@yeepay/yee-boss-ui 0.1.25 → 0.1.27

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.
@@ -1,8 +1,8 @@
1
- import { defineComponent as ge, reactive as Ae, useTemplateRef as ne, shallowRef as R, computed as g, onMounted as re, onBeforeUnmount as he, openBlock as v, createBlock as H, unref as b, mergeProps as ae, withCtx as p, createElementVNode as _, normalizeStyle as ye, renderSlot as z, createTextVNode as G, toDisplayString as W, nextTick as D, useSlots as Me, inject as de, watch as me, onUnmounted as Be, createElementBlock as I, normalizeClass as Z, withDirectives as Fe, withModifiers as Ie, Fragment as pe, renderList as fe, createCommentVNode as P, resolveDynamicComponent as $e, createVNode as $, vShow as He, toHandlers as Oe, createSlots as De, normalizeProps as ee, guardReactiveProps as te } from "vue";
2
- import { TreeSelect as Le, TimeRangePicker as qe, TimePicker as Ge, Textarea as We, Switch as je, Slider as Ue, Select as be, Segmented as Ye, Rate as Ke, RangePicker as Qe, RadioGroup as Je, Radio as Xe, Mentions as Ze, InputPassword as et, InputNumber as tt, Input as ot, DatePicker as nt, CheckboxGroup as rt, Checkbox as at, Cascader as it, AutoComplete as lt, Tooltip as Ce, Modal as st, Form as ut, FormItem as ct, Button as oe } from "ant-design-vue";
1
+ import { defineComponent as ge, reactive as Ae, useTemplateRef as ne, shallowRef as R, computed as g, onMounted as re, onBeforeUnmount as he, openBlock as v, createBlock as $, unref as b, mergeProps as ae, withCtx as p, createElementVNode as T, normalizeStyle as ye, renderSlot as z, createTextVNode as G, toDisplayString as W, nextTick as L, useSlots as Me, inject as de, watch as me, onUnmounted as Be, createElementBlock as H, normalizeClass as Z, withDirectives as Fe, withModifiers as He, Fragment as pe, renderList as fe, createCommentVNode as P, resolveDynamicComponent as Ie, createVNode as I, vShow as $e, toHandlers as Oe, createSlots as Le, normalizeProps as ee, guardReactiveProps as te } from "vue";
2
+ import { TreeSelect as De, TimeRangePicker as qe, TimePicker as Ge, Textarea as We, Switch as je, Slider as Ue, Select as be, Segmented as Ye, Rate as Ke, RangePicker as Qe, RadioGroup as Je, Radio as Xe, Mentions as Ze, InputPassword as et, InputNumber as tt, Input as ot, DatePicker as nt, CheckboxGroup as rt, Checkbox as at, Cascader as it, AutoComplete as lt, Tooltip as Ce, Modal as st, Form as ut, FormItem as ct, Button as oe } from "ant-design-vue";
3
3
  import { ChevronDown as dt } from "lucide-vue-next";
4
4
  import xe from "vxe-table/es/grid";
5
- import T from "vxe-table/es/ui";
5
+ import _ from "vxe-table/es/ui";
6
6
  import { p as mt } from "./context-DJQ4f46a.js";
7
7
  import { Y as pt } from "./YeeFileUpload-BUFoWs8x.js";
8
8
  import { p as ft } from "./context-C5gszWl6.js";
@@ -14,8 +14,8 @@ import bt from "vxe-pc-ui/es/loading";
14
14
  import Ct from "vxe-pc-ui/es/modal";
15
15
  import xt from "vxe-pc-ui/es/number-input";
16
16
  import wt from "vxe-pc-ui/es/pager";
17
- import _t from "vxe-pc-ui/es/radio-group";
18
- import Tt from "vxe-pc-ui/es/select";
17
+ import Tt from "vxe-pc-ui/es/radio-group";
18
+ import _t from "vxe-pc-ui/es/select";
19
19
  import St from "vxe-table/es/colgroup";
20
20
  import kt from "vxe-table/es/column";
21
21
  import Nt from "vxe-table/es/locale/lang/zh-CN";
