bianic-ui 1.15.0 → 1.16.0-alpha.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.
Files changed (46) hide show
  1. package/dist/cjs/index.js +213 -162
  2. package/dist/cjs/lib.css +1 -1
  3. package/dist/cjs/types/components/Forms/DatePicker/DateInputDisplay.d.ts +3 -1
  4. package/dist/cjs/types/components/Forms/DatePicker/DatePicker.d.ts +4 -1
  5. package/dist/cjs/types/components/Forms/Dropdown/DropdownContainer.d.ts +2 -2
  6. package/dist/cjs/types/components/Forms/LiveSearch/Example/CustomDropdown.d.ts +1 -2
  7. package/dist/cjs/types/components/Forms/LiveSearch/Example/DeprecatedSimulation.d.ts +4 -0
  8. package/dist/cjs/types/components/Forms/LiveSearch/hooks/useLiveSearch.d.ts +9 -0
  9. package/dist/cjs/types/components/Forms/LiveSearch/index.d.ts +2 -6
  10. package/dist/cjs/types/components/Forms/LiveSearch/types/index.d.ts +36 -0
  11. package/dist/cjs/types/components/Forms/LiveSearch/utils/dropdownUtils.d.ts +8 -0
  12. package/dist/cjs/types/components/Forms/LiveSearch/utils/searchUtils.d.ts +3 -0
  13. package/dist/cjs/types/components/InfoPanel/index.d.ts +3 -3
  14. package/dist/cjs/types/components/Menu/MenuContainer.d.ts +7 -1
  15. package/dist/cjs/types/components/Menu/MenuContainerNoAnchor.d.ts +13 -0
  16. package/dist/cjs/types/components/Modal/Modal.d.ts +2 -2
  17. package/dist/cjs/types/components/Tab/Tab.d.ts +2 -1
  18. package/dist/{esm/types/stories/Form/LiveSearch/LivesearchOld.stories.d.ts → cjs/types/stories/Form/LiveSearch/DeprecatedSimulation.stories.d.ts} +2 -2
  19. package/dist/cjs/types/stories/Form/LiveSearch/LivesearchCustomDropdownExample.stories.d.ts +7 -3
  20. package/dist/cjs/types/utility/hooks/usePopupPosition.d.ts +8 -0
  21. package/dist/esm/index.js +214 -163
  22. package/dist/esm/lib.css +1 -1
  23. package/dist/esm/types/components/Forms/DatePicker/DateInputDisplay.d.ts +3 -1
  24. package/dist/esm/types/components/Forms/DatePicker/DatePicker.d.ts +4 -1
  25. package/dist/esm/types/components/Forms/Dropdown/DropdownContainer.d.ts +2 -2
  26. package/dist/esm/types/components/Forms/LiveSearch/Example/CustomDropdown.d.ts +1 -2
  27. package/dist/esm/types/components/Forms/LiveSearch/Example/DeprecatedSimulation.d.ts +4 -0
  28. package/dist/esm/types/components/Forms/LiveSearch/hooks/useLiveSearch.d.ts +9 -0
  29. package/dist/esm/types/components/Forms/LiveSearch/index.d.ts +2 -6
  30. package/dist/esm/types/components/Forms/LiveSearch/types/index.d.ts +36 -0
  31. package/dist/esm/types/components/Forms/LiveSearch/utils/dropdownUtils.d.ts +8 -0
  32. package/dist/esm/types/components/Forms/LiveSearch/utils/searchUtils.d.ts +3 -0
  33. package/dist/esm/types/components/InfoPanel/index.d.ts +3 -3
  34. package/dist/esm/types/components/Menu/MenuContainer.d.ts +7 -1
  35. package/dist/esm/types/components/Menu/MenuContainerNoAnchor.d.ts +13 -0
  36. package/dist/esm/types/components/Modal/Modal.d.ts +2 -2
  37. package/dist/esm/types/components/Tab/Tab.d.ts +2 -1
  38. package/dist/{cjs/types/stories/Form/LiveSearch/LivesearchOld.stories.d.ts → esm/types/stories/Form/LiveSearch/DeprecatedSimulation.stories.d.ts} +2 -2
  39. package/dist/esm/types/stories/Form/LiveSearch/LivesearchCustomDropdownExample.stories.d.ts +7 -3
  40. package/dist/esm/types/utility/hooks/usePopupPosition.d.ts +8 -0
  41. package/dist/index.d.ts +34 -24
  42. package/package.json +1 -1
  43. package/dist/cjs/types/components/Forms/LiveSearch/PropsInterface.d.ts +0 -23
  44. package/dist/cjs/types/components/Forms/LiveSearch/Simulation.d.ts +0 -4
  45. package/dist/esm/types/components/Forms/LiveSearch/PropsInterface.d.ts +0 -23
  46. package/dist/esm/types/components/Forms/LiveSearch/Simulation.d.ts +0 -4
package/dist/cjs/index.js CHANGED
@@ -443,10 +443,10 @@ var minWidthConfig$1 = {
443
443
  tn: 'min-w-[64px]',
444
444
  };
445
445
  var iconOnlySizeConfig$1 = {
446
- lg: 'py-[13px] h-[48px] h-[48px] flex items-center justify-center gap-[10px]',
446
+ lg: 'py-[13px] h-[48px] w-[48px] flex items-center justify-center gap-[10px]',
447
447
  md: 'py-[11px] h-[40px] w-[40px] flex items-center justify-center gap-[5px]',
448
- sm: 'py-[8px] h-[30px] h-[30px] flex items-center justify-center gap-[5px] ',
449
- tn: 'py-[4px] h-[22px] h-[22px] flex items-center justify-center gap-[3px]',
448
+ sm: 'py-[8px] h-[30px] w-[30px] flex items-center justify-center gap-[5px] ',
449
+ tn: 'py-[4px] h-[22px] w-[22px] flex items-center justify-center gap-[3px]',
450
450
  };
451
451
  var shadow = 'shadow-[0px_6px_18px_1px_rgba(188,199,237,0.5)] disabled:shadow-none active:shadow-none';
452
452
  var variantConfig$2 = {
@@ -1724,7 +1724,86 @@ var TreeItem = function (_a) {
1724
1724
  })))));
1725
1725
  };
1726
1726
 
