@strictly/react-form 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/.out/core/mobx/hooks.d.ts +5 -1
  2. package/.out/core/mobx/hooks.js +13 -3
  3. package/.out/core/mobx/specs/form_presenter.tests.js +3 -6
  4. package/.out/core/mobx/specs/{merge_field_adapters_with_two_way_converter.js → merge_field_adapters_with_two_way_converter.tests.js} +15 -16
  5. package/.out/core/mobx/specs/sub_form_field_adapters.tests.js +127 -12
  6. package/.out/core/mobx/sub_form_field_adapters.d.ts +6 -4
  7. package/.out/core/mobx/sub_form_field_adapters.js +28 -4
  8. package/.out/field_converters/nullable_to_boolean_converter.d.ts +2 -2
  9. package/.out/mantine/create_checkbox.js +1 -0
  10. package/.out/mantine/create_fields_view.d.ts +1 -1
  11. package/.out/mantine/create_fields_view.js +4 -4
  12. package/.out/mantine/create_form.d.ts +1 -1
  13. package/.out/mantine/create_list.d.ts +1 -1
  14. package/.out/mantine/create_pill.d.ts +1 -1
  15. package/.out/mantine/create_radio.d.ts +1 -1
  16. package/.out/mantine/create_radio_group.js +1 -0
  17. package/.out/mantine/create_text_input.js +7 -2
  18. package/.out/mantine/create_value_input.js +1 -0
  19. package/.out/mantine/error_renderer.d.ts +1 -1
  20. package/.out/mantine/error_renderer.js +1 -1
  21. package/.out/mantine/hooks.d.ts +9 -9
  22. package/.out/mantine/specs/checkbox_hooks.stories.d.ts +2 -6
  23. package/.out/mantine/specs/checkbox_hooks.stories.js +4 -16
  24. package/.out/mantine/specs/fields_view_hooks.stories.d.ts +1 -1
  25. package/.out/mantine/specs/fields_view_hooks.stories.js +6 -3
  26. package/.out/mantine/specs/form_hooks.stories.d.ts +2 -2
  27. package/.out/mantine/specs/form_hooks.stories.js +4 -1
  28. package/.out/mantine/specs/radio_group_hooks.stories.d.ts +2 -6
  29. package/.out/mantine/specs/radio_group_hooks.stories.js +5 -17
  30. package/.out/mantine/specs/select_hooks.stories.d.ts +2 -6
  31. package/.out/mantine/specs/select_hooks.stories.js +4 -16
  32. package/.out/mantine/specs/text_input_hooks.stories.d.ts +2 -5
  33. package/.out/mantine/specs/text_input_hooks.stories.js +5 -5
  34. package/.out/mantine/specs/value_input_hooks.stories.d.ts +2 -5
  35. package/.out/mantine/specs/value_input_hooks.stories.js +5 -5
  36. package/.out/mantine/types.d.ts +4 -2
  37. package/.out/tsconfig.tsbuildinfo +1 -1
  38. package/.turbo/turbo-build.log +8 -8
  39. package/.turbo/turbo-check-types.log +1 -1
  40. package/.turbo/turbo-release$colon$exports.log +1 -1
  41. package/core/mobx/hooks.ts +24 -6
  42. package/core/mobx/specs/form_presenter.tests.ts +6 -6
  43. package/core/mobx/specs/{merge_field_adapters_with_two_way_converter.ts → merge_field_adapters_with_two_way_converter.tests.ts} +16 -16
  44. package/core/mobx/specs/sub_form_field_adapters.tests.ts +193 -17
  45. package/core/mobx/sub_form_field_adapters.ts +74 -11
  46. package/dist/index.cjs +77 -32
  47. package/dist/index.d.cts +25 -18
  48. package/dist/index.d.ts +25 -18
  49. package/dist/index.js +68 -21
  50. package/field_converters/nullable_to_boolean_converter.ts +2 -3
  51. package/mantine/create_checkbox.tsx +2 -1
  52. package/mantine/create_fields_view.tsx +17 -14
  53. package/mantine/create_form.tsx +2 -2
  54. package/mantine/create_list.tsx +1 -1
  55. package/mantine/create_pill.tsx +1 -1
  56. package/mantine/create_radio.tsx +1 -1
  57. package/mantine/create_radio_group.tsx +6 -2
  58. package/mantine/create_text_input.tsx +9 -3
  59. package/mantine/create_value_input.tsx +2 -1
  60. package/mantine/error_renderer.ts +1 -1
  61. package/mantine/hooks.tsx +19 -14
  62. package/mantine/specs/__snapshots__/checkbox_hooks.tests.tsx.snap +1 -64
  63. package/mantine/specs/__snapshots__/fields_view_hooks.tests.tsx.snap +52 -52
  64. package/mantine/specs/__snapshots__/radio_group_hooks.tests.tsx.snap +1 -179
  65. package/mantine/specs/__snapshots__/select_hooks.tests.tsx.snap +1 -83
  66. package/mantine/specs/__snapshots__/text_input_hooks.tests.tsx.snap +27 -27
  67. package/mantine/specs/__snapshots__/value_input_hooks.tests.tsx.snap +31 -31
  68. package/mantine/specs/checkbox_hooks.stories.tsx +5 -21
  69. package/mantine/specs/fields_view_hooks.stories.tsx +16 -4
  70. package/mantine/specs/form_hooks.stories.tsx +10 -3
  71. package/mantine/specs/radio_group_hooks.stories.tsx +6 -20
  72. package/mantine/specs/select_hooks.stories.tsx +5 -21
  73. package/mantine/specs/text_input_hooks.stories.tsx +5 -8
  74. package/mantine/specs/value_input_hooks.stories.tsx +5 -8
  75. package/mantine/types.ts +7 -3
  76. package/package.json +2 -1
  77. /package/.out/core/mobx/specs/{merge_field_adapters_with_two_way_converter.d.ts → merge_field_adapters_with_two_way_converter.tests.d.ts} +0 -0
