@ithinkdt/ui 4.0.0-38 → 4.0.0-400

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 (60) hide show
  1. package/auto-imports.js +1 -1
  2. package/dist/components-B_qzc9ro.js +1736 -0
  3. package/dist/components.js +5 -0
  4. package/dist/directives-qqYcWl1I.js +194 -0
  5. package/dist/directives.js +3 -0
  6. package/dist/index.js +1212 -0
  7. package/dist/page.js +519 -0
  8. package/dist/use-i18n-Dx7V4KrY.js +6 -0
  9. package/dist/use-style-DcT-1dj4.js +29 -0
  10. package/dist/use-style.js +2 -0
  11. package/{src → esm}/components.d.ts +56 -15
  12. package/esm/components.js +1 -0
  13. package/esm/directives.js +1 -0
  14. package/esm/index.js +1 -0
  15. package/{src → esm}/page.d.ts +2 -2
  16. package/esm/page.js +1 -0
  17. package/esm/use-style.js +1 -0
  18. package/package.json +29 -26
  19. package/unocss-preset.d.ts +5 -0
  20. package/unocss-preset.js +163 -0
  21. package/src/components/Checkboxes.jsx +0 -130
  22. package/src/components/DataActions.jsx +0 -105
  23. package/src/components/DataCustom.jsx +0 -187
  24. package/src/components/DataFilter.jsx +0 -119
  25. package/src/components/DataForm.jsx +0 -264
  26. package/src/components/DataLocaleInput.jsx +0 -121
  27. package/src/components/DataPagination.jsx +0 -62
  28. package/src/components/DataSelection.jsx +0 -57
  29. package/src/components/DataTable.jsx +0 -302
  30. package/src/components/Radios.jsx +0 -134
  31. package/src/components/UserDept.jsx +0 -643
  32. package/src/components/assets.jsx +0 -274
  33. package/src/components/index.js +0 -11
  34. package/src/design/Account.jsx +0 -154
  35. package/src/design/Appearance.jsx +0 -89
  36. package/src/design/Breadcrumb.jsx +0 -67
  37. package/src/design/Fullscreen.jsx +0 -65
  38. package/src/design/Language.jsx +0 -45
  39. package/src/design/Layout.jsx +0 -241
  40. package/src/design/Logo.jsx +0 -92
  41. package/src/design/Menu.jsx +0 -133
  42. package/src/design/MultiTabs.jsx +0 -501
  43. package/src/design/Notification.jsx +0 -311
  44. package/src/design/Tenant.jsx +0 -88
  45. package/src/design/common.jsx +0 -21
  46. package/src/design/index.js +0 -11
  47. package/src/directives/index.js +0 -2
  48. package/src/directives/spin.js +0 -181
  49. package/src/directives/tooltip.jsx +0 -121
  50. package/src/index.js +0 -18
  51. package/src/page.jsx +0 -740
  52. package/src/use-i18n.js +0 -8
  53. package/src/use-style.js +0 -58
  54. package/src/utils.js +0 -20
  55. package/unocss.d.ts +0 -5
  56. package/unocss.js +0 -94
  57. /package/{src → esm}/design.d.ts +0 -0
  58. /package/{src → esm}/directives.d.ts +0 -0
  59. /package/{src → esm}/index.d.ts +0 -0
  60. /package/{src → esm}/use-style.d.ts +0 -0
