@strictly/react-form 0.0.4 → 0.0.6
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.
- package/.out/core/mobx/field_adapter_builder.d.ts +1 -1
- package/.out/core/mobx/field_adapter_builder.js +1 -2
- package/.out/core/mobx/hooks.d.ts +10 -0
- package/.out/core/mobx/hooks.js +47 -0
- package/.out/core/props.d.ts +2 -2
- package/.out/index.d.ts +1 -0
- package/.out/index.js +1 -0
- package/.out/mantine/create_fields_view.d.ts +7 -0
- package/.out/mantine/{create_sub_form.js → create_fields_view.js} +4 -5
- package/.out/mantine/create_form.d.ts +7 -0
- package/.out/mantine/create_form.js +13 -0
- package/.out/mantine/create_list.d.ts +5 -4
- package/.out/mantine/create_list.js +4 -2
- package/.out/mantine/hooks.d.ts +8 -5
- package/.out/mantine/hooks.js +17 -7
- package/.out/mantine/specs/checkbox_hooks.stories.d.ts +2 -2
- package/.out/mantine/specs/checkbox_hooks.stories.js +2 -2
- package/.out/mantine/specs/{sub_form_hooks.stories.d.ts → fields_view_hooks.stories.d.ts} +2 -2
- package/.out/mantine/specs/{sub_form_hooks.stories.js → fields_view_hooks.stories.js} +9 -8
- package/.out/mantine/specs/fields_view_hooks.tests.d.ts +1 -0
- package/.out/mantine/specs/fields_view_hooks.tests.js +12 -0
- package/.out/mantine/specs/form_hooks.stories.d.ts +12 -0
- package/.out/mantine/specs/form_hooks.stories.js +60 -0
- package/.out/mantine/specs/form_hooks.tests.d.ts +1 -0
- package/.out/mantine/specs/form_hooks.tests.js +12 -0
- package/.out/mantine/specs/list_hooks.stories.d.ts +2 -2
- package/.out/mantine/specs/list_hooks.stories.js +8 -8
- package/.out/mantine/specs/radio_group_hooks.stories.d.ts +2 -2
- package/.out/mantine/specs/radio_group_hooks.stories.js +2 -2
- package/.out/mantine/specs/select_hooks.stories.d.ts +2 -2
- package/.out/mantine/specs/select_hooks.stories.js +2 -2
- package/.out/mantine/specs/text_input_hooks.stories.d.ts +2 -2
- package/.out/mantine/specs/text_input_hooks.stories.js +2 -2
- package/.out/mantine/specs/value_input_hooks.stories.d.ts +2 -2
- package/.out/mantine/specs/value_input_hooks.stories.js +2 -2
- package/.out/tsconfig.tsbuildinfo +1 -1
- package/.turbo/turbo-build.log +7 -7
- package/.turbo/turbo-check-types.log +1 -1
- package/core/mobx/field_adapter_builder.ts +3 -4
- package/core/mobx/hooks.ts +94 -0
- package/core/props.ts +2 -2
- package/dist/index.cjs +175 -95
- package/dist/index.d.cts +48 -39
- package/dist/index.d.ts +48 -39
- package/dist/index.js +170 -86
- package/index.ts +1 -0
- package/mantine/{create_sub_form.tsx → create_fields_view.tsx} +27 -16
- package/mantine/create_form.tsx +43 -0
- package/mantine/create_list.tsx +10 -4
- package/mantine/hooks.tsx +51 -16
- package/mantine/specs/__snapshots__/fields_view_hooks.tests.tsx.snap +460 -0
- package/mantine/specs/__snapshots__/form_hooks.tests.tsx.snap +273 -0
- package/mantine/specs/__snapshots__/list_hooks.tests.tsx.snap +56 -8
- package/mantine/specs/checkbox_hooks.stories.tsx +4 -4
- package/mantine/specs/{sub_form_hooks.stories.tsx → fields_view_hooks.stories.tsx} +23 -11
- package/mantine/specs/fields_view_hooks.tests.tsx +15 -0
- package/mantine/specs/form_hooks.stories.tsx +107 -0
- package/mantine/specs/form_hooks.tests.tsx +15 -0
- package/mantine/specs/list_hooks.stories.tsx +20 -10
- package/mantine/specs/radio_group_hooks.stories.tsx +4 -4
- package/mantine/specs/select_hooks.stories.tsx +4 -4
- package/mantine/specs/text_input_hooks.stories.tsx +4 -4
- package/mantine/specs/value_input_hooks.stories.tsx +4 -4
- package/package.json +1 -1
- package/.out/field_converters/list_converter.d.ts +0 -2
- package/.out/field_converters/list_converter.js +0 -13
- package/.out/mantine/create_sub_form.d.ts +0 -6
- package/field_converters/list_converter.ts +0 -20
package/mantine/hooks.tsx
CHANGED
|
@@ -13,8 +13,12 @@ import {
|
|
|
13
13
|
} from '@mantine/core'
|
|
14
14
|
import {
|
|
15
15
|
Cache,
|
|
16
|
+
type ElementOfArray,
|
|
16
17
|
} from '@strictly/base'
|
|
17
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
type FieldsViewProps,
|
|
20
|
+
type FormProps,
|
|
21
|
+
} from 'core/props'
|
|
18
22
|
import {
|
|
19
23
|
observable,
|
|
20
24
|
runInAction,
|
|
@@ -40,6 +44,8 @@ import {
|
|
|
40
44
|
createCheckbox,
|
|
41
45
|
type SuppliedCheckboxProps,
|
|
42
46
|
} from './create_checkbox'
|
|
47
|
+
import { createFieldsView } from './create_fields_view'
|
|
48
|
+
import { createForm } from './create_form'
|
|
43
49
|
import {
|
|
44
50
|
createList,
|
|
45
51
|
DefaultList,
|
|
@@ -57,7 +63,6 @@ import {
|
|
|
57
63
|
createRadioGroup,
|
|
58
64
|
type SuppliedRadioGroupProps,
|
|
59
65
|
} from './create_radio_group'
|
|
60
|
-
import { createSubForm } from './create_sub_form'
|
|
61
66
|
import {
|
|
62
67
|
createTextInput,
|
|
63
68
|
type SuppliedTextInputProps,
|
|
@@ -77,7 +82,7 @@ function SimpleSelect(props: SelectProps & {
|
|
|
77
82
|
return <Select {...props} />
|
|
78
83
|
}
|
|
79
84
|
|
|
80
|
-
export function
|
|
85
|
+
export function useMantineFormFields<
|
|
81
86
|
F extends Fields,
|
|
82
87
|
>({
|
|
83
88
|
onFieldValueChange,
|
|
@@ -85,7 +90,7 @@ export function useMantineForm<
|
|
|
85
90
|
onFieldFocus,
|
|
86
91
|
onFieldSubmit,
|
|
87
92
|
fields,
|
|
88
|
-
}:
|
|
93
|
+
}: FieldsViewProps<F>): MantineFormImpl<F> {
|
|
89
94
|
const form = useMemo(
|
|
90
95
|
function () {
|
|
91
96
|
return new MantineFormImpl(fields)
|
|
@@ -176,14 +181,20 @@ class MantineFormImpl<
|
|
|
176
181
|
> = new Cache(
|
|
177
182
|
createList.bind(this),
|
|
178
183
|
)
|
|
179
|
-
private readonly
|
|
184
|
+
private readonly fieldsViewCache: Cache<
|
|
180
185
|
// the cache cannot reference keys, so we just use any
|
|
181
186
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
182
|
-
[keyof AllFieldsOfFields<F>, ComponentType<any>,
|
|
187
|
+
[keyof AllFieldsOfFields<F>, ComponentType<any>, FieldsViewProps<F>],
|
|
183
188
|
ComponentType
|
|
184
189
|
> = new Cache(
|
|
185
|
-
|
|
190
|
+
createFieldsView.bind(this),
|
|
186
191
|
)
|
|
192
|
+
private readonly formCache: Cache<
|
|
193
|
+
// the cache cannot reference keys, so we just use any
|
|
194
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
195
|
+
[keyof AllFieldsOfFields<F>, ComponentType<any>, FieldsViewProps<F>],
|
|
196
|
+
ComponentType
|
|
197
|
+
> = new Cache(createForm.bind(this))
|
|
187
198
|
|
|
188
199
|
@observable.ref
|
|
189
200
|
accessor fields: F
|
|
@@ -362,7 +373,7 @@ class MantineFormImpl<
|
|
|
362
373
|
K extends keyof ListFieldsOfFields<F>,
|
|
363
374
|
>(valuePath: K): MantineFieldComponent<
|
|
364
375
|
SuppliedListProps<`${K}.${number}`>,
|
|
365
|
-
ComponentProps<typeof DefaultList
|
|
376
|
+
ComponentProps<typeof DefaultList<ElementOfArray<F[K]['value']>, K>>
|
|
366
377
|
> {
|
|
367
378
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
368
379
|
return this.listCache.retrieveOrCreate(
|
|
@@ -370,22 +381,46 @@ class MantineFormImpl<
|
|
|
370
381
|
DefaultList,
|
|
371
382
|
) as MantineFieldComponent<
|
|
372
383
|
SuppliedListProps<`${K}.${number}`>,
|
|
373
|
-
ComponentProps<typeof DefaultList
|
|
384
|
+
ComponentProps<typeof DefaultList<ElementOfArray<F[K]['value']>, K>>,
|
|
374
385
|
ErrorOfField<F[K]>
|
|
375
386
|
>
|
|
376
387
|
}
|
|
377
388
|
|
|
378
|
-
|
|
379
|
-
subForm<
|
|
389
|
+
fieldsView<
|
|
380
390
|
K extends keyof AllFieldsOfFields<F>,
|
|
381
|
-
|
|
382
|
-
>(valuePath: K,
|
|
383
|
-
|
|
391
|
+
P extends FieldsViewProps<Fields> = FieldsViewProps<SubFormFields<F, K>>,
|
|
392
|
+
>(valuePath: K, FieldsView: ComponentType<P>): MantineFieldComponent<
|
|
393
|
+
FieldsViewProps<P['fields']>,
|
|
394
|
+
P
|
|
395
|
+
> {
|
|
396
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
397
|
+
return this.fieldsViewCache.retrieveOrCreate(
|
|
398
|
+
valuePath,
|
|
399
|
+
// strip props from component since we lose information in the cache
|
|
400
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
401
|
+
FieldsView as ComponentType,
|
|
402
|
+
this,
|
|
403
|
+
) as unknown as MantineFieldComponent<
|
|
404
|
+
FieldsViewProps<P['fields']>,
|
|
405
|
+
P
|
|
406
|
+
>
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
form<
|
|
410
|
+
K extends keyof AllFieldsOfFields<F>,
|
|
411
|
+
P extends FormProps<ValueTypeOfField<F[K]>> = FormProps<ValueTypeOfField<F[K]>>,
|
|
412
|
+
>(
|
|
413
|
+
valuePath: K,
|
|
414
|
+
Form: ComponentType<P>,
|
|
415
|
+
): MantineFieldComponent<FormProps<ValueTypeOfField<F[K]>>, P> {
|
|
416
|
+
// strip props from component since we lose information in the cache
|
|
417
|
+
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
418
|
+
return this.formCache.retrieveOrCreate(
|
|
384
419
|
valuePath,
|
|
385
420
|
// strip props from component since we lose information in the cache
|
|
386
421
|
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
|
|
387
|
-
|
|
422
|
+
Form as ComponentType,
|
|
388
423
|
this,
|
|
389
|
-
)
|
|
424
|
+
) as unknown as MantineFieldComponent<FormProps<ValueTypeOfField<F[K]>>, P>
|
|
390
425
|
}
|
|
391
426
|
}
|
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`field view 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_6d731127 mantine-Stack-root"
|
|
12
|
+
style="--stack-gap: var(--mantine-spacing-md); --stack-align: stretch; --stack-justify: flex-start;"
|
|
13
|
+
>
|
|
14
|
+
<div
|
|
15
|
+
class="m_46b77525 mantine-InputWrapper-root mantine-TextInput-root"
|
|
16
|
+
data-error="true"
|
|
17
|
+
>
|
|
18
|
+
<label
|
|
19
|
+
class="m_8fdc1311 mantine-InputWrapper-label mantine-TextInput-label"
|
|
20
|
+
for="mantine-0cyk5rcyk"
|
|
21
|
+
id="mantine-0cyk5rcyk-label"
|
|
22
|
+
>
|
|
23
|
+
fields view
|
|
24
|
+
</label>
|
|
25
|
+
<div
|
|
26
|
+
class="m_6c018570 mantine-Input-wrapper mantine-TextInput-wrapper"
|
|
27
|
+
data-error="true"
|
|
28
|
+
data-variant="default"
|
|
29
|
+
style="--input-margin-bottom: calc(var(--mantine-spacing-xs) / 2);"
|
|
30
|
+
>
|
|
31
|
+
<input
|
|
32
|
+
aria-describedby="mantine-0cyk5rcyk-error"
|
|
33
|
+
aria-invalid="true"
|
|
34
|
+
class="m_8fb7ebe7 mantine-Input-input mantine-TextInput-input"
|
|
35
|
+
data-error="true"
|
|
36
|
+
data-variant="default"
|
|
37
|
+
id="mantine-0cyk5rcyk"
|
|
38
|
+
name="$"
|
|
39
|
+
value="xxx"
|
|
40
|
+
/>
|
|
41
|
+
</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
|
+
</div>
|
|
49
|
+
<div
|
|
50
|
+
class="m_6d731127 mantine-Stack-root"
|
|
51
|
+
style="--stack-gap: var(--mantine-spacing-md); --stack-align: stretch; --stack-justify: flex-start;"
|
|
52
|
+
>
|
|
53
|
+
<div
|
|
54
|
+
class="m_46b77525 mantine-InputWrapper-root mantine-TextInput-root"
|
|
55
|
+
data-error="true"
|
|
56
|
+
>
|
|
57
|
+
<label
|
|
58
|
+
class="m_8fdc1311 mantine-InputWrapper-label mantine-TextInput-label"
|
|
59
|
+
for="mantine-0px4bipx4"
|
|
60
|
+
id="mantine-0px4bipx4-label"
|
|
61
|
+
>
|
|
62
|
+
sub fields view
|
|
63
|
+
</label>
|
|
64
|
+
<div
|
|
65
|
+
class="m_6c018570 mantine-Input-wrapper mantine-TextInput-wrapper"
|
|
66
|
+
data-error="true"
|
|
67
|
+
data-variant="default"
|
|
68
|
+
style="--input-margin-bottom: calc(var(--mantine-spacing-xs) / 2);"
|
|
69
|
+
>
|
|
70
|
+
<input
|
|
71
|
+
aria-describedby="mantine-0px4bipx4-error"
|
|
72
|
+
aria-invalid="true"
|
|
73
|
+
class="m_8fb7ebe7 mantine-Input-input mantine-TextInput-input"
|
|
74
|
+
data-error="true"
|
|
75
|
+
data-variant="default"
|
|
76
|
+
id="mantine-0px4bipx4"
|
|
77
|
+
name="$"
|
|
78
|
+
value="xxx"
|
|
79
|
+
/>
|
|
80
|
+
</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
|
+
</div>
|
|
88
|
+
<button
|
|
89
|
+
class="mantine-focus-auto mantine-active m_77c9d27d mantine-Button-root m_87cf2631 mantine-UnstyledButton-root"
|
|
90
|
+
style="--button-color: var(--mantine-color-white);"
|
|
91
|
+
type="button"
|
|
92
|
+
>
|
|
93
|
+
<span
|
|
94
|
+
class="m_80f1301b mantine-Button-inner"
|
|
95
|
+
>
|
|
96
|
+
<span
|
|
97
|
+
class="m_811560b9 mantine-Button-label"
|
|
98
|
+
>
|
|
99
|
+
Bonus Button
|
|
100
|
+
</span>
|
|
101
|
+
</span>
|
|
102
|
+
</button>
|
|
103
|
+
</div>
|
|
104
|
+
</div>
|
|
105
|
+
</div>
|
|
106
|
+
`;
|
|
107
|
+
|
|
108
|
+
exports[`field view hooks > renders Disabled 1`] = `
|
|
109
|
+
<div>
|
|
110
|
+
<style
|
|
111
|
+
data-mantine-styles="classes"
|
|
112
|
+
>
|
|
113
|
+
@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;}}
|
|
114
|
+
</style>
|
|
115
|
+
<div
|
|
116
|
+
class="m_6d731127 mantine-Stack-root"
|
|
117
|
+
style="--stack-gap: var(--mantine-spacing-md); --stack-align: stretch; --stack-justify: flex-start;"
|
|
118
|
+
>
|
|
119
|
+
<div
|
|
120
|
+
class="m_46b77525 mantine-InputWrapper-root mantine-TextInput-root"
|
|
121
|
+
>
|
|
122
|
+
<label
|
|
123
|
+
class="m_8fdc1311 mantine-InputWrapper-label mantine-TextInput-label"
|
|
124
|
+
for="mantine-0cyk5rcyk"
|
|
125
|
+
id="mantine-0cyk5rcyk-label"
|
|
126
|
+
>
|
|
127
|
+
fields view
|
|
128
|
+
</label>
|
|
129
|
+
<div
|
|
130
|
+
class="m_6c018570 mantine-Input-wrapper mantine-TextInput-wrapper"
|
|
131
|
+
data-disabled="true"
|
|
132
|
+
data-variant="default"
|
|
133
|
+
>
|
|
134
|
+
<input
|
|
135
|
+
aria-invalid="false"
|
|
136
|
+
class="m_8fb7ebe7 mantine-Input-input mantine-TextInput-input"
|
|
137
|
+
data-disabled="true"
|
|
138
|
+
data-variant="default"
|
|
139
|
+
disabled=""
|
|
140
|
+
id="mantine-0cyk5rcyk"
|
|
141
|
+
name="$"
|
|
142
|
+
value="xxx"
|
|
143
|
+
/>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
<div
|
|
147
|
+
class="m_6d731127 mantine-Stack-root"
|
|
148
|
+
style="--stack-gap: var(--mantine-spacing-md); --stack-align: stretch; --stack-justify: flex-start;"
|
|
149
|
+
>
|
|
150
|
+
<div
|
|
151
|
+
class="m_46b77525 mantine-InputWrapper-root mantine-TextInput-root"
|
|
152
|
+
>
|
|
153
|
+
<label
|
|
154
|
+
class="m_8fdc1311 mantine-InputWrapper-label mantine-TextInput-label"
|
|
155
|
+
for="mantine-0px4bipx4"
|
|
156
|
+
id="mantine-0px4bipx4-label"
|
|
157
|
+
>
|
|
158
|
+
sub fields view
|
|
159
|
+
</label>
|
|
160
|
+
<div
|
|
161
|
+
class="m_6c018570 mantine-Input-wrapper mantine-TextInput-wrapper"
|
|
162
|
+
data-disabled="true"
|
|
163
|
+
data-variant="default"
|
|
164
|
+
>
|
|
165
|
+
<input
|
|
166
|
+
aria-invalid="false"
|
|
167
|
+
class="m_8fb7ebe7 mantine-Input-input mantine-TextInput-input"
|
|
168
|
+
data-disabled="true"
|
|
169
|
+
data-variant="default"
|
|
170
|
+
disabled=""
|
|
171
|
+
id="mantine-0px4bipx4"
|
|
172
|
+
name="$"
|
|
173
|
+
value="yyy"
|
|
174
|
+
/>
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
<button
|
|
178
|
+
class="mantine-focus-auto mantine-active m_77c9d27d mantine-Button-root m_87cf2631 mantine-UnstyledButton-root"
|
|
179
|
+
style="--button-color: var(--mantine-color-white);"
|
|
180
|
+
type="button"
|
|
181
|
+
>
|
|
182
|
+
<span
|
|
183
|
+
class="m_80f1301b mantine-Button-inner"
|
|
184
|
+
>
|
|
185
|
+
<span
|
|
186
|
+
class="m_811560b9 mantine-Button-label"
|
|
187
|
+
>
|
|
188
|
+
Bonus Button
|
|
189
|
+
</span>
|
|
190
|
+
</span>
|
|
191
|
+
</button>
|
|
192
|
+
</div>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
`;
|
|
196
|
+
|
|
197
|
+
exports[`field view hooks > renders Empty 1`] = `
|
|
198
|
+
<div>
|
|
199
|
+
<style
|
|
200
|
+
data-mantine-styles="classes"
|
|
201
|
+
>
|
|
202
|
+
@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;}}
|
|
203
|
+
</style>
|
|
204
|
+
<div
|
|
205
|
+
class="m_6d731127 mantine-Stack-root"
|
|
206
|
+
style="--stack-gap: var(--mantine-spacing-md); --stack-align: stretch; --stack-justify: flex-start;"
|
|
207
|
+
>
|
|
208
|
+
<div
|
|
209
|
+
class="m_46b77525 mantine-InputWrapper-root mantine-TextInput-root"
|
|
210
|
+
>
|
|
211
|
+
<label
|
|
212
|
+
class="m_8fdc1311 mantine-InputWrapper-label mantine-TextInput-label"
|
|
213
|
+
for="mantine-0px4bipx4"
|
|
214
|
+
id="mantine-0px4bipx4-label"
|
|
215
|
+
>
|
|
216
|
+
fields view
|
|
217
|
+
</label>
|
|
218
|
+
<div
|
|
219
|
+
class="m_6c018570 mantine-Input-wrapper mantine-TextInput-wrapper"
|
|
220
|
+
data-variant="default"
|
|
221
|
+
>
|
|
222
|
+
<input
|
|
223
|
+
aria-invalid="false"
|
|
224
|
+
class="m_8fb7ebe7 mantine-Input-input mantine-TextInput-input"
|
|
225
|
+
data-variant="default"
|
|
226
|
+
id="mantine-0px4bipx4"
|
|
227
|
+
name="$"
|
|
228
|
+
value=""
|
|
229
|
+
/>
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
<div
|
|
233
|
+
class="m_6d731127 mantine-Stack-root"
|
|
234
|
+
style="--stack-gap: var(--mantine-spacing-md); --stack-align: stretch; --stack-justify: flex-start;"
|
|
235
|
+
>
|
|
236
|
+
<div
|
|
237
|
+
class="m_46b77525 mantine-InputWrapper-root mantine-TextInput-root"
|
|
238
|
+
>
|
|
239
|
+
<label
|
|
240
|
+
class="m_8fdc1311 mantine-InputWrapper-label mantine-TextInput-label"
|
|
241
|
+
for="mantine-12voha2vo"
|
|
242
|
+
id="mantine-12voha2vo-label"
|
|
243
|
+
>
|
|
244
|
+
sub fields view
|
|
245
|
+
</label>
|
|
246
|
+
<div
|
|
247
|
+
class="m_6c018570 mantine-Input-wrapper mantine-TextInput-wrapper"
|
|
248
|
+
data-variant="default"
|
|
249
|
+
>
|
|
250
|
+
<input
|
|
251
|
+
aria-invalid="false"
|
|
252
|
+
class="m_8fb7ebe7 mantine-Input-input mantine-TextInput-input"
|
|
253
|
+
data-variant="default"
|
|
254
|
+
id="mantine-12voha2vo"
|
|
255
|
+
name="$"
|
|
256
|
+
value=""
|
|
257
|
+
/>
|
|
258
|
+
</div>
|
|
259
|
+
</div>
|
|
260
|
+
<button
|
|
261
|
+
class="mantine-focus-auto mantine-active m_77c9d27d mantine-Button-root m_87cf2631 mantine-UnstyledButton-root"
|
|
262
|
+
style="--button-color: var(--mantine-color-white);"
|
|
263
|
+
type="button"
|
|
264
|
+
>
|
|
265
|
+
<span
|
|
266
|
+
class="m_80f1301b mantine-Button-inner"
|
|
267
|
+
>
|
|
268
|
+
<span
|
|
269
|
+
class="m_811560b9 mantine-Button-label"
|
|
270
|
+
>
|
|
271
|
+
Bonus Button
|
|
272
|
+
</span>
|
|
273
|
+
</span>
|
|
274
|
+
</button>
|
|
275
|
+
</div>
|
|
276
|
+
</div>
|
|
277
|
+
</div>
|
|
278
|
+
`;
|
|
279
|
+
|
|
280
|
+
exports[`field view hooks > renders Populated 1`] = `
|
|
281
|
+
<div>
|
|
282
|
+
<style
|
|
283
|
+
data-mantine-styles="classes"
|
|
284
|
+
>
|
|
285
|
+
@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;}}
|
|
286
|
+
</style>
|
|
287
|
+
<div
|
|
288
|
+
class="m_6d731127 mantine-Stack-root"
|
|
289
|
+
style="--stack-gap: var(--mantine-spacing-md); --stack-align: stretch; --stack-justify: flex-start;"
|
|
290
|
+
>
|
|
291
|
+
<div
|
|
292
|
+
class="m_46b77525 mantine-InputWrapper-root mantine-TextInput-root"
|
|
293
|
+
>
|
|
294
|
+
<label
|
|
295
|
+
class="m_8fdc1311 mantine-InputWrapper-label mantine-TextInput-label"
|
|
296
|
+
for="mantine-0cyk5rcyk"
|
|
297
|
+
id="mantine-0cyk5rcyk-label"
|
|
298
|
+
>
|
|
299
|
+
fields view
|
|
300
|
+
</label>
|
|
301
|
+
<div
|
|
302
|
+
class="m_6c018570 mantine-Input-wrapper mantine-TextInput-wrapper"
|
|
303
|
+
data-variant="default"
|
|
304
|
+
>
|
|
305
|
+
<input
|
|
306
|
+
aria-invalid="false"
|
|
307
|
+
class="m_8fb7ebe7 mantine-Input-input mantine-TextInput-input"
|
|
308
|
+
data-variant="default"
|
|
309
|
+
id="mantine-0cyk5rcyk"
|
|
310
|
+
name="$"
|
|
311
|
+
value="Hello"
|
|
312
|
+
/>
|
|
313
|
+
</div>
|
|
314
|
+
</div>
|
|
315
|
+
<div
|
|
316
|
+
class="m_6d731127 mantine-Stack-root"
|
|
317
|
+
style="--stack-gap: var(--mantine-spacing-md); --stack-align: stretch; --stack-justify: flex-start;"
|
|
318
|
+
>
|
|
319
|
+
<div
|
|
320
|
+
class="m_46b77525 mantine-InputWrapper-root mantine-TextInput-root"
|
|
321
|
+
>
|
|
322
|
+
<label
|
|
323
|
+
class="m_8fdc1311 mantine-InputWrapper-label mantine-TextInput-label"
|
|
324
|
+
for="mantine-0px4bipx4"
|
|
325
|
+
id="mantine-0px4bipx4-label"
|
|
326
|
+
>
|
|
327
|
+
sub fields view
|
|
328
|
+
</label>
|
|
329
|
+
<div
|
|
330
|
+
class="m_6c018570 mantine-Input-wrapper mantine-TextInput-wrapper"
|
|
331
|
+
data-variant="default"
|
|
332
|
+
>
|
|
333
|
+
<input
|
|
334
|
+
aria-invalid="false"
|
|
335
|
+
class="m_8fb7ebe7 mantine-Input-input mantine-TextInput-input"
|
|
336
|
+
data-variant="default"
|
|
337
|
+
id="mantine-0px4bipx4"
|
|
338
|
+
name="$"
|
|
339
|
+
value="World"
|
|
340
|
+
/>
|
|
341
|
+
</div>
|
|
342
|
+
</div>
|
|
343
|
+
<button
|
|
344
|
+
class="mantine-focus-auto mantine-active m_77c9d27d mantine-Button-root m_87cf2631 mantine-UnstyledButton-root"
|
|
345
|
+
style="--button-color: var(--mantine-color-white);"
|
|
346
|
+
type="button"
|
|
347
|
+
>
|
|
348
|
+
<span
|
|
349
|
+
class="m_80f1301b mantine-Button-inner"
|
|
350
|
+
>
|
|
351
|
+
<span
|
|
352
|
+
class="m_811560b9 mantine-Button-label"
|
|
353
|
+
>
|
|
354
|
+
Bonus Button
|
|
355
|
+
</span>
|
|
356
|
+
</span>
|
|
357
|
+
</button>
|
|
358
|
+
</div>
|
|
359
|
+
</div>
|
|
360
|
+
</div>
|
|
361
|
+
`;
|
|
362
|
+
|
|
363
|
+
exports[`field view hooks > renders Required 1`] = `
|
|
364
|
+
<div>
|
|
365
|
+
<style
|
|
366
|
+
data-mantine-styles="classes"
|
|
367
|
+
>
|
|
368
|
+
@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;}}
|
|
369
|
+
</style>
|
|
370
|
+
<div
|
|
371
|
+
class="m_6d731127 mantine-Stack-root"
|
|
372
|
+
style="--stack-gap: var(--mantine-spacing-md); --stack-align: stretch; --stack-justify: flex-start;"
|
|
373
|
+
>
|
|
374
|
+
<div
|
|
375
|
+
class="m_46b77525 mantine-InputWrapper-root mantine-TextInput-root"
|
|
376
|
+
>
|
|
377
|
+
<label
|
|
378
|
+
class="m_8fdc1311 mantine-InputWrapper-label mantine-TextInput-label"
|
|
379
|
+
data-required="true"
|
|
380
|
+
for="mantine-0cyk5rcyk"
|
|
381
|
+
id="mantine-0cyk5rcyk-label"
|
|
382
|
+
>
|
|
383
|
+
fields view
|
|
384
|
+
<span
|
|
385
|
+
aria-hidden="true"
|
|
386
|
+
class="m_78a94662 mantine-InputWrapper-required mantine-TextInput-required"
|
|
387
|
+
>
|
|
388
|
+
*
|
|
389
|
+
</span>
|
|
390
|
+
</label>
|
|
391
|
+
<div
|
|
392
|
+
class="m_6c018570 mantine-Input-wrapper mantine-TextInput-wrapper"
|
|
393
|
+
data-variant="default"
|
|
394
|
+
>
|
|
395
|
+
<input
|
|
396
|
+
aria-invalid="false"
|
|
397
|
+
class="m_8fb7ebe7 mantine-Input-input mantine-TextInput-input"
|
|
398
|
+
data-variant="default"
|
|
399
|
+
id="mantine-0cyk5rcyk"
|
|
400
|
+
name="$"
|
|
401
|
+
required=""
|
|
402
|
+
value="xxx"
|
|
403
|
+
/>
|
|
404
|
+
</div>
|
|
405
|
+
</div>
|
|
406
|
+
<div
|
|
407
|
+
class="m_6d731127 mantine-Stack-root"
|
|
408
|
+
style="--stack-gap: var(--mantine-spacing-md); --stack-align: stretch; --stack-justify: flex-start;"
|
|
409
|
+
>
|
|
410
|
+
<div
|
|
411
|
+
class="m_46b77525 mantine-InputWrapper-root mantine-TextInput-root"
|
|
412
|
+
>
|
|
413
|
+
<label
|
|
414
|
+
class="m_8fdc1311 mantine-InputWrapper-label mantine-TextInput-label"
|
|
415
|
+
data-required="true"
|
|
416
|
+
for="mantine-0px4bipx4"
|
|
417
|
+
id="mantine-0px4bipx4-label"
|
|
418
|
+
>
|
|
419
|
+
sub fields view
|
|
420
|
+
<span
|
|
421
|
+
aria-hidden="true"
|
|
422
|
+
class="m_78a94662 mantine-InputWrapper-required mantine-TextInput-required"
|
|
423
|
+
>
|
|
424
|
+
*
|
|
425
|
+
</span>
|
|
426
|
+
</label>
|
|
427
|
+
<div
|
|
428
|
+
class="m_6c018570 mantine-Input-wrapper mantine-TextInput-wrapper"
|
|
429
|
+
data-variant="default"
|
|
430
|
+
>
|
|
431
|
+
<input
|
|
432
|
+
aria-invalid="false"
|
|
433
|
+
class="m_8fb7ebe7 mantine-Input-input mantine-TextInput-input"
|
|
434
|
+
data-variant="default"
|
|
435
|
+
id="mantine-0px4bipx4"
|
|
436
|
+
name="$"
|
|
437
|
+
required=""
|
|
438
|
+
value="yyy"
|
|
439
|
+
/>
|
|
440
|
+
</div>
|
|
441
|
+
</div>
|
|
442
|
+
<button
|
|
443
|
+
class="mantine-focus-auto mantine-active m_77c9d27d mantine-Button-root m_87cf2631 mantine-UnstyledButton-root"
|
|
444
|
+
style="--button-color: var(--mantine-color-white);"
|
|
445
|
+
type="button"
|
|
446
|
+
>
|
|
447
|
+
<span
|
|
448
|
+
class="m_80f1301b mantine-Button-inner"
|
|
449
|
+
>
|
|
450
|
+
<span
|
|
451
|
+
class="m_811560b9 mantine-Button-label"
|
|
452
|
+
>
|
|
453
|
+
Bonus Button
|
|
454
|
+
</span>
|
|
455
|
+
</span>
|
|
456
|
+
</button>
|
|
457
|
+
</div>
|
|
458
|
+
</div>
|
|
459
|
+
</div>
|
|
460
|
+
`;
|