@m4l/components 9.84.1 → 9.85.0
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/components/CheckableList/CheckableList.d.ts.map +1 -1
- package/components/CheckableList/CheckableList.js +250 -219
- package/components/CheckableList/CheckableList.styles.d.ts.map +1 -1
- package/components/CheckableList/CheckableList.styles.js +12 -0
- package/components/CheckableList/constants.d.ts +1 -1
- package/components/CheckableList/constants.d.ts.map +1 -1
- package/components/CheckableList/dictionary.d.ts +4 -2
- package/components/CheckableList/dictionary.d.ts.map +1 -1
- package/components/CheckableList/dictionary.js +6 -1
- package/components/CheckableList/dictionaryDefaults.d.ts +26 -0
- package/components/CheckableList/dictionaryDefaults.d.ts.map +1 -0
- package/components/CheckableList/dictionaryDefaults.js +31 -0
- package/components/CheckableList/hooks/types.d.ts +9 -0
- package/components/CheckableList/hooks/types.d.ts.map +1 -1
- package/components/CheckableList/hooks/useCheckableListHandlers.d.ts +2 -1
- package/components/CheckableList/hooks/useCheckableListHandlers.d.ts.map +1 -1
- package/components/CheckableList/hooks/useCheckableListHandlers.js +54 -40
- package/components/CheckableList/hooks/useCheckableListValue.d.ts +4 -0
- package/components/CheckableList/hooks/useCheckableListValue.d.ts.map +1 -0
- package/components/CheckableList/hooks/useCheckableListValue.js +28 -0
- package/components/CheckableList/index.d.ts +2 -0
- package/components/CheckableList/index.d.ts.map +1 -1
- package/components/CheckableList/slots/slots.d.ts +1 -0
- package/components/CheckableList/slots/slots.d.ts.map +1 -1
- package/components/CheckableList/slots/slots.js +1 -1
- package/components/CheckableList/slots/styled.d.ts +3 -0
- package/components/CheckableList/slots/styled.d.ts.map +1 -1
- package/components/CheckableList/slots/styled.js +62 -58
- package/components/CheckableList/types.d.ts +4 -0
- package/components/CheckableList/types.d.ts.map +1 -1
- package/components/DragResizeWindowRND/DragResizeWindowRND.d.ts.map +1 -1
- package/components/DragResizeWindowRND/DragResizeWindowRND.js +132 -118
- package/components/DragResizeWindowRND/constants.d.ts +1 -0
- package/components/DragResizeWindowRND/constants.d.ts.map +1 -1
- package/components/DragResizeWindowRND/constants.js +3 -2
- package/components/DragResizeWindowRND/hooks/types.d.ts +15 -0
- package/components/DragResizeWindowRND/hooks/types.d.ts.map +1 -0
- package/components/DragResizeWindowRND/hooks/useRNDCollapse.d.ts +4 -0
- package/components/DragResizeWindowRND/hooks/useRNDCollapse.d.ts.map +1 -0
- package/components/DragResizeWindowRND/hooks/useRNDCollapse.js +41 -0
- package/components/DragResizeWindowRND/hooks/useRNDDimensionEffects.d.ts +1 -0
- package/components/DragResizeWindowRND/hooks/useRNDDimensionEffects.d.ts.map +1 -1
- package/components/DragResizeWindowRND/hooks/useRNDDimensionEffects.js +21 -19
- package/components/DragResizeWindowRND/hooks/useRNDDragOptions.d.ts +2 -0
- package/components/DragResizeWindowRND/hooks/useRNDDragOptions.d.ts.map +1 -1
- package/components/DragResizeWindowRND/hooks/useRNDDragOptions.js +55 -54
- package/components/DragResizeWindowRND/types.d.ts +4 -0
- package/components/DragResizeWindowRND/types.d.ts.map +1 -1
- package/components/Label/Label.d.ts +2 -5
- package/components/Label/Label.d.ts.map +1 -1
- package/components/Label/Label.js +34 -35
- package/components/SortableList/dictionaryDefaults.d.ts +7 -0
- package/components/SortableList/dictionaryDefaults.d.ts.map +1 -0
- package/components/SortableList/dictionaryDefaults.js +34 -0
- package/components/SortableList/index.d.ts +1 -0
- package/components/SortableList/index.d.ts.map +1 -1
- package/components/Stepper/helpers/focusFirstErrorField/index.d.ts +1 -1
- package/components/Stepper/helpers/focusFirstErrorField/index.d.ts.map +1 -1
- package/components/Stepper/helpers/focusFirstErrorField/index.js +29 -14
- package/components/Stepper/helpers/getStepFocusTargets/constants.d.ts +4 -0
- package/components/Stepper/helpers/getStepFocusTargets/constants.d.ts.map +1 -0
- package/components/Stepper/helpers/getStepFocusTargets/constants.js +32 -0
- package/components/Stepper/helpers/getStepFocusTargets/index.d.ts +10 -0
- package/components/Stepper/helpers/getStepFocusTargets/index.d.ts.map +1 -0
- package/components/Stepper/helpers/getStepFocusTargets/index.js +34 -0
- package/components/Stepper/helpers/getStepFocusTargets/types.d.ts +6 -0
- package/components/Stepper/helpers/getStepFocusTargets/types.d.ts.map +1 -0
- package/components/Stepper/hooks/useStepEntryFocus/index.d.ts +4 -0
- package/components/Stepper/hooks/useStepEntryFocus/index.d.ts.map +1 -0
- package/components/Stepper/hooks/useStepEntryFocus/index.js +59 -0
- package/components/Stepper/hooks/useStepEntryFocus/types.d.ts +9 -0
- package/components/Stepper/hooks/useStepEntryFocus/types.d.ts.map +1 -0
- package/components/Stepper/hooks/useStepperActions/index.d.ts.map +1 -1
- package/components/Stepper/hooks/useStepperActions/index.js +53 -43
- package/components/Stepper/index.d.ts +1 -0
- package/components/Stepper/index.d.ts.map +1 -1
- package/components/Stepper/store/StepperContext/index.d.ts.map +1 -1
- package/components/Stepper/store/StepperContext/index.js +37 -35
- package/components/Stepper/store/StepperFocusContext/index.d.ts +5 -0
- package/components/Stepper/store/StepperFocusContext/index.d.ts.map +1 -0
- package/components/Stepper/store/StepperFocusContext/index.js +9 -0
- package/components/Stepper/store/StepperFocusContext/types.d.ts +8 -0
- package/components/Stepper/store/StepperFocusContext/types.d.ts.map +1 -0
- package/components/Stepper/subcomponents/StepArea/hooks/useStepArea.d.ts.map +1 -1
- package/components/Stepper/subcomponents/StepArea/hooks/useStepArea.js +74 -57
- package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/index.d.ts.map +1 -1
- package/components/Stepper/subcomponents/StepperContent/subcomponents/Step/index.js +21 -6
- package/components/Stepper/tests/focus/fixtures.d.ts +8 -0
- package/components/Stepper/tests/focus/fixtures.d.ts.map +1 -0
- package/components/Stepper/tests/focus/types.d.ts +63 -0
- package/components/Stepper/tests/focus/types.d.ts.map +1 -0
- package/components/Stepper/types.d.ts +8 -0
- package/components/Stepper/types.d.ts.map +1 -1
- package/components/WindowBase/WindowBase.d.ts.map +1 -1
- package/components/WindowBase/WindowBase.js +74 -64
- package/components/WindowBase/WindowBase.styles.d.ts.map +1 -1
- package/components/WindowBase/WindowBase.styles.js +16 -5
- package/components/WindowBase/subcomponents/Header/HeaderWindowBase.d.ts.map +1 -1
- package/components/WindowBase/subcomponents/Header/HeaderWindowBase.js +59 -58
- package/components/WindowBase/subcomponents/Header/types.d.ts +1 -1
- package/components/WindowBase/subcomponents/Header/types.d.ts.map +1 -1
- package/components/WindowBase/subcomponents/Header/useButtonActions.d.ts.map +1 -1
- package/components/WindowBase/subcomponents/Header/useButtonActions.js +13 -12
- package/components/WindowBase/subcomponents/MemoizedIconButton/MemoizedIconButton.d.ts +1 -1
- package/components/WindowBase/subcomponents/MemoizedIconButton/MemoizedIconButton.d.ts.map +1 -1
- package/components/WindowBase/subcomponents/MemoizedIconButton/MemoizedIconButton.js +5 -5
- package/components/WindowBase/subcomponents/MemoizedIconButton/types.d.ts +2 -0
- package/components/WindowBase/subcomponents/MemoizedIconButton/types.d.ts.map +1 -1
- package/components/WindowBase/types.d.ts +7 -1
- package/components/WindowBase/types.d.ts.map +1 -1
- package/components/areas/types.d.ts +1 -1
- package/components/areas/types.d.ts.map +1 -1
- package/components/extended/React-resizable-panels/slots/SplitLayoutSlots.d.ts +2 -2
- package/components/extended/mui/Autocomplete/hooks/useAutocomplete/useAutocomplete.d.ts +1 -1
- package/components/extended/mui/Autocomplete/hooks/useEndAdornments.d.ts +2 -1
- package/components/extended/mui/Autocomplete/hooks/useEndAdornments.d.ts.map +1 -1
- package/components/extended/mui/Autocomplete/hooks/useEndAdornments.js +65 -58
- package/components/extended/mui/Autocomplete/hooks/useValuesAndHandlers.d.ts +1 -1
- package/components/extended/mui/Autocomplete/hooks/useValuesAndHandlers.d.ts.map +1 -1
- package/components/extended/mui/Autocomplete/hooks/useValuesAndHandlers.js +51 -51
- package/components/extended/mui/Autocomplete/tests/keyboard/AutocompleteKeyboardFixture.d.ts +5 -0
- package/components/extended/mui/Autocomplete/tests/keyboard/AutocompleteKeyboardFixture.d.ts.map +1 -0
- package/components/extended/mui/Autocomplete/tests/keyboard/constants.d.ts +3 -0
- package/components/extended/mui/Autocomplete/tests/keyboard/constants.d.ts.map +1 -0
- package/components/extended/mui/Autocomplete/tests/keyboard/types.d.ts +17 -0
- package/components/extended/mui/Autocomplete/tests/keyboard/types.d.ts.map +1 -0
- package/components/extended/mui/Select/Select.d.ts.map +1 -1
- package/components/extended/mui/Select/Select.js +99 -94
- package/components/extended/mui/Select/Select.styles.d.ts.map +1 -1
- package/components/extended/mui/Select/Select.styles.js +48 -39
- package/components/extended/mui/Select/tests/keyboard/SelectKeyboardFixture.d.ts +4 -0
- package/components/extended/mui/Select/tests/keyboard/SelectKeyboardFixture.d.ts.map +1 -0
- package/components/extended/mui/Select/tests/keyboard/types.d.ts +6 -0
- package/components/extended/mui/Select/tests/keyboard/types.d.ts.map +1 -0
- package/components/formatters/DistanceToNowFormatter/DistanceToNowFormatter.d.ts +2 -6
- package/components/formatters/DistanceToNowFormatter/DistanceToNowFormatter.d.ts.map +1 -1
- package/components/formatters/DistanceToNowFormatter/DistanceToNowFormatter.js +18 -17
- package/components/formatters/DistanceToNowFormatter/dictionary.d.ts +18 -0
- package/components/formatters/DistanceToNowFormatter/dictionary.d.ts.map +1 -1
- package/components/formatters/DistanceToNowFormatter/dictionary.js +19 -1
- package/components/formatters/DistanceToNowFormatter/dictionaryDefaults.d.ts +96 -0
- package/components/formatters/DistanceToNowFormatter/dictionaryDefaults.d.ts.map +1 -0
- package/components/formatters/DistanceToNowFormatter/dictionaryDefaults.js +101 -0
- package/components/formatters/DistanceToNowFormatter/hooks/useDistanceToNowFormatter.d.ts +4 -9
- package/components/formatters/DistanceToNowFormatter/hooks/useDistanceToNowFormatter.d.ts.map +1 -1
- package/components/formatters/DistanceToNowFormatter/hooks/useDistanceToNowFormatter.js +41 -15
- package/components/formatters/DistanceToNowFormatter/index.d.ts +1 -0
- package/components/formatters/DistanceToNowFormatter/index.d.ts.map +1 -1
- package/components/formatters/DistanceToNowFormatter/types.d.ts +10 -3
- package/components/formatters/DistanceToNowFormatter/types.d.ts.map +1 -1
- package/components/hook-form/RHFActionsGroup/RHFActionsGroup.d.ts.map +1 -1
- package/components/hook-form/RHFActionsGroup/RHFActionsGroup.js +43 -40
- package/components/hook-form/RHFCheckableList/RHFCheckableList.d.ts.map +1 -1
- package/components/hook-form/RHFCheckableList/RHFCheckableList.js +82 -73
- package/components/hook-form/RHFCheckbox/RHFCheckbox.d.ts.map +1 -1
- package/components/hook-form/RHFCheckbox/RHFCheckbox.js +62 -53
- package/components/hook-form/RHFDatePicker/RHFDatePicker.d.ts.map +1 -1
- package/components/hook-form/RHFDatePicker/RHFDatePicker.js +35 -32
- package/components/hook-form/RHFDateTime/RHFDateTime.d.ts.map +1 -1
- package/components/hook-form/RHFDateTime/RHFDateTime.js +42 -39
- package/components/hook-form/RHFMultiCheckbox/index.d.ts.map +1 -1
- package/components/hook-form/RHFMultiCheckbox/index.js +20 -17
- package/components/hook-form/RHFNumberInput/RHFNumberInput.d.ts.map +1 -1
- package/components/hook-form/RHFNumberInput/RHFNumberInput.js +46 -43
- package/components/hook-form/RHFPeriod/RHFPeriod.d.ts.map +1 -1
- package/components/hook-form/RHFPeriod/RHFPeriod.js +41 -39
- package/components/hook-form/RHFRadioGroup/RHFRadioGroup.d.ts.map +1 -1
- package/components/hook-form/RHFRadioGroup/RHFRadioGroup.js +62 -59
- package/components/hook-form/RHFSelect/RHFSelect.d.ts.map +1 -1
- package/components/hook-form/RHFSelect/RHFSelect.js +89 -73
- package/components/hook-form/RHFSelect/test/focus/SelectFocusFixture.d.ts +4 -0
- package/components/hook-form/RHFSelect/test/focus/SelectFocusFixture.d.ts.map +1 -0
- package/components/hook-form/RHFSelect/test/focus/constants.d.ts +3 -0
- package/components/hook-form/RHFSelect/test/focus/constants.d.ts.map +1 -0
- package/components/hook-form/RHFSelect/test/focus/types.d.ts +13 -0
- package/components/hook-form/RHFSelect/test/focus/types.d.ts.map +1 -0
- package/components/hook-form/RHFSelect/types.d.ts +5 -0
- package/components/hook-form/RHFSelect/types.d.ts.map +1 -1
- package/components/hook-form/RHFTextField/RHFTextField.d.ts.map +1 -1
- package/components/hook-form/RHFTextField/RHFTextField.js +55 -52
- package/components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.d.ts.map +1 -1
- package/components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.js +93 -85
- package/components/hook-form/RHFUpload/RHFUploaMultipleFile/components/UploadMultiple/index.d.ts +1 -1
- package/components/hook-form/RHFUpload/RHFUploaMultipleFile/components/UploadMultiple/index.d.ts.map +1 -1
- package/components/hook-form/RHFUpload/RHFUploaMultipleFile/index.d.ts +1 -1
- package/components/hook-form/RHFUpload/RHFUploaMultipleFile/index.d.ts.map +1 -1
- package/components/hook-form/RHFUpload/RHFUploaMultipleFile/types.d.ts +2 -0
- package/components/hook-form/RHFUpload/RHFUploaMultipleFile/types.d.ts.map +1 -1
- package/components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.d.ts.map +1 -1
- package/components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.js +74 -66
- package/components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.styles.d.ts.map +1 -1
- package/components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.styles.js +52 -32
- package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/UploadImage.d.ts.map +1 -1
- package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/UploadImage.js +1 -0
- package/components/hook-form/RHFUpload/RHFUploadImage/tests/focus/UploadImageFocusFixture.d.ts +4 -0
- package/components/hook-form/RHFUpload/RHFUploadImage/tests/focus/UploadImageFocusFixture.d.ts.map +1 -0
- package/components/hook-form/RHFUpload/RHFUploadImage/tests/focus/types.d.ts +13 -0
- package/components/hook-form/RHFUpload/RHFUploadImage/tests/focus/types.d.ts.map +1 -0
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/RHFUploadSingleFile.d.ts.map +1 -1
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/RHFUploadSingleFile.js +34 -32
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/subcomponents/UploadSingleFile/index.js +13 -13
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/store.d.ts.map +1 -1
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/store.js +16 -16
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/types.d.ts +4 -2
- package/components/popups/components/PopupsProvider/contexts/PopupsContext/types.d.ts.map +1 -1
- package/components/popups/components/PopupsProvider/hooks/types.d.ts +5 -0
- package/components/popups/components/PopupsProvider/hooks/types.d.ts.map +1 -0
- package/components/popups/components/PopupsProvider/hooks/useHeaderActionsPopups.d.ts +3 -14
- package/components/popups/components/PopupsProvider/hooks/useHeaderActionsPopups.d.ts.map +1 -1
- package/components/popups/components/PopupsProvider/hooks/useHeaderActionsPopups.js +34 -33
- package/components/popups/components/PopupsViewer/subcomponents/Popup/Popup.d.ts.map +1 -1
- package/components/popups/components/PopupsViewer/subcomponents/Popup/Popup.js +125 -118
- package/components/popups/components/PopupsViewer/subcomponents/Popup/usePopupHeaderHeight.d.ts +3 -0
- package/components/popups/components/PopupsViewer/subcomponents/Popup/usePopupHeaderHeight.d.ts.map +1 -0
- package/components/popups/components/PopupsViewer/subcomponents/Popup/usePopupHeaderHeight.js +21 -0
- package/components/popups/dictionaryDefaults.d.ts +4 -0
- package/components/popups/dictionaryDefaults.d.ts.map +1 -0
- package/components/popups/dictionaryDefaults.js +16 -0
- package/components/popups/index.d.ts +1 -0
- package/components/popups/index.d.ts.map +1 -1
- package/hocs/withRHFController/index.d.ts.map +1 -1
- package/hocs/withRHFController/index.js +71 -61
- package/index.js +823 -813
- package/package.json +12 -12
- package/test/mocks/dictionary-mock.d.ts +71 -23
- package/test/mocks/dictionary-mock.d.ts.map +1 -1
- package/utils/formatDistanceToNow/formatDistanteToNow.d.ts +2 -2
- package/utils/formatDistanceToNow/formatDistanteToNow.d.ts.map +1 -1
- package/utils/formatDistanceToNow/formatDistanteToNow.js +40 -23
- package/utils/formatDistanceToNow/index.d.ts +1 -1
- package/utils/formatDistanceToNow/index.d.ts.map +1 -1
- package/utils/formatDistanceToNow/types.d.ts +12 -6
- package/utils/formatDistanceToNow/types.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/hook-form/RHFUpload/RHFUploaMultipleFile/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAG/C,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/hook-form/RHFUpload/RHFUploaMultipleFile/index.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAG/C,MAAM,WAAW,uBAAwB,SAAQ,IAAI,CAAC,oBAAoB,EAAE,OAAO,GAAG,cAAc,CAAC;IACjG,IAAI,EAAE,MAAM,CAAC;CAChB;AACD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,uBAAuB,oDA2B7E"}
|
|
@@ -4,6 +4,8 @@ import { SxProps } from '@mui/material';
|
|
|
4
4
|
import { Theme } from '@mui/material/styles';
|
|
5
5
|
import { CustomFile } from '../components/UploadComponents/types';
|
|
6
6
|
export interface UploadMultiFileProps extends DropzoneOptions {
|
|
7
|
+
/** Explicit RHF ownership when composed by RHFUploadMultiFile. */
|
|
8
|
+
rhfFieldName?: string;
|
|
7
9
|
error?: boolean;
|
|
8
10
|
files: CustomFile[];
|
|
9
11
|
showPreview: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/hook-form/RHFUpload/RHFUploaMultipleFile/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,MAAM,WAAW,oBAAqB,SAAQ,eAAe;IAC3D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,KAAK,IAAI,CAAC;IACxC,WAAW,EAAE,YAAY,CAAC;IAC1B,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/hook-form/RHFUpload/RHFUploaMultipleFile/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAClE,MAAM,WAAW,oBAAqB,SAAQ,eAAe;IAC3D,kEAAkE;IAClE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,KAAK,IAAI,CAAC;IACxC,WAAW,EAAE,YAAY,CAAC;IAC1B,EAAE,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IACpB,UAAU,CAAC,EAAE,SAAS,CAAC;CACxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RHFUploadImage.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"RHFUploadImage.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,oDA6ExD"}
|
|
@@ -1,78 +1,86 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useFormContext as
|
|
1
|
+
import { jsx as e, jsxs as x, Fragment as y } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useFormContext as U, Controller as F } from "react-hook-form";
|
|
3
3
|
import { useComponentSize as H } from "../../../../hooks/useComponentSize/index.js";
|
|
4
4
|
import { RHFUploadImageRootStyled as I } from "./slots/RHFUploadImageSlots.js";
|
|
5
5
|
import { UploadImage as L } from "./subcomponents/UploadImage/UploadImage.js";
|
|
6
6
|
import { Label as O } from "../../../Label/Label.js";
|
|
7
7
|
import { HelperError as v } from "../../../HelperError/HelperError.js";
|
|
8
|
-
function
|
|
8
|
+
function A(c) {
|
|
9
9
|
const {
|
|
10
|
-
name:
|
|
11
|
-
size:
|
|
12
|
-
accept:
|
|
10
|
+
name: m,
|
|
11
|
+
size: f,
|
|
12
|
+
accept: B,
|
|
13
13
|
label: i,
|
|
14
|
-
mandatory:
|
|
15
|
-
mandatoryMessage:
|
|
16
|
-
maxSize:
|
|
17
|
-
helperMessage:
|
|
18
|
-
disabled:
|
|
19
|
-
readOnly:
|
|
20
|
-
...
|
|
21
|
-
} =
|
|
22
|
-
return /* @__PURE__ */ e(
|
|
23
|
-
|
|
14
|
+
mandatory: p,
|
|
15
|
+
mandatoryMessage: u,
|
|
16
|
+
maxSize: g,
|
|
17
|
+
helperMessage: z,
|
|
18
|
+
disabled: l,
|
|
19
|
+
readOnly: s,
|
|
20
|
+
...b
|
|
21
|
+
} = c, { currentSize: r } = H(f), o = r === "small" || r === "medium" ? r : "medium", { control: h } = U();
|
|
22
|
+
return /* @__PURE__ */ e(
|
|
23
|
+
I,
|
|
24
24
|
{
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
25
|
+
"data-rhf-field": m,
|
|
26
|
+
"data-rhf-disabled": !!l,
|
|
27
|
+
"data-rhf-readonly": !!s,
|
|
28
|
+
children: /* @__PURE__ */ e(
|
|
29
|
+
F,
|
|
30
|
+
{
|
|
31
|
+
name: m,
|
|
32
|
+
control: h,
|
|
33
|
+
render: ({ field: { value: S, onChange: n }, fieldState: { error: d }, formState: { isSubmitting: R } }) => {
|
|
34
|
+
const t = !!d;
|
|
35
|
+
return /* @__PURE__ */ x(y, { children: [
|
|
36
|
+
i && /* @__PURE__ */ e(
|
|
37
|
+
O,
|
|
38
|
+
{
|
|
39
|
+
error: t,
|
|
40
|
+
label: i,
|
|
41
|
+
mandatory: p,
|
|
42
|
+
mandatoryMessage: u,
|
|
43
|
+
helperMessage: z,
|
|
44
|
+
size: o
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ e(
|
|
48
|
+
L,
|
|
49
|
+
{
|
|
50
|
+
onDrop: (j) => {
|
|
51
|
+
const a = j[0];
|
|
52
|
+
a && n(
|
|
53
|
+
Object.assign(a, {
|
|
54
|
+
preview: URL.createObjectURL(a)
|
|
55
|
+
})
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
onRemove: () => {
|
|
59
|
+
n(null);
|
|
60
|
+
},
|
|
61
|
+
error: t,
|
|
62
|
+
disabled: l || R,
|
|
63
|
+
readOnly: s,
|
|
64
|
+
...b,
|
|
65
|
+
file: S,
|
|
66
|
+
size: o,
|
|
67
|
+
maxSize: g
|
|
68
|
+
}
|
|
69
|
+
),
|
|
70
|
+
t && /* @__PURE__ */ e(
|
|
71
|
+
v,
|
|
72
|
+
{
|
|
73
|
+
message: d?.message,
|
|
74
|
+
size: o
|
|
75
|
+
}
|
|
76
|
+
)
|
|
77
|
+
] });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
)
|
|
73
81
|
}
|
|
74
|
-
)
|
|
82
|
+
);
|
|
75
83
|
}
|
|
76
84
|
export {
|
|
77
|
-
|
|
85
|
+
A as RHFUploadImage
|
|
78
86
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RHFUploadImage.styles.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA4B,oBAAoB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"RHFUploadImage.styles.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA4B,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAa9E,eAAO,MAAM,oBAAoB,EAAG,oBA2SnC,CAAC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { getSharedInputStateColors as o } from "../../../../utils/getSharedInputStateColors.js";
|
|
2
|
+
import { RHF_UPLOAD_IMAGE_CLASSES as s } from "./constants.js";
|
|
3
|
+
const t = "185px";
|
|
2
4
|
function r(e) {
|
|
3
5
|
const i = e?.maxHeight ?? e?.height;
|
|
4
6
|
return typeof i == "number" ? `${i}px` : i;
|
|
5
7
|
}
|
|
6
|
-
const
|
|
8
|
+
const l = {
|
|
7
9
|
/**
|
|
8
10
|
* rhfUploadImageRoot: outer wrapper
|
|
9
11
|
*/
|
|
@@ -18,35 +20,46 @@ const t = {
|
|
|
18
20
|
/**
|
|
19
21
|
* uploadImageRoot: dropzone outer border
|
|
20
22
|
*/
|
|
21
|
-
uploadImageRoot: ({ theme: e, ownerState: i }) =>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
23
|
+
uploadImageRoot: ({ theme: e, ownerState: i }) => {
|
|
24
|
+
const a = o(e, !!(i?.error || i?.isDragReject));
|
|
25
|
+
return {
|
|
26
|
+
padding: `${e.vars.size.baseSpacings.sp2}`,
|
|
27
|
+
border: e.vars.size.borderStroke.container,
|
|
28
|
+
borderRadius: e.vars.size.borderRadius.r1,
|
|
29
|
+
borderColor: i?.readOnly ? e.vars.palette.border.disabled : e.vars.palette.border.default,
|
|
30
|
+
boxSizing: "border-box",
|
|
31
|
+
width: "100%",
|
|
32
|
+
...i?.isDragAccept && {
|
|
33
|
+
borderColor: e.vars.palette.primary.main
|
|
34
|
+
},
|
|
35
|
+
...i?.isDragReject && {
|
|
36
|
+
borderColor: e.vars.palette.error.main
|
|
37
|
+
},
|
|
38
|
+
...i?.error && {
|
|
39
|
+
borderColor: e.vars.palette.error.main
|
|
40
|
+
},
|
|
41
|
+
...i?.readOnly && {
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
background: e.vars.palette.background.default,
|
|
44
|
+
borderRadius: e.vars.size.borderRadius.r2,
|
|
45
|
+
borderWidth: "2px",
|
|
46
|
+
display: "flex",
|
|
47
|
+
height: r(i) ?? t,
|
|
48
|
+
justifyContent: "center",
|
|
49
|
+
minHeight: r(i) ?? t,
|
|
50
|
+
overflow: "hidden",
|
|
51
|
+
pointerEvents: "none"
|
|
52
|
+
},
|
|
53
|
+
// Paint the field frame only when the dropzone itself owns entry focus.
|
|
54
|
+
// Browse/remove buttons retain their own independent focus treatment.
|
|
55
|
+
...!i?.disabled && !i?.readOnly && {
|
|
56
|
+
[`&:has(> .${s.contentModuleLayout}:focus)`]: {
|
|
57
|
+
borderColor: a.focusBorderColor,
|
|
58
|
+
boxShadow: `0px 0px 0px 1.5px ${a.focusRingColor} !important`
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
},
|
|
50
63
|
/**
|
|
51
64
|
* contentModuleLayout: inner content area
|
|
52
65
|
*/
|
|
@@ -57,6 +70,13 @@ const t = {
|
|
|
57
70
|
display: "flex",
|
|
58
71
|
gap: e.vars.size.baseSpacings.sp4,
|
|
59
72
|
flexDirection: "column",
|
|
73
|
+
...!i?.disabled && !i?.readOnly && {
|
|
74
|
+
// The themed frame replaces the inner browser outline in normal colors.
|
|
75
|
+
// Keep the native outline in forced colors, where shadows are suppressed.
|
|
76
|
+
"@media (forced-colors: none)": {
|
|
77
|
+
"&:focus": { outline: "none" }
|
|
78
|
+
}
|
|
79
|
+
},
|
|
60
80
|
"&:hover": {
|
|
61
81
|
button: {
|
|
62
82
|
display: "flex !important"
|
|
@@ -246,5 +266,5 @@ const t = {
|
|
|
246
266
|
})
|
|
247
267
|
};
|
|
248
268
|
export {
|
|
249
|
-
|
|
269
|
+
l as rhfUploadImageStyles
|
|
250
270
|
};
|
package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/UploadImage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadImage.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/UploadImage.tsx"],"names":[],"mappings":"AA6BA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG3C;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,
|
|
1
|
+
{"version":3,"file":"UploadImage.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/UploadImage.tsx"],"names":[],"mappings":"AA6BA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAG3C;;GAEG;AACH,eAAO,MAAM,WAAW,GAAI,OAAO,gBAAgB,qDAqMlD,CAAC"}
|
package/components/hook-form/RHFUpload/RHFUploadImage/tests/focus/UploadImageFocusFixture.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { UploadImageFocusFixtureProps } from './types';
|
|
2
|
+
/** Keep real RHF/dropzone ownership inside the Stepper's public target-discovery boundary. */
|
|
3
|
+
export declare function UploadImageFocusFixture({ disabled, readOnly, onMethods }: UploadImageFocusFixtureProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
4
|
+
//# sourceMappingURL=UploadImageFocusFixture.d.ts.map
|
package/components/hook-form/RHFUpload/RHFUploadImage/tests/focus/UploadImageFocusFixture.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UploadImageFocusFixture.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/hook-form/RHFUpload/RHFUploadImage/tests/focus/UploadImageFocusFixture.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,4BAA4B,EAA0B,MAAM,SAAS,CAAC;AAEpF,8FAA8F;AAC9F,wBAAgB,uBAAuB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,4BAA4B,oDAYtG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { UseFormReturn } from 'react-hook-form';
|
|
2
|
+
/** Actual form values used to prove that focus alone never changes the selected image. */
|
|
3
|
+
export interface UploadImageFocusValues {
|
|
4
|
+
image: File | null;
|
|
5
|
+
next: string;
|
|
6
|
+
}
|
|
7
|
+
/** Public editability states surrounding the real RHF upload field. */
|
|
8
|
+
export interface UploadImageFocusFixtureProps {
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
readOnly?: boolean;
|
|
11
|
+
onMethods: (methods: UseFormReturn<UploadImageFocusValues>) => void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/hook-form/RHFUpload/RHFUploadImage/tests/focus/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,0FAA0F;AAC1F,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,uEAAuE;AACvE,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,CAAC,OAAO,EAAE,aAAa,CAAC,sBAAsB,CAAC,KAAK,IAAI,CAAC;CACrE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RHFUploadSingleFile.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/hook-form/RHFUpload/RHFUploadSingleFile/RHFUploadSingleFile.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAQnD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,
|
|
1
|
+
{"version":3,"file":"RHFUploadSingleFile.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/hook-form/RHFUpload/RHFUploadSingleFile/RHFUploadSingleFile.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAQnD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,oDA4DlE"}
|
|
@@ -1,62 +1,64 @@
|
|
|
1
|
-
import { jsx as e, jsxs as U, Fragment as
|
|
2
|
-
import { useFormContext as
|
|
3
|
-
import
|
|
4
|
-
import { RHFUploadSingleFileRootStyled as
|
|
1
|
+
import { jsx as e, jsxs as U, Fragment as h } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useFormContext as I, Controller as L } from "react-hook-form";
|
|
3
|
+
import y from "./subcomponents/UploadSingleFile/index.js";
|
|
4
|
+
import { RHFUploadSingleFileRootStyled as H, LabelStyled as N, HelperErrorStyled as R } from "./slots/RHFUploadSingleFileSlots.js";
|
|
5
5
|
import { useComponentSize as j } from "../../../../hooks/useComponentSize/index.js";
|
|
6
6
|
import C from "clsx";
|
|
7
7
|
import { DEFAULT_MAX_FILE_SIZE as M, RHF_UPLOAD_SINGLE_FILE_KEY_COMPONENT as O } from "./constants.js";
|
|
8
8
|
import { getPropDataTestId as T } from "../../../../test/getNameDataTestId.js";
|
|
9
9
|
import { RHFUploadSingleFileSlots as w } from "./slots/RHFUploadSingleFileEnum.js";
|
|
10
|
-
function
|
|
11
|
-
const { control:
|
|
12
|
-
[
|
|
10
|
+
function Y(m) {
|
|
11
|
+
const { control: d } = I(), { name: a, label: l, skeletonWidth: n, size: p, className: c, helperMessage: S, mandatory: f, mandatoryMessage: F, maxFileSize: g = M, dataTestId: u, accept: b = "*/*", disabled: o } = m, { currentSize: t } = j(p), r = t === "small" || t === "medium" ? t : "medium", x = {
|
|
12
|
+
[b]: []
|
|
13
13
|
};
|
|
14
14
|
return /* @__PURE__ */ e(
|
|
15
|
-
|
|
15
|
+
H,
|
|
16
16
|
{
|
|
17
|
+
"data-rhf-field": a,
|
|
18
|
+
"data-rhf-disabled": !!o,
|
|
17
19
|
role: "textbox",
|
|
18
20
|
"aria-label": "upload-single-file",
|
|
19
21
|
ownerState: {},
|
|
20
22
|
className: C(c),
|
|
21
23
|
...T(O, w.root, u),
|
|
22
24
|
children: /* @__PURE__ */ e(
|
|
23
|
-
|
|
25
|
+
L,
|
|
24
26
|
{
|
|
25
|
-
name:
|
|
26
|
-
control:
|
|
27
|
-
render: ({ field: { value:
|
|
28
|
-
const
|
|
29
|
-
return /* @__PURE__ */ U(
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
name: a,
|
|
28
|
+
control: d,
|
|
29
|
+
render: ({ field: { value: z, onChange: E }, fieldState: { error: i }, formState: { isSubmitting: _ } }) => {
|
|
30
|
+
const s = !!i;
|
|
31
|
+
return /* @__PURE__ */ U(h, { children: [
|
|
32
|
+
l && /* @__PURE__ */ e(
|
|
33
|
+
N,
|
|
32
34
|
{
|
|
33
35
|
ownerState: {},
|
|
34
|
-
error:
|
|
35
|
-
label:
|
|
36
|
+
error: s,
|
|
37
|
+
label: l,
|
|
36
38
|
mandatory: f,
|
|
37
39
|
mandatoryMessage: F,
|
|
38
40
|
helperMessage: S,
|
|
39
|
-
size:
|
|
40
|
-
skeletonWidth:
|
|
41
|
-
disabled:
|
|
41
|
+
size: r,
|
|
42
|
+
skeletonWidth: n,
|
|
43
|
+
disabled: o
|
|
42
44
|
}
|
|
43
45
|
),
|
|
44
46
|
/* @__PURE__ */ e(
|
|
45
|
-
|
|
47
|
+
y,
|
|
46
48
|
{
|
|
47
49
|
maxFileSize: g,
|
|
48
|
-
accept:
|
|
49
|
-
file:
|
|
50
|
-
onChange:
|
|
51
|
-
size:
|
|
52
|
-
disabled:
|
|
50
|
+
accept: x,
|
|
51
|
+
file: z,
|
|
52
|
+
onChange: E,
|
|
53
|
+
size: r,
|
|
54
|
+
disabled: o || _
|
|
53
55
|
}
|
|
54
56
|
),
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
s && /* @__PURE__ */ e(
|
|
58
|
+
R,
|
|
57
59
|
{
|
|
58
|
-
message:
|
|
59
|
-
size:
|
|
60
|
+
message: i?.message,
|
|
61
|
+
size: r,
|
|
60
62
|
ownerState: {}
|
|
61
63
|
}
|
|
62
64
|
)
|
|
@@ -68,5 +70,5 @@ function Z(s) {
|
|
|
68
70
|
);
|
|
69
71
|
}
|
|
70
72
|
export {
|
|
71
|
-
|
|
73
|
+
Y as RHFUploadSingleFile
|
|
72
74
|
};
|
package/components/hook-form/RHFUpload/RHFUploadSingleFile/subcomponents/UploadSingleFile/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsx as a, jsxs as _ } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { useDropzone as
|
|
3
|
-
import { useReducer as
|
|
4
|
-
import { ContainerDropZoneStyled as
|
|
2
|
+
import { useDropzone as h } from "react-dropzone";
|
|
3
|
+
import { useReducer as D, useEffect as g } from "react";
|
|
4
|
+
import { ContainerDropZoneStyled as P, DropZoneStyled as T } from "../../slots/RHFUploadSingleFileSlots.js";
|
|
5
5
|
import { useHostTools as L, useModuleDictionary as b, useModuleSkeleton as w } from "@m4l/core";
|
|
6
6
|
import { COMPONENTS_DICTIONARY_KEYS as p } from "../../dictionary.js";
|
|
7
7
|
import { BlockContent as z } from "../BlockContent/BlockContent.js";
|
|
8
8
|
import { Preview as O } from "../Preview/Preview.js";
|
|
9
|
-
import { RHF_UPLOAD_SINGLE_FILE_CLASSES as
|
|
9
|
+
import { RHF_UPLOAD_SINGLE_FILE_CLASSES as v } from "../../constants.js";
|
|
10
10
|
import { uploadReducer as A } from "../../helpers/uploadReducer.js";
|
|
11
11
|
import { formatFileSize as C } from "../../helpers/formatFileSize.js";
|
|
12
12
|
import { getReadableFileType as N } from "../../helpers/getReadableFileType.js";
|
|
13
13
|
function B(R) {
|
|
14
|
-
const { file: t, accept: n, onChange:
|
|
14
|
+
const { file: t, accept: n, onChange: u, maxFileSize: c, size: d, disabled: f } = R, { toast: S } = L(), { getLabel: i } = b(), E = w(), [e, r] = D(A, {
|
|
15
15
|
progress: null,
|
|
16
16
|
preview: !1,
|
|
17
17
|
validFile: !1
|
|
18
|
-
}), { getRootProps: F, getInputProps: I } =
|
|
18
|
+
}), { getRootProps: F, getInputProps: I } = h({
|
|
19
19
|
multiple: !1,
|
|
20
20
|
disabled: f,
|
|
21
21
|
/**
|
|
@@ -24,26 +24,26 @@ function B(R) {
|
|
|
24
24
|
onDrop: (o) => {
|
|
25
25
|
try {
|
|
26
26
|
if (r({ type: "RESET" }), o.length > 0) {
|
|
27
|
-
const l = o[0], m = Object.entries(n).some(([s]) => !!(s === "*/*" || l.type === s || s.endsWith("/*") && l.type.startsWith(s.slice(0, -2)))), y = l.size <=
|
|
28
|
-
!m || !y ? (m || S({ title: `${i(p.errorFileRejected)} ${i(p.acceptFile)} ${N(Object.keys(n)[0])}.` }, { type: "error" }), y || S({ title: `${i(p.errorMaxSize)} ${i(p.acceptSize)} ${C(
|
|
27
|
+
const l = o[0], m = Object.entries(n).some(([s]) => !!(s === "*/*" || l.type === s || s.endsWith("/*") && l.type.startsWith(s.slice(0, -2)))), y = l.size <= c;
|
|
28
|
+
!m || !y ? (m || S({ title: `${i(p.errorFileRejected)} ${i(p.acceptFile)} ${N(Object.keys(n)[0])}.` }, { type: "error" }), y || S({ title: `${i(p.errorMaxSize)} ${i(p.acceptSize)} ${C(c)}.` }, { type: "error" })) : (u?.(l), r({ type: "SET_VALID_FILE", payload: !0 }));
|
|
29
29
|
}
|
|
30
30
|
} catch (l) {
|
|
31
31
|
console.error("Error in file drop:", l);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
|
-
return
|
|
35
|
+
return g(() => {
|
|
36
36
|
t && !e.validFile ? (r({ type: "SET_VALID_FILE", payload: !0 }), r({ type: "SET_PREVIEW", payload: !0 })) : !t && e.validFile && r({ type: "RESET" });
|
|
37
|
-
}, [t, e.validFile]),
|
|
37
|
+
}, [t, e.validFile]), g(() => {
|
|
38
38
|
let o;
|
|
39
39
|
return t && e.validFile && !e.preview && (o = setInterval(() => {
|
|
40
40
|
r({ type: "SET_PROGRESS", payload: (e.progress ?? 0) + 10 }), e.progress !== null && e.progress >= 100 && (clearInterval(o), r({ type: "SET_PROGRESS", payload: null }), r({ type: "SET_PREVIEW", payload: !0 }));
|
|
41
41
|
}, 100)), () => {
|
|
42
42
|
o && clearInterval(o);
|
|
43
43
|
};
|
|
44
|
-
}, [t, e.progress, e.validFile, e.preview]), /* @__PURE__ */ a(
|
|
45
|
-
/* @__PURE__ */ a(z, { value: e.progress, hidden: e.preview, size:
|
|
46
|
-
e.preview && !!t && /* @__PURE__ */ a(O, { uploadProgress: e.progress, file: t, onChange:
|
|
44
|
+
}, [t, e.progress, e.validFile, e.preview]), /* @__PURE__ */ a(P, { ownerState: {}, className: v.containerDropZone, children: /* @__PURE__ */ _(T, { ...F(), "data-rhf-focus-target": !0, ownerState: { isSkeleton: E }, className: v.dropZone, children: [
|
|
45
|
+
/* @__PURE__ */ a(z, { value: e.progress, hidden: e.preview, size: d }),
|
|
46
|
+
e.preview && !!t && /* @__PURE__ */ a(O, { uploadProgress: e.progress, file: t, onChange: u, onClose: () => r({ type: "RESET" }), size: d, disabled: f }),
|
|
47
47
|
!E && /* @__PURE__ */ a("input", { role: "button", "aria-label": "button-upload-single-file", ...I() })
|
|
48
48
|
] }) });
|
|
49
49
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/popups/components/PopupsProvider/contexts/PopupsContext/store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mCAAmC,EAAE,uBAAuB,EAAqB,MAAM,SAAS,CAAC;AAqB/G;;;;GAIG;AACH;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,WAAW,uBAAuB,EAAE,8BAA4B;;;;;;;;
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/components/src/components/popups/components/PopupsProvider/contexts/PopupsContext/store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mCAAmC,EAAE,uBAAuB,EAAqB,MAAM,SAAS,CAAC;AAqB/G;;;;GAIG;AACH;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,WAAW,uBAAuB,EAAE,8BAA4B;;;;;;;;CAkXjG,CAAC;AACF,MAAM,MAAM,0BAA0B,GAAG,UAAU,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
|
@@ -3,19 +3,19 @@ import { immer as x } from "zustand/middleware/immer";
|
|
|
3
3
|
import g from "lodash-es/cloneDeep";
|
|
4
4
|
import { createDynamicMFStore as l } from "../../../../../WindowBase/contexts/DynamicMFParmsContext/store.js";
|
|
5
5
|
import { devtools as y } from "zustand/middleware";
|
|
6
|
-
const
|
|
6
|
+
const G = (d, c) => {
|
|
7
7
|
const { enabled: a = !1 } = c;
|
|
8
|
-
return a && process.env.NODE_ENV === "development" ? y(
|
|
9
|
-
}, C = (
|
|
8
|
+
return a && process.env.NODE_ENV === "development" ? y(d, c) : d;
|
|
9
|
+
}, C = (d, c = !1) => {
|
|
10
10
|
const a = {
|
|
11
|
-
...
|
|
12
|
-
currentZindex:
|
|
11
|
+
...d,
|
|
12
|
+
currentZindex: d.baseZindex,
|
|
13
13
|
popupsIds: [],
|
|
14
14
|
hashPopups: {},
|
|
15
15
|
hashGroups: {}
|
|
16
16
|
};
|
|
17
17
|
return m(
|
|
18
|
-
|
|
18
|
+
G(
|
|
19
19
|
x((u, e) => ({
|
|
20
20
|
...a,
|
|
21
21
|
popupsActions: {
|
|
@@ -43,26 +43,26 @@ const I = (P, c) => {
|
|
|
43
43
|
* addPopup: Añade un popup
|
|
44
44
|
*/
|
|
45
45
|
addPopup: (o, s) => {
|
|
46
|
-
const { popupId: h, dynamicParams: p, dynamicMFStore: r, groupId:
|
|
46
|
+
const { popupId: h, dynamicParams: p, dynamicMFStore: r, groupId: P = "global" } = o;
|
|
47
47
|
if (e().hashPopups[h])
|
|
48
48
|
throw new Error(`Popup with id ${h} already exists`);
|
|
49
49
|
u((n) => {
|
|
50
50
|
s?.closeOthers && n.popupsIds.forEach((i) => {
|
|
51
|
-
n.hashPopups[i].groupId ===
|
|
51
|
+
n.hashPopups[i].groupId === P && (n.hashPopups[i].status = "closing");
|
|
52
52
|
});
|
|
53
53
|
const f = r || l({
|
|
54
54
|
dynamicMFParameters: p || {}
|
|
55
55
|
});
|
|
56
56
|
n.hashPopups[h] = {
|
|
57
57
|
...o,
|
|
58
|
-
groupId:
|
|
58
|
+
groupId: P,
|
|
59
59
|
status: "init",
|
|
60
60
|
zIndex: n.currentZindex,
|
|
61
61
|
dynamicMFStore: f
|
|
62
|
-
}, n.popupsIds.push(h), n.currentZindex += 1, n.hashGroups[
|
|
63
|
-
id:
|
|
62
|
+
}, n.popupsIds.push(h), n.currentZindex += 1, n.hashGroups[P] || (n.hashGroups[P] = {
|
|
63
|
+
id: P,
|
|
64
64
|
count: 0
|
|
65
|
-
}), n.hashGroups[
|
|
65
|
+
}), n.hashGroups[P].count += 1, n.hashGroups[P].selectedPopupId = h, n.hashPopups[h].onSelectedPopupIdChange?.(n.hashPopups[h].groupId, h, "add");
|
|
66
66
|
});
|
|
67
67
|
},
|
|
68
68
|
/**
|
|
@@ -78,8 +78,8 @@ const I = (P, c) => {
|
|
|
78
78
|
*/
|
|
79
79
|
bringPopupOnFront: (o, s) => {
|
|
80
80
|
e().hashPopups[o] && u((h) => {
|
|
81
|
-
const p = h.popupsIds.reduce((r,
|
|
82
|
-
h.hashPopups[o].zIndex !== p && (h.hashPopups[o].zIndex = h.currentZindex, h.currentZindex = h.currentZindex + 1), s && (h.hashPopups[o].enforceVisibleCount = (h.hashPopups[o].enforceVisibleCount || 0) + 1), h.hashGroups[h.hashPopups[o].groupId].selectedPopupId = o, h.hashPopups[o].onSelectedPopupIdChange?.(h.hashPopups[o].groupId, o, "select");
|
|
81
|
+
const p = h.popupsIds.reduce((r, P, n) => h.hashPopups[h.popupsIds[n]].zIndex > r ? h.hashPopups[h.popupsIds[n]].zIndex : r, h.hashPopups[h.popupsIds[0]].zIndex);
|
|
82
|
+
h.hashPopups[o].zIndex !== p && (h.hashPopups[o].zIndex = h.currentZindex, h.currentZindex = h.currentZindex + 1), s && (h.hashPopups[o].collapsed = !1, h.hashPopups[o].enforceVisibleCount = (h.hashPopups[o].enforceVisibleCount || 0) + 1), h.hashGroups[h.hashPopups[o].groupId].selectedPopupId = o, h.hashPopups[o].onSelectedPopupIdChange?.(h.hashPopups[o].groupId, o, "select");
|
|
83
83
|
});
|
|
84
84
|
},
|
|
85
85
|
/**
|
|
@@ -103,7 +103,7 @@ const I = (P, c) => {
|
|
|
103
103
|
*/
|
|
104
104
|
colapseLayoutItem: (o) => {
|
|
105
105
|
u((s) => {
|
|
106
|
-
s.hashPopups[o] && (s.hashPopups[o].collapsed = !0);
|
|
106
|
+
s.hashPopups[o] && s.hashPopups[o].collapsible !== !1 && (s.hashPopups[o].collapsed = !0);
|
|
107
107
|
});
|
|
108
108
|
},
|
|
109
109
|
/**
|
|
@@ -211,7 +211,7 @@ const I = (P, c) => {
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
})),
|
|
214
|
-
{ name: `PopupsStore: ${
|
|
214
|
+
{ name: `PopupsStore: ${d.storeId}`, enabled: c }
|
|
215
215
|
)
|
|
216
216
|
);
|
|
217
217
|
};
|