@manafishrov/ui 1.2.12 → 1.2.13
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/dist/components/form/ComboboxField.d.ts +5 -3
- package/dist/components/form/ComboboxField.js +62 -63
- package/dist/components/form/ComboboxField.js.map +1 -1
- package/dist/components/form/DatePickerField.d.ts +3 -2
- package/dist/components/form/DatePickerField.js +43 -32
- package/dist/components/form/DatePickerField.js.map +1 -1
- package/dist/components/form/NumberInputField.d.ts +3 -3
- package/dist/components/form/NumberInputField.js +18 -19
- package/dist/components/form/NumberInputField.js.map +1 -1
- package/dist/components/form/PasswordInputField.d.ts +1 -0
- package/dist/components/form/PasswordInputField.js +23 -16
- package/dist/components/form/PasswordInputField.js.map +1 -1
- package/dist/components/form/TagsInputField.d.ts +4 -4
- package/dist/components/form/TagsInputField.js +52 -49
- package/dist/components/form/TagsInputField.js.map +1 -1
- package/package.json +1 -1
- package/src/components/form/ComboboxField.tsx +30 -25
- package/src/components/form/DatePickerField.tsx +30 -17
- package/src/components/form/NumberInputField.tsx +5 -6
- package/src/components/form/PasswordInputField.tsx +7 -3
- package/src/components/form/TagsInputField.tsx +43 -32
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { ComboboxRootProps } from '@ark-ui/solid';
|
|
2
|
-
import { Component } from 'solid-js';
|
|
3
|
-
|
|
2
|
+
import { Component, ComponentProps } from 'solid-js';
|
|
3
|
+
import { ComboboxInput } from '../Combobox';
|
|
4
|
+
export type ComboboxFieldProps = ComponentProps<typeof ComboboxInput> & {
|
|
5
|
+
collection: ComboboxRootProps<string>['collection'];
|
|
4
6
|
label?: string;
|
|
5
7
|
description?: string;
|
|
6
8
|
showTrigger?: boolean;
|
|
7
|
-
|
|
9
|
+
showClearTrigger?: boolean;
|
|
8
10
|
} & {
|
|
9
11
|
class?: string;
|
|
10
12
|
};
|
|
@@ -1,66 +1,68 @@
|
|
|
1
|
-
import { createComponent as
|
|
2
|
-
import { Combobox as
|
|
3
|
-
import { Field as
|
|
1
|
+
import { createComponent as e, mergeProps as s, insert as i, memo as g, template as d } from "solid-js/web";
|
|
2
|
+
import { Combobox as u, ComboboxControl as c, ComboboxInput as h, ComboboxClearTrigger as m, ComboboxTrigger as b, ComboboxPositioner as C, ComboboxContent as p, ComboboxList as x } from "../Combobox.js";
|
|
3
|
+
import { Field as f, FieldLabel as T, FieldContent as v, FieldError as w, FieldDescription as O } from "../Field.js";
|
|
4
4
|
import { useFieldContext as F } from "./context.js";
|
|
5
|
-
import { splitProps as
|
|
6
|
-
var _ = /* @__PURE__ */
|
|
7
|
-
const y = (l) =>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
return r(x, {
|
|
5
|
+
import { splitProps as a } from "solid-js";
|
|
6
|
+
var _ = /* @__PURE__ */ d('<div class="gap-1 flex items-center">');
|
|
7
|
+
const y = (l) => {
|
|
8
|
+
const [t, r] = a(l, ["showTrigger", "showClearTrigger", "children"]);
|
|
9
|
+
return [e(c, {
|
|
10
|
+
get children() {
|
|
11
|
+
return [e(h, r), (() => {
|
|
12
|
+
var o = _();
|
|
13
|
+
return i(o, (() => {
|
|
14
|
+
var n = g(() => t.showClearTrigger === !0);
|
|
15
|
+
return () => n() && e(m, {});
|
|
16
|
+
})(), null), i(o, (() => {
|
|
17
|
+
var n = g(() => t.showTrigger === !0);
|
|
18
|
+
return () => n() && e(b, {});
|
|
19
|
+
})(), null), o;
|
|
20
|
+
})()];
|
|
21
|
+
}
|
|
22
|
+
}), e(C, {
|
|
23
|
+
get children() {
|
|
24
|
+
return e(p, {
|
|
25
|
+
get children() {
|
|
26
|
+
return e(x, {
|
|
27
|
+
get children() {
|
|
28
|
+
return t.children;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
})];
|
|
35
|
+
}, P = ["label", "description", "required", "disabled", "readOnly", "collection", "showTrigger", "showClearTrigger", "children"], D = (l) => {
|
|
36
|
+
const t = F(), [r, o] = a(l, P);
|
|
37
|
+
return e(f, {
|
|
39
38
|
get invalid() {
|
|
40
39
|
return t().state.meta.errors.length > 0;
|
|
41
40
|
},
|
|
42
41
|
get disabled() {
|
|
43
|
-
return
|
|
42
|
+
return r.disabled ?? !1;
|
|
44
43
|
},
|
|
45
44
|
get readOnly() {
|
|
46
|
-
return
|
|
45
|
+
return r.readOnly ?? !1;
|
|
47
46
|
},
|
|
48
47
|
get required() {
|
|
49
|
-
return
|
|
48
|
+
return r.required ?? !1;
|
|
50
49
|
},
|
|
51
50
|
get children() {
|
|
52
|
-
return [
|
|
51
|
+
return [e(T, {
|
|
53
52
|
get children() {
|
|
54
|
-
return
|
|
53
|
+
return r.label;
|
|
55
54
|
}
|
|
56
|
-
}),
|
|
55
|
+
}), e(v, {
|
|
57
56
|
get children() {
|
|
58
|
-
return [
|
|
57
|
+
return [e(u, {
|
|
58
|
+
get collection() {
|
|
59
|
+
return r.collection;
|
|
60
|
+
},
|
|
59
61
|
get value() {
|
|
60
62
|
return t().state.value;
|
|
61
63
|
},
|
|
62
|
-
onValueChange: (
|
|
63
|
-
t().handleChange(
|
|
64
|
+
onValueChange: (n) => {
|
|
65
|
+
t().handleChange(n.value);
|
|
64
66
|
},
|
|
65
67
|
onBlur: () => {
|
|
66
68
|
t().handleBlur();
|
|
@@ -69,35 +71,32 @@ const y = (l) => [r(g, {
|
|
|
69
71
|
return t().state.meta.errors.length > 0;
|
|
70
72
|
},
|
|
71
73
|
get disabled() {
|
|
72
|
-
return
|
|
74
|
+
return r.disabled ?? !1;
|
|
73
75
|
},
|
|
74
76
|
get readOnly() {
|
|
75
|
-
return
|
|
76
|
-
}
|
|
77
|
-
}, i, {
|
|
77
|
+
return r.readOnly ?? !1;
|
|
78
|
+
},
|
|
78
79
|
get children() {
|
|
79
|
-
return
|
|
80
|
-
get placeholder() {
|
|
81
|
-
return e.placeholder;
|
|
82
|
-
},
|
|
80
|
+
return e(y, s({
|
|
83
81
|
get showTrigger() {
|
|
84
|
-
return
|
|
85
|
-
},
|
|
86
|
-
get showClear() {
|
|
87
|
-
return e.showClear;
|
|
82
|
+
return r.showTrigger;
|
|
88
83
|
},
|
|
84
|
+
get showClearTrigger() {
|
|
85
|
+
return r.showClearTrigger;
|
|
86
|
+
}
|
|
87
|
+
}, o, {
|
|
89
88
|
get children() {
|
|
90
|
-
return
|
|
89
|
+
return r.children;
|
|
91
90
|
}
|
|
92
|
-
});
|
|
91
|
+
}));
|
|
93
92
|
}
|
|
94
|
-
})
|
|
93
|
+
}), e(w, {
|
|
95
94
|
get errors() {
|
|
96
95
|
return t().state.meta.errors;
|
|
97
96
|
}
|
|
98
|
-
}),
|
|
97
|
+
}), e(O, {
|
|
99
98
|
get children() {
|
|
100
|
-
return
|
|
99
|
+
return r.description;
|
|
101
100
|
}
|
|
102
101
|
})];
|
|
103
102
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxField.js","sources":["../../../src/components/form/ComboboxField.tsx"],"sourcesContent":["import type { ComboboxRootProps } from '@ark-ui/solid';\nimport type { Component, ComponentProps } from 'solid-js';\n\nimport {\n Combobox,\n ComboboxContent,\n ComboboxInput,\n ComboboxList,\n ComboboxPositioner,\n ComboboxControl,\n ComboboxTrigger,\n ComboboxClearTrigger,\n} from '@/components/Combobox';\nimport { Field, FieldContent, FieldDescription, FieldError, FieldLabel } from '@/components/Field';\n\nimport { useFieldContext } from './context';\n\nexport type ComboboxFieldProps =
|
|
1
|
+
{"version":3,"file":"ComboboxField.js","sources":["../../../src/components/form/ComboboxField.tsx"],"sourcesContent":["import type { ComboboxRootProps } from '@ark-ui/solid';\nimport type { Component, ComponentProps } from 'solid-js';\n\nimport {\n Combobox,\n ComboboxContent,\n ComboboxInput,\n ComboboxList,\n ComboboxPositioner,\n ComboboxControl,\n ComboboxTrigger,\n ComboboxClearTrigger,\n} from '@/components/Combobox';\nimport { Field, FieldContent, FieldDescription, FieldError, FieldLabel } from '@/components/Field';\n\nimport { useFieldContext } from './context';\n\nexport type ComboboxFieldProps = ComponentProps<typeof ComboboxInput> & {\n collection: ComboboxRootProps<string>['collection'];\n label?: string;\n description?: string;\n showTrigger?: boolean;\n showClearTrigger?: boolean;\n} & { class?: string };\n\nconst ComboboxInputGroup: Component<\n ComponentProps<typeof ComboboxInput> & {\n showTrigger?: boolean | undefined;\n showClearTrigger?: boolean | undefined;\n }\n> = (props) => {\n const [local, others] = splitProps(props, ['showTrigger', 'showClearTrigger', 'children']);\n\n return (\n <>\n <ComboboxControl>\n <ComboboxInput {...others} />\n <div class='gap-1 flex items-center'>\n {local.showClearTrigger === true && <ComboboxClearTrigger />}\n {local.showTrigger === true && <ComboboxTrigger />}\n </div>\n </ComboboxControl>\n <ComboboxPositioner>\n <ComboboxContent>\n <ComboboxList>{local.children}</ComboboxList>\n </ComboboxContent>\n </ComboboxPositioner>\n </>\n );\n};\n\nconst COMBOBOX_FIELD_PROPS = [\n 'label',\n 'description',\n 'required',\n 'disabled',\n 'readOnly',\n 'collection',\n 'showTrigger',\n 'showClearTrigger',\n 'children',\n] as const;\n\nexport const ComboboxField: Component<ComboboxFieldProps> = (props) => {\n const field = useFieldContext<string[]>();\n const [local, others] = splitProps(props, COMBOBOX_FIELD_PROPS);\n\n return (\n <Field\n invalid={field().state.meta.errors.length > 0}\n disabled={local.disabled ?? false}\n readOnly={local.readOnly ?? false}\n required={local.required ?? false}\n >\n <FieldLabel>{local.label}</FieldLabel>\n <FieldContent>\n <Combobox<string>\n collection={local.collection}\n value={field().state.value}\n onValueChange={(details) => {\n field().handleChange(details.value);\n }}\n onBlur={() => {\n field().handleBlur();\n }}\n invalid={field().state.meta.errors.length > 0}\n disabled={local.disabled ?? false}\n readOnly={local.readOnly ?? false}\n >\n <ComboboxInputGroup\n showTrigger={local.showTrigger}\n showClearTrigger={local.showClearTrigger}\n {...others}\n >\n {local.children}\n </ComboboxInputGroup>\n </Combobox>\n <FieldError errors={field().state.meta.errors} />\n <FieldDescription>{local.description}</FieldDescription>\n </FieldContent>\n </Field>\n );\n};\n"],"names":["ComboboxInputGroup","props","local","others","splitProps","_$createComponent","ComboboxControl","children","ComboboxInput","_el$","_tmpl$","_$insert","_c$","_$memo","showClearTrigger","ComboboxClearTrigger","_c$2","showTrigger","ComboboxTrigger","ComboboxPositioner","ComboboxContent","ComboboxList","COMBOBOX_FIELD_PROPS","ComboboxField","field","useFieldContext","Field","invalid","state","meta","errors","length","disabled","readOnly","required","FieldLabel","label","FieldContent","Combobox","collection","value","onValueChange","details","handleChange","onBlur","handleBlur","_$mergeProps","FieldError","FieldDescription","description"],"mappings":";;;;;;AAyBA,MAAMA,IAKDC,CAAAA,MAAU;AACb,QAAM,CAACC,GAAOC,CAAM,IAAIC,EAAWH,GAAO,CAAC,eAAe,oBAAoB,UAAU,CAAC;AAEzF,SAAA,CAAAI,EAEKC,GAAe;AAAA,IAAA,IAAAC,WAAA;AAAA,aAAA,CAAAF,EACbG,GAAkBL,CAAM,IAAA,MAAA;AAAA,YAAAM,IAAAC,EAAAA;AAAAC,eAAAA,EAAAF,IAAA,MAAA;AAAA,cAAAG,IAAAC,EAAA,MAEtBX,EAAMY,qBAAqB,EAAI;AAAA,iBAAA,MAA/BF,EAAAA,KAAAP,EAAoCU,GAAoB,CAAA,CAAA;AAAA,QAAG,GAAA,GAAA,IAAA,GAAAJ,EAAAF,IAAA,MAAA;AAAA,cAAAO,IAAAH,EAAA,MAC3DX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2
2
|
import { Component } from 'solid-js';
|
|
3
|
-
export type DatePickerFieldProps =
|
|
3
|
+
export type DatePickerFieldProps = DatePickerInputProps & {
|
|
4
4
|
label?: string;
|
|
5
5
|
description?: string;
|
|
6
|
+
showTrigger?: boolean;
|
|
6
7
|
};
|
|
7
8
|
export declare const DatePickerField: Component<DatePickerFieldProps>;
|
|
@@ -1,23 +1,33 @@
|
|
|
1
|
-
import { createComponent as e, mergeProps as a } from "solid-js/web";
|
|
2
|
-
import { DatePicker as
|
|
3
|
-
import { Field as
|
|
4
|
-
import { useFieldContext as
|
|
5
|
-
import { splitProps as
|
|
6
|
-
const C = (n) =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { createComponent as e, mergeProps as a, Show as d } from "solid-js/web";
|
|
2
|
+
import { DatePicker as s, DatePickerControl as g, DatePickerInput as u, DatePickerTrigger as c, DatePickerPositioner as h, DatePickerContent as p, DatePickerViews as m } from "../DatePicker.js";
|
|
3
|
+
import { Field as P, FieldLabel as f, FieldContent as D, FieldError as b, FieldDescription as k } from "../Field.js";
|
|
4
|
+
import { useFieldContext as w } from "./context.js";
|
|
5
|
+
import { splitProps as l } from "solid-js";
|
|
6
|
+
const C = (n) => {
|
|
7
|
+
const [t, r] = l(n, ["showTrigger"]);
|
|
8
|
+
return [e(g, {
|
|
9
|
+
get children() {
|
|
10
|
+
return [e(u, r), e(d, {
|
|
11
|
+
get when() {
|
|
12
|
+
return t.showTrigger !== !1;
|
|
13
|
+
},
|
|
14
|
+
get children() {
|
|
15
|
+
return e(c, {});
|
|
16
|
+
}
|
|
17
|
+
})];
|
|
18
|
+
}
|
|
19
|
+
}), e(h, {
|
|
20
|
+
get children() {
|
|
21
|
+
return e(p, {
|
|
22
|
+
get children() {
|
|
23
|
+
return e(m, {});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
})];
|
|
28
|
+
}, F = ["label", "description", "required", "disabled", "readOnly", "placeholder", "showTrigger"], I = (n) => {
|
|
29
|
+
const t = w(), [r, i] = l(n, F);
|
|
30
|
+
return e(P, {
|
|
21
31
|
get invalid() {
|
|
22
32
|
return t().state.meta.errors.length > 0;
|
|
23
33
|
},
|
|
@@ -31,18 +41,18 @@ const C = (n) => [e(o, {
|
|
|
31
41
|
return r.required ?? !1;
|
|
32
42
|
},
|
|
33
43
|
get children() {
|
|
34
|
-
return [e(
|
|
44
|
+
return [e(f, {
|
|
35
45
|
get children() {
|
|
36
46
|
return r.label;
|
|
37
47
|
}
|
|
38
|
-
}), e(
|
|
48
|
+
}), e(D, {
|
|
39
49
|
get children() {
|
|
40
|
-
return [e(
|
|
50
|
+
return [e(s, {
|
|
41
51
|
get value() {
|
|
42
52
|
return t().state.value;
|
|
43
53
|
},
|
|
44
|
-
onValueChange: (
|
|
45
|
-
t().handleChange(
|
|
54
|
+
onValueChange: (o) => {
|
|
55
|
+
t().handleChange(o.value);
|
|
46
56
|
},
|
|
47
57
|
onBlur: () => {
|
|
48
58
|
t().handleBlur();
|
|
@@ -55,20 +65,21 @@ const C = (n) => [e(o, {
|
|
|
55
65
|
},
|
|
56
66
|
get readOnly() {
|
|
57
67
|
return r.readOnly ?? !1;
|
|
58
|
-
}
|
|
59
|
-
}, l, {
|
|
68
|
+
},
|
|
60
69
|
get children() {
|
|
61
|
-
return e(C, {
|
|
70
|
+
return e(C, a(i, {
|
|
62
71
|
get placeholder() {
|
|
63
72
|
return r.placeholder;
|
|
64
73
|
}
|
|
65
|
-
})
|
|
74
|
+
}, () => typeof r.showTrigger == "boolean" && {
|
|
75
|
+
showTrigger: r.showTrigger
|
|
76
|
+
}));
|
|
66
77
|
}
|
|
67
|
-
})
|
|
78
|
+
}), e(b, {
|
|
68
79
|
get errors() {
|
|
69
80
|
return t().state.meta.errors;
|
|
70
81
|
}
|
|
71
|
-
}), e(
|
|
82
|
+
}), e(k, {
|
|
72
83
|
get children() {
|
|
73
84
|
return r.description;
|
|
74
85
|
}
|
|
@@ -79,6 +90,6 @@ const C = (n) => [e(o, {
|
|
|
79
90
|
});
|
|
80
91
|
};
|
|
81
92
|
export {
|
|
82
|
-
|
|
93
|
+
I as DatePickerField
|
|
83
94
|
};
|
|
84
95
|
//# sourceMappingURL=DatePickerField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePickerField.js","sources":["../../../src/components/form/DatePickerField.tsx"],"sourcesContent":["import type { DatePickerInputProps,
|
|
1
|
+
{"version":3,"file":"DatePickerField.js","sources":["../../../src/components/form/DatePickerField.tsx"],"sourcesContent":["import type { DatePickerInputProps, DateValue } from '@ark-ui/solid';\nimport type { Component } from 'solid-js';\n\nimport {\n DatePicker,\n DatePickerContent,\n DatePickerControl,\n DatePickerInput,\n DatePickerPositioner,\n DatePickerTrigger,\n DatePickerViews,\n} from '@/components/DatePicker';\nimport { Field, FieldContent, FieldDescription, FieldError, FieldLabel } from '@/components/Field';\n\nimport { useFieldContext } from './context';\n\nexport type DatePickerFieldProps = DatePickerInputProps & {\n label?: string;\n description?: string;\n showTrigger?: boolean;\n};\n\nconst DatePickerInputGroup: Component<DatePickerInputProps & { showTrigger?: boolean }> = (\n props,\n) => {\n const [local, others] = splitProps(props, ['showTrigger']);\n\n return (\n <>\n <DatePickerControl>\n <DatePickerInput {...others} />\n <Show when={local.showTrigger !== false}>\n <DatePickerTrigger />\n </Show>\n </DatePickerControl>\n <DatePickerPositioner>\n <DatePickerContent>\n <DatePickerViews />\n </DatePickerContent>\n </DatePickerPositioner>\n </>\n );\n};\n\nconst DATE_PICKER_FIELD_PROPS = [\n 'label',\n 'description',\n 'required',\n 'disabled',\n 'readOnly',\n 'placeholder',\n 'showTrigger',\n] as const;\n\nexport const DatePickerField: Component<DatePickerFieldProps> = (props) => {\n const field = useFieldContext<DateValue[]>();\n const [local, others] = splitProps(props, DATE_PICKER_FIELD_PROPS);\n\n return (\n <Field\n invalid={field().state.meta.errors.length > 0}\n disabled={local.disabled ?? false}\n readOnly={local.readOnly ?? false}\n required={local.required ?? false}\n >\n <FieldLabel>{local.label}</FieldLabel>\n <FieldContent>\n <DatePicker\n value={field().state.value}\n onValueChange={(details) => {\n field().handleChange(details.value);\n }}\n onBlur={() => {\n field().handleBlur();\n }}\n invalid={field().state.meta.errors.length > 0}\n disabled={local.disabled ?? false}\n readOnly={local.readOnly ?? false}\n >\n <DatePickerInputGroup\n {...others}\n placeholder={local.placeholder}\n {...(typeof local.showTrigger === 'boolean' && { showTrigger: local.showTrigger })}\n />\n </DatePicker>\n <FieldError errors={field().state.meta.errors} />\n <FieldDescription>{local.description}</FieldDescription>\n </FieldContent>\n </Field>\n );\n};\n"],"names":["DatePickerInputGroup","props","local","others","splitProps","_$createComponent","DatePickerControl","children","DatePickerInput","_$Show","when","showTrigger","DatePickerTrigger","DatePickerPositioner","DatePickerContent","DatePickerViews","DATE_PICKER_FIELD_PROPS","DatePickerField","field","useFieldContext","Field","invalid","state","meta","errors","length","disabled","readOnly","required","FieldLabel","label","FieldContent","DatePicker","value","onValueChange","details","handleChange","onBlur","handleBlur","_$mergeProps","placeholder","FieldError","FieldDescription","description"],"mappings":";;;;;AAsBA,MAAMA,IACJC,CAAAA,MACG;AACH,QAAM,CAACC,GAAOC,CAAM,IAAIC,EAAWH,GAAO,CAAC,aAAa,CAAC;AAEzD,SAAA,CAAAI,EAEKC,GAAiB;AAAA,IAAA,IAAAC,WAAA;AAAA,aAAA,CAAAF,EACfG,GAAoBL,CAAM,GAAAE,EAC1BI,GAAI;AAAA,QAAA,IAACC,OAAI;AAAA,iBAAER,EAAMS,gBAAgB;AAAA,QAAK;AAAA,QAAA,IAAAJ,WAAA;AAAA,iBAAAF,EACpCO,GAAiB,EAAA;AAAA,QAAA;AAAA,MAAA,CAAA,CAAA;AAAA,IAAA;AAAA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AAMC,KAAKC,OAAOC,SAAS;AAAA,YAAC;AAAA,YAAA,IAC7CC,WAAQ;AAAA,qBAAExB,EAAMwB,YAAY;AAAA,YAAK;AAAA,YAAA,IACjCC,WAAQ;AAAA,qBAAEzB,EAAMyB,YAAY;AAAA,YAAK;AAAA,YAAA,IAAApB,WAAA;AAAA,qBAAAF,EAEhCL,GAAoBuC,EACfpC,GAAM;AAAA,gBAAA,IACVqC,cAAW;AAAA,yBAAEtC,EAAMsC;AAAAA,gBAAW;AAAA,cAAA,GAAA,MACzB,OAAOtC,EAAMS,eAAgB,aAAa;AAAA,gBAAEA,aAAaT,EAAMS;AAAAA,cAAAA,CAAa,CAAA;AAAA,YAAA;AAAA,UAAA,CAAA,GAAAN,EAGpFoC,GAAU;AAAA,YAAA,IAACjB,SAAM;AAAA,qBAAEN,EAAAA,EAAQI,MAAMC,KAAKC;AAAAA,YAAM;AAAA,UAAA,CAAA,GAAAnB,EAC5CqC,GAAgB;AAAA,YAAA,IAAAnC,WAAA;AAAA,qBAAEL,EAAMyC;AAAAA,YAAW;AAAA,UAAA,CAAA,CAAA;AAAA,QAAA;AAAA,MAAA,CAAA,CAAA;AAAA,IAAA;AAAA,EAAA,CAAA;AAI5C;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Component, ComponentProps } from 'solid-js';
|
|
2
|
-
import {
|
|
3
|
-
export type NumberInputFieldProps = ComponentProps<typeof
|
|
2
|
+
import { NumberInputInput } from '../NumberInput';
|
|
3
|
+
export type NumberInputFieldProps = ComponentProps<typeof NumberInputInput> & {
|
|
4
4
|
label?: string;
|
|
5
5
|
description?: string;
|
|
6
|
-
|
|
6
|
+
showTriggers?: boolean;
|
|
7
7
|
};
|
|
8
8
|
export declare const NumberInputField: Component<NumberInputFieldProps>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { createComponent as e,
|
|
2
|
-
import { Field as
|
|
3
|
-
import { NumberInput as
|
|
4
|
-
import { useFieldContext as
|
|
5
|
-
import { splitProps as
|
|
6
|
-
const
|
|
7
|
-
const t =
|
|
8
|
-
return e(
|
|
1
|
+
import { createComponent as e, Show as u } from "solid-js/web";
|
|
2
|
+
import { Field as d, FieldLabel as a, FieldContent as o, FieldError as s, FieldDescription as g } from "../Field.js";
|
|
3
|
+
import { NumberInput as m, NumberInputControl as h, NumberInputInput as p, NumberInputTriggers as c } from "../NumberInput.js";
|
|
4
|
+
import { useFieldContext as b } from "./context.js";
|
|
5
|
+
import { splitProps as f } from "solid-js";
|
|
6
|
+
const v = (n) => {
|
|
7
|
+
const t = b(), [r, l] = f(n, ["label", "description", "required", "disabled", "readOnly", "showTriggers"]);
|
|
8
|
+
return e(d, {
|
|
9
9
|
get invalid() {
|
|
10
10
|
return t().state.meta.errors.length > 0;
|
|
11
11
|
},
|
|
@@ -19,13 +19,13 @@ const y = (n) => {
|
|
|
19
19
|
return r.readOnly ?? !1;
|
|
20
20
|
},
|
|
21
21
|
get children() {
|
|
22
|
-
return [e(
|
|
22
|
+
return [e(a, {
|
|
23
23
|
get children() {
|
|
24
24
|
return r.label;
|
|
25
25
|
}
|
|
26
|
-
}), e(
|
|
26
|
+
}), e(o, {
|
|
27
27
|
get children() {
|
|
28
|
-
return [e(
|
|
28
|
+
return [e(m, {
|
|
29
29
|
get value() {
|
|
30
30
|
return String(t().state.value);
|
|
31
31
|
},
|
|
@@ -46,27 +46,26 @@ const y = (n) => {
|
|
|
46
46
|
},
|
|
47
47
|
get required() {
|
|
48
48
|
return r.required ?? !1;
|
|
49
|
-
}
|
|
50
|
-
}, l, {
|
|
49
|
+
},
|
|
51
50
|
get children() {
|
|
52
51
|
return e(h, {
|
|
53
52
|
get children() {
|
|
54
|
-
return [e(
|
|
53
|
+
return [e(p, l), e(u, {
|
|
55
54
|
get when() {
|
|
56
|
-
return r.
|
|
55
|
+
return r.showTriggers !== !1;
|
|
57
56
|
},
|
|
58
57
|
get children() {
|
|
59
|
-
return e(
|
|
58
|
+
return e(c, {});
|
|
60
59
|
}
|
|
61
60
|
})];
|
|
62
61
|
}
|
|
63
62
|
});
|
|
64
63
|
}
|
|
65
|
-
})
|
|
64
|
+
}), e(s, {
|
|
66
65
|
get errors() {
|
|
67
66
|
return t().state.meta.errors;
|
|
68
67
|
}
|
|
69
|
-
}), e(
|
|
68
|
+
}), e(g, {
|
|
70
69
|
get children() {
|
|
71
70
|
return r.description;
|
|
72
71
|
}
|
|
@@ -77,6 +76,6 @@ const y = (n) => {
|
|
|
77
76
|
});
|
|
78
77
|
};
|
|
79
78
|
export {
|
|
80
|
-
|
|
79
|
+
v as NumberInputField
|
|
81
80
|
};
|
|
82
81
|
//# sourceMappingURL=NumberInputField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberInputField.js","sources":["../../../src/components/form/NumberInputField.tsx"],"sourcesContent":["import type { Component, ComponentProps } from 'solid-js';\n\nimport { Field, FieldLabel, FieldContent, FieldError, FieldDescription } from '@/components/Field';\nimport {\n NumberInput,\n NumberInputControl,\n NumberInputInput,\n NumberInputTriggers,\n} from '@/components/NumberInput';\n\nimport { useFieldContext } from './context';\n\nexport type NumberInputFieldProps = ComponentProps<typeof
|
|
1
|
+
{"version":3,"file":"NumberInputField.js","sources":["../../../src/components/form/NumberInputField.tsx"],"sourcesContent":["import type { Component, ComponentProps } from 'solid-js';\n\nimport { Field, FieldLabel, FieldContent, FieldError, FieldDescription } from '@/components/Field';\nimport {\n NumberInput,\n NumberInputControl,\n NumberInputInput,\n NumberInputTriggers,\n} from '@/components/NumberInput';\n\nimport { useFieldContext } from './context';\n\nexport type NumberInputFieldProps = ComponentProps<typeof NumberInputInput> & {\n label?: string;\n description?: string;\n showTriggers?: boolean;\n};\n\nexport const NumberInputField: Component<NumberInputFieldProps> = (props) => {\n const field = useFieldContext<number>();\n const [local, others] = splitProps(props, [\n 'label',\n 'description',\n 'required',\n 'disabled',\n 'readOnly',\n 'showTriggers',\n ]);\n\n return (\n <Field\n invalid={field().state.meta.errors.length > 0}\n required={local.required ?? false}\n disabled={local.disabled ?? false}\n readOnly={local.readOnly ?? false}\n >\n <FieldLabel>{local.label}</FieldLabel>\n <FieldContent>\n <NumberInput\n value={String(field().state.value)}\n onValueChange={(details) => {\n field().handleChange(details.valueAsNumber);\n }}\n onBlur={() => {\n field().handleBlur();\n }}\n invalid={field().state.meta.errors.length > 0}\n disabled={local.disabled ?? false}\n readOnly={local.readOnly ?? false}\n required={local.required ?? false}\n >\n <NumberInputControl>\n <NumberInputInput {...others} />\n <Show when={local.showTriggers !== false}>\n <NumberInputTriggers />\n </Show>\n </NumberInputControl>\n </NumberInput>\n <FieldError errors={field().state.meta.errors} />\n <FieldDescription>{local.description}</FieldDescription>\n </FieldContent>\n </Field>\n );\n};\n"],"names":["NumberInputField","props","field","useFieldContext","local","others","splitProps","_$createComponent","Field","invalid","state","meta","errors","length","required","disabled","readOnly","children","FieldLabel","label","FieldContent","NumberInput","value","String","onValueChange","details","handleChange","valueAsNumber","onBlur","handleBlur","NumberInputControl","NumberInputInput","_$Show","when","showTriggers","NumberInputTriggers","FieldError","FieldDescription","description"],"mappings":";;;;;AAkBO,MAAMA,IAAsDC,CAAAA,MAAU;AAC3E,QAAMC,IAAQC,EAAAA,GACR,CAACC,GAAOC,CAAM,IAAIC,EAAWL,GAAO,CACxC,SACA,eACA,YACA,YACA,YACA,cAAc,CACf;AAED,SAAAM,EACGC,GAAK;AAAA,IAAA,IACJC,UAAO;AAAA,aAAEP,EAAAA,EAAQQ,MAAMC,KAAKC,OAAOC,SAAS;AAAA,IAAC;AAAA,IAAA,IAC7CC,WAAQ;AAAA,aAAEV,EAAMU,YAAY;AAAA,IAAK;AAAA,IAAA,IACjCC,WAAQ;AAAA,aAAEX,EAAMW,YAAY;AAAA,IAAK;AAAA,IAAA,IACjCC,WAAQ;AAAA,aAAEZ,EAAMY,YAAY;AAAA,IAAK;AAAA,IAAA,IAAAC,WAAA;AAAA,aAAA,CAAAV,EAEhCW,GAAU;AAAA,QAAA,IAAA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A,IAAApB,WAAA;AAAA,qBAAEb,EAAMkC;AAAAA,YAAW;AAAA,UAAA,CAAA,CAAA;AAAA,QAAA;AAAA,MAAA,CAAA,CAAA;AAAA,IAAA;AAAA,EAAA,CAAA;AAI5C;"}
|
|
@@ -3,5 +3,6 @@ import { PasswordInputInput } from '../PasswordInput';
|
|
|
3
3
|
export type PasswordInputFieldProps = ComponentProps<typeof PasswordInputInput> & {
|
|
4
4
|
label?: string;
|
|
5
5
|
description?: string;
|
|
6
|
+
showVisibilityTrigger?: boolean;
|
|
6
7
|
};
|
|
7
8
|
export declare const PasswordInputField: Component<PasswordInputFieldProps>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { createComponent as e, mergeProps as
|
|
1
|
+
import { createComponent as e, mergeProps as d, Show as s } from "solid-js/web";
|
|
2
2
|
import { splitProps as a } from "solid-js";
|
|
3
|
-
import { Field as
|
|
4
|
-
import { PasswordInput as c, PasswordInputControl as m, PasswordInputInput as
|
|
3
|
+
import { Field as o, FieldLabel as u, FieldContent as g, FieldError as p, FieldDescription as h } from "../Field.js";
|
|
4
|
+
import { PasswordInput as c, PasswordInputControl as m, PasswordInputInput as f, PasswordInputVisibilityTrigger as b, PasswordInputIndicator as w } from "../PasswordInput.js";
|
|
5
5
|
import { useFieldContext as I } from "./context.js";
|
|
6
|
-
const
|
|
7
|
-
const t = I(), [r,
|
|
8
|
-
return e(
|
|
6
|
+
const C = (n) => {
|
|
7
|
+
const t = I(), [r, i] = a(n, ["label", "description", "required", "disabled", "readOnly", "showVisibilityTrigger"]);
|
|
8
|
+
return e(o, {
|
|
9
9
|
get invalid() {
|
|
10
10
|
return t().state.meta.errors.length > 0;
|
|
11
11
|
},
|
|
@@ -19,11 +19,11 @@ const v = (n) => {
|
|
|
19
19
|
return r.readOnly ?? !1;
|
|
20
20
|
},
|
|
21
21
|
get children() {
|
|
22
|
-
return [e(
|
|
22
|
+
return [e(u, {
|
|
23
23
|
get children() {
|
|
24
24
|
return r.label;
|
|
25
25
|
}
|
|
26
|
-
}), e(
|
|
26
|
+
}), e(g, {
|
|
27
27
|
get children() {
|
|
28
28
|
return [e(c, {
|
|
29
29
|
get invalid() {
|
|
@@ -41,29 +41,36 @@ const v = (n) => {
|
|
|
41
41
|
get children() {
|
|
42
42
|
return e(m, {
|
|
43
43
|
get children() {
|
|
44
|
-
return [e(
|
|
44
|
+
return [e(f, d({
|
|
45
45
|
get value() {
|
|
46
46
|
return t().state.value;
|
|
47
47
|
},
|
|
48
|
-
onInput: (
|
|
49
|
-
t().handleChange(
|
|
48
|
+
onInput: (l) => {
|
|
49
|
+
t().handleChange(l.target.value);
|
|
50
50
|
},
|
|
51
51
|
onBlur: () => {
|
|
52
52
|
t().handleBlur();
|
|
53
53
|
}
|
|
54
|
-
},
|
|
54
|
+
}, i)), e(s, {
|
|
55
|
+
get when() {
|
|
56
|
+
return r.showVisibilityTrigger !== !1;
|
|
57
|
+
},
|
|
55
58
|
get children() {
|
|
56
|
-
return e(b, {
|
|
59
|
+
return e(b, {
|
|
60
|
+
get children() {
|
|
61
|
+
return e(w, {});
|
|
62
|
+
}
|
|
63
|
+
});
|
|
57
64
|
}
|
|
58
65
|
})];
|
|
59
66
|
}
|
|
60
67
|
});
|
|
61
68
|
}
|
|
62
|
-
}), e(
|
|
69
|
+
}), e(p, {
|
|
63
70
|
get errors() {
|
|
64
71
|
return t().state.meta.errors;
|
|
65
72
|
}
|
|
66
|
-
}), e(
|
|
73
|
+
}), e(h, {
|
|
67
74
|
get children() {
|
|
68
75
|
return r.description;
|
|
69
76
|
}
|
|
@@ -74,6 +81,6 @@ const v = (n) => {
|
|
|
74
81
|
});
|
|
75
82
|
};
|
|
76
83
|
export {
|
|
77
|
-
|
|
84
|
+
C as PasswordInputField
|
|
78
85
|
};
|
|
79
86
|
//# sourceMappingURL=PasswordInputField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordInputField.js","sources":["../../../src/components/form/PasswordInputField.tsx"],"sourcesContent":["import { splitProps, type Component, type ComponentProps } from 'solid-js';\n\nimport { Field, FieldLabel, FieldContent, FieldError, FieldDescription } from '@/components/Field';\nimport {\n PasswordInput,\n PasswordInputControl,\n PasswordInputInput,\n PasswordInputVisibilityTrigger,\n PasswordInputIndicator,\n} from '@/components/PasswordInput';\n\nimport { useFieldContext } from './context';\n\nexport type PasswordInputFieldProps = ComponentProps<typeof PasswordInputInput> & {\n label?: string;\n description?: string;\n};\n\nexport const PasswordInputField: Component<PasswordInputFieldProps> = (props) => {\n const field = useFieldContext<string>();\n const [local, others] = splitProps(props, [\n 'label',\n 'description',\n 'required',\n 'disabled',\n 'readOnly',\n ]);\n\n return (\n <Field\n invalid={field().state.meta.errors.length > 0}\n required={local.required ?? false}\n disabled={local.disabled ?? false}\n readOnly={local.readOnly ?? false}\n >\n <FieldLabel>{local.label}</FieldLabel>\n <FieldContent>\n <PasswordInput\n invalid={field().state.meta.errors.length > 0}\n disabled={local.disabled ?? false}\n readOnly={local.readOnly ?? false}\n required={local.required ?? false}\n >\n <PasswordInputControl>\n <PasswordInputInput\n value={field().state.value}\n onInput={(event) => {\n field().handleChange(event.target.value);\n }}\n onBlur={() => {\n field().handleBlur();\n }}\n {...others}\n />\n <
|
|
1
|
+
{"version":3,"file":"PasswordInputField.js","sources":["../../../src/components/form/PasswordInputField.tsx"],"sourcesContent":["import { splitProps, type Component, type ComponentProps } from 'solid-js';\n\nimport { Field, FieldLabel, FieldContent, FieldError, FieldDescription } from '@/components/Field';\nimport {\n PasswordInput,\n PasswordInputControl,\n PasswordInputInput,\n PasswordInputVisibilityTrigger,\n PasswordInputIndicator,\n} from '@/components/PasswordInput';\n\nimport { useFieldContext } from './context';\n\nexport type PasswordInputFieldProps = ComponentProps<typeof PasswordInputInput> & {\n label?: string;\n description?: string;\n showVisibilityTrigger?: boolean;\n};\n\nexport const PasswordInputField: Component<PasswordInputFieldProps> = (props) => {\n const field = useFieldContext<string>();\n const [local, others] = splitProps(props, [\n 'label',\n 'description',\n 'required',\n 'disabled',\n 'readOnly',\n 'showVisibilityTrigger',\n ]);\n\n return (\n <Field\n invalid={field().state.meta.errors.length > 0}\n required={local.required ?? false}\n disabled={local.disabled ?? false}\n readOnly={local.readOnly ?? false}\n >\n <FieldLabel>{local.label}</FieldLabel>\n <FieldContent>\n <PasswordInput\n invalid={field().state.meta.errors.length > 0}\n disabled={local.disabled ?? false}\n readOnly={local.readOnly ?? false}\n required={local.required ?? false}\n >\n <PasswordInputControl>\n <PasswordInputInput\n value={field().state.value}\n onInput={(event) => {\n field().handleChange(event.target.value);\n }}\n onBlur={() => {\n field().handleBlur();\n }}\n {...others}\n />\n <Show when={local.showVisibilityTrigger !== false}>\n <PasswordInputVisibilityTrigger>\n <PasswordInputIndicator />\n </PasswordInputVisibilityTrigger>\n </Show>\n </PasswordInputControl>\n </PasswordInput>\n <FieldError errors={field().state.meta.errors} />\n <FieldDescription>{local.description}</FieldDescription>\n </FieldContent>\n </Field>\n );\n};\n"],"names":["PasswordInputField","props","field","useFieldContext","local","others","splitProps","_$createComponent","Field","invalid","state","meta","errors","length","required","disabled","readOnly","children","FieldLabel","label","FieldContent","PasswordInput","PasswordInputControl","PasswordInputInput","_$mergeProps","value","onInput","event","handleChange","target","onBlur","handleBlur","_$Show","when","showVisibilityTrigger","PasswordInputVisibilityTrigger","PasswordInputIndicator","FieldError","FieldDescription","description"],"mappings":";;;;;AAmBO,MAAMA,IAA0DC,CAAAA,MAAU;AAC/E,QAAMC,IAAQC,EAAAA,GACR,CAACC,GAAOC,CAAM,IAAIC,EAAWL,GAAO,CACxC,SACA,eACA,YACA,YACA,YACA,uBAAuB,CACxB;AAED,SAAAM,EACGC,GAAK;AAAA,IAAA,IACJC,UAAO;AAAA,aAAEP,EAAAA,EAAQQ,MAAMC,KAAKC,OAAOC,SAAS;AAAA,IAAC;AAAA,IAAA,IAC7CC,WAAQ;AAAA,aAAEV,EAAMU,YAAY;AAAA,IAAK;AAAA,IAAA,IACjCC,WAAQ;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CAAAV,EAC5B6B,GAAsB,EAAA;AAAA,wBAAA;AAAA,sBAAA,CAAA;AAAA,oBAAA;AAAA,kBAAA,CAAA,CAAA;AAAA,gBAAA;AAAA,cAAA,CAAA;AAAA,YAAA;AAAA,UAAA,CAAA,GAAA7B,EAK9B8B,GAAU;AAAA,YAAA,IAACzB,SAAM;AAAA,qBAAEV,EAAAA,EAAQQ,MAAMC,KAAKC;AAAAA,YAAM;AAAA,UAAA,CAAA,GAAAL,EAC5C+B,GAAgB;AAAA,YAAA,IAAArB,WAAA;AAAA,qBAAEb,EAAMmC;AAAAA,YAAW;AAAA,UAAA,CAAA,CAAA;AAAA,QAAA;AAAA,MAAA,CAAA,CAAA;AAAA,IAAA;AAAA,EAAA,CAAA;AAI5C;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export type TagsInputFieldProps =
|
|
1
|
+
import { Component, ComponentProps } from 'solid-js';
|
|
2
|
+
import { TagsInputInput } from '../TagsInput';
|
|
3
|
+
export type TagsInputFieldProps = ComponentProps<typeof TagsInputInput> & {
|
|
4
4
|
label?: string;
|
|
5
5
|
description?: string;
|
|
6
|
-
|
|
6
|
+
showClearTrigger?: boolean;
|
|
7
7
|
};
|
|
8
8
|
export declare const TagsInputField: Component<TagsInputFieldProps>;
|
|
@@ -1,40 +1,46 @@
|
|
|
1
|
-
import { createComponent as e, mergeProps as
|
|
2
|
-
import { splitProps as
|
|
3
|
-
import { Field as
|
|
4
|
-
import { TagsInput as
|
|
5
|
-
import { useFieldContext as
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
import { createComponent as e, mergeProps as o, Show as s, memo as u } from "solid-js/web";
|
|
2
|
+
import { splitProps as i, For as d } from "solid-js";
|
|
3
|
+
import { Field as h, FieldLabel as p, FieldContent as c, FieldError as T, FieldDescription as I } from "../Field.js";
|
|
4
|
+
import { TagsInput as m, TagsInputContext as C, TagsInputControl as f, TagsInputItem as b, TagsInputItemPreview as w, TagsInputItemText as F, TagsInputItemDeleteTrigger as v, TagsInputItemInput as y, TagsInputInput as O, TagsInputClearTrigger as P, TagsInputHiddenInput as x } from "../TagsInput.js";
|
|
5
|
+
import { useFieldContext as q } from "./context.js";
|
|
6
|
+
const D = (l) => {
|
|
7
|
+
const [t, r] = i(l, ["children", "showClearTrigger"]);
|
|
8
|
+
return [e(C, {
|
|
9
|
+
children: (a) => e(f, {
|
|
10
|
+
get children() {
|
|
11
|
+
return [e(d, {
|
|
12
|
+
get each() {
|
|
13
|
+
return a().value;
|
|
14
|
+
},
|
|
15
|
+
children: (n, g) => e(b, {
|
|
16
|
+
get index() {
|
|
17
|
+
return g();
|
|
18
|
+
},
|
|
19
|
+
value: n,
|
|
20
|
+
get children() {
|
|
21
|
+
return [e(w, {
|
|
22
|
+
get children() {
|
|
23
|
+
return [e(F, {
|
|
24
|
+
children: n
|
|
25
|
+
}), e(v, {})];
|
|
26
|
+
}
|
|
27
|
+
}), e(y, {})];
|
|
28
|
+
}
|
|
29
|
+
})
|
|
30
|
+
}), e(O, r), e(s, {
|
|
31
|
+
get when() {
|
|
32
|
+
return t.showClearTrigger !== !1;
|
|
16
33
|
},
|
|
17
|
-
value: r,
|
|
18
34
|
get children() {
|
|
19
|
-
return
|
|
20
|
-
get children() {
|
|
21
|
-
return [e(F, {
|
|
22
|
-
children: r
|
|
23
|
-
}), e(b, {})];
|
|
24
|
-
}
|
|
25
|
-
}), e(C, {})];
|
|
35
|
+
return e(P, {});
|
|
26
36
|
}
|
|
27
|
-
})
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
})
|
|
35
|
-
}), e(P, {})], q = ["label", "description", "required", "disabled", "readOnly", "placeholder"], L = (n) => {
|
|
36
|
-
const t = x(), [r, l] = u(n, q);
|
|
37
|
-
return e(o, {
|
|
37
|
+
}), u(() => t.children)];
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
}), e(x, {})];
|
|
41
|
+
}, S = ["label", "description", "required", "disabled", "readOnly", "showClearTrigger"], A = (l) => {
|
|
42
|
+
const t = q(), [r, a] = i(l, S);
|
|
43
|
+
return e(h, {
|
|
38
44
|
get invalid() {
|
|
39
45
|
return t().state.meta.errors.length > 0;
|
|
40
46
|
},
|
|
@@ -48,18 +54,18 @@ const y = (n) => [e(I, {
|
|
|
48
54
|
return r.required ?? !1;
|
|
49
55
|
},
|
|
50
56
|
get children() {
|
|
51
|
-
return [e(
|
|
57
|
+
return [e(p, {
|
|
52
58
|
get children() {
|
|
53
59
|
return r.label;
|
|
54
60
|
}
|
|
55
|
-
}), e(
|
|
61
|
+
}), e(c, {
|
|
56
62
|
get children() {
|
|
57
|
-
return [e(
|
|
63
|
+
return [e(m, {
|
|
58
64
|
get value() {
|
|
59
65
|
return t().state.value;
|
|
60
66
|
},
|
|
61
|
-
onValueChange: (
|
|
62
|
-
t().handleChange(
|
|
67
|
+
onValueChange: (n) => {
|
|
68
|
+
t().handleChange(n.value);
|
|
63
69
|
},
|
|
64
70
|
onBlur: () => {
|
|
65
71
|
t().handleBlur();
|
|
@@ -72,20 +78,17 @@ const y = (n) => [e(I, {
|
|
|
72
78
|
},
|
|
73
79
|
get readOnly() {
|
|
74
80
|
return r.readOnly ?? !1;
|
|
75
|
-
}
|
|
76
|
-
}, l, {
|
|
81
|
+
},
|
|
77
82
|
get children() {
|
|
78
|
-
return e(
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
+
return e(D, o(a, () => typeof r.showClearTrigger == "boolean" && {
|
|
84
|
+
showClearTrigger: r.showClearTrigger
|
|
85
|
+
}));
|
|
83
86
|
}
|
|
84
|
-
})
|
|
87
|
+
}), e(T, {
|
|
85
88
|
get errors() {
|
|
86
89
|
return t().state.meta.errors;
|
|
87
90
|
}
|
|
88
|
-
}), e(
|
|
91
|
+
}), e(I, {
|
|
89
92
|
get children() {
|
|
90
93
|
return r.description;
|
|
91
94
|
}
|
|
@@ -96,6 +99,6 @@ const y = (n) => [e(I, {
|
|
|
96
99
|
});
|
|
97
100
|
};
|
|
98
101
|
export {
|
|
99
|
-
|
|
102
|
+
A as TagsInputField
|
|
100
103
|
};
|
|
101
104
|
//# sourceMappingURL=TagsInputField.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TagsInputField.js","sources":["../../../src/components/form/TagsInputField.tsx"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"TagsInputField.js","sources":["../../../src/components/form/TagsInputField.tsx"],"sourcesContent":["import { type Component, type ComponentProps, splitProps, For } from 'solid-js';\n\nimport { Field, FieldContent, FieldDescription, FieldError, FieldLabel } from '@/components/Field';\nimport {\n TagsInput,\n TagsInputClearTrigger,\n TagsInputContext,\n TagsInputControl,\n TagsInputHiddenInput,\n TagsInputInput,\n TagsInputItemInput,\n TagsInputItemPreview,\n TagsInputItemText,\n TagsInputItem,\n TagsInputItemDeleteTrigger,\n} from '@/components/TagsInput';\n\nimport { useFieldContext } from './context';\n\nexport type TagsInputFieldProps = ComponentProps<typeof TagsInputInput> & {\n label?: string;\n description?: string;\n showClearTrigger?: boolean;\n};\n\nconst TagsInputGroup: Component<\n ComponentProps<typeof TagsInputInput> & { showClearTrigger?: boolean }\n> = (props) => {\n const [local, others] = splitProps(props, ['children', 'showClearTrigger']);\n\n return (\n <>\n <TagsInputContext>\n {(context) => (\n <TagsInputControl>\n <For each={context().value}>\n {(value, index) => (\n <TagsInputItem index={index()} value={value}>\n <TagsInputItemPreview>\n <TagsInputItemText>{value}</TagsInputItemText>\n <TagsInputItemDeleteTrigger />\n </TagsInputItemPreview>\n <TagsInputItemInput />\n </TagsInputItem>\n )}\n </For>\n <TagsInputInput {...others} />\n <Show when={local.showClearTrigger !== false}>\n <TagsInputClearTrigger />\n </Show>\n {local.children}\n </TagsInputControl>\n )}\n </TagsInputContext>\n <TagsInputHiddenInput />\n </>\n );\n};\n\nconst TAGS_INPUT_FIELD_PROPS = [\n 'label',\n 'description',\n 'required',\n 'disabled',\n 'readOnly',\n 'showClearTrigger',\n] as const;\n\nexport const TagsInputField: Component<TagsInputFieldProps> = (props) => {\n const field = useFieldContext<string[]>();\n const [local, others] = splitProps(props, TAGS_INPUT_FIELD_PROPS);\n\n return (\n <Field\n invalid={field().state.meta.errors.length > 0}\n disabled={local.disabled ?? false}\n readOnly={local.readOnly ?? false}\n required={local.required ?? false}\n >\n <FieldLabel>{local.label}</FieldLabel>\n <FieldContent>\n <TagsInput\n value={field().state.value}\n onValueChange={(details) => {\n field().handleChange(details.value);\n }}\n onBlur={() => {\n field().handleBlur();\n }}\n invalid={field().state.meta.errors.length > 0}\n disabled={local.disabled ?? false}\n readOnly={local.readOnly ?? false}\n >\n <TagsInputGroup\n {...others}\n {...(typeof local.showClearTrigger === 'boolean' && {\n showClearTrigger: local.showClearTrigger,\n })}\n />\n </TagsInput>\n <FieldError errors={field().state.meta.errors} />\n <FieldDescription>{local.description}</FieldDescription>\n </FieldContent>\n </Field>\n );\n};\n"],"names":["TagsInputGroup","props","local","others","splitProps","_$createComponent","TagsInputContext","children","context","TagsInputControl","For","each","value","index","TagsInputItem","TagsInputItemPreview","TagsInputItemText","TagsInputItemDeleteTrigger","TagsInputItemInput","TagsInputInput","_$Show","when","showClearTrigger","TagsInputClearTrigger","_$memo","TagsInputHiddenInput","TAGS_INPUT_FIELD_PROPS","TagsInputField","field","useFieldContext","Field","invalid","state","meta","errors","length","disabled","readOnly","required","FieldLabel","label","FieldContent","TagsInput","onValueChange","details","handleChange","onBlur","handleBlur","_$mergeProps","FieldError","FieldDescription","description"],"mappings":";;;;;AAyBA,MAAMA,IAEDC,CAAAA,MAAU;AACb,QAAM,CAACC,GAAOC,CAAM,IAAIC,EAAWH,GAAO,CAAC,YAAY,kBAAkB,CAAC;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AAAA,EAAQI,MAAMC,KAAKC;AAAAA,YAAM;AAAA,UAAA,CAAA,GAAA7B,EAC5C6C,GAAgB;AAAA,YAAA,IAAA3C,WAAA;AAAA,qBAAEL,EAAMiD;AAAAA,YAAW;AAAA,UAAA,CAAA,CAAA;AAAA,QAAA;AAAA,MAAA,CAAA,CAAA;AAAA,IAAA;AAAA,EAAA,CAAA;AAI5C;"}
|
package/package.json
CHANGED
|
@@ -15,34 +15,39 @@ import { Field, FieldContent, FieldDescription, FieldError, FieldLabel } from '@
|
|
|
15
15
|
|
|
16
16
|
import { useFieldContext } from './context';
|
|
17
17
|
|
|
18
|
-
export type ComboboxFieldProps =
|
|
18
|
+
export type ComboboxFieldProps = ComponentProps<typeof ComboboxInput> & {
|
|
19
|
+
collection: ComboboxRootProps<string>['collection'];
|
|
19
20
|
label?: string;
|
|
20
21
|
description?: string;
|
|
21
22
|
showTrigger?: boolean;
|
|
22
|
-
|
|
23
|
+
showClearTrigger?: boolean;
|
|
23
24
|
} & { class?: string };
|
|
24
25
|
|
|
25
26
|
const ComboboxInputGroup: Component<
|
|
26
27
|
ComponentProps<typeof ComboboxInput> & {
|
|
27
28
|
showTrigger?: boolean | undefined;
|
|
28
|
-
|
|
29
|
+
showClearTrigger?: boolean | undefined;
|
|
29
30
|
}
|
|
30
|
-
> = (props) =>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
{
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
31
|
+
> = (props) => {
|
|
32
|
+
const [local, others] = splitProps(props, ['showTrigger', 'showClearTrigger', 'children']);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<>
|
|
36
|
+
<ComboboxControl>
|
|
37
|
+
<ComboboxInput {...others} />
|
|
38
|
+
<div class='gap-1 flex items-center'>
|
|
39
|
+
{local.showClearTrigger === true && <ComboboxClearTrigger />}
|
|
40
|
+
{local.showTrigger === true && <ComboboxTrigger />}
|
|
41
|
+
</div>
|
|
42
|
+
</ComboboxControl>
|
|
43
|
+
<ComboboxPositioner>
|
|
44
|
+
<ComboboxContent>
|
|
45
|
+
<ComboboxList>{local.children}</ComboboxList>
|
|
46
|
+
</ComboboxContent>
|
|
47
|
+
</ComboboxPositioner>
|
|
48
|
+
</>
|
|
49
|
+
);
|
|
50
|
+
};
|
|
46
51
|
|
|
47
52
|
const COMBOBOX_FIELD_PROPS = [
|
|
48
53
|
'label',
|
|
@@ -50,9 +55,9 @@ const COMBOBOX_FIELD_PROPS = [
|
|
|
50
55
|
'required',
|
|
51
56
|
'disabled',
|
|
52
57
|
'readOnly',
|
|
53
|
-
'
|
|
58
|
+
'collection',
|
|
54
59
|
'showTrigger',
|
|
55
|
-
'
|
|
60
|
+
'showClearTrigger',
|
|
56
61
|
'children',
|
|
57
62
|
] as const;
|
|
58
63
|
|
|
@@ -69,7 +74,8 @@ export const ComboboxField: Component<ComboboxFieldProps> = (props) => {
|
|
|
69
74
|
>
|
|
70
75
|
<FieldLabel>{local.label}</FieldLabel>
|
|
71
76
|
<FieldContent>
|
|
72
|
-
<Combobox
|
|
77
|
+
<Combobox<string>
|
|
78
|
+
collection={local.collection}
|
|
73
79
|
value={field().state.value}
|
|
74
80
|
onValueChange={(details) => {
|
|
75
81
|
field().handleChange(details.value);
|
|
@@ -80,12 +86,11 @@ export const ComboboxField: Component<ComboboxFieldProps> = (props) => {
|
|
|
80
86
|
invalid={field().state.meta.errors.length > 0}
|
|
81
87
|
disabled={local.disabled ?? false}
|
|
82
88
|
readOnly={local.readOnly ?? false}
|
|
83
|
-
{...others}
|
|
84
89
|
>
|
|
85
90
|
<ComboboxInputGroup
|
|
86
|
-
placeholder={local.placeholder}
|
|
87
91
|
showTrigger={local.showTrigger}
|
|
88
|
-
|
|
92
|
+
showClearTrigger={local.showClearTrigger}
|
|
93
|
+
{...others}
|
|
89
94
|
>
|
|
90
95
|
{local.children}
|
|
91
96
|
</ComboboxInputGroup>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DatePickerInputProps,
|
|
1
|
+
import type { DatePickerInputProps, DateValue } from '@ark-ui/solid';
|
|
2
2
|
import type { Component } from 'solid-js';
|
|
3
3
|
|
|
4
4
|
import {
|
|
@@ -14,24 +14,33 @@ import { Field, FieldContent, FieldDescription, FieldError, FieldLabel } from '@
|
|
|
14
14
|
|
|
15
15
|
import { useFieldContext } from './context';
|
|
16
16
|
|
|
17
|
-
export type DatePickerFieldProps =
|
|
17
|
+
export type DatePickerFieldProps = DatePickerInputProps & {
|
|
18
18
|
label?: string;
|
|
19
19
|
description?: string;
|
|
20
|
+
showTrigger?: boolean;
|
|
20
21
|
};
|
|
21
22
|
|
|
22
|
-
const DatePickerInputGroup: Component<DatePickerInputProps> = (
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
const DatePickerInputGroup: Component<DatePickerInputProps & { showTrigger?: boolean }> = (
|
|
24
|
+
props,
|
|
25
|
+
) => {
|
|
26
|
+
const [local, others] = splitProps(props, ['showTrigger']);
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<>
|
|
30
|
+
<DatePickerControl>
|
|
31
|
+
<DatePickerInput {...others} />
|
|
32
|
+
<Show when={local.showTrigger !== false}>
|
|
33
|
+
<DatePickerTrigger />
|
|
34
|
+
</Show>
|
|
35
|
+
</DatePickerControl>
|
|
36
|
+
<DatePickerPositioner>
|
|
37
|
+
<DatePickerContent>
|
|
38
|
+
<DatePickerViews />
|
|
39
|
+
</DatePickerContent>
|
|
40
|
+
</DatePickerPositioner>
|
|
41
|
+
</>
|
|
42
|
+
);
|
|
43
|
+
};
|
|
35
44
|
|
|
36
45
|
const DATE_PICKER_FIELD_PROPS = [
|
|
37
46
|
'label',
|
|
@@ -40,6 +49,7 @@ const DATE_PICKER_FIELD_PROPS = [
|
|
|
40
49
|
'disabled',
|
|
41
50
|
'readOnly',
|
|
42
51
|
'placeholder',
|
|
52
|
+
'showTrigger',
|
|
43
53
|
] as const;
|
|
44
54
|
|
|
45
55
|
export const DatePickerField: Component<DatePickerFieldProps> = (props) => {
|
|
@@ -66,9 +76,12 @@ export const DatePickerField: Component<DatePickerFieldProps> = (props) => {
|
|
|
66
76
|
invalid={field().state.meta.errors.length > 0}
|
|
67
77
|
disabled={local.disabled ?? false}
|
|
68
78
|
readOnly={local.readOnly ?? false}
|
|
69
|
-
{...others}
|
|
70
79
|
>
|
|
71
|
-
<DatePickerInputGroup
|
|
80
|
+
<DatePickerInputGroup
|
|
81
|
+
{...others}
|
|
82
|
+
placeholder={local.placeholder}
|
|
83
|
+
{...(typeof local.showTrigger === 'boolean' && { showTrigger: local.showTrigger })}
|
|
84
|
+
/>
|
|
72
85
|
</DatePicker>
|
|
73
86
|
<FieldError errors={field().state.meta.errors} />
|
|
74
87
|
<FieldDescription>{local.description}</FieldDescription>
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
|
|
11
11
|
import { useFieldContext } from './context';
|
|
12
12
|
|
|
13
|
-
export type NumberInputFieldProps = ComponentProps<typeof
|
|
13
|
+
export type NumberInputFieldProps = ComponentProps<typeof NumberInputInput> & {
|
|
14
14
|
label?: string;
|
|
15
15
|
description?: string;
|
|
16
|
-
|
|
16
|
+
showTriggers?: boolean;
|
|
17
17
|
};
|
|
18
18
|
|
|
19
19
|
export const NumberInputField: Component<NumberInputFieldProps> = (props) => {
|
|
@@ -24,7 +24,7 @@ export const NumberInputField: Component<NumberInputFieldProps> = (props) => {
|
|
|
24
24
|
'required',
|
|
25
25
|
'disabled',
|
|
26
26
|
'readOnly',
|
|
27
|
-
'
|
|
27
|
+
'showTriggers',
|
|
28
28
|
]);
|
|
29
29
|
|
|
30
30
|
return (
|
|
@@ -48,11 +48,10 @@ export const NumberInputField: Component<NumberInputFieldProps> = (props) => {
|
|
|
48
48
|
disabled={local.disabled ?? false}
|
|
49
49
|
readOnly={local.readOnly ?? false}
|
|
50
50
|
required={local.required ?? false}
|
|
51
|
-
{...others}
|
|
52
51
|
>
|
|
53
52
|
<NumberInputControl>
|
|
54
|
-
<NumberInputInput />
|
|
55
|
-
<Show when={local.
|
|
53
|
+
<NumberInputInput {...others} />
|
|
54
|
+
<Show when={local.showTriggers !== false}>
|
|
56
55
|
<NumberInputTriggers />
|
|
57
56
|
</Show>
|
|
58
57
|
</NumberInputControl>
|
|
@@ -14,6 +14,7 @@ import { useFieldContext } from './context';
|
|
|
14
14
|
export type PasswordInputFieldProps = ComponentProps<typeof PasswordInputInput> & {
|
|
15
15
|
label?: string;
|
|
16
16
|
description?: string;
|
|
17
|
+
showVisibilityTrigger?: boolean;
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
export const PasswordInputField: Component<PasswordInputFieldProps> = (props) => {
|
|
@@ -24,6 +25,7 @@ export const PasswordInputField: Component<PasswordInputFieldProps> = (props) =>
|
|
|
24
25
|
'required',
|
|
25
26
|
'disabled',
|
|
26
27
|
'readOnly',
|
|
28
|
+
'showVisibilityTrigger',
|
|
27
29
|
]);
|
|
28
30
|
|
|
29
31
|
return (
|
|
@@ -52,9 +54,11 @@ export const PasswordInputField: Component<PasswordInputFieldProps> = (props) =>
|
|
|
52
54
|
}}
|
|
53
55
|
{...others}
|
|
54
56
|
/>
|
|
55
|
-
<
|
|
56
|
-
<
|
|
57
|
-
|
|
57
|
+
<Show when={local.showVisibilityTrigger !== false}>
|
|
58
|
+
<PasswordInputVisibilityTrigger>
|
|
59
|
+
<PasswordInputIndicator />
|
|
60
|
+
</PasswordInputVisibilityTrigger>
|
|
61
|
+
</Show>
|
|
58
62
|
</PasswordInputControl>
|
|
59
63
|
</PasswordInput>
|
|
60
64
|
<FieldError errors={field().state.meta.errors} />
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
import { type Component, splitProps, For } from 'solid-js';
|
|
1
|
+
import { type Component, type ComponentProps, splitProps, For } from 'solid-js';
|
|
4
2
|
|
|
5
3
|
import { Field, FieldContent, FieldDescription, FieldError, FieldLabel } from '@/components/Field';
|
|
6
4
|
import {
|
|
@@ -19,36 +17,45 @@ import {
|
|
|
19
17
|
|
|
20
18
|
import { useFieldContext } from './context';
|
|
21
19
|
|
|
22
|
-
export type TagsInputFieldProps =
|
|
20
|
+
export type TagsInputFieldProps = ComponentProps<typeof TagsInputInput> & {
|
|
23
21
|
label?: string;
|
|
24
22
|
description?: string;
|
|
25
|
-
|
|
23
|
+
showClearTrigger?: boolean;
|
|
26
24
|
};
|
|
27
25
|
|
|
28
|
-
const TagsInputGroup: Component<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
26
|
+
const TagsInputGroup: Component<
|
|
27
|
+
ComponentProps<typeof TagsInputInput> & { showClearTrigger?: boolean }
|
|
28
|
+
> = (props) => {
|
|
29
|
+
const [local, others] = splitProps(props, ['children', 'showClearTrigger']);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<>
|
|
33
|
+
<TagsInputContext>
|
|
34
|
+
{(context) => (
|
|
35
|
+
<TagsInputControl>
|
|
36
|
+
<For each={context().value}>
|
|
37
|
+
{(value, index) => (
|
|
38
|
+
<TagsInputItem index={index()} value={value}>
|
|
39
|
+
<TagsInputItemPreview>
|
|
40
|
+
<TagsInputItemText>{value}</TagsInputItemText>
|
|
41
|
+
<TagsInputItemDeleteTrigger />
|
|
42
|
+
</TagsInputItemPreview>
|
|
43
|
+
<TagsInputItemInput />
|
|
44
|
+
</TagsInputItem>
|
|
45
|
+
)}
|
|
46
|
+
</For>
|
|
47
|
+
<TagsInputInput {...others} />
|
|
48
|
+
<Show when={local.showClearTrigger !== false}>
|
|
49
|
+
<TagsInputClearTrigger />
|
|
50
|
+
</Show>
|
|
51
|
+
{local.children}
|
|
52
|
+
</TagsInputControl>
|
|
53
|
+
)}
|
|
54
|
+
</TagsInputContext>
|
|
55
|
+
<TagsInputHiddenInput />
|
|
56
|
+
</>
|
|
57
|
+
);
|
|
58
|
+
};
|
|
52
59
|
|
|
53
60
|
const TAGS_INPUT_FIELD_PROPS = [
|
|
54
61
|
'label',
|
|
@@ -56,7 +63,7 @@ const TAGS_INPUT_FIELD_PROPS = [
|
|
|
56
63
|
'required',
|
|
57
64
|
'disabled',
|
|
58
65
|
'readOnly',
|
|
59
|
-
'
|
|
66
|
+
'showClearTrigger',
|
|
60
67
|
] as const;
|
|
61
68
|
|
|
62
69
|
export const TagsInputField: Component<TagsInputFieldProps> = (props) => {
|
|
@@ -83,9 +90,13 @@ export const TagsInputField: Component<TagsInputFieldProps> = (props) => {
|
|
|
83
90
|
invalid={field().state.meta.errors.length > 0}
|
|
84
91
|
disabled={local.disabled ?? false}
|
|
85
92
|
readOnly={local.readOnly ?? false}
|
|
86
|
-
{...others}
|
|
87
93
|
>
|
|
88
|
-
<TagsInputGroup
|
|
94
|
+
<TagsInputGroup
|
|
95
|
+
{...others}
|
|
96
|
+
{...(typeof local.showClearTrigger === 'boolean' && {
|
|
97
|
+
showClearTrigger: local.showClearTrigger,
|
|
98
|
+
})}
|
|
99
|
+
/>
|
|
89
100
|
</TagsInput>
|
|
90
101
|
<FieldError errors={field().state.meta.errors} />
|
|
91
102
|
<FieldDescription>{local.description}</FieldDescription>
|