@ithinkdt/ui 4.0.6 → 4.0.8
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/{DataTable-D6hPSWvx.js → DataTable-DEb9CRCZ.js} +6 -5
- package/dist/{assets-_Fpf0gbI.js → assets-bJgPKDh1.js} +3 -1
- package/dist/components.js +185 -173
- package/dist/composables.js +2 -0
- package/dist/{directives-DXNnV4xc.js → directives-pwYPe_53.js} +11 -16
- package/dist/directives.js +1 -1
- package/dist/index.js +155 -141
- package/dist/page.js +184 -183
- package/dist/{use-i18n-Cmb7Xx7d.js → use-i18n-D1TTDOML.js} +3 -1
- package/dist/use-style.js +3 -1
- package/esm/page.d.ts +2 -2
- package/package.json +10 -10
- package/unocss-preset.js +1 -1
package/dist/index.js
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
import { n as e, t } from "./use-i18n-
|
|
1
|
+
import { n as e, t } from "./use-i18n-D1TTDOML.js";
|
|
2
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-
|
|
3
|
+
import { i as s, n as c, r as l, t as u } from "./directives-pwYPe_53.js";
|
|
4
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 ee, toRef as S, toValue as C, unref as w, useTemplateRef as T, watch as E, withDirectives as D } from "vue";
|
|
5
5
|
import { computedAsync as te, promiseTimeout as O, useElementHover as k, useElementSize as ne, useEventListener as re, useFullscreen as ie, watchDebounced as ae } from "@vueuse/core";
|
|
6
6
|
import { NAvatar as A, NBadge as oe, NBreadcrumb as se, NBreadcrumbItem as ce, NButton as j, NDrawer as le, NDrawerContent as M, NDropdown as N, NEmpty as P, NIcon as F, NList as I, NListItem as L, NMenu as R, NPagination as z, NPopover as B, NScrollbar as V, NText as H, NThing as U, useThemeVars as W } from "ithinkdt-ui";
|
|
7
7
|
import { useAtomicBroadcast as ue } from "@ithinkdt/common/composables";
|
|
8
8
|
import { RouterLink as de, useRouter as G } from "vue-router";
|
|
9
9
|
import { walkTree as fe } from "@ithinkdt/common/tree";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
10
|
+
import { isNullish as pe } from "@ithinkdt/common/object";
|
|
11
|
+
import { getOpaqueColor as me } from "@ithinkdt/common/color";
|
|
12
|
+
import { format as he } from "date-fns";
|
|
13
|
+
//#region src/design/Account.jsx
|
|
12
14
|
function K(e) {
|
|
13
15
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
|
|
14
16
|
}
|
|
15
|
-
|
|
17
|
+
var ge = /* @__PURE__ */ m({
|
|
16
18
|
name: "AppAccount",
|
|
17
19
|
props: {
|
|
18
20
|
username: String,
|
|
@@ -46,76 +48,79 @@ const he = m({
|
|
|
46
48
|
fill: "currentColor",
|
|
47
49
|
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"
|
|
48
50
|
}, null)]);
|
|
49
|
-
return () =>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}, { default: () => [p("div", { style: "display: flex; align-items: center; gap: 8px" }, [p(A, {
|
|
55
|
-
key: t.head ? "head" : "no-head",
|
|
56
|
-
src: t.head,
|
|
57
|
-
round: !0,
|
|
58
|
-
size: "small",
|
|
59
|
-
radix: .78,
|
|
60
|
-
color: "var(--color-primary-hover)"
|
|
61
|
-
}, {
|
|
62
|
-
fallback: () => o,
|
|
63
|
-
placeholder: () => o,
|
|
64
|
-
default: t.head ? void 0 : () => i.value
|
|
65
|
-
}), p("span", { style: "font-size: 14px" }, [t.username ?? ""])])] }),
|
|
66
|
-
default: () => {
|
|
67
|
-
let e = () => t.showChangePwd ? p(j, {
|
|
68
|
-
quaternary: !0,
|
|
69
|
-
style: "justify-content: left",
|
|
70
|
-
onClick: () => n("change-pwd")
|
|
71
|
-
}, {
|
|
72
|
-
icon: () => p(F, null, { default: () => [p("svg", {
|
|
73
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
74
|
-
width: "1em",
|
|
75
|
-
height: "1em",
|
|
76
|
-
viewBox: "0 0 32 32"
|
|
77
|
-
}, [p("path", {
|
|
78
|
-
fill: "currentColor",
|
|
79
|
-
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"
|
|
80
|
-
}, null), p("circle", {
|
|
81
|
-
cx: "22",
|
|
82
|
-
cy: "10",
|
|
83
|
-
r: "2",
|
|
84
|
-
fill: "currentColor"
|
|
85
|
-
}, null)])] }),
|
|
86
|
-
default: () => a("common.account.changePwd")
|
|
87
|
-
}) : void 0, i = () => t.showLogoutButton ? void 0 : p(j, {
|
|
51
|
+
return () => {
|
|
52
|
+
let e;
|
|
53
|
+
return p("div", { style: "display: flex; align-items: center" }, [
|
|
54
|
+
p(B, { style: "padding: 4px" }, {
|
|
55
|
+
trigger: () => p(j, {
|
|
88
56
|
quaternary: !0,
|
|
89
|
-
style: "
|
|
90
|
-
|
|
57
|
+
style: "--n-padding: 0 12px"
|
|
58
|
+
}, { default: () => [p("div", { style: "display: flex; align-items: center; gap: 8px" }, [p(A, {
|
|
59
|
+
key: t.head ? "head" : "no-head",
|
|
60
|
+
src: t.head,
|
|
61
|
+
round: !0,
|
|
62
|
+
size: "small",
|
|
63
|
+
radix: .78,
|
|
64
|
+
color: "var(--color-primary-hover)"
|
|
91
65
|
}, {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
66
|
+
fallback: () => o,
|
|
67
|
+
placeholder: () => o,
|
|
68
|
+
default: t.head ? void 0 : () => i.value
|
|
69
|
+
}), p("span", { style: "font-size: 14px" }, [t.username ?? ""])])] }),
|
|
70
|
+
default: () => {
|
|
71
|
+
let e = () => t.showChangePwd ? p(j, {
|
|
72
|
+
quaternary: !0,
|
|
73
|
+
style: "justify-content: left",
|
|
74
|
+
onClick: () => n("change-pwd")
|
|
75
|
+
}, {
|
|
76
|
+
icon: () => p(F, null, { default: () => [p("svg", {
|
|
77
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
78
|
+
width: "1em",
|
|
79
|
+
height: "1em",
|
|
80
|
+
viewBox: "0 0 32 32"
|
|
81
|
+
}, [p("path", {
|
|
82
|
+
fill: "currentColor",
|
|
83
|
+
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"
|
|
84
|
+
}, null), p("circle", {
|
|
85
|
+
cx: "22",
|
|
86
|
+
cy: "10",
|
|
87
|
+
r: "2",
|
|
88
|
+
fill: "currentColor"
|
|
89
|
+
}, null)])] }),
|
|
90
|
+
default: () => a("common.account.changePwd")
|
|
91
|
+
}) : void 0, i = () => t.showLogoutButton ? void 0 : p(j, {
|
|
92
|
+
quaternary: !0,
|
|
93
|
+
style: "justify-content: left",
|
|
94
|
+
onClick: () => n("logout")
|
|
95
|
+
}, {
|
|
96
|
+
icon: () => p(F, null, K(c) ? c : { default: () => [c] }),
|
|
97
|
+
default: () => [a("common.account.logout")]
|
|
98
|
+
});
|
|
99
|
+
return x(r, "dropdown", {
|
|
100
|
+
pwd: e,
|
|
101
|
+
logout: i
|
|
102
|
+
}, () => [p("div", { style: "display: flex; flex-direction: column" }, [
|
|
103
|
+
e(),
|
|
104
|
+
x(r, "dropdownExtra"),
|
|
105
|
+
i()
|
|
106
|
+
])]);
|
|
107
|
+
}
|
|
108
|
+
}),
|
|
109
|
+
x(r, "extra"),
|
|
110
|
+
t.showLogoutButton ? D(p(j, {
|
|
111
|
+
quaternary: !0,
|
|
112
|
+
style: "--n-padding: 0 12px",
|
|
113
|
+
onClick: () => t.username && n("logout")
|
|
114
|
+
}, K(e = x(r, "logoutButton", void 0, () => [p(F, { size: "16" }, K(c) ? c : { default: () => [c] })])) ? e : { default: () => [e] }), [[
|
|
115
|
+
s,
|
|
116
|
+
a("common.account.logout"),
|
|
117
|
+
void 0,
|
|
118
|
+
{ "bottom-end": !0 }
|
|
119
|
+
]]) : void 0
|
|
120
|
+
]);
|
|
121
|
+
};
|
|
117
122
|
}
|
|
118
|
-
}),
|
|
123
|
+
}), _e = /* @__PURE__ */ m({
|
|
119
124
|
name: "AppAppearance",
|
|
120
125
|
props: { mode: String },
|
|
121
126
|
emit: ["update:mode"],
|
|
@@ -175,10 +180,12 @@ const he = m({
|
|
|
175
180
|
fill: "currentColor",
|
|
176
181
|
d: "m17 18l-5-2.18L7 18V5h10m0-2H7a2 2 0 0 0-2 2v16l7-3l7 3V5a2 2 0 0 0-2-2Z"
|
|
177
182
|
}, null)]), Y = "__APP_CTX__", X = () => h(Y);
|
|
178
|
-
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region src/design/Breadcrumb.jsx
|
|
185
|
+
function ve(e) {
|
|
179
186
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
|
|
180
187
|
}
|
|
181
|
-
|
|
188
|
+
var ye = /* @__PURE__ */ m({
|
|
182
189
|
name: "AppBreadcrumb",
|
|
183
190
|
props: {
|
|
184
191
|
items: {
|
|
@@ -198,7 +205,7 @@ const ve = m({
|
|
|
198
205
|
});
|
|
199
206
|
}, { immediate: !0 }), () => {
|
|
200
207
|
let n;
|
|
201
|
-
return p(se, null,
|
|
208
|
+
return p(se, null, ve(n = e.items.map((e) => p(ce, {
|
|
202
209
|
clickable: e.href?.length > 0,
|
|
203
210
|
separator: e.separator,
|
|
204
211
|
onClick: e.href && ((n) => {
|
|
@@ -207,7 +214,7 @@ const ve = m({
|
|
|
207
214
|
}, { default: () => [e.icon ? p(d, null, [p(F, { component: e[r] }, null), " "]) : void 0, C(e.title)] }))) ? n : { default: () => [n] });
|
|
208
215
|
};
|
|
209
216
|
}
|
|
210
|
-
}),
|
|
217
|
+
}), be = /* @__PURE__ */ m({
|
|
211
218
|
name: "AppFullscreen",
|
|
212
219
|
props: {},
|
|
213
220
|
emit: ["change"],
|
|
@@ -250,7 +257,7 @@ const ve = m({
|
|
|
250
257
|
{ bottom: !0 }
|
|
251
258
|
]]);
|
|
252
259
|
}
|
|
253
|
-
}),
|
|
260
|
+
}), xe = /* @__PURE__ */ m({
|
|
254
261
|
name: "AppLanguage",
|
|
255
262
|
props: {
|
|
256
263
|
lang: String,
|
|
@@ -281,8 +288,7 @@ const ve = m({
|
|
|
281
288
|
"stroke-width": "1.5"
|
|
282
289
|
}, [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)])])] })] })] });
|
|
283
290
|
}
|
|
284
|
-
})
|
|
285
|
-
var xe = r([
|
|
291
|
+
}), Se = /* @__PURE__ */ r([
|
|
286
292
|
i("layout", {
|
|
287
293
|
display: "grid",
|
|
288
294
|
gridTemplateAreas: "\n 'sider header'\n 'sider content'\n 'sider footer'\n ",
|
|
@@ -333,7 +339,7 @@ var xe = r([
|
|
|
333
339
|
textAlign: "center",
|
|
334
340
|
color: "gray"
|
|
335
341
|
})
|
|
336
|
-
]),
|
|
342
|
+
]), Ce = () => p("svg", {
|
|
337
343
|
xmlns: "http://www.w3.org/2000/svg",
|
|
338
344
|
width: "1em",
|
|
339
345
|
height: "1em",
|
|
@@ -346,7 +352,7 @@ var xe = r([
|
|
|
346
352
|
"stroke-width": "1.5",
|
|
347
353
|
d: "M11.5 18s-6-4.419-6-6s6-6 6-6m7 12s-6-4.419-6-6s6-6 6-6",
|
|
348
354
|
color: "currentColor"
|
|
349
|
-
}, null)]),
|
|
355
|
+
}, null)]), we = () => p("svg", {
|
|
350
356
|
xmlns: "http://www.w3.org/2000/svg",
|
|
351
357
|
width: "1em",
|
|
352
358
|
height: "1em",
|
|
@@ -359,8 +365,7 @@ var xe = r([
|
|
|
359
365
|
"stroke-width": "1.5",
|
|
360
366
|
d: "M12.5 18s6-4.419 6-6s-6-6-6-6m-7 12s6-4.419 6-6s-6-6-6-6",
|
|
361
367
|
color: "currentColor"
|
|
362
|
-
}, null)])
|
|
363
|
-
const we = m({
|
|
368
|
+
}, null)]), Te = /* @__PURE__ */ m({
|
|
364
369
|
name: "AppLayout",
|
|
365
370
|
props: {
|
|
366
371
|
layout: {
|
|
@@ -370,7 +375,7 @@ const we = m({
|
|
|
370
375
|
fullContent: Boolean
|
|
371
376
|
},
|
|
372
377
|
setup(e, { slots: t }) {
|
|
373
|
-
n("-layout",
|
|
378
|
+
n("-layout", Se, b("app"), !1);
|
|
374
379
|
let r = y({
|
|
375
380
|
siderWidth: "0px",
|
|
376
381
|
headerHeight: "0px",
|
|
@@ -393,7 +398,7 @@ const we = m({
|
|
|
393
398
|
}, [x(t, "default")]);
|
|
394
399
|
};
|
|
395
400
|
}
|
|
396
|
-
}),
|
|
401
|
+
}), Ee = /* @__PURE__ */ m({
|
|
397
402
|
name: "AppHeader",
|
|
398
403
|
props: { height: {
|
|
399
404
|
type: Number,
|
|
@@ -403,7 +408,7 @@ const we = m({
|
|
|
403
408
|
let n = X();
|
|
404
409
|
return () => (n.headerHeight = e.height + "px", p("div", { class: "app-header" }, [x(t, "default")]));
|
|
405
410
|
}
|
|
406
|
-
}),
|
|
411
|
+
}), De = /* @__PURE__ */ m({
|
|
407
412
|
name: "AppSidebar",
|
|
408
413
|
props: {
|
|
409
414
|
showCollapseBtn: {
|
|
@@ -430,14 +435,14 @@ const we = m({
|
|
|
430
435
|
onClick: () => {
|
|
431
436
|
n("update:collapsed", !t.collapsed);
|
|
432
437
|
}
|
|
433
|
-
}, { default: () => [p(F, { size: "20" }, { default: () => [t.collapsed ? p(
|
|
438
|
+
}, { default: () => [p(F, { size: "20" }, { default: () => [t.collapsed ? p(we, null, null) : p(Ce, null, null)] })] }), [[s, t.collapsed ? i("common.layout.sider.expand") : i("common.layout.sider.collapse")]]) : void 0]));
|
|
434
439
|
}
|
|
435
|
-
}),
|
|
440
|
+
}), Oe = /* @__PURE__ */ m({
|
|
436
441
|
name: "AppContent",
|
|
437
442
|
setup(e, { slots: t }) {
|
|
438
443
|
return () => p("div", { class: "app-content" }, [x(t, "default")]);
|
|
439
444
|
}
|
|
440
|
-
}),
|
|
445
|
+
}), ke = /* @__PURE__ */ m({
|
|
441
446
|
name: "AppFooter",
|
|
442
447
|
props: { height: {
|
|
443
448
|
type: Number,
|
|
@@ -448,10 +453,12 @@ const we = m({
|
|
|
448
453
|
return () => (n.footerHeight = e.height + "px", p("div", { class: "app-footer" }, [x(t, "default")]));
|
|
449
454
|
}
|
|
450
455
|
});
|
|
451
|
-
|
|
456
|
+
//#endregion
|
|
457
|
+
//#region src/design/Logo.jsx
|
|
458
|
+
function Ae(e) {
|
|
452
459
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
|
|
453
460
|
}
|
|
454
|
-
|
|
461
|
+
var je = /* @__PURE__ */ m({
|
|
455
462
|
name: "AppLogo",
|
|
456
463
|
props: {
|
|
457
464
|
src: [String, Function],
|
|
@@ -487,7 +494,7 @@ const Z = m({
|
|
|
487
494
|
justifyContent: o ? "center" : "flex-start",
|
|
488
495
|
cursor: s ? "pointer" : void 0
|
|
489
496
|
}
|
|
490
|
-
}, [t
|
|
497
|
+
}, [x(t, "default", void 0, () => [p("div", {
|
|
491
498
|
class: "app-logo__img",
|
|
492
499
|
style: `
|
|
493
500
|
width: ${a ? "var(--app-sider-width, 60px)" : "56px"};
|
|
@@ -497,21 +504,23 @@ const Z = m({
|
|
|
497
504
|
display: flex;
|
|
498
505
|
justify-content: center
|
|
499
506
|
`
|
|
500
|
-
}, [t
|
|
507
|
+
}, [x(t, "icon", void 0, () => [p("img", {
|
|
501
508
|
src: n.value,
|
|
502
509
|
alt: "App Logo",
|
|
503
510
|
style: `transition: height 0.2s ease-in-out; height: calc(var(--app-logo-img-size) * ${c})`
|
|
504
|
-
}, null)]), i ? p(H, {
|
|
511
|
+
}, null)])])]), i ? p(H, {
|
|
505
512
|
class: "app-logo__name",
|
|
506
513
|
style: "font-size: var(--app-logo-name-size); font-weight: bold; white-space: nowrap; flex: 0 1 auto; overflow: hidden"
|
|
507
|
-
},
|
|
514
|
+
}, Ae(i) ? i : { default: () => [i] }) : void 0]);
|
|
508
515
|
};
|
|
509
516
|
}
|
|
510
517
|
});
|
|
511
|
-
|
|
518
|
+
//#endregion
|
|
519
|
+
//#region src/design/Menu.jsx
|
|
520
|
+
function Z(e) {
|
|
512
521
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
|
|
513
522
|
}
|
|
514
|
-
|
|
523
|
+
var Me = /* @__PURE__ */ m({
|
|
515
524
|
name: "AppMenu",
|
|
516
525
|
props: {
|
|
517
526
|
menus: Array,
|
|
@@ -546,7 +555,7 @@ const Ae = m({
|
|
|
546
555
|
_: o,
|
|
547
556
|
key: o.key,
|
|
548
557
|
label: () => e.renderLabel?.(o) ?? o.name,
|
|
549
|
-
icon: n === 0 || o.icon ? typeof o.icon == "string" ? e.getIcon?.(o.icon, o) ?? J : o.icon : void 0,
|
|
558
|
+
icon: n === 0 || o.icon ? pe(o.icon) || typeof o.icon == "string" ? e.getIcon?.(o.icon, o) ?? J : o.icon : void 0,
|
|
550
559
|
children: r ? void 0 : t,
|
|
551
560
|
path: o.path || (r ? t?.[0]?.path : void 0),
|
|
552
561
|
depth: n
|
|
@@ -568,7 +577,7 @@ const Ae = m({
|
|
|
568
577
|
}, [t.label()]);
|
|
569
578
|
else {
|
|
570
579
|
let e;
|
|
571
|
-
i = p(de, { to: t.path },
|
|
580
|
+
i = p(de, { to: t.path }, Z(e = t.label()) ? e : { default: () => [e] });
|
|
572
581
|
}
|
|
573
582
|
else i = p("span", null, [t.label()]);
|
|
574
583
|
return i.key = `${t.key}:${r ? 1 : 0}`, t.depth === 0 && !r && (i = D(p("div", null, [i]), [[
|
|
@@ -605,11 +614,16 @@ const Ae = m({
|
|
|
605
614
|
collapsedWidth: e.collapsedWidth,
|
|
606
615
|
width: e.width
|
|
607
616
|
}, null);
|
|
608
|
-
return e.horizontal ? i : p(V, null,
|
|
617
|
+
return e.horizontal ? i : p(V, null, Z(i) ? i : { default: () => [i] });
|
|
609
618
|
};
|
|
610
619
|
}
|
|
611
620
|
});
|
|
612
|
-
|
|
621
|
+
//#endregion
|
|
622
|
+
//#region src/design/MultiTabs.jsx
|
|
623
|
+
function Ne(e) {
|
|
624
|
+
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
|
|
625
|
+
}
|
|
626
|
+
function Pe(t, n, r) {
|
|
613
627
|
let { t: i } = e(), a = y({
|
|
614
628
|
visible: !1,
|
|
615
629
|
x: 0,
|
|
@@ -781,7 +795,7 @@ function je(t, n, r) {
|
|
|
781
795
|
}
|
|
782
796
|
};
|
|
783
797
|
}
|
|
784
|
-
function
|
|
798
|
+
function Fe(e, t, n) {
|
|
785
799
|
function r(n) {
|
|
786
800
|
if (n === -1 || !t.value?.children.length) return;
|
|
787
801
|
let r = t.value.children[n];
|
|
@@ -799,7 +813,7 @@ function Me(e, t, n) {
|
|
|
799
813
|
content: t
|
|
800
814
|
};
|
|
801
815
|
}
|
|
802
|
-
var
|
|
816
|
+
var Q = (e) => p("svg", e, [
|
|
803
817
|
p("defs", null, [
|
|
804
818
|
p("symbol", {
|
|
805
819
|
id: "geometry-left",
|
|
@@ -835,7 +849,7 @@ var Ne = (e) => p("svg", e, [
|
|
|
835
849
|
height: "36",
|
|
836
850
|
fill: "currentColor"
|
|
837
851
|
}, null)])])
|
|
838
|
-
]),
|
|
852
|
+
]), Ie = /* @__PURE__ */ m({
|
|
839
853
|
name: "AppTab",
|
|
840
854
|
props: {
|
|
841
855
|
path: String,
|
|
@@ -862,7 +876,7 @@ var Ne = (e) => p("svg", e, [
|
|
|
862
876
|
top: "0",
|
|
863
877
|
left: "-14px",
|
|
864
878
|
zIndex: e.isCurrent ? -1 : -2,
|
|
865
|
-
color: e.isCurrent ?
|
|
879
|
+
color: e.isCurrent ? me(c.value.primaryColor, e.dark ? .3 : .12, e.dark ? "#000" : "#fff") : i.value ? c.value.borderColor : "transparent"
|
|
866
880
|
}));
|
|
867
881
|
return () => p("div", {
|
|
868
882
|
ref: r,
|
|
@@ -874,7 +888,7 @@ var Ne = (e) => p("svg", e, [
|
|
|
874
888
|
}, [p("div", {
|
|
875
889
|
ref: o,
|
|
876
890
|
style: "display: flex; align-items: center; gap: 4px; width: fit-content"
|
|
877
|
-
}, [p("span", { style: l.value }, [n
|
|
891
|
+
}, [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(j, {
|
|
878
892
|
text: !0,
|
|
879
893
|
onClick: (e) => {
|
|
880
894
|
e.stopPropagation(), t("close");
|
|
@@ -889,11 +903,10 @@ var Ne = (e) => p("svg", e, [
|
|
|
889
903
|
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"
|
|
890
904
|
}, null)])] })] })]) : void 0])]),
|
|
891
905
|
p("span", { style: "height: 50%; width: 1px; background: #aaa; display: inline-block; position: absolute; top: 20%; right: -4px; z-index: -3" }, null),
|
|
892
|
-
p(
|
|
906
|
+
p(Q, { style: u.value }, null)
|
|
893
907
|
]);
|
|
894
908
|
}
|
|
895
|
-
})
|
|
896
|
-
const Fe = m({
|
|
909
|
+
}), Le = /* @__PURE__ */ m({
|
|
897
910
|
name: "AppMultiTabs",
|
|
898
911
|
props: {
|
|
899
912
|
fullTab: Boolean,
|
|
@@ -906,8 +919,8 @@ const Fe = m({
|
|
|
906
919
|
setup(e, { emit: t, slots: n }) {
|
|
907
920
|
let r = X();
|
|
908
921
|
r.hasMultiTab = !0;
|
|
909
|
-
let i = G(), { ctx: a, onCtx: o, onClickOutside: s, options: c, onSelect: l } =
|
|
910
|
-
return
|
|
922
|
+
let i = G(), { ctx: a, onCtx: o, onClickOutside: s, options: c, onSelect: l } = Pe(S(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();
|
|
923
|
+
return Fe(d, m, u), () => p("div", { style: "width: 100%; height: 100%; overflow: hidden; display: flex; justify-content: space-between" }, [p("div", {
|
|
911
924
|
ref: d,
|
|
912
925
|
style: "flex: 1 1 100%; height: 100%; display: flex; overflow: hidden; align-items: center; position: relative"
|
|
913
926
|
}, [
|
|
@@ -917,23 +930,23 @@ const Fe = m({
|
|
|
917
930
|
style: "padding-inline: 12px; flex: 1 1 auto; display: flex; align-items: end; gap: 8px; height: 100%",
|
|
918
931
|
onContextmenu: (e) => o(e)
|
|
919
932
|
}, [e.tabs.map((t, r, a) => {
|
|
920
|
-
let s = e.current?.key === t.key,
|
|
921
|
-
return p(
|
|
933
|
+
let s, c = e.current?.key === t.key, l = t.title ?? t.path;
|
|
934
|
+
return p(Ie, {
|
|
922
935
|
key: t.key,
|
|
923
|
-
isCurrent:
|
|
936
|
+
isCurrent: c,
|
|
924
937
|
isLast: r === a.length - 1,
|
|
925
938
|
onClose: t.close,
|
|
926
939
|
closable: t.closable,
|
|
927
940
|
dark: e.dark,
|
|
928
941
|
onClick: () => {
|
|
929
|
-
|
|
942
|
+
c || i.push(t.fullPath);
|
|
930
943
|
},
|
|
931
944
|
onContextmenu: (e) => o(e, t)
|
|
932
|
-
},
|
|
933
|
-
isCurrent:
|
|
934
|
-
name:
|
|
945
|
+
}, Ne(s = x(n, "name", {
|
|
946
|
+
isCurrent: c,
|
|
947
|
+
name: l,
|
|
935
948
|
tab: t
|
|
936
|
-
}) :
|
|
949
|
+
}, () => [l])) ? s : { default: () => [s] });
|
|
937
950
|
})]),
|
|
938
951
|
p("div", { style: "height: 100%; flex: 0 0 16px; z-index: 1; position: sticky; right: 0; backdrop-filter: opacity(0.9) blur(5px)" }, null)
|
|
939
952
|
]), p(N, {
|
|
@@ -948,10 +961,12 @@ const Fe = m({
|
|
|
948
961
|
}, null)]);
|
|
949
962
|
}
|
|
950
963
|
});
|
|
964
|
+
//#endregion
|
|
965
|
+
//#region src/design/Notification.jsx
|
|
951
966
|
function $(e) {
|
|
952
967
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !g(e);
|
|
953
968
|
}
|
|
954
|
-
|
|
969
|
+
var Re = /* @__PURE__ */ m({
|
|
955
970
|
name: "AppNotification",
|
|
956
971
|
inheritAttrs: !1,
|
|
957
972
|
props: {
|
|
@@ -986,13 +1001,13 @@ const Ie = m({
|
|
|
986
1001
|
immediate: !0
|
|
987
1002
|
});
|
|
988
1003
|
return () => {
|
|
989
|
-
let e = D(p(j, _(r, {
|
|
1004
|
+
let e, f = D(p(j, _(r, {
|
|
990
1005
|
quaternary: !0,
|
|
991
1006
|
style: "--n-padding: 0 12px",
|
|
992
1007
|
onClick: () => {
|
|
993
1008
|
a.value = !0, o.value = l.unread > 0 ? "unread" : "all", setTimeout(u, 300);
|
|
994
1009
|
}
|
|
995
|
-
}),
|
|
1010
|
+
}), $(e = x(n, "icon", void 0, () => [p(oe, {
|
|
996
1011
|
show: l.unread > 0,
|
|
997
1012
|
dot: !0,
|
|
998
1013
|
offset: [-2, 5],
|
|
@@ -1009,12 +1024,12 @@ const Ie = m({
|
|
|
1009
1024
|
"stroke-linejoin": "round",
|
|
1010
1025
|
"stroke-width": "1.5",
|
|
1011
1026
|
color: "currentColor"
|
|
1012
|
-
}, [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)])])] })] })] }), [[
|
|
1027
|
+
}, [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] }), [[
|
|
1013
1028
|
s,
|
|
1014
1029
|
i("common.notification.tip", { count: l.unread }),
|
|
1015
1030
|
void 0,
|
|
1016
1031
|
{ bottom: !0 }
|
|
1017
|
-
]]),
|
|
1032
|
+
]]), m = () => {
|
|
1018
1033
|
let e, t;
|
|
1019
1034
|
return p("div", { style: "display: flex; align-items: baseline; gap: 20px" }, [
|
|
1020
1035
|
p("div", { style: "padding-right: 12px" }, [i("common.notification.title")]),
|
|
@@ -1033,7 +1048,7 @@ const Ie = m({
|
|
|
1033
1048
|
}
|
|
1034
1049
|
}, $(t = i("common.notification.unread", { count: l.unread > 99 ? "99+" : l.unread.toString() })) ? t : { default: () => [t] })
|
|
1035
1050
|
]);
|
|
1036
|
-
},
|
|
1051
|
+
}, h = (e) => p(L, {
|
|
1037
1052
|
key: e.key,
|
|
1038
1053
|
onClick: () => {
|
|
1039
1054
|
e.status === "unread" && (t.markRead?.([e.key]).then(() => {
|
|
@@ -1086,15 +1101,15 @@ const Ie = m({
|
|
|
1086
1101
|
}, $(r = i("common.notification.markDelete")) ? r : { default: () => [r] })]) : void 0;
|
|
1087
1102
|
},
|
|
1088
1103
|
default: e.content,
|
|
1089
|
-
footer: () => p("span", { style: "color: gray" }, [e.hover ?
|
|
1090
|
-
})] }),
|
|
1104
|
+
footer: () => p("span", { style: "color: gray" }, [e.hover ? he(e.date, i("common.notification.time")) : i("common.timeago", { time: e.date })])
|
|
1105
|
+
})] }), g = () => {
|
|
1091
1106
|
let e;
|
|
1092
1107
|
return D(l.records.length > 0 ? p(I, {
|
|
1093
1108
|
clickable: !0,
|
|
1094
1109
|
hoverable: !0,
|
|
1095
1110
|
style: "min-height: 50vh"
|
|
1096
|
-
}, $(e = l.records.map((e) =>
|
|
1097
|
-
},
|
|
1111
|
+
}, $(e = l.records.map((e) => h(e))) ? e : { default: () => [e] }) : p(P, { style: "margin-top: 30vh" }, null), [[c, l.loading]]);
|
|
1112
|
+
}, v = () => p("div", { style: "display: flex; justify-content: space-between; width: 100%" }, [o.value === "unread" ? p(j, {
|
|
1098
1113
|
text: !0,
|
|
1099
1114
|
type: "primary",
|
|
1100
1115
|
disabled: l.records.length === 0,
|
|
@@ -1125,7 +1140,7 @@ const Ie = m({
|
|
|
1125
1140
|
l.page = e, u();
|
|
1126
1141
|
}
|
|
1127
1142
|
}, null)]);
|
|
1128
|
-
return p(d, null, [
|
|
1143
|
+
return p(d, null, [f, p(le, {
|
|
1129
1144
|
show: a.value,
|
|
1130
1145
|
"onUpdate:show": (e) => a.value = e,
|
|
1131
1146
|
showMask: !1,
|
|
@@ -1136,14 +1151,13 @@ const Ie = m({
|
|
|
1136
1151
|
nativeScrollbar: !1,
|
|
1137
1152
|
bodyContentStyle: { padding: "0" }
|
|
1138
1153
|
}, {
|
|
1139
|
-
header:
|
|
1140
|
-
default:
|
|
1141
|
-
footer:
|
|
1154
|
+
header: m,
|
|
1155
|
+
default: g,
|
|
1156
|
+
footer: v
|
|
1142
1157
|
})] })]);
|
|
1143
1158
|
};
|
|
1144
1159
|
}
|
|
1145
|
-
})
|
|
1146
|
-
var Le = (e) => p("svg", _({
|
|
1160
|
+
}), ze = (e) => p("svg", _({
|
|
1147
1161
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1148
1162
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
1149
1163
|
role: "img",
|
|
@@ -1153,8 +1167,7 @@ var Le = (e) => p("svg", _({
|
|
|
1153
1167
|
}, e), [p("path", {
|
|
1154
1168
|
fill: "currentColor",
|
|
1155
1169
|
d: "m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"
|
|
1156
|
-
}, null)])
|
|
1157
|
-
const Re = m({
|
|
1170
|
+
}, null)]), Be = /* @__PURE__ */ m({
|
|
1158
1171
|
name: "AppTenant",
|
|
1159
1172
|
props: {
|
|
1160
1173
|
options: Array,
|
|
@@ -1166,7 +1179,7 @@ const Re = m({
|
|
|
1166
1179
|
round: !0,
|
|
1167
1180
|
size: 22,
|
|
1168
1181
|
color: "var(--color-primary-hover)"
|
|
1169
|
-
}, { default: () => [e.icon?.() || e.name[0]] }), p("span", { style: e.id === t.current ? "color: var(--color-primary)" : "" }, [e.name])]), e.id === t.current ? p(
|
|
1182
|
+
}, { default: () => [e.icon?.() || e.name[0]] }), p("span", { style: e.id === t.current ? "color: var(--color-primary)" : "" }, [e.name])]), e.id === t.current ? p(ze, { style: "color: var(--color-primary); font-size: 20px" }, null) : p("div", null, null)]), a = f(() => [{
|
|
1170
1183
|
id: "___",
|
|
1171
1184
|
name: r("common.account.changeTenant"),
|
|
1172
1185
|
disabled: !0
|
|
@@ -1201,11 +1214,12 @@ const Re = m({
|
|
|
1201
1214
|
})] });
|
|
1202
1215
|
};
|
|
1203
1216
|
}
|
|
1204
|
-
}),
|
|
1217
|
+
}), Ve = /* @__PURE__ */ m({
|
|
1205
1218
|
name: "UIProvider",
|
|
1206
1219
|
props: { i18n: Function },
|
|
1207
1220
|
setup(e, { slots: n }) {
|
|
1208
|
-
return v(t, S(e, "i18n")), () => n
|
|
1221
|
+
return v(t, S(e, "i18n")), () => x(n, "default");
|
|
1209
1222
|
}
|
|
1210
1223
|
});
|
|
1211
|
-
|
|
1224
|
+
//#endregion
|
|
1225
|
+
export { ge as AppAccount, _e as AppAppearance, ye as AppBreadcrumb, Oe as AppContent, ke as AppFooter, be as AppFullscreen, Ee as AppHeader, xe as AppLanguage, Te as AppLayout, je as AppLogo, Me as AppMenu, Le as AppMultiTabs, Re as AppNotification, De as AppSidebar, Be as AppTenant, u as SpinDirectiveProvider, l as TooltipDirectiveProvider, Ve as UIProvider, c as vSpin, s as vTooltip };
|