@xsolla/xui-multi-select 0.133.0 → 0.134.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/native/index.js +35 -243
- package/native/index.js.map +1 -1
- package/native/index.mjs +7 -215
- package/native/index.mjs.map +1 -1
- package/package.json +5 -5
- package/web/index.js +35 -243
- package/web/index.js.map +1 -1
- package/web/index.mjs +7 -215
- package/web/index.mjs.map +1 -1
package/native/index.js
CHANGED
|
@@ -35,7 +35,7 @@ __export(index_exports, {
|
|
|
35
35
|
module.exports = __toCommonJS(index_exports);
|
|
36
36
|
|
|
37
37
|
// src/MultiSelect.tsx
|
|
38
|
-
var
|
|
38
|
+
var import_react8 = require("react");
|
|
39
39
|
|
|
40
40
|
// ../primitives-native/src/Box.tsx
|
|
41
41
|
var import_react_native = require("react-native");
|
|
@@ -302,7 +302,7 @@ var Icon = ({ children, color, size }) => {
|
|
|
302
302
|
var import_xui_core4 = require("@xsolla/xui-core");
|
|
303
303
|
|
|
304
304
|
// src/MultiSelectControl.tsx
|
|
305
|
-
var
|
|
305
|
+
var import_react6 = require("react");
|
|
306
306
|
var import_xui_core3 = require("@xsolla/xui-core");
|
|
307
307
|
|
|
308
308
|
// ../icons-base/dist/web/index.mjs
|
|
@@ -750,12 +750,11 @@ var lineContent113 = `<svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.
|
|
|
750
750
|
var Remove = (props) => /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(BaseIcon, { ...props, solidContent: solidContent113, lineContent: lineContent113 });
|
|
751
751
|
|
|
752
752
|
// src/useMultiSelectControl.tsx
|
|
753
|
-
var
|
|
753
|
+
var import_react5 = require("react");
|
|
754
754
|
|
|
755
755
|
// ../tag/dist/web/index.mjs
|
|
756
|
-
var
|
|
756
|
+
var import_react4 = __toESM(require("react"), 1);
|
|
757
757
|
var import_styled_components3 = __toESM(require("styled-components"), 1);
|
|
758
|
-
var import_react6 = __toESM(require("react"), 1);
|
|
759
758
|
var import_jsx_runtime393 = require("react/jsx-runtime");
|
|
760
759
|
var import_styled_components4 = __toESM(require("styled-components"), 1);
|
|
761
760
|
var import_jsx_runtime394 = require("react/jsx-runtime");
|
|
@@ -764,7 +763,6 @@ var import_jsx_runtime395 = require("react/jsx-runtime");
|
|
|
764
763
|
var import_xui_core = require("@xsolla/xui-core");
|
|
765
764
|
|
|
766
765
|
// ../icons/dist/web/index.mjs
|
|
767
|
-
var import_react4 = __toESM(require("react"), 1);
|
|
768
766
|
var import_styled_components2 = __toESM(require("styled-components"), 1);
|
|
769
767
|
var import_jsx_runtime391 = require("react/jsx-runtime");
|
|
770
768
|
|
|
@@ -847,109 +845,7 @@ var X = createLucideIcon("X", [
|
|
|
847
845
|
|
|
848
846
|
// ../icons/dist/web/index.mjs
|
|
849
847
|
var import_jsx_runtime392 = require("react/jsx-runtime");
|
|
850
|
-
var
|
|
851
|
-
// BoxProps — layout & styling
|
|
852
|
-
"backgroundColor",
|
|
853
|
-
"borderColor",
|
|
854
|
-
"borderWidth",
|
|
855
|
-
"borderBottomWidth",
|
|
856
|
-
"borderBottomColor",
|
|
857
|
-
"borderTopWidth",
|
|
858
|
-
"borderTopColor",
|
|
859
|
-
"borderLeftWidth",
|
|
860
|
-
"borderLeftColor",
|
|
861
|
-
"borderRightWidth",
|
|
862
|
-
"borderRightColor",
|
|
863
|
-
"borderRadius",
|
|
864
|
-
"borderStyle",
|
|
865
|
-
"flexDirection",
|
|
866
|
-
"flexWrap",
|
|
867
|
-
"alignItems",
|
|
868
|
-
"justifyContent",
|
|
869
|
-
"alignSelf",
|
|
870
|
-
"flex",
|
|
871
|
-
"flexShrink",
|
|
872
|
-
"gap",
|
|
873
|
-
"position",
|
|
874
|
-
"top",
|
|
875
|
-
"bottom",
|
|
876
|
-
"left",
|
|
877
|
-
"right",
|
|
878
|
-
"outline",
|
|
879
|
-
"overflow",
|
|
880
|
-
"overflowX",
|
|
881
|
-
"overflowY",
|
|
882
|
-
"zIndex",
|
|
883
|
-
"cursor",
|
|
884
|
-
"padding",
|
|
885
|
-
"paddingHorizontal",
|
|
886
|
-
"paddingVertical",
|
|
887
|
-
"paddingTop",
|
|
888
|
-
"paddingBottom",
|
|
889
|
-
"paddingLeft",
|
|
890
|
-
"paddingRight",
|
|
891
|
-
"margin",
|
|
892
|
-
"marginTop",
|
|
893
|
-
"marginBottom",
|
|
894
|
-
"marginLeft",
|
|
895
|
-
"marginRight",
|
|
896
|
-
"minWidth",
|
|
897
|
-
"minHeight",
|
|
898
|
-
"maxWidth",
|
|
899
|
-
"maxHeight",
|
|
900
|
-
"hoverStyle",
|
|
901
|
-
"pressStyle",
|
|
902
|
-
"focusStyle",
|
|
903
|
-
"outlineColor",
|
|
904
|
-
"outlineWidth",
|
|
905
|
-
"outlineOffset",
|
|
906
|
-
"outlineStyle",
|
|
907
|
-
// BoxProps — RN-only
|
|
908
|
-
"onPress",
|
|
909
|
-
"onLayout",
|
|
910
|
-
"onMoveShouldSetResponder",
|
|
911
|
-
"onResponderGrant",
|
|
912
|
-
"onResponderMove",
|
|
913
|
-
"onResponderRelease",
|
|
914
|
-
"onResponderTerminate",
|
|
915
|
-
"testID",
|
|
916
|
-
// Box — custom element type
|
|
917
|
-
"elementType",
|
|
918
|
-
// TextProps
|
|
919
|
-
"fontSize",
|
|
920
|
-
"fontWeight",
|
|
921
|
-
"fontFamily",
|
|
922
|
-
"lineHeight",
|
|
923
|
-
"whiteSpace",
|
|
924
|
-
"textAlign",
|
|
925
|
-
"textDecoration",
|
|
926
|
-
"numberOfLines",
|
|
927
|
-
"letterSpacing",
|
|
928
|
-
"textTransform",
|
|
929
|
-
// SpinnerProps
|
|
930
|
-
"strokeWidth",
|
|
931
|
-
// DividerProps
|
|
932
|
-
"vertical",
|
|
933
|
-
"dashStroke"
|
|
934
|
-
]);
|
|
935
|
-
function createFilteredElement(defaultTag) {
|
|
936
|
-
const Component = import_react4.default.forwardRef(
|
|
937
|
-
({ children, elementType, ...props }, ref) => {
|
|
938
|
-
const Tag2 = elementType || defaultTag;
|
|
939
|
-
const htmlProps = {};
|
|
940
|
-
for (const key of Object.keys(props)) {
|
|
941
|
-
if (!NON_HTML_PROPS.has(key)) {
|
|
942
|
-
htmlProps[key] = props[key];
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
return import_react4.default.createElement(Tag2, { ref, ...htmlProps }, children);
|
|
946
|
-
}
|
|
947
|
-
);
|
|
948
|
-
Component.displayName = `Filtered(${defaultTag})`;
|
|
949
|
-
return Component;
|
|
950
|
-
}
|
|
951
|
-
var FilteredDiv = createFilteredElement("div");
|
|
952
|
-
var StyledIcon2 = (0, import_styled_components2.default)(FilteredDiv)`
|
|
848
|
+
var StyledIcon2 = import_styled_components2.default.div`
|
|
953
849
|
display: flex;
|
|
954
850
|
align-items: center;
|
|
955
851
|
justify-content: center;
|
|
@@ -971,109 +867,7 @@ var X2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime392.jsx)(Icon3, { ...p
|
|
|
971
867
|
|
|
972
868
|
// ../tag/dist/web/index.mjs
|
|
973
869
|
var import_jsx_runtime396 = require("react/jsx-runtime");
|
|
974
|
-
var
|
|
975
|
-
// BoxProps — layout & styling
|
|
976
|
-
"backgroundColor",
|
|
977
|
-
"borderColor",
|
|
978
|
-
"borderWidth",
|
|
979
|
-
"borderBottomWidth",
|
|
980
|
-
"borderBottomColor",
|
|
981
|
-
"borderTopWidth",
|
|
982
|
-
"borderTopColor",
|
|
983
|
-
"borderLeftWidth",
|
|
984
|
-
"borderLeftColor",
|
|
985
|
-
"borderRightWidth",
|
|
986
|
-
"borderRightColor",
|
|
987
|
-
"borderRadius",
|
|
988
|
-
"borderStyle",
|
|
989
|
-
"flexDirection",
|
|
990
|
-
"flexWrap",
|
|
991
|
-
"alignItems",
|
|
992
|
-
"justifyContent",
|
|
993
|
-
"alignSelf",
|
|
994
|
-
"flex",
|
|
995
|
-
"flexShrink",
|
|
996
|
-
"gap",
|
|
997
|
-
"position",
|
|
998
|
-
"top",
|
|
999
|
-
"bottom",
|
|
1000
|
-
"left",
|
|
1001
|
-
"right",
|
|
1002
|
-
"outline",
|
|
1003
|
-
"overflow",
|
|
1004
|
-
"overflowX",
|
|
1005
|
-
"overflowY",
|
|
1006
|
-
"zIndex",
|
|
1007
|
-
"cursor",
|
|
1008
|
-
"padding",
|
|
1009
|
-
"paddingHorizontal",
|
|
1010
|
-
"paddingVertical",
|
|
1011
|
-
"paddingTop",
|
|
1012
|
-
"paddingBottom",
|
|
1013
|
-
"paddingLeft",
|
|
1014
|
-
"paddingRight",
|
|
1015
|
-
"margin",
|
|
1016
|
-
"marginTop",
|
|
1017
|
-
"marginBottom",
|
|
1018
|
-
"marginLeft",
|
|
1019
|
-
"marginRight",
|
|
1020
|
-
"minWidth",
|
|
1021
|
-
"minHeight",
|
|
1022
|
-
"maxWidth",
|
|
1023
|
-
"maxHeight",
|
|
1024
|
-
"hoverStyle",
|
|
1025
|
-
"pressStyle",
|
|
1026
|
-
"focusStyle",
|
|
1027
|
-
"outlineColor",
|
|
1028
|
-
"outlineWidth",
|
|
1029
|
-
"outlineOffset",
|
|
1030
|
-
"outlineStyle",
|
|
1031
|
-
// BoxProps — RN-only
|
|
1032
|
-
"onPress",
|
|
1033
|
-
"onLayout",
|
|
1034
|
-
"onMoveShouldSetResponder",
|
|
1035
|
-
"onResponderGrant",
|
|
1036
|
-
"onResponderMove",
|
|
1037
|
-
"onResponderRelease",
|
|
1038
|
-
"onResponderTerminate",
|
|
1039
|
-
"testID",
|
|
1040
|
-
// Box — custom element type
|
|
1041
|
-
"elementType",
|
|
1042
|
-
// TextProps
|
|
1043
|
-
"fontSize",
|
|
1044
|
-
"fontWeight",
|
|
1045
|
-
"fontFamily",
|
|
1046
|
-
"lineHeight",
|
|
1047
|
-
"whiteSpace",
|
|
1048
|
-
"textAlign",
|
|
1049
|
-
"textDecoration",
|
|
1050
|
-
"numberOfLines",
|
|
1051
|
-
"letterSpacing",
|
|
1052
|
-
"textTransform",
|
|
1053
|
-
// SpinnerProps
|
|
1054
|
-
"strokeWidth",
|
|
1055
|
-
// DividerProps
|
|
1056
|
-
"vertical",
|
|
1057
|
-
"dashStroke"
|
|
1058
|
-
]);
|
|
1059
|
-
function createFilteredElement2(defaultTag) {
|
|
1060
|
-
const Component = import_react6.default.forwardRef(
|
|
1061
|
-
({ children, elementType, ...props }, ref) => {
|
|
1062
|
-
const Tag2 = elementType || defaultTag;
|
|
1063
|
-
const htmlProps = {};
|
|
1064
|
-
for (const key of Object.keys(props)) {
|
|
1065
|
-
if (!NON_HTML_PROPS2.has(key)) {
|
|
1066
|
-
htmlProps[key] = props[key];
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
return import_react6.default.createElement(Tag2, { ref, ...htmlProps }, children);
|
|
1070
|
-
}
|
|
1071
|
-
);
|
|
1072
|
-
Component.displayName = `Filtered(${defaultTag})`;
|
|
1073
|
-
return Component;
|
|
1074
|
-
}
|
|
1075
|
-
var FilteredDiv2 = createFilteredElement2("div");
|
|
1076
|
-
var StyledBox = (0, import_styled_components3.default)(FilteredDiv2)`
|
|
870
|
+
var StyledBox = import_styled_components3.default.div`
|
|
1077
871
|
display: flex;
|
|
1078
872
|
box-sizing: border-box;
|
|
1079
873
|
background-color: ${(props) => props.backgroundColor || "transparent"};
|
|
@@ -1160,7 +954,7 @@ var StyledBox = (0, import_styled_components3.default)(FilteredDiv2)`
|
|
|
1160
954
|
${(props) => props.pressStyle?.backgroundColor && `background-color: ${props.pressStyle.backgroundColor};`}
|
|
1161
955
|
}
|
|
1162
956
|
`;
|
|
1163
|
-
var Box2 =
|
|
957
|
+
var Box2 = import_react4.default.forwardRef(
|
|
1164
958
|
({
|
|
1165
959
|
children,
|
|
1166
960
|
onPress,
|
|
@@ -1212,7 +1006,7 @@ var Box2 = import_react5.default.forwardRef(
|
|
|
1212
1006
|
StyledBox,
|
|
1213
1007
|
{
|
|
1214
1008
|
ref,
|
|
1215
|
-
|
|
1009
|
+
as,
|
|
1216
1010
|
id,
|
|
1217
1011
|
type: as === "button" ? type || "button" : void 0,
|
|
1218
1012
|
disabled: as === "button" ? disabled : void 0,
|
|
@@ -1239,8 +1033,7 @@ var Box2 = import_react5.default.forwardRef(
|
|
|
1239
1033
|
}
|
|
1240
1034
|
);
|
|
1241
1035
|
Box2.displayName = "Box";
|
|
1242
|
-
var
|
|
1243
|
-
var StyledText = (0, import_styled_components4.default)(FilteredSpan)`
|
|
1036
|
+
var StyledText = import_styled_components4.default.span`
|
|
1244
1037
|
color: ${(props) => props.color || "inherit"};
|
|
1245
1038
|
font-size: ${(props) => typeof props.fontSize === "number" ? `${props.fontSize}px` : props.fontSize || "inherit"};
|
|
1246
1039
|
font-weight: ${(props) => props.fontWeight || "normal"};
|
|
@@ -1269,8 +1062,7 @@ var Text2 = ({
|
|
|
1269
1062
|
}
|
|
1270
1063
|
);
|
|
1271
1064
|
};
|
|
1272
|
-
var
|
|
1273
|
-
var StyledIcon3 = (0, import_styled_components5.default)(FilteredDiv22)`
|
|
1065
|
+
var StyledIcon3 = import_styled_components5.default.div`
|
|
1274
1066
|
display: flex;
|
|
1275
1067
|
align-items: center;
|
|
1276
1068
|
justify-content: center;
|
|
@@ -1442,15 +1234,15 @@ var useMultiSelectControl = ({
|
|
|
1442
1234
|
themeProductContext
|
|
1443
1235
|
}) => {
|
|
1444
1236
|
const { theme } = (0, import_xui_core2.useResolvedTheme)({ themeMode, themeProductContext });
|
|
1445
|
-
const displayStateRef = (0,
|
|
1446
|
-
const savedWidthsRef = (0,
|
|
1447
|
-
const itemsRef = (0,
|
|
1448
|
-
const [itemsWidth, setItemsWidth] = (0,
|
|
1449
|
-
const [selectedContent, setSelectedContent] = (0,
|
|
1237
|
+
const displayStateRef = (0, import_react5.useRef)(0 /* Placeholder */);
|
|
1238
|
+
const savedWidthsRef = (0, import_react5.useRef)(null);
|
|
1239
|
+
const itemsRef = (0, import_react5.useRef)(null);
|
|
1240
|
+
const [itemsWidth, setItemsWidth] = (0, import_react5.useState)(0);
|
|
1241
|
+
const [selectedContent, setSelectedContent] = (0, import_react5.useState)(
|
|
1450
1242
|
null
|
|
1451
1243
|
);
|
|
1452
1244
|
const isPlaceholder = !selectedItems || selectedItems.length === 0;
|
|
1453
|
-
(0,
|
|
1245
|
+
(0, import_react5.useEffect)(() => {
|
|
1454
1246
|
if (!containerRef.current) return;
|
|
1455
1247
|
const resizeObserver = new ResizeObserver((entries) => {
|
|
1456
1248
|
for (const entry of entries) {
|
|
@@ -1460,7 +1252,7 @@ var useMultiSelectControl = ({
|
|
|
1460
1252
|
resizeObserver.observe(containerRef.current);
|
|
1461
1253
|
return () => resizeObserver.disconnect();
|
|
1462
1254
|
}, [containerRef]);
|
|
1463
|
-
const widthsDependencies = (0,
|
|
1255
|
+
const widthsDependencies = (0, import_react5.useMemo)(
|
|
1464
1256
|
() => ({
|
|
1465
1257
|
stateList: stateList.map((item) => item.value),
|
|
1466
1258
|
variant,
|
|
@@ -1618,7 +1410,7 @@ var useMultiSelectControl = ({
|
|
|
1618
1410
|
displayStateRef.current = 3 /* Render */;
|
|
1619
1411
|
setItemsRender();
|
|
1620
1412
|
};
|
|
1621
|
-
(0,
|
|
1413
|
+
(0, import_react5.useEffect)(() => {
|
|
1622
1414
|
if (isPlaceholder) {
|
|
1623
1415
|
displayStateRef.current = 0 /* Placeholder */;
|
|
1624
1416
|
setPlaceholder();
|
|
@@ -1652,7 +1444,7 @@ var useMultiSelectControl = ({
|
|
|
1652
1444
|
widthsDependencies,
|
|
1653
1445
|
stateList
|
|
1654
1446
|
]);
|
|
1655
|
-
(0,
|
|
1447
|
+
(0, import_react5.useEffect)(() => {
|
|
1656
1448
|
if (displayStateRef.current !== 2 /* Calculation */) return;
|
|
1657
1449
|
const rafId = requestAnimationFrame(() => {
|
|
1658
1450
|
if (displayStateRef.current === 2 /* Calculation */) {
|
|
@@ -1671,7 +1463,7 @@ var useMultiSelectControl = ({
|
|
|
1671
1463
|
|
|
1672
1464
|
// src/MultiSelectControl.tsx
|
|
1673
1465
|
var import_jsx_runtime398 = require("react/jsx-runtime");
|
|
1674
|
-
var MultiSelectControl = (0,
|
|
1466
|
+
var MultiSelectControl = (0, import_react6.forwardRef)(
|
|
1675
1467
|
({
|
|
1676
1468
|
variant = "tag",
|
|
1677
1469
|
flexible = true,
|
|
@@ -1699,7 +1491,7 @@ var MultiSelectControl = (0, import_react8.forwardRef)(
|
|
|
1699
1491
|
const inputColors = theme.colors.control.input;
|
|
1700
1492
|
const state = externalState || (disabled ? "disable" : "default");
|
|
1701
1493
|
const isDisable = state === "disable" || disabled;
|
|
1702
|
-
const containerRef = (0,
|
|
1494
|
+
const containerRef = (0, import_react6.useRef)(null);
|
|
1703
1495
|
const { itemsRef, selectedContent, isCalculating } = useMultiSelectControl({
|
|
1704
1496
|
variant,
|
|
1705
1497
|
flexible,
|
|
@@ -1822,7 +1614,7 @@ var MultiSelectControl = (0, import_react8.forwardRef)(
|
|
|
1822
1614
|
MultiSelectControl.displayName = "MultiSelectControl";
|
|
1823
1615
|
|
|
1824
1616
|
// src/useMultiSelect.ts
|
|
1825
|
-
var
|
|
1617
|
+
var import_react7 = require("react");
|
|
1826
1618
|
var initialState = {
|
|
1827
1619
|
values: [],
|
|
1828
1620
|
selectedItems: [],
|
|
@@ -1833,12 +1625,12 @@ var useMultiSelect = ({
|
|
|
1833
1625
|
value = [],
|
|
1834
1626
|
onChange
|
|
1835
1627
|
}) => {
|
|
1836
|
-
const [state, setState] = (0,
|
|
1837
|
-
const optionsRef = (0,
|
|
1838
|
-
(0,
|
|
1628
|
+
const [state, setState] = (0, import_react7.useState)(initialState);
|
|
1629
|
+
const optionsRef = (0, import_react7.useRef)(options);
|
|
1630
|
+
(0, import_react7.useEffect)(() => {
|
|
1839
1631
|
optionsRef.current = options;
|
|
1840
1632
|
}, [options]);
|
|
1841
|
-
(0,
|
|
1633
|
+
(0, import_react7.useEffect)(() => {
|
|
1842
1634
|
const selectedItems = options.filter((opt) => value.includes(opt.value));
|
|
1843
1635
|
setState((prevState) => ({
|
|
1844
1636
|
...prevState,
|
|
@@ -1846,7 +1638,7 @@ var useMultiSelect = ({
|
|
|
1846
1638
|
selectedItems
|
|
1847
1639
|
}));
|
|
1848
1640
|
}, [options, value]);
|
|
1849
|
-
const onChoose = (0,
|
|
1641
|
+
const onChoose = (0, import_react7.useCallback)(
|
|
1850
1642
|
(selectedIds) => {
|
|
1851
1643
|
const newValues = optionsRef.current.filter((opt) => selectedIds.includes(String(opt.value))).map((opt) => opt.value);
|
|
1852
1644
|
const newSelectedItems = optionsRef.current.filter(
|
|
@@ -1861,7 +1653,7 @@ var useMultiSelect = ({
|
|
|
1861
1653
|
},
|
|
1862
1654
|
[onChange]
|
|
1863
1655
|
);
|
|
1864
|
-
const onRemove = (0,
|
|
1656
|
+
const onRemove = (0, import_react7.useCallback)(
|
|
1865
1657
|
(value2, event) => {
|
|
1866
1658
|
event?.stopPropagation();
|
|
1867
1659
|
setState((prev) => {
|
|
@@ -1879,7 +1671,7 @@ var useMultiSelect = ({
|
|
|
1879
1671
|
},
|
|
1880
1672
|
[onChange]
|
|
1881
1673
|
);
|
|
1882
|
-
const onRemoveAll = (0,
|
|
1674
|
+
const onRemoveAll = (0, import_react7.useCallback)(() => {
|
|
1883
1675
|
setState((prevState) => ({
|
|
1884
1676
|
...prevState,
|
|
1885
1677
|
values: [],
|
|
@@ -1887,13 +1679,13 @@ var useMultiSelect = ({
|
|
|
1887
1679
|
}));
|
|
1888
1680
|
onChange?.([]);
|
|
1889
1681
|
}, [onChange]);
|
|
1890
|
-
const onSelectClick = (0,
|
|
1682
|
+
const onSelectClick = (0, import_react7.useCallback)(() => {
|
|
1891
1683
|
setState((prevState) => ({
|
|
1892
1684
|
...prevState,
|
|
1893
1685
|
isOpen: !prevState.isOpen
|
|
1894
1686
|
}));
|
|
1895
1687
|
}, []);
|
|
1896
|
-
const onClose = (0,
|
|
1688
|
+
const onClose = (0, import_react7.useCallback)(() => {
|
|
1897
1689
|
setState((prevState) => ({
|
|
1898
1690
|
...prevState,
|
|
1899
1691
|
isOpen: false
|
|
@@ -1914,7 +1706,7 @@ var useMultiSelect = ({
|
|
|
1914
1706
|
|
|
1915
1707
|
// src/MultiSelect.tsx
|
|
1916
1708
|
var import_jsx_runtime399 = require("react/jsx-runtime");
|
|
1917
|
-
var MultiSelect = (0,
|
|
1709
|
+
var MultiSelect = (0, import_react8.forwardRef)(
|
|
1918
1710
|
({
|
|
1919
1711
|
options,
|
|
1920
1712
|
errorMessage,
|
|
@@ -1936,8 +1728,8 @@ var MultiSelect = (0, import_react10.forwardRef)(
|
|
|
1936
1728
|
themeProductContext
|
|
1937
1729
|
}, ref) => {
|
|
1938
1730
|
const { theme } = (0, import_xui_core4.useResolvedTheme)({ themeMode, themeProductContext });
|
|
1939
|
-
const controlRef = (0,
|
|
1940
|
-
const menuRef = (0,
|
|
1731
|
+
const controlRef = (0, import_react8.useRef)(null);
|
|
1732
|
+
const menuRef = (0, import_react8.useRef)(null);
|
|
1941
1733
|
const sizeStyles = theme.sizing.input(size);
|
|
1942
1734
|
const state = externalState || (disabled ? "disable" : "default");
|
|
1943
1735
|
const isDisable = state === "disable" || disabled;
|
|
@@ -1958,7 +1750,7 @@ var MultiSelect = (0, import_react10.forwardRef)(
|
|
|
1958
1750
|
value,
|
|
1959
1751
|
onChange
|
|
1960
1752
|
});
|
|
1961
|
-
(0,
|
|
1753
|
+
(0, import_react8.useEffect)(() => {
|
|
1962
1754
|
if (isDisable) {
|
|
1963
1755
|
onClose();
|
|
1964
1756
|
}
|