@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
|
@@ -6,63 +6,73 @@ const react_1 = require("react");
|
|
|
6
6
|
const react_virtuoso_1 = require("react-virtuoso");
|
|
7
7
|
const ConfigProvider_1 = require("../ConfigProvider");
|
|
8
8
|
const ContentState_1 = require("../ContentState");
|
|
9
|
+
const constants_1 = require("../constants");
|
|
9
10
|
const DataGrid_1 = require("../DataGrid");
|
|
10
|
-
const
|
|
11
|
+
const constants_2 = require("../DataGrid/constants");
|
|
11
12
|
const DataGridContext_1 = require("../DataGrid/DataGridContext");
|
|
12
13
|
const enums_1 = require("../DataGrid/enums");
|
|
13
14
|
const Head_1 = require("../DataGrid/Head");
|
|
14
|
-
const Row_1 = require("../DataGrid/Row");
|
|
15
|
-
const styles_1 = require("../DataGrid/styles");
|
|
16
15
|
const Loader_1 = require("../Loader");
|
|
17
16
|
const classNames_1 = require("../utils/classNames");
|
|
18
17
|
const cva_1 = require("../utils/cva");
|
|
19
18
|
const getInertProps_1 = require("../utils/getInertProps");
|
|
20
|
-
const
|
|
19
|
+
const constants_3 = require("./constants");
|
|
20
|
+
const DataGridInfiniteContext_1 = require("./DataGridInfiniteContext");
|
|
21
21
|
const EndData_1 = require("./EndData");
|
|
22
22
|
const ErrorMessage_1 = require("./ErrorMessage");
|
|
23
23
|
const List_1 = require("./List");
|
|
24
24
|
const NoData_1 = require("./NoData");
|
|
25
|
-
const
|
|
25
|
+
const Row_1 = require("./Row");
|
|
26
|
+
const styles_1 = require("./styles");
|
|
26
27
|
const useLogic_1 = require("./useLogic");
|
|
27
|
-
const
|
|
28
|
-
const dataGridInfiniteCva = (0, cva_1.cva)(constants_1.dataGridClassnames.root, {
|
|
28
|
+
const dataGridInfiniteCva = (0, cva_1.cva)(constants_2.dataGridClassnames.root, {
|
|
29
29
|
variants: {
|
|
30
30
|
hasGroupedColumns: {
|
|
31
|
-
true:
|
|
31
|
+
true: constants_2.dataGridClassnames.hasGroupedColumns,
|
|
32
32
|
},
|
|
33
33
|
gridViewMode: {
|
|
34
|
-
full:
|
|
35
|
-
standard:
|
|
34
|
+
full: constants_2.dataGridClassnames.gridViewFull,
|
|
35
|
+
standard: constants_2.dataGridClassnames.gridViewStandard,
|
|
36
|
+
},
|
|
37
|
+
mobileDisplayVariant: {
|
|
38
|
+
cards: constants_2.dataGridClassnames.mobileVariantCards,
|
|
39
|
+
list: constants_2.dataGridClassnames.mobileVariantList,
|
|
40
|
+
},
|
|
41
|
+
isSelfContained: {
|
|
42
|
+
true: constants_1.selfContainedClassname,
|
|
36
43
|
},
|
|
37
44
|
},
|
|
38
45
|
});
|
|
39
46
|
const DataGridInfinite = (props) => {
|
|
40
47
|
const { imagesMap, emptySymbol } = (0, react_1.useContext)(ConfigProvider_1.ConfigContext);
|
|
41
|
-
const { isNoData, isDataGridDisabled, treeRenderConfig, virtuosoProps, headProps, rowProps, scrollToTopButtonProps, isEndReached, isHideHead, containerCssVars, isMobile, mobileSkeletonProps,
|
|
42
|
-
const { columns, rows = [], selectedRows = [], sorting, isLoading, isDisabled, keyId, emptyCellValue = emptySymbol, variant = enums_1.Variant.Tree, subrows, className, isError, endOfScrollMsg, errorMsg, noDataPlaceholder, onRowClick, onSort, onRetry, headPreAddon, activeRowId, } = props;
|
|
48
|
+
const { isNoData, isDataGridDisabled, treeRenderConfig, virtuosoProps, headProps, rowProps, scrollToTopButtonProps, isEndReached, isHideHead, containerCssVars, isMobile, mobileSkeletonProps, hasGroupedColumns, gridViewMode, gridColumns, handleSelectRow, mobileDisplayVariant, isSelfContained, } = (0, useLogic_1.useLogic)(props);
|
|
49
|
+
const { columns, rows = [], selectedRows = [], sorting, isLoading, isDisabled, keyId, emptyCellValue = emptySymbol, variant = enums_1.Variant.Tree, subrows, className, isError, endOfScrollMsg, errorMsg, noDataPlaceholder, onRowClick, onSort, onRetry, headPreAddon, activeRowId, isTabularNums, renderRow, } = props;
|
|
43
50
|
const { moreButtonColumnPosition = 1, isVisibleCollapseButton = true } = subrows || {};
|
|
44
|
-
const { isInitialExpanded = false, expandedLevel =
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
51
|
+
const { isInitialExpanded = false, expandedLevel = constants_2.EXPANDED_LEVEL_BY_DEFAULT, initialVisibleChildrenCount = constants_2.INITIAL_OPENED_NESTED_CHILDREN_COUNT_BY_DEFAULT, } = treeRenderConfig || {};
|
|
52
|
+
const { isSelectable } = rowProps;
|
|
53
|
+
const TableContainer = isDisabled ? styles_1.DisabledDataGridWrapper : styles_1.DataGridWrapper;
|
|
54
|
+
return ((0, jsx_runtime_1.jsx)(DataGridInfiniteContext_1.DataGridInfiniteContextProvider, { renderRow: renderRow, onSelectRow: handleSelectRow, variant: variant, isInitialExpanded: isInitialExpanded, expandedLevel: expandedLevel, initialVisibleChildrenCount: initialVisibleChildrenCount, isSelectable: isSelectable, selectedRows: selectedRows, moreButtonColumnPosition: moreButtonColumnPosition, isVisibleCollapseButton: isVisibleCollapseButton, children: (0, jsx_runtime_1.jsx)(DataGridContext_1.DataGridContextProvider, { gridColumns: gridColumns, emptyCellValue: emptyCellValue, activeRowId: activeRowId, columns: columns, keyId: keyId, isTabularNums: isTabularNums, onRowClick: onRowClick, mobileDisplayVariant: mobileDisplayVariant, children: (0, jsx_runtime_1.jsxs)(styles_1.StyledContainer, { style: containerCssVars, className: (0, classNames_1.classNames)(dataGridInfiniteCva({
|
|
55
|
+
hasGroupedColumns,
|
|
56
|
+
gridViewMode,
|
|
57
|
+
mobileDisplayVariant,
|
|
58
|
+
isSelfContained,
|
|
59
|
+
}), className), children: [headPreAddon, (0, jsx_runtime_1.jsxs)(TableContainer, { ...(0, getInertProps_1.getInertProps)(isDataGridDisabled), children: [!isHideHead && ((0, jsx_runtime_1.jsx)(Head_1.Head, { ...headProps, onSort: onSort, sorting: sorting, columns: columns })), (0, jsx_runtime_1.jsx)(ContentState_1.ContentState, { isLoading: isLoading && !isNoData, loadingTitle: "\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0434\u0430\u043D\u043D\u044B\u0445", isError: isError && !isNoData, loadingContent: isMobile && (0, jsx_runtime_1.jsx)(DataGrid_1.MobileSkeleton, { ...mobileSkeletonProps }), errorState: {
|
|
60
|
+
imgAlt: 'Что-то пошло не так',
|
|
61
|
+
errorList: [errorMsg || ''],
|
|
62
|
+
imgSrc: imagesMap.defaultErrorImgSrc,
|
|
63
|
+
onRetry,
|
|
64
|
+
}, children: (0, jsx_runtime_1.jsx)(react_virtuoso_1.Virtuoso, { ...virtuosoProps, style: { height: '100%' }, overscan: constants_3.OVERSCAN_COUNT, data: rows, components: {
|
|
65
|
+
// biome-ignore lint/suspicious/noTsIgnore: Требует HTMLDivElement, а для элемента списка используем HTMLUListElement (https://github.com/petyosi/react-virtuoso/issues/864)
|
|
66
|
+
// @ts-ignore
|
|
67
|
+
List: List_1.List,
|
|
68
|
+
Item: Row_1.Row,
|
|
69
|
+
EmptyPlaceholder: () => ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: noDataPlaceholder || (0, jsx_runtime_1.jsx)(NoData_1.NoData, {}) })),
|
|
70
|
+
Footer: () => {
|
|
71
|
+
if (!isLoading && !isError && !isEndReached) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.FooterRow, { children: [isLoading && (0, jsx_runtime_1.jsx)(Loader_1.Loader, {}), isError && (0, jsx_runtime_1.jsx)(ErrorMessage_1.ErrorMessage, { onRetry: onRetry }), isEndReached && ((0, jsx_runtime_1.jsx)(EndData_1.EndData, { endOfScrollMsg: endOfScrollMsg }))] }));
|
|
75
|
+
},
|
|
76
|
+
} }) }), (0, jsx_runtime_1.jsx)(styles_1.StyledScrollToTopButton, { ...scrollToTopButtonProps, className: constants_3.dataGridInfiniteClassnames.scrollToTopButton }), isDisabled && (0, jsx_runtime_1.jsx)(styles_1.Backdrop, {})] })] }) }) }));
|
|
67
77
|
};
|
|
68
78
|
exports.DataGridInfinite = DataGridInfinite;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type ChangeEvent, type ReactNode } from 'react';
|
|
2
|
+
export type DataGridInfiniteContextProps = {
|
|
3
|
+
renderRow: (row: Record<string, unknown>, index: number) => ReactNode;
|
|
4
|
+
onSelectRow: (row: Record<string, unknown>) => (event: ChangeEvent<HTMLInputElement>) => void;
|
|
5
|
+
variant: 'tree' | 'subrows';
|
|
6
|
+
isInitialExpanded?: boolean;
|
|
7
|
+
expandedLevel?: number;
|
|
8
|
+
initialVisibleChildrenCount?: number;
|
|
9
|
+
moreButtonColumnPosition?: number;
|
|
10
|
+
isVisibleCollapseButton?: boolean;
|
|
11
|
+
isSelectable?: boolean;
|
|
12
|
+
selectedRows?: Record<string, unknown>[];
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Контекст общих параметров для компонента `Item` внутри `DataGridInfinite`.
|
|
16
|
+
*
|
|
17
|
+
* `Item` передаётся в `Virtuoso` напрямую, без inline-обёртки: замыкание на
|
|
18
|
+
* каждом ре-рендере `DataGridInfinite` давало бы новую ссылку на компонент и
|
|
19
|
+
* лишние перерисовки виртуализированного списка.
|
|
20
|
+
*
|
|
21
|
+
* Поскольку `Virtuoso` сам управляет параметрами `Item`, общие настройки передаются через контекст.
|
|
22
|
+
*/
|
|
23
|
+
export declare const DataGridInfiniteContext: import("react").Context<DataGridInfiniteContextProps>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataGridInfiniteContext = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
/**
|
|
6
|
+
* Контекст общих параметров для компонента `Item` внутри `DataGridInfinite`.
|
|
7
|
+
*
|
|
8
|
+
* `Item` передаётся в `Virtuoso` напрямую, без inline-обёртки: замыкание на
|
|
9
|
+
* каждом ре-рендере `DataGridInfinite` давало бы новую ссылку на компонент и
|
|
10
|
+
* лишние перерисовки виртуализированного списка.
|
|
11
|
+
*
|
|
12
|
+
* Поскольку `Virtuoso` сам управляет параметрами `Item`, общие настройки передаются через контекст.
|
|
13
|
+
*/
|
|
14
|
+
exports.DataGridInfiniteContext = (0, react_1.createContext)({
|
|
15
|
+
renderRow: () => null,
|
|
16
|
+
onSelectRow: () => () => { },
|
|
17
|
+
variant: 'tree',
|
|
18
|
+
isInitialExpanded: false,
|
|
19
|
+
expandedLevel: 0,
|
|
20
|
+
initialVisibleChildrenCount: 0,
|
|
21
|
+
moreButtonColumnPosition: 0,
|
|
22
|
+
isVisibleCollapseButton: true,
|
|
23
|
+
selectedRows: [],
|
|
24
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type DataGridInfiniteContextProps } from '../DataGridInfiniteContext';
|
|
3
|
+
type DataGridInfiniteContextProviderProps = DataGridInfiniteContextProps & {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
export declare const DataGridInfiniteContextProvider: ({ children, ...props }: DataGridInfiniteContextProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataGridInfiniteContextProvider = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const DataGridInfiniteContext_1 = require("../DataGridInfiniteContext");
|
|
6
|
+
const DataGridInfiniteContextProvider = ({ children, ...props }) => {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)(DataGridInfiniteContext_1.DataGridInfiniteContext.Provider, { value: props, children: children }));
|
|
8
|
+
};
|
|
9
|
+
exports.DataGridInfiniteContextProvider = DataGridInfiniteContextProvider;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './DataGridInfiniteContextProvider';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./DataGridInfiniteContextProvider"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./DataGridInfiniteContext"), exports);
|
|
18
|
+
__exportStar(require("./DataGridInfiniteContextProvider"), exports);
|
|
@@ -4,5 +4,6 @@ exports.List = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const constants_1 = require("../constants");
|
|
7
|
+
const constants_2 = require("./constants");
|
|
7
8
|
const styles_1 = require("./styles");
|
|
8
|
-
exports.List = (0, react_1.forwardRef)(({ children, ...listProps }, ref) => ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { id: constants_1.VIRTUOSO_LIST_ID, ref: ref, ...listProps, children: children })));
|
|
9
|
+
exports.List = (0, react_1.forwardRef)(({ children, ...listProps }, ref) => ((0, jsx_runtime_1.jsx)(styles_1.Wrapper, { id: constants_1.VIRTUOSO_LIST_ID, ref: ref, ...listProps, className: constants_2.dataGridInfiniteListClassnames.root, children: children })));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dataGridInfiniteListClassnames = void 0;
|
|
4
|
+
const createUIKitClassname_1 = require("../../utils/createUIKitClassname");
|
|
5
|
+
exports.dataGridInfiniteListClassnames = {
|
|
6
|
+
root: (0, createUIKitClassname_1.createUIKitClassname)('data-grid-infinite-body'),
|
|
7
|
+
};
|
|
@@ -14,4 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.dataGridInfiniteListClassnames = void 0;
|
|
17
18
|
__exportStar(require("./List"), exports);
|
|
19
|
+
var constants_1 = require("./constants");
|
|
20
|
+
Object.defineProperty(exports, "dataGridInfiniteListClassnames", { enumerable: true, get: function () { return constants_1.dataGridInfiniteListClassnames; } });
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Row = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const CustomRowWrapper_1 = require("../../DataGrid/CustomRowWrapper");
|
|
6
|
+
const Row_1 = require("../../DataGrid/Row");
|
|
7
|
+
const RowContext_1 = require("../../DataGrid/Row/RowContext");
|
|
8
|
+
const useLogic_1 = require("./useLogic");
|
|
9
|
+
const INITIAL_LEVEL = 0;
|
|
10
|
+
const Row = ({ children, ...props }) => {
|
|
11
|
+
const { item, memoizedItemProps, onSelectRow, renderRow, flattenColumns, gridColumns, options, keyId, variant, isSelectable, isSelected, nestedChildren, isInitialExpanded, expandedLevel, initialVisibleChildrenCount, moreButtonColumnPosition, isVisibleCollapseButton, emptyCellValue, activeRowId, onRowClick, } = (0, useLogic_1.useLogic)(props);
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)(RowContext_1.RowContextProvider, { row: item, itemProps: memoizedItemProps, onSelectRow: onSelectRow, isSelectable: isSelectable, isSelected: isSelected, children: renderRow ? ((0, jsx_runtime_1.jsx)(CustomRowWrapper_1.CustomRowWrapper, { index: memoizedItemProps['data-item-index'], renderRow: renderRow, row: item })) : ((0, jsx_runtime_1.jsx)(Row_1.Row, { ...memoizedItemProps, row: item, columns: flattenColumns, gridColumns: gridColumns, options: options, keyId: keyId, variant: variant, isSelectable: isSelectable, isSelected: isSelected, level: INITIAL_LEVEL, nestedChildren: nestedChildren, isInitialExpanded: isInitialExpanded || false, expandedLevel: expandedLevel || 1, initialVisibleChildrenCount: initialVisibleChildrenCount || 2, activeRowId: activeRowId, moreButtonColumnPosition: moreButtonColumnPosition || 1, isVisibleCollapseButton: isVisibleCollapseButton || true, emptyCellValue: emptyCellValue, onRowClick: onRowClick, onSelectRow: onSelectRow })) }));
|
|
13
|
+
};
|
|
14
|
+
exports.Row = Row;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Row';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Row"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useLogic';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./useLogic"), exports);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type RowProps } from '../types';
|
|
3
|
+
type UseLogicParams = Omit<RowProps, 'children'>;
|
|
4
|
+
export declare const useLogic: ({ item, ...itemProps }: UseLogicParams) => {
|
|
5
|
+
item: Record<string, unknown>;
|
|
6
|
+
renderRow: (row: Record<string, unknown>, index: number) => import("react").ReactNode;
|
|
7
|
+
isSelected: boolean;
|
|
8
|
+
nestedChildren: unknown;
|
|
9
|
+
options: unknown;
|
|
10
|
+
flattenColumns: import("../../../DataGrid").DataGridSingleColumn<Record<string, unknown>>[];
|
|
11
|
+
gridColumns: string;
|
|
12
|
+
activeRowId: string | undefined;
|
|
13
|
+
emptyCellValue: import("react").ReactNode;
|
|
14
|
+
keyId: unknown;
|
|
15
|
+
onRowClick: ((row: Record<string, unknown>) => void) | undefined;
|
|
16
|
+
onSelectRow: (row: Record<string, unknown>) => (event: import("react").ChangeEvent<HTMLInputElement, Element>) => void;
|
|
17
|
+
variant: "tree" | "subrows";
|
|
18
|
+
isInitialExpanded: boolean | undefined;
|
|
19
|
+
expandedLevel: number | undefined;
|
|
20
|
+
initialVisibleChildrenCount: number | undefined;
|
|
21
|
+
moreButtonColumnPosition: number | undefined;
|
|
22
|
+
isVisibleCollapseButton: boolean | undefined;
|
|
23
|
+
isSelectable: boolean | undefined;
|
|
24
|
+
selectedRows: Record<string, unknown>[] | undefined;
|
|
25
|
+
memoizedItemProps: {
|
|
26
|
+
style?: import("react").CSSProperties | undefined;
|
|
27
|
+
'data-index': number;
|
|
28
|
+
'data-item-group-index'?: number | undefined;
|
|
29
|
+
'data-item-index': number;
|
|
30
|
+
'data-known-size': number;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useLogic = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const DataGridContext_1 = require("../../../DataGrid/DataGridContext");
|
|
6
|
+
const utils_1 = require("../../../DataGrid/utils");
|
|
7
|
+
const DataGridInfiniteContext_1 = require("../../DataGridInfiniteContext");
|
|
8
|
+
const useLogic = ({ item, ...itemProps }) => {
|
|
9
|
+
const { renderRow, onSelectRow, variant, isInitialExpanded, expandedLevel, initialVisibleChildrenCount, moreButtonColumnPosition, isVisibleCollapseButton, isSelectable, selectedRows, } = (0, react_1.useContext)(DataGridInfiniteContext_1.DataGridInfiniteContext);
|
|
10
|
+
const { activeRowId, columns, emptyCellValue, onRowClick, keyId, gridColumns, } = (0, react_1.useContext)(DataGridContext_1.DataGridContext);
|
|
11
|
+
const memoizedItemProps = (0, react_1.useMemo)(() => itemProps, [itemProps.style]);
|
|
12
|
+
const flattenColumns = (0, react_1.useMemo)(() => (0, utils_1.getFlattenColumns)(columns), [columns]);
|
|
13
|
+
const { children: nestedChildren, options } = item;
|
|
14
|
+
const isSelected = Boolean(selectedRows?.find((selectedRow) => selectedRow[keyId] === item[keyId]));
|
|
15
|
+
return {
|
|
16
|
+
item,
|
|
17
|
+
renderRow,
|
|
18
|
+
isSelected,
|
|
19
|
+
nestedChildren,
|
|
20
|
+
options,
|
|
21
|
+
flattenColumns,
|
|
22
|
+
gridColumns,
|
|
23
|
+
activeRowId,
|
|
24
|
+
emptyCellValue,
|
|
25
|
+
keyId,
|
|
26
|
+
onRowClick,
|
|
27
|
+
onSelectRow,
|
|
28
|
+
variant,
|
|
29
|
+
isInitialExpanded,
|
|
30
|
+
expandedLevel,
|
|
31
|
+
initialVisibleChildrenCount,
|
|
32
|
+
moreButtonColumnPosition,
|
|
33
|
+
isVisibleCollapseButton,
|
|
34
|
+
isSelectable,
|
|
35
|
+
selectedRows,
|
|
36
|
+
memoizedItemProps,
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
exports.useLogic = useLogic;
|
|
@@ -17,7 +17,7 @@ const makeRandomDate = () => {
|
|
|
17
17
|
exports.makeRandomDate = makeRandomDate;
|
|
18
18
|
const makeDataList = (length = 10, options) => {
|
|
19
19
|
return Array.from({ length }).map((_, i) => ({
|
|
20
|
-
id:
|
|
20
|
+
id: i.toString(),
|
|
21
21
|
documentName: `Договор №${i + 1}`,
|
|
22
22
|
recipient: RECIPIENTS[faker_1.faker.number.int({ min: 0, max: RECIPIENTS.length })],
|
|
23
23
|
createDate: (0, exports.makeRandomDate)(),
|
|
@@ -20,3 +20,9 @@ export declare const Backdrop: import("@emotion/styled/dist/declarations/src/typ
|
|
|
20
20
|
export declare const StyledScrollToTopButton: import("@emotion/styled/dist/declarations/src/types").StyledComponent<import("../ScrollToTopButton").ScrollToTopButtonProps & import("react").RefAttributes<HTMLButtonElement> & {
|
|
21
21
|
theme?: import("@emotion/react").Theme | undefined;
|
|
22
22
|
}, {}, {}>;
|
|
23
|
+
export declare const StyledContainer: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
24
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
25
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
26
|
+
} & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
27
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
28
|
+
}, {}, {}>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StyledScrollToTopButton = exports.Backdrop = exports.FooterRow = exports.DisabledDataGridWrapper = exports.DataGridWrapper = void 0;
|
|
3
|
+
exports.StyledContainer = exports.StyledScrollToTopButton = exports.Backdrop = exports.FooterRow = exports.DisabledDataGridWrapper = exports.DataGridWrapper = void 0;
|
|
4
|
+
const styles_1 = require("../DataGrid/styles");
|
|
4
5
|
const ScrollToTopButton_1 = require("../ScrollToTopButton");
|
|
5
6
|
const styled_1 = require("../styled");
|
|
6
7
|
const constants_1 = require("./constants");
|
|
8
|
+
const List_1 = require("./List");
|
|
7
9
|
exports.DataGridWrapper = styled_1.styled.div `
|
|
8
10
|
position: relative;
|
|
9
11
|
|
|
@@ -44,3 +46,12 @@ exports.StyledScrollToTopButton = (0, styled_1.styled)(ScrollToTopButton_1.Scrol
|
|
|
44
46
|
display: inline-flex;
|
|
45
47
|
}
|
|
46
48
|
`;
|
|
49
|
+
exports.StyledContainer = (0, styled_1.styled)(styles_1.Container) `
|
|
50
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
51
|
+
& .${List_1.dataGridInfiniteListClassnames.root} {
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
gap: ${({ theme }) => theme.spacing(2)};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
@@ -4,13 +4,13 @@ import { type DataGridRow } from '../../DataGrid';
|
|
|
4
4
|
import { type CellValue } from '../../DataGrid/types';
|
|
5
5
|
import { type DataGridInfiniteProps } from '../types';
|
|
6
6
|
type UseLogicParams<TData extends Record<string, CellValue> = DataGridRow, TSortField extends keyof TData = keyof TData> = DataGridInfiniteProps<TData, TSortField>;
|
|
7
|
-
export declare const useLogic: <TData extends Record<string, unknown> = DataGridRow, TSortField extends keyof TData = keyof TData>({ keyId, columns, rows, variant, tree, subrows, selectedRows, maxHeight, isLoading, isDisabled, isEndReached, onEndReached, onSelectRow, isHideSelectAll, isHideHeaderIfNoData, gridViewMode: gridViewModeProp, }: UseLogicParams<TData, TSortField>) => {
|
|
7
|
+
export declare const useLogic: <TData extends Record<string, unknown> = DataGridRow, TSortField extends keyof TData = keyof TData>({ keyId, columns, rows, variant, tree, subrows, selectedRows, maxHeight, isLoading, isDisabled, isEndReached, onEndReached, onSelectRow, isHideSelectAll, isHideHeaderIfNoData, gridViewMode: gridViewModeProp, mobileDisplayVariant, }: UseLogicParams<TData, TSortField>) => {
|
|
8
8
|
containerCssVars: import("react").CSSProperties;
|
|
9
9
|
mobileSkeletonProps: {
|
|
10
10
|
cellsCount: number;
|
|
11
11
|
rowsCount: number;
|
|
12
|
+
mobileDisplayVariant: "list" | "cards";
|
|
12
13
|
};
|
|
13
|
-
flattenColumns: import("../../DataGrid").DataGridSingleColumn<TData>[];
|
|
14
14
|
isNoData: boolean;
|
|
15
15
|
isMobile: boolean;
|
|
16
16
|
isDataGridDisabled: boolean | undefined;
|
|
@@ -23,6 +23,7 @@ export declare const useLogic: <TData extends Record<string, unknown> = DataGrid
|
|
|
23
23
|
isHideHead: boolean;
|
|
24
24
|
hasGroupedColumns: boolean;
|
|
25
25
|
gridViewMode: "standard" | "full";
|
|
26
|
+
gridColumns: string;
|
|
26
27
|
virtuosoProps: {
|
|
27
28
|
id: string;
|
|
28
29
|
ref: import("react").RefObject<VirtuosoHandle | null>;
|
|
@@ -41,11 +42,13 @@ export declare const useLogic: <TData extends Record<string, unknown> = DataGrid
|
|
|
41
42
|
rowProps: {
|
|
42
43
|
isSelectable: boolean;
|
|
43
44
|
gridColumns: string;
|
|
44
|
-
onSelectRow: (row: TData) => (event: ChangeEvent<HTMLInputElement>) => void;
|
|
45
45
|
};
|
|
46
46
|
scrollToTopButtonProps: {
|
|
47
47
|
onClick: () => void;
|
|
48
48
|
ref: import("react").RefObject<HTMLButtonElement | null>;
|
|
49
49
|
};
|
|
50
|
+
handleSelectRow: (row: TData) => (event: ChangeEvent<HTMLInputElement>) => void;
|
|
51
|
+
mobileDisplayVariant: "list" | "cards";
|
|
52
|
+
isSelfContained: boolean;
|
|
50
53
|
};
|
|
51
54
|
export {};
|
|
@@ -2,24 +2,40 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.useLogic = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
|
+
const constants_1 = require("../../DataGrid/constants");
|
|
5
6
|
const enums_1 = require("../../DataGrid/enums");
|
|
6
7
|
const hooks_1 = require("../../DataGrid/useLogic/hooks");
|
|
7
8
|
const utils_1 = require("../../DataGrid/utils");
|
|
8
9
|
const useViewportType_1 = require("../../useViewportType");
|
|
9
10
|
const prop_1 = require("../../utils/prop");
|
|
10
11
|
const uniqueBy_1 = require("../../utils/uniqueBy");
|
|
11
|
-
const
|
|
12
|
-
const useLogic = ({ keyId, columns, rows, variant, tree, subrows, selectedRows = [], maxHeight, isLoading, isDisabled, isEndReached, onEndReached, onSelectRow, isHideSelectAll, isHideHeaderIfNoData = false, gridViewMode: gridViewModeProp = 'standard', }) => {
|
|
12
|
+
const constants_2 = require("../constants");
|
|
13
|
+
const useLogic = ({ keyId, columns, rows, variant, tree, subrows, selectedRows = [], maxHeight, isLoading, isDisabled, isEndReached, onEndReached, onSelectRow, isHideSelectAll, isHideHeaderIfNoData = false, gridViewMode: gridViewModeProp = 'standard', mobileDisplayVariant = variant === 'subrows' ? 'cards' : 'list', }) => {
|
|
13
14
|
const virtuoso = (0, react_1.useRef)(null);
|
|
14
15
|
const scrollToTopButtonRef = (0, react_1.useRef)(null);
|
|
15
16
|
const { isMobile } = (0, useViewportType_1.useViewportType)();
|
|
17
|
+
// Реф добавлен для избежания замыкания selectedRows в handleSelectRow (иначе в handleSelectRow приходят некорректные значения selectedRows).
|
|
18
|
+
const selectedRowsRef = (0, react_1.useRef)(selectedRows);
|
|
19
|
+
(0, react_1.useEffect)(() => {
|
|
20
|
+
selectedRowsRef.current = selectedRows;
|
|
21
|
+
}, [selectedRows]);
|
|
16
22
|
const [hasVerticalScroll, setHasVerticalScroll] = (0, react_1.useState)(false);
|
|
17
23
|
const isNoData = Boolean(rows?.length);
|
|
18
24
|
const isSelectable = Boolean(onSelectRow);
|
|
19
25
|
const isDataGridDisabled = isDisabled || (!isNoData && isLoading);
|
|
20
|
-
const treeRenderConfig =
|
|
21
|
-
|
|
22
|
-
|
|
26
|
+
const treeRenderConfig = (0, react_1.useMemo)(() => {
|
|
27
|
+
const config = Object.is(variant, enums_1.Variant.Subrows)
|
|
28
|
+
? { ...subrows, isInitialExpanded: true }
|
|
29
|
+
: tree;
|
|
30
|
+
if (isMobile) {
|
|
31
|
+
return {
|
|
32
|
+
...config,
|
|
33
|
+
expandedLevel: constants_1.EXPANDED_LEVEL_BY_DEFAULT,
|
|
34
|
+
initialVisibleChildrenCount: constants_1.INITIAL_OPENED_NESTED_CHILDREN_COUNT_ON_MOBILE_BY_DEFAULT,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
return config;
|
|
38
|
+
}, [variant, subrows, tree, isMobile]);
|
|
23
39
|
const availableRows = rows.filter((row) => !(row.options?.isDisabled || row.options?.isNotSelectable));
|
|
24
40
|
const flattenColumns = (0, react_1.useMemo)(() => (0, utils_1.getFlattenColumns)(columns), [columns]);
|
|
25
41
|
const hasGroupedColumns = columns.some(utils_1.isGroupColumns);
|
|
@@ -35,7 +51,7 @@ const useLogic = ({ keyId, columns, rows, variant, tree, subrows, selectedRows =
|
|
|
35
51
|
}, [availableRows, selectedRows, keyId]);
|
|
36
52
|
const handleRangeChanged = (0, react_1.useCallback)((range) => {
|
|
37
53
|
if (scrollToTopButtonRef.current) {
|
|
38
|
-
scrollToTopButtonRef.current.classList.toggle(
|
|
54
|
+
scrollToTopButtonRef.current.classList.toggle(constants_2.dataGridInfiniteClassnames.visibleScrollToTopButton, range.startIndex > 2);
|
|
39
55
|
}
|
|
40
56
|
}, []);
|
|
41
57
|
const handleSelectAllRows = (event) => {
|
|
@@ -54,16 +70,16 @@ const useLogic = ({ keyId, columns, rows, variant, tree, subrows, selectedRows =
|
|
|
54
70
|
return;
|
|
55
71
|
}
|
|
56
72
|
if (event.target.checked) {
|
|
57
|
-
return onSelectRow([...
|
|
73
|
+
return onSelectRow([...selectedRowsRef.current, row]);
|
|
58
74
|
}
|
|
59
|
-
onSelectRow(
|
|
60
|
-
}, [
|
|
75
|
+
onSelectRow(selectedRowsRef.current.filter((selectedRow) => selectedRow[keyId] !== row[keyId]));
|
|
76
|
+
}, []);
|
|
61
77
|
const handleScrollToTop = () => {
|
|
62
78
|
virtuoso.current?.scrollIntoView({ index: 0, behavior: 'smooth' });
|
|
63
79
|
};
|
|
64
80
|
const recalculateVerticalScroll = () => {
|
|
65
|
-
const container = document.getElementById(
|
|
66
|
-
const list = document.getElementById(
|
|
81
|
+
const container = document.getElementById(constants_2.VIRTUOSO_CONTAINER_ID);
|
|
82
|
+
const list = document.getElementById(constants_2.VIRTUOSO_LIST_ID);
|
|
67
83
|
if (container && list) {
|
|
68
84
|
setHasVerticalScroll(list?.clientHeight > container?.clientHeight);
|
|
69
85
|
}
|
|
@@ -71,12 +87,12 @@ const useLogic = ({ keyId, columns, rows, variant, tree, subrows, selectedRows =
|
|
|
71
87
|
const isHideHead = isHideHeaderIfNoData && rows.length === 0;
|
|
72
88
|
const { mobileSkeletonProps } = (0, hooks_1.useDataGridMobileLogic)({
|
|
73
89
|
columns: flattenColumns,
|
|
90
|
+
mobileDisplayVariant,
|
|
74
91
|
});
|
|
75
92
|
const containerCssVars = (0, utils_1.getDataGridCssVars)(maxHeight);
|
|
76
93
|
return {
|
|
77
94
|
containerCssVars,
|
|
78
95
|
mobileSkeletonProps,
|
|
79
|
-
flattenColumns,
|
|
80
96
|
isNoData,
|
|
81
97
|
isMobile,
|
|
82
98
|
isDataGridDisabled,
|
|
@@ -85,8 +101,9 @@ const useLogic = ({ keyId, columns, rows, variant, tree, subrows, selectedRows =
|
|
|
85
101
|
isHideHead,
|
|
86
102
|
hasGroupedColumns,
|
|
87
103
|
gridViewMode,
|
|
104
|
+
gridColumns,
|
|
88
105
|
virtuosoProps: {
|
|
89
|
-
id:
|
|
106
|
+
id: constants_2.VIRTUOSO_CONTAINER_ID,
|
|
90
107
|
ref: virtuoso,
|
|
91
108
|
endReached: handleEndReach,
|
|
92
109
|
rangeChanged: handleRangeChanged,
|
|
@@ -103,12 +120,14 @@ const useLogic = ({ keyId, columns, rows, variant, tree, subrows, selectedRows =
|
|
|
103
120
|
rowProps: {
|
|
104
121
|
isSelectable,
|
|
105
122
|
gridColumns,
|
|
106
|
-
onSelectRow: handleSelectRow,
|
|
107
123
|
},
|
|
108
124
|
scrollToTopButtonProps: {
|
|
109
125
|
onClick: handleScrollToTop,
|
|
110
126
|
ref: scrollToTopButtonRef,
|
|
111
127
|
},
|
|
128
|
+
handleSelectRow,
|
|
129
|
+
mobileDisplayVariant,
|
|
130
|
+
isSelfContained: mobileDisplayVariant === 'cards',
|
|
112
131
|
};
|
|
113
132
|
};
|
|
114
133
|
exports.useLogic = useLogic;
|