@unifiedsoftware/react-ui 1.0.21 → 1.0.23
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/index.d.mts +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.js +276 -183
- package/dist/index.mjs +181 -92
- package/package.json +4 -3
package/dist/index.mjs
CHANGED
|
@@ -51,7 +51,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
// src/components/Autocomplete/Autocomplete.tsx
|
|
54
|
-
import { useEffect as
|
|
54
|
+
import { useEffect as useEffect15, useMemo as useMemo3, useRef as useRef11, useState as useState11 } from "react";
|
|
55
55
|
|
|
56
56
|
// src/constants/index.ts
|
|
57
57
|
var PREFIX_CLS = "us-";
|
|
@@ -383,6 +383,87 @@ function useElementSize(options) {
|
|
|
383
383
|
}
|
|
384
384
|
var useElementSize_default = useElementSize;
|
|
385
385
|
|
|
386
|
+
// src/hooks/useResizeObserver/useResizeObserver.ts
|
|
387
|
+
import { useEffect as useEffect9 } from "react";
|
|
388
|
+
function hasResizeObserver() {
|
|
389
|
+
return typeof window.ResizeObserver !== "undefined";
|
|
390
|
+
}
|
|
391
|
+
function useResizeObserver(options) {
|
|
392
|
+
const { ref, onResize } = options;
|
|
393
|
+
useEffect9(() => {
|
|
394
|
+
const element = ref == null ? void 0 : ref.current;
|
|
395
|
+
if (!element) {
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
if (!hasResizeObserver()) {
|
|
399
|
+
window.addEventListener("resize", onResize);
|
|
400
|
+
return () => {
|
|
401
|
+
window.removeEventListener("resize", onResize);
|
|
402
|
+
};
|
|
403
|
+
} else {
|
|
404
|
+
const resizeObserver = new window.ResizeObserver((entries) => {
|
|
405
|
+
if (!entries.length) {
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
onResize();
|
|
409
|
+
});
|
|
410
|
+
resizeObserver.observe(element);
|
|
411
|
+
return () => {
|
|
412
|
+
if (element) {
|
|
413
|
+
resizeObserver.unobserve(element);
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
}, [ref, onResize]);
|
|
418
|
+
}
|
|
419
|
+
var useResizeObserver_default = useResizeObserver;
|
|
420
|
+
|
|
421
|
+
// src/hooks/useEffectEvent/useEffectEvent.ts
|
|
422
|
+
import { useCallback as useCallback3, useLayoutEffect as useLayoutEffect2, useRef as useRef4 } from "react";
|
|
423
|
+
function useEffectEvent(fn) {
|
|
424
|
+
const ref = useRef4(null);
|
|
425
|
+
useLayoutEffect2(() => {
|
|
426
|
+
ref.current = fn;
|
|
427
|
+
}, [fn]);
|
|
428
|
+
return useCallback3((...args) => {
|
|
429
|
+
const f = ref.current;
|
|
430
|
+
return f(...args);
|
|
431
|
+
}, []);
|
|
432
|
+
}
|
|
433
|
+
var useEffectEvent_default = useEffectEvent;
|
|
434
|
+
|
|
435
|
+
// src/hooks/useValueEffect/useValueEffect.ts
|
|
436
|
+
import { useLayoutEffect as useLayoutEffect3, useRef as useRef5, useState as useState7 } from "react";
|
|
437
|
+
function useValueEffect(defaultValue) {
|
|
438
|
+
const [value, setValue] = useState7(defaultValue);
|
|
439
|
+
const effect = useRef5(null);
|
|
440
|
+
const nextRef = useEffectEvent_default(() => {
|
|
441
|
+
if (!effect.current)
|
|
442
|
+
return;
|
|
443
|
+
const newValue = effect.current.next();
|
|
444
|
+
if (newValue.done) {
|
|
445
|
+
effect.current = null;
|
|
446
|
+
return;
|
|
447
|
+
}
|
|
448
|
+
if (value === newValue.value) {
|
|
449
|
+
nextRef();
|
|
450
|
+
} else {
|
|
451
|
+
setValue(newValue.value);
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
useLayoutEffect3(() => {
|
|
455
|
+
if (effect.current) {
|
|
456
|
+
nextRef();
|
|
457
|
+
}
|
|
458
|
+
});
|
|
459
|
+
const queue = useEffectEvent_default((fn) => {
|
|
460
|
+
effect.current = fn(value);
|
|
461
|
+
nextRef();
|
|
462
|
+
});
|
|
463
|
+
return [value, queue];
|
|
464
|
+
}
|
|
465
|
+
var useValueEffect_default = useValueEffect;
|
|
466
|
+
|
|
386
467
|
// src/icons/ChevronDownIcon.tsx
|
|
387
468
|
import { forwardRef } from "react";
|
|
388
469
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -659,7 +740,7 @@ var Button = forwardRef6(
|
|
|
659
740
|
);
|
|
660
741
|
|
|
661
742
|
// src/components/Popover/Popover.tsx
|
|
662
|
-
import { Children as Children2, cloneElement as cloneElement2, useEffect as
|
|
743
|
+
import { Children as Children2, cloneElement as cloneElement2, useEffect as useEffect10, useRef as useRef6, useState as useState8 } from "react";
|
|
663
744
|
|
|
664
745
|
// src/components/Portal/Portal.tsx
|
|
665
746
|
import { forwardRef as forwardRef7 } from "react";
|
|
@@ -738,9 +819,9 @@ var Popover = (props) => {
|
|
|
738
819
|
onToggle,
|
|
739
820
|
onAfterClose
|
|
740
821
|
} = props;
|
|
741
|
-
const triggerRef =
|
|
742
|
-
const contentRef =
|
|
743
|
-
const [internalOpen, setInternalOpen] =
|
|
822
|
+
const triggerRef = useRef6(null);
|
|
823
|
+
const contentRef = useRef6(null);
|
|
824
|
+
const [internalOpen, setInternalOpen] = useState8(props.isOpen || false);
|
|
744
825
|
const [trigger, content] = Children2.toArray(children);
|
|
745
826
|
const prefixCls = PREFIX_CLS;
|
|
746
827
|
const handleOpen = () => {
|
|
@@ -764,7 +845,7 @@ var Popover = (props) => {
|
|
|
764
845
|
setInternalOpen((prevState) => !prevState);
|
|
765
846
|
}
|
|
766
847
|
};
|
|
767
|
-
|
|
848
|
+
useEffect10(() => {
|
|
768
849
|
setInternalOpen(isOpen || false);
|
|
769
850
|
}, [isOpen]);
|
|
770
851
|
return /* @__PURE__ */ jsxs6(
|
|
@@ -805,7 +886,7 @@ var Popover = (props) => {
|
|
|
805
886
|
var Popover_default = Popover;
|
|
806
887
|
|
|
807
888
|
// src/components/Popover/PopoverContent.tsx
|
|
808
|
-
import { forwardRef as forwardRef9, useCallback as
|
|
889
|
+
import { forwardRef as forwardRef9, useCallback as useCallback4, useEffect as useEffect11, useRef as useRef7, useState as useState9 } from "react";
|
|
809
890
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
810
891
|
function getScrollParent(node) {
|
|
811
892
|
if (node == null) {
|
|
@@ -821,8 +902,8 @@ var PopoverContent = forwardRef9((props, ref) => {
|
|
|
821
902
|
const _a = props, { children, style, className, onClick } = _a, rest = __objRest(_a, ["children", "style", "className", "onClick"]);
|
|
822
903
|
const { triggerRef, contentRef, target, onClose } = usePopover();
|
|
823
904
|
const prefixCls = PREFIX_CLS;
|
|
824
|
-
const menuListRef =
|
|
825
|
-
const [contentStyle, setContentStyle] =
|
|
905
|
+
const menuListRef = useRef7(null);
|
|
906
|
+
const [contentStyle, setContentStyle] = useState9({
|
|
826
907
|
position: "absolute",
|
|
827
908
|
top: 0,
|
|
828
909
|
left: 0,
|
|
@@ -845,7 +926,7 @@ var PopoverContent = forwardRef9((props, ref) => {
|
|
|
845
926
|
ev.stopPropagation();
|
|
846
927
|
onClick == null ? void 0 : onClick(ev);
|
|
847
928
|
};
|
|
848
|
-
const handleSize =
|
|
929
|
+
const handleSize = useCallback4(() => {
|
|
849
930
|
var _a2, _b;
|
|
850
931
|
const popoverRect = (_a2 = contentRef.current) == null ? void 0 : _a2.getBoundingClientRect();
|
|
851
932
|
const triggerClientRect = (_b = triggerRef.current) == null ? void 0 : _b.getBoundingClientRect();
|
|
@@ -876,7 +957,7 @@ var PopoverContent = forwardRef9((props, ref) => {
|
|
|
876
957
|
});
|
|
877
958
|
setContentStyle(style2);
|
|
878
959
|
}, []);
|
|
879
|
-
|
|
960
|
+
useEffect11(() => {
|
|
880
961
|
handleSize();
|
|
881
962
|
containerEl.addEventListener("scroll", handleSize);
|
|
882
963
|
window.addEventListener("orientationchange", handleSize);
|
|
@@ -920,7 +1001,7 @@ var PopoverTrigger = forwardRef10((props, ref) => {
|
|
|
920
1001
|
var PopoverTrigger_default = PopoverTrigger;
|
|
921
1002
|
|
|
922
1003
|
// src/components/Autocomplete/AutocompleteContent.tsx
|
|
923
|
-
import { Fragment as
|
|
1004
|
+
import { Fragment as Fragment3, useEffect as useEffect13, useRef as useRef9 } from "react";
|
|
924
1005
|
|
|
925
1006
|
// src/components/List/List.tsx
|
|
926
1007
|
import { forwardRef as forwardRef11 } from "react";
|
|
@@ -936,7 +1017,7 @@ var List_default = List;
|
|
|
936
1017
|
import { forwardRef as forwardRef15 } from "react";
|
|
937
1018
|
|
|
938
1019
|
// src/components/Collapse/Collapse.tsx
|
|
939
|
-
import { Children as Children4, useEffect as
|
|
1020
|
+
import { Children as Children4, useEffect as useEffect12, useRef as useRef8, useState as useState10 } from "react";
|
|
940
1021
|
|
|
941
1022
|
// src/components/Collapse/CollapseContext.tsx
|
|
942
1023
|
import { createContext as createContext2, useContext as useContext2 } from "react";
|
|
@@ -953,9 +1034,9 @@ var CollapseContext_default = CollapseContext;
|
|
|
953
1034
|
// src/components/Collapse/Collapse.tsx
|
|
954
1035
|
import { jsxs as jsxs7 } from "react/jsx-runtime";
|
|
955
1036
|
var Collapse = ({ children, isOpen, onOpen, onClose, onToggle }) => {
|
|
956
|
-
const collapseRef =
|
|
957
|
-
const [selfIsOpen, setSelfIsOpen] =
|
|
958
|
-
const [heightAuto, setHeightAuto] =
|
|
1037
|
+
const collapseRef = useRef8(null);
|
|
1038
|
+
const [selfIsOpen, setSelfIsOpen] = useState10(isOpen != null ? isOpen : false);
|
|
1039
|
+
const [heightAuto, setHeightAuto] = useState10(false);
|
|
959
1040
|
const [trigger, content] = Children4.toArray(children);
|
|
960
1041
|
const handleOpen = () => {
|
|
961
1042
|
setSelfIsOpen(true);
|
|
@@ -969,7 +1050,7 @@ var Collapse = ({ children, isOpen, onOpen, onClose, onToggle }) => {
|
|
|
969
1050
|
setSelfIsOpen((prevState) => !prevState);
|
|
970
1051
|
onToggle == null ? void 0 : onToggle();
|
|
971
1052
|
};
|
|
972
|
-
|
|
1053
|
+
useEffect12(() => {
|
|
973
1054
|
if (isOpen !== void 0) {
|
|
974
1055
|
setSelfIsOpen(isOpen);
|
|
975
1056
|
}
|
|
@@ -1044,11 +1125,12 @@ var CollapseTrigger_default = CollapseTrigger;
|
|
|
1044
1125
|
|
|
1045
1126
|
// src/components/List/ListItem.tsx
|
|
1046
1127
|
import { forwardRef as forwardRef14 } from "react";
|
|
1047
|
-
import { jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1128
|
+
import { Fragment, jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
1048
1129
|
var ListItem = forwardRef14(
|
|
1049
1130
|
(_a, ref) => {
|
|
1050
1131
|
var _b = _a, {
|
|
1051
1132
|
as: Component = "div",
|
|
1133
|
+
children,
|
|
1052
1134
|
className,
|
|
1053
1135
|
title,
|
|
1054
1136
|
subtitle,
|
|
@@ -1063,6 +1145,7 @@ var ListItem = forwardRef14(
|
|
|
1063
1145
|
onClick
|
|
1064
1146
|
} = _b, rest = __objRest(_b, [
|
|
1065
1147
|
"as",
|
|
1148
|
+
"children",
|
|
1066
1149
|
"className",
|
|
1067
1150
|
"title",
|
|
1068
1151
|
"subtitle",
|
|
@@ -1102,7 +1185,7 @@ var ListItem = forwardRef14(
|
|
|
1102
1185
|
children: [
|
|
1103
1186
|
hoverable && /* @__PURE__ */ jsx11("div", { className: `${prefixCls}overlay` }),
|
|
1104
1187
|
startContent && /* @__PURE__ */ jsx11("div", { className: `${prefixCls}list-item__start-content`, children: startContent }),
|
|
1105
|
-
/* @__PURE__ */
|
|
1188
|
+
/* @__PURE__ */ jsx11("div", { className: `${prefixCls}list-item__content`, children: title || subtitle ? /* @__PURE__ */ jsxs8(Fragment, { children: [
|
|
1106
1189
|
/* @__PURE__ */ jsx11("span", __spreadProps(__spreadValues({}, slotProps == null ? void 0 : slotProps.title), { className: clsx_default(`${prefixCls}list-item__title`, (_a2 = slotProps == null ? void 0 : slotProps.title) == null ? void 0 : _a2.className), children: title })),
|
|
1107
1190
|
/* @__PURE__ */ jsx11(
|
|
1108
1191
|
"span",
|
|
@@ -1111,7 +1194,7 @@ var ListItem = forwardRef14(
|
|
|
1111
1194
|
children: subtitle
|
|
1112
1195
|
})
|
|
1113
1196
|
)
|
|
1114
|
-
] }),
|
|
1197
|
+
] }) : children }),
|
|
1115
1198
|
endContent && /* @__PURE__ */ jsx11("div", { className: `${prefixCls}list-item__end-content`, children: endContent })
|
|
1116
1199
|
]
|
|
1117
1200
|
})
|
|
@@ -1121,7 +1204,7 @@ var ListItem = forwardRef14(
|
|
|
1121
1204
|
var ListItem_default = ListItem;
|
|
1122
1205
|
|
|
1123
1206
|
// src/components/List/ListGroup.tsx
|
|
1124
|
-
import { Fragment, jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1207
|
+
import { Fragment as Fragment2, jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
1125
1208
|
var ListGroup = forwardRef15(
|
|
1126
1209
|
(_a, ref) => {
|
|
1127
1210
|
var _b = _a, {
|
|
@@ -1152,11 +1235,11 @@ var ListGroup = forwardRef15(
|
|
|
1152
1235
|
ListItem_default,
|
|
1153
1236
|
__spreadValues({
|
|
1154
1237
|
ref,
|
|
1155
|
-
startContent: expandVisible && expandPosition === "start" ? /* @__PURE__ */ jsxs9(
|
|
1238
|
+
startContent: expandVisible && expandPosition === "start" ? /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1156
1239
|
/* @__PURE__ */ jsx12(Icon_default, { children: disclosure.isOpen ? /* @__PURE__ */ jsx12(ChevronUpIcon_default, {}) : /* @__PURE__ */ jsx12(ChevronDownIcon_default, {}) }),
|
|
1157
1240
|
startContent
|
|
1158
1241
|
] }) : startContent,
|
|
1159
|
-
endContent: expandVisible && expandPosition === "end" ? /* @__PURE__ */ jsxs9(
|
|
1242
|
+
endContent: expandVisible && expandPosition === "end" ? /* @__PURE__ */ jsxs9(Fragment2, { children: [
|
|
1160
1243
|
endContent,
|
|
1161
1244
|
/* @__PURE__ */ jsx12(Icon_default, { children: disclosure.isOpen ? /* @__PURE__ */ jsx12(ChevronUpIcon_default, {}) : /* @__PURE__ */ jsx12(ChevronDownIcon_default, {}) })
|
|
1162
1245
|
] }) : endContent
|
|
@@ -1245,14 +1328,14 @@ var AutocompleteContext_default = AutocompleteContext;
|
|
|
1245
1328
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
1246
1329
|
var AutocompleteContent = () => {
|
|
1247
1330
|
const { data, values, offset, setOffset, keyField, textField, onItemSelect, renderItem } = useAutocomplete();
|
|
1248
|
-
const parentRef =
|
|
1331
|
+
const parentRef = useRef9(null);
|
|
1249
1332
|
const { isOpen } = usePopover();
|
|
1250
1333
|
const handleItemSelect = (item) => {
|
|
1251
1334
|
var _a;
|
|
1252
1335
|
onItemSelect(item);
|
|
1253
1336
|
setOffset(((_a = parentRef.current) == null ? void 0 : _a.scrollHeight) || 0);
|
|
1254
1337
|
};
|
|
1255
|
-
|
|
1338
|
+
useEffect13(() => {
|
|
1256
1339
|
var _a;
|
|
1257
1340
|
if (!isOpen)
|
|
1258
1341
|
return;
|
|
@@ -1267,7 +1350,7 @@ var AutocompleteContent = () => {
|
|
|
1267
1350
|
width: `100%`,
|
|
1268
1351
|
position: "relative"
|
|
1269
1352
|
},
|
|
1270
|
-
children: /* @__PURE__ */ jsx14(List_default, { children: renderItem ? data.map((item) => /* @__PURE__ */ jsx14(
|
|
1353
|
+
children: /* @__PURE__ */ jsx14(List_default, { children: renderItem ? data.map((item) => /* @__PURE__ */ jsx14(Fragment3, { children: renderItem(item, {
|
|
1271
1354
|
title: "",
|
|
1272
1355
|
selected: values.includes(item[keyField]),
|
|
1273
1356
|
hoverable: true,
|
|
@@ -1288,7 +1371,7 @@ var AutocompleteContent = () => {
|
|
|
1288
1371
|
var AutocompleteContent_default = AutocompleteContent;
|
|
1289
1372
|
|
|
1290
1373
|
// src/components/Autocomplete/AutocompleteVirtual.tsx
|
|
1291
|
-
import { Fragment as
|
|
1374
|
+
import { Fragment as Fragment4, useEffect as useEffect14, useRef as useRef10 } from "react";
|
|
1292
1375
|
|
|
1293
1376
|
// src/components/Autocomplete/utils.ts
|
|
1294
1377
|
var valueToValues = (value) => {
|
|
@@ -1302,13 +1385,13 @@ var valuesToValue = (values) => {
|
|
|
1302
1385
|
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
1303
1386
|
var AutocompleteVirtual = () => {
|
|
1304
1387
|
const { data, values, keyField, textField, virtual, onItemSelect, renderItem } = useAutocomplete();
|
|
1305
|
-
const parentRef =
|
|
1388
|
+
const parentRef = useRef10(null);
|
|
1306
1389
|
const virtualizer = useVirtualizer_default(__spreadProps(__spreadValues({}, virtual), { count: data.length, parentRef }));
|
|
1307
1390
|
const { isOpen } = usePopover();
|
|
1308
1391
|
const handleItemSelect = (item) => {
|
|
1309
1392
|
onItemSelect(item);
|
|
1310
1393
|
};
|
|
1311
|
-
|
|
1394
|
+
useEffect14(() => {
|
|
1312
1395
|
if (!isOpen)
|
|
1313
1396
|
return;
|
|
1314
1397
|
const value = valuesToValue(values);
|
|
@@ -1375,7 +1458,7 @@ var AutocompleteVirtual = () => {
|
|
|
1375
1458
|
);
|
|
1376
1459
|
}
|
|
1377
1460
|
if (renderItem) {
|
|
1378
|
-
return /* @__PURE__ */ jsx15(
|
|
1461
|
+
return /* @__PURE__ */ jsx15(Fragment4, { children: renderItem(item, {
|
|
1379
1462
|
title: "",
|
|
1380
1463
|
selected: values.includes(item[keyField]),
|
|
1381
1464
|
hoverable: true,
|
|
@@ -1439,18 +1522,18 @@ var Autocomplete = (props) => {
|
|
|
1439
1522
|
} = props;
|
|
1440
1523
|
const disclosure = disclosureProp !== void 0 ? disclosureProp : useDisclosure_default();
|
|
1441
1524
|
const prefixCls = PREFIX_CLS;
|
|
1442
|
-
const inputRef =
|
|
1443
|
-
const [filter, setFilter] =
|
|
1444
|
-
const [search, setSearch] =
|
|
1445
|
-
const [isSearch, setIsSearch] =
|
|
1446
|
-
const [focus, setFocus] =
|
|
1525
|
+
const inputRef = useRef11(null);
|
|
1526
|
+
const [filter, setFilter] = useState11("");
|
|
1527
|
+
const [search, setSearch] = useState11("");
|
|
1528
|
+
const [isSearch, setIsSearch] = useState11(false);
|
|
1529
|
+
const [focus, setFocus] = useState11(false);
|
|
1447
1530
|
const values = useMemo3(() => {
|
|
1448
1531
|
return valueToValues(valueProp);
|
|
1449
1532
|
}, [valueProp]);
|
|
1450
1533
|
const items = useMemo3(() => {
|
|
1451
1534
|
return data.filter((item) => values.includes(item[keyField]));
|
|
1452
1535
|
}, [data, values]);
|
|
1453
|
-
const [offset, setOffset] =
|
|
1536
|
+
const [offset, setOffset] = useState11(0);
|
|
1454
1537
|
const handleClick = () => {
|
|
1455
1538
|
var _a;
|
|
1456
1539
|
(_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.focus();
|
|
@@ -1536,7 +1619,7 @@ var Autocomplete = (props) => {
|
|
|
1536
1619
|
}
|
|
1537
1620
|
}
|
|
1538
1621
|
};
|
|
1539
|
-
|
|
1622
|
+
useEffect15(() => {
|
|
1540
1623
|
if (isSearch)
|
|
1541
1624
|
return;
|
|
1542
1625
|
if (!props.isMultiple) {
|
|
@@ -1546,7 +1629,7 @@ var Autocomplete = (props) => {
|
|
|
1546
1629
|
}
|
|
1547
1630
|
}
|
|
1548
1631
|
}, [items]);
|
|
1549
|
-
|
|
1632
|
+
useEffect15(() => {
|
|
1550
1633
|
const values2 = valueToValues(valueProp);
|
|
1551
1634
|
const value = values2[0];
|
|
1552
1635
|
if (value === void 0) {
|
|
@@ -1634,12 +1717,12 @@ var Autocomplete_default = Autocomplete;
|
|
|
1634
1717
|
|
|
1635
1718
|
// src/components/Backdrop/Backdrop.tsx
|
|
1636
1719
|
import clsx6 from "clsx";
|
|
1637
|
-
import { forwardRef as forwardRef17, useRef as
|
|
1720
|
+
import { forwardRef as forwardRef17, useRef as useRef12 } from "react";
|
|
1638
1721
|
import { mergeRefs as mergeRefs2 } from "react-merge-refs";
|
|
1639
1722
|
import { jsx as jsx17, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
1640
1723
|
var Backdrop = forwardRef17((props, ref) => {
|
|
1641
1724
|
const _a = props, { children, className, isOpen, onClose } = _a, rest = __objRest(_a, ["children", "className", "isOpen", "onClose"]);
|
|
1642
|
-
const nodeRef =
|
|
1725
|
+
const nodeRef = useRef12(null);
|
|
1643
1726
|
return /* @__PURE__ */ jsx17(
|
|
1644
1727
|
Transition_default,
|
|
1645
1728
|
{
|
|
@@ -1750,12 +1833,12 @@ var Chip_default = Chip;
|
|
|
1750
1833
|
|
|
1751
1834
|
// src/components/Drawer/Drawer.tsx
|
|
1752
1835
|
import clsx9 from "clsx";
|
|
1753
|
-
import { forwardRef as forwardRef21, useRef as
|
|
1836
|
+
import { forwardRef as forwardRef21, useRef as useRef13 } from "react";
|
|
1754
1837
|
import { mergeRefs as mergeRefs3 } from "react-merge-refs";
|
|
1755
1838
|
import { jsx as jsx22, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
1756
1839
|
var Drawer = forwardRef21((props, ref) => {
|
|
1757
1840
|
const { children, className, isOpen, size = "md", position = "left", onClose } = props;
|
|
1758
|
-
const nodeRef =
|
|
1841
|
+
const nodeRef = useRef13(null);
|
|
1759
1842
|
const handleClose = () => {
|
|
1760
1843
|
onClose();
|
|
1761
1844
|
};
|
|
@@ -1782,7 +1865,7 @@ var Drawer_default = Drawer;
|
|
|
1782
1865
|
|
|
1783
1866
|
// src/components/Menu/Menu.tsx
|
|
1784
1867
|
import clsx13 from "clsx";
|
|
1785
|
-
import { useEffect as
|
|
1868
|
+
import { useEffect as useEffect17, useMemo as useMemo6, useState as useState12 } from "react";
|
|
1786
1869
|
|
|
1787
1870
|
// src/components/Menu/MenuContext.tsx
|
|
1788
1871
|
import { createContext as createContext4, useContext as useContext4 } from "react";
|
|
@@ -1802,7 +1885,7 @@ import { useMemo as useMemo5 } from "react";
|
|
|
1802
1885
|
|
|
1803
1886
|
// src/components/Menu/MenuItem.tsx
|
|
1804
1887
|
import clsx10 from "clsx";
|
|
1805
|
-
import { forwardRef as forwardRef22, useContext as useContext6, useEffect as
|
|
1888
|
+
import { forwardRef as forwardRef22, useContext as useContext6, useEffect as useEffect16 } from "react";
|
|
1806
1889
|
|
|
1807
1890
|
// src/components/Menu/MenuValueContext.tsx
|
|
1808
1891
|
import { createContext as createContext5, useContext as useContext5 } from "react";
|
|
@@ -1831,7 +1914,7 @@ var MenuItem = forwardRef22((props, ref) => {
|
|
|
1831
1914
|
onClick == null ? void 0 : onClick(event);
|
|
1832
1915
|
onItemSelect == null ? void 0 : onItemSelect(props);
|
|
1833
1916
|
};
|
|
1834
|
-
|
|
1917
|
+
useEffect16(() => {
|
|
1835
1918
|
if (navMode === "automatic" && originalValue.length > 0 && originalValue[originalValue.length - 1] === value) {
|
|
1836
1919
|
onOpen(values);
|
|
1837
1920
|
onChange(mergedValues);
|
|
@@ -1980,7 +2063,7 @@ var MenuSubmenu = (_a) => {
|
|
|
1980
2063
|
var MenuSubmenu_default = MenuSubmenu;
|
|
1981
2064
|
|
|
1982
2065
|
// src/components/Menu/MenuGroup.tsx
|
|
1983
|
-
import { Fragment as
|
|
2066
|
+
import { Fragment as Fragment5, jsx as jsx25, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
1984
2067
|
var MenuGroup = (_a) => {
|
|
1985
2068
|
var _b = _a, {
|
|
1986
2069
|
children,
|
|
@@ -2005,7 +2088,7 @@ var MenuGroup = (_a) => {
|
|
|
2005
2088
|
return type === "item" ? /* @__PURE__ */ jsx25(MenuItem_default, __spreadValues({}, item), index) : type === "submenu" ? /* @__PURE__ */ jsx25(MenuSubmenu_default, __spreadValues({}, item), index) : /* @__PURE__ */ jsx25(MenuItem_default, __spreadValues({}, item), index);
|
|
2006
2089
|
});
|
|
2007
2090
|
}, [items]);
|
|
2008
|
-
return /* @__PURE__ */ jsxs18(
|
|
2091
|
+
return /* @__PURE__ */ jsxs18(Fragment5, { children: [
|
|
2009
2092
|
/* @__PURE__ */ jsxs18(
|
|
2010
2093
|
"div",
|
|
2011
2094
|
__spreadProps(__spreadValues({
|
|
@@ -2052,8 +2135,8 @@ var Menu = (_a) => {
|
|
|
2052
2135
|
"onItemSelect"
|
|
2053
2136
|
]);
|
|
2054
2137
|
var _a2;
|
|
2055
|
-
const [selfValue, setSelfValue] =
|
|
2056
|
-
const [selfOpenValues, setSelfOpenValues] =
|
|
2138
|
+
const [selfValue, setSelfValue] = useState12((_a2 = valueProp != null ? valueProp : defaultValue) != null ? _a2 : []);
|
|
2139
|
+
const [selfOpenValues, setSelfOpenValues] = useState12(openValuesProp != null ? openValuesProp : []);
|
|
2057
2140
|
const content = useMemo6(() => {
|
|
2058
2141
|
return items == null ? void 0 : items.map((_a3, index) => {
|
|
2059
2142
|
var _b2 = _a3, { type } = _b2, item = __objRest(_b2, ["type"]);
|
|
@@ -2077,12 +2160,12 @@ var Menu = (_a) => {
|
|
|
2077
2160
|
const handleItemSelect = (props) => {
|
|
2078
2161
|
onItemSelect == null ? void 0 : onItemSelect(props);
|
|
2079
2162
|
};
|
|
2080
|
-
|
|
2163
|
+
useEffect17(() => {
|
|
2081
2164
|
if (valueProp !== void 0 && navMode !== "automatic") {
|
|
2082
2165
|
setSelfValue(valueProp);
|
|
2083
2166
|
}
|
|
2084
2167
|
}, [valueProp]);
|
|
2085
|
-
|
|
2168
|
+
useEffect17(() => {
|
|
2086
2169
|
if (openValuesProp !== void 0) {
|
|
2087
2170
|
setSelfOpenValues(openValuesProp);
|
|
2088
2171
|
}
|
|
@@ -2118,7 +2201,8 @@ var Accordion = forwardRef23((props, ref) => {
|
|
|
2118
2201
|
var Accordion_default = Accordion;
|
|
2119
2202
|
|
|
2120
2203
|
// src/components/Accordion/AccordionItem.tsx
|
|
2121
|
-
import { createContext as createContext6, forwardRef as forwardRef24, useContext as useContext8,
|
|
2204
|
+
import { createContext as createContext6, forwardRef as forwardRef24, useContext as useContext8, useState as useState13 } from "react";
|
|
2205
|
+
import { v4 as uuid } from "uuid";
|
|
2122
2206
|
import { jsx as jsx28 } from "react/jsx-runtime";
|
|
2123
2207
|
var AccordionItemContext = createContext6(null);
|
|
2124
2208
|
var useAccordionItem = () => {
|
|
@@ -2130,10 +2214,10 @@ var useAccordionItem = () => {
|
|
|
2130
2214
|
};
|
|
2131
2215
|
var AccordionItem = forwardRef24((props, ref) => {
|
|
2132
2216
|
const _a = props, { children, className, value: valueProp } = _a, rest = __objRest(_a, ["children", "className", "value"]);
|
|
2133
|
-
const
|
|
2134
|
-
const { isOpen, onOpen, onClose, onToggle } = useDisclosure_default({ defaultValue: true });
|
|
2135
|
-
const id = useId();
|
|
2217
|
+
const [id] = useState13(uuid());
|
|
2136
2218
|
const value = valueProp != null ? valueProp : id;
|
|
2219
|
+
const { isOpen, onOpen, onClose, onToggle } = useDisclosure_default({ defaultValue: true });
|
|
2220
|
+
const prefixCls = PREFIX_CLS;
|
|
2137
2221
|
return /* @__PURE__ */ jsx28(AccordionItemContext.Provider, { value: { value }, children: /* @__PURE__ */ jsx28("div", __spreadProps(__spreadValues({ ref, className: clsx_default(`${prefixCls}accordion-item`, className) }, rest), { children: /* @__PURE__ */ jsx28(Collapse_default, { isOpen, onOpen, onClose, onToggle, children }) })) });
|
|
2138
2222
|
});
|
|
2139
2223
|
var AccordionItem_default = AccordionItem;
|
|
@@ -2182,7 +2266,8 @@ var AccordionContent_default = AccordionContent;
|
|
|
2182
2266
|
// src/components/Tabs/Tab.tsx
|
|
2183
2267
|
import clsx14 from "clsx";
|
|
2184
2268
|
import mergeRefs4 from "merge-refs";
|
|
2185
|
-
import { forwardRef as forwardRef28, useEffect as
|
|
2269
|
+
import { forwardRef as forwardRef28, useEffect as useEffect18, useRef as useRef14, useState as useState14 } from "react";
|
|
2270
|
+
import { v4 as uuid2 } from "uuid";
|
|
2186
2271
|
|
|
2187
2272
|
// src/components/Tabs/TabsContext.ts
|
|
2188
2273
|
import { createContext as createContext7, useContext as useContext9 } from "react";
|
|
@@ -2222,11 +2307,11 @@ var Tab = forwardRef28(
|
|
|
2222
2307
|
"disabled",
|
|
2223
2308
|
"onClick"
|
|
2224
2309
|
]);
|
|
2225
|
-
const
|
|
2226
|
-
const
|
|
2310
|
+
const prefixCls = PREFIX_CLS;
|
|
2311
|
+
const tabRef = useRef14(null);
|
|
2312
|
+
const [id] = useState14(uuid2());
|
|
2227
2313
|
const value = valueProp != null ? valueProp : id;
|
|
2228
2314
|
const _a2 = useTabs(), { onClose, registerItem } = _a2, tabs = __objRest(_a2, ["onClose", "registerItem"]);
|
|
2229
|
-
const prefixCls = PREFIX_CLS;
|
|
2230
2315
|
const handleClick = (event) => {
|
|
2231
2316
|
const previousTab = tabs.previousTabRef.current;
|
|
2232
2317
|
const currentTab = tabRef.current;
|
|
@@ -2265,7 +2350,7 @@ var Tab = forwardRef28(
|
|
|
2265
2350
|
event.stopPropagation();
|
|
2266
2351
|
onClose(value);
|
|
2267
2352
|
};
|
|
2268
|
-
|
|
2353
|
+
useEffect18(() => {
|
|
2269
2354
|
registerItem({ value, disabled });
|
|
2270
2355
|
if (value === tabs.value) {
|
|
2271
2356
|
tabs.previousTabRef.current = tabRef.current;
|
|
@@ -2302,7 +2387,7 @@ var Tab = forwardRef28(
|
|
|
2302
2387
|
|
|
2303
2388
|
// src/components/Tabs/Tabs.tsx
|
|
2304
2389
|
import clsx15 from "clsx";
|
|
2305
|
-
import { useEffect as
|
|
2390
|
+
import { useEffect as useEffect19, useRef as useRef15, useState as useState15 } from "react";
|
|
2306
2391
|
import { jsx as jsx33, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
2307
2392
|
var Tabs = (_a) => {
|
|
2308
2393
|
var _b = _a, {
|
|
@@ -2322,11 +2407,11 @@ var Tabs = (_a) => {
|
|
|
2322
2407
|
"onChange",
|
|
2323
2408
|
"onClose"
|
|
2324
2409
|
]);
|
|
2325
|
-
const tabsRef =
|
|
2326
|
-
const tabRefs =
|
|
2327
|
-
const previousTabRef =
|
|
2328
|
-
const [selfValue, setSelfValue] =
|
|
2329
|
-
const [items, setItems] =
|
|
2410
|
+
const tabsRef = useRef15(null);
|
|
2411
|
+
const tabRefs = useRef15({});
|
|
2412
|
+
const previousTabRef = useRef15(null);
|
|
2413
|
+
const [selfValue, setSelfValue] = useState15(value != null ? value : defaultValue);
|
|
2414
|
+
const [items, setItems] = useState15([]);
|
|
2330
2415
|
const registerItem = (item) => {
|
|
2331
2416
|
setItems((prevItems) => {
|
|
2332
2417
|
const index = prevItems.findIndex((item2) => item2.value);
|
|
@@ -2353,13 +2438,13 @@ var Tabs = (_a) => {
|
|
|
2353
2438
|
const handleClose = (value2) => {
|
|
2354
2439
|
onClose == null ? void 0 : onClose(value2);
|
|
2355
2440
|
};
|
|
2356
|
-
|
|
2441
|
+
useEffect19(() => {
|
|
2357
2442
|
if (value !== void 0) {
|
|
2358
2443
|
setSelfValue(value);
|
|
2359
2444
|
scrollToTab(value);
|
|
2360
2445
|
}
|
|
2361
2446
|
}, [value]);
|
|
2362
|
-
|
|
2447
|
+
useEffect19(() => {
|
|
2363
2448
|
if (value === void 0) {
|
|
2364
2449
|
const item = items.find((tab) => !tab.disabled);
|
|
2365
2450
|
setSelfValue(item == null ? void 0 : item.value);
|
|
@@ -2387,7 +2472,7 @@ var Tabs = (_a) => {
|
|
|
2387
2472
|
|
|
2388
2473
|
// src/components/Toolbar/Toolbar.tsx
|
|
2389
2474
|
import clsx16 from "clsx";
|
|
2390
|
-
import { Fragment as
|
|
2475
|
+
import { Fragment as Fragment6, jsx as jsx34, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
2391
2476
|
var Toolbar = (props) => {
|
|
2392
2477
|
const _a = props, {
|
|
2393
2478
|
children,
|
|
@@ -2415,7 +2500,7 @@ var Toolbar = (props) => {
|
|
|
2415
2500
|
/* @__PURE__ */ jsx34("div", { className: `${prefixCls}outline-b` }),
|
|
2416
2501
|
/* @__PURE__ */ jsxs22("div", { className: clsx16(`${prefixCls}toolbar__container`), children: [
|
|
2417
2502
|
startContent ? /* @__PURE__ */ jsx34("div", { className: clsx16(`${prefixCls}toolbar__start-content`), children: startContent }) : startAction && /* @__PURE__ */ jsx34("div", { className: clsx16(`${prefixCls}toolbar__start-action`), children: startAction }),
|
|
2418
|
-
/* @__PURE__ */ jsx34("div", { className: clsx16(`${prefixCls}toolbar__content`), children: title || subtitle ? /* @__PURE__ */ jsxs22(
|
|
2503
|
+
/* @__PURE__ */ jsx34("div", { className: clsx16(`${prefixCls}toolbar__content`), children: title || subtitle ? /* @__PURE__ */ jsxs22(Fragment6, { children: [
|
|
2419
2504
|
title && /* @__PURE__ */ jsx34("div", { className: clsx16(`${prefixCls}toolbar__title`), children: title }),
|
|
2420
2505
|
subtitle && /* @__PURE__ */ jsx34("div", { className: clsx16(`${prefixCls}toolbar__subtitle`), children: subtitle })
|
|
2421
2506
|
] }) : children }),
|
|
@@ -2426,13 +2511,13 @@ var Toolbar = (props) => {
|
|
|
2426
2511
|
var Toolbar_default = Toolbar;
|
|
2427
2512
|
|
|
2428
2513
|
// src/components/TextInput/TextInput.tsx
|
|
2429
|
-
import { forwardRef as forwardRef29, useRef as
|
|
2514
|
+
import { forwardRef as forwardRef29, useRef as useRef16, useState as useState16 } from "react";
|
|
2430
2515
|
import { jsx as jsx35, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
2431
2516
|
var TextInput = forwardRef29(
|
|
2432
2517
|
(_a, ref) => {
|
|
2433
2518
|
var _b = _a, { className, value, defaultValue, disabled, inputRef, startContent, endContent, style, onChange, onClick } = _b, rest = __objRest(_b, ["className", "value", "defaultValue", "disabled", "inputRef", "startContent", "endContent", "style", "onChange", "onClick"]);
|
|
2434
|
-
const [focus, setFocus] =
|
|
2435
|
-
const selfInputRef =
|
|
2519
|
+
const [focus, setFocus] = useState16(false);
|
|
2520
|
+
const selfInputRef = useRef16(null);
|
|
2436
2521
|
const prefixCls = PREFIX_CLS;
|
|
2437
2522
|
const handleChange = (event) => {
|
|
2438
2523
|
onChange == null ? void 0 : onChange(event);
|
|
@@ -2485,7 +2570,7 @@ var TextInput_default = TextInput;
|
|
|
2485
2570
|
|
|
2486
2571
|
// src/components/Switch/Switch.tsx
|
|
2487
2572
|
import clsx17 from "clsx";
|
|
2488
|
-
import { forwardRef as forwardRef30, useEffect as
|
|
2573
|
+
import { forwardRef as forwardRef30, useEffect as useEffect20, useState as useState17 } from "react";
|
|
2489
2574
|
import { jsx as jsx36, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
2490
2575
|
var Switch = forwardRef30(
|
|
2491
2576
|
(_a, ref) => {
|
|
@@ -2510,7 +2595,7 @@ var Switch = forwardRef30(
|
|
|
2510
2595
|
"onCheckedChange",
|
|
2511
2596
|
"disabled"
|
|
2512
2597
|
]);
|
|
2513
|
-
const [selftChecked, setSelfChecked] =
|
|
2598
|
+
const [selftChecked, setSelfChecked] = useState17(checkedProp);
|
|
2514
2599
|
const prefixCls = PREFIX_CLS;
|
|
2515
2600
|
const handleChange = (event) => {
|
|
2516
2601
|
const { value: value2, checked } = event.target;
|
|
@@ -2518,7 +2603,7 @@ var Switch = forwardRef30(
|
|
|
2518
2603
|
onChange == null ? void 0 : onChange(value2);
|
|
2519
2604
|
onCheckedChangeProp == null ? void 0 : onCheckedChangeProp(checked);
|
|
2520
2605
|
};
|
|
2521
|
-
|
|
2606
|
+
useEffect20(() => {
|
|
2522
2607
|
if (checkedProp !== void 0) {
|
|
2523
2608
|
setSelfChecked(checkedProp);
|
|
2524
2609
|
}
|
|
@@ -2556,10 +2641,10 @@ var Switch = forwardRef30(
|
|
|
2556
2641
|
var Switch_default = Switch;
|
|
2557
2642
|
|
|
2558
2643
|
// src/components/Select/Select.tsx
|
|
2559
|
-
import { useEffect as
|
|
2644
|
+
import { useEffect as useEffect23, useMemo as useMemo7, useRef as useRef19, useState as useState18 } from "react";
|
|
2560
2645
|
|
|
2561
2646
|
// src/components/Select/SelectContent.tsx
|
|
2562
|
-
import { Fragment as
|
|
2647
|
+
import { Fragment as Fragment7, useEffect as useEffect21, useRef as useRef17 } from "react";
|
|
2563
2648
|
|
|
2564
2649
|
// src/components/Select/SelectContext.tsx
|
|
2565
2650
|
import { createContext as createContext8, useContext as useContext10 } from "react";
|
|
@@ -2577,14 +2662,14 @@ var SelectContext_default = SelectContext;
|
|
|
2577
2662
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
2578
2663
|
var SelectContent = () => {
|
|
2579
2664
|
const { data, values, offset, setOffset, keyField, textField, onItemSelect, renderItem } = useSelect();
|
|
2580
|
-
const parentRef =
|
|
2665
|
+
const parentRef = useRef17(null);
|
|
2581
2666
|
const { isOpen } = usePopover();
|
|
2582
2667
|
const handleItemSelect = (item) => {
|
|
2583
2668
|
var _a;
|
|
2584
2669
|
onItemSelect(item);
|
|
2585
2670
|
setOffset(((_a = parentRef.current) == null ? void 0 : _a.scrollHeight) || 0);
|
|
2586
2671
|
};
|
|
2587
|
-
|
|
2672
|
+
useEffect21(() => {
|
|
2588
2673
|
var _a;
|
|
2589
2674
|
if (!isOpen)
|
|
2590
2675
|
return;
|
|
@@ -2599,7 +2684,7 @@ var SelectContent = () => {
|
|
|
2599
2684
|
width: `100%`,
|
|
2600
2685
|
position: "relative"
|
|
2601
2686
|
},
|
|
2602
|
-
children: /* @__PURE__ */ jsx37(List_default, { children: renderItem ? data.map((item) => /* @__PURE__ */ jsx37(
|
|
2687
|
+
children: /* @__PURE__ */ jsx37(List_default, { children: renderItem ? data.map((item) => /* @__PURE__ */ jsx37(Fragment7, { children: renderItem(item, {
|
|
2603
2688
|
title: "",
|
|
2604
2689
|
selected: values.includes(item[keyField]),
|
|
2605
2690
|
hoverable: true,
|
|
@@ -2620,7 +2705,7 @@ var SelectContent = () => {
|
|
|
2620
2705
|
var SelectContent_default = SelectContent;
|
|
2621
2706
|
|
|
2622
2707
|
// src/components/Select/SelectVirtual.tsx
|
|
2623
|
-
import { Fragment as
|
|
2708
|
+
import { Fragment as Fragment8, useEffect as useEffect22, useRef as useRef18 } from "react";
|
|
2624
2709
|
|
|
2625
2710
|
// src/components/Select/utils.ts
|
|
2626
2711
|
var valueToValues2 = (value) => {
|
|
@@ -2634,13 +2719,13 @@ var valuesToValue2 = (values) => {
|
|
|
2634
2719
|
import { jsx as jsx38 } from "react/jsx-runtime";
|
|
2635
2720
|
var SelectVirtual = () => {
|
|
2636
2721
|
const { data, values, keyField, textField, virtual, onItemSelect, renderItem } = useSelect();
|
|
2637
|
-
const parentRef =
|
|
2722
|
+
const parentRef = useRef18(null);
|
|
2638
2723
|
const virtualizer = useVirtualizer_default(__spreadProps(__spreadValues({}, virtual), { count: data.length, parentRef }));
|
|
2639
2724
|
const { isOpen } = usePopover();
|
|
2640
2725
|
const handleItemSelect = (item) => {
|
|
2641
2726
|
onItemSelect(item);
|
|
2642
2727
|
};
|
|
2643
|
-
|
|
2728
|
+
useEffect22(() => {
|
|
2644
2729
|
if (!isOpen)
|
|
2645
2730
|
return;
|
|
2646
2731
|
const value = valuesToValue2(values);
|
|
@@ -2705,7 +2790,7 @@ var SelectVirtual = () => {
|
|
|
2705
2790
|
);
|
|
2706
2791
|
}
|
|
2707
2792
|
if (renderItem) {
|
|
2708
|
-
return /* @__PURE__ */ jsx38(
|
|
2793
|
+
return /* @__PURE__ */ jsx38(Fragment8, { children: renderItem(item, {
|
|
2709
2794
|
title: "",
|
|
2710
2795
|
selected: values.includes(item[keyField]),
|
|
2711
2796
|
hoverable: true,
|
|
@@ -2768,17 +2853,17 @@ var Select = (props) => {
|
|
|
2768
2853
|
} = props;
|
|
2769
2854
|
const disclosure = disclosureProp !== void 0 ? disclosureProp : useDisclosure_default();
|
|
2770
2855
|
const prefixCls = PREFIX_CLS;
|
|
2771
|
-
const inputRef =
|
|
2772
|
-
const [search, setSearch] =
|
|
2773
|
-
const [isSearch, setIsSearch] =
|
|
2774
|
-
const [focus, setFocus] =
|
|
2856
|
+
const inputRef = useRef19(null);
|
|
2857
|
+
const [search, setSearch] = useState18("");
|
|
2858
|
+
const [isSearch, setIsSearch] = useState18(false);
|
|
2859
|
+
const [focus, setFocus] = useState18(false);
|
|
2775
2860
|
const values = useMemo7(() => {
|
|
2776
2861
|
return valueToValues2(valueProp);
|
|
2777
2862
|
}, [valueProp]);
|
|
2778
2863
|
const items = useMemo7(() => {
|
|
2779
2864
|
return data.filter((item) => values.includes(item[keyField]));
|
|
2780
2865
|
}, [data, values]);
|
|
2781
|
-
const [offset, setOffset] =
|
|
2866
|
+
const [offset, setOffset] = useState18(0);
|
|
2782
2867
|
const handleClick = () => {
|
|
2783
2868
|
var _a;
|
|
2784
2869
|
(_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.focus();
|
|
@@ -2853,7 +2938,7 @@ var Select = (props) => {
|
|
|
2853
2938
|
}
|
|
2854
2939
|
}
|
|
2855
2940
|
};
|
|
2856
|
-
|
|
2941
|
+
useEffect23(() => {
|
|
2857
2942
|
if (isSearch)
|
|
2858
2943
|
return;
|
|
2859
2944
|
if (!props.isMultiple) {
|
|
@@ -2863,7 +2948,7 @@ var Select = (props) => {
|
|
|
2863
2948
|
}
|
|
2864
2949
|
}
|
|
2865
2950
|
}, [items]);
|
|
2866
|
-
|
|
2951
|
+
useEffect23(() => {
|
|
2867
2952
|
const values2 = valueToValues2(valueProp);
|
|
2868
2953
|
const value = values2[0];
|
|
2869
2954
|
if (value === void 0) {
|
|
@@ -2994,12 +3079,14 @@ export {
|
|
|
2994
3079
|
assignRef,
|
|
2995
3080
|
clsx_default as clsx,
|
|
2996
3081
|
getOpenValuesByPathname,
|
|
3082
|
+
hasResizeObserver,
|
|
2997
3083
|
mergeRefs_default as mergeRefs,
|
|
2998
3084
|
scrollToItem,
|
|
2999
3085
|
useAccordionItem,
|
|
3000
3086
|
useCollapse,
|
|
3001
3087
|
useDebounce_default as useDebounce,
|
|
3002
3088
|
useDisclosure_default as useDisclosure,
|
|
3089
|
+
useEffectEvent_default as useEffectEvent,
|
|
3003
3090
|
useElementSize_default as useElementSize,
|
|
3004
3091
|
useInfiniteQuery_default as useInfiniteQuery,
|
|
3005
3092
|
useLocalStorage,
|
|
@@ -3007,6 +3094,8 @@ export {
|
|
|
3007
3094
|
useMenuItemValue,
|
|
3008
3095
|
useOnClickOutside_default as useOnClickOutside,
|
|
3009
3096
|
usePrevious,
|
|
3097
|
+
useResizeObserver_default as useResizeObserver,
|
|
3010
3098
|
useStep,
|
|
3099
|
+
useValueEffect_default as useValueEffect,
|
|
3011
3100
|
useVirtualizer_default as useVirtualizer
|
|
3012
3101
|
};
|