@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
|
@@ -8,6 +8,8 @@ const DialogActions_1 = __importDefault(require("@mui/material/DialogActions"));
|
|
|
8
8
|
const Grid_1 = require("../Grid");
|
|
9
9
|
const styled_1 = require("../styled");
|
|
10
10
|
exports.StyledDialogActions = (0, styled_1.styled)(DialogActions_1.default) `
|
|
11
|
+
z-index: ${({ theme }) => theme.zIndex.modal};
|
|
12
|
+
|
|
11
13
|
padding-top: ${({ theme }) => theme.spacing(6)};
|
|
12
14
|
|
|
13
15
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DonutChart = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const classNames_1 = require("../utils/classNames");
|
|
6
|
+
const constants_1 = require("./constants");
|
|
7
|
+
const styles_1 = require("./styles");
|
|
8
|
+
const useLogic_1 = require("./useLogic");
|
|
9
|
+
const DonutChart = ({ value, maxValue, children, color = 'primary', colorIntensity = '700', className, style, }) => {
|
|
10
|
+
const { rootRef, svgViewBox, arcCx, arcCy, donutParams, meterAriaValue } = (0, useLogic_1.useLogic)({ value, maxValue, color, colorIntensity });
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { ref: rootRef, className: (0, classNames_1.classNames)(constants_1.donutChartClassnames.root, className), role: "meter", "aria-label": meterAriaValue.label, "aria-valuemin": meterAriaValue.min, "aria-valuemax": meterAriaValue.max, "aria-valuenow": meterAriaValue.now, style: { ...donutParams?.cssVars, ...style }, children: [donutParams && ((0, jsx_runtime_1.jsxs)(styles_1.Svg, { className: constants_1.donutChartClassnames.svg, viewBox: svgViewBox, "aria-hidden": true, children: [(0, jsx_runtime_1.jsx)(styles_1.TrackArc, { className: constants_1.donutChartClassnames.track, cx: arcCx, cy: arcCy, r: donutParams.arcR }), (0, jsx_runtime_1.jsx)(styles_1.ProgressArc, { className: constants_1.donutChartClassnames.progress, d: donutParams.arcPath, pathLength: 1, strokeDasharray: 1, strokeDashoffset: donutParams.progressOffset })] })), children && ((0, jsx_runtime_1.jsx)(styles_1.Content, { className: constants_1.donutChartClassnames.content, children: children }))] }));
|
|
12
|
+
};
|
|
13
|
+
exports.DonutChart = DonutChart;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Нормализованная система координат SVG. Масштаб — через CSS 100%. */
|
|
2
|
+
export declare const DONUT_CHART_VIEWBOX = 100;
|
|
3
|
+
/** Центр дуги в координатах viewBox (cx, cy). */
|
|
4
|
+
export declare const DONUT_CHART_VIEWBOX_CENTER: number;
|
|
5
|
+
/** Толщина обводки на экране (px), пересчитывается в единицы viewBox через getGeometry. */
|
|
6
|
+
export declare const DONUT_CHART_STROKE_WIDTH = 8;
|
|
7
|
+
/** Атрибут viewBox SVG (квадрат DONUT_CHART_VIEWBOX × DONUT_CHART_VIEWBOX). */
|
|
8
|
+
export declare const DONUT_CHART_SVG_VIEWBOX: "0 0 100 100";
|
|
9
|
+
export declare const donutChartClassnames: {
|
|
10
|
+
root: string;
|
|
11
|
+
svg: string;
|
|
12
|
+
track: string;
|
|
13
|
+
progress: string;
|
|
14
|
+
content: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.donutChartClassnames = exports.DONUT_CHART_SVG_VIEWBOX = exports.DONUT_CHART_STROKE_WIDTH = exports.DONUT_CHART_VIEWBOX_CENTER = exports.DONUT_CHART_VIEWBOX = void 0;
|
|
4
|
+
const createUIKitClassname_1 = require("../utils/createUIKitClassname");
|
|
5
|
+
/** Нормализованная система координат SVG. Масштаб — через CSS 100%. */
|
|
6
|
+
exports.DONUT_CHART_VIEWBOX = 100;
|
|
7
|
+
/** Центр дуги в координатах viewBox (cx, cy). */
|
|
8
|
+
exports.DONUT_CHART_VIEWBOX_CENTER = exports.DONUT_CHART_VIEWBOX / 2;
|
|
9
|
+
/** Толщина обводки на экране (px), пересчитывается в единицы viewBox через getGeometry. */
|
|
10
|
+
exports.DONUT_CHART_STROKE_WIDTH = 8;
|
|
11
|
+
/** Атрибут viewBox SVG (квадрат DONUT_CHART_VIEWBOX × DONUT_CHART_VIEWBOX). */
|
|
12
|
+
exports.DONUT_CHART_SVG_VIEWBOX = `0 0 ${exports.DONUT_CHART_VIEWBOX} ${exports.DONUT_CHART_VIEWBOX}`;
|
|
13
|
+
exports.donutChartClassnames = {
|
|
14
|
+
root: (0, createUIKitClassname_1.createUIKitClassname)('donut-chart'),
|
|
15
|
+
svg: (0, createUIKitClassname_1.createUIKitClassname)('donut-chart__svg'),
|
|
16
|
+
track: (0, createUIKitClassname_1.createUIKitClassname)('donut-chart__track'),
|
|
17
|
+
progress: (0, createUIKitClassname_1.createUIKitClassname)('donut-chart__progress'),
|
|
18
|
+
content: (0, createUIKitClassname_1.createUIKitClassname)('donut-chart__content'),
|
|
19
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.donutChartClassnames = exports.DonutChart = void 0;
|
|
4
|
+
var DonutChart_1 = require("./DonutChart");
|
|
5
|
+
Object.defineProperty(exports, "DonutChart", { enumerable: true, get: function () { return DonutChart_1.DonutChart; } });
|
|
6
|
+
var constants_1 = require("./constants");
|
|
7
|
+
Object.defineProperty(exports, "donutChartClassnames", { enumerable: true, get: function () { return constants_1.donutChartClassnames; } });
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DonutChart = exports.donutChartClassnames = void 0;
|
|
4
|
+
var constants_1 = require("./constants");
|
|
5
|
+
Object.defineProperty(exports, "donutChartClassnames", { enumerable: true, get: function () { return constants_1.donutChartClassnames; } });
|
|
6
|
+
var DonutChart_1 = require("./DonutChart");
|
|
7
|
+
Object.defineProperty(exports, "DonutChart", { enumerable: true, get: function () { return DonutChart_1.DonutChart; } });
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Wrapper: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const Svg: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
|
+
}, import("react").SVGProps<SVGSVGElement>, {}>;
|
|
10
|
+
export declare const TrackArc: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
11
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
12
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
13
|
+
}, import("react").SVGProps<SVGCircleElement>, {}>;
|
|
14
|
+
export declare const ProgressArc: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
15
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
16
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
17
|
+
}, import("react").SVGProps<SVGPathElement>, {}>;
|
|
18
|
+
export declare const Content: import("@emotion/styled/dist/declarations/src/types").StyledComponent<{
|
|
19
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
20
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
21
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Content = exports.ProgressArc = exports.TrackArc = exports.Svg = exports.Wrapper = void 0;
|
|
4
|
+
const styled_1 = require("../styled");
|
|
5
|
+
exports.Wrapper = styled_1.styled.div `
|
|
6
|
+
position: relative;
|
|
7
|
+
|
|
8
|
+
aspect-ratio: 1 / 1;
|
|
9
|
+
width: 100%;
|
|
10
|
+
`;
|
|
11
|
+
exports.Svg = styled_1.styled.svg `
|
|
12
|
+
/* Старт дуги (точка 3 часа) переносим наверх. */
|
|
13
|
+
transform: rotate(-90deg);
|
|
14
|
+
|
|
15
|
+
display: block;
|
|
16
|
+
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
`;
|
|
20
|
+
exports.TrackArc = styled_1.styled.circle `
|
|
21
|
+
fill: none;
|
|
22
|
+
stroke: ${({ theme }) => theme.palette.grey[100]};
|
|
23
|
+
stroke-linecap: round;
|
|
24
|
+
stroke-width: var(--donut-chart-stroke-width);
|
|
25
|
+
`;
|
|
26
|
+
exports.ProgressArc = styled_1.styled.path `
|
|
27
|
+
fill: none;
|
|
28
|
+
stroke: var(--donut-chart-progress-color);
|
|
29
|
+
stroke-linecap: round;
|
|
30
|
+
stroke-width: var(--donut-chart-stroke-width);
|
|
31
|
+
|
|
32
|
+
transition: stroke-dashoffset
|
|
33
|
+
${({ theme }) => theme.transitions.duration.standard}ms ease-in-out;
|
|
34
|
+
`;
|
|
35
|
+
exports.Content = styled_1.styled.div `
|
|
36
|
+
position: absolute;
|
|
37
|
+
inset: 0;
|
|
38
|
+
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
|
|
43
|
+
padding: ${({ theme }) => theme.spacing(4)};
|
|
44
|
+
`;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
+
export type DonutChartColor = 'primary' | 'success' | 'warning' | 'error' | 'grey' | 'red' | 'green' | 'yellow';
|
|
3
|
+
export type DonutChartColorIntensity = '900' | '800' | '700' | '600' | '500' | '400' | '300' | '200' | '100';
|
|
4
|
+
export type DonutChartProps = {
|
|
5
|
+
value: number;
|
|
6
|
+
maxValue: number;
|
|
7
|
+
/**
|
|
8
|
+
* Контент в центре. Можно передать другой `DonutChart`.
|
|
9
|
+
*/
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Цвет.
|
|
13
|
+
*/
|
|
14
|
+
color?: DonutChartColor;
|
|
15
|
+
/**
|
|
16
|
+
* Интенсивность цвета.
|
|
17
|
+
*/
|
|
18
|
+
colorIntensity?: DonutChartColorIntensity;
|
|
19
|
+
/**
|
|
20
|
+
* CSS-класс для корневого элемента.
|
|
21
|
+
*/
|
|
22
|
+
className?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Стили для корневого элемента.
|
|
25
|
+
*/
|
|
26
|
+
style?: CSSProperties;
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useRenderWidth';
|
|
@@ -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("./useRenderWidth"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useRenderWidth';
|
|
@@ -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("./useRenderWidth"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
/**
|
|
3
|
+
* Отслеживает ширину элемента и обновляет значение при resize.
|
|
4
|
+
* @returns Объект с ref для присоединения к элементу и текущей шириной в пикселях
|
|
5
|
+
*/
|
|
6
|
+
export declare const useRenderWidth: () => {
|
|
7
|
+
rootRef: import("react").RefObject<HTMLDivElement | null>;
|
|
8
|
+
renderWidth: number | null;
|
|
9
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useRenderWidth = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
/**
|
|
6
|
+
* Отслеживает ширину элемента и обновляет значение при resize.
|
|
7
|
+
* @returns Объект с ref для присоединения к элементу и текущей шириной в пикселях
|
|
8
|
+
*/
|
|
9
|
+
const useRenderWidth = () => {
|
|
10
|
+
const rootRef = (0, react_1.useRef)(null);
|
|
11
|
+
const [renderWidth, setRenderWidth] = (0, react_1.useState)(null);
|
|
12
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
13
|
+
const node = rootRef.current;
|
|
14
|
+
if (!node) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
const initialWidth = node.getBoundingClientRect().width;
|
|
18
|
+
if (initialWidth > 0) {
|
|
19
|
+
setRenderWidth(initialWidth);
|
|
20
|
+
}
|
|
21
|
+
const resizeObserver = new ResizeObserver((entries) => {
|
|
22
|
+
const width = entries[0]?.contentRect.width ?? 0;
|
|
23
|
+
if (width > 0) {
|
|
24
|
+
setRenderWidth(width);
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
resizeObserver.observe(node);
|
|
28
|
+
return () => {
|
|
29
|
+
resizeObserver.disconnect();
|
|
30
|
+
};
|
|
31
|
+
}, []);
|
|
32
|
+
return { rootRef, renderWidth };
|
|
33
|
+
};
|
|
34
|
+
exports.useRenderWidth = useRenderWidth;
|
|
@@ -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,15 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { DonutChartProps } from '../types';
|
|
3
|
+
export declare const useLogic: ({ value, maxValue, color, colorIntensity, }: DonutChartProps) => {
|
|
4
|
+
rootRef: import("react").RefObject<HTMLDivElement | null>;
|
|
5
|
+
svgViewBox: "0 0 100 100";
|
|
6
|
+
arcCx: number;
|
|
7
|
+
arcCy: number;
|
|
8
|
+
donutParams: {
|
|
9
|
+
arcR: number;
|
|
10
|
+
arcPath: string;
|
|
11
|
+
progressOffset: number;
|
|
12
|
+
cssVars: import("react").CSSProperties;
|
|
13
|
+
} | null;
|
|
14
|
+
meterAriaValue: import("./utils/getMeterAriaValue").MeterAriaValue;
|
|
15
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useLogic = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const useTheme_1 = require("../../theme/hooks/useTheme");
|
|
6
|
+
const constants_1 = require("../constants");
|
|
7
|
+
const hooks_1 = require("./hooks");
|
|
8
|
+
const getDonutChartCssVars_1 = require("./utils/getDonutChartCssVars");
|
|
9
|
+
const getGeometry_1 = require("./utils/getGeometry");
|
|
10
|
+
const getMeterAriaValue_1 = require("./utils/getMeterAriaValue");
|
|
11
|
+
const getProgressCirclePath_1 = require("./utils/getProgressCirclePath");
|
|
12
|
+
const getProgressOffset_1 = require("./utils/getProgressOffset");
|
|
13
|
+
const getProgressPercent_1 = require("./utils/getProgressPercent");
|
|
14
|
+
const useLogic = ({ value, maxValue, color = 'primary', colorIntensity = '700', }) => {
|
|
15
|
+
const theme = (0, useTheme_1.useTheme)();
|
|
16
|
+
const { rootRef, renderWidth } = (0, hooks_1.useRenderWidth)();
|
|
17
|
+
const progressPercent = (0, getProgressPercent_1.getProgressPercent)(value, maxValue);
|
|
18
|
+
const meterAriaValue = (0, getMeterAriaValue_1.getMeterAriaValue)(value, maxValue);
|
|
19
|
+
const donutParams = (0, react_1.useMemo)(() => {
|
|
20
|
+
if (renderWidth === null) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
const { stroke, radius, roundCapPercent } = (0, getGeometry_1.getGeometry)(renderWidth);
|
|
24
|
+
return {
|
|
25
|
+
arcR: radius,
|
|
26
|
+
arcPath: (0, getProgressCirclePath_1.getProgressCirclePath)(constants_1.DONUT_CHART_VIEWBOX_CENTER, constants_1.DONUT_CHART_VIEWBOX_CENTER, radius),
|
|
27
|
+
progressOffset: (0, getProgressOffset_1.getProgressOffset)(progressPercent, roundCapPercent),
|
|
28
|
+
cssVars: (0, getDonutChartCssVars_1.getDonutChartCssVars)(theme, {
|
|
29
|
+
color,
|
|
30
|
+
colorIntensity,
|
|
31
|
+
strokeWidth: stroke,
|
|
32
|
+
}),
|
|
33
|
+
};
|
|
34
|
+
}, [renderWidth, progressPercent, color, colorIntensity, theme]);
|
|
35
|
+
return {
|
|
36
|
+
rootRef,
|
|
37
|
+
svgViewBox: constants_1.DONUT_CHART_SVG_VIEWBOX,
|
|
38
|
+
arcCx: constants_1.DONUT_CHART_VIEWBOX_CENTER,
|
|
39
|
+
arcCy: constants_1.DONUT_CHART_VIEWBOX_CENTER,
|
|
40
|
+
donutParams,
|
|
41
|
+
meterAriaValue,
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
exports.useLogic = useLogic;
|
package/node/components/DonutChart/useLogic/utils/getDonutChartCssVars/getDonutChartCssVars.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
import type { Theme } from '../../../../theme/types';
|
|
3
|
+
import type { DonutChartColor, DonutChartColorIntensity } from '../../../types';
|
|
4
|
+
type GetDonutChartCssVarsParams = {
|
|
5
|
+
color: DonutChartColor;
|
|
6
|
+
colorIntensity: DonutChartColorIntensity;
|
|
7
|
+
strokeWidth: number;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Генерирует CSS переменные для стилизации DonutChart по теме и цвету.
|
|
11
|
+
* @param theme - Объект темы с палитрой цветов
|
|
12
|
+
* @param params - Параметры цвета, интенсивности и ширины stroke
|
|
13
|
+
* @returns CSS свойства для диаграммы
|
|
14
|
+
*/
|
|
15
|
+
export declare const getDonutChartCssVars: (theme: Theme, { color, colorIntensity, strokeWidth }: GetDonutChartCssVarsParams) => CSSProperties;
|
|
16
|
+
export {};
|
package/node/components/DonutChart/useLogic/utils/getDonutChartCssVars/getDonutChartCssVars.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDonutChartCssVars = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Генерирует CSS переменные для стилизации DonutChart по теме и цвету.
|
|
6
|
+
* @param theme - Объект темы с палитрой цветов
|
|
7
|
+
* @param params - Параметры цвета, интенсивности и ширины stroke
|
|
8
|
+
* @returns CSS свойства для диаграммы
|
|
9
|
+
*/
|
|
10
|
+
const getDonutChartCssVars = (theme, { color, colorIntensity, strokeWidth }) => ({
|
|
11
|
+
'--donut-chart-stroke-width': String(strokeWidth),
|
|
12
|
+
'--donut-chart-progress-color': theme.palette[color][colorIntensity],
|
|
13
|
+
});
|
|
14
|
+
exports.getDonutChartCssVars = getDonutChartCssVars;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getDonutChartCssVars } from './getDonutChartCssVars';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDonutChartCssVars = void 0;
|
|
4
|
+
var getDonutChartCssVars_1 = require("./getDonutChartCssVars");
|
|
5
|
+
Object.defineProperty(exports, "getDonutChartCssVars", { enumerable: true, get: function () { return getDonutChartCssVars_1.getDonutChartCssVars; } });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Вычисляет геометрию дуги в координатах viewBox по ширине контейнера.
|
|
3
|
+
* @param renderWidth - Ширина контейнера в пикселях
|
|
4
|
+
* @returns Геометрия дуги со stroke, радиусом и процентом round cap для расчетов
|
|
5
|
+
*/
|
|
6
|
+
export declare const getGeometry: (renderWidth: number) => {
|
|
7
|
+
stroke: number;
|
|
8
|
+
radius: number;
|
|
9
|
+
roundCapPercent: number;
|
|
10
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getGeometry = void 0;
|
|
4
|
+
const constants_1 = require("../../../constants");
|
|
5
|
+
/**
|
|
6
|
+
* Вычисляет геометрию дуги в координатах viewBox по ширине контейнера.
|
|
7
|
+
* @param renderWidth - Ширина контейнера в пикселях
|
|
8
|
+
* @returns Геометрия дуги со stroke, радиусом и процентом round cap для расчетов
|
|
9
|
+
*/
|
|
10
|
+
const getGeometry = (renderWidth) => {
|
|
11
|
+
const stroke = (constants_1.DONUT_CHART_STROKE_WIDTH * constants_1.DONUT_CHART_VIEWBOX) / renderWidth;
|
|
12
|
+
const radius = constants_1.DONUT_CHART_VIEWBOX_CENTER - stroke / 2;
|
|
13
|
+
const circumference = 2 * Math.PI * radius;
|
|
14
|
+
const roundCapPercent = (stroke / circumference) * 100;
|
|
15
|
+
return { stroke, radius, roundCapPercent };
|
|
16
|
+
};
|
|
17
|
+
exports.getGeometry = getGeometry;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getGeometry } from './getGeometry';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getGeometry = void 0;
|
|
4
|
+
var getGeometry_1 = require("./getGeometry");
|
|
5
|
+
Object.defineProperty(exports, "getGeometry", { enumerable: true, get: function () { return getGeometry_1.getGeometry; } });
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type MeterAriaValue = {
|
|
2
|
+
min: number;
|
|
3
|
+
max: number;
|
|
4
|
+
now: number;
|
|
5
|
+
label: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Нормализует value/maxValue для ARIA role="meter" с проверкой границ.
|
|
9
|
+
* @param value - Текущее значение
|
|
10
|
+
* @param maxValue - Максимальное значение (должно быть положительным и конечным)
|
|
11
|
+
* @returns ARIA атрибуты с свойствами min, max, now для role="meter"
|
|
12
|
+
*/
|
|
13
|
+
export declare const getMeterAriaValue: (value: number, maxValue: number) => MeterAriaValue;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMeterAriaValue = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Нормализует value/maxValue для ARIA role="meter" с проверкой границ.
|
|
6
|
+
* @param value - Текущее значение
|
|
7
|
+
* @param maxValue - Максимальное значение (должно быть положительным и конечным)
|
|
8
|
+
* @returns ARIA атрибуты с свойствами min, max, now для role="meter"
|
|
9
|
+
*/
|
|
10
|
+
const getMeterAriaValue = (value, maxValue) => {
|
|
11
|
+
const min = 0;
|
|
12
|
+
if (!Number.isFinite(maxValue) || maxValue <= 0) {
|
|
13
|
+
return { min, max: 1, now: 0, label: '0 / 1' };
|
|
14
|
+
}
|
|
15
|
+
if (!Number.isFinite(value)) {
|
|
16
|
+
return { min, max: maxValue, now: 0, label: `0 / ${maxValue}` };
|
|
17
|
+
}
|
|
18
|
+
const now = Math.max(min, Math.min(maxValue, value));
|
|
19
|
+
return {
|
|
20
|
+
min,
|
|
21
|
+
max: maxValue,
|
|
22
|
+
now,
|
|
23
|
+
label: `${now} / ${maxValue}`,
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
exports.getMeterAriaValue = getMeterAriaValue;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getMeterAriaValue, type MeterAriaValue } from './getMeterAriaValue';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getMeterAriaValue = void 0;
|
|
4
|
+
var getMeterAriaValue_1 = require("./getMeterAriaValue");
|
|
5
|
+
Object.defineProperty(exports, "getMeterAriaValue", { enumerable: true, get: function () { return getMeterAriaValue_1.getMeterAriaValue; } });
|
package/node/components/DonutChart/useLogic/utils/getProgressCirclePath/getProgressCirclePath.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Строит `d` полного круга из двух полудуг.
|
|
3
|
+
* Без `Z` — открытый путь без шва, поэтому нет 1px-артефакта на стыке.
|
|
4
|
+
* @param cx - Центр по X
|
|
5
|
+
* @param cy - Центр по Y
|
|
6
|
+
* @param r - Радиус
|
|
7
|
+
* @returns Значение атрибута `d`
|
|
8
|
+
*/
|
|
9
|
+
export declare const getProgressCirclePath: (cx: number, cy: number, r: number) => string;
|
package/node/components/DonutChart/useLogic/utils/getProgressCirclePath/getProgressCirclePath.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProgressCirclePath = void 0;
|
|
4
|
+
/** Точка на окружности по углу (0° — 3 часа, далее по часовой: y растёт вниз). */
|
|
5
|
+
const polarToCartesian = (cx, cy, r, angleDeg) => {
|
|
6
|
+
const angleRad = (angleDeg * Math.PI) / 180;
|
|
7
|
+
return {
|
|
8
|
+
x: cx + r * Math.cos(angleRad),
|
|
9
|
+
y: cy + r * Math.sin(angleRad),
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Строит `d` полного круга из двух полудуг.
|
|
14
|
+
* Без `Z` — открытый путь без шва, поэтому нет 1px-артефакта на стыке.
|
|
15
|
+
* @param cx - Центр по X
|
|
16
|
+
* @param cy - Центр по Y
|
|
17
|
+
* @param r - Радиус
|
|
18
|
+
* @returns Значение атрибута `d`
|
|
19
|
+
*/
|
|
20
|
+
const getProgressCirclePath = (cx, cy, r) => {
|
|
21
|
+
const start = polarToCartesian(cx, cy, r, 0);
|
|
22
|
+
const half = polarToCartesian(cx, cy, r, 180);
|
|
23
|
+
// Округляем координаты.
|
|
24
|
+
const f = (n) => Number(n.toFixed(3));
|
|
25
|
+
// Две полудуги (0°→180°→360°). Конец совпадает со стартом, но без `Z` —
|
|
26
|
+
// путь остаётся открытым, поэтому шва-стыка (источник 1px) не возникает.
|
|
27
|
+
return [
|
|
28
|
+
`M ${f(start.x)} ${f(start.y)}`,
|
|
29
|
+
`A ${f(r)} ${f(r)} 0 0 1 ${f(half.x)} ${f(half.y)}`,
|
|
30
|
+
`A ${f(r)} ${f(r)} 0 0 1 ${f(start.x)} ${f(start.y)}`,
|
|
31
|
+
].join(' ');
|
|
32
|
+
};
|
|
33
|
+
exports.getProgressCirclePath = getProgressCirclePath;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getProgressCirclePath } from './getProgressCirclePath';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProgressCirclePath = void 0;
|
|
4
|
+
var getProgressCirclePath_1 = require("./getProgressCirclePath");
|
|
5
|
+
Object.defineProperty(exports, "getProgressCirclePath", { enumerable: true, get: function () { return getProgressCirclePath_1.getProgressCirclePath; } });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Вычисляет stroke-dashoffset для SVG дуги с компенсацией round linecap.
|
|
3
|
+
* Выше 90% слегка уменьшает дисплей-процент, чтобы кэп не переливал за 100%.
|
|
4
|
+
* @param percent - Процент прогресса (0–100)
|
|
5
|
+
* @param roundCapPercent - Визуальная ширина round cap в процентах от окружности
|
|
6
|
+
* @returns Значение offset от 0 (полностью видно) до 1 (скрыто)
|
|
7
|
+
*/
|
|
8
|
+
export declare const getProgressOffset: (percent: number, roundCapPercent: number) => number;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProgressOffset = void 0;
|
|
4
|
+
/** С какого процента начинаем компенсировать round linecap у конца дуги */
|
|
5
|
+
const ROUND_CAP_RAMP_START = 90;
|
|
6
|
+
/**
|
|
7
|
+
* Вычисляет stroke-dashoffset для SVG дуги с компенсацией round linecap.
|
|
8
|
+
* Выше 90% слегка уменьшает дисплей-процент, чтобы кэп не переливал за 100%.
|
|
9
|
+
* @param percent - Процент прогресса (0–100)
|
|
10
|
+
* @param roundCapPercent - Визуальная ширина round cap в процентах от окружности
|
|
11
|
+
* @returns Значение offset от 0 (полностью видно) до 1 (скрыто)
|
|
12
|
+
*/
|
|
13
|
+
const getProgressOffset = (percent, roundCapPercent) => {
|
|
14
|
+
if (percent >= 100) {
|
|
15
|
+
return 0;
|
|
16
|
+
}
|
|
17
|
+
if (percent <= 0) {
|
|
18
|
+
return 1;
|
|
19
|
+
}
|
|
20
|
+
const roundCapRampProgress = Math.max(0, (percent - ROUND_CAP_RAMP_START) / (100 - ROUND_CAP_RAMP_START));
|
|
21
|
+
const displayPercent = percent - roundCapPercent * roundCapRampProgress;
|
|
22
|
+
const offset = 1 - displayPercent / 100;
|
|
23
|
+
return Math.round(offset * 1000) / 1000;
|
|
24
|
+
};
|
|
25
|
+
exports.getProgressOffset = getProgressOffset;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { getProgressOffset } from './getProgressOffset';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProgressOffset = void 0;
|
|
4
|
+
var getProgressOffset_1 = require("./getProgressOffset");
|
|
5
|
+
Object.defineProperty(exports, "getProgressOffset", { enumerable: true, get: function () { return getProgressOffset_1.getProgressOffset; } });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Преобразует value/maxValue в целый процент 0–100.
|
|
3
|
+
* Дробная часть отбрасывается вниз, некорректные значения дают 0.
|
|
4
|
+
* @param value - Текущее значение
|
|
5
|
+
* @param maxValue - Максимальное значение (должно быть положительным и конечным)
|
|
6
|
+
* @returns Целый процент от 0 до 100
|
|
7
|
+
*/
|
|
8
|
+
export declare const getProgressPercent: (value: number, maxValue: number) => number;
|