@ithinkdt/ui 4.0.0-38 → 4.0.0-40

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.
Files changed (55) hide show
  1. package/dist/components-BC8oa62b.js +1612 -0
  2. package/dist/components.js +5 -0
  3. package/dist/directives-DUuJW647.js +183 -0
  4. package/dist/directives.js +3 -0
  5. package/dist/index.js +1222 -0
  6. package/dist/page.js +511 -0
  7. package/dist/use-i18n-Dx7V4KrY.js +6 -0
  8. package/dist/use-style-DcT-1dj4.js +29 -0
  9. package/dist/use-style.js +2 -0
  10. package/esm/components.js +1 -0
  11. package/esm/directives.js +1 -0
  12. package/esm/index.js +1 -0
  13. package/esm/page.js +1 -0
  14. package/esm/use-style.js +1 -0
  15. package/package.json +21 -18
  16. package/src/components/Checkboxes.jsx +0 -130
  17. package/src/components/DataActions.jsx +0 -105
  18. package/src/components/DataCustom.jsx +0 -187
  19. package/src/components/DataFilter.jsx +0 -119
  20. package/src/components/DataForm.jsx +0 -264
  21. package/src/components/DataLocaleInput.jsx +0 -121
  22. package/src/components/DataPagination.jsx +0 -62
  23. package/src/components/DataSelection.jsx +0 -57
  24. package/src/components/DataTable.jsx +0 -302
  25. package/src/components/Radios.jsx +0 -134
  26. package/src/components/UserDept.jsx +0 -643
  27. package/src/components/assets.jsx +0 -274
  28. package/src/components/index.js +0 -11
  29. package/src/design/Account.jsx +0 -154
  30. package/src/design/Appearance.jsx +0 -89
  31. package/src/design/Breadcrumb.jsx +0 -67
  32. package/src/design/Fullscreen.jsx +0 -65
  33. package/src/design/Language.jsx +0 -45
  34. package/src/design/Layout.jsx +0 -241
  35. package/src/design/Logo.jsx +0 -92
  36. package/src/design/Menu.jsx +0 -133
  37. package/src/design/MultiTabs.jsx +0 -501
  38. package/src/design/Notification.jsx +0 -311
  39. package/src/design/Tenant.jsx +0 -88
  40. package/src/design/common.jsx +0 -21
  41. package/src/design/index.js +0 -11
  42. package/src/directives/index.js +0 -2
  43. package/src/directives/spin.js +0 -181
  44. package/src/directives/tooltip.jsx +0 -121
  45. package/src/index.js +0 -18
  46. package/src/page.jsx +0 -740
  47. package/src/use-i18n.js +0 -8
  48. package/src/use-style.js +0 -58
  49. package/src/utils.js +0 -20
  50. /package/{src → esm}/components.d.ts +0 -0
  51. /package/{src → esm}/design.d.ts +0 -0
  52. /package/{src → esm}/directives.d.ts +0 -0
  53. /package/{src → esm}/index.d.ts +0 -0
  54. /package/{src → esm}/page.d.ts +0 -0
  55. /package/{src → esm}/use-style.d.ts +0 -0