@@ -18,7 +18,7 @@ export function createFieldsView<
18
18
  valuePath: K,
19
19
  FieldsView: ComponentType<P>,
20
20
  observableProps: FieldsViewProps<F>,
21
- ): MantineFieldComponent<FieldsViewProps<P['fields']>, P> {
21
+ ): MantineFieldComponent<FieldsViewProps<P['fields']>, P, never> {
22
22
  function toKey(subKey: string | number | symbol): string {
23
23
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
24
24
  return (subKey as string).replace('$', valuePath as string)
@@ -49,18 +49,22 @@ export function createFieldsView<
49
49
  }
50
50
 
51
51
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
52
- return observer(function (props: ComponentProps<MantineFieldComponent<FieldsViewProps<P['fields']>, P>>) {
52
+ return observer(function (props: ComponentProps<MantineFieldComponent<FieldsViewProps<P['fields']>, P, never>>) {
53
53
  // convert fields to sub-fields
54
- const subFields = Object.entries(observableProps.fields).reduce<Record<string, unknown>>((acc, [
55
- fieldKey,
56
- fieldValue,
57
- ]) => {
54
+ const subFields = Object.entries(observableProps.fields).reduce<Record<string, unknown>>(
55
+ (acc, [
56
+ fieldKey,
57
+ fieldValue,
58
+ ]) => {
59
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
60
+ if (fieldKey.startsWith(valuePath as string)) {
61
+ acc[toSubKey(fieldKey)] = fieldValue
62
+ }
63
+ return acc
64
+ },
58
65
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
59
- if (fieldKey.startsWith(valuePath as string)) {
60
- acc[toSubKey(fieldKey)] = fieldValue
61
- }
62
- return acc
63
- }, {})
66
+ {} as P['fields'],
67
+ )
64
68
 
65
69
  return (
66
70
  <FieldsView
@@ -69,13 +73,12 @@ export function createFieldsView<
69
73
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/consistent-type-assertions
70
74
  ...props as any
71
75
  }
72
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
73
- fields={subFields as P['fields']}
76
+ fields={subFields}
74
77
  onFieldBlur={onFieldBlur}
75
78
  onFieldFocus={onFieldFocus}
76
79
  onFieldSubmit={onFieldSubmit}
77
80
  onFieldValueChange={onFieldValueChange}
78
81
  />
79
82
  )
80
- }) as unknown as MantineFieldComponent<FieldsViewProps<P['fields']>, P>
83
+ }) as unknown as MantineFieldComponent<FieldsViewProps<P['fields']>, P, never>
81
84
  }
