@npm-questionpro/wick-ui-lib 2.3.0 ā 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/appHeader/components/productSwitcher/ui/_productItem.d.ts +0 -1
- package/dist/components/appHeader/components/productSwitcher/ui/_productList.d.ts +0 -1
- package/dist/style.css +1 -1
- package/dist/translate/WuTranslateContext.d.ts +7 -10
- package/dist/translate/wtCache.d.ts +15 -0
- package/dist/wick-ui-lib/es/index.js +894 -770
- package/package.json +3 -3
|
@@ -319,7 +319,7 @@ var Je = {
|
|
|
319
319
|
})]
|
|
320
320
|
}) })
|
|
321
321
|
}) });
|
|
322
|
-
}, Xe = { wuButton: "
|
|
322
|
+
}, Xe = { wuButton: "_wuButton_d6dvg_1" }, Ze = n.forwardRef((e, t) => Qe(e, t)), Qe = (e, t) => {
|
|
323
323
|
let { size: n = "md", color: r = "#1B87E6", variant: i = "dots", ...a } = e, o = K("wu-w-[4em] wu-h-[1em] wu-inline-block wu-text-xs wu-relative wu-loader-dot-container"), s = "7px";
|
|
324
324
|
n === "sm" ? s = "7px" : n === "md" ? s = "12px" : n === "lg" ? s = "18px" : typeof n == "string" && (s = n);
|
|
325
325
|
let c = {
|
|
@@ -844,15 +844,15 @@ var gt = ({ buttonRef: e, handleDropdownToggle: t, handleKeyDown: n, isDropdownO
|
|
|
844
844
|
e382: "wp-suite-cx",
|
|
845
845
|
e308: "wp-surveys",
|
|
846
846
|
e315: "wp-workforce"
|
|
847
|
-
}, yt = ({ product: e,
|
|
848
|
-
let
|
|
847
|
+
}, yt = ({ product: e, activeProductName: t, dir: n, focusItem: r, setFocusItem: i }) => {
|
|
848
|
+
let a = e.name === t, [o, s] = m(a), c = !e.active, l = K("wu-font-normal wu-text-xs wu-text-gray-lead wu-text-center", a && "wu-text-blue-q wu-font-normal", !e.active && "wu-text-gray-subtle", o && "wu-font-normal", e.active && o && "wu-text-blue-q"), u = K("wu-text-blue-p wu-text-base", a && "wu-text-blue-q", !e.active && "wu-text-gray-subtle", e.active && o && "wu-text-blue-q"), d = o || r === e.name || a ? "#1b3380" : "#c5cce0";
|
|
849
849
|
return /* @__PURE__ */ b("li", {
|
|
850
|
-
className: K(Y.productListItem, "focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item", (
|
|
850
|
+
className: K(Y.productListItem, "focus-visible:wu-outline-none focus:wu-outline-none wu-sub-product-list-item", (a || o) && Y.activeProduct, e.name.length > 15 && window.innerWidth > 768 && "wu-w-[130px] wu-min-w-[130px]", r === e.name && Y.activeProduct, "wu-product-item"),
|
|
851
851
|
onMouseOver: () => s(!0),
|
|
852
852
|
onMouseOut: () => s(!1),
|
|
853
853
|
"aria-label": e.name,
|
|
854
|
-
"aria-disabled":
|
|
855
|
-
dir:
|
|
854
|
+
"aria-disabled": c,
|
|
855
|
+
dir: n,
|
|
856
856
|
onKeyDown: (e) => {
|
|
857
857
|
if (e.key === "Enter") {
|
|
858
858
|
e.preventDefault();
|
|
@@ -861,44 +861,43 @@ var gt = ({ buttonRef: e, handleDropdownToggle: t, handleKeyDown: n, isDropdownO
|
|
|
861
861
|
}
|
|
862
862
|
},
|
|
863
863
|
onFocus: () => {
|
|
864
|
-
|
|
864
|
+
i(e.name);
|
|
865
865
|
},
|
|
866
|
-
onBlur: () =>
|
|
866
|
+
onBlur: () => i(""),
|
|
867
867
|
children: [/* @__PURE__ */ y("div", {
|
|
868
|
-
className: K(Y.topBorder,
|
|
869
|
-
style: { backgroundColor:
|
|
868
|
+
className: K(Y.topBorder, n === "rtl" && Y.topBorderRtl),
|
|
869
|
+
style: { backgroundColor: c ? "#ffcf70" : d }
|
|
870
870
|
}), /* @__PURE__ */ b("a", {
|
|
871
871
|
className: K(Y.productLink, "focus:wu-outline-none focus-visible:wu-outline-none"),
|
|
872
872
|
href: e.link || "#",
|
|
873
873
|
tabIndex: 0,
|
|
874
874
|
children: [/* @__PURE__ */ y("span", {
|
|
875
|
-
className: K(
|
|
875
|
+
className: K(u, vt[e.icon || ""]),
|
|
876
876
|
"aria-hidden": !0
|
|
877
877
|
}), /* @__PURE__ */ y("span", {
|
|
878
|
-
className: K(
|
|
878
|
+
className: K(l),
|
|
879
879
|
children: e.name
|
|
880
880
|
})]
|
|
881
881
|
})]
|
|
882
882
|
}, e.name);
|
|
883
|
-
}, bt = ({ category: e,
|
|
884
|
-
let { products:
|
|
883
|
+
}, bt = ({ category: e, activeProductName: t, dir: n = "ltr", focusItem: r, setFocusItem: i, borderColorLocked: a = "#f5a300" }) => {
|
|
884
|
+
let { products: o = [], active: s } = e, c = f(() => o.filter((e) => e.active).sort((e, t) => (e.order || 100) - (t.order || 100)), [o]), l = f(() => o.filter((e) => !e.active), [o]), [u, d] = m(a), p = (e) => e.map((e, a) => /* @__PURE__ */ y(yt, {
|
|
885
885
|
product: e,
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
u.length > 0 && /* @__PURE__ */ b("li", {
|
|
886
|
+
activeProductName: t,
|
|
887
|
+
dir: n,
|
|
888
|
+
focusItem: r,
|
|
889
|
+
setFocusItem: i
|
|
890
|
+
}, a));
|
|
891
|
+
return s ? /* @__PURE__ */ b(v, { children: [
|
|
892
|
+
p(c),
|
|
893
|
+
l.length > 0 && /* @__PURE__ */ b("li", {
|
|
895
894
|
className: K(Y.productListItem, "focus:wu-outline-none focus-visible:wu-outline-none !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee] wu-group"),
|
|
896
|
-
onMouseOver: () =>
|
|
897
|
-
onMouseOut: () =>
|
|
895
|
+
onMouseOver: () => d("#f5a300"),
|
|
896
|
+
onMouseOut: () => d(a),
|
|
898
897
|
"aria-label": "Upgrade to unlock",
|
|
899
898
|
children: [/* @__PURE__ */ y("div", {
|
|
900
|
-
className: K(Y.topBorder,
|
|
901
|
-
style: { backgroundColor:
|
|
899
|
+
className: K(Y.topBorder, n === "rtl" && Y.topBorderRtl),
|
|
900
|
+
style: { backgroundColor: u },
|
|
902
901
|
"aria-label": "top-border"
|
|
903
902
|
}), /* @__PURE__ */ b("a", {
|
|
904
903
|
href: "https://www.questionpro.com/a/showUpgradeUser.do",
|
|
@@ -913,16 +912,16 @@ var gt = ({ buttonRef: e, handleDropdownToggle: t, handleKeyDown: n, isDropdownO
|
|
|
913
912
|
})]
|
|
914
913
|
})]
|
|
915
914
|
}),
|
|
916
|
-
|
|
915
|
+
p(l)
|
|
917
916
|
] }) : /* @__PURE__ */ b("li", {
|
|
918
|
-
className: K(Y.productListItem, Y.learnMore, "focus:wu-outline-none focus-visible:wu-outline-none wu-product-item-inactive !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee]",
|
|
917
|
+
className: K(Y.productListItem, Y.learnMore, "focus:wu-outline-none focus-visible:wu-outline-none wu-product-item-inactive !wu-bg-[#f5f5f5] hover:!wu-bg-[#eeeeee]", r === "learn" && "activeProduct"),
|
|
919
918
|
tabIndex: 0,
|
|
920
|
-
onFocus: () =>
|
|
921
|
-
onBlur: () =>
|
|
919
|
+
onFocus: () => i("learn"),
|
|
920
|
+
onBlur: () => i(""),
|
|
922
921
|
"aria-label": "Learn More",
|
|
923
922
|
children: [/* @__PURE__ */ y("div", {
|
|
924
|
-
className: K(Y.topBorder,
|
|
925
|
-
style: { backgroundColor:
|
|
923
|
+
className: K(Y.topBorder, n === "rtl" && Y.topBorderRtl),
|
|
924
|
+
style: { backgroundColor: a }
|
|
926
925
|
}), /* @__PURE__ */ y("a", {
|
|
927
926
|
className: Y.productLink,
|
|
928
927
|
href: "https://www.questionpro.com/a/showUpgradeUser.do",
|
|
@@ -969,7 +968,6 @@ var gt = ({ buttonRef: e, handleDropdownToggle: t, handleKeyDown: n, isDropdownO
|
|
|
969
968
|
category: e,
|
|
970
969
|
dir: t,
|
|
971
970
|
activeProductName: c,
|
|
972
|
-
currentProduct: e.name,
|
|
973
971
|
focusItem: l,
|
|
974
972
|
setFocusItem: d,
|
|
975
973
|
borderColorLocked: "#ffcf70"
|
|
@@ -1222,34 +1220,35 @@ var Mt = ({ label: e, className: t }) => {
|
|
|
1222
1220
|
})
|
|
1223
1221
|
});
|
|
1224
1222
|
}, Pt = {
|
|
1225
|
-
wuDropdownTrigger: "
|
|
1226
|
-
|
|
1227
|
-
|
|
1223
|
+
wuDropdownTrigger: "_wuDropdownTrigger_188h8_1",
|
|
1224
|
+
wuDropdownPositioner: "_wuDropdownPositioner_188h8_13",
|
|
1225
|
+
wuDropdownPopup: "_wuDropdownPopup_188h8_17",
|
|
1226
|
+
wuDropdownItem: "_wuDropdownItem_188h8_27"
|
|
1228
1227
|
};
|
|
1229
1228
|
//#endregion
|
|
1230
1229
|
//#region src/components/calendar/internal/Dropdown.tsx
|
|
1231
1230
|
function Ft({ options: e, value: t, onChange: n }) {
|
|
1232
1231
|
return /* @__PURE__ */ b(O.Root, {
|
|
1233
1232
|
items: e,
|
|
1234
|
-
value: t,
|
|
1233
|
+
value: t === void 0 ? void 0 : Number(t),
|
|
1235
1234
|
onValueChange: (e) => {
|
|
1236
1235
|
n && n({
|
|
1237
|
-
target: { value: String(e) },
|
|
1238
|
-
currentTarget: { value: String(e) }
|
|
1236
|
+
target: { value: e == null ? "" : String(e) },
|
|
1237
|
+
currentTarget: { value: e == null ? "" : String(e) }
|
|
1239
1238
|
});
|
|
1240
1239
|
},
|
|
1241
1240
|
children: [/* @__PURE__ */ y(O.Trigger, {
|
|
1242
1241
|
className: Pt.wuDropdownTrigger,
|
|
1243
1242
|
children: /* @__PURE__ */ y(O.Value, {})
|
|
1244
1243
|
}), /* @__PURE__ */ y(O.Portal, { children: /* @__PURE__ */ y(O.Positioner, {
|
|
1245
|
-
className: "wu-isolate",
|
|
1246
1244
|
alignItemWithTrigger: !1,
|
|
1247
1245
|
side: "bottom",
|
|
1248
1246
|
align: "start",
|
|
1249
1247
|
sideOffset: 4,
|
|
1248
|
+
className: Pt.wuDropdownPositioner,
|
|
1250
1249
|
children: /* @__PURE__ */ y(O.Popup, {
|
|
1251
1250
|
className: Pt.wuDropdownPopup,
|
|
1252
|
-
"data-
|
|
1251
|
+
"data-animation": "dropdown",
|
|
1253
1252
|
children: /* @__PURE__ */ y(O.List, { children: e?.map(({ label: e, value: t }) => /* @__PURE__ */ y(O.Item, {
|
|
1254
1253
|
value: t,
|
|
1255
1254
|
className: Pt.wuDropdownItem,
|
|
@@ -1260,18 +1259,18 @@ function Ft({ options: e, value: t, onChange: n }) {
|
|
|
1260
1259
|
});
|
|
1261
1260
|
}
|
|
1262
1261
|
var X = {
|
|
1263
|
-
wuCalendar: "
|
|
1264
|
-
wuCalendarMonths: "
|
|
1265
|
-
wuCalendarMonth: "
|
|
1266
|
-
wuCalendarMonthCaption: "
|
|
1267
|
-
wuCalendarCaptionLabel: "
|
|
1268
|
-
wuCalendarButtonNext: "
|
|
1269
|
-
wuCalendarButtonPrevious: "
|
|
1270
|
-
wuCalendarWeekday: "
|
|
1271
|
-
wuCalendarDay: "
|
|
1272
|
-
wuCalendarOutside: "
|
|
1273
|
-
wuCalendarRangeMiddle: "
|
|
1274
|
-
wuCalendarRangePreview: "
|
|
1262
|
+
wuCalendar: "_wuCalendar_7jm2b_1",
|
|
1263
|
+
wuCalendarMonths: "_wuCalendarMonths_7jm2b_9",
|
|
1264
|
+
wuCalendarMonth: "_wuCalendarMonth_7jm2b_9",
|
|
1265
|
+
wuCalendarMonthCaption: "_wuCalendarMonthCaption_7jm2b_18",
|
|
1266
|
+
wuCalendarCaptionLabel: "_wuCalendarCaptionLabel_7jm2b_27",
|
|
1267
|
+
wuCalendarButtonNext: "_wuCalendarButtonNext_7jm2b_31",
|
|
1268
|
+
wuCalendarButtonPrevious: "_wuCalendarButtonPrevious_7jm2b_31",
|
|
1269
|
+
wuCalendarWeekday: "_wuCalendarWeekday_7jm2b_49",
|
|
1270
|
+
wuCalendarDay: "_wuCalendarDay_7jm2b_56",
|
|
1271
|
+
wuCalendarOutside: "_wuCalendarOutside_7jm2b_79",
|
|
1272
|
+
wuCalendarRangeMiddle: "_wuCalendarRangeMiddle_7jm2b_83",
|
|
1273
|
+
wuCalendarRangePreview: "_wuCalendarRangePreview_7jm2b_89"
|
|
1275
1274
|
};
|
|
1276
1275
|
//#endregion
|
|
1277
1276
|
//#region src/components/calendar/internal/RangeWrapper.tsx
|
|
@@ -1425,11 +1424,11 @@ var Z = (e) => /* @__PURE__ */ y(Kt, {
|
|
|
1425
1424
|
})]
|
|
1426
1425
|
});
|
|
1427
1426
|
}, Jt = {
|
|
1428
|
-
pickerTriggerText: "
|
|
1429
|
-
pickerTriggerLabel: "
|
|
1430
|
-
pickerPositioner: "
|
|
1431
|
-
pickerPopup: "
|
|
1432
|
-
pickerFooter: "
|
|
1427
|
+
pickerTriggerText: "_pickerTriggerText_om9px_1",
|
|
1428
|
+
pickerTriggerLabel: "_pickerTriggerLabel_om9px_9",
|
|
1429
|
+
pickerPositioner: "_pickerPositioner_om9px_15",
|
|
1430
|
+
pickerPopup: "_pickerPopup_om9px_19",
|
|
1431
|
+
pickerFooter: "_pickerFooter_om9px_44"
|
|
1433
1432
|
};
|
|
1434
1433
|
//#endregion
|
|
1435
1434
|
//#region src/components/pickers/_shared/PickerShell.tsx
|
|
@@ -2284,62 +2283,84 @@ var Wn = n.memo(n.forwardRef(({ className: e, Label: t, labelPosition: r = "top"
|
|
|
2284
2283
|
Wn.displayName = "WuInput";
|
|
2285
2284
|
//#endregion
|
|
2286
2285
|
//#region src/components/combobox/ui/_tags.tsx
|
|
2287
|
-
var Gn = ({ tags: e, triggerRef: t }) => {
|
|
2288
|
-
let [n, r] = m([]), [i, a] = m([]), o =
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
}), [i]), s = (e) => {
|
|
2295
|
-
let t = document.createElement("div");
|
|
2296
|
-
Object.assign(t.style, {
|
|
2297
|
-
display: "inline-block",
|
|
2298
|
-
visibility: "hidden",
|
|
2286
|
+
var Gn = 8, Kn = 20, qn = 36, Jn = 40, Yn = ({ tags: e, triggerRef: t }) => {
|
|
2287
|
+
let [n, r] = m([]), [i, a] = m([]), o = "wu-inline-block wu-flex-none wu-px-1 wu-py-0.5 wu-text-xs wu-rounded-sm wu-bg-gray-10 wu-truncate wu-combobox-tag";
|
|
2288
|
+
u(() => {
|
|
2289
|
+
let n = t.current;
|
|
2290
|
+
if (!n) return;
|
|
2291
|
+
let i = document.createElement("span");
|
|
2292
|
+
i.className = o.replace("wu-truncate", ""), Object.assign(i.style, {
|
|
2299
2293
|
position: "absolute",
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
let
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2294
|
+
top: "0",
|
|
2295
|
+
left: "0",
|
|
2296
|
+
visibility: "hidden",
|
|
2297
|
+
whiteSpace: "nowrap",
|
|
2298
|
+
pointerEvents: "none"
|
|
2299
|
+
}), document.body.appendChild(i);
|
|
2300
|
+
let s = e.map((e) => (i.textContent = e, i.offsetWidth));
|
|
2301
|
+
document.body.removeChild(i);
|
|
2302
|
+
let c = () => {
|
|
2303
|
+
let t = n.offsetWidth - Kn - qn;
|
|
2304
|
+
if (t <= 0) {
|
|
2305
|
+
r([]), a(e);
|
|
2306
|
+
return;
|
|
2313
2307
|
}
|
|
2308
|
+
let i = /* @__PURE__ */ new Map(), o = [], c = 0;
|
|
2309
|
+
for (let n = 0; n < e.length; n++) {
|
|
2310
|
+
let e = i.size ? Gn : 0;
|
|
2311
|
+
c + e + s[n] <= t ? (i.set(n, void 0), c += e + s[n]) : o.push(n);
|
|
2312
|
+
}
|
|
2313
|
+
if (o.length > 0) {
|
|
2314
|
+
let e = o.length > 1 ? 52 : 0, n = i.size ? Gn : 0, r = t - c - n - e;
|
|
2315
|
+
for (r >= Jn && (i.set(o.shift(), r), c += n + r); o.length > 0 && i.size > 0 && c + 52 > t;) {
|
|
2316
|
+
let e = Math.max(...i.keys()), n = i.get(e) ?? s[e], r = c + 52 - t;
|
|
2317
|
+
n - r >= Jn ? (i.set(e, n - r), c -= r) : (i.delete(e), o.push(e), c -= n + (i.size ? Gn : 0));
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2320
|
+
let l = [], u = [];
|
|
2321
|
+
for (let t = 0; t < e.length; t++) i.has(t) ? l.push({
|
|
2322
|
+
tag: e[t],
|
|
2323
|
+
maxWidth: i.get(t)
|
|
2324
|
+
}) : u.push(e[t]);
|
|
2325
|
+
r(l), a(u);
|
|
2314
2326
|
};
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
}, [e, t])
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2327
|
+
c();
|
|
2328
|
+
let l = new ResizeObserver(c);
|
|
2329
|
+
return l.observe(n), () => l.disconnect();
|
|
2330
|
+
}, [e, t]);
|
|
2331
|
+
let s = f(() => /* @__PURE__ */ y("ul", {
|
|
2332
|
+
className: "wu-flex wu-flex-col wu-items-start wu-justify-center wu-list-none",
|
|
2333
|
+
children: i.map((e, t) => /* @__PURE__ */ y("li", {
|
|
2334
|
+
className: "wu-py-1 wu-text-xs wu-text-left",
|
|
2322
2335
|
children: e
|
|
2323
|
-
}, e))
|
|
2324
|
-
|
|
2336
|
+
}, `${t}-${e}`))
|
|
2337
|
+
}), [i]);
|
|
2338
|
+
return /* @__PURE__ */ b("div", {
|
|
2339
|
+
className: "wu-flex wu-min-w-0 wu-flex-1 wu-items-center wu-gap-2 wu-overflow-hidden wu-text-xs",
|
|
2340
|
+
children: [n.map((e, t) => /* @__PURE__ */ y("span", {
|
|
2341
|
+
style: e.maxWidth ? { maxWidth: e.maxWidth } : void 0,
|
|
2342
|
+
className: o,
|
|
2343
|
+
children: e.tag
|
|
2344
|
+
}, `${t}-${e.tag}`)), i.length > 0 && /* @__PURE__ */ y(jt, {
|
|
2345
|
+
content: s,
|
|
2325
2346
|
className: "wu-z-[51] wu-text-left",
|
|
2326
2347
|
children: /* @__PURE__ */ b("span", {
|
|
2327
|
-
className:
|
|
2348
|
+
className: o,
|
|
2328
2349
|
children: ["+", i.length]
|
|
2329
2350
|
})
|
|
2330
2351
|
})]
|
|
2331
2352
|
});
|
|
2332
|
-
},
|
|
2353
|
+
}, Xn = ae.Root, Zn = ae.Trigger, Qn = t.forwardRef(({ className: e, align: t = "center", sideOffset: n = 4, ...r }, i) => /* @__PURE__ */ y(ae.Portal, { children: /* @__PURE__ */ y(ae.Content, {
|
|
2333
2354
|
ref: i,
|
|
2334
2355
|
align: t,
|
|
2335
2356
|
sideOffset: n,
|
|
2336
2357
|
className: K("wu-z-50 wu-w-72 wu-border wu-bg-popover wu-p-4 wu-text-popover-foreground wu-shadow-md wu-outline-none data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[side=bottom]:wu-slide-in-from-top-2 data-[side=left]:wu-slide-in-from-right-2 data-[side=right]:wu-slide-in-from-left-2 data-[side=top]:wu-slide-in-from-bottom-2", e),
|
|
2337
2358
|
...r
|
|
2338
2359
|
}) }));
|
|
2339
|
-
|
|
2360
|
+
Qn.displayName = ae.Content.displayName;
|
|
2340
2361
|
//#endregion
|
|
2341
2362
|
//#region src/components/combobox/ui/_trigger.tsx
|
|
2342
|
-
var
|
|
2363
|
+
var $n = ({ placeholder: e = "Select...", isEllipse: t = !1, selectedOptions: n, variant: r = "flat", dir: i = "ltr", accessorKey: a, multiple: o, id: s, disabled: c, selectAll: l, isCheckedAll: d, className: f, ...h }) => {
|
|
2343
2364
|
let [g, _] = m([]), v = p(null);
|
|
2344
2365
|
u(() => {
|
|
2345
2366
|
if (!n || Array.isArray(n) && n.length === 0) {
|
|
@@ -2358,14 +2379,14 @@ var Yn = ({ placeholder: e = "Select...", isEllipse: t = !1, selectedOptions: n,
|
|
|
2358
2379
|
className: "wu-overflow-hidden wu-text-xs wu-text-start wu-text-ellipsis wu-whitespace-nowrap",
|
|
2359
2380
|
style: { width: `${(v.current?.offsetWidth || 0) - 32}px` },
|
|
2360
2381
|
children: g.join(", ")
|
|
2361
|
-
}) : /* @__PURE__ */ y(
|
|
2382
|
+
}) : /* @__PURE__ */ y(Yn, {
|
|
2362
2383
|
tags: g,
|
|
2363
2384
|
triggerRef: v
|
|
2364
2385
|
}) : /* @__PURE__ */ y("p", {
|
|
2365
2386
|
className: "wu-text-xs wu-opacity-70",
|
|
2366
2387
|
children: e
|
|
2367
2388
|
});
|
|
2368
|
-
return /* @__PURE__ */ y(
|
|
2389
|
+
return /* @__PURE__ */ y(Zn, {
|
|
2369
2390
|
dir: i,
|
|
2370
2391
|
asChild: !0,
|
|
2371
2392
|
id: s,
|
|
@@ -2378,13 +2399,13 @@ var Yn = ({ placeholder: e = "Select...", isEllipse: t = !1, selectedOptions: n,
|
|
|
2378
2399
|
children: [x(), /* @__PURE__ */ y("span", { className: "wm-arrow-drop-down group-data-[state=open]/wuCombobox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base" })]
|
|
2379
2400
|
})
|
|
2380
2401
|
});
|
|
2381
|
-
},
|
|
2402
|
+
}, er = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y(U, {
|
|
2382
2403
|
ref: n,
|
|
2383
2404
|
className: K("wu-flex wu-h-full wu-w-full wu-flex-col wu-overflow-hidden wu-rounded-md", e),
|
|
2384
2405
|
...t
|
|
2385
2406
|
}));
|
|
2386
|
-
|
|
2387
|
-
var
|
|
2407
|
+
er.displayName = U.displayName;
|
|
2408
|
+
var tr = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("div", {
|
|
2388
2409
|
className: "wu-flex wu-items-center wu-border-b wu-px-3",
|
|
2389
2410
|
children: /* @__PURE__ */ y(U.Input, {
|
|
2390
2411
|
ref: n,
|
|
@@ -2392,45 +2413,45 @@ var Zn = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("div", {
|
|
|
2392
2413
|
...t
|
|
2393
2414
|
})
|
|
2394
2415
|
}));
|
|
2395
|
-
|
|
2396
|
-
var
|
|
2416
|
+
tr.displayName = U.Input.displayName;
|
|
2417
|
+
var nr = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y(U.List, {
|
|
2397
2418
|
ref: n,
|
|
2398
2419
|
className: K("", e),
|
|
2399
2420
|
...t
|
|
2400
2421
|
}));
|
|
2401
|
-
|
|
2402
|
-
var
|
|
2422
|
+
nr.displayName = U.List.displayName;
|
|
2423
|
+
var rr = t.forwardRef((e, t) => /* @__PURE__ */ y(U.Empty, {
|
|
2403
2424
|
ref: t,
|
|
2404
2425
|
className: "wu-text-center wu-p-2 wu-pb-2.5 wu-text-xs",
|
|
2405
2426
|
...e
|
|
2406
2427
|
}));
|
|
2407
|
-
|
|
2408
|
-
var
|
|
2428
|
+
rr.displayName = U.Empty.displayName;
|
|
2429
|
+
var ir = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y(U.Group, {
|
|
2409
2430
|
ref: n,
|
|
2410
2431
|
className: K("", e),
|
|
2411
2432
|
...t
|
|
2412
2433
|
}));
|
|
2413
|
-
|
|
2414
|
-
var
|
|
2434
|
+
ir.displayName = U.Group.displayName;
|
|
2435
|
+
var ar = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y(U.Separator, {
|
|
2415
2436
|
ref: n,
|
|
2416
2437
|
className: K("wu-mx-2 wu-my-1 wu-h-px wu-bg-gray-40", e),
|
|
2417
2438
|
...t
|
|
2418
2439
|
}));
|
|
2419
|
-
|
|
2420
|
-
var
|
|
2440
|
+
ar.displayName = U.Separator.displayName;
|
|
2441
|
+
var or = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y(U.Item, {
|
|
2421
2442
|
ref: n,
|
|
2422
2443
|
className: K("wu-relative wu-flex wu-cursor-default wu-gap-2 wu-select-none wu-items-center wu-rounded-sm wu-px-2 wu-py-3 wu-text-sm wu-outline-none data-[disabled=true]:wu-pointer-events-none data-[disabled=true]:wu-opacity-50 [&_svg]:wu-pointer-events-none [&_svg]:wu-size-4 [&_svg]:wu-shrink-0", e),
|
|
2423
2444
|
...t
|
|
2424
2445
|
}));
|
|
2425
|
-
|
|
2426
|
-
var
|
|
2446
|
+
or.displayName = U.Item.displayName;
|
|
2447
|
+
var sr = ({ className: e, ...t }) => /* @__PURE__ */ y("span", {
|
|
2427
2448
|
className: K("wu-ml-auto wu-text-xs wu-tracking-widest", e),
|
|
2428
2449
|
...t
|
|
2429
2450
|
});
|
|
2430
|
-
|
|
2451
|
+
sr.displayName = "CommandShortcut";
|
|
2431
2452
|
//#endregion
|
|
2432
2453
|
//#region src/components/combobox/ui/_item.tsx
|
|
2433
|
-
var
|
|
2454
|
+
var cr = ({ option: e, value: t, multiple: n = !1, onSelect: r, accessorKey: i, dir: a }) => {
|
|
2434
2455
|
let [o, s] = m(n ? [] : "");
|
|
2435
2456
|
u(() => {
|
|
2436
2457
|
t && s(n ? t.map((e) => JSON.stringify(e[i.value])) : JSON.stringify(t[i.value]));
|
|
@@ -2440,19 +2461,19 @@ var ir = ({ option: e, value: t, multiple: n = !1, onSelect: r, accessorKey: i,
|
|
|
2440
2461
|
n
|
|
2441
2462
|
]);
|
|
2442
2463
|
let c = n ? o.includes(JSON.stringify(e[i.value])) : o === JSON.stringify(e[i.value]);
|
|
2443
|
-
return /* @__PURE__ */ b(
|
|
2464
|
+
return /* @__PURE__ */ b(or, {
|
|
2444
2465
|
onSelect: () => {
|
|
2445
2466
|
e.disabled || r(e);
|
|
2446
2467
|
},
|
|
2447
2468
|
disabled: e.disabled,
|
|
2448
2469
|
className: K("wu-cursor-pointer wu-text-xs wu-items-start wu-leading-4 wu-py-2 wu-combobox-item hover:wu-bg-gray-100", c && "wu-bg-gray-10"),
|
|
2449
2470
|
dir: a,
|
|
2450
|
-
children: [n && /* @__PURE__ */ y(Q, { checked: c }), /* @__PURE__ */ y(
|
|
2471
|
+
children: [n && /* @__PURE__ */ y(Q, { checked: c }), /* @__PURE__ */ y(lr, {
|
|
2451
2472
|
option: e,
|
|
2452
2473
|
accessorKey: i
|
|
2453
2474
|
})]
|
|
2454
2475
|
});
|
|
2455
|
-
},
|
|
2476
|
+
}, lr = ({ option: e, accessorKey: t }) => {
|
|
2456
2477
|
let n = e[t.label];
|
|
2457
2478
|
return /* @__PURE__ */ b("div", {
|
|
2458
2479
|
className: "wu-flex wu-items-center wu-w-full wu-gap-1",
|
|
@@ -2462,10 +2483,10 @@ var ir = ({ option: e, value: t, multiple: n = !1, onSelect: r, accessorKey: i,
|
|
|
2462
2483
|
e.isAdmin && /* @__PURE__ */ y("span", { className: "wu-ml-auto wu-text-sm wm-lock wu-text-orange-deep" })
|
|
2463
2484
|
]
|
|
2464
2485
|
});
|
|
2465
|
-
},
|
|
2486
|
+
}, ur = (e) => {
|
|
2466
2487
|
let { option: t, selectAll: n, handleSelectAll: r, isCheckedAll: a, isPartialSelected: o, ...s } = e;
|
|
2467
2488
|
switch ("type" in t ? t.type : "option") {
|
|
2468
|
-
case "all": return /* @__PURE__ */ b(
|
|
2489
|
+
case "all": return /* @__PURE__ */ b(or, {
|
|
2469
2490
|
onSelect: r,
|
|
2470
2491
|
className: K("wu-cursor-pointer wu-text-xs wu-leading-4 wu-py-2 wu-combobox-item"),
|
|
2471
2492
|
dir: s.dir,
|
|
@@ -2479,21 +2500,21 @@ var ir = ({ option: e, value: t, multiple: n = !1, onSelect: r, accessorKey: i,
|
|
|
2479
2500
|
children: n?.label || "Select All"
|
|
2480
2501
|
})]
|
|
2481
2502
|
});
|
|
2482
|
-
case "group": return /* @__PURE__ */ b(
|
|
2503
|
+
case "group": return /* @__PURE__ */ b(ir, { children: [/* @__PURE__ */ y(fn, { children: t.label }), t.options.map((e, t) => {
|
|
2483
2504
|
let n = e[s.accessorKey.value], r = n == null ? `group-item-${t}` : String(n);
|
|
2484
|
-
return /* @__PURE__ */ i(
|
|
2505
|
+
return /* @__PURE__ */ i(cr, {
|
|
2485
2506
|
...s,
|
|
2486
2507
|
option: e,
|
|
2487
2508
|
key: r
|
|
2488
2509
|
});
|
|
2489
2510
|
})] });
|
|
2490
|
-
case "divider": return /* @__PURE__ */ y(
|
|
2491
|
-
default: return /* @__PURE__ */ y(
|
|
2511
|
+
case "divider": return /* @__PURE__ */ y(ar, { className: "wu-mx-4" });
|
|
2512
|
+
default: return /* @__PURE__ */ y(cr, {
|
|
2492
2513
|
...s,
|
|
2493
2514
|
option: t
|
|
2494
2515
|
});
|
|
2495
2516
|
}
|
|
2496
|
-
},
|
|
2517
|
+
}, dr = (e) => {
|
|
2497
2518
|
let t = [], n = [], r = [], i = [];
|
|
2498
2519
|
return e.forEach((e) => {
|
|
2499
2520
|
e.type === "group" ? (t.push(e), r.push(...e.options), i.push(...e.options.filter((e) => !e.disabled))) : e.type === "divider" ? n.push(e) : r.push(e), e?.disabled || i.push(e);
|
|
@@ -2503,8 +2524,8 @@ var ir = ({ option: e, value: t, multiple: n = !1, onSelect: r, accessorKey: i,
|
|
|
2503
2524
|
allOptions: r,
|
|
2504
2525
|
enabledOptions: i
|
|
2505
2526
|
};
|
|
2506
|
-
},
|
|
2507
|
-
let [N, ee] = m(""), [P, F] = m(), [I, L] = m(!1), [R, te] = m(!1), [z, B] = m(!1), ne = p(null), { allOptions: re, enabledOptions: V } = f(() => x || S && !S.includeDisabled ?
|
|
2527
|
+
}, fr = o(Wn), pr = ({ data: e, accessorKey: t, value: n, defaultValue: r, Header: i, virtualizedThreshold: a = 100, isEllipse: o, placeholder: c, variant: l, dir: d, onSelect: h, Label: g, maxHeight: _ = 420, multiple: v = !1, hasGroup: x = !1, selectAll: S, id: C, disabled: w, labelPosition: T = "top", className: E, onScroll: D, maxContentWidth: O, enableSearch: k = !0, noDataContent: A, selectedToTop: j = !1, ...M }) => {
|
|
2528
|
+
let [N, ee] = m(""), [P, F] = m(), [I, L] = m(!1), [R, te] = m(!1), [z, B] = m(!1), ne = p(null), { allOptions: re, enabledOptions: V } = f(() => x || S && !S.includeDisabled ? dr(e) : {
|
|
2508
2529
|
allOptions: e,
|
|
2509
2530
|
groups: [],
|
|
2510
2531
|
dividers: [],
|
|
@@ -2557,13 +2578,13 @@ var ir = ({ option: e, value: t, multiple: n = !1, onSelect: r, accessorKey: i,
|
|
|
2557
2578
|
return /* @__PURE__ */ b("div", {
|
|
2558
2579
|
className: K(Pe(T), "wu-flex wu-combobox-container"),
|
|
2559
2580
|
ref: ne,
|
|
2560
|
-
children: [/* @__PURE__ */ b(
|
|
2581
|
+
children: [/* @__PURE__ */ b(Xn, {
|
|
2561
2582
|
onOpenChange: (e) => {
|
|
2562
2583
|
e && U(), L(e);
|
|
2563
2584
|
},
|
|
2564
2585
|
open: I,
|
|
2565
2586
|
modal: !0,
|
|
2566
|
-
children: [/* @__PURE__ */ y(
|
|
2587
|
+
children: [/* @__PURE__ */ y($n, {
|
|
2567
2588
|
selectedOptions: P,
|
|
2568
2589
|
accessorKey: t,
|
|
2569
2590
|
isEllipse: o,
|
|
@@ -2577,17 +2598,17 @@ var ir = ({ option: e, value: t, multiple: n = !1, onSelect: r, accessorKey: i,
|
|
|
2577
2598
|
className: E,
|
|
2578
2599
|
id: C,
|
|
2579
2600
|
...M
|
|
2580
|
-
}), /* @__PURE__ */ y(
|
|
2601
|
+
}), /* @__PURE__ */ y(Qn, {
|
|
2581
2602
|
className: "wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-p-0 wu-bg-white wu-border wu-border-blue-p wu-combobox-content",
|
|
2582
2603
|
align: "start",
|
|
2583
2604
|
sideOffset: -1,
|
|
2584
2605
|
style: { maxWidth: O },
|
|
2585
|
-
children: /* @__PURE__ */ b(
|
|
2606
|
+
children: /* @__PURE__ */ b(er, {
|
|
2586
2607
|
id: C,
|
|
2587
2608
|
children: [
|
|
2588
2609
|
k && /* @__PURE__ */ y("div", {
|
|
2589
2610
|
className: "wu-m-2",
|
|
2590
|
-
children: /* @__PURE__ */ y(
|
|
2611
|
+
children: /* @__PURE__ */ y(fr, {
|
|
2591
2612
|
placeholder: "Search...",
|
|
2592
2613
|
Icon: /* @__PURE__ */ y("span", { className: "wm-search" }),
|
|
2593
2614
|
className: "wu-text-xs wu-combobox-search",
|
|
@@ -2599,13 +2620,13 @@ var ir = ({ option: e, value: t, multiple: n = !1, onSelect: r, accessorKey: i,
|
|
|
2599
2620
|
})
|
|
2600
2621
|
}),
|
|
2601
2622
|
i,
|
|
2602
|
-
/* @__PURE__ */ b(
|
|
2623
|
+
/* @__PURE__ */ b(nr, { children: [/* @__PURE__ */ y(rr, { children: A || "No results found." }), H.length >= a ? /* @__PURE__ */ y(Qt, {
|
|
2603
2624
|
className: "wu-combobox-list",
|
|
2604
2625
|
containerHeight: _,
|
|
2605
2626
|
list: H,
|
|
2606
2627
|
callback: (e, n) => {
|
|
2607
2628
|
let r = n, i = r[t.value], a = i == null ? `__${"type" in r ? r.type : "item"}__${e}` : String(i);
|
|
2608
|
-
return /* @__PURE__ */ y(
|
|
2629
|
+
return /* @__PURE__ */ y(ur, {
|
|
2609
2630
|
option: n,
|
|
2610
2631
|
value: P,
|
|
2611
2632
|
onSelect: ae,
|
|
@@ -2628,7 +2649,7 @@ var ir = ({ option: e, value: t, multiple: n = !1, onSelect: r, accessorKey: i,
|
|
|
2628
2649
|
onScroll: D,
|
|
2629
2650
|
children: H.map((e, n) => {
|
|
2630
2651
|
let r = e, i = r[t.value], a = i == null ? `__${"type" in r ? r.type : "item"}__${n}` : String(i);
|
|
2631
|
-
return /* @__PURE__ */ y(
|
|
2652
|
+
return /* @__PURE__ */ y(ur, {
|
|
2632
2653
|
option: r,
|
|
2633
2654
|
value: P,
|
|
2634
2655
|
onSelect: ae,
|
|
@@ -2651,7 +2672,7 @@ var ir = ({ option: e, value: t, multiple: n = !1, onSelect: r, accessorKey: i,
|
|
|
2651
2672
|
children: g
|
|
2652
2673
|
})]
|
|
2653
2674
|
});
|
|
2654
|
-
},
|
|
2675
|
+
}, mr = (e) => {
|
|
2655
2676
|
let { textToCopy: t, notificationText: r, ...i } = e, [a, o] = n.useState(!1), s = async () => {
|
|
2656
2677
|
if (t) try {
|
|
2657
2678
|
await navigator.clipboard.writeText(t), o(!0), setTimeout(() => o(!1), 2e3);
|
|
@@ -2673,7 +2694,7 @@ var ir = ({ option: e, value: t, multiple: n = !1, onSelect: r, accessorKey: i,
|
|
|
2673
2694
|
className: "wu-text-lg"
|
|
2674
2695
|
})]
|
|
2675
2696
|
});
|
|
2676
|
-
},
|
|
2697
|
+
}, hr = z([
|
|
2677
2698
|
"wu-inline-flex wu-items-center wu-justify-center wu-rounded",
|
|
2678
2699
|
"wu-whitespace-nowrap wu-text-sm wu-leading-normal wu-font-normal",
|
|
2679
2700
|
"wu-transition-colors wu-duration-300",
|
|
@@ -2737,8 +2758,8 @@ var ir = ({ option: e, value: t, multiple: n = !1, onSelect: r, accessorKey: i,
|
|
|
2737
2758
|
color: "primary"
|
|
2738
2759
|
},
|
|
2739
2760
|
compoundVariants: []
|
|
2740
|
-
}),
|
|
2741
|
-
className: K(
|
|
2761
|
+
}), gr = t.forwardRef(({ className: e, variant: t, size: n, color: r, asChild: i = !1, ...a }, o) => /* @__PURE__ */ y(i ? ce : "button", {
|
|
2762
|
+
className: K(hr({
|
|
2742
2763
|
size: n,
|
|
2743
2764
|
color: r,
|
|
2744
2765
|
variant: t,
|
|
@@ -2747,16 +2768,16 @@ var ir = ({ option: e, value: t, multiple: n = !1, onSelect: r, accessorKey: i,
|
|
|
2747
2768
|
ref: o,
|
|
2748
2769
|
...a
|
|
2749
2770
|
}));
|
|
2750
|
-
|
|
2771
|
+
gr.displayName = "Button";
|
|
2751
2772
|
//#endregion
|
|
2752
2773
|
//#region src/base/ui/sheet.tsx
|
|
2753
|
-
var
|
|
2774
|
+
var _r = W.Root, vr = W.Trigger, yr = W.Close, br = W.Portal, xr = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y(W.Overlay, {
|
|
2754
2775
|
className: K("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30 data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0", "wu-drawer-overlay", e),
|
|
2755
2776
|
...t,
|
|
2756
2777
|
ref: n
|
|
2757
2778
|
}));
|
|
2758
|
-
|
|
2759
|
-
var
|
|
2779
|
+
xr.displayName = W.Overlay.displayName;
|
|
2780
|
+
var Sr = z("wu-fixed wu-z-50 wu-gap-4 wu-p-6 wu-shadow-lg wu-transition wu-ease-in-out data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-duration-500 data-[state=open]:wu-duration-500", {
|
|
2760
2781
|
variants: { side: {
|
|
2761
2782
|
top: "wu-inset-x-0 wu-top-0 wu-border-b data-[state=closed]:wu-slide-out-to-top data-[state=open]:wu-slide-in-from-top",
|
|
2762
2783
|
bottom: "wu-inset-x-0 wu-bottom-0 wu-border-t data-[state=closed]:wu-slide-out-to-bottom data-[state=open]:wu-slide-in-from-bottom",
|
|
@@ -2764,14 +2785,14 @@ var vr = z("wu-fixed wu-z-50 wu-gap-4 wu-p-6 wu-shadow-lg wu-transition wu-ease-
|
|
|
2764
2785
|
right: "wu-inset-y-0 wu-right-0 wu-h-full wu-w-3/4 wu-border-l data-[state=closed]:wu-slide-out-to-right data-[state=open]:wu-slide-in-from-right sm:wu-max-w-sm"
|
|
2765
2786
|
} },
|
|
2766
2787
|
defaultVariants: { side: "right" }
|
|
2767
|
-
}),
|
|
2788
|
+
}), Cr = t.forwardRef(({ side: e = "right", className: t, children: n, hideCloseButton: r, overlayClassName: i, closeButtonClassName: a, ...o }, s) => /* @__PURE__ */ b(br, { children: [/* @__PURE__ */ y(xr, { className: i }), /* @__PURE__ */ b(W.Content, {
|
|
2768
2789
|
ref: s,
|
|
2769
|
-
className: K(
|
|
2790
|
+
className: K(Sr({ side: e }), t),
|
|
2770
2791
|
...o,
|
|
2771
2792
|
children: [n, !r && /* @__PURE__ */ y(W.Close, {
|
|
2772
2793
|
"aria-label": "close",
|
|
2773
2794
|
asChild: !0,
|
|
2774
|
-
children: /* @__PURE__ */ b(
|
|
2795
|
+
children: /* @__PURE__ */ b(gr, {
|
|
2775
2796
|
variant: "iconOnly",
|
|
2776
2797
|
className: K("wu-absolute wu-right-4 wu-top-4", a),
|
|
2777
2798
|
children: [/* @__PURE__ */ y("span", { className: "wm-close" }), /* @__PURE__ */ y("span", {
|
|
@@ -2781,43 +2802,43 @@ var vr = z("wu-fixed wu-z-50 wu-gap-4 wu-p-6 wu-shadow-lg wu-transition wu-ease-
|
|
|
2781
2802
|
})
|
|
2782
2803
|
})]
|
|
2783
2804
|
})] }));
|
|
2784
|
-
|
|
2785
|
-
var
|
|
2805
|
+
Cr.displayName = W.Content.displayName;
|
|
2806
|
+
var wr = ({ className: e, ...t }) => /* @__PURE__ */ y("div", {
|
|
2786
2807
|
className: K("", e),
|
|
2787
2808
|
...t
|
|
2788
2809
|
});
|
|
2789
|
-
|
|
2790
|
-
var
|
|
2810
|
+
wr.displayName = "SheetHeader";
|
|
2811
|
+
var Tr = ({ className: e, ...t }) => /* @__PURE__ */ y("div", {
|
|
2791
2812
|
className: K("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2", e),
|
|
2792
2813
|
...t
|
|
2793
2814
|
});
|
|
2794
|
-
|
|
2795
|
-
var
|
|
2815
|
+
Tr.displayName = "SheetFooter";
|
|
2816
|
+
var Er = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y(W.Title, {
|
|
2796
2817
|
ref: n,
|
|
2797
2818
|
className: K("wu-text-lg wu-font-semibold", e),
|
|
2798
2819
|
...t
|
|
2799
2820
|
}));
|
|
2800
|
-
|
|
2801
|
-
var
|
|
2821
|
+
Er.displayName = W.Title.displayName;
|
|
2822
|
+
var Dr = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y(W.Description, {
|
|
2802
2823
|
ref: n,
|
|
2803
2824
|
className: K("wu-text-sm", e),
|
|
2804
2825
|
...t
|
|
2805
2826
|
}));
|
|
2806
|
-
|
|
2827
|
+
Dr.displayName = W.Description.displayName;
|
|
2807
2828
|
//#endregion
|
|
2808
2829
|
//#region src/components/drawer/WuDrawer.tsx
|
|
2809
|
-
var
|
|
2830
|
+
var Or = (e) => (t) => {
|
|
2810
2831
|
e && t.preventDefault();
|
|
2811
|
-
},
|
|
2832
|
+
}, kr = (e) => {
|
|
2812
2833
|
let { Trigger: t, children: n, hideCloseButton: r, className: i, side: a = "left", open: o, onOpenChange: s, preventClickOutside: c, overlayClassName: l, closeButtonClassName: u, ...d } = e;
|
|
2813
|
-
return /* @__PURE__ */ b(
|
|
2834
|
+
return /* @__PURE__ */ b(_r, {
|
|
2814
2835
|
open: o,
|
|
2815
2836
|
onOpenChange: s,
|
|
2816
|
-
children: [/* @__PURE__ */ y(
|
|
2837
|
+
children: [/* @__PURE__ */ y(vr, {
|
|
2817
2838
|
asChild: !0,
|
|
2818
2839
|
children: t
|
|
2819
|
-
}), /* @__PURE__ */ b(
|
|
2820
|
-
onInteractOutside:
|
|
2840
|
+
}), /* @__PURE__ */ b(Cr, {
|
|
2841
|
+
onInteractOutside: Or(c),
|
|
2821
2842
|
side: a,
|
|
2822
2843
|
className: K("wu-bg-white wu-text-gray-lead wu-px-0", i),
|
|
2823
2844
|
hideCloseButton: r,
|
|
@@ -2826,14 +2847,14 @@ var wr = (e) => (t) => {
|
|
|
2826
2847
|
...d,
|
|
2827
2848
|
children: [/* @__PURE__ */ y("div", {
|
|
2828
2849
|
className: "wu-hidden",
|
|
2829
|
-
children: /* @__PURE__ */ y(
|
|
2850
|
+
children: /* @__PURE__ */ y(Er, {})
|
|
2830
2851
|
}), n]
|
|
2831
2852
|
})]
|
|
2832
2853
|
});
|
|
2833
|
-
},
|
|
2854
|
+
}, Ar = ({ children: e, ...t }) => /* @__PURE__ */ y(yr, {
|
|
2834
2855
|
...t,
|
|
2835
2856
|
children: e
|
|
2836
|
-
}),
|
|
2857
|
+
}), jr = (e) => {
|
|
2837
2858
|
let { checked: t, onSelect: n, children: r, disabled: i, preventCloseOnSelect: a } = e;
|
|
2838
2859
|
return /* @__PURE__ */ y(un, {
|
|
2839
2860
|
disabled: i,
|
|
@@ -2842,7 +2863,7 @@ var wr = (e) => (t) => {
|
|
|
2842
2863
|
onSelect: (e) => a && e.preventDefault(),
|
|
2843
2864
|
children: r
|
|
2844
2865
|
});
|
|
2845
|
-
},
|
|
2866
|
+
}, Mr = (e) => {
|
|
2846
2867
|
let { children: t, className: n, Icon: r, iconPosition: i = "left", disabled: a, onSelect: o, preventCloseOnSelect: s } = e;
|
|
2847
2868
|
return /* @__PURE__ */ b(ln, {
|
|
2848
2869
|
onSelect: (e) => {
|
|
@@ -2855,10 +2876,10 @@ var wr = (e) => (t) => {
|
|
|
2855
2876
|
children: r
|
|
2856
2877
|
}), t]
|
|
2857
2878
|
});
|
|
2858
|
-
},
|
|
2879
|
+
}, Nr = ({ children: e, Label: t, ...n }) => /* @__PURE__ */ b(tn, {
|
|
2859
2880
|
...n,
|
|
2860
2881
|
children: [/* @__PURE__ */ y(fn, { children: t }), e]
|
|
2861
|
-
}),
|
|
2882
|
+
}), Pr = (e) => {
|
|
2862
2883
|
let { options: t, value: n, onSelect: r } = e;
|
|
2863
2884
|
return /* @__PURE__ */ y(an, {
|
|
2864
2885
|
value: n,
|
|
@@ -2869,13 +2890,13 @@ var wr = (e) => (t) => {
|
|
|
2869
2890
|
children: e.Label
|
|
2870
2891
|
}, e.value))
|
|
2871
2892
|
});
|
|
2872
|
-
},
|
|
2893
|
+
}, Fr = (e) => {
|
|
2873
2894
|
let { className: t, ...n } = e, r = K("wu-w-11/12 wu-mx-auto wu-border-gray-40", t);
|
|
2874
2895
|
return /* @__PURE__ */ y(pn, {
|
|
2875
2896
|
...n,
|
|
2876
2897
|
className: r
|
|
2877
2898
|
});
|
|
2878
|
-
},
|
|
2899
|
+
}, Ir = t.forwardRef(({ className: e, children: t, thumbColor: n, railColor: r, ...i }, a) => /* @__PURE__ */ b(pe.Root, {
|
|
2879
2900
|
ref: a,
|
|
2880
2901
|
className: K("wu-relative wu-overflow-hidden", e),
|
|
2881
2902
|
children: [
|
|
@@ -2884,15 +2905,15 @@ var wr = (e) => (t) => {
|
|
|
2884
2905
|
...i,
|
|
2885
2906
|
children: t
|
|
2886
2907
|
}),
|
|
2887
|
-
/* @__PURE__ */ y(
|
|
2908
|
+
/* @__PURE__ */ y(Lr, {
|
|
2888
2909
|
thumbColor: n,
|
|
2889
2910
|
railColor: r
|
|
2890
2911
|
}),
|
|
2891
2912
|
/* @__PURE__ */ y(pe.Corner, {})
|
|
2892
2913
|
]
|
|
2893
2914
|
}));
|
|
2894
|
-
|
|
2895
|
-
var
|
|
2915
|
+
Ir.displayName = pe.Root.displayName;
|
|
2916
|
+
var Lr = t.forwardRef(({ className: e, orientation: t = "vertical", thumbColor: n = "#d4d4d4", railColor: r = "#eeeeee", ...i }, a) => /* @__PURE__ */ y(pe.ScrollAreaScrollbar, {
|
|
2896
2917
|
ref: a,
|
|
2897
2918
|
orientation: t,
|
|
2898
2919
|
className: K("wu-flex wu-touch-none wu-select-none wu-transition-colors", t === "vertical" && "wu-h-full wu-w-2 wu-border-l wu-border-l-transparent wu-p-[1px]", t === "horizontal" && "wu-h-2 wu-flex-col wu-border-t wu-border-t-transparent wu-p-[1px]", e),
|
|
@@ -2903,10 +2924,10 @@ var Nr = t.forwardRef(({ className: e, orientation: t = "vertical", thumbColor:
|
|
|
2903
2924
|
style: { background: n }
|
|
2904
2925
|
})
|
|
2905
2926
|
}));
|
|
2906
|
-
|
|
2927
|
+
Lr.displayName = pe.ScrollAreaScrollbar.displayName;
|
|
2907
2928
|
//#endregion
|
|
2908
2929
|
//#region src/components/menu/ui/WuSubMenu.tsx
|
|
2909
|
-
var
|
|
2930
|
+
var Rr = (e) => {
|
|
2910
2931
|
let { children: t, Label: n, open: r, onOpenChange: i, height: a, dir: o, ...s } = e;
|
|
2911
2932
|
return /* @__PURE__ */ b(rn, {
|
|
2912
2933
|
...s,
|
|
@@ -2917,7 +2938,7 @@ var Pr = (e) => {
|
|
|
2917
2938
|
children: n
|
|
2918
2939
|
}), /* @__PURE__ */ y(nn, { children: /* @__PURE__ */ y(sn, {
|
|
2919
2940
|
onInteractOutside: (e) => e.preventDefault(),
|
|
2920
|
-
children: /* @__PURE__ */ y(
|
|
2941
|
+
children: /* @__PURE__ */ y(Ir, {
|
|
2921
2942
|
className: "wu-h-fit",
|
|
2922
2943
|
style: { height: a },
|
|
2923
2944
|
dir: o,
|
|
@@ -2925,7 +2946,7 @@ var Pr = (e) => {
|
|
|
2925
2946
|
})
|
|
2926
2947
|
}) })]
|
|
2927
2948
|
});
|
|
2928
|
-
},
|
|
2949
|
+
}, zr = "wu-p-1.5 wu-cursor-pointer hover:wu-bg-gray-20 wu-border-gray-40 wu-transition wu-duration-300 focus:wu-outline-2 focus:wu-outline-offset focus:wu-outline-blue-p/80 focus:wu-bg-gray-20 hover:wu-bg-gray-20 wu-rounded-t-sm", Br = (e) => {
|
|
2929
2950
|
let { children: t, MenuTitle: n, variant: r = "flat", name: i, open: a, onOpenChange: o, height: s, preventCloseOnClickOutside: c, dir: l, Trigger: u, align: d = "start", sideOffset: f = 0, side: p = "bottom", alignOffset: m, className: h, disabled: g, ..._ } = e;
|
|
2930
2951
|
return /* @__PURE__ */ b($t, {
|
|
2931
2952
|
..._,
|
|
@@ -2937,7 +2958,7 @@ var Pr = (e) => {
|
|
|
2937
2958
|
dir: l,
|
|
2938
2959
|
disabled: g,
|
|
2939
2960
|
className: K("disabled:wu-text-zinc-300 disabled:wu-bg-white disabled:wu-cursor-not-allowed disabled:hover:wu-bg-transparent"),
|
|
2940
|
-
children: u ??
|
|
2961
|
+
children: u ?? Vr(r, i, g)
|
|
2941
2962
|
}), /* @__PURE__ */ y(cn, {
|
|
2942
2963
|
className: K("wu-w-56 wu-border wu-border-blue-p disabled:wu-border-gray-40", h, "wu-menu-content"),
|
|
2943
2964
|
align: d,
|
|
@@ -2945,7 +2966,7 @@ var Pr = (e) => {
|
|
|
2945
2966
|
side: p,
|
|
2946
2967
|
alignOffset: m,
|
|
2947
2968
|
onInteractOutside: (e) => c && e.preventDefault(),
|
|
2948
|
-
children: /* @__PURE__ */ b(
|
|
2969
|
+
children: /* @__PURE__ */ b(Ir, {
|
|
2949
2970
|
className: "h-fit",
|
|
2950
2971
|
style: { height: s },
|
|
2951
2972
|
dir: l,
|
|
@@ -2960,13 +2981,13 @@ var Pr = (e) => {
|
|
|
2960
2981
|
})
|
|
2961
2982
|
})]
|
|
2962
2983
|
});
|
|
2963
|
-
},
|
|
2964
|
-
className: K(
|
|
2984
|
+
}, Vr = (e, t, n) => /* @__PURE__ */ b("button", {
|
|
2985
|
+
className: K(zr, "wu-flex wu-items-center wu-justify-between wu-gap-2 wu-h-8 wu-text-xs wu-group/wuMenu", e === "outlined" ? "wu-border" : "wu-border-b", "wu-trigger-btn"),
|
|
2965
2986
|
"aria-label": "menu-trigger",
|
|
2966
2987
|
children: [/* @__PURE__ */ y("span", { children: t ?? "Menu" }), /* @__PURE__ */ y("span", { className: K("wm-arrow-drop-down wu-text-gray-lead wu-text-base wu-rotate-180 group-data-[state=closed]/wuMenu:wu-rotate-0 wu-transition-transform wu-duration-300 group-hover:wu-text-blue-q", n && "wu-text-zinc-300 group-hover:wu-text-zinc-300") })]
|
|
2967
|
-
}),
|
|
2988
|
+
}), Hr = ({ titles: e, dir: t = "ltr", handleTitleClick: r }) => {
|
|
2968
2989
|
let [i, a] = n.useState(!1);
|
|
2969
|
-
return /* @__PURE__ */ y(
|
|
2990
|
+
return /* @__PURE__ */ y(Br, {
|
|
2970
2991
|
className: "wu-rounded-sm",
|
|
2971
2992
|
open: i,
|
|
2972
2993
|
onOpenChange: a,
|
|
@@ -2977,12 +2998,12 @@ var Pr = (e) => {
|
|
|
2977
2998
|
className: K("wu-w-6 wu-h-6 wu-shrink-0 wu-rounded-sm"),
|
|
2978
2999
|
Icon: /* @__PURE__ */ y("span", { className: K("wm-keyboard-arrow-down wu-text-[16px] wu-origin-center wu-transition-transform wu-duration-300", i && (t === "rtl" ? "-wu-rotate-180" : "wu-rotate-180")) })
|
|
2979
3000
|
}),
|
|
2980
|
-
children: e.map((e) => /* @__PURE__ */ y(
|
|
3001
|
+
children: e.map((e) => /* @__PURE__ */ y(Mr, {
|
|
2981
3002
|
onSelect: (t) => r(t, e.id),
|
|
2982
3003
|
children: e.title
|
|
2983
3004
|
}, e.id))
|
|
2984
3005
|
});
|
|
2985
|
-
},
|
|
3006
|
+
}, Ur = ({ titles: e, currentLevel: t, initial: n, handleTitleClick: r, headerClasses: i, offsetHeight: a, dir: o = "ltr" }) => {
|
|
2986
3007
|
let s = f(() => o === "rtl" ? {
|
|
2987
3008
|
initial: {
|
|
2988
3009
|
x: 8,
|
|
@@ -3020,7 +3041,7 @@ var Pr = (e) => {
|
|
|
3020
3041
|
className: K("wu-absolute wu-top-0 wu-left-0 wu-flex wu-gap-x-2 wu-px-4 wu-items-center wu-origin-left wu-w-full wu-transition wu-duration-200", t === n ? o === "rtl" ? "wu-translate-x-1 wu-opacity-0 wu-z-0 wu-delay-0" : "-wu-translate-x-1 wu-opacity-0 wu-z-0 wu-delay-0" : "wu-translate-x-0 wu-opacity-100 wu-z-50 wu-delay-200", i),
|
|
3021
3042
|
style: { height: t === n ? "-40px" : `${a}px` },
|
|
3022
3043
|
dir: o,
|
|
3023
|
-
children: [/* @__PURE__ */ y(
|
|
3044
|
+
children: [/* @__PURE__ */ y(Hr, {
|
|
3024
3045
|
titles: e,
|
|
3025
3046
|
handleTitleClick: r,
|
|
3026
3047
|
dir: o
|
|
@@ -3031,7 +3052,7 @@ var Pr = (e) => {
|
|
|
3031
3052
|
children: /* @__PURE__ */ b(le, {
|
|
3032
3053
|
initial: !1,
|
|
3033
3054
|
mode: "popLayout",
|
|
3034
|
-
children: [
|
|
3055
|
+
children: [Wr(e).map((e, t) => /* @__PURE__ */ y(fe.div, {
|
|
3035
3056
|
initial: s.initial,
|
|
3036
3057
|
animate: s.animate,
|
|
3037
3058
|
exit: s.exit,
|
|
@@ -3053,7 +3074,7 @@ var Pr = (e) => {
|
|
|
3053
3074
|
})
|
|
3054
3075
|
})]
|
|
3055
3076
|
});
|
|
3056
|
-
},
|
|
3077
|
+
}, Wr = (e) => {
|
|
3057
3078
|
let t = e.length;
|
|
3058
3079
|
return t > 2 ? [
|
|
3059
3080
|
e[0],
|
|
@@ -3063,7 +3084,7 @@ var Pr = (e) => {
|
|
|
3063
3084
|
},
|
|
3064
3085
|
e[t - 1]
|
|
3065
3086
|
] : e;
|
|
3066
|
-
},
|
|
3087
|
+
}, Gr = ({ items: e, initial: t, baseTitle: n, mode: r = "popLayout", headerClasses: i = "", offsetHeight: a = 40, variant: o = "default", dir: s = "ltr" }) => {
|
|
3067
3088
|
let [c, l] = m(n ? [n] : []), [[u, d], f] = m([t, 1]), p = (e, t) => {
|
|
3068
3089
|
t && l([...c, t]), f([e, 1]);
|
|
3069
3090
|
}, h = (e) => {
|
|
@@ -3073,7 +3094,7 @@ var Pr = (e) => {
|
|
|
3073
3094
|
return /* @__PURE__ */ b("div", {
|
|
3074
3095
|
dir: s,
|
|
3075
3096
|
className: "wu-w-full wu-h-full wu-relative wu-overflow-hidden wu-flex wu-flex-col",
|
|
3076
|
-
children: [/* @__PURE__ */ y(
|
|
3097
|
+
children: [/* @__PURE__ */ y(Ur, {
|
|
3077
3098
|
titles: c,
|
|
3078
3099
|
currentLevel: u,
|
|
3079
3100
|
initial: t,
|
|
@@ -3109,7 +3130,7 @@ var Pr = (e) => {
|
|
|
3109
3130
|
return /* @__PURE__ */ y(fe.div, {
|
|
3110
3131
|
dir: s,
|
|
3111
3132
|
custom: d,
|
|
3112
|
-
variants:
|
|
3133
|
+
variants: Kr(o),
|
|
3113
3134
|
initial: "enter",
|
|
3114
3135
|
animate: "center",
|
|
3115
3136
|
exit: "exit",
|
|
@@ -3131,14 +3152,14 @@ var Pr = (e) => {
|
|
|
3131
3152
|
})
|
|
3132
3153
|
})]
|
|
3133
3154
|
});
|
|
3134
|
-
},
|
|
3155
|
+
}, Kr = (e) => {
|
|
3135
3156
|
switch (e) {
|
|
3136
|
-
case "slideRight": return
|
|
3137
|
-
case "slideLeft": return
|
|
3138
|
-
case "fadeZoom": return
|
|
3139
|
-
default: return
|
|
3157
|
+
case "slideRight": return Jr;
|
|
3158
|
+
case "slideLeft": return Yr;
|
|
3159
|
+
case "fadeZoom": return Xr;
|
|
3160
|
+
default: return qr;
|
|
3140
3161
|
}
|
|
3141
|
-
},
|
|
3162
|
+
}, qr = {
|
|
3142
3163
|
enter: (e) => ({
|
|
3143
3164
|
scale: e > 0 ? .825 : 1.1,
|
|
3144
3165
|
opacity: 0,
|
|
@@ -3154,7 +3175,7 @@ var Pr = (e) => {
|
|
|
3154
3175
|
opacity: 0,
|
|
3155
3176
|
zIndex: 0
|
|
3156
3177
|
})
|
|
3157
|
-
},
|
|
3178
|
+
}, Jr = {
|
|
3158
3179
|
enter: (e) => ({
|
|
3159
3180
|
x: e > 0 ? -15 : 15,
|
|
3160
3181
|
opacity: 0,
|
|
@@ -3170,7 +3191,7 @@ var Pr = (e) => {
|
|
|
3170
3191
|
opacity: 0,
|
|
3171
3192
|
zIndex: 0
|
|
3172
3193
|
})
|
|
3173
|
-
},
|
|
3194
|
+
}, Yr = {
|
|
3174
3195
|
enter: (e) => ({
|
|
3175
3196
|
x: e > 0 ? 15 : -15,
|
|
3176
3197
|
opacity: 0,
|
|
@@ -3186,7 +3207,7 @@ var Pr = (e) => {
|
|
|
3186
3207
|
opacity: 0,
|
|
3187
3208
|
zIndex: 0
|
|
3188
3209
|
})
|
|
3189
|
-
},
|
|
3210
|
+
}, Xr = {
|
|
3190
3211
|
enter: (e) => ({
|
|
3191
3212
|
opacity: 0,
|
|
3192
3213
|
zIndex: 0,
|
|
@@ -3202,7 +3223,7 @@ var Pr = (e) => {
|
|
|
3202
3223
|
zIndex: 0,
|
|
3203
3224
|
scale: 1
|
|
3204
3225
|
}
|
|
3205
|
-
},
|
|
3226
|
+
}, Zr = ({ className: e, isLoading: t, loadingText: n, children: r, ...i }) => /* @__PURE__ */ b("footer", {
|
|
3206
3227
|
className: K("wu-flex wu-items-center wu-justify-between wu-gap-2 wu-border-t wu-border-gray-10 wu-py-3 wu-px-4 wu-bg-white/80 wu-backdrop-blur-sm wu-text-xs wu-font-normal wu-text-gray-footer wu-sticky wu-bottom-0", e),
|
|
3207
3228
|
...i,
|
|
3208
3229
|
children: [/* @__PURE__ */ y("div", {
|
|
@@ -3215,10 +3236,10 @@ var Pr = (e) => {
|
|
|
3215
3236
|
message: n
|
|
3216
3237
|
})]
|
|
3217
3238
|
});
|
|
3218
|
-
|
|
3239
|
+
Zr.displayName = "WuFooter";
|
|
3219
3240
|
//#endregion
|
|
3220
3241
|
//#region src/components/helpButton/WuHelpButton.tsx
|
|
3221
|
-
var
|
|
3242
|
+
var Qr = n.forwardRef((e, t) => {
|
|
3222
3243
|
let { size: n = "sm", idOrSlugOrUrl: r, variant: i = "primary", ...a } = e, o = n === "sm" ? 16 : 18, s = r.includes("http") ? r : `/help/${r}.html`, c = i === "primary" ? "wu-text-blue-p" : "wu-text-gray-lead";
|
|
3223
3244
|
return /* @__PURE__ */ y("button", {
|
|
3224
3245
|
...a,
|
|
@@ -3227,19 +3248,19 @@ var Jr = n.forwardRef((e, t) => {
|
|
|
3227
3248
|
children: /* @__PURE__ */ y("span", { className: K("wm-help wu-text-gray-subtle", `wu-text-[${o}px]`, c, a.disabled && "wu-text-neutral-300", "wu-help-button-icon") })
|
|
3228
3249
|
});
|
|
3229
3250
|
});
|
|
3230
|
-
|
|
3251
|
+
Qr.displayName = "WuHelpButton";
|
|
3231
3252
|
//#endregion
|
|
3232
3253
|
//#region src/components/listbox/utils/useGenClass.ts
|
|
3233
|
-
var
|
|
3254
|
+
var $r = (e, t) => `wu-${t ? "combobox" : "listbox"}-${e}`;
|
|
3234
3255
|
//#endregion
|
|
3235
3256
|
//#region src/components/listbox/ui/_item.tsx
|
|
3236
|
-
function
|
|
3237
|
-
let { option: t, accessorKey: n, onSelect: r, multiple: a, dir: o, GroupLabel: s, Item: c, isSelected: l, ...u } = e, d = n.group && Array.isArray(t[n.group]), f = ({ item: e, className: s }) => /* @__PURE__ */ i(
|
|
3257
|
+
function ei(e) {
|
|
3258
|
+
let { option: t, accessorKey: n, onSelect: r, multiple: a, dir: o, GroupLabel: s, Item: c, isSelected: l, ...u } = e, d = n.group && Array.isArray(t[n.group]), f = ({ item: e, className: s }) => /* @__PURE__ */ i(or, {
|
|
3238
3259
|
...u,
|
|
3239
3260
|
key: JSON.stringify(e),
|
|
3240
3261
|
onSelect: () => r?.(e),
|
|
3241
3262
|
value: t[n.value],
|
|
3242
|
-
className: K("data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-10", !!l?.(e) && !a && "wu-bg-blue-p/10", o === "rtl" && "wu-justify-end", s,
|
|
3263
|
+
className: K("data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-10", !!l?.(e) && !a && "wu-bg-blue-p/10", o === "rtl" && "wu-justify-end", s, $r("item")),
|
|
3243
3264
|
disabled: e.disabled
|
|
3244
3265
|
}, a && /* @__PURE__ */ y(Q, { checked: l?.(e) }), c ? c({
|
|
3245
3266
|
value: e,
|
|
@@ -3247,7 +3268,7 @@ function Xr(e) {
|
|
|
3247
3268
|
}) : /* @__PURE__ */ y(v, { children: e[n.label] }));
|
|
3248
3269
|
if (d) {
|
|
3249
3270
|
let e = t[n.group];
|
|
3250
|
-
return /* @__PURE__ */ y(
|
|
3271
|
+
return /* @__PURE__ */ y(ir, {
|
|
3251
3272
|
heading: typeof s == "string" ? t[s] : s?.(t),
|
|
3252
3273
|
children: e?.map((e) => /* @__PURE__ */ y(f, {
|
|
3253
3274
|
item: e,
|
|
@@ -3257,24 +3278,24 @@ function Xr(e) {
|
|
|
3257
3278
|
}
|
|
3258
3279
|
return /* @__PURE__ */ y(f, { item: t });
|
|
3259
3280
|
}
|
|
3260
|
-
var
|
|
3281
|
+
var ti = n.memo(ei), ni = (e) => {
|
|
3261
3282
|
let { className: t, ...n } = e;
|
|
3262
3283
|
return /* @__PURE__ */ b("div", {
|
|
3263
3284
|
className: "wu-relative",
|
|
3264
3285
|
children: [/* @__PURE__ */ y(J, {
|
|
3265
3286
|
icon: "wm-search",
|
|
3266
3287
|
className: "wu-absolute wu-top-[14px] wu-left-5"
|
|
3267
|
-
}), /* @__PURE__ */ y(
|
|
3288
|
+
}), /* @__PURE__ */ y(tr, {
|
|
3268
3289
|
...n,
|
|
3269
3290
|
"aria-label": "Search",
|
|
3270
|
-
className: K("wu-bg-gray-10 wu-border-b wu-border-gray-subtle wu-rounded-none wu-rounded-t-sm wu-h-8 wu-my-2 wu-pl-8", "focus:wu-border-blue-p focus-visible:wu-outline-none;",
|
|
3291
|
+
className: K("wu-bg-gray-10 wu-border-b wu-border-gray-subtle wu-rounded-none wu-rounded-t-sm wu-h-8 wu-my-2 wu-pl-8", "focus:wu-border-blue-p focus-visible:wu-outline-none;", $r("input"), t)
|
|
3271
3292
|
})]
|
|
3272
3293
|
});
|
|
3273
|
-
},
|
|
3294
|
+
}, ri = (e) => {
|
|
3274
3295
|
let { label: t, onSelectAll: r, data: i, value: a } = e, [o, s] = n.useState(!1), [c, l] = n.useState(!1);
|
|
3275
3296
|
return n.useEffect(() => {
|
|
3276
3297
|
!a || !i || (s(a.length > 0), l(a.length > 0 && a.length < i.length));
|
|
3277
|
-
}, [i, a]), /* @__PURE__ */ b(
|
|
3298
|
+
}, [i, a]), /* @__PURE__ */ b(or, {
|
|
3278
3299
|
className: "data-[selected='true']:wu-bg-gray-100 wu-cursor-pointer wu-text-xs wu-min-h-8 wu-py-0 hover:wu-bg-gray-100",
|
|
3279
3300
|
onSelect: () => r?.(!o),
|
|
3280
3301
|
children: [/* @__PURE__ */ y(Q, {
|
|
@@ -3282,7 +3303,7 @@ var Zr = n.memo(Xr), Qr = (e) => {
|
|
|
3282
3303
|
partial: c
|
|
3283
3304
|
}), t || "Select All"]
|
|
3284
3305
|
});
|
|
3285
|
-
},
|
|
3306
|
+
}, ii = (e) => {
|
|
3286
3307
|
let { CustomTrigger: t, disabled: r, value: i, placeholder: a, accessorKey: o, Chip: s, handleUnselect: c, variant: l, dir: u, className: d, ...f } = e, [p, m] = n.useState(), h = n.useRef(null);
|
|
3287
3308
|
return n.useEffect(() => {
|
|
3288
3309
|
if (!i) {
|
|
@@ -3302,43 +3323,43 @@ var Zr = n.memo(Xr), Qr = (e) => {
|
|
|
3302
3323
|
s,
|
|
3303
3324
|
o.label,
|
|
3304
3325
|
m
|
|
3305
|
-
]), /* @__PURE__ */ y(
|
|
3326
|
+
]), /* @__PURE__ */ y(Zn, {
|
|
3306
3327
|
asChild: !0,
|
|
3307
3328
|
id: e.id,
|
|
3308
3329
|
disabled: r,
|
|
3309
3330
|
ref: h,
|
|
3310
3331
|
children: t?.(i) || /* @__PURE__ */ b("button", {
|
|
3311
3332
|
...f,
|
|
3312
|
-
className: K("wu-group/wuListbox wu-relative wu-min-h-8 wu-text-xs wu-border-gray-subtle wu-bg-gray-10 wu-p-1 wu-pl-2 rtl:wu-pr-2 wu-border-b wu-w-full wu-text-left wu-pr-5 rtl:wu-pl-5", "hover:wu-border-blue-p", "disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle", "rtl:wu-text-right", l === "outlined" && "wu-border wu-border-gray-subtle wu-bg-white", d,
|
|
3333
|
+
className: K("wu-group/wuListbox wu-relative wu-min-h-8 wu-text-xs wu-border-gray-subtle wu-bg-gray-10 wu-p-1 wu-pl-2 rtl:wu-pr-2 wu-border-b wu-w-full wu-text-left wu-pr-5 rtl:wu-pl-5", "hover:wu-border-blue-p", "disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle", "rtl:wu-text-right", l === "outlined" && "wu-border wu-border-gray-subtle wu-bg-white", d, $r("trigger")),
|
|
3313
3334
|
children: [/* @__PURE__ */ y("div", {
|
|
3314
3335
|
className: K("wu-truncate", s && "wu-flex wu-items-center wu-gap-1 wu-flex-wrap", !p && "wu-font-light"),
|
|
3315
3336
|
children: p || a
|
|
3316
3337
|
}), /* @__PURE__ */ y(J, {
|
|
3317
3338
|
icon: "wm-arrow-drop-down",
|
|
3318
|
-
className: K("wu-absolute wu-top-1 wm-arrow-drop-down group-data-[state=open]/wuListbox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base", u === "rtl" ? "wu-left-1" : "wu-right-1",
|
|
3339
|
+
className: K("wu-absolute wu-top-1 wm-arrow-drop-down group-data-[state=open]/wuListbox:wu-rotate-180 wu-transition-transform wu-duration-300 wu-text-base", u === "rtl" ? "wu-left-1" : "wu-right-1", $r("drop-icon"))
|
|
3319
3340
|
})]
|
|
3320
3341
|
})
|
|
3321
3342
|
});
|
|
3322
|
-
},
|
|
3343
|
+
}, ai = (e, t, n) => {
|
|
3323
3344
|
let r = String(e[n.label] ?? "").toLowerCase(), i = String(e[n.value] ?? "").toLowerCase();
|
|
3324
3345
|
return r.includes(t) || i.includes(t);
|
|
3325
|
-
},
|
|
3346
|
+
}, oi = (e, t, n) => {
|
|
3326
3347
|
let r = t.trim();
|
|
3327
3348
|
if (r === "") return e;
|
|
3328
3349
|
let i = r.toLowerCase(), a = [];
|
|
3329
3350
|
for (let t of e) {
|
|
3330
3351
|
let e = n.group, r = e ? t[e] : void 0;
|
|
3331
3352
|
if (Array.isArray(r)) {
|
|
3332
|
-
let o = r.filter((e) =>
|
|
3353
|
+
let o = r.filter((e) => ai(e, i, n));
|
|
3333
3354
|
o.length > 0 && a.push({
|
|
3334
3355
|
...t,
|
|
3335
3356
|
[e]: o
|
|
3336
3357
|
});
|
|
3337
|
-
} else
|
|
3358
|
+
} else ai(t, i, n) && a.push(t);
|
|
3338
3359
|
}
|
|
3339
3360
|
return a;
|
|
3340
|
-
},
|
|
3341
|
-
let { data: t, accessorKey: r, value: i, Item: a, Label: o, GroupLabel: s, CustomHeader: c, CustomTrigger: l, NoDataContent: u, Chip: d, onSelect: f, onScroll: p, disabled: m, multiple: h, searchable: g, selectAll: _, virtualizedThreshold: v = 100, showGroupSeparator: x, id: S, dir: C, className: w, listClass: T, placeholder: E = "Select items...", variant: D, labelPosition: O = "top", maxContentWidth: k, maxContentHeight: A, modal: j, ...M } = e, [N, ee] = n.useState(!1), [P, F] = n.useState(""), [I, L] = n.useState(i), R = n.useMemo(() => r, [r]), te = n.useMemo(() => !g || !P ? t :
|
|
3361
|
+
}, si = (e) => {
|
|
3362
|
+
let { data: t, accessorKey: r, value: i, Item: a, Label: o, GroupLabel: s, CustomHeader: c, CustomTrigger: l, NoDataContent: u, Chip: d, onSelect: f, onScroll: p, disabled: m, multiple: h, searchable: g, selectAll: _, virtualizedThreshold: v = 100, showGroupSeparator: x, id: S, dir: C, className: w, listClass: T, placeholder: E = "Select items...", variant: D, labelPosition: O = "top", maxContentWidth: k, maxContentHeight: A, modal: j, ...M } = e, [N, ee] = n.useState(!1), [P, F] = n.useState(""), [I, L] = n.useState(i), R = n.useMemo(() => r, [r]), te = n.useMemo(() => !g || !P ? t : oi(t, P.toLowerCase().trim(), r), [
|
|
3342
3363
|
t,
|
|
3343
3364
|
P,
|
|
3344
3365
|
r.label,
|
|
@@ -3362,7 +3383,7 @@ var Zr = n.memo(Xr), Qr = (e) => {
|
|
|
3362
3383
|
let re = (e) => {
|
|
3363
3384
|
let t = (t, i) => {
|
|
3364
3385
|
let o = r.group && Array.isArray(t[r.group]), c = x && o && i > 0 && e.length > 1;
|
|
3365
|
-
return /* @__PURE__ */ b(n.Fragment, { children: [c && /* @__PURE__ */ y(
|
|
3386
|
+
return /* @__PURE__ */ b(n.Fragment, { children: [c && /* @__PURE__ */ y(ar, {}), /* @__PURE__ */ y(ti, {
|
|
3366
3387
|
option: t,
|
|
3367
3388
|
accessorKey: R,
|
|
3368
3389
|
multiple: h,
|
|
@@ -3379,13 +3400,13 @@ var Zr = n.memo(Xr), Qr = (e) => {
|
|
|
3379
3400
|
}) : e.map((e, n) => t(e, n));
|
|
3380
3401
|
};
|
|
3381
3402
|
return /* @__PURE__ */ b("div", {
|
|
3382
|
-
className: K("wu-flex wu-text-sm wu-gap-2", O === "top" && "wu-flex-col wu-gap-1", O === "left" && "wu-flex-row", O === "right" && "wu-flex-row-reverse",
|
|
3403
|
+
className: K("wu-flex wu-text-sm wu-gap-2", O === "top" && "wu-flex-col wu-gap-1", O === "left" && "wu-flex-row", O === "right" && "wu-flex-row-reverse", $r("container")),
|
|
3383
3404
|
dir: C,
|
|
3384
3405
|
children: [o && /* @__PURE__ */ y(Z, {
|
|
3385
3406
|
htmlFor: S,
|
|
3386
|
-
className:
|
|
3407
|
+
className: $r("label"),
|
|
3387
3408
|
children: o
|
|
3388
|
-
}), /* @__PURE__ */ b(
|
|
3409
|
+
}), /* @__PURE__ */ b(Xn, {
|
|
3389
3410
|
open: N,
|
|
3390
3411
|
onOpenChange: (e) => {
|
|
3391
3412
|
ee(e), e || setTimeout(() => {
|
|
@@ -3393,7 +3414,7 @@ var Zr = n.memo(Xr), Qr = (e) => {
|
|
|
3393
3414
|
}, 100);
|
|
3394
3415
|
},
|
|
3395
3416
|
modal: j,
|
|
3396
|
-
children: [/* @__PURE__ */ y(
|
|
3417
|
+
children: [/* @__PURE__ */ y(ii, {
|
|
3397
3418
|
CustomTrigger: l,
|
|
3398
3419
|
disabled: m,
|
|
3399
3420
|
value: I,
|
|
@@ -3406,33 +3427,33 @@ var Zr = n.memo(Xr), Qr = (e) => {
|
|
|
3406
3427
|
id: S,
|
|
3407
3428
|
dir: C,
|
|
3408
3429
|
...M
|
|
3409
|
-
}), /* @__PURE__ */ y(
|
|
3410
|
-
className: K("wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-w-auto wu-p-0 wu-bg-white wu-border wu-border-blue-p",
|
|
3430
|
+
}), /* @__PURE__ */ y(Qn, {
|
|
3431
|
+
className: K("wu-min-w-[--radix-popover-trigger-width] wu-max-w-[calc(100vw-32px)] wu-w-auto wu-p-0 wu-bg-white wu-border wu-border-blue-p", $r("content")),
|
|
3411
3432
|
align: "start",
|
|
3412
3433
|
sideOffset: -1,
|
|
3413
3434
|
style: { maxWidth: k },
|
|
3414
|
-
children: /* @__PURE__ */ b(
|
|
3435
|
+
children: /* @__PURE__ */ b(er, {
|
|
3415
3436
|
id: e.id,
|
|
3416
3437
|
shouldFilter: !1,
|
|
3417
3438
|
children: [
|
|
3418
|
-
g && /* @__PURE__ */ y(
|
|
3439
|
+
g && /* @__PURE__ */ y(ni, {
|
|
3419
3440
|
value: P,
|
|
3420
3441
|
onValueChange: F
|
|
3421
3442
|
}),
|
|
3422
3443
|
c,
|
|
3423
|
-
/* @__PURE__ */ b(
|
|
3424
|
-
className: K("wu-overflow-y-auto",
|
|
3444
|
+
/* @__PURE__ */ b(nr, {
|
|
3445
|
+
className: K("wu-overflow-y-auto", $r("list"), T),
|
|
3425
3446
|
onScroll: p,
|
|
3426
3447
|
style: { maxHeight: A || "420px" },
|
|
3427
3448
|
children: [
|
|
3428
|
-
/* @__PURE__ */ y(
|
|
3429
|
-
/* @__PURE__ */ y(
|
|
3449
|
+
/* @__PURE__ */ y(rr, { children: u || "No results found." }),
|
|
3450
|
+
/* @__PURE__ */ y(ir, { children: h && _?.enabled && !P && /* @__PURE__ */ y(ri, {
|
|
3430
3451
|
data: t,
|
|
3431
3452
|
value: I,
|
|
3432
3453
|
onSelectAll: B,
|
|
3433
3454
|
label: _.label
|
|
3434
3455
|
}) }),
|
|
3435
|
-
/* @__PURE__ */ y(
|
|
3456
|
+
/* @__PURE__ */ y(ir, { children: re(te) })
|
|
3436
3457
|
]
|
|
3437
3458
|
})
|
|
3438
3459
|
]
|
|
@@ -3440,7 +3461,7 @@ var Zr = n.memo(Xr), Qr = (e) => {
|
|
|
3440
3461
|
})]
|
|
3441
3462
|
})]
|
|
3442
3463
|
});
|
|
3443
|
-
},
|
|
3464
|
+
}, ci = n.forwardRef(({ showMenu: e = !1, className: t, color: n = "#1B3380", ...r }, i) => {
|
|
3444
3465
|
let a = K("wu-w-full wu-border wu-transition-all wu-duration-300");
|
|
3445
3466
|
return /* @__PURE__ */ b("div", {
|
|
3446
3467
|
...r,
|
|
@@ -3463,8 +3484,8 @@ var Zr = n.memo(Xr), Qr = (e) => {
|
|
|
3463
3484
|
]
|
|
3464
3485
|
});
|
|
3465
3486
|
});
|
|
3466
|
-
|
|
3467
|
-
var
|
|
3487
|
+
ci.displayName = "WuMenuIcon";
|
|
3488
|
+
var li = { gradientBackground: "_gradientBackground_1uc4j_1" }, ui = (e) => {
|
|
3468
3489
|
let { colors: t, size: n = .55, children: r, className: i, strokeWidth: a, centerOffset: o = {
|
|
3469
3490
|
x: 0,
|
|
3470
3491
|
y: 0
|
|
@@ -3495,35 +3516,35 @@ var ai = { gradientBackground: "_gradientBackground_1uc4j_1" }, oi = (e) => {
|
|
|
3495
3516
|
o
|
|
3496
3517
|
]), /* @__PURE__ */ y("div", {
|
|
3497
3518
|
ref: c,
|
|
3498
|
-
className: K(
|
|
3519
|
+
className: K(li.gradientBackground, "wu-transform-gpu", i),
|
|
3499
3520
|
...s,
|
|
3500
3521
|
children: r
|
|
3501
3522
|
});
|
|
3502
|
-
},
|
|
3523
|
+
}, di = {
|
|
3503
3524
|
wuModalBodyWrapper: "_wuModalBodyWrapper_ogig8_1",
|
|
3504
3525
|
"wu-modal-footer": "_wu-modal-footer_ogig8_5",
|
|
3505
3526
|
"wu-modal-content": "_wu-modal-content_ogig8_5",
|
|
3506
3527
|
"wu-modal-header": "_wu-modal-header_ogig8_9"
|
|
3507
|
-
},
|
|
3528
|
+
}, fi = {
|
|
3508
3529
|
overlay: "data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0",
|
|
3509
3530
|
content: "data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[state=closed]:wu-fade-out-0 data-[state=open]:wu-fade-in-0 data-[state=closed]:wu-zoom-out-95 data-[state=open]:wu-zoom-in-95 data-[state=closed]:wu-slide-out-to-left-1/2 data-[state=closed]:wu-slide-out-to-top-[48%] data-[state=open]:wu-slide-in-from-left-1/2 data-[state=open]:wu-slide-in-from-top-[48%]"
|
|
3510
|
-
},
|
|
3531
|
+
}, pi = W.Root, mi = W.Trigger, hi = W.Portal, gi = W.Close, _i = a(({ className: e, ...t }, n) => /* @__PURE__ */ y(W.Overlay, {
|
|
3511
3532
|
ref: n,
|
|
3512
|
-
className: K("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30",
|
|
3533
|
+
className: K("wu-fixed wu-inset-0 wu-z-50 wu-bg-black/30", fi.overlay, e),
|
|
3513
3534
|
...t
|
|
3514
3535
|
}));
|
|
3515
|
-
|
|
3516
|
-
var
|
|
3536
|
+
_i.displayName = W.Overlay.displayName;
|
|
3537
|
+
var vi = a(({ className: e, children: t, hideCloseButton: n, isStackedCard: r, ...i }, a) => /* @__PURE__ */ b(hi, { children: [/* @__PURE__ */ y(_i, {
|
|
3517
3538
|
className: r ? "wu-bg-transparent" : "",
|
|
3518
3539
|
"data-wu-overlay": !0
|
|
3519
3540
|
}), /* @__PURE__ */ b(W.Content, {
|
|
3520
3541
|
ref: a,
|
|
3521
|
-
className: K("wu-fixed wu-left-[50%] wu-z-50 wu-top-[50%] wu-flex wu-flex-col wu-w-full wu-max-w-lg wu-translate-x-[-50%] wu-translate-y-[-50%] wu-bg-white wu-shadow-lg wu-duration-200",
|
|
3542
|
+
className: K("wu-fixed wu-left-[50%] wu-z-50 wu-top-[50%] wu-flex wu-flex-col wu-w-full wu-max-w-lg wu-translate-x-[-50%] wu-translate-y-[-50%] wu-bg-white wu-shadow-lg wu-duration-200", fi.content, e),
|
|
3522
3543
|
...i,
|
|
3523
3544
|
children: [t, !n && /* @__PURE__ */ y(W.Close, {
|
|
3524
3545
|
"aria-label": "close",
|
|
3525
3546
|
asChild: !0,
|
|
3526
|
-
children: /* @__PURE__ */ b(
|
|
3547
|
+
children: /* @__PURE__ */ b(gr, {
|
|
3527
3548
|
variant: "iconOnly",
|
|
3528
3549
|
className: K("wu-absolute wu-right-2 wu-top-1 hover:wu-bg-black/[0.08] wu-w-8 wu-h-8 wu-p-0", "wu-top-3 wu-right-4", "group-data-[variant=action]:wu-text-blue-q", "group-data-[variant=upgrade]:wu-text-yellow-deep", "group-data-[variant=critical]:wu-text-red-deep"),
|
|
3529
3550
|
children: [/* @__PURE__ */ y("span", { className: "wm-close wu-leading-5" }), /* @__PURE__ */ y("span", {
|
|
@@ -3533,36 +3554,36 @@ var mi = a(({ className: e, children: t, hideCloseButton: n, isStackedCard: r, .
|
|
|
3533
3554
|
})
|
|
3534
3555
|
})]
|
|
3535
3556
|
})] }));
|
|
3536
|
-
|
|
3537
|
-
var
|
|
3557
|
+
vi.displayName = W.Content.displayName;
|
|
3558
|
+
var yi = ({ className: e, ...t }) => /* @__PURE__ */ y("div", {
|
|
3538
3559
|
className: K("wu-text-center wu-bg-gray-20 wu-w-full", e),
|
|
3539
3560
|
...t
|
|
3540
3561
|
});
|
|
3541
|
-
|
|
3542
|
-
var
|
|
3562
|
+
yi.displayName = "DialogHeader";
|
|
3563
|
+
var bi = ({ className: e, ...t }) => /* @__PURE__ */ y("div", {
|
|
3543
3564
|
className: K("wu-flex wu-flex-col-reverse sm:wu-flex-row sm:wu-justify-end sm:wu-space-x-2 wu-p-4", e),
|
|
3544
3565
|
...t
|
|
3545
3566
|
});
|
|
3546
|
-
|
|
3547
|
-
var
|
|
3567
|
+
bi.displayName = "DialogFooter";
|
|
3568
|
+
var xi = a(({ className: e, ...t }, n) => /* @__PURE__ */ y(W.Title, {
|
|
3548
3569
|
ref: n,
|
|
3549
3570
|
className: K("wu-text-lg wu-font-medium wu-flex wu-items-center wu-justify-center wu-gap-1 wu-h-10 wu-leading-none wu-tracking-tight", e),
|
|
3550
3571
|
...t
|
|
3551
3572
|
}));
|
|
3552
|
-
|
|
3553
|
-
var
|
|
3573
|
+
xi.displayName = W.Title.displayName;
|
|
3574
|
+
var Si = a(({ className: e, ...t }, n) => /* @__PURE__ */ y(W.Description, {
|
|
3554
3575
|
ref: n,
|
|
3555
3576
|
className: K("wu-text-sm wu-text-muted-foreground", e),
|
|
3556
3577
|
...t
|
|
3557
3578
|
}));
|
|
3558
|
-
|
|
3579
|
+
Si.displayName = W.Description.displayName;
|
|
3559
3580
|
//#endregion
|
|
3560
3581
|
//#region src/components/modal/WuModal.tsx
|
|
3561
|
-
var
|
|
3582
|
+
var Ci = "calc(100vh - 64px)", wi = {
|
|
3562
3583
|
sm: "400px",
|
|
3563
3584
|
md: "600px",
|
|
3564
3585
|
lg: "1200px"
|
|
3565
|
-
},
|
|
3586
|
+
}, Ti = ({ Trigger: e, children: t, size: n = "md", hideCloseButton: r, preventClickOutside: i, onOpenChange: a, open: o, dir: s, maxWidth: c, maxHeight: l, className: d, style: f, variant: m = "action", allowExternalPortals: h, onOpenAutoFocus: g, onCloseAutoFocus: _, ...v }) => {
|
|
3566
3587
|
let x = {
|
|
3567
3588
|
action: ["#EEF3FBcc 32%", "#1D50F4cc"],
|
|
3568
3589
|
upgrade: ["#FDEDCCcc 32%", "#FF9F00cc"],
|
|
@@ -3570,19 +3591,19 @@ var yi = "calc(100vh - 64px)", bi = {
|
|
|
3570
3591
|
}, S = p(null), C = p(null);
|
|
3571
3592
|
return u(() => () => {
|
|
3572
3593
|
S.current &&= (document.removeEventListener("focusin", S.current.focusin, !0), document.removeEventListener("focusout", S.current.focusout, !0), document.body.style.pointerEvents = "", null);
|
|
3573
|
-
}, []), /* @__PURE__ */ b(
|
|
3594
|
+
}, []), /* @__PURE__ */ b(pi, {
|
|
3574
3595
|
modal: !0,
|
|
3575
3596
|
onOpenChange: a,
|
|
3576
3597
|
open: o,
|
|
3577
|
-
children: [e && /* @__PURE__ */ y(
|
|
3598
|
+
children: [e && /* @__PURE__ */ y(mi, {
|
|
3578
3599
|
asChild: !0,
|
|
3579
3600
|
children: e
|
|
3580
|
-
}), /* @__PURE__ */ y(
|
|
3601
|
+
}), /* @__PURE__ */ y(vi, {
|
|
3581
3602
|
ref: C,
|
|
3582
3603
|
style: {
|
|
3583
3604
|
width: "calc(100% - 64px)",
|
|
3584
|
-
maxWidth: c ||
|
|
3585
|
-
maxHeight: l ||
|
|
3605
|
+
maxWidth: c || wi[n],
|
|
3606
|
+
maxHeight: l || Ci,
|
|
3586
3607
|
...f
|
|
3587
3608
|
},
|
|
3588
3609
|
hideCloseButton: r,
|
|
@@ -3615,34 +3636,34 @@ var yi = "calc(100vh - 64px)", bi = {
|
|
|
3615
3636
|
dir: s,
|
|
3616
3637
|
"aria-describedby": void 0,
|
|
3617
3638
|
"data-variant": m,
|
|
3618
|
-
className: K("wu-group wu-rounded-[.88rem]",
|
|
3639
|
+
className: K("wu-group wu-rounded-[.88rem]", di.wuModalBodyWrapper, d),
|
|
3619
3640
|
...v,
|
|
3620
|
-
children: /* @__PURE__ */ y(
|
|
3641
|
+
children: /* @__PURE__ */ y(ui, {
|
|
3621
3642
|
colors: x[m],
|
|
3622
3643
|
strokeWidth: 4,
|
|
3623
3644
|
className: K("wu-rounded-[1.1rem] wu-transform-gpu wu-flex wu-flex-col", d),
|
|
3624
|
-
style: { maxHeight: l ||
|
|
3645
|
+
style: { maxHeight: l || Ci },
|
|
3625
3646
|
children: t
|
|
3626
3647
|
})
|
|
3627
3648
|
})]
|
|
3628
3649
|
});
|
|
3629
|
-
},
|
|
3630
|
-
className: K("wu-flex wu-flex-col wu-gap-4 wu-p-4 rtl:wu-text-right wu-overflow-auto wu-bg-white", "wu-p-8 wu-text-gray-lead",
|
|
3650
|
+
}, Ei = ({ children: e, className: t, ...n }) => /* @__PURE__ */ y("div", {
|
|
3651
|
+
className: K("wu-flex wu-flex-col wu-gap-4 wu-p-4 rtl:wu-text-right wu-overflow-auto wu-bg-white", "wu-p-8 wu-text-gray-lead", di["wu-modal-content"], t),
|
|
3631
3652
|
...n,
|
|
3632
3653
|
children: e
|
|
3633
|
-
}),
|
|
3654
|
+
}), Di = ({ children: e, className: t, ...n }) => /* @__PURE__ */ y(yi, {
|
|
3634
3655
|
...n,
|
|
3635
3656
|
"data-variant": "action",
|
|
3636
|
-
className: K("wu-text-lg wu-text-gray-lead wu-font-medium", "wu-rounded-t-[.88rem] wu-px-4", "group-data-[variant=action]:wu-bg-blue-sidebar group-data-[variant=action]:wu-text-blue-q", "group-data-[variant=critical]:wu-bg-[#F9E0E0] group-data-[variant=critical]:wu-text-red-deep", "group-data-[variant=upgrade]:wu-bg-[#FEF1D9] group-data-[variant=upgrade]:wu-text-yellow-deep",
|
|
3637
|
-
children: /* @__PURE__ */ y(
|
|
3657
|
+
className: K("wu-text-lg wu-text-gray-lead wu-font-medium", "wu-rounded-t-[.88rem] wu-px-4", "group-data-[variant=action]:wu-bg-blue-sidebar group-data-[variant=action]:wu-text-blue-q", "group-data-[variant=critical]:wu-bg-[#F9E0E0] group-data-[variant=critical]:wu-text-red-deep", "group-data-[variant=upgrade]:wu-bg-[#FEF1D9] group-data-[variant=upgrade]:wu-text-yellow-deep", di["wu-modal-header"], t),
|
|
3658
|
+
children: /* @__PURE__ */ y(xi, {
|
|
3638
3659
|
className: "wu-font-normal wu-justify-start wu-text-2xl wu-h-14",
|
|
3639
3660
|
children: e
|
|
3640
3661
|
})
|
|
3641
|
-
}),
|
|
3662
|
+
}), Oi = ({ children: e, className: t, ...n }) => /* @__PURE__ */ y(bi, {
|
|
3642
3663
|
...n,
|
|
3643
|
-
className: K("wu-border-t wu-border-gray-40 wu-bg-white wu-min-h-16 wu-mx-4 wu-px-0", "wu-mx-0 wu-rounded-b-[.88rem] wu-min-h-16 wu-p-4", "group-data-[variant=upgrade]:wu-border-[#EED6A8]", "group-data-[variant=action]:wu-border-[#BAC9F8]", "group-data-[variant=critical]:wu-border-[#F0B3B3]",
|
|
3664
|
+
className: K("wu-border-t wu-border-gray-40 wu-bg-white wu-min-h-16 wu-mx-4 wu-px-0", "wu-mx-0 wu-rounded-b-[.88rem] wu-min-h-16 wu-p-4", "group-data-[variant=upgrade]:wu-border-[#EED6A8]", "group-data-[variant=action]:wu-border-[#BAC9F8]", "group-data-[variant=critical]:wu-border-[#F0B3B3]", di["wu-modal-footer"], t),
|
|
3644
3665
|
children: e
|
|
3645
|
-
}),
|
|
3666
|
+
}), ki = ({ children: e, className: t, ...r }) => /* @__PURE__ */ y(gi, {
|
|
3646
3667
|
asChild: !0,
|
|
3647
3668
|
children: /* @__PURE__ */ y($e, {
|
|
3648
3669
|
className: t,
|
|
@@ -3650,7 +3671,7 @@ var yi = "calc(100vh - 64px)", bi = {
|
|
|
3650
3671
|
...r,
|
|
3651
3672
|
children: e
|
|
3652
3673
|
})
|
|
3653
|
-
}),
|
|
3674
|
+
}), Ai = [
|
|
3654
3675
|
"Jan",
|
|
3655
3676
|
"Feb",
|
|
3656
3677
|
"Mar",
|
|
@@ -3663,7 +3684,7 @@ var yi = "calc(100vh - 64px)", bi = {
|
|
|
3663
3684
|
"Oct",
|
|
3664
3685
|
"Nov",
|
|
3665
3686
|
"Dec"
|
|
3666
|
-
],
|
|
3687
|
+
], ji = ({ value: e, onChange: t, min: n = I(/* @__PURE__ */ new Date(), { years: 5 }), max: r = k(/* @__PURE__ */ new Date(), { years: 1 }), placeholder: i = "Select a month", Label: a, labelPosition: o = "top", disabled: s, id: c, readonly: l, disabledMonths: d = [], ...h }) => {
|
|
3667
3688
|
let g = f(() => {
|
|
3668
3689
|
if (!e) return null;
|
|
3669
3690
|
let t = new Date(e);
|
|
@@ -3671,7 +3692,7 @@ var yi = "calc(100vh - 64px)", bi = {
|
|
|
3671
3692
|
}, [e]), [_, v] = m(g ? {
|
|
3672
3693
|
year: g.getFullYear(),
|
|
3673
3694
|
month: g.getMonth()
|
|
3674
|
-
} : null), [x, S] = m(g ? `${
|
|
3695
|
+
} : null), [x, S] = m(g ? `${Ai[g.getMonth()]} ${g.getFullYear()}` : void 0), [C, w] = m(() => {
|
|
3675
3696
|
let e = g?.getFullYear() ?? Math.min((/* @__PURE__ */ new Date()).getFullYear(), new Date(r).getFullYear());
|
|
3676
3697
|
return {
|
|
3677
3698
|
value: e,
|
|
@@ -3690,7 +3711,7 @@ var yi = "calc(100vh - 64px)", bi = {
|
|
|
3690
3711
|
v({
|
|
3691
3712
|
year: e,
|
|
3692
3713
|
month: t
|
|
3693
|
-
}), S(`${
|
|
3714
|
+
}), S(`${Ai[t]} ${e}`), w({
|
|
3694
3715
|
value: e,
|
|
3695
3716
|
label: e
|
|
3696
3717
|
});
|
|
@@ -3705,7 +3726,7 @@ var yi = "calc(100vh - 64px)", bi = {
|
|
|
3705
3726
|
label: g.getFullYear()
|
|
3706
3727
|
})), D.current = !1, E(e);
|
|
3707
3728
|
}, j = () => {
|
|
3708
|
-
_ && (D.current = !0, t?.(new Date(_.year, _.month, 15)), S(`${
|
|
3729
|
+
_ && (D.current = !0, t?.(new Date(_.year, _.month, 15)), S(`${Ai[_.month]} ${_.year}`));
|
|
3709
3730
|
}, M = () => {
|
|
3710
3731
|
v(null), S(void 0);
|
|
3711
3732
|
};
|
|
@@ -3734,7 +3755,7 @@ var yi = "calc(100vh - 64px)", bi = {
|
|
|
3734
3755
|
multiple: !1,
|
|
3735
3756
|
maxHeight: 224
|
|
3736
3757
|
})
|
|
3737
|
-
}), /* @__PURE__ */ y(
|
|
3758
|
+
}), /* @__PURE__ */ y(Mi, {
|
|
3738
3759
|
year: C?.value,
|
|
3739
3760
|
selectedMonth: _?.month,
|
|
3740
3761
|
selectedYear: _?.year,
|
|
@@ -3749,7 +3770,7 @@ var yi = "calc(100vh - 64px)", bi = {
|
|
|
3749
3770
|
children: a
|
|
3750
3771
|
})]
|
|
3751
3772
|
});
|
|
3752
|
-
},
|
|
3773
|
+
}, Mi = ({ year: e, selectedMonth: t, selectedYear: r, onClick: i, disabledMonths: a = [] }) => {
|
|
3753
3774
|
let o = /* @__PURE__ */ new Date(), s = o.getFullYear(), c = o.getMonth(), l = n.useMemo(() => {
|
|
3754
3775
|
let e = /* @__PURE__ */ new Set();
|
|
3755
3776
|
return a.forEach((t) => {
|
|
@@ -3759,23 +3780,23 @@ var yi = "calc(100vh - 64px)", bi = {
|
|
|
3759
3780
|
}, [a]);
|
|
3760
3781
|
return /* @__PURE__ */ y("div", {
|
|
3761
3782
|
className: "wu-grid wu-grid-cols-3 wu-grid-rows-4 wu-w-fit wu-gap-[1px] wu-bg-[#d9d9d9] wu-border wu-border-[#d9d9d9] wu-month-picker-grid",
|
|
3762
|
-
children:
|
|
3783
|
+
children: Ai.map((n, a) => {
|
|
3763
3784
|
let o = e === s && a === c, u = t === a && r === e;
|
|
3764
3785
|
return /* @__PURE__ */ y("button", {
|
|
3765
3786
|
disabled: l.has(`${e}-${a}`),
|
|
3766
3787
|
onClick: () => i(a, e),
|
|
3767
3788
|
className: K("wu-bg-white wu-flex wu-items-center wu-justify-center wu-w-[83px] wu-h-[53px] wu-text-xs wu-transition-colors", "hover:wu-bg-gray-25 hover:wu-text-blue-q hover:wu-font-medium", "focus:wu-outline-none focus-visible:wu-border focus-visible:wu-border-blue-p/50", o && "wu-border wu-border-blue-p", u && "wu-bg-blue-p wu-text-white hover:wu-bg-blue-p/80 hover:wu-text-white wu-font-medium", "disabled:wu-bg-gray-20 disabled:wu-text-gray-subtle disabled:hover:wu-bg-gray-20 disabled:hover:wu-text-gray-subtle disabled:hover:wu-font-normal", "wu-month-picker-month"),
|
|
3768
|
-
"data-value": `${
|
|
3789
|
+
"data-value": `${Ai[a]} ${e}`,
|
|
3769
3790
|
"data-month": a,
|
|
3770
3791
|
"data-year": e,
|
|
3771
3792
|
children: n
|
|
3772
3793
|
}, n);
|
|
3773
3794
|
})
|
|
3774
3795
|
});
|
|
3775
|
-
},
|
|
3796
|
+
}, Ni = {
|
|
3776
3797
|
wuPrimaryLink: "_wuPrimaryLink_124of_1",
|
|
3777
3798
|
wuPrimaryPopoverContent: "_wuPrimaryPopoverContent_124of_8"
|
|
3778
|
-
},
|
|
3799
|
+
}, Pi = (e, t, r, i = 96) => {
|
|
3779
3800
|
let a = e.length === 0 || i <= 0, [o, s] = n.useState([]), [c, l] = n.useState([]);
|
|
3780
3801
|
return n.useEffect(() => {
|
|
3781
3802
|
if (a) {
|
|
@@ -3794,11 +3815,11 @@ var yi = "calc(100vh - 64px)", bi = {
|
|
|
3794
3815
|
i,
|
|
3795
3816
|
a
|
|
3796
3817
|
]), a ? [[], []] : [o, c];
|
|
3797
|
-
},
|
|
3818
|
+
}, Fi = (e) => {
|
|
3798
3819
|
let { Links: t, children: r, className: i, ...a } = e, o = n.useMemo(() => t.map((e, t) => n.cloneElement(e, {
|
|
3799
|
-
className: K(
|
|
3820
|
+
className: K(Ni.wuPrimaryLink, e.props.className, "wu-primary-nav-link"),
|
|
3800
3821
|
key: t
|
|
3801
|
-
})), [t]), s = n.useRef(null), c = n.useRef(null), [l, u] =
|
|
3822
|
+
})), [t]), s = n.useRef(null), c = n.useRef(null), [l, u] = Pi(o, s, c);
|
|
3802
3823
|
return /* @__PURE__ */ y(v, { children: /* @__PURE__ */ b("header", {
|
|
3803
3824
|
className: K("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-px-2 wu-py-1 wu-bg-white wu-border-b", i),
|
|
3804
3825
|
...a,
|
|
@@ -3808,12 +3829,12 @@ var yi = "calc(100vh - 64px)", bi = {
|
|
|
3808
3829
|
children: [/* @__PURE__ */ y("nav", {
|
|
3809
3830
|
className: "wu-flex wu-items-center wu-justify-start wu-gap-4 wu-primary-nav-left",
|
|
3810
3831
|
children: l
|
|
3811
|
-
}), u.length > 0 && /* @__PURE__ */ b(
|
|
3832
|
+
}), u.length > 0 && /* @__PURE__ */ b(Xn, { children: [/* @__PURE__ */ y(Zn, {
|
|
3812
3833
|
className: "wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25",
|
|
3813
3834
|
"aria-label": "more",
|
|
3814
3835
|
children: /* @__PURE__ */ y("span", { className: "wm-more-vert" })
|
|
3815
|
-
}), /* @__PURE__ */ y(
|
|
3816
|
-
className: K(
|
|
3836
|
+
}), /* @__PURE__ */ y(Qn, {
|
|
3837
|
+
className: K(Ni.wuPrimaryPopoverContent, "wu-primary-nav-popover-left"),
|
|
3817
3838
|
align: "start",
|
|
3818
3839
|
sideOffset: 12,
|
|
3819
3840
|
children: u
|
|
@@ -3822,29 +3843,29 @@ var yi = "calc(100vh - 64px)", bi = {
|
|
|
3822
3843
|
className: "wu-items-center wu-justify-end wu-hidden wu-gap-4 sm:wu-flex wu-primary-nav-right",
|
|
3823
3844
|
ref: c,
|
|
3824
3845
|
children: r
|
|
3825
|
-
}), /* @__PURE__ */ b(
|
|
3846
|
+
}), /* @__PURE__ */ b(Xn, { children: [/* @__PURE__ */ y(Zn, {
|
|
3826
3847
|
className: "sm:wu-hidden",
|
|
3827
3848
|
children: /* @__PURE__ */ y("span", { className: "wu-text-lg wm-menu" })
|
|
3828
|
-
}), /* @__PURE__ */ y(
|
|
3849
|
+
}), /* @__PURE__ */ y(Qn, {
|
|
3829
3850
|
className: "wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-primary-nav-popover-right",
|
|
3830
3851
|
align: "end",
|
|
3831
3852
|
sideOffset: 4,
|
|
3832
3853
|
children: r
|
|
3833
3854
|
})] })] })]
|
|
3834
3855
|
}) });
|
|
3835
|
-
},
|
|
3856
|
+
}, Ii = {
|
|
3836
3857
|
wuSecondaryLink: "_wuSecondaryLink_1edl1_1",
|
|
3837
3858
|
wuSecondaryNav: "_wuSecondaryNav_1edl1_6",
|
|
3838
3859
|
wuSecondaryPopoverContent: "_wuSecondaryPopoverContent_1edl1_11"
|
|
3839
|
-
},
|
|
3860
|
+
}, Li = (e) => {
|
|
3840
3861
|
let { Links: t, children: r, className: i, ...a } = e, o = f(() => t.map((e, t) => n.cloneElement(e.link, {
|
|
3841
3862
|
key: t,
|
|
3842
|
-
className: K(
|
|
3863
|
+
className: K(Ii.wuSecondaryLink, e.link.props.className, "wu-secondary-nav-link-container"),
|
|
3843
3864
|
children: /* @__PURE__ */ b(v, { children: [n.cloneElement(e.imgOrIcon, { className: K("wu-w-5 wu-h-5 wu-flex wu-items-center wu-justify-center wu-text-lg wu-leading-5", e.imgOrIcon.props.className) }), /* @__PURE__ */ y("div", {
|
|
3844
3865
|
className: "wu-secondary-nav-link",
|
|
3845
3866
|
children: e.link.props.children
|
|
3846
3867
|
})] })
|
|
3847
|
-
})), [t]), s = n.useRef(null), c = n.useRef(null), l = n.useRef(null), [u, d] =
|
|
3868
|
+
})), [t]), s = n.useRef(null), c = n.useRef(null), l = n.useRef(null), [u, d] = Pi(o, s, l);
|
|
3848
3869
|
return /* @__PURE__ */ y(v, { children: /* @__PURE__ */ b("header", {
|
|
3849
3870
|
className: K("wu-flex wu-items-center wu-justify-between wu-gap-4 wu-border-y wu-border-gray-25 wu-h-[50px]", i),
|
|
3850
3871
|
...a,
|
|
@@ -3852,15 +3873,15 @@ var yi = "calc(100vh - 64px)", bi = {
|
|
|
3852
3873
|
children: [/* @__PURE__ */ b("div", {
|
|
3853
3874
|
className: "wu-flex wu-items-center wu-justify-start wu-gap-2",
|
|
3854
3875
|
children: [/* @__PURE__ */ y("nav", {
|
|
3855
|
-
className: K(
|
|
3876
|
+
className: K(Ii.wuSecondaryNav, "wu-flex wu-items-center wu-justify-start wu-w-full wu-h-full wu-secondary-nav-left"),
|
|
3856
3877
|
ref: c,
|
|
3857
3878
|
children: u
|
|
3858
|
-
}), d.length > 0 && /* @__PURE__ */ b(
|
|
3879
|
+
}), d.length > 0 && /* @__PURE__ */ b(Xn, { children: [/* @__PURE__ */ y(Zn, {
|
|
3859
3880
|
className: "wu-p-1 wu-pb-0 wu-rounded-sm focus:wu-outline-none focus:wu-bg-gray-25",
|
|
3860
3881
|
"aria-label": "more",
|
|
3861
3882
|
children: /* @__PURE__ */ y("span", { className: "wm-more-vert" })
|
|
3862
|
-
}), /* @__PURE__ */ y(
|
|
3863
|
-
className: K(
|
|
3883
|
+
}), /* @__PURE__ */ y(Qn, {
|
|
3884
|
+
className: K(Ii.wuSecondaryNavPopover, "wu-secondary-nav-popover-left"),
|
|
3864
3885
|
align: "start",
|
|
3865
3886
|
sideOffset: 12,
|
|
3866
3887
|
children: d
|
|
@@ -3869,17 +3890,17 @@ var yi = "calc(100vh - 64px)", bi = {
|
|
|
3869
3890
|
className: "wu-items-center wu-justify-end wu-hidden sm:wu-flex",
|
|
3870
3891
|
ref: l,
|
|
3871
3892
|
children: r
|
|
3872
|
-
}), /* @__PURE__ */ b(
|
|
3893
|
+
}), /* @__PURE__ */ b(Xn, { children: [/* @__PURE__ */ y(Zn, {
|
|
3873
3894
|
className: "sm:wu-hidden",
|
|
3874
3895
|
children: /* @__PURE__ */ y("span", { className: "wu-text-lg wm-menu" })
|
|
3875
|
-
}), /* @__PURE__ */ y(
|
|
3896
|
+
}), /* @__PURE__ */ y(Qn, {
|
|
3876
3897
|
className: "wu-bg-white wu-border wu-border-blue-p wu-w-fit wu-secondary-nav-popover-right",
|
|
3877
3898
|
align: "end",
|
|
3878
3899
|
sideOffset: 12,
|
|
3879
3900
|
children: r
|
|
3880
3901
|
})] })] })]
|
|
3881
3902
|
}) });
|
|
3882
|
-
},
|
|
3903
|
+
}, Ri = n.forwardRef(({ totalRows: e, initialPage: t = 0, initialPageSize: n = 100, onPageChange: r, className: i, disabled: a = !1, ...o }, c) => {
|
|
3883
3904
|
let [l, d] = m(t), [f, p] = m(n);
|
|
3884
3905
|
u(() => {
|
|
3885
3906
|
d(t), p(n);
|
|
@@ -3892,26 +3913,26 @@ var yi = "calc(100vh - 64px)", bi = {
|
|
|
3892
3913
|
...o,
|
|
3893
3914
|
role: "navigation",
|
|
3894
3915
|
children: [
|
|
3895
|
-
/* @__PURE__ */ y(
|
|
3916
|
+
/* @__PURE__ */ y(zi, {
|
|
3896
3917
|
label: "Previous page",
|
|
3897
3918
|
onClick: () => x(l - 1),
|
|
3898
3919
|
disabled: l === 0 || a,
|
|
3899
3920
|
icon: "wm-arrow-back-ios-new",
|
|
3900
3921
|
className: "hover:wu-bg-gray-20 rtl:wu-rotate-180 wu-prev-btn"
|
|
3901
3922
|
}),
|
|
3902
|
-
/* @__PURE__ */ y(
|
|
3923
|
+
/* @__PURE__ */ y(Br, {
|
|
3903
3924
|
name: `${g} - ${_}`,
|
|
3904
3925
|
className: "wu-w-[96px] wu-min-w-[96px] wu-pagination-menu",
|
|
3905
3926
|
align: "end",
|
|
3906
3927
|
disabled: a,
|
|
3907
|
-
children: /* @__PURE__ */ y(
|
|
3928
|
+
children: /* @__PURE__ */ y(Ir, {
|
|
3908
3929
|
style: { maxHeight: "224px" },
|
|
3909
3930
|
dir: o.dir,
|
|
3910
3931
|
children: v.length > 100 ? /* @__PURE__ */ y(Qt, {
|
|
3911
3932
|
className: "wu-pagination-list",
|
|
3912
3933
|
containerHeight: 224,
|
|
3913
3934
|
list: v,
|
|
3914
|
-
callback: (t, n) => /* @__PURE__ */ b(
|
|
3935
|
+
callback: (t, n) => /* @__PURE__ */ b(Mr, {
|
|
3915
3936
|
onSelect: () => x(n),
|
|
3916
3937
|
className: K("wu-py-2", n === l && "wu-bg-gray-20", "wu-pagination-item"),
|
|
3917
3938
|
children: [
|
|
@@ -3920,7 +3941,7 @@ var yi = "calc(100vh - 64px)", bi = {
|
|
|
3920
3941
|
Math.min((n + 1) * f, e)
|
|
3921
3942
|
]
|
|
3922
3943
|
}, t)
|
|
3923
|
-
}) : v.map((t) => /* @__PURE__ */ b(
|
|
3944
|
+
}) : v.map((t) => /* @__PURE__ */ b(Mr, {
|
|
3924
3945
|
onSelect: () => x(t),
|
|
3925
3946
|
className: K(t === l && "wu-bg-gray-20", "wu-py-2 hover:wu-bg-gray-20", "wu-pagination-item"),
|
|
3926
3947
|
children: [
|
|
@@ -3931,7 +3952,7 @@ var yi = "calc(100vh - 64px)", bi = {
|
|
|
3931
3952
|
}, t))
|
|
3932
3953
|
})
|
|
3933
3954
|
}),
|
|
3934
|
-
/* @__PURE__ */ y(
|
|
3955
|
+
/* @__PURE__ */ y(zi, {
|
|
3935
3956
|
label: "Next page",
|
|
3936
3957
|
onClick: () => x(l + 1),
|
|
3937
3958
|
disabled: l === h - 1 || a,
|
|
@@ -3941,39 +3962,39 @@ var yi = "calc(100vh - 64px)", bi = {
|
|
|
3941
3962
|
]
|
|
3942
3963
|
});
|
|
3943
3964
|
});
|
|
3944
|
-
|
|
3945
|
-
var
|
|
3965
|
+
Ri.displayName = "WuPagination";
|
|
3966
|
+
var zi = ({ label: e, onClick: t, disabled: n, icon: r, className: i }) => /* @__PURE__ */ y($e, {
|
|
3946
3967
|
variant: "iconOnly",
|
|
3947
3968
|
onClick: t,
|
|
3948
3969
|
disabled: n,
|
|
3949
3970
|
className: K("wu-w-8 wu-h-8 wu-rounded-xs wu-group disabled:wu-text-zinc-300 disabled:wu-bg-white wu-text-gray-lead focus:wu-bg-color-none", i),
|
|
3950
3971
|
"aria-label": e,
|
|
3951
3972
|
children: /* @__PURE__ */ y("span", { className: K("wu-text-sm", r) })
|
|
3952
|
-
}),
|
|
3973
|
+
}), Bi = ({ Trigger: e, children: t, className: n, dir: r, open: i, onOpenChange: a, modal: o, ...s }) => /* @__PURE__ */ b(Xn, {
|
|
3953
3974
|
open: i,
|
|
3954
3975
|
onOpenChange: a,
|
|
3955
3976
|
modal: o,
|
|
3956
|
-
children: [/* @__PURE__ */ y(
|
|
3977
|
+
children: [/* @__PURE__ */ y(Zn, {
|
|
3957
3978
|
asChild: !0,
|
|
3958
3979
|
dir: r,
|
|
3959
3980
|
children: e
|
|
3960
|
-
}), /* @__PURE__ */ y(
|
|
3981
|
+
}), /* @__PURE__ */ y(Qn, {
|
|
3961
3982
|
className: K("wu-w-80 wu-p-0 wu-border-blue-p wu-bg-white wu-dark:border-gray-switcher", n),
|
|
3962
3983
|
dir: r,
|
|
3963
3984
|
...s,
|
|
3964
3985
|
children: t
|
|
3965
3986
|
})]
|
|
3966
|
-
}),
|
|
3987
|
+
}), Vi = (e) => /* @__PURE__ */ y(oe, {
|
|
3967
3988
|
asChild: !0,
|
|
3968
3989
|
children: /* @__PURE__ */ y($e, { ...e })
|
|
3969
|
-
}),
|
|
3990
|
+
}), Hi = t.forwardRef(({ className: e, orientation: t, ...n }, r) => /* @__PURE__ */ y(me.Root, {
|
|
3970
3991
|
orientation: t,
|
|
3971
3992
|
className: K(t === "horizontal" ? "wu-flex wu-flex-row wu-items-center wu-gap-4" : "wu-grid wu-gap-2", e),
|
|
3972
3993
|
...n,
|
|
3973
3994
|
ref: r
|
|
3974
3995
|
}));
|
|
3975
|
-
|
|
3976
|
-
var
|
|
3996
|
+
Hi.displayName = me.Root.displayName;
|
|
3997
|
+
var Ui = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y(me.Item, {
|
|
3977
3998
|
ref: n,
|
|
3978
3999
|
className: K("wu-group wu-aspect-square wu-h-4 wu-w-4 wu-rounded-full wu-border wu-border-gray-subtle wu-text-blue-p wu-ring-offset-white disabled:wu-cursor-not-allowed disabled:wu-opacity-50 hover:wu-border-blue-p hover:wu-bg-gray-20 data-[state=checked]:wu-border-blue-p hover:data-[state=checked]:wu-border-blue-q hover:data-[state=checked]:wu-bg-inherit focus:wu-outline-2 focus:wu-outline-offset-4 focus:wu-outline-blue-soft disabled:hover:wu-border-gray-subtle disabled:wu-hover:bg-gray-20 disabled:wu-bg-gray-20", e),
|
|
3979
4000
|
...t,
|
|
@@ -3982,10 +4003,10 @@ var zi = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y(me.Item,
|
|
|
3982
4003
|
children: /* @__PURE__ */ y("div", { className: "wu-w-2 wu-h-2 wu-rounded-full wu-bg-blue-p group-hover:group-data-[state=checked]:wu-bg-blue-q" })
|
|
3983
4004
|
})
|
|
3984
4005
|
}));
|
|
3985
|
-
|
|
4006
|
+
Ui.displayName = me.Item.displayName;
|
|
3986
4007
|
//#endregion
|
|
3987
4008
|
//#region src/components/radio/WuRadioGroup.tsx
|
|
3988
|
-
var
|
|
4009
|
+
var Wi = n.forwardRef((e, t) => {
|
|
3989
4010
|
let { options: n, defaultValue: r, onChange: i, label: a, dir: o, orientation: s = "vertical", ...c } = e;
|
|
3990
4011
|
return /* @__PURE__ */ b("div", {
|
|
3991
4012
|
"data-slot": "wu-radio-group",
|
|
@@ -3994,7 +4015,7 @@ var Bi = n.forwardRef((e, t) => {
|
|
|
3994
4015
|
children: [/* @__PURE__ */ y(Z, {
|
|
3995
4016
|
htmlFor: c.id,
|
|
3996
4017
|
children: a
|
|
3997
|
-
}), /* @__PURE__ */ y(
|
|
4018
|
+
}), /* @__PURE__ */ y(Hi, {
|
|
3998
4019
|
defaultValue: r,
|
|
3999
4020
|
required: c.required,
|
|
4000
4021
|
disabled: c.disabled,
|
|
@@ -4006,7 +4027,7 @@ var Bi = n.forwardRef((e, t) => {
|
|
|
4006
4027
|
ref: t,
|
|
4007
4028
|
children: n.map((e) => /* @__PURE__ */ b("div", {
|
|
4008
4029
|
className: "wu-flex wu-items-center wu-gap-2 wu-radio-item-container",
|
|
4009
|
-
children: [/* @__PURE__ */ y(
|
|
4030
|
+
children: [/* @__PURE__ */ y(Ui, {
|
|
4010
4031
|
value: e.value,
|
|
4011
4032
|
id: e.value,
|
|
4012
4033
|
disabled: e.disabled,
|
|
@@ -4022,28 +4043,28 @@ var Bi = n.forwardRef((e, t) => {
|
|
|
4022
4043
|
})]
|
|
4023
4044
|
});
|
|
4024
4045
|
});
|
|
4025
|
-
|
|
4046
|
+
Wi.displayName = "WuRadioGroup";
|
|
4026
4047
|
//#endregion
|
|
4027
4048
|
//#region src/components/scrollArea/WuScrollArea.tsx
|
|
4028
|
-
var
|
|
4049
|
+
var Gi = (e) => {
|
|
4029
4050
|
let { children: t, ...n } = e;
|
|
4030
|
-
return /* @__PURE__ */ b(
|
|
4051
|
+
return /* @__PURE__ */ b(Ir, {
|
|
4031
4052
|
...n,
|
|
4032
4053
|
role: "complementary",
|
|
4033
4054
|
"aria-label": "ScrollArea",
|
|
4034
|
-
children: [t, /* @__PURE__ */ y(
|
|
4055
|
+
children: [t, /* @__PURE__ */ y(Lr, { orientation: "horizontal" })]
|
|
4035
4056
|
});
|
|
4036
4057
|
};
|
|
4037
4058
|
//#endregion
|
|
4038
4059
|
//#region src/components/segmentedSelector/hooks/useSegmentedIndicator.ts
|
|
4039
|
-
function
|
|
4060
|
+
function Ki(e) {
|
|
4040
4061
|
let t = e.querySelector("button[data-pressed]:not(:disabled)");
|
|
4041
4062
|
t ? (e.style.setProperty("--wu-seg-x", `${t.offsetLeft}px`), e.style.setProperty("--wu-seg-w", `${t.offsetWidth}px`), e.style.setProperty("--wu-seg-o", "1")) : e.style.setProperty("--wu-seg-o", "0");
|
|
4042
4063
|
}
|
|
4043
|
-
function
|
|
4064
|
+
function qi(e, t) {
|
|
4044
4065
|
d(() => {
|
|
4045
4066
|
let t = e.current;
|
|
4046
|
-
if (!t || (
|
|
4067
|
+
if (!t || (Ki(t), t.dataset.ready)) return;
|
|
4047
4068
|
let n = requestAnimationFrame(() => {
|
|
4048
4069
|
e.current && (e.current.dataset.ready = "true");
|
|
4049
4070
|
});
|
|
@@ -4051,16 +4072,16 @@ function Ui(e, t) {
|
|
|
4051
4072
|
}, [t]), d(() => {
|
|
4052
4073
|
let t = e.current;
|
|
4053
4074
|
if (!t) return;
|
|
4054
|
-
let n = new ResizeObserver(() =>
|
|
4075
|
+
let n = new ResizeObserver(() => Ki(t));
|
|
4055
4076
|
return n.observe(t), () => n.disconnect();
|
|
4056
4077
|
}, []);
|
|
4057
4078
|
}
|
|
4058
|
-
var
|
|
4079
|
+
var Ji = {
|
|
4059
4080
|
wuSegmentedSelector: "_wuSegmentedSelector_19z31_1",
|
|
4060
4081
|
wuSegmentedSelectorItem: "_wuSegmentedSelectorItem_19z31_35"
|
|
4061
|
-
},
|
|
4082
|
+
}, Yi = ({ value: e, defaultValue: t, onChange: n, size: r = "md", iconOnly: i, disabled: a, className: o, children: s, ...c }) => {
|
|
4062
4083
|
let [l, u] = m(t), d = p(null);
|
|
4063
|
-
return
|
|
4084
|
+
return qi(d, e ?? l), /* @__PURE__ */ y(he, {
|
|
4064
4085
|
ref: d,
|
|
4065
4086
|
value: e === void 0 ? void 0 : [e],
|
|
4066
4087
|
defaultValue: t === void 0 ? void 0 : [t],
|
|
@@ -4071,46 +4092,46 @@ var Wi = {
|
|
|
4071
4092
|
disabled: a,
|
|
4072
4093
|
"data-size": r,
|
|
4073
4094
|
"data-icon-only": i || void 0,
|
|
4074
|
-
className: K(
|
|
4095
|
+
className: K(Ji.wuSegmentedSelector, o),
|
|
4075
4096
|
...c,
|
|
4076
4097
|
"data-slot": "wu-segmented-selector",
|
|
4077
4098
|
children: s
|
|
4078
4099
|
});
|
|
4079
4100
|
};
|
|
4080
|
-
|
|
4101
|
+
Yi.displayName = "WuSegmentedSelector";
|
|
4081
4102
|
//#endregion
|
|
4082
4103
|
//#region src/components/segmentedSelector/subComponents/WuSegmentedSelectorItem.tsx
|
|
4083
|
-
var
|
|
4104
|
+
var Xi = a(({ value: e, className: t, children: n, ...r }, i) => /* @__PURE__ */ y(ge, {
|
|
4084
4105
|
ref: i,
|
|
4085
4106
|
value: e,
|
|
4086
|
-
className: K(
|
|
4107
|
+
className: K(Ji.wuSegmentedSelectorItem, t),
|
|
4087
4108
|
...r,
|
|
4088
4109
|
"data-slot": "wu-segmented-selector-item",
|
|
4089
4110
|
children: n
|
|
4090
4111
|
}));
|
|
4091
|
-
|
|
4112
|
+
Xi.displayName = "WuSegmentedSelectorItem";
|
|
4092
4113
|
//#endregion
|
|
4093
4114
|
//#region src/base/ui/input.tsx
|
|
4094
|
-
var
|
|
4115
|
+
var Zi = t.forwardRef(({ className: e, type: t, ...n }, r) => /* @__PURE__ */ y("input", {
|
|
4095
4116
|
type: t,
|
|
4096
4117
|
className: K("wu-flex wu-h-8 wu-w-full wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-p-2 wu-text-sm wu-font-normal wu-text-gray-lead", "file:wu-border-0 file:wu-bg-gray-40 file:wu-text-gray-notification file:wu-text-sm file:wu-font-normal file:wu-relative file:wu-bottom-[3px]", "wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light", "disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle", "read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle", "focus:wu-border-blue-p focus-visible:wu-outline-none wu-transition-colors hover:wu-border-gray-40", e),
|
|
4097
4118
|
ref: r,
|
|
4098
4119
|
...n
|
|
4099
4120
|
}));
|
|
4100
|
-
|
|
4121
|
+
Zi.displayName = "Input";
|
|
4101
4122
|
//#endregion
|
|
4102
4123
|
//#region src/base/ui/separator.tsx
|
|
4103
|
-
var
|
|
4124
|
+
var Qi = t.forwardRef(({ className: e, orientation: t = "horizontal", decorative: n = !0, ...r }, i) => /* @__PURE__ */ y(_e.Root, {
|
|
4104
4125
|
ref: i,
|
|
4105
4126
|
decorative: n,
|
|
4106
4127
|
orientation: t,
|
|
4107
4128
|
className: K("wu-shrink-0 wu-bg-gray-40", t === "horizontal" ? "wu-h-[1px] wu-w-full" : "wu-h-full wu-w-[1px]", e),
|
|
4108
4129
|
...r
|
|
4109
4130
|
}));
|
|
4110
|
-
|
|
4131
|
+
Qi.displayName = _e.Root.displayName;
|
|
4111
4132
|
//#endregion
|
|
4112
4133
|
//#region src/base/ui/skeleton.tsx
|
|
4113
|
-
function
|
|
4134
|
+
function $i({ className: e, ...t }) {
|
|
4114
4135
|
return /* @__PURE__ */ y("div", {
|
|
4115
4136
|
className: K("animate-pulse rounded-md bg-muted", e),
|
|
4116
4137
|
...t
|
|
@@ -4118,28 +4139,28 @@ function Yi({ className: e, ...t }) {
|
|
|
4118
4139
|
}
|
|
4119
4140
|
//#endregion
|
|
4120
4141
|
//#region src/hooks/useMobile.tsx
|
|
4121
|
-
var
|
|
4122
|
-
function
|
|
4142
|
+
var ea = 768;
|
|
4143
|
+
function ta() {
|
|
4123
4144
|
let [e, n] = t.useState(void 0);
|
|
4124
4145
|
return t.useEffect(() => {
|
|
4125
|
-
let e = window.matchMedia(`(max-width: ${
|
|
4126
|
-
n(window.innerWidth <
|
|
4146
|
+
let e = window.matchMedia(`(max-width: ${ea - 1}px)`), t = () => {
|
|
4147
|
+
n(window.innerWidth < ea);
|
|
4127
4148
|
};
|
|
4128
|
-
return e.addEventListener("change", t), n(window.innerWidth <
|
|
4149
|
+
return e.addEventListener("change", t), n(window.innerWidth < ea), () => e.removeEventListener("change", t);
|
|
4129
4150
|
}, []), !!e;
|
|
4130
4151
|
}
|
|
4131
4152
|
//#endregion
|
|
4132
4153
|
//#region src/components/sidebar/shadcn/sidebar.tsx
|
|
4133
|
-
var
|
|
4134
|
-
function
|
|
4135
|
-
let e = t.useContext(
|
|
4154
|
+
var na = "sidebar_state", ra = 3600 * 24 * 7, ia = "256px", aa = "256px", oa = "3rem", sa = "b", ca = t.createContext(null);
|
|
4155
|
+
function la() {
|
|
4156
|
+
let e = t.useContext(ca);
|
|
4136
4157
|
if (!e) throw Error("useSidebar must be used within a SidebarProvider.");
|
|
4137
4158
|
return e;
|
|
4138
4159
|
}
|
|
4139
|
-
var
|
|
4140
|
-
let l =
|
|
4160
|
+
var ua = t.forwardRef(({ defaultOpen: e = !0, open: n, onOpenChange: r, className: i, style: a, children: o, ...s }, c) => {
|
|
4161
|
+
let l = ta(), [u, d] = t.useState(!1), [f, p] = t.useState(l ? !0 : e), m = n ?? f, h = t.useCallback((e) => {
|
|
4141
4162
|
let t = typeof e == "function" ? e(m) : e;
|
|
4142
|
-
r ? r(t) : p(t), document.cookie = `${
|
|
4163
|
+
r ? r(t) : p(t), document.cookie = `${na}=${t}; path=/; max-age=${ra}`;
|
|
4143
4164
|
}, [r, m]), g = t.useCallback(() => l ? d((e) => !e) : h((e) => !e), [
|
|
4144
4165
|
l,
|
|
4145
4166
|
h,
|
|
@@ -4147,7 +4168,7 @@ var oa = t.forwardRef(({ defaultOpen: e = !0, open: n, onOpenChange: r, classNam
|
|
|
4147
4168
|
]);
|
|
4148
4169
|
t.useEffect(() => {
|
|
4149
4170
|
let e = (e) => {
|
|
4150
|
-
e.key ===
|
|
4171
|
+
e.key === sa && (e.metaKey || e.ctrlKey) && (e.preventDefault(), g());
|
|
4151
4172
|
};
|
|
4152
4173
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
4153
4174
|
}, [g]);
|
|
@@ -4168,14 +4189,14 @@ var oa = t.forwardRef(({ defaultOpen: e = !0, open: n, onOpenChange: r, classNam
|
|
|
4168
4189
|
d,
|
|
4169
4190
|
g
|
|
4170
4191
|
]);
|
|
4171
|
-
return /* @__PURE__ */ y(
|
|
4192
|
+
return /* @__PURE__ */ y(ca.Provider, {
|
|
4172
4193
|
value: v,
|
|
4173
4194
|
children: /* @__PURE__ */ y(Dt, {
|
|
4174
4195
|
delayDuration: 0,
|
|
4175
4196
|
children: /* @__PURE__ */ y("div", {
|
|
4176
4197
|
style: {
|
|
4177
|
-
"--sidebar-width":
|
|
4178
|
-
"--sidebar-width-icon":
|
|
4198
|
+
"--sidebar-width": ia,
|
|
4199
|
+
"--sidebar-width-icon": oa,
|
|
4179
4200
|
...a
|
|
4180
4201
|
},
|
|
4181
4202
|
className: K("wu-group/sidebar-wrapper wu-flex wu-min-h-[calc(100svh-48px)] wu-w-full", i),
|
|
@@ -4186,23 +4207,23 @@ var oa = t.forwardRef(({ defaultOpen: e = !0, open: n, onOpenChange: r, classNam
|
|
|
4186
4207
|
})
|
|
4187
4208
|
});
|
|
4188
4209
|
});
|
|
4189
|
-
|
|
4190
|
-
var
|
|
4191
|
-
let { isMobile: s, state: c, openMobile: l, setOpenMobile: u } =
|
|
4210
|
+
ua.displayName = "SidebarProvider";
|
|
4211
|
+
var da = t.forwardRef(({ side: e = "left", variant: t = "sidebar", collapsible: n = "offcanvas", className: r, children: i, ...a }, o) => {
|
|
4212
|
+
let { isMobile: s, state: c, openMobile: l, setOpenMobile: u } = la();
|
|
4192
4213
|
return n === "none" ? /* @__PURE__ */ y("div", {
|
|
4193
4214
|
className: K("wu-flex wu-h-full wu-w-[--sidebar-width] wu-flex-col", r),
|
|
4194
4215
|
ref: o,
|
|
4195
4216
|
...a,
|
|
4196
4217
|
children: i
|
|
4197
|
-
}) : s ? /* @__PURE__ */ y(
|
|
4218
|
+
}) : s ? /* @__PURE__ */ y(_r, {
|
|
4198
4219
|
open: l,
|
|
4199
4220
|
onOpenChange: u,
|
|
4200
4221
|
...a,
|
|
4201
|
-
children: /* @__PURE__ */ y(
|
|
4222
|
+
children: /* @__PURE__ */ y(Cr, {
|
|
4202
4223
|
"data-sidebar": "sidebar",
|
|
4203
4224
|
"data-mobile": "true",
|
|
4204
4225
|
className: "wu-w-[--sidebar-width] wu-bg-blue-sidebar wu-p-0 [&>button]:wu-hidden",
|
|
4205
|
-
style: { "--sidebar-width":
|
|
4226
|
+
style: { "--sidebar-width": aa },
|
|
4206
4227
|
side: e,
|
|
4207
4228
|
children: /* @__PURE__ */ y("div", {
|
|
4208
4229
|
className: "wu-flex wu-flex-col wu-w-full wu-h-full",
|
|
@@ -4227,10 +4248,10 @@ var sa = t.forwardRef(({ side: e = "left", variant: t = "sidebar", collapsible:
|
|
|
4227
4248
|
})]
|
|
4228
4249
|
});
|
|
4229
4250
|
});
|
|
4230
|
-
|
|
4231
|
-
var
|
|
4232
|
-
let { toggleSidebar: a } =
|
|
4233
|
-
return /* @__PURE__ */ b(
|
|
4251
|
+
da.displayName = "Sidebar";
|
|
4252
|
+
var fa = t.forwardRef(({ className: e, onClick: t, children: n, ...r }, i) => {
|
|
4253
|
+
let { toggleSidebar: a } = la();
|
|
4254
|
+
return /* @__PURE__ */ b(gr, {
|
|
4234
4255
|
ref: i,
|
|
4235
4256
|
"data-sidebar": "trigger",
|
|
4236
4257
|
variant: "secondary",
|
|
@@ -4245,9 +4266,9 @@ var ca = t.forwardRef(({ className: e, onClick: t, children: n, ...r }, i) => {
|
|
|
4245
4266
|
})]
|
|
4246
4267
|
});
|
|
4247
4268
|
});
|
|
4248
|
-
|
|
4249
|
-
var
|
|
4250
|
-
let { toggleSidebar: r } =
|
|
4269
|
+
fa.displayName = "SidebarTrigger";
|
|
4270
|
+
var pa = t.forwardRef(({ className: e, ...t }, n) => {
|
|
4271
|
+
let { toggleSidebar: r } = la();
|
|
4251
4272
|
return /* @__PURE__ */ y("button", {
|
|
4252
4273
|
ref: n,
|
|
4253
4274
|
"data-sidebar": "rail",
|
|
@@ -4259,91 +4280,91 @@ var la = t.forwardRef(({ className: e, ...t }, n) => {
|
|
|
4259
4280
|
...t
|
|
4260
4281
|
});
|
|
4261
4282
|
});
|
|
4262
|
-
|
|
4263
|
-
var
|
|
4283
|
+
pa.displayName = "SidebarRail";
|
|
4284
|
+
var ma = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("main", {
|
|
4264
4285
|
ref: n,
|
|
4265
4286
|
className: K("wu-relative wu-flex wu-w-full wu-flex-1 wu-flex-col", "md:peer-data-[variant=inset]:wu-m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:wu-ml-2 md:peer-data-[variant=inset]:wu-ml-0 md:peer-data-[variant=inset]:wu-rounded-xl md:peer-data-[variant=inset]:wu-shadow", e),
|
|
4266
4287
|
...t
|
|
4267
4288
|
}));
|
|
4268
|
-
|
|
4269
|
-
var
|
|
4289
|
+
ma.displayName = "SidebarInset";
|
|
4290
|
+
var ha = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y(Zi, {
|
|
4270
4291
|
ref: n,
|
|
4271
4292
|
"data-sidebar": "input",
|
|
4272
4293
|
className: K("wu-h-8 wu-w-full wu-shadow-none focus-visible:wu-ring-2", e),
|
|
4273
4294
|
...t
|
|
4274
4295
|
}));
|
|
4275
|
-
|
|
4276
|
-
var
|
|
4296
|
+
ha.displayName = "SidebarInput";
|
|
4297
|
+
var ga = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("div", {
|
|
4277
4298
|
ref: n,
|
|
4278
4299
|
"data-sidebar": "header",
|
|
4279
4300
|
className: K("wu-flex wu-flex-col wu-gap-2 wu-p-2", e),
|
|
4280
4301
|
...t
|
|
4281
4302
|
}));
|
|
4282
|
-
|
|
4283
|
-
var
|
|
4303
|
+
ga.displayName = "SidebarHeader";
|
|
4304
|
+
var _a = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("div", {
|
|
4284
4305
|
ref: n,
|
|
4285
4306
|
"data-sidebar": "footer",
|
|
4286
4307
|
className: K("wu-flex wu-flex-col wu-gap-2 wu-pb-2", e),
|
|
4287
4308
|
...t
|
|
4288
4309
|
}));
|
|
4289
|
-
|
|
4290
|
-
var
|
|
4310
|
+
_a.displayName = "SidebarFooter";
|
|
4311
|
+
var va = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y(Qi, {
|
|
4291
4312
|
ref: n,
|
|
4292
4313
|
"data-sidebar": "separator",
|
|
4293
4314
|
className: K("wu-mx-2 wu-w-auto", e),
|
|
4294
4315
|
...t
|
|
4295
4316
|
}));
|
|
4296
|
-
|
|
4297
|
-
var
|
|
4317
|
+
va.displayName = "SidebarSeparator";
|
|
4318
|
+
var ya = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("div", {
|
|
4298
4319
|
ref: n,
|
|
4299
4320
|
"data-sidebar": "content",
|
|
4300
4321
|
className: K("wu-flex wu-min-h-0 wu-flex-1 wu-flex-col wu-gap-2 wu-overflow-auto group-data-[collapsible=icon]:wu-overflow-hidden", e),
|
|
4301
4322
|
...t
|
|
4302
4323
|
}));
|
|
4303
|
-
|
|
4304
|
-
var
|
|
4324
|
+
ya.displayName = "SidebarContent";
|
|
4325
|
+
var ba = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("div", {
|
|
4305
4326
|
ref: n,
|
|
4306
4327
|
"data-sidebar": "group",
|
|
4307
4328
|
className: K("wu-relative wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-p-2", e),
|
|
4308
4329
|
...t
|
|
4309
4330
|
}));
|
|
4310
|
-
|
|
4311
|
-
var
|
|
4331
|
+
ba.displayName = "SidebarGroup";
|
|
4332
|
+
var xa = t.forwardRef(({ className: e, asChild: t = !1, ...n }, r) => /* @__PURE__ */ y(t ? ce : "div", {
|
|
4312
4333
|
ref: r,
|
|
4313
4334
|
"data-sidebar": "group-label",
|
|
4314
4335
|
className: K("wu-flex wu-h-8 wu-shrink-0 wu-items-center wu-rounded-md wu-px-2 wu-text-xs wu-font-medium wu-outline-none wu-transition-[margin,opacity] wu-duration-150 wu-ease-linear focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0", "group-data-[collapsible=icon]:wu-opacity-0", e),
|
|
4315
4336
|
...n
|
|
4316
4337
|
}));
|
|
4317
|
-
|
|
4318
|
-
var
|
|
4338
|
+
xa.displayName = "SidebarGroupLabel";
|
|
4339
|
+
var Sa = t.forwardRef(({ className: e, asChild: t = !1, ...n }, r) => /* @__PURE__ */ y(t ? ce : "button", {
|
|
4319
4340
|
ref: r,
|
|
4320
4341
|
"data-sidebar": "group-action",
|
|
4321
4342
|
className: K("wu-absolute wu-right-3 wu-top-3.5 wu-flex wu-aspect-square wu-w-5 wu-items-center wu-justify-center wu-rounded-md wu-p-0 wu-outline-none wu-transition-transform focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0", "after:wu-absolute after:wu-inset-2 after:md:wu-hidden", "group-data-[collapsible=icon]:wu-hidden", e),
|
|
4322
4343
|
...n
|
|
4323
4344
|
}));
|
|
4324
|
-
|
|
4325
|
-
var
|
|
4345
|
+
Sa.displayName = "SidebarGroupAction";
|
|
4346
|
+
var Ca = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("div", {
|
|
4326
4347
|
ref: n,
|
|
4327
4348
|
"data-sidebar": "group-content",
|
|
4328
4349
|
className: K("wu-w-full wu-text-sm", e),
|
|
4329
4350
|
...t
|
|
4330
4351
|
}));
|
|
4331
|
-
|
|
4332
|
-
var
|
|
4352
|
+
Ca.displayName = "SidebarGroupContent";
|
|
4353
|
+
var wa = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("ul", {
|
|
4333
4354
|
ref: n,
|
|
4334
4355
|
"data-sidebar": "menu",
|
|
4335
4356
|
className: K("wu-flex wu-w-full wu-min-w-0 wu-flex-col wu-gap-1", e),
|
|
4336
4357
|
...t
|
|
4337
4358
|
}));
|
|
4338
|
-
|
|
4339
|
-
var
|
|
4359
|
+
wa.displayName = "SidebarMenu";
|
|
4360
|
+
var Ta = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("li", {
|
|
4340
4361
|
ref: n,
|
|
4341
4362
|
"data-sidebar": "menu-item",
|
|
4342
4363
|
className: K("wu-group/menu-item wu-relative", e),
|
|
4343
4364
|
...t
|
|
4344
4365
|
}));
|
|
4345
|
-
|
|
4346
|
-
var
|
|
4366
|
+
Ta.displayName = "SidebarMenuItem";
|
|
4367
|
+
var Ea = z("wu-peer/menu-button wu-flex wu-w-full wu-items-center wu-gap-2 wu-overflow-hidden wu-rounded-md wu-p-2 wu-text-left wu-text-sm wu-outline-none wu-transition-[width,height,padding] focus-visible:wu-ring-2 disabled:wu-pointer-events-none disabled:wu-opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:wu-pr-8 aria-disabled:wu-pointer-events-none aria-disabled:wu-opacity-50 data-[active=true]:wu-font-medium group-data-[collapsible=icon]:!wu-size-8 group-data-[collapsible=icon]:!wu-p-2 [&>span:last-child]:wu-truncate [&>svg]:wu-size-4 [&>svg]:wu-shrink-0", {
|
|
4347
4368
|
variants: {
|
|
4348
4369
|
variant: {
|
|
4349
4370
|
default: "",
|
|
@@ -4359,13 +4380,13 @@ var Sa = z("wu-peer/menu-button wu-flex wu-w-full wu-items-center wu-gap-2 wu-ov
|
|
|
4359
4380
|
variant: "default",
|
|
4360
4381
|
size: "default"
|
|
4361
4382
|
}
|
|
4362
|
-
}),
|
|
4363
|
-
let c = e ? ce : "button", { isMobile: l, state: u } =
|
|
4383
|
+
}), Da = t.forwardRef(({ asChild: e = !1, isActive: t = !1, variant: n = "default", size: r = "default", tooltip: i, className: a, ...o }, s) => {
|
|
4384
|
+
let c = e ? ce : "button", { isMobile: l, state: u } = la(), d = /* @__PURE__ */ y(c, {
|
|
4364
4385
|
ref: s,
|
|
4365
4386
|
"data-sidebar": "menu-button",
|
|
4366
4387
|
"data-size": r,
|
|
4367
4388
|
"data-active": t,
|
|
4368
|
-
className: K(
|
|
4389
|
+
className: K(Ea({
|
|
4369
4390
|
variant: n,
|
|
4370
4391
|
size: r
|
|
4371
4392
|
}), a),
|
|
@@ -4381,52 +4402,52 @@ var Sa = z("wu-peer/menu-button wu-flex wu-w-full wu-items-center wu-gap-2 wu-ov
|
|
|
4381
4402
|
...i
|
|
4382
4403
|
})] })) : d;
|
|
4383
4404
|
});
|
|
4384
|
-
|
|
4385
|
-
var
|
|
4405
|
+
Da.displayName = "SidebarMenuButton";
|
|
4406
|
+
var Oa = t.forwardRef(({ className: e, asChild: t = !1, showOnHover: n = !1, ...r }, i) => /* @__PURE__ */ y(t ? ce : "button", {
|
|
4386
4407
|
ref: i,
|
|
4387
4408
|
"data-sidebar": "menu-action",
|
|
4388
4409
|
className: K("wu-absolute wu-right-1 wu-top-1.5 wu-flex wu-aspect-square wu-w-5 wu-items-center wu-justify-center wu-rounded-md wu-p-0 wu-outline-none wu-transition-transform focus-visible:wu-ring-2 [&>svg]:wu-size-4 [&>svg]:wu-shrink-0", "after:wu-absolute after:wu-inset-2 after:md:wu-hidden", "peer-data-[size=sm]/menu-button:wu-top-1", "peer-data-[size=default]/menu-button:wu-top-1.5", "peer-data-[size=lg]/menu-button:wu-top-2.5", "group-data-[collapsible=icon]:wu-hidden", n && "group-focus-within/menu-item:wu-opacity-100 group-hover/menu-item:wu-opacity-100 data-[state=open]:wu-opacity-100 md:wu-opacity-0", e),
|
|
4389
4410
|
...r
|
|
4390
4411
|
}));
|
|
4391
|
-
|
|
4392
|
-
var
|
|
4412
|
+
Oa.displayName = "SidebarMenuAction";
|
|
4413
|
+
var ka = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("div", {
|
|
4393
4414
|
ref: n,
|
|
4394
4415
|
"data-sidebar": "menu-badge",
|
|
4395
4416
|
className: K("wu-pointer-events-none wu-absolute wu-right-1 wu-flex wu-h-5 wu-min-w-5 wu-select-none wu-items-center wu-justify-center wu-rounded-md wu-px-1 wu-text-xs wu-font-medium wu-tabular-nums", "", "peer-data-[size=sm]/menu-button:wu-top-1", "peer-data-[size=default]/menu-button:wu-top-1.5", "peer-data-[size=lg]/menu-button:wu-top-2.5", "group-data-[collapsible=icon]:wu-hidden", e),
|
|
4396
4417
|
...t
|
|
4397
4418
|
}));
|
|
4398
|
-
|
|
4399
|
-
var
|
|
4419
|
+
ka.displayName = "SidebarMenuBadge";
|
|
4420
|
+
var Aa = t.forwardRef(({ className: e, showIcon: n = !1, ...r }, i) => {
|
|
4400
4421
|
let a = t.useMemo(() => `${Math.floor(Math.random() * 40) + 50}%`, []);
|
|
4401
4422
|
return /* @__PURE__ */ b("div", {
|
|
4402
4423
|
ref: i,
|
|
4403
4424
|
"data-sidebar": "menu-skeleton",
|
|
4404
4425
|
className: K("wu-flex wu-h-8 wu-items-center wu-gap-2 wu-rounded-md wu-px-2", e),
|
|
4405
4426
|
...r,
|
|
4406
|
-
children: [n && /* @__PURE__ */ y(
|
|
4427
|
+
children: [n && /* @__PURE__ */ y($i, {
|
|
4407
4428
|
className: "wu-rounded-md wu-size-4",
|
|
4408
4429
|
"data-sidebar": "menu-skeleton-icon"
|
|
4409
|
-
}), /* @__PURE__ */ y(
|
|
4430
|
+
}), /* @__PURE__ */ y($i, {
|
|
4410
4431
|
className: "wu-h-4 wu-max-w-[--skeleton-width] wu-flex-1",
|
|
4411
4432
|
"data-sidebar": "menu-skeleton-text",
|
|
4412
4433
|
style: { "--skeleton-width": a }
|
|
4413
4434
|
})]
|
|
4414
4435
|
});
|
|
4415
4436
|
});
|
|
4416
|
-
|
|
4417
|
-
var
|
|
4437
|
+
Aa.displayName = "SidebarMenuSkeleton";
|
|
4438
|
+
var ja = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("ul", {
|
|
4418
4439
|
ref: n,
|
|
4419
4440
|
"data-sidebar": "menu-sub",
|
|
4420
4441
|
className: K("wu-mx-3.5 wu-flex wu-min-w-0 wu-translate-x-px wu-flex-col wu-gap-1 wu-border-l wu-px-2.5 wu-py-0.5", "group-data-[collapsible=icon]:wu-hidden", e),
|
|
4421
4442
|
...t
|
|
4422
4443
|
}));
|
|
4423
|
-
|
|
4424
|
-
var
|
|
4444
|
+
ja.displayName = "SidebarMenuSub";
|
|
4445
|
+
var Ma = t.forwardRef(({ ...e }, t) => /* @__PURE__ */ y("li", {
|
|
4425
4446
|
ref: t,
|
|
4426
4447
|
...e
|
|
4427
4448
|
}));
|
|
4428
|
-
|
|
4429
|
-
var
|
|
4449
|
+
Ma.displayName = "SidebarMenuSubItem";
|
|
4450
|
+
var Na = t.forwardRef(({ asChild: e = !1, size: t = "md", isActive: n, className: r, ...i }, a) => /* @__PURE__ */ y(e ? ce : "a", {
|
|
4430
4451
|
ref: a,
|
|
4431
4452
|
"data-sidebar": "menu-sub-button",
|
|
4432
4453
|
"data-size": t,
|
|
@@ -4434,39 +4455,39 @@ var ka = t.forwardRef(({ asChild: e = !1, size: t = "md", isActive: n, className
|
|
|
4434
4455
|
className: K("wu-flex wu-h-7 wu-min-w-0 wu-translate-x-px wu-items-center wu-gap-2 wu-overflow-hidden wu-rounded-md wu-px-2 wu-outline-none focus-visible:wu-ring-2 disabled:wu-pointer-events-none disabled:wu-opacity-50 aria-disabled:wu-pointer-events-none aria-disabled:wu-opacity-50 [&>span:last-child]:wu-truncate [&>svg]:wu-size-4 [&>svg]:wu-shrink-0", "data-[active=true]:wu-bg-sidebar-accent data-[active=true]:wu-text-sidebar-accent-foreground", t === "sm" && "wu-text-xs", t === "md" && "wu-text-sm", "group-data-[collapsible=icon]:wu-hidden", r),
|
|
4435
4456
|
...i
|
|
4436
4457
|
}));
|
|
4437
|
-
|
|
4458
|
+
Na.displayName = "SidebarMenuSubButton";
|
|
4438
4459
|
//#endregion
|
|
4439
4460
|
//#region src/components/sidebar/WuSidebar.tsx
|
|
4440
|
-
var
|
|
4461
|
+
var Pa = ({ children: e, Sidebar: t, className: n, defaultOpen: r = !0, open: i, onOpenChange: a, style: o }) => /* @__PURE__ */ b(ua, {
|
|
4441
4462
|
defaultOpen: r,
|
|
4442
4463
|
open: i,
|
|
4443
4464
|
onOpenChange: a,
|
|
4444
|
-
children: [/* @__PURE__ */ b(
|
|
4465
|
+
children: [/* @__PURE__ */ b(da, {
|
|
4445
4466
|
variant: "sidebar",
|
|
4446
4467
|
collapsible: "icon",
|
|
4447
4468
|
className: K("wu-top-12 wu-h-[calc(100%-48px)] wu-shadow-sidebar wu-border-none", n),
|
|
4448
4469
|
style: o,
|
|
4449
4470
|
role: "complementary",
|
|
4450
|
-
children: [/* @__PURE__ */ y(
|
|
4471
|
+
children: [/* @__PURE__ */ y(ga, {
|
|
4451
4472
|
className: "wu-py-2",
|
|
4452
|
-
children: /* @__PURE__ */ y(
|
|
4473
|
+
children: /* @__PURE__ */ y(Fa, {})
|
|
4453
4474
|
}), t]
|
|
4454
|
-
}), /* @__PURE__ */ y(
|
|
4475
|
+
}), /* @__PURE__ */ y(ma, {
|
|
4455
4476
|
className: "wu-contain-inline-size",
|
|
4456
4477
|
children: e
|
|
4457
4478
|
})]
|
|
4458
|
-
}),
|
|
4459
|
-
let { state: t, isMobile: n, openMobile: r } =
|
|
4460
|
-
return /* @__PURE__ */ y(
|
|
4479
|
+
}), Fa = (e) => {
|
|
4480
|
+
let { state: t, isMobile: n, openMobile: r } = la();
|
|
4481
|
+
return /* @__PURE__ */ y(fa, {
|
|
4461
4482
|
...e,
|
|
4462
|
-
children: /* @__PURE__ */ y(
|
|
4483
|
+
children: /* @__PURE__ */ y(ci, { showMenu: n ? r : t === "expanded" })
|
|
4463
4484
|
});
|
|
4464
|
-
},
|
|
4485
|
+
}, Ia = ({ className: e, children: t, ...n }) => {
|
|
4465
4486
|
let r = p(null), i = p(null), a = ({ currentTarget: e }) => {
|
|
4466
4487
|
let { scrollTop: t, clientHeight: n, scrollHeight: a } = e;
|
|
4467
4488
|
r.current && r.current.classList.toggle("wu-border-[#1b338014]", t !== 0), i.current && i.current.classList.toggle("wu-border-[#1b338014]", t + n !== a);
|
|
4468
4489
|
}, o = "wu-w-[calc(100%-16px)] wu-mx-auto wu-border-transparent";
|
|
4469
|
-
return /* @__PURE__ */ b(
|
|
4490
|
+
return /* @__PURE__ */ b(ya, {
|
|
4470
4491
|
...n,
|
|
4471
4492
|
className: K("wu-overflow-hidden wu-gap-0", e),
|
|
4472
4493
|
children: [
|
|
@@ -4474,7 +4495,7 @@ var Aa = ({ children: e, Sidebar: t, className: n, defaultOpen: r = !0, open: i,
|
|
|
4474
4495
|
className: o,
|
|
4475
4496
|
ref: r
|
|
4476
4497
|
}),
|
|
4477
|
-
/* @__PURE__ */ y(
|
|
4498
|
+
/* @__PURE__ */ y(Ir, {
|
|
4478
4499
|
onScroll: a,
|
|
4479
4500
|
className: "wu-gap-2",
|
|
4480
4501
|
thumbColor: "#b9c3dc",
|
|
@@ -4488,21 +4509,21 @@ var Aa = ({ children: e, Sidebar: t, className: n, defaultOpen: r = !0, open: i,
|
|
|
4488
4509
|
})
|
|
4489
4510
|
]
|
|
4490
4511
|
});
|
|
4491
|
-
},
|
|
4512
|
+
}, La = (e) => /* @__PURE__ */ y(_a, {
|
|
4492
4513
|
...e,
|
|
4493
4514
|
children: e.children
|
|
4494
|
-
}),
|
|
4515
|
+
}), Ra = ({ label: e, children: t, ...n }) => /* @__PURE__ */ b(ba, {
|
|
4495
4516
|
...n,
|
|
4496
4517
|
className: "wu-p-0",
|
|
4497
4518
|
children: [/* @__PURE__ */ y("div", {
|
|
4498
4519
|
className: "wu-h-8",
|
|
4499
|
-
children: /* @__PURE__ */ y(
|
|
4520
|
+
children: /* @__PURE__ */ y(xa, {
|
|
4500
4521
|
className: "wu-items-end wu-px-4 wu-text-xs wu-font-normal wu-leading-4 wu-text-blue-q",
|
|
4501
4522
|
children: e
|
|
4502
4523
|
})
|
|
4503
|
-
}), /* @__PURE__ */ y(
|
|
4504
|
-
}),
|
|
4505
|
-
let { state: o } =
|
|
4524
|
+
}), /* @__PURE__ */ y(Ca, { children: /* @__PURE__ */ y(wa, { children: t }) })]
|
|
4525
|
+
}), za = (e) => /* @__PURE__ */ y(wa, { ...e }), Ba = ({ Icon: e, children: t, className: r, isActive: i, ...a }) => {
|
|
4526
|
+
let { state: o } = la(), [s, c] = n.useState(), l = ta(), u = n.isValidElement(t) ? n.cloneElement(t, { children: /* @__PURE__ */ b("div", {
|
|
4506
4527
|
className: "wu-flex wu-items-center wu-overflow-hidden wu-text-base wu-truncate wu-text-ellipsis",
|
|
4507
4528
|
children: [/* @__PURE__ */ y("div", {
|
|
4508
4529
|
className: "wu-relative wu-right-1",
|
|
@@ -4523,10 +4544,10 @@ var Aa = ({ children: e, Sidebar: t, className: n, defaultOpen: r = !0, open: i,
|
|
|
4523
4544
|
}), d = p(null);
|
|
4524
4545
|
return n.useEffect(() => {
|
|
4525
4546
|
c(d.current?.textContent || "");
|
|
4526
|
-
}, []), /* @__PURE__ */ y(
|
|
4547
|
+
}, []), /* @__PURE__ */ y(Ta, {
|
|
4527
4548
|
...a,
|
|
4528
4549
|
className: "wu-flex wu-items-center wu-gap-2 wu-px-2",
|
|
4529
|
-
children: /* @__PURE__ */ y(
|
|
4550
|
+
children: /* @__PURE__ */ y(Da, {
|
|
4530
4551
|
className: K("wu-flex wu-items-center wu-text-blue-q hover:wu-bg-blue-sidebarHover wu-cursor-pointer wu-h-8 wu-rounded-sm", r, i && "wu-bg-white wu-shadow-[4px_4px_16px_0_#1B338014] wu-font-medium wu-text-blue-p hover:wu-bg-white wu-cursor-default"),
|
|
4531
4552
|
isActive: i,
|
|
4532
4553
|
tooltip: s,
|
|
@@ -4535,11 +4556,11 @@ var Aa = ({ children: e, Sidebar: t, className: n, defaultOpen: r = !0, open: i,
|
|
|
4535
4556
|
children: u
|
|
4536
4557
|
})
|
|
4537
4558
|
});
|
|
4538
|
-
},
|
|
4539
|
-
let { state: a } =
|
|
4559
|
+
}, Va = ({ Title: e, Icon: t, children: n, className: r, ...i }) => {
|
|
4560
|
+
let { state: a } = la(), o = ta();
|
|
4540
4561
|
return /* @__PURE__ */ b(ve.Root, { children: [/* @__PURE__ */ y(ve.Trigger, { render: (n) => {
|
|
4541
4562
|
let r = "data-panel-open" in n;
|
|
4542
|
-
return /* @__PURE__ */ b(
|
|
4563
|
+
return /* @__PURE__ */ b(Ba, {
|
|
4543
4564
|
Icon: t,
|
|
4544
4565
|
...n,
|
|
4545
4566
|
children: [e, (a === "expanded" || o) && /* @__PURE__ */ y(J, {
|
|
@@ -4552,7 +4573,7 @@ var Aa = ({ children: e, Sidebar: t, className: n, defaultOpen: r = !0, open: i,
|
|
|
4552
4573
|
...i,
|
|
4553
4574
|
children: n
|
|
4554
4575
|
})] });
|
|
4555
|
-
},
|
|
4576
|
+
}, Ha = new Map([
|
|
4556
4577
|
[-3, {
|
|
4557
4578
|
top: -20,
|
|
4558
4579
|
left: -4,
|
|
@@ -4606,14 +4627,14 @@ var Aa = ({ children: e, Sidebar: t, className: n, defaultOpen: r = !0, open: i,
|
|
|
4606
4627
|
transition: "all 0.3s ease-in-out, z-index 0.3s 0.10s",
|
|
4607
4628
|
position: "absolute"
|
|
4608
4629
|
}]
|
|
4609
|
-
]),
|
|
4630
|
+
]), Ua = (e, t, n = 1) => {
|
|
4610
4631
|
let r = e.match(/hsla?\(\s*([\d.]+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*([\d.]+)\s*)?\)/);
|
|
4611
4632
|
if (!r) throw Error("Invalid HSL color format");
|
|
4612
4633
|
return `hsl(${parseFloat(r[1])} ${parseFloat(r[2])}% ${Math.max(0, parseFloat(r[3]) + t)}% / ${n})`;
|
|
4613
|
-
},
|
|
4634
|
+
}, Wa = ({ index: e, viewIndex: t, length: n, itemHeight: r }) => {
|
|
4614
4635
|
let i = (e - t + n) % n, a;
|
|
4615
4636
|
a = i === 0 ? 0 : i === n - 1 && n >= 2 ? -1 : i === n - 2 && n >= 3 ? -2 : i === 1 ? 1 : i === 2 ? 2 : i === n - 3 && n >= 4 ? -3 : 3;
|
|
4616
|
-
let o =
|
|
4637
|
+
let o = Ha.get(a) || {}, s = a > 0 ? r + 28 + (a - 1) * 20 : o.top;
|
|
4617
4638
|
return {
|
|
4618
4639
|
position: a,
|
|
4619
4640
|
styles: {
|
|
@@ -4622,7 +4643,7 @@ var Aa = ({ children: e, Sidebar: t, className: n, defaultOpen: r = !0, open: i,
|
|
|
4622
4643
|
height: a > 0 ? "32px" : r
|
|
4623
4644
|
}
|
|
4624
4645
|
};
|
|
4625
|
-
},
|
|
4646
|
+
}, Ga = {
|
|
4626
4647
|
LIGHTNESS_STEP: 8,
|
|
4627
4648
|
BORDER_LIGHTNESS: 10,
|
|
4628
4649
|
CONTENT_LIGHTNESS: 45,
|
|
@@ -4630,21 +4651,21 @@ var Aa = ({ children: e, Sidebar: t, className: n, defaultOpen: r = !0, open: i,
|
|
|
4630
4651
|
FONT_SIZE_ACTIVE: "14px",
|
|
4631
4652
|
FONT_SIZE_INACTIVE: "12px",
|
|
4632
4653
|
HEADER_HEIGHT: "2rem"
|
|
4633
|
-
},
|
|
4654
|
+
}, Ka = ({ children: e, className: t, header: n, baseColor: r, position: i = 0, style: a, ...o }) => {
|
|
4634
4655
|
let s = i <= 0, c = i === 0, l = {
|
|
4635
|
-
border: c ? `4px solid ${
|
|
4656
|
+
border: c ? `4px solid ${Ua(r, Ga.BORDER_LIGHTNESS)}` : "",
|
|
4636
4657
|
...a
|
|
4637
4658
|
}, u = {
|
|
4638
|
-
backgroundColor:
|
|
4639
|
-
fontSize: c ?
|
|
4659
|
+
backgroundColor: Ua(r, i * Ga.LIGHTNESS_STEP),
|
|
4660
|
+
fontSize: c ? Ga.FONT_SIZE_ACTIVE : Ga.FONT_SIZE_INACTIVE,
|
|
4640
4661
|
transition: "all 0.3s ease",
|
|
4641
4662
|
position: "relative",
|
|
4642
4663
|
bottom: i < 0 ? "4px" : "0px",
|
|
4643
4664
|
height: "32px",
|
|
4644
4665
|
padding: "4px 8px"
|
|
4645
4666
|
}, d = {
|
|
4646
|
-
backgroundColor:
|
|
4647
|
-
height:
|
|
4667
|
+
backgroundColor: Ua(r, 45 + i * 6),
|
|
4668
|
+
height: Ga.CONTENT_HEIGHT,
|
|
4648
4669
|
position: "relative",
|
|
4649
4670
|
bottom: i < 0 ? "4px" : "0px"
|
|
4650
4671
|
};
|
|
@@ -4662,28 +4683,28 @@ var Aa = ({ children: e, Sidebar: t, className: n, defaultOpen: r = !0, open: i,
|
|
|
4662
4683
|
children: e
|
|
4663
4684
|
})]
|
|
4664
4685
|
});
|
|
4665
|
-
},
|
|
4686
|
+
}, qa = ({ children: e, Trigger: t, Header: n, styles: r = {}, classNames: i = {}, open: a, onOpenChange: o, itemHeight: s }) => {
|
|
4666
4687
|
let c = {
|
|
4667
4688
|
height: s,
|
|
4668
4689
|
...r.Trigger
|
|
4669
4690
|
};
|
|
4670
|
-
return /* @__PURE__ */ b(
|
|
4691
|
+
return /* @__PURE__ */ b(pi, {
|
|
4671
4692
|
open: a,
|
|
4672
4693
|
onOpenChange: o,
|
|
4673
|
-
children: [/* @__PURE__ */ y(
|
|
4694
|
+
children: [/* @__PURE__ */ y(mi, {
|
|
4674
4695
|
className: K("wu-bg-gray-25 wu-z-0 wu-w-full wu-rounded-lg wu-rounded-tl-none wu-relative", i.Trigger),
|
|
4675
4696
|
style: c,
|
|
4676
4697
|
children: /* @__PURE__ */ y("span", {
|
|
4677
4698
|
className: "wu-absolute wu-text-xs wu-font-medium wu-bg-gray-25 -wu-top-6 wu-left-0 wu-p-1 wu-rounded-t-lg",
|
|
4678
4699
|
children: t
|
|
4679
4700
|
})
|
|
4680
|
-
}), /* @__PURE__ */ b(
|
|
4701
|
+
}), /* @__PURE__ */ b(vi, {
|
|
4681
4702
|
className: K("wu-top-[50%] wu-left-[50%] wu-bg-black/75 wu-backdrop-blur-[4px] wu-min-h-full wu-overflow-auto wu-shadow-none wu-max-w-none wu-border-none wu-text-white", i.Content),
|
|
4682
4703
|
hideCloseButton: !0,
|
|
4683
4704
|
isStackedCard: !0,
|
|
4684
4705
|
style: r.Content,
|
|
4685
4706
|
children: [
|
|
4686
|
-
/* @__PURE__ */ y(
|
|
4707
|
+
/* @__PURE__ */ y(xi, {}),
|
|
4687
4708
|
/* @__PURE__ */ y(se, {
|
|
4688
4709
|
className: K("wu-absolute wu-right-2 wu-top-2 wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-z-10", i.CloseButton),
|
|
4689
4710
|
style: r.CloseButton,
|
|
@@ -4693,7 +4714,7 @@ var Aa = ({ children: e, Sidebar: t, className: n, defaultOpen: r = !0, open: i,
|
|
|
4693
4714
|
className: "wu-text-lg wu-m-4 wu-cursor-pointer"
|
|
4694
4715
|
})
|
|
4695
4716
|
}),
|
|
4696
|
-
n && /* @__PURE__ */ y(
|
|
4717
|
+
n && /* @__PURE__ */ y(yi, {
|
|
4697
4718
|
className: K("wu-h-12 wu-p-2 wu-pl-4 wu-bg-white/25 wu-backdrop-blur-[24px]", i.Header),
|
|
4698
4719
|
style: r.Header,
|
|
4699
4720
|
children: n
|
|
@@ -4702,7 +4723,7 @@ var Aa = ({ children: e, Sidebar: t, className: n, defaultOpen: r = !0, open: i,
|
|
|
4702
4723
|
]
|
|
4703
4724
|
})]
|
|
4704
4725
|
});
|
|
4705
|
-
},
|
|
4726
|
+
}, Ja = { wuStepper: "_wuStepper_ejzqx_1" }, Ya = ({ onChange: e, Label: n, defaultValue: r = 0, readonly: i, dir: a, step: o = 1, min: s, max: c, value: l, className: u, labelPosition: d = "left", disabled: f, resetInvalidValueOnBlur: p = !0, ...m }) => {
|
|
4706
4727
|
let h = t.useId(), [g, _] = t.useState(l === void 0 ? r || 0 : Number(l));
|
|
4707
4728
|
t.useEffect(() => {
|
|
4708
4729
|
l !== void 0 && _(Number(l));
|
|
@@ -4731,7 +4752,7 @@ var Aa = ({ children: e, Sidebar: t, className: n, defaultOpen: r = !0, open: i,
|
|
|
4731
4752
|
readOnly: i,
|
|
4732
4753
|
onValueChange: (e) => typeof e == "number" && v(e),
|
|
4733
4754
|
dir: a,
|
|
4734
|
-
className: K("wu-flex wu-stepper", a === "rtl" && d !== "top" && "wu-gap-2",
|
|
4755
|
+
className: K("wu-flex wu-stepper", a === "rtl" && d !== "top" && "wu-gap-2", Ja.wuStepper, Xa({ labelPosition: d }), u),
|
|
4735
4756
|
children: [n && /* @__PURE__ */ y(Z, {
|
|
4736
4757
|
htmlFor: h,
|
|
4737
4758
|
className: "wu-input-label",
|
|
@@ -4771,7 +4792,7 @@ var Aa = ({ children: e, Sidebar: t, className: n, defaultOpen: r = !0, open: i,
|
|
|
4771
4792
|
]
|
|
4772
4793
|
})]
|
|
4773
4794
|
});
|
|
4774
|
-
},
|
|
4795
|
+
}, Xa = z("wu-flex wu-w-fit", { variants: { labelPosition: {
|
|
4775
4796
|
left: "wu-flex-row wu-text-right wu-gap-2 wu-items-center",
|
|
4776
4797
|
top: "wu-flex-col"
|
|
4777
4798
|
} } }), $ = {
|
|
@@ -4787,7 +4808,7 @@ var Aa = ({ children: e, Sidebar: t, className: n, defaultOpen: r = !0, open: i,
|
|
|
4787
4808
|
icon: "_icon_1mgpg_50",
|
|
4788
4809
|
sharedWrapper: "_sharedWrapper_1mgpg_54",
|
|
4789
4810
|
emptyState: "_emptyState_1mgpg_63"
|
|
4790
|
-
},
|
|
4811
|
+
}, Za = n.memo(({ className: e, label: t = "Shared surveys", ...n }) => /* @__PURE__ */ b("button", {
|
|
4791
4812
|
className: K($.sharedWrapper, e),
|
|
4792
4813
|
"data-slot": "survey-select-shared",
|
|
4793
4814
|
"aria-label": t,
|
|
@@ -4797,10 +4818,10 @@ var Aa = ({ children: e, Sidebar: t, className: n, defaultOpen: r = !0, open: i,
|
|
|
4797
4818
|
"aria-hidden": "true"
|
|
4798
4819
|
}), /* @__PURE__ */ y("span", { children: t })]
|
|
4799
4820
|
}));
|
|
4800
|
-
|
|
4821
|
+
Za.displayName = "WuSharedSurvey";
|
|
4801
4822
|
//#endregion
|
|
4802
4823
|
//#region src/components/surveySelect/subComponents/WuSurveyItem.tsx
|
|
4803
|
-
var
|
|
4824
|
+
var Qa = (e, t = !1) => {
|
|
4804
4825
|
if (e) return /* @__PURE__ */ y("span", {
|
|
4805
4826
|
className: $.icon,
|
|
4806
4827
|
"aria-hidden": "true",
|
|
@@ -4811,34 +4832,34 @@ var Ja = (e, t = !1) => {
|
|
|
4811
4832
|
className: K($.icon, n),
|
|
4812
4833
|
"aria-hidden": "true"
|
|
4813
4834
|
});
|
|
4814
|
-
},
|
|
4835
|
+
}, $a = n.memo(({ children: e, icon: t, isActive: n, isShared: r, className: i, ...a }) => /* @__PURE__ */ b("button", {
|
|
4815
4836
|
className: K($.listItem, n && $.listItemActive, i),
|
|
4816
4837
|
"aria-selected": n,
|
|
4817
4838
|
"data-slot": "survey-select-item",
|
|
4818
4839
|
type: "button",
|
|
4819
4840
|
...a,
|
|
4820
|
-
children: [
|
|
4841
|
+
children: [Qa(t, r), /* @__PURE__ */ y("span", {
|
|
4821
4842
|
className: $.label,
|
|
4822
4843
|
children: e
|
|
4823
4844
|
})]
|
|
4824
4845
|
}));
|
|
4825
|
-
|
|
4846
|
+
$a.displayName = "WuSurveyItem";
|
|
4826
4847
|
//#endregion
|
|
4827
4848
|
//#region src/components/surveySelect/subComponents/WuSurveyList.tsx
|
|
4828
|
-
var
|
|
4849
|
+
var eo = n.memo(({ children: e, className: t, ...n }) => /* @__PURE__ */ y("div", {
|
|
4829
4850
|
className: K($.list, t),
|
|
4830
4851
|
...n,
|
|
4831
4852
|
children: e
|
|
4832
4853
|
}));
|
|
4833
|
-
|
|
4854
|
+
eo.displayName = "WuSurveyList";
|
|
4834
4855
|
//#endregion
|
|
4835
4856
|
//#region src/components/surveySelect/subComponents/WuSurveySource.tsx
|
|
4836
|
-
var
|
|
4857
|
+
var to = (e) => {
|
|
4837
4858
|
let { className: t, variant: n = "outlined", ...r } = e;
|
|
4838
4859
|
return /* @__PURE__ */ y("div", {
|
|
4839
4860
|
className: $.sourceWrapper,
|
|
4840
4861
|
"data-slot": "survey-select-source",
|
|
4841
|
-
children: /* @__PURE__ */ y(
|
|
4862
|
+
children: /* @__PURE__ */ y(si, {
|
|
4842
4863
|
variant: n,
|
|
4843
4864
|
showGroupSeparator: !0,
|
|
4844
4865
|
className: K($.source, t),
|
|
@@ -4846,8 +4867,8 @@ var Za = (e) => {
|
|
|
4846
4867
|
})
|
|
4847
4868
|
});
|
|
4848
4869
|
};
|
|
4849
|
-
|
|
4850
|
-
var
|
|
4870
|
+
to.displayName = "WuSurveySource";
|
|
4871
|
+
var no = n.memo(to), ro = n.memo(({ Sidebar: e, children: t, className: n, ...r }) => /* @__PURE__ */ b("div", {
|
|
4851
4872
|
className: K($.container, n),
|
|
4852
4873
|
role: "region",
|
|
4853
4874
|
"aria-label": "Survey selection interface",
|
|
@@ -4866,10 +4887,10 @@ var Qa = n.memo(Za), $a = n.memo(({ Sidebar: e, children: t, className: n, ...r
|
|
|
4866
4887
|
children: t
|
|
4867
4888
|
})]
|
|
4868
4889
|
}));
|
|
4869
|
-
|
|
4890
|
+
ro.displayName = "WuSurveySelect";
|
|
4870
4891
|
//#endregion
|
|
4871
4892
|
//#region src/base/ui/toggle.tsx
|
|
4872
|
-
var
|
|
4893
|
+
var io = z("wu-inline-flex wu-items-center wu-justify-center wu-text-sm wu-font-medium wu-ring-offset-background wu-transition-colors hover:wu-bg-muted hover:wu-text-muted-foreground focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-2 disabled:wu-cursor-not-allowed disabled:wu-opacity-80", {
|
|
4873
4894
|
variants: {
|
|
4874
4895
|
variant: {
|
|
4875
4896
|
default: "wu-bg-transparent",
|
|
@@ -4885,26 +4906,26 @@ var eo = z("wu-inline-flex wu-items-center wu-justify-center wu-text-sm wu-font-
|
|
|
4885
4906
|
variant: "default",
|
|
4886
4907
|
size: "default"
|
|
4887
4908
|
}
|
|
4888
|
-
}),
|
|
4909
|
+
}), ao = t.forwardRef(({ className: e, variant: t, size: n, ...r }, i) => /* @__PURE__ */ y(xe.Root, {
|
|
4889
4910
|
ref: i,
|
|
4890
|
-
className: K(
|
|
4911
|
+
className: K(io({
|
|
4891
4912
|
variant: t,
|
|
4892
4913
|
size: n,
|
|
4893
4914
|
className: e
|
|
4894
4915
|
})),
|
|
4895
4916
|
...r
|
|
4896
4917
|
}));
|
|
4897
|
-
|
|
4918
|
+
ao.displayName = xe.Root.displayName;
|
|
4898
4919
|
//#endregion
|
|
4899
4920
|
//#region src/base/ui/toggleGroup.tsx
|
|
4900
|
-
var
|
|
4921
|
+
var oo = t.createContext({
|
|
4901
4922
|
size: "default",
|
|
4902
4923
|
variant: "default"
|
|
4903
|
-
}),
|
|
4924
|
+
}), so = t.forwardRef(({ className: e, variant: t, size: n, children: r, ...i }, a) => /* @__PURE__ */ y(be.Root, {
|
|
4904
4925
|
ref: a,
|
|
4905
4926
|
className: K("wu-flex wu-items-center wu-justify-center wu-gap-1", e),
|
|
4906
4927
|
...i,
|
|
4907
|
-
children: /* @__PURE__ */ y(
|
|
4928
|
+
children: /* @__PURE__ */ y(oo.Provider, {
|
|
4908
4929
|
value: {
|
|
4909
4930
|
variant: t,
|
|
4910
4931
|
size: n
|
|
@@ -4912,12 +4933,12 @@ var no = t.createContext({
|
|
|
4912
4933
|
children: r
|
|
4913
4934
|
})
|
|
4914
4935
|
}));
|
|
4915
|
-
|
|
4916
|
-
var
|
|
4917
|
-
let s = t.useContext(
|
|
4936
|
+
so.displayName = be.Root.displayName;
|
|
4937
|
+
var co = t.forwardRef(({ className: e, children: n, variant: r, size: i, ...a }, o) => {
|
|
4938
|
+
let s = t.useContext(oo);
|
|
4918
4939
|
return /* @__PURE__ */ y(be.Item, {
|
|
4919
4940
|
ref: o,
|
|
4920
|
-
className: K(
|
|
4941
|
+
className: K(io({
|
|
4921
4942
|
variant: s.variant || r,
|
|
4922
4943
|
size: s.size || i
|
|
4923
4944
|
}), e),
|
|
@@ -4925,12 +4946,12 @@ var io = t.forwardRef(({ className: e, children: n, variant: r, size: i, ...a },
|
|
|
4925
4946
|
children: n
|
|
4926
4947
|
});
|
|
4927
4948
|
});
|
|
4928
|
-
|
|
4949
|
+
co.displayName = be.Item.displayName;
|
|
4929
4950
|
//#endregion
|
|
4930
4951
|
//#region src/components/switcher/ui/_iconTab.tsx
|
|
4931
|
-
var
|
|
4952
|
+
var lo = n.forwardRef((e, t) => {
|
|
4932
4953
|
let { options: n, value: r, disabled: i, dir: a, onChange: o } = e, s = (e) => K("wu-w-8 wu-h-8 wu-text-xl wu-leading-5 wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-p-0 wu-flex wu-items-center wu-justify-center", i && "wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead", e === r && "wu-text-white", i && r === e && "wu-text-gray-lead", "wu-switcher-icon-tab-item");
|
|
4933
|
-
return /* @__PURE__ */ y(v, { children: /* @__PURE__ */ b(
|
|
4954
|
+
return /* @__PURE__ */ y(v, { children: /* @__PURE__ */ b(so, {
|
|
4934
4955
|
ref: t,
|
|
4935
4956
|
type: "single",
|
|
4936
4957
|
value: r,
|
|
@@ -4943,12 +4964,12 @@ var ao = n.forwardRef((e, t) => {
|
|
|
4943
4964
|
role: "slider",
|
|
4944
4965
|
className: K("wu-absolute wu-z-0 wu-w-8 wu-h-8 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out", r === "opt1" && "", r === "opt2" && a !== "rtl" && "wu-translate-x-full", r === "opt2" && a === "rtl" && "-wu-translate-x-full", i && "wu-bg-gray-40", "wu-switcher-icon-tab-slider")
|
|
4945
4966
|
}),
|
|
4946
|
-
/* @__PURE__ */ y(
|
|
4967
|
+
/* @__PURE__ */ y(co, {
|
|
4947
4968
|
value: "opt1",
|
|
4948
4969
|
className: s("opt1"),
|
|
4949
4970
|
children: n[0].label
|
|
4950
4971
|
}),
|
|
4951
|
-
/* @__PURE__ */ y(
|
|
4972
|
+
/* @__PURE__ */ y(co, {
|
|
4952
4973
|
value: "opt2",
|
|
4953
4974
|
className: s("opt2"),
|
|
4954
4975
|
children: n[1].label
|
|
@@ -4956,12 +4977,12 @@ var ao = n.forwardRef((e, t) => {
|
|
|
4956
4977
|
]
|
|
4957
4978
|
}) });
|
|
4958
4979
|
});
|
|
4959
|
-
|
|
4980
|
+
lo.displayName = "_IconTab";
|
|
4960
4981
|
//#endregion
|
|
4961
4982
|
//#region src/components/switcher/ui/_tab.tsx
|
|
4962
|
-
var
|
|
4983
|
+
var uo = n.forwardRef((e, t) => {
|
|
4963
4984
|
let { options: n, value: r, disabled: i, dir: a, size: o = "md", onChange: s } = e, c = (e) => K("wu-w-1/2 wu-text-xs wu-rounded-full wu-text-gray-lead wu-relative wu-z-10 wu-font-normal", i && "wu-cursor-not-allowed data-[state=on]:wu-text-gray-lead", o === "sm" && "wu-h-6 wu-min-w-20", o === "md" && "wu-h-8 wu-min-w-28", o === "lg" && "wu-h-10 wu-min-w-36", e === r && "wu-text-white wu-font-medium", i && r === e && "wu-text-gray-lead", "wu-switcher-tab-item");
|
|
4964
|
-
return /* @__PURE__ */ y(v, { children: /* @__PURE__ */ b(
|
|
4985
|
+
return /* @__PURE__ */ y(v, { children: /* @__PURE__ */ b(so, {
|
|
4965
4986
|
ref: t,
|
|
4966
4987
|
type: "single",
|
|
4967
4988
|
value: r,
|
|
@@ -4974,7 +4995,7 @@ var oo = n.forwardRef((e, t) => {
|
|
|
4974
4995
|
role: "slider",
|
|
4975
4996
|
className: K("wu-absolute wu-z-0 wu-w-1/2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out ", o === "sm" && "wu-h-6 wu-min-w-20", o === "md" && "wu-h-8 wu-min-w-28", o === "lg" && "wu-h-10 wu-min-w-36", r === "opt1" && "", r === "opt2" && a !== "rtl" && "wu-translate-x-full", r === "opt2" && a === "rtl" && "-wu-translate-x-full", i && "wu-bg-gray-40", "wu-switcher-tab-slider")
|
|
4976
4997
|
}),
|
|
4977
|
-
/* @__PURE__ */ y(
|
|
4998
|
+
/* @__PURE__ */ y(co, {
|
|
4978
4999
|
value: "opt1",
|
|
4979
5000
|
className: c("opt1"),
|
|
4980
5001
|
children: /* @__PURE__ */ y("div", {
|
|
@@ -4982,7 +5003,7 @@ var oo = n.forwardRef((e, t) => {
|
|
|
4982
5003
|
children: n[0].label
|
|
4983
5004
|
})
|
|
4984
5005
|
}),
|
|
4985
|
-
/* @__PURE__ */ y(
|
|
5006
|
+
/* @__PURE__ */ y(co, {
|
|
4986
5007
|
value: "opt2",
|
|
4987
5008
|
className: c("opt2"),
|
|
4988
5009
|
children: /* @__PURE__ */ y("div", {
|
|
@@ -4993,12 +5014,12 @@ var oo = n.forwardRef((e, t) => {
|
|
|
4993
5014
|
]
|
|
4994
5015
|
}) });
|
|
4995
5016
|
});
|
|
4996
|
-
|
|
5017
|
+
uo.displayName = "_Tab";
|
|
4997
5018
|
//#endregion
|
|
4998
5019
|
//#region src/components/switcher/ui/_toggle.tsx
|
|
4999
|
-
var
|
|
5020
|
+
var fo = n.forwardRef((e, t) => {
|
|
5000
5021
|
let { options: n, value: r, disabled: i, dir: a, onChange: o } = e, s = (e) => K("wu-p-0 wu-w-fit wu-text-xs wu-text-gray-lead wu-h-fit wu-font-normal", i && "wu-cursor-not-allowed data-[state=on]:wu-text-gray-subtle wu-text-gray-subtle", e === r && "wu-text-primary wu-font-medium", i && r === e && "wu-text-gray-lead", "wu-switcher-toggle-item"), c = K("wu-w-fit wu-gap-2", i && "wu-cursor-not-allowed", "wu-switcher-toggle-group"), l = K("wu-flex wu-items-center wu-justify-center wu-w-8 wu-h-3 wu-p-0 wu-border wu-rounded-full wu-cursor-pointer wu-border-blue-p focus:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-blue-soft focus-visible:wu-ring-offset-2", i && "wu-border-gray-subtle wu-cursor-not-allowed", "wu-switcher-toggle-button"), u = K("wu-w-2 wu-h-2 wu-bg-blue-p wu-rounded-full wu-transition-transform wu-duration-300 wu-ease-in-out", r === "opt1" && a !== "rtl" && "-wu-translate-x-[10px]", r === "opt1" && a === "rtl" && "wu-translate-x-[10px]", r === "opt2" && a !== "rtl" && "wu-translate-x-[10px]", r === "opt2" && a === "rtl" && "-wu-translate-x-[10px]", i && "wu-hidden", "wu-switcher-toggle-knob");
|
|
5001
|
-
return /* @__PURE__ */ y(v, { children: /* @__PURE__ */ b(
|
|
5022
|
+
return /* @__PURE__ */ y(v, { children: /* @__PURE__ */ b(so, {
|
|
5002
5023
|
ref: t,
|
|
5003
5024
|
type: "single",
|
|
5004
5025
|
value: r,
|
|
@@ -5007,7 +5028,7 @@ var so = n.forwardRef((e, t) => {
|
|
|
5007
5028
|
className: c,
|
|
5008
5029
|
onValueChange: o,
|
|
5009
5030
|
children: [
|
|
5010
|
-
/* @__PURE__ */ y(
|
|
5031
|
+
/* @__PURE__ */ y(co, {
|
|
5011
5032
|
value: "opt1",
|
|
5012
5033
|
className: s("opt1"),
|
|
5013
5034
|
children: /* @__PURE__ */ y("div", {
|
|
@@ -5027,7 +5048,7 @@ var so = n.forwardRef((e, t) => {
|
|
|
5027
5048
|
dir: a
|
|
5028
5049
|
})
|
|
5029
5050
|
}),
|
|
5030
|
-
/* @__PURE__ */ y(
|
|
5051
|
+
/* @__PURE__ */ y(co, {
|
|
5031
5052
|
value: "opt2",
|
|
5032
5053
|
className: s("opt2"),
|
|
5033
5054
|
children: /* @__PURE__ */ y("div", {
|
|
@@ -5038,10 +5059,10 @@ var so = n.forwardRef((e, t) => {
|
|
|
5038
5059
|
]
|
|
5039
5060
|
}) });
|
|
5040
5061
|
});
|
|
5041
|
-
|
|
5062
|
+
fo.displayName = "_Toggle";
|
|
5042
5063
|
//#endregion
|
|
5043
5064
|
//#region src/components/switcher/WuSwitcher.tsx
|
|
5044
|
-
var
|
|
5065
|
+
var po = n.forwardRef((e, t) => {
|
|
5045
5066
|
let { type: r, options: i, value: a, disabled: o, dir: s, size: c, onChange: l, toggle: u = !0, ...d } = e, [f, p] = n.useState(), m = (e) => {
|
|
5046
5067
|
let t = f;
|
|
5047
5068
|
e === "" ? u && (t = f === "opt1" ? "opt2" : "opt1") : t = e;
|
|
@@ -5053,7 +5074,7 @@ var co = n.forwardRef((e, t) => {
|
|
|
5053
5074
|
p(a === i[0].value ? "opt1" : "opt2");
|
|
5054
5075
|
}, [i, a]), !Array.isArray(i) || i.length < 2) return /* @__PURE__ */ y(v, {});
|
|
5055
5076
|
switch (r) {
|
|
5056
|
-
case "toggle": return /* @__PURE__ */ y(
|
|
5077
|
+
case "toggle": return /* @__PURE__ */ y(fo, {
|
|
5057
5078
|
...d,
|
|
5058
5079
|
ref: t,
|
|
5059
5080
|
options: i,
|
|
@@ -5062,7 +5083,7 @@ var co = n.forwardRef((e, t) => {
|
|
|
5062
5083
|
disabled: o,
|
|
5063
5084
|
dir: s
|
|
5064
5085
|
});
|
|
5065
|
-
case "iconTab": return /* @__PURE__ */ y(
|
|
5086
|
+
case "iconTab": return /* @__PURE__ */ y(lo, {
|
|
5066
5087
|
ref: t,
|
|
5067
5088
|
options: i,
|
|
5068
5089
|
value: f || "opt1",
|
|
@@ -5070,7 +5091,7 @@ var co = n.forwardRef((e, t) => {
|
|
|
5070
5091
|
disabled: o,
|
|
5071
5092
|
dir: s
|
|
5072
5093
|
});
|
|
5073
|
-
default: return /* @__PURE__ */ y(
|
|
5094
|
+
default: return /* @__PURE__ */ y(uo, {
|
|
5074
5095
|
ref: t,
|
|
5075
5096
|
options: i,
|
|
5076
5097
|
value: f || "opt1",
|
|
@@ -5081,39 +5102,39 @@ var co = n.forwardRef((e, t) => {
|
|
|
5081
5102
|
});
|
|
5082
5103
|
}
|
|
5083
5104
|
});
|
|
5084
|
-
|
|
5105
|
+
po.displayName = "WuSwitcher";
|
|
5085
5106
|
//#endregion
|
|
5086
5107
|
//#region src/components/tab/shadcn/tabs.tsx
|
|
5087
|
-
var
|
|
5108
|
+
var mo = Se.Root, ho = t.forwardRef(({ className: e, children: t, ...n }, r) => /* @__PURE__ */ y(Se.List, {
|
|
5088
5109
|
className: K("wu-relative wu-flex", e),
|
|
5089
5110
|
...n,
|
|
5090
5111
|
ref: r,
|
|
5091
5112
|
children: t
|
|
5092
5113
|
}));
|
|
5093
|
-
|
|
5094
|
-
var
|
|
5114
|
+
ho.displayName = Se.List.displayName;
|
|
5115
|
+
var go = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y(Se.Trigger, {
|
|
5095
5116
|
ref: n,
|
|
5096
5117
|
className: K("wu-relative wu-inline-flex wu-items-center wu-whitespace-nowrap wu-text-xs wu-px-4 wu-py-2 wu-text-gray-600 wu-transition-colors wu-duration-200 data-[state=active]:wu-text-blue-p", "data-[orientation=horizontal]:wu-justify-center", e),
|
|
5097
5118
|
...t
|
|
5098
5119
|
}));
|
|
5099
|
-
|
|
5100
|
-
var
|
|
5120
|
+
go.displayName = Se.Trigger.displayName;
|
|
5121
|
+
var _o = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y(Se.Content, {
|
|
5101
5122
|
ref: n,
|
|
5102
5123
|
className: e,
|
|
5103
5124
|
...t
|
|
5104
5125
|
}));
|
|
5105
|
-
|
|
5126
|
+
_o.displayName = Se.Content.displayName;
|
|
5106
5127
|
//#endregion
|
|
5107
5128
|
//#region src/components/tab/components/BaseTabContent.tsx
|
|
5108
|
-
var
|
|
5129
|
+
var vo = ({ items: e, enableAnimation: t }) => /* @__PURE__ */ y("div", {
|
|
5109
5130
|
className: K("wu-w-full wu-h-full wu-flex-1 wu-overflow-auto", t && "wu-relative wu-overflow-hidden", "wu-tab-content-container"),
|
|
5110
|
-
children: e.map((e) => /* @__PURE__ */ y(
|
|
5131
|
+
children: e.map((e) => /* @__PURE__ */ y(_o, {
|
|
5111
5132
|
value: e.value,
|
|
5112
5133
|
forceMount: t || void 0,
|
|
5113
5134
|
className: K("wu-w-full wu-h-full wu-overflow-y-auto", t && "wu-duration-700 wu-ease-in-out wu-transition-all data-[state=inactive]:wu-absolute data-[state=inactive]:wu-inset-0 data-[state=inactive]:wu-opacity-0 data-[state=inactive]:wu-z-0 data-[state=active]:wu-relative data-[state=active]:wu-opacity-100 data-[state=active]:wu-z-10", "wu-tab-content"),
|
|
5114
5135
|
children: e.Content
|
|
5115
5136
|
}, e.value))
|
|
5116
|
-
}),
|
|
5137
|
+
}), yo = (e) => {
|
|
5117
5138
|
let [t, n] = m(!1), [r, i] = m(!1), a = () => {
|
|
5118
5139
|
let t = e.current;
|
|
5119
5140
|
t && (n(t.scrollLeft > 0), i(t.scrollLeft + t.clientWidth < t.scrollWidth));
|
|
@@ -5137,7 +5158,7 @@ var mo = ({ items: e, enableAnimation: t }) => /* @__PURE__ */ y("div", {
|
|
|
5137
5158
|
}
|
|
5138
5159
|
}
|
|
5139
5160
|
};
|
|
5140
|
-
},
|
|
5161
|
+
}, bo = (e, t) => {
|
|
5141
5162
|
let [n, r] = m({
|
|
5142
5163
|
width: 0,
|
|
5143
5164
|
left: 0,
|
|
@@ -5164,8 +5185,8 @@ var mo = ({ items: e, enableAnimation: t }) => /* @__PURE__ */ y("div", {
|
|
|
5164
5185
|
};
|
|
5165
5186
|
}
|
|
5166
5187
|
}, [e, i]), n;
|
|
5167
|
-
},
|
|
5168
|
-
let l = n.useRef(null), u =
|
|
5188
|
+
}, xo = ({ items: e, value: t, defaultValue: r, onValueChange: i, enableAnimation: a = !1, className: o, dir: s = "ltr", position: c = "top" }) => {
|
|
5189
|
+
let l = n.useRef(null), u = bo(l, "horizontal"), { showLeftArrow: d, showRightArrow: f, scrollByTab: p } = yo(l), [m, h] = n.useState(!1), g = () => p("left"), _ = () => p("right"), v = (e) => /* @__PURE__ */ y("div", {
|
|
5169
5190
|
"data-testid": `gradient-overlay-${e}`,
|
|
5170
5191
|
className: K("wu-absolute wu-top-0 wu-h-full wu-w-20 wu-z-10 wu-pointer-events-none", e === "left" ? "wu-left-0 wu-bg-gradient-to-r wu-from-white wu-to-transparent" : "wu-right-0 wu-bg-gradient-to-l wu-from-white wu-to-transparent")
|
|
5171
5192
|
}), x = (e, t, n) => {
|
|
@@ -5177,7 +5198,7 @@ var mo = ({ items: e, enableAnimation: t }) => /* @__PURE__ */ y("div", {
|
|
|
5177
5198
|
children: /* @__PURE__ */ y("span", { className: K("wu-text-blue-p wu-text-lg", r ? "wm-keyboard-arrow-left" : "wm-keyboard-arrow-right") })
|
|
5178
5199
|
});
|
|
5179
5200
|
};
|
|
5180
|
-
return /* @__PURE__ */ b(
|
|
5201
|
+
return /* @__PURE__ */ b(mo, {
|
|
5181
5202
|
defaultValue: r || e[0]?.value,
|
|
5182
5203
|
value: t,
|
|
5183
5204
|
onValueChange: i,
|
|
@@ -5193,10 +5214,10 @@ var mo = ({ items: e, enableAnimation: t }) => /* @__PURE__ */ y("div", {
|
|
|
5193
5214
|
children: [
|
|
5194
5215
|
d && m && v("left"),
|
|
5195
5216
|
x(g, "left", d && m),
|
|
5196
|
-
/* @__PURE__ */ b(
|
|
5217
|
+
/* @__PURE__ */ b(ho, {
|
|
5197
5218
|
ref: l,
|
|
5198
5219
|
className: K("wu-relative wu-flex wu-w-full wu-overflow-x-auto wu-flex-row", "[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]", "wu-tablist"),
|
|
5199
|
-
children: [e.map((e) => /* @__PURE__ */ y(
|
|
5220
|
+
children: [e.map((e) => /* @__PURE__ */ y(go, {
|
|
5200
5221
|
value: e.value,
|
|
5201
5222
|
children: e.Trigger
|
|
5202
5223
|
}, e.value)), /* @__PURE__ */ y("span", {
|
|
@@ -5213,12 +5234,12 @@ var mo = ({ items: e, enableAnimation: t }) => /* @__PURE__ */ y("div", {
|
|
|
5213
5234
|
f && m && v("right"),
|
|
5214
5235
|
x(_, "right", f && m)
|
|
5215
5236
|
]
|
|
5216
|
-
}), /* @__PURE__ */ y(
|
|
5237
|
+
}), /* @__PURE__ */ y(vo, {
|
|
5217
5238
|
items: e,
|
|
5218
5239
|
enableAnimation: a
|
|
5219
5240
|
})]
|
|
5220
5241
|
});
|
|
5221
|
-
},
|
|
5242
|
+
}, So = (e) => {
|
|
5222
5243
|
let [t, n] = m(!1), [r, i] = m(!1), a = () => {
|
|
5223
5244
|
let t = e.current;
|
|
5224
5245
|
t && (n(t.scrollTop > 0), i(t.scrollTop + t.clientHeight < t.scrollHeight));
|
|
@@ -5242,8 +5263,8 @@ var mo = ({ items: e, enableAnimation: t }) => /* @__PURE__ */ y("div", {
|
|
|
5242
5263
|
}
|
|
5243
5264
|
}
|
|
5244
5265
|
};
|
|
5245
|
-
},
|
|
5246
|
-
let l = n.useRef(null), u =
|
|
5266
|
+
}, Co = ({ items: e, value: t, defaultValue: r, onValueChange: i, enableAnimation: a = !1, className: o, dir: s = "ltr", position: c = "left" }) => {
|
|
5267
|
+
let l = n.useRef(null), u = bo(l, "vertical"), { showTopArrow: d, showBottomArrow: f, scrollByTab: p } = So(l), [m, h] = n.useState(!1), g = () => p("up"), _ = () => p("down"), v = (e) => /* @__PURE__ */ y("div", { className: K("wu-absolute wu-left-0 wu-w-full wu-h-12 wu-z-10 wu-pointer-events-none", e === "top" ? "wu-top-0 wu-bg-gradient-to-b wu-from-white wu-to-transparent" : "wu-bottom-0 wu-bg-gradient-to-t wu-from-white wu-to-transparent") }), x = (e, t, n) => {
|
|
5247
5268
|
let r = t === "up";
|
|
5248
5269
|
return /* @__PURE__ */ y("button", {
|
|
5249
5270
|
onClick: e,
|
|
@@ -5252,7 +5273,7 @@ var mo = ({ items: e, enableAnimation: t }) => /* @__PURE__ */ y("div", {
|
|
|
5252
5273
|
children: /* @__PURE__ */ y("span", { className: K("wu-text-blue-p wu-text-lg", r ? "wm-keyboard-arrow-up" : "wm-keyboard-arrow-down") })
|
|
5253
5274
|
});
|
|
5254
5275
|
};
|
|
5255
|
-
return /* @__PURE__ */ b(
|
|
5276
|
+
return /* @__PURE__ */ b(mo, {
|
|
5256
5277
|
defaultValue: r || e[0]?.value,
|
|
5257
5278
|
value: t,
|
|
5258
5279
|
onValueChange: i,
|
|
@@ -5268,10 +5289,10 @@ var mo = ({ items: e, enableAnimation: t }) => /* @__PURE__ */ y("div", {
|
|
|
5268
5289
|
children: [
|
|
5269
5290
|
d && m && v("top"),
|
|
5270
5291
|
x(g, "up", d && m),
|
|
5271
|
-
/* @__PURE__ */ b(
|
|
5292
|
+
/* @__PURE__ */ b(ho, {
|
|
5272
5293
|
ref: l,
|
|
5273
5294
|
className: K("wu-relative wu-flex wu-h-full wu-overflow-y-auto wu-flex-col", "[&::-webkit-scrollbar]:wu-hidden [-ms-overflow-style:none] [scrollbar-width:none]", "wu-tablist"),
|
|
5274
|
-
children: [e.map((e) => /* @__PURE__ */ y(
|
|
5295
|
+
children: [e.map((e) => /* @__PURE__ */ y(go, {
|
|
5275
5296
|
value: e.value,
|
|
5276
5297
|
children: e.Trigger
|
|
5277
5298
|
}, e.value)), /* @__PURE__ */ y("span", {
|
|
@@ -5288,16 +5309,16 @@ var mo = ({ items: e, enableAnimation: t }) => /* @__PURE__ */ y("div", {
|
|
|
5288
5309
|
f && m && v("bottom"),
|
|
5289
5310
|
x(_, "down", f && m)
|
|
5290
5311
|
]
|
|
5291
|
-
}), /* @__PURE__ */ y(
|
|
5312
|
+
}), /* @__PURE__ */ y(vo, {
|
|
5292
5313
|
items: e,
|
|
5293
5314
|
enableAnimation: a
|
|
5294
5315
|
})]
|
|
5295
5316
|
});
|
|
5296
|
-
},
|
|
5297
|
-
function
|
|
5317
|
+
}, wo = ({ ...e }) => e.orientation === "vertical" ? /* @__PURE__ */ y(Co, { ...e }) : /* @__PURE__ */ y(xo, { ...e }), To = "expander";
|
|
5318
|
+
function Eo(e, t) {
|
|
5298
5319
|
return e ? [{
|
|
5299
|
-
id:
|
|
5300
|
-
accessorKey:
|
|
5320
|
+
id: To,
|
|
5321
|
+
accessorKey: To,
|
|
5301
5322
|
header: "",
|
|
5302
5323
|
cell: ({ row: e }) => {
|
|
5303
5324
|
let t = e.getIsExpanded();
|
|
@@ -5316,10 +5337,10 @@ function So(e, t) {
|
|
|
5316
5337
|
size: 48
|
|
5317
5338
|
}, ...t] : t;
|
|
5318
5339
|
}
|
|
5319
|
-
function
|
|
5340
|
+
function Do(e, t) {
|
|
5320
5341
|
return t.map((e) => e.columnDef?.expandableRowContent).find((e) => e)?.call(null, e);
|
|
5321
5342
|
}
|
|
5322
|
-
function
|
|
5343
|
+
function Oo(e) {
|
|
5323
5344
|
let t = /* @__PURE__ */ new Map(), n = 0;
|
|
5324
5345
|
for (let r = 0; r < e.length; r++) {
|
|
5325
5346
|
let i = e[r];
|
|
@@ -5344,7 +5365,7 @@ function wo(e) {
|
|
|
5344
5365
|
}
|
|
5345
5366
|
return t;
|
|
5346
5367
|
}
|
|
5347
|
-
function
|
|
5368
|
+
function ko(e, t, n, r) {
|
|
5348
5369
|
return t ? e === "left" && n ? /* @__PURE__ */ y("div", { style: {
|
|
5349
5370
|
position: "absolute",
|
|
5350
5371
|
top: 0,
|
|
@@ -5363,10 +5384,10 @@ function To(e, t, n, r) {
|
|
|
5363
5384
|
pointerEvents: "none"
|
|
5364
5385
|
} }) : null : null;
|
|
5365
5386
|
}
|
|
5366
|
-
function
|
|
5387
|
+
function Ao(e, t, n) {
|
|
5367
5388
|
return e === !0 && (!t || n > t);
|
|
5368
5389
|
}
|
|
5369
|
-
function
|
|
5390
|
+
function jo(e, t) {
|
|
5370
5391
|
let n = Ce(t.cell, e.getContext());
|
|
5371
5392
|
return e.column.id === "actions" ? /* @__PURE__ */ y("div", {
|
|
5372
5393
|
className: "wu-opacity-0 wu-transition-opacity wu-duration-150 wu-ease-in-out group-hover:wu-opacity-100",
|
|
@@ -5375,7 +5396,7 @@ function Do(e, t) {
|
|
|
5375
5396
|
}
|
|
5376
5397
|
//#endregion
|
|
5377
5398
|
//#region src/components/table/hooks/useRowSelection.tsx
|
|
5378
|
-
var
|
|
5399
|
+
var Mo = ({ columns: e, rowSelection: t }) => {
|
|
5379
5400
|
let n = t?.isEnabled ?? !1, r = t?.size ?? 48, { onRowSelect: i, rowUniqueKey: a, isRowDisabled: o, hideSelectAll: c } = t || {}, l = s((e) => (t) => {
|
|
5380
5401
|
i?.(t ? e : []);
|
|
5381
5402
|
}, [i]);
|
|
@@ -5417,8 +5438,8 @@ var Oo = ({ columns: e, rowSelection: t }) => {
|
|
|
5417
5438
|
};
|
|
5418
5439
|
//#endregion
|
|
5419
5440
|
//#region src/components/table/hooks/useTableCore.ts
|
|
5420
|
-
function
|
|
5421
|
-
let [i, a] = m({}), { finalColumns: o } =
|
|
5441
|
+
function No({ data: e, columns: t, rowSelection: n, isRowExpandable: r }) {
|
|
5442
|
+
let [i, a] = m({}), { finalColumns: o } = Mo({
|
|
5422
5443
|
columns: t,
|
|
5423
5444
|
rowSelection: n
|
|
5424
5445
|
}), s = f(() => {
|
|
@@ -5435,7 +5456,7 @@ function ko({ data: e, columns: t, rowSelection: n, isRowExpandable: r }) {
|
|
|
5435
5456
|
rowSelectionState: s,
|
|
5436
5457
|
sortableColumns: f(() => o.filter((e) => e.enableSorting).map((e) => e.accessorKey), [o]),
|
|
5437
5458
|
selectedRowCount: n?.selectedRows?.length ?? 0,
|
|
5438
|
-
columnsWithExpand: f(() =>
|
|
5459
|
+
columnsWithExpand: f(() => Eo(r, o), [o, r]),
|
|
5439
5460
|
expanded: i,
|
|
5440
5461
|
setExpanded: a,
|
|
5441
5462
|
handleRowSelectionChange: (t) => {
|
|
@@ -5451,7 +5472,7 @@ function ko({ data: e, columns: t, rowSelection: n, isRowExpandable: r }) {
|
|
|
5451
5472
|
}
|
|
5452
5473
|
//#endregion
|
|
5453
5474
|
//#region src/components/table/hooks/useTableScroll.ts
|
|
5454
|
-
function
|
|
5475
|
+
function Po() {
|
|
5455
5476
|
let e = p(null), [t, n] = m(!1), [r, i] = m(!1), a = s(() => {
|
|
5456
5477
|
let t = e.current;
|
|
5457
5478
|
t && (n(t.scrollLeft > 12), i(t.scrollLeft < t.scrollWidth - t.clientWidth - 1));
|
|
@@ -5467,101 +5488,101 @@ function Ao() {
|
|
|
5467
5488
|
}
|
|
5468
5489
|
//#endregion
|
|
5469
5490
|
//#region src/components/table/utils/tableStyles.ts
|
|
5470
|
-
var
|
|
5491
|
+
var Fo = (e) => K("wu-group wu-border-b wu-border-black/[12%] [--wu-row-overlay:transparent]", "data-[state=selected]:[--wu-row-overlay:rgb(var(--wu-blue-p)/0.08)]", !e && ["hover:[--wu-row-overlay:rgba(0,0,0,0.02)]", "data-[state=selected]:hover:[--wu-row-overlay:rgb(var(--wu-blue-p)/0.16)]"]), Io = (e = "default", t) => K("wu-py-0 wu-font-light wu-text-xs wu-bg-white", "[background-image:linear-gradient(var(--wu-row-overlay),var(--wu-row-overlay))]", e === "compact" ? "wu-h-8" : "wu-h-10", t === "right" && "wu-text-right", t === "center" && "wu-text-center", t === "left" && "wu-text-left"), Lo = (e = "default") => e === "compact" ? "wu-h-8" : "wu-h-10", Ro = (e) => K({
|
|
5471
5492
|
"wu-text-right": e === "right",
|
|
5472
5493
|
"wu-text-center": e === "center",
|
|
5473
5494
|
"wu-text-left": e === "left"
|
|
5474
|
-
}),
|
|
5495
|
+
}), zo = (e) => K({
|
|
5475
5496
|
"wu-justify-end": e === "right",
|
|
5476
5497
|
"wu-justify-center": e === "center"
|
|
5477
|
-
}),
|
|
5498
|
+
}), Bo = (e, t) => K("wu-absolute -wu-bottom-[13px] wu-left-0 wm-arrow-drop-up wu-text-xl", e && "wu-hidden", !t && "-wu-bottom-[10px]"), Vo = (e, t) => K("wu-absolute -wu-top-[15px] wu-left-0 wm-arrow-drop-down wu-text-xl", e && "wu-hidden", !t && "-wu-top-[11px]"), Ho = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("table", {
|
|
5478
5499
|
ref: n,
|
|
5479
5500
|
className: K("wu-w-full wu-caption-bottom wu-text-sm", e),
|
|
5480
5501
|
...t
|
|
5481
5502
|
}));
|
|
5482
|
-
|
|
5483
|
-
var
|
|
5503
|
+
Ho.displayName = "Table";
|
|
5504
|
+
var Uo = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("thead", {
|
|
5484
5505
|
ref: n,
|
|
5485
5506
|
className: K("[&_tr]:wu-border-b", e),
|
|
5486
5507
|
...t
|
|
5487
5508
|
}));
|
|
5488
|
-
|
|
5489
|
-
var
|
|
5509
|
+
Uo.displayName = "TableHeader";
|
|
5510
|
+
var Wo = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("tbody", {
|
|
5490
5511
|
ref: n,
|
|
5491
5512
|
className: K("", e),
|
|
5492
5513
|
...t
|
|
5493
5514
|
}));
|
|
5494
|
-
|
|
5495
|
-
var
|
|
5515
|
+
Wo.displayName = "TableBody";
|
|
5516
|
+
var Go = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("tfoot", {
|
|
5496
5517
|
ref: n,
|
|
5497
5518
|
className: K("wu-border-t wu-bg-muted/50 wu-font-medium [&>tr]:last:wu-border-b-0", e),
|
|
5498
5519
|
...t
|
|
5499
5520
|
}));
|
|
5500
|
-
|
|
5501
|
-
var
|
|
5521
|
+
Go.displayName = "TableFooter";
|
|
5522
|
+
var Ko = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("tr", {
|
|
5502
5523
|
ref: n,
|
|
5503
5524
|
className: K("wu-border-b wu-transition-colors wu-hover:wu-bg-muted/50 data-[state=selected]:wu-bg-muted", e),
|
|
5504
5525
|
...t
|
|
5505
5526
|
}));
|
|
5506
|
-
|
|
5507
|
-
var
|
|
5527
|
+
Ko.displayName = "TableRow";
|
|
5528
|
+
var qo = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("th", {
|
|
5508
5529
|
ref: n,
|
|
5509
5530
|
className: K("wu-px-4 wu-text-left wu-align-middle wu-font-medium wu-text-muted-foreground [&:has([role=checkbox])]:wu-pr-0", e),
|
|
5510
5531
|
...t
|
|
5511
5532
|
}));
|
|
5512
|
-
|
|
5513
|
-
var
|
|
5533
|
+
qo.displayName = "TableHead";
|
|
5534
|
+
var Jo = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("td", {
|
|
5514
5535
|
ref: n,
|
|
5515
5536
|
className: K("wu-p-4 wu-align-middle [&:has([role=checkbox])]:wu-pr-0", e),
|
|
5516
5537
|
...t
|
|
5517
5538
|
}));
|
|
5518
|
-
|
|
5519
|
-
var
|
|
5539
|
+
Jo.displayName = "TableCell";
|
|
5540
|
+
var Yo = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("caption", {
|
|
5520
5541
|
ref: n,
|
|
5521
5542
|
className: K("wu-mt-4 wu-text-sm wu-text-gray-subtle wu-font-normal", e),
|
|
5522
5543
|
...t
|
|
5523
5544
|
}));
|
|
5524
|
-
|
|
5545
|
+
Yo.displayName = "TableCaption";
|
|
5525
5546
|
//#endregion
|
|
5526
5547
|
//#region src/components/table/ui/_body.tsx
|
|
5527
|
-
var
|
|
5528
|
-
let l = e.getVisibleLeafColumns(), u = l.length, d = e.getRowModel().rows, f =
|
|
5529
|
-
return r ? /* @__PURE__ */ y(
|
|
5548
|
+
var Xo = ({ table: e, size: t, NoDataContent: n, isLoading: r, CustomLoader: i, isRowDisabled: a, isRowExpandable: o, isScrolledLeft: s, isScrolledRight: c }) => {
|
|
5549
|
+
let l = e.getVisibleLeafColumns(), u = l.length, d = e.getRowModel().rows, f = Oo(l);
|
|
5550
|
+
return r ? /* @__PURE__ */ y(Wo, { children: /* @__PURE__ */ y(Ko, { children: /* @__PURE__ */ y(Jo, {
|
|
5530
5551
|
colSpan: u,
|
|
5531
5552
|
className: "wu-text-center wu-h-[35vh] wu-loader-container",
|
|
5532
5553
|
children: i ?? /* @__PURE__ */ y(Ze, { className: "wu-w-full" })
|
|
5533
|
-
}) }) }) : d.length ? /* @__PURE__ */ y(
|
|
5534
|
-
let i = a?.(n.original) ?? !1, l = n.getIsSelected(), d = n.getIsExpanded(), p = /* @__PURE__ */ y(
|
|
5554
|
+
}) }) }) : d.length ? /* @__PURE__ */ y(Wo, { children: d.flatMap((n, r) => {
|
|
5555
|
+
let i = a?.(n.original) ?? !1, l = n.getIsSelected(), d = n.getIsExpanded(), p = /* @__PURE__ */ y(Ko, {
|
|
5535
5556
|
"data-disabled": i,
|
|
5536
5557
|
"data-state": l && "selected",
|
|
5537
|
-
className:
|
|
5558
|
+
className: Fo(i),
|
|
5538
5559
|
"data-expanded": d,
|
|
5539
5560
|
children: n.getVisibleCells().map((e, n) => {
|
|
5540
5561
|
let r = e.column.columnDef, i = f.get(e.column.id);
|
|
5541
|
-
return /* @__PURE__ */ b(
|
|
5542
|
-
className: K(
|
|
5562
|
+
return /* @__PURE__ */ b(Jo, {
|
|
5563
|
+
className: K(Io(t, r.cellAlign), i && "wu-sticky wu-z-[1]"),
|
|
5543
5564
|
style: {
|
|
5544
5565
|
width: `${e.column.getSize()}px`,
|
|
5545
5566
|
...i && { [i.sticky]: i.offset }
|
|
5546
5567
|
},
|
|
5547
|
-
children: [
|
|
5568
|
+
children: [jo(e, r), ko(i?.sticky, i?.isStickyEdge ?? !1, s, c)]
|
|
5548
5569
|
}, `${e.id}-${n}`);
|
|
5549
5570
|
})
|
|
5550
|
-
}, `${n.id}-${r}`), m = o && d ?
|
|
5551
|
-
return m ? [p, /* @__PURE__ */ y(
|
|
5571
|
+
}, `${n.id}-${r}`), m = o && d ? Do(n, e.getVisibleLeafColumns()) : null;
|
|
5572
|
+
return m ? [p, /* @__PURE__ */ y(Ko, {
|
|
5552
5573
|
"data-expanded": "true",
|
|
5553
5574
|
"data-state": l && "selected",
|
|
5554
|
-
children: /* @__PURE__ */ y(
|
|
5575
|
+
children: /* @__PURE__ */ y(Jo, {
|
|
5555
5576
|
colSpan: u,
|
|
5556
5577
|
children: m
|
|
5557
5578
|
})
|
|
5558
5579
|
}, `${n.id}-expanded-${r}`)] : [p];
|
|
5559
|
-
}) }) : /* @__PURE__ */ y(
|
|
5580
|
+
}) }) : /* @__PURE__ */ y(Wo, { children: /* @__PURE__ */ y(Ko, { children: /* @__PURE__ */ y(Jo, {
|
|
5560
5581
|
colSpan: u,
|
|
5561
5582
|
children: n
|
|
5562
5583
|
}) }) });
|
|
5563
|
-
},
|
|
5564
|
-
let f = i === "compact" ? "wu-h-8" : "wu-h-10", p = e.getVisibleLeafColumns(), m =
|
|
5584
|
+
}, Zo = ({ table: e, sortableColumns: t, manual: n = !1, onSort: r, size: i, isRowSelected: a, HeaderAction: o, isStickyHeader: s, asVirtualContent: c = !1, isRowExpandable: l, isScrolledLeft: u, isScrolledRight: d }) => {
|
|
5585
|
+
let f = i === "compact" ? "wu-h-8" : "wu-h-10", p = e.getVisibleLeafColumns(), m = Oo(p), h = (e) => {
|
|
5565
5586
|
let { id: i, columnDef: a, getIsSorted: o, toggleSorting: s } = e.column, c = a.headerAlign, l = Ce(a.header, e.getContext());
|
|
5566
5587
|
if (!t.includes(i)) return l;
|
|
5567
5588
|
let u = o(), d = u === "asc", f = u === "desc";
|
|
@@ -5573,32 +5594,32 @@ var Ko = ({ table: e, size: t, NoDataContent: n, isLoading: r, CustomLoader: i,
|
|
|
5573
5594
|
}) : s(e.column.getIsSorted() === "asc");
|
|
5574
5595
|
},
|
|
5575
5596
|
"aria-label": `Sort by ${typeof a.header == "string" ? a.header : i}`,
|
|
5576
|
-
className: K("wu-flex wu-items-center wu-gap-1 wu-w-full",
|
|
5597
|
+
className: K("wu-flex wu-items-center wu-gap-1 wu-w-full", zo(c)),
|
|
5577
5598
|
children: [l, /* @__PURE__ */ b("div", {
|
|
5578
5599
|
className: "wu-relative wu-flex-shrink-0 wu-w-4",
|
|
5579
|
-
children: [/* @__PURE__ */ y("span", { className:
|
|
5600
|
+
children: [/* @__PURE__ */ y("span", { className: Vo(d, !!u) }), /* @__PURE__ */ y("span", { className: Bo(f, !!u) })]
|
|
5580
5601
|
})]
|
|
5581
5602
|
});
|
|
5582
5603
|
}, g = (e) => {
|
|
5583
5604
|
let t = e.column.id === "actions", n = m.get(e.column.id), r = n ? { [n.sticky]: n.offset } : {};
|
|
5584
|
-
return t ? /* @__PURE__ */ y(
|
|
5605
|
+
return t ? /* @__PURE__ */ y(qo, {
|
|
5585
5606
|
colSpan: e.colSpan,
|
|
5586
5607
|
className: K("wu-text-xs wu-font-medium", n && "wu-sticky wu-z-[2] wu-bg-[#EEEEEE]"),
|
|
5587
5608
|
style: {
|
|
5588
5609
|
width: `${e.getSize()}px`,
|
|
5589
5610
|
...r
|
|
5590
5611
|
},
|
|
5591
|
-
children:
|
|
5592
|
-
}, e.id) : /* @__PURE__ */ b(
|
|
5612
|
+
children: ko(n?.sticky, n?.isStickyEdge ?? !1, u, d)
|
|
5613
|
+
}, e.id) : /* @__PURE__ */ b(qo, {
|
|
5593
5614
|
colSpan: e.colSpan,
|
|
5594
|
-
className: K("wu-text-xs wu-font-medium wu-bg-[#EEEEEE]", n ? "wu-sticky wu-z-[2]" : "wu-relative wu-z-0",
|
|
5615
|
+
className: K("wu-text-xs wu-font-medium wu-bg-[#EEEEEE]", n ? "wu-sticky wu-z-[2]" : "wu-relative wu-z-0", Ro(e.column.columnDef.headerAlign)),
|
|
5595
5616
|
style: {
|
|
5596
5617
|
width: `${e.getSize()}px`,
|
|
5597
5618
|
...r
|
|
5598
5619
|
},
|
|
5599
|
-
children: [h(e),
|
|
5620
|
+
children: [h(e), ko(n?.sticky, n?.isStickyEdge ?? !1, u, d)]
|
|
5600
5621
|
}, e.id);
|
|
5601
|
-
}, _ = () => e.getHeaderGroups().map((e) => /* @__PURE__ */ y(
|
|
5622
|
+
}, _ = () => e.getHeaderGroups().map((e) => /* @__PURE__ */ y(Ko, {
|
|
5602
5623
|
className: "wu-relative",
|
|
5603
5624
|
children: e.headers.map(g)
|
|
5604
5625
|
}, e.id)), v = () => /* @__PURE__ */ b("div", {
|
|
@@ -5621,27 +5642,27 @@ var Ko = ({ table: e, size: t, NoDataContent: n, isLoading: r, CustomLoader: i,
|
|
|
5621
5642
|
children: o
|
|
5622
5643
|
})]
|
|
5623
5644
|
}), x = a && o;
|
|
5624
|
-
return c ? /* @__PURE__ */ b(
|
|
5645
|
+
return c ? /* @__PURE__ */ b(Ko, {
|
|
5625
5646
|
className: "wu-relative",
|
|
5626
|
-
children: [(e.getHeaderGroups()[0]?.headers ?? []).map(g), x && /* @__PURE__ */ y(
|
|
5647
|
+
children: [(e.getHeaderGroups()[0]?.headers ?? []).map(g), x && /* @__PURE__ */ y(qo, {
|
|
5627
5648
|
colSpan: p.length,
|
|
5628
5649
|
className: "wu-p-0 wu-absolute wu-top-0 wu-left-0 wu-right-0 wu-z-10",
|
|
5629
5650
|
children: v()
|
|
5630
5651
|
})]
|
|
5631
|
-
}) : /* @__PURE__ */ b(
|
|
5652
|
+
}) : /* @__PURE__ */ b(Uo, {
|
|
5632
5653
|
className: K("wu-border-t wu-border-black/[12%] wu-bg-gray-20 wu-relative", s && "wu-sticky wu-top-[-.5px] wu-z-10", f),
|
|
5633
5654
|
children: [_(), x && /* @__PURE__ */ y("div", {
|
|
5634
5655
|
className: K("wu-absolute wu-top-[-1px] wu-left-0 wu-right-0 wu-flex wu-items-center wu-border-b wu-border-t wu-bg-gray-20 wu-z-10", f),
|
|
5635
5656
|
children: v()
|
|
5636
5657
|
})]
|
|
5637
5658
|
});
|
|
5638
|
-
},
|
|
5659
|
+
}, Qo = n.forwardRef((e, t) => /* @__PURE__ */ y(Wo, {
|
|
5639
5660
|
...e,
|
|
5640
5661
|
ref: t
|
|
5641
5662
|
}));
|
|
5642
|
-
|
|
5643
|
-
var
|
|
5644
|
-
let m = e.getRowModel().rows, h = e.getVisibleLeafColumns(), g =
|
|
5663
|
+
Qo.displayName = "TableBodyComponent";
|
|
5664
|
+
var $o = ({ table: e, size: t, isRowDisabled: n, containerHeight: r = 600, sortableColumns: i, HeaderAction: a, isRowSelected: o, manual: s = !1, onSort: c, tableLayout: l = "auto", isScrolledLeft: u, isScrolledRight: d, isRowExpandable: f, hideHeader: p = !1 }) => {
|
|
5665
|
+
let m = e.getRowModel().rows, h = e.getVisibleLeafColumns(), g = Oo(h), _ = [];
|
|
5645
5666
|
for (let e of m) _.push({
|
|
5646
5667
|
type: "row",
|
|
5647
5668
|
row: e
|
|
@@ -5654,7 +5675,7 @@ var Yo = ({ table: e, size: t, isRowDisabled: n, containerHeight: r = 600, sorta
|
|
|
5654
5675
|
children: /* @__PURE__ */ y(ne, {
|
|
5655
5676
|
style: { height: r },
|
|
5656
5677
|
totalCount: _.length,
|
|
5657
|
-
fixedHeaderContent: p ? void 0 : () => /* @__PURE__ */ y(
|
|
5678
|
+
fixedHeaderContent: p ? void 0 : () => /* @__PURE__ */ y(Zo, {
|
|
5658
5679
|
table: e,
|
|
5659
5680
|
sortableColumns: i,
|
|
5660
5681
|
manual: s,
|
|
@@ -5670,8 +5691,8 @@ var Yo = ({ table: e, size: t, isRowDisabled: n, containerHeight: r = 600, sorta
|
|
|
5670
5691
|
let r = _[n];
|
|
5671
5692
|
if (!r) return null;
|
|
5672
5693
|
if (r.type === "expanded") {
|
|
5673
|
-
let t =
|
|
5674
|
-
return /* @__PURE__ */ y(
|
|
5694
|
+
let t = Do(r.row, e.getVisibleLeafColumns());
|
|
5695
|
+
return /* @__PURE__ */ y(Jo, {
|
|
5675
5696
|
colSpan: h.length,
|
|
5676
5697
|
children: t
|
|
5677
5698
|
});
|
|
@@ -5679,10 +5700,10 @@ var Yo = ({ table: e, size: t, isRowDisabled: n, containerHeight: r = 600, sorta
|
|
|
5679
5700
|
let i = r.row;
|
|
5680
5701
|
return /* @__PURE__ */ y(v, { children: i.getVisibleCells().map((e, n) => {
|
|
5681
5702
|
let r = e.column.columnDef, i = g.get(e.column.id);
|
|
5682
|
-
return /* @__PURE__ */ b(
|
|
5683
|
-
className: K(
|
|
5703
|
+
return /* @__PURE__ */ b(Jo, {
|
|
5704
|
+
className: K(Io(t, r.cellAlign), i && "wu-sticky wu-z-[1]"),
|
|
5684
5705
|
style: i ? { [i.sticky]: i.offset } : void 0,
|
|
5685
|
-
children: [
|
|
5706
|
+
children: [jo(e, r), ko(i?.sticky, i?.isStickyEdge ?? !1, u, d)]
|
|
5686
5707
|
}, `${e.id}-${n}`);
|
|
5687
5708
|
}) });
|
|
5688
5709
|
},
|
|
@@ -5697,30 +5718,30 @@ var Yo = ({ table: e, size: t, isRowDisabled: n, containerHeight: r = 600, sorta
|
|
|
5697
5718
|
},
|
|
5698
5719
|
children: [/* @__PURE__ */ y("colgroup", { children: h.map((e) => /* @__PURE__ */ y("col", { style: { width: `${e.getSize()}px` } }, e.id)) }), t.children]
|
|
5699
5720
|
}),
|
|
5700
|
-
TableBody:
|
|
5701
|
-
TableHead: (e) => /* @__PURE__ */ y(
|
|
5721
|
+
TableBody: Qo,
|
|
5722
|
+
TableHead: (e) => /* @__PURE__ */ y(Uo, {
|
|
5702
5723
|
...e,
|
|
5703
|
-
className: K("wu-border-t wu-border-black/[12%] wu-bg-gray-20",
|
|
5724
|
+
className: K("wu-border-t wu-border-black/[12%] wu-bg-gray-20", Lo(t), e.className)
|
|
5704
5725
|
}),
|
|
5705
5726
|
TableRow: ({ ...e }) => {
|
|
5706
5727
|
let t = _[e["data-index"]], r = t?.row, i = r ? n?.(r.original) ?? !1 : !1, a = r?.getIsSelected() ?? !1;
|
|
5707
|
-
return /* @__PURE__ */ y(
|
|
5728
|
+
return /* @__PURE__ */ y(Ko, {
|
|
5708
5729
|
...e,
|
|
5709
5730
|
"data-disabled": i,
|
|
5710
5731
|
"data-state": a && "selected",
|
|
5711
5732
|
"data-expanded": t?.type === "expanded" ? "true" : void 0,
|
|
5712
|
-
className:
|
|
5733
|
+
className: Fo(i)
|
|
5713
5734
|
});
|
|
5714
5735
|
}
|
|
5715
5736
|
}
|
|
5716
5737
|
})
|
|
5717
5738
|
});
|
|
5718
|
-
},
|
|
5739
|
+
}, es = z("", { variants: { variant: {
|
|
5719
5740
|
striped: "[&_tr:nth-child(even):not([data-expanded])_td]:wu-bg-zinc-50 [&_tr:nth-child(odd)[data-expanded]:not([data-state=\"selected\"])_td]:wu-bg-zinc-50",
|
|
5720
5741
|
unstyled: "",
|
|
5721
5742
|
bordered: "wu-border-collapse wu-border wu-border-black/[12%] [&_th]:wu-border [&_td]:wu-border"
|
|
5722
|
-
} } }),
|
|
5723
|
-
let [C, w] = n.useState(() => a?.defaultSort ?? null), { scrollContainerRef: T, isScrolledLeft: E, isScrolledRight: D, handleScroll: O } =
|
|
5743
|
+
} } }), ts = ({ data: e, columns: t, isLoading: r = !1, variant: i = "unstyled", sort: a, size: o, rowSelection: s, HeaderAction: c, NoDataContent: l, stickyHeader: u = !1, maxHeight: d, CustomLoader: f, caption: p, virtualization: m, isRowExpandable: h, hideHeader: g = !1, tableLayout: _ = "fixed", style: v, className: x, ...S }) => {
|
|
5744
|
+
let [C, w] = n.useState(() => a?.defaultSort ?? null), { scrollContainerRef: T, isScrolledLeft: E, isScrolledRight: D, handleScroll: O } = Po(), { rowSelectionState: k, sortableColumns: A, selectedRowCount: j, columnsWithExpand: M, expanded: N, setExpanded: ee, handleRowSelectionChange: P } = No({
|
|
5724
5745
|
data: e,
|
|
5725
5746
|
columns: t,
|
|
5726
5747
|
rowSelection: s,
|
|
@@ -5746,20 +5767,20 @@ var Yo = ({ table: e, size: t, isRowDisabled: n, containerHeight: r = 600, sorta
|
|
|
5746
5767
|
},
|
|
5747
5768
|
onRowSelectionChange: P,
|
|
5748
5769
|
...h ? { onExpandedChange: ee } : {}
|
|
5749
|
-
}), I =
|
|
5770
|
+
}), I = Ao(m?.enabled, m?.threshold, e.length), L = m?.maxHeight ?? 600, R = typeof d == "number" ? `${d}px` : d;
|
|
5750
5771
|
return /* @__PURE__ */ y("div", {
|
|
5751
5772
|
className: K("wu-text-gray-lead wu-table-container wu-relative", !I && u && !R && "wu-h-full"),
|
|
5752
5773
|
children: I ? /* @__PURE__ */ b("div", {
|
|
5753
5774
|
ref: T,
|
|
5754
5775
|
onScroll: O,
|
|
5755
|
-
className: K("wu-overflow-x-auto wu-w-full",
|
|
5756
|
-
children: [p && /* @__PURE__ */ y(
|
|
5776
|
+
className: K("wu-overflow-x-auto wu-w-full", es({ variant: i })),
|
|
5777
|
+
children: [p && /* @__PURE__ */ y(Yo, {
|
|
5757
5778
|
className: "wu-font-light",
|
|
5758
5779
|
children: p
|
|
5759
5780
|
}), r ? /* @__PURE__ */ y("div", {
|
|
5760
5781
|
className: "wu-text-center wu-h-[35vh] wu-flex wu-items-center wu-justify-center",
|
|
5761
5782
|
children: f ?? /* @__PURE__ */ y(Ze, { className: "wu-w-full" })
|
|
5762
|
-
}) : F.getRowModel().rows?.length ? /* @__PURE__ */ y(
|
|
5783
|
+
}) : F.getRowModel().rows?.length ? /* @__PURE__ */ y($o, {
|
|
5763
5784
|
table: F,
|
|
5764
5785
|
size: o,
|
|
5765
5786
|
isRowDisabled: s?.isRowDisabled,
|
|
@@ -5784,19 +5805,19 @@ var Yo = ({ table: e, size: t, isRowDisabled: n, containerHeight: r = 600, sorta
|
|
|
5784
5805
|
onScroll: O,
|
|
5785
5806
|
className: K("wu-overflow-x-auto wu-w-full", u && "wu-overflow-y-auto", u && !R && "wu-h-full"),
|
|
5786
5807
|
style: u && R ? { maxHeight: R } : void 0,
|
|
5787
|
-
children: /* @__PURE__ */ b(
|
|
5808
|
+
children: /* @__PURE__ */ b(Ho, {
|
|
5788
5809
|
...S,
|
|
5789
|
-
className: K("wu-w-full",
|
|
5810
|
+
className: K("wu-w-full", es({ variant: i }), x),
|
|
5790
5811
|
style: {
|
|
5791
5812
|
tableLayout: _,
|
|
5792
5813
|
...v
|
|
5793
5814
|
},
|
|
5794
5815
|
children: [
|
|
5795
|
-
p && /* @__PURE__ */ y(
|
|
5816
|
+
p && /* @__PURE__ */ y(Yo, {
|
|
5796
5817
|
className: "wu-font-light",
|
|
5797
5818
|
children: p
|
|
5798
5819
|
}),
|
|
5799
|
-
!g && /* @__PURE__ */ y(
|
|
5820
|
+
!g && /* @__PURE__ */ y(Zo, {
|
|
5800
5821
|
table: F,
|
|
5801
5822
|
sortableColumns: A,
|
|
5802
5823
|
manual: !0,
|
|
@@ -5811,7 +5832,7 @@ var Yo = ({ table: e, size: t, isRowDisabled: n, containerHeight: r = 600, sorta
|
|
|
5811
5832
|
isScrolledLeft: E,
|
|
5812
5833
|
isScrolledRight: D
|
|
5813
5834
|
}),
|
|
5814
|
-
/* @__PURE__ */ y(
|
|
5835
|
+
/* @__PURE__ */ y(Xo, {
|
|
5815
5836
|
table: F,
|
|
5816
5837
|
size: o,
|
|
5817
5838
|
NoDataContent: l,
|
|
@@ -5826,11 +5847,11 @@ var Yo = ({ table: e, size: t, isRowDisabled: n, containerHeight: r = 600, sorta
|
|
|
5826
5847
|
})
|
|
5827
5848
|
})
|
|
5828
5849
|
});
|
|
5829
|
-
},
|
|
5850
|
+
}, ns = ({ data: e, columns: t, variant: r = "unstyled", size: i = "default", sort: a, filterText: o, pagination: s, stickyHeader: c, maxHeight: l, HeaderAction: d, CustomLoader: p, NoDataContent: h, isLoading: g, caption: _, rowSelection: v, isRowExpandable: x, hideHeader: S = !1, virtualization: C, tableLayout: w = "fixed", style: T, className: E, ...D }) => {
|
|
5830
5851
|
let [O, k] = n.useState(() => a?.defaultSort ? [{
|
|
5831
5852
|
id: a.defaultSort.id,
|
|
5832
5853
|
desc: a.defaultSort.desc
|
|
5833
|
-
}] : []), [A, j] = m([]), [M, N] = m(s?.pageIndex ?? 0), { scrollContainerRef: ee, isScrolledLeft: P, isScrolledRight: F, handleScroll: I } =
|
|
5854
|
+
}] : []), [A, j] = m([]), [M, N] = m(s?.pageIndex ?? 0), { scrollContainerRef: ee, isScrolledLeft: P, isScrolledRight: F, handleScroll: I } = Po(), { finalColumns: L, rowSelectionState: R, sortableColumns: te, selectedRowCount: z, columnsWithExpand: B, expanded: ne, setExpanded: re, handleRowSelectionChange: V } = No({
|
|
5834
5855
|
data: e,
|
|
5835
5856
|
columns: t,
|
|
5836
5857
|
rowSelection: v,
|
|
@@ -5868,17 +5889,17 @@ var Yo = ({ table: e, size: t, isRowDisabled: n, containerHeight: r = 600, sorta
|
|
|
5868
5889
|
]), u(() => {
|
|
5869
5890
|
s && s?.pageIndex !== M && (v?.onRowSelect([]), H.resetRowSelection(), N(s.pageIndex));
|
|
5870
5891
|
}, [s?.pageIndex]);
|
|
5871
|
-
let ae =
|
|
5892
|
+
let ae = Ao(C?.enabled, C?.threshold, e.length), oe = C?.maxHeight ?? 600, U = typeof l == "number" ? `${l}px` : l;
|
|
5872
5893
|
return /* @__PURE__ */ y("div", {
|
|
5873
5894
|
className: K("wu-text-gray-lead wu-table-container wu-relative", !ae && c && !U && "wu-h-full"),
|
|
5874
5895
|
children: ae ? /* @__PURE__ */ b("div", {
|
|
5875
5896
|
ref: ee,
|
|
5876
5897
|
onScroll: I,
|
|
5877
|
-
className: K("wu-overflow-x-auto wu-w-full",
|
|
5878
|
-
children: [_ && /* @__PURE__ */ y(
|
|
5898
|
+
className: K("wu-overflow-x-auto wu-w-full", es({ variant: r })),
|
|
5899
|
+
children: [_ && /* @__PURE__ */ y(Yo, { children: _ }), g ? /* @__PURE__ */ y("div", {
|
|
5879
5900
|
className: "wu-text-center wu-h-[35vh] wu-flex wu-items-center wu-justify-center",
|
|
5880
5901
|
children: p ?? /* @__PURE__ */ y(Ze, { className: "wu-w-full" })
|
|
5881
|
-
}) : H.getRowModel().rows?.length ? /* @__PURE__ */ y(
|
|
5902
|
+
}) : H.getRowModel().rows?.length ? /* @__PURE__ */ y($o, {
|
|
5882
5903
|
table: H,
|
|
5883
5904
|
size: i,
|
|
5884
5905
|
isRowDisabled: v?.isRowDisabled,
|
|
@@ -5900,16 +5921,16 @@ var Yo = ({ table: e, size: t, isRowDisabled: n, containerHeight: r = 600, sorta
|
|
|
5900
5921
|
onScroll: I,
|
|
5901
5922
|
className: K("wu-overflow-x-auto wu-w-full", c && "wu-overflow-y-auto", c && !U && "wu-h-full"),
|
|
5902
5923
|
style: c && U ? { maxHeight: U } : void 0,
|
|
5903
|
-
children: /* @__PURE__ */ b(
|
|
5924
|
+
children: /* @__PURE__ */ b(Ho, {
|
|
5904
5925
|
...D,
|
|
5905
|
-
className: K(`wu-table-${w}`, "wu-w-full",
|
|
5926
|
+
className: K(`wu-table-${w}`, "wu-w-full", es({ variant: r }), E),
|
|
5906
5927
|
style: {
|
|
5907
5928
|
tableLayout: w,
|
|
5908
5929
|
...T
|
|
5909
5930
|
},
|
|
5910
5931
|
children: [
|
|
5911
|
-
_ && /* @__PURE__ */ y(
|
|
5912
|
-
!S && /* @__PURE__ */ y(
|
|
5932
|
+
_ && /* @__PURE__ */ y(Yo, { children: _ }),
|
|
5933
|
+
!S && /* @__PURE__ */ y(Zo, {
|
|
5913
5934
|
table: H,
|
|
5914
5935
|
sortableColumns: te,
|
|
5915
5936
|
size: i,
|
|
@@ -5920,7 +5941,7 @@ var Yo = ({ table: e, size: t, isRowDisabled: n, containerHeight: r = 600, sorta
|
|
|
5920
5941
|
isScrolledLeft: P,
|
|
5921
5942
|
isScrolledRight: F
|
|
5922
5943
|
}),
|
|
5923
|
-
/* @__PURE__ */ y(
|
|
5944
|
+
/* @__PURE__ */ y(Xo, {
|
|
5924
5945
|
table: H,
|
|
5925
5946
|
size: i,
|
|
5926
5947
|
NoDataContent: h,
|
|
@@ -5935,22 +5956,22 @@ var Yo = ({ table: e, size: t, isRowDisabled: n, containerHeight: r = 600, sorta
|
|
|
5935
5956
|
})
|
|
5936
5957
|
})
|
|
5937
5958
|
});
|
|
5938
|
-
},
|
|
5959
|
+
}, rs = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y("textarea", {
|
|
5939
5960
|
className: K("wu-flex wu-w-full wu-border-b wu-border-gray-subtle wu-bg-gray-10 wu-text-gray-lead wu-p-2 wu-text-sm wu-font-normal wu-placeholder:wu-text-gray-subtle wu-placeholder:wu-font-light focus-visible:wu-outline-none disabled:wu-cursor-not-allowed disabled:wu-bg-gray-20 disabled:wu-border-gray-40 disabled:wu-text-gray-subtle read-only:wu-cursor-not-allowed read-only:wu-bg-gray-20 read-only:wu-border-gray-40 read-only:wu-text-gray-subtle focus:wu-border-blue-p wu-transition-colors hover:wu-border-gray-40 ", e),
|
|
5940
5961
|
ref: n,
|
|
5941
5962
|
...t
|
|
5942
5963
|
}));
|
|
5943
|
-
|
|
5964
|
+
rs.displayName = "Textarea";
|
|
5944
5965
|
//#endregion
|
|
5945
5966
|
//#region src/components/textarea/WuTextarea.tsx
|
|
5946
|
-
var
|
|
5967
|
+
var is = n.forwardRef((e, t) => {
|
|
5947
5968
|
let { Label: n, id: r = Ne(), variant: i = "flat", readonly: a, maxLength: o, labelPosition: s = "top", ...c } = e, l = (e) => {
|
|
5948
5969
|
c.onChange && c.onChange(e);
|
|
5949
5970
|
};
|
|
5950
5971
|
return /* @__PURE__ */ b("div", {
|
|
5951
5972
|
className: K(Pe(s), "wu-flex wu-textarea-container"),
|
|
5952
5973
|
dir: c.dir,
|
|
5953
|
-
children: [/* @__PURE__ */ y(
|
|
5974
|
+
children: [/* @__PURE__ */ y(rs, {
|
|
5954
5975
|
...c,
|
|
5955
5976
|
ref: t,
|
|
5956
5977
|
id: r,
|
|
@@ -5965,25 +5986,25 @@ var es = n.forwardRef((e, t) => {
|
|
|
5965
5986
|
})]
|
|
5966
5987
|
});
|
|
5967
5988
|
});
|
|
5968
|
-
|
|
5989
|
+
is.displayName = "WuTextarea";
|
|
5969
5990
|
//#endregion
|
|
5970
5991
|
//#region src/components/timePicker/utils/timePickerUtils.ts
|
|
5971
|
-
function
|
|
5992
|
+
function as(e) {
|
|
5972
5993
|
return typeof e == "string" && e.includes("T") ? j(ee(e), "HH:mm") : typeof e == "string" && /^\d{2}:\d{2}:\d{2}$/.test(e) ? j(N(e, "HH:mm:ss", /* @__PURE__ */ new Date()), "HH:mm") : typeof e == "string" && /^\d{2}:\d{2}$/.test(e) ? e : "00:00";
|
|
5973
5994
|
}
|
|
5974
|
-
var
|
|
5975
|
-
function
|
|
5995
|
+
var os = ["12", ...Array.from({ length: 11 }, (e, t) => String(t + 1).padStart(2, "0"))], ss = Array.from({ length: 60 }, (e, t) => String(t).padStart(2, "0")), cs = ["am", "pm"];
|
|
5996
|
+
function ls(e) {
|
|
5976
5997
|
return Array(50).fill(e).flat();
|
|
5977
5998
|
}
|
|
5978
|
-
function
|
|
5999
|
+
function us(e, t) {
|
|
5979
6000
|
let n = e.indexOf(t);
|
|
5980
6001
|
return [...e.slice(n), ...e.slice(0, n)];
|
|
5981
6002
|
}
|
|
5982
|
-
function
|
|
6003
|
+
function ds(e, t) {
|
|
5983
6004
|
let n = Number(e);
|
|
5984
6005
|
return t === "pm" && n < 12 && (n += 12), t === "am" && n === 12 && (n = 0), String(n).padStart(2, "0");
|
|
5985
6006
|
}
|
|
5986
|
-
function
|
|
6007
|
+
function fs(e) {
|
|
5987
6008
|
let t = Number(e), n = t >= 12 ? "pm" : "am", r = t % 12 == 0 ? 12 : t % 12;
|
|
5988
6009
|
return {
|
|
5989
6010
|
hour: String(r),
|
|
@@ -5992,15 +6013,15 @@ function cs(e) {
|
|
|
5992
6013
|
}
|
|
5993
6014
|
//#endregion
|
|
5994
6015
|
//#region src/components/timePicker/components/timeColumn.tsx
|
|
5995
|
-
var
|
|
6016
|
+
var ps = ({ value: e, isSelected: t, onClick: n }) => /* @__PURE__ */ y("div", {
|
|
5996
6017
|
onClick: n,
|
|
5997
6018
|
className: K("wu-w-8 wu-h-8 wu-flex wu-items-center wu-justify-center wu-text-center wu-snap-start wu-rounded-[2px] wu-cursor-pointer hover:wu-bg-blue-p hover:wu-text-white", t && "wu-bg-blue-p/15 wu-text-blue-p"),
|
|
5998
6019
|
children: e
|
|
5999
|
-
}),
|
|
6020
|
+
}), ms = ({ values: e, selectedValue: t, scrollRef: n, onSelect: r, repeatItems: i = !0, className: a }) => /* @__PURE__ */ y("div", {
|
|
6000
6021
|
ref: n,
|
|
6001
6022
|
className: K("wu-overflow-y-scroll wu-w-8 wu-snap-y wu-snap-mandatory [&::-webkit-scrollbar]:hidden [-ms-overflow-style:none] [scrollbar-width:none]", a),
|
|
6002
6023
|
role: "presentation",
|
|
6003
|
-
children: (i ?
|
|
6024
|
+
children: (i ? ls(e) : e).map((e, n) => /* @__PURE__ */ y(ps, {
|
|
6004
6025
|
value: e,
|
|
6005
6026
|
isSelected: e === t,
|
|
6006
6027
|
onClick: () => r(e)
|
|
@@ -6008,16 +6029,16 @@ var ls = ({ value: e, isSelected: t, onClick: n }) => /* @__PURE__ */ y("div", {
|
|
|
6008
6029
|
});
|
|
6009
6030
|
//#endregion
|
|
6010
6031
|
//#region src/components/timePicker/hooks/useRotatedArrays.ts
|
|
6011
|
-
function
|
|
6032
|
+
function hs(e, t, n, r) {
|
|
6012
6033
|
return {
|
|
6013
|
-
rotatedHours: f(() => e ? os
|
|
6014
|
-
rotatedMinutes: f(() => e ?
|
|
6015
|
-
rotatedMeridiem: f(() => e ?
|
|
6034
|
+
rotatedHours: f(() => e ? us(os, t.padStart(2, "0")) : os, [e]),
|
|
6035
|
+
rotatedMinutes: f(() => e ? us(ss, n.padStart(2, "0")) : ss, [e]),
|
|
6036
|
+
rotatedMeridiem: f(() => e ? us(cs, r) : cs, [e])
|
|
6016
6037
|
};
|
|
6017
6038
|
}
|
|
6018
6039
|
//#endregion
|
|
6019
6040
|
//#region src/components/timePicker/hooks/useTimePickerScroll.ts
|
|
6020
|
-
function
|
|
6041
|
+
function gs(e, t, n) {
|
|
6021
6042
|
u(() => {
|
|
6022
6043
|
function r(e) {
|
|
6023
6044
|
if (e) {
|
|
@@ -6045,16 +6066,16 @@ function fs(e, t, n) {
|
|
|
6045
6066
|
}
|
|
6046
6067
|
//#endregion
|
|
6047
6068
|
//#region src/components/timePicker/WuTimePicker.tsx
|
|
6048
|
-
var
|
|
6069
|
+
var _s = ({ className: e, time: t, Label: r, labelPosition: i, dir: a, ...o }) => {
|
|
6049
6070
|
let [c, l] = m(!1), [u, d] = m(""), f = p(null), h = p(null), g = p(null), _ = p(null), [v, x] = m("12"), [S, C] = m("00"), [w, T] = m("am");
|
|
6050
6071
|
n.useEffect(() => {
|
|
6051
6072
|
if (!t) {
|
|
6052
6073
|
d(""), x("12"), C("00"), T("am"), f.current && (f.current.value = "");
|
|
6053
6074
|
return;
|
|
6054
6075
|
}
|
|
6055
|
-
let e =
|
|
6076
|
+
let e = as(t);
|
|
6056
6077
|
d(e);
|
|
6057
|
-
let [n, r] = e.split(":"), { hour: i, meridiem: a } =
|
|
6078
|
+
let [n, r] = e.split(":"), { hour: i, meridiem: a } = fs(n);
|
|
6058
6079
|
x(i), C(r), T(a), f.current && (f.current.value = e);
|
|
6059
6080
|
}, [t]), n.useEffect(() => {
|
|
6060
6081
|
let e = (e) => {
|
|
@@ -6063,10 +6084,10 @@ var ps = ({ className: e, time: t, Label: r, labelPosition: i, dir: a, ...o }) =
|
|
|
6063
6084
|
return document.addEventListener("mousedown", e), () => {
|
|
6064
6085
|
document.removeEventListener("mousedown", e);
|
|
6065
6086
|
};
|
|
6066
|
-
}, []),
|
|
6067
|
-
let { rotatedHours: E, rotatedMinutes: D, rotatedMeridiem: O } =
|
|
6087
|
+
}, []), gs(c, g, _);
|
|
6088
|
+
let { rotatedHours: E, rotatedMinutes: D, rotatedMeridiem: O } = hs(c, v, S, w), k = s((e, t, n) => {
|
|
6068
6089
|
let r = e ?? v, i = t ?? S, a = n ?? w;
|
|
6069
|
-
x(r), C(i), T(a), d(`${
|
|
6090
|
+
x(r), C(i), T(a), d(`${ds(r, a)}:${i}`);
|
|
6070
6091
|
}, [
|
|
6071
6092
|
v,
|
|
6072
6093
|
S,
|
|
@@ -6092,7 +6113,7 @@ var ps = ({ className: e, time: t, Label: r, labelPosition: i, dir: a, ...o }) =
|
|
|
6092
6113
|
role: "textbox",
|
|
6093
6114
|
onChange: (e) => {
|
|
6094
6115
|
d(e.target.value);
|
|
6095
|
-
let [t, n] = e.target.value.split(":"), { hour: r, meridiem: i } =
|
|
6116
|
+
let [t, n] = e.target.value.split(":"), { hour: r, meridiem: i } = fs(t);
|
|
6096
6117
|
x(r), C(n), T(i);
|
|
6097
6118
|
},
|
|
6098
6119
|
className: "wu-w-[136px] wu-h-8 wu-pr-6 wu-border wu-border-lead/40 wu-text-gray-lead wu-timepicker-input",
|
|
@@ -6114,21 +6135,21 @@ var ps = ({ className: e, time: t, Label: r, labelPosition: i, dir: a, ...o }) =
|
|
|
6114
6135
|
c && /* @__PURE__ */ b("div", {
|
|
6115
6136
|
className: K("wu-absolute wu-w-[136px] wu-h-[228px] wu-flex wu-bg-white wu-border wu-shadow wu-z-50 wu-text-xs wu-gap-1 wu-p-1 wu-border-blue-p wu-text-lead", e),
|
|
6116
6137
|
children: [
|
|
6117
|
-
/* @__PURE__ */ y(
|
|
6138
|
+
/* @__PURE__ */ y(ms, {
|
|
6118
6139
|
values: E,
|
|
6119
6140
|
selectedValue: v.padStart(2, "0"),
|
|
6120
6141
|
scrollRef: g,
|
|
6121
6142
|
onSelect: (e) => k(e, S),
|
|
6122
6143
|
className: "wu-time-hour-picker"
|
|
6123
6144
|
}),
|
|
6124
|
-
/* @__PURE__ */ y(
|
|
6145
|
+
/* @__PURE__ */ y(ms, {
|
|
6125
6146
|
values: D,
|
|
6126
6147
|
selectedValue: S.padStart(2, "0"),
|
|
6127
6148
|
scrollRef: _,
|
|
6128
6149
|
onSelect: (e) => k(v, e),
|
|
6129
6150
|
className: "wu-time-minute-picker"
|
|
6130
6151
|
}),
|
|
6131
|
-
/* @__PURE__ */ y(
|
|
6152
|
+
/* @__PURE__ */ y(ms, {
|
|
6132
6153
|
values: O,
|
|
6133
6154
|
selectedValue: w,
|
|
6134
6155
|
onSelect: (e) => k(void 0, void 0, e),
|
|
@@ -6141,27 +6162,27 @@ var ps = ({ className: e, time: t, Label: r, labelPosition: i, dir: a, ...o }) =
|
|
|
6141
6162
|
})]
|
|
6142
6163
|
});
|
|
6143
6164
|
};
|
|
6144
|
-
|
|
6165
|
+
_s.displayName = "WuTimePicker";
|
|
6145
6166
|
//#endregion
|
|
6146
6167
|
//#region src/base/ui/useToast.ts
|
|
6147
|
-
var
|
|
6148
|
-
function
|
|
6149
|
-
return
|
|
6168
|
+
var vs = 1, ys = 1e6, bs = 0;
|
|
6169
|
+
function xs() {
|
|
6170
|
+
return bs = (bs + 1) % (2 ** 53 - 1), bs.toString();
|
|
6150
6171
|
}
|
|
6151
|
-
var
|
|
6152
|
-
if (
|
|
6172
|
+
var Ss = /* @__PURE__ */ new Map(), Cs = (e) => {
|
|
6173
|
+
if (Ss.has(e)) return;
|
|
6153
6174
|
let t = setTimeout(() => {
|
|
6154
|
-
|
|
6175
|
+
Ss.delete(e), Ds({
|
|
6155
6176
|
type: "REMOVE_TOAST",
|
|
6156
6177
|
toastId: e
|
|
6157
6178
|
});
|
|
6158
|
-
},
|
|
6159
|
-
|
|
6160
|
-
},
|
|
6179
|
+
}, ys);
|
|
6180
|
+
Ss.set(e, t);
|
|
6181
|
+
}, ws = (e, t) => {
|
|
6161
6182
|
switch (t.type) {
|
|
6162
6183
|
case "ADD_TOAST": return {
|
|
6163
6184
|
...e,
|
|
6164
|
-
toasts: [t.toast, ...e.toasts].slice(0,
|
|
6185
|
+
toasts: [t.toast, ...e.toasts].slice(0, vs)
|
|
6165
6186
|
};
|
|
6166
6187
|
case "UPDATE_TOAST": return {
|
|
6167
6188
|
...e,
|
|
@@ -6172,8 +6193,8 @@ var vs = /* @__PURE__ */ new Map(), ys = (e) => {
|
|
|
6172
6193
|
};
|
|
6173
6194
|
case "DISMISS_TOAST": {
|
|
6174
6195
|
let { toastId: n } = t;
|
|
6175
|
-
return n ?
|
|
6176
|
-
|
|
6196
|
+
return n ? Cs(n) : e.toasts.forEach((e) => {
|
|
6197
|
+
Cs(e.id);
|
|
6177
6198
|
}), {
|
|
6178
6199
|
...e,
|
|
6179
6200
|
toasts: e.toasts.map((e) => e.id === n || n === void 0 ? {
|
|
@@ -6190,24 +6211,24 @@ var vs = /* @__PURE__ */ new Map(), ys = (e) => {
|
|
|
6190
6211
|
toasts: e.toasts.filter((e) => e.id !== t.toastId)
|
|
6191
6212
|
};
|
|
6192
6213
|
}
|
|
6193
|
-
},
|
|
6194
|
-
function
|
|
6195
|
-
|
|
6196
|
-
e(
|
|
6214
|
+
}, Ts = [], Es = { toasts: [] };
|
|
6215
|
+
function Ds(e) {
|
|
6216
|
+
Es = ws(Es, e), Ts.forEach((e) => {
|
|
6217
|
+
e(Es);
|
|
6197
6218
|
});
|
|
6198
6219
|
}
|
|
6199
|
-
function
|
|
6200
|
-
let t =
|
|
6220
|
+
function Os({ ...e }) {
|
|
6221
|
+
let t = xs(), n = (e) => Ds({
|
|
6201
6222
|
type: "UPDATE_TOAST",
|
|
6202
6223
|
toast: {
|
|
6203
6224
|
...e,
|
|
6204
6225
|
id: t
|
|
6205
6226
|
}
|
|
6206
|
-
}), r = () =>
|
|
6227
|
+
}), r = () => Ds({
|
|
6207
6228
|
type: "DISMISS_TOAST",
|
|
6208
6229
|
toastId: t
|
|
6209
6230
|
});
|
|
6210
|
-
return
|
|
6231
|
+
return Ds({
|
|
6211
6232
|
type: "ADD_TOAST",
|
|
6212
6233
|
toast: {
|
|
6213
6234
|
...e,
|
|
@@ -6223,15 +6244,15 @@ function ws({ ...e }) {
|
|
|
6223
6244
|
update: n
|
|
6224
6245
|
};
|
|
6225
6246
|
}
|
|
6226
|
-
function
|
|
6227
|
-
let [e, t] = m(
|
|
6228
|
-
return u(() => (
|
|
6229
|
-
let e =
|
|
6230
|
-
e > -1 &&
|
|
6247
|
+
function ks() {
|
|
6248
|
+
let [e, t] = m(Es);
|
|
6249
|
+
return u(() => (Ts.push(t), () => {
|
|
6250
|
+
let e = Ts.indexOf(t);
|
|
6251
|
+
e > -1 && Ts.splice(e, 1);
|
|
6231
6252
|
}), [e]), {
|
|
6232
6253
|
...e,
|
|
6233
|
-
toast:
|
|
6234
|
-
dismiss: (e) =>
|
|
6254
|
+
toast: Os,
|
|
6255
|
+
dismiss: (e) => Ds({
|
|
6235
6256
|
type: "DISMISS_TOAST",
|
|
6236
6257
|
toastId: e
|
|
6237
6258
|
})
|
|
@@ -6239,12 +6260,12 @@ function Ts() {
|
|
|
6239
6260
|
}
|
|
6240
6261
|
//#endregion
|
|
6241
6262
|
//#region src/components/toast/hooks/useWuShowToast.ts
|
|
6242
|
-
var
|
|
6263
|
+
var As = () => ({ showToast: ({ message: e, variant: t, duration: n, position: r }) => Os({
|
|
6243
6264
|
description: e,
|
|
6244
6265
|
variant: t,
|
|
6245
6266
|
duration: n,
|
|
6246
6267
|
position: r
|
|
6247
|
-
}) }),
|
|
6268
|
+
}) }), js = G.Provider, Ms = z("wu-fixed wu-z-[100] wu-flex wu-max-h-screen wu-w-full wu-flex-col-reverse wu-px-4 wu-py-2 sm:wu-flex-col md:wu-max-w-[720px] wu-w-fit wu-toast-container", {
|
|
6248
6269
|
variants: { position: {
|
|
6249
6270
|
topRight: "wu-right-0 wu-top-0",
|
|
6250
6271
|
top: "wu-top-0 wu-left-1/2 wu--translate-x-1/2",
|
|
@@ -6254,13 +6275,13 @@ var Es = () => ({ showToast: ({ message: e, variant: t, duration: n, position: r
|
|
|
6254
6275
|
bottomLeft: "wu-left-0 wu-bottom-0"
|
|
6255
6276
|
} },
|
|
6256
6277
|
defaultVariants: { position: "top" }
|
|
6257
|
-
}),
|
|
6278
|
+
}), Ns = t.forwardRef(({ className: e, position: t, ...n }, r) => /* @__PURE__ */ y(G.Viewport, {
|
|
6258
6279
|
ref: r,
|
|
6259
|
-
className: K(
|
|
6280
|
+
className: K(Ms({ position: t }), e),
|
|
6260
6281
|
...n
|
|
6261
6282
|
}));
|
|
6262
|
-
|
|
6263
|
-
var
|
|
6283
|
+
Ns.displayName = G.Viewport.displayName;
|
|
6284
|
+
var Ps = z("group wu-pointer-events-auto wu-text-xs wu-font-normal wu-relative wu-flex wu-w-full wu-min-h-12 wu-items-center wu-justify-between wu-overflow-hidden wu-px-4 wu-pr-0 wu-py-2 wu-shadow-sm wu-transition-all data-[swipe=cancel]:wu-translate-y-0 data-[swipe=end]:wu-translate-y-[var(--radix-toast-swipe-end-y)] data-[swipe=move]:wu-translate-y-[var(--radix-toast-swipe-move-y)] data-[swipe=move]:wu-transition-none data-[state=open]:wu-animate-in data-[state=closed]:wu-animate-out data-[swipe=end]:wu-animate-out data-[state=closed]:wu-fade-out-80", {
|
|
6264
6285
|
variants: {
|
|
6265
6286
|
variant: {
|
|
6266
6287
|
default: "wu-border wu-bg-white wu-text-text",
|
|
@@ -6282,22 +6303,22 @@ var As = z("group wu-pointer-events-auto wu-text-xs wu-font-normal wu-relative w
|
|
|
6282
6303
|
variant: "success",
|
|
6283
6304
|
position: "top"
|
|
6284
6305
|
}
|
|
6285
|
-
}),
|
|
6306
|
+
}), Fs = t.forwardRef(({ className: e, variant: t, position: n, ...r }, i) => /* @__PURE__ */ y(G.Root, {
|
|
6286
6307
|
ref: i,
|
|
6287
|
-
className: K(
|
|
6308
|
+
className: K(Ps({
|
|
6288
6309
|
variant: t,
|
|
6289
6310
|
position: n
|
|
6290
6311
|
}), e),
|
|
6291
6312
|
...r
|
|
6292
6313
|
}));
|
|
6293
|
-
|
|
6294
|
-
var
|
|
6314
|
+
Fs.displayName = G.Root.displayName;
|
|
6315
|
+
var Is = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y(G.Action, {
|
|
6295
6316
|
ref: n,
|
|
6296
6317
|
className: K("wu-inline-flex wu-h-8 wu-shrink-0 wu-items-center wu-justify-center wu-border wu-bg-transparent wu-px-3 wu-text-sm wu-font-medium wu-ring-offset-background wu-transition-colors hover:wu-bg-secondary focus:wu-outline-none focus:wu-ring-2 focus:wu-ring-ring focus:wu-ring-offset-2 disabled:wu-cursor-not-allowed disabled:wu-opacity-50 group-[.destructive]:wu-border-muted/40 group-[.destructive]:hover:wu-border-destructive/30 group-[.destructive]:hover:wu-bg-destructive group-[.destructive]:hover:wu-text-destructive-foreground group-[.destructive]:focus:wu-ring-destructive", e),
|
|
6297
6318
|
...t
|
|
6298
6319
|
}));
|
|
6299
|
-
|
|
6300
|
-
var
|
|
6320
|
+
Is.displayName = G.Action.displayName;
|
|
6321
|
+
var Ls = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y(G.Close, {
|
|
6301
6322
|
ref: n,
|
|
6302
6323
|
className: K("wu-relative wu-right-4 wu-bottom-2 wu-rounded-sm wu-w-4 wu-h-4 wu-p-1 wu-text-foreground/50 wu-opacity-100 wu-transition-opacity hover:wu-text-foreground focus:wu-opacity-100 focus:wu-outline-none group-hover:wu-opacity-100 group-[.destructive]:wu-text-red-300 group-[.destructive]:hover:wu-text-red-50 group-[.destructive]:focus:wu-ring-red-400 group-[.destructive]:focus:wu-ring-offset-red-600", e),
|
|
6303
6324
|
"toast-close": "",
|
|
@@ -6305,27 +6326,27 @@ var Ns = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y(G.Close,
|
|
|
6305
6326
|
...t,
|
|
6306
6327
|
children: /* @__PURE__ */ y("span", { className: "wm-close wu-text-base" })
|
|
6307
6328
|
}));
|
|
6308
|
-
|
|
6309
|
-
var
|
|
6329
|
+
Ls.displayName = G.Close.displayName;
|
|
6330
|
+
var Rs = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y(G.Title, {
|
|
6310
6331
|
ref: n,
|
|
6311
6332
|
className: K("wu-text-sm wu-font-semibold", e),
|
|
6312
6333
|
...t
|
|
6313
6334
|
}));
|
|
6314
|
-
|
|
6315
|
-
var
|
|
6335
|
+
Rs.displayName = G.Title.displayName;
|
|
6336
|
+
var zs = t.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ y(G.Description, {
|
|
6316
6337
|
ref: n,
|
|
6317
6338
|
className: K("wu-text-sm wu-opacity-90", e),
|
|
6318
6339
|
...t
|
|
6319
6340
|
}));
|
|
6320
|
-
|
|
6341
|
+
zs.displayName = G.Description.displayName;
|
|
6321
6342
|
//#endregion
|
|
6322
6343
|
//#region src/base/ui/toaster.tsx
|
|
6323
|
-
function
|
|
6324
|
-
let { toasts: e } =
|
|
6344
|
+
function Bs() {
|
|
6345
|
+
let { toasts: e } = ks(), t = e.reduce((e, t) => {
|
|
6325
6346
|
let n = t.position || "top";
|
|
6326
6347
|
return e[n] || (e[n] = []), e[n].push(t), e;
|
|
6327
6348
|
}, {});
|
|
6328
|
-
return /* @__PURE__ */ y(
|
|
6349
|
+
return /* @__PURE__ */ y(js, { children: Object.entries(t).map(([e, t]) => /* @__PURE__ */ y(Ns, {
|
|
6329
6350
|
position: e,
|
|
6330
6351
|
children: t.map(function({ id: e, title: t, description: n, action: r, variant: i, position: a, ...o }) {
|
|
6331
6352
|
let s = {
|
|
@@ -6334,14 +6355,14 @@ function Is() {
|
|
|
6334
6355
|
warning: "wm-error",
|
|
6335
6356
|
error: "wm-cancel"
|
|
6336
6357
|
};
|
|
6337
|
-
return /* @__PURE__ */ b(
|
|
6358
|
+
return /* @__PURE__ */ b(Fs, {
|
|
6338
6359
|
variant: i || "success",
|
|
6339
6360
|
position: a,
|
|
6340
6361
|
...o,
|
|
6341
6362
|
children: [
|
|
6342
6363
|
/* @__PURE__ */ b("div", {
|
|
6343
6364
|
className: "wu-grid wu-gap-1",
|
|
6344
|
-
children: [t && /* @__PURE__ */ y(
|
|
6365
|
+
children: [t && /* @__PURE__ */ y(Rs, { children: t }), n && /* @__PURE__ */ b(zs, {
|
|
6345
6366
|
className: "wu-flex wu-items-center wu-gap-3 wu-pr-6",
|
|
6346
6367
|
children: [/* @__PURE__ */ y(J, {
|
|
6347
6368
|
icon: s[i || "success"],
|
|
@@ -6350,7 +6371,7 @@ function Is() {
|
|
|
6350
6371
|
})]
|
|
6351
6372
|
}),
|
|
6352
6373
|
r,
|
|
6353
|
-
/* @__PURE__ */ y(
|
|
6374
|
+
/* @__PURE__ */ y(Ls, {})
|
|
6354
6375
|
]
|
|
6355
6376
|
}, e);
|
|
6356
6377
|
})
|
|
@@ -6358,24 +6379,24 @@ function Is() {
|
|
|
6358
6379
|
}
|
|
6359
6380
|
//#endregion
|
|
6360
6381
|
//#region src/components/toast/WuToast.tsx
|
|
6361
|
-
var
|
|
6382
|
+
var Vs = () => /* @__PURE__ */ y(Bs, {}), Hs = t.forwardRef(({ className: e, dir: t, ...n }, r) => /* @__PURE__ */ y(Ae.Root, {
|
|
6362
6383
|
className: K("wu-bg-gray-40 wu-inline-flex wu-h-2 wu-w-8 wu-shrink-0 wu-cursor-pointer wu-items-center wu-rounded-full wu-transition-colors focus-visible:wu-outline-none focus-visible:wu-ring-2 focus-visible:wu-ring-ring focus-visible:wu-ring-offset-[5px] focus-visible:wu-ring-offset-background disabled:wu-cursor-not-allowed disabled:wu-opacity-50 data-[state=unchecked]:wu-bg-gray-25 wu-group", "hover:wu-bg-gray-subtle hover:data-[state=unchecked]:wu-bg-gray-subtle", e),
|
|
6363
6384
|
...n,
|
|
6364
6385
|
ref: r,
|
|
6365
6386
|
children: /* @__PURE__ */ y(Ae.Thumb, { className: K("wu-block wu-h-4 wu-w-4 wu-rounded-full wu-bg-gray-subtle wu-shadow-lg wu-ring-0 wu-transition-all data-[state=checked]:wu-bg-blue-p", "group-hover:data-[state=unchecked]:wu-bg-gray-lead", t === "rtl" && "-wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0", t !== "rtl" && "wu-translate-x-4 data-[state=unchecked]:wu-translate-x-0", "wu-toggle-thumb") })
|
|
6366
6387
|
}));
|
|
6367
|
-
|
|
6388
|
+
Hs.displayName = Ae.Root.displayName;
|
|
6368
6389
|
//#endregion
|
|
6369
6390
|
//#region src/components/toggle/WuToggle.tsx
|
|
6370
|
-
var
|
|
6391
|
+
var Us = n.forwardRef((e, t) => {
|
|
6371
6392
|
let { Label: r, labelPosition: i = "right", onChange: a, className: o, dir: s, disabled: c, id: l = Ne(), ...u } = e;
|
|
6372
6393
|
return n.useEffect(() => {
|
|
6373
6394
|
let { checked: e, defaultChecked: t } = u;
|
|
6374
6395
|
e !== void 0 && t !== void 0 && console.error("WuToggle: Both `checked` and `defaultChecked` props are set. Use only one of them.");
|
|
6375
6396
|
}, [u.checked, u.defaultChecked]), /* @__PURE__ */ b("div", {
|
|
6376
|
-
className: K(
|
|
6397
|
+
className: K(Ws({ labelPosition: i }), "wu-toggle-container"),
|
|
6377
6398
|
dir: s,
|
|
6378
|
-
children: [/* @__PURE__ */ y(
|
|
6399
|
+
children: [/* @__PURE__ */ y(Hs, {
|
|
6379
6400
|
...u,
|
|
6380
6401
|
id: l,
|
|
6381
6402
|
disabled: c,
|
|
@@ -6390,20 +6411,20 @@ var zs = n.forwardRef((e, t) => {
|
|
|
6390
6411
|
})]
|
|
6391
6412
|
});
|
|
6392
6413
|
});
|
|
6393
|
-
|
|
6394
|
-
var
|
|
6414
|
+
Us.displayName = "WuToggle";
|
|
6415
|
+
var Ws = z("wu-flex wu-items-center wu-gap-3 wu-w-fit", { variants: { labelPosition: {
|
|
6395
6416
|
right: "wu-flex-row",
|
|
6396
6417
|
left: "wu-flex-row-reverse",
|
|
6397
6418
|
top: "wu-flex-col-reverse wu-items-baseline"
|
|
6398
|
-
} } }),
|
|
6399
|
-
let e = l(
|
|
6419
|
+
} } }), Gs = r(null), Ks = () => {
|
|
6420
|
+
let e = l(Gs);
|
|
6400
6421
|
if (!e) throw Error("useTranslation must be used within a WuTranslationProvider");
|
|
6401
6422
|
return e.useTranslation();
|
|
6402
|
-
},
|
|
6403
|
-
let e = l(
|
|
6423
|
+
}, qs = () => {
|
|
6424
|
+
let e = l(Gs);
|
|
6404
6425
|
if (!e) throw Error("useLoadTranslationsFunction must be used within a WuTranslationProvider");
|
|
6405
6426
|
return e;
|
|
6406
|
-
},
|
|
6427
|
+
}, Js = ({ children: e }) => {
|
|
6407
6428
|
let [t, n] = m({}), [r, i] = m({}), a = {
|
|
6408
6429
|
loadTranslations: s(async (e, t) => {
|
|
6409
6430
|
try {
|
|
@@ -6418,109 +6439,212 @@ var Bs = z("wu-flex wu-items-center wu-gap-3 wu-w-fit", { variants: { labelPosit
|
|
|
6418
6439
|
}, []),
|
|
6419
6440
|
useTranslation: s(() => ({ t: (e, n) => t[e] ? t[e] : r[e] ? r[e] : n || e }), [t, r])
|
|
6420
6441
|
};
|
|
6421
|
-
return /* @__PURE__ */ y(
|
|
6442
|
+
return /* @__PURE__ */ y(Gs.Provider, {
|
|
6422
6443
|
value: a,
|
|
6423
6444
|
children: e
|
|
6424
6445
|
});
|
|
6425
|
-
},
|
|
6426
|
-
|
|
6427
|
-
},
|
|
6428
|
-
|
|
6429
|
-
},
|
|
6446
|
+
}, Ys = {}, Xs = !1, Zs = "", Qs = (e) => {
|
|
6447
|
+
Ys = e;
|
|
6448
|
+
}, $s = (e, t) => {
|
|
6449
|
+
Xs = e, Zs = t;
|
|
6450
|
+
}, ec = (e) => Ys[e] ?? e, tc = () => Xs, nc = () => Zs, rc = "wick-ui-i18n-cache::", ic = 3600 * 1e3, ac = (e, t) => `${rc}${e}::${t}`;
|
|
6451
|
+
function oc(e, t, n = ic) {
|
|
6452
|
+
try {
|
|
6453
|
+
let r = localStorage.getItem(ac(e, t));
|
|
6454
|
+
if (!r) return null;
|
|
6455
|
+
let i = JSON.parse(r);
|
|
6456
|
+
return Date.now() - i.ts > n ? (localStorage.removeItem(ac(e, t)), null) : i;
|
|
6457
|
+
} catch {
|
|
6458
|
+
return null;
|
|
6459
|
+
}
|
|
6460
|
+
}
|
|
6461
|
+
function sc(e, t, n, r, i) {
|
|
6462
|
+
try {
|
|
6463
|
+
let a = {
|
|
6464
|
+
data: n,
|
|
6465
|
+
isRtl: r,
|
|
6466
|
+
characterSet: i,
|
|
6467
|
+
ts: Date.now()
|
|
6468
|
+
};
|
|
6469
|
+
localStorage.setItem(ac(e, t), JSON.stringify(a));
|
|
6470
|
+
} catch {}
|
|
6471
|
+
}
|
|
6472
|
+
function cc(e, t, n) {
|
|
6473
|
+
try {
|
|
6474
|
+
let r = localStorage.getItem(ac(e, t));
|
|
6475
|
+
if (!r) return;
|
|
6476
|
+
let i = JSON.parse(r);
|
|
6477
|
+
i.data = {
|
|
6478
|
+
...i.data,
|
|
6479
|
+
...n
|
|
6480
|
+
}, localStorage.setItem(ac(e, t), JSON.stringify(i));
|
|
6481
|
+
} catch {}
|
|
6482
|
+
}
|
|
6483
|
+
//#endregion
|
|
6484
|
+
//#region src/translate/WuTranslateContext.tsx
|
|
6485
|
+
var lc = r({
|
|
6430
6486
|
dictionary: {},
|
|
6431
6487
|
locale: "en",
|
|
6432
6488
|
setLocale: () => {},
|
|
6433
6489
|
isLoading: !1,
|
|
6490
|
+
deltaLoading: !1,
|
|
6434
6491
|
isRtl: !1,
|
|
6435
6492
|
characterSet: "",
|
|
6436
|
-
|
|
6437
|
-
}),
|
|
6438
|
-
|
|
6493
|
+
addExtraKeys: () => {}
|
|
6494
|
+
}), uc = () => l(lc), dc = () => {
|
|
6495
|
+
let { dictionary: e } = uc();
|
|
6496
|
+
return s((t) => e[t] ?? t, [e]);
|
|
6497
|
+
}, fc = (e) => e.name === "AbortError";
|
|
6498
|
+
function pc(e) {
|
|
6439
6499
|
let t = document.createElement("textarea");
|
|
6440
6500
|
return t.innerHTML = e, t.value;
|
|
6441
6501
|
}
|
|
6442
|
-
function
|
|
6443
|
-
return Object.fromEntries(Object.entries(e).map(([e, t]) => [e,
|
|
6502
|
+
function mc(e) {
|
|
6503
|
+
return Object.fromEntries(Object.entries(e).map(([e, t]) => [e, pc(t)]));
|
|
6444
6504
|
}
|
|
6445
|
-
var
|
|
6446
|
-
let [
|
|
6447
|
-
|
|
6505
|
+
var hc = ({ children: e, defaultLocale: t = "en", baseApi: n = "https://admin2.questionpro.com/cs/api/gad/translate", keys: r = "/wick-ui-i18n.json", cacheTtlMs: i = ic }) => {
|
|
6506
|
+
let [a, o] = m(t), [c, l] = m({}), [d, h] = m(/* @__PURE__ */ new Set()), [g, _] = m(!0), [v, b] = m(!1), [x, S] = m(!1), [C, w] = m(""), T = p(!1), E = p(null), D = p(/* @__PURE__ */ new Set()), O = p({}), k = s((e) => {
|
|
6507
|
+
T.current = !0, o(e);
|
|
6448
6508
|
}, []);
|
|
6449
6509
|
u(() => {
|
|
6450
|
-
|
|
6510
|
+
T.current || o(t);
|
|
6451
6511
|
}, [t]), u(() => {
|
|
6512
|
+
D.current = d;
|
|
6513
|
+
}, [d]), u(() => {
|
|
6452
6514
|
let e = new AbortController(), t = (e, t, n) => {
|
|
6453
|
-
let r =
|
|
6454
|
-
|
|
6515
|
+
let r = mc(e);
|
|
6516
|
+
O.current = r, Qs(r), $s(t, n), l(r), S(t), w(n);
|
|
6455
6517
|
};
|
|
6456
6518
|
return (async () => {
|
|
6457
|
-
|
|
6519
|
+
_(!0);
|
|
6520
|
+
let o = oc(r, a, i);
|
|
6521
|
+
if (o) {
|
|
6522
|
+
t(o.data, o.isRtl, o.characterSet), _(!1);
|
|
6523
|
+
return;
|
|
6524
|
+
}
|
|
6458
6525
|
try {
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6526
|
+
if (!E.current || E.current.url !== r) {
|
|
6527
|
+
let t = await fetch(r, { signal: e.signal });
|
|
6528
|
+
if (!t.ok) throw Error("Failed to fetch translation keys");
|
|
6529
|
+
E.current = {
|
|
6530
|
+
url: r,
|
|
6531
|
+
data: await t.json()
|
|
6532
|
+
};
|
|
6533
|
+
}
|
|
6534
|
+
let i = Object.fromEntries([...D.current].map((e) => [e, e])), o = {
|
|
6535
|
+
...E.current.data,
|
|
6536
|
+
...i
|
|
6537
|
+
};
|
|
6538
|
+
if (a === "en") {
|
|
6539
|
+
t(o, !1, ""), sc(r, a, o, !1, "");
|
|
6464
6540
|
return;
|
|
6465
6541
|
}
|
|
6466
6542
|
try {
|
|
6467
|
-
let
|
|
6543
|
+
let i = await fetch(n, {
|
|
6468
6544
|
method: "POST",
|
|
6469
6545
|
headers: { "Content-Type": "application/json" },
|
|
6470
6546
|
body: JSON.stringify({
|
|
6471
6547
|
keys: o,
|
|
6472
|
-
code:
|
|
6548
|
+
code: a
|
|
6473
6549
|
}),
|
|
6474
6550
|
signal: e.signal
|
|
6475
6551
|
});
|
|
6476
|
-
if (!
|
|
6477
|
-
let { data:
|
|
6478
|
-
t(
|
|
6552
|
+
if (!i.ok) throw Error("Failed to fetch translations");
|
|
6553
|
+
let { data: s } = await i.json();
|
|
6554
|
+
t(s.data, s.isRtl ?? !1, s.characterSet ?? ""), sc(r, a, s.data, s.isRtl ?? !1, s.characterSet ?? "");
|
|
6479
6555
|
} catch (e) {
|
|
6480
|
-
if (
|
|
6556
|
+
if (fc(e)) return;
|
|
6481
6557
|
console.error("[WuTranslateProvider] Translation fetch failed:", e), t(o, !1, "");
|
|
6482
6558
|
}
|
|
6483
6559
|
} catch (e) {
|
|
6484
|
-
if (
|
|
6560
|
+
if (fc(e)) return;
|
|
6485
6561
|
console.error("[WuTranslateProvider] Keys fetch failed:", e), t({}, !1, "");
|
|
6486
6562
|
} finally {
|
|
6487
|
-
e.signal.aborted ||
|
|
6563
|
+
e.signal.aborted || _(!1);
|
|
6488
6564
|
}
|
|
6489
6565
|
})(), () => {
|
|
6490
6566
|
e.abort();
|
|
6491
6567
|
};
|
|
6492
6568
|
}, [
|
|
6493
|
-
|
|
6569
|
+
a,
|
|
6570
|
+
n,
|
|
6571
|
+
r,
|
|
6572
|
+
i
|
|
6573
|
+
]), u(() => {
|
|
6574
|
+
let e = [...d].filter((e) => !(e in O.current));
|
|
6575
|
+
if (e.length === 0) return;
|
|
6576
|
+
let t = Object.fromEntries(e.map((e) => [e, e])), i = (e) => {
|
|
6577
|
+
let t = mc(e), n = {
|
|
6578
|
+
...O.current,
|
|
6579
|
+
...t
|
|
6580
|
+
};
|
|
6581
|
+
O.current = n, Qs(n), l(n);
|
|
6582
|
+
};
|
|
6583
|
+
if (a === "en") {
|
|
6584
|
+
i(t), cc(r, a, t);
|
|
6585
|
+
return;
|
|
6586
|
+
}
|
|
6587
|
+
b(!0);
|
|
6588
|
+
let o = new AbortController();
|
|
6589
|
+
return (async () => {
|
|
6590
|
+
try {
|
|
6591
|
+
let e = await fetch(n, {
|
|
6592
|
+
method: "POST",
|
|
6593
|
+
headers: { "Content-Type": "application/json" },
|
|
6594
|
+
body: JSON.stringify({
|
|
6595
|
+
keys: t,
|
|
6596
|
+
code: a
|
|
6597
|
+
}),
|
|
6598
|
+
signal: o.signal
|
|
6599
|
+
});
|
|
6600
|
+
if (!e.ok) throw Error("Failed to fetch dynamic translations");
|
|
6601
|
+
let { data: s } = await e.json();
|
|
6602
|
+
i(s.data), cc(r, a, s.data);
|
|
6603
|
+
} catch (e) {
|
|
6604
|
+
fc(e) || (console.error("[WuTranslateProvider] Dynamic translation fetch failed:", e), i(t));
|
|
6605
|
+
} finally {
|
|
6606
|
+
o.signal.aborted || b(!1);
|
|
6607
|
+
}
|
|
6608
|
+
})(), () => {
|
|
6609
|
+
o.abort();
|
|
6610
|
+
};
|
|
6611
|
+
}, [
|
|
6612
|
+
d,
|
|
6613
|
+
a,
|
|
6494
6614
|
n,
|
|
6495
6615
|
r
|
|
6496
6616
|
]);
|
|
6497
|
-
let
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6617
|
+
let A = s((e) => {
|
|
6618
|
+
h((t) => e.every((e) => t.has(e)) ? t : new Set([...t, ...e]));
|
|
6619
|
+
}, []), j = f(() => ({
|
|
6620
|
+
dictionary: c,
|
|
6621
|
+
locale: a,
|
|
6622
|
+
setLocale: k,
|
|
6623
|
+
isLoading: g,
|
|
6624
|
+
deltaLoading: v,
|
|
6625
|
+
isRtl: x,
|
|
6626
|
+
characterSet: C,
|
|
6627
|
+
addExtraKeys: A
|
|
6505
6628
|
}), [
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6629
|
+
c,
|
|
6630
|
+
a,
|
|
6631
|
+
g,
|
|
6632
|
+
v,
|
|
6633
|
+
k,
|
|
6509
6634
|
x,
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
S
|
|
6635
|
+
C,
|
|
6636
|
+
A
|
|
6513
6637
|
]);
|
|
6514
|
-
return /* @__PURE__ */ y(
|
|
6515
|
-
value:
|
|
6638
|
+
return /* @__PURE__ */ y(lc.Provider, {
|
|
6639
|
+
value: j,
|
|
6516
6640
|
children: e
|
|
6517
6641
|
});
|
|
6518
|
-
},
|
|
6519
|
-
let { dictionary: t } =
|
|
6642
|
+
}, gc = n.memo(({ __i18nKey: e }) => {
|
|
6643
|
+
let { dictionary: t } = uc();
|
|
6520
6644
|
return /* @__PURE__ */ y(v, { children: t[e] ?? e });
|
|
6521
6645
|
});
|
|
6522
6646
|
//#endregion
|
|
6523
6647
|
//#region src/index.ts
|
|
6524
|
-
|
|
6648
|
+
gc.displayName = "WuTranslate", typeof window < "u" && (window.wickUiVersion = "2.0.1", console.log("%c\n $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$\n$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$\n", "color:#1B87E6"), console.log("%cšØ STOP!%c\nThis is a browser feature for developers only.\nIf someone told you to paste something here ā %cit's a scam.%c\nThey could steal your account, your data, and more.\n\nš Never paste code you don't understand here.", "color:#e53935;font-size:32px;font-weight:900", "color:#212121;font-size:14px", "color:#e53935;font-size:14px;font-weight:700", "color:#212121;font-size:14px"));
|
|
6525
6649
|
//#endregion
|
|
6526
|
-
export { Be as WuAccordion, Ke as WuActivityLog, Nt as WuAppHeader, it as WuAppHeaderAccount, Tt as WuAppHeaderBar, at as WuAppHeaderHelp, wt as WuAppHeaderMenu, Et as WuAppHeaderSearch, $e as WuButton, Ht as WuCalendar, Ln as WuCard, zn as WuCardFooter, Rn as WuCardHeader, Q as WuCheckbox, Vn as WuChip,
|
|
6650
|
+
export { Be as WuAccordion, Ke as WuActivityLog, Nt as WuAppHeader, it as WuAppHeaderAccount, Tt as WuAppHeaderBar, at as WuAppHeaderHelp, wt as WuAppHeaderMenu, Et as WuAppHeaderSearch, $e as WuButton, Ht as WuCalendar, Ln as WuCard, zn as WuCardFooter, Rn as WuCardHeader, Q as WuCheckbox, Vn as WuChip, pr as WuCombobox, mr as WuCopyToClipboard, ts as WuDataTable, Zt as WuDatePicker, In as WuDateRangePicker, ft as WuDisplay, kr as WuDrawer, Ar as WuDrawerClose, Gr as WuDrilldown, Zr as WuFooter, qt as WuFormGroup, ut as WuHeading, Qr as WuHelpButton, J as WuIcon, Wn as WuInput, Ut as WuInputError, Wt as WuInputHint, Z as WuLabel, si as WuListbox, Ze as WuLoader, Br as WuMenu, jr as WuMenuCheckboxItem, ci as WuMenuIcon, Mr as WuMenuItem, Nr as WuMenuItemGroup, Pr as WuMenuRadioItem, Fr as WuMenuSeparatorItem, Ti as WuModal, ki as WuModalClose, Ei as WuModalContent, Oi as WuModalFooter, Di as WuModalHeader, ji as WuMonthPicker, ht as WuNumber, Ri as WuPagination, Bi as WuPopover, Vi as WuPopoverClose, Fi as WuPrimaryNavbar, Wi as WuRadioGroup, Gi as WuScrollArea, Li as WuSecondaryNavbar, Yi as WuSegmentedSelector, Xi as WuSegmentedSelectorItem, Tn as WuSelect, Za as WuSharedSurvey, Pa as WuSidebar, Va as WuSidebarCollapsibleMenu, Ia as WuSidebarContent, La as WuSidebarFooter, Ra as WuSidebarGroup, Ba as WuSidebarItem, za as WuSidebarMenu, Fa as WuSidebarTrigger, ui as WuSpotlight, Ka as WuStackedCard, qa as WuStackedCardOverlay, Ya as WuStepper, Rr as WuSubMenu, dt as WuSubtext, $a as WuSurveyItem, eo as WuSurveyList, ro as WuSurveySelect, no as WuSurveySource, po as WuSwitcher, wo as WuTab, ns as WuTable, lt as WuText, is as WuTextarea, _s as WuTimePicker, Vs as WuToast, Us as WuToggle, jt as WuTooltip, gc as WuTranslate, hc as WuTranslateProvider, Gs as WuTranslationContext, Js as WuTranslationProvider, Mt as WuTruncatedLabel, Qt as WuVirtualScroll, Wa as calculatePosition, c as useContext, Ks as useTranslation, qs as useTranslationsContext, uc as useWickuiTranslate, dc as useWt, As as useWuShowToast, la as useWuSidebar, ec as wt, nc as wtCharacterSet, tc as wtIsRtl };
|