1727
- var MenuContainer = React.forwardRef(function MenuContainer(propsComp, ref) {
1727
+ var getDropdownStyle = function (anchorRef, popupRef) {
1728
+ if (!anchorRef.current || !popupRef.current) {
1729
+ return {};
1730
+ }
1731
+ var anchorRect = anchorRef.current.getBoundingClientRect();
1732
+ var popupHeight = popupRef.current.offsetHeight;
1733
+ var spaceToBottom = window.innerHeight - anchorRect.bottom;
1734
+ var spaceToTop = anchorRect.top;
1735
+ var style = {
1736
+ left: "".concat(anchorRect.left, "px"),
1737
+ };
1738
+ // If space below is less than popup height,
1739
+ // AND space above is more than space below
1740
+ // then flip up
1741
+ if (spaceToBottom < popupHeight && spaceToTop > spaceToBottom) {
1742
+ style.bottom = "".concat(window.innerHeight - anchorRect.top, "px");
1743
+ }
1744
+ else {
1745
+ style.top = "".concat(anchorRect.bottom, "px");
1746
+ }
1747
+ return style;
1748
+ };
1749
+ var usePopupPosition = function (anchorRef, popupRef) {
1750
+ // In projects where bianic-ui is installed,
1751
+ // there is a delay in rendering styles,
1752
+ // which causes popups to lose their position and need to be re-rendered.
1753
+ var _a = React.useState(0), repeateRender = _a[0], setRepeateRender = _a[1];
1754
+ var _b = React.useState({}), positionStyle = _b[0], setPositionStyle = _b[1];
1755
+ React.useLayoutEffect(function () {
1756
+ if (!(anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current))
1757
+ return;
1758
+ var newStyle = getDropdownStyle(anchorRef, popupRef);
1759
+ setPositionStyle(newStyle);
1760
+ var handleScrollOrResize = function () {
1761
+ setPositionStyle(getDropdownStyle(anchorRef, popupRef));
1762
+ };
1763
+ window.addEventListener('scroll', handleScrollOrResize);
1764
+ window.addEventListener('resize', handleScrollOrResize);
1765
+ setRepeateRender(0);
1766
+ return function () {
1767
+ window.removeEventListener('scroll', handleScrollOrResize);
1768
+ window.removeEventListener('resize', handleScrollOrResize);
1769
+ };
1770
+ }, [anchorRef]);
1771
+ React.useEffect(function () {
1772
+ if (repeateRender < 5 && (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current)) {
1773
+ setPositionStyle(getDropdownStyle(anchorRef, popupRef));
1774
+ setRepeateRender(repeateRender + 1);
1775
+ }
1776
+ }, [repeateRender]);
1777
+ return [positionStyle];
1778
+ };
1779
+
1780
+ var MenuContainer = function (props) {
1781
+ var _a = props.isTopFlat, isTopFlat = _a === void 0 ? false : _a, children = props.children, _b = props.open, open = _b === void 0 ? true : _b, _c = props.onClose, onClose = _c === void 0 ? function () { } : _c, _d = props.className, className = _d === void 0 ? '' : _d, _e = props.isWithOverlay, isWithOverlay = _e === void 0 ? true : _e, _f = props.zIndex, zIndex = _f === void 0 ? 100 : _f, _g = props.onClickItem, onClickItem = _g === void 0 ? function () { } : _g, anchorRef = props.anchorRef, restProps = __rest(props, ["isTopFlat", "children", "open", "onClose", "className", "isWithOverlay", "zIndex", "onClickItem", "anchorRef"]);
1782
+ if (!open)
1783
+ return null;
1784
+ var radiusClass = "rounded-b-radius-sm ".concat(!isTopFlat && 'rounded-t-radius-sm');
1785
+ var MenuContainerRef = React.useRef(null);
1786
+ var positionStyle = usePopupPosition(anchorRef, MenuContainerRef)[0];
1787
+ return (React.createElement(React.Fragment, null,
1788
+ isWithOverlay && (React.createElement("div", { className: "bianic-menu-overlay fixed left-0 top-0 z-0 h-screen w-screen", onClick: function () { return onClose(); }, style: { zIndex: zIndex } })),
1789
+ reactDom.createPortal(React.createElement("div", __assign({ ref: MenuContainerRef, className: "absolute w-fit bg-bia-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.20)] ".concat(radiusClass, " ").concat(className), style: __assign({ zIndex: zIndex + 10, minWidth: anchorRef.current
1790
+ ? anchorRef.current.offsetWidth
1791
+ : undefined }, positionStyle) }, restProps), React.Children.map(children, function (child) {
1792
+ return React.isValidElement(child)
1793
+ ? // Kirimkan handleItemClick sebagai props onClick ke setiap MenuItem
1794
+ React.cloneElement(child, {
1795
+ onClose: function () { return onClose(); },
1796
+ zIndex: zIndex + 10,
1797
+ inheritedOnClick: function () { return onClickItem(); },
1798
+ })
1799
+ : child;
1800
+ })), document.body)));
1801
+ };
1802
+ MenuContainer.defaultProps = {
1803
+ isTopFlat: false,
1804
+ };
1805
+
1806
+ var MenuContainerNoAnchor = React.forwardRef(function MenuContainerNoAnchor(propsComp, ref) {
1728
1807
  var _a = propsComp.isTopFlat, isTopFlat = _a === void 0 ? false : _a, children = propsComp.children, _b = propsComp.open, open = _b === void 0 ? true : _b, _c = propsComp.onClose, onClose = _c === void 0 ? function () { } : _c, _d = propsComp.className, className = _d === void 0 ? '' : _d, _e = propsComp.isWithOverlay, isWithOverlay = _e === void 0 ? true : _e, _f = propsComp.zIndex, zIndex = _f === void 0 ? 100 : _f, _g = propsComp.onClickItem, onClickItem = _g === void 0 ? function () { } : _g, restProps = __rest(propsComp, ["isTopFlat", "children", "open", "onClose", "className", "isWithOverlay", "zIndex", "onClickItem"]);
1729
1808
  var radiusClass = "rounded-b-radius-sm ".concat(!isTopFlat && 'rounded-t-radius-sm');
1730
1809
  return (open && (React.createElement(React.Fragment, null,
@@ -1742,7 +1821,7 @@ var MenuContainer = React.forwardRef(function MenuContainer(propsComp, ref) {
1742
1821
  : child;
1743
1822
  })))));
1744
1823
  });
1745
- MenuContainer.defaultProps = {
1824
+ MenuContainerNoAnchor.defaultProps = {
1746
1825
  isTopFlat: false,
1747
1826
  };
1748
1827
 
@@ -1756,11 +1835,10 @@ function MenuItem(_a) {
1756
1835
  var itemClass = "".concat(leftPadding, " ").concat(rightPadding, " ").concat(className);
1757
1836
  var MenuContRef = React.useRef(null);
1758
1837
  React.useEffect(function () {
1759
- var _a;
1760
1838
  if (MenuContRef.current) {
1761
1839
  // Adjust dropdown position to prevent overflow on the right.
1762
- var MenuContRect = (_a = MenuContRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
1763
- var RectRight = MenuContRect === null || MenuContRect === void 0 ? void 0 : MenuContRect.right;
1840
+ var MenuContRect = MenuContRef.current.getBoundingClientRect();
1841
+ var RectRight = MenuContRect.right;
1764
1842
  var innerWindow = window.innerWidth;
1765
1843
  if (RectRight > innerWindow)
1766
1844
  setIsLeft(true);
@@ -1784,7 +1862,7 @@ function MenuItem(_a) {
1784
1862
  React.createElement("div", { className: "ml-auto flex items-center" },
1785
1863
  children && (React.createElement(TbChevronRight, { className: "ml-[10px] text-bia-coolgrey" })),
1786
1864
  children === undefined && caption && (React.createElement("span", { className: "ml-[30px] whitespace-nowrap text-[11px] text-bia-coolgrey" }, caption)))),
1787
- children && (React.createElement(MenuContainer, { open: isHovered, onClose: onClose, className: "absolute top-0 bg-primary-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.20)] group-first/main:top-[6px] ".concat(translateClass), ref: MenuContRef, zIndex: currentZIndex + 10, onClickItem: function () { return inheritedOnClick(); } }, children))));
1865
+ children && (React.createElement(MenuContainerNoAnchor, { open: isHovered, onClose: onClose, className: "absolute top-0 bg-primary-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.20)] group-first/main:top-[6px] ".concat(translateClass), ref: MenuContRef, zIndex: currentZIndex + 10, onClickItem: function () { return inheritedOnClick(); } }, children))));
1788
1866
  }
1789
1867
  MenuItem.defaultProps = {
1790
1868
  className: '',
@@ -2385,71 +2463,22 @@ var sizeConfig$6 = {
2385
2463
  },
2386
2464
  };
2387
2465
 
2388
- var getDropdownStyle = function (anchorRef, dropdownRef) {
2389
- if (!anchorRef.current || !dropdownRef.current) {
2390
- return { minWidth: 'auto' };
2391
- }
2392
- var anchorRect = anchorRef.current.getBoundingClientRect();
2393
- var dropdownHeight = dropdownRef.current.offsetHeight;
2394
- var spaceToBottom = window.innerHeight - anchorRect.bottom;
2395
- var spaceToTop = anchorRect.top;
2396
- var style = {
2397
- left: "".concat(anchorRect.left, "px"),
2398
- minWidth: "".concat(anchorRect.width, "px"),
2399
- };
2400
- // If space below is less than dropdown height,
2401
- // AND space above is more than space below
2402
- // then flip up
2403
- if (spaceToBottom < dropdownHeight && spaceToTop > spaceToBottom) {
2404
- style.bottom = "".concat(window.innerHeight - anchorRect.top, "px");
2405
- }
2406
- else {
2407
- style.top = "".concat(anchorRect.bottom, "px");
2408
- }
2409
- return style;
2410
- };
2411
2466
  var DropdownContainer = function (propsComp) {
2412
2467
  var _a = propsComp.isTopFlat, isTopFlat = _a === void 0 ? false : _a, children = propsComp.children, _b = propsComp.open, open = _b === void 0 ? true : _b, _c = propsComp.onClose, onClose = _c === void 0 ? function () { } : _c, _d = propsComp.className, className = _d === void 0 ? '' : _d, _e = propsComp.isWithOverlay, isWithOverlay = _e === void 0 ? true : _e, _f = propsComp.size, size = _f === void 0 ? 'md' : _f, _g = propsComp.onClickItem, onClickItem = _g === void 0 ? function () { } : _g, _h = propsComp.zIndex, zIndex = _h === void 0 ? 100 : _h, anchorRef = propsComp.anchorRef, restProps = __rest(propsComp, ["isTopFlat", "children", "open", "onClose", "className", "isWithOverlay", "size", "onClickItem", "zIndex", "anchorRef"]);
2413
2468
  if (!open)
2414
2469
  return null;
2415
- var _j = React.useState({ minWidth: 'auto' }), positionStyle = _j[0], setPositionStyle = _j[1];
2416
2470
  var radiusClass = "rounded-b-radius-sm ".concat(!isTopFlat && 'rounded-t-radius-sm');
2417
2471
  var sizeClass = containerSizeConfig[size] || containerSizeConfig['md'];
2418
2472
  var containerClass = "".concat(sizeClass, " ").concat(radiusClass, " ").concat(className);
2419
2473
  var dropdownRef = React.useRef(null);
2474
+ var positionStyle = usePopupPosition(anchorRef, dropdownRef)[0];
2420
2475
  var handleClickDrpdownItem = function (e, val) {
2421
2476
  onClickItem(e, val);
2422
2477
  onClose();
2423
2478
  };
2424
- // In projects where bianic-ui is installed,
2425
- // there is a delay in rendering styles,
2426
- // which causes dropdowns to lose their position and need to be re-rendered.
2427
- var _k = React.useState(0), repeateRender = _k[0], setRepeateRender = _k[1];
2428
- React.useLayoutEffect(function () {
2429
- if (!(anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current))
2430
- return;
2431
- var newStyle = getDropdownStyle(anchorRef, dropdownRef);
2432
- setPositionStyle(newStyle);
2433
- var handleScrollOrResize = function () {
2434
- setPositionStyle(getDropdownStyle(anchorRef, dropdownRef));
2435
- };
2436
- window.addEventListener('scroll', handleScrollOrResize);
2437
- window.addEventListener('resize', handleScrollOrResize);
2438
- setRepeateRender(0);
2439
- return function () {
2440
- window.removeEventListener('scroll', handleScrollOrResize);
2441
- window.removeEventListener('resize', handleScrollOrResize);
2442
- };
2443
- }, [anchorRef]);
2444
- React.useEffect(function () {
2445
- if (repeateRender < 5 && (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current)) {
2446
- setPositionStyle(getDropdownStyle(anchorRef, dropdownRef));
2447
- setRepeateRender(repeateRender + 1);
2448
- }
2449
- }, [repeateRender]);
2450
2479
  return (React.createElement(React.Fragment, null,
2451
2480
  isWithOverlay && (React.createElement("div", { className: "bianic-dropdown-overlay fixed left-0 top-0 h-screen w-screen", style: { zIndex: zIndex }, onClick: function () { return onClose(); } })),
2452
- reactDom.createPortal(React.createElement("div", __assign({ ref: dropdownRef, className: "fixed max-w-fit bianic-dropdown-container bg-bia-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.20)] ".concat(containerClass), style: __assign({ zIndex: zIndex + 10 }, positionStyle) }, restProps), React.Children.map(children, function (child) {
2481
+ reactDom.createPortal(React.createElement("div", __assign({ ref: dropdownRef, className: "fixed max-w-fit bianic-dropdown-container bg-bia-white shadow-[0px_3px_20px_0px_rgba(0,0,0,0.20)] ".concat(containerClass), style: __assign({ minWidth: anchorRef.current ? anchorRef.current.offsetWidth : undefined, zIndex: zIndex + 10 }, positionStyle) }, restProps), React.Children.map(children, function (child) {
2453
2482
  return React.isValidElement(child)
2454
2483
  ? // Kirimkan handleItemClick sebagai props onClick ke setiap DropdownItem
2455
2484
  React.cloneElement(child, {
@@ -2520,111 +2549,131 @@ var matchSearchTerm = function (content, term, variant) {
2520
2549
  return lowerContent.includes(lowerTerm);
2521
2550
  }
2522
2551
  };
2523
- function LiveSearch(_a) {
2524
- var descText = _a.descText, _b = _a.disabled, disabled = _b === void 0 ? false : _b, id = _a.id, _c = _a.size, size = _c === void 0 ? 'md' : _c, label = _a.label, placeholder = _a.placeholder, _d = _a.required, required = _d === void 0 ? false : _d, options = _a.options, setValue = _a.setValue, value = _a.value, _e = _a.readOnly, readOnly = _e === void 0 ? false : _e, _f = _a.onChangeText, onChangeText = _f === void 0 ? function () { } : _f, _g = _a.onClickDropdown, onClickDropdown = _g === void 0 ? function () { } : _g, _h = _a.autoComplete, autoComplete = _h === void 0 ? 'off' : _h, _j = _a.children, children = _j === void 0 ? undefined : _j, _k = _a.dropContProps, dropContProps = _k === void 0 ? { className: undefined } : _k, _l = _a.searchVariant, searchVariant = _l === void 0 ? 'include' : _l;
2525
- var _m = React.useState(false), isOpen = _m[0], setIsOpen = _m[1];
2526
- var _o = React.useState(value.label || ''), searchTerm = _o[0], setSearchTerm = _o[1];
2527
- var _p = sizeConfig$6[size], iconClass = _p.iconClass, iconSize = _p.iconSize, inputClass = _p.inputClass;
2528
- var dropContClassName = dropContProps.className, dropContOnClickItem = dropContProps.onClickItem, restDropContProps = __rest(dropContProps, ["className", "onClickItem"]);
2529
- var isValueExist = value && value.label !== undefined && value.label !== '';
2530
- var inputRef = React.useRef(null);
2531
- var dropdownContRef = React.useRef(null);
2532
- // Will be used soon
2533
- // const handleOutsideClick = (e: MouseEvent) => {
2534
- // if (inputRef.current && !inputRef.current.contains(e.target as Node)) {
2535
- // setIsOpen(false)
2536
- // }
2537
- // }
2538
- // useEffect(() => {
2539
- // document.addEventListener('mousedown', handleOutsideClick)
2540
- // return () => {
2541
- // document.removeEventListener('mousedown', handleOutsideClick)
2542
- // }
2543
- // })
2544
- // Synchronize internal searchTerm with external value prop
2545
- React.useEffect(function () {
2546
- // Only update searchTerm if the label from the value prop differs from the current searchTerm
2547
- // This prevents infinite loops if searchTerm is already the same as value.label
2548
- if (value.label !== searchTerm) {
2549
- setSearchTerm(value.label || '');
2550
- }
2551
- }, [value.label, searchTerm]);
2552
- var filteredOptions = options === null || options === void 0 ? void 0 : options.filter(function (item) {
2553
- return item.label.toLowerCase().includes(value.label.toLowerCase());
2552
+ var filterOptions = function (options, searchTerm) {
2553
+ return options === null || options === void 0 ? void 0 : options.filter(function (item) {
2554
+ return item.label.toLowerCase().includes(searchTerm.toLowerCase());
2554
2555
  });
2555
- var handleInputChange = function (e) {
2556
- var newSearchTerm = e.target.value;
2557
- setSearchTerm(newSearchTerm);
2558
- setIsOpen(true); // Ensure dropdown opens when typing
2559
- };
2560
- var handleDropdownItemClick = React.useCallback(function (clickedValue) {
2561
- setSearchTerm(clickedValue.label); // Set input text to the selected label
2562
- setValue(clickedValue); // Update the value in the parent
2563
- setIsOpen(false);
2564
- }, [setValue]);
2565
- // Recursive function to filter and clone DropdownItems, including nested items
2566
- var processDropdownChildren = function (nodes, currentSearchTerm, includeAllIfNoSearch) {
2567
- return React.Children.map(nodes, function (child) {
2568
- if (!React.isValidElement(child) || child.type !== DropdownItem) {
2569
- return child;
2570
- }
2571
- var itemProps = child.props;
2572
- // Assume content is a string for filtering; otherwise, filtering won't work well
2573
- var itemContent = typeof itemProps.content === 'string' ? itemProps.content : '';
2574
- var itemValue = itemProps.value;
2575
- var isDisabled = itemProps.disabled;
2576
- // 2. Filtering Logic (Uses Global Search Variant)
2577
- if (!includeAllIfNoSearch) {
2578
- // Use the matchSearchTerm utility with the selected searchVariant
2579
- if (currentSearchTerm && !matchSearchTerm(itemValue, currentSearchTerm, searchVariant)) {
2580
- return null; // Item does not match the search criteria
2581
- }
2556
+ };
2557
+
2558
+ var getItemLabel = function (value) {
2559
+ var _a;
2560
+ return typeof value === 'object' && value !== null && 'label' in value
2561
+ ? (_a = value.label) !== null && _a !== void 0 ? _a : ''
2562
+ : String(value !== null && value !== void 0 ? value : '');
2563
+ };
2564
+ var processDropdownChildren = function (nodes, currentSearchTerm, includeAllIfNoSearch, searchVariant, handleDropdownItemClick) {
2565
+ if (searchVariant === void 0) { searchVariant = 'include'; }
2566
+ return React.Children.map(nodes, function (child) {
2567
+ if (!React.isValidElement(child) || child.type !== DropdownItem) {
2568
+ return child;
2569
+ }
2570
+ var itemProps = child.props;
2571
+ var itemContent = typeof itemProps.content === 'string' ? itemProps.content : '';
2572
+ var itemValue = itemProps.value;
2573
+ var isDisabled = itemProps.disabled;
2574
+ // Filtering Logic
2575
+ if (!includeAllIfNoSearch) {
2576
+ var itemValueStr = typeof itemValue === 'object'
2577
+ ? itemValue.label
2578
+ : String(itemValue || '');
2579
+ if (currentSearchTerm &&
2580
+ !matchSearchTerm(itemValueStr, currentSearchTerm, searchVariant)) {
2581
+ return null;
2582
2582
  }
2583
- // 3. Process Nested Children (Recursion)
2584
- var clonedChildren = itemProps.children
2585
- ? processDropdownChildren(itemProps.children, currentSearchTerm, includeAllIfNoSearch)
2586
- : null;
2587
- // 4. Clone and Inject Click Handler
2588
- return React.cloneElement(child, {
2589
- onClick: function (e) {
2590
- if (!isDisabled) {
2591
- handleDropdownItemClick({
2592
- id: itemValue !== undefined ? itemValue : itemContent,
2593
- label: itemValue !== undefined ? itemValue : itemContent
2594
- });
2595
- }
2596
- if (dropContOnClickItem) {
2597
- dropContOnClickItem(e, itemValue !== undefined ? itemValue : itemContent);
2583
+ }
2584
+ // Process Nested Children
2585
+ var clonedChildren = itemProps.children
2586
+ ? processDropdownChildren(itemProps.children, currentSearchTerm, includeAllIfNoSearch, searchVariant, handleDropdownItemClick)
2587
+ : null;
2588
+ // Clone and Inject Click Handler
2589
+ return React.cloneElement(child, {
2590
+ onClick: function (e) {
2591
+ if (!isDisabled) {
2592
+ if (itemValue === undefined &&
2593
+ typeof itemProps.content === 'string') {
2594
+ return handleDropdownItemClick(e, itemContent);
2598
2595
  }
2599
- if (itemProps.onClickItem) {
2600
- itemProps.onClickItem(e, itemValue !== undefined ? itemValue : itemContent);
2596
+ if (typeof itemValue === 'object' || itemValue !== undefined) {
2597
+ return handleDropdownItemClick(e, itemValue);
2601
2598
  }
2602
- },
2603
- children: clonedChildren
2604
- });
2599
+ }
2600
+ if (itemProps.onClickItem) {
2601
+ itemProps.onClickItem(e, itemValue !== undefined ? itemValue : itemContent);
2602
+ }
2603
+ },
2604
+ children: clonedChildren,
2605
2605
  });
2606
- };
2607
- // Determine which children to display
2606
+ });
2607
+ };
2608
+ var processRenderedChildren = function (children, searchTerm, searchVariant, handleDropdownItemClick) {
2608
2609
  var renderedChildren = null;
2609
2610
  var hasFilteredResults = false;
2610
2611
  if (searchTerm) {
2611
- // If there's a searchTerm, filter children
2612
- renderedChildren = processDropdownChildren(children, searchTerm, false);
2612
+ renderedChildren = processDropdownChildren(children, searchTerm, false, searchVariant, handleDropdownItemClick);
2613
2613
  hasFilteredResults =
2614
2614
  React.Children.toArray(renderedChildren).filter(Boolean).length > 0;
2615
2615
  }
2616
2616
  else {
2617
- // If searchTerm is empty, display all children without filtering (but with onClick injected)
2618
- renderedChildren = processDropdownChildren(children, '', true);
2617
+ renderedChildren = processDropdownChildren(children, '', true, searchVariant, handleDropdownItemClick);
2619
2618
  hasFilteredResults =
2620
- React.Children.toArray(renderedChildren).filter(Boolean).length > 0; // Should always be true if there are initial children
2619
+ React.Children.toArray(renderedChildren).filter(Boolean).length > 0;
2621
2620
  }
2621
+ return { renderedChildren: renderedChildren, hasFilteredResults: hasFilteredResults };
2622
+ };
2623
+
2624
+ var useLiveSearch = function (_a) {
2625
+ var value = _a.value, setValue = _a.setValue, onChangeText = _a.onChangeText, dropContOnClickItem = _a.dropContOnClickItem;
2626
+ var _b = React.useState(false), isOpen = _b[0], setIsOpen = _b[1];
2627
+ var _c = React.useState(String(value.label || '')), searchTerm = _c[0], setSearchTerm = _c[1];
2628
+ React.useEffect(function () {
2629
+ if (!isOpen && searchTerm !== '') {
2630
+ setSearchTerm(getItemLabel(value));
2631
+ }
2632
+ }, [isOpen]);
2633
+ var handleInputChange = function (e) {
2634
+ var newSearchTerm = e.target.value;
2635
+ setSearchTerm(newSearchTerm);
2636
+ setIsOpen(true);
2637
+ onChangeText === null || onChangeText === void 0 ? void 0 : onChangeText(e);
2638
+ };
2639
+ var handleDropdownItemClick = React.useCallback(function (event, clickedValue) {
2640
+ dropContOnClickItem === null || dropContOnClickItem === void 0 ? void 0 : dropContOnClickItem(event, clickedValue);
2641
+ var newLabel = getItemLabel(clickedValue);
2642
+ setSearchTerm(newLabel);
2643
+ setValue(clickedValue);
2644
+ setIsOpen(false);
2645
+ }, [setValue, dropContOnClickItem]);
2646
+ return {
2647
+ isOpen: isOpen,
2648
+ setIsOpen: setIsOpen,
2649
+ searchTerm: searchTerm,
2650
+ handleInputChange: handleInputChange,
2651
+ handleDropdownItemClick: handleDropdownItemClick,
2652
+ };
2653
+ };
2654
+
2655
+ function LiveSearch(_a) {
2656
+ var _b = _a.autoComplete, autoComplete = _b === void 0 ? 'off' : _b, _c = _a.children, children = _c === void 0 ? undefined : _c, descText = _a.descText, _d = _a.disabled, disabled = _d === void 0 ? false : _d, _e = _a.dropContProps, dropContProps = _e === void 0 ? { className: undefined } : _e, id = _a.id, label = _a.label, _f = _a.onChangeText, onChangeText = _f === void 0 ? function () { } : _f, _g = _a.onClickDropdown, onClickDropdown = _g === void 0 ? function () { } : _g, options = _a.options, placeholder = _a.placeholder, _h = _a.readOnly, readOnly = _h === void 0 ? false : _h, _j = _a.required, required = _j === void 0 ? false : _j, _k = _a.searchVariant, searchVariant = _k === void 0 ? 'include' : _k, setValue = _a.setValue, _l = _a.size, size = _l === void 0 ? 'md' : _l, value = _a.value;
2657
+ var inputRef = React.useRef(null);
2658
+ var dropdownContRef = React.useRef(null);
2659
+ var _m = useLiveSearch({
2660
+ value: value,
2661
+ setValue: setValue,
2662
+ onChangeText: onChangeText,
2663
+ dropContOnClickItem: dropContProps.onClickItem
2664
+ }), isOpen = _m.isOpen, setIsOpen = _m.setIsOpen, searchTerm = _m.searchTerm, handleInputChange = _m.handleInputChange, handleDropdownItemClick = _m.handleDropdownItemClick;
2665
+ var _o = sizeConfig$6[size], iconClass = _o.iconClass, iconSize = _o.iconSize, inputClass = _o.inputClass;
2666
+ var dropContClassName = dropContProps.className; dropContProps.onClickItem; var restDropContProps = __rest(dropContProps, ["className", "onClickItem"]);
2667
+ var isValueExist = value && value.label !== undefined && value.label !== '';
2668
+ var filteredOptions = filterOptions(options || [], value.label);
2669
+ var _p = processRenderedChildren(children, searchTerm, searchVariant, handleDropdownItemClick), renderedChildren = _p.renderedChildren, hasFilteredResults = _p.hasFilteredResults;
2622
2670
  return (React.createElement("div", { className: "bianic-livesearch field-group group/form flex w-full flex-col gap-y-2 " },
2623
- label && (React.createElement(FormLabel, { htmlFor: id, required: required, readOnly: readOnly }, label)),
2671
+ label && (React.createElement(FormLabel, { htmlFor: id, required: required, readOnly: readOnly },
2672
+ label,
2673
+ " Test")),
2624
2674
  React.createElement("div", { className: "group relative w-full" },
2625
2675
  React.createElement("input", { className: "bianic-livesearch-input field peer w-full rounded border border-bia-grey-dark-10 bg-primary-white read-only:pointer-events-none read-only:border-bia-grey-disabled focus-visible:outline-none enabled:hover:rounded-b-none enabled:hover:border-b-bia-blue enabled:focus:rounded-b-none enabled:focus:border-b-bia-blue disabled:border-bia-grey-dark-10 disabled:bg-bia-grey-light-10 disabled:text-bia-coolgrey ".concat(inputClass), onClick: function () { return setIsOpen(!isOpen); }, value: searchTerm, required: required, disabled: disabled, id: id, placeholder: placeholder, ref: inputRef, onChange: function (e) {
2626
2676
  onChangeText(e);
2627
- setValue({ id: null, label: e.target.value });
2628
2677
  handleInputChange(e);
2629
2678
  }, type: "text", readOnly: readOnly, autoComplete: autoComplete }),
2630
2679
  React.createElement("div", { className: "absolute inset-y-0 flex items-center pl-3 ".concat(iconClass) },
@@ -3070,7 +3119,7 @@ var monthMap = [
3070
3119
  'December',
3071
3120
  ];
3072
3121
  var DateInputDisplay = function (_a) {
3073
- var value = _a.value, setValue = _a.setValue, _b = _a.placeholder, placeholder = _b === void 0 ? 'YYYY-MM-DD' : _b, label = _a.label, required = _a.required, id = _a.id, _c = _a.size, size = _c === void 0 ? 'sm' : _c, className = _a.className, _d = _a.disabled, disabled = _d === void 0 ? false : _d, buttonAction = _a.buttonAction, props = __rest(_a, ["value", "setValue", "placeholder", "label", "required", "id", "size", "className", "disabled", "buttonAction"]);
3122
+ var value = _a.value, setValue = _a.setValue, _b = _a.placeholder, placeholder = _b === void 0 ? 'YYYY-MM-DD' : _b, label = _a.label, required = _a.required, id = _a.id, _c = _a.size, size = _c === void 0 ? 'sm' : _c, className = _a.className, _d = _a.disabled, disabled = _d === void 0 ? false : _d, buttonAction = _a.buttonAction, nullDisplay = _a.nullDisplay, props = __rest(_a, ["value", "setValue", "placeholder", "label", "required", "id", "size", "className", "disabled", "buttonAction", "nullDisplay"]);
3074
3123
  var _e = React.useState(false), isEditing = _e[0], setIsEditing = _e[1];
3075
3124
  var _f = React.useState(value), dateString = _f[0], setDateString = _f[1];
3076
3125
  var _g = styleConfig['text'], fieldStyle = _g.fieldStyle;
@@ -3099,11 +3148,13 @@ var DateInputDisplay = function (_a) {
3099
3148
  setIsEditing(false);
3100
3149
  setDateString(value);
3101
3150
  };
3102
- var input = isEditing ? (React.createElement(TextInput, { type: "text", value: dateString !== null && dateString !== void 0 ? dateString : '', onChange: handleTextChange, onBlur: handleBlur, placeholder: placeholder, size: size, autoFocus: true, actionElement: React.createElement("button", { className: "bianic-datepicker-toggle-button text-bia-coolgrey", disabled: disabled, onClick: function () {
3151
+ var input = isEditing ? (React.createElement(TextInput, { type: "text", value: dateString !== null && dateString !== void 0 ? dateString : '', onChange: handleTextChange, onBlur: handleBlur, placeholder: placeholder, size: size, inputClassName: className, autoFocus: true, actionElement: React.createElement("button", { className: "bianic-datepicker-toggle-button text-bia-coolgrey", disabled: disabled, onClick: function () {
3103
3152
  buttonAction && buttonAction();
3104
3153
  } },
3105
3154
  React.createElement(TbCalendar, { size: iconSize })) })) : (React.createElement(React.Fragment, null,
3106
- React.createElement("div", { role: "button", onClick: function () { return setIsEditing(true); }, className: "bianic-text-input bianic-fgc-target w-full min-w-[185px] rounded hover:rounded-b-none hover:border-b-bia-blue focus:rounded-b-none focus-visible:outline-none disabled:border-bia-grey-dark-10 disabled:bg-bia-grey-light-80 disabled:text-bia-grey-active ".concat(extendedInputClassName, " ").concat(value ? 'text-bia-black' : 'text-bia-coolgrey') }, value ? displayDateFormatter(new Date(value)) : placeholder),
3155
+ React.createElement("div", { role: "button", onClick: function () { return setIsEditing(true); }, className: "bianic-text-input bianic-fgc-target w-full min-w-[185px] rounded hover:rounded-b-none hover:border-b-bia-blue focus:rounded-b-none focus-visible:outline-none disabled:border-bia-grey-dark-10 disabled:bg-bia-grey-light-80 disabled:text-bia-grey-active ".concat(extendedInputClassName, " ").concat(value || nullDisplay ? 'text-bia-black' : 'text-bia-coolgrey', " ").concat(className) }, value
3156
+ ? displayDateFormatter(new Date(value))
3157
+ : nullDisplay || placeholder),
3107
3158
  React.createElement("div", { className: "absolute inset-y-0 flex items-center pl-3 text-bia-coolgrey ".concat(iconPosition) },
3108
3159
  React.createElement("button", { className: "bianic-datepicker-toggle-button", disabled: disabled, onClick: function () { return buttonAction && buttonAction(); } },
3109
3160
  React.createElement(TbCalendar, { size: iconSize })))));
@@ -3132,15 +3183,15 @@ var displayDateFormatter = function (date) {
3132
3183
  };
3133
3184
 
3134
3185
  function DatePicker(_a) {
3135
- var value = _a.value, onChange = _a.onChange, size = _a.size, disabled = _a.disabled; _a.placeholder; var label = _a.label, minDate = _a.minDate, maxDate = _a.maxDate, required = _a.required;
3186
+ var value = _a.value, onChange = _a.onChange, size = _a.size, disabled = _a.disabled; _a.placeholder; var label = _a.label, minDate = _a.minDate, maxDate = _a.maxDate, required = _a.required, nullDisplay = _a.nullDisplay, inputclassName = _a.inputclassName, containerClassName = _a.containerClassName;
3136
3187
  // State and Ref
3137
3188
  var inputRef = React.useRef(null);
3138
3189
  var wrapperRef = React.useRef(null);
3139
3190
  var pickerRef = React.useRef(null);
3140
3191
  var _c = useDetectOutsideClick(wrapperRef, false, pickerRef), isPickerOpen = _c[0], setIsPickerOpen = _c[1];
3141
- return (React.createElement("div", { className: "bianic-datepicker-container relative", ref: wrapperRef },
3192
+ return (React.createElement("div", { className: "bianic-datepicker-container relative ".concat(containerClassName), ref: wrapperRef },
3142
3193
  React.createElement("div", { className: "bianic-datepicker-field-container" },
3143
- React.createElement(DateInputDisplay, { value: value, setValue: onChange, placeholder: "YYYY-MM-DD", size: size, label: label, required: required, buttonAction: function () { return setIsPickerOpen(!isPickerOpen); }, ref: inputRef, disabled: disabled })),
3194
+ React.createElement(DateInputDisplay, { inputClassName: inputclassName, value: value, setValue: onChange, placeholder: "YYYY-MM-DD", nullDisplay: nullDisplay, size: size, label: label, required: required, buttonAction: function () { return setIsPickerOpen(!isPickerOpen); }, ref: inputRef, disabled: disabled })),
3144
3195
  isPickerOpen && (React.createElement("div", { className: "bianic-datepicker-calendar-container absolute left-0 w-[250px] rounded-b-radius-sm bg-bia-white px-1.5 pb-[17px] pt-[15px] shadow-md" },
3145
3196
  React.createElement(PickerCalendar, { selectedDate: value, onDateChange: onChange, ref: pickerRef, minDate: minDate, maxDate: maxDate })))));
3146
3197
  }
@@ -3338,18 +3389,17 @@ var sizeConfig$3 = {
3338
3389
  };
3339
3390
 
3340
3391
  var InfoPanel = function (_a) {
3341
- var variant = _a.variant, color = _a.color, className = _a.className, textClassName = _a.textClassName;
3392
+ var variant = _a.variant, color = _a.color, className = _a.className, children = _a.children;
3342
3393
  var sizeClass = sizeConfig$3[variant || 'container'];
3343
3394
  var colorClass = colorConfig$1[color || 'yellow'];
3344
3395
  var allClasses = "".concat(sizeClass, " ").concat(colorClass, " ").concat(className);
3345
- return (React.createElement("div", { className: "flex items-center justify-center rounded-radius-md ".concat(allClasses) },
3346
- React.createElement(Text, { variant: "medium-text", extended: textClassName }, "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.")));
3396
+ return (React.createElement("div", { className: "flex items-center justify-center rounded-radius-md ".concat(allClasses) }, children));
3347
3397
  };
3348
3398
  InfoPanel.defaultProps = {
3349
3399
  variant: 'container',
3350
3400
  color: 'yellow',
3351
3401
  className: '',
3352
- textClassName: '',
3402
+ children: null,
3353
3403
  };
3354
3404
 
3355
3405
  function Modal(_a) {
@@ -3375,12 +3425,12 @@ function Modal(_a) {
3375
3425
  if (open) {
3376
3426
  return (
3377
3427
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events
3378
- React.createElement("div", { className: "bianic-modal-wrapper fixed inset-0 flex items-center justify-center bg-bia-black-transparent-75", style: { zIndex: !zIndex && isNaN(zIndex) ? 'auto' : zIndex }, id: "wrapper", onClick: handleClose },
3428
+ reactDom.createPortal(React.createElement("div", { className: "bianic-modal-wrapper fixed inset-0 flex items-center justify-center bg-bia-black-transparent-75", style: { zIndex: !zIndex && isNaN(zIndex) ? 'auto' : zIndex }, id: "wrapper", onClick: handleClose },
3379
3429
  React.createElement("div", { className: "bianic-modal flex flex-col gap-[20px] rounded-[5px] bg-white p-[20px] ".concat(modalSize), onClick: onClick },
3380
3430
  React.createElement("div", { className: "bianic-modal-header flex justify-between" },
3381
3431
  React.createElement("div", { className: " text-wrap text-left font-humnst777 text-[18px] font-bold leading-[21.85px] text-primary-black" }, title),
3382
3432
  React.createElement(Button, { variant: "subtle", radius: "full-rounded", iconLeft: React.createElement(TbX, { size: 14 }), size: "tn", onClick: function () { return onClose(); } })),
3383
- React.createElement("div", { className: "bianic-modal-content flex w-full flex-col items-start gap-[20px]" }, rest.children))));
3433
+ React.createElement("div", { className: "bianic-modal-content flex w-full flex-col items-start gap-[20px]" }, rest.children))), document.body));
3384
3434
  }
3385
3435
  return null;
3386
3436
  }
@@ -3436,7 +3486,7 @@ function PaginationBar(_a) {
3436
3486
  return (React.createElement("div", { className: "flex ".concat(positionConfig[position], " gap-[5px]") },
3437
3487
  React.createElement(Button, { variant: "subtle-link", size: size, type: "button", onClick: function () { return handlePageChange(currentPage - 1); }, className: "cursor-pointer", iconLeft: React.createElement(TbChevronLeft, { size: iconSize }), disabled: currentPage === 1 }),
3438
3488
  showedPages.map(function (page) { return (React.createElement(Button, { key: page, variant: currentPage === page ? 'default' : 'subtle-link', size: size, type: "button", onClick: function () { return handlePageChange(page); }, className: "cursor-pointer ".concat(sizeConfig$2[size]), label: page.toString(), minWidth: buttonSizingStyle })); }),
3439
- React.createElement(Button, { variant: "subtle-link", size: "md", type: "button", onClick: function () { return handlePageChange(currentPage + 1); }, className: "cursor-pointer", iconLeft: React.createElement(TbChevronRight, { size: iconSize }), disabled: currentPage === totalPages })));
3489
+ React.createElement(Button, { variant: "subtle-link", size: size, type: "button", onClick: function () { return handlePageChange(currentPage + 1); }, className: "cursor-pointer", iconLeft: React.createElement(TbChevronRight, { size: iconSize }), disabled: currentPage === totalPages })));
3440
3490
  }
3441
3491
 
3442
3492
  var activeConfig = {
@@ -3754,7 +3804,7 @@ var configTab = {
3754
3804
  };
3755
3805
 
3756
3806
  function Tab(_a) {
3757
- var children = _a.children, active = _a.active, icon = _a.icon, disabled = _a.disabled, _b = _a.mode, mode = _b === void 0 ? 'horizontal' : _b, _c = _a.fit, fit = _c === void 0 ? 'fit-content' : _c, _d = _a.size, size = _d === void 0 ? 'md' : _d, rest = __rest(_a, ["children", "active", "icon", "disabled", "mode", "fit", "size"]);
3807
+ var children = _a.children, active = _a.active, icon = _a.icon, disabled = _a.disabled, _b = _a.mode, mode = _b === void 0 ? 'horizontal' : _b, _c = _a.fit, fit = _c === void 0 ? 'fit-content' : _c, _d = _a.size, size = _d === void 0 ? 'md' : _d, className = _a.className, rest = __rest(_a, ["children", "active", "icon", "disabled", "mode", "fit", "size", "className"]);
3758
3808
  var disabledKeyTab = disabled || active ? ' pointer-events-none' : '';
3759
3809
  var cursor;
3760
3810
  if (disabled) {
@@ -3775,8 +3825,9 @@ function Tab(_a) {
3775
3825
  var activeKeyTab = active
3776
3826
  ? 'group-disabled:text-bia-coolgrey-disabled text-primary-black'
3777
3827
  : 'text-bia-coolgrey group-hover:text-bia-coolgrey-hover group-active:text-bia-coolgrey-active group-disabled:text-bia-coolgrey-disabled';
3828
+ var buttonClassName = "".concat(horizontalButtonStyle, " ").concat(disabledKeyTab, " ").concat(fit, " ").concat(className ? className : '');
3778
3829
  return (React.createElement("div", { className: "".concat(mode === 'horizontal' ? 'h-full' : 'w-full', " ").concat(cursor) },
3779
- React.createElement("button", __assign({ type: "button", disabled: disabled }, rest, { className: "flex items-stretch justify-between ".concat(horizontalButtonStyle, " group relative outline-none ").concat(disabledKeyTab, " ").concat(fit) }),
3830
+ React.createElement("button", __assign({ type: "button", className: "flex items-stretch justify-between group relative outline-none ".concat(buttonClassName), disabled: disabled }, rest),
3780
3831
  React.createElement("div", { className: "flex items-center justify-center ".concat(buttonContentStyle) },
3781
3832
  React.createElement("div", { className: "flex items-center justify-center " },
3782
3833
  React.createElement("div", { className: "flex items-center space-x-1 text-nowrap ".concat(activeKeyTab, " ").concat(configTab[size].text) },