@yeepay/yee-boss-ui 0.1.20 → 0.1.22
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 +94 -67
- package/dist/YeeGrid-C5jcjTuQ.js +629 -0
- package/dist/components/{form → grid}/form-api.d.ts +8 -4
- package/dist/components/grid/form-component-map.d.ts +9 -0
- package/dist/components/{form/types.d.ts → grid/form-types.d.ts} +45 -42
- package/dist/components/grid/index.d.ts +2 -0
- package/dist/components/grid/types.d.ts +12 -10
- package/dist/components/grid/use-yee-grid.d.ts +2 -2
- package/dist/components/grid/yee-grid-api.d.ts +4 -3
- package/dist/grid.css +1 -1
- package/dist/grid.js +2 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +42 -47
- package/dist/resolver.d.ts +25 -0
- package/dist/resolver.js +22 -0
- package/dist/style.css +1 -5
- package/dist/use-yee-grid-idCNjiBi.js +141 -0
- package/package.json +15 -26
- package/dist/YeeForm-COND7XQj.js +0 -160
- package/dist/YeeGrid-CF-0OZUj.js +0 -395
- package/dist/components/form/YeeForm.vue.d.ts +0 -14
- package/dist/components/form/component-map.d.ts +0 -9
- package/dist/components/form/index.d.ts +0 -3
- package/dist/components/grid/YeeGrid.vue.d.ts +0 -28
- package/dist/components/select/YeeSelect.vue.d.ts +0 -32
- package/dist/components/select/index.d.ts +0 -3
- package/dist/components/select/types.d.ts +0 -120
- package/dist/form-api-0148j8ew.js +0 -44
- package/dist/form.d.ts +0 -1
- package/dist/form.js +0 -6
- package/dist/index-DvY7PmUA.js +0 -132
- package/dist/select.d.ts +0 -1
- package/dist/select.js +0 -4
- package/dist/use-yee-grid-ClKZU8CY.js +0 -85
package/dist/YeeGrid-CF-0OZUj.js
DELETED
|
@@ -1,395 +0,0 @@
|
|
|
1
|
-
import { defineComponent as q, reactive as ne, useTemplateRef as Q, shallowRef as E, computed as p, onMounted as F, onBeforeUnmount as re, openBlock as w, createBlock as G, unref as S, mergeProps as K, withCtx as v, createElementVNode as H, normalizeStyle as ie, renderSlot as V, createTextVNode as J, toDisplayString as X, nextTick as I, useSlots as ae, inject as Y, watch as le, onUnmounted as se, createElementBlock as L, normalizeClass as ue, withDirectives as ce, vShow as me, createCommentVNode as k, createVNode as O, toHandlers as pe, createSlots as de, normalizeProps as j, guardReactiveProps as D, renderList as fe } from "vue";
|
|
2
|
-
import { Tooltip as Z, Modal as ge, Select as ve } from "ant-design-vue";
|
|
3
|
-
import ee from "vxe-table/es/grid";
|
|
4
|
-
import h from "vxe-table/es/ui";
|
|
5
|
-
import { p as he } from "./context-DJQ4f46a.js";
|
|
6
|
-
import { Y as be } from "./YeeForm-COND7XQj.js";
|
|
7
|
-
import { p as ye } from "./context-C5gszWl6.js";
|
|
8
|
-
import xe from "vxe-pc-ui/es/button";
|
|
9
|
-
import Ce from "vxe-pc-ui/es/checkbox";
|
|
10
|
-
import Te from "vxe-pc-ui/es/icon";
|
|
11
|
-
import we from "vxe-pc-ui/es/input";
|
|
12
|
-
import Ve from "vxe-pc-ui/es/loading";
|
|
13
|
-
import ze from "vxe-pc-ui/es/modal";
|
|
14
|
-
import Ne from "vxe-pc-ui/es/number-input";
|
|
15
|
-
import Se from "vxe-pc-ui/es/pager";
|
|
16
|
-
import He from "vxe-pc-ui/es/radio-group";
|
|
17
|
-
import Pe from "vxe-pc-ui/es/select";
|
|
18
|
-
import _e from "vxe-table/es/colgroup";
|
|
19
|
-
import Ee from "vxe-table/es/column";
|
|
20
|
-
import ke from "vxe-table/es/locale/lang/zh-CN";
|
|
21
|
-
import Re from "vxe-table/es/table";
|
|
22
|
-
import $e from "vxe-table/es/toolbar";
|
|
23
|
-
import { _ as Ae } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
24
|
-
const Be = /* @__PURE__ */ q({
|
|
25
|
-
inheritAttrs: !1,
|
|
26
|
-
name: "VxeTooltip",
|
|
27
|
-
__name: "YeeGridTooltip",
|
|
28
|
-
props: {
|
|
29
|
-
content: {},
|
|
30
|
-
enterDelay: {},
|
|
31
|
-
enterable: { type: Boolean },
|
|
32
|
-
height: {},
|
|
33
|
-
isArrow: { type: Boolean, default: !0 },
|
|
34
|
-
leaveDelay: {},
|
|
35
|
-
maxHeight: {},
|
|
36
|
-
maxWidth: {},
|
|
37
|
-
minHeight: {},
|
|
38
|
-
minWidth: {},
|
|
39
|
-
modelValue: { type: Boolean },
|
|
40
|
-
popupClassName: {},
|
|
41
|
-
selector: {},
|
|
42
|
-
theme: {},
|
|
43
|
-
trigger: {},
|
|
44
|
-
useHTML: { type: Boolean },
|
|
45
|
-
width: {},
|
|
46
|
-
zIndex: {}
|
|
47
|
-
},
|
|
48
|
-
emits: ["update:modelValue"],
|
|
49
|
-
setup(i, { expose: r, emit: l }) {
|
|
50
|
-
const e = i, c = l, P = Z, s = ne({ visible: !1 }), T = Q("tooltip"), b = E(), y = E(""), x = E(), C = E(!1);
|
|
51
|
-
let d;
|
|
52
|
-
function f(t) {
|
|
53
|
-
if (!(t === void 0 || t === ""))
|
|
54
|
-
return typeof t == "number" ? `${t}px` : t;
|
|
55
|
-
}
|
|
56
|
-
const R = p(() => {
|
|
57
|
-
const t = b.value;
|
|
58
|
-
return !t || !s.visible ? { display: "none" } : {
|
|
59
|
-
height: `${Math.max(t.height, 1)}px`,
|
|
60
|
-
left: `${t.left}px`,
|
|
61
|
-
pointerEvents: "none",
|
|
62
|
-
position: "fixed",
|
|
63
|
-
top: `${t.top}px`,
|
|
64
|
-
width: `${Math.max(t.width, 1)}px`
|
|
65
|
-
};
|
|
66
|
-
}), $ = p(() => ({
|
|
67
|
-
cursor: e.enterable ? "text" : void 0,
|
|
68
|
-
height: f(e.height),
|
|
69
|
-
maxHeight: f(e.maxHeight),
|
|
70
|
-
maxWidth: f(e.maxWidth),
|
|
71
|
-
minHeight: f(e.minHeight),
|
|
72
|
-
minWidth: f(e.minWidth),
|
|
73
|
-
userSelect: e.enterable ? "text" : void 0,
|
|
74
|
-
width: f(e.width)
|
|
75
|
-
})), A = p(() => ({
|
|
76
|
-
...e.popupClassName ? { overlayClassName: e.popupClassName } : {},
|
|
77
|
-
...e.zIndex === void 0 ? {} : { zIndex: Number(e.zIndex) }
|
|
78
|
-
}));
|
|
79
|
-
function B(t) {
|
|
80
|
-
return t.closest("body") ?? document.body;
|
|
81
|
-
}
|
|
82
|
-
function M(t) {
|
|
83
|
-
return t || (typeof e.selector == "string" ? document.querySelector(e.selector) ?? void 0 : e.selector);
|
|
84
|
-
}
|
|
85
|
-
function o() {
|
|
86
|
-
const t = x.value;
|
|
87
|
-
if (!t?.isConnected)
|
|
88
|
-
return m();
|
|
89
|
-
const u = t.getBoundingClientRect();
|
|
90
|
-
return b.value = {
|
|
91
|
-
height: u.height,
|
|
92
|
-
left: u.left,
|
|
93
|
-
top: u.top,
|
|
94
|
-
width: u.width
|
|
95
|
-
}, I(() => T.value?.forcePopupAlign?.());
|
|
96
|
-
}
|
|
97
|
-
function n(t, u) {
|
|
98
|
-
const N = M(t);
|
|
99
|
-
return N ? (x.value = N, y.value = u ?? e.content ?? "", C.value = !0, s.visible = !0, c("update:modelValue", !0), o()) : I();
|
|
100
|
-
}
|
|
101
|
-
function a(t, u, N) {
|
|
102
|
-
const oe = t.currentTarget instanceof HTMLElement ? t.currentTarget : void 0;
|
|
103
|
-
return n(u ?? oe, N);
|
|
104
|
-
}
|
|
105
|
-
function m() {
|
|
106
|
-
return C.value = !1, x.value = void 0, b.value = void 0, s.visible = !1, c("update:modelValue", !1), I();
|
|
107
|
-
}
|
|
108
|
-
function g(t) {
|
|
109
|
-
t && d && (clearTimeout(d), d = void 0), C.value = t;
|
|
110
|
-
}
|
|
111
|
-
function z() {
|
|
112
|
-
return C.value;
|
|
113
|
-
}
|
|
114
|
-
function _() {
|
|
115
|
-
s.visible && o();
|
|
116
|
-
}
|
|
117
|
-
function te() {
|
|
118
|
-
g(!1), e.enterable && (d = setTimeout(() => {
|
|
119
|
-
d = void 0, C.value || m();
|
|
120
|
-
}, e.leaveDelay ?? 0));
|
|
121
|
-
}
|
|
122
|
-
return F(() => {
|
|
123
|
-
window.addEventListener("resize", _), window.addEventListener("scroll", _, !0), e.modelValue && n(void 0, e.content);
|
|
124
|
-
}), re(() => {
|
|
125
|
-
d && clearTimeout(d), window.removeEventListener("resize", _), window.removeEventListener("scroll", _, !0);
|
|
126
|
-
}), r({
|
|
127
|
-
close: m,
|
|
128
|
-
isActived: z,
|
|
129
|
-
open: n,
|
|
130
|
-
openByEvent: a,
|
|
131
|
-
reactData: s,
|
|
132
|
-
setActived: g,
|
|
133
|
-
toVisible: n,
|
|
134
|
-
updatePlacement: o
|
|
135
|
-
}), (t, u) => (w(), G(S(P), K({ ref: "tooltip" }, A.value, {
|
|
136
|
-
arrow: e.isArrow !== !1,
|
|
137
|
-
"get-popup-container": B,
|
|
138
|
-
open: s.visible,
|
|
139
|
-
"overlay-inner-style": $.value,
|
|
140
|
-
placement: "top"
|
|
141
|
-
}), {
|
|
142
|
-
title: v(() => [
|
|
143
|
-
H("div", {
|
|
144
|
-
class: "yee-ui-grid-tooltip-content",
|
|
145
|
-
onMouseenter: u[0] || (u[0] = (N) => e.enterable && g(!0)),
|
|
146
|
-
onMouseleave: te
|
|
147
|
-
}, [
|
|
148
|
-
V(t.$slots, "content", {}, () => [
|
|
149
|
-
J(X(y.value), 1)
|
|
150
|
-
])
|
|
151
|
-
], 32)
|
|
152
|
-
]),
|
|
153
|
-
default: v(() => [
|
|
154
|
-
H("span", {
|
|
155
|
-
"aria-hidden": "true",
|
|
156
|
-
class: "yee-ui-grid-tooltip-anchor",
|
|
157
|
-
style: ie(R.value)
|
|
158
|
-
}, null, 4)
|
|
159
|
-
]),
|
|
160
|
-
_: 3
|
|
161
|
-
}, 16, ["arrow", "open", "overlay-inner-style"]));
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
let U = !1;
|
|
165
|
-
const W = /* @__PURE__ */ new Set();
|
|
166
|
-
function Me() {
|
|
167
|
-
const i = h.modal.confirm.bind(h.modal);
|
|
168
|
-
h.modal.confirm = ((r, l, e) => {
|
|
169
|
-
const c = typeof r == "object" && r !== null ? r : typeof e == "object" && e !== null ? e : void 0;
|
|
170
|
-
if ((typeof c?.className == "string" ? c.className.split(/\s+/) : []).includes("vxe-table--ignore-clear")) {
|
|
171
|
-
const s = [...W], T = s[s.length - 1];
|
|
172
|
-
if (T) {
|
|
173
|
-
const b = typeof c?.content == "string" ? c.content : String(c?.content ?? r);
|
|
174
|
-
return T(b);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
return i(r, l, e);
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
function Ie(i) {
|
|
181
|
-
return W.add(i), () => W.delete(i);
|
|
182
|
-
}
|
|
183
|
-
function Le() {
|
|
184
|
-
if (U) return;
|
|
185
|
-
h.hasLanguage("zh-CN") || (h.setI18n("zh-CN", ke), h.setLanguage("zh-CN")), [
|
|
186
|
-
Re,
|
|
187
|
-
Ee,
|
|
188
|
-
_e,
|
|
189
|
-
ee,
|
|
190
|
-
$e,
|
|
191
|
-
xe,
|
|
192
|
-
Ce,
|
|
193
|
-
Te,
|
|
194
|
-
we,
|
|
195
|
-
Ve,
|
|
196
|
-
ze,
|
|
197
|
-
Ne,
|
|
198
|
-
Se,
|
|
199
|
-
He,
|
|
200
|
-
Pe,
|
|
201
|
-
Be
|
|
202
|
-
].forEach((r) => h.component(r)), Me(), U = !0;
|
|
203
|
-
}
|
|
204
|
-
const Oe = {
|
|
205
|
-
key: 1,
|
|
206
|
-
class: "yee-ui-grid__separator"
|
|
207
|
-
}, je = { class: "yee-ui-grid__table-container" }, De = {
|
|
208
|
-
key: 0,
|
|
209
|
-
class: "yee-ui-grid__title"
|
|
210
|
-
}, Ge = /* @__PURE__ */ q({
|
|
211
|
-
name: "YeeGrid",
|
|
212
|
-
__name: "YeeGrid",
|
|
213
|
-
props: {
|
|
214
|
-
api: {},
|
|
215
|
-
tableTitle: {},
|
|
216
|
-
tableTitleHelp: {}
|
|
217
|
-
},
|
|
218
|
-
setup(i) {
|
|
219
|
-
const r = i, l = ae(), e = Q("gridRef"), c = Y(he), P = Y(ye, void 0), [s, T] = ge.useModal();
|
|
220
|
-
Le();
|
|
221
|
-
const b = Ie((o) => new Promise((n) => {
|
|
222
|
-
s.confirm({
|
|
223
|
-
title: "恢复默认列配置",
|
|
224
|
-
content: o,
|
|
225
|
-
centered: !0,
|
|
226
|
-
okText: "确认",
|
|
227
|
-
cancelText: "取消",
|
|
228
|
-
keyboard: !0,
|
|
229
|
-
wrapClassName: "vxe-table--ignore-clear",
|
|
230
|
-
onOk: () => n("confirm"),
|
|
231
|
-
onCancel: () => n("cancel")
|
|
232
|
-
});
|
|
233
|
-
})), y = p(() => r.api.state.value), x = p(() => y.value.formOptions), C = p(() => !!(r.tableTitle || l["table-title"] || l["toolbar-actions"] || l["toolbar-tools"])), d = p(() => Object.keys(l).filter((o) => ![
|
|
234
|
-
"empty",
|
|
235
|
-
"loading",
|
|
236
|
-
"table-title",
|
|
237
|
-
"toolbar-actions",
|
|
238
|
-
"toolbar-tools"
|
|
239
|
-
].includes(o))), f = p(() => P?.value ?? !1), R = p(() => {
|
|
240
|
-
const o = y.value.gridOptions, n = o.proxyConfig, a = n?.ajax?.query, m = o.toolbarConfig, g = o.pagerConfig;
|
|
241
|
-
return {
|
|
242
|
-
align: "left",
|
|
243
|
-
border: "inner",
|
|
244
|
-
minHeight: 180,
|
|
245
|
-
showHeaderOverflow: "tooltip",
|
|
246
|
-
showOverflow: "tooltip",
|
|
247
|
-
size: "medium",
|
|
248
|
-
...f.value ? { height: "auto" } : {},
|
|
249
|
-
...o,
|
|
250
|
-
columnConfig: {
|
|
251
|
-
resizable: !0,
|
|
252
|
-
...o.columnConfig
|
|
253
|
-
},
|
|
254
|
-
tooltipConfig: {
|
|
255
|
-
enterable: !0,
|
|
256
|
-
leaveDelay: 300,
|
|
257
|
-
...o.tooltipConfig
|
|
258
|
-
},
|
|
259
|
-
...g ? {
|
|
260
|
-
pagerConfig: {
|
|
261
|
-
pageSize: 20,
|
|
262
|
-
pageSizes: [10, 20, 30, 50, 100, 200],
|
|
263
|
-
layouts: ["Total", "Sizes", "Home", "PrevPage", "Number", "NextPage", "End"],
|
|
264
|
-
...g,
|
|
265
|
-
slots: {
|
|
266
|
-
sizes: "pagerSizes",
|
|
267
|
-
...g.slots
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
} : {},
|
|
271
|
-
...n ? {
|
|
272
|
-
proxyConfig: {
|
|
273
|
-
autoLoad: !0,
|
|
274
|
-
showResponseMsg: !1,
|
|
275
|
-
...n,
|
|
276
|
-
response: {
|
|
277
|
-
list: "items",
|
|
278
|
-
result: "items",
|
|
279
|
-
total: "total",
|
|
280
|
-
...n.response
|
|
281
|
-
},
|
|
282
|
-
...n.ajax ? {
|
|
283
|
-
ajax: {
|
|
284
|
-
...n.ajax,
|
|
285
|
-
...a ? {
|
|
286
|
-
query: (z) => a(z, r.api.formApi.getValues())
|
|
287
|
-
} : {}
|
|
288
|
-
}
|
|
289
|
-
} : {}
|
|
290
|
-
}
|
|
291
|
-
} : {},
|
|
292
|
-
...m || C.value ? {
|
|
293
|
-
toolbarConfig: {
|
|
294
|
-
custom: !0,
|
|
295
|
-
refresh: !0,
|
|
296
|
-
zoom: !0,
|
|
297
|
-
...m,
|
|
298
|
-
slots: {
|
|
299
|
-
...r.tableTitle || l["table-title"] || l["toolbar-actions"] ? { buttons: "toolbarActions" } : {},
|
|
300
|
-
...l["toolbar-tools"] ? { tools: "toolbarTools" } : {}
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
} : {}
|
|
304
|
-
};
|
|
305
|
-
}), $ = p(() => y.value.gridEvents ?? {});
|
|
306
|
-
le(
|
|
307
|
-
() => c?.value.mode ?? "light",
|
|
308
|
-
(o) => h.setTheme(o),
|
|
309
|
-
{ immediate: !0 }
|
|
310
|
-
);
|
|
311
|
-
async function A() {
|
|
312
|
-
await r.api.reload();
|
|
313
|
-
}
|
|
314
|
-
async function B() {
|
|
315
|
-
await r.api.reload();
|
|
316
|
-
}
|
|
317
|
-
function M(o, n) {
|
|
318
|
-
typeof n != "number" && typeof n != "string" || o.setPageSizeByEvent(new Event("change"), n);
|
|
319
|
-
}
|
|
320
|
-
return F(() => {
|
|
321
|
-
e.value && r.api.mount(e.value);
|
|
322
|
-
}), se(() => {
|
|
323
|
-
b(), r.api.unmount();
|
|
324
|
-
}), (o, n) => (w(), L("section", {
|
|
325
|
-
class: ue(["yee-ui-grid", { "yee-ui-grid--fill-page-content": f.value }])
|
|
326
|
-
}, [
|
|
327
|
-
x.value ? ce((w(), G(be, {
|
|
328
|
-
key: 0,
|
|
329
|
-
api: i.api.formApi,
|
|
330
|
-
options: x.value,
|
|
331
|
-
"on-reset": B,
|
|
332
|
-
"on-submit": A
|
|
333
|
-
}, null, 8, ["api", "options"])), [
|
|
334
|
-
[me, i.api.searchFormVisible.value]
|
|
335
|
-
]) : k("", !0),
|
|
336
|
-
x.value && y.value.separator !== !1 ? (w(), L("div", Oe)) : k("", !0),
|
|
337
|
-
H("div", je, [
|
|
338
|
-
O(S(ee), K({
|
|
339
|
-
ref_key: "gridRef",
|
|
340
|
-
ref: e,
|
|
341
|
-
class: "yee-ui-grid__table"
|
|
342
|
-
}, R.value, pe($.value)), de({
|
|
343
|
-
toolbarActions: v((a) => [
|
|
344
|
-
V(o.$slots, "table-title", {}, () => [
|
|
345
|
-
i.tableTitle ? (w(), L("div", De, [
|
|
346
|
-
J(X(i.tableTitle) + " ", 1),
|
|
347
|
-
i.tableTitleHelp ? (w(), G(S(Z), {
|
|
348
|
-
key: 0,
|
|
349
|
-
title: i.tableTitleHelp
|
|
350
|
-
}, {
|
|
351
|
-
default: v(() => [...n[0] || (n[0] = [
|
|
352
|
-
H("span", {
|
|
353
|
-
class: "yee-ui-grid__help",
|
|
354
|
-
tabindex: "0"
|
|
355
|
-
}, "?", -1)
|
|
356
|
-
])]),
|
|
357
|
-
_: 1
|
|
358
|
-
}, 8, ["title"])) : k("", !0)
|
|
359
|
-
])) : k("", !0)
|
|
360
|
-
], !0),
|
|
361
|
-
V(o.$slots, "toolbar-actions", j(D(a)), void 0, !0)
|
|
362
|
-
]),
|
|
363
|
-
toolbarTools: v((a) => [
|
|
364
|
-
V(o.$slots, "toolbar-tools", j(D(a)), void 0, !0)
|
|
365
|
-
]),
|
|
366
|
-
pagerSizes: v(({ $pager: a, options: m, pageSize: g }) => [
|
|
367
|
-
O(S(ve), {
|
|
368
|
-
class: "yee-ui-grid__page-size",
|
|
369
|
-
options: m,
|
|
370
|
-
value: g,
|
|
371
|
-
onChange: (z) => M(a, z)
|
|
372
|
-
}, null, 8, ["options", "value", "onChange"])
|
|
373
|
-
]),
|
|
374
|
-
empty: v(() => [
|
|
375
|
-
V(o.$slots, "empty", {}, () => [
|
|
376
|
-
n[1] || (n[1] = H("div", { class: "yee-ui-grid__empty" }, "暂无数据", -1))
|
|
377
|
-
], !0)
|
|
378
|
-
]),
|
|
379
|
-
_: 2
|
|
380
|
-
}, [
|
|
381
|
-
fe(d.value, (a) => ({
|
|
382
|
-
name: a,
|
|
383
|
-
fn: v((m) => [
|
|
384
|
-
V(o.$slots, a, j(D(m)), void 0, !0)
|
|
385
|
-
])
|
|
386
|
-
}))
|
|
387
|
-
]), 1040)
|
|
388
|
-
]),
|
|
389
|
-
O(S(T))
|
|
390
|
-
], 2));
|
|
391
|
-
}
|
|
392
|
-
}), dt = /* @__PURE__ */ Ae(Ge, [["__scopeId", "data-v-b69f5a93"]]);
|
|
393
|
-
export {
|
|
394
|
-
dt as default
|
|
395
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { YeeFormSlots, YeeFormValues, YeeFormProps } from './types';
|
|
2
|
-
declare const _default: <TValues extends object = YeeFormValues>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
3
|
-
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & YeeFormProps<TValues> & Partial<{}>> & import('vue').PublicProps;
|
|
4
|
-
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
|
5
|
-
attrs: any;
|
|
6
|
-
slots: Readonly<YeeFormSlots<TValues>> & YeeFormSlots<TValues>;
|
|
7
|
-
emit: {};
|
|
8
|
-
}>) => import('vue').VNode & {
|
|
9
|
-
__ctx?: Awaited<typeof __VLS_setup>;
|
|
10
|
-
};
|
|
11
|
-
export default _default;
|
|
12
|
-
type __VLS_PrettifyLocal<T> = {
|
|
13
|
-
[K in keyof T]: T[K];
|
|
14
|
-
} & {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Component } from 'vue';
|
|
2
|
-
import { YeeFormBuiltInComponent } from './types';
|
|
3
|
-
export declare const yeeFormComponentMap: Record<YeeFormBuiltInComponent, Component>;
|
|
4
|
-
export declare const yeeFormModelPropMap: {
|
|
5
|
-
readonly Checkbox: "checked";
|
|
6
|
-
readonly Radio: "checked";
|
|
7
|
-
readonly Switch: "checked";
|
|
8
|
-
readonly Upload: "fileList";
|
|
9
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export { default as YeeForm } from './YeeForm.vue';
|
|
2
|
-
export { YeeFormApi } from './form-api';
|
|
3
|
-
export type { YeeFormBuiltInComponent, YeeFormComponent, YeeFormComponentPropsMap, YeeFormOptions, YeeFormSchema, YeeFormSchemaUpdate, YeeFormSlotProps, YeeFormSlots, YeeFormValues, YeeFormProps, } from './types';
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { VxeGridProps } from 'vxe-table';
|
|
2
|
-
import { YeeGridInternalProps, YeeGridSlots } from './types';
|
|
3
|
-
type __VLS_Props = YeeGridInternalProps;
|
|
4
|
-
declare function __VLS_template(): {
|
|
5
|
-
attrs: Partial<{}>;
|
|
6
|
-
slots: Readonly<YeeGridSlots<Record<string, unknown>>> & YeeGridSlots<Record<string, unknown>>;
|
|
7
|
-
refs: {
|
|
8
|
-
gridRef: (import('vxe-table').VxeGridMethods<any> & {
|
|
9
|
-
$props: VxeGridProps<any> & import('vxe-table').VxeGridEventProps<any>;
|
|
10
|
-
$slots: import('vxe-table').VxeGridSlots<any>;
|
|
11
|
-
}) | null;
|
|
12
|
-
};
|
|
13
|
-
rootEl: HTMLElement;
|
|
14
|
-
};
|
|
15
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
16
|
-
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
17
|
-
gridRef: (import('vxe-table').VxeGridMethods<any> & {
|
|
18
|
-
$props: VxeGridProps<any> & import('vxe-table').VxeGridEventProps<any>;
|
|
19
|
-
$slots: import('vxe-table').VxeGridSlots<any>;
|
|
20
|
-
}) | null;
|
|
21
|
-
}, HTMLElement>;
|
|
22
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
23
|
-
export default _default;
|
|
24
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
25
|
-
new (): {
|
|
26
|
-
$slots: S;
|
|
27
|
-
};
|
|
28
|
-
};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { YeeSelectRuntimeProps, YeeSelectSlots, YeeSelectValue } from './types';
|
|
2
|
-
type __VLS_Props = YeeSelectRuntimeProps;
|
|
3
|
-
type __VLS_PublicProps = {
|
|
4
|
-
'value'?: YeeSelectValue;
|
|
5
|
-
} & __VLS_Props;
|
|
6
|
-
declare function __VLS_template(): {
|
|
7
|
-
attrs: Partial<{}>;
|
|
8
|
-
slots: Readonly<YeeSelectSlots> & YeeSelectSlots;
|
|
9
|
-
refs: {
|
|
10
|
-
select: unknown;
|
|
11
|
-
};
|
|
12
|
-
rootEl: any;
|
|
13
|
-
};
|
|
14
|
-
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
15
|
-
declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps, {
|
|
16
|
-
focus: () => void;
|
|
17
|
-
blur: () => void;
|
|
18
|
-
scrollTo: import('ant-design-vue/es/vc-virtual-list/List').ScrollTo;
|
|
19
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
20
|
-
"update:value": (value: import('ant-design-vue/es/select').SelectValue) => any;
|
|
21
|
-
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
22
|
-
"onUpdate:value"?: (value: import('ant-design-vue/es/select').SelectValue) => any;
|
|
23
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
24
|
-
select: unknown;
|
|
25
|
-
}, any>;
|
|
26
|
-
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
27
|
-
export default _default;
|
|
28
|
-
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
29
|
-
new (): {
|
|
30
|
-
$slots: S;
|
|
31
|
-
};
|
|
32
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { YeeSelectComponent as YeeSelectPublicComponent } from './types';
|
|
2
|
-
export declare const YeeSelect: YeeSelectPublicComponent;
|
|
3
|
-
export type { YeeSelectComponent, YeeSelectDisplayValue, YeeSelectDropdownRenderProps, YeeSelectEmits, YeeSelectExpose, YeeSelectFieldNames, YeeSelectOption, YeeSelectProps, YeeSelectSlots, YeeSelectTagRenderProps, YeeSelectValue, } from './types';
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { DefaultOptionType, LabeledValue, RefSelectProps, SelectProps, SelectValue } from 'ant-design-vue/es/select';
|
|
2
|
-
import { ComponentOptionsMixin, DefineComponent, VNodeChild } from 'vue';
|
|
3
|
-
/** YeeSelect 选项,沿用 Ant Design Vue 的默认选项结构。 */
|
|
4
|
-
export type YeeSelectOption = DefaultOptionType;
|
|
5
|
-
/** 自定义选项字段映射。 */
|
|
6
|
-
export type YeeSelectFieldNames = NonNullable<SelectProps['fieldNames']>;
|
|
7
|
-
/** YeeSelect 支持的受控值。 */
|
|
8
|
-
export type YeeSelectValue = SelectValue;
|
|
9
|
-
/** 下拉面板自定义插槽接收的参数。 */
|
|
10
|
-
export interface YeeSelectDropdownRenderProps {
|
|
11
|
-
/** Select 默认生成的下拉菜单节点。 */
|
|
12
|
-
menuNode?: VNodeChild;
|
|
13
|
-
/** 下拉面板接收到的内部属性。 */
|
|
14
|
-
props?: Record<string, unknown>;
|
|
15
|
-
}
|
|
16
|
-
/** 多选模式下单个已选标签的渲染参数。 */
|
|
17
|
-
export interface YeeSelectTagRenderProps {
|
|
18
|
-
/** 当前标签是否允许关闭。 */
|
|
19
|
-
closable: boolean;
|
|
20
|
-
/** 当前选项是否禁用。 */
|
|
21
|
-
disabled: boolean;
|
|
22
|
-
/** 当前标签展示内容。 */
|
|
23
|
-
label: VNodeChild;
|
|
24
|
-
/** 关闭当前标签。 */
|
|
25
|
-
onClose: (event?: MouseEvent) => void;
|
|
26
|
-
/** 当前标签对应的完整选项。 */
|
|
27
|
-
option: YeeSelectOption;
|
|
28
|
-
/** 当前标签对应的原始值。 */
|
|
29
|
-
value: string | number;
|
|
30
|
-
}
|
|
31
|
-
/** maxTagPlaceholder 接收的单个折叠选中项。 */
|
|
32
|
-
export interface YeeSelectDisplayValue {
|
|
33
|
-
/** 当前选项是否禁用。 */
|
|
34
|
-
disabled?: boolean;
|
|
35
|
-
/** 当前选中项的稳定键。 */
|
|
36
|
-
key?: string | number;
|
|
37
|
-
/** 当前选中项的展示内容。 */
|
|
38
|
-
label?: VNodeChild;
|
|
39
|
-
/** 当前选中项对应的完整选项。 */
|
|
40
|
-
option?: YeeSelectOption;
|
|
41
|
-
/** 当前选中项的原始值。 */
|
|
42
|
-
value?: string | number;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* YeeSelect 的公开属性,完整继承 Ant Design Vue Select。
|
|
46
|
-
* value 显式允许 undefined,兼容严格模式下尚未选择的 v-model 初始值。
|
|
47
|
-
*/
|
|
48
|
-
export type YeeSelectProps = Omit<SelectProps, 'value'> & {
|
|
49
|
-
/** 当前选中值,支持 v-model:value。 */
|
|
50
|
-
value?: YeeSelectValue | undefined;
|
|
51
|
-
};
|
|
52
|
-
/** YeeSelect 在运行时主动接管的属性,其余 SelectProps 通过 $attrs 透传。 */
|
|
53
|
-
export interface YeeSelectRuntimeProps {
|
|
54
|
-
/** 自定义选项字段映射。 */
|
|
55
|
-
fieldNames?: YeeSelectFieldNames;
|
|
56
|
-
/** 选择项列表。 */
|
|
57
|
-
options?: YeeSelectOption[];
|
|
58
|
-
}
|
|
59
|
-
/** YeeSelect 的公开事件。 */
|
|
60
|
-
export interface YeeSelectEmits {
|
|
61
|
-
/** 选择框失去焦点时触发。 */
|
|
62
|
-
blur: [event: FocusEvent];
|
|
63
|
-
/** 选中值变化时触发。 */
|
|
64
|
-
change: [value: YeeSelectValue, option: YeeSelectOption | YeeSelectOption[]];
|
|
65
|
-
/** 清空已选内容时触发。 */
|
|
66
|
-
clear: [];
|
|
67
|
-
/** 多选或标签模式取消选择时触发。 */
|
|
68
|
-
deselect: [value: string | number | LabeledValue, option: YeeSelectOption];
|
|
69
|
-
/** 下拉面板显隐变化时触发。 */
|
|
70
|
-
dropdownVisibleChange: [open: boolean];
|
|
71
|
-
/** 选择框获得焦点时触发。 */
|
|
72
|
-
focus: [event: FocusEvent];
|
|
73
|
-
/** 下拉面板滚动时触发。 */
|
|
74
|
-
popupScroll: [event: UIEvent];
|
|
75
|
-
/** 搜索文本变化时触发。 */
|
|
76
|
-
search: [value: string];
|
|
77
|
-
/** 选择选项时触发。 */
|
|
78
|
-
select: [value: string | number | LabeledValue, option: YeeSelectOption];
|
|
79
|
-
/** 受控值变化时触发,支持 v-model:value。 */
|
|
80
|
-
'update:value': [value: YeeSelectValue];
|
|
81
|
-
}
|
|
82
|
-
type YeeSelectEmitOptions = {
|
|
83
|
-
[TEvent in keyof YeeSelectEmits]: (...args: YeeSelectEmits[TEvent]) => void;
|
|
84
|
-
};
|
|
85
|
-
/** YeeSelect 的公开插槽,与 Ant Design Vue Select 保持一致。 */
|
|
86
|
-
export interface YeeSelectSlots {
|
|
87
|
-
/** 使用 Select.Option 时的默认内容。 */
|
|
88
|
-
default?: () => VNodeChild;
|
|
89
|
-
/** 清除按钮图标。 */
|
|
90
|
-
clearIcon?: () => VNodeChild;
|
|
91
|
-
/** 自定义下拉面板。 */
|
|
92
|
-
dropdownRender?: (props: YeeSelectDropdownRenderProps) => VNodeChild;
|
|
93
|
-
/** 选中项图标。 */
|
|
94
|
-
itemIcon?: () => VNodeChild;
|
|
95
|
-
/** 最大标签数量提示。 */
|
|
96
|
-
maxTagPlaceholder?: (omittedValues: YeeSelectDisplayValue[]) => VNodeChild;
|
|
97
|
-
/** 无匹配选项时的内容。 */
|
|
98
|
-
notFoundContent?: () => VNodeChild;
|
|
99
|
-
/** 自定义选项内容。 */
|
|
100
|
-
option?: (props: YeeSelectOption) => VNodeChild;
|
|
101
|
-
/** 自定义选中项标签。 */
|
|
102
|
-
optionLabel?: (option: YeeSelectOption) => VNodeChild;
|
|
103
|
-
/** 输入框占位内容。 */
|
|
104
|
-
placeholder?: () => VNodeChild;
|
|
105
|
-
/** 多选标签移除图标。 */
|
|
106
|
-
removeIcon?: () => VNodeChild;
|
|
107
|
-
/** 选择框尾部图标。 */
|
|
108
|
-
suffixIcon?: () => VNodeChild;
|
|
109
|
-
/** 多选标签内容。 */
|
|
110
|
-
tagRender?: (props: YeeSelectTagRenderProps) => VNodeChild;
|
|
111
|
-
}
|
|
112
|
-
/** 通过 YeeSelect 组件 ref 调用的方法。 */
|
|
113
|
-
export type YeeSelectExpose = RefSelectProps;
|
|
114
|
-
/** 带完整原生 Props、Events 和 Slots 提示的 YeeSelect 组件类型。 */
|
|
115
|
-
export type YeeSelectComponent = DefineComponent<YeeSelectProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, YeeSelectEmitOptions> & {
|
|
116
|
-
new (): YeeSelectExpose & {
|
|
117
|
-
$slots: YeeSelectSlots;
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { shallowRef as t, reactive as i } from "vue";
|
|
2
|
-
class h {
|
|
3
|
-
/** 当前表单 Schema,由组件初始化,可通过 updateSchema 动态更新。 */
|
|
4
|
-
schema = t([]);
|
|
5
|
-
initialValues = {};
|
|
6
|
-
values = i({});
|
|
7
|
-
/** @internal 使用配置初始化 Schema 和字段值。 */
|
|
8
|
-
configure(e) {
|
|
9
|
-
this.schema.value = e.schema.map((s) => ({ ...s })), this.initialValues = { ...e.initialValues }, this.resetForm();
|
|
10
|
-
}
|
|
11
|
-
/** 获取指定字段值,并保留 TValues 中声明的字段类型。 */
|
|
12
|
-
getFieldValue(e) {
|
|
13
|
-
return this.values[e];
|
|
14
|
-
}
|
|
15
|
-
/** 获取当前全部字段值的浅拷贝。 */
|
|
16
|
-
getValues() {
|
|
17
|
-
return { ...this.values };
|
|
18
|
-
}
|
|
19
|
-
/** 将字段值恢复为 initialValues。 */
|
|
20
|
-
resetForm() {
|
|
21
|
-
for (const e of Object.keys(this.values))
|
|
22
|
-
delete this.values[e];
|
|
23
|
-
Object.assign(this.values, this.initialValues);
|
|
24
|
-
}
|
|
25
|
-
/** 设置指定字段值,字段名和值必须与 TValues 保持一致。 */
|
|
26
|
-
setFieldValue(e, s) {
|
|
27
|
-
this.values[e] = s;
|
|
28
|
-
}
|
|
29
|
-
/** 批量更新已声明字段的值。 */
|
|
30
|
-
setValues(e) {
|
|
31
|
-
Object.assign(this.values, e);
|
|
32
|
-
}
|
|
33
|
-
/** 按字段名动态更新 Schema。 */
|
|
34
|
-
updateSchema(e) {
|
|
35
|
-
const s = new Map(e.map((a) => [a.fieldName, a]));
|
|
36
|
-
this.schema.value = this.schema.value.map((a) => ({
|
|
37
|
-
...a,
|
|
38
|
-
...s.get(a.fieldName)
|
|
39
|
-
}));
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
export {
|
|
43
|
-
h as Y
|
|
44
|
-
};
|
package/dist/form.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './components/form';
|