@yeepay/yee-boss-ui 0.1.16 → 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +124 -59
- package/dist/PlatformConfigProvider-BwqlDDcK.js +34 -0
- package/dist/YeeDescriptions-BZ33odSs.js +128 -0
- package/dist/YeeEllipsisText-CR94Jym2.js +100 -0
- package/dist/YeeFileUpload-DvRN1D-j.js +196 -0
- package/dist/YeePage-Dbvn1TNi.js +99 -0
- package/dist/YeeTabs-BPzlkZy6.js +891 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/app-shell.d.ts +2 -0
- package/dist/app-shell.js +20 -0
- package/dist/components/app-shell/YeeAppShell.vue.d.ts +28 -0
- package/dist/components/app-shell/YeeHeader.vue.d.ts +40 -0
- package/dist/components/app-shell/YeeMenu.vue.d.ts +32 -0
- package/dist/components/app-shell/YeeSidebar.vue.d.ts +35 -0
- package/dist/components/app-shell/YeeTabs.vue.d.ts +69 -0
- package/dist/components/app-shell/index.d.ts +6 -0
- package/dist/components/app-shell/types.d.ts +258 -0
- package/dist/components/app-shell/use-tabs-drag.d.ts +7 -0
- package/dist/components/app-shell/use-tabs-scroll.d.ts +15 -0
- package/dist/components/grid/types.d.ts +1 -4
- package/dist/components/grid/vxe-init.d.ts +1 -1
- package/dist/components/modal/YeeModal.vue.d.ts +3 -3
- package/dist/context-C5gszWl6.js +4 -0
- package/dist/context-DJQ4f46a.js +12 -0
- package/dist/core.d.ts +8 -0
- package/dist/core.js +14 -0
- package/dist/descriptions.d.ts +1 -0
- package/dist/descriptions.js +4 -0
- package/dist/ellipsis-text.d.ts +1 -0
- package/dist/ellipsis-text.js +4 -0
- package/dist/file-upload.d.ts +1 -0
- package/dist/file-upload.js +4 -0
- package/dist/form-api-DbIL_dvg.js +201 -0
- package/dist/form.d.ts +1 -0
- package/dist/form.js +5 -0
- package/dist/grid.d.ts +1 -0
- package/dist/grid.js +5 -0
- package/dist/index-DZP16zRG.js +261 -0
- package/dist/index-kF3hvw2Z.js +132 -0
- package/dist/index.d.ts +2 -4
- package/dist/index.js +36 -2206
- package/dist/modal.d.ts +1 -0
- package/dist/modal.js +4 -0
- package/dist/page.d.ts +1 -0
- package/dist/page.js +4 -0
- package/dist/platform-message-BgD7E-34.js +22 -0
- package/dist/select.d.ts +1 -0
- package/dist/select.js +4 -0
- package/dist/style.css +1 -1
- package/dist/use-yee-grid-rYoenViE.js +464 -0
- package/package.json +68 -24
- package/dist/components/file-preview/YeeFilePreview.vue.d.ts +0 -23
- package/dist/components/file-preview/index.d.ts +0 -2
- package/dist/components/file-preview/source.d.ts +0 -8
- package/dist/components/file-preview/types.d.ts +0 -70
- package/dist/components/file-preview/useFilePreview.d.ts +0 -31
- package/dist/docx-preview.min-lCFRKxYn.js +0 -4852
- package/dist/marked.esm-DaHdfxOj.js +0 -1563
- package/dist/postal-mime-CPJ2QXsD.js +0 -3219
- package/dist/purify.es-HJ4qIUVZ.js +0 -869
- package/dist/xlsx-CF422ARu.js +0 -24728
|
@@ -0,0 +1,891 @@
|
|
|
1
|
+
import { defineComponent as P, useModel as H, computed as L, openBlock as c, createElementBlock as S, normalizeStyle as ee, normalizeClass as G, createElementVNode as T, renderSlot as K, mergeModels as E, inject as Ie, shallowRef as Y, onMounted as te, onBeforeUnmount as ne, createTextVNode as X, toDisplayString as J, createCommentVNode as $, createBlock as M, unref as r, withCtx as I, createVNode as x, useSlots as ve, watch as le, mergeProps as me, h as ge, nextTick as Q, useTemplateRef as Ke, Fragment as he, renderList as Be, resolveDynamicComponent as Oe } from "vue";
|
|
2
|
+
import { _ as V } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
3
|
+
import { MenuUnfoldOutlined as Ae, MenuFoldOutlined as We, MenuOutlined as Ye } from "@ant-design/icons-vue";
|
|
4
|
+
import { Tooltip as R, Button as N, Menu as Z, Dropdown as be } from "ant-design-vue";
|
|
5
|
+
import { RotateCw as _e, MoonStar as Ee, Sun as ze, Minimize as Fe, Maximize as Pe, ChevronLeft as Ve, X as ye, Pin as pe, ChevronRight as De, ChevronDown as Re, PinOff as Ne, ExternalLink as He, ArrowLeftToLine as Ge, ArrowRightToLine as qe, FoldHorizontal as Ue, ArrowRightLeft as je } from "lucide-vue-next";
|
|
6
|
+
import { p as Xe } from "./context-DJQ4f46a.js";
|
|
7
|
+
import Je from "sortablejs";
|
|
8
|
+
const Qe = { class: "yee-ui-app-shell__header" }, Ze = { class: "yee-ui-app-shell__body" }, et = { class: "yee-ui-app-shell__sidebar" }, tt = { class: "yee-ui-app-shell__content" }, nt = /* @__PURE__ */ P({
|
|
9
|
+
name: "YeeAppShell",
|
|
10
|
+
__name: "YeeAppShell",
|
|
11
|
+
props: /* @__PURE__ */ E({
|
|
12
|
+
headerHeight: { default: 50 },
|
|
13
|
+
sidebarWidth: { default: 224 },
|
|
14
|
+
sidebarCollapsedWidth: { default: 64 }
|
|
15
|
+
}, {
|
|
16
|
+
sidebarCollapsed: { type: Boolean, default: !1 },
|
|
17
|
+
sidebarCollapsedModifiers: {}
|
|
18
|
+
}),
|
|
19
|
+
emits: ["update:sidebarCollapsed"],
|
|
20
|
+
setup(o) {
|
|
21
|
+
const v = o, l = H(o, "sidebarCollapsed");
|
|
22
|
+
function a(i) {
|
|
23
|
+
return typeof i == "number" ? `${i}px` : i;
|
|
24
|
+
}
|
|
25
|
+
const u = L(() => ({
|
|
26
|
+
"--yee-content-height": "100%",
|
|
27
|
+
"--yee-ui-app-shell-header-height": a(v.headerHeight),
|
|
28
|
+
"--yee-ui-app-shell-sidebar-collapsed-width": a(v.sidebarCollapsedWidth),
|
|
29
|
+
"--yee-ui-app-shell-sidebar-current-width": a(
|
|
30
|
+
l.value ? v.sidebarCollapsedWidth : v.sidebarWidth
|
|
31
|
+
),
|
|
32
|
+
"--yee-ui-app-shell-sidebar-expanded-width": a(v.sidebarWidth)
|
|
33
|
+
}));
|
|
34
|
+
return (i, _) => (c(), S("div", {
|
|
35
|
+
class: G(["yee-ui-app-shell", { "yee-ui-app-shell--sidebar-collapsed": l.value }]),
|
|
36
|
+
style: ee(u.value)
|
|
37
|
+
}, [
|
|
38
|
+
T("div", Qe, [
|
|
39
|
+
K(i.$slots, "header", {}, void 0, !0)
|
|
40
|
+
]),
|
|
41
|
+
T("div", Ze, [
|
|
42
|
+
T("div", et, [
|
|
43
|
+
K(i.$slots, "sidebar", {}, void 0, !0)
|
|
44
|
+
]),
|
|
45
|
+
T("div", tt, [
|
|
46
|
+
K(i.$slots, "default", {}, void 0, !0)
|
|
47
|
+
])
|
|
48
|
+
])
|
|
49
|
+
], 6));
|
|
50
|
+
}
|
|
51
|
+
}), zt = /* @__PURE__ */ V(nt, [["__scopeId", "data-v-d49f2827"]]), lt = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1788345814609'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='20502'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='200'%20height='200'%3e%3cpath%20d='M125.643%20492.954c12.17-244.953%20235.799-433.516%20458.349-438.909-266.975%206.47-564.010%20155.506-564.010%20461.213%200%20141.71%2076.991%20270.507%20189.876%20352.758%20118.299%2086.197%20236.991%2093.132%20375.945%20108.132-252.997-27.311-473.721-210.25-460.159-483.195z'%20fill='%2328A13A'%20p-id='20503'%3e%3c/path%3e%3cpath%20d='M601.2%20135.572c-9.351%200-18.627%200.302-27.821%200.881%20184.945%2013.191%20331.172%20177.808%20331.172%20378.972%200%20201.165-146.227%20365.807-331.172%20379.001%209.195%200.58%2018.469%200.881%2027.821%200.881%20224.732%200%20406.907-170.096%20406.907-379.881%200-209.783-182.176-379.853-406.907-379.853z'%20fill='%2328A13A'%20p-id='20504'%3e%3c/path%3e%3cpath%20d='M562.975%20476.426c0%200-20.643%2019.911-0.899%2046.126%2019.769%2026.233%2041.823%2012.673%2044.75%2010.775l140.054-108.449c0%200%2023.015-19.012%200.687-48.657%200%200-105.169-179.743-279.463-76.575l-138.545%2067.633c0%200-179.407%2070.489-79.273%20202.545%200%200%2019.765%2028.923%2048.234%2047.087%200%200%20140.352%20114.068%20159.691%20123.68%200%200%20115.522%2063.267%20202.871-29.494%200%200%20162.115-179.981%20175.836-213.541%200%200%206.425-13.774%206.023-27.67%200%200-9.893-39.901-59.141%205.337%200%200-72.668%2080.163-109.129%20115.61%200%200-43.52%2056.435-101.225%2017.291%200%200-29.093-13.65-135.225-115.31%200%200-46.604-42.255-15.589-79.589%200%200%20107.979-95.726%20169.329-55.323%200%200%2027.504%2016.895%2042.564%2029.733%200%200%2022.154%2016.938-0.423%2034.239l-71.122%2054.556z'%20fill='%2328A13A'%20p-id='20505'%3e%3c/path%3e%3c/svg%3e", at = { class: "yee-ui-header__default-brand" }, st = { class: "yee-ui-header__logo-wrap" }, ot = ["alt", "src"], it = {
|
|
52
|
+
key: 1,
|
|
53
|
+
"aria-hidden": "true",
|
|
54
|
+
class: "yee-ui-header__logo-placeholder"
|
|
55
|
+
}, rt = {
|
|
56
|
+
key: 0,
|
|
57
|
+
class: "yee-ui-header__title"
|
|
58
|
+
}, dt = { class: "yee-ui-header__center" }, ct = {
|
|
59
|
+
key: 1,
|
|
60
|
+
class: "yee-ui-header__content"
|
|
61
|
+
}, ut = {
|
|
62
|
+
key: 0,
|
|
63
|
+
class: "yee-ui-header__actions"
|
|
64
|
+
}, ft = /* @__PURE__ */ P({
|
|
65
|
+
name: "YeeHeader",
|
|
66
|
+
__name: "YeeHeader",
|
|
67
|
+
props: /* @__PURE__ */ E({
|
|
68
|
+
headerHeight: { default: 50 },
|
|
69
|
+
sidebarWidth: { default: 224 },
|
|
70
|
+
sidebarCollapsedWidth: { default: 64 },
|
|
71
|
+
showSidebarToggle: { type: Boolean, default: !0 },
|
|
72
|
+
showRefresh: { type: Boolean, default: !0 },
|
|
73
|
+
showThemeToggle: { type: Boolean, default: !0 },
|
|
74
|
+
showFullscreen: { type: Boolean, default: !0 },
|
|
75
|
+
themeMode: {},
|
|
76
|
+
logo: { default: lt },
|
|
77
|
+
title: {},
|
|
78
|
+
logoAlt: { default: "应用 Logo" }
|
|
79
|
+
}, {
|
|
80
|
+
sidebarCollapsed: { type: Boolean, default: !1 },
|
|
81
|
+
sidebarCollapsedModifiers: {}
|
|
82
|
+
}),
|
|
83
|
+
emits: /* @__PURE__ */ E(["refresh", "themeChange", "fullscreenChange"], ["update:sidebarCollapsed"]),
|
|
84
|
+
setup(o, { emit: v }) {
|
|
85
|
+
const l = o, a = v, u = H(o, "sidebarCollapsed"), i = Ie(Xe, void 0), _ = Y("light"), m = L(() => l.themeMode ?? i?.value.mode ?? _.value), d = Y(!1);
|
|
86
|
+
function h(s) {
|
|
87
|
+
return typeof s == "number" ? `${s}px` : s;
|
|
88
|
+
}
|
|
89
|
+
const k = L(() => ({
|
|
90
|
+
"--yee-ui-header-own-brand-width": h(
|
|
91
|
+
u.value ? l.sidebarCollapsedWidth : l.sidebarWidth
|
|
92
|
+
),
|
|
93
|
+
"--yee-ui-header-own-height": h(l.headerHeight)
|
|
94
|
+
})), y = L(() => u.value ? "展开侧边栏" : "收起侧边栏");
|
|
95
|
+
function B() {
|
|
96
|
+
u.value = !u.value;
|
|
97
|
+
}
|
|
98
|
+
function f() {
|
|
99
|
+
a("refresh");
|
|
100
|
+
}
|
|
101
|
+
function p() {
|
|
102
|
+
const s = m.value === "light" ? "dark" : "light";
|
|
103
|
+
l.themeMode === void 0 && !i && (_.value = s), a("themeChange", s);
|
|
104
|
+
}
|
|
105
|
+
function g() {
|
|
106
|
+
const s = !!document.fullscreenElement;
|
|
107
|
+
s !== d.value && (d.value = s, a("fullscreenChange", s));
|
|
108
|
+
}
|
|
109
|
+
async function O() {
|
|
110
|
+
try {
|
|
111
|
+
if (document.fullscreenElement) {
|
|
112
|
+
typeof document.exitFullscreen == "function" && await document.exitFullscreen();
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const s = document.documentElement;
|
|
116
|
+
typeof s.requestFullscreen == "function" && await s.requestFullscreen();
|
|
117
|
+
} catch {
|
|
118
|
+
g();
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return te(() => {
|
|
122
|
+
document.addEventListener("fullscreenchange", g), g();
|
|
123
|
+
}), ne(() => {
|
|
124
|
+
document.removeEventListener("fullscreenchange", g);
|
|
125
|
+
}), (s, b) => (c(), S("header", {
|
|
126
|
+
class: "yee-ui-header",
|
|
127
|
+
style: ee(k.value)
|
|
128
|
+
}, [
|
|
129
|
+
T("div", {
|
|
130
|
+
class: G(["yee-ui-header__brand", { "yee-ui-header__brand--collapsed": u.value }])
|
|
131
|
+
}, [
|
|
132
|
+
K(s.$slots, "brand", {}, () => [
|
|
133
|
+
T("div", at, [
|
|
134
|
+
T("div", st, [
|
|
135
|
+
K(s.$slots, "logo", {}, () => [
|
|
136
|
+
o.logo ? (c(), S("img", {
|
|
137
|
+
key: 0,
|
|
138
|
+
class: "yee-ui-header__logo",
|
|
139
|
+
alt: o.logoAlt,
|
|
140
|
+
src: o.logo
|
|
141
|
+
}, null, 8, ot)) : (c(), S("span", it))
|
|
142
|
+
], !0)
|
|
143
|
+
]),
|
|
144
|
+
s.$slots.title || o.title ? (c(), S("div", rt, [
|
|
145
|
+
K(s.$slots, "title", {}, () => [
|
|
146
|
+
X(J(o.title), 1)
|
|
147
|
+
], !0)
|
|
148
|
+
])) : $("", !0)
|
|
149
|
+
])
|
|
150
|
+
], !0)
|
|
151
|
+
], 2),
|
|
152
|
+
T("div", dt, [
|
|
153
|
+
o.showSidebarToggle ? (c(), M(r(R), {
|
|
154
|
+
key: 0,
|
|
155
|
+
title: y.value
|
|
156
|
+
}, {
|
|
157
|
+
default: I(() => [
|
|
158
|
+
x(r(N), {
|
|
159
|
+
"aria-label": y.value,
|
|
160
|
+
class: "yee-ui-header__sidebar-toggle",
|
|
161
|
+
type: "text",
|
|
162
|
+
onClick: B
|
|
163
|
+
}, {
|
|
164
|
+
default: I(() => [
|
|
165
|
+
u.value ? (c(), M(r(Ae), { key: 0 })) : (c(), M(r(We), { key: 1 }))
|
|
166
|
+
]),
|
|
167
|
+
_: 1
|
|
168
|
+
}, 8, ["aria-label"])
|
|
169
|
+
]),
|
|
170
|
+
_: 1
|
|
171
|
+
}, 8, ["title"])) : $("", !0),
|
|
172
|
+
s.$slots.content ? (c(), S("div", ct, [
|
|
173
|
+
K(s.$slots, "content", {}, void 0, !0)
|
|
174
|
+
])) : $("", !0)
|
|
175
|
+
]),
|
|
176
|
+
o.showRefresh || o.showThemeToggle || o.showFullscreen || s.$slots.actions ? (c(), S("div", ut, [
|
|
177
|
+
o.showRefresh ? (c(), M(r(R), {
|
|
178
|
+
key: 0,
|
|
179
|
+
title: "刷新"
|
|
180
|
+
}, {
|
|
181
|
+
default: I(() => [
|
|
182
|
+
x(r(N), {
|
|
183
|
+
"aria-label": "刷新",
|
|
184
|
+
class: "yee-ui-header__action",
|
|
185
|
+
type: "text",
|
|
186
|
+
onClick: f
|
|
187
|
+
}, {
|
|
188
|
+
default: I(() => [
|
|
189
|
+
x(r(_e), { "aria-hidden": "true" })
|
|
190
|
+
]),
|
|
191
|
+
_: 1
|
|
192
|
+
})
|
|
193
|
+
]),
|
|
194
|
+
_: 1
|
|
195
|
+
})) : $("", !0),
|
|
196
|
+
o.showThemeToggle ? (c(), M(r(R), {
|
|
197
|
+
key: 1,
|
|
198
|
+
title: m.value === "light" ? "切换暗色主题" : "切换亮色主题"
|
|
199
|
+
}, {
|
|
200
|
+
default: I(() => [
|
|
201
|
+
x(r(N), {
|
|
202
|
+
"aria-label": m.value === "light" ? "切换暗色主题" : "切换亮色主题",
|
|
203
|
+
class: "yee-ui-header__action",
|
|
204
|
+
type: "text",
|
|
205
|
+
onClick: p
|
|
206
|
+
}, {
|
|
207
|
+
default: I(() => [
|
|
208
|
+
m.value === "light" ? (c(), M(r(Ee), {
|
|
209
|
+
key: 0,
|
|
210
|
+
"aria-hidden": "true"
|
|
211
|
+
})) : (c(), M(r(ze), {
|
|
212
|
+
key: 1,
|
|
213
|
+
"aria-hidden": "true"
|
|
214
|
+
}))
|
|
215
|
+
]),
|
|
216
|
+
_: 1
|
|
217
|
+
}, 8, ["aria-label"])
|
|
218
|
+
]),
|
|
219
|
+
_: 1
|
|
220
|
+
}, 8, ["title"])) : $("", !0),
|
|
221
|
+
o.showFullscreen ? (c(), M(r(R), {
|
|
222
|
+
key: 2,
|
|
223
|
+
title: d.value ? "退出全屏" : "进入全屏"
|
|
224
|
+
}, {
|
|
225
|
+
default: I(() => [
|
|
226
|
+
x(r(N), {
|
|
227
|
+
"aria-label": d.value ? "退出全屏" : "进入全屏",
|
|
228
|
+
"aria-pressed": d.value,
|
|
229
|
+
class: "yee-ui-header__action",
|
|
230
|
+
type: "text",
|
|
231
|
+
onClick: O
|
|
232
|
+
}, {
|
|
233
|
+
default: I(() => [
|
|
234
|
+
d.value ? (c(), M(r(Fe), {
|
|
235
|
+
key: 0,
|
|
236
|
+
"aria-hidden": "true"
|
|
237
|
+
})) : (c(), M(r(Pe), {
|
|
238
|
+
key: 1,
|
|
239
|
+
"aria-hidden": "true"
|
|
240
|
+
}))
|
|
241
|
+
]),
|
|
242
|
+
_: 1
|
|
243
|
+
}, 8, ["aria-label", "aria-pressed"])
|
|
244
|
+
]),
|
|
245
|
+
_: 1
|
|
246
|
+
}, 8, ["title"])) : $("", !0),
|
|
247
|
+
K(s.$slots, "actions", {}, void 0, !0)
|
|
248
|
+
])) : $("", !0)
|
|
249
|
+
], 4));
|
|
250
|
+
}
|
|
251
|
+
}), Ft = /* @__PURE__ */ V(ft, [["__scopeId", "data-v-b373a044"]]), ht = /* @__PURE__ */ P({
|
|
252
|
+
name: "YeeMenu",
|
|
253
|
+
__name: "YeeMenu",
|
|
254
|
+
props: {
|
|
255
|
+
items: { default: () => [] },
|
|
256
|
+
selectedKeys: {},
|
|
257
|
+
openKeys: {},
|
|
258
|
+
collapsed: { type: Boolean, default: !1 },
|
|
259
|
+
mode: { default: "inline" },
|
|
260
|
+
inlineIndent: { default: 16 },
|
|
261
|
+
selectable: { type: Boolean, default: !0 },
|
|
262
|
+
multiple: { type: Boolean, default: !1 },
|
|
263
|
+
disabled: { type: Boolean, default: !1 }
|
|
264
|
+
},
|
|
265
|
+
emits: ["click", "select", "openChange"],
|
|
266
|
+
setup(o, { emit: v }) {
|
|
267
|
+
const l = o, a = v, u = ve();
|
|
268
|
+
function i(s, b = 0) {
|
|
269
|
+
return s.map((w) => {
|
|
270
|
+
const A = w.icon ?? (b === 0 ? Ye : void 0);
|
|
271
|
+
return {
|
|
272
|
+
...w.children?.length ? { children: i(w.children, b + 1) } : {},
|
|
273
|
+
...w.disabled !== void 0 ? { disabled: w.disabled } : {},
|
|
274
|
+
...A ? { icon: ge(A) } : {},
|
|
275
|
+
key: w.key,
|
|
276
|
+
label: u.item ? u.item({ item: w }) : w.label
|
|
277
|
+
};
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
const _ = L(() => i(l.items)), m = L(() => l.selectedKeys === void 0 ? void 0 : [...l.selectedKeys]), d = Y([]);
|
|
281
|
+
function h(s, b, w = []) {
|
|
282
|
+
for (const A of s) {
|
|
283
|
+
const W = [...w, A.key];
|
|
284
|
+
if (A.key === b) return W;
|
|
285
|
+
if (A.children?.length) {
|
|
286
|
+
const F = h(A.children, b, W);
|
|
287
|
+
if (F) return F;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
function k(s) {
|
|
292
|
+
const b = s.at(-1);
|
|
293
|
+
if (b === void 0) return [];
|
|
294
|
+
const w = String(b);
|
|
295
|
+
return h(l.items, w) ?? [w];
|
|
296
|
+
}
|
|
297
|
+
function y(s, b) {
|
|
298
|
+
if (b === void 0)
|
|
299
|
+
return [];
|
|
300
|
+
const w = h(s, String(b));
|
|
301
|
+
return w ? w.slice(0, -1) : [];
|
|
302
|
+
}
|
|
303
|
+
le(
|
|
304
|
+
[
|
|
305
|
+
() => l.items,
|
|
306
|
+
() => l.selectedKeys?.at(-1),
|
|
307
|
+
() => l.openKeys === void 0
|
|
308
|
+
],
|
|
309
|
+
([s, b]) => {
|
|
310
|
+
l.openKeys !== void 0 || b === void 0 || (d.value = y(s, b));
|
|
311
|
+
},
|
|
312
|
+
{ immediate: !0 }
|
|
313
|
+
);
|
|
314
|
+
const B = L(() => l.openKeys === void 0 ? d.value : k(l.openKeys)), f = L(() => ({
|
|
315
|
+
disabled: l.disabled,
|
|
316
|
+
inlineCollapsed: l.mode === "inline" && l.collapsed,
|
|
317
|
+
inlineIndent: l.inlineIndent,
|
|
318
|
+
items: _.value,
|
|
319
|
+
mode: l.mode,
|
|
320
|
+
multiple: l.multiple,
|
|
321
|
+
openKeys: B.value,
|
|
322
|
+
selectable: l.selectable,
|
|
323
|
+
...m.value === void 0 ? {} : { selectedKeys: m.value }
|
|
324
|
+
}));
|
|
325
|
+
function p(s) {
|
|
326
|
+
a("select", String(s.key));
|
|
327
|
+
}
|
|
328
|
+
function g(s) {
|
|
329
|
+
a("click", String(s.key));
|
|
330
|
+
}
|
|
331
|
+
function O(s) {
|
|
332
|
+
const b = k(s);
|
|
333
|
+
l.openKeys === void 0 && (d.value = b), a("openChange", b);
|
|
334
|
+
}
|
|
335
|
+
return (s, b) => (c(), M(r(Z), me(f.value, {
|
|
336
|
+
class: "yee-ui-menu",
|
|
337
|
+
onClick: g,
|
|
338
|
+
onOpenChange: O,
|
|
339
|
+
onSelect: p
|
|
340
|
+
}), null, 16));
|
|
341
|
+
}
|
|
342
|
+
}), bt = /* @__PURE__ */ V(ht, [["__scopeId", "data-v-3fbf938f"]]), yt = ["aria-label"], pt = {
|
|
343
|
+
key: 0,
|
|
344
|
+
class: "yee-ui-sidebar__extra"
|
|
345
|
+
}, vt = /* @__PURE__ */ P({
|
|
346
|
+
name: "YeeSidebar",
|
|
347
|
+
__name: "YeeSidebar",
|
|
348
|
+
props: /* @__PURE__ */ E({
|
|
349
|
+
items: { default: () => [] },
|
|
350
|
+
selectedKeys: {},
|
|
351
|
+
openKeys: {},
|
|
352
|
+
width: { default: 224 },
|
|
353
|
+
collapsedWidth: { default: 64 },
|
|
354
|
+
ariaLabel: { default: "应用导航" }
|
|
355
|
+
}, {
|
|
356
|
+
collapsed: { type: Boolean, default: !1 },
|
|
357
|
+
collapsedModifiers: {}
|
|
358
|
+
}),
|
|
359
|
+
emits: /* @__PURE__ */ E(["click", "select", "openChange"], ["update:collapsed"]),
|
|
360
|
+
setup(o, { emit: v }) {
|
|
361
|
+
const l = o, a = H(o, "collapsed"), u = v;
|
|
362
|
+
function i(y) {
|
|
363
|
+
return typeof y == "number" ? `${y}px` : y;
|
|
364
|
+
}
|
|
365
|
+
const _ = L(() => ({
|
|
366
|
+
"--yee-ui-sidebar-own-width": i(
|
|
367
|
+
a.value ? l.collapsedWidth : l.width
|
|
368
|
+
)
|
|
369
|
+
})), m = L(() => ({
|
|
370
|
+
collapsed: a.value,
|
|
371
|
+
items: l.items,
|
|
372
|
+
...l.openKeys === void 0 ? {} : { openKeys: l.openKeys },
|
|
373
|
+
...l.selectedKeys === void 0 ? {} : { selectedKeys: l.selectedKeys }
|
|
374
|
+
}));
|
|
375
|
+
function d(y) {
|
|
376
|
+
u("select", y);
|
|
377
|
+
}
|
|
378
|
+
function h(y) {
|
|
379
|
+
u("click", y);
|
|
380
|
+
}
|
|
381
|
+
function k(y) {
|
|
382
|
+
u("openChange", y);
|
|
383
|
+
}
|
|
384
|
+
return (y, B) => (c(), S("aside", {
|
|
385
|
+
class: G(["yee-ui-sidebar", { "yee-ui-sidebar--collapsed": a.value }]),
|
|
386
|
+
style: ee(_.value)
|
|
387
|
+
}, [
|
|
388
|
+
T("nav", {
|
|
389
|
+
"aria-label": o.ariaLabel,
|
|
390
|
+
class: "yee-ui-sidebar__navigation"
|
|
391
|
+
}, [
|
|
392
|
+
K(y.$slots, "default", {}, () => [
|
|
393
|
+
x(bt, me(m.value, {
|
|
394
|
+
onClick: h,
|
|
395
|
+
onOpenChange: k,
|
|
396
|
+
onSelect: d
|
|
397
|
+
}), null, 16)
|
|
398
|
+
], !0)
|
|
399
|
+
], 8, yt),
|
|
400
|
+
y.$slots.extra ? (c(), S("div", pt, [
|
|
401
|
+
K(y.$slots, "extra", {}, void 0, !0)
|
|
402
|
+
])) : $("", !0)
|
|
403
|
+
], 6));
|
|
404
|
+
}
|
|
405
|
+
}), Pt = /* @__PURE__ */ V(vt, [["__scopeId", "data-v-81c49558"]]);
|
|
406
|
+
function mt(o, v) {
|
|
407
|
+
const l = Y();
|
|
408
|
+
let a;
|
|
409
|
+
function u() {
|
|
410
|
+
l.value?.destroy(), l.value = void 0;
|
|
411
|
+
}
|
|
412
|
+
async function i() {
|
|
413
|
+
await Q(), u();
|
|
414
|
+
const m = o.value;
|
|
415
|
+
!m || !v.enabled() || a?.matches || (l.value = Je.create(m, {
|
|
416
|
+
animation: 150,
|
|
417
|
+
draggable: ".yee-ui-tabs__item",
|
|
418
|
+
filter: (d, h) => v.enabled() ? !!(h.closest(".yee-ui-tabs__item")?.classList.contains("yee-ui-tabs__item--pinned") || h.closest(".yee-ui-tabs__close, .yee-ui-tabs__pin")) : !0,
|
|
419
|
+
onEnd: (d) => {
|
|
420
|
+
d.item.classList.remove("is-dragging");
|
|
421
|
+
const { oldIndex: h, newIndex: k } = d;
|
|
422
|
+
h !== void 0 && k !== void 0 && h !== k && v.onSort(h, k);
|
|
423
|
+
},
|
|
424
|
+
onMove: (d) => {
|
|
425
|
+
const h = d.dragged.closest(".yee-ui-tabs__item"), k = d.related.closest(".yee-ui-tabs__item");
|
|
426
|
+
return !h || !k ? !1 : !h.classList.contains("yee-ui-tabs__item--pinned") && !k.classList.contains("yee-ui-tabs__item--pinned");
|
|
427
|
+
},
|
|
428
|
+
onStart: (d) => {
|
|
429
|
+
d.item.classList.add("is-dragging");
|
|
430
|
+
},
|
|
431
|
+
preventOnFilter: !0
|
|
432
|
+
}));
|
|
433
|
+
}
|
|
434
|
+
function _() {
|
|
435
|
+
i();
|
|
436
|
+
}
|
|
437
|
+
te(() => {
|
|
438
|
+
typeof window < "u" && typeof window.matchMedia == "function" && (a = window.matchMedia("(max-width: 768px)"), a.addEventListener("change", _)), i();
|
|
439
|
+
}), le(v.enabled, () => {
|
|
440
|
+
i();
|
|
441
|
+
}), ne(() => {
|
|
442
|
+
a?.removeEventListener("change", _), a = void 0, u();
|
|
443
|
+
});
|
|
444
|
+
}
|
|
445
|
+
function gt(o, v) {
|
|
446
|
+
const l = Y(!1), a = Y(!1), u = Y(!1);
|
|
447
|
+
let i, _;
|
|
448
|
+
function m() {
|
|
449
|
+
const f = o.value;
|
|
450
|
+
if (!f) return;
|
|
451
|
+
const p = Math.max(0, f.scrollWidth - f.clientWidth);
|
|
452
|
+
u.value = p > 0, l.value = f.scrollLeft > 0, a.value = f.scrollLeft < p - 1;
|
|
453
|
+
}
|
|
454
|
+
function d(f) {
|
|
455
|
+
const p = o.value;
|
|
456
|
+
if (!p) return;
|
|
457
|
+
const g = Math.max(p.clientWidth - 150, 150);
|
|
458
|
+
typeof p.scrollBy == "function" ? p.scrollBy({ behavior: "smooth", left: f * g }) : p.scrollLeft += f * g;
|
|
459
|
+
}
|
|
460
|
+
async function h() {
|
|
461
|
+
await Q();
|
|
462
|
+
const p = o.value?.querySelector(".is-active");
|
|
463
|
+
!p || typeof p.scrollIntoView != "function" || p.scrollIntoView({
|
|
464
|
+
behavior: "smooth",
|
|
465
|
+
block: "nearest",
|
|
466
|
+
inline: "start"
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
function k(f) {
|
|
470
|
+
if (!v.wheelable()) return;
|
|
471
|
+
const p = f.deltaY || f.deltaX, g = o.value;
|
|
472
|
+
!g || !p || (f.preventDefault(), f.stopPropagation(), typeof g.scrollBy == "function" ? g.scrollBy({ left: p * 3, behavior: "auto" }) : g.scrollLeft += p * 3);
|
|
473
|
+
}
|
|
474
|
+
function y() {
|
|
475
|
+
const f = o.value;
|
|
476
|
+
f && (i?.disconnect(), _?.disconnect(), i = void 0, _ = void 0, typeof ResizeObserver < "u" && (i = new ResizeObserver(() => {
|
|
477
|
+
m(), h();
|
|
478
|
+
}), i.observe(f)), typeof MutationObserver < "u" && (_ = new MutationObserver(() => {
|
|
479
|
+
m(), h();
|
|
480
|
+
}), _.observe(f, { childList: !0, subtree: !0 })), m());
|
|
481
|
+
}
|
|
482
|
+
function B() {
|
|
483
|
+
m();
|
|
484
|
+
}
|
|
485
|
+
return te(() => {
|
|
486
|
+
const f = o.value;
|
|
487
|
+
f && (f.addEventListener("scroll", B, { passive: !0 }), y(), h());
|
|
488
|
+
}), ne(() => {
|
|
489
|
+
o.value?.removeEventListener("scroll", B), i?.disconnect(), _?.disconnect(), i = void 0, _ = void 0;
|
|
490
|
+
}), le(
|
|
491
|
+
[v.activeKey, v.itemsVersion],
|
|
492
|
+
() => {
|
|
493
|
+
Q(() => {
|
|
494
|
+
m(), h();
|
|
495
|
+
});
|
|
496
|
+
},
|
|
497
|
+
{ flush: "post" }
|
|
498
|
+
), {
|
|
499
|
+
canScrollLeft: l,
|
|
500
|
+
canScrollRight: a,
|
|
501
|
+
handleWheel: k,
|
|
502
|
+
scrollTabs: d,
|
|
503
|
+
showScrollButtons: u
|
|
504
|
+
};
|
|
505
|
+
}
|
|
506
|
+
const _t = { class: "yee-ui-tabs" }, kt = { class: "yee-ui-tabs__navigation" }, wt = ["aria-disabled", "disabled"], Ct = ["data-pinned", "data-tab-key", "onMousedown"], St = ["aria-selected", "aria-disabled", "tabindex", "onClick", "onKeydown"], Tt = { class: "yee-ui-tabs__label" }, Mt = ["aria-label", "disabled", "onClick"], $t = ["aria-label", "onClick"], xt = ["aria-disabled", "disabled"], Lt = {
|
|
507
|
+
"aria-label": "标签页操作",
|
|
508
|
+
class: "yee-ui-tabs__actions",
|
|
509
|
+
type: "button"
|
|
510
|
+
}, It = /* @__PURE__ */ P({
|
|
511
|
+
name: "YeeTabs",
|
|
512
|
+
__name: "YeeTabs",
|
|
513
|
+
props: /* @__PURE__ */ E({
|
|
514
|
+
items: { default: () => [] },
|
|
515
|
+
activeKey: {},
|
|
516
|
+
closable: { type: Boolean, default: !0 },
|
|
517
|
+
draggable: { type: Boolean, default: !0 },
|
|
518
|
+
middleClickToClose: { type: Boolean, default: !1 },
|
|
519
|
+
showClose: { type: Boolean, default: !0 },
|
|
520
|
+
showIcon: { type: Boolean, default: !0 },
|
|
521
|
+
showActions: { type: Boolean, default: !0 },
|
|
522
|
+
wheelable: { type: Boolean, default: !0 },
|
|
523
|
+
contextMenus: {}
|
|
524
|
+
}, {
|
|
525
|
+
activeKey: {
|
|
526
|
+
default: void 0
|
|
527
|
+
},
|
|
528
|
+
activeKeyModifiers: {}
|
|
529
|
+
}),
|
|
530
|
+
emits: /* @__PURE__ */ E(["change", "close", "closeAll", "closeLeft", "closeOthers", "closeRight", "openInNewWindow", "pin", "refresh", "sortTabs"], ["update:activeKey"]),
|
|
531
|
+
setup(o, { expose: v, emit: l }) {
|
|
532
|
+
const a = o, u = H(o, "activeKey"), i = l, _ = ve(), m = Ke("tabsList"), d = L(() => {
|
|
533
|
+
const e = [], t = [];
|
|
534
|
+
for (const n of a.items)
|
|
535
|
+
n.pinned === !0 ? e.push(n) : t.push(n);
|
|
536
|
+
return [...e, ...t];
|
|
537
|
+
}), h = L(() => d.value.map((e) => `${e.key}:${e.label}:${e.pinned ? "pinned" : "normal"}`).join("|")), {
|
|
538
|
+
canScrollLeft: k,
|
|
539
|
+
canScrollRight: y,
|
|
540
|
+
handleWheel: B,
|
|
541
|
+
scrollTabs: f,
|
|
542
|
+
showScrollButtons: p
|
|
543
|
+
} = gt(m, {
|
|
544
|
+
activeKey: u,
|
|
545
|
+
itemsVersion: () => h.value,
|
|
546
|
+
wheelable: () => a.wheelable
|
|
547
|
+
});
|
|
548
|
+
mt(m, {
|
|
549
|
+
enabled: () => a.draggable,
|
|
550
|
+
onSort: (e, t) => {
|
|
551
|
+
const n = d.value[e], C = d.value[t];
|
|
552
|
+
if (!n || !C)
|
|
553
|
+
return;
|
|
554
|
+
const z = a.items.findIndex((j) => j.key === n.key), fe = a.items.findIndex((j) => j.key === C.key);
|
|
555
|
+
z < 0 || fe < 0 || i("sortTabs", z, fe);
|
|
556
|
+
}
|
|
557
|
+
});
|
|
558
|
+
function g(e) {
|
|
559
|
+
return a.items.find((t) => t.key === e);
|
|
560
|
+
}
|
|
561
|
+
function O(e) {
|
|
562
|
+
return g(e ?? u.value ?? "");
|
|
563
|
+
}
|
|
564
|
+
function s(e) {
|
|
565
|
+
return d.value.findIndex((t) => t.key === e.key);
|
|
566
|
+
}
|
|
567
|
+
function b(e) {
|
|
568
|
+
return e.closable ?? a.closable;
|
|
569
|
+
}
|
|
570
|
+
function w(e) {
|
|
571
|
+
return a.showClose && a.items.length > 1 && !e.pinned && b(e);
|
|
572
|
+
}
|
|
573
|
+
function A(e) {
|
|
574
|
+
return a.items.length > 1 && e.pinned === !0 && b(e);
|
|
575
|
+
}
|
|
576
|
+
const W = L(() => O());
|
|
577
|
+
function F(e) {
|
|
578
|
+
return {
|
|
579
|
+
active: u.value === e.key,
|
|
580
|
+
index: s(e),
|
|
581
|
+
tabCount: a.items.length
|
|
582
|
+
};
|
|
583
|
+
}
|
|
584
|
+
function ke(e) {
|
|
585
|
+
const { active: t, index: n, tabCount: C } = F(e), z = C <= 1;
|
|
586
|
+
return [
|
|
587
|
+
{
|
|
588
|
+
action: "close",
|
|
589
|
+
disabled: z || e.pinned === !0 || !b(e),
|
|
590
|
+
icon: ye,
|
|
591
|
+
label: "关闭"
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
action: "pin",
|
|
595
|
+
icon: e.pinned ? Ne : pe,
|
|
596
|
+
label: e.pinned ? "取消固定" : "固定"
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
action: "refresh",
|
|
600
|
+
disabled: !t,
|
|
601
|
+
icon: _e,
|
|
602
|
+
label: "重新加载"
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
action: "open-new-window",
|
|
606
|
+
icon: He,
|
|
607
|
+
label: "在新窗口打开",
|
|
608
|
+
separator: !0
|
|
609
|
+
},
|
|
610
|
+
{
|
|
611
|
+
action: "close-left",
|
|
612
|
+
disabled: !t || n <= 0,
|
|
613
|
+
icon: Ge,
|
|
614
|
+
label: "关闭左侧标签页"
|
|
615
|
+
},
|
|
616
|
+
{
|
|
617
|
+
action: "close-right",
|
|
618
|
+
disabled: !t || n >= C - 1,
|
|
619
|
+
icon: qe,
|
|
620
|
+
label: "关闭右侧标签页",
|
|
621
|
+
separator: !0
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
action: "close-others",
|
|
625
|
+
disabled: !t || z,
|
|
626
|
+
icon: Ue,
|
|
627
|
+
label: "关闭其它标签页"
|
|
628
|
+
},
|
|
629
|
+
{
|
|
630
|
+
action: "close-all",
|
|
631
|
+
disabled: z,
|
|
632
|
+
icon: je,
|
|
633
|
+
label: "关闭全部标签页"
|
|
634
|
+
}
|
|
635
|
+
];
|
|
636
|
+
}
|
|
637
|
+
function we(e) {
|
|
638
|
+
return a.contextMenus?.(e, F(e)) ?? ke(e);
|
|
639
|
+
}
|
|
640
|
+
function ae(e) {
|
|
641
|
+
const t = [];
|
|
642
|
+
for (const n of we(e)) {
|
|
643
|
+
if (n.hidden) continue;
|
|
644
|
+
const C = n.icon ? {
|
|
645
|
+
disabled: n.disabled,
|
|
646
|
+
icon: ge(n.icon),
|
|
647
|
+
key: n.action,
|
|
648
|
+
label: n.label
|
|
649
|
+
} : {
|
|
650
|
+
disabled: n.disabled,
|
|
651
|
+
key: n.action,
|
|
652
|
+
label: n.label
|
|
653
|
+
};
|
|
654
|
+
t.push(C), n.separator && t.push({ type: "divider" });
|
|
655
|
+
}
|
|
656
|
+
return t;
|
|
657
|
+
}
|
|
658
|
+
function q(e) {
|
|
659
|
+
const t = g(e);
|
|
660
|
+
return !t || t.disabled ? !1 : (u.value = t.key, i("change", t.key), !0);
|
|
661
|
+
}
|
|
662
|
+
function D(e) {
|
|
663
|
+
const t = g(e);
|
|
664
|
+
return !t || t.disabled || t.pinned || !b(t) ? !1 : (i("close", t.key), !0);
|
|
665
|
+
}
|
|
666
|
+
function se(e) {
|
|
667
|
+
const t = O(e);
|
|
668
|
+
return t ? (i("closeLeft", t.key), !0) : !1;
|
|
669
|
+
}
|
|
670
|
+
function oe(e) {
|
|
671
|
+
const t = O(e);
|
|
672
|
+
return t ? (i("closeRight", t.key), !0) : !1;
|
|
673
|
+
}
|
|
674
|
+
function ie(e) {
|
|
675
|
+
const t = O(e);
|
|
676
|
+
return t ? (i("closeOthers", t.key), !0) : !1;
|
|
677
|
+
}
|
|
678
|
+
function re() {
|
|
679
|
+
return a.items.length ? (i("closeAll"), !0) : !1;
|
|
680
|
+
}
|
|
681
|
+
function Ce() {
|
|
682
|
+
return [...d.value];
|
|
683
|
+
}
|
|
684
|
+
function U(e, t) {
|
|
685
|
+
const n = g(e);
|
|
686
|
+
return !n || n.disabled ? !1 : (i("pin", {
|
|
687
|
+
key: n.key,
|
|
688
|
+
pinned: t ?? !n.pinned
|
|
689
|
+
}), !0);
|
|
690
|
+
}
|
|
691
|
+
function de(e) {
|
|
692
|
+
const t = O(e);
|
|
693
|
+
return !t || t.disabled ? !1 : (i("refresh", t.key), !0);
|
|
694
|
+
}
|
|
695
|
+
function ce(e) {
|
|
696
|
+
const t = O(e);
|
|
697
|
+
return !t || t.disabled ? !1 : (i("openInNewWindow", t.key), !0);
|
|
698
|
+
}
|
|
699
|
+
function Se(e, t) {
|
|
700
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), q(e.key));
|
|
701
|
+
}
|
|
702
|
+
function Te(e, t) {
|
|
703
|
+
t.button === 1 && a.middleClickToClose && a.items.length > 1 && !e.pinned && b(e) && (t.preventDefault(), t.stopPropagation(), D(e.key));
|
|
704
|
+
}
|
|
705
|
+
function Me(e, t) {
|
|
706
|
+
t.stopPropagation(), D(e.key);
|
|
707
|
+
}
|
|
708
|
+
function $e(e, t) {
|
|
709
|
+
t.stopPropagation(), U(e.key);
|
|
710
|
+
}
|
|
711
|
+
function ue(e, t) {
|
|
712
|
+
switch (t) {
|
|
713
|
+
case "close":
|
|
714
|
+
D(e.key);
|
|
715
|
+
break;
|
|
716
|
+
case "pin":
|
|
717
|
+
U(e.key);
|
|
718
|
+
break;
|
|
719
|
+
case "refresh":
|
|
720
|
+
de(e.key);
|
|
721
|
+
break;
|
|
722
|
+
case "open-new-window":
|
|
723
|
+
ce(e.key);
|
|
724
|
+
break;
|
|
725
|
+
case "close-left":
|
|
726
|
+
se(e.key);
|
|
727
|
+
break;
|
|
728
|
+
case "close-right":
|
|
729
|
+
oe(e.key);
|
|
730
|
+
break;
|
|
731
|
+
case "close-others":
|
|
732
|
+
ie(e.key);
|
|
733
|
+
break;
|
|
734
|
+
case "close-all":
|
|
735
|
+
re();
|
|
736
|
+
break;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
function xe(e, t) {
|
|
740
|
+
ue(e, String(t.key));
|
|
741
|
+
}
|
|
742
|
+
function Le(e) {
|
|
743
|
+
const t = W.value;
|
|
744
|
+
t && ue(t, String(e.key));
|
|
745
|
+
}
|
|
746
|
+
return v({
|
|
747
|
+
activateTab: q,
|
|
748
|
+
closeAllTabs: re,
|
|
749
|
+
closeLeftTabs: se,
|
|
750
|
+
closeOtherTabs: ie,
|
|
751
|
+
closeRightTabs: oe,
|
|
752
|
+
closeTab: D,
|
|
753
|
+
getTab: g,
|
|
754
|
+
getTabs: Ce,
|
|
755
|
+
openTabInNewWindow: ce,
|
|
756
|
+
pinTab: U,
|
|
757
|
+
refreshTab: de
|
|
758
|
+
}), (e, t) => (c(), S("div", _t, [
|
|
759
|
+
T("div", kt, [
|
|
760
|
+
r(p) ? (c(), S("button", {
|
|
761
|
+
key: 0,
|
|
762
|
+
"aria-disabled": !r(k),
|
|
763
|
+
"aria-label": "向左滚动标签",
|
|
764
|
+
class: "yee-ui-tabs__scroll-button yee-ui-tabs__scroll-button--left",
|
|
765
|
+
disabled: !r(k),
|
|
766
|
+
type: "button",
|
|
767
|
+
onClick: t[0] || (t[0] = (n) => r(f)(-1))
|
|
768
|
+
}, [
|
|
769
|
+
x(r(Ve), { "aria-hidden": "true" })
|
|
770
|
+
], 8, wt)) : $("", !0),
|
|
771
|
+
T("div", {
|
|
772
|
+
ref: "tabsList",
|
|
773
|
+
"aria-label": "页面标签",
|
|
774
|
+
class: "yee-ui-tabs__list",
|
|
775
|
+
role: "tablist",
|
|
776
|
+
onWheel: t[1] || (t[1] = //@ts-ignore
|
|
777
|
+
(...n) => r(B) && r(B)(...n))
|
|
778
|
+
}, [
|
|
779
|
+
(c(!0), S(he, null, Be(d.value, (n) => (c(), M(r(be), {
|
|
780
|
+
key: n.key,
|
|
781
|
+
"overlay-class-name": "yee-ui-tabs__context-menu",
|
|
782
|
+
trigger: ["contextmenu"]
|
|
783
|
+
}, {
|
|
784
|
+
overlay: I(() => [
|
|
785
|
+
x(r(Z), {
|
|
786
|
+
items: ae(n),
|
|
787
|
+
onClick: (C) => xe(n, C)
|
|
788
|
+
}, null, 8, ["items", "onClick"])
|
|
789
|
+
]),
|
|
790
|
+
default: I(() => [
|
|
791
|
+
T("div", {
|
|
792
|
+
"data-pinned": n.pinned ? "true" : "false",
|
|
793
|
+
"data-tab-key": n.key,
|
|
794
|
+
class: G(["yee-ui-tabs__item", {
|
|
795
|
+
"is-active": u.value === n.key,
|
|
796
|
+
"yee-ui-tabs__item--disabled": n.disabled,
|
|
797
|
+
"yee-ui-tabs__item--pinned": n.pinned
|
|
798
|
+
}]),
|
|
799
|
+
onMousedown: (C) => Te(n, C)
|
|
800
|
+
}, [
|
|
801
|
+
T("div", {
|
|
802
|
+
"aria-selected": u.value === n.key,
|
|
803
|
+
"aria-disabled": n.disabled || void 0,
|
|
804
|
+
class: "yee-ui-tabs__tab",
|
|
805
|
+
role: "tab",
|
|
806
|
+
tabindex: n.disabled ? -1 : 0,
|
|
807
|
+
onClick: (C) => q(n.key),
|
|
808
|
+
onKeydown: (C) => Se(n, C)
|
|
809
|
+
}, [
|
|
810
|
+
o.showIcon && n.icon ? (c(), M(Oe(n.icon), {
|
|
811
|
+
key: 0,
|
|
812
|
+
class: "yee-ui-tabs__icon"
|
|
813
|
+
})) : $("", !0),
|
|
814
|
+
T("span", Tt, [
|
|
815
|
+
_.tab ? K(e.$slots, "tab", {
|
|
816
|
+
key: 0,
|
|
817
|
+
active: u.value === n.key,
|
|
818
|
+
item: n
|
|
819
|
+
}, () => [
|
|
820
|
+
X(J(n.label), 1)
|
|
821
|
+
], !0) : (c(), S(he, { key: 1 }, [
|
|
822
|
+
X(J(n.label), 1)
|
|
823
|
+
], 64))
|
|
824
|
+
])
|
|
825
|
+
], 40, St),
|
|
826
|
+
w(n) ? (c(), S("button", {
|
|
827
|
+
key: 0,
|
|
828
|
+
"aria-label": `关闭${n.label}`,
|
|
829
|
+
class: "yee-ui-tabs__close",
|
|
830
|
+
disabled: n.disabled,
|
|
831
|
+
type: "button",
|
|
832
|
+
onClick: (C) => Me(n, C)
|
|
833
|
+
}, [
|
|
834
|
+
x(r(ye), { "aria-hidden": "true" })
|
|
835
|
+
], 8, Mt)) : $("", !0),
|
|
836
|
+
A(n) ? (c(), S("button", {
|
|
837
|
+
key: 1,
|
|
838
|
+
"aria-label": `取消固定${n.label}`,
|
|
839
|
+
class: "yee-ui-tabs__pin",
|
|
840
|
+
type: "button",
|
|
841
|
+
onClick: (C) => $e(n, C)
|
|
842
|
+
}, [
|
|
843
|
+
x(r(pe), { "aria-hidden": "true" })
|
|
844
|
+
], 8, $t)) : $("", !0)
|
|
845
|
+
], 42, Ct)
|
|
846
|
+
]),
|
|
847
|
+
_: 2
|
|
848
|
+
}, 1024))), 128))
|
|
849
|
+
], 544),
|
|
850
|
+
r(p) ? (c(), S("button", {
|
|
851
|
+
key: 1,
|
|
852
|
+
"aria-disabled": !r(y),
|
|
853
|
+
"aria-label": "向右滚动标签",
|
|
854
|
+
class: "yee-ui-tabs__scroll-button yee-ui-tabs__scroll-button--right",
|
|
855
|
+
disabled: !r(y),
|
|
856
|
+
type: "button",
|
|
857
|
+
onClick: t[2] || (t[2] = (n) => r(f)(1))
|
|
858
|
+
}, [
|
|
859
|
+
x(r(De), { "aria-hidden": "true" })
|
|
860
|
+
], 8, xt)) : $("", !0)
|
|
861
|
+
]),
|
|
862
|
+
o.showActions ? (c(), M(r(be), {
|
|
863
|
+
key: 0,
|
|
864
|
+
disabled: !W.value,
|
|
865
|
+
"overlay-class-name": "yee-ui-tabs__dropdown",
|
|
866
|
+
placement: "bottomRight",
|
|
867
|
+
trigger: ["click"]
|
|
868
|
+
}, {
|
|
869
|
+
overlay: I(() => [
|
|
870
|
+
x(r(Z), {
|
|
871
|
+
items: W.value ? ae(W.value) : [],
|
|
872
|
+
onClick: Le
|
|
873
|
+
}, null, 8, ["items"])
|
|
874
|
+
]),
|
|
875
|
+
default: I(() => [
|
|
876
|
+
T("button", Lt, [
|
|
877
|
+
x(r(Re), { "aria-hidden": "true" })
|
|
878
|
+
])
|
|
879
|
+
]),
|
|
880
|
+
_: 1
|
|
881
|
+
}, 8, ["disabled"])) : $("", !0)
|
|
882
|
+
]));
|
|
883
|
+
}
|
|
884
|
+
}), Vt = /* @__PURE__ */ V(It, [["__scopeId", "data-v-af23f0b8"]]);
|
|
885
|
+
export {
|
|
886
|
+
zt as Y,
|
|
887
|
+
Ft as a,
|
|
888
|
+
bt as b,
|
|
889
|
+
Pt as c,
|
|
890
|
+
Vt as d
|
|
891
|
+
};
|