@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
|
@@ -2,6 +2,8 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
2
2
|
import { forwardRef, useMemo } from 'react';
|
|
3
3
|
import { Virtuoso, VirtuosoGrid, } from 'react-virtuoso';
|
|
4
4
|
import { ContentState } from '../ContentState';
|
|
5
|
+
import { selfContainedClassname } from '../constants';
|
|
6
|
+
import { cva } from '../utils/cva';
|
|
5
7
|
import { Card } from './Card';
|
|
6
8
|
import { cardGridClassnames } from './constants';
|
|
7
9
|
import { Footer } from './Footer';
|
|
@@ -11,8 +13,15 @@ import { OnTopButton } from './OnTopButton';
|
|
|
11
13
|
import { SkeletonGrid } from './SkeletonGrid';
|
|
12
14
|
import { ContentStateWrapper } from './styles';
|
|
13
15
|
import { useLogic } from './useLogic';
|
|
16
|
+
const rootCva = cva([cardGridClassnames.root, selfContainedClassname], {
|
|
17
|
+
variants: {
|
|
18
|
+
isLoading: {
|
|
19
|
+
true: cardGridClassnames.loading,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
});
|
|
14
23
|
export const CardGridInfinite = (props) => {
|
|
15
|
-
const { contentStateProps, desktopCardWidth, virtuosoProps, scrollParent, skeleton, footerProps, onTopButtonProps, list, noDataImgSrc, defineCard,
|
|
24
|
+
const { contentStateProps, desktopCardWidth, virtuosoProps, scrollParent, skeleton, footerProps, onTopButtonProps, list, noDataImgSrc, defineCard, isLoading, isMobile, } = useLogic(props);
|
|
16
25
|
const VirtuosoList = useMemo(() => forwardRef((listProps, ref) => (_jsx(List, { ...listProps, ref: ref, desktopCardWidth: desktopCardWidth }))), [desktopCardWidth]);
|
|
17
26
|
const renderVirtuoso = () => {
|
|
18
27
|
if (!scrollParent) {
|
|
@@ -30,5 +39,5 @@ export const CardGridInfinite = (props) => {
|
|
|
30
39
|
Footer: () => _jsx(Footer, { ...footerProps }),
|
|
31
40
|
}, itemContent: (_, item) => _jsx(Card, { item: item, ...defineCard(item) }) }));
|
|
32
41
|
};
|
|
33
|
-
return (_jsx(ContentStateWrapper, { className:
|
|
42
|
+
return (_jsx(ContentStateWrapper, { className: rootCva({ isLoading }), children: _jsx(ContentState, { ...contentStateProps, loadingContent: _jsx(SkeletonGrid, { skeleton: skeleton, desktopCardWidth: desktopCardWidth }), children: list?.length ? (_jsxs(_Fragment, { children: [renderVirtuoso(), _jsx(OnTopButton, { ...onTopButtonProps })] })) : (_jsx(NoDataPlaceholder, { noDataImgSrc: noDataImgSrc })) }) }));
|
|
34
43
|
};
|
|
@@ -37,6 +37,6 @@ export declare const useLogic: <TDataItem extends Record<string, unknown>>({ lis
|
|
|
37
37
|
list: TDataItem[] | undefined;
|
|
38
38
|
noDataImgSrc: string | undefined;
|
|
39
39
|
defineCard: (itemData: TDataItem) => Omit<import("..").CardProps<TDataItem>, "item">;
|
|
40
|
-
|
|
40
|
+
isLoading: boolean | undefined;
|
|
41
41
|
};
|
|
42
42
|
export {};
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
import { useContext,
|
|
1
|
+
import { useContext, useMemo } from 'react';
|
|
2
2
|
import { ConfigContext } from '../../ConfigProvider';
|
|
3
3
|
import { useScrollManagement } from '../../useScrollManagement';
|
|
4
4
|
import { useStickyButton } from '../../useStickyButton';
|
|
5
5
|
import { useViewportType } from '../../useViewportType';
|
|
6
|
-
import {
|
|
7
|
-
import { cardGridClassnames, OVERSCAN, VIRTUOSO_CONTAINER_ID, } from '../constants';
|
|
6
|
+
import { OVERSCAN, VIRTUOSO_CONTAINER_ID } from '../constants';
|
|
8
7
|
export const useLogic = ({ list, isLoading, isError, errorMsg, errorImgSrc, scrollRef, skeleton, onRetry, endOfScrollMsg, isEndReached, onLoadMore, noDataImgSrc, defineCard, desktopCardWidth, }) => {
|
|
9
8
|
const { imagesMap } = useContext(ConfigContext);
|
|
10
9
|
const { isMobile } = useViewportType();
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
if (isMobile && scrollRef?.current) {
|
|
13
|
-
scrollRef.current.style.backgroundColor = 'unset';
|
|
14
|
-
scrollRef.current.style.padding = 'unset';
|
|
15
|
-
}
|
|
16
|
-
}, [isMobile]);
|
|
17
10
|
const contentStateProps = useMemo(() => {
|
|
18
11
|
const isNoData = !list?.length;
|
|
19
12
|
return {
|
|
@@ -39,9 +32,6 @@ export const useLogic = ({ list, isLoading, isError, errorMsg, errorImgSrc, scro
|
|
|
39
32
|
recalculateVerticalScroll();
|
|
40
33
|
propsHandleRangeChanged(range);
|
|
41
34
|
};
|
|
42
|
-
const classnames = useMemo(() => classNames(cardGridClassnames.root, {
|
|
43
|
-
[cardGridClassnames.loading]: isLoading,
|
|
44
|
-
}), [isLoading]);
|
|
45
35
|
return {
|
|
46
36
|
contentStateProps,
|
|
47
37
|
desktopCardWidth,
|
|
@@ -71,6 +61,6 @@ export const useLogic = ({ list, isLoading, isError, errorMsg, errorImgSrc, scro
|
|
|
71
61
|
list,
|
|
72
62
|
noDataImgSrc,
|
|
73
63
|
defineCard,
|
|
74
|
-
|
|
64
|
+
isLoading,
|
|
75
65
|
};
|
|
76
66
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type SvgIconProps } from '@mui/material/SvgIcon';
|
|
2
1
|
import type { ReactElement } from 'react';
|
|
2
|
+
import { type SvgIconProps } from '../SvgIcon';
|
|
3
3
|
import { type WithoutEmotionSpecific } from '../types/WithoutEmotionSpecific';
|
|
4
4
|
export type ChevronProps = {
|
|
5
5
|
isActive?: boolean;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Button } from '../Button';
|
|
3
3
|
import { Popover } from '../Popover';
|
|
4
|
-
import { DEFAULT_ANCHOR_ORIGIN, DEFAULT_TRANSFORM_ORIGIN } from './constants';
|
|
4
|
+
import { DEFAULT_ANCHOR_ORIGIN, DEFAULT_MOBILE_TITLE, DEFAULT_TRANSFORM_ORIGIN, } from './constants';
|
|
5
5
|
import { Actions, StyledTypography, Wrapper } from './styles';
|
|
6
6
|
import { useLogic } from './useLogic';
|
|
7
7
|
export const ConfirmAction = (props) => {
|
|
8
8
|
const { actionComponentProps, popoverProps, cancelButtonProps, confirmButtonProps, } = useLogic(props);
|
|
9
9
|
const { text, confirmButtonProps: externalConfirmButtonProps, popoverProps: externalPopoverProps, actionComponent, } = props;
|
|
10
10
|
const { text: confirmButtonText = 'Подтвердить' } = externalConfirmButtonProps || {};
|
|
11
|
-
const { anchorOrigin = DEFAULT_ANCHOR_ORIGIN, transformOrigin = DEFAULT_TRANSFORM_ORIGIN, } = externalPopoverProps || {};
|
|
12
|
-
return (_jsxs(_Fragment, { children: [actionComponent(actionComponentProps), _jsx(Popover, { anchorOrigin: anchorOrigin, transformOrigin: transformOrigin, ...popoverProps, children: _jsxs(Wrapper, { children: [text && _jsx(StyledTypography, { children: text }), _jsxs(Actions, { children: [_jsx(Button, { variant: "text", ...cancelButtonProps, children: "\u041E\u0442\u043C\u0435\u043D\u0430" }), _jsx(Button, { ...confirmButtonProps, children: confirmButtonText })] })] }) })] }));
|
|
11
|
+
const { anchorOrigin = DEFAULT_ANCHOR_ORIGIN, transformOrigin = DEFAULT_TRANSFORM_ORIGIN, title = DEFAULT_MOBILE_TITLE, } = externalPopoverProps || {};
|
|
12
|
+
return (_jsxs(_Fragment, { children: [actionComponent(actionComponentProps), _jsx(Popover, { anchorOrigin: anchorOrigin, transformOrigin: transformOrigin, title: title, ...popoverProps, children: _jsxs(Wrapper, { children: [text && _jsx(StyledTypography, { children: text }), _jsxs(Actions, { children: [_jsx(Button, { variant: "text", ...cancelButtonProps, children: "\u041E\u0442\u043C\u0435\u043D\u0430" }), _jsx(Button, { ...confirmButtonProps, children: confirmButtonText })] })] }) })] }));
|
|
13
13
|
};
|
|
@@ -6,6 +6,7 @@ export declare const DEFAULT_TRANSFORM_ORIGIN: {
|
|
|
6
6
|
vertical: string;
|
|
7
7
|
horizontal: string;
|
|
8
8
|
};
|
|
9
|
+
export declare const DEFAULT_MOBILE_TITLE = "\u041F\u043E\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043D\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044F";
|
|
9
10
|
export declare const confirmActionClassnames: {
|
|
10
11
|
actionComponent: string;
|
|
11
12
|
};
|
|
@@ -7,6 +7,7 @@ export const DEFAULT_TRANSFORM_ORIGIN = {
|
|
|
7
7
|
vertical: 'top',
|
|
8
8
|
horizontal: 'right',
|
|
9
9
|
};
|
|
10
|
+
export const DEFAULT_MOBILE_TITLE = 'Подтверждение действия';
|
|
10
11
|
export const confirmActionClassnames = {
|
|
11
12
|
actionComponent: createUIKitClassname('confirm-action__action-component'),
|
|
12
13
|
};
|
|
@@ -6,13 +6,26 @@ export const Wrapper = styled.div `
|
|
|
6
6
|
|
|
7
7
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
8
8
|
max-width: unset;
|
|
9
|
+
padding: 0;
|
|
9
10
|
}
|
|
10
11
|
`;
|
|
11
12
|
export const StyledTypography = styled(Typography) `
|
|
12
13
|
margin-bottom: ${({ theme }) => theme.spacing(3)};
|
|
14
|
+
|
|
15
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
16
|
+
margin: 0;
|
|
17
|
+
padding: ${({ theme }) => theme.spacing(5, 4)};
|
|
18
|
+
}
|
|
13
19
|
`;
|
|
14
20
|
export const Actions = styled.div `
|
|
15
21
|
display: flex;
|
|
16
22
|
gap: ${({ theme }) => theme.spacing(3)};
|
|
17
23
|
justify-content: end;
|
|
24
|
+
|
|
25
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
26
|
+
flex-direction: column-reverse;
|
|
27
|
+
gap: ${({ theme }) => theme.spacing(2)};
|
|
28
|
+
|
|
29
|
+
padding: ${({ theme }) => theme.spacing(4)};
|
|
30
|
+
}
|
|
18
31
|
`;
|
|
@@ -25,7 +25,7 @@ export type ConfirmActionProps = {
|
|
|
25
25
|
/**
|
|
26
26
|
* Параметры всплывающего окна
|
|
27
27
|
*/
|
|
28
|
-
popoverProps?: Pick<PopoverProps, 'anchorOrigin' | 'transformOrigin'>;
|
|
28
|
+
popoverProps?: Pick<PopoverProps, 'anchorOrigin' | 'transformOrigin' | 'title'>;
|
|
29
29
|
/**
|
|
30
30
|
* Кнопка, действие которой необходимо подтвердить
|
|
31
31
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { BodyProps } from './types';
|
|
2
|
-
export declare const Body: <TData extends Record<string, unknown>>({ rows, selectedRows, minDisplayRows, keyId, noDataPlaceholder, className, ...rowProps }: BodyProps<TData>) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const Body: <TData extends Record<string, unknown>>({ rows, selectedRows, minDisplayRows, keyId, noDataPlaceholder, className, renderRow, columns, isSelectable, onSelectRow, onRowEnter, onRowLeave, registerRowElement, unregisterRowElement, ...rowProps }: BodyProps<TData>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { classNames } from '../../utils/classNames';
|
|
3
3
|
import { cva } from '../../utils/cva';
|
|
4
|
+
import { CustomRowWrapper } from '../CustomRowWrapper';
|
|
4
5
|
import { Row } from '../Row';
|
|
5
6
|
import { RowContextProvider } from '../Row/RowContext';
|
|
6
7
|
import { bodyClassnames } from './constants';
|
|
@@ -14,12 +15,13 @@ const bodyCva = cva(bodyClassnames.root, {
|
|
|
14
15
|
},
|
|
15
16
|
},
|
|
16
17
|
});
|
|
17
|
-
export const Body = ({ rows, selectedRows = [], minDisplayRows, keyId, noDataPlaceholder, className, ...rowProps }) => {
|
|
18
|
+
export const Body = ({ rows, selectedRows = [], minDisplayRows, keyId, noDataPlaceholder, className, renderRow, columns, isSelectable, onSelectRow, onRowEnter, onRowLeave, registerRowElement, unregisterRowElement, ...rowProps }) => {
|
|
18
19
|
const { disableMinHeight, bodyCssVars } = useLogic({ minDisplayRows });
|
|
19
|
-
const renderedRows = rows.map((
|
|
20
|
+
const renderedRows = rows.map((row, index) => {
|
|
20
21
|
const rowId = row[keyId];
|
|
21
22
|
const isSelected = Boolean(selectedRows?.find((selectedRow) => selectedRow[keyId] === rowId));
|
|
22
|
-
|
|
23
|
+
const { children, options } = row;
|
|
24
|
+
return (_jsx(RowContextProvider, { row: row, onSelectRow: onSelectRow, onRowEnter: onRowEnter, onRowLeave: onRowLeave, registerRowElement: registerRowElement, unregisterRowElement: unregisterRowElement, isSelectable: isSelectable, isSelected: isSelected, children: renderRow ? (_jsx(CustomRowWrapper, { index: index, renderRow: renderRow, row: row })) : (_jsx(Row, { row: row, options: options, keyId: keyId, level: INITIAL_LEVEL, nestedChildren: children, isSelected: isSelected, columns: columns, isSelectable: isSelectable, onSelectRow: onSelectRow, onRowEnter: onRowEnter, onRowLeave: onRowLeave, registerRowElement: registerRowElement, unregisterRowElement: unregisterRowElement, ...rowProps }, rowId)) }, rowId));
|
|
23
25
|
});
|
|
24
26
|
return (_jsx(Wrapper, { className: classNames(className, bodyCva({ disableMinHeight })), style: bodyCssVars, children: rows.length ? renderedRows : noDataPlaceholder }));
|
|
25
27
|
};
|
|
@@ -107,4 +107,9 @@ export type BodyProps<TData extends Record<string, CellValue>> = {
|
|
|
107
107
|
* Класс применяемый для корневого элемента
|
|
108
108
|
*/
|
|
109
109
|
className?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Кастомный компонент для отображения строк таблицы
|
|
112
|
+
*/
|
|
113
|
+
renderRow?: (row: TData, index: number) => ReactNode;
|
|
110
114
|
};
|
|
115
|
+
export type ContextOnSelectRow = (row: Record<string, unknown>) => (event: ChangeEvent<HTMLInputElement>) => void;
|
|
@@ -30,5 +30,13 @@ export type CellProps<TData extends Record<string, CellValue>> = {
|
|
|
30
30
|
* Скрытие ячейки на мобильных устройствах
|
|
31
31
|
*/
|
|
32
32
|
isHideOnMobile?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Флаг наличия вложенных элементов в строке
|
|
35
|
+
*/
|
|
36
|
+
hasNestedChildren?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Ссылка на корневой элемент строки
|
|
39
|
+
*/
|
|
40
|
+
rootRowElement?: HTMLLIElement | null;
|
|
33
41
|
};
|
|
34
|
-
export declare const Cell: <TData extends Record<string, unknown>>(props: CellProps<TData>) => import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export declare const Cell: <TData extends Record<string, unknown>>(props: CellProps<TData>) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { createPortal } from 'react-dom';
|
|
2
3
|
import { OverflowTypography } from '../../OverflowTypography';
|
|
3
4
|
import { useHidePersonalData } from '../../personalDataSecurity';
|
|
5
|
+
import { useViewportType } from '../../useViewportType';
|
|
4
6
|
import { classNames } from '../../utils/classNames';
|
|
5
7
|
import { cva } from '../../utils/cva';
|
|
6
8
|
import { getInertProps } from '../../utils/getInertProps';
|
|
@@ -23,6 +25,9 @@ const cellCva = cva(dataGridCellClassnames.root, {
|
|
|
23
25
|
center: dataGridCellClassnames.alignCenter,
|
|
24
26
|
right: dataGridCellClassnames.alignRight,
|
|
25
27
|
},
|
|
28
|
+
isActionColumn: {
|
|
29
|
+
true: dataGridCellClassnames.actionColumn,
|
|
30
|
+
},
|
|
26
31
|
},
|
|
27
32
|
});
|
|
28
33
|
const cellContentCva = cva(dataGridCellClassnames.cellContent, {
|
|
@@ -44,17 +49,26 @@ const columnLabelCva = cva(dataGridCellClassnames.columnLabel, {
|
|
|
44
49
|
});
|
|
45
50
|
export const Cell = (props) => {
|
|
46
51
|
const { formattedValue, hasStartAdornment, isActionColumn, label, hideTitleOnMobile, isTabularNums, } = useLogic(props);
|
|
47
|
-
const { className, startAdornment, row, cell, isDisabled, isHidePersonalData, isHideOnMobile, } = props;
|
|
52
|
+
const { className, startAdornment, row, cell, isDisabled, isHidePersonalData, isHideOnMobile, hasNestedChildren, rootRowElement, } = props;
|
|
48
53
|
const { renderCell, align = 'left' } = cell;
|
|
54
|
+
const { isMobile } = useViewportType();
|
|
49
55
|
const hidePersonalDataClassname = useHidePersonalData({
|
|
50
56
|
isEnabled: isHidePersonalData === true,
|
|
51
57
|
});
|
|
52
|
-
|
|
58
|
+
const cellNode = (_jsxs(Wrapper, { className: classNames(className, hidePersonalDataClassname, cellCva({
|
|
53
59
|
isHideOnMobile: cell.isHideOnMobile || isHideOnMobile,
|
|
54
60
|
isDisabled,
|
|
55
61
|
withStartAdornment: hasStartAdornment,
|
|
56
62
|
align,
|
|
63
|
+
isActionColumn,
|
|
57
64
|
})), ...getInertProps(isDisabled), children: [startAdornment && startAdornment, _jsxs(CellContent, { className: cellContentCva({ isActionColumn, isTabularNums }), children: [_jsx(ColumnLabel, { variant: "caption", color: "textSecondary", className: columnLabelCva({
|
|
58
65
|
hidden: hideTitleOnMobile || isActionColumn,
|
|
59
66
|
}), children: label }), renderCell?.(row), !renderCell && (_jsx(OverflowTypography, { rowsCount: 2, tooltipProps: { className: hidePersonalDataClassname }, children: _jsx(_Fragment, { children: formattedValue }) }))] })] }));
|
|
67
|
+
if (isActionColumn && isMobile && hasNestedChildren) {
|
|
68
|
+
if (!rootRowElement) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
return createPortal(cellNode, rootRowElement);
|
|
72
|
+
}
|
|
73
|
+
return cellNode;
|
|
60
74
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type RenderRow } from '../types';
|
|
3
|
+
type CustomRowWrapperProps = {
|
|
4
|
+
index: number;
|
|
5
|
+
renderRow: RenderRow;
|
|
6
|
+
row: Record<string, unknown>;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Обёртка с `memo` для изоляции пользовательского `renderRow`.
|
|
10
|
+
*
|
|
11
|
+
* При re-render родителя (`Body`, Virtuoso `Item`) без обёртки `renderRow(row, index)`
|
|
12
|
+
* вызывается заново на каждой строке и каждый раз создаёт новые React-elements, из‑за чего `memo` у дочерних компонентов
|
|
13
|
+
* (например, `DataGridCollapsibleRow`) не срабатывает.
|
|
14
|
+
*
|
|
15
|
+
* `CustomRowWrapper` повторно вызывает `renderRow` только когда изменились
|
|
16
|
+
* `index`, `row` или ссылка на `renderRow`.
|
|
17
|
+
*/
|
|
18
|
+
export declare const CustomRowWrapper: import("react").MemoExoticComponent<({ index, renderRow, row }: CustomRowWrapperProps) => import("react/jsx-runtime").JSX.Element>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Обёртка с `memo` для изоляции пользовательского `renderRow`.
|
|
5
|
+
*
|
|
6
|
+
* При re-render родителя (`Body`, Virtuoso `Item`) без обёртки `renderRow(row, index)`
|
|
7
|
+
* вызывается заново на каждой строке и каждый раз создаёт новые React-elements, из‑за чего `memo` у дочерних компонентов
|
|
8
|
+
* (например, `DataGridCollapsibleRow`) не срабатывает.
|
|
9
|
+
*
|
|
10
|
+
* `CustomRowWrapper` повторно вызывает `renderRow` только когда изменились
|
|
11
|
+
* `index`, `row` или ссылка на `renderRow`.
|
|
12
|
+
*/
|
|
13
|
+
export const CustomRowWrapper = memo(({ index, renderRow, row }) => {
|
|
14
|
+
return _jsx(_Fragment, { children: renderRow(row, index) });
|
|
15
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CustomRowWrapper } from './CustomRowWrapper';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CustomRowWrapper } from './CustomRowWrapper';
|
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useCallback, useContext } from 'react';
|
|
3
3
|
import { ConfigContext } from '../ConfigProvider';
|
|
4
4
|
import { ContentState } from '../ContentState';
|
|
5
|
+
import { selfContainedClassname } from '../constants';
|
|
5
6
|
import { classNames } from '../utils/classNames';
|
|
6
7
|
import { cva } from '../utils/cva';
|
|
7
8
|
import { getInertProps } from '../utils/getInertProps';
|
|
@@ -38,6 +39,13 @@ const dataGridCva = cva(dataGridClassnames.root, {
|
|
|
38
39
|
hasGroupedColumns: {
|
|
39
40
|
true: dataGridClassnames.hasGroupedColumns,
|
|
40
41
|
},
|
|
42
|
+
mobileDisplayVariant: {
|
|
43
|
+
cards: dataGridClassnames.mobileVariantCards,
|
|
44
|
+
list: dataGridClassnames.mobileVariantList,
|
|
45
|
+
},
|
|
46
|
+
isSelfContained: {
|
|
47
|
+
true: selfContainedClassname,
|
|
48
|
+
},
|
|
41
49
|
},
|
|
42
50
|
});
|
|
43
51
|
const bodyCva = cva(dataGridClassnames.body, {
|
|
@@ -48,9 +56,9 @@ const bodyCva = cva(dataGridClassnames.body, {
|
|
|
48
56
|
},
|
|
49
57
|
});
|
|
50
58
|
export const DataGrid = (props) => {
|
|
51
|
-
const { dataGridClassName, isDataGridDisabled, treeRenderConfig, headColumns, headProps, bodyProps, gridColumns, loaderProps, renderRows, isAllowHorizontalScroll, isHideHead, hasPinnedColumns, contentStateProps, rowHoverProps, containerRef, sections, isNoData, isMobile, mobileSkeletonProps, isLoading, containerCssVars, hasGroupedColumns, gridViewMode, } = useLogic(props);
|
|
59
|
+
const { dataGridClassName, isDataGridDisabled, treeRenderConfig, headColumns, headProps, bodyProps, gridColumns, loaderProps, renderRows, isAllowHorizontalScroll, isHideHead, hasPinnedColumns, contentStateProps, rowHoverProps, containerRef, sections, isNoData, isMobile, mobileSkeletonProps, isLoading, containerCssVars, hasGroupedColumns, gridViewMode, mobileDisplayVariant, isSelfContained, } = useLogic(props);
|
|
52
60
|
const { emptySymbol } = useContext(ConfigContext);
|
|
53
|
-
const { columns, selectedRows = [], minDisplayRows = MIN_DISPLAY_ROWS_BY_DEFAULT, variant = Variant.Tree, footer, noDataPlaceholder, subrows, keyId, activeRowId, emptyCellValue = emptySymbol, onRowClick, noDataOptions, headPreAddon, isTabularNums, } = props;
|
|
61
|
+
const { columns, selectedRows = [], minDisplayRows = MIN_DISPLAY_ROWS_BY_DEFAULT, variant = Variant.Tree, footer, noDataPlaceholder, subrows, keyId, activeRowId, emptyCellValue = emptySymbol, onRowClick, noDataOptions, headPreAddon, isTabularNums, renderRow, } = props;
|
|
54
62
|
const { moreButtonColumnPosition = 1, isVisibleCollapseButton = true } = subrows || {};
|
|
55
63
|
const { isInitialExpanded = false, expandedLevel = EXPANDED_LEVEL_BY_DEFAULT, initialVisibleChildrenCount = INITIAL_OPENED_NESTED_CHILDREN_COUNT_BY_DEFAULT, } = treeRenderConfig || {};
|
|
56
64
|
const Wrapper = isDataGridDisabled
|
|
@@ -78,6 +86,7 @@ export const DataGrid = (props) => {
|
|
|
78
86
|
noDataPlaceholder: renderedPlaceholder(),
|
|
79
87
|
onRowClick,
|
|
80
88
|
...rowHoverProps,
|
|
89
|
+
renderRow,
|
|
81
90
|
};
|
|
82
91
|
const renderTableContent = () => {
|
|
83
92
|
if (!hasPinnedColumns || isMobile) {
|
|
@@ -89,10 +98,12 @@ export const DataGrid = (props) => {
|
|
|
89
98
|
isDisabled: isDataGridDisabled,
|
|
90
99
|
}), isDisabled: isDataGridDisabled, headProps: headProps, gridColumns: gridColumns, bodyProps: commonBodyProps, isNoData: isNoData }) }));
|
|
91
100
|
};
|
|
92
|
-
return (_jsx(DataGridContextProvider, { isLoading: isLoading, isTabularNums: isTabularNums, children: _jsxs(Container, { ref: containerRef, style: containerCssVars, className: classNames(dataGridClassName, dataGridCva({
|
|
101
|
+
return (_jsx(DataGridContextProvider, { isLoading: isLoading, isTabularNums: isTabularNums, gridColumns: gridColumns, emptyCellValue: emptyCellValue, activeRowId: activeRowId, keyId: keyId, columns: columns, onRowClick: onRowClick, mobileDisplayVariant: mobileDisplayVariant, children: _jsxs(Container, { ref: containerRef, style: containerCssVars, className: classNames(dataGridClassName, dataGridCva({
|
|
93
102
|
isAllowHorizontalScroll,
|
|
94
103
|
hasPinnedColumns,
|
|
95
104
|
gridViewMode,
|
|
96
105
|
hasGroupedColumns,
|
|
106
|
+
mobileDisplayVariant,
|
|
107
|
+
isSelfContained,
|
|
97
108
|
})), children: [renderTableContent(), _jsx(Loader, { ...loaderProps }), footer && footer] }) }));
|
|
98
109
|
};
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type DataGridColumns } from '../types';
|
|
2
3
|
export type DataGridContextProps = {
|
|
3
|
-
checkIsOpened: (key: string) => boolean;
|
|
4
|
-
checkIsMoreOpened: (key: string) => boolean;
|
|
5
|
-
toggleOpenItems: (key: string) => void;
|
|
6
|
-
toggleOpenMoreItems: (key: string) => void;
|
|
7
4
|
isLoading?: boolean;
|
|
8
5
|
isTabularNums?: boolean;
|
|
6
|
+
gridColumns: string;
|
|
7
|
+
emptyCellValue: ReactNode;
|
|
8
|
+
activeRowId?: string;
|
|
9
|
+
keyId: unknown;
|
|
10
|
+
columns: DataGridColumns<Record<string, unknown>>[];
|
|
11
|
+
onRowClick?: (row: Record<string, unknown>) => void;
|
|
12
|
+
mobileDisplayVariant?: 'list' | 'cards';
|
|
9
13
|
};
|
|
10
14
|
export declare const DataGridContext: import("react").Context<DataGridContextProps>;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { createContext } from 'react';
|
|
2
2
|
export const DataGridContext = createContext({
|
|
3
|
-
checkIsOpened: () => false,
|
|
4
|
-
checkIsMoreOpened: () => false,
|
|
5
|
-
toggleOpenItems: () => undefined,
|
|
6
|
-
toggleOpenMoreItems: () => undefined,
|
|
7
3
|
isLoading: false,
|
|
8
4
|
isTabularNums: false,
|
|
5
|
+
gridColumns: '',
|
|
6
|
+
emptyCellValue: '',
|
|
7
|
+
activeRowId: '',
|
|
8
|
+
keyId: '',
|
|
9
|
+
columns: [],
|
|
10
|
+
onRowClick: () => undefined,
|
|
11
|
+
mobileDisplayVariant: 'list',
|
|
9
12
|
});
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
isTabularNums?: boolean;
|
|
2
|
+
import { type DataGridContextProps } from '../DataGridContext';
|
|
3
|
+
type DataGridContextProviderProps = Pick<DataGridContextProps, 'isLoading' | 'isTabularNums' | 'gridColumns' | 'emptyCellValue' | 'activeRowId' | 'keyId' | 'columns' | 'onRowClick' | 'mobileDisplayVariant'> & {
|
|
5
4
|
children: ReactNode;
|
|
6
5
|
};
|
|
7
|
-
export declare const DataGridContextProvider: ({ isLoading, isTabularNums, children, }: DataGridContextProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const DataGridContextProvider: ({ isLoading, isTabularNums, gridColumns, emptyCellValue, activeRowId, children, keyId, columns, onRowClick, mobileDisplayVariant, }: DataGridContextProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export {};
|
|
@@ -1,58 +1,28 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import { DataGridStorageProvider } from '../../DataGridStorageContext';
|
|
3
4
|
import { DataGridContext } from '../DataGridContext';
|
|
4
|
-
const
|
|
5
|
-
isOpenedItems: true,
|
|
6
|
-
iOpenedMoreItems: false,
|
|
7
|
-
};
|
|
8
|
-
export const DataGridContextProvider = ({ isLoading, isTabularNums, children, }) => {
|
|
9
|
-
const [openedItems, setOpenedItems] = useState({});
|
|
10
|
-
const checkIsOpened = useCallback((key) => {
|
|
11
|
-
if (openedItems[key]) {
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
return false;
|
|
15
|
-
}, [openedItems]);
|
|
16
|
-
const checkIsMoreOpened = useCallback((key) => {
|
|
17
|
-
if (openedItems[key]) {
|
|
18
|
-
return openedItems[key].iOpenedMoreItems;
|
|
19
|
-
}
|
|
20
|
-
return false;
|
|
21
|
-
}, [openedItems]);
|
|
22
|
-
const toggleOpenItems = useCallback((key) => setOpenedItems((currentOpenedItems) => {
|
|
23
|
-
if (checkIsOpened(key)) {
|
|
24
|
-
const newOpenedItems = { ...currentOpenedItems };
|
|
25
|
-
delete newOpenedItems[key];
|
|
26
|
-
return newOpenedItems;
|
|
27
|
-
}
|
|
28
|
-
return { ...currentOpenedItems, [key]: ROW_FLAGS_BY_DEFAULT };
|
|
29
|
-
}), [openedItems]);
|
|
30
|
-
const toggleOpenMoreItems = useCallback((key) => setOpenedItems((currentOpenedItems) => {
|
|
31
|
-
if (checkIsMoreOpened(key)) {
|
|
32
|
-
const newOpenedItems = { ...currentOpenedItems };
|
|
33
|
-
newOpenedItems[key] = ROW_FLAGS_BY_DEFAULT;
|
|
34
|
-
return newOpenedItems;
|
|
35
|
-
}
|
|
36
|
-
return {
|
|
37
|
-
...currentOpenedItems,
|
|
38
|
-
[key]: { ...ROW_FLAGS_BY_DEFAULT, iOpenedMoreItems: true },
|
|
39
|
-
};
|
|
40
|
-
}), [openedItems]);
|
|
5
|
+
export const DataGridContextProvider = ({ isLoading, isTabularNums, gridColumns, emptyCellValue, activeRowId, children, keyId, columns, onRowClick, mobileDisplayVariant, }) => {
|
|
41
6
|
const contextValue = useMemo(() => ({
|
|
42
|
-
checkIsOpened,
|
|
43
|
-
checkIsMoreOpened,
|
|
44
|
-
toggleOpenItems,
|
|
45
|
-
toggleOpenMoreItems,
|
|
46
7
|
isLoading,
|
|
47
8
|
isTabularNums,
|
|
9
|
+
gridColumns,
|
|
10
|
+
emptyCellValue,
|
|
11
|
+
activeRowId,
|
|
12
|
+
keyId,
|
|
13
|
+
columns,
|
|
14
|
+
onRowClick,
|
|
15
|
+
mobileDisplayVariant,
|
|
48
16
|
}), [
|
|
49
|
-
checkIsOpened,
|
|
50
|
-
checkIsMoreOpened,
|
|
51
|
-
toggleOpenItems,
|
|
52
|
-
toggleOpenMoreItems,
|
|
53
17
|
isLoading,
|
|
54
|
-
openedItems,
|
|
55
18
|
isTabularNums,
|
|
19
|
+
gridColumns,
|
|
20
|
+
emptyCellValue,
|
|
21
|
+
activeRowId,
|
|
22
|
+
keyId,
|
|
23
|
+
columns,
|
|
24
|
+
onRowClick,
|
|
25
|
+
mobileDisplayVariant,
|
|
56
26
|
]);
|
|
57
|
-
return (_jsx(DataGridContext.Provider, { value: contextValue, children: children }));
|
|
27
|
+
return (_jsx(DataGridContext.Provider, { value: contextValue, children: _jsx(DataGridStorageProvider, { children: children }) }));
|
|
58
28
|
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export type DataGridStorageContextProps = {
|
|
3
|
+
getItem: (key: string) => unknown;
|
|
4
|
+
setItem: (key: string, value: unknown) => void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Контекст хранилища для сохранения и чтения локального UI-состояния внутри компонента DataGrid.
|
|
8
|
+
*
|
|
9
|
+
* Это обычный объект, а не React-состояние и не `localStorage`.
|
|
10
|
+
* `setItem` не вызывает ре-рендер; данные живут, пока смонтирован `DataGrid`, и теряются при размонтировании.
|
|
11
|
+
*
|
|
12
|
+
* Провайдер подключается внутри `DataGridProvider`.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* // Сохранить значение между размонтированием и повторным монтированием дочернего компонента
|
|
16
|
+
* const { getItem, setItem } = useContext(DataGridStorageContext);
|
|
17
|
+
* const key = `row-expanded:${rowId}`;
|
|
18
|
+
*
|
|
19
|
+
* const [isOpen, setIsOpen] = useState(
|
|
20
|
+
* getItem(key) !== undefined ? (getItem(key) as boolean) : initialOpen,
|
|
21
|
+
* );
|
|
22
|
+
*
|
|
23
|
+
* const handleToggle = () => {
|
|
24
|
+
* const next = !isOpen;
|
|
25
|
+
* setIsOpen(next);
|
|
26
|
+
* setItem(key, next);
|
|
27
|
+
* };
|
|
28
|
+
*/
|
|
29
|
+
export declare const DataGridStorageContext: import("react").Context<DataGridStorageContextProps>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { createContext } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Контекст хранилища для сохранения и чтения локального UI-состояния внутри компонента DataGrid.
|
|
4
|
+
*
|
|
5
|
+
* Это обычный объект, а не React-состояние и не `localStorage`.
|
|
6
|
+
* `setItem` не вызывает ре-рендер; данные живут, пока смонтирован `DataGrid`, и теряются при размонтировании.
|
|
7
|
+
*
|
|
8
|
+
* Провайдер подключается внутри `DataGridProvider`.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* // Сохранить значение между размонтированием и повторным монтированием дочернего компонента
|
|
12
|
+
* const { getItem, setItem } = useContext(DataGridStorageContext);
|
|
13
|
+
* const key = `row-expanded:${rowId}`;
|
|
14
|
+
*
|
|
15
|
+
* const [isOpen, setIsOpen] = useState(
|
|
16
|
+
* getItem(key) !== undefined ? (getItem(key) as boolean) : initialOpen,
|
|
17
|
+
* );
|
|
18
|
+
*
|
|
19
|
+
* const handleToggle = () => {
|
|
20
|
+
* const next = !isOpen;
|
|
21
|
+
* setIsOpen(next);
|
|
22
|
+
* setItem(key, next);
|
|
23
|
+
* };
|
|
24
|
+
*/
|
|
25
|
+
export const DataGridStorageContext = createContext({
|
|
26
|
+
getItem: () => undefined,
|
|
27
|
+
setItem: () => undefined,
|
|
28
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo, useRef } from 'react';
|
|
3
|
+
import { DataGridStorageContext } from '../DataGridStorageContext';
|
|
4
|
+
export const DataGridStorageProvider = ({ children, }) => {
|
|
5
|
+
const storageRef = useRef({});
|
|
6
|
+
const getItem = useCallback((key) => storageRef.current[key], []);
|
|
7
|
+
const setItem = useCallback((key, value) => {
|
|
8
|
+
storageRef.current[key] = value;
|
|
9
|
+
}, []);
|
|
10
|
+
const contextValue = useMemo(() => ({ getItem, setItem }), [getItem, setItem]);
|
|
11
|
+
return (_jsx(DataGridStorageContext.Provider, { value: contextValue, children: children }));
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DataGridStorageProvider';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DataGridStorageProvider';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
type MobileSkeletonProps = {
|
|
2
2
|
cellsCount: number;
|
|
3
3
|
rowsCount: number;
|
|
4
|
+
mobileDisplayVariant: 'cards' | 'list';
|
|
4
5
|
};
|
|
5
|
-
export declare const MobileSkeleton: ({ cellsCount, rowsCount, }: MobileSkeletonProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export declare const MobileSkeleton: ({ cellsCount, mobileDisplayVariant, rowsCount, }: MobileSkeletonProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export {};
|