@linzjs/step-ag-grid 32.0.0 → 32.1.1
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 +19 -5
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +20 -6
- 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/GridEditBoolean.tsx +10 -3
- package/src/components/gridPopoverEdit/GridPopoverMenu.tsx +3 -0
- package/src/components/types.ts +2 -0
- package/src/stories/grid/GridPopoutEditBoolean.stories.tsx +22 -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,
|
|
@@ -64050,8 +64056,13 @@ const BooleanCellRenderer = (props) => {
|
|
|
64050
64056
|
return;
|
|
64051
64057
|
}
|
|
64052
64058
|
const cell = eGridCell?.querySelector('.ag-cell-focus .grid-edit-boolean input.ag-checkbox-input:not(:disabled)');
|
|
64053
|
-
if (cell
|
|
64054
|
-
cell
|
|
64059
|
+
if (cell) {
|
|
64060
|
+
// When you redraw a cell the activeElement moves to the cell div away from input
|
|
64061
|
+
// Refocus here if the cell div is active back to the input
|
|
64062
|
+
const activeElement = cell.ownerDocument.activeElement;
|
|
64063
|
+
if (activeElement && activeElement.getAttribute('role') === 'gridcell' && activeElement !== cell) {
|
|
64064
|
+
cell.focus();
|
|
64065
|
+
}
|
|
64055
64066
|
}
|
|
64056
64067
|
});
|
|
64057
64068
|
return (jsx("div", { className: clsx('grid-edit-boolean ag-wrapper ag-input-wrapper ag-checkbox-input-wrapper', {
|
|
@@ -64168,6 +64179,9 @@ const GridPopoverMenu = (colDef, custom) => GridCell({
|
|
|
64168
64179
|
editable: colDef.editable != null ? colDef.editable : true,
|
|
64169
64180
|
exportable: false,
|
|
64170
64181
|
cellStyle: { flex: 1, justifyContent: 'center' },
|
|
64182
|
+
suppressMovable: true,
|
|
64183
|
+
lockPosition: 'right',
|
|
64184
|
+
resizable: false,
|
|
64171
64185
|
cellRenderer: GridRenderPopoutMenuCell,
|
|
64172
64186
|
// Menus open on single click, this parameter is picked up in Grid.tsx
|
|
64173
64187
|
singleClickEdit: true,
|