@@ -21,7 +21,7 @@ export function createForm<
21
21
  valuePath: K,
22
22
  Form: ComponentType<P>,
23
23
  observableProps: FieldsViewProps<F>,
24
- ): MantineFieldComponent<FormProps<ValueTypeOfField<F[K]>>, P> {
24
+ ): MantineFieldComponent<FormProps<ValueTypeOfField<F[K]>>, P, never> {
25
25
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
26
26
  return observer((props: ComponentProps<MantineFieldComponent<FormProps<ValueTypeOfField<F[K]>>, P>>) => {
27
27
  const { value } = observableProps.fields[valuePath]
@@ -39,5 +39,5 @@ export function createForm<
39
39
  value={value}
40
40
  />
41
41
  )
42
- }) as MantineFieldComponent<FormProps<ValueTypeOfField<F[K]>>, P>
42
+ }) as MantineFieldComponent<FormProps<ValueTypeOfField<F[K]>>, P, never>
43
43
  }
@@ -29,7 +29,7 @@ export function createList<
29
29
  this: MantineForm<F>,
30
30
  valuePath: K,
31
31
  List: ComponentType<Props>,
32
- ): MantineFieldComponent<SuppliedListProps<ElementOfArray<ValueTypeOfField<F[K]>>>, Props> {
32
+ ): MantineFieldComponent<SuppliedListProps<ElementOfArray<ValueTypeOfField<F[K]>>>, Props, never> {
33
33
  const propSource = () => {
34
34
  const values = [...this.fields[valuePath].value]
35
35
  return {
@@ -25,7 +25,7 @@ export function createPill<
25
25
  this: MantineForm<F>,
26
26
  valuePath: K,
27
27
  Pill: ComponentType<Props>,
28
- ): MantineFieldComponent<SuppliedPillProps, Props> {
28
+ ): MantineFieldComponent<SuppliedPillProps, Props, never> {
29
29
  const propSource = () => {
30
30
  const {
31
31
  readonly,
@@ -22,7 +22,7 @@ export function createRadio<
22
22
  valuePath: K,
23
23
  value: ValueTypeOfField<F[K]>,
24
24
  Radio: ComponentType<Props>,
25
- ): MantineFieldComponent<SuppliedRadioProps, Props> {
25
+ ): MantineFieldComponent<SuppliedRadioProps, Props, never> {
26
26
  const propSource = () => {
27
27
  return {
28
28
  disabled: this.fields[valuePath].readonly,
@@ -68,6 +68,10 @@ export function createRadioGroup<
68
68
  onKeyUp,
69
69
  }
70
70
  }
71
-
72
- return createUnsafePartialObserverComponent(RadioGroup, propSource, ['ErrorRenderer'])
71
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
72
+ return createUnsafePartialObserverComponent(RadioGroup, propSource, ['ErrorRenderer']) as MantineFieldComponent<
73
+ SuppliedRadioGroupProps,
74
+ Props,
75
+ ErrorOfField<F[K]>
76
+ >
73
77
  }
@@ -59,13 +59,18 @@ export function createTextInput<
59
59
  }: {
60
60
  ErrorRenderer?: ErrorRenderer<ErrorOfField<F[K]>>,
61
61
  }) => {
62
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
63
+ const field = this.fields[valuePath as string]
64
+ if (field == null) {
65
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
66
+ throw new Error(`invalid field ${valuePath as string}`)
67
+ }
62
68
  const {
63
69
  readonly,
64
70
  required,
65
71
  value,
66
72
  error,
67
- // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
68
- } = this.fields[valuePath as string]
73
+ } = field
69
74
  return {
70
75
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
71
76
  name: valuePath as string,
@@ -79,6 +84,7 @@ export function createTextInput<
79
84
  onKeyUp,
80
85
  }
81
86
  }
87
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
82
88
  return createUnsafePartialObserverComponent<
83
89
  typeof TextInput,
84
90
  SuppliedTextInputProps,
@@ -88,5 +94,5 @@ export function createTextInput<
88
94
  TextInput,
89
95
  propSource,
90
96
  ['ErrorRenderer'],
91
- )
97
+ ) as MantineFieldComponent<SuppliedTextInputProps, Props, ErrorOfField<F[K]>>
92
98
  }
@@ -77,6 +77,7 @@ export function createValueInput<
77
77
  onKeyUp,
