@yeepay/yee-boss-ui 0.1.17 → 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/dist/grid.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Y as i, u as s } from "./use-yee-grid-CUkH4SGb.js";
1
+ import { Y as i, u as s } from "./use-yee-grid-rYoenViE.js";
2
2
  export {
3
3
  i as YeeGridApi,
4
4
  s as useYeeGrid
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import { Y as E } from "./YeeDescriptions-BZ33odSs.js";
8
8
  import { Y as c } from "./YeeEllipsisText-CR94Jym2.js";
9
9
  import { Y as F } from "./YeeFileUpload-DvRN1D-j.js";
10
10
  import { Y as H, a as v } from "./form-api-DbIL_dvg.js";
11
- import { Y as I, u as L } from "./use-yee-grid-CUkH4SGb.js";
11
+ import { Y as I, u as L } from "./use-yee-grid-rYoenViE.js";
12
12
  import { Y as N } from "./YeePage-Dbvn1TNi.js";
13
13
  export {
14
14
  a as CSS_VARIABLE_LAYOUT_CONTENT_HEIGHT,
@@ -1,26 +1,27 @@
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";
1
+ import { shallowRef as z, defineComponent as D, reactive as ne, useTemplateRef as U, computed as d, onMounted as Q, onBeforeUnmount as K, openBlock as V, createBlock as F, unref as N, mergeProps as J, withCtx as v, createElementVNode as P, normalizeStyle as ae, renderSlot as S, 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 L, guardReactiveProps as I, renderList as ge, h as ve } from "vue";
2
2
  import { Tooltip as ee, Modal as he, Select as be } from "ant-design-vue";
3
3
  import te from "vxe-table/es/grid";
4
- import _ from "vxe-table/es/ui";
4
+ import h from "vxe-table/es/ui";
5
5
  import { p as ye } from "./context-DJQ4f46a.js";
6
6
  import { a as xe, Y as Te } from "./form-api-DbIL_dvg.js";
7
7
  import { p as Ce } from "./context-C5gszWl6.js";
8
8
  import we from "vxe-pc-ui/es/button";
9
9
  import Ve from "vxe-pc-ui/es/checkbox";
10
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";
11
+ import ze from "vxe-pc-ui/es/input";
12
+ import He from "vxe-pc-ui/es/loading";
13
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";
14
+ import Ne from "vxe-pc-ui/es/number-input";
15
+ import Pe from "vxe-pc-ui/es/pager";
16
+ import _e from "vxe-pc-ui/es/radio-group";
17
17
  import Ee from "vxe-pc-ui/es/select";
18
18
  import ke from "vxe-table/es/colgroup";
19
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 {
20
+ import Oe from "vxe-table/es/locale/lang/zh-CN";
21
+ import Re from "vxe-table/es/table";
22
+ import Ye from "vxe-table/es/toolbar";
23
+ import { _ as $e } from "./_plugin-vue_export-helper-CHgC5LLL.js";
24
+ class Be {
24
25
  /** 查询表单控制器。 */
25
26
  formApi = new xe();
26
27
  /** 查询表单当前是否可见。 */
@@ -29,7 +30,7 @@ class $e {
29
30
  state;
30
31
  grid;
31
32
  constructor(e) {
32
- this.state = S(e), this.searchFormVisible = S(e.showSearchForm ?? !0);
33
+ this.state = z(e), this.searchFormVisible = z(e.showSearchForm ?? !0);
33
34
  }
34
35
  /** @internal 由 YeeGrid 挂载底层 VXE Grid 实例。 */
35
36
  mount(e) {
@@ -68,7 +69,7 @@ class $e {
68
69
  this.grid = void 0;
69
70
  }
70
71
  }
71
- const Be = /* @__PURE__ */ D({
72
+ const Me = /* @__PURE__ */ D({
72
73
  inheritAttrs: !1,
73
74
  name: "VxeTooltip",
74
75
  __name: "YeeGridTooltip",
@@ -94,14 +95,14 @@ const Be = /* @__PURE__ */ D({
94
95
  },
95
96
  emits: ["update:modelValue"],
96
97
  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
+ const t = n, a = l, C = ee, s = ne({ visible: !1 }), w = U("tooltip"), b = z(), y = z(""), x = z(), T = z(!1);
98
99
  let p;
99
100
  function f(o) {
100
101
  if (!(o === void 0 || o === ""))
101
102
  return typeof o == "number" ? `${o}px` : o;
102
103
  }
103
104
  const k = d(() => {
104
- const o = h.value;
105
+ const o = b.value;
105
106
  return !o || !s.visible ? { display: "none" } : {
106
107
  height: `${Math.max(o.height, 1)}px`,
107
108
  left: `${o.left}px`,
@@ -130,46 +131,46 @@ const Be = /* @__PURE__ */ D({
130
131
  return o || (typeof t.selector == "string" ? document.querySelector(t.selector) ?? void 0 : t.selector);
131
132
  }
132
133
  function i() {
133
- const o = y.value;
134
+ const o = x.value;
134
135
  if (!o?.isConnected)
135
136
  return m();
136
137
  const c = o.getBoundingClientRect();
137
- return h.value = {
138
+ return b.value = {
138
139
  height: c.height,
139
140
  left: c.left,
140
141
  top: c.top,
141
142
  width: c.width
142
- }, $(() => C.value?.forcePopupAlign?.());
143
+ }, $(() => w.value?.forcePopupAlign?.());
143
144
  }
144
145
  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()) : $();
146
+ const A = Y(o);
147
+ return A ? (x.value = A, y.value = c ?? t.content ?? "", T.value = !0, s.visible = !0, a("update:modelValue", !0), i()) : $();
147
148
  }
148
- function u(o, c, z) {
149
+ function u(o, c, A) {
149
150
  const re = o.currentTarget instanceof HTMLElement ? o.currentTarget : void 0;
150
- return r(c ?? re, z);
151
+ return r(c ?? re, A);
151
152
  }
152
153
  function m() {
153
- return x.value = !1, y.value = void 0, h.value = void 0, s.visible = !1, a("update:modelValue", !1), $();
154
+ return T.value = !1, x.value = void 0, b.value = void 0, s.visible = !1, a("update:modelValue", !1), $();
154
155
  }
155
156
  function g(o) {
156
- o && p && (clearTimeout(p), p = void 0), x.value = o;
157
+ o && p && (clearTimeout(p), p = void 0), T.value = o;
157
158
  }
158
159
  function H() {
159
- return x.value;
160
+ return T.value;
160
161
  }
161
- function N() {
162
+ function _() {
162
163
  s.visible && i();
163
164
  }
164
165
  function ie() {
165
166
  g(!1), t.enterable && (p = setTimeout(() => {
166
- p = void 0, x.value || m();
167
+ p = void 0, T.value || m();
167
168
  }, t.leaveDelay ?? 0));
168
169
  }
169
170
  return Q(() => {
170
- window.addEventListener("resize", N), window.addEventListener("scroll", N, !0), t.modelValue && r(void 0, t.content);
171
+ window.addEventListener("resize", _), window.addEventListener("scroll", _, !0), t.modelValue && r(void 0, t.content);
171
172
  }), K(() => {
172
- p && clearTimeout(p), window.removeEventListener("resize", N), window.removeEventListener("scroll", N, !0);
173
+ p && clearTimeout(p), window.removeEventListener("resize", _), window.removeEventListener("scroll", _, !0);
173
174
  }), e({
174
175
  close: m,
175
176
  isActived: H,
@@ -179,7 +180,7 @@ const Be = /* @__PURE__ */ D({
179
180
  setActived: g,
180
181
  toVisible: r,
181
182
  updatePlacement: i
182
- }), (o, c) => (w(), L(A(T), J({ ref: "tooltip" }, O.value, {
183
+ }), (o, c) => (V(), F(N(C), J({ ref: "tooltip" }, O.value, {
183
184
  arrow: t.isArrow !== !1,
184
185
  "get-popup-container": R,
185
186
  open: s.visible,
@@ -189,11 +190,11 @@ const Be = /* @__PURE__ */ D({
189
190
  title: v(() => [
190
191
  P("div", {
191
192
  class: "yee-ui-grid-tooltip-content",
192
- onMouseenter: c[0] || (c[0] = (z) => t.enterable && g(!0)),
193
+ onMouseenter: c[0] || (c[0] = (A) => t.enterable && g(!0)),
193
194
  onMouseleave: ie
194
195
  }, [
195
- V(o.$slots, "content", {}, () => [
196
- X(Z(b.value), 1)
196
+ S(o.$slots, "content", {}, () => [
197
+ X(Z(y.value), 1)
197
198
  ])
198
199
  ], 32)
199
200
  ]),
@@ -210,51 +211,51 @@ const Be = /* @__PURE__ */ D({
210
211
  });
211
212
  let q = !1;
212
213
  const j = /* @__PURE__ */ new Set();
213
- function Me() {
214
- const n = _.modal.confirm.bind(_.modal);
215
- _.modal.confirm = ((e, l, t) => {
214
+ function Le() {
215
+ const n = h.modal.confirm.bind(h.modal);
216
+ h.modal.confirm = ((e, l, t) => {
216
217
  const a = typeof e == "object" && e !== null ? e : typeof t == "object" && t !== null ? t : void 0;
217
218
  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);
219
+ const s = [...j], w = s[s.length - 1];
220
+ if (w) {
221
+ const b = typeof a?.content == "string" ? a.content : String(a?.content ?? e);
222
+ return w(b);
222
223
  }
223
224
  }
224
225
  return n(e, l, t);
225
226
  });
226
227
  }
227
- function Fe(n) {
228
+ function Ie(n) {
228
229
  return j.add(n), () => j.delete(n);
229
230
  }
230
231
  function oe() {
231
232
  if (q) return;
232
- [
233
- Oe,
233
+ h.hasLanguage("zh-CN") || (h.setI18n("zh-CN", Oe), h.setLanguage("zh-CN")), [
234
+ Re,
234
235
  Ge,
235
236
  ke,
236
237
  te,
237
- Re,
238
+ Ye,
238
239
  we,
239
240
  Ve,
240
241
  Se,
241
- He,
242
242
  ze,
243
+ He,
243
244
  Ae,
245
+ Ne,
244
246
  Pe,
245
247
  _e,
246
- Ne,
247
248
  Ee,
248
- Be
249
- ].forEach((e) => _.component(e)), Me(), q = !0;
249
+ Me
250
+ ].forEach((e) => h.component(e)), Le(), q = !0;
250
251
  }
251
- const Ie = {
252
+ const Fe = {
252
253
  key: 1,
253
254
  class: "yee-ui-grid__separator"
254
- }, Le = { class: "yee-ui-grid__table-container" }, je = {
255
+ }, je = { class: "yee-ui-grid__table-container" }, De = {
255
256
  key: 0,
256
257
  class: "yee-ui-grid__title"
257
- }, De = /* @__PURE__ */ D({
258
+ }, We = /* @__PURE__ */ D({
258
259
  name: "YeeGrid",
259
260
  __name: "YeeGrid",
260
261
  props: {
@@ -263,9 +264,9 @@ const Ie = {
263
264
  tableTitleHelp: {}
264
265
  },
265
266
  setup(n) {
266
- const e = n, l = le(), t = U("gridRef"), a = W(ye), T = W(Ce, void 0), [s, C] = he.useModal();
267
+ const e = n, l = le(), t = U("gridRef"), a = W(ye), C = W(Ce, void 0), [s, w] = he.useModal();
267
268
  oe();
268
- const h = Fe((i) => new Promise((r) => {
269
+ const b = Ie((i) => new Promise((r) => {
269
270
  s.confirm({
270
271
  title: "恢复默认列配置",
271
272
  content: i,
@@ -277,14 +278,14 @@ const Ie = {
277
278
  onOk: () => r("confirm"),
278
279
  onCancel: () => r("cancel")
279
280
  });
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
+ })), y = d(() => e.api.state.value), x = d(() => y.value.formOptions), T = d(() => !!(e.tableTitle || l["table-title"] || l["toolbar-actions"] || l["toolbar-tools"])), p = d(() => Object.keys(l).filter((i) => ![
281
282
  "empty",
282
283
  "loading",
283
284
  "table-title",
284
285
  "toolbar-actions",
285
286
  "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;
287
+ ].includes(i))), f = d(() => C?.value ?? !1), k = d(() => {
288
+ const i = y.value.gridOptions, r = i.proxyConfig, u = r?.ajax?.query, m = i.toolbarConfig, g = i.pagerConfig;
288
289
  return {
289
290
  align: "left",
290
291
  border: "inner",
@@ -336,7 +337,7 @@ const Ie = {
336
337
  } : {}
337
338
  }
338
339
  } : {},
339
- ...m || x.value ? {
340
+ ...m || T.value ? {
340
341
  toolbarConfig: {
341
342
  custom: !0,
342
343
  refresh: !0,
@@ -349,10 +350,10 @@ const Ie = {
349
350
  }
350
351
  } : {}
351
352
  };
352
- }), G = d(() => b.value.gridEvents ?? {});
353
+ }), G = d(() => y.value.gridEvents ?? {});
353
354
  se(
354
355
  () => a?.value.mode ?? "light",
355
- (i) => _.setTheme(i),
356
+ (i) => h.setTheme(i),
356
357
  { immediate: !0 }
357
358
  );
358
359
  async function O() {
@@ -367,31 +368,31 @@ const Ie = {
367
368
  return Q(() => {
368
369
  t.value && e.api.mount(t.value);
369
370
  }), ue(() => {
370
- h(), e.api.unmount();
371
- }), (i, r) => (w(), B("section", {
371
+ b(), e.api.unmount();
372
+ }), (i, r) => (V(), B("section", {
372
373
  class: ce(["yee-ui-grid", { "yee-ui-grid--fill-page-content": f.value }])
373
374
  }, [
374
- y.value ? me((w(), L(Te, {
375
+ x.value ? me((V(), F(Te, {
375
376
  key: 0,
376
377
  api: n.api.formApi,
377
- options: y.value,
378
+ options: x.value,
378
379
  "on-reset": R,
379
380
  "on-submit": O
380
381
  }, null, 8, ["api", "options"])), [
381
382
  [de, n.api.searchFormVisible.value]
382
383
  ]) : E("", !0),
383
- y.value && b.value.separator !== !1 ? (w(), B("div", Ie)) : E("", !0),
384
- P("div", Le, [
385
- M(A(te), J({
384
+ x.value && y.value.separator !== !1 ? (V(), B("div", Fe)) : E("", !0),
385
+ P("div", je, [
386
+ M(N(te), J({
386
387
  ref_key: "gridRef",
387
388
  ref: t,
388
389
  class: "yee-ui-grid__table"
389
390
  }, k.value, pe(G.value)), fe({
390
391
  toolbarActions: v((u) => [
391
- V(i.$slots, "table-title", {}, () => [
392
- n.tableTitle ? (w(), B("div", je, [
392
+ S(i.$slots, "table-title", {}, () => [
393
+ n.tableTitle ? (V(), B("div", De, [
393
394
  X(Z(n.tableTitle) + " ", 1),
394
- n.tableTitleHelp ? (w(), L(A(ee), {
395
+ n.tableTitleHelp ? (V(), F(N(ee), {
395
396
  key: 0,
396
397
  title: n.tableTitleHelp
397
398
  }, {
@@ -405,13 +406,13 @@ const Ie = {
405
406
  }, 8, ["title"])) : E("", !0)
406
407
  ])) : E("", !0)
407
408
  ], !0),
408
- V(i.$slots, "toolbar-actions", F(I(u)), void 0, !0)
409
+ S(i.$slots, "toolbar-actions", L(I(u)), void 0, !0)
409
410
  ]),
410
411
  toolbarTools: v((u) => [
411
- V(i.$slots, "toolbar-tools", F(I(u)), void 0, !0)
412
+ S(i.$slots, "toolbar-tools", L(I(u)), void 0, !0)
412
413
  ]),
413
414
  pagerSizes: v(({ $pager: u, options: m, pageSize: g }) => [
414
- M(A(be), {
415
+ M(N(be), {
415
416
  class: "yee-ui-grid__page-size",
416
417
  options: m,
417
418
  value: g,
@@ -419,7 +420,7 @@ const Ie = {
419
420
  }, null, 8, ["options", "value", "onChange"])
420
421
  ]),
421
422
  empty: v(() => [
422
- V(i.$slots, "empty", {}, () => [
423
+ S(i.$slots, "empty", {}, () => [
423
424
  r[1] || (r[1] = P("div", { class: "yee-ui-grid__empty" }, "暂无数据", -1))
424
425
  ], !0)
425
426
  ]),
@@ -428,18 +429,18 @@ const Ie = {
428
429
  ge(p.value, (u) => ({
429
430
  name: u,
430
431
  fn: v((m) => [
431
- V(i.$slots, u, F(I(m)), void 0, !0)
432
+ S(i.$slots, u, L(I(m)), void 0, !0)
432
433
  ])
433
434
  }))
434
435
  ]), 1040)
435
436
  ]),
436
- M(A(C))
437
+ M(N(w))
437
438
  ], 2));
438
439
  }
439
- }), We = /* @__PURE__ */ Ye(De, [["__scopeId", "data-v-bc8ae91c"]]);
440
- function gt(n) {
440
+ }), qe = /* @__PURE__ */ $e(We, [["__scopeId", "data-v-bc8ae91c"]]);
441
+ function ht(n) {
441
442
  oe();
442
- const e = new $e(n), l = We;
443
+ const e = new Be(n), l = qe;
443
444
  return [D({
444
445
  name: "YeeGrid",
445
446
  inheritAttrs: !1,
@@ -447,9 +448,9 @@ function gt(n) {
447
448
  tableTitle: String,
448
449
  tableTitleHelp: String
449
450
  },
450
- setup(a, { attrs: T, slots: s }) {
451
+ setup(a, { attrs: C, slots: s }) {
451
452
  return K(() => e.unmount()), () => ve(l, {
452
- ...T,
453
+ ...C,
453
454
  api: e,
454
455
  ...a.tableTitle ? { tableTitle: a.tableTitle } : {},
455
456
  ...a.tableTitleHelp ? { tableTitleHelp: a.tableTitleHelp } : {}
@@ -458,6 +459,6 @@ function gt(n) {
458
459
  }), e];
459
460
  }
460
461
  export {
461
- $e as Y,
462
- gt as u
462
+ Be as Y,
463
+ ht as u
463
464
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yeepay/yee-boss-ui",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "description": "运营后台平台公共 UI 与主题基础能力",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -76,6 +76,17 @@
76
76
  "sideEffects": [
77
77
  "**/*.css"
78
78
  ],
79
+ "scripts": {
80
+ "build": "vite build",
81
+ "build:example": "vite build --config examples/vite.config.ts",
82
+ "check": "pnpm typecheck && pnpm test && pnpm build && pnpm typecheck:public && pnpm publint",
83
+ "example": "vite --config examples/vite.config.ts",
84
+ "prepack": "pnpm check",
85
+ "publint": "publint",
86
+ "test": "vitest run",
87
+ "typecheck": "vue-tsc --noEmit",
88
+ "typecheck:public": "vue-tsc --noEmit -p tsconfig.public.json"
89
+ },
79
90
  "peerDependencies": {
80
91
  "ant-design-vue": "^4.2.0",
81
92
  "vue": "^3.5.0"
@@ -101,18 +112,14 @@
101
112
  "node": ">=20.19.0",
102
113
  "pnpm": ">=10.0.0"
103
114
  },
115
+ "packageManager": "pnpm@10.28.1",
116
+ "pnpm": {
117
+ "overrides": {
118
+ "@vxe-ui/core": "4.3.1"
119
+ }
120
+ },
104
121
  "publishConfig": {
105
122
  "access": "public",
106
123
  "registry": "https://registry.npmjs.org/"
107
- },
108
- "scripts": {
109
- "build": "vite build",
110
- "build:example": "vite build --config examples/vite.config.ts",
111
- "check": "pnpm typecheck && pnpm test && pnpm build && pnpm typecheck:public && pnpm publint",
112
- "example": "vite --config examples/vite.config.ts",
113
- "publint": "publint",
114
- "test": "vitest run",
115
- "typecheck": "vue-tsc --noEmit",
116
- "typecheck:public": "vue-tsc --noEmit -p tsconfig.public.json"
117
124
  }
118
- }
125
+ }