@mmb-digital/ds-lilly 0.3.13 → 0.3.16-beta.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/ds-lilly.js CHANGED
@@ -84159,6 +84159,9 @@ var external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_ = __
84159
84159
  var external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default = /*#__PURE__*/__webpack_require__.n(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_);
84160
84160
 
84161
84161
  // CONCATENATED MODULE: ./src/utils/hooks.ts
84162
+ // TODO: enable eslint react-hooks/exhaustive-deps
84163
+ /* eslint-disable react-hooks/exhaustive-deps */
84164
+ // TODO: enable eslint @typescript-eslint/ban-ts-comment
84162
84165
  /* eslint-disable @typescript-eslint/ban-ts-comment */
84163
84166
 
84164
84167
  // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
@@ -96390,6 +96393,8 @@ var DropdownItem = function (_a) {
96390
96393
  };
96391
96394
 
96392
96395
  // CONCATENATED MODULE: ./src/components/Components/CompactButtons/CompactButtons.tsx
96396
+ // TODO: enable eslint react-hooks/exhaustive-deps
96397
+ /* eslint-disable react-hooks/exhaustive-deps */
96393
96398
  var CompactButtons_assign = (undefined && undefined.__assign) || function () {
96394
96399
  CompactButtons_assign = Object.assign || function(t) {
96395
96400
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -96648,6 +96653,8 @@ var ModalContent = function (_a) {
96648
96653
  };
96649
96654
 
96650
96655
  // CONCATENATED MODULE: ./src/components/Components/Modal/ModalDialog.tsx
96656
+ // TODO: enable eslint react-hooks/exhaustive-deps
96657
+ /* eslint-disable react-hooks/exhaustive-deps */
96651
96658
 
96652
96659
 
96653
96660
 
@@ -96728,6 +96735,8 @@ var Modal = function (_a) {
96728
96735
  };
96729
96736
 
96730
96737
  // CONCATENATED MODULE: ./src/components/Components/Modal/Modal.hook.tsx
96738
+ // TODO: enable eslint react-hooks/exhaustive-deps
96739
+ /* eslint-disable react-hooks/exhaustive-deps */
96731
96740
 
96732
96741
 
96733
96742
 
@@ -96958,6 +96967,8 @@ var useToast = function () { return ({
96958
96967
  }); };
96959
96968
 
96960
96969
  // CONCATENATED MODULE: ./src/components/Components/Toast/Toast.tsx
96970
+ // TODO: enable eslint react-hooks/exhaustive-deps
96971
+ /* eslint-disable react-hooks/exhaustive-deps */
96961
96972
  var Toast_assign = (undefined && undefined.__assign) || function () {
96962
96973
  Toast_assign = Object.assign || function(t) {
96963
96974
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -97393,6 +97404,8 @@ var FormField = Object(external_root_React_commonjs2_react_commonjs_react_amd_re
97393
97404
  FormField.displayName = 'forwardRef(FormField)';
97394
97405
 
97395
97406
  // CONCATENATED MODULE: ./src/components/Form/FormControl/FormControl.tsx
97407
+ // TODO: enable eslint react-hooks/exhaustive-deps
97408
+ /* eslint-disable react-hooks/exhaustive-deps */
97396
97409
  var FormControl_assign = (undefined && undefined.__assign) || function () {
97397
97410
  FormControl_assign = Object.assign || function(t) {
97398
97411
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -97495,6 +97508,8 @@ var TextInputControl = Object(external_root_React_commonjs2_react_commonjs_react
97495
97508
  TextInputControl.displayName = 'TextInputControl';
97496
97509
 
97497
97510
  // CONCATENATED MODULE: ./src/components/Form/IntegerInput/IntegerInput.tsx
97511
+ // TODO: enable eslint react-hooks/exhaustive-deps
97512
+ /* eslint-disable react-hooks/exhaustive-deps */
97498
97513
  var IntegerInput_assign = (undefined && undefined.__assign) || function () {
97499
97514
  IntegerInput_assign = Object.assign || function(t) {
97500
97515
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -97591,6 +97606,12 @@ var IntegerInput = function (_a) {
97591
97606
 
97592
97607
 
97593
97608
 
97609
+ var renderTime = function (timeLeft) {
97610
+ var minutes = Math.floor(timeLeft / 60);
97611
+ var secondsLeft = timeLeft % 60;
97612
+ var seconds = secondsLeft < 10 ? "0" + secondsLeft : secondsLeft;
97613
+ return minutes + ":" + seconds;
97614
+ };
97594
97615
  var UserAuth = function (_a) {
97595
97616
  var _b;
97596
97617
  var children = _a.children, mobileKey = _a.mobileKey, resetTimer = _a.resetTimer, state = _a.state, testId = _a.testId, theme = _a.theme, timer = _a.timer, title = _a.title;
@@ -97600,7 +97621,7 @@ var UserAuth = function (_a) {
97600
97621
  var _d = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(''), mobileKeyValue = _d[0], setMobileKeyValue = _d[1];
97601
97622
  var timerAriaRef = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useRef"])(null);
97602
97623
  var isTimerAriaInDOM = useOnScreen(timerAriaRef);
97603
- var setAriaText = function (time, addSeconds) {
97624
+ var setAriaText = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useCallback"])(function (time, addSeconds) {
97604
97625
  var minutes = Math.floor(time / 60);
97605
97626
  var seconds = time % 60;
97606
97627
  var minutesText = undefined;
@@ -97619,9 +97640,9 @@ var UserAuth = function (_a) {
97619
97640
  }
97620
97641
  return (timer === null || timer === void 0 ? void 0 : timer.aria.timeLeft) + " " + seconds + " " + (timer === null || timer === void 0 ? void 0 : timer.aria.seconds);
97621
97642
  }
97622
- };
97643
+ }, [timer]);
97623
97644
  var _e = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(setAriaText(timeLeft, true)), ariaMessage = _e[0], setAriaMessage = _e[1];
97624
- var isInputVisible = (mobileKey === null || mobileKey === void 0 ? void 0 : mobileKey.message) && (mobileKey === null || mobileKey === void 0 ? void 0 : mobileKey.placeholder) && timeLeft > 0;
97645
+ var isInputVisible = state === 'waiting' && (timeLeft > 0 || !timer);
97625
97646
  var timeoutRef = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useRef"])();
97626
97647
  Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useEffect"])(function () {
97627
97648
  setTimeLeft((timer === null || timer === void 0 ? void 0 : timer.time) ? timer.time : 0);
@@ -97631,18 +97652,17 @@ var UserAuth = function (_a) {
97631
97652
  setTimeLeft((timer === null || timer === void 0 ? void 0 : timer.time) ? timer.time : 0);
97632
97653
  setMobileKeyValue('');
97633
97654
  }
97634
- }, [resetTimer]);
97655
+ }, [resetTimer, timer]);
97635
97656
  Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useEffect"])(function () {
97636
97657
  if (mobileKey === null || mobileKey === void 0 ? void 0 : mobileKey.error) {
97637
97658
  setMobileKeyValue('');
97638
97659
  }
97639
97660
  }, [mobileKey]);
97640
97661
  Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useEffect"])(function () {
97641
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
97642
- // @ts-ignore
97643
97662
  timeoutRef.current = setTimeout(function () {
97644
- if (ariaMessage === '')
97663
+ if (ariaMessage === '') {
97645
97664
  setAriaMessage(setAriaText(timeLeft, true));
97665
+ }
97646
97666
  var newTime = timeLeft - 1;
97647
97667
  if (timeLeft > 0) {
97648
97668
  var minutes = Math.floor(newTime / 60);
@@ -97660,22 +97680,18 @@ var UserAuth = function (_a) {
97660
97680
  }
97661
97681
  }, 1000);
97662
97682
  return function () {
97663
- clearTimeout(timeoutRef.current);
97683
+ if (timeoutRef.current) {
97684
+ clearTimeout(timeoutRef.current);
97685
+ }
97664
97686
  };
97665
- }, [timeLeft]);
97666
- var renderTime = function () {
97667
- var minutes = Math.floor(timeLeft / 60);
97668
- var secondsLeft = timeLeft % 60;
97669
- var seconds = secondsLeft < 10 ? "0" + secondsLeft : secondsLeft;
97670
- return minutes + ":" + seconds;
97671
- };
97687
+ }, [timeLeft, timer, setAriaText, ariaMessage]);
97672
97688
  var renderLoader = function () { return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Loader, null, timer && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["Fragment"], null,
97673
- external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { role: "timer" }, renderTime()),
97689
+ external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { role: "timer" }, renderTime(timeLeft)),
97674
97690
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { ref: timerAriaRef, "aria-atomic": "true", "aria-live": "assertive", className: classBinder_cx('u-vHide') }, isTimerAriaInDOM && ariaMessage))))); };
97675
- var handleOnChange = function (val) {
97691
+ var handleOnChange = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useCallback"])(function (val) {
97676
97692
  mobileKey === null || mobileKey === void 0 ? void 0 : mobileKey.onChange(mobileKeyValue, val);
97677
97693
  setMobileKeyValue(val);
97678
- };
97694
+ }, [mobileKey, mobileKeyValue]);
97679
97695
  var renderInfoGraphic = function () {
97680
97696
  switch (state) {
97681
97697
  case 'error':
@@ -97702,7 +97718,9 @@ var UserAuth = function (_a) {
97702
97718
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { "aria-live": "polite", className: classBinder_cx('c-alert__content') },
97703
97719
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Flex, { direction: "column", justifyContent: isSmall ? 'center' : 'flex-start' },
97704
97720
  title && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-alert__title'), id: identification + "__title" }, title)),
97705
- isInputVisible && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(IntegerInput, { allowLeadingZeros: true, hasAutoFocus: true, "aria-live": "off", error: mobileKey === null || mobileKey === void 0 ? void 0 : mobileKey.error, label: mobileKey === null || mobileKey === void 0 ? void 0 : mobileKey.message, maxLength: 8, name: (mobileKey === null || mobileKey === void 0 ? void 0 : mobileKey.name) || 'mobileKey', placeholder: mobileKey === null || mobileKey === void 0 ? void 0 : mobileKey.placeholder, theme: classBinder_cx('c-userAuth__mobileKey'), value: mobileKeyValue, onChange: handleOnChange })),
97721
+ isInputVisible && (
97722
+ //TODO: change it with Input2
97723
+ external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(IntegerInput, { allowLeadingZeros: true, hasAutoFocus: true, "aria-live": "off", error: mobileKey === null || mobileKey === void 0 ? void 0 : mobileKey.error, label: mobileKey === null || mobileKey === void 0 ? void 0 : mobileKey.message, maxLength: 8, name: (mobileKey === null || mobileKey === void 0 ? void 0 : mobileKey.name) || 'mobileKey', placeholder: mobileKey === null || mobileKey === void 0 ? void 0 : mobileKey.placeholder, theme: classBinder_cx('c-userAuth__mobileKey'), value: mobileKeyValue, onChange: handleOnChange })),
97706
97724
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('c-alert__text') }, children))))));
97707
97725
  };