78
78
  }
79
79
  }
80
+ // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
80
81
  return createUnsafePartialObserverComponent<
81
82
  typeof ValueInput,
82
83
  SuppliedValueInputProps<ValueTypeOfField<F[K]>>,
@@ -86,5 +87,5 @@ export function createValueInput<
86
87
  ValueInput,
87
88
  propSource,
88
89
  ['ErrorRenderer'],
89
- )
90
+ ) as MantineFieldComponent<SuppliedValueInputProps<ValueTypeOfField<F[K]>>, Props, ErrorOfField<F[K]>>
90
91
  }
@@ -11,5 +11,5 @@ export function DefaultErrorRenderer({
11
11
  error,
12
12
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
13
  }: ErrorRendererProps<any>) {
14
- return error
14
+ return JSON.stringify(error)
15
15
  }
package/mantine/hooks.tsx CHANGED
@@ -209,7 +209,7 @@ class MantineFormImpl<
209
209
 
210
210
  textInput<
211
211
  K extends keyof StringFieldsOfFields<F>,
212
- >(valuePath: K): MantineFieldComponent<SuppliedTextInputProps, TextInputProps>
212
+ >(valuePath: K): MantineFieldComponent<SuppliedTextInputProps, TextInputProps, ErrorOfField<F[K]>>
213
213
  textInput<
214
214
  K extends keyof StringFieldsOfFields<F>,
215
215
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -217,7 +217,7 @@ class MantineFormImpl<
217
217
  >(
218
218
  valuePath: K,
219
219
  TextInput?: ComponentType<P>,
220
- ): MantineFieldComponent<SuppliedTextInputProps, P>
220
+ ): MantineFieldComponent<SuppliedTextInputProps, P, ErrorOfField<F[K]>>
221
221
  textInput<
222
222
  K extends keyof StringFieldsOfFields<F>,
223
223
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -264,7 +264,7 @@ class MantineFormImpl<
264
264
 
265
265
  checkbox<
266
266
  K extends keyof BooleanFieldsOfFields<F>,
267
- >(valuePath: K): MantineFieldComponent<SuppliedCheckboxProps, CheckboxProps>
267
+ >(valuePath: K): MantineFieldComponent<SuppliedCheckboxProps, CheckboxProps, ErrorOfField<F[K]>>
268
268
  checkbox<
269
269
  K extends keyof BooleanFieldsOfFields<F>,
270
270
  P extends SuppliedCheckboxProps,
@@ -282,19 +282,21 @@ class MantineFormImpl<
282
282
  valuePath,
283
283
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
284
284
  Checkbox as ComponentType<SuppliedCheckboxProps>,
285
- ) as MantineFieldComponent<SuppliedCheckboxProps, P>
285
+ ) as MantineFieldComponent<SuppliedCheckboxProps, P, ErrorOfField<F[K]>>
286
286
  }
287
287
 
288
+ // this should work?
288
289
  radioGroup<
289
290
  K extends keyof StringFieldsOfFields<F>,
290
- >(valuePath: K): MantineFieldComponent<SuppliedRadioGroupProps, RadioGroupProps>
291
+ P extends RadioGroupProps = RadioGroupProps,
292
+ >(valuePath: K): MantineFieldComponent<SuppliedRadioGroupProps, P, ErrorOfField<F[K]>>
291
293
  radioGroup<
292
294
  K extends keyof StringFieldsOfFields<F>,
293
295
  P extends SuppliedRadioGroupProps,
294
296
  >(
295
297
  valuePath: K,
296
298
  RadioGroup: ComponentType<P>,
297
- ): MantineFieldComponent<SuppliedRadioGroupProps, P>
299
+ ): MantineFieldComponent<SuppliedRadioGroupProps, P, ErrorOfField<F[K]>>
298
300
  radioGroup<
299
301
  K extends keyof StringFieldsOfFields<F>,
300
302
  P extends SuppliedRadioGroupProps,
@@ -340,7 +342,7 @@ class MantineFormImpl<
340
342
  value,
341
343
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
342
344
  Radio as ComponentType<SuppliedRadioProps>,
343
- ) as MantineFieldComponent<SuppliedRadioProps, P>
345
+ ) as MantineFieldComponent<SuppliedRadioProps, P, ErrorOfField<F[K]>>
344
346
  }
