Skip to content

Commit

Permalink
Merge branch 'master' into add_mantine_theme
Browse files Browse the repository at this point in the history
  • Loading branch information
ErnestTeluk committed Mar 14, 2024
2 parents 9f2a597 + 555cb98 commit b4dc6e1
Show file tree
Hide file tree
Showing 35 changed files with 530 additions and 2,114 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @radekmie @wadamek65
* @wadamek65 @kestarumper
1 change: 1 addition & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
Expand Down
4 changes: 2 additions & 2 deletions docs/uth-autofield-algorithm.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ const AutoField = createAutoField(props => {

## Overriding `AutoField`

To make it possible, all `AutoFields` created with the `createAutoField` are configurable. To adjust the components, use the React context available in `AutoField.componentDetectorContext`. You can use it as often as needed - in most apps once will be enough. Example:
If you want to alter the default behavior of `AutoField` and render a different component based on the props, you can do it using the React context available in `AutoField.componentDetectorContext`. You can use it as often as needed - once will be enough in most apps. Example:

```tsx
<AutoField.componentDetectorContext.Provider value={(props, uniforms) => /* ... */}>
<Application />
</AutoField.componentDetectorContext.Provider>
```

If you want to add an exception and then fallback to the existing algorithm, use `AutoField.defaultComponentDetector`. Example:
If you want to change the detector only partially, i.e., to render one additional field, and in other cases, use the default algorithm as a fallback, return `AutoField.defaultComponentDetector`. Example:

```tsx
<AutoField.componentDetectorContext.Provider
Expand Down
183 changes: 0 additions & 183 deletions packages/uniforms-antd/__tests__/ListField.tsx

This file was deleted.

52 changes: 0 additions & 52 deletions packages/uniforms-antd/__tests__/ListItemField.tsx

This file was deleted.

3 changes: 3 additions & 0 deletions packages/uniforms-antd/__tests__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,10 @@ describe('@RTL', () => {
suites.testListDelField(theme.ListDelField);
suites.testListField(theme.ListField, {
getListAddField: screen => screen.getByRole('img', { name: 'plus-square' }),
testTooltip: true,
testStyle: true,
});
suites.testListItemField(theme.ListItemField);
suites.testLongTextField(theme.LongTextField);
// FIXME: AntD number input doesn't work with new RTL test implementation
// suites.testNumField(antd.NumField);
Expand Down
Loading

0 comments on commit b4dc6e1

Please sign in to comment.