@@ -43,7 +43,7 @@ const Rt = {
43
43
  Textarea: We,
44
44
  TimePicker: Ge,
45
45
  TimeRangePicker: qe,
46
- TreeSelect: Le,
46
+ TreeSelect: De,
47
47
  Upload: pt
48
48
  }, Et = {
49
49
  Checkbox: "checked",
@@ -76,7 +76,7 @@ const Rt = {
76
76
  },
77
77
  emits: ["update:modelValue"],
78
78
  setup(l, { expose: a, emit: f }) {
79
- const r = l, C = f, L = Ce, h = Ae({ visible: !1 }), E = ne("tooltip"), S = R(), k = R(""), i = R(), u = R(!1);
79
+ const r = l, C = f, D = Ce, h = Ae({ visible: !1 }), E = ne("tooltip"), S = R(), k = R(""), i = R(), u = R(!1);
80
80
  let y;
81
81
  function x(n) {
82
82
  if (!(n === void 0 || n === ""))
@@ -121,18 +121,18 @@ const Rt = {
121
121
  left: m.left,
122
122
  top: m.top,
123
123
  width: m.width
124
- }, D(() => E.value?.forcePopupAlign?.());
124
+ }, L(() => E.value?.forcePopupAlign?.());
125
125
  }
126
126
  function w(n, m) {
127
127
  const V = Y(n);
128
- return V ? (i.value = V, k.value = m ?? r.content ?? "", u.value = !0, h.visible = !0, C("update:modelValue", !0), A()) : D();
128
+ return V ? (i.value = V, k.value = m ?? r.content ?? "", u.value = !0, h.visible = !0, C("update:modelValue", !0), A()) : L();
129
129
  }
130
130
  function q(n, m, V) {
131
131
  const J = n.currentTarget instanceof HTMLElement ? n.currentTarget : void 0;
132
132
  return w(m ?? J, V);
133
133
  }
134
134
  function N() {
135
- return u.value = !1, i.value = void 0, S.value = void 0, h.visible = !1, C("update:modelValue", !1), D();
135
+ return u.value = !1, i.value = void 0, S.value = void 0, h.visible = !1, C("update:modelValue", !1), L();
136
136
  }
137
137
  function M(n) {
138
138
  n && y && (clearTimeout(y), y = void 0), u.value = n;
@@ -161,7 +161,7 @@ const Rt = {
161
161
  setActived: M,
162
162
  toVisible: w,
163
163
  updatePlacement: A
164
- }), (n, m) => (v(), H(b(L), ae({ ref: "tooltip" }, j.value, {
164
+ }), (n, m) => (v(), $(b(D), ae({ ref: "tooltip" }, j.value, {
165
165
  arrow: r.isArrow !== !1,
166
166
  "get-popup-container": U,
167
167
  open: h.visible,
@@ -169,7 +169,7 @@ const Rt = {
169
169
  placement: "top"
170
170
  }), {
171
171
  title: p(() => [
172
- _("div", {
172
+ T("div", {
173
173
  class: "yee-ui-grid-tooltip-content",
174
174
  onMouseenter: m[0] || (m[0] = (V) => r.enterable && M(!0)),
175
175
  onMouseleave: Q
@@ -180,7 +180,7 @@ const Rt = {
180
180
  ], 32)
181
181
  ]),
182
182
  default: p(() => [
183
- _("span", {
183
+ T("span", {
184
184
  "aria-hidden": "true",
185
185
  class: "yee-ui-grid-tooltip-anchor",
186
186
  style: ye(d.value)
@@ -193,8 +193,8 @@ const Rt = {
193
193
  let ve = !1;
194
194
  const ie = /* @__PURE__ */ new Set();
195
195
  function Mt() {
196
- const l = T.modal.confirm.bind(T.modal);
197
- T.modal.confirm = ((a, f, r) => {
196
+ const l = _.modal.confirm.bind(_.modal);
197
+ _.modal.confirm = ((a, f, r) => {
198
198
  const C = typeof a == "object" && a !== null ? a : typeof r == "object" && r !== null ? r : void 0;
199
199
  if ((typeof C?.className == "string" ? C.className.split(/\s+/) : []).includes("vxe-table--ignore-clear")) {
200
200
  const h = [...ie], E = h[h.length - 1];
@@ -211,7 +211,7 @@ function Bt(l) {
211
211
  }
212
212
  function Ft() {
213
213
  if (ve) return;
214
- T.hasLanguage("zh-CN") || (T.setI18n("zh-CN", Nt), T.setLanguage("zh-CN")), [
214
+ _.hasLanguage("zh-CN") || (_.setI18n("zh-CN", Nt), _.setLanguage("zh-CN")), [
215
215
  Vt,
216
216
  kt,
217
217
  St,
@@ -225,18 +225,18 @@ function Ft() {
225
225
  Ct,
226
226
  xt,
227
227
  wt,
228
- _t,
229
228
  Tt,
229
+ _t,
230
230
  At
231
- ].forEach((a) => T.component(a)), Mt(), ve = !0;
231
+ ].forEach((a) => _.component(a)), Mt(), ve = !0;
232
232
  }
233
- const It = {
233
+ const Ht = {
234
234
  key: 0,
235
235
  class: "yee-ui-grid__label"
236
- }, $t = { class: "yee-ui-grid__control" }, Ht = { class: "yee-ui-grid__form-actions" }, Ot = {
236
+ }, It = { class: "yee-ui-grid__control" }, $t = { class: "yee-ui-grid__form-actions" }, Ot = {
237
237
  key: 1,
238
238
  class: "yee-ui-grid__separator"
239
- }, Dt = { class: "yee-ui-grid__table-container" }, Lt = {
239
+ }, Lt = { class: "yee-ui-grid__table-container" }, Dt = {
240
240
  key: 0,
241
241
  class: "yee-ui-grid__title"
242
242
  }, qt = /* @__PURE__ */ ge({
@@ -248,7 +248,7 @@ const It = {
248
248
  tableTitleHelp: {}
249
249
  },
250
250
  setup(l) {
251
- const a = l, f = Me(), r = ne("gridRef"), C = de(mt), L = de(ft, void 0), [h, E] = st.useModal();
251
+ const a = l, f = Me(), r = ne("gridRef"), C = de(mt), D = de(ft, void 0), [h, E] = st.useModal();
252
252
  Ft();
253
253
  const S = Bt((e) => new Promise((t) => {
254
254
  h.confirm({
@@ -284,7 +284,7 @@ const It = {
284
284
  "table-title",
285
285
  "toolbar-actions",
286
286
  "toolbar-tools"
287
- ].includes(e) && !e.startsWith("form-"))), A = g(() => L?.value ?? !1), w = g(() => a.api.formApi.schema.value.filter((e) => !e.hide)), q = g(() => {
287
+ ].includes(e) && !e.startsWith("form-"))), A = g(() => D?.value ?? !1), w = g(() => a.api.formApi.schema.value.filter((e) => !e.hide)), q = g(() => {
288
288
  if (!i.value?.showCollapseButton || !u.value) return w.value;
289
289
  const e = Math.max(1, i.value.collapsedRows ?? 1), t = y.value, o = [];
290
290
  let s = 1, c = 0;
@@ -354,7 +354,7 @@ const It = {
354
354
  t.required && !a.api.formApi.validateField(t.fieldName) && e.add(t.fieldName);
355
355
  return d.value = e, e.size === 0;
356
356
  }
357
- async function _e() {
357
+ async function Te() {
358
358
  a.api.formApi.resetForm(), d.value = /* @__PURE__ */ new Set(), await Re();
359
359
  }
360
360
  async function X() {
@@ -364,8 +364,8 @@ const It = {
364
364
  }
365
365
  await ze();
366
366
  }
367
- function Te(e) {
368
- e.key === "Enter" && i.value?.submitOnEnter && (e.preventDefault(), X());
367
+ function _e(e) {
368
+ e.key === "Enter" && i.value?.submitOnEnter && !(e.target instanceof HTMLTextAreaElement) && (e.preventDefault(), X());
369
369
  }
370
370
  function se(e) {
371
371
  u.value !== e && (u.value = e, i.value?.handleCollapsedChange?.(e));
@@ -389,9 +389,9 @@ const It = {
389
389
  d.value = /* @__PURE__ */ new Set();
390
390
  return;
391
391
  }
392
- a.api.formApi.configure(e), u.value = e.collapsed ?? !0, d.value = /* @__PURE__ */ new Set(), D(N);
392
+ a.api.formApi.configure(e), u.value = e.collapsed ?? !0, d.value = /* @__PURE__ */ new Set(), L(N);
393
393
  }, { immediate: !0 }), re(async () => {
394
- await D(), N();
394
+ await L(), N();
395
395
  const e = x.value?.$el;
396
396
  typeof ResizeObserver < "u" && e && (O = new ResizeObserver(N), O.observe(e));
397
397
  }), he(() => {
@@ -466,7 +466,7 @@ const It = {
466
466
  }), Pe = g(() => k.value.gridEvents ?? {});
467
467
  me(
468
468
  () => C?.value.mode ?? "light",
469
- (e) => T.setTheme(e),
469
+ (e) => _.setTheme(e),
470
470
  { immediate: !0 }
471
471
  );
472
472
  async function ze() {
@@ -482,20 +482,20 @@ const It = {
482
482
  r.value && a.api.mount(r.value);
483
483
  }), Be(() => {
484
484
  S(), a.api.unmount();
485
- }), (e, t) => (v(), I("section", {
485
+ }), (e, t) => (v(), H("section", {
486
486
  class: Z(["yee-ui-grid", { "yee-ui-grid--fill-page-content": A.value }])
487
487
  }, [
488
- i.value ? Fe((v(), H(b(ut), {
488
+ i.value ? Fe((v(), $(b(ut), {
489
489
  key: 0,
490
490
  ref: "formElement",
491
491
  class: "yee-ui-grid__search-form",
492
492
  layout: i.value.layout ?? "horizontal",
493
493
  model: l.api.formApi.getModel(),
494
- onKeydown: Te,
495
- onSubmit: Ie(X, ["prevent"])
494
+ onKeydown: _e,
495
+ onSubmit: He(X, ["prevent"])
496
496
  }, {
497
497
  default: p(() => [
498
- (v(!0), I(pe, null, fe(q.value, (o) => (v(), H(b(ct), {
498
+ (v(!0), H(pe, null, fe(q.value, (o) => (v(), $(b(ct), {
499
499
  key: o.fieldName,
500
500
  "no-style": "",
501
501
  name: o.fieldName,
@@ -503,20 +503,20 @@ const It = {
503
503
  "validate-status": d.value.has(o.fieldName) ? "error" : ""
504
504
  }, {
505
505
  default: p(() => [
506
- _("label", {
506
+ T("label", {
507
507
  class: Z(["yee-ui-grid__field", B(o)]),
508
508
  style: ye(Q(o))
509
509
  }, [
510
- o.label ? (v(), I("span", It, W(o.label), 1)) : P("", !0),
511
- _("div", $t, [
510
+ o.label ? (v(), H("span", Ht, W(o.label), 1)) : P("", !0),
511
+ T("div", It, [
512
512
  Ne(o) ? z(e.$slots, ue(o), {
513
513
  key: 0,
514
514
  field: o,
515
515
  setValue: (s) => le(o, s),
516
516
  value: M(o),
517
517
  values: l.api.formApi.getValues()
518
- }, void 0, !0) : (v(), I(pe, { key: 1 }, [
519
- o.component !== "Custom" ? (v(), H($e(m(o)), ae({
518
+ }, void 0, !0) : (v(), H(pe, { key: 1 }, [
519
+ o.component !== "Custom" ? (v(), $(Ie(m(o)), ae({
520
520
  key: 0,
521
521
  ref_for: !0
522
522
  }, J(o)), null, 16)) : P("", !0)
@@ -526,17 +526,17 @@ const It = {
526
526
  ]),
527
527
  _: 2
528
528
  }, 1032, ["name", "required", "validate-status"]))), 128)),
529
- _("div", Ht, [
530
- $(b(oe), {
529
+ T("div", $t, [
530
+ I(b(oe), {
531
531
  "html-type": "button",
532
- onClick: _e
532
+ onClick: Te
533
533
  }, {
534
534
  default: p(() => [...t[0] || (t[0] = [
535
535
  G(" 重置 ", -1)
536
536
  ])]),
537
537
  _: 1
538
538
  }),
539
- $(b(oe), {
539
+ I(b(oe), {
540
540
  type: "primary",
541
541
  "html-type": "submit"
542
542
  }, {
@@ -545,7 +545,7 @@ const It = {
545
545
  ])]),
546
546
  _: 1
547
547
  }),
548
- i.value.showCollapseButton ? (v(), H(b(oe), {
548
+ i.value.showCollapseButton ? (v(), $(b(oe), {
549
549
  key: 0,
550
550
  class: "yee-ui-grid__collapse-button",
551
551
  type: "link",
@@ -553,8 +553,8 @@ const It = {
553
553
  onClick: ke
554
554
  }, {
555
555
  default: p(() => [
556
- _("span", null, W(u.value ? "展开" : "收起"), 1),
557
- $(b(dt), {
556
+ T("span", null, W(u.value ? "展开" : "收起"), 1),
557
+ I(b(dt), {
558
558
  "aria-hidden": "true",
559
559
  class: Z(["yee-ui-grid__collapse-icon", { "yee-ui-grid__collapse-icon--expanded": !u.value }])
560
560
  }, null, 8, ["class"])
@@ -565,25 +565,25 @@ const It = {
565
565
  ]),
566
566
  _: 3
567
567
  }, 8, ["layout", "model"])), [
568
- [He, l.api.searchFormVisible.value]
568
+ [$e, l.api.searchFormVisible.value]
569
569
  ]) : P("", !0),
570
- i.value && k.value.separator !== !1 ? (v(), I("div", Ot)) : P("", !0),
571
- _("div", Dt, [
572
- $(b(xe), ae({
570
+ i.value && k.value.separator !== !1 ? (v(), H("div", Ot)) : P("", !0),
571
+ T("div", Lt, [
572
+ I(b(xe), ae({
573
573
  ref_key: "gridRef",
574
574
  ref: r,
575
575
  class: "yee-ui-grid__table"
576
- }, Ve.value, Oe(Pe.value)), De({
576
+ }, Ve.value, Oe(Pe.value)), Le({
577
577
  toolbarActions: p((o) => [
578
578
  z(e.$slots, "table-title", {}, () => [
579
- l.tableTitle ? (v(), I("div", Lt, [
579
+ l.tableTitle ? (v(), H("div", Dt, [
580
580
  G(W(l.tableTitle) + " ", 1),
581
- l.tableTitleHelp ? (v(), H(b(Ce), {
581
+ l.tableTitleHelp ? (v(), $(b(Ce), {
582
582
  key: 0,
583
583
  title: l.tableTitleHelp
584
584
  }, {
585
585
  default: p(() => [...t[2] || (t[2] = [
586
- _("span", {
586
+ T("span", {
587
587
  class: "yee-ui-grid__help",
588
588
  tabindex: "0"
589
589
  }, "?", -1)
@@ -598,7 +598,7 @@ const It = {
598
598
  z(e.$slots, "toolbar-tools", ee(te(o)), void 0, !0)
599
599
  ]),
600
600
  pagerSizes: p(({ $pager: o, options: s, pageSize: c }) => [
601
- $(b(be), {
601
+ I(b(be), {
602
602
  class: "yee-ui-grid__page-size",
603
603
  options: s,
604
604
  value: c,
@@ -607,7 +607,7 @@ const It = {
607
607
  ]),
608
608
  empty: p(() => [
609
609
  z(e.$slots, "empty", {}, () => [
610
- t[3] || (t[3] = _("div", { class: "yee-ui-grid__empty" }, "暂无数据", -1))
610
+ t[3] || (t[3] = T("div", { class: "yee-ui-grid__empty" }, "暂无数据", -1))
611
611
  ], !0)
612
612
  ]),
613
613
  _: 2
@@ -620,10 +620,10 @@ const It = {
620
620
  }))
621
621
  ]), 1040)
622
622
  ]),
623
- $(b(E))
623
+ I(b(E))
624
624
  ], 2));
625
625
  }
626
- }), vo = /* @__PURE__ */ zt(qt, [["__scopeId", "data-v-73071c91"]]);
626
+ }), vo = /* @__PURE__ */ zt(qt, [["__scopeId", "data-v-94e4a5a9"]]);
627
627
  export {
628
628
  vo as default
629
629
  };
@@ -4,6 +4,8 @@ export declare class YeeGridFormApi<TValues extends object = YeeGridFormValues>
4
4
  /** 当前表单 Schema,由组件初始化,可通过 updateSchema 动态更新。 */
5
5
  readonly schema: ShallowRef<readonly YeeGridFormSchema<TValues>[]>;
6
6
  private initialValues;
7
+ private configured;
8
+ private pendingSchemaUpdates;
7
9
  private readonly values;
8
10
  /** 获取指定字段值,并保留 TValues 中声明的字段类型。 */
9
11
  getFieldValue<TKey extends keyof TValues & string>(fieldName: TKey): TValues[TKey] | undefined;
@@ -19,6 +21,6 @@ export declare class YeeGridFormApi<TValues extends object = YeeGridFormValues>
19
21
  validateField<TKey extends keyof TValues & string>(fieldName: TKey): boolean;
20
22
  /** 校验所有未隐藏的必填字段;校验失败时返回 false。 */
21
23
  validate(): boolean;
22
- /** 按字段名动态更新 Schema。 */
24
+ /** 按字段名动态更新 Schema;Grid 初始化前调用时会在首次 configure 后应用。 */
23
25
  updateSchema(updates: readonly YeeGridFormSchemaUpdate<TValues>[]): void;
24
26
  }