@linzjs/step-ag-grid 31.2.0 → 31.2.2
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/step-ag-grid.cjs +4 -4
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +4 -4
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +2 -2
- package/src/components/gridForm/GridFormPopoverMenu.tsx +2 -4
- package/src/stories/grid/gridFormStatic/GridFormPopoverMenu.stories.tsx +12 -3
package/package.json
CHANGED
package/src/components/Grid.tsx
CHANGED
|
@@ -1150,10 +1150,10 @@ export const Grid = <TData extends GridBaseRow = GridBaseRow>({
|
|
|
1150
1150
|
rowDragText={
|
|
1151
1151
|
params.rowDragText ??
|
|
1152
1152
|
(rowSelection === 'multiple'
|
|
1153
|
-
? () => {
|
|
1153
|
+
? (dragItem) => {
|
|
1154
1154
|
const count = multiDragCountRef.current;
|
|
1155
1155
|
if (count > 1) return `Moving ${count} rows`;
|
|
1156
|
-
return ''
|
|
1156
|
+
return `${dragItem.rowNode?.data?.id ?? ''}`;
|
|
1157
1157
|
}
|
|
1158
1158
|
: undefined)
|
|
1159
1159
|
}
|
|
@@ -139,10 +139,9 @@ export const GridFormPopoverMenu = <TData extends GridBaseRow>(props: GridFormPo
|
|
|
139
139
|
<MenuDivider key={`$$divider_${index}`} />
|
|
140
140
|
) : (
|
|
141
141
|
!item.hidden && (
|
|
142
|
-
<Fragment key={
|
|
142
|
+
<Fragment key={`fragment__${index}`}>
|
|
143
143
|
{item.subMenu ? (
|
|
144
144
|
<SubMenu
|
|
145
|
-
key={`${String(item.label)}`}
|
|
146
145
|
disabled={!!item.disabled}
|
|
147
146
|
label={item.label as string}
|
|
148
147
|
title={item.disabled && typeof item.disabled !== 'boolean' ? item.disabled : ''}
|
|
@@ -151,7 +150,6 @@ export const GridFormPopoverMenu = <TData extends GridBaseRow>(props: GridFormPo
|
|
|
151
150
|
</SubMenu>
|
|
152
151
|
) : (
|
|
153
152
|
<MenuItem
|
|
154
|
-
key={`${String(item.label)}`}
|
|
155
153
|
onClick={(e: ClickEvent) => void onMenuItemClick(e, item)}
|
|
156
154
|
disabled={!!item.disabled}
|
|
157
155
|
title={item.disabled && typeof item.disabled !== 'boolean' ? item.disabled : ''}
|
|
@@ -160,7 +158,7 @@ export const GridFormPopoverMenu = <TData extends GridBaseRow>(props: GridFormPo
|
|
|
160
158
|
</MenuItem>
|
|
161
159
|
)}
|
|
162
160
|
{item.subComponent && subComponentSelected === item && (
|
|
163
|
-
<FocusableItem className={'LuiDeprecatedForms'}
|
|
161
|
+
<FocusableItem className={'LuiDeprecatedForms'}>
|
|
164
162
|
{() => (
|
|
165
163
|
<GridSubComponentContext.Provider
|
|
166
164
|
value={{
|
|
@@ -24,6 +24,15 @@ export default {
|
|
|
24
24
|
const Template: StoryFn<typeof GridFormPopoverMenu> = (props) => {
|
|
25
25
|
const configs: [string, GridFormPopoverMenuProps<GridBaseRow>][] = [
|
|
26
26
|
['No options', { options: () => [] }],
|
|
27
|
+
[
|
|
28
|
+
'Elements',
|
|
29
|
+
{
|
|
30
|
+
options: () => [
|
|
31
|
+
{ label: <i>El1</i>, value: 1 },
|
|
32
|
+
{ label: <i>El2</i>, value: 2 },
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
],
|
|
27
36
|
[
|
|
28
37
|
'Enabled/disabled/hidden and divider',
|
|
29
38
|
{
|
|
@@ -43,12 +52,12 @@ const Template: StoryFn<typeof GridFormPopoverMenu> = (props) => {
|
|
|
43
52
|
<div className={'react-menu-inline-test'}>
|
|
44
53
|
<GridContextProvider>
|
|
45
54
|
{configs.map((config, index) => (
|
|
46
|
-
|
|
55
|
+
<div key={index}>
|
|
47
56
|
<h6 ref={anchorRefs[index]}>{config[0]}</h6>
|
|
48
57
|
<GridPopoverContext.Provider value={{ anchorRef: anchorRefs[index] } as any as GridPopoverContextType<any>}>
|
|
49
|
-
<GridFormPopoverMenu {...props} {...config[1]} />
|
|
58
|
+
<GridFormPopoverMenu {...props} {...config[1]} defaultAction={() => {}} />
|
|
50
59
|
</GridPopoverContext.Provider>
|
|
51
|
-
|
|
60
|
+
</div>
|
|
52
61
|
))}
|
|
53
62
|
</GridContextProvider>
|
|
54
63
|
</div>
|