@ithinkdt/ui 4.1.1 → 4.2.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/{DataTable-D1Z9h8V1.js → DataTable-D5VMWw2x.js} +4 -6
- package/esm/{components-CwMUuo3f.js → components-BA7KsV1q.js} +362 -285
- package/esm/components.d.ts +11 -2
- package/esm/components.js +1 -1
- package/esm/composables.js +1 -1
- package/esm/{directives-G7hy3akL.js → directives--_Z8BQhu.js} +2 -2
- package/esm/directives.js +1 -1
- package/esm/index.js +69 -71
- package/esm/page.js +12 -12
- package/esm/{use-i18n-BUP_StIp.js → use-i18n-BMlVGLEB.js} +1 -1
- package/esm/{use-table-range-select-B6KrCUln.js → use-table-range-select-BOqsUOeY.js} +7 -4
- package/package.json +8 -8
package/esm/components.d.ts
CHANGED
|
@@ -325,7 +325,7 @@ export interface DataCustomProps<Data extends {}> {
|
|
|
325
325
|
| ((modify: {
|
|
326
326
|
key: string
|
|
327
327
|
hidden?: boolean | undefined
|
|
328
|
-
fixed?: 'left' | 'right' |
|
|
328
|
+
fixed?: false | 'left' | 'right' | undefined
|
|
329
329
|
}) => void)>
|
|
330
330
|
| undefined
|
|
331
331
|
}
|
|
@@ -336,8 +336,17 @@ export interface DataCustomEmits {
|
|
|
336
336
|
(e: 'custom', modify: {
|
|
337
337
|
key: string
|
|
338
338
|
hidden?: boolean | undefined
|
|
339
|
-
fixed?: 'left' | 'right' |
|
|
339
|
+
fixed?: false | 'left' | 'right' | undefined
|
|
340
340
|
}): void
|
|
341
|
+
(e: 'custom', batchs: Array<
|
|
342
|
+
| true
|
|
343
|
+
| string[]
|
|
344
|
+
| {
|
|
345
|
+
key: string
|
|
346
|
+
hidden?: boolean | undefined
|
|
347
|
+
fixed?: false | 'left' | 'right' | undefined
|
|
348
|
+
}>
|
|
349
|
+
): void
|
|
341
350
|
}
|
|
342
351
|
|
|
343
352
|
export declare function DataCustom<Data extends {}>(
|
package/esm/components.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { S as e, _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y, w as b, x, y as S } from "./components-
|
|
1
|
+
import { S as e, _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y, w as b, x, y as S } from "./components-BA7KsV1q.js";
|
|
2
2
|
export { e as DataActions, x as DataCustom, r as DataDescriptions, s as DataFilter, t as DataForm, y as DataFormActions, d as DataLocaleInput, m as DataPagination, a as DataSelection, _ as DataTable, l as DtDeptRender, n as DtUserDept, p as DtUserRender, v as FullscreenButton, u as FullscreenWrapper, b as NCheckboxes, i as NRadios, f as NStateButton, h as StateButtonProps, o as ViewProfile, S as dataFormActionsProps, g as renderUsers, c as useLocaleEdit };
|
package/esm/composables.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./use-table-range-select-
|
|
1
|
+
import { t as e } from "./use-table-range-select-BOqsUOeY.js";
|
|
2
2
|
import { nextTick as t, ref as n, watch as r } from "vue";
|
|
3
3
|
import { unrefElement as i } from "@vueuse/core";
|
|
4
4
|
import { Sortable as a } from "sortablejs";
|
|
@@ -35,7 +35,7 @@ var C = [
|
|
|
35
35
|
whiteSpace: "normal",
|
|
36
36
|
lineHeight: "1.25"
|
|
37
37
|
})
|
|
38
|
-
]), T = /* @__PURE__ */ Symbol("
|
|
38
|
+
]), T = /* @__PURE__ */ Symbol("__TOOLTIP_DIRECTIVE__"), E = /* @__PURE__ */ f();
|
|
39
39
|
function D(e) {
|
|
40
40
|
let t = e.firstChild;
|
|
41
41
|
if (!t) return !1;
|
|
@@ -163,7 +163,7 @@ var O, k, A, j = /* @__PURE__ */ s({
|
|
|
163
163
|
setup(t) {
|
|
164
164
|
return F = e("-spin-directive", L), I = p(t, "dark"), () => c(a);
|
|
165
165
|
}
|
|
166
|
-
}), z = /* @__PURE__ */ Symbol("
|
|
166
|
+
}), z = /* @__PURE__ */ Symbol("__SPIN_DIRECTIVE__"), B = (e, { value: t, modifiers: n }) => {
|
|
167
167
|
if (e[z].loading.value = !!t, !e[z].loading.value) return;
|
|
168
168
|
let r = n.dark || !n.light && I.value;
|
|
169
169
|
e[z].spinEl.style.setProperty("--host-bg", r ? "0 0 0" : "255 255 255");
|
package/esm/directives.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as e, n as t, r as n, t as r } from "./directives
|
|
1
|
+
import { i as e, n as t, r as n, t as r } from "./directives--_Z8BQhu.js";
|
|
2
2
|
export { r as SpinDirectiveProvider, n as TooltipDirectiveProvider, t as vSpin, e as vTooltip };
|
package/esm/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { n as e, t } from "./use-i18n-
|
|
1
|
+
import { n as e, t } from "./use-i18n-BMlVGLEB.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--_Z8BQhu.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 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, watchDebounced as re } from "@vueuse/core";
|
|
6
|
-
import { NAvatar as
|
|
7
|
-
import { debounce as
|
|
8
|
-
import { useAtomicBroadcast as de } from "@ithinkdt/common/composables";
|
|
5
|
+
import { computedAsync as ee, promiseTimeout as k, useElementHover as A, useElementSize as te, useEventListener as j, useIntervalFn as ne, 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";
|
|
9
8
|
import { RouterLink as fe, useRouter as G } from "vue-router";
|
|
10
9
|
import { walkTree as pe } from "@ithinkdt/common/tree";
|
|
11
10
|
import { isNullish as me } from "@ithinkdt/common/object";
|
|
@@ -32,7 +31,7 @@ var _e = /* @__PURE__ */ m({
|
|
|
32
31
|
},
|
|
33
32
|
emit: ["logout", "change-pwd"],
|
|
34
33
|
setup(t, { emit: n, slots: r }) {
|
|
35
|
-
let i = f(() => /^[\u{4E00}-\u{9FA5}]+$/u.test(t.nickname) ? t.nickname?.slice(t.nickname?.length > 3 ? 2 : 1) : t.nickname?.split(" ", 1)[0]), { t: a } = e(), o = p(
|
|
34
|
+
let i = f(() => /^[\u{4E00}-\u{9FA5}]+$/u.test(t.nickname) ? t.nickname?.slice(t.nickname?.length > 3 ? 2 : 1) : t.nickname?.split(" ", 1)[0]), { t: a } = e(), o = p(F, { size: "28" }, { default: () => [p("svg", {
|
|
36
35
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37
36
|
width: "1em",
|
|
38
37
|
height: "1em",
|
|
@@ -52,11 +51,11 @@ var _e = /* @__PURE__ */ m({
|
|
|
52
51
|
return () => {
|
|
53
52
|
let e;
|
|
54
53
|
return p("div", { style: "display: flex; align-items: center" }, [
|
|
55
|
-
p(
|
|
56
|
-
trigger: () => p(
|
|
54
|
+
p(V, { style: "padding: 4px" }, {
|
|
55
|
+
trigger: () => p(N, {
|
|
57
56
|
quaternary: !0,
|
|
58
57
|
style: "--n-padding: 0 12px"
|
|
59
|
-
}, { default: () => [p("div", { style: "display: flex; align-items: center; gap: 8px" }, [p(
|
|
58
|
+
}, { default: () => [p("div", { style: "display: flex; align-items: center; gap: 8px" }, [p(M, {
|
|
60
59
|
key: t.head ? "head" : "no-head",
|
|
61
60
|
src: t.head,
|
|
62
61
|
round: !0,
|
|
@@ -69,12 +68,12 @@ var _e = /* @__PURE__ */ m({
|
|
|
69
68
|
default: t.head ? void 0 : () => i.value
|
|
70
69
|
}), p("span", { style: "font-size: 14px" }, [t.username ?? ""])])] }),
|
|
71
70
|
default: () => {
|
|
72
|
-
let e = () => t.showChangePwd ? p(
|
|
71
|
+
let e = () => t.showChangePwd ? p(N, {
|
|
73
72
|
quaternary: !0,
|
|
74
73
|
style: "justify-content: left",
|
|
75
74
|
onClick: () => n("change-pwd")
|
|
76
75
|
}, {
|
|
77
|
-
icon: () => p(
|
|
76
|
+
icon: () => p(F, null, { default: () => [p("svg", {
|
|
78
77
|
xmlns: "http://www.w3.org/2000/svg",
|
|
79
78
|
width: "1em",
|
|
80
79
|
height: "1em",
|
|
@@ -89,12 +88,12 @@ var _e = /* @__PURE__ */ m({
|
|
|
89
88
|
fill: "currentColor"
|
|
90
89
|
}, null)])] }),
|
|
91
90
|
default: () => a("common.account.changePwd")
|
|
92
|
-
}) : void 0, i = () => t.showLogoutButton ? void 0 : p(
|
|
91
|
+
}) : void 0, i = () => t.showLogoutButton ? void 0 : p(N, {
|
|
93
92
|
quaternary: !0,
|
|
94
93
|
style: "justify-content: left",
|
|
95
94
|
onClick: () => n("logout")
|
|
96
95
|
}, {
|
|
97
|
-
icon: () => p(
|
|
96
|
+
icon: () => p(F, null, K(c) ? c : { default: () => [c] }),
|
|
98
97
|
default: () => [a("common.account.logout")]
|
|
99
98
|
});
|
|
100
99
|
return x(r, "dropdown", {
|
|
@@ -108,11 +107,11 @@ var _e = /* @__PURE__ */ m({
|
|
|
108
107
|
}
|
|
109
108
|
}),
|
|
110
109
|
x(r, "extra"),
|
|
111
|
-
t.showLogoutButton ? O(p(
|
|
110
|
+
t.showLogoutButton ? O(p(N, {
|
|
112
111
|
quaternary: !0,
|
|
113
112
|
style: "--n-padding: 0 12px",
|
|
114
113
|
onClick: () => t.username && n("logout")
|
|
115
|
-
}, K(e = x(r, "logoutButton", void 0, () => [p(
|
|
114
|
+
}, K(e = x(r, "logoutButton", void 0, () => [p(F, { size: "16" }, K(c) ? c : { default: () => [c] })])) ? e : { default: () => [e] }), [[
|
|
116
115
|
s,
|
|
117
116
|
a("common.account.logout"),
|
|
118
117
|
void 0,
|
|
@@ -127,13 +126,13 @@ var _e = /* @__PURE__ */ m({
|
|
|
127
126
|
emit: ["update:mode"],
|
|
128
127
|
setup(t, { emit: n }) {
|
|
129
128
|
let { t: r } = e();
|
|
130
|
-
return () => O(p(
|
|
129
|
+
return () => O(p(N, {
|
|
131
130
|
quaternary: !0,
|
|
132
131
|
style: "--n-padding: 0 12px",
|
|
133
132
|
onClick: () => {
|
|
134
133
|
n("update:mode", t.mode === "light" ? "dark" : t.mode === "dark" ? "auto" : "light");
|
|
135
134
|
}
|
|
136
|
-
}, { default: () => [p(
|
|
135
|
+
}, { default: () => [p(F, { size: "18" }, { default: () => [t.mode === "light" ? p("svg", {
|
|
137
136
|
xmlns: "http://www.w3.org/2000/svg",
|
|
138
137
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
139
138
|
role: "img",
|
|
@@ -212,7 +211,7 @@ var be = /* @__PURE__ */ m({
|
|
|
212
211
|
onClick: e.href && ((n) => {
|
|
213
212
|
n.stopPropagation(), t.push(e.href);
|
|
214
213
|
})
|
|
215
|
-
}, { default: () => [e.icon ? p(d, null, [p(
|
|
214
|
+
}, { default: () => [e.icon ? p(d, null, [p(F, { component: e[r] }, null), " "]) : void 0, w(e.title)] }))) ? n : { default: () => [n] });
|
|
216
215
|
};
|
|
217
216
|
}
|
|
218
217
|
}), xe = /* @__PURE__ */ m({
|
|
@@ -223,15 +222,15 @@ var be = /* @__PURE__ */ m({
|
|
|
223
222
|
},
|
|
224
223
|
emit: ["update:lang"],
|
|
225
224
|
setup(e, { emit: t }) {
|
|
226
|
-
return () => p(
|
|
225
|
+
return () => p(P, {
|
|
227
226
|
options: e.supports,
|
|
228
227
|
keyField: "value",
|
|
229
228
|
showArrow: !0,
|
|
230
229
|
onSelect: (e) => t("update:lang", e)
|
|
231
|
-
}, { default: () => [p(
|
|
230
|
+
}, { default: () => [p(N, {
|
|
232
231
|
quaternary: !0,
|
|
233
232
|
style: "--n-padding: 0 12px"
|
|
234
|
-
}, { default: () => [p(
|
|
233
|
+
}, { default: () => [p(F, { size: "18" }, { default: () => [p("svg", {
|
|
235
234
|
xmlns: "http://www.w3.org/2000/svg",
|
|
236
235
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
237
236
|
role: "img",
|
|
@@ -388,13 +387,13 @@ var be = /* @__PURE__ */ m({
|
|
|
388
387
|
setup(t, { emit: n, slots: r }) {
|
|
389
388
|
v(q, C(t, "collapsed"));
|
|
390
389
|
let { t: i } = e(), a = X();
|
|
391
|
-
return () => (a.sidebarWidth = (t.collapsed ? t.collapsedWidth : t.width) + "px", p("div", { class: "app-sidebar" }, [x(r, "default"), t.showCollapseBtn ? O(p(
|
|
390
|
+
return () => (a.sidebarWidth = (t.collapsed ? t.collapsedWidth : t.width) + "px", p("div", { class: "app-sidebar" }, [x(r, "default"), t.showCollapseBtn ? O(p(N, {
|
|
392
391
|
class: "app-sidebar__collapse-btn",
|
|
393
392
|
quaternary: !0,
|
|
394
393
|
onClick: () => {
|
|
395
394
|
n("update:collapsed", !t.collapsed);
|
|
396
395
|
}
|
|
397
|
-
}, { default: () => [p(
|
|
396
|
+
}, { default: () => [p(F, { size: "20" }, { default: () => [t.collapsed ? p(we, null, null) : p(Ce, null, null)] })] }), [[s, t.collapsed ? i("common.layout.sidebar.expand") : i("common.layout.sidebar.collapse")]]) : void 0]));
|
|
398
397
|
}
|
|
399
398
|
}), Oe = /* @__PURE__ */ m({
|
|
400
399
|
name: "AppContent",
|
|
@@ -467,7 +466,7 @@ var je = /* @__PURE__ */ m({
|
|
|
467
466
|
src: n.value,
|
|
468
467
|
alt: "App Logo",
|
|
469
468
|
style: `transition: height 0.2s ease-in-out; height: calc(var(--app-logo-img-size) * ${c})`
|
|
470
|
-
}, null)])])]), i ? p(
|
|
469
|
+
}, null)])])]), i ? p(U, {
|
|
471
470
|
class: "app-logo__name",
|
|
472
471
|
style: "font-size: var(--app-logo-name-size); font-weight: bold; white-space: nowrap; flex: 0 1 auto; overflow: hidden"
|
|
473
472
|
}, Ae(i) ? i : { default: () => [i] }) : void 0]);
|
|
@@ -559,7 +558,7 @@ var Me = /* @__PURE__ */ m({
|
|
|
559
558
|
}, null)])])), i;
|
|
560
559
|
};
|
|
561
560
|
return () => {
|
|
562
|
-
let i = p(
|
|
561
|
+
let i = p(z, {
|
|
563
562
|
ref: "menu",
|
|
564
563
|
options: t.value,
|
|
565
564
|
rootIndent: 16,
|
|
@@ -573,7 +572,7 @@ var Me = /* @__PURE__ */ m({
|
|
|
573
572
|
collapsedWidth: e.collapsedWidth,
|
|
574
573
|
width: e.width
|
|
575
574
|
}, null);
|
|
576
|
-
return e.horizontal ? i : p(
|
|
575
|
+
return e.horizontal ? i : p(H, null, Z(i) ? i : { default: () => [i] });
|
|
577
576
|
};
|
|
578
577
|
}
|
|
579
578
|
});
|
|
@@ -603,7 +602,7 @@ function Pe(t, n, r) {
|
|
|
603
602
|
key: "reload",
|
|
604
603
|
label: i("common.layout.tabs.reloadTab"),
|
|
605
604
|
disabled: !a.tab || a.tab.key !== n.value,
|
|
606
|
-
icon: () => p(
|
|
605
|
+
icon: () => p(F, { size: 20 }, { default: () => [p("svg", {
|
|
607
606
|
xmlns: "http://www.w3.org/2000/svg",
|
|
608
607
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
609
608
|
role: "img",
|
|
@@ -618,7 +617,7 @@ function Pe(t, n, r) {
|
|
|
618
617
|
{
|
|
619
618
|
key: "fullTab",
|
|
620
619
|
label: i("common.layout.tabs.fullTab"),
|
|
621
|
-
icon: () => p(
|
|
620
|
+
icon: () => p(F, { size: 16 }, { default: () => [p("svg", {
|
|
622
621
|
xmlns: "http://www.w3.org/2000/svg",
|
|
623
622
|
width: "1em",
|
|
624
623
|
height: "1em",
|
|
@@ -638,7 +637,7 @@ function Pe(t, n, r) {
|
|
|
638
637
|
key: "open",
|
|
639
638
|
label: i("common.layout.tabs.openTabBlank"),
|
|
640
639
|
disabled: !a.tab,
|
|
641
|
-
icon: () => p(
|
|
640
|
+
icon: () => p(F, { size: 20 }, { default: () => [p("svg", {
|
|
642
641
|
xmlns: "http://www.w3.org/2000/svg",
|
|
643
642
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
644
643
|
role: "img",
|
|
@@ -655,7 +654,7 @@ function Pe(t, n, r) {
|
|
|
655
654
|
{
|
|
656
655
|
key: "closeAll",
|
|
657
656
|
label: i("common.layout.tabs.closeAllTabs"),
|
|
658
|
-
icon: () => p(
|
|
657
|
+
icon: () => p(F, { size: 20 }, { default: () => [p("svg", {
|
|
659
658
|
xmlns: "http://www.w3.org/2000/svg",
|
|
660
659
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
661
660
|
role: "img",
|
|
@@ -671,7 +670,7 @@ function Pe(t, n, r) {
|
|
|
671
670
|
key: "closeLeft",
|
|
672
671
|
label: i("common.layout.tabs.closeLeftTabs"),
|
|
673
672
|
disabled: !a.tab,
|
|
674
|
-
icon: () => p(
|
|
673
|
+
icon: () => p(F, { size: 20 }, { default: () => [p("svg", {
|
|
675
674
|
xmlns: "http://www.w3.org/2000/svg",
|
|
676
675
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
677
676
|
role: "img",
|
|
@@ -687,7 +686,7 @@ function Pe(t, n, r) {
|
|
|
687
686
|
key: "closeRight",
|
|
688
687
|
label: i("common.layout.tabs.closeRightTabs"),
|
|
689
688
|
disabled: !a.tab,
|
|
690
|
-
icon: () => p(
|
|
689
|
+
icon: () => p(F, { size: 20 }, { default: () => [p("svg", {
|
|
691
690
|
xmlns: "http://www.w3.org/2000/svg",
|
|
692
691
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
693
692
|
role: "img",
|
|
@@ -703,7 +702,7 @@ function Pe(t, n, r) {
|
|
|
703
702
|
key: "closeOther",
|
|
704
703
|
label: i("common.layout.tabs.closeOtherTabs"),
|
|
705
704
|
disabled: !a.tab,
|
|
706
|
-
icon: () => p(
|
|
705
|
+
icon: () => p(F, { size: 20 }, { default: () => [" ", p("svg", {
|
|
707
706
|
xmlns: "http://www.w3.org/2000/svg",
|
|
708
707
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
709
708
|
role: "img",
|
|
@@ -765,7 +764,7 @@ function Fe(e, t, n) {
|
|
|
765
764
|
}
|
|
766
765
|
return re(A(e), (e) => {
|
|
767
766
|
e || r(n.value);
|
|
768
|
-
}, { debounce: 333 }), D(n, r, { flush: "post" }),
|
|
767
|
+
}, { debounce: 333 }), D(n, r, { flush: "post" }), j(e, "wheel", (t) => {
|
|
769
768
|
t.deltaMode === WheelEvent.DOM_DELTA_PIXEL && (t.preventDefault(), e.value.scrollBy({ left: t.deltaY }));
|
|
770
769
|
}, { passive: !1 }), {
|
|
771
770
|
el: e,
|
|
@@ -823,7 +822,7 @@ var Q = (e) => p("svg", e, [
|
|
|
823
822
|
D(s, async () => {
|
|
824
823
|
await k(1), a.value.style.width = o.value.scrollWidth + "px";
|
|
825
824
|
});
|
|
826
|
-
let c =
|
|
825
|
+
let c = ue(), l = f(() => ({
|
|
827
826
|
fontSize: "14px",
|
|
828
827
|
color: e.isCurrent ? c.value.primaryColor : c.value.textColor3,
|
|
829
828
|
maxWidth: "355px",
|
|
@@ -847,12 +846,12 @@ var Q = (e) => p("svg", e, [
|
|
|
847
846
|
}, [p("div", {
|
|
848
847
|
ref: o,
|
|
849
848
|
style: "display: flex; align-items: center; gap: 4px; width: fit-content"
|
|
850
|
-
}, [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(
|
|
849
|
+
}, [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, {
|
|
851
850
|
text: !0,
|
|
852
851
|
onClick: (e) => {
|
|
853
852
|
e.stopPropagation(), t("close");
|
|
854
853
|
}
|
|
855
|
-
}, { default: () => [p(
|
|
854
|
+
}, { default: () => [p(F, { size: 18 }, { default: () => [p("svg", {
|
|
856
855
|
xmlns: "http://www.w3.org/2000/svg",
|
|
857
856
|
width: "1em",
|
|
858
857
|
height: "1em",
|
|
@@ -908,7 +907,7 @@ var Q = (e) => p("svg", e, [
|
|
|
908
907
|
}, () => [l])) ? s : { default: () => [s] });
|
|
909
908
|
})]),
|
|
910
909
|
p("div", { style: "height: 100%; flex: 0 0 16px; z-index: 1; position: sticky; right: 0; backdrop-filter: opacity(0.9) blur(5px)" }, null)
|
|
911
|
-
]), p(
|
|
910
|
+
]), p(P, {
|
|
912
911
|
placement: "bottom-start",
|
|
913
912
|
trigger: "manual",
|
|
914
913
|
show: a.visible,
|
|
@@ -952,25 +951,24 @@ var Re = /* @__PURE__ */ m({
|
|
|
952
951
|
l.loading = !0, l.filteredTotal = 0;
|
|
953
952
|
let e = u.value?.trim() || void 0;
|
|
954
953
|
Promise.resolve(t.getPage?.(o.value, l.page, l.size, e) ?? []).then(({ records: t, total: n }) => {
|
|
955
|
-
l.records = t, l.filteredTotal = n, !e && (o.value === "unread" ?
|
|
954
|
+
l.records = t, l.filteredTotal = n, !e && (o.value === "unread" ? l.unread = n : l.total = n);
|
|
956
955
|
}).finally(() => {
|
|
957
956
|
l.loading = !1;
|
|
958
957
|
});
|
|
959
|
-
}, {
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
}), g = ue(() => {
|
|
958
|
+
}, { pause: m, resume: h } = ne(f, () => t.interval, {
|
|
959
|
+
immediate: document.visibilityState === "visible",
|
|
960
|
+
immediateCallback: !0
|
|
961
|
+
});
|
|
962
|
+
j(document, "visibilitychange", () => {
|
|
963
|
+
document.visibilityState === "visible" ? h() : m();
|
|
964
|
+
}, { passive: !0 });
|
|
965
|
+
let g = de(() => {
|
|
968
966
|
l.page = 1, f();
|
|
969
967
|
}, 300), v = (e) => {
|
|
970
968
|
u.value = e, g();
|
|
971
969
|
}, S = () => {
|
|
972
970
|
let e;
|
|
973
|
-
return O(p(
|
|
971
|
+
return O(p(N, _(r, {
|
|
974
972
|
quaternary: !0,
|
|
975
973
|
style: "--n-padding: 0 12px",
|
|
976
974
|
onClick: () => {
|
|
@@ -981,7 +979,7 @@ var Re = /* @__PURE__ */ m({
|
|
|
981
979
|
dot: !0,
|
|
982
980
|
offset: [-2, 5],
|
|
983
981
|
processing: !0
|
|
984
|
-
}, { default: () => [p(
|
|
982
|
+
}, { default: () => [p(F, { size: "18" }, { default: () => [p("svg", {
|
|
985
983
|
xmlns: "http://www.w3.org/2000/svg",
|
|
986
984
|
width: "1em",
|
|
987
985
|
height: "1em",
|
|
@@ -1003,29 +1001,29 @@ var Re = /* @__PURE__ */ m({
|
|
|
1003
1001
|
let e, t;
|
|
1004
1002
|
return p("div", { style: "display: flex; align-items: baseline; gap: 20px" }, [
|
|
1005
1003
|
p("div", { style: "padding-right: 12px" }, [i("common.notification.title")]),
|
|
1006
|
-
p(
|
|
1004
|
+
p(N, {
|
|
1007
1005
|
text: !0,
|
|
1008
1006
|
type: o.value === "all" ? "primary" : "default",
|
|
1009
1007
|
onClick: () => {
|
|
1010
1008
|
o.value = "all", f();
|
|
1011
1009
|
}
|
|
1012
1010
|
}, $(e = i("common.notification.all")) ? e : { default: () => [e] }),
|
|
1013
|
-
p(
|
|
1011
|
+
p(N, {
|
|
1014
1012
|
text: !0,
|
|
1015
1013
|
type: o.value === "unread" ? "primary" : "default",
|
|
1016
1014
|
onClick: () => {
|
|
1017
|
-
o.value = "unread",
|
|
1015
|
+
o.value = "unread", f();
|
|
1018
1016
|
}
|
|
1019
1017
|
}, $(t = i("common.notification.unread", { count: l.unread > 99 ? "99+" : l.unread.toString() })) ? t : { default: () => [t] })
|
|
1020
1018
|
]);
|
|
1021
|
-
}, w = (e) => p(
|
|
1019
|
+
}, w = (e) => p(R, {
|
|
1022
1020
|
key: e.key,
|
|
1023
1021
|
onClick: () => {
|
|
1024
1022
|
e.status === "unread" && (t.markRead?.([e.key]).then(() => {
|
|
1025
1023
|
e.status = "read";
|
|
1026
1024
|
}), l.unread--), e.link && window.open(e.link, "_target");
|
|
1027
1025
|
}
|
|
1028
|
-
}, { default: () => [p(
|
|
1026
|
+
}, { default: () => [p(W, {
|
|
1029
1027
|
bordered: !1,
|
|
1030
1028
|
closable: !0,
|
|
1031
1029
|
contentIndented: !0,
|
|
@@ -1034,7 +1032,7 @@ var Re = /* @__PURE__ */ m({
|
|
|
1034
1032
|
onMouseleave: () => e.hover = !1,
|
|
1035
1033
|
style: "padding: 0 4px; position: relative"
|
|
1036
1034
|
}, {
|
|
1037
|
-
avatar: () => p(
|
|
1035
|
+
avatar: () => p(F, {
|
|
1038
1036
|
size: 22,
|
|
1039
1037
|
color: e.status === "unread" ? "var(--color-primary)" : void 0
|
|
1040
1038
|
}, { default: () => [p("svg", {
|
|
@@ -1055,7 +1053,7 @@ var Re = /* @__PURE__ */ m({
|
|
|
1055
1053
|
onClick: (e) => {
|
|
1056
1054
|
e.preventDefault(), e.stopPropagation();
|
|
1057
1055
|
}
|
|
1058
|
-
}, [e.status === "unread" ? p(
|
|
1056
|
+
}, [e.status === "unread" ? p(N, {
|
|
1059
1057
|
text: !0,
|
|
1060
1058
|
type: "primary",
|
|
1061
1059
|
onClick: () => {
|
|
@@ -1063,22 +1061,22 @@ var Re = /* @__PURE__ */ m({
|
|
|
1063
1061
|
e.status = "read", l.unread--;
|
|
1064
1062
|
});
|
|
1065
1063
|
}
|
|
1066
|
-
}, $(n = i("common.notification.markRead")) ? n : { default: () => [n] }) : void 0, p(
|
|
1064
|
+
}, $(n = i("common.notification.markRead")) ? n : { default: () => [n] }) : void 0, p(N, {
|
|
1067
1065
|
text: !0,
|
|
1068
1066
|
type: "error",
|
|
1069
1067
|
onClick: () => {
|
|
1070
|
-
l.records === 1 ? (l.records = [],
|
|
1068
|
+
l.records === 1 ? (l.records = [], f()) : l.records.splice(l.records.findIndex((t) => t.key == e.key), 1), t.markDelete?.([e.key]);
|
|
1071
1069
|
}
|
|
1072
1070
|
}, $(r = i("common.notification.markDelete")) ? r : { default: () => [r] })]) : void 0]);
|
|
1073
1071
|
}
|
|
1074
1072
|
})] }), T = () => {
|
|
1075
1073
|
let e;
|
|
1076
|
-
return p("div", null, [p("div", { style: "padding: 12px 20px; position: sticky; z-index: 1; top: 0; backdrop-filter: blur(6px)" }, [p(
|
|
1074
|
+
return p("div", null, [p("div", { style: "padding: 12px 20px; position: sticky; z-index: 1; top: 0; backdrop-filter: blur(6px)" }, [p(I, {
|
|
1077
1075
|
size: "small",
|
|
1078
1076
|
clearable: !0,
|
|
1079
1077
|
value: u.value,
|
|
1080
1078
|
onUpdateValue: v
|
|
1081
|
-
}, { suffix: () => p(
|
|
1079
|
+
}, { suffix: () => p(F, { style: "margin-left: 4px" }, { default: () => [p("svg", {
|
|
1082
1080
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1083
1081
|
width: "1em",
|
|
1084
1082
|
height: "1em",
|
|
@@ -1086,12 +1084,12 @@ var Re = /* @__PURE__ */ m({
|
|
|
1086
1084
|
}, [p("path", {
|
|
1087
1085
|
fill: "currentColor",
|
|
1088
1086
|
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"
|
|
1089
|
-
}, null)])] }) })]), O(l.records.length > 0 ? p(
|
|
1087
|
+
}, null)])] }) })]), O(l.records.length > 0 ? p(L, {
|
|
1090
1088
|
clickable: !0,
|
|
1091
1089
|
hoverable: !0,
|
|
1092
1090
|
style: "min-height: 50vh"
|
|
1093
1091
|
}, $(e = l.records.map((e) => w(e))) ? e : { default: () => [e] }) : p(le, { style: "margin-top: 30vh" }, null), [[c, l.loading]])]);
|
|
1094
|
-
}, E = () => p("div", { style: "display: flex; justify-content: space-between; width: 100%" }, [o.value === "unread" ? p(
|
|
1092
|
+
}, E = () => p("div", { style: "display: flex; justify-content: space-between; width: 100%" }, [o.value === "unread" ? p(N, {
|
|
1095
1093
|
text: !0,
|
|
1096
1094
|
type: "primary",
|
|
1097
1095
|
disabled: l.records.length === 0,
|
|
@@ -1099,11 +1097,11 @@ var Re = /* @__PURE__ */ m({
|
|
|
1099
1097
|
let e = l.records.filter((e) => e.status === "unread").map((e) => e.key);
|
|
1100
1098
|
t.markRead(e).then(() => {
|
|
1101
1099
|
for (; l.unread - e.length <= l.size * (l.page - 1);) l.page--;
|
|
1102
|
-
|
|
1100
|
+
f();
|
|
1103
1101
|
});
|
|
1104
1102
|
}
|
|
1105
1103
|
}, {
|
|
1106
|
-
icon: () => p(
|
|
1104
|
+
icon: () => p(F, { size: "20" }, { default: () => [p("svg", {
|
|
1107
1105
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1108
1106
|
width: "1em",
|
|
1109
1107
|
height: "1em",
|
|
@@ -1113,7 +1111,7 @@ var Re = /* @__PURE__ */ m({
|
|
|
1113
1111
|
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"
|
|
1114
1112
|
}, null)])] }),
|
|
1115
1113
|
default: () => i("common.notification.markPageRead")
|
|
1116
|
-
}) : p("span", null, null), p(
|
|
1114
|
+
}) : p("span", null, null), p(B, {
|
|
1117
1115
|
simple: !0,
|
|
1118
1116
|
pageSize: l.size,
|
|
1119
1117
|
page: l.page,
|
|
@@ -1159,7 +1157,7 @@ var Re = /* @__PURE__ */ m({
|
|
|
1159
1157
|
},
|
|
1160
1158
|
emit: ["update:current"],
|
|
1161
1159
|
setup(t, { emit: n }) {
|
|
1162
|
-
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(
|
|
1160
|
+
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, {
|
|
1163
1161
|
round: !0,
|
|
1164
1162
|
size: 22,
|
|
1165
1163
|
color: "var(--color-primary-hover)"
|
|
@@ -1171,7 +1169,7 @@ var Re = /* @__PURE__ */ m({
|
|
|
1171
1169
|
return () => {
|
|
1172
1170
|
if (!t.options?.length) return;
|
|
1173
1171
|
let e = t.options.find((e) => e.id === t.current);
|
|
1174
|
-
return p(
|
|
1172
|
+
return p(P, {
|
|
1175
1173
|
options: a.value,
|
|
1176
1174
|
placement: "bottom-end",
|
|
1177
1175
|
keyField: "id",
|
|
@@ -1179,11 +1177,11 @@ var Re = /* @__PURE__ */ m({
|
|
|
1179
1177
|
showArrow: !0,
|
|
1180
1178
|
renderLabel: i,
|
|
1181
1179
|
onSelect: (e) => e !== t.current && n("update:current", e)
|
|
1182
|
-
}, { default: () => [p(
|
|
1180
|
+
}, { default: () => [p(N, {
|
|
1183
1181
|
quaternary: !0,
|
|
1184
1182
|
style: "--n-padding: 0 6px"
|
|
1185
1183
|
}, {
|
|
1186
|
-
icon: () => p(
|
|
1184
|
+
icon: () => p(F, { size: "18" }, { default: () => [p("svg", {
|
|
1187
1185
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1188
1186
|
"xmlns:xlink": "http://www.w3.org/1999/xlink",
|
|
1189
1187
|
viewBox: "0 0 1024 1024",
|
package/esm/page.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as e } from "./use-i18n-
|
|
2
|
-
import { _ as t, a as n, c as r, i, o as a, w as o } from "./components-
|
|
1
|
+
import { n as e } from "./use-i18n-BMlVGLEB.js";
|
|
2
|
+
import { _ as t, a as n, c as r, i, o as a, w as o } from "./components-BA7KsV1q.js";
|
|
3
3
|
import { computed as s, createVNode as c, defineAsyncComponent as l, defineComponent as u, h as d, isVNode as f, mergeProps as p, nextTick as m, ref as h, renderSlot as g, shallowRef as _, toValue as v, unref as y } from "vue";
|
|
4
4
|
import { until as b, useClipboard as x } from "@vueuse/core";
|
|
5
5
|
import { NButton as S, NCheckbox as C, NColorPicker as w, NDrawer as T, NDrawerContent as E, NFlex as D, NIcon as O, NInput as k, NInputNumber as A, NModal as j, NScrollbar as M, NSelect as N, NText as P, NUpload as F, useMessage as I } from "ithinkdt-ui";
|
|
@@ -300,7 +300,7 @@ function X({ getUserGroups: e, getUsersByGroup: t, getDeptsByCode: i, getUsersBy
|
|
|
300
300
|
depth: 2,
|
|
301
301
|
style: "line-height: 1.25"
|
|
302
302
|
}, { default: () => [n ?? ""] }) : (t = W(t), d(k, p({
|
|
303
|
-
class: { [m]: !V(n) && (Array.isArray(n)
|
|
303
|
+
class: { [m]: !V(n) && (!Array.isArray(n) || n.length > 0) },
|
|
304
304
|
clearable: !0
|
|
305
305
|
}, t, o, {
|
|
306
306
|
value: n,
|
|
@@ -317,7 +317,7 @@ function X({ getUserGroups: e, getUsersByGroup: t, getDeptsByCode: i, getUsersBy
|
|
|
317
317
|
return e = a, u === "string" && !t && (t = (t, ...n) => {
|
|
318
318
|
e(x(t), ...n);
|
|
319
319
|
}), d(A, p({
|
|
320
|
-
class: { [m]: !V(i) && (Array.isArray(i)
|
|
320
|
+
class: { [m]: !V(i) && (!Array.isArray(i) || i.length > 0) },
|
|
321
321
|
clearable: !0
|
|
322
322
|
}, f, l, {
|
|
323
323
|
value: h,
|
|
@@ -359,7 +359,7 @@ function X({ getUserGroups: e, getUsersByGroup: t, getDeptsByCode: i, getUsersBy
|
|
|
359
359
|
return r = T.multiple, i = u, w === "number" && !a && (a = (e, ...t) => {
|
|
360
360
|
i(r ? e?.map(S) : S(e), ...t);
|
|
361
361
|
}), d(N, p({
|
|
362
|
-
class: { [m]: !V(l) && (Array.isArray(l)
|
|
362
|
+
class: { [m]: !V(l) && (!Array.isArray(l) || l.length > 0) },
|
|
363
363
|
clearable: !0,
|
|
364
364
|
filterable: y(t)?.length > 9,
|
|
365
365
|
loading: n?.value || t?.loading,
|
|
@@ -381,7 +381,7 @@ function X({ getUserGroups: e, getUsersByGroup: t, getDeptsByCode: i, getUsersBy
|
|
|
381
381
|
style: "line-height: 1.25"
|
|
382
382
|
}, q(r) ? r : { default: () => [r] });
|
|
383
383
|
}
|
|
384
|
-
return d(C, p({ class: { [m]: !V(n) && (Array.isArray(n)
|
|
384
|
+
return d(C, p({ class: { [m]: !V(n) && (!Array.isArray(n) || n.length > 0) } }, t, o, {
|
|
385
385
|
checked: n,
|
|
386
386
|
"onUpdate:checked": r
|
|
387
387
|
}), e);
|
|
@@ -404,7 +404,7 @@ function X({ getUserGroups: e, getUsersByGroup: t, getDeptsByCode: i, getUsersBy
|
|
|
404
404
|
}
|
|
405
405
|
return n = s, _ === "number" && !r && (r = (e, ...t) => {
|
|
406
406
|
n(e?.map(S), ...t);
|
|
407
|
-
}), d(o, p({ class: { [m]: !V(a) && (Array.isArray(a)
|
|
407
|
+
}), d(o, p({ class: { [m]: !V(a) && (!Array.isArray(a) || a.length > 0) } }, y, f, {
|
|
408
408
|
options: t,
|
|
409
409
|
modelValue: C,
|
|
410
410
|
"onUpdate:modelValue": _ === "number" ? r : n
|
|
@@ -426,7 +426,7 @@ function X({ getUserGroups: e, getUsersByGroup: t, getDeptsByCode: i, getUsersBy
|
|
|
426
426
|
}
|
|
427
427
|
return n = s, _ === "number" && !i && (i = (e, ...t) => {
|
|
428
428
|
n(S(e), ...t);
|
|
429
|
-
}), d(r, p({ class: { [m]: !V(o) && (Array.isArray(o)
|
|
429
|
+
}), d(r, p({ class: { [m]: !V(o) && (!Array.isArray(o) || o.length > 0) } }, y, f, {
|
|
430
430
|
options: t,
|
|
431
431
|
modelValue: C,
|
|
432
432
|
"onUpdate:modelValue": _ === "number" ? i : n
|
|
@@ -442,7 +442,7 @@ function X({ getUserGroups: e, getUsersByGroup: t, getDeptsByCode: i, getUsersBy
|
|
|
442
442
|
depth: 2,
|
|
443
443
|
style: "line-height: 1.25"
|
|
444
444
|
}, { default: () => [n ? R(n, l) : ""] }) : d(J, p({
|
|
445
|
-
class: { [m]: !V(n) && (Array.isArray(n)
|
|
445
|
+
class: { [m]: !V(n) && (!Array.isArray(n) || n.length > 0) },
|
|
446
446
|
actions: null,
|
|
447
447
|
updateValueOnClose: !0,
|
|
448
448
|
closeOnSelect: !0,
|
|
@@ -468,7 +468,7 @@ function X({ getUserGroups: e, getUsersByGroup: t, getDeptsByCode: i, getUsersBy
|
|
|
468
468
|
style: "max-width: 100px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; display: inline-block"
|
|
469
469
|
}, [e.name]))) ? e : { default: () => [e] }) : void 0;
|
|
470
470
|
}
|
|
471
|
-
return d(Y, p({ class: { [m]: !V(n) && (Array.isArray(n)
|
|
471
|
+
return d(Y, p({ class: { [m]: !V(n) && (!Array.isArray(n) || n.length > 0) } }, t, o, {
|
|
472
472
|
defaultUpload: !1,
|
|
473
473
|
uploadFile: u,
|
|
474
474
|
fileList: n,
|
|
@@ -506,7 +506,7 @@ function X({ getUserGroups: e, getUsersByGroup: t, getDeptsByCode: i, getUsersBy
|
|
|
506
506
|
style: "max-width: 100%; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; display: inline-block"
|
|
507
507
|
}, [e.name]))) ? e : { default: () => [e] });
|
|
508
508
|
}
|
|
509
|
-
return d(Y, p({ class: { [m]: !V(f) && (Array.isArray(f)
|
|
509
|
+
return d(Y, p({ class: { [m]: !V(f) && (!Array.isArray(f) || f.length > 0) } }, b, y, {
|
|
510
510
|
uploadFile: u,
|
|
511
511
|
fileList: r.value,
|
|
512
512
|
onUpdateFileList: (e = []) => {
|
|
@@ -538,7 +538,7 @@ function X({ getUserGroups: e, getUsersByGroup: t, getDeptsByCode: i, getUsersBy
|
|
|
538
538
|
getUsersByUsername: l,
|
|
539
539
|
renderInfo: S.renderInfo
|
|
540
540
|
}, null) : d(n, p({
|
|
541
|
-
class: { [m]: !V(g) && (Array.isArray(g)
|
|
541
|
+
class: { [m]: !V(g) && (!Array.isArray(g) || g.length > 0) },
|
|
542
542
|
type: "user",
|
|
543
543
|
users: r.value,
|
|
544
544
|
depts: u.value,
|