@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
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
|
2
2
|
import { LuiMiniSpinner, LuiIcon, useShowLUIMessage, LuiStatusSpinner, LuiButtonGroup, LuiButton, LuiCheckboxInput } from '@linzjs/lui';
|
|
3
3
|
import React13, { forwardRef, useContext, useRef, useState, useImperativeHandle, useLayoutEffect, useCallback, useMemo, createContext, memo, useEffect, createElement, Suspense, Component as Component$1, useReducer, cloneElement, Fragment as Fragment$1, useId } from 'react';
|
|
4
4
|
import ReactDOM, { createPortal, unstable_batchedUpdates, flushSync } from 'react-dom';
|
|
5
|
-
import { negate, isEmpty, findIndex, defer, debounce as debounce$1, compact, xorBy, last, difference,
|
|
5
|
+
import { negate, isEmpty, findIndex, defer, debounce as debounce$1, compact, xorBy, last, difference, omit, delay, sortBy, partition, pick, groupBy, fromPairs, toPairs, isEqual, pull, filter, sumBy, remove, flatten, castArray } from 'lodash-es';
|
|
6
6
|
import { createRoot } from 'react-dom/client';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -61423,9 +61423,11 @@ maxInitialWidth,
|
|
|
61423
61423
|
}
|
|
61424
61424
|
else {
|
|
61425
61425
|
const colDefEditable = colDef.editable;
|
|
61426
|
-
const
|
|
61426
|
+
const ignoreGridReadOnly = colDef.ignoreGridReadOnly === true;
|
|
61427
|
+
const editable = combineEditables(params.loading !== true, ignoreGridReadOnly ? true : params.readOnly !== true, params.defaultColDef?.editable, colDefEditable);
|
|
61427
61428
|
return {
|
|
61428
|
-
|
|
61429
|
+
// ag-grid warns on unrecognised colDef properties, so it can't be left on the returned colDef
|
|
61430
|
+
...omit(colDef, 'ignoreGridReadOnly'),
|
|
61429
61431
|
editable,
|
|
61430
61432
|
cellClassRules: {
|
|
61431
61433
|
...colDef.cellClassRules,
|
|
@@ -63799,7 +63801,11 @@ const GridFormPopoverMenu = (props) => {
|
|
|
63799
63801
|
invalid: () => subComponentSelected && !subComponentIsValid.current,
|
|
63800
63802
|
save,
|
|
63801
63803
|
});
|
|
63802
|
-
|
|
63804
|
+
// isEmpty(options) alone isn't enough: options can be a non-empty array where every item is
|
|
63805
|
+
// hidden (e.g. all actions unavailable in a given mode), which must also show "No actions"
|
|
63806
|
+
// rather than rendering an empty menu body.
|
|
63807
|
+
const hasVisibleOption = options?.some((item) => !item.hidden && item.label !== __isMenuSeparator__);
|
|
63808
|
+
return popoverWrapper(jsx(ComponentLoadingWrapper, { loading: !options, className: 'GridFormPopupMenu', children: jsx(Fragment, { children: !hasVisibleOption ? (jsx(MenuItem, { className: 'GridPopoverMenu-noOptions', disabled: true, children: "No actions" }, `GridPopoverMenu-empty`)) : (options?.map((item, index) => item.label === '__isMenuSeparator__' ? (jsx(MenuDivider, {}, `$$divider_${index}`)) : (!item.hidden && (jsxs(Fragment$1, { children: [item.subMenu ? (jsx(SubMenu, { disabled: !!item.disabled, label: item.label, title: item.disabled && typeof item.disabled !== 'boolean' ? item.disabled : '', children: jsx(item.subMenu, {}) })) : (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 && (jsx(FocusableItem, { className: 'LuiDeprecatedForms', children: () => (jsx(GridSubComponentContext.Provider, { value: {
|
|
63803
63809
|
context: {},
|
|
63804
63810
|
data,
|
|
63805
63811
|
value: subSelectedValue,
|
|
@@ -64168,6 +64174,9 @@ const GridPopoverMenu = (colDef, custom) => GridCell({
|
|
|
64168
64174
|
editable: colDef.editable != null ? colDef.editable : true,
|
|
64169
64175
|
exportable: false,
|
|
64170
64176
|
cellStyle: { flex: 1, justifyContent: 'center' },
|
|
64177
|
+
suppressMovable: true,
|
|
64178
|
+
lockPosition: 'right',
|
|
64179
|
+
resizable: false,
|
|
64171
64180
|
cellRenderer: GridRenderPopoutMenuCell,
|
|
64172
64181
|
// Menus open on single click, this parameter is picked up in Grid.tsx
|
|
64173
64182
|
singleClickEdit: true,
|