@oliasoft-open-source/react-ui-library 10.7.0-beta-10 → 10.8.0-beta-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/global.css +1734 -1765
- package/dist/index.d.ts +10 -9
- package/dist/index.js +540 -327
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,9 @@ import { CSSTransition } from "react-transition-group";
|
|
|
6
6
|
import { CheckboxButton, CheckboxField } from "react-aria-components/Checkbox";
|
|
7
7
|
import { ColorArea, ColorPicker, ColorSlider, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, ColorThumb, DialogTrigger, Focusable, OverlayArrow, Popover as Popover$1, Pressable, RouterProvider, SliderTrack, Tooltip as Tooltip$1, TooltipTrigger, TooltipTriggerStateContext, useLocale } from "react-aria-components";
|
|
8
8
|
import { clamp, cloneDeep, cloneDeepWith, debounce, every, get, isArray, isBoolean, isEmpty, isEqual, isFinite, isFunction, isNil, isNumber, isObject, isPlainObject, isString, keys, noop, sortBy, toLower, toNumber, upperFirst, values } from "es-toolkit/compat";
|
|
9
|
-
import { Header, Menu as Menu$1, MenuItem, MenuTrigger, Separator, SubmenuTrigger } from "react-aria-components/Menu";
|
|
9
|
+
import { Header, Menu as Menu$1, MenuItem, MenuTrigger, Pressable as Pressable$1, Separator, SubmenuTrigger } from "react-aria-components/Menu";
|
|
10
|
+
import { Autocomplete } from "react-aria-components/Autocomplete";
|
|
11
|
+
import { Input as Input$1, SearchField } from "react-aria-components/SearchField";
|
|
10
12
|
import { Breadcrumb as Breadcrumb$1, Breadcrumbs, Link } from "react-aria-components/Breadcrumbs";
|
|
11
13
|
import { colord, extend } from "colord";
|
|
12
14
|
import lchPlugin from "colord/plugins/lch";
|
|
@@ -18,7 +20,7 @@ import { ALT_UNITS, KNOWN_UNITS, altUnitsList, cleanNumStr, convertAndGetValue,
|
|
|
18
20
|
import { ListBox, ListBoxItem } from "react-aria-components/ListBox";
|
|
19
21
|
import { ListLayout, Virtualizer } from "react-aria-components/Virtualizer";
|
|
20
22
|
import { SortableContext, useSortable, verticalListSortingStrategy } from "@dnd-kit/sortable";
|
|
21
|
-
import { CSS } from "@dnd-kit/utilities";
|
|
23
|
+
import { CSS as CSS$1 } from "@dnd-kit/utilities";
|
|
22
24
|
import * as RadixSlider from "@radix-ui/react-slider";
|
|
23
25
|
import memoizeOne from "memoize-one";
|
|
24
26
|
import isEqual$1 from "react-fast-compare";
|
|
@@ -1056,32 +1058,35 @@ var isMenuEmpty = (menu) => {
|
|
|
1056
1058
|
return !isValidElement(sections) && (!Array.isArray(sections) || sections.every((section) => isEmpty(section)));
|
|
1057
1059
|
};
|
|
1058
1060
|
var menu_module_default = {
|
|
1059
|
-
layer: "
|
|
1060
|
-
nested: "
|
|
1061
|
-
fileInput: "
|
|
1062
|
-
trigger: "
|
|
1063
|
-
heading: "
|
|
1064
|
-
headingIcon: "
|
|
1065
|
-
clickable: "
|
|
1066
|
-
option: "
|
|
1067
|
-
active: "
|
|
1068
|
-
disabled: "
|
|
1069
|
-
selected: "
|
|
1070
|
-
optionContent: "
|
|
1071
|
-
description: "
|
|
1072
|
-
inline: "
|
|
1073
|
-
icon: "
|
|
1074
|
-
check: "
|
|
1075
|
-
label: "
|
|
1076
|
-
arrow: "
|
|
1077
|
-
divider: "
|
|
1078
|
-
buttonLabel: "
|
|
1079
|
-
component: "
|
|
1080
|
-
right: "
|
|
1081
|
-
actions: "
|
|
1082
|
-
menuPopover: "
|
|
1083
|
-
menuPopoverNested: "
|
|
1084
|
-
menuItem: "
|
|
1061
|
+
layer: "_layer_lg82f_1",
|
|
1062
|
+
nested: "_nested_lg82f_14",
|
|
1063
|
+
fileInput: "_fileInput_lg82f_17",
|
|
1064
|
+
trigger: "_trigger_lg82f_23",
|
|
1065
|
+
heading: "_heading_lg82f_32",
|
|
1066
|
+
headingIcon: "_headingIcon_lg82f_38",
|
|
1067
|
+
clickable: "_clickable_lg82f_45",
|
|
1068
|
+
option: "_option_lg82f_49",
|
|
1069
|
+
active: "_active_lg82f_68",
|
|
1070
|
+
disabled: "_disabled_lg82f_73",
|
|
1071
|
+
selected: "_selected_lg82f_76",
|
|
1072
|
+
optionContent: "_optionContent_lg82f_83",
|
|
1073
|
+
description: "_description_lg82f_87",
|
|
1074
|
+
inline: "_inline_lg82f_91",
|
|
1075
|
+
icon: "_icon_lg82f_96",
|
|
1076
|
+
check: "_check_lg82f_97",
|
|
1077
|
+
label: "_label_lg82f_123",
|
|
1078
|
+
arrow: "_arrow_lg82f_139",
|
|
1079
|
+
divider: "_divider_lg82f_143",
|
|
1080
|
+
buttonLabel: "_buttonLabel_lg82f_151",
|
|
1081
|
+
component: "_component_lg82f_158",
|
|
1082
|
+
right: "_right_lg82f_164",
|
|
1083
|
+
actions: "_actions_lg82f_169",
|
|
1084
|
+
menuPopover: "_menuPopover_lg82f_176",
|
|
1085
|
+
menuPopoverNested: "_menuPopoverNested_lg82f_198",
|
|
1086
|
+
menuItem: "_menuItem_lg82f_201",
|
|
1087
|
+
overlayScope: "_overlayScope_lg82f_216",
|
|
1088
|
+
noResults: "_noResults_lg82f_219",
|
|
1089
|
+
searchInput: "_searchInput_lg82f_223"
|
|
1085
1090
|
};
|
|
1086
1091
|
//#endregion
|
|
1087
1092
|
//#region src/components/menu/layer/heading.tsx
|
|
@@ -1178,9 +1183,9 @@ var Option$2 = ({ actions, label, url, onClick, description, icon, selected, clo
|
|
|
1178
1183
|
}),
|
|
1179
1184
|
/* @__PURE__ */ jsxs("div", {
|
|
1180
1185
|
className: menu_module_default.right,
|
|
1181
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
1186
|
+
children: [selected && /* @__PURE__ */ jsx("span", {
|
|
1182
1187
|
className: menu_module_default.check,
|
|
1183
|
-
children:
|
|
1188
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: IconType.CHECK })
|
|
1184
1189
|
}), !!(actions === null || actions === void 0 ? void 0 : actions.length) && /* @__PURE__ */ jsx("div", {
|
|
1185
1190
|
className: menu_module_default.actions,
|
|
1186
1191
|
onClick: (evt) => evt.stopPropagation(),
|
|
@@ -1247,6 +1252,74 @@ var Section$1 = ({ section, closeOnOptionClick, close }) => {
|
|
|
1247
1252
|
}
|
|
1248
1253
|
};
|
|
1249
1254
|
//#endregion
|
|
1255
|
+
//#region src/helpers/search.ts
|
|
1256
|
+
/**
|
|
1257
|
+
* Shared text-search matching for searchable components (Select, Menu).
|
|
1258
|
+
* Case-insensitive substring match — keep behaviour identical across components.
|
|
1259
|
+
*/
|
|
1260
|
+
var normalizeSearch = (value) => String(value !== null && value !== void 0 ? value : "").toLowerCase();
|
|
1261
|
+
var matchesSearch = (query, ...texts) => {
|
|
1262
|
+
const normalizedQuery = normalizeSearch(query);
|
|
1263
|
+
if (!normalizedQuery) return true;
|
|
1264
|
+
return texts.some((text) => text != null && normalizeSearch(text).includes(normalizedQuery));
|
|
1265
|
+
};
|
|
1266
|
+
//#endregion
|
|
1267
|
+
//#region src/components/menu/filter-menu-sections.ts
|
|
1268
|
+
var getSearchText = (label) => typeof label === "string" || typeof label === "number" ? String(label) : "";
|
|
1269
|
+
var isItem = (section) => section.type === MenuType.OPTION || section.type === MenuType.MENU;
|
|
1270
|
+
var isBoundary = (section) => section.type === MenuType.HEADING || section.type === MenuType.DIVIDER;
|
|
1271
|
+
/** Drop headings with no items under them, and leading / trailing / doubled dividers. */
|
|
1272
|
+
var tidy = (sections) => {
|
|
1273
|
+
var _result;
|
|
1274
|
+
const withoutEmptyHeadings = sections.filter((section, i) => {
|
|
1275
|
+
if (section.type !== MenuType.HEADING) return true;
|
|
1276
|
+
const next = sections.slice(i + 1).find((s) => isItem(s) || isBoundary(s));
|
|
1277
|
+
return !!next && isItem(next);
|
|
1278
|
+
});
|
|
1279
|
+
const result = [];
|
|
1280
|
+
withoutEmptyHeadings.forEach((section) => {
|
|
1281
|
+
const previous = result[result.length - 1];
|
|
1282
|
+
if (section.type === MenuType.DIVIDER && (!previous || previous.type === MenuType.DIVIDER)) return;
|
|
1283
|
+
result.push(section);
|
|
1284
|
+
});
|
|
1285
|
+
if (((_result = result[result.length - 1]) === null || _result === void 0 ? void 0 : _result.type) === MenuType.DIVIDER) result.pop();
|
|
1286
|
+
return result;
|
|
1287
|
+
};
|
|
1288
|
+
/**
|
|
1289
|
+
* Filters menu sections by a search query while preserving structure:
|
|
1290
|
+
* - options are kept when their label or description matches
|
|
1291
|
+
* - submenus are kept when their own label matches (with all children), or when any
|
|
1292
|
+
* descendant matches (with children filtered recursively)
|
|
1293
|
+
* - headings / dividers are kept only where they still separate visible items
|
|
1294
|
+
* Labels that are not plain strings/numbers cannot be matched.
|
|
1295
|
+
*/
|
|
1296
|
+
var filterMenuSections = (sections, query) => {
|
|
1297
|
+
if (isValidElement(sections) || !Array.isArray(sections)) return [];
|
|
1298
|
+
if (!normalizeSearch(query)) return sections;
|
|
1299
|
+
return tidy(sections.flatMap((section) => {
|
|
1300
|
+
switch (section === null || section === void 0 ? void 0 : section.type) {
|
|
1301
|
+
case MenuType.HEADING:
|
|
1302
|
+
case MenuType.DIVIDER: return [section];
|
|
1303
|
+
case MenuType.OPTION: return matchesSearch(query, getSearchText(section.label), section.description) ? [section] : [];
|
|
1304
|
+
case MenuType.MENU: {
|
|
1305
|
+
var _section$menu$label, _section$menu, _section$menu$section, _section$menu2;
|
|
1306
|
+
if (matchesSearch(query, getSearchText((_section$menu$label = (_section$menu = section.menu) === null || _section$menu === void 0 ? void 0 : _section$menu.label) !== null && _section$menu$label !== void 0 ? _section$menu$label : section.label))) return [section];
|
|
1307
|
+
const children = filterMenuSections((_section$menu$section = (_section$menu2 = section.menu) === null || _section$menu2 === void 0 ? void 0 : _section$menu2.sections) !== null && _section$menu$section !== void 0 ? _section$menu$section : [], query);
|
|
1308
|
+
if (!children.some(isItem)) return [];
|
|
1309
|
+
return [{
|
|
1310
|
+
...section,
|
|
1311
|
+
menu: {
|
|
1312
|
+
trigger: "Text",
|
|
1313
|
+
...section.menu,
|
|
1314
|
+
sections: children
|
|
1315
|
+
}
|
|
1316
|
+
}];
|
|
1317
|
+
}
|
|
1318
|
+
default: return [];
|
|
1319
|
+
}
|
|
1320
|
+
}));
|
|
1321
|
+
};
|
|
1322
|
+
//#endregion
|
|
1250
1323
|
//#region src/components/menu/trigger/text.tsx
|
|
1251
1324
|
var Text$1 = forwardRef(({ label, title, carat, disabled, isOpen, selected, className, ...domProps }, ref) => {
|
|
1252
1325
|
let titleText;
|
|
@@ -1271,11 +1344,22 @@ var Text$1 = forwardRef(({ label, title, carat, disabled, isOpen, selected, clas
|
|
|
1271
1344
|
});
|
|
1272
1345
|
//#endregion
|
|
1273
1346
|
//#region src/components/menu/layer/layer.tsx
|
|
1347
|
+
var MENU_SCOPE_ATTRIBUTE = "data-menu-scope";
|
|
1348
|
+
/**
|
|
1349
|
+
* Marks every popover (root + submenus) belonging to one searchable menu, so outside-press
|
|
1350
|
+
* detection can tell clicks inside the menu apart from clicks elsewhere.
|
|
1351
|
+
*/
|
|
1352
|
+
var OverlayScope = ({ scopeId, children }) => scopeId ? /* @__PURE__ */ jsx("div", {
|
|
1353
|
+
[MENU_SCOPE_ATTRIBUTE]: scopeId,
|
|
1354
|
+
className: menu_module_default.overlayScope,
|
|
1355
|
+
onMouseDown: (evt) => evt.preventDefault(),
|
|
1356
|
+
children
|
|
1357
|
+
}) : /* @__PURE__ */ jsx(Fragment$1, { children });
|
|
1274
1358
|
var getTextValue = (label) => {
|
|
1275
1359
|
if (typeof label === "string" || typeof label === "number") return String(label);
|
|
1276
1360
|
return "";
|
|
1277
1361
|
};
|
|
1278
|
-
var renderSection = (section, index, { closeOnOptionClick, close, maxHeight, width }) => {
|
|
1362
|
+
var renderSection = (section, index, { closeOnOptionClick, close, maxHeight, width, scopeId }) => {
|
|
1279
1363
|
if (section.type === MenuType.MENU) {
|
|
1280
1364
|
var _section$menu, _section$menu2, _section$menu3, _section$menu$label, _section$menu4, _ref, _section$menu$label2, _section$menu5, _section$menu6, _section$menu$section, _section$menu7;
|
|
1281
1365
|
const submenuSections = (_section$menu = section.menu) === null || _section$menu === void 0 ? void 0 : _section$menu.sections;
|
|
@@ -1299,14 +1383,18 @@ var renderSection = (section, index, { closeOnOptionClick, close, maxHeight, wid
|
|
|
1299
1383
|
placement: submenuPlacement,
|
|
1300
1384
|
isNested: true,
|
|
1301
1385
|
"data-testid": (_section$menu6 = section.menu) === null || _section$menu6 === void 0 ? void 0 : _section$menu6.testId,
|
|
1302
|
-
children: /* @__PURE__ */ jsx(
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1386
|
+
children: /* @__PURE__ */ jsx(OverlayScope, {
|
|
1387
|
+
scopeId,
|
|
1388
|
+
children: /* @__PURE__ */ jsx(Layer$2, {
|
|
1389
|
+
sections: (_section$menu$section = (_section$menu7 = section.menu) === null || _section$menu7 === void 0 ? void 0 : _section$menu7.sections) !== null && _section$menu$section !== void 0 ? _section$menu$section : [],
|
|
1390
|
+
isNested: true,
|
|
1391
|
+
width,
|
|
1392
|
+
closeOnOptionClick,
|
|
1393
|
+
close,
|
|
1394
|
+
maxHeight,
|
|
1395
|
+
testId: nestedTestId ? `${nestedTestId}-layer` : void 0,
|
|
1396
|
+
scopeId
|
|
1397
|
+
})
|
|
1310
1398
|
})
|
|
1311
1399
|
})] }, `${section.type}-${index}`);
|
|
1312
1400
|
}
|
|
@@ -1316,11 +1404,12 @@ var renderSection = (section, index, { closeOnOptionClick, close, maxHeight, wid
|
|
|
1316
1404
|
close
|
|
1317
1405
|
}, `${section.type}-${index}`);
|
|
1318
1406
|
};
|
|
1319
|
-
var Layer$2 = ({ sections, isNested = false, width, closeOnOptionClick, close, maxHeight, showAllButton, testId }) => {
|
|
1320
|
-
var _showAllButton$additi, _showAllButton$additi2;
|
|
1407
|
+
var Layer$2 = ({ sections, isNested = false, width, closeOnOptionClick, close, maxHeight, showAllButton, testId, search, scopeId }) => {
|
|
1408
|
+
var _showAllButton$additi, _showAllButton$additi2, _search$value;
|
|
1321
1409
|
const [showAll, setShowAll] = useState(!(showAllButton === null || showAllButton === void 0 ? void 0 : showAllButton.visible));
|
|
1322
1410
|
if (isValidElement(sections)) return /* @__PURE__ */ jsx(Fragment$1, { children: sections });
|
|
1323
1411
|
const sectionsArray = sections;
|
|
1412
|
+
const isSearching = !!(search === null || search === void 0 ? void 0 : search.value);
|
|
1324
1413
|
const additionalSections = (_showAllButton$additi = showAllButton === null || showAllButton === void 0 || (_showAllButton$additi2 = showAllButton.additionalSections) === null || _showAllButton$additi2 === void 0 ? void 0 : _showAllButton$additi2.map((s) => ({
|
|
1325
1414
|
...s,
|
|
1326
1415
|
closeOnOptionClick,
|
|
@@ -1333,7 +1422,10 @@ var Layer$2 = ({ sections, isNested = false, width, closeOnOptionClick, close, m
|
|
|
1333
1422
|
visible: true,
|
|
1334
1423
|
closeOnOptionClick: false
|
|
1335
1424
|
}] : [];
|
|
1336
|
-
const localSections = (showAllButton === null || showAllButton === void 0 ? void 0 : showAllButton.visible) ?
|
|
1425
|
+
const localSections = isSearching ? filterMenuSections([...sectionsArray, ...(showAllButton === null || showAllButton === void 0 ? void 0 : showAllButton.visible) ? additionalSections : []], (_search$value = search === null || search === void 0 ? void 0 : search.value) !== null && _search$value !== void 0 ? _search$value : "").map((s) => ({
|
|
1426
|
+
...s,
|
|
1427
|
+
closeOnOptionClick
|
|
1428
|
+
})) : (showAllButton === null || showAllButton === void 0 ? void 0 : showAllButton.visible) ? sectionsArray.map((s, i) => {
|
|
1337
1429
|
return showAll || i <= 3 ? {
|
|
1338
1430
|
...s,
|
|
1339
1431
|
visible: true,
|
|
@@ -1352,14 +1444,120 @@ var Layer$2 = ({ sections, isNested = false, width, closeOnOptionClick, close, m
|
|
|
1352
1444
|
shouldCloseOnSelect: closeOnOptionClick,
|
|
1353
1445
|
autoFocus: isNested ? void 0 : "first",
|
|
1354
1446
|
"data-testid": testId,
|
|
1447
|
+
renderEmptyState: search ? () => {
|
|
1448
|
+
var _search$noResultsText;
|
|
1449
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1450
|
+
className: menu_module_default.noResults,
|
|
1451
|
+
children: (_search$noResultsText = search.noResultsText) !== null && _search$noResultsText !== void 0 ? _search$noResultsText : "No results"
|
|
1452
|
+
});
|
|
1453
|
+
} : void 0,
|
|
1355
1454
|
children: localSections.map((section, i) => renderSection(section, i, {
|
|
1356
1455
|
closeOnOptionClick: section.closeOnOptionClick,
|
|
1357
1456
|
close,
|
|
1358
1457
|
maxHeight,
|
|
1359
|
-
width
|
|
1458
|
+
width,
|
|
1459
|
+
scopeId
|
|
1360
1460
|
}))
|
|
1361
1461
|
});
|
|
1362
1462
|
};
|
|
1463
|
+
var trigger_module_default = {
|
|
1464
|
+
inputInTable: "_inputInTable_c2rg4_1",
|
|
1465
|
+
inputHover: "_inputHover_c2rg4_13",
|
|
1466
|
+
inputFocus: "_inputFocus_c2rg4_18",
|
|
1467
|
+
controlFocusVisible: "_controlFocusVisible_c2rg4_25",
|
|
1468
|
+
inputError: "_inputError_c2rg4_29",
|
|
1469
|
+
inputWarning: "_inputWarning_c2rg4_30",
|
|
1470
|
+
inputDisabled: "_inputDisabled_c2rg4_65",
|
|
1471
|
+
hideScrollbars: "_hideScrollbars_c2rg4_71",
|
|
1472
|
+
trigger: "_trigger_c2rg4_81",
|
|
1473
|
+
isInTable: "_isInTable_c2rg4_97",
|
|
1474
|
+
input: "_input_c2rg4_1",
|
|
1475
|
+
isOpen: "_isOpen_c2rg4_118",
|
|
1476
|
+
disabled: "_disabled_c2rg4_161",
|
|
1477
|
+
icons: "_icons_c2rg4_167",
|
|
1478
|
+
clearAll: "_clearAll_c2rg4_174",
|
|
1479
|
+
iconOpen: "_iconOpen_c2rg4_175",
|
|
1480
|
+
small: "_small_c2rg4_186",
|
|
1481
|
+
triggerInputContainer: "_triggerInputContainer_c2rg4_194",
|
|
1482
|
+
right: "_right_c2rg4_203",
|
|
1483
|
+
multiOptions: "_multiOptions_c2rg4_216",
|
|
1484
|
+
multiOption: "_multiOption_c2rg4_216",
|
|
1485
|
+
label: "_label_c2rg4_244",
|
|
1486
|
+
closeMultiOption: "_closeMultiOption_c2rg4_247",
|
|
1487
|
+
focus: "_focus_c2rg4_258",
|
|
1488
|
+
selectedSingleValue: "_selectedSingleValue_c2rg4_262",
|
|
1489
|
+
placeHolder: "_placeHolder_c2rg4_263",
|
|
1490
|
+
groupOrderFirst: "_groupOrderFirst_c2rg4_302",
|
|
1491
|
+
groupOrderMiddle: "_groupOrderMiddle_c2rg4_303",
|
|
1492
|
+
groupOrderLast: "_groupOrderLast_c2rg4_307",
|
|
1493
|
+
detailedLabel: "_detailedLabel_c2rg4_312"
|
|
1494
|
+
};
|
|
1495
|
+
//#endregion
|
|
1496
|
+
//#region src/components/menu/trigger/search-trigger.tsx
|
|
1497
|
+
var groupOrderClass = (groupOrder) => {
|
|
1498
|
+
switch (groupOrder) {
|
|
1499
|
+
case GroupOrder.FIRST: return trigger_module_default.groupOrderFirst;
|
|
1500
|
+
case GroupOrder.LAST: return trigger_module_default.groupOrderLast;
|
|
1501
|
+
case void 0: return;
|
|
1502
|
+
default: return trigger_module_default.groupOrderMiddle;
|
|
1503
|
+
}
|
|
1504
|
+
};
|
|
1505
|
+
/**
|
|
1506
|
+
* Select-style search input acting as the Menu trigger. Must render inside an RAC `Autocomplete`
|
|
1507
|
+
* (wires the input to the menu via virtual focus / aria-activedescendant) and a `MenuTrigger`.
|
|
1508
|
+
* Behaviour mirrors the searchable Select: click anywhere toggles, typing / ArrowDown opens,
|
|
1509
|
+
* Escape / Tab close.
|
|
1510
|
+
*/
|
|
1511
|
+
var SearchTrigger = forwardRef(({ label, searchValue, isOpen, disabled, small, width, groupOrder, error, warning, tabIndex, testId, inputRef, onOpen, onClose }, ref) => {
|
|
1512
|
+
const handleMouseDown = (evt) => evt.preventDefault();
|
|
1513
|
+
const handleClick = () => {
|
|
1514
|
+
var _inputRef$current;
|
|
1515
|
+
if (disabled) return;
|
|
1516
|
+
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
|
|
1517
|
+
if (isOpen) onClose();
|
|
1518
|
+
else onOpen();
|
|
1519
|
+
};
|
|
1520
|
+
const handleKeyDown = (evt) => {
|
|
1521
|
+
if (!isOpen && evt.key === "ArrowDown") onOpen();
|
|
1522
|
+
if (isOpen && (evt.key === "Escape" || evt.key === "Tab")) onClose();
|
|
1523
|
+
};
|
|
1524
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
1525
|
+
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)),
|
|
1527
|
+
style: { width },
|
|
1528
|
+
onMouseDown: handleMouseDown,
|
|
1529
|
+
onClick: handleClick,
|
|
1530
|
+
"data-error": error || null,
|
|
1531
|
+
"data-warning": warning || null,
|
|
1532
|
+
"data-testid": testId,
|
|
1533
|
+
children: [/* @__PURE__ */ jsxs(SearchField, {
|
|
1534
|
+
"aria-label": typeof label === "string" ? label : "Search",
|
|
1535
|
+
isDisabled: disabled,
|
|
1536
|
+
onKeyDown: handleKeyDown,
|
|
1537
|
+
className: trigger_module_default.triggerInputContainer,
|
|
1538
|
+
children: [!searchValue && /* @__PURE__ */ jsx("span", {
|
|
1539
|
+
className: trigger_module_default.selectedSingleValue,
|
|
1540
|
+
"data-testid": testId && `${testId}-value`,
|
|
1541
|
+
children: label
|
|
1542
|
+
}), /* @__PURE__ */ jsx(Input$1, {
|
|
1543
|
+
ref: inputRef,
|
|
1544
|
+
className: cx(trigger_module_default.input, menu_module_default.searchInput),
|
|
1545
|
+
size: searchValue.length + 1,
|
|
1546
|
+
tabIndex,
|
|
1547
|
+
"data-testid": testId ? `${testId}-input` : void 0
|
|
1548
|
+
})]
|
|
1549
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
1550
|
+
className: trigger_module_default.icons,
|
|
1551
|
+
children: /* @__PURE__ */ jsx(Pressable$1, {
|
|
1552
|
+
isDisabled: true,
|
|
1553
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
1554
|
+
className: trigger_module_default.iconOpen,
|
|
1555
|
+
children: /* @__PURE__ */ jsx(Icon, { icon: IconType.CHEVRON_DOWN })
|
|
1556
|
+
})
|
|
1557
|
+
})
|
|
1558
|
+
})]
|
|
1559
|
+
});
|
|
1560
|
+
});
|
|
1363
1561
|
//#endregion
|
|
1364
1562
|
//#region src/components/menu/layer/placementOptions.ts
|
|
1365
1563
|
var placementOptions = (placement, isNested = false) => ({ placement: placement || (isNested ? "right-start" : "bottom-start") });
|
|
@@ -1407,7 +1605,7 @@ var Badge = ({ children, color = "", textColor: textColorProp = "", title = null
|
|
|
1407
1605
|
};
|
|
1408
1606
|
//#endregion
|
|
1409
1607
|
//#region src/components/menu/trigger/button.tsx
|
|
1410
|
-
var Button$1 = React.forwardRef(({ trigger, label, colored,
|
|
1608
|
+
var Button$1 = React.forwardRef(({ trigger, label, colored, small, width, disabled, groupOrder, loading, error, warning, active, tabIndex, testId, ...domProps }, ref) => {
|
|
1411
1609
|
const disabledContext = useContext(DisabledContext);
|
|
1412
1610
|
const isDropdown = trigger === TriggerType.DROP_DOWN_BUTTON;
|
|
1413
1611
|
return /* @__PURE__ */ jsx(Button, {
|
|
@@ -1417,7 +1615,6 @@ var Button$1 = React.forwardRef(({ trigger, label, colored, basic, small, width,
|
|
|
1417
1615
|
children: label
|
|
1418
1616
|
}),
|
|
1419
1617
|
colored,
|
|
1420
|
-
basic,
|
|
1421
1618
|
small,
|
|
1422
1619
|
width,
|
|
1423
1620
|
groupOrder,
|
|
@@ -1500,7 +1697,7 @@ var withBadge = (children, { isNested, badgeTitle, badgeDot }) => !isNested && (
|
|
|
1500
1697
|
* Renders the menu trigger control only (Button / Text / Component).
|
|
1501
1698
|
* OverlayTriggerChild owns the Pressable host — do not wrap a focus shell here.
|
|
1502
1699
|
*/
|
|
1503
|
-
var Trigger$1 = React.forwardRef(({ active, disabled, loading, width, trigger, label, title, colored,
|
|
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) => {
|
|
1504
1701
|
const isButtonTrigger = trigger === TriggerType.BUTTON || trigger === TriggerType.DROP_DOWN_BUTTON;
|
|
1505
1702
|
const isComponentTrigger = trigger === TriggerType.COMPONENT;
|
|
1506
1703
|
if (isButtonTrigger) return /* @__PURE__ */ jsx(Button$1, {
|
|
@@ -1508,7 +1705,6 @@ var Trigger$1 = React.forwardRef(({ active, disabled, loading, width, trigger, l
|
|
|
1508
1705
|
trigger,
|
|
1509
1706
|
label: label !== null && label !== void 0 ? label : "",
|
|
1510
1707
|
colored,
|
|
1511
|
-
basic,
|
|
1512
1708
|
small,
|
|
1513
1709
|
width,
|
|
1514
1710
|
disabled,
|
|
@@ -1545,22 +1741,40 @@ var Trigger$1 = React.forwardRef(({ active, disabled, loading, width, trigger, l
|
|
|
1545
1741
|
});
|
|
1546
1742
|
//#endregion
|
|
1547
1743
|
//#region src/components/menu/menu.tsx
|
|
1548
|
-
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 }) => {
|
|
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, searchable = false, searchNoResultsText }) => {
|
|
1549
1745
|
const disabledContext = useContext(DisabledContext);
|
|
1550
1746
|
const triggerRef = useRef(null);
|
|
1551
1747
|
const [internalOpen, setInternalOpen] = useState(false);
|
|
1552
|
-
const
|
|
1748
|
+
const [searchValue, setSearchValue] = useState("");
|
|
1749
|
+
const scopeId = useId();
|
|
1750
|
+
const searchTriggerRef = useRef(null);
|
|
1751
|
+
const searchInputRef = useRef(null);
|
|
1752
|
+
const { label, title, trigger, colored, small, sections, component, placement, showAllButton } = menu;
|
|
1553
1753
|
const isControlled = isBoolean(openProp) && isFunction(setOpenProp);
|
|
1554
1754
|
const isOpen = isControlled ? openProp : internalOpen;
|
|
1555
1755
|
const isDisabled = disabled || isMenuEmpty(menu) || disabledContext;
|
|
1756
|
+
const isSearchable = searchable && !isValidElement(sections);
|
|
1757
|
+
/** Input trigger, or any popover (root / submenu) belonging to this menu. */
|
|
1758
|
+
const isInSearchScope = (el) => {
|
|
1759
|
+
var _searchTriggerRef$cur;
|
|
1760
|
+
return el instanceof Element && (!!((_searchTriggerRef$cur = searchTriggerRef.current) === null || _searchTriggerRef$cur === void 0 ? void 0 : _searchTriggerRef$cur.contains(el)) || !!el.closest(`[data-menu-scope="${CSS.escape(scopeId)}"]`));
|
|
1761
|
+
};
|
|
1556
1762
|
const handleOpenChange = useCallback((open) => {
|
|
1557
1763
|
if (isDisabled && open) return;
|
|
1764
|
+
if (!open) {
|
|
1765
|
+
setSearchValue("");
|
|
1766
|
+
if (isSearchable && isInSearchScope(document.activeElement) && document.activeElement !== searchInputRef.current) {
|
|
1767
|
+
var _searchInputRef$curre;
|
|
1768
|
+
(_searchInputRef$curre = searchInputRef.current) === null || _searchInputRef$curre === void 0 || _searchInputRef$curre.focus();
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
1558
1771
|
if (isControlled) setOpenProp(open);
|
|
1559
1772
|
else setInternalOpen(open);
|
|
1560
1773
|
}, [
|
|
1561
1774
|
isControlled,
|
|
1562
1775
|
isDisabled,
|
|
1563
|
-
setOpenProp
|
|
1776
|
+
setOpenProp,
|
|
1777
|
+
isSearchable
|
|
1564
1778
|
]);
|
|
1565
1779
|
const close = useCallback(() => {
|
|
1566
1780
|
handleOpenChange(false);
|
|
@@ -1578,6 +1792,23 @@ var Menu = ({ menu, width, disabled = false, badgeTitle, badgeDot = false, loadi
|
|
|
1578
1792
|
evt.stopPropagation();
|
|
1579
1793
|
evt.preventDefault();
|
|
1580
1794
|
};
|
|
1795
|
+
const handleSearchChange = (value) => {
|
|
1796
|
+
setSearchValue(value);
|
|
1797
|
+
if (value && !isOpen) handleOpenChange(true);
|
|
1798
|
+
};
|
|
1799
|
+
useEffect(() => {
|
|
1800
|
+
if (!isSearchable || !isOpen) return;
|
|
1801
|
+
const onPointerDown = (evt) => {
|
|
1802
|
+
if (!isInSearchScope(evt.target)) close();
|
|
1803
|
+
};
|
|
1804
|
+
document.addEventListener("pointerdown", onPointerDown, true);
|
|
1805
|
+
return () => document.removeEventListener("pointerdown", onPointerDown, true);
|
|
1806
|
+
}, [
|
|
1807
|
+
isSearchable,
|
|
1808
|
+
isOpen,
|
|
1809
|
+
close
|
|
1810
|
+
]);
|
|
1811
|
+
const ignorePopoverClose = () => {};
|
|
1581
1812
|
const triggerControl = /* @__PURE__ */ jsx(OverlayTriggerChild, {
|
|
1582
1813
|
behavior: OverlayTriggerBehavior.PRESS,
|
|
1583
1814
|
testId,
|
|
@@ -1594,7 +1825,6 @@ var Menu = ({ menu, width, disabled = false, badgeTitle, badgeDot = false, loadi
|
|
|
1594
1825
|
label,
|
|
1595
1826
|
title,
|
|
1596
1827
|
colored,
|
|
1597
|
-
basic,
|
|
1598
1828
|
small,
|
|
1599
1829
|
component,
|
|
1600
1830
|
groupOrder,
|
|
@@ -1605,6 +1835,67 @@ var Menu = ({ menu, width, disabled = false, badgeTitle, badgeDot = false, loadi
|
|
|
1605
1835
|
onClick: handleTriggerClick
|
|
1606
1836
|
})
|
|
1607
1837
|
});
|
|
1838
|
+
const layer = /* @__PURE__ */ jsx(Layer$2, {
|
|
1839
|
+
sections,
|
|
1840
|
+
width,
|
|
1841
|
+
closeOnOptionClick,
|
|
1842
|
+
close,
|
|
1843
|
+
maxHeight,
|
|
1844
|
+
showAllButton,
|
|
1845
|
+
testId: layerTestId,
|
|
1846
|
+
search: isSearchable ? {
|
|
1847
|
+
value: searchValue,
|
|
1848
|
+
noResultsText: searchNoResultsText
|
|
1849
|
+
} : void 0,
|
|
1850
|
+
scopeId: isSearchable ? scopeId : void 0
|
|
1851
|
+
});
|
|
1852
|
+
if (isSearchable) return /* @__PURE__ */ jsx(MenuTrigger, {
|
|
1853
|
+
isOpen,
|
|
1854
|
+
onOpenChange: handleOpenChange,
|
|
1855
|
+
children: /* @__PURE__ */ jsxs(Autocomplete, {
|
|
1856
|
+
inputValue: searchValue,
|
|
1857
|
+
onInputChange: handleSearchChange,
|
|
1858
|
+
children: [/* @__PURE__ */ jsx(TriggerTooltip, {
|
|
1859
|
+
tooltip,
|
|
1860
|
+
error,
|
|
1861
|
+
warning,
|
|
1862
|
+
children: withBadge(/* @__PURE__ */ jsx(SearchTrigger, {
|
|
1863
|
+
ref: searchTriggerRef,
|
|
1864
|
+
inputRef: searchInputRef,
|
|
1865
|
+
label,
|
|
1866
|
+
searchValue,
|
|
1867
|
+
isOpen,
|
|
1868
|
+
disabled: isDisabled,
|
|
1869
|
+
small,
|
|
1870
|
+
width,
|
|
1871
|
+
groupOrder,
|
|
1872
|
+
error,
|
|
1873
|
+
warning,
|
|
1874
|
+
tabIndex,
|
|
1875
|
+
testId,
|
|
1876
|
+
onOpen: () => handleOpenChange(true),
|
|
1877
|
+
onClose: close
|
|
1878
|
+
}), {
|
|
1879
|
+
badgeTitle,
|
|
1880
|
+
badgeDot
|
|
1881
|
+
})
|
|
1882
|
+
}), /* @__PURE__ */ jsx(AriaOverlayPopover, {
|
|
1883
|
+
className: menu_module_default.menuPopover,
|
|
1884
|
+
placement: resolvedPlacement,
|
|
1885
|
+
triggerRef: searchTriggerRef,
|
|
1886
|
+
portalTriggerRef: searchTriggerRef,
|
|
1887
|
+
offset,
|
|
1888
|
+
isNonModal: true,
|
|
1889
|
+
isOpen,
|
|
1890
|
+
onOpenChange: ignorePopoverClose,
|
|
1891
|
+
"data-testid": menu.testId,
|
|
1892
|
+
children: /* @__PURE__ */ jsx(OverlayScope, {
|
|
1893
|
+
scopeId,
|
|
1894
|
+
children: layer
|
|
1895
|
+
})
|
|
1896
|
+
})]
|
|
1897
|
+
})
|
|
1898
|
+
});
|
|
1608
1899
|
return /* @__PURE__ */ jsxs(MenuTrigger, {
|
|
1609
1900
|
isOpen,
|
|
1610
1901
|
onOpenChange: handleOpenChange,
|
|
@@ -1622,15 +1913,7 @@ var Menu = ({ menu, width, disabled = false, badgeTitle, badgeDot = false, loadi
|
|
|
1622
1913
|
portalTriggerRef: triggerRef,
|
|
1623
1914
|
offset,
|
|
1624
1915
|
"data-testid": menu.testId,
|
|
1625
|
-
children:
|
|
1626
|
-
sections,
|
|
1627
|
-
width,
|
|
1628
|
-
closeOnOptionClick,
|
|
1629
|
-
close,
|
|
1630
|
-
maxHeight,
|
|
1631
|
-
showAllButton,
|
|
1632
|
-
testId: layerTestId
|
|
1633
|
-
})
|
|
1916
|
+
children: layer
|
|
1634
1917
|
})]
|
|
1635
1918
|
});
|
|
1636
1919
|
};
|
|
@@ -2742,53 +3025,28 @@ var InputGroup = ({ children, small = false, width = "100%", isInTable: isInTabl
|
|
|
2742
3025
|
})
|
|
2743
3026
|
});
|
|
2744
3027
|
};
|
|
2745
|
-
//#endregion
|
|
2746
|
-
//#region src/hooks/use-element-width.ts
|
|
2747
|
-
var useElementWidth = (enabled = true) => {
|
|
2748
|
-
const [element, setElement] = useState(null);
|
|
2749
|
-
const [width, setWidth] = useState(null);
|
|
2750
|
-
const ref = useCallback((node) => {
|
|
2751
|
-
setElement(node);
|
|
2752
|
-
}, []);
|
|
2753
|
-
useLayoutEffect(() => {
|
|
2754
|
-
if (!enabled || !element) {
|
|
2755
|
-
setWidth(null);
|
|
2756
|
-
return;
|
|
2757
|
-
}
|
|
2758
|
-
const measure = () => setWidth(element.getBoundingClientRect().width);
|
|
2759
|
-
measure();
|
|
2760
|
-
if (typeof ResizeObserver === "undefined") return;
|
|
2761
|
-
const observer = new ResizeObserver(measure);
|
|
2762
|
-
observer.observe(element);
|
|
2763
|
-
return () => observer.disconnect();
|
|
2764
|
-
}, [enabled, element]);
|
|
2765
|
-
return [ref, width];
|
|
2766
|
-
};
|
|
2767
3028
|
var input_module_default = {
|
|
2768
|
-
inputInTable: "
|
|
2769
|
-
inputHover: "
|
|
2770
|
-
inputFocus: "
|
|
2771
|
-
controlFocusVisible: "
|
|
2772
|
-
inputError: "
|
|
2773
|
-
inputWarning: "
|
|
2774
|
-
inputDisabled: "
|
|
2775
|
-
hideScrollbars: "
|
|
2776
|
-
wrapper: "
|
|
2777
|
-
input: "
|
|
2778
|
-
isInTable: "
|
|
2779
|
-
small: "
|
|
2780
|
-
right: "
|
|
2781
|
-
groupOrderFirst: "
|
|
2782
|
-
groupOrderMiddle: "
|
|
2783
|
-
groupOrderLast: "
|
|
2784
|
-
|
|
2785
|
-
slotLeft: "_slotLeft_1w4lm_207",
|
|
2786
|
-
slotRight: "_slotRight_1w4lm_212",
|
|
2787
|
-
icon: "_icon_1w4lm_225"
|
|
3029
|
+
inputInTable: "_inputInTable_o2gwb_1",
|
|
3030
|
+
inputHover: "_inputHover_o2gwb_13",
|
|
3031
|
+
inputFocus: "_inputFocus_o2gwb_18",
|
|
3032
|
+
controlFocusVisible: "_controlFocusVisible_o2gwb_25",
|
|
3033
|
+
inputError: "_inputError_o2gwb_29",
|
|
3034
|
+
inputWarning: "_inputWarning_o2gwb_30",
|
|
3035
|
+
inputDisabled: "_inputDisabled_o2gwb_65",
|
|
3036
|
+
hideScrollbars: "_hideScrollbars_o2gwb_71",
|
|
3037
|
+
wrapper: "_wrapper_o2gwb_81",
|
|
3038
|
+
input: "_input_o2gwb_1",
|
|
3039
|
+
isInTable: "_isInTable_o2gwb_107",
|
|
3040
|
+
small: "_small_o2gwb_131",
|
|
3041
|
+
right: "_right_o2gwb_177",
|
|
3042
|
+
groupOrderFirst: "_groupOrderFirst_o2gwb_180",
|
|
3043
|
+
groupOrderMiddle: "_groupOrderMiddle_o2gwb_181",
|
|
3044
|
+
groupOrderLast: "_groupOrderLast_o2gwb_185",
|
|
3045
|
+
icon: "_icon_o2gwb_190"
|
|
2788
3046
|
};
|
|
2789
3047
|
//#endregion
|
|
2790
3048
|
//#region src/components/input/input.tsx
|
|
2791
|
-
var Input = forwardRef(({ error = null, tooltip = null, isInTable: isInTableProp, width: propWidth = void 0, small = false, onChange = noop, placeholder = "", value = "", icon,
|
|
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) => {
|
|
2792
3050
|
const disabledContext = useContext(DisabledContext);
|
|
2793
3051
|
const isInTable = useIsInTable(isInTableProp);
|
|
2794
3052
|
const order = (() => {
|
|
@@ -2800,67 +3058,48 @@ var Input = forwardRef(({ error = null, tooltip = null, isInTable: isInTableProp
|
|
|
2800
3058
|
return "";
|
|
2801
3059
|
})();
|
|
2802
3060
|
const width = propWidth || (size ? "auto" : "100%");
|
|
2803
|
-
const leftContent = icon ? /* @__PURE__ */ jsx("span", {
|
|
2804
|
-
className: input_module_default.icon,
|
|
2805
|
-
children: /* @__PURE__ */ jsx(Icon, { icon })
|
|
2806
|
-
}) : leftSlot;
|
|
2807
|
-
const [leftSlotRef, leftSlotWidth] = useElementWidth(!!leftContent);
|
|
2808
|
-
const [rightSlotRef, rightSlotWidth] = useElementWidth(!!rightSlot);
|
|
2809
3061
|
const handleFocus = (e) => {
|
|
2810
3062
|
onFocus(e);
|
|
2811
3063
|
if (selectOnFocus) setTimeout(() => {
|
|
2812
3064
|
if (e.target === document.activeElement) e.target.select();
|
|
2813
3065
|
}, 0);
|
|
2814
3066
|
};
|
|
2815
|
-
return /* @__PURE__ */
|
|
3067
|
+
return /* @__PURE__ */ jsx("div", {
|
|
2816
3068
|
style: { width },
|
|
2817
3069
|
className: cx(order, input_module_default.wrapper),
|
|
2818
|
-
children:
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
|
|
2844
|
-
|
|
2845
|
-
|
|
2846
|
-
|
|
2847
|
-
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2851
|
-
...rightSlotWidth ? { paddingRight: rightSlotWidth } : null
|
|
2852
|
-
},
|
|
2853
|
-
"data-error": error || null,
|
|
2854
|
-
"data-warning": warning || null,
|
|
2855
|
-
"data-testid": testId
|
|
2856
|
-
})
|
|
2857
|
-
}),
|
|
2858
|
-
rightSlot && /* @__PURE__ */ jsx("div", {
|
|
2859
|
-
ref: rightSlotRef,
|
|
2860
|
-
className: cx(input_module_default.slot, input_module_default.slotRight),
|
|
2861
|
-
children: rightSlot
|
|
2862
|
-
})
|
|
2863
|
-
]
|
|
3070
|
+
children: /* @__PURE__ */ jsxs(Tooltip, {
|
|
3071
|
+
error: !!error,
|
|
3072
|
+
warning: !!warning,
|
|
3073
|
+
text: tooltip || error || warning,
|
|
3074
|
+
enabled: tooltip && isStringNumberOrNode(tooltip) || error && isStringNumberOrNode(error) || warning && isStringNumberOrNode(warning) || false,
|
|
3075
|
+
maxWidth: maxTooltipWidth,
|
|
3076
|
+
display: "block",
|
|
3077
|
+
children: [icon && /* @__PURE__ */ jsx("span", {
|
|
3078
|
+
className: input_module_default.icon,
|
|
3079
|
+
children: /* @__PURE__ */ jsx(Icon, { icon })
|
|
3080
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
3081
|
+
ref,
|
|
3082
|
+
type: type || "text",
|
|
3083
|
+
size: size || 20,
|
|
3084
|
+
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : "",
|
|
3085
|
+
value: value !== null && value !== void 0 ? value : "",
|
|
3086
|
+
onChange,
|
|
3087
|
+
onKeyPress,
|
|
3088
|
+
onKeyDown,
|
|
3089
|
+
onFocus: handleFocus,
|
|
3090
|
+
onBlur,
|
|
3091
|
+
onPaste,
|
|
3092
|
+
name,
|
|
3093
|
+
tabIndex,
|
|
3094
|
+
autoComplete: "off",
|
|
3095
|
+
disabled: disabled || disabledContext,
|
|
3096
|
+
className: cx(input_module_default.input, right ? input_module_default.right : "", small ? input_module_default.small : "", isInTable ? input_module_default.isInTable : ""),
|
|
3097
|
+
style: { width },
|
|
3098
|
+
"data-error": error || null,
|
|
3099
|
+
"data-warning": warning || null,
|
|
3100
|
+
"data-testid": testId
|
|
3101
|
+
})]
|
|
3102
|
+
})
|
|
2864
3103
|
});
|
|
2865
3104
|
});
|
|
2866
3105
|
var file_input_module_default = { fileInput: "_fileInput_1elar_1" };
|
|
@@ -3762,38 +4001,6 @@ var Layer$1 = ({ listRef, sections, selectedOptions, onSelectOption, focusedOpti
|
|
|
3762
4001
|
children: listBox
|
|
3763
4002
|
});
|
|
3764
4003
|
};
|
|
3765
|
-
var trigger_module_default = {
|
|
3766
|
-
inputInTable: "_inputInTable_c2rg4_1",
|
|
3767
|
-
inputHover: "_inputHover_c2rg4_13",
|
|
3768
|
-
inputFocus: "_inputFocus_c2rg4_18",
|
|
3769
|
-
controlFocusVisible: "_controlFocusVisible_c2rg4_25",
|
|
3770
|
-
inputError: "_inputError_c2rg4_29",
|
|
3771
|
-
inputWarning: "_inputWarning_c2rg4_30",
|
|
3772
|
-
inputDisabled: "_inputDisabled_c2rg4_65",
|
|
3773
|
-
hideScrollbars: "_hideScrollbars_c2rg4_71",
|
|
3774
|
-
trigger: "_trigger_c2rg4_81",
|
|
3775
|
-
isInTable: "_isInTable_c2rg4_97",
|
|
3776
|
-
input: "_input_c2rg4_1",
|
|
3777
|
-
isOpen: "_isOpen_c2rg4_118",
|
|
3778
|
-
disabled: "_disabled_c2rg4_161",
|
|
3779
|
-
icons: "_icons_c2rg4_167",
|
|
3780
|
-
clearAll: "_clearAll_c2rg4_174",
|
|
3781
|
-
iconOpen: "_iconOpen_c2rg4_175",
|
|
3782
|
-
small: "_small_c2rg4_186",
|
|
3783
|
-
triggerInputContainer: "_triggerInputContainer_c2rg4_194",
|
|
3784
|
-
right: "_right_c2rg4_203",
|
|
3785
|
-
multiOptions: "_multiOptions_c2rg4_216",
|
|
3786
|
-
multiOption: "_multiOption_c2rg4_216",
|
|
3787
|
-
label: "_label_c2rg4_244",
|
|
3788
|
-
closeMultiOption: "_closeMultiOption_c2rg4_247",
|
|
3789
|
-
focus: "_focus_c2rg4_258",
|
|
3790
|
-
selectedSingleValue: "_selectedSingleValue_c2rg4_262",
|
|
3791
|
-
placeHolder: "_placeHolder_c2rg4_263",
|
|
3792
|
-
groupOrderFirst: "_groupOrderFirst_c2rg4_302",
|
|
3793
|
-
groupOrderMiddle: "_groupOrderMiddle_c2rg4_303",
|
|
3794
|
-
groupOrderLast: "_groupOrderLast_c2rg4_307",
|
|
3795
|
-
detailedLabel: "_detailedLabel_c2rg4_312"
|
|
3796
|
-
};
|
|
3797
4004
|
//#endregion
|
|
3798
4005
|
//#region src/components/select/custom-select/trigger/multi-selected-options.tsx
|
|
3799
4006
|
var MultiSelectedOptions = ({ selectedOptions, small, width, testId }) => {
|
|
@@ -3838,7 +4045,7 @@ var MultiSelectedOptions = ({ selectedOptions, small, width, testId }) => {
|
|
|
3838
4045
|
};
|
|
3839
4046
|
//#endregion
|
|
3840
4047
|
//#region src/components/select/custom-select/trigger/input.tsx
|
|
3841
|
-
var Input$
|
|
4048
|
+
var Input$2 = ({ selectedOptions, searchable = false, searchValue, onChange = noop, inputRef, error, placeholder = "Select...", small, testId }) => {
|
|
3842
4049
|
const containerRef = useRef(null);
|
|
3843
4050
|
const isMulti = Array.isArray(selectedOptions);
|
|
3844
4051
|
const hasSelectedValues = isMulti ? selectedOptions.length > 0 : !!selectedOptions;
|
|
@@ -3918,7 +4125,7 @@ var Trigger = ({ selectedOptions, searchValue, searchable, clearable, onClickTri
|
|
|
3918
4125
|
"data-error": error || null,
|
|
3919
4126
|
"data-warning": warning || null,
|
|
3920
4127
|
"data-testid": testId,
|
|
3921
|
-
children: [/* @__PURE__ */ jsx(Input$
|
|
4128
|
+
children: [/* @__PURE__ */ jsx(Input$2, {
|
|
3922
4129
|
selectedOptions: selectedOptionsWithDetails,
|
|
3923
4130
|
placeholder,
|
|
3924
4131
|
searchable,
|
|
@@ -4590,17 +4797,16 @@ var validateSelectedPage = (selectedPage, numPages, errorMessageTemplate = "Sele
|
|
|
4590
4797
|
};
|
|
4591
4798
|
var pagination_module_default = { paginationContainer: "_paginationContainer_1tmz4_1" };
|
|
4592
4799
|
var input_group_addon_module_default = {
|
|
4593
|
-
addon: "
|
|
4594
|
-
small: "
|
|
4595
|
-
groupOrderFirst: "
|
|
4596
|
-
groupOrderMiddle: "
|
|
4597
|
-
groupOrderLast: "
|
|
4598
|
-
isInTable: "
|
|
4599
|
-
borderless: "_borderless_4fbro_38"
|
|
4800
|
+
addon: "_addon_11bnn_1",
|
|
4801
|
+
small: "_small_11bnn_12",
|
|
4802
|
+
groupOrderFirst: "_groupOrderFirst_11bnn_16",
|
|
4803
|
+
groupOrderMiddle: "_groupOrderMiddle_11bnn_17",
|
|
4804
|
+
groupOrderLast: "_groupOrderLast_11bnn_21",
|
|
4805
|
+
isInTable: "_isInTable_11bnn_26"
|
|
4600
4806
|
};
|
|
4601
4807
|
//#endregion
|
|
4602
4808
|
//#region src/components/input-group/input-group-addon/input-group-addon.tsx
|
|
4603
|
-
var InputGroupAddon = ({ children, groupOrder, small = false
|
|
4809
|
+
var InputGroupAddon = ({ children, groupOrder, small = false }) => {
|
|
4604
4810
|
const isInTable = useIsInTable();
|
|
4605
4811
|
const order = (() => {
|
|
4606
4812
|
if (groupOrder) switch (groupOrder) {
|
|
@@ -4611,7 +4817,7 @@ var InputGroupAddon = ({ children, groupOrder, small = false, borderless = false
|
|
|
4611
4817
|
return "";
|
|
4612
4818
|
})();
|
|
4613
4819
|
return /* @__PURE__ */ jsx("span", {
|
|
4614
|
-
className: cx(input_group_addon_module_default.addon, order, small ? input_group_addon_module_default.small : "", isInTable && input_group_addon_module_default.isInTable
|
|
4820
|
+
className: cx(input_group_addon_module_default.addon, order, small ? input_group_addon_module_default.small : "", isInTable && input_group_addon_module_default.isInTable),
|
|
4615
4821
|
children
|
|
4616
4822
|
});
|
|
4617
4823
|
};
|
|
@@ -4800,37 +5006,37 @@ var getHeaderAlignment = (alignments, isHeader = false, rowIndex = 0) => {
|
|
|
4800
5006
|
}
|
|
4801
5007
|
};
|
|
4802
5008
|
var cell_module_default = {
|
|
4803
|
-
inputInTable: "
|
|
4804
|
-
inputHover: "
|
|
4805
|
-
inputFocus: "
|
|
4806
|
-
controlFocusVisible: "
|
|
4807
|
-
inputError: "
|
|
4808
|
-
inputWarning: "
|
|
4809
|
-
inputDisabled: "
|
|
4810
|
-
hideScrollbars: "
|
|
4811
|
-
cell: "
|
|
4812
|
-
disabledLink: "
|
|
4813
|
-
inputWrapper: "
|
|
4814
|
-
numberInputWrapper: "
|
|
4815
|
-
unitInputWrapper: "
|
|
4816
|
-
breakWord: "
|
|
4817
|
-
inputCell: "
|
|
4818
|
-
sliderCell: "
|
|
4819
|
-
staticCell: "
|
|
4820
|
-
staticCellContent: "
|
|
4821
|
-
unit: "
|
|
4822
|
-
sortingCell: "
|
|
4823
|
-
sortingCellIcon: "
|
|
4824
|
-
icon: "
|
|
4825
|
-
checkBoxCell: "
|
|
4826
|
-
iconCellWrapper: "
|
|
4827
|
-
actionsCell: "
|
|
4828
|
-
rightAligned: "
|
|
4829
|
-
centerAligned: "
|
|
4830
|
-
leftAligned: "
|
|
4831
|
-
popover: "
|
|
4832
|
-
disabledPointerEvents: "
|
|
4833
|
-
standaloneCheckbox: "
|
|
5009
|
+
inputInTable: "_inputInTable_1ull1_1",
|
|
5010
|
+
inputHover: "_inputHover_1ull1_13",
|
|
5011
|
+
inputFocus: "_inputFocus_1ull1_18",
|
|
5012
|
+
controlFocusVisible: "_controlFocusVisible_1ull1_25",
|
|
5013
|
+
inputError: "_inputError_1ull1_29",
|
|
5014
|
+
inputWarning: "_inputWarning_1ull1_30",
|
|
5015
|
+
inputDisabled: "_inputDisabled_1ull1_65",
|
|
5016
|
+
hideScrollbars: "_hideScrollbars_1ull1_71",
|
|
5017
|
+
cell: "_cell_1ull1_81",
|
|
5018
|
+
disabledLink: "_disabledLink_1ull1_91",
|
|
5019
|
+
inputWrapper: "_inputWrapper_1ull1_95",
|
|
5020
|
+
numberInputWrapper: "_numberInputWrapper_1ull1_110",
|
|
5021
|
+
unitInputWrapper: "_unitInputWrapper_1ull1_117",
|
|
5022
|
+
breakWord: "_breakWord_1ull1_125",
|
|
5023
|
+
inputCell: "_inputCell_1ull1_128",
|
|
5024
|
+
sliderCell: "_sliderCell_1ull1_131",
|
|
5025
|
+
staticCell: "_staticCell_1ull1_135",
|
|
5026
|
+
staticCellContent: "_staticCellContent_1ull1_138",
|
|
5027
|
+
unit: "_unit_1ull1_117",
|
|
5028
|
+
sortingCell: "_sortingCell_1ull1_162",
|
|
5029
|
+
sortingCellIcon: "_sortingCellIcon_1ull1_173",
|
|
5030
|
+
icon: "_icon_1ull1_184",
|
|
5031
|
+
checkBoxCell: "_checkBoxCell_1ull1_188",
|
|
5032
|
+
iconCellWrapper: "_iconCellWrapper_1ull1_192",
|
|
5033
|
+
actionsCell: "_actionsCell_1ull1_196",
|
|
5034
|
+
rightAligned: "_rightAligned_1ull1_204",
|
|
5035
|
+
centerAligned: "_centerAligned_1ull1_210",
|
|
5036
|
+
leftAligned: "_leftAligned_1ull1_216",
|
|
5037
|
+
popover: "_popover_1ull1_219",
|
|
5038
|
+
disabledPointerEvents: "_disabledPointerEvents_1ull1_222",
|
|
5039
|
+
standaloneCheckbox: "_standaloneCheckbox_1ull1_225"
|
|
4834
5040
|
};
|
|
4835
5041
|
//#endregion
|
|
4836
5042
|
//#region src/components/table/cell/cell-types/input-cell.tsx
|
|
@@ -4876,7 +5082,7 @@ var startsWithDecimal = (value) => value.startsWith(".");
|
|
|
4876
5082
|
* undoing deletion of the leading zero when editing values like 0.1 → 1.1.
|
|
4877
5083
|
*/
|
|
4878
5084
|
var preserveLeadingDecimalDraft = (rawInput, cleaned) => startsWithDecimal(rawInput) && cleaned === `0${rawInput}` ? rawInput : cleaned;
|
|
4879
|
-
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
|
|
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 }) => {
|
|
4880
5086
|
const validateInputValue = (value) => {
|
|
4881
5087
|
const validation = validateNumber(value);
|
|
4882
5088
|
const isPlaceholder = placeholder && isEmptyNullOrUndefined(value);
|
|
@@ -4988,9 +5194,7 @@ var NumberInput = ({ name, placeholder = "", disabled = false, error = false, le
|
|
|
4988
5194
|
selectOnFocus,
|
|
4989
5195
|
tabIndex,
|
|
4990
5196
|
tooltip,
|
|
4991
|
-
ref: inputRef
|
|
4992
|
-
leftSlot,
|
|
4993
|
-
rightSlot
|
|
5197
|
+
ref: inputRef
|
|
4994
5198
|
}, stringName);
|
|
4995
5199
|
};
|
|
4996
5200
|
//#endregion
|
|
@@ -5209,11 +5413,9 @@ var safeRoundNumbers = (value) => {
|
|
|
5209
5413
|
return !isScientificStringNum(value) ? roundByMagnitude(value) : value;
|
|
5210
5414
|
};
|
|
5211
5415
|
var unit_input_module_default = {
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
|
|
5215
|
-
predefinedMenuActive: "_predefinedMenuActive_1ogvr_13",
|
|
5216
|
-
isInTable: "_isInTable_1ogvr_16"
|
|
5416
|
+
predefinedMenuActive: "_predefinedMenuActive_13yll_1",
|
|
5417
|
+
inputWrapper: "_inputWrapper_13yll_4",
|
|
5418
|
+
isInTable: "_isInTable_13yll_9"
|
|
5217
5419
|
};
|
|
5218
5420
|
//#endregion
|
|
5219
5421
|
//#region src/components/unit-input/unit-input.tsx
|
|
@@ -5396,7 +5598,10 @@ var UnitInput = ({ name, placeholder = "", disabled = false, disabledUnit = fals
|
|
|
5396
5598
|
} });
|
|
5397
5599
|
}
|
|
5398
5600
|
},
|
|
5399
|
-
label: el.label,
|
|
5601
|
+
label: /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(Text, { children: el.label }), /* @__PURE__ */ jsx(Spacer, {
|
|
5602
|
+
width: "20px",
|
|
5603
|
+
height: "0"
|
|
5604
|
+
})] }),
|
|
5400
5605
|
description,
|
|
5401
5606
|
selected: foundPredefinedMenuOption === el && predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED
|
|
5402
5607
|
};
|
|
@@ -5431,92 +5636,100 @@ var UnitInput = ({ name, placeholder = "", disabled = false, disabledUnit = fals
|
|
|
5431
5636
|
}
|
|
5432
5637
|
return placeholder;
|
|
5433
5638
|
};
|
|
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;
|
|
5434
5648
|
return /* @__PURE__ */ jsx("div", {
|
|
5435
|
-
className: cx(
|
|
5436
|
-
|
|
5437
|
-
children: /* @__PURE__ */ jsx(NumberInput, {
|
|
5438
|
-
name: stringName,
|
|
5439
|
-
testId,
|
|
5440
|
-
disabled,
|
|
5441
|
-
placeholder: getPlaceholder(placeholder),
|
|
5442
|
-
value: displayLayer.value,
|
|
5443
|
-
onChange: onSetValue,
|
|
5444
|
-
onFocus,
|
|
5445
|
-
error: error === null ? void 0 : error,
|
|
5446
|
-
warning: warning === null ? void 0 : warning,
|
|
5447
|
-
left,
|
|
5448
|
-
allowEmpty: derivedAllowEmpty,
|
|
5449
|
-
validationCallback: (_name, error) => validationCallback(stringName, error),
|
|
5450
|
-
enableCosmeticRounding,
|
|
5451
|
-
enableDisplayRounding,
|
|
5452
|
-
roundDisplayValue,
|
|
5453
|
-
groupOrder,
|
|
5454
|
-
disableInternalErrorValidationMessages,
|
|
5649
|
+
className: cx(predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED && unit_input_module_default.predefinedMenuActive, isInTable && unit_input_module_default.isInTable),
|
|
5650
|
+
children: /* @__PURE__ */ jsxs(InputGroup, {
|
|
5455
5651
|
small,
|
|
5456
|
-
width
|
|
5652
|
+
width,
|
|
5457
5653
|
isInTable,
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5654
|
+
children: [
|
|
5655
|
+
predefinedOptions && /* @__PURE__ */ jsx(Menu, {
|
|
5656
|
+
maxHeight: 380,
|
|
5657
|
+
groupOrder: "first",
|
|
5658
|
+
testId: testId && `${testId}-predefined-menu`,
|
|
5659
|
+
disabled,
|
|
5660
|
+
menu: {
|
|
5661
|
+
colored: true,
|
|
5662
|
+
trigger: "Component",
|
|
5663
|
+
component: /* @__PURE__ */ jsx(Button, {
|
|
5664
|
+
groupOrder: "first",
|
|
5665
|
+
active: predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED,
|
|
5666
|
+
icon: predefinedOptionsMenuState === PredefinedOptionsMenuState.PREDEFINED ? "link" : "unlink",
|
|
5667
|
+
small
|
|
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,
|
|
5496
5701
|
small,
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5501
|
-
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5702
|
+
children: displayUnitLabel
|
|
5703
|
+
}) : /* @__PURE__ */ jsx(Menu, {
|
|
5704
|
+
groupOrder: unitGroupOrder,
|
|
5705
|
+
maxHeight: 380,
|
|
5706
|
+
disabled: disabledUnit,
|
|
5707
|
+
testId: testId && `${testId}-menu`,
|
|
5708
|
+
tabIndex: -1,
|
|
5709
|
+
menu: {
|
|
5710
|
+
label: displayUnitLabel,
|
|
5711
|
+
trigger: "DropDownButton",
|
|
5712
|
+
small,
|
|
5713
|
+
sections: alternativeUnits.map(([value = "", altUnit = "", label]) => {
|
|
5714
|
+
const displayUnit = label || altUnit || "";
|
|
5715
|
+
const safeValue = isValidNum(value) ? value : "";
|
|
5716
|
+
return {
|
|
5717
|
+
type: "Option",
|
|
5718
|
+
label: enableCosmeticRounding ? safeRoundNumbers(safeValue) : safeValue,
|
|
5719
|
+
inline: true,
|
|
5720
|
+
onClick: (evt) => {
|
|
5721
|
+
evt.stopPropagation();
|
|
5722
|
+
onClickUnit(value, altUnit);
|
|
5723
|
+
},
|
|
5724
|
+
description: displayUnit,
|
|
5725
|
+
selected: displayUnit === displayUnitLabel,
|
|
5726
|
+
testId: `${testId}-unit-${displayUnit}`
|
|
5727
|
+
};
|
|
5728
|
+
})
|
|
5729
|
+
}
|
|
5730
|
+
}))
|
|
5731
|
+
]
|
|
5732
|
+
})
|
|
5520
5733
|
});
|
|
5521
5734
|
};
|
|
5522
5735
|
//#endregion
|
|
@@ -6233,7 +6446,7 @@ var Row$1 = ({ row, rowIndex, isHeader = false, columnCount, colSpan, columnHead
|
|
|
6233
6446
|
]);
|
|
6234
6447
|
const rowRef = measureRef ? setMeasuredRowRef : !row.noDrag ? setNodeRef : null;
|
|
6235
6448
|
const style = {
|
|
6236
|
-
transform: !dropDisabled ? CSS.Translate.toString(transform) : void 0,
|
|
6449
|
+
transform: !dropDisabled ? CSS$1.Translate.toString(transform) : void 0,
|
|
6237
6450
|
height,
|
|
6238
6451
|
transition,
|
|
6239
6452
|
opacity: isDragging ? 0 : void 0
|
|
@@ -8710,7 +8923,7 @@ var ListRow = forwardRef(({ item, index, expanding, invokeEditOnRowClick, dragga
|
|
|
8710
8923
|
animateLayoutChanges: () => false
|
|
8711
8924
|
});
|
|
8712
8925
|
const style = {
|
|
8713
|
-
transform: CSS.Translate.toString(transform),
|
|
8926
|
+
transform: CSS$1.Translate.toString(transform),
|
|
8714
8927
|
transition,
|
|
8715
8928
|
opacity: isDragging ? 0 : 1
|
|
8716
8929
|
};
|
|
@@ -10216,7 +10429,7 @@ var Link$1 = ({ label, url, icon, onClick, active, disabled, testId, component:
|
|
|
10216
10429
|
};
|
|
10217
10430
|
//#endregion
|
|
10218
10431
|
//#region src/components/top-bar/element/element.tsx
|
|
10219
|
-
var Element = ({ element }) => {
|
|
10432
|
+
var Element$1 = ({ element }) => {
|
|
10220
10433
|
switch (element.type) {
|
|
10221
10434
|
case ElementType.LINK: return /* @__PURE__ */ jsx("div", {
|
|
10222
10435
|
className: top_bar_module_default.item,
|
|
@@ -10287,14 +10500,14 @@ var TopBar = ({ title, appSwitcher, content = [], contentRight = [], warning = "
|
|
|
10287
10500
|
version: title.version,
|
|
10288
10501
|
onClick: title.onClick
|
|
10289
10502
|
}), content.map((element, i) => {
|
|
10290
|
-
if (element) return /* @__PURE__ */ jsx(Element, { element }, i);
|
|
10503
|
+
if (element) return /* @__PURE__ */ jsx(Element$1, { element }, i);
|
|
10291
10504
|
return null;
|
|
10292
10505
|
})]
|
|
10293
10506
|
}),
|
|
10294
10507
|
/* @__PURE__ */ jsx("div", {
|
|
10295
10508
|
className: top_bar_module_default.right,
|
|
10296
10509
|
children: contentRight.map((element, i) => {
|
|
10297
|
-
if (element) return /* @__PURE__ */ jsx(Element, { element }, i);
|
|
10510
|
+
if (element) return /* @__PURE__ */ jsx(Element$1, { element }, i);
|
|
10298
10511
|
return null;
|
|
10299
10512
|
})
|
|
10300
10513
|
})
|