@linzjs/step-ag-grid 2.4.1 → 2.4.3
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 +27 -9
- package/dist/index.js.map +1 -1
- package/dist/src/components/gridForm/GridFormSubComponentTextInput.d.ts +2 -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 +27 -9
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/gridForm/GridFormSubComponentTextInput.tsx +12 -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) {
|
|
@@ -3662,10 +3661,11 @@ var GridPopoverTextInput = function (colDef, params) {
|
|
|
3662
3661
|
};
|
|
3663
3662
|
|
|
3664
3663
|
var GridFormSubComponentTextInput = function (_a) {
|
|
3665
|
-
var keyDown = _a.keyDown, placeholder = _a.placeholder, setValue = _a.setValue;
|
|
3664
|
+
var keyDown = _a.keyDown, placeholder = _a.placeholder, setValue = _a.setValue, className = _a.className;
|
|
3666
3665
|
var placeholderText = placeholder || "Other...";
|
|
3666
|
+
var inputClass = className || "";
|
|
3667
3667
|
var _b = react.useState(""), inputValue = _b[0], setInputValue = _b[1];
|
|
3668
|
-
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(TextInputFormatted, { value: inputValue, onChange: function (e) {
|
|
3668
|
+
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx(TextInputFormatted, { className: inputClass, value: inputValue, onChange: function (e) {
|
|
3669
3669
|
var value = e.target.value;
|
|
3670
3670
|
setValue(value);
|
|
3671
3671
|
setInputValue(value);
|
|
@@ -3676,6 +3676,9 @@ var GridFormSubComponentTextInput = function (_a) {
|
|
|
3676
3676
|
if (document.activeElement != e.currentTarget) {
|
|
3677
3677
|
e.currentTarget.focus();
|
|
3678
3678
|
}
|
|
3679
|
+
},
|
|
3680
|
+
style: {
|
|
3681
|
+
width: "100%"
|
|
3679
3682
|
}
|
|
3680
3683
|
} }) }));
|
|
3681
3684
|
};
|
|
@@ -3796,15 +3799,30 @@ var minimumInProgressTimeMs = 950;
|
|
|
3796
3799
|
var ActionButton = function (_a) {
|
|
3797
3800
|
var _b;
|
|
3798
3801
|
var _c;
|
|
3799
|
-
var icon = _a.icon, name = _a.name, inProgressName = _a.inProgressName, dataTestId = _a.dataTestId,
|
|
3802
|
+
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;
|
|
3803
|
+
var _e = react.useState(false), inProgress = _e[0], setInProgress = _e[1];
|
|
3800
3804
|
var lastInProgress = usePrevious(inProgress !== null && inProgress !== void 0 ? inProgress : false);
|
|
3801
|
-
var
|
|
3805
|
+
var _f = useStateDeferred(inProgress), localInProgress = _f[0], setLocalInProgress = _f[1], setLocalInProgressDeferred = _f[2];
|
|
3802
3806
|
react.useEffect(function () {
|
|
3803
3807
|
if (inProgress == lastInProgress)
|
|
3804
3808
|
return;
|
|
3805
3809
|
inProgress ? setLocalInProgress(true) : setLocalInProgressDeferred(false, minimumInProgressTimeMs);
|
|
3806
3810
|
}, [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:
|
|
3811
|
+
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 () {
|
|
3812
|
+
return __generator(this, function (_a) {
|
|
3813
|
+
switch (_a.label) {
|
|
3814
|
+
case 0:
|
|
3815
|
+
setInProgress(true);
|
|
3816
|
+
externalSetInProgress && setInProgress(true);
|
|
3817
|
+
return [4 /*yield*/, onAction()];
|
|
3818
|
+
case 1:
|
|
3819
|
+
_a.sent();
|
|
3820
|
+
externalSetInProgress && setInProgress(false);
|
|
3821
|
+
setInProgress(false);
|
|
3822
|
+
return [2 /*return*/];
|
|
3823
|
+
}
|
|
3824
|
+
});
|
|
3825
|
+
}); }, disabled: localInProgress }, { children: [localInProgress ? (jsxRuntime.jsx(lui.LuiMiniSpinner, { size: 16, divProps: (_b = {
|
|
3808
3826
|
"data-testid": "loading-spinner",
|
|
3809
3827
|
style: { padding: 0, margin: 0, paddingRight: 8 },
|
|
3810
3828
|
role: "status"
|