@yeepay/yee-boss-ui 0.1.18 → 0.1.19

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.
@@ -0,0 +1,395 @@
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
+ };
package/dist/app-shell.js CHANGED
@@ -1,7 +1,7 @@
1
- import { C as s, P as r } from "./PlatformConfigProvider-BwqlDDcK.js";
1
+ import { C as s, P as r } from "./PlatformConfigProvider-BuML7gEO.js";
2
2
  import { d as m, l as t, r as T, t as l, a as f } from "./tokens-Dw6w0SSs.js";
3
3
  import { p, u as Y } from "./context-DJQ4f46a.js";
4
- import { Y as i, a as n, b as P, c as A, d as C } from "./YeeTabs-BPzlkZy6.js";
4
+ import { Y as i, a as n, b as P, c as A, d as C } from "./YeeTabs-YwptF8tY.js";
5
5
  export {
6
6
  s as CSS_VARIABLE_LAYOUT_CONTENT_HEIGHT,
7
7
  r as PlatformConfigProvider,
@@ -3,6 +3,6 @@ import { YeeGridApi } from './yee-grid-api';
3
3
  import { YeeGridComponent as YeeGridPublicComponent, UseYeeGridOptions } from './types';
4
4
  /**
5
5
  * 创建类型安全的 YeeGrid 组件和控制器。
6
- * T 为表格行类型,TFormValues 为查询表单字段类型。
6
+ * Grid 的 VXE 实现只在组件真正渲染时加载,避免根入口按需引入时带入 VXE。
7
7
  */
8
8
  export declare function useYeeGrid<T = Record<string, unknown>, TFormValues extends object = YeeFormValues>(options: UseYeeGridOptions<T, TFormValues>): readonly [YeeGridPublicComponent<T>, YeeGridApi<T, TFormValues>];
package/dist/core.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as o, P as r } from "./PlatformConfigProvider-BwqlDDcK.js";
1
+ import { C as o, P as r } from "./PlatformConfigProvider-BuML7gEO.js";
2
2
  import { d as m, l as t, r as T, t as f, a as l } from "./tokens-Dw6w0SSs.js";
3
3
  import { p as P, u as i } from "./context-DJQ4f46a.js";
4
4
  export {
@@ -1,4 +1,4 @@
1
- import { Y as r } from "./YeeDescriptions-BZ33odSs.js";
1
+ import { Y as r } from "./YeeDescriptions-DyYySPuw.js";
2
2
  export {
3
3
  r as YeeDescriptions
4
4
  };
@@ -1,4 +1,4 @@
1
- import { Y as i } from "./YeeEllipsisText-CR94Jym2.js";
1
+ import { Y as i } from "./YeeEllipsisText-BTSbIuBl.js";
2
2
  export {
3
3
  i as YeeEllipsisText
4
4
  };
@@ -1,4 +1,4 @@
1
- import { Y as a } from "./YeeFileUpload-DvRN1D-j.js";
1
+ import { Y as a } from "./YeeFileUpload-BUFoWs8x.js";
2
2
  export {
3
3
  a as YeeFileUpload
4
4
  };
@@ -0,0 +1,44 @@
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.js CHANGED
@@ -1,5 +1,6 @@
1
- import { Y as r, a } from "./form-api-DbIL_dvg.js";
1
+ import { Y as r } from "./YeeForm-COND7XQj.js";
2
+ import { Y } from "./form-api-0148j8ew.js";
2
3
  export {
3
4
  r as YeeForm,
4
- a as YeeFormApi
5
+ Y as YeeFormApi
5
6
  };