@linzjs/step-ag-grid 32.0.0 → 32.1.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/types.d.ts +2 -0
- package/dist/step-ag-grid.cjs +12 -3
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +13 -4
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Grid.tsx +6 -3
- package/src/components/gridForm/GridFormPopoverMenu.tsx +6 -2
- package/src/components/gridPopoverEdit/GridPopoverMenu.tsx +3 -0
- package/src/components/types.ts +2 -0
- package/src/stories/grid/GridReadOnly.stories.tsx +69 -0
- package/src/stories/grid/gridFormInteraction/GridFormPopoverMenuInteraction.stories.tsx +47 -0
|
@@ -15,6 +15,8 @@ export interface GridOnRowDragEndProps<TData extends GridBaseRow> {
|
|
|
15
15
|
}
|
|
16
16
|
export interface ColDefT<TData extends GridBaseRow, ValueType = any> extends ColDef<TData, ValueType> {
|
|
17
17
|
editable?: boolean | EditableCallback<TData, ValueType>;
|
|
18
|
+
/** When true, this column's editable state ignores the grid-level `readOnly` prop. */
|
|
19
|
+
ignoreGridReadOnly?: boolean;
|
|
18
20
|
valueGetter?: string | ValueGetterFunc<TData, ValueType>;
|
|
19
21
|
valueFormatter?: string | ValueFormatterFunc<TData, ValueType>;
|
|
20
22
|
cellRenderer?: ((props: ICellRendererParams<TData, ValueType>) => ReactElement | string | false | null | undefined) | string;
|
package/dist/step-ag-grid.cjs
CHANGED
|
@@ -61425,9 +61425,11 @@ maxInitialWidth,
|
|
|
61425
61425
|
}
|
|
61426
61426
|
else {
|
|
61427
61427
|
const colDefEditable = colDef.editable;
|
|
61428
|
-
const
|
|
61428
|
+
const ignoreGridReadOnly = colDef.ignoreGridReadOnly === true;
|
|
61429
|
+
const editable = combineEditables(params.loading !== true, ignoreGridReadOnly ? true : params.readOnly !== true, params.defaultColDef?.editable, colDefEditable);
|
|
61429
61430
|
return {
|
|
61430
|
-
|
|
61431
|
+
// ag-grid warns on unrecognised colDef properties, so it can't be left on the returned colDef
|
|
61432
|
+
...lodashEs.omit(colDef, 'ignoreGridReadOnly'),
|
|
61431
61433
|
editable,
|
|
61432
61434
|
cellClassRules: {
|
|
61433
61435
|
...colDef.cellClassRules,
|
|
@@ -63801,7 +63803,11 @@ const GridFormPopoverMenu = (props) => {
|
|
|
63801
63803
|
invalid: () => subComponentSelected && !subComponentIsValid.current,
|
|
63802
63804
|
save,
|
|
63803
63805
|
});
|
|
63804
|
-
|
|
63806
|
+
// isEmpty(options) alone isn't enough: options can be a non-empty array where every item is
|
|
63807
|
+
// hidden (e.g. all actions unavailable in a given mode), which must also show "No actions"
|
|
63808
|
+
// rather than rendering an empty menu body.
|
|
63809
|
+
const hasVisibleOption = options?.some((item) => !item.hidden && item.label !== __isMenuSeparator__);
|
|
63810
|
+
return popoverWrapper(jsxRuntime.jsx(ComponentLoadingWrapper, { loading: !options, className: 'GridFormPopupMenu', children: jsxRuntime.jsx(jsxRuntime.Fragment, { children: !hasVisibleOption ? (jsxRuntime.jsx(MenuItem, { className: 'GridPopoverMenu-noOptions', disabled: true, children: "No actions" }, `GridPopoverMenu-empty`)) : (options?.map((item, index) => item.label === '__isMenuSeparator__' ? (jsxRuntime.jsx(MenuDivider, {}, `$$divider_${index}`)) : (!item.hidden && (jsxRuntime.jsxs(React13.Fragment, { children: [item.subMenu ? (jsxRuntime.jsx(SubMenu, { disabled: !!item.disabled, label: item.label, title: item.disabled && typeof item.disabled !== 'boolean' ? item.disabled : '', children: jsxRuntime.jsx(item.subMenu, {}) })) : (jsxRuntime.jsx(MenuItem, { onClick: (e) => void onMenuItemClick(e, item), disabled: !!item.disabled, title: item.disabled && typeof item.disabled !== 'boolean' ? item.disabled : '', children: item.label })), item.subComponent && subComponentSelected === item && (jsxRuntime.jsx(FocusableItem, { className: 'LuiDeprecatedForms', children: () => (jsxRuntime.jsx(GridSubComponentContext.Provider, { value: {
|
|
63805
63811
|
context: {},
|
|
63806
63812
|
data,
|
|
63807
63813
|
value: subSelectedValue,
|
|
@@ -64170,6 +64176,9 @@ const GridPopoverMenu = (colDef, custom) => GridCell({
|
|
|
64170
64176
|
editable: colDef.editable != null ? colDef.editable : true,
|
|
64171
64177
|
exportable: false,
|
|
64172
64178
|
cellStyle: { flex: 1, justifyContent: 'center' },
|
|
64179
|
+
suppressMovable: true,
|
|
64180
|
+
lockPosition: 'right',
|
|
64181
|
+
resizable: false,
|
|
64173
64182
|
cellRenderer: GridRenderPopoutMenuCell,
|
|
64174
64183
|
// Menus open on single click, this parameter is picked up in Grid.tsx
|
|
64175
64184
|
singleClickEdit: true,
|