@linzjs/step-ag-grid 23.0.1 → 25.0.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/dist/GridTheme.scss +1 -1
- package/dist/index.css +0 -13
- package/dist/src/components/ComponentLoadingWrapper.d.ts +1 -1
- package/dist/src/components/Grid.d.ts +17 -17
- package/dist/src/components/GridCell.d.ts +9 -9
- package/dist/src/components/GridCellFiller.d.ts +2 -2
- package/dist/src/components/GridCellMultiEditor.d.ts +6 -6
- package/dist/src/components/GridCellMultiSelectClassRules.d.ts +1 -1
- package/dist/src/components/GridIcon.d.ts +2 -2
- package/dist/src/components/GridNoRowsOverlay.d.ts +1 -1
- package/dist/src/components/GridPopoverHook.d.ts +2 -2
- package/dist/src/components/GridWrapper.d.ts +1 -1
- package/dist/src/components/PostSortRowsHook.d.ts +1 -1
- package/dist/src/components/clickInputWhenContainingCellClicked.d.ts +1 -1
- package/dist/src/components/gridFilter/GridFilterButtons.d.ts +5 -5
- package/dist/src/components/gridFilter/GridFilterColumnsToggle.d.ts +1 -1
- package/dist/src/components/gridFilter/GridFilterDownloadCsvButton.d.ts +1 -1
- package/dist/src/components/gridFilter/GridFilterHeaderIconButton.d.ts +2 -2
- package/dist/src/components/gridFilter/GridFilters.d.ts +1 -1
- package/dist/src/components/gridFilter/index.d.ts +7 -7
- package/dist/src/components/gridFilter/useGridFilter.d.ts +2 -2
- package/dist/src/components/gridForm/GridFormDropDown.d.ts +8 -8
- package/dist/src/components/gridForm/GridFormEditBearing.d.ts +2 -2
- package/dist/src/components/gridForm/GridFormMessage.d.ts +3 -3
- package/dist/src/components/gridForm/GridFormMultiSelect.d.ts +4 -4
- package/dist/src/components/gridForm/GridFormMultiSelectGrid.d.ts +4 -4
- package/dist/src/components/gridForm/GridFormPopoverMenu.d.ts +5 -5
- package/dist/src/components/gridForm/GridFormSubComponentTextArea.d.ts +4 -4
- package/dist/src/components/gridForm/GridFormSubComponentTextInput.d.ts +4 -4
- package/dist/src/components/gridForm/GridFormTextArea.d.ts +4 -4
- package/dist/src/components/gridForm/GridFormTextInput.d.ts +3 -3
- package/dist/src/components/gridForm/index.d.ts +10 -10
- package/dist/src/components/gridHeader/GridHeaderSelect.d.ts +1 -1
- package/dist/src/components/gridHeader/index.d.ts +1 -1
- package/dist/src/components/gridHook/index.d.ts +1 -1
- package/dist/src/components/gridHook/useGridContextMenu.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridButton.d.ts +5 -5
- package/dist/src/components/gridPopoverEdit/GridEditBoolean.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoutEditMultiSelect.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoutEditMultiSelectGrid.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoverEditBearing.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoverEditDropDown.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoverMenu.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoverMessage.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoverTextArea.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/GridPopoverTextInput.d.ts +4 -4
- package/dist/src/components/gridPopoverEdit/index.d.ts +11 -11
- package/dist/src/components/gridRender/GridRenderGenericCell.d.ts +5 -5
- package/dist/src/components/gridRender/GridRenderPopoutMenuCell.d.ts +1 -1
- package/dist/src/components/gridRender/index.d.ts +2 -2
- package/dist/src/components/gridUtil.d.ts +1 -1
- package/dist/src/components/index.d.ts +19 -19
- package/dist/src/contexts/GridContext.d.ts +4 -4
- package/dist/src/contexts/GridContextProvider.d.ts +3 -3
- package/dist/src/contexts/GridPopoverContext.d.ts +3 -3
- package/dist/src/contexts/GridPopoverContextProvider.d.ts +4 -4
- package/dist/src/contexts/GridUpdatingContextProvider.d.ts +1 -1
- package/dist/src/index.d.ts +19 -17
- package/dist/src/lui/ActionButton.d.ts +9 -9
- package/dist/src/lui/FormError.d.ts +2 -2
- package/dist/src/lui/TextAreaInput.d.ts +1 -1
- package/dist/src/lui/TextInputFormatted.d.ts +2 -2
- package/dist/src/lui/reactUtils.d.ts +1 -1
- package/dist/src/lui/stateDeferredHook.d.ts +1 -1
- package/dist/src/react-menu3/components/ControlledMenu.d.ts +2 -2
- package/dist/src/react-menu3/components/FocusableItem.d.ts +3 -3
- package/dist/src/react-menu3/components/Menu.d.ts +3 -3
- package/dist/src/react-menu3/components/MenuButton.d.ts +2 -2
- package/dist/src/react-menu3/components/MenuDivider.d.ts +1 -1
- package/dist/src/react-menu3/components/MenuGroup.d.ts +2 -2
- package/dist/src/react-menu3/components/MenuHeader.d.ts +2 -2
- package/dist/src/react-menu3/components/MenuItem.d.ts +3 -3
- package/dist/src/react-menu3/components/MenuList.d.ts +1 -1
- package/dist/src/react-menu3/components/MenuRadioGroup.d.ts +2 -2
- package/dist/src/react-menu3/components/SubMenu.d.ts +5 -5
- package/dist/src/react-menu3/contexts/EventHandlersContext.d.ts +1 -1
- package/dist/src/react-menu3/contexts/MenuListContext.d.ts +2 -2
- package/dist/src/react-menu3/contexts/MenuListItemContext.d.ts +1 -1
- package/dist/src/react-menu3/contexts/RadioGroupContext.d.ts +1 -1
- package/dist/src/react-menu3/contexts/SettingsContext.d.ts +2 -2
- package/dist/src/react-menu3/hooks/index.d.ts +9 -9
- package/dist/src/react-menu3/hooks/useBEM.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useCombinedRef.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useIsomorphicLayoutEffect.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useItemEffect.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useItemState.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useItems.d.ts +2 -2
- package/dist/src/react-menu3/hooks/useMenuChange.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useMenuState.d.ts +1 -1
- package/dist/src/react-menu3/hooks/useMenuStateAndFocus.d.ts +1 -1
- package/dist/src/react-menu3/index.d.ts +11 -11
- package/dist/src/react-menu3/positionUtils/getPositionHelpers.d.ts +1 -1
- package/dist/src/react-menu3/positionUtils/index.d.ts +3 -3
- package/dist/src/react-menu3/positionUtils/placeArrowHorizontal.d.ts +1 -1
- package/dist/src/react-menu3/positionUtils/placeArrowVertical.d.ts +1 -1
- package/dist/src/react-menu3/positionUtils/placeLeftorRight.d.ts +4 -4
- package/dist/src/react-menu3/positionUtils/placeToporBottom.d.ts +5 -5
- package/dist/src/react-menu3/positionUtils/positionContextMenu.d.ts +2 -2
- package/dist/src/react-menu3/positionUtils/positionMenu.d.ts +5 -5
- package/dist/src/react-menu3/style-utils/index.d.ts +1 -1
- package/dist/src/react-menu3/types.d.ts +15 -15
- package/dist/src/react-menu3/utils/constants.d.ts +1 -1
- package/dist/src/react-menu3/utils/index.d.ts +3 -3
- package/dist/src/react-menu3/utils/utils.d.ts +5 -5
- package/dist/src/react-menu3/utils/withHovering.d.ts +1 -1
- package/{src/utils → dist/src/utils/__tests__}/storybookTestUtil.ts +2 -2
- package/{src/utils → dist/src/utils/__tests__}/testQuick.ts +15 -14
- package/{src/utils → dist/src/utils/__tests__}/testUtil.ts +31 -36
- package/dist/src/utils/__tests__/vitestUtil.ts +295 -0
- package/dist/src/utils/textValidator.d.ts +2 -2
- package/dist/{step-ag-grid.cjs.js → step-ag-grid.cjs} +969 -955
- package/dist/step-ag-grid.cjs.map +1 -0
- package/dist/step-ag-grid.esm.js +970 -958
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/dist/vite.config.d.ts +1 -1
- package/package.json +38 -57
- package/src/components/ComponentLoadingWrapper.tsx +5 -6
- package/src/components/Grid.tsx +85 -83
- package/src/components/GridCell.test.tsx +17 -15
- package/src/components/GridCell.tsx +46 -44
- package/src/components/GridCellFiller.tsx +5 -4
- package/src/components/GridCellMultiEditor.tsx +7 -7
- package/src/components/GridCellMultiSelectClassRules.tsx +3 -3
- package/src/components/GridIcon.tsx +6 -7
- package/src/components/GridLoadableCell.tsx +2 -2
- package/src/components/GridNoRowsOverlay.tsx +8 -8
- package/src/components/GridPopoverHook.tsx +16 -16
- package/src/components/GridWrapper.tsx +2 -2
- package/src/components/PostSortRowsHook.ts +11 -11
- package/src/components/clickInputWhenContainingCellClicked.tsx +5 -5
- package/src/components/gridFilter/GridFilterButtons.tsx +8 -9
- package/src/components/gridFilter/GridFilterColumnsToggle.tsx +25 -26
- package/src/components/gridFilter/GridFilterDownloadCsvButton.tsx +12 -13
- package/src/components/gridFilter/GridFilterHeaderIconButton.tsx +9 -10
- package/src/components/gridFilter/GridFilterQuick.tsx +6 -6
- package/src/components/gridFilter/GridFilters.tsx +1 -1
- package/src/components/gridFilter/index.ts +7 -7
- package/src/components/gridFilter/useGridFilter.ts +3 -3
- package/src/components/gridForm/GridFormDropDown.tsx +56 -52
- package/src/components/gridForm/GridFormEditBearing.tsx +12 -12
- package/src/components/gridForm/GridFormMessage.tsx +10 -10
- package/src/components/gridForm/GridFormMultiSelect.tsx +53 -51
- package/src/components/gridForm/GridFormMultiSelectGrid.tsx +25 -26
- package/src/components/gridForm/GridFormPopoverMenu.tsx +32 -29
- package/src/components/gridForm/GridFormSubComponentTextArea.tsx +10 -10
- package/src/components/gridForm/GridFormSubComponentTextInput.tsx +8 -8
- package/src/components/gridForm/GridFormTextArea.tsx +11 -11
- package/src/components/gridForm/GridFormTextInput.tsx +11 -11
- package/src/components/gridForm/index.ts +10 -10
- package/src/components/gridHeader/GridHeaderSelect.tsx +9 -9
- package/src/components/gridHeader/index.ts +1 -1
- package/src/components/gridHook/index.ts +1 -1
- package/src/components/gridHook/useGridContextMenu.tsx +7 -7
- package/src/components/gridPopoverEdit/GridButton.tsx +13 -12
- package/src/components/gridPopoverEdit/GridEditBoolean.tsx +19 -18
- package/src/components/gridPopoverEdit/GridPopoutEditMultiSelect.ts +7 -6
- package/src/components/gridPopoverEdit/GridPopoutEditMultiSelectGrid.ts +7 -6
- package/src/components/gridPopoverEdit/GridPopoverEditBearing.ts +9 -9
- package/src/components/gridPopoverEdit/GridPopoverEditDropDown.ts +8 -7
- package/src/components/gridPopoverEdit/GridPopoverMenu.tsx +6 -6
- package/src/components/gridPopoverEdit/GridPopoverMessage.ts +4 -4
- package/src/components/gridPopoverEdit/GridPopoverTextArea.ts +4 -4
- package/src/components/gridPopoverEdit/GridPopoverTextInput.ts +4 -4
- package/src/components/gridPopoverEdit/index.ts +11 -11
- package/src/components/gridRender/GridRenderGenericCell.tsx +5 -5
- package/src/components/gridRender/GridRenderPopoutMenuCell.tsx +8 -9
- package/src/components/gridRender/index.ts +2 -2
- package/src/components/gridUtil.ts +3 -3
- package/src/components/index.ts +19 -19
- package/src/contexts/GridContext.tsx +52 -46
- package/src/contexts/GridContextProvider.test.tsx +15 -14
- package/src/contexts/GridContextProvider.tsx +42 -42
- package/src/contexts/GridPopoverContext.tsx +10 -7
- package/src/contexts/GridPopoverContextProvider.tsx +12 -10
- package/src/contexts/GridSubComponentContext.ts +6 -5
- package/src/contexts/GridUpdatingContext.tsx +5 -4
- package/src/contexts/GridUpdatingContextProvider.tsx +3 -3
- package/src/index.ts +19 -21
- package/src/lui/ActionButton.scss +2 -2
- package/src/lui/ActionButton.tsx +42 -41
- package/src/lui/FormError.scss +3 -4
- package/src/lui/FormError.tsx +4 -4
- package/src/lui/TextAreaInput.tsx +9 -9
- package/src/lui/TextInputFormatted.scss +1 -1
- package/src/lui/TextInputFormatted.tsx +11 -11
- package/src/lui/reactUtils.test.tsx +9 -8
- package/src/lui/reactUtils.tsx +2 -2
- package/src/lui/stateDeferredHook.tsx +3 -5
- package/src/lui/timeoutHook.test.tsx +12 -11
- package/src/lui/timeoutHook.tsx +1 -1
- package/src/react-app-env.d.ts +1 -1
- package/src/react-menu3/components/ControlledMenu.tsx +48 -48
- package/src/react-menu3/components/FocusableItem.tsx +7 -7
- package/src/react-menu3/components/Menu.tsx +11 -11
- package/src/react-menu3/components/MenuButton.tsx +4 -4
- package/src/react-menu3/components/MenuDivider.tsx +4 -4
- package/src/react-menu3/components/MenuGroup.tsx +5 -5
- package/src/react-menu3/components/MenuHeader.tsx +4 -4
- package/src/react-menu3/components/MenuItem.tsx +14 -14
- package/src/react-menu3/components/MenuList.tsx +55 -55
- package/src/react-menu3/components/MenuRadioGroup.tsx +7 -7
- package/src/react-menu3/components/SubMenu.tsx +24 -24
- package/src/react-menu3/contexts/EventHandlersContext.ts +2 -2
- package/src/react-menu3/contexts/HoverItemContext.ts +1 -1
- package/src/react-menu3/contexts/ItemSettingsContext.ts +1 -1
- package/src/react-menu3/contexts/MenuListContext.ts +2 -2
- package/src/react-menu3/contexts/MenuListItemContext.ts +2 -2
- package/src/react-menu3/contexts/RadioGroupContext.ts +2 -2
- package/src/react-menu3/contexts/SettingsContext.ts +2 -2
- package/src/react-menu3/hooks/index.ts +9 -9
- package/src/react-menu3/hooks/useBEM.ts +4 -4
- package/src/react-menu3/hooks/useCombinedRef.ts +2 -2
- package/src/react-menu3/hooks/useIsomorphicLayoutEffect.ts +4 -4
- package/src/react-menu3/hooks/useItemEffect.ts +3 -3
- package/src/react-menu3/hooks/useItemState.ts +5 -5
- package/src/react-menu3/hooks/useItems.ts +8 -8
- package/src/react-menu3/hooks/useMenuChange.ts +3 -3
- package/src/react-menu3/hooks/useMenuState.ts +5 -5
- package/src/react-menu3/hooks/useMenuStateAndFocus.ts +4 -4
- package/src/react-menu3/index.ts +11 -11
- package/src/react-menu3/positionUtils/getPositionHelpers.ts +2 -2
- package/src/react-menu3/positionUtils/index.ts +3 -3
- package/src/react-menu3/positionUtils/placeArrowHorizontal.ts +1 -1
- package/src/react-menu3/positionUtils/placeArrowVertical.ts +1 -1
- package/src/react-menu3/positionUtils/placeLeftorRight.ts +13 -13
- package/src/react-menu3/positionUtils/placeToporBottom.ts +15 -15
- package/src/react-menu3/positionUtils/positionContextMenu.ts +4 -4
- package/src/react-menu3/positionUtils/positionMenu.ts +14 -14
- package/src/react-menu3/style-utils/index.ts +24 -24
- package/src/react-menu3/types.ts +15 -15
- package/src/react-menu3/utils/constants.ts +33 -33
- package/src/react-menu3/utils/index.ts +3 -4
- package/src/react-menu3/utils/propTypes2.ts +10 -10
- package/src/react-menu3/utils/utils.ts +14 -14
- package/src/react-menu3/utils/withHovering.tsx +3 -3
- package/src/stories/components/ActionButton.stories.tsx +23 -24
- package/src/stories/grid/FormTest.tsx +15 -16
- package/src/stories/grid/GridDragRow.stories.tsx +33 -34
- package/src/stories/grid/GridFilterButtons.stories.tsx +32 -33
- package/src/stories/grid/GridNoRowsOverlay.stories.tsx +9 -10
- package/src/stories/grid/GridNonEditableRow.stories.tsx +40 -41
- package/src/stories/grid/GridPinnedRow.stories.tsx +25 -26
- package/src/stories/grid/GridPopoutContextMenu.stories.tsx +33 -32
- package/src/stories/grid/GridPopoutEditBoolean.stories.tsx +21 -22
- package/src/stories/grid/GridPopoutEditGeneric.stories.tsx +18 -19
- package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +50 -49
- package/src/stories/grid/GridPopoverEditBearing.stories.tsx +25 -26
- package/src/stories/grid/GridPopoverEditDropDown.stories.tsx +93 -94
- package/src/stories/grid/GridPopoverEditMultiSelect.stories.tsx +62 -63
- package/src/stories/grid/GridPopoverEditMultiSelectGrid.stories.tsx +28 -28
- package/src/stories/grid/GridReadOnly.stories.tsx +66 -67
- package/src/stories/grid/GridViewList.stories.tsx +37 -38
- package/src/stories/grid/gridFormInteraction/GridFormDropDownInteraction.stories.tsx +37 -38
- package/src/stories/grid/gridFormInteraction/GridFormEditBearingCorrectionInteraction.stories.tsx +25 -26
- package/src/stories/grid/gridFormInteraction/GridFormEditBearingInteraction.stories.tsx +25 -26
- package/src/stories/grid/gridFormInteraction/GridFormMultiSelectGridInteraction.stories.tsx +31 -31
- package/src/stories/grid/gridFormInteraction/GridFormMultiSelectInteraction.stories.tsx +47 -48
- package/src/stories/grid/gridFormInteraction/GridFormPopoverMenuInteraction.stories.tsx +44 -45
- package/src/stories/grid/gridFormInteraction/GridFormTextAreaInteraction.stories.tsx +19 -20
- package/src/stories/grid/gridFormInteraction/GridFormTextInputInteraction.stories.tsx +21 -22
- package/src/stories/grid/gridFormStatic/GridFormDropDown.stories.tsx +40 -41
- package/src/stories/grid/gridFormStatic/GridFormEditBearing.stories.tsx +14 -15
- package/src/stories/grid/gridFormStatic/GridFormEditBearingCorrection.stories.tsx +14 -15
- package/src/stories/grid/gridFormStatic/GridFormMessage.stories.tsx +10 -11
- package/src/stories/grid/gridFormStatic/GridFormMultiSelect.stories.tsx +20 -21
- package/src/stories/grid/gridFormStatic/GridFormPopoverMenu.stories.tsx +16 -17
- package/src/stories/grid/gridFormStatic/GridFormTextArea.stories.tsx +13 -14
- package/src/stories/grid/gridFormStatic/GridFormTextInput.stories.tsx +13 -14
- package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +68 -71
- package/src/stories/react-menu/ReactMenu.stories.tsx +26 -26
- package/src/styles/Grid.scss +9 -9
- package/src/styles/GridIcon.scss +6 -6
- package/src/styles/GridPopoverMenu.scss +3 -3
- package/src/styles/GridTheme.scss +1 -1
- package/src/styles/react-menu-customisations.scss +26 -41
- package/src/utils/__tests__/storybookTestUtil.ts +4 -0
- package/src/utils/__tests__/testQuick.ts +157 -0
- package/src/utils/__tests__/testUtil.ts +294 -0
- package/src/utils/__tests__/vitestUtil.ts +295 -0
- package/src/utils/bearing.test.ts +47 -45
- package/src/utils/bearing.ts +20 -20
- package/src/utils/deferredPromise.ts +1 -1
- package/src/utils/textMatcher.test.ts +10 -9
- package/src/utils/textMatcher.ts +8 -8
- package/src/utils/textValidator.test.ts +61 -62
- package/src/utils/textValidator.ts +11 -11
- package/src/utils/util.test.ts +21 -20
- package/src/utils/util.ts +7 -7
- package/dist/src/utils/storybookTestUtil.d.ts +0 -3
- package/dist/src/utils/testQuick.d.ts +0 -62
- package/dist/src/utils/testUtil.d.ts +0 -46
- package/dist/step-ag-grid.cjs.js.map +0 -1
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import '../../styles/GridTheme.scss';
|
|
2
|
+
import '../../styles/index.scss';
|
|
3
|
+
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
+
import '@linzjs/lui/dist/fonts';
|
|
4
5
|
|
|
5
|
-
import { Meta, StoryFn } from
|
|
6
|
-
import { useCallback, useMemo, useState } from
|
|
7
|
-
|
|
8
|
-
import "@linzjs/lui/dist/fonts";
|
|
6
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
7
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
9
8
|
|
|
10
9
|
import {
|
|
11
10
|
ColDefT,
|
|
@@ -27,14 +26,14 @@ import {
|
|
|
27
26
|
MenuSeparator,
|
|
28
27
|
MenuSeparatorString,
|
|
29
28
|
wait,
|
|
30
|
-
} from
|
|
31
|
-
import { waitForGridReady } from
|
|
29
|
+
} from '../..';
|
|
30
|
+
import { waitForGridReady } from '../../utils/__tests__/storybookTestUtil';
|
|
32
31
|
|
|
33
32
|
export default {
|
|
34
|
-
title:
|
|
33
|
+
title: 'Components / Grids',
|
|
35
34
|
component: Grid,
|
|
36
35
|
args: {
|
|
37
|
-
quickFilterValue:
|
|
36
|
+
quickFilterValue: '',
|
|
38
37
|
selectable: true,
|
|
39
38
|
},
|
|
40
39
|
decorators: [
|
|
@@ -70,25 +69,25 @@ const GridEditDropDownTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
70
69
|
|
|
71
70
|
const optionsFn = useCallback(async (selectedRows: ITestRow[], filter?: string) => {
|
|
72
71
|
// eslint-disable-next-line no-console
|
|
73
|
-
console.log(
|
|
72
|
+
console.log('optionsFn selected rows', selectedRows, filter);
|
|
74
73
|
filter = filter?.toLowerCase();
|
|
75
74
|
await wait(1000);
|
|
76
75
|
return [
|
|
77
76
|
null,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
'Architect',
|
|
78
|
+
'Developer',
|
|
79
|
+
'Product Owner',
|
|
80
|
+
'Scrum Master',
|
|
81
|
+
'Tester',
|
|
83
82
|
MenuSeparatorString,
|
|
84
|
-
|
|
83
|
+
'Custom',
|
|
85
84
|
].filter((v) => (filter != null ? v != null && v.toLowerCase().indexOf(filter) === 0 : true));
|
|
86
85
|
}, []);
|
|
87
86
|
|
|
88
87
|
const optionsObjects = useMemo(
|
|
89
88
|
() => [
|
|
90
|
-
{ code:
|
|
91
|
-
{ code:
|
|
89
|
+
{ code: 'O1', desc: 'Object One' },
|
|
90
|
+
{ code: 'O2', desc: 'Object Two' },
|
|
92
91
|
],
|
|
93
92
|
[],
|
|
94
93
|
);
|
|
@@ -96,40 +95,40 @@ const GridEditDropDownTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
96
95
|
const columnDefs: ColDefT<ITestRow>[] = useMemo(
|
|
97
96
|
() => [
|
|
98
97
|
GridCell({
|
|
99
|
-
field:
|
|
100
|
-
headerName:
|
|
98
|
+
field: 'id',
|
|
99
|
+
headerName: 'Id',
|
|
101
100
|
}),
|
|
102
|
-
GridPopoverEditDropDown<ITestRow, ITestRow[
|
|
101
|
+
GridPopoverEditDropDown<ITestRow, ITestRow['position2']>(
|
|
103
102
|
{
|
|
104
|
-
field:
|
|
105
|
-
headerName:
|
|
103
|
+
field: 'position2',
|
|
104
|
+
headerName: 'Multi-edit',
|
|
106
105
|
},
|
|
107
106
|
{
|
|
108
107
|
multiEdit: true,
|
|
109
108
|
editorParams: {
|
|
110
109
|
options: [
|
|
111
|
-
MenuHeaderItem(
|
|
110
|
+
MenuHeaderItem('Header'),
|
|
112
111
|
{
|
|
113
|
-
value:
|
|
114
|
-
label:
|
|
115
|
-
disabled:
|
|
112
|
+
value: '1',
|
|
113
|
+
label: 'One',
|
|
114
|
+
disabled: 'Disabled for test',
|
|
116
115
|
},
|
|
117
|
-
{ value:
|
|
116
|
+
{ value: '2', label: 'Two' },
|
|
118
117
|
MenuSeparator,
|
|
119
|
-
{ value:
|
|
118
|
+
{ value: '3', label: 'Three' },
|
|
120
119
|
],
|
|
121
120
|
},
|
|
122
121
|
},
|
|
123
122
|
),
|
|
124
123
|
GridPopoverEditDropDown(
|
|
125
124
|
{
|
|
126
|
-
field:
|
|
127
|
-
headerName:
|
|
125
|
+
field: 'position3',
|
|
126
|
+
headerName: 'Custom callback',
|
|
128
127
|
},
|
|
129
128
|
{
|
|
130
129
|
multiEdit: true,
|
|
131
130
|
editorParams: {
|
|
132
|
-
options: [null,
|
|
131
|
+
options: [null, 'Architect', 'Developer', 'Product Owner', 'Scrum Master', 'Tester'],
|
|
133
132
|
onSelectedItem: async (selected) => {
|
|
134
133
|
await wait(2000);
|
|
135
134
|
selected.selectedRows.forEach((row) => {
|
|
@@ -141,45 +140,45 @@ const GridEditDropDownTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
141
140
|
),
|
|
142
141
|
GridPopoverEditDropDown(
|
|
143
142
|
{
|
|
144
|
-
field:
|
|
145
|
-
headerName:
|
|
143
|
+
field: 'position',
|
|
144
|
+
headerName: 'Options Fn',
|
|
146
145
|
},
|
|
147
146
|
{
|
|
148
147
|
multiEdit: false,
|
|
149
148
|
editorParams: {
|
|
150
|
-
filtered:
|
|
151
|
-
filterPlaceholder:
|
|
149
|
+
filtered: 'reload',
|
|
150
|
+
filterPlaceholder: 'Search me...',
|
|
152
151
|
options: optionsFn,
|
|
153
152
|
},
|
|
154
153
|
},
|
|
155
154
|
),
|
|
156
155
|
GridPopoverEditDropDown(
|
|
157
156
|
{
|
|
158
|
-
colId:
|
|
159
|
-
field:
|
|
160
|
-
headerName:
|
|
157
|
+
colId: 'position3filtered',
|
|
158
|
+
field: 'position3',
|
|
159
|
+
headerName: 'Filtered',
|
|
161
160
|
editable: false,
|
|
162
161
|
},
|
|
163
162
|
{
|
|
164
163
|
multiEdit: true,
|
|
165
164
|
editorParams: {
|
|
166
|
-
filtered:
|
|
167
|
-
filterPlaceholder:
|
|
168
|
-
options: [null,
|
|
165
|
+
filtered: 'local',
|
|
166
|
+
filterPlaceholder: 'Filter this',
|
|
167
|
+
options: [null, 'Architect', 'Developer', 'Product Owner', 'Scrum Master', 'Tester'],
|
|
169
168
|
},
|
|
170
169
|
},
|
|
171
170
|
),
|
|
172
171
|
GridPopoverEditDropDown(
|
|
173
172
|
{
|
|
174
|
-
colId:
|
|
175
|
-
headerName:
|
|
173
|
+
colId: 'position4',
|
|
174
|
+
headerName: 'Filtered (object)',
|
|
176
175
|
valueGetter: ({ data }) => data?.position4?.desc,
|
|
177
176
|
},
|
|
178
177
|
{
|
|
179
178
|
multiEdit: true,
|
|
180
179
|
editorParams: {
|
|
181
|
-
filtered:
|
|
182
|
-
filterPlaceholder:
|
|
180
|
+
filtered: 'local',
|
|
181
|
+
filterPlaceholder: 'Filter this',
|
|
183
182
|
options: optionsObjects.map((o) => {
|
|
184
183
|
return { value: o, label: o.desc, disabled: false };
|
|
185
184
|
}),
|
|
@@ -188,26 +187,26 @@ const GridEditDropDownTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
188
187
|
),
|
|
189
188
|
GridPopoverEditDropDown(
|
|
190
189
|
{
|
|
191
|
-
field:
|
|
192
|
-
headerName:
|
|
190
|
+
field: 'code',
|
|
191
|
+
headerName: 'Filter Selectable',
|
|
193
192
|
},
|
|
194
193
|
{
|
|
195
194
|
multiEdit: true,
|
|
196
195
|
editorParams: {
|
|
197
|
-
filtered:
|
|
198
|
-
filterPlaceholder:
|
|
199
|
-
filterHelpText:
|
|
196
|
+
filtered: 'local',
|
|
197
|
+
filterPlaceholder: 'Filter this',
|
|
198
|
+
filterHelpText: 'Press enter to save custom value',
|
|
200
199
|
options: optionsObjects.map((o) => {
|
|
201
200
|
return { value: o, label: o.desc, disabled: false };
|
|
202
201
|
}),
|
|
203
|
-
onSelectedItem:
|
|
202
|
+
onSelectedItem: (selected) => {
|
|
204
203
|
// eslint-disable-next-line no-console
|
|
205
|
-
console.log(
|
|
204
|
+
console.log('onSelectedItem selected', selected);
|
|
206
205
|
selected.selectedRows.forEach((row) => (row.code = selected.value.code));
|
|
207
206
|
},
|
|
208
|
-
onSelectFilter:
|
|
207
|
+
onSelectFilter: (selected) => {
|
|
209
208
|
// eslint-disable-next-line no-console
|
|
210
|
-
console.log(
|
|
209
|
+
console.log('onSelectFilter selected', selected);
|
|
211
210
|
selected.selectedRows.forEach((row) => (row.code = selected.value));
|
|
212
211
|
},
|
|
213
212
|
},
|
|
@@ -215,44 +214,44 @@ const GridEditDropDownTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
215
214
|
),
|
|
216
215
|
GridPopoverEditDropDown(
|
|
217
216
|
{
|
|
218
|
-
field:
|
|
219
|
-
headerName:
|
|
217
|
+
field: 'sub',
|
|
218
|
+
headerName: 'Subcomponent',
|
|
220
219
|
valueGetter: ({ data }) => data?.sub,
|
|
221
220
|
},
|
|
222
221
|
{
|
|
223
222
|
multiEdit: true,
|
|
224
223
|
editorParams: {
|
|
225
|
-
filtered:
|
|
226
|
-
filterPlaceholder:
|
|
224
|
+
filtered: 'local',
|
|
225
|
+
filterPlaceholder: 'Filter this',
|
|
227
226
|
options: () => {
|
|
228
227
|
return [
|
|
229
228
|
{
|
|
230
|
-
value:
|
|
231
|
-
label:
|
|
229
|
+
value: 'one',
|
|
230
|
+
label: 'One',
|
|
232
231
|
},
|
|
233
232
|
{
|
|
234
|
-
value:
|
|
235
|
-
label:
|
|
233
|
+
value: 'two',
|
|
234
|
+
label: 'Two',
|
|
236
235
|
},
|
|
237
236
|
{
|
|
238
|
-
value:
|
|
239
|
-
label:
|
|
237
|
+
value: 'oth',
|
|
238
|
+
label: 'Other text input',
|
|
240
239
|
subComponent: () => (
|
|
241
|
-
<GridFormSubComponentTextInput placeholder={
|
|
240
|
+
<GridFormSubComponentTextInput placeholder={'Other...'} defaultValue={'a'} required={true} />
|
|
242
241
|
),
|
|
243
242
|
},
|
|
244
243
|
{
|
|
245
|
-
value:
|
|
246
|
-
label:
|
|
244
|
+
value: 'oth',
|
|
245
|
+
label: 'Other text area',
|
|
247
246
|
subComponent: () => (
|
|
248
|
-
<GridFormSubComponentTextArea placeholder={
|
|
247
|
+
<GridFormSubComponentTextArea placeholder={'Other...'} defaultValue={'b'} required={true} />
|
|
249
248
|
),
|
|
250
249
|
},
|
|
251
250
|
];
|
|
252
251
|
},
|
|
253
252
|
onSelectedItem: async (selected) => {
|
|
254
253
|
// eslint-disable-next-line no-console
|
|
255
|
-
console.log(
|
|
254
|
+
console.log('onSelectedItem', selected);
|
|
256
255
|
await wait(500);
|
|
257
256
|
selected.selectedRows.forEach((row) => (row.sub = selected.subComponentValue ?? selected.value));
|
|
258
257
|
},
|
|
@@ -263,7 +262,7 @@ const GridEditDropDownTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
263
262
|
{},
|
|
264
263
|
{
|
|
265
264
|
editorParams: {
|
|
266
|
-
options:
|
|
265
|
+
options: () => [{ label: 'Hello', action: async () => {} }],
|
|
267
266
|
},
|
|
268
267
|
},
|
|
269
268
|
),
|
|
@@ -274,30 +273,30 @@ const GridEditDropDownTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
274
273
|
const [rowData] = useState([
|
|
275
274
|
{
|
|
276
275
|
id: 1000,
|
|
277
|
-
position:
|
|
278
|
-
position2:
|
|
279
|
-
position3:
|
|
280
|
-
position4: { code:
|
|
281
|
-
code:
|
|
282
|
-
sub:
|
|
276
|
+
position: 'Tester',
|
|
277
|
+
position2: '1',
|
|
278
|
+
position3: 'Tester',
|
|
279
|
+
position4: { code: 'O1', desc: 'Object One' },
|
|
280
|
+
code: 'O1',
|
|
281
|
+
sub: 'two',
|
|
283
282
|
},
|
|
284
283
|
{
|
|
285
284
|
id: 1001,
|
|
286
|
-
position:
|
|
287
|
-
position2:
|
|
288
|
-
position3:
|
|
289
|
-
position4: { code:
|
|
290
|
-
code:
|
|
291
|
-
sub:
|
|
285
|
+
position: 'Developer',
|
|
286
|
+
position2: '2',
|
|
287
|
+
position3: 'Developer',
|
|
288
|
+
position4: { code: 'O2', desc: 'Object Two' },
|
|
289
|
+
code: 'O2',
|
|
290
|
+
sub: 'one',
|
|
292
291
|
},
|
|
293
292
|
{
|
|
294
293
|
id: 1002,
|
|
295
|
-
position:
|
|
296
|
-
position2:
|
|
297
|
-
position3:
|
|
298
|
-
position4: { code:
|
|
299
|
-
code:
|
|
300
|
-
sub:
|
|
294
|
+
position: 'Scrum Master',
|
|
295
|
+
position2: '2',
|
|
296
|
+
position3: 'Architect',
|
|
297
|
+
position4: { code: 'O2', desc: 'Object Two' },
|
|
298
|
+
code: 'O2',
|
|
299
|
+
sub: 'one',
|
|
301
300
|
},
|
|
302
301
|
] as ITestRow[]);
|
|
303
302
|
|
|
@@ -306,7 +305,7 @@ const GridEditDropDownTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
306
305
|
<GridFilters>
|
|
307
306
|
<GridFilterQuick />
|
|
308
307
|
<GridFilterColumnsToggle />
|
|
309
|
-
<GridFilterDownloadCsvButton fileName={
|
|
308
|
+
<GridFilterDownloadCsvButton fileName={'customFilename'} />
|
|
310
309
|
</GridFilters>
|
|
311
310
|
<Grid
|
|
312
311
|
{...props}
|
|
@@ -314,10 +313,10 @@ const GridEditDropDownTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
314
313
|
setExternalSelectedItems={setExternalSelectedItems}
|
|
315
314
|
columnDefs={columnDefs}
|
|
316
315
|
rowData={rowData}
|
|
317
|
-
domLayout={
|
|
316
|
+
domLayout={'autoHeight'}
|
|
318
317
|
onCellEditingComplete={() => {
|
|
319
318
|
/* eslint-disable-next-line no-console */
|
|
320
|
-
console.log(
|
|
319
|
+
console.log('Cell editing complete');
|
|
321
320
|
}}
|
|
322
321
|
/>
|
|
323
322
|
</GridWrapper>
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import '../../styles/GridTheme.scss';
|
|
2
|
+
import '../../styles/index.scss';
|
|
3
|
+
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
+
import '@linzjs/lui/dist/fonts';
|
|
4
5
|
|
|
5
|
-
import { Meta, StoryFn } from
|
|
6
|
-
import { isEmpty, partition } from
|
|
7
|
-
import { useMemo, useState } from
|
|
8
|
-
|
|
9
|
-
import "@linzjs/lui/dist/fonts";
|
|
6
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
7
|
+
import { isEmpty, partition } from 'lodash-es';
|
|
8
|
+
import { useMemo, useState } from 'react';
|
|
10
9
|
|
|
11
10
|
import {
|
|
12
11
|
ColDefT,
|
|
@@ -20,14 +19,14 @@ import {
|
|
|
20
19
|
MenuSeparator,
|
|
21
20
|
MultiSelectOption,
|
|
22
21
|
wait,
|
|
23
|
-
} from
|
|
24
|
-
import { waitForGridReady } from
|
|
22
|
+
} from '../..';
|
|
23
|
+
import { waitForGridReady } from '../../utils/__tests__/storybookTestUtil';
|
|
25
24
|
|
|
26
25
|
export default {
|
|
27
|
-
title:
|
|
26
|
+
title: 'Components / Grids',
|
|
28
27
|
component: Grid,
|
|
29
28
|
args: {
|
|
30
|
-
quickFilterValue:
|
|
29
|
+
quickFilterValue: '',
|
|
31
30
|
selectable: true,
|
|
32
31
|
},
|
|
33
32
|
decorators: [
|
|
@@ -55,56 +54,56 @@ const GridEditMultiSelectTemplate: StoryFn<typeof Grid> = (props: GridProps) =>
|
|
|
55
54
|
|
|
56
55
|
const columnDefs: ColDefT<ITestRow>[] = useMemo(() => {
|
|
57
56
|
const positionMap: Record<string, string> = {
|
|
58
|
-
lot1:
|
|
59
|
-
lot2:
|
|
60
|
-
lot3:
|
|
61
|
-
lot4:
|
|
62
|
-
appA:
|
|
63
|
-
appB:
|
|
64
|
-
other:
|
|
57
|
+
lot1: 'Lot 1',
|
|
58
|
+
lot2: 'Lot 2',
|
|
59
|
+
lot3: 'Lot 3',
|
|
60
|
+
lot4: 'Lot A 482392',
|
|
61
|
+
appA: 'A',
|
|
62
|
+
appB: 'B',
|
|
63
|
+
other: 'Other',
|
|
65
64
|
};
|
|
66
65
|
return [
|
|
67
66
|
GridCell({
|
|
68
|
-
field:
|
|
69
|
-
headerName:
|
|
67
|
+
field: 'id',
|
|
68
|
+
headerName: 'Id',
|
|
70
69
|
}),
|
|
71
|
-
GridPopoutEditMultiSelect<ITestRow, ITestRow[
|
|
70
|
+
GridPopoutEditMultiSelect<ITestRow, ITestRow['position']>(
|
|
72
71
|
{
|
|
73
|
-
field:
|
|
74
|
-
headerName:
|
|
72
|
+
field: 'position',
|
|
73
|
+
headerName: 'Position',
|
|
75
74
|
valueFormatter: ({ value }) => {
|
|
76
|
-
if (value == null) return
|
|
77
|
-
return value.map((v: string) => positionMap[v] ?? v).join(
|
|
75
|
+
if (value == null) return '';
|
|
76
|
+
return value.map((v: string) => positionMap[v] ?? v).join(', ');
|
|
78
77
|
},
|
|
79
78
|
},
|
|
80
79
|
{
|
|
81
80
|
multiEdit: true,
|
|
82
81
|
editorParams: {
|
|
83
82
|
filtered: true,
|
|
84
|
-
filterPlaceholder:
|
|
85
|
-
className:
|
|
86
|
-
headers: [{ header:
|
|
83
|
+
filterPlaceholder: 'Filter position',
|
|
84
|
+
className: 'GridMultiSelect-containerUnlimited',
|
|
85
|
+
headers: [{ header: 'Header item' }],
|
|
87
86
|
options: (selectedRows) => {
|
|
88
87
|
const firstRow = selectedRows[0];
|
|
89
88
|
return [
|
|
90
|
-
{ value:
|
|
91
|
-
{ value:
|
|
92
|
-
{ value:
|
|
93
|
-
{ value:
|
|
94
|
-
{ value:
|
|
95
|
-
{ value:
|
|
96
|
-
{ value:
|
|
89
|
+
{ value: 'lot1', label: 'Lot 1' },
|
|
90
|
+
{ value: 'lot2', label: 'Lot 2' },
|
|
91
|
+
{ value: 'lot3', label: 'Lot 3' },
|
|
92
|
+
{ value: 'lot11', label: 'Lot 11' },
|
|
93
|
+
{ value: 'lot4', label: 'Lot A 482392' },
|
|
94
|
+
{ value: 'appA', label: 'A' },
|
|
95
|
+
{ value: 'appB', label: 'B' },
|
|
97
96
|
MenuSeparator,
|
|
98
97
|
{
|
|
99
|
-
value:
|
|
100
|
-
label:
|
|
101
|
-
subComponent: () => <GridFormSubComponentTextArea required={true} maxLength={5} defaultValue={
|
|
98
|
+
value: 'other',
|
|
99
|
+
label: 'Other',
|
|
100
|
+
subComponent: () => <GridFormSubComponentTextArea required={true} maxLength={5} defaultValue={''} />,
|
|
102
101
|
},
|
|
103
102
|
].map((r) => ({ ...r, checked: firstRow.position?.includes(r.value) }));
|
|
104
103
|
},
|
|
105
104
|
onSave: async ({ selectedRows, selectedOptions }) => {
|
|
106
105
|
// eslint-disable-next-line no-console
|
|
107
|
-
console.log(
|
|
106
|
+
console.log('multiSelect result', { selectedRows, selectedOptions });
|
|
108
107
|
|
|
109
108
|
await wait(1000);
|
|
110
109
|
const [subValues, normalValues] = partition(selectedOptions, (o) => o.subComponent);
|
|
@@ -115,41 +114,41 @@ const GridEditMultiSelectTemplate: StoryFn<typeof Grid> = (props: GridProps) =>
|
|
|
115
114
|
},
|
|
116
115
|
},
|
|
117
116
|
),
|
|
118
|
-
GridPopoutEditMultiSelect<ITestRow, ITestRow[
|
|
117
|
+
GridPopoutEditMultiSelect<ITestRow, ITestRow['position']>(
|
|
119
118
|
{
|
|
120
|
-
field:
|
|
121
|
-
headerName:
|
|
119
|
+
field: 'position',
|
|
120
|
+
headerName: 'Parcel picker',
|
|
122
121
|
valueFormatter: ({ value }) => {
|
|
123
|
-
if (value == null) return
|
|
124
|
-
return value.map((v: string) => positionMap[v] ?? v).join(
|
|
122
|
+
if (value == null) return '';
|
|
123
|
+
return value.map((v: string) => positionMap[v] ?? v).join(', ');
|
|
125
124
|
},
|
|
126
125
|
},
|
|
127
126
|
{
|
|
128
127
|
multiEdit: true,
|
|
129
128
|
editorParams: {
|
|
130
129
|
filtered: true,
|
|
131
|
-
filterPlaceholder:
|
|
130
|
+
filterPlaceholder: 'Filter/add custom parcel...',
|
|
132
131
|
filterHelpText: (filter, options) =>
|
|
133
132
|
isEmpty(filter) || options.find((o) => o.label && o.label.toLowerCase() === filter.toLowerCase())
|
|
134
133
|
? undefined
|
|
135
|
-
:
|
|
136
|
-
onSelectFilter:
|
|
134
|
+
: 'Press enter to add free text',
|
|
135
|
+
onSelectFilter: ({ filter, options }) => {
|
|
137
136
|
if (isEmpty(filter) || options.find((o) => o.label && o.label.toLowerCase() === filter.toLowerCase()))
|
|
138
137
|
return;
|
|
139
|
-
options.push({ value: filter, label: filter, filter:
|
|
138
|
+
options.push({ value: filter, label: filter, filter: 'freeText', checked: true });
|
|
140
139
|
},
|
|
141
|
-
className:
|
|
142
|
-
headers: [{ header:
|
|
140
|
+
className: 'GridMultiSelect-containerLarge',
|
|
141
|
+
headers: [{ header: 'Free text', filter: 'freeText' }, { header: 'Parcels' }],
|
|
143
142
|
options: (selectedRows) => {
|
|
144
143
|
const firstRow = selectedRows[0];
|
|
145
144
|
const r: MultiSelectOption[] = [
|
|
146
|
-
{ value:
|
|
147
|
-
{ value:
|
|
148
|
-
{ value:
|
|
149
|
-
{ value:
|
|
150
|
-
{ value:
|
|
151
|
-
{ value:
|
|
152
|
-
{ value:
|
|
145
|
+
{ value: 'lot1', label: 'Lot 1' },
|
|
146
|
+
{ value: 'lot2', label: 'Lot 2', warning: "Don't select me" },
|
|
147
|
+
{ value: 'lot3', label: 'Lot 3' },
|
|
148
|
+
{ value: 'lot11', label: 'Lot 11' },
|
|
149
|
+
{ value: 'lot4', label: 'Lot A 482392' },
|
|
150
|
+
{ value: 'appA', label: 'A' },
|
|
151
|
+
{ value: 'appB', label: 'B' },
|
|
153
152
|
].map((r) => ({ ...r, checked: firstRow.position?.includes(r.value) }));
|
|
154
153
|
firstRow.position?.forEach(
|
|
155
154
|
(p) =>
|
|
@@ -158,14 +157,14 @@ const GridEditMultiSelectTemplate: StoryFn<typeof Grid> = (props: GridProps) =>
|
|
|
158
157
|
value: p,
|
|
159
158
|
label: p,
|
|
160
159
|
checked: true,
|
|
161
|
-
filter:
|
|
160
|
+
filter: 'freeText',
|
|
162
161
|
}),
|
|
163
162
|
);
|
|
164
163
|
return r;
|
|
165
164
|
},
|
|
166
165
|
onSave: async ({ selectedRows, selectedOptions }) => {
|
|
167
166
|
// eslint-disable-next-line no-console
|
|
168
|
-
console.log(
|
|
167
|
+
console.log('multiSelect result', { selectedRows, selectedOptions });
|
|
169
168
|
|
|
170
169
|
await wait(1000);
|
|
171
170
|
const [subValues, normalValues] = partition(selectedOptions, (o) => o.subComponent);
|
|
@@ -180,8 +179,8 @@ const GridEditMultiSelectTemplate: StoryFn<typeof Grid> = (props: GridProps) =>
|
|
|
180
179
|
}, []);
|
|
181
180
|
|
|
182
181
|
const [rowData] = useState([
|
|
183
|
-
{ id: 1000, position: [
|
|
184
|
-
{ id: 1001, position: [
|
|
182
|
+
{ id: 1000, position: ['lot1', 'lot2'], position2: 'lot1', position3: 'Tester' },
|
|
183
|
+
{ id: 1001, position: ['appA'], position2: 'lot2', position3: 'Developer' },
|
|
185
184
|
] as ITestRow[]);
|
|
186
185
|
|
|
187
186
|
return (
|
|
@@ -192,7 +191,7 @@ const GridEditMultiSelectTemplate: StoryFn<typeof Grid> = (props: GridProps) =>
|
|
|
192
191
|
setExternalSelectedItems={setExternalSelectedItems}
|
|
193
192
|
columnDefs={columnDefs}
|
|
194
193
|
rowData={rowData}
|
|
195
|
-
domLayout={
|
|
194
|
+
domLayout={'autoHeight'}
|
|
196
195
|
/>
|
|
197
196
|
);
|
|
198
197
|
};
|