@m4l/components 9.3.34-BE20251127-beta.1 → 9.3.34-JT20251210-beta.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.
- package/@types/export.d.ts +6 -0
- package/@types/types.d.ts +60 -6
- package/components/AccountPopover/AccountPopover.styles.js +5 -2
- package/components/AccountPopover/slots/AccountPopoverSlots.d.ts +6 -6
- package/components/ActionsGroup/ActionsGroup.d.ts +5 -0
- package/components/ActionsGroup/ActionsGroup.js +40 -0
- package/components/ActionsGroup/ActionsGroup.styles.d.ts +2 -0
- package/components/ActionsGroup/ActionsGroup.styles.js +95 -0
- package/components/ActionsGroup/__tests__/ActionsGroup.test.d.ts +1 -0
- package/components/ActionsGroup/constants.d.ts +2 -0
- package/components/ActionsGroup/constants.js +8 -0
- package/components/ActionsGroup/icons.d.ts +3 -0
- package/components/ActionsGroup/icons.js +6 -0
- package/components/ActionsGroup/index.d.ts +1 -0
- package/components/ActionsGroup/slots/ActionsGroupEnum.d.ts +8 -0
- package/components/ActionsGroup/slots/ActionsGroupEnum.js +12 -0
- package/components/ActionsGroup/slots/ActionsGroupSlots.d.ts +15 -0
- package/components/ActionsGroup/slots/ActionsGroupSlots.js +35 -0
- package/components/ActionsGroup/subcomponents/ActionIconButton/ActionIconButton.d.ts +6 -0
- package/components/ActionsGroup/subcomponents/ActionIconButton/ActionIconButton.js +76 -0
- package/components/ActionsGroup/subcomponents/ActionIconButton/types.d.ts +7 -0
- package/components/ActionsGroup/types.d.ts +60 -0
- package/components/AppBar/slots/AppBarSlots.d.ts +1 -1
- package/components/CheckableList/CheckableList.d.ts +20 -0
- package/components/CheckableList/CheckableList.js +225 -0
- package/components/CheckableList/CheckableList.styles.d.ts +2 -0
- package/components/CheckableList/CheckableList.styles.js +247 -0
- package/components/CheckableList/constants.d.ts +5 -0
- package/components/CheckableList/constants.js +17 -0
- package/components/CheckableList/dictionary.d.ts +14 -0
- package/components/CheckableList/dictionary.js +14 -0
- package/components/CheckableList/hooks/index.d.ts +6 -0
- package/components/CheckableList/hooks/useCheckableListHandlers.d.ts +21 -0
- package/components/CheckableList/hooks/useCheckableListHandlers.js +66 -0
- package/components/CheckableList/hooks/useCheckableListItems.d.ts +19 -0
- package/components/CheckableList/hooks/useCheckableListItems.js +79 -0
- package/components/CheckableList/hooks/useCheckableListRender.d.ts +52 -0
- package/components/CheckableList/hooks/useCheckableListRender.js +223 -0
- package/components/CheckableList/hooks/useCheckableListSelection.d.ts +19 -0
- package/components/CheckableList/hooks/useCheckableListSelection.js +69 -0
- package/components/CheckableList/hooks/useCheckableListState.d.ts +17 -0
- package/components/CheckableList/hooks/useCheckableListState.js +59 -0
- package/components/CheckableList/hooks/useCheckableListVirtualization.d.ts +14 -0
- package/components/CheckableList/hooks/useCheckableListVirtualization.js +42 -0
- package/components/CheckableList/icons.d.ts +5 -0
- package/components/CheckableList/icons.js +8 -0
- package/components/CheckableList/index.d.ts +3 -0
- package/components/CheckableList/slots/index.d.ts +2 -0
- package/components/CheckableList/slots/index.js +1 -0
- package/components/CheckableList/slots/slots.d.ts +26 -0
- package/components/CheckableList/slots/slots.js +30 -0
- package/components/CheckableList/slots/styled.d.ts +72 -0
- package/components/CheckableList/slots/styled.js +130 -0
- package/components/CheckableList/types.d.ts +277 -0
- package/components/Chip/slots/ChipSlots.d.ts +2 -2
- package/components/CommonActions/components/ActionCancel/slots/ActionsCancelSlots.d.ts +1 -1
- package/components/CommonActions/components/ActionFormCancel/ActionFormCancel.js +1 -1
- package/components/CommonActions/components/ActionFormCancel/slots/ActionFormCancelSlots.d.ts +1 -1
- package/components/CommonActions/components/ActionIntro/slots/ActionsIntroSlots.d.ts +1 -1
- package/components/CommonActions/components/ActionsContainer/slots/ActionsContainerSlots.d.ts +1 -1
- package/components/ContainerFlow/ContainerFlow.js +1 -1
- package/components/DataGrid/DataGrid.js +9 -1
- package/components/DataGrid/Datagrid.styles.js +169 -72
- package/components/DataGrid/constants.d.ts +13 -0
- package/components/DataGrid/constants.js +11 -0
- package/components/DataGrid/contexts/DataGridContext/index.js +62 -275
- package/components/DataGrid/contexts/DataGridContext/types.d.ts +24 -23
- package/components/DataGrid/dictionary.d.ts +1 -0
- package/components/DataGrid/dictionary.js +2 -1
- package/components/DataGrid/formatters/ColumnColorFormatter/tests/ColumnColorFormatter.test.d.ts +1 -0
- package/components/DataGrid/formatters/ColumnColorFormatter/tests/useColumnColor.test.d.ts +1 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/ImageFormatterCell.d.ts +13 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/ImageFormatterCell.js +33 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/constants.d.ts +6 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/constants.js +6 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/formatter.d.ts +8 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/formatter.js +25 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/index.d.ts +3 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/index.js +1 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/tests/ColumnImageFormatter.test.d.ts +1 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/types.d.ts +44 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/types.js +1 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/useColumnImage.d.ts +9 -0
- package/components/DataGrid/formatters/ColumnImageFormatter/useColumnImage.js +22 -0
- package/components/DataGrid/formatters/ColumnTagsFormatter/tests/ColumnTagsFormatter.test.d.ts +1 -0
- package/components/DataGrid/formatters/ColumnTagsFormatter/tests/useColumnTags.test.d.ts +1 -0
- package/components/DataGrid/formatters/index.d.ts +1 -0
- package/components/DataGrid/helpers/getAllViewModes/getAllViewModes.d.ts +19 -0
- package/components/DataGrid/helpers/getAllViewModes/getAllViewModes.js +6 -0
- package/components/DataGrid/helpers/getAllViewModes/getAllViewModes.test.d.ts +1 -0
- package/components/DataGrid/helpers/getAllViewModes/index.d.ts +1 -0
- package/components/DataGrid/helpers/getAllViewModes/index.js +1 -0
- package/components/DataGrid/helpers/getColumnsWidth/getColumnsWidth.d.ts +47 -0
- package/components/DataGrid/helpers/getColumnsWidth/getColumnsWidth.js +32 -0
- package/components/DataGrid/helpers/getColumnsWidth/getColumnsWidth.test.d.ts +1 -0
- package/components/DataGrid/helpers/getColumnsWidth/index.d.ts +1 -0
- package/components/DataGrid/helpers/getColumnsWidth/index.js +1 -0
- package/components/DataGrid/helpers/getIndexRowHeightVariant/getIndexRowHeightVariant.d.ts +24 -0
- package/components/DataGrid/helpers/getIndexRowHeightVariant/getIndexRowHeightVariant.js +12 -0
- package/components/DataGrid/helpers/getIndexRowHeightVariant/getIndexRowHeightVariant.test.d.ts +1 -0
- package/components/DataGrid/helpers/getIndexRowHeightVariant/index.d.ts +1 -0
- package/components/DataGrid/helpers/getIndexRowHeightVariant/index.js +1 -0
- package/components/DataGrid/helpers/getInitialColumnsConfig/getInitialColumnsConfig.d.ts +48 -0
- package/components/DataGrid/helpers/getInitialColumnsConfig/getInitialColumnsConfig.js +35 -0
- package/components/DataGrid/helpers/getInitialColumnsConfig/getInitialColumnsConfig.test.d.ts +1 -0
- package/components/DataGrid/helpers/getInitialColumnsConfig/index.d.ts +1 -0
- package/components/DataGrid/helpers/getInitialColumnsConfig/index.js +1 -0
- package/components/DataGrid/helpers/getViewMode/getViewMode.d.ts +41 -0
- package/components/DataGrid/helpers/getViewMode/getViewMode.js +19 -0
- package/components/DataGrid/helpers/getViewMode/getViewMode.test.d.ts +1 -0
- package/components/DataGrid/helpers/getViewMode/index.d.ts +1 -0
- package/components/DataGrid/helpers/getViewMode/index.js +1 -0
- package/components/DataGrid/helpers/getViewSpecificConfig/getViewSpecificConfig.d.ts +28 -0
- package/components/DataGrid/helpers/getViewSpecificConfig/getViewSpecificConfig.js +22 -0
- package/components/DataGrid/helpers/getViewSpecificConfig/getViewSpecificConfig.test.d.ts +1 -0
- package/components/DataGrid/helpers/getViewSpecificConfig/index.d.ts +1 -0
- package/components/DataGrid/helpers/getViewSpecificConfig/index.js +1 -0
- package/components/DataGrid/helpers/getViewSuffix/getViewSuffix.d.ts +24 -0
- package/components/DataGrid/helpers/getViewSuffix/getViewSuffix.js +9 -0
- package/components/DataGrid/helpers/getViewSuffix/getViewSuffix.test.d.ts +1 -0
- package/components/DataGrid/helpers/getViewSuffix/index.d.ts +1 -0
- package/components/DataGrid/helpers/getViewSuffix/index.js +1 -0
- package/components/DataGrid/helpers/index.d.ts +13 -0
- package/components/DataGrid/helpers/index.js +1 -0
- package/components/DataGrid/helpers/loadViewConfig/index.d.ts +1 -0
- package/components/DataGrid/helpers/loadViewConfig/index.js +1 -0
- package/components/DataGrid/helpers/loadViewConfig/loadViewConfig.d.ts +23 -0
- package/components/DataGrid/helpers/loadViewConfig/loadViewConfig.js +12 -0
- package/components/DataGrid/helpers/loadViewConfig/loadViewConfig.test.d.ts +1 -0
- package/components/DataGrid/helpers/saveColumnsWidth/index.d.ts +1 -0
- package/components/DataGrid/helpers/saveColumnsWidth/index.js +1 -0
- package/components/DataGrid/helpers/saveColumnsWidth/saveColumnsWidth.d.ts +52 -0
- package/components/DataGrid/helpers/saveColumnsWidth/saveColumnsWidth.js +18 -0
- package/components/DataGrid/helpers/saveColumnsWidth/saveColumnsWidth.test.d.ts +1 -0
- package/components/DataGrid/helpers/saveViewConfig/index.d.ts +1 -0
- package/components/DataGrid/helpers/saveViewConfig/index.js +1 -0
- package/components/DataGrid/helpers/saveViewConfig/saveViewConfig.d.ts +35 -0
- package/components/DataGrid/helpers/saveViewConfig/saveViewConfig.js +15 -0
- package/components/DataGrid/helpers/saveViewConfig/saveViewConfig.test.d.ts +1 -0
- package/components/DataGrid/helpers/saveViewMode/index.d.ts +1 -0
- package/components/DataGrid/helpers/saveViewMode/index.js +1 -0
- package/components/DataGrid/helpers/saveViewMode/saveViewMode.d.ts +33 -0
- package/components/DataGrid/helpers/saveViewMode/saveViewMode.js +13 -0
- package/components/DataGrid/helpers/saveViewMode/saveViewMode.test.d.ts +1 -0
- package/components/DataGrid/hooks/index.d.ts +6 -0
- package/components/DataGrid/hooks/index.js +1 -0
- package/components/DataGrid/hooks/useChangeColumnsConfig/index.d.ts +1 -0
- package/components/DataGrid/hooks/useChangeColumnsConfig/index.js +1 -0
- package/components/DataGrid/hooks/useChangeColumnsConfig/useChangeColumnsConfig.d.ts +9 -0
- package/components/DataGrid/hooks/useChangeColumnsConfig/useChangeColumnsConfig.js +27 -0
- package/components/DataGrid/hooks/useChangeColumnsConfig/useChangeColumnsConfig.test.d.ts +1 -0
- package/components/DataGrid/hooks/useChangeColumnsOrder/index.d.ts +1 -0
- package/components/DataGrid/hooks/useChangeColumnsOrder/index.js +1 -0
- package/components/DataGrid/hooks/useChangeColumnsOrder/useChangeColumnsOrder.d.ts +10 -0
- package/components/DataGrid/hooks/useChangeColumnsOrder/useChangeColumnsOrder.js +34 -0
- package/components/DataGrid/hooks/useChangeColumnsOrder/useChangeColumnsOrder.test.d.ts +1 -0
- package/components/DataGrid/hooks/useColumnsWidth/index.d.ts +1 -0
- package/components/DataGrid/hooks/useColumnsWidth/index.js +1 -0
- package/components/DataGrid/hooks/useColumnsWidth/useColumnsWidth.d.ts +11 -0
- package/components/DataGrid/hooks/useColumnsWidth/useColumnsWidth.js +29 -0
- package/components/DataGrid/hooks/useColumnsWidth/useColumnsWidth.test.d.ts +1 -0
- package/components/DataGrid/hooks/useModalCardDetail.d.ts +1 -1
- package/components/DataGrid/hooks/useModalCardDetail.js +6 -1
- package/components/DataGrid/hooks/useRowHeight/index.d.ts +1 -0
- package/components/DataGrid/hooks/useRowHeight/index.js +1 -0
- package/components/DataGrid/hooks/useRowHeight/useRowHeight.d.ts +28 -0
- package/components/DataGrid/hooks/useRowHeight/useRowHeight.js +51 -0
- package/components/DataGrid/hooks/useRowHeight/useRowHeight.test.d.ts +1 -0
- package/components/DataGrid/hooks/useViewConfig/index.d.ts +1 -0
- package/components/DataGrid/hooks/useViewConfig/index.js +1 -0
- package/components/DataGrid/hooks/useViewConfig/useViewConfig.d.ts +9 -0
- package/components/DataGrid/hooks/useViewConfig/useViewConfig.js +30 -0
- package/components/DataGrid/hooks/useViewConfig/useViewConfig.test.d.ts +1 -0
- package/components/DataGrid/hooks/useViewMode/index.d.ts +1 -0
- package/components/DataGrid/hooks/useViewMode/index.js +1 -0
- package/components/DataGrid/hooks/useViewMode/useViewMode.d.ts +31 -0
- package/components/DataGrid/hooks/useViewMode/useViewMode.js +44 -0
- package/components/DataGrid/hooks/useViewMode/useViewMode.test.d.ts +1 -0
- package/components/DataGrid/icons.d.ts +1 -0
- package/components/DataGrid/icons.js +2 -1
- package/components/DataGrid/index.d.ts +5 -4
- package/components/DataGrid/slots/DataGridEnum.d.ts +4 -1
- package/components/DataGrid/slots/DataGridEnum.js +3 -0
- package/components/DataGrid/slots/DataGridSlot.d.ts +3 -0
- package/components/DataGrid/slots/DataGridSlot.js +48 -33
- package/components/DataGrid/subcomponents/Cards/helpers/calculateCardHeight.d.ts +5 -4
- package/components/DataGrid/subcomponents/Cards/helpers/calculateCardHeight.js +4 -1
- package/components/DataGrid/subcomponents/Cards/helpers/scrollToCardElement.js +2 -2
- package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.d.ts +1 -1
- package/components/DataGrid/subcomponents/Cards/hooks/useCardContent.js +47 -5
- package/components/DataGrid/subcomponents/Cards/index.js +22 -6
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.d.ts +1 -1
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardDetails/index.js +57 -15
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardHeader/index.js +16 -8
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.d.ts +2 -2
- package/components/DataGrid/subcomponents/Cards/subcomponents/CardRow/index.js +6 -1
- package/components/DataGrid/subcomponents/Cards/types.d.ts +16 -0
- package/components/DataGrid/subcomponents/CheckboxCellAdapter/index.js +5 -2
- package/components/DataGrid/subcomponents/ControlNavigate/ControlNavigate.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/index.js +2 -2
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Density/index.js +0 -3
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/RowsCount/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfigCards/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/ViewMode/index.js +1 -1
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +6 -2
- package/components/DataGrid/subcomponents/Table/index.js +11 -2
- package/components/DataGrid/subcomponents/Table/subcomponents/ActionsColumn.js +0 -3
- package/components/DataGrid/subcomponents/Table/subcomponents/CheckboxFormatter.js +1 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/CustomIcons.js +39 -14
- package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/RadioFormatter.d.ts +6 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/RadioFormatter.js +12 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/RadioSelectColumn.d.ts +64 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/RadioSelectColumn.js +46 -0
- package/components/DataGrid/subcomponents/editors/TextEditor/index.js +1 -1
- package/components/DataGrid/tests/helpers/types.d.ts +10 -0
- package/components/DataGrid/tests/table/subcomponents/RadioFormatter.test.d.ts +1 -0
- package/components/DataGrid/tests/table/subcomponents/RadioSelectColumn.test.d.ts +1 -0
- package/components/DataGrid/types.d.ts +49 -6
- package/components/DataGrid/types.helpers.d.ts +55 -0
- package/components/DataGrid/types.helpers.js +1 -0
- package/components/DataGrid/types.hooks.d.ts +81 -0
- package/components/DynamicFilter/DynamicFilter.styles.js +5 -2
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +2 -2
- package/components/DynamicFilter/store/DynamicFilterContext.js +11 -0
- package/components/DynamicFilter/store/DynamicFilterStore.js +9 -0
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/useDynamicFilterBase.d.ts +1 -1
- package/components/DynamicFilter/types.d.ts +4 -0
- package/components/DynamicSort/DynamicSort.styles.js +5 -2
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts +2 -2
- package/components/DynamicSort/store/DynamicSortStore.js +6 -0
- package/components/DynamicSort/subcomponents/DynamicSortBase/useDynamicSortBase.d.ts +1 -1
- package/components/DynamicSort/subcomponents/PopoverMenuFields/PopoverMenuFields.js +3 -0
- package/components/DynamicSort/subcomponents/PopoverSort/PopoverSort.js +3 -0
- package/components/DynamicSort/types.d.ts +4 -0
- package/components/EditLabel/constants.d.ts +1 -1
- package/components/EditLabel/slots/EditLabelSlots.d.ts +4 -4
- package/components/GridLayout/styles.js +0 -1
- package/components/HelperError/slots/HelperErrorSlots.d.ts +1 -1
- package/components/ImageText/constants.d.ts +1 -1
- package/components/ImageText/slots/ImageTextSlots.d.ts +2 -2
- package/components/Label/index.d.ts +1 -1
- package/components/Label/slots/LabelSlots.d.ts +3 -3
- package/components/Label/types.d.ts +6 -0
- package/components/LanguagePopover/LanguagePopover.styles.js +13 -4
- package/components/LanguagePopover/slots/LanguagePopoverSlots.d.ts +1 -1
- package/components/LoadingError/slots/LoadingErrorSlots.d.ts +1 -1
- package/components/MFIsolationApp/slots/MFIsolationAppSlots.d.ts +2 -2
- package/components/MFLoader/styles.js +0 -1
- package/components/MenuActions/slots/MenuActionsSlots.d.ts +2 -2
- package/components/ModalDialog/ModalDialog.styles.js +8 -1
- package/components/ModalDialog/slots/ModalDialogSlots.d.ts +2 -2
- package/components/NumberInput/slots/NumberInputSlots.d.ts +2 -2
- package/components/ObjectLogs/slots/ObjectLogsSlots.d.ts +2 -2
- package/components/Pager/slots/PagerSlots.d.ts +3 -3
- package/components/PaperForm/slots/PaperFormSlots.d.ts +1 -1
- package/components/PrintingSystem/PrintingSystem.js +3 -1
- package/components/PrintingSystem/PrintingSystem.styles.js +179 -2
- package/components/SettingsLayout/slots/SettingsLayoutSlots.d.ts +3 -3
- package/components/SideBar/slots/SideBarSlots.d.ts +1 -1
- package/components/SideBar/subcomponents/SideBarMobile/index.js +0 -3
- package/components/Stepper/Stepper.styles.js +13 -8
- package/{helpers → components/Stepper/helpers}/getStepsAndValidationSchema/getStepsAndValidationSchema.d.ts +4 -4
- package/{helpers → components/Stepper/helpers}/getStepsAndValidationSchema/getStepsAndValidationSchema.js +6 -12
- package/components/Stepper/helpers/getStepsAndValidationSchema/index.js +1 -0
- package/{helpers → components/Stepper/helpers}/getStepsAndValidationSchema/types.d.ts +6 -3
- package/components/Stepper/helpers/getStepsAndValidationSchema/types.js +1 -0
- package/components/Stepper/hooks/useDynamicValidation/index.d.ts +2 -1
- package/components/Stepper/hooks/useDynamicValidation/index.js +31 -6
- package/components/Stepper/index.d.ts +1 -0
- package/components/Stepper/slots/StepperSlot.d.ts +4 -4
- package/components/TabsNavigator/slots/TabsNavigatorSlots.d.ts +12 -12
- package/components/ToastContainer/slots/toastContainerSlots.d.ts +4 -4
- package/components/WindowBase/WindowBase.styles.js +8 -0
- package/components/WindowBase/hooks/useDynamicMFParameters/index.d.ts +4 -4
- package/components/WindowBase/slots/WindowBaseSlots.d.ts +2 -2
- package/components/WindowBase/subcomponents/Header/useButtonActions.js +23 -13
- package/components/animate/variants/background.d.ts +9 -9
- package/components/animate/variants/bounce.d.ts +9 -9
- package/components/animate/variants/fade.d.ts +20 -20
- package/components/animate/variants/flip.d.ts +6 -6
- package/components/animate/variants/rotate.d.ts +3 -3
- package/components/animate/variants/scale.d.ts +6 -6
- package/components/animate/variants/slide.d.ts +16 -16
- package/components/animate/variants/transition.d.ts +3 -3
- package/components/animate/variants/zoom.d.ts +15 -15
- package/components/areas/components/AreasAdmin/slots/AreasAdminSlots.d.ts +3 -3
- package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/subcomponents/ChipMobile/ChipMobile.js +5 -0
- package/components/commercial/AppBarCommercial/styles.js +1 -3
- package/components/commercial/HamburgerMenu/styles.js +1 -3
- package/components/commercial/SectionCommercial/styles.d.ts +1 -1
- package/components/commercial/SectionCommercial/styles.js +1 -3
- package/components/commercial/TopBar/component/ConteinItem/subcomponets/NavItem/index.js +1 -3
- package/components/commercial/TopBar/style.js +1 -3
- package/components/extended/React-Resizable/Resizable/slots/ResizableSlots.d.ts +1 -1
- package/components/extended/React-Resizable/ResizableBox/slots/ResizableBoxSlots.d.ts +1 -1
- package/components/extended/React-resizable-panels/slots/SplitLayoutSlots.d.ts +6 -6
- package/components/formatters/BooleanFormatter/slots/BooleanFormatterSlots.d.ts +1 -1
- package/components/formatters/ConcatenatedFormatter/slots/ConcatenatedFormatterSlots.d.ts +1 -1
- package/components/formatters/DateFormatter/slots/DateFormatterSlots.d.ts +1 -1
- package/components/formatters/DistanceToNowFormatter/slots/DistanceToNowFormatterSlots.d.ts +1 -1
- package/components/formatters/ImageFormatter/ImageFormatter.d.ts +10 -0
- package/components/formatters/ImageFormatter/ImageFormatter.js +72 -0
- package/components/formatters/ImageFormatter/ImageFormatter.styles.d.ts +2 -0
- package/components/formatters/ImageFormatter/ImageFormatter.styles.js +42 -0
- package/components/formatters/ImageFormatter/constants.d.ts +5 -0
- package/components/formatters/ImageFormatter/constants.js +10 -0
- package/components/formatters/ImageFormatter/index.d.ts +2 -0
- package/components/formatters/ImageFormatter/index.js +1 -0
- package/components/formatters/ImageFormatter/slots/ImageFormatterEnum.d.ts +5 -0
- package/components/formatters/ImageFormatter/slots/ImageFormatterEnum.js +9 -0
- package/components/formatters/ImageFormatter/slots/ImageFormatterSlots.d.ts +9 -0
- package/components/formatters/ImageFormatter/slots/ImageFormatterSlots.js +23 -0
- package/components/formatters/ImageFormatter/tests/ImageFormatter.test.d.ts +1 -0
- package/components/formatters/ImageFormatter/types.d.ts +51 -0
- package/components/formatters/ImageFormatter/types.js +1 -0
- package/components/formatters/PeriodFormatter/slots/PeriodFormatterSlots.d.ts +1 -1
- package/components/formatters/PointsFormatter/slots/ointsFormatterSlots.d.ts +1 -1
- package/components/formatters/PriceFormatter/slots/PriceFormatterSlots.d.ts +1 -1
- package/components/formatters/UncertaintyFormatter/slots/UncertaintyFormatterSlots.d.ts +1 -1
- package/components/formatters/index.d.ts +1 -0
- package/components/hook-form/RHFActionsGroup/RHFActionsGroup.d.ts +7 -0
- package/components/hook-form/RHFActionsGroup/RHFActionsGroup.js +87 -0
- package/components/hook-form/RHFActionsGroup/RHFActionsGroupStyles.d.ts +2 -0
- package/components/hook-form/RHFActionsGroup/RHFActionsGroupStyles.js +14 -0
- package/components/hook-form/RHFActionsGroup/constants.d.ts +9 -0
- package/components/hook-form/RHFActionsGroup/constants.js +8 -0
- package/components/hook-form/RHFActionsGroup/index.d.ts +2 -0
- package/components/hook-form/RHFActionsGroup/index.js +1 -0
- package/components/hook-form/RHFActionsGroup/slots/RHFActionsGroupEnum.d.ts +3 -0
- package/components/hook-form/RHFActionsGroup/slots/RHFActionsGroupEnum.js +7 -0
- package/components/hook-form/RHFActionsGroup/slots/RHFActionsGroupSlots.d.ts +1 -0
- package/components/hook-form/RHFActionsGroup/slots/RHFActionsGroupSlots.js +11 -0
- package/components/hook-form/RHFActionsGroup/slots/index.d.ts +2 -0
- package/components/hook-form/RHFActionsGroup/slots/index.js +1 -0
- package/components/hook-form/RHFActionsGroup/tests/RHFActionsGroup.test.d.ts +1 -0
- package/components/hook-form/RHFActionsGroup/tests/common.d.ts +28 -0
- package/components/hook-form/RHFActionsGroup/types.d.ts +54 -0
- package/components/hook-form/RHFAutocomplete/RHFAutocomplete.js +2 -2
- package/components/hook-form/RHFCheckableList/RHFCheckableList.d.ts +7 -0
- package/components/hook-form/RHFCheckableList/RHFCheckableList.js +91 -0
- package/components/hook-form/RHFCheckableList/RHFCheckableList.styles.d.ts +2 -0
- package/components/hook-form/RHFCheckableList/RHFCheckableList.styles.js +30 -0
- package/components/hook-form/RHFCheckableList/constants.d.ts +8 -0
- package/components/hook-form/RHFCheckableList/constants.js +11 -0
- package/components/hook-form/RHFCheckableList/index.d.ts +2 -0
- package/components/hook-form/RHFCheckableList/index.js +1 -0
- package/components/hook-form/RHFCheckableList/slots/RHFCheckableListEnum.d.ts +6 -0
- package/components/hook-form/RHFCheckableList/slots/RHFCheckableListEnum.js +10 -0
- package/components/hook-form/RHFCheckableList/slots/RHFCheckableListSlots.d.ts +20 -0
- package/components/hook-form/RHFCheckableList/slots/RHFCheckableListSlots.js +29 -0
- package/components/hook-form/RHFCheckableList/slots/index.d.ts +2 -0
- package/components/hook-form/RHFCheckableList/types.d.ts +60 -0
- package/components/hook-form/RHFCheckbox/RHFCheckbox.js +2 -2
- package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxSlots.d.ts +1 -1
- package/components/hook-form/RHFColorPicker/RFHColorPicker.js +2 -2
- package/components/hook-form/RHFColorPicker/hooks/useColorPicker/useColorPicker.d.ts +1 -1
- package/components/hook-form/RHFColorPicker/slots/RHFColorPickerSlots.d.ts +1 -1
- package/components/hook-form/RHFDatePicker/RHFDatePicker.js +2 -2
- package/components/hook-form/RHFDatePicker/slots/RHFDatePickerSlots.d.ts +3 -3
- package/components/hook-form/RHFDateTime/RHFDateTime.js +2 -2
- package/components/hook-form/RHFNumberInput/RHFNumberInput.js +2 -2
- package/components/hook-form/RHFPeriod/RHFPeriod.js +2 -2
- package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.d.ts +1 -1
- package/components/hook-form/RHFPeriod/subcomponents/Period/Period.js +4 -4
- package/components/hook-form/RHFRadioGroup/RHFRadioGroup.d.ts +3 -3
- package/components/hook-form/RHFRadioGroup/RHFRadioGroup.js +66 -24
- package/components/hook-form/RHFRadioGroup/RHFRadioGroup.styles.d.ts +5 -0
- package/components/hook-form/RHFRadioGroup/RHFRadioGroup.styles.js +29 -0
- package/components/hook-form/RHFRadioGroup/constants.d.ts +5 -0
- package/components/hook-form/RHFRadioGroup/constants.js +8 -0
- package/components/hook-form/RHFRadioGroup/formatters/OptionIconLabelFormatter/index.d.ts +2 -2
- package/components/hook-form/RHFRadioGroup/slots/slots.d.ts +5 -0
- package/components/hook-form/RHFRadioGroup/slots/slots.js +9 -0
- package/components/hook-form/RHFRadioGroup/slots/styled.d.ts +9 -0
- package/components/hook-form/RHFRadioGroup/slots/styled.js +20 -0
- package/components/hook-form/RHFRadioGroup/types.d.ts +55 -11
- package/components/hook-form/RHFSelect/RHFSelect.js +2 -2
- package/components/hook-form/RHFSelect/constants.d.ts +1 -1
- package/components/hook-form/RHFSelect/slots/RHFSlots.d.ts +1 -1
- package/components/hook-form/RHFTextField/RHFTextField.js +2 -2
- package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +1 -1
- package/components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.js +2 -2
- package/components/hook-form/RHFTextFieldPassword/slots/RHFTextFieldPasswordSlots.d.ts +2 -2
- package/components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.js +3 -1
- package/components/hook-form/RHFUpload/RHFUploadImage/slots/RHFUploadImageSlots.d.ts +3 -3
- package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/UploadImage.js +5 -4
- package/components/hook-form/RHFUpload/RHFUploadImage/types.d.ts +4 -0
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/RHFUploadSingleFile.js +6 -4
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/constants.d.ts +1 -1
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/slots/RHFUploadSingleFileSlots.d.ts +7 -7
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/subcomponents/Preview/Preview.js +3 -2
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/subcomponents/Preview/types.d.ts +1 -1
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/subcomponents/UploadSingleFile/index.js +13 -4
- package/components/hook-form/RHFUpload/RHFUploadSingleFile/types.d.ts +4 -0
- package/components/hook-form/RHFormProvider/classes/index.d.ts +1 -1
- package/components/hook-form/RHFormProvider/styles.js +4 -3
- package/components/hook-form/index.d.ts +2 -0
- package/components/index.d.ts +2 -0
- package/components/mui_extended/Accordion/Accordion.js +3 -3
- package/components/mui_extended/Accordion/slots/AccordionSlots.d.ts +3 -3
- package/components/mui_extended/Accordion/styles.js +8 -5
- package/components/mui_extended/Autocomplete/Autocomplete.styles.js +11 -1
- package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.d.ts +6 -6
- package/components/mui_extended/Avatar/slots/AvatarSlots.d.ts +1 -1
- package/components/mui_extended/Badge/slots/BadgeSlots.d.ts +1 -1
- package/components/mui_extended/Button/slots/ButtonSlots.d.ts +2 -2
- package/components/mui_extended/CheckBox/CheckBox.js +2 -0
- package/components/mui_extended/CheckBox/slots/CheckBoxSlots.d.ts +2 -2
- package/components/mui_extended/DatePicker/constants.d.ts +1 -1
- package/components/mui_extended/DatePicker/slots/DatePickerSlots.d.ts +3 -3
- package/components/mui_extended/DateTimePicker/DateTimePicker.styles.js +158 -129
- package/components/mui_extended/DateTimePicker/slots/DateTimePickerSlots.d.ts +4 -4
- package/components/mui_extended/Divider/slots/DividerSlots.d.ts +1 -1
- package/components/mui_extended/IconButton/constants.d.ts +1 -1
- package/components/mui_extended/IconButton/slots/IconButtonSlots.d.ts +1 -1
- package/components/mui_extended/ImageButton/styles.js +1 -3
- package/components/mui_extended/LoadingButton/slots/LoadingButtonSlots.d.ts +1 -1
- package/components/mui_extended/MenuDivider/slots/MenuDividerSlots.d.ts +1 -1
- package/components/mui_extended/MenuItem/slots/MenuItemSlots.d.ts +2 -2
- package/components/mui_extended/NavLink/slots/NavLinkSlots.d.ts +1 -1
- package/components/mui_extended/Popover/Popover.styles.js +6 -1
- package/components/mui_extended/Popper/slots/PopperStlots.d.ts +1 -1
- package/components/mui_extended/Radio/Radio.d.ts +20 -0
- package/components/mui_extended/Radio/Radio.js +111 -0
- package/components/mui_extended/Radio/Radio.styles.d.ts +2 -0
- package/components/mui_extended/Radio/Radio.styles.js +101 -0
- package/components/mui_extended/Radio/constants.d.ts +2 -0
- package/components/mui_extended/Radio/constants.js +8 -0
- package/components/mui_extended/Radio/icons.d.ts +4 -0
- package/components/mui_extended/Radio/icons.js +7 -0
- package/components/mui_extended/Radio/index.d.ts +1 -0
- package/components/mui_extended/Radio/index.js +1 -0
- package/components/mui_extended/Radio/slots/slots.d.ts +6 -0
- package/components/mui_extended/Radio/slots/slots.js +10 -0
- package/components/mui_extended/Radio/slots/styled.d.ts +14 -0
- package/components/mui_extended/Radio/slots/styled.js +28 -0
- package/components/mui_extended/Radio/tests/Radio.test.d.ts +1 -0
- package/components/mui_extended/Radio/types.d.ts +53 -0
- package/components/mui_extended/Select/Select.js +2 -18
- package/components/mui_extended/Select/Select.styles.js +33 -1
- package/components/mui_extended/Select/constants.d.ts +2 -1
- package/components/mui_extended/Select/slots/SelectEnum.d.ts +2 -1
- package/components/mui_extended/Select/slots/SelectEnum.js +1 -0
- package/components/mui_extended/Select/slots/SelectSlots.d.ts +5 -5
- package/components/mui_extended/Skeleton/Slots/skeletonSlots.d.ts +1 -1
- package/components/mui_extended/Stack/Stack.d.ts +1 -1
- package/components/mui_extended/Stack/Stack.js +5 -2
- package/components/mui_extended/Stack/slots/StackSlot.d.ts +1 -1
- package/components/mui_extended/Tab/Slots/TabSlots.d.ts +2 -2
- package/components/mui_extended/TabContent/TabContent.styles.js +2 -2
- package/components/mui_extended/Tabs/Tabs.js +48 -2
- package/components/mui_extended/Tabs/Tabs.styles.js +52 -26
- package/components/mui_extended/Tabs/icons.d.ts +4 -0
- package/components/mui_extended/Tabs/icons.js +7 -0
- package/components/mui_extended/Tabs/slots/TabsSlots.d.ts +1 -1
- package/components/mui_extended/Tabs/types.d.ts +4 -1
- package/components/mui_extended/TextField/TextField.styles.js +2 -1
- package/components/mui_extended/TextField/slots/TextFieldSlots.d.ts +4 -4
- package/components/mui_extended/TimePicker/slots/TimePickerSlots.d.ts +3 -3
- package/components/mui_extended/ToggleButton/slots/ToggleButtonSlots.d.ts +1 -1
- package/components/mui_extended/ToggleIconButton/slots/ToggleIconButtonSlots.d.ts +1 -1
- package/components/mui_extended/Tooltip/Tooltip.styles.js +22 -4
- package/components/mui_extended/Tooltip/constants.d.ts +1 -1
- package/components/mui_extended/Typography/slots/typographySlots.d.ts +1 -1
- package/components/mui_extended/index.d.ts +1 -0
- package/hooks/useDataGridPersistence/constants.d.ts +2 -0
- package/hooks/useDataGridPersistence/constants.js +6 -2
- package/hooks/useDataGridPersistence/helpers.d.ts +5 -1
- package/hooks/useDataGridPersistence/helpers.js +8 -1
- package/hooks/useDataGridPersistence/useDataGridPersistence.d.ts +11 -3
- package/hooks/useDataGridPersistence/useDataGridPersistence.js +65 -20
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortEnum.d.ts +2 -1
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortEnum.js +1 -0
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortSlots.d.ts +6 -3
- package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortSlots.js +6 -0
- package/hooks/useDynamicFilterAndSort/styles.js +23 -0
- package/hooks/useDynamicFilterAndSort/types.d.ts +2 -0
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +27 -21
- package/index.d.ts +0 -1
- package/index.js +258 -240
- package/package.json +1 -1
- package/components/DataGrid/formatters/ColumnIconFormatter/constants.d.ts +0 -4
- package/components/hook-form/RHFRadioGroup/formatters/OptionIconLabelFormatter/index.js +0 -16
- package/helpers/index.d.ts +0 -1
- /package/{helpers/getStepsAndValidationSchema → components/ActionsGroup}/index.js +0 -0
- /package/{helpers → components/CheckableList/hooks}/index.js +0 -0
- /package/{helpers/getStepsAndValidationSchema/types.js → components/CheckableList/index.js} +0 -0
- /package/{helpers → components/Stepper/helpers}/getStepsAndValidationSchema/index.d.ts +0 -0
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from "react";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { C as CHECKABLE_LIST_CLASSES } from "./constants.js";
|
|
5
|
+
import { useModuleDictionary } from "@m4l/core";
|
|
6
|
+
import { D as DICCTIONARY } from "./dictionary.js";
|
|
7
|
+
import { u as useSizeContainer } from "../../hooks/useSizeContainer/index.js";
|
|
8
|
+
import { u as useStateRef } from "../../hooks/useStateRef/index.js";
|
|
9
|
+
import { u as useCheckableListState } from "./hooks/useCheckableListState.js";
|
|
10
|
+
import { u as useCheckableListItems } from "./hooks/useCheckableListItems.js";
|
|
11
|
+
import { u as useCheckableListSelection } from "./hooks/useCheckableListSelection.js";
|
|
12
|
+
import { u as useCheckableListHandlers } from "./hooks/useCheckableListHandlers.js";
|
|
13
|
+
import { u as useCheckableListVirtualization } from "./hooks/useCheckableListVirtualization.js";
|
|
14
|
+
import { u as useCheckableListRender } from "./hooks/useCheckableListRender.js";
|
|
15
|
+
import { R as RootStyled, L as LoadingContainerStyled, S as SearchContainerStyled, a as SearchInputStyled, b as SelectAllContainerStyled, c as SelectAllCheckboxStyled, C as ChipCountTypografyStyled, d as ListContainerStyled, V as VirtualizedListStyled, E as EmptyMessageWrapperStyled } from "./slots/styled.js";
|
|
16
|
+
import { S as Skeleton } from "../mui_extended/Skeleton/Skeleton.js";
|
|
17
|
+
import { I as ImageText } from "../ImageText/ImageText.js";
|
|
18
|
+
import { I as Icon } from "../Icon/Icon.js";
|
|
19
|
+
const CheckableList = (props) => {
|
|
20
|
+
const {
|
|
21
|
+
value = [],
|
|
22
|
+
onChange,
|
|
23
|
+
items = [],
|
|
24
|
+
groups,
|
|
25
|
+
multiple = true,
|
|
26
|
+
selectAll = false,
|
|
27
|
+
groupable = true,
|
|
28
|
+
expandAllGroups = true,
|
|
29
|
+
searchable = false,
|
|
30
|
+
filterFn,
|
|
31
|
+
size = "medium",
|
|
32
|
+
variant = "standard",
|
|
33
|
+
width = "100%",
|
|
34
|
+
checkboxSize = "medium",
|
|
35
|
+
showCheckboxOnGroup = true,
|
|
36
|
+
indeterminateBehavior = "indicate-some",
|
|
37
|
+
className,
|
|
38
|
+
"data-testid": dataTestId,
|
|
39
|
+
ariaLabel,
|
|
40
|
+
ariaLabelledBy,
|
|
41
|
+
renderItem,
|
|
42
|
+
renderGroup,
|
|
43
|
+
loading = false,
|
|
44
|
+
disabled = false,
|
|
45
|
+
itemRowHeight,
|
|
46
|
+
groupRowHeight
|
|
47
|
+
} = props;
|
|
48
|
+
const listRef = useRef(null);
|
|
49
|
+
const [containerElement, setContainerElement] = useStateRef(null);
|
|
50
|
+
const containerSize = useSizeContainer(containerElement, {
|
|
51
|
+
// excludePadding: true,
|
|
52
|
+
});
|
|
53
|
+
const { getLabel } = useModuleDictionary();
|
|
54
|
+
const refHeight = useRef(containerSize?.containerHeight ?? 0);
|
|
55
|
+
if (refHeight.current !== containerSize?.containerHeight) {
|
|
56
|
+
if (containerSize?.containerHeight !== 0) {
|
|
57
|
+
refHeight.current = containerSize?.containerHeight;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
const {
|
|
61
|
+
searchQuery,
|
|
62
|
+
setSearchQuery,
|
|
63
|
+
expandedGroups,
|
|
64
|
+
itemHeights,
|
|
65
|
+
handleGroupExpandToggle
|
|
66
|
+
} = useCheckableListState({
|
|
67
|
+
groups,
|
|
68
|
+
expandAllGroups
|
|
69
|
+
});
|
|
70
|
+
const {
|
|
71
|
+
isGrouped,
|
|
72
|
+
normalizedItems,
|
|
73
|
+
filteredItems,
|
|
74
|
+
filteredGroups,
|
|
75
|
+
virtualizedItems
|
|
76
|
+
} = useCheckableListItems({
|
|
77
|
+
items,
|
|
78
|
+
groups,
|
|
79
|
+
searchQuery,
|
|
80
|
+
filterFn,
|
|
81
|
+
expandedGroups
|
|
82
|
+
});
|
|
83
|
+
const {
|
|
84
|
+
getGroupItems,
|
|
85
|
+
isItemSelected,
|
|
86
|
+
isGroupFullySelected,
|
|
87
|
+
isGroupPartiallySelected,
|
|
88
|
+
areAllItemsSelected,
|
|
89
|
+
areSomeItemsSelected
|
|
90
|
+
} = useCheckableListSelection({
|
|
91
|
+
value,
|
|
92
|
+
normalizedItems,
|
|
93
|
+
groups,
|
|
94
|
+
isGrouped
|
|
95
|
+
});
|
|
96
|
+
const { handleItemToggle, handleGroupToggle, handleSelectAllToggle } = useCheckableListHandlers({
|
|
97
|
+
value,
|
|
98
|
+
onChange,
|
|
99
|
+
multiple,
|
|
100
|
+
disabled,
|
|
101
|
+
normalizedItems,
|
|
102
|
+
getGroupItems,
|
|
103
|
+
isGroupFullySelected,
|
|
104
|
+
isItemSelected,
|
|
105
|
+
areAllItemsSelected
|
|
106
|
+
});
|
|
107
|
+
const { getItemSize } = useCheckableListVirtualization({
|
|
108
|
+
virtualizedItems,
|
|
109
|
+
itemHeights,
|
|
110
|
+
defaultItemRowHeight: itemRowHeight,
|
|
111
|
+
defaultGroupRowHeight: groupRowHeight
|
|
112
|
+
});
|
|
113
|
+
const { renderVirtualizedItem, urlIconSearch, urlIconNoResults } = useCheckableListRender({
|
|
114
|
+
isItemSelected,
|
|
115
|
+
disabled,
|
|
116
|
+
size,
|
|
117
|
+
variant,
|
|
118
|
+
checkboxSize,
|
|
119
|
+
handleItemToggle,
|
|
120
|
+
renderItem,
|
|
121
|
+
expandedGroups,
|
|
122
|
+
isGroupFullySelected,
|
|
123
|
+
isGroupPartiallySelected,
|
|
124
|
+
getGroupItems,
|
|
125
|
+
indeterminateBehavior,
|
|
126
|
+
renderGroup,
|
|
127
|
+
groupable,
|
|
128
|
+
showCheckboxOnGroup,
|
|
129
|
+
handleGroupExpandToggle,
|
|
130
|
+
handleGroupToggle
|
|
131
|
+
});
|
|
132
|
+
const ownerState = {
|
|
133
|
+
size,
|
|
134
|
+
variant,
|
|
135
|
+
disabled,
|
|
136
|
+
grouped: isGrouped,
|
|
137
|
+
hasSelected: value.length > 0
|
|
138
|
+
};
|
|
139
|
+
if (loading) {
|
|
140
|
+
return /* @__PURE__ */ jsx(
|
|
141
|
+
RootStyled,
|
|
142
|
+
{
|
|
143
|
+
ownerState,
|
|
144
|
+
className: clsx(className, CHECKABLE_LIST_CLASSES.root),
|
|
145
|
+
"data-testid": dataTestId,
|
|
146
|
+
"aria-label": ariaLabel,
|
|
147
|
+
"aria-labelledby": ariaLabelledBy,
|
|
148
|
+
children: /* @__PURE__ */ jsx(LoadingContainerStyled, { ownerState, children: /* @__PURE__ */ jsx(Skeleton, { variant: "rectangular", width: "100%", height: 200 }) })
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
const hasItems = isGrouped ? filteredGroups.length > 0 : filteredItems.length > 0;
|
|
153
|
+
return /* @__PURE__ */ jsxs(
|
|
154
|
+
RootStyled,
|
|
155
|
+
{
|
|
156
|
+
ownerState,
|
|
157
|
+
className: clsx(className, CHECKABLE_LIST_CLASSES.root),
|
|
158
|
+
"data-testid": dataTestId,
|
|
159
|
+
"aria-label": ariaLabel,
|
|
160
|
+
"aria-labelledby": ariaLabelledBy,
|
|
161
|
+
children: [
|
|
162
|
+
searchable && /* @__PURE__ */ jsx(SearchContainerStyled, { ownerState, children: /* @__PURE__ */ jsx(
|
|
163
|
+
SearchInputStyled,
|
|
164
|
+
{
|
|
165
|
+
ownerState,
|
|
166
|
+
value: searchQuery,
|
|
167
|
+
onChange: (e) => setSearchQuery(e.target.value),
|
|
168
|
+
placeholder: getLabel(DICCTIONARY.label_search_placeholder),
|
|
169
|
+
size,
|
|
170
|
+
variant: "contained",
|
|
171
|
+
InputProps: {
|
|
172
|
+
startAdornment: /* @__PURE__ */ jsx(Icon, { src: urlIconSearch })
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
) }),
|
|
176
|
+
selectAll && hasItems && /* @__PURE__ */ jsxs(SelectAllContainerStyled, { ownerState, children: [
|
|
177
|
+
/* @__PURE__ */ jsx(
|
|
178
|
+
SelectAllCheckboxStyled,
|
|
179
|
+
{
|
|
180
|
+
checked: areAllItemsSelected,
|
|
181
|
+
indeterminate: areSomeItemsSelected && !areAllItemsSelected,
|
|
182
|
+
disabled,
|
|
183
|
+
size: checkboxSize,
|
|
184
|
+
onChange: handleSelectAllToggle,
|
|
185
|
+
inlineText: getLabel(DICCTIONARY.label_select_all)
|
|
186
|
+
}
|
|
187
|
+
),
|
|
188
|
+
/* @__PURE__ */ jsx(
|
|
189
|
+
ChipCountTypografyStyled,
|
|
190
|
+
{
|
|
191
|
+
ownerState,
|
|
192
|
+
variant: "body",
|
|
193
|
+
size,
|
|
194
|
+
color: "text.disabled",
|
|
195
|
+
children: value.length
|
|
196
|
+
}
|
|
197
|
+
)
|
|
198
|
+
] }),
|
|
199
|
+
/* @__PURE__ */ jsx(ListContainerStyled, { ref: setContainerElement, ownerState: { ...ownerState }, children: hasItems ? refHeight.current > 0 ? /* @__PURE__ */ jsx(
|
|
200
|
+
VirtualizedListStyled,
|
|
201
|
+
{
|
|
202
|
+
ref: listRef,
|
|
203
|
+
height: refHeight.current,
|
|
204
|
+
width,
|
|
205
|
+
itemCount: virtualizedItems.length,
|
|
206
|
+
itemSize: getItemSize,
|
|
207
|
+
itemData: virtualizedItems,
|
|
208
|
+
layout: "vertical",
|
|
209
|
+
children: renderVirtualizedItem
|
|
210
|
+
}
|
|
211
|
+
) : null : /* @__PURE__ */ jsx(EmptyMessageWrapperStyled, { ownerState, children: /* @__PURE__ */ jsx(
|
|
212
|
+
ImageText,
|
|
213
|
+
{
|
|
214
|
+
title: getLabel(DICCTIONARY.label_no_results),
|
|
215
|
+
message: getLabel(DICCTIONARY.label_no_results_description),
|
|
216
|
+
imageUrl: urlIconNoResults
|
|
217
|
+
}
|
|
218
|
+
) }) })
|
|
219
|
+
]
|
|
220
|
+
}
|
|
221
|
+
);
|
|
222
|
+
};
|
|
223
|
+
export {
|
|
224
|
+
CheckableList as C
|
|
225
|
+
};
|
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { getContrastTextColor } from "@m4l/graphics";
|
|
2
|
+
import { g as getSizeStyles } from "../../utils/getSizeStyles/getSizeStyles.js";
|
|
3
|
+
const checkableListStyles = {
|
|
4
|
+
/**
|
|
5
|
+
* Root: Estilos del contenedor principal del componente.
|
|
6
|
+
*/
|
|
7
|
+
root: ({ theme, ownerState }) => ({
|
|
8
|
+
width: "100%",
|
|
9
|
+
// height: '100%',
|
|
10
|
+
flexGrow: 1,
|
|
11
|
+
overflow: "hidden",
|
|
12
|
+
display: "flex",
|
|
13
|
+
flexDirection: "column",
|
|
14
|
+
gap: theme.vars.size.baseSpacings.sp2,
|
|
15
|
+
...ownerState?.disabled && {
|
|
16
|
+
opacity: 0.6,
|
|
17
|
+
pointerEvents: "none"
|
|
18
|
+
}
|
|
19
|
+
}),
|
|
20
|
+
/**
|
|
21
|
+
* searchContainer: Estilos del contenedor de búsqueda.
|
|
22
|
+
*/
|
|
23
|
+
searchContainer: ({ theme }) => ({
|
|
24
|
+
width: "100%",
|
|
25
|
+
padding: theme.vars.size.baseSpacings.sp1
|
|
26
|
+
}),
|
|
27
|
+
/**
|
|
28
|
+
* searchInput: Estilos del input de búsqueda.
|
|
29
|
+
*/
|
|
30
|
+
searchInput: ({ theme, ownerState }) => ({
|
|
31
|
+
width: "100%",
|
|
32
|
+
...getSizeStyles(theme, ownerState?.size || "medium", "container", (size) => ({
|
|
33
|
+
height: size,
|
|
34
|
+
minHeight: size
|
|
35
|
+
}))
|
|
36
|
+
}),
|
|
37
|
+
/**
|
|
38
|
+
* selectAllContainer: Estilos del contenedor de "Seleccionar todo".
|
|
39
|
+
*/
|
|
40
|
+
selectAllContainer: ({ theme }) => ({
|
|
41
|
+
display: "flex",
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
padding: theme.vars.size.baseSpacings.sp1,
|
|
44
|
+
paddingLeft: theme.vars.size.baseSpacings.sp2,
|
|
45
|
+
borderBottom: `1px solid ${theme.vars.palette.border.secondary}`
|
|
46
|
+
}),
|
|
47
|
+
/**
|
|
48
|
+
* selectAllCheckbox: Estilos del checkbox de "Seleccionar todo".
|
|
49
|
+
*/
|
|
50
|
+
selectAllCheckbox: ({ theme }) => ({
|
|
51
|
+
"&&& .MuiTypography-root": {
|
|
52
|
+
color: theme.vars.palette.text.secondary
|
|
53
|
+
}
|
|
54
|
+
}),
|
|
55
|
+
/**
|
|
56
|
+
* listContainer: Estilos del contenedor de la lista.
|
|
57
|
+
*/
|
|
58
|
+
listContainer: ({ theme, ownerState }) => ({
|
|
59
|
+
flex: 1,
|
|
60
|
+
overflow: "hidden",
|
|
61
|
+
display: "flex",
|
|
62
|
+
flexDirection: "column",
|
|
63
|
+
flexGrow: 1,
|
|
64
|
+
// border: `1px solid ${theme.vars.palette.border.secondary}`,
|
|
65
|
+
// borderRadius: theme.vars.size.borderRadius.r2,
|
|
66
|
+
backgroundColor: theme.vars.palette.background.default,
|
|
67
|
+
...ownerState?.maxHeight && {
|
|
68
|
+
maxHeight: typeof ownerState.maxHeight === "number" ? `${ownerState.maxHeight}px` : ownerState.maxHeight
|
|
69
|
+
}
|
|
70
|
+
}),
|
|
71
|
+
/**
|
|
72
|
+
* virtualizedList: Estilos de la lista virtualizada.
|
|
73
|
+
*/
|
|
74
|
+
virtualizedList: () => ({
|
|
75
|
+
width: "100%",
|
|
76
|
+
height: "100%"
|
|
77
|
+
}),
|
|
78
|
+
/**
|
|
79
|
+
* itemWrapper: Estilos del contenedor de cada item.
|
|
80
|
+
*/
|
|
81
|
+
itemWrapper: ({ theme, ownerState }) => ({
|
|
82
|
+
display: "flex",
|
|
83
|
+
alignItems: "center",
|
|
84
|
+
height: "100%",
|
|
85
|
+
backgroundColor: ownerState?.selected ? theme.vars.palette.primary.opacity : "transparent",
|
|
86
|
+
// borderBottom: `1px solid ${theme.vars.palette.border.secondary}`,
|
|
87
|
+
gap: theme.vars.size.baseSpacings["sp2-5"],
|
|
88
|
+
padding: theme.vars.size.baseSpacings["sp1-5"],
|
|
89
|
+
paddingLeft: theme.vars.size.baseSpacings.sp2,
|
|
90
|
+
paddingRight: theme.vars.size.baseSpacings["sp2-5"],
|
|
91
|
+
cursor: "pointer",
|
|
92
|
+
transition: "background-color 0.1s",
|
|
93
|
+
"&:hover": {
|
|
94
|
+
backgroundColor: theme.vars.palette.action.hover
|
|
95
|
+
}
|
|
96
|
+
}),
|
|
97
|
+
/**
|
|
98
|
+
* itemCheckbox: Estilos del checkbox del item.
|
|
99
|
+
*/
|
|
100
|
+
itemCheckbox: ({ theme, ownerState }) => ({
|
|
101
|
+
flexShrink: 0,
|
|
102
|
+
...getSizeStyles(theme, ownerState?.size || "medium", "action", (size) => ({
|
|
103
|
+
width: size,
|
|
104
|
+
height: size
|
|
105
|
+
}))
|
|
106
|
+
}),
|
|
107
|
+
/**
|
|
108
|
+
* itemLabel: Estilos del label del item.
|
|
109
|
+
*/
|
|
110
|
+
itemLabel: () => ({}),
|
|
111
|
+
/**
|
|
112
|
+
* itemDescription: Estilos de la descripción del item.
|
|
113
|
+
*/
|
|
114
|
+
itemDescription: () => ({}),
|
|
115
|
+
/**
|
|
116
|
+
* itemContentWrapper: Estilos del contenedor de contenido del item.
|
|
117
|
+
*/
|
|
118
|
+
itemContentWrapper: ({ theme }) => ({
|
|
119
|
+
flex: 1,
|
|
120
|
+
display: "flex",
|
|
121
|
+
flexDirection: "column",
|
|
122
|
+
gap: theme.vars.size.baseSpacings["sp0-5"]
|
|
123
|
+
}),
|
|
124
|
+
/**
|
|
125
|
+
* itemIcon: Estilos del icono del item.
|
|
126
|
+
*/
|
|
127
|
+
itemIcon: ({ theme }) => ({
|
|
128
|
+
display: "flex",
|
|
129
|
+
alignItems: "center",
|
|
130
|
+
justifyContent: "center",
|
|
131
|
+
flexShrink: 0,
|
|
132
|
+
...getSizeStyles(theme, "medium", "action", (size) => ({
|
|
133
|
+
width: size,
|
|
134
|
+
height: size
|
|
135
|
+
}))
|
|
136
|
+
}),
|
|
137
|
+
/**
|
|
138
|
+
* groupWrapper: Estilos del contenedor del grupo.
|
|
139
|
+
*/
|
|
140
|
+
groupWrapper: ({ theme, ownerState }) => ({
|
|
141
|
+
display: "flex",
|
|
142
|
+
flexDirection: "column",
|
|
143
|
+
backgroundColor: ownerState?.selected ? theme.vars.palette.primary.opacity : "transparent",
|
|
144
|
+
borderBottom: `1px solid ${theme.vars.palette.border.secondary}`,
|
|
145
|
+
"&:last-child": {
|
|
146
|
+
borderBottom: "none"
|
|
147
|
+
}
|
|
148
|
+
}),
|
|
149
|
+
/**
|
|
150
|
+
* groupHeader: Estilos del header del grupo.
|
|
151
|
+
*/
|
|
152
|
+
groupHeader: ({ theme }) => ({
|
|
153
|
+
display: "flex",
|
|
154
|
+
alignItems: "center",
|
|
155
|
+
height: "100%",
|
|
156
|
+
gap: theme.vars.size.baseSpacings.sp1,
|
|
157
|
+
padding: theme.vars.size.baseSpacings["sp1-5"],
|
|
158
|
+
paddingLeft: theme.vars.size.baseSpacings.sp2,
|
|
159
|
+
// backgroundColor: theme.vars.palette.background.paper,
|
|
160
|
+
cursor: "pointer"
|
|
161
|
+
}),
|
|
162
|
+
/**
|
|
163
|
+
* groupCheckbox: Estilos del checkbox del grupo.
|
|
164
|
+
*/
|
|
165
|
+
groupCheckbox: () => ({}),
|
|
166
|
+
/**
|
|
167
|
+
* groupLabelTagWrapper: Estilos del contenedor del label del grupo.
|
|
168
|
+
*/
|
|
169
|
+
groupLabelCountWrapper: ({ theme }) => ({
|
|
170
|
+
display: "flex",
|
|
171
|
+
alignItems: "center",
|
|
172
|
+
justifyContent: "space-between",
|
|
173
|
+
gap: theme.vars.size.baseSpacings.sp1
|
|
174
|
+
}),
|
|
175
|
+
/**
|
|
176
|
+
* groupLabel: Estilos del label del grupo.
|
|
177
|
+
*/
|
|
178
|
+
groupLabel: ({ theme }) => ({
|
|
179
|
+
flex: 1,
|
|
180
|
+
// fontWeight: 600,
|
|
181
|
+
color: theme.vars.palette.text.primary
|
|
182
|
+
}),
|
|
183
|
+
/**
|
|
184
|
+
* chipCount: Estilos del contador del grupo.
|
|
185
|
+
*/
|
|
186
|
+
chipCount: ({ theme, ownerState }) => ({
|
|
187
|
+
"&&& ": {
|
|
188
|
+
borderRadius: theme.vars.size.borderRadius["r1-5"],
|
|
189
|
+
paddingLeft: theme.vars.size.baseSpacings["sp1"],
|
|
190
|
+
paddingRight: theme.vars.size.baseSpacings["sp1"],
|
|
191
|
+
backgroundColor: ownerState?.color ?? theme.vars.palette.background.surface,
|
|
192
|
+
color: ownerState?.color ? getContrastTextColor(ownerState?.color) : theme.vars.palette.text.secondary
|
|
193
|
+
}
|
|
194
|
+
}),
|
|
195
|
+
/**
|
|
196
|
+
* groupIcon: Estilos del icono del grupo.
|
|
197
|
+
*/
|
|
198
|
+
groupIcon: ({ theme }) => ({
|
|
199
|
+
display: "flex",
|
|
200
|
+
alignItems: "center",
|
|
201
|
+
justifyContent: "center",
|
|
202
|
+
flexShrink: 0,
|
|
203
|
+
...getSizeStyles(theme, "medium", "action", (size) => ({
|
|
204
|
+
width: size,
|
|
205
|
+
height: size
|
|
206
|
+
}))
|
|
207
|
+
}),
|
|
208
|
+
/**
|
|
209
|
+
* groupToggleButton: Estilos del botón para expandir/colapsar grupo.
|
|
210
|
+
*/
|
|
211
|
+
groupToggleButton: ({ theme, ownerState }) => ({
|
|
212
|
+
flexShrink: 0,
|
|
213
|
+
...getSizeStyles(theme, ownerState?.size || "medium", "action", (size) => ({
|
|
214
|
+
width: size,
|
|
215
|
+
height: size
|
|
216
|
+
}))
|
|
217
|
+
}),
|
|
218
|
+
/**
|
|
219
|
+
* groupItems: Estilos del contenedor de items del grupo.
|
|
220
|
+
*/
|
|
221
|
+
groupItems: () => ({
|
|
222
|
+
display: "flex",
|
|
223
|
+
flexDirection: "column",
|
|
224
|
+
overflow: "hidden"
|
|
225
|
+
}),
|
|
226
|
+
/**
|
|
227
|
+
* emptyMessage: Estilos del mensaje cuando no hay items.
|
|
228
|
+
*/
|
|
229
|
+
emptyMessageWrapper: () => ({
|
|
230
|
+
display: "flex",
|
|
231
|
+
flexDirection: "column",
|
|
232
|
+
alignItems: "center",
|
|
233
|
+
justifyContent: "center"
|
|
234
|
+
}),
|
|
235
|
+
/**
|
|
236
|
+
* loadingContainer: Estilos del contenedor de carga.
|
|
237
|
+
*/
|
|
238
|
+
loadingContainer: ({ theme }) => ({
|
|
239
|
+
display: "flex",
|
|
240
|
+
alignItems: "center",
|
|
241
|
+
justifyContent: "center",
|
|
242
|
+
padding: theme.vars.size.baseSpacings.sp3
|
|
243
|
+
})
|
|
244
|
+
};
|
|
245
|
+
export {
|
|
246
|
+
checkableListStyles as c
|
|
247
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const CHECKABLE_LIST_KEY_COMPONENT = "M4LCheckableList";
|
|
2
|
+
export declare const CHECKABLE_LIST_CLASSES: Record<"root" | "searchContainer" | "searchInput" | "selectAllContainer" | "selectAllCheckbox" | "listContainer" | "virtualizedList" | "itemWrapper" | "itemCheckbox" | "itemContentWrapper" | "itemLabel" | "itemDescription" | "itemIcon" | "groupWrapper" | "groupHeader" | "groupCheckbox" | "groupLabelCountWrapper" | "groupLabel" | "chipCount" | "groupIcon" | "groupToggleButton" | "groupItems" | "emptyMessageWrapper" | "loadingContainer", string>;
|
|
3
|
+
export declare const CHECKABLE_LIST_DEFAULT_ITEM_ROW_HEIGHT = 36;
|
|
4
|
+
export declare const CHECKABLE_LIST_DEFAULT_ITEM_ROW_HEIGHT_WITH_DESCRIPTION = 46;
|
|
5
|
+
export declare const CHECKABLE_LIST_DEFAULT_GROUP_ROW_HEIGHT = 36;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { g as getComponentClasses } from "../../utils/getComponentSlotRoot.js";
|
|
2
|
+
import { C as CheckableListSlots } from "./slots/slots.js";
|
|
3
|
+
const CHECKABLE_LIST_KEY_COMPONENT = "M4LCheckableList";
|
|
4
|
+
const CHECKABLE_LIST_CLASSES = getComponentClasses(
|
|
5
|
+
CHECKABLE_LIST_KEY_COMPONENT,
|
|
6
|
+
CheckableListSlots
|
|
7
|
+
);
|
|
8
|
+
const CHECKABLE_LIST_DEFAULT_ITEM_ROW_HEIGHT = 36;
|
|
9
|
+
const CHECKABLE_LIST_DEFAULT_ITEM_ROW_HEIGHT_WITH_DESCRIPTION = 46;
|
|
10
|
+
const CHECKABLE_LIST_DEFAULT_GROUP_ROW_HEIGHT = 36;
|
|
11
|
+
export {
|
|
12
|
+
CHECKABLE_LIST_CLASSES as C,
|
|
13
|
+
CHECKABLE_LIST_DEFAULT_ITEM_ROW_HEIGHT as a,
|
|
14
|
+
CHECKABLE_LIST_DEFAULT_GROUP_ROW_HEIGHT as b,
|
|
15
|
+
CHECKABLE_LIST_DEFAULT_ITEM_ROW_HEIGHT_WITH_DESCRIPTION as c,
|
|
16
|
+
CHECKABLE_LIST_KEY_COMPONENT as d
|
|
17
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const CHECKABLE_LIST_DICTIONARY_ID = "checkable_list";
|
|
2
|
+
/**
|
|
3
|
+
* getCheckableListComponentsDictionary: Devuelve un array con los ids de los componentes que
|
|
4
|
+
* componente CheckableList.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getCheckableListComponentsDictionary(): string[];
|
|
7
|
+
export declare const DICCTIONARY: {
|
|
8
|
+
readonly label_search_placeholder: "checkable_list.label_search_placeholder";
|
|
9
|
+
readonly label_no_results: "checkable_list.label_no_results";
|
|
10
|
+
readonly label_no_results_description: "checkable_list.label_no_results_description";
|
|
11
|
+
readonly label_group_title: "checkable_list.label_group_title";
|
|
12
|
+
readonly label_select_all: "checkable_list.label_select_all";
|
|
13
|
+
};
|
|
14
|
+
export type TypeDictionary = typeof DICCTIONARY;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const CHECKABLE_LIST_DICTIONARY_ID = "checkable_list";
|
|
2
|
+
function getCheckableListComponentsDictionary() {
|
|
3
|
+
return [CHECKABLE_LIST_DICTIONARY_ID];
|
|
4
|
+
}
|
|
5
|
+
const DICCTIONARY = {
|
|
6
|
+
label_search_placeholder: `${CHECKABLE_LIST_DICTIONARY_ID}.label_search_placeholder`,
|
|
7
|
+
label_no_results: `${CHECKABLE_LIST_DICTIONARY_ID}.label_no_results`,
|
|
8
|
+
label_no_results_description: `${CHECKABLE_LIST_DICTIONARY_ID}.label_no_results_description`,
|
|
9
|
+
label_select_all: `${CHECKABLE_LIST_DICTIONARY_ID}.label_select_all`
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
DICCTIONARY as D,
|
|
13
|
+
getCheckableListComponentsDictionary as g
|
|
14
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { useCheckableListState } from './useCheckableListState';
|
|
2
|
+
export { useCheckableListItems } from './useCheckableListItems';
|
|
3
|
+
export { useCheckableListSelection } from './useCheckableListSelection';
|
|
4
|
+
export { useCheckableListHandlers } from './useCheckableListHandlers';
|
|
5
|
+
export { useCheckableListVirtualization } from './useCheckableListVirtualization';
|
|
6
|
+
export { useCheckableListRender } from './useCheckableListRender';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CheckableListGroup, CheckableListItem } from '../types';
|
|
2
|
+
interface UseCheckableListHandlersProps {
|
|
3
|
+
value: (string | number)[];
|
|
4
|
+
onChange?: (selectedIds: (string | number)[]) => void;
|
|
5
|
+
multiple?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
normalizedItems: CheckableListItem[];
|
|
8
|
+
getGroupItems: (group: CheckableListGroup) => CheckableListItem[];
|
|
9
|
+
isGroupFullySelected: (group: CheckableListGroup) => boolean;
|
|
10
|
+
isItemSelected: (itemId: string | number) => boolean;
|
|
11
|
+
areAllItemsSelected: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Hook para manejar los event handlers del componente CheckableList
|
|
15
|
+
*/
|
|
16
|
+
export declare const useCheckableListHandlers: ({ value, onChange, multiple, disabled, normalizedItems, getGroupItems, isGroupFullySelected, isItemSelected, areAllItemsSelected, }: UseCheckableListHandlersProps) => {
|
|
17
|
+
handleItemToggle: (itemId: string | number) => void;
|
|
18
|
+
handleGroupToggle: (group: CheckableListGroup) => void;
|
|
19
|
+
handleSelectAllToggle: () => void;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
const useCheckableListHandlers = ({
|
|
3
|
+
value,
|
|
4
|
+
onChange,
|
|
5
|
+
multiple = true,
|
|
6
|
+
disabled = false,
|
|
7
|
+
normalizedItems,
|
|
8
|
+
getGroupItems,
|
|
9
|
+
isGroupFullySelected,
|
|
10
|
+
isItemSelected,
|
|
11
|
+
areAllItemsSelected
|
|
12
|
+
}) => {
|
|
13
|
+
const handleItemToggle = useCallback(
|
|
14
|
+
(itemId) => {
|
|
15
|
+
if (!onChange || disabled) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (multiple) {
|
|
19
|
+
const newValue = isItemSelected(itemId) ? value.filter((id) => id !== itemId) : [...value, itemId];
|
|
20
|
+
onChange(newValue);
|
|
21
|
+
} else {
|
|
22
|
+
onChange(isItemSelected(itemId) ? [] : [itemId]);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
[onChange, disabled, multiple, value, isItemSelected]
|
|
26
|
+
);
|
|
27
|
+
const handleGroupToggle = useCallback(
|
|
28
|
+
(group) => {
|
|
29
|
+
if (!onChange || disabled) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const groupItems = getGroupItems(group);
|
|
33
|
+
const allSelected = isGroupFullySelected(group);
|
|
34
|
+
if (allSelected) {
|
|
35
|
+
const newValue = value.filter(
|
|
36
|
+
(id) => !groupItems.some((item) => item.id === id)
|
|
37
|
+
);
|
|
38
|
+
onChange(newValue);
|
|
39
|
+
} else {
|
|
40
|
+
const itemIds = groupItems.map((item) => item.id);
|
|
41
|
+
const newValue = [.../* @__PURE__ */ new Set([...value, ...itemIds])];
|
|
42
|
+
onChange(newValue);
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
[onChange, disabled, value, getGroupItems, isGroupFullySelected]
|
|
46
|
+
);
|
|
47
|
+
const handleSelectAllToggle = useCallback(() => {
|
|
48
|
+
if (!onChange || disabled) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (areAllItemsSelected) {
|
|
52
|
+
onChange([]);
|
|
53
|
+
} else {
|
|
54
|
+
const allIds = normalizedItems.map((item) => item.id);
|
|
55
|
+
onChange(allIds);
|
|
56
|
+
}
|
|
57
|
+
}, [onChange, disabled, areAllItemsSelected, normalizedItems]);
|
|
58
|
+
return {
|
|
59
|
+
handleItemToggle,
|
|
60
|
+
handleGroupToggle,
|
|
61
|
+
handleSelectAllToggle
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
export {
|
|
65
|
+
useCheckableListHandlers as u
|
|
66
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CheckableListItem, CheckableListGroup, VirtualizedItem } from '../types';
|
|
2
|
+
interface UseCheckableListItemsProps {
|
|
3
|
+
items?: CheckableListItem[];
|
|
4
|
+
groups?: CheckableListGroup[];
|
|
5
|
+
searchQuery: string;
|
|
6
|
+
filterFn?: (item: CheckableListItem, query: string) => boolean;
|
|
7
|
+
expandedGroups: Set<string | number>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Hook para manejar la normalización, filtrado y construcción de items virtualizados
|
|
11
|
+
*/
|
|
12
|
+
export declare const useCheckableListItems: ({ items, groups, searchQuery, filterFn, expandedGroups, }: UseCheckableListItemsProps) => {
|
|
13
|
+
isGrouped: boolean;
|
|
14
|
+
normalizedItems: CheckableListItem[];
|
|
15
|
+
filteredItems: CheckableListItem[];
|
|
16
|
+
filteredGroups: CheckableListGroup[];
|
|
17
|
+
virtualizedItems: VirtualizedItem[];
|
|
18
|
+
};
|
|
19
|
+
export {};
|