@astral/ui 4.74.0 → 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/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/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
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { useRef, useState, } from 'react';
|
|
2
|
+
import { redirectToLink } from '../../../utils/redirectToLink';
|
|
3
|
+
import { useMobileLogic } from '../../Row/useLogic/hooks';
|
|
4
|
+
import { DISABLE_ROW_ATTR } from '../constants';
|
|
5
|
+
export const useLogic = ({ className, row, keyId, onRowClick, columns, sectionOffset, customContent, renderStartAdornment, isSelected, isDisabled, disabledReason, onSelectRow, onRowEnter, onRowLeave, registerRowElement, unregisterRowElement, gridColumns, activeRowId, emptyCellValue, isSelectable, rowId, mobileDisplayVariant, ...dataGridInfiniteItemProps }) => {
|
|
6
|
+
const [isVisibleTooltip, setVisibleTooltip] = useState(false);
|
|
7
|
+
const savedElementRef = useRef(null);
|
|
8
|
+
const { isDrawerOpen, handleOpenDrawer, handleCloseDrawer } = useMobileLogic();
|
|
9
|
+
const { options } = row;
|
|
10
|
+
const { style: dataGridInfiniteItemStyle, ...restDataGridInfiniteItemProps } = dataGridInfiniteItemProps || {};
|
|
11
|
+
const { disabledReason: propsDisabledReason, isDisabled: propsIsDisabled, isDisabledLastCell, href, isNotSelectable, target, } = options || {};
|
|
12
|
+
const disabled = isDisabled || propsIsDisabled;
|
|
13
|
+
const disabledReasonText = propsDisabledReason || disabledReason;
|
|
14
|
+
const handleOpenTooltip = (event) => {
|
|
15
|
+
const element = event.target;
|
|
16
|
+
const isDisabledCell = element?.getAttribute(DISABLE_ROW_ATTR) === 'true';
|
|
17
|
+
if (isDisabledCell) {
|
|
18
|
+
setVisibleTooltip(true);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
const handleCloseTooltip = () => setVisibleTooltip(false);
|
|
22
|
+
const rowBaseVars = {
|
|
23
|
+
'--row-base-grid-columns': gridColumns,
|
|
24
|
+
...(dataGridInfiniteItemStyle || {}),
|
|
25
|
+
};
|
|
26
|
+
const isHovered = Boolean(!disabled && (onRowClick || href));
|
|
27
|
+
const isActive = activeRowId === rowId;
|
|
28
|
+
const rowRef = (element) => {
|
|
29
|
+
if (element) {
|
|
30
|
+
savedElementRef.current = element;
|
|
31
|
+
registerRowElement?.(rowId, element);
|
|
32
|
+
}
|
|
33
|
+
else if (savedElementRef.current) {
|
|
34
|
+
unregisterRowElement?.(rowId, savedElementRef.current);
|
|
35
|
+
savedElementRef.current = null;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const handleRowClick = () => {
|
|
39
|
+
if (disabled) {
|
|
40
|
+
handleOpenDrawer();
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
if (href) {
|
|
44
|
+
return redirectToLink(href, target);
|
|
45
|
+
}
|
|
46
|
+
onRowClick?.(row);
|
|
47
|
+
};
|
|
48
|
+
return {
|
|
49
|
+
handleRowClick,
|
|
50
|
+
tooltipProps: {
|
|
51
|
+
open: isVisibleTooltip,
|
|
52
|
+
title: disabled ? disabledReasonText : undefined,
|
|
53
|
+
onOpen: handleOpenTooltip,
|
|
54
|
+
onClose: handleCloseTooltip,
|
|
55
|
+
followCursor: true,
|
|
56
|
+
arrow: false,
|
|
57
|
+
},
|
|
58
|
+
checkboxProps: {
|
|
59
|
+
checked: isSelected,
|
|
60
|
+
disabled,
|
|
61
|
+
onChange: onSelectRow(row),
|
|
62
|
+
},
|
|
63
|
+
drawerProps: {
|
|
64
|
+
open: isDrawerOpen,
|
|
65
|
+
onClose: handleCloseDrawer,
|
|
66
|
+
title: 'Заблокировано',
|
|
67
|
+
},
|
|
68
|
+
drawerContent: disabledReasonText,
|
|
69
|
+
rowBaseVars,
|
|
70
|
+
isHovered,
|
|
71
|
+
isActive,
|
|
72
|
+
columns,
|
|
73
|
+
emptyCellValue,
|
|
74
|
+
rowRef,
|
|
75
|
+
onRowEnter,
|
|
76
|
+
onRowLeave,
|
|
77
|
+
rowId,
|
|
78
|
+
row,
|
|
79
|
+
isDisabled: disabled,
|
|
80
|
+
sectionOffset,
|
|
81
|
+
customContent,
|
|
82
|
+
isDisabledLastCell,
|
|
83
|
+
renderStartAdornment,
|
|
84
|
+
isSelectable,
|
|
85
|
+
isNotSelectable,
|
|
86
|
+
dataGridInfiniteItemProps: restDataGridInfiniteItemProps,
|
|
87
|
+
mobileDisplayVariant,
|
|
88
|
+
className,
|
|
89
|
+
};
|
|
90
|
+
};
|
|
@@ -2,9 +2,11 @@ export declare const MIN_ROW_HEIGHT = 44;
|
|
|
2
2
|
export declare const ROOT_ACTION_CELL_WIDTH = 32;
|
|
3
3
|
export declare const TREE_LINE_WIDTH: number;
|
|
4
4
|
export declare const MIN_DISPLAY_ROWS_BY_DEFAULT = 10;
|
|
5
|
+
export declare const MOBILE_TREE_LINE_WIDTH = 12;
|
|
5
6
|
export declare const DEFAULT_MOBILE_SKELETON_ROWS_COUNT = 5;
|
|
6
7
|
export declare const EXPANDED_LEVEL_BY_DEFAULT = 1;
|
|
7
8
|
export declare const INITIAL_OPENED_NESTED_CHILDREN_COUNT_BY_DEFAULT = 2;
|
|
9
|
+
export declare const INITIAL_OPENED_NESTED_CHILDREN_COUNT_ON_MOBILE_BY_DEFAULT = 1;
|
|
8
10
|
export declare const dataGridClassnames: {
|
|
9
11
|
loadingPlaceholder: string;
|
|
10
12
|
header: string;
|
|
@@ -23,4 +25,10 @@ export declare const dataGridClassnames: {
|
|
|
23
25
|
hasGroupedColumns: string;
|
|
24
26
|
gridViewFull: string;
|
|
25
27
|
gridViewStandard: string;
|
|
28
|
+
mobileVariantCards: string;
|
|
29
|
+
mobileVariantList: string;
|
|
30
|
+
};
|
|
31
|
+
export declare const dataGridSkeletonClassnames: {
|
|
32
|
+
list: string;
|
|
33
|
+
item: string;
|
|
26
34
|
};
|
|
@@ -3,9 +3,11 @@ export const MIN_ROW_HEIGHT = 44;
|
|
|
3
3
|
export const ROOT_ACTION_CELL_WIDTH = 32;
|
|
4
4
|
export const TREE_LINE_WIDTH = ROOT_ACTION_CELL_WIDTH / 2;
|
|
5
5
|
export const MIN_DISPLAY_ROWS_BY_DEFAULT = 10;
|
|
6
|
+
export const MOBILE_TREE_LINE_WIDTH = 12;
|
|
6
7
|
export const DEFAULT_MOBILE_SKELETON_ROWS_COUNT = 5;
|
|
7
8
|
export const EXPANDED_LEVEL_BY_DEFAULT = 1;
|
|
8
9
|
export const INITIAL_OPENED_NESTED_CHILDREN_COUNT_BY_DEFAULT = 2;
|
|
10
|
+
export const INITIAL_OPENED_NESTED_CHILDREN_COUNT_ON_MOBILE_BY_DEFAULT = 1;
|
|
9
11
|
export const dataGridClassnames = {
|
|
10
12
|
loadingPlaceholder: createUIKitClassname('data-grid__loading-placeholder'),
|
|
11
13
|
header: createUIKitClassname('data-grid__header'),
|
|
@@ -24,4 +26,10 @@ export const dataGridClassnames = {
|
|
|
24
26
|
hasGroupedColumns: createUIKitClassname('data-grid_has-grouped-columns'),
|
|
25
27
|
gridViewFull: createUIKitClassname('data-grid_grid-view-full'),
|
|
26
28
|
gridViewStandard: createUIKitClassname('data-grid_grid-view-standard'),
|
|
29
|
+
mobileVariantCards: createUIKitClassname('data-grid_mobile-variant-cards'),
|
|
30
|
+
mobileVariantList: createUIKitClassname('data-grid_mobile-variant-list'),
|
|
31
|
+
};
|
|
32
|
+
export const dataGridSkeletonClassnames = {
|
|
33
|
+
list: createUIKitClassname('data-grid__skeleton-list'),
|
|
34
|
+
item: createUIKitClassname('data-grid__skeleton-item'),
|
|
27
35
|
};
|
|
@@ -2,3 +2,6 @@ export { DataGrid } from './DataGrid';
|
|
|
2
2
|
export type { DataGridProps, DataGridColumns, DataGridSingleColumn, DataGridRow, DataGridRowOptions, DataGridSort, DataGridRowWithOptions, DataGridRowOptionColumns, } from './types';
|
|
3
3
|
export { dataGridClassnames } from './constants';
|
|
4
4
|
export { MobileSkeleton } from './MobileSkeleton';
|
|
5
|
+
export { RowBase, type RowBaseProps } from './RowBase';
|
|
6
|
+
export { DataGridContext } from './DataGridContext';
|
|
7
|
+
export { DataGridStorageContext } from './DataGridStorageContext';
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
export { DataGrid } from './DataGrid';
|
|
2
2
|
export { dataGridClassnames } from './constants';
|
|
3
3
|
export { MobileSkeleton } from './MobileSkeleton';
|
|
4
|
+
export { RowBase } from './RowBase';
|
|
5
|
+
export { DataGridContext } from './DataGridContext';
|
|
6
|
+
export { DataGridStorageContext } from './DataGridStorageContext';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { styled } from '../styled';
|
|
2
|
+
import { bodyClassnames } from './Body/constants';
|
|
2
3
|
import { dataGridCellClassnames } from './Cell/constants';
|
|
3
4
|
import { dataGridClassnames } from './constants';
|
|
4
5
|
import { headCellClassnames } from './HeadCell';
|
|
@@ -137,6 +138,19 @@ export const Container = styled.div `
|
|
|
137
138
|
border-bottom: none;
|
|
138
139
|
}
|
|
139
140
|
}
|
|
141
|
+
|
|
142
|
+
&.${dataGridClassnames.mobileVariantCards} {
|
|
143
|
+
|
|
144
|
+
& .${dataGridClassnames.wrapper} {
|
|
145
|
+
margin: ${({ theme }) => theme.spacing(0, 4, 4)};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
& .${bodyClassnames.root} {
|
|
149
|
+
display: flex;
|
|
150
|
+
flex-direction: column;
|
|
151
|
+
gap: ${({ theme }) => theme.spacing(2)};
|
|
152
|
+
}
|
|
153
|
+
}
|
|
140
154
|
}
|
|
141
155
|
`;
|
|
142
156
|
export const DataGridWrapper = styled.div `
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
+
import { type DataGridColumns, type DataGridRowWithOptions } from '../../types';
|
|
3
|
+
type RenderRow = (row: Record<string, unknown>, index: number) => ReactNode;
|
|
4
|
+
type GridRenderProps = {
|
|
5
|
+
rows: DataGridRowWithOptions<DataItem>[];
|
|
6
|
+
columns: DataGridColumns<DataItem>[];
|
|
7
|
+
selectedRows?: DataItem[];
|
|
8
|
+
onSelectRow?: (rows: DataItem[]) => void;
|
|
9
|
+
renderRow?: RenderRow;
|
|
10
|
+
onRetry: () => void;
|
|
11
|
+
};
|
|
12
|
+
type TestDataGridPerformanceParams = {
|
|
13
|
+
render: (ui: ReactElement) => void;
|
|
14
|
+
renderGrid: (props: GridRenderProps) => ReactNode;
|
|
15
|
+
};
|
|
16
|
+
type DataItem = {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const testDataGridPerformance: ({ render, renderGrid, }: TestDataGridPerformanceParams) => void;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { screen, userEvents } from '@ui/dev/tests';
|
|
3
|
+
import { useMemo, useState } from 'react';
|
|
4
|
+
import { expect, it, vi } from 'vitest';
|
|
5
|
+
const TEST_ROWS = [
|
|
6
|
+
{ id: '1', name: 'Vasya' },
|
|
7
|
+
{ id: '2', name: 'Petya' },
|
|
8
|
+
{ id: '3', name: 'Ivan' },
|
|
9
|
+
];
|
|
10
|
+
export const testDataGridPerformance = ({ render, renderGrid, }) => {
|
|
11
|
+
const getRenderCountFor = (spy, id) => spy.mock.calls.filter(([row]) => row.id === id).length;
|
|
12
|
+
it('При клике на чекбокс перерендеривается только выбранная строка', async () => {
|
|
13
|
+
const renderCellSpy = vi.fn((row) => row.name);
|
|
14
|
+
const TestComponent = () => {
|
|
15
|
+
const [selectedRows, setSelectedRows] = useState([]);
|
|
16
|
+
const columns = useMemo(() => [
|
|
17
|
+
{
|
|
18
|
+
field: 'name',
|
|
19
|
+
label: 'Наименование',
|
|
20
|
+
renderCell: renderCellSpy,
|
|
21
|
+
},
|
|
22
|
+
], []);
|
|
23
|
+
return renderGrid({
|
|
24
|
+
rows: TEST_ROWS,
|
|
25
|
+
columns,
|
|
26
|
+
selectedRows,
|
|
27
|
+
onSelectRow: setSelectedRows,
|
|
28
|
+
onRetry: () => { },
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
render(_jsx(TestComponent, {}));
|
|
32
|
+
renderCellSpy.mockClear();
|
|
33
|
+
const checkboxes = screen.getAllByRole('checkbox');
|
|
34
|
+
const secondRowCheckbox = checkboxes[2];
|
|
35
|
+
await userEvents.click(secondRowCheckbox);
|
|
36
|
+
expect(getRenderCountFor(renderCellSpy, '1')).toBe(0);
|
|
37
|
+
expect(getRenderCountFor(renderCellSpy, '2')).toBe(1);
|
|
38
|
+
expect(getRenderCountFor(renderCellSpy, '3')).toBe(0);
|
|
39
|
+
});
|
|
40
|
+
it('При изменении значений одного row перерендеривается только этот row', async () => {
|
|
41
|
+
const renderCellSpy = vi.fn((row) => row.name);
|
|
42
|
+
const TestComponent = () => {
|
|
43
|
+
const [rows, setRows] = useState(TEST_ROWS);
|
|
44
|
+
const columns = useMemo(() => [
|
|
45
|
+
{
|
|
46
|
+
field: 'name',
|
|
47
|
+
label: 'Наименование',
|
|
48
|
+
renderCell: renderCellSpy,
|
|
49
|
+
},
|
|
50
|
+
], []);
|
|
51
|
+
const updateSecondRow = () => {
|
|
52
|
+
setRows((prevRows) => prevRows.map((row) => row.id === '2' ? { ...row, name: 'Petya Updated' } : row));
|
|
53
|
+
};
|
|
54
|
+
return (_jsxs(_Fragment, { children: [_jsx("button", { onClick: updateSecondRow, children: "Update row 2" }), renderGrid({
|
|
55
|
+
rows,
|
|
56
|
+
columns,
|
|
57
|
+
onRetry: () => { },
|
|
58
|
+
selectedRows: [],
|
|
59
|
+
onSelectRow: () => { },
|
|
60
|
+
})] }));
|
|
61
|
+
};
|
|
62
|
+
render(_jsx(TestComponent, {}));
|
|
63
|
+
renderCellSpy.mockClear();
|
|
64
|
+
await userEvents.click(screen.getByText('Update row 2'));
|
|
65
|
+
expect(getRenderCountFor(renderCellSpy, '1')).toBe(0);
|
|
66
|
+
expect(getRenderCountFor(renderCellSpy, '2')).toBe(1);
|
|
67
|
+
expect(getRenderCountFor(renderCellSpy, '3')).toBe(0);
|
|
68
|
+
expect(screen.getByText('Petya Updated')).toBeVisible();
|
|
69
|
+
});
|
|
70
|
+
it('При изменении параметра selectedRows изменяется только выбранные строки', async () => {
|
|
71
|
+
const renderCellSpy = vi.fn((row) => row.name);
|
|
72
|
+
const TestComponent = () => {
|
|
73
|
+
const [selectedRows, setSelectedRows] = useState([]);
|
|
74
|
+
const columns = useMemo(() => [
|
|
75
|
+
{
|
|
76
|
+
field: 'name',
|
|
77
|
+
label: 'Наименование',
|
|
78
|
+
renderCell: renderCellSpy,
|
|
79
|
+
},
|
|
80
|
+
], []);
|
|
81
|
+
const selectRowsDirectly = () => {
|
|
82
|
+
setSelectedRows([
|
|
83
|
+
{ id: '1', name: 'Vasya' },
|
|
84
|
+
{ id: '3', name: 'Ivan' },
|
|
85
|
+
]);
|
|
86
|
+
};
|
|
87
|
+
return (_jsxs(_Fragment, { children: [_jsx("button", { onClick: selectRowsDirectly, children: "Select 1 and 3" }), renderGrid({
|
|
88
|
+
rows: TEST_ROWS,
|
|
89
|
+
columns,
|
|
90
|
+
selectedRows,
|
|
91
|
+
onSelectRow: setSelectedRows,
|
|
92
|
+
onRetry: () => { },
|
|
93
|
+
})] }));
|
|
94
|
+
};
|
|
95
|
+
render(_jsx(TestComponent, {}));
|
|
96
|
+
renderCellSpy.mockClear();
|
|
97
|
+
await userEvents.click(screen.getByText('Select 1 and 3'));
|
|
98
|
+
expect(getRenderCountFor(renderCellSpy, '1')).toBe(1);
|
|
99
|
+
expect(getRenderCountFor(renderCellSpy, '2')).toBe(0);
|
|
100
|
+
expect(getRenderCountFor(renderCellSpy, '3')).toBe(1);
|
|
101
|
+
});
|
|
102
|
+
};
|
|
@@ -181,6 +181,15 @@ export type DataGridProps<TData extends Record<string, CellValue> = DataGridRow,
|
|
|
181
181
|
* Включает моноширинный шрифт для чисел в таблице
|
|
182
182
|
*/
|
|
183
183
|
isTabularNums?: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Кастомный компонент для отображения строк таблицы
|
|
186
|
+
* @example <DataGrid renderRow={(row) => <DataGridCollapsibleRow><CustomContent row={row} /></DataGridCollapsibleRow>} />
|
|
187
|
+
*/
|
|
188
|
+
renderRow?: (row: TData, index: number) => ReactNode;
|
|
189
|
+
/**
|
|
190
|
+
* Вариант отображения таблицы на мобильных устройствах
|
|
191
|
+
*/
|
|
192
|
+
mobileDisplayVariant?: 'cards' | 'list';
|
|
184
193
|
};
|
|
185
194
|
export type DataGridSort<TSortField> = {
|
|
186
195
|
/**
|
|
@@ -336,3 +345,5 @@ export type DataGridRowWithOptions<TData extends DataGridRow> = TData & {
|
|
|
336
345
|
options?: DataGridRowOptions<TData>;
|
|
337
346
|
children?: DataGridRowWithOptions<TData>[];
|
|
338
347
|
};
|
|
348
|
+
export type ContextOnRowClick = (row: Record<string, unknown>) => void;
|
|
349
|
+
export type RenderRow = (row: Record<string, unknown>, index: number) => ReactNode;
|
package/components/DataGrid/useLogic/hooks/useDataGridMobileLogic/useDataGridMobileLogic.d.ts
CHANGED
|
@@ -6,12 +6,14 @@ type UseDataGridMobileLogicParams<TData extends Record<string, CellValue> = Data
|
|
|
6
6
|
columns?: DataGridSingleColumn<TData>[];
|
|
7
7
|
rows?: TData[];
|
|
8
8
|
isNoScrollToTop?: boolean;
|
|
9
|
+
mobileDisplayVariant: 'cards' | 'list';
|
|
9
10
|
};
|
|
10
|
-
export declare const useDataGridMobileLogic: <TData extends Record<string, unknown> = DataGridRow>({ containerRef, isLoading, columns, rows, isNoScrollToTop, }: UseDataGridMobileLogicParams<TData>) => {
|
|
11
|
+
export declare const useDataGridMobileLogic: <TData extends Record<string, unknown> = DataGridRow>({ containerRef, isLoading, columns, rows, isNoScrollToTop, mobileDisplayVariant, }: UseDataGridMobileLogicParams<TData>) => {
|
|
11
12
|
isMobile: boolean;
|
|
12
13
|
mobileSkeletonProps: {
|
|
13
14
|
cellsCount: number;
|
|
14
15
|
rowsCount: number;
|
|
16
|
+
mobileDisplayVariant: "list" | "cards";
|
|
15
17
|
};
|
|
16
18
|
};
|
|
17
19
|
export {};
|
|
@@ -2,7 +2,7 @@ import { useEffect, useLayoutEffect, useMemo, useRef, } from 'react';
|
|
|
2
2
|
import { pageLayoutClassnames } from '../../../../PageLayoutContainer/constants';
|
|
3
3
|
import { useViewportType } from '../../../../useViewportType';
|
|
4
4
|
import { DEFAULT_MOBILE_SKELETON_ROWS_COUNT } from '../../../constants';
|
|
5
|
-
export const useDataGridMobileLogic = ({ containerRef, isLoading, columns, rows, isNoScrollToTop = false, }) => {
|
|
5
|
+
export const useDataGridMobileLogic = ({ containerRef, isLoading, columns, rows, isNoScrollToTop = false, mobileDisplayVariant, }) => {
|
|
6
6
|
const { isMobile } = useViewportType();
|
|
7
7
|
const firstLoadedRowsCountRef = useRef(null);
|
|
8
8
|
const mobileSkeletonCellsCount = useMemo(() => columns?.filter((column) => !column.isHideOnMobile).length ?? 0, [columns]);
|
|
@@ -31,6 +31,7 @@ export const useDataGridMobileLogic = ({ containerRef, isLoading, columns, rows,
|
|
|
31
31
|
const mobileSkeletonProps = {
|
|
32
32
|
cellsCount: mobileSkeletonCellsCount,
|
|
33
33
|
rowsCount: firstLoadedRowsCountRef.current ?? DEFAULT_MOBILE_SKELETON_ROWS_COUNT,
|
|
34
|
+
mobileDisplayVariant,
|
|
34
35
|
};
|
|
35
36
|
return { isMobile, mobileSkeletonProps };
|
|
36
37
|
};
|
|
@@ -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;
|
|
@@ -3,12 +3,12 @@ import { ConfigContext } from '../../ConfigProvider';
|
|
|
3
3
|
import { useFirstMountState } from '../../useFirstMountState';
|
|
4
4
|
import { prop } from '../../utils/prop';
|
|
5
5
|
import { uniqueBy } from '../../utils/uniqueBy';
|
|
6
|
-
import { dataGridClassnames } from '../constants';
|
|
6
|
+
import { dataGridClassnames, EXPANDED_LEVEL_BY_DEFAULT, INITIAL_OPENED_NESTED_CHILDREN_COUNT_ON_MOBILE_BY_DEFAULT, } from '../constants';
|
|
7
7
|
import { Variant } from '../enums';
|
|
8
8
|
import { getDataGridCssVars, getFlattenColumns, getGridTemplateColumns, isGroupColumns, } from '../utils';
|
|
9
9
|
import { useDataGridMobileLogic, usePinnedColumns } from './hooks';
|
|
10
10
|
import { getIsAllowHorizontalScroll } from './utils';
|
|
11
|
-
export 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', }) => {
|
|
11
|
+
export 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', }) => {
|
|
12
12
|
const isFirstRender = useFirstMountState();
|
|
13
13
|
const isSelectable = Boolean(onSelectRow);
|
|
14
14
|
const isDataGridDisabled = isLoading || isDisabled;
|
|
@@ -42,10 +42,21 @@ export const useLogic = ({ keyId, columns, rows = [], variant, tree, subrows, se
|
|
|
42
42
|
columns: getFlattenColumns(processedColumns()),
|
|
43
43
|
rows,
|
|
44
44
|
isNoScrollToTop: isLoading && isNoData,
|
|
45
|
+
mobileDisplayVariant,
|
|
45
46
|
});
|
|
46
|
-
const treeRenderConfig =
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
const treeRenderConfig = useMemo(() => {
|
|
48
|
+
const config = Object.is(variant, Variant.Subrows)
|
|
49
|
+
? { ...subrows, isInitialExpanded: true }
|
|
50
|
+
: tree;
|
|
51
|
+
if (isMobile) {
|
|
52
|
+
return {
|
|
53
|
+
...config,
|
|
54
|
+
expandedLevel: EXPANDED_LEVEL_BY_DEFAULT,
|
|
55
|
+
initialVisibleChildrenCount: INITIAL_OPENED_NESTED_CHILDREN_COUNT_ON_MOBILE_BY_DEFAULT,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
return config;
|
|
59
|
+
}, [variant, subrows, tree, isMobile]);
|
|
49
60
|
const availableRows = rows.filter((row) => !(row.options?.isDisabled || row.options?.isNotSelectable));
|
|
50
61
|
const gridColumns = useMemo(() => getGridTemplateColumns(getFlattenColumns(columns)), [columns]);
|
|
51
62
|
const isAllowHorizontalScroll = getIsAllowHorizontalScroll(getFlattenColumns(columns));
|
|
@@ -63,7 +74,7 @@ export const useLogic = ({ keyId, columns, rows = [], variant, tree, subrows, se
|
|
|
63
74
|
const filteredRows = selectedRows.filter((selectedRow) => !rows.find((row) => row[keyId] === selectedRow[keyId]));
|
|
64
75
|
onSelectRow(filteredRows);
|
|
65
76
|
};
|
|
66
|
-
const handleSelectRow = (row) => (event) => {
|
|
77
|
+
const handleSelectRow = useCallback((row) => (event) => {
|
|
67
78
|
if (!onSelectRow) {
|
|
68
79
|
return;
|
|
69
80
|
}
|
|
@@ -71,7 +82,7 @@ export const useLogic = ({ keyId, columns, rows = [], variant, tree, subrows, se
|
|
|
71
82
|
return onSelectRow([...selectedRowsRef.current, row]);
|
|
72
83
|
}
|
|
73
84
|
onSelectRow(selectedRowsRef.current.filter((selectedRow) => selectedRow[keyId] !== row[keyId]));
|
|
74
|
-
};
|
|
85
|
+
}, []);
|
|
75
86
|
const hasGroupedColumns = columns.some(isGroupColumns);
|
|
76
87
|
const gridViewMode = hasGroupedColumns ? 'full' : gridViewModeProp;
|
|
77
88
|
const isHideHead = (isHideHeaderIfNoData && isNoData) || (hasGroupedColumns && isNoData);
|
|
@@ -124,7 +135,9 @@ export const useLogic = ({ keyId, columns, rows = [], variant, tree, subrows, se
|
|
|
124
135
|
isSelectable,
|
|
125
136
|
onSelectRow: handleSelectRow,
|
|
126
137
|
},
|
|
138
|
+
mobileDisplayVariant,
|
|
127
139
|
sections,
|
|
140
|
+
isSelfContained: mobileDisplayVariant === 'cards',
|
|
128
141
|
loaderProps: {
|
|
129
142
|
isLoading: !isFirstRender && isLoading,
|
|
130
143
|
isVisibleDivider: Boolean(rows.length),
|
package/components/DataGridActionCell/DataGridMainActions/Action/MainIconButton/MainIconButton.js
CHANGED
|
@@ -15,9 +15,11 @@ const iconButtonCva = cva(mainIconButtonClassnames.root, {
|
|
|
15
15
|
export const MainIconButton = (props) => {
|
|
16
16
|
const { tooltipProps } = useLogic(props);
|
|
17
17
|
const { action, onActionClick, isDisabled, tooltipPlacement } = props;
|
|
18
|
-
const { name, icon, needConfirm, confirmText, confirmButtonProps, disabledReason, disabled, loading, isBlockingOperation, loadingNote, onClick, isMobilePrimary, ...actions } = action;
|
|
18
|
+
const { name, icon, needConfirm, confirmText, confirmMobileTitle, confirmButtonProps, disabledReason, disabled, loading, isBlockingOperation, loadingNote, onClick, isMobilePrimary, mobileProps, ...actions } = action;
|
|
19
19
|
const renderButton = (renderProps) => (_jsx(Tooltip, { withoutContainer: !disabled, placement: tooltipPlacement, ...tooltipProps, children: _jsx(StyledIconButton, { disabled: isDisabled || disabled, loading: loading, ...actions, variant: "text", ...renderProps, className: iconButtonCva({ isMobilePrimary }), children: icon }) }, name));
|
|
20
|
-
return (_jsx(_Fragment, { children: needConfirm ? (_jsx(ConfirmAction, { text: confirmText, confirmButtonProps: confirmButtonProps,
|
|
20
|
+
return (_jsx(_Fragment, { children: needConfirm ? (_jsx(ConfirmAction, { text: confirmText, confirmButtonProps: confirmButtonProps, popoverProps: {
|
|
21
|
+
title: confirmMobileTitle,
|
|
22
|
+
}, actionComponent: (renderProps) => renderButton(renderProps), onConfirm: onActionClick(onClick) })) : (renderButton({
|
|
21
23
|
onClick: onActionClick(onClick),
|
|
22
24
|
})) }));
|
|
23
25
|
};
|
|
@@ -2,10 +2,12 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { ConfirmAction, } from '../../../../ConfirmAction';
|
|
3
3
|
import { StyledButton } from './styles';
|
|
4
4
|
export const MobileMainButton = ({ action, isDisabled, onActionClick, }) => {
|
|
5
|
-
const { mobileProps, name, icon, needConfirm, confirmText, confirmButtonProps, disabledReason, disabled, loading, isBlockingOperation, loadingNote, onClick, isMobilePrimary, ...actions } = action;
|
|
5
|
+
const { mobileProps, name, icon, needConfirm, confirmText, confirmMobileTitle, confirmButtonProps, disabledReason, disabled, loading, isBlockingOperation, loadingNote, onClick, isMobilePrimary, ...actions } = action;
|
|
6
6
|
const { text, color } = mobileProps ?? { text: name, color: 'primary' };
|
|
7
7
|
const renderButton = (renderProps) => (_jsx(StyledButton, { disabled: isDisabled || disabled, loading: loading, color: color, ...actions, variant: "contained", ...renderProps, children: text }));
|
|
8
|
-
return (_jsx(_Fragment, { children: needConfirm ? (_jsx(ConfirmAction, { text: confirmText, confirmButtonProps: confirmButtonProps,
|
|
8
|
+
return (_jsx(_Fragment, { children: needConfirm ? (_jsx(ConfirmAction, { text: confirmText, confirmButtonProps: confirmButtonProps, popoverProps: {
|
|
9
|
+
title: confirmMobileTitle,
|
|
10
|
+
}, actionComponent: (renderProps) => renderButton(renderProps), onConfirm: onActionClick(onClick) })) : (renderButton({
|
|
9
11
|
onClick: onActionClick(onClick),
|
|
10
12
|
})) }));
|
|
11
13
|
};
|
|
@@ -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,29 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from 'react';
|
|
3
|
+
import { Button } from '../Button';
|
|
4
|
+
import { Collapse } from '../Collapse';
|
|
5
|
+
import { cva } from '../utils/cva';
|
|
6
|
+
import { collapsibleRowClassnames } from './constants';
|
|
7
|
+
import { ChevronIcon, ChildrenWrapper, CollapseButton, CollapseCell, CollapseContainer, CollapseContent, MobileExpandButtonWrapper, StyledRowBase, } from './styles';
|
|
8
|
+
import { useLogic } from './useLogic';
|
|
9
|
+
const chevronIconCva = cva(collapsibleRowClassnames.chevronIcon, {
|
|
10
|
+
variants: {
|
|
11
|
+
isActive: {
|
|
12
|
+
true: collapsibleRowClassnames.chevronIconActive,
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
export const DataGridCollapsibleRow = ({ children, initialOpen, onOpen, onClose, }) => {
|
|
17
|
+
const { handleToggle, isOpen, rowBaseProps, itemProps, handleRowClick } = useLogic({
|
|
18
|
+
initialOpen,
|
|
19
|
+
onOpen,
|
|
20
|
+
onClose,
|
|
21
|
+
});
|
|
22
|
+
const renderStartAdornment = useCallback((isFirstCell) => {
|
|
23
|
+
if (!isFirstCell) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
return (_jsx(CollapseCell, { children: _jsx(CollapseButton, { variant: "text", onClick: handleToggle, title: isOpen ? 'Свернуть' : 'Развернуть', children: _jsx(ChevronIcon, { className: chevronIconCva({ isActive: isOpen }) }) }) }));
|
|
27
|
+
}, [isOpen, handleToggle]);
|
|
28
|
+
return (_jsx(StyledRowBase, { ...rowBaseProps, renderStartAdornment: renderStartAdornment, onRowClick: handleRowClick, customContent: _jsxs(_Fragment, { children: [_jsx(MobileExpandButtonWrapper, { children: _jsxs(Button, { variant: "link", onClick: handleToggle, className: collapsibleRowClassnames.collapseButton, children: [_jsx(ChevronIcon, { className: chevronIconCva({ isActive: isOpen }) }), isOpen ? 'Свернуть' : 'Развернуть'] }) }), _jsx(Collapse, { in: isOpen, unmountOnExit: true, children: _jsx(CollapseContainer, { className: collapsibleRowClassnames.collapseContainer, children: _jsx(CollapseContent, { children: _jsx(ChildrenWrapper, { className: collapsibleRowClassnames.collapsibleContent, children: children }) }) }) })] }), ...itemProps }));
|
|
29
|
+
};
|
|
@@ -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,12 @@
|
|
|
1
|
+
import { createUIKitClassname } from '../utils/createUIKitClassname';
|
|
2
|
+
export const STORAGE_KEY_PREFIX = 'collapsible-row';
|
|
3
|
+
export const collapsibleRowClassnames = {
|
|
4
|
+
root: createUIKitClassname('data-grid__collapsible-row'),
|
|
5
|
+
cellsWrapper: createUIKitClassname('data-grid__collapsible-row_cells-wrapper'),
|
|
6
|
+
active: createUIKitClassname('data-grid__collapsible-row_active'),
|
|
7
|
+
collapseContainer: createUIKitClassname('data-grid__collapsible-row_collapse-container'),
|
|
8
|
+
chevronIcon: createUIKitClassname('data-grid__collapsible-row_chevron-icon'),
|
|
9
|
+
chevronIconActive: createUIKitClassname('data-grid__collapsible-row__chevron-icon_active'),
|
|
10
|
+
collapseButton: createUIKitClassname('data-grid__collapsible-row__collapse-button'),
|
|
11
|
+
collapsibleContent: createUIKitClassname('data-grid__collapsible-row__collapsible-content'),
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DataGridCollapsibleRow } from './DataGridCollapsibleRow';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DataGridCollapsibleRow } from './DataGridCollapsibleRow';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const CollapseContainer: import("../styled").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("../styled").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("../styled").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("../styled").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("../styled").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("../styled").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("../styled").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("../styled").StyledComponent<import("../DataGrid/RowBase").RowBaseProps & {
|
|
41
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
42
|
+
}, {}, {}>;
|