@linzjs/step-ag-grid 2.4.1 → 2.4.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/index.js +21 -7
- package/dist/index.js.map +1 -1
- package/dist/src/components/gridPopoverEdit/GridPopoverMenu.d.ts +1 -1
- package/dist/src/lui/ActionButton.d.ts +3 -3
- package/dist/step-ag-grid.esm.js +21 -7
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/gridPopoverEdit/GridPopoverMenu.tsx +3 -3
- package/src/lui/ActionButton.tsx +15 -7
- package/src/stories/components/ActionButton.stories.tsx +2 -13
- package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +1 -11
- package/src/stories/grid/GridPopoutEditMultiSelect.stories.tsx +4 -5
- package/src/stories/grid/GridReadOnly.stories.tsx +1 -0
package/dist/index.js
CHANGED
|
@@ -3274,12 +3274,11 @@ var GridFormPopoutMenu = function (_props) {
|
|
|
3274
3274
|
/**
|
|
3275
3275
|
* Popout burger menu
|
|
3276
3276
|
*/
|
|
3277
|
-
var GridPopoverMenu = function (colDef,
|
|
3278
|
-
|
|
3279
|
-
return GridCell(__assign(__assign({ maxWidth: 64, editable: colDef.editable != null ? colDef.editable : true, cellRenderer: GridRenderPopoutMenuCell, cellClass: ((_a = colDef === null || colDef === void 0 ? void 0 : colDef.cellEditorParams) === null || _a === void 0 ? void 0 : _a.multiEdit) !== false ? GenericMultiEditCellClass : undefined }, colDef), { cellRendererParams: {
|
|
3277
|
+
var GridPopoverMenu = function (colDef, custom) {
|
|
3278
|
+
return GridCell(__assign(__assign({ maxWidth: 64, editable: colDef.editable != null ? colDef.editable : true, cellRenderer: GridRenderPopoutMenuCell, cellClass: (custom === null || custom === void 0 ? void 0 : custom.multiEdit) ? GenericMultiEditCellClass : undefined }, colDef), { cellRendererParams: {
|
|
3280
3279
|
// Menus open on single click, this parameter is picked up in Grid.tsx
|
|
3281
3280
|
singleClickEdit: true
|
|
3282
|
-
} }), __assign({ editor: GridFormPopoutMenu },
|
|
3281
|
+
} }), __assign({ editor: GridFormPopoutMenu }, custom));
|
|
3283
3282
|
};
|
|
3284
3283
|
|
|
3285
3284
|
var bearingValueFormatter = function (params) {
|
|
@@ -3796,15 +3795,30 @@ var minimumInProgressTimeMs = 950;
|
|
|
3796
3795
|
var ActionButton = function (_a) {
|
|
3797
3796
|
var _b;
|
|
3798
3797
|
var _c;
|
|
3799
|
-
var icon = _a.icon, name = _a.name, inProgressName = _a.inProgressName, dataTestId = _a.dataTestId,
|
|
3798
|
+
var icon = _a.icon, name = _a.name, inProgressName = _a.inProgressName, dataTestId = _a.dataTestId, className = _a.className, title = _a.title, onAction = _a.onAction, externalSetInProgress = _a.externalSetInProgress, _d = _a.size, size = _d === void 0 ? "sm" : _d;
|
|
3799
|
+
var _e = react.useState(false), inProgress = _e[0], setInProgress = _e[1];
|
|
3800
3800
|
var lastInProgress = usePrevious(inProgress !== null && inProgress !== void 0 ? inProgress : false);
|
|
3801
|
-
var
|
|
3801
|
+
var _f = useStateDeferred(inProgress), localInProgress = _f[0], setLocalInProgress = _f[1], setLocalInProgressDeferred = _f[2];
|
|
3802
3802
|
react.useEffect(function () {
|
|
3803
3803
|
if (inProgress == lastInProgress)
|
|
3804
3804
|
return;
|
|
3805
3805
|
inProgress ? setLocalInProgress(true) : setLocalInProgressDeferred(false, minimumInProgressTimeMs);
|
|
3806
3806
|
}, [inProgress, lastInProgress, setLocalInProgress, setLocalInProgressDeferred]);
|
|
3807
|
-
return (jsxRuntime.jsxs(lui.LuiButton, __assign({ "data-testid": dataTestId, type: "button", level: "tertiary", title: title !== null && title !== void 0 ? title : name, "aria-label": name, className: clsx("lui-button-icon", "ActionButton", className, localInProgress && "ActionButton-inProgress"), size: "lg", onClick:
|
|
3807
|
+
return (jsxRuntime.jsxs(lui.LuiButton, __assign({ "data-testid": dataTestId, type: "button", level: "tertiary", title: title !== null && title !== void 0 ? title : name, "aria-label": name, className: clsx("lui-button-icon", "ActionButton", className, localInProgress && "ActionButton-inProgress"), size: "lg", onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
3808
|
+
return __generator(this, function (_a) {
|
|
3809
|
+
switch (_a.label) {
|
|
3810
|
+
case 0:
|
|
3811
|
+
setInProgress(true);
|
|
3812
|
+
externalSetInProgress && setInProgress(true);
|
|
3813
|
+
return [4 /*yield*/, onAction()];
|
|
3814
|
+
case 1:
|
|
3815
|
+
_a.sent();
|
|
3816
|
+
externalSetInProgress && setInProgress(false);
|
|
3817
|
+
setInProgress(false);
|
|
3818
|
+
return [2 /*return*/];
|
|
3819
|
+
}
|
|
3820
|
+
});
|
|
3821
|
+
}); }, disabled: localInProgress }, { children: [localInProgress ? (jsxRuntime.jsx(lui.LuiMiniSpinner, { size: 16, divProps: (_b = {
|
|
3808
3822
|
"data-testid": "loading-spinner",
|
|
3809
3823
|
style: { padding: 0, margin: 0, paddingRight: 8 },
|
|
3810
3824
|
role: "status"
|