package/dist/index.js ADDED
@@ -0,0 +1,1222 @@
1
+ import { n as useI18n, t as UI_I18N_INJECTION } from "./use-i18n-Dx7V4KrY.js";
2
+ import { i as vTooltip, n as vSpin, r as TooltipDirectiveProvider, t as SpinDirectiveProvider } from "./directives-DUuJW647.js";
3
+ import { g as useStyle, i as cM, n as cB, r as cE, t as c } from "./use-style-DcT-1dj4.js";
4
+ import { Fragment, computed, createVNode, defineComponent, inject, isVNode, mergeProps, provide, reactive, ref, renderSlot, shallowRef, toRef, toValue, unref, useTemplateRef, watch, withDirectives } from "vue";
5
+ import { computedAsync, promiseTimeout, useElementHover, useElementSize, useEventListener, useFullscreen, watchDebounced } from "@vueuse/core";
6
+ import { NAvatar, NBadge, NBreadcrumb, NBreadcrumbItem, NButton, NDrawer, NDrawerContent, NDropdown, NEmpty, NIcon, NList, NListItem, NMenu, NPagination, NPopover, NScrollbar, NText, NThing, useThemeVars } from "ithinkdt-ui";
7
+ import { useAtomicBroadcast } from "@ithinkdt/common/composables";
8
+ import { RouterLink, useRouter } from "vue-router";
9
+ import { walkTree } from "@ithinkdt/common/tree";
10
+ import { getOpaqueColor } from "@ithinkdt/common/color";
11
+ import { format } from "date-fns";
12
+ function _isSlot$4(d) {
13
+ return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !isVNode(d);
14
+ }
15
+ const AppAccount = /* @__PURE__ */ defineComponent({
16
+ name: "AppAccount",
17
+ props: {
18
+ username: String,
19
+ nickname: String,
20
+ head: String,
21
+ showLogoutButton: {
22
+ type: Boolean,
23
+ default: !0
24
+ },
25
+ showChangePwd: {
26
+ type: Boolean,
27
+ default: !0
28
+ }
29
+ },
30
+ emit: ["logout", "change-pwd"],
31
+ setup(z, { emit: V, slots: H }) {
32
+ let U = computed(() => /^[\u4E00-\u9FA5]+$/.test(z.nickname) ? z.nickname?.slice(z.nickname?.length > 3 ? 2 : 1) : z.nickname?.split(" ")[0]), { t: W } = useI18n(), G = createVNode(NIcon, { size: "28" }, { default: () => [createVNode("svg", {
33
+ xmlns: "http://www.w3.org/2000/svg",
34
+ width: "1em",
35
+ height: "1em",
36
+ viewBox: "-4 -4 32 32"
37
+ }, [createVNode("path", {
38
+ fill: "currentColor",
39
+ 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"
40
+ }, null)])] }), K = createVNode("svg", {
41
+ xmlns: "http://www.w3.org/2000/svg",
42
+ width: "1em",
43
+ height: "1em",
44
+ viewBox: "0 0 24 24"
45
+ }, [createVNode("path", {
46
+ fill: "currentColor",
47
+ 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
+ }, null)]);
49
+ return () => createVNode("div", { style: "display: flex; align-items: center" }, [
50
+ createVNode(NPopover, { style: "padding: 4px" }, {
51
+ trigger: () => createVNode(NButton, {
52
+ quaternary: !0,
53
+ style: "--n-padding: 0 12px"
54
+ }, { default: () => [createVNode("div", { style: "display: flex; align-items: center; gap: 8px" }, [createVNode(NAvatar, {
55
+ key: z.head ? "head" : "no-head",
56
+ src: z.head,
57
+ round: !0,
58
+ size: "small",
59
+ radix: .78,
60
+ color: "var(--color-primary-hover)"
61
+ }, {
62
+ fallback: () => G,
63
+ placeholder: () => G,
64
+ default: z.head ? void 0 : () => U.value
65
+ }), createVNode("span", { style: "font-size: 14px" }, [z.username ?? ""])])] }),
66
+ default: () => {
67
+ let d = () => z.showChangePwd ? createVNode(NButton, {
68
+ quaternary: !0,
69
+ style: "justify-content: left",
70
+ onClick: () => V("change-pwd")
71
+ }, {
72
+ icon: () => createVNode(NIcon, null, { default: () => [createVNode("svg", {
73
+ xmlns: "http://www.w3.org/2000/svg",
74
+ width: "1em",
75
+ height: "1em",
76
+ viewBox: "0 0 32 32"
77
+ }, [createVNode("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), createVNode("circle", {
81
+ cx: "22",
82
+ cy: "10",
83
+ r: "2",
84
+ fill: "currentColor"
85
+ }, null)])] }),
86
+ default: () => W("common.account.changePwd")
87
+ }) : void 0, B = () => z.showLogoutButton ? void 0 : createVNode(NButton, {
88
+ quaternary: !0,
89
+ style: "justify-content: left",
90
+ onClick: () => V("logout")
91
+ }, {
92
+ icon: () => createVNode(NIcon, null, _isSlot$4(K) ? K : { default: () => [K] }),
93
+ default: () => W("common.account.logout")
94
+ });
95
+ return H.dropdown ? H.dropdown({
96
+ pwd: d,
97
+ logout: B
98
+ }) : createVNode("div", { style: "display: flex; flex-direction: column" }, [
99
+ d(),
100
+ H.dropdownExtra?.(),
101
+ B()
102
+ ]);
103
+ }
104
+ }),
105
+ H.extra?.(),
106
+ z.showLogoutButton ? withDirectives(createVNode(NButton, {
107
+ quaternary: !0,
108
+ style: "--n-padding: 0 12px",
109
+ onClick: () => z.username && V("logout")
110
+ }, { default: () => [H.logoutButton?.() ?? createVNode(NIcon, { size: "16" }, _isSlot$4(K) ? K : { default: () => [K] })] }), [[
111
+ vTooltip,
112
+ W("common.account.logout"),
113
+ void 0,
114
+ { "bottom-end": !0 }
115
+ ]]) : void 0
116
+ ]);
117
+ }
118
+ }), AppAppearance = /* @__PURE__ */ defineComponent({
119
+ name: "AppAppearance",
120
+ props: { mode: String },
121
+ emit: ["update:mode"],
122
+ setup(z, { emit: V }) {
123
+ let { t: H } = useI18n();
124
+ return () => withDirectives(createVNode(NButton, {
125
+ quaternary: !0,
126
+ style: "--n-padding: 0 12px",
127
+ onClick: () => {
128
+ V("update:mode", z.mode === "light" ? "dark" : z.mode === "dark" ? "auto" : "light");
129
+ }
130
+ }, { default: () => [createVNode(NIcon, { size: "18" }, { default: () => [z.mode === "light" ? createVNode("svg", {
131
+ xmlns: "http://www.w3.org/2000/svg",
132
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
133
+ role: "img",
134
+ width: "1em",
135
+ height: "1em",
136
+ viewBox: "0 0 24 24"
137
+ }, [createVNode("path", {
138
+ fill: "currentColor",
139
+ 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"
140
+ }, null)]) : z.mode === "dark" ? createVNode("svg", {
141
+ xmlns: "http://www.w3.org/2000/svg",
142
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
143
+ role: "img",
144
+ width: "1em",
145
+ height: "1em",
146
+ viewBox: "0 0 24 24"
147
+ }, [createVNode("path", {
148
+ fill: "currentColor",
149
+ 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"
150
+ }, null)]) : createVNode("svg", {
151
+ xmlns: "http://www.w3.org/2000/svg",
152
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
153
+ role: "img",
154
+ width: "1em",
155
+ height: "1em",
156
+ viewBox: "0 0 24 24"
157
+ }, [createVNode("path", {
158
+ fill: "currentColor",
159
+ 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"
160
+ }, null)])] })] }), [[
161
+ vTooltip,
162
+ z.mode === "light" ? H("common.layout.mode.light") : z.mode === "dark" ? H("common.layout.mode.dark") : H("common.layout.mode.auto"),
163
+ void 0,
164
+ { bottom: !0 }
165
+ ]]);
166
+ }
167
+ }), COLLAPSED_INJECTION_KEY = "APP_SIDER_COLLAPSED", IBookmark = () => createVNode("svg", {
168
+ xmlns: "http://www.w3.org/2000/svg",
169
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
170
+ role: "img",
171
+ width: "1em",
172
+ height: "1em",
173
+ viewBox: "0 0 24 24"
174
+ }, [createVNode("path", {
175
+ fill: "currentColor",
176
+ d: "m17 18l-5-2.18L7 18V5h10m0-2H7a2 2 0 0 0-2 2v16l7-3l7 3V5a2 2 0 0 0-2-2Z"
177
+ }, null)]), CTX_INJECTION_KEY = "__APP_CTX__", getCtx = () => inject(CTX_INJECTION_KEY);
178
+ function _isSlot$3(d) {
179
+ return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !isVNode(d);
180
+ }
181
+ const AppBreadcrumb = /* @__PURE__ */ defineComponent({
182
+ name: "AppBreadcrumb",
183
+ props: {
184
+ items: {
185
+ type: Array,
186
+ default: () => []
187
+ },
188
+ getIcon: {
189
+ type: Function,
190
+ default: void 0
191
+ }
192
+ },
193
+ setup(d) {
194
+ let z = useRouter(), B = Symbol(), V = Symbol();
195
+ return watch(() => d.items, (z) => {
196
+ walkTree(z, (z) => {
197
+ z.icon && (typeof z.icon == "string" ? (z[B] = d.getIcon?.(z.icon), z[V] = () => z[B]?.() || IBookmark()) : z[V] = z.icon);
198
+ });
199
+ }, { immediate: !0 }), () => {
200
+ let B;
201
+ return createVNode(NBreadcrumb, null, _isSlot$3(B = d.items.map((d) => createVNode(NBreadcrumbItem, {
202
+ clickable: d.href?.length > 0,
203
+ separator: d.separator,
204
+ onClick: d.href && ((B) => {
205
+ B.stopPropagation(), z.push(d.href);
206
+ })
207
+ }, { default: () => [d.icon ? createVNode(Fragment, null, [createVNode(NIcon, { component: d[V] }, null), " "]) : void 0, toValue(d.title)] }))) ? B : { default: () => [B] });
208
+ };
209
+ }
210
+ }), AppFullscreen = /* @__PURE__ */ defineComponent({
211
+ name: "AppFullscreen",
212
+ props: {},
213
+ emit: ["change"],
214
+ setup(z, { emit: V }) {
215
+ let { t: H } = useI18n(), { isFullscreen: U, toggle: W } = useFullscreen();
216
+ return () => withDirectives(createVNode(NButton, {
217
+ quaternary: !0,
218
+ style: "--n-padding: 0 12px",
219
+ onClick: () => {
220
+ W(), V("change", U.value);
221
+ }
222
+ }, { default: () => [createVNode(NIcon, { size: "18" }, { default: () => [U.value ? createVNode("svg", {
223
+ xmlns: "http://www.w3.org/2000/svg",
224
+ width: "1em",
225
+ height: "1em",
226
+ viewBox: "0 0 24 24"
227
+ }, [createVNode("path", {
228
+ fill: "none",
229
+ stroke: "currentColor",
230
+ "stroke-linecap": "round",
231
+ "stroke-linejoin": "round",
232
+ "stroke-width": "1.5",
233
+ 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"
234
+ }, null)]) : createVNode("svg", {
235
+ xmlns: "http://www.w3.org/2000/svg",
236
+ width: "1em",
237
+ height: "1em",
238
+ viewBox: "0 0 24 24"
239
+ }, [createVNode("path", {
240
+ fill: "none",
241
+ stroke: "currentColor",
242
+ "stroke-linecap": "round",
243
+ "stroke-linejoin": "round",
244
+ "stroke-width": "1.5",
245
+ 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"
246
+ }, null)])] })] }), [[
247
+ vTooltip,
248
+ U.value ? H("common.layout.screen.exitfull") : H("common.layout.screen.full"),
249
+ void 0,
250
+ { bottom: !0 }
251
+ ]]);
252
+ }
253
+ }), AppLanguage = /* @__PURE__ */ defineComponent({
254
+ name: "AppLanguage",
255
+ props: {
256
+ lang: String,
257
+ supports: Array
258
+ },
259
+ emit: ["update:lang"],
260
+ setup(d, { emit: z }) {
261
+ return () => createVNode(NDropdown, {
262
+ options: d.supports,
263
+ keyField: "value",
264
+ showArrow: !0,
265
+ onSelect: (d) => z("update:lang", d)
266
+ }, { default: () => [createVNode(NButton, {
267
+ quaternary: !0,
268
+ style: "--n-padding: 0 12px"
269
+ }, { default: () => [createVNode(NIcon, { size: "18" }, { default: () => [createVNode("svg", {
270
+ xmlns: "http://www.w3.org/2000/svg",
271
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
272
+ role: "img",
273
+ width: "1em",
274
+ height: "1em",
275
+ viewBox: "0 0 24 24"
276
+ }, [createVNode("g", {
277
+ fill: "none",
278
+ stroke: "currentColor",
279
+ "stroke-linecap": "round",
280
+ "stroke-linejoin": "round",
281
+ "stroke-width": "1.5"
282
+ }, [createVNode("path", { d: "M2 12c0 5.523 4.477 10 10 10s10-4.477 10-10S17.523 2 12 2S2 6.477 2 12Z" }, null), createVNode("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
+ }
284
+ });
285
+ var style = /* @__PURE__ */ c([
286
+ cB("layout", {
287
+ display: "grid",
288
+ gridTemplateAreas: "\n 'sider header'\n 'sider content'\n 'sider footer'\n ",
289
+ gridTemplateRows: "auto 1fr auto",
290
+ gridTemplateColumns: "auto 1fr",
291
+ position: "relative",
292
+ top: "0",
293
+ left: "0",
294
+ transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
295
+ "--app-content-height": "calc(100vh - var(--app-header-height) - var(--app-footer-height))"
296
+ }, [cM("full-header", { gridTemplateAreas: "\n 'header header'\n 'sider content'\n 'sider footer'\n " }), cM("full-content", {
297
+ width: "calc(100% + var(--app-sider-width))",
298
+ height: "calc(100% + var(--app-header-height))",
299
+ left: "calc(-1 * var(--app-sider-width))",
300
+ top: "calc(-1 * var(--app-header-height))"
301
+ })]),
302
+ cB("header", {
303
+ gridArea: "header",
304
+ overflow: "hidden",
305
+ zIndex: 2,
306
+ height: "var(--app-header-height, 44px)",
307
+ zIndex: "2"
308
+ }),
309
+ cB("sider", {
310
+ gridArea: "sider",
311
+ width: "var(--app-sider-width, 220px)",
312
+ display: "flex",
313
+ flexDirection: "column",
314
+ overflow: "auto",
315
+ position: "relative",
316
+ transition: "width 0.2s ease-in-out",
317
+ zIndex: "2"
318
+ }, [cE("collapse-btn", {
319
+ "--n-padding": "0 12px",
320
+ position: "absolute",
321
+ zIndex: "2",
322
+ bottom: "8px",
323
+ right: "8px"
324
+ })]),
325
+ cB("content", {
326
+ gridArea: "content",
327
+ position: "relative",
328
+ overflow: "hidden",
329
+ zIndex: "1"
330
+ }),
331
+ cB("footer", {
332
+ gridArea: "footer",
333
+ lineHeight: "24px"
334
+ })
335
+ ]), IFold = () => createVNode("svg", {
336
+ xmlns: "http://www.w3.org/2000/svg",
337
+ width: "1em",
338
+ height: "1em",
339
+ viewBox: "0 0 24 24"
340
+ }, [createVNode("path", {
341
+ fill: "none",
342
+ stroke: "currentColor",
343
+ "stroke-linecap": "round",
344
+ "stroke-linejoin": "round",
345
+ "stroke-width": "1.5",
346
+ d: "M11.5 18s-6-4.419-6-6s6-6 6-6m7 12s-6-4.419-6-6s6-6 6-6",
347
+ color: "currentColor"
348
+ }, null)]), IUnfold = () => createVNode("svg", {
349
+ xmlns: "http://www.w3.org/2000/svg",
350
+ width: "1em",
351
+ height: "1em",
352
+ viewBox: "0 0 24 24"
353
+ }, [createVNode("path", {
354
+ fill: "none",
355
+ stroke: "currentColor",
356
+ "stroke-linecap": "round",
357
+ "stroke-linejoin": "round",
358
+ "stroke-width": "1.5",
359
+ d: "M12.5 18s6-4.419 6-6s-6-6-6-6m-7 12s6-4.419 6-6s-6-6-6-6",
360
+ color: "currentColor"
361
+ }, null)]);
362
+ const AppLayout = /* @__PURE__ */ defineComponent({
363
+ name: "AppLayout",
364
+ props: {
365
+ layout: {
366
+ type: String,
367
+ default: "left2right"
368
+ },
369
+ fullContent: Boolean
370
+ },
371
+ setup(d, { slots: z }) {
372
+ useStyle("-layout", style, ref("app"), !1);
373
+ let B = reactive({
374
+ siderWidth: "0px",
375
+ headerHeight: "0px",
376
+ footerHeight: "0px",
377
+ hasMultiTab: !1
378
+ });
379
+ return provide(CTX_INJECTION_KEY, B), () => {
380
+ let { layout: V } = d;
381
+ return createVNode("div", {
382
+ class: {
383
+ "app-layout": !0,
384
+ "app-layout--full-header": V === "top2bottom",
385
+ "app-layout--full-content": d.fullContent
386
+ },
387
+ style: {
388
+ "--app-sider-width": B.siderWidth,
389
+ "--app-header-height": B.headerHeight,
390
+ "--app-footer-height": B.footerHeight
391
+ }
392
+ }, [renderSlot(z, "default")]);
393
+ };
394
+ }
395
+ }), AppHeader = /* @__PURE__ */ defineComponent({
396
+ name: "AppHeader",
397
+ props: { height: {
398
+ type: Number,
399
+ default: 44
400
+ } },
401
+ setup(d, { slots: z }) {
402
+ let B = getCtx();
403
+ return () => (B.headerHeight = d.height + "px", createVNode("div", { class: "app-header" }, [renderSlot(z, "default")]));
404
+ }
405
+ }), AppSider = /* @__PURE__ */ defineComponent({
406
+ name: "AppSider",
407
+ props: {
408
+ showCollapseBtn: {
409
+ type: Boolean,
410
+ default: !0
411
+ },
412
+ collapsed: Boolean,
413
+ width: {
414
+ type: Number,
415
+ default: 220
416
+ },
417
+ collapsedWidth: {
418
+ type: Number,
419
+ default: 60
420
+ }
421
+ },
422
+ emits: { "update:collapsed": () => !0 },
423
+ setup(z, { emit: V, slots: H }) {
424
+ provide(COLLAPSED_INJECTION_KEY, toRef(z, "collapsed"));
425
+ let { t: U } = useI18n(), W = getCtx();
426
+ return () => (W.siderWidth = (z.collapsed ? z.collapsedWidth : z.width) + "px", createVNode("div", { class: "app-sider" }, [renderSlot(H, "default"), z.showCollapseBtn ? withDirectives(createVNode(NButton, {
427
+ class: "app-sider__collapse-btn",
428
+ quaternary: !0,
429
+ onClick: () => {
430
+ V("update:collapsed", !z.collapsed);
431
+ }
432
+ }, { default: () => [createVNode(NIcon, { size: "20" }, { default: () => [z.collapsed ? createVNode(IUnfold, null, null) : createVNode(IFold, null, null)] })] }), [[vTooltip, z.collapsed ? U("common.layout.sider.expand") : U("common.layout.sider.collapse")]]) : void 0]));
433
+ }
434
+ }), AppContent = /* @__PURE__ */ defineComponent({
435
+ name: "AppContent",
436
+ setup(d, { slots: z }) {
437
+ return () => createVNode("div", { class: "app-content" }, [renderSlot(z, "default")]);
438
+ }
439
+ }), AppFooter = /* @__PURE__ */ defineComponent({
440
+ name: "AppFooter",
441
+ props: { height: {
442
+ type: Number,
443
+ default: 30
444
+ } },
445
+ setup(d, { slots: z }) {
446
+ let B = getCtx();
447
+ return () => (B.footerHeight = d.height + "px", createVNode("div", { class: "app-footer" }, [renderSlot(z, "default")]));
448
+ }
449
+ });
450
+ function _isSlot$2(d) {
451
+ return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !isVNode(d);
452
+ }
453
+ const AppLogo = /* @__PURE__ */ defineComponent({
454
+ name: "AppLogo",
455
+ props: {
456
+ src: [String, Function],
457
+ name: String,
458
+ collapsed: {
459
+ type: Boolean,
460
+ default: void 0
461
+ },
462
+ center: {
463
+ type: Boolean,
464
+ default: !1
465
+ },
466
+ link: {
467
+ type: Boolean,
468
+ default: !0
469
+ }
470
+ },
471
+ setup(d, { slots: z }) {
472
+ let B = computedAsync(() => typeof d.src == "function" ? d.src() : d.src), V = inject(COLLAPSED_INJECTION_KEY, !1);
473
+ return () => {
474
+ let { name: H, collapsed: U, center: W, link: G } = d;
475
+ U ??= unref(V);
476
+ let K = U ? 1 : 1 / 1.1;
477
+ return createVNode("div", {
478
+ class: "app-logo",
479
+ style: {
480
+ "--app-logo-img-size": "32px",
481
+ "--app-logo-name-size": "22px",
482
+ width: W ? "100%" : "auto",
483
+ overflow: "hidden",
484
+ display: "flex",
485
+ alignItems: "center",
486
+ justifyContent: W ? "center" : "flex-start",
487
+ cursor: G ? "pointer" : void 0
488
+ }
489
+ }, [z.default ? z.default() : createVNode("div", {
490
+ class: "app-logo__img",
491
+ style: `
492
+ width: ${U ? "var(--app-sider-width, 60px)" : "56px"};
493
+ font-size: ${U ? "calc(var(--app-sider-width, 60px) - 24px)" : "32px"};
494
+ transition: width 0.2s ease-in-out 0.1s;
495
+ flex: 0 0 auto;
496
+ display: flex;
497
+ justify-content: center
498
+ `
499
+ }, [z.icon ? z.icon() : createVNode("img", {
500
+ src: B.value,
501
+ alt: "App Logo",
502
+ style: `transition: height 0.2s ease-in-out; height: calc(var(--app-logo-img-size) * ${K})`
503
+ }, null)]), H ? createVNode(NText, {
504
+ class: "app-logo__name",
505
+ style: "font-size: var(--app-logo-name-size); font-weight: bold; white-space: nowrap; flex: 0 1 auto; overflow: hidden"
506
+ }, _isSlot$2(H) ? H : { default: () => [H] }) : ""]);
507
+ };
508
+ }
509
+ });
510
+ function _isSlot$1(d) {
511
+ return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !isVNode(d);
512
+ }
513
+ const AppMenu = /* @__PURE__ */ defineComponent({
514
+ name: "AppMenu",
515
+ props: {
516
+ menus: Array,
517
+ getIcon: Function,
518
+ current: String,
519
+ horizontal: Boolean,
520
+ single: Boolean,
521
+ accordion: Boolean,
522
+ collapsed: {
523
+ type: Boolean,
524
+ default: void 0
525
+ },
526
+ renderLabel: Function,
527
+ width: {
528
+ type: Number,
529
+ default: 220
530
+ },
531
+ collapsedWidth: {
532
+ type: Number,
533
+ default: 60
534
+ }
535
+ },
536
+ setup(d) {
537
+ let z = shallowRef([]);
538
+ watch([() => d.menus, () => d.single], ([B, V]) => {
539
+ if (z.value = [], !B?.length) return;
540
+ let H = (z, B = 0) => {
541
+ let U = [];
542
+ for (let W of z) {
543
+ if (W.type === "action") continue;
544
+ let z = W.type === "view" ? void 0 : H(W.children ?? [], B + 1), G = {
545
+ _: W,
546
+ key: W.key,
547
+ label: () => d.renderLabel?.(W) ?? W.name,
548
+ icon: B === 0 || W.icon ? d.getIcon?.(W.icon) ?? IBookmark : void 0,
549
+ children: V ? void 0 : z,
550
+ path: W.path || (V ? z?.[0]?.path : void 0),
551
+ depth: B
552
+ };
553
+ delete G.type, U.push(G);
554
+ }
555
+ return U;
556
+ };
557
+ z.value = H(B);
558
+ }, { immediate: !0 }), watch([useTemplateRef("menu"), () => d.current], ([d, z]) => {
559
+ d?.showOption(z);
560
+ }, { immediate: !0 });
561
+ let V = inject(COLLAPSED_INJECTION_KEY, !1), H = (z) => {
562
+ let H = d.collapsed ?? unref(V), U;
563
+ if (z._.type === "view") if (z.isExternal && z.externalEmbed) U = createVNode("a", {
564
+ href: z.externalLink,
565
+ target: "_blank",
566
+ onClick: (d) => d.stopPropagation()
567
+ }, [z.label()]);
568
+ else {
569
+ let d;
570
+ U = createVNode(RouterLink, { to: z.path }, _isSlot$1(d = z.label()) ? d : { default: () => [d] });
571
+ }
572
+ else U = createVNode("span", null, [z.label()]);
573
+ return U.key = `${z.key}:${H ? 1 : 0}`, z.depth === 0 && !H && (U = withDirectives(U, [[
574
+ vTooltip,
575
+ z.label(),
576
+ void 0,
577
+ {
578
+ auto: !0,
579
+ right: !0
580
+ }
581
+ ]])), z.isNew && (U = createVNode("div", { style: "display: flex; width: 100%" }, [createVNode("span", { style: "flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis" }, [U]), createVNode("svg", {
582
+ xmlns: "http://www.w3.org/2000/svg",
583
+ width: "24",
584
+ height: "24",
585
+ viewBox: "0 0 1024 1024",
586
+ style: "margin-left: 8px; flex: 0 0 auto;"
587
+ }, [createVNode("path", {
588
+ 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",
589
+ fill: "var(--color-danger)"
590
+ }, null)])])), U;
591
+ };
592
+ return () => {
593
+ let B = createVNode(NMenu, {
594
+ ref: "menu",
595
+ options: z.value,
596
+ rootIndent: 16,
597
+ accordion: d.accordion,
598
+ collapsed: d.collapsed ?? unref(V),
599
+ dropdownProps: { showArrow: !0 },
600
+ mode: d.horizontal ? "horizontal" : "vertical",
601
+ value: d.current ?? null,
602
+ renderLabel: H,
603
+ responsive: !0,
604
+ collapsedWidth: d.collapsedWidth,
605
+ width: d.width
606
+ }, null);
607
+ return d.horizontal ? B : createVNode(NScrollbar, null, _isSlot$1(B) ? B : { default: () => [B] });
608
+ };
609
+ }
610
+ });
611
+ function useCtxMenu(z, B, V) {
612
+ let { t: H } = useI18n(), U = reactive({
613
+ visible: !1,
614
+ x: 0,
615
+ y: 0
616
+ }), W = async (d, z) => {
617
+ d.preventDefault(), d.stopPropagation(), !(U.visible && U.tab === z) && (U.tab = z, U.visible && (U.visible = !1, await promiseTimeout(130)), U.visible = !0, U.x = d.clientX, U.y = d.clientY);
618
+ }, G = async () => {
619
+ requestIdleCallback(() => {
620
+ U.visible = !1;
621
+ }, { timeout: 30 });
622
+ }, K = useRouter();
623
+ return {
624
+ ctx: U,
625
+ onCtx: W,
626
+ onClickoutside: G,
627
+ options: computed(() => [
628
+ {
629
+ key: "reload",
630
+ label: H("common.layout.tabs.reloadTab"),
631
+ disabled: U.tab && U.tab.key !== B.value,
632
+ icon: () => createVNode(NIcon, { size: 20 }, { default: () => [createVNode("svg", {
633
+ xmlns: "http://www.w3.org/2000/svg",
634
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
635
+ role: "img",
636
+ width: "1em",
637
+ height: "1em",
638
+ viewBox: "0 0 24 24"
639
+ }, [createVNode("path", {
640
+ fill: "currentColor",
641
+ 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"
642
+ }, null)])] })
643
+ },
644
+ {
645
+ key: "fullTab",
646
+ label: H("common.layout.tabs.fullTab"),
647
+ icon: () => createVNode(NIcon, { size: 16 }, { default: () => [createVNode("svg", {
648
+ xmlns: "http://www.w3.org/2000/svg",
649
+ width: "1em",
650
+ height: "1em",
651
+ viewBox: "0 0 24 24"
652
+ }, [createVNode("path", {
653
+ fill: "currentColor",
654
+ "fill-rule": "evenodd",
655
+ 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",
656
+ "clip-rule": "evenodd"
657
+ }, null), createVNode("path", {
658
+ fill: "currentColor",
659
+ 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",
660
+ opacity: ".5"
661
+ }, null)])] })
662
+ },
663
+ {
664
+ key: "open",
665
+ label: H("common.layout.tabs.openTabBlank"),
666
+ disabled: U.tab?.key !== B.value,
667
+ icon: () => createVNode(NIcon, { size: 20 }, { default: () => [createVNode("svg", {
668
+ xmlns: "http://www.w3.org/2000/svg",
669
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
670
+ role: "img",
671
+ width: "1em",
672
+ height: "1em",
673
+ viewBox: "0 0 15 15"
674
+ }, [createVNode("path", {
675
+ fill: "currentColor",
676
+ "clip-rule": "evenodd",
677
+ "fill-rule": "evenodd",
678
+ 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"
679
+ }, null)])] })
680
+ },
681
+ {
682
+ key: "closeAll",
683
+ label: H("common.layout.tabs.closeAllTabs"),
684
+ icon: () => createVNode(NIcon, { size: 20 }, { default: () => [createVNode("svg", {
685
+ xmlns: "http://www.w3.org/2000/svg",
686
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
687
+ role: "img",
688
+ width: "1em",
689
+ height: "1em",
690
+ viewBox: "0 0 24 24"
691
+ }, [createVNode("path", {
692
+ fill: "currentColor",
693
+ 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"
694
+ }, null)])] })
695
+ },
696
+ {
697
+ key: "closeLeft",
698
+ label: H("common.layout.tabs.closeLeftTabs"),
699
+ disabled: !U.tab,
700
+ icon: () => createVNode(NIcon, { size: 20 }, { default: () => [createVNode("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
+ }, [createVNode("path", {
708
+ fill: "currentColor",
709
+ d: "M11 16v-3h10v-2H11V8l-4 4l4 4m-8 4h2V4H3v16Z"
710
+ }, null)])] })
711
+ },
712
+ {
713
+ key: "closeRight",
714
+ label: H("common.layout.tabs.closeRightTabs"),
715
+ disabled: !U.tab,
716
+ icon: () => createVNode(NIcon, { size: 20 }, { default: () => [createVNode("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
+ }, [createVNode("path", {
724
+ fill: "currentColor",
725
+ d: "M13 8v3H3v2h10v3l4-4l-4-4m6 12h2V4h-2v16Z"
726
+ }, null)])] })
727
+ },
728
+ {
729
+ key: "closeOther",
730
+ label: H("common.layout.tabs.closeOtherTabs"),
731
+ disabled: !U.tab,
732
+ icon: () => createVNode(NIcon, { size: 20 }, { default: () => [" ", createVNode("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 1024 1024"
739
+ }, [createVNode("path", {
740
+ fill: "currentColor",
741
+ 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"
742
+ }, null)])] })
743
+ }
744
+ ]),
745
+ onSelect: async (d) => {
746
+ U.visible = !1;
747
+ let H = [...z.value];
748
+ if (d === "closeAll") {
749
+ await K.push("/");
750
+ for (let d of H) d.key !== B.value && d.close(!1);
751
+ return;
752
+ }
753
+ if (d === "fullTab") {
754
+ V();
755
+ return;
756
+ }
757
+ if (!U.tab) {
758
+ let z = H.find((d) => d.key === B.value);
759
+ switch (d) {
760
+ case "open":
761
+ window.open(z.href, "_blank");
762
+ break;
763
+ case "reload":
764
+ z.reloading ||= (z.reloading = !0, await promiseTimeout(220), !1);
765
+ break;
766
+ }
767
+ return;
768
+ }
769
+ switch (d) {
770
+ case "open":
771
+ window.open(U.tab.href, "_blank");
772
+ break;
773
+ case "reload":
774
+ U.tab.reloading || (U.tab.reloading = !0, await promiseTimeout(220), U.tab.reloading = !1);
775
+ break;
776
+ case "close":
777
+ U.tab?.close();
778
+ break;
779
+ case "closeOther":
780
+ B.value !== U.tab.key && await K.push(U.tab.fullPath);
781
+ for (let d of H) d.key !== U.tab.key && d.close(!1);
782
+ break;
783
+ case "closeLeft":
784
+ B.value !== U.tab.key && await K.push(U.tab.fullPath);
785
+ for (let d of z.value.slice(0, H.indexOf(U.tab))) d.close(!1);
786
+ break;
787
+ case "closeRight":
788
+ B.value !== U.tab.key && await K.push(U.tab.fullPath);
789
+ for (let d of z.value.slice(H.indexOf(U.tab) + 1)) d.close(!1);
790
+ break;
791
+ }
792
+ }
793
+ };
794
+ }
795
+ function useContentScroll(d, z, B) {
796
+ function V(B) {
797
+ if (B === -1 || !z.value?.children.length) return;
798
+ let V = z.value.children[B];
799
+ d.value.scrollTo({
800
+ behavior: "smooth",
801
+ left: Math.max(0, z.value.offsetLeft + V.offsetLeft - d.value.clientWidth / 2 + V.clientWidth / 2 + 10)
802
+ });
803
+ }
804
+ return watchDebounced(useElementHover(d), (d) => {
805
+ d || V(B.value);
806
+ }, { debounce: 333 }), watch(B, V, { flush: "post" }), useEventListener(d, "wheel", (z) => {
807
+ z.deltaMode === WheelEvent.DOM_DELTA_PIXEL && (z.preventDefault(), d.value.scrollBy({ left: z.deltaY }));
808
+ }, { passive: !1 }), {
809
+ el: d,
810
+ content: z
811
+ };
812
+ }
813
+ var IBg = (d) => createVNode("svg", d, [
814
+ createVNode("defs", null, [
815
+ createVNode("symbol", {
816
+ id: "geometry-left",
817
+ viewBox: "0 0 214 36"
818
+ }, [createVNode("path", { d: "M17 0h197v36H0v-2c4.5 0 9-3.5 9-8V8c0-4.5 3.5-8 8-8z" }, null)]),
819
+ createVNode("symbol", {
820
+ id: "geometry-right",
821
+ viewBox: "0 0 214 36"
822
+ }, [createVNode("use", { "xlink:href": "#geometry-left" }, null)]),
823
+ createVNode("clipPath", null, [createVNode("rect", {
824
+ width: "100%",
825
+ height: "100%",
826
+ x: "0"
827
+ }, null)])
828
+ ]),
829
+ createVNode("svg", {
830
+ width: "50%",
831
+ height: "100%"
832
+ }, [createVNode("use", {
833
+ "xlink:href": "#geometry-left",
834
+ width: "214",
835
+ height: "36",
836
+ fill: "currentColor"
837
+ }, null)]),
838
+ createVNode("g", { transform: "scale(-1, 1)" }, [createVNode("svg", {
839
+ width: "50%",
840
+ height: "100%",
841
+ x: "-100%",
842
+ y: "0"
843
+ }, [createVNode("use", {
844
+ "xlink:href": "#geometry-right",
845
+ width: "214",
846
+ height: "36",
847
+ fill: "currentColor"
848
+ }, null)])])
849
+ ]), AppTab = /* @__PURE__ */ defineComponent({
850
+ name: "AppTab",
851
+ props: {
852
+ path: String,
853
+ isCurrent: Boolean,
854
+ isLast: Boolean,
855
+ closable: Boolean,
856
+ dark: Boolean
857
+ },
858
+ emits: ["close"],
859
+ setup(d, { emit: z, slots: B }) {
860
+ let V = ref(), H = useElementHover(V), U = ref(), W = ref(), { width: G } = useElementSize(W);
861
+ watch(G, async () => {
862
+ await promiseTimeout(1), U.value.style.width = W.value.scrollWidth + "px";
863
+ });
864
+ let K = useThemeVars(), q = computed(() => ({
865
+ fontSize: "14px",
866
+ color: d.isCurrent ? K.value.primaryColor : K.value.textColor3,
867
+ maxWidth: "355px",
868
+ overflow: "hidden"
869
+ })), J = computed(() => ({
870
+ width: "calc(100% + 27px)",
871
+ height: "100%",
872
+ position: "absolute",
873
+ top: "0",
874
+ left: "-14px",
875
+ zIndex: d.isCurrent ? -1 : -2,
876
+ color: d.isCurrent ? getOpaqueColor(K.value.primaryColor, d.dark ? .3 : .12, d.dark ? "#000" : "#fff") : H.value ? K.value.borderColor : "transparent"
877
+ }));
878
+ return () => createVNode("div", {
879
+ ref: V,
880
+ style: "position: relative; padding: 2px 10px 5px; cursor: pointer"
881
+ }, [
882
+ createVNode("div", {
883
+ ref: U,
884
+ style: "transition: width 300ms; overflow: hidden"
885
+ }, [createVNode("div", {
886
+ ref: W,
887
+ style: "display: flex; align-items: center; gap: 4px; width: fit-content"
888
+ }, [createVNode("span", { style: q.value }, [B.default?.()]), d.closable !== !1 && (d.isCurrent || H.value) ? createVNode("span", { style: "line-height: 0; display: inline-block; text-align: right; padding-top: 2px" }, [createVNode(NButton, {
889
+ text: !0,
890
+ onClick: (d) => {
891
+ d.stopPropagation(), z("close");
892
+ }
893
+ }, { default: () => [createVNode(NIcon, { size: 18 }, { default: () => [createVNode("svg", {
894
+ xmlns: "http://www.w3.org/2000/svg",
895
+ width: "1em",
896
+ height: "1em",
897
+ viewBox: "0 0 24 24"
898
+ }, [createVNode("path", {
899
+ fill: "currentColor",
900
+ 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"
901
+ }, null)])] })] })]) : void 0])]),
902
+ createVNode("span", { style: "height: 50%; width: 1px; background: #aaa; display: inline-block; position: absolute; top: 20%; right: -4px; z-index: -3" }, null),
903
+ createVNode(IBg, { style: J.value }, null)
904
+ ]);
905
+ }
906
+ });
907
+ const AppMultiTabs = /* @__PURE__ */ defineComponent({
908
+ name: "AppMultiTabs",
909
+ props: {
910
+ fullTab: Boolean,
911
+ showBreadcrumb: Boolean,
912
+ tabs: Array,
913
+ current: Object,
914
+ dark: Boolean
915
+ },
916
+ emits: ["update:fullTab"],
917
+ setup(d, { emit: z, slots: B }) {
918
+ let V = getCtx();
919
+ V.hasMultiTab = !0;
920
+ let H = useRouter(), { ctx: U, onCtx: W, onClickoutside: G, options: K, onSelect: q } = useCtxMenu(toRef(d, "tabs"), computed(() => d.current?.key), () => z("update:fullTab", !d.fullTab)), J = computed(() => d.current ? d.tabs.findIndex((z) => z.key === d.current?.key) : -1), Y = ref(), Z = ref();
921
+ return useContentScroll(Y, Z, J), () => createVNode("div", { style: "width: 100%; height: 100%; overflow: hidden; display: flex; justify-content: space-between" }, [createVNode("div", {
922
+ ref: Y,
923
+ style: "flex: 1 1 100%; height: 100%; display: flex; overflow: hidden; align-items: center; position: relative"
924
+ }, [
925
+ createVNode("div", { style: "height: 100%; flex: 0 0 16px; z-index: 1; position: sticky; left: 0; backdrop-filter: opacity(0.9) blur(5px)" }, null),
926
+ createVNode("div", {
927
+ ref: Z,
928
+ style: "padding-inline: 12px; flex: 1 1 auto; display: flex; align-items: end; gap: 8px; height: 100%",
929
+ onContextmenu: (d) => W(d)
930
+ }, [d.tabs.map((z, V, U) => {
931
+ let G = d.current?.key === z.key, K = z.title ?? z.path;
932
+ return createVNode(AppTab, {
933
+ key: z.key,
934
+ isCurrent: G,
935
+ isLast: V === U.length - 1,
936
+ onClose: z.close,
937
+ closable: z.closable,
938
+ dark: d.dark,
939
+ onClick: () => {
940
+ G || H.push(z.fullPath);
941
+ },
942
+ onContextmenu: (d) => W(d, z)
943
+ }, { default: () => [B.name ? B.name({
944
+ isCurrent: G,
945
+ name: K,
946
+ tab: z
947
+ }) : K] });
948
+ })]),
949
+ createVNode("div", { style: "height: 100%; flex: 0 0 16px; z-index: 1; position: sticky; right: 0; backdrop-filter: opacity(0.9) blur(5px)" }, null)
950
+ ]), createVNode(NDropdown, {
951
+ placement: "bottom-start",
952
+ trigger: "manual",
953
+ show: U.visible,
954
+ x: U.x,
955
+ y: U.y,
956
+ options: K.value,
957
+ onClickoutside: G,
958
+ onSelect: q
959
+ }, null)]);
960
+ }
961
+ });
962
+ function _isSlot(d) {
963
+ return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !isVNode(d);
964
+ }
965
+ const AppNotification = /* @__PURE__ */ defineComponent({
966
+ name: "AppNotification",
967
+ inheritAttrs: !1,
968
+ props: {
969
+ getUnreadCount: Function,
970
+ getPage: Function,
971
+ markRead: Function,
972
+ markDelete: Function,
973
+ interval: {
974
+ type: Number,
975
+ default: 3e4
976
+ }
977
+ },
978
+ setup(z, { slots: H, attrs: U }) {
979
+ let { t: W } = useI18n(), G = ref(!1), K = ref("unread"), q = reactive({
980
+ page: 1,
981
+ size: 10,
982
+ loading: !1,
983
+ records: [],
984
+ total: 0,
985
+ unread: 0
986
+ }), { sync: J, post: X } = useAtomicBroadcast({
987
+ channel: "__ithinkdt_mc_shared_channel",
988
+ onMsg: (d) => {
989
+ q.unread = d;
990
+ },
991
+ getMsg: () => (G.value && (q.loading = !0, Promise.resolve(z.getPage?.(K.value, q.page, q.size) ?? []).then(({ records: d, total: z }) => {
992
+ q.records = d, K.value === "unread" ? (q.unread = z, X(z)) : q.total = z;
993
+ }).finally(() => {
994
+ q.loading = !1;
995
+ })), z.getUnreadCount?.() ?? 0),
996
+ timeout: () => z.interval,
997
+ immediate: !0
998
+ });
999
+ return () => {
1000
+ let d = withDirectives(createVNode(NButton, mergeProps(U, {
1001
+ quaternary: !0,
1002
+ style: "--n-padding: 0 12px",
1003
+ onClick: () => {
1004
+ G.value = !0, K.value = q.unread > 0 ? "unread" : "all", setTimeout(J, 300);
1005
+ }
1006
+ }), { default: () => [H.icon ? H.icon() : createVNode(NBadge, {
1007
+ show: q.unread > 0,
1008
+ dot: !0,
1009
+ offset: [-2, 5],
1010
+ processing: !0
1011
+ }, { default: () => [createVNode(NIcon, { size: "18" }, { default: () => [createVNode("svg", {
1012
+ xmlns: "http://www.w3.org/2000/svg",
1013
+ width: "1em",
1014
+ height: "1em",
1015
+ viewBox: "0 0 24 24"
1016
+ }, [createVNode("g", {
1017
+ fill: "none",
1018
+ stroke: "currentColor",
1019
+ "stroke-linecap": "round",
1020
+ "stroke-linejoin": "round",
1021
+ "stroke-width": "1.5",
1022
+ color: "currentColor"
1023
+ }, [createVNode("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), createVNode("path", { d: "M8 19c.458 1.725 2.076 3 4 3c1.925 0 3.541-1.275 4-3" }, null)])])] })] })] }), [[
1024
+ vTooltip,
1025
+ W("common.notification.tip", { count: q.unread }),
1026
+ void 0,
1027
+ { bottom: !0 }
1028
+ ]]), X = () => {
1029
+ let d, z;
1030
+ return createVNode("div", { style: "display: flex; align-items: baseline; gap: 20px" }, [
1031
+ createVNode("div", { style: "padding-right: 12px" }, [W("common.notification.title")]),
1032
+ createVNode(NButton, {
1033
+ text: !0,
1034
+ type: K.value === "all" ? "primary" : "default",
1035
+ onClick: () => {
1036
+ K.value = "all", J();
1037
+ }
1038
+ }, _isSlot(d = W("common.notification.all")) ? d : { default: () => [d] }),
1039
+ createVNode(NButton, {
1040
+ text: !0,
1041
+ type: K.value === "unread" ? "primary" : "default",
1042
+ onClick: () => {
1043
+ K.value = "unread", J();
1044
+ }
1045
+ }, _isSlot(z = W("common.notification.unread", { count: q.unread > 99 ? "99+" : q.unread.toString() })) ? z : { default: () => [z] })
1046
+ ]);
1047
+ }, Z = (d) => createVNode(NListItem, {
1048
+ key: d.key,
1049
+ onClick: () => {
1050
+ d.status === "unread" && (z.markRead?.([d.key]).then(() => {
1051
+ d.status = "read";
1052
+ }), q.unread--), d.link && window.open(d.link, "_target");
1053
+ }
1054
+ }, { default: () => [createVNode(NThing, {
1055
+ bordered: !1,
1056
+ closable: !0,
1057
+ contentIndented: !0,
1058
+ size: "small",
1059
+ onMouseenter: () => d.hover = !0,
1060
+ onMouseleave: () => d.hover = !1,
1061
+ style: "padding: 0 4px"
1062
+ }, {
1063
+ avatar: () => createVNode(NIcon, {
1064
+ size: 22,
1065
+ color: d.status === "unread" ? "var(--color-primary)" : void 0
1066
+ }, { default: () => [createVNode("svg", {
1067
+ xmlns: "http://www.w3.org/2000/svg",
1068
+ width: "1em",
1069
+ height: "1em",
1070
+ viewBox: "0 0 24 24"
1071
+ }, [createVNode("path", {
1072
+ fill: "currentColor",
1073
+ 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"
1074
+ }, null)])] }),
1075
+ header: () => d.title,
1076
+ "header-extra": () => {
1077
+ let B, V;
1078
+ return d.hover ? createVNode("div", {
1079
+ style: "display: flex; justify-content: end; gap: 12px",
1080
+ onClick: (d) => {
1081
+ d.preventDefault(), d.stopPropagation();
1082
+ }
1083
+ }, [d.status === "unread" ? createVNode(NButton, {
1084
+ text: !0,
1085
+ type: "primary",
1086
+ onClick: () => {
1087
+ z.markRead?.([d.key]).then(() => {
1088
+ d.status = "read", q.unread--;
1089
+ });
1090
+ }
1091
+ }, _isSlot(B = W("common.notification.markRead")) ? B : { default: () => [B] }) : void 0, createVNode(NButton, {
1092
+ text: !0,
1093
+ type: "error",
1094
+ onClick: () => {
1095
+ q.records === 1 ? (q.records = [], J()) : q.records.splice(q.records.findIndex((z) => z.key == d.key), 1), z.markDelete?.([d.key]);
1096
+ }
1097
+ }, _isSlot(V = W("common.notification.markDelete")) ? V : { default: () => [V] })]) : void 0;
1098
+ },
1099
+ default: d.content,
1100
+ footer: () => createVNode("span", { style: "color: gray" }, [d.hover ? format(d.date, W("common.notification.time")) : W("common.timeago", { time: d.date })])
1101
+ })] }), Q = () => {
1102
+ let d;
1103
+ return withDirectives(q.records.length > 0 ? createVNode(NList, {
1104
+ clickable: !0,
1105
+ hoverable: !0,
1106
+ style: "min-height: 50vh"
1107
+ }, _isSlot(d = q.records.map((d) => Z(d))) ? d : { default: () => [d] }) : createVNode(NEmpty, { style: "margin-top: 30vh" }, null), [[vSpin, q.loading]]);
1108
+ }, $ = () => createVNode("div", { style: "display: flex; justify-content: space-between; width: 100%" }, [K.value === "unread" ? createVNode(NButton, {
1109
+ text: !0,
1110
+ type: "primary",
1111
+ disabled: q.records.length === 0,
1112
+ onClick: () => {
1113
+ let d = q.records.filter((d) => d.status === "unread").map((d) => d.key);
1114
+ z.markRead(d).then(() => {
1115
+ for (; q.unread - d.length <= q.size * (q.page - 1);) q.page--;
1116
+ J();
1117
+ });
1118
+ }
1119
+ }, {
1120
+ icon: () => createVNode(NIcon, { size: "20" }, { default: () => [createVNode("svg", {
1121
+ xmlns: "http://www.w3.org/2000/svg",
1122
+ width: "1em",
1123
+ height: "1em",
1124
+ viewBox: "0 0 24 24"
1125
+ }, [createVNode("path", {
1126
+ fill: "currentColor",
1127
+ 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"
1128
+ }, null)])] }),
1129
+ default: () => W("common.notification.markPageRead")
1130
+ }) : createVNode("span", null, null), createVNode(NPagination, {
1131
+ simple: !0,
1132
+ pageSize: q.size,
1133
+ page: q.page,
1134
+ itemCount: K.value === "unread" ? q.unread : q.total,
1135
+ onUpdatePage: (d) => {
1136
+ q.page = d, J();
1137
+ }
1138
+ }, null)]);
1139
+ return createVNode(Fragment, null, [d, createVNode(NDrawer, {
1140
+ show: G.value,
1141
+ "onUpdate:show": (d) => G.value = d,
1142
+ showMask: !1,
1143
+ width: 400
1144
+ }, { default: () => [createVNode(NDrawerContent, {
1145
+ title: W("common.notification.title"),
1146
+ closable: !0,
1147
+ nativeScrollbar: !1,
1148
+ bodyContentStyle: { padding: "0" }
1149
+ }, {
1150
+ header: X,
1151
+ default: Q,
1152
+ footer: $
1153
+ })] })]);
1154
+ };
1155
+ }
1156
+ });
1157
+ var ICheck = (d) => createVNode("svg", mergeProps({
1158
+ xmlns: "http://www.w3.org/2000/svg",
1159
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
1160
+ role: "img",
1161
+ width: "1em",
1162
+ height: "1em",
1163
+ viewBox: "0 0 24 24"
1164
+ }, d), [createVNode("path", {
1165
+ fill: "currentColor",
1166
+ d: "m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"
1167
+ }, null)]);
1168
+ const AppTenant = /* @__PURE__ */ defineComponent({
1169
+ name: "AppTenant",
1170
+ props: {
1171
+ options: Array,
1172
+ current: String
1173
+ },
1174
+ emit: ["update:current"],
1175
+ setup(z, { emit: B }) {
1176
+ let { t: V } = useI18n(), H = (d) => d.disabled ? createVNode("div", null, [d.name]) : createVNode("div", { style: "display: flex; align-items: center; justify-content: space-between; gap: 20px" }, [createVNode("div", { style: "display: flex; align-items: center; gap: 8px" }, [createVNode(NAvatar, {
1177
+ round: !0,
1178
+ size: 22,
1179
+ color: "var(--color-primary-hover)"
1180
+ }, { default: () => [d.icon?.() || d.name[0]] }), createVNode("span", { style: d.id === z.current ? "color: var(--color-primary)" : "" }, [d.name])]), d.id === z.current ? createVNode(ICheck, { style: "color: var(--color-primary); font-size: 20px" }, null) : createVNode("div", null, null)]), U = computed(() => [{
1181
+ id: "___",
1182
+ name: V("common.account.changeTenant"),
1183
+ disabled: !0
1184
+ }, ...z.options ?? []]);
1185
+ return () => {
1186
+ if (!z.options?.length) return;
1187
+ let d = z.options.find((d) => d.id === z.current);
1188
+ return createVNode(NDropdown, {
1189
+ options: U.value,
1190
+ placement: "bottom-end",
1191
+ keyField: "id",
1192
+ labelField: "name",
1193
+ showArrow: !0,
1194
+ renderLabel: H,
1195
+ onSelect: (d) => d !== z.current && B("update:current", d)
1196
+ }, { default: () => [createVNode(NButton, {
1197
+ quaternary: !0,
1198
+ style: "--n-padding: 0 6px"
1199
+ }, {
1200
+ icon: () => createVNode(NIcon, { size: "18" }, { default: () => [createVNode("svg", {
1201
+ xmlns: "http://www.w3.org/2000/svg",
1202
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
1203
+ viewBox: "0 0 1024 1024",
1204
+ width: "1em",
1205
+ height: "1em",
1206
+ role: "img"
1207
+ }, [createVNode("path", {
1208
+ 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",
1209
+ fill: "currentColor"
1210
+ }, null)])] }),
1211
+ default: () => d.shotName || d.name
1212
+ })] });
1213
+ };
1214
+ }
1215
+ }), UIProvider = /* @__PURE__ */ defineComponent({
1216
+ name: "UIProvider",
1217
+ props: { i18n: Function },
1218
+ setup(d, { slots: B }) {
1219
+ return provide(UI_I18N_INJECTION, toRef(d, "i18n")), () => B.default();
1220
+ }
1221
+ });
1222
+ export { AppAccount, AppAppearance, AppBreadcrumb, AppContent, AppFooter, AppFullscreen, AppHeader, AppLanguage, AppLayout, AppLogo, AppMenu, AppMultiTabs, AppNotification, AppSider, AppTenant, SpinDirectiveProvider, TooltipDirectiveProvider, UIProvider, vSpin, vTooltip };