345
347
 
346
348
  pill<
@@ -352,7 +354,7 @@ class MantineFormImpl<
352
354
  >(
353
355
  valuePath: K,
354
356
  Pill: ComponentType<P>,
355
- ): MantineFieldComponent<SuppliedPillProps, P>
357
+ ): MantineFieldComponent<SuppliedPillProps, P, ErrorOfField<F[K]>>
356
358
  pill<
357
359
  K extends keyof AllFieldsOfFields<F>,
358
360
  P extends SuppliedPillProps,
@@ -373,7 +375,8 @@ class MantineFormImpl<
373
375
  K extends keyof ListFieldsOfFields<F>,
374
376
  >(valuePath: K): MantineFieldComponent<
375
377
  SuppliedListProps<`${K}.${number}`>,
376
- ComponentProps<typeof DefaultList<ElementOfArray<F[K]['value']>, K>>
378
+ ComponentProps<typeof DefaultList<ElementOfArray<F[K]['value']>, K>>,
379
+ never
377
380
  > {
378
381
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
379
382
  return this.listCache.retrieveOrCreate(
@@ -382,7 +385,7 @@ class MantineFormImpl<
382
385
  ) as MantineFieldComponent<
383
386
  SuppliedListProps<`${K}.${number}`>,
384
387
  ComponentProps<typeof DefaultList<ElementOfArray<F[K]['value']>, K>>,
385
- ErrorOfField<F[K]>
388
+ never
386
389
  >
387
390
  }
388
391
 
@@ -391,7 +394,8 @@ class MantineFormImpl<
391
394
  P extends FieldsViewProps<Fields> = FieldsViewProps<SubFormFields<F, K>>,
392
395
  >(valuePath: K, FieldsView: ComponentType<P>): MantineFieldComponent<
393
396
  FieldsViewProps<P['fields']>,
394
- P
397
+ P,
398
+ never
395
399
  > {
396
400
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
397
401
  return this.fieldsViewCache.retrieveOrCreate(
@@ -402,7 +406,8 @@ class MantineFormImpl<
402
406
  this,
403
407
  ) as unknown as MantineFieldComponent<
404
408
  FieldsViewProps<P['fields']>,
405
- P
409
+ P,
410
+ never
406
411
  >
407
412
  }
408
413
 
@@ -412,7 +417,7 @@ class MantineFormImpl<
412
417
  >(
413
418
  valuePath: K,
414
419
  Form: ComponentType<P>,
415
- ): MantineFieldComponent<FormProps<ValueTypeOfField<F[K]>>, P> {
420
+ ): MantineFieldComponent<FormProps<ValueTypeOfField<F[K]>>, P, never> {
416
421
  // strip props from component since we lose information in the cache
417
422
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
418
423
  return this.formCache.retrieveOrCreate(
@@ -421,6 +426,6 @@ class MantineFormImpl<
421
426
  // eslint-disable-next-line @typescript-eslint/consistent-type-assertions
422
427
  Form as ComponentType,
423
428
  this,
424
- ) as unknown as MantineFieldComponent<FormProps<ValueTypeOfField<F[K]>>, P>
429
+ ) as unknown as MantineFieldComponent<FormProps<ValueTypeOfField<F[K]>>, P, never>
425
430
  }
426
431
  }
