@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,11 +1,12 @@
|
|
|
1
1
|
import { useCallback, useContext, useMemo, useRef, useState, } from 'react';
|
|
2
2
|
import { DataGridContext } from '../../DataGridContext';
|
|
3
3
|
import { Variant } from '../../enums';
|
|
4
|
+
import { getRowDisabledState, resolveRowDisabled } from '../../utils';
|
|
4
5
|
import { DISABLE_ROW_ATTR } from '../constants';
|
|
5
6
|
import { RowContext } from '../RowContext';
|
|
6
7
|
import { useMobileLogic } from './hooks';
|
|
7
8
|
import { mergeColumnsOptions } from './utils';
|
|
8
|
-
export const useLogic = ({ keyId, columns, row, nestedChildren, level, variant, options, isInitialExpanded = false, expandedLevel, isSelectable, isSelected, onSelectRow, onRowClick, isVisibleCollapseButton, registerRowElement, unregisterRowElement, style, activeRowId, }) => {
|
|
9
|
+
export const useLogic = ({ keyId, columns, row, nestedChildren, level, variant, options, isInitialExpanded = false, expandedLevel, isSelectable, isSelected, getRowDisabled, isNested = false, onSelectRow, onRowClick, isVisibleCollapseButton, registerRowElement, unregisterRowElement, style, activeRowId, }) => {
|
|
9
10
|
const { isDrawerOpen, handleOpenDrawer, handleCloseDrawer } = useMobileLogic();
|
|
10
11
|
const [rootRowElement, setRootRowElement] = useState(null);
|
|
11
12
|
const rootRowRef = useCallback((element) => {
|
|
@@ -15,7 +16,7 @@ export const useLogic = ({ keyId, columns, row, nestedChildren, level, variant,
|
|
|
15
16
|
}, []);
|
|
16
17
|
const isDefaultExpanded = Boolean(isInitialExpanded && level <= expandedLevel - 1 && nestedChildren?.length);
|
|
17
18
|
const { mobileDisplayVariant } = useContext(DataGridContext);
|
|
18
|
-
const {
|
|
19
|
+
const { hasBlockingAction, blockingActionReason, rowDisabled: contextRowDisabled, } = useContext(RowContext);
|
|
19
20
|
const [isOpen, setIsOpen] = useState(isDefaultExpanded);
|
|
20
21
|
const savedElementRef = useRef(null);
|
|
21
22
|
const rowRef = (element) => {
|
|
@@ -30,10 +31,17 @@ export const useLogic = ({ keyId, columns, row, nestedChildren, level, variant,
|
|
|
30
31
|
};
|
|
31
32
|
const [isVisibleTooltip, setVisibleTooltip] = useState(false);
|
|
32
33
|
const rowId = row[keyId];
|
|
33
|
-
const {
|
|
34
|
-
|
|
34
|
+
const { href } = options || {};
|
|
35
|
+
// Блокировку строки из rows таблица передаёт через контекст, вложенная строка считает её сама и не наследует блокировку родителя
|
|
36
|
+
const rowDisabled = useMemo(() => isNested ? resolveRowDisabled(row, getRowDisabled) : contextRowDisabled, [isNested, row, getRowDisabled, contextRowDisabled]);
|
|
37
|
+
const { isDisabled, isDisabledLastCell, disabledReason, isCheckboxDisabled, checkboxDisabledReason, } = getRowDisabledState({
|
|
38
|
+
rowDisabled,
|
|
39
|
+
hasBlockingAction,
|
|
40
|
+
blockingActionReason,
|
|
41
|
+
isDisabledLastCellOption: options?.isDisabledLastCell,
|
|
42
|
+
});
|
|
35
43
|
const handleRowClick = () => {
|
|
36
|
-
if (
|
|
44
|
+
if (isDisabled) {
|
|
37
45
|
handleOpenDrawer();
|
|
38
46
|
return undefined;
|
|
39
47
|
}
|
|
@@ -54,7 +62,7 @@ export const useLogic = ({ keyId, columns, row, nestedChildren, level, variant,
|
|
|
54
62
|
};
|
|
55
63
|
const handleCloseTooltip = () => setVisibleTooltip(false);
|
|
56
64
|
const handleMouseMove = (event) => {
|
|
57
|
-
if (!
|
|
65
|
+
if (!isDisabled) {
|
|
58
66
|
return;
|
|
59
67
|
}
|
|
60
68
|
const element = event.target;
|
|
@@ -68,19 +76,19 @@ export const useLogic = ({ keyId, columns, row, nestedChildren, level, variant,
|
|
|
68
76
|
'--level': level,
|
|
69
77
|
...style,
|
|
70
78
|
}), [level, style]);
|
|
71
|
-
const isHovered = Boolean(!
|
|
79
|
+
const isHovered = Boolean(!isDisabled && (onRowClick || href));
|
|
72
80
|
const isActive = activeRowId === rowId;
|
|
73
|
-
const disabledReasonText = externalDisabledReason || disabledReason;
|
|
74
81
|
const handleCheckboxChange = useMemo(() => onSelectRow(row), [onSelectRow, row]);
|
|
75
82
|
return {
|
|
76
|
-
|
|
83
|
+
disabledReason,
|
|
77
84
|
rowStyles,
|
|
78
85
|
isOpen,
|
|
79
86
|
isShowConnector,
|
|
80
87
|
childrenColumns,
|
|
81
88
|
rowId,
|
|
82
89
|
rowRef,
|
|
83
|
-
|
|
90
|
+
isDisabled,
|
|
91
|
+
isDisabledLastCell,
|
|
84
92
|
isSelectable,
|
|
85
93
|
isRenderCollapseButton,
|
|
86
94
|
handleToggle,
|
|
@@ -100,13 +108,14 @@ export const useLogic = ({ keyId, columns, row, nestedChildren, level, variant,
|
|
|
100
108
|
},
|
|
101
109
|
tooltipProps: {
|
|
102
110
|
open: isVisibleTooltip,
|
|
103
|
-
title:
|
|
111
|
+
title: isDisabled ? disabledReason : undefined,
|
|
104
112
|
onOpen: handleOpenTooltip,
|
|
105
113
|
onClose: handleCloseTooltip,
|
|
106
114
|
},
|
|
107
115
|
checkboxProps: {
|
|
108
116
|
checked: isSelected,
|
|
109
|
-
disabled,
|
|
117
|
+
disabled: isCheckboxDisabled,
|
|
118
|
+
disabledReason: checkboxDisabledReason,
|
|
110
119
|
onChange: handleCheckboxChange,
|
|
111
120
|
},
|
|
112
121
|
nestedChildrenProps: {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useCallback } from 'react';
|
|
3
3
|
import { BottomDrawer } from '../../BottomDrawer';
|
|
4
|
-
import { Checkbox } from '../../Checkbox';
|
|
5
4
|
import { Tooltip } from '../../Tooltip';
|
|
6
5
|
import { cn } from '../../utils/cn';
|
|
7
6
|
import { cva } from '../../utils/cva';
|
|
@@ -9,6 +8,7 @@ import { getInertProps } from '../../utils/getInertProps';
|
|
|
9
8
|
import { Cell } from '../Cell';
|
|
10
9
|
import { DISABLE_ROW_ATTR, dataGridRowClassnames } from '../Row/constants';
|
|
11
10
|
import { checkIsDisabled } from '../Row/utils';
|
|
11
|
+
import { RowCheckbox } from '../RowCheckbox';
|
|
12
12
|
import { isGroupColumns } from '../utils';
|
|
13
13
|
import { dataGridRowBaseClassnames } from './constants';
|
|
14
14
|
import { GroupCell } from './GroupCell';
|
|
@@ -40,7 +40,7 @@ export const RowBase = memo((props) => {
|
|
|
40
40
|
if (!adornment && !shouldRenderCheckbox) {
|
|
41
41
|
return null;
|
|
42
42
|
}
|
|
43
|
-
return (_jsxs(_Fragment, { children: [adornment, shouldRenderCheckbox && (_jsx(CheckboxCell, { ...getInertProps(isDisabled), onClick: (event) => event.stopPropagation(), className: dataGridRowClassnames.checkbox, children: _jsx(
|
|
43
|
+
return (_jsxs(_Fragment, { children: [adornment, shouldRenderCheckbox && (_jsx(CheckboxCell, { ...getInertProps(isDisabled), onClick: (event) => event.stopPropagation(), className: dataGridRowClassnames.checkbox, children: _jsx(RowCheckbox, { ...checkboxProps }) }))] }));
|
|
44
44
|
};
|
|
45
45
|
const renderCells = useCallback(() => {
|
|
46
46
|
const lastCellGlobalIndex = columns.length - 1;
|
|
@@ -61,9 +61,12 @@ export const RowBase = memo((props) => {
|
|
|
61
61
|
row,
|
|
62
62
|
columns,
|
|
63
63
|
isDisabled,
|
|
64
|
+
isDisabledLastCell,
|
|
64
65
|
sectionOffset,
|
|
65
66
|
renderStartAdornment,
|
|
66
67
|
checkboxProps.checked,
|
|
68
|
+
checkboxProps.disabled,
|
|
69
|
+
checkboxProps.disabledReason,
|
|
67
70
|
]);
|
|
68
71
|
return (_jsxs(Wrapper, { className: cn(className, rootCva({ mobileDisplayVariant })), style: rowBaseVars, ...dataGridInfiniteItemProps, children: [_jsx(Tooltip, { ...tooltipProps, children: _jsx(ContentWrapper, { ref: rowRef, onPointerEnter: () => onRowEnter?.(rowId), onPointerLeave: (event) => onRowLeave?.(rowId, event.nativeEvent), className: contentWrapperCva({ isHovered, isActive }), [DISABLE_ROW_ATTR]: isDisabled, onClick: handleRowClick, children: renderCells() }) }), customContent, _jsx(BottomDrawer, { ...drawerProps, children: _jsx(BottomDrawerContent, { children: drawerContent }) })] }, `row-base-${rowId}`));
|
|
69
72
|
});
|
|
@@ -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;
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { useRef, useState, } from 'react';
|
|
2
2
|
import { redirectToLink } from '../../../utils/redirectToLink';
|
|
3
3
|
import { useMobileLogic } from '../../Row/useLogic/hooks';
|
|
4
|
+
import { getRowDisabledState } from '../../utils';
|
|
4
5
|
import { DISABLE_ROW_ATTR } from '../constants';
|
|
5
|
-
export const useLogic = ({ className, row, keyId, onRowClick, columns, sectionOffset, customContent, renderStartAdornment, isSelected,
|
|
6
|
+
export 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 }) => {
|
|
6
7
|
const [isVisibleTooltip, setVisibleTooltip] = useState(false);
|
|
7
8
|
const savedElementRef = useRef(null);
|
|
8
9
|
const { isDrawerOpen, handleOpenDrawer, handleCloseDrawer } = useMobileLogic();
|
|
9
10
|
const { options } = row;
|
|
10
11
|
const { style: dataGridInfiniteItemStyle, ...restDataGridInfiniteItemProps } = dataGridInfiniteItemProps || {};
|
|
11
|
-
const {
|
|
12
|
-
const
|
|
13
|
-
|
|
12
|
+
const { href, isNotSelectable, target } = options || {};
|
|
13
|
+
const { isDisabled, isDisabledLastCell, disabledReason, isCheckboxDisabled, checkboxDisabledReason, } = getRowDisabledState({
|
|
14
|
+
rowDisabled,
|
|
15
|
+
hasBlockingAction,
|
|
16
|
+
blockingActionReason,
|
|
17
|
+
isDisabledLastCellOption: options?.isDisabledLastCell,
|
|
18
|
+
});
|
|
14
19
|
const handleOpenTooltip = (event) => {
|
|
15
20
|
const element = event.target;
|
|
16
21
|
const isDisabledCell = element?.getAttribute(DISABLE_ROW_ATTR) === 'true';
|
|
@@ -23,7 +28,7 @@ export const useLogic = ({ className, row, keyId, onRowClick, columns, sectionOf
|
|
|
23
28
|
'--row-base-grid-columns': gridColumns,
|
|
24
29
|
...(dataGridInfiniteItemStyle || {}),
|
|
25
30
|
};
|
|
26
|
-
const isHovered = Boolean(!
|
|
31
|
+
const isHovered = Boolean(!isDisabled && (onRowClick || href));
|
|
27
32
|
const isActive = activeRowId === rowId;
|
|
28
33
|
const rowRef = (element) => {
|
|
29
34
|
if (element) {
|
|
@@ -36,7 +41,7 @@ export const useLogic = ({ className, row, keyId, onRowClick, columns, sectionOf
|
|
|
36
41
|
}
|
|
37
42
|
};
|
|
38
43
|
const handleRowClick = () => {
|
|
39
|
-
if (
|
|
44
|
+
if (isDisabled) {
|
|
40
45
|
handleOpenDrawer();
|
|
41
46
|
return undefined;
|
|
42
47
|
}
|
|
@@ -49,7 +54,7 @@ export const useLogic = ({ className, row, keyId, onRowClick, columns, sectionOf
|
|
|
49
54
|
handleRowClick,
|
|
50
55
|
tooltipProps: {
|
|
51
56
|
open: isVisibleTooltip,
|
|
52
|
-
title:
|
|
57
|
+
title: isDisabled ? disabledReason : undefined,
|
|
53
58
|
onOpen: handleOpenTooltip,
|
|
54
59
|
onClose: handleCloseTooltip,
|
|
55
60
|
followCursor: true,
|
|
@@ -57,7 +62,8 @@ export const useLogic = ({ className, row, keyId, onRowClick, columns, sectionOf
|
|
|
57
62
|
},
|
|
58
63
|
checkboxProps: {
|
|
59
64
|
checked: isSelected,
|
|
60
|
-
disabled,
|
|
65
|
+
disabled: isCheckboxDisabled,
|
|
66
|
+
disabledReason: checkboxDisabledReason,
|
|
61
67
|
onChange: onSelectRow(row),
|
|
62
68
|
},
|
|
63
69
|
drawerProps: {
|
|
@@ -65,7 +71,7 @@ export const useLogic = ({ className, row, keyId, onRowClick, columns, sectionOf
|
|
|
65
71
|
onClose: handleCloseDrawer,
|
|
66
72
|
title: 'Заблокировано',
|
|
67
73
|
},
|
|
68
|
-
drawerContent:
|
|
74
|
+
drawerContent: disabledReason,
|
|
69
75
|
rowBaseVars,
|
|
70
76
|
isHovered,
|
|
71
77
|
isActive,
|
|
@@ -78,7 +84,7 @@ export const useLogic = ({ className, row, keyId, onRowClick, columns, sectionOf
|
|
|
78
84
|
onRowLeave,
|
|
79
85
|
rowId,
|
|
80
86
|
row,
|
|
81
|
-
isDisabled
|
|
87
|
+
isDisabled,
|
|
82
88
|
sectionOffset,
|
|
83
89
|
customContent,
|
|
84
90
|
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,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Checkbox } from '../../Checkbox';
|
|
3
|
+
import { Tooltip } from '../../Tooltip';
|
|
4
|
+
import { DISABLED_REASON_TOOLTIP_DELAY } from './constants';
|
|
5
|
+
/**
|
|
6
|
+
* Checkbox строки. Для заблокированного выбора показывает причину в tooltip
|
|
7
|
+
*/
|
|
8
|
+
export const RowCheckbox = ({ disabledReason, ...checkboxProps }) => {
|
|
9
|
+
if (!disabledReason) {
|
|
10
|
+
return _jsx(Checkbox, { ...checkboxProps });
|
|
11
|
+
}
|
|
12
|
+
return (_jsx(Tooltip, { title: disabledReason, enterDelay: DISABLED_REASON_TOOLTIP_DELAY, enterNextDelay: DISABLED_REASON_TOOLTIP_DELAY, withoutContainer: false, children: _jsx(Checkbox, { ...checkboxProps }) }));
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RowCheckbox';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './RowCheckbox';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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;
|
|
@@ -22,6 +22,8 @@ export const dataGridClassnames = {
|
|
|
22
22
|
rightPinnedSection: createUIKitClassname('data-grid__right-pinned-section'),
|
|
23
23
|
overflowed: createUIKitClassname('data-grid_overflowed'),
|
|
24
24
|
wrapper: createUIKitClassname('data-grid__wrapper'),
|
|
25
|
+
hasMassActions: createUIKitClassname('data-grid_has-mass-actions'),
|
|
26
|
+
massActionsOpen: createUIKitClassname('data-grid_mass-actions-open'),
|
|
25
27
|
isAllowHorizontalScroll: createUIKitClassname('data-grid_is-allow-horizontal-scroll'),
|
|
26
28
|
hasGroupedColumns: createUIKitClassname('data-grid_has-grouped-columns'),
|
|
27
29
|
gridViewFull: createUIKitClassname('data-grid_grid-view-full'),
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useWarnRowsWithoutDisabledReason';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useWarnRowsWithoutDisabledReason';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Выводит одно агрегированное предупреждение о строках с блокировкой без причины.
|
|
4
|
+
* Строки, о которых уже предупреждали, повторно не попадают в предупреждение
|
|
5
|
+
*/
|
|
6
|
+
export const useWarnRowsWithoutDisabledReason = (idsWithoutReason) => {
|
|
7
|
+
const warnedIdsRef = useRef(new Set());
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const newIds = idsWithoutReason.filter((id) => !warnedIdsRef.current.has(id));
|
|
10
|
+
if (!newIds.length) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
newIds.forEach((id) => warnedIdsRef.current.add(id));
|
|
14
|
+
// biome-ignore lint/suspicious/noConsole: Ошибка для интеграторов
|
|
15
|
+
console.warn(`UIKIT. DataGrid: getRowDisabled вернул блокировку без reason для строк: ${newIds.join(', ')}`);
|
|
16
|
+
}, [idsWithoutReason]);
|
|
17
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { DataGrid } from './DataGrid';
|
|
2
|
-
export type { DataGridProps, DataGridRenderLink, DataGridRenderLinkParams, DataGridColumns, DataGridSingleColumn, DataGridRow, DataGridRowOptions, DataGridSort, DataGridRowWithOptions, DataGridRowOptionColumns, } from './types';
|
|
2
|
+
export type { DataGridProps, DataGridRenderLink, DataGridRenderLinkParams, DataGridColumns, DataGridSingleColumn, DataGridRow, DataGridRowOptions, DataGridRowDisabled, DataGridSort, DataGridRowWithOptions, DataGridRowOptionColumns, } from './types';
|
|
3
3
|
export { dataGridClassnames } from './constants';
|
|
4
4
|
export { MobileSkeleton } from './MobileSkeleton';
|
|
5
5
|
export { RowBase, type RowBaseProps } from './RowBase';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { dataGridClassnames } from './constants';
|
|
2
2
|
export { DataGrid } from './DataGrid';
|
|
3
|
-
export type { DataGridColumns, DataGridProps, DataGridRenderLink, DataGridRenderLinkParams, DataGridRow, DataGridRowOptionColumns, DataGridRowOptions, DataGridRowWithOptions, DataGridSort, } from './types';
|
|
3
|
+
export type { DataGridColumns, DataGridProps, DataGridRenderLink, DataGridRenderLinkParams, DataGridRow, DataGridRowDisabled, DataGridRowOptionColumns, DataGridRowOptions, DataGridRowWithOptions, DataGridSort, } from './types';
|
|
@@ -13,3 +13,7 @@ export declare const DisabledDataGridWrapper: import("../styled").StyledComponen
|
|
|
13
13
|
} & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
14
14
|
theme?: import("@emotion/react").Theme | undefined;
|
|
15
15
|
}, {}, {}>;
|
|
16
|
+
export declare const MassActionsAnchor: import("../styled").StyledComponent<{
|
|
17
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
18
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
19
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -7,6 +7,9 @@ import { dataGridRowClassnames } from './Row/constants';
|
|
|
7
7
|
export const Container = styled.div `
|
|
8
8
|
--max-height: initial;
|
|
9
9
|
|
|
10
|
+
/* Место под открытой панелью массовых действий: высота панели + отступ */
|
|
11
|
+
--mass-actions-reserved-space: 96px;
|
|
12
|
+
|
|
10
13
|
position: relative;
|
|
11
14
|
|
|
12
15
|
overflow: hidden;
|
|
@@ -152,6 +155,24 @@ export const Container = styled.div `
|
|
|
152
155
|
}
|
|
153
156
|
}
|
|
154
157
|
}
|
|
158
|
+
|
|
159
|
+
&.${dataGridClassnames.hasMassActions} {
|
|
160
|
+
/* Резерв места под панель массовых действий убирается одновременно с анимацией её скрытия, чтобы строки не прыгали */
|
|
161
|
+
& .${dataGridClassnames.wrapper} .${dataGridClassnames.body},
|
|
162
|
+
& .${dataGridClassnames.pinnedSections} {
|
|
163
|
+
transition: padding-bottom
|
|
164
|
+
${({ theme }) => theme.transitions.duration.leavingScreen}ms
|
|
165
|
+
${({ theme }) => theme.transitions.easing.easeIn};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* Пока панель массовых действий открыта, последние строки не должны перекрываться ею */
|
|
169
|
+
&.${dataGridClassnames.massActionsOpen} {
|
|
170
|
+
& .${dataGridClassnames.wrapper} .${dataGridClassnames.body},
|
|
171
|
+
& .${dataGridClassnames.pinnedSections} {
|
|
172
|
+
padding-bottom: var(--mass-actions-reserved-space);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
155
176
|
`;
|
|
156
177
|
export const DataGridWrapper = styled.div `
|
|
157
178
|
position: relative;
|
|
@@ -177,3 +198,8 @@ export const DisabledDataGridWrapper = styled(DataGridWrapper) `
|
|
|
177
198
|
opacity: 0.7;
|
|
178
199
|
}
|
|
179
200
|
`;
|
|
201
|
+
export const MassActionsAnchor = styled.div `
|
|
202
|
+
position: relative;
|
|
203
|
+
|
|
204
|
+
height: 0;
|
|
205
|
+
`;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { type ReactElement, type ReactNode } from 'react';
|
|
2
|
-
import { type DataGridColumns, type DataGridRowWithOptions } from '../../types';
|
|
2
|
+
import { type DataGridColumns, type DataGridProps, type DataGridRowDisabled, type DataGridRowWithOptions } from '../../types';
|
|
3
3
|
type RenderRow = (row: Record<string, unknown>, index: number) => ReactNode;
|
|
4
4
|
type GridRenderProps = {
|
|
5
5
|
rows: DataGridRowWithOptions<DataItem>[];
|
|
6
6
|
columns: DataGridColumns<DataItem>[];
|
|
7
7
|
selectedRows?: DataItem[];
|
|
8
8
|
onSelectRow?: (rows: DataItem[]) => void;
|
|
9
|
+
getRowDisabled?: (row: DataItem) => DataGridRowDisabled | undefined;
|
|
10
|
+
tree?: DataGridProps<DataItem>['tree'];
|
|
9
11
|
renderRow?: RenderRow;
|
|
10
12
|
onRetry: () => void;
|
|
11
13
|
};
|