@trsys-tech/matrix-library 0.4.1 → 0.4.2
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.
|
@@ -10,12 +10,13 @@ type FormComboboxProps<TFieldValues extends FieldValues, TName extends FieldPath
|
|
|
10
10
|
loading?: boolean;
|
|
11
11
|
loadingText?: string;
|
|
12
12
|
emptyOptionsText?: string;
|
|
13
|
+
showSearchInput?: boolean;
|
|
13
14
|
placeholder?: string;
|
|
14
15
|
required?: boolean;
|
|
15
16
|
slotProps?: {
|
|
16
17
|
formLabelProps?: React.HTMLAttributes<HTMLLabelElement> & React.RefAttributes<HTMLLabelElement>;
|
|
17
18
|
formMessageProps?: React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>;
|
|
18
|
-
comboboxProps?: React.
|
|
19
|
+
comboboxProps?: Omit<React.ComponentPropsWithoutRef<typeof Combobox>, "options" | "value" | "onValueChange" | "loading" | "loadingText" | "emptyOptionsText" | "placeholder" | "disabled" | "showSearchInput">;
|
|
19
20
|
};
|
|
20
21
|
};
|
|
21
22
|
declare const FormCombobox: <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(props: FormComboboxProps<TFieldValues, TName>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FormCombobox.d.ts","sourceRoot":"","sources":["../../../src/components/form-combobox/FormCombobox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE1E,OAAO,EAA0B,QAAQ,EAA0B,MAAM,cAAc,CAAC;AACxF,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,KAAK,iBAAiB,CAAC,YAAY,SAAS,WAAW,EAAE,KAAK,SAAS,SAAS,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC,YAAY,CAAC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o, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { FormField as C, FormItem as P, FormLabel as I, FormControl as j, FormMessage as v } from "./form.es.js";
|
|
3
|
+
import { Combobox as L } from "./combobox.es.js";
|
|
4
|
+
const q = (n) => {
|
|
5
5
|
const {
|
|
6
6
|
name: t,
|
|
7
7
|
control: m,
|
|
8
8
|
defaultValue: a,
|
|
9
|
-
disabled:
|
|
9
|
+
disabled: r,
|
|
10
10
|
rules: d,
|
|
11
11
|
shouldUnregister: i,
|
|
12
12
|
label: p,
|
|
13
|
-
options:
|
|
14
|
-
loading:
|
|
15
|
-
loadingText:
|
|
16
|
-
emptyOptionsText:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
13
|
+
options: c,
|
|
14
|
+
loading: u,
|
|
15
|
+
loadingText: b,
|
|
16
|
+
emptyOptionsText: h,
|
|
17
|
+
showSearchInput: x,
|
|
18
|
+
placeholder: g,
|
|
19
|
+
slotProps: e,
|
|
20
|
+
required: F,
|
|
21
|
+
...f
|
|
22
|
+
} = n;
|
|
23
|
+
return /* @__PURE__ */ o(
|
|
24
|
+
C,
|
|
24
25
|
{
|
|
25
26
|
control: m,
|
|
26
27
|
name: t,
|
|
27
28
|
defaultValue: a,
|
|
28
|
-
disabled:
|
|
29
|
+
disabled: r,
|
|
29
30
|
rules: d,
|
|
30
31
|
shouldUnregister: i,
|
|
31
|
-
render: ({ field:
|
|
32
|
-
/* @__PURE__ */
|
|
32
|
+
render: ({ field: s }) => /* @__PURE__ */ l(P, { ...f, children: [
|
|
33
|
+
/* @__PURE__ */ l(I, { ...e?.formLabelProps ?? {}, children: [
|
|
33
34
|
p,
|
|
34
|
-
|
|
35
|
+
F && /* @__PURE__ */ o("span", { className: "text-danger text-sm leading-4", children: "*" })
|
|
35
36
|
] }),
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
|
|
37
|
+
/* @__PURE__ */ o(j, { children: /* @__PURE__ */ o(
|
|
38
|
+
L,
|
|
38
39
|
{
|
|
39
|
-
options:
|
|
40
|
-
value:
|
|
41
|
-
onValueChange:
|
|
42
|
-
loading:
|
|
43
|
-
loadingText:
|
|
44
|
-
emptyOptionsText:
|
|
45
|
-
placeholder:
|
|
46
|
-
disabled:
|
|
40
|
+
options: c,
|
|
41
|
+
value: s.value,
|
|
42
|
+
onValueChange: s.onChange,
|
|
43
|
+
loading: u,
|
|
44
|
+
loadingText: b,
|
|
45
|
+
emptyOptionsText: h,
|
|
46
|
+
placeholder: g,
|
|
47
|
+
disabled: r,
|
|
48
|
+
showSearchInput: x,
|
|
49
|
+
...e?.comboboxProps ?? {}
|
|
47
50
|
}
|
|
48
51
|
) }),
|
|
49
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ o(v, { ...e?.formMessageProps ?? {} })
|
|
50
53
|
] })
|
|
51
54
|
}
|
|
52
55
|
);
|
|
53
56
|
};
|
|
54
57
|
export {
|
|
55
|
-
|
|
58
|
+
q as FormCombobox
|
|
56
59
|
};
|
|
57
60
|
//# sourceMappingURL=formcombobox.es.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formcombobox.es.js","sources":["../src/components/form-combobox/FormCombobox.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { ControllerProps, FieldPath, FieldValues } from \"react-hook-form\";\r\n\r\nimport { FormControl, FormField, FormItem, FormLabel, FormMessage } from \"../form/Form\";\r\nimport { Combobox } from \"../combobox/Combobox\";\r\n\r\ntype FormComboboxProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<\r\n ControllerProps<TFieldValues, TName>,\r\n \"render\"\r\n> &\r\n React.ComponentProps<typeof FormItem> & {\r\n label: string;\r\n options: { value: string | number; label: string }[];\r\n loading?: boolean;\r\n loadingText?: string;\r\n emptyOptionsText?: string;\r\n placeholder?: string;\r\n required?: boolean;\r\n slotProps?: {\r\n formLabelProps?: React.HTMLAttributes<HTMLLabelElement> & React.RefAttributes<HTMLLabelElement>;\r\n formMessageProps?: React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>;\r\n comboboxProps?: React.
|
|
1
|
+
{"version":3,"file":"formcombobox.es.js","sources":["../src/components/form-combobox/FormCombobox.tsx"],"sourcesContent":["\"use client\";\r\n\r\nimport { ControllerProps, FieldPath, FieldValues } from \"react-hook-form\";\r\n\r\nimport { FormControl, FormField, FormItem, FormLabel, FormMessage } from \"../form/Form\";\r\nimport { Combobox } from \"../combobox/Combobox\";\r\n\r\ntype FormComboboxProps<TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = Omit<\r\n ControllerProps<TFieldValues, TName>,\r\n \"render\"\r\n> &\r\n React.ComponentProps<typeof FormItem> & {\r\n label: string;\r\n options: { value: string | number; label: string }[];\r\n loading?: boolean;\r\n loadingText?: string;\r\n emptyOptionsText?: string;\r\n showSearchInput?: boolean;\r\n placeholder?: string;\r\n required?: boolean;\r\n slotProps?: {\r\n formLabelProps?: React.HTMLAttributes<HTMLLabelElement> & React.RefAttributes<HTMLLabelElement>;\r\n formMessageProps?: React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>;\r\n comboboxProps?: Omit<\r\n React.ComponentPropsWithoutRef<typeof Combobox>,\r\n \"options\" | \"value\" | \"onValueChange\" | \"loading\" | \"loadingText\" | \"emptyOptionsText\" | \"placeholder\" | \"disabled\" | \"showSearchInput\"\r\n >;\r\n };\r\n };\r\n\r\nconst FormCombobox = <TFieldValues extends FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(\r\n props: FormComboboxProps<TFieldValues, TName>,\r\n) => {\r\n const {\r\n name,\r\n control,\r\n defaultValue,\r\n disabled,\r\n rules,\r\n shouldUnregister,\r\n label,\r\n options,\r\n loading,\r\n loadingText,\r\n emptyOptionsText,\r\n showSearchInput,\r\n placeholder,\r\n slotProps,\r\n required,\r\n ...formItemProps\r\n } = props;\r\n\r\n return (\r\n <FormField\r\n control={control}\r\n name={name}\r\n defaultValue={defaultValue}\r\n disabled={disabled}\r\n rules={rules}\r\n shouldUnregister={shouldUnregister}\r\n render={({ field }) => {\r\n return (\r\n <FormItem {...formItemProps}>\r\n <FormLabel {...(slotProps?.formLabelProps ?? {})}>\r\n {label}\r\n {required && <span className=\"text-danger text-sm leading-4\">*</span>}\r\n </FormLabel>\r\n <FormControl>\r\n <Combobox\r\n options={options}\r\n value={field.value}\r\n onValueChange={field.onChange}\r\n loading={loading}\r\n loadingText={loadingText}\r\n emptyOptionsText={emptyOptionsText}\r\n placeholder={placeholder}\r\n disabled={disabled}\r\n showSearchInput={showSearchInput}\r\n {...(slotProps?.comboboxProps ?? {})}\r\n />\r\n </FormControl>\r\n\r\n <FormMessage {...(slotProps?.formMessageProps ?? {})} />\r\n </FormItem>\r\n );\r\n }}\r\n />\r\n );\r\n};\r\nexport { FormCombobox, type FormComboboxProps };\r\n"],"names":["FormCombobox","props","name","control","defaultValue","disabled","rules","shouldUnregister","label","options","loading","loadingText","emptyOptionsText","showSearchInput","placeholder","slotProps","required","formItemProps","jsx","FormField","field","jsxs","FormItem","FormLabel","FormControl","Combobox","FormMessage"],"mappings":";;;AA8BM,MAAAA,IAAe,CACnBC,MACG;AACG,QAAA;AAAA,IACJ,MAAAC;AAAA,IACA,SAAAC;AAAA,IACA,cAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,SAAAC;AAAA,IACA,SAAAC;AAAA,IACA,aAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,aAAAC;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,IACDhB;AAGF,SAAA,gBAAAiB;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAAhB;AAAA,MACA,MAAAD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