vft 0.0.456 → 0.0.457

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.
Files changed (44) hide show
  1. package/dist/index.css +1 -1
  2. package/es/components/carousel/use-carousel.js +1 -1
  3. package/es/components/config-provider/hooks/use-global-config.js +3 -3
  4. package/es/components/input/input.vue2.js +4 -4
  5. package/es/components/input-tag/composables/use-input-tag.js +1 -1
  6. package/es/components/loading/index.d.ts +3 -3
  7. package/es/components/loading/loading.js +1 -1
  8. package/es/components/loading/types.d.ts +2 -1
  9. package/es/components/super-form/super-form-item.vue2.js +1 -1
  10. package/es/components/table/index.d.ts +6 -15
  11. package/es/components/table/table.vue2.js +73 -72
  12. package/es/components/table/types.d.ts +2 -2
  13. package/es/components/table/use/use-data-source.js +35 -38
  14. package/es/package.json.d.ts +1 -1
  15. package/es/package.json.js +1 -1
  16. package/es/utils/vue/vnode.js +1 -1
  17. package/lib/components/input/input.vue2.cjs +1 -1
  18. package/lib/components/loading/index.d.ts +3 -3
  19. package/lib/components/loading/loading.cjs +1 -1
  20. package/lib/components/loading/types.d.ts +2 -1
  21. package/lib/components/table/index.d.ts +6 -15
  22. package/lib/components/table/table.vue2.cjs +1 -1
  23. package/lib/components/table/types.d.ts +2 -2
  24. package/lib/components/table/use/use-data-source.cjs +1 -1
  25. package/lib/package.json.cjs +1 -1
  26. package/lib/package.json.d.ts +1 -1
  27. package/package.json +5 -5
  28. package/theme-style/base.css +1 -1
  29. package/theme-style/index.css +1 -1
  30. package/theme-style/src/common/help.scss +17 -0
  31. package/theme-style/src/common/transition.scss +10 -0
  32. package/theme-style/src/loading.scss +5 -4
  33. package/theme-style/src/table.scss +5 -0
  34. package/theme-style/vft-collapse.css +1 -1
  35. package/theme-style/vft-date-picker.css +1 -1
  36. package/theme-style/vft-loading.css +1 -1
  37. package/theme-style/vft-md-container.css +1 -1
  38. package/theme-style/vft-menu.css +1 -1
  39. package/theme-style/vft-table.css +1 -1
  40. package/theme-style/vft-tabs.css +1 -1
  41. package/theme-style/vft-time-picker.css +1 -1
  42. package/theme-style/vft-time-select.css +1 -1
  43. package/theme-style/vft-tree.css +1 -1
  44. package/web-types.json +1 -1
@@ -11,7 +11,7 @@ import "../../hooks/use-model-toggle/index.js";
11
11
  import { useOrderedChildren as ge } from "../../hooks/use-ordered-children/index.js";
12
12
  import "@popperjs/core";
13
13
  import "../../hooks/use-z-index/index.js";
