@linzjs/step-ag-grid 7.2.0 → 7.3.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
@@ -3365,7 +3365,7 @@ var GridFormDropDown = function (props) {
3365
3365
  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 }))] })));
3366
3366
  } })), 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) {
3367
3367
  var _a;
3368
- 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) {
3368
+ 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) {
3369
3369
  if (item.subComponent) {
3370
3370
  // toggle selection
3371
3371
  setSelectedSubComponent(selectedSubComponent === item ? null : item);
@@ -3380,7 +3380,8 @@ var GridFormDropDown = function (props) {
3380
3380
  : CloseReason.TAB_FORWARD
3381
3381
  : CloseReason.CLICK).then();
3382
3382
  }
3383
- } }, { 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: {
3383
+ } }, { children: ((_a = item.label) !== null && _a !== void 0 ? _a : (item.value == null ? "<".concat(item.value, ">") : "".concat(item.value))) +
3384
+ (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: {
3384
3385
  context: { options: options },
3385
3386
  data: data,
3386
3387
  value: subSelectedValue,
@@ -3400,7 +3401,7 @@ var GridFormDropDown = function (props) {
3400
3401
  return [2 /*return*/];
3401
3402
  });
3402
3403
  }); }
3403
- } }, { children: item.subComponent && (jsxRuntime.jsx(item.subComponent, {}, "".concat(fieldToString(field), "-").concat(index, "_subcomponent_inner"))) }))); } }), "".concat(item.label, "_subcomponent")))] }, "menu-wrapper-".concat(index)));
3404
+ } }, { children: item.subComponent && (jsxRuntime.jsx("div", __assign({ className: "subComponent" }, { children: jsxRuntime.jsx(item.subComponent, {}, "".concat(fieldToString(field), "-").concat(index, "_subcomponent_inner")) }))) }))); } }), "".concat(item.label, "_subcomponent")))] }, "menu-wrapper-".concat(index)));
3404
3405
  })] }) }))] }));
3405
3406
  };
3406
3407
 
@@ -3771,7 +3772,7 @@ var MenuSubComponent = function (props) {
3771
3772
  subComponentIsValid["".concat(item.value)] = valid;
3772
3773
  },
3773
3774
  triggerSave: triggerSave
3774
- } }, { children: jsxRuntime.jsx(item.subComponent, {}) })));
3775
+ } }, { children: jsxRuntime.jsx("div", __assign({ className: "subComponent" }, { children: jsxRuntime.jsx(item.subComponent, {}) })) })));
3775
3776
  } }), "".concat(item.value, "_subcomponent")));
3776
3777
  };
3777
3778
 
@@ -3917,7 +3918,7 @@ var GridFormPopoverMenu = function (props) {
3917
3918
  subComponentIsValid.current = valid;
3918
3919
  },
3919
3920
  triggerSave: triggerSave
3920
- } }, { children: jsxRuntime.jsx(item.subComponent, {}) })));
3921
+ } }, { children: jsxRuntime.jsx("div", __assign({ className: "subComponent" }, { children: jsxRuntime.jsx(item.subComponent, {}) })) })));
3921
3922
  } }), "".concat(item.label, "_subcomponent")))] }, "".concat(item.label))));
3922
3923
  }) }) })));
3923
3924
  };
@@ -4339,7 +4340,7 @@ var GridFormSubComponentTextArea = function (props) {
4339
4340
  React.useEffect(function () {
4340
4341
  setValid(value != null && invalid() == null);
4341
4342
  }, [setValid, invalid, value]);
4342
- return (jsxRuntime.jsx("div", __assign({ className: clsx("FreeTextInput LuiDeprecatedForms", props.className) }, { children: jsxRuntime.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 }) })));
4343
+ return (jsxRuntime.jsx("div", __assign({ className: clsx("FreeTextInput", props.className) }, { children: jsxRuntime.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 }) })));
4343
4344
  };
4344
4345
 
4345
4346
  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%}";
