period-ui 0.10.1 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. package/README.md +15 -0
  2. package/dist/components/molecules/form/form-checkbox/form-checkbox.d.ts +8 -4
  3. package/dist/components/molecules/form/form-checkbox/form-checkbox.d.ts.map +1 -1
  4. package/dist/components/molecules/form/form-checkbox/form-checkbox.js +11 -5
  5. package/dist/components/molecules/form/form-checkbox/form-checkbox.js.map +1 -1
  6. package/dist/components/molecules/form/form-date-picker/form-date-picker.d.ts +10 -4
  7. package/dist/components/molecules/form/form-date-picker/form-date-picker.d.ts.map +1 -1
  8. package/dist/components/molecules/form/form-date-picker/form-date-picker.js +37 -23
  9. package/dist/components/molecules/form/form-date-picker/form-date-picker.js.map +1 -1
  10. package/dist/components/molecules/form/form-field-binding.d.ts +25 -0
  11. package/dist/components/molecules/form/form-field-binding.d.ts.map +1 -0
  12. package/dist/components/molecules/form/form-field-binding.js +29 -0
  13. package/dist/components/molecules/form/form-field-binding.js.map +1 -0
  14. package/dist/components/molecules/form/form-file-uploader/form-file-uploader.d.ts +3 -3
  15. package/dist/components/molecules/form/form-file-uploader/form-file-uploader.d.ts.map +1 -1
  16. package/dist/components/molecules/form/form-file-uploader/form-file-uploader.js +8 -8
  17. package/dist/components/molecules/form/form-file-uploader/form-file-uploader.js.map +1 -1
  18. package/dist/components/molecules/form/form-image-uploader/form-image-uploader.d.ts +3 -3
  19. package/dist/components/molecules/form/form-image-uploader/form-image-uploader.d.ts.map +1 -1
  20. package/dist/components/molecules/form/form-image-uploader/form-image-uploader.js +8 -8
  21. package/dist/components/molecules/form/form-image-uploader/form-image-uploader.js.map +1 -1
  22. package/dist/components/molecules/form/form-password-field/components/index.d.ts +2 -0
  23. package/dist/components/molecules/form/form-password-field/components/index.d.ts.map +1 -0
  24. package/dist/components/molecules/form/form-password-field/components/index.js +18 -0
  25. package/dist/components/molecules/form/form-password-field/components/index.js.map +1 -0
  26. package/dist/components/molecules/form/form-password-field/components/password-criteria-list.d.ts +10 -0
  27. package/dist/components/molecules/form/form-password-field/components/password-criteria-list.d.ts.map +1 -0
  28. package/dist/components/molecules/form/form-password-field/components/password-criteria-list.js +25 -0
  29. package/dist/components/molecules/form/form-password-field/components/password-criteria-list.js.map +1 -0
  30. package/dist/components/molecules/form/form-password-field/form-password-field-types.d.ts +10 -0
  31. package/dist/components/molecules/form/form-password-field/form-password-field-types.d.ts.map +1 -0
  32. package/dist/components/molecules/form/form-password-field/form-password-field-types.js +10 -0
  33. package/dist/components/molecules/form/form-password-field/form-password-field-types.js.map +1 -0
  34. package/dist/components/molecules/form/form-password-field/form-password-field.d.ts +10 -7
  35. package/dist/components/molecules/form/form-password-field/form-password-field.d.ts.map +1 -1
  36. package/dist/components/molecules/form/form-password-field/form-password-field.js +15 -15
  37. package/dist/components/molecules/form/form-password-field/form-password-field.js.map +1 -1
  38. package/dist/components/molecules/form/form-password-field/index.d.ts +1 -0
  39. package/dist/components/molecules/form/form-password-field/index.d.ts.map +1 -1
  40. package/dist/components/molecules/form/form-password-field/index.js +1 -0
  41. package/dist/components/molecules/form/form-password-field/index.js.map +1 -1
  42. package/dist/components/molecules/form/form-phone-field/form-phone-field.d.ts +8 -7
  43. package/dist/components/molecules/form/form-phone-field/form-phone-field.d.ts.map +1 -1
  44. package/dist/components/molecules/form/form-phone-field/form-phone-field.js +10 -15
  45. package/dist/components/molecules/form/form-phone-field/form-phone-field.js.map +1 -1
  46. package/dist/components/molecules/form/form-radio-button/form-radio-button.d.ts +8 -5
  47. package/dist/components/molecules/form/form-radio-button/form-radio-button.d.ts.map +1 -1
  48. package/dist/components/molecules/form/form-radio-button/form-radio-button.js +11 -5
  49. package/dist/components/molecules/form/form-radio-button/form-radio-button.js.map +1 -1
  50. package/dist/components/molecules/form/form-select/form-select-types.d.ts +5 -0
  51. package/dist/components/molecules/form/form-select/form-select-types.d.ts.map +1 -0
  52. package/dist/components/molecules/form/form-select/form-select-types.js +3 -0
  53. package/dist/components/molecules/form/form-select/form-select-types.js.map +1 -0
  54. package/dist/components/molecules/form/form-select/form-select.d.ts +14 -4
  55. package/dist/components/molecules/form/form-select/form-select.d.ts.map +1 -1
  56. package/dist/components/molecules/form/form-select/form-select.js +42 -23
  57. package/dist/components/molecules/form/form-select/form-select.js.map +1 -1
  58. package/dist/components/molecules/form/form-select/index.d.ts +1 -0
  59. package/dist/components/molecules/form/form-select/index.d.ts.map +1 -1
  60. package/dist/components/molecules/form/form-select/index.js +1 -0
  61. package/dist/components/molecules/form/form-select/index.js.map +1 -1
  62. package/dist/components/molecules/form/form-story-stubs.d.ts +3 -0
  63. package/dist/components/molecules/form/form-story-stubs.d.ts.map +1 -1
  64. package/dist/components/molecules/form/form-story-stubs.js +4 -6
  65. package/dist/components/molecules/form/form-story-stubs.js.map +1 -1
  66. package/dist/components/molecules/form/form-text-field/form-text-field.d.ts +8 -7
  67. package/dist/components/molecules/form/form-text-field/form-text-field.d.ts.map +1 -1
  68. package/dist/components/molecules/form/form-text-field/form-text-field.js +10 -15
  69. package/dist/components/molecules/form/form-text-field/form-text-field.js.map +1 -1
  70. package/dist/components/molecules/form/form-types.d.ts +1 -1
  71. package/dist/components/molecules/form/form-types.d.ts.map +1 -1
  72. package/dist/components/organisms/document-field/document-field.d.ts.map +1 -1
  73. package/dist/components/organisms/document-field/document-field.js +3 -3
  74. package/dist/components/organisms/document-field/document-field.js.map +1 -1
  75. package/dist/components/organisms/filter-modal/components/filter.d.ts +5 -4
  76. package/dist/components/organisms/filter-modal/components/filter.d.ts.map +1 -1
  77. package/dist/components/organisms/filter-modal/components/filter.js.map +1 -1
  78. package/dist/components/organisms/filter-modal/filter-modal-types.d.ts +5 -4
  79. package/dist/components/organisms/filter-modal/filter-modal-types.d.ts.map +1 -1
  80. package/dist/components/organisms/filter-modal/filter-modal-types.js.map +1 -1
  81. package/dist/components/organisms/payment-card-fields/components/payment-card-field-control.d.ts.map +1 -1
  82. package/dist/components/organisms/payment-card-fields/components/payment-card-field-control.js +1 -1
  83. package/dist/components/organisms/payment-card-fields/components/payment-card-field-control.js.map +1 -1
  84. package/dist/components/organisms/payment-card-fields/payment-card-fields.d.ts.map +1 -1
  85. package/dist/components/organisms/payment-card-fields/payment-card-fields.js +1 -1
  86. package/dist/components/organisms/payment-card-fields/payment-card-fields.js.map +1 -1
  87. package/dist/containers/form-control/components/form-label.d.ts +1 -2
  88. package/dist/containers/form-control/components/form-label.d.ts.map +1 -1
  89. package/dist/containers/form-control/components/form-label.js +6 -2
  90. package/dist/containers/form-control/components/form-label.js.map +1 -1
  91. package/dist/containers/form-control/form-control-types.d.ts +12 -0
  92. package/dist/containers/form-control/form-control-types.d.ts.map +1 -1
  93. package/dist/containers/form-control/form-control.d.ts +7 -18
  94. package/dist/containers/form-control/form-control.d.ts.map +1 -1
  95. package/dist/containers/form-control/form-control.js +12 -9
  96. package/dist/containers/form-control/form-control.js.map +1 -1
  97. package/dist/containers/form-control/form-field-state.d.ts +20 -0
  98. package/dist/containers/form-control/form-field-state.d.ts.map +1 -0
  99. package/dist/containers/form-control/form-field-state.js +41 -0
  100. package/dist/containers/form-control/form-field-state.js.map +1 -0
  101. package/dist/containers/form-control/index.d.ts +1 -0
  102. package/dist/containers/form-control/index.d.ts.map +1 -1
  103. package/dist/containers/form-control/index.js +1 -0
  104. package/dist/containers/form-control/index.js.map +1 -1
  105. package/dist/index.d.ts +4 -2
  106. package/dist/index.d.ts.map +1 -1
  107. package/dist/index.js +3 -1
  108. package/dist/index.js.map +1 -1
  109. package/dist/index.mjs +8068 -7955
  110. package/dist/providers/index.d.ts +2 -0
  111. package/dist/providers/index.d.ts.map +1 -0
  112. package/dist/providers/index.js +18 -0
  113. package/dist/providers/index.js.map +1 -0
  114. package/dist/providers/period-ui-provider/index.d.ts +2 -0
  115. package/dist/providers/period-ui-provider/index.d.ts.map +1 -0
  116. package/dist/providers/period-ui-provider/index.js +18 -0
  117. package/dist/providers/period-ui-provider/index.js.map +1 -0
  118. package/dist/providers/period-ui-provider/period-ui-provider.d.ts +12 -0
  119. package/dist/providers/period-ui-provider/period-ui-provider.d.ts.map +1 -0
  120. package/dist/providers/period-ui-provider/period-ui-provider.js +18 -0
  121. package/dist/providers/period-ui-provider/period-ui-provider.js.map +1 -0
  122. package/package.json +1 -1
