vft 0.0.456 → 0.0.458
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/autocomplete/autocomplete.vue.d.ts +2 -2
- package/es/components/autocomplete/index.d.ts +6 -6
- package/es/components/button/index.d.ts +9 -9
- package/es/components/carousel/use-carousel.js +1 -1
- 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/popconfirm/index.d.ts +15 -15
- package/es/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/es/components/select/index.d.ts +4 -4
- package/es/components/select/select.vue.d.ts +4 -4
- package/es/components/select/useSelect.d.ts +4 -4
- package/es/components/super-form/super-form-item.vue2.js +1 -1
- package/es/components/table/index.d.ts +15 -15
- package/es/components/table/table.vue2.js +72 -72
- package/es/components/table/types.d.ts +2 -2
- package/es/components/table/use/use-data-source.js +35 -38
- package/es/hooks/use-z-index/index.js +3 -3
- 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/autocomplete/autocomplete.vue.d.ts +2 -2
- package/lib/components/autocomplete/index.d.ts +6 -6
- package/lib/components/button/index.d.ts +9 -9
- 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/popconfirm/index.d.ts +15 -15
- package/lib/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/lib/components/select/index.d.ts +4 -4
- package/lib/components/select/select.vue.d.ts +4 -4
- package/lib/components/select/useSelect.d.ts +4 -4
- package/lib/components/table/index.d.ts +15 -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
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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 { VftClientOnly as ue } from "../client-only/index.js";
|
|
3
|
+
import { VftEmpty as fe } from "../empty/index.js";
|
|
4
|
+
import { vLoading as me } from "../loading/directive.js";
|
|
5
|
+
import { deepMerge as _, isClient as pe, omit as he, isFunction as be } from "@vft/utils";
|
|
6
|
+
import { FormCompEnum as Ce } from "../../utils/form-register.js";
|
|
6
7
|
import "@vueuse/core";
|
|
7
8
|
import "../config-provider/hooks/use-global-config.js";
|
|
8
9
|
import "lodash-es";
|
|
9
|
-
import { useForm as
|
|
10
|
-
import { useNamespace as
|
|
10
|
+
import { useForm as ye } from "../super-form/use/use-form.js";
|
|
11
|
+
import { useNamespace as we } from "../../hooks/use-namespace/index.js";
|
|
11
12
|
import "../../hooks/use-model-toggle/index.js";
|
|
12
13
|
import "@popperjs/core";
|
|
13
14
|
import "../../hooks/use-z-index/index.js";
|
|
14
15
|
import "../icon/index.js";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import
|
|
20
|
-
import ke from "xe-utils";
|
|
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,16 @@ 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
|
-
default:
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
loadingCfg: {
|
|
86
|
+
default: () => ({
|
|
87
|
+
customClass: "vft-card-loading",
|
|
88
|
+
text: c("div", null, [c("span", null, [de("加载中")]), c("span", {
|
|
89
|
+
class: "dot"
|
|
90
|
+
}, null)])
|
|
91
|
+
})
|
|
90
92
|
},
|
|
91
93
|
layouts: {},
|
|
92
94
|
columns: {},
|
|
@@ -397,26 +399,26 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
|
|
|
397
399
|
"toolbar-tool-click",
|
|
398
400
|
"zoom"
|
|
399
401
|
],
|
|
400
|
-
setup(
|
|
401
|
-
expose:
|
|
402
|
-
emit:
|
|
402
|
+
setup(Te, {
|
|
403
|
+
expose: A,
|
|
404
|
+
emit: E
|
|
403
405
|
}) {
|
|
404
|
-
const n =
|
|
406
|
+
const n = E, d = we("table"), O = ae(), b = g(), C = g(), q = g([]), u = g(), M = te(), t = D(() => _(M.props, e(u))), {
|
|
405
407
|
getLoading: $,
|
|
406
|
-
setLoading:
|
|
407
|
-
} =
|
|
408
|
-
getPaginationInfo:
|
|
408
|
+
setLoading: L
|
|
409
|
+
} = Pe(t), {
|
|
410
|
+
getPaginationInfo: s,
|
|
409
411
|
setPagination: f,
|
|
410
|
-
getCurrentPage:
|
|
411
|
-
} =
|
|
412
|
-
getViewColumns:
|
|
413
|
-
setColumns:
|
|
414
|
-
} =
|
|
415
|
-
oe(() =>
|
|
412
|
+
getCurrentPage: G
|
|
413
|
+
} = De(t), {
|
|
414
|
+
getViewColumns: I,
|
|
415
|
+
setColumns: K
|
|
416
|
+
} = ze(t);
|
|
417
|
+
oe(() => G(), (a) => {
|
|
416
418
|
le(() => {
|
|
417
419
|
y({
|
|
418
420
|
seqConfig: {
|
|
419
|
-
startIndex: (a - 1) * (
|
|
421
|
+
startIndex: (a - 1) * (s.value?.pageSize || e(t).pageSize || N)
|
|
420
422
|
}
|
|
421
423
|
});
|
|
422
424
|
});
|
|
@@ -424,8 +426,8 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
|
|
|
424
426
|
immediate: !0
|
|
425
427
|
});
|
|
426
428
|
function y(a) {
|
|
427
|
-
|
|
428
|
-
...e(
|
|
429
|
+
u.value = {
|
|
430
|
+
...e(u),
|
|
429
431
|
...a
|
|
430
432
|
};
|
|
431
433
|
}
|
|
@@ -441,10 +443,10 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
|
|
|
441
443
|
getDataSource: J,
|
|
442
444
|
getRawDataSource: k,
|
|
443
445
|
tableSearch: S
|
|
444
|
-
} =
|
|
446
|
+
} = Re(t, {
|
|
445
447
|
tableData: q,
|
|
446
|
-
setLoading:
|
|
447
|
-
getPaginationInfo:
|
|
448
|
+
setLoading: L,
|
|
449
|
+
getPaginationInfo: s,
|
|
448
450
|
setPagination: f
|
|
449
451
|
}, n);
|
|
450
452
|
function B(a) {
|
|
@@ -454,7 +456,7 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
|
|
|
454
456
|
const {
|
|
455
457
|
onChange: o
|
|
456
458
|
} = e(t);
|
|
457
|
-
o &&
|
|
459
|
+
o && be(o) && o(a);
|
|
458
460
|
}
|
|
459
461
|
const z = {};
|
|
460
462
|
[
|
|
@@ -578,19 +580,19 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
|
|
|
578
580
|
"toolbar-tool-click",
|
|
579
581
|
"zoom"
|
|
580
582
|
].forEach((a) => {
|
|
581
|
-
const o =
|
|
583
|
+
const o = Be.camelCase(`on-${a}`);
|
|
582
584
|
z[o] = (...r) => n(a, ...r);
|
|
583
585
|
});
|
|
584
|
-
const l =
|
|
586
|
+
const l = D(() => {
|
|
585
587
|
const a = e(w), o = {
|
|
586
|
-
...
|
|
588
|
+
...O,
|
|
587
589
|
...e(t),
|
|
588
|
-
columns: re(e(
|
|
590
|
+
columns: re(e(I)),
|
|
589
591
|
loading: e($),
|
|
590
592
|
data: a,
|
|
591
593
|
...z
|
|
592
594
|
};
|
|
593
|
-
if (
|
|
595
|
+
if (pe) {
|
|
594
596
|
(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
597
|
const r = e(t)?.minHeight;
|
|
596
598
|
o.minHeight = r || (r !== 0 && e(t)?.toolbarConfig?.custom ? 300 : void 0);
|
|
@@ -600,6 +602,7 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
|
|
|
600
602
|
result: e(t)?.fetchSetting?.listField,
|
|
601
603
|
total: e(t)?.fetchSetting?.totalField
|
|
602
604
|
},
|
|
605
|
+
autoLoad: !1,
|
|
603
606
|
ajax: {
|
|
604
607
|
query: async () => await v()
|
|
605
608
|
}
|
|
@@ -616,7 +619,7 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
|
|
|
616
619
|
setTableData: x,
|
|
617
620
|
getDataSource: J,
|
|
618
621
|
getDataSourceRef: w,
|
|
619
|
-
setColumns:
|
|
622
|
+
setColumns: K,
|
|
620
623
|
getRawDataSource: k,
|
|
621
624
|
tableSearch: S
|
|
622
625
|
};
|
|
@@ -624,7 +627,7 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
|
|
|
624
627
|
const Q = {
|
|
625
628
|
field: "_filterTableData",
|
|
626
629
|
label: "",
|
|
627
|
-
type:
|
|
630
|
+
type: Ce.Search,
|
|
628
631
|
itemProps: {
|
|
629
632
|
class: "search-all-form-item"
|
|
630
633
|
},
|
|
@@ -635,7 +638,7 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
|
|
|
635
638
|
});
|
|
636
639
|
}
|
|
637
640
|
})
|
|
638
|
-
}, [Z] =
|
|
641
|
+
}, [Z] = ye(_({
|
|
639
642
|
schemas: [l.value?.formOptions?.addSearchAllSchema ? Q : {}],
|
|
640
643
|
rowProps: {
|
|
641
644
|
justify: "start"
|
|
@@ -650,7 +653,7 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
|
|
|
650
653
|
btnText: "搜索"
|
|
651
654
|
},
|
|
652
655
|
actionInline: !0
|
|
653
|
-
},
|
|
656
|
+
}, he(
|
|
654
657
|
l.value?.formOptions,
|
|
655
658
|
["showActionForm", "addSearchAllSchema"]
|
|
656
659
|
// 'union' | 'intersection' | 'concat' | 'replace' = 'union'
|
|
@@ -659,36 +662,33 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
|
|
|
659
662
|
}, ee = () => {
|
|
660
663
|
x(k()), n("form-reset");
|
|
661
664
|
};
|
|
662
|
-
return
|
|
665
|
+
return A({
|
|
663
666
|
table: b,
|
|
664
667
|
pageRef: C,
|
|
665
668
|
...R
|
|
666
|
-
}), (a, o) => (
|
|
667
|
-
fallback:
|
|
668
|
-
default:
|
|
669
|
-
class: ne([e(
|
|
670
|
-
}, [
|
|
669
|
+
}), (a, o) => (p(), m(e(ue), null, {
|
|
670
|
+
fallback: i(() => [c(e(xe))]),
|
|
671
|
+
default: i(() => [H("div", {
|
|
672
|
+
class: ne([e(d).b()])
|
|
673
|
+
}, [c(e(Se), T({
|
|
671
674
|
ref_key: "xGrid",
|
|
672
675
|
ref: b
|
|
673
676
|
}, l.value), {
|
|
674
|
-
toolbarButtons:
|
|
677
|
+
toolbarButtons: i(() => [h(a.$slots, "toolbar-left"), l.value?.formOptions?.showActionForm ? (p(), m(e(ke), {
|
|
675
678
|
key: 0,
|
|
676
679
|
onRegister: e(Z),
|
|
677
680
|
onSubmit: P,
|
|
678
681
|
onReset: ee
|
|
679
682
|
}, 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]])]),
|
|
683
|
+
empty: i(() => [h(a.$slots, "empty", {}, () => [c(e(fe), se(ge(l.value.emptyCfg)), null, 16)])]),
|
|
684
|
+
loading: i(() => [ce(H("div", null, null, 512), [[ie, l.value.loading], [e(me), l.value.loadingCfg]])]),
|
|
685
685
|
_: 3
|
|
686
|
-
}, 16), l.value.showPager ? (
|
|
686
|
+
}, 16), l.value.showPager ? (p(), m(e(ve), T({
|
|
687
687
|
key: 0,
|
|
688
688
|
ref_key: "pageRef",
|
|
689
689
|
ref: C
|
|
690
|
-
}, e(
|
|
691
|
-
class: [e(
|
|
690
|
+
}, e(s), {
|
|
691
|
+
class: [e(d).e("pager"), e(d).m(`pager-${e(s)?.pagePlacement}`)],
|
|
692
692
|
onCurrentChange: o[0] || (o[0] = (r) => B({
|
|
693
693
|
currentPage: r
|
|
694
694
|
})),
|
|
@@ -701,5 +701,5 @@ const He = ["vft-loading-text", "vft-loading-custom-class"], De = O({
|
|
|
701
701
|
}
|
|
702
702
|
});
|
|
703
703
|
export {
|
|
704
|
-
|
|
704
|
+
ra as default
|
|
705
705
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EmptyProps } from 'vft/es/components/empty';
|
|
2
|
+
import type { LoadingOptions } 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?: LoadingOptions;
|
|
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
|
};
|
|
@@ -2,14 +2,14 @@ import "@vueuse/core";
|
|
|
2
2
|
import { isNumber as m, isClient as p } from "@vft/utils";
|
|
3
3
|
import { debugWarn as l } from "../../utils/error.js";
|
|
4
4
|
import "../../components/config-provider/hooks/use-global-config.js";
|
|
5
|
-
import { getCurrentInstance as i, inject as e, computed as c, unref as
|
|
5
|
+
import { ref as v, getCurrentInstance as i, inject as e, computed as c, unref as Z } from "vue";
|
|
6
6
|
import "lodash-es";
|
|
7
7
|
import "../../components/form/index.js";
|
|
8
8
|
const s = {
|
|
9
9
|
current: 0
|
|
10
|
-
}, u =
|
|
10
|
+
}, u = v(0), f = 2e3, d = Symbol("vftZIndexContextKey"), y = Symbol("zIndexContextKey"), K = (I) => {
|
|
11
11
|
const n = i() ? e(d, s) : s, x = I || (i() ? e(y, void 0) : void 0), t = c(() => {
|
|
12
|
-
const r =
|
|
12
|
+
const r = Z(x);
|
|
13
13
|
return m(r) ? r : f;
|
|
14
14
|
}), o = c(() => t.value + u.value), a = () => (n.current++, u.value = n.current, o.value);
|
|
15
15
|
return !p && !e(d) && l(
|
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";
|
|
@@ -62,9 +62,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
62
62
|
readonly placement?: import("@popperjs/core").Placement | undefined;
|
|
63
63
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
64
64
|
readonly effect?: "light" | "dark" | undefined;
|
|
65
|
-
readonly visible?: boolean | null | undefined;
|
|
66
65
|
readonly teleported?: boolean | undefined;
|
|
67
66
|
readonly open?: boolean | undefined;
|
|
67
|
+
readonly visible?: boolean | null | undefined;
|
|
68
68
|
readonly trigger?: import("vft/es/components/tooltip").TooltipTriggerType | undefined;
|
|
69
69
|
readonly arrowOffset?: number | undefined;
|
|
70
70
|
readonly gpuAcceleration?: boolean | undefined;
|
|
@@ -480,9 +480,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
480
480
|
readonly placement?: import("@popperjs/core").Placement | undefined;
|
|
481
481
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
482
482
|
readonly effect?: "light" | "dark" | undefined;
|
|
483
|
-
readonly visible?: boolean | null | undefined;
|
|
484
483
|
readonly teleported?: boolean | undefined;
|
|
485
484
|
readonly open?: boolean | undefined;
|
|
485
|
+
readonly visible?: boolean | null | undefined;
|
|
486
486
|
readonly trigger?: import("vft/es/components/tooltip").TooltipTriggerType | undefined;
|
|
487
487
|
readonly arrowOffset?: number | undefined;
|
|
488
488
|
readonly gpuAcceleration?: boolean | undefined;
|
|
@@ -85,9 +85,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
|
|
|
85
85
|
readonly placement?: import("@popperjs/core").Placement | undefined;
|
|
86
86
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
87
87
|
readonly effect?: "light" | "dark" | undefined;
|
|
88
|
-
readonly visible?: boolean | null | undefined;
|
|
89
88
|
readonly teleported?: boolean | undefined;
|
|
90
89
|
readonly open?: boolean | undefined;
|
|
90
|
+
readonly visible?: boolean | null | undefined;
|
|
91
91
|
readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
|
|
92
92
|
readonly arrowOffset?: number | undefined;
|
|
93
93
|
readonly gpuAcceleration?: boolean | undefined;
|
|
@@ -503,9 +503,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
|
|
|
503
503
|
readonly placement?: import("@popperjs/core").Placement | undefined;
|
|
504
504
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
505
505
|
readonly effect?: "light" | "dark" | undefined;
|
|
506
|
-
readonly visible?: boolean | null | undefined;
|
|
507
506
|
readonly teleported?: boolean | undefined;
|
|
508
507
|
readonly open?: boolean | undefined;
|
|
508
|
+
readonly visible?: boolean | null | undefined;
|
|
509
509
|
readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
|
|
510
510
|
readonly arrowOffset?: number | undefined;
|
|
511
511
|
readonly gpuAcceleration?: boolean | undefined;
|
|
@@ -1006,9 +1006,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
|
|
|
1006
1006
|
readonly placement?: import("@popperjs/core").Placement | undefined;
|
|
1007
1007
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
1008
1008
|
readonly effect?: "light" | "dark" | undefined;
|
|
1009
|
-
readonly visible?: boolean | null | undefined;
|
|
1010
1009
|
readonly teleported?: boolean | undefined;
|
|
1011
1010
|
readonly open?: boolean | undefined;
|
|
1011
|
+
readonly visible?: boolean | null | undefined;
|
|
1012
1012
|
readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
|
|
1013
1013
|
readonly arrowOffset?: number | undefined;
|
|
1014
1014
|
readonly gpuAcceleration?: boolean | undefined;
|
|
@@ -1424,9 +1424,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
|
|
|
1424
1424
|
readonly placement?: import("@popperjs/core").Placement | undefined;
|
|
1425
1425
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
1426
1426
|
readonly effect?: "light" | "dark" | undefined;
|
|
1427
|
-
readonly visible?: boolean | null | undefined;
|
|
1428
1427
|
readonly teleported?: boolean | undefined;
|
|
1429
1428
|
readonly open?: boolean | undefined;
|
|
1429
|
+
readonly visible?: boolean | null | undefined;
|
|
1430
1430
|
readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
|
|
1431
1431
|
readonly arrowOffset?: number | undefined;
|
|
1432
1432
|
readonly gpuAcceleration?: boolean | undefined;
|
|
@@ -1916,9 +1916,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
|
|
|
1916
1916
|
readonly placement?: import("@popperjs/core").Placement | undefined;
|
|
1917
1917
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
1918
1918
|
readonly effect?: "light" | "dark" | undefined;
|
|
1919
|
-
readonly visible?: boolean | null | undefined;
|
|
1920
1919
|
readonly teleported?: boolean | undefined;
|
|
1921
1920
|
readonly open?: boolean | undefined;
|
|
1921
|
+
readonly visible?: boolean | null | undefined;
|
|
1922
1922
|
readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
|
|
1923
1923
|
readonly arrowOffset?: number | undefined;
|
|
1924
1924
|
readonly gpuAcceleration?: boolean | undefined;
|
|
@@ -2334,9 +2334,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
|
|
|
2334
2334
|
readonly placement?: import("@popperjs/core").Placement | undefined;
|
|
2335
2335
|
readonly strategy?: "fixed" | "absolute" | undefined;
|
|
2336
2336
|
readonly effect?: "light" | "dark" | undefined;
|
|
2337
|
-
readonly visible?: boolean | null | undefined;
|
|
2338
2337
|
readonly teleported?: boolean | undefined;
|
|
2339
2338
|
readonly open?: boolean | undefined;
|
|
2339
|
+
readonly visible?: boolean | null | undefined;
|
|
2340
2340
|
readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
|
|
2341
2341
|
readonly arrowOffset?: number | undefined;
|
|
2342
2342
|
readonly gpuAcceleration?: boolean | undefined;
|
|
@@ -24,12 +24,12 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
|
|
|
24
24
|
autofocus: {
|
|
25
25
|
type: import("vue").PropType<boolean>;
|
|
26
26
|
};
|
|
27
|
-
icon: {
|
|
28
|
-
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
29
|
-
};
|
|
30
27
|
dark: {
|
|
31
28
|
type: import("vue").PropType<boolean>;
|
|
32
29
|
};
|
|
30
|
+
icon: {
|
|
31
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
32
|
+
};
|
|
33
33
|
loading: {
|
|
34
34
|
type: import("vue").PropType<boolean>;
|
|
35
35
|
};
|
|
@@ -114,12 +114,12 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
|
|
|
114
114
|
autofocus: {
|
|
115
115
|
type: import("vue").PropType<boolean>;
|
|
116
116
|
};
|
|
117
|
-
icon: {
|
|
118
|
-
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
119
|
-
};
|
|
120
117
|
dark: {
|
|
121
118
|
type: import("vue").PropType<boolean>;
|
|
122
119
|
};
|
|
120
|
+
icon: {
|
|
121
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
122
|
+
};
|
|
123
123
|
loading: {
|
|
124
124
|
type: import("vue").PropType<boolean>;
|
|
125
125
|
};
|
|
@@ -199,12 +199,12 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
|
|
|
199
199
|
autofocus: {
|
|
200
200
|
type: import("vue").PropType<boolean>;
|
|
201
201
|
};
|
|
202
|
-
icon: {
|
|
203
|
-
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
204
|
-
};
|
|
205
202
|
dark: {
|
|
206
203
|
type: import("vue").PropType<boolean>;
|
|
207
204
|
};
|
|
205
|
+
icon: {
|
|
206
|
+
type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
|
|
207
|
+
};
|
|
208
208
|
loading: {
|
|
209
209
|
type: import("vue").PropType<boolean>;
|
|
210
210
|
};
|