@@ -1,68 +1,5 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
- exports[`mantine checkbox hooks > renders CustomError 1`] = `
4
- <div>
5
- <style
6
- data-mantine-styles="classes"
7
- >
8
- @media (max-width: 35.99375em) {.mantine-visible-from-xs {display: none !important;}}@media (min-width: 36em) {.mantine-hidden-from-xs {display: none !important;}}@media (max-width: 47.99375em) {.mantine-visible-from-sm {display: none !important;}}@media (min-width: 48em) {.mantine-hidden-from-sm {display: none !important;}}@media (max-width: 61.99375em) {.mantine-visible-from-md {display: none !important;}}@media (min-width: 62em) {.mantine-hidden-from-md {display: none !important;}}@media (max-width: 74.99375em) {.mantine-visible-from-lg {display: none !important;}}@media (min-width: 75em) {.mantine-hidden-from-lg {display: none !important;}}@media (max-width: 87.99375em) {.mantine-visible-from-xl {display: none !important;}}@media (min-width: 88em) {.mantine-hidden-from-xl {display: none !important;}}
9
- </style>
10
- <div
11
- class="m_bf2d988c mantine-Checkbox-root m_5f75b09e mantine-Checkbox-root"
12
- data-checked="true"
13
- data-label-position="right"
14
- style="--checkbox-color: var(--mantine-color-blue-filled);"
15
- >
16
- <div
17
- class="m_5f6e695e mantine-Checkbox-body"
18
- >
19
- <div
20
- class="m_26062bec mantine-Checkbox-inner"
21
- data-label-position="right"
22
- >
23
- <input
24
- checked=""
25
- class="mantine-focus-auto m_26063560 mantine-Checkbox-input"
26
- data-error="true"
27
- id="mantine-0cyk5rcyk"
28
- name="$"
29
- type="checkbox"
30
- />
31
- <svg
32
- aria-hidden="true"
33
- class="m_bf295423 mantine-Checkbox-icon"
34
- fill="none"
35
- viewBox="0 0 10 7"
36
- xmlns="http://www.w3.org/2000/svg"
37
- >
38
- <path
39
- clip-rule="evenodd"
40
- d="M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z"
41
- fill="currentColor"
42
- fill-rule="evenodd"
43
- />
44
- </svg>
45
- </div>
46
- <div
47
- class="m_d3ea56bb mantine-Checkbox-labelWrapper"
48
- >
49
- <label
50
- class="m_8ee546b8 mantine-Checkbox-label"
51
- for="mantine-0cyk5rcyk"
52
- >
53
- Checkbox
54
- </label>
55
- <p
56
- class="m_8e8a99cc mantine-Checkbox-error m_8f816625 mantine-InputWrapper-error"
57
- >
58
- custom error
59
- </p>
60
- </div>
61
- </div>
62
- </div>
63
- </div>
64
- `;
65
-
66
3
  exports[`mantine checkbox hooks > renders Disabled 1`] = `
67
4
  <div>
68
5
  <style
@@ -176,7 +113,7 @@ exports[`mantine checkbox hooks > renders Error 1`] = `
176
113
  <p
177
114
  class="m_8e8a99cc mantine-Checkbox-error m_8f816625 mantine-InputWrapper-error"
178
115
  >
179
- error
116
+ Error error
180
117
  </p>
181
118
  </div>
182
119
  </div>
@@ -1,6 +1,6 @@
1
1
  // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2
2
 
3
- exports[`field view hooks > renders CustomError 1`] = `
3
+ exports[`field view hooks > renders Disabled 1`] = `
4
4
  <div>
5
5
  <style
6
6
  data-mantine-styles="classes"
@@ -13,7 +13,6 @@ exports[`field view hooks > renders CustomError 1`] = `
13
13
  >
14
14
  <div
15
15
  class="m_46b77525 mantine-InputWrapper-root mantine-TextInput-root"
16
- data-error="true"
17
16
  >
18
17
  <label
19
18
  class="m_8fdc1311 mantine-InputWrapper-label mantine-TextInput-label"
@@ -24,27 +23,20 @@ exports[`field view hooks > renders CustomError 1`] = `
24
23
  </label>
25
24
  <div
26
25
  class="m_6c018570 mantine-Input-wrapper mantine-TextInput-wrapper"
27
- data-error="true"
26
+ data-disabled="true"
28
27
  data-variant="default"
29
- style="--input-margin-bottom: calc(var(--mantine-spacing-xs) / 2);"
30
28
  >
31
29
  <input
32
- aria-describedby="mantine-0cyk5rcyk-error"
33
- aria-invalid="true"
30
+ aria-invalid="false"
34
31
  class="m_8fb7ebe7 mantine-Input-input mantine-TextInput-input"
35
- data-error="true"
32
+ data-disabled="true"
36
33
  data-variant="default"
34
+ disabled=""
37
35
  id="mantine-0cyk5rcyk"
38
36
  name="$"
39
37
  value="xxx"
40
38
  />
41
39
  </div>
42
- <p
43
- class="m_8f816625 mantine-InputWrapper-error mantine-TextInput-error"
44
- id="mantine-0cyk5rcyk-error"
45
- >
46
- form error
47
- </p>
48
40
  </div>
49
41
  <div
