@yeepay/yee-boss-ui 0.1.16 → 0.1.17
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-CUkH4SGb.js +463 -0
- package/package.json +50 -13
- 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,463 @@
|
|
|
1
|
+
import { shallowRef as S, defineComponent as D, reactive as ne, useTemplateRef as U, computed as d, onMounted as Q, onBeforeUnmount as K, openBlock as w, createBlock as L, unref as A, mergeProps as J, withCtx as v, createElementVNode as P, normalizeStyle as ae, renderSlot as V, createTextVNode as X, toDisplayString as Z, nextTick as $, useSlots as le, inject as W, watch as se, onUnmounted as ue, createElementBlock as B, normalizeClass as ce, withDirectives as me, vShow as de, createCommentVNode as E, createVNode as M, toHandlers as pe, createSlots as fe, normalizeProps as F, guardReactiveProps as I, renderList as ge, h as ve } from "vue";
|
|
2
|
+
import { Tooltip as ee, Modal as he, Select as be } from "ant-design-vue";
|
|
3
|
+
import te from "vxe-table/es/grid";
|
|
4
|
+
import _ from "vxe-table/es/ui";
|
|
5
|
+
import { p as ye } from "./context-DJQ4f46a.js";
|
|
6
|
+
import { a as xe, Y as Te } from "./form-api-DbIL_dvg.js";
|
|
7
|
+
import { p as Ce } from "./context-C5gszWl6.js";
|
|
8
|
+
import we from "vxe-pc-ui/es/button";
|
|
9
|
+
import Ve from "vxe-pc-ui/es/checkbox";
|
|
10
|
+
import Se from "vxe-pc-ui/es/icon";
|
|
11
|
+
import He from "vxe-pc-ui/es/input";
|
|
12
|
+
import ze from "vxe-pc-ui/es/loading";
|
|
13
|
+
import Ae from "vxe-pc-ui/es/modal";
|
|
14
|
+
import Pe from "vxe-pc-ui/es/number-input";
|
|
15
|
+
import _e from "vxe-pc-ui/es/pager";
|
|
16
|
+
import Ne from "vxe-pc-ui/es/radio-group";
|
|
17
|
+
import Ee from "vxe-pc-ui/es/select";
|
|
18
|
+
import ke from "vxe-table/es/colgroup";
|
|
19
|
+
import Ge from "vxe-table/es/column";
|
|
20
|
+
import Oe from "vxe-table/es/table";
|
|
21
|
+
import Re from "vxe-table/es/toolbar";
|
|
22
|
+
import { _ as Ye } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
23
|
+
class $e {
|
|
24
|
+
/** 查询表单控制器。 */
|
|
25
|
+
formApi = new xe();
|
|
26
|
+
/** 查询表单当前是否可见。 */
|
|
27
|
+
searchFormVisible;
|
|
28
|
+
/** 当前 Grid 初始化配置。 */
|
|
29
|
+
state;
|
|
30
|
+
grid;
|
|
31
|
+
constructor(e) {
|
|
32
|
+
this.state = S(e), this.searchFormVisible = S(e.showSearchForm ?? !0);
|
|
33
|
+
}
|
|
34
|
+
/** @internal 由 YeeGrid 挂载底层 VXE Grid 实例。 */
|
|
35
|
+
mount(e) {
|
|
36
|
+
this.grid = e;
|
|
37
|
+
}
|
|
38
|
+
/** 保留当前页码并执行查询,可在查询前合并表单值。 */
|
|
39
|
+
query = async (e) => (e && this.formApi.setValues(e), this.grid?.commitProxy("query"));
|
|
40
|
+
/** 回到第一页并重新查询,可在查询前合并表单值。 */
|
|
41
|
+
reload = async (e) => (e && this.formApi.setValues(e), this.grid?.commitProxy("reload"));
|
|
42
|
+
/** 合并更新 VXE Grid 配置。 */
|
|
43
|
+
setGridOptions(e) {
|
|
44
|
+
this.setState({
|
|
45
|
+
gridOptions: {
|
|
46
|
+
...this.state.value.gridOptions,
|
|
47
|
+
...e
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/** 设置表格加载状态。 */
|
|
52
|
+
setLoading(e) {
|
|
53
|
+
this.setGridOptions({ loading: e });
|
|
54
|
+
}
|
|
55
|
+
/** 合并更新 useYeeGrid 初始化配置。 */
|
|
56
|
+
setState(e) {
|
|
57
|
+
this.state.value = {
|
|
58
|
+
...this.state.value,
|
|
59
|
+
...e
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
/** 切换查询表单显隐,并返回切换后的状态。 */
|
|
63
|
+
toggleSearchForm(e) {
|
|
64
|
+
return this.searchFormVisible.value = e ?? !this.searchFormVisible.value, this.searchFormVisible.value;
|
|
65
|
+
}
|
|
66
|
+
/** @internal 清理底层 VXE Grid 实例引用。 */
|
|
67
|
+
unmount() {
|
|
68
|
+
this.grid = void 0;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const Be = /* @__PURE__ */ D({
|
|
72
|
+
inheritAttrs: !1,
|
|
73
|
+
name: "VxeTooltip",
|
|
74
|
+
__name: "YeeGridTooltip",
|
|
75
|
+
props: {
|
|
76
|
+
content: {},
|
|
77
|
+
enterDelay: {},
|
|
78
|
+
enterable: { type: Boolean },
|
|
79
|
+
height: {},
|
|
80
|
+
isArrow: { type: Boolean, default: !0 },
|
|
81
|
+
leaveDelay: {},
|
|
82
|
+
maxHeight: {},
|
|
83
|
+
maxWidth: {},
|
|
84
|
+
minHeight: {},
|
|
85
|
+
minWidth: {},
|
|
86
|
+
modelValue: { type: Boolean },
|
|
87
|
+
popupClassName: {},
|
|
88
|
+
selector: {},
|
|
89
|
+
theme: {},
|
|
90
|
+
trigger: {},
|
|
91
|
+
useHTML: { type: Boolean },
|
|
92
|
+
width: {},
|
|
93
|
+
zIndex: {}
|
|
94
|
+
},
|
|
95
|
+
emits: ["update:modelValue"],
|
|
96
|
+
setup(n, { expose: e, emit: l }) {
|
|
97
|
+
const t = n, a = l, T = ee, s = ne({ visible: !1 }), C = U("tooltip"), h = S(), b = S(""), y = S(), x = S(!1);
|
|
98
|
+
let p;
|
|
99
|
+
function f(o) {
|
|
100
|
+
if (!(o === void 0 || o === ""))
|
|
101
|
+
return typeof o == "number" ? `${o}px` : o;
|
|
102
|
+
}
|
|
103
|
+
const k = d(() => {
|
|
104
|
+
const o = h.value;
|
|
105
|
+
return !o || !s.visible ? { display: "none" } : {
|
|
106
|
+
height: `${Math.max(o.height, 1)}px`,
|
|
107
|
+
left: `${o.left}px`,
|
|
108
|
+
pointerEvents: "none",
|
|
109
|
+
position: "fixed",
|
|
110
|
+
top: `${o.top}px`,
|
|
111
|
+
width: `${Math.max(o.width, 1)}px`
|
|
112
|
+
};
|
|
113
|
+
}), G = d(() => ({
|
|
114
|
+
cursor: t.enterable ? "text" : void 0,
|
|
115
|
+
height: f(t.height),
|
|
116
|
+
maxHeight: f(t.maxHeight),
|
|
117
|
+
maxWidth: f(t.maxWidth),
|
|
118
|
+
minHeight: f(t.minHeight),
|
|
119
|
+
minWidth: f(t.minWidth),
|
|
120
|
+
userSelect: t.enterable ? "text" : void 0,
|
|
121
|
+
width: f(t.width)
|
|
122
|
+
})), O = d(() => ({
|
|
123
|
+
...t.popupClassName ? { overlayClassName: t.popupClassName } : {},
|
|
124
|
+
...t.zIndex === void 0 ? {} : { zIndex: Number(t.zIndex) }
|
|
125
|
+
}));
|
|
126
|
+
function R(o) {
|
|
127
|
+
return o.closest("body") ?? document.body;
|
|
128
|
+
}
|
|
129
|
+
function Y(o) {
|
|
130
|
+
return o || (typeof t.selector == "string" ? document.querySelector(t.selector) ?? void 0 : t.selector);
|
|
131
|
+
}
|
|
132
|
+
function i() {
|
|
133
|
+
const o = y.value;
|
|
134
|
+
if (!o?.isConnected)
|
|
135
|
+
return m();
|
|
136
|
+
const c = o.getBoundingClientRect();
|
|
137
|
+
return h.value = {
|
|
138
|
+
height: c.height,
|
|
139
|
+
left: c.left,
|
|
140
|
+
top: c.top,
|
|
141
|
+
width: c.width
|
|
142
|
+
}, $(() => C.value?.forcePopupAlign?.());
|
|
143
|
+
}
|
|
144
|
+
function r(o, c) {
|
|
145
|
+
const z = Y(o);
|
|
146
|
+
return z ? (y.value = z, b.value = c ?? t.content ?? "", x.value = !0, s.visible = !0, a("update:modelValue", !0), i()) : $();
|
|
147
|
+
}
|
|
148
|
+
function u(o, c, z) {
|
|
149
|
+
const re = o.currentTarget instanceof HTMLElement ? o.currentTarget : void 0;
|
|
150
|
+
return r(c ?? re, z);
|
|
151
|
+
}
|
|
152
|
+
function m() {
|
|
153
|
+
return x.value = !1, y.value = void 0, h.value = void 0, s.visible = !1, a("update:modelValue", !1), $();
|
|
154
|
+
}
|
|
155
|
+
function g(o) {
|
|
156
|
+
o && p && (clearTimeout(p), p = void 0), x.value = o;
|
|
157
|
+
}
|
|
158
|
+
function H() {
|
|
159
|
+
return x.value;
|
|
160
|
+
}
|
|
161
|
+
function N() {
|
|
162
|
+
s.visible && i();
|
|
163
|
+
}
|
|
164
|
+
function ie() {
|
|
165
|
+
g(!1), t.enterable && (p = setTimeout(() => {
|
|
166
|
+
p = void 0, x.value || m();
|
|
167
|
+
}, t.leaveDelay ?? 0));
|
|
168
|
+
}
|
|
169
|
+
return Q(() => {
|
|
170
|
+
window.addEventListener("resize", N), window.addEventListener("scroll", N, !0), t.modelValue && r(void 0, t.content);
|
|
171
|
+
}), K(() => {
|
|
172
|
+
p && clearTimeout(p), window.removeEventListener("resize", N), window.removeEventListener("scroll", N, !0);
|
|
173
|
+
}), e({
|
|
174
|
+
close: m,
|
|
175
|
+
isActived: H,
|
|
176
|
+
open: r,
|
|
177
|
+
openByEvent: u,
|
|
178
|
+
reactData: s,
|
|
179
|
+
setActived: g,
|
|
180
|
+
toVisible: r,
|
|
181
|
+
updatePlacement: i
|
|
182
|
+
}), (o, c) => (w(), L(A(T), J({ ref: "tooltip" }, O.value, {
|
|
183
|
+
arrow: t.isArrow !== !1,
|
|
184
|
+
"get-popup-container": R,
|
|
185
|
+
open: s.visible,
|
|
186
|
+
"overlay-inner-style": G.value,
|
|
187
|
+
placement: "top"
|
|
188
|
+
}), {
|
|
189
|
+
title: v(() => [
|
|
190
|
+
P("div", {
|
|
191
|
+
class: "yee-ui-grid-tooltip-content",
|
|
192
|
+
onMouseenter: c[0] || (c[0] = (z) => t.enterable && g(!0)),
|
|
193
|
+
onMouseleave: ie
|
|
194
|
+
}, [
|
|
195
|
+
V(o.$slots, "content", {}, () => [
|
|
196
|
+
X(Z(b.value), 1)
|
|
197
|
+
])
|
|
198
|
+
], 32)
|
|
199
|
+
]),
|
|
200
|
+
default: v(() => [
|
|
201
|
+
P("span", {
|
|
202
|
+
"aria-hidden": "true",
|
|
203
|
+
class: "yee-ui-grid-tooltip-anchor",
|
|
204
|
+
style: ae(k.value)
|
|
205
|
+
}, null, 4)
|
|
206
|
+
]),
|
|
207
|
+
_: 3
|
|
208
|
+
}, 16, ["arrow", "open", "overlay-inner-style"]));
|
|
209
|
+
}
|
|
210
|
+
});
|
|
211
|
+
let q = !1;
|
|
212
|
+
const j = /* @__PURE__ */ new Set();
|
|
213
|
+
function Me() {
|
|
214
|
+
const n = _.modal.confirm.bind(_.modal);
|
|
215
|
+
_.modal.confirm = ((e, l, t) => {
|
|
216
|
+
const a = typeof e == "object" && e !== null ? e : typeof t == "object" && t !== null ? t : void 0;
|
|
217
|
+
if ((typeof a?.className == "string" ? a.className.split(/\s+/) : []).includes("vxe-table--ignore-clear")) {
|
|
218
|
+
const s = [...j], C = s[s.length - 1];
|
|
219
|
+
if (C) {
|
|
220
|
+
const h = typeof a?.content == "string" ? a.content : String(a?.content ?? e);
|
|
221
|
+
return C(h);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return n(e, l, t);
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
function Fe(n) {
|
|
228
|
+
return j.add(n), () => j.delete(n);
|
|
229
|
+
}
|
|
230
|
+
function oe() {
|
|
231
|
+
if (q) return;
|
|
232
|
+
[
|
|
233
|
+
Oe,
|
|
234
|
+
Ge,
|
|
235
|
+
ke,
|
|
236
|
+
te,
|
|
237
|
+
Re,
|
|
238
|
+
we,
|
|
239
|
+
Ve,
|
|
240
|
+
Se,
|
|
241
|
+
He,
|
|
242
|
+
ze,
|
|
243
|
+
Ae,
|
|
244
|
+
Pe,
|
|
245
|
+
_e,
|
|
246
|
+
Ne,
|
|
247
|
+
Ee,
|
|
248
|
+
Be
|
|
249
|
+
].forEach((e) => _.component(e)), Me(), q = !0;
|
|
250
|
+
}
|
|
251
|
+
const Ie = {
|
|
252
|
+
key: 1,
|
|
253
|
+
class: "yee-ui-grid__separator"
|
|
254
|
+
}, Le = { class: "yee-ui-grid__table-container" }, je = {
|
|
255
|
+
key: 0,
|
|
256
|
+
class: "yee-ui-grid__title"
|
|
257
|
+
}, De = /* @__PURE__ */ D({
|
|
258
|
+
name: "YeeGrid",
|
|
259
|
+
__name: "YeeGrid",
|
|
260
|
+
props: {
|
|
261
|
+
api: {},
|
|
262
|
+
tableTitle: {},
|
|
263
|
+
tableTitleHelp: {}
|
|
264
|
+
},
|
|
265
|
+
setup(n) {
|
|
266
|
+
const e = n, l = le(), t = U("gridRef"), a = W(ye), T = W(Ce, void 0), [s, C] = he.useModal();
|
|
267
|
+
oe();
|
|
268
|
+
const h = Fe((i) => new Promise((r) => {
|
|
269
|
+
s.confirm({
|
|
270
|
+
title: "恢复默认列配置",
|
|
271
|
+
content: i,
|
|
272
|
+
centered: !0,
|
|
273
|
+
okText: "确认",
|
|
274
|
+
cancelText: "取消",
|
|
275
|
+
keyboard: !0,
|
|
276
|
+
wrapClassName: "vxe-table--ignore-clear",
|
|
277
|
+
onOk: () => r("confirm"),
|
|
278
|
+
onCancel: () => r("cancel")
|
|
279
|
+
});
|
|
280
|
+
})), b = d(() => e.api.state.value), y = d(() => b.value.formOptions), x = d(() => !!(e.tableTitle || l["table-title"] || l["toolbar-actions"] || l["toolbar-tools"])), p = d(() => Object.keys(l).filter((i) => ![
|
|
281
|
+
"empty",
|
|
282
|
+
"loading",
|
|
283
|
+
"table-title",
|
|
284
|
+
"toolbar-actions",
|
|
285
|
+
"toolbar-tools"
|
|
286
|
+
].includes(i))), f = d(() => T?.value ?? !1), k = d(() => {
|
|
287
|
+
const i = b.value.gridOptions, r = i.proxyConfig, u = r?.ajax?.query, m = i.toolbarConfig, g = i.pagerConfig;
|
|
288
|
+
return {
|
|
289
|
+
align: "left",
|
|
290
|
+
border: "inner",
|
|
291
|
+
minHeight: 180,
|
|
292
|
+
showHeaderOverflow: "tooltip",
|
|
293
|
+
showOverflow: "tooltip",
|
|
294
|
+
size: "medium",
|
|
295
|
+
...f.value ? { height: "auto" } : {},
|
|
296
|
+
...i,
|
|
297
|
+
columnConfig: {
|
|
298
|
+
resizable: !0,
|
|
299
|
+
...i.columnConfig
|
|
300
|
+
},
|
|
301
|
+
tooltipConfig: {
|
|
302
|
+
enterable: !0,
|
|
303
|
+
leaveDelay: 300,
|
|
304
|
+
...i.tooltipConfig
|
|
305
|
+
},
|
|
306
|
+
...g ? {
|
|
307
|
+
pagerConfig: {
|
|
308
|
+
pageSize: 20,
|
|
309
|
+
pageSizes: [10, 20, 30, 50, 100, 200],
|
|
310
|
+
layouts: ["Total", "Sizes", "Home", "PrevPage", "Number", "NextPage", "End"],
|
|
311
|
+
...g,
|
|
312
|
+
slots: {
|
|
313
|
+
sizes: "pagerSizes",
|
|
314
|
+
...g.slots
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
} : {},
|
|
318
|
+
...r ? {
|
|
319
|
+
proxyConfig: {
|
|
320
|
+
autoLoad: !0,
|
|
321
|
+
showResponseMsg: !1,
|
|
322
|
+
...r,
|
|
323
|
+
response: {
|
|
324
|
+
list: "items",
|
|
325
|
+
result: "items",
|
|
326
|
+
total: "total",
|
|
327
|
+
...r.response
|
|
328
|
+
},
|
|
329
|
+
...r.ajax ? {
|
|
330
|
+
ajax: {
|
|
331
|
+
...r.ajax,
|
|
332
|
+
...u ? {
|
|
333
|
+
query: (H) => u(H, e.api.formApi.getValues())
|
|
334
|
+
} : {}
|
|
335
|
+
}
|
|
336
|
+
} : {}
|
|
337
|
+
}
|
|
338
|
+
} : {},
|
|
339
|
+
...m || x.value ? {
|
|
340
|
+
toolbarConfig: {
|
|
341
|
+
custom: !0,
|
|
342
|
+
refresh: !0,
|
|
343
|
+
zoom: !0,
|
|
344
|
+
...m,
|
|
345
|
+
slots: {
|
|
346
|
+
...e.tableTitle || l["table-title"] || l["toolbar-actions"] ? { buttons: "toolbarActions" } : {},
|
|
347
|
+
...l["toolbar-tools"] ? { tools: "toolbarTools" } : {}
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
} : {}
|
|
351
|
+
};
|
|
352
|
+
}), G = d(() => b.value.gridEvents ?? {});
|
|
353
|
+
se(
|
|
354
|
+
() => a?.value.mode ?? "light",
|
|
355
|
+
(i) => _.setTheme(i),
|
|
356
|
+
{ immediate: !0 }
|
|
357
|
+
);
|
|
358
|
+
async function O() {
|
|
359
|
+
await e.api.reload();
|
|
360
|
+
}
|
|
361
|
+
async function R() {
|
|
362
|
+
await e.api.reload();
|
|
363
|
+
}
|
|
364
|
+
function Y(i, r) {
|
|
365
|
+
typeof r != "number" && typeof r != "string" || i.setPageSizeByEvent(new Event("change"), r);
|
|
366
|
+
}
|
|
367
|
+
return Q(() => {
|
|
368
|
+
t.value && e.api.mount(t.value);
|
|
369
|
+
}), ue(() => {
|
|
370
|
+
h(), e.api.unmount();
|
|
371
|
+
}), (i, r) => (w(), B("section", {
|
|
372
|
+
class: ce(["yee-ui-grid", { "yee-ui-grid--fill-page-content": f.value }])
|
|
373
|
+
}, [
|
|
374
|
+
y.value ? me((w(), L(Te, {
|
|
375
|
+
key: 0,
|
|
376
|
+
api: n.api.formApi,
|
|
377
|
+
options: y.value,
|
|
378
|
+
"on-reset": R,
|
|
379
|
+
"on-submit": O
|
|
380
|
+
}, null, 8, ["api", "options"])), [
|
|
381
|
+
[de, n.api.searchFormVisible.value]
|
|
382
|
+
]) : E("", !0),
|
|
383
|
+
y.value && b.value.separator !== !1 ? (w(), B("div", Ie)) : E("", !0),
|
|
384
|
+
P("div", Le, [
|
|
385
|
+
M(A(te), J({
|
|
386
|
+
ref_key: "gridRef",
|
|
387
|
+
ref: t,
|
|
388
|
+
class: "yee-ui-grid__table"
|
|
389
|
+
}, k.value, pe(G.value)), fe({
|
|
390
|
+
toolbarActions: v((u) => [
|
|
391
|
+
V(i.$slots, "table-title", {}, () => [
|
|
392
|
+
n.tableTitle ? (w(), B("div", je, [
|
|
393
|
+
X(Z(n.tableTitle) + " ", 1),
|
|
394
|
+
n.tableTitleHelp ? (w(), L(A(ee), {
|
|
395
|
+
key: 0,
|
|
396
|
+
title: n.tableTitleHelp
|
|
397
|
+
}, {
|
|
398
|
+
default: v(() => [...r[0] || (r[0] = [
|
|
399
|
+
P("span", {
|
|
400
|
+
class: "yee-ui-grid__help",
|
|
401
|
+
tabindex: "0"
|
|
402
|
+
}, "?", -1)
|
|
403
|
+
])]),
|
|
404
|
+
_: 1
|
|
405
|
+
}, 8, ["title"])) : E("", !0)
|
|
406
|
+
])) : E("", !0)
|
|
407
|
+
], !0),
|
|
408
|
+
V(i.$slots, "toolbar-actions", F(I(u)), void 0, !0)
|
|
409
|
+
]),
|
|
410
|
+
toolbarTools: v((u) => [
|
|
411
|
+
V(i.$slots, "toolbar-tools", F(I(u)), void 0, !0)
|
|
412
|
+
]),
|
|
413
|
+
pagerSizes: v(({ $pager: u, options: m, pageSize: g }) => [
|
|
414
|
+
M(A(be), {
|
|
415
|
+
class: "yee-ui-grid__page-size",
|
|
416
|
+
options: m,
|
|
417
|
+
value: g,
|
|
418
|
+
onChange: (H) => Y(u, H)
|
|
419
|
+
}, null, 8, ["options", "value", "onChange"])
|
|
420
|
+
]),
|
|
421
|
+
empty: v(() => [
|
|
422
|
+
V(i.$slots, "empty", {}, () => [
|
|
423
|
+
r[1] || (r[1] = P("div", { class: "yee-ui-grid__empty" }, "暂无数据", -1))
|
|
424
|
+
], !0)
|
|
425
|
+
]),
|
|
426
|
+
_: 2
|
|
427
|
+
}, [
|
|
428
|
+
ge(p.value, (u) => ({
|
|
429
|
+
name: u,
|
|
430
|
+
fn: v((m) => [
|
|
431
|
+
V(i.$slots, u, F(I(m)), void 0, !0)
|
|
432
|
+
])
|
|
433
|
+
}))
|
|
434
|
+
]), 1040)
|
|
435
|
+
]),
|
|
436
|
+
M(A(C))
|
|
437
|
+
], 2));
|
|
438
|
+
}
|
|
439
|
+
}), We = /* @__PURE__ */ Ye(De, [["__scopeId", "data-v-bc8ae91c"]]);
|
|
440
|
+
function gt(n) {
|
|
441
|
+
oe();
|
|
442
|
+
const e = new $e(n), l = We;
|
|
443
|
+
return [D({
|
|
444
|
+
name: "YeeGrid",
|
|
445
|
+
inheritAttrs: !1,
|
|
446
|
+
props: {
|
|
447
|
+
tableTitle: String,
|
|
448
|
+
tableTitleHelp: String
|
|
449
|
+
},
|
|
450
|
+
setup(a, { attrs: T, slots: s }) {
|
|
451
|
+
return K(() => e.unmount()), () => ve(l, {
|
|
452
|
+
...T,
|
|
453
|
+
api: e,
|
|
454
|
+
...a.tableTitle ? { tableTitle: a.tableTitle } : {},
|
|
455
|
+
...a.tableTitleHelp ? { tableTitleHelp: a.tableTitleHelp } : {}
|
|
456
|
+
}, s);
|
|
457
|
+
}
|
|
458
|
+
}), e];
|
|
459
|
+
}
|
|
460
|
+
export {
|
|
461
|
+
$e as Y,
|
|
462
|
+
gt as u
|
|
463
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yeepay/yee-boss-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.17",
|
|
4
4
|
"description": "运营后台平台公共 UI 与主题基础能力",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -15,6 +15,34 @@
|
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"import": "./dist/index.js"
|
|
17
17
|
},
|
|
18
|
+
"./app-shell": {
|
|
19
|
+
"types": "./dist/app-shell.d.ts",
|
|
20
|
+
"import": "./dist/app-shell.js"
|
|
21
|
+
},
|
|
22
|
+
"./core": {
|
|
23
|
+
"types": "./dist/core.d.ts",
|
|
24
|
+
"import": "./dist/core.js"
|
|
25
|
+
},
|
|
26
|
+
"./descriptions": {
|
|
27
|
+
"types": "./dist/descriptions.d.ts",
|
|
28
|
+
"import": "./dist/descriptions.js"
|
|
29
|
+
},
|
|
30
|
+
"./ellipsis-text": {
|
|
31
|
+
"types": "./dist/ellipsis-text.d.ts",
|
|
32
|
+
"import": "./dist/ellipsis-text.js"
|
|
33
|
+
},
|
|
34
|
+
"./file-upload": {
|
|
35
|
+
"types": "./dist/file-upload.d.ts",
|
|
36
|
+
"import": "./dist/file-upload.js"
|
|
37
|
+
},
|
|
38
|
+
"./form": {
|
|
39
|
+
"types": "./dist/form.d.ts",
|
|
40
|
+
"import": "./dist/form.js"
|
|
41
|
+
},
|
|
42
|
+
"./grid": {
|
|
43
|
+
"types": "./dist/grid.d.ts",
|
|
44
|
+
"import": "./dist/grid.js"
|
|
45
|
+
},
|
|
18
46
|
"./tailwind-preset": {
|
|
19
47
|
"types": "./dist/tailwind-preset.d.ts",
|
|
20
48
|
"import": "./dist/tailwind-preset.js"
|
|
@@ -24,30 +52,41 @@
|
|
|
24
52
|
"types": "./dist/theme.d.ts",
|
|
25
53
|
"import": "./dist/theme.js"
|
|
26
54
|
},
|
|
55
|
+
"./modal": {
|
|
56
|
+
"types": "./dist/modal.d.ts",
|
|
57
|
+
"import": "./dist/modal.js"
|
|
58
|
+
},
|
|
59
|
+
"./page": {
|
|
60
|
+
"types": "./dist/page.d.ts",
|
|
61
|
+
"import": "./dist/page.js"
|
|
62
|
+
},
|
|
63
|
+
"./select": {
|
|
64
|
+
"types": "./dist/select.d.ts",
|
|
65
|
+
"import": "./dist/select.js"
|
|
66
|
+
},
|
|
27
67
|
"./style.css": "./dist/style.css"
|
|
28
68
|
},
|
|
29
69
|
"dependencies": {
|
|
30
|
-
"@ant-design/icons-vue": "^7.0.1"
|
|
70
|
+
"@ant-design/icons-vue": "^7.0.1",
|
|
71
|
+
"lucide-vue-next": "^0.553.0",
|
|
72
|
+
"sortablejs": "^1.15.7",
|
|
73
|
+
"vxe-pc-ui": "4.12.12",
|
|
74
|
+
"vxe-table": "4.17.46"
|
|
31
75
|
},
|
|
32
76
|
"sideEffects": [
|
|
33
77
|
"**/*.css"
|
|
34
78
|
],
|
|
35
79
|
"peerDependencies": {
|
|
36
80
|
"ant-design-vue": "^4.2.0",
|
|
37
|
-
"vue": "^3.5.0"
|
|
38
|
-
"vxe-pc-ui": "4.12.12",
|
|
39
|
-
"vxe-table": "4.17.46"
|
|
81
|
+
"vue": "^3.5.0"
|
|
40
82
|
},
|
|
41
83
|
"devDependencies": {
|
|
42
84
|
"@types/node": "^24.10.9",
|
|
85
|
+
"@types/sortablejs": "^1.15.9",
|
|
43
86
|
"@vitejs/plugin-vue": "^6.0.3",
|
|
44
87
|
"@vue/test-utils": "^2.4.6",
|
|
45
88
|
"ant-design-vue": "^4.2.6",
|
|
46
|
-
"docx-preview": "0.1.14",
|
|
47
|
-
"dompurify": "^3.4.13",
|
|
48
89
|
"happy-dom": "^17.6.3",
|
|
49
|
-
"marked": "4.3.0",
|
|
50
|
-
"postal-mime": "^2.7.6",
|
|
51
90
|
"publint": "^0.3.17",
|
|
52
91
|
"sass": "^1.83.0",
|
|
53
92
|
"typescript": "~5.9.3",
|
|
@@ -55,10 +94,8 @@
|
|
|
55
94
|
"vite-plugin-dts": "^4.5.4",
|
|
56
95
|
"vitest": "^3.2.4",
|
|
57
96
|
"vue": "3.5.27",
|
|
58
|
-
"vue-
|
|
59
|
-
"
|
|
60
|
-
"vxe-table": "4.17.46",
|
|
61
|
-
"xlsx": "0.18.5"
|
|
97
|
+
"vue-router": "^4.6.4",
|
|
98
|
+
"vue-tsc": "^3.2.3"
|
|
62
99
|
},
|
|
63
100
|
"engines": {
|
|
64
101
|
"node": ">=20.19.0",
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { YeeFilePreviewError, YeeFilePreviewProps } from './types';
|
|
2
|
-
declare const _default: import('vue').DefineComponent<YeeFilePreviewProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
3
|
-
error: (error: YeeFilePreviewError) => any;
|
|
4
|
-
unsupported: (error: YeeFilePreviewError) => any;
|
|
5
|
-
load: (result: import('./types').YeeFilePreviewLoadResult) => any;
|
|
6
|
-
download: () => any;
|
|
7
|
-
}, string, import('vue').PublicProps, Readonly<YeeFilePreviewProps> & Readonly<{
|
|
8
|
-
onError?: (error: YeeFilePreviewError) => any;
|
|
9
|
-
onUnsupported?: (error: YeeFilePreviewError) => any;
|
|
10
|
-
onLoad?: (result: import('./types').YeeFilePreviewLoadResult) => any;
|
|
11
|
-
onDownload?: () => any;
|
|
12
|
-
}>, {
|
|
13
|
-
maxFileSize: number | undefined;
|
|
14
|
-
maxRows: number | undefined;
|
|
15
|
-
maxColumns: number | undefined;
|
|
16
|
-
showHeader: boolean | undefined;
|
|
17
|
-
showDownload: boolean | undefined;
|
|
18
|
-
alt: string | undefined;
|
|
19
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
20
|
-
previewContainer: HTMLElement;
|
|
21
|
-
docxContainer: HTMLDivElement;
|
|
22
|
-
}, HTMLElement>;
|
|
23
|
-
export default _default;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export { default as YeeFilePreview } from './YeeFilePreview.vue';
|
|
2
|
-
export type { YeeFilePreviewEmits, YeeFilePreviewEmailMeta, YeeFilePreviewError, YeeFilePreviewKind, YeeFilePreviewLoadResult, YeeFilePreviewProps, YeeFilePreviewSource, YeeFilePreviewStatus, YeeFilePreviewTableRow, } from './types';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { YeeFilePreviewKind, YeeFilePreviewSource } from './types';
|
|
2
|
-
export declare function extensionFromName(name: string | undefined): string;
|
|
3
|
-
export declare function fileNameFromSource(source: YeeFilePreviewSource | undefined): string;
|
|
4
|
-
export declare function kindFromType(type: string | undefined): YeeFilePreviewKind | undefined;
|
|
5
|
-
export declare function resolveFileKind(source: YeeFilePreviewSource | undefined, fileName: string | undefined, fileType: string | undefined): YeeFilePreviewKind;
|
|
6
|
-
export declare function supportedFileExtensions(): readonly string[];
|
|
7
|
-
export declare function isBlobLike(source: YeeFilePreviewSource | undefined): source is Blob | File | ArrayBuffer;
|
|
8
|
-
export declare function sourceToBlob(source: Blob | File | ArrayBuffer): Blob;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
/** 可直接交给 YeeFilePreview 的文件来源。 */
|
|
2
|
-
export type YeeFilePreviewSource = string | Blob | File | ArrayBuffer;
|
|
3
|
-
/** YeeFilePreview 当前支持识别的文件类型。 */
|
|
4
|
-
export type YeeFilePreviewKind = 'image' | 'pdf' | 'text' | 'json' | 'xml' | 'csv' | 'markdown' | 'html' | 'video' | 'audio' | 'docx' | 'spreadsheet' | 'eml' | 'unsupported';
|
|
5
|
-
/** 文件预览的加载状态。 */
|
|
6
|
-
export type YeeFilePreviewStatus = 'idle' | 'loading' | 'ready' | 'error' | 'unsupported';
|
|
7
|
-
/** YeeFilePreview 的公开属性。 */
|
|
8
|
-
export interface YeeFilePreviewProps {
|
|
9
|
-
/** 文件地址、Blob、File 或 ArrayBuffer。 */
|
|
10
|
-
source?: YeeFilePreviewSource | undefined;
|
|
11
|
-
/** 兼容只提供文件地址的调用方式,优先推荐 source。 */
|
|
12
|
-
url?: string | undefined;
|
|
13
|
-
/** 用于格式识别和下载的文件名。 */
|
|
14
|
-
fileName?: string | undefined;
|
|
15
|
-
/** 用于格式识别的 MIME 类型或扩展名。 */
|
|
16
|
-
fileType?: string | undefined;
|
|
17
|
-
/** 预览区域高度,数字按 px 处理。 */
|
|
18
|
-
height?: string | number | undefined;
|
|
19
|
-
/** 允许解析的最大文件字节数。 */
|
|
20
|
-
maxFileSize?: number | undefined;
|
|
21
|
-
/** 表格预览最多展示的行数。 */
|
|
22
|
-
maxRows?: number | undefined;
|
|
23
|
-
/** 表格预览最多展示的列数。 */
|
|
24
|
-
maxColumns?: number | undefined;
|
|
25
|
-
/** 是否显示文件名和工具栏。 */
|
|
26
|
-
showHeader?: boolean | undefined;
|
|
27
|
-
/** 是否显示下载按钮。 */
|
|
28
|
-
showDownload?: boolean | undefined;
|
|
29
|
-
/** 图片预览的替代文本。 */
|
|
30
|
-
alt?: string | undefined;
|
|
31
|
-
}
|
|
32
|
-
/** 表格文件解析后的单行数据。 */
|
|
33
|
-
export interface YeeFilePreviewTableRow {
|
|
34
|
-
/** 当前行的单元格文本。 */
|
|
35
|
-
cells: string[];
|
|
36
|
-
}
|
|
37
|
-
/** 文件预览失败或不支持时的错误信息。 */
|
|
38
|
-
export interface YeeFilePreviewError {
|
|
39
|
-
/** 当前识别到的文件类型。 */
|
|
40
|
-
kind: YeeFilePreviewKind;
|
|
41
|
-
/** 可直接展示给用户的错误信息。 */
|
|
42
|
-
message: string;
|
|
43
|
-
/** 原始异常。 */
|
|
44
|
-
cause?: unknown;
|
|
45
|
-
}
|
|
46
|
-
/** 文件成功加载后的事件参数。 */
|
|
47
|
-
export interface YeeFilePreviewLoadResult {
|
|
48
|
-
/** 当前文件类型。 */
|
|
49
|
-
kind: YeeFilePreviewKind;
|
|
50
|
-
/** 最终解析出的文件名。 */
|
|
51
|
-
fileName: string;
|
|
52
|
-
}
|
|
53
|
-
/** EML 文件解析后的头部字段。 */
|
|
54
|
-
export interface YeeFilePreviewEmailMeta {
|
|
55
|
-
/** 字段标题。 */
|
|
56
|
-
label: string;
|
|
57
|
-
/** 字段内容。 */
|
|
58
|
-
value: string;
|
|
59
|
-
}
|
|
60
|
-
/** YeeFilePreview 的公开事件。 */
|
|
61
|
-
export interface YeeFilePreviewEmits {
|
|
62
|
-
/** 用户触发下载后触发。 */
|
|
63
|
-
download: [];
|
|
64
|
-
/** 文件加载或解析失败时触发。 */
|
|
65
|
-
error: [error: YeeFilePreviewError];
|
|
66
|
-
/** 文件成功加载后触发。 */
|
|
67
|
-
load: [result: YeeFilePreviewLoadResult];
|
|
68
|
-
/** 文件类型暂不支持在线预览时触发。 */
|
|
69
|
-
unsupported: [error: YeeFilePreviewError];
|
|
70
|
-
}
|