@linzjs/step-ag-grid 23.0.0 → 24.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/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 +17 -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/dist/src/utils/testQuick.d.ts +2 -2
- package/dist/src/utils/testUtil.d.ts +2 -2
- package/dist/src/utils/textValidator.d.ts +2 -2
- package/dist/step-ag-grid.cjs.js +966 -952
- package/dist/step-ag-grid.cjs.js.map +1 -1
- package/dist/step-ag-grid.esm.js +968 -954
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +26 -41
- package/src/components/ComponentLoadingWrapper.tsx +5 -6
- package/src/components/Grid.tsx +85 -83
- package/src/components/GridCell.test.tsx +15 -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 +14 -14
- package/src/contexts/GridContextProvider.tsx +42 -41
- 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 +17 -21
- package/src/lui/ActionButton.tsx +42 -41
- package/src/lui/FormError.tsx +4 -4
- package/src/lui/TextAreaInput.tsx +9 -9
- package/src/lui/TextInputFormatted.tsx +11 -11
- package/src/lui/reactUtils.test.tsx +8 -8
- package/src/lui/reactUtils.tsx +2 -2
- package/src/lui/stateDeferredHook.tsx +3 -5
- package/src/lui/timeoutHook.test.tsx +5 -5
- 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/utils/bearing.test.ts +44 -44
- package/src/utils/bearing.ts +20 -20
- package/src/utils/deferredPromise.ts +1 -1
- package/src/utils/storybookTestUtil.ts +2 -2
- package/src/utils/testQuick.ts +15 -14
- package/src/utils/testUtil.ts +31 -36
- package/src/utils/textMatcher.test.ts +9 -9
- package/src/utils/textMatcher.ts +8 -8
- package/src/utils/textValidator.test.ts +56 -56
- package/src/utils/textValidator.ts +11 -11
- package/src/utils/util.test.ts +20 -20
- package/src/utils/util.ts +7 -7
|
@@ -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 { useMemo, useState } from
|
|
7
|
-
|
|
8
|
-
import "@linzjs/lui/dist/fonts";
|
|
6
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
7
|
+
import { useMemo, useState } from 'react';
|
|
9
8
|
|
|
10
9
|
import {
|
|
11
10
|
ColDefT,
|
|
@@ -18,15 +17,15 @@ import {
|
|
|
18
17
|
GridProps,
|
|
19
18
|
GridUpdatingContextProvider,
|
|
20
19
|
GridWrapper,
|
|
21
|
-
} from
|
|
22
|
-
import { waitForGridReady } from
|
|
20
|
+
} from '../..';
|
|
21
|
+
import { waitForGridReady } from '../../utils/storybookTestUtil';
|
|
23
22
|
|
|
24
23
|
export default {
|
|
25
|
-
title:
|
|
24
|
+
title: 'Components / Grids',
|
|
26
25
|
component: Grid,
|
|
27
26
|
decorators: [
|
|
28
27
|
(Story) => (
|
|
29
|
-
<div style={{ width: 1024, height: 400, display:
|
|
28
|
+
<div style={{ width: 1024, height: 400, display: 'flex' }}>
|
|
30
29
|
<GridUpdatingContextProvider>
|
|
31
30
|
<GridContextProvider>
|
|
32
31
|
<Story />
|
|
@@ -47,16 +46,16 @@ const GridFilterButtonsTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
47
46
|
const columnDefs: ColDefT<ITestRow>[] = useMemo(
|
|
48
47
|
() => [
|
|
49
48
|
GridCell({
|
|
50
|
-
field:
|
|
51
|
-
headerName:
|
|
49
|
+
field: 'id',
|
|
50
|
+
headerName: 'Id',
|
|
52
51
|
}),
|
|
53
52
|
GridCell({
|
|
54
|
-
field:
|
|
55
|
-
headerName:
|
|
53
|
+
field: 'position',
|
|
54
|
+
headerName: 'Position',
|
|
56
55
|
}),
|
|
57
56
|
GridCell({
|
|
58
|
-
field:
|
|
59
|
-
headerName:
|
|
57
|
+
field: 'desc',
|
|
58
|
+
headerName: 'Description',
|
|
60
59
|
flex: 1,
|
|
61
60
|
}),
|
|
62
61
|
],
|
|
@@ -66,40 +65,40 @@ const GridFilterButtonsTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
66
65
|
const [rowData] = useState([
|
|
67
66
|
{
|
|
68
67
|
id: 1000,
|
|
69
|
-
position:
|
|
68
|
+
position: 'Tester',
|
|
70
69
|
age: 30,
|
|
71
|
-
desc:
|
|
70
|
+
desc: 'Integration tester - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur a lectus neque. Nunc congue magna ut lorem pretium, vitae congue lorem malesuada. Etiam eget eleifend sapien, sed egestas felis. Aliquam ac augue sapien.',
|
|
72
71
|
},
|
|
73
|
-
{ id: 1001, position:
|
|
74
|
-
{ id: 1002, position:
|
|
75
|
-
{ id: 1003, position:
|
|
76
|
-
{ id: 1004, position:
|
|
77
|
-
{ id: 1005, position:
|
|
78
|
-
{ id: 1006, position:
|
|
72
|
+
{ id: 1001, position: 'Developer', age: 12, desc: 'Frontend developer' },
|
|
73
|
+
{ id: 1002, position: 'Manager', age: 65, desc: 'Technical Manager' },
|
|
74
|
+
{ id: 1003, position: 'Tester', age: 30, desc: 'E2E tester' },
|
|
75
|
+
{ id: 1004, position: 'Developer', age: 12, desc: 'Fullstack Developer' },
|
|
76
|
+
{ id: 1005, position: 'Developer', age: 12, desc: 'Backend Developer' },
|
|
77
|
+
{ id: 1006, position: 'Architect', age: 30, desc: 'Architect' },
|
|
79
78
|
]);
|
|
80
79
|
|
|
81
80
|
return (
|
|
82
81
|
<GridWrapper>
|
|
83
82
|
<GridFilters>
|
|
84
|
-
<GridFilterQuick quickFilterPlaceholder={
|
|
83
|
+
<GridFilterQuick quickFilterPlaceholder={'Custom placeholder...'} />
|
|
85
84
|
<GridFilterButtons<ITestRow>
|
|
86
|
-
luiButtonProps={{ style: { whiteSpace:
|
|
85
|
+
luiButtonProps={{ style: { whiteSpace: 'nowrap' } }}
|
|
87
86
|
options={[
|
|
88
87
|
{
|
|
89
|
-
label:
|
|
88
|
+
label: 'All',
|
|
90
89
|
},
|
|
91
90
|
{
|
|
92
|
-
label:
|
|
93
|
-
filter: (row) => row.position ===
|
|
91
|
+
label: 'Developers',
|
|
92
|
+
filter: (row) => row.position === 'Developer',
|
|
94
93
|
},
|
|
95
94
|
{
|
|
96
|
-
label:
|
|
97
|
-
filter: (row) => row.position ===
|
|
95
|
+
label: 'Testers',
|
|
96
|
+
filter: (row) => row.position === 'Tester',
|
|
98
97
|
},
|
|
99
98
|
]}
|
|
100
99
|
/>
|
|
101
100
|
</GridFilters>
|
|
102
|
-
<Grid {...props} columnDefs={columnDefs} rowData={rowData} sizeColumns={
|
|
101
|
+
<Grid {...props} columnDefs={columnDefs} rowData={rowData} sizeColumns={'auto-skip-headers'} />
|
|
103
102
|
</GridWrapper>
|
|
104
103
|
);
|
|
105
104
|
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '@linzjs/lui/dist/scss/base.scss';
|
|
2
|
+
import '@linzjs/lui/dist/fonts';
|
|
2
3
|
|
|
3
|
-
import { Meta, StoryFn } from
|
|
4
|
-
import { expect } from
|
|
5
|
-
import { within } from
|
|
4
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
5
|
+
import { expect } from '@storybook/test';
|
|
6
|
+
import { within } from '@storybook/test';
|
|
6
7
|
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
import { GridNoRowsOverlay, GridNoRowsOverlayProps } from "../../components";
|
|
8
|
+
import { GridNoRowsOverlay, GridNoRowsOverlayProps } from '../../components';
|
|
10
9
|
|
|
11
10
|
export default {
|
|
12
|
-
title:
|
|
11
|
+
title: 'Components / Grids / GridNoRowsOverlay',
|
|
13
12
|
component: GridNoRowsOverlay,
|
|
14
13
|
args: {},
|
|
15
14
|
} as Meta<typeof GridNoRowsOverlay>;
|
|
@@ -25,7 +24,7 @@ _GridNoRowsEmpty.args = {
|
|
|
25
24
|
};
|
|
26
25
|
_GridNoRowsEmpty.play = async ({ canvasElement }) => {
|
|
27
26
|
const canvas = within(canvasElement);
|
|
28
|
-
expect(await canvas.findByText(
|
|
27
|
+
expect(await canvas.findByText('There are currently no rows')).toBeInTheDocument();
|
|
29
28
|
};
|
|
30
29
|
|
|
31
30
|
export const _GridNoRowsFiltered = GridNoRowsOverlayTemplate.bind({});
|
|
@@ -35,5 +34,5 @@ _GridNoRowsFiltered.args = {
|
|
|
35
34
|
};
|
|
36
35
|
_GridNoRowsFiltered.play = async ({ canvasElement }) => {
|
|
37
36
|
const canvas = within(canvasElement);
|
|
38
|
-
expect(await canvas.findByText(
|
|
37
|
+
expect(await canvas.findByText('All rows have been filtered')).toBeInTheDocument();
|
|
39
38
|
};
|
|
@@ -1,13 +1,12 @@
|
|
|
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 { GridPopoverEditDropDown } from
|
|
7
|
-
import { GridPopoverTextArea } from
|
|
8
|
-
import { useMemo, useState } from
|
|
9
|
-
|
|
10
|
-
import "@linzjs/lui/dist/fonts";
|
|
6
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
7
|
+
import { GridPopoverEditDropDown } from 'components/gridPopoverEdit/GridPopoverEditDropDown';
|
|
8
|
+
import { GridPopoverTextArea } from 'components/gridPopoverEdit/GridPopoverTextArea';
|
|
9
|
+
import { useMemo, useState } from 'react';
|
|
11
10
|
|
|
12
11
|
import {
|
|
13
12
|
ColDefT,
|
|
@@ -21,15 +20,15 @@ import {
|
|
|
21
20
|
GridUpdatingContextProvider,
|
|
22
21
|
MenuOption,
|
|
23
22
|
wait,
|
|
24
|
-
} from
|
|
25
|
-
import { waitForGridReady } from
|
|
23
|
+
} from '../..';
|
|
24
|
+
import { waitForGridReady } from '../../utils/storybookTestUtil';
|
|
26
25
|
|
|
27
26
|
export default {
|
|
28
|
-
title:
|
|
27
|
+
title: 'Components / Grids',
|
|
29
28
|
component: Grid,
|
|
30
29
|
args: {
|
|
31
30
|
selectable: true,
|
|
32
|
-
rowSelection:
|
|
31
|
+
rowSelection: 'single',
|
|
33
32
|
autoSelectFirstRow: true,
|
|
34
33
|
},
|
|
35
34
|
decorators: [
|
|
@@ -57,31 +56,31 @@ const GridNonEditableRowTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
57
56
|
const columnDefs: ColDefT<ITestRow>[] = useMemo(
|
|
58
57
|
() => [
|
|
59
58
|
GridCell({
|
|
60
|
-
field:
|
|
61
|
-
headerName:
|
|
59
|
+
field: 'id',
|
|
60
|
+
headerName: 'Id',
|
|
62
61
|
}),
|
|
63
62
|
GridPopoverEditDropDown(
|
|
64
63
|
{
|
|
65
|
-
field:
|
|
66
|
-
headerName:
|
|
64
|
+
field: 'position',
|
|
65
|
+
headerName: 'Position',
|
|
67
66
|
},
|
|
68
67
|
{
|
|
69
68
|
multiEdit: true,
|
|
70
69
|
editorParams: {
|
|
71
|
-
filtered:
|
|
72
|
-
filterPlaceholder:
|
|
73
|
-
options: [
|
|
70
|
+
filtered: 'local',
|
|
71
|
+
filterPlaceholder: 'Filter',
|
|
72
|
+
options: ['Architect', 'Developer', 'Product Owner', 'Scrum Master', 'Tester'],
|
|
74
73
|
},
|
|
75
74
|
},
|
|
76
75
|
),
|
|
77
76
|
GridCell({
|
|
78
|
-
field:
|
|
79
|
-
headerName:
|
|
77
|
+
field: 'age',
|
|
78
|
+
headerName: 'Age',
|
|
80
79
|
}),
|
|
81
80
|
GridPopoverTextArea(
|
|
82
81
|
{
|
|
83
|
-
field:
|
|
84
|
-
headerName:
|
|
82
|
+
field: 'desc',
|
|
83
|
+
headerName: 'Description',
|
|
85
84
|
},
|
|
86
85
|
{},
|
|
87
86
|
),
|
|
@@ -95,48 +94,48 @@ const GridNonEditableRowTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
95
94
|
await wait(500);
|
|
96
95
|
return [
|
|
97
96
|
{
|
|
98
|
-
label:
|
|
97
|
+
label: 'Single edit only',
|
|
99
98
|
action: async ({ selectedRows }) => {
|
|
100
|
-
alert(`Single-edit: ${selectedRows.map((r) => r.id)} rowId(s) selected`);
|
|
99
|
+
alert(`Single-edit: ${selectedRows.map((r) => r.id).join()} rowId(s) selected`);
|
|
101
100
|
await wait(1500);
|
|
102
101
|
},
|
|
103
102
|
disabled: selectedItems.length > 1,
|
|
104
103
|
},
|
|
105
104
|
{
|
|
106
|
-
label:
|
|
105
|
+
label: 'Multi-edit',
|
|
107
106
|
action: async ({ selectedRows }) => {
|
|
108
|
-
alert(`Multi-edit: ${selectedRows.map((r) => r.id)} rowId(s) selected`);
|
|
107
|
+
alert(`Multi-edit: ${selectedRows.map((r) => r.id).join()} rowId(s) selected`);
|
|
109
108
|
await wait(1500);
|
|
110
109
|
},
|
|
111
110
|
},
|
|
112
111
|
{
|
|
113
|
-
label:
|
|
114
|
-
disabled:
|
|
112
|
+
label: 'Disabled item',
|
|
113
|
+
disabled: 'Disabled for test',
|
|
115
114
|
},
|
|
116
115
|
{
|
|
117
|
-
label:
|
|
118
|
-
hidden: selectedItems.some((x) => x.position !=
|
|
116
|
+
label: 'Developer Only',
|
|
117
|
+
hidden: selectedItems.some((x) => x.position != 'Developer'),
|
|
119
118
|
},
|
|
120
119
|
{
|
|
121
|
-
label:
|
|
120
|
+
label: 'Other (TextInput)',
|
|
122
121
|
action: async ({ menuOption }) => {
|
|
123
122
|
// eslint-disable-next-line no-console
|
|
124
123
|
console.log(`Sub selected value was ${JSON.stringify(menuOption.subValue)}`);
|
|
125
124
|
await wait(500);
|
|
126
125
|
},
|
|
127
126
|
subComponent: () => (
|
|
128
|
-
<GridFormSubComponentTextInput placeholder={
|
|
127
|
+
<GridFormSubComponentTextInput placeholder={'Other'} maxLength={5} required defaultValue={''} />
|
|
129
128
|
),
|
|
130
129
|
},
|
|
131
130
|
{
|
|
132
|
-
label:
|
|
131
|
+
label: 'Other (TextArea)',
|
|
133
132
|
action: async ({ menuOption }) => {
|
|
134
133
|
// eslint-disable-next-line no-console
|
|
135
134
|
console.log(`Sub selected value was ${JSON.stringify(menuOption.subValue)}`);
|
|
136
135
|
await wait(500);
|
|
137
136
|
},
|
|
138
137
|
subComponent: () => (
|
|
139
|
-
<GridFormSubComponentTextArea placeholder={
|
|
138
|
+
<GridFormSubComponentTextArea placeholder={'Other'} maxLength={5} required defaultValue={''} />
|
|
140
139
|
),
|
|
141
140
|
},
|
|
142
141
|
] as MenuOption<ITestRow>[];
|
|
@@ -149,14 +148,14 @@ const GridNonEditableRowTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
149
148
|
);
|
|
150
149
|
|
|
151
150
|
const [rowData] = useState([
|
|
152
|
-
{ id: 1000, position:
|
|
153
|
-
{ id: 1001, position:
|
|
154
|
-
{ id: 1002, position:
|
|
151
|
+
{ id: 1000, position: 'Tester', age: 30, desc: 'Tests application', dd: '1' },
|
|
152
|
+
{ id: 1001, position: 'Developer', age: 12, desc: 'Develops application', dd: '2' },
|
|
153
|
+
{ id: 1002, position: 'Manager', age: 65, desc: 'Manages', dd: '3' },
|
|
155
154
|
]);
|
|
156
155
|
|
|
157
156
|
const defaultColDef: ColDefT<ITestRow> = useMemo(
|
|
158
157
|
() => ({
|
|
159
|
-
editable: ({ data }) => data?.position !==
|
|
158
|
+
editable: ({ data }) => data?.position !== 'Manager',
|
|
160
159
|
}),
|
|
161
160
|
[],
|
|
162
161
|
);
|
|
@@ -169,7 +168,7 @@ const GridNonEditableRowTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
169
168
|
defaultColDef={defaultColDef}
|
|
170
169
|
columnDefs={columnDefs}
|
|
171
170
|
rowData={rowData}
|
|
172
|
-
domLayout={
|
|
171
|
+
domLayout={'autoHeight'}
|
|
173
172
|
/>
|
|
174
173
|
);
|
|
175
174
|
};
|
|
@@ -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 { useMemo, useState } from
|
|
7
|
-
|
|
8
|
-
import "@linzjs/lui/dist/fonts";
|
|
6
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
7
|
+
import { useMemo, useState } from 'react';
|
|
9
8
|
|
|
10
9
|
import {
|
|
11
10
|
ColDefT,
|
|
@@ -15,11 +14,11 @@ import {
|
|
|
15
14
|
GridProps,
|
|
16
15
|
GridUpdatingContextProvider,
|
|
17
16
|
GridWrapper,
|
|
18
|
-
} from
|
|
19
|
-
import { waitForGridReady } from
|
|
17
|
+
} from '../..';
|
|
18
|
+
import { waitForGridReady } from '../../utils/storybookTestUtil';
|
|
20
19
|
|
|
21
20
|
export default {
|
|
22
|
-
title:
|
|
21
|
+
title: 'Components / Grids',
|
|
23
22
|
component: Grid,
|
|
24
23
|
args: {
|
|
25
24
|
selectable: false,
|
|
@@ -28,13 +27,13 @@ export default {
|
|
|
28
27
|
parameters: {
|
|
29
28
|
docs: {
|
|
30
29
|
source: {
|
|
31
|
-
type:
|
|
30
|
+
type: 'code',
|
|
32
31
|
},
|
|
33
32
|
},
|
|
34
33
|
},
|
|
35
34
|
decorators: [
|
|
36
35
|
(Story) => (
|
|
37
|
-
<div style={{ maxWidth: 1024, height: 260, display:
|
|
36
|
+
<div style={{ maxWidth: 1024, height: 260, display: 'flex', flexDirection: 'column' }}>
|
|
38
37
|
<GridUpdatingContextProvider>
|
|
39
38
|
<GridContextProvider>
|
|
40
39
|
<Story />
|
|
@@ -62,35 +61,35 @@ const PinnedRowTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
62
61
|
const columnDefs: ColDefT<ITestRow>[] = useMemo(
|
|
63
62
|
() => [
|
|
64
63
|
GridCell({
|
|
65
|
-
field:
|
|
66
|
-
headerName:
|
|
64
|
+
field: 'name',
|
|
65
|
+
headerName: 'Name',
|
|
67
66
|
}),
|
|
68
67
|
GridCell({
|
|
69
|
-
field:
|
|
70
|
-
headerName:
|
|
68
|
+
field: 'position',
|
|
69
|
+
headerName: 'Position',
|
|
71
70
|
}),
|
|
72
71
|
GridCell({
|
|
73
|
-
field:
|
|
74
|
-
headerName:
|
|
72
|
+
field: 'age',
|
|
73
|
+
headerName: 'Age',
|
|
75
74
|
}),
|
|
76
75
|
],
|
|
77
76
|
[],
|
|
78
77
|
);
|
|
79
78
|
|
|
80
79
|
const [rowData] = useState<ITestRow[]>([
|
|
81
|
-
{ id: 1, name:
|
|
82
|
-
{ id: 2, name:
|
|
83
|
-
{ id: 3, name:
|
|
84
|
-
{ id: 4, name:
|
|
85
|
-
{ id: 5, name:
|
|
80
|
+
{ id: 1, name: 'Opeyemi', position: 'Tester', age: 30 },
|
|
81
|
+
{ id: 2, name: 'Johnie', position: 'Developer', age: 21 },
|
|
82
|
+
{ id: 3, name: 'Laxmi', position: 'Manager', age: 65 },
|
|
83
|
+
{ id: 4, name: 'Salama', position: 'Developer', age: 22 },
|
|
84
|
+
{ id: 5, name: 'Husni', position: 'Developer', age: 24 },
|
|
86
85
|
]);
|
|
87
|
-
const [pinnedBottomRowData] = useState<ITestPinnedRow[]>([{ name:
|
|
88
|
-
const [pinnedTopRowData] = useState<ITestPinnedRow[]>([{ name:
|
|
86
|
+
const [pinnedBottomRowData] = useState<ITestPinnedRow[]>([{ name: 'Total Age', position: '', age: 170 }]);
|
|
87
|
+
const [pinnedTopRowData] = useState<ITestPinnedRow[]>([{ name: 'Min Age', position: '', age: 21 }]);
|
|
89
88
|
|
|
90
89
|
return (
|
|
91
90
|
<GridWrapper maxHeight={400}>
|
|
92
91
|
<Grid
|
|
93
|
-
data-testid={
|
|
92
|
+
data-testid={'readonly'}
|
|
94
93
|
{...props}
|
|
95
94
|
selectable={false}
|
|
96
95
|
columnDefs={columnDefs}
|
|
@@ -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 { ReactElement, useCallback, useContext, useMemo, useState } from
|
|
7
|
-
|
|
8
|
-
import "@linzjs/lui/dist/fonts";
|
|
6
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
7
|
+
import { ReactElement, useCallback, useContext, useMemo, useState } from 'react';
|
|
9
8
|
|
|
10
9
|
import {
|
|
11
10
|
ActionButton,
|
|
@@ -19,15 +18,15 @@ import {
|
|
|
19
18
|
GridUpdatingContextProvider,
|
|
20
19
|
MenuItem,
|
|
21
20
|
wait,
|
|
22
|
-
} from
|
|
23
|
-
import { waitForGridReady } from
|
|
24
|
-
import { IFormTestRow } from
|
|
21
|
+
} from '../..';
|
|
22
|
+
import { waitForGridReady } from '../../utils/storybookTestUtil';
|
|
23
|
+
import { IFormTestRow } from './FormTest';
|
|
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: [
|
|
@@ -46,10 +45,10 @@ export default {
|
|
|
46
45
|
const ContextMenu = ({ clickedRow, colDef, close }: GridContextMenuComponentProps<IFormTestRow>): ReactElement => {
|
|
47
46
|
const onClick = useCallback(() => {
|
|
48
47
|
switch (colDef.field) {
|
|
49
|
-
case
|
|
50
|
-
clickedRow.name =
|
|
48
|
+
case 'name':
|
|
49
|
+
clickedRow.name = '';
|
|
51
50
|
break;
|
|
52
|
-
case
|
|
51
|
+
case 'distance':
|
|
53
52
|
clickedRow.distance = null;
|
|
54
53
|
break;
|
|
55
54
|
}
|
|
@@ -68,26 +67,26 @@ const GridPopoutContextMenuTemplate: StoryFn<typeof Grid> = (props: GridProps) =
|
|
|
68
67
|
const { selectRowsWithFlashDiff } = useContext(GridContext);
|
|
69
68
|
const [externalSelectedItems, setExternalSelectedItems] = useState<any[]>([]);
|
|
70
69
|
const [rowData, setRowData] = useState([
|
|
71
|
-
{ id: 1000, name:
|
|
72
|
-
{ id: 1001, name:
|
|
70
|
+
{ id: 1000, name: 'IS IS DP12345', nameType: 'IS', numba: 'IX', plan: 'DP 12345', distance: 10 },
|
|
71
|
+
{ id: 1001, name: 'PEG V SD523', nameType: 'PEG', numba: 'V', plan: 'SD 523', distance: null },
|
|
73
72
|
] as IFormTestRow[]);
|
|
74
73
|
|
|
75
74
|
const columnDefs: ColDefT<IFormTestRow>[] = useMemo(
|
|
76
75
|
() => [
|
|
77
76
|
GridCell({
|
|
78
|
-
field:
|
|
79
|
-
headerName:
|
|
77
|
+
field: 'id',
|
|
78
|
+
headerName: 'Id',
|
|
80
79
|
}),
|
|
81
80
|
GridCell({
|
|
82
|
-
field:
|
|
83
|
-
headerName:
|
|
81
|
+
field: 'name',
|
|
82
|
+
headerName: 'Name',
|
|
84
83
|
}),
|
|
85
84
|
GridCell({
|
|
86
|
-
field:
|
|
87
|
-
headerName:
|
|
85
|
+
field: 'distance',
|
|
86
|
+
headerName: 'Number input',
|
|
88
87
|
valueFormatter: ({ data }) => {
|
|
89
88
|
const v = data?.distance;
|
|
90
|
-
return v != null ? `${v}m` :
|
|
89
|
+
return v != null ? `${v}m` : '–';
|
|
91
90
|
},
|
|
92
91
|
}),
|
|
93
92
|
],
|
|
@@ -98,16 +97,18 @@ const GridPopoutContextMenuTemplate: StoryFn<typeof Grid> = (props: GridProps) =
|
|
|
98
97
|
await wait(1000);
|
|
99
98
|
|
|
100
99
|
const lastRow = rowData[rowData.length - 1];
|
|
100
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
101
101
|
await selectRowsWithFlashDiff(async () => {
|
|
102
102
|
setRowData([
|
|
103
103
|
...rowData,
|
|
104
104
|
{
|
|
105
105
|
id: (lastRow?.id ?? 0) + 1,
|
|
106
|
-
name:
|
|
107
|
-
nameType:
|
|
108
|
-
numba:
|
|
109
|
-
plan:
|
|
106
|
+
name: '?',
|
|
107
|
+
nameType: '?',
|
|
108
|
+
numba: '?',
|
|
109
|
+
plan: '',
|
|
110
110
|
distance: null,
|
|
111
|
+
bold: false,
|
|
111
112
|
},
|
|
112
113
|
]);
|
|
113
114
|
});
|
|
@@ -121,16 +122,16 @@ const GridPopoutContextMenuTemplate: StoryFn<typeof Grid> = (props: GridProps) =
|
|
|
121
122
|
setExternalSelectedItems={setExternalSelectedItems}
|
|
122
123
|
columnDefs={columnDefs}
|
|
123
124
|
rowData={rowData}
|
|
124
|
-
domLayout={
|
|
125
|
+
domLayout={'autoHeight'}
|
|
125
126
|
defaultColDef={{ minWidth: 70 }}
|
|
126
|
-
sizeColumns={
|
|
127
|
+
sizeColumns={'auto'}
|
|
127
128
|
onCellEditingComplete={() => {
|
|
128
129
|
/* eslint-disable-next-line no-console */
|
|
129
|
-
console.log(
|
|
130
|
+
console.log('Cell editing complete');
|
|
130
131
|
}}
|
|
131
132
|
contextMenu={ContextMenu}
|
|
132
133
|
/>
|
|
133
|
-
<ActionButton icon={
|
|
134
|
+
<ActionButton icon={'ic_add'} name={'Add new row'} inProgressName={'Adding...'} onClick={addRowAction} />
|
|
134
135
|
</>
|
|
135
136
|
);
|
|
136
137
|
};
|
|
@@ -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 { useMemo, useState } from
|
|
7
|
-
|
|
8
|
-
import "@linzjs/lui/dist/fonts";
|
|
6
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
7
|
+
import { useMemo, useState } from 'react';
|
|
9
8
|
|
|
10
9
|
import {
|
|
11
10
|
ColDefT,
|
|
@@ -15,12 +14,12 @@ import {
|
|
|
15
14
|
GridContextProvider,
|
|
16
15
|
GridEditBoolean,
|
|
17
16
|
GridUpdatingContextProvider,
|
|
18
|
-
} from
|
|
19
|
-
import { waitForGridReady } from
|
|
20
|
-
import { IFormTestRow } from
|
|
17
|
+
} from '../..';
|
|
18
|
+
import { waitForGridReady } from '../../utils/storybookTestUtil';
|
|
19
|
+
import { IFormTestRow } from './FormTest';
|
|
21
20
|
|
|
22
21
|
export default {
|
|
23
|
-
title:
|
|
22
|
+
title: 'Components / Grids',
|
|
24
23
|
component: Grid,
|
|
25
24
|
decorators: [
|
|
26
25
|
(Story) => (
|
|
@@ -37,37 +36,37 @@ export default {
|
|
|
37
36
|
|
|
38
37
|
const GridPopoutEditBooleanTemplate: StoryFn<typeof Grid> = () => {
|
|
39
38
|
const [rowData, setRowData] = useState([
|
|
40
|
-
{ id: 1000, name:
|
|
41
|
-
{ id: 1001, name:
|
|
39
|
+
{ id: 1000, name: 'IS IS DP12345', nameType: 'IS', numba: 'IX', plan: 'DP 12345', bold: true },
|
|
40
|
+
{ id: 1001, name: 'PEG V SD523', nameType: 'PEG', numba: 'V', plan: 'SD 523', bold: false },
|
|
42
41
|
] as IFormTestRow[]);
|
|
43
42
|
|
|
44
43
|
const columnDefs: ColDefT<IFormTestRow>[] = useMemo(
|
|
45
44
|
() => [
|
|
46
45
|
GridCell({
|
|
47
|
-
field:
|
|
48
|
-
headerName:
|
|
46
|
+
field: 'id',
|
|
47
|
+
headerName: 'Id',
|
|
49
48
|
}),
|
|
50
49
|
GridButton(
|
|
51
50
|
{
|
|
52
|
-
colId:
|
|
53
|
-
headerName:
|
|
51
|
+
colId: 'button',
|
|
52
|
+
headerName: 'Button',
|
|
54
53
|
},
|
|
55
54
|
{
|
|
56
55
|
visible: ({ data }) => !!(data.id & 1),
|
|
57
56
|
onClick: ({ selectedRowIds }) => {
|
|
58
|
-
alert(
|
|
57
|
+
alert('click ' + String(selectedRowIds));
|
|
59
58
|
},
|
|
60
59
|
},
|
|
61
60
|
),
|
|
62
61
|
GridEditBoolean(
|
|
63
62
|
{
|
|
64
|
-
field:
|
|
63
|
+
field: 'bold',
|
|
65
64
|
},
|
|
66
65
|
{
|
|
67
|
-
onClick:
|
|
66
|
+
onClick: ({ selectedRowIds, checked }) => {
|
|
68
67
|
setRowData((rowData) => {
|
|
69
68
|
// eslint-disable-next-line no-console
|
|
70
|
-
console.log(
|
|
69
|
+
console.log('onchange', selectedRowIds, checked);
|
|
71
70
|
return rowData.map((row) => (selectedRowIds.includes(row.id) ? { ...row, bold: checked } : row));
|
|
72
71
|
});
|
|
73
72
|
return true;
|
|
@@ -85,7 +84,7 @@ const GridPopoutEditBooleanTemplate: StoryFn<typeof Grid> = () => {
|
|
|
85
84
|
selectable={false}
|
|
86
85
|
singleClickEdit={true}
|
|
87
86
|
rowSelection="single"
|
|
88
|
-
domLayout={
|
|
87
|
+
domLayout={'autoHeight'}
|
|
89
88
|
/>
|
|
90
89
|
);
|
|
91
90
|
};
|