14
- import { carouselContextKey as Se, CAROUSEL_ITEM_NAME as H } from "./constants.js";
14
+ import { CAROUSEL_ITEM_NAME as H, carouselContextKey as Se } from "./constants.js";
15
15
  const L = 300, ze = (t, O, M) => {
16
16
  const {
17
17
  children: o,
@@ -1,7 +1,7 @@
1
1
  import { keysOf as f } from "@vft/utils";
2
2
  import "@vueuse/core";
3
3
  import { debugWarn as v } from "../../../utils/error.js";
4
- import { ref as g, getCurrentInstance as l, computed as i, unref as p, provide as C, inject as x } from "vue";
4
+ import { getCurrentInstance as l, computed as i, unref as p, provide as g, ref as C, inject as x } from "vue";
5
5
  import "lodash-es";
6
6
  import "../../form/index.js";
7
7
  import { namespaceContextKey as I, useNamespace as b, defaultNamespace as y } from "../../../hooks/use-namespace/index.js";
@@ -9,7 +9,7 @@ import "../../../hooks/use-model-toggle/index.js";
9
9
  import "@popperjs/core";
10
10
  import { zIndexContextKey as G, useZIndex as z, defaultInitialZIndex as K } from "../../../hooks/use-z-index/index.js";
11
11
  import { configProviderContextKey as m } from "../constants.js";
12
- const a = g();
12
+ const a = C();
13
13
  function d(o, e = void 0) {
14
14
  const n = l() ? x(m, a) : a;
15
15
  return o ? i(() => n?.value?.[o] ?? e) : n;
@@ -27,7 +27,7 @@ function B(o) {
27
27
  };
28
28
  }
29
29
  const S = (o, e, n = !1) => {
30
- const t = !!l(), r = t ? d() : void 0, u = e?.provide ?? (t ? C : void 0);
30
+ const t = !!l(), r = t ? d() : void 0, u = e?.provide ?? (t ? g : void 0);
31
31
  if (!u) {
32
32
  v(
33
33
  "provideGlobalConfig",
@@ -13,8 +13,8 @@ import "../../hooks/use-z-index/index.js";
13
13
  import { UPDATE_MODEL_EVENT as Q } from "@vft/constants";
14
14
  import { useAttrs as Ze, useCursor as _e } from "@vft/use";
15
15
  import { calcTextareaHeight as he } from "./utils.js";
16
- import { useFormItem as et, useFormItemInputId as tt } from "../form/hooks/use-form-item.js";
17
- import { useFormSize as at, useFormDisabled as nt } from "../form/hooks/use-form-common-props.js";
16
+ import { useFormSize as et, useFormDisabled as tt } from "../form/hooks/use-form-common-props.js";
17
+ import { useFormItem as at, useFormItemInputId as nt } from "../form/hooks/use-form-item.js";
18
18
  const ot = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form"], st = ["id", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form"], It = /* @__PURE__ */ Oe({
19
19
  __name: "input",
20
20
  props: {
@@ -85,9 +85,9 @@ const ot = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "rea
85
85
  n.is("focus", v.value)
86
86
  ]), d = Ze({
87
87
  excludeKeys: l(() => Object.keys(X.value))
88
- }), { form: Ce, formItem: F } = et(), { inputId: Y } = tt(we.props, {
88
+ }), { form: Ce, formItem: F } = at(), { inputId: Y } = nt(we.props, {
89
89
  formItemContext: F
90
- }), ke = at(), x = nt(), n = ye("input"), Z = ye("textarea"), M = H(), p = H(), v = S(!1), N = S(!1), C = S(!1), K = S(!1), _ = S(), O = H(e.inputStyle), k = l(() => M.value || p.value), T = l(() => G(e.prefixIcon, "icon", { size: 16 })), ee = l(() => G(e.suffixIcon, "icon", { size: 16 })), Ie = l(() => G(e.clearIcon, "icon", {
90
+ }), ke = et(), x = tt(), n = ye("input"), Z = ye("textarea"), M = H(), p = H(), v = S(!1), N = S(!1), C = S(!1), K = S(!1), _ = S(), O = H(e.inputStyle), k = l(() => M.value || p.value), T = l(() => G(e.prefixIcon, "icon", { size: 16 })), ee = l(() => G(e.suffixIcon, "icon", { size: 16 })), Ie = l(() => G(e.clearIcon, "icon", {
91
91
  icon: "icon-circle-close",
92
92
  size: 16
93
93
  })), te = l(() => Ce?.statusIcon ?? !1), I = l(() => F?.validateState || ""), ae = l(
@@ -1,6 +1,6 @@
1
1
  import { shallowRef as B, ref as L, computed as c, watch as G } from "vue";
2
2
  import { EVENT_CODE as g } from "../../../constants/aria.js";
3
- import { CHANGE_EVENT as i, UPDATE_MODEL_EVENT as d, INPUT_EVENT as H } from "../../../constants/event.js";
3
+ import { CHANGE_EVENT as i, INPUT_EVENT as H, UPDATE_MODEL_EVENT as d } from "../../../constants/event.js";
4
4
  import "@vueuse/core";
5
5
  import { isUndefined as K } from "@vft/utils";
6
6
  import { debugWarn as C } from "../../../utils/error.js";
@@ -1,11 +1,11 @@
1
1
  import type { App } from 'vue';
2
- import { vLoading, createLoadingDirective } from './directive';
2
+ import { vLoading, createLoadingDirective, type LoadingBinding } from './directive';
3
3
  import { Loading } from './service';
4
4
  export declare const VftLoading: {
5
5
  install(app: App): void;
6
- directive: import("vue").Directive<import("./directive").VftLoading, import("./directive").LoadingBinding>;
6
+ directive: import("vue").Directive<import("./directive").VftLoading, LoadingBinding>;
7
7
  service: (options?: import("./types").LoadingOptions) => import("./loading").LoadingInstance;
8
8
  };
9
9
  export default VftLoading;
10
- export { vLoading as VftLoadingDirective, Loading as VftLoadingService, vLoading, createLoadingDirective };
10
+ export { vLoading as VftLoadingDirective, Loading as VftLoadingService, vLoading, createLoadingDirective, type LoadingBinding, };
11
11
  export * from './types';
@@ -76,7 +76,7 @@ function K(r) {
76
76
  fill: "none"
77
77
  })
78
78
  ]
79
- ), h = e.text ? o("p", { class: n.b("text") }, e.text) : void 0;
79
+ ), h = e.text ? o("p", { class: n.b("text") }, [e.text]) : void 0;
80
80
  return o(
81
81
  k,
82
82
  {
@@ -1,5 +1,6 @@
1
1
  import type { IconProps } from 'vft/es/components/icon';
2
2
  import type { MaybeRef } from '@vueuse/core';
3
+ import type { VNode } from 'vue';
3
4
  export type LoadingOptionsResolved = {
4
5
  parent: LoadingParentElement;
5
6
  background: MaybeRef<string>;
@@ -8,7 +9,7 @@ export type LoadingOptionsResolved = {
8
9
  spinner: MaybeRef<boolean | string>;
9
10
  img: MaybeRef<boolean | string>;
10
11
  icon: MaybeRef<IconProps | string>;
11
- text: MaybeRef<string>;
12
+ text: MaybeRef<string | VNode | VNode[]>;
12
13
  fullscreen: boolean;
13
14
  rotate: MaybeRef<boolean | string>;
14
15
  lock: boolean;
@@ -1,4 +1,4 @@
1
- import { defineComponent as X, computed as j, ref as re, unref as c, useSlots as oe, createVNode as a, mergeProps as q, withDirectives as ie, vShow as ne, createTextVNode as O, isVNode as le, resolveComponent as N } from "vue";
1
+ import { defineComponent as X, computed as j, ref as re, unref as c, useSlots as oe, createVNode as a, mergeProps as q, withDirectives as ie, vShow as ne, isVNode as le, createTextVNode as O, resolveComponent as N } from "vue";
2
2
  import "../alert/index.js";
3
3
  import "../avatar/index.js";
4
4
  import "../avatar-stack/index.js";
@@ -69,11 +69,8 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
69
69
  emptyCfg: {
70
70
  type: import("vue").PropType<import("vft/es/vft").EmptyProps>;
71
71
  };
72
- loadingText: {
73
- type: import("vue").PropType<string>;
74
- };
75
- loadingClass: {
76
- type: import("vue").PropType<string>;
72
+ loadingCfg: {
73
+ type: import("vue").PropType<import("vft/es/vft").LoadingBinding>;
77
74
  };
78
75
  layouts: {
79
76
  type: import("vue").PropType<import("vxe-table").VxeGridPropTypes.Layouts>;
@@ -988,11 +985,8 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
988
985
  emptyCfg: {
989
986
  type: import("vue").PropType<import("vft/es/vft").EmptyProps>;
990
987
  };
991
- loadingText: {
992
- type: import("vue").PropType<string>;
993
- };
994
- loadingClass: {
995
- type: import("vue").PropType<string>;
988
+ loadingCfg: {
989
+ type: import("vue").PropType<import("vft/es/vft").LoadingBinding>;
996
990
  };
997
991
  layouts: {
998
992
  type: import("vue").PropType<import("vxe-table").VxeGridPropTypes.Layouts>;
@@ -1791,11 +1785,8 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
1791
1785
  emptyCfg: {
1792
1786
  type: import("vue").PropType<import("vft/es/vft").EmptyProps>;
1793
1787
  };
1794
- loadingText: {
1795
- type: import("vue").PropType<string>;
1796
- };
1797
- loadingClass: {
1798
- type: import("vue").PropType<string>;
1788
+ loadingCfg: {
1789
+ type: import("vue").PropType<import("vft/es/vft").LoadingBinding>;
1799
1790
  };
1800
1791
  layouts: {
1801
1792
  type: import("vue").PropType<import("vxe-table").VxeGridPropTypes.Layouts>;
@@ -1,33 +1,33 @@
1
- import { defineComponent as O, useAttrs as ae, ref as s, getCurrentInstance as te, computed as H, unref as e, watch as oe, nextTick as le, toRaw as re, createBlock as u, openBlock as m, withCtx as c, createElementVNode as D, normalizeClass as ne, createVNode as p, createCommentVNode as F, mergeProps as T, withDirectives as ce, renderSlot as h, normalizeProps as ie, guardReactiveProps as se } from "vue";
2
- import { VftEmpty as ge } from "../empty/index.js";
3
- import { vLoading as de } from "../loading/directive.js";
4
- import { deepMerge as _, isClient as fe, omit as ue, isFunction as me } from "@vft/utils";
5
- import { FormCompEnum as pe } from "../../utils/form-register.js";
1
+ import { defineComponent as V, createVNode as c, useAttrs as ae, ref as g, getCurrentInstance as te, computed as D, unref as e, watch as oe, nextTick as le, toRaw as re, createBlock as m, openBlock as p, withCtx as i, createElementVNode as H, normalizeClass as ne, createCommentVNode as F, mergeProps as T, withDirectives as ce, vShow as ie, renderSlot as h, normalizeProps as se, guardReactiveProps as ge, createTextVNode as de } from "vue";
2
+ import { VftEmpty as ue } from "../empty/index.js";
3
+ import { vLoading as fe } from "../loading/directive.js";
4
+ import { deepMerge as _, isClient as me, omit as pe, isFunction as he } from "@vft/utils";
5
+ import { FormCompEnum as be } from "../../utils/form-register.js";
6
6
  import "@vueuse/core";
7
7
  import "../config-provider/hooks/use-global-config.js";
8
8
  import "lodash-es";
9
- import { useForm as he } from "../super-form/use/use-form.js";
10
- import { useNamespace as be } from "../../hooks/use-namespace/index.js";
9
+ import { useForm as Ce } from "../super-form/use/use-form.js";
10
+ import { useNamespace as ye } from "../../hooks/use-namespace/index.js";
11
11
  import "../../hooks/use-model-toggle/index.js";
12
12
  import "@popperjs/core";
13
13
  import "../../hooks/use-z-index/index.js";
14
14
  import "../icon/index.js";
15
- import { VftClientOnly as Ce } from "../client-only/index.js";
16
- import { VftPagination as ye } from "../pagination/index.js";
17
- import { VftSkeleton as we } from "../skeleton/index.js";
18
- import { VftSuperForm as ve } from "../super-form/index.js";
19
- import { VxeGrid as xe } from "vxe-table";
20
- import ke from "xe-utils";
15
+ import { VftClientOnly as we } from "../client-only/index.js";
16
+ import { VftPagination as ve } from "../pagination/index.js";
17
+ import { VftSkeleton as xe } from "../skeleton/index.js";
18
+ import { VftSuperForm as ke } from "../super-form/index.js";
19
+ import { VxeGrid as Se } from "vxe-table";
20
+ import Be from "xe-utils";
21
21
  import { PageSize as N } from "./constants.js";
22
- import { useColumns as Se } from "./use/use-columns.js";
23
- import { useDataSource as Be } from "./use/use-data-source.js";
24
- import { useLoading as ze } from "./use/use-loading.js";
25
- import { usePagination as Re } from "./use/use-pagination.js";
26
- import { EmptyEnum as Pe } from "../empty/constants.js";
27
- const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
22
+ import { useColumns as ze } from "./use/use-columns.js";
23
+ import { useDataSource as Re } from "./use/use-data-source.js";
24
+ import { useLoading as Pe } from "./use/use-loading.js";
25
+ import { usePagination as De } from "./use/use-pagination.js";
26
+ import { EmptyEnum as He } from "../empty/constants.js";
27
+ const Fe = V({
28
28
  name: "vft-table"
29
- }), la = /* @__PURE__ */ O({
30
- ...De,
29
+ }), ra = /* @__PURE__ */ V({
30
+ ...Fe,
31
31
  props: {
32
32
  sticky: {
33
33
  type: [Boolean, Object]
@@ -79,14 +79,17 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
79
79
  onChange: {},
80
80
  emptyCfg: {
81
81
  default: () => ({
82
- type: Pe.NoData
82
+ type: He.NoData
83
83
  })
84
84
  },
85
- loadingText: {
86
- default: "加载中..."
87
- },
88
- loadingClass: {
89
- default: "vft-card-loading"
85
+ loadingCfg: {
86
+ type: Boolean,
87
+ default: () => ({
88
+ customClass: "vft-card-loading",
89
+ text: c("div", null, [c("span", null, [de("加载中")]), c("span", {
90
+ class: "dot"
91
+ }, null)])
92
+ })
90
93
  },
91
94
  layouts: {},
92
95
  columns: {},
@@ -397,26 +400,26 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
397
400
  "toolbar-tool-click",
398
401
  "zoom"
399
402
  ],
400
- setup(Fe, {
401
- expose: V,
402
- emit: A
403
+ setup(Te, {
404
+ expose: A,
405
+ emit: E
403
406
  }) {
404
- const n = A, g = be("table"), E = ae(), b = s(), C = s(), q = s([]), d = s(), M = te(), t = H(() => _(M.props, e(d))), {
407
+ const n = E, d = ye("table"), O = ae(), b = g(), C = g(), q = g([]), u = g(), M = te(), t = D(() => _(M.props, e(u))), {
405
408
  getLoading: $,
406
- setLoading: G
407
- } = ze(t), {
408
- getPaginationInfo: i,
409
+ setLoading: L
410
+ } = Pe(t), {
411
+ getPaginationInfo: s,
409
412
  setPagination: f,
410
- getCurrentPage: I
411
- } = Re(t), {
412
- getViewColumns: K,
413
- setColumns: L
414
- } = Se(t);
415
- oe(() => I(), (a) => {
413
+ getCurrentPage: G
414
+ } = De(t), {
415
+ getViewColumns: I,
416
+ setColumns: K
417
+ } = ze(t);
418
+ oe(() => G(), (a) => {
416
419
  le(() => {
417
420
  y({
418
421
  seqConfig: {
419
- startIndex: (a - 1) * (i.value?.pageSize || e(t).pageSize || N)
422
+ startIndex: (a - 1) * (s.value?.pageSize || e(t).pageSize || N)
420
423
  }
421
424
  });
422
425
  });
@@ -424,8 +427,8 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
424
427
  immediate: !0
425
428
  });
426
429
  function y(a) {
427
- d.value = {
428
- ...e(d),
430
+ u.value = {
431
+ ...e(u),
429
432
  ...a
430
433
  };
431
434
  }
@@ -441,10 +444,10 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
441
444
  getDataSource: J,
442
445
  getRawDataSource: k,
443
446
  tableSearch: S
444
- } = Be(t, {
447
+ } = Re(t, {
445
448
  tableData: q,
446
- setLoading: G,
447
- getPaginationInfo: i,
449
+ setLoading: L,
450
+ getPaginationInfo: s,
448
451
  setPagination: f
449
452
  }, n);
450
453
  function B(a) {
@@ -454,7 +457,7 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
454
457
  const {
455
458
  onChange: o
456
459
  } = e(t);
457
- o && me(o) && o(a);
460
+ o && he(o) && o(a);
458
461
  }
459
462
  const z = {};
460
463
  [
@@ -578,19 +581,19 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
578
581
  "toolbar-tool-click",
579
582
  "zoom"
580
583
  ].forEach((a) => {
581
- const o = ke.camelCase(`on-${a}`);
584
+ const o = Be.camelCase(`on-${a}`);
582
585
  z[o] = (...r) => n(a, ...r);
583
586
  });
584
- const l = H(() => {
587
+ const l = D(() => {
585
588
  const a = e(w), o = {
586
- ...E,
589
+ ...O,
587
590
  ...e(t),
588
- columns: re(e(K)),
591
+ columns: re(e(I)),
589
592
  loading: e($),
590
593
  data: a,
591
594
  ...z
592
595
  };
593
- if (fe) {
596
+ if (me) {
594
597
  (e(t)?.addMaxHeight || e(t)?.maxHeight) && (o.maxHeight = e(t)?.maxHeight ? e(t)?.maxHeight : `${window.innerHeight - e(t)?.extraSysHeight - (t.value?.showPager ? t.value?.pageHeight || 40 : 0)}px`);
595
598
  const r = e(t)?.minHeight;
596
599
  o.minHeight = r || (r !== 0 && e(t)?.toolbarConfig?.custom ? 300 : void 0);
@@ -600,6 +603,7 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
600
603
  result: e(t)?.fetchSetting?.listField,
601
604
  total: e(t)?.fetchSetting?.totalField
602
605
  },
606
+ autoLoad: !1,
603
607
  ajax: {
604
608
  query: async () => await v()
605
609
  }
@@ -616,7 +620,7 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
616
620
  setTableData: x,
617
621
  getDataSource: J,
618
622
  getDataSourceRef: w,
619
- setColumns: L,
623
+ setColumns: K,
620
624
  getRawDataSource: k,
621
625
  tableSearch: S
622
626
  };
@@ -624,7 +628,7 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
624
628
  const Q = {
625
629
  field: "_filterTableData",
626
630
  label: "",
627
- type: pe.Search,
631
+ type: be.Search,
628
632
  itemProps: {
629
633
  class: "search-all-form-item"
630
634
  },
@@ -635,7 +639,7 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
635
639
  });
636
640
  }
637
641
  })
638
- }, [Z] = he(_({
642
+ }, [Z] = Ce(_({
639
643
  schemas: [l.value?.formOptions?.addSearchAllSchema ? Q : {}],
640
644
  rowProps: {
641
645
  justify: "start"
@@ -650,7 +654,7 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
650
654
  btnText: "搜索"
651
655
  },
652
656
  actionInline: !0
653
- }, ue(
657
+ }, pe(
654
658
  l.value?.formOptions,
655
659
  ["showActionForm", "addSearchAllSchema"]
656
660
  // 'union' | 'intersection' | 'concat' | 'replace' = 'union'
@@ -659,36 +663,33 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
659
663
  }, ee = () => {
660
664
  x(k()), n("form-reset");
661
665
  };
662
- return V({
666
+ return A({
663
667
  table: b,
664
668
  pageRef: C,
665
669
  ...R
666
- }), (a, o) => (m(), u(e(Ce), null, {
667
- fallback: c(() => [p(e(we))]),
668
- default: c(() => [D("div", {
669
- class: ne([e(g).b()])
670
- }, [p(e(xe), T({
670
+ }), (a, o) => (p(), m(e(we), null, {
671
+ fallback: i(() => [c(e(xe))]),
672
+ default: i(() => [H("div", {
673
+ class: ne([e(d).b()])
674
+ }, [c(e(Se), T({
671
675
  ref_key: "xGrid",
672
676
  ref: b
673
677
  }, l.value), {
674
- toolbarButtons: c(() => [h(a.$slots, "toolbar-left"), l.value?.formOptions?.showActionForm ? (m(), u(e(ve), {
678
+ toolbarButtons: i(() => [h(a.$slots, "toolbar-left"), l.value?.formOptions?.showActionForm ? (p(), m(e(ke), {
675
679
  key: 0,
676
680
  onRegister: e(Z),
677
681
  onSubmit: P,
678
682
  onReset: ee
679
683
  }, null, 8, ["onRegister"])) : F("", !0), h(a.$slots, "toolbar-right")]),
680
- empty: c(() => [h(a.$slots, "empty", {}, () => [p(e(ge), ie(se(l.value.emptyCfg)), null, 16)])]),
681
- loading: c(() => [ce(D("div", {
682
- "vft-loading-text": l.value.loadingText,
683
- "vft-loading-custom-class": l.value.loadingClass
684
- }, null, 8, He), [[e(de), !!l.value.loading]])]),
684
+ empty: i(() => [h(a.$slots, "empty", {}, () => [c(e(ue), se(ge(l.value.emptyCfg)), null, 16)])]),
685
+ loading: i(() => [ce(H("div", null, null, 512), [[ie, l.value.loading], [e(fe), l.value.loadingCfg || {}]])]),
685
686
  _: 3
686
- }, 16), l.value.showPager ? (m(), u(e(ye), T({
687
+ }, 16), l.value.showPager ? (p(), m(e(ve), T({
687
688
  key: 0,
688
689
  ref_key: "pageRef",
689
690
  ref: C
690
- }, e(i), {
691
- class: [e(g).e("pager"), e(g).m(`pager-${e(i)?.pagePlacement}`)],
691
+ }, e(s), {
692
+ class: [e(d).e("pager"), e(d).m(`pager-${e(s)?.pagePlacement}`)],
692
693
  onCurrentChange: o[0] || (o[0] = (r) => B({
693
694
  currentPage: r
694
695
  })),
@@ -701,5 +702,5 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
701
702
  }
702
703
  });
703
704
  export {
704
- la as default
705
+ ra as default
705
706
  };
@@ -1,4 +1,5 @@
1
1
  import type { EmptyProps } from 'vft/es/components/empty';
2
+ import type { LoadingBinding } from 'vft/es/components/loading';
2
3
  import { type PaginationProps } from 'vft/es/components/pagination';
3
4
  import type { VxeGridInstance, VxeGridProps, VxeTableDefines } from 'vxe-table';
4
5
  import { type SuperFormProps } from '../super-form';
@@ -76,8 +77,7 @@ export interface TableProps extends VxeGridProps {
76
77
  onChange?: (...args: any[]) => void;
77
78
  /** 空状态配置,用于自定义空数据时的显示内容 */
78
79
  emptyCfg?: EmptyProps;
79
- loadingText?: string;
80
- loadingClass?: string;
80
+ loadingCfg?: LoadingBinding;
81
81
  }
82
82
  /** 列项属性类型,继承自 VXE Table 的列选项 */
83
83
  export type ColumnItemProps = VxeTableDefines.ColumnOptions;
@@ -1,12 +1,11 @@
1
1
  import "../../pagination/index.js";
2
2
  import { isFunction as D, isBoolean as X, delObjAttrNotExist as Y, isString as $, isEmptyObject as ee, isNullOrUndefined as E, isObject as N, isNumber as te, isPlainObject as ae } from "@vft/utils";
3
- import { useTimeoutFn as re } from "@vueuse/core";
4
- import { merge as ie, get as k } from "lodash-es";
5
- import { ref as T, watchEffect as ne, unref as r, watch as C, computed as ce, onMounted as le, nextTick as ue } from "vue";
6
- import { PageSize as oe } from "../constants.js";
7
- function ve(u, { tableData: I, setLoading: p, getPaginationInfo: O, setPagination: o }, j) {
3
+ import { merge as re, get as k } from "lodash-es";
4
+ import { ref as T, watchEffect as ie, unref as r, watch as C, computed as ne, onMounted as ce, nextTick as le } from "vue";
5
+ import { PageSize as ue } from "../constants.js";
6
+ function ge(u, { tableData: I, setLoading: p, getPaginationInfo: O, setPagination: s }, j) {
8
7
  const a = T([]), R = T({});
9
- ne(() => {
8
+ ie(() => {
10
9
  I.value = r(a);
11
10
  }), C(
12
11
  () => r(u).data,
@@ -19,9 +18,9 @@ function ve(u, { tableData: I, setLoading: p, getPaginationInfo: O, setPaginatio
19
18
  }
20
19
  );
21
20
  function M(e) {
22
- o(e), g({});
21
+ s(e), g({});
23
22
  }
24
- const z = ce(() => {
23
+ const z = ne(() => {
25
24
  const e = r(a);
26
25
  return !e || e.length === 0 ? r(a) : r(a);
27
26
  });
@@ -31,8 +30,8 @@ function ve(u, { tableData: I, setLoading: p, getPaginationInfo: O, setPaginatio
31
30
  fetchSetting: i = {},
32
31
  beforeFetch: n,
33
32
  afterFetch: l,
34
- pagination: d,
35
- delEmptyParams: s,
33
+ pagination: m,
34
+ delEmptyParams: o,
36
35
  transformParams: J,
37
36
  extraParams: h
38
37
  } = r(u);
@@ -50,23 +49,23 @@ function ve(u, { tableData: I, setLoading: p, getPaginationInfo: O, setPaginatio
50
49
  i
51
50
  );
52
51
  let w = {}, c = e;
53
- const { currentPage: P = 1, pageSize: _ = oe } = r(
52
+ const { currentPage: P = 1, pageSize: _ = ue } = r(
54
53
  O
55
54
  );
56
55
  if (J) {
57
- if (X(d) && !d)
56
+ if (X(m) && !m)
58
57
  w = {};
59
58
  else {
60
- const m = e && e.page || P;
61
- w[b] = d?.pageIsZero ? m - 1 : m, w[K] = _;
59
+ const d = e && e.page || P;
60
+ w[b] = m?.pageIsZero ? d - 1 : d, w[K] = _;
62
61
  }
63
- if (c = ie(e, w), n && D(n)) {
64
- const m = await n(c);
65
- c = { ...c, ...m };
62
+ if (c = re(e, w), n && D(n)) {
63
+ const d = await n(c);
64
+ c = { ...c, ...d };
66
65
  }
67
- s && Y(
66
+ o && Y(
68
67
  c,
69
- $(s) ? s === "strict" : !1
68
+ $(o) ? o === "strict" : !1
70
69
  );
71
70
  }
72
71
  c && !ee(c) && !E(h) ? N(c) && N(h) && (c = Object.assign({}, c, h)) : E(h) || (c = h);
@@ -74,26 +73,26 @@ function ve(u, { tableData: I, setLoading: p, getPaginationInfo: O, setPaginatio
74
73
  let f = x ? v : k(v, Q);
75
74
  const S = x ? v.length : k(v, W);
76
75
  if (Number(S)) {
77
- const m = Math.ceil(S / _);
78
- if (P > m)
79
- return o({
80
- currentPage: m
76
+ const d = Math.ceil(S / _);
77
+ if (P > d)
78
+ return s({
79
+ currentPage: d
81
80
  }), await g(e);
82
81
  }
83
- return l && D(l) && (f = await l(f) || f), a.value = f, R.value = f, o({
82
+ return l && D(l) && (f = await l(f) || f), a.value = f, R.value = f, s({
84
83
  total: S || 0
85
- }), e && e.page && o({
84
+ }), e && e.page && s({
86
85
  currentPage: e.page || 1
87
86
  }), j("fetch-success", {
88
87
  items: r(f),
89
88
  total: S
90
89
  }), f;
91
90
  } catch (b) {
92
- console.log(b), j("fetch-error", b), a.value = [], o({
91
+ console.log(b), j("fetch-error", b), a.value = [], s({
93
92
  total: 0
94
93
  });
95
94
  } finally {
96
- ue(() => {
95
+ le(() => {
97
96
  p(!1);
98
97
  });
99
98
  }
@@ -102,7 +101,7 @@ function ve(u, { tableData: I, setLoading: p, getPaginationInfo: O, setPaginatio
102
101
  return R.value;
103
102
  }
104
103
  async function q(e) {
105
- return o({
104
+ return s({
106
105
  currentPage: e?.page || 1
107
106
  }), await g(e);
108
107
  }
@@ -111,9 +110,9 @@ function ve(u, { tableData: I, setLoading: p, getPaginationInfo: O, setPaginatio
111
110
  const { rowkey: t } = r(u);
112
111
  return ((n) => {
113
112
  let l;
114
- return n.some(function(s) {
115
- if (Reflect.has(s, t) && s[t] === e)
116
- return l = s, !0;
113
+ return n.some(function(o) {
114
+ if (Reflect.has(o, t) && o[t] === e)
115
+ return l = o, !0;
117
116
  }), l;
118
117
  })(a.value);
119
118
  }
@@ -135,11 +134,11 @@ function ve(u, { tableData: I, setLoading: p, getPaginationInfo: O, setPaginatio
135
134
  function Z(e, t) {
136
135
  if (!a.value || a.value.length === 0) return;
137
136
  const { rowkey: i } = r(u), n = a.value.findIndex(
138
- (d) => d[t || i] === e[t || i]
137
+ (m) => m[t || i] === e[t || i]
139
138
  );
140
139
  a.value.splice(n, 1);
141
140
  const { total: l } = r(O);
142
- te(l) && o({
141
+ te(l) && s({
143
142
  total: l - 1
144
143
  });
145
144
  }
@@ -162,10 +161,8 @@ function ve(u, { tableData: I, setLoading: p, getPaginationInfo: O, setPaginatio
162
161
  y(F());
163
162
  }
164
163
  const A = T(!0);
165
- return le(() => {
166
- re(() => {
167
- r(u).immediate && g(), A.value = !1;
168
- }, 16);
164
+ return ce(() => {
165
+ r(u).immediate && g(), A.value = !1;
169
166
  }), C(
170
167
  () => r(u).api,
171
168
  () => {
@@ -186,5 +183,5 @@ function ve(u, { tableData: I, setLoading: p, getPaginationInfo: O, setPaginatio
186
183
  };
187
184
  }
188
185
  export {
189
- ve as useDataSource
186
+ ge as useDataSource
190
187
  };
@@ -1,6 +1,6 @@
1
1
  declare const _default: {
2
2
  "name": "vft",
3
- "version": "0.0.456",
3
+ "version": "0.0.457",
4
4
  "license": "MIT",
5
5
  "main": "lib/index.cjs",
6
6
  "module": "es/index.js",
@@ -1,4 +1,4 @@
1
- const o = "0.0.456";
1
+ const o = "0.0.457";
2
2
  export {
3
3
  o as version
4
4
  };
@@ -1,4 +1,4 @@
1
- import { hasOwn as m, camelize as N, isArray as E } from "@vft/utils";
1
+ import { isArray as E, hasOwn as m, camelize as N } from "@vft/utils";
2
2
  import { isVNode as o, Fragment as S, Comment as A, Text as s, createCommentVNode as L, createBlock as _, openBlock as C } from "vue";
3
3
  import { debugWarn as O } from "../error.js";
4
4
  const R = "utils/vue/vnode";