@astral/ui 4.113.3 → 4.115.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/ActionGroup/ActionGroup.js +2 -2
- package/components/ActionGroup/SecondaryActions/SecondaryActions.d.ts +1 -1
- package/components/ActionGroup/SecondaryActions/SecondaryActions.js +2 -2
- package/components/ActionGroup/types.d.ts +9 -0
- package/components/DataGrid/Body/Body.d.ts +1 -1
- package/components/DataGrid/Body/Body.js +7 -3
- package/components/DataGrid/Body/types.d.ts +11 -3
- package/components/DataGrid/DataGrid.js +13 -6
- package/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.d.ts +3 -2
- package/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.js +3 -2
- package/components/DataGrid/DataGridSelectionContext/DataGridSelectionContext.d.ts +25 -0
- package/components/DataGrid/DataGridSelectionContext/DataGridSelectionContext.js +13 -0
- package/components/DataGrid/DataGridSelectionContext/DataGridSelectionProvider/DataGridSelectionProvider.d.ts +7 -0
- package/components/DataGrid/DataGridSelectionContext/DataGridSelectionProvider/DataGridSelectionProvider.js +8 -0
- package/components/DataGrid/DataGridSelectionContext/DataGridSelectionProvider/index.d.ts +1 -0
- package/components/DataGrid/DataGridSelectionContext/DataGridSelectionProvider/index.js +1 -0
- package/components/DataGrid/DataGridSelectionContext/index.d.ts +2 -0
- package/components/DataGrid/DataGridSelectionContext/index.js +2 -0
- package/components/DataGrid/PinnedSections/PinnedSections.js +2 -2
- package/components/DataGrid/PinnedSections/useLogic/useLogic.d.ts +1 -0
- package/components/DataGrid/PinnedSections/useLogic/useLogic.js +4 -3
- package/components/DataGrid/Row/Row.js +13 -9
- package/components/DataGrid/Row/RowContext/RowContext.d.ts +15 -4
- package/components/DataGrid/Row/RowContext/RowContext.js +3 -3
- package/components/DataGrid/Row/RowContext/RowProvider/RowProvider.d.ts +10 -1
- package/components/DataGrid/Row/RowContext/RowProvider/RowProvider.js +23 -17
- package/components/DataGrid/Row/types.d.ts +7 -3
- package/components/DataGrid/Row/useLogic/useLogic.d.ts +6 -4
- package/components/DataGrid/Row/useLogic/useLogic.js +21 -12
- package/components/DataGrid/RowBase/RowBase.js +5 -2
- package/components/DataGrid/RowBase/types.d.ts +9 -5
- package/components/DataGrid/RowBase/useLogic/useLogic.d.ts +5 -4
- package/components/DataGrid/RowBase/useLogic/useLogic.js +16 -10
- package/components/DataGrid/RowCheckbox/RowCheckbox.d.ts +5 -0
- package/components/DataGrid/RowCheckbox/RowCheckbox.js +13 -0
- package/components/DataGrid/RowCheckbox/constants.d.ts +4 -0
- package/components/DataGrid/RowCheckbox/constants.js +4 -0
- package/components/DataGrid/RowCheckbox/index.d.ts +1 -0
- package/components/DataGrid/RowCheckbox/index.js +1 -0
- package/components/DataGrid/RowCheckbox/types.d.ts +7 -0
- package/components/DataGrid/RowCheckbox/types.js +1 -0
- package/components/DataGrid/constants.d.ts +2 -0
- package/components/DataGrid/constants.js +2 -0
- package/components/DataGrid/hooks/index.d.ts +1 -0
- package/components/DataGrid/hooks/index.js +1 -0
- package/components/DataGrid/hooks/useWarnRowsWithoutDisabledReason/index.d.ts +1 -0
- package/components/DataGrid/hooks/useWarnRowsWithoutDisabledReason/index.js +1 -0
- package/components/DataGrid/hooks/useWarnRowsWithoutDisabledReason/useWarnRowsWithoutDisabledReason.d.ts +5 -0
- package/components/DataGrid/hooks/useWarnRowsWithoutDisabledReason/useWarnRowsWithoutDisabledReason.js +17 -0
- package/components/DataGrid/index.d.ts +1 -1
- package/components/DataGrid/public.d.ts +1 -1
- package/components/DataGrid/styles.d.ts +4 -0
- package/components/DataGrid/styles.js +26 -0
- package/components/DataGrid/tests/performance/testDataGridPerformance.d.ts +3 -1
- package/components/DataGrid/tests/performance/testDataGridPerformance.js +234 -2
- package/components/DataGrid/tests/selection/testDataGridSelection.d.ts +14 -0
- package/components/DataGrid/tests/selection/testDataGridSelection.js +562 -0
- package/components/DataGrid/types.d.ts +41 -1
- package/components/DataGrid/useLogic/useLogic.d.ts +8 -3
- package/components/DataGrid/useLogic/useLogic.js +23 -10
- package/components/DataGrid/utils/checkIsMassActionsOpen/checkIsMassActionsOpen.d.ts +10 -0
- package/components/DataGrid/utils/checkIsMassActionsOpen/checkIsMassActionsOpen.js +4 -0
- package/components/DataGrid/utils/checkIsMassActionsOpen/index.d.ts +1 -0
- package/components/DataGrid/utils/checkIsMassActionsOpen/index.js +1 -0
- package/components/DataGrid/utils/getRowDisabledState/getRowDisabledState.d.ts +31 -0
- package/components/DataGrid/utils/getRowDisabledState/getRowDisabledState.js +20 -0
- package/components/DataGrid/utils/getRowDisabledState/index.d.ts +1 -0
- package/components/DataGrid/utils/getRowDisabledState/index.js +1 -0
- package/components/DataGrid/utils/index.d.ts +4 -0
- package/components/DataGrid/utils/index.js +4 -0
- package/components/DataGrid/utils/resolveRowDisabled/index.d.ts +1 -0
- package/components/DataGrid/utils/resolveRowDisabled/index.js +1 -0
- package/components/DataGrid/utils/resolveRowDisabled/resolveRowDisabled.d.ts +5 -0
- package/components/DataGrid/utils/resolveRowDisabled/resolveRowDisabled.js +17 -0
- package/components/DataGrid/utils/resolveRowsDisabled/index.d.ts +1 -0
- package/components/DataGrid/utils/resolveRowsDisabled/index.js +1 -0
- package/components/DataGrid/utils/resolveRowsDisabled/resolveRowsDisabled.d.ts +16 -0
- package/components/DataGrid/utils/resolveRowsDisabled/resolveRowsDisabled.js +17 -0
- package/components/DataGridActionCell/hooks/useBlockingActions/useBlockingActions.js +3 -3
- package/components/DataGridCollapsibleRow/useLogic/useLogic.d.ts +3 -2
- package/components/DataGridCollapsibleRow/useLogic/useLogic.js +4 -3
- package/components/DataGridInfinite/DataGridInfinite.js +18 -14
- package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContext.d.ts +1 -1
- package/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContext.js +1 -1
- package/components/DataGridInfinite/Footer/Footer.d.ts +6 -0
- package/components/DataGridInfinite/Footer/Footer.js +25 -0
- package/components/DataGridInfinite/Footer/index.d.ts +2 -0
- package/components/DataGridInfinite/Footer/index.js +1 -0
- package/components/DataGridInfinite/Footer/types.d.ts +26 -0
- package/components/DataGridInfinite/Footer/types.js +1 -0
- package/components/DataGridInfinite/Row/Row.js +2 -2
- package/components/DataGridInfinite/Row/index.d.ts +1 -0
- package/components/DataGridInfinite/Row/types.d.ts +17 -2
- package/components/DataGridInfinite/Row/useLogic/useLogic.d.ts +4 -2
- package/components/DataGridInfinite/Row/useLogic/useLogic.js +12 -4
- package/components/DataGridInfinite/constants.d.ts +3 -0
- package/components/DataGridInfinite/constants.js +3 -0
- package/components/DataGridInfinite/faker.d.ts +1 -5
- package/components/DataGridInfinite/faker.js +1 -2
- package/components/DataGridInfinite/styles.d.ts +4 -0
- package/components/DataGridInfinite/styles.js +24 -0
- package/components/DataGridInfinite/useLogic/useLogic.d.ts +7 -3
- package/components/DataGridInfinite/useLogic/useLogic.js +52 -16
- package/components/DataGridMassActions/DataGridMassActions.d.ts +15 -0
- package/components/DataGridMassActions/DataGridMassActions.js +32 -0
- package/components/DataGridMassActions/constants.d.ts +4 -0
- package/components/DataGridMassActions/constants.js +5 -0
- package/components/DataGridMassActions/index.d.ts +2 -0
- package/components/DataGridMassActions/index.js +1 -0
- package/components/DataGridMassActions/public.d.ts +2 -0
- package/components/DataGridMassActions/public.js +1 -0
- package/components/DataGridMassActions/styles.d.ts +8 -0
- package/components/DataGridMassActions/styles.js +49 -0
- package/components/DataGridMassActions/tests/testDataGridMassActions.d.ts +23 -0
- package/components/DataGridMassActions/tests/testDataGridMassActions.js +77 -0
- package/components/DataGridMassActions/types.d.ts +2 -0
- package/components/DataGridMassActions/types.js +1 -0
- package/components/DataGridMassActions/useLogic/index.d.ts +1 -0
- package/components/DataGridMassActions/useLogic/index.js +1 -0
- package/components/DataGridMassActions/useLogic/useLogic.d.ts +6 -0
- package/components/DataGridMassActions/useLogic/useLogic.js +21 -0
- package/components/IconDropdownButton/IconDropdownButton.d.ts +5 -0
- package/components/IconDropdownButton/IconDropdownButton.js +2 -2
- package/components/MassActions/MassActions.d.ts +5 -0
- package/components/MassActions/MassActions.js +17 -0
- package/components/MassActions/constants.d.ts +6 -0
- package/components/MassActions/constants.js +12 -0
- package/components/MassActions/index.d.ts +2 -0
- package/components/MassActions/index.js +1 -0
- package/components/MassActions/styles.d.ts +34 -0
- package/components/MassActions/styles.js +43 -0
- package/components/MassActions/types.d.ts +20 -0
- package/components/MassActions/types.js +1 -0
- package/components/MassActions/useLogic/index.d.ts +1 -0
- package/components/MassActions/useLogic/index.js +1 -0
- package/components/MassActions/useLogic/useLogic.d.ts +7 -0
- package/components/MassActions/useLogic/useLogic.js +9 -0
- package/components/PageHeader/PageActions/SecondaryActions/styles.d.ts +1 -1
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/index.d.ts +0 -1
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/index.js +0 -1
- package/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/useLogic.js +2 -1
- package/components/index.d.ts +1 -1
- package/node/components/ActionGroup/ActionGroup.js +2 -2
- package/node/components/ActionGroup/SecondaryActions/SecondaryActions.d.ts +1 -1
- package/node/components/ActionGroup/SecondaryActions/SecondaryActions.js +2 -2
- package/node/components/ActionGroup/types.d.ts +9 -0
- package/node/components/DataGrid/Body/Body.d.ts +1 -1
- package/node/components/DataGrid/Body/Body.js +7 -3
- package/node/components/DataGrid/Body/types.d.ts +11 -3
- package/node/components/DataGrid/DataGrid.js +12 -5
- package/node/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.d.ts +3 -2
- package/node/components/DataGrid/DataGridContext/DataGridProvider/DataGridProvider.js +3 -2
- package/node/components/DataGrid/DataGridSelectionContext/DataGridSelectionContext.d.ts +25 -0
- package/node/components/DataGrid/DataGridSelectionContext/DataGridSelectionContext.js +16 -0
- package/node/components/DataGrid/DataGridSelectionContext/DataGridSelectionProvider/DataGridSelectionProvider.d.ts +7 -0
- package/node/components/DataGrid/DataGridSelectionContext/DataGridSelectionProvider/DataGridSelectionProvider.js +12 -0
- package/node/components/DataGrid/DataGridSelectionContext/DataGridSelectionProvider/index.d.ts +1 -0
- package/node/components/DataGrid/DataGridSelectionContext/DataGridSelectionProvider/index.js +17 -0
- package/node/components/DataGrid/DataGridSelectionContext/index.d.ts +2 -0
- package/node/components/DataGrid/DataGridSelectionContext/index.js +18 -0
- package/node/components/DataGrid/PinnedSections/PinnedSections.js +2 -2
- package/node/components/DataGrid/PinnedSections/useLogic/useLogic.d.ts +1 -0
- package/node/components/DataGrid/PinnedSections/useLogic/useLogic.js +4 -3
- package/node/components/DataGrid/Row/Row.js +13 -9
- package/node/components/DataGrid/Row/RowContext/RowContext.d.ts +15 -4
- package/node/components/DataGrid/Row/RowContext/RowContext.js +3 -3
- package/node/components/DataGrid/Row/RowContext/RowProvider/RowProvider.d.ts +10 -1
- package/node/components/DataGrid/Row/RowContext/RowProvider/RowProvider.js +23 -17
- package/node/components/DataGrid/Row/types.d.ts +7 -3
- package/node/components/DataGrid/Row/useLogic/useLogic.d.ts +6 -4
- package/node/components/DataGrid/Row/useLogic/useLogic.js +23 -14
- package/node/components/DataGrid/RowBase/RowBase.js +5 -2
- package/node/components/DataGrid/RowBase/types.d.ts +9 -5
- package/node/components/DataGrid/RowBase/useLogic/useLogic.d.ts +5 -4
- package/node/components/DataGrid/RowBase/useLogic/useLogic.js +16 -10
- package/node/components/DataGrid/RowCheckbox/RowCheckbox.d.ts +5 -0
- package/node/components/DataGrid/RowCheckbox/RowCheckbox.js +17 -0
- package/node/components/DataGrid/RowCheckbox/constants.d.ts +4 -0
- package/node/components/DataGrid/RowCheckbox/constants.js +7 -0
- package/node/components/DataGrid/RowCheckbox/index.d.ts +1 -0
- package/node/components/DataGrid/RowCheckbox/index.js +17 -0
- package/node/components/DataGrid/RowCheckbox/types.d.ts +7 -0
- package/node/components/DataGrid/RowCheckbox/types.js +2 -0
- package/node/components/DataGrid/constants.d.ts +2 -0
- package/node/components/DataGrid/constants.js +2 -0
- package/node/components/DataGrid/hooks/index.d.ts +1 -0
- package/node/components/DataGrid/hooks/index.js +1 -0
- package/node/components/DataGrid/hooks/useWarnRowsWithoutDisabledReason/index.d.ts +1 -0
- package/node/components/DataGrid/hooks/useWarnRowsWithoutDisabledReason/index.js +17 -0
- package/node/components/DataGrid/hooks/useWarnRowsWithoutDisabledReason/useWarnRowsWithoutDisabledReason.d.ts +5 -0
- package/node/components/DataGrid/hooks/useWarnRowsWithoutDisabledReason/useWarnRowsWithoutDisabledReason.js +21 -0
- package/node/components/DataGrid/index.d.ts +1 -1
- package/node/components/DataGrid/public.d.ts +1 -1
- package/node/components/DataGrid/styles.d.ts +4 -0
- package/node/components/DataGrid/styles.js +27 -1
- package/node/components/DataGrid/tests/performance/testDataGridPerformance.d.ts +3 -1
- package/node/components/DataGrid/tests/performance/testDataGridPerformance.js +232 -0
- package/node/components/DataGrid/tests/selection/testDataGridSelection.d.ts +14 -0
- package/node/components/DataGrid/tests/selection/testDataGridSelection.js +566 -0
- package/node/components/DataGrid/types.d.ts +41 -1
- package/node/components/DataGrid/useLogic/useLogic.d.ts +8 -3
- package/node/components/DataGrid/useLogic/useLogic.js +25 -12
- package/node/components/DataGrid/utils/checkIsMassActionsOpen/checkIsMassActionsOpen.d.ts +10 -0
- package/node/components/DataGrid/utils/checkIsMassActionsOpen/checkIsMassActionsOpen.js +8 -0
- package/node/components/DataGrid/utils/checkIsMassActionsOpen/index.d.ts +1 -0
- package/node/components/DataGrid/utils/checkIsMassActionsOpen/index.js +5 -0
- package/node/components/DataGrid/utils/getRowDisabledState/getRowDisabledState.d.ts +31 -0
- package/node/components/DataGrid/utils/getRowDisabledState/getRowDisabledState.js +24 -0
- package/node/components/DataGrid/utils/getRowDisabledState/index.d.ts +1 -0
- package/node/components/DataGrid/utils/getRowDisabledState/index.js +5 -0
- package/node/components/DataGrid/utils/index.d.ts +4 -0
- package/node/components/DataGrid/utils/index.js +9 -1
- package/node/components/DataGrid/utils/resolveRowDisabled/index.d.ts +1 -0
- package/node/components/DataGrid/utils/resolveRowDisabled/index.js +5 -0
- package/node/components/DataGrid/utils/resolveRowDisabled/resolveRowDisabled.d.ts +5 -0
- package/node/components/DataGrid/utils/resolveRowDisabled/resolveRowDisabled.js +21 -0
- package/node/components/DataGrid/utils/resolveRowsDisabled/index.d.ts +1 -0
- package/node/components/DataGrid/utils/resolveRowsDisabled/index.js +5 -0
- package/node/components/DataGrid/utils/resolveRowsDisabled/resolveRowsDisabled.d.ts +16 -0
- package/node/components/DataGrid/utils/resolveRowsDisabled/resolveRowsDisabled.js +21 -0
- package/node/components/DataGridActionCell/hooks/useBlockingActions/useBlockingActions.js +3 -3
- package/node/components/DataGridCollapsibleRow/useLogic/useLogic.d.ts +3 -2
- package/node/components/DataGridCollapsibleRow/useLogic/useLogic.js +4 -3
- package/node/components/DataGridInfinite/DataGridInfinite.js +19 -15
- package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContext.d.ts +1 -1
- package/node/components/DataGridInfinite/DataGridInfiniteContext/DataGridInfiniteContext.js +1 -1
- package/node/components/DataGridInfinite/Footer/Footer.d.ts +6 -0
- package/node/components/DataGridInfinite/Footer/Footer.js +29 -0
- package/node/components/DataGridInfinite/Footer/index.d.ts +2 -0
- package/node/components/DataGridInfinite/Footer/index.js +17 -0
- package/node/components/DataGridInfinite/Footer/types.d.ts +26 -0
- package/node/components/DataGridInfinite/Footer/types.js +2 -0
- package/node/components/DataGridInfinite/Row/Row.js +2 -2
- package/node/components/DataGridInfinite/Row/index.d.ts +1 -0
- package/node/components/DataGridInfinite/Row/types.d.ts +17 -2
- package/node/components/DataGridInfinite/Row/useLogic/useLogic.d.ts +4 -2
- package/node/components/DataGridInfinite/Row/useLogic/useLogic.js +12 -4
- package/node/components/DataGridInfinite/constants.d.ts +3 -0
- package/node/components/DataGridInfinite/constants.js +3 -0
- package/node/components/DataGridInfinite/faker.d.ts +1 -5
- package/node/components/DataGridInfinite/faker.js +1 -2
- package/node/components/DataGridInfinite/styles.d.ts +4 -0
- package/node/components/DataGridInfinite/styles.js +27 -3
- package/node/components/DataGridInfinite/useLogic/useLogic.d.ts +7 -3
- package/node/components/DataGridInfinite/useLogic/useLogic.js +52 -16
- package/node/components/DataGridMassActions/DataGridMassActions.d.ts +15 -0
- package/node/components/DataGridMassActions/DataGridMassActions.js +36 -0
- package/node/components/DataGridMassActions/constants.d.ts +4 -0
- package/node/components/DataGridMassActions/constants.js +8 -0
- package/node/components/DataGridMassActions/index.d.ts +2 -0
- package/node/components/DataGridMassActions/index.js +5 -0
- package/node/components/DataGridMassActions/public.d.ts +2 -0
- package/node/components/DataGridMassActions/public.js +5 -0
- package/node/components/DataGridMassActions/styles.d.ts +8 -0
- package/node/components/DataGridMassActions/styles.js +52 -0
- package/node/components/DataGridMassActions/tests/testDataGridMassActions.d.ts +23 -0
- package/node/components/DataGridMassActions/tests/testDataGridMassActions.js +81 -0
- package/node/components/DataGridMassActions/types.d.ts +2 -0
- package/node/components/DataGridMassActions/types.js +2 -0
- package/node/components/DataGridMassActions/useLogic/index.d.ts +1 -0
- package/node/components/DataGridMassActions/useLogic/index.js +17 -0
- package/node/components/DataGridMassActions/useLogic/useLogic.d.ts +6 -0
- package/node/components/DataGridMassActions/useLogic/useLogic.js +25 -0
- package/node/components/IconDropdownButton/IconDropdownButton.d.ts +5 -0
- package/node/components/IconDropdownButton/IconDropdownButton.js +2 -2
- package/node/components/MassActions/MassActions.d.ts +5 -0
- package/node/components/MassActions/MassActions.js +21 -0
- package/node/components/MassActions/constants.d.ts +6 -0
- package/node/components/MassActions/constants.js +15 -0
- package/node/components/MassActions/index.d.ts +2 -0
- package/node/components/MassActions/index.js +5 -0
- package/node/components/MassActions/styles.d.ts +34 -0
- package/node/components/MassActions/styles.js +46 -0
- package/node/components/MassActions/types.d.ts +20 -0
- package/node/components/MassActions/types.js +2 -0
- package/node/components/MassActions/useLogic/index.d.ts +1 -0
- package/node/components/MassActions/useLogic/index.js +17 -0
- package/node/components/MassActions/useLogic/useLogic.d.ts +7 -0
- package/node/components/MassActions/useLogic/useLogic.js +13 -0
- package/node/components/PageHeader/PageActions/SecondaryActions/styles.d.ts +1 -1
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/index.d.ts +0 -1
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/index.js +0 -1
- package/node/components/Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/useLogic.js +2 -1
- package/node/components/index.d.ts +1 -1
- package/package.json +1 -1
- /package/components/{Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount → useDelayedUnmount}/index.d.ts +0 -0
- /package/components/{Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount → useDelayedUnmount}/index.js +0 -0
- /package/components/{Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount → useDelayedUnmount}/useDelayedUnmount.d.ts +0 -0
- /package/components/{Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount → useDelayedUnmount}/useDelayedUnmount.js +0 -0
- /package/node/components/{Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount → useDelayedUnmount}/index.d.ts +0 -0
- /package/node/components/{Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount → useDelayedUnmount}/index.js +0 -0
- /package/node/components/{Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount → useDelayedUnmount}/useDelayedUnmount.d.ts +0 -0
- /package/node/components/{Tree/TreeItem/MobileSlidePanel/MobileSlidePanelContent/useLogic/hooks/useDelayedUnmount → useDelayedUnmount}/useDelayedUnmount.js +0 -0
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import { type ChangeEvent } from 'react';
|
|
2
|
+
import { type DataGridRowDisabled } from '../../types';
|
|
2
3
|
export type RowContextProps = {
|
|
3
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Если true, в строке выполняется блокирующее действие DataGridActionCell
|
|
6
|
+
*/
|
|
7
|
+
hasBlockingAction: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Причина блокировки от блокирующего действия
|
|
10
|
+
*/
|
|
11
|
+
blockingActionReason?: string;
|
|
12
|
+
addBlockingAction: (reason?: string) => void;
|
|
13
|
+
removeBlockingAction: () => void;
|
|
4
14
|
isSelectable?: boolean;
|
|
5
|
-
disabledReason?: string;
|
|
6
|
-
addDisabledRow: (disabledReason?: string) => void;
|
|
7
|
-
removeDisabledRow: () => void;
|
|
8
15
|
row: Record<string, unknown>;
|
|
9
16
|
onSelectRow: (row: Record<string, unknown>) => (event: ChangeEvent<HTMLInputElement>) => void;
|
|
10
17
|
onRowEnter?: (rowId: string) => void;
|
|
@@ -13,5 +20,9 @@ export type RowContextProps = {
|
|
|
13
20
|
unregisterRowElement?: (rowId: string, el: HTMLElement) => void;
|
|
14
21
|
itemProps?: object;
|
|
15
22
|
isSelected?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Итоговая блокировка строки, рассчитанная resolveRowDisabled
|
|
25
|
+
*/
|
|
26
|
+
rowDisabled?: DataGridRowDisabled;
|
|
16
27
|
};
|
|
17
28
|
export declare const RowContext: import("react").Context<RowContextProps>;
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RowContext = void 0;
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
exports.RowContext = (0, react_1.createContext)({
|
|
6
|
-
|
|
6
|
+
hasBlockingAction: false,
|
|
7
7
|
isSelectable: false,
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
addBlockingAction: () => undefined,
|
|
9
|
+
removeBlockingAction: () => undefined,
|
|
10
10
|
row: {},
|
|
11
11
|
onSelectRow: () => () => undefined,
|
|
12
12
|
onRowEnter: () => undefined,
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
+
import { type DataGridRowDisabled } from '../../../types';
|
|
2
3
|
import { type RowContextProps } from '../RowContext';
|
|
3
4
|
type RowContextProviderProps = Pick<RowContextProps, 'row' | 'itemProps' | 'onSelectRow' | 'onRowEnter' | 'onRowLeave' | 'registerRowElement' | 'unregisterRowElement' | 'isSelectable' | 'isSelected'> & {
|
|
5
|
+
/**
|
|
6
|
+
* Режим блокировки строки
|
|
7
|
+
*/
|
|
8
|
+
disabledMode?: DataGridRowDisabled['mode'];
|
|
9
|
+
/**
|
|
10
|
+
* Причина блокировки строки
|
|
11
|
+
*/
|
|
12
|
+
disabledReason?: string;
|
|
4
13
|
children: ReactNode;
|
|
5
14
|
};
|
|
6
|
-
export declare const RowContextProvider: ({ row, itemProps, onSelectRow, onRowEnter, onRowLeave, registerRowElement, unregisterRowElement, children, isSelectable, isSelected, }: RowContextProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const RowContextProvider: ({ row, itemProps, onSelectRow, onRowEnter, onRowLeave, registerRowElement, unregisterRowElement, children, isSelectable, isSelected, disabledMode, disabledReason, }: RowContextProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
16
|
export {};
|
|
@@ -4,23 +4,27 @@ exports.RowContextProvider = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const RowContext_1 = require("../RowContext");
|
|
7
|
-
const RowContextProvider = ({ row, itemProps, onSelectRow, onRowEnter, onRowLeave, registerRowElement, unregisterRowElement, children, isSelectable, isSelected, }) => {
|
|
8
|
-
const [
|
|
9
|
-
const [
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
const RowContextProvider = ({ row, itemProps, onSelectRow, onRowEnter, onRowLeave, registerRowElement, unregisterRowElement, children, isSelectable, isSelected, disabledMode, disabledReason, }) => {
|
|
8
|
+
const [hasBlockingAction, setHasBlockingAction] = (0, react_1.useState)(false);
|
|
9
|
+
const [blockingActionReason, setBlockingActionReason] = (0, react_1.useState)();
|
|
10
|
+
const addBlockingAction = (0, react_1.useCallback)((reason) => {
|
|
11
|
+
setHasBlockingAction(true);
|
|
12
|
+
setBlockingActionReason(reason);
|
|
13
13
|
}, []);
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const removeBlockingAction = (0, react_1.useCallback)(() => {
|
|
15
|
+
setHasBlockingAction(false);
|
|
16
|
+
setBlockingActionReason(undefined);
|
|
17
17
|
}, []);
|
|
18
|
+
// Блокировка приходит примитивами, чтобы новый объект с тем же содержимым не обновлял контекст
|
|
19
|
+
const rowDisabled = (0, react_1.useMemo)(() => disabledMode
|
|
20
|
+
? { mode: disabledMode, reason: disabledReason ?? '' }
|
|
21
|
+
: undefined, [disabledMode, disabledReason]);
|
|
18
22
|
const contextValue = (0, react_1.useMemo)(() => ({
|
|
19
|
-
|
|
23
|
+
hasBlockingAction,
|
|
24
|
+
blockingActionReason,
|
|
25
|
+
addBlockingAction,
|
|
26
|
+
removeBlockingAction,
|
|
20
27
|
isSelectable,
|
|
21
|
-
disabledReason,
|
|
22
|
-
addDisabledRow,
|
|
23
|
-
removeDisabledRow,
|
|
24
28
|
row,
|
|
25
29
|
itemProps,
|
|
26
30
|
onSelectRow,
|
|
@@ -29,12 +33,13 @@ const RowContextProvider = ({ row, itemProps, onSelectRow, onRowEnter, onRowLeav
|
|
|
29
33
|
registerRowElement,
|
|
30
34
|
unregisterRowElement,
|
|
31
35
|
isSelected,
|
|
36
|
+
rowDisabled,
|
|
32
37
|
}), [
|
|
33
|
-
|
|
38
|
+
hasBlockingAction,
|
|
39
|
+
blockingActionReason,
|
|
40
|
+
addBlockingAction,
|
|
41
|
+
removeBlockingAction,
|
|
34
42
|
isSelectable,
|
|
35
|
-
disabledReason,
|
|
36
|
-
addDisabledRow,
|
|
37
|
-
removeDisabledRow,
|
|
38
43
|
row,
|
|
39
44
|
itemProps,
|
|
40
45
|
onSelectRow,
|
|
@@ -43,6 +48,7 @@ const RowContextProvider = ({ row, itemProps, onSelectRow, onRowEnter, onRowLeav
|
|
|
43
48
|
registerRowElement,
|
|
44
49
|
unregisterRowElement,
|
|
45
50
|
isSelected,
|
|
51
|
+
rowDisabled,
|
|
46
52
|
]);
|
|
47
53
|
return ((0, jsx_runtime_1.jsx)(RowContext_1.RowContext.Provider, { value: contextValue, children: children }));
|
|
48
54
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ChangeEvent, type CSSProperties, type ReactNode } from 'react';
|
|
2
2
|
import { type Variant } from '../enums';
|
|
3
|
-
import { type CellValue, type DataGridColumns, type DataGridRowOptions } from '../types';
|
|
3
|
+
import { type CellValue, type DataGridColumns, type DataGridProps, type DataGridRowOptions } from '../types';
|
|
4
4
|
export type RowProps<TData extends Record<string, CellValue>> = {
|
|
5
5
|
/**
|
|
6
6
|
* Название класса, применяется к корневому компоненту
|
|
@@ -71,9 +71,13 @@ export type RowProps<TData extends Record<string, CellValue>> = {
|
|
|
71
71
|
*/
|
|
72
72
|
isSelected?: boolean;
|
|
73
73
|
/**
|
|
74
|
-
*
|
|
74
|
+
* Если true, строка вложенная и сама вычисляет блокировку
|
|
75
75
|
*/
|
|
76
|
-
|
|
76
|
+
isNested?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* Функция блокировки для вложенных строк. Передаётся только строкам с дочерними элементами
|
|
79
|
+
*/
|
|
80
|
+
getRowDisabled?: DataGridProps<TData>['getRowDisabled'];
|
|
77
81
|
/**
|
|
78
82
|
* Заглушка для пустых ячеек (если отсутствует field и filter и renderCell)
|
|
79
83
|
* @default '-'
|
|
@@ -2,8 +2,8 @@ import { type MouseEvent, type SyntheticEvent } from 'react';
|
|
|
2
2
|
import type { CellValue } from '../../types';
|
|
3
3
|
import type { RowProps } from '../types';
|
|
4
4
|
type UseLogicParams<TData extends Record<string, CellValue>> = RowProps<TData>;
|
|
5
|
-
export declare const useLogic: <TData extends Record<string, unknown>>({ keyId, columns, row, nestedChildren, level, variant, options, isInitialExpanded, expandedLevel, isSelectable, isSelected, onSelectRow, onRowClick, isVisibleCollapseButton, registerRowElement, unregisterRowElement, style, activeRowId, }: UseLogicParams<TData>) => {
|
|
6
|
-
|
|
5
|
+
export declare const useLogic: <TData extends Record<string, unknown>>({ keyId, columns, row, nestedChildren, level, variant, options, isInitialExpanded, expandedLevel, isSelectable, isSelected, getRowDisabled, isNested, onSelectRow, onRowClick, isVisibleCollapseButton, registerRowElement, unregisterRowElement, style, activeRowId, }: UseLogicParams<TData>) => {
|
|
6
|
+
disabledReason: string | undefined;
|
|
7
7
|
rowStyles: {
|
|
8
8
|
accentColor?: import("csstype").Property.AccentColor | undefined;
|
|
9
9
|
alignContent?: import("csstype").Property.AlignContent | undefined;
|
|
@@ -869,7 +869,8 @@ export declare const useLogic: <TData extends Record<string, unknown>>({ keyId,
|
|
|
869
869
|
childrenColumns: any[];
|
|
870
870
|
rowId: string;
|
|
871
871
|
rowRef: (element: HTMLElement | null) => void;
|
|
872
|
-
|
|
872
|
+
isDisabled: boolean;
|
|
873
|
+
isDisabledLastCell: boolean;
|
|
873
874
|
isSelectable: boolean | undefined;
|
|
874
875
|
isRenderCollapseButton: boolean;
|
|
875
876
|
handleToggle: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
@@ -895,7 +896,8 @@ export declare const useLogic: <TData extends Record<string, unknown>>({ keyId,
|
|
|
895
896
|
};
|
|
896
897
|
checkboxProps: {
|
|
897
898
|
checked: boolean | undefined;
|
|
898
|
-
disabled: boolean
|
|
899
|
+
disabled: boolean;
|
|
900
|
+
disabledReason: string | undefined;
|
|
899
901
|
onChange: (event: import("react").ChangeEvent<HTMLInputElement, Element>) => void;
|
|
900
902
|
};
|
|
901
903
|
nestedChildrenProps: {
|
|
@@ -4,11 +4,12 @@ exports.useLogic = void 0;
|
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const DataGridContext_1 = require("../../DataGridContext");
|
|
6
6
|
const enums_1 = require("../../enums");
|
|
7
|
+
const utils_1 = require("../../utils");
|
|
7
8
|
const constants_1 = require("../constants");
|
|
8
9
|
const RowContext_1 = require("../RowContext");
|
|
9
10
|
const hooks_1 = require("./hooks");
|
|
10
|
-
const
|
|
11
|
-
const useLogic = ({ keyId, columns, row, nestedChildren, level, variant, options, isInitialExpanded = false, expandedLevel, isSelectable, isSelected, onSelectRow, onRowClick, isVisibleCollapseButton, registerRowElement, unregisterRowElement, style, activeRowId, }) => {
|
|
11
|
+
const utils_2 = require("./utils");
|
|
12
|
+
const useLogic = ({ keyId, columns, row, nestedChildren, level, variant, options, isInitialExpanded = false, expandedLevel, isSelectable, isSelected, getRowDisabled, isNested = false, onSelectRow, onRowClick, isVisibleCollapseButton, registerRowElement, unregisterRowElement, style, activeRowId, }) => {
|
|
12
13
|
const { isDrawerOpen, handleOpenDrawer, handleCloseDrawer } = (0, hooks_1.useMobileLogic)();
|
|
13
14
|
const [rootRowElement, setRootRowElement] = (0, react_1.useState)(null);
|
|
14
15
|
const rootRowRef = (0, react_1.useCallback)((element) => {
|
|
@@ -18,7 +19,7 @@ const useLogic = ({ keyId, columns, row, nestedChildren, level, variant, options
|
|
|
18
19
|
}, []);
|
|
19
20
|
const isDefaultExpanded = Boolean(isInitialExpanded && level <= expandedLevel - 1 && nestedChildren?.length);
|
|
20
21
|
const { mobileDisplayVariant } = (0, react_1.useContext)(DataGridContext_1.DataGridContext);
|
|
21
|
-
const {
|
|
22
|
+
const { hasBlockingAction, blockingActionReason, rowDisabled: contextRowDisabled, } = (0, react_1.useContext)(RowContext_1.RowContext);
|
|
22
23
|
const [isOpen, setIsOpen] = (0, react_1.useState)(isDefaultExpanded);
|
|
23
24
|
const savedElementRef = (0, react_1.useRef)(null);
|
|
24
25
|
const rowRef = (element) => {
|
|
@@ -33,17 +34,24 @@ const useLogic = ({ keyId, columns, row, nestedChildren, level, variant, options
|
|
|
33
34
|
};
|
|
34
35
|
const [isVisibleTooltip, setVisibleTooltip] = (0, react_1.useState)(false);
|
|
35
36
|
const rowId = row[keyId];
|
|
36
|
-
const {
|
|
37
|
-
|
|
37
|
+
const { href } = options || {};
|
|
38
|
+
// Блокировку строки из rows таблица передаёт через контекст, вложенная строка считает её сама и не наследует блокировку родителя
|
|
39
|
+
const rowDisabled = (0, react_1.useMemo)(() => isNested ? (0, utils_1.resolveRowDisabled)(row, getRowDisabled) : contextRowDisabled, [isNested, row, getRowDisabled, contextRowDisabled]);
|
|
40
|
+
const { isDisabled, isDisabledLastCell, disabledReason, isCheckboxDisabled, checkboxDisabledReason, } = (0, utils_1.getRowDisabledState)({
|
|
41
|
+
rowDisabled,
|
|
42
|
+
hasBlockingAction,
|
|
43
|
+
blockingActionReason,
|
|
44
|
+
isDisabledLastCellOption: options?.isDisabledLastCell,
|
|
45
|
+
});
|
|
38
46
|
const handleRowClick = () => {
|
|
39
|
-
if (
|
|
47
|
+
if (isDisabled) {
|
|
40
48
|
handleOpenDrawer();
|
|
41
49
|
return undefined;
|
|
42
50
|
}
|
|
43
51
|
onRowClick?.(row);
|
|
44
52
|
};
|
|
45
53
|
const isShowConnector = Object.is(variant, enums_1.Variant.Tree);
|
|
46
|
-
const childrenColumns = (0, react_1.useMemo)(() => (0,
|
|
54
|
+
const childrenColumns = (0, react_1.useMemo)(() => (0, utils_2.mergeColumnsOptions)(columns, options?.childrenColumns), [columns, options]);
|
|
47
55
|
const handleToggle = (0, react_1.useCallback)((event) => {
|
|
48
56
|
event.stopPropagation();
|
|
49
57
|
setIsOpen((prev) => !prev);
|
|
@@ -57,7 +65,7 @@ const useLogic = ({ keyId, columns, row, nestedChildren, level, variant, options
|
|
|
57
65
|
};
|
|
58
66
|
const handleCloseTooltip = () => setVisibleTooltip(false);
|
|
59
67
|
const handleMouseMove = (event) => {
|
|
60
|
-
if (!
|
|
68
|
+
if (!isDisabled) {
|
|
61
69
|
return;
|
|
62
70
|
}
|
|
63
71
|
const element = event.target;
|
|
@@ -71,19 +79,19 @@ const useLogic = ({ keyId, columns, row, nestedChildren, level, variant, options
|
|
|
71
79
|
'--level': level,
|
|
72
80
|
...style,
|
|
73
81
|
}), [level, style]);
|
|
74
|
-
const isHovered = Boolean(!
|
|
82
|
+
const isHovered = Boolean(!isDisabled && (onRowClick || href));
|
|
75
83
|
const isActive = activeRowId === rowId;
|
|
76
|
-
const disabledReasonText = externalDisabledReason || disabledReason;
|
|
77
84
|
const handleCheckboxChange = (0, react_1.useMemo)(() => onSelectRow(row), [onSelectRow, row]);
|
|
78
85
|
return {
|
|
79
|
-
|
|
86
|
+
disabledReason,
|
|
80
87
|
rowStyles,
|
|
81
88
|
isOpen,
|
|
82
89
|
isShowConnector,
|
|
83
90
|
childrenColumns,
|
|
84
91
|
rowId,
|
|
85
92
|
rowRef,
|
|
86
|
-
|
|
93
|
+
isDisabled,
|
|
94
|
+
isDisabledLastCell,
|
|
87
95
|
isSelectable,
|
|
88
96
|
isRenderCollapseButton,
|
|
89
97
|
handleToggle,
|
|
@@ -103,13 +111,14 @@ const useLogic = ({ keyId, columns, row, nestedChildren, level, variant, options
|
|
|
103
111
|
},
|
|
104
112
|
tooltipProps: {
|
|
105
113
|
open: isVisibleTooltip,
|
|
106
|
-
title:
|
|
114
|
+
title: isDisabled ? disabledReason : undefined,
|
|
107
115
|
onOpen: handleOpenTooltip,
|
|
108
116
|
onClose: handleCloseTooltip,
|
|
109
117
|
},
|
|
110
118
|
checkboxProps: {
|
|
111
119
|
checked: isSelected,
|
|
112
|
-
disabled,
|
|
120
|
+
disabled: isCheckboxDisabled,
|
|
121
|
+
disabledReason: checkboxDisabledReason,
|
|
113
122
|
onChange: handleCheckboxChange,
|
|
114
123
|
},
|
|
115
124
|
nestedChildrenProps: {
|
|
@@ -4,7 +4,6 @@ exports.RowBase = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const BottomDrawer_1 = require("../../BottomDrawer");
|
|
7
|
-
const Checkbox_1 = require("../../Checkbox");
|
|
8
7
|
const Tooltip_1 = require("../../Tooltip");
|
|
9
8
|
const cn_1 = require("../../utils/cn");
|
|
10
9
|
const cva_1 = require("../../utils/cva");
|
|
@@ -12,6 +11,7 @@ const getInertProps_1 = require("../../utils/getInertProps");
|
|
|
12
11
|
const Cell_1 = require("../Cell");
|
|
13
12
|
const constants_1 = require("../Row/constants");
|
|
14
13
|
const utils_1 = require("../Row/utils");
|
|
14
|
+
const RowCheckbox_1 = require("../RowCheckbox");
|
|
15
15
|
const utils_2 = require("../utils");
|
|
16
16
|
const constants_2 = require("./constants");
|
|
17
17
|
const GroupCell_1 = require("./GroupCell");
|
|
@@ -43,7 +43,7 @@ exports.RowBase = (0, react_1.memo)((props) => {
|
|
|
43
43
|
if (!adornment && !shouldRenderCheckbox) {
|
|
44
44
|
return null;
|
|
45
45
|
}
|
|
46
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [adornment, shouldRenderCheckbox && ((0, jsx_runtime_1.jsx)(styles_1.CheckboxCell, { ...(0, getInertProps_1.getInertProps)(isDisabled), onClick: (event) => event.stopPropagation(), className: constants_1.dataGridRowClassnames.checkbox, children: (0, jsx_runtime_1.jsx)(
|
|
46
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [adornment, shouldRenderCheckbox && ((0, jsx_runtime_1.jsx)(styles_1.CheckboxCell, { ...(0, getInertProps_1.getInertProps)(isDisabled), onClick: (event) => event.stopPropagation(), className: constants_1.dataGridRowClassnames.checkbox, children: (0, jsx_runtime_1.jsx)(RowCheckbox_1.RowCheckbox, { ...checkboxProps }) }))] }));
|
|
47
47
|
};
|
|
48
48
|
const renderCells = (0, react_1.useCallback)(() => {
|
|
49
49
|
const lastCellGlobalIndex = columns.length - 1;
|
|
@@ -64,9 +64,12 @@ exports.RowBase = (0, react_1.memo)((props) => {
|
|
|
64
64
|
row,
|
|
65
65
|
columns,
|
|
66
66
|
isDisabled,
|
|
67
|
+
isDisabledLastCell,
|
|
67
68
|
sectionOffset,
|
|
68
69
|
renderStartAdornment,
|
|
69
70
|
checkboxProps.checked,
|
|
71
|
+
checkboxProps.disabled,
|
|
72
|
+
checkboxProps.disabledReason,
|
|
70
73
|
]);
|
|
71
74
|
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { className: (0, cn_1.cn)(className, rootCva({ mobileDisplayVariant })), style: rowBaseVars, ...dataGridInfiniteItemProps, children: [(0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { ...tooltipProps, children: (0, jsx_runtime_1.jsx)(styles_1.ContentWrapper, { ref: rowRef, onPointerEnter: () => onRowEnter?.(rowId), onPointerLeave: (event) => onRowLeave?.(rowId, event.nativeEvent), className: contentWrapperCva({ isHovered, isActive }), [constants_1.DISABLE_ROW_ATTR]: isDisabled, onClick: handleRowClick, children: renderCells() }) }), customContent, (0, jsx_runtime_1.jsx)(BottomDrawer_1.BottomDrawer, { ...drawerProps, children: (0, jsx_runtime_1.jsx)(styles_1.BottomDrawerContent, { children: drawerContent }) })] }, `row-base-${rowId}`));
|
|
72
75
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ChangeEvent, type ReactNode } from 'react';
|
|
2
|
-
import type { DataGridColumns, DataGridRowWithOptions } from '../types';
|
|
2
|
+
import type { DataGridColumns, DataGridRowDisabled, DataGridRowWithOptions } from '../types';
|
|
3
3
|
export type RowBaseProps = {
|
|
4
4
|
/**
|
|
5
5
|
* Массив колонок
|
|
@@ -42,13 +42,17 @@ export type RowBaseProps = {
|
|
|
42
42
|
*/
|
|
43
43
|
isSelected?: boolean;
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* Если true, в строке выполняется блокирующее действие DataGridActionCell
|
|
46
46
|
*/
|
|
47
|
-
|
|
47
|
+
hasBlockingAction?: boolean;
|
|
48
48
|
/**
|
|
49
|
-
* Причина блокировки
|
|
49
|
+
* Причина блокировки от блокирующего действия
|
|
50
50
|
*/
|
|
51
|
-
|
|
51
|
+
blockingActionReason?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Итоговая блокировка строки, рассчитанная resolveRowDisabled
|
|
54
|
+
*/
|
|
55
|
+
rowDisabled?: DataGridRowDisabled;
|
|
52
56
|
/**
|
|
53
57
|
* Обработчик выбора строки
|
|
54
58
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type CSSProperties, type SyntheticEvent } from 'react';
|
|
2
2
|
import type { RowBaseProps } from '../types';
|
|
3
3
|
type UseLogicParams = RowBaseProps;
|
|
4
|
-
export declare const useLogic: ({ className, row, keyId, onRowClick, columns, sectionOffset, customContent, renderStartAdornment, isSelected,
|
|
4
|
+
export declare const useLogic: ({ className, row, keyId, onRowClick, columns, sectionOffset, customContent, renderStartAdornment, isSelected, hasBlockingAction, blockingActionReason, rowDisabled, onSelectRow, onRowEnter, onRowLeave, registerRowElement, unregisterRowElement, gridColumns, activeRowId, emptyCellValue, isSelectable, rowId, mobileDisplayVariant, ...dataGridInfiniteItemProps }: UseLogicParams) => {
|
|
5
5
|
handleRowClick: () => void;
|
|
6
6
|
tooltipProps: {
|
|
7
7
|
open: boolean;
|
|
@@ -13,7 +13,8 @@ export declare const useLogic: ({ className, row, keyId, onRowClick, columns, se
|
|
|
13
13
|
};
|
|
14
14
|
checkboxProps: {
|
|
15
15
|
checked: boolean | undefined;
|
|
16
|
-
disabled: boolean
|
|
16
|
+
disabled: boolean;
|
|
17
|
+
disabledReason: string | undefined;
|
|
17
18
|
onChange: (event: import("react").ChangeEvent<HTMLInputElement, Element>) => void;
|
|
18
19
|
};
|
|
19
20
|
drawerProps: {
|
|
@@ -34,10 +35,10 @@ export declare const useLogic: ({ className, row, keyId, onRowClick, columns, se
|
|
|
34
35
|
onRowLeave: ((rowId: string, event: PointerEvent) => void) | undefined;
|
|
35
36
|
rowId: string;
|
|
36
37
|
row: import("../..").DataGridRowWithOptions<Record<string, unknown>>;
|
|
37
|
-
isDisabled: boolean
|
|
38
|
+
isDisabled: boolean;
|
|
38
39
|
sectionOffset: number | undefined;
|
|
39
40
|
customContent: import("react").ReactNode;
|
|
40
|
-
isDisabledLastCell: boolean
|
|
41
|
+
isDisabledLastCell: boolean;
|
|
41
42
|
renderStartAdornment: ((isFirstCell: boolean) => import("react").ReactNode) | undefined;
|
|
42
43
|
isSelectable: boolean | undefined;
|
|
43
44
|
isNotSelectable: boolean | undefined;
|
|
@@ -4,16 +4,21 @@ exports.useLogic = void 0;
|
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const redirectToLink_1 = require("../../../utils/redirectToLink");
|
|
6
6
|
const hooks_1 = require("../../Row/useLogic/hooks");
|
|
7
|
+
const utils_1 = require("../../utils");
|
|
7
8
|
const constants_1 = require("../constants");
|
|
8
|
-
const useLogic = ({ className, row, keyId, onRowClick, columns, sectionOffset, customContent, renderStartAdornment, isSelected,
|
|
9
|
+
const useLogic = ({ className, row, keyId, onRowClick, columns, sectionOffset, customContent, renderStartAdornment, isSelected, hasBlockingAction, blockingActionReason, rowDisabled, onSelectRow, onRowEnter, onRowLeave, registerRowElement, unregisterRowElement, gridColumns, activeRowId, emptyCellValue, isSelectable, rowId, mobileDisplayVariant, ...dataGridInfiniteItemProps }) => {
|
|
9
10
|
const [isVisibleTooltip, setVisibleTooltip] = (0, react_1.useState)(false);
|
|
10
11
|
const savedElementRef = (0, react_1.useRef)(null);
|
|
11
12
|
const { isDrawerOpen, handleOpenDrawer, handleCloseDrawer } = (0, hooks_1.useMobileLogic)();
|
|
12
13
|
const { options } = row;
|
|
13
14
|
const { style: dataGridInfiniteItemStyle, ...restDataGridInfiniteItemProps } = dataGridInfiniteItemProps || {};
|
|
14
|
-
const {
|
|
15
|
-
const
|
|
16
|
-
|
|
15
|
+
const { href, isNotSelectable, target } = options || {};
|
|
16
|
+
const { isDisabled, isDisabledLastCell, disabledReason, isCheckboxDisabled, checkboxDisabledReason, } = (0, utils_1.getRowDisabledState)({
|
|
17
|
+
rowDisabled,
|
|
18
|
+
hasBlockingAction,
|
|
19
|
+
blockingActionReason,
|
|
20
|
+
isDisabledLastCellOption: options?.isDisabledLastCell,
|
|
21
|
+
});
|
|
17
22
|
const handleOpenTooltip = (event) => {
|
|
18
23
|
const element = event.target;
|
|
19
24
|
const isDisabledCell = element?.getAttribute(constants_1.DISABLE_ROW_ATTR) === 'true';
|
|
@@ -26,7 +31,7 @@ const useLogic = ({ className, row, keyId, onRowClick, columns, sectionOffset, c
|
|
|
26
31
|
'--row-base-grid-columns': gridColumns,
|
|
27
32
|
...(dataGridInfiniteItemStyle || {}),
|
|
28
33
|
};
|
|
29
|
-
const isHovered = Boolean(!
|
|
34
|
+
const isHovered = Boolean(!isDisabled && (onRowClick || href));
|
|
30
35
|
const isActive = activeRowId === rowId;
|
|
31
36
|
const rowRef = (element) => {
|
|
32
37
|
if (element) {
|
|
@@ -39,7 +44,7 @@ const useLogic = ({ className, row, keyId, onRowClick, columns, sectionOffset, c
|
|
|
39
44
|
}
|
|
40
45
|
};
|
|
41
46
|
const handleRowClick = () => {
|
|
42
|
-
if (
|
|
47
|
+
if (isDisabled) {
|
|
43
48
|
handleOpenDrawer();
|
|
44
49
|
return undefined;
|
|
45
50
|
}
|
|
@@ -52,7 +57,7 @@ const useLogic = ({ className, row, keyId, onRowClick, columns, sectionOffset, c
|
|
|
52
57
|
handleRowClick,
|
|
53
58
|
tooltipProps: {
|
|
54
59
|
open: isVisibleTooltip,
|
|
55
|
-
title:
|
|
60
|
+
title: isDisabled ? disabledReason : undefined,
|
|
56
61
|
onOpen: handleOpenTooltip,
|
|
57
62
|
onClose: handleCloseTooltip,
|
|
58
63
|
followCursor: true,
|
|
@@ -60,7 +65,8 @@ const useLogic = ({ className, row, keyId, onRowClick, columns, sectionOffset, c
|
|
|
60
65
|
},
|
|
61
66
|
checkboxProps: {
|
|
62
67
|
checked: isSelected,
|
|
63
|
-
disabled,
|
|
68
|
+
disabled: isCheckboxDisabled,
|
|
69
|
+
disabledReason: checkboxDisabledReason,
|
|
64
70
|
onChange: onSelectRow(row),
|
|
65
71
|
},
|
|
66
72
|
drawerProps: {
|
|
@@ -68,7 +74,7 @@ const useLogic = ({ className, row, keyId, onRowClick, columns, sectionOffset, c
|
|
|
68
74
|
onClose: handleCloseDrawer,
|
|
69
75
|
title: 'Заблокировано',
|
|
70
76
|
},
|
|
71
|
-
drawerContent:
|
|
77
|
+
drawerContent: disabledReason,
|
|
72
78
|
rowBaseVars,
|
|
73
79
|
isHovered,
|
|
74
80
|
isActive,
|
|
@@ -81,7 +87,7 @@ const useLogic = ({ className, row, keyId, onRowClick, columns, sectionOffset, c
|
|
|
81
87
|
onRowLeave,
|
|
82
88
|
rowId,
|
|
83
89
|
row,
|
|
84
|
-
isDisabled
|
|
90
|
+
isDisabled,
|
|
85
91
|
sectionOffset,
|
|
86
92
|
customContent,
|
|
87
93
|
isDisabledLastCell,
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type RowCheckboxProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Checkbox строки. Для заблокированного выбора показывает причину в tooltip
|
|
4
|
+
*/
|
|
5
|
+
export declare const RowCheckbox: ({ disabledReason, ...checkboxProps }: RowCheckboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RowCheckbox = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const Checkbox_1 = require("../../Checkbox");
|
|
6
|
+
const Tooltip_1 = require("../../Tooltip");
|
|
7
|
+
const constants_1 = require("./constants");
|
|
8
|
+
/**
|
|
9
|
+
* Checkbox строки. Для заблокированного выбора показывает причину в tooltip
|
|
10
|
+
*/
|
|
11
|
+
const RowCheckbox = ({ disabledReason, ...checkboxProps }) => {
|
|
12
|
+
if (!disabledReason) {
|
|
13
|
+
return (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { ...checkboxProps });
|
|
14
|
+
}
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)(Tooltip_1.Tooltip, { title: disabledReason, enterDelay: constants_1.DISABLED_REASON_TOOLTIP_DELAY, enterNextDelay: constants_1.DISABLED_REASON_TOOLTIP_DELAY, withoutContainer: false, children: (0, jsx_runtime_1.jsx)(Checkbox_1.Checkbox, { ...checkboxProps }) }));
|
|
16
|
+
};
|
|
17
|
+
exports.RowCheckbox = RowCheckbox;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RowCheckbox';
|
|
@@ -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("./RowCheckbox"), exports);
|
|
@@ -21,6 +21,8 @@ export declare const dataGridClassnames: {
|
|
|
21
21
|
rightPinnedSection: string;
|
|
22
22
|
overflowed: string;
|
|
23
23
|
wrapper: string;
|
|
24
|
+
hasMassActions: string;
|
|
25
|
+
massActionsOpen: string;
|
|
24
26
|
isAllowHorizontalScroll: string;
|
|
25
27
|
hasGroupedColumns: string;
|
|
26
28
|
gridViewFull: string;
|
|
@@ -25,6 +25,8 @@ exports.dataGridClassnames = {
|
|
|
25
25
|
rightPinnedSection: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__right-pinned-section'),
|
|
26
26
|
overflowed: (0, createUIKitClassname_1.createUIKitClassname)('data-grid_overflowed'),
|
|
27
27
|
wrapper: (0, createUIKitClassname_1.createUIKitClassname)('data-grid__wrapper'),
|
|
28
|
+
hasMassActions: (0, createUIKitClassname_1.createUIKitClassname)('data-grid_has-mass-actions'),
|
|
29
|
+
massActionsOpen: (0, createUIKitClassname_1.createUIKitClassname)('data-grid_mass-actions-open'),
|
|
28
30
|
isAllowHorizontalScroll: (0, createUIKitClassname_1.createUIKitClassname)('data-grid_is-allow-horizontal-scroll'),
|
|
29
31
|
hasGroupedColumns: (0, createUIKitClassname_1.createUIKitClassname)('data-grid_has-grouped-columns'),
|
|
30
32
|
gridViewFull: (0, createUIKitClassname_1.createUIKitClassname)('data-grid_grid-view-full'),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useWarnRowsWithoutDisabledReason';
|
|
@@ -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("./useWarnRowsWithoutDisabledReason"), exports);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useWarnRowsWithoutDisabledReason = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
/**
|
|
6
|
+
* Выводит одно агрегированное предупреждение о строках с блокировкой без причины.
|
|
7
|
+
* Строки, о которых уже предупреждали, повторно не попадают в предупреждение
|
|
8
|
+
*/
|
|
9
|
+
const useWarnRowsWithoutDisabledReason = (idsWithoutReason) => {
|
|
10
|
+
const warnedIdsRef = (0, react_1.useRef)(new Set());
|
|
11
|
+
(0, react_1.useEffect)(() => {
|
|
12
|
+
const newIds = idsWithoutReason.filter((id) => !warnedIdsRef.current.has(id));
|
|
13
|
+
if (!newIds.length) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
newIds.forEach((id) => warnedIdsRef.current.add(id));
|
|
17
|
+
// biome-ignore lint/suspicious/noConsole: Ошибка для интеграторов
|
|
18
|
+
console.warn(`UIKIT. DataGrid: getRowDisabled вернул блокировку без reason для строк: ${newIds.join(', ')}`);
|
|
19
|
+
}, [idsWithoutReason]);
|
|
20
|
+
};
|
|
21
|
+
exports.useWarnRowsWithoutDisabledReason = useWarnRowsWithoutDisabledReason;
|