@linzjs/step-ag-grid 23.0.1 → 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,18 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import '../../../react-menu3/styles/index.scss';
|
|
2
|
+
import '../../../styles/index.scss';
|
|
3
|
+
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
+
import '@linzjs/lui/dist/fonts';
|
|
4
5
|
|
|
5
|
-
import { StoryFn } from
|
|
6
|
-
import { expect, fn, userEvent, within } from
|
|
7
|
-
import { GridPopoverContext } from
|
|
8
|
-
import { useRef } from
|
|
6
|
+
import { StoryFn } from '@storybook/react';
|
|
7
|
+
import { expect, fn, userEvent, within } from '@storybook/test';
|
|
8
|
+
import { GridPopoverContext } from 'contexts/GridPopoverContext';
|
|
9
|
+
import { useRef } from 'react';
|
|
9
10
|
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
import { GridContext, GridFormDropDown, GridFormDropDownProps, GridFormSubComponentTextInput } from "../../..";
|
|
11
|
+
import { GridContext, GridFormDropDown, GridFormDropDownProps, GridFormSubComponentTextInput } from '../../..';
|
|
13
12
|
|
|
14
13
|
export default {
|
|
15
|
-
title:
|
|
14
|
+
title: 'GridForm / Interactions',
|
|
16
15
|
component: GridFormDropDown,
|
|
17
16
|
args: {},
|
|
18
17
|
};
|
|
@@ -25,16 +24,16 @@ const onSelectedItem = fn(async () => {});
|
|
|
25
24
|
|
|
26
25
|
const Template: StoryFn<typeof GridFormDropDown> = (props: GridFormDropDownProps<any>) => {
|
|
27
26
|
const config: GridFormDropDownProps<any> = {
|
|
28
|
-
filtered:
|
|
27
|
+
filtered: 'local',
|
|
29
28
|
onSelectedItem,
|
|
30
29
|
options: [
|
|
31
|
-
{ label:
|
|
32
|
-
{ label:
|
|
30
|
+
{ label: 'Enabled', value: 1 },
|
|
31
|
+
{ label: 'Disabled', value: 0, disabled: true },
|
|
33
32
|
{
|
|
34
|
-
label:
|
|
33
|
+
label: 'Sub menu',
|
|
35
34
|
value: 0,
|
|
36
35
|
subComponent: () => (
|
|
37
|
-
<GridFormSubComponentTextInput placeholder={
|
|
36
|
+
<GridFormSubComponentTextInput placeholder={'Text input'} maxLength={5} required defaultValue={''} />
|
|
38
37
|
),
|
|
39
38
|
},
|
|
40
39
|
],
|
|
@@ -42,7 +41,7 @@ const Template: StoryFn<typeof GridFormDropDown> = (props: GridFormDropDownProps
|
|
|
42
41
|
const anchorRef = useRef<HTMLHeadingElement>(null);
|
|
43
42
|
|
|
44
43
|
return (
|
|
45
|
-
<div className={
|
|
44
|
+
<div className={'react-menu-inline-test'}>
|
|
46
45
|
<GridContext.Provider
|
|
47
46
|
value={
|
|
48
47
|
{
|
|
@@ -56,12 +55,12 @@ const Template: StoryFn<typeof GridFormDropDown> = (props: GridFormDropDownProps
|
|
|
56
55
|
value={{
|
|
57
56
|
anchorRef,
|
|
58
57
|
updateValue,
|
|
59
|
-
data: { value:
|
|
60
|
-
colId:
|
|
61
|
-
value:
|
|
62
|
-
field:
|
|
58
|
+
data: { value: '' },
|
|
59
|
+
colId: '',
|
|
60
|
+
value: '',
|
|
61
|
+
field: 'value',
|
|
63
62
|
selectedRows: [],
|
|
64
|
-
formatValue: () =>
|
|
63
|
+
formatValue: () => '',
|
|
65
64
|
saving: false,
|
|
66
65
|
setSaving: () => {},
|
|
67
66
|
}}
|
|
@@ -78,10 +77,10 @@ export const GridFormDropDownInteractions_: typeof Template = Template.bind({});
|
|
|
78
77
|
GridFormDropDownInteractions_.play = async ({ canvasElement }) => {
|
|
79
78
|
const canvas = within(canvasElement);
|
|
80
79
|
|
|
81
|
-
const getOption = (name: string) => canvas.findByRole(
|
|
80
|
+
const getOption = (name: string) => canvas.findByRole('menuitem', { name });
|
|
82
81
|
|
|
83
82
|
// Check enabled menu handles click
|
|
84
|
-
const enabledMenuOption = await getOption(
|
|
83
|
+
const enabledMenuOption = await getOption('Enabled');
|
|
85
84
|
expect(enabledMenuOption).toBeInTheDocument();
|
|
86
85
|
|
|
87
86
|
await userEvent.click(enabledMenuOption);
|
|
@@ -91,24 +90,24 @@ GridFormDropDownInteractions_.play = async ({ canvasElement }) => {
|
|
|
91
90
|
// Check disabled menu ignores click
|
|
92
91
|
updateValue.mockClear();
|
|
93
92
|
onSelectedItem.mockClear();
|
|
94
|
-
const disabledMenuOption = await getOption(
|
|
93
|
+
const disabledMenuOption = await getOption('Disabled');
|
|
95
94
|
await userEvent.click(disabledMenuOption);
|
|
96
95
|
expect(updateValue).not.toHaveBeenCalled();
|
|
97
96
|
expect(onSelectedItem).not.toHaveBeenCalled();
|
|
98
97
|
|
|
99
98
|
// Check sub menu works
|
|
100
|
-
const subTextInput = await getOption(
|
|
99
|
+
const subTextInput = await getOption('Sub menu...');
|
|
101
100
|
expect(subTextInput).toBeInTheDocument();
|
|
102
101
|
|
|
103
|
-
expect(canvas.queryByPlaceholderText(
|
|
102
|
+
expect(canvas.queryByPlaceholderText('Text input')).not.toBeInTheDocument();
|
|
104
103
|
|
|
105
104
|
await userEvent.click(subTextInput);
|
|
106
|
-
const textInput = await canvas.findByPlaceholderText(
|
|
105
|
+
const textInput = await canvas.findByPlaceholderText('Text input');
|
|
107
106
|
expect(textInput).toBeInTheDocument();
|
|
108
|
-
expect(await canvas.findByText(
|
|
107
|
+
expect(await canvas.findByText('Must not be empty')).toBeInTheDocument();
|
|
109
108
|
|
|
110
|
-
await userEvent.type(textInput,
|
|
111
|
-
expect(await canvas.findByText(
|
|
109
|
+
await userEvent.type(textInput, 'Hello');
|
|
110
|
+
expect(await canvas.findByText('Press enter or tab to save')).toBeInTheDocument();
|
|
112
111
|
|
|
113
112
|
// Test tab to save
|
|
114
113
|
updateValue.mockClear();
|
|
@@ -122,19 +121,19 @@ GridFormDropDownInteractions_.play = async ({ canvasElement }) => {
|
|
|
122
121
|
|
|
123
122
|
// Test escape to not save
|
|
124
123
|
updateValue.mockClear();
|
|
125
|
-
await userEvent.type(textInput,
|
|
124
|
+
await userEvent.type(textInput, '{Escape}');
|
|
126
125
|
expect(updateValue).not.toHaveBeenCalled();
|
|
127
126
|
|
|
128
127
|
// Test invalid value doesn't save
|
|
129
128
|
updateValue.mockClear();
|
|
130
129
|
await userEvent.clear(textInput);
|
|
131
|
-
await userEvent.type(textInput,
|
|
130
|
+
await userEvent.type(textInput, '{Enter}');
|
|
132
131
|
expect(updateValue).not.toHaveBeenCalled();
|
|
133
132
|
|
|
134
133
|
// Test filter
|
|
135
|
-
const filterText = await canvas.findByPlaceholderText(
|
|
136
|
-
await userEvent.type(filterText,
|
|
137
|
-
expect(canvas.queryByText(
|
|
138
|
-
expect(canvas.queryByText(
|
|
139
|
-
expect(canvas.queryByText(
|
|
134
|
+
const filterText = await canvas.findByPlaceholderText('Filter...');
|
|
135
|
+
await userEvent.type(filterText, 'ena');
|
|
136
|
+
expect(canvas.queryByText('Enabled')).toBeInTheDocument();
|
|
137
|
+
expect(canvas.queryByText('Disabled')).not.toBeInTheDocument();
|
|
138
|
+
expect(canvas.queryByText('Sub menu...')).not.toBeInTheDocument();
|
|
140
139
|
};
|
package/src/stories/grid/gridFormInteraction/GridFormEditBearingCorrectionInteraction.stories.tsx
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import '../../../react-menu3/styles/index.scss';
|
|
2
|
+
import '../../../styles/index.scss';
|
|
3
|
+
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
+
import '@linzjs/lui/dist/fonts';
|
|
4
5
|
|
|
5
|
-
import { StoryFn } from
|
|
6
|
-
import { expect, fn, userEvent, within } from
|
|
7
|
-
import { GridPopoverContext } from
|
|
8
|
-
import { useRef } from
|
|
9
|
-
|
|
10
|
-
import "@linzjs/lui/dist/fonts";
|
|
6
|
+
import { StoryFn } from '@storybook/react';
|
|
7
|
+
import { expect, fn, userEvent, within } from '@storybook/test';
|
|
8
|
+
import { GridPopoverContext } from 'contexts/GridPopoverContext';
|
|
9
|
+
import { useRef } from 'react';
|
|
11
10
|
|
|
12
11
|
import {
|
|
13
12
|
GridContext,
|
|
14
13
|
GridFormEditBearing,
|
|
15
14
|
GridFormEditBearingProps,
|
|
16
15
|
GridPopoverEditBearingCorrectionEditorParams,
|
|
17
|
-
} from
|
|
16
|
+
} from '../../..';
|
|
18
17
|
|
|
19
18
|
export default {
|
|
20
|
-
title:
|
|
19
|
+
title: 'GridForm / Interactions',
|
|
21
20
|
component: GridFormEditBearing,
|
|
22
21
|
args: {},
|
|
23
22
|
};
|
|
@@ -28,7 +27,7 @@ const Template: StoryFn<typeof GridFormEditBearing> = (props: GridFormEditBearin
|
|
|
28
27
|
const anchorRef = useRef<HTMLHeadingElement>(null);
|
|
29
28
|
|
|
30
29
|
return (
|
|
31
|
-
<div className={
|
|
30
|
+
<div className={'react-menu-inline-test'}>
|
|
32
31
|
<GridContext.Provider
|
|
33
32
|
value={
|
|
34
33
|
{
|
|
@@ -41,15 +40,15 @@ const Template: StoryFn<typeof GridFormEditBearing> = (props: GridFormEditBearin
|
|
|
41
40
|
<GridPopoverContext.Provider
|
|
42
41
|
value={{
|
|
43
42
|
anchorRef,
|
|
44
|
-
colId:
|
|
43
|
+
colId: '',
|
|
45
44
|
value: null,
|
|
46
45
|
updateValue,
|
|
47
46
|
formatValue: (value) => value,
|
|
48
47
|
setSaving: () => {},
|
|
49
48
|
saving: false,
|
|
50
49
|
selectedRows: [],
|
|
51
|
-
data: { value:
|
|
52
|
-
field:
|
|
50
|
+
data: { value: '' },
|
|
51
|
+
field: 'value',
|
|
53
52
|
}}
|
|
54
53
|
>
|
|
55
54
|
<GridFormEditBearing {...props} {...GridPopoverEditBearingCorrectionEditorParams} />
|
|
@@ -63,21 +62,21 @@ export const GridFormEditBearingCorrectionInteractions_: typeof Template = Templ
|
|
|
63
62
|
GridFormEditBearingCorrectionInteractions_.play = async ({ canvasElement }) => {
|
|
64
63
|
const canvas = within(canvasElement);
|
|
65
64
|
|
|
66
|
-
expect(await canvas.findByText(
|
|
65
|
+
expect(await canvas.findByText('Press enter or tab to save')).toBeInTheDocument();
|
|
67
66
|
|
|
68
|
-
const inputField = canvas.getByPlaceholderText(
|
|
67
|
+
const inputField = canvas.getByPlaceholderText('Enter bearing correction');
|
|
69
68
|
|
|
70
69
|
// Test formatting null
|
|
71
|
-
expect(await canvas.findByText(
|
|
70
|
+
expect(await canvas.findByText('–')).toBeInTheDocument();
|
|
72
71
|
|
|
73
72
|
// Test formatting a bearing
|
|
74
73
|
expect(inputField).toBeInTheDocument();
|
|
75
|
-
await userEvent.type(inputField,
|
|
76
|
-
expect(await canvas.findByText(
|
|
74
|
+
await userEvent.type(inputField, '1.2345');
|
|
75
|
+
expect(await canvas.findByText('+1° 23\' 45"')).toBeInTheDocument();
|
|
77
76
|
|
|
78
77
|
// Test enter to save
|
|
79
78
|
updateValue.mockClear();
|
|
80
|
-
await userEvent.type(inputField,
|
|
79
|
+
await userEvent.type(inputField, '{Enter}');
|
|
81
80
|
expect(updateValue).toHaveBeenCalledWith(expect.anything(), 0); // 0 = Enter
|
|
82
81
|
|
|
83
82
|
// Test tab to save
|
|
@@ -92,16 +91,16 @@ GridFormEditBearingCorrectionInteractions_.play = async ({ canvasElement }) => {
|
|
|
92
91
|
|
|
93
92
|
// Test escape not to save
|
|
94
93
|
updateValue.mockClear();
|
|
95
|
-
await userEvent.type(inputField,
|
|
94
|
+
await userEvent.type(inputField, '{Escape}');
|
|
96
95
|
expect(updateValue).not.toHaveBeenCalled();
|
|
97
96
|
|
|
98
97
|
// Test invalid value doesn't save
|
|
99
98
|
updateValue.mockClear();
|
|
100
|
-
await userEvent.type(inputField,
|
|
101
|
-
expect(await canvas.findByText(
|
|
99
|
+
await userEvent.type(inputField, 'xxx');
|
|
100
|
+
expect(await canvas.findByText('?')).toBeInTheDocument();
|
|
102
101
|
|
|
103
|
-
expect(canvas.getByText(
|
|
104
|
-
await userEvent.type(inputField,
|
|
102
|
+
expect(canvas.getByText('Bearing must be a number in D.MMSSS format')).toBeInTheDocument();
|
|
103
|
+
await userEvent.type(inputField, '{Enter}');
|
|
105
104
|
expect(updateValue).not.toHaveBeenCalled();
|
|
106
105
|
await userEvent.tab();
|
|
107
106
|
expect(updateValue).not.toHaveBeenCalled();
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import '../../../react-menu3/styles/index.scss';
|
|
2
|
+
import '../../../styles/index.scss';
|
|
3
|
+
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
+
import '@linzjs/lui/dist/fonts';
|
|
4
5
|
|
|
5
|
-
import { StoryFn } from
|
|
6
|
-
import { expect, fn, userEvent, within } from
|
|
7
|
-
import { GridPopoverContext } from
|
|
8
|
-
import { useRef } from
|
|
9
|
-
|
|
10
|
-
import "@linzjs/lui/dist/fonts";
|
|
6
|
+
import { StoryFn } from '@storybook/react';
|
|
7
|
+
import { expect, fn, userEvent, within } from '@storybook/test';
|
|
8
|
+
import { GridPopoverContext } from 'contexts/GridPopoverContext';
|
|
9
|
+
import { useRef } from 'react';
|
|
11
10
|
|
|
12
11
|
import {
|
|
13
12
|
GridContext,
|
|
14
13
|
GridFormEditBearing,
|
|
15
14
|
GridFormEditBearingProps,
|
|
16
15
|
GridPopoverEditBearingEditorParams,
|
|
17
|
-
} from
|
|
16
|
+
} from '../../..';
|
|
18
17
|
|
|
19
18
|
export default {
|
|
20
|
-
title:
|
|
19
|
+
title: 'GridForm / Interactions',
|
|
21
20
|
component: GridFormEditBearing,
|
|
22
21
|
args: {},
|
|
23
22
|
};
|
|
@@ -28,7 +27,7 @@ const Template: StoryFn<typeof GridFormEditBearing> = (props: GridFormEditBearin
|
|
|
28
27
|
const anchorRef = useRef<HTMLHeadingElement>(null);
|
|
29
28
|
|
|
30
29
|
return (
|
|
31
|
-
<div className={
|
|
30
|
+
<div className={'react-menu-inline-test'}>
|
|
32
31
|
<GridContext.Provider
|
|
33
32
|
value={
|
|
34
33
|
{
|
|
@@ -41,15 +40,15 @@ const Template: StoryFn<typeof GridFormEditBearing> = (props: GridFormEditBearin
|
|
|
41
40
|
<GridPopoverContext.Provider
|
|
42
41
|
value={{
|
|
43
42
|
anchorRef,
|
|
44
|
-
colId:
|
|
43
|
+
colId: '',
|
|
45
44
|
value: null,
|
|
46
45
|
updateValue,
|
|
47
46
|
formatValue: (value) => value,
|
|
48
47
|
setSaving: () => {},
|
|
49
48
|
saving: false,
|
|
50
49
|
selectedRows: [],
|
|
51
|
-
data: { value:
|
|
52
|
-
field:
|
|
50
|
+
data: { value: '' },
|
|
51
|
+
field: 'value',
|
|
53
52
|
}}
|
|
54
53
|
>
|
|
55
54
|
<GridFormEditBearing {...props} {...GridPopoverEditBearingEditorParams} />
|
|
@@ -63,21 +62,21 @@ export const GridFormEditBearingInteractions_: typeof Template = Template.bind({
|
|
|
63
62
|
GridFormEditBearingInteractions_.play = async ({ canvasElement }) => {
|
|
64
63
|
const canvas = within(canvasElement);
|
|
65
64
|
|
|
66
|
-
expect(await canvas.findByText(
|
|
65
|
+
expect(await canvas.findByText('Press enter or tab to save')).toBeInTheDocument();
|
|
67
66
|
|
|
68
|
-
const inputField = canvas.getByPlaceholderText(
|
|
67
|
+
const inputField = canvas.getByPlaceholderText('Enter bearing');
|
|
69
68
|
|
|
70
69
|
// Test formatting null
|
|
71
|
-
expect(await canvas.findByText(
|
|
70
|
+
expect(await canvas.findByText('–')).toBeInTheDocument();
|
|
72
71
|
|
|
73
72
|
// Test formatting a bearing
|
|
74
73
|
expect(inputField).toBeInTheDocument();
|
|
75
|
-
await userEvent.type(inputField,
|
|
76
|
-
expect(await canvas.findByText(
|
|
74
|
+
await userEvent.type(inputField, '1.2345');
|
|
75
|
+
expect(await canvas.findByText('1° 23\' 45"')).toBeInTheDocument();
|
|
77
76
|
|
|
78
77
|
// Test enter to save
|
|
79
78
|
updateValue.mockClear();
|
|
80
|
-
await userEvent.type(inputField,
|
|
79
|
+
await userEvent.type(inputField, '{Enter}');
|
|
81
80
|
expect(updateValue).toHaveBeenCalledWith(expect.anything(), 0); // 0 = Enter
|
|
82
81
|
|
|
83
82
|
// Test tab to save
|
|
@@ -92,15 +91,15 @@ GridFormEditBearingInteractions_.play = async ({ canvasElement }) => {
|
|
|
92
91
|
|
|
93
92
|
// Test escape not to save
|
|
94
93
|
updateValue.mockClear();
|
|
95
|
-
await userEvent.type(inputField,
|
|
94
|
+
await userEvent.type(inputField, '{Escape}');
|
|
96
95
|
expect(updateValue).not.toHaveBeenCalled();
|
|
97
96
|
|
|
98
97
|
// Test invalid value doesn't save
|
|
99
98
|
updateValue.mockClear();
|
|
100
|
-
await userEvent.type(inputField,
|
|
101
|
-
expect(await canvas.findByText(
|
|
102
|
-
expect(canvas.getByText(
|
|
103
|
-
await userEvent.type(inputField,
|
|
99
|
+
await userEvent.type(inputField, 'xxx');
|
|
100
|
+
expect(await canvas.findByText('?')).toBeInTheDocument();
|
|
101
|
+
expect(canvas.getByText('Bearing must be a number in D.MMSSS format')).toBeInTheDocument();
|
|
102
|
+
await userEvent.type(inputField, '{Enter}');
|
|
104
103
|
expect(updateValue).not.toHaveBeenCalled();
|
|
105
104
|
await userEvent.tab();
|
|
106
105
|
expect(updateValue).not.toHaveBeenCalled();
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import '../../../react-menu3/styles/index.scss';
|
|
2
|
+
import '../../../styles/index.scss';
|
|
3
|
+
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
+
import '@linzjs/lui/dist/fonts';
|
|
4
5
|
|
|
5
|
-
import { StoryFn } from
|
|
6
|
-
import { expect, fn, userEvent, waitFor, within } from
|
|
7
|
-
import { GridPopoverContext } from
|
|
8
|
-
import { useRef } from
|
|
6
|
+
import { StoryFn } from '@storybook/react';
|
|
7
|
+
import { expect, fn, userEvent, waitFor, within } from '@storybook/test';
|
|
8
|
+
import { GridPopoverContext } from 'contexts/GridPopoverContext';
|
|
9
|
+
import { useRef } from 'react';
|
|
9
10
|
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
import { GridContext, GridFormMultiSelectGrid, GridFormMultiSelectGridProps, MultiSelectGridOption } from "../../..";
|
|
11
|
+
import { GridContext, GridFormMultiSelectGrid, GridFormMultiSelectGridProps, MultiSelectGridOption } from '../../..';
|
|
13
12
|
|
|
14
13
|
export default {
|
|
15
|
-
title:
|
|
14
|
+
title: 'GridForm / Interactions',
|
|
16
15
|
component: GridFormMultiSelectGrid,
|
|
17
16
|
args: {},
|
|
18
17
|
};
|
|
19
18
|
|
|
20
19
|
const updateValue = fn((saveFn: (selectedRows: any[]) => Promise<boolean>, _tabDirection: 1 | 0 | -1) => saveFn([]));
|
|
21
20
|
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
22
22
|
const onSave = fn(async () => true);
|
|
23
23
|
const onSelectFilter = fn();
|
|
24
24
|
|
|
@@ -26,11 +26,11 @@ const five = <div>Five</div>;
|
|
|
26
26
|
let options: MultiSelectGridOption[] = [];
|
|
27
27
|
const Template: StoryFn<typeof GridFormMultiSelectGrid> = (props: GridFormMultiSelectGridProps<any>) => {
|
|
28
28
|
options = [
|
|
29
|
-
{ label:
|
|
30
|
-
{ label:
|
|
31
|
-
{ label:
|
|
32
|
-
{ label:
|
|
33
|
-
{ label:
|
|
29
|
+
{ label: 'Zero', value: 0 },
|
|
30
|
+
{ label: 'One', value: 1 },
|
|
31
|
+
{ label: 'Two', value: 2 },
|
|
32
|
+
{ label: 'Three', value: 3 },
|
|
33
|
+
{ label: 'Four', value: 4 },
|
|
34
34
|
{ label: five, value: 5 },
|
|
35
35
|
];
|
|
36
36
|
const config: GridFormMultiSelectGridProps<any> = {
|
|
@@ -41,7 +41,7 @@ const Template: StoryFn<typeof GridFormMultiSelectGrid> = (props: GridFormMultiS
|
|
|
41
41
|
const anchorRef = useRef<HTMLHeadingElement>(null);
|
|
42
42
|
|
|
43
43
|
return (
|
|
44
|
-
<div className={
|
|
44
|
+
<div className={'react-menu-inline-test'}>
|
|
45
45
|
<GridContext.Provider
|
|
46
46
|
value={
|
|
47
47
|
{
|
|
@@ -55,14 +55,14 @@ const Template: StoryFn<typeof GridFormMultiSelectGrid> = (props: GridFormMultiS
|
|
|
55
55
|
value={{
|
|
56
56
|
anchorRef: anchorRef,
|
|
57
57
|
updateValue,
|
|
58
|
-
colId:
|
|
59
|
-
value:
|
|
58
|
+
colId: '',
|
|
59
|
+
value: '',
|
|
60
60
|
selectedRows: [],
|
|
61
61
|
formatValue: (value) => value,
|
|
62
62
|
setSaving: () => {},
|
|
63
63
|
saving: false,
|
|
64
|
-
data: { value:
|
|
65
|
-
field:
|
|
64
|
+
data: { value: '' },
|
|
65
|
+
field: 'value',
|
|
66
66
|
}}
|
|
67
67
|
>
|
|
68
68
|
<GridFormMultiSelectGrid {...props} {...config} />
|
|
@@ -80,14 +80,14 @@ GridFormMultiSelectGridInteractions_.play = async ({ canvasElement }) => {
|
|
|
80
80
|
|
|
81
81
|
const canvas = within(canvasElement);
|
|
82
82
|
|
|
83
|
-
const getOption = (name: RegExp | string) => canvas.findByRole(
|
|
83
|
+
const getOption = (name: RegExp | string) => canvas.findByRole('menuitem', { name });
|
|
84
84
|
|
|
85
85
|
// Check enabled menu handles click
|
|
86
86
|
const zeroMenuOption = await getOption(/Zero/);
|
|
87
87
|
expect(zeroMenuOption).toBeInTheDocument();
|
|
88
88
|
|
|
89
89
|
await userEvent.click(zeroMenuOption);
|
|
90
|
-
await userEvent.keyboard(
|
|
90
|
+
await userEvent.keyboard('{Tab}');
|
|
91
91
|
expect(updateValue).toHaveBeenCalled();
|
|
92
92
|
await waitFor(() => expect(onSave).toHaveBeenCalledWith({ selectedRows: [], addValues: [0], removeValues: [] }));
|
|
93
93
|
|
|
@@ -97,14 +97,14 @@ GridFormMultiSelectGridInteractions_.play = async ({ canvasElement }) => {
|
|
|
97
97
|
};
|
|
98
98
|
|
|
99
99
|
// Test left/right arrow
|
|
100
|
-
await userEvent.keyboard(
|
|
101
|
-
check(
|
|
102
|
-
await userEvent.keyboard(
|
|
103
|
-
check(
|
|
104
|
-
await userEvent.keyboard(
|
|
105
|
-
check(
|
|
106
|
-
await userEvent.keyboard(
|
|
107
|
-
check(
|
|
100
|
+
await userEvent.keyboard('{ArrowRight}');
|
|
101
|
+
check('Three');
|
|
102
|
+
await userEvent.keyboard('{ArrowRight}');
|
|
103
|
+
check('Zero');
|
|
104
|
+
await userEvent.keyboard('{ArrowLeft}');
|
|
105
|
+
check('Three');
|
|
106
|
+
await userEvent.keyboard('{ArrowLeft}');
|
|
107
|
+
check('Zero');
|
|
108
108
|
|
|
109
109
|
// Test tab to save
|
|
110
110
|
updateValue.mockClear();
|