@linzjs/step-ag-grid 32.7.1 → 34.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/PostSortRowsHook.test.d.ts +1 -0
- package/dist/src/components/gridFilter/GridFilterColumnsMultiSelect.d.ts +6 -25
- package/dist/src/components/gridForm/GridFormTextInput.d.ts +2 -1
- package/dist/src/utils/__tests__/storybookTestUtil.ts +1 -1
- package/dist/step-ag-grid.cjs +190 -206
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +190 -206
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +17 -17
- package/src/components/Grid.tsx +8 -10
- package/src/components/PostSortRowsHook.test.ts +300 -0
- package/src/components/PostSortRowsHook.ts +127 -24
- package/src/components/gridFilter/GridFilterColumnsMultiSelect.tsx +110 -199
- package/src/components/gridForm/GridFormTextInput.tsx +2 -1
- package/src/components/gridHook/useGridRangeSelection.ts +8 -6
- package/src/contexts/GridContextProvider.tsx +5 -9
- package/src/react-menu3/components/ControlledMenu.tsx +5 -3
- package/src/react-menu3/components/MenuList.tsx +7 -3
- package/src/react-menu3/hooks/useItems.ts +1 -1
- package/src/stories/components/ActionButton.stories.tsx +12 -11
- package/src/stories/decorators/withOpenInPanelDecorator.tsx +35 -0
- package/src/stories/grid/GridCopy.stories.tsx +38 -35
- package/src/stories/grid/GridDragRow.stories.tsx +41 -36
- package/src/stories/grid/GridFilterButtons.stories.tsx +25 -19
- package/src/stories/grid/GridFilterColumnsMultiSelect.stories.tsx +42 -37
- package/src/stories/grid/GridInlineText.stories.tsx +62 -49
- package/src/stories/grid/GridNoRowsOverlay.stories.tsx +28 -23
- package/src/stories/grid/GridNonEditableRow.stories.tsx +30 -24
- package/src/stories/grid/GridPinnedRow.stories.tsx +37 -31
- package/src/stories/grid/GridPopoutContextMenu.stories.tsx +29 -24
- package/src/stories/grid/GridPopoutEditBoolean.stories.tsx +89 -82
- package/src/stories/grid/GridPopoutEditGeneric.stories.tsx +27 -22
- package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +29 -24
- package/src/stories/grid/GridPopoverEditBearing.stories.tsx +30 -25
- package/src/stories/grid/GridPopoverEditDropDown.stories.tsx +29 -24
- package/src/stories/grid/GridPopoverEditMultiSelect.stories.tsx +29 -24
- package/src/stories/grid/GridPopoverEditMultiSelectGrid.stories.tsx +28 -24
- package/src/stories/grid/GridReadOnly.stories.tsx +56 -52
- package/src/stories/grid/GridSorting.stories.tsx +498 -86
- package/src/stories/grid/GridViewList.stories.tsx +31 -26
- package/src/stories/grid/GridViewSelectableList.stories.tsx +31 -26
- package/src/stories/grid/gridAutosize/GridAutoSize.stories.tsx +41 -37
- package/src/stories/grid/gridAutosize/GridFitSize.stories.tsx +40 -36
- package/src/stories/grid/gridAutosize/GridFitSizeFlex.stories.tsx +40 -36
- package/src/stories/grid/gridAutosize/ShowPanelResizingAgGrid/ShowPanelResizingStepAgGrid.tsx +14 -6
- package/src/stories/grid/gridFormInteraction/GridFormDropDownInteraction.stories.tsx +74 -74
- package/src/stories/grid/gridFormInteraction/GridFormEditBearingCorrectionInteraction.stories.tsx +59 -59
- package/src/stories/grid/gridFormInteraction/GridFormEditBearingInteraction.stories.tsx +58 -58
- package/src/stories/grid/gridFormInteraction/GridFormMultiSelectGridInteraction.stories.tsx +62 -62
- package/src/stories/grid/gridFormInteraction/GridFormMultiSelectInteraction.stories.tsx +118 -118
- package/src/stories/grid/gridFormInteraction/GridFormPopoverMenuInteraction.stories.tsx +107 -105
- package/src/stories/grid/gridFormInteraction/GridFormTextAreaInteraction.stories.tsx +72 -64
- package/src/stories/grid/gridFormInteraction/GridFormTextInputInteraction.stories.tsx +82 -73
- package/src/stories/grid/gridFormStatic/GridFormDropDown.stories.tsx +12 -13
- package/src/stories/grid/gridFormStatic/GridFormEditBearing.stories.tsx +12 -13
- package/src/stories/grid/gridFormStatic/GridFormEditBearingCorrection.stories.tsx +11 -13
- package/src/stories/grid/gridFormStatic/GridFormMessage.stories.tsx +11 -13
- package/src/stories/grid/gridFormStatic/GridFormMultiSelect.stories.tsx +11 -13
- package/src/stories/grid/gridFormStatic/GridFormPopoverMenu.stories.tsx +11 -13
- package/src/stories/grid/gridFormStatic/GridFormTextArea.stories.tsx +11 -13
- package/src/stories/grid/gridFormStatic/GridFormTextInput.stories.tsx +11 -13
- package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +110 -107
- package/src/stories/react-menu/ReactMenu.stories.tsx +70 -73
- package/src/styles/GridLoadableCell.scss +1 -1
- package/src/utils/__tests__/storybookTestUtil.ts +1 -1
- package/src/utils/useSharedInterval.ts +3 -3
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { LuiFilterCharactersProvider } from '@linzjs/lui';
|
|
2
|
-
import { StoryFn } from '@storybook/react-vite';
|
|
2
|
+
import { Meta, StoryFn, StoryObj } from '@storybook/react-vite';
|
|
3
3
|
import { GridPopoverContext } from '../../../contexts/GridPopoverContext';
|
|
4
4
|
import { useRef } from 'react';
|
|
5
5
|
import { expect, fn, userEvent, within } from 'storybook/test';
|
|
6
6
|
|
|
7
7
|
import { GridContextProvider, GridFormTextArea, GridFormTextAreaProps } from '../../..';
|
|
8
8
|
|
|
9
|
-
export default {
|
|
10
|
-
title: 'GridForm / Interactions',
|
|
11
|
-
component: GridFormTextArea,
|
|
12
|
-
args: {},
|
|
13
|
-
};
|
|
14
|
-
|
|
15
9
|
const updateValue = fn();
|
|
16
10
|
|
|
17
11
|
const Template: StoryFn<typeof GridFormTextArea> = (props: GridFormTextAreaProps<any>) => {
|
|
@@ -43,43 +37,6 @@ const Template: StoryFn<typeof GridFormTextArea> = (props: GridFormTextAreaProps
|
|
|
43
37
|
);
|
|
44
38
|
};
|
|
45
39
|
|
|
46
|
-
export const GridFormTextAreaInteractions_: typeof Template = Template.bind({});
|
|
47
|
-
GridFormTextAreaInteractions_.play = async ({ canvasElement }) => {
|
|
48
|
-
const canvas = within(canvasElement);
|
|
49
|
-
|
|
50
|
-
await expect(await canvas.findByText('Must not be empty')).toBeInTheDocument();
|
|
51
|
-
|
|
52
|
-
const inputField = canvas.getByPlaceholderText('Type here');
|
|
53
|
-
await userEvent.type(inputField, 'Hello');
|
|
54
|
-
|
|
55
|
-
await expect(await canvas.findByText('Press tab to save')).toBeInTheDocument();
|
|
56
|
-
|
|
57
|
-
// Test tab to save
|
|
58
|
-
updateValue.mockClear();
|
|
59
|
-
await userEvent.tab();
|
|
60
|
-
await expect(updateValue).toHaveBeenCalledWith(expect.anything(), 1); // 1 = Tab
|
|
61
|
-
|
|
62
|
-
// Test shift+tab to save
|
|
63
|
-
updateValue.mockClear();
|
|
64
|
-
await userEvent.tab({ shift: true });
|
|
65
|
-
await expect(updateValue).toHaveBeenCalledWith(expect.anything(), -1); // -1 = Shift + tab
|
|
66
|
-
|
|
67
|
-
// Test escape not to save
|
|
68
|
-
updateValue.mockClear();
|
|
69
|
-
await userEvent.type(inputField, '{Escape}');
|
|
70
|
-
await expect(updateValue).toHaveBeenCalledWith(expect.anything(), 0);
|
|
71
|
-
|
|
72
|
-
// Test invalid value doesn't save
|
|
73
|
-
updateValue.mockClear();
|
|
74
|
-
await userEvent.clear(inputField);
|
|
75
|
-
|
|
76
|
-
await expect(canvas.getByText('Must not be empty')).toBeInTheDocument();
|
|
77
|
-
await userEvent.tab();
|
|
78
|
-
await expect(updateValue).not.toHaveBeenCalled();
|
|
79
|
-
await userEvent.tab({ shift: true });
|
|
80
|
-
await expect(updateValue).not.toHaveBeenCalled();
|
|
81
|
-
};
|
|
82
|
-
|
|
83
40
|
const FilterTemplate: StoryFn<typeof GridFormTextArea> = (props: GridFormTextAreaProps<any>) => {
|
|
84
41
|
const anchorRef = useRef<HTMLHeadingElement>(null);
|
|
85
42
|
|
|
@@ -111,29 +68,80 @@ const FilterTemplate: StoryFn<typeof GridFormTextArea> = (props: GridFormTextAre
|
|
|
111
68
|
);
|
|
112
69
|
};
|
|
113
70
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
71
|
+
const meta: Meta<typeof Template> = {
|
|
72
|
+
title: 'GridForm / Interactions',
|
|
73
|
+
component: Template,
|
|
74
|
+
args: {},
|
|
75
|
+
};
|
|
76
|
+
export default meta;
|
|
119
77
|
|
|
120
|
-
|
|
121
|
-
const inputField = await canvas.findByPlaceholderText('Type here');
|
|
122
|
-
// ’ (U+2019 right single quote) -> ' , — (U+2014 em dash) -> - , Ω (U+03A9, out of range) -> removed
|
|
123
|
-
await userEvent.type(inputField, 'It’s—cool Ω');
|
|
78
|
+
type Story = StoryObj<typeof meta>;
|
|
124
79
|
|
|
125
|
-
|
|
126
|
-
}
|
|
80
|
+
export const GridFormTextAreaInteractions_: Story = {
|
|
81
|
+
play: async ({ canvasElement }) => {
|
|
82
|
+
const canvas = within(canvasElement);
|
|
127
83
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
84
|
+
await expect(await canvas.findByText('Must not be empty')).toBeInTheDocument();
|
|
85
|
+
|
|
86
|
+
const inputField = canvas.getByPlaceholderText('Type here');
|
|
87
|
+
await userEvent.type(inputField, 'Hello');
|
|
88
|
+
|
|
89
|
+
await expect(await canvas.findByText('Press tab to save')).toBeInTheDocument();
|
|
90
|
+
|
|
91
|
+
// Test tab to save
|
|
92
|
+
updateValue.mockClear();
|
|
93
|
+
await userEvent.tab();
|
|
94
|
+
await expect(updateValue).toHaveBeenCalledWith(expect.anything(), 1); // 1 = Tab
|
|
95
|
+
|
|
96
|
+
// Test shift+tab to save
|
|
97
|
+
updateValue.mockClear();
|
|
98
|
+
await userEvent.tab({ shift: true });
|
|
99
|
+
await expect(updateValue).toHaveBeenCalledWith(expect.anything(), -1); // -1 = Shift + tab
|
|
133
100
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
101
|
+
// Test escape not to save
|
|
102
|
+
updateValue.mockClear();
|
|
103
|
+
await userEvent.type(inputField, '{Escape}');
|
|
104
|
+
await expect(updateValue).toHaveBeenCalledWith(expect.anything(), 0);
|
|
137
105
|
|
|
138
|
-
|
|
106
|
+
// Test invalid value doesn't save
|
|
107
|
+
updateValue.mockClear();
|
|
108
|
+
await userEvent.clear(inputField);
|
|
109
|
+
|
|
110
|
+
await expect(canvas.getByText('Must not be empty')).toBeInTheDocument();
|
|
111
|
+
await userEvent.tab();
|
|
112
|
+
await expect(updateValue).not.toHaveBeenCalled();
|
|
113
|
+
await userEvent.tab({ shift: true });
|
|
114
|
+
await expect(updateValue).not.toHaveBeenCalled();
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
// By default (disableUnicodeCharacterFilter unset) invalid unicode characters are silently
|
|
119
|
+
// converted or stripped as the user types, matching LuiTextAreaInput's behaviour.
|
|
120
|
+
export const GridFormTextAreaUnicodeFilter_: Story = {
|
|
121
|
+
render: FilterTemplate,
|
|
122
|
+
play: async ({ canvasElement }) => {
|
|
123
|
+
const canvas = within(canvasElement);
|
|
124
|
+
|
|
125
|
+
// The popover mounts asynchronously (GridPopoverHook opens on a post-mount effect), so wait for it.
|
|
126
|
+
const inputField = await canvas.findByPlaceholderText('Type here');
|
|
127
|
+
// ’ (U+2019 right single quote) -> ' , — (U+2014 em dash) -> - , Ω (U+03A9, out of range) -> removed
|
|
128
|
+
await userEvent.type(inputField, 'It’s—cool Ω');
|
|
129
|
+
|
|
130
|
+
await expect(inputField).toHaveValue("It's-cool ");
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
// disableUnicodeCharacterFilter=true opts out of filtering, leaving invalid characters intact.
|
|
135
|
+
export const GridFormTextAreaUnicodeFilterDisabled_: Story = {
|
|
136
|
+
render: FilterTemplate,
|
|
137
|
+
args: { disableUnicodeCharacterFilter: true },
|
|
138
|
+
play: async ({ canvasElement }) => {
|
|
139
|
+
const canvas = within(canvasElement);
|
|
140
|
+
|
|
141
|
+
const inputField = await canvas.findByPlaceholderText('Type here');
|
|
142
|
+
// Same chars as above, but left untouched since filtering is disabled
|
|
143
|
+
await userEvent.type(inputField, 'It’s—cool Ω');
|
|
144
|
+
|
|
145
|
+
await expect(inputField).toHaveValue('It’s—cool Ω');
|
|
146
|
+
},
|
|
139
147
|
};
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import { LuiFilterCharactersProvider } from '@linzjs/lui';
|
|
2
|
-
import {
|
|
2
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
3
3
|
import { GridPopoverContext } from '../../../contexts/GridPopoverContext';
|
|
4
4
|
import { useRef } from 'react';
|
|
5
5
|
import { expect, fn, userEvent, within } from 'storybook/test';
|
|
6
6
|
|
|
7
7
|
import { GridContextProvider, GridFormTextInput, GridFormTextInputProps } from '../../..';
|
|
8
8
|
|
|
9
|
-
export default {
|
|
10
|
-
title: 'GridForm / Interactions',
|
|
11
|
-
component: GridFormTextInput,
|
|
12
|
-
args: {},
|
|
13
|
-
};
|
|
14
|
-
|
|
15
9
|
const updateValue = fn();
|
|
16
10
|
|
|
17
|
-
const Template
|
|
11
|
+
const Template = (props: GridFormTextInputProps<any>) => {
|
|
18
12
|
const anchorRef = useRef<HTMLHeadingElement>(null);
|
|
19
13
|
|
|
20
14
|
return (
|
|
@@ -43,51 +37,7 @@ const Template: StoryFn<typeof GridFormTextInput> = (props: GridFormTextInputPro
|
|
|
43
37
|
);
|
|
44
38
|
};
|
|
45
39
|
|
|
46
|
-
|
|
47
|
-
GridFormTextInputInteractions_.play = async ({ canvasElement }) => {
|
|
48
|
-
const canvas = within(canvasElement);
|
|
49
|
-
|
|
50
|
-
await expect(await canvas.findByText('Must not be empty')).toBeInTheDocument();
|
|
51
|
-
|
|
52
|
-
const inputField = canvas.getByPlaceholderText('Type here');
|
|
53
|
-
await userEvent.type(inputField, 'Hello');
|
|
54
|
-
|
|
55
|
-
await expect(canvas.getByText('Press enter or tab to save')).toBeInTheDocument();
|
|
56
|
-
|
|
57
|
-
// Test enter to save
|
|
58
|
-
updateValue.mockClear();
|
|
59
|
-
await userEvent.type(inputField, '{Enter}');
|
|
60
|
-
await expect(updateValue).toHaveBeenCalledWith(expect.anything(), 0); // 0 = Enter
|
|
61
|
-
|
|
62
|
-
// Test tab to save
|
|
63
|
-
updateValue.mockClear();
|
|
64
|
-
await userEvent.tab();
|
|
65
|
-
await expect(updateValue).toHaveBeenCalledWith(expect.anything(), 1); // 1 = Tab
|
|
66
|
-
|
|
67
|
-
// Test shift+tab to save
|
|
68
|
-
updateValue.mockClear();
|
|
69
|
-
await userEvent.tab({ shift: true });
|
|
70
|
-
await expect(updateValue).toHaveBeenCalledWith(expect.anything(), -1); // -1 = Shift + tab
|
|
71
|
-
|
|
72
|
-
// Test escape not to save
|
|
73
|
-
updateValue.mockClear();
|
|
74
|
-
await userEvent.type(inputField, '{Escape}');
|
|
75
|
-
await expect(updateValue).toHaveBeenCalledWith(expect.anything(), 0);
|
|
76
|
-
|
|
77
|
-
// Test invalid value doesn't save
|
|
78
|
-
updateValue.mockClear();
|
|
79
|
-
await userEvent.clear(inputField);
|
|
80
|
-
|
|
81
|
-
await expect(canvas.getByText('Must not be empty')).toBeInTheDocument();
|
|
82
|
-
await userEvent.type(inputField, '{Enter}');
|
|
83
|
-
await expect(updateValue).not.toHaveBeenCalled();
|
|
84
|
-
await userEvent.tab();
|
|
85
|
-
await expect(updateValue).not.toHaveBeenCalled();
|
|
86
|
-
await userEvent.tab({ shift: true });
|
|
87
|
-
await expect(updateValue).not.toHaveBeenCalled();
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
const FilterTemplate: StoryFn<typeof GridFormTextInput> = (props: GridFormTextInputProps<any>) => {
|
|
40
|
+
const FilterTemplate = (props: GridFormTextInputProps<any>) => {
|
|
91
41
|
const anchorRef = useRef<HTMLHeadingElement>(null);
|
|
92
42
|
|
|
93
43
|
return (
|
|
@@ -118,29 +68,88 @@ const FilterTemplate: StoryFn<typeof GridFormTextInput> = (props: GridFormTextIn
|
|
|
118
68
|
);
|
|
119
69
|
};
|
|
120
70
|
|
|
71
|
+
const meta: Meta<typeof GridFormTextInput> = {
|
|
72
|
+
title: 'GridForm / Interactions',
|
|
73
|
+
component: GridFormTextInput,
|
|
74
|
+
args: {},
|
|
75
|
+
};
|
|
76
|
+
export default meta;
|
|
77
|
+
|
|
78
|
+
type Story = StoryObj<typeof meta>;
|
|
79
|
+
|
|
80
|
+
export const GridFormTextInputInteractions_: Story = {
|
|
81
|
+
render: Template,
|
|
82
|
+
play: async ({ canvasElement }) => {
|
|
83
|
+
const canvas = within(canvasElement);
|
|
84
|
+
|
|
85
|
+
await expect(await canvas.findByText('Must not be empty')).toBeInTheDocument();
|
|
86
|
+
|
|
87
|
+
const inputField = canvas.getByPlaceholderText('Type here');
|
|
88
|
+
await userEvent.type(inputField, 'Hello');
|
|
89
|
+
|
|
90
|
+
await expect(canvas.getByText('Press enter or tab to save')).toBeInTheDocument();
|
|
91
|
+
|
|
92
|
+
// Test enter to save
|
|
93
|
+
updateValue.mockClear();
|
|
94
|
+
await userEvent.type(inputField, '{Enter}');
|
|
95
|
+
await expect(updateValue).toHaveBeenCalledWith(expect.anything(), 0); // 0 = Enter
|
|
96
|
+
|
|
97
|
+
// Test tab to save
|
|
98
|
+
updateValue.mockClear();
|
|
99
|
+
await userEvent.tab();
|
|
100
|
+
await expect(updateValue).toHaveBeenCalledWith(expect.anything(), 1); // 1 = Tab
|
|
101
|
+
|
|
102
|
+
// Test shift+tab to save
|
|
103
|
+
updateValue.mockClear();
|
|
104
|
+
await userEvent.tab({ shift: true });
|
|
105
|
+
await expect(updateValue).toHaveBeenCalledWith(expect.anything(), -1); // -1 = Shift + tab
|
|
106
|
+
|
|
107
|
+
// Test escape not to save
|
|
108
|
+
updateValue.mockClear();
|
|
109
|
+
await userEvent.type(inputField, '{Escape}');
|
|
110
|
+
await expect(updateValue).toHaveBeenCalledWith(expect.anything(), 0);
|
|
111
|
+
|
|
112
|
+
// Test invalid value doesn't save
|
|
113
|
+
updateValue.mockClear();
|
|
114
|
+
await userEvent.clear(inputField);
|
|
115
|
+
|
|
116
|
+
await expect(canvas.getByText('Must not be empty')).toBeInTheDocument();
|
|
117
|
+
await userEvent.type(inputField, '{Enter}');
|
|
118
|
+
await expect(updateValue).not.toHaveBeenCalled();
|
|
119
|
+
await userEvent.tab();
|
|
120
|
+
await expect(updateValue).not.toHaveBeenCalled();
|
|
121
|
+
await userEvent.tab({ shift: true });
|
|
122
|
+
await expect(updateValue).not.toHaveBeenCalled();
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
121
126
|
// By default (disableUnicodeCharacterFilter unset) invalid unicode characters are silently
|
|
122
127
|
// converted or stripped as the user types, matching LuiTextInput's behaviour.
|
|
123
|
-
export const GridFormTextInputUnicodeFilter_ =
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
export const GridFormTextInputUnicodeFilter_: Story = {
|
|
129
|
+
render: FilterTemplate,
|
|
130
|
+
play: async ({ canvasElement }) => {
|
|
131
|
+
const canvas = within(canvasElement);
|
|
132
|
+
|
|
133
|
+
// The popover mounts asynchronously (GridPopoverHook opens on a post-mount effect), so wait for it.
|
|
134
|
+
const inputField = await canvas.findByPlaceholderText('Type here');
|
|
135
|
+
// ’ (U+2019 right single quote) -> ' , — (U+2014 em dash) -> - , Ω (U+03A9, out of range) -> removed
|
|
136
|
+
await userEvent.type(inputField, 'It’s—cool Ω');
|
|
137
|
+
|
|
138
|
+
await expect(inputField).toHaveValue("It's-cool ");
|
|
139
|
+
},
|
|
133
140
|
};
|
|
134
141
|
|
|
135
142
|
// disableUnicodeCharacterFilter=true opts out of filtering, leaving invalid characters intact.
|
|
136
|
-
export const GridFormTextInputUnicodeFilterDisabled_ =
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
export const GridFormTextInputUnicodeFilterDisabled_: Story = {
|
|
144
|
+
render: FilterTemplate,
|
|
145
|
+
args: { disableUnicodeCharacterFilter: true },
|
|
146
|
+
play: async ({ canvasElement }) => {
|
|
147
|
+
const canvas = within(canvasElement);
|
|
148
|
+
|
|
149
|
+
const inputField = await canvas.findByPlaceholderText('Type here');
|
|
150
|
+
// Same chars as above, but left untouched since filtering is disabled
|
|
151
|
+
await userEvent.type(inputField, 'It’s—cool Ω');
|
|
152
|
+
|
|
153
|
+
await expect(inputField).toHaveValue('It’s—cool Ω');
|
|
154
|
+
},
|
|
146
155
|
};
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '../../../styles/index.scss';
|
|
3
|
-
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
-
|
|
5
|
-
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
6
2
|
import { GridPopoverContext, GridPopoverContextType } from '../../../contexts/GridPopoverContext';
|
|
7
3
|
import { useRef } from 'react';
|
|
8
4
|
|
|
9
5
|
import { GridBaseRow, GridContextProvider, GridFormDropDown, GridFormDropDownProps, MenuHeaderItem } from '../../..';
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
title: 'GridForm / Static Tests',
|
|
13
|
-
component: GridFormDropDown,
|
|
14
|
-
args: {},
|
|
15
|
-
} as Meta<typeof GridFormDropDown>;
|
|
16
|
-
|
|
17
|
-
const Template: StoryFn<typeof GridFormDropDown> = (props: GridFormDropDownProps<GridBaseRow, unknown>) => {
|
|
7
|
+
const Template = (props: GridFormDropDownProps<GridBaseRow, unknown>) => {
|
|
18
8
|
const configs: [string, GridFormDropDownProps<GridBaseRow, unknown>, string?][] = [
|
|
19
9
|
['No options', { options: [] }],
|
|
20
10
|
['Custom no options', { options: [], noOptionsMessage: 'Custom no options' }],
|
|
@@ -102,4 +92,13 @@ const Template: StoryFn<typeof GridFormDropDown> = (props: GridFormDropDownProps
|
|
|
102
92
|
);
|
|
103
93
|
};
|
|
104
94
|
|
|
105
|
-
|
|
95
|
+
const meta: Meta<typeof Template> = {
|
|
96
|
+
title: 'GridForm / Static Tests',
|
|
97
|
+
component: Template,
|
|
98
|
+
args: {},
|
|
99
|
+
};
|
|
100
|
+
export default meta;
|
|
101
|
+
|
|
102
|
+
type Story = StoryObj<typeof meta>;
|
|
103
|
+
|
|
104
|
+
export const GridFormDropDown_: Story = {};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '../../../styles/index.scss';
|
|
3
|
-
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
-
|
|
5
|
-
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
6
2
|
import { GridPopoverContext, GridPopoverContextType } from '../../../contexts/GridPopoverContext';
|
|
7
3
|
import { useRef } from 'react';
|
|
8
4
|
|
|
@@ -13,13 +9,7 @@ import {
|
|
|
13
9
|
GridPopoverEditBearingEditorParams,
|
|
14
10
|
} from '../../..';
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
title: 'GridForm / Static Tests',
|
|
18
|
-
component: GridFormEditBearing,
|
|
19
|
-
args: {},
|
|
20
|
-
} as Meta<typeof GridFormEditBearing>;
|
|
21
|
-
|
|
22
|
-
const Template: StoryFn<typeof GridFormEditBearing> = (props: GridFormEditBearingProps<any>) => {
|
|
12
|
+
const Template = (props: GridFormEditBearingProps<any>) => {
|
|
23
13
|
const values: [string, GridFormEditBearingProps<any>, number | null][] = [
|
|
24
14
|
['Null value', {}, null],
|
|
25
15
|
['Custom placeholder', { placeHolder: 'Custom placeholder' }, null],
|
|
@@ -52,4 +42,13 @@ const Template: StoryFn<typeof GridFormEditBearing> = (props: GridFormEditBearin
|
|
|
52
42
|
);
|
|
53
43
|
};
|
|
54
44
|
|
|
55
|
-
|
|
45
|
+
const meta: Meta<typeof Template> = {
|
|
46
|
+
title: 'GridForm / Static Tests',
|
|
47
|
+
component: Template,
|
|
48
|
+
args: {},
|
|
49
|
+
};
|
|
50
|
+
export default meta;
|
|
51
|
+
|
|
52
|
+
type Story = StoryObj<typeof meta>;
|
|
53
|
+
|
|
54
|
+
export const GridFormEditBearing_: Story = {};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '../../../styles/index.scss';
|
|
3
|
-
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
-
|
|
5
|
-
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
6
2
|
import { GridPopoverContext, GridPopoverContextType } from '../../../contexts/GridPopoverContext';
|
|
7
3
|
import { useRef } from 'react';
|
|
8
4
|
|
|
@@ -13,13 +9,7 @@ import {
|
|
|
13
9
|
GridPopoverEditBearingCorrectionEditorParams,
|
|
14
10
|
} from '../../..';
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
title: 'GridForm / Static Tests',
|
|
18
|
-
component: GridFormEditBearing,
|
|
19
|
-
args: {},
|
|
20
|
-
} as Meta<typeof GridFormEditBearing>;
|
|
21
|
-
|
|
22
|
-
const Template: StoryFn<typeof GridFormEditBearing> = (props: GridFormEditBearingProps<any>) => {
|
|
12
|
+
const Template = (props: GridFormEditBearingProps<any>) => {
|
|
23
13
|
const values: [string, GridFormEditBearingProps<any>, number | null][] = [
|
|
24
14
|
['Null value', {}, null],
|
|
25
15
|
['Custom placeholder', { placeHolder: 'Custom placeholder' }, null],
|
|
@@ -52,4 +42,12 @@ const Template: StoryFn<typeof GridFormEditBearing> = (props: GridFormEditBearin
|
|
|
52
42
|
);
|
|
53
43
|
};
|
|
54
44
|
|
|
55
|
-
|
|
45
|
+
const meta: Meta<typeof Template> = {
|
|
46
|
+
title: 'GridForm / Static Tests',
|
|
47
|
+
component: Template,
|
|
48
|
+
};
|
|
49
|
+
export default meta;
|
|
50
|
+
|
|
51
|
+
type Story = StoryObj<typeof meta>;
|
|
52
|
+
|
|
53
|
+
export const GridFormEditBearingCorrection_: Story = {};
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '../../../styles/index.scss';
|
|
3
|
-
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
-
|
|
5
|
-
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
6
2
|
import { GridPopoverContext, GridPopoverContextType } from '../../../contexts/GridPopoverContext';
|
|
7
3
|
import { useRef } from 'react';
|
|
8
4
|
|
|
9
5
|
import { GridContextProvider, GridFormMessage, GridFormMessageProps } from '../../..';
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
title: 'GridForm / Static Tests',
|
|
13
|
-
component: GridFormMessage,
|
|
14
|
-
args: {},
|
|
15
|
-
} as Meta<typeof GridFormMessage>;
|
|
16
|
-
|
|
17
|
-
const Template: StoryFn<typeof GridFormMessage> = (props: GridFormMessageProps<any>) => {
|
|
7
|
+
const Template = (props: GridFormMessageProps<any>) => {
|
|
18
8
|
const anchorRef1 = useRef<HTMLHeadingElement>(null);
|
|
19
9
|
|
|
20
10
|
return (
|
|
@@ -29,4 +19,12 @@ const Template: StoryFn<typeof GridFormMessage> = (props: GridFormMessageProps<a
|
|
|
29
19
|
);
|
|
30
20
|
};
|
|
31
21
|
|
|
32
|
-
|
|
22
|
+
const meta: Meta<typeof Template> = {
|
|
23
|
+
title: 'GridForm / Static Tests',
|
|
24
|
+
component: Template,
|
|
25
|
+
};
|
|
26
|
+
export default meta;
|
|
27
|
+
|
|
28
|
+
type Story = StoryObj<typeof meta>;
|
|
29
|
+
|
|
30
|
+
export const GridFormMessage_: Story = {};
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '../../../styles/index.scss';
|
|
3
|
-
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
-
|
|
5
|
-
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
6
2
|
import { GridPopoverContext, GridPopoverContextType } from '../../../contexts/GridPopoverContext';
|
|
7
3
|
import { useRef } from 'react';
|
|
8
4
|
|
|
9
5
|
import { GridBaseRow, GridContextProvider, GridFormMultiSelect, GridFormMultiSelectProps } from '../../..';
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
title: 'GridForm / Static Tests',
|
|
13
|
-
component: GridFormMultiSelect,
|
|
14
|
-
args: {},
|
|
15
|
-
} as Meta<typeof GridFormMultiSelect>;
|
|
16
|
-
|
|
17
|
-
const Template: StoryFn<typeof GridFormMultiSelect> = (props) => {
|
|
7
|
+
const Template = (props: GridFormMultiSelectProps<any>) => {
|
|
18
8
|
const configs: [string, GridFormMultiSelectProps<GridBaseRow>, string?][] = [
|
|
19
9
|
['No options', { options: [] }],
|
|
20
10
|
['Custom no options', { options: [], noOptionsMessage: 'Custom no options' }],
|
|
@@ -67,4 +57,12 @@ const Template: StoryFn<typeof GridFormMultiSelect> = (props) => {
|
|
|
67
57
|
);
|
|
68
58
|
};
|
|
69
59
|
|
|
70
|
-
|
|
60
|
+
const meta: Meta<typeof Template> = {
|
|
61
|
+
title: 'GridForm / Static Tests',
|
|
62
|
+
component: Template,
|
|
63
|
+
};
|
|
64
|
+
export default meta;
|
|
65
|
+
|
|
66
|
+
type Story = StoryObj<typeof meta>;
|
|
67
|
+
|
|
68
|
+
export const GridFormMultiSelect_: Story = {};
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '../../../styles/index.scss';
|
|
3
|
-
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
-
|
|
5
|
-
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
6
2
|
import { GridPopoverContext, GridPopoverContextType } from '../../../contexts/GridPopoverContext';
|
|
7
3
|
import { useRef } from 'react';
|
|
8
4
|
|
|
@@ -14,13 +10,7 @@ import {
|
|
|
14
10
|
PopoutMenuSeparator,
|
|
15
11
|
} from '../../..';
|
|
16
12
|
|
|
17
|
-
|
|
18
|
-
title: 'GridForm / Static Tests',
|
|
19
|
-
component: GridFormPopoverMenu,
|
|
20
|
-
args: {},
|
|
21
|
-
} as Meta<typeof GridFormPopoverMenu>;
|
|
22
|
-
|
|
23
|
-
const Template: StoryFn<typeof GridFormPopoverMenu> = (props) => {
|
|
13
|
+
const Template = (props: GridFormPopoverMenuProps<any>) => {
|
|
24
14
|
const configs: [string, GridFormPopoverMenuProps<GridBaseRow>][] = [
|
|
25
15
|
['No options', { options: () => [] }],
|
|
26
16
|
[
|
|
@@ -63,4 +53,12 @@ const Template: StoryFn<typeof GridFormPopoverMenu> = (props) => {
|
|
|
63
53
|
);
|
|
64
54
|
};
|
|
65
55
|
|
|
66
|
-
|
|
56
|
+
const meta: Meta<typeof Template> = {
|
|
57
|
+
title: 'GridForm / Static Tests',
|
|
58
|
+
component: Template,
|
|
59
|
+
};
|
|
60
|
+
export default meta;
|
|
61
|
+
|
|
62
|
+
type Story = StoryObj<typeof meta>;
|
|
63
|
+
|
|
64
|
+
export const GridFormPopoverMenu_: Story = {};
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '../../../styles/index.scss';
|
|
3
|
-
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
-
|
|
5
|
-
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
6
2
|
import { GridPopoverContext, GridPopoverContextType } from '../../../contexts/GridPopoverContext';
|
|
7
3
|
import { useRef } from 'react';
|
|
8
4
|
|
|
9
5
|
import { GridBaseRow, GridContextProvider, GridFormTextArea, GridFormTextAreaProps } from '../../..';
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
title: 'GridForm / Static Tests',
|
|
13
|
-
component: GridFormTextArea,
|
|
14
|
-
args: {},
|
|
15
|
-
} as Meta<typeof GridFormTextArea>;
|
|
16
|
-
|
|
17
|
-
const Template: StoryFn<typeof GridFormTextArea> = (props: GridFormTextAreaProps<any>) => {
|
|
7
|
+
const Template = (props: GridFormTextAreaProps<any>) => {
|
|
18
8
|
const configs: [string, GridFormTextAreaProps<GridBaseRow>, string?][] = [
|
|
19
9
|
['Text area', {}],
|
|
20
10
|
['Text area with text', {}, 'Some text'],
|
|
@@ -41,4 +31,12 @@ const Template: StoryFn<typeof GridFormTextArea> = (props: GridFormTextAreaProps
|
|
|
41
31
|
);
|
|
42
32
|
};
|
|
43
33
|
|
|
44
|
-
|
|
34
|
+
const meta: Meta<typeof Template> = {
|
|
35
|
+
title: 'GridForm / Static Tests',
|
|
36
|
+
component: Template,
|
|
37
|
+
};
|
|
38
|
+
export default meta;
|
|
39
|
+
|
|
40
|
+
type Story = StoryObj<typeof meta>;
|
|
41
|
+
|
|
42
|
+
export const GridFormTextArea_: Story = {};
|
|
@@ -1,20 +1,10 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import '../../../styles/index.scss';
|
|
3
|
-
import '@linzjs/lui/dist/scss/base.scss';
|
|
4
|
-
|
|
5
|
-
import { Meta, StoryFn } from '@storybook/react-vite';
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
6
2
|
import { GridPopoverContext, GridPopoverContextType } from '../../../contexts/GridPopoverContext';
|
|
7
3
|
import { useRef } from 'react';
|
|
8
4
|
|
|
9
5
|
import { GridBaseRow, GridContextProvider, GridFormTextInput, GridFormTextInputProps } from '../../..';
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
title: 'GridForm / Static Tests',
|
|
13
|
-
component: GridFormTextInput,
|
|
14
|
-
args: {},
|
|
15
|
-
} as Meta<typeof GridFormTextInput>;
|
|
16
|
-
|
|
17
|
-
const Template: StoryFn<typeof GridFormTextInput> = (props: GridFormTextInputProps<any>) => {
|
|
7
|
+
const Template = (props: GridFormTextInputProps<any>) => {
|
|
18
8
|
const configs: [string, GridFormTextInputProps<GridBaseRow>, string?][] = [
|
|
19
9
|
['Text input', {}],
|
|
20
10
|
['Text input with text', {}, 'Some text'],
|
|
@@ -41,4 +31,12 @@ const Template: StoryFn<typeof GridFormTextInput> = (props: GridFormTextInputPro
|
|
|
41
31
|
);
|
|
42
32
|
};
|
|
43
33
|
|
|
44
|
-
|
|
34
|
+
const meta: Meta<typeof Template> = {
|
|
35
|
+
title: 'GridForm / Static Tests',
|
|
36
|
+
component: Template,
|
|
37
|
+
};
|
|
38
|
+
export default meta;
|
|
39
|
+
|
|
40
|
+
type Story = StoryObj<typeof meta>;
|
|
41
|
+
|
|
42
|
+
export const GridFormTextInput_: Story = {};
|