vft 0.0.487 → 0.0.493
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/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/es/components/dialog/use-dialog.js +11 -11
- package/es/components/message/message.vue2.js +45 -42
- package/es/components/message/types.d.ts +8 -2
- package/es/components/message/types.js +2 -1
- package/es/components/modal/modal-footer-action.vue.d.ts +1 -1
- package/es/components/modal/modal-footer-action.vue2.js +13 -15
- package/es/components/modal/modal.vue2.js +35 -36
- package/es/components/super-form/index.d.ts +30 -24
- package/es/components/super-form/super-form-item.vue2.js +263 -231
- package/es/components/super-form/super-form.vue.d.ts +3 -1
- package/es/components/super-form/super-form.vue2.js +153 -132
- package/es/components/super-form/types.d.ts +4 -2
- package/es/components/super-form/use/helper.d.ts +34 -0
- package/es/components/super-form/use/helper.js +81 -34
- package/es/components/switch/index.d.ts +1 -0
- package/es/components/switch/switch.vue.d.ts +1 -25
- package/es/components/switch/types.d.ts +25 -0
- package/es/components/switch/types.js +1 -0
- package/es/components/table/index.d.ts +6 -0
- package/es/components/table/table.vue.d.ts +4 -0
- package/es/components/table/table.vue2.js +164 -149
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/es/utils/form-register.d.ts +1 -1
- package/es/utils/form-register.js +1 -1
- package/lib/components/dialog/use-dialog.cjs +1 -1
- package/lib/components/message/message.vue2.cjs +1 -1
- package/lib/components/message/types.cjs +1 -1
- package/lib/components/message/types.d.ts +8 -2
- package/lib/components/modal/modal-footer-action.vue.d.ts +1 -1
- package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
- package/lib/components/modal/modal.vue2.cjs +1 -1
- package/lib/components/super-form/index.d.ts +30 -24
- package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
- package/lib/components/super-form/super-form.vue.d.ts +3 -1
- package/lib/components/super-form/super-form.vue2.cjs +1 -1
- package/lib/components/super-form/types.d.ts +4 -2
- package/lib/components/super-form/use/helper.cjs +1 -1
- package/lib/components/super-form/use/helper.d.ts +34 -0
- package/lib/components/switch/index.d.ts +1 -0
- package/lib/components/switch/switch.vue.d.ts +1 -25
- package/lib/components/switch/types.cjs +1 -0
- package/lib/components/switch/types.d.ts +25 -0
- package/lib/components/table/index.d.ts +6 -0
- package/lib/components/table/table.vue.d.ts +4 -0
- package/lib/components/table/table.vue2.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/lib/utils/form-register.cjs +1 -1
- package/lib/utils/form-register.d.ts +1 -1
- package/package.json +5 -5
- package/tags.json +1 -1
- package/theme-style/index.css +1 -1
- package/theme-style/src/dialog.scss +1 -1
- package/theme-style/src/message.scss +8 -4
- package/theme-style/src/super-form.scss +6 -0
- package/theme-style/src/table.scss +25 -6
- package/theme-style/vft-dialog.css +1 -1
- package/theme-style/vft-message.css +1 -1
- package/theme-style/vft-super-form.css +1 -1
- package/theme-style/vft-table.css +1 -1
- package/web-types.json +1 -1
|
@@ -513,6 +513,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
513
513
|
getRawDataSource: () => import("../types").Recordable[];
|
|
514
514
|
tableSearch: (value: any) => void;
|
|
515
515
|
table: import("vue").Ref<import("./types").TableInstance | undefined, import("./types").TableInstance | undefined>;
|
|
516
|
+
formRef: import("vue").Ref<any, any>;
|
|
516
517
|
pageRef: import("vue").Ref<import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
517
518
|
total: {
|
|
518
519
|
type: import("vue").PropType<number>;
|
|
@@ -1432,6 +1433,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
1432
1433
|
getRawDataSource: () => import("../types").Recordable[];
|
|
1433
1434
|
tableSearch: (value: any) => void;
|
|
1434
1435
|
table: import("vue").Ref<import("./types").TableInstance | undefined, import("./types").TableInstance | undefined>;
|
|
1436
|
+
formRef: import("vue").Ref<any, any>;
|
|
1435
1437
|
pageRef: import("vue").Ref<import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
1436
1438
|
total: {
|
|
1437
1439
|
type: import("vue").PropType<number>;
|
|
@@ -2235,6 +2237,7 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
2235
2237
|
getRawDataSource: () => import("../types").Recordable[];
|
|
2236
2238
|
tableSearch: (value: any) => void;
|
|
2237
2239
|
table: import("vue").Ref<import("./types").TableInstance | undefined, import("./types").TableInstance | undefined>;
|
|
2240
|
+
formRef: import("vue").Ref<any, any>;
|
|
2238
2241
|
pageRef: import("vue").Ref<import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
2239
2242
|
total: {
|
|
2240
2243
|
type: import("vue").PropType<number>;
|
|
@@ -2636,6 +2639,9 @@ export declare const VftTable: import("vft/es/utils").SFCWithInstall<{
|
|
|
2636
2639
|
}, string, {}, {}, string, {}, import("vue").GlobalComponents, import("vue").GlobalDirectives, string, import("vue").ComponentProvideOptions> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps & (new () => {
|
|
2637
2640
|
$slots: {
|
|
2638
2641
|
"toolbar-left"?(_: {}): any;
|
|
2642
|
+
resetBefore?(_: any): any;
|
|
2643
|
+
submitBefore?(_: any): any;
|
|
2644
|
+
submitAfter?(_: any): any;
|
|
2639
2645
|
"toolbar-right"?(_: {}): any;
|
|
2640
2646
|
empty?(_: {}): any;
|
|
2641
2647
|
};
|
|
@@ -3,6 +3,9 @@ import type { TableInstance, TableProps } from './types';
|
|
|
3
3
|
declare function setProps(props: Partial<TableProps>): void;
|
|
4
4
|
declare function __VLS_template(): {
|
|
5
5
|
"toolbar-left"?(_: {}): any;
|
|
6
|
+
resetBefore?(_: any): any;
|
|
7
|
+
submitBefore?(_: any): any;
|
|
8
|
+
submitAfter?(_: any): any;
|
|
6
9
|
"toolbar-right"?(_: {}): any;
|
|
7
10
|
empty?(_: {}): any;
|
|
8
11
|
};
|
|
@@ -22,6 +25,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
22
25
|
getRawDataSource: () => import("../types").Recordable[];
|
|
23
26
|
tableSearch: (value: any) => void;
|
|
24
27
|
table: import("vue").Ref<TableInstance | undefined, TableInstance | undefined>;
|
|
28
|
+
formRef: import("vue").Ref<any, any>;
|
|
25
29
|
pageRef: import("vue").Ref<import("vue").CreateComponentPublicInstanceWithMixins<Readonly<import("vue").ExtractPropTypes<{
|
|
26
30
|
total: {
|
|
27
31
|
type: import("vue").PropType<number>;
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { VftClientOnly as
|
|
3
|
-
import { VftEmpty as
|
|
4
|
-
import { vLoading as
|
|
5
|
-
import { deepMerge as
|
|
6
|
-
import { FormCompEnum as
|
|
1
|
+
import { defineComponent as V, createVNode as c, useAttrs as le, ref as g, getCurrentInstance as re, computed as F, unref as e, watch as ne, nextTick as ie, toRaw as ce, createElementBlock as se, openBlock as C, normalizeClass as ge, withCtx as n, createBlock as T, createCommentVNode as A, mergeProps as E, withDirectives as fe, createElementVNode as de, vShow as ue, renderSlot as s, normalizeProps as u, guardReactiveProps as m, createSlots as me, createTextVNode as pe } from "vue";
|
|
2
|
+
import { VftClientOnly as he } from "../client-only/index.js";
|
|
3
|
+
import { VftEmpty as be } from "../empty/index.js";
|
|
4
|
+
import { vLoading as Ce } from "../loading/directive.js";
|
|
5
|
+
import { deepMerge as N, isClient as ye, omit as we, isFunction as ve } from "@vft/utils";
|
|
6
|
+
import { FormCompEnum as ke } from "../../utils/form-register.js";
|
|
7
7
|
import "@vueuse/core";
|
|
8
8
|
import "../config-provider/hooks/use-global-config.js";
|
|
9
9
|
import "lodash-es";
|
|
10
|
-
import { useForm as
|
|
11
|
-
import { useNamespace as
|
|
10
|
+
import { useForm as xe } from "../super-form/use/use-form.js";
|
|
11
|
+
import { useNamespace as Se } from "../../hooks/use-namespace/index.js";
|
|
12
12
|
import "../../hooks/use-model-toggle/index.js";
|
|
13
13
|
import "@popperjs/core";
|
|
14
14
|
import "../../hooks/use-z-index/index.js";
|
|
15
15
|
import "../icon/index.js";
|
|
16
|
-
import { VftPagination as
|
|
17
|
-
import { VftSkeleton as
|
|
18
|
-
import { VftSuperForm as
|
|
19
|
-
import { VxeGrid as
|
|
20
|
-
import
|
|
21
|
-
import { PageSize as
|
|
22
|
-
import { useColumns as
|
|
23
|
-
import { useDataSource as
|
|
24
|
-
import { useLoading as
|
|
25
|
-
import { usePagination as
|
|
26
|
-
import { EmptyEnum as
|
|
27
|
-
const
|
|
16
|
+
import { VftPagination as Be } from "../pagination/index.js";
|
|
17
|
+
import { VftSkeleton as Re } from "../skeleton/index.js";
|
|
18
|
+
import { VftSuperForm as ze } from "../super-form/index.js";
|
|
19
|
+
import { VxeGrid as Pe } from "vxe-table";
|
|
20
|
+
import De from "xe-utils";
|
|
21
|
+
import { PageSize as O } from "./constants.js";
|
|
22
|
+
import { useColumns as He } from "./use/use-columns.js";
|
|
23
|
+
import { useDataSource as Fe } from "./use/use-data-source.js";
|
|
24
|
+
import { useLoading as Te } from "./use/use-loading.js";
|
|
25
|
+
import { usePagination as Ae } from "./use/use-pagination.js";
|
|
26
|
+
import { EmptyEnum as Ee } from "../empty/constants.js";
|
|
27
|
+
const Ne = V({
|
|
28
28
|
name: "vft-table"
|
|
29
|
-
}),
|
|
30
|
-
...
|
|
29
|
+
}), st = /* @__PURE__ */ V({
|
|
30
|
+
...Ne,
|
|
31
31
|
props: {
|
|
32
32
|
sticky: {
|
|
33
33
|
type: [Boolean, Object]
|
|
34
34
|
},
|
|
35
35
|
api: {},
|
|
36
36
|
pageSize: {
|
|
37
|
-
default:
|
|
37
|
+
default: O
|
|
38
38
|
},
|
|
39
39
|
total: {},
|
|
40
40
|
rowkey: {
|
|
@@ -52,7 +52,7 @@ const Te = N({
|
|
|
52
52
|
beforeFetch: {},
|
|
53
53
|
delEmptyParams: {
|
|
54
54
|
type: [Boolean, String],
|
|
55
|
-
default:
|
|
55
|
+
default: "strict"
|
|
56
56
|
},
|
|
57
57
|
afterFetch: {},
|
|
58
58
|
transformParams: {
|
|
@@ -79,13 +79,13 @@ const Te = N({
|
|
|
79
79
|
onChange: {},
|
|
80
80
|
emptyCfg: {
|
|
81
81
|
default: () => ({
|
|
82
|
-
type:
|
|
82
|
+
type: Ee.NoData
|
|
83
83
|
})
|
|
84
84
|
},
|
|
85
85
|
loadingCfg: {
|
|
86
86
|
default: () => ({
|
|
87
87
|
customClass: "vft-card-loading",
|
|
88
|
-
text: c("div", null, [c("span", null, [
|
|
88
|
+
text: c("div", null, [c("span", null, [pe("加载中")]), c("span", {
|
|
89
89
|
class: "dot"
|
|
90
90
|
}, null)])
|
|
91
91
|
})
|
|
@@ -399,66 +399,66 @@ const Te = N({
|
|
|
399
399
|
"toolbar-tool-click",
|
|
400
400
|
"zoom"
|
|
401
401
|
],
|
|
402
|
-
setup(
|
|
403
|
-
expose:
|
|
404
|
-
emit:
|
|
402
|
+
setup(Oe, {
|
|
403
|
+
expose: $,
|
|
404
|
+
emit: _
|
|
405
405
|
}) {
|
|
406
|
-
const
|
|
407
|
-
getLoading:
|
|
408
|
-
setLoading:
|
|
409
|
-
} =
|
|
410
|
-
getPaginationInfo:
|
|
411
|
-
setPagination:
|
|
412
|
-
getCurrentPage:
|
|
413
|
-
} =
|
|
414
|
-
getViewColumns:
|
|
415
|
-
setColumns:
|
|
416
|
-
} =
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
406
|
+
const i = _, f = Se("table"), q = le(), y = g(), w = g(), M = g([]), p = g(), h = g(), L = re(), a = F(() => N(L.props, e(p))), {
|
|
407
|
+
getLoading: G,
|
|
408
|
+
setLoading: I
|
|
409
|
+
} = Te(a), {
|
|
410
|
+
getPaginationInfo: d,
|
|
411
|
+
setPagination: b,
|
|
412
|
+
getCurrentPage: K
|
|
413
|
+
} = Ae(a), {
|
|
414
|
+
getViewColumns: X,
|
|
415
|
+
setColumns: j
|
|
416
|
+
} = He(a);
|
|
417
|
+
ne(() => K(), (t) => {
|
|
418
|
+
ie(() => {
|
|
419
|
+
v({
|
|
420
420
|
seqConfig: {
|
|
421
|
-
startIndex: (
|
|
421
|
+
startIndex: (t - 1) * (d.value?.pageSize || e(a).pageSize || O)
|
|
422
422
|
}
|
|
423
423
|
});
|
|
424
424
|
});
|
|
425
425
|
}, {
|
|
426
426
|
immediate: !0
|
|
427
427
|
});
|
|
428
|
-
function
|
|
429
|
-
|
|
430
|
-
...e(
|
|
431
|
-
...
|
|
428
|
+
function v(t) {
|
|
429
|
+
p.value = {
|
|
430
|
+
...e(p),
|
|
431
|
+
...t
|
|
432
432
|
};
|
|
433
433
|
}
|
|
434
434
|
const {
|
|
435
|
-
getDataSourceRef:
|
|
436
|
-
handleTableChange:
|
|
437
|
-
reload:
|
|
438
|
-
deleteTableDataRecord:
|
|
439
|
-
insertTableDataRecord:
|
|
440
|
-
updateTableData:
|
|
441
|
-
updateTableDataRecord:
|
|
442
|
-
setTableData:
|
|
443
|
-
getDataSource:
|
|
444
|
-
getRawDataSource:
|
|
445
|
-
tableSearch:
|
|
446
|
-
} =
|
|
447
|
-
tableData:
|
|
448
|
-
setLoading:
|
|
449
|
-
getPaginationInfo:
|
|
450
|
-
setPagination:
|
|
451
|
-
},
|
|
452
|
-
function
|
|
453
|
-
|
|
435
|
+
getDataSourceRef: k,
|
|
436
|
+
handleTableChange: Y,
|
|
437
|
+
reload: x,
|
|
438
|
+
deleteTableDataRecord: W,
|
|
439
|
+
insertTableDataRecord: U,
|
|
440
|
+
updateTableData: J,
|
|
441
|
+
updateTableDataRecord: Q,
|
|
442
|
+
setTableData: S,
|
|
443
|
+
getDataSource: Z,
|
|
444
|
+
getRawDataSource: B,
|
|
445
|
+
tableSearch: R
|
|
446
|
+
} = Fe(a, {
|
|
447
|
+
tableData: M,
|
|
448
|
+
setLoading: I,
|
|
449
|
+
getPaginationInfo: d,
|
|
450
|
+
setPagination: b
|
|
451
|
+
}, i);
|
|
452
|
+
function z(t) {
|
|
453
|
+
t?.pageSize && b({
|
|
454
454
|
currentPage: 1
|
|
455
|
-
}),
|
|
455
|
+
}), Y(t), i("change", t);
|
|
456
456
|
const {
|
|
457
457
|
onChange: o
|
|
458
|
-
} = e(
|
|
459
|
-
o &&
|
|
458
|
+
} = e(a);
|
|
459
|
+
o && ve(o) && o(t);
|
|
460
460
|
}
|
|
461
|
-
const
|
|
461
|
+
const P = {};
|
|
462
462
|
[
|
|
463
463
|
"update:data",
|
|
464
464
|
"keydown-start",
|
|
@@ -579,67 +579,67 @@ const Te = N({
|
|
|
579
579
|
"toolbar-button-click",
|
|
580
580
|
"toolbar-tool-click",
|
|
581
581
|
"zoom"
|
|
582
|
-
].forEach((
|
|
583
|
-
const o =
|
|
584
|
-
|
|
582
|
+
].forEach((t) => {
|
|
583
|
+
const o = De.camelCase(`on-${t}`);
|
|
584
|
+
P[o] = (...l) => i(t, ...l);
|
|
585
585
|
});
|
|
586
|
-
const
|
|
587
|
-
const
|
|
588
|
-
...
|
|
589
|
-
...e(
|
|
590
|
-
columns:
|
|
591
|
-
loading: e(
|
|
592
|
-
data:
|
|
593
|
-
...
|
|
586
|
+
const r = F(() => {
|
|
587
|
+
const t = e(k), o = {
|
|
588
|
+
...q,
|
|
589
|
+
...e(a),
|
|
590
|
+
columns: ce(e(X)),
|
|
591
|
+
loading: e(G),
|
|
592
|
+
data: t,
|
|
593
|
+
...P
|
|
594
594
|
};
|
|
595
|
-
if (
|
|
596
|
-
(e(
|
|
597
|
-
const
|
|
598
|
-
o.minHeight =
|
|
595
|
+
if (ye) {
|
|
596
|
+
(e(a)?.addMaxHeight || e(a)?.maxHeight) && (o.maxHeight = e(a)?.maxHeight ? e(a)?.maxHeight : `${window.innerHeight - e(a)?.extraSysHeight - (a.value?.showPager ? a.value?.pageHeight || 40 : 0)}px`);
|
|
597
|
+
const l = e(a)?.minHeight;
|
|
598
|
+
o.minHeight = l || (l !== 0 && e(a)?.toolbarConfig?.custom ? 300 : void 0);
|
|
599
599
|
}
|
|
600
|
-
return e(
|
|
600
|
+
return e(a)?.toolbarConfig?.refresh && (o.proxyConfig = e(a)?.proxyConfig || {
|
|
601
601
|
response: {
|
|
602
|
-
result: e(
|
|
603
|
-
total: e(
|
|
602
|
+
result: e(a)?.fetchSetting?.listField,
|
|
603
|
+
total: e(a)?.fetchSetting?.totalField
|
|
604
604
|
},
|
|
605
605
|
autoLoad: !1,
|
|
606
606
|
ajax: {
|
|
607
|
-
query: async () => await
|
|
607
|
+
query: async () => await x()
|
|
608
608
|
}
|
|
609
609
|
}), o;
|
|
610
|
-
}),
|
|
611
|
-
setPagination:
|
|
612
|
-
emit:
|
|
613
|
-
setProps:
|
|
614
|
-
reload:
|
|
615
|
-
deleteTableDataRecord:
|
|
616
|
-
insertTableDataRecord:
|
|
617
|
-
updateTableDataRecord:
|
|
618
|
-
updateTableData:
|
|
619
|
-
setTableData:
|
|
620
|
-
getDataSource:
|
|
621
|
-
getDataSourceRef:
|
|
622
|
-
setColumns:
|
|
623
|
-
getRawDataSource:
|
|
624
|
-
tableSearch:
|
|
610
|
+
}), D = {
|
|
611
|
+
setPagination: b,
|
|
612
|
+
emit: i,
|
|
613
|
+
setProps: v,
|
|
614
|
+
reload: x,
|
|
615
|
+
deleteTableDataRecord: W,
|
|
616
|
+
insertTableDataRecord: U,
|
|
617
|
+
updateTableDataRecord: Q,
|
|
618
|
+
updateTableData: J,
|
|
619
|
+
setTableData: S,
|
|
620
|
+
getDataSource: Z,
|
|
621
|
+
getDataSourceRef: k,
|
|
622
|
+
setColumns: j,
|
|
623
|
+
getRawDataSource: B,
|
|
624
|
+
tableSearch: R
|
|
625
625
|
};
|
|
626
|
-
|
|
627
|
-
const
|
|
626
|
+
i("register", D);
|
|
627
|
+
const ee = {
|
|
628
628
|
field: "_filterTableData",
|
|
629
629
|
label: "",
|
|
630
|
-
type:
|
|
630
|
+
type: ke.Search,
|
|
631
631
|
itemProps: {
|
|
632
632
|
class: "search-all-form-item"
|
|
633
633
|
},
|
|
634
634
|
componentProps: () => ({
|
|
635
|
-
onChange: (
|
|
636
|
-
|
|
637
|
-
_filterTableData:
|
|
635
|
+
onChange: (t) => {
|
|
636
|
+
H({
|
|
637
|
+
_filterTableData: t
|
|
638
638
|
});
|
|
639
639
|
}
|
|
640
640
|
})
|
|
641
|
-
},
|
|
642
|
-
schemas: [
|
|
641
|
+
}, te = N({
|
|
642
|
+
schemas: [r.value?.formOptions?.addSearchAllSchema ? ee : {}],
|
|
643
643
|
rowProps: {
|
|
644
644
|
justify: "start"
|
|
645
645
|
},
|
|
@@ -653,53 +653,68 @@ const Te = N({
|
|
|
653
653
|
btnText: "搜索"
|
|
654
654
|
},
|
|
655
655
|
actionInline: !0
|
|
656
|
-
},
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
), "replace")), R = (a) => {
|
|
661
|
-
Reflect.has(a, "_filterTableData") && k(a._filterTableData), n("form-submit", a);
|
|
662
|
-
}, Z = () => {
|
|
663
|
-
v(x()), n("form-reset");
|
|
656
|
+
}, we(r.value?.formOptions, ["showActionForm", "addSearchAllSchema"]), "replace"), [ae] = xe(te), H = (t) => {
|
|
657
|
+
Reflect.has(t, "_filterTableData") && R(t._filterTableData), i("form-submit", t);
|
|
658
|
+
}, oe = () => {
|
|
659
|
+
S(B()), i("form-reset");
|
|
664
660
|
};
|
|
665
|
-
return
|
|
666
|
-
table:
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
661
|
+
return $({
|
|
662
|
+
table: y,
|
|
663
|
+
formRef: h,
|
|
664
|
+
pageRef: w,
|
|
665
|
+
...D
|
|
666
|
+
}), (t, o) => (C(), se("div", {
|
|
667
|
+
class: ge([e(f).b(), {
|
|
668
|
+
[e(f).is("form-exceed-one-rows")]: h.value?.willExceedOneRow
|
|
669
|
+
}])
|
|
670
|
+
}, [c(e(he), null, {
|
|
671
|
+
fallback: n(() => [c(e(Re))]),
|
|
672
|
+
default: n(() => [c(e(Pe), E({
|
|
674
673
|
ref_key: "xGrid",
|
|
675
|
-
ref:
|
|
676
|
-
},
|
|
677
|
-
toolbarButtons:
|
|
674
|
+
ref: y
|
|
675
|
+
}, r.value), {
|
|
676
|
+
toolbarButtons: n(() => [s(t.$slots, "toolbar-left"), r.value?.formOptions?.showActionForm ? (C(), T(e(ze), {
|
|
678
677
|
key: 0,
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
678
|
+
ref_key: "formRef",
|
|
679
|
+
ref: h,
|
|
680
|
+
onRegister: e(ae),
|
|
681
|
+
onSubmit: H,
|
|
682
|
+
onReset: oe
|
|
683
|
+
}, me({
|
|
684
|
+
_: 2
|
|
685
|
+
}, [t.$slots.resetBefore ? {
|
|
686
|
+
name: "resetBefore",
|
|
687
|
+
fn: n((l) => [s(t.$slots, "resetBefore", u(m(l)))]),
|
|
688
|
+
key: "0"
|
|
689
|
+
} : void 0, t.$slots.submitBefore ? {
|
|
690
|
+
name: "submitBefore",
|
|
691
|
+
fn: n((l) => [s(t.$slots, "submitBefore", u(m(l)))]),
|
|
692
|
+
key: "1"
|
|
693
|
+
} : void 0, t.$slots.submitAfter ? {
|
|
694
|
+
name: "submitAfter",
|
|
695
|
+
fn: n((l) => [s(t.$slots, "submitAfter", u(m(l)))]),
|
|
696
|
+
key: "2"
|
|
697
|
+
} : void 0]), 1032, ["onRegister"])) : A("", !0), s(t.$slots, "toolbar-right")]),
|
|
698
|
+
empty: n(() => [s(t.$slots, "empty", {}, () => [c(e(be), u(m(r.value.emptyCfg)), null, 16)])]),
|
|
699
|
+
loading: n(() => [fe(de("div", null, null, 512), [[ue, r.value.loading], [e(Ce), r.value.loadingCfg]])]),
|
|
685
700
|
_: 3
|
|
686
|
-
}, 16),
|
|
701
|
+
}, 16), r.value.showPager ? (C(), T(e(Be), E({
|
|
687
702
|
key: 0,
|
|
688
703
|
ref_key: "pageRef",
|
|
689
|
-
ref:
|
|
690
|
-
}, e(
|
|
691
|
-
class: [e(
|
|
692
|
-
onCurrentChange: o[0] || (o[0] = (
|
|
693
|
-
currentPage:
|
|
704
|
+
ref: w
|
|
705
|
+
}, e(d), {
|
|
706
|
+
class: [e(f).e("pager"), e(f).m(`pager-${e(d)?.pagePlacement}`)],
|
|
707
|
+
onCurrentChange: o[0] || (o[0] = (l) => z({
|
|
708
|
+
currentPage: l
|
|
694
709
|
})),
|
|
695
|
-
onSizeChange: o[1] || (o[1] = (
|
|
696
|
-
pageSize:
|
|
710
|
+
onSizeChange: o[1] || (o[1] = (l) => z({
|
|
711
|
+
pageSize: l
|
|
697
712
|
}))
|
|
698
|
-
}), null, 16, ["class"])) :
|
|
713
|
+
}), null, 16, ["class"])) : A("", !0)]),
|
|
699
714
|
_: 3
|
|
700
715
|
})], 2));
|
|
701
716
|
}
|
|
702
717
|
});
|
|
703
718
|
export {
|
|
704
|
-
|
|
719
|
+
st as default
|
|
705
720
|
};
|
package/es/package.json.d.ts
CHANGED
package/es/package.json.js
CHANGED
|
@@ -22,7 +22,7 @@ export declare const FormCompEnum: {
|
|
|
22
22
|
readonly Switch: "switch";
|
|
23
23
|
readonly Upload: "upload";
|
|
24
24
|
readonly TimePicker: "time-picker";
|
|
25
|
-
readonly TimeRangePicker: "time-picker";
|
|
25
|
+
readonly TimeRangePicker: "time-range-picker";
|
|
26
26
|
readonly YearPicker: "year";
|
|
27
27
|
readonly MonthPicker: "month";
|
|
28
28
|
readonly DatePicker: "date";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../config-provider/index.cjs");const W=require("../../constants/event.cjs"),x=require("@vueuse/core"),f=require("@vft/utils"),X=require("../../utils/helper.cjs"),n=require("vue");require("lodash-es");require("../form/index.cjs");const N=require("../../hooks/use-id/index.cjs"),Y=require("../../hooks/use-lockscreen/index.cjs");require("../../hooks/use-model-toggle/index.cjs");const H=require("../../hooks/use-namespace/index.cjs");require("@popperjs/core");const R=require("../../hooks/use-z-index/index.cjs"),P=require("./constants.cjs"),p=require("../config-provider/hooks/use-global-config.cjs"),ee=(e,l)=>{const i=n.getCurrentInstance().emit,{nextZIndex:d}=R.useZIndex();let L="";const S=N.useId(),$=N.useId(),u=n.ref(!1),v=n.ref(!1),c=n.ref(!1),m=n.ref(e.zIndex??d());let g,y;const E=p.useGlobalConfig(),z=n.computed(()=>E.value?.namespace??H.defaultNamespace),s=n.computed(()=>E.value?.dialog),M=n.computed(()=>{const t={},a=`--${z.value}-dialog`;return e.fullscreen||(e.top&&(t[`${a}-margin-top`]=e.top),e.width&&(t[`${a}-width`]=X.addUnit(e.width))),t}),G=n.computed(()=>(e.draggable??s.value?.draggable??!1)&&!e.fullscreen),O=n.computed(()=>e.alignCenter??s.value?.alignCenter??!1),U=n.computed(()=>e.overflow??s.value?.overflow??!1),k=n.computed(()=>O.value?{display:"flex"}:{}),B=n.computed(()=>{const t=e.transition??s.value?.transition??P.DEFAULT_DIALOG_TRANSITION,a={name:t,onAfterEnter:C,onBeforeLeave:I,onAfterLeave:A};if(f.isObject(t)){const o={...t},b=(r,Q)=>_=>{f.isArray(r)?r.forEach(w=>{f.isFunction(w)&&w(_)}):f.isFunction(r)&&r(_),Q()};return o.onAfterEnter=b(o.onAfterEnter,C),o.onBeforeLeave=b(o.onBeforeLeave,I),o.onAfterLeave=b(o.onAfterLeave,A),o.name||(o.name=P.DEFAULT_DIALOG_TRANSITION),o}return a});function C(){i("opened")}function A(){i("closed"),i(W.UPDATE_MODEL_EVENT,!1),e.destroyOnClose&&(c.value=!1)}function I(){i("close")}function F(){y?.(),g?.(),e.openDelay&&e.openDelay>0?{stop:g}=x.useTimeoutFn(()=>h(),e.openDelay):h()}function q(){g?.(),y?.(),e.closeDelay&&e.closeDelay>0?{stop:y}=x.useTimeoutFn(()=>T(),e.closeDelay):T()}function D(){function t(a){a||(v.value=!0,u.value=!1)}e.beforeClose?e.beforeClose(t):q()}function V(){e.closeOnClickModal&&D()}function h(){x.isClient&&(u.value=!0)}function T(){u.value=!1}function j(){i("openAutoFocus")}function Z(){i("closeAutoFocus")}function J(t){t.detail?.focusReason==="pointer"&&t.preventDefault()}e.lockScroll&&Y.useLockscreen(u);function K(){e.closeOnPressEscape&&D()}return n.watch(()=>e.zIndex,()=>{m.value=e.zIndex??d()}),n.watch(()=>e.modelValue,t=>{t?(v.value=!1,F(),c.value=!0,m.value=e.zIndex??d(),n.nextTick(()=>{i("open"),l.value&&(l.value.parentElement.scrollTop=0,l.value.parentElement.scrollLeft=0,l.value.scrollTop=0)})):u.value&&q()}),n.watch(()=>e.fullscreen,t=>{l.value&&(t?(L=l.value.style.transform,l.value.style.transform=""):l.value.style.transform=L)}),n.onMounted(()=>{e.modelValue&&(u.value=!0,c.value=!0,F())}),{afterEnter:C,afterLeave:A,beforeLeave:I,handleClose:D,onModalClick:V,close:q,doClose:T,onOpenAutoFocus:j,onCloseAutoFocus:Z,onCloseRequested:K,onFocusoutPrevented:J,titleId:S,bodyId:$,closed:v,style:M,overlayDialogStyle:k,rendered:c,visible:u,zIndex:m,transitionConfig:B,_draggable:G,_alignCenter:O,_overflow:U}};exports.useDialog=ee;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../icon/index.cjs"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../icon/index.cjs"),q=require("@vft/constants"),x=require("@vft/use"),y=require("@vft/utils"),p=require("@vueuse/core");require("../config-provider/index.cjs");const C=require("./instance.cjs"),L=require("../config-provider/hooks/use-global-config.cjs"),E=["id"],N=["innerHTML"],V=e.defineComponent({__name:"message",props:{customClass:{},center:{type:Boolean},dangerouslyUseHTMLString:{type:Boolean},duration:{},icon:{},showIcon:{type:Boolean},closeIcon:{},id:{},message:{type:[String,Object,Function]},onClose:{type:Function},showClose:{type:Boolean},type:{},offset:{},zIndex:{},grouping:{type:Boolean},repeatNum:{}},emits:["destroy"],setup(n,{expose:B}){const o=n,{ns:t,zIndex:k}=L.useGlobalComponentSettings("message"),{currentZIndex:h,nextZIndex:w}=k,l=e.ref(),c=e.ref(!1),a=e.ref(0);let u;const b=new Map([["primary",{icon:"icon-info-filled"}],["info",{icon:"icon-info-filled"}],["success",{icon:"icon-success-filled"}],["error",{icon:"icon-circle-close-filled"}],["warning",{icon:"icon-warning-filled"}]]),f=e.computed(()=>y.singleAttrToObj(o.icon,"icon",{icon:b.get(o.type)?.icon})),T=e.computed(()=>y.singleAttrToObj(o.icon,"icon",{icon:"icon-close"})),M=e.computed(()=>{const s=o.type;return{[t.bm("icon",s)]:s}}),S=e.computed(()=>C.getLastOffset(o.id)),d=e.computed(()=>C.getOffsetOrSpace(o.id,o.offset)+S.value),I=e.computed(()=>a.value+d.value),z=e.computed(()=>({top:`${d.value}px`,zIndex:h.value}));function r(){o.duration!==0&&({stop:u}=p.useTimeoutFn(()=>{i()},o.duration))}function m(){u?.()}function i(){c.value=!1}function O({code:s}){s===q.EVENT_CODE.esc&&i()}return e.onMounted(()=>{r(),w(),c.value=!0}),e.watch(()=>o.repeatNum,()=>{m(),r()}),x.useEventListener(document,"keydown",O),p.useResizeObserver(l,()=>{a.value=l.value.getBoundingClientRect().height}),B({visible:c,bottom:I,close:i}),(s,g)=>(e.openBlock(),e.createBlock(e.Transition,{name:e.unref(t).b("fade"),onBeforeLeave:n.onClose,onAfterLeave:g[0]||(g[0]=R=>s.$emit("destroy"))},{default:e.withCtx(()=>[e.withDirectives(e.createElementVNode("div",{id:n.id,ref_key:"messageRef",ref:l,class:e.normalizeClass([e.unref(t).b(),{[e.unref(t).m(n.type)]:n.type&&!n.icon},e.unref(t).is("center",n.center),e.unref(t).is("closable",n.showClose),n.customClass]),style:e.normalizeStyle(z.value),role:"alert",onMouseenter:m,onMouseleave:r},[n.showIcon&&f.value?.icon?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass([e.unref(t).e("icon"),M.value])},[e.createVNode(e.unref(v.VftIcon),e.normalizeProps(e.guardReactiveProps(f.value)),null,16)],2)):e.createCommentVNode("",!0),e.renderSlot(s.$slots,"default",{},()=>[n.dangerouslyUseHTMLString?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(e.unref(t).e("content")),innerHTML:n.message},null,10,N)):(e.openBlock(),e.createElementBlock("p",{key:0,class:e.normalizeClass(e.unref(t).e("content"))},e.toDisplayString(n.message),3))]),n.showClose?(e.openBlock(),e.createBlock(e.unref(v.VftIcon),e.mergeProps({key:1,class:e.unref(t).e("closeBtn")},T.value,{onClick:e.withModifiers(i,["stop"])}),null,16,["class"])):e.createCommentVNode("",!0)],46,E),[[e.vShow,c.value]])]),_:3},8,["name","onBeforeLeave"]))}});exports.default=V;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@vueuse/core"),s=["success","info","warning","error"],o={customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:e.isClient?document.body:void 0};exports.messageDefaults=o;exports.messageTypes=s;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@vueuse/core"),s=["primary","success","info","warning","error"],o={customClass:"",center:!1,dangerouslyUseHTMLString:!1,duration:3e3,icon:void 0,showIcon:!0,id:"",message:"",onClose:void 0,showClose:!1,type:"info",offset:16,zIndex:0,grouping:!1,repeatNum:1,appendTo:e.isClient?document.body:void 0};exports.messageDefaults=o;exports.messageTypes=s;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AppContext, VNode } from 'vue';
|
|
2
|
-
export declare const messageTypes: readonly ["success", "info", "warning", "error"];
|
|
3
|
-
export type MessageType = 'success' | 'warning' | 'info' | 'error';
|
|
2
|
+
export declare const messageTypes: readonly ["primary", "success", "info", "warning", "error"];
|
|
3
|
+
export type MessageType = 'primary' | 'success' | 'warning' | 'info' | 'error';
|
|
4
4
|
export interface MessageConfigContext {
|
|
5
5
|
/** 可同时显示的消息最大数量 */
|
|
6
6
|
max?: number;
|
|
@@ -14,6 +14,8 @@ export interface MessageConfigContext {
|
|
|
14
14
|
duration?: number;
|
|
15
15
|
/** 默认图标 */
|
|
16
16
|
icon?: string;
|
|
17
|
+
/** 默认是否显示图标 */
|
|
18
|
+
showIcon?: boolean;
|
|
17
19
|
/** 默认是否显示关闭按钮 */
|
|
18
20
|
showClose?: boolean;
|
|
19
21
|
/** 默认消息类型 */
|
|
@@ -33,6 +35,7 @@ export declare const messageDefaults: {
|
|
|
33
35
|
dangerouslyUseHTMLString: boolean;
|
|
34
36
|
duration: number;
|
|
35
37
|
icon: undefined;
|
|
38
|
+
showIcon: boolean;
|
|
36
39
|
id: string;
|
|
37
40
|
message: string;
|
|
38
41
|
onClose: undefined;
|
|
@@ -55,6 +58,8 @@ export interface MessageProps {
|
|
|
55
58
|
duration: number;
|
|
56
59
|
/** 自定义图标,该属性会覆盖 type 的图标 */
|
|
57
60
|
icon?: any;
|
|
61
|
+
/** 是否显示图标 */
|
|
62
|
+
showIcon?: boolean;
|
|
58
63
|
/** 自定义关闭图标 */
|
|
59
64
|
closeIcon?: any;
|
|
60
65
|
/** 消息的唯一标识 */
|
|
@@ -94,6 +99,7 @@ export type MessageFn = {
|
|
|
94
99
|
};
|
|
95
100
|
export type MessageTypedFn = (options?: MessageParamsWithType, appContext?: null | AppContext) => MessageHandler;
|
|
96
101
|
export interface Message extends MessageFn {
|
|
102
|
+
primary: MessageTypedFn;
|
|
97
103
|
success: MessageTypedFn;
|
|
98
104
|
warning: MessageTypedFn;
|
|
99
105
|
info: MessageTypedFn;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../row/index.cjs"),i=require("../button/index.cjs");require("
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("../row/index.cjs"),i=require("../button/index.cjs");require("@vueuse/core");require("@vft/utils");require("../config-provider/hooks/use-global-config.cjs");require("lodash-es");require("../form/index.cjs");const a=require("../../hooks/use-namespace/index.cjs");require("../../hooks/use-model-toggle/index.cjs");require("@popperjs/core");require("../../hooks/use-z-index/index.cjs");const l=e.defineComponent({__name:"modal-footer-action",props:{showSubmitButton:{type:Boolean},showCancelButton:{type:Boolean},submitButtonOptions:{},cancelButtonOptions:{},actionRowOptions:{}},setup(t){const o=a.useNamespace("form-action"),s=e.computed(()=>({justify:"end",...t.actionRowOptions})),n=e.computed(()=>Object.assign({btnText:"确认"},t.submitButtonOptions)),r=e.computed(()=>Object.assign({btnText:"取消"},t.cancelButtonOptions));return(u,m)=>(e.openBlock(),e.createBlock(e.unref(c.VftRow),e.normalizeProps(e.guardReactiveProps(s.value)),{default:e.withCtx(()=>[t.showCancelButton?(e.openBlock(),e.createBlock(e.unref(i.VftButton),e.mergeProps({key:0},r.value,{class:e.unref(o).e("cancel")}),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(r.value.btnText),1)]),_:1},16,["class"])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"submitBefore"),t.showSubmitButton?(e.openBlock(),e.createBlock(e.unref(i.VftButton),e.mergeProps({key:1,type:"primary",class:e.unref(o).e("submit")},n.value),{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.value.btnText),1)]),_:1},16,["class"])):e.createCommentVNode("",!0),e.renderSlot(u.$slots,"submitAfter")]),_:3},16))}});exports.default=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),v=require("../dialog/index.cjs"),m=require("@vft/utils"),h=require("./modal-footer-action.vue2.cjs"),V=e.defineComponent({__name:"modal",props:{closeFunc:{},showActionButtonGroup:{type:Boolean,default:!1},confirmLoading:{type:Boolean},loading:{type:Boolean},scrollTop:{type:Boolean},appendToBody:{type:Boolean,default:!1},appendTo:{},beforeClose:{},destroyOnClose:{type:Boolean,default:!1},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},lockScroll:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},openDelay:{default:0},closeDelay:{default:0},top:{},modalPenetrable:{type:Boolean},modelValue:{type:Boolean,default:!1},modalClass:{},width:{},zIndex:{},trapFocus:{type:Boolean,default:!1},overflow:{type:Boolean},transition:{},center:{type:Boolean,default:!1},alignCenter:{type:Boolean,default:!1},closeIcon:{},customClass:{default:""},draggable:{type:Boolean,default:!1},fullscreen:{type:Boolean,default:!1},showClose:{type:Boolean,default:!0},title:{default:""},headerClass:{},bodyClass:{},footerClass:{},showSubmitButton:{type:Boolean,default:!0},showCancelButton:{type:Boolean,default:!0},submitButtonOptions:{},cancelButtonOptions:{},actionRowOptions:{}},emits:["visible-change","close","ok","register","update:modelValue","submit","open","opened","closed","openAutoFocus","closeAutoFocus"],setup(u,{emit:B}){const l=u,n=B,b=e.useAttrs(),c=e.ref(null),s=e.ref(!1),a=e.ref(null),d={setModalProps:f,emitVisible:void 0,redoModalHeight:()=>{e.nextTick(()=>{e.unref(a)&&e.unref(a).setModalHeight()})}},i=e.getCurrentInstance();i&&n("register",d,i.uid);const y=e.computed(()=>({...l,...e.unref(c)})),C=e.computed(()=>({...b,...e.unref(y),modelValue:e.unref(s)}));e.watchEffect(()=>{s.value=!!l.modelValue}),e.watch(()=>e.unref(s),o=>{n("visible-change",o),n("update:modelValue",o),i&&d.emitVisible&&e.nextTick(()=>{d.emitVisible(o,i.uid)}),e.nextTick(()=>{l.scrollTop&&o&&e.unref(a)&&e.unref(a).scrollTop()})},{immediate:!1});async function p(o){if(o?.stopPropagation(),l.closeFunc&&m.isFunction(l.closeFunc)){await l.closeFunc()||f({modelValue:!1});return}f({modelValue:!1}),n("close",o)}function f(o){c.value=m.deepMerge(e.unref(c)||{},o),Reflect.has(o,"modelValue")&&(s.value=!!o.modelValue)}const g=e.computed(()=>({onClick:o=>p(o),...l.cancelButtonOptions})),w=e.computed(()=>({onClick:()=>n("submit"),...l.submitButtonOptions}));return(o,t)=>(e.openBlock(),e.createBlock(e.unref(v.VftDialog),e.mergeProps(C.value,{onClose:p,onOpen:t[0]||(t[0]=r=>n("open")),onOpened:t[1]||(t[1]=r=>n("opened")),onClosed:t[2]||(t[2]=r=>n("closed")),onOpenAutoFocus:t[3]||(t[3]=r=>n("openAutoFocus")),onCloseAutoFocus:t[4]||(t[4]=r=>n("closeAutoFocus"))}),e.createSlots({default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:2},[o.$slots.footer||u.showActionButtonGroup?{name:"footer",fn:e.withCtx(()=>[u.showActionButtonGroup?(e.openBlock(),e.createBlock(h.default,{key:0,"show-cancel-button":u.showCancelButton,"show-submit-button":u.showSubmitButton,"cancel-button-options":g.value,"submit-button-options":w.value},null,8,["show-cancel-button","show-submit-button","cancel-button-options","submit-button-options"])):e.createCommentVNode("",!0)]),key:"0"}:void 0]),1040))}});exports.default=V;
|