@astral/ui 4.73.1 → 4.75.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/CardGridInfinite/CardGridInfinite.js +11 -2
- package/components/CardGridInfinite/styles.js +4 -0
- package/components/CardGridInfinite/useLogic/useLogic.d.ts +1 -1
- package/components/CardGridInfinite/useLogic/useLogic.js +3 -13
- package/components/Chevron/Chevron.d.ts +1 -1
- package/components/ConfirmAction/ConfirmAction.js +3 -3
- package/components/ConfirmAction/constants.d.ts +1 -0
- package/components/ConfirmAction/constants.js +1 -0
- package/components/ConfirmAction/styles.js +13 -0
- package/components/ConfirmAction/types.d.ts +1 -1
- package/components/DataGrid/Body/Body.d.ts +1 -1
- package/components/DataGrid/Body/Body.js +5 -3
- package/components/DataGrid/Body/types.d.ts +5 -0
- package/components/DataGrid/Cell/Cell.d.ts +9 -1
- package/components/DataGrid/Cell/Cell.js +16 -2
- package/components/DataGrid/CustomRowWrapper/CustomRowWrapper.d.ts +19 -0
- package/components/DataGrid/CustomRowWrapper/CustomRowWrapper.js +15 -0
- package/components/DataGrid/CustomRowWrapper/index.d.ts +1 -0
- package/components/DataGrid/CustomRowWrapper/index.js +1 -0
- package/components/DataGrid/DataGrid.js +14 -3
- package/components/DataGrid/DataGridContext/DataGridContext.d.ts +9 -5
- package/components/DataGrid/DataGridContext/DataGridContext.js +7 -4
- package/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.d.ts +3 -4
- package/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.js +18 -48
- package/components/DataGrid/DataGridStorageContext/DataGridStorageContext.d.ts +29 -0
- package/components/DataGrid/DataGridStorageContext/DataGridStorageContext.js +28 -0
- package/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/DataGridStorageProvider.d.ts +6 -0
- package/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/DataGridStorageProvider.js +12 -0
- package/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/index.d.ts +1 -0
- package/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/index.js +1 -0
- package/components/DataGrid/DataGridStorageContext/index.d.ts +2 -0
- package/components/DataGrid/DataGridStorageContext/index.js +2 -0
- package/components/DataGrid/MobileSkeleton/MobileSkeleton.d.ts +2 -1
- package/components/DataGrid/MobileSkeleton/MobileSkeleton.js +21 -3
- package/components/DataGrid/MobileSkeleton/styles.js +12 -0
- package/components/DataGrid/Row/NestedChildren/NestedChildren.d.ts +1 -5
- package/components/DataGrid/Row/NestedChildren/NestedChildren.js +17 -7
- package/components/DataGrid/Row/NestedChildren/constants.d.ts +6 -0
- package/components/DataGrid/Row/NestedChildren/constants.js +7 -0
- package/components/DataGrid/Row/NestedChildren/styles.js +42 -3
- package/components/DataGrid/Row/NestedChildren/useLogic/useLogic.d.ts +1 -1
- package/components/DataGrid/Row/NestedChildren/useLogic/useLogic.js +4 -6
- package/components/DataGrid/Row/Row.js +34 -37
- package/components/DataGrid/Row/RowContext/RowContext.d.ts +10 -1
- package/components/DataGrid/Row/RowContext/RowContext.js +9 -0
- package/components/DataGrid/Row/RowContext/RowProvider/RowProvider.d.ts +3 -2
- package/components/DataGrid/Row/RowContext/RowProvider/RowProvider.js +25 -2
- package/components/DataGrid/Row/constants.d.ts +6 -0
- package/components/DataGrid/Row/constants.js +6 -0
- package/components/DataGrid/Row/styles.js +102 -3
- package/components/DataGrid/Row/useLogic/hooks/useMobileLogic.d.ts +1 -0
- package/components/DataGrid/Row/useLogic/hooks/useMobileLogic.js +1 -1
- package/components/DataGrid/Row/useLogic/useLogic.d.ts +5 -2
- package/components/DataGrid/Row/useLogic/useLogic.js +21 -19
- package/components/DataGrid/RowBase/GroupCell/GroupCell.d.ts +2 -0
- package/components/DataGrid/RowBase/GroupCell/GroupCell.js +22 -0
- package/components/DataGrid/RowBase/GroupCell/constants.d.ts +4 -0
- package/components/DataGrid/RowBase/GroupCell/constants.js +5 -0
- package/components/DataGrid/RowBase/GroupCell/index.d.ts +1 -0
- package/components/DataGrid/RowBase/GroupCell/index.js +1 -0
- package/components/DataGrid/RowBase/GroupCell/styles.d.ts +12 -0
- package/components/DataGrid/RowBase/GroupCell/styles.js +16 -0
- package/components/DataGrid/RowBase/GroupCell/types.d.ts +11 -0
- package/components/DataGrid/RowBase/GroupCell/types.js +1 -0
- package/components/DataGrid/RowBase/RowBase.d.ts +3 -0
- package/components/DataGrid/RowBase/RowBase.js +69 -0
- package/components/DataGrid/RowBase/constants.d.ts +9 -0
- package/components/DataGrid/RowBase/constants.js +10 -0
- package/components/DataGrid/RowBase/index.d.ts +3 -0
- package/components/DataGrid/RowBase/index.js +2 -0
- package/components/DataGrid/RowBase/styles.d.ts +17 -0
- package/components/DataGrid/RowBase/styles.js +87 -0
- package/components/DataGrid/RowBase/types.d.ts +92 -0
- package/components/DataGrid/RowBase/types.js +1 -0
- package/components/DataGrid/RowBase/useLogic/useLogic.d.ts +46 -0
- package/components/DataGrid/RowBase/useLogic/useLogic.js +90 -0
- package/components/DataGrid/constants.d.ts +8 -0
- package/components/DataGrid/constants.js +8 -0
- package/components/DataGrid/index.d.ts +3 -0
- package/components/DataGrid/index.js +3 -0
- package/components/DataGrid/styles.js +14 -0
- package/components/DataGrid/tests/performance/testDataGridPerformance.d.ts +21 -0
- package/components/DataGrid/tests/performance/testDataGridPerformance.js +102 -0
- package/components/DataGrid/types.d.ts +11 -0
- package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.d.ts +3 -1
- package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.js +2 -1
- package/components/DataGrid/useLogic/useLogic.d.ts +4 -1
- package/components/DataGrid/useLogic/useLogic.js +20 -7
- package/components/DataGridActionCell/DataGridMainActions/Action/MainIconButton/MainIconButton.js +4 -2
- package/components/DataGridActionCell/DataGridMainActions/Action/MobileMainButton/MobileMainButton.js +4 -2
- package/components/DataGridActionCell/types.d.ts +4 -0
- package/components/DataGridCollapsibleRow/DataGridCollapsibleRow.d.ts +2 -0
- package/components/DataGridCollapsibleRow/DataGridCollapsibleRow.js +29 -0
- package/components/DataGridCollapsibleRow/constants.d.ts +11 -0
- package/components/DataGridCollapsibleRow/constants.js +12 -0
- package/components/DataGridCollapsibleRow/index.d.ts +2 -0
- package/components/DataGridCollapsibleRow/index.js +1 -0
- package/components/DataGridCollapsibleRow/public.d.ts +2 -0
- package/components/DataGridCollapsibleRow/public.js +1 -0
- package/components/DataGridCollapsibleRow/styles.d.ts +42 -0
- package/components/DataGridCollapsibleRow/styles.js +99 -0
- package/components/DataGridCollapsibleRow/types.d.ts +19 -0
- package/components/DataGridCollapsibleRow/types.js +1 -0
- package/components/DataGridCollapsibleRow/useLogic/index.js +1 -0
- package/components/DataGridCollapsibleRow/useLogic/useLogic.d.ts +29 -0
- package/components/DataGridCollapsibleRow/useLogic/useLogic.js +62 -0
- package/components/DataGridInfinite/DataGridInfinite.js +37 -27
- package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContext.d.ts +23 -0
- package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContext.js +21 -0
- package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/DataGridInfiniteContextProvider.d.ts +7 -0
- package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/DataGridInfiniteContextProvider.js +5 -0
- package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/index.d.ts +1 -0
- package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/index.js +1 -0
- package/components/DataGridInfinite/DataGridInfiniteContext/index.d.ts +2 -0
- package/components/DataGridInfinite/DataGridInfiniteContext/index.js +2 -0
- package/components/DataGridInfinite/List/List.js +2 -1
- package/components/DataGridInfinite/List/constants.d.ts +3 -0
- package/components/DataGridInfinite/List/constants.js +4 -0
- package/components/DataGridInfinite/List/index.d.ts +1 -0
- package/components/DataGridInfinite/List/index.js +1 -0
- package/components/DataGridInfinite/Row/Row.d.ts +2 -0
- package/components/DataGridInfinite/Row/Row.js +10 -0
- package/components/DataGridInfinite/Row/index.d.ts +1 -0
- package/components/DataGridInfinite/Row/index.js +1 -0
- package/components/DataGridInfinite/Row/types.d.ts +2 -0
- package/components/DataGridInfinite/Row/types.js +1 -0
- package/components/DataGridInfinite/Row/useLogic/index.d.ts +1 -0
- package/components/DataGridInfinite/Row/useLogic/index.js +1 -0
- package/components/DataGridInfinite/Row/useLogic/useLogic.d.ts +33 -0
- package/components/DataGridInfinite/Row/useLogic/useLogic.js +35 -0
- package/components/DataGridInfinite/faker.js +1 -1
- package/components/DataGridInfinite/styles.d.ts +6 -0
- package/components/DataGridInfinite/styles.js +11 -0
- package/components/DataGridInfinite/useLogic/useLogic.d.ts +6 -3
- package/components/DataGridInfinite/useLogic/useLogic.js +29 -10
- package/components/DialogActions/styles.js +2 -0
- package/components/DonutChart/DonutChart.d.ts +2 -0
- package/components/DonutChart/DonutChart.js +9 -0
- package/components/DonutChart/constants.d.ts +15 -0
- package/components/DonutChart/constants.js +16 -0
- package/components/DonutChart/index.d.ts +3 -0
- package/components/DonutChart/index.js +2 -0
- package/components/DonutChart/public.d.ts +3 -0
- package/components/DonutChart/public.js +2 -0
- package/components/DonutChart/styles.d.ts +21 -0
- package/components/DonutChart/styles.js +41 -0
- package/components/DonutChart/types.d.ts +27 -0
- package/components/DonutChart/types.js +1 -0
- package/components/DonutChart/useLogic/hooks/index.d.ts +1 -0
- package/components/DonutChart/useLogic/hooks/index.js +1 -0
- package/components/DonutChart/useLogic/hooks/useRenderWidth/index.d.ts +1 -0
- package/components/DonutChart/useLogic/hooks/useRenderWidth/index.js +1 -0
- package/components/DonutChart/useLogic/hooks/useRenderWidth/useRenderWidth.d.ts +9 -0
- package/components/DonutChart/useLogic/hooks/useRenderWidth/useRenderWidth.js +30 -0
- package/components/DonutChart/useLogic/index.d.ts +1 -0
- package/components/DonutChart/useLogic/index.js +1 -0
- package/components/DonutChart/useLogic/useLogic.d.ts +15 -0
- package/components/DonutChart/useLogic/useLogic.js +40 -0
- package/components/DonutChart/useLogic/utils/getDonutChartCssVars/getDonutChartCssVars.d.ts +16 -0
- package/components/DonutChart/useLogic/utils/getDonutChartCssVars/getDonutChartCssVars.js +10 -0
- package/components/DonutChart/useLogic/utils/getDonutChartCssVars/index.d.ts +1 -0
- package/components/DonutChart/useLogic/utils/getDonutChartCssVars/index.js +1 -0
- package/components/DonutChart/useLogic/utils/getGeometry/getGeometry.d.ts +10 -0
- package/components/DonutChart/useLogic/utils/getGeometry/getGeometry.js +13 -0
- package/components/DonutChart/useLogic/utils/getGeometry/index.d.ts +1 -0
- package/components/DonutChart/useLogic/utils/getGeometry/index.js +1 -0
- package/components/DonutChart/useLogic/utils/getMeterAriaValue/getMeterAriaValue.d.ts +13 -0
- package/components/DonutChart/useLogic/utils/getMeterAriaValue/getMeterAriaValue.js +22 -0
- package/components/DonutChart/useLogic/utils/getMeterAriaValue/index.d.ts +1 -0
- package/components/DonutChart/useLogic/utils/getMeterAriaValue/index.js +1 -0
- package/components/DonutChart/useLogic/utils/getProgressCirclePath/getProgressCirclePath.d.ts +9 -0
- package/components/DonutChart/useLogic/utils/getProgressCirclePath/getProgressCirclePath.js +29 -0
- package/components/DonutChart/useLogic/utils/getProgressCirclePath/index.d.ts +1 -0
- package/components/DonutChart/useLogic/utils/getProgressCirclePath/index.js +1 -0
- package/components/DonutChart/useLogic/utils/getProgressOffset/getProgressOffset.d.ts +8 -0
- package/components/DonutChart/useLogic/utils/getProgressOffset/getProgressOffset.js +21 -0
- package/components/DonutChart/useLogic/utils/getProgressOffset/index.d.ts +1 -0
- package/components/DonutChart/useLogic/utils/getProgressOffset/index.js +1 -0
- package/components/DonutChart/useLogic/utils/getProgressPercent/getProgressPercent.d.ts +8 -0
- package/components/DonutChart/useLogic/utils/getProgressPercent/getProgressPercent.js +16 -0
- package/components/DonutChart/useLogic/utils/getProgressPercent/index.d.ts +1 -0
- package/components/DonutChart/useLogic/utils/getProgressPercent/index.js +1 -0
- package/components/DonutChart/useLogic/utils/index.d.ts +6 -0
- package/components/DonutChart/useLogic/utils/index.js +6 -0
- package/components/ExpansionPanel/Summary/styles.d.ts +1 -1
- package/components/MenuOrganization/OrganizationButton/styles.d.ts +1 -1
- package/components/NewStepper/StepIcon/StepIcon.js +3 -1
- package/components/NewStepper/StepIcon/useLogic/index.d.ts +1 -0
- package/components/NewStepper/StepIcon/useLogic/index.js +1 -0
- package/components/NewStepper/StepIcon/useLogic/useLogic.d.ts +8 -0
- package/components/NewStepper/StepIcon/useLogic/useLogic.js +6 -0
- package/components/PageContent/PageContent.js +23 -5
- package/components/PageContent/constants.d.ts +2 -0
- package/components/PageContent/constants.js +2 -0
- package/components/PageContent/styles.d.ts +0 -2
- package/components/PageContent/styles.js +17 -11
- package/components/PageContent/types.d.ts +4 -0
- package/components/Profile/styles.d.ts +1 -1
- package/components/SearchField/types.d.ts +9 -0
- package/components/SearchField/useLogic/useLogic.d.ts +1 -1
- package/components/SearchField/useLogic/useLogic.js +28 -16
- package/components/constants/classnames.d.ts +1 -0
- package/components/constants/classnames.js +2 -0
- package/components/constants/index.d.ts +1 -0
- package/components/constants/index.js +1 -0
- package/components/fileUploading/FileUploaderDropzone/HintPlaceholder/HintPlaceholder.d.ts +2 -1
- package/components/fileUploading/FileUploaderDropzone/HintPlaceholder/HintPlaceholder.js +4 -1
- package/components/fileUploading/FileUploaderDropzone/HintPlaceholder/useLogic/useLogic.d.ts +5 -4
- package/components/fileUploading/PreviewFileUploaderDropZone/HintPlaceholder/HintPlaceholder.js +11 -2
- package/components/fileUploading/PreviewFileUploaderDropZone/HintPlaceholder/useLogic/useLogic.d.ts +5 -5
- package/components/fileUploading/hooks/useFileUploader/useFileUploader.d.ts +1 -1
- package/components/fileUploading/hooks/usePreviewFileUploader/usePreviewFileUploader.d.ts +1 -1
- package/components/fileUploading/types.d.ts +2 -2
- package/components/useProfiler/index.d.ts +1 -0
- package/components/useProfiler/index.js +1 -0
- package/components/useProfiler/useProfiler.d.ts +14 -0
- package/components/useProfiler/useProfiler.js +46 -0
- package/components/useProfiler/utils/index.d.ts +1 -0
- package/components/useProfiler/utils/index.js +1 -0
- package/components/useProfiler/utils/shallowEqual/index.d.ts +1 -0
- package/components/useProfiler/utils/shallowEqual/index.js +1 -0
- package/components/useProfiler/utils/shallowEqual/shallowEqual.d.ts +5 -0
- package/components/useProfiler/utils/shallowEqual/shallowEqual.js +26 -0
- package/hook-form/FormFilters/FormFilters.js +1 -1
- package/hook-form/FormFilters/FormFiltersSkeleton/FormFiltersSkeleton.d.ts +5 -1
- package/hook-form/FormFilters/FormFiltersSkeleton/FormFiltersSkeleton.js +4 -3
- package/hook-form/FormFilters/FormQuickFiltersSkeleton/FormQuickFiltersSkeleton.d.ts +1 -0
- package/hook-form/FormFilters/FormQuickFiltersSkeleton/FormQuickFiltersSkeleton.js +9 -0
- package/hook-form/FormFilters/FormQuickFiltersSkeleton/index.d.ts +1 -0
- package/hook-form/FormFilters/FormQuickFiltersSkeleton/index.js +1 -0
- package/hook-form/FormFilters/FormQuickFiltersSkeleton/styles.d.ts +5 -0
- package/hook-form/FormFilters/FormQuickFiltersSkeleton/styles.js +5 -0
- package/node/components/CardGridInfinite/CardGridInfinite.js +13 -4
- package/node/components/CardGridInfinite/styles.js +4 -0
- package/node/components/CardGridInfinite/useLogic/useLogic.d.ts +1 -1
- package/node/components/CardGridInfinite/useLogic/useLogic.js +1 -11
- package/node/components/Chevron/Chevron.d.ts +1 -1
- package/node/components/ConfirmAction/ConfirmAction.js +2 -2
- package/node/components/ConfirmAction/constants.d.ts +1 -0
- package/node/components/ConfirmAction/constants.js +2 -1
- package/node/components/ConfirmAction/styles.js +13 -0
- package/node/components/ConfirmAction/types.d.ts +1 -1
- package/node/components/DataGrid/Body/Body.d.ts +1 -1
- package/node/components/DataGrid/Body/Body.js +5 -3
- package/node/components/DataGrid/Body/types.d.ts +5 -0
- package/node/components/DataGrid/Cell/Cell.d.ts +9 -1
- package/node/components/DataGrid/Cell/Cell.js +16 -2
- package/node/components/DataGrid/CustomRowWrapper/CustomRowWrapper.d.ts +19 -0
- package/node/components/DataGrid/CustomRowWrapper/CustomRowWrapper.js +18 -0
- package/node/components/DataGrid/CustomRowWrapper/index.d.ts +1 -0
- package/node/components/DataGrid/CustomRowWrapper/index.js +5 -0
- package/node/components/DataGrid/DataGrid.js +27 -16
- package/node/components/DataGrid/DataGridContext/DataGridContext.d.ts +9 -5
- package/node/components/DataGrid/DataGridContext/DataGridContext.js +7 -4
- package/node/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.d.ts +3 -4
- package/node/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.js +17 -47
- package/node/components/DataGrid/DataGridStorageContext/DataGridStorageContext.d.ts +29 -0
- package/node/components/DataGrid/DataGridStorageContext/DataGridStorageContext.js +31 -0
- package/node/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/DataGridStorageProvider.d.ts +6 -0
- package/node/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/DataGridStorageProvider.js +16 -0
- package/node/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/index.d.ts +1 -0
- package/node/components/DataGrid/DataGridStorageContext/DataGridStorageProvider/index.js +17 -0
- package/node/components/DataGrid/DataGridStorageContext/index.d.ts +2 -0
- package/node/components/DataGrid/DataGridStorageContext/index.js +18 -0
- package/node/components/DataGrid/MobileSkeleton/MobileSkeleton.d.ts +2 -1
- package/node/components/DataGrid/MobileSkeleton/MobileSkeleton.js +21 -3
- package/node/components/DataGrid/MobileSkeleton/styles.js +12 -0
- package/node/components/DataGrid/Row/NestedChildren/NestedChildren.d.ts +1 -5
- package/node/components/DataGrid/Row/NestedChildren/NestedChildren.js +18 -7
- package/node/components/DataGrid/Row/NestedChildren/constants.d.ts +6 -0
- package/node/components/DataGrid/Row/NestedChildren/constants.js +10 -0
- package/node/components/DataGrid/Row/NestedChildren/styles.js +41 -2
- package/node/components/DataGrid/Row/NestedChildren/useLogic/useLogic.d.ts +1 -1
- package/node/components/DataGrid/Row/NestedChildren/useLogic/useLogic.js +3 -5
- package/node/components/DataGrid/Row/Row.js +33 -36
- package/node/components/DataGrid/Row/RowContext/RowContext.d.ts +10 -1
- package/node/components/DataGrid/Row/RowContext/RowContext.js +9 -0
- package/node/components/DataGrid/Row/RowContext/RowProvider/RowProvider.d.ts +3 -2
- package/node/components/DataGrid/Row/RowContext/RowProvider/RowProvider.js +25 -2
- package/node/components/DataGrid/Row/constants.d.ts +6 -0
- package/node/components/DataGrid/Row/constants.js +6 -0
- package/node/components/DataGrid/Row/styles.js +99 -0
- package/node/components/DataGrid/Row/useLogic/hooks/useMobileLogic.d.ts +1 -0
- package/node/components/DataGrid/Row/useLogic/hooks/useMobileLogic.js +1 -1
- package/node/components/DataGrid/Row/useLogic/useLogic.d.ts +5 -2
- package/node/components/DataGrid/Row/useLogic/useLogic.js +20 -18
- package/node/components/DataGrid/RowBase/GroupCell/GroupCell.d.ts +2 -0
- package/node/components/DataGrid/RowBase/GroupCell/GroupCell.js +26 -0
- package/node/components/DataGrid/RowBase/GroupCell/constants.d.ts +4 -0
- package/node/components/DataGrid/RowBase/GroupCell/constants.js +8 -0
- package/node/components/DataGrid/RowBase/GroupCell/index.d.ts +1 -0
- package/node/components/DataGrid/RowBase/GroupCell/index.js +5 -0
- package/node/components/DataGrid/RowBase/GroupCell/styles.d.ts +12 -0
- package/node/components/DataGrid/RowBase/GroupCell/styles.js +19 -0
- package/node/components/DataGrid/RowBase/GroupCell/types.d.ts +11 -0
- package/node/components/DataGrid/RowBase/GroupCell/types.js +2 -0
- package/node/components/DataGrid/RowBase/RowBase.d.ts +3 -0
- package/node/components/DataGrid/RowBase/RowBase.js +72 -0
- package/node/components/DataGrid/RowBase/constants.d.ts +9 -0
- package/node/components/DataGrid/RowBase/constants.js +13 -0
- package/node/components/DataGrid/RowBase/index.d.ts +3 -0
- package/node/components/DataGrid/RowBase/index.js +7 -0
- package/node/components/DataGrid/RowBase/styles.d.ts +17 -0
- package/node/components/DataGrid/RowBase/styles.js +90 -0
- package/node/components/DataGrid/RowBase/types.d.ts +92 -0
- package/node/components/DataGrid/RowBase/types.js +2 -0
- package/node/components/DataGrid/RowBase/useLogic/index.d.ts +1 -0
- package/node/components/DataGrid/RowBase/useLogic/useLogic.d.ts +46 -0
- package/node/components/DataGrid/RowBase/useLogic/useLogic.js +94 -0
- package/node/components/DataGrid/constants.d.ts +8 -0
- package/node/components/DataGrid/constants.js +9 -1
- package/node/components/DataGrid/index.d.ts +3 -0
- package/node/components/DataGrid/index.js +7 -1
- package/node/components/DataGrid/styles.js +40 -26
- package/node/components/DataGrid/tests/performance/testDataGridPerformance.d.ts +21 -0
- package/node/components/DataGrid/tests/performance/testDataGridPerformance.js +106 -0
- package/node/components/DataGrid/types.d.ts +11 -0
- package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.d.ts +3 -1
- package/node/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.js +2 -1
- package/node/components/DataGrid/useLogic/useLogic.d.ts +4 -1
- package/node/components/DataGrid/useLogic/useLogic.js +19 -6
- package/node/components/DataGridActionCell/DataGridMainActions/Action/MainIconButton/MainIconButton.js +4 -2
- package/node/components/DataGridActionCell/DataGridMainActions/Action/MobileMainButton/MobileMainButton.js +4 -2
- package/node/components/DataGridActionCell/types.d.ts +4 -0
- package/node/components/DataGridCollapsibleRow/DataGridCollapsibleRow.d.ts +2 -0
- package/node/components/DataGridCollapsibleRow/DataGridCollapsibleRow.js +33 -0
- package/node/components/DataGridCollapsibleRow/constants.d.ts +11 -0
- package/node/components/DataGridCollapsibleRow/constants.js +15 -0
- package/node/components/DataGridCollapsibleRow/index.d.ts +2 -0
- package/node/components/DataGridCollapsibleRow/index.js +5 -0
- package/node/components/DataGridCollapsibleRow/public.d.ts +2 -0
- package/node/components/DataGridCollapsibleRow/public.js +5 -0
- package/node/components/DataGridCollapsibleRow/styles.d.ts +42 -0
- package/node/components/DataGridCollapsibleRow/styles.js +102 -0
- package/node/components/DataGridCollapsibleRow/types.d.ts +19 -0
- package/node/components/DataGridCollapsibleRow/types.js +2 -0
- package/node/components/DataGridCollapsibleRow/useLogic/index.d.ts +1 -0
- package/node/components/DataGridCollapsibleRow/useLogic/index.js +17 -0
- package/node/components/DataGridCollapsibleRow/useLogic/useLogic.d.ts +29 -0
- package/node/components/DataGridCollapsibleRow/useLogic/useLogic.js +66 -0
- package/node/components/DataGridInfinite/DataGridInfinite.js +45 -35
- package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContext.d.ts +23 -0
- package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContext.js +24 -0
- package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/DataGridInfiniteContextProvider.d.ts +7 -0
- package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/DataGridInfiniteContextProvider.js +9 -0
- package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/index.d.ts +1 -0
- package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContextProvider/index.js +17 -0
- package/node/components/DataGridInfinite/DataGridInfiniteContext/index.d.ts +2 -0
- package/node/components/DataGridInfinite/DataGridInfiniteContext/index.js +18 -0
- package/node/components/DataGridInfinite/List/List.js +2 -1
- package/node/components/DataGridInfinite/List/constants.d.ts +3 -0
- package/node/components/DataGridInfinite/List/constants.js +7 -0
- package/node/components/DataGridInfinite/List/index.d.ts +1 -0
- package/node/components/DataGridInfinite/List/index.js +3 -0
- package/node/components/DataGridInfinite/Row/Row.d.ts +2 -0
- package/node/components/DataGridInfinite/Row/Row.js +14 -0
- package/node/components/DataGridInfinite/Row/index.d.ts +1 -0
- package/node/components/DataGridInfinite/Row/index.js +17 -0
- package/node/components/DataGridInfinite/Row/types.d.ts +2 -0
- package/node/components/DataGridInfinite/Row/types.js +2 -0
- package/node/components/DataGridInfinite/Row/useLogic/index.d.ts +1 -0
- package/node/components/DataGridInfinite/Row/useLogic/index.js +17 -0
- package/node/components/DataGridInfinite/Row/useLogic/useLogic.d.ts +33 -0
- package/node/components/DataGridInfinite/Row/useLogic/useLogic.js +39 -0
- package/node/components/DataGridInfinite/faker.js +1 -1
- package/node/components/DataGridInfinite/styles.d.ts +6 -0
- package/node/components/DataGridInfinite/styles.js +12 -1
- package/node/components/DataGridInfinite/useLogic/useLogic.d.ts +6 -3
- package/node/components/DataGridInfinite/useLogic/useLogic.js +33 -14
- package/node/components/DialogActions/styles.js +2 -0
- package/node/components/DonutChart/DonutChart.d.ts +2 -0
- package/node/components/DonutChart/DonutChart.js +13 -0
- package/node/components/DonutChart/constants.d.ts +15 -0
- package/node/components/DonutChart/constants.js +19 -0
- package/node/components/DonutChart/index.d.ts +3 -0
- package/node/components/DonutChart/index.js +7 -0
- package/node/components/DonutChart/public.d.ts +3 -0
- package/node/components/DonutChart/public.js +7 -0
- package/node/components/DonutChart/styles.d.ts +21 -0
- package/node/components/DonutChart/styles.js +44 -0
- package/node/components/DonutChart/types.d.ts +27 -0
- package/node/components/DonutChart/types.js +2 -0
- package/node/components/DonutChart/useLogic/hooks/index.d.ts +1 -0
- package/node/components/DonutChart/useLogic/hooks/index.js +17 -0
- package/node/components/DonutChart/useLogic/hooks/useRenderWidth/index.d.ts +1 -0
- package/node/components/DonutChart/useLogic/hooks/useRenderWidth/index.js +17 -0
- package/node/components/DonutChart/useLogic/hooks/useRenderWidth/useRenderWidth.d.ts +9 -0
- package/node/components/DonutChart/useLogic/hooks/useRenderWidth/useRenderWidth.js +34 -0
- package/node/components/DonutChart/useLogic/index.d.ts +1 -0
- package/node/components/DonutChart/useLogic/index.js +17 -0
- package/node/components/DonutChart/useLogic/useLogic.d.ts +15 -0
- package/node/components/DonutChart/useLogic/useLogic.js +44 -0
- package/node/components/DonutChart/useLogic/utils/getDonutChartCssVars/getDonutChartCssVars.d.ts +16 -0
- package/node/components/DonutChart/useLogic/utils/getDonutChartCssVars/getDonutChartCssVars.js +14 -0
- package/node/components/DonutChart/useLogic/utils/getDonutChartCssVars/index.d.ts +1 -0
- package/node/components/DonutChart/useLogic/utils/getDonutChartCssVars/index.js +5 -0
- package/node/components/DonutChart/useLogic/utils/getGeometry/getGeometry.d.ts +10 -0
- package/node/components/DonutChart/useLogic/utils/getGeometry/getGeometry.js +17 -0
- package/node/components/DonutChart/useLogic/utils/getGeometry/index.d.ts +1 -0
- package/node/components/DonutChart/useLogic/utils/getGeometry/index.js +5 -0
- package/node/components/DonutChart/useLogic/utils/getMeterAriaValue/getMeterAriaValue.d.ts +13 -0
- package/node/components/DonutChart/useLogic/utils/getMeterAriaValue/getMeterAriaValue.js +26 -0
- package/node/components/DonutChart/useLogic/utils/getMeterAriaValue/index.d.ts +1 -0
- package/node/components/DonutChart/useLogic/utils/getMeterAriaValue/index.js +5 -0
- package/node/components/DonutChart/useLogic/utils/getProgressCirclePath/getProgressCirclePath.d.ts +9 -0
- package/node/components/DonutChart/useLogic/utils/getProgressCirclePath/getProgressCirclePath.js +33 -0
- package/node/components/DonutChart/useLogic/utils/getProgressCirclePath/index.d.ts +1 -0
- package/node/components/DonutChart/useLogic/utils/getProgressCirclePath/index.js +5 -0
- package/node/components/DonutChart/useLogic/utils/getProgressOffset/getProgressOffset.d.ts +8 -0
- package/node/components/DonutChart/useLogic/utils/getProgressOffset/getProgressOffset.js +25 -0
- package/node/components/DonutChart/useLogic/utils/getProgressOffset/index.d.ts +1 -0
- package/node/components/DonutChart/useLogic/utils/getProgressOffset/index.js +5 -0
- package/node/components/DonutChart/useLogic/utils/getProgressPercent/getProgressPercent.d.ts +8 -0
- package/node/components/DonutChart/useLogic/utils/getProgressPercent/getProgressPercent.js +20 -0
- package/node/components/DonutChart/useLogic/utils/getProgressPercent/index.d.ts +1 -0
- package/node/components/DonutChart/useLogic/utils/getProgressPercent/index.js +5 -0
- package/node/components/DonutChart/useLogic/utils/index.d.ts +6 -0
- package/node/components/DonutChart/useLogic/utils/index.js +15 -0
- package/node/components/ExpansionPanel/Summary/styles.d.ts +1 -1
- package/node/components/MenuOrganization/OrganizationButton/styles.d.ts +1 -1
- package/node/components/NewStepper/StepIcon/StepIcon.js +3 -1
- package/node/components/NewStepper/StepIcon/useLogic/index.d.ts +1 -0
- package/node/components/NewStepper/StepIcon/useLogic/index.js +17 -0
- package/node/components/NewStepper/StepIcon/useLogic/useLogic.d.ts +8 -0
- package/node/components/NewStepper/StepIcon/useLogic/useLogic.js +10 -0
- package/node/components/PageContent/PageContent.js +22 -4
- package/node/components/PageContent/constants.d.ts +2 -0
- package/node/components/PageContent/constants.js +2 -0
- package/node/components/PageContent/styles.d.ts +0 -2
- package/node/components/PageContent/styles.js +17 -11
- package/node/components/PageContent/types.d.ts +4 -0
- package/node/components/Profile/styles.d.ts +1 -1
- package/node/components/SearchField/types.d.ts +9 -0
- package/node/components/SearchField/useLogic/useLogic.d.ts +1 -1
- package/node/components/SearchField/useLogic/useLogic.js +27 -15
- package/node/components/constants/classnames.d.ts +1 -0
- package/node/components/constants/classnames.js +5 -0
- package/node/components/constants/index.d.ts +1 -0
- package/node/components/constants/index.js +1 -0
- package/node/components/fileUploading/FileUploaderDropzone/HintPlaceholder/HintPlaceholder.d.ts +2 -1
- package/node/components/fileUploading/FileUploaderDropzone/HintPlaceholder/HintPlaceholder.js +4 -1
- package/node/components/fileUploading/FileUploaderDropzone/HintPlaceholder/useLogic/useLogic.d.ts +5 -4
- package/node/components/fileUploading/PreviewFileUploaderDropZone/HintPlaceholder/HintPlaceholder.js +10 -1
- package/node/components/fileUploading/PreviewFileUploaderDropZone/HintPlaceholder/useLogic/useLogic.d.ts +5 -5
- package/node/components/fileUploading/hooks/useFileUploader/useFileUploader.d.ts +1 -1
- package/node/components/fileUploading/hooks/usePreviewFileUploader/usePreviewFileUploader.d.ts +1 -1
- package/node/components/fileUploading/types.d.ts +2 -2
- package/node/components/useProfiler/index.d.ts +1 -0
- package/node/components/useProfiler/index.js +5 -0
- package/node/components/useProfiler/useProfiler.d.ts +14 -0
- package/node/components/useProfiler/useProfiler.js +50 -0
- package/node/components/useProfiler/utils/index.d.ts +1 -0
- package/node/components/useProfiler/utils/index.js +17 -0
- package/node/components/useProfiler/utils/shallowEqual/index.d.ts +1 -0
- package/node/components/useProfiler/utils/shallowEqual/index.js +6 -0
- package/node/components/useProfiler/utils/shallowEqual/shallowEqual.d.ts +5 -0
- package/node/components/useProfiler/utils/shallowEqual/shallowEqual.js +31 -0
- package/node/hook-form/FormFilters/FormFilters.js +1 -1
- package/node/hook-form/FormFilters/FormFiltersSkeleton/FormFiltersSkeleton.d.ts +5 -1
- package/node/hook-form/FormFilters/FormFiltersSkeleton/FormFiltersSkeleton.js +3 -2
- package/node/hook-form/FormFilters/FormQuickFiltersSkeleton/FormQuickFiltersSkeleton.d.ts +1 -0
- package/node/hook-form/FormFilters/FormQuickFiltersSkeleton/FormQuickFiltersSkeleton.js +13 -0
- package/node/hook-form/FormFilters/FormQuickFiltersSkeleton/index.d.ts +1 -0
- package/node/hook-form/FormFilters/FormQuickFiltersSkeleton/index.js +17 -0
- package/node/hook-form/FormFilters/FormQuickFiltersSkeleton/styles.d.ts +5 -0
- package/node/hook-form/FormFilters/FormQuickFiltersSkeleton/styles.js +8 -0
- package/package.json +1 -1
- package/components/PageContent/useLogic/useLogic.d.ts +0 -7
- package/components/PageContent/useLogic/useLogic.js +0 -11
- package/node/components/PageContent/useLogic/useLogic.d.ts +0 -7
- package/node/components/PageContent/useLogic/useLogic.js +0 -15
- /package/components/{PageContent → DataGrid/RowBase}/useLogic/index.d.ts +0 -0
- /package/components/{PageContent → DataGrid/RowBase}/useLogic/index.js +0 -0
- /package/{node/components/PageContent → components/DataGridCollapsibleRow}/useLogic/index.d.ts +0 -0
- /package/node/components/{PageContent → DataGrid/RowBase}/useLogic/index.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ChangeEvent } from 'react';
|
|
2
2
|
import type { CellValue, DataGridProps, DataGridRow } from '../types';
|
|
3
3
|
type UseLogicParams<TData extends Record<string, CellValue> = DataGridRow, TSortField extends keyof TData = keyof TData> = DataGridProps<TData, TSortField>;
|
|
4
|
-
export declare const useLogic: <TData extends Record<string, unknown> = DataGridRow, TSortField extends keyof TData = keyof TData>({ keyId, columns, rows, variant, tree, subrows, selectedRows, isLoading, isDisabled, onSelectRow, isError, onRetry, errorMsg, isHideSelectAll, isHideHeaderIfNoData, sorting, className, onSort, maxHeight, gridViewMode: gridViewModeProp, }: UseLogicParams<TData, TSortField>) => {
|
|
4
|
+
export declare const useLogic: <TData extends Record<string, unknown> = DataGridRow, TSortField extends keyof TData = keyof TData>({ keyId, columns, rows, variant, tree, subrows, selectedRows, isLoading, isDisabled, mobileDisplayVariant, onSelectRow, isError, onRetry, errorMsg, isHideSelectAll, isHideHeaderIfNoData, sorting, className, onSort, maxHeight, gridViewMode: gridViewModeProp, }: UseLogicParams<TData, TSortField>) => {
|
|
5
5
|
dataGridClassName: string | undefined;
|
|
6
6
|
containerCssVars: import("react").CSSProperties;
|
|
7
7
|
isDataGridDisabled: boolean | undefined;
|
|
@@ -43,6 +43,7 @@ export declare const useLogic: <TData extends Record<string, unknown> = DataGrid
|
|
|
43
43
|
mobileSkeletonProps: {
|
|
44
44
|
cellsCount: number;
|
|
45
45
|
rowsCount: number;
|
|
46
|
+
mobileDisplayVariant: "list" | "cards";
|
|
46
47
|
};
|
|
47
48
|
hasGroupedColumns: boolean;
|
|
48
49
|
headProps: {
|
|
@@ -58,7 +59,9 @@ export declare const useLogic: <TData extends Record<string, unknown> = DataGrid
|
|
|
58
59
|
isSelectable: boolean;
|
|
59
60
|
onSelectRow: (row: TData) => (event: ChangeEvent<HTMLInputElement>) => void;
|
|
60
61
|
};
|
|
62
|
+
mobileDisplayVariant: "list" | "cards";
|
|
61
63
|
sections: import("../PinnedSections/types").PinnedSection<TData>[];
|
|
64
|
+
isSelfContained: boolean;
|
|
62
65
|
loaderProps: {
|
|
63
66
|
isLoading: boolean | undefined;
|
|
64
67
|
isVisibleDivider: boolean;
|
|
@@ -11,7 +11,7 @@ const enums_1 = require("../enums");
|
|
|
11
11
|
const utils_1 = require("../utils");
|
|
12
12
|
const hooks_1 = require("./hooks");
|
|
13
13
|
const utils_2 = require("./utils");
|
|
14
|
-
const useLogic = ({ keyId, columns, rows = [], variant, tree, subrows, selectedRows = [], isLoading, isDisabled, onSelectRow, isError, onRetry, errorMsg, isHideSelectAll, isHideHeaderIfNoData = false, sorting, className, onSort, maxHeight, gridViewMode: gridViewModeProp = 'standard', }) => {
|
|
14
|
+
const useLogic = ({ keyId, columns, rows = [], variant, tree, subrows, selectedRows = [], isLoading, isDisabled, mobileDisplayVariant = variant === 'subrows' ? 'cards' : 'list', onSelectRow, isError, onRetry, errorMsg, isHideSelectAll, isHideHeaderIfNoData = false, sorting, className, onSort, maxHeight, gridViewMode: gridViewModeProp = 'standard', }) => {
|
|
15
15
|
const isFirstRender = (0, useFirstMountState_1.useFirstMountState)();
|
|
16
16
|
const isSelectable = Boolean(onSelectRow);
|
|
17
17
|
const isDataGridDisabled = isLoading || isDisabled;
|
|
@@ -45,10 +45,21 @@ const useLogic = ({ keyId, columns, rows = [], variant, tree, subrows, selectedR
|
|
|
45
45
|
columns: (0, utils_1.getFlattenColumns)(processedColumns()),
|
|
46
46
|
rows,
|
|
47
47
|
isNoScrollToTop: isLoading && isNoData,
|
|
48
|
+
mobileDisplayVariant,
|
|
48
49
|
});
|
|
49
|
-
const treeRenderConfig =
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
const treeRenderConfig = (0, react_1.useMemo)(() => {
|
|
51
|
+
const config = Object.is(variant, enums_1.Variant.Subrows)
|
|
52
|
+
? { ...subrows, isInitialExpanded: true }
|
|
53
|
+
: tree;
|
|
54
|
+
if (isMobile) {
|
|
55
|
+
return {
|
|
56
|
+
...config,
|
|
57
|
+
expandedLevel: constants_1.EXPANDED_LEVEL_BY_DEFAULT,
|
|
58
|
+
initialVisibleChildrenCount: constants_1.INITIAL_OPENED_NESTED_CHILDREN_COUNT_ON_MOBILE_BY_DEFAULT,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
return config;
|
|
62
|
+
}, [variant, subrows, tree, isMobile]);
|
|
52
63
|
const availableRows = rows.filter((row) => !(row.options?.isDisabled || row.options?.isNotSelectable));
|
|
53
64
|
const gridColumns = (0, react_1.useMemo)(() => (0, utils_1.getGridTemplateColumns)((0, utils_1.getFlattenColumns)(columns)), [columns]);
|
|
54
65
|
const isAllowHorizontalScroll = (0, utils_2.getIsAllowHorizontalScroll)((0, utils_1.getFlattenColumns)(columns));
|
|
@@ -66,7 +77,7 @@ const useLogic = ({ keyId, columns, rows = [], variant, tree, subrows, selectedR
|
|
|
66
77
|
const filteredRows = selectedRows.filter((selectedRow) => !rows.find((row) => row[keyId] === selectedRow[keyId]));
|
|
67
78
|
onSelectRow(filteredRows);
|
|
68
79
|
};
|
|
69
|
-
const handleSelectRow = (row) => (event) => {
|
|
80
|
+
const handleSelectRow = (0, react_1.useCallback)((row) => (event) => {
|
|
70
81
|
if (!onSelectRow) {
|
|
71
82
|
return;
|
|
72
83
|
}
|
|
@@ -74,7 +85,7 @@ const useLogic = ({ keyId, columns, rows = [], variant, tree, subrows, selectedR
|
|
|
74
85
|
return onSelectRow([...selectedRowsRef.current, row]);
|
|
75
86
|
}
|
|
76
87
|
onSelectRow(selectedRowsRef.current.filter((selectedRow) => selectedRow[keyId] !== row[keyId]));
|
|
77
|
-
};
|
|
88
|
+
}, []);
|
|
78
89
|
const hasGroupedColumns = columns.some(utils_1.isGroupColumns);
|
|
79
90
|
const gridViewMode = hasGroupedColumns ? 'full' : gridViewModeProp;
|
|
80
91
|
const isHideHead = (isHideHeaderIfNoData && isNoData) || (hasGroupedColumns && isNoData);
|
|
@@ -127,7 +138,9 @@ const useLogic = ({ keyId, columns, rows = [], variant, tree, subrows, selectedR
|
|
|
127
138
|
isSelectable,
|
|
128
139
|
onSelectRow: handleSelectRow,
|
|
129
140
|
},
|
|
141
|
+
mobileDisplayVariant,
|
|
130
142
|
sections,
|
|
143
|
+
isSelfContained: mobileDisplayVariant === 'cards',
|
|
131
144
|
loaderProps: {
|
|
132
145
|
isLoading: !isFirstRender && isLoading,
|
|
133
146
|
isVisibleDivider: Boolean(rows.length),
|
|
@@ -18,9 +18,11 @@ const iconButtonCva = (0, cva_1.cva)(constants_1.mainIconButtonClassnames.root,
|
|
|
18
18
|
const MainIconButton = (props) => {
|
|
19
19
|
const { tooltipProps } = (0, useLogic_1.useLogic)(props);
|
|
20
20
|
const { action, onActionClick, isDisabled, tooltipPlacement } = props;
|
|
21
|
-
const { name, icon, needConfirm, confirmText, confirmButtonProps, disabledReason, disabled, loading, isBlockingOperation, loadingNote, onClick, isMobilePrimary, ...actions } = action;
|
|
21
|
+
const { name, icon, needConfirm, confirmText, confirmMobileTitle, confirmButtonProps, disabledReason, disabled, loading, isBlockingOperation, loadingNote, onClick, isMobilePrimary, mobileProps, ...actions } = action;
|
|
22
22
|
const renderButton = (renderProps) => ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { withoutContainer: !disabled, placement: tooltipPlacement, ...tooltipProps, children: (0, jsx_runtime_1.jsx)(styles_1.StyledIconButton, { disabled: isDisabled || disabled, loading: loading, ...actions, variant: "text", ...renderProps, className: iconButtonCva({ isMobilePrimary }), children: icon }) }, name));
|
|
23
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: needConfirm ? ((0, jsx_runtime_1.jsx)(ConfirmAction_1.ConfirmAction, { text: confirmText, confirmButtonProps: confirmButtonProps,
|
|
23
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: needConfirm ? ((0, jsx_runtime_1.jsx)(ConfirmAction_1.ConfirmAction, { text: confirmText, confirmButtonProps: confirmButtonProps, popoverProps: {
|
|
24
|
+
title: confirmMobileTitle,
|
|
25
|
+
}, actionComponent: (renderProps) => renderButton(renderProps), onConfirm: onActionClick(onClick) })) : (renderButton({
|
|
24
26
|
onClick: onActionClick(onClick),
|
|
25
27
|
})) }));
|
|
26
28
|
};
|
|
@@ -5,10 +5,12 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const ConfirmAction_1 = require("../../../../ConfirmAction");
|
|
6
6
|
const styles_1 = require("./styles");
|
|
7
7
|
const MobileMainButton = ({ action, isDisabled, onActionClick, }) => {
|
|
8
|
-
const { mobileProps, name, icon, needConfirm, confirmText, confirmButtonProps, disabledReason, disabled, loading, isBlockingOperation, loadingNote, onClick, isMobilePrimary, ...actions } = action;
|
|
8
|
+
const { mobileProps, name, icon, needConfirm, confirmText, confirmMobileTitle, confirmButtonProps, disabledReason, disabled, loading, isBlockingOperation, loadingNote, onClick, isMobilePrimary, ...actions } = action;
|
|
9
9
|
const { text, color } = mobileProps ?? { text: name, color: 'primary' };
|
|
10
10
|
const renderButton = (renderProps) => ((0, jsx_runtime_1.jsx)(styles_1.StyledButton, { disabled: isDisabled || disabled, loading: loading, color: color, ...actions, variant: "contained", ...renderProps, children: text }));
|
|
11
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: needConfirm ? ((0, jsx_runtime_1.jsx)(ConfirmAction_1.ConfirmAction, { text: confirmText, confirmButtonProps: confirmButtonProps,
|
|
11
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: needConfirm ? ((0, jsx_runtime_1.jsx)(ConfirmAction_1.ConfirmAction, { text: confirmText, confirmButtonProps: confirmButtonProps, popoverProps: {
|
|
12
|
+
title: confirmMobileTitle,
|
|
13
|
+
}, actionComponent: (renderProps) => renderButton(renderProps), onConfirm: onActionClick(onClick) })) : (renderButton({
|
|
12
14
|
onClick: onActionClick(onClick),
|
|
13
15
|
})) }));
|
|
14
16
|
};
|
|
@@ -34,6 +34,10 @@ export type SingleAction<TAction> = {
|
|
|
34
34
|
* Поясняющий текст для подтверждения действия
|
|
35
35
|
*/
|
|
36
36
|
confirmText?: ConfirmActionProps['text'];
|
|
37
|
+
/**
|
|
38
|
+
* Заголовок для подтверждения действия на мобильных устройствах
|
|
39
|
+
*/
|
|
40
|
+
confirmMobileTitle?: string;
|
|
37
41
|
/**
|
|
38
42
|
* Параметры кнопки подтверждения действия
|
|
39
43
|
*/
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataGridCollapsibleRow = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const Button_1 = require("../Button");
|
|
7
|
+
const Collapse_1 = require("../Collapse");
|
|
8
|
+
const cva_1 = require("../utils/cva");
|
|
9
|
+
const constants_1 = require("./constants");
|
|
10
|
+
const styles_1 = require("./styles");
|
|
11
|
+
const useLogic_1 = require("./useLogic");
|
|
12
|
+
const chevronIconCva = (0, cva_1.cva)(constants_1.collapsibleRowClassnames.chevronIcon, {
|
|
13
|
+
variants: {
|
|
14
|
+
isActive: {
|
|
15
|
+
true: constants_1.collapsibleRowClassnames.chevronIconActive,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
const DataGridCollapsibleRow = ({ children, initialOpen, onOpen, onClose, }) => {
|
|
20
|
+
const { handleToggle, isOpen, rowBaseProps, itemProps, handleRowClick } = (0, useLogic_1.useLogic)({
|
|
21
|
+
initialOpen,
|
|
22
|
+
onOpen,
|
|
23
|
+
onClose,
|
|
24
|
+
});
|
|
25
|
+
const renderStartAdornment = (0, react_1.useCallback)((isFirstCell) => {
|
|
26
|
+
if (!isFirstCell) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.CollapseCell, { children: (0, jsx_runtime_1.jsx)(styles_1.CollapseButton, { variant: "text", onClick: handleToggle, title: isOpen ? 'Свернуть' : 'Развернуть', children: (0, jsx_runtime_1.jsx)(styles_1.ChevronIcon, { className: chevronIconCva({ isActive: isOpen }) }) }) }));
|
|
30
|
+
}, [isOpen, handleToggle]);
|
|
31
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.StyledRowBase, { ...rowBaseProps, renderStartAdornment: renderStartAdornment, onRowClick: handleRowClick, customContent: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(styles_1.MobileExpandButtonWrapper, { children: (0, jsx_runtime_1.jsxs)(Button_1.Button, { variant: "link", onClick: handleToggle, className: constants_1.collapsibleRowClassnames.collapseButton, children: [(0, jsx_runtime_1.jsx)(styles_1.ChevronIcon, { className: chevronIconCva({ isActive: isOpen }) }), isOpen ? 'Свернуть' : 'Развернуть'] }) }), (0, jsx_runtime_1.jsx)(Collapse_1.Collapse, { in: isOpen, unmountOnExit: true, children: (0, jsx_runtime_1.jsx)(styles_1.CollapseContainer, { className: constants_1.collapsibleRowClassnames.collapseContainer, children: (0, jsx_runtime_1.jsx)(styles_1.CollapseContent, { children: (0, jsx_runtime_1.jsx)(styles_1.ChildrenWrapper, { className: constants_1.collapsibleRowClassnames.collapsibleContent, children: children }) }) }) })] }), ...itemProps }));
|
|
32
|
+
};
|
|
33
|
+
exports.DataGridCollapsibleRow = DataGridCollapsibleRow;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const STORAGE_KEY_PREFIX = "collapsible-row";
|
|
2
|
+
export declare const collapsibleRowClassnames: {
|
|
3
|
+
root: string;
|
|
4
|
+
cellsWrapper: string;
|
|
5
|
+
active: string;
|
|
6
|
+
collapseContainer: string;
|
|
7
|
+
chevronIcon: string;
|
|
8
|
+
chevronIconActive: string;
|
|
9
|
+
collapseButton: string;
|
|
10
|
+
collapsibleContent: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.collapsibleRowClassnames = exports.STORAGE_KEY_PREFIX = void 0;
|
|
4
|
+
const createUIKitClassname_1 = require("../utils/createUIKitClassname");
|
|
5
|
+
exports.STORAGE_KEY_PREFIX = 'collapsible-row';
|
|
6
|
+
exports.collapsibleRowClassnames = {
|
|
7
|
+
root: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__collapsible-row'),
|
|
8
|
+
cellsWrapper: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__collapsible-row_cells-wrapper'),
|
|
9
|
+
active: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__collapsible-row_active'),
|
|
10
|
+
collapseContainer: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__collapsible-row_collapse-container'),
|
|
11
|
+
chevronIcon: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__collapsible-row_chevron-icon'),
|
|
12
|
+
chevronIconActive: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__collapsible-row__chevron-icon_active'),
|
|
13
|
+
collapseButton: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__collapsible-row__collapse-button'),
|
|
14
|
+
collapsibleContent: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__collapsible-row__collapsible-content'),
|
|
15
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataGridCollapsibleRow = void 0;
|
|
4
|
+
var DataGridCollapsibleRow_1 = require("./DataGridCollapsibleRow");
|
|
5
|
+
Object.defineProperty(exports, "DataGridCollapsibleRow", { enumerable: true, get: function () { return DataGridCollapsibleRow_1.DataGridCollapsibleRow; } });
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataGridCollapsibleRow = void 0;
|
|
4
|
+
var DataGridCollapsibleRow_1 = require("./DataGridCollapsibleRow");
|
|
5
|
+
Object.defineProperty(exports, "DataGridCollapsibleRow", { enumerable: true, get: function () { return DataGridCollapsibleRow_1.DataGridCollapsibleRow; } });
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const CollapseContainer: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const CollapseContent: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
|
+
export declare const ChildrenWrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
11
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
12
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
13
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
14
|
+
export declare const MobileExpandButtonWrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
15
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
16
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
17
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
18
|
+
export declare const CollapseButton: import("@emotion/styled/dist/declarations/src/types").StyledComponent<Omit<import("..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "size" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
|
|
19
|
+
variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
|
|
20
|
+
loading?: boolean | undefined;
|
|
21
|
+
color?: "primary" | "success" | "warning" | "error" | "grey" | undefined;
|
|
22
|
+
component?: import("react").ElementType | undefined;
|
|
23
|
+
selected?: boolean | undefined;
|
|
24
|
+
size?: "large" | "medium" | undefined;
|
|
25
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ""> & import("react").RefAttributes<HTMLButtonElement> & {
|
|
26
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
27
|
+
}, {}, {}>;
|
|
28
|
+
export declare const CollapseCell: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
29
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
30
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
31
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
32
|
+
export declare const ChevronIcon: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
33
|
+
children?: import("react").ReactNode;
|
|
34
|
+
color?: string | undefined;
|
|
35
|
+
titleAccess?: string | undefined;
|
|
36
|
+
size?: "sm" | "md" | undefined;
|
|
37
|
+
} & import("react").SVGProps<SVGSVGElement> & {
|
|
38
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
39
|
+
}, {}, {}>;
|
|
40
|
+
export declare const StyledRowBase: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("../DataGrid/RowBase").RowBaseProps & {
|
|
41
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
42
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyledRowBase = exports.ChevronIcon = exports.CollapseCell = exports.CollapseButton = exports.MobileExpandButtonWrapper = exports.ChildrenWrapper = exports.CollapseContent = exports.CollapseContainer = void 0;
|
|
4
|
+
const ChevronROutlineMd_1 = require("../../icons/ChevronROutlineMd");
|
|
5
|
+
const Button_1 = require("../Button");
|
|
6
|
+
const constants_1 = require("../DataGrid/constants");
|
|
7
|
+
const RowBase_1 = require("../DataGrid/RowBase");
|
|
8
|
+
const IconButton_1 = require("../IconButton");
|
|
9
|
+
const styled_1 = require("../styled");
|
|
10
|
+
const constants_2 = require("./constants");
|
|
11
|
+
exports.CollapseContainer = styled_1.styled.div `
|
|
12
|
+
width: 100%;
|
|
13
|
+
margin-bottom: ${({ theme }) => theme.spacing(4)};
|
|
14
|
+
`;
|
|
15
|
+
exports.CollapseContent = styled_1.styled.div `
|
|
16
|
+
padding: ${({ theme }) => theme.spacing(2)};
|
|
17
|
+
|
|
18
|
+
background-color: ${({ theme }) => theme.palette.grey[100]};
|
|
19
|
+
border-radius: ${({ theme }) => theme.shape.large};
|
|
20
|
+
`;
|
|
21
|
+
exports.ChildrenWrapper = styled_1.styled.div `
|
|
22
|
+
padding: ${({ theme }) => theme.spacing(0, 3)};
|
|
23
|
+
|
|
24
|
+
background-color: ${({ theme }) => theme.palette.background.paper};
|
|
25
|
+
border-radius: ${({ theme }) => theme.shape.medium};
|
|
26
|
+
|
|
27
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
28
|
+
padding: ${({ theme }) => theme.spacing(2)};
|
|
29
|
+
}
|
|
30
|
+
`;
|
|
31
|
+
exports.MobileExpandButtonWrapper = styled_1.styled.div `
|
|
32
|
+
display: none;
|
|
33
|
+
|
|
34
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
35
|
+
display: flex;
|
|
36
|
+
|
|
37
|
+
& .${Button_1.buttonClassnames.root} {
|
|
38
|
+
justify-content: flex-start;
|
|
39
|
+
|
|
40
|
+
width: 100%;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
`;
|
|
44
|
+
exports.CollapseButton = (0, styled_1.styled)(IconButton_1.IconButton) `
|
|
45
|
+
width: 24px;
|
|
46
|
+
height: 24px;
|
|
47
|
+
|
|
48
|
+
color: inherit;
|
|
49
|
+
|
|
50
|
+
&:hover {
|
|
51
|
+
background-color: ${({ theme }) => theme.palette.grey[300]};
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
exports.CollapseCell = styled_1.styled.div `
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
justify-content: center;
|
|
58
|
+
|
|
59
|
+
width: ${constants_1.ROOT_ACTION_CELL_WIDTH}px;
|
|
60
|
+
|
|
61
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
62
|
+
display: none;
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
exports.ChevronIcon = (0, styled_1.styled)(ChevronROutlineMd_1.ChevronROutlineMd) `
|
|
66
|
+
transform: rotateZ(0deg);
|
|
67
|
+
|
|
68
|
+
transition: ${({ theme }) => theme.transitions.create('transform', {
|
|
69
|
+
easing: theme.transitions.easing.sharp,
|
|
70
|
+
duration: theme.transitions.duration.short,
|
|
71
|
+
})};
|
|
72
|
+
|
|
73
|
+
&.${constants_2.collapsibleRowClassnames.chevronIconActive} {
|
|
74
|
+
transform: rotateZ(90deg);
|
|
75
|
+
}
|
|
76
|
+
`;
|
|
77
|
+
exports.StyledRowBase = (0, styled_1.styled)(RowBase_1.RowBase) `
|
|
78
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
79
|
+
&.${RowBase_1.dataGridRowBaseClassnames.mobileVariantCards} {
|
|
80
|
+
padding: 0;
|
|
81
|
+
|
|
82
|
+
background-color: ${({ theme }) => theme.palette.grey[100]};
|
|
83
|
+
border-bottom: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
84
|
+
|
|
85
|
+
& .${RowBase_1.dataGridRowBaseClassnames.contentWrapper} {
|
|
86
|
+
padding: ${({ theme }) => theme.spacing(5, 4, 4)};
|
|
87
|
+
|
|
88
|
+
background-color: ${({ theme }) => theme.palette.background.default};
|
|
89
|
+
border-radius: ${({ theme }) => theme.shape.medium};
|
|
90
|
+
outline: 1px solid ${({ theme }) => theme.palette.grey[300]};
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
& .${constants_2.collapsibleRowClassnames.collapseButton} {
|
|
94
|
+
padding-left: ${({ theme }) => theme.spacing(4)};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
& .${constants_2.collapsibleRowClassnames.collapsibleContent} {
|
|
98
|
+
background-color: transparent;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export type DataGridCollapsibleRowProps = {
|
|
3
|
+
/**
|
|
4
|
+
* Контент, который будет отображаться при развернутом состоянии
|
|
5
|
+
*/
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Функция, которая будет вызываться при развернутом состоянии
|
|
9
|
+
*/
|
|
10
|
+
onOpen?: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* Функция, которая будет вызываться при свернутом состоянии
|
|
13
|
+
*/
|
|
14
|
+
onClose?: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* Флаг начального раскрытия строки при монтировании
|
|
17
|
+
*/
|
|
18
|
+
initialOpen?: boolean;
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useLogic';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./useLogic"), exports);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type SyntheticEvent } from 'react';
|
|
2
|
+
import type { DataGridCollapsibleRowProps } from '../types';
|
|
3
|
+
type UseLogicParams = Pick<DataGridCollapsibleRowProps, 'initialOpen' | 'onOpen' | 'onClose'>;
|
|
4
|
+
export declare const useLogic: ({ initialOpen, onOpen, onClose }: UseLogicParams) => {
|
|
5
|
+
handleToggle: (event?: SyntheticEvent) => void;
|
|
6
|
+
handleRowClick: (clickedRow: Record<string, unknown>) => void;
|
|
7
|
+
isOpen: boolean | undefined;
|
|
8
|
+
itemProps: object | undefined;
|
|
9
|
+
rowBaseProps: {
|
|
10
|
+
isSelected: boolean | undefined;
|
|
11
|
+
row: Record<string, unknown>;
|
|
12
|
+
keyId: unknown;
|
|
13
|
+
columns: import("../..").DataGridColumns<Record<string, unknown>>[];
|
|
14
|
+
rowId: string;
|
|
15
|
+
isDisabled: boolean;
|
|
16
|
+
disabledReason: string | undefined;
|
|
17
|
+
onSelectRow: (row: Record<string, unknown>) => (event: import("react").ChangeEvent<HTMLInputElement, Element>) => void;
|
|
18
|
+
onRowEnter: ((rowId: string) => void) | undefined;
|
|
19
|
+
onRowLeave: ((rowId: string, event: PointerEvent) => void) | undefined;
|
|
20
|
+
registerRowElement: ((rowId: string, el: HTMLElement) => void) | undefined;
|
|
21
|
+
unregisterRowElement: ((rowId: string, el: HTMLElement) => void) | undefined;
|
|
22
|
+
isSelectable: boolean | undefined;
|
|
23
|
+
emptyCellValue: import("react").ReactNode;
|
|
24
|
+
gridColumns: string;
|
|
25
|
+
activeRowId: string | undefined;
|
|
26
|
+
mobileDisplayVariant: "list" | "cards" | undefined;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useLogic = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const DataGridContext_1 = require("../../DataGrid/DataGridContext");
|
|
6
|
+
const DataGridStorageContext_1 = require("../../DataGrid/DataGridStorageContext");
|
|
7
|
+
const RowContext_1 = require("../../DataGrid/Row/RowContext");
|
|
8
|
+
const constants_1 = require("../constants");
|
|
9
|
+
const useLogic = ({ initialOpen, onOpen, onClose }) => {
|
|
10
|
+
const { keyId, columns, gridColumns, activeRowId, emptyCellValue, onRowClick, mobileDisplayVariant, } = (0, react_1.useContext)(DataGridContext_1.DataGridContext);
|
|
11
|
+
const { row, onSelectRow, isDisabled, disabledReason, onRowEnter, onRowLeave, registerRowElement, unregisterRowElement, isSelectable, itemProps, isSelected, } = (0, react_1.useContext)(RowContext_1.RowContext);
|
|
12
|
+
const rowId = row[keyId];
|
|
13
|
+
/**
|
|
14
|
+
* Используется локальное хранилище DataGridStorageContext. Для сохранения состояния раскрытия строки на время жизни DataGrid.
|
|
15
|
+
*/
|
|
16
|
+
const { getItem, setItem } = (0, react_1.useContext)(DataGridStorageContext_1.DataGridStorageContext);
|
|
17
|
+
const storageKey = `${constants_1.STORAGE_KEY_PREFIX}:${rowId}`;
|
|
18
|
+
const storedValue = getItem(storageKey);
|
|
19
|
+
const [isOpen, setIsOpen] = (0, react_1.useState)(storedValue !== undefined ? storedValue : initialOpen);
|
|
20
|
+
const handleToggle = (0, react_1.useCallback)((event) => {
|
|
21
|
+
event?.stopPropagation();
|
|
22
|
+
if (isOpen) {
|
|
23
|
+
setIsOpen(false);
|
|
24
|
+
setItem(storageKey, false);
|
|
25
|
+
onClose?.();
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
setIsOpen(true);
|
|
29
|
+
setItem(storageKey, true);
|
|
30
|
+
onOpen?.();
|
|
31
|
+
}
|
|
32
|
+
}, [isOpen, onOpen, onClose, storageKey, setItem]);
|
|
33
|
+
const handleRowClick = (0, react_1.useCallback)((clickedRow) => {
|
|
34
|
+
if (onRowClick) {
|
|
35
|
+
onRowClick(clickedRow);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
handleToggle();
|
|
39
|
+
}, [onRowClick, handleToggle]);
|
|
40
|
+
return {
|
|
41
|
+
handleToggle,
|
|
42
|
+
handleRowClick,
|
|
43
|
+
isOpen,
|
|
44
|
+
itemProps,
|
|
45
|
+
rowBaseProps: {
|
|
46
|
+
isSelected,
|
|
47
|
+
row,
|
|
48
|
+
keyId,
|
|
49
|
+
columns,
|
|
50
|
+
rowId,
|
|
51
|
+
isDisabled,
|
|
52
|
+
disabledReason,
|
|
53
|
+
onSelectRow,
|
|
54
|
+
onRowEnter,
|
|
55
|
+
onRowLeave,
|
|
56
|
+
registerRowElement,
|
|
57
|
+
unregisterRowElement,
|
|
58
|
+
isSelectable,
|
|
59
|
+
emptyCellValue,
|
|
60
|
+
gridColumns,
|
|
61
|
+
activeRowId,
|
|
62
|
+
mobileDisplayVariant,
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
exports.useLogic = useLogic;
|