97708
97726
 
@@ -97844,6 +97862,8 @@ var Select2Options = function (_a) {
97844
97862
  };
97845
97863
 
97846
97864
  // CONCATENATED MODULE: ./src/components/Form/Autocomplete/Autocomplete.tsx
97865
+ // TODO: enable eslint react-hooks/exhaustive-deps
97866
+ /* eslint-disable react-hooks/exhaustive-deps */
97847
97867
  var Autocomplete_assign = (undefined && undefined.__assign) || function () {
97848
97868
  Autocomplete_assign = Object.assign || function(t) {
97849
97869
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -98212,6 +98232,8 @@ var SelectedOption = function (_a) {
98212
98232
  };
98213
98233
 
98214
98234
  // CONCATENATED MODULE: ./src/components/Form/Autocomplete2/Autocomplete2.tsx
98235
+ // TODO: enable eslint react-hooks/exhaustive-deps
98236
+ /* eslint-disable react-hooks/exhaustive-deps */
98215
98237
  var Autocomplete2_assign = (undefined && undefined.__assign) || function () {
98216
98238
  Autocomplete2_assign = Object.assign || function(t) {
98217
98239
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -98271,27 +98293,28 @@ var Autocomplete2_spreadArray = (undefined && undefined.__spreadArray) || functi
98271
98293
 
98272
98294
 
98273
98295
  var Autocomplete2 = function (_a) {
98274
- var _b;
98275
- var _c = _a.asyncDelayMilliseconds, asyncDelayMilliseconds = _c === void 0 ? 200 : _c, _d = _a.canAlwaysCreateNewItem, canAlwaysCreateNewItem = _d === void 0 ? false : _d, disabledTooltip = _a.disabledTooltip, _e = _a.displayDetails, displayDetails = _e === void 0 ? false : _e, dropdownTheme = _a.dropdownTheme, emptyValueLabel = _a.emptyValueLabel, error = _a.error, _f = _a.filterMinimumLength, filterMinimumLength = _f === void 0 ? 2 : _f, _g = _a.hasFullWidthOptions, hasFullWidthOptions = _g === void 0 ? true : _g, help = _a.help, isDisabled = _a.isDisabled, isLazyLoaded = _a.isLazyLoaded, isLoading = _a.isLoading, _h = _a.items, inputItems = _h === void 0 ? [] : _h, label = _a.label, labelTooltip = _a.labelTooltip, loadItems = _a.loadItems, loadMoreItems = _a.loadMoreItems, name = _a.name, messages = _a.messages, _j = _a.newItemMinimumLength, newItemMinimumLength = _j === void 0 ? 2 : _j, onBlur = _a.onBlur, onChange = _a.onChange, onCreateNewItem = _a.onCreateNewItem, onFocus = _a.onFocus, placeholder = _a.placeholder, testId = _a.testId, theme = _a.theme, value = _a.value;
98276
- var _k = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(false), isDropdownVisible = _k[0], setIsDropdownVisible = _k[1];
98277
- var _l = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(null), buttonValue = _l[0], setButtonValue = _l[1];
98278
- var _m = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(false), typingMode = _m[0], setTypingMode = _m[1];
98279
- var _o = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(''), fulltextValue = _o[0], setFulltextValue = _o[1];
98280
- var _p = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(-1), currentItemPosition = _p[0], setCurrentItemPosition = _p[1];
98281
- var _q = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])([]), items = _q[0], setItems = _q[1];
98282
- var _r = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])({
98296
+ var _b = _a.asyncDelayMilliseconds, asyncDelayMilliseconds = _b === void 0 ? 200 : _b, _c = _a.canAlwaysCreateNewItem, canAlwaysCreateNewItem = _c === void 0 ? false : _c, disabledTooltip = _a.disabledTooltip, _d = _a.displayDetails, displayDetails = _d === void 0 ? false : _d, dropdownTheme = _a.dropdownTheme, emptyValueLabel = _a.emptyValueLabel, error = _a.error, _e = _a.filterMinimumLength, filterMinimumLength = _e === void 0 ? 2 : _e, _f = _a.hasFullWidthOptions, hasFullWidthOptions = _f === void 0 ? true : _f, help = _a.help, isDisabled = _a.isDisabled, isLazyLoaded = _a.isLazyLoaded, isLoading = _a.isLoading, _g = _a.items, inputItems = _g === void 0 ? [] : _g, label = _a.label, labelTooltip = _a.labelTooltip, loadItems = _a.loadItems, loadMoreItems = _a.loadMoreItems, name = _a.name, messages = _a.messages, _h = _a.newItemMinimumLength, newItemMinimumLength = _h === void 0 ? 2 : _h, onBlur = _a.onBlur, onChange = _a.onChange, onCreateNewItem = _a.onCreateNewItem, onFocus = _a.onFocus, placeholder = _a.placeholder, testId = _a.testId, theme = _a.theme, value = _a.value;
98297
+ var _j = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(false), isDropdownVisible = _j[0], setIsDropdownVisible = _j[1];
98298
+ var _k = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(null), buttonValue = _k[0], setButtonValue = _k[1];
98299
+ var _l = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(false), typingMode = _l[0], setTypingMode = _l[1];
98300
+ var _m = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(''), fulltextValue = _m[0], setFulltextValue = _m[1];
98301
+ var _o = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(-1), currentItemPosition = _o[0], setCurrentItemPosition = _o[1];
98302
+ var _p = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])([]), items = _p[0], setItems = _p[1];
98303
+ var _q = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])({
98283
98304
  loading: false,
98284
98305
  found: -1
98285
- }), searchState = _r[0], setSearchState = _r[1];
98286
- var _s = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])({
98306
+ }), searchState = _q[0], setSearchState = _q[1];
98307
+ var _r = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])({
98287
98308
  loading: false,
98288
98309
  found: -1
98289
- }), pagingState = _s[0], setPagingState = _s[1];
98310
+ }), pagingState = _r[0], setPagingState = _r[1];
98311
+ var getSearchString = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useCallback"])(function (str) { return stripDiacritics(str).toLowerCase(); }, []);
98312
+ var emptyValueLabelPattern = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useMemo"])(function () { return getSearchString(emptyValueLabel || ''); }, [emptyValueLabel]);
98313
+ var isCategorised = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useCallback"])(function (itemList) { var _a; return !!(itemList && ((_a = itemList[0]) === null || _a === void 0 ? void 0 : _a.items)); }, []);
98290
98314
  var loadAsyncItems = function (query) { return Autocomplete2_awaiter(void 0, void 0, void 0, function () {
98291
- var newItems, isCategorised, found;
98292
- var _a;
98293
- return Autocomplete2_generator(this, function (_b) {
98294
- switch (_b.label) {
98315
+ var newItems, categorised, found;
98316
+ return Autocomplete2_generator(this, function (_a) {
98317
+ switch (_a.label) {
98295
98318
  case 0:
98296
98319
  if (!loadItems)
98297
98320
  return [2 /*return*/];
@@ -98299,9 +98322,9 @@ var Autocomplete2 = function (_a) {
98299
98322
  setItems([]);
98300
98323
  return [4 /*yield*/, loadItems(query)];
98301
98324
  case 1:
98302
- newItems = _b.sent();
98303
- isCategorised = !!(newItems && ((_a = newItems[0]) === null || _a === void 0 ? void 0 : _a.items));
98304
- found = isCategorised
98325
+ newItems = _a.sent();
98326
+ categorised = isCategorised(newItems);
98327
+ found = categorised
98305
98328
  ? newItems.reduce(function (acc, curr) { return acc + curr.items.length; }, 0)
98306
98329
  : newItems.length;
98307
98330
  setSearchState({ loading: false, found: found });
@@ -98310,11 +98333,11 @@ var Autocomplete2 = function (_a) {
98310
98333
  }
98311
98334
  });
98312
98335
  }); };
98336
+ var fulltextMatchesEmptyValue = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useMemo"])(function () { return emptyValueLabelPattern.includes(fulltextValue); }, [fulltextValue]);
98313
98337
  var debouncedCallApi = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useState"])(function () { return (loadItems ? lodash_debounce_default()(loadAsyncItems, asyncDelayMilliseconds) : noop); })[0];
98314
- var isCategorised = !!(items && ((_b = items[0]) === null || _b === void 0 ? void 0 : _b.items));
98315
98338
  var itemsIndex = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["useMemo"])(function () {
98316
98339
  var map;
98317
- if (isCategorised) {
98340
+ if (isCategorised(items)) {
98318
98341
  map = items.reduce(function (acc, category, categoryIndex) {
98319
98342
  return acc.concat(category.items
98320
98343
  .map(function (item, index) { return (!item.isDisabled ? { category: categoryIndex, item: index } : undefined); })
@@ -98326,11 +98349,11 @@ var Autocomplete2 = function (_a) {
98326
98349
  .map(function (item, index) { return (!item.isDisabled ? { category: -1, item: index } : undefined); })
98327
98350
  .filter(Boolean);
98328
98351
  }
98329
- if (emptyValueLabel && map.length > 0 && (fulltextValue === (buttonValue === null || buttonValue === void 0 ? void 0 : buttonValue.label) || !value)) {
98352
+ if (emptyValueLabel && (!fulltextValue || fulltextValue === (buttonValue === null || buttonValue === void 0 ? void 0 : buttonValue.label) || fulltextMatchesEmptyValue)) {
98330
98353
  return Autocomplete2_spreadArray([{ item: -1, category: -1 }], map);
98331
98354
  }
98332
98355
  return map;
98333
- }, [items, isCategorised, fulltextValue, value, buttonValue]);
98356
+ }, [items, fulltextValue, value, buttonValue]);
98334
98357
  var showCreatable = !!onCreateNewItem &&
98335
98358
  (itemsIndex.length === 0 || canAlwaysCreateNewItem) &&
98336
98359
  typingMode &&
@@ -98341,7 +98364,7 @@ var Autocomplete2 = function (_a) {
98341
98364
  if (val === '' || val === undefined) {
98342
98365
  return { item: -1, category: -1 };
98343
98366
  }
98344
- if (isCategorised) {
98367
+ if (isCategorised(sourceItems)) {
98345
98368
  var index = sourceItems
98346
98369
  .map(function (category, categoryIndex) {
98347
98370
  var item = category.items.findIndex(function (item) { return item.value === val && !item.isDisabled; });
@@ -98363,16 +98386,14 @@ var Autocomplete2 = function (_a) {
98363
98386
  });
98364
98387
  };
98365
98388
  var getFilteredItems = function (filter) {
98366
- var newFilter = stripDiacritics(typeof filter === 'string' ? filter : filter.toString())
98367
- .toLowerCase()
98368
- .trim();
98369
- if (isCategorised) {
98389
+ var newFilter = getSearchString(typeof filter === 'string' ? filter : filter.toString()).trim();
98390
+ if (isCategorised(inputItems)) {
98370
98391
  var filteredCategories_1 = [];
98371
98392
  var unfilteredItems = inputItems;
98372
98393
  unfilteredItems.map(function (category) {
98373
98394
  var filteredCategory = category.items.filter(function (_a) {
98374
98395
  var amount = _a.amount, label = _a.label, perex = _a.perex;
98375
- var text = stripDiacritics(label + " " + (perex || '') + " " + (amount || '')).toLowerCase();
98396
+ var text = getSearchString(label + " " + (perex || '') + " " + (amount || ''));
98376
98397
  return text.includes(newFilter);
98377
98398
  });
98378
98399
  if (filteredCategory.length > 0) {
@@ -98384,7 +98405,7 @@ var Autocomplete2 = function (_a) {
98384
98405
  else {
98385
98406
  var filteredOptions = inputItems.filter(function (_a) {
98386
98407
  var amount = _a.amount, label = _a.label, perex = _a.perex;
98387
- var text = stripDiacritics(label + " " + (perex || '') + " " + (amount || '')).toLowerCase();
98408
+ var text = getSearchString(label + " " + (perex || '') + " " + (amount || ''));
98388
98409
  return text.includes(newFilter);
98389
98410
  });
98390
98411
  return filteredOptions;
@@ -98395,7 +98416,7 @@ var Autocomplete2 = function (_a) {
98395
98416
  setItems(inputItems);
98396
98417
  var _a = getItemIndexByValue(value, inputItems), category = _a.category, item = _a.item;
98397
98418
  if (item > -1) {
98398
- var selectedItem = isCategorised
98419
+ var selectedItem = isCategorised(inputItems)
98399
98420
  ? inputItems[category].items[item]
98400
98421
  : inputItems[item];
98401
98422
  if (selectedItem) {
@@ -98410,7 +98431,7 @@ var Autocomplete2 = function (_a) {
98410
98431
  setCurrentItemPosition(itemIndexPosition);
98411
98432
  var category = itemIndex.category, item = itemIndex.item;
98412
98433
  if (item > -1) {
98413
- var selectedItem = isCategorised
98434
+ var selectedItem = isCategorised(items)
98414
98435
  ? items[category].items[item]
98415
98436
  : items[item];
98416
98437
  if (selectedItem) {
@@ -98434,7 +98455,7 @@ var Autocomplete2 = function (_a) {
98434
98455
  var _a, _b, _c, _d, _e, _f;
98435
98456
  if (category === void 0) { category = -1; }
98436
98457
  if (center === void 0) { center = false; }
98437
- var itemElementId = isCategorised ? name + "_option-" + category + "-" + item : name + "_option-" + item;
98458
+ var itemElementId = isCategorised(items) ? name + "_option-" + category + "-" + item : name + "_option-" + item;
98438
98459
  if (center) {
98439
98460
  var dropdownHalfHeight = (((_a = document.getElementById('autocomplete_dropdown')) === null || _a === void 0 ? void 0 : _a.clientHeight) || 0) / 2;
98440
98461
  var itemHalfHeight = (((_b = document.getElementById(itemElementId)) === null || _b === void 0 ? void 0 : _b.clientHeight) || 0) / 2;
@@ -98550,7 +98571,7 @@ var Autocomplete2 = function (_a) {
98550
98571
  propagateChange();
98551
98572
  return undefined;
98552
98573
  }
98553
- var selectedItem = isCategorised
98574
+ var selectedItem = isCategorised(items)
98554
98575
  ? items[category].items[item]
98555
98576
  : items[item];
98556
98577
  if (selectedItem) {
@@ -98675,7 +98696,7 @@ var Autocomplete2 = function (_a) {
98675
98696
  setTimeout(function () {
98676
98697
  var _a;
98677
98698
  scrollToItem(item_1, category_1);
98678
- var listElementId = isCategorised ? name + "_list-" + category_1 : name + "_list";
98699
+ var listElementId = isCategorised(items) ? name + "_list-" + category_1 : name + "_list";
98679
98700
  (_a = document.getElementById(listElementId)) === null || _a === void 0 ? void 0 : _a.focus();
98680
98701
  });
98681
98702
  }
@@ -98690,16 +98711,15 @@ var Autocomplete2 = function (_a) {
98690
98711
  if (key === KEYS.Enter) {
98691
98712
  event.preventDefault();
98692
98713
  if (isDropdownVisible) {
98693
- var minItemsToAutoselect = emptyValueLabel && !value ? 2 : 1;
98694
98714
  if (showCreatable && itemsIndex.length === 0) {
98695
98715
  handleCreateNewOption();
98696
98716
  }
98697
- else if (fulltextValue && fulltextValue !== (buttonValue === null || buttonValue === void 0 ? void 0 : buttonValue.label) && itemsIndex.length >= minItemsToAutoselect) {
98698
- var _a = itemsIndex[minItemsToAutoselect - 1], category = _a.category, item = _a.item;
98699
- var selectedItem = isCategorised
98717
+ else if (fulltextValue && fulltextValue !== (buttonValue === null || buttonValue === void 0 ? void 0 : buttonValue.label) && itemsIndex.length > 0) {
98718
+ var _a = itemsIndex[0], category = _a.category, item = _a.item;
98719
+ var selectedItem = isCategorised(items)
98700
98720
  ? items[category].items[item]
98701
98721
  : items[item];
98702
- setFulltextValue(selectedItem.label);
98722
+ setFulltextValue((selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.label) || '');
98703
98723
  propagateChange(selectedItem);
98704
98724
  setTypingMode(false);
98705
98725
  }
@@ -98725,7 +98745,7 @@ var Autocomplete2 = function (_a) {
98725
98745
  setTimeout(function () {
98726
98746
  var _a;
98727
98747
  scrollToItem(item_2, category_2);
98728
- var listElementId = isCategorised ? name + "_list-" + category_2 : name + "_list";
98748
+ var listElementId = isCategorised(items) ? name + "_list-" + category_2 : name + "_list";
98729
98749
  (_a = document.getElementById(listElementId)) === null || _a === void 0 ? void 0 : _a.focus();
98730
98750
  });
98731
98751
  }
@@ -98756,7 +98776,7 @@ var Autocomplete2 = function (_a) {
98756
98776
  }
98757
98777
  else if (fulltextValue && fulltextValue !== (buttonValue === null || buttonValue === void 0 ? void 0 : buttonValue.label) && itemsIndex.length > 0) {
98758
98778
  var _c = itemsIndex[0], category = _c.category, item = _c.item;
98759
- var selectedItem = isCategorised
98779
+ var selectedItem = isCategorised(items)
98760
98780
  ? items[category].items[item]
98761
98781
  : items[item];
98762
98782
  setButtonValue(selectedItem);
@@ -98825,7 +98845,7 @@ var Autocomplete2 = function (_a) {
98825
98845
  messages.loadingItems));
98826
98846
  }
98827
98847
  return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_["Fragment"], null,
98828
- isCategorised ? external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Select2CategorisedOptions, null) : external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Select2Options, null),
98848
+ isCategorised(items) ? external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Select2CategorisedOptions, null) : external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Select2Options, null),
98829
98849
  pagingState.loading && messages.loadingItems && (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: "f-autocomplete__message", id: "autocomplete_loading-more-items" },
98830
98850
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Icon, { name: "loading", size: "large" }),
98831
98851
  messages.loadingMoreItems)),
@@ -98839,10 +98859,12 @@ var Autocomplete2 = function (_a) {
98839
98859
  messages.createItem, " \"" + fulltextValue + "\""))))));
98840
98860
  };
98841
98861
  var focusedItem = itemsIndex[currentItemPosition];
98862
+ var focusedCategoryIndex = focusedItem ? focusedItem.category : -1;
98863
+ var focusedItemIndex = focusedItem ? focusedItem.item : -1;
98842
98864
  var select2context = {
98843
- emptyValueLabel: itemsIndex.length > 0 && (fulltextValue === (buttonValue === null || buttonValue === void 0 ? void 0 : buttonValue.label) || !value) ? emptyValueLabel : undefined,
98844
- focusedCategoryIndex: focusedItem ? focusedItem.category : -1,
98845
- focusedItemIndex: focusedItem ? focusedItem.item : -1,
98865
+ emptyValueLabel: !fulltextValue || fulltextValue === (buttonValue === null || buttonValue === void 0 ? void 0 : buttonValue.label) || fulltextMatchesEmptyValue ? emptyValueLabel : undefined,
98866
+ focusedCategoryIndex: focusedCategoryIndex,
98867
+ focusedItemIndex: focusedItemIndex,
98846
98868
  items: items,
98847
98869
  name: name,
98848
98870
  optionClick: handleOptionClick,
@@ -98864,9 +98886,13 @@ var Autocomplete2 = function (_a) {
98864
98886
  return (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(FormGroup2, Autocomplete2_assign({ theme: classBinder_cx({ 'f-group2--open': isDropdownVisible }, theme) }, fromGroupProps),
98865
98887
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(contexts_Select2Context.Provider, { value: select2context },
98866
98888
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Dropdown, { dropdownId: "autocomplete_dropdown", forceVisibility: isDropdownVisible, hasSameWidthAsTrigger: hasFullWidthOptions, placement: "bottom-start", theme: dropdownTheme, trigger: null, triggerComponent: external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: "f-controlWrap", "data-testid": testId, role: "combobox" }, typingMode ? (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("div", { className: classBinder_cx('f-control2 f-control2--select', { 'f-control2--large': displayDetails }) },
98867
- external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("input", { autoComplete: "off", className: classBinder_cx('f-autocomplete__input'), disabled: isDisabled, id: name + "_input", name: name, placeholder: placeholder, type: "text", value: fulltextValue, onChange: handleFulltextChange, onKeyDown: handleFulltextKeyPress }),
98889
+ external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("input", { "aria-activedescendant": isDropdownVisible && (itemsIndex.length > 0 || showCreatable)
98890
+ ? isCategorised(items)
98891
+ ? name + "_option-" + focusedCategoryIndex + "-" + focusedItemIndex
98892
+ : name + "_option-" + focusedItemIndex
98893
+ : undefined, "aria-autocomplete": "list", "aria-controls": name + "_list", "aria-labelledby": name + "_label", autoComplete: "off", className: classBinder_cx('f-autocomplete__input'), disabled: isDisabled, id: name + "_input", name: name, placeholder: placeholder, type: "text", value: fulltextValue, onChange: handleFulltextChange, onKeyDown: handleFulltextKeyPress }),
98868
98894
  external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("button", { "aria-invalid": !!error, className: classBinder_cx('f-autocomplete__button'), disabled: isDisabled, id: name + "_toggle_button", name: name, tabIndex: -1, type: "button", onClick: toggleDropdown },
98869
- external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Icon, { name: "arrowDown", size: "small", theme: "f-control2__selectIcon" })))) : (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("button", { "aria-expanded": isDropdownVisible, "aria-haspopup": "listbox", "aria-invalid": !!error, "aria-labelledby": name + "_label " + name, className: classBinder_cx('f-control2 f-control2--select', {
98895
+ external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement(Icon, { name: "arrowDown", size: "small", theme: "f-control2__selectIcon" })))) : (external_root_React_commonjs2_react_commonjs_react_amd_react_umd_react_default.a.createElement("button", { "aria-expanded": isDropdownVisible, "aria-haspopup": "listbox", "aria-invalid": !!error, "aria-labelledby": name + "_label", className: classBinder_cx('f-control2 f-control2--select', {
98870
98896
  'f-control2--large': displayDetails,
98871
98897
  'f-autocomplete__trigger--loading': isLoading
98872
98898
  }), disabled: isDisabled, id: name + "_button", name: name, type: "button", onClick: handleComboBoxClick, onFocus: handleFocus },
@@ -103795,6 +103821,8 @@ var SelectMenu = function (_a) {
103795
103821
  };
103796
103822
 
103797
103823
  // CONCATENATED MODULE: ./src/components/Form/SelectControlAutocomplete/SelectControlAutocomplete.tsx
103824
+ // TODO: enable eslint react-hooks/exhaustive-deps
103825
+ /* eslint-disable react-hooks/exhaustive-deps */
103798
103826
  var SelectControlAutocomplete_assign = (undefined && undefined.__assign) || function () {
103799
103827
  SelectControlAutocomplete_assign = Object.assign || function(t) {
103800
103828
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -104349,6 +104377,8 @@ var react_flatpickr_build = __webpack_require__(61);
104349
104377
  var build_default = /*#__PURE__*/__webpack_require__.n(react_flatpickr_build);
104350
104378
 
104351
104379
  // CONCATENATED MODULE: ./src/components/Form/DatePicker/DatePicker.tsx
104380
+ // TODO: enable eslint react-hooks/exhaustive-deps
104381
+ /* eslint-disable react-hooks/exhaustive-deps */
104352
104382
  var DatePicker_assign = (undefined && undefined.__assign) || function () {
104353
104383
  DatePicker_assign = Object.assign || function(t) {
104354
104384
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -104466,6 +104496,8 @@ var ShowPasswordIcon = function (_a) {
104466
104496
  };
104467
104497
 
104468
104498
  // CONCATENATED MODULE: ./src/components/Form/Input2/Input2.tsx
104499
+ // TODO: enable eslint react-hooks/exhaustive-deps
104500
+ /* eslint-disable react-hooks/exhaustive-deps */
104469
104501
  var Input2_assign = (undefined && undefined.__assign) || function () {
104470
104502
  Input2_assign = Object.assign || function(t) {
104471
104503
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -104719,6 +104751,8 @@ var DatePicker2 = function (_a) {
104719
104751
 
104720
104752
 
104721
104753
  // CONCATENATED MODULE: ./src/components/Form/DecimalInput/DecimalInput.tsx
104754
+ // TODO: enable eslint react-hooks/exhaustive-deps
104755
+ /* eslint-disable react-hooks/exhaustive-deps */
104722
104756
  var DecimalInput_assign = (undefined && undefined.__assign) || function () {
104723
104757
  DecimalInput_assign = Object.assign || function(t) {
104724
104758
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -106582,6 +106616,8 @@ function monthSelectPlugin(pluginConfig) {
106582
106616
  };
106583
106617
  }
106584
106618
  // CONCATENATED MODULE: ./src/components/Form/MonthInput/MonthInput.tsx
106619
+ // TODO: enable eslint react-hooks/exhaustive-deps
106620
+ /* eslint-disable react-hooks/exhaustive-deps */
106585
106621
  var MonthInput_assign = (undefined && undefined.__assign) || function () {
106586
106622
  MonthInput_assign = Object.assign || function(t) {
106587
106623
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -107038,6 +107074,8 @@ var RadioGroup = function (_a) {
107038
107074
 
107039
107075
 
107040
107076
  // CONCATENATED MODULE: ./src/components/Form/Select2/Select2.tsx
107077
+ // TODO: enable eslint react-hooks/exhaustive-deps
107078
+ /* eslint-disable react-hooks/exhaustive-deps */
107041
107079
  var Select2_assign = (undefined && undefined.__assign) || function () {
107042
107080
  Select2_assign = Object.assign || function(t) {
107043
107081
  for (var s, i = 1, n = arguments.length; i < n; i++) {
@@ -111067,6 +111105,8 @@ var AreaChart_assign = (undefined && undefined.__assign) || function () {
111067
111105
  };
111068
111106
  return AreaChart_assign.apply(this, arguments);
111069
111107
  };
111108
+ // TODO: enable react-hooks/rules-of-hooks
111109
+ /* eslint-disable react-hooks/rules-of-hooks */
111070
111110
 
111071
111111
 
111072
111112
 
@@ -112546,6 +112586,8 @@ var AppMain = function (_a) {
112546
112586
 
112547
112587
 
112548
112588
  // CONCATENATED MODULE: ./src/components/Layout/Box/Box.tsx
112589
+ // TODO: enable eslint react-hooks/exhaustive-deps
112590
+ /* eslint-disable react-hooks/exhaustive-deps */
112549
112591
 
112550
112592
 
112551
112593
  var Box = function (_a) {