50
42
  class="m_6d731127 mantine-Stack-root"
@@ -52,7 +44,6 @@ exports[`field view hooks > renders CustomError 1`] = `
52
44
  >
53
45
  <div
54
46
  class="m_46b77525 mantine-InputWrapper-root mantine-TextInput-root"
55
- data-error="true"
56
47
  >
57
48
  <label
58
49
  class="m_8fdc1311 mantine-InputWrapper-label mantine-TextInput-label"
@@ -63,27 +54,20 @@ exports[`field view hooks > renders CustomError 1`] = `
63
54
  </label>
64
55
  <div
65
56
  class="m_6c018570 mantine-Input-wrapper mantine-TextInput-wrapper"
66
- data-error="true"
57
+ data-disabled="true"
67
58
  data-variant="default"
68
- style="--input-margin-bottom: calc(var(--mantine-spacing-xs) / 2);"
69
59
  >
70
60
  <input
71
- aria-describedby="mantine-0px4bipx4-error"
72
- aria-invalid="true"
61
+ aria-invalid="false"
73
62
  class="m_8fb7ebe7 mantine-Input-input mantine-TextInput-input"
74
- data-error="true"
63
+ data-disabled="true"
75
64
  data-variant="default"
65
+ disabled=""
76
66
  id="mantine-0px4bipx4"
77
67
  name="$"
78
- value="xxx"
68
+ value="yyy"
79
69
  />
80
70
  </div>
81
- <p
82
- class="m_8f816625 mantine-InputWrapper-error mantine-TextInput-error"
83
- id="mantine-0px4bipx4-error"
84
- >
85
- sub form error
86
- </p>
87
71
  </div>
88
72
  <button
89
73
  class="mantine-focus-auto mantine-active m_77c9d27d mantine-Button-root m_87cf2631 mantine-UnstyledButton-root"
@@ -105,7 +89,7 @@ exports[`field view hooks > renders CustomError 1`] = `
105
89
  </div>
106
90
  `;
107
91
 
108
- exports[`field view hooks > renders Disabled 1`] = `
92
+ exports[`field view hooks > renders Empty 1`] = `
109
93
  <div>
110
94
  <style
111
95
  data-mantine-styles="classes"
@@ -121,25 +105,22 @@ exports[`field view hooks > renders Disabled 1`] = `
121
105
  >
122
106
  <label
123
107
  class="m_8fdc1311 mantine-InputWrapper-label mantine-TextInput-label"
124
- for="mantine-0cyk5rcyk"
125
- id="mantine-0cyk5rcyk-label"
108
+ for="mantine-0px4bipx4"
109
+ id="mantine-0px4bipx4-label"
126
110
  >
127
111
  fields view
128
112
  </label>
129
113
  <div
130
114
  class="m_6c018570 mantine-Input-wrapper mantine-TextInput-wrapper"
131
- data-disabled="true"
132
115
  data-variant="default"
133
116
  >
134
117
  <input
135
118
  aria-invalid="false"
136
119
  class="m_8fb7ebe7 mantine-Input-input mantine-TextInput-input"
137
- data-disabled="true"
138
120
  data-variant="default"
139
- disabled=""
140
- id="mantine-0cyk5rcyk"
121
+ id="mantine-0px4bipx4"
141
122
  name="$"
142
- value="xxx"
123
+ value=""
143
124
  />
144
125
  </div>
145
126
  </div>
@@ -152,25 +133,22 @@ exports[`field view hooks > renders Disabled 1`] = `
152
133
  >
153
134
  <label
154
135
  class="m_8fdc1311 mantine-InputWrapper-label mantine-TextInput-label"
155
- for="mantine-0px4bipx4"
156
- id="mantine-0px4bipx4-label"
136
+ for="mantine-12voha2vo"
137
+ id="mantine-12voha2vo-label"
157
138
  >
158
139
  sub fields view
159
140
  </label>
160
141
  <div
161
142
  class="m_6c018570 mantine-Input-wrapper mantine-TextInput-wrapper"
162
- data-disabled="true"
163
143
  data-variant="default"
164
144
  >
165
145
  <input
166
146
  aria-invalid="false"
167
147
  class="m_8fb7ebe7 mantine-Input-input mantine-TextInput-input"
168
- data-disabled="true"
169
148
  data-variant="default"
