@oliasoft-open-source/react-ui-library 10.8.0-beta-1 → 10.8.0-beta-2
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/global.css +239 -194
- package/dist/index.d.ts +39 -9
- package/dist/index.js +309 -252
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1058,35 +1058,35 @@ var isMenuEmpty = (menu) => {
|
|
|
1058
1058
|
return !isValidElement(sections) && (!Array.isArray(sections) || sections.every((section) => isEmpty(section)));
|
|
1059
1059
|
};
|
|
1060
1060
|
var menu_module_default = {
|
|
1061
|
-
layer: "
|
|
1062
|
-
nested: "
|
|
1063
|
-
fileInput: "
|
|
1064
|
-
trigger: "
|
|
1065
|
-
heading: "
|
|
1066
|
-
headingIcon: "
|
|
1067
|
-
clickable: "
|
|
1068
|
-
option: "
|
|
1069
|
-
active: "
|
|
1070
|
-
disabled: "
|
|
1071
|
-
selected: "
|
|
1072
|
-
optionContent: "
|
|
1073
|
-
description: "
|
|
1074
|
-
inline: "
|
|
1075
|
-
icon: "
|
|
1076
|
-
check: "
|
|
1077
|
-
label: "
|
|
1078
|
-
arrow: "
|
|
1079
|
-
divider: "
|
|
1080
|
-
buttonLabel: "
|
|
1081
|
-
component: "
|
|
1082
|
-
right: "
|
|
1083
|
-
actions: "
|
|
1084
|
-
menuPopover: "
|
|
1085
|
-
menuPopoverNested: "
|
|
1086
|
-
menuItem: "
|
|
1087
|
-
overlayScope: "
|
|
1088
|
-
noResults: "
|
|
1089
|
-
searchInput: "
|
|
1061
|
+
layer: "_layer_1dlok_1",
|
|
1062
|
+
nested: "_nested_1dlok_14",
|
|
1063
|
+
fileInput: "_fileInput_1dlok_17",
|
|
1064
|
+
trigger: "_trigger_1dlok_23",
|
|
1065
|
+
heading: "_heading_1dlok_32",
|
|
1066
|
+
headingIcon: "_headingIcon_1dlok_38",
|
|
1067
|
+
clickable: "_clickable_1dlok_45",
|
|
1068
|
+
option: "_option_1dlok_49",
|
|
1069
|
+
active: "_active_1dlok_68",
|
|
1070
|
+
disabled: "_disabled_1dlok_73",
|
|
1071
|
+
selected: "_selected_1dlok_76",
|
|
1072
|
+
optionContent: "_optionContent_1dlok_89",
|
|
1073
|
+
description: "_description_1dlok_93",
|
|
1074
|
+
inline: "_inline_1dlok_97",
|
|
1075
|
+
icon: "_icon_1dlok_102",
|
|
1076
|
+
check: "_check_1dlok_103",
|
|
1077
|
+
label: "_label_1dlok_130",
|
|
1078
|
+
arrow: "_arrow_1dlok_148",
|
|
1079
|
+
divider: "_divider_1dlok_152",
|
|
1080
|
+
buttonLabel: "_buttonLabel_1dlok_160",
|
|
1081
|
+
component: "_component_1dlok_167",
|
|
1082
|
+
right: "_right_1dlok_173",
|
|
1083
|
+
actions: "_actions_1dlok_178",
|
|
1084
|
+
menuPopover: "_menuPopover_1dlok_185",
|
|
1085
|
+
menuPopoverNested: "_menuPopoverNested_1dlok_207",
|
|
1086
|
+
menuItem: "_menuItem_1dlok_210",
|
|
1087
|
+
overlayScope: "_overlayScope_1dlok_229",
|
|
1088
|
+
noResults: "_noResults_1dlok_232",
|
|
1089
|
+
searchInput: "_searchInput_1dlok_236"
|
|
1090
1090
|
};
|
|
1091
1091
|
//#endregion
|
|
1092
1092
|
//#region src/components/menu/layer/heading.tsx
|
|
@@ -1183,9 +1183,9 @@ var Option$2 = ({ actions, label, url, onClick, description, icon, selected, clo
|
|
|
1183
1183
|
}),
|
|
1184
1184
|
/* @__PURE__ */ jsxs("div", {
|
|
1185
1185
|
className: menu_module_default.right,
|
|
1186
|
-
children: [
|
|
1186
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
1187
1187
|
className: menu_module_default.check,
|
|
1188
|
-
children: /* @__PURE__ */ jsx(Icon, { icon: IconType.CHECK })
|
|
1188
|
+
children: selected && /* @__PURE__ */ jsx(Icon, { icon: IconType.CHECK })
|
|
1189
1189
|
}), !!(actions === null || actions === void 0 ? void 0 : actions.length) && /* @__PURE__ */ jsx("div", {
|
|
1190
1190
|
className: menu_module_default.actions,
|
|
1191
1191
|
onClick: (evt) => evt.stopPropagation(),
|
|
@@ -1210,6 +1210,15 @@ var MenuCarat = /* @__PURE__ */ function(MenuCarat) {
|
|
|
1210
1210
|
MenuCarat["DOWN"] = "down";
|
|
1211
1211
|
return MenuCarat;
|
|
1212
1212
|
}({});
|
|
1213
|
+
/** Menu trigger variants. Extends shared `TriggerType` with Search. */
|
|
1214
|
+
var MenuTriggerType = /* @__PURE__ */ function(MenuTriggerType) {
|
|
1215
|
+
MenuTriggerType["TEXT"] = "Text";
|
|
1216
|
+
MenuTriggerType["BUTTON"] = "Button";
|
|
1217
|
+
MenuTriggerType["DROP_DOWN_BUTTON"] = "DropDownButton";
|
|
1218
|
+
MenuTriggerType["COMPONENT"] = "Component";
|
|
1219
|
+
MenuTriggerType["SEARCH"] = "Search";
|
|
1220
|
+
return MenuTriggerType;
|
|
1221
|
+
}({});
|
|
1213
1222
|
//#endregion
|
|
1214
1223
|
//#region src/components/menu/layer/section.tsx
|
|
1215
1224
|
/** Leaf section types only. Submenus are owned by Layer. */
|
|
@@ -1444,13 +1453,10 @@ var Layer$2 = ({ sections, isNested = false, width, closeOnOptionClick, close, m
|
|
|
1444
1453
|
shouldCloseOnSelect: closeOnOptionClick,
|
|
1445
1454
|
autoFocus: isNested ? void 0 : "first",
|
|
1446
1455
|
"data-testid": testId,
|
|
1447
|
-
renderEmptyState: search ? () => {
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
children: (_search$noResultsText = search.noResultsText) !== null && _search$noResultsText !== void 0 ? _search$noResultsText : "No results"
|
|
1452
|
-
});
|
|
1453
|
-
} : void 0,
|
|
1456
|
+
renderEmptyState: search ? () => /* @__PURE__ */ jsx("div", {
|
|
1457
|
+
className: menu_module_default.noResults,
|
|
1458
|
+
children: "No results"
|
|
1459
|
+
}) : void 0,
|
|
1454
1460
|
children: localSections.map((section, i) => renderSection(section, i, {
|
|
1455
1461
|
closeOnOptionClick: section.closeOnOptionClick,
|
|
1456
1462
|
close,
|
|
@@ -1494,6 +1500,7 @@ var trigger_module_default = {
|
|
|
1494
1500
|
};
|
|
1495
1501
|
//#endregion
|
|
1496
1502
|
//#region src/components/menu/trigger/search-trigger.tsx
|
|
1503
|
+
var hasDisplayValue = (value) => value != null && value !== "";
|
|
1497
1504
|
var groupOrderClass = (groupOrder) => {
|
|
1498
1505
|
switch (groupOrder) {
|
|
1499
1506
|
case GroupOrder.FIRST: return trigger_module_default.groupOrderFirst;
|
|
@@ -1508,7 +1515,7 @@ var groupOrderClass = (groupOrder) => {
|
|
|
1508
1515
|
* Behaviour mirrors the searchable Select: click anywhere toggles, typing / ArrowDown opens,
|
|
1509
1516
|
* Escape / Tab close.
|
|
1510
1517
|
*/
|
|
1511
|
-
var SearchTrigger = forwardRef(({ label, searchValue, isOpen, disabled, small, width, groupOrder, error, warning, tabIndex, testId, inputRef, onOpen, onClose }, ref) => {
|
|
1518
|
+
var SearchTrigger = forwardRef(({ label, placeholder, searchValue, isOpen, disabled, small, width, groupOrder, error, warning, tabIndex, testId, isInTable, inputRef, onOpen, onClose }, ref) => {
|
|
1512
1519
|
const handleMouseDown = (evt) => evt.preventDefault();
|
|
1513
1520
|
const handleClick = () => {
|
|
1514
1521
|
var _inputRef$current;
|
|
@@ -1521,9 +1528,12 @@ var SearchTrigger = forwardRef(({ label, searchValue, isOpen, disabled, small, w
|
|
|
1521
1528
|
if (!isOpen && evt.key === "ArrowDown") onOpen();
|
|
1522
1529
|
if (isOpen && (evt.key === "Escape" || evt.key === "Tab")) onClose();
|
|
1523
1530
|
};
|
|
1531
|
+
const showLabel = !searchValue && hasDisplayValue(label);
|
|
1532
|
+
const showPlaceholder = !searchValue && !showLabel && hasDisplayValue(placeholder);
|
|
1533
|
+
const ariaLabel = typeof label === "string" && label || typeof placeholder === "string" && placeholder || "Search";
|
|
1524
1534
|
return /* @__PURE__ */ jsxs("div", {
|
|
1525
1535
|
ref,
|
|
1526
|
-
className: cx(trigger_module_default.trigger, isOpen && trigger_module_default.isOpen, disabled && trigger_module_default.disabled, small && trigger_module_default.small, groupOrderClass(groupOrder)),
|
|
1536
|
+
className: cx(trigger_module_default.trigger, isOpen && trigger_module_default.isOpen, disabled && trigger_module_default.disabled, small && trigger_module_default.small, isInTable && trigger_module_default.isInTable, groupOrderClass(groupOrder)),
|
|
1527
1537
|
style: { width },
|
|
1528
1538
|
onMouseDown: handleMouseDown,
|
|
1529
1539
|
onClick: handleClick,
|
|
@@ -1531,21 +1541,28 @@ var SearchTrigger = forwardRef(({ label, searchValue, isOpen, disabled, small, w
|
|
|
1531
1541
|
"data-warning": warning || null,
|
|
1532
1542
|
"data-testid": testId,
|
|
1533
1543
|
children: [/* @__PURE__ */ jsxs(SearchField, {
|
|
1534
|
-
"aria-label":
|
|
1544
|
+
"aria-label": ariaLabel,
|
|
1535
1545
|
isDisabled: disabled,
|
|
1536
1546
|
onKeyDown: handleKeyDown,
|
|
1537
1547
|
className: trigger_module_default.triggerInputContainer,
|
|
1538
|
-
children: [
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1548
|
+
children: [
|
|
1549
|
+
showLabel && /* @__PURE__ */ jsx("span", {
|
|
1550
|
+
className: trigger_module_default.selectedSingleValue,
|
|
1551
|
+
"data-testid": testId && `${testId}-value`,
|
|
1552
|
+
children: label
|
|
1553
|
+
}),
|
|
1554
|
+
showPlaceholder && /* @__PURE__ */ jsx("span", {
|
|
1555
|
+
className: trigger_module_default.placeHolder,
|
|
1556
|
+
children: placeholder
|
|
1557
|
+
}),
|
|
1558
|
+
/* @__PURE__ */ jsx(Input$1, {
|
|
1559
|
+
ref: inputRef,
|
|
1560
|
+
className: cx(trigger_module_default.input, menu_module_default.searchInput),
|
|
1561
|
+
size: searchValue.length + 1,
|
|
1562
|
+
tabIndex,
|
|
1563
|
+
"data-testid": testId ? `${testId}-input` : void 0
|
|
1564
|
+
})
|
|
1565
|
+
]
|
|
1549
1566
|
}), /* @__PURE__ */ jsx("span", {
|
|
1550
1567
|
className: trigger_module_default.icons,
|
|
1551
1568
|
children: /* @__PURE__ */ jsx(Pressable$1, {
|
|
@@ -1605,7 +1622,7 @@ var Badge = ({ children, color = "", textColor: textColorProp = "", title = null
|
|
|
1605
1622
|
};
|
|
1606
1623
|
//#endregion
|
|
1607
1624
|
//#region src/components/menu/trigger/button.tsx
|
|
1608
|
-
var Button$1 = React.forwardRef(({ trigger, label, colored, small, width, disabled, groupOrder, loading, error, warning, active, tabIndex, testId, ...domProps }, ref) => {
|
|
1625
|
+
var Button$1 = React.forwardRef(({ trigger, label, colored, basic, small, width, disabled, groupOrder, loading, error, warning, active, tabIndex, testId, ...domProps }, ref) => {
|
|
1609
1626
|
const disabledContext = useContext(DisabledContext);
|
|
1610
1627
|
const isDropdown = trigger === TriggerType.DROP_DOWN_BUTTON;
|
|
1611
1628
|
return /* @__PURE__ */ jsx(Button, {
|
|
@@ -1615,6 +1632,7 @@ var Button$1 = React.forwardRef(({ trigger, label, colored, small, width, disabl
|
|
|
1615
1632
|
children: label
|
|
1616
1633
|
}),
|
|
1617
1634
|
colored,
|
|
1635
|
+
basic,
|
|
1618
1636
|
small,
|
|
1619
1637
|
width,
|
|
1620
1638
|
groupOrder,
|
|
@@ -1697,7 +1715,7 @@ var withBadge = (children, { isNested, badgeTitle, badgeDot }) => !isNested && (
|
|
|
1697
1715
|
* Renders the menu trigger control only (Button / Text / Component).
|
|
1698
1716
|
* OverlayTriggerChild owns the Pressable host — do not wrap a focus shell here.
|
|
1699
1717
|
*/
|
|
1700
|
-
var Trigger$1 = React.forwardRef(({ active, disabled, loading, width, trigger, label, title, colored, small, isNested, component, groupOrder, isOpen, error, warning, testId, selected, tabIndex, ...domProps }, ref) => {
|
|
1718
|
+
var Trigger$1 = React.forwardRef(({ active, disabled, loading, width, trigger, label, title, colored, basic, small, isNested, component, groupOrder, isOpen, error, warning, testId, selected, tabIndex, ...domProps }, ref) => {
|
|
1701
1719
|
const isButtonTrigger = trigger === TriggerType.BUTTON || trigger === TriggerType.DROP_DOWN_BUTTON;
|
|
1702
1720
|
const isComponentTrigger = trigger === TriggerType.COMPONENT;
|
|
1703
1721
|
if (isButtonTrigger) return /* @__PURE__ */ jsx(Button$1, {
|
|
@@ -1705,6 +1723,7 @@ var Trigger$1 = React.forwardRef(({ active, disabled, loading, width, trigger, l
|
|
|
1705
1723
|
trigger,
|
|
1706
1724
|
label: label !== null && label !== void 0 ? label : "",
|
|
1707
1725
|
colored,
|
|
1726
|
+
basic,
|
|
1708
1727
|
small,
|
|
1709
1728
|
width,
|
|
1710
1729
|
disabled,
|
|
@@ -1741,7 +1760,7 @@ var Trigger$1 = React.forwardRef(({ active, disabled, loading, width, trigger, l
|
|
|
1741
1760
|
});
|
|
1742
1761
|
//#endregion
|
|
1743
1762
|
//#region src/components/menu/menu.tsx
|
|
1744
|
-
var Menu = ({ menu, width, disabled = false, badgeTitle, badgeDot = false, loading = false, closeOnOptionClick = true, maxHeight, testId, open: openProp, setOpen: setOpenProp, tooltip, error, warning, tabIndex, active, groupOrder, offset = 0,
|
|
1763
|
+
var Menu = ({ menu, width, disabled = false, badgeTitle, badgeDot = false, loading = false, closeOnOptionClick = true, maxHeight, testId, open: openProp, setOpen: setOpenProp, tooltip, error, warning, tabIndex, active, groupOrder, offset = 0, isInTable = false }) => {
|
|
1745
1764
|
const disabledContext = useContext(DisabledContext);
|
|
1746
1765
|
const triggerRef = useRef(null);
|
|
1747
1766
|
const [internalOpen, setInternalOpen] = useState(false);
|
|
@@ -1749,11 +1768,11 @@ var Menu = ({ menu, width, disabled = false, badgeTitle, badgeDot = false, loadi
|
|
|
1749
1768
|
const scopeId = useId();
|
|
1750
1769
|
const searchTriggerRef = useRef(null);
|
|
1751
1770
|
const searchInputRef = useRef(null);
|
|
1752
|
-
const { label, title, trigger, colored, small, sections, component, placement, showAllButton } = menu;
|
|
1771
|
+
const { label, title, trigger, colored, basic, small, sections, component, placement, showAllButton, placeholder } = menu;
|
|
1753
1772
|
const isControlled = isBoolean(openProp) && isFunction(setOpenProp);
|
|
1754
1773
|
const isOpen = isControlled ? openProp : internalOpen;
|
|
1755
1774
|
const isDisabled = disabled || isMenuEmpty(menu) || disabledContext;
|
|
1756
|
-
const isSearchable =
|
|
1775
|
+
const isSearchable = trigger === MenuTriggerType.SEARCH && !isValidElement(sections);
|
|
1757
1776
|
/** Input trigger, or any popover (root / submenu) belonging to this menu. */
|
|
1758
1777
|
const isInSearchScope = (el) => {
|
|
1759
1778
|
var _searchTriggerRef$cur;
|
|
@@ -1825,6 +1844,7 @@ var Menu = ({ menu, width, disabled = false, badgeTitle, badgeDot = false, loadi
|
|
|
1825
1844
|
label,
|
|
1826
1845
|
title,
|
|
1827
1846
|
colored,
|
|
1847
|
+
basic,
|
|
1828
1848
|
small,
|
|
1829
1849
|
component,
|
|
1830
1850
|
groupOrder,
|
|
@@ -1843,10 +1863,7 @@ var Menu = ({ menu, width, disabled = false, badgeTitle, badgeDot = false, loadi
|
|
|
1843
1863
|
maxHeight,
|
|
1844
1864
|
showAllButton,
|
|
1845
1865
|
testId: layerTestId,
|
|
1846
|
-
search: isSearchable ? {
|
|
1847
|
-
value: searchValue,
|
|
1848
|
-
noResultsText: searchNoResultsText
|
|
1849
|
-
} : void 0,
|
|
1866
|
+
search: isSearchable ? { value: searchValue } : void 0,
|
|
1850
1867
|
scopeId: isSearchable ? scopeId : void 0
|
|
1851
1868
|
});
|
|
1852
1869
|
if (isSearchable) return /* @__PURE__ */ jsx(MenuTrigger, {
|
|
@@ -1863,6 +1880,7 @@ var Menu = ({ menu, width, disabled = false, badgeTitle, badgeDot = false, loadi
|
|
|
1863
1880
|
ref: searchTriggerRef,
|
|
1864
1881
|
inputRef: searchInputRef,
|
|
1865
1882
|
label,
|
|
1883
|
+
placeholder,
|
|
1866
1884
|
searchValue,
|
|
1867
1885
|
isOpen,
|
|
1868
1886
|
disabled: isDisabled,
|
|
@@ -1873,6 +1891,7 @@ var Menu = ({ menu, width, disabled = false, badgeTitle, badgeDot = false, loadi
|
|
|
1873
1891
|
warning,
|
|
1874
1892
|
tabIndex,
|
|
1875
1893
|
testId,
|
|
1894
|
+
isInTable,
|
|
1876
1895
|
onOpen: () => handleOpenChange(true),
|
|
1877
1896
|
onClose: close
|
|
1878
1897
|
}), {
|
|
@@ -3025,28 +3044,53 @@ var InputGroup = ({ children, small = false, width = "100%", isInTable: isInTabl
|
|
|
3025
3044
|
})
|
|
3026
3045
|
});
|
|
3027
3046
|
};
|
|
3047
|
+
//#endregion
|
|
3048
|
+
//#region src/hooks/use-element-width.ts
|
|
3049
|
+
var useElementWidth = (enabled = true) => {
|
|
3050
|
+
const [element, setElement] = useState(null);
|
|
3051
|
+
const [width, setWidth] = useState(null);
|
|
3052
|
+
const ref = useCallback((node) => {
|
|
3053
|
+
setElement(node);
|
|
3054
|
+
}, []);
|
|
3055
|
+
useLayoutEffect(() => {
|
|
3056
|
+
if (!enabled || !element) {
|
|
3057
|
+
setWidth(null);
|
|
3058
|
+
return;
|
|
3059
|
+
}
|
|
3060
|
+
const measure = () => setWidth(element.getBoundingClientRect().width);
|
|
3061
|
+
measure();
|
|
3062
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
3063
|
+
const observer = new ResizeObserver(measure);
|
|
3064
|
+
observer.observe(element);
|
|
3065
|
+
return () => observer.disconnect();
|
|
3066
|
+
}, [enabled, element]);
|
|
3067
|
+
return [ref, width];
|
|
3068
|
+
};
|
|
3028
3069
|
var input_module_default = {
|
|
3029
|
-
inputInTable: "
|
|
3030
|
-
inputHover: "
|
|
3031
|
-
inputFocus: "
|
|
3032
|
-
controlFocusVisible: "
|
|
3033
|
-
inputError: "
|
|
3034
|
-
inputWarning: "
|
|
3035
|
-
inputDisabled: "
|
|
3036
|
-
hideScrollbars: "
|
|
3037
|
-
wrapper: "
|
|
3038
|
-
input: "
|
|
3039
|
-
isInTable: "
|
|
3040
|
-
small: "
|
|
3041
|
-
right: "
|
|
3042
|
-
groupOrderFirst: "
|
|
3043
|
-
groupOrderMiddle: "
|
|
3044
|
-
groupOrderLast: "
|
|
3045
|
-
|
|
3070
|
+
inputInTable: "_inputInTable_1w4lm_1",
|
|
3071
|
+
inputHover: "_inputHover_1w4lm_13",
|
|
3072
|
+
inputFocus: "_inputFocus_1w4lm_18",
|
|
3073
|
+
controlFocusVisible: "_controlFocusVisible_1w4lm_25",
|
|
3074
|
+
inputError: "_inputError_1w4lm_29",
|
|
3075
|
+
inputWarning: "_inputWarning_1w4lm_30",
|
|
3076
|
+
inputDisabled: "_inputDisabled_1w4lm_65",
|
|
3077
|
+
hideScrollbars: "_hideScrollbars_1w4lm_71",
|
|
3078
|
+
wrapper: "_wrapper_1w4lm_81",
|
|
3079
|
+
input: "_input_1w4lm_1",
|
|
3080
|
+
isInTable: "_isInTable_1w4lm_107",
|
|
3081
|
+
small: "_small_1w4lm_131",
|
|
3082
|
+
right: "_right_1w4lm_177",
|
|
3083
|
+
groupOrderFirst: "_groupOrderFirst_1w4lm_180",
|
|
3084
|
+
groupOrderMiddle: "_groupOrderMiddle_1w4lm_181",
|
|
3085
|
+
groupOrderLast: "_groupOrderLast_1w4lm_185",
|
|
3086
|
+
slot: "_slot_1w4lm_190",
|
|
3087
|
+
slotLeft: "_slotLeft_1w4lm_207",
|
|
3088
|
+
slotRight: "_slotRight_1w4lm_212",
|
|
3089
|
+
icon: "_icon_1w4lm_225"
|
|
3046
3090
|
};
|
|
3047
3091
|
//#endregion
|
|
3048
3092
|
//#region src/components/input/input.tsx
|
|
3049
|
-
var Input = forwardRef(({ error = null, tooltip = null, isInTable: isInTableProp, width: propWidth = void 0, small = false, onChange = noop, placeholder = "", value = "", icon, onKeyPress = () => {}, onFocus = () => {}, onBlur = () => {}, onPaste = () => {}, onKeyDown = () => {}, selectOnFocus = true, name = void 0, type = "text", tabIndex = 0, disabled = false, right = false, warning = null, groupOrder = null, maxTooltipWidth = void 0, testId = void 0, size = null }, ref) => {
|
|
3093
|
+
var Input = forwardRef(({ error = null, tooltip = null, isInTable: isInTableProp, width: propWidth = void 0, small = false, onChange = noop, placeholder = "", value = "", icon, leftSlot, rightSlot, onKeyPress = () => {}, onFocus = () => {}, onBlur = () => {}, onPaste = () => {}, onKeyDown = () => {}, selectOnFocus = true, name = void 0, type = "text", tabIndex = 0, disabled = false, right = false, warning = null, groupOrder = null, maxTooltipWidth = void 0, testId = void 0, size = null }, ref) => {
|
|
3050
3094
|
const disabledContext = useContext(DisabledContext);
|
|
3051
3095
|
const isInTable = useIsInTable(isInTableProp);
|
|
3052
3096
|
const order = (() => {
|
|
@@ -3058,48 +3102,67 @@ var Input = forwardRef(({ error = null, tooltip = null, isInTable: isInTableProp
|
|
|
3058
3102
|
return "";
|
|
3059
3103
|
})();
|
|
3060
3104
|
const width = propWidth || (size ? "auto" : "100%");
|
|
3105
|
+
const leftContent = icon ? /* @__PURE__ */ jsx("span", {
|
|
3106
|
+
className: input_module_default.icon,
|
|
3107
|
+
children: /* @__PURE__ */ jsx(Icon, { icon })
|
|
3108
|
+
}) : leftSlot;
|
|
3109
|
+
const [leftSlotRef, leftSlotWidth] = useElementWidth(!!leftContent);
|
|
3110
|
+
const [rightSlotRef, rightSlotWidth] = useElementWidth(!!rightSlot);
|
|
3061
3111
|
const handleFocus = (e) => {
|
|
3062
3112
|
onFocus(e);
|
|
3063
3113
|
if (selectOnFocus) setTimeout(() => {
|
|
3064
3114
|
if (e.target === document.activeElement) e.target.select();
|
|
3065
3115
|
}, 0);
|
|
3066
3116
|
};
|
|
3067
|
-
return /* @__PURE__ */
|
|
3117
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
3068
3118
|
style: { width },
|
|
3069
3119
|
className: cx(order, input_module_default.wrapper),
|
|
3070
|
-
children:
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
|
|
3083
|
-
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3120
|
+
children: [
|
|
3121
|
+
leftContent && /* @__PURE__ */ jsx("div", {
|
|
3122
|
+
ref: leftSlotRef,
|
|
3123
|
+
className: cx(input_module_default.slot, input_module_default.slotLeft),
|
|
3124
|
+
children: leftContent
|
|
3125
|
+
}),
|
|
3126
|
+
/* @__PURE__ */ jsx(Tooltip, {
|
|
3127
|
+
error: !!error,
|
|
3128
|
+
warning: !!warning,
|
|
3129
|
+
text: tooltip || error || warning,
|
|
3130
|
+
enabled: tooltip && isStringNumberOrNode(tooltip) || error && isStringNumberOrNode(error) || warning && isStringNumberOrNode(warning) || false,
|
|
3131
|
+
maxWidth: maxTooltipWidth,
|
|
3132
|
+
display: "block",
|
|
3133
|
+
children: /* @__PURE__ */ jsx("input", {
|
|
3134
|
+
ref,
|
|
3135
|
+
type: type || "text",
|
|
3136
|
+
size: size || 20,
|
|
3137
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : "",
|
|
3138
|
+
value: value !== null && value !== void 0 ? value : "",
|
|
3139
|
+
onChange,
|
|
3140
|
+
onKeyPress,
|
|
3141
|
+
onKeyDown,
|
|
3142
|
+
onFocus: handleFocus,
|
|
3143
|
+
onBlur,
|
|
3144
|
+
onPaste,
|
|
3145
|
+
name,
|
|
3146
|
+
tabIndex,
|
|
3147
|
+
autoComplete: "off",
|
|
3148
|
+
disabled: disabled || disabledContext,
|
|
3149
|
+
className: cx(input_module_default.input, right ? input_module_default.right : "", small ? input_module_default.small : "", isInTable ? input_module_default.isInTable : ""),
|
|
3150
|
+
style: {
|
|
3151
|
+
width,
|
|
3152
|
+
...leftSlotWidth ? { paddingLeft: leftSlotWidth } : null,
|
|
3153
|
+
...rightSlotWidth ? { paddingRight: rightSlotWidth } : null
|
|
3154
|
+
},
|
|
3155
|
+
"data-error": error || null,
|
|
3156
|
+
"data-warning": warning || null,
|
|
3157
|
+
"data-testid": testId
|
|
3158
|
+
})
|
|
3159
|
+
}),
|
|
3160
|
+
rightSlot && /* @__PURE__ */ jsx("div", {
|
|
3161
|
+
ref: rightSlotRef,
|
|
3162
|
+
className: cx(input_module_default.slot, input_module_default.slotRight),
|
|
3163
|
+
children: rightSlot
|
|
3164
|
+
})
|
|
3165
|
+
]
|
|
3103
3166
|
});
|
|
3104
3167
|
});
|
|
3105
3168
|
var file_input_module_default = { fileInput: "_fileInput_1elar_1" };
|
|
@@ -4797,16 +4860,17 @@ var validateSelectedPage = (selectedPage, numPages, errorMessageTemplate = "Sele
|
|
|
4797
4860
|
};
|
|
4798
4861
|
var pagination_module_default = { paginationContainer: "_paginationContainer_1tmz4_1" };
|
|
4799
4862
|
var input_group_addon_module_default = {
|
|
4800
|
-
addon: "
|
|
4801
|
-
small: "
|
|
4802
|
-
groupOrderFirst: "
|
|
4803
|
-
groupOrderMiddle: "
|
|
4804
|
-
groupOrderLast: "
|
|
4805
|
-
isInTable: "
|
|
4863
|
+
addon: "_addon_4fbro_1",
|
|
4864
|
+
small: "_small_4fbro_12",
|
|
4865
|
+
groupOrderFirst: "_groupOrderFirst_4fbro_16",
|
|
4866
|
+
groupOrderMiddle: "_groupOrderMiddle_4fbro_17",
|
|
4867
|
+
groupOrderLast: "_groupOrderLast_4fbro_21",
|
|
4868
|
+
isInTable: "_isInTable_4fbro_26",
|
|
4869
|
+
borderless: "_borderless_4fbro_38"
|
|
4806
4870
|
};
|
|
4807
4871
|
//#endregion
|
|
4808
4872
|
//#region src/components/input-group/input-group-addon/input-group-addon.tsx
|
|
4809
|
-
var InputGroupAddon = ({ children, groupOrder, small = false }) => {
|
|
4873
|
+
var InputGroupAddon = ({ children, groupOrder, small = false, borderless = false }) => {
|
|
4810
4874
|
const isInTable = useIsInTable();
|
|
4811
4875
|
const order = (() => {
|
|
4812
4876
|
if (groupOrder) switch (groupOrder) {
|
|
@@ -4817,7 +4881,7 @@ var InputGroupAddon = ({ children, groupOrder, small = false }) => {
|
|
|
4817
4881
|
return "";
|
|
4818
4882
|
})();
|
|
4819
4883
|
return /* @__PURE__ */ jsx("span", {
|
|
4820
|
-
className: cx(input_group_addon_module_default.addon, order, small ? input_group_addon_module_default.small : "", isInTable && input_group_addon_module_default.isInTable),
|
|
4884
|
+
className: cx(input_group_addon_module_default.addon, order, small ? input_group_addon_module_default.small : "", isInTable && input_group_addon_module_default.isInTable, borderless && input_group_addon_module_default.borderless),
|
|
4821
4885
|
children
|
|
4822
4886
|
});
|
|
4823
4887
|
};
|
|
@@ -5006,37 +5070,37 @@ var getHeaderAlignment = (alignments, isHeader = false, rowIndex = 0) => {
|
|
|
5006
5070
|
}
|
|
5007
5071
|
};
|
|
5008
5072
|
var cell_module_default = {
|
|
5009
|
-
inputInTable: "
|
|
5010
|
-
inputHover: "
|
|
5011
|
-
inputFocus: "
|
|
5012
|
-
controlFocusVisible: "
|
|
5013
|
-
inputError: "
|
|
5014
|
-
inputWarning: "
|
|
5015
|
-
inputDisabled: "
|
|
5016
|
-
hideScrollbars: "
|
|
5017
|
-
cell: "
|
|
5018
|
-
disabledLink: "
|
|
5019
|
-
inputWrapper: "
|
|
5020
|
-
numberInputWrapper: "
|
|
5021
|
-
unitInputWrapper: "
|
|
5022
|
-
breakWord: "
|
|
5023
|
-
inputCell: "
|
|
5024
|
-
sliderCell: "
|
|
5025
|
-
staticCell: "
|
|
5026
|
-
staticCellContent: "
|
|
5027
|
-
unit: "
|
|
5028
|
-
sortingCell: "
|
|
5029
|
-
sortingCellIcon: "
|
|
5030
|
-
icon: "
|
|
5031
|
-
checkBoxCell: "
|
|
5032
|
-
iconCellWrapper: "
|
|
5033
|
-
actionsCell: "
|
|
5034
|
-
rightAligned: "
|
|
5035
|
-
centerAligned: "
|
|
5036
|
-
leftAligned: "
|
|
5037
|
-
popover: "
|
|
5038
|
-
disabledPointerEvents: "
|
|
5039
|
-
standaloneCheckbox: "
|
|
5073
|
+
inputInTable: "_inputInTable_1vfnu_1",
|
|
5074
|
+
inputHover: "_inputHover_1vfnu_13",
|
|
5075
|
+
inputFocus: "_inputFocus_1vfnu_18",
|
|
5076
|
+
controlFocusVisible: "_controlFocusVisible_1vfnu_25",
|
|
5077
|
+
inputError: "_inputError_1vfnu_29",
|
|
5078
|
+
inputWarning: "_inputWarning_1vfnu_30",
|
|
5079
|
+
inputDisabled: "_inputDisabled_1vfnu_65",
|
|
5080
|
+
hideScrollbars: "_hideScrollbars_1vfnu_71",
|
|
5081
|
+
cell: "_cell_1vfnu_81",
|
|
5082
|
+
disabledLink: "_disabledLink_1vfnu_91",
|
|
5083
|
+
inputWrapper: "_inputWrapper_1vfnu_95",
|
|
5084
|
+
numberInputWrapper: "_numberInputWrapper_1vfnu_110",
|
|
5085
|
+
unitInputWrapper: "_unitInputWrapper_1vfnu_117",
|
|
5086
|
+
breakWord: "_breakWord_1vfnu_123",
|
|
5087
|
+
inputCell: "_inputCell_1vfnu_126",
|
|
5088
|
+
sliderCell: "_sliderCell_1vfnu_129",
|
|
5089
|
+
staticCell: "_staticCell_1vfnu_133",
|
|
5090
|
+
staticCellContent: "_staticCellContent_1vfnu_136",
|
|
5091
|
+
unit: "_unit_1vfnu_117",
|
|
5092
|
+
sortingCell: "_sortingCell_1vfnu_160",
|
|
5093
|
+
sortingCellIcon: "_sortingCellIcon_1vfnu_171",
|
|
5094
|
+
icon: "_icon_1vfnu_182",
|
|
5095
|
+
checkBoxCell: "_checkBoxCell_1vfnu_186",
|
|
5096
|
+
iconCellWrapper: "_iconCellWrapper_1vfnu_190",
|
|
5097
|
+
actionsCell: "_actionsCell_1vfnu_194",
|
|
5098
|
+
rightAligned: "_rightAligned_1vfnu_202",
|
|
5099
|
+
centerAligned: "_centerAligned_1vfnu_208",
|
|
5100
|
+
leftAligned: "_leftAligned_1vfnu_214",
|
|
5101
|
+
popover: "_popover_1vfnu_217",
|
|
5102
|
+
disabledPointerEvents: "_disabledPointerEvents_1vfnu_220",
|
|
5103
|
+
standaloneCheckbox: "_standaloneCheckbox_1vfnu_223"
|
|
5040
5104
|
};
|
|
5041
5105
|
//#endregion
|
|
5042
5106
|
//#region src/components/table/cell/cell-types/input-cell.tsx
|
|
@@ -5082,7 +5146,7 @@ var startsWithDecimal = (value) => value.startsWith(".");
|
|
|
5082
5146
|
* undoing deletion of the leading zero when editing values like 0.1 → 1.1.
|
|
5083
5147
|
*/
|
|
5084
5148
|
var preserveLeadingDecimalDraft = (rawInput, cleaned) => startsWithDecimal(rawInput) && cleaned === `0${rawInput}` ? rawInput : cleaned;
|
|
5085
|
-
var NumberInput = ({ name, placeholder = "", disabled = false, error = false, left = false, small = false, width = "100%", value = "", onChange = () => {}, onFocus = () => {}, onBlur = () => {}, selectOnFocus = true, tabIndex = 0, testId, tooltip = null, warning = false, validationCallback = () => {}, allowEmpty = false, isInTable, groupOrder, enableCosmeticRounding = true, enableDisplayRounding = false, roundDisplayValue, disableInternalErrorValidationMessages = false, disableValidationOnFocus = false }) => {
|
|
5149
|
+
var NumberInput = ({ name, placeholder = "", disabled = false, error = false, left = false, small = false, width = "100%", value = "", onChange = () => {}, onFocus = () => {}, onBlur = () => {}, selectOnFocus = true, tabIndex = 0, testId, tooltip = null, warning = false, validationCallback = () => {}, allowEmpty = false, isInTable, groupOrder, enableCosmeticRounding = true, enableDisplayRounding = false, roundDisplayValue, disableInternalErrorValidationMessages = false, disableValidationOnFocus = false, leftSlot, rightSlot }) => {
|
|
5086
5150
|
const validateInputValue = (value) => {
|
|
5087
5151
|
const validation = validateNumber(value);
|
|
5088
5152
|
const isPlaceholder = placeholder && isEmptyNullOrUndefined(value);
|
|
@@ -5194,7 +5258,9 @@ var NumberInput = ({ name, placeholder = "", disabled = false, error = false, le
|
|
|
5194
5258
|
selectOnFocus,
|
|
5195
5259
|
tabIndex,
|
|
5196
5260
|
tooltip,
|
|
5197
|
-
ref: inputRef
|
|
5261
|
+
ref: inputRef,
|
|
5262
|
+
leftSlot,
|
|
5263
|
+
rightSlot
|
|
5198
5264
|
}, stringName);
|
|
5199
5265
|
};
|
|
5200
5266
|
//#endregion
|
|
@@ -5413,9 +5479,11 @@ var safeRoundNumbers = (value) => {
|
|
|
5413
5479
|
return !isScientificStringNum(value) ? roundByMagnitude(value) : value;
|
|
5414
5480
|
};
|
|
5415
5481
|
var unit_input_module_default = {
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
|
|
5482
|
+
unitInput: "_unitInput_1ogvr_1",
|
|
5483
|
+
unitTriggerLabel: "_unitTriggerLabel_1ogvr_5",
|
|
5484
|
+
unitValue: "_unitValue_1ogvr_8",
|
|
5485
|
+
predefinedMenuActive: "_predefinedMenuActive_1ogvr_13",
|
|
5486
|
+
isInTable: "_isInTable_1ogvr_16"
|
|
5419
5487
|
};
|
|
5420
5488
|
//#endregion
|
|
5421
5489
|
//#region src/components/unit-input/unit-input.tsx
|
|
@@ -5598,10 +5666,7 @@ var UnitInput = ({ name, placeholder = "", disabled = false, disabledUnit = fals
|
|
|
5598
5666
|
} });
|
|
5599
5667
|
}
|
|
5600
5668
|
},
|
|
5601
|
-
label:
|
|
5602
|
-
width: "20px",
|
|
5603
|
-
height: "0"
|
|
5604
|
-
})] }),
|
|
5669
|
+
label: el.label,
|
|
5605
5670
|
description,
|
|
5606
5671
|
selected: foundPredefinedMenuOption === el && predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED
|
|
5607
5672
|
};
|
|
@@ -5636,100 +5701,92 @@ var UnitInput = ({ name, placeholder = "", disabled = false, disabledUnit = fals
|
|
|
5636
5701
|
}
|
|
5637
5702
|
return placeholder;
|
|
5638
5703
|
};
|
|
5639
|
-
const hasPredefinedOptions = Boolean(predefinedOptions);
|
|
5640
|
-
const hasUnitControl = Boolean(displayUnitLabel);
|
|
5641
|
-
const inputGroupOrder = (() => {
|
|
5642
|
-
if (hasPredefinedOptions && hasUnitControl) return GroupOrder.MIDDLE;
|
|
5643
|
-
if (hasPredefinedOptions) return !groupOrder || groupOrder === GroupOrder.LAST ? GroupOrder.LAST : GroupOrder.MIDDLE;
|
|
5644
|
-
if (hasUnitControl) return !groupOrder || groupOrder === GroupOrder.FIRST ? GroupOrder.FIRST : GroupOrder.MIDDLE;
|
|
5645
|
-
return groupOrder !== null && groupOrder !== void 0 ? groupOrder : GroupOrder.FIRST;
|
|
5646
|
-
})();
|
|
5647
|
-
const unitGroupOrder = !groupOrder || groupOrder === GroupOrder.LAST ? GroupOrder.LAST : GroupOrder.MIDDLE;
|
|
5648
5704
|
return /* @__PURE__ */ jsx("div", {
|
|
5649
|
-
className: cx(predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED && unit_input_module_default.predefinedMenuActive, isInTable && unit_input_module_default.isInTable),
|
|
5650
|
-
|
|
5705
|
+
className: cx(unit_input_module_default.unitInput, predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED && unit_input_module_default.predefinedMenuActive, isInTable && unit_input_module_default.isInTable),
|
|
5706
|
+
style: { width },
|
|
5707
|
+
children: /* @__PURE__ */ jsx(NumberInput, {
|
|
5708
|
+
name: stringName,
|
|
5709
|
+
testId,
|
|
5710
|
+
disabled,
|
|
5711
|
+
placeholder: getPlaceholder(placeholder),
|
|
5712
|
+
value: displayLayer.value,
|
|
5713
|
+
onChange: onSetValue,
|
|
5714
|
+
onFocus,
|
|
5715
|
+
error: error === null ? void 0 : error,
|
|
5716
|
+
warning: warning === null ? void 0 : warning,
|
|
5717
|
+
left,
|
|
5718
|
+
allowEmpty: derivedAllowEmpty,
|
|
5719
|
+
validationCallback: (_name, error) => validationCallback(stringName, error),
|
|
5720
|
+
enableCosmeticRounding,
|
|
5721
|
+
enableDisplayRounding,
|
|
5722
|
+
roundDisplayValue,
|
|
5723
|
+
groupOrder,
|
|
5724
|
+
disableInternalErrorValidationMessages,
|
|
5651
5725
|
small,
|
|
5652
|
-
width,
|
|
5726
|
+
width: "100%",
|
|
5653
5727
|
isInTable,
|
|
5654
|
-
|
|
5655
|
-
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
|
|
5666
|
-
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
small,
|
|
5670
|
-
sections: sectionsPredefinedMenu
|
|
5671
|
-
},
|
|
5672
|
-
tooltip: predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED ? foundPredefinedMenuOption === null || foundPredefinedMenuOption === void 0 ? void 0 : foundPredefinedMenuOption.label : ""
|
|
5673
|
-
}),
|
|
5674
|
-
/* @__PURE__ */ jsx("div", {
|
|
5675
|
-
className: unit_input_module_default.inputWrapper,
|
|
5676
|
-
children: /* @__PURE__ */ jsx(NumberInput, {
|
|
5677
|
-
name: stringName,
|
|
5678
|
-
testId,
|
|
5679
|
-
disabled,
|
|
5680
|
-
placeholder: getPlaceholder(placeholder),
|
|
5681
|
-
value: displayLayer.value,
|
|
5682
|
-
onChange: onSetValue,
|
|
5683
|
-
onFocus,
|
|
5684
|
-
error: error === null ? void 0 : error,
|
|
5685
|
-
warning: warning === null ? void 0 : warning,
|
|
5686
|
-
left,
|
|
5687
|
-
allowEmpty: derivedAllowEmpty,
|
|
5688
|
-
validationCallback: (_name, error) => validationCallback(stringName, error),
|
|
5689
|
-
enableCosmeticRounding,
|
|
5690
|
-
enableDisplayRounding,
|
|
5691
|
-
roundDisplayValue,
|
|
5692
|
-
groupOrder: inputGroupOrder,
|
|
5693
|
-
disableInternalErrorValidationMessages,
|
|
5694
|
-
small,
|
|
5695
|
-
selectOnFocus,
|
|
5696
|
-
tooltip
|
|
5697
|
-
}, stringName)
|
|
5698
|
-
}),
|
|
5699
|
-
displayUnitLabel && (noConvert || !knownUnit ? /* @__PURE__ */ jsx(InputGroupAddon, {
|
|
5700
|
-
groupOrder: unitGroupOrder,
|
|
5728
|
+
selectOnFocus,
|
|
5729
|
+
tooltip,
|
|
5730
|
+
leftSlot: predefinedOptions && /* @__PURE__ */ jsx(Menu, {
|
|
5731
|
+
maxHeight: 380,
|
|
5732
|
+
testId: testId && `${testId}-predefined-menu`,
|
|
5733
|
+
disabled,
|
|
5734
|
+
menu: {
|
|
5735
|
+
trigger: "Component",
|
|
5736
|
+
component: /* @__PURE__ */ jsx(Button, {
|
|
5737
|
+
basic: true,
|
|
5738
|
+
colored: Color.MUTED,
|
|
5739
|
+
active: predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED,
|
|
5740
|
+
icon: predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED ? "link" : "unlink",
|
|
5741
|
+
small
|
|
5742
|
+
}),
|
|
5701
5743
|
small,
|
|
5702
|
-
|
|
5703
|
-
}
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
|
|
5707
|
-
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5744
|
+
sections: sectionsPredefinedMenu
|
|
5745
|
+
},
|
|
5746
|
+
tooltip: predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED ? foundPredefinedMenuOption === null || foundPredefinedMenuOption === void 0 ? void 0 : foundPredefinedMenuOption.label : ""
|
|
5747
|
+
}),
|
|
5748
|
+
rightSlot: displayUnitLabel && (noConvert || !knownUnit ? /* @__PURE__ */ jsx(InputGroupAddon, {
|
|
5749
|
+
borderless: true,
|
|
5750
|
+
small,
|
|
5751
|
+
children: displayUnitLabel
|
|
5752
|
+
}) : /* @__PURE__ */ jsx(Menu, {
|
|
5753
|
+
maxHeight: 380,
|
|
5754
|
+
disabled: disabledUnit,
|
|
5755
|
+
testId: testId && `${testId}-menu`,
|
|
5756
|
+
tabIndex: -1,
|
|
5757
|
+
menu: {
|
|
5758
|
+
trigger: TriggerType.DROP_DOWN_BUTTON,
|
|
5759
|
+
label: /* @__PURE__ */ jsx("span", {
|
|
5760
|
+
className: unit_input_module_default.unitTriggerLabel,
|
|
5761
|
+
children: displayUnitLabel
|
|
5762
|
+
}),
|
|
5763
|
+
colored: Color.MUTED,
|
|
5764
|
+
basic: true,
|
|
5765
|
+
placement: "bottom-end",
|
|
5766
|
+
small,
|
|
5767
|
+
sections: alternativeUnits.map(([value = "", altUnit = "", label]) => {
|
|
5768
|
+
const displayUnit = label || altUnit || "";
|
|
5769
|
+
const safeValue = isValidNum(value) ? value : "";
|
|
5770
|
+
const displayValue = enableCosmeticRounding ? safeRoundNumbers(safeValue) : safeValue;
|
|
5771
|
+
return {
|
|
5772
|
+
type: "Option",
|
|
5773
|
+
label: /* @__PURE__ */ jsx("span", {
|
|
5774
|
+
className: unit_input_module_default.unitValue,
|
|
5775
|
+
children: displayValue
|
|
5776
|
+
}),
|
|
5777
|
+
inline: true,
|
|
5778
|
+
onClick: (evt) => {
|
|
5779
|
+
evt.stopPropagation();
|
|
5780
|
+
onClickUnit(value, altUnit);
|
|
5781
|
+
},
|
|
5782
|
+
description: displayUnit,
|
|
5783
|
+
selected: displayUnit === displayUnitLabel,
|
|
5784
|
+
testId: `${testId}-unit-${displayUnit}`
|
|
5785
|
+
};
|
|
5786
|
+
})
|
|
5787
|
+
}
|
|
5788
|
+
}))
|
|
5789
|
+
}, stringName)
|
|
5733
5790
|
});
|
|
5734
5791
|
};
|
|
5735
5792
|
//#endregion
|
|
@@ -14835,4 +14892,4 @@ var initializeGuiLibrary = (config) => {
|
|
|
14835
14892
|
});
|
|
14836
14893
|
};
|
|
14837
14894
|
//#endregion
|
|
14838
|
-
export { Accordion, AccordionWithDefaultToggle, Actions, Align, AuditLog, Badge, Breadcrumb, BreadcrumbLinkType, Button, ButtonGroup, ButtonPosition, ButtonType, Card, CheckBox, Chevron, Collapse, Color, ColorInput, ColorInputPopover, Column, Dialog, DiffCode, DiffTable, DiffViewer, DisabledContext, Divider, Drawer, ElementType, Empty, ErrorBoundary, Field, FileButton, FileInput, Flex, FormRow, Grid, GroupOrder, Heading, HelpIcon, Icon, IconType, Input, InputGroup, InputGroupAddon, InputReaderMethods, InputType, Label, List, ListHeading, ListSubheading, Loader, Mention, Menu, MenuCarat, MenuType, Message, MessageType, Modal, NativeSelect, NumberInput, OptionDropdown, Page, Pagination, PopConfirm, Popover, Portal, PrintHeader, ProgressBar, RadioButton, Resizable, RichTextInput, Row, Select, SettingField, SideBar, Skeleton, Slider, SmartUploadModal, Spacer, Spinner, Table, TableImportExport, Tabs, Text, TextArea, TextLink, TextTransform, Theme, Toaster, Toggle, Tooltip, TopBar, Tree, TreeTable, TriggerType, UnitInput, UnitSlider, UnitTable, UsageTracker, dismissToast, initializeContext, initializeGuiLibrary, readFile, toast, useFocus, useKeyboardEvent, useWindowWidth, withChainableErrorBoundary, withErrorBoundary };
|
|
14895
|
+
export { Accordion, AccordionWithDefaultToggle, Actions, Align, AuditLog, Badge, Breadcrumb, BreadcrumbLinkType, Button, ButtonGroup, ButtonPosition, ButtonType, Card, CheckBox, Chevron, Collapse, Color, ColorInput, ColorInputPopover, Column, Dialog, DiffCode, DiffTable, DiffViewer, DisabledContext, Divider, Drawer, ElementType, Empty, ErrorBoundary, Field, FileButton, FileInput, Flex, FormRow, Grid, GroupOrder, Heading, HelpIcon, Icon, IconType, Input, InputGroup, InputGroupAddon, InputReaderMethods, InputType, Label, List, ListHeading, ListSubheading, Loader, Mention, Menu, MenuCarat, MenuTriggerType, MenuType, Message, MessageType, Modal, NativeSelect, NumberInput, OptionDropdown, Page, Pagination, PopConfirm, Popover, Portal, PrintHeader, ProgressBar, RadioButton, Resizable, RichTextInput, Row, Select, SettingField, SideBar, Skeleton, Slider, SmartUploadModal, Spacer, Spinner, Table, TableImportExport, Tabs, Text, TextArea, TextLink, TextTransform, Theme, Toaster, Toggle, Tooltip, TopBar, Tree, TreeTable, TriggerType, UnitInput, UnitSlider, UnitTable, UsageTracker, dismissToast, initializeContext, initializeGuiLibrary, readFile, toast, useFocus, useKeyboardEvent, useWindowWidth, withChainableErrorBoundary, withErrorBoundary };
|