@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 CHANGED
@@ -1330,6 +1330,15 @@ var isFloat = function (value) {
1330
1330
  var regexp = /^-?\d+(\.\d+)?$/;
1331
1331
  return regexp.test(value);
1332
1332
  };
1333
+ var findParentWithClass = function (className, child) {
1334
+ for (var node = child; node; node = node.parentNode) {
1335
+ // When nodes are in portals they aren't type node anymore hence treating it as any here
1336
+ if (node.classList && node.classList.contains(className)) {
1337
+ return node;
1338
+ }
1339
+ }
1340
+ return null;
1341
+ };
1333
1342
  var hasParentClass = function (className, child) {
1334
1343
  for (var node = child; node; node = node.parentNode) {
1335
1344
  // When nodes are in portals they aren't type node anymore hence treating it as any here
@@ -3369,7 +3378,7 @@ var GridFormDropDown = function (props) {
3369
3378
  return (jsxRuntime.jsxs("div", __assign({ style: { display: "flex", flexDirection: "column", width: "100%" } }, { children: [jsxRuntime.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) && (jsxRuntime.jsx(FormError, { error: null, helpText: props.filterHelpText }))] })));
3370
3379
  } })), jsxRuntime.jsx(MenuDivider, {}, "$$divider_filter")] }))), jsxRuntime.jsx(ComponentLoadingWrapper, __assign({ loading: !options, className: "GridFormDropDown-options" }, { children: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [options && options.length == (filteredValues === null || filteredValues === void 0 ? void 0 : filteredValues.length) && (jsxRuntime.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) {
3371
3380
  var _a;
3372
- return item.value === MenuSeparatorString ? (jsxRuntime.jsx(MenuDivider, {}, "$$divider_".concat(index))) : item.value === MenuHeaderString ? (jsxRuntime.jsx(MenuHeader, { children: item.label }, "$$header_".concat(index))) : filteredValues.includes(item.value) ? null : (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx(MenuItem, __assign({ disabled: !!item.disabled, title: item.disabled && typeof item.disabled !== "boolean" ? item.disabled : "", value: item.value, onClick: function (e) {
3381
+ return item.value === MenuSeparatorString ? (jsxRuntime.jsx(MenuDivider, {}, "$$divider_".concat(index))) : item.value === MenuHeaderString ? (jsxRuntime.jsx(MenuHeader, { children: item.label }, "$$header_".concat(index))) : filteredValues.includes(item.value) ? null : (jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs(MenuItem, __assign({ disabled: !!item.disabled, title: item.disabled && typeof item.disabled !== "boolean" ? item.disabled : "", value: item.value, onClick: function (e) {
3373
3382
  if (item.subComponent) {
3374
3383
  // toggle selection
3375
3384
  setSelectedSubComponent(selectedSubComponent === item ? null : item);
@@ -3384,8 +3393,7 @@ var GridFormDropDown = function (props) {
3384
3393
  : CloseReason.TAB_FORWARD
3385
3394
  : CloseReason.CLICK).then();
3386
3395
  }
3387
- } }, { children: ((_a = item.label) !== null && _a !== void 0 ? _a : (item.value == null ? "<".concat(item.value, ">") : "".concat(item.value))) +
3388
- (item.subComponent ? "..." : "") }), "".concat(fieldToString(field), "-").concat(index)), item.subComponent && selectedSubComponent === item && (jsxRuntime.jsx(FocusableItem, __assign({ className: "LuiDeprecatedForms" }, { children: function (ref) { return (jsxRuntime.jsx(GridSubComponentContext.Provider, __assign({ value: {
3396
+ } }, { 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 && (jsxRuntime.jsx(FocusableItem, __assign({ className: "LuiDeprecatedForms" }, { children: function (ref) { return (jsxRuntime.jsx(GridSubComponentContext.Provider, __assign({ value: {
3389
3397
  context: { options: options },
3390
3398
  data: data,
3391
3399
  value: subSelectedValue,
@@ -4420,7 +4428,7 @@ var useStateDeferred = function (initialValue) {
4420
4428
  var minimumInProgressTimeMs = 950;
4421
4429
  var ActionButton = function (_a) {
4422
4430
  var _b, _c, _d;
4423
- 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"];
4431
+ 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"];
4424
4432
  var _h = React.useState(false), inProgress = _h[0], setInProgress = _h[1];
4425
4433
  var lastInProgress = usePrevious(inProgress !== null && inProgress !== void 0 ? inProgress : false);
4426
4434
  var _j = useStateDeferred(inProgress), localInProgress = _j[0], setLocalInProgress = _j[1], setLocalInProgressDeferred = _j[2];
@@ -4435,18 +4443,16 @@ var ActionButton = function (_a) {
4435
4443
  return __generator(this, function (_a) {
4436
4444
  switch (_a.label) {
4437
4445
  case 0:
4438
- promise = onAction();
4446
+ promise = onClick();
4439
4447
  isPromise = typeof promise !== "undefined";
4440
4448
  if (!isPromise) return [3 /*break*/, 3];
4441
4449
  setInProgress(true);
4442
- externalSetInProgress && setInProgress(true);
4443
4450
  if (!isPromise) return [3 /*break*/, 2];
4444
4451
  return [4 /*yield*/, promise];
4445
4452
  case 1:
4446
4453
  _a.sent();
4447
4454
  _a.label = 2;
4448
4455
  case 2:
4449
- externalSetInProgress && setInProgress(false);
4450
4456
  setInProgress(false);
4451
4457
  _a.label = 3;
4452
4458
  case 3: return [2 /*return*/];
@@ -24739,6 +24745,7 @@ exports.findCell = findCell;
24739
24745
  exports.findCellContains = findCellContains;
24740
24746
  exports.findMenuOption = findMenuOption;
24741
24747
  exports.findMultiSelectOption = findMultiSelectOption;
24748
+ exports.findParentWithClass = findParentWithClass;
24742
24749
  exports.findRow = findRow;
24743
24750
  exports.getMultiSelectOptions = getMultiSelectOptions;
24744
24751
  exports.hasParentClass = hasParentClass;