package/dist/index.js ADDED
@@ -0,0 +1,1212 @@
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-qqYcWl1I.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: "32px",
334
+ textAlign: "center",
335
+ color: "gray"
336
+ })
337
+ ]), IFold = () => createVNode("svg", {
338
+ xmlns: "http://www.w3.org/2000/svg",
339
+ width: "1em",
340
+ height: "1em",
341
+ viewBox: "0 0 24 24"
342
+ }, [createVNode("path", {
343
+ fill: "none",
344
+ stroke: "currentColor",
345
+ "stroke-linecap": "round",
346
+ "stroke-linejoin": "round",
347
+ "stroke-width": "1.5",
348
+ d: "M11.5 18s-6-4.419-6-6s6-6 6-6m7 12s-6-4.419-6-6s6-6 6-6",
349
+ color: "currentColor"
350
+ }, null)]), IUnfold = () => createVNode("svg", {
351
+ xmlns: "http://www.w3.org/2000/svg",
352
+ width: "1em",
353
+ height: "1em",
354
+ viewBox: "0 0 24 24"
355
+ }, [createVNode("path", {
356
+ fill: "none",
357
+ stroke: "currentColor",
358
+ "stroke-linecap": "round",
359
+ "stroke-linejoin": "round",
360
+ "stroke-width": "1.5",
361
+ d: "M12.5 18s6-4.419 6-6s-6-6-6-6m-7 12s6-4.419 6-6s-6-6-6-6",
362
+ color: "currentColor"
363
+ }, null)]);
364
+ const AppLayout = /* @__PURE__ */ defineComponent({
365
+ name: "AppLayout",
366
+ props: {
367
+ layout: {
368
+ type: String,
369
+ default: "left2right"
370
+ },
371
+ fullContent: Boolean
372
+ },
373
+ setup(d, { slots: z }) {
374
+ useStyle("-layout", style, ref("app"), !1);
375
+ let B = reactive({
376
+ siderWidth: "0px",
377
+ headerHeight: "0px",
378
+ footerHeight: "0px",
379
+ hasMultiTab: !1
380
+ });
381
+ return provide(CTX_INJECTION_KEY, B), () => {
382
+ let { layout: V } = d;
383
+ return createVNode("div", {
384
+ class: {
385
+ "app-layout": !0,
386
+ "app-layout--full-header": V === "top2bottom",
387
+ "app-layout--full-content": d.fullContent
388
+ },
389
+ style: {
390
+ "--app-sider-width": B.siderWidth,
391
+ "--app-header-height": B.headerHeight,
392
+ "--app-footer-height": B.footerHeight
393
+ }
394
+ }, [renderSlot(z, "default")]);
395
+ };
396
+ }
397
+ }), AppHeader = /* @__PURE__ */ defineComponent({
398
+ name: "AppHeader",
399
+ props: { height: {
400
+ type: Number,
401
+ default: 44
402
+ } },
403
+ setup(d, { slots: z }) {
404
+ let B = getCtx();
405
+ return () => (B.headerHeight = d.height + "px", createVNode("div", { class: "app-header" }, [renderSlot(z, "default")]));
406
+ }
407
+ }), AppSider = /* @__PURE__ */ defineComponent({
408
+ name: "AppSider",
409
+ props: {
410
+ showCollapseBtn: {
411
+ type: Boolean,
412
+ default: !0
413
+ },
414
+ collapsed: Boolean,
415
+ width: {
416
+ type: Number,
417
+ default: 220
418
+ },
419
+ collapsedWidth: {
420
+ type: Number,
421
+ default: 60
422
+ }
423
+ },
424
+ emits: { "update:collapsed": () => !0 },
425
+ setup(z, { emit: V, slots: H }) {
426
+ provide(COLLAPSED_INJECTION_KEY, toRef(z, "collapsed"));
427
+ let { t: U } = useI18n(), W = getCtx();
428
+ return () => (W.siderWidth = (z.collapsed ? z.collapsedWidth : z.width) + "px", createVNode("div", { class: "app-sider" }, [renderSlot(H, "default"), z.showCollapseBtn ? withDirectives(createVNode(NButton, {
429
+ class: "app-sider__collapse-btn",
430
+ quaternary: !0,
431
+ onClick: () => {
432
+ V("update:collapsed", !z.collapsed);
433
+ }
434
+ }, { 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]));
435
+ }
436
+ }), AppContent = /* @__PURE__ */ defineComponent({
437
+ name: "AppContent",
438
+ setup(d, { slots: z }) {
439
+ return () => createVNode("div", { class: "app-content" }, [renderSlot(z, "default")]);
440
+ }
441
+ }), AppFooter = /* @__PURE__ */ defineComponent({
442
+ name: "AppFooter",
443
+ props: { height: {
444
+ type: Number,
445
+ default: 30
446
+ } },
447
+ setup(d, { slots: z }) {
448
+ let B = getCtx();
449
+ return () => (B.footerHeight = d.height + "px", createVNode("div", { class: "app-footer" }, [renderSlot(z, "default")]));
450
+ }
451
+ });
452
+ function _isSlot$2(d) {
453
+ return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !isVNode(d);
454
+ }
455
+ const AppLogo = /* @__PURE__ */ defineComponent({
456
+ name: "AppLogo",
457
+ props: {
458
+ src: [String, Function],
459
+ name: String,
460
+ collapsed: {
461
+ type: Boolean,
462
+ default: void 0
463
+ },
464
+ center: {
465
+ type: Boolean,
466
+ default: !1
467
+ },
468
+ link: {
469
+ type: Boolean,
470
+ default: !0
471
+ }
472
+ },
473
+ setup(d, { slots: z }) {
474
+ let B = computedAsync(() => typeof d.src == "function" ? d.src() : d.src), V = inject(COLLAPSED_INJECTION_KEY, !1);
475
+ return () => {
476
+ let { name: H, collapsed: U, center: W, link: G } = d;
477
+ U ??= unref(V);
478
+ let K = U ? 1 : 1 / 1.1;
479
+ return createVNode("div", {
480
+ class: "app-logo",
481
+ style: {
482
+ "--app-logo-img-size": "32px",
483
+ "--app-logo-name-size": "22px",
484
+ width: W ? "100%" : "auto",
485
+ overflow: "hidden",
486
+ display: "flex",
487
+ alignItems: "center",
488
+ justifyContent: W ? "center" : "flex-start",
489
+ cursor: G ? "pointer" : void 0
490
+ }
491
+ }, [z.default ? z.default() : createVNode("div", {
492
+ class: "app-logo__img",
493
+ style: `
494
+ width: ${U ? "var(--app-sider-width, 60px)" : "56px"};
495
+ font-size: ${U ? "calc(var(--app-sider-width, 60px) - 24px)" : "32px"};
496
+ transition: width 0.2s ease-in-out 0.1s;
497
+ flex: 0 0 auto;
498
+ display: flex;
499
+ justify-content: center
500
+ `
501
+ }, [z.icon ? z.icon() : createVNode("img", {
502
+ src: B.value,
503
+ alt: "App Logo",
504
+ style: `transition: height 0.2s ease-in-out; height: calc(var(--app-logo-img-size) * ${K})`
505
+ }, null)]), H ? createVNode(NText, {
506
+ class: "app-logo__name",
507
+ style: "font-size: var(--app-logo-name-size); font-weight: bold; white-space: nowrap; flex: 0 1 auto; overflow: hidden"
508
+ }, _isSlot$2(H) ? H : { default: () => [H] }) : ""]);
509
+ };
510
+ }
511
+ });
512
+ function _isSlot$1(d) {
513
+ return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !isVNode(d);
514
+ }
515
+ const AppMenu = /* @__PURE__ */ defineComponent({
516
+ name: "AppMenu",
517
+ props: {
518
+ menus: Array,
519
+ getIcon: Function,
520
+ current: String,
521
+ horizontal: Boolean,
522
+ single: Boolean,
523
+ accordion: Boolean,
524
+ collapsed: {
525
+ type: Boolean,
526
+ default: void 0
527
+ },
528
+ renderLabel: Function,
529
+ width: {
530
+ type: Number,
531
+ default: 220
532
+ },
533
+ collapsedWidth: {
534
+ type: Number,
535
+ default: 60
536
+ }
537
+ },
538
+ setup(d) {
539
+ let z = shallowRef([]);
540
+ watch([() => d.menus, () => d.single], ([B, V]) => {
541
+ if (z.value = [], !B?.length) return;
542
+ let H = (z, B = 0) => {
543
+ let U = [];
544
+ for (let W of z) {
545
+ if (W.type === "action") continue;
546
+ let z = W.type === "view" ? void 0 : H(W.children ?? [], B + 1), G = {
547
+ _: W,
548
+ key: W.key,
549
+ label: () => d.renderLabel?.(W) ?? W.name,
550
+ icon: B === 0 || W.icon ? d.getIcon?.(W.icon) ?? IBookmark : void 0,
551
+ children: V ? void 0 : z,
552
+ path: W.path || (V ? z?.[0]?.path : void 0),
553
+ depth: B
554
+ };
555
+ delete G.type, U.push(G);
556
+ }
557
+ return U;
558
+ };
559
+ z.value = H(B);
560
+ }, { immediate: !0 }), watch([useTemplateRef("menu"), () => d.current], ([d, z]) => {
561
+ d?.showOption(z);
562
+ }, { immediate: !0 });
563
+ let V = inject(COLLAPSED_INJECTION_KEY, !1), H = (z) => {
564
+ let H = d.collapsed ?? unref(V), U;
565
+ if (z._.type === "view") if (z.isExternal && z.externalEmbed) U = createVNode("a", {
566
+ href: z.externalLink,
567
+ target: "_blank",
568
+ onClick: (d) => d.stopPropagation()
569
+ }, [z.label()]);
570
+ else {
571
+ let d;
572
+ U = createVNode(RouterLink, { to: z.path }, _isSlot$1(d = z.label()) ? d : { default: () => [d] });
573
+ }
574
+ else U = createVNode("span", null, [z.label()]);
575
+ return U.key = `${z.key}:${H ? 1 : 0}`, z.depth === 0 && !H && (U = withDirectives(U, [[
576
+ vTooltip,
577
+ z.label(),
578
+ void 0,
579
+ {
580
+ auto: !0,
581
+ right: !0
582
+ }
583
+ ]])), 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", {
584
+ xmlns: "http://www.w3.org/2000/svg",
585
+ width: "24",
586
+ height: "24",
587
+ viewBox: "0 0 1024 1024",
588
+ style: "margin-left: 8px; flex: 0 0 auto;"
589
+ }, [createVNode("path", {
590
+ 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",
591
+ fill: "var(--color-danger)"
592
+ }, null)])])), U;
593
+ };
594
+ return () => {
595
+ let B = createVNode(NMenu, {
596
+ ref: "menu",
597
+ options: z.value,
598
+ rootIndent: 16,
599
+ accordion: d.accordion,
600
+ collapsed: d.collapsed ?? unref(V),
601
+ dropdownProps: { showArrow: !0 },
602
+ mode: d.horizontal ? "horizontal" : "vertical",
603
+ value: d.current ?? null,
604
+ renderLabel: H,
605
+ responsive: !0,
606
+ collapsedWidth: d.collapsedWidth,
607
+ width: d.width
608
+ }, null);
609
+ return d.horizontal ? B : createVNode(NScrollbar, null, _isSlot$1(B) ? B : { default: () => [B] });
610
+ };
611
+ }
612
+ });
613
+ function useCtxMenu(z, B, V) {
614
+ let { t: H } = useI18n(), U = reactive({
615
+ visible: !1,
616
+ x: 0,
617
+ y: 0
618
+ }), W = async (d, z) => {
619
+ 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);
620
+ }, G = async () => {
621
+ requestIdleCallback(() => {
622
+ U.visible = !1;
623
+ }, { timeout: 30 });
624
+ }, K = useRouter();
625
+ return {
626
+ ctx: U,
627
+ onCtx: W,
628
+ onClickoutside: G,
629
+ options: computed(() => [
630
+ {
631
+ key: "reload",
632
+ label: H("common.layout.tabs.reloadTab"),
633
+ disabled: !U.tab || U.tab.key !== B.value,
634
+ icon: () => createVNode(NIcon, { size: 20 }, { default: () => [createVNode("svg", {
635
+ xmlns: "http://www.w3.org/2000/svg",
636
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
637
+ role: "img",
638
+ width: "1em",
639
+ height: "1em",
640
+ viewBox: "0 0 24 24"
641
+ }, [createVNode("path", {
642
+ fill: "currentColor",
643
+ 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"
644
+ }, null)])] })
645
+ },
646
+ {
647
+ key: "fullTab",
648
+ label: H("common.layout.tabs.fullTab"),
649
+ icon: () => createVNode(NIcon, { size: 16 }, { default: () => [createVNode("svg", {
650
+ xmlns: "http://www.w3.org/2000/svg",
651
+ width: "1em",
652
+ height: "1em",
653
+ viewBox: "0 0 24 24"
654
+ }, [createVNode("path", {
655
+ fill: "currentColor",
656
+ "fill-rule": "evenodd",
657
+ 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",
658
+ "clip-rule": "evenodd"
659
+ }, null), createVNode("path", {
660
+ fill: "currentColor",
661
+ 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",
662
+ opacity: ".5"
663
+ }, null)])] })
664
+ },
665
+ {
666
+ key: "open",
667
+ label: H("common.layout.tabs.openTabBlank"),
668
+ disabled: !U.tab,
669
+ icon: () => createVNode(NIcon, { size: 20 }, { default: () => [createVNode("svg", {
670
+ xmlns: "http://www.w3.org/2000/svg",
671
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
672
+ role: "img",
673
+ width: "1em",
674
+ height: "1em",
675
+ viewBox: "0 0 15 15"
676
+ }, [createVNode("path", {
677
+ fill: "currentColor",
678
+ "clip-rule": "evenodd",
679
+ "fill-rule": "evenodd",
680
+ 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"
681
+ }, null)])] })
682
+ },
683
+ {
684
+ key: "closeAll",
685
+ label: H("common.layout.tabs.closeAllTabs"),
686
+ icon: () => createVNode(NIcon, { size: 20 }, { default: () => [createVNode("svg", {
687
+ xmlns: "http://www.w3.org/2000/svg",
688
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
689
+ role: "img",
690
+ width: "1em",
691
+ height: "1em",
692
+ viewBox: "0 0 24 24"
693
+ }, [createVNode("path", {
694
+ fill: "currentColor",
695
+ 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"
696
+ }, null)])] })
697
+ },
698
+ {
699
+ key: "closeLeft",
700
+ label: H("common.layout.tabs.closeLeftTabs"),
701
+ disabled: !U.tab,
702
+ icon: () => createVNode(NIcon, { size: 20 }, { default: () => [createVNode("svg", {
703
+ xmlns: "http://www.w3.org/2000/svg",
704
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
705
+ role: "img",
706
+ width: "1em",
707
+ height: "1em",
708
+ viewBox: "0 0 24 24"
709
+ }, [createVNode("path", {
710
+ fill: "currentColor",
711
+ d: "M11 16v-3h10v-2H11V8l-4 4l4 4m-8 4h2V4H3v16Z"
712
+ }, null)])] })
713
+ },
714
+ {
715
+ key: "closeRight",
716
+ label: H("common.layout.tabs.closeRightTabs"),
717
+ disabled: !U.tab,
718
+ icon: () => createVNode(NIcon, { size: 20 }, { default: () => [createVNode("svg", {
719
+ xmlns: "http://www.w3.org/2000/svg",
720
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
721
+ role: "img",
722
+ width: "1em",
723
+ height: "1em",
724
+ viewBox: "0 0 24 24"
725
+ }, [createVNode("path", {
726
+ fill: "currentColor",
727
+ d: "M13 8v3H3v2h10v3l4-4l-4-4m6 12h2V4h-2v16Z"
728
+ }, null)])] })
729
+ },
730
+ {
731
+ key: "closeOther",
732
+ label: H("common.layout.tabs.closeOtherTabs"),
733
+ disabled: !U.tab,
734
+ icon: () => createVNode(NIcon, { size: 20 }, { default: () => [" ", createVNode("svg", {
735
+ xmlns: "http://www.w3.org/2000/svg",
736
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
737
+ role: "img",
738
+ width: "1em",
739
+ height: "1em",
740
+ viewBox: "0 0 1024 1024"
741
+ }, [createVNode("path", {
742
+ fill: "currentColor",
743
+ 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"
744
+ }, null)])] })
745
+ }
746
+ ]),
747
+ onSelect: async (d) => {
748
+ U.visible = !1;
749
+ let H = [...z.value];
750
+ if (d === "closeAll") {
751
+ await K.push("/");
752
+ for (let d of H) d.key !== B.value && d.close(!1);
753
+ return;
754
+ }
755
+ if (d === "fullTab") {
756
+ V();
757
+ return;
758
+ }
759
+ if (U.tab) switch (d) {
760
+ case "open":
761
+ window.open(U.tab.href, "_blank");
762
+ break;
763
+ case "reload":
764
+ U.tab.reloading || (U.tab.reloading = !0, await promiseTimeout(220), U.tab.reloading = !1);
765
+ break;
766
+ case "close":
767
+ U.tab?.close();
768
+ break;
769
+ case "closeOther":
770
+ B.value !== U.tab.key && await K.push(U.tab.fullPath);
771
+ for (let d of H) d.key !== U.tab.key && d.close(!1);
772
+ break;
773
+ case "closeLeft":
774
+ B.value !== U.tab.key && await K.push(U.tab.fullPath);
775
+ for (let d of z.value.slice(0, H.indexOf(U.tab))) d.close(!1);
776
+ break;
777
+ case "closeRight":
778
+ B.value !== U.tab.key && await K.push(U.tab.fullPath);
779
+ for (let d of z.value.slice(H.indexOf(U.tab) + 1)) d.close(!1);
780
+ break;
781
+ }
782
+ }
783
+ };
784
+ }
785
+ function useContentScroll(d, z, B) {
786
+ function V(B) {
787
+ if (B === -1 || !z.value?.children.length) return;
788
+ let V = z.value.children[B];
789
+ d.value.scrollTo({
790
+ behavior: "smooth",
791
+ left: Math.max(0, z.value.offsetLeft + V.offsetLeft - d.value.clientWidth / 2 + V.clientWidth / 2 + 10)
792
+ });
793
+ }
794
+ return watchDebounced(useElementHover(d), (d) => {
795
+ d || V(B.value);
796
+ }, { debounce: 333 }), watch(B, V, { flush: "post" }), useEventListener(d, "wheel", (z) => {
797
+ z.deltaMode === WheelEvent.DOM_DELTA_PIXEL && (z.preventDefault(), d.value.scrollBy({ left: z.deltaY }));
798
+ }, { passive: !1 }), {
799
+ el: d,
800
+ content: z
801
+ };
802
+ }
803
+ var IBg = (d) => createVNode("svg", d, [
804
+ createVNode("defs", null, [
805
+ createVNode("symbol", {
806
+ id: "geometry-left",
807
+ viewBox: "0 0 214 36"
808
+ }, [createVNode("path", { d: "M17 0h197v36H0v-2c4.5 0 9-3.5 9-8V8c0-4.5 3.5-8 8-8z" }, null)]),
809
+ createVNode("symbol", {
810
+ id: "geometry-right",
811
+ viewBox: "0 0 214 36"
812
+ }, [createVNode("use", { "xlink:href": "#geometry-left" }, null)]),
813
+ createVNode("clipPath", null, [createVNode("rect", {
814
+ width: "100%",
815
+ height: "100%",
816
+ x: "0"
817
+ }, null)])
818
+ ]),
819
+ createVNode("svg", {
820
+ width: "50%",
821
+ height: "100%"
822
+ }, [createVNode("use", {
823
+ "xlink:href": "#geometry-left",
824
+ width: "214",
825
+ height: "36",
826
+ fill: "currentColor"
827
+ }, null)]),
828
+ createVNode("g", { transform: "scale(-1, 1)" }, [createVNode("svg", {
829
+ width: "50%",
830
+ height: "100%",
831
+ x: "-100%",
832
+ y: "0"
833
+ }, [createVNode("use", {
834
+ "xlink:href": "#geometry-right",
835
+ width: "214",
836
+ height: "36",
837
+ fill: "currentColor"
838
+ }, null)])])
839
+ ]), AppTab = /* @__PURE__ */ defineComponent({
840
+ name: "AppTab",
841
+ props: {
842
+ path: String,
843
+ isCurrent: Boolean,
844
+ isLast: Boolean,
845
+ closable: Boolean,
846
+ dark: Boolean
847
+ },
848
+ emits: ["close"],
849
+ setup(d, { emit: z, slots: B }) {
850
+ let V = ref(), H = useElementHover(V), U = ref(), W = ref(), { width: G } = useElementSize(W);
851
+ watch(G, async () => {
852
+ await promiseTimeout(1), U.value.style.width = W.value.scrollWidth + "px";
853
+ });
854
+ let K = useThemeVars(), q = computed(() => ({
855
+ fontSize: "14px",
856
+ color: d.isCurrent ? K.value.primaryColor : K.value.textColor3,
857
+ maxWidth: "355px",
858
+ overflow: "hidden"
859
+ })), J = computed(() => ({
860
+ width: "calc(100% + 27px)",
861
+ height: "100%",
862
+ position: "absolute",
863
+ top: "0",
864
+ left: "-14px",
865
+ zIndex: d.isCurrent ? -1 : -2,
866
+ color: d.isCurrent ? getOpaqueColor(K.value.primaryColor, d.dark ? .3 : .12, d.dark ? "#000" : "#fff") : H.value ? K.value.borderColor : "transparent"
867
+ }));
868
+ return () => createVNode("div", {
869
+ ref: V,
870
+ style: "position: relative; padding: 2px 10px 5px; cursor: pointer"
871
+ }, [
872
+ createVNode("div", {
873
+ ref: U,
874
+ style: "transition: width 300ms; overflow: hidden"
875
+ }, [createVNode("div", {
876
+ ref: W,
877
+ style: "display: flex; align-items: center; gap: 4px; width: fit-content"
878
+ }, [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, {
879
+ text: !0,
880
+ onClick: (d) => {
881
+ d.stopPropagation(), z("close");
882
+ }
883
+ }, { default: () => [createVNode(NIcon, { size: 18 }, { default: () => [createVNode("svg", {
884
+ xmlns: "http://www.w3.org/2000/svg",
885
+ width: "1em",
886
+ height: "1em",
887
+ viewBox: "0 0 24 24"
888
+ }, [createVNode("path", {
889
+ fill: "currentColor",
890
+ 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"
891
+ }, null)])] })] })]) : void 0])]),
892
+ createVNode("span", { style: "height: 50%; width: 1px; background: #aaa; display: inline-block; position: absolute; top: 20%; right: -4px; z-index: -3" }, null),
893
+ createVNode(IBg, { style: J.value }, null)
894
+ ]);
895
+ }
896
+ });
897
+ const AppMultiTabs = /* @__PURE__ */ defineComponent({
898
+ name: "AppMultiTabs",
899
+ props: {
900
+ fullTab: Boolean,
901
+ showBreadcrumb: Boolean,
902
+ tabs: Array,
903
+ current: Object,
904
+ dark: Boolean
905
+ },
906
+ emits: ["update:fullTab"],
907
+ setup(d, { emit: z, slots: B }) {
908
+ let V = getCtx();
909
+ V.hasMultiTab = !0;
910
+ 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();
911
+ return useContentScroll(Y, Z, J), () => createVNode("div", { style: "width: 100%; height: 100%; overflow: hidden; display: flex; justify-content: space-between" }, [createVNode("div", {
912
+ ref: Y,
913
+ style: "flex: 1 1 100%; height: 100%; display: flex; overflow: hidden; align-items: center; position: relative"
914
+ }, [
915
+ createVNode("div", { style: "height: 100%; flex: 0 0 16px; z-index: 1; position: sticky; left: 0; backdrop-filter: opacity(0.9) blur(5px)" }, null),
916
+ createVNode("div", {
917
+ ref: Z,
918
+ style: "padding-inline: 12px; flex: 1 1 auto; display: flex; align-items: end; gap: 8px; height: 100%",
919
+ onContextmenu: (d) => W(d)
920
+ }, [d.tabs.map((z, V, U) => {
921
+ let G = d.current?.key === z.key, K = z.title ?? z.path;
922
+ return createVNode(AppTab, {
923
+ key: z.key,
924
+ isCurrent: G,
925
+ isLast: V === U.length - 1,
926
+ onClose: z.close,
927
+ closable: z.closable,
928
+ dark: d.dark,
929
+ onClick: () => {
930
+ G || H.push(z.fullPath);
931
+ },
932
+ onContextmenu: (d) => W(d, z)
933
+ }, { default: () => [B.name ? B.name({
934
+ isCurrent: G,
935
+ name: K,
936
+ tab: z
937
+ }) : K] });
938
+ })]),
939
+ createVNode("div", { style: "height: 100%; flex: 0 0 16px; z-index: 1; position: sticky; right: 0; backdrop-filter: opacity(0.9) blur(5px)" }, null)
940
+ ]), createVNode(NDropdown, {
941
+ placement: "bottom-start",
942
+ trigger: "manual",
943
+ show: U.visible,
944
+ x: U.x,
945
+ y: U.y,
946
+ options: K.value,
947
+ onClickoutside: G,
948
+ onSelect: q
949
+ }, null)]);
950
+ }
951
+ });
952
+ function _isSlot(d) {
953
+ return typeof d == "function" || Object.prototype.toString.call(d) === "[object Object]" && !isVNode(d);
954
+ }
955
+ const AppNotification = /* @__PURE__ */ defineComponent({
956
+ name: "AppNotification",
957
+ inheritAttrs: !1,
958
+ props: {
959
+ getUnreadCount: Function,
960
+ getPage: Function,
961
+ markRead: Function,
962
+ markDelete: Function,
963
+ interval: {
964
+ type: Number,
965
+ default: 3e4
966
+ }
967
+ },
968
+ setup(z, { slots: H, attrs: U }) {
969
+ let { t: W } = useI18n(), G = ref(!1), K = ref("unread"), q = reactive({
970
+ page: 1,
971
+ size: 10,
972
+ loading: !1,
973
+ records: [],
974
+ total: 0,
975
+ unread: 0
976
+ }), { sync: J, post: X } = useAtomicBroadcast({
977
+ channel: "__ithinkdt_mc_shared_channel",
978
+ onMsg: (d) => {
979
+ q.unread = d;
980
+ },
981
+ getMsg: () => (G.value && (q.loading = !0, Promise.resolve(z.getPage?.(K.value, q.page, q.size) ?? []).then(({ records: d, total: z }) => {
982
+ q.records = d, K.value === "unread" ? (q.unread = z, X(z)) : q.total = z;
983
+ }).finally(() => {
984
+ q.loading = !1;
985
+ })), z.getUnreadCount?.() ?? 0),
986
+ timeout: () => z.interval,
987
+ immediate: !0
988
+ });
989
+ return () => {
990
+ let d = withDirectives(createVNode(NButton, mergeProps(U, {
991
+ quaternary: !0,
992
+ style: "--n-padding: 0 12px",
993
+ onClick: () => {
994
+ G.value = !0, K.value = q.unread > 0 ? "unread" : "all", setTimeout(J, 300);
995
+ }
996
+ }), { default: () => [H.icon ? H.icon() : createVNode(NBadge, {
997
+ show: q.unread > 0,
998
+ dot: !0,
999
+ offset: [-2, 5],
1000
+ processing: !0
1001
+ }, { default: () => [createVNode(NIcon, { size: "18" }, { default: () => [createVNode("svg", {
1002
+ xmlns: "http://www.w3.org/2000/svg",
1003
+ width: "1em",
1004
+ height: "1em",
1005
+ viewBox: "0 0 24 24"
1006
+ }, [createVNode("g", {
1007
+ fill: "none",
1008
+ stroke: "currentColor",
1009
+ "stroke-linecap": "round",
1010
+ "stroke-linejoin": "round",
1011
+ "stroke-width": "1.5",
1012
+ color: "currentColor"
1013
+ }, [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)])])] })] })] }), [[
1014
+ vTooltip,
1015
+ W("common.notification.tip", { count: q.unread }),
1016
+ void 0,
1017
+ { bottom: !0 }
1018
+ ]]), X = () => {
1019
+ let d, z;
1020
+ return createVNode("div", { style: "display: flex; align-items: baseline; gap: 20px" }, [
1021
+ createVNode("div", { style: "padding-right: 12px" }, [W("common.notification.title")]),
1022
+ createVNode(NButton, {
1023
+ text: !0,
1024
+ type: K.value === "all" ? "primary" : "default",
1025
+ onClick: () => {
1026
+ K.value = "all", J();
1027
+ }
1028
+ }, _isSlot(d = W("common.notification.all")) ? d : { default: () => [d] }),
1029
+ createVNode(NButton, {
1030
+ text: !0,
1031
+ type: K.value === "unread" ? "primary" : "default",
1032
+ onClick: () => {
1033
+ K.value = "unread", J();
1034
+ }
1035
+ }, _isSlot(z = W("common.notification.unread", { count: q.unread > 99 ? "99+" : q.unread.toString() })) ? z : { default: () => [z] })
1036
+ ]);
1037
+ }, Z = (d) => createVNode(NListItem, {
1038
+ key: d.key,
1039
+ onClick: () => {
1040
+ d.status === "unread" && (z.markRead?.([d.key]).then(() => {
1041
+ d.status = "read";
1042
+ }), q.unread--), d.link && window.open(d.link, "_target");
1043
+ }
1044
+ }, { default: () => [createVNode(NThing, {
1045
+ bordered: !1,
1046
+ closable: !0,
1047
+ contentIndented: !0,
1048
+ size: "small",
1049
+ onMouseenter: () => d.hover = !0,
1050
+ onMouseleave: () => d.hover = !1,
1051
+ style: "padding: 0 4px"
1052
+ }, {
1053
+ avatar: () => createVNode(NIcon, {
1054
+ size: 22,
1055
+ color: d.status === "unread" ? "var(--color-primary)" : void 0
1056
+ }, { default: () => [createVNode("svg", {
1057
+ xmlns: "http://www.w3.org/2000/svg",
1058
+ width: "1em",
1059
+ height: "1em",
1060
+ viewBox: "0 0 24 24"
1061
+ }, [createVNode("path", {
1062
+ fill: "currentColor",
1063
+ 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"
1064
+ }, null)])] }),
1065
+ header: () => d.title,
1066
+ "header-extra": () => {
1067
+ let B, V;
1068
+ return d.hover ? createVNode("div", {
1069
+ style: "display: flex; justify-content: end; gap: 12px",
1070
+ onClick: (d) => {
1071
+ d.preventDefault(), d.stopPropagation();
1072
+ }
1073
+ }, [d.status === "unread" ? createVNode(NButton, {
1074
+ text: !0,
1075
+ type: "primary",
1076
+ onClick: () => {
1077
+ z.markRead?.([d.key]).then(() => {
1078
+ d.status = "read", q.unread--;
1079
+ });
1080
+ }
1081
+ }, _isSlot(B = W("common.notification.markRead")) ? B : { default: () => [B] }) : void 0, createVNode(NButton, {
1082
+ text: !0,
1083
+ type: "error",
1084
+ onClick: () => {
1085
+ q.records === 1 ? (q.records = [], J()) : q.records.splice(q.records.findIndex((z) => z.key == d.key), 1), z.markDelete?.([d.key]);
1086
+ }
1087
+ }, _isSlot(V = W("common.notification.markDelete")) ? V : { default: () => [V] })]) : void 0;
1088
+ },
1089
+ default: d.content,
1090
+ footer: () => createVNode("span", { style: "color: gray" }, [d.hover ? format(d.date, W("common.notification.time")) : W("common.timeago", { time: d.date })])
1091
+ })] }), Q = () => {
1092
+ let d;
1093
+ return withDirectives(q.records.length > 0 ? createVNode(NList, {
1094
+ clickable: !0,
1095
+ hoverable: !0,
1096
+ style: "min-height: 50vh"
1097
+ }, _isSlot(d = q.records.map((d) => Z(d))) ? d : { default: () => [d] }) : createVNode(NEmpty, { style: "margin-top: 30vh" }, null), [[vSpin, q.loading]]);
1098
+ }, $ = () => createVNode("div", { style: "display: flex; justify-content: space-between; width: 100%" }, [K.value === "unread" ? createVNode(NButton, {
1099
+ text: !0,
1100
+ type: "primary",
1101
+ disabled: q.records.length === 0,
1102
+ onClick: () => {
1103
+ let d = q.records.filter((d) => d.status === "unread").map((d) => d.key);
1104
+ z.markRead(d).then(() => {
1105
+ for (; q.unread - d.length <= q.size * (q.page - 1);) q.page--;
1106
+ J();
1107
+ });
1108
+ }
1109
+ }, {
1110
+ icon: () => createVNode(NIcon, { size: "20" }, { default: () => [createVNode("svg", {
1111
+ xmlns: "http://www.w3.org/2000/svg",
1112
+ width: "1em",
1113
+ height: "1em",
1114
+ viewBox: "0 0 24 24"
1115
+ }, [createVNode("path", {
1116
+ fill: "currentColor",
1117
+ 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"
1118
+ }, null)])] }),
1119
+ default: () => W("common.notification.markPageRead")
1120
+ }) : createVNode("span", null, null), createVNode(NPagination, {
1121
+ simple: !0,
1122
+ pageSize: q.size,
1123
+ page: q.page,
1124
+ itemCount: K.value === "unread" ? q.unread : q.total,
1125
+ onUpdatePage: (d) => {
1126
+ q.page = d, J();
1127
+ }
1128
+ }, null)]);
1129
+ return createVNode(Fragment, null, [d, createVNode(NDrawer, {
1130
+ show: G.value,
1131
+ "onUpdate:show": (d) => G.value = d,
1132
+ showMask: !1,
1133
+ width: 400
1134
+ }, { default: () => [createVNode(NDrawerContent, {
1135
+ title: W("common.notification.title"),
1136
+ closable: !0,
1137
+ nativeScrollbar: !1,
1138
+ bodyContentStyle: { padding: "0" }
1139
+ }, {
1140
+ header: X,
1141
+ default: Q,
1142
+ footer: $
1143
+ })] })]);
1144
+ };
1145
+ }
1146
+ });
1147
+ var ICheck = (d) => createVNode("svg", mergeProps({
1148
+ xmlns: "http://www.w3.org/2000/svg",
1149
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
1150
+ role: "img",
1151
+ width: "1em",
1152
+ height: "1em",
1153
+ viewBox: "0 0 24 24"
1154
+ }, d), [createVNode("path", {
1155
+ fill: "currentColor",
1156
+ d: "m9.55 18l-5.7-5.7l1.425-1.425L9.55 15.15l9.175-9.175L20.15 7.4z"
1157
+ }, null)]);
1158
+ const AppTenant = /* @__PURE__ */ defineComponent({
1159
+ name: "AppTenant",
1160
+ props: {
1161
+ options: Array,
1162
+ current: String
1163
+ },
1164
+ emit: ["update:current"],
1165
+ setup(z, { emit: B }) {
1166
+ 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, {
1167
+ round: !0,
1168
+ size: 22,
1169
+ color: "var(--color-primary-hover)"
1170
+ }, { 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(() => [{
1171
+ id: "___",
1172
+ name: V("common.account.changeTenant"),
1173
+ disabled: !0
1174
+ }, ...z.options ?? []]);
1175
+ return () => {
1176
+ if (!z.options?.length) return;
1177
+ let d = z.options.find((d) => d.id === z.current);
1178
+ return createVNode(NDropdown, {
1179
+ options: U.value,
1180
+ placement: "bottom-end",
1181
+ keyField: "id",
1182
+ labelField: "name",
1183
+ showArrow: !0,
1184
+ renderLabel: H,
1185
+ onSelect: (d) => d !== z.current && B("update:current", d)
1186
+ }, { default: () => [createVNode(NButton, {
1187
+ quaternary: !0,
1188
+ style: "--n-padding: 0 6px"
1189
+ }, {
1190
+ icon: () => createVNode(NIcon, { size: "18" }, { default: () => [createVNode("svg", {
1191
+ xmlns: "http://www.w3.org/2000/svg",
1192
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
1193
+ viewBox: "0 0 1024 1024",
1194
+ width: "1em",
1195
+ height: "1em",
1196
+ role: "img"
1197
+ }, [createVNode("path", {
1198
+ 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",
1199
+ fill: "currentColor"
1200
+ }, null)])] }),
1201
+ default: () => d?.shotName || d?.name
1202
+ })] });
1203
+ };
1204
+ }
1205
+ }), UIProvider = /* @__PURE__ */ defineComponent({
1206
+ name: "UIProvider",
1207
+ props: { i18n: Function },
1208
+ setup(d, { slots: B }) {
1209
+ return provide(UI_I18N_INJECTION, toRef(d, "i18n")), () => B.default();
1210
+ }
1211
+ });
1212
+ export { AppAccount, AppAppearance, AppBreadcrumb, AppContent, AppFooter, AppFullscreen, AppHeader, AppLanguage, AppLayout, AppLogo, AppMenu, AppMultiTabs, AppNotification, AppSider, AppTenant, SpinDirectiveProvider, TooltipDirectiveProvider, UIProvider, vSpin, vTooltip };