@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, useContext, useMemo, useState } from
|
|
7
|
-
|
|
8
|
-
import "@linzjs/lui/dist/fonts";
|
|
6
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
7
|
+
import { useCallback, useContext, useMemo, useState } from 'react';
|
|
9
8
|
|
|
10
9
|
import {
|
|
11
10
|
ActionButton,
|
|
@@ -25,15 +24,15 @@ import {
|
|
|
25
24
|
GridUpdatingContextProvider,
|
|
26
25
|
isFloat,
|
|
27
26
|
wait,
|
|
28
|
-
} from
|
|
29
|
-
import { waitForGridReady } from
|
|
30
|
-
import { IFormTestRow } from
|
|
27
|
+
} from '../..';
|
|
28
|
+
import { waitForGridReady } from '../../utils/__tests__/storybookTestUtil';
|
|
29
|
+
import { IFormTestRow } from './FormTest';
|
|
31
30
|
|
|
32
31
|
export default {
|
|
33
|
-
title:
|
|
32
|
+
title: 'Components / Grids',
|
|
34
33
|
component: Grid,
|
|
35
34
|
args: {
|
|
36
|
-
quickFilterValue:
|
|
35
|
+
quickFilterValue: '',
|
|
37
36
|
selectable: true,
|
|
38
37
|
},
|
|
39
38
|
decorators: [
|
|
@@ -53,34 +52,34 @@ const GridPopoutEditGenericTemplate: StoryFn<typeof Grid> = (props: GridProps) =
|
|
|
53
52
|
const { selectRowsWithFlashDiff } = useContext(GridContext);
|
|
54
53
|
const [externalSelectedItems, setExternalSelectedItems] = useState<any[]>([]);
|
|
55
54
|
const [rowData, setRowData] = useState([
|
|
56
|
-
{ id: 1000, name:
|
|
57
|
-
{ id: 1001, name:
|
|
55
|
+
{ id: 1000, name: 'IS IS DP12345', nameType: 'IS', numba: 'IX', plan: 'DP 12345', distance: 10 },
|
|
56
|
+
{ id: 1001, name: 'PEG V SD523', nameType: 'PEG', numba: 'V', plan: 'SD 523', distance: null },
|
|
58
57
|
] as IFormTestRow[]);
|
|
59
58
|
|
|
60
59
|
const columnDefs: ColDefT<IFormTestRow>[] = useMemo(
|
|
61
60
|
() => [
|
|
62
61
|
GridCell({
|
|
63
|
-
field:
|
|
64
|
-
headerName:
|
|
62
|
+
field: 'id',
|
|
63
|
+
headerName: 'Id',
|
|
65
64
|
}),
|
|
66
65
|
GridPopoverTextInput(
|
|
67
66
|
{
|
|
68
|
-
field:
|
|
69
|
-
headerName:
|
|
67
|
+
field: 'name',
|
|
68
|
+
headerName: 'Text input',
|
|
70
69
|
},
|
|
71
70
|
{
|
|
72
71
|
multiEdit: true,
|
|
73
72
|
editorParams: {
|
|
74
73
|
required: true,
|
|
75
74
|
maxLength: 12,
|
|
76
|
-
placeholder:
|
|
75
|
+
placeholder: 'Enter some text...',
|
|
77
76
|
invalid: (value: string) => {
|
|
78
|
-
if (value ===
|
|
77
|
+
if (value === 'never') return "The value 'never' is not allowed";
|
|
79
78
|
return null;
|
|
80
79
|
},
|
|
81
80
|
onSave: async ({ selectedRows, value }) => {
|
|
82
81
|
await wait(1000);
|
|
83
|
-
selectedRows.forEach((selectedRow) => (selectedRow[
|
|
82
|
+
selectedRows.forEach((selectedRow) => (selectedRow['name'] = value));
|
|
84
83
|
return true;
|
|
85
84
|
},
|
|
86
85
|
},
|
|
@@ -88,27 +87,27 @@ const GridPopoutEditGenericTemplate: StoryFn<typeof Grid> = (props: GridProps) =
|
|
|
88
87
|
),
|
|
89
88
|
GridPopoverTextInput(
|
|
90
89
|
{
|
|
91
|
-
field:
|
|
92
|
-
headerName:
|
|
90
|
+
field: 'distance',
|
|
91
|
+
headerName: 'Number input',
|
|
93
92
|
valueFormatter: (params) => {
|
|
94
93
|
const v = params.data?.distance;
|
|
95
|
-
return v != null ? `${v}${params.colDef.cellEditorParams.units}` :
|
|
94
|
+
return v != null ? `${v}${params.colDef.cellEditorParams.units}` : '–';
|
|
96
95
|
},
|
|
97
96
|
},
|
|
98
97
|
{
|
|
99
98
|
multiEdit: false,
|
|
100
99
|
editorParams: {
|
|
101
100
|
maxLength: 12,
|
|
102
|
-
placeholder:
|
|
103
|
-
units:
|
|
101
|
+
placeholder: 'Enter distance...',
|
|
102
|
+
units: 'm',
|
|
104
103
|
invalid: (value: string) => {
|
|
105
|
-
if (value.length && !isFloat(value)) return
|
|
104
|
+
if (value.length && !isFloat(value)) return 'Value must be a number';
|
|
106
105
|
return null;
|
|
107
106
|
},
|
|
108
107
|
onSave: async ({ selectedRows, value }) => {
|
|
109
108
|
await wait(1000);
|
|
110
109
|
selectedRows.forEach(
|
|
111
|
-
(selectedRow) => (selectedRow[
|
|
110
|
+
(selectedRow) => (selectedRow['distance'] = value.length ? parseFloat(value) : null),
|
|
112
111
|
);
|
|
113
112
|
return true;
|
|
114
113
|
},
|
|
@@ -117,22 +116,22 @@ const GridPopoutEditGenericTemplate: StoryFn<typeof Grid> = (props: GridProps) =
|
|
|
117
116
|
),
|
|
118
117
|
GridPopoverTextArea(
|
|
119
118
|
{
|
|
120
|
-
field:
|
|
121
|
-
headerName:
|
|
119
|
+
field: 'plan',
|
|
120
|
+
headerName: 'Text area',
|
|
122
121
|
},
|
|
123
122
|
{
|
|
124
123
|
multiEdit: true,
|
|
125
124
|
editorParams: {
|
|
126
125
|
required: true,
|
|
127
126
|
maxLength: 32,
|
|
128
|
-
placeholder:
|
|
127
|
+
placeholder: 'Enter some text...',
|
|
129
128
|
invalid: (value: string) => {
|
|
130
|
-
if (value ===
|
|
129
|
+
if (value === 'never') return "The value 'never' is not allowed";
|
|
131
130
|
return null;
|
|
132
131
|
},
|
|
133
132
|
onSave: async ({ selectedRows, value }) => {
|
|
134
133
|
await wait(1000);
|
|
135
|
-
selectedRows.forEach((selectedRow) => (selectedRow[
|
|
134
|
+
selectedRows.forEach((selectedRow) => (selectedRow['plan'] = value));
|
|
136
135
|
return true;
|
|
137
136
|
},
|
|
138
137
|
},
|
|
@@ -140,9 +139,9 @@ const GridPopoutEditGenericTemplate: StoryFn<typeof Grid> = (props: GridProps) =
|
|
|
140
139
|
),
|
|
141
140
|
GridCellMultiEditor(
|
|
142
141
|
{
|
|
143
|
-
colId:
|
|
144
|
-
field:
|
|
145
|
-
headerName:
|
|
142
|
+
colId: 'plan2',
|
|
143
|
+
field: 'plan',
|
|
144
|
+
headerName: 'Multi-editor',
|
|
146
145
|
},
|
|
147
146
|
(_params) =>
|
|
148
147
|
_params.rowIndex == 0
|
|
@@ -152,27 +151,27 @@ const GridPopoutEditGenericTemplate: StoryFn<typeof Grid> = (props: GridProps) =
|
|
|
152
151
|
editorParams: {
|
|
153
152
|
required: true,
|
|
154
153
|
maxLength: 32,
|
|
155
|
-
placeholder:
|
|
154
|
+
placeholder: 'Enter some text...',
|
|
156
155
|
},
|
|
157
156
|
})
|
|
158
157
|
: Editor({
|
|
159
158
|
multiEdit: false,
|
|
160
159
|
editor: GridFormDropDown,
|
|
161
160
|
editorParams: {
|
|
162
|
-
options: [{ label:
|
|
161
|
+
options: [{ label: 'One', value: 1 }],
|
|
163
162
|
},
|
|
164
163
|
}),
|
|
165
164
|
),
|
|
166
165
|
GridPopoverMenu(
|
|
167
166
|
{
|
|
168
|
-
headerName:
|
|
167
|
+
headerName: '',
|
|
169
168
|
},
|
|
170
169
|
{
|
|
171
170
|
multiEdit: true,
|
|
172
171
|
editorParams: {
|
|
173
|
-
options:
|
|
172
|
+
options: () => [
|
|
174
173
|
{
|
|
175
|
-
label:
|
|
174
|
+
label: 'Delete',
|
|
176
175
|
action: async ({ selectedRows }) => {
|
|
177
176
|
await wait(1000);
|
|
178
177
|
setRowData(rowData.filter((data) => !selectedRows.some((row) => row.id == data.id)));
|
|
@@ -190,16 +189,18 @@ const GridPopoutEditGenericTemplate: StoryFn<typeof Grid> = (props: GridProps) =
|
|
|
190
189
|
await wait(1000);
|
|
191
190
|
|
|
192
191
|
const lastRow = rowData[rowData.length - 1];
|
|
192
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
193
193
|
await selectRowsWithFlashDiff(async () => {
|
|
194
194
|
setRowData([
|
|
195
195
|
...rowData,
|
|
196
196
|
{
|
|
197
197
|
id: (lastRow?.id ?? 0) + 1,
|
|
198
|
-
name:
|
|
199
|
-
nameType:
|
|
200
|
-
numba:
|
|
201
|
-
plan:
|
|
198
|
+
name: '?',
|
|
199
|
+
nameType: '?',
|
|
200
|
+
numba: '?',
|
|
201
|
+
plan: '',
|
|
202
202
|
distance: null,
|
|
203
|
+
bold: false,
|
|
203
204
|
},
|
|
204
205
|
]);
|
|
205
206
|
});
|
|
@@ -213,15 +214,15 @@ const GridPopoutEditGenericTemplate: StoryFn<typeof Grid> = (props: GridProps) =
|
|
|
213
214
|
setExternalSelectedItems={setExternalSelectedItems}
|
|
214
215
|
columnDefs={columnDefs}
|
|
215
216
|
rowData={rowData}
|
|
216
|
-
domLayout={
|
|
217
|
+
domLayout={'autoHeight'}
|
|
217
218
|
defaultColDef={{ minWidth: 70 }}
|
|
218
|
-
sizeColumns={
|
|
219
|
+
sizeColumns={'auto'}
|
|
219
220
|
onCellEditingComplete={() => {
|
|
220
221
|
/* eslint-disable-next-line no-console */
|
|
221
|
-
console.log(
|
|
222
|
+
console.log('Cell editing complete');
|
|
222
223
|
}}
|
|
223
224
|
/>
|
|
224
|
-
<ActionButton icon={
|
|
225
|
+
<ActionButton icon={'ic_add'} name={'Add new row'} inProgressName={'Adding...'} onClick={addRowAction} />
|
|
225
226
|
</>
|
|
226
227
|
);
|
|
227
228
|
};
|
|
@@ -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,
|
|
@@ -22,14 +21,14 @@ import {
|
|
|
22
21
|
GridUpdatingContextProvider,
|
|
23
22
|
GridWrapper,
|
|
24
23
|
wait,
|
|
25
|
-
} from
|
|
26
|
-
import { waitForGridReady } from
|
|
24
|
+
} from '../..';
|
|
25
|
+
import { waitForGridReady } from '../../utils/__tests__/storybookTestUtil';
|
|
27
26
|
|
|
28
27
|
export default {
|
|
29
|
-
title:
|
|
28
|
+
title: 'Components / Grids',
|
|
30
29
|
component: Grid,
|
|
31
30
|
args: {
|
|
32
|
-
quickFilterValue:
|
|
31
|
+
quickFilterValue: '',
|
|
33
32
|
selectable: true,
|
|
34
33
|
alwaysShowVerticalScroll: false,
|
|
35
34
|
},
|
|
@@ -57,16 +56,16 @@ const GridPopoverEditBearingTemplate: 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
|
GridPopoverEditBearingCorrection(
|
|
64
63
|
{
|
|
65
|
-
field:
|
|
66
|
-
headerName:
|
|
64
|
+
field: 'bearingCorrection',
|
|
65
|
+
headerName: 'Bearing correction',
|
|
67
66
|
cellRendererParams: {
|
|
68
|
-
warning: ({ data }) => data?.id == 1002 &&
|
|
69
|
-
info: ({ data }) => data?.id == 1001 &&
|
|
67
|
+
warning: ({ data }) => data?.id == 1002 && 'Testers are testing',
|
|
68
|
+
info: ({ data }) => data?.id == 1001 && 'Developers are developing',
|
|
70
69
|
},
|
|
71
70
|
},
|
|
72
71
|
{
|
|
@@ -75,14 +74,14 @@ const GridPopoverEditBearingTemplate: StoryFn<typeof Grid> = (props: GridProps)
|
|
|
75
74
|
),
|
|
76
75
|
GridPopoverEditBearing(
|
|
77
76
|
{
|
|
78
|
-
field:
|
|
79
|
-
headerName:
|
|
77
|
+
field: 'bearing',
|
|
78
|
+
headerName: 'Bearing',
|
|
80
79
|
},
|
|
81
80
|
{
|
|
82
81
|
editorParams: {
|
|
83
82
|
onSave: async ({ selectedRows, value }) => {
|
|
84
83
|
await wait(1000);
|
|
85
|
-
selectedRows.forEach((row) => (row[
|
|
84
|
+
selectedRows.forEach((row) => (row['bearing'] = value));
|
|
86
85
|
return true;
|
|
87
86
|
},
|
|
88
87
|
},
|
|
@@ -94,11 +93,11 @@ const GridPopoverEditBearingTemplate: StoryFn<typeof Grid> = (props: GridProps)
|
|
|
94
93
|
|
|
95
94
|
const [rowData] = useState([
|
|
96
95
|
{ id: 1000, bearing: 1.234, bearingCorrection: null },
|
|
97
|
-
{ id: 1001, bearing:
|
|
96
|
+
{ id: 1001, bearing: '0E-12', bearingCorrection: 240 },
|
|
98
97
|
{ id: 1002, bearing: null, bearingCorrection: 355.1 },
|
|
99
98
|
{ id: 1003, bearing: null, bearingCorrection: 0 },
|
|
100
|
-
{ id: 1004, bearing: 5.0, bearingCorrection:
|
|
101
|
-
{ id: 1005, bearing: null, bearingCorrection:
|
|
99
|
+
{ id: 1004, bearing: 5.0, bearingCorrection: '1.00500' },
|
|
100
|
+
{ id: 1005, bearing: null, bearingCorrection: '0E-12' },
|
|
102
101
|
] as ITestRow[]);
|
|
103
102
|
|
|
104
103
|
return (
|
|
@@ -106,17 +105,17 @@ const GridPopoverEditBearingTemplate: StoryFn<typeof Grid> = (props: GridProps)
|
|
|
106
105
|
<GridFilters>
|
|
107
106
|
<GridFilterQuick />
|
|
108
107
|
<GridFilterColumnsToggle />
|
|
109
|
-
<GridFilterDownloadCsvButton fileName={
|
|
108
|
+
<GridFilterDownloadCsvButton fileName={'customFilename'} />
|
|
110
109
|
</GridFilters>
|
|
111
110
|
<Grid
|
|
112
|
-
data-testid={
|
|
111
|
+
data-testid={'bearingsTestTable'}
|
|
113
112
|
{...props}
|
|
114
113
|
readOnly={false}
|
|
115
114
|
externalSelectedItems={externalSelectedItems}
|
|
116
115
|
setExternalSelectedItems={setExternalSelectedItems}
|
|
117
116
|
columnDefs={columnDefs}
|
|
118
117
|
rowData={rowData}
|
|
119
|
-
domLayout={
|
|
118
|
+
domLayout={'autoHeight'}
|
|
120
119
|
/>
|
|
121
120
|
</GridWrapper>
|
|
122
121
|
);
|