@zydon/common 2.9.27 → 2.9.28
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.
|
@@ -4,9 +4,10 @@ import { BaseField } from '../../../types/baseField.js';
|
|
|
4
4
|
import 'react';
|
|
5
5
|
import 'react-hook-form';
|
|
6
6
|
|
|
7
|
-
interface SelectableCardsProps extends BaseField<Omit<SelectableCardsProps$1, 'onChange'>> {
|
|
7
|
+
interface SelectableCardsProps extends BaseField<Omit<SelectableCardsProps$1, 'onChange' | 'values'>> {
|
|
8
|
+
values?: string[];
|
|
8
9
|
}
|
|
9
10
|
|
|
10
|
-
declare const SelectableCards: ({ name, rules, ...other }: SelectableCardsProps) => react_jsx_runtime.JSX.Element;
|
|
11
|
+
declare const SelectableCards: ({ name, rules, values, ...other }: SelectableCardsProps) => react_jsx_runtime.JSX.Element;
|
|
11
12
|
|
|
12
13
|
export { SelectableCards as default };
|
|
@@ -9,7 +9,7 @@ import '../../../chunk-Z6YXPKWP.js';
|
|
|
9
9
|
import { useFormContext, Controller } from 'react-hook-form';
|
|
10
10
|
import { jsx } from 'react/jsx-runtime';
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var d=({name:r,rules:l,values:t,...n})=>{let{control:a$1}=useFormContext();return jsx(Controller,{name:r,control:a$1,rules:l,render:({field:{onChange:s,value:m}})=>jsx(a,{...n,values:t??m??[],onChange:s})})},b=d;
|
|
13
13
|
|
|
14
|
-
export {
|
|
14
|
+
export { b as default };
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/form/SelectableCards/index.tsx"],"names":["Controller","useFormContext","jsx","SelectableCards","name","rules","other","control","onChange","SelectableCards_default"],"mappings":"oSAAA,OAAS,cAAAA,EAAY,kBAAAC,MAAsB,
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/form/SelectableCards/index.tsx"],"names":["Controller","useFormContext","jsx","SelectableCards","name","rules","values","other","control","onChange","value","SelectableCards_default"],"mappings":"oSAAA,OAAS,cAAAA,EAAY,kBAAAC,MAAsB,kBAoBnC,cAAAC,MAAA,oBAdR,IAAMC,EAAkB,CAAC,CACvB,KAAAC,EACA,MAAAC,EACA,OAAAC,EACA,GAAGC,CACL,IAA4B,CAC1B,GAAM,CAAE,QAAAC,CAAQ,EAAIP,EAAe,EAEnC,OACEC,EAACF,EAAA,CACC,KAAMI,EACN,QAASI,EACT,MAAOH,EACP,OAAQ,CAAC,CAAE,MAAO,CAAE,SAAAI,EAAU,MAAAC,CAAM,CAAE,IACpCR,EAACS,EAAA,CACE,GAAGJ,EACJ,OAAQD,GAAUI,GAAS,CAAC,EAC5B,SAAUD,EACZ,EAEJ,CAEJ,EAEOE,EAAQR","sourcesContent":["import { Controller, useFormContext } from 'react-hook-form';\n\nimport SelectableCardsComponent from 'components/SelectableCards';\n\nimport { SelectableCardsProps } from './props';\n\nconst SelectableCards = ({\n name,\n rules,\n values,\n ...other\n}: SelectableCardsProps) => {\n const { control } = useFormContext();\n\n return (\n <Controller\n name={name}\n control={control}\n rules={rules}\n render={({ field: { onChange, value } }) => (\n <SelectableCardsComponent\n {...other}\n values={values ?? value ?? []}\n onChange={onChange}\n />\n )}\n />\n );\n};\n\nexport default SelectableCards;\n"]}
|