@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,24 +1,23 @@
|
|
|
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 { countBy, mergeWith, pull, range, union } from
|
|
7
|
-
import { useMemo, useState } from
|
|
6
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
7
|
+
import { countBy, mergeWith, pull, range, union } from 'lodash-es';
|
|
8
|
+
import { useMemo, useState } from 'react';
|
|
8
9
|
|
|
9
|
-
import
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { waitForGridReady } from "../../utils/storybookTestUtil";
|
|
15
|
-
import { EditMultiSelect } from "./GridPopoverEditMultiSelect.stories";
|
|
10
|
+
import { ColDefT, Grid, GridCell, GridContextProvider, GridProps, GridUpdatingContextProvider } from '../..';
|
|
11
|
+
import { MultiSelectGridOption } from '../../components/gridForm/GridFormMultiSelectGrid';
|
|
12
|
+
import { GridPopoutEditMultiSelectGrid } from '../../components/gridPopoverEdit/GridPopoutEditMultiSelectGrid';
|
|
13
|
+
import { waitForGridReady } from '../../utils/storybookTestUtil';
|
|
14
|
+
import { EditMultiSelect } from './GridPopoverEditMultiSelect.stories';
|
|
16
15
|
|
|
17
16
|
export default {
|
|
18
|
-
title:
|
|
17
|
+
title: 'Components / Grids',
|
|
19
18
|
component: Grid,
|
|
20
19
|
args: {
|
|
21
|
-
quickFilterValue:
|
|
20
|
+
quickFilterValue: '',
|
|
22
21
|
selectable: true,
|
|
23
22
|
},
|
|
24
23
|
decorators: [
|
|
@@ -46,22 +45,22 @@ const GridEditMultiSelectGridTemplate: StoryFn<typeof Grid> = (props: GridProps)
|
|
|
46
45
|
const columnDefs: ColDefT<ITestRow>[] = useMemo(() => {
|
|
47
46
|
return [
|
|
48
47
|
GridCell({
|
|
49
|
-
field:
|
|
50
|
-
headerName:
|
|
48
|
+
field: 'id',
|
|
49
|
+
headerName: 'Id',
|
|
51
50
|
}),
|
|
52
|
-
GridPopoutEditMultiSelectGrid<ITestRow, ITestRow[
|
|
51
|
+
GridPopoutEditMultiSelectGrid<ITestRow, ITestRow['position']>(
|
|
53
52
|
{
|
|
54
|
-
field:
|
|
55
|
-
headerName:
|
|
53
|
+
field: 'position',
|
|
54
|
+
headerName: 'Position',
|
|
56
55
|
valueFormatter: ({ value }) => {
|
|
57
|
-
if (value == null) return
|
|
58
|
-
return value.join(
|
|
56
|
+
if (value == null) return '';
|
|
57
|
+
return value.join(', ');
|
|
59
58
|
},
|
|
60
59
|
},
|
|
61
60
|
{
|
|
62
61
|
multiEdit: true,
|
|
63
62
|
editorParams: {
|
|
64
|
-
className:
|
|
63
|
+
className: 'GridMultiSelect-containerUnlimited',
|
|
65
64
|
options: (selectedRows: ITestRow[]) => {
|
|
66
65
|
const counts: Record<number, number> = mergeWith(
|
|
67
66
|
{},
|
|
@@ -69,15 +68,16 @@ const GridEditMultiSelectGridTemplate: StoryFn<typeof Grid> = (props: GridProps)
|
|
|
69
68
|
(a: number | undefined, b: number | undefined) => (a ?? 0) + (b ?? 0),
|
|
70
69
|
);
|
|
71
70
|
return range(50024, 50067).map((value): MultiSelectGridOption => {
|
|
72
|
-
const checked = counts[value] == selectedRows.length ? true : counts[value] > 0 ?
|
|
71
|
+
const checked = counts[value] == selectedRows.length ? true : counts[value] > 0 ? 'partial' : false;
|
|
73
72
|
return {
|
|
74
73
|
value: value,
|
|
75
74
|
label: `${value}`,
|
|
76
75
|
checked,
|
|
77
|
-
canSelectPartial: checked ===
|
|
76
|
+
canSelectPartial: checked === 'partial',
|
|
78
77
|
};
|
|
79
78
|
});
|
|
80
79
|
},
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
81
81
|
onSave: async ({ selectedRows, addValues, removeValues }) => {
|
|
82
82
|
selectedRows.forEach((row) => {
|
|
83
83
|
row.position = union(pull(row.position ?? [], ...removeValues), addValues).sort();
|
|
@@ -92,8 +92,8 @@ const GridEditMultiSelectGridTemplate: StoryFn<typeof Grid> = (props: GridProps)
|
|
|
92
92
|
}, []);
|
|
93
93
|
|
|
94
94
|
const [rowData] = useState([
|
|
95
|
-
{ id: 1000, position: [50024, 50025], position2:
|
|
96
|
-
{ id: 1001, position: [50025, 50026], position2:
|
|
95
|
+
{ id: 1000, position: [50024, 50025], position2: 'lot1' },
|
|
96
|
+
{ id: 1001, position: [50025, 50026], position2: 'lot2' },
|
|
97
97
|
] as ITestRow[]);
|
|
98
98
|
|
|
99
99
|
return (
|
|
@@ -104,7 +104,7 @@ const GridEditMultiSelectGridTemplate: StoryFn<typeof Grid> = (props: GridProps)
|
|
|
104
104
|
setExternalSelectedItems={setExternalSelectedItems}
|
|
105
105
|
columnDefs={columnDefs}
|
|
106
106
|
rowData={rowData}
|
|
107
|
-
domLayout={
|
|
107
|
+
domLayout={'autoHeight'}
|
|
108
108
|
/>
|
|
109
109
|
);
|
|
110
110
|
};
|
|
@@ -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, useMemo, useState } from
|
|
7
|
-
|
|
8
|
-
import "@linzjs/lui/dist/fonts";
|
|
6
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
7
|
+
import { ReactElement, useCallback, useMemo, useState } from 'react';
|
|
9
8
|
|
|
10
9
|
import {
|
|
11
10
|
ColDefT,
|
|
@@ -26,32 +25,32 @@ import {
|
|
|
26
25
|
MenuItem,
|
|
27
26
|
useGridFilter,
|
|
28
27
|
wait,
|
|
29
|
-
} from
|
|
30
|
-
import { GridFilterColumnsToggle, GridFilterDownloadCsvButton } from
|
|
31
|
-
import { GridCellFiller } from
|
|
32
|
-
import { waitForGridReady } from
|
|
28
|
+
} from '../..';
|
|
29
|
+
import { GridFilterColumnsToggle, GridFilterDownloadCsvButton } from '../../components';
|
|
30
|
+
import { GridCellFiller } from '../../components/GridCellFiller';
|
|
31
|
+
import { waitForGridReady } from '../../utils/storybookTestUtil';
|
|
33
32
|
|
|
34
33
|
export default {
|
|
35
|
-
title:
|
|
34
|
+
title: 'Components / Grids',
|
|
36
35
|
component: Grid,
|
|
37
36
|
args: {
|
|
38
37
|
quickFilter: true,
|
|
39
|
-
quickFilterValue:
|
|
40
|
-
quickFilterPlaceholder:
|
|
38
|
+
quickFilterValue: '',
|
|
39
|
+
quickFilterPlaceholder: 'Quick filter...',
|
|
41
40
|
selectable: false,
|
|
42
|
-
rowSelection:
|
|
41
|
+
rowSelection: 'single',
|
|
43
42
|
},
|
|
44
43
|
// Storybook hangs otherwise
|
|
45
44
|
parameters: {
|
|
46
45
|
docs: {
|
|
47
46
|
source: {
|
|
48
|
-
type:
|
|
47
|
+
type: 'code',
|
|
49
48
|
},
|
|
50
49
|
},
|
|
51
50
|
},
|
|
52
51
|
decorators: [
|
|
53
52
|
(Story) => (
|
|
54
|
-
<div style={{ maxWidth: 1024, height: 400, display:
|
|
53
|
+
<div style={{ maxWidth: 1024, height: 400, display: 'flex', flexDirection: 'column' }}>
|
|
55
54
|
<GridUpdatingContextProvider>
|
|
56
55
|
<GridContextProvider>
|
|
57
56
|
<Story />
|
|
@@ -76,42 +75,42 @@ const GridReadOnlyTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
76
75
|
const columnDefs: ColDefT<ITestRow>[] = useMemo(
|
|
77
76
|
() => [
|
|
78
77
|
GridCell({
|
|
79
|
-
field:
|
|
80
|
-
headerName:
|
|
78
|
+
field: 'id',
|
|
79
|
+
headerName: 'Id',
|
|
81
80
|
lockVisible: true,
|
|
82
81
|
}),
|
|
83
|
-
GridCell<ITestRow, ITestRow[
|
|
84
|
-
field:
|
|
85
|
-
headerName:
|
|
82
|
+
GridCell<ITestRow, ITestRow['position']>({
|
|
83
|
+
field: 'position',
|
|
84
|
+
headerName: 'Position',
|
|
86
85
|
cellRendererParams: {
|
|
87
|
-
warning: ({ value }) => value ===
|
|
88
|
-
info: ({ value }) => value ===
|
|
86
|
+
warning: ({ value }) => value === 'Tester' && 'Testers are testing',
|
|
87
|
+
info: ({ value }) => value === 'Developer' && 'Developers are awesome',
|
|
89
88
|
},
|
|
90
89
|
}),
|
|
91
90
|
{
|
|
92
|
-
headerName:
|
|
91
|
+
headerName: 'Metrics',
|
|
93
92
|
marryChildren: true,
|
|
94
93
|
children: [
|
|
95
|
-
GridCell<ITestRow, ITestRow[
|
|
96
|
-
field:
|
|
97
|
-
headerName:
|
|
94
|
+
GridCell<ITestRow, ITestRow['age']>({
|
|
95
|
+
field: 'age',
|
|
96
|
+
headerName: 'Age',
|
|
98
97
|
}),
|
|
99
|
-
GridCell<ITestRow, ITestRow[
|
|
100
|
-
field:
|
|
101
|
-
headerName:
|
|
98
|
+
GridCell<ITestRow, ITestRow['height']>({
|
|
99
|
+
field: 'height',
|
|
100
|
+
headerName: 'Height',
|
|
102
101
|
}),
|
|
103
102
|
],
|
|
104
103
|
},
|
|
105
104
|
GridCell({
|
|
106
|
-
field:
|
|
107
|
-
headerName:
|
|
105
|
+
field: 'desc',
|
|
106
|
+
headerName: 'Description',
|
|
108
107
|
flex: 1,
|
|
109
108
|
initialHide: true,
|
|
110
109
|
}),
|
|
111
110
|
GridCellFiller(),
|
|
112
111
|
GridPopoverMessage(
|
|
113
112
|
{
|
|
114
|
-
headerName:
|
|
113
|
+
headerName: 'Popout message',
|
|
115
114
|
cellRenderer: () => <>Single Click me!</>,
|
|
116
115
|
exportable: false,
|
|
117
116
|
},
|
|
@@ -126,20 +125,20 @@ const GridReadOnlyTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
126
125
|
},
|
|
127
126
|
),
|
|
128
127
|
GridCell({
|
|
129
|
-
headerName:
|
|
128
|
+
headerName: 'Custom edit',
|
|
130
129
|
editable: true,
|
|
131
130
|
flex: 1,
|
|
132
|
-
valueFormatter: () =>
|
|
131
|
+
valueFormatter: () => 'Press E',
|
|
133
132
|
cellRendererParams: {
|
|
134
133
|
rightHoverElement: (
|
|
135
|
-
<GridIcon icon={
|
|
134
|
+
<GridIcon icon={'ic_launch_modal'} title={'Title text'} className={'GridCell-editableIcon'} />
|
|
136
135
|
),
|
|
137
136
|
editAction: (selectedRows: ITestRow[]) => {
|
|
138
|
-
alert(`Custom edit ${selectedRows.map((r) => r.id)} rowId(s) selected`);
|
|
137
|
+
alert(`Custom edit ${selectedRows.map((r) => r.id).join()} rowId(s) selected`);
|
|
139
138
|
},
|
|
140
139
|
shortcutKeys: {
|
|
141
140
|
e: () => {
|
|
142
|
-
alert(
|
|
141
|
+
alert('Hi');
|
|
143
142
|
},
|
|
144
143
|
},
|
|
145
144
|
},
|
|
@@ -149,61 +148,61 @@ const GridReadOnlyTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
149
148
|
{
|
|
150
149
|
multiEdit: true,
|
|
151
150
|
editorParams: {
|
|
152
|
-
defaultAction:
|
|
151
|
+
defaultAction: ({ menuOption }) => {
|
|
153
152
|
// eslint-disable-next-line no-console
|
|
154
|
-
console.log(
|
|
153
|
+
console.log('clicked', { menuOption });
|
|
155
154
|
},
|
|
156
155
|
options: async (selectedItems) => {
|
|
157
156
|
// Just doing a timeout here to demonstrate deferred loading
|
|
158
157
|
await wait(500);
|
|
159
158
|
return [
|
|
160
159
|
{
|
|
161
|
-
label:
|
|
160
|
+
label: 'Single edit only',
|
|
162
161
|
action: async ({ selectedRows }) => {
|
|
163
|
-
alert(`Single-edit: ${selectedRows.map((r) => r.id)} rowId(s) selected`);
|
|
162
|
+
alert(`Single-edit: ${selectedRows.map((r) => r.id).join()} rowId(s) selected`);
|
|
164
163
|
await wait(1500);
|
|
165
164
|
},
|
|
166
165
|
disabled: selectedItems.length > 1,
|
|
167
166
|
},
|
|
168
167
|
{
|
|
169
|
-
label:
|
|
168
|
+
label: 'Multi-edit',
|
|
170
169
|
action: async ({ selectedRows }) => {
|
|
171
|
-
alert(`Multi-edit: ${selectedRows.map((r) => r.id)} rowId(s) selected`);
|
|
170
|
+
alert(`Multi-edit: ${selectedRows.map((r) => r.id).join()} rowId(s) selected`);
|
|
172
171
|
await wait(1500);
|
|
173
172
|
},
|
|
174
173
|
},
|
|
175
174
|
{
|
|
176
|
-
label:
|
|
175
|
+
label: 'Sub menu...',
|
|
177
176
|
subMenu: () => <MenuItem>Find...</MenuItem>,
|
|
178
177
|
},
|
|
179
178
|
{
|
|
180
|
-
label:
|
|
181
|
-
disabled:
|
|
179
|
+
label: 'Disabled item',
|
|
180
|
+
disabled: 'Disabled for test',
|
|
182
181
|
},
|
|
183
182
|
{
|
|
184
|
-
label:
|
|
185
|
-
hidden: selectedItems.some((x) => x.position !=
|
|
183
|
+
label: 'Developer Only',
|
|
184
|
+
hidden: selectedItems.some((x) => x.position != 'Developer'),
|
|
186
185
|
},
|
|
187
186
|
{
|
|
188
|
-
label:
|
|
187
|
+
label: 'Other (TextInput)',
|
|
189
188
|
action: async ({ menuOption }) => {
|
|
190
189
|
// eslint-disable-next-line no-console
|
|
191
190
|
console.log(`Sub selected value was ${JSON.stringify(menuOption.subValue)}`);
|
|
192
191
|
await wait(500);
|
|
193
192
|
},
|
|
194
193
|
subComponent: () => (
|
|
195
|
-
<GridFormSubComponentTextInput placeholder={
|
|
194
|
+
<GridFormSubComponentTextInput placeholder={'Other'} maxLength={5} required defaultValue={''} />
|
|
196
195
|
),
|
|
197
196
|
},
|
|
198
197
|
{
|
|
199
|
-
label:
|
|
198
|
+
label: 'Other (TextArea)',
|
|
200
199
|
action: async ({ menuOption }) => {
|
|
201
200
|
// eslint-disable-next-line no-console
|
|
202
201
|
console.log(`Sub selected value was ${JSON.stringify(menuOption.subValue)}`);
|
|
203
202
|
await wait(500);
|
|
204
203
|
},
|
|
205
204
|
subComponent: () => (
|
|
206
|
-
<GridFormSubComponentTextArea placeholder={
|
|
205
|
+
<GridFormSubComponentTextArea placeholder={'Other'} maxLength={5} required defaultValue={''} />
|
|
207
206
|
),
|
|
208
207
|
},
|
|
209
208
|
];
|
|
@@ -216,33 +215,33 @@ const GridReadOnlyTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
216
215
|
);
|
|
217
216
|
|
|
218
217
|
const [rowData] = useState<ITestRow[]>([
|
|
219
|
-
{ id: 1000, position:
|
|
220
|
-
{ id: 1001, position:
|
|
221
|
-
{ id: 1002, position:
|
|
218
|
+
{ id: 1000, position: 'Tester', age: 30, height: `6'4"`, desc: 'Tests application', dd: '1' },
|
|
219
|
+
{ id: 1001, position: 'Developer', age: 12, height: `5'3"`, desc: 'Develops application', dd: '2' },
|
|
220
|
+
{ id: 1002, position: 'Manager', age: 65, height: `5'9"`, desc: 'Manages', dd: '3' },
|
|
222
221
|
]);
|
|
223
222
|
|
|
224
223
|
return (
|
|
225
224
|
<GridWrapper maxHeight={400}>
|
|
226
225
|
<GridFilters>
|
|
227
226
|
<GridFilterQuick />
|
|
228
|
-
<GridFilterLessThan text="Age <" field={
|
|
227
|
+
<GridFilterLessThan text="Age <" field={'age'} />
|
|
229
228
|
<GridFilterButtons<ITestRow>
|
|
230
|
-
luiButtonProps={{ style: { whiteSpace:
|
|
229
|
+
luiButtonProps={{ style: { whiteSpace: 'nowrap' } }}
|
|
231
230
|
options={[
|
|
232
231
|
{
|
|
233
|
-
label:
|
|
232
|
+
label: 'All',
|
|
234
233
|
},
|
|
235
234
|
{
|
|
236
|
-
label:
|
|
235
|
+
label: '< 30',
|
|
237
236
|
filter: (row) => row.age < 30,
|
|
238
237
|
},
|
|
239
238
|
]}
|
|
240
239
|
/>
|
|
241
240
|
<GridFilterColumnsToggle />
|
|
242
|
-
<GridFilterDownloadCsvButton fileName={
|
|
241
|
+
<GridFilterDownloadCsvButton fileName={'readOnlyGrid'} />
|
|
243
242
|
</GridFilters>
|
|
244
243
|
<Grid
|
|
245
|
-
data-testid={
|
|
244
|
+
data-testid={'readonly'}
|
|
246
245
|
{...props}
|
|
247
246
|
selectable={true}
|
|
248
247
|
autoSelectFirstRow={true}
|
|
@@ -274,17 +273,17 @@ const GridFilterLessThan = (props: {
|
|
|
274
273
|
|
|
275
274
|
const updateValue = (newValue: string) => {
|
|
276
275
|
try {
|
|
277
|
-
setValue(newValue.trim() ==
|
|
276
|
+
setValue(newValue.trim() == '' ? undefined : parseInt(newValue));
|
|
278
277
|
} catch {
|
|
279
278
|
// ignore number parse exception
|
|
280
279
|
}
|
|
281
280
|
};
|
|
282
281
|
|
|
283
282
|
return (
|
|
284
|
-
<div className={
|
|
285
|
-
<div style={{ whiteSpace:
|
|
283
|
+
<div className={'GridFilter-container flex-row-center'}>
|
|
284
|
+
<div style={{ whiteSpace: 'nowrap' }}>{props.text}</div>
|
|
286
285
|
 
|
|
287
|
-
<input type={
|
|
286
|
+
<input type={'text'} defaultValue={value} onChange={(e) => updateValue(e.target.value)} style={{ width: 64 }} />
|
|
288
287
|
</div>
|
|
289
288
|
);
|
|
290
289
|
};
|
|
@@ -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,22 +14,22 @@ import {
|
|
|
15
14
|
GridProps,
|
|
16
15
|
GridUpdatingContextProvider,
|
|
17
16
|
GridWrapper,
|
|
18
|
-
} from
|
|
17
|
+
} from '../..';
|
|
19
18
|
|
|
20
19
|
export default {
|
|
21
|
-
title:
|
|
20
|
+
title: 'Components / Grids',
|
|
22
21
|
component: Grid,
|
|
23
22
|
// Storybook hangs otherwise
|
|
24
23
|
parameters: {
|
|
25
24
|
docs: {
|
|
26
25
|
source: {
|
|
27
|
-
type:
|
|
26
|
+
type: 'code',
|
|
28
27
|
},
|
|
29
28
|
},
|
|
30
29
|
},
|
|
31
30
|
decorators: [
|
|
32
31
|
(Story) => (
|
|
33
|
-
<div style={{ maxWidth: 1024, height: 400, display:
|
|
32
|
+
<div style={{ maxWidth: 1024, height: 400, display: 'flex', flexDirection: 'column' }}>
|
|
34
33
|
<GridUpdatingContextProvider>
|
|
35
34
|
<GridContextProvider>
|
|
36
35
|
<Story />
|
|
@@ -54,65 +53,65 @@ const GridReadOnlyTemplate: StoryFn<typeof Grid> = (props: GridProps) => {
|
|
|
54
53
|
const [externalSelectedItems, setExternalSelectedItems] = useState<any[]>([]);
|
|
55
54
|
const columnDefs: ColDefT<ITestRow>[] = useMemo(
|
|
56
55
|
() => [
|
|
57
|
-
GridCell<ITestRow, ITestRow[
|
|
58
|
-
field:
|
|
59
|
-
headerName:
|
|
56
|
+
GridCell<ITestRow, ITestRow['id']>({
|
|
57
|
+
field: 'id',
|
|
58
|
+
headerName: 'Id',
|
|
60
59
|
lockVisible: true,
|
|
61
60
|
resizable: false,
|
|
62
|
-
lockPosition:
|
|
63
|
-
cellRenderer: ({ value }) => <a href={
|
|
61
|
+
lockPosition: 'left',
|
|
62
|
+
cellRenderer: ({ value }) => <a href={'#'}>{value}</a>,
|
|
64
63
|
}),
|
|
65
|
-
GridCell<ITestRow, ITestRow[
|
|
66
|
-
field:
|
|
67
|
-
headerName:
|
|
64
|
+
GridCell<ITestRow, ITestRow['position']>({
|
|
65
|
+
field: 'position',
|
|
66
|
+
headerName: 'Position',
|
|
68
67
|
resizable: false,
|
|
69
|
-
lockPosition:
|
|
68
|
+
lockPosition: 'left',
|
|
70
69
|
cellRendererParams: {
|
|
71
|
-
warning: ({ value }) => value ===
|
|
72
|
-
info: ({ value }) => value ===
|
|
70
|
+
warning: ({ value }) => value === 'Tester' && 'Testers are testing',
|
|
71
|
+
info: ({ value }) => value === 'Developer' && 'Developers are awesome',
|
|
73
72
|
},
|
|
74
73
|
}),
|
|
75
74
|
GridCell({
|
|
76
|
-
field:
|
|
77
|
-
headerName:
|
|
75
|
+
field: 'desc',
|
|
76
|
+
headerName: 'Description',
|
|
78
77
|
resizable: false,
|
|
79
|
-
lockPosition:
|
|
78
|
+
lockPosition: 'left',
|
|
80
79
|
}),
|
|
81
80
|
GridCell({
|
|
82
|
-
field:
|
|
83
|
-
headerName:
|
|
81
|
+
field: 'age',
|
|
82
|
+
headerName: 'Age',
|
|
84
83
|
resizable: false,
|
|
85
|
-
lockPosition:
|
|
84
|
+
lockPosition: 'left',
|
|
86
85
|
}),
|
|
87
86
|
GridCell({
|
|
88
|
-
field:
|
|
89
|
-
headerName:
|
|
87
|
+
field: 'height',
|
|
88
|
+
headerName: 'Height',
|
|
90
89
|
resizable: false,
|
|
91
|
-
lockPosition:
|
|
90
|
+
lockPosition: 'left',
|
|
92
91
|
}),
|
|
93
92
|
],
|
|
94
93
|
[],
|
|
95
94
|
);
|
|
96
95
|
|
|
97
96
|
const [rowData] = useState<ITestRow[]>([
|
|
98
|
-
{ id: 1000, position:
|
|
99
|
-
{ id: 1001, position:
|
|
100
|
-
{ id: 1002, position:
|
|
97
|
+
{ id: 1000, position: 'Tester', age: 30, height: `6'4"`, desc: 'Tests application', dd: '1' },
|
|
98
|
+
{ id: 1001, position: 'Developer', age: 12, height: `5'3"`, desc: 'Develops application', dd: '2' },
|
|
99
|
+
{ id: 1002, position: 'Manager', age: 65, height: `5'9"`, desc: 'Manages', dd: '3' },
|
|
101
100
|
]);
|
|
102
101
|
|
|
103
102
|
return (
|
|
104
103
|
<GridWrapper maxHeight={400}>
|
|
105
104
|
<Grid
|
|
106
|
-
data-testid={
|
|
105
|
+
data-testid={'readonly'}
|
|
107
106
|
{...props}
|
|
108
107
|
selectable={false}
|
|
109
|
-
rowSelection={
|
|
108
|
+
rowSelection={'single'}
|
|
110
109
|
externalSelectedItems={externalSelectedItems}
|
|
111
110
|
setExternalSelectedItems={setExternalSelectedItems}
|
|
112
111
|
columnDefs={columnDefs}
|
|
113
112
|
rowData={rowData}
|
|
114
|
-
sizeColumns={
|
|
115
|
-
theme={
|
|
113
|
+
sizeColumns={'fit'}
|
|
114
|
+
theme={'ag-theme-step-view-list-default'}
|
|
116
115
|
contextMenuSelectRow={false}
|
|
117
116
|
suppressCellFocus={true}
|
|
118
117
|
/>
|