@unifiedsoftware/react-ui 1.0.18 → 1.0.20
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 +299 -204
- package/dist/index.d.ts +299 -204
- package/dist/index.js +2180 -1375
- package/dist/index.mjs +2209 -1421
- package/package.json +5 -2
package/dist/index.js
CHANGED
|
@@ -55,6 +55,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
55
55
|
mod
|
|
56
56
|
));
|
|
57
57
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
58
|
+
var __async = (__this, __arguments, generator) => {
|
|
59
|
+
return new Promise((resolve, reject) => {
|
|
60
|
+
var fulfilled = (value) => {
|
|
61
|
+
try {
|
|
62
|
+
step(generator.next(value));
|
|
63
|
+
} catch (e) {
|
|
64
|
+
reject(e);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
var rejected = (value) => {
|
|
68
|
+
try {
|
|
69
|
+
step(generator.throw(value));
|
|
70
|
+
} catch (e) {
|
|
71
|
+
reject(e);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
75
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
76
|
+
});
|
|
77
|
+
};
|
|
58
78
|
|
|
59
79
|
// src/index.ts
|
|
60
80
|
var src_exports = {};
|
|
@@ -64,6 +84,7 @@ __export(src_exports, {
|
|
|
64
84
|
AccordionHeader: () => AccordionHeader_default,
|
|
65
85
|
AccordionItem: () => AccordionItem_default,
|
|
66
86
|
AccordionPanel: () => AccordionPanel_default,
|
|
87
|
+
Autocomplete: () => Autocomplete_default,
|
|
67
88
|
Backdrop: () => Backdrop_default,
|
|
68
89
|
Badge: () => Badge_default,
|
|
69
90
|
Button: () => Button,
|
|
@@ -86,143 +107,375 @@ __export(src_exports, {
|
|
|
86
107
|
MenuItem: () => MenuItem_default,
|
|
87
108
|
MenuSubmenu: () => MenuSubmenu_default,
|
|
88
109
|
MenuValueContext: () => MenuValueContext_default,
|
|
89
|
-
MultiSelect: () => MultiSelect_default,
|
|
90
110
|
Portal: () => Portal_default,
|
|
111
|
+
QueryStatus: () => QueryStatus,
|
|
91
112
|
ScrollArea: () => ScrollArea_default,
|
|
92
113
|
Select: () => Select_default,
|
|
93
114
|
Switch: () => Switch_default,
|
|
94
115
|
Tab: () => Tab,
|
|
95
116
|
Tabs: () => Tabs,
|
|
117
|
+
TextInput: () => TextInput_default,
|
|
96
118
|
Toolbar: () => Toolbar_default,
|
|
97
119
|
Transition: () => Transition_default,
|
|
120
|
+
assignRef: () => assignRef,
|
|
98
121
|
clsx: () => clsx_default,
|
|
99
122
|
getOpenValuesByPathname: () => getOpenValuesByPathname,
|
|
123
|
+
mergeRefs: () => mergeRefs_default,
|
|
100
124
|
scrollToItem: () => scrollToItem,
|
|
101
125
|
useAccordionItem: () => useAccordionItem,
|
|
102
126
|
useCollapse: () => useCollapse,
|
|
127
|
+
useDebounce: () => useDebounce_default,
|
|
103
128
|
useDisclosure: () => useDisclosure_default,
|
|
129
|
+
useElementSize: () => useElementSize_default,
|
|
130
|
+
useInfiniteQuery: () => useInfiniteQuery_default,
|
|
104
131
|
useLocalStorage: () => useLocalStorage,
|
|
105
132
|
useMenu: () => useMenu,
|
|
106
133
|
useMenuItemValue: () => useMenuItemValue,
|
|
134
|
+
useOnClickOutside: () => useOnClickOutside_default,
|
|
107
135
|
usePrevious: () => usePrevious,
|
|
108
|
-
useStep: () => useStep
|
|
136
|
+
useStep: () => useStep,
|
|
137
|
+
useVirtualizer: () => useVirtualizer_default
|
|
109
138
|
});
|
|
110
139
|
module.exports = __toCommonJS(src_exports);
|
|
111
140
|
|
|
112
|
-
// src/components/
|
|
113
|
-
var
|
|
114
|
-
var import_react3 = require("react");
|
|
115
|
-
var import_react_merge_refs = require("react-merge-refs");
|
|
141
|
+
// src/components/Autocomplete/Autocomplete.tsx
|
|
142
|
+
var import_react35 = require("react");
|
|
116
143
|
|
|
117
144
|
// src/constants/index.ts
|
|
118
145
|
var PREFIX_CLS = "us-";
|
|
119
146
|
|
|
120
|
-
// src/
|
|
121
|
-
var
|
|
122
|
-
var import_react_portal = require("react-portal");
|
|
123
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
124
|
-
var Portal = (0, import_react.forwardRef)(({ children }, ref) => {
|
|
125
|
-
const portalRef = (0, import_react.useRef)(null);
|
|
126
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_portal.Portal, { ref: portalRef, node: document.body, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `${PREFIX_CLS}potal`, children }) });
|
|
127
|
-
});
|
|
128
|
-
var Portal_default = Portal;
|
|
147
|
+
// src/hooks/useLocalStorage.tsx
|
|
148
|
+
var import_react3 = require("react");
|
|
129
149
|
|
|
130
|
-
// src/
|
|
131
|
-
var import_clsx = __toESM(require("clsx"));
|
|
150
|
+
// src/hooks/useEventListener.tsx
|
|
132
151
|
var import_react2 = require("react");
|
|
133
|
-
var import_react_transition_group = require("react-transition-group");
|
|
134
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
135
|
-
var Transition = (0, import_react2.forwardRef)((props, ref) => {
|
|
136
|
-
const {
|
|
137
|
-
children,
|
|
138
|
-
className,
|
|
139
|
-
nodeRef,
|
|
140
|
-
name,
|
|
141
|
-
isOpen,
|
|
142
|
-
enter = 0,
|
|
143
|
-
leave = 0,
|
|
144
|
-
mountOnEnter,
|
|
145
|
-
unmountOnExit,
|
|
146
|
-
onExited
|
|
147
|
-
} = props;
|
|
148
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
149
|
-
import_react_transition_group.CSSTransition,
|
|
150
|
-
{
|
|
151
|
-
nodeRef,
|
|
152
|
-
in: isOpen,
|
|
153
|
-
appear: true,
|
|
154
|
-
timeout: { enter, exit: leave },
|
|
155
|
-
mountOnEnter,
|
|
156
|
-
unmountOnExit,
|
|
157
|
-
classNames: (0, import_clsx.default)(name, className),
|
|
158
|
-
onExited,
|
|
159
|
-
children
|
|
160
|
-
}
|
|
161
|
-
);
|
|
162
|
-
});
|
|
163
|
-
var Transition_default = Transition;
|
|
164
152
|
|
|
165
|
-
// src/
|
|
166
|
-
var
|
|
167
|
-
var
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
})
|
|
192
|
-
) })
|
|
153
|
+
// src/hooks/useIsomorphicLayoutEffect.tsx
|
|
154
|
+
var import_react = require("react");
|
|
155
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? import_react.useLayoutEffect : import_react.useEffect;
|
|
156
|
+
var useIsomorphicLayoutEffect_default = useIsomorphicLayoutEffect;
|
|
157
|
+
|
|
158
|
+
// src/hooks/useEventListener.tsx
|
|
159
|
+
function useEventListener(handler) {
|
|
160
|
+
const savedHandler = (0, import_react2.useRef)(handler);
|
|
161
|
+
useIsomorphicLayoutEffect_default(() => {
|
|
162
|
+
savedHandler.current = handler;
|
|
163
|
+
}, [handler]);
|
|
164
|
+
}
|
|
165
|
+
var useEventListener_default = useEventListener;
|
|
166
|
+
|
|
167
|
+
// src/hooks/useLocalStorage.tsx
|
|
168
|
+
function useLocalStorage(key, initialValue) {
|
|
169
|
+
const readValue = (0, import_react3.useCallback)(() => {
|
|
170
|
+
if (typeof window === "undefined") {
|
|
171
|
+
return initialValue;
|
|
172
|
+
}
|
|
173
|
+
try {
|
|
174
|
+
const item = window.localStorage.getItem(key);
|
|
175
|
+
return item ? parseJSON(item) : initialValue;
|
|
176
|
+
} catch (error) {
|
|
177
|
+
console.warn(`Error reading localStorage key \u201C${key}\u201D:`, error);
|
|
178
|
+
return initialValue;
|
|
193
179
|
}
|
|
180
|
+
}, [initialValue, key]);
|
|
181
|
+
const [storedValue, setStoredValue] = (0, import_react3.useState)(readValue);
|
|
182
|
+
const setValue = (0, import_react3.useCallback)(
|
|
183
|
+
(value) => {
|
|
184
|
+
if (typeof window == "undefined") {
|
|
185
|
+
console.warn(`Tried setting localStorage key \u201C${key}\u201D even though environment is not a client`);
|
|
186
|
+
}
|
|
187
|
+
try {
|
|
188
|
+
const newValue = value instanceof Function ? value(storedValue) : value;
|
|
189
|
+
window.localStorage.setItem(key, JSON.stringify(newValue));
|
|
190
|
+
setStoredValue(newValue);
|
|
191
|
+
window.dispatchEvent(new Event("local-storage"));
|
|
192
|
+
} catch (error) {
|
|
193
|
+
console.warn(`Error setting localStorage key \u201C${key}\u201D:`, error);
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
[key, storedValue]
|
|
194
197
|
);
|
|
195
|
-
|
|
196
|
-
|
|
198
|
+
(0, import_react3.useEffect)(() => {
|
|
199
|
+
setStoredValue(readValue());
|
|
200
|
+
}, []);
|
|
201
|
+
const handleStorageChange = (0, import_react3.useCallback)(() => {
|
|
202
|
+
setStoredValue(readValue());
|
|
203
|
+
}, [readValue]);
|
|
204
|
+
useEventListener_default("storage", handleStorageChange);
|
|
205
|
+
useEventListener_default("local-storage", handleStorageChange);
|
|
206
|
+
return [storedValue, setValue];
|
|
207
|
+
}
|
|
208
|
+
function parseJSON(value) {
|
|
209
|
+
try {
|
|
210
|
+
return value === "undefined" ? void 0 : JSON.parse(value != null ? value : "");
|
|
211
|
+
} catch (e) {
|
|
212
|
+
return void 0;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
197
215
|
|
|
198
|
-
// src/
|
|
199
|
-
var
|
|
200
|
-
var
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
216
|
+
// src/hooks/usePrevious.tsx
|
|
217
|
+
var import_react4 = require("react");
|
|
218
|
+
var usePrevious = (value) => {
|
|
219
|
+
const ref = (0, import_react4.useRef)();
|
|
220
|
+
(0, import_react4.useEffect)(() => {
|
|
221
|
+
ref.current = value;
|
|
222
|
+
});
|
|
223
|
+
return ref.current;
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
// src/hooks/useDisclosure.ts
|
|
227
|
+
var import_react5 = require("react");
|
|
228
|
+
function useDisclosure({ defaultValue } = {}) {
|
|
229
|
+
const [isOpen, setIsOpen] = (0, import_react5.useState)(defaultValue || false);
|
|
230
|
+
const onOpen = () => {
|
|
231
|
+
setIsOpen(true);
|
|
232
|
+
};
|
|
233
|
+
const onClose = () => {
|
|
234
|
+
setIsOpen(false);
|
|
235
|
+
};
|
|
236
|
+
const onToggle = () => {
|
|
237
|
+
setIsOpen((prevState) => !prevState);
|
|
238
|
+
};
|
|
239
|
+
return {
|
|
240
|
+
isOpen,
|
|
241
|
+
onOpen,
|
|
242
|
+
onClose,
|
|
243
|
+
onToggle
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
var useDisclosure_default = useDisclosure;
|
|
247
|
+
|
|
248
|
+
// src/hooks/useOnClickOutside.tsx
|
|
249
|
+
var import_react6 = require("react");
|
|
250
|
+
var useOnClickOutside = (ref, handler) => {
|
|
251
|
+
(0, import_react6.useEffect)(() => {
|
|
252
|
+
const listener = (event) => {
|
|
253
|
+
if (!ref.current || ref.current.contains(event.target)) {
|
|
254
|
+
return;
|
|
211
255
|
}
|
|
212
|
-
|
|
213
|
-
|
|
256
|
+
handler(event);
|
|
257
|
+
};
|
|
258
|
+
document.addEventListener("click", listener);
|
|
259
|
+
return () => {
|
|
260
|
+
document.removeEventListener("click", listener);
|
|
261
|
+
};
|
|
262
|
+
}, [ref, handler]);
|
|
214
263
|
};
|
|
215
|
-
var
|
|
264
|
+
var useOnClickOutside_default = useOnClickOutside;
|
|
216
265
|
|
|
217
|
-
// src/
|
|
218
|
-
var
|
|
266
|
+
// src/hooks/useStep.tsx
|
|
267
|
+
var import_react7 = require("react");
|
|
268
|
+
var useStep = (maxStep) => {
|
|
269
|
+
const [currentStep, setCurrentStep] = (0, import_react7.useState)(1);
|
|
270
|
+
const canGoToNextStep = (0, import_react7.useMemo)(() => currentStep + 1 <= maxStep, [currentStep, maxStep]);
|
|
271
|
+
const canGoToPrevStep = (0, import_react7.useMemo)(() => currentStep - 1 >= 1, [currentStep]);
|
|
272
|
+
const setStep = (0, import_react7.useCallback)(
|
|
273
|
+
(step) => {
|
|
274
|
+
const newStep = step instanceof Function ? step(currentStep) : step;
|
|
275
|
+
if (newStep >= 1 && newStep <= maxStep) {
|
|
276
|
+
setCurrentStep(newStep);
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
throw new Error("Step not valid");
|
|
280
|
+
},
|
|
281
|
+
[maxStep, currentStep]
|
|
282
|
+
);
|
|
283
|
+
const goToNextStep = (0, import_react7.useCallback)(() => {
|
|
284
|
+
if (canGoToNextStep) {
|
|
285
|
+
setCurrentStep((step) => step + 1);
|
|
286
|
+
}
|
|
287
|
+
}, [canGoToNextStep]);
|
|
288
|
+
const goToPrevStep = (0, import_react7.useCallback)(() => {
|
|
289
|
+
if (canGoToPrevStep) {
|
|
290
|
+
setCurrentStep((step) => step - 1);
|
|
291
|
+
}
|
|
292
|
+
}, [canGoToPrevStep]);
|
|
293
|
+
const reset = (0, import_react7.useCallback)(() => {
|
|
294
|
+
setCurrentStep(1);
|
|
295
|
+
}, []);
|
|
296
|
+
return [
|
|
297
|
+
currentStep,
|
|
298
|
+
{
|
|
299
|
+
goToNextStep,
|
|
300
|
+
goToPrevStep,
|
|
301
|
+
canGoToNextStep,
|
|
302
|
+
canGoToPrevStep,
|
|
303
|
+
setStep,
|
|
304
|
+
reset
|
|
305
|
+
}
|
|
306
|
+
];
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
// src/hooks/useDebounce.ts
|
|
219
310
|
var import_react8 = require("react");
|
|
311
|
+
function useDebounce(value, delay) {
|
|
312
|
+
const [debouncedValue, setDebouncedValue] = (0, import_react8.useState)(value);
|
|
313
|
+
(0, import_react8.useEffect)(() => {
|
|
314
|
+
const timer = setTimeout(() => setDebouncedValue(value), delay || 500);
|
|
315
|
+
return () => {
|
|
316
|
+
clearTimeout(timer);
|
|
317
|
+
};
|
|
318
|
+
}, [value, delay]);
|
|
319
|
+
return debouncedValue;
|
|
320
|
+
}
|
|
321
|
+
var useDebounce_default = useDebounce;
|
|
322
|
+
|
|
323
|
+
// src/hooks/useVirtualizer/useVirtualizer.ts
|
|
324
|
+
var import_react_virtual = require("@tanstack/react-virtual");
|
|
325
|
+
var import_react9 = require("react");
|
|
326
|
+
function useVirtualizer(options) {
|
|
327
|
+
const {
|
|
328
|
+
parentRef,
|
|
329
|
+
total,
|
|
330
|
+
count = 0,
|
|
331
|
+
overscan = 5,
|
|
332
|
+
hasNextPage,
|
|
333
|
+
isFetchingNextPage,
|
|
334
|
+
onFetchNextPage,
|
|
335
|
+
estimateSize
|
|
336
|
+
} = options;
|
|
337
|
+
const virtualizer = (0, import_react_virtual.useVirtualizer)({
|
|
338
|
+
count: total ? total : hasNextPage ? count + 1 : count,
|
|
339
|
+
getScrollElement: () => parentRef.current,
|
|
340
|
+
estimateSize,
|
|
341
|
+
overscan
|
|
342
|
+
});
|
|
343
|
+
(0, import_react9.useEffect)(() => {
|
|
344
|
+
if (!onFetchNextPage)
|
|
345
|
+
return;
|
|
346
|
+
const [lastItem] = [...virtualizer.getVirtualItems()].reverse();
|
|
347
|
+
if (!lastItem) {
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
if (lastItem.index >= count - 1 && hasNextPage && !isFetchingNextPage) {
|
|
351
|
+
onFetchNextPage == null ? void 0 : onFetchNextPage();
|
|
352
|
+
}
|
|
353
|
+
}, [hasNextPage, onFetchNextPage, count, isFetchingNextPage, virtualizer.getVirtualItems()]);
|
|
354
|
+
return {
|
|
355
|
+
getVirtualItems: virtualizer.getVirtualItems,
|
|
356
|
+
getTotalSize: virtualizer.getTotalSize,
|
|
357
|
+
scrollToIndex: (index, options2) => {
|
|
358
|
+
virtualizer.scrollToIndex(index, options2);
|
|
359
|
+
},
|
|
360
|
+
scrollToOffset: (toOffset, options2) => {
|
|
361
|
+
virtualizer.scrollToOffset(toOffset, options2);
|
|
362
|
+
}
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
var useVirtualizer_default = useVirtualizer;
|
|
366
|
+
|
|
367
|
+
// src/hooks/useInfiniteQuery/useInfiniteQuery.ts
|
|
368
|
+
var import_react10 = require("react");
|
|
369
|
+
|
|
370
|
+
// src/hooks/useInfiniteQuery/types.ts
|
|
371
|
+
var QueryStatus = /* @__PURE__ */ ((QueryStatus2) => {
|
|
372
|
+
QueryStatus2[QueryStatus2["IDLE"] = 0] = "IDLE";
|
|
373
|
+
QueryStatus2[QueryStatus2["LOADING"] = 1] = "LOADING";
|
|
374
|
+
QueryStatus2[QueryStatus2["SUCCESS"] = 2] = "SUCCESS";
|
|
375
|
+
QueryStatus2[QueryStatus2["ERROR"] = 3] = "ERROR";
|
|
376
|
+
return QueryStatus2;
|
|
377
|
+
})(QueryStatus || {});
|
|
378
|
+
|
|
379
|
+
// src/hooks/useInfiniteQuery/useInfiniteQuery.ts
|
|
380
|
+
function useInfiniteQuery(options, deps = []) {
|
|
381
|
+
const [status, setStatus] = (0, import_react10.useState)(0 /* IDLE */);
|
|
382
|
+
const [data, setData] = (0, import_react10.useState)({ pages: [] });
|
|
383
|
+
const [error, setError] = (0, import_react10.useState)();
|
|
384
|
+
const [hasNextPage, setHasNextPage] = (0, import_react10.useState)(true);
|
|
385
|
+
const [isFetchingNextPage, setIsFetchingNextPage] = (0, import_react10.useState)(false);
|
|
386
|
+
const fetchNextPage = () => __async(this, null, function* () {
|
|
387
|
+
try {
|
|
388
|
+
setStatus(1 /* LOADING */);
|
|
389
|
+
setError(void 0);
|
|
390
|
+
setIsFetchingNextPage(true);
|
|
391
|
+
const lastIndex = data.pages.length - 1;
|
|
392
|
+
const page = options.getNextPage(data.pages[lastIndex], data.pages);
|
|
393
|
+
const newPage = yield options.query({ page });
|
|
394
|
+
const newData = { pages: [...data.pages, newPage] };
|
|
395
|
+
setData(newData);
|
|
396
|
+
const newLastIndex = newData.pages.length - 1;
|
|
397
|
+
const nextPage = options.getNextPage(newData.pages[newLastIndex], newData.pages);
|
|
398
|
+
setHasNextPage(nextPage !== void 0);
|
|
399
|
+
setIsFetchingNextPage(false);
|
|
400
|
+
setStatus(2 /* SUCCESS */);
|
|
401
|
+
} catch (error2) {
|
|
402
|
+
setError(error2);
|
|
403
|
+
setStatus(3 /* ERROR */);
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
(0, import_react10.useEffect)(() => {
|
|
407
|
+
const fetchData = () => __async(this, null, function* () {
|
|
408
|
+
try {
|
|
409
|
+
setStatus(1 /* LOADING */);
|
|
410
|
+
setError(void 0);
|
|
411
|
+
setIsFetchingNextPage(true);
|
|
412
|
+
const page = void 0;
|
|
413
|
+
const newPage = yield options.query({ page });
|
|
414
|
+
setData({ pages: [newPage] });
|
|
415
|
+
const nextPage = options.getNextPage(newPage, [newPage]);
|
|
416
|
+
setHasNextPage(nextPage !== void 0);
|
|
417
|
+
setIsFetchingNextPage(false);
|
|
418
|
+
setStatus(2 /* SUCCESS */);
|
|
419
|
+
} catch (error2) {
|
|
420
|
+
setError(error2);
|
|
421
|
+
setStatus(3 /* ERROR */);
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
fetchData();
|
|
425
|
+
}, deps);
|
|
426
|
+
return { status, data, error, hasNextPage, isFetchingNextPage, fetchNextPage };
|
|
427
|
+
}
|
|
428
|
+
var useInfiniteQuery_default = useInfiniteQuery;
|
|
429
|
+
|
|
430
|
+
// src/hooks/useElementSize/useElementSize.ts
|
|
431
|
+
var import_react11 = require("react");
|
|
432
|
+
var defaultState = {
|
|
433
|
+
width: 0,
|
|
434
|
+
height: 0
|
|
435
|
+
};
|
|
436
|
+
function useElementSize(options) {
|
|
437
|
+
var _a;
|
|
438
|
+
const frameID = (0, import_react11.useRef)(0);
|
|
439
|
+
const [resize, setResize] = (0, import_react11.useState)(defaultState);
|
|
440
|
+
const observer = (0, import_react11.useMemo)(
|
|
441
|
+
() => typeof window !== "undefined" ? new ResizeObserver((entries) => {
|
|
442
|
+
const entry = entries[0];
|
|
443
|
+
if (entry) {
|
|
444
|
+
cancelAnimationFrame(frameID.current);
|
|
445
|
+
frameID.current = requestAnimationFrame(() => {
|
|
446
|
+
var _a2, _b, _c;
|
|
447
|
+
const target = (_b = (_a2 = options.ref) == null ? void 0 : _a2.current) != null ? _b : options.target;
|
|
448
|
+
if (target) {
|
|
449
|
+
(_c = options.callback) == null ? void 0 : _c.call(options, resize);
|
|
450
|
+
setResize({ width: entry.contentRect.width, height: entry.contentRect.height });
|
|
451
|
+
}
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
}) : null,
|
|
455
|
+
[]
|
|
456
|
+
);
|
|
457
|
+
(0, import_react11.useEffect)(() => {
|
|
458
|
+
var _a2, _b;
|
|
459
|
+
const target = (_b = (_a2 = options.ref) == null ? void 0 : _a2.current) != null ? _b : options.target;
|
|
460
|
+
if (target) {
|
|
461
|
+
observer == null ? void 0 : observer.observe(target);
|
|
462
|
+
}
|
|
463
|
+
return () => {
|
|
464
|
+
observer == null ? void 0 : observer.disconnect();
|
|
465
|
+
if (frameID.current) {
|
|
466
|
+
cancelAnimationFrame(frameID.current);
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
}, [(_a = options.ref) == null ? void 0 : _a.current, options.target]);
|
|
470
|
+
return resize;
|
|
471
|
+
}
|
|
472
|
+
var useElementSize_default = useElementSize;
|
|
220
473
|
|
|
221
474
|
// src/icons/ChevronDownIcon.tsx
|
|
222
|
-
var
|
|
223
|
-
var
|
|
224
|
-
var ChevronDownIcon = (0,
|
|
225
|
-
return /* @__PURE__ */ (0,
|
|
475
|
+
var import_react12 = require("react");
|
|
476
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
477
|
+
var ChevronDownIcon = (0, import_react12.forwardRef)((props, ref) => {
|
|
478
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
226
479
|
"svg",
|
|
227
480
|
__spreadProps(__spreadValues({
|
|
228
481
|
ref,
|
|
@@ -235,8 +488,8 @@ var ChevronDownIcon = (0, import_react4.forwardRef)((props, ref) => {
|
|
|
235
488
|
xmlns: "http://www.w3.org/2000/svg"
|
|
236
489
|
}, props), {
|
|
237
490
|
children: [
|
|
238
|
-
/* @__PURE__ */ (0,
|
|
239
|
-
/* @__PURE__ */ (0,
|
|
491
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { fill: "none", d: "M0 0h24v24H0V0z" }),
|
|
492
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z" })
|
|
240
493
|
]
|
|
241
494
|
})
|
|
242
495
|
);
|
|
@@ -244,11 +497,11 @@ var ChevronDownIcon = (0, import_react4.forwardRef)((props, ref) => {
|
|
|
244
497
|
var ChevronDownIcon_default = ChevronDownIcon;
|
|
245
498
|
|
|
246
499
|
// src/icons/ChevronUpIcon.tsx
|
|
247
|
-
var
|
|
248
|
-
var
|
|
249
|
-
var ChevronUpIcon = (0,
|
|
250
|
-
return /* @__PURE__ */ (0,
|
|
251
|
-
"svg",
|
|
500
|
+
var import_react13 = require("react");
|
|
501
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
502
|
+
var ChevronUpIcon = (0, import_react13.forwardRef)((props, ref) => {
|
|
503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
504
|
+
"svg",
|
|
252
505
|
__spreadProps(__spreadValues({
|
|
253
506
|
ref,
|
|
254
507
|
stroke: "currentColor",
|
|
@@ -260,8 +513,8 @@ var ChevronUpIcon = (0, import_react5.forwardRef)((props, ref) => {
|
|
|
260
513
|
xmlns: "http://www.w3.org/2000/svg"
|
|
261
514
|
}, props), {
|
|
262
515
|
children: [
|
|
263
|
-
/* @__PURE__ */ (0,
|
|
264
|
-
/* @__PURE__ */ (0,
|
|
516
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { fill: "none", d: "M0 0h24v24H0z" }),
|
|
517
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z" })
|
|
265
518
|
]
|
|
266
519
|
})
|
|
267
520
|
);
|
|
@@ -269,10 +522,10 @@ var ChevronUpIcon = (0, import_react5.forwardRef)((props, ref) => {
|
|
|
269
522
|
var ChevronUpIcon_default = ChevronUpIcon;
|
|
270
523
|
|
|
271
524
|
// src/icons/LoaderIcon.tsx
|
|
272
|
-
var
|
|
273
|
-
var
|
|
274
|
-
var LoaderIcon = (0,
|
|
275
|
-
return /* @__PURE__ */ (0,
|
|
525
|
+
var import_react14 = require("react");
|
|
526
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
527
|
+
var LoaderIcon = (0, import_react14.forwardRef)((props, ref) => {
|
|
528
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
276
529
|
"svg",
|
|
277
530
|
__spreadProps(__spreadValues({
|
|
278
531
|
ref,
|
|
@@ -287,93 +540,66 @@ var LoaderIcon = (0, import_react6.forwardRef)((props, ref) => {
|
|
|
287
540
|
xmlns: "http://www.w3.org/2000/svg"
|
|
288
541
|
}, props), {
|
|
289
542
|
children: [
|
|
290
|
-
/* @__PURE__ */ (0,
|
|
291
|
-
/* @__PURE__ */ (0,
|
|
543
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
544
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("path", { d: "M12 3a9 9 0 1 0 9 9" })
|
|
292
545
|
]
|
|
293
546
|
})
|
|
294
547
|
);
|
|
295
548
|
});
|
|
296
549
|
var LoaderIcon_default = LoaderIcon;
|
|
297
550
|
|
|
298
|
-
// src/
|
|
299
|
-
var
|
|
300
|
-
var
|
|
301
|
-
var
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
551
|
+
// src/icons/CloseIcon.tsx
|
|
552
|
+
var import_react15 = require("react");
|
|
553
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
554
|
+
var CloseIcon = (0, import_react15.forwardRef)((props, ref) => {
|
|
555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
556
|
+
"svg",
|
|
557
|
+
__spreadProps(__spreadValues({
|
|
558
|
+
ref,
|
|
559
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
560
|
+
width: "24",
|
|
561
|
+
height: "24",
|
|
562
|
+
viewBox: "0 0 24 24",
|
|
563
|
+
strokeWidth: "2",
|
|
564
|
+
stroke: "currentColor",
|
|
565
|
+
fill: "none",
|
|
566
|
+
strokeLinecap: "round",
|
|
567
|
+
strokeLinejoin: "round"
|
|
568
|
+
}, props), {
|
|
569
|
+
children: [
|
|
570
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }),
|
|
571
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M18 6l-12 12" }),
|
|
572
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M6 6l12 12" })
|
|
573
|
+
]
|
|
574
|
+
})
|
|
575
|
+
);
|
|
308
576
|
});
|
|
309
|
-
var
|
|
577
|
+
var CloseIcon_default = CloseIcon;
|
|
310
578
|
|
|
311
|
-
// src/
|
|
312
|
-
var
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
startContent,
|
|
325
|
-
endContent,
|
|
326
|
-
block,
|
|
327
|
-
loading,
|
|
328
|
-
disabled
|
|
329
|
-
} = _b, rest = __objRest(_b, [
|
|
330
|
-
"as",
|
|
331
|
-
"children",
|
|
332
|
-
"className",
|
|
333
|
-
"role",
|
|
334
|
-
"variant",
|
|
335
|
-
"color",
|
|
336
|
-
"size",
|
|
337
|
-
"iconOnly",
|
|
338
|
-
"startContent",
|
|
339
|
-
"endContent",
|
|
340
|
-
"block",
|
|
341
|
-
"loading",
|
|
342
|
-
"disabled"
|
|
343
|
-
]);
|
|
344
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
345
|
-
Component,
|
|
346
|
-
__spreadProps(__spreadValues({
|
|
347
|
-
ref,
|
|
348
|
-
className: (0, import_clsx5.default)(
|
|
349
|
-
`${PREFIX_CLS}button`,
|
|
350
|
-
{
|
|
351
|
-
[`${PREFIX_CLS}button--${variant}`]: variant,
|
|
352
|
-
[`${PREFIX_CLS}button--${color}`]: color,
|
|
353
|
-
[`${PREFIX_CLS}button--${size}`]: size,
|
|
354
|
-
[`${PREFIX_CLS}button--block`]: block,
|
|
355
|
-
[`${PREFIX_CLS}button--icon-only`]: iconOnly,
|
|
356
|
-
[`${PREFIX_CLS}button--disabled`]: disabled
|
|
357
|
-
},
|
|
358
|
-
className
|
|
359
|
-
),
|
|
360
|
-
role,
|
|
361
|
-
disabled
|
|
362
|
-
}, rest), {
|
|
363
|
-
children: [
|
|
364
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `${PREFIX_CLS}overlay` }),
|
|
365
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `${PREFIX_CLS}outline` }),
|
|
366
|
-
loading ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Icon_default, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(LoaderIcon_default, { className: `${PREFIX_CLS}animation-spin` }) }) : startContent,
|
|
367
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: `${PREFIX_CLS}button__content`, children }),
|
|
368
|
-
endContent
|
|
369
|
-
]
|
|
370
|
-
})
|
|
371
|
-
);
|
|
579
|
+
// src/utils/scroll.ts
|
|
580
|
+
var scrollToItem = (parentElement, currentElement) => {
|
|
581
|
+
const parentRect = parentElement.getBoundingClientRect();
|
|
582
|
+
const currentRect = currentElement.getBoundingClientRect();
|
|
583
|
+
const behavior = "smooth";
|
|
584
|
+
const previousElement = currentElement.previousSibling;
|
|
585
|
+
const previousRect = (previousElement == null ? void 0 : previousElement.getBoundingClientRect()) || currentRect;
|
|
586
|
+
if (parentRect.left > previousRect.left) {
|
|
587
|
+
let offset = 0;
|
|
588
|
+
if (previousElement) {
|
|
589
|
+
offset = previousRect.left - parentRect.left + parentElement.scrollLeft + previousRect.width / 4;
|
|
590
|
+
}
|
|
591
|
+
parentElement.scrollTo({ behavior, left: offset });
|
|
372
592
|
}
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
593
|
+
const nextElement = currentElement.nextSibling;
|
|
594
|
+
const nextRect = (nextElement == null ? void 0 : nextElement.getBoundingClientRect()) || currentRect;
|
|
595
|
+
if (parentRect.right < nextRect.right) {
|
|
596
|
+
let offset = parentElement.scrollWidth;
|
|
597
|
+
if (nextElement) {
|
|
598
|
+
offset = nextRect.right - parentRect.right + parentElement.scrollLeft - nextRect.width / 4;
|
|
599
|
+
}
|
|
600
|
+
parentElement.scrollTo({ behavior, left: offset });
|
|
601
|
+
}
|
|
602
|
+
};
|
|
377
603
|
|
|
378
604
|
// src/utils/clsx.ts
|
|
379
605
|
function toVal(mix) {
|
|
@@ -401,7 +627,7 @@ function toVal(mix) {
|
|
|
401
627
|
}
|
|
402
628
|
return str;
|
|
403
629
|
}
|
|
404
|
-
function
|
|
630
|
+
function clsx(...inputs) {
|
|
405
631
|
let i = 0, tmp, x, str = "";
|
|
406
632
|
while (i < inputs.length) {
|
|
407
633
|
if (tmp = inputs[i++]) {
|
|
@@ -413,115 +639,415 @@ function clsx6(...inputs) {
|
|
|
413
639
|
}
|
|
414
640
|
return str;
|
|
415
641
|
}
|
|
416
|
-
var clsx_default =
|
|
417
|
-
|
|
418
|
-
// src/utils/
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
if (parentRect.left > previousRect.left) {
|
|
426
|
-
let offset = 0;
|
|
427
|
-
if (previousElement) {
|
|
428
|
-
offset = previousRect.left - parentRect.left + parentElement.scrollLeft + previousRect.width / 4;
|
|
429
|
-
}
|
|
430
|
-
parentElement.scrollTo({ behavior, left: offset });
|
|
642
|
+
var clsx_default = clsx;
|
|
643
|
+
|
|
644
|
+
// src/utils/mergeRefs.ts
|
|
645
|
+
function assignRef(ref, value) {
|
|
646
|
+
if (ref == null)
|
|
647
|
+
return;
|
|
648
|
+
if (typeof ref === "function") {
|
|
649
|
+
ref(value);
|
|
650
|
+
return;
|
|
431
651
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
if (nextElement) {
|
|
437
|
-
offset = nextRect.right - parentRect.right + parentElement.scrollLeft - nextRect.width / 4;
|
|
438
|
-
}
|
|
439
|
-
parentElement.scrollTo({ behavior, left: offset });
|
|
652
|
+
try {
|
|
653
|
+
ref.current = value;
|
|
654
|
+
} catch (error) {
|
|
655
|
+
throw new Error(`Cannot assign value '${value}' to ref '${ref}'`);
|
|
440
656
|
}
|
|
441
|
-
}
|
|
657
|
+
}
|
|
658
|
+
function mergeRefs(...refs) {
|
|
659
|
+
return (node) => {
|
|
660
|
+
refs.forEach((ref) => {
|
|
661
|
+
assignRef(ref, node);
|
|
662
|
+
});
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
var mergeRefs_default = mergeRefs;
|
|
442
666
|
|
|
443
|
-
// src/components/
|
|
444
|
-
var
|
|
445
|
-
var
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
667
|
+
// src/components/Button/Button.tsx
|
|
668
|
+
var import_clsx3 = __toESM(require("clsx"));
|
|
669
|
+
var import_react17 = require("react");
|
|
670
|
+
|
|
671
|
+
// src/components/Icon/Icon.tsx
|
|
672
|
+
var import_clsx2 = __toESM(require("clsx"));
|
|
673
|
+
var import_react16 = require("react");
|
|
674
|
+
var Icon = (0, import_react16.forwardRef)(({ children, size }, ref) => {
|
|
675
|
+
const child = import_react16.Children.only(children);
|
|
676
|
+
return (0, import_react16.cloneElement)(child, __spreadProps(__spreadValues({
|
|
677
|
+
ref
|
|
678
|
+
}, child.props), {
|
|
679
|
+
className: (0, import_clsx2.default)(`${PREFIX_CLS}icon`, { [`${PREFIX_CLS}font-size-${size}`]: size }, child.props.className)
|
|
680
|
+
}));
|
|
449
681
|
});
|
|
450
|
-
var
|
|
682
|
+
var Icon_default = Icon;
|
|
451
683
|
|
|
452
|
-
// src/components/
|
|
453
|
-
var
|
|
454
|
-
var
|
|
455
|
-
var CardHeader = (0, import_react10.forwardRef)(
|
|
684
|
+
// src/components/Button/Button.tsx
|
|
685
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
686
|
+
var Button = (0, import_react17.forwardRef)(
|
|
456
687
|
(_a, ref) => {
|
|
457
|
-
var _b = _a, {
|
|
688
|
+
var _b = _a, {
|
|
689
|
+
as: Component = "button",
|
|
690
|
+
children,
|
|
691
|
+
className,
|
|
692
|
+
role = "presentation",
|
|
693
|
+
variant = "text",
|
|
694
|
+
color = "primary",
|
|
695
|
+
size = "md",
|
|
696
|
+
iconOnly,
|
|
697
|
+
startContent,
|
|
698
|
+
endContent,
|
|
699
|
+
block,
|
|
700
|
+
loading,
|
|
701
|
+
disabled
|
|
702
|
+
} = _b, rest = __objRest(_b, [
|
|
703
|
+
"as",
|
|
704
|
+
"children",
|
|
705
|
+
"className",
|
|
706
|
+
"role",
|
|
707
|
+
"variant",
|
|
708
|
+
"color",
|
|
709
|
+
"size",
|
|
710
|
+
"iconOnly",
|
|
711
|
+
"startContent",
|
|
712
|
+
"endContent",
|
|
713
|
+
"block",
|
|
714
|
+
"loading",
|
|
715
|
+
"disabled"
|
|
716
|
+
]);
|
|
458
717
|
const prefixCls = PREFIX_CLS;
|
|
459
|
-
return /* @__PURE__ */ (0,
|
|
460
|
-
startContent && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `${prefixCls}card-header__start-content`, children: startContent }),
|
|
461
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: `${prefixCls}card-header__content`, children: [
|
|
462
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `${prefixCls}card-header__title`, children: title }),
|
|
463
|
-
subtitle && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `${prefixCls}card-header__subtitle`, children: subtitle })
|
|
464
|
-
] }),
|
|
465
|
-
endContent && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: `${prefixCls}card-header__end-content`, children: endContent })
|
|
466
|
-
] }));
|
|
467
|
-
}
|
|
468
|
-
);
|
|
469
|
-
var CardHeader_default = CardHeader;
|
|
470
|
-
|
|
471
|
-
// src/components/Chip/Chip.tsx
|
|
472
|
-
var import_clsx7 = __toESM(require("clsx"));
|
|
473
|
-
var import_react11 = require("react");
|
|
474
|
-
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
475
|
-
var Chip = (0, import_react11.forwardRef)(
|
|
476
|
-
(_a, ref) => {
|
|
477
|
-
var _b = _a, { as: Component = "div", children, className, variant, color, size } = _b, rest = __objRest(_b, ["as", "children", "className", "variant", "color", "size"]);
|
|
478
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
718
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
479
719
|
Component,
|
|
480
720
|
__spreadProps(__spreadValues({
|
|
481
721
|
ref,
|
|
482
|
-
className: (0,
|
|
483
|
-
`${
|
|
722
|
+
className: (0, import_clsx3.default)(
|
|
723
|
+
`${prefixCls}button`,
|
|
484
724
|
{
|
|
485
|
-
[`${
|
|
486
|
-
[`${
|
|
487
|
-
[`${
|
|
725
|
+
[`${prefixCls}button--${variant}`]: variant,
|
|
726
|
+
[`${prefixCls}button--${color}`]: color,
|
|
727
|
+
[`${prefixCls}button--${size}`]: size,
|
|
728
|
+
[`${prefixCls}button--block`]: block,
|
|
729
|
+
[`${prefixCls}button--icon-only`]: iconOnly,
|
|
730
|
+
[`${prefixCls}button--disabled`]: disabled
|
|
488
731
|
},
|
|
489
732
|
className
|
|
490
|
-
)
|
|
733
|
+
),
|
|
734
|
+
role,
|
|
735
|
+
disabled
|
|
491
736
|
}, rest), {
|
|
492
737
|
children: [
|
|
493
|
-
/* @__PURE__ */ (0,
|
|
494
|
-
/* @__PURE__ */ (0,
|
|
495
|
-
children
|
|
738
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: `${prefixCls}overlay` }),
|
|
739
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: `${prefixCls}outline` }),
|
|
740
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(Icon_default, { children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(LoaderIcon_default, { className: `${prefixCls}animation-spin` }) }) : startContent,
|
|
741
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: `${prefixCls}button__content`, children }),
|
|
742
|
+
endContent
|
|
496
743
|
]
|
|
497
744
|
})
|
|
498
745
|
);
|
|
499
746
|
}
|
|
500
747
|
);
|
|
501
|
-
var Chip_default = Chip;
|
|
502
748
|
|
|
503
|
-
// src/components/
|
|
504
|
-
var
|
|
749
|
+
// src/components/Popover/Popover.tsx
|
|
750
|
+
var import_react21 = require("react");
|
|
505
751
|
|
|
506
|
-
// src/components/
|
|
507
|
-
var
|
|
508
|
-
var
|
|
509
|
-
var
|
|
510
|
-
|
|
752
|
+
// src/components/Portal/Portal.tsx
|
|
753
|
+
var import_react18 = require("react");
|
|
754
|
+
var import_react_dom = require("react-dom");
|
|
755
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
756
|
+
var Portal = (0, import_react18.forwardRef)(({ children, container }, ref) => {
|
|
757
|
+
const prefixCls = PREFIX_CLS;
|
|
758
|
+
return (0, import_react_dom.createPortal)(
|
|
759
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { ref, className: `${prefixCls}portal`, children }),
|
|
760
|
+
container || document.body
|
|
761
|
+
);
|
|
762
|
+
});
|
|
763
|
+
var Portal_default = Portal;
|
|
764
|
+
|
|
765
|
+
// src/components/Transition/Transition.tsx
|
|
766
|
+
var import_clsx4 = __toESM(require("clsx"));
|
|
767
|
+
var import_react19 = require("react");
|
|
768
|
+
var import_react_transition_group = require("react-transition-group");
|
|
769
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
770
|
+
var Transition = (0, import_react19.forwardRef)((props, ref) => {
|
|
771
|
+
const {
|
|
772
|
+
children,
|
|
773
|
+
className,
|
|
774
|
+
nodeRef,
|
|
775
|
+
name,
|
|
776
|
+
isOpen,
|
|
777
|
+
enter = 0,
|
|
778
|
+
leave = 0,
|
|
779
|
+
mountOnEnter,
|
|
780
|
+
unmountOnExit,
|
|
781
|
+
onExited
|
|
782
|
+
} = props;
|
|
783
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
784
|
+
import_react_transition_group.CSSTransition,
|
|
785
|
+
{
|
|
786
|
+
nodeRef,
|
|
787
|
+
in: isOpen,
|
|
788
|
+
appear: true,
|
|
789
|
+
timeout: { enter, exit: leave },
|
|
790
|
+
mountOnEnter,
|
|
791
|
+
unmountOnExit,
|
|
792
|
+
classNames: (0, import_clsx4.default)(name, className),
|
|
793
|
+
onExited,
|
|
794
|
+
children
|
|
795
|
+
}
|
|
796
|
+
);
|
|
797
|
+
});
|
|
798
|
+
var Transition_default = Transition;
|
|
799
|
+
|
|
800
|
+
// src/components/Popover/constans.ts
|
|
801
|
+
var POPOVER_TRANSITION_DURATION_LEAVE = 150;
|
|
802
|
+
|
|
803
|
+
// src/components/Popover/PopoverContext.tsx
|
|
804
|
+
var import_react20 = require("react");
|
|
805
|
+
var PopoverContext = (0, import_react20.createContext)(null);
|
|
806
|
+
var usePopover = () => {
|
|
807
|
+
const context = (0, import_react20.useContext)(PopoverContext);
|
|
511
808
|
if (!context) {
|
|
512
|
-
throw new Error("`
|
|
809
|
+
throw new Error("`usePopover` must be used within a `<Popover />`");
|
|
513
810
|
}
|
|
514
811
|
return context;
|
|
515
812
|
};
|
|
516
|
-
var
|
|
813
|
+
var PopoverContext_default = PopoverContext;
|
|
517
814
|
|
|
518
|
-
// src/components/
|
|
519
|
-
var
|
|
815
|
+
// src/components/Popover/Popover.tsx
|
|
816
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
817
|
+
var Popover = (props) => {
|
|
818
|
+
const {
|
|
819
|
+
children,
|
|
820
|
+
target,
|
|
821
|
+
autoClose = true,
|
|
822
|
+
triggerClosable = true,
|
|
823
|
+
isOpen,
|
|
824
|
+
onOpen,
|
|
825
|
+
onClose,
|
|
826
|
+
onToggle,
|
|
827
|
+
onAfterClose
|
|
828
|
+
} = props;
|
|
829
|
+
const triggerRef = (0, import_react21.useRef)(null);
|
|
830
|
+
const contentRef = (0, import_react21.useRef)(null);
|
|
831
|
+
const [internalOpen, setInternalOpen] = (0, import_react21.useState)(props.isOpen || false);
|
|
832
|
+
const [trigger, content] = import_react21.Children.toArray(children);
|
|
833
|
+
const prefixCls = PREFIX_CLS;
|
|
834
|
+
const handleOpen = () => {
|
|
835
|
+
if (isOpen !== void 0) {
|
|
836
|
+
onOpen == null ? void 0 : onOpen();
|
|
837
|
+
} else {
|
|
838
|
+
setInternalOpen(true);
|
|
839
|
+
}
|
|
840
|
+
};
|
|
841
|
+
const handleClose = () => {
|
|
842
|
+
if (isOpen !== void 0) {
|
|
843
|
+
onClose == null ? void 0 : onClose();
|
|
844
|
+
} else {
|
|
845
|
+
setInternalOpen(false);
|
|
846
|
+
}
|
|
847
|
+
};
|
|
848
|
+
const handleToggle = () => {
|
|
849
|
+
if (isOpen !== void 0) {
|
|
850
|
+
onToggle == null ? void 0 : onToggle();
|
|
851
|
+
} else {
|
|
852
|
+
setInternalOpen((prevState) => !prevState);
|
|
853
|
+
}
|
|
854
|
+
};
|
|
855
|
+
(0, import_react21.useEffect)(() => {
|
|
856
|
+
setInternalOpen(isOpen || false);
|
|
857
|
+
}, [isOpen]);
|
|
858
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
859
|
+
PopoverContext_default.Provider,
|
|
860
|
+
{
|
|
861
|
+
value: {
|
|
862
|
+
triggerRef,
|
|
863
|
+
contentRef,
|
|
864
|
+
target,
|
|
865
|
+
isOpen: internalOpen,
|
|
866
|
+
autoClose,
|
|
867
|
+
triggerClosable,
|
|
868
|
+
onOpen: handleOpen,
|
|
869
|
+
onClose: handleClose,
|
|
870
|
+
onToggle: handleToggle
|
|
871
|
+
},
|
|
872
|
+
children: [
|
|
873
|
+
trigger,
|
|
874
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
875
|
+
Transition_default,
|
|
876
|
+
{
|
|
877
|
+
nodeRef: contentRef,
|
|
878
|
+
isOpen: internalOpen,
|
|
879
|
+
enter: 300,
|
|
880
|
+
leave: POPOVER_TRANSITION_DURATION_LEAVE,
|
|
881
|
+
name: `${prefixCls}popover`,
|
|
882
|
+
unmountOnExit: true,
|
|
883
|
+
onExited: onAfterClose,
|
|
884
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Portal_default, { children: (0, import_react21.cloneElement)(import_react21.Children.only(content), __spreadProps(__spreadValues({}, content.props), {
|
|
885
|
+
ref: contentRef
|
|
886
|
+
})) })
|
|
887
|
+
}
|
|
888
|
+
)
|
|
889
|
+
]
|
|
890
|
+
}
|
|
891
|
+
);
|
|
892
|
+
};
|
|
893
|
+
var Popover_default = Popover;
|
|
894
|
+
|
|
895
|
+
// src/components/Popover/PopoverContent.tsx
|
|
896
|
+
var import_react22 = require("react");
|
|
897
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
898
|
+
function getScrollParent(node) {
|
|
899
|
+
if (node == null) {
|
|
900
|
+
return null;
|
|
901
|
+
}
|
|
902
|
+
if (node.scrollHeight > node.clientHeight) {
|
|
903
|
+
return node;
|
|
904
|
+
} else {
|
|
905
|
+
return getScrollParent(node.parentNode);
|
|
906
|
+
}
|
|
907
|
+
}
|
|
908
|
+
var PopoverContent = (0, import_react22.forwardRef)((props, ref) => {
|
|
909
|
+
const _a = props, { children, style, className, onClick } = _a, rest = __objRest(_a, ["children", "style", "className", "onClick"]);
|
|
910
|
+
const { triggerRef, contentRef, target, onClose } = usePopover();
|
|
911
|
+
const prefixCls = PREFIX_CLS;
|
|
912
|
+
const menuListRef = (0, import_react22.useRef)(null);
|
|
913
|
+
const [contentStyle, setContentStyle] = (0, import_react22.useState)({
|
|
914
|
+
position: "absolute",
|
|
915
|
+
top: 0,
|
|
916
|
+
left: 0,
|
|
917
|
+
visibility: "hidden"
|
|
918
|
+
});
|
|
919
|
+
const containerEl = getScrollParent(triggerRef.current) || window;
|
|
920
|
+
useElementSize_default({
|
|
921
|
+
target: containerEl,
|
|
922
|
+
callback: () => {
|
|
923
|
+
handleSize();
|
|
924
|
+
}
|
|
925
|
+
});
|
|
926
|
+
useOnClickOutside_default(contentRef, (event) => {
|
|
927
|
+
const el = triggerRef.current;
|
|
928
|
+
if (!el || el.contains(event.target))
|
|
929
|
+
return;
|
|
930
|
+
onClose();
|
|
931
|
+
});
|
|
932
|
+
const handleClick = (ev) => {
|
|
933
|
+
ev.stopPropagation();
|
|
934
|
+
onClick == null ? void 0 : onClick(ev);
|
|
935
|
+
};
|
|
936
|
+
const handleSize = (0, import_react22.useCallback)(() => {
|
|
937
|
+
var _a2, _b;
|
|
938
|
+
const popoverRect = (_a2 = contentRef.current) == null ? void 0 : _a2.getBoundingClientRect();
|
|
939
|
+
const triggerClientRect = (_b = triggerRef.current) == null ? void 0 : _b.getBoundingClientRect();
|
|
940
|
+
if (!popoverRect || !triggerClientRect || !containerEl) {
|
|
941
|
+
return;
|
|
942
|
+
}
|
|
943
|
+
const container = { innerWidth: window.innerWidth, innerHeight: window.innerHeight };
|
|
944
|
+
const triggerRect = {
|
|
945
|
+
width: triggerClientRect.width,
|
|
946
|
+
height: triggerClientRect.height,
|
|
947
|
+
top: triggerClientRect.top + window.scrollY,
|
|
948
|
+
bottom: triggerClientRect.top + triggerClientRect.height + window.scrollY,
|
|
949
|
+
left: triggerClientRect.left + window.scrollX,
|
|
950
|
+
right: triggerClientRect.left + triggerClientRect.width + window.scrollX
|
|
951
|
+
};
|
|
952
|
+
const outsideX = triggerRect.left + popoverRect.width > container.innerWidth;
|
|
953
|
+
const outsideY = triggerRect.top + popoverRect.height > container.innerHeight + window.scrollY;
|
|
954
|
+
const style2 = __spreadProps(__spreadValues({}, target && {
|
|
955
|
+
width: triggerRect.width,
|
|
956
|
+
minWidth: "auto"
|
|
957
|
+
}), {
|
|
958
|
+
position: "absolute",
|
|
959
|
+
top: outsideY ? void 0 : triggerRect.bottom,
|
|
960
|
+
bottom: outsideY ? container.innerHeight - triggerRect.top : void 0,
|
|
961
|
+
left: outsideX ? void 0 : triggerRect.left,
|
|
962
|
+
right: outsideX ? container.innerWidth - triggerRect.right : void 0,
|
|
963
|
+
visibility: void 0
|
|
964
|
+
});
|
|
965
|
+
setContentStyle(style2);
|
|
966
|
+
}, []);
|
|
967
|
+
(0, import_react22.useEffect)(() => {
|
|
968
|
+
handleSize();
|
|
969
|
+
containerEl.addEventListener("scroll", handleSize);
|
|
970
|
+
window.addEventListener("orientationchange", handleSize);
|
|
971
|
+
return () => {
|
|
972
|
+
containerEl.removeEventListener("scroll", handleSize);
|
|
973
|
+
window.removeEventListener("orientationchange", handleSize);
|
|
974
|
+
};
|
|
975
|
+
}, []);
|
|
976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
977
|
+
"div",
|
|
978
|
+
__spreadProps(__spreadValues({
|
|
979
|
+
ref: mergeRefs_default(menuListRef, ref),
|
|
980
|
+
className: clsx_default(`${prefixCls}popover`, className),
|
|
981
|
+
style: __spreadValues(__spreadValues({}, style), contentStyle),
|
|
982
|
+
onClick: handleClick
|
|
983
|
+
}, rest), {
|
|
984
|
+
children: [
|
|
985
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: `${prefixCls}popover__overlay` }),
|
|
986
|
+
children
|
|
987
|
+
]
|
|
988
|
+
})
|
|
989
|
+
);
|
|
990
|
+
});
|
|
991
|
+
var PopoverContent_default = PopoverContent;
|
|
992
|
+
|
|
993
|
+
// src/components/Popover/PopoverTrigger.tsx
|
|
994
|
+
var import_react23 = require("react");
|
|
995
|
+
var PopoverTrigger = (0, import_react23.forwardRef)((props, ref) => {
|
|
996
|
+
const _a = props, { children, onClick } = _a, rest = __objRest(_a, ["children", "onClick"]);
|
|
997
|
+
const { isOpen, triggerRef, triggerClosable, onOpen, onClose } = usePopover();
|
|
998
|
+
const child = import_react23.Children.only(typeof children === "function" ? children(isOpen) : children);
|
|
999
|
+
const handleClick = (ev) => {
|
|
1000
|
+
var _a2, _b;
|
|
1001
|
+
ev.preventDefault();
|
|
1002
|
+
triggerClosable && isOpen ? onClose() : onOpen();
|
|
1003
|
+
onClick == null ? void 0 : onClick(ev);
|
|
1004
|
+
(_b = (_a2 = child.props).onClick) == null ? void 0 : _b.call(_a2, ev);
|
|
1005
|
+
};
|
|
1006
|
+
return (0, import_react23.cloneElement)(child, __spreadProps(__spreadValues(__spreadValues({}, child.props), rest), {
|
|
1007
|
+
ref: mergeRefs_default(ref, triggerRef),
|
|
1008
|
+
onClick: handleClick
|
|
1009
|
+
}));
|
|
1010
|
+
});
|
|
1011
|
+
var PopoverTrigger_default = PopoverTrigger;
|
|
1012
|
+
|
|
1013
|
+
// src/components/Autocomplete/AutocompleteContent.tsx
|
|
1014
|
+
var import_react33 = require("react");
|
|
1015
|
+
|
|
1016
|
+
// src/components/List/List.tsx
|
|
1017
|
+
var import_react24 = require("react");
|
|
1018
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
1019
|
+
var List = (0, import_react24.forwardRef)((_a, ref) => {
|
|
1020
|
+
var _b = _a, { as: Component = "div", children } = _b, rest = __objRest(_b, ["as", "children"]);
|
|
1021
|
+
const prefixCls = PREFIX_CLS;
|
|
1022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Component, __spreadProps(__spreadValues({ ref, className: `${prefixCls}list` }, rest), { children }));
|
|
1023
|
+
});
|
|
1024
|
+
var List_default = List;
|
|
1025
|
+
|
|
1026
|
+
// src/components/List/ListGroup.tsx
|
|
1027
|
+
var import_react30 = require("react");
|
|
1028
|
+
|
|
1029
|
+
// src/components/Collapse/Collapse.tsx
|
|
1030
|
+
var import_react26 = require("react");
|
|
1031
|
+
|
|
1032
|
+
// src/components/Collapse/CollapseContext.tsx
|
|
1033
|
+
var import_react25 = require("react");
|
|
1034
|
+
var CollapseContext = (0, import_react25.createContext)(null);
|
|
1035
|
+
var useCollapse = () => {
|
|
1036
|
+
const context = (0, import_react25.useContext)(CollapseContext);
|
|
1037
|
+
if (!context) {
|
|
1038
|
+
throw new Error("`useCollapse` must be used within a `<Collapse />`");
|
|
1039
|
+
}
|
|
1040
|
+
return context;
|
|
1041
|
+
};
|
|
1042
|
+
var CollapseContext_default = CollapseContext;
|
|
1043
|
+
|
|
1044
|
+
// src/components/Collapse/Collapse.tsx
|
|
1045
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
520
1046
|
var Collapse = ({ children, isOpen, onOpen, onClose, onToggle }) => {
|
|
521
|
-
const collapseRef = (0,
|
|
522
|
-
const [selfIsOpen, setSelfIsOpen] = (0,
|
|
523
|
-
const [heightAuto, setHeightAuto] = (0,
|
|
524
|
-
const [trigger, content] =
|
|
1047
|
+
const collapseRef = (0, import_react26.useRef)(null);
|
|
1048
|
+
const [selfIsOpen, setSelfIsOpen] = (0, import_react26.useState)(isOpen != null ? isOpen : false);
|
|
1049
|
+
const [heightAuto, setHeightAuto] = (0, import_react26.useState)(false);
|
|
1050
|
+
const [trigger, content] = import_react26.Children.toArray(children);
|
|
525
1051
|
const handleOpen = () => {
|
|
526
1052
|
setSelfIsOpen(true);
|
|
527
1053
|
onOpen == null ? void 0 : onOpen();
|
|
@@ -534,7 +1060,7 @@ var Collapse = ({ children, isOpen, onOpen, onClose, onToggle }) => {
|
|
|
534
1060
|
setSelfIsOpen((prevState) => !prevState);
|
|
535
1061
|
onToggle == null ? void 0 : onToggle();
|
|
536
1062
|
};
|
|
537
|
-
(0,
|
|
1063
|
+
(0, import_react26.useEffect)(() => {
|
|
538
1064
|
if (isOpen !== void 0) {
|
|
539
1065
|
setSelfIsOpen(isOpen);
|
|
540
1066
|
}
|
|
@@ -546,7 +1072,7 @@ var Collapse = ({ children, isOpen, onOpen, onClose, onToggle }) => {
|
|
|
546
1072
|
}
|
|
547
1073
|
}, 100);
|
|
548
1074
|
}, [isOpen]);
|
|
549
|
-
return /* @__PURE__ */ (0,
|
|
1075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
550
1076
|
CollapseContext_default.Provider,
|
|
551
1077
|
{
|
|
552
1078
|
value: {
|
|
@@ -567,13 +1093,13 @@ var Collapse = ({ children, isOpen, onOpen, onClose, onToggle }) => {
|
|
|
567
1093
|
var Collapse_default = Collapse;
|
|
568
1094
|
|
|
569
1095
|
// src/components/Collapse/CollapseContent.tsx
|
|
570
|
-
var
|
|
571
|
-
var
|
|
572
|
-
var CollapseContent = (0,
|
|
1096
|
+
var import_clsx5 = __toESM(require("clsx"));
|
|
1097
|
+
var import_react27 = require("react");
|
|
1098
|
+
var CollapseContent = (0, import_react27.forwardRef)(({ children }, ref) => {
|
|
573
1099
|
var _a, _b;
|
|
574
1100
|
const { collapseRef, isOpen, heightAuto } = useCollapse();
|
|
575
|
-
const child =
|
|
576
|
-
return (0,
|
|
1101
|
+
const child = import_react27.Children.only(children);
|
|
1102
|
+
return (0, import_react27.cloneElement)(child, __spreadProps(__spreadValues({}, child.props), {
|
|
577
1103
|
ref: (node) => {
|
|
578
1104
|
collapseRef.current = node;
|
|
579
1105
|
if (ref !== null) {
|
|
@@ -583,18 +1109,18 @@ var CollapseContent = (0, import_react14.forwardRef)(({ children }, ref) => {
|
|
|
583
1109
|
style: __spreadProps(__spreadValues({}, child.props.style), {
|
|
584
1110
|
height: isOpen && heightAuto ? "auto" : isOpen ? (_a = collapseRef.current) == null ? void 0 : _a.scrollHeight : !isOpen && heightAuto ? (_b = collapseRef.current) == null ? void 0 : _b.scrollHeight : 0
|
|
585
1111
|
}),
|
|
586
|
-
className: (0,
|
|
1112
|
+
className: (0, import_clsx5.default)(`${PREFIX_CLS}collapse`, child.props.className)
|
|
587
1113
|
}));
|
|
588
1114
|
});
|
|
589
1115
|
var CollapseContent_default = CollapseContent;
|
|
590
1116
|
|
|
591
1117
|
// src/components/Collapse/CollapseTrigger.tsx
|
|
592
|
-
var
|
|
593
|
-
var CollapseTrigger = (0,
|
|
1118
|
+
var import_react28 = require("react");
|
|
1119
|
+
var CollapseTrigger = (0, import_react28.forwardRef)(({ children }, ref) => {
|
|
594
1120
|
const { collapseRef, onToggle } = useCollapse();
|
|
595
|
-
const child =
|
|
1121
|
+
const child = import_react28.Children.only(children);
|
|
596
1122
|
const _a = child.props, { onClick } = _a, rest = __objRest(_a, ["onClick"]);
|
|
597
|
-
return (0,
|
|
1123
|
+
return (0, import_react28.cloneElement)(child, __spreadValues({
|
|
598
1124
|
ref,
|
|
599
1125
|
onClick: (event) => {
|
|
600
1126
|
if (!collapseRef.current) {
|
|
@@ -607,47 +1133,746 @@ var CollapseTrigger = (0, import_react15.forwardRef)(({ children }, ref) => {
|
|
|
607
1133
|
});
|
|
608
1134
|
var CollapseTrigger_default = CollapseTrigger;
|
|
609
1135
|
|
|
610
|
-
// src/components/
|
|
611
|
-
var
|
|
612
|
-
var
|
|
613
|
-
var
|
|
1136
|
+
// src/components/List/ListItem.tsx
|
|
1137
|
+
var import_react29 = require("react");
|
|
1138
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
1139
|
+
var ListItem = (0, import_react29.forwardRef)(
|
|
1140
|
+
(_a, ref) => {
|
|
1141
|
+
var _b = _a, {
|
|
1142
|
+
as: Component = "div",
|
|
1143
|
+
className,
|
|
1144
|
+
title,
|
|
1145
|
+
subtitle,
|
|
1146
|
+
startContent,
|
|
1147
|
+
endContent,
|
|
1148
|
+
level = 1,
|
|
1149
|
+
hoverable,
|
|
1150
|
+
selected,
|
|
1151
|
+
disabled,
|
|
1152
|
+
slotProps,
|
|
1153
|
+
style,
|
|
1154
|
+
onClick
|
|
1155
|
+
} = _b, rest = __objRest(_b, [
|
|
1156
|
+
"as",
|
|
1157
|
+
"className",
|
|
1158
|
+
"title",
|
|
1159
|
+
"subtitle",
|
|
1160
|
+
"startContent",
|
|
1161
|
+
"endContent",
|
|
1162
|
+
"level",
|
|
1163
|
+
"hoverable",
|
|
1164
|
+
"selected",
|
|
1165
|
+
"disabled",
|
|
1166
|
+
"slotProps",
|
|
1167
|
+
"style",
|
|
1168
|
+
"onClick"
|
|
1169
|
+
]);
|
|
1170
|
+
var _a2, _b2;
|
|
1171
|
+
const prefixCls = PREFIX_CLS;
|
|
1172
|
+
const handleClick = (event) => {
|
|
1173
|
+
onClick == null ? void 0 : onClick(event);
|
|
1174
|
+
};
|
|
1175
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
1176
|
+
Component,
|
|
1177
|
+
__spreadProps(__spreadValues({
|
|
1178
|
+
ref,
|
|
1179
|
+
className: clsx_default(
|
|
1180
|
+
`${prefixCls}list-item`,
|
|
1181
|
+
{
|
|
1182
|
+
[`${prefixCls}list-item--selected`]: selected,
|
|
1183
|
+
[`${prefixCls}list-item--hoverable`]: hoverable,
|
|
1184
|
+
[`${prefixCls}list-item--disabled`]: disabled
|
|
1185
|
+
},
|
|
1186
|
+
className
|
|
1187
|
+
),
|
|
1188
|
+
style: __spreadValues({
|
|
1189
|
+
paddingLeft: level <= 1 ? `var(--${prefixCls}list-item-padding-x)` : `calc(${level} * var(--${prefixCls}list-item-padding-level))`
|
|
1190
|
+
}, style),
|
|
1191
|
+
onClick: handleClick
|
|
1192
|
+
}, rest), {
|
|
1193
|
+
children: [
|
|
1194
|
+
hoverable && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: `${prefixCls}overlay` }),
|
|
1195
|
+
startContent && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: `${prefixCls}list-item__start-content`, children: startContent }),
|
|
1196
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: `${prefixCls}list-item__content`, children: [
|
|
1197
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("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 })),
|
|
1198
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1199
|
+
"span",
|
|
1200
|
+
__spreadProps(__spreadValues({}, slotProps == null ? void 0 : slotProps.subtitle), {
|
|
1201
|
+
className: clsx_default(`${prefixCls}list-item__subtitle`, (_b2 = slotProps == null ? void 0 : slotProps.subtitle) == null ? void 0 : _b2.className),
|
|
1202
|
+
children: subtitle
|
|
1203
|
+
})
|
|
1204
|
+
)
|
|
1205
|
+
] }),
|
|
1206
|
+
endContent && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: `${prefixCls}list-item__end-content`, children: endContent })
|
|
1207
|
+
]
|
|
1208
|
+
})
|
|
1209
|
+
);
|
|
1210
|
+
}
|
|
1211
|
+
);
|
|
1212
|
+
var ListItem_default = ListItem;
|
|
1213
|
+
|
|
1214
|
+
// src/components/List/ListGroup.tsx
|
|
614
1215
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
615
|
-
var
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
1216
|
+
var ListGroup = (0, import_react30.forwardRef)(
|
|
1217
|
+
(_a, ref) => {
|
|
1218
|
+
var _b = _a, {
|
|
1219
|
+
children,
|
|
1220
|
+
startContent,
|
|
1221
|
+
endContent,
|
|
1222
|
+
expandVisible = true,
|
|
1223
|
+
expandPosition = "end",
|
|
1224
|
+
isOpen,
|
|
1225
|
+
onOpen,
|
|
1226
|
+
onClose,
|
|
1227
|
+
onToggle
|
|
1228
|
+
} = _b, rest = __objRest(_b, [
|
|
1229
|
+
"children",
|
|
1230
|
+
"startContent",
|
|
1231
|
+
"endContent",
|
|
1232
|
+
"expandVisible",
|
|
1233
|
+
"expandPosition",
|
|
1234
|
+
"isOpen",
|
|
1235
|
+
"onOpen",
|
|
1236
|
+
"onClose",
|
|
1237
|
+
"onToggle"
|
|
1238
|
+
]);
|
|
1239
|
+
const disclosure = isOpen !== void 0 ? { isOpen, onOpen, onClose, onToggle } : useDisclosure_default();
|
|
1240
|
+
const prefixCls = PREFIX_CLS;
|
|
1241
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: `${prefixCls}list-group`, children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(Collapse_default, __spreadProps(__spreadValues({}, disclosure), { children: [
|
|
1242
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CollapseTrigger_default, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
1243
|
+
ListItem_default,
|
|
1244
|
+
__spreadValues({
|
|
1245
|
+
ref,
|
|
1246
|
+
startContent: expandVisible && expandPosition === "start" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1247
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon_default, { children: disclosure.isOpen ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ChevronUpIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ChevronDownIcon_default, {}) }),
|
|
1248
|
+
startContent
|
|
1249
|
+
] }) : startContent,
|
|
1250
|
+
endContent: expandVisible && expandPosition === "end" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
1251
|
+
endContent,
|
|
1252
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Icon_default, { children: disclosure.isOpen ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ChevronUpIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ChevronDownIcon_default, {}) })
|
|
1253
|
+
] }) : endContent
|
|
1254
|
+
}, rest)
|
|
1255
|
+
) }),
|
|
1256
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(CollapseContent_default, { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(List_default, { children }) }) })
|
|
1257
|
+
] })) });
|
|
1258
|
+
}
|
|
1259
|
+
);
|
|
1260
|
+
var ListGroup_default = ListGroup;
|
|
1261
|
+
|
|
1262
|
+
// src/components/ScrollArea/ScrollArea.tsx
|
|
1263
|
+
var import_react31 = require("react");
|
|
1264
|
+
var import_react_custom_scrollbars_2 = require("react-custom-scrollbars-2");
|
|
1265
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
1266
|
+
var ScrollArea = (0, import_react31.forwardRef)(({ children, autoHide = false, style }, ref) => {
|
|
1267
|
+
const prefixCls = PREFIX_CLS;
|
|
1268
|
+
const renderView = (props) => {
|
|
1269
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", __spreadProps(__spreadValues({}, props), { className: clsx_default(`${prefixCls}scroll-area__view`, props.className) }));
|
|
620
1270
|
};
|
|
621
|
-
|
|
622
|
-
|
|
1271
|
+
const renderTrackHorizontal = (props) => {
|
|
1272
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1273
|
+
"div",
|
|
1274
|
+
__spreadProps(__spreadValues({}, props), {
|
|
1275
|
+
className: clsx_default(`${prefixCls}scroll-area__track ${prefixCls}scroll-area__track--horizontal`, props.className)
|
|
1276
|
+
})
|
|
1277
|
+
);
|
|
1278
|
+
};
|
|
1279
|
+
const renderTrackVertical = (props) => {
|
|
1280
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1281
|
+
"div",
|
|
1282
|
+
__spreadProps(__spreadValues({}, props), {
|
|
1283
|
+
className: clsx_default(`${prefixCls}scroll-area__track ${prefixCls}scroll-area__track--vertical`, props.className)
|
|
1284
|
+
})
|
|
1285
|
+
);
|
|
1286
|
+
};
|
|
1287
|
+
const renderThumbHorizontal = (props) => {
|
|
1288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1289
|
+
"div",
|
|
1290
|
+
__spreadProps(__spreadValues({}, props), {
|
|
1291
|
+
className: clsx_default(`${prefixCls}scroll-area__thumb ${prefixCls}scroll-area__thumb--horizontal`, props.className)
|
|
1292
|
+
})
|
|
1293
|
+
);
|
|
1294
|
+
};
|
|
1295
|
+
const renderThumbVertical = (props) => {
|
|
1296
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1297
|
+
"div",
|
|
1298
|
+
__spreadProps(__spreadValues({}, props), {
|
|
1299
|
+
className: clsx_default(`${prefixCls}scroll-area__thumb ${prefixCls}scroll-area__thumb--vertical`, props.className)
|
|
1300
|
+
})
|
|
1301
|
+
);
|
|
1302
|
+
};
|
|
1303
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
1304
|
+
import_react_custom_scrollbars_2.Scrollbars,
|
|
623
1305
|
{
|
|
624
|
-
|
|
625
|
-
className:
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
)
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
]
|
|
1306
|
+
autoHide,
|
|
1307
|
+
className: `${prefixCls}scroll-area`,
|
|
1308
|
+
renderTrackHorizontal,
|
|
1309
|
+
renderTrackVertical,
|
|
1310
|
+
renderThumbHorizontal,
|
|
1311
|
+
renderThumbVertical,
|
|
1312
|
+
renderView,
|
|
1313
|
+
style,
|
|
1314
|
+
ref: (node) => {
|
|
1315
|
+
node && assignRef(ref, node.container.firstElementChild);
|
|
1316
|
+
},
|
|
1317
|
+
children
|
|
637
1318
|
}
|
|
638
|
-
)
|
|
1319
|
+
);
|
|
1320
|
+
});
|
|
1321
|
+
var ScrollArea_default = ScrollArea;
|
|
1322
|
+
|
|
1323
|
+
// src/components/Autocomplete/AutocompleteContext.tsx
|
|
1324
|
+
var import_react32 = require("react");
|
|
1325
|
+
var AutocompleteContext = (0, import_react32.createContext)(null);
|
|
1326
|
+
var useAutocomplete = () => {
|
|
1327
|
+
const context = (0, import_react32.useContext)(AutocompleteContext);
|
|
1328
|
+
if (!context) {
|
|
1329
|
+
throw new Error("`useAutocomplete` must be used within a `<Autocomplete />`");
|
|
1330
|
+
}
|
|
1331
|
+
return context;
|
|
1332
|
+
};
|
|
1333
|
+
var AutocompleteContext_default = AutocompleteContext;
|
|
1334
|
+
|
|
1335
|
+
// src/components/Autocomplete/AutocompleteContent.tsx
|
|
1336
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
1337
|
+
var AutocompleteContent = () => {
|
|
1338
|
+
const { data, values, offset, setOffset, keyField, textField, onItemSelect, renderItem } = useAutocomplete();
|
|
1339
|
+
const parentRef = (0, import_react33.useRef)(null);
|
|
1340
|
+
const { isOpen } = usePopover();
|
|
1341
|
+
const handleItemSelect = (item) => {
|
|
1342
|
+
var _a;
|
|
1343
|
+
onItemSelect(item);
|
|
1344
|
+
setOffset(((_a = parentRef.current) == null ? void 0 : _a.scrollHeight) || 0);
|
|
1345
|
+
};
|
|
1346
|
+
(0, import_react33.useEffect)(() => {
|
|
1347
|
+
var _a;
|
|
1348
|
+
if (!isOpen)
|
|
1349
|
+
return;
|
|
1350
|
+
(_a = parentRef.current) == null ? void 0 : _a.scrollTo({ top: offset });
|
|
1351
|
+
}, [isOpen]);
|
|
1352
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1353
|
+
ScrollArea_default,
|
|
1354
|
+
{
|
|
1355
|
+
ref: parentRef,
|
|
1356
|
+
style: {
|
|
1357
|
+
height: `200px`,
|
|
1358
|
+
width: `100%`,
|
|
1359
|
+
position: "relative"
|
|
1360
|
+
},
|
|
1361
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(List_default, { children: renderItem ? data.map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_react33.Fragment, { children: renderItem(item, {
|
|
1362
|
+
title: "",
|
|
1363
|
+
selected: values.includes(item[keyField]),
|
|
1364
|
+
hoverable: true,
|
|
1365
|
+
onClick: () => handleItemSelect(item)
|
|
1366
|
+
}) }, item[keyField])) : data.map((item) => /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
1367
|
+
ListItem_default,
|
|
1368
|
+
{
|
|
1369
|
+
title: item[textField],
|
|
1370
|
+
selected: values.includes(item[keyField]),
|
|
1371
|
+
hoverable: true,
|
|
1372
|
+
onClick: () => handleItemSelect(item)
|
|
1373
|
+
},
|
|
1374
|
+
item[keyField]
|
|
1375
|
+
)) })
|
|
1376
|
+
}
|
|
1377
|
+
);
|
|
1378
|
+
};
|
|
1379
|
+
var AutocompleteContent_default = AutocompleteContent;
|
|
1380
|
+
|
|
1381
|
+
// src/components/Autocomplete/AutocompleteVirtual.tsx
|
|
1382
|
+
var import_react34 = require("react");
|
|
1383
|
+
|
|
1384
|
+
// src/components/Autocomplete/utils.ts
|
|
1385
|
+
var valueToValues = (value) => {
|
|
1386
|
+
return Array.isArray(value) ? value : value !== null ? [value] : [];
|
|
1387
|
+
};
|
|
1388
|
+
var valuesToValue = (values) => {
|
|
1389
|
+
return Array.isArray(values) ? values.length !== 0 ? values[0] : null : values;
|
|
1390
|
+
};
|
|
1391
|
+
|
|
1392
|
+
// src/components/Autocomplete/AutocompleteVirtual.tsx
|
|
1393
|
+
var import_jsx_runtime16 = require("react/jsx-runtime");
|
|
1394
|
+
var AutocompleteVirtual = () => {
|
|
1395
|
+
const { data, values, keyField, textField, virtual, onItemSelect, renderItem } = useAutocomplete();
|
|
1396
|
+
const parentRef = (0, import_react34.useRef)(null);
|
|
1397
|
+
const virtualizer = useVirtualizer_default(__spreadProps(__spreadValues({}, virtual), { count: data.length, parentRef }));
|
|
1398
|
+
const { isOpen } = usePopover();
|
|
1399
|
+
const handleItemSelect = (item) => {
|
|
1400
|
+
onItemSelect(item);
|
|
1401
|
+
};
|
|
1402
|
+
(0, import_react34.useEffect)(() => {
|
|
1403
|
+
if (!isOpen)
|
|
1404
|
+
return;
|
|
1405
|
+
const value = valuesToValue(values);
|
|
1406
|
+
const index = data.findIndex((item) => item[keyField] === value);
|
|
1407
|
+
virtualizer.scrollToIndex(index, { align: "start" });
|
|
1408
|
+
}, [isOpen]);
|
|
1409
|
+
if (!virtual)
|
|
1410
|
+
return null;
|
|
1411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1412
|
+
ScrollArea_default,
|
|
1413
|
+
{
|
|
1414
|
+
ref: parentRef,
|
|
1415
|
+
autoHide: true,
|
|
1416
|
+
style: {
|
|
1417
|
+
height: `200px`,
|
|
1418
|
+
width: `100%`,
|
|
1419
|
+
position: "relative"
|
|
1420
|
+
},
|
|
1421
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(List_default, { children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1422
|
+
"div",
|
|
1423
|
+
{
|
|
1424
|
+
style: {
|
|
1425
|
+
height: `${virtualizer.getTotalSize()}px`,
|
|
1426
|
+
width: "100%",
|
|
1427
|
+
position: "relative"
|
|
1428
|
+
},
|
|
1429
|
+
children: virtualizer.getVirtualItems().map((virtualItem) => {
|
|
1430
|
+
const isLoaderRow = virtualItem.index > data.length - 1;
|
|
1431
|
+
const item = data[virtualItem.index];
|
|
1432
|
+
if (isLoaderRow) {
|
|
1433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1434
|
+
ListItem_default,
|
|
1435
|
+
{
|
|
1436
|
+
title: virtual.hasNextPage ? "Loading..." : "Nothing more to load",
|
|
1437
|
+
style: {
|
|
1438
|
+
position: "absolute",
|
|
1439
|
+
top: 0,
|
|
1440
|
+
left: 0,
|
|
1441
|
+
width: "100%",
|
|
1442
|
+
height: `${virtualItem.size}px`,
|
|
1443
|
+
transform: `translateY(${virtualItem.start}px)`
|
|
1444
|
+
}
|
|
1445
|
+
},
|
|
1446
|
+
virtualItem.index
|
|
1447
|
+
);
|
|
1448
|
+
}
|
|
1449
|
+
if (!item) {
|
|
1450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1451
|
+
ListItem_default,
|
|
1452
|
+
{
|
|
1453
|
+
title: `Item ${virtualItem.index} not found`,
|
|
1454
|
+
style: {
|
|
1455
|
+
position: "absolute",
|
|
1456
|
+
top: 0,
|
|
1457
|
+
left: 0,
|
|
1458
|
+
width: "100%",
|
|
1459
|
+
height: `${virtualItem.size}px`,
|
|
1460
|
+
transform: `translateY(${virtualItem.start}px)`
|
|
1461
|
+
}
|
|
1462
|
+
},
|
|
1463
|
+
virtualItem.index
|
|
1464
|
+
);
|
|
1465
|
+
}
|
|
1466
|
+
if (renderItem) {
|
|
1467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_react34.Fragment, { children: renderItem(item, {
|
|
1468
|
+
title: "",
|
|
1469
|
+
selected: values.includes(item[keyField]),
|
|
1470
|
+
hoverable: true,
|
|
1471
|
+
style: {
|
|
1472
|
+
position: "absolute",
|
|
1473
|
+
top: 0,
|
|
1474
|
+
left: 0,
|
|
1475
|
+
width: "100%",
|
|
1476
|
+
height: `${virtualItem.size}px`,
|
|
1477
|
+
transform: `translateY(${virtualItem.start}px)`
|
|
1478
|
+
},
|
|
1479
|
+
onClick: () => handleItemSelect(item)
|
|
1480
|
+
}) }, virtualItem.index);
|
|
1481
|
+
}
|
|
1482
|
+
return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
|
|
1483
|
+
ListItem_default,
|
|
1484
|
+
{
|
|
1485
|
+
title: item[textField],
|
|
1486
|
+
selected: values.includes(item[keyField]),
|
|
1487
|
+
hoverable: true,
|
|
1488
|
+
style: {
|
|
1489
|
+
position: "absolute",
|
|
1490
|
+
top: 0,
|
|
1491
|
+
left: 0,
|
|
1492
|
+
width: "100%",
|
|
1493
|
+
height: `${virtualItem.size}px`,
|
|
1494
|
+
transform: `translateY(${virtualItem.start}px)`
|
|
1495
|
+
},
|
|
1496
|
+
onClick: () => handleItemSelect(item)
|
|
1497
|
+
},
|
|
1498
|
+
virtualItem.index
|
|
1499
|
+
);
|
|
1500
|
+
})
|
|
1501
|
+
}
|
|
1502
|
+
) })
|
|
1503
|
+
}
|
|
1504
|
+
);
|
|
1505
|
+
};
|
|
1506
|
+
var AutocompleteVirtual_default = AutocompleteVirtual;
|
|
1507
|
+
|
|
1508
|
+
// src/components/Autocomplete/Autocomplete.tsx
|
|
1509
|
+
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
1510
|
+
var Autocomplete = (props) => {
|
|
1511
|
+
const {
|
|
1512
|
+
data,
|
|
1513
|
+
value: valueProp,
|
|
1514
|
+
keyField = "key",
|
|
1515
|
+
textField = "text",
|
|
1516
|
+
isMultiple = false,
|
|
1517
|
+
disabled,
|
|
1518
|
+
loading,
|
|
1519
|
+
disclosure: disclosureProp,
|
|
1520
|
+
virtual,
|
|
1521
|
+
placeholder,
|
|
1522
|
+
style,
|
|
1523
|
+
startContent,
|
|
1524
|
+
endContent,
|
|
1525
|
+
onFilterChange,
|
|
1526
|
+
renderItem
|
|
1527
|
+
} = props;
|
|
1528
|
+
const disclosure = disclosureProp !== void 0 ? disclosureProp : useDisclosure_default();
|
|
1529
|
+
const prefixCls = PREFIX_CLS;
|
|
1530
|
+
const inputRef = (0, import_react35.useRef)(null);
|
|
1531
|
+
const [filter, setFilter] = (0, import_react35.useState)("");
|
|
1532
|
+
const [search, setSearch] = (0, import_react35.useState)("");
|
|
1533
|
+
const [isSearch, setIsSearch] = (0, import_react35.useState)(false);
|
|
1534
|
+
const [focus, setFocus] = (0, import_react35.useState)(false);
|
|
1535
|
+
const values = (0, import_react35.useMemo)(() => {
|
|
1536
|
+
return valueToValues(valueProp);
|
|
1537
|
+
}, [valueProp]);
|
|
1538
|
+
const items = (0, import_react35.useMemo)(() => {
|
|
1539
|
+
return data.filter((item) => values.includes(item[keyField]));
|
|
1540
|
+
}, [data, values]);
|
|
1541
|
+
const [offset, setOffset] = (0, import_react35.useState)(0);
|
|
1542
|
+
const handleClick = () => {
|
|
1543
|
+
var _a;
|
|
1544
|
+
(_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.focus();
|
|
1545
|
+
};
|
|
1546
|
+
const handleChange = (values2) => {
|
|
1547
|
+
var _a, _b, _c, _d, _e;
|
|
1548
|
+
if (props.isMultiple) {
|
|
1549
|
+
const items2 = data.filter((item) => values2.includes(item[keyField]));
|
|
1550
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, items2);
|
|
1551
|
+
(_b = props.onValueChange) == null ? void 0 : _b.call(props, values2);
|
|
1552
|
+
} else {
|
|
1553
|
+
const newValue = valuesToValue(values2);
|
|
1554
|
+
let item = null;
|
|
1555
|
+
if (newValue !== void 0) {
|
|
1556
|
+
item = (_c = data.find((item2) => item2[keyField] === newValue)) != null ? _c : null;
|
|
1557
|
+
}
|
|
1558
|
+
(_d = props.onChange) == null ? void 0 : _d.call(props, item);
|
|
1559
|
+
(_e = props.onValueChange) == null ? void 0 : _e.call(props, newValue);
|
|
1560
|
+
}
|
|
1561
|
+
};
|
|
1562
|
+
const handleClear = (event) => {
|
|
1563
|
+
var _a, _b, _c, _d;
|
|
1564
|
+
event.stopPropagation();
|
|
1565
|
+
setIsSearch(true);
|
|
1566
|
+
setSearch("");
|
|
1567
|
+
if (props.isMultiple) {
|
|
1568
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, []);
|
|
1569
|
+
(_b = props.onValueChange) == null ? void 0 : _b.call(props, []);
|
|
1570
|
+
} else {
|
|
1571
|
+
(_c = props.onChange) == null ? void 0 : _c.call(props, null);
|
|
1572
|
+
(_d = props.onValueChange) == null ? void 0 : _d.call(props, null);
|
|
1573
|
+
}
|
|
1574
|
+
setIsSearch(false);
|
|
1575
|
+
};
|
|
1576
|
+
const handleFilterChange = (event) => {
|
|
1577
|
+
!disclosure.isOpen && disclosure.onOpen();
|
|
1578
|
+
setIsSearch(true);
|
|
1579
|
+
setSearch(event.target.value);
|
|
1580
|
+
onFilterChange == null ? void 0 : onFilterChange(event.target.value);
|
|
1581
|
+
};
|
|
1582
|
+
const handleItemSelect = (item) => {
|
|
1583
|
+
var _a;
|
|
1584
|
+
const newValue = item[keyField];
|
|
1585
|
+
if (props.isMultiple) {
|
|
1586
|
+
const newValues = [...values];
|
|
1587
|
+
const valueIndex = values.indexOf(newValue);
|
|
1588
|
+
if (valueIndex === -1) {
|
|
1589
|
+
newValues.push(newValue);
|
|
1590
|
+
} else {
|
|
1591
|
+
newValues.splice(valueIndex, 1);
|
|
1592
|
+
}
|
|
1593
|
+
handleChange(newValues);
|
|
1594
|
+
} else {
|
|
1595
|
+
const value = valuesToValue(values);
|
|
1596
|
+
if (value !== newValue) {
|
|
1597
|
+
handleChange([newValue]);
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
if (isSearch) {
|
|
1601
|
+
setFilter(search);
|
|
1602
|
+
}
|
|
1603
|
+
setIsSearch(false);
|
|
1604
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
1605
|
+
disclosure.onClose();
|
|
1606
|
+
};
|
|
1607
|
+
const handleOpen = () => {
|
|
1608
|
+
disclosure.onOpen();
|
|
1609
|
+
setFocus(true);
|
|
1610
|
+
};
|
|
1611
|
+
const handleClose = () => {
|
|
1612
|
+
disclosure.onClose();
|
|
1613
|
+
if (!props.isMultiple) {
|
|
1614
|
+
if (isSearch) {
|
|
1615
|
+
const item = items[0];
|
|
1616
|
+
if (item !== void 0) {
|
|
1617
|
+
setSearch(item[textField]);
|
|
1618
|
+
onFilterChange == null ? void 0 : onFilterChange(filter);
|
|
1619
|
+
} else {
|
|
1620
|
+
setSearch("");
|
|
1621
|
+
onFilterChange == null ? void 0 : onFilterChange(filter);
|
|
1622
|
+
}
|
|
1623
|
+
setIsSearch(false);
|
|
1624
|
+
}
|
|
1625
|
+
}
|
|
1626
|
+
};
|
|
1627
|
+
(0, import_react35.useEffect)(() => {
|
|
1628
|
+
if (isSearch)
|
|
1629
|
+
return;
|
|
1630
|
+
if (!props.isMultiple) {
|
|
1631
|
+
const item = items[0];
|
|
1632
|
+
if (item !== void 0) {
|
|
1633
|
+
setSearch(item[textField]);
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1636
|
+
}, [items]);
|
|
1637
|
+
(0, import_react35.useEffect)(() => {
|
|
1638
|
+
const values2 = valueToValues(valueProp);
|
|
1639
|
+
const value = values2[0];
|
|
1640
|
+
if (value === void 0) {
|
|
1641
|
+
setSearch("");
|
|
1642
|
+
onFilterChange == null ? void 0 : onFilterChange("");
|
|
1643
|
+
}
|
|
1644
|
+
}, [valueProp]);
|
|
1645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1646
|
+
AutocompleteContext_default.Provider,
|
|
1647
|
+
{
|
|
1648
|
+
value: {
|
|
1649
|
+
data,
|
|
1650
|
+
values,
|
|
1651
|
+
keyField,
|
|
1652
|
+
textField,
|
|
1653
|
+
isMultiple,
|
|
1654
|
+
virtual,
|
|
1655
|
+
onChange: handleChange,
|
|
1656
|
+
onItemSelect: handleItemSelect,
|
|
1657
|
+
offset,
|
|
1658
|
+
setOffset,
|
|
1659
|
+
renderItem
|
|
1660
|
+
},
|
|
1661
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1662
|
+
Popover_default,
|
|
1663
|
+
__spreadProps(__spreadValues({
|
|
1664
|
+
target: true
|
|
1665
|
+
}, disclosure), {
|
|
1666
|
+
isOpen: disclosure.isOpen,
|
|
1667
|
+
onOpen: handleOpen,
|
|
1668
|
+
onClose: handleClose,
|
|
1669
|
+
autoClose: "outside",
|
|
1670
|
+
children: [
|
|
1671
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PopoverTrigger_default, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(
|
|
1672
|
+
"div",
|
|
1673
|
+
{
|
|
1674
|
+
className: clsx_default(`${prefixCls}input ${prefixCls}input--filterable`, {
|
|
1675
|
+
[`${prefixCls}input--focus`]: focus,
|
|
1676
|
+
[`${prefixCls}input--disabled`]: disabled
|
|
1677
|
+
}),
|
|
1678
|
+
style,
|
|
1679
|
+
onClick: handleClick,
|
|
1680
|
+
onFocus: () => {
|
|
1681
|
+
setFocus(true);
|
|
1682
|
+
},
|
|
1683
|
+
onBlur: () => {
|
|
1684
|
+
setFocus(false);
|
|
1685
|
+
},
|
|
1686
|
+
children: [
|
|
1687
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: `${prefixCls}outline` }),
|
|
1688
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: `${prefixCls}input__content`, children: [
|
|
1689
|
+
startContent && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { className: `${prefixCls}input__start-content`, children: startContent }),
|
|
1690
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
|
|
1691
|
+
"input",
|
|
1692
|
+
{
|
|
1693
|
+
ref: inputRef,
|
|
1694
|
+
className: `${prefixCls}input__field`,
|
|
1695
|
+
value: search,
|
|
1696
|
+
placeholder,
|
|
1697
|
+
disabled,
|
|
1698
|
+
onChange: handleFilterChange
|
|
1699
|
+
}
|
|
1700
|
+
),
|
|
1701
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsxs)("div", { className: `${prefixCls}input__end-content`, children: [
|
|
1702
|
+
endContent,
|
|
1703
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon_default, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(LoaderIcon_default, { className: `${prefixCls}animation-spin` }) }) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Button, { color: "secondary", variant: "plain", size: "xs", iconOnly: true, onClick: handleClear, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon_default, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CloseIcon_default, {}) }) }),
|
|
1704
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { style: { pointerEvents: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Icon_default, { children: disclosure.isOpen ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChevronUpIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ChevronDownIcon_default, {}) }) })
|
|
1705
|
+
] })
|
|
1706
|
+
] })
|
|
1707
|
+
]
|
|
1708
|
+
}
|
|
1709
|
+
) }),
|
|
1710
|
+
/* @__PURE__ */ (0, import_jsx_runtime17.jsx)(PopoverContent_default, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)("div", { children: virtual ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AutocompleteVirtual_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(AutocompleteContent_default, {}) }) })
|
|
1711
|
+
]
|
|
1712
|
+
})
|
|
1713
|
+
)
|
|
1714
|
+
}
|
|
1715
|
+
);
|
|
1716
|
+
};
|
|
1717
|
+
var Autocomplete_default = Autocomplete;
|
|
1718
|
+
|
|
1719
|
+
// src/components/Backdrop/Backdrop.tsx
|
|
1720
|
+
var import_clsx6 = __toESM(require("clsx"));
|
|
1721
|
+
var import_react36 = require("react");
|
|
1722
|
+
var import_react_merge_refs = require("react-merge-refs");
|
|
1723
|
+
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1724
|
+
var Backdrop = (0, import_react36.forwardRef)((props, ref) => {
|
|
1725
|
+
const _a = props, { children, className, isOpen, onClose } = _a, rest = __objRest(_a, ["children", "className", "isOpen", "onClose"]);
|
|
1726
|
+
const nodeRef = (0, import_react36.useRef)(null);
|
|
1727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1728
|
+
Transition_default,
|
|
1729
|
+
{
|
|
1730
|
+
nodeRef,
|
|
1731
|
+
isOpen,
|
|
1732
|
+
name: `${PREFIX_CLS}backdrop`,
|
|
1733
|
+
enter: 300,
|
|
1734
|
+
leave: 300,
|
|
1735
|
+
mountOnEnter: true,
|
|
1736
|
+
unmountOnExit: true,
|
|
1737
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Portal_default, { children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(
|
|
1738
|
+
"div",
|
|
1739
|
+
__spreadProps(__spreadValues({
|
|
1740
|
+
ref: (0, import_react_merge_refs.mergeRefs)([ref, nodeRef]),
|
|
1741
|
+
className: (0, import_clsx6.default)(`${PREFIX_CLS}backdrop`, className),
|
|
1742
|
+
tabIndex: -1
|
|
1743
|
+
}, rest), {
|
|
1744
|
+
children: [
|
|
1745
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: `${PREFIX_CLS}backdrop__overlay`, onClick: onClose }),
|
|
1746
|
+
children
|
|
1747
|
+
]
|
|
1748
|
+
})
|
|
1749
|
+
) })
|
|
1750
|
+
}
|
|
1751
|
+
);
|
|
1752
|
+
});
|
|
1753
|
+
var Backdrop_default = Backdrop;
|
|
1754
|
+
|
|
1755
|
+
// src/components/Badge/Badge.tsx
|
|
1756
|
+
var import_clsx7 = __toESM(require("clsx"));
|
|
1757
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1758
|
+
var Badge = ({ children, placement, content }) => {
|
|
1759
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: (0, import_clsx7.default)(`${PREFIX_CLS}badge-wrapper`), children: [
|
|
1760
|
+
children,
|
|
1761
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1762
|
+
"div",
|
|
1763
|
+
{
|
|
1764
|
+
className: (0, import_clsx7.default)(`${PREFIX_CLS}badge`, {
|
|
1765
|
+
[`${PREFIX_CLS}badge--${placement}`]: placement
|
|
1766
|
+
}),
|
|
1767
|
+
children: content
|
|
1768
|
+
}
|
|
1769
|
+
)
|
|
1770
|
+
] });
|
|
1771
|
+
};
|
|
1772
|
+
var Badge_default = Badge;
|
|
1773
|
+
|
|
1774
|
+
// src/components/Card/Card.tsx
|
|
1775
|
+
var import_react37 = require("react");
|
|
1776
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1777
|
+
var Card = (0, import_react37.forwardRef)((_a, ref) => {
|
|
1778
|
+
var _b = _a, { as: Component = "div", children, className } = _b, rest = __objRest(_b, ["as", "children", "className"]);
|
|
1779
|
+
const prefixCls = PREFIX_CLS;
|
|
1780
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Component, __spreadProps(__spreadValues({ ref, className: clsx_default(`${prefixCls}card`, className) }, rest), { children }));
|
|
1781
|
+
});
|
|
1782
|
+
var Card_default = Card;
|
|
1783
|
+
|
|
1784
|
+
// src/components/Card/CardHeader.tsx
|
|
1785
|
+
var import_react38 = require("react");
|
|
1786
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1787
|
+
var CardHeader = (0, import_react38.forwardRef)(
|
|
1788
|
+
(_a, ref) => {
|
|
1789
|
+
var _b = _a, { as: Component = "div", className, title, subtitle, startContent, endContent } = _b, rest = __objRest(_b, ["as", "className", "title", "subtitle", "startContent", "endContent"]);
|
|
1790
|
+
const prefixCls = PREFIX_CLS;
|
|
1791
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Component, __spreadProps(__spreadValues({ ref, className: clsx_default(`${prefixCls}card-header`, className) }, rest), { children: [
|
|
1792
|
+
startContent && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: `${prefixCls}card-header__start-content`, children: startContent }),
|
|
1793
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: `${prefixCls}card-header__content`, children: [
|
|
1794
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: `${prefixCls}card-header__title`, children: title }),
|
|
1795
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: `${prefixCls}card-header__subtitle`, children: subtitle })
|
|
1796
|
+
] }),
|
|
1797
|
+
endContent && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: `${prefixCls}card-header__end-content`, children: endContent })
|
|
1798
|
+
] }));
|
|
1799
|
+
}
|
|
1800
|
+
);
|
|
1801
|
+
var CardHeader_default = CardHeader;
|
|
1802
|
+
|
|
1803
|
+
// src/components/Chip/Chip.tsx
|
|
1804
|
+
var import_clsx8 = __toESM(require("clsx"));
|
|
1805
|
+
var import_react39 = require("react");
|
|
1806
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1807
|
+
var Chip = (0, import_react39.forwardRef)(
|
|
1808
|
+
(_a, ref) => {
|
|
1809
|
+
var _b = _a, { as: Component = "div", children, className, variant = "text", color = "primary", size = "md" } = _b, rest = __objRest(_b, ["as", "children", "className", "variant", "color", "size"]);
|
|
1810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
1811
|
+
Component,
|
|
1812
|
+
__spreadProps(__spreadValues({
|
|
1813
|
+
ref,
|
|
1814
|
+
className: (0, import_clsx8.default)(
|
|
1815
|
+
`${PREFIX_CLS}chip`,
|
|
1816
|
+
{
|
|
1817
|
+
[`${PREFIX_CLS}chip--${variant}`]: variant,
|
|
1818
|
+
[`${PREFIX_CLS}chip--${color}`]: color,
|
|
1819
|
+
[`${PREFIX_CLS}chip--${size}`]: size
|
|
1820
|
+
},
|
|
1821
|
+
className
|
|
1822
|
+
)
|
|
1823
|
+
}, rest), {
|
|
1824
|
+
children: [
|
|
1825
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: (0, import_clsx8.default)(`${PREFIX_CLS}overlay`) }),
|
|
1826
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: `${PREFIX_CLS}outline` }),
|
|
1827
|
+
children
|
|
1828
|
+
]
|
|
1829
|
+
})
|
|
1830
|
+
);
|
|
1831
|
+
}
|
|
1832
|
+
);
|
|
1833
|
+
var Chip_default = Chip;
|
|
1834
|
+
|
|
1835
|
+
// src/components/Drawer/Drawer.tsx
|
|
1836
|
+
var import_clsx9 = __toESM(require("clsx"));
|
|
1837
|
+
var import_react40 = require("react");
|
|
1838
|
+
var import_react_merge_refs2 = require("react-merge-refs");
|
|
1839
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
1840
|
+
var Drawer = (0, import_react40.forwardRef)((props, ref) => {
|
|
1841
|
+
const { children, className, isOpen, size = "md", position = "left", onClose } = props;
|
|
1842
|
+
const nodeRef = (0, import_react40.useRef)(null);
|
|
1843
|
+
const handleClose = () => {
|
|
1844
|
+
onClose();
|
|
1845
|
+
};
|
|
1846
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Backdrop_default, { isOpen, onClose: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Transition_default, { nodeRef, isOpen, name: `${PREFIX_CLS}drawer`, enter: 600, leave: 300, unmountOnExit: true, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
1847
|
+
"div",
|
|
1848
|
+
{
|
|
1849
|
+
ref: (0, import_react_merge_refs2.mergeRefs)([ref, nodeRef]),
|
|
1850
|
+
className: (0, import_clsx9.default)(
|
|
1851
|
+
`${PREFIX_CLS}drawer`,
|
|
1852
|
+
{
|
|
1853
|
+
[`${PREFIX_CLS}drawer--${size}`]: size,
|
|
1854
|
+
[`${PREFIX_CLS}drawer--${position}`]: position
|
|
1855
|
+
},
|
|
1856
|
+
className
|
|
1857
|
+
),
|
|
1858
|
+
children: [
|
|
1859
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: `${PREFIX_CLS}drawer__overlay` }),
|
|
1860
|
+
children
|
|
1861
|
+
]
|
|
1862
|
+
}
|
|
1863
|
+
) }) });
|
|
639
1864
|
});
|
|
640
1865
|
var Drawer_default = Drawer;
|
|
641
1866
|
|
|
642
1867
|
// src/components/Menu/Menu.tsx
|
|
643
1868
|
var import_clsx13 = __toESM(require("clsx"));
|
|
644
|
-
var
|
|
1869
|
+
var import_react46 = require("react");
|
|
645
1870
|
|
|
646
1871
|
// src/components/Menu/MenuContext.tsx
|
|
647
|
-
var
|
|
648
|
-
var MenuContext = (0,
|
|
1872
|
+
var import_react41 = require("react");
|
|
1873
|
+
var MenuContext = (0, import_react41.createContext)(null);
|
|
649
1874
|
var useMenu = () => {
|
|
650
|
-
const context = (0,
|
|
1875
|
+
const context = (0, import_react41.useContext)(MenuContext);
|
|
651
1876
|
if (!context) {
|
|
652
1877
|
throw new Error("`useMenu` must be used within a `<Menu />`");
|
|
653
1878
|
}
|
|
@@ -657,17 +1882,17 @@ var MenuContext_default = MenuContext;
|
|
|
657
1882
|
|
|
658
1883
|
// src/components/Menu/MenuGroup.tsx
|
|
659
1884
|
var import_clsx12 = __toESM(require("clsx"));
|
|
660
|
-
var
|
|
1885
|
+
var import_react45 = require("react");
|
|
661
1886
|
|
|
662
1887
|
// src/components/Menu/MenuItem.tsx
|
|
663
1888
|
var import_clsx10 = __toESM(require("clsx"));
|
|
664
|
-
var
|
|
1889
|
+
var import_react43 = require("react");
|
|
665
1890
|
|
|
666
1891
|
// src/components/Menu/MenuValueContext.tsx
|
|
667
|
-
var
|
|
668
|
-
var MenuValueContext = (0,
|
|
1892
|
+
var import_react42 = require("react");
|
|
1893
|
+
var MenuValueContext = (0, import_react42.createContext)([]);
|
|
669
1894
|
var useMenuItemValue = () => {
|
|
670
|
-
const context = (0,
|
|
1895
|
+
const context = (0, import_react42.useContext)(MenuValueContext);
|
|
671
1896
|
if (!context) {
|
|
672
1897
|
throw new Error("`useMenuValue` must be used within a `<MenuValueContext.Provider />`");
|
|
673
1898
|
}
|
|
@@ -676,12 +1901,13 @@ var useMenuItemValue = () => {
|
|
|
676
1901
|
var MenuValueContext_default = MenuValueContext;
|
|
677
1902
|
|
|
678
1903
|
// src/components/Menu/MenuItem.tsx
|
|
679
|
-
var
|
|
680
|
-
var MenuItem = (0,
|
|
1904
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
1905
|
+
var MenuItem = (0, import_react43.forwardRef)((props, ref) => {
|
|
681
1906
|
const _a = props, { as: Component = "div", className, style, value, title, icon, level = 1, disabled, onClick } = _a, rest = __objRest(_a, ["as", "className", "style", "value", "title", "icon", "level", "disabled", "onClick"]);
|
|
682
1907
|
const { value: menuValue, originalValue, navMode, onChange, onOpen, onItemSelect } = useMenu();
|
|
683
|
-
const values = (0,
|
|
1908
|
+
const values = (0, import_react43.useContext)(MenuValueContext_default);
|
|
684
1909
|
const mergedValues = [...values, value];
|
|
1910
|
+
const isSelected = menuValue[level - 1] === value;
|
|
685
1911
|
const handleClick = (event) => {
|
|
686
1912
|
if (value !== void 0) {
|
|
687
1913
|
onChange(mergedValues);
|
|
@@ -689,20 +1915,20 @@ var MenuItem = (0, import_react19.forwardRef)((props, ref) => {
|
|
|
689
1915
|
onClick == null ? void 0 : onClick(event);
|
|
690
1916
|
onItemSelect == null ? void 0 : onItemSelect(props);
|
|
691
1917
|
};
|
|
692
|
-
(0,
|
|
1918
|
+
(0, import_react43.useEffect)(() => {
|
|
693
1919
|
if (navMode === "automatic" && originalValue.length > 0 && originalValue[originalValue.length - 1] === value) {
|
|
694
1920
|
onOpen(values);
|
|
695
1921
|
onChange(mergedValues);
|
|
696
1922
|
}
|
|
697
1923
|
}, [value, originalValue, navMode]);
|
|
698
|
-
return /* @__PURE__ */ (0,
|
|
1924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
699
1925
|
Component,
|
|
700
1926
|
__spreadProps(__spreadValues({
|
|
701
1927
|
ref,
|
|
702
1928
|
className: (0, import_clsx10.default)(
|
|
703
1929
|
`${PREFIX_CLS}menu-item`,
|
|
704
1930
|
{
|
|
705
|
-
[`${PREFIX_CLS}menu-item--selected`]:
|
|
1931
|
+
[`${PREFIX_CLS}menu-item--selected`]: isSelected,
|
|
706
1932
|
[`${PREFIX_CLS}menu-item--disabled`]: disabled
|
|
707
1933
|
},
|
|
708
1934
|
className
|
|
@@ -713,9 +1939,9 @@ var MenuItem = (0, import_react19.forwardRef)((props, ref) => {
|
|
|
713
1939
|
onClick: handleClick
|
|
714
1940
|
}, rest), {
|
|
715
1941
|
children: [
|
|
716
|
-
/* @__PURE__ */ (0,
|
|
717
|
-
icon && /* @__PURE__ */ (0,
|
|
718
|
-
/* @__PURE__ */ (0,
|
|
1942
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: `${PREFIX_CLS}overlay`, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: `${PREFIX_CLS}overlay__surface` }) }),
|
|
1943
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: `${PREFIX_CLS}menu-item__icon`, children: icon }),
|
|
1944
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: `${PREFIX_CLS}menu-item__content`, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: `${PREFIX_CLS}menu-item__title`, children: title }) })
|
|
719
1945
|
]
|
|
720
1946
|
})
|
|
721
1947
|
);
|
|
@@ -725,7 +1951,7 @@ var MenuItem_default = MenuItem;
|
|
|
725
1951
|
|
|
726
1952
|
// src/components/Menu/MenuSubmenu.tsx
|
|
727
1953
|
var import_clsx11 = __toESM(require("clsx"));
|
|
728
|
-
var
|
|
1954
|
+
var import_react44 = require("react");
|
|
729
1955
|
|
|
730
1956
|
// src/components/Menu/utils.ts
|
|
731
1957
|
var getOpenValuesByPathname = (pathname) => {
|
|
@@ -751,7 +1977,7 @@ var addOrRemoveValueInArray = (array, value) => {
|
|
|
751
1977
|
};
|
|
752
1978
|
|
|
753
1979
|
// src/components/Menu/MenuSubmenu.tsx
|
|
754
|
-
var
|
|
1980
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
755
1981
|
var MenuSubmenu = (_a) => {
|
|
756
1982
|
var _b = _a, {
|
|
757
1983
|
children,
|
|
@@ -775,13 +2001,14 @@ var MenuSubmenu = (_a) => {
|
|
|
775
2001
|
"onClick"
|
|
776
2002
|
]);
|
|
777
2003
|
const { value: menuValue, openValues, expandMode, onOpen } = useMenu();
|
|
778
|
-
const values = (0,
|
|
2004
|
+
const values = (0, import_react44.useContext)(MenuValueContext_default);
|
|
779
2005
|
const isOpen = openValues.includes(value);
|
|
780
2006
|
const mergedValues = [...values, value];
|
|
781
|
-
const
|
|
2007
|
+
const isSelected = menuValue[level - 1] === value;
|
|
2008
|
+
const content = (0, import_react44.useMemo)(() => {
|
|
782
2009
|
return items == null ? void 0 : items.map((_a2, index) => {
|
|
783
2010
|
var _b2 = _a2, { type } = _b2, item = __objRest(_b2, ["type"]);
|
|
784
|
-
return type === "item" ? /* @__PURE__ */ (0,
|
|
2011
|
+
return type === "item" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MenuItem_default, __spreadValues({ level: level !== void 0 ? level + 1 : void 0 }, item), index) : type === "submenu" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MenuSubmenu, __spreadValues({ level: level !== void 0 ? level + 1 : void 0 }, item), index) : type === "group" ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MenuGroup_default, __spreadValues({ level: level !== void 0 ? level + 1 : void 0 }, item), index) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MenuItem_default, __spreadValues({ level: level !== void 0 ? level + 1 : void 0 }, item), index);
|
|
785
2012
|
});
|
|
786
2013
|
}, [items]);
|
|
787
2014
|
const handleClick = (event) => {
|
|
@@ -799,14 +2026,14 @@ var MenuSubmenu = (_a) => {
|
|
|
799
2026
|
}
|
|
800
2027
|
onClick == null ? void 0 : onClick(event);
|
|
801
2028
|
};
|
|
802
|
-
return /* @__PURE__ */ (0,
|
|
803
|
-
/* @__PURE__ */ (0,
|
|
2029
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(MenuValueContext_default.Provider, { value: mergedValues, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: (0, import_clsx11.default)(`${PREFIX_CLS}menu-submenu`), children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Collapse_default, { isOpen, children: [
|
|
2030
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CollapseTrigger_default, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(
|
|
804
2031
|
"div",
|
|
805
2032
|
__spreadProps(__spreadValues({
|
|
806
2033
|
className: (0, import_clsx11.default)(
|
|
807
2034
|
`${PREFIX_CLS}menu-item`,
|
|
808
2035
|
{
|
|
809
|
-
[`${PREFIX_CLS}menu-item--selected`]:
|
|
2036
|
+
[`${PREFIX_CLS}menu-item--selected`]: isSelected || items && mergedValues.includes(menuValue)
|
|
810
2037
|
},
|
|
811
2038
|
className
|
|
812
2039
|
),
|
|
@@ -816,14 +2043,14 @@ var MenuSubmenu = (_a) => {
|
|
|
816
2043
|
onClick: handleClick
|
|
817
2044
|
}, rest), {
|
|
818
2045
|
children: [
|
|
819
|
-
/* @__PURE__ */ (0,
|
|
820
|
-
icon && /* @__PURE__ */ (0,
|
|
821
|
-
/* @__PURE__ */ (0,
|
|
822
|
-
/* @__PURE__ */ (0,
|
|
2046
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: `${PREFIX_CLS}overlay`, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: `${PREFIX_CLS}overlay__surface` }) }),
|
|
2047
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: `${PREFIX_CLS}menu-item__icon`, children: icon }),
|
|
2048
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: `${PREFIX_CLS}menu-item__content`, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("span", { className: `${PREFIX_CLS}menu-item__title`, children: title }) }),
|
|
2049
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: `${PREFIX_CLS}menu-item__icon`, children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ChevronUpIcon_default, { className: `${PREFIX_CLS}icon` }) : /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ChevronDownIcon_default, { className: `${PREFIX_CLS}icon` }) })
|
|
823
2050
|
]
|
|
824
2051
|
})
|
|
825
2052
|
) }),
|
|
826
|
-
/* @__PURE__ */ (0,
|
|
2053
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(CollapseContent_default, { children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
827
2054
|
"ul",
|
|
828
2055
|
{
|
|
829
2056
|
className: (0, import_clsx11.default)(`${PREFIX_CLS}menu`, {
|
|
@@ -837,7 +2064,7 @@ var MenuSubmenu = (_a) => {
|
|
|
837
2064
|
var MenuSubmenu_default = MenuSubmenu;
|
|
838
2065
|
|
|
839
2066
|
// src/components/Menu/MenuGroup.tsx
|
|
840
|
-
var
|
|
2067
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
841
2068
|
var MenuGroup = (_a) => {
|
|
842
2069
|
var _b = _a, {
|
|
843
2070
|
children,
|
|
@@ -856,14 +2083,14 @@ var MenuGroup = (_a) => {
|
|
|
856
2083
|
"level",
|
|
857
2084
|
"items"
|
|
858
2085
|
]);
|
|
859
|
-
const content = (0,
|
|
2086
|
+
const content = (0, import_react45.useMemo)(() => {
|
|
860
2087
|
return items == null ? void 0 : items.map((_a2, index) => {
|
|
861
2088
|
var _b2 = _a2, { type } = _b2, item = __objRest(_b2, ["type"]);
|
|
862
|
-
return type === "item" ? /* @__PURE__ */ (0,
|
|
2089
|
+
return type === "item" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(MenuItem_default, __spreadValues({}, item), index) : type === "submenu" ? /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(MenuSubmenu_default, __spreadValues({}, item), index) : /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(MenuItem_default, __spreadValues({}, item), index);
|
|
863
2090
|
});
|
|
864
2091
|
}, [items]);
|
|
865
|
-
return /* @__PURE__ */ (0,
|
|
866
|
-
/* @__PURE__ */ (0,
|
|
2092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
2093
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
867
2094
|
"div",
|
|
868
2095
|
__spreadProps(__spreadValues({
|
|
869
2096
|
className: (0, import_clsx12.default)(`${PREFIX_CLS}menu-group`, className),
|
|
@@ -872,8 +2099,8 @@ var MenuGroup = (_a) => {
|
|
|
872
2099
|
}, style)
|
|
873
2100
|
}, rest), {
|
|
874
2101
|
children: [
|
|
875
|
-
icon && /* @__PURE__ */ (0,
|
|
876
|
-
/* @__PURE__ */ (0,
|
|
2102
|
+
icon && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: `${PREFIX_CLS}menu-group__icon`, children: icon }),
|
|
2103
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: `${PREFIX_CLS}menu-group__content`, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: `${PREFIX_CLS}menu-group__title`, children: title }) })
|
|
877
2104
|
]
|
|
878
2105
|
})
|
|
879
2106
|
),
|
|
@@ -883,7 +2110,7 @@ var MenuGroup = (_a) => {
|
|
|
883
2110
|
var MenuGroup_default = MenuGroup;
|
|
884
2111
|
|
|
885
2112
|
// src/components/Menu/Menu.tsx
|
|
886
|
-
var
|
|
2113
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
887
2114
|
var Menu = (_a) => {
|
|
888
2115
|
var _b = _a, {
|
|
889
2116
|
children,
|
|
@@ -909,12 +2136,12 @@ var Menu = (_a) => {
|
|
|
909
2136
|
"onItemSelect"
|
|
910
2137
|
]);
|
|
911
2138
|
var _a2;
|
|
912
|
-
const [selfValue, setSelfValue] = (0,
|
|
913
|
-
const [selfOpenValues, setSelfOpenValues] = (0,
|
|
914
|
-
const content = (0,
|
|
2139
|
+
const [selfValue, setSelfValue] = (0, import_react46.useState)((_a2 = valueProp != null ? valueProp : defaultValue) != null ? _a2 : []);
|
|
2140
|
+
const [selfOpenValues, setSelfOpenValues] = (0, import_react46.useState)(openValuesProp != null ? openValuesProp : []);
|
|
2141
|
+
const content = (0, import_react46.useMemo)(() => {
|
|
915
2142
|
return items == null ? void 0 : items.map((_a3, index) => {
|
|
916
2143
|
var _b2 = _a3, { type } = _b2, item = __objRest(_b2, ["type"]);
|
|
917
|
-
return type === "item" ? /* @__PURE__ */ (0,
|
|
2144
|
+
return type === "item" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MenuItem_default, __spreadValues({}, item), index) : type === "submenu" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MenuSubmenu_default, __spreadValues({}, item), index) : type === "group" ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MenuGroup_default, __spreadValues({}, item), index) : /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MenuItem_default, __spreadValues({}, item), index);
|
|
918
2145
|
});
|
|
919
2146
|
}, [items]);
|
|
920
2147
|
const handleChange = (value) => {
|
|
@@ -934,17 +2161,17 @@ var Menu = (_a) => {
|
|
|
934
2161
|
const handleItemSelect = (props) => {
|
|
935
2162
|
onItemSelect == null ? void 0 : onItemSelect(props);
|
|
936
2163
|
};
|
|
937
|
-
(0,
|
|
2164
|
+
(0, import_react46.useEffect)(() => {
|
|
938
2165
|
if (valueProp !== void 0 && navMode !== "automatic") {
|
|
939
2166
|
setSelfValue(valueProp);
|
|
940
2167
|
}
|
|
941
2168
|
}, [valueProp]);
|
|
942
|
-
(0,
|
|
2169
|
+
(0, import_react46.useEffect)(() => {
|
|
943
2170
|
if (openValuesProp !== void 0) {
|
|
944
2171
|
setSelfOpenValues(openValuesProp);
|
|
945
2172
|
}
|
|
946
2173
|
}, [openValuesProp]);
|
|
947
|
-
return /* @__PURE__ */ (0,
|
|
2174
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
948
2175
|
MenuContext_default.Provider,
|
|
949
2176
|
{
|
|
950
2177
|
value: {
|
|
@@ -957,7 +2184,7 @@ var Menu = (_a) => {
|
|
|
957
2184
|
onChange: handleChange,
|
|
958
2185
|
onItemSelect: handleItemSelect
|
|
959
2186
|
},
|
|
960
|
-
children: /* @__PURE__ */ (0,
|
|
2187
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", __spreadProps(__spreadValues({ className: (0, import_clsx13.default)(`${PREFIX_CLS}menu`) }, rest), { children: content || children }))
|
|
961
2188
|
}
|
|
962
2189
|
);
|
|
963
2190
|
};
|
|
@@ -965,319 +2192,87 @@ Menu.displayName = "Menu";
|
|
|
965
2192
|
var Menu_default = Menu;
|
|
966
2193
|
|
|
967
2194
|
// src/components/Accordion/Accordion.tsx
|
|
968
|
-
var
|
|
969
|
-
var
|
|
970
|
-
var Accordion = (0,
|
|
2195
|
+
var import_react47 = require("react");
|
|
2196
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
2197
|
+
var Accordion = (0, import_react47.forwardRef)((props, ref) => {
|
|
971
2198
|
const _a = props, { children, className } = _a, rest = __objRest(_a, ["children", "className"]);
|
|
972
2199
|
const prefixCls = PREFIX_CLS;
|
|
973
|
-
return /* @__PURE__ */ (0,
|
|
2200
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", __spreadProps(__spreadValues({ ref, className: clsx_default(`${prefixCls}accordion`, className) }, rest), { children }));
|
|
974
2201
|
});
|
|
975
2202
|
var Accordion_default = Accordion;
|
|
976
2203
|
|
|
977
2204
|
// src/components/Accordion/AccordionItem.tsx
|
|
978
|
-
var
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
var
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
var
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
const
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
}
|
|
998
|
-
var useEventListener_default = useEventListener;
|
|
999
|
-
|
|
1000
|
-
// src/hooks/useLocalStorage.tsx
|
|
1001
|
-
function useLocalStorage(key, initialValue) {
|
|
1002
|
-
const readValue = (0, import_react26.useCallback)(() => {
|
|
1003
|
-
if (typeof window === "undefined") {
|
|
1004
|
-
return initialValue;
|
|
1005
|
-
}
|
|
1006
|
-
try {
|
|
1007
|
-
const item = window.localStorage.getItem(key);
|
|
1008
|
-
return item ? parseJSON(item) : initialValue;
|
|
1009
|
-
} catch (error) {
|
|
1010
|
-
console.warn(`Error reading localStorage key \u201C${key}\u201D:`, error);
|
|
1011
|
-
return initialValue;
|
|
1012
|
-
}
|
|
1013
|
-
}, [initialValue, key]);
|
|
1014
|
-
const [storedValue, setStoredValue] = (0, import_react26.useState)(readValue);
|
|
1015
|
-
const setValue = (0, import_react26.useCallback)(
|
|
1016
|
-
(value) => {
|
|
1017
|
-
if (typeof window == "undefined") {
|
|
1018
|
-
console.warn(`Tried setting localStorage key \u201C${key}\u201D even though environment is not a client`);
|
|
1019
|
-
}
|
|
1020
|
-
try {
|
|
1021
|
-
const newValue = value instanceof Function ? value(storedValue) : value;
|
|
1022
|
-
window.localStorage.setItem(key, JSON.stringify(newValue));
|
|
1023
|
-
setStoredValue(newValue);
|
|
1024
|
-
window.dispatchEvent(new Event("local-storage"));
|
|
1025
|
-
} catch (error) {
|
|
1026
|
-
console.warn(`Error setting localStorage key \u201C${key}\u201D:`, error);
|
|
1027
|
-
}
|
|
1028
|
-
},
|
|
1029
|
-
[key, storedValue]
|
|
1030
|
-
);
|
|
1031
|
-
(0, import_react26.useEffect)(() => {
|
|
1032
|
-
setStoredValue(readValue());
|
|
1033
|
-
}, []);
|
|
1034
|
-
const handleStorageChange = (0, import_react26.useCallback)(() => {
|
|
1035
|
-
setStoredValue(readValue());
|
|
1036
|
-
}, [readValue]);
|
|
1037
|
-
useEventListener_default("storage", handleStorageChange);
|
|
1038
|
-
useEventListener_default("local-storage", handleStorageChange);
|
|
1039
|
-
return [storedValue, setValue];
|
|
1040
|
-
}
|
|
1041
|
-
function parseJSON(value) {
|
|
1042
|
-
try {
|
|
1043
|
-
return value === "undefined" ? void 0 : JSON.parse(value != null ? value : "");
|
|
1044
|
-
} catch (e) {
|
|
1045
|
-
return void 0;
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
// src/hooks/usePrevious.tsx
|
|
1050
|
-
var import_react27 = require("react");
|
|
1051
|
-
var usePrevious = (value) => {
|
|
1052
|
-
const ref = (0, import_react27.useRef)();
|
|
1053
|
-
(0, import_react27.useEffect)(() => {
|
|
1054
|
-
ref.current = value;
|
|
1055
|
-
});
|
|
1056
|
-
return ref.current;
|
|
1057
|
-
};
|
|
1058
|
-
|
|
1059
|
-
// src/hooks/useDisclosure.ts
|
|
1060
|
-
var import_react28 = require("react");
|
|
1061
|
-
var useDisclosure = ({ defaultValue } = {}) => {
|
|
1062
|
-
const [isOpen, setIsOpen] = (0, import_react28.useState)(defaultValue || false);
|
|
1063
|
-
const onOpen = () => {
|
|
1064
|
-
setIsOpen(true);
|
|
1065
|
-
};
|
|
1066
|
-
const onClose = () => {
|
|
1067
|
-
setIsOpen(false);
|
|
1068
|
-
};
|
|
1069
|
-
const onToggle = () => {
|
|
1070
|
-
setIsOpen((prevState) => !prevState);
|
|
1071
|
-
};
|
|
1072
|
-
return {
|
|
1073
|
-
isOpen,
|
|
1074
|
-
onOpen,
|
|
1075
|
-
onClose,
|
|
1076
|
-
onToggle
|
|
1077
|
-
};
|
|
1078
|
-
};
|
|
1079
|
-
var useDisclosure_default = useDisclosure;
|
|
1080
|
-
|
|
1081
|
-
// src/hooks/useStep.tsx
|
|
1082
|
-
var import_react29 = require("react");
|
|
1083
|
-
var useStep = (maxStep) => {
|
|
1084
|
-
const [currentStep, setCurrentStep] = (0, import_react29.useState)(1);
|
|
1085
|
-
const canGoToNextStep = (0, import_react29.useMemo)(() => currentStep + 1 <= maxStep, [currentStep, maxStep]);
|
|
1086
|
-
const canGoToPrevStep = (0, import_react29.useMemo)(() => currentStep - 1 >= 1, [currentStep]);
|
|
1087
|
-
const setStep = (0, import_react29.useCallback)(
|
|
1088
|
-
(step) => {
|
|
1089
|
-
const newStep = step instanceof Function ? step(currentStep) : step;
|
|
1090
|
-
if (newStep >= 1 && newStep <= maxStep) {
|
|
1091
|
-
setCurrentStep(newStep);
|
|
1092
|
-
return;
|
|
1093
|
-
}
|
|
1094
|
-
throw new Error("Step not valid");
|
|
1095
|
-
},
|
|
1096
|
-
[maxStep, currentStep]
|
|
1097
|
-
);
|
|
1098
|
-
const goToNextStep = (0, import_react29.useCallback)(() => {
|
|
1099
|
-
if (canGoToNextStep) {
|
|
1100
|
-
setCurrentStep((step) => step + 1);
|
|
1101
|
-
}
|
|
1102
|
-
}, [canGoToNextStep]);
|
|
1103
|
-
const goToPrevStep = (0, import_react29.useCallback)(() => {
|
|
1104
|
-
if (canGoToPrevStep) {
|
|
1105
|
-
setCurrentStep((step) => step - 1);
|
|
1106
|
-
}
|
|
1107
|
-
}, [canGoToPrevStep]);
|
|
1108
|
-
const reset = (0, import_react29.useCallback)(() => {
|
|
1109
|
-
setCurrentStep(1);
|
|
1110
|
-
}, []);
|
|
1111
|
-
return [
|
|
1112
|
-
currentStep,
|
|
1113
|
-
{
|
|
1114
|
-
goToNextStep,
|
|
1115
|
-
goToPrevStep,
|
|
1116
|
-
canGoToNextStep,
|
|
1117
|
-
canGoToPrevStep,
|
|
1118
|
-
setStep,
|
|
1119
|
-
reset
|
|
1120
|
-
}
|
|
1121
|
-
];
|
|
1122
|
-
};
|
|
1123
|
-
|
|
1124
|
-
// src/components/Accordion/AccordionItem.tsx
|
|
1125
|
-
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1126
|
-
var AccordionItemContext = (0, import_react30.createContext)(null);
|
|
1127
|
-
var useAccordionItem = () => {
|
|
1128
|
-
const context = (0, import_react30.useContext)(AccordionItemContext);
|
|
1129
|
-
if (!context) {
|
|
1130
|
-
throw new Error("`useAccordionItem` must be used within a `<AccordionItem />`");
|
|
1131
|
-
}
|
|
1132
|
-
return context;
|
|
1133
|
-
};
|
|
1134
|
-
var AccordionItem = (0, import_react30.forwardRef)((props, ref) => {
|
|
1135
|
-
const _a = props, { children, className, value: valueProp } = _a, rest = __objRest(_a, ["children", "className", "value"]);
|
|
1136
|
-
const prefixCls = PREFIX_CLS;
|
|
1137
|
-
const { isOpen, onOpen, onClose, onToggle } = useDisclosure_default({ defaultValue: true });
|
|
1138
|
-
const id = (0, import_react30.useId)();
|
|
1139
|
-
const value = valueProp != null ? valueProp : id;
|
|
1140
|
-
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(AccordionItemContext.Provider, { value: { value }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("div", __spreadProps(__spreadValues({ ref, className: clsx_default(`${prefixCls}accordion-item`, className) }, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(Collapse_default, { isOpen, onOpen, onClose, onToggle, children }) })) });
|
|
1141
|
-
});
|
|
1142
|
-
var AccordionItem_default = AccordionItem;
|
|
2205
|
+
var import_react48 = require("react");
|
|
2206
|
+
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
2207
|
+
var AccordionItemContext = (0, import_react48.createContext)(null);
|
|
2208
|
+
var useAccordionItem = () => {
|
|
2209
|
+
const context = (0, import_react48.useContext)(AccordionItemContext);
|
|
2210
|
+
if (!context) {
|
|
2211
|
+
throw new Error("`useAccordionItem` must be used within a `<AccordionItem />`");
|
|
2212
|
+
}
|
|
2213
|
+
return context;
|
|
2214
|
+
};
|
|
2215
|
+
var AccordionItem = (0, import_react48.forwardRef)((props, ref) => {
|
|
2216
|
+
const _a = props, { children, className, value: valueProp } = _a, rest = __objRest(_a, ["children", "className", "value"]);
|
|
2217
|
+
const prefixCls = PREFIX_CLS;
|
|
2218
|
+
const { isOpen, onOpen, onClose, onToggle } = useDisclosure_default({ defaultValue: true });
|
|
2219
|
+
const id = (0, import_react48.useId)();
|
|
2220
|
+
const value = valueProp != null ? valueProp : id;
|
|
2221
|
+
return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(AccordionItemContext.Provider, { value: { value }, children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("div", __spreadProps(__spreadValues({ ref, className: clsx_default(`${prefixCls}accordion-item`, className) }, rest), { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Collapse_default, { isOpen, onOpen, onClose, onToggle, children }) })) });
|
|
2222
|
+
});
|
|
2223
|
+
var AccordionItem_default = AccordionItem;
|
|
1143
2224
|
|
|
1144
2225
|
// src/components/Accordion/AccordionHeader.tsx
|
|
1145
|
-
var
|
|
1146
|
-
var
|
|
1147
|
-
var AccordionHeader = (0,
|
|
2226
|
+
var import_react49 = require("react");
|
|
2227
|
+
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
2228
|
+
var AccordionHeader = (0, import_react49.forwardRef)((props, ref) => {
|
|
1148
2229
|
const _a = props, { className, title, subtitle, startContent, endContent } = _a, rest = __objRest(_a, ["className", "title", "subtitle", "startContent", "endContent"]);
|
|
1149
2230
|
const prefixCls = PREFIX_CLS;
|
|
1150
2231
|
const { isOpen } = useCollapse();
|
|
1151
|
-
return /* @__PURE__ */ (0,
|
|
1152
|
-
startContent && /* @__PURE__ */ (0,
|
|
1153
|
-
/* @__PURE__ */ (0,
|
|
1154
|
-
/* @__PURE__ */ (0,
|
|
1155
|
-
subtitle && /* @__PURE__ */ (0,
|
|
2232
|
+
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CollapseTrigger_default, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", __spreadProps(__spreadValues({ ref, className: clsx_default(`${prefixCls}accordion-header`, className) }, rest), { children: [
|
|
2233
|
+
startContent && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: `${prefixCls}accordion-header__start-content`, children: startContent }),
|
|
2234
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: `${prefixCls}accordion-header__content`, children: [
|
|
2235
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: `${prefixCls}accordion-header__title`, children: title }),
|
|
2236
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: `${prefixCls}accordion-header__subtitle`, children: subtitle })
|
|
1156
2237
|
] }),
|
|
1157
|
-
/* @__PURE__ */ (0,
|
|
2238
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { className: `${prefixCls}accordion-header__end-content`, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)("div", { className: "us-d-flex us-items-center us-gap-1", children: [
|
|
1158
2239
|
endContent,
|
|
1159
|
-
/* @__PURE__ */ (0,
|
|
2240
|
+
/* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Button, { type: "button", variant: "text", color: "secondary", size: "sm", iconOnly: true, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon_default, { children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ChevronUpIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(ChevronDownIcon_default, {}) }) })
|
|
1160
2241
|
] }) })
|
|
1161
2242
|
] })) });
|
|
1162
2243
|
});
|
|
1163
2244
|
var AccordionHeader_default = AccordionHeader;
|
|
1164
2245
|
|
|
1165
2246
|
// src/components/Accordion/AccordionPanel.tsx
|
|
1166
|
-
var
|
|
1167
|
-
var
|
|
1168
|
-
var AccordionPanel = (0,
|
|
2247
|
+
var import_react50 = require("react");
|
|
2248
|
+
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
2249
|
+
var AccordionPanel = (0, import_react50.forwardRef)((_a, ref) => {
|
|
1169
2250
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
|
1170
2251
|
const prefixCls = PREFIX_CLS;
|
|
1171
|
-
return /* @__PURE__ */ (0,
|
|
2252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(CollapseContent_default, { children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", __spreadProps(__spreadValues({ className: clsx_default(`${prefixCls}accordion-panel`, className) }, rest), { children })) }) });
|
|
1172
2253
|
});
|
|
1173
2254
|
var AccordionPanel_default = AccordionPanel;
|
|
1174
2255
|
|
|
1175
2256
|
// src/components/Accordion/AccordionContent.tsx
|
|
1176
|
-
var
|
|
1177
|
-
var
|
|
1178
|
-
var AccordionContent = (0,
|
|
2257
|
+
var import_react51 = require("react");
|
|
2258
|
+
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2259
|
+
var AccordionContent = (0, import_react51.forwardRef)((_a, ref) => {
|
|
1179
2260
|
var _b = _a, { children, className } = _b, rest = __objRest(_b, ["children", "className"]);
|
|
1180
2261
|
const prefixCls = PREFIX_CLS;
|
|
1181
|
-
return /* @__PURE__ */ (0,
|
|
2262
|
+
return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CollapseContent_default, { children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { ref, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", __spreadProps(__spreadValues({ className: clsx_default(`${prefixCls}accordion-content`, className) }, rest), { children })) }) });
|
|
1182
2263
|
});
|
|
1183
2264
|
var AccordionContent_default = AccordionContent;
|
|
1184
2265
|
|
|
1185
2266
|
// src/components/Tabs/Tab.tsx
|
|
1186
2267
|
var import_clsx15 = __toESM(require("clsx"));
|
|
1187
2268
|
var import_merge_refs = __toESM(require("merge-refs"));
|
|
1188
|
-
var
|
|
1189
|
-
|
|
1190
|
-
// ../../../node_modules/react-icons/lib/esm/iconBase.js
|
|
1191
|
-
var import_react35 = __toESM(require("react"));
|
|
1192
|
-
|
|
1193
|
-
// ../../../node_modules/react-icons/lib/esm/iconContext.js
|
|
1194
|
-
var import_react34 = __toESM(require("react"));
|
|
1195
|
-
var DefaultContext = {
|
|
1196
|
-
color: void 0,
|
|
1197
|
-
size: void 0,
|
|
1198
|
-
className: void 0,
|
|
1199
|
-
style: void 0,
|
|
1200
|
-
attr: void 0
|
|
1201
|
-
};
|
|
1202
|
-
var IconContext = import_react34.default.createContext && import_react34.default.createContext(DefaultContext);
|
|
1203
|
-
|
|
1204
|
-
// ../../../node_modules/react-icons/lib/esm/iconBase.js
|
|
1205
|
-
var __assign = function() {
|
|
1206
|
-
__assign = Object.assign || function(t) {
|
|
1207
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1208
|
-
s = arguments[i];
|
|
1209
|
-
for (var p in s)
|
|
1210
|
-
if (Object.prototype.hasOwnProperty.call(s, p))
|
|
1211
|
-
t[p] = s[p];
|
|
1212
|
-
}
|
|
1213
|
-
return t;
|
|
1214
|
-
};
|
|
1215
|
-
return __assign.apply(this, arguments);
|
|
1216
|
-
};
|
|
1217
|
-
var __rest = function(s, e) {
|
|
1218
|
-
var t = {};
|
|
1219
|
-
for (var p in s)
|
|
1220
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
1221
|
-
t[p] = s[p];
|
|
1222
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
1223
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1224
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
1225
|
-
t[p[i]] = s[p[i]];
|
|
1226
|
-
}
|
|
1227
|
-
return t;
|
|
1228
|
-
};
|
|
1229
|
-
function Tree2Element(tree) {
|
|
1230
|
-
return tree && tree.map(function(node, i) {
|
|
1231
|
-
return import_react35.default.createElement(node.tag, __assign({
|
|
1232
|
-
key: i
|
|
1233
|
-
}, node.attr), Tree2Element(node.child));
|
|
1234
|
-
});
|
|
1235
|
-
}
|
|
1236
|
-
function GenIcon(data) {
|
|
1237
|
-
return function(props) {
|
|
1238
|
-
return import_react35.default.createElement(IconBase, __assign({
|
|
1239
|
-
attr: __assign({}, data.attr)
|
|
1240
|
-
}, props), Tree2Element(data.child));
|
|
1241
|
-
};
|
|
1242
|
-
}
|
|
1243
|
-
function IconBase(props) {
|
|
1244
|
-
var elem = function(conf) {
|
|
1245
|
-
var attr = props.attr, size = props.size, title = props.title, svgProps = __rest(props, ["attr", "size", "title"]);
|
|
1246
|
-
var computedSize = size || conf.size || "1em";
|
|
1247
|
-
var className;
|
|
1248
|
-
if (conf.className)
|
|
1249
|
-
className = conf.className;
|
|
1250
|
-
if (props.className)
|
|
1251
|
-
className = (className ? className + " " : "") + props.className;
|
|
1252
|
-
return import_react35.default.createElement("svg", __assign({
|
|
1253
|
-
stroke: "currentColor",
|
|
1254
|
-
fill: "currentColor",
|
|
1255
|
-
strokeWidth: "0"
|
|
1256
|
-
}, conf.attr, attr, svgProps, {
|
|
1257
|
-
className,
|
|
1258
|
-
style: __assign(__assign({
|
|
1259
|
-
color: props.color || conf.color
|
|
1260
|
-
}, conf.style), props.style),
|
|
1261
|
-
height: computedSize,
|
|
1262
|
-
width: computedSize,
|
|
1263
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
1264
|
-
}), title && import_react35.default.createElement("title", null, title), props.children);
|
|
1265
|
-
};
|
|
1266
|
-
return IconContext !== void 0 ? import_react35.default.createElement(IconContext.Consumer, null, function(conf) {
|
|
1267
|
-
return elem(conf);
|
|
1268
|
-
}) : elem(DefaultContext);
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1271
|
-
// ../../../node_modules/react-icons/tb/index.esm.js
|
|
1272
|
-
function TbX(props) {
|
|
1273
|
-
return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24", "strokeWidth": "2", "stroke": "currentColor", "fill": "none", "strokeLinecap": "round", "strokeLinejoin": "round" }, "child": [{ "tag": "path", "attr": { "stroke": "none", "d": "M0 0h24v24H0z", "fill": "none" } }, { "tag": "path", "attr": { "d": "M18 6l-12 12" } }, { "tag": "path", "attr": { "d": "M6 6l12 12" } }] })(props);
|
|
1274
|
-
}
|
|
2269
|
+
var import_react53 = require("react");
|
|
1275
2270
|
|
|
1276
2271
|
// src/components/Tabs/TabsContext.ts
|
|
1277
|
-
var
|
|
1278
|
-
var TabsContext = (0,
|
|
2272
|
+
var import_react52 = require("react");
|
|
2273
|
+
var TabsContext = (0, import_react52.createContext)(null);
|
|
1279
2274
|
var useTabs = () => {
|
|
1280
|
-
const context = (0,
|
|
2275
|
+
const context = (0, import_react52.useContext)(TabsContext);
|
|
1281
2276
|
if (!context) {
|
|
1282
2277
|
throw new Error("`useTabs` must be used within a `<Tabs />`");
|
|
1283
2278
|
}
|
|
@@ -1285,8 +2280,8 @@ var useTabs = () => {
|
|
|
1285
2280
|
};
|
|
1286
2281
|
|
|
1287
2282
|
// src/components/Tabs/Tab.tsx
|
|
1288
|
-
var
|
|
1289
|
-
var Tab = (0,
|
|
2283
|
+
var import_jsx_runtime33 = require("react/jsx-runtime");
|
|
2284
|
+
var Tab = (0, import_react53.forwardRef)(
|
|
1290
2285
|
(_a, ref) => {
|
|
1291
2286
|
var _b = _a, {
|
|
1292
2287
|
as: Component = "div",
|
|
@@ -1294,6 +2289,8 @@ var Tab = (0, import_react37.forwardRef)(
|
|
|
1294
2289
|
className,
|
|
1295
2290
|
role = "presentation",
|
|
1296
2291
|
value: valueProp,
|
|
2292
|
+
startContent,
|
|
2293
|
+
endContent,
|
|
1297
2294
|
closable,
|
|
1298
2295
|
disabled,
|
|
1299
2296
|
onClick
|
|
@@ -1303,22 +2300,25 @@ var Tab = (0, import_react37.forwardRef)(
|
|
|
1303
2300
|
"className",
|
|
1304
2301
|
"role",
|
|
1305
2302
|
"value",
|
|
2303
|
+
"startContent",
|
|
2304
|
+
"endContent",
|
|
1306
2305
|
"closable",
|
|
1307
2306
|
"disabled",
|
|
1308
2307
|
"onClick"
|
|
1309
2308
|
]);
|
|
1310
|
-
const tabRef = (0,
|
|
1311
|
-
const id = (0,
|
|
2309
|
+
const tabRef = (0, import_react53.useRef)(null);
|
|
2310
|
+
const id = (0, import_react53.useId)();
|
|
1312
2311
|
const value = valueProp != null ? valueProp : id;
|
|
1313
2312
|
const _a2 = useTabs(), { onClose, registerItem } = _a2, tabs = __objRest(_a2, ["onClose", "registerItem"]);
|
|
2313
|
+
const prefixCls = PREFIX_CLS;
|
|
1314
2314
|
const handleClick = (event) => {
|
|
1315
2315
|
const previousTab = tabs.previousTabRef.current;
|
|
1316
2316
|
const currentTab = tabRef.current;
|
|
1317
2317
|
if (!currentTab)
|
|
1318
2318
|
return;
|
|
1319
2319
|
if (previousTab) {
|
|
1320
|
-
const previousIndicator = previousTab.querySelector(`.${
|
|
1321
|
-
const currentIndicator = currentTab.querySelector(`.${
|
|
2320
|
+
const previousIndicator = previousTab.querySelector(`.${prefixCls}tab__indicator`);
|
|
2321
|
+
const currentIndicator = currentTab.querySelector(`.${prefixCls}tab__indicator`);
|
|
1322
2322
|
if (!previousIndicator || !currentIndicator)
|
|
1323
2323
|
return;
|
|
1324
2324
|
const from = {};
|
|
@@ -1349,31 +2349,35 @@ var Tab = (0, import_react37.forwardRef)(
|
|
|
1349
2349
|
event.stopPropagation();
|
|
1350
2350
|
onClose(value);
|
|
1351
2351
|
};
|
|
1352
|
-
(0,
|
|
2352
|
+
(0, import_react53.useEffect)(() => {
|
|
1353
2353
|
registerItem({ value, disabled });
|
|
1354
2354
|
if (value === tabs.value) {
|
|
1355
2355
|
tabs.previousTabRef.current = tabRef.current;
|
|
1356
2356
|
}
|
|
1357
2357
|
}, [value, tabs.value]);
|
|
1358
|
-
return /* @__PURE__ */ (0,
|
|
2358
|
+
return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(
|
|
1359
2359
|
Component,
|
|
1360
2360
|
__spreadProps(__spreadValues({
|
|
1361
2361
|
ref: (0, import_merge_refs.default)(tabRef, ref, (el) => tabs.tabRefs.current[value] = el),
|
|
1362
2362
|
className: (0, import_clsx15.default)(
|
|
1363
|
-
`${
|
|
1364
|
-
{ [`${
|
|
2363
|
+
`${prefixCls}tab`,
|
|
2364
|
+
{ [`${prefixCls}tab--selected`]: value === tabs.value, [`${prefixCls}tab--disabled`]: disabled },
|
|
1365
2365
|
className
|
|
1366
2366
|
),
|
|
1367
2367
|
role,
|
|
1368
2368
|
onClick: handleClick
|
|
1369
2369
|
}, rest), {
|
|
1370
2370
|
children: [
|
|
1371
|
-
/* @__PURE__ */ (0,
|
|
1372
|
-
/* @__PURE__ */ (0,
|
|
2371
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: `${prefixCls}overlay`, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: `${prefixCls}overlay__surface` }) }),
|
|
2372
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: `${prefixCls}tab__content`, children: [
|
|
2373
|
+
startContent && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: `${prefixCls}tab__start-content`, children: startContent }),
|
|
1373
2374
|
children,
|
|
1374
|
-
closable && /* @__PURE__ */ (0,
|
|
2375
|
+
endContent || closable && /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: `${prefixCls}tab__end-content`, children: [
|
|
2376
|
+
endContent,
|
|
2377
|
+
closable && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Button, { variant: "text", color: "secondary", iconOnly: true, size: "xs", onClick: handleClose, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Icon_default, { children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(CloseIcon_default, {}) }) })
|
|
2378
|
+
] })
|
|
1375
2379
|
] }),
|
|
1376
|
-
/* @__PURE__ */ (0,
|
|
2380
|
+
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: `${prefixCls}tab__indicator` })
|
|
1377
2381
|
]
|
|
1378
2382
|
})
|
|
1379
2383
|
);
|
|
@@ -1382,8 +2386,8 @@ var Tab = (0, import_react37.forwardRef)(
|
|
|
1382
2386
|
|
|
1383
2387
|
// src/components/Tabs/Tabs.tsx
|
|
1384
2388
|
var import_clsx16 = __toESM(require("clsx"));
|
|
1385
|
-
var
|
|
1386
|
-
var
|
|
2389
|
+
var import_react54 = require("react");
|
|
2390
|
+
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
1387
2391
|
var Tabs = (_a) => {
|
|
1388
2392
|
var _b = _a, {
|
|
1389
2393
|
children,
|
|
@@ -1402,11 +2406,11 @@ var Tabs = (_a) => {
|
|
|
1402
2406
|
"onChange",
|
|
1403
2407
|
"onClose"
|
|
1404
2408
|
]);
|
|
1405
|
-
const tabsRef = (0,
|
|
1406
|
-
const tabRefs = (0,
|
|
1407
|
-
const previousTabRef = (0,
|
|
1408
|
-
const [selfValue, setSelfValue] = (0,
|
|
1409
|
-
const [items, setItems] = (0,
|
|
2409
|
+
const tabsRef = (0, import_react54.useRef)(null);
|
|
2410
|
+
const tabRefs = (0, import_react54.useRef)({});
|
|
2411
|
+
const previousTabRef = (0, import_react54.useRef)(null);
|
|
2412
|
+
const [selfValue, setSelfValue] = (0, import_react54.useState)(value != null ? value : defaultValue);
|
|
2413
|
+
const [items, setItems] = (0, import_react54.useState)([]);
|
|
1410
2414
|
const registerItem = (item) => {
|
|
1411
2415
|
setItems((prevItems) => {
|
|
1412
2416
|
const index = prevItems.findIndex((item2) => item2.value);
|
|
@@ -1433,24 +2437,24 @@ var Tabs = (_a) => {
|
|
|
1433
2437
|
const handleClose = (value2) => {
|
|
1434
2438
|
onClose == null ? void 0 : onClose(value2);
|
|
1435
2439
|
};
|
|
1436
|
-
(0,
|
|
2440
|
+
(0, import_react54.useEffect)(() => {
|
|
1437
2441
|
if (value !== void 0) {
|
|
1438
2442
|
setSelfValue(value);
|
|
1439
2443
|
scrollToTab(value);
|
|
1440
2444
|
}
|
|
1441
2445
|
}, [value]);
|
|
1442
|
-
(0,
|
|
2446
|
+
(0, import_react54.useEffect)(() => {
|
|
1443
2447
|
if (value === void 0) {
|
|
1444
2448
|
const item = items.find((tab) => !tab.disabled);
|
|
1445
2449
|
setSelfValue(item == null ? void 0 : item.value);
|
|
1446
2450
|
}
|
|
1447
2451
|
}, [value, items]);
|
|
1448
|
-
return /* @__PURE__ */ (0,
|
|
2452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(
|
|
1449
2453
|
TabsContext.Provider,
|
|
1450
2454
|
{
|
|
1451
2455
|
value: { previousTabRef, tabRefs, value: selfValue, onChange: handleChange, onClose: handleClose, registerItem },
|
|
1452
2456
|
children: [
|
|
1453
|
-
/* @__PURE__ */ (0,
|
|
2457
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
|
|
1454
2458
|
"div",
|
|
1455
2459
|
__spreadProps(__spreadValues({
|
|
1456
2460
|
ref: tabsRef,
|
|
@@ -1459,7 +2463,7 @@ var Tabs = (_a) => {
|
|
|
1459
2463
|
children
|
|
1460
2464
|
})
|
|
1461
2465
|
),
|
|
1462
|
-
/* @__PURE__ */ (0,
|
|
2466
|
+
/* @__PURE__ */ (0, import_jsx_runtime34.jsx)("div", { className: `${PREFIX_CLS}divider` })
|
|
1463
2467
|
]
|
|
1464
2468
|
}
|
|
1465
2469
|
);
|
|
@@ -1467,774 +2471,566 @@ var Tabs = (_a) => {
|
|
|
1467
2471
|
|
|
1468
2472
|
// src/components/Toolbar/Toolbar.tsx
|
|
1469
2473
|
var import_clsx17 = __toESM(require("clsx"));
|
|
1470
|
-
var
|
|
2474
|
+
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
1471
2475
|
var Toolbar = (props) => {
|
|
1472
|
-
const _a = props, {
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
2476
|
+
const _a = props, {
|
|
2477
|
+
children,
|
|
2478
|
+
className,
|
|
2479
|
+
size = "md",
|
|
2480
|
+
startContent,
|
|
2481
|
+
endContent,
|
|
2482
|
+
startAction,
|
|
2483
|
+
endAction,
|
|
2484
|
+
title,
|
|
2485
|
+
subtitle
|
|
2486
|
+
} = _a, rest = __objRest(_a, [
|
|
2487
|
+
"children",
|
|
2488
|
+
"className",
|
|
2489
|
+
"size",
|
|
2490
|
+
"startContent",
|
|
2491
|
+
"endContent",
|
|
2492
|
+
"startAction",
|
|
2493
|
+
"endAction",
|
|
2494
|
+
"title",
|
|
2495
|
+
"subtitle"
|
|
2496
|
+
]);
|
|
2497
|
+
const prefixCls = PREFIX_CLS;
|
|
2498
|
+
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", __spreadProps(__spreadValues({ className: (0, import_clsx17.default)(`${prefixCls}toolbar`, { [`${prefixCls}toolbar--${size}`]: size }, className) }, rest), { children: [
|
|
2499
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: `${prefixCls}outline-b` }),
|
|
2500
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("div", { className: (0, import_clsx17.default)(`${prefixCls}toolbar__container`), children: [
|
|
2501
|
+
startContent ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: (0, import_clsx17.default)(`${prefixCls}toolbar__start-content`), children: startContent }) : startAction && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: (0, import_clsx17.default)(`${prefixCls}toolbar__start-action`), children: startAction }),
|
|
2502
|
+
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: (0, import_clsx17.default)(`${prefixCls}toolbar__content`), children: title || subtitle ? /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
|
|
2503
|
+
title && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: (0, import_clsx17.default)(`${prefixCls}toolbar__title`), children: title }),
|
|
2504
|
+
subtitle && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: (0, import_clsx17.default)(`${prefixCls}toolbar__subtitle`), children: subtitle })
|
|
1480
2505
|
] }) : children }),
|
|
1481
|
-
endAction && /* @__PURE__ */ (0,
|
|
2506
|
+
endContent ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: (0, import_clsx17.default)(`${prefixCls}toolbar__end-content`), children: endContent }) : endAction && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: (0, import_clsx17.default)(`${prefixCls}toolbar__end-action`), children: endAction })
|
|
1482
2507
|
] })
|
|
1483
2508
|
] }));
|
|
1484
2509
|
};
|
|
1485
2510
|
var Toolbar_default = Toolbar;
|
|
1486
2511
|
|
|
1487
|
-
// src/components/
|
|
1488
|
-
var
|
|
1489
|
-
var
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
)
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
2512
|
+
// src/components/TextInput/TextInput.tsx
|
|
2513
|
+
var import_react55 = require("react");
|
|
2514
|
+
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2515
|
+
var TextInput = (0, import_react55.forwardRef)(
|
|
2516
|
+
(_a, ref) => {
|
|
2517
|
+
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"]);
|
|
2518
|
+
const [focus, setFocus] = (0, import_react55.useState)(false);
|
|
2519
|
+
const selfInputRef = (0, import_react55.useRef)(null);
|
|
2520
|
+
const prefixCls = PREFIX_CLS;
|
|
2521
|
+
const handleChange = (event) => {
|
|
2522
|
+
onChange == null ? void 0 : onChange(event);
|
|
2523
|
+
};
|
|
2524
|
+
const handleClick = (event) => {
|
|
2525
|
+
var _a2;
|
|
2526
|
+
onClick == null ? void 0 : onClick(event);
|
|
2527
|
+
(_a2 = selfInputRef == null ? void 0 : selfInputRef.current) == null ? void 0 : _a2.focus();
|
|
2528
|
+
};
|
|
2529
|
+
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
|
|
2530
|
+
"div",
|
|
2531
|
+
{
|
|
2532
|
+
ref,
|
|
2533
|
+
className: clsx_default(
|
|
2534
|
+
`${prefixCls}input`,
|
|
2535
|
+
{ [`${prefixCls}input--focus`]: focus, [`${prefixCls}input--disabled`]: disabled },
|
|
2536
|
+
className
|
|
2537
|
+
),
|
|
2538
|
+
style,
|
|
2539
|
+
onFocus: () => {
|
|
2540
|
+
setFocus(true);
|
|
2541
|
+
},
|
|
2542
|
+
onBlur: () => {
|
|
2543
|
+
setFocus(false);
|
|
2544
|
+
},
|
|
2545
|
+
onClick: handleClick,
|
|
2546
|
+
children: [
|
|
2547
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: `${prefixCls}outline` }),
|
|
2548
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: `${prefixCls}input__content`, children: [
|
|
2549
|
+
startContent && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: `${prefixCls}input__start-content`, children: startContent }),
|
|
2550
|
+
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2551
|
+
"input",
|
|
2552
|
+
__spreadValues({
|
|
2553
|
+
ref: mergeRefs_default(selfInputRef, inputRef),
|
|
2554
|
+
className: `${prefixCls}input__field`,
|
|
2555
|
+
value,
|
|
2556
|
+
defaultValue,
|
|
2557
|
+
disabled,
|
|
2558
|
+
onChange: handleChange
|
|
2559
|
+
}, rest)
|
|
2560
|
+
),
|
|
2561
|
+
endContent && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: `${prefixCls}input__end-content`, children: endContent })
|
|
2562
|
+
] })
|
|
2563
|
+
]
|
|
2564
|
+
}
|
|
2565
|
+
);
|
|
2566
|
+
}
|
|
2567
|
+
);
|
|
2568
|
+
var TextInput_default = TextInput;
|
|
1503
2569
|
|
|
1504
|
-
// src/components/
|
|
1505
|
-
var
|
|
1506
|
-
var
|
|
1507
|
-
var
|
|
1508
|
-
var
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
keyField: keyField2 = "key",
|
|
1514
|
-
textField: textField3 = "text",
|
|
1515
|
-
placeholder,
|
|
1516
|
-
virtual,
|
|
1517
|
-
filterable,
|
|
1518
|
-
disabled,
|
|
1519
|
-
loading,
|
|
1520
|
-
className,
|
|
1521
|
-
onChange,
|
|
1522
|
-
onFilterChange
|
|
1523
|
-
}) => {
|
|
1524
|
-
const [value, setValue] = (0, import_react40.useState)(valueProp);
|
|
1525
|
-
const [filter, setFilter] = (0, import_react40.useState)(filterProp);
|
|
1526
|
-
const handleChange = (event) => {
|
|
1527
|
-
const value2 = event.target.value || null;
|
|
1528
|
-
if (valueProp !== void 0) {
|
|
1529
|
-
onChange(value2);
|
|
1530
|
-
} else {
|
|
1531
|
-
setValue(value2);
|
|
1532
|
-
}
|
|
1533
|
-
};
|
|
1534
|
-
const pageSize3 = virtual == null ? void 0 : virtual.pageSize;
|
|
1535
|
-
const filteredData = (0, import_react40.useRef)([]);
|
|
1536
|
-
const [state, setState] = (0, import_react40.useState)({
|
|
1537
|
-
skip: 0,
|
|
1538
|
-
total: propData.total,
|
|
1539
|
-
subsetData: propData.items.slice(0, pageSize3)
|
|
1540
|
-
});
|
|
1541
|
-
const handleFilterChange = (event) => {
|
|
1542
|
-
if (pageSize3) {
|
|
1543
|
-
filteredData.current = (0, import_kendo_data_query.filterBy)(propData.items.slice(), event.filter);
|
|
1544
|
-
const data = filteredData.current.slice(0, pageSize3);
|
|
1545
|
-
setState({
|
|
1546
|
-
subsetData: data,
|
|
1547
|
-
skip: 0,
|
|
1548
|
-
total: filteredData.current.length
|
|
1549
|
-
});
|
|
1550
|
-
}
|
|
1551
|
-
const filter2 = event.filter.value;
|
|
1552
|
-
if (filterProp !== void 0) {
|
|
1553
|
-
onFilterChange == null ? void 0 : onFilterChange(filter2);
|
|
1554
|
-
} else {
|
|
1555
|
-
setFilter(filter2);
|
|
1556
|
-
}
|
|
1557
|
-
};
|
|
1558
|
-
const handlePageChange = (event) => {
|
|
1559
|
-
if (pageSize3) {
|
|
1560
|
-
const skip = event.page.skip;
|
|
1561
|
-
const take = event.page.take;
|
|
1562
|
-
const newSubsetData = filteredData.current.slice(skip, skip + take);
|
|
1563
|
-
setState(__spreadProps(__spreadValues({}, state), { subsetData: newSubsetData, skip }));
|
|
1564
|
-
}
|
|
1565
|
-
};
|
|
1566
|
-
(0, import_react40.useEffect)(() => {
|
|
1567
|
-
if (valueProp !== void 0) {
|
|
1568
|
-
setValue(valueProp);
|
|
1569
|
-
}
|
|
1570
|
-
}, [valueProp]);
|
|
1571
|
-
(0, import_react40.useEffect)(() => {
|
|
1572
|
-
setFilter(filterProp);
|
|
1573
|
-
}, [filterProp]);
|
|
1574
|
-
(0, import_react40.useEffect)(() => {
|
|
1575
|
-
if (pageSize3) {
|
|
1576
|
-
filteredData.current = propData.items.slice();
|
|
1577
|
-
}
|
|
1578
|
-
}, [propData]);
|
|
1579
|
-
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
1580
|
-
import_kendo_react_dropdowns.ComboBox,
|
|
1581
|
-
{
|
|
2570
|
+
// src/components/Switch/Switch.tsx
|
|
2571
|
+
var import_clsx18 = __toESM(require("clsx"));
|
|
2572
|
+
var import_react56 = require("react");
|
|
2573
|
+
var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
2574
|
+
var Switch = (0, import_react56.forwardRef)(
|
|
2575
|
+
(_a, ref) => {
|
|
2576
|
+
var _b = _a, {
|
|
2577
|
+
id,
|
|
2578
|
+
name,
|
|
1582
2579
|
value,
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
var import_react41 = require("react");
|
|
1608
|
-
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
1609
|
-
var textField = "ContactName";
|
|
1610
|
-
var emptyItem = { [textField]: "loading ...", CustomerID: 0 };
|
|
1611
|
-
var pageSize = 10;
|
|
1612
|
-
var loadingData = [];
|
|
1613
|
-
while (loadingData.length < pageSize) {
|
|
1614
|
-
loadingData.push(__spreadValues({}, emptyItem));
|
|
1615
|
-
}
|
|
1616
|
-
var SelectServer = ({
|
|
1617
|
-
data: dataProp,
|
|
1618
|
-
value: valueProp,
|
|
1619
|
-
keyField: keyField2 = "key",
|
|
1620
|
-
textField: textField3 = "text",
|
|
1621
|
-
placeholder,
|
|
1622
|
-
virtual,
|
|
1623
|
-
filterable,
|
|
1624
|
-
filter: filterProp = "",
|
|
1625
|
-
disabled,
|
|
1626
|
-
loading,
|
|
1627
|
-
className,
|
|
1628
|
-
onChange,
|
|
1629
|
-
onDataChange,
|
|
1630
|
-
onFilterChange,
|
|
1631
|
-
getData,
|
|
1632
|
-
renderItem
|
|
1633
|
-
}) => {
|
|
1634
|
-
var _a;
|
|
1635
|
-
const dataCaching = (0, import_react41.useRef)([]);
|
|
1636
|
-
const pendingRequest = (0, import_react41.useRef)();
|
|
1637
|
-
const requestStarted = (0, import_react41.useRef)(false);
|
|
1638
|
-
const emptyItem3 = { [keyField2]: 0, [textField3]: "loading ..." };
|
|
1639
|
-
const [loadingData3, setLoadingData] = (0, import_react41.useState)([]);
|
|
1640
|
-
const [data, setData] = (0, import_react41.useState)(dataProp.items);
|
|
1641
|
-
const [total, setTotal] = (0, import_react41.useState)(0);
|
|
1642
|
-
const [value, setValue] = (0, import_react41.useState)(valueProp);
|
|
1643
|
-
const [filter, setFilter] = (0, import_react41.useState)(filterProp);
|
|
1644
|
-
const pageSize3 = (_a = virtual == null ? void 0 : virtual.pageSize) != null ? _a : 10;
|
|
1645
|
-
const skipRef = (0, import_react41.useRef)(0);
|
|
1646
|
-
const resetCach = () => {
|
|
1647
|
-
dataCaching.current.length = 0;
|
|
1648
|
-
};
|
|
1649
|
-
const requestData = (0, import_react41.useCallback)(
|
|
1650
|
-
(state) => {
|
|
1651
|
-
const { skip } = state;
|
|
1652
|
-
if (requestStarted.current) {
|
|
1653
|
-
clearTimeout(pendingRequest.current);
|
|
1654
|
-
pendingRequest.current = setTimeout(() => {
|
|
1655
|
-
requestData(state);
|
|
1656
|
-
}, 50);
|
|
1657
|
-
return;
|
|
1658
|
-
}
|
|
1659
|
-
requestStarted.current = true;
|
|
1660
|
-
getData(state).then(({ items, total: total2 }) => {
|
|
1661
|
-
items.forEach((item, index) => {
|
|
1662
|
-
dataCaching.current[index + skip] = item;
|
|
1663
|
-
});
|
|
1664
|
-
if (skip === skipRef.current) {
|
|
1665
|
-
setData(items);
|
|
1666
|
-
setTotal(total2);
|
|
1667
|
-
onDataChange == null ? void 0 : onDataChange({ items, total: total2 });
|
|
1668
|
-
}
|
|
1669
|
-
requestStarted.current = false;
|
|
1670
|
-
}).catch(() => {
|
|
1671
|
-
requestStarted.current = false;
|
|
1672
|
-
});
|
|
1673
|
-
},
|
|
1674
|
-
[getData]
|
|
1675
|
-
);
|
|
1676
|
-
const handleFilterChange = (0, import_react41.useCallback)((event) => {
|
|
1677
|
-
const filter2 = event.filter.value;
|
|
1678
|
-
if (filterProp !== void 0) {
|
|
1679
|
-
onFilterChange == null ? void 0 : onFilterChange(filter2);
|
|
1680
|
-
} else {
|
|
1681
|
-
setFilter(filter2);
|
|
1682
|
-
}
|
|
1683
|
-
resetCach();
|
|
1684
|
-
requestData({ skip: 0, filter: filter2 });
|
|
1685
|
-
setData(loadingData3);
|
|
1686
|
-
skipRef.current = 0;
|
|
1687
|
-
}, []);
|
|
1688
|
-
const shouldRequestData = (0, import_react41.useCallback)((skip) => {
|
|
1689
|
-
for (let i = 0; i < pageSize3; i++) {
|
|
1690
|
-
if (!dataCaching.current[skip + i]) {
|
|
1691
|
-
return true;
|
|
1692
|
-
}
|
|
1693
|
-
}
|
|
1694
|
-
return false;
|
|
1695
|
-
}, []);
|
|
1696
|
-
const getCachedData = (0, import_react41.useCallback)((skip) => {
|
|
1697
|
-
const data2 = [];
|
|
1698
|
-
for (let i = 0; i < pageSize3; i++) {
|
|
1699
|
-
data2.push(dataCaching.current[i + skip] || emptyItem3);
|
|
1700
|
-
}
|
|
1701
|
-
return data2;
|
|
1702
|
-
}, []);
|
|
1703
|
-
const pageChange = (0, import_react41.useCallback)(
|
|
1704
|
-
(event) => {
|
|
1705
|
-
if (filter !== void 0) {
|
|
1706
|
-
const newSkip = event.page.skip;
|
|
1707
|
-
if (shouldRequestData(newSkip)) {
|
|
1708
|
-
requestData({ skip: newSkip, filter });
|
|
1709
|
-
}
|
|
1710
|
-
const data2 = getCachedData(newSkip);
|
|
1711
|
-
setData(data2);
|
|
1712
|
-
skipRef.current = newSkip;
|
|
1713
|
-
}
|
|
1714
|
-
},
|
|
1715
|
-
[getCachedData, requestData, shouldRequestData, filter]
|
|
1716
|
-
);
|
|
1717
|
-
const handleChange = (0, import_react41.useCallback)((event) => {
|
|
1718
|
-
const value2 = event.target.value;
|
|
1719
|
-
if (value2 && value2[textField3] === emptyItem3[textField3]) {
|
|
1720
|
-
return;
|
|
1721
|
-
}
|
|
1722
|
-
if (valueProp !== void 0) {
|
|
1723
|
-
onChange(value2);
|
|
1724
|
-
} else {
|
|
1725
|
-
setValue(value2);
|
|
1726
|
-
}
|
|
1727
|
-
}, []);
|
|
1728
|
-
const handleItemRender = (li, itemProps) => {
|
|
1729
|
-
const itemChildren = renderItem == null ? void 0 : renderItem(itemProps.dataItem);
|
|
1730
|
-
if (!itemChildren)
|
|
1731
|
-
return (0, import_react41.cloneElement)(li, li.props);
|
|
1732
|
-
return (0, import_react41.cloneElement)(li, li.props, itemChildren);
|
|
1733
|
-
};
|
|
1734
|
-
(0, import_react41.useEffect)(() => {
|
|
1735
|
-
const pageSize4 = 10;
|
|
1736
|
-
const loadingData4 = [];
|
|
1737
|
-
while (loadingData4.length < pageSize4) {
|
|
1738
|
-
loadingData4.push(emptyItem3);
|
|
1739
|
-
}
|
|
1740
|
-
setLoadingData(loadingData4);
|
|
1741
|
-
}, []);
|
|
1742
|
-
(0, import_react41.useEffect)(() => {
|
|
1743
|
-
if (valueProp !== void 0) {
|
|
1744
|
-
setValue(valueProp);
|
|
1745
|
-
}
|
|
1746
|
-
}, [valueProp]);
|
|
1747
|
-
(0, import_react41.useEffect)(() => {
|
|
1748
|
-
if (filterProp !== void 0) {
|
|
1749
|
-
setFilter(filterProp);
|
|
1750
|
-
}
|
|
1751
|
-
}, [filterProp]);
|
|
1752
|
-
(0, import_react41.useEffect)(() => {
|
|
1753
|
-
requestData({ skip: 0, filter });
|
|
1754
|
-
return () => {
|
|
1755
|
-
resetCach();
|
|
1756
|
-
};
|
|
1757
|
-
}, [filter, requestData]);
|
|
1758
|
-
(0, import_react41.useEffect)(() => {
|
|
1759
|
-
setData(dataProp.items);
|
|
1760
|
-
}, [dataProp]);
|
|
1761
|
-
return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
|
|
1762
|
-
import_kendo_react_dropdowns2.ComboBox,
|
|
1763
|
-
{
|
|
1764
|
-
data,
|
|
1765
|
-
value,
|
|
1766
|
-
placeholder,
|
|
1767
|
-
dataItemKey: keyField2,
|
|
1768
|
-
textField: textField3,
|
|
1769
|
-
filterable,
|
|
1770
|
-
onFilterChange: handleFilterChange,
|
|
1771
|
-
virtual: {
|
|
1772
|
-
pageSize: pageSize3,
|
|
1773
|
-
skip: skipRef.current,
|
|
1774
|
-
total
|
|
1775
|
-
},
|
|
1776
|
-
disabled,
|
|
1777
|
-
loading,
|
|
1778
|
-
className,
|
|
1779
|
-
onChange: handleChange,
|
|
1780
|
-
onPageChange: pageChange,
|
|
1781
|
-
itemRender: handleItemRender
|
|
1782
|
-
}
|
|
1783
|
-
);
|
|
1784
|
-
};
|
|
1785
|
-
var SelectServer_default = SelectServer;
|
|
1786
|
-
|
|
1787
|
-
// src/components/Select/Select.tsx
|
|
1788
|
-
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
1789
|
-
var Select = (props) => {
|
|
1790
|
-
return props.filterMode === "client" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectClient_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(SelectServer_default, __spreadValues({}, props));
|
|
1791
|
-
};
|
|
1792
|
-
var Select_default = Select;
|
|
1793
|
-
|
|
1794
|
-
// src/components/Switch/Switch.tsx
|
|
1795
|
-
var import_clsx18 = __toESM(require("clsx"));
|
|
1796
|
-
var import_react42 = require("react");
|
|
1797
|
-
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
1798
|
-
var Switch = (0, import_react42.forwardRef)(
|
|
1799
|
-
(_a, ref) => {
|
|
1800
|
-
var _b = _a, { name, value: valueProp, defaultValue, onChange: onChangeProp, disabled } = _b, rest = __objRest(_b, ["name", "value", "defaultValue", "onChange", "disabled"]);
|
|
1801
|
-
var _a2;
|
|
1802
|
-
const [selftValue, setSelfValue] = (0, import_react42.useState)((_a2 = valueProp != null ? valueProp : defaultValue) != null ? _a2 : false);
|
|
1803
|
-
const handleChange = () => {
|
|
1804
|
-
if (disabled) {
|
|
1805
|
-
return;
|
|
1806
|
-
}
|
|
1807
|
-
onChangeProp == null ? void 0 : onChangeProp(!selftValue);
|
|
1808
|
-
setSelfValue(!selftValue);
|
|
2580
|
+
defaultValue,
|
|
2581
|
+
checked: checkedProp,
|
|
2582
|
+
defaultChecked,
|
|
2583
|
+
onChange,
|
|
2584
|
+
onCheckedChange: onCheckedChangeProp,
|
|
2585
|
+
disabled
|
|
2586
|
+
} = _b, rest = __objRest(_b, [
|
|
2587
|
+
"id",
|
|
2588
|
+
"name",
|
|
2589
|
+
"value",
|
|
2590
|
+
"defaultValue",
|
|
2591
|
+
"checked",
|
|
2592
|
+
"defaultChecked",
|
|
2593
|
+
"onChange",
|
|
2594
|
+
"onCheckedChange",
|
|
2595
|
+
"disabled"
|
|
2596
|
+
]);
|
|
2597
|
+
const [selftChecked, setSelfChecked] = (0, import_react56.useState)(checkedProp);
|
|
2598
|
+
const prefixCls = PREFIX_CLS;
|
|
2599
|
+
const handleChange = (event) => {
|
|
2600
|
+
const { value: value2, checked } = event.target;
|
|
2601
|
+
setSelfChecked(checked);
|
|
2602
|
+
onChange == null ? void 0 : onChange(value2);
|
|
2603
|
+
onCheckedChangeProp == null ? void 0 : onCheckedChangeProp(checked);
|
|
1809
2604
|
};
|
|
1810
|
-
(0,
|
|
1811
|
-
if (
|
|
1812
|
-
|
|
2605
|
+
(0, import_react56.useEffect)(() => {
|
|
2606
|
+
if (checkedProp !== void 0) {
|
|
2607
|
+
setSelfChecked(checkedProp);
|
|
1813
2608
|
}
|
|
1814
|
-
}, [
|
|
1815
|
-
return /* @__PURE__ */ (0,
|
|
2609
|
+
}, [checkedProp]);
|
|
2610
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(
|
|
1816
2611
|
"label",
|
|
1817
|
-
{
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
2612
|
+
__spreadProps(__spreadValues({
|
|
2613
|
+
ref,
|
|
2614
|
+
htmlFor: id,
|
|
2615
|
+
className: (0, import_clsx18.default)(`${prefixCls}switch`, {
|
|
2616
|
+
[`${prefixCls}switch--checked`]: !!selftChecked
|
|
2617
|
+
})
|
|
2618
|
+
}, rest), {
|
|
1822
2619
|
children: [
|
|
1823
|
-
/* @__PURE__ */ (0,
|
|
2620
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
|
|
1824
2621
|
"input",
|
|
1825
|
-
|
|
2622
|
+
{
|
|
1826
2623
|
type: "checkbox",
|
|
1827
|
-
|
|
2624
|
+
id,
|
|
1828
2625
|
name,
|
|
1829
|
-
|
|
1830
|
-
|
|
2626
|
+
value,
|
|
2627
|
+
defaultValue,
|
|
2628
|
+
checked: selftChecked,
|
|
2629
|
+
defaultChecked,
|
|
1831
2630
|
disabled,
|
|
1832
2631
|
onChange: handleChange
|
|
1833
|
-
}
|
|
2632
|
+
}
|
|
1834
2633
|
),
|
|
1835
|
-
/* @__PURE__ */ (0,
|
|
2634
|
+
/* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: `${prefixCls}switch__thumb` })
|
|
1836
2635
|
]
|
|
1837
|
-
}
|
|
2636
|
+
})
|
|
1838
2637
|
);
|
|
1839
2638
|
}
|
|
1840
2639
|
);
|
|
1841
2640
|
var Switch_default = Switch;
|
|
1842
2641
|
|
|
1843
|
-
// src/components/
|
|
1844
|
-
var
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
var
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
var
|
|
1851
|
-
var
|
|
1852
|
-
var
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
const [value, setValue] = (0, import_react43.useState)(valueProp);
|
|
1872
|
-
const [filter, setFilter] = (0, import_react43.useState)(filterProp);
|
|
1873
|
-
const handleChange = (event) => {
|
|
1874
|
-
onChange(event.target.value);
|
|
1875
|
-
};
|
|
1876
|
-
const pageSize3 = virtual == null ? void 0 : virtual.pageSize;
|
|
1877
|
-
const filteredData = (0, import_react43.useRef)([]);
|
|
1878
|
-
const [state, setState] = (0, import_react43.useState)({
|
|
1879
|
-
skip: 0,
|
|
1880
|
-
total: dataProp.total,
|
|
1881
|
-
subsetData: dataProp.items.slice(0, pageSize3)
|
|
1882
|
-
});
|
|
1883
|
-
const handleFilterChange = (event) => {
|
|
1884
|
-
if (pageSize3) {
|
|
1885
|
-
filteredData.current = (0, import_kendo_data_query2.filterBy)(dataProp.items.slice(), event.filter);
|
|
1886
|
-
const data = filteredData.current.slice(0, pageSize3);
|
|
1887
|
-
setState({
|
|
1888
|
-
subsetData: data,
|
|
1889
|
-
skip: 0,
|
|
1890
|
-
total: filteredData.current.length
|
|
1891
|
-
});
|
|
1892
|
-
}
|
|
1893
|
-
onFilterChange == null ? void 0 : onFilterChange(event.filter.value);
|
|
1894
|
-
};
|
|
1895
|
-
const pageChange = (event) => {
|
|
1896
|
-
if (pageSize3) {
|
|
1897
|
-
const skip = event.page.skip;
|
|
1898
|
-
const take = event.page.take;
|
|
1899
|
-
const newSubsetData = filteredData.current.slice(skip, skip + take);
|
|
1900
|
-
setState(__spreadProps(__spreadValues({}, state), { subsetData: newSubsetData, skip }));
|
|
1901
|
-
}
|
|
2642
|
+
// src/components/Select/Select.tsx
|
|
2643
|
+
var import_react60 = require("react");
|
|
2644
|
+
|
|
2645
|
+
// src/components/Select/SelectContent.tsx
|
|
2646
|
+
var import_react58 = require("react");
|
|
2647
|
+
|
|
2648
|
+
// src/components/Select/SelectContext.tsx
|
|
2649
|
+
var import_react57 = require("react");
|
|
2650
|
+
var SelectContext = (0, import_react57.createContext)(null);
|
|
2651
|
+
var useSelect = () => {
|
|
2652
|
+
const context = (0, import_react57.useContext)(SelectContext);
|
|
2653
|
+
if (!context) {
|
|
2654
|
+
throw new Error("`useSelect` must be used within a `<Select />`");
|
|
2655
|
+
}
|
|
2656
|
+
return context;
|
|
2657
|
+
};
|
|
2658
|
+
var SelectContext_default = SelectContext;
|
|
2659
|
+
|
|
2660
|
+
// src/components/Select/SelectContent.tsx
|
|
2661
|
+
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
2662
|
+
var SelectContent = () => {
|
|
2663
|
+
const { data, values, offset, setOffset, keyField, textField, onItemSelect, renderItem } = useSelect();
|
|
2664
|
+
const parentRef = (0, import_react58.useRef)(null);
|
|
2665
|
+
const { isOpen } = usePopover();
|
|
2666
|
+
const handleItemSelect = (item) => {
|
|
2667
|
+
var _a;
|
|
2668
|
+
onItemSelect(item);
|
|
2669
|
+
setOffset(((_a = parentRef.current) == null ? void 0 : _a.scrollHeight) || 0);
|
|
1902
2670
|
};
|
|
1903
|
-
(0,
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
}, [
|
|
1909
|
-
(0,
|
|
1910
|
-
|
|
1911
|
-
filteredData.current = dataProp.items.slice();
|
|
1912
|
-
}
|
|
1913
|
-
}, [dataProp]);
|
|
1914
|
-
return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
|
|
1915
|
-
import_kendo_react_dropdowns3.MultiSelect,
|
|
2671
|
+
(0, import_react58.useEffect)(() => {
|
|
2672
|
+
var _a;
|
|
2673
|
+
if (!isOpen)
|
|
2674
|
+
return;
|
|
2675
|
+
(_a = parentRef.current) == null ? void 0 : _a.scrollTo({ top: offset });
|
|
2676
|
+
}, [isOpen]);
|
|
2677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2678
|
+
ScrollArea_default,
|
|
1916
2679
|
{
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
} :
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
2680
|
+
ref: parentRef,
|
|
2681
|
+
style: {
|
|
2682
|
+
height: `200px`,
|
|
2683
|
+
width: `100%`,
|
|
2684
|
+
position: "relative"
|
|
2685
|
+
},
|
|
2686
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(List_default, { children: renderItem ? data.map((item) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_react58.Fragment, { children: renderItem(item, {
|
|
2687
|
+
title: "",
|
|
2688
|
+
selected: values.includes(item[keyField]),
|
|
2689
|
+
hoverable: true,
|
|
2690
|
+
onClick: () => handleItemSelect(item)
|
|
2691
|
+
}) }, item[keyField])) : data.map((item) => /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
|
|
2692
|
+
ListItem_default,
|
|
2693
|
+
{
|
|
2694
|
+
title: item[textField],
|
|
2695
|
+
selected: values.includes(item[keyField]),
|
|
2696
|
+
hoverable: true,
|
|
2697
|
+
onClick: () => handleItemSelect(item)
|
|
2698
|
+
},
|
|
2699
|
+
item[keyField]
|
|
2700
|
+
)) })
|
|
1935
2701
|
}
|
|
1936
2702
|
);
|
|
1937
2703
|
};
|
|
1938
|
-
var
|
|
2704
|
+
var SelectContent_default = SelectContent;
|
|
1939
2705
|
|
|
1940
|
-
// src/components/
|
|
1941
|
-
var
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
var
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
}) => {
|
|
1961
|
-
var _a;
|
|
1962
|
-
const dataCaching = (0, import_react44.useRef)([]);
|
|
1963
|
-
const pendingRequest = (0, import_react44.useRef)();
|
|
1964
|
-
const requestStarted = (0, import_react44.useRef)(false);
|
|
1965
|
-
const emptyItem3 = { [keyField2]: 0, [textField3]: "loading ..." };
|
|
1966
|
-
const [loadingData3, setLoadingData] = (0, import_react44.useState)([]);
|
|
1967
|
-
const [data, setData] = (0, import_react44.useState)(dataProp.items);
|
|
1968
|
-
const [total, setTotal] = (0, import_react44.useState)(0);
|
|
1969
|
-
const [value, setValue] = (0, import_react44.useState)(valueProp);
|
|
1970
|
-
const [filter, setFilter] = (0, import_react44.useState)(filterProp);
|
|
1971
|
-
const pageSize3 = (_a = virtual == null ? void 0 : virtual.pageSize) != null ? _a : 10;
|
|
1972
|
-
const skipRef = (0, import_react44.useRef)(0);
|
|
1973
|
-
const resetCach = () => {
|
|
1974
|
-
dataCaching.current.length = 0;
|
|
2706
|
+
// src/components/Select/SelectVirtual.tsx
|
|
2707
|
+
var import_react59 = require("react");
|
|
2708
|
+
|
|
2709
|
+
// src/components/Select/utils.ts
|
|
2710
|
+
var valueToValues2 = (value) => {
|
|
2711
|
+
return Array.isArray(value) ? value : value !== null ? [value] : [];
|
|
2712
|
+
};
|
|
2713
|
+
var valuesToValue2 = (values) => {
|
|
2714
|
+
return Array.isArray(values) ? values.length !== 0 ? values[0] : null : values;
|
|
2715
|
+
};
|
|
2716
|
+
|
|
2717
|
+
// src/components/Select/SelectVirtual.tsx
|
|
2718
|
+
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2719
|
+
var SelectVirtual = () => {
|
|
2720
|
+
const { data, values, keyField, textField, virtual, onItemSelect, renderItem } = useSelect();
|
|
2721
|
+
const parentRef = (0, import_react59.useRef)(null);
|
|
2722
|
+
const virtualizer = useVirtualizer_default(__spreadProps(__spreadValues({}, virtual), { count: data.length, parentRef }));
|
|
2723
|
+
const { isOpen } = usePopover();
|
|
2724
|
+
const handleItemSelect = (item) => {
|
|
2725
|
+
onItemSelect(item);
|
|
1975
2726
|
};
|
|
1976
|
-
|
|
1977
|
-
(
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
2727
|
+
(0, import_react59.useEffect)(() => {
|
|
2728
|
+
if (!isOpen)
|
|
2729
|
+
return;
|
|
2730
|
+
const value = valuesToValue2(values);
|
|
2731
|
+
const index = data.findIndex((item) => item[keyField] === value);
|
|
2732
|
+
virtualizer.scrollToIndex(index, { align: "start" });
|
|
2733
|
+
}, [isOpen]);
|
|
2734
|
+
if (!virtual)
|
|
2735
|
+
return null;
|
|
2736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2737
|
+
ScrollArea_default,
|
|
2738
|
+
{
|
|
2739
|
+
ref: parentRef,
|
|
2740
|
+
autoHide: true,
|
|
2741
|
+
style: {
|
|
2742
|
+
height: `200px`,
|
|
2743
|
+
width: `100%`,
|
|
2744
|
+
position: "relative"
|
|
2745
|
+
},
|
|
2746
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(List_default, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2747
|
+
"div",
|
|
2748
|
+
{
|
|
2749
|
+
style: {
|
|
2750
|
+
height: `${virtualizer.getTotalSize()}px`,
|
|
2751
|
+
width: "100%",
|
|
2752
|
+
position: "relative"
|
|
2753
|
+
},
|
|
2754
|
+
children: virtualizer.getVirtualItems().map((virtualItem) => {
|
|
2755
|
+
const isLoaderRow = virtualItem.index > data.length - 1;
|
|
2756
|
+
const item = data[virtualItem.index];
|
|
2757
|
+
if (isLoaderRow) {
|
|
2758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2759
|
+
ListItem_default,
|
|
2760
|
+
{
|
|
2761
|
+
title: virtual.hasNextPage ? "Loading..." : "Nothing more to load",
|
|
2762
|
+
style: {
|
|
2763
|
+
position: "absolute",
|
|
2764
|
+
top: 0,
|
|
2765
|
+
left: 0,
|
|
2766
|
+
width: "100%",
|
|
2767
|
+
height: `${virtualItem.size}px`,
|
|
2768
|
+
transform: `translateY(${virtualItem.start}px)`
|
|
2769
|
+
}
|
|
2770
|
+
},
|
|
2771
|
+
virtualItem.index
|
|
2772
|
+
);
|
|
2773
|
+
}
|
|
2774
|
+
if (!item) {
|
|
2775
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2776
|
+
ListItem_default,
|
|
2777
|
+
{
|
|
2778
|
+
title: `Item ${virtualItem.index} not found`,
|
|
2779
|
+
style: {
|
|
2780
|
+
position: "absolute",
|
|
2781
|
+
top: 0,
|
|
2782
|
+
left: 0,
|
|
2783
|
+
width: "100%",
|
|
2784
|
+
height: `${virtualItem.size}px`,
|
|
2785
|
+
transform: `translateY(${virtualItem.start}px)`
|
|
2786
|
+
}
|
|
2787
|
+
},
|
|
2788
|
+
virtualItem.index
|
|
2789
|
+
);
|
|
2790
|
+
}
|
|
2791
|
+
if (renderItem) {
|
|
2792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_react59.Fragment, { children: renderItem(item, {
|
|
2793
|
+
title: "",
|
|
2794
|
+
selected: values.includes(item[keyField]),
|
|
2795
|
+
hoverable: true,
|
|
2796
|
+
style: {
|
|
2797
|
+
position: "absolute",
|
|
2798
|
+
top: 0,
|
|
2799
|
+
left: 0,
|
|
2800
|
+
width: "100%",
|
|
2801
|
+
height: `${virtualItem.size}px`,
|
|
2802
|
+
transform: `translateY(${virtualItem.start}px)`
|
|
2803
|
+
},
|
|
2804
|
+
onClick: () => handleItemSelect(item)
|
|
2805
|
+
}) }, virtualItem.index);
|
|
2806
|
+
}
|
|
2807
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
|
|
2808
|
+
ListItem_default,
|
|
2809
|
+
{
|
|
2810
|
+
title: item[textField],
|
|
2811
|
+
selected: values.includes(item[keyField]),
|
|
2812
|
+
hoverable: true,
|
|
2813
|
+
style: {
|
|
2814
|
+
position: "absolute",
|
|
2815
|
+
top: 0,
|
|
2816
|
+
left: 0,
|
|
2817
|
+
width: "100%",
|
|
2818
|
+
height: `${virtualItem.size}px`,
|
|
2819
|
+
transform: `translateY(${virtualItem.start}px)`
|
|
2820
|
+
},
|
|
2821
|
+
onClick: () => handleItemSelect(item)
|
|
2822
|
+
},
|
|
2823
|
+
virtualItem.index
|
|
2824
|
+
);
|
|
2825
|
+
})
|
|
1995
2826
|
}
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
requestStarted.current = false;
|
|
1999
|
-
});
|
|
2000
|
-
},
|
|
2001
|
-
[getData]
|
|
2827
|
+
) })
|
|
2828
|
+
}
|
|
2002
2829
|
);
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2830
|
+
};
|
|
2831
|
+
var SelectVirtual_default = SelectVirtual;
|
|
2832
|
+
|
|
2833
|
+
// src/components/Select/Select.tsx
|
|
2834
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2835
|
+
var Select = (props) => {
|
|
2836
|
+
const {
|
|
2837
|
+
data,
|
|
2838
|
+
value: valueProp,
|
|
2839
|
+
keyField = "key",
|
|
2840
|
+
textField = "text",
|
|
2841
|
+
isMultiple = false,
|
|
2842
|
+
disabled,
|
|
2843
|
+
loading,
|
|
2844
|
+
disclosure: disclosureProp,
|
|
2845
|
+
virtual,
|
|
2846
|
+
placeholder,
|
|
2847
|
+
style,
|
|
2848
|
+
startContent,
|
|
2849
|
+
endContent,
|
|
2850
|
+
renderItem
|
|
2851
|
+
} = props;
|
|
2852
|
+
const disclosure = disclosureProp !== void 0 ? disclosureProp : useDisclosure_default();
|
|
2853
|
+
const prefixCls = PREFIX_CLS;
|
|
2854
|
+
const inputRef = (0, import_react60.useRef)(null);
|
|
2855
|
+
const [search, setSearch] = (0, import_react60.useState)("");
|
|
2856
|
+
const [isSearch, setIsSearch] = (0, import_react60.useState)(false);
|
|
2857
|
+
const [focus, setFocus] = (0, import_react60.useState)(false);
|
|
2858
|
+
const values = (0, import_react60.useMemo)(() => {
|
|
2859
|
+
return valueToValues2(valueProp);
|
|
2860
|
+
}, [valueProp]);
|
|
2861
|
+
const items = (0, import_react60.useMemo)(() => {
|
|
2862
|
+
return data.filter((item) => values.includes(item[keyField]));
|
|
2863
|
+
}, [data, values]);
|
|
2864
|
+
const [offset, setOffset] = (0, import_react60.useState)(0);
|
|
2865
|
+
const handleClick = () => {
|
|
2866
|
+
var _a;
|
|
2867
|
+
(_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.focus();
|
|
2868
|
+
};
|
|
2869
|
+
const handleChange = (values2) => {
|
|
2870
|
+
var _a, _b, _c, _d, _e;
|
|
2871
|
+
if (props.isMultiple) {
|
|
2872
|
+
const items2 = data.filter((item) => values2.includes(item[keyField]));
|
|
2873
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, items2);
|
|
2874
|
+
(_b = props.onValueChange) == null ? void 0 : _b.call(props, values2);
|
|
2875
|
+
} else {
|
|
2876
|
+
const newValue = valuesToValue2(values2);
|
|
2877
|
+
let item = null;
|
|
2878
|
+
if (newValue !== null) {
|
|
2879
|
+
item = (_c = data.find((item2) => item2[keyField] === newValue)) != null ? _c : null;
|
|
2016
2880
|
}
|
|
2881
|
+
(_d = props.onChange) == null ? void 0 : _d.call(props, item);
|
|
2882
|
+
(_e = props.onValueChange) == null ? void 0 : _e.call(props, newValue);
|
|
2017
2883
|
}
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2884
|
+
};
|
|
2885
|
+
const handleClear = (event) => {
|
|
2886
|
+
var _a, _b, _c, _d;
|
|
2887
|
+
event.stopPropagation();
|
|
2888
|
+
setIsSearch(true);
|
|
2889
|
+
setSearch("");
|
|
2890
|
+
if (props.isMultiple) {
|
|
2891
|
+
(_a = props.onChange) == null ? void 0 : _a.call(props, []);
|
|
2892
|
+
(_b = props.onValueChange) == null ? void 0 : _b.call(props, []);
|
|
2893
|
+
} else {
|
|
2894
|
+
(_c = props.onChange) == null ? void 0 : _c.call(props, null);
|
|
2895
|
+
(_d = props.onValueChange) == null ? void 0 : _d.call(props, null);
|
|
2024
2896
|
}
|
|
2025
|
-
|
|
2026
|
-
}
|
|
2027
|
-
const
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2897
|
+
setIsSearch(false);
|
|
2898
|
+
};
|
|
2899
|
+
const handleItemSelect = (item) => {
|
|
2900
|
+
var _a;
|
|
2901
|
+
const newValue = item[keyField];
|
|
2902
|
+
if (props.isMultiple) {
|
|
2903
|
+
const newValues = [...values];
|
|
2904
|
+
const valueIndex = values.indexOf(newValue);
|
|
2905
|
+
if (valueIndex === -1) {
|
|
2906
|
+
newValues.push(newValue);
|
|
2907
|
+
} else {
|
|
2908
|
+
newValues.splice(valueIndex, 1);
|
|
2032
2909
|
}
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2910
|
+
handleChange(newValues);
|
|
2911
|
+
} else {
|
|
2912
|
+
const value = valuesToValue2(values);
|
|
2913
|
+
if (value !== newValue) {
|
|
2914
|
+
handleChange([newValue]);
|
|
2915
|
+
}
|
|
2916
|
+
}
|
|
2917
|
+
setIsSearch(false);
|
|
2918
|
+
(_a = inputRef.current) == null ? void 0 : _a.focus();
|
|
2919
|
+
disclosure.onClose();
|
|
2920
|
+
};
|
|
2921
|
+
const handleOpen = () => {
|
|
2922
|
+
disclosure.onOpen();
|
|
2923
|
+
setFocus(true);
|
|
2924
|
+
};
|
|
2925
|
+
const handleClose = () => {
|
|
2926
|
+
disclosure.onClose();
|
|
2927
|
+
if (!props.isMultiple) {
|
|
2928
|
+
if (isSearch) {
|
|
2929
|
+
const item = items[0];
|
|
2930
|
+
if (item !== void 0) {
|
|
2931
|
+
setSearch(item[textField]);
|
|
2932
|
+
} else {
|
|
2933
|
+
setSearch("");
|
|
2934
|
+
}
|
|
2935
|
+
setIsSearch(false);
|
|
2936
|
+
}
|
|
2937
|
+
}
|
|
2938
|
+
};
|
|
2939
|
+
(0, import_react60.useEffect)(() => {
|
|
2940
|
+
if (isSearch)
|
|
2042
2941
|
return;
|
|
2942
|
+
if (!props.isMultiple) {
|
|
2943
|
+
const item = items[0];
|
|
2944
|
+
if (item !== void 0) {
|
|
2945
|
+
setSearch(item[textField]);
|
|
2946
|
+
}
|
|
2043
2947
|
}
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
while (loadingData4.length < pageSize4) {
|
|
2051
|
-
loadingData4.push(emptyItem3);
|
|
2948
|
+
}, [items]);
|
|
2949
|
+
(0, import_react60.useEffect)(() => {
|
|
2950
|
+
const values2 = valueToValues2(valueProp);
|
|
2951
|
+
const value = values2[0];
|
|
2952
|
+
if (value === void 0) {
|
|
2953
|
+
setSearch("");
|
|
2052
2954
|
}
|
|
2053
|
-
setLoadingData(loadingData4);
|
|
2054
|
-
}, []);
|
|
2055
|
-
(0, import_react44.useEffect)(() => {
|
|
2056
|
-
setData(dataProp.items);
|
|
2057
|
-
}, [dataProp]);
|
|
2058
|
-
(0, import_react44.useEffect)(() => {
|
|
2059
|
-
setValue(valueProp);
|
|
2060
2955
|
}, [valueProp]);
|
|
2061
|
-
(0,
|
|
2062
|
-
|
|
2063
|
-
}, [filterProp]);
|
|
2064
|
-
(0, import_react44.useEffect)(() => {
|
|
2065
|
-
requestData({ skip: 0, filter });
|
|
2066
|
-
return () => {
|
|
2067
|
-
resetCach();
|
|
2068
|
-
};
|
|
2069
|
-
}, [filter, requestData]);
|
|
2070
|
-
return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
|
|
2071
|
-
import_kendo_react_dropdowns4.MultiSelect,
|
|
2956
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
|
|
2957
|
+
SelectContext_default.Provider,
|
|
2072
2958
|
{
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2959
|
+
value: {
|
|
2960
|
+
data,
|
|
2961
|
+
values,
|
|
2962
|
+
keyField,
|
|
2963
|
+
textField,
|
|
2964
|
+
isMultiple,
|
|
2965
|
+
virtual,
|
|
2966
|
+
onChange: handleChange,
|
|
2967
|
+
onItemSelect: handleItemSelect,
|
|
2968
|
+
offset,
|
|
2969
|
+
setOffset,
|
|
2970
|
+
renderItem
|
|
2084
2971
|
},
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2972
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
2973
|
+
Popover_default,
|
|
2974
|
+
__spreadProps(__spreadValues({
|
|
2975
|
+
target: true
|
|
2976
|
+
}, disclosure), {
|
|
2977
|
+
isOpen: disclosure.isOpen,
|
|
2978
|
+
onOpen: handleOpen,
|
|
2979
|
+
onClose: handleClose,
|
|
2980
|
+
autoClose: "outside",
|
|
2981
|
+
children: [
|
|
2982
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(PopoverTrigger_default, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
|
|
2983
|
+
"div",
|
|
2984
|
+
{
|
|
2985
|
+
className: clsx_default(`${prefixCls}input`, {
|
|
2986
|
+
[`${prefixCls}input--focus`]: focus,
|
|
2987
|
+
[`${prefixCls}input--disabled`]: disabled
|
|
2988
|
+
}),
|
|
2989
|
+
style,
|
|
2990
|
+
onClick: handleClick,
|
|
2991
|
+
onFocus: () => {
|
|
2992
|
+
setFocus(true);
|
|
2993
|
+
},
|
|
2994
|
+
onBlur: () => {
|
|
2995
|
+
setFocus(false);
|
|
2996
|
+
},
|
|
2997
|
+
children: [
|
|
2998
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("input", { type: "text", ref: inputRef, style: { position: "absolute", opacity: 0 } }),
|
|
2999
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: `${prefixCls}outline` }),
|
|
3000
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: `${prefixCls}input__content`, children: [
|
|
3001
|
+
startContent && /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: `${prefixCls}input__start-content`, children: startContent }),
|
|
3002
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: `${prefixCls}input__field`, children: search || placeholder }),
|
|
3003
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("div", { className: `${prefixCls}input__end-content`, children: [
|
|
3004
|
+
endContent,
|
|
3005
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon_default, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(LoaderIcon_default, { className: `${prefixCls}animation-spin` }) }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Button, { color: "secondary", variant: "plain", size: "xs", iconOnly: true, onClick: handleClear, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon_default, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CloseIcon_default, {}) }) }),
|
|
3006
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { style: { pointerEvents: "none" }, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Icon_default, { children: disclosure.isOpen ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChevronUpIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ChevronDownIcon_default, {}) }) })
|
|
3007
|
+
] })
|
|
3008
|
+
] })
|
|
3009
|
+
]
|
|
3010
|
+
}
|
|
3011
|
+
) }),
|
|
3012
|
+
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)(PopoverContent_default, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { children: virtual ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectVirtual_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(SelectContent_default, {}) }) })
|
|
3013
|
+
]
|
|
3014
|
+
})
|
|
3015
|
+
)
|
|
2090
3016
|
}
|
|
2091
3017
|
);
|
|
2092
3018
|
};
|
|
2093
|
-
var
|
|
2094
|
-
|
|
2095
|
-
// src/components/MultiSelect/MultiSelect.tsx
|
|
2096
|
-
var import_jsx_runtime32 = require("react/jsx-runtime");
|
|
2097
|
-
var MultiSelect3 = (props) => {
|
|
2098
|
-
return props.filterMode === "client" ? /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(MultiSelectClient_default, __spreadValues({}, props)) : /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(MultiSelectServer_default, __spreadValues({}, props));
|
|
2099
|
-
};
|
|
2100
|
-
var MultiSelect_default = MultiSelect3;
|
|
3019
|
+
var Select_default = Select;
|
|
2101
3020
|
|
|
2102
3021
|
// src/components/Field/Field.tsx
|
|
2103
|
-
var
|
|
2104
|
-
var
|
|
2105
|
-
var Field = (0,
|
|
3022
|
+
var import_react61 = require("react");
|
|
3023
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3024
|
+
var Field = (0, import_react61.forwardRef)(({ children, label }, ref) => {
|
|
2106
3025
|
{
|
|
2107
3026
|
const prefixCls = PREFIX_CLS;
|
|
2108
|
-
return /* @__PURE__ */ (0,
|
|
2109
|
-
/* @__PURE__ */ (0,
|
|
2110
|
-
/* @__PURE__ */ (0,
|
|
3027
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { ref, className: clsx_default(`${prefixCls}field`), children: [
|
|
3028
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: `${prefixCls}field__label`, children: label }),
|
|
3029
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { className: `${prefixCls}field__content`, children })
|
|
2111
3030
|
] });
|
|
2112
3031
|
}
|
|
2113
3032
|
});
|
|
2114
3033
|
var Field_default = Field;
|
|
2115
|
-
|
|
2116
|
-
// src/components/List/List.tsx
|
|
2117
|
-
var import_react46 = require("react");
|
|
2118
|
-
var import_jsx_runtime34 = require("react/jsx-runtime");
|
|
2119
|
-
var List = (0, import_react46.forwardRef)((_a, ref) => {
|
|
2120
|
-
var _b = _a, { as: Component = "div", children } = _b, rest = __objRest(_b, ["as", "children"]);
|
|
2121
|
-
return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Component, __spreadProps(__spreadValues({ ref, className: "us-list" }, rest), { children }));
|
|
2122
|
-
});
|
|
2123
|
-
var List_default = List;
|
|
2124
|
-
|
|
2125
|
-
// src/components/List/ListGroup.tsx
|
|
2126
|
-
var import_react48 = require("react");
|
|
2127
|
-
|
|
2128
|
-
// src/components/List/ListItem.tsx
|
|
2129
|
-
var import_react47 = require("react");
|
|
2130
|
-
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
2131
|
-
var ListItem = (0, import_react47.forwardRef)(
|
|
2132
|
-
(_a, ref) => {
|
|
2133
|
-
var _b = _a, {
|
|
2134
|
-
as: Component = "div",
|
|
2135
|
-
className,
|
|
2136
|
-
title,
|
|
2137
|
-
startContent,
|
|
2138
|
-
endContent,
|
|
2139
|
-
level = 1,
|
|
2140
|
-
hoverable,
|
|
2141
|
-
selected,
|
|
2142
|
-
disabled,
|
|
2143
|
-
style,
|
|
2144
|
-
onClick
|
|
2145
|
-
} = _b, rest = __objRest(_b, [
|
|
2146
|
-
"as",
|
|
2147
|
-
"className",
|
|
2148
|
-
"title",
|
|
2149
|
-
"startContent",
|
|
2150
|
-
"endContent",
|
|
2151
|
-
"level",
|
|
2152
|
-
"hoverable",
|
|
2153
|
-
"selected",
|
|
2154
|
-
"disabled",
|
|
2155
|
-
"style",
|
|
2156
|
-
"onClick"
|
|
2157
|
-
]);
|
|
2158
|
-
const prefixCls = PREFIX_CLS;
|
|
2159
|
-
const handleClick = (event) => {
|
|
2160
|
-
onClick == null ? void 0 : onClick(event);
|
|
2161
|
-
};
|
|
2162
|
-
return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(
|
|
2163
|
-
Component,
|
|
2164
|
-
__spreadProps(__spreadValues({
|
|
2165
|
-
ref,
|
|
2166
|
-
className: clsx_default(
|
|
2167
|
-
`${prefixCls}list-item`,
|
|
2168
|
-
{
|
|
2169
|
-
[`${prefixCls}list-item--selected`]: selected,
|
|
2170
|
-
[`${prefixCls}list-item--hoverable`]: hoverable,
|
|
2171
|
-
[`${prefixCls}list-item--disabled`]: disabled
|
|
2172
|
-
},
|
|
2173
|
-
className
|
|
2174
|
-
),
|
|
2175
|
-
style: __spreadValues({
|
|
2176
|
-
paddingLeft: level <= 1 ? `var(--${prefixCls}list-item-padding-x)` : `calc(${level} * var(--${prefixCls}list-item-padding-level))`
|
|
2177
|
-
}, style),
|
|
2178
|
-
onClick: handleClick
|
|
2179
|
-
}, rest), {
|
|
2180
|
-
children: [
|
|
2181
|
-
hoverable && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: `${prefixCls}overlay` }),
|
|
2182
|
-
startContent && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: `${prefixCls}list-item__start-content`, children: startContent }),
|
|
2183
|
-
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: `${prefixCls}list-item__content`, children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: `${prefixCls}list-item__title`, children: title }) }),
|
|
2184
|
-
endContent && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("div", { className: `${prefixCls}list-item__end-content`, children: endContent })
|
|
2185
|
-
]
|
|
2186
|
-
})
|
|
2187
|
-
);
|
|
2188
|
-
}
|
|
2189
|
-
);
|
|
2190
|
-
var ListItem_default = ListItem;
|
|
2191
|
-
|
|
2192
|
-
// src/components/List/ListGroup.tsx
|
|
2193
|
-
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
2194
|
-
var ListGroup = (0, import_react48.forwardRef)(
|
|
2195
|
-
(_a, ref) => {
|
|
2196
|
-
var _b = _a, {
|
|
2197
|
-
children,
|
|
2198
|
-
startContent,
|
|
2199
|
-
endContent,
|
|
2200
|
-
expandVisible = true,
|
|
2201
|
-
expandPosition = "end",
|
|
2202
|
-
isOpen,
|
|
2203
|
-
onOpen,
|
|
2204
|
-
onClose,
|
|
2205
|
-
onToggle
|
|
2206
|
-
} = _b, rest = __objRest(_b, [
|
|
2207
|
-
"children",
|
|
2208
|
-
"startContent",
|
|
2209
|
-
"endContent",
|
|
2210
|
-
"expandVisible",
|
|
2211
|
-
"expandPosition",
|
|
2212
|
-
"isOpen",
|
|
2213
|
-
"onOpen",
|
|
2214
|
-
"onClose",
|
|
2215
|
-
"onToggle"
|
|
2216
|
-
]);
|
|
2217
|
-
const disclosure = isOpen !== void 0 ? { isOpen, onOpen, onClose, onToggle } : useDisclosure_default();
|
|
2218
|
-
return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { className: "us-list-group", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Collapse_default, __spreadProps(__spreadValues({}, disclosure), { children: [
|
|
2219
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CollapseTrigger_default, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
|
|
2220
|
-
ListItem_default,
|
|
2221
|
-
__spreadValues({
|
|
2222
|
-
ref,
|
|
2223
|
-
startContent: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
2224
|
-
expandVisible && expandPosition === "start" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Icon_default, { children: disclosure.isOpen ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ChevronUpIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ChevronDownIcon_default, {}) }),
|
|
2225
|
-
startContent
|
|
2226
|
-
] }),
|
|
2227
|
-
endContent: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [
|
|
2228
|
-
endContent,
|
|
2229
|
-
expandVisible && expandPosition === "end" && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Icon_default, { children: disclosure.isOpen ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ChevronUpIcon_default, {}) : /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ChevronDownIcon_default, {}) })
|
|
2230
|
-
] })
|
|
2231
|
-
}, rest)
|
|
2232
|
-
) }),
|
|
2233
|
-
/* @__PURE__ */ (0, import_jsx_runtime36.jsx)(CollapseContent_default, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(List_default, { children }) }) })
|
|
2234
|
-
] })) });
|
|
2235
|
-
}
|
|
2236
|
-
);
|
|
2237
|
-
var ListGroup_default = ListGroup;
|
|
2238
3034
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2239
3035
|
0 && (module.exports = {
|
|
2240
3036
|
Accordion,
|
|
@@ -2242,6 +3038,7 @@ var ListGroup_default = ListGroup;
|
|
|
2242
3038
|
AccordionHeader,
|
|
2243
3039
|
AccordionItem,
|
|
2244
3040
|
AccordionPanel,
|
|
3041
|
+
Autocomplete,
|
|
2245
3042
|
Backdrop,
|
|
2246
3043
|
Badge,
|
|
2247
3044
|
Button,
|
|
@@ -2264,24 +3061,32 @@ var ListGroup_default = ListGroup;
|
|
|
2264
3061
|
MenuItem,
|
|
2265
3062
|
MenuSubmenu,
|
|
2266
3063
|
MenuValueContext,
|
|
2267
|
-
MultiSelect,
|
|
2268
3064
|
Portal,
|
|
3065
|
+
QueryStatus,
|
|
2269
3066
|
ScrollArea,
|
|
2270
3067
|
Select,
|
|
2271
3068
|
Switch,
|
|
2272
3069
|
Tab,
|
|
2273
3070
|
Tabs,
|
|
3071
|
+
TextInput,
|
|
2274
3072
|
Toolbar,
|
|
2275
3073
|
Transition,
|
|
3074
|
+
assignRef,
|
|
2276
3075
|
clsx,
|
|
2277
3076
|
getOpenValuesByPathname,
|
|
3077
|
+
mergeRefs,
|
|
2278
3078
|
scrollToItem,
|
|
2279
3079
|
useAccordionItem,
|
|
2280
3080
|
useCollapse,
|
|
3081
|
+
useDebounce,
|
|
2281
3082
|
useDisclosure,
|
|
3083
|
+
useElementSize,
|
|
3084
|
+
useInfiniteQuery,
|
|
2282
3085
|
useLocalStorage,
|
|
2283
3086
|
useMenu,
|
|
2284
3087
|
useMenuItemValue,
|
|
3088
|
+
useOnClickOutside,
|
|
2285
3089
|
usePrevious,
|
|
2286
|
-
useStep
|
|
3090
|
+
useStep,
|
|
3091
|
+
useVirtualizer
|
|
2287
3092
|
});
|