@linzjs/step-ag-grid 7.4.0 → 7.5.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/index.js +14 -7
- package/dist/index.js.map +1 -1
- package/dist/src/lui/ActionButton.d.ts +2 -3
- package/dist/src/utils/util.d.ts +1 -0
- package/dist/step-ag-grid.esm.js +14 -8
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/gridForm/GridFormDropDown.tsx +2 -2
- package/src/lui/ActionButton.tsx +3 -8
- package/src/stories/components/ActionButton.stories.tsx +3 -3
- package/src/stories/grid/GridPopoutEditGenericTextArea.stories.tsx +1 -1
- package/src/utils/util.ts +10 -0
|
@@ -12,9 +12,8 @@ export interface ActionButtonProps {
|
|
|
12
12
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | "ns";
|
|
13
13
|
iconPosition?: "left" | "right";
|
|
14
14
|
className?: "ActionButton-fill" | string;
|
|
15
|
-
|
|
16
|
-
externalSetInProgress?: () => void;
|
|
15
|
+
onClick: () => Promise<void> | void;
|
|
17
16
|
level?: LuiButtonProps["level"];
|
|
18
17
|
style?: React.CSSProperties;
|
|
19
18
|
}
|
|
20
|
-
export declare const ActionButton: ({ icon, name, inProgressName, dataTestId, style, className, title,
|
|
19
|
+
export declare const ActionButton: ({ icon, name, inProgressName, dataTestId, style, className, title, onClick, size, iconPosition, level, "aria-label": ariaLabel, }: ActionButtonProps) => JSX.Element;
|
package/dist/src/utils/util.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const isNotEmpty: (value?: any) => boolean;
|
|
2
2
|
export declare const wait: (timeoutMs: number) => Promise<(string | null)[]>;
|
|
3
3
|
export declare const isFloat: (value: string) => boolean;
|
|
4
|
+
export declare const findParentWithClass: (className: string, child: Node) => HTMLElement | null;
|
|
4
5
|
export declare const hasParentClass: (className: string, child: Node) => boolean;
|
|
5
6
|
export declare const stringByteLengthIsInvalid: (str: string, maxBytes: number) => boolean;
|
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -1309,6 +1309,15 @@ var isFloat = function (value) {
|
|
|
1309
1309
|
var regexp = /^-?\d+(\.\d+)?$/;
|
|
1310
1310
|
return regexp.test(value);
|
|
1311
1311
|
};
|
|
1312
|
+
var findParentWithClass = function (className, child) {
|
|
1313
|
+
for (var node = child; node; node = node.parentNode) {
|
|
1314
|
+
// When nodes are in portals they aren't type node anymore hence treating it as any here
|
|
1315
|
+
if (node.classList && node.classList.contains(className)) {
|
|
1316
|
+
return node;
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
return null;
|
|
1320
|
+
};
|
|
1312
1321
|
var hasParentClass = function (className, child) {
|
|
1313
1322
|
for (var node = child; node; node = node.parentNode) {
|
|
1314
1323
|
// When nodes are in portals they aren't type node anymore hence treating it as any here
|
|
@@ -3348,7 +3357,7 @@ var GridFormDropDown = function (props) {
|
|
|
3348
3357
|
return (jsxs("div", __assign({ style: { display: "flex", flexDirection: "column", 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, "data-disableenterautosave": true, "data-allowtabtosave": true, onChange: function (e) { return setFilter(e.target.value); }, onKeyDown: handleKeyDown, onKeyUp: handleKeyUp }), props.filterHelpText && isNotEmpty(filter) && (jsx(FormError, { error: null, helpText: props.filterHelpText }))] })));
|
|
3349
3358
|
} })), 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) {
|
|
3350
3359
|
var _a;
|
|
3351
|
-
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: [
|
|
3360
|
+
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) {
|
|
3352
3361
|
if (item.subComponent) {
|
|
3353
3362
|
// toggle selection
|
|
3354
3363
|
setSelectedSubComponent(selectedSubComponent === item ? null : item);
|
|
@@ -3363,8 +3372,7 @@ var GridFormDropDown = function (props) {
|
|
|
3363
3372
|
: CloseReason.TAB_FORWARD
|
|
3364
3373
|
: CloseReason.CLICK).then();
|
|
3365
3374
|
}
|
|
3366
|
-
} }, { children: (
|
|
3367
|
-
(item.subComponent ? "..." : "") }), "".concat(fieldToString(field), "-").concat(index)), item.subComponent && selectedSubComponent === item && (jsx(FocusableItem, __assign({ className: "LuiDeprecatedForms" }, { children: function (ref) { return (jsx(GridSubComponentContext.Provider, __assign({ value: {
|
|
3375
|
+
} }, { children: [(_a = item.label) !== null && _a !== void 0 ? _a : (item.value == null ? "<".concat(item.value, ">") : "".concat(item.value)), item.subComponent ? "..." : ""] }), "".concat(fieldToString(field), "-").concat(index)), item.subComponent && selectedSubComponent === item && (jsx(FocusableItem, __assign({ className: "LuiDeprecatedForms" }, { children: function (ref) { return (jsx(GridSubComponentContext.Provider, __assign({ value: {
|
|
3368
3376
|
context: { options: options },
|
|
3369
3377
|
data: data,
|
|
3370
3378
|
value: subSelectedValue,
|
|
@@ -4399,7 +4407,7 @@ var useStateDeferred = function (initialValue) {
|
|
|
4399
4407
|
var minimumInProgressTimeMs = 950;
|
|
4400
4408
|
var ActionButton = function (_a) {
|
|
4401
4409
|
var _b, _c, _d;
|
|
4402
|
-
var icon = _a.icon, name = _a.name, inProgressName = _a.inProgressName, dataTestId = _a.dataTestId, style = _a.style, className = _a.className, title = _a.title,
|
|
4410
|
+
var icon = _a.icon, name = _a.name, inProgressName = _a.inProgressName, dataTestId = _a.dataTestId, style = _a.style, className = _a.className, title = _a.title, onClick = _a.onClick, _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"];
|
|
4403
4411
|
var _h = useState(false), inProgress = _h[0], setInProgress = _h[1];
|
|
4404
4412
|
var lastInProgress = usePrevious(inProgress !== null && inProgress !== void 0 ? inProgress : false);
|
|
4405
4413
|
var _j = useStateDeferred(inProgress), localInProgress = _j[0], setLocalInProgress = _j[1], setLocalInProgressDeferred = _j[2];
|
|
@@ -4414,18 +4422,16 @@ var ActionButton = function (_a) {
|
|
|
4414
4422
|
return __generator(this, function (_a) {
|
|
4415
4423
|
switch (_a.label) {
|
|
4416
4424
|
case 0:
|
|
4417
|
-
promise =
|
|
4425
|
+
promise = onClick();
|
|
4418
4426
|
isPromise = typeof promise !== "undefined";
|
|
4419
4427
|
if (!isPromise) return [3 /*break*/, 3];
|
|
4420
4428
|
setInProgress(true);
|
|
4421
|
-
externalSetInProgress && setInProgress(true);
|
|
4422
4429
|
if (!isPromise) return [3 /*break*/, 2];
|
|
4423
4430
|
return [4 /*yield*/, promise];
|
|
4424
4431
|
case 1:
|
|
4425
4432
|
_a.sent();
|
|
4426
4433
|
_a.label = 2;
|
|
4427
4434
|
case 2:
|
|
4428
|
-
externalSetInProgress && setInProgress(false);
|
|
4429
4435
|
setInProgress(false);
|
|
4430
4436
|
_a.label = 3;
|
|
4431
4437
|
case 3: return [2 /*return*/];
|
|
@@ -24652,5 +24658,5 @@ var clickActionButton = function (text, container) { return __awaiter(void 0, vo
|
|
|
24652
24658
|
});
|
|
24653
24659
|
}); };
|
|
24654
24660
|
|
|
24655
|
-
export { ActionButton, ComponentLoadingWrapper, ControlledMenu, FocusableItem, GenericCellEditorComponentWrapper, Grid, GridCell, GridCellMultiSelectClassRules, GridCellRenderer, GridContext, GridContextProvider, GridFormDropDown, GridFormMultiSelect, GridFormPopoverMenu, GridFormSubComponentTextArea, GridFormSubComponentTextInput, GridHeaderSelect, GridIcon, GridLoadableCell, GridPopoutEditMultiSelect, GridPopoverContext, GridPopoverContextProvider, GridPopoverEditBearing, GridPopoverEditBearingCorrection, GridPopoverEditDropDown, GridPopoverMenu, GridPopoverMessage, GridPopoverTextArea, GridPopoverTextInput, GridRenderPopoutMenuCell, GridRendererGenericCell, GridSubComponentContext, GridUpdatingContext, GridUpdatingContextProvider, Menu, MenuButton, MenuDivider, MenuGroup, MenuHeader, MenuHeaderItem, MenuHeaderString, MenuItem, MenuRadioGroup, MenuSeparator, MenuSeparatorString, PopoutMenuSeparator, SubMenu, TextAreaInput, TextInputFormatted, bearingCorrectionValueFormatter, bearingNumberParser, bearingStringValidator, bearingValueFormatter, clickActionButton, clickMenuOption, clickMultiSelectOption, closeMenu, convertDDToDMS, countRows, deselectRow, editCell, findActionButton, findCell, findCellContains, findMenuOption, findMultiSelectOption, findRow, getMultiSelectOptions, hasParentClass, isFloat, isNotEmpty, openAndClickMenuOption, queryMenuOption, queryRow, selectCell, selectRow, stringByteLengthIsInvalid, typeOtherInput, typeOtherTextArea, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, wait$2 as wait };
|
|
24661
|
+
export { ActionButton, ComponentLoadingWrapper, ControlledMenu, FocusableItem, GenericCellEditorComponentWrapper, Grid, GridCell, GridCellMultiSelectClassRules, GridCellRenderer, GridContext, GridContextProvider, GridFormDropDown, GridFormMultiSelect, GridFormPopoverMenu, GridFormSubComponentTextArea, GridFormSubComponentTextInput, GridHeaderSelect, GridIcon, GridLoadableCell, GridPopoutEditMultiSelect, GridPopoverContext, GridPopoverContextProvider, GridPopoverEditBearing, GridPopoverEditBearingCorrection, GridPopoverEditDropDown, GridPopoverMenu, GridPopoverMessage, GridPopoverTextArea, GridPopoverTextInput, GridRenderPopoutMenuCell, GridRendererGenericCell, GridSubComponentContext, GridUpdatingContext, GridUpdatingContextProvider, Menu, MenuButton, MenuDivider, MenuGroup, MenuHeader, MenuHeaderItem, MenuHeaderString, MenuItem, MenuRadioGroup, MenuSeparator, MenuSeparatorString, PopoutMenuSeparator, SubMenu, TextAreaInput, TextInputFormatted, bearingCorrectionValueFormatter, bearingNumberParser, bearingStringValidator, bearingValueFormatter, clickActionButton, clickMenuOption, clickMultiSelectOption, closeMenu, convertDDToDMS, countRows, deselectRow, editCell, findActionButton, findCell, findCellContains, findMenuOption, findMultiSelectOption, findParentWithClass, findRow, getMultiSelectOptions, hasParentClass, isFloat, isNotEmpty, openAndClickMenuOption, queryMenuOption, queryRow, selectCell, selectRow, stringByteLengthIsInvalid, typeOtherInput, typeOtherTextArea, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, wait$2 as wait };
|
|
24656
24662
|
//# sourceMappingURL=step-ag-grid.esm.js.map
|