@xsolla/xui-multi-select 0.221.1 → 0.222.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/native/index.js +136 -54
- package/native/index.js.map +1 -1
- package/native/index.mjs +131 -49
- package/native/index.mjs.map +1 -1
- package/package.json +15 -8
- package/web/index.js +136 -54
- package/web/index.js.map +1 -1
- package/web/index.mjs +131 -49
- package/web/index.mjs.map +1 -1
package/web/index.js
CHANGED
|
@@ -101,7 +101,7 @@ function shouldForwardProp(key) {
|
|
|
101
101
|
function createFilteredElement(defaultTag) {
|
|
102
102
|
const Component = import_react.default.forwardRef(
|
|
103
103
|
({ children, elementType, ...props }, ref) => {
|
|
104
|
-
const
|
|
104
|
+
const Tag = elementType || defaultTag;
|
|
105
105
|
const htmlProps = {};
|
|
106
106
|
for (const key of Object.keys(props)) {
|
|
107
107
|
if (shouldForwardProp(key)) {
|
|
@@ -109,7 +109,7 @@ function createFilteredElement(defaultTag) {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
return import_react.default.createElement(
|
|
112
|
-
|
|
112
|
+
Tag,
|
|
113
113
|
{ ref, ...htmlProps },
|
|
114
114
|
children
|
|
115
115
|
);
|
|
@@ -406,19 +406,101 @@ var Icon = ({
|
|
|
406
406
|
var isWeb = true;
|
|
407
407
|
|
|
408
408
|
// src/MultiSelect.tsx
|
|
409
|
-
var
|
|
410
|
-
var
|
|
409
|
+
var import_xui_core4 = require("@xsolla/xui-core");
|
|
410
|
+
var import_xui_icons_base3 = require("@xsolla/xui-icons-base");
|
|
411
411
|
|
|
412
412
|
// src/MultiSelectControl.tsx
|
|
413
413
|
var import_react4 = require("react");
|
|
414
|
-
var
|
|
415
|
-
var
|
|
414
|
+
var import_xui_core3 = require("@xsolla/xui-core");
|
|
415
|
+
var import_xui_icons_base2 = require("@xsolla/xui-icons-base");
|
|
416
416
|
|
|
417
417
|
// src/useMultiSelectControl.tsx
|
|
418
418
|
var import_react3 = require("react");
|
|
419
|
-
var
|
|
419
|
+
var import_xui_core2 = require("@xsolla/xui-core");
|
|
420
|
+
|
|
421
|
+
// src/MultiSelectItem.tsx
|
|
420
422
|
var import_xui_core = require("@xsolla/xui-core");
|
|
423
|
+
var import_xui_icons_base = require("@xsolla/xui-icons-base");
|
|
421
424
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
425
|
+
var MultiSelectItem = ({
|
|
426
|
+
size = "md",
|
|
427
|
+
children,
|
|
428
|
+
onRemove,
|
|
429
|
+
disabled = false,
|
|
430
|
+
interactive = false,
|
|
431
|
+
testID,
|
|
432
|
+
themeMode,
|
|
433
|
+
themeProductContext
|
|
434
|
+
}) => {
|
|
435
|
+
const { theme } = (0, import_xui_core.useResolvedTheme)({ themeMode, themeProductContext });
|
|
436
|
+
const sizeStyles = theme.sizing.tag(size);
|
|
437
|
+
const chipColors = theme.colors.control.mono.secondary;
|
|
438
|
+
const inputColors = theme.colors.control.input;
|
|
439
|
+
const backgroundColor = disabled ? inputColors.bgDisable : chipColors.bg;
|
|
440
|
+
const contentColor = disabled ? inputColors.textDisable : theme.colors.content.primary;
|
|
441
|
+
const removeLabel = typeof children === "string" ? `Remove ${children}` : "Remove";
|
|
442
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
443
|
+
Box,
|
|
444
|
+
{
|
|
445
|
+
testID,
|
|
446
|
+
backgroundColor,
|
|
447
|
+
borderRadius: theme.shape.knob.lg.borderRadius,
|
|
448
|
+
height: sizeStyles.height,
|
|
449
|
+
paddingHorizontal: sizeStyles.padding,
|
|
450
|
+
flexDirection: "row",
|
|
451
|
+
alignItems: "center",
|
|
452
|
+
justifyContent: "center",
|
|
453
|
+
gap: sizeStyles.gap,
|
|
454
|
+
borderWidth: 0,
|
|
455
|
+
hoverStyle: interactive && !disabled ? { backgroundColor: chipColors.bgHover } : void 0,
|
|
456
|
+
style: {
|
|
457
|
+
overflow: "hidden",
|
|
458
|
+
textOverflow: "ellipsis",
|
|
459
|
+
whiteSpace: "nowrap"
|
|
460
|
+
},
|
|
461
|
+
children: [
|
|
462
|
+
children !== void 0 && children !== null && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
463
|
+
Text,
|
|
464
|
+
{
|
|
465
|
+
color: contentColor,
|
|
466
|
+
fontSize: sizeStyles.fontSize,
|
|
467
|
+
fontWeight: "500",
|
|
468
|
+
whiteSpace: "nowrap",
|
|
469
|
+
style: {
|
|
470
|
+
overflow: "hidden",
|
|
471
|
+
textOverflow: "ellipsis"
|
|
472
|
+
},
|
|
473
|
+
children
|
|
474
|
+
}
|
|
475
|
+
),
|
|
476
|
+
onRemove && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
477
|
+
Box,
|
|
478
|
+
{
|
|
479
|
+
role: "button",
|
|
480
|
+
"aria-label": removeLabel,
|
|
481
|
+
"aria-disabled": disabled || void 0,
|
|
482
|
+
alignItems: "center",
|
|
483
|
+
justifyContent: "center",
|
|
484
|
+
onPress: disabled ? void 0 : onRemove,
|
|
485
|
+
style: { cursor: disabled ? "not-allowed" : "pointer" },
|
|
486
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
487
|
+
import_xui_icons_base.Remove,
|
|
488
|
+
{
|
|
489
|
+
size: sizeStyles.iconSize,
|
|
490
|
+
color: contentColor,
|
|
491
|
+
variant: "line"
|
|
492
|
+
}
|
|
493
|
+
)
|
|
494
|
+
}
|
|
495
|
+
)
|
|
496
|
+
]
|
|
497
|
+
}
|
|
498
|
+
);
|
|
499
|
+
};
|
|
500
|
+
MultiSelectItem.displayName = "MultiSelectItem";
|
|
501
|
+
|
|
502
|
+
// src/useMultiSelectControl.tsx
|
|
503
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
422
504
|
var COUNT_ITEM_VALUE = "count-item";
|
|
423
505
|
var useMultiSelectControl = ({
|
|
424
506
|
variant,
|
|
@@ -434,7 +516,7 @@ var useMultiSelectControl = ({
|
|
|
434
516
|
themeMode,
|
|
435
517
|
themeProductContext
|
|
436
518
|
}) => {
|
|
437
|
-
const { theme } = (0,
|
|
519
|
+
const { theme } = (0, import_xui_core2.useResolvedTheme)({ themeMode, themeProductContext });
|
|
438
520
|
const displayStateRef = (0, import_react3.useRef)(0 /* Placeholder */);
|
|
439
521
|
const savedWidthsRef = (0, import_react3.useRef)(null);
|
|
440
522
|
const itemsRef = (0, import_react3.useRef)(null);
|
|
@@ -498,7 +580,7 @@ var useMultiSelectControl = ({
|
|
|
498
580
|
};
|
|
499
581
|
const setPlaceholder = () => {
|
|
500
582
|
setSelectedContent(
|
|
501
|
-
/* @__PURE__ */ (0,
|
|
583
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
502
584
|
Text,
|
|
503
585
|
{
|
|
504
586
|
color: theme.colors.control.input.placeholder,
|
|
@@ -551,7 +633,7 @@ var useMultiSelectControl = ({
|
|
|
551
633
|
const canRemove = !isCount && !isLocked;
|
|
552
634
|
const isReducable = index2 === 0 && displayStateRef.current === 3 /* Render */ && displayedItemsCount === 0 || flexible;
|
|
553
635
|
if (variant === "tag") {
|
|
554
|
-
return /* @__PURE__ */ (0,
|
|
636
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
555
637
|
Box,
|
|
556
638
|
{
|
|
557
639
|
onPress: canRemove ? (e) => {
|
|
@@ -560,14 +642,14 @@ var useMultiSelectControl = ({
|
|
|
560
642
|
} : void 0,
|
|
561
643
|
style: {
|
|
562
644
|
minWidth: isReducable ? 0 : "fit-content",
|
|
563
|
-
opacity: disabled ? 0.5 : 1,
|
|
564
645
|
cursor: isLocked ? "default" : disabled || isCount ? "not-allowed" : "pointer"
|
|
565
646
|
},
|
|
566
|
-
children: /* @__PURE__ */ (0,
|
|
567
|
-
|
|
647
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
648
|
+
MultiSelectItem,
|
|
568
649
|
{
|
|
569
650
|
size,
|
|
570
|
-
|
|
651
|
+
disabled,
|
|
652
|
+
interactive: canRemove,
|
|
571
653
|
onRemove: removeTagsButtons && canRemove ? (e) => {
|
|
572
654
|
e?.stopPropagation();
|
|
573
655
|
if (!disabled) removeValue(item.value, e);
|
|
@@ -581,7 +663,7 @@ var useMultiSelectControl = ({
|
|
|
581
663
|
}
|
|
582
664
|
const isCountItem = hasHidden;
|
|
583
665
|
const needsComma = index2 < displayedItems.length - 2 || index2 < displayedItems.length - 1 && !isCountItem;
|
|
584
|
-
return /* @__PURE__ */ (0,
|
|
666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
585
667
|
Text,
|
|
586
668
|
{
|
|
587
669
|
color: theme.colors.content.primary,
|
|
@@ -597,7 +679,7 @@ var useMultiSelectControl = ({
|
|
|
597
679
|
},
|
|
598
680
|
children: [
|
|
599
681
|
item.label,
|
|
600
|
-
needsComma ? "
|
|
682
|
+
needsComma ? ", " : " "
|
|
601
683
|
]
|
|
602
684
|
},
|
|
603
685
|
item.value
|
|
@@ -683,7 +765,7 @@ var useMultiSelectControl = ({
|
|
|
683
765
|
};
|
|
684
766
|
|
|
685
767
|
// src/MultiSelectControl.tsx
|
|
686
|
-
var
|
|
768
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
687
769
|
var MultiSelectControl = (0, import_react4.forwardRef)(
|
|
688
770
|
({
|
|
689
771
|
variant = "tag",
|
|
@@ -708,7 +790,7 @@ var MultiSelectControl = (0, import_react4.forwardRef)(
|
|
|
708
790
|
themeMode,
|
|
709
791
|
themeProductContext
|
|
710
792
|
}, ref) => {
|
|
711
|
-
const { theme } = (0,
|
|
793
|
+
const { theme } = (0, import_xui_core3.useResolvedTheme)({ themeMode, themeProductContext });
|
|
712
794
|
const sizeStyles = theme.sizing.input(size);
|
|
713
795
|
const inputColors = theme.colors.control.input;
|
|
714
796
|
const state = externalState || (disabled ? "disable" : "default");
|
|
@@ -743,7 +825,7 @@ var MultiSelectControl = (0, import_react4.forwardRef)(
|
|
|
743
825
|
borderColor = inputColors.borderHover;
|
|
744
826
|
}
|
|
745
827
|
const iconColor = isDisable ? inputColors.textDisable : inputColors.placeholder;
|
|
746
|
-
return /* @__PURE__ */ (0,
|
|
828
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
747
829
|
Box,
|
|
748
830
|
{
|
|
749
831
|
ref,
|
|
@@ -771,7 +853,7 @@ var MultiSelectControl = (0, import_react4.forwardRef)(
|
|
|
771
853
|
borderColor: inputColors.borderHover
|
|
772
854
|
} : void 0,
|
|
773
855
|
children: [
|
|
774
|
-
/* @__PURE__ */ (0,
|
|
856
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(
|
|
775
857
|
Box,
|
|
776
858
|
{
|
|
777
859
|
ref: containerRef,
|
|
@@ -781,8 +863,8 @@ var MultiSelectControl = (0, import_react4.forwardRef)(
|
|
|
781
863
|
gap: 8,
|
|
782
864
|
style: { minWidth: 0 },
|
|
783
865
|
children: [
|
|
784
|
-
iconLeft && /* @__PURE__ */ (0,
|
|
785
|
-
/* @__PURE__ */ (0,
|
|
866
|
+
iconLeft && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(Icon, { size: sizeStyles.iconSize, color: iconColor, variant: "line", children: iconLeft }),
|
|
867
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
786
868
|
Box,
|
|
787
869
|
{
|
|
788
870
|
ref: itemsRef,
|
|
@@ -798,8 +880,8 @@ var MultiSelectControl = (0, import_react4.forwardRef)(
|
|
|
798
880
|
]
|
|
799
881
|
}
|
|
800
882
|
),
|
|
801
|
-
/* @__PURE__ */ (0,
|
|
802
|
-
extraClear && selectedItems.length > 0 && !isDisable && /* @__PURE__ */ (0,
|
|
883
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Box, { flexDirection: "row", alignItems: "center", gap: 4, children: [
|
|
884
|
+
extraClear && selectedItems.length > 0 && !isDisable && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
803
885
|
Box,
|
|
804
886
|
{
|
|
805
887
|
onPress: (e) => {
|
|
@@ -807,11 +889,11 @@ var MultiSelectControl = (0, import_react4.forwardRef)(
|
|
|
807
889
|
removeAllValues();
|
|
808
890
|
},
|
|
809
891
|
style: { cursor: "pointer" },
|
|
810
|
-
children: /* @__PURE__ */ (0,
|
|
892
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_xui_icons_base2.Remove, { size: 18, color: iconColor, variant: "line" })
|
|
811
893
|
}
|
|
812
894
|
),
|
|
813
|
-
isError && /* @__PURE__ */ (0,
|
|
814
|
-
iconRight ? iconRight : isOpen ? /* @__PURE__ */ (0,
|
|
895
|
+
isError && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_xui_icons_base2.ExclamationMarkCr, { size: 18, color: theme.colors.content.alert.primary }),
|
|
896
|
+
iconRight ? iconRight : isOpen ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_xui_icons_base2.ChevronUp, { size: 18, color: iconColor, variant: "line" }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_xui_icons_base2.ChevronDown, { size: 18, color: iconColor, variant: "line" })
|
|
815
897
|
] })
|
|
816
898
|
]
|
|
817
899
|
}
|
|
@@ -939,7 +1021,7 @@ var Portal = ({ children }) => {
|
|
|
939
1021
|
};
|
|
940
1022
|
|
|
941
1023
|
// src/MultiSelect.tsx
|
|
942
|
-
var
|
|
1024
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
943
1025
|
var EXTERNAL_MENU_MIN_WIDTH_DEFAULT = 540;
|
|
944
1026
|
var SEARCH_ROW_HEIGHT = 60;
|
|
945
1027
|
var SELECT_ALL_ROW_HEIGHT = 37;
|
|
@@ -976,9 +1058,9 @@ var MultiSelect = (0, import_react7.forwardRef)(
|
|
|
976
1058
|
themeMode,
|
|
977
1059
|
themeProductContext
|
|
978
1060
|
}, ref) => {
|
|
979
|
-
const { theme } = (0,
|
|
980
|
-
const modalId = (0,
|
|
981
|
-
const overlayLayer = (0,
|
|
1061
|
+
const { theme } = (0, import_xui_core4.useResolvedTheme)({ themeMode, themeProductContext });
|
|
1062
|
+
const modalId = (0, import_xui_core4.useModalId)();
|
|
1063
|
+
const overlayLayer = (0, import_xui_core4.useOverlayLayer)();
|
|
982
1064
|
const controlRef = (0, import_react7.useRef)(null);
|
|
983
1065
|
const menuRef = (0, import_react7.useRef)(null);
|
|
984
1066
|
const containerRef = (0, import_react7.useRef)(null);
|
|
@@ -1112,8 +1194,8 @@ var MultiSelect = (0, import_react7.forwardRef)(
|
|
|
1112
1194
|
minWidth: menuMinWidth ?? EXTERNAL_MENU_MIN_WIDTH_DEFAULT,
|
|
1113
1195
|
boxSizing: "border-box"
|
|
1114
1196
|
} : void 0;
|
|
1115
|
-
const dropdown = dropdownMenu && isOpen && !isDisable && (!isWeb || menuPosition) && /* @__PURE__ */ (0,
|
|
1116
|
-
!isWeb && /* @__PURE__ */ (0,
|
|
1197
|
+
const dropdown = dropdownMenu && isOpen && !isDisable && (!isWeb || menuPosition) && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
1198
|
+
!isWeb && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1117
1199
|
Box,
|
|
1118
1200
|
{
|
|
1119
1201
|
"data-modal-id": modalId,
|
|
@@ -1123,13 +1205,13 @@ var MultiSelect = (0, import_react7.forwardRef)(
|
|
|
1123
1205
|
left: 0,
|
|
1124
1206
|
right: 0,
|
|
1125
1207
|
bottom: 0,
|
|
1126
|
-
zIndex: overlayLayer +
|
|
1208
|
+
zIndex: overlayLayer + import_xui_core4.LAYER_OFFSET.menu,
|
|
1127
1209
|
cursor: "default"
|
|
1128
1210
|
},
|
|
1129
1211
|
onPress: onClose
|
|
1130
1212
|
}
|
|
1131
1213
|
),
|
|
1132
|
-
/* @__PURE__ */ (0,
|
|
1214
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1133
1215
|
Box,
|
|
1134
1216
|
{
|
|
1135
1217
|
ref: menuRef,
|
|
@@ -1148,18 +1230,18 @@ var MultiSelect = (0, import_react7.forwardRef)(
|
|
|
1148
1230
|
right: isWeb ? void 0 : 0,
|
|
1149
1231
|
width: isWeb ? menuPosition?.width : void 0,
|
|
1150
1232
|
marginTop: isWeb ? void 0 : 4,
|
|
1151
|
-
zIndex: overlayLayer +
|
|
1233
|
+
zIndex: overlayLayer + import_xui_core4.LAYER_OFFSET.popover,
|
|
1152
1234
|
boxShadow: theme.shadow.popover
|
|
1153
1235
|
},
|
|
1154
1236
|
children: [
|
|
1155
|
-
searchable && isWeb && /* @__PURE__ */ (0,
|
|
1237
|
+
searchable && isWeb && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1156
1238
|
Box,
|
|
1157
1239
|
{
|
|
1158
1240
|
paddingHorizontal: sizeStyles.paddingHorizontal,
|
|
1159
1241
|
paddingVertical: sizeStyles.paddingVertical,
|
|
1160
1242
|
borderBottomWidth: 1,
|
|
1161
1243
|
borderColor: theme.colors.border.secondary,
|
|
1162
|
-
children: /* @__PURE__ */ (0,
|
|
1244
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1163
1245
|
Box,
|
|
1164
1246
|
{
|
|
1165
1247
|
flexDirection: "row",
|
|
@@ -1167,15 +1249,15 @@ var MultiSelect = (0, import_react7.forwardRef)(
|
|
|
1167
1249
|
gap: sizeStyles.paddingHorizontal / 2,
|
|
1168
1250
|
paddingHorizontal: 4,
|
|
1169
1251
|
children: [
|
|
1170
|
-
/* @__PURE__ */ (0,
|
|
1252
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1171
1253
|
Icon,
|
|
1172
1254
|
{
|
|
1173
1255
|
size: sizeStyles.iconSize - 2,
|
|
1174
1256
|
color: inputColors.placeholder,
|
|
1175
|
-
children: /* @__PURE__ */ (0,
|
|
1257
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_xui_icons_base3.Search, {})
|
|
1176
1258
|
}
|
|
1177
1259
|
),
|
|
1178
|
-
/* @__PURE__ */ (0,
|
|
1260
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1179
1261
|
Box,
|
|
1180
1262
|
{
|
|
1181
1263
|
as: "input",
|
|
@@ -1202,7 +1284,7 @@ var MultiSelect = (0, import_react7.forwardRef)(
|
|
|
1202
1284
|
)
|
|
1203
1285
|
}
|
|
1204
1286
|
),
|
|
1205
|
-
showSelectAll && /* @__PURE__ */ (0,
|
|
1287
|
+
showSelectAll && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1206
1288
|
Box,
|
|
1207
1289
|
{
|
|
1208
1290
|
role: "button",
|
|
@@ -1219,7 +1301,7 @@ var MultiSelect = (0, import_react7.forwardRef)(
|
|
|
1219
1301
|
backgroundColor: theme.colors.control.input.bgHover
|
|
1220
1302
|
},
|
|
1221
1303
|
style: { cursor: "pointer" },
|
|
1222
|
-
children: /* @__PURE__ */ (0,
|
|
1304
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1223
1305
|
Text,
|
|
1224
1306
|
{
|
|
1225
1307
|
color: theme.colors.content.brand.primary,
|
|
@@ -1231,7 +1313,7 @@ var MultiSelect = (0, import_react7.forwardRef)(
|
|
|
1231
1313
|
)
|
|
1232
1314
|
}
|
|
1233
1315
|
),
|
|
1234
|
-
/* @__PURE__ */ (0,
|
|
1316
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1235
1317
|
Box,
|
|
1236
1318
|
{
|
|
1237
1319
|
paddingVertical: 4,
|
|
@@ -1241,13 +1323,13 @@ var MultiSelect = (0, import_react7.forwardRef)(
|
|
|
1241
1323
|
overflowX: optionListOverflowX,
|
|
1242
1324
|
scrollbarWidth: "none"
|
|
1243
1325
|
},
|
|
1244
|
-
children: menuItems.length === 0 ? /* @__PURE__ */ (0,
|
|
1326
|
+
children: menuItems.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1245
1327
|
Box,
|
|
1246
1328
|
{
|
|
1247
1329
|
paddingVertical: sizeStyles.paddingVertical * 2,
|
|
1248
1330
|
paddingHorizontal: sizeStyles.paddingHorizontal,
|
|
1249
1331
|
alignItems: "center",
|
|
1250
|
-
children: /* @__PURE__ */ (0,
|
|
1332
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1251
1333
|
Text,
|
|
1252
1334
|
{
|
|
1253
1335
|
color: theme.colors.content.tertiary,
|
|
@@ -1260,7 +1342,7 @@ var MultiSelect = (0, import_react7.forwardRef)(
|
|
|
1260
1342
|
const brandColors = theme.colors.control.brand.primary;
|
|
1261
1343
|
const contentColors = theme.colors.content;
|
|
1262
1344
|
const isInert = item.locked && item.checked;
|
|
1263
|
-
return /* @__PURE__ */ (0,
|
|
1345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1264
1346
|
Box,
|
|
1265
1347
|
{
|
|
1266
1348
|
testID,
|
|
@@ -1283,7 +1365,7 @@ var MultiSelect = (0, import_react7.forwardRef)(
|
|
|
1283
1365
|
opacity: item.disabled ? 0.5 : 1,
|
|
1284
1366
|
minWidth: optionRowMinWidth
|
|
1285
1367
|
},
|
|
1286
|
-
children: /* @__PURE__ */ (0,
|
|
1368
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1287
1369
|
Text,
|
|
1288
1370
|
{
|
|
1289
1371
|
color: item.checked ? contentColors.on.brand : theme.colors.content.secondary,
|
|
@@ -1304,7 +1386,7 @@ var MultiSelect = (0, import_react7.forwardRef)(
|
|
|
1304
1386
|
}
|
|
1305
1387
|
)
|
|
1306
1388
|
] });
|
|
1307
|
-
return /* @__PURE__ */ (0,
|
|
1389
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1308
1390
|
Box,
|
|
1309
1391
|
{
|
|
1310
1392
|
ref: containerRef,
|
|
@@ -1313,7 +1395,7 @@ var MultiSelect = (0, import_react7.forwardRef)(
|
|
|
1313
1395
|
gap: sizeStyles.fieldGap,
|
|
1314
1396
|
style: externalFieldLayout,
|
|
1315
1397
|
children: [
|
|
1316
|
-
label && /* @__PURE__ */ (0,
|
|
1398
|
+
label && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1317
1399
|
Text,
|
|
1318
1400
|
{
|
|
1319
1401
|
color: theme.colors.content.secondary,
|
|
@@ -1322,7 +1404,7 @@ var MultiSelect = (0, import_react7.forwardRef)(
|
|
|
1322
1404
|
children: label
|
|
1323
1405
|
}
|
|
1324
1406
|
),
|
|
1325
|
-
/* @__PURE__ */ (0,
|
|
1407
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
1326
1408
|
Box,
|
|
1327
1409
|
{
|
|
1328
1410
|
ref,
|
|
@@ -1331,7 +1413,7 @@ var MultiSelect = (0, import_react7.forwardRef)(
|
|
|
1331
1413
|
...externalFieldLayout ? { width: "100%" } : {}
|
|
1332
1414
|
},
|
|
1333
1415
|
children: [
|
|
1334
|
-
/* @__PURE__ */ (0,
|
|
1416
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1335
1417
|
MultiSelectControl,
|
|
1336
1418
|
{
|
|
1337
1419
|
ref: controlRef,
|
|
@@ -1356,11 +1438,11 @@ var MultiSelect = (0, import_react7.forwardRef)(
|
|
|
1356
1438
|
extraClear
|
|
1357
1439
|
}
|
|
1358
1440
|
),
|
|
1359
|
-
isWeb ? /* @__PURE__ */ (0,
|
|
1441
|
+
isWeb ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Portal, { children: dropdown }) : dropdown
|
|
1360
1442
|
]
|
|
1361
1443
|
}
|
|
1362
1444
|
),
|
|
1363
|
-
errorMessage && /* @__PURE__ */ (0,
|
|
1445
|
+
errorMessage && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
1364
1446
|
Text,
|
|
1365
1447
|
{
|
|
1366
1448
|
color: theme.colors.content.alert.primary,
|