@m4l/components 0.1.39 → 0.1.40
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/.git +1 -0
- package/package.json +4 -2
- package/.DS_Store +0 -0
- package/dist/assets/Logo/index.228dcb5a.js +0 -93
- package/dist/assets/Logo.d.ts +0 -7
- package/dist/commonjs.565e6834.js +0 -12
- package/dist/components/CommonActions/components/ActionCancel/index.9230c57b.js +0 -17
- package/dist/components/CommonActions/components/ActionCancel/index.d.ts +0 -3
- package/dist/components/CommonActions/components/ActionFormCancel/index.ab514bd9.js +0 -65
- package/dist/components/CommonActions/components/ActionFormCancel/index.d.ts +0 -2
- package/dist/components/CommonActions/components/ActionFormIntro/index.ca4d2674.js +0 -37
- package/dist/components/CommonActions/components/ActionFormIntro/index.d.ts +0 -3
- package/dist/components/CommonActions/components/ActionIntro/index.a0a341c7.js +0 -18
- package/dist/components/CommonActions/components/ActionIntro/index.d.ts +0 -3
- package/dist/components/CommonActions/components/Actions/index.d.ts +0 -3
- package/dist/components/CommonActions/components/Actions/index.d3e1f36e.js +0 -54
- package/dist/components/CommonActions/components/Actions/styles.d.ts +0 -2
- package/dist/components/CommonActions/components/Actions/types.d.ts +0 -4
- package/dist/components/CommonActions/dictionary.d.ts +0 -3
- package/dist/components/CommonActions/index.d.ts +0 -6
- package/dist/components/DataGrid/contexts/DataGridContext/index.d.ts +0 -5
- package/dist/components/DataGrid/contexts/DataGridContext/types.d.ts +0 -39
- package/dist/components/DataGrid/contexts/FilterContext/index.d.ts +0 -9
- package/dist/components/DataGrid/contexts/FilterContext/types.d.ts +0 -15
- package/dist/components/DataGrid/dictionary.d.ts +0 -3
- package/dist/components/DataGrid/formatters/columnBooleanFormatter/index.d.ts +0 -3
- package/dist/components/DataGrid/formatters/columnBooleanFormatter/types.d.ts +0 -7
- package/dist/components/DataGrid/formatters/columnDateFormatter/index.d.ts +0 -3
- package/dist/components/DataGrid/formatters/columnDateFormatter/types.d.ts +0 -8
- package/dist/components/DataGrid/formatters/columnNestedValueFormatter/index.d.ts +0 -3
- package/dist/components/DataGrid/formatters/columnNestedValueFormatter/index.f68ef4e1.js +0 -17
- package/dist/components/DataGrid/formatters/columnNestedValueFormatter/types.d.ts +0 -5
- package/dist/components/DataGrid/formatters/columnPointsFormatter/index.5e645334.js +0 -13
- package/dist/components/DataGrid/formatters/columnPointsFormatter/index.d.ts +0 -3
- package/dist/components/DataGrid/formatters/columnPointsFormatter/types.d.ts +0 -6
- package/dist/components/DataGrid/formatters/columnPriceFormatter/index.d.ts +0 -3
- package/dist/components/DataGrid/formatters/columnPriceFormatter/index.e612fda3.js +0 -13
- package/dist/components/DataGrid/formatters/columnPriceFormatter/types.d.ts +0 -5
- package/dist/components/DataGrid/formatters/columnUncertaintyFormatter/index.cae2057a.js +0 -13
- package/dist/components/DataGrid/formatters/columnUncertaintyFormatter/index.d.ts +0 -3
- package/dist/components/DataGrid/formatters/columnUncertaintyFormatter/types.d.ts +0 -7
- package/dist/components/DataGrid/formatters/index.d.ts +0 -7
- package/dist/components/DataGrid/hooks/useDataGrid.d.ts +0 -3
- package/dist/components/DataGrid/hooks/useFilters.d.ts +0 -1
- package/dist/components/DataGrid/index.67260455.js +0 -1782
- package/dist/components/DataGrid/index.d.ts +0 -3
- package/dist/components/DataGrid/styles.d.ts +0 -3
- package/dist/components/DataGrid/subcomponents/Actions/index.d.ts +0 -3
- package/dist/components/DataGrid/subcomponents/Actions/styles.d.ts +0 -2
- package/dist/components/DataGrid/subcomponents/Actions/subcomponents/Density/index.d.ts +0 -2
- package/dist/components/DataGrid/subcomponents/Actions/subcomponents/Density/styles.d.ts +0 -3
- package/dist/components/DataGrid/subcomponents/Actions/subcomponents/Filter/index.d.ts +0 -2
- package/dist/components/DataGrid/subcomponents/Actions/subcomponents/Filter/styles.d.ts +0 -2
- package/dist/components/DataGrid/subcomponents/Actions/subcomponents/RowsCount/index.d.ts +0 -2
- package/dist/components/DataGrid/subcomponents/Actions/subcomponents/RowsCount/styles.d.ts +0 -4
- package/dist/components/DataGrid/subcomponents/Actions/subcomponents/Settings/index.d.ts +0 -2
- package/dist/components/DataGrid/subcomponents/Actions/subcomponents/Settings/styles.d.ts +0 -2
- package/dist/components/DataGrid/subcomponents/Actions/subcomponents/Settings/subcomponents/ColumnsConfig/index.d.ts +0 -3
- package/dist/components/DataGrid/subcomponents/Actions/subcomponents/Settings/subcomponents/ColumnsConfig/styles.d.ts +0 -8
- package/dist/components/DataGrid/subcomponents/Actions/subcomponents/Settings/subcomponents/ColumnsConfig/subcomponents/FormatterColumn/index.d.ts +0 -4
- package/dist/components/DataGrid/subcomponents/Actions/subcomponents/Settings/subcomponents/ColumnsConfig/types.d.ts +0 -25
- package/dist/components/DataGrid/subcomponents/Actions/subcomponents/Settings/types.d.ts +0 -2
- package/dist/components/DataGrid/subcomponents/Actions/types.d.ts +0 -11
- package/dist/components/DataGrid/subcomponents/Table/hooks/getDragHeaderRenderer.d.ts +0 -3
- package/dist/components/DataGrid/subcomponents/Table/hooks/useFocusRef.d.ts +0 -5
- package/dist/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.d.ts +0 -8
- package/dist/components/DataGrid/subcomponents/Table/index.d.ts +0 -3
- package/dist/components/DataGrid/subcomponents/Table/styles.d.ts +0 -3
- package/dist/components/DataGrid/subcomponents/Table/subcomponents/ActionsColumn.d.ts +0 -4
- package/dist/components/DataGrid/subcomponents/Table/subcomponents/CheckboxFormatter.d.ts +0 -3
- package/dist/components/DataGrid/subcomponents/Table/subcomponents/CustomIcons.d.ts +0 -15
- package/dist/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.d.ts +0 -6
- package/dist/components/DataGrid/subcomponents/Table/subcomponents/SelectColumn.d.ts +0 -4
- package/dist/components/DataGrid/subcomponents/Table/subcomponents/SkeletonFormatter/index.d.ts +0 -2
- package/dist/components/DataGrid/subcomponents/Table/subcomponents/SkeletonFormatter/styles.d.ts +0 -2
- package/dist/components/DataGrid/subcomponents/editors/TextEditor/index.d.ts +0 -6
- package/dist/components/DataGrid/types.d.ts +0 -61
- package/dist/components/DataGrid/utils/getDataGridRowsFromSet.d.ts +0 -1
- package/dist/components/DraggableWindow/index.d.ts +0 -4
- package/dist/components/DraggableWindow/types.d.ts +0 -5
- package/dist/components/DynamicFilter/components/ApplyedFilters/components/ApplyedFilter/index.d.ts +0 -3
- package/dist/components/DynamicFilter/components/ApplyedFilters/components/ApplyedFilter/styles.d.ts +0 -6
- package/dist/components/DynamicFilter/components/ApplyedFilters/index.d.ts +0 -2
- package/dist/components/DynamicFilter/components/ApplyedFilters/styles.d.ts +0 -3
- package/dist/components/DynamicFilter/components/ClearFilters/index.d.ts +0 -2
- package/dist/components/DynamicFilter/components/ClearFilters/styles.d.ts +0 -3
- package/dist/components/DynamicFilter/components/FilterButton/index.d.ts +0 -2
- package/dist/components/DynamicFilter/components/FilterButton/styles.d.ts +0 -3
- package/dist/components/DynamicFilter/components/InputFilter/index.d.ts +0 -2
- package/dist/components/DynamicFilter/components/InputFilter/styles.d.ts +0 -3
- package/dist/components/DynamicFilter/components/PopupEditFilter/index.d.ts +0 -2
- package/dist/components/DynamicFilter/components/PopupEditFilter/styles.d.ts +0 -6
- package/dist/components/DynamicFilter/components/fieldstypes/BooleanFilter/index.d.ts +0 -4
- package/dist/components/DynamicFilter/components/fieldstypes/BooleanFilter/styles.d.ts +0 -3
- package/dist/components/DynamicFilter/components/fieldstypes/DateTimeFilter/index.d.ts +0 -5
- package/dist/components/DynamicFilter/components/fieldstypes/DateTimeFilter/styles.d.ts +0 -3
- package/dist/components/DynamicFilter/components/fieldstypes/NumberFilter/index.d.ts +0 -4
- package/dist/components/DynamicFilter/components/fieldstypes/NumberFilter/styles.d.ts +0 -3
- package/dist/components/DynamicFilter/components/fieldstypes/StringFilter/index.d.ts +0 -4
- package/dist/components/DynamicFilter/components/fieldstypes/StringFilter/styles.d.ts +0 -3
- package/dist/components/DynamicFilter/components/fieldstypes/factory.d.ts +0 -7
- package/dist/components/DynamicFilter/components/fieldstypes/validations.d.ts +0 -6
- package/dist/components/DynamicFilter/contexts/BaseContext/index.d.ts +0 -5
- package/dist/components/DynamicFilter/contexts/BaseContext/types.d.ts +0 -42
- package/dist/components/DynamicFilter/dictionary.d.ts +0 -3
- package/dist/components/DynamicFilter/hooks/useFilter.d.ts +0 -1
- package/dist/components/DynamicFilter/index.071aa795.js +0 -1658
- package/dist/components/DynamicFilter/index.d.ts +0 -3
- package/dist/components/DynamicFilter/styles.d.ts +0 -8
- package/dist/components/DynamicFilter/types.d.ts +0 -67
- package/dist/components/ErrorLabel/index.c8615f16.js +0 -20
- package/dist/components/ErrorLabel/index.d.ts +0 -4
- package/dist/components/ErrorLabel/styles.d.ts +0 -2
- package/dist/components/ErrorLabel/types.d.ts +0 -3
- package/dist/components/HelmetPage/index.d.ts +0 -6
- package/dist/components/HelmetPage/types.d.ts +0 -7
- package/dist/components/Icon/index.8d754623.js +0 -153
- package/dist/components/Icon/index.d.ts +0 -3
- package/dist/components/Icon/styles.d.ts +0 -4
- package/dist/components/Icon/types.d.ts +0 -11
- package/dist/components/Image/index.93d5f37f.js +0 -190
- package/dist/components/Image/index.d.ts +0 -4
- package/dist/components/Image/styles.d.ts +0 -3
- package/dist/components/Image/subcomponents/BasicIntersectComponent/index.d.ts +0 -3
- package/dist/components/Image/subcomponents/LazyLoadComponent/index.d.ts +0 -3
- package/dist/components/Image/subcomponents/Skeleton/index.d.ts +0 -3
- package/dist/components/Image/subcomponents/Skeleton/styles.d.ts +0 -2
- package/dist/components/Image/subcomponents/Skeleton/types.d.ts +0 -4
- package/dist/components/Image/types.d.ts +0 -34
- package/dist/components/Image/utils/isIntersectionObserverAvailable.d.ts +0 -1
- package/dist/components/LanguagePopover/index.cbc4b282.js +0 -144
- package/dist/components/LanguagePopover/index.d.ts +0 -2
- package/dist/components/LanguagePopover/styles.d.ts +0 -4
- package/dist/components/Loadable/index.117eaced.js +0 -14
- package/dist/components/Loadable/index.d.ts +0 -2
- package/dist/components/ModalDialog/index.a684827f.js +0 -123
- package/dist/components/NoItemSelected/dictionary.d.ts +0 -3
- package/dist/components/NoItemSelected/index.46d2f632.js +0 -85
- package/dist/components/NoItemSelected/index.d.ts +0 -2
- package/dist/components/NoItemSelected/styles.d.ts +0 -5
- package/dist/components/ObjectLogs/components/DetailDialog/index.d.ts +0 -3
- package/dist/components/ObjectLogs/components/DetailDialog/styles.d.ts +0 -3
- package/dist/components/ObjectLogs/components/DetailDialog/types.d.ts +0 -3
- package/dist/components/ObjectLogs/components/DetailFormatter/index.d.ts +0 -3
- package/dist/components/ObjectLogs/components/DetailFormatter/types.d.ts +0 -3
- package/dist/components/ObjectLogs/dictionary.d.ts +0 -3
- package/dist/components/ObjectLogs/index.4a859658.js +0 -305
- package/dist/components/ObjectLogs/index.d.ts +0 -3
- package/dist/components/ObjectLogs/styles.d.ts +0 -4
- package/dist/components/ObjectLogs/types.d.ts +0 -16
- package/dist/components/Page/index.4237c241.js +0 -27
- package/dist/components/PaperForm/components/Header.d.ts +0 -3
- package/dist/components/PaperForm/index.c5948756.js +0 -112
- package/dist/components/PaperForm/index.d.ts +0 -3
- package/dist/components/PaperForm/styles.d.ts +0 -7
- package/dist/components/PaperForm/types.d.ts +0 -7
- package/dist/components/Period/dictionary.d.ts +0 -6
- package/dist/components/Period/index.abe445bd.js +0 -256
- package/dist/components/Period/index.d.ts +0 -3
- package/dist/components/Period/styles.d.ts +0 -7
- package/dist/components/Period/types.d.ts +0 -33
- package/dist/components/PropertyValue/index.d.ts +0 -3
- package/dist/components/PropertyValue/index.dfcfe1ba.js +0 -147
- package/dist/components/PropertyValue/skeleton.d.ts +0 -2
- package/dist/components/PropertyValue/styles.d.ts +0 -6
- package/dist/components/PropertyValue/types.d.ts +0 -17
- package/dist/components/Resizeable/index.c96c0f09.js +0 -96
- package/dist/components/ResizeableWindow/index.d.ts +0 -3
- package/dist/components/ResizeableWindow/styles.d.ts +0 -5
- package/dist/components/ResizeableWindow/types.d.ts +0 -11
- package/dist/components/ScrollBar/index.39eeb2de.js +0 -54
- package/dist/components/ScrollBar/index.d.ts +0 -6
- package/dist/components/ScrollToTop/index.d.ts +0 -1
- package/dist/components/ScrollToTop/index.e06f98f6.js +0 -12
- package/dist/components/SplitLayout/index.5a8355d8.js +0 -133
- package/dist/components/SplitLayout/index.d.ts +0 -3
- package/dist/components/SplitLayout/styles.d.ts +0 -4
- package/dist/components/SplitLayout/types.d.ts +0 -9
- package/dist/components/WrapperComponent/index.5e872594.js +0 -18
- package/dist/components/WrapperComponent/index.d.ts +0 -3
- package/dist/components/WrapperComponent/types.d.ts +0 -5
- package/dist/components/animate/IconButtonAnimate/index.d.ts +0 -3
- package/dist/components/animate/IconButtonAnimate/types.d.ts +0 -5
- package/dist/components/animate/LoadingScreen/index.1d0c4307.js +0 -103
- package/dist/components/animate/LoadingScreen/index.d.ts +0 -4
- package/dist/components/animate/LoadingScreen/styles.d.ts +0 -3
- package/dist/components/animate/LoadingScreen/types.d.ts +0 -6
- package/dist/components/animate/MotionContainer/index.8d9f9d80.js +0 -33
- package/dist/components/animate/MotionContainer/index.d.ts +0 -10
- package/dist/components/animate/MotionLazyContainer/index.572dd012.js +0 -15
- package/dist/components/animate/MotionLazyContainer/index.d.ts +0 -6
- package/dist/components/animate/PropagateLoader/index.be5b02c3.js +0 -30
- package/dist/components/animate/PropagateLoader/index.d.ts +0 -2
- package/dist/components/animate/PropagateLoader/syles.d.ts +0 -2
- package/dist/components/animate/features.0fbf41e1.js +0 -5
- package/dist/components/animate/features.d.ts +0 -2
- package/dist/components/animate/index.d.ts +0 -6
- package/dist/components/animate/type.d.ts +0 -26
- package/dist/components/animate/variants/bounce.784aaaaa.js +0 -99
- package/dist/components/animate/variants/bounce.d.ts +0 -136
- package/dist/components/animate/variants/container.11f82b76.js +0 -22
- package/dist/components/animate/variants/container.d.ts +0 -19
- package/dist/components/animate/variants/fade.b561c0fc.js +0 -63
- package/dist/components/animate/variants/fade.d.ts +0 -217
- package/dist/components/animate/variants/index.7a912140.js +0 -1
- package/dist/components/animate/variants/index.d.ts +0 -4
- package/dist/components/animate/variants/transition.bd46b9ce.js +0 -20
- package/dist/components/animate/variants/transition.d.ts +0 -13
- package/dist/components/areas/components/Area/index.d.ts +0 -6
- package/dist/components/areas/components/Area/styles.d.ts +0 -2
- package/dist/components/areas/components/Area/types.d.ts +0 -92
- package/dist/components/areas/components/AreasAdmin/index.6794b22f.js +0 -112
- package/dist/components/areas/components/AreasAdmin/index.d.ts +0 -2
- package/dist/components/areas/components/AreasAdmin/styles.d.ts +0 -2
- package/dist/components/areas/components/AreasAdmin/subcomponents/AreaChip/index.d.ts +0 -6
- package/dist/components/areas/components/AreasAdmin/subcomponents/AreaChip/styles.d.ts +0 -3
- package/dist/components/areas/components/AreasAdmin/subcomponents/AreaChip/types.d.ts +0 -5
- package/dist/components/areas/components/AreasContainer/index.a2f8899b.js +0 -43
- package/dist/components/areas/components/AreasContainer/index.d.ts +0 -2
- package/dist/components/areas/components/AreasContainer/styles.d.ts +0 -2
- package/dist/components/areas/components/GridLayout/index.b9c1e846.js +0 -92
- package/dist/components/areas/components/GridLayout/index.d.ts +0 -2
- package/dist/components/areas/components/GridLayout/styles.d.ts +0 -2
- package/dist/components/areas/components/Window/contexts/WindowContext/index.d.ts +0 -5
- package/dist/components/areas/components/Window/contexts/WindowContext/types.d.ts +0 -13
- package/dist/components/areas/components/Window/hooks/useWindow/index.d.ts +0 -1
- package/dist/components/areas/components/Window/index.252fbf4e.js +0 -646
- package/dist/components/areas/components/Window/index.d.ts +0 -4
- package/dist/components/areas/components/Window/styles.d.ts +0 -3
- package/dist/components/areas/components/Window/subcomponents/Component/index.d.ts +0 -7
- package/dist/components/areas/components/Window/subcomponents/Header/index.d.ts +0 -2
- package/dist/components/areas/components/Window/subcomponents/Header/skeleton.d.ts +0 -2
- package/dist/components/areas/components/Window/subcomponents/Header/styles.d.ts +0 -9
- package/dist/components/areas/components/Window/subcomponents/MicroFrontend/index.d.ts +0 -4
- package/dist/components/areas/components/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/index.d.ts +0 -15
- package/dist/components/areas/components/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/index.d.ts +0 -3
- package/dist/components/areas/components/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/styles.d.ts +0 -2
- package/dist/components/areas/components/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/index.d.ts +0 -3
- package/dist/components/areas/components/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/styles.d.ts +0 -2
- package/dist/components/areas/components/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/types.d.ts +0 -2
- package/dist/components/areas/components/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/types.d.ts +0 -6
- package/dist/components/areas/components/WindowPopUp/index.214cf099.js +0 -120
- package/dist/components/areas/components/WindowPopUp/index.d.ts +0 -3
- package/dist/components/areas/components/WindowPopUp/styles.d.ts +0 -2
- package/dist/components/areas/components/index.7d6cd649.js +0 -67
- package/dist/components/areas/components/index.d.ts +0 -4
- package/dist/components/areas/contexts/AreaContext/index.4894cf23.js +0 -286
- package/dist/components/areas/contexts/AreaContext/index.d.ts +0 -6
- package/dist/components/areas/contexts/AreaContext/types.d.ts +0 -28
- package/dist/components/areas/contexts/AreasContext/index.cd8e4bee.js +0 -158
- package/dist/components/areas/contexts/AreasContext/index.d.ts +0 -5
- package/dist/components/areas/contexts/AreasContext/types.d.ts +0 -18
- package/dist/components/areas/contexts/DynamicMFParmsContext/index.668bc2e2.js +0 -17
- package/dist/components/areas/contexts/DynamicMFParmsContext/index.d.ts +0 -5
- package/dist/components/areas/contexts/DynamicMFParmsContext/types.d.ts +0 -19
- package/dist/components/areas/contexts/index.d.ts +0 -2
- package/dist/components/areas/contexts/index.f9196fb2.js +0 -1
- package/dist/components/areas/dictionary.d.ts +0 -14
- package/dist/components/areas/hooks/useArea/index.9b85ce24.js +0 -19
- package/dist/components/areas/hooks/useArea/index.d.ts +0 -1
- package/dist/components/areas/hooks/useAreas/index.d.ts +0 -2
- package/dist/components/areas/hooks/useDynamicMFParameters/index.d.ts +0 -1
- package/dist/components/areas/hooks/useDynamicMFParameters/index.e6a44ae3.js +0 -11
- package/dist/components/areas/index.d.ts +0 -2
- package/dist/components/areas/index.d1bf612c.js +0 -16
- package/dist/components/formatters/BooleanFormatter/index.3a9b16c8.js +0 -44
- package/dist/components/formatters/BooleanFormatter/index.d.ts +0 -3
- package/dist/components/formatters/BooleanFormatter/types.d.ts +0 -7
- package/dist/components/formatters/DateFormatter/index.80522f69.js +0 -49
- package/dist/components/formatters/DateFormatter/index.d.ts +0 -3
- package/dist/components/formatters/DateFormatter/types.d.ts +0 -9
- package/dist/components/formatters/PointsFormatter/index.80a4e414.js +0 -32
- package/dist/components/formatters/PointsFormatter/index.d.ts +0 -4
- package/dist/components/formatters/PointsFormatter/types.d.ts +0 -8
- package/dist/components/formatters/PriceFormatter/index.83cbe7be.js +0 -43
- package/dist/components/formatters/PriceFormatter/index.d.ts +0 -4
- package/dist/components/formatters/PriceFormatter/types.d.ts +0 -6
- package/dist/components/formatters/UncertaintyFormatter/index.08e1b79f.js +0 -34
- package/dist/components/formatters/UncertaintyFormatter/index.d.ts +0 -4
- package/dist/components/formatters/UncertaintyFormatter/types.d.ts +0 -15
- package/dist/components/formatters/dicctionary.d.ts +0 -3
- package/dist/components/formatters/index.0b5f95d0.js +0 -21
- package/dist/components/formatters/index.d.ts +0 -6
- package/dist/components/formatters/types.d.ts +0 -2
- package/dist/components/hook-form/RHFAutocomplete/dictionary.d.ts +0 -3
- package/dist/components/hook-form/RHFAutocomplete/index.d.ts +0 -3
- package/dist/components/hook-form/RHFAutocomplete/index.de93fe01.js +0 -279
- package/dist/components/hook-form/RHFAutocomplete/styles.d.ts +0 -2
- package/dist/components/hook-form/RHFAutocomplete/subcomponents/RenderOption/index.d.ts +0 -3
- package/dist/components/hook-form/RHFAutocomplete/subcomponents/RenderOption/styles.d.ts +0 -2
- package/dist/components/hook-form/RHFAutocomplete/subcomponents/Skeleton/index.d.ts +0 -3
- package/dist/components/hook-form/RHFAutocomplete/subcomponents/Skeleton/styles.d.ts +0 -3
- package/dist/components/hook-form/RHFAutocomplete/subcomponents/Skeleton/types.d.ts +0 -4
- package/dist/components/hook-form/RHFAutocomplete/types.d.ts +0 -19
- package/dist/components/hook-form/RHFAutocompleteAsync/dictionary.d.ts +0 -3
- package/dist/components/hook-form/RHFAutocompleteAsync/index.ca696cce.js +0 -87
- package/dist/components/hook-form/RHFAutocompleteAsync/index.d.ts +0 -3
- package/dist/components/hook-form/RHFAutocompleteAsync/types.d.ts +0 -9
- package/dist/components/hook-form/RHFCheckbox/index.6dcec9e2.js +0 -68
- package/dist/components/hook-form/RHFCheckbox/index.d.ts +0 -4
- package/dist/components/hook-form/RHFCheckbox/subcomponents/Skeleton/index.d.ts +0 -2
- package/dist/components/hook-form/RHFCheckbox/subcomponents/Skeleton/styles.d.ts +0 -2
- package/dist/components/hook-form/RHFCheckbox/types.d.ts +0 -9
- package/dist/components/hook-form/RHFDateTime/index.7f1cbd85.js +0 -106
- package/dist/components/hook-form/RHFDateTime/index.d.ts +0 -4
- package/dist/components/hook-form/RHFDateTime/subcomponents/Skeleton/index.d.ts +0 -3
- package/dist/components/hook-form/RHFDateTime/subcomponents/Skeleton/styles.d.ts +0 -2
- package/dist/components/hook-form/RHFDateTime/subcomponents/Skeleton/types.d.ts +0 -2
- package/dist/components/hook-form/RHFDateTime/types.d.ts +0 -6
- package/dist/components/hook-form/RHFMultiCheckbox/index.2680b3b6.js +0 -34
- package/dist/components/hook-form/RHFMultiCheckbox/index.d.ts +0 -3
- package/dist/components/hook-form/RHFMultiCheckbox/types.d.ts +0 -10
- package/dist/components/hook-form/RHFPeriod/index.3772295b.js +0 -55
- package/dist/components/hook-form/RHFPeriod/index.d.ts +0 -3
- package/dist/components/hook-form/RHFPeriod/styles.d.ts +0 -2
- package/dist/components/hook-form/RHFPeriod/types.d.ts +0 -5
- package/dist/components/hook-form/RHFRadioGroup/index.b3335e13.js +0 -43
- package/dist/components/hook-form/RHFRadioGroup.d.ts +0 -9
- package/dist/components/hook-form/RHFSelect/index.b6ca8bb2.js +0 -36
- package/dist/components/hook-form/RHFSelect.d.ts +0 -8
- package/dist/components/hook-form/RHFTextField/index.b17d68f4.js +0 -146
- package/dist/components/hook-form/RHFTextField/index.d.ts +0 -3
- package/dist/components/hook-form/RHFTextField/subcomponents/Skeleton/index.d.ts +0 -3
- package/dist/components/hook-form/RHFTextField/subcomponents/Skeleton/styles.d.ts +0 -2
- package/dist/components/hook-form/RHFTextField/subcomponents/Skeleton/types.d.ts +0 -2
- package/dist/components/hook-form/RHFTextField/types.d.ts +0 -6
- package/dist/components/hook-form/RHFTextFieldPassword/index.d.ts +0 -3
- package/dist/components/hook-form/RHFTextFieldPassword/types.d.ts +0 -4
- package/dist/components/hook-form/RHFUpload/RHFUploadImage/index.d.ts +0 -3
- package/dist/components/hook-form/RHFUpload/RHFUploadImage/styles.d.ts +0 -2
- package/dist/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/index.d.ts +0 -3
- package/dist/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/styles.d.ts +0 -12
- package/dist/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/subcomponents/Skeleton/index.d.ts +0 -2
- package/dist/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/subcomponents/Skeleton/styles.d.ts +0 -2
- package/dist/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/types.d.ts +0 -11
- package/dist/components/hook-form/RHFUpload/RHFUploadImage/types.d.ts +0 -14
- package/dist/components/hook-form/RHFUpload/index.d.ts +0 -1
- package/dist/components/hook-form/RHFUpload/index.d5cc7c13.js +0 -285
- package/dist/components/hook-form/RHFUpload/types.d.ts +0 -4
- package/dist/components/hook-form/index.d.ts +0 -14
- package/dist/components/index.d.ts +0 -40
- package/dist/components/modal/ModalDialog/dictionary.d.ts +0 -3
- package/dist/components/modal/ModalDialog/index.d.ts +0 -2
- package/dist/components/modal/ModalDialog/styles.d.ts +0 -9
- package/dist/components/modal/ModalDialog/types.d.ts +0 -6
- package/dist/components/modal/WindowBase/index.d.ts +0 -3
- package/dist/components/modal/WindowBase/styles.d.ts +0 -2
- package/dist/components/modal/WindowBase/subcomponents/Header/index.d.ts +0 -3
- package/dist/components/modal/WindowBase/subcomponents/Header/styles.d.ts +0 -6
- package/dist/components/modal/WindowBase/subcomponents/Header/types.d.ts +0 -2
- package/dist/components/modal/WindowBase/types.d.ts +0 -9
- package/dist/components/modal/WindowBase.04439b8e.js +0 -120
- package/dist/components/modal/WindowConfirm/index.d.ts +0 -3
- package/dist/components/modal/WindowConfirm/subcomponents/MessageIlustration/index.d.ts +0 -3
- package/dist/components/modal/WindowConfirm/subcomponents/MessageIlustration/styles.d.ts +0 -6
- package/dist/components/modal/WindowConfirm/subcomponents/MessageIlustration/types.d.ts +0 -8
- package/dist/components/modal/WindowConfirm/types.d.ts +0 -10
- package/dist/components/modal/WindowConfirm.0b8a6818.js +0 -115
- package/dist/components/modal/index.8387e90e.js +0 -18
- package/dist/components/modal/index.d.ts +0 -4
- package/dist/components/mui_extended/Accordion/components/AccordionLabel.d.ts +0 -3
- package/dist/components/mui_extended/Accordion/index.a541c71c.js +0 -107
- package/dist/components/mui_extended/Accordion/index.d.ts +0 -3
- package/dist/components/mui_extended/Accordion/styles.d.ts +0 -4
- package/dist/components/mui_extended/Accordion/types.d.ts +0 -14
- package/dist/components/mui_extended/Avatar/index.d.ts +0 -4
- package/dist/components/mui_extended/Avatar/index.fe06afd7.js +0 -51
- package/dist/components/mui_extended/Avatar/subcomponents/SkeletonAvatar/index.d.ts +0 -2
- package/dist/components/mui_extended/Avatar/types.d.ts +0 -6
- package/dist/components/mui_extended/BoxIcon/index.d.ts +0 -3
- package/dist/components/mui_extended/BoxIcon/index.e638ecc8.js +0 -22
- package/dist/components/mui_extended/BoxIcon/types.d.ts +0 -4
- package/dist/components/mui_extended/Breadcrumbs/components/LinkItem/index.d.ts +0 -3
- package/dist/components/mui_extended/Breadcrumbs/components/LinkItem/types.d.ts +0 -4
- package/dist/components/mui_extended/Breadcrumbs/index.5e37d903.js +0 -94
- package/dist/components/mui_extended/Breadcrumbs/index.d.ts +0 -4
- package/dist/components/mui_extended/Breadcrumbs/types.d.ts +0 -12
- package/dist/components/mui_extended/Button/index.86a155a2.js +0 -101
- package/dist/components/mui_extended/Button/index.d.ts +0 -3
- package/dist/components/mui_extended/Button/types.d.ts +0 -2
- package/dist/components/mui_extended/CircularProgress/index.ad569afd.js +0 -10
- package/dist/components/mui_extended/CircularProgress/index.d.ts +0 -3
- package/dist/components/mui_extended/IconButton/index.82f16572.js +0 -63
- package/dist/components/mui_extended/IconButton/index.d.ts +0 -4
- package/dist/components/mui_extended/IconButton/subcomponents/SkeletonIconButton/index.d.ts +0 -2
- package/dist/components/mui_extended/IconButton/types.d.ts +0 -5
- package/dist/components/mui_extended/ImageButton/index.d.ts +0 -3
- package/dist/components/mui_extended/ImageButton/types.d.ts +0 -7
- package/dist/components/mui_extended/LinearProgress/index.c92b9ba9.js +0 -13
- package/dist/components/mui_extended/LinearProgress/index.d.ts +0 -3
- package/dist/components/mui_extended/LinkWithRoute/index.16436ab8.js +0 -30
- package/dist/components/mui_extended/LinkWithRoute/index.d.ts +0 -3
- package/dist/components/mui_extended/LinkWithRoute/types.d.ts +0 -7
- package/dist/components/mui_extended/LoadingButton/index.d.ts +0 -3
- package/dist/components/mui_extended/LoadingButton/subcomponents/Skeleton/index.d.ts +0 -2
- package/dist/components/mui_extended/LoadingButton/subcomponents/Skeleton/styles.d.ts +0 -2
- package/dist/components/mui_extended/LoadingButton/types.d.ts +0 -5
- package/dist/components/mui_extended/MenuActions/index.d.ts +0 -4
- package/dist/components/mui_extended/MenuActions/index.ee17bddd.js +0 -112
- package/dist/components/mui_extended/MenuActions/styles.d.ts +0 -30
- package/dist/components/mui_extended/MenuActions/types.d.ts +0 -28
- package/dist/components/mui_extended/Pager/components/PagerActions/index.d.ts +0 -3
- package/dist/components/mui_extended/Pager/components/PagerActions/styles.d.ts +0 -2
- package/dist/components/mui_extended/Pager/components/PagerActions/types.d.ts +0 -7
- package/dist/components/mui_extended/Pager/dicctionary.d.ts +0 -3
- package/dist/components/mui_extended/Pager/index.74d3f5fc.js +0 -206
- package/dist/components/mui_extended/Pager/index.d.ts +0 -4
- package/dist/components/mui_extended/Pager/styles.d.ts +0 -6
- package/dist/components/mui_extended/Pager/types.d.ts +0 -13
- package/dist/components/mui_extended/Popover/index.53c77d23.js +0 -137
- package/dist/components/mui_extended/Popover/index.d.ts +0 -4
- package/dist/components/mui_extended/Popover/types.d.ts +0 -9
- package/dist/components/mui_extended/Tab/index.d.ts +0 -3
- package/dist/components/mui_extended/Tab/index.e0653a0a.js +0 -32
- package/dist/components/mui_extended/Tab/styles.d.ts +0 -2
- package/dist/components/mui_extended/Tab/types.d.ts +0 -5
- package/dist/components/mui_extended/Typography/index.d.ts +0 -3
- package/dist/components/mui_extended/Typography/index.e5494696.js +0 -35
- package/dist/components/mui_extended/Typography/subcomponents/index.d.ts +0 -3
- package/dist/components/mui_extended/Typography/subcomponents/types.d.ts +0 -2
- package/dist/components/mui_extended/Typography/types.d.ts +0 -7
- package/dist/components/mui_extended/index.85dfadf1.js +0 -16
- package/dist/components/mui_extended/index.d.ts +0 -20
- package/dist/contexts/ModalContext/index.b90eec94.js +0 -36
- package/dist/contexts/ModalContext/index.d.ts +0 -5
- package/dist/contexts/ModalContext/types.d.ts +0 -24
- package/dist/contexts/RHFormContext/index.d.ts +0 -3
- package/dist/contexts/RHFormContext/index.d88e6e27.js +0 -63
- package/dist/contexts/RHFormContext/styles.d.ts +0 -2
- package/dist/contexts/RHFormContext/types.d.ts +0 -11
- package/dist/contexts/index.d.ts +0 -5
- package/dist/hooks/index.d.ts +0 -3
- package/dist/hooks/useFormAddEdit/index.d.ts +0 -6
- package/dist/hooks/useFormAddEdit/index.d4845f1a.js +0 -44
- package/dist/hooks/useFormAddEdit/types.d.ts +0 -8
- package/dist/hooks/useModal/index.d.ts +0 -2
- package/dist/hooks/useModal/index.d14edee3.js +0 -11
- package/dist/index.d.ts +0 -4
- package/dist/index.js +0 -268
- package/dist/node_modules.416f1da3.js +0 -125
- package/dist/package.json +0 -50
- package/dist/react-data-grid.d46d625e.js +0 -2658
- package/dist/react-draggable.84d6b038.js +0 -961
- package/dist/react-json-view.57125fcf.js +0 -2766
- package/dist/react-resizable.1d00271d.js +0 -544
- package/dist/react-splitter-layout.8b1655c8.js +0 -167
- package/dist/style.css +0 -65
- package/dist/utils/index.899eb67b.js +0 -581
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/types.d.ts +0 -1
- package/dist/vite-env.d.ts +0 -3
|
@@ -1,1782 +0,0 @@
|
|
|
1
|
-
import { styled, alpha } from "@mui/material/styles";
|
|
2
|
-
import { forwardRef, createContext, useState, useMemo, useEffect, useCallback, useContext, useRef, useLayoutEffect, useImperativeHandle } from "react";
|
|
3
|
-
import { S as SELECT_COLUMN_KEY, u as useRowSelection, a as SelectCellFormatter, H as HeaderRenderer, D as DataGrid$1 } from "../../react-data-grid.d46d625e.js";
|
|
4
|
-
import { useDrag, useDrop, DndProvider } from "react-dnd";
|
|
5
|
-
import { HTML5Backend } from "react-dnd-html5-backend";
|
|
6
|
-
import { SvgIcon, Checkbox, InputBase, Skeleton } from "@mui/material";
|
|
7
|
-
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
8
|
-
import { voidFunction, useModuleDictionary, useModuleSkeleton, getPropertyByString, useEnvironment } from "@m4l/core";
|
|
9
|
-
import { M as MenuActions } from "../mui_extended/MenuActions/index.ee17bddd.js";
|
|
10
|
-
import { P as Pager, g as getPagerComponentsDictionary, d as defaultPagerDictionary } from "../mui_extended/Pager/index.74d3f5fc.js";
|
|
11
|
-
import { I as IconButton } from "../mui_extended/IconButton/index.82f16572.js";
|
|
12
|
-
import { u as useModal } from "../../hooks/useModal/index.d14edee3.js";
|
|
13
|
-
import { A as ActionCancel } from "../CommonActions/components/ActionCancel/index.9230c57b.js";
|
|
14
|
-
import { A as ActionIntro } from "../CommonActions/components/ActionIntro/index.a0a341c7.js";
|
|
15
|
-
import "../../react-draggable.84d6b038.js";
|
|
16
|
-
import { g as getModalDialogComponentsDictionary, d as defaultModalDialogDictionary } from "../ModalDialog/index.a684827f.js";
|
|
17
|
-
import "../Resizeable/index.c96c0f09.js";
|
|
18
|
-
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
19
|
-
import "../areas/contexts/DynamicMFParmsContext/index.668bc2e2.js";
|
|
20
|
-
import { A as Actions$1 } from "../CommonActions/components/Actions/index.d3e1f36e.js";
|
|
21
|
-
import "react-hook-form";
|
|
22
|
-
import "@mui/material/Button";
|
|
23
|
-
import "@mui/lab";
|
|
24
|
-
import "../modal/WindowConfirm.0b8a6818.js";
|
|
25
|
-
import "../Icon/index.8d754623.js";
|
|
26
|
-
import { W as WindowBase } from "../modal/WindowBase.04439b8e.js";
|
|
27
|
-
import { B as BooleanFormatter } from "../formatters/BooleanFormatter/index.3a9b16c8.js";
|
|
28
|
-
import { D as DateFormatter } from "../formatters/DateFormatter/index.80522f69.js";
|
|
29
|
-
const WrapperGrid = styled("div")(() => ({
|
|
30
|
-
display: "flex",
|
|
31
|
-
flexDirection: "column",
|
|
32
|
-
position: "absolute",
|
|
33
|
-
padding: "0px",
|
|
34
|
-
inset: "0px",
|
|
35
|
-
overflow: "hidden"
|
|
36
|
-
}));
|
|
37
|
-
const OriginalDataGridWrapperStyled = styled("div")(({
|
|
38
|
-
theme
|
|
39
|
-
}) => ({
|
|
40
|
-
position: "absolute",
|
|
41
|
-
bottom: "0px",
|
|
42
|
-
top: "0px",
|
|
43
|
-
left: "0px",
|
|
44
|
-
right: "0px",
|
|
45
|
-
"& .rdg ": {
|
|
46
|
-
userSelect: "initial",
|
|
47
|
-
height: "100%",
|
|
48
|
-
contentVisibility: "unset",
|
|
49
|
-
overflow: "scroll",
|
|
50
|
-
borderRadius: "5px",
|
|
51
|
-
"--rdg-grid-inline-size": "0px",
|
|
52
|
-
"--rdg-header-background-color": theme.palette.grid?.sectionHeader,
|
|
53
|
-
"--rdg-row-selected-background-color": theme.palette.mode === "light" ? theme.palette.primary.LightSelected : theme.palette.primary.DarkSelected,
|
|
54
|
-
"--rdg-row-hover-background-color": theme.palette.grid?.rowHover,
|
|
55
|
-
"--rdg-background-color": theme.palette.background.default,
|
|
56
|
-
"--rdg-selection-color": theme.palette.primary.main,
|
|
57
|
-
"--row-selected-hover-background-color": theme.palette.mode === "light" ? theme.palette.primary.LightSelectedHover : theme.palette.primary.DarkSelectedHover,
|
|
58
|
-
"--rdg-checkbox-color": theme.palette.primary.main,
|
|
59
|
-
"--rdg-checkbox-focus-color": alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity),
|
|
60
|
-
"--rdg-border-color": theme.palette.divider
|
|
61
|
-
},
|
|
62
|
-
"& .rdg::-webkit-scrollbar": {
|
|
63
|
-
width: "6px",
|
|
64
|
-
height: "6px",
|
|
65
|
-
borderRadius: "3px",
|
|
66
|
-
backgroundColor: "transparent"
|
|
67
|
-
},
|
|
68
|
-
"& .rdg::-webkit-scrollbar-track": {
|
|
69
|
-
backgroundColor: "transparent",
|
|
70
|
-
border: "0px solid transparent"
|
|
71
|
-
},
|
|
72
|
-
"& .rdg::-webkit-scrollbar-corner": {
|
|
73
|
-
backgroundColor: "transparent"
|
|
74
|
-
},
|
|
75
|
-
"& ::-webkit-scrollbar-thumb": {
|
|
76
|
-
borderRadius: "10px",
|
|
77
|
-
backgroundColor: theme.palette.divider,
|
|
78
|
-
border: "0px solid transparent"
|
|
79
|
-
},
|
|
80
|
-
'& [role="columnheader"]': {
|
|
81
|
-
justifyContent: "center",
|
|
82
|
-
alignItems: "center"
|
|
83
|
-
},
|
|
84
|
-
"& .rdg-cell": {
|
|
85
|
-
fontFamily: theme.typography.body2.fontFamily,
|
|
86
|
-
fontWeight: theme.typography.body2.fontWeight,
|
|
87
|
-
fontSize: theme.typography.body2.fontSize,
|
|
88
|
-
color: theme.palette.text.secondary,
|
|
89
|
-
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
90
|
-
borderRight: `0px solid transparent`,
|
|
91
|
-
position: "relative",
|
|
92
|
-
"&.rdg-cell-frozen": {
|
|
93
|
-
position: "sticky"
|
|
94
|
-
},
|
|
95
|
-
"&:after": {
|
|
96
|
-
content: `""`,
|
|
97
|
-
borderRight: `1px solid ${theme.palette.divider}`,
|
|
98
|
-
position: "absolute",
|
|
99
|
-
right: "0px",
|
|
100
|
-
top: "25%",
|
|
101
|
-
bottom: "25%"
|
|
102
|
-
},
|
|
103
|
-
"& .m4l_icon": {
|
|
104
|
-
height: "100%"
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
"& .rdg-cell.rdg-cell-align-left": {
|
|
108
|
-
textAlign: "left"
|
|
109
|
-
},
|
|
110
|
-
"& .rdg-cell.rdg-cell-align-center": {
|
|
111
|
-
textAlign: "center"
|
|
112
|
-
},
|
|
113
|
-
"& .rdg-cell.rdg-cell-align-right": {
|
|
114
|
-
textAlign: "right"
|
|
115
|
-
},
|
|
116
|
-
"& .rdg-row .rdg-cell-frozen-last:after": {
|
|
117
|
-
borderRight: `0px solid transparent`,
|
|
118
|
-
boxShadow: "none"
|
|
119
|
-
},
|
|
120
|
-
"& .rdg-row :last-child:after": {
|
|
121
|
-
borderRight: `0px solid transparent`
|
|
122
|
-
},
|
|
123
|
-
"& .rdg-header-row .rdg-cell": {
|
|
124
|
-
fontFamily: theme.typography.subtitle2.fontFamily,
|
|
125
|
-
fontWeight: theme.typography.subtitle2.fontWeight,
|
|
126
|
-
fontSize: theme.typography.subtitle2.fontSize,
|
|
127
|
-
color: theme.palette.text.primary,
|
|
128
|
-
borderRight: `0px solid transparent`,
|
|
129
|
-
boxShadow: "none",
|
|
130
|
-
"&.rdg-cell-frozen-last": {
|
|
131
|
-
"&:after": {
|
|
132
|
-
borderRight: `0px solid transparent`
|
|
133
|
-
},
|
|
134
|
-
boxShadow: "var(--rdg-frozen-cell-box-shadow)"
|
|
135
|
-
},
|
|
136
|
-
"& .rdg-sort-arrow": {
|
|
137
|
-
width: theme.spacing(1),
|
|
138
|
-
margin: `0 ${theme.spacing(0.5)}`
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
"& .rdg-header-row :last-child.rdg-cell": {
|
|
142
|
-
borderTopRightRadius: "5px",
|
|
143
|
-
"&:after": {
|
|
144
|
-
borderRight: `0px solid transparent`
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
"& .filter_cell_div": {
|
|
148
|
-
paddingLeft: theme.spacing(0.5),
|
|
149
|
-
paddingRight: theme.spacing(0.5)
|
|
150
|
-
},
|
|
151
|
-
"& .rdg-header-sort-cell": {
|
|
152
|
-
width: "100%",
|
|
153
|
-
flexGrow: "1",
|
|
154
|
-
alignItems: "center"
|
|
155
|
-
},
|
|
156
|
-
'& [aria-columnsort="ASC"]': {
|
|
157
|
-
borderTop: `2px solid ${theme.palette.primary.main}`
|
|
158
|
-
},
|
|
159
|
-
'& [aria-columnsort="DESC"]': {
|
|
160
|
-
borderBottom: `2px solid ${theme.palette.primary.main}`
|
|
161
|
-
}
|
|
162
|
-
}));
|
|
163
|
-
const WrapperTable = styled("div", {
|
|
164
|
-
shouldForwardProp: (prop) => prop !== "withActions"
|
|
165
|
-
})(({
|
|
166
|
-
withActions,
|
|
167
|
-
theme
|
|
168
|
-
}) => ({
|
|
169
|
-
display: "flex",
|
|
170
|
-
flexDirection: "column",
|
|
171
|
-
position: "absolute",
|
|
172
|
-
top: withActions ? theme.spacing(5.5) : "0px",
|
|
173
|
-
bottom: "0px",
|
|
174
|
-
left: "0px",
|
|
175
|
-
right: "0px",
|
|
176
|
-
overflow: "hidden"
|
|
177
|
-
}));
|
|
178
|
-
function CheckboxIcon(props) {
|
|
179
|
-
return /* @__PURE__ */ jsx(SvgIcon, {
|
|
180
|
-
...props,
|
|
181
|
-
children: /* @__PURE__ */ jsx("path", {
|
|
182
|
-
d: "M17 3a4 4 0 014 4v10a4 4 0 01-4 4H7a4 4 0 01-4-4V7a4 4 0 014-4h10zm0 2H7a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2z"
|
|
183
|
-
})
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
function CheckboxCheckedIcon(props) {
|
|
187
|
-
return /* @__PURE__ */ jsx(SvgIcon, {
|
|
188
|
-
...props,
|
|
189
|
-
children: /* @__PURE__ */ jsx("path", {
|
|
190
|
-
d: "M17 3a4 4 0 014 4v10a4 4 0 01-4 4H7a4 4 0 01-4-4V7a4 4 0 014-4h10zm-1.372 4.972a1.006 1.006 0 00-.928.388l-3.78 5-1.63-2.08a1.001 1.001 0 00-1.58 1.23l2.44 3.11a1 1 0 001.58-.01l4.57-6v-.03a1.006 1.006 0 00-.672-1.608z"
|
|
191
|
-
})
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
function CheckboxIndeterminateIcon(props) {
|
|
195
|
-
return /* @__PURE__ */ jsx(SvgIcon, {
|
|
196
|
-
...props,
|
|
197
|
-
children: /* @__PURE__ */ jsx("path", {
|
|
198
|
-
d: "M17 3a4 4 0 014 4v10a4 4 0 01-4 4H7a4 4 0 01-4-4V7a4 4 0 014-4h10zm-1.75 8h-6.5a.75.75 0 00-.75.75v.5c0 .414.336.75.75.75h6.5a.75.75 0 00.75-.75v-.5a.75.75 0 00-.75-.75z"
|
|
199
|
-
})
|
|
200
|
-
});
|
|
201
|
-
}
|
|
202
|
-
const CheckboxFormatter = forwardRef(
|
|
203
|
-
function CheckboxFormatter2({
|
|
204
|
-
onChange,
|
|
205
|
-
checked,
|
|
206
|
-
...props
|
|
207
|
-
}, _ref) {
|
|
208
|
-
function handleChange(e) {
|
|
209
|
-
onChange(e.target.checked, e.nativeEvent.shiftKey);
|
|
210
|
-
}
|
|
211
|
-
return /* @__PURE__ */ jsx(Checkbox, {
|
|
212
|
-
checked,
|
|
213
|
-
size: "small",
|
|
214
|
-
icon: /* @__PURE__ */ jsx(CheckboxIcon, {}),
|
|
215
|
-
checkedIcon: /* @__PURE__ */ jsx(CheckboxCheckedIcon, {}),
|
|
216
|
-
indeterminateIcon: /* @__PURE__ */ jsx(CheckboxIndeterminateIcon, {}),
|
|
217
|
-
onChange: handleChange,
|
|
218
|
-
...props
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
|
-
);
|
|
222
|
-
const DataGridContext = createContext(null);
|
|
223
|
-
const getColumnConfigByKey = (key, storeColumnsConfig) => {
|
|
224
|
-
let indexFind = -1;
|
|
225
|
-
return [storeColumnsConfig.find((column, index) => {
|
|
226
|
-
if (column.key === key) {
|
|
227
|
-
indexFind = index;
|
|
228
|
-
}
|
|
229
|
-
return column.key === key;
|
|
230
|
-
}), indexFind];
|
|
231
|
-
};
|
|
232
|
-
function getColumnsConfig(id, columns, remoteConfig = void 0) {
|
|
233
|
-
let columnsConfig;
|
|
234
|
-
if (remoteConfig) {
|
|
235
|
-
columnsConfig = remoteConfig.columnsConfig;
|
|
236
|
-
} else {
|
|
237
|
-
try {
|
|
238
|
-
const item = window.localStorage.getItem(`${id}_columns_config`);
|
|
239
|
-
columnsConfig = item !== null ? JSON.parse(item) : [];
|
|
240
|
-
} catch (e) {
|
|
241
|
-
columnsConfig = [];
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
return columns.map((column, index) => {
|
|
245
|
-
const [columnConfig = {
|
|
246
|
-
...column
|
|
247
|
-
}, columnConfigIndex] = getColumnConfigByKey(column.key, columnsConfig);
|
|
248
|
-
return {
|
|
249
|
-
key: column.key,
|
|
250
|
-
name: column.name,
|
|
251
|
-
hidden: column.hidden === void 0 ? false : column.hidden,
|
|
252
|
-
index: columnConfigIndex > -1 ? columnConfigIndex : index,
|
|
253
|
-
visible: columnConfig.visible === void 0 ? true : columnConfig.visible,
|
|
254
|
-
frozen: columnConfig.frozen === void 0 ? false : columnConfig.frozen,
|
|
255
|
-
orginalIndex: index,
|
|
256
|
-
originalVisible: column.visible === void 0 ? true : column.visible,
|
|
257
|
-
originalFrozen: column.frozen === void 0 ? false : column.frozen
|
|
258
|
-
};
|
|
259
|
-
}).sort((a, b) => a.index - b.index);
|
|
260
|
-
}
|
|
261
|
-
function getColumnsWidth(id, columns, remoteConfig) {
|
|
262
|
-
const newMap = /* @__PURE__ */ new Map();
|
|
263
|
-
let storeColumnsWidth;
|
|
264
|
-
try {
|
|
265
|
-
const item = window.localStorage.getItem(`${id}_columns_width`);
|
|
266
|
-
storeColumnsWidth = item !== null ? new Map(JSON.parse(item)) : /* @__PURE__ */ new Map();
|
|
267
|
-
} catch (e) {
|
|
268
|
-
storeColumnsWidth = /* @__PURE__ */ new Map();
|
|
269
|
-
}
|
|
270
|
-
for (let i = 0; i < columns.length; i++) {
|
|
271
|
-
let width;
|
|
272
|
-
if (remoteConfig) {
|
|
273
|
-
try {
|
|
274
|
-
width = remoteConfig.columnsWidths.get(columns[i].key);
|
|
275
|
-
} catch (error) {
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
if (width === void 0) {
|
|
279
|
-
const storeWidth = storeColumnsWidth.get(columns[i].key);
|
|
280
|
-
if (typeof storeWidth === "number") {
|
|
281
|
-
width = storeWidth;
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
if (width !== void 0) {
|
|
285
|
-
newMap.set(columns[i].key, width);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
return newMap;
|
|
289
|
-
}
|
|
290
|
-
function saveColumnsWidth(id, storeColumnsWidth) {
|
|
291
|
-
localStorage.setItem(`${id}_columns_width`, JSON.stringify([...storeColumnsWidth]));
|
|
292
|
-
}
|
|
293
|
-
function saveColumnsConfig(id, columnsConfig) {
|
|
294
|
-
localStorage.setItem(`${id}_columns_config`, JSON.stringify(columnsConfig));
|
|
295
|
-
}
|
|
296
|
-
function getIndexRowHeightVariant(variant) {
|
|
297
|
-
if (variant === "compact") {
|
|
298
|
-
return 0;
|
|
299
|
-
}
|
|
300
|
-
if (variant === "standard") {
|
|
301
|
-
return 1;
|
|
302
|
-
}
|
|
303
|
-
return 2;
|
|
304
|
-
}
|
|
305
|
-
function DataGridProvider(props) {
|
|
306
|
-
const {
|
|
307
|
-
id,
|
|
308
|
-
children,
|
|
309
|
-
columns,
|
|
310
|
-
remoteConfig,
|
|
311
|
-
rows,
|
|
312
|
-
rowsCount,
|
|
313
|
-
rowActionsGetter,
|
|
314
|
-
rowHeights = [36, 52, 67],
|
|
315
|
-
rowHeaderHeights = [44, 63, 75],
|
|
316
|
-
initialRowHeightVariant = "compact",
|
|
317
|
-
checkedRows,
|
|
318
|
-
onCheckedRowsChange,
|
|
319
|
-
rowKeyGetter
|
|
320
|
-
} = props;
|
|
321
|
-
const [columnsWidths, setColumnsWidths] = useState(/* @__PURE__ */ new Map());
|
|
322
|
-
const [columnsConfig, setColumnsConfigOptions] = useState(() => []);
|
|
323
|
-
const [rowsFilterCount, setRowFilterCount] = useState(rowsCount);
|
|
324
|
-
const [currentRowHeightVariant, setCurrentRowHeightVariant] = useState(() => {
|
|
325
|
-
if (typeof rowHeights !== typeof rowHeaderHeights) {
|
|
326
|
-
throw new Error("Must be same type rowheights and rowHeaderTypes");
|
|
327
|
-
}
|
|
328
|
-
if (typeof rowHeights === "number" && typeof rowHeaderHeights === "number") {
|
|
329
|
-
return {
|
|
330
|
-
rowHVariant: "compact",
|
|
331
|
-
rowHeight: rowHeights,
|
|
332
|
-
rowHeaderHeight: rowHeaderHeights
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
if (typeof rowHeights !== "number" && rowHeights.length !== 3) {
|
|
336
|
-
throw new Error("Must be 3 heights");
|
|
337
|
-
}
|
|
338
|
-
if (typeof rowHeaderHeights !== "number" && rowHeaderHeights.length !== 3) {
|
|
339
|
-
throw new Error("Must be 3 HeaderHeights");
|
|
340
|
-
}
|
|
341
|
-
return {
|
|
342
|
-
rowHVariant: initialRowHeightVariant,
|
|
343
|
-
rowHeight: typeof rowHeights !== "number" ? rowHeights[getIndexRowHeightVariant(initialRowHeightVariant)] : rowHeights,
|
|
344
|
-
rowHeaderHeight: typeof rowHeaderHeights !== "number" ? rowHeaderHeights[getIndexRowHeightVariant(initialRowHeightVariant)] : rowHeaderHeights
|
|
345
|
-
};
|
|
346
|
-
});
|
|
347
|
-
const finalRowHeights = useMemo(() => rowHeights, [rowHeights]);
|
|
348
|
-
let timerSaveColumns;
|
|
349
|
-
useEffect(() => {
|
|
350
|
-
}, [columnsConfig]);
|
|
351
|
-
useEffect(() => {
|
|
352
|
-
setColumnsWidths(getColumnsWidth(id, columns, remoteConfig));
|
|
353
|
-
setColumnsConfigOptions(getColumnsConfig(id, columns, remoteConfig));
|
|
354
|
-
}, [columns, id, remoteConfig]);
|
|
355
|
-
const onChangeColumnsConfig = useCallback((newColumnsConfig) => {
|
|
356
|
-
saveColumnsConfig(id, newColumnsConfig);
|
|
357
|
-
setColumnsConfigOptions(newColumnsConfig);
|
|
358
|
-
}, [setColumnsConfigOptions, id]);
|
|
359
|
-
const onChangeColumnsOrder = useCallback((sourceKey, targetKey) => {
|
|
360
|
-
if (sourceKey === targetKey)
|
|
361
|
-
return;
|
|
362
|
-
const sourceColumnIndex = columnsConfig.findIndex((c) => c.key === sourceKey);
|
|
363
|
-
const targetColumnIndex = columnsConfig.findIndex((c) => c.key === targetKey);
|
|
364
|
-
const reorderedColumnsConfig = [...columnsConfig];
|
|
365
|
-
reorderedColumnsConfig.splice(targetColumnIndex, 0, reorderedColumnsConfig.splice(sourceColumnIndex, 1)[0]);
|
|
366
|
-
onChangeColumnsConfig(reorderedColumnsConfig);
|
|
367
|
-
}, [columnsConfig, onChangeColumnsConfig]);
|
|
368
|
-
const onChangeColumnWidth = (columnKey, width) => {
|
|
369
|
-
columnsWidths.set(columnKey, Math.round(width));
|
|
370
|
-
if (timerSaveColumns) {
|
|
371
|
-
clearTimeout(timerSaveColumns);
|
|
372
|
-
}
|
|
373
|
-
timerSaveColumns = setTimeout(() => {
|
|
374
|
-
saveColumnsWidth(id, columnsWidths);
|
|
375
|
-
}, 500);
|
|
376
|
-
};
|
|
377
|
-
useEffect(() => {
|
|
378
|
-
setColumnsConfigOptions(getColumnsConfig(id, columns));
|
|
379
|
-
}, [columns]);
|
|
380
|
-
const setRowFilterCountInternal = (newRowsCount) => {
|
|
381
|
-
setRowFilterCount(newRowsCount);
|
|
382
|
-
};
|
|
383
|
-
const setCurrentRowHeightInternal = useCallback((newVariant) => {
|
|
384
|
-
if (typeof rowHeights === "number" || typeof rowHeaderHeights === "number") {
|
|
385
|
-
throw new Error("Only use setCurrentRowHeight with vector rowHeights");
|
|
386
|
-
}
|
|
387
|
-
setCurrentRowHeightVariant({
|
|
388
|
-
rowHVariant: newVariant,
|
|
389
|
-
rowHeight: rowHeights[getIndexRowHeightVariant(newVariant)],
|
|
390
|
-
rowHeaderHeight: rowHeaderHeights[getIndexRowHeightVariant(newVariant)]
|
|
391
|
-
});
|
|
392
|
-
}, [setCurrentRowHeightVariant, rowHeights, rowHeaderHeights]);
|
|
393
|
-
return /* @__PURE__ */ jsx(DataGridContext.Provider, {
|
|
394
|
-
value: {
|
|
395
|
-
columnsConfig,
|
|
396
|
-
columnsWidths,
|
|
397
|
-
onChangeColumnsConfig,
|
|
398
|
-
onChangeColumnsOrder,
|
|
399
|
-
onChangeColumnWidth,
|
|
400
|
-
rowsCount: rowsFilterCount,
|
|
401
|
-
setRowsCount: setRowFilterCountInternal,
|
|
402
|
-
rowActionsGetter,
|
|
403
|
-
currentRowHeightVariant: currentRowHeightVariant.rowHVariant,
|
|
404
|
-
currentRowHeight: currentRowHeightVariant.rowHeight,
|
|
405
|
-
currentRowHeaderHeight: currentRowHeightVariant.rowHeaderHeight,
|
|
406
|
-
rowHeights: finalRowHeights,
|
|
407
|
-
setRowHeightVariant: setCurrentRowHeightInternal,
|
|
408
|
-
rows,
|
|
409
|
-
checkedRows,
|
|
410
|
-
onCheckedRowsChange,
|
|
411
|
-
rowKeyGetter
|
|
412
|
-
},
|
|
413
|
-
children
|
|
414
|
-
});
|
|
415
|
-
}
|
|
416
|
-
function useDataGrid() {
|
|
417
|
-
const context = useContext(DataGridContext);
|
|
418
|
-
if (!context)
|
|
419
|
-
throw new Error("useDataGrid context must be use inside DataGridContext");
|
|
420
|
-
return context;
|
|
421
|
-
}
|
|
422
|
-
const filterColumnClassName = "filter-cell";
|
|
423
|
-
const filterHeight = 35;
|
|
424
|
-
function SelectGroupFormatter(props) {
|
|
425
|
-
const [isRowSelected, onRowSelectionChange] = useRowSelection();
|
|
426
|
-
const onChange = (checked) => {
|
|
427
|
-
onRowSelectionChange({
|
|
428
|
-
row: props.row,
|
|
429
|
-
checked,
|
|
430
|
-
isShiftClick: false
|
|
431
|
-
});
|
|
432
|
-
};
|
|
433
|
-
const cellFormater = SelectCellFormatter({
|
|
434
|
-
value: isRowSelected,
|
|
435
|
-
isCellSelected: props.isCellSelected,
|
|
436
|
-
onChange,
|
|
437
|
-
"aria-label": "Select Group"
|
|
438
|
-
});
|
|
439
|
-
return cellFormater;
|
|
440
|
-
}
|
|
441
|
-
function SelectFormatter(props) {
|
|
442
|
-
const {
|
|
443
|
-
checkedRows,
|
|
444
|
-
onCheckedRowsChange,
|
|
445
|
-
rowKeyGetter
|
|
446
|
-
} = useDataGrid();
|
|
447
|
-
const onChange = (checked, _isShiftClick) => {
|
|
448
|
-
const newCheckedRows = new Set(checkedRows);
|
|
449
|
-
if (checked) {
|
|
450
|
-
newCheckedRows.add(rowKeyGetter(props.row));
|
|
451
|
-
} else {
|
|
452
|
-
newCheckedRows.delete(rowKeyGetter(props.row));
|
|
453
|
-
}
|
|
454
|
-
onCheckedRowsChange && onCheckedRowsChange(newCheckedRows);
|
|
455
|
-
};
|
|
456
|
-
return /* @__PURE__ */ jsx(SelectCellFormatter, {
|
|
457
|
-
value: checkedRows?.has(rowKeyGetter(props.row)) || false,
|
|
458
|
-
isCellSelected: props.isCellSelected,
|
|
459
|
-
onChange,
|
|
460
|
-
"aria-label": "Select"
|
|
461
|
-
});
|
|
462
|
-
}
|
|
463
|
-
const SelectColumnHeaderRenderer = (props) => {
|
|
464
|
-
const {
|
|
465
|
-
rows,
|
|
466
|
-
rowKeyGetter,
|
|
467
|
-
onCheckedRowsChange,
|
|
468
|
-
checkedRows
|
|
469
|
-
} = useDataGrid();
|
|
470
|
-
const onAllRowsCheckedChange = (checked) => {
|
|
471
|
-
if (!onCheckedRowsChange)
|
|
472
|
-
return;
|
|
473
|
-
if (checked) {
|
|
474
|
-
onCheckedRowsChange(new Set(rows.map((r) => rowKeyGetter(r))));
|
|
475
|
-
} else {
|
|
476
|
-
onCheckedRowsChange(/* @__PURE__ */ new Set());
|
|
477
|
-
}
|
|
478
|
-
};
|
|
479
|
-
const allRowsChecked = rows.length === checkedRows?.size;
|
|
480
|
-
return SelectCellFormatter({
|
|
481
|
-
"aria-label": "Select All",
|
|
482
|
-
isCellSelected: props.isCellSelected,
|
|
483
|
-
value: allRowsChecked,
|
|
484
|
-
onChange: onAllRowsCheckedChange
|
|
485
|
-
});
|
|
486
|
-
};
|
|
487
|
-
const SelectColumn = {
|
|
488
|
-
key: SELECT_COLUMN_KEY,
|
|
489
|
-
name: "",
|
|
490
|
-
width: 60,
|
|
491
|
-
maxWidth: 60,
|
|
492
|
-
resizable: false,
|
|
493
|
-
sortable: false,
|
|
494
|
-
frozen: true,
|
|
495
|
-
type: "boolean",
|
|
496
|
-
headerRenderer: SelectColumnHeaderRenderer,
|
|
497
|
-
formatter: SelectFormatter,
|
|
498
|
-
groupFormatter: SelectGroupFormatter
|
|
499
|
-
};
|
|
500
|
-
function useFocusRef(isSelected) {
|
|
501
|
-
const ref = useRef(null);
|
|
502
|
-
useLayoutEffect(() => {
|
|
503
|
-
if (!isSelected)
|
|
504
|
-
return;
|
|
505
|
-
ref.current?.focus({ preventScroll: true });
|
|
506
|
-
}, [isSelected]);
|
|
507
|
-
return {
|
|
508
|
-
ref,
|
|
509
|
-
tabIndex: isSelected ? 0 : -1
|
|
510
|
-
};
|
|
511
|
-
}
|
|
512
|
-
const initialState = {
|
|
513
|
-
activeFilters: false,
|
|
514
|
-
setActiveFilters: voidFunction
|
|
515
|
-
};
|
|
516
|
-
const FilterContext = createContext(initialState);
|
|
517
|
-
function FilterProvider({
|
|
518
|
-
children,
|
|
519
|
-
initialActiveFilters
|
|
520
|
-
}) {
|
|
521
|
-
const [filterOptions, setFilterOptions] = useState({
|
|
522
|
-
activeFilters: initialActiveFilters
|
|
523
|
-
});
|
|
524
|
-
const onChangeFilter = (column, value) => {
|
|
525
|
-
const newMap = filterOptions.filters ? new Map(filterOptions.filters) : /* @__PURE__ */ new Map();
|
|
526
|
-
if (value !== "") {
|
|
527
|
-
newMap.set(column.key, {
|
|
528
|
-
value,
|
|
529
|
-
customFilter: column.customFilter
|
|
530
|
-
});
|
|
531
|
-
} else {
|
|
532
|
-
newMap.delete(column.key);
|
|
533
|
-
}
|
|
534
|
-
setFilterOptions({
|
|
535
|
-
...filterOptions,
|
|
536
|
-
filters: newMap
|
|
537
|
-
});
|
|
538
|
-
};
|
|
539
|
-
const setActiveFilters = (active) => {
|
|
540
|
-
if (active) {
|
|
541
|
-
setFilterOptions({
|
|
542
|
-
activeFilters: true,
|
|
543
|
-
filters: /* @__PURE__ */ new Map()
|
|
544
|
-
});
|
|
545
|
-
} else {
|
|
546
|
-
setFilterOptions({
|
|
547
|
-
activeFilters: false
|
|
548
|
-
});
|
|
549
|
-
}
|
|
550
|
-
};
|
|
551
|
-
return /* @__PURE__ */ jsx(FilterContext.Provider, {
|
|
552
|
-
value: {
|
|
553
|
-
...filterOptions,
|
|
554
|
-
onChangeFilter,
|
|
555
|
-
setActiveFilters
|
|
556
|
-
},
|
|
557
|
-
children
|
|
558
|
-
});
|
|
559
|
-
}
|
|
560
|
-
const useFilters = () => useContext(FilterContext);
|
|
561
|
-
function DraggableHeaderRenderer(props) {
|
|
562
|
-
const {
|
|
563
|
-
onColumnsReorder,
|
|
564
|
-
column,
|
|
565
|
-
isCellSelected,
|
|
566
|
-
...others
|
|
567
|
-
} = props;
|
|
568
|
-
const {
|
|
569
|
-
ref,
|
|
570
|
-
tabIndex
|
|
571
|
-
} = useFocusRef(isCellSelected);
|
|
572
|
-
const {
|
|
573
|
-
getLabel
|
|
574
|
-
} = useModuleDictionary();
|
|
575
|
-
const {
|
|
576
|
-
activeFilters,
|
|
577
|
-
filters,
|
|
578
|
-
onChangeFilter
|
|
579
|
-
} = useFilters();
|
|
580
|
-
const [filter, setFilter] = useState(filters?.get(column.key) || "");
|
|
581
|
-
const [{
|
|
582
|
-
isDragging
|
|
583
|
-
}, drag] = useDrag({
|
|
584
|
-
type: "COLUMN_DRAG",
|
|
585
|
-
item: {
|
|
586
|
-
key: column.key
|
|
587
|
-
},
|
|
588
|
-
collect: (monitor) => ({
|
|
589
|
-
isDragging: monitor.isDragging()
|
|
590
|
-
})
|
|
591
|
-
});
|
|
592
|
-
const [{
|
|
593
|
-
isOver
|
|
594
|
-
}, drop] = useDrop({
|
|
595
|
-
accept: "COLUMN_DRAG",
|
|
596
|
-
drop({
|
|
597
|
-
key
|
|
598
|
-
}) {
|
|
599
|
-
onColumnsReorder(key, column.key);
|
|
600
|
-
},
|
|
601
|
-
collect: (monitor) => ({
|
|
602
|
-
isOver: monitor.isOver(),
|
|
603
|
-
canDrop: monitor.canDrop()
|
|
604
|
-
})
|
|
605
|
-
});
|
|
606
|
-
const handleChange = (e) => {
|
|
607
|
-
if (activeFilters) {
|
|
608
|
-
if (onChangeFilter)
|
|
609
|
-
onChangeFilter(column, e.target.value);
|
|
610
|
-
}
|
|
611
|
-
setFilter(e.target.value);
|
|
612
|
-
};
|
|
613
|
-
useEffect(() => {
|
|
614
|
-
if (!activeFilters)
|
|
615
|
-
setFilter("");
|
|
616
|
-
}, [activeFilters]);
|
|
617
|
-
const newColumn = {
|
|
618
|
-
...column
|
|
619
|
-
};
|
|
620
|
-
if (newColumn.withinHeaderRenderer) {
|
|
621
|
-
newColumn.name = newColumn.withinHeaderRenderer(props);
|
|
622
|
-
}
|
|
623
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
624
|
-
ref: (newRef) => {
|
|
625
|
-
drag(newRef);
|
|
626
|
-
drop(newRef);
|
|
627
|
-
},
|
|
628
|
-
style: {
|
|
629
|
-
opacity: isDragging ? 0.5 : 1,
|
|
630
|
-
backgroundColor: isOver ? "#ececec" : void 0,
|
|
631
|
-
cursor: "move",
|
|
632
|
-
display: "flex",
|
|
633
|
-
flexDirection: "column",
|
|
634
|
-
lineHeight: "1",
|
|
635
|
-
height: "100%",
|
|
636
|
-
justifyContent: "center",
|
|
637
|
-
textAlign: "center"
|
|
638
|
-
},
|
|
639
|
-
children: [/* @__PURE__ */ jsx(HeaderRenderer, {
|
|
640
|
-
column: newColumn,
|
|
641
|
-
isCellSelected,
|
|
642
|
-
...others
|
|
643
|
-
}), activeFilters && (column?.withFilter === void 0 || column.withFilter === true) && /* @__PURE__ */ jsx("div", {
|
|
644
|
-
className: "filter_cell_div",
|
|
645
|
-
style: {
|
|
646
|
-
borderTop: "1px solid var(--rdg-border-color)",
|
|
647
|
-
width: "100%",
|
|
648
|
-
display: "flex",
|
|
649
|
-
alignItems: "center",
|
|
650
|
-
height: `${filterHeight}px`
|
|
651
|
-
},
|
|
652
|
-
children: /* @__PURE__ */ jsx(InputBase, {
|
|
653
|
-
inputRef: ref,
|
|
654
|
-
placeholder: getLabel("data_grid.filter_holder"),
|
|
655
|
-
style: {
|
|
656
|
-
width: "100%",
|
|
657
|
-
paddingBottom: "2px",
|
|
658
|
-
border: "1px solid var(--rdg-border-color)"
|
|
659
|
-
},
|
|
660
|
-
tabIndex,
|
|
661
|
-
type: "text",
|
|
662
|
-
onChange: handleChange,
|
|
663
|
-
value: filter
|
|
664
|
-
})
|
|
665
|
-
})]
|
|
666
|
-
});
|
|
667
|
-
}
|
|
668
|
-
const getDragHeaderRenderer = (handleColumnsReorder) => {
|
|
669
|
-
function HeaderRenderer2(props) {
|
|
670
|
-
return /* @__PURE__ */ jsx(DraggableHeaderRenderer, {
|
|
671
|
-
...props,
|
|
672
|
-
onColumnsReorder: handleColumnsReorder
|
|
673
|
-
});
|
|
674
|
-
}
|
|
675
|
-
return HeaderRenderer2;
|
|
676
|
-
};
|
|
677
|
-
const ACTIONS_COLUMN_KEY = "actions-row";
|
|
678
|
-
function ActionsFormatter(props) {
|
|
679
|
-
const {
|
|
680
|
-
rowActionsGetter
|
|
681
|
-
} = useDataGrid();
|
|
682
|
-
if (rowActionsGetter === void 0) {
|
|
683
|
-
return /* @__PURE__ */ jsx(Fragment, {});
|
|
684
|
-
}
|
|
685
|
-
return /* @__PURE__ */ jsx(MenuActions, {
|
|
686
|
-
arrowType: "top-left",
|
|
687
|
-
objItem: props.row,
|
|
688
|
-
menuActions: rowActionsGetter,
|
|
689
|
-
marginTop: 1,
|
|
690
|
-
marginLeft: "-11px",
|
|
691
|
-
anchorOrigin: {
|
|
692
|
-
vertical: "bottom",
|
|
693
|
-
horizontal: "left"
|
|
694
|
-
},
|
|
695
|
-
transformOrigin: {
|
|
696
|
-
vertical: "top",
|
|
697
|
-
horizontal: "left"
|
|
698
|
-
}
|
|
699
|
-
});
|
|
700
|
-
}
|
|
701
|
-
const ActionsColumn = {
|
|
702
|
-
key: ACTIONS_COLUMN_KEY,
|
|
703
|
-
name: "Actions",
|
|
704
|
-
width: 60,
|
|
705
|
-
withFilter: false,
|
|
706
|
-
resizable: true,
|
|
707
|
-
sortable: false,
|
|
708
|
-
frozen: true,
|
|
709
|
-
type: "custom",
|
|
710
|
-
formatter: ActionsFormatter
|
|
711
|
-
};
|
|
712
|
-
const WrapperSkeleton = styled("div")(() => ({
|
|
713
|
-
display: "flex",
|
|
714
|
-
width: "100%",
|
|
715
|
-
height: "100%",
|
|
716
|
-
alignItems: "center"
|
|
717
|
-
}));
|
|
718
|
-
function SkeletonFormatter() {
|
|
719
|
-
return /* @__PURE__ */ jsx(WrapperSkeleton, {
|
|
720
|
-
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
721
|
-
variant: "text",
|
|
722
|
-
width: "100%",
|
|
723
|
-
height: "12px"
|
|
724
|
-
})
|
|
725
|
-
});
|
|
726
|
-
}
|
|
727
|
-
function getComparator(columns, sortColumn) {
|
|
728
|
-
const column = columns.find((d) => d.key === sortColumn);
|
|
729
|
-
let typeOrder = "string";
|
|
730
|
-
if (column) {
|
|
731
|
-
typeOrder = column.type || "string";
|
|
732
|
-
}
|
|
733
|
-
switch (typeOrder) {
|
|
734
|
-
case "number":
|
|
735
|
-
return (a, b) => {
|
|
736
|
-
try {
|
|
737
|
-
return Number(a[sortColumn]) - Number(b[sortColumn]);
|
|
738
|
-
} catch (error) {
|
|
739
|
-
return -1;
|
|
740
|
-
}
|
|
741
|
-
};
|
|
742
|
-
default:
|
|
743
|
-
return (a, b) => {
|
|
744
|
-
try {
|
|
745
|
-
return a[sortColumn].toString().localeCompare(b[sortColumn].toString());
|
|
746
|
-
} catch (error) {
|
|
747
|
-
return -1;
|
|
748
|
-
}
|
|
749
|
-
};
|
|
750
|
-
}
|
|
751
|
-
}
|
|
752
|
-
const getColumIndex = (key, columnsConfig) => columnsConfig.findIndex((columnConfig) => columnConfig.key === key);
|
|
753
|
-
const getInOrderColumns = (columns, hasCheckedRows, columnsConfig, columnsWidths, rowActionsGetter) => {
|
|
754
|
-
let filteredSortedColumns = columns.filter((column) => {
|
|
755
|
-
const columnConfigIndex = getColumIndex(column.key, columnsConfig);
|
|
756
|
-
const visible = columnConfigIndex > -1 ? columnsConfig[columnConfigIndex].visible : true;
|
|
757
|
-
return !column.hidden && visible;
|
|
758
|
-
}).sort(
|
|
759
|
-
(a, b) => getColumIndex(a.key, columnsConfig) - getColumIndex(b.key, columnsConfig)
|
|
760
|
-
).map((columnSorted) => {
|
|
761
|
-
const columnConfigIndex = getColumIndex(columnSorted.key, columnsConfig);
|
|
762
|
-
return {
|
|
763
|
-
...columnSorted,
|
|
764
|
-
frozen: columnConfigIndex > -1 ? columnsConfig[columnConfigIndex].frozen : true,
|
|
765
|
-
width: typeof columnsWidths.get(columnSorted.key) === "number" ? columnsWidths.get(columnSorted.key) : columnSorted.width
|
|
766
|
-
};
|
|
767
|
-
}).sort((a, b) => {
|
|
768
|
-
const order = (a.frozen === void 0 || a.frozen === false) === (b.frozen === void 0 || b.frozen === false) ? 0 : a.frozen ? -1 : 1;
|
|
769
|
-
return order;
|
|
770
|
-
});
|
|
771
|
-
if (rowActionsGetter) {
|
|
772
|
-
filteredSortedColumns = [ActionsColumn, ...filteredSortedColumns];
|
|
773
|
-
}
|
|
774
|
-
if (hasCheckedRows) {
|
|
775
|
-
filteredSortedColumns = [SelectColumn, ...filteredSortedColumns];
|
|
776
|
-
}
|
|
777
|
-
return filteredSortedColumns;
|
|
778
|
-
};
|
|
779
|
-
const getAligByType = (columnType) => {
|
|
780
|
-
switch (columnType) {
|
|
781
|
-
case "string":
|
|
782
|
-
return "left";
|
|
783
|
-
case "date":
|
|
784
|
-
case "boolean":
|
|
785
|
-
case "custom":
|
|
786
|
-
return "center";
|
|
787
|
-
case "number":
|
|
788
|
-
return "right";
|
|
789
|
-
}
|
|
790
|
-
return "left";
|
|
791
|
-
};
|
|
792
|
-
const useSortColumnsRows = (sourceColumns, sourceRows) => {
|
|
793
|
-
const {
|
|
794
|
-
columnsConfig,
|
|
795
|
-
columnsWidths,
|
|
796
|
-
onChangeColumnsOrder,
|
|
797
|
-
rowActionsGetter,
|
|
798
|
-
checkedRows,
|
|
799
|
-
onCheckedRowsChange
|
|
800
|
-
} = useDataGrid();
|
|
801
|
-
const [columns, setColumns] = useState(() => []);
|
|
802
|
-
const [sortColumns, setSortColumns] = useState([]);
|
|
803
|
-
const isSkeleton = useModuleSkeleton();
|
|
804
|
-
const { activeFilters, filters } = useFilters();
|
|
805
|
-
const findKeyInColumns = (key, cols) => {
|
|
806
|
-
const index = cols.findIndex((column) => key === column.key && column.hidden === false);
|
|
807
|
-
return index !== -1;
|
|
808
|
-
};
|
|
809
|
-
useEffect(() => {
|
|
810
|
-
setColumns(
|
|
811
|
-
getInOrderColumns(
|
|
812
|
-
sourceColumns,
|
|
813
|
-
!!checkedRows && !!onCheckedRowsChange,
|
|
814
|
-
columnsConfig,
|
|
815
|
-
columnsWidths,
|
|
816
|
-
rowActionsGetter
|
|
817
|
-
)
|
|
818
|
-
);
|
|
819
|
-
const finalSortedColumns = sortColumns.filter(
|
|
820
|
-
(sortColumn) => findKeyInColumns(sortColumn.columnKey, sourceColumns)
|
|
821
|
-
);
|
|
822
|
-
if (JSON.stringify(finalSortedColumns) !== JSON.stringify(sortColumns)) {
|
|
823
|
-
setSortColumns(finalSortedColumns);
|
|
824
|
-
}
|
|
825
|
-
}, [sourceColumns, columnsConfig, rowActionsGetter]);
|
|
826
|
-
const finalColumns = useMemo(() => {
|
|
827
|
-
const DragAndDropHeaderRenderer = getDragHeaderRenderer(onChangeColumnsOrder);
|
|
828
|
-
return columns.map((c) => {
|
|
829
|
-
const newColumn = {
|
|
830
|
-
...c,
|
|
831
|
-
cellClass: c.align !== void 0 ? `rdg-cell-align-${c.align}` : `rdg-cell-align-${getAligByType(c.type)}`
|
|
832
|
-
};
|
|
833
|
-
if (newColumn.key === SELECT_COLUMN_KEY || newColumn.isDraggable !== void 0 && newColumn.isDraggable === false)
|
|
834
|
-
return newColumn;
|
|
835
|
-
if (isSkeleton) {
|
|
836
|
-
newColumn.headerRenderer = SkeletonFormatter;
|
|
837
|
-
newColumn.formatter = SkeletonFormatter;
|
|
838
|
-
}
|
|
839
|
-
if (newColumn.headerRenderer) {
|
|
840
|
-
newColumn.withinHeaderRenderer = newColumn.headerRenderer;
|
|
841
|
-
}
|
|
842
|
-
if ((newColumn?.withFilter === void 0 || newColumn.withFilter === true) && activeFilters) {
|
|
843
|
-
newColumn.headerCellClass = filterColumnClassName;
|
|
844
|
-
}
|
|
845
|
-
newColumn.headerRenderer = DragAndDropHeaderRenderer;
|
|
846
|
-
return newColumn;
|
|
847
|
-
});
|
|
848
|
-
}, [isSkeleton, columns, activeFilters, onChangeColumnsOrder]);
|
|
849
|
-
const finalRows = useMemo(() => {
|
|
850
|
-
const nextRows = sourceRows.filter((r) => {
|
|
851
|
-
if (!filters || filters.size === 0)
|
|
852
|
-
return true;
|
|
853
|
-
const iterator = filters.entries();
|
|
854
|
-
let valReturn = true;
|
|
855
|
-
for (let i = 0; i < filters.size; i++) {
|
|
856
|
-
const entry = iterator.next().value;
|
|
857
|
-
const columnKey = entry[0];
|
|
858
|
-
const columnFilter = entry[1];
|
|
859
|
-
let valCell;
|
|
860
|
-
try {
|
|
861
|
-
if (columnFilter.customFilter) {
|
|
862
|
-
valReturn = valReturn && columnFilter.customFilter(r, columnFilter.value);
|
|
863
|
-
} else {
|
|
864
|
-
valCell = getPropertyByString(r, columnKey) || "";
|
|
865
|
-
valReturn = valReturn && valCell.includes(columnFilter.value);
|
|
866
|
-
}
|
|
867
|
-
} catch (error) {
|
|
868
|
-
continue;
|
|
869
|
-
}
|
|
870
|
-
if (!valReturn)
|
|
871
|
-
break;
|
|
872
|
-
}
|
|
873
|
-
return valReturn;
|
|
874
|
-
});
|
|
875
|
-
if (sortColumns.length === 0) {
|
|
876
|
-
return nextRows;
|
|
877
|
-
}
|
|
878
|
-
nextRows.sort((a, b) => {
|
|
879
|
-
for (const sort of sortColumns) {
|
|
880
|
-
const comparator = getComparator(columns, sort.columnKey);
|
|
881
|
-
const compResult = comparator(a, b);
|
|
882
|
-
if (compResult !== 0) {
|
|
883
|
-
return sort.direction === "ASC" ? compResult : -compResult;
|
|
884
|
-
}
|
|
885
|
-
}
|
|
886
|
-
return 0;
|
|
887
|
-
});
|
|
888
|
-
return nextRows;
|
|
889
|
-
}, [sourceRows, sortColumns, filters]);
|
|
890
|
-
return { finalColumns, sortColumns, setSortColumns, finalRows };
|
|
891
|
-
};
|
|
892
|
-
function Table(props) {
|
|
893
|
-
const {
|
|
894
|
-
columns,
|
|
895
|
-
rows,
|
|
896
|
-
withActions,
|
|
897
|
-
onRowsChange,
|
|
898
|
-
rowKeyGetter,
|
|
899
|
-
selectedRows,
|
|
900
|
-
onSelectedRowsChange
|
|
901
|
-
} = props;
|
|
902
|
-
const {
|
|
903
|
-
finalColumns,
|
|
904
|
-
sortColumns,
|
|
905
|
-
setSortColumns,
|
|
906
|
-
finalRows
|
|
907
|
-
} = useSortColumnsRows(columns, rows);
|
|
908
|
-
const {
|
|
909
|
-
activeFilters
|
|
910
|
-
} = useFilters();
|
|
911
|
-
const {
|
|
912
|
-
onChangeColumnWidth,
|
|
913
|
-
setRowsCount,
|
|
914
|
-
currentRowHeight,
|
|
915
|
-
currentRowHeaderHeight
|
|
916
|
-
} = useDataGrid();
|
|
917
|
-
const ref_data_grid = useRef(null);
|
|
918
|
-
const onRowClick = (row) => {
|
|
919
|
-
if (selectedRows && onSelectedRowsChange) {
|
|
920
|
-
if (selectedRows.entries().next().value) {
|
|
921
|
-
if (selectedRows.entries().next().value[1] === rowKeyGetter(row)) {
|
|
922
|
-
return;
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
const mySet = /* @__PURE__ */ new Set([rowKeyGetter(row)]);
|
|
926
|
-
onSelectedRowsChange(mySet);
|
|
927
|
-
}
|
|
928
|
-
};
|
|
929
|
-
useEffect(() => {
|
|
930
|
-
let columnIndice = 0;
|
|
931
|
-
for (const column of finalColumns) {
|
|
932
|
-
const index = sortColumns.findIndex((sortColumn) => column.key === sortColumn.columnKey);
|
|
933
|
-
if (index !== -1) {
|
|
934
|
-
ref_data_grid.current?.element?.querySelector(`[role="columnheader"][aria-colindex="${columnIndice + 1}"]`)?.setAttribute("aria-columnsort", `${sortColumns[index].direction}`);
|
|
935
|
-
} else {
|
|
936
|
-
ref_data_grid.current?.element?.querySelector(`[role="columnheader"][aria-colindex="${columnIndice + 1}"]`)?.removeAttribute("aria-columnsort");
|
|
937
|
-
}
|
|
938
|
-
columnIndice++;
|
|
939
|
-
}
|
|
940
|
-
}, [sortColumns, finalColumns]);
|
|
941
|
-
useEffect(() => {
|
|
942
|
-
setRowsCount(finalRows.length);
|
|
943
|
-
}, [finalRows]);
|
|
944
|
-
const onColumnResize = (idx, width) => {
|
|
945
|
-
onChangeColumnWidth(finalColumns[idx].key, width);
|
|
946
|
-
};
|
|
947
|
-
const onChangeSort = (newSortColumns) => {
|
|
948
|
-
setSortColumns(newSortColumns);
|
|
949
|
-
};
|
|
950
|
-
return /* @__PURE__ */ jsx(WrapperTable, {
|
|
951
|
-
id: "WrapperTable",
|
|
952
|
-
withActions,
|
|
953
|
-
children: /* @__PURE__ */ jsx(OriginalDataGridWrapperStyled, {
|
|
954
|
-
id: "OriginalGridWrapperStyled",
|
|
955
|
-
children: /* @__PURE__ */ jsx(DndProvider, {
|
|
956
|
-
backend: HTML5Backend,
|
|
957
|
-
context: window,
|
|
958
|
-
children: /* @__PURE__ */ jsx(DataGrid$1, {
|
|
959
|
-
className: "fill-grid rdg-light",
|
|
960
|
-
ref: ref_data_grid,
|
|
961
|
-
headerRowHeight: activeFilters ? currentRowHeaderHeight + filterHeight : currentRowHeaderHeight,
|
|
962
|
-
columns: finalColumns,
|
|
963
|
-
sortColumns,
|
|
964
|
-
onSortColumnsChange: onChangeSort,
|
|
965
|
-
onColumnResize,
|
|
966
|
-
rows: finalRows,
|
|
967
|
-
onRowsChange,
|
|
968
|
-
selectedRows,
|
|
969
|
-
onSelectedRowsChange,
|
|
970
|
-
onRowClick,
|
|
971
|
-
rowHeight: currentRowHeight,
|
|
972
|
-
rowKeyGetter,
|
|
973
|
-
cellNavigationMode: "LOOP_OVER_ROW",
|
|
974
|
-
components: {
|
|
975
|
-
checkboxFormatter: CheckboxFormatter
|
|
976
|
-
},
|
|
977
|
-
defaultColumnOptions: {
|
|
978
|
-
resizable: true,
|
|
979
|
-
sortable: true
|
|
980
|
-
}
|
|
981
|
-
})
|
|
982
|
-
})
|
|
983
|
-
})
|
|
984
|
-
});
|
|
985
|
-
}
|
|
986
|
-
const SKTWrapperFilter = styled("div")(({
|
|
987
|
-
theme
|
|
988
|
-
}) => ({
|
|
989
|
-
display: "flex",
|
|
990
|
-
justifyContent: "center",
|
|
991
|
-
alignItems: "center",
|
|
992
|
-
minWidth: theme.spacing(3.75),
|
|
993
|
-
height: theme.spacing(3.75)
|
|
994
|
-
}));
|
|
995
|
-
function Filter() {
|
|
996
|
-
const isSkeleton = useModuleSkeleton();
|
|
997
|
-
const {
|
|
998
|
-
activeFilters,
|
|
999
|
-
setActiveFilters
|
|
1000
|
-
} = useFilters();
|
|
1001
|
-
const {
|
|
1002
|
-
host_static_assets,
|
|
1003
|
-
environment_assets
|
|
1004
|
-
} = useEnvironment();
|
|
1005
|
-
const toggleIcon = () => {
|
|
1006
|
-
setActiveFilters(!activeFilters);
|
|
1007
|
-
};
|
|
1008
|
-
if (isSkeleton) {
|
|
1009
|
-
return /* @__PURE__ */ jsx(SKTWrapperFilter, {
|
|
1010
|
-
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
1011
|
-
variant: "circular",
|
|
1012
|
-
width: 20,
|
|
1013
|
-
height: 20
|
|
1014
|
-
})
|
|
1015
|
-
});
|
|
1016
|
-
}
|
|
1017
|
-
return /* @__PURE__ */ jsx(IconButton, {
|
|
1018
|
-
dictionaryTooltip: activeFilters ? "data_grid.tooltip_filter_hide" : "data_grid.tooltip_filter_show",
|
|
1019
|
-
onClick: toggleIcon,
|
|
1020
|
-
"aria-label": "filter",
|
|
1021
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/filter.svg`
|
|
1022
|
-
});
|
|
1023
|
-
}
|
|
1024
|
-
const WrapperColumnsConfig = styled("div")(({ theme }) => ({
|
|
1025
|
-
color: theme.palette.text.primary,
|
|
1026
|
-
position: "relative",
|
|
1027
|
-
display: "flex",
|
|
1028
|
-
flexDirection: "column",
|
|
1029
|
-
height: "100%",
|
|
1030
|
-
width: "100%"
|
|
1031
|
-
}));
|
|
1032
|
-
styled("div")(({ theme }) => ({
|
|
1033
|
-
color: theme.palette.text.primary,
|
|
1034
|
-
fontSize: theme.typography.h4.fontSize
|
|
1035
|
-
}));
|
|
1036
|
-
const DivSelColumns = styled("div")(({ theme }) => ({
|
|
1037
|
-
...theme.typography.subtitle2,
|
|
1038
|
-
color: theme.palette.text.primary,
|
|
1039
|
-
padding: `${theme.spacing(3)} ${theme.spacing(1)}`
|
|
1040
|
-
}));
|
|
1041
|
-
const WrapperDataGrid = styled("div")(() => ({
|
|
1042
|
-
position: "relative",
|
|
1043
|
-
display: "flex",
|
|
1044
|
-
flexDirection: "column",
|
|
1045
|
-
flexGrow: 1
|
|
1046
|
-
}));
|
|
1047
|
-
styled("div")(() => ({
|
|
1048
|
-
display: "flex",
|
|
1049
|
-
flexDirection: "row"
|
|
1050
|
-
}));
|
|
1051
|
-
const ColumnActions = styled("div")(({ theme }) => ({
|
|
1052
|
-
paddingTop: theme.spacing(3),
|
|
1053
|
-
display: "flex",
|
|
1054
|
-
flexDirection: "row"
|
|
1055
|
-
}));
|
|
1056
|
-
styled("div")(({ theme }) => ({
|
|
1057
|
-
paddingTop: theme.spacing(3),
|
|
1058
|
-
display: "flex",
|
|
1059
|
-
flexDirection: "row",
|
|
1060
|
-
justifyContent: "flex-end",
|
|
1061
|
-
"& > button": {
|
|
1062
|
-
marginLeft: "10px"
|
|
1063
|
-
}
|
|
1064
|
-
}));
|
|
1065
|
-
function FormatterColumn({
|
|
1066
|
-
row,
|
|
1067
|
-
onRowChange,
|
|
1068
|
-
column
|
|
1069
|
-
}) {
|
|
1070
|
-
const handleChange = () => {
|
|
1071
|
-
const newRow = {
|
|
1072
|
-
...row
|
|
1073
|
-
};
|
|
1074
|
-
newRow[column.key] = !row[column.key];
|
|
1075
|
-
onRowChange(newRow);
|
|
1076
|
-
};
|
|
1077
|
-
return /* @__PURE__ */ jsx(Checkbox, {
|
|
1078
|
-
size: "small",
|
|
1079
|
-
checked: row[column.key],
|
|
1080
|
-
onChange: handleChange
|
|
1081
|
-
});
|
|
1082
|
-
}
|
|
1083
|
-
function getRowsFromColumnsConfig(columnsConfig) {
|
|
1084
|
-
return columnsConfig.filter((column) => !column.hidden).map((column) => ({
|
|
1085
|
-
key: column.key,
|
|
1086
|
-
name: column.name,
|
|
1087
|
-
visible: column.visible === void 0 ? true : column.visible,
|
|
1088
|
-
frozen: column.frozen === void 0 ? false : column.frozen,
|
|
1089
|
-
originalIndex: column.orginalIndex,
|
|
1090
|
-
originalFrozen: column.originalFrozen,
|
|
1091
|
-
originalVisible: column.originalVisible
|
|
1092
|
-
}));
|
|
1093
|
-
}
|
|
1094
|
-
const ColumnsConfig = forwardRef((props, ref) => {
|
|
1095
|
-
const refdata_grid = useRef(null);
|
|
1096
|
-
const {
|
|
1097
|
-
onCloseSettings,
|
|
1098
|
-
columnsConfig,
|
|
1099
|
-
onChangeColumnsConfig
|
|
1100
|
-
} = props;
|
|
1101
|
-
const {
|
|
1102
|
-
getLabel
|
|
1103
|
-
} = useModuleDictionary();
|
|
1104
|
-
const [isInit, setIsInit] = useState(true);
|
|
1105
|
-
const [rows, setRows] = useState(getRowsFromColumnsConfig(columnsConfig));
|
|
1106
|
-
const [selRows, setSelRows] = useState(() => /* @__PURE__ */ new Set());
|
|
1107
|
-
const divRef = useRef(null);
|
|
1108
|
-
const {
|
|
1109
|
-
host_static_assets,
|
|
1110
|
-
environment_assets
|
|
1111
|
-
} = useEnvironment();
|
|
1112
|
-
useImperativeHandle(ref, () => ({
|
|
1113
|
-
onClickIntro: handleIntro,
|
|
1114
|
-
current: divRef.current
|
|
1115
|
-
}));
|
|
1116
|
-
const columnsdata_grid = useMemo(() => [{
|
|
1117
|
-
key: "name",
|
|
1118
|
-
name: getLabel("data_grid.settings_column_name"),
|
|
1119
|
-
width: 200,
|
|
1120
|
-
resizable: true,
|
|
1121
|
-
type: "string"
|
|
1122
|
-
}, {
|
|
1123
|
-
key: "originalIndex",
|
|
1124
|
-
name: getLabel("data_grid.settings_column_position"),
|
|
1125
|
-
width: 50,
|
|
1126
|
-
type: "number",
|
|
1127
|
-
cellClass: "rdg-cell-align-center"
|
|
1128
|
-
}, {
|
|
1129
|
-
key: "visible",
|
|
1130
|
-
name: getLabel("data_grid.settings_column_visible"),
|
|
1131
|
-
width: 80,
|
|
1132
|
-
type: "boolean",
|
|
1133
|
-
formatter: FormatterColumn,
|
|
1134
|
-
cellClass: "rdg-cell-align-center"
|
|
1135
|
-
}, {
|
|
1136
|
-
key: "frozen",
|
|
1137
|
-
name: getLabel("data_grid.settings_column_frozen"),
|
|
1138
|
-
width: 80,
|
|
1139
|
-
type: "boolean",
|
|
1140
|
-
formatter: FormatterColumn,
|
|
1141
|
-
cellClass: "rdg-cell-align-center"
|
|
1142
|
-
}], [getLabel]);
|
|
1143
|
-
const checkAll = () => {
|
|
1144
|
-
setRows(rows.map((row) => ({
|
|
1145
|
-
...row,
|
|
1146
|
-
visible: true
|
|
1147
|
-
})));
|
|
1148
|
-
};
|
|
1149
|
-
const unCheckAll = () => {
|
|
1150
|
-
setRows(rows.map((row) => ({
|
|
1151
|
-
...row,
|
|
1152
|
-
visible: false
|
|
1153
|
-
})));
|
|
1154
|
-
};
|
|
1155
|
-
const restoreAll = () => {
|
|
1156
|
-
setRows(rows.map((row) => ({
|
|
1157
|
-
...row,
|
|
1158
|
-
visible: row.originalVisible,
|
|
1159
|
-
frozen: row.originalFrozen,
|
|
1160
|
-
index: row.originalIndex
|
|
1161
|
-
})).sort((a, b) => a.index - b.index));
|
|
1162
|
-
};
|
|
1163
|
-
useEffect(() => {
|
|
1164
|
-
if (isInit === false) {
|
|
1165
|
-
setRows(getRowsFromColumnsConfig(columnsConfig));
|
|
1166
|
-
}
|
|
1167
|
-
setIsInit(false);
|
|
1168
|
-
}, [columnsConfig]);
|
|
1169
|
-
const rowSelectedIndex = useMemo(() => {
|
|
1170
|
-
let rowIndex = -1;
|
|
1171
|
-
if (selRows.size !== 1)
|
|
1172
|
-
return rowIndex;
|
|
1173
|
-
const iterator = selRows.entries();
|
|
1174
|
-
const entry = iterator.next().value[1];
|
|
1175
|
-
rowIndex = rows.findIndex((row) => row.key === entry);
|
|
1176
|
-
return rowIndex;
|
|
1177
|
-
}, [rows, selRows]);
|
|
1178
|
-
const handleMoveFirst = () => {
|
|
1179
|
-
if (rowSelectedIndex === -1)
|
|
1180
|
-
return -1;
|
|
1181
|
-
const newRows = [...rows];
|
|
1182
|
-
newRows.splice(rowSelectedIndex, 1);
|
|
1183
|
-
newRows.splice(0, 0, rows[rowSelectedIndex]);
|
|
1184
|
-
refdata_grid.current?.selectCell({
|
|
1185
|
-
idx: 0,
|
|
1186
|
-
rowIdx: 0
|
|
1187
|
-
});
|
|
1188
|
-
setRows(newRows);
|
|
1189
|
-
};
|
|
1190
|
-
const handleMoveLast = () => {
|
|
1191
|
-
if (rowSelectedIndex === -1)
|
|
1192
|
-
return -1;
|
|
1193
|
-
const newRows = [...rows];
|
|
1194
|
-
newRows.splice(rowSelectedIndex, 1);
|
|
1195
|
-
newRows.splice(newRows.length, 0, rows[rowSelectedIndex]);
|
|
1196
|
-
refdata_grid.current?.selectCell({
|
|
1197
|
-
idx: 0,
|
|
1198
|
-
rowIdx: newRows.length - 1
|
|
1199
|
-
});
|
|
1200
|
-
setRows(newRows);
|
|
1201
|
-
};
|
|
1202
|
-
const handleMoveUpDownd = (position) => {
|
|
1203
|
-
if (rowSelectedIndex === -1)
|
|
1204
|
-
return -1;
|
|
1205
|
-
const newRows = [...rows];
|
|
1206
|
-
const element = newRows[rowSelectedIndex];
|
|
1207
|
-
newRows.splice(rowSelectedIndex, 1);
|
|
1208
|
-
newRows.splice(rowSelectedIndex + position, 0, element);
|
|
1209
|
-
refdata_grid.current?.selectCell({
|
|
1210
|
-
idx: 0,
|
|
1211
|
-
rowIdx: rowSelectedIndex + position
|
|
1212
|
-
});
|
|
1213
|
-
setRows(newRows);
|
|
1214
|
-
};
|
|
1215
|
-
const getColumnConfigByKey2 = (key) => {
|
|
1216
|
-
const rowIndexFinded = rows.findIndex((row) => row.key === key);
|
|
1217
|
-
if (rowIndexFinded > -1) {
|
|
1218
|
-
return {
|
|
1219
|
-
visible: rows[rowIndexFinded].visible,
|
|
1220
|
-
frozen: rows[rowIndexFinded].frozen
|
|
1221
|
-
};
|
|
1222
|
-
}
|
|
1223
|
-
return void 0;
|
|
1224
|
-
};
|
|
1225
|
-
const getRowIndex = (column) => {
|
|
1226
|
-
const rowIndexFinded = rows.findIndex((row) => row.key === column.key);
|
|
1227
|
-
if (rowIndexFinded > -1) {
|
|
1228
|
-
return rowIndexFinded;
|
|
1229
|
-
}
|
|
1230
|
-
return columnsConfig.findIndex((columnConfig) => columnConfig.key === column.key);
|
|
1231
|
-
};
|
|
1232
|
-
const handleIntro = () => {
|
|
1233
|
-
const newColumnsConfig = columnsConfig.map((columnConfig) => {
|
|
1234
|
-
const newColumnConfig = {
|
|
1235
|
-
...columnConfig
|
|
1236
|
-
};
|
|
1237
|
-
if (!columnConfig.hidden) {
|
|
1238
|
-
const columnConfigRow = getColumnConfigByKey2(columnConfig.key);
|
|
1239
|
-
if (columnConfigRow) {
|
|
1240
|
-
newColumnConfig.visible = columnConfigRow.visible;
|
|
1241
|
-
newColumnConfig.frozen = columnConfigRow.frozen;
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
return newColumnConfig;
|
|
1245
|
-
}).sort((a, b) => getRowIndex(a) - getRowIndex(b));
|
|
1246
|
-
onChangeColumnsConfig(newColumnsConfig);
|
|
1247
|
-
onCloseSettings();
|
|
1248
|
-
};
|
|
1249
|
-
const onInternalSelectedRowsChange = () => {
|
|
1250
|
-
};
|
|
1251
|
-
const onInternalRowsChange = (newRows) => {
|
|
1252
|
-
setRows(newRows);
|
|
1253
|
-
};
|
|
1254
|
-
const onRowClick = (row) => {
|
|
1255
|
-
if (selRows.has(row.key))
|
|
1256
|
-
return;
|
|
1257
|
-
const mySet = /* @__PURE__ */ new Set([row.key]);
|
|
1258
|
-
setSelRows(mySet);
|
|
1259
|
-
};
|
|
1260
|
-
return /* @__PURE__ */ jsxs(WrapperColumnsConfig, {
|
|
1261
|
-
id: "WrapperColumnsConfig",
|
|
1262
|
-
ref: divRef,
|
|
1263
|
-
children: [/* @__PURE__ */ jsx(DivSelColumns, {
|
|
1264
|
-
id: "divInfo",
|
|
1265
|
-
children: getLabel("data_grid.settings_sel_columns")
|
|
1266
|
-
}), /* @__PURE__ */ jsx(WrapperDataGrid, {
|
|
1267
|
-
id: "WrapperDataGrid",
|
|
1268
|
-
children: /* @__PURE__ */ jsx(OriginalDataGridWrapperStyled, {
|
|
1269
|
-
id: "Originaldata_gridWrapperStyled",
|
|
1270
|
-
children: /* @__PURE__ */ jsx(DataGrid$1, {
|
|
1271
|
-
className: "fill-data_grid rdg-light",
|
|
1272
|
-
ref: refdata_grid,
|
|
1273
|
-
columns: columnsdata_grid,
|
|
1274
|
-
rows,
|
|
1275
|
-
onRowsChange: onInternalRowsChange,
|
|
1276
|
-
selectedRows: selRows,
|
|
1277
|
-
onSelectedRowsChange: onInternalSelectedRowsChange,
|
|
1278
|
-
onRowClick,
|
|
1279
|
-
rowKeyGetter: (row) => row.key,
|
|
1280
|
-
cellNavigationMode: "CHANGE_ROW",
|
|
1281
|
-
defaultColumnOptions: {
|
|
1282
|
-
resizable: true,
|
|
1283
|
-
sortable: true
|
|
1284
|
-
}
|
|
1285
|
-
})
|
|
1286
|
-
})
|
|
1287
|
-
}), /* @__PURE__ */ jsxs(ColumnActions, {
|
|
1288
|
-
children: [/* @__PURE__ */ jsx(IconButton, {
|
|
1289
|
-
dictionaryTooltip: "data_grid.settings_move_first",
|
|
1290
|
-
onClick: handleMoveFirst,
|
|
1291
|
-
"aria-label": "move first place",
|
|
1292
|
-
disabled: rowSelectedIndex < 1,
|
|
1293
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/move_first_place.svg`
|
|
1294
|
-
}), /* @__PURE__ */ jsx(IconButton, {
|
|
1295
|
-
dictionaryTooltip: "data_grid.settings_move_up",
|
|
1296
|
-
onClick: () => handleMoveUpDownd(-1),
|
|
1297
|
-
"aria-label": "move up place",
|
|
1298
|
-
disabled: rowSelectedIndex < 1,
|
|
1299
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/move_up_place.svg`
|
|
1300
|
-
}), /* @__PURE__ */ jsx(IconButton, {
|
|
1301
|
-
dictionaryTooltip: "data_grid.settings_move_last",
|
|
1302
|
-
onClick: handleMoveLast,
|
|
1303
|
-
"aria-label": "move last place",
|
|
1304
|
-
disabled: !!(rowSelectedIndex === rows.length - 1 || rowSelectedIndex === -1),
|
|
1305
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/move_last_place.svg`
|
|
1306
|
-
}), /* @__PURE__ */ jsx(IconButton, {
|
|
1307
|
-
dictionaryTooltip: "data_grid.settings_move_down",
|
|
1308
|
-
onClick: () => handleMoveUpDownd(1),
|
|
1309
|
-
"aria-label": "move down place",
|
|
1310
|
-
disabled: !!(rowSelectedIndex === rows.length - 1 || rowSelectedIndex === -1),
|
|
1311
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/move_down_place.svg`
|
|
1312
|
-
}), /* @__PURE__ */ jsx(IconButton, {
|
|
1313
|
-
dictionaryTooltip: "data_grid.settings_visible_all",
|
|
1314
|
-
onClick: checkAll,
|
|
1315
|
-
"aria-label": "check visible all",
|
|
1316
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/check_all.svg`
|
|
1317
|
-
}), /* @__PURE__ */ jsx(IconButton, {
|
|
1318
|
-
dictionaryTooltip: "data_grid.settings_no_visible_all",
|
|
1319
|
-
onClick: unCheckAll,
|
|
1320
|
-
"aria-label": "un check all",
|
|
1321
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/uncheck_all.svg`
|
|
1322
|
-
}), /* @__PURE__ */ jsx(IconButton, {
|
|
1323
|
-
dictionaryTooltip: "data_grid.settings_restore",
|
|
1324
|
-
onClick: restoreAll,
|
|
1325
|
-
"aria-label": "Restore columns",
|
|
1326
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/restore_columns.svg`
|
|
1327
|
-
})]
|
|
1328
|
-
})]
|
|
1329
|
-
});
|
|
1330
|
-
});
|
|
1331
|
-
ColumnsConfig.displayName = "ColumnsConfig";
|
|
1332
|
-
const SKTWrapperColumnsSettings = styled("div")(({ theme }) => ({
|
|
1333
|
-
display: "flex",
|
|
1334
|
-
justifyContent: "center",
|
|
1335
|
-
alignItems: "center",
|
|
1336
|
-
minWidth: theme.spacing(3.75),
|
|
1337
|
-
height: theme.spacing(3.75)
|
|
1338
|
-
}));
|
|
1339
|
-
function Settings() {
|
|
1340
|
-
const {
|
|
1341
|
-
openModal,
|
|
1342
|
-
closeModal
|
|
1343
|
-
} = useModal();
|
|
1344
|
-
const {
|
|
1345
|
-
columnsConfig,
|
|
1346
|
-
onChangeColumnsConfig
|
|
1347
|
-
} = useDataGrid();
|
|
1348
|
-
const {
|
|
1349
|
-
getLabel
|
|
1350
|
-
} = useModuleDictionary();
|
|
1351
|
-
const {
|
|
1352
|
-
host_static_assets,
|
|
1353
|
-
environment_assets
|
|
1354
|
-
} = useEnvironment();
|
|
1355
|
-
const isSkeleton = useModuleSkeleton();
|
|
1356
|
-
const ref = useRef(null);
|
|
1357
|
-
const onCloseSettings = useCallback(() => {
|
|
1358
|
-
closeModal();
|
|
1359
|
-
}, [closeModal]);
|
|
1360
|
-
const onClickIntro = useCallback(() => {
|
|
1361
|
-
if (ref.current?.onClickIntro) {
|
|
1362
|
-
ref.current?.onClickIntro();
|
|
1363
|
-
}
|
|
1364
|
-
}, []);
|
|
1365
|
-
const onClickSettings = useCallback(() => {
|
|
1366
|
-
openModal({
|
|
1367
|
-
initialWidth: 500,
|
|
1368
|
-
initialHeigth: 680,
|
|
1369
|
-
window: /* @__PURE__ */ jsxs(WindowBase, {
|
|
1370
|
-
title: getLabel("data_grid.settings_title"),
|
|
1371
|
-
children: [/* @__PURE__ */ jsx(ColumnsConfig, {
|
|
1372
|
-
ref,
|
|
1373
|
-
columnsConfig,
|
|
1374
|
-
onChangeColumnsConfig,
|
|
1375
|
-
onCloseSettings
|
|
1376
|
-
}), /* @__PURE__ */ jsxs(Actions$1, {
|
|
1377
|
-
children: [/* @__PURE__ */ jsx(ActionCancel, {
|
|
1378
|
-
onClick: closeModal
|
|
1379
|
-
}), /* @__PURE__ */ jsx(ActionIntro, {
|
|
1380
|
-
onClick: onClickIntro
|
|
1381
|
-
})]
|
|
1382
|
-
})]
|
|
1383
|
-
})
|
|
1384
|
-
});
|
|
1385
|
-
}, [closeModal, columnsConfig, getLabel, onChangeColumnsConfig, onCloseSettings, openModal, onClickIntro]);
|
|
1386
|
-
if (isSkeleton) {
|
|
1387
|
-
return /* @__PURE__ */ jsx(SKTWrapperColumnsSettings, {
|
|
1388
|
-
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
1389
|
-
variant: "circular",
|
|
1390
|
-
width: 20,
|
|
1391
|
-
height: 20
|
|
1392
|
-
})
|
|
1393
|
-
});
|
|
1394
|
-
}
|
|
1395
|
-
return /* @__PURE__ */ jsx(IconButton, {
|
|
1396
|
-
dictionaryTooltip: "data_grid.tooltip_settings",
|
|
1397
|
-
onClick: onClickSettings,
|
|
1398
|
-
"aria-label": "settings",
|
|
1399
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/configuration.svg`
|
|
1400
|
-
});
|
|
1401
|
-
}
|
|
1402
|
-
const Container = styled("div")(() => ({
|
|
1403
|
-
display: "flex",
|
|
1404
|
-
alignItems: "center"
|
|
1405
|
-
}));
|
|
1406
|
-
const RowsLabel = styled("span")(() => ({}));
|
|
1407
|
-
const InsetLabel = styled("span")(({ theme }) => ({
|
|
1408
|
-
marginLeft: theme.spacing(2),
|
|
1409
|
-
paddingTop: "2px",
|
|
1410
|
-
paddingBottom: "2px",
|
|
1411
|
-
paddingLeft: "4px",
|
|
1412
|
-
paddingRight: "4px",
|
|
1413
|
-
border: `1px solid ${theme.palette.divider}`
|
|
1414
|
-
}));
|
|
1415
|
-
function RowsCount() {
|
|
1416
|
-
const {
|
|
1417
|
-
rowsCount
|
|
1418
|
-
} = useDataGrid();
|
|
1419
|
-
const {
|
|
1420
|
-
getLabel
|
|
1421
|
-
} = useModuleDictionary();
|
|
1422
|
-
const isSkeleton = useModuleSkeleton();
|
|
1423
|
-
if (isSkeleton) {
|
|
1424
|
-
return /* @__PURE__ */ jsxs(Container, {
|
|
1425
|
-
children: [/* @__PURE__ */ jsx(RowsLabel, {
|
|
1426
|
-
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
1427
|
-
variant: "text",
|
|
1428
|
-
width: "40px",
|
|
1429
|
-
height: "16px"
|
|
1430
|
-
})
|
|
1431
|
-
}), /* @__PURE__ */ jsx(InsetLabel, {
|
|
1432
|
-
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
1433
|
-
variant: "text",
|
|
1434
|
-
width: "20px",
|
|
1435
|
-
height: "16px"
|
|
1436
|
-
})
|
|
1437
|
-
})]
|
|
1438
|
-
});
|
|
1439
|
-
}
|
|
1440
|
-
return /* @__PURE__ */ jsxs(Container, {
|
|
1441
|
-
className: "rows-count",
|
|
1442
|
-
id: "RowsCount",
|
|
1443
|
-
children: [/* @__PURE__ */ jsx(RowsLabel, {
|
|
1444
|
-
children: getLabel("data_grid.rows")
|
|
1445
|
-
}), /* @__PURE__ */ jsx(InsetLabel, {
|
|
1446
|
-
children: rowsCount
|
|
1447
|
-
})]
|
|
1448
|
-
});
|
|
1449
|
-
}
|
|
1450
|
-
const WrapperDensity = styled("div")(({ theme }) => ({
|
|
1451
|
-
marginLeft: 0,
|
|
1452
|
-
[theme.breakpoints.up("sm")]: {
|
|
1453
|
-
marginLeft: theme.spacing(3)
|
|
1454
|
-
}
|
|
1455
|
-
}));
|
|
1456
|
-
const SKTWrapperDensity = styled("div")(({ theme }) => ({
|
|
1457
|
-
display: "flex",
|
|
1458
|
-
justifyContent: "center",
|
|
1459
|
-
alignItems: "center",
|
|
1460
|
-
minWidth: theme.spacing(3.75),
|
|
1461
|
-
height: theme.spacing(3.75)
|
|
1462
|
-
}));
|
|
1463
|
-
function Density() {
|
|
1464
|
-
const {
|
|
1465
|
-
host_static_assets,
|
|
1466
|
-
environment_assets
|
|
1467
|
-
} = useEnvironment();
|
|
1468
|
-
const {
|
|
1469
|
-
rowHeights,
|
|
1470
|
-
currentRowHeightVariant,
|
|
1471
|
-
setRowHeightVariant
|
|
1472
|
-
} = useDataGrid();
|
|
1473
|
-
const {
|
|
1474
|
-
getLabel
|
|
1475
|
-
} = useModuleDictionary();
|
|
1476
|
-
const isSkeleton = useModuleSkeleton();
|
|
1477
|
-
const menuActions = useMemo(() => {
|
|
1478
|
-
if (typeof rowHeights === "number") {
|
|
1479
|
-
return [];
|
|
1480
|
-
}
|
|
1481
|
-
return [{
|
|
1482
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/compact.svg`,
|
|
1483
|
-
onClick: () => setRowHeightVariant("compact"),
|
|
1484
|
-
disabled: currentRowHeightVariant === "compact",
|
|
1485
|
-
dictionaryField: "data_grid.density_compact"
|
|
1486
|
-
}, {
|
|
1487
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/standard.svg`,
|
|
1488
|
-
onClick: () => setRowHeightVariant("standard"),
|
|
1489
|
-
disabled: currentRowHeightVariant === "standard",
|
|
1490
|
-
dictionaryField: "data_grid.density_standard"
|
|
1491
|
-
}, {
|
|
1492
|
-
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/confortable.svg`,
|
|
1493
|
-
onClick: () => setRowHeightVariant("confortable"),
|
|
1494
|
-
disabled: currentRowHeightVariant === "confortable",
|
|
1495
|
-
dictionaryField: "data_grid.density_confortable"
|
|
1496
|
-
}];
|
|
1497
|
-
}, [rowHeights, currentRowHeightVariant, setRowHeightVariant, host_static_assets, environment_assets]);
|
|
1498
|
-
const currenViewIcon = useMemo(() => {
|
|
1499
|
-
if (currentRowHeightVariant === "compact") {
|
|
1500
|
-
return `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/compact.svg`;
|
|
1501
|
-
}
|
|
1502
|
-
if (currentRowHeightVariant === "standard") {
|
|
1503
|
-
return `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/standard.svg`;
|
|
1504
|
-
}
|
|
1505
|
-
return `${host_static_assets}/${environment_assets}/frontend/components/data_grid/assets/icons/confortable.svg`;
|
|
1506
|
-
}, [currentRowHeightVariant, host_static_assets, environment_assets]);
|
|
1507
|
-
if (menuActions.length === 0) {
|
|
1508
|
-
return /* @__PURE__ */ jsx(Fragment, {});
|
|
1509
|
-
}
|
|
1510
|
-
if (isSkeleton) {
|
|
1511
|
-
return /* @__PURE__ */ jsx(SKTWrapperDensity, {
|
|
1512
|
-
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
1513
|
-
variant: "circular",
|
|
1514
|
-
width: "20px",
|
|
1515
|
-
height: "20px"
|
|
1516
|
-
})
|
|
1517
|
-
});
|
|
1518
|
-
}
|
|
1519
|
-
return /* @__PURE__ */ jsx(WrapperDensity, {
|
|
1520
|
-
id: "WrapperDensity",
|
|
1521
|
-
children: /* @__PURE__ */ jsx(MenuActions, {
|
|
1522
|
-
arrowType: "right-top",
|
|
1523
|
-
anchorOrigin: {
|
|
1524
|
-
vertical: "top",
|
|
1525
|
-
horizontal: "left"
|
|
1526
|
-
},
|
|
1527
|
-
transformOrigin: {
|
|
1528
|
-
vertical: "top",
|
|
1529
|
-
horizontal: "right"
|
|
1530
|
-
},
|
|
1531
|
-
menuActions,
|
|
1532
|
-
url_icon: currenViewIcon,
|
|
1533
|
-
toolTip: getLabel("data_grid.tooltip_density")
|
|
1534
|
-
})
|
|
1535
|
-
});
|
|
1536
|
-
}
|
|
1537
|
-
const WrapperActions = styled("div")(({ theme }) => ({
|
|
1538
|
-
...theme.typography.caption,
|
|
1539
|
-
position: "absolute",
|
|
1540
|
-
left: "0px",
|
|
1541
|
-
right: "0px",
|
|
1542
|
-
top: "0px",
|
|
1543
|
-
height: theme.spacing(5.5),
|
|
1544
|
-
padding: 0,
|
|
1545
|
-
display: "flex",
|
|
1546
|
-
flexDirection: "row",
|
|
1547
|
-
alignItems: "center",
|
|
1548
|
-
justifyContent: "flex-end",
|
|
1549
|
-
[theme.breakpoints.up("sm")]: {
|
|
1550
|
-
padding: theme.spacing(0, 1.5)
|
|
1551
|
-
},
|
|
1552
|
-
"&.with-no-pager .rows-count": {
|
|
1553
|
-
flexGrow: 1
|
|
1554
|
-
},
|
|
1555
|
-
"& .MuiTablePagination-root": {
|
|
1556
|
-
flexGrow: 1,
|
|
1557
|
-
display: "flex",
|
|
1558
|
-
justifyContent: "center",
|
|
1559
|
-
overflow: "hidden"
|
|
1560
|
-
}
|
|
1561
|
-
}));
|
|
1562
|
-
function Actions(props) {
|
|
1563
|
-
const isDesktop = useResponsiveDesktop();
|
|
1564
|
-
const {
|
|
1565
|
-
rowHeights
|
|
1566
|
-
} = useDataGrid();
|
|
1567
|
-
const isSkeleton = useModuleSkeleton();
|
|
1568
|
-
const {
|
|
1569
|
-
withRowsCount = true,
|
|
1570
|
-
withPager = true,
|
|
1571
|
-
pagerOptions,
|
|
1572
|
-
withSettings = true,
|
|
1573
|
-
settingsProps,
|
|
1574
|
-
withLocalFilters
|
|
1575
|
-
} = props;
|
|
1576
|
-
return /* @__PURE__ */ jsxs(WrapperActions, {
|
|
1577
|
-
id: "WrapperActions",
|
|
1578
|
-
className: withPager && pagerOptions ? "with-pager" : "with-no-pager",
|
|
1579
|
-
children: [withRowsCount && isDesktop && /* @__PURE__ */ jsx(RowsCount, {}), withPager && pagerOptions && /* @__PURE__ */ jsx(Pager, {
|
|
1580
|
-
...pagerOptions,
|
|
1581
|
-
totalRecords: pagerOptions.totalRecords,
|
|
1582
|
-
isSkeleton,
|
|
1583
|
-
isDesktop
|
|
1584
|
-
}), typeof rowHeights !== "number" && /* @__PURE__ */ jsx(Density, {}), withLocalFilters && /* @__PURE__ */ jsx(Filter, {}), withSettings && /* @__PURE__ */ jsx(Settings, {
|
|
1585
|
-
...settingsProps
|
|
1586
|
-
})]
|
|
1587
|
-
});
|
|
1588
|
-
}
|
|
1589
|
-
function DataGrid(props) {
|
|
1590
|
-
const {
|
|
1591
|
-
id,
|
|
1592
|
-
withActions = true,
|
|
1593
|
-
rows,
|
|
1594
|
-
columns,
|
|
1595
|
-
actionsProps,
|
|
1596
|
-
selectedRows,
|
|
1597
|
-
onSelectedRowsChange,
|
|
1598
|
-
rowKeyGetter,
|
|
1599
|
-
rowActionsGetter,
|
|
1600
|
-
onRowsChange,
|
|
1601
|
-
rowHeaderHeights,
|
|
1602
|
-
rowHeights,
|
|
1603
|
-
initialRowHeightVariant,
|
|
1604
|
-
checkedRows,
|
|
1605
|
-
onCheckedRowsChange
|
|
1606
|
-
} = props;
|
|
1607
|
-
return /* @__PURE__ */ jsx(WrapperGrid, {
|
|
1608
|
-
id: `WrapperGrid_${props.id}`,
|
|
1609
|
-
children: /* @__PURE__ */ jsx(DataGridProvider, {
|
|
1610
|
-
id: props.id,
|
|
1611
|
-
columns: props.columns,
|
|
1612
|
-
rowHeights,
|
|
1613
|
-
rowHeaderHeights,
|
|
1614
|
-
initialRowHeightVariant,
|
|
1615
|
-
rowsCount: rows.length,
|
|
1616
|
-
rowActionsGetter,
|
|
1617
|
-
checkedRows,
|
|
1618
|
-
onCheckedRowsChange,
|
|
1619
|
-
rowKeyGetter,
|
|
1620
|
-
rows,
|
|
1621
|
-
children: /* @__PURE__ */ jsxs(FilterProvider, {
|
|
1622
|
-
initialActiveFilters: false,
|
|
1623
|
-
children: [withActions && actionsProps && /* @__PURE__ */ jsx(Actions, {
|
|
1624
|
-
...actionsProps
|
|
1625
|
-
}), /* @__PURE__ */ jsx(Table, {
|
|
1626
|
-
id,
|
|
1627
|
-
withActions,
|
|
1628
|
-
columns,
|
|
1629
|
-
rows,
|
|
1630
|
-
selectedRows,
|
|
1631
|
-
onSelectedRowsChange,
|
|
1632
|
-
rowKeyGetter,
|
|
1633
|
-
onRowsChange
|
|
1634
|
-
})]
|
|
1635
|
-
})
|
|
1636
|
-
})
|
|
1637
|
-
});
|
|
1638
|
-
}
|
|
1639
|
-
function columnBooleanFormatter(props) {
|
|
1640
|
-
const {
|
|
1641
|
-
fieldValue,
|
|
1642
|
-
presentationType,
|
|
1643
|
-
Component
|
|
1644
|
-
} = props;
|
|
1645
|
-
return (obProps) => {
|
|
1646
|
-
return /* @__PURE__ */ jsx(BooleanFormatter, {
|
|
1647
|
-
presentationType,
|
|
1648
|
-
value: getPropertyByString(obProps, fieldValue),
|
|
1649
|
-
Component
|
|
1650
|
-
});
|
|
1651
|
-
};
|
|
1652
|
-
}
|
|
1653
|
-
function columnDateFormatter(props) {
|
|
1654
|
-
const {
|
|
1655
|
-
fieldValue,
|
|
1656
|
-
presentationType,
|
|
1657
|
-
Component
|
|
1658
|
-
} = props;
|
|
1659
|
-
return (obProps) => {
|
|
1660
|
-
return /* @__PURE__ */ jsx(DateFormatter, {
|
|
1661
|
-
presentationType,
|
|
1662
|
-
value: getPropertyByString(obProps, fieldValue),
|
|
1663
|
-
Component
|
|
1664
|
-
});
|
|
1665
|
-
};
|
|
1666
|
-
}
|
|
1667
|
-
function getDataGridComponentsDictionary() {
|
|
1668
|
-
return ["data_grid"].concat(getPagerComponentsDictionary()).concat(getModalDialogComponentsDictionary());
|
|
1669
|
-
}
|
|
1670
|
-
({
|
|
1671
|
-
grid: {
|
|
1672
|
-
actions: "Actions",
|
|
1673
|
-
settings_tooltip: "Settings",
|
|
1674
|
-
settings_sel_columns: "Select columns",
|
|
1675
|
-
settings_column_name: "Name",
|
|
1676
|
-
settings_column_position: "Position",
|
|
1677
|
-
settings_column_visible: "Visible",
|
|
1678
|
-
settings_column_frozen: "Frozen",
|
|
1679
|
-
settings_move_first: "Move first",
|
|
1680
|
-
settings_move_up: "Move up",
|
|
1681
|
-
settings_move_last: "Move first",
|
|
1682
|
-
settings_move_down: "Move down",
|
|
1683
|
-
settings_visible_all: "Visible all",
|
|
1684
|
-
settings_no_visible_all: "Invisible all",
|
|
1685
|
-
settings_restore: "Restore",
|
|
1686
|
-
density_tooltip: "Density",
|
|
1687
|
-
density_compact: "Compact",
|
|
1688
|
-
density_standard: "Standard",
|
|
1689
|
-
density_confortable: "Confortable",
|
|
1690
|
-
filter_holder: "Filter",
|
|
1691
|
-
filter_show: "Show filters",
|
|
1692
|
-
filter_hide: "Hide filters",
|
|
1693
|
-
rows: "Rows",
|
|
1694
|
-
rows_per_page: "Rows per page"
|
|
1695
|
-
},
|
|
1696
|
-
...defaultPagerDictionary,
|
|
1697
|
-
...defaultModalDialogDictionary
|
|
1698
|
-
});
|
|
1699
|
-
const Input = styled("input")(() => ({
|
|
1700
|
-
appearance: "none",
|
|
1701
|
-
boxSizing: "border-box",
|
|
1702
|
-
inlineSize: "100%",
|
|
1703
|
-
blockSize: "100%",
|
|
1704
|
-
paddingBlock: "0",
|
|
1705
|
-
verticalAlign: "top",
|
|
1706
|
-
textAlign: "right",
|
|
1707
|
-
color: "var(--rdg-color)",
|
|
1708
|
-
backgroundColor: "var(--rdg-background-color)",
|
|
1709
|
-
fontFamily: "inherit",
|
|
1710
|
-
"&:focus": {
|
|
1711
|
-
outline: "none"
|
|
1712
|
-
},
|
|
1713
|
-
"&::placeholder": {
|
|
1714
|
-
color: "#999",
|
|
1715
|
-
opacity: "1"
|
|
1716
|
-
}
|
|
1717
|
-
}));
|
|
1718
|
-
function autoFocusAndSelect(input) {
|
|
1719
|
-
input?.focus();
|
|
1720
|
-
input?.select();
|
|
1721
|
-
}
|
|
1722
|
-
function TextEditor({
|
|
1723
|
-
row,
|
|
1724
|
-
column,
|
|
1725
|
-
onRowChange,
|
|
1726
|
-
onClose
|
|
1727
|
-
}) {
|
|
1728
|
-
return /* @__PURE__ */ jsx(Input, {
|
|
1729
|
-
className: "rdg-text-editor",
|
|
1730
|
-
ref: autoFocusAndSelect,
|
|
1731
|
-
value: row[column.key],
|
|
1732
|
-
onChange: (event) => onRowChange({
|
|
1733
|
-
...row,
|
|
1734
|
-
[column.key]: event.target.value
|
|
1735
|
-
}),
|
|
1736
|
-
onBlur: () => onClose(true)
|
|
1737
|
-
});
|
|
1738
|
-
}
|
|
1739
|
-
function NumberEditor({
|
|
1740
|
-
row,
|
|
1741
|
-
column,
|
|
1742
|
-
onRowChange,
|
|
1743
|
-
onClose
|
|
1744
|
-
}) {
|
|
1745
|
-
return /* @__PURE__ */ jsx(Input, {
|
|
1746
|
-
className: "rdg-text-editor",
|
|
1747
|
-
ref: autoFocusAndSelect,
|
|
1748
|
-
type: "number",
|
|
1749
|
-
value: row[column.key],
|
|
1750
|
-
onChange: (event) => onRowChange({
|
|
1751
|
-
...row,
|
|
1752
|
-
[column.key]: event.target.value !== "" ? Number(event.target.value) : ""
|
|
1753
|
-
}),
|
|
1754
|
-
onBlur: () => onClose(true)
|
|
1755
|
-
});
|
|
1756
|
-
}
|
|
1757
|
-
const getDataGridRowsFromSet = (set, rows, rowKeyGetter) => {
|
|
1758
|
-
const rowsFinded = [];
|
|
1759
|
-
if (set) {
|
|
1760
|
-
if (set.size > 0) {
|
|
1761
|
-
const iterator = set.entries();
|
|
1762
|
-
for (let i = 0; i < set.size; i++) {
|
|
1763
|
-
const entry = iterator.next().value;
|
|
1764
|
-
const key = entry[1];
|
|
1765
|
-
const row = rows.find((frow) => rowKeyGetter(frow) === key);
|
|
1766
|
-
if (row) {
|
|
1767
|
-
rowsFinded.push(row);
|
|
1768
|
-
}
|
|
1769
|
-
}
|
|
1770
|
-
}
|
|
1771
|
-
}
|
|
1772
|
-
return rowsFinded;
|
|
1773
|
-
};
|
|
1774
|
-
export {
|
|
1775
|
-
DataGrid as D,
|
|
1776
|
-
NumberEditor as N,
|
|
1777
|
-
TextEditor as T,
|
|
1778
|
-
getDataGridRowsFromSet as a,
|
|
1779
|
-
columnDateFormatter as b,
|
|
1780
|
-
columnBooleanFormatter as c,
|
|
1781
|
-
getDataGridComponentsDictionary as g
|
|
1782
|
-
};
|