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.
- package/dist/index.css +1 -1
- package/es/components/carousel/use-carousel.js +1 -1
- package/es/components/config-provider/hooks/use-global-config.js +3 -3
- package/es/components/input/input.vue2.js +4 -4
- package/es/components/input-tag/composables/use-input-tag.js +1 -1
- package/es/components/loading/index.d.ts +3 -3
- package/es/components/loading/loading.js +1 -1
- package/es/components/loading/types.d.ts +2 -1
- package/es/components/super-form/super-form-item.vue2.js +1 -1
- package/es/components/table/index.d.ts +6 -15
- package/es/components/table/table.vue2.js +73 -72
- package/es/components/table/types.d.ts +2 -2
- package/es/components/table/use/use-data-source.js +35 -38
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/es/utils/vue/vnode.js +1 -1
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/loading/index.d.ts +3 -3
- package/lib/components/loading/loading.cjs +1 -1
- package/lib/components/loading/types.d.ts +2 -1
- package/lib/components/table/index.d.ts +6 -15
- package/lib/components/table/table.vue2.cjs +1 -1
- package/lib/components/table/types.d.ts +2 -2
- package/lib/components/table/use/use-data-source.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +5 -5
- package/theme-style/base.css +1 -1
- package/theme-style/index.css +1 -1
- package/theme-style/src/common/help.scss +17 -0
- package/theme-style/src/common/transition.scss +10 -0
- package/theme-style/src/loading.scss +5 -4
- package/theme-style/src/table.scss +5 -0
- package/theme-style/vft-collapse.css +1 -1
- package/theme-style/vft-date-picker.css +1 -1
- package/theme-style/vft-loading.css +1 -1
- package/theme-style/vft-md-container.css +1 -1
- package/theme-style/vft-menu.css +1 -1
- package/theme-style/vft-table.css +1 -1
- package/theme-style/vft-tabs.css +1 -1
- package/theme-style/vft-time-picker.css +1 -1
- package/theme-style/vft-time-select.css +1 -1
- package/theme-style/vft-tree.css +1 -1
- 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 {
|
|
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 {
|
|
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 =
|
|
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 ?
|
|
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 {
|
|
17
|
-
import {
|
|
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 } =
|
|
88
|
+
}), { form: Ce, formItem: F } = at(), { inputId: Y } = nt(we.props, {
|
|
89
89
|
formItemContext: F
|
|
90
|
-
}), ke =
|
|
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,
|
|
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,
|
|
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';
|
|
@@ -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,
|
|
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
|
-
|
|
73
|
-
type: import("vue").PropType<
|
|
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
|
-
|
|
992
|
-
type: import("vue").PropType<
|
|
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
|
-
|
|
1795
|
-
type: import("vue").PropType<
|
|
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
|
|
2
|
-
import { VftEmpty as
|
|
3
|
-
import { vLoading as
|
|
4
|
-
import { deepMerge as _, isClient as
|
|
5
|
-
import { FormCompEnum as
|
|
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
|
|
10
|
-
import { useNamespace as
|
|
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
|
|
16
|
-
import { VftPagination as
|
|
17
|
-
import { VftSkeleton as
|
|
18
|
-
import { VftSuperForm as
|
|
19
|
-
import { VxeGrid as
|
|
20
|
-
import
|
|
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
|
|
23
|
-
import { useDataSource as
|
|
24
|
-
import { useLoading as
|
|
25
|
-
import { usePagination as
|
|
26
|
-
import { EmptyEnum as
|
|
27
|
-
const
|
|
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
|
-
}),
|
|
30
|
-
...
|
|
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:
|
|
82
|
+
type: He.NoData
|
|
83
83
|
})
|
|
84
84
|
},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
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(
|
|
401
|
-
expose:
|
|
402
|
-
emit:
|
|
403
|
+
setup(Te, {
|
|
404
|
+
expose: A,
|
|
405
|
+
emit: E
|
|
403
406
|
}) {
|
|
404
|
-
const n =
|
|
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:
|
|
407
|
-
} =
|
|
408
|
-
getPaginationInfo:
|
|
409
|
+
setLoading: L
|
|
410
|
+
} = Pe(t), {
|
|
411
|
+
getPaginationInfo: s,
|
|
409
412
|
setPagination: f,
|
|
410
|
-
getCurrentPage:
|
|
411
|
-
} =
|
|
412
|
-
getViewColumns:
|
|
413
|
-
setColumns:
|
|
414
|
-
} =
|
|
415
|
-
oe(() =>
|
|
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) * (
|
|
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
|
-
|
|
428
|
-
...e(
|
|
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
|
-
} =
|
|
447
|
+
} = Re(t, {
|
|
445
448
|
tableData: q,
|
|
446
|
-
setLoading:
|
|
447
|
-
getPaginationInfo:
|
|
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 &&
|
|
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 =
|
|
584
|
+
const o = Be.camelCase(`on-${a}`);
|
|
582
585
|
z[o] = (...r) => n(a, ...r);
|
|
583
586
|
});
|
|
584
|
-
const l =
|
|
587
|
+
const l = D(() => {
|
|
585
588
|
const a = e(w), o = {
|
|
586
|
-
...
|
|
589
|
+
...O,
|
|
587
590
|
...e(t),
|
|
588
|
-
columns: re(e(
|
|
591
|
+
columns: re(e(I)),
|
|
589
592
|
loading: e($),
|
|
590
593
|
data: a,
|
|
591
594
|
...z
|
|
592
595
|
};
|
|
593
|
-
if (
|
|
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:
|
|
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:
|
|
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] =
|
|
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
|
-
},
|
|
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
|
|
666
|
+
return A({
|
|
663
667
|
table: b,
|
|
664
668
|
pageRef: C,
|
|
665
669
|
...R
|
|
666
|
-
}), (a, o) => (
|
|
667
|
-
fallback:
|
|
668
|
-
default:
|
|
669
|
-
class: ne([e(
|
|
670
|
-
}, [
|
|
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:
|
|
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:
|
|
681
|
-
loading:
|
|
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 ? (
|
|
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(
|
|
691
|
-
class: [e(
|
|
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
|
-
|
|
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
|
-
|
|
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 {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
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
|
-
|
|
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
|
-
|
|
21
|
+
s(e), g({});
|
|
23
22
|
}
|
|
24
|
-
const z =
|
|
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:
|
|
35
|
-
delEmptyParams:
|
|
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: _ =
|
|
52
|
+
const { currentPage: P = 1, pageSize: _ = ue } = r(
|
|
54
53
|
O
|
|
55
54
|
);
|
|
56
55
|
if (J) {
|
|
57
|
-
if (X(
|
|
56
|
+
if (X(m) && !m)
|
|
58
57
|
w = {};
|
|
59
58
|
else {
|
|
60
|
-
const
|
|
61
|
-
w[b] =
|
|
59
|
+
const d = e && e.page || P;
|
|
60
|
+
w[b] = m?.pageIsZero ? d - 1 : d, w[K] = _;
|
|
62
61
|
}
|
|
63
|
-
if (c =
|
|
64
|
-
const
|
|
65
|
-
c = { ...c, ...
|
|
62
|
+
if (c = re(e, w), n && D(n)) {
|
|
63
|
+
const d = await n(c);
|
|
64
|
+
c = { ...c, ...d };
|
|
66
65
|
}
|
|
67
|
-
|
|
66
|
+
o && Y(
|
|
68
67
|
c,
|
|
69
|
-
$(
|
|
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
|
|
78
|
-
if (P >
|
|
79
|
-
return
|
|
80
|
-
currentPage:
|
|
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,
|
|
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 &&
|
|
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 = [],
|
|
91
|
+
console.log(b), j("fetch-error", b), a.value = [], s({
|
|
93
92
|
total: 0
|
|
94
93
|
});
|
|
95
94
|
} finally {
|
|
96
|
-
|
|
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
|
|
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(
|
|
115
|
-
if (Reflect.has(
|
|
116
|
-
return l =
|
|
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
|
-
(
|
|
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) &&
|
|
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
|
|
166
|
-
|
|
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
|
-
|
|
186
|
+
ge as useDataSource
|
|
190
187
|
};
|
package/es/package.json.d.ts
CHANGED
package/es/package.json.js
CHANGED
package/es/utils/vue/vnode.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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";
|