@linzjs/step-ag-grid 7.4.0 → 7.5.0
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 +12 -4
- 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 +12 -5
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- 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
|
|
@@ -4399,7 +4408,7 @@ var useStateDeferred = function (initialValue) {
|
|
|
4399
4408
|
var minimumInProgressTimeMs = 950;
|
|
4400
4409
|
var ActionButton = function (_a) {
|
|
4401
4410
|
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,
|
|
4411
|
+
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
4412
|
var _h = useState(false), inProgress = _h[0], setInProgress = _h[1];
|
|
4404
4413
|
var lastInProgress = usePrevious(inProgress !== null && inProgress !== void 0 ? inProgress : false);
|
|
4405
4414
|
var _j = useStateDeferred(inProgress), localInProgress = _j[0], setLocalInProgress = _j[1], setLocalInProgressDeferred = _j[2];
|
|
@@ -4414,18 +4423,16 @@ var ActionButton = function (_a) {
|
|
|
4414
4423
|
return __generator(this, function (_a) {
|
|
4415
4424
|
switch (_a.label) {
|
|
4416
4425
|
case 0:
|
|
4417
|
-
promise =
|
|
4426
|
+
promise = onClick();
|
|
4418
4427
|
isPromise = typeof promise !== "undefined";
|
|
4419
4428
|
if (!isPromise) return [3 /*break*/, 3];
|
|
4420
4429
|
setInProgress(true);
|
|
4421
|
-
externalSetInProgress && setInProgress(true);
|
|
4422
4430
|
if (!isPromise) return [3 /*break*/, 2];
|
|
4423
4431
|
return [4 /*yield*/, promise];
|
|
4424
4432
|
case 1:
|
|
4425
4433
|
_a.sent();
|
|
4426
4434
|
_a.label = 2;
|
|
4427
4435
|
case 2:
|
|
4428
|
-
externalSetInProgress && setInProgress(false);
|
|
4429
4436
|
setInProgress(false);
|
|
4430
4437
|
_a.label = 3;
|
|
4431
4438
|
case 3: return [2 /*return*/];
|
|
@@ -24652,5 +24659,5 @@ var clickActionButton = function (text, container) { return __awaiter(void 0, vo
|
|
|
24652
24659
|
});
|
|
24653
24660
|
}); };
|
|
24654
24661
|
|
|
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 };
|
|
24662
|
+
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
24663
|
//# sourceMappingURL=step-ag-grid.esm.js.map
|