170
- disabled=""
171
- id="mantine-0px4bipx4"
149
+ id="mantine-12voha2vo"
172
150
  name="$"
173
- value="yyy"
151
+ value=""
174
152
  />
175
153
  </div>
176
154
  </div>
@@ -194,7 +172,7 @@ exports[`field view hooks > renders Disabled 1`] = `
194
172
  </div>
195
173
  `;
196
174
 
197
- exports[`field view hooks > renders Empty 1`] = `
175
+ exports[`field view hooks > renders Errors 1`] = `
198
176
  <div>
199
177
  <style
200
178
  data-mantine-styles="classes"
@@ -207,27 +185,38 @@ exports[`field view hooks > renders Empty 1`] = `
207
185
  >
208
186
  <div
209
187
  class="m_46b77525 mantine-InputWrapper-root mantine-TextInput-root"
188
+ data-error="true"
210
189
  >
211
190
  <label
212
191
  class="m_8fdc1311 mantine-InputWrapper-label mantine-TextInput-label"
213
- for="mantine-0px4bipx4"
214
- id="mantine-0px4bipx4-label"
192
+ for="mantine-0cyk5rcyk"
193
+ id="mantine-0cyk5rcyk-label"
215
194
  >
216
195
  fields view
217
196
  </label>
218
197
  <div
219
198
  class="m_6c018570 mantine-Input-wrapper mantine-TextInput-wrapper"
199
+ data-error="true"
220
200
  data-variant="default"
201
+ style="--input-margin-bottom: calc(var(--mantine-spacing-xs) / 2);"
221
202
  >
222
203
  <input
223
- aria-invalid="false"
204
+ aria-describedby="mantine-0cyk5rcyk-error"
205
+ aria-invalid="true"
224
206
  class="m_8fb7ebe7 mantine-Input-input mantine-TextInput-input"
207
+ data-error="true"
225
208
  data-variant="default"
226
- id="mantine-0px4bipx4"
209
+ id="mantine-0cyk5rcyk"
227
210
  name="$"
228
- value=""
211
+ value="xxx"
229
212
  />
230
213
  </div>
214
+ <p
215
+ class="m_8f816625 mantine-InputWrapper-error mantine-TextInput-error"
216
+ id="mantine-0cyk5rcyk-error"
217
+ >
218
+ error form error
219
+ </p>
231
220
  </div>
232
221
  <div
233
222
  class="m_6d731127 mantine-Stack-root"
@@ -235,27 +224,38 @@ exports[`field view hooks > renders Empty 1`] = `
235
224
  >
236
225
  <div
237
226
  class="m_46b77525 mantine-InputWrapper-root mantine-TextInput-root"
227
+ data-error="true"
238
228
  >
239
229
  <label
240
230
  class="m_8fdc1311 mantine-InputWrapper-label mantine-TextInput-label"
241
- for="mantine-12voha2vo"
242
- id="mantine-12voha2vo-label"
231
+ for="mantine-0px4bipx4"
232
+ id="mantine-0px4bipx4-label"
243
233
  >
244
234
  sub fields view
245
235
  </label>
246
236
  <div
247
237
  class="m_6c018570 mantine-Input-wrapper mantine-TextInput-wrapper"
238
+ data-error="true"
248
239
  data-variant="default"
240
+ style="--input-margin-bottom: calc(var(--mantine-spacing-xs) / 2);"
249
241
  >
250
242
  <input
251
- aria-invalid="false"
243
+ aria-describedby="mantine-0px4bipx4-error"
244
+ aria-invalid="true"
252
245
  class="m_8fb7ebe7 mantine-Input-input mantine-TextInput-input"
246
+ data-error="true"
253
247
  data-variant="default"
254
- id="mantine-12voha2vo"
248
+ id="mantine-0px4bipx4"
255
249
  name="$"
256
- value=""
250
+ value="xxx"
257
251
  />
258
252
  </div>
253
+ <p
254
+ class="m_8f816625 mantine-InputWrapper-error mantine-TextInput-error"
255
+ id="mantine-0px4bipx4-error"
256
+ >
257
+ error sub form error
258
+ </p>
259
259
  </div>
260
260
  <button
261
261
  class="mantine-focus-auto mantine-active m_77c9d27d mantine-Button-root m_87cf2631 mantine-UnstyledButton-root"