package/README.md CHANGED
@@ -92,6 +92,21 @@ module.exports = {
92
92
  No copies los tokens del preset a tu config: el preset es la única fuente de verdad. `content` y
93
93
  `screens` no forman parte del preset — son responsabilidad de cada app.
94
94
 
95
+ ### 4. Monta `PeriodUiProvider` (obligatorio desde 0.11.0):
96
+
97
+ Los labels de los campos de formulario muestran el texto de "opcional" cuando el campo no es
98
+ `isRequired`. Ese copy lo define tu app una sola vez, en la raíz:
99
+
100
+ ```tsx
101
+ import { PeriodUiProvider } from 'period-ui';
102
+
103
+ <PeriodUiProvider texts={{ optionalLabel: t('form.optional') }}>
104
+ <App />
105
+ </PeriodUiProvider>;
106
+ ```
107
+
108
+ Sin el provider, cualquier campo con label tira un error que lo indica.
109
+
95
110
  ---
96
111
 
97
112
  ## 📚 Storybook (Probar localmente)
@@ -1,9 +1,13 @@
1
1
  import { CheckboxGroupProps } from '../../../../components/atoms/check-box';
2
- import { FormControlProps } from '../../../../containers';
3
- export type FormCheckBoxProps = FormControlProps & Omit<CheckboxGroupProps, 'onCheckData' | 'checkedData'> & {
4
- formControlClassName?: string;
2
+ import { FormFieldProps } from '../../../../containers';
3
+ import { FieldValueProps } from '../form-field-binding';
4
+ type CheckBoxValueProps = {
5
5
  checkedData?: string[];
6
+ };
7
+ export type FormCheckBoxProps = FormFieldProps & Omit<CheckboxGroupProps, 'id' | 'checkedData' | 'onCheckData' | 'ariaLabelledBy' | 'ariaDescribedBy' | 'ariaInvalid'> & FieldValueProps<CheckBoxValueProps> & {
8
+ formControlClassName?: string;
6
9
  onCheckData?: (value?: string[]) => void;
7
10
  };
8
- export declare function FormCheckBox({ formControlClassName, label, helperText, errorText, optionalLabel, hideRequiredMark, toolTipProps, inputWidth, id, formName, formProps, isRequired, isDisabled, checkedData, onCheckData, ...checkboxProps }: FormCheckBoxProps): import("react/jsx-runtime").JSX.Element;
11
+ export declare function FormCheckBox({ id, label, helperText, errorText, isRequired, isDisabled, hideRequiredMark, inputWidth, toolTipProps, formControlClassName, formProps, name, checkedData, onCheckData, ...checkboxProps }: FormCheckBoxProps): import("react/jsx-runtime").JSX.Element;
12
+ export {};
9
13
  //# sourceMappingURL=form-checkbox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-checkbox.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-checkbox/form-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC3F,OAAO,EAAe,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAGvE,MAAM,MAAM,iBAAiB,GAAG,gBAAgB,GAC9C,IAAI,CAAC,kBAAkB,EAAE,aAAa,GAAG,aAAa,CAAC,GAAG;IACxD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC1C,CAAC;AAEJ,wBAAgB,YAAY,CAAC,EAC3B,oBAAoB,EACpB,KAAK,EACL,UAAU,EACV,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,YAAY,EACZ,UAAU,EACV,EAAE,EACF,QAAQ,EACR,SAAS,EACT,UAAU,EACV,UAAU,EACV,WAAW,EACX,WAAW,EACX,GAAG,aAAa,EACjB,EAAE,iBAAiB,2CAsCnB"}
1
+ {"version":3,"file":"form-checkbox.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-checkbox/form-checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC3F,OAAO,EAEL,cAAc,EAGf,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,eAAe,EAAgC,MAAM,uBAAuB,CAAC;AAEtF,KAAK,kBAAkB,GAAG;IACxB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,cAAc,GAC5C,IAAI,CACF,kBAAkB,EAClB,IAAI,GAAG,aAAa,GAAG,aAAa,GAAG,gBAAgB,GAAG,iBAAiB,GAAG,aAAa,CAC5F,GACD,eAAe,CAAC,kBAAkB,CAAC,GAAG;IACpC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,WAAW,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;CAC1C,CAAC;AAEJ,wBAAgB,YAAY,CAAC,EAC3B,EAAE,EACF,KAAK,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,SAAS,EACT,IAAI,EACJ,WAAW,EACX,WAAW,EACX,GAAG,aAAa,EACjB,EAAE,iBAAiB,2CA0CnB"}
@@ -5,12 +5,18 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const check_box_1 = require("../../../../components/atoms/check-box");
6
6
  const containers_1 = require("../../../../containers");
7
7
  const tailwind_utils_1 = require("../../../../utils/tailwind-utils");
8
- function FormCheckBox({ formControlClassName, label, helperText, errorText, optionalLabel, hideRequiredMark, toolTipProps, inputWidth, id, formName, formProps, isRequired, isDisabled, checkedData, onCheckData, ...checkboxProps }) {
9
- async function handleChanceValue(value) {
8
+ const form_field_binding_1 = require("../form-field-binding");
9
+ function FormCheckBox({ id, label, helperText, errorText, isRequired, isDisabled, hideRequiredMark, inputWidth, toolTipProps, formControlClassName, formProps, name, checkedData, onCheckData, ...checkboxProps }) {
10
+ const boundField = (0, form_field_binding_1.toBoundField)(formProps, name);
11
+ const resolvedCheckedData = boundField
12
+ ? (0, containers_1.getFieldValue)(boundField)
13
+ : checkedData;
14
+ async function handleCheckData(value) {
10
15
  onCheckData?.(value);
11
- await formProps?.setFieldValue(formName ?? '', value);
12
- await formProps?.setFieldTouched(formName ?? '', true, true);
16
+ if (boundField) {
17
+ await (0, containers_1.setFieldValueAndTouch)(boundField, value);
18
+ }
13
19
  }
14
- return ((0, jsx_runtime_1.jsx)(containers_1.FormControl, { id: id, label: label, helperText: helperText, optionalLabel: optionalLabel, hideRequiredMark: hideRequiredMark, toolTipProps: toolTipProps, inputWidth: inputWidth, formName: formName, formProps: formProps, isRequired: isRequired, isDisabled: isDisabled, errorText: errorText, className: (0, tailwind_utils_1.tailwind)('space-y-4', formControlClassName), containerClassName: "space-y-4", associateLabelWithInput: false, children: ({ isErrorVisible, labelId, describedBy }) => ((0, jsx_runtime_1.jsx)(check_box_1.CheckboxGroup, { ...checkboxProps, ariaLabelledBy: labelId, ariaDescribedBy: describedBy, ariaInvalid: isErrorVisible, checkedData: checkedData ?? formProps?.values[formName], onCheckData: handleChanceValue })) }));
20
+ return ((0, jsx_runtime_1.jsx)(containers_1.FormControl, { ...(0, form_field_binding_1.toFieldBinding)(boundField), id: id, label: label, helperText: helperText, errorText: errorText, isRequired: isRequired, isDisabled: isDisabled, hideRequiredMark: hideRequiredMark, inputWidth: inputWidth, toolTipProps: toolTipProps, className: (0, tailwind_utils_1.tailwind)('space-y-4', formControlClassName), containerClassName: "space-y-4", associateLabelWithInput: false, children: ({ isErrorVisible, labelId, describedBy }) => ((0, jsx_runtime_1.jsx)(check_box_1.CheckboxGroup, { ...checkboxProps, ariaLabelledBy: labelId, ariaDescribedBy: describedBy, ariaInvalid: isErrorVisible, checkedData: resolvedCheckedData, onCheckData: handleCheckData })) }));
15
21
  }
16
22
  //# sourceMappingURL=form-checkbox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-checkbox.js","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-checkbox/form-checkbox.tsx"],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MAAM,CAAC,QAAS,CAAC,EACxD,WAAW,EAAE,iBAAiB,GAC9B,CACH,GACW,CACf,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"form-checkbox.js","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-checkbox/form-checkbox.tsx"],"names":[],"mappings":";;AAwBA,oCA0DC;;AAlFD,sEAA2F;AAC3F,uDAKgC;AAChC,qEAA4D;AAC5D,8DAAsF;AAgBtF,SAAgB,YAAY,CAAC,EAC3B,EAAE,EACF,KAAK,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,SAAS,EACT,IAAI,EACJ,WAAW,EACX,WAAW,EACX,GAAG,aAAa,EACE;IAClB,MAAM,UAAU,GAAG,IAAA,iCAAY,EAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IACjD,MAAM,mBAAmB,GAAG,UAAU;QACpC,CAAC,CAAC,IAAA,0BAAa,EAAuB,UAAU,CAAC;QACjD,CAAC,CAAC,WAAW,CAAC;IAEhB,KAAK,UAAU,eAAe,CAAC,KAAgB;QAC7C,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC;QAErB,IAAI,UAAU,EAAE,CAAC;YACf,MAAM,IAAA,kCAAqB,EAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QACjD,CAAC;IACH,CAAC;IAED,OAAO,CACL,uBAAC,wBAAW,OACN,IAAA,mCAAc,EAAC,UAAU,CAAC,EAC9B,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,IAAA,yBAAQ,EAAC,WAAW,EAAE,oBAAoB,CAAC,EACtD,kBAAkB,EAAC,WAAW,EAC9B,uBAAuB,EAAE,KAAK,YAE7B,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAC7C,uBAAC,yBAAa,OACR,aAAa,EACjB,cAAc,EAAE,OAAO,EACvB,eAAe,EAAE,WAAW,EAC5B,WAAW,EAAE,cAAc,EAC3B,WAAW,EAAE,mBAAmB,EAChC,WAAW,EAAE,eAAe,GAC5B,CACH,GACW,CACf,CAAC;AACJ,CAAC"}
@@ -1,10 +1,16 @@
1
1
  import { DatePickerProps } from '../../..';
2
- import { FormControlProps } from '../../../../containers';
3
- export type FormDatePickerProps = FormControlProps & DatePickerProps & {
2
+ import { FormFieldProps } from '../../../../containers';
3
+ import { FieldValueProps } from '../form-field-binding';
4
+ type DatePickerValueProps = {
5
+ startDate?: Date;
6
+ endDate?: Date;
7
+ };
8
+ export type FormDatePickerProps = Omit<FormFieldProps, 'inputWidth'> & Omit<DatePickerProps, 'id' | 'startDate' | 'endDate' | 'isDisabled' | 'isErrorVisible' | 'ariaLabelledBy' | 'ariaDescribedBy'> & FieldValueProps<DatePickerValueProps> & {
4
9
  formControlClassName?: string;
5
- mobileEndDateProps?: FormControlProps & {
10
+ mobileEndDateProps?: FormFieldProps & {
6
11
  onBlur?: () => void;
7
12
  };
8
13
  };
9
- export declare function FormDatePicker({ formControlClassName, mobileEndDateProps, label, helperText, errorText, optionalLabel, hideRequiredMark, containerClassName, toolTipProps, id, formName, formProps, isRequired, ...datePickerProps }: FormDatePickerProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare function FormDatePicker({ id, label, helperText, errorText, isRequired, isDisabled, hideRequiredMark, containerClassName, toolTipProps, formControlClassName, mobileEndDateProps, formProps, name, startDate, endDate, ...datePickerProps }: FormDatePickerProps): import("react/jsx-runtime").JSX.Element;
15
+ export {};
10
16
  //# sourceMappingURL=form-date-picker.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-date-picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-date-picker/form-date-picker.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,eAAe,EAAsB,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAe,gBAAgB,EAAkB,MAAM,wBAAwB,CAAC;AAEvF,MAAM,MAAM,mBAAmB,GAAG,gBAAgB,GAChD,eAAe,GAAG;IAChB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kBAAkB,CAAC,EAAE,gBAAgB,GAAG;QACtC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;KACrB,CAAC;CACH,CAAC;AAEJ,wBAAgB,cAAc,CAAC,EAC7B,oBAAoB,EACpB,kBAAkB,EAClB,KAAK,EACL,UAAU,EACV,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,EAAE,EACF,QAAQ,EACR,SAAS,EACT,UAAU,EACV,GAAG,eAAe,EACnB,EAAE,mBAAmB,2CAkIrB"}
1
+ {"version":3,"file":"form-date-picker.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-date-picker/form-date-picker.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,eAAe,EAAsB,MAAM,UAAU,CAAC;AAE3E,OAAO,EAGL,cAAc,EAIf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,eAAe,EAAgC,MAAM,uBAAuB,CAAC;AAEtF,KAAK,oBAAoB,GAAG;IAC1B,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,cAAc,EAAE,YAAY,CAAC,GAClE,IAAI,CACF,eAAe,EACb,IAAI,GACJ,WAAW,GACX,SAAS,GACT,YAAY,GACZ,gBAAgB,GAChB,gBAAgB,GAChB,iBAAiB,CACpB,GACD,eAAe,CAAC,oBAAoB,CAAC,GAAG;IACtC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kBAAkB,CAAC,EAAE,cAAc,GAAG;QACpC,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;KACrB,CAAC;CACH,CAAC;AAQJ,wBAAgB,cAAc,CAAC,EAC7B,EAAE,EACF,KAAK,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAClB,SAAS,EACT,IAAI,EACJ,SAAS,EACT,OAAO,EACP,GAAG,eAAe,EACnB,EAAE,mBAAmB,2CA2IrB"}
@@ -5,47 +5,61 @@ const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const window_dimensions_utils_1 = require("../../../../utils/window-dimensions-utils");
6
6
  const __1 = require("../../..");
7
7
  const containers_1 = require("../../../../containers");
8
- function FormDatePicker({ formControlClassName, mobileEndDateProps, label, helperText, errorText, optionalLabel, hideRequiredMark, containerClassName, toolTipProps, id, formName, formProps, isRequired, ...datePickerProps }) {
8
+ const form_field_binding_1 = require("../form-field-binding");
9
+ function resolveBoundDates(boundField) {
10
+ const fieldValue = (0, containers_1.getFieldValue)(boundField);
11
+ return { startDate: fieldValue?.startDate, endDate: fieldValue?.endDate };
12
+ }
13
+ function FormDatePicker({ id, label, helperText, errorText, isRequired, isDisabled, hideRequiredMark, containerClassName, toolTipProps, formControlClassName, mobileEndDateProps, formProps, name, startDate, endDate, ...datePickerProps }) {
9
14
  const { isMobile } = (0, window_dimensions_utils_1.useWindowDimensions)();
15
+ const boundField = (0, form_field_binding_1.toBoundField)(formProps, name);
16
+ const dates = boundField ? resolveBoundDates(boundField) : { startDate, endDate };
10
17
  const isRangeDatePicker = datePickerProps.variant === __1.DatePickerVariants.DATE_RANGE;
11
- async function handleChange(startDate, endDate) {
12
- await formProps?.setFieldValue(formName, { startDate, endDate });
13
- datePickerProps.onChange?.(startDate, endDate);
18
+ const resolvedErrorText = errorText || (boundField ? (0, containers_1.getFieldErrorText)(boundField) : undefined);
19
+ async function handleChange(nextStartDate, nextEndDate) {
20
+ if (boundField) {
21
+ await boundField.formProps.setFieldValue(boundField.name, {
22
+ startDate: nextStartDate,
23
+ endDate: nextEndDate,
24
+ });
25
+ }
26
+ datePickerProps.onChange?.(nextStartDate, nextEndDate);
14
27
  }
15
28
  async function handleChangeMobileStartDate(date) {
16
- await handleChange(date, datePickerProps.endDate);
29
+ await handleChange(date, dates.endDate);
17
30
  }
18
31
  async function handleChangeMobileEndDate(date) {
19
- await handleChange(datePickerProps.startDate, date);
32
+ await handleChange(dates.startDate, date);
20
33
  }
21
- async function handleOnBlur() {
22
- await formProps?.setFieldTouched(formName ?? '', true, true);
34
+ async function handleBlur() {
35
+ if (boundField) {
36
+ await boundField.formProps.setFieldTouched(boundField.name, true, true);
37
+ }
23
38
  datePickerProps.onBlur?.();
24
39
  }
25
40
  async function handleClear() {
26
- await formProps?.setFieldValue(formName, { startDate: undefined, endDate: undefined });
41
+ if (boundField) {
42
+ await boundField.formProps.setFieldValue(boundField.name, {
43
+ startDate: undefined,
44
+ endDate: undefined,
45
+ });
46
+ }
27
47
  datePickerProps.onClear?.();
28
48
  }
29
- const getErrorText = () => {
30
- const formError = formProps?.errors[formName];
31
- const errorMessage = typeof formError === 'object' && formError !== null
32
- ? Object.values(formError)[0]
33
- : formError;
34
- return errorText || errorMessage;
35
- };
36
- const baseFormControlProps = {
49
+ const fieldControlProps = {
50
+ ...(0, form_field_binding_1.toFieldBinding)(boundField),
37
51
  id,
38
52
  label,
39
53
  helperText,
40
- optionalLabel,
54
+ isRequired,
55
+ isDisabled,
41
56
  hideRequiredMark,
42
57
  containerClassName,
43
58
  toolTipProps,
44
- formName,
45
- formProps,
46
- isRequired,
47
- isDisabled: datePickerProps.isDisabled,
48
59
  };
49
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: isMobile && datePickerProps.variant === __1.DatePickerVariants.DATE_RANGE ? ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col space-y-4", children: [(0, jsx_runtime_1.jsx)(containers_1.FormControl, { ...baseFormControlProps, inputWidth: containers_1.FormInputWidth.TWO_COLUMN, errorText: getErrorText(), className: formControlClassName, associateLabelWithInput: false, children: ({ isErrorVisible, inputId, labelId, describedBy }) => ((0, jsx_runtime_1.jsx)(__1.DatePicker, { ...datePickerProps, id: inputId, ariaLabelledBy: labelId, ariaDescribedBy: describedBy, maxDate: datePickerProps.endDate, endDate: datePickerProps.startDate, variant: __1.DatePickerVariants.DEFAULT, isErrorVisible: isErrorVisible, onChange: handleChangeMobileStartDate, onBlur: handleOnBlur })) }), (0, jsx_runtime_1.jsx)(containers_1.FormControl, { ...mobileEndDateProps, inputWidth: containers_1.FormInputWidth.TWO_COLUMN, errorText: getErrorText(), className: formControlClassName, associateLabelWithInput: false, children: ({ isErrorVisible, inputId, labelId, describedBy }) => ((0, jsx_runtime_1.jsx)(__1.DatePicker, { ...datePickerProps, id: inputId, ariaLabelledBy: labelId, ariaDescribedBy: describedBy, minDate: datePickerProps.startDate, startDate: datePickerProps.endDate, variant: __1.DatePickerVariants.DEFAULT, isErrorVisible: isErrorVisible, onChange: handleChangeMobileEndDate, onBlur: mobileEndDateProps?.onBlur })) })] })) : ((0, jsx_runtime_1.jsx)(containers_1.FormControl, { ...baseFormControlProps, inputWidth: isRangeDatePicker ? containers_1.FormInputWidth.FOUR_COLUMN : containers_1.FormInputWidth.TWO_COLUMN, errorText: getErrorText(), className: formControlClassName, associateLabelWithInput: false, children: ({ isErrorVisible, inputId, labelId, describedBy }) => ((0, jsx_runtime_1.jsx)(__1.DatePicker, { ...datePickerProps, id: inputId, ariaLabelledBy: labelId, ariaDescribedBy: describedBy, isErrorVisible: isErrorVisible, onChange: handleChange, onBlur: handleOnBlur, onClear: handleClear })) })) }));
60
+ if (isMobile && isRangeDatePicker) {
61
+ return ((0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col space-y-4", children: [(0, jsx_runtime_1.jsx)(containers_1.FormControl, { ...fieldControlProps, inputWidth: containers_1.FormInputWidth.TWO_COLUMN, errorText: resolvedErrorText, className: formControlClassName, associateLabelWithInput: false, children: ({ isErrorVisible, inputId, labelId, describedBy }) => ((0, jsx_runtime_1.jsx)(__1.DatePicker, { ...datePickerProps, id: inputId, ariaLabelledBy: labelId, ariaDescribedBy: describedBy, isDisabled: isDisabled, startDate: dates.startDate, maxDate: dates.endDate, endDate: dates.startDate, variant: __1.DatePickerVariants.DEFAULT, isErrorVisible: isErrorVisible, onChange: handleChangeMobileStartDate, onBlur: handleBlur })) }), (0, jsx_runtime_1.jsx)(containers_1.FormControl, { ...mobileEndDateProps, inputWidth: containers_1.FormInputWidth.TWO_COLUMN, errorText: resolvedErrorText, className: formControlClassName, associateLabelWithInput: false, children: ({ isErrorVisible, inputId, labelId, describedBy }) => ((0, jsx_runtime_1.jsx)(__1.DatePicker, { ...datePickerProps, id: inputId, ariaLabelledBy: labelId, ariaDescribedBy: describedBy, isDisabled: isDisabled, endDate: dates.endDate, minDate: dates.startDate, startDate: dates.endDate, variant: __1.DatePickerVariants.DEFAULT, isErrorVisible: isErrorVisible, onChange: handleChangeMobileEndDate, onBlur: mobileEndDateProps?.onBlur })) })] }));
62
+ }
63
+ return ((0, jsx_runtime_1.jsx)(containers_1.FormControl, { ...fieldControlProps, inputWidth: isRangeDatePicker ? containers_1.FormInputWidth.FOUR_COLUMN : containers_1.FormInputWidth.TWO_COLUMN, errorText: resolvedErrorText, className: formControlClassName, associateLabelWithInput: false, children: ({ isErrorVisible, inputId, labelId, describedBy }) => ((0, jsx_runtime_1.jsx)(__1.DatePicker, { ...datePickerProps, id: inputId, ariaLabelledBy: labelId, ariaDescribedBy: describedBy, isDisabled: isDisabled, startDate: dates.startDate, endDate: dates.endDate, isErrorVisible: isErrorVisible, onChange: handleChange, onBlur: handleBlur, onClear: handleClear })) }));
50
64
  }
51
65
  //# sourceMappingURL=form-date-picker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-date-picker.js","sourceRoot":"","sources":["../../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YAAY,GACpB,CACH,GACW,EAEd,uBAAC,wBAAW,OACN,kBAAkB,EACtB,UAAU,EAAE,2BAAc,CAAC,UAAU,EACrC,SAAS,EAAE,YAAY,EAAE,EACzB,SAAS,EAAE,oBAAoB,EAC/B,uBAAuB,EAAE,KAAK,YAE7B,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CACtD,uBAAC,cAAU,OACL,eAAe,EACnB,EAAE,EAAE,OAAO,EACX,cAAc,EAAE,OAAO,EACvB,eAAe,EAAE,WAAW,EAC5B,OAAO,EAAE,eAAe,CAAC,SAAS,EAClC,SAAS,EAAE,eAAe,CAAC,OAAO,EAClC,OAAO,EAAE,sBAAkB,CAAC,OAAO,EACnC,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,yBAAyB,EACnC,MAAM,EAAE,kBAAkB,EAAE,MAAM,GAClC,CACH,GACW,IACV,CACP,CAAC,CAAC,CAAC,CACF,uBAAC,wBAAW,OACN,oBAAoB,EACxB,UAAU,EAAE,iBAAiB,CAAC,CAAC,CAAC,2BAAc,CAAC,WAAW,CAAC,CAAC,CAAC,2BAAc,CAAC,UAAU,EACtF,SAAS,EAAE,YAAY,EAAE,EACzB,SAAS,EAAE,oBAAoB,EAC/B,uBAAuB,EAAE,KAAK,YAE7B,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CACtD,uBAAC,cAAU,OACL,eAAe,EACnB,EAAE,EAAE,OAAO,EACX,cAAc,EAAE,OAAO,EACvB,eAAe,EAAE,WAAW,EAC5B,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,YAAY,EACpB,OAAO,EAAE,WAAW,GACpB,CACH,GACW,CACf,GACA,CACJ,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"form-date-picker.js","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-date-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Ac,CAAC,UAAU,EACtF,SAAS,EAAE,iBAAiB,EAC5B,SAAS,EAAE,oBAAoB,EAC/B,uBAAuB,EAAE,KAAK,YAE7B,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CACtD,uBAAC,cAAU,OACL,eAAe,EACnB,EAAE,EAAE,OAAO,EACX,cAAc,EAAE,OAAO,EACvB,eAAe,EAAE,WAAW,EAC5B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,KAAK,CAAC,SAAS,EAC1B,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,WAAW,GACpB,CACH,GACW,CACf,CAAC;AACJ,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { ChangeEvent, FocusEvent } from 'react';
2
+ import { AnyFormRenderProps, BoundFieldBinding, FieldBinding, StandaloneFieldBinding } from '../../../containers/form-control/form-field-state';
3
+ export type BoundValueProps<StandaloneValueProps> = BoundFieldBinding & {
4
+ [Key in keyof StandaloneValueProps]?: never;
5
+ };
6
+ export type StandaloneValueProps<ValueProps> = StandaloneFieldBinding & ValueProps;
7
+ export type FieldValueProps<ValueProps> = BoundValueProps<ValueProps> | StandaloneValueProps<ValueProps>;
8
+ export type StandaloneOnly<Props> = Extract<Props, {
9
+ formProps?: never;
10
+ }>;
11
+ export declare function toBoundField(formProps: AnyFormRenderProps | undefined, name: string | undefined): BoundFieldBinding | undefined;
12
+ export declare function toFieldBinding(boundField: BoundFieldBinding | undefined): FieldBinding;
13
+ type TextInputBindingProps<InputValue> = {
14
+ boundField: BoundFieldBinding | undefined;
15
+ value: InputValue | undefined;
16
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
17
+ onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
18
+ };
19
+ export declare function bindTextInput<InputValue>({ boundField, value, onChange, onBlur, }: TextInputBindingProps<InputValue>): {
20
+ inputValue: string | InputValue | undefined;
21
+ handleChange: (event: ChangeEvent<HTMLInputElement>) => void;
22
+ handleBlur: (event: FocusEvent<HTMLInputElement>) => void;
23
+ };
24
+ export {};
25
+ //# sourceMappingURL=form-field-binding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-field-binding.d.ts","sourceRoot":"","sources":["../../../../src/components/molecules/form/form-field-binding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAChD,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,sBAAsB,EAEvB,MAAM,mDAAmD,CAAC;AAE3D,MAAM,MAAM,eAAe,CAAC,oBAAoB,IAAI,iBAAiB,GAAG;KACrE,GAAG,IAAI,MAAM,oBAAoB,CAAC,CAAC,EAAE,KAAK;CAC5C,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,UAAU,IAAI,sBAAsB,GAAG,UAAU,CAAC;AAEnF,MAAM,MAAM,eAAe,CAAC,UAAU,IAClC,eAAe,CAAC,UAAU,CAAC,GAC3B,oBAAoB,CAAC,UAAU,CAAC,CAAC;AAErC,MAAM,MAAM,cAAc,CAAC,KAAK,IAAI,OAAO,CAAC,KAAK,EAAE;IAAE,SAAS,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAE1E,wBAAgB,YAAY,CAC1B,SAAS,EAAE,kBAAkB,GAAG,SAAS,EACzC,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,iBAAiB,GAAG,SAAS,CAE/B;AAED,wBAAgB,cAAc,CAAC,UAAU,EAAE,iBAAiB,GAAG,SAAS,GAAG,YAAY,CAEtF;AAED,KAAK,qBAAqB,CAAC,UAAU,IAAI;IACvC,UAAU,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC1C,KAAK,EAAE,UAAU,GAAG,SAAS,CAAC;IAC9B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAC1D,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;CACxD,CAAC;AAEF,wBAAgB,aAAa,CAAC,UAAU,EAAE,EACxC,UAAU,EACV,KAAK,EACL,QAAQ,EACR,MAAM,GACP,EAAE,qBAAqB,CAAC,UAAU,CAAC;;0BAGL,WAAW,CAAC,gBAAgB,CAAC,KAAG,IAAI;wBAQtC,UAAU,CAAC,gBAAgB,CAAC,KAAG,IAAI;EAS/D"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toBoundField = toBoundField;
4
+ exports.toFieldBinding = toFieldBinding;
5
+ exports.bindTextInput = bindTextInput;
6
+ const form_field_state_1 = require("../../../containers/form-control/form-field-state");
7
+ function toBoundField(formProps, name) {
8
+ return formProps && name !== undefined ? { formProps, name } : undefined;
9
+ }
10
+ function toFieldBinding(boundField) {
11
+ return boundField ?? {};
12
+ }
13
+ function bindTextInput({ boundField, value, onChange, onBlur, }) {
14
+ const inputValue = boundField ? ((0, form_field_state_1.getFieldValue)(boundField) ?? '') : value;
15
+ function handleChange(event) {
16
+ onChange?.(event);
17
+ if (boundField) {
18
+ void boundField.formProps.setFieldValue(boundField.name, event.target.value ?? '');
19
+ }
20
+ }
21
+ function handleBlur(event) {
22
+ onBlur?.(event);
23
+ if (boundField) {
24
+ void boundField.formProps.setFieldTouched(boundField.name, true, true);
25
+ }
26
+ }
27
+ return { inputValue, handleChange, handleBlur };
28
+ }
29
+ //# sourceMappingURL=form-field-binding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-field-binding.js","sourceRoot":"","sources":["../../../../src/components/molecules/form/form-field-binding.ts"],"names":[],"mappings":";;AAqBA,oCAKC;AAED,wCAEC;AASD,sCAyBC;AA/DD,wFAM2D;AAc3D,SAAgB,YAAY,CAC1B,SAAyC,EACzC,IAAwB;IAExB,OAAO,SAAS,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAC3E,CAAC;AAED,SAAgB,cAAc,CAAC,UAAyC;IACtE,OAAO,UAAU,IAAI,EAAE,CAAC;AAC1B,CAAC;AASD,SAAgB,aAAa,CAAa,EACxC,UAAU,EACV,KAAK,EACL,QAAQ,EACR,MAAM,GAC4B;IAClC,MAAM,UAAU,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC,IAAA,gCAAa,EAAyB,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAElG,SAAS,YAAY,CAAC,KAAoC;QACxD,QAAQ,EAAE,CAAC,KAAK,CAAC,CAAC;QAElB,IAAI,UAAU,EAAE,CAAC;YACf,KAAK,UAAU,CAAC,SAAS,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;QACrF,CAAC;IACH,CAAC;IAED,SAAS,UAAU,CAAC,KAAmC;QACrD,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;QAEhB,IAAI,UAAU,EAAE,CAAC;YACf,KAAK,UAAU,CAAC,SAAS,CAAC,eAAe,CAAC,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,CAAC;AAClD,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { FileUploaderProps } from '../../../../components';
2
- import { FormControlProps } from '../../../../containers';
3
- export type FormFileUploaderProps = FormControlProps & Omit<FileUploaderProps, 'id' | 'describedBy' | 'isDisabled' | 'isError'> & {
2
+ import { FieldBinding, FormFieldProps } from '../../../../containers';
3
+ export type FormFileUploaderProps = FormFieldProps & Omit<FileUploaderProps, 'id' | 'describedBy' | 'isDisabled' | 'isError'> & FieldBinding & {
4
4
  formControlClassName?: string;
5
5
  };
6
- export declare function FormFileUploader({ label, helperText, errorText, optionalLabel, hideRequiredMark, containerClassName, toolTipProps, inputWidth, formName, formProps, formControlClassName, id, isRequired, isDisabled, state, onSelectFile, onDelete, ...fileUploaderProps }: FormFileUploaderProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function FormFileUploader({ id, label, helperText, errorText, isRequired, isDisabled, hideRequiredMark, inputWidth, containerClassName, toolTipProps, formControlClassName, formProps, name, state, onSelectFile, onDelete, ...fileUploaderProps }: FormFileUploaderProps): import("react/jsx-runtime").JSX.Element;
7
7
  //# sourceMappingURL=form-file-uploader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-file-uploader.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-file-uploader/form-file-uploader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,iBAAiB,EAAqB,MAAM,wBAAwB,CAAC;AAC5F,OAAO,EAAe,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEvE,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,GAClD,IAAI,CAAC,iBAAiB,EAAE,IAAI,GAAG,aAAa,GAAG,YAAY,GAAG,SAAS,CAAC,GAAG;IACzE,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEJ,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,UAAU,EACV,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,SAAS,EACT,oBAAoB,EACpB,EAAE,EACF,UAAU,EACV,UAAU,EACV,KAAiC,EACjC,YAAY,EACZ,QAAQ,EACR,GAAG,iBAAiB,EACrB,EAAE,qBAAqB,2CAkDvB"}
1
+ {"version":3,"file":"form-file-uploader.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-file-uploader/form-file-uploader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,iBAAiB,EAAqB,MAAM,wBAAwB,CAAC;AAC5F,OAAO,EACL,YAAY,EAEZ,cAAc,EAEf,MAAM,wBAAwB,CAAC;AAGhC,MAAM,MAAM,qBAAqB,GAAG,cAAc,GAChD,IAAI,CAAC,iBAAiB,EAAE,IAAI,GAAG,aAAa,GAAG,YAAY,GAAG,SAAS,CAAC,GACxE,YAAY,GAAG;IACb,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEJ,wBAAgB,gBAAgB,CAAC,EAC/B,EAAE,EACF,KAAK,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,SAAS,EACT,IAAI,EACJ,KAAiC,EACjC,YAAY,EACZ,QAAQ,EACR,GAAG,iBAAiB,EACrB,EAAE,qBAAqB,2CAgDvB"}
@@ -4,21 +4,21 @@ exports.FormFileUploader = FormFileUploader;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const components_1 = require("../../../../components");
6
6
  const containers_1 = require("../../../../containers");
7
- function FormFileUploader({ label, helperText, errorText, optionalLabel, hideRequiredMark, containerClassName, toolTipProps, inputWidth, formName, formProps, formControlClassName, id, isRequired, isDisabled, state = components_1.FileUploaderState.DEFAULT, onSelectFile, onDelete, ...fileUploaderProps }) {
7
+ const form_field_binding_1 = require("../form-field-binding");
8
+ function FormFileUploader({ id, label, helperText, errorText, isRequired, isDisabled, hideRequiredMark, inputWidth, containerClassName, toolTipProps, formControlClassName, formProps, name, state = components_1.FileUploaderState.DEFAULT, onSelectFile, onDelete, ...fileUploaderProps }) {
9
+ const boundField = (0, form_field_binding_1.toBoundField)(formProps, name);
8
10
  function handleSelectFile(file) {
9
11
  onSelectFile?.(file);
10
- if (formProps && formName) {
11
- void formProps.setFieldValue(formName, file);
12
- void formProps.setFieldTouched(formName, true, true);
12
+ if (boundField) {
13
+ void (0, containers_1.setFieldValueAndTouch)(boundField, file);
13
14
  }
14
15
  }
15
16
  function handleDelete() {
16
17
  onDelete?.();
17
- if (formProps && formName) {
18
- void formProps.setFieldValue(formName, null);
19
- void formProps.setFieldTouched(formName, true, true);
18
+ if (boundField) {
19
+ void (0, containers_1.setFieldValueAndTouch)(boundField, null);
20
20
  }
21
21
  }
22
- return ((0, jsx_runtime_1.jsx)(containers_1.FormControl, { id: id, label: label, helperText: helperText, optionalLabel: optionalLabel, hideRequiredMark: hideRequiredMark, containerClassName: containerClassName, toolTipProps: toolTipProps, inputWidth: inputWidth, formName: formName, formProps: formProps, isRequired: isRequired, isDisabled: isDisabled, errorText: errorText || formProps?.errors[formName ?? ''], className: formControlClassName, children: ({ isErrorVisible, inputId, describedBy }) => ((0, jsx_runtime_1.jsx)(components_1.FileUploader, { ...fileUploaderProps, id: inputId, describedBy: describedBy, isDisabled: isDisabled, isError: isErrorVisible, state: state, onSelectFile: handleSelectFile, onDelete: handleDelete })) }));
22
+ return ((0, jsx_runtime_1.jsx)(containers_1.FormControl, { ...(0, form_field_binding_1.toFieldBinding)(boundField), id: id, label: label, helperText: helperText, errorText: errorText, isRequired: isRequired, isDisabled: isDisabled, hideRequiredMark: hideRequiredMark, inputWidth: inputWidth, containerClassName: containerClassName, toolTipProps: toolTipProps, className: formControlClassName, children: ({ isErrorVisible, inputId, describedBy }) => ((0, jsx_runtime_1.jsx)(components_1.FileUploader, { ...fileUploaderProps, id: inputId, describedBy: describedBy, isDisabled: isDisabled, isError: isErrorVisible, state: state, onSelectFile: handleSelectFile, onDelete: handleDelete })) }));
23
23
  }
24
24
  //# sourceMappingURL=form-file-uploader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-file-uploader.js","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-file-uploader/form-file-uploader.tsx"],"names":[],"mappings":";;AAQA,4CAqEC;;AA7ED,uDAA4F;AAC5F,uDAAuE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AI,EAAE,CAAwB,EACjF,SAAS,EAAE,oBAAoB,YAE9B,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAC7C,uBAAC,yBAAY,OACP,iBAAiB,EACrB,EAAE,EAAE,OAAO,EACX,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,YAAY,GACtB,CACH,GACW,CACf,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"form-file-uploader.js","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-file-uploader/form-file-uploader.tsx"],"names":[],"mappings":";;AAeA,4CAkEC;;AAjFD,uDAA4F;AAC5F,uDAKgC;AAChC,8DAAqE;AAQrE,SAAgB,gBAAgB,CAAC,EAC/B,EAAE,EACF,KAAK,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,SAAS,EACT,IAAI,EACJ,KAAK,GAAG,8BAAiB,CAAC,OAAO,EACjC,YAAY,EACZ,QAAQ,EACR,GAAG,iBAAiB,EACE;IACtB,MAAM,UAAU,GAAG,IAAA,iCAAY,EAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAEjD,SAAS,gBAAgB,CAAC,IAAU;QAClC,YAAY,EAAE,CAAC,IAAI,CAAC,CAAC;QAErB,IAAI,UAAU,EAAE,CAAC;YACf,KAAK,IAAA,kCAAqB,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,SAAS,YAAY;QACnB,QAAQ,EAAE,EAAE,CAAC;QAEb,IAAI,UAAU,EAAE,CAAC;YACf,KAAK,IAAA,kCAAqB,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,OAAO,CACL,uBAAC,wBAAW,OACN,IAAA,mCAAc,EAAC,UAAU,CAAC,EAC9B,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,oBAAoB,YAE9B,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAC7C,uBAAC,yBAAY,OACP,iBAAiB,EACrB,EAAE,EAAE,OAAO,EACX,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,YAAY,GACtB,CACH,GACW,CACf,CAAC;AACJ,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { ImageUploaderProps } from '../../../../components';
2
- import { FormControlProps } from '../../../../containers';
3
- export type FormImageUploaderProps = FormControlProps & Omit<ImageUploaderProps, 'id' | 'describedBy' | 'isDisabled' | 'isError'> & {
2
+ import { FieldBinding, FormFieldProps } from '../../../../containers';
3
+ export type FormImageUploaderProps = FormFieldProps & Omit<ImageUploaderProps, 'id' | 'describedBy' | 'isDisabled' | 'isError'> & FieldBinding & {
4
4
  formControlClassName?: string;
5
5
  };
6
- export declare function FormImageUploader({ label, helperText, errorText, optionalLabel, hideRequiredMark, containerClassName, toolTipProps, inputWidth, formName, formProps, formControlClassName, id, isRequired, isDisabled, state, onSelectFile, onDelete, ...imageUploaderProps }: FormImageUploaderProps): import("react/jsx-runtime").JSX.Element;
6
+ export declare function FormImageUploader({ id, label, helperText, errorText, isRequired, isDisabled, hideRequiredMark, inputWidth, containerClassName, toolTipProps, formControlClassName, formProps, name, state, onSelectFile, onDelete, ...imageUploaderProps }: FormImageUploaderProps): import("react/jsx-runtime").JSX.Element;
7
7
  //# sourceMappingURL=form-image-uploader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-image-uploader.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-image-uploader/form-image-uploader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,kBAAkB,EAAsB,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EAAe,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEvE,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GACnD,IAAI,CAAC,kBAAkB,EAAE,IAAI,GAAG,aAAa,GAAG,YAAY,GAAG,SAAS,CAAC,GAAG;IAC1E,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEJ,wBAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,UAAU,EACV,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,SAAS,EACT,oBAAoB,EACpB,EAAE,EACF,UAAU,EACV,UAAU,EACV,KAAkC,EAClC,YAAY,EACZ,QAAQ,EACR,GAAG,kBAAkB,EACtB,EAAE,sBAAsB,2CAkDxB"}
1
+ {"version":3,"file":"form-image-uploader.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-image-uploader/form-image-uploader.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,kBAAkB,EAAsB,MAAM,wBAAwB,CAAC;AAC/F,OAAO,EACL,YAAY,EAEZ,cAAc,EAEf,MAAM,wBAAwB,CAAC;AAGhC,MAAM,MAAM,sBAAsB,GAAG,cAAc,GACjD,IAAI,CAAC,kBAAkB,EAAE,IAAI,GAAG,aAAa,GAAG,YAAY,GAAG,SAAS,CAAC,GACzE,YAAY,GAAG;IACb,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEJ,wBAAgB,iBAAiB,CAAC,EAChC,EAAE,EACF,KAAK,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,SAAS,EACT,IAAI,EACJ,KAAkC,EAClC,YAAY,EACZ,QAAQ,EACR,GAAG,kBAAkB,EACtB,EAAE,sBAAsB,2CAgDxB"}
@@ -4,21 +4,21 @@ exports.FormImageUploader = FormImageUploader;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const components_1 = require("../../../../components");
6
6
  const containers_1 = require("../../../../containers");
7
- function FormImageUploader({ label, helperText, errorText, optionalLabel, hideRequiredMark, containerClassName, toolTipProps, inputWidth, formName, formProps, formControlClassName, id, isRequired, isDisabled, state = components_1.ImageUploaderState.DEFAULT, onSelectFile, onDelete, ...imageUploaderProps }) {
7
+ const form_field_binding_1 = require("../form-field-binding");
8
+ function FormImageUploader({ id, label, helperText, errorText, isRequired, isDisabled, hideRequiredMark, inputWidth, containerClassName, toolTipProps, formControlClassName, formProps, name, state = components_1.ImageUploaderState.DEFAULT, onSelectFile, onDelete, ...imageUploaderProps }) {
9
+ const boundField = (0, form_field_binding_1.toBoundField)(formProps, name);
8
10
  function handleSelectFile(file) {
9
11
  onSelectFile?.(file);
10
- if (formProps && formName) {
11
- void formProps.setFieldValue(formName, file);
12
- void formProps.setFieldTouched(formName, true, true);
12
+ if (boundField) {
13
+ void (0, containers_1.setFieldValueAndTouch)(boundField, file);
13
14
  }
14
15
  }
15
16
  function handleDelete() {
16
17
  onDelete?.();
17
- if (formProps && formName) {
18
- void formProps.setFieldValue(formName, null);
19
- void formProps.setFieldTouched(formName, true, true);
18
+ if (boundField) {
19
+ void (0, containers_1.setFieldValueAndTouch)(boundField, null);
20
20
  }
21
21
  }
22
- return ((0, jsx_runtime_1.jsx)(containers_1.FormControl, { id: id, label: label, helperText: helperText, optionalLabel: optionalLabel, hideRequiredMark: hideRequiredMark, containerClassName: containerClassName, toolTipProps: toolTipProps, inputWidth: inputWidth, formName: formName, formProps: formProps, isRequired: isRequired, isDisabled: isDisabled, errorText: errorText || formProps?.errors[formName ?? ''], className: formControlClassName, children: ({ isErrorVisible, inputId, describedBy }) => ((0, jsx_runtime_1.jsx)(components_1.ImageUploader, { ...imageUploaderProps, id: inputId, describedBy: describedBy, isDisabled: isDisabled, isError: isErrorVisible, state: state, onSelectFile: handleSelectFile, onDelete: handleDelete })) }));
22
+ return ((0, jsx_runtime_1.jsx)(containers_1.FormControl, { ...(0, form_field_binding_1.toFieldBinding)(boundField), id: id, label: label, helperText: helperText, errorText: errorText, isRequired: isRequired, isDisabled: isDisabled, hideRequiredMark: hideRequiredMark, inputWidth: inputWidth, containerClassName: containerClassName, toolTipProps: toolTipProps, className: formControlClassName, children: ({ isErrorVisible, inputId, describedBy }) => ((0, jsx_runtime_1.jsx)(components_1.ImageUploader, { ...imageUploaderProps, id: inputId, describedBy: describedBy, isDisabled: isDisabled, isError: isErrorVisible, state: state, onSelectFile: handleSelectFile, onDelete: handleDelete })) }));
23
23
  }
24
24
  //# sourceMappingURL=form-image-uploader.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-image-uploader.js","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-image-uploader/form-image-uploader.tsx"],"names":[],"mappings":";;AAQA,8CAqEC;;AA7ED,uDAA+F;AAC/F,uDAAuE;AAOvE,SAAgB,iBAAiB,CAAC,EAChC,KAAK,EACL,UAAU,EACV,SAAS,EACT,aAAa,EACb,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,SAAS,EACT,oBAAoB,EACpB,EAAE,EACF,UAAU,EACV,UAAU,EACV,KAAK,GAAG,+BAAkB,CAAC,OAAO,EAClC,YAAY,EACZ,QAAQ,EACR,GAAG,kBAAkB,EACE;IACvB,SAAS,gBAAgB,CAAC,IAAU;QAClC,YAAY,EAAE,CAAC,IAAI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AAC;AACJ,CAAC"}
1
+ {"version":3,"file":"form-image-uploader.js","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-image-uploader/form-image-uploader.tsx"],"names":[],"mappings":";;AAeA,8CAkEC;;AAjFD,uDAA+F;AAC/F,uDAKgC;AAChC,8DAAqE;AAQrE,SAAgB,iBAAiB,CAAC,EAChC,EAAE,EACF,KAAK,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,SAAS,EACT,IAAI,EACJ,KAAK,GAAG,+BAAkB,CAAC,OAAO,EAClC,YAAY,EACZ,QAAQ,EACR,GAAG,kBAAkB,EACE;IACvB,MAAM,UAAU,GAAG,IAAA,iCAAY,EAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAEjD,SAAS,gBAAgB,CAAC,IAAU;QAClC,YAAY,EAAE,CAAC,IAAI,CAAC,CAAC;QAErB,IAAI,UAAU,EAAE,CAAC;YACf,KAAK,IAAA,kCAAqB,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,SAAS,YAAY;QACnB,QAAQ,EAAE,EAAE,CAAC;QAEb,IAAI,UAAU,EAAE,CAAC;YACf,KAAK,IAAA,kCAAqB,EAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,OAAO,CACL,uBAAC,wBAAW,OACN,IAAA,mCAAc,EAAC,UAAU,CAAC,EAC9B,EAAE,EAAE,EAAE,EACN,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,UAAU,EACtB,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,oBAAoB,YAE9B,CAAC,EAAE,cAAc,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAC7C,uBAAC,0BAAa,OACR,kBAAkB,EACtB,EAAE,EAAE,OAAO,EACX,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,gBAAgB,EAC9B,QAAQ,EAAE,YAAY,GACtB,CACH,GACW,CACf,CAAC;AACJ,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './password-criteria-list';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/components/molecules/form/form-password-field/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./password-criteria-list"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/components/molecules/form/form-password-field/components/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC"}
@@ -0,0 +1,10 @@
1
+ import { PasswordCriterion } from '../form-password-field-types';
2
+ type Props = {
3
+ id: string;
4
+ criteria: PasswordCriterion[];
5
+ password: string;
6
+ isValidated: boolean;
7
+ };
8
+ export declare function PasswordCriteriaList({ id, criteria, password, isValidated }: Props): import("react/jsx-runtime").JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=password-criteria-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"password-criteria-list.d.ts","sourceRoot":"","sources":["../../../../../../src/components/molecules/form/form-password-field/components/password-criteria-list.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,iBAAiB,EAA0B,MAAM,8BAA8B,CAAC;AAEzF,KAAK,KAAK,GAAG;IACX,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAwBF,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,EAAE,KAAK,2CAoBlF"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PasswordCriteriaList = PasswordCriteriaList;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const components_1 = require("../../../../../components");
6
+ const form_password_field_types_1 = require("../form-password-field-types");
7
+ function resolveCriterionState(isMet, isValidated) {
8
+ if (isMet) {
9
+ return form_password_field_types_1.PasswordCriterionState.MET;
10
+ }
11
+ return isValidated ? form_password_field_types_1.PasswordCriterionState.UNMET : form_password_field_types_1.PasswordCriterionState.PENDING;
12
+ }
13
+ function CriterionIndicator({ state }) {
14
+ if (state === form_password_field_types_1.PasswordCriterionState.PENDING) {
15
+ return (0, jsx_runtime_1.jsx)("span", { "aria-hidden": true, className: "h-1 w-1 rounded-full bg-gray-02" });
16
+ }
17
+ return ((0, jsx_runtime_1.jsx)(components_1.BilloIcon, { icon: state === form_password_field_types_1.PasswordCriterionState.MET ? components_1.IconSymbol.CHECK_CIRCLE : components_1.IconSymbol.X_CIRCLE, size: components_1.IconSize.LG, color: state === form_password_field_types_1.PasswordCriterionState.MET ? components_1.IconColor.GREEN_01 : components_1.IconColor.RED_01 }));
18
+ }
19
+ function PasswordCriteriaList({ id, criteria, password, isValidated }) {
20
+ return ((0, jsx_runtime_1.jsx)("ul", { id: id, className: "flex flex-col space-y-1", children: criteria.map((criterion) => {
21
+ const state = resolveCriterionState(criterion.test(password), isValidated);
22
+ return ((0, jsx_runtime_1.jsxs)("li", { "data-state": state, className: "flex flex-row items-center", children: [(0, jsx_runtime_1.jsx)("div", { className: "flex w-[18px] shrink-0 justify-center", children: (0, jsx_runtime_1.jsx)(CriterionIndicator, { state: state }) }), (0, jsx_runtime_1.jsx)(components_1.Text, { variant: components_1.TextVariant.HELPER, color: components_1.TextColors.BLACK_02, className: "ml-2", children: criterion.label })] }, criterion.label));
23
+ }) }));
24
+ }
25
+ //# sourceMappingURL=password-criteria-list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"password-criteria-list.js","sourceRoot":"","sources":["../../../../../../src/components/molecules/form/form-password-field/components/password-criteria-list.tsx"],"names":[],"mappings":";;AAwCA,oDAoBC;;AA5DD,0DAQmC;AACnC,4EAAyF;AASzF,SAAS,qBAAqB,CAAC,KAAc,EAAE,WAAoB;IACjE,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,kDAAsB,CAAC,GAAG,CAAC;IACpC,CAAC;IAED,OAAO,WAAW,CAAC,CAAC,CAAC,kDAAsB,CAAC,KAAK,CAAC,CAAC,CAAC,kDAAsB,CAAC,OAAO,CAAC;AACrF,CAAC;AAED,SAAS,kBAAkB,CAAC,EAAE,KAAK,EAAqC;IACtE,IAAI,KAAK,KAAK,kDAAsB,CAAC,OAAO,EAAE,CAAC;QAC7C,OAAO,sDAAkB,SAAS,EAAC,iCAAiC,GAAG,CAAC;IAC1E,CAAC;IAED,OAAO,CACL,uBAAC,sBAAS,IACR,IAAI,EAAE,KAAK,KAAK,kDAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,uBAAU,CAAC,YAAY,CAAC,CAAC,CAAC,uBAAU,CAAC,QAAQ,EAC1F,IAAI,EAAE,qBAAQ,CAAC,EAAE,EACjB,KAAK,EAAE,KAAK,KAAK,kDAAsB,CAAC,GAAG,CAAC,CAAC,CAAC,sBAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,sBAAS,CAAC,MAAM,GACnF,CACH,CAAC;AACJ,CAAC;AAED,SAAgB,oBAAoB,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAS;IACjF,OAAO,CACL,+BAAI,EAAE,EAAE,EAAE,EAAE,SAAS,EAAC,yBAAyB,YAC5C,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE;YAC1B,MAAM,KAAK,GAAG,qBAAqB,CAAC,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC,CAAC;YAE3E,OAAO,CACL,8CAAsC,KAAK,EAAE,SAAS,EAAC,4BAA4B,aACjF,gCAAK,SAAS,EAAC,uCAAuC,YACpD,uBAAC,kBAAkB,IAAC,KAAK,EAAE,KAAK,GAAI,GAChC,EAEN,uBAAC,iBAAI,IAAC,OAAO,EAAE,wBAAW,CAAC,MAAM,EAAE,KAAK,EAAE,uBAAU,CAAC,QAAQ,EAAE,SAAS,EAAC,MAAM,YAC5E,SAAS,CAAC,KAAK,GACX,KAPA,SAAS,CAAC,KAAK,CAQnB,CACN,CAAC;QACJ,CAAC,CAAC,GACC,CACN,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ export type PasswordCriterion = {
2
+ label: string;
3
+ test: (password: string) => boolean;
4
+ };
5
+ export declare enum PasswordCriterionState {
6
+ PENDING = "PENDING",
7
+ MET = "MET",
8
+ UNMET = "UNMET"
9
+ }
10
+ //# sourceMappingURL=form-password-field-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-password-field-types.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-password-field/form-password-field-types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;CACrC,CAAC;AAEF,oBAAY,sBAAsB;IAChC,OAAO,YAAY;IACnB,GAAG,QAAQ;IACX,KAAK,UAAU;CAChB"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PasswordCriterionState = void 0;
4
+ var PasswordCriterionState;
5
+ (function (PasswordCriterionState) {
6
+ PasswordCriterionState["PENDING"] = "PENDING";
7
+ PasswordCriterionState["MET"] = "MET";
8
+ PasswordCriterionState["UNMET"] = "UNMET";
9
+ })(PasswordCriterionState || (exports.PasswordCriterionState = PasswordCriterionState = {}));
10
+ //# sourceMappingURL=form-password-field-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"form-password-field-types.js","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-password-field/form-password-field-types.ts"],"names":[],"mappings":";;;AAKA,IAAY,sBAIX;AAJD,WAAY,sBAAsB;IAChC,6CAAmB,CAAA;IACnB,qCAAW,CAAA;IACX,yCAAe,CAAA;AACjB,CAAC,EAJW,sBAAsB,sCAAtB,sBAAsB,QAIjC"}
@@ -1,11 +1,14 @@
1
1
  import { PasswordFieldProps } from '../../../../components';
2
- import { FormControlProps, FormInputWidth } from '../../../../containers';
3
- export type FormPasswordFieldProps = FormControlProps & Omit<PasswordFieldProps, 'width'> & {
4
- formControlClassName?: string;
5
- width?: FormInputWidth;
2
+ import { FormFieldProps } from '../../../../containers';
3
+ import { FieldValueProps } from '../form-field-binding';
4
+ import { PasswordCriterion } from './form-password-field-types';
5
+ type PasswordFieldValueProps = {
6
+ value: PasswordFieldProps['value'];
6
7
  };
7
- export declare const FormPasswordField: import("react").ForwardRefExoticComponent<FormControlProps & Omit<PasswordFieldProps, "width"> & {
8
+ export type FormPasswordFieldProps = FormFieldProps & Omit<PasswordFieldProps, 'id' | 'name' | 'value' | 'isRequired' | 'isDisabled' | 'isErrorVisible'> & FieldValueProps<PasswordFieldValueProps> & {
9
+ criteria?: PasswordCriterion[];
8
10
  formControlClassName?: string;
9
- width?: FormInputWidth;
10
- } & import("react").RefAttributes<HTMLInputElement>>;
11
+ };
12
+ export declare const FormPasswordField: import("react").ForwardRefExoticComponent<FormPasswordFieldProps & import("react").RefAttributes<HTMLInputElement>>;
13
+ export {};
11
14
  //# sourceMappingURL=form-password-field.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-password-field.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-password-field/form-password-field.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAe,gBAAgB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEvF,MAAM,MAAM,sBAAsB,GAAG,gBAAgB,GACnD,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC,GAAG;IAClC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B,KAAK,CAAC,EAAE,cAAc,CAAC;CACxB,CAAC;AAEJ,eAAO,MAAM,iBAAiB;2BALH,MAAM;YAErB,cAAc;oDA2ExB,CAAC"}
1
+ {"version":3,"file":"form-password-field.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/form/form-password-field/form-password-field.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAe,cAAc,EAAkB,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAEL,eAAe,EAGhB,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAEhE,KAAK,uBAAuB,GAAG;IAC7B,KAAK,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,cAAc,GACjD,IAAI,CACF,kBAAkB,EAClB,IAAI,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,GAAG,YAAY,GAAG,gBAAgB,CACzE,GACD,eAAe,CAAC,uBAAuB,CAAC,GAAG;IACzC,QAAQ,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC/B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC;AAEJ,eAAO,MAAM,iBAAiB,qHAiF5B,CAAC"}