@ithinkdt/ui 4.0.14 → 4.0.16

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/esm/index.js CHANGED
@@ -1 +1,1251 @@
1
- export * from '../dist/index.js'
1
+ import { n as e, t } from "./use-i18n-D1TTDOML.js";
2
+ import n, { c as r, cB as i, cE as a, cM as o } from "./use-style.js";
3
+ import { i as s, n as c, r as l, t as u } from "./directives-g3YmS-dM.js";
4
+ import { Fragment as d, computed as f, createVNode as p, defineComponent as m, inject as h, isVNode as g, mergeProps as _, provide as v, reactive as y, ref as b, renderSlot as x, shallowRef as S, toRef as C, toValue as w, unref as T, useTemplateRef as E, watch as D, withDirectives as O } from "vue";
5
+ import { computedAsync as ee, promiseTimeout as k, useElementHover as A, useElementSize as te, useEventListener as ne, useFullscreen as j, watchDebounced as re } from "@vueuse/core";
6
+ import { NAvatar as M, NBadge as ie, NBreadcrumb as ae, NBreadcrumbItem as oe, NButton as N, NDrawer as se, NDrawerContent as ce, NDropdown as P, NEmpty as le, NIcon as F, NInput as I, NList as L, NListItem as R, NMenu as z, NPagination as B, NPopover as V, NScrollbar as H, NText as U, NThing as W, useThemeVars as ue } from "ithinkdt-ui";
7
+ import { debounce as de } from "@ithinkdt/common/fn";
8
+ import { useAtomicBroadcast as fe } from "@ithinkdt/common/composables";
9
+ import { RouterLink as pe, useRouter as G } from "vue-router";
10
+ import { walkTree as me } from "@ithinkdt/common/tree";
11
+ import { isNullish as he } from "@ithinkdt/common/object";
12
+ import { getOpaqueColor as ge } from "@ithinkdt/common/color";
13
+ import { format as _e } from "date-fns";
14
+ //#region src/design/Account.jsx
15
+ function K(e) {
16
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
17
+ }
18
+ var ve = /* @__PURE__ */ m({
19
+ name: "AppAccount",
20
+ props: {
21
+ username: String,
22
+ nickname: String,
23
+ head: String,
24
+ showLogoutButton: {
25
+ type: Boolean,
26
+ default: !0
27
+ },
28
+ showChangePwd: {
29
+ type: Boolean,
30
+ default: !0
31
+ }
32
+ },
33
+ emit: ["logout", "change-pwd"],
34
+ setup(t, { emit: n, slots: r }) {
35
+ let i = f(() => /^[\u4E00-\u9FA5]+$/.test(t.nickname) ? t.nickname?.slice(t.nickname?.length > 3 ? 2 : 1) : t.nickname?.split(" ")[0]), { t: a } = e(), o = p(F, { size: "28" }, { default: () => [p("svg", {
36
+ xmlns: "http://www.w3.org/2000/svg",
37
+ width: "1em",
38
+ height: "1em",
39
+ viewBox: "-4 -4 32 32"
40
+ }, [p("path", {
41
+ fill: "currentColor",
42
+ d: "M12 12q-1.65 0-2.825-1.175T8 8t1.175-2.825T12 4t2.825 1.175T16 8t-1.175 2.825T12 12m-8 6v-.8q0-.85.438-1.562T5.6 14.55q1.55-.775 3.15-1.162T12 13t3.25.388t3.15 1.162q.725.375 1.163 1.088T20 17.2v.8q0 .825-.587 1.413T18 20H6q-.825 0-1.412-.587T4 18"
43
+ }, null)])] }), c = p("svg", {
44
+ xmlns: "http://www.w3.org/2000/svg",
45
+ width: "1em",
46
+ height: "1em",
47
+ viewBox: "0 0 24 24"
48
+ }, [p("path", {
49
+ fill: "currentColor",
50
+ d: "M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2a9.99 9.99 0 0 1 8 4h-2.71a8 8 0 1 0 .001 12h2.71A9.99 9.99 0 0 1 12 22m7-6v-3h-8v-2h8V8l5 4z"
51
+ }, null)]);
52
+ return () => {
53
+ let e;
54
+ return p("div", { style: "display: flex; align-items: center" }, [
55
+ p(V, { style: "padding: 4px" }, {
56
+ trigger: () => p(N, {
57
+ quaternary: !0,
58
+ style: "--n-padding: 0 12px"
59
+ }, { default: () => [p("div", { style: "display: flex; align-items: center; gap: 8px" }, [p(M, {
60
+ key: t.head ? "head" : "no-head",
61
+ src: t.head,
62
+ round: !0,
63
+ size: "small",
64
+ radix: .78,
65
+ color: "var(--color-primary-hover)"
66
+ }, {
67
+ fallback: () => o,
68
+ placeholder: () => o,
69
+ default: t.head ? void 0 : () => i.value
70
+ }), p("span", { style: "font-size: 14px" }, [t.username ?? ""])])] }),
71
+ default: () => {
72
+ let e = () => t.showChangePwd ? p(N, {
73
+ quaternary: !0,
74
+ style: "justify-content: left",
75
+ onClick: () => n("change-pwd")
76
+ }, {
77
+ icon: () => p(F, null, { default: () => [p("svg", {
78
+ xmlns: "http://www.w3.org/2000/svg",
79
+ width: "1em",
80
+ height: "1em",
81
+ viewBox: "0 0 32 32"
82
+ }, [p("path", {
83
+ fill: "currentColor",
84
+ d: "M21 2a8.998 8.998 0 0 0-8.612 11.612L2 24v6h6l10.388-10.388A9 9 0 1 0 21 2m0 16a7 7 0 0 1-2.032-.302l-1.147-.348l-.847.847l-3.181 3.181L12.414 20L11 21.414l1.379 1.379l-1.586 1.586L9.414 23L8 24.414l1.379 1.379L7.172 28H4v-3.172l9.802-9.802l.848-.847l-.348-1.147A7 7 0 1 1 21 18"
85
+ }, null), p("circle", {
86
+ cx: "22",
87
+ cy: "10",
88
+ r: "2",
89
+ fill: "currentColor"
90
+ }, null)])] }),
91
+ default: () => a("common.account.changePwd")
92
+ }) : void 0, i = () => t.showLogoutButton ? void 0 : p(N, {
93
+ quaternary: !0,
94
+ style: "justify-content: left",
95
+ onClick: () => n("logout")
96
+ }, {
97
+ icon: () => p(F, null, K(c) ? c : { default: () => [c] }),
98
+ default: () => [a("common.account.logout")]
99
+ });
100
+ return x(r, "dropdown", {
101
+ pwd: e,
102
+ logout: i
103
+ }, () => [p("div", { style: "display: flex; flex-direction: column" }, [
104
+ e(),
105
+ x(r, "dropdownExtra"),
106
+ i()
107
+ ])]);
108
+ }
109
+ }),
110
+ x(r, "extra"),
111
+ t.showLogoutButton ? O(p(N, {
112
+ quaternary: !0,
113
+ style: "--n-padding: 0 12px",
114
+ onClick: () => t.username && n("logout")
115
+ }, K(e = x(r, "logoutButton", void 0, () => [p(F, { size: "16" }, K(c) ? c : { default: () => [c] })])) ? e : { default: () => [e] }), [[
116
+ s,
117
+ a("common.account.logout"),
118
+ void 0,
119
+ { "bottom-end": !0 }
120
+ ]]) : void 0
121
+ ]);
122
+ };
123
+ }
124
+ }), ye = /* @__PURE__ */ m({
125
+ name: "AppAppearance",
126
+ props: { mode: String },
127
+ emit: ["update:mode"],
128
+ setup(t, { emit: n }) {
129
+ let { t: r } = e();
130
+ return () => O(p(N, {
131
+ quaternary: !0,
132
+ style: "--n-padding: 0 12px",
133
+ onClick: () => {
134
+ n("update:mode", t.mode === "light" ? "dark" : t.mode === "dark" ? "auto" : "light");
135
+ }
136
+ }, { default: () => [p(F, { size: "18" }, { default: () => [t.mode === "light" ? p("svg", {
137
+ xmlns: "http://www.w3.org/2000/svg",
138
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
139
+ role: "img",
140
+ width: "1em",
141
+ height: "1em",
142
+ viewBox: "0 0 24 24"
143
+ }, [p("path", {
144
+ fill: "currentColor",
145
+ d: "M12 15q1.25 0 2.125-.875T15 12q0-1.25-.875-2.125T12 9q-1.25 0-2.125.875T9 12q0 1.25.875 2.125T12 15Zm0 2q-2.075 0-3.537-1.463Q7 14.075 7 12t1.463-3.538Q9.925 7 12 7t3.538 1.462Q17 9.925 17 12q0 2.075-1.462 3.537Q14.075 17 12 17ZM1 13v-2h4v2Zm18 0v-2h4v2Zm-8-8V1h2v4Zm0 18v-4h2v4ZM6.35 7.75L3.875 5.275l1.4-1.4L7.75 6.35Zm12.375 12.375L16.25 17.65l1.4-1.4l2.475 2.475ZM17.65 7.75l-1.4-1.4l2.475-2.475l1.4 1.4ZM5.275 20.125l-1.4-1.4L6.35 16.25l1.4 1.4ZM12 12Z"
146
+ }, null)]) : t.mode === "dark" ? p("svg", {
147
+ xmlns: "http://www.w3.org/2000/svg",
148
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
149
+ role: "img",
150
+ width: "1em",
151
+ height: "1em",
152
+ viewBox: "0 0 24 24"
153
+ }, [p("path", {
154
+ fill: "currentColor",
155
+ d: "M12 21q-3.75 0-6.375-2.625T3 12q0-3.75 2.625-6.375T12 3q.35 0 .688.025q.337.025.662.075q-1.025.725-1.637 1.887Q11.1 6.15 11.1 7.5q0 2.25 1.575 3.825Q14.25 12.9 16.5 12.9q1.375 0 2.525-.613q1.15-.612 1.875-1.637q.05.325.075.662Q21 11.65 21 12q0 3.75-2.625 6.375T12 21Zm0-2q2.2 0 3.95-1.212q1.75-1.213 2.55-3.163q-.5.125-1 .2q-.5.075-1 .075q-3.075 0-5.238-2.162Q9.1 10.575 9.1 7.5q0-.5.075-1t.2-1q-1.95.8-3.162 2.55Q5 9.8 5 12q0 2.9 2.05 4.95Q9.1 19 12 19Zm-.25-6.75Z"
156
+ }, null)]) : p("svg", {
157
+ xmlns: "http://www.w3.org/2000/svg",
158
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
159
+ role: "img",
160
+ width: "1em",
161
+ height: "1em",
162
+ viewBox: "0 0 24 24"
163
+ }, [p("path", {
164
+ fill: "currentColor",
165
+ d: "M11 19q1.35 0 2.513-.538q1.162-.537 1.987-1.487q-3.15-.2-5.325-2.488Q8 12.2 8 9q0-.325.025-.638q.025-.312.075-.612q-1.4.775-2.25 2.162Q5 11.3 5 13q0 2.5 1.75 4.25T11 19Zm0 2q-3.35 0-5.675-2.325Q3 16.35 3 13q0-3.35 2.325-5.675Q7.65 5 11 5q.125 0 .25.012q.125.013.25.013q-.725.8-1.113 1.812Q10 7.85 10 9q0 2.5 1.75 4.25T16 15q.8 0 1.525-.2q.725-.2 1.375-.55q-.45 2.875-2.662 4.812Q14.025 21 11 21Zm2.8-10L17 2h2l3.2 9h-1.9l-.7-2h-3.2l-.7 2Zm3.05-3.35h2.3L18 4Z"
166
+ }, null)])] })] }), [[
167
+ s,
168
+ t.mode === "light" ? r("common.layout.mode.light") : t.mode === "dark" ? r("common.layout.mode.dark") : r("common.layout.mode.auto"),
169
+ void 0,
170
+ { bottom: !0 }
171
+ ]]);
172
+ }
173
+ }), q = "APP_SIDEBAR_COLLAPSED", J = () => p("svg", {
174
+ xmlns: "http://www.w3.org/2000/svg",
175
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
176
+ role: "img",
177
+ width: "1em",
178
+ height: "1em",
179
+ viewBox: "0 0 24 24"
180
+ }, [p("path", {
181
+ fill: "currentColor",
182
+ d: "m17 18l-5-2.18L7 18V5h10m0-2H7a2 2 0 0 0-2 2v16l7-3l7 3V5a2 2 0 0 0-2-2Z"
183
+ }, null)]), Y = "__APP_CTX__", X = () => h(Y);
184
+ //#endregion
185
+ //#region src/design/Breadcrumb.jsx
186
+ function be(e) {
187
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
188
+ }
189
+ var xe = /* @__PURE__ */ m({
190
+ name: "AppBreadcrumb",
191
+ props: {
192
+ items: {
193
+ type: Array,
194
+ default: () => []
195
+ },
196
+ getIcon: {
197
+ type: Function,
198
+ default: void 0
199
+ }
200
+ },
201
+ setup(e) {
202
+ let t = G(), n = Symbol(), r = Symbol();
203
+ return D(() => e.items, (t) => {
204
+ me(t, (t) => {
205
+ t.icon && (typeof t.icon == "string" ? (t[n] = e.getIcon?.(t.icon), t[r] = () => t[n]?.() || J()) : t[r] = t.icon);
206
+ });
207
+ }, { immediate: !0 }), () => {
208
+ let n;
209
+ return p(ae, null, be(n = e.items.map((e) => p(oe, {
210
+ clickable: e.href?.length > 0,
211
+ separator: e.separator,
212
+ onClick: e.href && ((n) => {
213
+ n.stopPropagation(), t.push(e.href);
214
+ })
215
+ }, { default: () => [e.icon ? p(d, null, [p(F, { component: e[r] }, null), " "]) : void 0, w(e.title)] }))) ? n : { default: () => [n] });
216
+ };
217
+ }
218
+ }), Se = /* @__PURE__ */ m({
219
+ name: "AppFullscreen",
220
+ props: {},
221
+ emit: ["change"],
222
+ setup(t, { emit: n }) {
223
+ let { t: r } = e(), { isFullscreen: i, toggle: a } = j();
224
+ return () => O(p(N, {
225
+ quaternary: !0,
226
+ style: "--n-padding: 0 12px",
227
+ onClick: () => {
228
+ a(), n("change", i.value);
229
+ }
230
+ }, { default: () => [p(F, { size: "18" }, { default: () => [i.value ? p("svg", {
231
+ xmlns: "http://www.w3.org/2000/svg",
232
+ width: "1em",
233
+ height: "1em",
234
+ viewBox: "0 0 24 24"
235
+ }, [p("path", {
236
+ fill: "none",
237
+ stroke: "currentColor",
238
+ "stroke-linecap": "round",
239
+ "stroke-linejoin": "round",
240
+ "stroke-width": "1.5",
241
+ d: "M8.345 3.75v2.095a2.5 2.5 0 0 1-2.5 2.5H3.75M8.345 20.25v-2.095a2.5 2.5 0 0 0-2.5-2.5H3.75M15.655 3.75v2.095a2.5 2.5 0 0 0 2.5 2.5h2.095M15.655 20.25v-2.095a2.5 2.5 0 0 1 2.5-2.5h2.095"
242
+ }, null)]) : p("svg", {
243
+ xmlns: "http://www.w3.org/2000/svg",
244
+ width: "1em",
245
+ height: "1em",
246
+ viewBox: "0 0 24 24"
247
+ }, [p("path", {
248
+ fill: "none",
249
+ stroke: "currentColor",
250
+ "stroke-linecap": "round",
251
+ "stroke-linejoin": "round",
252
+ "stroke-width": "1.5",
253
+ d: "M3.75 8.345V6.25a2.5 2.5 0 0 1 2.5-2.5h2.095M3.75 15.655v2.095a2.5 2.5 0 0 0 2.5 2.5h2.095M20.25 8.345V6.25a2.5 2.5 0 0 0-2.5-2.5h-2.095m4.595 11.905v2.095a2.5 2.5 0 0 1-2.5 2.5h-2.095"
254
+ }, null)])] })] }), [[
255
+ s,
256
+ i.value ? r("common.layout.screen.exitfull") : r("common.layout.screen.full"),
257
+ void 0,
258
+ { bottom: !0 }
259
+ ]]);
260
+ }
261
+ }), Ce = /* @__PURE__ */ m({
262
+ name: "AppLanguage",
263
+ props: {
264
+ lang: String,
265
+ supports: Array
266
+ },
267
+ emit: ["update:lang"],
268
+ setup(e, { emit: t }) {
269
+ return () => p(P, {
270
+ options: e.supports,
271
+ keyField: "value",
272
+ showArrow: !0,
273
+ onSelect: (e) => t("update:lang", e)
274
+ }, { default: () => [p(N, {
275
+ quaternary: !0,
276
+ style: "--n-padding: 0 12px"
277
+ }, { default: () => [p(F, { size: "18" }, { default: () => [p("svg", {
278
+ xmlns: "http://www.w3.org/2000/svg",
279
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
280
+ role: "img",
281
+ width: "1em",
282
+ height: "1em",
283
+ viewBox: "0 0 24 24"
284
+ }, [p("g", {
285
+ fill: "none",
286
+ stroke: "currentColor",
287
+ "stroke-linecap": "round",
288
+ "stroke-linejoin": "round",
289
+ "stroke-width": "1.5"
290
+ }, [p("path", { d: "M2 12c0 5.523 4.477 10 10 10s10-4.477 10-10S17.523 2 12 2S2 6.477 2 12Z" }, null), p("path", { d: "M13 2.05S16 6 16 12c0 6-3 9.95-3 9.95m-2 0S8 18 8 12c0-6 3-9.95 3-9.95M2.63 15.5h18.74m-18.74-7h18.74" }, null)])])] })] })] });
291
+ }
292
+ }), we = /* @__PURE__ */ r([
293
+ i("layout", {
294
+ display: "grid",
295
+ gridTemplateAreas: "\n 'sidebar header'\n 'sidebar content'\n 'sidebar footer'\n ",
296
+ gridTemplateRows: "auto 1fr auto",
297
+ gridTemplateColumns: "auto 1fr",
298
+ position: "relative",
299
+ top: "0",
300
+ left: "0",
301
+ transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
302
+ "--app-content-height": "calc(100vh - var(--app-header-height) - var(--app-footer-height))"
303
+ }, [o("full-header", { gridTemplateAreas: "\n 'header header'\n 'sidebar content'\n 'sidebar footer'\n " }), o("full-content", {
304
+ width: "calc(100% + var(--app-sidebar-width))",
305
+ height: "calc(100% + var(--app-header-height))",
306
+ left: "calc(-1 * var(--app-sidebar-width))",
307
+ top: "calc(-1 * var(--app-header-height))"
308
+ })]),
309
+ i("header", {
310
+ gridArea: "header",
311
+ overflow: "hidden",
312
+ zIndex: 2,
313
+ height: "var(--app-header-height, 44px)"
314
+ }),
315
+ i("sidebar", {
316
+ gridArea: "sidebar",
317
+ width: "var(--app-sidebar-width, 220px)",
318
+ display: "flex",
319
+ flexDirection: "column",
320
+ overflow: "auto",
321
+ position: "relative",
322
+ transition: "width 0.2s ease-in-out",
323
+ zIndex: "2"
324
+ }, [a("collapse-btn", {
325
+ "--n-padding": "0 12px",
326
+ position: "absolute",
327
+ zIndex: "2",
328
+ bottom: "8px",
329
+ right: "8px"
330
+ })]),
331
+ i("content", {
332
+ gridArea: "content",
333
+ position: "relative",
334
+ overflow: "hidden",
335
+ zIndex: "1"
336
+ }),
337
+ i("footer", {
338
+ gridArea: "footer",
339
+ lineHeight: "32px",
340
+ textAlign: "center",
341
+ color: "gray"
342
+ })
343
+ ]), Te = () => p("svg", {
344
+ xmlns: "http://www.w3.org/2000/svg",
345
+ width: "1em",
346
+ height: "1em",
347
+ viewBox: "0 0 24 24"
348
+ }, [p("path", {
349
+ fill: "none",
350
+ stroke: "currentColor",
351
+ "stroke-linecap": "round",
352
+ "stroke-linejoin": "round",
353
+ "stroke-width": "1.5",
354
+ d: "M11.5 18s-6-4.419-6-6s6-6 6-6m7 12s-6-4.419-6-6s6-6 6-6",
355
+ color: "currentColor"
356
+ }, null)]), Ee = () => p("svg", {
357
+ xmlns: "http://www.w3.org/2000/svg",
358
+ width: "1em",
359
+ height: "1em",
360
+ viewBox: "0 0 24 24"
361
+ }, [p("path", {
362
+ fill: "none",
363
+ stroke: "currentColor",
364
+ "stroke-linecap": "round",
365
+ "stroke-linejoin": "round",
366
+ "stroke-width": "1.5",
367
+ d: "M12.5 18s6-4.419 6-6s-6-6-6-6m-7 12s6-4.419 6-6s-6-6-6-6",
368
+ color: "currentColor"
369
+ }, null)]), De = /* @__PURE__ */ m({
370
+ name: "AppLayout",
371
+ props: {
372
+ layout: {
373
+ type: String,
374
+ default: "left2right"
375
+ },
376
+ fullContent: Boolean
377
+ },
378
+ setup(e, { slots: t }) {
379
+ n("-layout", we, b("app"), !1);
380
+ let r = y({
381
+ sidebarWidth: "0px",
382
+ headerHeight: "0px",
383
+ footerHeight: "0px",
384
+ hasMultiTab: !1
385
+ });
386
+ return v(Y, r), () => {
387
+ let { layout: n } = e;
388
+ return p("div", {
389
+ class: {
390
+ "app-layout": !0,
391
+ "app-layout--full-header": n === "top2bottom",
392
+ "app-layout--full-content": e.fullContent
393
+ },
394
+ style: {
395
+ "--app-sidebar-width": r.sidebarWidth,
396
+ "--app-header-height": r.headerHeight,
397
+ "--app-footer-height": r.footerHeight
398
+ }
399
+ }, [x(t, "default")]);
400
+ };
401
+ }
402
+ }), Oe = /* @__PURE__ */ m({
403
+ name: "AppHeader",
404
+ props: { height: {
405
+ type: Number,
406
+ default: 44
407
+ } },
408
+ setup(e, { slots: t }) {
409
+ let n = X();
410
+ return () => (n.headerHeight = e.height + "px", p("div", { class: "app-header" }, [x(t, "default")]));
411
+ }
412
+ }), ke = /* @__PURE__ */ m({
413
+ name: "AppSidebar",
414
+ props: {
415
+ showCollapseBtn: {
416
+ type: Boolean,
417
+ default: !0
418
+ },
419
+ collapsed: Boolean,
420
+ width: {
421
+ type: Number,
422
+ default: 220
423
+ },
424
+ collapsedWidth: {
425
+ type: Number,
426
+ default: 60
427
+ }
428
+ },
429
+ emits: { "update:collapsed": () => !0 },
430
+ setup(t, { emit: n, slots: r }) {
431
+ v(q, C(t, "collapsed"));
432
+ let { t: i } = e(), a = X();
433
+ return () => (a.sidebarWidth = (t.collapsed ? t.collapsedWidth : t.width) + "px", p("div", { class: "app-sidebar" }, [x(r, "default"), t.showCollapseBtn ? O(p(N, {
434
+ class: "app-sidebar__collapse-btn",
435
+ quaternary: !0,
436
+ onClick: () => {
437
+ n("update:collapsed", !t.collapsed);
438
+ }
439
+ }, { default: () => [p(F, { size: "20" }, { default: () => [t.collapsed ? p(Ee, null, null) : p(Te, null, null)] })] }), [[s, t.collapsed ? i("common.layout.sidebar.expand") : i("common.layout.sidebar.collapse")]]) : void 0]));
440
+ }
441
+ }), Ae = /* @__PURE__ */ m({
442
+ name: "AppContent",
443
+ setup(e, { slots: t }) {
444
+ return () => p("div", { class: "app-content" }, [x(t, "default")]);
445
+ }
446
+ }), je = /* @__PURE__ */ m({
447
+ name: "AppFooter",
448
+ props: { height: {
449
+ type: Number,
450
+ default: 30
451
+ } },
452
+ setup(e, { slots: t }) {
453
+ let n = X();
454
+ return () => (n.footerHeight = e.height + "px", p("div", { class: "app-footer" }, [x(t, "default")]));
455
+ }
456
+ });
457
+ //#endregion
458
+ //#region src/design/Logo.jsx
459
+ function Me(e) {
460
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
461
+ }
462
+ var Ne = /* @__PURE__ */ m({
463
+ name: "AppLogo",
464
+ props: {
465
+ src: [String, Function],
466
+ name: String,
467
+ collapsed: {
468
+ type: Boolean,
469
+ default: void 0
470
+ },
471
+ center: {
472
+ type: Boolean,
473
+ default: !1
474
+ },
475
+ link: {
476
+ type: Boolean,
477
+ default: !0
478
+ }
479
+ },
480
+ setup(e, { slots: t }) {
481
+ let n = ee(() => typeof e.src == "function" ? e.src() : e.src), r = h(q, !1);
482
+ return () => {
483
+ let { name: i, collapsed: a, center: o, link: s } = e;
484
+ a ??= T(r);
485
+ let c = a ? 1 : 1 / 1.1;
486
+ return p("div", {
487
+ class: "app-logo",
488
+ style: {
489
+ "--app-logo-img-size": "32px",
490
+ "--app-logo-name-size": "22px",
491
+ width: o ? "100%" : "auto",
492
+ overflow: "hidden",
493
+ display: "flex",
494
+ alignItems: "center",
495
+ justifyContent: o ? "center" : "flex-start",
496
+ cursor: s ? "pointer" : void 0
497
+ }
498
+ }, [x(t, "default", void 0, () => [p("div", {
499
+ class: "app-logo__img",
500
+ style: `
501
+ width: ${a ? "var(--app-sidebar-width, 60px)" : "56px"};
502
+ font-size: ${a ? "calc(var(--app-sidebar-width, 60px) - 24px)" : "32px"};
503
+ transition: width 0.2s ease-in-out 0.1s;
504
+ flex: 0 0 auto;
505
+ display: flex;
506
+ justify-content: center
507
+ `
508
+ }, [x(t, "icon", void 0, () => [p("img", {
509
+ src: n.value,
510
+ alt: "App Logo",
511
+ style: `transition: height 0.2s ease-in-out; height: calc(var(--app-logo-img-size) * ${c})`
512
+ }, null)])])]), i ? p(U, {
513
+ class: "app-logo__name",
514
+ style: "font-size: var(--app-logo-name-size); font-weight: bold; white-space: nowrap; flex: 0 1 auto; overflow: hidden"
515
+ }, Me(i) ? i : { default: () => [i] }) : void 0]);
516
+ };
517
+ }
518
+ });
519
+ //#endregion
520
+ //#region src/design/Menu.jsx
521
+ function Z(e) {
522
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
523
+ }
524
+ var Pe = /* @__PURE__ */ m({
525
+ name: "AppMenu",
526
+ props: {
527
+ menus: Array,
528
+ getIcon: Function,
529
+ current: String,
530
+ horizontal: Boolean,
531
+ single: Boolean,
532
+ accordion: Boolean,
533
+ collapsed: {
534
+ type: Boolean,
535
+ default: void 0
536
+ },
537
+ renderLabel: Function,
538
+ width: {
539
+ type: Number,
540
+ default: 220
541
+ },
542
+ collapsedWidth: {
543
+ type: Number,
544
+ default: 60
545
+ }
546
+ },
547
+ setup(e) {
548
+ let t = S([]);
549
+ D([() => e.menus, () => e.single], ([n, r]) => {
550
+ if (t.value = [], !n?.length) return;
551
+ let i = (t, n = 0) => {
552
+ let a = [];
553
+ for (let o of t) {
554
+ if (o.type === "action") continue;
555
+ let t = o.type === "view" ? void 0 : i(o.children ?? [], n + 1), s = {
556
+ _: o,
557
+ key: o.key,
558
+ label: () => e.renderLabel?.(o) ?? o.name,
559
+ icon: n === 0 || o.icon ? he(o.icon) || typeof o.icon == "string" ? e.getIcon?.(o.icon, o) ?? J : o.icon : void 0,
560
+ children: r ? void 0 : t,
561
+ path: o.path || (r ? t?.[0]?.path : void 0),
562
+ depth: n
563
+ };
564
+ delete s.type, a.push(s);
565
+ }
566
+ return a;
567
+ };
568
+ t.value = i(n);
569
+ }, { immediate: !0 }), D([E("menu"), () => e.current], ([e, t]) => {
570
+ e?.showOption(t);
571
+ }, { immediate: !0 });
572
+ let n = h(q, !1), r = (t) => {
573
+ let r = e.collapsed ?? T(n), i;
574
+ if (t._.type === "view") if (t.isExternal && t.externalEmbed) i = p("a", {
575
+ href: t.externalLink,
576
+ target: "_blank",
577
+ onClick: (e) => e.stopPropagation()
578
+ }, [t.label()]);
579
+ else {
580
+ let e;
581
+ i = p(pe, { to: t.path }, Z(e = t.label()) ? e : { default: () => [e] });
582
+ }
583
+ else i = p("span", null, [t.label()]);
584
+ return i.key = `${t.key}:${+!!r}`, t.depth === 0 && !r && (i = O(p("div", null, [i]), [[
585
+ s,
586
+ t.label(),
587
+ void 0,
588
+ {
589
+ auto: !0,
590
+ right: !0
591
+ }
592
+ ]])), t.isNew && (i = p("div", { style: "display: flex; width: 100%" }, [p("span", { style: "flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis" }, [i]), p("svg", {
593
+ xmlns: "http://www.w3.org/2000/svg",
594
+ width: "24",
595
+ height: "24",
596
+ viewBox: "0 0 1024 1024",
597
+ style: "margin-left: 8px; flex: 0 0 auto;"
598
+ }, [p("path", {
599
+ d: "M245.76 286.72h552.96c124.928 0 225.28 100.352 225.28 225.28s-100.352 225.28-225.28 225.28H0V532.48c0-135.168 110.592-245.76 245.76-245.76z m133.12 348.16V401.408H348.16v178.176l-112.64-178.176H204.8V634.88h30.72v-178.176L348.16 634.88h30.72z m182.272-108.544v-24.576h-96.256v-75.776h110.592v-24.576h-141.312V634.88h143.36v-24.576h-112.64v-83.968h96.256z m100.352 28.672l-34.816-151.552h-34.816l55.296 233.472H675.84l47.104-161.792 4.096-20.48 4.096 20.48 47.104 161.792h28.672l57.344-233.472h-34.816l-32.768 151.552-4.096 30.72-6.144-30.72-40.96-151.552h-30.72l-40.96 151.552-6.144 30.72-6.144-30.72z",
600
+ fill: "var(--color-danger)"
601
+ }, null)])])), i;
602
+ };
603
+ return () => {
604
+ let i = p(z, {
605
+ ref: "menu",
606
+ options: t.value,
607
+ rootIndent: 16,
608
+ accordion: e.accordion,
609
+ collapsed: e.collapsed ?? T(n),
610
+ dropdownProps: { showArrow: !0 },
611
+ mode: e.horizontal ? "horizontal" : "vertical",
612
+ value: e.current ?? null,
613
+ renderLabel: r,
614
+ responsive: !0,
615
+ collapsedWidth: e.collapsedWidth,
616
+ width: e.width
617
+ }, null);
618
+ return e.horizontal ? i : p(H, null, Z(i) ? i : { default: () => [i] });
619
+ };
620
+ }
621
+ });
622
+ //#endregion
623
+ //#region src/design/MultiTabs.jsx
624
+ function Fe(e) {
625
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
626
+ }
627
+ function Q(t, n, r) {
628
+ let { t: i } = e(), a = y({
629
+ visible: !1,
630
+ x: 0,
631
+ y: 0
632
+ }), o = async (e, t) => {
633
+ e.preventDefault(), e.stopPropagation(), !(a.visible && a.tab === t) && (a.tab = t, a.visible && (a.visible = !1, await k(130)), a.visible = !0, a.x = e.clientX, a.y = e.clientY);
634
+ }, s = async () => {
635
+ requestIdleCallback(() => {
636
+ a.visible = !1;
637
+ }, { timeout: 30 });
638
+ }, c = G();
639
+ return {
640
+ ctx: a,
641
+ onCtx: o,
642
+ onClickOutside: s,
643
+ options: f(() => [
644
+ {
645
+ key: "reload",
646
+ label: i("common.layout.tabs.reloadTab"),
647
+ disabled: !a.tab || a.tab.key !== n.value,
648
+ icon: () => p(F, { size: 20 }, { default: () => [p("svg", {
649
+ xmlns: "http://www.w3.org/2000/svg",
650
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
651
+ role: "img",
652
+ width: "1em",
653
+ height: "1em",
654
+ viewBox: "0 0 24 24"
655
+ }, [p("path", {
656
+ fill: "currentColor",
657
+ d: "M17.65 6.35A7.958 7.958 0 0 0 12 4a8 8 0 0 0-8 8a8 8 0 0 0 8 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18a6 6 0 0 1-6-6a6 6 0 0 1 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4l-2.35 2.35Z"
658
+ }, null)])] })
659
+ },
660
+ {
661
+ key: "fullTab",
662
+ label: i("common.layout.tabs.fullTab"),
663
+ icon: () => p(F, { size: 16 }, { default: () => [p("svg", {
664
+ xmlns: "http://www.w3.org/2000/svg",
665
+ width: "1em",
666
+ height: "1em",
667
+ viewBox: "0 0 24 24"
668
+ }, [p("path", {
669
+ fill: "currentColor",
670
+ "fill-rule": "evenodd",
671
+ d: "M18.29 2.89c-1.028-.138-2.383-.14-4.29-.14a.75.75 0 0 1 0-1.5h.056c1.838 0 3.294 0 4.433.153c1.172.158 2.121.49 2.87 1.238c.748.749 1.08 1.698 1.238 2.87c.153 1.14.153 2.595.153 4.433V10a.75.75 0 0 1-1.5 0c0-1.907-.002-3.261-.14-4.29c-.135-1.005-.389-1.585-.812-2.008s-1.003-.677-2.009-.812M2 13.25a.75.75 0 0 1 .75.75c0 1.907.002 3.262.14 4.29c.135 1.005.389 1.585.812 2.008s1.003.677 2.009.812c1.028.138 2.382.14 4.289.14a.75.75 0 0 1 0 1.5h-.056c-1.838 0-3.294 0-4.433-.153c-1.172-.158-2.121-.49-2.87-1.238c-.748-.749-1.08-1.698-1.238-2.87c-.153-1.14-.153-2.595-.153-4.433V14a.75.75 0 0 1 .75-.75",
672
+ "clip-rule": "evenodd"
673
+ }, null), p("path", {
674
+ fill: "currentColor",
675
+ d: "M9.944 1.25H10a.75.75 0 0 1 0 1.5c-1.907 0-3.261.002-4.29.14c-1.005.135-1.585.389-2.008.812S3.025 4.705 2.89 5.71c-.138 1.029-.14 2.383-.14 4.29a.75.75 0 0 1-1.5 0v-.056c0-1.838 0-3.294.153-4.433c.158-1.172.49-2.121 1.238-2.87c.749-.748 1.698-1.08 2.87-1.238c1.14-.153 2.595-.153 4.433-.153M22 13.25a.75.75 0 0 1 .75.75v.056c0 1.838 0 3.294-.153 4.433c-.158 1.172-.49 2.121-1.238 2.87c-.749.748-1.698 1.08-2.87 1.238c-1.14.153-2.595.153-4.433.153H14a.75.75 0 0 1 0-1.5c1.907 0 3.262-.002 4.29-.14c1.005-.135 1.585-.389 2.008-.812s.677-1.003.812-2.009c.138-1.027.14-2.382.14-4.289a.75.75 0 0 1 .75-.75",
676
+ opacity: ".5"
677
+ }, null)])] })
678
+ },
679
+ {
680
+ key: "open",
681
+ label: i("common.layout.tabs.openTabBlank"),
682
+ disabled: !a.tab,
683
+ icon: () => p(F, { size: 20 }, { default: () => [p("svg", {
684
+ xmlns: "http://www.w3.org/2000/svg",
685
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
686
+ role: "img",
687
+ width: "1em",
688
+ height: "1em",
689
+ viewBox: "0 0 15 15"
690
+ }, [p("path", {
691
+ fill: "currentColor",
692
+ "clip-rule": "evenodd",
693
+ "fill-rule": "evenodd",
694
+ d: "M12 13a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1H3a1 1 0 0 0-1 1v3.5a.5.5 0 0 0 1 0V3h9v9H8.5a.5.5 0 0 0 0 1H12ZM9 6.5v3a.5.5 0 0 1-1 0V7.707l-5.146 5.147a.5.5 0 0 1-.708-.708L7.293 7H5.5a.5.5 0 0 1 0-1h3a.498.498 0 0 1 .5.497"
695
+ }, null)])] })
696
+ },
697
+ {
698
+ key: "closeAll",
699
+ label: i("common.layout.tabs.closeAllTabs"),
700
+ icon: () => p(F, { size: 20 }, { default: () => [p("svg", {
701
+ xmlns: "http://www.w3.org/2000/svg",
702
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
703
+ role: "img",
704
+ width: "1em",
705
+ height: "1em",
706
+ viewBox: "0 0 24 24"
707
+ }, [p("path", {
708
+ fill: "currentColor",
709
+ d: "M6.4 19L5 17.6l5.6-5.6L5 6.4L6.4 5l5.6 5.6L17.6 5L19 6.4L13.4 12l5.6 5.6l-1.4 1.4l-5.6-5.6L6.4 19Z"
710
+ }, null)])] })
711
+ },
712
+ {
713
+ key: "closeLeft",
714
+ label: i("common.layout.tabs.closeLeftTabs"),
715
+ disabled: !a.tab,
716
+ icon: () => p(F, { size: 20 }, { default: () => [p("svg", {
717
+ xmlns: "http://www.w3.org/2000/svg",
718
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
719
+ role: "img",
720
+ width: "1em",
721
+ height: "1em",
722
+ viewBox: "0 0 24 24"
723
+ }, [p("path", {
724
+ fill: "currentColor",
725
+ d: "M11 16v-3h10v-2H11V8l-4 4l4 4m-8 4h2V4H3v16Z"
726
+ }, null)])] })
727
+ },
728
+ {
729
+ key: "closeRight",
730
+ label: i("common.layout.tabs.closeRightTabs"),
731
+ disabled: !a.tab,
732
+ icon: () => p(F, { size: 20 }, { default: () => [p("svg", {
733
+ xmlns: "http://www.w3.org/2000/svg",
734
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
735
+ role: "img",
736
+ width: "1em",
737
+ height: "1em",
738
+ viewBox: "0 0 24 24"
739
+ }, [p("path", {
740
+ fill: "currentColor",
741
+ d: "M13 8v3H3v2h10v3l4-4l-4-4m6 12h2V4h-2v16Z"
742
+ }, null)])] })
743
+ },
744
+ {
745
+ key: "closeOther",
746
+ label: i("common.layout.tabs.closeOtherTabs"),
747
+ disabled: !a.tab,
748
+ icon: () => p(F, { size: 20 }, { default: () => [" ", p("svg", {
749
+ xmlns: "http://www.w3.org/2000/svg",
750
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
751
+ role: "img",
752
+ width: "1em",
753
+ height: "1em",
754
+ viewBox: "0 0 1024 1024"
755
+ }, [p("path", {
756
+ fill: "currentColor",
757
+ d: "M180 176h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zm724 0h-60c-4.4 0-8 3.6-8 8v656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V184c0-4.4-3.6-8-8-8zM785.3 504.3L657.7 403.6a7.23 7.23 0 0 0-11.7 5.7V476H378v-62.8c0-6-7-9.4-11.7-5.7L238.7 508.3a7.14 7.14 0 0 0 0 11.3l127.5 100.8c4.7 3.7 11.7.4 11.7-5.7V548h268v62.8c0 6 7 9.4 11.7 5.7l127.5-100.8c3.8-2.9 3.8-8.5.2-11.4z"
758
+ }, null)])] })
759
+ }
760
+ ]),
761
+ onSelect: async (e) => {
762
+ a.visible = !1;
763
+ let i = [...t.value];
764
+ if (e === "closeAll") {
765
+ await c.push("/");
766
+ for (let e of i) e.key !== n.value && e.close(!1);
767
+ return;
768
+ }
769
+ if (e === "fullTab") {
770
+ r();
771
+ return;
772
+ }
773
+ if (a.tab) switch (e) {
774
+ case "open":
775
+ window.open(a.tab.href, "_blank");
776
+ break;
777
+ case "reload":
778
+ a.tab.reloading || (a.tab.reloading = !0, await k(220), a.tab.reloading = !1);
779
+ break;
780
+ case "close":
781
+ a.tab?.close();
782
+ break;
783
+ case "closeOther":
784
+ n.value !== a.tab.key && await c.push(a.tab.fullPath);
785
+ for (let e of i) e.key !== a.tab.key && e.close(!1);
786
+ break;
787
+ case "closeLeft":
788
+ n.value !== a.tab.key && await c.push(a.tab.fullPath);
789
+ for (let e of t.value.slice(0, i.indexOf(a.tab))) e.close(!1);
790
+ break;
791
+ case "closeRight":
792
+ n.value !== a.tab.key && await c.push(a.tab.fullPath);
793
+ for (let e of t.value.slice(i.indexOf(a.tab) + 1)) e.close(!1);
794
+ break;
795
+ }
796
+ }
797
+ };
798
+ }
799
+ function Ie(e, t, n) {
800
+ function r(n) {
801
+ if (n === -1 || !t.value?.children.length) return;
802
+ let r = t.value.children[n];
803
+ e.value.scrollTo({
804
+ behavior: "smooth",
805
+ left: Math.max(0, t.value.offsetLeft + r.offsetLeft - e.value.clientWidth / 2 + r.clientWidth / 2 + 10)
806
+ });
807
+ }
808
+ return re(A(e), (e) => {
809
+ e || r(n.value);
810
+ }, { debounce: 333 }), D(n, r, { flush: "post" }), ne(e, "wheel", (t) => {
811
+ t.deltaMode === WheelEvent.DOM_DELTA_PIXEL && (t.preventDefault(), e.value.scrollBy({ left: t.deltaY }));
812
+ }, { passive: !1 }), {
813
+ el: e,
814
+ content: t
815
+ };
816
+ }
817
+ var Le = (e) => p("svg", e, [
818
+ p("defs", null, [
819
+ p("symbol", {
820
+ id: "geometry-left",
821
+ viewBox: "0 0 214 36"
822
+ }, [p("path", { d: "M17 0h197v36H0v-2c4.5 0 9-3.5 9-8V8c0-4.5 3.5-8 8-8z" }, null)]),
823
+ p("symbol", {
824
+ id: "geometry-right",
825
+ viewBox: "0 0 214 36"
826
+ }, [p("use", { "xlink:href": "#geometry-left" }, null)]),
827
+ p("clipPath", null, [p("rect", {
828
+ width: "100%",
829
+ height: "100%",
830
+ x: "0"
831
+ }, null)])
832
+ ]),
833
+ p("svg", {
834
+ width: "50%",
835
+ height: "100%"
836
+ }, [p("use", {
837
+ "xlink:href": "#geometry-left",
838
+ width: "214",
839
+ height: "36",
840
+ fill: "currentColor"
841
+ }, null)]),
842
+ p("g", { transform: "scale(-1, 1)" }, [p("svg", {
843
+ width: "50%",
844
+ height: "100%",
845
+ x: "-100%",
846
+ y: "0"
847
+ }, [p("use", {
848
+ "xlink:href": "#geometry-right",
849
+ width: "214",
850
+ height: "36",
851
+ fill: "currentColor"
852
+ }, null)])])
853
+ ]), Re = /* @__PURE__ */ m({
854
+ name: "AppTab",
855
+ props: {
856
+ path: String,
857
+ isCurrent: Boolean,
858
+ isLast: Boolean,
859
+ closable: Boolean,
860
+ dark: Boolean
861
+ },
862
+ emits: ["close"],
863
+ setup(e, { emit: t, slots: n }) {
864
+ let r = b(), i = A(r), a = b(), o = b(), { width: s } = te(o);
865
+ D(s, async () => {
866
+ await k(1), a.value.style.width = o.value.scrollWidth + "px";
867
+ });
868
+ let c = ue(), l = f(() => ({
869
+ fontSize: "14px",
870
+ color: e.isCurrent ? c.value.primaryColor : c.value.textColor3,
871
+ maxWidth: "355px",
872
+ overflow: "hidden"
873
+ })), u = f(() => ({
874
+ width: "calc(100% + 27px)",
875
+ height: "100%",
876
+ position: "absolute",
877
+ top: "0",
878
+ left: "-14px",
879
+ zIndex: e.isCurrent ? -1 : -2,
880
+ color: e.isCurrent ? ge(c.value.primaryColor, e.dark ? .3 : .12, e.dark ? "#000" : "#fff") : i.value ? c.value.borderColor : "transparent"
881
+ }));
882
+ return () => p("div", {
883
+ ref: r,
884
+ style: "position: relative; padding: 2px 10px 5px; cursor: pointer"
885
+ }, [
886
+ p("div", {
887
+ ref: a,
888
+ style: "transition: width 300ms; overflow: hidden"
889
+ }, [p("div", {
890
+ ref: o,
891
+ style: "display: flex; align-items: center; gap: 4px; width: fit-content"
892
+ }, [p("span", { style: l.value }, [x(n, "default")]), e.closable !== !1 && (e.isCurrent || i.value) ? p("span", { style: "line-height: 0; display: inline-block; text-align: right; padding-top: 2px" }, [p(N, {
893
+ text: !0,
894
+ onClick: (e) => {
895
+ e.stopPropagation(), t("close");
896
+ }
897
+ }, { default: () => [p(F, { size: 18 }, { default: () => [p("svg", {
898
+ xmlns: "http://www.w3.org/2000/svg",
899
+ width: "1em",
900
+ height: "1em",
901
+ viewBox: "0 0 24 24"
902
+ }, [p("path", {
903
+ fill: "currentColor",
904
+ d: "m6.4 18.308l-.708-.708l5.6-5.6l-5.6-5.6l.708-.708l5.6 5.6l5.6-5.6l.708.708l-5.6 5.6l5.6 5.6l-.708.708l-5.6-5.6z"
905
+ }, null)])] })] })]) : void 0])]),
906
+ p("span", { style: "height: 50%; width: 1px; background: #aaa; display: inline-block; position: absolute; top: 20%; right: -4px; z-index: -3" }, null),
907
+ p(Le, { style: u.value }, null)
908
+ ]);
909
+ }
910
+ }), ze = /* @__PURE__ */ m({
911
+ name: "AppMultiTabs",
912
+ props: {
913
+ fullTab: Boolean,
914
+ showBreadcrumb: Boolean,
915
+ tabs: Array,
916
+ current: Object,
917
+ dark: Boolean
918
+ },
919
+ emits: ["update:fullTab"],
920
+ setup(e, { emit: t, slots: n }) {
921
+ let r = X();
922
+ r.hasMultiTab = !0;
923
+ let i = G(), { ctx: a, onCtx: o, onClickOutside: s, options: c, onSelect: l } = Q(C(e, "tabs"), f(() => e.current?.key), () => t("update:fullTab", !e.fullTab)), u = f(() => e.current ? e.tabs.findIndex((t) => t.key === e.current?.key) : -1), d = b(), m = b();
924
+ return Ie(d, m, u), () => p("div", { style: "width: 100%; height: 100%; overflow: hidden; display: flex; justify-content: space-between" }, [p("div", {
925
+ ref: d,
926
+ style: "flex: 1 1 100%; height: 100%; display: flex; overflow: hidden; align-items: center; position: relative"
927
+ }, [
928
+ p("div", { style: "height: 100%; flex: 0 0 16px; z-index: 1; position: sticky; left: 0; backdrop-filter: opacity(0.9) blur(5px)" }, null),
929
+ p("div", {
930
+ ref: m,
931
+ style: "padding-inline: 12px; flex: 1 1 auto; display: flex; align-items: end; gap: 8px; height: 100%",
932
+ onContextmenu: (e) => o(e)
933
+ }, [e.tabs.map((t, r, a) => {
934
+ let s, c = e.current?.key === t.key, l = t.title ?? t.path;
935
+ return p(Re, {
936
+ key: t.key,
937
+ isCurrent: c,
938
+ isLast: r === a.length - 1,
939
+ onClose: t.close,
940
+ closable: t.closable,
941
+ dark: e.dark,
942
+ onClick: () => {
943
+ c || i.push(t.fullPath);
944
+ },
945
+ onContextmenu: (e) => o(e, t)
946
+ }, Fe(s = x(n, "name", {
947
+ isCurrent: c,
948
+ name: l,
949
+ tab: t
950
+ }, () => [l])) ? s : { default: () => [s] });
951
+ })]),
952
+ p("div", { style: "height: 100%; flex: 0 0 16px; z-index: 1; position: sticky; right: 0; backdrop-filter: opacity(0.9) blur(5px)" }, null)
953
+ ]), p(P, {
954
+ placement: "bottom-start",
955
+ trigger: "manual",
956
+ show: a.visible,
957
+ x: a.x,
958
+ y: a.y,
959
+ options: c.value,
960
+ onClickoutside: s,
961
+ onSelect: l
962
+ }, null)]);
963
+ }
964
+ });
965
+ //#endregion
966
+ //#region src/design/Notification.jsx
967
+ function $(e) {
968
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
969
+ }
970
+ var Be = /* @__PURE__ */ m({
971
+ name: "AppNotification",
972
+ inheritAttrs: !1,
973
+ props: {
974
+ getUnreadCount: Function,
975
+ getPage: Function,
976
+ markRead: Function,
977
+ markDelete: Function,
978
+ interval: {
979
+ type: Number,
980
+ default: 3e4
981
+ },
982
+ drawerTo: [String, Object]
983
+ },
984
+ setup(t, { slots: n, attrs: r }) {
985
+ let { t: i } = e(), a = b(!1), o = b("unread"), l = y({
986
+ page: 1,
987
+ size: 10,
988
+ loading: !1,
989
+ records: [],
990
+ total: 0,
991
+ unread: 0,
992
+ filteredTotal: 0
993
+ }), u = b(""), f = () => {
994
+ l.loading = !0, l.filteredTotal = 0;
995
+ let e = u.value?.trim() || void 0;
996
+ Promise.resolve(t.getPage?.(o.value, l.page, l.size, e) ?? []).then(({ records: t, total: n }) => {
997
+ l.records = t, l.filteredTotal = n, !e && (o.value === "unread" ? (l.unread = n, h(l.unread)) : l.total = n);
998
+ }).finally(() => {
999
+ l.loading = !1;
1000
+ });
1001
+ }, { sync: m, post: h } = fe({
1002
+ channel: "__ithinkdt_mc_shared_channel",
1003
+ onMsg: (e) => {
1004
+ l.unread = e;
1005
+ },
1006
+ getMsg: () => t.getUnreadCount?.() ?? 0,
1007
+ timeout: () => t.interval,
1008
+ immediate: !0
1009
+ }), g = de(() => {
1010
+ l.page = 1, f();
1011
+ }, 300), v = (e) => {
1012
+ u.value = e, g();
1013
+ }, S = () => {
1014
+ let e;
1015
+ return O(p(N, _(r, {
1016
+ quaternary: !0,
1017
+ style: "--n-padding: 0 12px",
1018
+ onClick: () => {
1019
+ o.value = l.unread > 0 ? "unread" : "all", u.value = void 0, a.value = !0, f();
1020
+ }
1021
+ }), $(e = x(n, "icon", void 0, () => [p(ie, {
1022
+ show: l.unread > 0,
1023
+ dot: !0,
1024
+ offset: [-2, 5],
1025
+ processing: !0
1026
+ }, { default: () => [p(F, { size: "18" }, { default: () => [p("svg", {
1027
+ xmlns: "http://www.w3.org/2000/svg",
1028
+ width: "1em",
1029
+ height: "1em",
1030
+ viewBox: "0 0 24 24"
1031
+ }, [p("g", {
1032
+ fill: "none",
1033
+ stroke: "currentColor",
1034
+ "stroke-linecap": "round",
1035
+ "stroke-linejoin": "round",
1036
+ "stroke-width": "1.5",
1037
+ color: "currentColor"
1038
+ }, [p("path", { d: "M2.53 14.77c-.213 1.394.738 2.361 1.902 2.843c4.463 1.85 10.673 1.85 15.136 0c1.164-.482 2.115-1.45 1.902-2.843c-.13-.857-.777-1.57-1.256-2.267c-.627-.924-.689-1.931-.69-3.003C19.525 5.358 16.157 2 12 2S4.475 5.358 4.475 9.5c0 1.072-.062 2.08-.69 3.003c-.478.697-1.124 1.41-1.255 2.267" }, null), p("path", { d: "M8 19c.458 1.725 2.076 3 4 3c1.925 0 3.541-1.275 4-3" }, null)])])] })] })])) ? e : { default: () => [e] }), [[
1039
+ s,
1040
+ i("common.notification.tip", { count: l.unread }),
1041
+ void 0,
1042
+ { bottom: !0 }
1043
+ ]]);
1044
+ }, C = () => {
1045
+ let e, t;
1046
+ return p("div", { style: "display: flex; align-items: baseline; gap: 20px" }, [
1047
+ p("div", { style: "padding-right: 12px" }, [i("common.notification.title")]),
1048
+ p(N, {
1049
+ text: !0,
1050
+ type: o.value === "all" ? "primary" : "default",
1051
+ onClick: () => {
1052
+ o.value = "all", f();
1053
+ }
1054
+ }, $(e = i("common.notification.all")) ? e : { default: () => [e] }),
1055
+ p(N, {
1056
+ text: !0,
1057
+ type: o.value === "unread" ? "primary" : "default",
1058
+ onClick: () => {
1059
+ o.value = "unread", m();
1060
+ }
1061
+ }, $(t = i("common.notification.unread", { count: l.unread > 99 ? "99+" : l.unread.toString() })) ? t : { default: () => [t] })
1062
+ ]);
1063
+ }, w = (e) => p(R, {
1064
+ key: e.key,
1065
+ onClick: () => {
1066
+ e.status === "unread" && (t.markRead?.([e.key]).then(() => {
1067
+ e.status = "read";
1068
+ }), l.unread--), e.link && window.open(e.link, "_target");
1069
+ }
1070
+ }, { default: () => [p(W, {
1071
+ bordered: !1,
1072
+ closable: !0,
1073
+ contentIndented: !0,
1074
+ size: "small",
1075
+ onMouseenter: () => e.hover = !0,
1076
+ onMouseleave: () => e.hover = !1,
1077
+ style: "padding: 0 4px; position: relative"
1078
+ }, {
1079
+ avatar: () => p(F, {
1080
+ size: 22,
1081
+ color: e.status === "unread" ? "var(--color-primary)" : void 0
1082
+ }, { default: () => [p("svg", {
1083
+ xmlns: "http://www.w3.org/2000/svg",
1084
+ width: "1em",
1085
+ height: "1em",
1086
+ viewBox: "0 0 24 24"
1087
+ }, [p("path", {
1088
+ fill: "currentColor",
1089
+ d: "M12.3 7.29c.2-.18.44-.29.7-.29c.27 0 .5.11.71.29c.19.21.29.45.29.71c0 .27-.1.5-.29.71c-.21.19-.44.29-.71.29c-.26 0-.5-.1-.7-.29c-.19-.21-.3-.44-.3-.71c0-.26.11-.5.3-.71m-2.5 4.68s2.17-1.72 2.96-1.79c.74-.06.59.79.52 1.23l-.01.06c-.14.53-.31 1.17-.48 1.78c-.38 1.39-.75 2.75-.66 3c.1.34.72-.09 1.17-.39c.06-.04.11-.08.16-.11c0 0 .08-.08.16.03c.02.03.04.06.06.08c.09.14.14.19.02.27l-.04.02c-.22.15-1.16.81-1.54 1.05c-.41.27-1.98 1.17-1.74-.58c.21-1.23.49-2.29.71-3.12c.41-1.5.59-2.18-.33-1.59c-.37.22-.59.36-.72.45c-.11.08-.12.08-.19-.05l-.03-.06l-.05-.08c-.07-.1-.07-.11.03-.2M22 12c0 5.5-4.5 10-10 10S2 17.5 2 12S6.5 2 12 2s10 4.5 10 10m-2 0c0-4.42-3.58-8-8-8s-8 3.58-8 8s3.58 8 8 8s8-3.58 8-8"
1090
+ }, null)])] }),
1091
+ header: () => e.title,
1092
+ default: e.content,
1093
+ footer: () => {
1094
+ let n, r;
1095
+ return p("div", { style: "display: flex; align-items: center; justify-content: space-between" }, [p("span", { style: "color: gray" }, [e.hover ? _e(e.date, i("common.notification.time")) : i("common.timeago", { time: e.date })]), e.hover ? p("div", {
1096
+ style: "display: flex; gap: 12px",
1097
+ onClick: (e) => {
1098
+ e.preventDefault(), e.stopPropagation();
1099
+ }
1100
+ }, [e.status === "unread" ? p(N, {
1101
+ text: !0,
1102
+ type: "primary",
1103
+ onClick: () => {
1104
+ t.markRead?.([e.key]).then(() => {
1105
+ e.status = "read", l.unread--;
1106
+ });
1107
+ }
1108
+ }, $(n = i("common.notification.markRead")) ? n : { default: () => [n] }) : void 0, p(N, {
1109
+ text: !0,
1110
+ type: "error",
1111
+ onClick: () => {
1112
+ l.records === 1 ? (l.records = [], m()) : l.records.splice(l.records.findIndex((t) => t.key == e.key), 1), t.markDelete?.([e.key]);
1113
+ }
1114
+ }, $(r = i("common.notification.markDelete")) ? r : { default: () => [r] })]) : void 0]);
1115
+ }
1116
+ })] }), T = () => {
1117
+ let e;
1118
+ return p("div", null, [p("div", { style: "padding: 12px 20px; position: sticky; z-index: 1; top: 0; backdrop-filter: blur(6px)" }, [p(I, {
1119
+ size: "small",
1120
+ clearable: !0,
1121
+ value: u.value,
1122
+ onUpdateValue: v
1123
+ }, { suffix: () => p(F, { style: "margin-left: 4px" }, { default: () => [p("svg", {
1124
+ xmlns: "http://www.w3.org/2000/svg",
1125
+ width: "1em",
1126
+ height: "1em",
1127
+ viewBox: "0 0 24 24"
1128
+ }, [p("path", {
1129
+ fill: "currentColor",
1130
+ d: "m18.031 16.617l4.283 4.282l-1.415 1.415l-4.282-4.283A8.96 8.96 0 0 1 11 20c-4.968 0-9-4.032-9-9s4.032-9 9-9s9 4.032 9 9a8.96 8.96 0 0 1-1.969 5.617m-2.006-.742A6.98 6.98 0 0 0 18 11c0-3.867-3.133-7-7-7s-7 3.133-7 7s3.133 7 7 7a6.98 6.98 0 0 0 4.875-1.975z"
1131
+ }, null)])] }) })]), O(l.records.length > 0 ? p(L, {
1132
+ clickable: !0,
1133
+ hoverable: !0,
1134
+ style: "min-height: 50vh"
1135
+ }, $(e = l.records.map((e) => w(e))) ? e : { default: () => [e] }) : p(le, { style: "margin-top: 30vh" }, null), [[c, l.loading]])]);
1136
+ }, E = () => p("div", { style: "display: flex; justify-content: space-between; width: 100%" }, [o.value === "unread" ? p(N, {
1137
+ text: !0,
1138
+ type: "primary",
1139
+ disabled: l.records.length === 0,
1140
+ onClick: () => {
1141
+ let e = l.records.filter((e) => e.status === "unread").map((e) => e.key);
1142
+ t.markRead(e).then(() => {
1143
+ for (; l.unread - e.length <= l.size * (l.page - 1);) l.page--;
1144
+ m();
1145
+ });
1146
+ }
1147
+ }, {
1148
+ icon: () => p(F, { size: "20" }, { default: () => [p("svg", {
1149
+ xmlns: "http://www.w3.org/2000/svg",
1150
+ width: "1em",
1151
+ height: "1em",
1152
+ viewBox: "0 0 24 24"
1153
+ }, [p("path", {
1154
+ fill: "currentColor",
1155
+ d: "M.41 13.41L6 19l1.41-1.42L1.83 12m20.41-6.42L11.66 16.17L7.5 12l-1.43 1.41L11.66 19l12-12M18 7l-1.41-1.42l-6.35 6.35l1.42 1.41z"
1156
+ }, null)])] }),
1157
+ default: () => i("common.notification.markPageRead")
1158
+ }) : p("span", null, null), p(B, {
1159
+ simple: !0,
1160
+ pageSize: l.size,
1161
+ page: l.page,
1162
+ itemCount: l.filteredTotal,
1163
+ onUpdatePage: (e) => {
1164
+ l.page = e, f();
1165
+ }
1166
+ }, null)]);
1167
+ return () => p(d, null, [S(), p(se, {
1168
+ show: a.value,
1169
+ "onUpdate:show": (e) => a.value = e,
1170
+ showMask: !1,
1171
+ resizable: !0,
1172
+ defaultWidth: 420,
1173
+ minWidth: 400,
1174
+ to: t.drawerTo
1175
+ }, { default: () => [p(ce, {
1176
+ title: i("common.notification.title"),
1177
+ closable: !0,
1178
+ nativeScrollbar: !1,
1179
+ bodyContentStyle: { padding: "0" }
1180
+ }, {
1181
+ header: C,
1182
+ default: T,
1183
+ footer: E
1184
+ })] })]);
1185
+ }
1186
+ }), Ve = (e) => p("svg", _({
1187
+ xmlns: "http://www.w3.org/2000/svg",
1188
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
1189
+ role: "img",
1190
+ width: "1em",
1191
+ height: "1em",
1192
+ viewBox: "0 0 24 24"
1193
+ }, e), [p("path", {
1194
+ fill: "currentColor",
1195
+ d: "m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"
1196
+ }, null)]), He = /* @__PURE__ */ m({
1197
+ name: "AppTenant",
1198
+ props: {
1199
+ options: Array,
1200
+ current: String
1201
+ },
1202
+ emit: ["update:current"],
1203
+ setup(t, { emit: n }) {
1204
+ let { t: r } = e(), i = (e) => e.disabled ? p("div", null, [e.name]) : p("div", { style: "display: flex; align-items: center; justify-content: space-between; gap: 20px" }, [p("div", { style: "display: flex; align-items: center; gap: 8px" }, [p(M, {
1205
+ round: !0,
1206
+ size: 22,
1207
+ color: "var(--color-primary-hover)"
1208
+ }, { default: () => [e.icon?.() || e.name[0]] }), p("span", { style: e.id === t.current ? "color: var(--color-primary)" : "" }, [e.name])]), e.id === t.current ? p(Ve, { style: "color: var(--color-primary); font-size: 20px" }, null) : p("div", null, null)]), a = f(() => [{
1209
+ id: "___",
1210
+ name: r("common.account.changeTenant"),
1211
+ disabled: !0
1212
+ }, ...t.options ?? []]);
1213
+ return () => {
1214
+ if (!t.options?.length) return;
1215
+ let e = t.options.find((e) => e.id === t.current);
1216
+ return p(P, {
1217
+ options: a.value,
1218
+ placement: "bottom-end",
1219
+ keyField: "id",
1220
+ labelField: "name",
1221
+ showArrow: !0,
1222
+ renderLabel: i,
1223
+ onSelect: (e) => e !== t.current && n("update:current", e)
1224
+ }, { default: () => [p(N, {
1225
+ quaternary: !0,
1226
+ style: "--n-padding: 0 6px"
1227
+ }, {
1228
+ icon: () => p(F, { size: "18" }, { default: () => [p("svg", {
1229
+ xmlns: "http://www.w3.org/2000/svg",
1230
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
1231
+ viewBox: "0 0 1024 1024",
1232
+ width: "1em",
1233
+ height: "1em",
1234
+ role: "img"
1235
+ }, [p("path", {
1236
+ d: "M728 600.2c8.1-13.2 4-30.4-9.1-38.5-30.7-19-63.6-33.8-97.8-44.4 69.4-43 115.6-119.8 115.6-207.4C736.7 175.2 627.5 66 492.8 66S249 175.2 249 309.9c0 88.2 46.8 165.5 117 208.3-12.9 4.1-25.6 8.8-38.1 14.1-51.1 21.8-97 53-136.4 92.7-39.4 39.7-70.3 85.9-91.9 137.4-22.4 53.3-33.7 109.9-33.7 168.2 0 15.5 12.5 28 28 28s28-12.5 28-28c0-207.5 167.4-376.3 373.2-376.3 68.8 0 136.1 19 194.4 55 13.1 8.2 30.4 4.1 38.5-9.1zM305 309.9c0-50.2 19.5-97.4 55-132.8 35.5-35.5 82.7-55 132.8-55 50.2 0 97.4 19.5 132.8 55 35.5 35.5 55 82.7 55 132.8s-19.5 97.4-55 132.8c-35.5 35.5-82.7 55-132.8 55-50.2 0-97.4-19.5-132.8-55-35.5-35.5-55-82.6-55-132.8zM606.2 746.4h325.1c11.3 0 21.5-6.8 25.9-17.3s1.9-22.5-6.1-30.5L844.5 592.1c-10.9-10.9-28.7-10.9-39.6 0-10.9 10.9-10.9 28.7 0 39.6l58.7 58.6H606.2c-15.5 0-28 12.5-28 28s12.6 28.1 28 28.1zM931.4 794.6H606.3c-11.3 0-21.5 6.8-25.9 17.3s-1.9 22.5 6.1 30.5l106.6 106.4c5.5 5.5 12.6 8.2 19.8 8.2 7.2 0 14.4-2.7 19.8-8.2 10.9-10.9 10.9-28.7 0-39.6L674 850.6h257.4c15.5 0 28-12.5 28-28s-12.5-28-28-28z",
1237
+ fill: "currentColor"
1238
+ }, null)])] }),
1239
+ default: () => e?.shotName || e?.name
1240
+ })] });
1241
+ };
1242
+ }
1243
+ }), Ue = /* @__PURE__ */ m({
1244
+ name: "UIProvider",
1245
+ props: { i18n: Function },
1246
+ setup(e, { slots: n }) {
1247
+ return v(t, C(e, "i18n")), () => x(n, "default");
1248
+ }
1249
+ });
1250
+ //#endregion
1251
+ export { ve as AppAccount, ye as AppAppearance, xe as AppBreadcrumb, Ae as AppContent, je as AppFooter, Se as AppFullscreen, Oe as AppHeader, Ce as AppLanguage, De as AppLayout, Ne as AppLogo, Pe as AppMenu, ze as AppMultiTabs, Be as AppNotification, ke as AppSidebar, He as AppTenant, u as SpinDirectiveProvider, l as TooltipDirectiveProvider, Ue as UIProvider, c as vSpin, s as vTooltip };