react-better-html 1.1.203 → 1.1.205

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.mjs CHANGED
@@ -5655,6 +5655,12 @@ var decryptString = (text) => {
5655
5655
  });
5656
5656
  return decrypted.toString(CryptoJS.enc.Utf8);
5657
5657
  };
5658
+ var getPluralWord = (word, count) => {
5659
+ if (count === 1) return word;
5660
+ const needChangeY = word.slice(-1) === "y" && !["a", "e", "o", "u", "i"].includes(word.slice(-2, -1));
5661
+ const pluralWord = needChangeY ? word.slice(0, -1) + "ies" : word.slice(-1) === "s" ? word + "es" : word + "s";
5662
+ return pluralWord;
5663
+ };
5658
5664
 
5659
5665
  // src/components/Label.tsx
5660
5666
  import { memo as memo15 } from "react";
@@ -5711,6 +5717,7 @@ var DropdownComponent = forwardRef10(function Dropdown({
5711
5717
  onChangeSearch,
5712
5718
  renderOption,
5713
5719
  renderOptionDivider,
5720
+ withMultiselect,
5714
5721
  id,
5715
5722
  ...props
5716
5723
  }, ref) {
@@ -5745,8 +5752,10 @@ var DropdownComponent = forwardRef10(function Dropdown({
5745
5752
  if (isOpen && filteredOptions.length > 0 && focusedOptionIndex !== void 0) {
5746
5753
  const option = filteredOptions[focusedOptionIndex];
5747
5754
  if (!option.disabled) {
5748
- if (controlledValue === void 0) setInternalValue(option.value);
5749
- onChange?.(option.value);
5755
+ const clickedValue = option.value;
5756
+ const newValue = withMultiselect ? Array.isArray(internalValue) ? internalValue?.includes(clickedValue) ? internalValue.filter((value2) => value2 !== clickedValue) : [...internalValue, clickedValue] : [clickedValue] : clickedValue;
5757
+ if (controlledValue === void 0) setInternalValue(newValue);
5758
+ onChange?.(newValue);
5750
5759
  setIsOpen.setFalse();
5751
5760
  inputRef.current?.blur();
5752
5761
  setSearchQuery("");
@@ -5775,20 +5784,32 @@ var DropdownComponent = forwardRef10(function Dropdown({
5775
5784
  }
5776
5785
  }
5777
5786
  },
5778
- [disabled, withSearch, isOpen, filteredOptions, focusedOptionIndex, controlledValue, onChange]
5787
+ [
5788
+ disabled,
5789
+ withSearch,
5790
+ isOpen,
5791
+ filteredOptions,
5792
+ focusedOptionIndex,
5793
+ internalValue,
5794
+ controlledValue,
5795
+ onChange,
5796
+ withMultiselect
5797
+ ]
5779
5798
  );
5780
5799
  const onClickOption = useCallback7(
5781
5800
  (option) => {
5782
5801
  if (!option.disabled) {
5783
- if (controlledValue === void 0) setInternalValue(option.value);
5784
- onChange?.(option.value);
5802
+ const clickedValue = option.value;
5803
+ const newValue = withMultiselect ? Array.isArray(internalValue) ? internalValue?.includes(clickedValue) ? internalValue.filter((value2) => value2 !== clickedValue) : [...internalValue, clickedValue] : [clickedValue] : clickedValue;
5804
+ if (controlledValue === void 0) setInternalValue(newValue);
5805
+ onChange?.(newValue);
5785
5806
  setIsOpen.setFalse();
5786
5807
  inputRef.current?.blur();
5787
5808
  setSearchQuery("");
5788
5809
  setFocusedOptionIndex(void 0);
5789
5810
  }
5790
5811
  },
5791
- [onChange, controlledValue]
5812
+ [onChange, internalValue, controlledValue, withMultiselect]
5792
5813
  );
5793
5814
  const onClickClearButton = useCallback7(
5794
5815
  (event) => {
@@ -5810,12 +5831,15 @@ var DropdownComponent = forwardRef10(function Dropdown({
5810
5831
  },
5811
5832
  [withDebounce, onChangeSearch]
5812
5833
  );
5813
- const selectedOption = useMemo4(() => options.find((option) => option.value === value), [options, value]);
5834
+ const selectedOption = useMemo4(
5835
+ () => withMultiselect ? options.filter((option) => Array.isArray(value) ? value.includes(option.value) : false) : options.find((option) => option.value === value),
5836
+ [options, value]
5837
+ );
5814
5838
  const renderedOptions = useMemo4(
5815
5839
  () => /* @__PURE__ */ jsxs11(Fragment4, { children: [
5816
5840
  renderOptionDivider ? renderOptionDivider(void 0, filteredOptions[0], -1, 0) : void 0,
5817
5841
  filteredOptions.map((option, index) => {
5818
- const isSelected = option.value === value;
5842
+ const isSelected = withMultiselect ? Array.isArray(value) ? value.includes(option.value) : false : option.value === value;
5819
5843
  const isDisabled = option.disabled;
5820
5844
  const isFocused2 = index === focusedOptionIndex;
5821
5845
  return /* @__PURE__ */ jsxs11(Fragment3, { children: [
@@ -5846,7 +5870,16 @@ var DropdownComponent = forwardRef10(function Dropdown({
5846
5870
  ] }, JSON.stringify(option));
5847
5871
  })
5848
5872
  ] }),
5849
- [filteredOptions, value, focusedOptionIndex, theme2.colors, onClickOption, renderOption, renderOptionDivider]
5873
+ [
5874
+ withMultiselect,
5875
+ filteredOptions,
5876
+ value,
5877
+ focusedOptionIndex,
5878
+ theme2.colors,
5879
+ onClickOption,
5880
+ renderOption,
5881
+ renderOptionDivider
5882
+ ]
5850
5883
  );
5851
5884
  useEffect6(() => {
5852
5885
  setInternalValue(controlledValue);
@@ -5884,34 +5917,50 @@ var DropdownComponent = forwardRef10(function Dropdown({
5884
5917
  if (!withDebounce) return;
5885
5918
  onChangeSearch?.(debouncedSearchQuery);
5886
5919
  }, [withDebounce, onChangeSearch, debouncedSearchQuery]);
5887
- const displayValue = withSearch && isFocused ? searchQuery : selectedOption?.label ?? "";
5888
- const withClearButton = isOpen && selectedOption;
5889
- const readyPlaceholder = placeholder ?? `Select an ${label?.toLowerCase() ?? "option"}`;
5890
- return /* @__PURE__ */ jsx15(Div_default.column, { width: "100%", position: "relative", userSelect: "none", ...props, children: /* @__PURE__ */ jsxs11(Div_default.row, { position: "relative", width: "100%", children: [
5891
- /* @__PURE__ */ jsx15(
5892
- InputField_default,
5893
- {
5894
- label,
5895
- labelColor,
5896
- errorText,
5897
- infoText,
5898
- required,
5899
- name,
5900
- disabled,
5901
- readOnly: !withSearch,
5902
- value: displayValue,
5903
- id,
5904
- cursor: !withSearch ? "pointer" : void 0,
5905
- placeholder: withSearch ? selectedOption ? selectedOption.label : readyPlaceholder : readyPlaceholder,
5906
- leftIcon,
5907
- autoComplete: "off",
5908
- className: `react-better-html-dropdown${isOpen ? " react-better-html-dropdown-open" : ""}${isOpenLate ? " react-better-html-dropdown-open-late" : ""}${inputFieldClassName ? ` ${inputFieldClassName}` : ""}`,
5909
- onClick: !disabled ? setIsOpen.toggle : void 0,
5910
- onFocus: setIsFocused.setTrue,
5911
- onBlur: setIsFocused.setFalse,
5912
- onKeyDown: onKeyDownInputField,
5913
- onChangeValue: withSearch ? onChangeValue : void 0,
5914
- insideInputFieldComponent: /* @__PURE__ */ jsx15(
5920
+ const displayValue = (withSearch && isFocused && searchQuery.length > 0 ? searchQuery : !Array.isArray(selectedOption) ? selectedOption?.label : void 0) ?? "";
5921
+ const withClearButton = isOpen && (Array.isArray(selectedOption) ? selectedOption.length > 0 : selectedOption);
5922
+ const readyPlaceholder = placeholder ?? `Select ${!withMultiselect ? "an " : ""}${label?.toLowerCase() ?? getPluralWord("option", withMultiselect ? 2 : 1)}`;
5923
+ return /* @__PURE__ */ jsx15(Div_default.column, { width: "100%", position: "relative", userSelect: "none", ...props, children: /* @__PURE__ */ jsx15(
5924
+ InputField_default,
5925
+ {
5926
+ label,
5927
+ labelColor,
5928
+ errorText,
5929
+ infoText,
5930
+ required,
5931
+ name,
5932
+ disabled,
5933
+ readOnly: !withSearch,
5934
+ value: displayValue,
5935
+ id,
5936
+ cursor: !withSearch ? "pointer" : void 0,
5937
+ placeholder: withSearch ? selectedOption && !Array.isArray(selectedOption) ? selectedOption.label : readyPlaceholder : readyPlaceholder,
5938
+ leftIcon,
5939
+ autoComplete: "off",
5940
+ className: `react-better-html-dropdown${Array.isArray(selectedOption) && selectedOption.length > 0 ? " react-better-html-dropdown-multiselect" : ""}${isOpen ? " react-better-html-dropdown-open" : ""}${isOpenLate ? " react-better-html-dropdown-open-late" : ""}${inputFieldClassName ? ` ${inputFieldClassName}` : ""}`,
5941
+ onClick: !disabled ? setIsOpen.toggle : void 0,
5942
+ onFocus: setIsFocused.setTrue,
5943
+ onBlur: setIsFocused.setFalse,
5944
+ onKeyDown: onKeyDownInputField,
5945
+ onChangeValue: withSearch ? onChangeValue : void 0,
5946
+ insideInputFieldBeforeComponent: Array.isArray(selectedOption) && selectedOption.length > 0 ? /* @__PURE__ */ jsx15(
5947
+ Div_default,
5948
+ {
5949
+ width: "100%",
5950
+ backgroundColor: theme2.colors.backgroundContent,
5951
+ border: `solid 1px ${theme2.colors.border}`,
5952
+ borderColor: isFocused ? theme2.colors.primary : void 0,
5953
+ borderBottom: "none",
5954
+ borderTopLeftRadius: theme2.styles.borderRadius,
5955
+ borderTopRightRadius: theme2.styles.borderRadius,
5956
+ paddingBlock: theme2.styles.gap,
5957
+ paddingInline: (theme2.styles.space + theme2.styles.gap) / 2,
5958
+ transition: theme2.styles.transition,
5959
+ children: /* @__PURE__ */ jsx15(Div_default.row, { width: "100%", flexWrap: "wrap", gap: theme2.styles.gap, children: selectedOption.map((option) => /* @__PURE__ */ jsx15(Chip_default, { text: option.label }, JSON.stringify(option))) })
5960
+ }
5961
+ ) : void 0,
5962
+ insideInputFieldAfterComponent: /* @__PURE__ */ jsxs11(Fragment4, { children: [
5963
+ /* @__PURE__ */ jsx15(
5915
5964
  Div_default,
5916
5965
  {
5917
5966
  position: "absolute",
@@ -5936,60 +5985,61 @@ var DropdownComponent = forwardRef10(function Dropdown({
5936
5985
  children: isLoadingDebouncedSearchQuery || debounceIsLoading ? /* @__PURE__ */ jsx15(Div_default, { padding: `${theme2.styles.space / 2}px ${theme2.styles.space + theme2.styles.gap}px`, children: /* @__PURE__ */ jsx15(Loader_default.text, {}) }) : filteredOptions.length ? /* @__PURE__ */ jsx15(Fragment4, { children: (withoutRenderingOptionsWhenClosed ? isOpen || isOpenLate : true) ? renderedOptions : void 0 }) : /* @__PURE__ */ jsx15(Div_default, { padding: `${theme2.styles.space / 2}px ${theme2.styles.space + theme2.styles.gap}px`, children: /* @__PURE__ */ jsx15(Text_default.unknown, { textAlign: "left", children: debounceMinimumSymbolsRequired !== void 0 && searchQuery.length < debounceMinimumSymbolsRequired ? `Enter at least ${debounceMinimumSymbolsRequired} characters` : "No options" }) })
5937
5986
  }
5938
5987
  ),
5939
- role: "combobox",
5940
- "aria-expanded": isOpen,
5941
- "aria-controls": "dropdown-list",
5942
- "aria-haspopup": "listbox",
5943
- "aria-label": label,
5944
- holderRef: inputFieldHolderRef,
5945
- ref: inputRef
5946
- }
5947
- ),
5948
- /* @__PURE__ */ jsxs11(
5949
- Div_default.row,
5950
- {
5951
- position: "absolute",
5952
- top: 46 / 2 + (label ? 16 + theme2.styles.gap / 2 : 0),
5953
- right: theme2.styles.space + 1,
5954
- alignItems: "center",
5955
- gap: theme2.styles.gap,
5956
- transform: "translateY(-50%)",
5957
- pointerEvents: "none",
5958
- filter: disabled ? "brightness(0.9)" : void 0,
5959
- opacity: disabled ? 0.6 : void 0,
5960
- zIndex: isOpen || isOpenLate ? 1001 : void 0,
5961
- ref: buttonsRef,
5962
- children: [
5963
- !withoutClearButton && /* @__PURE__ */ jsx15(
5964
- Button_default.icon,
5965
- {
5966
- icon: "XMark",
5967
- position: "relative",
5968
- size: 10,
5969
- iconSize: 14,
5970
- opacity: !withClearButton ? 0 : void 0,
5971
- pointerEvents: withClearButton ? "all" : void 0,
5972
- onClick: onClickClearButton,
5973
- disabled: !withClearButton
5974
- }
5975
- ),
5976
- /* @__PURE__ */ jsx15(
5977
- Icon_default,
5978
- {
5979
- name: "chevronDown",
5980
- position: "relative",
5981
- size: 16,
5982
- color: theme2.colors.textSecondary,
5983
- transform: `rotate(${isOpen ? 180 : 0}deg)`,
5984
- transition: theme2.styles.transition,
5985
- pointerEvents: "none",
5986
- "aria-hidden": true
5987
- }
5988
- )
5989
- ]
5990
- }
5991
- )
5992
- ] }) });
5988
+ /* @__PURE__ */ jsxs11(
5989
+ Div_default.row,
5990
+ {
5991
+ position: "absolute",
5992
+ top: 46 / 2,
5993
+ right: theme2.styles.space + 1,
5994
+ alignItems: "center",
5995
+ gap: theme2.styles.gap,
5996
+ transform: "translateY(-50%)",
5997
+ pointerEvents: "none",
5998
+ filter: disabled ? "brightness(0.9)" : void 0,
5999
+ opacity: disabled ? 0.6 : void 0,
6000
+ zIndex: isOpen || isOpenLate ? 1001 : void 0,
6001
+ ref: buttonsRef,
6002
+ children: [
6003
+ !withoutClearButton && /* @__PURE__ */ jsx15(
6004
+ Button_default.icon,
6005
+ {
6006
+ icon: "XMark",
6007
+ position: "relative",
6008
+ size: 10,
6009
+ iconSize: 14,
6010
+ opacity: !withClearButton ? 0 : void 0,
6011
+ pointerEvents: withClearButton ? "all" : void 0,
6012
+ onClick: onClickClearButton,
6013
+ disabled: !withClearButton
6014
+ }
6015
+ ),
6016
+ /* @__PURE__ */ jsx15(
6017
+ Icon_default,
6018
+ {
6019
+ name: "chevronDown",
6020
+ position: "relative",
6021
+ size: 16,
6022
+ color: theme2.colors.textSecondary,
6023
+ transform: `rotate(${isOpen ? 180 : 0}deg)`,
6024
+ transition: theme2.styles.transition,
6025
+ pointerEvents: "none",
6026
+ "aria-hidden": true
6027
+ }
6028
+ )
6029
+ ]
6030
+ }
6031
+ )
6032
+ ] }),
6033
+ role: "combobox",
6034
+ "aria-expanded": isOpen,
6035
+ "aria-controls": "dropdown-list",
6036
+ "aria-multiselectable": withMultiselect ? "true" : "false",
6037
+ "aria-haspopup": "listbox",
6038
+ "aria-label": label,
6039
+ holderRef: inputFieldHolderRef,
6040
+ ref: inputRef
6041
+ }
6042
+ ) });
5993
6043
  });
5994
6044
  DropdownComponent.countries = forwardRef10(function Countries({ ...props }, ref) {
5995
6045
  const theme2 = useTheme();
@@ -6344,6 +6394,12 @@ var InputElement = styled10.input.withConfig({
6344
6394
  &.react-better-html-dropdown {
6345
6395
  padding-right: ${(props) => props.theme.styles.space + 16 + props.theme.styles.space - 1}px;
6346
6396
 
6397
+ &.react-better-html-dropdown-multiselect {
6398
+ border-top: none;
6399
+ border-top-left-radius: 0px;
6400
+ border-top-right-radius: 0px;
6401
+ }
6402
+
6347
6403
  &.react-better-html-dropdown-open {
6348
6404
  border-bottom-left-radius: 0px;
6349
6405
  border-bottom-right-radius: 0px;
@@ -6416,7 +6472,8 @@ var InputFieldComponent = forwardRef11(function InputField({
6416
6472
  prefixBackgroundColor,
6417
6473
  suffix,
6418
6474
  suffixBackgroundColor,
6419
- insideInputFieldComponent,
6475
+ insideInputFieldBeforeComponent,
6476
+ insideInputFieldAfterComponent,
6420
6477
  withDebounce,
6421
6478
  debounceDelay = 0.5,
6422
6479
  onChange,
@@ -6482,59 +6539,62 @@ var InputFieldComponent = forwardRef11(function InputField({
6482
6539
  }
6483
6540
  ),
6484
6541
  /* @__PURE__ */ jsxs13(Div_default, { position: "relative", width: "100%", height: "fit-content", ref: holderRef, children: [
6485
- leftIcon && /* @__PURE__ */ jsx17(
6486
- Icon_default,
6487
- {
6488
- name: leftIcon,
6489
- position: "absolute",
6490
- top: (props.type === "date" || props.type === "time" || props.type === "datetime-local" ? 48 : 46) / 2,
6491
- left: theme2.styles.space + 1,
6492
- transform: "translateY(-50%)",
6493
- pointerEvents: "none",
6494
- zIndex: leftIconZIndex
6495
- }
6496
- ),
6497
- /* @__PURE__ */ jsx17(
6498
- InputElement,
6499
- {
6500
- theme: theme2,
6501
- withLeftIcon: leftIcon !== void 0,
6502
- withRightIcon: rightIcon !== void 0,
6503
- withPrefix: prefix !== void 0,
6504
- withSuffix: suffix !== void 0,
6505
- required,
6506
- placeholder: placeholder ?? label,
6507
- id: readyId,
6508
- onChange: onChangeElement,
6509
- ...styledComponentStylesWithoutExcluded,
6510
- ...dataProps,
6511
- ...ariaProps,
6512
- ...restProps,
6513
- ref
6514
- }
6515
- ),
6516
- rightIcon ? onClickRightIcon ? /* @__PURE__ */ jsx17(
6517
- Button_default.icon,
6518
- {
6519
- icon: rightIcon,
6520
- position: "absolute",
6521
- top: 46 / 2,
6522
- right: theme2.styles.space + 1 - theme2.styles.space / 2,
6523
- transform: "translateY(-50%)",
6524
- onClick: onClickRightIcon
6525
- }
6526
- ) : /* @__PURE__ */ jsx17(
6527
- Icon_default,
6528
- {
6529
- name: rightIcon,
6530
- position: "absolute",
6531
- top: 46 / 2,
6532
- right: theme2.styles.space + 1,
6533
- transform: "translateY(-50%)",
6534
- pointerEvents: "none"
6535
- }
6536
- ) : void 0,
6537
- insideInputFieldComponent
6542
+ insideInputFieldBeforeComponent,
6543
+ /* @__PURE__ */ jsxs13(Div_default, { position: "relative", width: "100%", height: "fit-content", children: [
6544
+ leftIcon && /* @__PURE__ */ jsx17(
6545
+ Icon_default,
6546
+ {
6547
+ name: leftIcon,
6548
+ position: "absolute",
6549
+ top: (props.type === "date" || props.type === "time" || props.type === "datetime-local" ? 48 : 46) / 2,
6550
+ left: theme2.styles.space + 1,
6551
+ transform: "translateY(-50%)",
6552
+ pointerEvents: "none",
6553
+ zIndex: leftIconZIndex
6554
+ }
6555
+ ),
6556
+ /* @__PURE__ */ jsx17(
6557
+ InputElement,
6558
+ {
6559
+ theme: theme2,
6560
+ withLeftIcon: leftIcon !== void 0,
6561
+ withRightIcon: rightIcon !== void 0,
6562
+ withPrefix: prefix !== void 0,
6563
+ withSuffix: suffix !== void 0,
6564
+ required,
6565
+ placeholder: placeholder ?? label,
6566
+ id: readyId,
6567
+ onChange: onChangeElement,
6568
+ ...styledComponentStylesWithoutExcluded,
6569
+ ...dataProps,
6570
+ ...ariaProps,
6571
+ ...restProps,
6572
+ ref
6573
+ }
6574
+ ),
6575
+ rightIcon ? onClickRightIcon ? /* @__PURE__ */ jsx17(
6576
+ Button_default.icon,
6577
+ {
6578
+ icon: rightIcon,
6579
+ position: "absolute",
6580
+ top: 46 / 2,
6581
+ right: theme2.styles.space + 1 - theme2.styles.space / 2,
6582
+ transform: "translateY(-50%)",
6583
+ onClick: onClickRightIcon
6584
+ }
6585
+ ) : /* @__PURE__ */ jsx17(
6586
+ Icon_default,
6587
+ {
6588
+ name: rightIcon,
6589
+ position: "absolute",
6590
+ top: 46 / 2,
6591
+ right: theme2.styles.space + 1,
6592
+ transform: "translateY(-50%)",
6593
+ pointerEvents: "none"
6594
+ }
6595
+ ) : void 0,
6596
+ insideInputFieldAfterComponent
6597
+ ] })
6538
6598
  ] }),
6539
6599
  suffix && /* @__PURE__ */ jsx17(
6540
6600
  Div_default.row,
@@ -6850,7 +6910,7 @@ InputFieldComponent.date = forwardRef11(function Date2({ minDate, maxDate, ...pr
6850
6910
  InputFieldComponent,
6851
6911
  {
6852
6912
  type: "date",
6853
- insideInputFieldComponent: !isMobileIOS ? /* @__PURE__ */ jsx17(
6913
+ insideInputFieldAfterComponent: !isMobileIOS ? /* @__PURE__ */ jsx17(
6854
6914
  Div_default,
6855
6915
  {
6856
6916
  position: "absolute",
@@ -6921,7 +6981,7 @@ InputFieldComponent.dateTime = forwardRef11(function DateTime({ minDate, maxDate
6921
6981
  InputFieldComponent,
6922
6982
  {
6923
6983
  type: "datetime-local",
6924
- insideInputFieldComponent: !isMobileIOS ? /* @__PURE__ */ jsx17(
6984
+ insideInputFieldAfterComponent: !isMobileIOS ? /* @__PURE__ */ jsx17(
6925
6985
  Div_default,
6926
6986
  {
6927
6987
  position: "absolute",
@@ -7062,7 +7122,7 @@ InputFieldComponent.time = forwardRef11(function Time({ ...props }, ref) {
7062
7122
  InputFieldComponent,
7063
7123
  {
7064
7124
  type: "time",
7065
- insideInputFieldComponent: !isMobileIOS ? /* @__PURE__ */ jsx17(
7125
+ insideInputFieldAfterComponent: !isMobileIOS ? /* @__PURE__ */ jsx17(
7066
7126
  Div_default,
7067
7127
  {
7068
7128
  position: "absolute",
@@ -7165,7 +7225,7 @@ InputFieldComponent.color = forwardRef11(function Color2({ value, onChangeValue,
7165
7225
  InputFieldComponent,
7166
7226
  {
7167
7227
  type: "color",
7168
- insideInputFieldComponent: /* @__PURE__ */ jsx17(
7228
+ insideInputFieldAfterComponent: /* @__PURE__ */ jsx17(
7169
7229
  Div_default.row,
7170
7230
  {
7171
7231
  position: "absolute",
@@ -9397,7 +9457,7 @@ var MenuItemComponent = memo27(function MenuItemComponent2({ item, backgroundCol
9397
9457
  const isCollapsed = sideMenuIsCollapsed && !mediaQuery.size1000;
9398
9458
  const onClickElement = useCallback16(() => {
9399
9459
  if (item.disabled) return;
9400
- if (!item.children) setActiveItem(void 0);
9460
+ if (!item.children) setActiveItem((oldValue) => oldValue?.href === item.href ? oldValue : void 0);
9401
9461
  if (item.children) {
9402
9462
  setSideMenuIsCollapsed.setFalse();
9403
9463
  if (isCollapsed) setTimeout(setIsOpened.setTrue, 0.1 * 1e3);
@@ -9964,6 +10024,7 @@ export {
9964
10024
  generateRandomString,
9965
10025
  getBrowser,
9966
10026
  getFormErrorObject,
10027
+ getPluralWord,
9967
10028
  isMobileDevice,
9968
10029
  lightenColor,
9969
10030
  loaderControls,