@zeturn/watercolor-react 1.2.2 → 1.2.4
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/LocaleReact.d.ts +52 -0
- package/dist/LocaleReact.d.ts.map +1 -0
- package/dist/components/Alert/Alert.d.ts.map +1 -1
- package/dist/components/Autocomplete/Autocomplete.d.ts.map +1 -1
- package/dist/components/Banner/Banner.d.ts.map +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/components/Chip/Chip.d.ts.map +1 -1
- package/dist/components/CircularProgress/CircularProgress.d.ts.map +1 -1
- package/dist/components/ColorPicker/ColorPicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/Feed/Feed.d.ts.map +1 -1
- package/dist/components/HoverCard/HoverCard.d.ts.map +1 -1
- package/dist/components/ImageGallery/ImageGallery.d.ts.map +1 -1
- package/dist/components/Input/VerificationCodeInput.d.ts.map +1 -1
- package/dist/components/Menu/Menu.d.ts.map +1 -1
- package/dist/components/Modal/Modal.d.ts +1 -2
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Pagination/Pagination.d.ts.map +1 -1
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/Progress/Progress.d.ts.map +1 -1
- package/dist/components/Rating/Rating.d.ts +2 -1
- package/dist/components/Rating/Rating.d.ts.map +1 -1
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/components/SlideOver/SlideOver.d.ts +1 -2
- package/dist/components/SlideOver/SlideOver.d.ts.map +1 -1
- package/dist/components/Snackbar/Snackbar.d.ts.map +1 -1
- package/dist/components/Status/Status.d.ts.map +1 -1
- package/dist/components/Switch/Switch.d.ts.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts.map +1 -1
- package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/VideoPlayer/VideoPlayer.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/interactions.d.ts +27 -0
- package/dist/interactions.d.ts.map +1 -0
- package/dist/watercolor-react.css +1 -1
- package/dist/watercolor-react.es.js +1321 -1118
- package/index.d.ts +52 -0
- package/package.json +7 -7
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import e, { Suspense as t, createContext as n, lazy as r, useCallback as i, useContext as a, useEffect as o, useId as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
2
2
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import { THEME_CONFIG_VERSION as
|
|
3
|
+
import { createPortal as h } from "react-dom";
|
|
4
|
+
import { THEME_CONFIG_VERSION as g, THEME_MODES as _, THEME_STORAGE_KEY as v, applyFloatingPosition as y, applyThemeConfig as b, applyThemeConfig as x, createOverlayLayer as S, createThemeController as C, createThemeController as w, createThemeInitScript as T, loadThemeConfig as E, resetThemeConfig as D, resetThemeConfig as O, resolveThemeMode as k, serializeThemeConfig as A, validateThemeConfig as j } from "@zeturn/watercolor-core";
|
|
5
5
|
//#region \0rolldown/runtime.js
|
|
6
|
-
var
|
|
7
|
-
if (t && typeof t == "object" || typeof t == "function") for (var i =
|
|
6
|
+
var M = Object.create, N = Object.defineProperty, P = Object.getOwnPropertyDescriptor, F = Object.getOwnPropertyNames, I = Object.getPrototypeOf, L = Object.prototype.hasOwnProperty, R = (e, t) => () => (t || e((t = { exports: {} }).exports, t), t.exports), z = (e, t, n, r) => {
|
|
7
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = F(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !L.call(e, s) && s !== n && N(e, s, {
|
|
8
8
|
get: ((e) => t[e]).bind(null, s),
|
|
9
|
-
enumerable: !(r =
|
|
9
|
+
enumerable: !(r = P(t, s)) || r.enumerable
|
|
10
10
|
});
|
|
11
11
|
return e;
|
|
12
|
-
},
|
|
12
|
+
}, B = (e, t, n) => (n = e == null ? {} : M(I(e)), z(t || !e || !e.__esModule ? N(n, "default", {
|
|
13
13
|
value: e,
|
|
14
14
|
enumerable: !0
|
|
15
|
-
}) : n, e)),
|
|
15
|
+
}) : n, e)), V = [
|
|
16
16
|
"default",
|
|
17
17
|
"bordered",
|
|
18
18
|
"filled"
|
|
19
19
|
];
|
|
20
|
-
function
|
|
21
|
-
return
|
|
20
|
+
function H(e = "default") {
|
|
21
|
+
return V.includes(e) ? e : "default";
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function U(e) {
|
|
24
24
|
return e ? typeof e == "string" ? e : Array.isArray(e) ? e.filter(Boolean).join(" ") : typeof e == "object" ? Object.entries(e).filter(([, e]) => e).map(([e]) => e).join(" ") : "" : "";
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
let n =
|
|
26
|
+
function W(e = "default", t = "") {
|
|
27
|
+
let n = H(e), r = U(t);
|
|
28
28
|
return [
|
|
29
29
|
"wc-accordion",
|
|
30
30
|
n === "default" ? "" : `wc-accordion--${n}`,
|
|
31
31
|
r
|
|
32
32
|
].filter(Boolean).join(" ");
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function ee(e = [], t, n = !1) {
|
|
35
35
|
return n ? e.includes(t) ? e.filter((e) => e !== t) : [...e, t] : e.includes(t) ? [] : [t];
|
|
36
36
|
}
|
|
37
37
|
//#endregion
|
|
38
38
|
//#region src/components/Accordion/Accordion.jsx
|
|
39
|
-
var
|
|
40
|
-
let l = s(), [u, f] = d([]), h =
|
|
39
|
+
var te = ({ items: e = [], multiple: t = !1, variant: n = "default", onToggle: r, className: i = "", style: a = {}, "aria-label": o, ...c }) => {
|
|
40
|
+
let l = s(), [u, f] = d([]), h = W(n, i), g = (n) => {
|
|
41
41
|
if (e[n]?.disabled) return;
|
|
42
|
-
let i =
|
|
42
|
+
let i = ee(u, n, t);
|
|
43
43
|
f(i), r?.(n, i.includes(n));
|
|
44
44
|
}, _ = (e) => u.includes(e);
|
|
45
45
|
return /* @__PURE__ */ p("div", {
|
|
@@ -84,10 +84,10 @@ var G = ({ items: e = [], multiple: t = !1, variant: n = "default", onToggle: r,
|
|
|
84
84
|
}, t))
|
|
85
85
|
});
|
|
86
86
|
};
|
|
87
|
-
|
|
87
|
+
te.displayName = "Accordion";
|
|
88
88
|
//#endregion
|
|
89
89
|
//#region ../core/src/components/Alert/utils.jsx
|
|
90
|
-
function
|
|
90
|
+
function ne(e, t) {
|
|
91
91
|
return [
|
|
92
92
|
"wc-alert",
|
|
93
93
|
`wc-alert--${e}`,
|
|
@@ -95,8 +95,64 @@ function ee(e, t) {
|
|
|
95
95
|
];
|
|
96
96
|
}
|
|
97
97
|
//#endregion
|
|
98
|
+
//#region src/LocaleReact.tsx
|
|
99
|
+
var re = {
|
|
100
|
+
breadcrumb: "Breadcrumb",
|
|
101
|
+
close: "Close",
|
|
102
|
+
closeDialog: "Close dialog",
|
|
103
|
+
closeLightbox: "Close lightbox",
|
|
104
|
+
closePopover: "Popover content",
|
|
105
|
+
colorPicker: "Choose color",
|
|
106
|
+
circularProgress: "Loading progress",
|
|
107
|
+
downloadImage: (e) => `Download image ${e}`,
|
|
108
|
+
enterFullscreen: "Enter fullscreen",
|
|
109
|
+
loading: "Loading",
|
|
110
|
+
muteVideo: "Mute video",
|
|
111
|
+
nextImage: "Next image",
|
|
112
|
+
nextMonth: "Next month",
|
|
113
|
+
nextPage: "Next page",
|
|
114
|
+
openCalendar: "Choose date",
|
|
115
|
+
openImageInLightbox: (e) => `Open image ${e} in lightbox`,
|
|
116
|
+
page: (e) => `Page ${e}`,
|
|
117
|
+
pagination: "Pagination",
|
|
118
|
+
pauseVideo: "Pause video",
|
|
119
|
+
playVideo: "Play video",
|
|
120
|
+
previousImage: "Previous image",
|
|
121
|
+
previousMonth: "Previous month",
|
|
122
|
+
previousPage: "Previous page",
|
|
123
|
+
progress: "Progress",
|
|
124
|
+
rating: "Rating",
|
|
125
|
+
ratingValue: (e, t) => `${e} of ${t}`,
|
|
126
|
+
remove: "Remove",
|
|
127
|
+
removeItem: (e) => `Remove${e ? ` ${e}` : ""}`,
|
|
128
|
+
rowsPerPage: "Rows per page",
|
|
129
|
+
switchControl: "Switch",
|
|
130
|
+
tabList: "Content sections",
|
|
131
|
+
unmuteVideo: "Unmute video",
|
|
132
|
+
jumpToPage: "Jump to page",
|
|
133
|
+
verificationCodeDigit: (e) => `Verification code digit ${e}`,
|
|
134
|
+
viewImage: (e, t) => `View image ${e}${t ? `: ${t}` : ""}`,
|
|
135
|
+
volume: "Volume",
|
|
136
|
+
videoProgress: "Video progress"
|
|
137
|
+
}, G = n({ messages: re }), K = ({ children: e, locale: t, messages: n }) => {
|
|
138
|
+
let r = l(() => ({
|
|
139
|
+
locale: t,
|
|
140
|
+
messages: {
|
|
141
|
+
...re,
|
|
142
|
+
...n
|
|
143
|
+
}
|
|
144
|
+
}), [t, n]);
|
|
145
|
+
return /* @__PURE__ */ p(G.Provider, {
|
|
146
|
+
value: r,
|
|
147
|
+
children: e
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
function q() {
|
|
151
|
+
return a(G);
|
|
152
|
+
}
|
|
153
|
+
//#endregion
|
|
98
154
|
//#region src/components/Alert/Alert.jsx
|
|
99
|
-
var
|
|
155
|
+
var J = ({ type: e }) => {
|
|
100
156
|
let t = e === "success" ? /* @__PURE__ */ p("path", { d: "m6.8 10.1 2.1 2.1 4.4-4.6" }) : e === "info" ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("path", { d: "M10 9v4" }), /* @__PURE__ */ p("path", { d: "M10 6.5h.01" })] }) : e === "warning" ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("path", { d: "M10 6.5v4.2" }), /* @__PURE__ */ p("path", { d: "M10 13.5h.01" })] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("path", { d: "m7.5 7.5 5 5" }), /* @__PURE__ */ p("path", { d: "m12.5 7.5-5 5" })] });
|
|
101
157
|
return /* @__PURE__ */ m("svg", {
|
|
102
158
|
viewBox: "0 0 20 20",
|
|
@@ -113,19 +169,19 @@ var te = ({ type: e }) => {
|
|
|
113
169
|
}), t]
|
|
114
170
|
});
|
|
115
171
|
};
|
|
116
|
-
function
|
|
117
|
-
let [c, l] = d(!0);
|
|
172
|
+
function ie({ type: e = "info", variant: t = "standard", title: n = "", closable: r = !1, showIcon: i = !0, className: a = "", children: o, onClose: s = () => {} }) {
|
|
173
|
+
let [c, l] = d(!0), { messages: u } = q();
|
|
118
174
|
if (!c) return null;
|
|
119
|
-
let
|
|
175
|
+
let f = () => {
|
|
120
176
|
l(!1), s();
|
|
121
177
|
};
|
|
122
178
|
return /* @__PURE__ */ m("div", {
|
|
123
|
-
className: [...
|
|
179
|
+
className: [...ne(e, t), a].filter(Boolean).join(" "),
|
|
124
180
|
role: "alert",
|
|
125
181
|
children: [
|
|
126
182
|
i && /* @__PURE__ */ p("div", {
|
|
127
183
|
className: "wc-alert-icon",
|
|
128
|
-
children: /* @__PURE__ */ p(
|
|
184
|
+
children: /* @__PURE__ */ p(J, { type: e })
|
|
129
185
|
}),
|
|
130
186
|
/* @__PURE__ */ m("div", {
|
|
131
187
|
className: "wc-alert-content",
|
|
@@ -140,8 +196,8 @@ function K({ type: e = "info", variant: t = "standard", title: n = "", closable:
|
|
|
140
196
|
r && /* @__PURE__ */ p("button", {
|
|
141
197
|
type: "button",
|
|
142
198
|
className: "wc-alert-close",
|
|
143
|
-
"aria-label":
|
|
144
|
-
onClick:
|
|
199
|
+
"aria-label": u.close,
|
|
200
|
+
onClick: f,
|
|
145
201
|
children: /* @__PURE__ */ p("svg", {
|
|
146
202
|
viewBox: "0 0 20 20",
|
|
147
203
|
fill: "none",
|
|
@@ -157,67 +213,148 @@ function K({ type: e = "info", variant: t = "standard", title: n = "", closable:
|
|
|
157
213
|
}
|
|
158
214
|
//#endregion
|
|
159
215
|
//#region src/components/AppBar/AppBar.jsx
|
|
160
|
-
var
|
|
216
|
+
var Y = ({ children: e, position: t = "fixed", color: n = "default", elevation: r = 0, variant: i = "elevation", className: a = "", style: o = {}, ...s }) => /* @__PURE__ */ p("div", {
|
|
161
217
|
className: `wc-appbar wc-appbar--${t} wc-appbar--${n} wc-appbar--elevation-${r} wc-appbar--${i} ${a}`,
|
|
162
218
|
style: o,
|
|
163
219
|
...s,
|
|
164
220
|
children: e
|
|
165
|
-
}),
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
221
|
+
}), ae = typeof document > "u" ? o : c;
|
|
222
|
+
function oe({ children: e, target: t }) {
|
|
223
|
+
return typeof document > "u" ? null : h(e, (typeof t == "string" ? document.querySelector(t) : t) || document.body);
|
|
224
|
+
}
|
|
225
|
+
function se({ open: e, elementRef: t, refs: n = [], modal: r = !1, lockScroll: i = !1, restoreFocus: a = !0, initialFocus: s = !1, closeOnEscape: c = !0, closeOnPointerDownOutside: l = !0, onEscapeKeyDown: d, onPointerDownOutside: f, zIndex: p }) {
|
|
226
|
+
let m = u(null);
|
|
227
|
+
return o(() => {
|
|
228
|
+
if (!(!e || !t.current || typeof document > "u")) return m.current = S({
|
|
229
|
+
element: t.current,
|
|
230
|
+
refs: n.map((e) => e?.current || e).filter(Boolean),
|
|
231
|
+
modal: r,
|
|
232
|
+
lockScroll: i,
|
|
233
|
+
restoreFocus: a,
|
|
234
|
+
initialFocus: s,
|
|
235
|
+
closeOnEscape: c,
|
|
236
|
+
closeOnPointerDownOutside: l,
|
|
237
|
+
onEscapeKeyDown: d,
|
|
238
|
+
onPointerDownOutside: f,
|
|
239
|
+
zIndex: p
|
|
240
|
+
}), () => {
|
|
241
|
+
m.current?.destroy(), m.current = null;
|
|
172
242
|
};
|
|
173
|
-
|
|
174
|
-
|
|
243
|
+
}, [
|
|
244
|
+
e,
|
|
245
|
+
t,
|
|
246
|
+
r,
|
|
247
|
+
i,
|
|
248
|
+
a,
|
|
249
|
+
s,
|
|
250
|
+
c,
|
|
251
|
+
l,
|
|
252
|
+
d,
|
|
253
|
+
f,
|
|
254
|
+
p
|
|
255
|
+
]), o(() => {
|
|
256
|
+
m.current?.update({
|
|
257
|
+
refs: n.map((e) => e?.current || e).filter(Boolean),
|
|
258
|
+
closeOnEscape: c,
|
|
259
|
+
closeOnPointerDownOutside: l,
|
|
260
|
+
onEscapeKeyDown: d,
|
|
261
|
+
onPointerDownOutside: f
|
|
262
|
+
});
|
|
263
|
+
}, [
|
|
264
|
+
n,
|
|
265
|
+
c,
|
|
266
|
+
l,
|
|
267
|
+
d,
|
|
268
|
+
f
|
|
269
|
+
]), m;
|
|
270
|
+
}
|
|
271
|
+
function ce({ open: e, anchorRef: t, floatingRef: n, placement: r = "bottom", offset: i = 8, boundaryPadding: a = 8 }) {
|
|
272
|
+
let [o, s] = d(r);
|
|
273
|
+
return ae(() => {
|
|
274
|
+
if (!e || !t.current || !n.current || typeof window > "u") return;
|
|
275
|
+
let o = () => {
|
|
276
|
+
s(y(t.current, n.current, {
|
|
277
|
+
placement: r,
|
|
278
|
+
offset: i,
|
|
279
|
+
boundaryPadding: a
|
|
280
|
+
}).placement);
|
|
175
281
|
};
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
282
|
+
return o(), window.addEventListener("resize", o), window.addEventListener("scroll", o, !0), () => {
|
|
283
|
+
window.removeEventListener("resize", o), window.removeEventListener("scroll", o, !0);
|
|
284
|
+
};
|
|
285
|
+
}, [
|
|
286
|
+
e,
|
|
287
|
+
t,
|
|
288
|
+
n,
|
|
289
|
+
r,
|
|
290
|
+
i,
|
|
291
|
+
a
|
|
292
|
+
]), o;
|
|
293
|
+
}
|
|
294
|
+
//#endregion
|
|
295
|
+
//#region src/components/Autocomplete/Autocomplete.jsx
|
|
296
|
+
var le = ({ value: e = null, onChange: t, options: n = [], placeholder: r = "Type to search...", label: i = "", helperText: a = "", error: c = !1, errorMessage: l = "", required: f = !1, disabled: h = !1, readonly: g = !1, multiple: _ = !1, freeSolo: v = !1, clearable: y = !0, fullWidth: b = !1, size: x = "md", variant: S = "filled", minSearchLength: C = 0, noOptionsText: w = "No options found", name: T = "", id: E = "", className: D = "", style: O = {}, onFocus: k, onBlur: A, onInputChange: j, filterOptions: M, renderOption: N, renderInput: P, getOptionLabel: F, getOptionValue: I, ...L }) => {
|
|
297
|
+
let [R, z] = d(!1), [B, V] = d(""), [H, U] = d(-1), W = u(null), ee = u(null), te = u(null), ne = (e) => e ? typeof e == "object" ? e.label || e.value || "" : String(e) : "", re = (e) => e ? typeof e == "object" ? e.value === void 0 ? e : e.value : e : null, G = F || ne, K = I || re;
|
|
298
|
+
o(() => {
|
|
299
|
+
!_ && e ? V(G(e)) : e || V("");
|
|
300
|
+
}, [e, _]);
|
|
301
|
+
let q = () => {
|
|
302
|
+
z(!1), U(-1);
|
|
303
|
+
};
|
|
304
|
+
se({
|
|
305
|
+
open: R,
|
|
306
|
+
elementRef: te,
|
|
307
|
+
refs: [W],
|
|
308
|
+
closeOnEscape: !0,
|
|
309
|
+
closeOnPointerDownOutside: !0,
|
|
310
|
+
onEscapeKeyDown: q,
|
|
311
|
+
onPointerDownOutside: q,
|
|
312
|
+
zIndex: 1e3
|
|
313
|
+
});
|
|
314
|
+
let J = M ? M(n, B) : ((e, t) => !t || t.length < C ? e : e.filter((e) => G(e).toLowerCase().includes(t.toLowerCase())))(n, B), ie = (t) => {
|
|
315
|
+
let n = K(t);
|
|
316
|
+
return _ && Array.isArray(e) ? e.some((e) => K(e) === n) : K(e) === n;
|
|
317
|
+
}, Y = () => {
|
|
181
318
|
let e = ["wc-autocomplete"];
|
|
182
319
|
return b && e.push("wc-autocomplete--full-width"), e.concat(D).filter(Boolean).join(" ");
|
|
183
|
-
},
|
|
320
|
+
}, ae = () => {
|
|
184
321
|
let e = ["wc-autocomplete__label"];
|
|
185
322
|
return e.push(`wc-autocomplete__label--${x}`), c && e.push("wc-autocomplete__label--error"), e.join(" ");
|
|
186
|
-
},
|
|
323
|
+
}, oe = () => {
|
|
187
324
|
let e = ["wc-autocomplete__container"];
|
|
188
325
|
return e.push(`wc-autocomplete__container--${S}`), e.push(`wc-autocomplete__container--${x}`), h && e.push("wc-autocomplete__container--disabled"), c && e.push("wc-autocomplete__container--error"), R && e.push("wc-autocomplete__container--open"), e.join(" ");
|
|
189
|
-
},
|
|
326
|
+
}, ce = (e, t) => {
|
|
190
327
|
let n = ["wc-autocomplete__option"];
|
|
191
|
-
return
|
|
192
|
-
},
|
|
328
|
+
return ie(e) && n.push("wc-autocomplete__option--selected"), t === H && n.push("wc-autocomplete__option--highlighted"), e.disabled && n.push("wc-autocomplete__option--disabled"), n.join(" ");
|
|
329
|
+
}, le = (e) => {
|
|
193
330
|
z(!0), k?.(e);
|
|
194
|
-
},
|
|
331
|
+
}, ue = (e) => {
|
|
195
332
|
setTimeout(() => {
|
|
196
333
|
z(!1), A?.(e);
|
|
197
334
|
}, 200);
|
|
198
|
-
},
|
|
335
|
+
}, de = (e) => {
|
|
199
336
|
let n = e.target.value;
|
|
200
337
|
V(n), z(!0), U(-1), j?.(n), v && t?.({ target: {
|
|
201
338
|
name: T,
|
|
202
339
|
value: n
|
|
203
340
|
} });
|
|
204
|
-
},
|
|
205
|
-
e.stopPropagation(), V(""),
|
|
341
|
+
}, fe = (e) => {
|
|
342
|
+
e.stopPropagation(), V(""), q(), t?.({ target: {
|
|
206
343
|
name: T,
|
|
207
344
|
value: _ ? [] : null
|
|
208
345
|
} });
|
|
209
|
-
},
|
|
346
|
+
}, pe = (n) => {
|
|
210
347
|
if (n.disabled) return;
|
|
211
|
-
let r =
|
|
348
|
+
let r = K(n), i;
|
|
212
349
|
if (_) {
|
|
213
|
-
let t = Array.isArray(e) ? [...e] : [], a = t.findIndex((e) =>
|
|
350
|
+
let t = Array.isArray(e) ? [...e] : [], a = t.findIndex((e) => K(e) === r);
|
|
214
351
|
a > -1 ? t.splice(a, 1) : t.push(n), i = t, V("");
|
|
215
|
-
} else i = n, V(
|
|
352
|
+
} else i = n, V(G(n)), q();
|
|
216
353
|
U(-1), t?.({ target: {
|
|
217
354
|
name: T,
|
|
218
355
|
value: i
|
|
219
356
|
} });
|
|
220
|
-
},
|
|
357
|
+
}, me = (e) => {
|
|
221
358
|
if (!R && (e.key === "ArrowDown" || e.key === "ArrowUp")) {
|
|
222
359
|
z(!0), e.preventDefault();
|
|
223
360
|
return;
|
|
@@ -230,40 +367,40 @@ var q = ({ children: e, position: t = "fixed", color: n = "default", elevation:
|
|
|
230
367
|
e.preventDefault(), U((e) => Math.max(e - 1, 0));
|
|
231
368
|
break;
|
|
232
369
|
case "Enter":
|
|
233
|
-
e.preventDefault(), H >= 0 && H < J.length &&
|
|
370
|
+
e.preventDefault(), H >= 0 && H < J.length && pe(J[H]);
|
|
234
371
|
break;
|
|
235
372
|
case "Escape":
|
|
236
|
-
|
|
373
|
+
q(), ee.current?.blur();
|
|
237
374
|
break;
|
|
238
375
|
default: break;
|
|
239
376
|
}
|
|
240
|
-
},
|
|
377
|
+
}, he = s(), X = E || T || he;
|
|
241
378
|
return /* @__PURE__ */ m("div", {
|
|
242
|
-
className:
|
|
379
|
+
className: Y(),
|
|
243
380
|
ref: W,
|
|
244
381
|
style: O,
|
|
245
382
|
children: [
|
|
246
383
|
i && /* @__PURE__ */ m("label", {
|
|
247
384
|
htmlFor: X,
|
|
248
|
-
className:
|
|
385
|
+
className: ae(),
|
|
249
386
|
children: [i, f && /* @__PURE__ */ p("span", {
|
|
250
387
|
className: "wc-autocomplete__required",
|
|
251
388
|
children: "*"
|
|
252
389
|
})]
|
|
253
390
|
}),
|
|
254
391
|
/* @__PURE__ */ m("div", {
|
|
255
|
-
className:
|
|
392
|
+
className: oe(),
|
|
256
393
|
children: [P ? P({
|
|
257
394
|
id: X,
|
|
258
395
|
value: B,
|
|
259
|
-
onChange:
|
|
260
|
-
onFocus:
|
|
261
|
-
onBlur:
|
|
262
|
-
onKeyDown:
|
|
396
|
+
onChange: de,
|
|
397
|
+
onFocus: le,
|
|
398
|
+
onBlur: ue,
|
|
399
|
+
onKeyDown: me,
|
|
263
400
|
placeholder: r,
|
|
264
401
|
disabled: h,
|
|
265
402
|
readonly: g,
|
|
266
|
-
ref:
|
|
403
|
+
ref: ee,
|
|
267
404
|
role: "combobox",
|
|
268
405
|
"aria-autocomplete": "list",
|
|
269
406
|
"aria-expanded": R,
|
|
@@ -271,15 +408,15 @@ var q = ({ children: e, position: t = "fixed", color: n = "default", elevation:
|
|
|
271
408
|
"aria-activedescendant": H >= 0 ? `${X}-option-${H}` : void 0
|
|
272
409
|
}) : /* @__PURE__ */ p("input", {
|
|
273
410
|
id: X,
|
|
274
|
-
ref:
|
|
411
|
+
ref: ee,
|
|
275
412
|
type: "text",
|
|
276
413
|
className: "wc-autocomplete__input",
|
|
277
414
|
placeholder: r,
|
|
278
415
|
value: B,
|
|
279
|
-
onChange:
|
|
280
|
-
onFocus:
|
|
281
|
-
onBlur:
|
|
282
|
-
onKeyDown:
|
|
416
|
+
onChange: de,
|
|
417
|
+
onFocus: le,
|
|
418
|
+
onBlur: ue,
|
|
419
|
+
onKeyDown: me,
|
|
283
420
|
disabled: h,
|
|
284
421
|
readOnly: g,
|
|
285
422
|
autoComplete: "off",
|
|
@@ -293,7 +430,7 @@ var q = ({ children: e, position: t = "fixed", color: n = "default", elevation:
|
|
|
293
430
|
children: [y && B && /* @__PURE__ */ p("button", {
|
|
294
431
|
type: "button",
|
|
295
432
|
className: "wc-autocomplete__clear",
|
|
296
|
-
onClick:
|
|
433
|
+
onClick: fe,
|
|
297
434
|
tabIndex: -1,
|
|
298
435
|
children: /* @__PURE__ */ m("svg", {
|
|
299
436
|
viewBox: "0 0 24 24",
|
|
@@ -333,6 +470,7 @@ var q = ({ children: e, position: t = "fixed", color: n = "default", elevation:
|
|
|
333
470
|
})]
|
|
334
471
|
}),
|
|
335
472
|
R && B.length >= C && /* @__PURE__ */ p("div", {
|
|
473
|
+
ref: te,
|
|
336
474
|
className: "wc-autocomplete__dropdown",
|
|
337
475
|
id: `${X}-options`,
|
|
338
476
|
role: "listbox",
|
|
@@ -343,15 +481,15 @@ var q = ({ children: e, position: t = "fixed", color: n = "default", elevation:
|
|
|
343
481
|
className: "wc-autocomplete__options",
|
|
344
482
|
children: J.map((e, t) => /* @__PURE__ */ m("div", {
|
|
345
483
|
id: `${X}-option-${t}`,
|
|
346
|
-
className:
|
|
484
|
+
className: ce(e, t),
|
|
347
485
|
role: "option",
|
|
348
|
-
"aria-selected":
|
|
349
|
-
onClick: () =>
|
|
486
|
+
"aria-selected": ie(e),
|
|
487
|
+
onClick: () => pe(e),
|
|
350
488
|
onMouseEnter: () => U(t),
|
|
351
|
-
children: [N ? N(e, { selected:
|
|
489
|
+
children: [N ? N(e, { selected: ie(e) }) : /* @__PURE__ */ p("span", {
|
|
352
490
|
className: "wc-autocomplete__option-text",
|
|
353
|
-
children:
|
|
354
|
-
}),
|
|
491
|
+
children: G(e)
|
|
492
|
+
}), ie(e) && /* @__PURE__ */ p("svg", {
|
|
355
493
|
className: "wc-autocomplete__option-check",
|
|
356
494
|
viewBox: "0 0 24 24",
|
|
357
495
|
fill: "none",
|
|
@@ -359,7 +497,7 @@ var q = ({ children: e, position: t = "fixed", color: n = "default", elevation:
|
|
|
359
497
|
strokeWidth: "2",
|
|
360
498
|
children: /* @__PURE__ */ p("polyline", { points: "20,6 9,17 4,12" })
|
|
361
499
|
})]
|
|
362
|
-
},
|
|
500
|
+
}, K(e) || t))
|
|
363
501
|
})
|
|
364
502
|
}),
|
|
365
503
|
(c || a) && /* @__PURE__ */ p("div", { children: c ? /* @__PURE__ */ p("p", {
|
|
@@ -372,40 +510,40 @@ var q = ({ children: e, position: t = "fixed", color: n = "default", elevation:
|
|
|
372
510
|
]
|
|
373
511
|
});
|
|
374
512
|
};
|
|
375
|
-
|
|
513
|
+
le.displayName = "Autocomplete";
|
|
376
514
|
//#endregion
|
|
377
515
|
//#region ../core/src/components/Avatar/utils.jsx
|
|
378
|
-
function
|
|
516
|
+
function ue({ size: e, variant: t, color: n, src: r, imgError: i }) {
|
|
379
517
|
let a = ["wc-avatar"];
|
|
380
518
|
return typeof e == "string" && a.push(`wc-avatar--${e}`), a.push(`wc-avatar--${t}`), (!r || i) && a.push(`wc-avatar--${n}`), a;
|
|
381
519
|
}
|
|
382
|
-
function
|
|
520
|
+
function de(e) {
|
|
383
521
|
let t = {};
|
|
384
522
|
return typeof e == "number" && (t.width = `${e}px`, t.height = `${e}px`, t.fontSize = `${e * .4}px`), t;
|
|
385
523
|
}
|
|
386
|
-
function
|
|
524
|
+
function fe(e) {
|
|
387
525
|
if (!e) return "";
|
|
388
526
|
let t = e.trim(), n = t.charAt(0);
|
|
389
527
|
if (/[\u4e00-\u9fa5]/.test(n)) return n;
|
|
390
528
|
let r = t.split(/\s+/).filter(Boolean);
|
|
391
529
|
return r.length === 1 ? r[0].charAt(0).toUpperCase() : (r[0].charAt(0) + r[1].charAt(0)).toUpperCase();
|
|
392
530
|
}
|
|
393
|
-
function
|
|
531
|
+
function pe(e) {
|
|
394
532
|
e(!0);
|
|
395
533
|
}
|
|
396
|
-
function
|
|
534
|
+
function me(e) {
|
|
397
535
|
e(!1);
|
|
398
536
|
}
|
|
399
537
|
//#endregion
|
|
400
538
|
//#region src/components/Avatar/Avatar.jsx
|
|
401
|
-
var
|
|
402
|
-
let [c, l] = d(!1), u =
|
|
539
|
+
var he = ({ src: e = "", alt: t = "", size: n = "md", variant: r = "circular", color: i = "default", children: a = "", className: o = "", ...s }) => {
|
|
540
|
+
let [c, l] = d(!1), u = ue({
|
|
403
541
|
size: n,
|
|
404
542
|
variant: r,
|
|
405
543
|
color: i,
|
|
406
544
|
src: e,
|
|
407
545
|
imgError: c
|
|
408
|
-
}).concat(o).filter(Boolean).join(" "), f =
|
|
546
|
+
}).concat(o).filter(Boolean).join(" "), f = de(n), m = fe(a), h = () => pe(l), g = () => me(l);
|
|
409
547
|
return /* @__PURE__ */ p("div", {
|
|
410
548
|
className: u,
|
|
411
549
|
style: f,
|
|
@@ -422,10 +560,10 @@ var oe = ({ src: e = "", alt: t = "", size: n = "md", variant: r = "circular", c
|
|
|
422
560
|
}) : null
|
|
423
561
|
});
|
|
424
562
|
};
|
|
425
|
-
|
|
563
|
+
he.displayName = "Avatar";
|
|
426
564
|
//#endregion
|
|
427
565
|
//#region ../core/src/components/Badge/utils.js
|
|
428
|
-
var
|
|
566
|
+
var X = [
|
|
429
567
|
"primary",
|
|
430
568
|
"secondary",
|
|
431
569
|
"success",
|
|
@@ -436,20 +574,20 @@ var se = [
|
|
|
436
574
|
"cyan",
|
|
437
575
|
"pink"
|
|
438
576
|
];
|
|
439
|
-
function
|
|
440
|
-
return
|
|
577
|
+
function ge(e) {
|
|
578
|
+
return X.includes(e);
|
|
441
579
|
}
|
|
442
|
-
function
|
|
443
|
-
return
|
|
580
|
+
function _e(e) {
|
|
581
|
+
return ge(e) ? e : "primary";
|
|
444
582
|
}
|
|
445
|
-
function
|
|
446
|
-
let i = ["wc-badge", `wc-badge--${
|
|
583
|
+
function ve({ variant: e, size: t, dot: n, className: r }) {
|
|
584
|
+
let i = ["wc-badge", `wc-badge--${_e(e)}`];
|
|
447
585
|
return n ? i.push(`wc-badge--dot-${t}`) : i.push(`wc-badge--${t}`), r && i.push(r), i.filter(Boolean).join(" ");
|
|
448
586
|
}
|
|
449
587
|
//#endregion
|
|
450
588
|
//#region src/components/Badge/Badge.jsx
|
|
451
|
-
var
|
|
452
|
-
className:
|
|
589
|
+
var ye = ({ children: e, variant: t = "primary", size: n = "md", dot: r = !1, className: i = "", ...a }) => /* @__PURE__ */ p("span", {
|
|
590
|
+
className: ve({
|
|
453
591
|
variant: t,
|
|
454
592
|
size: n,
|
|
455
593
|
dot: r,
|
|
@@ -458,10 +596,10 @@ var de = ({ children: e, variant: t = "primary", size: n = "md", dot: r = !1, cl
|
|
|
458
596
|
...a,
|
|
459
597
|
children: !r && e
|
|
460
598
|
});
|
|
461
|
-
|
|
599
|
+
ye.displayName = "Badge";
|
|
462
600
|
//#endregion
|
|
463
601
|
//#region ../core/src/components/Banner/utils.js
|
|
464
|
-
function
|
|
602
|
+
function be(e, t, n) {
|
|
465
603
|
let r = [
|
|
466
604
|
"wc-banner",
|
|
467
605
|
`wc-banner--${e}`,
|
|
@@ -469,18 +607,18 @@ function fe(e, t, n) {
|
|
|
469
607
|
];
|
|
470
608
|
return n && r.push("wc-banner--sticky"), r.join(" ");
|
|
471
609
|
}
|
|
472
|
-
function
|
|
610
|
+
function xe(e) {
|
|
473
611
|
return { zIndex: e };
|
|
474
612
|
}
|
|
475
|
-
function
|
|
613
|
+
function Se(e, t) {
|
|
476
614
|
e(!1), t && t();
|
|
477
615
|
}
|
|
478
|
-
function
|
|
616
|
+
function Ce(e) {
|
|
479
617
|
e && e();
|
|
480
618
|
}
|
|
481
619
|
//#endregion
|
|
482
620
|
//#region src/components/Banner/Banner.jsx
|
|
483
|
-
var
|
|
621
|
+
var we = ({ type: e }) => {
|
|
484
622
|
let t = e === "success" ? /* @__PURE__ */ p("path", { d: "m6.8 10.1 2.1 2.1 4.4-4.6" }) : e === "info" ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("path", { d: "M10 9v4" }), /* @__PURE__ */ p("path", { d: "M10 6.5h.01" })] }) : e === "warning" ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("path", { d: "M10 6.5v4.2" }), /* @__PURE__ */ p("path", { d: "M10 13.5h.01" })] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("path", { d: "m7.5 7.5 5 5" }), /* @__PURE__ */ p("path", { d: "m12.5 7.5-5 5" })] });
|
|
485
623
|
return /* @__PURE__ */ m("svg", {
|
|
486
624
|
viewBox: "0 0 20 20",
|
|
@@ -497,17 +635,17 @@ var he = ({ type: e }) => {
|
|
|
497
635
|
}), t]
|
|
498
636
|
});
|
|
499
637
|
};
|
|
500
|
-
function
|
|
501
|
-
let [_, v] = d(!0);
|
|
638
|
+
function Te({ type: t = "info", position: n = "top", title: r = "", message: i = "", closable: a = !0, showIcon: o = !0, showDefaultAction: s = !1, actionText: c = "立即行动", sticky: l = !0, zIndex: u = 1e3, onClose: f, onAction: h, children: g }) {
|
|
639
|
+
let [_, v] = d(!0), { messages: y } = q();
|
|
502
640
|
if (!_) return null;
|
|
503
|
-
let
|
|
504
|
-
|
|
505
|
-
},
|
|
506
|
-
|
|
507
|
-
},
|
|
641
|
+
let b = be(t, n, l), x = xe(u), S = () => {
|
|
642
|
+
Se(v, f);
|
|
643
|
+
}, C = () => {
|
|
644
|
+
Ce(h);
|
|
645
|
+
}, w = g && e.Children.count(g) > 0;
|
|
508
646
|
return /* @__PURE__ */ p("div", {
|
|
509
|
-
className:
|
|
510
|
-
style:
|
|
647
|
+
className: b,
|
|
648
|
+
style: x,
|
|
511
649
|
role: t === "error" ? "alert" : "status",
|
|
512
650
|
"aria-live": t === "error" ? "assertive" : "polite",
|
|
513
651
|
children: /* @__PURE__ */ m("div", {
|
|
@@ -515,7 +653,7 @@ function ge({ type: t = "info", position: n = "top", title: r = "", message: i =
|
|
|
515
653
|
children: [
|
|
516
654
|
o && /* @__PURE__ */ p("div", {
|
|
517
655
|
className: "wc-banner-icon",
|
|
518
|
-
children: /* @__PURE__ */ p(
|
|
656
|
+
children: /* @__PURE__ */ p(we, { type: t })
|
|
519
657
|
}),
|
|
520
658
|
/* @__PURE__ */ m("div", {
|
|
521
659
|
className: "wc-banner-text",
|
|
@@ -527,18 +665,18 @@ function ge({ type: t = "info", position: n = "top", title: r = "", message: i =
|
|
|
527
665
|
children: i
|
|
528
666
|
})]
|
|
529
667
|
}),
|
|
530
|
-
(
|
|
668
|
+
(w || s) && /* @__PURE__ */ p("div", {
|
|
531
669
|
className: "wc-banner-actions",
|
|
532
|
-
children:
|
|
533
|
-
onClick:
|
|
670
|
+
children: w ? g : /* @__PURE__ */ p("button", {
|
|
671
|
+
onClick: C,
|
|
534
672
|
className: "wc-banner-action-btn",
|
|
535
673
|
children: c
|
|
536
674
|
})
|
|
537
675
|
}),
|
|
538
676
|
a && /* @__PURE__ */ p("button", {
|
|
539
|
-
onClick:
|
|
677
|
+
onClick: S,
|
|
540
678
|
className: "wc-banner-close",
|
|
541
|
-
"aria-label":
|
|
679
|
+
"aria-label": y.close,
|
|
542
680
|
children: /* @__PURE__ */ p("svg", {
|
|
543
681
|
viewBox: "0 0 20 20",
|
|
544
682
|
fill: "none",
|
|
@@ -555,22 +693,22 @@ function ge({ type: t = "info", position: n = "top", title: r = "", message: i =
|
|
|
555
693
|
}
|
|
556
694
|
//#endregion
|
|
557
695
|
//#region ../core/src/components/Blockquote/utils.js
|
|
558
|
-
function
|
|
696
|
+
function Ee(e = "", t = "default", n = !0, r = !0, i = "medium", a = "default") {
|
|
559
697
|
let o = ["wc-blockquote"];
|
|
560
698
|
return t && t !== "default" && t !== "card" && o.push(`wc-blockquote--${t}`), n && o.push("wc-blockquote--no-border"), r && o.push("wc-blockquote--interactive"), i && i !== "medium" && o.push(`wc-blockquote--${i}`), a && a !== "default" && o.push(`wc-blockquote--${a}`), e && o.push(e), o.filter(Boolean).join(" ");
|
|
561
699
|
}
|
|
562
700
|
//#endregion
|
|
563
701
|
//#region ../core/src/components/Card/utils.jsx
|
|
564
|
-
function
|
|
702
|
+
function De(e = "", t = "minimal", n = "default", r = "medium", i = !1, a = !0) {
|
|
565
703
|
let o = ["wc-card"];
|
|
566
704
|
return t && o.push(`wc-card--${t}`), n && n !== "default" && o.push(`wc-card--${n}`), r && r !== "medium" && o.push(`wc-card--${r}`), i && o.push("wc-card--interactive"), a && o.push("wc-card--no-border"), e && o.push(e), o.filter(Boolean).join(" ");
|
|
567
705
|
}
|
|
568
706
|
//#endregion
|
|
569
707
|
//#region src/components/Card/Card.jsx
|
|
570
|
-
var
|
|
708
|
+
var Oe = ({ children: e, title: t = "", variant: n = "minimal", color: r = "default", size: i = "medium", interactive: a = !1, noBorder: o = !0, className: s = "", header: c = null, footer: l = null, style: u = {}, onClick: d, onMouseEnter: f, onMouseLeave: h, onKeyDown: g, ..._ }) => {
|
|
571
709
|
let v = a || !!d;
|
|
572
710
|
return /* @__PURE__ */ m("div", {
|
|
573
|
-
className:
|
|
711
|
+
className: De(s, n, r, i, v, o),
|
|
574
712
|
style: u,
|
|
575
713
|
onClick: (e) => {
|
|
576
714
|
v && d && d(e);
|
|
@@ -606,11 +744,11 @@ var ye = ({ children: e, title: t = "", variant: n = "minimal", color: r = "defa
|
|
|
606
744
|
]
|
|
607
745
|
});
|
|
608
746
|
};
|
|
609
|
-
|
|
747
|
+
Oe.displayName = "Card";
|
|
610
748
|
//#endregion
|
|
611
749
|
//#region src/components/Blockquote/Blockquote.jsx
|
|
612
|
-
function
|
|
613
|
-
return r === "card" ? /* @__PURE__ */ m(
|
|
750
|
+
function ke({ cite: e = "", children: t, className: n = "", variant: r = "default", noBorder: i = !0, interactive: a = !0, size: o = "medium", color: s = "default", ...c }) {
|
|
751
|
+
return r === "card" ? /* @__PURE__ */ m(Oe, {
|
|
614
752
|
variant: "filled",
|
|
615
753
|
color: s,
|
|
616
754
|
size: o,
|
|
@@ -626,7 +764,7 @@ function be({ cite: e = "", children: t, className: n = "", variant: r = "defaul
|
|
|
626
764
|
children: ["— ", e]
|
|
627
765
|
})]
|
|
628
766
|
}) : /* @__PURE__ */ m("blockquote", {
|
|
629
|
-
className:
|
|
767
|
+
className: Ee(n, r, i, a, o, s),
|
|
630
768
|
...c,
|
|
631
769
|
children: [/* @__PURE__ */ p("p", {
|
|
632
770
|
className: "quote-text",
|
|
@@ -653,32 +791,32 @@ var Z = {
|
|
|
653
791
|
16: "4rem",
|
|
654
792
|
20: "5rem",
|
|
655
793
|
24: "6rem"
|
|
656
|
-
},
|
|
794
|
+
}, Ae = {
|
|
657
795
|
flex: "flex",
|
|
658
796
|
block: "block",
|
|
659
797
|
inline: "inline",
|
|
660
798
|
"inline-block": "inline-block",
|
|
661
799
|
none: "hidden",
|
|
662
800
|
grid: "grid"
|
|
663
|
-
},
|
|
801
|
+
}, je = {
|
|
664
802
|
row: "flex-row",
|
|
665
803
|
column: "flex-col",
|
|
666
804
|
"row-reverse": "flex-row-reverse",
|
|
667
805
|
"column-reverse": "flex-col-reverse"
|
|
668
|
-
},
|
|
806
|
+
}, Me = {
|
|
669
807
|
"flex-start": "justify-start",
|
|
670
808
|
center: "justify-center",
|
|
671
809
|
"flex-end": "justify-end",
|
|
672
810
|
"space-between": "justify-between",
|
|
673
811
|
"space-around": "justify-around",
|
|
674
812
|
"space-evenly": "justify-evenly"
|
|
675
|
-
},
|
|
813
|
+
}, Ne = {
|
|
676
814
|
"flex-start": "items-start",
|
|
677
815
|
center: "items-center",
|
|
678
816
|
"flex-end": "items-end",
|
|
679
817
|
stretch: "items-stretch",
|
|
680
818
|
baseline: "items-baseline"
|
|
681
|
-
},
|
|
819
|
+
}, Pe = {
|
|
682
820
|
wrap: "flex-wrap",
|
|
683
821
|
nowrap: "flex-nowrap",
|
|
684
822
|
"wrap-reverse": "flex-wrap-reverse"
|
|
@@ -686,9 +824,9 @@ var Z = {
|
|
|
686
824
|
function Q(e) {
|
|
687
825
|
return typeof e == "number" ? `${e}px` : e;
|
|
688
826
|
}
|
|
689
|
-
function
|
|
827
|
+
function Fe(e) {
|
|
690
828
|
let t = ["wc-box"];
|
|
691
|
-
if (e.display &&
|
|
829
|
+
if (e.display && Ae[e.display] && t.push(Ae[e.display]), e.flexDirection && je[e.flexDirection] && t.push(je[e.flexDirection]), e.justifyContent && Me[e.justifyContent] && t.push(Me[e.justifyContent]), e.alignItems && Ne[e.alignItems] && t.push(Ne[e.alignItems]), e.flexWrap && Pe[e.flexWrap] && t.push(Pe[e.flexWrap]), e.gap !== void 0) {
|
|
692
830
|
let n = e.gap.toString();
|
|
693
831
|
[
|
|
694
832
|
"0",
|
|
@@ -708,7 +846,7 @@ function Ee(e) {
|
|
|
708
846
|
}
|
|
709
847
|
return t;
|
|
710
848
|
}
|
|
711
|
-
function
|
|
849
|
+
function Ie(e) {
|
|
712
850
|
let t = {};
|
|
713
851
|
if (e.p !== void 0 && (t.padding = Z[e.p] || Q(e.p)), e.pt !== void 0 && (t.paddingTop = Z[e.pt] || Q(e.pt)), e.pr !== void 0 && (t.paddingRight = Z[e.pr] || Q(e.pr)), e.pb !== void 0 && (t.paddingBottom = Z[e.pb] || Q(e.pb)), e.pl !== void 0 && (t.paddingLeft = Z[e.pl] || Q(e.pl)), e.px !== void 0) {
|
|
714
852
|
let n = Z[e.px] || Q(e.px);
|
|
@@ -730,9 +868,9 @@ function De(e) {
|
|
|
730
868
|
}
|
|
731
869
|
//#endregion
|
|
732
870
|
//#region src/components/Box/Box.jsx
|
|
733
|
-
function
|
|
871
|
+
function Le({ component: e = "div", children: t, className: n = "", p: r, pt: i, pr: a, pb: o, pl: s, px: c, py: l, m: u, mt: d, mr: f, mb: m, ml: h, mx: g, my: _, display: v, flexDirection: y, justifyContent: b, alignItems: x, flexWrap: S, gap: C, bgcolor: w, color: T, border: E, borderRadius: D, width: O, height: k, minWidth: A, minHeight: j, maxWidth: M, maxHeight: N, style: P = {}, ...F }) {
|
|
734
872
|
return /* @__PURE__ */ p(e, {
|
|
735
|
-
className:
|
|
873
|
+
className: Fe({
|
|
736
874
|
display: v,
|
|
737
875
|
flexDirection: y,
|
|
738
876
|
justifyContent: b,
|
|
@@ -741,7 +879,7 @@ function Oe({ component: e = "div", children: t, className: n = "", p: r, pt: i,
|
|
|
741
879
|
gap: C
|
|
742
880
|
}).concat(n).filter(Boolean).join(" "),
|
|
743
881
|
style: {
|
|
744
|
-
...
|
|
882
|
+
...Ie({
|
|
745
883
|
p: r,
|
|
746
884
|
pt: i,
|
|
747
885
|
pr: a,
|
|
@@ -781,7 +919,7 @@ function Oe({ component: e = "div", children: t, className: n = "", p: r, pt: i,
|
|
|
781
919
|
}
|
|
782
920
|
//#endregion
|
|
783
921
|
//#region ../core/src/components/Breadcrumb/utils.js
|
|
784
|
-
function
|
|
922
|
+
function Re(e, t, n, r) {
|
|
785
923
|
let i = [...e];
|
|
786
924
|
if (t && i.length && i[0].label !== "首页" && i.unshift({
|
|
787
925
|
label: "首页",
|
|
@@ -801,66 +939,66 @@ function ke(e, t, n, r) {
|
|
|
801
939
|
}
|
|
802
940
|
return i;
|
|
803
941
|
}
|
|
804
|
-
function
|
|
942
|
+
function ze(e) {
|
|
805
943
|
return `wc-breadcrumb wc-breadcrumb--${e}`;
|
|
806
944
|
}
|
|
807
|
-
function
|
|
945
|
+
function Be(e, t) {
|
|
808
946
|
let n = ["wc-breadcrumb-item"];
|
|
809
947
|
return e === t - 1 && n.push("wc-breadcrumb-item--current"), n.join(" ");
|
|
810
948
|
}
|
|
811
|
-
function
|
|
949
|
+
function Ve(e) {
|
|
812
950
|
let t = ["wc-breadcrumb-link"];
|
|
813
951
|
return e && t.push("wc-breadcrumb-link--disabled"), t.join(" ");
|
|
814
952
|
}
|
|
815
|
-
function
|
|
953
|
+
function He(e, t, n, r, i) {
|
|
816
954
|
return t.disabled || t.isEllipsis || n === r - 1 ? (e.preventDefault(), !1) : (i && i(e, t, n), !0);
|
|
817
955
|
}
|
|
818
|
-
function
|
|
956
|
+
function Ue(e, t, n, r) {
|
|
819
957
|
return e !== t - 1 && !n && !r;
|
|
820
958
|
}
|
|
821
959
|
//#endregion
|
|
822
960
|
//#region src/components/Breadcrumb/Breadcrumb.jsx
|
|
823
|
-
function
|
|
824
|
-
let c = e.useMemo(() =>
|
|
961
|
+
function We({ items: t = [], separator: n = "/", variant: r = "default", showHome: i = !1, homeIcon: a = "🏠", maxItems: o = 0, onItemClick: s }) {
|
|
962
|
+
let { messages: c } = q(), l = e.useMemo(() => Re(t, i, a, o), [
|
|
825
963
|
t,
|
|
826
964
|
i,
|
|
827
965
|
a,
|
|
828
966
|
o
|
|
829
|
-
]),
|
|
830
|
-
|
|
967
|
+
]), u = (e, t, n) => {
|
|
968
|
+
He(e, t, n, l.length, s);
|
|
831
969
|
};
|
|
832
970
|
return /* @__PURE__ */ p("nav", {
|
|
833
|
-
className:
|
|
834
|
-
"aria-label":
|
|
971
|
+
className: ze(r),
|
|
972
|
+
"aria-label": c.breadcrumb,
|
|
835
973
|
role: "navigation",
|
|
836
974
|
children: /* @__PURE__ */ p("ol", {
|
|
837
975
|
className: "wc-breadcrumb-list",
|
|
838
|
-
children:
|
|
839
|
-
className:
|
|
840
|
-
children: [
|
|
976
|
+
children: l.map((e, t) => /* @__PURE__ */ m("li", {
|
|
977
|
+
className: Be(t, l.length),
|
|
978
|
+
children: [Ue(t, l.length, e.disabled, e.isEllipsis) ? e.href ? /* @__PURE__ */ m("a", {
|
|
841
979
|
href: e.href,
|
|
842
|
-
className:
|
|
843
|
-
onClick: (n) =>
|
|
980
|
+
className: Ve(e.disabled),
|
|
981
|
+
onClick: (n) => u(n, e, t),
|
|
844
982
|
children: [e.icon && /* @__PURE__ */ p("span", {
|
|
845
983
|
className: "wc-breadcrumb-icon",
|
|
846
984
|
dangerouslySetInnerHTML: { __html: e.icon }
|
|
847
985
|
}), e.label]
|
|
848
986
|
}) : /* @__PURE__ */ m("button", {
|
|
849
987
|
type: "button",
|
|
850
|
-
onClick: (n) =>
|
|
851
|
-
className:
|
|
988
|
+
onClick: (n) => u(n, e, t),
|
|
989
|
+
className: Ve(e.disabled),
|
|
852
990
|
children: [e.icon && /* @__PURE__ */ p("span", {
|
|
853
991
|
className: "wc-breadcrumb-icon",
|
|
854
992
|
dangerouslySetInnerHTML: { __html: e.icon }
|
|
855
993
|
}), e.label]
|
|
856
994
|
}) : /* @__PURE__ */ m("span", {
|
|
857
|
-
className:
|
|
995
|
+
className: Ve(!0),
|
|
858
996
|
"aria-current": "page",
|
|
859
997
|
children: [e.icon && /* @__PURE__ */ p("span", {
|
|
860
998
|
className: "wc-breadcrumb-icon",
|
|
861
999
|
dangerouslySetInnerHTML: { __html: e.icon }
|
|
862
1000
|
}), e.label]
|
|
863
|
-
}), t <
|
|
1001
|
+
}), t < l.length - 1 && /* @__PURE__ */ p("span", {
|
|
864
1002
|
className: "wc-breadcrumb-separator",
|
|
865
1003
|
children: n
|
|
866
1004
|
})]
|
|
@@ -870,7 +1008,7 @@ function Fe({ items: t = [], separator: n = "/", variant: r = "default", showHom
|
|
|
870
1008
|
}
|
|
871
1009
|
//#endregion
|
|
872
1010
|
//#region ../core/src/components/Button/utils.jsx
|
|
873
|
-
var
|
|
1011
|
+
var Ge = [
|
|
874
1012
|
"primary",
|
|
875
1013
|
"secondary",
|
|
876
1014
|
"filled",
|
|
@@ -885,23 +1023,23 @@ var Ie = [
|
|
|
885
1023
|
"cyan",
|
|
886
1024
|
"pink"
|
|
887
1025
|
];
|
|
888
|
-
function
|
|
889
|
-
return
|
|
1026
|
+
function Ke(e) {
|
|
1027
|
+
return Ge.includes(e);
|
|
890
1028
|
}
|
|
891
|
-
function
|
|
892
|
-
return
|
|
1029
|
+
function qe(e) {
|
|
1030
|
+
return Ke(e) ? e : "primary";
|
|
893
1031
|
}
|
|
894
|
-
function
|
|
1032
|
+
function Je(e) {
|
|
895
1033
|
let { variant: t, size: n, disabled: r, loading: i, fullWidth: a, uppercase: o, rounded: s, buttonStyle: c = "default" } = e, l = ["wc-btn"];
|
|
896
|
-
return l.push(`wc-btn--style-${c}`), l.push(`wc-btn--${
|
|
1034
|
+
return l.push(`wc-btn--style-${c}`), l.push(`wc-btn--${qe(t)}`), l.push(`wc-btn--${n}`), (r || i) && l.push("wc-btn--disabled"), i && l.push("wc-btn--loading"), a && l.push("wc-btn--full-width"), o && l.push("wc-btn--uppercase"), s === !1 || s === "none" ? l.push("wc-btn--rounded-none") : typeof s == "string" ? l.push(`wc-btn--rounded-${s}`) : l.push("wc-btn--rounded"), l;
|
|
897
1035
|
}
|
|
898
|
-
function
|
|
1036
|
+
function Ye({ event: e, disabled: t, loading: n, href: r, target: i, onClick: a }) {
|
|
899
1037
|
!t && !n && (r && window.open(r, i), a?.(e));
|
|
900
1038
|
}
|
|
901
1039
|
//#endregion
|
|
902
1040
|
//#region src/components/Button/Button.jsx
|
|
903
|
-
var
|
|
904
|
-
let T =
|
|
1041
|
+
var Xe = ({ children: e, variant: t = "primary", buttonStyle: n = "default", size: r = "md", disabled: i = !1, loading: a = !1, fullWidth: o = !1, type: s = "button", href: c = null, target: l = "_self", startIcon: u = null, endIcon: d = null, rounded: f = !0, uppercase: h = !1, ripple: g = !0, onClick: _, onMouseOver: v, onMouseOut: y, onFocus: b, onBlur: x, className: S = "", style: C = {}, ...w }) => {
|
|
1042
|
+
let T = Je({
|
|
905
1043
|
variant: t,
|
|
906
1044
|
buttonStyle: n,
|
|
907
1045
|
size: r,
|
|
@@ -911,7 +1049,7 @@ var Ve = ({ children: e, variant: t = "primary", buttonStyle: n = "default", siz
|
|
|
911
1049
|
uppercase: h,
|
|
912
1050
|
rounded: f
|
|
913
1051
|
}).concat(S).filter(Boolean).join(" "), E = { ...C }, D = (e) => {
|
|
914
|
-
|
|
1052
|
+
Ye({
|
|
915
1053
|
event: e,
|
|
916
1054
|
disabled: i,
|
|
917
1055
|
loading: a,
|
|
@@ -975,10 +1113,10 @@ var Ve = ({ children: e, variant: t = "primary", buttonStyle: n = "default", siz
|
|
|
975
1113
|
]
|
|
976
1114
|
});
|
|
977
1115
|
};
|
|
978
|
-
|
|
1116
|
+
Xe.displayName = "Button";
|
|
979
1117
|
//#endregion
|
|
980
1118
|
//#region src/components/Card/CardActions.jsx
|
|
981
|
-
var
|
|
1119
|
+
var Ze = ({ children: e, disableSpacing: t = !1, disablePadding: n = !1, justifyContent: r = "flex-start", className: i = "", ...a }) => /* @__PURE__ */ p("div", {
|
|
982
1120
|
className: [
|
|
983
1121
|
"wc-card-actions",
|
|
984
1122
|
"wc-flex",
|
|
@@ -997,10 +1135,10 @@ var He = ({ children: e, disableSpacing: t = !1, disablePadding: n = !1, justify
|
|
|
997
1135
|
...a,
|
|
998
1136
|
children: e
|
|
999
1137
|
});
|
|
1000
|
-
|
|
1138
|
+
Ze.displayName = "CardActions";
|
|
1001
1139
|
//#endregion
|
|
1002
1140
|
//#region src/components/Card/CardContent.jsx
|
|
1003
|
-
var
|
|
1141
|
+
var Qe = ({ children: e, disablePadding: t = !1, padding: n = "normal", className: r = "", ...i }) => /* @__PURE__ */ p("div", {
|
|
1004
1142
|
className: [
|
|
1005
1143
|
"wc-card-content",
|
|
1006
1144
|
!t && {
|
|
@@ -1014,22 +1152,22 @@ var Ue = ({ children: e, disablePadding: t = !1, padding: n = "normal", classNam
|
|
|
1014
1152
|
...i,
|
|
1015
1153
|
children: e
|
|
1016
1154
|
});
|
|
1017
|
-
|
|
1155
|
+
Qe.displayName = "CardContent";
|
|
1018
1156
|
//#endregion
|
|
1019
1157
|
//#region src/components/Checkbox/Checkbox.jsx
|
|
1020
|
-
var
|
|
1158
|
+
var $e = [
|
|
1021
1159
|
"primary",
|
|
1022
1160
|
"secondary",
|
|
1023
1161
|
"success",
|
|
1024
1162
|
"warning",
|
|
1025
1163
|
"error",
|
|
1026
1164
|
"info"
|
|
1027
|
-
],
|
|
1165
|
+
], et = [
|
|
1028
1166
|
"sm",
|
|
1029
1167
|
"md",
|
|
1030
1168
|
"lg"
|
|
1031
|
-
],
|
|
1032
|
-
let _ = s(), [v, y] = d(!1), b =
|
|
1169
|
+
], tt = ({ checked: e = !1, onChange: t, indeterminate: n = !1, disabled: r = !1, required: i = !1, size: a = "md", color: o = "primary", label: c = "", labelPlacement: l = "end", value: u = !0, name: f, className: h = "", ...g }) => {
|
|
1170
|
+
let _ = s(), [v, y] = d(!1), b = $e.includes(o) ? o : "primary", x = et.includes(a) ? a : "md", S = [
|
|
1033
1171
|
"wc-checkbox",
|
|
1034
1172
|
`wc-checkbox--${x}`,
|
|
1035
1173
|
(e || n) && (n ? "wc-checkbox--indeterminate" : "wc-checkbox--checked"),
|
|
@@ -1099,46 +1237,46 @@ var We = [
|
|
|
1099
1237
|
]
|
|
1100
1238
|
});
|
|
1101
1239
|
};
|
|
1102
|
-
|
|
1240
|
+
tt.displayName = "Checkbox";
|
|
1103
1241
|
//#endregion
|
|
1104
1242
|
//#region ../core/src/components/Chip/utils.jsx
|
|
1105
|
-
function
|
|
1243
|
+
function nt(e) {
|
|
1106
1244
|
let { size: t = "md", variant: n = "filled", color: r = "default", clickable: i = !1, disabled: a = !1, className: o = "" } = e, s = ["wc-chip"];
|
|
1107
1245
|
return s.push(`wc-chip--${t}`), s.push(`wc-chip--${n}`), s.push(`wc-chip--${r}`), i && !a && s.push("wc-chip--clickable"), a && s.push("wc-chip--disabled"), o && s.push(o), s.filter(Boolean).join(" ");
|
|
1108
1246
|
}
|
|
1109
|
-
function
|
|
1247
|
+
function rt(e, t, n, r) {
|
|
1110
1248
|
t && !n && r && r(e);
|
|
1111
1249
|
}
|
|
1112
|
-
function
|
|
1250
|
+
function it(e, t, n) {
|
|
1113
1251
|
e.stopPropagation(), !t && n && n(e);
|
|
1114
1252
|
}
|
|
1115
|
-
function
|
|
1253
|
+
function at() {
|
|
1116
1254
|
return "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z";
|
|
1117
1255
|
}
|
|
1118
1256
|
//#endregion
|
|
1119
1257
|
//#region src/components/Chip/Chip.jsx
|
|
1120
|
-
function
|
|
1121
|
-
let g =
|
|
1258
|
+
function ot({ label: e = "", avatar: t = "", deletable: n = !1, disabled: r = !1, clickable: i = !1, variant: a = "filled", size: o = "md", color: s = "default", deleteIcon: c = null, onClick: l, onDelete: u, children: d, className: f = "", ...h }) {
|
|
1259
|
+
let { messages: g } = q(), _ = nt({
|
|
1122
1260
|
size: o,
|
|
1123
1261
|
variant: a,
|
|
1124
1262
|
color: s,
|
|
1125
1263
|
clickable: i,
|
|
1126
1264
|
disabled: r,
|
|
1127
1265
|
className: f
|
|
1128
|
-
}),
|
|
1129
|
-
|
|
1130
|
-
}, v = (e) => {
|
|
1131
|
-
Ye(e, r, u);
|
|
1266
|
+
}), v = (e) => {
|
|
1267
|
+
rt(e, i, r, l);
|
|
1132
1268
|
}, y = (e) => {
|
|
1133
|
-
(e
|
|
1269
|
+
it(e, r, u);
|
|
1270
|
+
}, b = (e) => {
|
|
1271
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), v(e));
|
|
1134
1272
|
};
|
|
1135
1273
|
return /* @__PURE__ */ m("div", {
|
|
1136
|
-
className:
|
|
1274
|
+
className: _,
|
|
1137
1275
|
role: i ? "button" : void 0,
|
|
1138
1276
|
tabIndex: i && !r ? 0 : void 0,
|
|
1139
1277
|
"aria-disabled": i ? r : void 0,
|
|
1140
|
-
onClick:
|
|
1141
|
-
onKeyDown:
|
|
1278
|
+
onClick: v,
|
|
1279
|
+
onKeyDown: b,
|
|
1142
1280
|
...h,
|
|
1143
1281
|
children: [
|
|
1144
1282
|
d && d.avatar || t ? /* @__PURE__ */ p("div", {
|
|
@@ -1155,9 +1293,9 @@ function Ze({ label: e = "", avatar: t = "", deletable: n = !1, disabled: r = !1
|
|
|
1155
1293
|
}),
|
|
1156
1294
|
n && /* @__PURE__ */ p("button", {
|
|
1157
1295
|
type: "button",
|
|
1158
|
-
onClick:
|
|
1296
|
+
onClick: y,
|
|
1159
1297
|
className: "wc-chip-delete",
|
|
1160
|
-
"aria-label": "
|
|
1298
|
+
"aria-label": g.removeItem(typeof e == "string" ? e : void 0),
|
|
1161
1299
|
children: c || /* @__PURE__ */ p("svg", {
|
|
1162
1300
|
width: "16",
|
|
1163
1301
|
height: "16",
|
|
@@ -1167,7 +1305,7 @@ function Ze({ label: e = "", avatar: t = "", deletable: n = !1, disabled: r = !1
|
|
|
1167
1305
|
"aria-hidden": "true",
|
|
1168
1306
|
children: /* @__PURE__ */ p("path", {
|
|
1169
1307
|
fillRule: "evenodd",
|
|
1170
|
-
d:
|
|
1308
|
+
d: at(),
|
|
1171
1309
|
clipRule: "evenodd"
|
|
1172
1310
|
})
|
|
1173
1311
|
})
|
|
@@ -1177,7 +1315,7 @@ function Ze({ label: e = "", avatar: t = "", deletable: n = !1, disabled: r = !1
|
|
|
1177
1315
|
}
|
|
1178
1316
|
//#endregion
|
|
1179
1317
|
//#region ../core/src/components/CircularProgress/utils.jsx
|
|
1180
|
-
function
|
|
1318
|
+
function st(e, t) {
|
|
1181
1319
|
let n = typeof e == "string" ? parseInt(e, 10) : e, r = n / 2, i = (n - t) / 2;
|
|
1182
1320
|
return {
|
|
1183
1321
|
sizeNumber: n,
|
|
@@ -1186,21 +1324,21 @@ function Qe(e, t) {
|
|
|
1186
1324
|
circumference: 2 * Math.PI * i
|
|
1187
1325
|
};
|
|
1188
1326
|
}
|
|
1189
|
-
function
|
|
1327
|
+
function ct(e, t, n) {
|
|
1190
1328
|
return e === "determinate" ? n - t / 100 * n : 0;
|
|
1191
1329
|
}
|
|
1192
|
-
function
|
|
1330
|
+
function lt(e) {
|
|
1193
1331
|
let { color: t = "primary", variant: n = "indeterminate", overlay: r = !1, centered: i = !1, inline: a = !1, className: o = "" } = e, s = ["wc-circular-progress"];
|
|
1194
1332
|
return s.push(`wc-circular-progress--${t}`), n === "indeterminate" && s.push("wc-circular-progress--indeterminate"), r && s.push("wc-circular-progress--overlay"), i && s.push("wc-circular-progress--centered"), a && s.push("wc-circular-progress--inline"), o && s.push(o), s.filter(Boolean);
|
|
1195
1333
|
}
|
|
1196
|
-
function
|
|
1334
|
+
function ut(e) {
|
|
1197
1335
|
let t = ["wc-circular-progress-circle"];
|
|
1198
1336
|
return e === "indeterminate" && t.push("wc-circular-progress-circle--indeterminate"), t.filter(Boolean);
|
|
1199
1337
|
}
|
|
1200
|
-
function
|
|
1338
|
+
function dt(e) {
|
|
1201
1339
|
return Math.round(e);
|
|
1202
1340
|
}
|
|
1203
|
-
function
|
|
1341
|
+
function ft(e) {
|
|
1204
1342
|
let { value: t = 0, variant: n } = e, r = {
|
|
1205
1343
|
role: "progressbar",
|
|
1206
1344
|
"aria-valuemin": 0,
|
|
@@ -1210,92 +1348,94 @@ function rt(e) {
|
|
|
1210
1348
|
}
|
|
1211
1349
|
//#endregion
|
|
1212
1350
|
//#region src/components/CircularProgress/CircularProgress.jsx
|
|
1213
|
-
function
|
|
1214
|
-
let {
|
|
1351
|
+
function pt({ value: e = 0, size: t = 40, thickness: n = 3.6, variant: r = "indeterminate", color: i = "primary", showValue: a = !1, overlay: o = !1, centered: s = !1, inline: c = !1, className: l = "", ...u }) {
|
|
1352
|
+
let { messages: d } = q(), { sizeNumber: f, center: h, radius: g, circumference: _ } = st(t, n), v = ct(r, e, _), y = lt({
|
|
1215
1353
|
color: i,
|
|
1216
1354
|
variant: r,
|
|
1217
1355
|
overlay: o,
|
|
1218
1356
|
centered: s,
|
|
1219
1357
|
inline: c,
|
|
1220
1358
|
className: l
|
|
1221
|
-
}).join(" "),
|
|
1359
|
+
}).join(" "), b = ut(r).join(" "), x = ft({
|
|
1360
|
+
value: e,
|
|
1361
|
+
variant: r
|
|
1362
|
+
});
|
|
1222
1363
|
return /* @__PURE__ */ m("div", {
|
|
1223
|
-
className:
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
variant: r
|
|
1227
|
-
}),
|
|
1364
|
+
className: y,
|
|
1365
|
+
"aria-label": d.circularProgress,
|
|
1366
|
+
...x,
|
|
1228
1367
|
...u,
|
|
1229
1368
|
children: [/* @__PURE__ */ m("svg", {
|
|
1230
|
-
width:
|
|
1231
|
-
height:
|
|
1232
|
-
viewBox: `0 0 ${
|
|
1369
|
+
width: f,
|
|
1370
|
+
height: f,
|
|
1371
|
+
viewBox: `0 0 ${f} ${f}`,
|
|
1233
1372
|
className: "wc-circular-progress-svg",
|
|
1234
1373
|
children: [/* @__PURE__ */ p("circle", {
|
|
1235
|
-
cx:
|
|
1236
|
-
cy:
|
|
1237
|
-
r:
|
|
1374
|
+
cx: h,
|
|
1375
|
+
cy: h,
|
|
1376
|
+
r: g,
|
|
1238
1377
|
strokeWidth: n,
|
|
1239
1378
|
stroke: "currentColor",
|
|
1240
1379
|
fill: "none",
|
|
1241
1380
|
className: "wc-circular-progress-bg"
|
|
1242
1381
|
}), /* @__PURE__ */ p("circle", {
|
|
1243
|
-
cx:
|
|
1244
|
-
cy:
|
|
1245
|
-
r:
|
|
1382
|
+
cx: h,
|
|
1383
|
+
cy: h,
|
|
1384
|
+
r: g,
|
|
1246
1385
|
strokeWidth: n,
|
|
1247
1386
|
stroke: "currentColor",
|
|
1248
1387
|
fill: "none",
|
|
1249
|
-
strokeDasharray:
|
|
1250
|
-
strokeDashoffset:
|
|
1251
|
-
className:
|
|
1388
|
+
strokeDasharray: _,
|
|
1389
|
+
strokeDashoffset: v,
|
|
1390
|
+
className: b
|
|
1252
1391
|
})]
|
|
1253
1392
|
}), a && /* @__PURE__ */ m("div", {
|
|
1254
1393
|
className: "wc-circular-progress-value",
|
|
1255
|
-
children: [
|
|
1394
|
+
children: [dt(e), "%"]
|
|
1256
1395
|
})]
|
|
1257
1396
|
});
|
|
1258
1397
|
}
|
|
1259
1398
|
//#endregion
|
|
1260
1399
|
//#region ../core/src/components/ColorPicker/utils.jsx
|
|
1261
|
-
function
|
|
1400
|
+
function mt(e) {
|
|
1262
1401
|
let { size: t = "md", shape: n = "circle", disabled: r = !1, className: i = "" } = e, a = ["wc-color-picker"];
|
|
1263
1402
|
return a.push(`wc-color-picker--${t}`), a.push(`wc-color-picker--${n}`), r && a.push("wc-color-picker--disabled"), i && a.push(i), a.filter(Boolean);
|
|
1264
1403
|
}
|
|
1265
|
-
function
|
|
1404
|
+
function ht(e, t, n) {
|
|
1266
1405
|
!t && n && n(e.target.value);
|
|
1267
1406
|
}
|
|
1268
|
-
function
|
|
1407
|
+
function gt(e) {
|
|
1269
1408
|
return { backgroundColor: e };
|
|
1270
1409
|
}
|
|
1271
1410
|
//#endregion
|
|
1272
1411
|
//#region src/components/ColorPicker/ColorPicker.jsx
|
|
1273
|
-
function
|
|
1274
|
-
let o = e ?? "",
|
|
1412
|
+
function _t({ value: e = "#ffffff", onChange: t, size: n = "md", shape: r = "circle", disabled: i = !1, className: a = "" }) {
|
|
1413
|
+
let { messages: o } = q(), s = e ?? "", c = mt({
|
|
1275
1414
|
size: n,
|
|
1276
1415
|
shape: r,
|
|
1277
1416
|
disabled: i,
|
|
1278
1417
|
className: a
|
|
1279
|
-
}).join(" "),
|
|
1418
|
+
}).join(" "), l = gt(s);
|
|
1280
1419
|
return /* @__PURE__ */ m("label", {
|
|
1281
|
-
className:
|
|
1420
|
+
className: c,
|
|
1282
1421
|
children: [/* @__PURE__ */ p("input", {
|
|
1283
1422
|
type: "color",
|
|
1284
|
-
value:
|
|
1423
|
+
value: s,
|
|
1285
1424
|
onChange: (e) => {
|
|
1286
|
-
|
|
1425
|
+
ht(e, i, t);
|
|
1287
1426
|
},
|
|
1288
1427
|
disabled: i,
|
|
1289
|
-
className: "wc-color-picker__input"
|
|
1428
|
+
className: "wc-color-picker__input",
|
|
1429
|
+
"aria-label": o.colorPicker
|
|
1290
1430
|
}), /* @__PURE__ */ p("span", {
|
|
1291
1431
|
className: "wc-color-picker__preview",
|
|
1292
|
-
style:
|
|
1432
|
+
style: l
|
|
1293
1433
|
})]
|
|
1294
1434
|
});
|
|
1295
1435
|
}
|
|
1296
1436
|
//#endregion
|
|
1297
1437
|
//#region ../core/src/components/Container/utils.jsx
|
|
1298
|
-
var
|
|
1438
|
+
var vt = {
|
|
1299
1439
|
xs: "max-w-xs",
|
|
1300
1440
|
sm: "max-w-sm",
|
|
1301
1441
|
md: "max-w-md",
|
|
@@ -1303,15 +1443,15 @@ var lt = {
|
|
|
1303
1443
|
xl: "max-w-6xl",
|
|
1304
1444
|
"2xl": "max-w-7xl"
|
|
1305
1445
|
};
|
|
1306
|
-
function
|
|
1446
|
+
function yt(e) {
|
|
1307
1447
|
let { maxWidth: t = "lg", fluid: n = !1, fixed: r = !1, className: i = "" } = e, a = ["mx-auto px-4 sm:px-6 lg:px-8"];
|
|
1308
|
-
return n || r ? a.push("w-full") : t &&
|
|
1448
|
+
return n || r ? a.push("w-full") : t && vt[t] && a.push(vt[t]), i && a.push(i), a.filter(Boolean);
|
|
1309
1449
|
}
|
|
1310
1450
|
//#endregion
|
|
1311
1451
|
//#region src/components/Container/Container.jsx
|
|
1312
|
-
function
|
|
1452
|
+
function bt({ maxWidth: e = "lg", fluid: t = !1, fixed: n = !1, className: r = "", children: i }) {
|
|
1313
1453
|
return /* @__PURE__ */ p("div", {
|
|
1314
|
-
className:
|
|
1454
|
+
className: yt({
|
|
1315
1455
|
maxWidth: e,
|
|
1316
1456
|
fluid: t,
|
|
1317
1457
|
fixed: n,
|
|
@@ -1322,17 +1462,17 @@ function dt({ maxWidth: e = "lg", fluid: t = !1, fixed: n = !1, className: r = "
|
|
|
1322
1462
|
}
|
|
1323
1463
|
//#endregion
|
|
1324
1464
|
//#region ../core/src/components/Copy/utils.jsx
|
|
1325
|
-
function
|
|
1465
|
+
function xt(e) {
|
|
1326
1466
|
let { variant: t = "default", size: n = "md", copied: r = !1, copyError: i = !1, className: a = "" } = e, o = ["wc-copy"];
|
|
1327
1467
|
return o.push(`wc-copy--${t}`), o.push(`wc-copy--${n}`), r && o.push("wc-copy--copied"), i && o.push("wc-copy--error"), a && o.push(a), o.filter(Boolean);
|
|
1328
1468
|
}
|
|
1329
|
-
function
|
|
1469
|
+
function St(e, t, n, r) {
|
|
1330
1470
|
return t ? "错误" : e ? r : n;
|
|
1331
1471
|
}
|
|
1332
|
-
function
|
|
1472
|
+
function Ct(e, t, n, r) {
|
|
1333
1473
|
return t ? r : e ? n : "";
|
|
1334
1474
|
}
|
|
1335
|
-
async function
|
|
1475
|
+
async function wt(e) {
|
|
1336
1476
|
try {
|
|
1337
1477
|
if (navigator.clipboard?.writeText) return await navigator.clipboard.writeText(e), !0;
|
|
1338
1478
|
{
|
|
@@ -1345,18 +1485,18 @@ async function ht(e) {
|
|
|
1345
1485
|
return console.warn("复制失败:", e), !1;
|
|
1346
1486
|
}
|
|
1347
1487
|
}
|
|
1348
|
-
async function
|
|
1349
|
-
await
|
|
1488
|
+
async function Tt(e, t, n, r, i, a, o, s) {
|
|
1489
|
+
await wt(e) ? (r(!0), i(!1), t(e)) : (r(!1), i(!0), n(/* @__PURE__ */ Error("复制失败"))), o && a && (a(!0), setTimeout(() => a(!1), 1500)), setTimeout(() => {
|
|
1350
1490
|
r(!1), i(!1);
|
|
1351
1491
|
}, s);
|
|
1352
1492
|
}
|
|
1353
|
-
function
|
|
1493
|
+
function Et(e, t) {
|
|
1354
1494
|
let n = "wc-copy-tooltip";
|
|
1355
1495
|
return e && (n += " wc-copy-tooltip--success"), t && (n += " wc-copy-tooltip--error"), n;
|
|
1356
1496
|
}
|
|
1357
1497
|
//#endregion
|
|
1358
1498
|
//#region src/components/Copy/Copy.jsx
|
|
1359
|
-
var
|
|
1499
|
+
var Dt = ({ copied: e, error: t }) => e ? /* @__PURE__ */ m("svg", {
|
|
1360
1500
|
viewBox: "0 0 20 20",
|
|
1361
1501
|
fill: "none",
|
|
1362
1502
|
stroke: "currentColor",
|
|
@@ -1396,15 +1536,15 @@ var vt = ({ copied: e, error: t }) => e ? /* @__PURE__ */ m("svg", {
|
|
|
1396
1536
|
rx: "2"
|
|
1397
1537
|
}), /* @__PURE__ */ p("path", { d: "M13.5 6.5v-1A2 2 0 0 0 11.5 3.5h-7a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h2" })]
|
|
1398
1538
|
});
|
|
1399
|
-
function
|
|
1400
|
-
let [v, y] = d(!1), [b, x] = d(!1), [S, C] = d(!1), w =
|
|
1539
|
+
function Ot({ text: e, variant: t = "default", size: n = "md", showLabel: r = !0, showTooltip: i = !0, copyLabel: a = "复制", copiedLabel: o = "已复制", tooltipSuccess: s = "复制成功!", tooltipError: c = "复制失败", resetDelay: l = 2e3, onCopy: u = () => {}, onError: f = () => {}, className: h = "", children: g, icon: _ }) {
|
|
1540
|
+
let [v, y] = d(!1), [b, x] = d(!1), [S, C] = d(!1), w = xt({
|
|
1401
1541
|
variant: t,
|
|
1402
1542
|
size: n,
|
|
1403
1543
|
copied: v,
|
|
1404
1544
|
copyError: b,
|
|
1405
1545
|
className: h
|
|
1406
|
-
}).join(" "), T =
|
|
1407
|
-
await
|
|
1546
|
+
}).join(" "), T = St(v, b, a, o), E = Ct(v, b, s, c), D = Et(v, b), O = async () => {
|
|
1547
|
+
await Tt(e, u, f, y, x, C, i, l);
|
|
1408
1548
|
}, k = (e) => {
|
|
1409
1549
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), O());
|
|
1410
1550
|
};
|
|
@@ -1424,7 +1564,7 @@ function yt({ text: e, variant: t = "default", size: n = "md", showLabel: r = !0
|
|
|
1424
1564
|
className: "wc-copy-action",
|
|
1425
1565
|
children: [_ ? /* @__PURE__ */ p(_, { className: "wc-copy-icon" }) : /* @__PURE__ */ p("span", {
|
|
1426
1566
|
className: "wc-copy-icon",
|
|
1427
|
-
children: /* @__PURE__ */ p(
|
|
1567
|
+
children: /* @__PURE__ */ p(Dt, {
|
|
1428
1568
|
copied: v,
|
|
1429
1569
|
error: b
|
|
1430
1570
|
})
|
|
@@ -1443,20 +1583,20 @@ function yt({ text: e, variant: t = "default", size: n = "md", showLabel: r = !0
|
|
|
1443
1583
|
}
|
|
1444
1584
|
//#endregion
|
|
1445
1585
|
//#region ../core/src/components/DatePicker/utils.jsx
|
|
1446
|
-
function
|
|
1586
|
+
function kt(e, t = "YYYY-MM-DD") {
|
|
1447
1587
|
if (!e || !(e instanceof Date)) return "";
|
|
1448
1588
|
let n = e.getFullYear(), r = String(e.getMonth() + 1).padStart(2, "0"), i = String(e.getDate()).padStart(2, "0");
|
|
1449
1589
|
return t.replace("YYYY", n).replace("MM", r).replace("DD", i);
|
|
1450
1590
|
}
|
|
1451
|
-
function
|
|
1591
|
+
function At(e) {
|
|
1452
1592
|
if (!e) return !1;
|
|
1453
1593
|
let t = /* @__PURE__ */ new Date();
|
|
1454
1594
|
return e.toDateString() === t.toDateString();
|
|
1455
1595
|
}
|
|
1456
|
-
function
|
|
1596
|
+
function jt(e, t) {
|
|
1457
1597
|
return !e || !t ? !1 : e.toDateString() === t.toDateString();
|
|
1458
1598
|
}
|
|
1459
|
-
function
|
|
1599
|
+
function Mt(e) {
|
|
1460
1600
|
let t = e.getFullYear(), n = e.getMonth(), r = new Date(t, n, 1), i = new Date(t, n + 1, 0), a = r.getDay(), o = i.getDate(), s = [], c = new Date(t, n - 1, 0);
|
|
1461
1601
|
for (let e = a - 1; e >= 0; e--) s.push({
|
|
1462
1602
|
day: c.getDate() - e,
|
|
@@ -1476,7 +1616,7 @@ function Ct(e) {
|
|
|
1476
1616
|
});
|
|
1477
1617
|
return s;
|
|
1478
1618
|
}
|
|
1479
|
-
function
|
|
1619
|
+
function Nt(e = "md", t = "default", n = !1, r = !1, i = !1) {
|
|
1480
1620
|
let a = [
|
|
1481
1621
|
"wc-datepicker-wrapper",
|
|
1482
1622
|
`wc-datepicker-wrapper--${e}`,
|
|
@@ -1484,44 +1624,48 @@ function wt(e = "md", t = "default", n = !1, r = !1, i = !1) {
|
|
|
1484
1624
|
];
|
|
1485
1625
|
return n && a.push("wc-datepicker-wrapper--disabled"), r && a.push("wc-datepicker-wrapper--focused"), i && a.push("wc-datepicker-wrapper--open"), a.join(" ");
|
|
1486
1626
|
}
|
|
1487
|
-
function
|
|
1627
|
+
function Pt(e, t) {
|
|
1488
1628
|
let n = ["wc-datepicker-day"];
|
|
1489
|
-
return e.month === "prev" && n.push("wc-datepicker-day--prev"), e.month === "next" && n.push("wc-datepicker-day--next"), e.month === "current" && n.push("wc-datepicker-day--current"), t &&
|
|
1629
|
+
return e.month === "prev" && n.push("wc-datepicker-day--prev"), e.month === "next" && n.push("wc-datepicker-day--next"), e.month === "current" && n.push("wc-datepicker-day--current"), t && jt(e.date, t) && n.push("wc-datepicker-day--selected"), At(e.date) && n.push("wc-datepicker-day--today"), n.join(" ");
|
|
1490
1630
|
}
|
|
1491
1631
|
//#endregion
|
|
1492
1632
|
//#region src/components/DatePicker/DatePicker.jsx
|
|
1493
|
-
function
|
|
1494
|
-
let v = u(null),
|
|
1633
|
+
function Ft({ value: e = null, onChange: t = () => {}, placeholder: n = "请选择日期", disabled: r = !1, size: i = "md", variant: a = "default", format: c = "YYYY-MM-DD", showToday: l = !0, minDate: f = null, maxDate: h = null, className: g = "", ..._ }) {
|
|
1634
|
+
let { messages: v } = q(), y = u(null), b = u(null), x = s(), [S, C] = d(!1), [w, T] = d(() => e ? new Date(e) : /* @__PURE__ */ new Date()), [E, D] = d(e ? new Date(e) : null);
|
|
1495
1635
|
o(() => {
|
|
1496
|
-
|
|
1497
|
-
}, [e]),
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
C((
|
|
1636
|
+
D(e ? new Date(e) : null);
|
|
1637
|
+
}, [e]), se({
|
|
1638
|
+
open: S,
|
|
1639
|
+
elementRef: b,
|
|
1640
|
+
refs: [y],
|
|
1641
|
+
closeOnEscape: !0,
|
|
1642
|
+
closeOnPointerDownOutside: !0,
|
|
1643
|
+
onEscapeKeyDown: () => C(!1),
|
|
1644
|
+
onPointerDownOutside: () => C(!1),
|
|
1645
|
+
zIndex: 1e3
|
|
1646
|
+
});
|
|
1647
|
+
let O = E ? kt(E, c) : "", k = () => {
|
|
1648
|
+
r || C((e) => !e);
|
|
1649
|
+
}, A = (e) => {
|
|
1650
|
+
r || (e.key === "Enter" || e.key === " " || e.key === "ArrowDown" ? (e.preventDefault(), C(!0)) : e.key === "Escape" && C(!1));
|
|
1651
|
+
}, j = (e) => {
|
|
1652
|
+
T((t) => {
|
|
1509
1653
|
let n = new Date(t);
|
|
1510
1654
|
return n.setMonth(n.getMonth() + e), n;
|
|
1511
1655
|
});
|
|
1512
|
-
},
|
|
1513
|
-
if (
|
|
1656
|
+
}, M = (e) => {
|
|
1657
|
+
if (F(e)) return;
|
|
1514
1658
|
let n = new Date(e.date);
|
|
1515
|
-
|
|
1516
|
-
},
|
|
1659
|
+
D(n), t(n), C(!1);
|
|
1660
|
+
}, N = () => {
|
|
1517
1661
|
let e = /* @__PURE__ */ new Date();
|
|
1518
|
-
|
|
1519
|
-
},
|
|
1520
|
-
|
|
1521
|
-
},
|
|
1662
|
+
D(e), t(e), C(!1);
|
|
1663
|
+
}, P = () => {
|
|
1664
|
+
D(null), t(null), C(!1);
|
|
1665
|
+
}, F = (e) => {
|
|
1522
1666
|
let { date: t } = e;
|
|
1523
1667
|
return !!(f && t < (f instanceof Date ? f : new Date(f)) || h && t > (h instanceof Date ? h : new Date(h)));
|
|
1524
|
-
},
|
|
1668
|
+
}, I = Mt(w), L = [
|
|
1525
1669
|
"日",
|
|
1526
1670
|
"一",
|
|
1527
1671
|
"二",
|
|
@@ -1529,27 +1673,27 @@ function Et({ value: e = null, onChange: t = () => {}, placeholder: n = "请选
|
|
|
1529
1673
|
"四",
|
|
1530
1674
|
"五",
|
|
1531
1675
|
"六"
|
|
1532
|
-
],
|
|
1676
|
+
], R = `${w.getFullYear()}年${w.getMonth() + 1}月`, z = [Nt(i, a, r, !1, S), g].filter(Boolean).join(" ");
|
|
1533
1677
|
return /* @__PURE__ */ m("div", {
|
|
1534
1678
|
className: "wc-datepicker",
|
|
1535
|
-
ref:
|
|
1679
|
+
ref: y,
|
|
1536
1680
|
..._,
|
|
1537
1681
|
children: [/* @__PURE__ */ m("div", {
|
|
1538
|
-
className:
|
|
1539
|
-
onClick:
|
|
1682
|
+
className: z,
|
|
1683
|
+
onClick: k,
|
|
1540
1684
|
children: [/* @__PURE__ */ p("input", {
|
|
1541
1685
|
type: "text",
|
|
1542
|
-
id:
|
|
1686
|
+
id: x,
|
|
1543
1687
|
className: "wc-datepicker-input",
|
|
1544
|
-
value:
|
|
1688
|
+
value: O,
|
|
1545
1689
|
placeholder: n,
|
|
1546
1690
|
disabled: r,
|
|
1547
1691
|
readOnly: !0,
|
|
1548
1692
|
role: "combobox",
|
|
1549
1693
|
"aria-haspopup": "dialog",
|
|
1550
|
-
"aria-expanded":
|
|
1551
|
-
"aria-controls": `${
|
|
1552
|
-
onKeyDown:
|
|
1694
|
+
"aria-expanded": S,
|
|
1695
|
+
"aria-controls": `${x}-calendar`,
|
|
1696
|
+
onKeyDown: A
|
|
1553
1697
|
}), /* @__PURE__ */ p("span", {
|
|
1554
1698
|
className: "wc-datepicker-icon",
|
|
1555
1699
|
"aria-hidden": "true",
|
|
@@ -1567,11 +1711,12 @@ function Et({ value: e = null, onChange: t = () => {}, placeholder: n = "请选
|
|
|
1567
1711
|
}), /* @__PURE__ */ p("path", { d: "M16 3v4M8 3v4M3 10h18" })]
|
|
1568
1712
|
})
|
|
1569
1713
|
})]
|
|
1570
|
-
}),
|
|
1714
|
+
}), S && /* @__PURE__ */ m("div", {
|
|
1715
|
+
ref: b,
|
|
1571
1716
|
className: "wc-datepicker-dropdown",
|
|
1572
|
-
id: `${
|
|
1717
|
+
id: `${x}-calendar`,
|
|
1573
1718
|
role: "dialog",
|
|
1574
|
-
"aria-label":
|
|
1719
|
+
"aria-label": v.openCalendar,
|
|
1575
1720
|
children: [
|
|
1576
1721
|
/* @__PURE__ */ m("div", {
|
|
1577
1722
|
className: "wc-datepicker-header",
|
|
@@ -1579,40 +1724,40 @@ function Et({ value: e = null, onChange: t = () => {}, placeholder: n = "请选
|
|
|
1579
1724
|
/* @__PURE__ */ p("button", {
|
|
1580
1725
|
type: "button",
|
|
1581
1726
|
className: "wc-datepicker-nav",
|
|
1582
|
-
"aria-label":
|
|
1583
|
-
onClick: () =>
|
|
1727
|
+
"aria-label": v.previousMonth,
|
|
1728
|
+
onClick: () => j(-1),
|
|
1584
1729
|
children: "‹"
|
|
1585
1730
|
}),
|
|
1586
1731
|
/* @__PURE__ */ p("span", {
|
|
1587
1732
|
className: "wc-datepicker-title",
|
|
1588
|
-
children:
|
|
1733
|
+
children: R
|
|
1589
1734
|
}),
|
|
1590
1735
|
/* @__PURE__ */ p("button", {
|
|
1591
1736
|
type: "button",
|
|
1592
1737
|
className: "wc-datepicker-nav",
|
|
1593
|
-
"aria-label":
|
|
1594
|
-
onClick: () =>
|
|
1738
|
+
"aria-label": v.nextMonth,
|
|
1739
|
+
onClick: () => j(1),
|
|
1595
1740
|
children: "›"
|
|
1596
1741
|
})
|
|
1597
1742
|
]
|
|
1598
1743
|
}),
|
|
1599
1744
|
/* @__PURE__ */ p("div", {
|
|
1600
1745
|
className: "wc-datepicker-weekdays",
|
|
1601
|
-
children:
|
|
1746
|
+
children: L.map((e) => /* @__PURE__ */ p("div", {
|
|
1602
1747
|
className: "wc-datepicker-weekday",
|
|
1603
1748
|
children: e
|
|
1604
1749
|
}, e))
|
|
1605
1750
|
}),
|
|
1606
1751
|
/* @__PURE__ */ p("div", {
|
|
1607
1752
|
className: "wc-datepicker-days",
|
|
1608
|
-
children:
|
|
1753
|
+
children: I.map((e) => /* @__PURE__ */ p("button", {
|
|
1609
1754
|
type: "button",
|
|
1610
|
-
className:
|
|
1611
|
-
disabled:
|
|
1612
|
-
"aria-label":
|
|
1613
|
-
"aria-selected":
|
|
1614
|
-
"aria-current":
|
|
1615
|
-
onClick: () =>
|
|
1755
|
+
className: Pt(e, E),
|
|
1756
|
+
disabled: F(e),
|
|
1757
|
+
"aria-label": kt(e.date, "YYYY-MM-DD"),
|
|
1758
|
+
"aria-selected": jt(e.date, E),
|
|
1759
|
+
"aria-current": At(e.date) ? "date" : void 0,
|
|
1760
|
+
onClick: () => M(e),
|
|
1616
1761
|
children: e.day
|
|
1617
1762
|
}, `${e.month}-${e.day}`))
|
|
1618
1763
|
}),
|
|
@@ -1621,12 +1766,12 @@ function Et({ value: e = null, onChange: t = () => {}, placeholder: n = "请选
|
|
|
1621
1766
|
children: [/* @__PURE__ */ p("button", {
|
|
1622
1767
|
type: "button",
|
|
1623
1768
|
className: "wc-datepicker-today",
|
|
1624
|
-
onClick:
|
|
1769
|
+
onClick: N,
|
|
1625
1770
|
children: "今天"
|
|
1626
1771
|
}), /* @__PURE__ */ p("button", {
|
|
1627
1772
|
type: "button",
|
|
1628
1773
|
className: "wc-datepicker-clear",
|
|
1629
|
-
onClick:
|
|
1774
|
+
onClick: P,
|
|
1630
1775
|
children: "清除"
|
|
1631
1776
|
})]
|
|
1632
1777
|
})
|
|
@@ -1636,7 +1781,7 @@ function Et({ value: e = null, onChange: t = () => {}, placeholder: n = "请选
|
|
|
1636
1781
|
}
|
|
1637
1782
|
//#endregion
|
|
1638
1783
|
//#region src/components/Button/Fab.jsx
|
|
1639
|
-
var
|
|
1784
|
+
var It = ({ variant: e = "circular", size: t = "md", color: n = "primary", disabled: r = !1, label: i = "", icon: a = "", children: o, onClick: s, onFocus: c, onBlur: l, className: u = "", style: f = {}, ...h }) => {
|
|
1640
1785
|
let [g, _] = d(!1), v = ["circular", "extended"], y = [
|
|
1641
1786
|
"sm",
|
|
1642
1787
|
"md",
|
|
@@ -1677,10 +1822,10 @@ var Dt = ({ variant: e = "circular", size: t = "md", color: n = "primary", disab
|
|
|
1677
1822
|
})]
|
|
1678
1823
|
});
|
|
1679
1824
|
};
|
|
1680
|
-
|
|
1825
|
+
It.displayName = "Fab";
|
|
1681
1826
|
//#endregion
|
|
1682
1827
|
//#region src/components/Feed/Feed.jsx
|
|
1683
|
-
var
|
|
1828
|
+
var Lt = ({ item: e, showAvatar: t = !0, variant: n = "timeline", color: r = "var(--wc-accent)", dotSize: i = 8, lineWidth: a = 1, onItemClick: o }) => {
|
|
1684
1829
|
let s = Array.isArray(e.children) && e.children.length, c = typeof i == "number" ? `${i}px` : i, l = typeof a == "number" ? `${a}px` : a, u = {
|
|
1685
1830
|
"--feed-color": r,
|
|
1686
1831
|
"--feed-dot-size": c,
|
|
@@ -1689,7 +1834,6 @@ var Ot = ({ item: e, showAvatar: t = !0, variant: n = "timeline", color: r = "va
|
|
|
1689
1834
|
return /* @__PURE__ */ m("li", {
|
|
1690
1835
|
className: `wc-feed-item ${n} ${s ? "has-children" : ""}`,
|
|
1691
1836
|
style: u,
|
|
1692
|
-
role: o ? "button" : void 0,
|
|
1693
1837
|
tabIndex: o ? 0 : void 0,
|
|
1694
1838
|
onClick: (t) => {
|
|
1695
1839
|
t.stopPropagation(), o && o(e);
|
|
@@ -1722,7 +1866,7 @@ var Ot = ({ item: e, showAvatar: t = !0, variant: n = "timeline", color: r = "va
|
|
|
1722
1866
|
}),
|
|
1723
1867
|
s && /* @__PURE__ */ p("ul", {
|
|
1724
1868
|
className: "wc-feed-children",
|
|
1725
|
-
children: e.children.map((e) => /* @__PURE__ */ p(
|
|
1869
|
+
children: e.children.map((e) => /* @__PURE__ */ p(Lt, {
|
|
1726
1870
|
item: e,
|
|
1727
1871
|
showAvatar: t,
|
|
1728
1872
|
variant: n,
|
|
@@ -1735,7 +1879,7 @@ var Ot = ({ item: e, showAvatar: t = !0, variant: n = "timeline", color: r = "va
|
|
|
1735
1879
|
]
|
|
1736
1880
|
})]
|
|
1737
1881
|
});
|
|
1738
|
-
},
|
|
1882
|
+
}, Rt = ({ items: e = [], variant: t = "timeline", showAvatar: n = !0, color: r = "var(--wc-accent)", dotSize: i = 8, lineWidth: a = 1, onItemClick: o, className: s = "" }) => {
|
|
1739
1883
|
let c = typeof a == "number" ? `${a}px` : a, l = {
|
|
1740
1884
|
"--feed-color": r,
|
|
1741
1885
|
"--feed-line-width": c
|
|
@@ -1743,7 +1887,7 @@ var Ot = ({ item: e, showAvatar: t = !0, variant: n = "timeline", color: r = "va
|
|
|
1743
1887
|
return /* @__PURE__ */ p("ul", {
|
|
1744
1888
|
className: `wc-feed-list ${t} ${s}`,
|
|
1745
1889
|
style: l,
|
|
1746
|
-
children: e.map((e) => /* @__PURE__ */ p(
|
|
1890
|
+
children: e.map((e) => /* @__PURE__ */ p(Lt, {
|
|
1747
1891
|
item: e,
|
|
1748
1892
|
variant: t,
|
|
1749
1893
|
showAvatar: n,
|
|
@@ -1754,10 +1898,10 @@ var Ot = ({ item: e, showAvatar: t = !0, variant: n = "timeline", color: r = "va
|
|
|
1754
1898
|
}, e.id || e.time))
|
|
1755
1899
|
});
|
|
1756
1900
|
};
|
|
1757
|
-
|
|
1901
|
+
Rt.displayName = "Feed";
|
|
1758
1902
|
//#endregion
|
|
1759
1903
|
//#region ../core/src/components/Feature/utils.jsx
|
|
1760
|
-
var
|
|
1904
|
+
var zt = ({ align: e, size: t, background: n, reverse: r, vertical: i, clickable: a, disabled: o, className: s }) => [
|
|
1761
1905
|
"wc-feature-card",
|
|
1762
1906
|
a && "wc-feature-card--clickable",
|
|
1763
1907
|
o && "wc-feature-card--disabled",
|
|
@@ -1768,29 +1912,29 @@ var At = ({ align: e, size: t, background: n, reverse: r, vertical: i, clickable
|
|
|
1768
1912
|
`wc-feature-card--${e}`,
|
|
1769
1913
|
s
|
|
1770
1914
|
].filter(Boolean);
|
|
1771
|
-
function
|
|
1915
|
+
function Bt(e) {
|
|
1772
1916
|
return ["wc-feature-icon", `wc-feature-icon--${e}`].filter(Boolean);
|
|
1773
1917
|
}
|
|
1774
|
-
function
|
|
1918
|
+
function Vt(e) {
|
|
1775
1919
|
return ["wc-feature-content", `wc-feature-content--${e}`].filter(Boolean);
|
|
1776
1920
|
}
|
|
1777
|
-
function
|
|
1921
|
+
function Ht(e) {
|
|
1778
1922
|
return ["wc-feature-title", `wc-feature-title--${e}`].filter(Boolean);
|
|
1779
1923
|
}
|
|
1780
|
-
var
|
|
1781
|
-
function
|
|
1924
|
+
var Ut = (e) => ["wc-feature-description", `wc-feature-description--${e}`].filter(Boolean);
|
|
1925
|
+
function Wt(e, t, n) {
|
|
1782
1926
|
!t && n && n(e);
|
|
1783
1927
|
}
|
|
1784
|
-
function
|
|
1928
|
+
function Gt(e, t) {
|
|
1785
1929
|
e.stopPropagation(), t && t(e);
|
|
1786
1930
|
}
|
|
1787
|
-
function
|
|
1931
|
+
function Kt(e) {
|
|
1788
1932
|
return e;
|
|
1789
1933
|
}
|
|
1790
1934
|
//#endregion
|
|
1791
1935
|
//#region src/components/Feature/Feature.jsx
|
|
1792
|
-
var
|
|
1793
|
-
let b =
|
|
1936
|
+
var qt = ({ title: e = "Awesome Feature", description: t = "Feature description goes here.", icon: n = "", iconSize: r = 48, size: i = "md", align: a = "left", background: o = "default", variant: s = "default", bgColor: c = "", reverse: l = !1, vertical: u = !1, ctaLabel: d = "", ctaHref: f = "#", onClick: h, onCtaClick: g, children: _, className: v = "", style: y = {} }) => {
|
|
1937
|
+
let b = zt({
|
|
1794
1938
|
align: a,
|
|
1795
1939
|
size: i,
|
|
1796
1940
|
background: o,
|
|
@@ -1799,7 +1943,7 @@ var Rt = ({ title: e = "Awesome Feature", description: t = "Feature description
|
|
|
1799
1943
|
clickable: !!h,
|
|
1800
1944
|
disabled: !1,
|
|
1801
1945
|
className: v
|
|
1802
|
-
}).join(" "), x =
|
|
1946
|
+
}).join(" "), x = Bt(r).join(" "), S = Vt(a).join(" "), C = Ht(i).join(" "), w = Ut(i).join(" "), T = {
|
|
1803
1947
|
...c ? { background: c } : {},
|
|
1804
1948
|
...y
|
|
1805
1949
|
}, E = typeof r == "number" ? `${r}px` : r, D = h ? {
|
|
@@ -1812,7 +1956,7 @@ var Rt = ({ title: e = "Awesome Feature", description: t = "Feature description
|
|
|
1812
1956
|
return /* @__PURE__ */ m("div", {
|
|
1813
1957
|
className: `${b} ${s === "default" ? "" : `wc-feature-card--${s}`}`,
|
|
1814
1958
|
style: T,
|
|
1815
|
-
onClick: (e) =>
|
|
1959
|
+
onClick: (e) => Wt(e, !1, h),
|
|
1816
1960
|
...D,
|
|
1817
1961
|
children: [n && /* @__PURE__ */ p("div", {
|
|
1818
1962
|
className: x,
|
|
@@ -1823,7 +1967,7 @@ var Rt = ({ title: e = "Awesome Feature", description: t = "Feature description
|
|
|
1823
1967
|
children: typeof n == "string" ? /* @__PURE__ */ p("span", {
|
|
1824
1968
|
className: "wc-feature-icon__inner",
|
|
1825
1969
|
dangerouslySetInnerHTML: { __html: n }
|
|
1826
|
-
}) :
|
|
1970
|
+
}) : Kt(n)
|
|
1827
1971
|
}), /* @__PURE__ */ m("div", {
|
|
1828
1972
|
className: S,
|
|
1829
1973
|
children: [
|
|
@@ -1838,17 +1982,17 @@ var Rt = ({ title: e = "Awesome Feature", description: t = "Feature description
|
|
|
1838
1982
|
d && /* @__PURE__ */ p("a", {
|
|
1839
1983
|
href: f,
|
|
1840
1984
|
className: "wc-feature-cta",
|
|
1841
|
-
onClick: (e) =>
|
|
1985
|
+
onClick: (e) => Gt(e, g),
|
|
1842
1986
|
children: d
|
|
1843
1987
|
})
|
|
1844
1988
|
]
|
|
1845
1989
|
})]
|
|
1846
1990
|
});
|
|
1847
1991
|
};
|
|
1848
|
-
|
|
1992
|
+
qt.displayName = "Feature";
|
|
1849
1993
|
//#endregion
|
|
1850
1994
|
//#region src/components/FileInput/FileInput.jsx
|
|
1851
|
-
var
|
|
1995
|
+
var Jt = ({ className: e = "" }) => /* @__PURE__ */ p("span", {
|
|
1852
1996
|
className: e,
|
|
1853
1997
|
"aria-hidden": "true",
|
|
1854
1998
|
children: /* @__PURE__ */ m("svg", {
|
|
@@ -1858,7 +2002,7 @@ var zt = ({ className: e = "" }) => /* @__PURE__ */ p("span", {
|
|
|
1858
2002
|
strokeWidth: "2",
|
|
1859
2003
|
children: [/* @__PURE__ */ p("path", { d: "M12 16V4m0 0L7 9m5-5 5 5" }), /* @__PURE__ */ p("path", { d: "M5 14v4a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-4" })]
|
|
1860
2004
|
})
|
|
1861
|
-
}),
|
|
2005
|
+
}), Yt = ({ multiple: e = !1, variant: t = "block", accept: n = "", label: r = "选择文件", description: i = "或拖放到这里", disabled: a = !1, onChange: o, onInvalid: s, className: c = "", style: l = {} }) => {
|
|
1862
2006
|
let [u, h] = d(!1), g = (e) => {
|
|
1863
2007
|
if (!n) return !0;
|
|
1864
2008
|
let t = n.split(",").map((e) => e.trim().toLowerCase()), r = [...e].filter((e) => !t.some((t) => t.startsWith(".") ? e.name.toLowerCase().endsWith(t) : t.endsWith("/*") ? e.type.toLowerCase().startsWith(t.slice(0, -1)) : e.type.toLowerCase() === t));
|
|
@@ -1901,7 +2045,7 @@ var zt = ({ className: e = "" }) => /* @__PURE__ */ p("span", {
|
|
|
1901
2045
|
"aria-label": r,
|
|
1902
2046
|
onChange: _
|
|
1903
2047
|
}),
|
|
1904
|
-
t === "block" && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(
|
|
2048
|
+
t === "block" && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(Jt, { className: "wc-file-input__upload-icon" }), /* @__PURE__ */ m("span", {
|
|
1905
2049
|
className: "wc-file-input-content",
|
|
1906
2050
|
children: [/* @__PURE__ */ p("strong", {
|
|
1907
2051
|
className: "wc-file-input-content__title",
|
|
@@ -1919,14 +2063,14 @@ var zt = ({ className: e = "" }) => /* @__PURE__ */ p("span", {
|
|
|
1919
2063
|
children: "+"
|
|
1920
2064
|
}), r]
|
|
1921
2065
|
}),
|
|
1922
|
-
t === "icon" && /* @__PURE__ */ p(
|
|
2066
|
+
t === "icon" && /* @__PURE__ */ p(Jt, { className: "wc-file-icon" })
|
|
1923
2067
|
]
|
|
1924
2068
|
});
|
|
1925
2069
|
};
|
|
1926
|
-
|
|
2070
|
+
Yt.displayName = "FileInput";
|
|
1927
2071
|
//#endregion
|
|
1928
2072
|
//#region src/components/Form/FormControl.jsx
|
|
1929
|
-
var
|
|
2073
|
+
var Xt = n(null), Zt = ({ disabled: e = !1, error: t = !1, required: n = !1, variant: r = "filled", size: i = "md", fullWidth: a = !1, margin: o = "normal", className: s = "", style: c = {}, children: u, ...d }) => {
|
|
1930
2074
|
let f = l(() => ({
|
|
1931
2075
|
disabled: e,
|
|
1932
2076
|
error: t,
|
|
@@ -1948,7 +2092,7 @@ var Vt = n(null), Ht = ({ disabled: e = !1, error: t = !1, required: n = !1, var
|
|
|
1948
2092
|
t && "form-control--error",
|
|
1949
2093
|
s
|
|
1950
2094
|
].filter(Boolean).join(" ");
|
|
1951
|
-
return /* @__PURE__ */ p(
|
|
2095
|
+
return /* @__PURE__ */ p(Xt.Provider, {
|
|
1952
2096
|
value: f,
|
|
1953
2097
|
children: /* @__PURE__ */ p("div", {
|
|
1954
2098
|
className: m,
|
|
@@ -1958,10 +2102,10 @@ var Vt = n(null), Ht = ({ disabled: e = !1, error: t = !1, required: n = !1, var
|
|
|
1958
2102
|
})
|
|
1959
2103
|
});
|
|
1960
2104
|
};
|
|
1961
|
-
|
|
2105
|
+
Zt.displayName = "FormControl";
|
|
1962
2106
|
//#endregion
|
|
1963
2107
|
//#region src/components/Form/FormControlLabel.jsx
|
|
1964
|
-
var
|
|
2108
|
+
var Qt = ({ label: e, labelPlacement: t = "end", disabled: n = !1, required: r = !1, checked: i, value: a, control: o, className: s = "", style: c = {}, onChange: l, children: u, ...d }) => {
|
|
1965
2109
|
let f = (e) => {
|
|
1966
2110
|
n || l?.(e);
|
|
1967
2111
|
}, h = [
|
|
@@ -2000,10 +2144,10 @@ var Ut = ({ label: e, labelPlacement: t = "end", disabled: n = !1, required: r =
|
|
|
2000
2144
|
]
|
|
2001
2145
|
});
|
|
2002
2146
|
};
|
|
2003
|
-
|
|
2147
|
+
Qt.displayName = "FormControlLabel";
|
|
2004
2148
|
//#endregion
|
|
2005
2149
|
//#region src/components/Form/FormGroup.jsx
|
|
2006
|
-
var
|
|
2150
|
+
var $t = ({ row: e = !1, spacing: t = "normal", className: n = "", style: r = {}, children: i, ...a }) => /* @__PURE__ */ p("div", {
|
|
2007
2151
|
className: [
|
|
2008
2152
|
"form-group",
|
|
2009
2153
|
e && "form-group--row",
|
|
@@ -2015,11 +2159,11 @@ var Wt = ({ row: e = !1, spacing: t = "normal", className: n = "", style: r = {}
|
|
|
2015
2159
|
...a,
|
|
2016
2160
|
children: i
|
|
2017
2161
|
});
|
|
2018
|
-
|
|
2162
|
+
$t.displayName = "FormGroup";
|
|
2019
2163
|
//#endregion
|
|
2020
2164
|
//#region src/components/Form/FormHelperText.jsx
|
|
2021
|
-
var
|
|
2022
|
-
let h = a(
|
|
2165
|
+
var en = ({ disabled: e = !1, error: t = !1, filled: n = !1, focused: r = !1, margin: i = "normal", required: o = !1, variant: s = "filled", id: c, size: l = "md", className: u = "", style: d = {}, children: f, ...m }) => {
|
|
2166
|
+
let h = a(Xt) || {}, g = t || h.error, _ = e || h.disabled;
|
|
2023
2167
|
return /* @__PURE__ */ p("p", {
|
|
2024
2168
|
id: c,
|
|
2025
2169
|
className: [
|
|
@@ -2039,55 +2183,55 @@ var Gt = ({ disabled: e = !1, error: t = !1, filled: n = !1, focused: r = !1, ma
|
|
|
2039
2183
|
children: f
|
|
2040
2184
|
});
|
|
2041
2185
|
};
|
|
2042
|
-
|
|
2186
|
+
en.displayName = "FormHelperText";
|
|
2043
2187
|
//#endregion
|
|
2044
2188
|
//#region ../core/src/components/Grid/utils.jsx
|
|
2045
|
-
var
|
|
2189
|
+
var tn = {
|
|
2046
2190
|
xs: "xs",
|
|
2047
2191
|
sm: "sm",
|
|
2048
2192
|
md: "md",
|
|
2049
2193
|
lg: "lg",
|
|
2050
2194
|
xl: "xl"
|
|
2051
|
-
},
|
|
2195
|
+
}, nn = {
|
|
2052
2196
|
row: "wc-grid-container--row",
|
|
2053
2197
|
column: "wc-grid-container--column",
|
|
2054
2198
|
"row-reverse": "wc-grid-container--row-reverse",
|
|
2055
2199
|
"column-reverse": "wc-grid-container--column-reverse"
|
|
2056
|
-
},
|
|
2200
|
+
}, rn = {
|
|
2057
2201
|
"flex-start": "wc-grid-container--justify-start",
|
|
2058
2202
|
center: "wc-grid-container--justify-center",
|
|
2059
2203
|
"flex-end": "wc-grid-container--justify-end",
|
|
2060
2204
|
"space-between": "wc-grid-container--justify-between",
|
|
2061
2205
|
"space-around": "wc-grid-container--justify-around",
|
|
2062
2206
|
"space-evenly": "wc-grid-container--justify-evenly"
|
|
2063
|
-
},
|
|
2207
|
+
}, an = {
|
|
2064
2208
|
"flex-start": "wc-grid-container--align-start",
|
|
2065
2209
|
center: "wc-grid-container--align-center",
|
|
2066
2210
|
"flex-end": "wc-grid-container--align-end",
|
|
2067
2211
|
stretch: "wc-grid-container--align-stretch",
|
|
2068
2212
|
baseline: "wc-grid-container--align-baseline"
|
|
2069
|
-
},
|
|
2213
|
+
}, on = (e) => {
|
|
2070
2214
|
let { direction: t = "row", justifyContent: n = "flex-start", alignItems: r = "stretch", spacing: i = 0 } = e, a = ["wc-grid", "wc-grid-container"];
|
|
2071
|
-
return
|
|
2072
|
-
},
|
|
2215
|
+
return nn[t] && a.push(nn[t]), rn[n] && a.push(rn[n]), an[r] && a.push(an[r]), a.push(...cn(i)), a;
|
|
2216
|
+
}, sn = (e) => {
|
|
2073
2217
|
let { xs: t, sm: n, md: r, lg: i, xl: a } = e, o = ["wc-grid", "wc-grid-item"];
|
|
2074
|
-
return Object.entries(
|
|
2218
|
+
return Object.entries(tn).forEach(([t, n]) => {
|
|
2075
2219
|
let r = e[t];
|
|
2076
|
-
r !== void 0 && o.push(
|
|
2220
|
+
r !== void 0 && o.push(...ln(r, n));
|
|
2077
2221
|
}), o;
|
|
2078
|
-
},
|
|
2222
|
+
}, cn = (e) => {
|
|
2079
2223
|
let t = Number(e);
|
|
2080
2224
|
return [`wc-grid-container--spacing-${Number.isFinite(t) ? Math.max(0, Math.min(12, Math.round(t))) : 0}`];
|
|
2081
|
-
},
|
|
2225
|
+
}, ln = (e, t) => {
|
|
2082
2226
|
if (e === !1 || e == null) return [];
|
|
2083
2227
|
if (e === "auto") return [`wc-grid-item--${t}-auto`];
|
|
2084
2228
|
if (e === !0) return [`wc-grid-item--${t}-true`];
|
|
2085
2229
|
let n = Number(e);
|
|
2086
2230
|
return Number.isFinite(n) && n >= 1 && n <= 12 ? [`wc-grid-item--${t}-${Math.round(n)}`] : [];
|
|
2087
|
-
},
|
|
2231
|
+
}, un = (e) => {
|
|
2088
2232
|
let { container: t = !1, item: n = !1, className: r = "" } = e, i = [];
|
|
2089
|
-
return t && i.push(...
|
|
2090
|
-
},
|
|
2233
|
+
return t && i.push(...on(e)), n && i.push(...sn(e)), r && i.push(r), i;
|
|
2234
|
+
}, dn = (e) => {
|
|
2091
2235
|
let t = { ...e };
|
|
2092
2236
|
return t.spacing !== void 0 && (t.spacing = Number(t.spacing) || 0), [
|
|
2093
2237
|
"xs",
|
|
@@ -2102,8 +2246,8 @@ var Kt = {
|
|
|
2102
2246
|
isNaN(r) || (t[e] = Math.max(1, Math.min(12, r)));
|
|
2103
2247
|
}
|
|
2104
2248
|
}), t;
|
|
2105
|
-
},
|
|
2106
|
-
className:
|
|
2249
|
+
}, fn = ({ container: e = !1, item: t = !1, xs: n, sm: r, md: i, lg: a, xl: o, spacing: s = 0, direction: c = "row", justifyContent: l = "flex-start", alignItems: u = "stretch", className: d = "", style: f = {}, children: m, ...h }) => /* @__PURE__ */ p("div", {
|
|
2250
|
+
className: un(dn({
|
|
2107
2251
|
container: e,
|
|
2108
2252
|
item: t,
|
|
2109
2253
|
xs: n,
|
|
@@ -2121,57 +2265,79 @@ var Kt = {
|
|
|
2121
2265
|
...h,
|
|
2122
2266
|
children: m
|
|
2123
2267
|
});
|
|
2124
|
-
|
|
2268
|
+
fn.displayName = "Grid";
|
|
2125
2269
|
//#endregion
|
|
2126
2270
|
//#region src/components/HoverCard/HoverCard.jsx
|
|
2127
|
-
var
|
|
2128
|
-
let T = s(), [E, D] = d(!1), O = u(null), k = u(null), A = u(null), j = `${T}-trigger`,
|
|
2271
|
+
var pn = ({ triggerText: e = "Hover me", cardData: t = {}, variant: n = "default", size: r = "md", cardSize: i = "md", position: a = "top", delay: c = 300, hideDelay: l = 100, showArrow: h = !1, disabled: g = !1, onShow: _, onHide: v, onAction: y, className: b = "", style: x = {}, children: S, card: C, ...w }) => {
|
|
2272
|
+
let T = s(), [E, D] = d(!1), O = u(null), k = u(null), A = u(null), j = u(null), M = `${T}-trigger`, N = () => {
|
|
2129
2273
|
clearTimeout(O.current), clearTimeout(k.current);
|
|
2130
|
-
},
|
|
2131
|
-
g || (
|
|
2274
|
+
}, P = () => {
|
|
2275
|
+
g || (N(), O.current = setTimeout(() => {
|
|
2132
2276
|
D(!0), _?.();
|
|
2133
2277
|
}, c));
|
|
2134
|
-
},
|
|
2135
|
-
g || (
|
|
2278
|
+
}, F = () => {
|
|
2279
|
+
g || (N(), k.current = setTimeout(() => {
|
|
2136
2280
|
D(!1), v?.();
|
|
2137
2281
|
}, l));
|
|
2138
2282
|
};
|
|
2139
|
-
o(() => () =>
|
|
2140
|
-
let
|
|
2283
|
+
o(() => () => N(), []);
|
|
2284
|
+
let I = (e) => {
|
|
2141
2285
|
y?.(e), e?.onClick?.();
|
|
2142
|
-
},
|
|
2286
|
+
}, L = [
|
|
2143
2287
|
"hover-card-container",
|
|
2144
2288
|
`hover-card-${n}`,
|
|
2145
2289
|
`hover-card-size-${r}`,
|
|
2146
2290
|
g && "hover-card-disabled",
|
|
2147
2291
|
b
|
|
2148
|
-
].filter(Boolean).join(" "),
|
|
2292
|
+
].filter(Boolean).join(" "), R = [
|
|
2149
2293
|
"hover-card-popup",
|
|
2150
2294
|
`hover-card-position-${a}`,
|
|
2151
2295
|
`hover-card-card-size-${i}`
|
|
2152
|
-
].join(" ")
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2296
|
+
].join(" "), z = ce({
|
|
2297
|
+
open: E,
|
|
2298
|
+
anchorRef: j,
|
|
2299
|
+
floatingRef: A,
|
|
2300
|
+
placement: a,
|
|
2301
|
+
offset: 8
|
|
2302
|
+
});
|
|
2303
|
+
return se({
|
|
2304
|
+
open: E,
|
|
2305
|
+
elementRef: A,
|
|
2306
|
+
refs: [j],
|
|
2307
|
+
closeOnEscape: !0,
|
|
2308
|
+
closeOnPointerDownOutside: !0,
|
|
2309
|
+
onEscapeKeyDown: () => {
|
|
2310
|
+
D(!1), v?.(), j.current?.focus();
|
|
2311
|
+
},
|
|
2312
|
+
onPointerDownOutside: () => {
|
|
2313
|
+
D(!1), v?.();
|
|
2314
|
+
},
|
|
2315
|
+
zIndex: 1e3
|
|
2316
|
+
}), /* @__PURE__ */ m("div", {
|
|
2317
|
+
className: L,
|
|
2318
|
+
onMouseEnter: P,
|
|
2319
|
+
onMouseLeave: F,
|
|
2320
|
+
onTouchStart: P,
|
|
2321
|
+
onTouchEnd: F,
|
|
2322
|
+
onFocus: P,
|
|
2323
|
+
onBlur: F,
|
|
2161
2324
|
style: x,
|
|
2162
2325
|
...w,
|
|
2163
2326
|
children: [/* @__PURE__ */ p("span", {
|
|
2164
|
-
|
|
2327
|
+
ref: j,
|
|
2328
|
+
id: M,
|
|
2165
2329
|
className: "hover-card-trigger",
|
|
2166
2330
|
tabIndex: g ? -1 : 0,
|
|
2167
2331
|
"aria-describedby": E ? T : void 0,
|
|
2168
2332
|
children: S || e
|
|
2169
|
-
}), E && /* @__PURE__ */ m("div", {
|
|
2333
|
+
}), E && /* @__PURE__ */ p(oe, { children: /* @__PURE__ */ m("div", {
|
|
2170
2334
|
ref: A,
|
|
2171
2335
|
id: T,
|
|
2172
|
-
className:
|
|
2336
|
+
className: `${R} hover-card-position-${z}`.trim(),
|
|
2173
2337
|
role: "dialog",
|
|
2174
2338
|
"aria-labelledby": t.title ? `${T}-title` : void 0,
|
|
2339
|
+
onMouseEnter: P,
|
|
2340
|
+
onMouseLeave: F,
|
|
2175
2341
|
children: [h && /* @__PURE__ */ p("div", { className: `hover-card-arrow hover-card-arrow-${a}` }), /* @__PURE__ */ p("div", {
|
|
2176
2342
|
className: "hover-card-content",
|
|
2177
2343
|
children: C ? typeof C == "function" ? C(t) : C : /* @__PURE__ */ m(f, { children: [t.image && /* @__PURE__ */ p("div", {
|
|
@@ -2203,20 +2369,20 @@ var rn = ({ triggerText: e = "Hover me", cardData: t = {}, variant: n = "default
|
|
|
2203
2369
|
className: "hover-card-actions",
|
|
2204
2370
|
children: t.actions.map((e, t) => /* @__PURE__ */ p("button", {
|
|
2205
2371
|
className: "hover-card-action-btn",
|
|
2206
|
-
onClick: () =>
|
|
2372
|
+
onClick: () => I(e),
|
|
2207
2373
|
children: e.label
|
|
2208
2374
|
}, t))
|
|
2209
2375
|
})
|
|
2210
2376
|
]
|
|
2211
2377
|
})] })
|
|
2212
2378
|
})]
|
|
2213
|
-
})]
|
|
2379
|
+
}) })]
|
|
2214
2380
|
});
|
|
2215
2381
|
};
|
|
2216
|
-
|
|
2382
|
+
pn.displayName = "HoverCard";
|
|
2217
2383
|
//#endregion
|
|
2218
2384
|
//#region ../../node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js
|
|
2219
|
-
var
|
|
2385
|
+
var mn = /* @__PURE__ */ R(((e) => {
|
|
2220
2386
|
var t = typeof Symbol == "function" && Symbol.for, n = t ? Symbol.for("react.element") : 60103, r = t ? Symbol.for("react.portal") : 60106, i = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, o = t ? Symbol.for("react.profiler") : 60114, s = t ? Symbol.for("react.provider") : 60109, c = t ? Symbol.for("react.context") : 60110, l = t ? Symbol.for("react.async_mode") : 60111, u = t ? Symbol.for("react.concurrent_mode") : 60111, d = t ? Symbol.for("react.forward_ref") : 60112, f = t ? Symbol.for("react.suspense") : 60113, p = t ? Symbol.for("react.suspense_list") : 60120, m = t ? Symbol.for("react.memo") : 60115, h = t ? Symbol.for("react.lazy") : 60116, g = t ? Symbol.for("react.block") : 60121, _ = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, y = t ? Symbol.for("react.scope") : 60119;
|
|
2221
2387
|
function b(e) {
|
|
2222
2388
|
if (typeof e == "object" && e) {
|
|
@@ -2272,7 +2438,7 @@ var an = /* @__PURE__ */ L(((e) => {
|
|
|
2272
2438
|
}, e.isValidElementType = function(e) {
|
|
2273
2439
|
return typeof e == "string" || typeof e == "function" || e === i || e === u || e === o || e === a || e === f || e === p || typeof e == "object" && !!e && (e.$$typeof === h || e.$$typeof === m || e.$$typeof === s || e.$$typeof === c || e.$$typeof === d || e.$$typeof === _ || e.$$typeof === v || e.$$typeof === y || e.$$typeof === g);
|
|
2274
2440
|
}, e.typeOf = b;
|
|
2275
|
-
})),
|
|
2441
|
+
})), hn = /* @__PURE__ */ R(((e) => {
|
|
2276
2442
|
process.env.NODE_ENV !== "production" && (function() {
|
|
2277
2443
|
var t = typeof Symbol == "function" && Symbol.for, n = t ? Symbol.for("react.element") : 60103, r = t ? Symbol.for("react.portal") : 60106, i = t ? Symbol.for("react.fragment") : 60107, a = t ? Symbol.for("react.strict_mode") : 60108, o = t ? Symbol.for("react.profiler") : 60114, s = t ? Symbol.for("react.provider") : 60109, c = t ? Symbol.for("react.context") : 60110, l = t ? Symbol.for("react.async_mode") : 60111, u = t ? Symbol.for("react.concurrent_mode") : 60111, d = t ? Symbol.for("react.forward_ref") : 60112, f = t ? Symbol.for("react.suspense") : 60113, p = t ? Symbol.for("react.suspense_list") : 60120, m = t ? Symbol.for("react.memo") : 60115, h = t ? Symbol.for("react.lazy") : 60116, g = t ? Symbol.for("react.block") : 60121, _ = t ? Symbol.for("react.fundamental") : 60117, v = t ? Symbol.for("react.responder") : 60118, y = t ? Symbol.for("react.scope") : 60119;
|
|
2278
2444
|
function b(e) {
|
|
@@ -2334,23 +2500,23 @@ var an = /* @__PURE__ */ L(((e) => {
|
|
|
2334
2500
|
function W(e) {
|
|
2335
2501
|
return x(e) === m;
|
|
2336
2502
|
}
|
|
2337
|
-
function
|
|
2503
|
+
function ee(e) {
|
|
2338
2504
|
return x(e) === r;
|
|
2339
2505
|
}
|
|
2340
|
-
function
|
|
2506
|
+
function te(e) {
|
|
2341
2507
|
return x(e) === o;
|
|
2342
2508
|
}
|
|
2343
|
-
function
|
|
2509
|
+
function ne(e) {
|
|
2344
2510
|
return x(e) === a;
|
|
2345
2511
|
}
|
|
2346
|
-
function
|
|
2512
|
+
function re(e) {
|
|
2347
2513
|
return x(e) === f;
|
|
2348
2514
|
}
|
|
2349
|
-
e.AsyncMode = S, e.ConcurrentMode = C, e.ContextConsumer = w, e.ContextProvider = T, e.Element = E, e.ForwardRef = D, e.Fragment = O, e.Lazy = k, e.Memo = A, e.Portal = j, e.Profiler = M, e.StrictMode = N, e.Suspense = P, e.isAsyncMode = I, e.isConcurrentMode = L, e.isContextConsumer = R, e.isContextProvider = z, e.isElement = B, e.isForwardRef = V, e.isFragment = H, e.isLazy = U, e.isMemo = W, e.isPortal =
|
|
2515
|
+
e.AsyncMode = S, e.ConcurrentMode = C, e.ContextConsumer = w, e.ContextProvider = T, e.Element = E, e.ForwardRef = D, e.Fragment = O, e.Lazy = k, e.Memo = A, e.Portal = j, e.Profiler = M, e.StrictMode = N, e.Suspense = P, e.isAsyncMode = I, e.isConcurrentMode = L, e.isContextConsumer = R, e.isContextProvider = z, e.isElement = B, e.isForwardRef = V, e.isFragment = H, e.isLazy = U, e.isMemo = W, e.isPortal = ee, e.isProfiler = te, e.isStrictMode = ne, e.isSuspense = re, e.isValidElementType = b, e.typeOf = x;
|
|
2350
2516
|
})();
|
|
2351
|
-
})),
|
|
2352
|
-
process.env.NODE_ENV === "production" ? t.exports =
|
|
2353
|
-
})),
|
|
2517
|
+
})), gn = /* @__PURE__ */ R(((e, t) => {
|
|
2518
|
+
process.env.NODE_ENV === "production" ? t.exports = mn() : t.exports = hn();
|
|
2519
|
+
})), _n = /* @__PURE__ */ R(((e, t) => {
|
|
2354
2520
|
var n = Object.getOwnPropertySymbols, r = Object.prototype.hasOwnProperty, i = Object.prototype.propertyIsEnumerable;
|
|
2355
2521
|
function a(e) {
|
|
2356
2522
|
if (e == null) throw TypeError("Object.assign cannot be called with null or undefined");
|
|
@@ -2383,14 +2549,14 @@ var an = /* @__PURE__ */ L(((e) => {
|
|
|
2383
2549
|
}
|
|
2384
2550
|
return s;
|
|
2385
2551
|
};
|
|
2386
|
-
})),
|
|
2552
|
+
})), vn = /* @__PURE__ */ R(((e, t) => {
|
|
2387
2553
|
t.exports = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
2388
|
-
})),
|
|
2554
|
+
})), yn = /* @__PURE__ */ R(((e, t) => {
|
|
2389
2555
|
t.exports = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
2390
|
-
})),
|
|
2556
|
+
})), bn = /* @__PURE__ */ R(((e, t) => {
|
|
2391
2557
|
var n = function() {};
|
|
2392
2558
|
if (process.env.NODE_ENV !== "production") {
|
|
2393
|
-
var r =
|
|
2559
|
+
var r = vn(), i = {}, a = yn();
|
|
2394
2560
|
n = function(e) {
|
|
2395
2561
|
var t = "Warning: " + e;
|
|
2396
2562
|
typeof console < "u" && console.error(t);
|
|
@@ -2423,8 +2589,8 @@ var an = /* @__PURE__ */ L(((e) => {
|
|
|
2423
2589
|
o.resetWarningCache = function() {
|
|
2424
2590
|
process.env.NODE_ENV !== "production" && (i = {});
|
|
2425
2591
|
}, t.exports = o;
|
|
2426
|
-
})),
|
|
2427
|
-
var n =
|
|
2592
|
+
})), xn = /* @__PURE__ */ R(((e, t) => {
|
|
2593
|
+
var n = gn(), r = _n(), i = vn(), a = yn(), o = bn(), s = function() {};
|
|
2428
2594
|
process.env.NODE_ENV !== "production" && (s = function(e) {
|
|
2429
2595
|
var t = "Warning: " + e;
|
|
2430
2596
|
typeof console < "u" && console.error(t);
|
|
@@ -2682,8 +2848,8 @@ var an = /* @__PURE__ */ L(((e) => {
|
|
|
2682
2848
|
}
|
|
2683
2849
|
return p.checkPropTypes = o, p.resetWarningCache = o.resetWarningCache, p.PropTypes = p, p;
|
|
2684
2850
|
};
|
|
2685
|
-
})),
|
|
2686
|
-
var n =
|
|
2851
|
+
})), Sn = /* @__PURE__ */ R(((e, t) => {
|
|
2852
|
+
var n = vn();
|
|
2687
2853
|
function r() {}
|
|
2688
2854
|
function i() {}
|
|
2689
2855
|
i.resetWarningCache = r, t.exports = function() {
|
|
@@ -2722,42 +2888,42 @@ var an = /* @__PURE__ */ L(((e) => {
|
|
|
2722
2888
|
};
|
|
2723
2889
|
return a.PropTypes = a, a;
|
|
2724
2890
|
};
|
|
2725
|
-
})), $ = /* @__PURE__ */
|
|
2891
|
+
})), $ = /* @__PURE__ */ B((/* @__PURE__ */ R(((e, t) => {
|
|
2726
2892
|
if (process.env.NODE_ENV !== "production") {
|
|
2727
|
-
var n =
|
|
2728
|
-
t.exports =
|
|
2729
|
-
} else t.exports =
|
|
2730
|
-
})))(), 1),
|
|
2893
|
+
var n = gn();
|
|
2894
|
+
t.exports = xn()(n.isElement, !0);
|
|
2895
|
+
} else t.exports = Sn()();
|
|
2896
|
+
})))(), 1), Cn = ({ className: e, style: t }) => /* @__PURE__ */ p("span", {
|
|
2731
2897
|
className: e,
|
|
2732
2898
|
style: t
|
|
2733
|
-
}),
|
|
2899
|
+
}), wn = {
|
|
2734
2900
|
lucide: () => import("@zeturn/watercolor-icons-lucide-react"),
|
|
2735
2901
|
heroicons: () => import("@zeturn/watercolor-icons-heroicons-react"),
|
|
2736
2902
|
tabler: () => import("@zeturn/watercolor-icons-tabler-react"),
|
|
2737
2903
|
phosphor: () => import("@zeturn/watercolor-icons-phosphor-react"),
|
|
2738
2904
|
feather: () => import("@zeturn/watercolor-icons-feather")
|
|
2739
|
-
},
|
|
2740
|
-
let t =
|
|
2905
|
+
}, Tn = (e) => {
|
|
2906
|
+
let t = wn[e];
|
|
2741
2907
|
return t ? t() : Promise.resolve(null);
|
|
2742
|
-
},
|
|
2908
|
+
}, En = (e, t) => r(() => e().then((e) => ({ default: t(e || {}) })).catch((e) => (console.warn("[Icon] 动态导入失败,已回退到占位符图标。", e), { default: Cn }))), Dn = (e, t, n) => {
|
|
2743
2909
|
switch (e) {
|
|
2744
|
-
case "lucide": return
|
|
2745
|
-
case "heroicons": return
|
|
2746
|
-
case "tabler": return
|
|
2747
|
-
case "phosphor": return
|
|
2910
|
+
case "lucide": return En(() => Tn("lucide"), (e) => e.getIcon?.(t) || Cn);
|
|
2911
|
+
case "heroicons": return En(() => Tn("heroicons"), (e) => e.getIcon?.(t, n) || Cn);
|
|
2912
|
+
case "tabler": return En(() => Tn("tabler"), (e) => e.getIcon?.(t) || Cn);
|
|
2913
|
+
case "phosphor": return En(() => Tn("phosphor"), (e) => e.getIcon?.(t) || Cn);
|
|
2748
2914
|
default: return null;
|
|
2749
2915
|
}
|
|
2750
|
-
},
|
|
2916
|
+
}, On = (e) => typeof e == "number" ? e : {
|
|
2751
2917
|
xs: 16,
|
|
2752
2918
|
sm: 20,
|
|
2753
2919
|
md: 24,
|
|
2754
2920
|
lg: 32,
|
|
2755
2921
|
xl: 48
|
|
2756
|
-
}[e] || parseInt(e) || 24,
|
|
2922
|
+
}[e] || parseInt(e) || 24, kn = ({ library: e = "lucide", name: n = "", html: i = "", size: a = 24, color: o = "currentColor", strokeWidth: s = 2, variant: c = "outline", className: u = "", children: d, ...f }) => {
|
|
2757
2923
|
let m = l(() => {
|
|
2758
2924
|
if (!n) return null;
|
|
2759
2925
|
try {
|
|
2760
|
-
return
|
|
2926
|
+
return Dn(e, n, c);
|
|
2761
2927
|
} catch {
|
|
2762
2928
|
return console.warn(`Icon "${n}" not found in library "${e}"`), null;
|
|
2763
2929
|
}
|
|
@@ -2767,7 +2933,7 @@ var an = /* @__PURE__ */ L(((e) => {
|
|
|
2767
2933
|
c
|
|
2768
2934
|
]), h = l(() => e === "feather" && n ? r(async () => {
|
|
2769
2935
|
try {
|
|
2770
|
-
let e =
|
|
2936
|
+
let e = On(a), { getFeatherSvg: t } = await Tn("feather") || {}, r = await t(n, {
|
|
2771
2937
|
width: e,
|
|
2772
2938
|
height: e,
|
|
2773
2939
|
strokeWidth: Number(s)
|
|
@@ -2788,13 +2954,13 @@ var an = /* @__PURE__ */ L(((e) => {
|
|
|
2788
2954
|
]), g = l(() => e === "html" && i ? i : "", [e, i]), _ = l(() => {
|
|
2789
2955
|
let e = {};
|
|
2790
2956
|
if (o && o !== "currentColor" && (e.color = o), a) {
|
|
2791
|
-
let t =
|
|
2957
|
+
let t = On(a);
|
|
2792
2958
|
e.width = `${t}px`, e.height = `${t}px`;
|
|
2793
2959
|
}
|
|
2794
2960
|
return e;
|
|
2795
2961
|
}, [o, a]), v = l(() => {
|
|
2796
2962
|
let t = {
|
|
2797
|
-
size:
|
|
2963
|
+
size: On(a),
|
|
2798
2964
|
color: o,
|
|
2799
2965
|
...f
|
|
2800
2966
|
};
|
|
@@ -2835,7 +3001,7 @@ var an = /* @__PURE__ */ L(((e) => {
|
|
|
2835
3001
|
children: d
|
|
2836
3002
|
});
|
|
2837
3003
|
};
|
|
2838
|
-
|
|
3004
|
+
kn.propTypes = {
|
|
2839
3005
|
library: $.default.oneOf([
|
|
2840
3006
|
"lucide",
|
|
2841
3007
|
"heroicons",
|
|
@@ -2859,7 +3025,7 @@ bn.propTypes = {
|
|
|
2859
3025
|
};
|
|
2860
3026
|
//#endregion
|
|
2861
3027
|
//#region src/components/Button/IconButton.jsx
|
|
2862
|
-
var
|
|
3028
|
+
var An = ({ color: e = "default", size: t = "md", edge: n = !1, disabled: r = !1, icon: i = "", children: a, onClick: o, onFocus: s, onBlur: c, className: l = "", style: u = {}, ...d }) => {
|
|
2863
3029
|
let f = [
|
|
2864
3030
|
"default",
|
|
2865
3031
|
"primary",
|
|
@@ -2901,16 +3067,16 @@ var xn = ({ color: e = "default", size: t = "md", edge: n = !1, disabled: r = !1
|
|
|
2901
3067
|
})
|
|
2902
3068
|
});
|
|
2903
3069
|
};
|
|
2904
|
-
|
|
3070
|
+
An.displayName = "IconButton";
|
|
2905
3071
|
//#endregion
|
|
2906
3072
|
//#region src/components/ImageGallery/ImageGallery.jsx
|
|
2907
|
-
var
|
|
2908
|
-
let [w, T] = d(-1), [E, D] = d(1), O = u ? Math.ceil(e.length / f) : 1,
|
|
3073
|
+
var jn = ({ images: e = [], title: t = "", layout: n = "grid", size: r = "md", columns: i = 3, gap: a = 16, showInfo: s = !0, showCount: c = !0, showDownload: l = !1, showPagination: u = !1, itemsPerPage: f = 12, lazyLoad: h = !0, loading: g = !1, className: _ = "", style: v = {}, onSelect: y, onDownload: b, onLightboxOpen: x, onLightboxClose: S, ...C }) => {
|
|
3074
|
+
let [w, T] = d(-1), [E, D] = d(1), { messages: O } = q(), k = u ? Math.ceil(e.length / f) : 1, A = {
|
|
2909
3075
|
sm: "75%",
|
|
2910
3076
|
md: "66.67%",
|
|
2911
3077
|
lg: "56.25%",
|
|
2912
3078
|
xl: "50%"
|
|
2913
|
-
},
|
|
3079
|
+
}, j = u ? e.slice((E - 1) * f, E * f) : e, M = (t) => {
|
|
2914
3080
|
let n = u ? (E - 1) * f + t : t;
|
|
2915
3081
|
T(n);
|
|
2916
3082
|
let r = e[n];
|
|
@@ -2921,16 +3087,16 @@ var Sn = ({ images: e = [], title: t = "", layout: n = "grid", size: r = "md", c
|
|
|
2921
3087
|
index: n,
|
|
2922
3088
|
image: r
|
|
2923
3089
|
});
|
|
2924
|
-
},
|
|
3090
|
+
}, N = (e) => {
|
|
2925
3091
|
b?.(e);
|
|
2926
3092
|
let t = document.createElement("a");
|
|
2927
3093
|
t.href = e.src, t.download = e.title || "image", document.body.appendChild(t), t.click(), document.body.removeChild(t);
|
|
2928
|
-
},
|
|
3094
|
+
}, P = () => {
|
|
2929
3095
|
T(-1), S?.();
|
|
2930
|
-
},
|
|
3096
|
+
}, F = () => T((e) => e > 0 ? e - 1 : e), I = () => T((t) => t < e.length - 1 ? t + 1 : t);
|
|
2931
3097
|
return o(() => {
|
|
2932
3098
|
let e = (e) => {
|
|
2933
|
-
e.key === "Escape" &&
|
|
3099
|
+
e.key === "Escape" && P(), w !== -1 && (e.key === "ArrowLeft" && F(), e.key === "ArrowRight" && I());
|
|
2934
3100
|
};
|
|
2935
3101
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
2936
3102
|
}, [w]), /* @__PURE__ */ m("div", {
|
|
@@ -2963,15 +3129,12 @@ var Sn = ({ images: e = [], title: t = "", layout: n = "grid", size: r = "md", c
|
|
|
2963
3129
|
columnCount: i,
|
|
2964
3130
|
columnGap: a
|
|
2965
3131
|
} : { gap: a },
|
|
2966
|
-
children:
|
|
3132
|
+
children: j.map((e, t) => /* @__PURE__ */ m("div", {
|
|
2967
3133
|
className: "gallery-item",
|
|
2968
|
-
onClick: () =>
|
|
2969
|
-
tabIndex: 0,
|
|
2970
|
-
role: "button",
|
|
2971
|
-
"aria-label": `查看图片 ${t + 1}`,
|
|
3134
|
+
onClick: () => M(t),
|
|
2972
3135
|
children: [/* @__PURE__ */ m("div", {
|
|
2973
3136
|
className: "gallery-image-container",
|
|
2974
|
-
style: { paddingBottom:
|
|
3137
|
+
style: { paddingBottom: A[r] },
|
|
2975
3138
|
children: [/* @__PURE__ */ p("img", {
|
|
2976
3139
|
src: e.thumbnail || e.src,
|
|
2977
3140
|
alt: e.alt || e.title,
|
|
@@ -2983,16 +3146,16 @@ var Sn = ({ images: e = [], title: t = "", layout: n = "grid", size: r = "md", c
|
|
|
2983
3146
|
className: "gallery-overlay-content",
|
|
2984
3147
|
children: [/* @__PURE__ */ p("button", {
|
|
2985
3148
|
className: "gallery-action-btn gallery-view-btn",
|
|
2986
|
-
"aria-label":
|
|
3149
|
+
"aria-label": O.openImageInLightbox(t + 1),
|
|
2987
3150
|
onClick: (e) => {
|
|
2988
|
-
e.stopPropagation(),
|
|
3151
|
+
e.stopPropagation(), M(t);
|
|
2989
3152
|
},
|
|
2990
3153
|
children: "👁️"
|
|
2991
3154
|
}), l && /* @__PURE__ */ p("button", {
|
|
2992
3155
|
className: "gallery-action-btn gallery-download-btn",
|
|
2993
|
-
"aria-label":
|
|
3156
|
+
"aria-label": O.downloadImage(t + 1),
|
|
2994
3157
|
onClick: (t) => {
|
|
2995
|
-
t.stopPropagation(),
|
|
3158
|
+
t.stopPropagation(), N(e);
|
|
2996
3159
|
},
|
|
2997
3160
|
children: "📥"
|
|
2998
3161
|
})]
|
|
@@ -3010,12 +3173,13 @@ var Sn = ({ images: e = [], title: t = "", layout: n = "grid", size: r = "md", c
|
|
|
3010
3173
|
})]
|
|
3011
3174
|
}, e.id || t))
|
|
3012
3175
|
}),
|
|
3013
|
-
u &&
|
|
3176
|
+
u && k > 1 && /* @__PURE__ */ m("div", {
|
|
3014
3177
|
className: "gallery-pagination",
|
|
3015
3178
|
children: [
|
|
3016
3179
|
/* @__PURE__ */ p("button", {
|
|
3017
3180
|
className: "gallery-page-btn",
|
|
3018
3181
|
disabled: E === 1,
|
|
3182
|
+
"aria-label": O.previousPage,
|
|
3019
3183
|
onClick: () => D((e) => e - 1),
|
|
3020
3184
|
children: "上一页"
|
|
3021
3185
|
}),
|
|
@@ -3025,13 +3189,14 @@ var Sn = ({ images: e = [], title: t = "", layout: n = "grid", size: r = "md", c
|
|
|
3025
3189
|
"第 ",
|
|
3026
3190
|
E,
|
|
3027
3191
|
" 页,共 ",
|
|
3028
|
-
|
|
3192
|
+
k,
|
|
3029
3193
|
" 页"
|
|
3030
3194
|
]
|
|
3031
3195
|
}),
|
|
3032
3196
|
/* @__PURE__ */ p("button", {
|
|
3033
3197
|
className: "gallery-page-btn",
|
|
3034
|
-
disabled: E ===
|
|
3198
|
+
disabled: E === k,
|
|
3199
|
+
"aria-label": O.nextPage,
|
|
3035
3200
|
onClick: () => D((e) => e + 1),
|
|
3036
3201
|
children: "下一页"
|
|
3037
3202
|
})
|
|
@@ -3039,7 +3204,7 @@ var Sn = ({ images: e = [], title: t = "", layout: n = "grid", size: r = "md", c
|
|
|
3039
3204
|
}),
|
|
3040
3205
|
w !== -1 && /* @__PURE__ */ p("div", {
|
|
3041
3206
|
className: "gallery-lightbox",
|
|
3042
|
-
onClick:
|
|
3207
|
+
onClick: P,
|
|
3043
3208
|
role: "dialog",
|
|
3044
3209
|
"aria-modal": "true",
|
|
3045
3210
|
"aria-labelledby": "lightbox-title",
|
|
@@ -3049,7 +3214,8 @@ var Sn = ({ images: e = [], title: t = "", layout: n = "grid", size: r = "md", c
|
|
|
3049
3214
|
children: [
|
|
3050
3215
|
/* @__PURE__ */ p("button", {
|
|
3051
3216
|
className: "gallery-lightbox-close",
|
|
3052
|
-
|
|
3217
|
+
"aria-label": O.closeLightbox,
|
|
3218
|
+
onClick: P,
|
|
3053
3219
|
children: "✕"
|
|
3054
3220
|
}),
|
|
3055
3221
|
/* @__PURE__ */ p("div", {
|
|
@@ -3077,8 +3243,8 @@ var Sn = ({ images: e = [], title: t = "", layout: n = "grid", size: r = "md", c
|
|
|
3077
3243
|
/* @__PURE__ */ p("button", {
|
|
3078
3244
|
className: "gallery-lightbox-nav gallery-lightbox-prev",
|
|
3079
3245
|
disabled: w === 0,
|
|
3080
|
-
"aria-label":
|
|
3081
|
-
onClick:
|
|
3246
|
+
"aria-label": O.previousImage,
|
|
3247
|
+
onClick: F,
|
|
3082
3248
|
children: "‹"
|
|
3083
3249
|
}),
|
|
3084
3250
|
/* @__PURE__ */ m("span", {
|
|
@@ -3092,15 +3258,15 @@ var Sn = ({ images: e = [], title: t = "", layout: n = "grid", size: r = "md", c
|
|
|
3092
3258
|
/* @__PURE__ */ p("button", {
|
|
3093
3259
|
className: "gallery-lightbox-nav gallery-lightbox-next",
|
|
3094
3260
|
disabled: w === e.length - 1,
|
|
3095
|
-
"aria-label":
|
|
3096
|
-
onClick:
|
|
3261
|
+
"aria-label": O.nextImage,
|
|
3262
|
+
onClick: I,
|
|
3097
3263
|
children: "›"
|
|
3098
3264
|
})
|
|
3099
3265
|
]
|
|
3100
3266
|
}),
|
|
3101
3267
|
l && /* @__PURE__ */ p("button", {
|
|
3102
3268
|
className: "gallery-action-btn gallery-download-btn",
|
|
3103
|
-
onClick: () =>
|
|
3269
|
+
onClick: () => N(e[w]),
|
|
3104
3270
|
children: "下载"
|
|
3105
3271
|
})
|
|
3106
3272
|
]
|
|
@@ -3109,10 +3275,10 @@ var Sn = ({ images: e = [], title: t = "", layout: n = "grid", size: r = "md", c
|
|
|
3109
3275
|
]
|
|
3110
3276
|
});
|
|
3111
3277
|
};
|
|
3112
|
-
|
|
3278
|
+
jn.displayName = "ImageGallery";
|
|
3113
3279
|
//#endregion
|
|
3114
3280
|
//#region src/composition.ts
|
|
3115
|
-
var
|
|
3281
|
+
var Mn = [
|
|
3116
3282
|
"none",
|
|
3117
3283
|
"2xs",
|
|
3118
3284
|
"xs",
|
|
@@ -3122,40 +3288,40 @@ var Cn = [
|
|
|
3122
3288
|
"xl",
|
|
3123
3289
|
"2xl",
|
|
3124
3290
|
"3xl"
|
|
3125
|
-
],
|
|
3291
|
+
], Nn = [
|
|
3126
3292
|
"stretch",
|
|
3127
3293
|
"start",
|
|
3128
3294
|
"center",
|
|
3129
3295
|
"end"
|
|
3130
|
-
],
|
|
3296
|
+
], Pn = [
|
|
3131
3297
|
"sm",
|
|
3132
3298
|
"md",
|
|
3133
3299
|
"lg",
|
|
3134
3300
|
"xl",
|
|
3135
3301
|
"full"
|
|
3136
|
-
],
|
|
3302
|
+
], Fn = [
|
|
3137
3303
|
"none",
|
|
3138
3304
|
"sm",
|
|
3139
3305
|
"md",
|
|
3140
3306
|
"lg"
|
|
3141
|
-
],
|
|
3307
|
+
], In = [
|
|
3142
3308
|
"start",
|
|
3143
3309
|
"center",
|
|
3144
3310
|
"end",
|
|
3145
3311
|
"between",
|
|
3146
3312
|
"around"
|
|
3147
|
-
],
|
|
3313
|
+
], Ln = [
|
|
3148
3314
|
"equal",
|
|
3149
3315
|
"sidebar",
|
|
3150
3316
|
"sidebar-end",
|
|
3151
3317
|
"wide-start",
|
|
3152
3318
|
"wide-end"
|
|
3153
|
-
],
|
|
3319
|
+
], Rn = [
|
|
3154
3320
|
"none",
|
|
3155
3321
|
"sm",
|
|
3156
3322
|
"md",
|
|
3157
3323
|
"lg"
|
|
3158
|
-
],
|
|
3324
|
+
], zn = ({ as: e = "div", gap: t = "md", align: n = "center", justify: r = "start", wrap: i = !0, className: a = "", children: o, ...s }) => /* @__PURE__ */ p(e, {
|
|
3159
3325
|
className: ["wc-inline", a].filter(Boolean).join(" "),
|
|
3160
3326
|
"data-gap": t,
|
|
3161
3327
|
"data-align": n,
|
|
@@ -3164,18 +3330,18 @@ var Cn = [
|
|
|
3164
3330
|
...s,
|
|
3165
3331
|
children: o
|
|
3166
3332
|
});
|
|
3167
|
-
|
|
3333
|
+
zn.displayName = "Inline", zn.propTypes = {
|
|
3168
3334
|
as: $.default.elementType,
|
|
3169
|
-
gap: $.default.oneOf(
|
|
3170
|
-
align: $.default.oneOf(
|
|
3171
|
-
justify: $.default.oneOf(
|
|
3335
|
+
gap: $.default.oneOf(Mn),
|
|
3336
|
+
align: $.default.oneOf(Nn),
|
|
3337
|
+
justify: $.default.oneOf(In),
|
|
3172
3338
|
wrap: $.default.bool,
|
|
3173
3339
|
className: $.default.string,
|
|
3174
3340
|
children: $.default.node
|
|
3175
3341
|
};
|
|
3176
3342
|
//#endregion
|
|
3177
3343
|
//#region src/components/Input/Input.jsx
|
|
3178
|
-
var
|
|
3344
|
+
var Bn = ({ value: e = "", onChange: t, type: n = "text", placeholder: r = "", disabled: i = !1, readonly: a = !1, required: c = !1, autoFocus: l = !1, maxLength: f, minLength: h, size: g = "md", variant: _ = "filled", color: v = "primary", error: y = !1, helperText: b = "", label: x = "", startAdornment: S = null, endAdornment: C = null, fullWidth: w = !1, multiline: T = !1, rows: E = 4, autoComplete: D = "off", name: O = "", id: k = "", className: A = "", style: j = {}, onFocus: M, onBlur: N, onKeyDown: P, onKeyUp: F, onKeyPress: I, ...L }) => {
|
|
3179
3345
|
let [R, z] = d(!1), [B, V] = d(!!e), H = u(null), U = s(), W = k || U;
|
|
3180
3346
|
return o(() => {
|
|
3181
3347
|
V(!!e);
|
|
@@ -3246,28 +3412,28 @@ var jn = ({ value: e = "", onChange: t, type: n = "text", placeholder: r = "", d
|
|
|
3246
3412
|
]
|
|
3247
3413
|
});
|
|
3248
3414
|
};
|
|
3249
|
-
|
|
3415
|
+
Bn.displayName = "Input";
|
|
3250
3416
|
//#endregion
|
|
3251
3417
|
//#region ../core/src/components/List/utils.jsx
|
|
3252
|
-
var
|
|
3418
|
+
var Vn = (e) => {
|
|
3253
3419
|
let { dense: t = !1, disablePadding: n = !1, variant: r, className: i = "" } = e, a = ["list"];
|
|
3254
3420
|
return t && a.push("list--dense"), n && a.push("list--no-padding"), r && a.push(`list--${r}`), i && a.push(i), a;
|
|
3255
|
-
},
|
|
3421
|
+
}, Hn = (e) => {
|
|
3256
3422
|
let { button: t = !1, disabled: n = !1, divider: r = !1, dense: i = !1, selected: a = !1, disableGutters: o = !1, draggable: s = !1, multiselect: c = !1, className: l = "" } = e, u = ["list-item"];
|
|
3257
3423
|
return t && u.push("list-item--button"), n && u.push("list-item--disabled"), r && u.push("list-item--divider"), i && u.push("list-item--dense"), a && u.push("list-item--selected"), o && u.push("list-item--no-gutters"), s && u.push("list-item--draggable"), c && u.push("list-item--multiselect"), l && u.push(l), u;
|
|
3258
|
-
},
|
|
3424
|
+
}, Un = (e) => {
|
|
3259
3425
|
let { position: t = "start", className: n = "" } = e, r = ["list-item-icon"];
|
|
3260
3426
|
return t && r.push(`list-item-icon--${t}`), n && r.push(n), r;
|
|
3261
|
-
},
|
|
3427
|
+
}, Wn = (e) => {
|
|
3262
3428
|
let { inset: t = !1, className: n = "" } = e, r = ["list-item-text"];
|
|
3263
3429
|
return t && r.push("list-item-text--inset"), n && r.push(n), r;
|
|
3264
|
-
},
|
|
3265
|
-
let s =
|
|
3430
|
+
}, Gn = n({ dense: !1 }), Kn = ({ children: e, dense: t = !1, disablePadding: n = !1, nav: r = !1, subheader: i = "", className: a = "", ...o }) => {
|
|
3431
|
+
let s = Vn({
|
|
3266
3432
|
dense: t,
|
|
3267
3433
|
disablePadding: n,
|
|
3268
3434
|
className: a
|
|
3269
3435
|
}).concat(r ? "list--nav" : []).join(" ");
|
|
3270
|
-
return /* @__PURE__ */ p(
|
|
3436
|
+
return /* @__PURE__ */ p(Gn.Provider, {
|
|
3271
3437
|
value: { dense: t },
|
|
3272
3438
|
children: /* @__PURE__ */ m("div", {
|
|
3273
3439
|
role: r ? "navigation" : "list",
|
|
@@ -3279,8 +3445,8 @@ var Mn = (e) => {
|
|
|
3279
3445
|
}), e]
|
|
3280
3446
|
})
|
|
3281
3447
|
});
|
|
3282
|
-
},
|
|
3283
|
-
let { dense: d } = a(
|
|
3448
|
+
}, qn = ({ children: e, button: t = !1, disabled: n = !1, divider: r = !1, selected: i = !1, disableGutters: o = !1, multiselect: s = !1, component: c, className: l = "", ...u }) => {
|
|
3449
|
+
let { dense: d } = a(Gn) || { dense: !1 }, f = Hn({
|
|
3284
3450
|
button: t,
|
|
3285
3451
|
disabled: n,
|
|
3286
3452
|
divider: r,
|
|
@@ -3297,15 +3463,15 @@ var Mn = (e) => {
|
|
|
3297
3463
|
...u,
|
|
3298
3464
|
children: e
|
|
3299
3465
|
});
|
|
3300
|
-
},
|
|
3301
|
-
className:
|
|
3466
|
+
}, Jn = ({ children: e, position: t = "start", className: n = "", ...r }) => /* @__PURE__ */ p("span", {
|
|
3467
|
+
className: Un({
|
|
3302
3468
|
position: t,
|
|
3303
3469
|
className: n
|
|
3304
3470
|
}).join(" "),
|
|
3305
3471
|
...r,
|
|
3306
3472
|
children: e
|
|
3307
|
-
}),
|
|
3308
|
-
className:
|
|
3473
|
+
}), Yn = ({ primary: e = "", secondary: t = "", inset: n = !1, className: r = "", ...i }) => /* @__PURE__ */ m("div", {
|
|
3474
|
+
className: Wn({
|
|
3309
3475
|
inset: n,
|
|
3310
3476
|
className: r
|
|
3311
3477
|
}).join(" "),
|
|
@@ -3317,64 +3483,155 @@ var Mn = (e) => {
|
|
|
3317
3483
|
className: "list-item-text-secondary",
|
|
3318
3484
|
children: t
|
|
3319
3485
|
})]
|
|
3320
|
-
}),
|
|
3486
|
+
}), Xn = ({ size: e, variant: t, disabled: n, className: r }) => {
|
|
3321
3487
|
let i = [
|
|
3322
3488
|
"wc-menu",
|
|
3323
3489
|
`wc-menu--${e}`,
|
|
3324
3490
|
`wc-menu--${t}`
|
|
3325
3491
|
];
|
|
3326
3492
|
return n && i.push("wc-menu--disabled"), r && i.push(r), i;
|
|
3327
|
-
},
|
|
3493
|
+
}, Zn = (e, t) => [
|
|
3328
3494
|
"wc-menu__menu",
|
|
3329
3495
|
`wc-menu__menu--${e}`,
|
|
3330
3496
|
t
|
|
3331
|
-
],
|
|
3497
|
+
], Qn = ({ disabled: e }) => ["wc-menu__button", e ? "wc-menu__button--disabled" : ""], $n = (e) => {
|
|
3332
3498
|
let t = ["wc-menu__item"];
|
|
3333
3499
|
return e.divider && t.push("wc-menu__divider"), e.disabled && t.push("wc-menu__item--disabled"), e.selected && t.push("wc-menu__item--selected"), e.danger && t.push("wc-menu__item--danger"), t;
|
|
3334
|
-
},
|
|
3500
|
+
}, er = (e) => ["wc-menu__arrow", e ? "wc-menu__arrow--open" : ""], tr = (e, t, n, r, i) => {
|
|
3335
3501
|
t || (n(!e), e ? i && i() : r && r());
|
|
3336
|
-
},
|
|
3502
|
+
}, nr = (e, t, n, r, i) => {
|
|
3337
3503
|
e.disabled || e.divider || (n && n(e, t), r(!1), i && i());
|
|
3338
|
-
},
|
|
3339
|
-
let
|
|
3340
|
-
e(t);
|
|
3341
|
-
};
|
|
3342
|
-
return {
|
|
3343
|
-
add: () => document.addEventListener("click", t),
|
|
3344
|
-
remove: () => document.removeEventListener("click", t)
|
|
3345
|
-
};
|
|
3346
|
-
}, Yn = ({ items: e = [], triggerText: t = "选择选项", placement: n = "bottom-start", size: r = "md", variant: i = "default", disabled: a = !1, trigger: s = "click", illustration: c = "", illustrationAlt: l = "示意图", cardTitle: f = "", cardDescription: h = "", onSelect: g, onOpen: _, onClose: v, children: y, triggerContent: b, menuContent: x, className: S = "", ...C }) => {
|
|
3347
|
-
let [w, T] = d(!1), E = u(null), D = u(null), O = Vn({
|
|
3504
|
+
}, rr = (e) => e.startsWith("top") ? "top" : "bottom", ir = ({ items: e = [], triggerText: t = "选择选项", placement: n = "bottom-start", size: r = "md", variant: i = "default", disabled: a = !1, trigger: c = "click", illustration: l = "", illustrationAlt: f = "示意图", cardTitle: h = "", cardDescription: g = "", onSelect: _, onOpen: v, onClose: y, children: b, triggerContent: x, menuContent: S, className: C = "", ...w }) => {
|
|
3505
|
+
let [T, E] = d(!1), D = s(), O = u(null), k = u(null), A = u(null), j = Xn({
|
|
3348
3506
|
size: r,
|
|
3349
3507
|
variant: i,
|
|
3350
3508
|
disabled: a,
|
|
3351
|
-
className:
|
|
3352
|
-
}).join(" "),
|
|
3509
|
+
className: C
|
|
3510
|
+
}).join(" "), M = Zn(n, i === "card" ? "wc-menu__menu--card" : "").join(" "), N = Qn({ disabled: a }).join(" "), P = er(T).join(" "), F = i === "card" ? {
|
|
3353
3511
|
minWidth: "320px",
|
|
3354
3512
|
maxWidth: "450px"
|
|
3355
|
-
} : { minWidth: "120px" },
|
|
3356
|
-
|
|
3357
|
-
},
|
|
3358
|
-
|
|
3359
|
-
},
|
|
3360
|
-
|
|
3513
|
+
} : { minWidth: "120px" }, I = () => {
|
|
3514
|
+
tr(T, a, E, v, y);
|
|
3515
|
+
}, L = (e, t) => {
|
|
3516
|
+
nr(e, t, _, E, y);
|
|
3517
|
+
}, R = () => {
|
|
3518
|
+
T && (E(!1), y?.());
|
|
3519
|
+
}, z = (e = "first") => {
|
|
3520
|
+
let t = Array.from(k.current?.querySelectorAll("[role=\"menuitem\"]:not(:disabled)") || []);
|
|
3521
|
+
if (!t.length) return;
|
|
3522
|
+
let n = t.indexOf(document.activeElement), r = e === "last" ? t.length - 1 : 0;
|
|
3523
|
+
e === "next" && (r = n < 0 ? 0 : (n + 1) % t.length), e === "previous" && (r = n <= 0 ? t.length - 1 : n - 1), t[r]?.focus();
|
|
3524
|
+
};
|
|
3525
|
+
o(() => {
|
|
3526
|
+
T && queueMicrotask(() => z("first"));
|
|
3527
|
+
}, [T]);
|
|
3528
|
+
let B = ce({
|
|
3529
|
+
open: T,
|
|
3530
|
+
anchorRef: A,
|
|
3531
|
+
floatingRef: k,
|
|
3532
|
+
placement: rr(n),
|
|
3533
|
+
offset: 6
|
|
3361
3534
|
});
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3535
|
+
se({
|
|
3536
|
+
open: T,
|
|
3537
|
+
elementRef: k,
|
|
3538
|
+
refs: [A],
|
|
3539
|
+
closeOnEscape: !0,
|
|
3540
|
+
closeOnPointerDownOutside: !0,
|
|
3541
|
+
onEscapeKeyDown: () => {
|
|
3542
|
+
R(), A.current?.focus();
|
|
3543
|
+
},
|
|
3544
|
+
onPointerDownOutside: R,
|
|
3545
|
+
zIndex: 1e3
|
|
3546
|
+
});
|
|
3547
|
+
let V = (e) => {
|
|
3548
|
+
a || (e.key === "ArrowDown" || e.key === "Enter" || e.key === " " ? (e.preventDefault(), T ? z("next") : (E(!0), v?.())) : e.key === "ArrowUp" && (e.preventDefault(), T ? z("previous") : (E(!0), v?.(), queueMicrotask(() => z("last")))));
|
|
3549
|
+
}, H = T ? /* @__PURE__ */ p(oe, { children: /* @__PURE__ */ p("div", {
|
|
3550
|
+
ref: k,
|
|
3551
|
+
className: `${M} wc-menu__menu--resolved-${B}`.trim(),
|
|
3552
|
+
id: D,
|
|
3553
|
+
style: F,
|
|
3554
|
+
role: "menu",
|
|
3555
|
+
onKeyDown: (e) => {
|
|
3556
|
+
e.key === "ArrowDown" ? (e.preventDefault(), z("next")) : e.key === "ArrowUp" ? (e.preventDefault(), z("previous")) : e.key === "Home" ? (e.preventDefault(), z("first")) : e.key === "End" ? (e.preventDefault(), z("last")) : e.key === "Tab" && R();
|
|
3557
|
+
},
|
|
3558
|
+
children: S || (i === "card" ? /* @__PURE__ */ m("div", {
|
|
3559
|
+
className: "wc-menu__card",
|
|
3560
|
+
children: [/* @__PURE__ */ m("div", {
|
|
3561
|
+
className: "wc-menu__card-illustration",
|
|
3562
|
+
children: [l ? /* @__PURE__ */ p("img", {
|
|
3563
|
+
src: l,
|
|
3564
|
+
alt: f,
|
|
3565
|
+
className: "wc-menu__illustration-image"
|
|
3566
|
+
}) : /* @__PURE__ */ p("div", {
|
|
3567
|
+
className: "wc-menu__illustration-placeholder",
|
|
3568
|
+
children: /* @__PURE__ */ p("span", { children: "🎨" })
|
|
3569
|
+
}), (h || g) && /* @__PURE__ */ m("div", {
|
|
3570
|
+
className: "wc-menu__card-info",
|
|
3571
|
+
children: [h && /* @__PURE__ */ p("h4", {
|
|
3572
|
+
className: "wc-menu__card-title",
|
|
3573
|
+
children: h
|
|
3574
|
+
}), g && /* @__PURE__ */ p("p", {
|
|
3575
|
+
className: "wc-menu__card-description",
|
|
3576
|
+
children: g
|
|
3577
|
+
})]
|
|
3578
|
+
})]
|
|
3579
|
+
}), /* @__PURE__ */ p("div", {
|
|
3580
|
+
className: "wc-menu__card-list",
|
|
3581
|
+
children: e.map((e, t) => e.divider ? /* @__PURE__ */ p("div", {
|
|
3582
|
+
className: "wc-menu__divider",
|
|
3583
|
+
role: "separator"
|
|
3584
|
+
}, e.key || t) : /* @__PURE__ */ m("button", {
|
|
3585
|
+
type: "button",
|
|
3586
|
+
role: "menuitem",
|
|
3587
|
+
className: $n(e).join(" "),
|
|
3588
|
+
disabled: e.disabled,
|
|
3589
|
+
onClick: () => L(e, t),
|
|
3590
|
+
children: [e.icon && /* @__PURE__ */ p("span", {
|
|
3591
|
+
className: "wc-menu__icon",
|
|
3592
|
+
children: e.icon
|
|
3593
|
+
}), /* @__PURE__ */ p("span", {
|
|
3594
|
+
className: "wc-menu__label",
|
|
3595
|
+
children: e.label
|
|
3596
|
+
})]
|
|
3597
|
+
}, e.key || t))
|
|
3598
|
+
})]
|
|
3599
|
+
}) : e.map((e, t) => e.divider ? /* @__PURE__ */ p("div", {
|
|
3600
|
+
className: "wc-menu__divider",
|
|
3601
|
+
role: "separator"
|
|
3602
|
+
}, e.key || t) : /* @__PURE__ */ m("button", {
|
|
3603
|
+
type: "button",
|
|
3604
|
+
role: "menuitem",
|
|
3605
|
+
className: $n(e).join(" "),
|
|
3606
|
+
disabled: e.disabled,
|
|
3607
|
+
onClick: () => L(e, t),
|
|
3608
|
+
children: [e.icon && /* @__PURE__ */ p("span", {
|
|
3609
|
+
className: "wc-menu__icon",
|
|
3610
|
+
children: e.icon
|
|
3611
|
+
}), /* @__PURE__ */ p("span", {
|
|
3612
|
+
className: "wc-menu__label",
|
|
3613
|
+
children: e.label
|
|
3614
|
+
})]
|
|
3615
|
+
}, e.key || t)))
|
|
3616
|
+
}) }) : null;
|
|
3617
|
+
return /* @__PURE__ */ m("div", {
|
|
3618
|
+
className: j,
|
|
3619
|
+
ref: O,
|
|
3620
|
+
...w,
|
|
3366
3621
|
children: [/* @__PURE__ */ p("div", {
|
|
3367
3622
|
className: "wc-menu__trigger",
|
|
3368
|
-
onClick:
|
|
3369
|
-
|
|
3370
|
-
|
|
3623
|
+
onClick: I,
|
|
3624
|
+
onKeyDown: V,
|
|
3625
|
+
ref: A,
|
|
3626
|
+
children: x || b || /* @__PURE__ */ m("button", {
|
|
3371
3627
|
type: "button",
|
|
3372
|
-
className:
|
|
3628
|
+
className: N,
|
|
3373
3629
|
disabled: a,
|
|
3374
3630
|
"aria-haspopup": "menu",
|
|
3375
|
-
"aria-expanded":
|
|
3631
|
+
"aria-expanded": T,
|
|
3632
|
+
"aria-controls": T ? D : void 0,
|
|
3376
3633
|
children: [t, /* @__PURE__ */ p("span", {
|
|
3377
|
-
className:
|
|
3634
|
+
className: P,
|
|
3378
3635
|
children: /* @__PURE__ */ p("svg", {
|
|
3379
3636
|
viewBox: "0 0 24 24",
|
|
3380
3637
|
fill: "none",
|
|
@@ -3384,150 +3641,73 @@ var Mn = (e) => {
|
|
|
3384
3641
|
})
|
|
3385
3642
|
})]
|
|
3386
3643
|
})
|
|
3387
|
-
}),
|
|
3388
|
-
className: k,
|
|
3389
|
-
style: M,
|
|
3390
|
-
role: "menu",
|
|
3391
|
-
children: x || (i === "card" ? /* @__PURE__ */ m("div", {
|
|
3392
|
-
className: "wc-menu__card",
|
|
3393
|
-
children: [/* @__PURE__ */ m("div", {
|
|
3394
|
-
className: "wc-menu__card-illustration",
|
|
3395
|
-
children: [c ? /* @__PURE__ */ p("img", {
|
|
3396
|
-
src: c,
|
|
3397
|
-
alt: l,
|
|
3398
|
-
className: "wc-menu__illustration-image"
|
|
3399
|
-
}) : /* @__PURE__ */ p("div", {
|
|
3400
|
-
className: "wc-menu__illustration-placeholder",
|
|
3401
|
-
children: /* @__PURE__ */ p("span", { children: "🎨" })
|
|
3402
|
-
}), (f || h) && /* @__PURE__ */ m("div", {
|
|
3403
|
-
className: "wc-menu__card-info",
|
|
3404
|
-
children: [f && /* @__PURE__ */ p("h4", {
|
|
3405
|
-
className: "wc-menu__card-title",
|
|
3406
|
-
children: f
|
|
3407
|
-
}), h && /* @__PURE__ */ p("p", {
|
|
3408
|
-
className: "wc-menu__card-description",
|
|
3409
|
-
children: h
|
|
3410
|
-
})]
|
|
3411
|
-
})]
|
|
3412
|
-
}), /* @__PURE__ */ p("div", {
|
|
3413
|
-
className: "wc-menu__card-list",
|
|
3414
|
-
children: e.map((e, t) => e.divider ? /* @__PURE__ */ p("div", {
|
|
3415
|
-
className: "wc-menu__divider",
|
|
3416
|
-
role: "separator"
|
|
3417
|
-
}, e.key || t) : /* @__PURE__ */ m("button", {
|
|
3418
|
-
type: "button",
|
|
3419
|
-
role: "menuitem",
|
|
3420
|
-
className: Wn(e).join(" "),
|
|
3421
|
-
disabled: e.disabled,
|
|
3422
|
-
onClick: () => P(e, t),
|
|
3423
|
-
children: [e.icon && /* @__PURE__ */ p("span", {
|
|
3424
|
-
className: "wc-menu__icon",
|
|
3425
|
-
children: e.icon
|
|
3426
|
-
}), /* @__PURE__ */ p("span", {
|
|
3427
|
-
className: "wc-menu__label",
|
|
3428
|
-
children: e.label
|
|
3429
|
-
})]
|
|
3430
|
-
}, e.key || t))
|
|
3431
|
-
})]
|
|
3432
|
-
}) : e.map((e, t) => e.divider ? /* @__PURE__ */ p("div", {
|
|
3433
|
-
className: "wc-menu__divider",
|
|
3434
|
-
role: "separator"
|
|
3435
|
-
}, e.key || t) : /* @__PURE__ */ m("button", {
|
|
3436
|
-
type: "button",
|
|
3437
|
-
role: "menuitem",
|
|
3438
|
-
className: Wn(e).join(" "),
|
|
3439
|
-
disabled: e.disabled,
|
|
3440
|
-
onClick: () => P(e, t),
|
|
3441
|
-
children: [e.icon && /* @__PURE__ */ p("span", {
|
|
3442
|
-
className: "wc-menu__icon",
|
|
3443
|
-
children: e.icon
|
|
3444
|
-
}), /* @__PURE__ */ p("span", {
|
|
3445
|
-
className: "wc-menu__label",
|
|
3446
|
-
children: e.label
|
|
3447
|
-
})]
|
|
3448
|
-
}, e.key || t)))
|
|
3449
|
-
})]
|
|
3644
|
+
}), H]
|
|
3450
3645
|
});
|
|
3451
3646
|
};
|
|
3452
|
-
|
|
3647
|
+
ir.displayName = "Menu";
|
|
3453
3648
|
//#endregion
|
|
3454
3649
|
//#region ../core/src/components/Modal/utils.js
|
|
3455
|
-
function
|
|
3650
|
+
function ar({ size: e = "md", fullWidth: t = !1, fullScreen: n = !1, scroll: r = "paper", position: i = "center", className: a = "" } = {}) {
|
|
3456
3651
|
let o = ["wc-modal"];
|
|
3457
3652
|
return e && !n && o.push(`wc-modal--${e}`), n && o.push("wc-modal--fullscreen"), t && !n && o.push("wc-modal--full-width"), r === "body" ? o.push("wc-modal--scroll-body") : o.push("wc-modal--scroll-paper"), i && i !== "center" && o.push(`wc-modal--${i}`), a && o.push(a), o.filter(Boolean).join(" ");
|
|
3458
3653
|
}
|
|
3459
|
-
function
|
|
3654
|
+
function or({ centered: e = !0, position: t = "center" } = {}) {
|
|
3460
3655
|
let n = ["wc-modal-overlay"];
|
|
3461
3656
|
return (e || t === "center") && n.push("wc-modal-overlay--centered"), t && t !== "center" && n.push(`wc-modal-overlay--${t}`), n.join(" ");
|
|
3462
3657
|
}
|
|
3463
|
-
function
|
|
3658
|
+
function sr(e, t, n = 0) {
|
|
3464
3659
|
e(!1), t && (n > 0 ? setTimeout(() => {
|
|
3465
3660
|
t();
|
|
3466
3661
|
}, n) : t());
|
|
3467
3662
|
}
|
|
3468
|
-
function $n(e, t, n) {
|
|
3469
|
-
e.key === "Escape" && t && n();
|
|
3470
|
-
}
|
|
3471
|
-
function er(e) {
|
|
3472
|
-
if (e) {
|
|
3473
|
-
let t = e.querySelectorAll("button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])");
|
|
3474
|
-
t.length > 0 ? t[0].focus() : e.focus();
|
|
3475
|
-
}
|
|
3476
|
-
}
|
|
3477
|
-
function tr(e) {
|
|
3478
|
-
if (!e) return () => {};
|
|
3479
|
-
let t = e.querySelectorAll("button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])"), n = t[0], r = t[t.length - 1], i = (e) => {
|
|
3480
|
-
e.key === "Tab" && (e.shiftKey ? document.activeElement === n && (e.preventDefault(), r?.focus()) : document.activeElement === r && (e.preventDefault(), n?.focus()));
|
|
3481
|
-
};
|
|
3482
|
-
return e.addEventListener("keydown", i), () => {
|
|
3483
|
-
e.removeEventListener("keydown", i);
|
|
3484
|
-
};
|
|
3485
|
-
}
|
|
3486
3663
|
//#endregion
|
|
3487
3664
|
//#region src/components/Modal/Modal.jsx
|
|
3488
|
-
var
|
|
3489
|
-
let M = s(), [N, P] = d(e || t), F = u(null),
|
|
3665
|
+
var cr = ({ visible: e = !1, open: t = !1, title: n = "", size: r = "md", maxWidth: a = null, closable: c = !0, showCloseButton: l = !0, maskClosable: f = !0, closeOnOverlay: h = !0, disableBackdropClick: g = !1, disableEscapeKeyDown: _ = !1, centered: v = !0, fullWidth: y = !1, fullScreen: b = !1, position: x = "center", scroll: S = "paper", lockScroll: C = !0, zIndex: w = 1e3, showOverlay: T = !0, className: E = "", onClose: D, children: O, header: k, footer: A, ...j }) => {
|
|
3666
|
+
let M = s(), [N, P] = d(e || t), F = u(null), { messages: I } = q(), L = e || t;
|
|
3490
3667
|
o(() => {
|
|
3491
|
-
P(
|
|
3492
|
-
}, [
|
|
3493
|
-
let
|
|
3494
|
-
size:
|
|
3668
|
+
P(L);
|
|
3669
|
+
}, [L]);
|
|
3670
|
+
let R = ar({
|
|
3671
|
+
size: a || r,
|
|
3495
3672
|
fullWidth: y,
|
|
3496
3673
|
fullScreen: b,
|
|
3497
3674
|
scroll: S,
|
|
3498
3675
|
position: x,
|
|
3499
3676
|
className: E
|
|
3500
|
-
}),
|
|
3677
|
+
}), z = or({
|
|
3501
3678
|
centered: x === "center" || v,
|
|
3502
3679
|
position: x
|
|
3503
|
-
}),
|
|
3504
|
-
|
|
3505
|
-
},
|
|
3506
|
-
|
|
3507
|
-
}, U = (e) => {
|
|
3508
|
-
$n(e, a && !_, V);
|
|
3509
|
-
};
|
|
3510
|
-
if (o(() => {
|
|
3511
|
-
if (N) return I.current = document.activeElement, setTimeout(() => {
|
|
3512
|
-
F.current && (er(F.current), L.current = tr(F.current));
|
|
3513
|
-
}, 100), document.addEventListener("keydown", U), C && (document.body.style.overflow = "hidden"), () => {
|
|
3514
|
-
document.removeEventListener("keydown", U), L.current &&= (L.current(), null), I.current && I.current.focus && I.current.focus(), C && (document.body.style.overflow = "");
|
|
3515
|
-
};
|
|
3680
|
+
}), B = i(() => {
|
|
3681
|
+
sr(P, D);
|
|
3682
|
+
}, [D]), V = i(() => {
|
|
3683
|
+
f && h && !g && B();
|
|
3516
3684
|
}, [
|
|
3517
|
-
|
|
3518
|
-
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
])
|
|
3522
|
-
|
|
3523
|
-
|
|
3524
|
-
|
|
3685
|
+
h,
|
|
3686
|
+
g,
|
|
3687
|
+
B,
|
|
3688
|
+
f
|
|
3689
|
+
]);
|
|
3690
|
+
if (se({
|
|
3691
|
+
open: N,
|
|
3692
|
+
elementRef: F,
|
|
3693
|
+
modal: !0,
|
|
3694
|
+
lockScroll: C,
|
|
3695
|
+
restoreFocus: !0,
|
|
3696
|
+
initialFocus: !0,
|
|
3697
|
+
closeOnEscape: c && !_,
|
|
3698
|
+
closeOnPointerDownOutside: !1,
|
|
3699
|
+
onEscapeKeyDown: B,
|
|
3700
|
+
zIndex: w
|
|
3701
|
+
}), !N) return null;
|
|
3702
|
+
let H = c && l !== !1;
|
|
3703
|
+
return /* @__PURE__ */ p(oe, { children: /* @__PURE__ */ m("div", {
|
|
3704
|
+
className: z,
|
|
3525
3705
|
style: { zIndex: w },
|
|
3526
|
-
onClick:
|
|
3706
|
+
onClick: V,
|
|
3527
3707
|
"data-testid": "modal-overlay",
|
|
3528
3708
|
children: [T && /* @__PURE__ */ p("div", { className: "wc-modal__overlay" }), /* @__PURE__ */ m("div", {
|
|
3529
3709
|
ref: F,
|
|
3530
|
-
className:
|
|
3710
|
+
className: R,
|
|
3531
3711
|
onClick: (e) => e.stopPropagation(),
|
|
3532
3712
|
role: "dialog",
|
|
3533
3713
|
"aria-modal": "true",
|
|
@@ -3535,12 +3715,12 @@ var nr = ({ visible: e = !1, open: t = !1, title: n = "", size: r = "md", maxWid
|
|
|
3535
3715
|
tabIndex: -1,
|
|
3536
3716
|
...j,
|
|
3537
3717
|
children: [
|
|
3538
|
-
|
|
3718
|
+
H && /* @__PURE__ */ p(Xe, {
|
|
3539
3719
|
variant: "text",
|
|
3540
3720
|
size: "sm",
|
|
3541
3721
|
className: "wc-modal__close",
|
|
3542
|
-
onClick:
|
|
3543
|
-
"aria-label":
|
|
3722
|
+
onClick: B,
|
|
3723
|
+
"aria-label": I.closeDialog,
|
|
3544
3724
|
children: /* @__PURE__ */ p("svg", {
|
|
3545
3725
|
viewBox: "0 0 24 24",
|
|
3546
3726
|
"aria-hidden": "true",
|
|
@@ -3565,12 +3745,12 @@ var nr = ({ visible: e = !1, open: t = !1, title: n = "", size: r = "md", maxWid
|
|
|
3565
3745
|
})
|
|
3566
3746
|
]
|
|
3567
3747
|
})]
|
|
3568
|
-
})
|
|
3748
|
+
}) });
|
|
3569
3749
|
};
|
|
3570
|
-
|
|
3750
|
+
cr.displayName = "Modal";
|
|
3571
3751
|
//#endregion
|
|
3572
3752
|
//#region src/components/NumberAnimation/NumberAnimation.jsx
|
|
3573
|
-
var
|
|
3753
|
+
var lr = ({ active: e = !0, duration: t = 3e3, from: n = 0, to: r, locale: i = "", precision: a = 0, showSeparator: s = !1, prefix: c = "", suffix: l = "", separator: f = "", formatter: m = null, easing: h = "linear", onFinish: g, className: _ = "", style: v = {}, ...y }) => {
|
|
3574
3754
|
let [b, x] = d(n), [S, C] = d(!1), w = u(null), T = u(null), E = (i) => {
|
|
3575
3755
|
w.current === null && (w.current = i);
|
|
3576
3756
|
let a = Math.min((i - w.current) / t, 1);
|
|
@@ -3616,21 +3796,21 @@ var rr = ({ active: e = !0, duration: t = 3e3, from: n = 0, to: r, locale: i = "
|
|
|
3616
3796
|
};
|
|
3617
3797
|
//#endregion
|
|
3618
3798
|
//#region src/components/Pagination/Pagination.jsx
|
|
3619
|
-
function
|
|
3620
|
-
let
|
|
3799
|
+
function ur({ value: e = 1, onChange: t, total: n, pageSize: r = 10, siblingCount: a = 1, boundaryCount: s = 1, size: c = "md", className: u = "", ...f }) {
|
|
3800
|
+
let { messages: h } = q(), [g, _] = d(e);
|
|
3621
3801
|
o(() => {
|
|
3622
|
-
|
|
3802
|
+
_(e);
|
|
3623
3803
|
}, [e]);
|
|
3624
|
-
let
|
|
3804
|
+
let v = l(() => Math.max(1, Math.ceil(n / r)), [n, r]), y = (e, t) => {
|
|
3625
3805
|
let n = [];
|
|
3626
3806
|
for (let r = e; r <= t; r++) n.push(r);
|
|
3627
3807
|
return n;
|
|
3628
|
-
},
|
|
3629
|
-
if (
|
|
3808
|
+
}, b = l(() => {
|
|
3809
|
+
if (v <= a * 2 + 3 + s * 2) return y(1, v).map((e) => ({
|
|
3630
3810
|
key: e,
|
|
3631
3811
|
num: e
|
|
3632
3812
|
}));
|
|
3633
|
-
let e = Math.max(
|
|
3813
|
+
let e = Math.max(g - a, s + 2), t = Math.min(g + a, v - s - 1), n = e > s + 2, r = t < v - s - 1, i = [];
|
|
3634
3814
|
for (let e = 1; e <= s; e++) i.push({
|
|
3635
3815
|
key: "b" + e,
|
|
3636
3816
|
num: e
|
|
@@ -3647,59 +3827,59 @@ function ir({ value: e = 1, onChange: t, total: n, pageSize: r = 10, siblingCoun
|
|
|
3647
3827
|
key: "r-ellipsis",
|
|
3648
3828
|
ellipsis: !0
|
|
3649
3829
|
});
|
|
3650
|
-
for (let e =
|
|
3830
|
+
for (let e = v - s + 1; e <= v; e++) i.push({
|
|
3651
3831
|
key: "e" + e,
|
|
3652
3832
|
num: e
|
|
3653
3833
|
});
|
|
3654
3834
|
return i;
|
|
3655
3835
|
}, [
|
|
3656
|
-
|
|
3657
|
-
|
|
3836
|
+
g,
|
|
3837
|
+
v,
|
|
3658
3838
|
a,
|
|
3659
3839
|
s
|
|
3660
|
-
]),
|
|
3661
|
-
e < 1 || e >
|
|
3840
|
+
]), x = i((e) => {
|
|
3841
|
+
e < 1 || e > v || e === g || (_(e), t?.(e));
|
|
3662
3842
|
}, [
|
|
3663
|
-
|
|
3664
|
-
|
|
3843
|
+
g,
|
|
3844
|
+
v,
|
|
3665
3845
|
t
|
|
3666
3846
|
]);
|
|
3667
|
-
return
|
|
3847
|
+
return v <= 1 ? null : /* @__PURE__ */ m("nav", {
|
|
3668
3848
|
className: [
|
|
3669
3849
|
"pagination",
|
|
3670
3850
|
"wc-pagination",
|
|
3671
3851
|
c === "md" ? "" : `wc-pagination--${c}`,
|
|
3672
3852
|
u
|
|
3673
3853
|
].filter(Boolean).join(" "),
|
|
3674
|
-
"aria-label":
|
|
3854
|
+
"aria-label": h.pagination,
|
|
3675
3855
|
...f,
|
|
3676
3856
|
children: [
|
|
3677
3857
|
/* @__PURE__ */ p("button", {
|
|
3678
3858
|
className: "page-btn wc-page-btn wc-page-btn--prev wc-page-btn--nav",
|
|
3679
|
-
disabled:
|
|
3680
|
-
onClick: () =>
|
|
3681
|
-
"aria-label":
|
|
3859
|
+
disabled: g === 1,
|
|
3860
|
+
onClick: () => x(g - 1),
|
|
3861
|
+
"aria-label": h.previousPage,
|
|
3682
3862
|
children: /* @__PURE__ */ p("svg", {
|
|
3683
3863
|
viewBox: "0 0 24 24",
|
|
3684
3864
|
"aria-hidden": "true",
|
|
3685
3865
|
children: /* @__PURE__ */ p("path", { d: "m15 18-6-6 6-6" })
|
|
3686
3866
|
})
|
|
3687
3867
|
}),
|
|
3688
|
-
|
|
3868
|
+
b.map((e) => e.ellipsis ? /* @__PURE__ */ p("span", {
|
|
3689
3869
|
className: "page-ellipsis",
|
|
3690
3870
|
children: "…"
|
|
3691
3871
|
}, e.key) : /* @__PURE__ */ p("button", {
|
|
3692
|
-
className: `page-btn wc-page-btn${e.num ===
|
|
3693
|
-
onClick: () =>
|
|
3694
|
-
"aria-current": e.num ===
|
|
3695
|
-
"aria-label":
|
|
3872
|
+
className: `page-btn wc-page-btn${e.num === g ? " active wc-page-btn--active" : ""}`,
|
|
3873
|
+
onClick: () => x(e.num),
|
|
3874
|
+
"aria-current": e.num === g ? "page" : void 0,
|
|
3875
|
+
"aria-label": h.page(e.num),
|
|
3696
3876
|
children: e.num
|
|
3697
3877
|
}, e.key)),
|
|
3698
3878
|
/* @__PURE__ */ p("button", {
|
|
3699
3879
|
className: "page-btn wc-page-btn wc-page-btn--next wc-page-btn--nav",
|
|
3700
|
-
disabled:
|
|
3701
|
-
onClick: () =>
|
|
3702
|
-
"aria-label":
|
|
3880
|
+
disabled: g === v,
|
|
3881
|
+
onClick: () => x(g + 1),
|
|
3882
|
+
"aria-label": h.nextPage,
|
|
3703
3883
|
children: /* @__PURE__ */ p("svg", {
|
|
3704
3884
|
viewBox: "0 0 24 24",
|
|
3705
3885
|
"aria-hidden": "true",
|
|
@@ -3711,38 +3891,38 @@ function ir({ value: e = 1, onChange: t, total: n, pageSize: r = 10, siblingCoun
|
|
|
3711
3891
|
}
|
|
3712
3892
|
//#endregion
|
|
3713
3893
|
//#region src/components/Page/Page.jsx
|
|
3714
|
-
var
|
|
3894
|
+
var dr = ({ as: e = "div", size: t = "lg", gutter: n = "md", className: r = "", children: i, ...a }) => /* @__PURE__ */ p(e, {
|
|
3715
3895
|
className: ["wc-page", r].filter(Boolean).join(" "),
|
|
3716
3896
|
"data-size": t,
|
|
3717
3897
|
"data-gutter": n,
|
|
3718
3898
|
...a,
|
|
3719
3899
|
children: i
|
|
3720
3900
|
});
|
|
3721
|
-
|
|
3901
|
+
dr.displayName = "Page", dr.propTypes = {
|
|
3722
3902
|
as: $.default.elementType,
|
|
3723
|
-
size: $.default.oneOf(
|
|
3724
|
-
gutter: $.default.oneOf(
|
|
3903
|
+
size: $.default.oneOf(Pn),
|
|
3904
|
+
gutter: $.default.oneOf(Fn),
|
|
3725
3905
|
className: $.default.string,
|
|
3726
3906
|
children: $.default.node
|
|
3727
3907
|
};
|
|
3728
3908
|
//#endregion
|
|
3729
3909
|
//#region ../core/src/components/Paper/utils.jsx
|
|
3730
|
-
var
|
|
3910
|
+
var fr = {
|
|
3731
3911
|
ELEVATION: "elevation",
|
|
3732
3912
|
OUTLINED: "outlined"
|
|
3733
|
-
},
|
|
3913
|
+
}, pr = {
|
|
3734
3914
|
SQUARE: "square",
|
|
3735
3915
|
ROUNDED_SM: "rounded-sm",
|
|
3736
3916
|
ROUNDED_LG: "rounded-lg",
|
|
3737
3917
|
ROUNDED_XL: "rounded-xl",
|
|
3738
3918
|
ROUNDED_2XL: "rounded-2xl",
|
|
3739
3919
|
ROUNDED_FULL: "rounded-full"
|
|
3740
|
-
},
|
|
3920
|
+
}, mr = {
|
|
3741
3921
|
SM: "sm",
|
|
3742
3922
|
MD: "md",
|
|
3743
3923
|
LG: "lg",
|
|
3744
3924
|
XL: "xl"
|
|
3745
|
-
},
|
|
3925
|
+
}, hr = {
|
|
3746
3926
|
DEFAULT: "default",
|
|
3747
3927
|
PRIMARY: "primary",
|
|
3748
3928
|
SUCCESS: "success",
|
|
@@ -3750,21 +3930,21 @@ var or = {
|
|
|
3750
3930
|
ERROR: "error",
|
|
3751
3931
|
INFO: "info"
|
|
3752
3932
|
};
|
|
3753
|
-
function
|
|
3754
|
-
let { variant: t =
|
|
3755
|
-
if (t ===
|
|
3933
|
+
function gr(e = {}) {
|
|
3934
|
+
let { variant: t = fr.ELEVATION, elevation: n = 1, square: r = !1, shape: i = null, size: a = null, color: o = hr.DEFAULT, hoverable: s = !1, clickable: c = !1, gradient: l = !1, frosted: u = !1, textured: d = !1, className: f = "" } = e, p = ["wc-paper"];
|
|
3935
|
+
if (t === fr.OUTLINED) p.push("wc-paper--outlined");
|
|
3756
3936
|
else {
|
|
3757
3937
|
p.push("wc-paper--elevation");
|
|
3758
3938
|
let e = Math.max(0, Math.min(24, Math.floor(Number(n) || 0)));
|
|
3759
3939
|
p.push(`wc-paper--elevation-${e}`);
|
|
3760
3940
|
}
|
|
3761
|
-
return r ? p.push("wc-paper--square") : i &&
|
|
3941
|
+
return r ? p.push("wc-paper--square") : i && pr[i.toUpperCase()] && p.push(`wc-paper--${i}`), a && mr[a.toUpperCase()] && p.push(`wc-paper--${a}`), o !== hr.DEFAULT && hr[o.toUpperCase()] && p.push(`wc-paper--${o}`), s && p.push("wc-paper--hoverable"), c && p.push("wc-paper--clickable"), l && p.push("wc-paper--gradient"), u && p.push("wc-paper--frosted"), d && p.push("wc-paper--textured"), f && p.push(f), p.join(" ");
|
|
3762
3942
|
}
|
|
3763
3943
|
//#endregion
|
|
3764
3944
|
//#region src/components/Paper/Paper.jsx
|
|
3765
|
-
function
|
|
3945
|
+
function _r({ component: e = "div", variant: t = "elevation", elevation: n = 1, square: r = !1, hoverable: i = !1, clickable: a = !1, color: o = "default", size: s = null, shape: c = null, gradient: l = !1, frosted: u = !1, textured: d = !1, className: f = "", children: m, onClick: h, onMouseEnter: g, onMouseLeave: _, onKeyDown: v, style: y = {}, ...b }) {
|
|
3766
3946
|
return /* @__PURE__ */ p(e, {
|
|
3767
|
-
className:
|
|
3947
|
+
className: gr({
|
|
3768
3948
|
variant: t,
|
|
3769
3949
|
elevation: Math.max(0, Math.min(24, Math.floor(Number(n) || 0))),
|
|
3770
3950
|
square: r,
|
|
@@ -3795,70 +3975,60 @@ function dr({ component: e = "div", variant: t = "elevation", elevation: n = 1,
|
|
|
3795
3975
|
}
|
|
3796
3976
|
//#endregion
|
|
3797
3977
|
//#region src/components/Popover/Popover.jsx
|
|
3798
|
-
function
|
|
3799
|
-
let
|
|
3800
|
-
|
|
3801
|
-
},
|
|
3802
|
-
|
|
3803
|
-
},
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
o(() => {}, [b, t]), o(() => (C && (D(), window.addEventListener("resize", D), window.addEventListener("scroll", D), document.addEventListener("mousedown", O)), () => {
|
|
3825
|
-
window.removeEventListener("resize", D), window.removeEventListener("scroll", D), document.removeEventListener("mousedown", O);
|
|
3826
|
-
}), [C, D]);
|
|
3827
|
-
let O = (e) => {
|
|
3828
|
-
S.current && !S.current.contains(e.target) && !x.current.contains(e.target) && T();
|
|
3829
|
-
}, k = a ? e.cloneElement(a, {
|
|
3830
|
-
ref: x,
|
|
3831
|
-
onClick: E,
|
|
3832
|
-
"aria-expanded": C,
|
|
3978
|
+
function vr({ open: t, onOpenChange: n, triggerText: r = "打开弹窗", trigger: i, placement: a = "bottom", offset: o = 8, children: c, className: l = "" }) {
|
|
3979
|
+
let { messages: f } = q(), h = s(), [g, _] = d(!1), v = t != null, y = u(null), b = u(null), x = v ? t : g, S = (e) => {
|
|
3980
|
+
v || _(e), n?.(e);
|
|
3981
|
+
}, C = () => S(!1), w = () => {
|
|
3982
|
+
S(!x);
|
|
3983
|
+
}, T = ce({
|
|
3984
|
+
open: x,
|
|
3985
|
+
anchorRef: y,
|
|
3986
|
+
floatingRef: b,
|
|
3987
|
+
placement: a,
|
|
3988
|
+
offset: o
|
|
3989
|
+
});
|
|
3990
|
+
se({
|
|
3991
|
+
open: x,
|
|
3992
|
+
elementRef: b,
|
|
3993
|
+
refs: [y],
|
|
3994
|
+
closeOnEscape: !0,
|
|
3995
|
+
closeOnPointerDownOutside: !0,
|
|
3996
|
+
onEscapeKeyDown: C,
|
|
3997
|
+
onPointerDownOutside: C,
|
|
3998
|
+
zIndex: 2e3
|
|
3999
|
+
});
|
|
4000
|
+
let E = i ? e.cloneElement(i, {
|
|
4001
|
+
ref: y,
|
|
4002
|
+
onClick: w,
|
|
4003
|
+
"aria-expanded": x,
|
|
3833
4004
|
"aria-haspopup": "dialog",
|
|
3834
|
-
"aria-controls":
|
|
4005
|
+
"aria-controls": h
|
|
3835
4006
|
}) : /* @__PURE__ */ p("button", {
|
|
3836
|
-
ref:
|
|
4007
|
+
ref: y,
|
|
3837
4008
|
type: "button",
|
|
3838
4009
|
className: "wc-popover-trigger",
|
|
3839
|
-
onClick:
|
|
3840
|
-
"aria-expanded":
|
|
4010
|
+
onClick: w,
|
|
4011
|
+
"aria-expanded": x,
|
|
3841
4012
|
"aria-haspopup": "dialog",
|
|
3842
|
-
"aria-controls":
|
|
4013
|
+
"aria-controls": h,
|
|
3843
4014
|
children: r
|
|
3844
4015
|
});
|
|
3845
4016
|
return /* @__PURE__ */ m("div", {
|
|
3846
|
-
className: `wc-popover-container ${
|
|
3847
|
-
children: [
|
|
3848
|
-
ref:
|
|
3849
|
-
id:
|
|
3850
|
-
className: `wc-popover-content wc-popover-content--${
|
|
4017
|
+
className: `wc-popover-container ${l}`.trim(),
|
|
4018
|
+
children: [E, x && /* @__PURE__ */ p(oe, { children: /* @__PURE__ */ p("div", {
|
|
4019
|
+
ref: b,
|
|
4020
|
+
id: h,
|
|
4021
|
+
className: `wc-popover-content wc-popover-content--${T}`.trim(),
|
|
3851
4022
|
role: "dialog",
|
|
3852
|
-
"aria-label":
|
|
4023
|
+
"aria-label": f.closePopover,
|
|
3853
4024
|
tabIndex: -1,
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
}), document.body)]
|
|
4025
|
+
children: c
|
|
4026
|
+
}) })]
|
|
3857
4027
|
});
|
|
3858
4028
|
}
|
|
3859
4029
|
//#endregion
|
|
3860
4030
|
//#region src/components/PricingTable/PricingTable.jsx
|
|
3861
|
-
function
|
|
4031
|
+
function yr({ plans: e = [], columns: t = 3, className: n = "" }) {
|
|
3862
4032
|
let r = { gridTemplateColumns: `repeat(${t}, minmax(0,1fr))` };
|
|
3863
4033
|
return /* @__PURE__ */ p("div", {
|
|
3864
4034
|
className: `pricing-grid ${n}`.trim(),
|
|
@@ -3888,8 +4058,8 @@ function pr({ plans: e = [], columns: t = 3, className: n = "" }) {
|
|
|
3888
4058
|
}
|
|
3889
4059
|
//#endregion
|
|
3890
4060
|
//#region src/components/Progress/Progress.jsx
|
|
3891
|
-
var
|
|
3892
|
-
let c = [
|
|
4061
|
+
var br = ({ value: e = 0, label: t = "", showPercent: n = !1, color: r = "primary", size: i = "md", animated: a = !1, className: o = "", ...s }) => {
|
|
4062
|
+
let { messages: c } = q(), l = [
|
|
3893
4063
|
"primary",
|
|
3894
4064
|
"success",
|
|
3895
4065
|
"warning",
|
|
@@ -3898,11 +4068,11 @@ var mr = ({ value: e = 0, label: t = "", showPercent: n = !1, color: r = "primar
|
|
|
3898
4068
|
"orange",
|
|
3899
4069
|
"cyan",
|
|
3900
4070
|
"pink"
|
|
3901
|
-
].includes(r) ? r : "primary",
|
|
4071
|
+
].includes(r) ? r : "primary", u = Number(e), d = Number.isNaN(u) ? 0 : Math.max(0, Math.min(100, u)), f = ["wc-progress", `wc-progress--${i}`], h = [
|
|
3902
4072
|
"wc-progress__bar",
|
|
3903
|
-
`wc-progress__bar--${
|
|
4073
|
+
`wc-progress__bar--${l}`,
|
|
3904
4074
|
a && "wc-progress__bar--animated"
|
|
3905
|
-
].filter(Boolean).join(" "),
|
|
4075
|
+
].filter(Boolean).join(" "), g = { width: `${d}%` };
|
|
3906
4076
|
return /* @__PURE__ */ m("div", {
|
|
3907
4077
|
className: `wc-progress-wrapper ${o}`,
|
|
3908
4078
|
...s,
|
|
@@ -3913,27 +4083,27 @@ var mr = ({ value: e = 0, label: t = "", showPercent: n = !1, color: r = "primar
|
|
|
3913
4083
|
children: t
|
|
3914
4084
|
}), n && /* @__PURE__ */ m("span", {
|
|
3915
4085
|
className: "wc-progress-percent",
|
|
3916
|
-
children: [Math.round(
|
|
4086
|
+
children: [Math.round(d), "%"]
|
|
3917
4087
|
})]
|
|
3918
4088
|
}), /* @__PURE__ */ p("div", {
|
|
3919
|
-
className:
|
|
4089
|
+
className: f.join(" "),
|
|
3920
4090
|
role: "progressbar",
|
|
3921
|
-
"aria-label": t ||
|
|
3922
|
-
"aria-valuenow":
|
|
4091
|
+
"aria-label": t || c.progress,
|
|
4092
|
+
"aria-valuenow": d,
|
|
3923
4093
|
"aria-valuemin": "0",
|
|
3924
4094
|
"aria-valuemax": "100",
|
|
3925
4095
|
children: /* @__PURE__ */ p("div", {
|
|
3926
|
-
className:
|
|
3927
|
-
style:
|
|
4096
|
+
className: h,
|
|
4097
|
+
style: g
|
|
3928
4098
|
})
|
|
3929
4099
|
})]
|
|
3930
4100
|
});
|
|
3931
4101
|
};
|
|
3932
|
-
|
|
4102
|
+
br.displayName = "Progress";
|
|
3933
4103
|
//#endregion
|
|
3934
4104
|
//#region src/components/Radio/Radio.jsx
|
|
3935
|
-
var
|
|
3936
|
-
function
|
|
4105
|
+
var xr = n(null);
|
|
4106
|
+
function Sr({ value: e, onChange: t, name: n, disabled: r = !1, label: a = "", row: o = !1, required: s = !1, error: c = "", helperText: l = "", size: u = "md", color: f = "primary", children: h, className: g = "" }) {
|
|
3937
4107
|
let [_, v] = d(e), y = e !== void 0, b = y ? e : _, x = i((e) => {
|
|
3938
4108
|
r || (y || v(e), t?.(e));
|
|
3939
4109
|
}, [
|
|
@@ -3941,7 +4111,7 @@ function gr({ value: e, onChange: t, name: n, disabled: r = !1, label: a = "", r
|
|
|
3941
4111
|
y,
|
|
3942
4112
|
t
|
|
3943
4113
|
]), S = ["wc-radio-group", g].filter(Boolean).join(" "), C = ["wc-radio-group-content", o && "wc-radio-group-content--row"].filter(Boolean).join(" ");
|
|
3944
|
-
return /* @__PURE__ */ p(
|
|
4114
|
+
return /* @__PURE__ */ p(xr.Provider, {
|
|
3945
4115
|
value: {
|
|
3946
4116
|
value: b,
|
|
3947
4117
|
updateValue: x,
|
|
@@ -3978,8 +4148,8 @@ function gr({ value: e, onChange: t, name: n, disabled: r = !1, label: a = "", r
|
|
|
3978
4148
|
})
|
|
3979
4149
|
});
|
|
3980
4150
|
}
|
|
3981
|
-
function
|
|
3982
|
-
let h = a(
|
|
4151
|
+
function Cr({ value: e, checked: t, onChange: n, label: r, name: i, disabled: o = !1, color: s = "primary", size: c = "md", className: l = "", children: u, ...f }) {
|
|
4152
|
+
let h = a(xr), g = h ? h.value === e : t === void 0 ? void 0 : t, _ = h ? h.name : i, v = h && h.disabled || o, y = c || h && h.size || "md", b = s || h && h.color || "primary", [x, S] = d(!1), C = [
|
|
3983
4153
|
"wc-radio",
|
|
3984
4154
|
`wc-radio--${y}`,
|
|
3985
4155
|
v && "wc-radio--disabled",
|
|
@@ -4020,114 +4190,130 @@ function _r({ value: e, checked: t, onChange: n, label: r, name: i, disabled: o
|
|
|
4020
4190
|
]
|
|
4021
4191
|
});
|
|
4022
4192
|
}
|
|
4023
|
-
|
|
4193
|
+
Cr.displayName = "Radio", Sr.displayName = "RadioGroup";
|
|
4024
4194
|
//#endregion
|
|
4025
4195
|
//#region src/components/Rating/Rating.jsx
|
|
4026
|
-
var
|
|
4027
|
-
let [
|
|
4028
|
-
o(() =>
|
|
4029
|
-
let
|
|
4196
|
+
var wr = ({ value: e = 0, max: t = 5, readOnly: n = !1, onChange: r = () => {}, className: i = "", style: a = {}, ariaLabel: s, ...c }) => {
|
|
4197
|
+
let [l, u] = d(0), [f, m] = d(e), { messages: h } = q();
|
|
4198
|
+
o(() => m(e), [e]);
|
|
4199
|
+
let g = (e) => {
|
|
4030
4200
|
if (n) return;
|
|
4031
|
-
let t = e ===
|
|
4032
|
-
|
|
4201
|
+
let t = e === f ? 0 : e;
|
|
4202
|
+
m(t), r(t);
|
|
4033
4203
|
};
|
|
4034
4204
|
return /* @__PURE__ */ p("div", {
|
|
4035
4205
|
className: ["wc-rating", i].filter(Boolean).join(" "),
|
|
4036
4206
|
role: "radiogroup",
|
|
4037
|
-
"aria-label":
|
|
4207
|
+
"aria-label": s || h.rating,
|
|
4038
4208
|
style: a,
|
|
4039
|
-
...
|
|
4209
|
+
...c,
|
|
4040
4210
|
children: Array.from({ length: t }, (e, r) => {
|
|
4041
4211
|
let i = r + 1;
|
|
4042
4212
|
return /* @__PURE__ */ p("button", {
|
|
4043
4213
|
type: "button",
|
|
4044
|
-
className: ["wc-rating-item", (i <=
|
|
4045
|
-
onMouseEnter: () => !n &&
|
|
4046
|
-
onMouseLeave: () => !n &&
|
|
4047
|
-
onClick: () =>
|
|
4214
|
+
className: ["wc-rating-item", (i <= l || i <= f) && "wc-rating-item--active"].filter(Boolean).join(" "),
|
|
4215
|
+
onMouseEnter: () => !n && u(i),
|
|
4216
|
+
onMouseLeave: () => !n && u(0),
|
|
4217
|
+
onClick: () => g(i),
|
|
4048
4218
|
disabled: n,
|
|
4049
|
-
"aria-label":
|
|
4050
|
-
"aria-checked": i ===
|
|
4219
|
+
"aria-label": h.ratingValue(i, t),
|
|
4220
|
+
"aria-checked": i === f,
|
|
4051
4221
|
role: "radio",
|
|
4052
4222
|
children: "★"
|
|
4053
4223
|
}, i);
|
|
4054
4224
|
})
|
|
4055
4225
|
});
|
|
4056
4226
|
};
|
|
4057
|
-
|
|
4227
|
+
wr.displayName = "Rating";
|
|
4058
4228
|
//#endregion
|
|
4059
4229
|
//#region src/components/Select/Select.jsx
|
|
4060
|
-
var
|
|
4061
|
-
let [
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4230
|
+
var Tr = ({ value: e = "", onChange: t, options: n = [], placeholder: r = "Select an option", label: i = "", helperText: a = "", error: o = !1, errorMessage: c = "", required: l = !1, disabled: f = !1, multiple: h = !1, clearable: g = !1, fullWidth: _ = !1, size: v = "md", variant: y = "filled", color: b = "primary", maxHeight: x = 200, name: S = "", id: C = "", className: w = "", style: T = {}, onFocus: E, onBlur: D, onSearch: O, renderOption: k, renderValue: A, ...j }) => {
|
|
4231
|
+
let [M, N] = d(!1), [P, F] = d(!1), [I, L] = d(-1), R = u(null), z = u(null), B = () => {
|
|
4232
|
+
N(!1), F(!1), L(-1);
|
|
4233
|
+
};
|
|
4234
|
+
se({
|
|
4235
|
+
open: M,
|
|
4236
|
+
elementRef: z,
|
|
4237
|
+
refs: [R],
|
|
4238
|
+
closeOnEscape: !0,
|
|
4239
|
+
closeOnPointerDownOutside: !0,
|
|
4240
|
+
onEscapeKeyDown: B,
|
|
4241
|
+
onPointerDownOutside: B,
|
|
4242
|
+
zIndex: 1e3
|
|
4243
|
+
});
|
|
4244
|
+
let V = h ? n.filter((t) => e.includes(t.value)) : n.find((t) => t.value === e), H = () => {
|
|
4071
4245
|
let e = ["wc-select"];
|
|
4072
|
-
return e.push(`wc-select--${
|
|
4073
|
-
},
|
|
4074
|
-
|
|
4075
|
-
|
|
4246
|
+
return e.push(`wc-select--${y}`), e.push(`wc-select--${v}`), o && e.push("wc-select--error"), f && e.push("wc-select--disabled"), M && e.push("wc-select--open"), P && e.push("wc-select--focused"), _ && e.push("wc-select--full-width"), h && e.push("wc-select--multiple"), e.concat(w).filter(Boolean).join(" ");
|
|
4247
|
+
}, U = () => {
|
|
4248
|
+
if (!f) {
|
|
4249
|
+
let e = !M;
|
|
4250
|
+
N(e), F(e), L(e ? Math.max(0, n.findIndex((e) => !e.disabled)) : -1);
|
|
4251
|
+
}
|
|
4252
|
+
}, W = (n) => {
|
|
4076
4253
|
if (n.disabled) return;
|
|
4077
4254
|
let r;
|
|
4078
|
-
if (
|
|
4255
|
+
if (h) {
|
|
4079
4256
|
let t = Array.isArray(e) ? e : [];
|
|
4080
4257
|
r = t.includes(n.value) ? t.filter((e) => e !== n.value) : [...t, n.value];
|
|
4081
|
-
} else r = n.value,
|
|
4258
|
+
} else r = n.value, B();
|
|
4082
4259
|
t?.({ target: {
|
|
4083
|
-
name:
|
|
4260
|
+
name: S,
|
|
4084
4261
|
value: r
|
|
4085
4262
|
} });
|
|
4086
|
-
},
|
|
4263
|
+
}, ee = (e) => {
|
|
4087
4264
|
e.stopPropagation(), t?.({ target: {
|
|
4088
|
-
name:
|
|
4089
|
-
value:
|
|
4265
|
+
name: S,
|
|
4266
|
+
value: h ? [] : ""
|
|
4090
4267
|
} });
|
|
4091
|
-
},
|
|
4092
|
-
|
|
4093
|
-
},
|
|
4268
|
+
}, te = (e) => {
|
|
4269
|
+
F(!0), E?.(e);
|
|
4270
|
+
}, ne = (e) => {
|
|
4094
4271
|
setTimeout(() => {
|
|
4095
|
-
|
|
4272
|
+
R.current?.contains(document.activeElement) || (F(!1), D?.(e));
|
|
4096
4273
|
}, 100);
|
|
4097
|
-
},
|
|
4098
|
-
|
|
4099
|
-
|
|
4274
|
+
}, re = (e) => {
|
|
4275
|
+
if (f) return;
|
|
4276
|
+
let t = n.map((e, t) => ({
|
|
4277
|
+
option: e,
|
|
4278
|
+
index: t
|
|
4279
|
+
})).filter(({ option: e }) => !e.disabled), r = (e) => {
|
|
4280
|
+
if (!t.length) return;
|
|
4281
|
+
let n = t.findIndex(({ index: e }) => e === I);
|
|
4282
|
+
L(t[n < 0 ? 0 : (n + e + t.length) % t.length].index);
|
|
4283
|
+
};
|
|
4284
|
+
e.key === "Enter" || e.key === " " ? (e.preventDefault(), M && I >= 0 ? W(n[I]) : U()) : e.key === "ArrowDown" ? (e.preventDefault(), M ? r(1) : (N(!0), F(!0), L(t[0]?.index ?? -1))) : e.key === "ArrowUp" ? (e.preventDefault(), M ? r(-1) : (N(!0), F(!0), L(t[t.length - 1]?.index ?? -1))) : e.key === "Home" ? (e.preventDefault(), L(t[0]?.index ?? -1)) : e.key === "End" ? (e.preventDefault(), L(t[t.length - 1]?.index ?? -1)) : e.key === "Escape" && B();
|
|
4285
|
+
}, G = () => h && Array.isArray(V) ? V.length === 0 ? /* @__PURE__ */ p("span", {
|
|
4100
4286
|
className: "wc-select__placeholder",
|
|
4101
4287
|
children: r
|
|
4102
4288
|
}) : /* @__PURE__ */ p("div", {
|
|
4103
4289
|
className: "wc-select__chips",
|
|
4104
|
-
children:
|
|
4290
|
+
children: V.map((e) => /* @__PURE__ */ p("span", {
|
|
4105
4291
|
className: "wc-select__chip",
|
|
4106
|
-
children:
|
|
4292
|
+
children: A ? A(e) : e.label || e.value
|
|
4107
4293
|
}, e.value))
|
|
4108
|
-
}) :
|
|
4294
|
+
}) : V ? A ? A(V) : V.label || V.value : /* @__PURE__ */ p("span", {
|
|
4109
4295
|
className: "wc-select__placeholder",
|
|
4110
4296
|
children: r
|
|
4111
4297
|
}), K = () => {
|
|
4112
4298
|
let e = ["wc-select__label"];
|
|
4113
|
-
return e.push(`wc-select__label--${
|
|
4299
|
+
return e.push(`wc-select__label--${v}`), o && e.push("wc-select__label--error"), (P || V) && e.push("wc-select__label--active"), e.join(" ");
|
|
4114
4300
|
}, q = () => {
|
|
4115
4301
|
let e = ["wc-select__container"];
|
|
4116
|
-
return e.push(`wc-select__container--${
|
|
4302
|
+
return e.push(`wc-select__container--${y}`), e.push(`wc-select__container--${v}`), f && e.push("wc-select__container--disabled"), o && e.push("wc-select__container--error"), P && e.push("wc-select__container--focused"), M && e.push("wc-select__container--open"), e.join(" ");
|
|
4117
4303
|
}, J = (e, t) => {
|
|
4118
4304
|
let n = ["wc-select__option"];
|
|
4119
4305
|
return t && n.push("wc-select__option--selected"), e.disabled && n.push("wc-select__option--disabled"), n.join(" ");
|
|
4120
|
-
},
|
|
4306
|
+
}, ie = s(), Y = C || S || ie;
|
|
4121
4307
|
return /* @__PURE__ */ m("div", {
|
|
4122
|
-
className:
|
|
4123
|
-
style:
|
|
4124
|
-
ref:
|
|
4308
|
+
className: H(),
|
|
4309
|
+
style: T,
|
|
4310
|
+
ref: R,
|
|
4125
4311
|
children: [
|
|
4126
4312
|
i && /* @__PURE__ */ m("label", {
|
|
4127
|
-
htmlFor:
|
|
4128
|
-
id: `${
|
|
4313
|
+
htmlFor: Y,
|
|
4314
|
+
id: `${Y}-label`,
|
|
4129
4315
|
className: K(),
|
|
4130
|
-
children: [i,
|
|
4316
|
+
children: [i, l && /* @__PURE__ */ p("span", {
|
|
4131
4317
|
className: "wc-select__required",
|
|
4132
4318
|
children: "*"
|
|
4133
4319
|
})]
|
|
@@ -4136,40 +4322,41 @@ var yr = ({ value: e = "", onChange: t, options: n = [], placeholder: r = "Selec
|
|
|
4136
4322
|
className: q(),
|
|
4137
4323
|
children: [/* @__PURE__ */ m("div", {
|
|
4138
4324
|
className: "wc-select__control",
|
|
4139
|
-
id:
|
|
4140
|
-
onClick:
|
|
4141
|
-
onFocus:
|
|
4142
|
-
onBlur:
|
|
4143
|
-
onKeyDown:
|
|
4144
|
-
tabIndex:
|
|
4325
|
+
id: Y,
|
|
4326
|
+
onClick: U,
|
|
4327
|
+
onFocus: te,
|
|
4328
|
+
onBlur: ne,
|
|
4329
|
+
onKeyDown: re,
|
|
4330
|
+
tabIndex: f ? -1 : 0,
|
|
4145
4331
|
role: "combobox",
|
|
4146
|
-
"aria-expanded":
|
|
4332
|
+
"aria-expanded": M,
|
|
4147
4333
|
"aria-haspopup": "listbox",
|
|
4148
|
-
"aria-labelledby": i ? `${
|
|
4149
|
-
"aria-controls": `${
|
|
4150
|
-
"aria-
|
|
4151
|
-
"aria-
|
|
4334
|
+
"aria-labelledby": i ? `${Y}-label` : void 0,
|
|
4335
|
+
"aria-controls": `${Y}-options`,
|
|
4336
|
+
"aria-activedescendant": M && I >= 0 ? `${Y}-option-${I}` : void 0,
|
|
4337
|
+
"aria-disabled": f,
|
|
4338
|
+
"aria-required": l,
|
|
4152
4339
|
children: [/* @__PURE__ */ p("div", {
|
|
4153
4340
|
className: "wc-select__value",
|
|
4154
|
-
children:
|
|
4341
|
+
children: G()
|
|
4155
4342
|
}), /* @__PURE__ */ m("div", {
|
|
4156
4343
|
className: "wc-select__indicators",
|
|
4157
|
-
children: [
|
|
4344
|
+
children: [g && (V || h && e?.length > 0) && /* @__PURE__ */ p("button", {
|
|
4158
4345
|
type: "button",
|
|
4159
4346
|
className: "wc-select__clear",
|
|
4160
|
-
onClick:
|
|
4347
|
+
onClick: ee,
|
|
4161
4348
|
tabIndex: -1,
|
|
4162
4349
|
children: "×"
|
|
4163
4350
|
}), /* @__PURE__ */ p("div", {
|
|
4164
|
-
className: `wc-select__arrow${
|
|
4351
|
+
className: `wc-select__arrow${M ? " wc-select__arrow--open" : ""}`,
|
|
4165
4352
|
children: "▼"
|
|
4166
4353
|
})]
|
|
4167
4354
|
})]
|
|
4168
|
-
}),
|
|
4355
|
+
}), M && /* @__PURE__ */ p("div", {
|
|
4169
4356
|
className: "wc-select__dropdown",
|
|
4170
|
-
id: `${
|
|
4171
|
-
style: { maxHeight:
|
|
4172
|
-
ref:
|
|
4357
|
+
id: `${Y}-options`,
|
|
4358
|
+
style: { maxHeight: x },
|
|
4359
|
+
ref: z,
|
|
4173
4360
|
children: /* @__PURE__ */ p("div", {
|
|
4174
4361
|
className: "wc-select__options",
|
|
4175
4362
|
role: "listbox",
|
|
@@ -4177,15 +4364,17 @@ var yr = ({ value: e = "", onChange: t, options: n = [], placeholder: r = "Selec
|
|
|
4177
4364
|
className: "wc-select__no-options",
|
|
4178
4365
|
children: "没有可选项"
|
|
4179
4366
|
}) : n.map((t, n) => {
|
|
4180
|
-
let r =
|
|
4367
|
+
let r = h ? Array.isArray(e) && e.includes(t.value) : e === t.value;
|
|
4181
4368
|
return /* @__PURE__ */ m("div", {
|
|
4369
|
+
id: `${Y}-option-${n}`,
|
|
4182
4370
|
className: J(t, r),
|
|
4183
|
-
onClick: () =>
|
|
4371
|
+
onClick: () => W(t),
|
|
4184
4372
|
role: "option",
|
|
4185
4373
|
"aria-selected": r,
|
|
4374
|
+
"data-active": I === n ? "true" : void 0,
|
|
4186
4375
|
children: [/* @__PURE__ */ p("span", {
|
|
4187
4376
|
className: "wc-select__option-text",
|
|
4188
|
-
children:
|
|
4377
|
+
children: k ? k(t) : t.label || t.value
|
|
4189
4378
|
}), r && /* @__PURE__ */ p("svg", {
|
|
4190
4379
|
className: "wc-select__option-check",
|
|
4191
4380
|
viewBox: "0 0 24 24",
|
|
@@ -4199,9 +4388,9 @@ var yr = ({ value: e = "", onChange: t, options: n = [], placeholder: r = "Selec
|
|
|
4199
4388
|
})
|
|
4200
4389
|
})]
|
|
4201
4390
|
}),
|
|
4202
|
-
(
|
|
4391
|
+
(o || a) && /* @__PURE__ */ p("div", { children: o ? /* @__PURE__ */ p("p", {
|
|
4203
4392
|
className: "wc-select__error",
|
|
4204
|
-
children:
|
|
4393
|
+
children: c || o
|
|
4205
4394
|
}) : /* @__PURE__ */ p("p", {
|
|
4206
4395
|
className: "wc-select__helper",
|
|
4207
4396
|
children: a
|
|
@@ -4209,29 +4398,29 @@ var yr = ({ value: e = "", onChange: t, options: n = [], placeholder: r = "Selec
|
|
|
4209
4398
|
]
|
|
4210
4399
|
});
|
|
4211
4400
|
};
|
|
4212
|
-
|
|
4401
|
+
Tr.displayName = "Select";
|
|
4213
4402
|
//#endregion
|
|
4214
4403
|
//#region src/components/Skeleton/Skeleton.jsx
|
|
4215
|
-
var
|
|
4404
|
+
var Er = {
|
|
4216
4405
|
text: "wc-skeleton--text",
|
|
4217
4406
|
rectangular: "wc-skeleton--rectangular",
|
|
4218
4407
|
rounded: "wc-skeleton--rounded",
|
|
4219
4408
|
circular: "wc-skeleton--circular"
|
|
4220
|
-
},
|
|
4221
|
-
let c = l(() => {
|
|
4222
|
-
let t = ["wc-skeleton",
|
|
4409
|
+
}, Dr = ({ animation: e = "pulse", component: t = "div", height: n, width: r, variant: i = "text", style: a = {}, className: o = "", ...s }) => {
|
|
4410
|
+
let { messages: c } = q(), u = l(() => {
|
|
4411
|
+
let t = ["wc-skeleton", Er[i] || Er.text];
|
|
4223
4412
|
return e === "pulse" && t.push("wc-skeleton--pulse"), e === "wave" && t.push("wc-skeleton--wave"), t.join(" ");
|
|
4224
|
-
}, [e, i]),
|
|
4225
|
-
return r !== void 0 && (
|
|
4226
|
-
className: `${
|
|
4227
|
-
style:
|
|
4413
|
+
}, [e, i]), d = { ...a };
|
|
4414
|
+
return r !== void 0 && (d.width = typeof r == "number" ? `${r}px` : r), n !== void 0 && (d.height = typeof n == "number" ? `${n}px` : n), !r && !n && (i === "circular" ? (d.width = "40px", d.height = "40px") : i === "text" ? (d.width = "100%", d.height = "16px") : (d.width = "100%", d.height = "128px")), /* @__PURE__ */ p(t, {
|
|
4415
|
+
className: `${u} ${o}`,
|
|
4416
|
+
style: d,
|
|
4228
4417
|
role: "status",
|
|
4229
4418
|
"aria-live": "polite",
|
|
4230
|
-
"aria-label":
|
|
4419
|
+
"aria-label": c.loading,
|
|
4231
4420
|
"aria-busy": "true",
|
|
4232
4421
|
...s
|
|
4233
4422
|
});
|
|
4234
|
-
},
|
|
4423
|
+
}, Or = ({ value: e, defaultValue: t = 0, min: n = 0, max: r = 100, step: i = 1, disabled: a = !1, label: c = "", valueLabelDisplay: u = "off", onChange: f = () => {}, className: h = "", style: g = {}, ..._ }) => {
|
|
4235
4424
|
let [v, y] = d(e === void 0 ? t : e), b = s();
|
|
4236
4425
|
o(() => {
|
|
4237
4426
|
e !== void 0 && y(e);
|
|
@@ -4278,27 +4467,29 @@ var br = {
|
|
|
4278
4467
|
})]
|
|
4279
4468
|
});
|
|
4280
4469
|
};
|
|
4281
|
-
|
|
4470
|
+
Or.displayName = "Slider";
|
|
4282
4471
|
//#endregion
|
|
4283
4472
|
//#region src/components/SlideOver/SlideOver.jsx
|
|
4284
|
-
var
|
|
4285
|
-
let c = u(null), l =
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4473
|
+
var kr = ({ open: e = !1, onClose: t = () => {}, placement: n = "right", width: r = 400, children: a, header: o, footer: s }) => {
|
|
4474
|
+
let c = u(null), { messages: l } = q(), d = i(() => {
|
|
4475
|
+
t?.();
|
|
4476
|
+
}, [t]);
|
|
4477
|
+
return se({
|
|
4478
|
+
open: e,
|
|
4479
|
+
elementRef: c,
|
|
4480
|
+
modal: !0,
|
|
4481
|
+
lockScroll: !0,
|
|
4482
|
+
restoreFocus: !0,
|
|
4483
|
+
initialFocus: !0,
|
|
4484
|
+
closeOnEscape: !0,
|
|
4485
|
+
closeOnPointerDownOutside: !1,
|
|
4486
|
+
onEscapeKeyDown: d,
|
|
4487
|
+
zIndex: 3e3
|
|
4488
|
+
}), /* @__PURE__ */ p(oe, { children: e ? /* @__PURE__ */ m("div", {
|
|
4298
4489
|
className: "wc-slideover-wrapper",
|
|
4299
4490
|
children: [/* @__PURE__ */ p("div", {
|
|
4300
4491
|
className: "wc-slideover-overlay",
|
|
4301
|
-
onClick:
|
|
4492
|
+
onClick: d
|
|
4302
4493
|
}), /* @__PURE__ */ m("div", {
|
|
4303
4494
|
ref: c,
|
|
4304
4495
|
className: `wc-slideover-panel wc-slideover-${n}`,
|
|
@@ -4307,13 +4498,13 @@ var Cr = ({ open: e = !1, onClose: t = () => {}, placement: n = "right", width:
|
|
|
4307
4498
|
"aria-modal": "true",
|
|
4308
4499
|
tabIndex: -1,
|
|
4309
4500
|
children: [
|
|
4310
|
-
|
|
4501
|
+
o && /* @__PURE__ */ p("header", {
|
|
4311
4502
|
className: "wc-slideover-header",
|
|
4312
|
-
children:
|
|
4503
|
+
children: o
|
|
4313
4504
|
}),
|
|
4314
4505
|
/* @__PURE__ */ p("div", {
|
|
4315
4506
|
className: "wc-slideover-body",
|
|
4316
|
-
children:
|
|
4507
|
+
children: a
|
|
4317
4508
|
}),
|
|
4318
4509
|
s && /* @__PURE__ */ p("footer", {
|
|
4319
4510
|
className: "wc-slideover-footer",
|
|
@@ -4322,8 +4513,8 @@ var Cr = ({ open: e = !1, onClose: t = () => {}, placement: n = "right", width:
|
|
|
4322
4513
|
/* @__PURE__ */ p("button", {
|
|
4323
4514
|
className: "wc-slideover-close",
|
|
4324
4515
|
type: "button",
|
|
4325
|
-
onClick:
|
|
4326
|
-
"aria-label":
|
|
4516
|
+
onClick: d,
|
|
4517
|
+
"aria-label": l.closeDialog,
|
|
4327
4518
|
children: /* @__PURE__ */ p("svg", {
|
|
4328
4519
|
viewBox: "0 0 24 24",
|
|
4329
4520
|
"aria-hidden": "true",
|
|
@@ -4332,8 +4523,8 @@ var Cr = ({ open: e = !1, onClose: t = () => {}, placement: n = "right", width:
|
|
|
4332
4523
|
})
|
|
4333
4524
|
]
|
|
4334
4525
|
})]
|
|
4335
|
-
}) : null
|
|
4336
|
-
},
|
|
4526
|
+
}) : null });
|
|
4527
|
+
}, Ar = ({ as: e = "div", ratio: t = "equal", gap: n = "xl", align: r = "stretch", collapse: i = "md", className: a = "", children: o, ...s }) => /* @__PURE__ */ p(e, {
|
|
4337
4528
|
className: ["wc-split", a].filter(Boolean).join(" "),
|
|
4338
4529
|
"data-ratio": t,
|
|
4339
4530
|
"data-gap": n,
|
|
@@ -4342,34 +4533,34 @@ var Cr = ({ open: e = !1, onClose: t = () => {}, placement: n = "right", width:
|
|
|
4342
4533
|
...s,
|
|
4343
4534
|
children: o
|
|
4344
4535
|
});
|
|
4345
|
-
|
|
4536
|
+
Ar.displayName = "Split", Ar.propTypes = {
|
|
4346
4537
|
as: $.default.elementType,
|
|
4347
|
-
ratio: $.default.oneOf(
|
|
4348
|
-
gap: $.default.oneOf(
|
|
4349
|
-
align: $.default.oneOf(
|
|
4350
|
-
collapse: $.default.oneOf(
|
|
4538
|
+
ratio: $.default.oneOf(Ln),
|
|
4539
|
+
gap: $.default.oneOf(Mn),
|
|
4540
|
+
align: $.default.oneOf(Nn),
|
|
4541
|
+
collapse: $.default.oneOf(Rn),
|
|
4351
4542
|
className: $.default.string,
|
|
4352
4543
|
children: $.default.node
|
|
4353
4544
|
};
|
|
4354
4545
|
//#endregion
|
|
4355
4546
|
//#region src/components/Stack/Stack.jsx
|
|
4356
|
-
var
|
|
4547
|
+
var jr = ({ as: e = "div", gap: t = "md", align: n = "stretch", className: r = "", children: i, ...a }) => /* @__PURE__ */ p(e, {
|
|
4357
4548
|
className: ["wc-stack", r].filter(Boolean).join(" "),
|
|
4358
4549
|
"data-gap": t,
|
|
4359
4550
|
"data-align": n,
|
|
4360
4551
|
...a,
|
|
4361
4552
|
children: i
|
|
4362
4553
|
});
|
|
4363
|
-
|
|
4554
|
+
jr.displayName = "Stack", jr.propTypes = {
|
|
4364
4555
|
as: $.default.elementType,
|
|
4365
|
-
gap: $.default.oneOf(
|
|
4366
|
-
align: $.default.oneOf(
|
|
4556
|
+
gap: $.default.oneOf(Mn),
|
|
4557
|
+
align: $.default.oneOf(Nn),
|
|
4367
4558
|
className: $.default.string,
|
|
4368
4559
|
children: $.default.node
|
|
4369
4560
|
};
|
|
4370
4561
|
//#endregion
|
|
4371
4562
|
//#region src/components/Snackbar/Snackbar.jsx
|
|
4372
|
-
var
|
|
4563
|
+
var Mr = ({ severity: e }) => {
|
|
4373
4564
|
let t = e === "success" ? /* @__PURE__ */ p("path", { d: "m6.8 10.1 2.1 2.1 4.4-4.6" }) : e === "info" ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("path", { d: "M10 9v4" }), /* @__PURE__ */ p("path", { d: "M10 6.5h.01" })] }) : e === "warning" ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("path", { d: "M10 6.5v4.2" }), /* @__PURE__ */ p("path", { d: "M10 13.5h.01" })] }) : /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("path", { d: "m7.5 7.5 5 5" }), /* @__PURE__ */ p("path", { d: "m12.5 7.5-5 5" })] });
|
|
4374
4565
|
return /* @__PURE__ */ m("svg", {
|
|
4375
4566
|
viewBox: "0 0 20 20",
|
|
@@ -4386,23 +4577,23 @@ var Er = ({ severity: e }) => {
|
|
|
4386
4577
|
}), t]
|
|
4387
4578
|
});
|
|
4388
4579
|
};
|
|
4389
|
-
function
|
|
4580
|
+
function Nr({ open: e = !1, modelValue: t = void 0, message: n = "", title: r = "", severity: i = "info", variant: a = "standard", autoHideDuration: s = 6e3, anchorOrigin: c = {
|
|
4390
4581
|
vertical: "bottom",
|
|
4391
4582
|
horizontal: "left"
|
|
4392
|
-
}, action: l = "", closable: u = !0, showIcon: f = !0, showProgress:
|
|
4393
|
-
let x = t !== void 0, [
|
|
4583
|
+
}, action: l = "", closable: u = !0, showIcon: f = !0, showProgress: g = !1, onClose: _ = () => {}, onUpdateModelValue: v, onAction: y = () => {}, children: b }) {
|
|
4584
|
+
let { messages: x } = q(), S = t !== void 0, [C, w] = d(S ? t : e), [T, E] = d(100);
|
|
4394
4585
|
o(() => {
|
|
4395
|
-
let n =
|
|
4396
|
-
|
|
4586
|
+
let n = S ? t : e;
|
|
4587
|
+
w(n), n && E(100);
|
|
4397
4588
|
}, [e, t]), o(() => {
|
|
4398
|
-
if (!
|
|
4589
|
+
if (!C || s <= 0) return;
|
|
4399
4590
|
let e = Date.now(), t = setTimeout(() => {
|
|
4400
|
-
|
|
4591
|
+
D();
|
|
4401
4592
|
}, s);
|
|
4402
|
-
if (
|
|
4593
|
+
if (g) {
|
|
4403
4594
|
let n = setInterval(() => {
|
|
4404
4595
|
let t = Date.now() - e, r = Math.max(0, 100 - t / s * 100);
|
|
4405
|
-
|
|
4596
|
+
E(r), r <= 0 && clearInterval(n);
|
|
4406
4597
|
}, 50);
|
|
4407
4598
|
return () => {
|
|
4408
4599
|
clearTimeout(t), clearInterval(n);
|
|
@@ -4410,34 +4601,34 @@ function Dr({ open: e = !1, modelValue: t = void 0, message: n = "", title: r =
|
|
|
4410
4601
|
}
|
|
4411
4602
|
return () => clearTimeout(t);
|
|
4412
4603
|
}, [
|
|
4413
|
-
|
|
4604
|
+
C,
|
|
4414
4605
|
s,
|
|
4415
|
-
|
|
4606
|
+
g
|
|
4416
4607
|
]);
|
|
4417
|
-
let
|
|
4418
|
-
|
|
4419
|
-
},
|
|
4608
|
+
let D = () => {
|
|
4609
|
+
S ? v?.(!1) : w(!1), _();
|
|
4610
|
+
}, O = () => {
|
|
4420
4611
|
y();
|
|
4421
4612
|
};
|
|
4422
|
-
if (!
|
|
4423
|
-
let
|
|
4613
|
+
if (!C) return null;
|
|
4614
|
+
let k = [
|
|
4424
4615
|
"wc-snackbar",
|
|
4425
4616
|
`wc-snackbar--${a}`,
|
|
4426
4617
|
`wc-snackbar--${i}`
|
|
4427
|
-
],
|
|
4618
|
+
], A = {
|
|
4428
4619
|
position: "fixed",
|
|
4429
4620
|
zIndex: 1400
|
|
4430
|
-
}, { vertical:
|
|
4431
|
-
return
|
|
4432
|
-
className:
|
|
4433
|
-
style:
|
|
4621
|
+
}, { vertical: j, horizontal: M } = c;
|
|
4622
|
+
return j === "top" ? A.top = "20px" : A.bottom = "20px", M === "left" ? A.left = "20px" : M === "right" ? A.right = "20px" : (A.left = "50%", A.transform = "translateX(-50%)"), h(/* @__PURE__ */ m("div", {
|
|
4623
|
+
className: k.join(" "),
|
|
4624
|
+
style: A,
|
|
4434
4625
|
role: "alert",
|
|
4435
4626
|
"aria-live": "assertive",
|
|
4436
4627
|
"aria-atomic": "true",
|
|
4437
4628
|
children: [
|
|
4438
4629
|
f && /* @__PURE__ */ p("div", {
|
|
4439
4630
|
className: "wc-snackbar__icon",
|
|
4440
|
-
children: /* @__PURE__ */ p(
|
|
4631
|
+
children: /* @__PURE__ */ p(Mr, { severity: i })
|
|
4441
4632
|
}),
|
|
4442
4633
|
/* @__PURE__ */ m("div", {
|
|
4443
4634
|
className: "wc-snackbar__content",
|
|
@@ -4454,15 +4645,15 @@ function Dr({ open: e = !1, modelValue: t = void 0, message: n = "", title: r =
|
|
|
4454
4645
|
children: b?.action || /* @__PURE__ */ p("button", {
|
|
4455
4646
|
type: "button",
|
|
4456
4647
|
className: "wc-snackbar__action",
|
|
4457
|
-
onClick:
|
|
4648
|
+
onClick: O,
|
|
4458
4649
|
children: l
|
|
4459
4650
|
})
|
|
4460
4651
|
}),
|
|
4461
4652
|
u && /* @__PURE__ */ p("button", {
|
|
4462
4653
|
type: "button",
|
|
4463
4654
|
className: "wc-snackbar__close",
|
|
4464
|
-
"aria-label":
|
|
4465
|
-
onClick:
|
|
4655
|
+
"aria-label": x.close,
|
|
4656
|
+
onClick: D,
|
|
4466
4657
|
children: /* @__PURE__ */ p("svg", {
|
|
4467
4658
|
viewBox: "0 0 20 20",
|
|
4468
4659
|
fill: "none",
|
|
@@ -4473,11 +4664,11 @@ function Dr({ open: e = !1, modelValue: t = void 0, message: n = "", title: r =
|
|
|
4473
4664
|
children: /* @__PURE__ */ p("path", { d: "m6 6 8 8M14 6l-8 8" })
|
|
4474
4665
|
})
|
|
4475
4666
|
}),
|
|
4476
|
-
|
|
4667
|
+
g && s > 0 && /* @__PURE__ */ p("div", {
|
|
4477
4668
|
className: "wc-snackbar__progress",
|
|
4478
4669
|
children: /* @__PURE__ */ p("div", {
|
|
4479
4670
|
className: "wc-snackbar__progress-bar",
|
|
4480
|
-
style: { width: `${
|
|
4671
|
+
style: { width: `${T}%` }
|
|
4481
4672
|
})
|
|
4482
4673
|
})
|
|
4483
4674
|
]
|
|
@@ -4485,7 +4676,7 @@ function Dr({ open: e = !1, modelValue: t = void 0, message: n = "", title: r =
|
|
|
4485
4676
|
}
|
|
4486
4677
|
//#endregion
|
|
4487
4678
|
//#region ../core/src/components/Status/utils.js
|
|
4488
|
-
var
|
|
4679
|
+
var Pr = [
|
|
4489
4680
|
"default",
|
|
4490
4681
|
"success",
|
|
4491
4682
|
"error",
|
|
@@ -4494,7 +4685,7 @@ var Or = [
|
|
|
4494
4685
|
"pending",
|
|
4495
4686
|
"processing",
|
|
4496
4687
|
"cancelled"
|
|
4497
|
-
],
|
|
4688
|
+
], Fr = [
|
|
4498
4689
|
"auto",
|
|
4499
4690
|
"pulse",
|
|
4500
4691
|
"spin",
|
|
@@ -4504,7 +4695,7 @@ var Or = [
|
|
|
4504
4695
|
"breathe",
|
|
4505
4696
|
"ripple",
|
|
4506
4697
|
"glow"
|
|
4507
|
-
],
|
|
4698
|
+
], Ir = {
|
|
4508
4699
|
default: {
|
|
4509
4700
|
text: "默认",
|
|
4510
4701
|
color: "var(--wc-text-tertiary)"
|
|
@@ -4538,29 +4729,29 @@ var Or = [
|
|
|
4538
4729
|
color: "var(--wc-text-disabled)"
|
|
4539
4730
|
}
|
|
4540
4731
|
};
|
|
4541
|
-
function
|
|
4542
|
-
return
|
|
4732
|
+
function Lr(e) {
|
|
4733
|
+
return Pr.includes(e);
|
|
4543
4734
|
}
|
|
4544
|
-
function
|
|
4545
|
-
return
|
|
4735
|
+
function Rr(e) {
|
|
4736
|
+
return Lr(e) ? e : "default";
|
|
4546
4737
|
}
|
|
4547
|
-
function
|
|
4548
|
-
let o =
|
|
4738
|
+
function zr({ status: e, size: t, showText: n, animated: r, animationType: i = "auto", className: a }) {
|
|
4739
|
+
let o = Rr(e), s = [
|
|
4549
4740
|
"wc-status",
|
|
4550
4741
|
`wc-status--${o}`,
|
|
4551
4742
|
`wc-status--${t}`
|
|
4552
4743
|
];
|
|
4553
4744
|
if (n && s.push("wc-status--with-text"), r) {
|
|
4554
|
-
let e =
|
|
4745
|
+
let e = Vr(o, i);
|
|
4555
4746
|
s.push("wc-status--animated", `wc-status--${e}`);
|
|
4556
4747
|
}
|
|
4557
4748
|
return a && s.push(a), s.filter(Boolean).join(" ");
|
|
4558
4749
|
}
|
|
4559
|
-
function
|
|
4560
|
-
return
|
|
4750
|
+
function Br(e) {
|
|
4751
|
+
return Ir[e]?.text || Ir.default.text;
|
|
4561
4752
|
}
|
|
4562
|
-
function
|
|
4563
|
-
return t !== "auto" &&
|
|
4753
|
+
function Vr(e, t = "auto") {
|
|
4754
|
+
return t !== "auto" && Fr.includes(t) ? t : {
|
|
4564
4755
|
processing: "spin",
|
|
4565
4756
|
pending: "pulse",
|
|
4566
4757
|
success: "bounce",
|
|
@@ -4573,17 +4764,18 @@ function Fr(e, t = "auto") {
|
|
|
4573
4764
|
}
|
|
4574
4765
|
//#endregion
|
|
4575
4766
|
//#region src/components/Status/Status.jsx
|
|
4576
|
-
var
|
|
4577
|
-
let s =
|
|
4767
|
+
var Hr = ({ status: e = "default", size: t = "md", showText: n = !1, animated: r = !1, animationType: i = "auto", className: a = "", ...o }) => {
|
|
4768
|
+
let s = zr({
|
|
4578
4769
|
status: e,
|
|
4579
4770
|
size: t,
|
|
4580
4771
|
showText: n,
|
|
4581
4772
|
animated: r,
|
|
4582
4773
|
animationType: i,
|
|
4583
4774
|
className: a
|
|
4584
|
-
}), c =
|
|
4775
|
+
}), c = Br(e);
|
|
4585
4776
|
return /* @__PURE__ */ p("span", {
|
|
4586
4777
|
className: s,
|
|
4778
|
+
role: "status",
|
|
4587
4779
|
title: c,
|
|
4588
4780
|
"aria-label": c,
|
|
4589
4781
|
...o,
|
|
@@ -4593,11 +4785,11 @@ var Ir = ({ status: e = "default", size: t = "md", showText: n = !1, animated: r
|
|
|
4593
4785
|
})
|
|
4594
4786
|
});
|
|
4595
4787
|
};
|
|
4596
|
-
|
|
4788
|
+
Hr.displayName = "Status";
|
|
4597
4789
|
//#endregion
|
|
4598
4790
|
//#region src/components/Switch/Switch.jsx
|
|
4599
|
-
var
|
|
4600
|
-
let d =
|
|
4791
|
+
var Ur = ({ checked: e = !1, onChange: t, label: n = "", description: r = "", disabled: i = !1, required: a = !1, color: o = "primary", size: c = "md", className: l = "", ...u }) => {
|
|
4792
|
+
let { messages: d } = q(), f = s(), h = `${f}-input`, g = [
|
|
4601
4793
|
"primary",
|
|
4602
4794
|
"success",
|
|
4603
4795
|
"warning",
|
|
@@ -4606,24 +4798,24 @@ var Lr = ({ checked: e = !1, onChange: t, label: n = "", description: r = "", di
|
|
|
4606
4798
|
"orange",
|
|
4607
4799
|
"cyan",
|
|
4608
4800
|
"pink"
|
|
4609
|
-
].includes(o) ? o : "primary",
|
|
4801
|
+
].includes(o) ? o : "primary", _ = [
|
|
4610
4802
|
"sm",
|
|
4611
4803
|
"md",
|
|
4612
4804
|
"lg"
|
|
4613
|
-
].includes(c) ? c : "md",
|
|
4805
|
+
].includes(c) ? c : "md", v = [
|
|
4614
4806
|
"wc-switch",
|
|
4615
|
-
`wc-switch--${
|
|
4616
|
-
|
|
4807
|
+
`wc-switch--${g}`,
|
|
4808
|
+
_ !== "md" && `wc-switch--${_}`,
|
|
4617
4809
|
i && "wc-switch--disabled",
|
|
4618
4810
|
l
|
|
4619
|
-
].filter(Boolean).join(" "),
|
|
4811
|
+
].filter(Boolean).join(" "), y = (e) => {
|
|
4620
4812
|
i || !t || t(e.target.checked);
|
|
4621
4813
|
};
|
|
4622
4814
|
return /* @__PURE__ */ m("div", {
|
|
4623
4815
|
className: "wc-switch-wrapper",
|
|
4624
4816
|
children: [n && /* @__PURE__ */ m("label", {
|
|
4625
|
-
id:
|
|
4626
|
-
htmlFor:
|
|
4817
|
+
id: f,
|
|
4818
|
+
htmlFor: h,
|
|
4627
4819
|
className: "wc-switch__label",
|
|
4628
4820
|
children: [n, a && /* @__PURE__ */ p("span", {
|
|
4629
4821
|
className: "wc-switch__required",
|
|
@@ -4632,19 +4824,20 @@ var Lr = ({ checked: e = !1, onChange: t, label: n = "", description: r = "", di
|
|
|
4632
4824
|
}), /* @__PURE__ */ m("div", {
|
|
4633
4825
|
className: "wc-switch__container",
|
|
4634
4826
|
children: [/* @__PURE__ */ m("label", {
|
|
4635
|
-
className:
|
|
4827
|
+
className: v,
|
|
4636
4828
|
"aria-disabled": i,
|
|
4637
4829
|
children: [/* @__PURE__ */ p("input", {
|
|
4638
4830
|
type: "checkbox",
|
|
4639
|
-
id:
|
|
4831
|
+
id: h,
|
|
4640
4832
|
className: "wc-switch__input",
|
|
4641
4833
|
checked: e,
|
|
4642
4834
|
disabled: i,
|
|
4643
|
-
"aria-labelledby": n ?
|
|
4835
|
+
"aria-labelledby": n ? f : void 0,
|
|
4836
|
+
"aria-label": n ? void 0 : d.switchControl,
|
|
4644
4837
|
"aria-checked": e,
|
|
4645
4838
|
required: a,
|
|
4646
4839
|
role: "switch",
|
|
4647
|
-
onChange:
|
|
4840
|
+
onChange: y,
|
|
4648
4841
|
...u
|
|
4649
4842
|
}), /* @__PURE__ */ p("span", {
|
|
4650
4843
|
className: "wc-switch__track",
|
|
@@ -4657,20 +4850,20 @@ var Lr = ({ checked: e = !1, onChange: t, label: n = "", description: r = "", di
|
|
|
4657
4850
|
})]
|
|
4658
4851
|
});
|
|
4659
4852
|
};
|
|
4660
|
-
|
|
4853
|
+
Ur.displayName = "Switch";
|
|
4661
4854
|
//#endregion
|
|
4662
4855
|
//#region src/components/Table/Table.jsx
|
|
4663
|
-
var
|
|
4856
|
+
var Wr = n({
|
|
4664
4857
|
size: "md",
|
|
4665
4858
|
dense: !1,
|
|
4666
4859
|
hover: !1,
|
|
4667
4860
|
striped: !1
|
|
4668
|
-
}),
|
|
4861
|
+
}), Gr = ({ size: e = "md", stickyHeader: t = !1, dense: n = !1, hover: r = !1, striped: i = !1, children: a, className: o = "", ...s }) => /* @__PURE__ */ p("div", {
|
|
4669
4862
|
className: `wc-table-container${t ? " wc-table-container--sticky" : ""} ${o}`,
|
|
4670
4863
|
...s,
|
|
4671
4864
|
children: /* @__PURE__ */ p("table", {
|
|
4672
4865
|
className: `wc-table wc-table--${e}${r ? " wc-table--hover" : ""}${i ? " wc-table--striped" : ""}${n ? " wc-table--dense" : ""}`,
|
|
4673
|
-
children: /* @__PURE__ */ p(
|
|
4866
|
+
children: /* @__PURE__ */ p(Wr.Provider, {
|
|
4674
4867
|
value: {
|
|
4675
4868
|
size: e,
|
|
4676
4869
|
dense: n,
|
|
@@ -4682,24 +4875,24 @@ var Rr = n({
|
|
|
4682
4875
|
})
|
|
4683
4876
|
})
|
|
4684
4877
|
});
|
|
4685
|
-
|
|
4686
|
-
var
|
|
4687
|
-
let { stickyHeader: r } = a(
|
|
4878
|
+
Gr.displayName = "Table";
|
|
4879
|
+
var Kr = ({ children: e, className: t = "", ...n }) => {
|
|
4880
|
+
let { stickyHeader: r } = a(Wr);
|
|
4688
4881
|
return /* @__PURE__ */ p("thead", {
|
|
4689
4882
|
className: `wc-table-head${r ? " wc-table-head--sticky" : ""} ${t}`,
|
|
4690
4883
|
...n,
|
|
4691
4884
|
children: e
|
|
4692
4885
|
});
|
|
4693
4886
|
};
|
|
4694
|
-
|
|
4695
|
-
var
|
|
4887
|
+
Kr.displayName = "TableHead";
|
|
4888
|
+
var qr = ({ children: e, className: t = "", ...n }) => /* @__PURE__ */ p("tbody", {
|
|
4696
4889
|
className: `wc-table-body ${t}`,
|
|
4697
4890
|
...n,
|
|
4698
4891
|
children: e
|
|
4699
4892
|
});
|
|
4700
|
-
|
|
4701
|
-
var
|
|
4702
|
-
let c = a(
|
|
4893
|
+
qr.displayName = "TableBody";
|
|
4894
|
+
var Jr = ({ hover: e, selected: t = !1, clickable: n = !1, children: r, className: i = "", onClick: o, ...s }) => {
|
|
4895
|
+
let c = a(Wr);
|
|
4703
4896
|
return /* @__PURE__ */ p("tr", {
|
|
4704
4897
|
className: [
|
|
4705
4898
|
"wc-table-row",
|
|
@@ -4713,9 +4906,9 @@ var Hr = ({ hover: e, selected: t = !1, clickable: n = !1, children: r, classNam
|
|
|
4713
4906
|
children: r
|
|
4714
4907
|
});
|
|
4715
4908
|
};
|
|
4716
|
-
|
|
4717
|
-
var
|
|
4718
|
-
let d = a(
|
|
4909
|
+
Jr.displayName = "TableRow";
|
|
4910
|
+
var Yr = ({ component: e = "td", align: t = "inherit", padding: n = "normal", size: r, sortDirection: i = !1, variant: o = "body", scope: s, children: c, className: l = "", ...u }) => {
|
|
4911
|
+
let d = a(Wr), f = r || (d.dense ? "small" : "medium");
|
|
4719
4912
|
return /* @__PURE__ */ p(e, {
|
|
4720
4913
|
className: [
|
|
4721
4914
|
"wc-table-cell",
|
|
@@ -4732,29 +4925,29 @@ var Ur = ({ component: e = "td", align: t = "inherit", padding: n = "normal", si
|
|
|
4732
4925
|
children: c
|
|
4733
4926
|
});
|
|
4734
4927
|
};
|
|
4735
|
-
|
|
4736
|
-
var
|
|
4737
|
-
Head:
|
|
4738
|
-
Body:
|
|
4739
|
-
Row:
|
|
4740
|
-
Cell:
|
|
4741
|
-
}),
|
|
4742
|
-
let l = s(),
|
|
4928
|
+
Yr.displayName = "TableCell";
|
|
4929
|
+
var Xr = Object.assign(Gr, {
|
|
4930
|
+
Head: Kr,
|
|
4931
|
+
Body: qr,
|
|
4932
|
+
Row: Jr,
|
|
4933
|
+
Cell: Yr
|
|
4934
|
+
}), Zr = ({ tabs: e = [], activeIndex: t, onChange: n, variant: r = "default", children: i, className: a = "", ...c }) => {
|
|
4935
|
+
let l = s(), { messages: u } = q(), [f, h] = d(t || 0), g = t !== void 0, _ = g ? t : f;
|
|
4743
4936
|
o(() => {
|
|
4744
|
-
|
|
4745
|
-
}, [t,
|
|
4746
|
-
let
|
|
4937
|
+
g && h(t);
|
|
4938
|
+
}, [t, g]);
|
|
4939
|
+
let v = [
|
|
4747
4940
|
"wc-tabs",
|
|
4748
4941
|
r === "pills" && "wc-tabs--pills",
|
|
4749
4942
|
r === "underline" && "wc-tabs--underline",
|
|
4750
4943
|
(r === "default" || !["pills", "underline"].includes(r)) && "wc-tabs--default",
|
|
4751
4944
|
a
|
|
4752
|
-
].filter(Boolean).join(" "),
|
|
4945
|
+
].filter(Boolean).join(" "), y = (e, t) => {
|
|
4753
4946
|
let n = ["wc-tab"];
|
|
4754
|
-
return
|
|
4755
|
-
},
|
|
4756
|
-
t.disabled || (
|
|
4757
|
-
},
|
|
4947
|
+
return _ === e && n.push("wc-tab--active"), n.join(" ");
|
|
4948
|
+
}, b = (e, t) => {
|
|
4949
|
+
t.disabled || (g || h(e), n && n(e, t));
|
|
4950
|
+
}, x = e[_], S = (t, n) => {
|
|
4758
4951
|
if (![
|
|
4759
4952
|
"ArrowLeft",
|
|
4760
4953
|
"ArrowRight",
|
|
@@ -4765,25 +4958,25 @@ var Wr = Object.assign(zr, {
|
|
|
4765
4958
|
let r = e.map((e, t) => e.disabled ? -1 : t).filter((e) => e >= 0);
|
|
4766
4959
|
if (!r.length) return;
|
|
4767
4960
|
let i = r.indexOf(n), a;
|
|
4768
|
-
a = t.key === "Home" ? r[0] : t.key === "End" ? r[r.length - 1] : t.key === "ArrowRight" ? r[(i + 1) % r.length] : r[(i - 1 + r.length) % r.length],
|
|
4961
|
+
a = t.key === "Home" ? r[0] : t.key === "End" ? r[r.length - 1] : t.key === "ArrowRight" ? r[(i + 1) % r.length] : r[(i - 1 + r.length) % r.length], b(a, e[a]), t.currentTarget.parentElement?.querySelectorAll("[role=\"tab\"]")[a]?.focus();
|
|
4769
4962
|
};
|
|
4770
4963
|
return /* @__PURE__ */ m("div", {
|
|
4771
4964
|
className: "wc-tabs-wrapper",
|
|
4772
4965
|
...c,
|
|
4773
4966
|
children: [/* @__PURE__ */ p("div", {
|
|
4774
|
-
className:
|
|
4967
|
+
className: v,
|
|
4775
4968
|
role: "tablist",
|
|
4776
|
-
"aria-label":
|
|
4969
|
+
"aria-label": u.tabList,
|
|
4777
4970
|
children: e.map((e, t) => /* @__PURE__ */ p("button", {
|
|
4778
|
-
className:
|
|
4779
|
-
onClick: () =>
|
|
4780
|
-
onKeyDown: (e) =>
|
|
4971
|
+
className: y(t, e.disabled),
|
|
4972
|
+
onClick: () => b(t, e),
|
|
4973
|
+
onKeyDown: (e) => S(e, t),
|
|
4781
4974
|
disabled: e.disabled,
|
|
4782
4975
|
id: `${l}-tab-${t}`,
|
|
4783
4976
|
role: "tab",
|
|
4784
|
-
"aria-selected":
|
|
4977
|
+
"aria-selected": _ === t,
|
|
4785
4978
|
"aria-controls": `${l}-panel`,
|
|
4786
|
-
tabIndex:
|
|
4979
|
+
tabIndex: _ === t ? 0 : -1,
|
|
4787
4980
|
type: "button",
|
|
4788
4981
|
children: e.title
|
|
4789
4982
|
}, e.key || t))
|
|
@@ -4791,18 +4984,18 @@ var Wr = Object.assign(zr, {
|
|
|
4791
4984
|
id: `${l}-panel`,
|
|
4792
4985
|
className: "wc-tab-content",
|
|
4793
4986
|
role: "tabpanel",
|
|
4794
|
-
"aria-labelledby": `${l}-tab-${
|
|
4987
|
+
"aria-labelledby": `${l}-tab-${_}`,
|
|
4795
4988
|
children: typeof i == "function" ? i({
|
|
4796
|
-
activeTab:
|
|
4797
|
-
activeIndex:
|
|
4989
|
+
activeTab: x,
|
|
4990
|
+
activeIndex: _
|
|
4798
4991
|
}) : i
|
|
4799
4992
|
})]
|
|
4800
4993
|
});
|
|
4801
4994
|
};
|
|
4802
|
-
|
|
4995
|
+
Zr.displayName = "Tabs";
|
|
4803
4996
|
//#endregion
|
|
4804
4997
|
//#region src/components/TextField/TextField.jsx
|
|
4805
|
-
var
|
|
4998
|
+
var Qr = ({ value: e = "", onChange: t, type: n = "text", label: r = "", placeholder: i = "", helperText: a = "", error: s = "", required: c = !1, disabled: l = !1, readonly: u = !1, autoFocus: f = !1, fullWidth: h = !1, multiline: g = !1, rows: _ = 4, maxRows: v, minRows: y, variant: b = "filled", size: x = "md", color: S = "primary", startAdornment: C = null, endAdornment: w = null, maxLength: T, minLength: E, pattern: D, autoComplete: O = "off", name: k = "", id: A = "", className: j = "", style: M = {}, onFocus: N, onBlur: P, onKeyDown: F, onKeyUp: I, onKeyPress: L, ...R }) => {
|
|
4806
4999
|
let [z, B] = d(!1), [V, H] = d(!!e);
|
|
4807
5000
|
o(() => {
|
|
4808
5001
|
H(!!e);
|
|
@@ -4812,45 +5005,45 @@ var Kr = ({ value: e = "", onChange: t, type: n = "text", label: r = "", placeho
|
|
|
4812
5005
|
H(!!n), t?.(e);
|
|
4813
5006
|
}, W = (e) => {
|
|
4814
5007
|
B(!0), N?.(e);
|
|
4815
|
-
},
|
|
5008
|
+
}, ee = (e) => {
|
|
4816
5009
|
B(!1), P?.(e);
|
|
4817
|
-
},
|
|
5010
|
+
}, te = () => {
|
|
4818
5011
|
let e = ["wc-textfield"];
|
|
4819
5012
|
return h && e.push("wc-textfield--full-width"), g && e.push("wc-textfield--multiline"), j && e.push(j), e.filter(Boolean).join(" ");
|
|
4820
|
-
},
|
|
5013
|
+
}, ne = () => {
|
|
4821
5014
|
let e = ["wc-textfield__container"];
|
|
4822
5015
|
return e.push(`wc-textfield__container--${b}`), e.push(`wc-textfield__container--${x}`), s && e.push("wc-textfield__container--error"), l && e.push("wc-textfield__container--disabled"), z && e.push("wc-textfield__container--focused"), V && e.push("wc-textfield__container--has-value"), e.filter(Boolean).join(" ");
|
|
4823
|
-
},
|
|
5016
|
+
}, re = () => {
|
|
4824
5017
|
let e = ["wc-textfield__label"];
|
|
4825
5018
|
return e.push(`wc-textfield__label--${x}`), s && e.push("wc-textfield__label--error"), z && e.push("wc-textfield__label--focused"), e.filter(Boolean).join(" ");
|
|
4826
|
-
},
|
|
5019
|
+
}, G = g ? "textarea" : "input", K = A || k || `textfield-${Math.random().toString(36).substr(2, 9)}`, q = !!s;
|
|
4827
5020
|
return /* @__PURE__ */ m("div", {
|
|
4828
|
-
className:
|
|
5021
|
+
className: te(),
|
|
4829
5022
|
style: M,
|
|
4830
5023
|
children: [
|
|
4831
5024
|
r && /* @__PURE__ */ m("label", {
|
|
4832
|
-
htmlFor:
|
|
4833
|
-
className:
|
|
5025
|
+
htmlFor: K,
|
|
5026
|
+
className: re(),
|
|
4834
5027
|
children: [r, c && /* @__PURE__ */ p("span", {
|
|
4835
5028
|
className: "wc-textfield__required",
|
|
4836
5029
|
children: "*"
|
|
4837
5030
|
})]
|
|
4838
5031
|
}),
|
|
4839
5032
|
/* @__PURE__ */ m("div", {
|
|
4840
|
-
className:
|
|
5033
|
+
className: ne(),
|
|
4841
5034
|
children: [
|
|
4842
5035
|
C && /* @__PURE__ */ p("div", {
|
|
4843
5036
|
className: "wc-textfield__adornment wc-textfield__adornment--start",
|
|
4844
5037
|
children: C
|
|
4845
5038
|
}),
|
|
4846
|
-
/* @__PURE__ */ p(
|
|
5039
|
+
/* @__PURE__ */ p(G, {
|
|
4847
5040
|
className: g ? "wc-textfield__input wc-textfield__textarea" : "wc-textfield__input",
|
|
4848
|
-
id:
|
|
5041
|
+
id: K,
|
|
4849
5042
|
type: g ? void 0 : n,
|
|
4850
5043
|
value: e,
|
|
4851
5044
|
onChange: U,
|
|
4852
5045
|
onFocus: W,
|
|
4853
|
-
onBlur:
|
|
5046
|
+
onBlur: ee,
|
|
4854
5047
|
onKeyDown: F,
|
|
4855
5048
|
onKeyUp: I,
|
|
4856
5049
|
onKeyPress: L,
|
|
@@ -4867,9 +5060,9 @@ var Kr = ({ value: e = "", onChange: t, type: n = "text", label: r = "", placeho
|
|
|
4867
5060
|
name: k,
|
|
4868
5061
|
...R
|
|
4869
5062
|
}),
|
|
4870
|
-
(w ||
|
|
5063
|
+
(w || q) && /* @__PURE__ */ m("div", {
|
|
4871
5064
|
className: "wc-textfield__adornment wc-textfield__adornment--end",
|
|
4872
|
-
children: [
|
|
5065
|
+
children: [q && /* @__PURE__ */ p("svg", {
|
|
4873
5066
|
className: "wc-textfield__error-icon",
|
|
4874
5067
|
fill: "currentColor",
|
|
4875
5068
|
viewBox: "0 0 20 20",
|
|
@@ -4882,68 +5075,76 @@ var Kr = ({ value: e = "", onChange: t, type: n = "text", label: r = "", placeho
|
|
|
4882
5075
|
})
|
|
4883
5076
|
]
|
|
4884
5077
|
}),
|
|
4885
|
-
(a ||
|
|
4886
|
-
className: `wc-textfield__helper-text ${
|
|
4887
|
-
children:
|
|
5078
|
+
(a || q) && /* @__PURE__ */ p("div", {
|
|
5079
|
+
className: `wc-textfield__helper-text ${q ? "wc-textfield__helper-text--error" : ""}`,
|
|
5080
|
+
children: q ? s : a
|
|
4888
5081
|
})
|
|
4889
5082
|
]
|
|
4890
5083
|
});
|
|
4891
5084
|
};
|
|
4892
|
-
|
|
5085
|
+
Qr.displayName = "TextField";
|
|
4893
5086
|
//#endregion
|
|
4894
5087
|
//#region ../core/src/components/Toolbar/utils.js
|
|
4895
|
-
var
|
|
5088
|
+
var $r = (e, t, n = "") => {
|
|
4896
5089
|
let r = ["flex items-center w-full"];
|
|
4897
5090
|
return e === "dense" ? r.push("min-h-12 py-2") : r.push("min-h-16 py-3"), t || r.push("px-4 sm:px-6 lg:px-8"), n && r.push(n), r.join(" ");
|
|
4898
|
-
},
|
|
4899
|
-
className:
|
|
5091
|
+
}, ei = ({ children: e, variant: t = "regular", disableGutters: n = !1, className: r = "", style: i = {}, ...a }) => /* @__PURE__ */ p("div", {
|
|
5092
|
+
className: $r(t, n, r),
|
|
4900
5093
|
style: i,
|
|
4901
5094
|
...a,
|
|
4902
5095
|
children: e
|
|
4903
|
-
}),
|
|
5096
|
+
}), ti = {
|
|
4904
5097
|
top: "wc-tooltip--top",
|
|
4905
5098
|
bottom: "wc-tooltip--bottom",
|
|
4906
5099
|
left: "wc-tooltip--left",
|
|
4907
5100
|
right: "wc-tooltip--right"
|
|
4908
|
-
},
|
|
5101
|
+
}, ni = [
|
|
4909
5102
|
"top",
|
|
4910
5103
|
"bottom",
|
|
4911
5104
|
"left",
|
|
4912
5105
|
"right"
|
|
4913
5106
|
];
|
|
4914
|
-
function
|
|
4915
|
-
return
|
|
5107
|
+
function ri(e) {
|
|
5108
|
+
return ni.includes(e);
|
|
4916
5109
|
}
|
|
4917
|
-
function
|
|
4918
|
-
return
|
|
5110
|
+
function ii(e) {
|
|
5111
|
+
return ti[e] || ti.top;
|
|
4919
5112
|
}
|
|
4920
5113
|
//#endregion
|
|
4921
5114
|
//#region src/components/Tooltip/Tooltip.jsx
|
|
4922
|
-
function
|
|
4923
|
-
|
|
4924
|
-
let [i, a] = d(!1), o = s(), c =
|
|
5115
|
+
function ai({ text: e, placement: t = "top", children: n, className: r = "" }) {
|
|
5116
|
+
ri(t) || console.warn(`Invalid tooltip placement: ${t}. Using 'top' as default.`);
|
|
5117
|
+
let [i, a] = d(!1), o = s(), c = u(null), l = u(null), f = ii(ce({
|
|
5118
|
+
open: i,
|
|
5119
|
+
anchorRef: c,
|
|
5120
|
+
floatingRef: l,
|
|
5121
|
+
placement: t,
|
|
5122
|
+
offset: 8
|
|
5123
|
+
})), h = () => {
|
|
4925
5124
|
a(!0);
|
|
4926
|
-
},
|
|
5125
|
+
}, g = () => {
|
|
4927
5126
|
a(!1);
|
|
4928
5127
|
};
|
|
4929
5128
|
return /* @__PURE__ */ m("span", {
|
|
5129
|
+
ref: c,
|
|
4930
5130
|
className: `wc-tooltip-wrapper ${r}`.trim(),
|
|
4931
5131
|
"aria-describedby": i ? o : void 0,
|
|
4932
|
-
onMouseEnter:
|
|
4933
|
-
onMouseLeave:
|
|
4934
|
-
onFocus:
|
|
4935
|
-
onBlur:
|
|
4936
|
-
children: [n, i && /* @__PURE__ */ p("div", {
|
|
5132
|
+
onMouseEnter: h,
|
|
5133
|
+
onMouseLeave: g,
|
|
5134
|
+
onFocus: h,
|
|
5135
|
+
onBlur: g,
|
|
5136
|
+
children: [n, i && /* @__PURE__ */ p(oe, { children: /* @__PURE__ */ p("div", {
|
|
5137
|
+
ref: l,
|
|
4937
5138
|
id: o,
|
|
4938
|
-
className: `wc-tooltip ${
|
|
5139
|
+
className: `wc-tooltip ${f}`,
|
|
4939
5140
|
role: "tooltip",
|
|
4940
5141
|
children: e
|
|
4941
|
-
})]
|
|
5142
|
+
}) })]
|
|
4942
5143
|
});
|
|
4943
5144
|
}
|
|
4944
5145
|
//#endregion
|
|
4945
5146
|
//#region ../core/src/components/Typography/utils.js
|
|
4946
|
-
var
|
|
5147
|
+
var oi = {
|
|
4947
5148
|
h1: "h1",
|
|
4948
5149
|
h2: "h2",
|
|
4949
5150
|
h3: "h3",
|
|
@@ -4957,7 +5158,7 @@ var ei = {
|
|
|
4957
5158
|
caption: "span",
|
|
4958
5159
|
overline: "span",
|
|
4959
5160
|
button: "span"
|
|
4960
|
-
},
|
|
5161
|
+
}, si = {
|
|
4961
5162
|
h1: "wc-typography--h1",
|
|
4962
5163
|
h2: "wc-typography--h2",
|
|
4963
5164
|
h3: "wc-typography--h3",
|
|
@@ -4971,7 +5172,7 @@ var ei = {
|
|
|
4971
5172
|
caption: "wc-typography--caption",
|
|
4972
5173
|
overline: "wc-typography--overline",
|
|
4973
5174
|
button: "wc-typography--button"
|
|
4974
|
-
},
|
|
5175
|
+
}, ci = {
|
|
4975
5176
|
inherit: "wc-typography--color-inherit",
|
|
4976
5177
|
primary: "wc-typography--color-primary",
|
|
4977
5178
|
secondary: "wc-typography--color-secondary",
|
|
@@ -4981,12 +5182,12 @@ var ei = {
|
|
|
4981
5182
|
textPrimary: "wc-typography--color-text-primary",
|
|
4982
5183
|
textSecondary: "wc-typography--color-text-secondary",
|
|
4983
5184
|
textDisabled: "wc-typography--color-text-disabled"
|
|
4984
|
-
},
|
|
5185
|
+
}, li = {
|
|
4985
5186
|
left: "wc-typography--align-left",
|
|
4986
5187
|
center: "wc-typography--align-center",
|
|
4987
5188
|
right: "wc-typography--align-right",
|
|
4988
5189
|
justify: "wc-typography--align-justify"
|
|
4989
|
-
},
|
|
5190
|
+
}, ui = {
|
|
4990
5191
|
h1: "1.2",
|
|
4991
5192
|
h2: "1.2",
|
|
4992
5193
|
h3: "1.3",
|
|
@@ -5001,15 +5202,15 @@ var ei = {
|
|
|
5001
5202
|
overline: "1.4",
|
|
5002
5203
|
button: "1.4"
|
|
5003
5204
|
};
|
|
5004
|
-
function
|
|
5005
|
-
return t ||
|
|
5205
|
+
function di(e, t) {
|
|
5206
|
+
return t || oi[e] || "p";
|
|
5006
5207
|
}
|
|
5007
|
-
function
|
|
5208
|
+
function fi(e, t, n, r, i, a = "") {
|
|
5008
5209
|
return [
|
|
5009
5210
|
"wc-typography",
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
n === "inherit" ? null :
|
|
5211
|
+
si[e],
|
|
5212
|
+
ci[t],
|
|
5213
|
+
n === "inherit" ? null : li[n],
|
|
5013
5214
|
r ? "wc-typography--gutter-bottom" : null,
|
|
5014
5215
|
i ? "wc-typography--no-wrap" : null,
|
|
5015
5216
|
a
|
|
@@ -5017,19 +5218,19 @@ function oi(e, t, n, r, i, a = "") {
|
|
|
5017
5218
|
}
|
|
5018
5219
|
//#endregion
|
|
5019
5220
|
//#region src/components/Typography/Typography.jsx
|
|
5020
|
-
var
|
|
5021
|
-
className:
|
|
5221
|
+
var pi = ({ variant: e = "body1", component: t, color: n = "inherit", align: r = "inherit", gutterBottom: i = !1, noWrap: a = !1, children: o, className: s = "", style: c = {}, ...l }) => /* @__PURE__ */ p(di(e, t), {
|
|
5222
|
+
className: fi(e, n, r, i, a, s),
|
|
5022
5223
|
style: {
|
|
5023
|
-
lineHeight:
|
|
5224
|
+
lineHeight: ui[e],
|
|
5024
5225
|
...c
|
|
5025
5226
|
},
|
|
5026
5227
|
...l,
|
|
5027
5228
|
children: o
|
|
5028
5229
|
});
|
|
5029
|
-
|
|
5230
|
+
pi.displayName = "Typography";
|
|
5030
5231
|
//#endregion
|
|
5031
5232
|
//#region ../core/src/components/TypingText/utils.jsx
|
|
5032
|
-
var
|
|
5233
|
+
var mi = class {
|
|
5033
5234
|
constructor(e, t = {}) {
|
|
5034
5235
|
this.text = e, this.speed = t.speed || 100, this.pause = t.pause || 1500, this.loop = t.loop || !1, this.erase = t.erase || !1, this.index = 0, this.direction = 1, this.timer = null, this.onUpdate = t.onUpdate || (() => {});
|
|
5035
5236
|
}
|
|
@@ -5050,9 +5251,9 @@ var ci = class {
|
|
|
5050
5251
|
updateText(e) {
|
|
5051
5252
|
this.text = e, this.reset(), this.start();
|
|
5052
5253
|
}
|
|
5053
|
-
},
|
|
5254
|
+
}, hi = ({ text: e = "Hello, Watercolor UI!", speed: t = 100, pause: n = 1500, loop: r = !1, erase: i = !1, showCursor: a = !0, className: s = "", style: c = {}, ...l }) => {
|
|
5054
5255
|
let [f, h] = d(""), g = u(null);
|
|
5055
|
-
return o(() => (g.current = new
|
|
5256
|
+
return o(() => (g.current = new mi(e, {
|
|
5056
5257
|
speed: t,
|
|
5057
5258
|
pause: n,
|
|
5058
5259
|
loop: r,
|
|
@@ -5076,29 +5277,29 @@ var ci = class {
|
|
|
5076
5277
|
}), a && /* @__PURE__ */ p("span", { className: "typing-cursor" })]
|
|
5077
5278
|
});
|
|
5078
5279
|
};
|
|
5079
|
-
|
|
5280
|
+
hi.displayName = "TypingText";
|
|
5080
5281
|
//#endregion
|
|
5081
5282
|
//#region src/components/Input/VerificationCodeInput.jsx
|
|
5082
|
-
var
|
|
5083
|
-
let c = u([]);
|
|
5283
|
+
var gi = ({ length: e = 6, value: t = "", onChange: n, onComplete: r, autoFocus: i = !1, className: a = "", ...s }) => {
|
|
5284
|
+
let { messages: c } = q(), l = u([]);
|
|
5084
5285
|
o(() => {
|
|
5085
5286
|
typeof t == "string" && t.split("").forEach((e, t) => {
|
|
5086
|
-
|
|
5287
|
+
l.current[t] && (l.current[t].value = e);
|
|
5087
5288
|
});
|
|
5088
5289
|
}, [t]), o(() => {
|
|
5089
|
-
i &&
|
|
5290
|
+
i && l.current[0] && l.current[0].focus();
|
|
5090
5291
|
}, [i]);
|
|
5091
|
-
let
|
|
5092
|
-
let t =
|
|
5292
|
+
let d = (e) => {
|
|
5293
|
+
let t = l.current[e];
|
|
5093
5294
|
t && t.focus();
|
|
5094
|
-
},
|
|
5295
|
+
}, f = () => l.current.map((e) => e ? e.value : "").join(""), m = (t) => (i) => {
|
|
5095
5296
|
let a = i.target.value.replace(/[^0-9a-zA-Z]/g, "");
|
|
5096
5297
|
i.target.value = a.toUpperCase();
|
|
5097
|
-
let o =
|
|
5098
|
-
n?.(o), a && t < e - 1 &&
|
|
5099
|
-
},
|
|
5100
|
-
t.key === "Backspace" && !t.target.value && e > 0 && (t.preventDefault(),
|
|
5101
|
-
},
|
|
5298
|
+
let o = f();
|
|
5299
|
+
n?.(o), a && t < e - 1 && d(t + 1), o.length === e && r?.(o);
|
|
5300
|
+
}, h = (e) => (t) => {
|
|
5301
|
+
t.key === "Backspace" && !t.target.value && e > 0 && (t.preventDefault(), d(e - 1));
|
|
5302
|
+
}, g = (e) => {
|
|
5102
5303
|
e.target.select();
|
|
5103
5304
|
};
|
|
5104
5305
|
return /* @__PURE__ */ p("div", {
|
|
@@ -5107,12 +5308,12 @@ var ui = ({ length: e = 6, value: t = "", onChange: n, onComplete: r, autoFocus:
|
|
|
5107
5308
|
t.preventDefault();
|
|
5108
5309
|
let i = (t.clipboardData?.getData("text") || "").trim().slice(0, e);
|
|
5109
5310
|
i && (i.split("").forEach((e, t) => {
|
|
5110
|
-
|
|
5311
|
+
l.current[t] && (l.current[t].value = e);
|
|
5111
5312
|
}), n?.(i), i.length === e && r?.(i));
|
|
5112
5313
|
},
|
|
5113
5314
|
...s,
|
|
5114
5315
|
children: Array.from({ length: e }).map((e, t) => /* @__PURE__ */ p("input", {
|
|
5115
|
-
ref: (e) =>
|
|
5316
|
+
ref: (e) => l.current[t] = e,
|
|
5116
5317
|
id: `wc-input-code-${t}`,
|
|
5117
5318
|
name: `wc-input-code-${t}`,
|
|
5118
5319
|
className: "wc-input-code__box",
|
|
@@ -5120,100 +5321,101 @@ var ui = ({ length: e = 6, value: t = "", onChange: n, onComplete: r, autoFocus:
|
|
|
5120
5321
|
maxLength: 1,
|
|
5121
5322
|
autoComplete: "one-time-code",
|
|
5122
5323
|
inputMode: "numeric",
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5324
|
+
"aria-label": c.verificationCodeDigit(t + 1),
|
|
5325
|
+
onInput: m(t),
|
|
5326
|
+
onKeyDown: h(t),
|
|
5327
|
+
onFocus: g
|
|
5126
5328
|
}, t))
|
|
5127
5329
|
});
|
|
5128
5330
|
};
|
|
5129
|
-
|
|
5331
|
+
gi.displayName = "VerificationCodeInput";
|
|
5130
5332
|
//#endregion
|
|
5131
5333
|
//#region ../core/src/components/VideoPlayer/utils.js
|
|
5132
|
-
function
|
|
5334
|
+
function _i(e) {
|
|
5133
5335
|
return `${Math.floor(e / 60)}:${Math.floor(e % 60).toString().padStart(2, "0")}`;
|
|
5134
5336
|
}
|
|
5135
|
-
function
|
|
5337
|
+
function vi(e, t) {
|
|
5136
5338
|
let n = e.currentTarget.getBoundingClientRect();
|
|
5137
5339
|
return (e.clientX - n.left) / n.width * t;
|
|
5138
5340
|
}
|
|
5139
|
-
function
|
|
5341
|
+
function yi(e) {
|
|
5140
5342
|
e && (document.fullscreenElement ? document.exitFullscreen?.() : e.requestFullscreen?.());
|
|
5141
5343
|
}
|
|
5142
5344
|
//#endregion
|
|
5143
5345
|
//#region src/components/VideoPlayer/VideoPlayer.jsx
|
|
5144
|
-
var
|
|
5145
|
-
let s = u(null), [
|
|
5146
|
-
let e =
|
|
5346
|
+
var bi = ({ src: e, autoplay: t = !1, loop: n = !1, className: r = "", style: i = {}, ...a }) => {
|
|
5347
|
+
let { messages: s } = q(), c = u(null), [l, f] = d(!1), [h, g] = d(0), [_, v] = d(.7), [y, b] = d(!1), [x, S] = d(0), [C, w] = d(0), T = _i(C), E = _i(x), D = () => {
|
|
5348
|
+
let e = c.current;
|
|
5147
5349
|
e && (e.paused ? e.play() : e.pause());
|
|
5148
|
-
},
|
|
5149
|
-
let e =
|
|
5150
|
-
e && (
|
|
5151
|
-
},
|
|
5152
|
-
let t =
|
|
5153
|
-
t && (t.currentTime =
|
|
5154
|
-
},
|
|
5155
|
-
|
|
5350
|
+
}, O = () => {
|
|
5351
|
+
let e = c.current;
|
|
5352
|
+
e && (S(e.duration || 0), w(e.currentTime), g(e.duration ? e.currentTime / e.duration * 100 : 0), f(!e.paused));
|
|
5353
|
+
}, k = (e) => {
|
|
5354
|
+
let t = c.current;
|
|
5355
|
+
t && (t.currentTime = vi(e, x));
|
|
5356
|
+
}, A = () => {
|
|
5357
|
+
b((e) => {
|
|
5156
5358
|
let t = !e;
|
|
5157
|
-
return
|
|
5359
|
+
return c.current && (c.current.muted = t), t;
|
|
5158
5360
|
});
|
|
5159
|
-
},
|
|
5160
|
-
|
|
5361
|
+
}, j = () => {
|
|
5362
|
+
yi(c.current?.parentElement);
|
|
5161
5363
|
};
|
|
5162
5364
|
return o(() => {
|
|
5163
|
-
|
|
5164
|
-
}, [
|
|
5165
|
-
let e =
|
|
5166
|
-
e && (e.muted =
|
|
5365
|
+
c.current && (c.current.volume = _);
|
|
5366
|
+
}, [_]), o(() => {
|
|
5367
|
+
let e = c.current;
|
|
5368
|
+
e && (e.muted = y, e.loop = n, t && e.play());
|
|
5167
5369
|
}, [
|
|
5168
5370
|
t,
|
|
5169
5371
|
n,
|
|
5170
|
-
|
|
5372
|
+
y
|
|
5171
5373
|
]), /* @__PURE__ */ m("div", {
|
|
5172
5374
|
className: `video-wrapper ${r}`,
|
|
5173
5375
|
style: i,
|
|
5174
5376
|
...a,
|
|
5175
5377
|
children: [/* @__PURE__ */ p("video", {
|
|
5176
|
-
ref:
|
|
5378
|
+
ref: c,
|
|
5177
5379
|
className: "video-el",
|
|
5178
5380
|
src: e,
|
|
5179
|
-
onTimeUpdate:
|
|
5180
|
-
onEnded: () =>
|
|
5381
|
+
onTimeUpdate: O,
|
|
5382
|
+
onEnded: () => f(!1)
|
|
5181
5383
|
}), /* @__PURE__ */ m("div", {
|
|
5182
5384
|
className: "controls",
|
|
5183
5385
|
children: [
|
|
5184
5386
|
/* @__PURE__ */ p("button", {
|
|
5185
5387
|
className: "ctrl-btn",
|
|
5186
|
-
"aria-label":
|
|
5187
|
-
onClick:
|
|
5188
|
-
children:
|
|
5388
|
+
"aria-label": l ? s.pauseVideo : s.playVideo,
|
|
5389
|
+
onClick: D,
|
|
5390
|
+
children: l ? "❚❚" : "▶️"
|
|
5189
5391
|
}),
|
|
5190
5392
|
/* @__PURE__ */ p("div", {
|
|
5191
5393
|
className: "progress",
|
|
5192
5394
|
role: "slider",
|
|
5193
5395
|
tabIndex: 0,
|
|
5194
|
-
"aria-label":
|
|
5195
|
-
"aria-valuenow": Math.round(
|
|
5396
|
+
"aria-label": s.videoProgress,
|
|
5397
|
+
"aria-valuenow": Math.round(h),
|
|
5196
5398
|
"aria-valuemin": 0,
|
|
5197
5399
|
"aria-valuemax": 100,
|
|
5198
|
-
onClick:
|
|
5400
|
+
onClick: k,
|
|
5199
5401
|
children: /* @__PURE__ */ p("div", {
|
|
5200
5402
|
className: "progress-bar",
|
|
5201
|
-
style: { width: `${
|
|
5403
|
+
style: { width: `${h}%` }
|
|
5202
5404
|
})
|
|
5203
5405
|
}),
|
|
5204
5406
|
/* @__PURE__ */ m("span", {
|
|
5205
5407
|
className: "time",
|
|
5206
5408
|
children: [
|
|
5207
|
-
|
|
5409
|
+
T,
|
|
5208
5410
|
" / ",
|
|
5209
|
-
|
|
5411
|
+
E
|
|
5210
5412
|
]
|
|
5211
5413
|
}),
|
|
5212
5414
|
/* @__PURE__ */ p("button", {
|
|
5213
5415
|
className: "ctrl-btn",
|
|
5214
|
-
"aria-label":
|
|
5215
|
-
onClick:
|
|
5216
|
-
children:
|
|
5416
|
+
"aria-label": y ? s.unmuteVideo : s.muteVideo,
|
|
5417
|
+
onClick: A,
|
|
5418
|
+
children: y ? "🔇" : "🔊"
|
|
5217
5419
|
}),
|
|
5218
5420
|
/* @__PURE__ */ p("input", {
|
|
5219
5421
|
className: "volume",
|
|
@@ -5221,23 +5423,24 @@ var mi = ({ src: e, autoplay: t = !1, loop: n = !1, className: r = "", style: i
|
|
|
5221
5423
|
min: "0",
|
|
5222
5424
|
max: "1",
|
|
5223
5425
|
step: "0.05",
|
|
5224
|
-
value:
|
|
5225
|
-
|
|
5426
|
+
value: _,
|
|
5427
|
+
"aria-label": s.volume,
|
|
5428
|
+
onChange: (e) => v(Number(e.target.value))
|
|
5226
5429
|
}),
|
|
5227
5430
|
/* @__PURE__ */ p("button", {
|
|
5228
5431
|
className: "ctrl-btn",
|
|
5229
|
-
"aria-label":
|
|
5230
|
-
onClick:
|
|
5432
|
+
"aria-label": s.enterFullscreen,
|
|
5433
|
+
onClick: j,
|
|
5231
5434
|
children: "⛶"
|
|
5232
5435
|
})
|
|
5233
5436
|
]
|
|
5234
5437
|
})]
|
|
5235
5438
|
});
|
|
5236
5439
|
};
|
|
5237
|
-
|
|
5440
|
+
bi.displayName = "VideoPlayer";
|
|
5238
5441
|
//#endregion
|
|
5239
5442
|
//#region ../core/src/components/Watermark/utils.js
|
|
5240
|
-
var
|
|
5443
|
+
var xi = {
|
|
5241
5444
|
content: "",
|
|
5242
5445
|
cross: !1,
|
|
5243
5446
|
debug: !1,
|
|
@@ -5265,14 +5468,14 @@ var hi = {
|
|
|
5265
5468
|
yOffset: 0,
|
|
5266
5469
|
zIndex: 10
|
|
5267
5470
|
};
|
|
5268
|
-
function
|
|
5471
|
+
function Si(e) {
|
|
5269
5472
|
if (typeof e == "string" && e.startsWith("var(")) {
|
|
5270
5473
|
let t = e.match(/--[^, )]+/);
|
|
5271
5474
|
if (t) return getComputedStyle(document.documentElement).getPropertyValue(t[0]).trim() || e;
|
|
5272
5475
|
}
|
|
5273
5476
|
return e;
|
|
5274
5477
|
}
|
|
5275
|
-
function
|
|
5478
|
+
function Ci(e) {
|
|
5276
5479
|
let t = document.createElement("canvas"), n = t.getContext("2d"), r = e.width, i = e.height;
|
|
5277
5480
|
if (!e.image && e.content) {
|
|
5278
5481
|
n.font = `${e.fontStyle} ${e.fontVariant} ${e.fontWeight} ${e.fontSize}px ${e.fontFamily}`;
|
|
@@ -5288,14 +5491,14 @@ function _i(e) {
|
|
|
5288
5491
|
}, i.src = e.image;
|
|
5289
5492
|
});
|
|
5290
5493
|
let a = (e.content || "").split(/\n/);
|
|
5291
|
-
n.textAlign = e.textAlign || "center", n.textBaseline = "middle", n.fillStyle = e.fontColor.startsWith("var(") ?
|
|
5494
|
+
n.textAlign = e.textAlign || "center", n.textBaseline = "middle", n.fillStyle = e.fontColor.startsWith("var(") ? Si(e.fontColor) : e.fontColor, n.font = `${e.fontStyle} ${e.fontVariant} ${e.fontWeight} ${e.fontSize}px ${e.fontFamily}`, n.translate(r / 2, i / 2), n.rotate(e.rotate * Math.PI / 180);
|
|
5292
5495
|
let o = -(a.length - 1) * e.lineHeight / 2;
|
|
5293
5496
|
return a.forEach((t, r) => {
|
|
5294
5497
|
let i = o + r * e.lineHeight;
|
|
5295
5498
|
n.fillText(t, 0, i);
|
|
5296
5499
|
}), Promise.resolve(t.toDataURL());
|
|
5297
5500
|
}
|
|
5298
|
-
function
|
|
5501
|
+
function wi(e, t) {
|
|
5299
5502
|
let n = {
|
|
5300
5503
|
position: e.fullscreen ? "fixed" : "absolute",
|
|
5301
5504
|
top: 0,
|
|
@@ -5314,15 +5517,15 @@ function vi(e, t) {
|
|
|
5314
5517
|
}
|
|
5315
5518
|
//#endregion
|
|
5316
5519
|
//#region src/components/Watermark/Watermark.jsx
|
|
5317
|
-
var
|
|
5520
|
+
var Ti = (e) => {
|
|
5318
5521
|
let t = {
|
|
5319
|
-
...
|
|
5522
|
+
...xi,
|
|
5320
5523
|
...e
|
|
5321
5524
|
}, [n, r] = d(""), i = !!t.content || !!t.image;
|
|
5322
5525
|
o(() => {
|
|
5323
5526
|
if (!i) return;
|
|
5324
5527
|
let e = !0;
|
|
5325
|
-
return
|
|
5528
|
+
return Ci(t).then((t) => {
|
|
5326
5529
|
e && r(t);
|
|
5327
5530
|
}), () => {
|
|
5328
5531
|
e = !1;
|
|
@@ -5331,7 +5534,7 @@ var yi = (e) => {
|
|
|
5331
5534
|
let { children: e, ...n } = t;
|
|
5332
5535
|
return JSON.stringify(n);
|
|
5333
5536
|
}, [t]), i]);
|
|
5334
|
-
let a = l(() => i ?
|
|
5537
|
+
let a = l(() => i ? wi(t, n) : {}, [
|
|
5335
5538
|
n,
|
|
5336
5539
|
i,
|
|
5337
5540
|
t
|
|
@@ -5341,11 +5544,11 @@ var yi = (e) => {
|
|
|
5341
5544
|
style: a
|
|
5342
5545
|
}), t.children] }) : t.children || null;
|
|
5343
5546
|
};
|
|
5344
|
-
|
|
5547
|
+
Ti.displayName = "Watermark";
|
|
5345
5548
|
//#endregion
|
|
5346
5549
|
//#region src/ThemeReact.tsx
|
|
5347
|
-
var
|
|
5348
|
-
async function
|
|
5550
|
+
var Ei = n(void 0), Di = typeof window > "u" ? o : c;
|
|
5551
|
+
async function Oi(e, t, n, r) {
|
|
5349
5552
|
if (typeof fetch > "u") return {
|
|
5350
5553
|
ok: !1,
|
|
5351
5554
|
url: e,
|
|
@@ -5387,9 +5590,9 @@ async function Si(e, t, n, r) {
|
|
|
5387
5590
|
} : null;
|
|
5388
5591
|
}
|
|
5389
5592
|
}
|
|
5390
|
-
var
|
|
5593
|
+
var ki = ({ children: e, config: t, defaultMode: n = "system", themeUrl: r, target: a, mode: s, initialResolvedMode: c, storageKey: f, storage: m, onModeChange: h, onResolvedModeChange: g, onThemeLoad: _, onThemeError: v }) => {
|
|
5391
5594
|
let y = u(null);
|
|
5392
|
-
y.current ||=
|
|
5595
|
+
y.current ||= w({
|
|
5393
5596
|
target: a,
|
|
5394
5597
|
initialMode: s ?? n,
|
|
5395
5598
|
initialResolvedMode: c,
|
|
@@ -5397,34 +5600,34 @@ var Ci = ({ children: e, config: t, defaultMode: n = "system", themeUrl: r, targ
|
|
|
5397
5600
|
storage: m,
|
|
5398
5601
|
readStorage: s === void 0
|
|
5399
5602
|
});
|
|
5400
|
-
let b = y.current, [S,
|
|
5603
|
+
let b = y.current, [S, C] = d({
|
|
5401
5604
|
mode: b.mode,
|
|
5402
5605
|
resolvedMode: b.resolvedMode,
|
|
5403
5606
|
dark: b.dark
|
|
5404
|
-
}), T = u(S.resolvedMode), E = u(a),
|
|
5405
|
-
k.current = g, A.current = _, j.current = v,
|
|
5607
|
+
}), T = u(S.resolvedMode), E = u(a), D = u(0), k = u(g), A = u(_), j = u(v);
|
|
5608
|
+
k.current = g, A.current = _, j.current = v, Di(() => {
|
|
5406
5609
|
let e = b.subscribe((e) => {
|
|
5407
|
-
|
|
5610
|
+
C(e), T.current !== e.resolvedMode && (T.current = e.resolvedMode, k.current?.(e.resolvedMode));
|
|
5408
5611
|
});
|
|
5409
5612
|
return b.start(), () => {
|
|
5410
5613
|
e(), b.destroy();
|
|
5411
5614
|
};
|
|
5412
|
-
}, [b]),
|
|
5615
|
+
}, [b]), Di(() => {
|
|
5413
5616
|
s !== void 0 && b.setMode(s);
|
|
5414
5617
|
}, [b, s]), o(() => {
|
|
5415
|
-
let e = ++
|
|
5618
|
+
let e = ++D.current, n = E.current, i = typeof AbortController > "u" ? null : new AbortController();
|
|
5416
5619
|
if (t !== void 0) {
|
|
5417
5620
|
let e = x(t, { target: n });
|
|
5418
5621
|
e.ok ? A.current?.(e) : j.current?.(e);
|
|
5419
|
-
} else r ||
|
|
5420
|
-
return r &&
|
|
5622
|
+
} else r || O(n);
|
|
5623
|
+
return r && Oi(r, n, () => e === D.current, i?.signal).then((e) => {
|
|
5421
5624
|
e && (e.ok ? A.current?.(e) : i?.signal.aborted || j.current?.(e));
|
|
5422
5625
|
}), () => {
|
|
5423
5626
|
i?.abort();
|
|
5424
5627
|
};
|
|
5425
5628
|
}, [t, r]), o(() => {
|
|
5426
5629
|
let e = E.current;
|
|
5427
|
-
return () =>
|
|
5630
|
+
return () => O(e);
|
|
5428
5631
|
}, []);
|
|
5429
5632
|
let M = i((e) => {
|
|
5430
5633
|
s === void 0 && b.setMode(e), h?.(e);
|
|
@@ -5448,15 +5651,15 @@ var Ci = ({ children: e, config: t, defaultMode: n = "system", themeUrl: r, targ
|
|
|
5448
5651
|
M,
|
|
5449
5652
|
N
|
|
5450
5653
|
]);
|
|
5451
|
-
return /* @__PURE__ */ p(
|
|
5654
|
+
return /* @__PURE__ */ p(Ei.Provider, {
|
|
5452
5655
|
value: P,
|
|
5453
5656
|
children: e
|
|
5454
5657
|
});
|
|
5455
5658
|
};
|
|
5456
|
-
function
|
|
5457
|
-
let e = a(
|
|
5659
|
+
function Ai() {
|
|
5660
|
+
let e = a(Ei);
|
|
5458
5661
|
if (!e) throw Error("useTheme must be used within ThemeProvider");
|
|
5459
5662
|
return e;
|
|
5460
5663
|
}
|
|
5461
5664
|
//#endregion
|
|
5462
|
-
export {
|
|
5665
|
+
export { te as Accordion, ie as Alert, Y as AppBar, le as Autocomplete, he as Avatar, ye as Badge, Te as Banner, ke as Blockquote, Le as Box, We as Breadcrumb, Xe as Button, Oe as Card, Ze as CardActions, Qe as CardContent, tt as Checkbox, ot as Chip, pt as CircularProgress, _t as ColorPicker, bt as Container, Ot as Copy, Ft as DatePicker, It as Fab, qt as Feature, Rt as Feed, Yt as FileInput, Zt as FormControl, Qt as FormControlLabel, $t as FormGroup, en as FormHelperText, fn as Grid, pn as HoverCard, kn as Icon, An as IconButton, jn as ImageGallery, zn as Inline, Bn as Input, Kn as List, qn as ListItem, Jn as ListItemIcon, Yn as ListItemText, K as LocaleProvider, ir as Menu, cr as Modal, lr as NumberAnimation, dr as Page, ur as Pagination, _r as Paper, vr as Popover, yr as PricingTable, br as Progress, Cr as Radio, Sr as RadioGroup, wr as Rating, Tr as Select, Dr as Skeleton, kr as SlideOver, Or as Slider, Nr as Snackbar, Ar as Split, jr as Stack, Hr as Status, Ur as Switch, g as THEME_CONFIG_VERSION, _ as THEME_MODES, v as THEME_STORAGE_KEY, Xr as Table, qr as TableBody, Yr as TableCell, Kr as TableHead, Jr as TableRow, Zr as Tabs, Qr as TextField, ki as ThemeProvider, ei as Toolbar, ai as Tooltip, hi as TypingText, pi as Typography, gi as VerificationCodeInput, bi as VideoPlayer, Ti as Watermark, b as applyThemeConfig, C as createThemeController, T as createThemeInitScript, re as defaultLocaleMessages, E as loadThemeConfig, D as resetThemeConfig, k as resolveThemeMode, A as serializeThemeConfig, q as useLocale, Ai as useTheme, j as validateThemeConfig };
|