@@ -24256,6 +24257,12 @@ var queryAllBySelector = function (selector, container) {
24256
24257
  return Array.from(container.querySelectorAll(selector));
24257
24258
  };
24258
24259
  var escapeSelectorParam = function (param) { return param.replace(/["\\]/g, "\\$&"); };
24260
+ var getMatcher = function (matcherText) {
24261
+ var textMatcher = typeof matcherText === "string"
24262
+ ? function (text) { return text != null && text.toLowerCase() === matcherText.toLowerCase(); }
24263
+ : function (text) { return text != null && matcherText.test(text); };
24264
+ return function (e) { var _a, _b; return textMatcher((_a = e.innerHTML) === null || _a === void 0 ? void 0 : _a.trim()) || textMatcher((_b = e.innerText) === null || _b === void 0 ? void 0 : _b.trim()); };
24265
+ };
24259
24266
  /**
24260
24267
  * Build selector for quick operations.
24261
24268
  *
@@ -24263,7 +24270,6 @@ var escapeSelectorParam = function (param) { return param.replace(/["\\]/g, "\\$
24263
24270
  * @param container Optional container to search in.
24264
24271
  */
24265
24272
  var quickSelector = function (props, container) {
24266
- var _a, _b;
24267
24273
  var selector = "";
24268
24274
  var lastIQueryQuick = props;
24269
24275
  for (var loop = props; loop; loop = loop.child) {
@@ -24280,16 +24286,9 @@ var quickSelector = function (props, container) {
24280
24286
  throw "get/query/findQuick needs at least one defined parameter";
24281
24287
  }
24282
24288
  var els = queryAllBySelector(selector, container);
24283
- var textMatch = (_a = lastIQueryQuick.textEquals) === null || _a === void 0 ? void 0 : _a.toLowerCase();
24284
- if (textMatch != null) {
24285
- els = els.filter(function (el) { return el.innerHTML.toLowerCase() === textMatch || el.innerText.toLowerCase() === textMatch; });
24286
- }
24287
- var textContains = (_b = lastIQueryQuick.textContains) === null || _b === void 0 ? void 0 : _b.toLowerCase();
24288
- if (textContains != null) {
24289
- els = els.filter(function (el) {
24290
- return el.innerHTML.toLowerCase().indexOf(textContains) != -1 ||
24291
- el.innerText.toLowerCase().indexOf(textContains) != -1;
24292
- });
24289
+ if (lastIQueryQuick.text != null) {
24290
+ var matcher = getMatcher(lastIQueryQuick.text);
24291
+ els = els.filter(matcher);
24293
24292
  }
24294
24293
  return { selector: selector, els: els };
24295
24294
  };
@@ -24304,7 +24303,7 @@ var queryQuick = function (filter, container) {
24304
24303
  var _a;
24305
24304
  var _b = quickSelector(filter, container), els = _b.els, selector = _b.selector;
24306
24305
  if (els.length > 1) {
24307
- throw "Found multiple(".concat(els.length, ") elements by selector ").concat(selector);
24306
+ throw "Found multiple(".concat(els.length, ") elements by selector ").concat(selector, "\n").concat(els.map(function (el, index) { var _a; return "".concat(index, ": ").concat((_a = el.parentElement) === null || _a === void 0 ? void 0 : _a.innerHTML, "\n\n"); }));
24308
24307
  }
24309
24308
  return (_a = els[0]) !== null && _a !== void 0 ? _a : null;
24310
24309
  };
@@ -24424,6 +24423,25 @@ var findCell = function (rowId, colId, within) { return __awaiter(void 0, void 0
24424
24423
  }
24425
24424
  });
24426
24425
  }); };
24426
+ var cellContains = function (rowId, colId, text, within) { return __awaiter(void 0, void 0, void 0, function () {
24427
+ return __generator(this, function (_a) {
24428
+ switch (_a.label) {
24429
+ case 0: return [4 /*yield*/, waitForWrapper(function () { return __awaiter(void 0, void 0, void 0, function () {
24430
+ var row;
24431
+ return __generator(this, function (_a) {
24432
+ switch (_a.label) {
24433
+ case 0: return [4 /*yield*/, findRow(rowId, within)];
24434
+ case 1:
24435
+ row = _a.sent();
24436
+ return [4 /*yield*/, findQuick({ tagName: "[col-id='".concat(colId, "']"), text: text }, row)];
24437
+ case 2: return [2 /*return*/, _a.sent()];
24438
+ }
24439
+ });
24440
+ }); })];
24441
+ case 1: return [2 /*return*/, _a.sent()];
24442
+ }
24443
+ });
24444
+ }); };
24427
24445
  var selectCell = function (rowId, colId, within) { return __awaiter(void 0, void 0, void 0, function () {
24428
24446
  return __generator(this, function (_a) {
24429
24447
  switch (_a.label) {
@@ -24456,14 +24474,14 @@ var editCell = function (rowId, colId, within) { return __awaiter(void 0, void 0
24456
24474
  case 1:
24457
24475
  cell = _a.sent();
24458
24476
  userEvent.dblClick(cell);
24459
- return [4 /*yield*/, findOpenMenu()];
24460
- case 2:
24461
- _a.sent();
24462
24477
  return [2 /*return*/];
24463
24478
  }
24464
24479
  });
24465
24480
  }); })];
24466
24481
  case 1:
24482
+ _a.sent();
24483
+ return [4 /*yield*/, findOpenMenu()];
24484
+ case 2:
24467
24485
  _a.sent();
24468
24486
  return [2 /*return*/];
24469
24487
  }
