@linzjs/step-ag-grid 7.0.0 → 7.0.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 +8 -8
- package/dist/index.js.map +1 -1
- package/dist/src/lui/ActionButton.d.ts +3 -2
- package/dist/step-ag-grid.esm.js +8 -8
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/GridCell.tsx +1 -1
- package/src/components/gridForm/GridFormDropDown.tsx +4 -3
- package/src/lui/ActionButton.scss +10 -0
- package/src/lui/ActionButton.tsx +11 -3
- package/src/react-menu3/components/ControlledMenu.tsx +1 -1
- package/src/stories/components/ActionButton.stories.tsx +2 -0
- package/src/stories/grid/FormTest.tsx +1 -1
- package/src/styles/GridFormDropDown.scss +4 -0
|
@@ -11,9 +11,10 @@ export interface ActionButtonProps {
|
|
|
11
11
|
dataTestId?: string;
|
|
12
12
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "ns";
|
|
13
13
|
iconPosition?: "left" | "right";
|
|
14
|
-
className?: string;
|
|
14
|
+
className?: "ActionButton-fill" | string;
|
|
15
15
|
onAction: () => Promise<void> | void;
|
|
16
16
|
externalSetInProgress?: () => void;
|
|
17
17
|
level?: LuiButtonProps["level"];
|
|
18
|
+
style?: React.CSSProperties;
|
|
18
19
|
}
|
|
19
|
-
export declare const ActionButton: ({ icon, name, inProgressName, dataTestId, className, title, onAction, externalSetInProgress, size, iconPosition, level, "aria-label": ariaLabel, }: ActionButtonProps) => JSX.Element;
|
|
20
|
+
export declare const ActionButton: ({ icon, name, inProgressName, dataTestId, style, className, title, onAction, externalSetInProgress, size, iconPosition, level, "aria-label": ariaLabel, }: ActionButtonProps) => JSX.Element;
|
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -1397,7 +1397,7 @@ var ControlledMenuFr = function (_a, externalRef) {
|
|
|
1397
1397
|
if (activeElement !== firstInputEl && activeElement !== lastInputEl)
|
|
1398
1398
|
return;
|
|
1399
1399
|
var isTextArea = activeElement.nodeName === "TEXTAREA";
|
|
1400
|
-
var suppressEnterAutoSave = activeElement.getAttribute("data-
|
|
1400
|
+
var suppressEnterAutoSave = activeElement.getAttribute("data-disableenterautosave") || isTextArea;
|
|
1401
1401
|
var allowTabToSave = activeElement.getAttribute("data-allowtabtoSave");
|
|
1402
1402
|
var invokeSave = function (reason) {
|
|
1403
1403
|
var _a, _b;
|
|
@@ -2885,7 +2885,7 @@ var GridCell = function (props, custom) {
|
|
|
2885
2885
|
})), { suppressKeyboardEvent: function (e) {
|
|
2886
2886
|
// It's important that aggrid doesn't trigger edit on enter
|
|
2887
2887
|
// as the incorrect selected rows will be returned
|
|
2888
|
-
return e.event.key
|
|
2888
|
+
return !["ArrowLeft", "ArrowRight", "ArrowDown", "ArrowUp", "Tab", " "].includes(e.event.key);
|
|
2889
2889
|
} }), ((custom === null || custom === void 0 ? void 0 : custom.editorParams) && {
|
|
2890
2890
|
cellEditorParams: __assign(__assign({}, custom.editorParams), { multiEdit: custom.multiEdit })
|
|
2891
2891
|
})), {
|
|
@@ -3008,7 +3008,7 @@ var GridRenderPopoutMenuCell = function (props) {
|
|
|
3008
3008
|
var css_248z$6 = ".GridMultiSelect-containerSmall .GridFormMultiSelect-options{max-height:130px;overflow-y:auto}.GridMultiSelect-containerMedium .GridFormMultiSelect-options{max-height:190px;overflow-y:auto}.GridMultiSelect-containerLarge .GridFormMultiSelect-options{max-height:320px;overflow-y:auto}.GridMultiSelect-containerUnlimited .GridFormMultiSelect-options{overflow-y:auto}";
|
|
3009
3009
|
styleInject(css_248z$6);
|
|
3010
3010
|
|
|
3011
|
-
var css_248z$5 = ".GridPopoverEditDropDown-containerSmall .GridFormDropDown-options{max-height:120px;overflow-y:auto}.GridPopoverEditDropDown-containerMedium .GridFormDropDown-options{max-height:220px;overflow-y:auto}.GridPopoverEditDropDown-containerLarge .GridFormDropDown-options{max-height:400px;overflow-y:auto}.GridPopoverEditDropDown-containerUnlimited .GridFormDropDown-options{overflow-y:auto}";
|
|
3011
|
+
var css_248z$5 = ".GridPopoverEditDropDown-containerSmall .GridFormDropDown-options{max-height:120px;overflow-y:auto}.GridPopoverEditDropDown-containerMedium .GridFormDropDown-options{max-height:220px;overflow-y:auto}.GridPopoverEditDropDown-containerLarge .GridFormDropDown-options{max-height:400px;overflow-y:auto}.GridPopoverEditDropDown-containerUnlimited .GridFormDropDown-options{overflow-y:auto}.GridPopoverEditDropDown-noOptions{justify-content:center}";
|
|
3012
3012
|
styleInject(css_248z$5);
|
|
3013
3013
|
|
|
3014
3014
|
/* global setTimeout, clearTimeout */
|
|
@@ -3279,8 +3279,8 @@ var GridFormDropDown = function (props) {
|
|
|
3279
3279
|
return popoverWrapper(jsxs(Fragment$1, { children: [props.filtered && (jsxs("div", __assign({ className: "GridFormDropDown-filter" }, { children: [jsx(FocusableItem, __assign({ className: "filter-item" }, { children: function (_a) {
|
|
3280
3280
|
var _b;
|
|
3281
3281
|
var ref = _a.ref;
|
|
3282
|
-
return (jsx("div", __assign({ style: { display: "flex", width: "100%" } }, { children: jsx("input", { autoFocus: true, className: "
|
|
3283
|
-
} })), jsx(MenuDivider, {}, "$$divider_filter")] }))), jsx(ComponentLoadingWrapper, __assign({ loading: !options, className: "GridFormDropDown-options" }, { children: jsxs(Fragment$1, { children: [options && options.length == (filteredValues === null || filteredValues === void 0 ? void 0 : filteredValues.length) && (jsx(MenuItem, { children: "
|
|
3282
|
+
return (jsx("div", __assign({ style: { display: "flex", width: "100%" } }, { children: jsx("input", { autoFocus: true, className: "LuiTextInput-input", ref: ref, type: "text", placeholder: (_b = props.filterPlaceholder) !== null && _b !== void 0 ? _b : "Placeholder", "data-testid": "filteredMenu-free-text-input", defaultValue: filter, onChange: function (e) { return setFilter(e.target.value.toLowerCase()); } }) })));
|
|
3283
|
+
} })), jsx(MenuDivider, {}, "$$divider_filter")] }))), jsx(ComponentLoadingWrapper, __assign({ loading: !options, className: "GridFormDropDown-options" }, { children: jsxs(Fragment$1, { children: [options && options.length == (filteredValues === null || filteredValues === void 0 ? void 0 : filteredValues.length) && (jsx(MenuItem, __assign({ className: "GridPopoverEditDropDown-noOptions" }, { children: "No Options" }), "".concat(fieldToString(field), "-empty"))), options === null || options === void 0 ? void 0 : options.map(function (item, index) {
|
|
3284
3284
|
var _a;
|
|
3285
3285
|
return item.value === MenuSeparatorString ? (jsx(MenuDivider, {}, "$$divider_".concat(index))) : item.value === MenuHeaderString ? (jsx(MenuHeader, { children: item.label }, "$$header_".concat(index))) : filteredValues.includes(item.value) ? null : (jsxs("div", { children: [jsxs(MenuItem, __assign({ disabled: !!item.disabled, title: item.disabled && typeof item.disabled !== "boolean" ? item.disabled : "", value: item.value, onClick: function (e) {
|
|
3286
3286
|
if (item.subComponent) {
|
|
@@ -4210,7 +4210,7 @@ var GridFormSubComponentTextArea = function (props) {
|
|
|
4210
4210
|
return (jsx("div", __assign({ className: clsx("FreeTextInput LuiDeprecatedForms", props.className) }, { children: jsx(TextAreaInput, { className: "free-text-input", value: value, onChange: function (e) { return setValue(e.target.value); }, error: invalid(), helpText: helpText, autoFocus: true, placeholder: props.placeholder }) })));
|
|
4211
4211
|
};
|
|
4212
4212
|
|
|
4213
|
-
var css_248z = ".ActionButton{align-items:center;display:flex}.ActionButton .LuiIcon{margin:0 4px!important}.ActionButton-minimalArea{position:relative}.ActionButton-minimalAreaDisplay{position:absolute}.ActionButton-minimalAreaExpand{visibility:hidden}.ActionButton-inProgress{background-color:#e2f3f7!important;color:#007198!important;cursor:progress}.ActionButton-inProgress svg *{fill:#0000!important}";
|
|
4213
|
+
var css_248z = ".ActionButton{align-items:center;display:flex}.ActionButton-minimal{padding-right:38px!important}.ActionButton .LuiIcon{margin:0 4px!important}.ActionButton-minimalArea{position:relative}.ActionButton-minimalAreaDisplay{position:absolute}.ActionButton-minimalAreaExpand{visibility:hidden}.ActionButton-inProgress{background-color:#e2f3f7!important;color:#007198!important;cursor:progress}.ActionButton-inProgress svg *{fill:#0000!important}.ActionButton-fill{justify-content:center;width:100%}";
|
|
4214
4214
|
styleInject(css_248z);
|
|
4215
4215
|
|
|
4216
4216
|
/**
|
|
@@ -4283,7 +4283,7 @@ var useStateDeferred = function (initialValue) {
|
|
|
4283
4283
|
var minimumInProgressTimeMs = 950;
|
|
4284
4284
|
var ActionButton = function (_a) {
|
|
4285
4285
|
var _b, _c, _d;
|
|
4286
|
-
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, _e = _a.size, size = _e === void 0 ? "sm" : _e, _f = _a.iconPosition, iconPosition = _f === void 0 ? "left" : _f, _g = _a.level, level = _g === void 0 ? "tertiary" : _g, ariaLabel = _a["aria-label"];
|
|
4286
|
+
var icon = _a.icon, name = _a.name, inProgressName = _a.inProgressName, dataTestId = _a.dataTestId, style = _a.style, className = _a.className, title = _a.title, onAction = _a.onAction, externalSetInProgress = _a.externalSetInProgress, _e = _a.size, size = _e === void 0 ? "sm" : _e, _f = _a.iconPosition, iconPosition = _f === void 0 ? "left" : _f, _g = _a.level, level = _g === void 0 ? "tertiary" : _g, ariaLabel = _a["aria-label"];
|
|
4287
4287
|
var _h = useState(false), inProgress = _h[0], setInProgress = _h[1];
|
|
4288
4288
|
var lastInProgress = usePrevious(inProgress !== null && inProgress !== void 0 ? inProgress : false);
|
|
4289
4289
|
var _j = useStateDeferred(inProgress), localInProgress = _j[0], setLocalInProgress = _j[1], setLocalInProgressDeferred = _j[2];
|
|
@@ -4293,7 +4293,7 @@ var ActionButton = function (_a) {
|
|
|
4293
4293
|
inProgress ? setLocalInProgress(true) : setLocalInProgressDeferred(false, minimumInProgressTimeMs);
|
|
4294
4294
|
}, [inProgress, lastInProgress, setLocalInProgress, setLocalInProgressDeferred]);
|
|
4295
4295
|
var buttonText = (jsxs("span", __assign({ className: "ActionButton-minimalArea" }, { children: [jsx("span", __assign({ className: "ActionButton-minimalAreaDisplay" }, { children: (_b = (localInProgress ? inProgressName : name)) !== null && _b !== void 0 ? _b : name })), jsx("span", __assign({ className: "ActionButton-minimalAreaExpand" }, { children: name }))] })));
|
|
4296
|
-
return (jsxs(LuiButton, __assign({ "data-testid": dataTestId, type: "button", level: level, title: (_c = title !== null && title !== void 0 ? title : ariaLabel) !== null && _c !== void 0 ? _c : name, "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : name, className: clsx("lui-button-icon-right", "ActionButton", className, localInProgress && "ActionButton-inProgress"), size: "lg", style: name == null
|
|
4296
|
+
return (jsxs(LuiButton, __assign({ "data-testid": dataTestId, type: "button", level: level, title: (_c = title !== null && title !== void 0 ? title : ariaLabel) !== null && _c !== void 0 ? _c : name, "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : name, className: clsx("lui-button-icon-right", "ActionButton", className, localInProgress && "ActionButton-inProgress", name != null && !(className === null || className === void 0 ? void 0 : className.includes("ActionButton-fill")) && "ActionButton-minimal"), size: "lg", style: __assign(__assign({}, (name == null && { padding: "8px 5px" })), style), onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
4297
4297
|
var promise, isPromise;
|
|
4298
4298
|
return __generator(this, function (_a) {
|
|
4299
4299
|
switch (_a.label) {
|