@@ -24473,7 +24491,7 @@ var findOpenMenu = function () { return __awaiter(void 0, void 0, void 0, functi
24473
24491
  return [2 /*return*/, findQuick({ classes: ".szh-menu--state-open" })];
24474
24492
  }); }); };
24475
24493
  var queryMenuOption = function (menuOptionText) { return __awaiter(void 0, void 0, void 0, function () {
24476
- var openMenu, els, result;
24494
+ var openMenu, els, matcher, result;
24477
24495
  return __generator(this, function (_a) {
24478
24496
  switch (_a.label) {
24479
24497
  case 0: return [4 /*yield*/, findOpenMenu()];
@@ -24482,22 +24500,30 @@ var queryMenuOption = function (menuOptionText) { return __awaiter(void 0, void
24482
24500
  return [4 /*yield*/, getQueriesForElement(openMenu).findAllByRole("menuitem")];
24483
24501
  case 2:
24484
24502
  els = _a.sent();
24485
- result = els.find(function (e) { var _a, _b; return ((_a = e.innerHTML) === null || _a === void 0 ? void 0 : _a.trim()) === menuOptionText || ((_b = e.innerText) === null || _b === void 0 ? void 0 : _b.trim()) === menuOptionText; });
24503
+ matcher = getMatcher(menuOptionText);
24504
+ result = els.find(matcher);
24486
24505
  return [2 /*return*/, result !== null && result !== void 0 ? result : null];
24487
24506
  }
24488
24507
  });
24489
24508
  }); };
24490
24509
  var findMenuOption = function (menuOptionText) { return __awaiter(void 0, void 0, void 0, function () {
24491
- var menuOption;
24492
24510
  return __generator(this, function (_a) {
24493
24511
  switch (_a.label) {
24494
- case 0: return [4 /*yield*/, queryMenuOption(menuOptionText)];
24495
- case 1:
24496
- menuOption = _a.sent();
24497
- if (menuOption == null) {
24498
- throw Error("Unable to find menu option ".concat(menuOptionText));
24499
- }
24500
- return [2 /*return*/, menuOption];
24512
+ case 0: return [4 /*yield*/, waitForWrapper(function () { return __awaiter(void 0, void 0, void 0, function () {
24513
+ var menuOption;
24514
+ return __generator(this, function (_a) {
24515
+ switch (_a.label) {
24516
+ case 0: return [4 /*yield*/, queryMenuOption(menuOptionText)];
24517
+ case 1:
24518
+ menuOption = _a.sent();
24519
+ if (menuOption == null) {
24520
+ throw Error("Unable to find menu option ".concat(menuOptionText));
24521
+ }
24522
+ return [2 /*return*/, menuOption];
24523
+ }
24524
+ });
24525
+ }); }, { timeout: 10000 })];
24526
+ case 1: return [2 /*return*/, _a.sent()];
24501
24527
  }
24502
24528
  });
24503
24529
  }); };
@@ -24528,8 +24554,11 @@ var openAndClickMenuOption = function (rowId, colId, menuOptionText, within) { r
24528
24554
  case 0: return [4 /*yield*/, editCell(rowId, colId, within)];
24529
24555
  case 1:
24530
24556
  _a.sent();
24531
- return [4 /*yield*/, clickMenuOption(menuOptionText)];
24557
+ return [4 /*yield*/, wait$2(100)];
24532
24558
  case 2:
24559
+ _a.sent();
24560
+ return [4 /*yield*/, clickMenuOption(menuOptionText)];
24561
+ case 3:
24533
24562
  _a.sent();
24534
24563
  return [2 /*return*/];
24535
24564
  }
@@ -24582,7 +24611,7 @@ var typeOtherInput = function (value) { return __awaiter(void 0, void 0, void 0,
24582
24611
  case 0: return [4 /*yield*/, findOpenMenu()];
24583
24612
  case 1:
24584
24613
  openMenu = _a.sent();
24585
- return [4 /*yield*/, findQuick({ tagName: "input[type='text']" }, openMenu)];
24614
+ return [4 /*yield*/, findQuick({ classes: ".subComponent", child: { tagName: "input[type='text']" } }, openMenu)];
24586
24615
  case 2:
24587
24616
  otherInput = _a.sent();
24588
24617
  userEvent.type(otherInput, value);
@@ -24597,7 +24626,7 @@ var typeOtherTextArea = function (value) { return __awaiter(void 0, void 0, void
24597
24626
  case 0: return [4 /*yield*/, findOpenMenu()];
24598
24627
  case 1:
24599
24628
  openMenu = _a.sent();
24600
- return [4 /*yield*/, findQuick({ tagName: "textarea" }, openMenu)];
24629
+ return [4 /*yield*/, findQuick({ classes: ".subComponent", child: { tagName: "textarea" } }, openMenu)];
24601
24630
  case 2:
24602
24631
  otherTextArea = _a.sent();
24603
24632
  userEvent.type(otherTextArea, value);
@@ -24609,7 +24638,7 @@ var closeMenu = function () {
24609
24638
  userEvent.click(document.body);
24610
24639
  };
24611
24640
  var findActionButton = function (text, container) {
24612
- return findQuick({ tagName: "button", child: { classes: ".ActionButton-minimalAreaDisplay", textEquals: text } }, container);
24641
+ return findQuick({ tagName: "button", child: { classes: ".ActionButton-minimalAreaDisplay", text: text } }, container);
24613
24642
  };
24614
24643
  var clickActionButton = function (text, container) { return __awaiter(void 0, void 0, void 0, function () {
24615
24644
  return __generator(this, function (_a) {
@@ -24686,6 +24715,7 @@ exports.bearingCorrectionValueFormatter = bearingCorrectionValueFormatter;
24686
24715
  exports.bearingNumberParser = bearingNumberParser;
24687
24716
  exports.bearingStringValidator = bearingStringValidator;
24688
24717
  exports.bearingValueFormatter = bearingValueFormatter;
24718
+ exports.cellContains = cellContains;
24689
24719
  exports.clickActionButton = clickActionButton;
24690
24720
  exports.clickMenuOption = clickMenuOption;
24691
24721
  exports.clickMultiSelectOption = clickMultiSelectOption;