vxe-table 4.23.12 → 4.23.13
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/all.esm.js +4789 -4773
- package/dist/all.esm.min.js +3 -3
- package/es/colgroup/index.d.ts +18 -18
- package/es/column/index.d.ts +18 -18
- package/es/grid/index.d.ts +174 -174
- package/es/grid/src/emits.d.ts +1 -1
- package/es/grid/src/emits.js +3 -3
- package/es/grid/src/grid.d.ts +27 -27
- package/es/grid/src/grid.js +10 -10
- package/es/grid/src/props.d.ts +2 -2
- package/es/grid/src/props.js +4 -4
- package/es/index.esm.js +1 -0
- package/es/index.js +1 -0
- package/es/table/index.d.ts +174 -174
- package/es/table/module/custom/panel.js +1588 -1585
- package/es/table/module/export/export-panel.js +587 -584
- package/es/table/module/export/import-panel.js +258 -255
- package/es/table/module/filter/hook.js +1 -15
- package/es/table/module/filter/panel.js +281 -278
- package/es/table/module/menu/panel.js +225 -222
- package/es/table/src/body.js +895 -892
- package/es/table/src/column.d.ts +3 -3
- package/es/table/src/emits.d.ts +1 -1
- package/es/table/src/emits.js +2 -2
- package/es/table/src/footer.d.ts +2 -2
- package/es/table/src/footer.js +341 -338
- package/es/table/src/group.d.ts +3 -3
- package/es/table/src/header.js +539 -536
- package/es/table/src/props.d.ts +2 -2
- package/es/table/src/props.js +2 -2
- package/es/table/src/table.d.ts +27 -27
- package/es/table/src/table.js +15 -10
- package/es/toolbar/index.d.ts +18 -18
- package/es/toolbar/src/toolbar.d.ts +3 -3
- package/es/ui/index.js +1 -1
- package/es/ui/src/dom.d.ts +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/ui/src/vn.d.ts +2 -2
- package/lib/colgroup/index.d.ts +760 -0
- package/lib/column/index.d.ts +760 -0
- package/lib/components.d.ts +13 -0
- package/lib/grid/index.d.ts +2824 -0
- package/lib/grid/src/emits.d.ts +2 -0
- package/lib/grid/src/emits.js +2 -2
- package/lib/grid/src/grid.d.ts +556 -0
- package/lib/grid/src/grid.js +6 -6
- package/lib/grid/src/props.d.ts +200 -0
- package/lib/grid/src/props.js +3 -3
- package/lib/index.common.js +1 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +1 -0
- package/lib/index.umd.js +4789 -4773
- package/lib/index.umd.min.js +3 -3
- package/lib/locale/ar-EG.umd.d.ts +908 -0
- package/lib/locale/de-DE.umd.d.ts +908 -0
- package/lib/locale/en-US.umd.d.ts +908 -0
- package/lib/locale/es-ES.umd.d.ts +908 -0
- package/lib/locale/fr-FR.umd.d.ts +908 -0
- package/lib/locale/hu-HU.umd.d.ts +908 -0
- package/lib/locale/hy-AM.umd.d.ts +908 -0
- package/lib/locale/id-ID.umd.d.ts +908 -0
- package/lib/locale/it-IT.umd.d.ts +908 -0
- package/lib/locale/ja-JP.umd.d.ts +908 -0
- package/lib/locale/ko-KR.umd.d.ts +908 -0
- package/lib/locale/lang/ar-EG.d.ts +908 -0
- package/lib/locale/lang/ar-EG.umd.d.ts +908 -0
- package/lib/locale/lang/de-DE.d.ts +908 -0
- package/lib/locale/lang/de-DE.umd.d.ts +908 -0
- package/lib/locale/lang/en-US.d.ts +908 -0
- package/lib/locale/lang/en-US.umd.d.ts +908 -0
- package/lib/locale/lang/es-ES.d.ts +908 -0
- package/lib/locale/lang/es-ES.umd.d.ts +908 -0
- package/lib/locale/lang/fr-FR.d.ts +908 -0
- package/lib/locale/lang/fr-FR.umd.d.ts +908 -0
- package/lib/locale/lang/hu-HU.d.ts +908 -0
- package/lib/locale/lang/hu-HU.umd.d.ts +908 -0
- package/lib/locale/lang/hy-AM.d.ts +908 -0
- package/lib/locale/lang/hy-AM.umd.d.ts +908 -0
- package/lib/locale/lang/id-ID.d.ts +908 -0
- package/lib/locale/lang/id-ID.umd.d.ts +908 -0
- package/lib/locale/lang/it-IT.d.ts +908 -0
- package/lib/locale/lang/it-IT.umd.d.ts +908 -0
- package/lib/locale/lang/ja-JP.d.ts +908 -0
- package/lib/locale/lang/ja-JP.umd.d.ts +908 -0
- package/lib/locale/lang/ko-KR.d.ts +908 -0
- package/lib/locale/lang/ko-KR.umd.d.ts +908 -0
- package/lib/locale/lang/ms-MY.d.ts +908 -0
- package/lib/locale/lang/ms-MY.umd.d.ts +908 -0
- package/lib/locale/lang/nb-NO.d.ts +908 -0
- package/lib/locale/lang/nb-NO.umd.d.ts +908 -0
- package/lib/locale/lang/pt-BR.d.ts +908 -0
- package/lib/locale/lang/pt-BR.umd.d.ts +908 -0
- package/lib/locale/lang/ru-RU.d.ts +908 -0
- package/lib/locale/lang/ru-RU.umd.d.ts +908 -0
- package/lib/locale/lang/th-TH.d.ts +908 -0
- package/lib/locale/lang/th-TH.umd.d.ts +908 -0
- package/lib/locale/lang/ug-CN.d.ts +908 -0
- package/lib/locale/lang/ug-CN.umd.d.ts +908 -0
- package/lib/locale/lang/uk-UA.d.ts +908 -0
- package/lib/locale/lang/uk-UA.umd.d.ts +908 -0
- package/lib/locale/lang/uz-UZ.d.ts +908 -0
- package/lib/locale/lang/uz-UZ.umd.d.ts +908 -0
- package/lib/locale/lang/vi-VN.d.ts +908 -0
- package/lib/locale/lang/vi-VN.umd.d.ts +908 -0
- package/lib/locale/lang/zh-CHT.d.ts +908 -0
- package/lib/locale/lang/zh-CHT.umd.d.ts +908 -0
- package/lib/locale/lang/zh-CN.d.ts +908 -0
- package/lib/locale/lang/zh-CN.umd.d.ts +908 -0
- package/lib/locale/lang/zh-HK.d.ts +908 -0
- package/lib/locale/lang/zh-HK.umd.d.ts +908 -0
- package/lib/locale/lang/zh-MO.d.ts +908 -0
- package/lib/locale/lang/zh-MO.umd.d.ts +908 -0
- package/lib/locale/lang/zh-TC.d.ts +908 -0
- package/lib/locale/lang/zh-TC.umd.d.ts +908 -0
- package/lib/locale/lang/zh-TW.d.ts +908 -0
- package/lib/locale/lang/zh-TW.umd.d.ts +908 -0
- package/lib/locale/ms-MY.umd.d.ts +908 -0
- package/lib/locale/nb-NO.umd.d.ts +908 -0
- package/lib/locale/pt-BR.umd.d.ts +908 -0
- package/lib/locale/ru-RU.umd.d.ts +908 -0
- package/lib/locale/th-TH.umd.d.ts +908 -0
- package/lib/locale/ug-CN.umd.d.ts +908 -0
- package/lib/locale/uk-UA.umd.d.ts +908 -0
- package/lib/locale/uz-UZ.umd.d.ts +908 -0
- package/lib/locale/vi-VN.umd.d.ts +908 -0
- package/lib/locale/zh-CHT.umd.d.ts +908 -0
- package/lib/locale/zh-CN.umd.d.ts +908 -0
- package/lib/locale/zh-HK.umd.d.ts +908 -0
- package/lib/locale/zh-MO.umd.d.ts +908 -0
- package/lib/locale/zh-TC.umd.d.ts +908 -0
- package/lib/locale/zh-TW.umd.d.ts +908 -0
- package/lib/table/index.d.ts +2672 -0
- package/lib/table/module/custom/hook.d.ts +1 -0
- package/lib/table/module/custom/panel.d.ts +17 -0
- package/lib/table/module/custom/panel.js +1588 -1585
- package/lib/table/module/edit/hook.d.ts +1 -0
- package/lib/table/module/export/export-panel.d.ts +27 -0
- package/lib/table/module/export/export-panel.js +587 -584
- package/lib/table/module/export/hook.d.ts +1 -0
- package/lib/table/module/export/import-panel.d.ts +27 -0
- package/lib/table/module/export/import-panel.js +258 -255
- package/lib/table/module/export/util.d.ts +5 -0
- package/lib/table/module/filter/hook.d.ts +1 -0
- package/lib/table/module/filter/hook.js +1 -15
- package/lib/table/module/filter/panel.d.ts +16 -0
- package/lib/table/module/filter/panel.js +281 -278
- package/lib/table/module/keyboard/hook.d.ts +1 -0
- package/lib/table/module/menu/hook.d.ts +1 -0
- package/lib/table/module/menu/panel.d.ts +2 -0
- package/lib/table/module/menu/panel.js +225 -222
- package/lib/table/module/validator/hook.d.ts +1 -0
- package/lib/table/render/index.d.ts +1 -0
- package/lib/table/src/body.d.ts +24 -0
- package/lib/table/src/body.js +895 -892
- package/lib/table/src/cell.d.ts +192 -0
- package/lib/table/src/column.d.ts +263 -0
- package/lib/table/src/columnInfo.d.ts +13 -0
- package/lib/table/src/emits.d.ts +2 -0
- package/lib/table/src/emits.js +2 -2
- package/lib/table/src/footer.d.ts +45 -0
- package/lib/table/src/footer.js +341 -338
- package/lib/table/src/group.d.ts +178 -0
- package/lib/table/src/header.d.ts +26 -0
- package/lib/table/src/header.js +539 -536
- package/lib/table/src/props.d.ts +238 -0
- package/lib/table/src/props.js +2 -2
- package/lib/table/src/store.d.ts +6 -0
- package/lib/table/src/table.d.ts +539 -0
- package/lib/table/src/table.js +13 -8
- package/lib/table/src/use/cell-view.d.ts +10 -0
- package/lib/table/src/use/index.d.ts +1 -0
- package/lib/table/src/util.d.ts +74 -0
- package/lib/toolbar/index.d.ts +340 -0
- package/lib/toolbar/src/toolbar.d.ts +75 -0
- package/lib/ui/index.d.ts +85 -0
- package/lib/ui/index.js +1 -1
- package/lib/ui/src/anime.d.ts +10 -0
- package/lib/ui/src/comp.d.ts +2 -0
- package/lib/ui/src/dom.d.ts +80 -0
- package/lib/ui/src/log.d.ts +6 -0
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/utils.d.ts +23 -0
- package/lib/ui/src/vn.d.ts +7 -0
- package/lib/v-x-e-table/index.d.ts +2 -0
- package/lib/vxe-colgroup/index.d.ts +3 -0
- package/lib/vxe-column/index.d.ts +3 -0
- package/lib/vxe-grid/index.d.ts +3 -0
- package/lib/vxe-table/index.d.ts +3 -0
- package/lib/vxe-toolbar/index.d.ts +3 -0
- package/lib/vxe-ui/index.d.ts +3 -0
- package/package.json +2 -2
- package/packages/grid/src/emits.ts +2 -2
- package/packages/grid/src/grid.ts +8 -8
- package/packages/grid/src/props.ts +3 -3
- package/packages/index.ts +2 -2
- package/packages/table/module/custom/panel.ts +2 -2
- package/packages/table/module/export/export-panel.ts +2 -2
- package/packages/table/module/export/import-panel.ts +2 -2
- package/packages/table/module/filter/hook.ts +1 -15
- package/packages/table/module/filter/panel.ts +2 -2
- package/packages/table/module/menu/panel.ts +2 -2
- package/packages/table/src/body.ts +2 -2
- package/packages/table/src/emits.ts +1 -1
- package/packages/table/src/footer.ts +2 -2
- package/packages/table/src/header.ts +2 -2
- package/packages/table/src/props.ts +1 -1
- package/packages/table/src/table.ts +21 -33
- /package/dist/{iconfont.1793090564415.ttf → iconfont.1793627868721.ttf} +0 -0
- /package/dist/{iconfont.1793090564415.woff → iconfont.1793627868721.woff} +0 -0
- /package/dist/{iconfont.1793090564415.woff2 → iconfont.1793627868721.woff2} +0 -0
- /package/es/{iconfont.1793090564415.ttf → iconfont.1793627868721.ttf} +0 -0
- /package/es/{iconfont.1793090564415.woff → iconfont.1793627868721.woff} +0 -0
- /package/es/{iconfont.1793090564415.woff2 → iconfont.1793627868721.woff2} +0 -0
- /package/lib/{iconfont.1793090564415.ttf → iconfont.1793627868721.ttf} +0 -0
- /package/lib/{iconfont.1793090564415.woff → iconfont.1793627868721.woff} +0 -0
- /package/lib/{iconfont.1793090564415.woff2 → iconfont.1793627868721.woff2} +0 -0
|
@@ -8,311 +8,314 @@ import { createComponentLog } from "../../../ui/src/log";
|
|
|
8
8
|
import XEUtils from "xe-utils";
|
|
9
9
|
const { warnLog } = createComponentLog("table");
|
|
10
10
|
const { getI18n, getIcon, renderer, renderEmptyElement } = VxeUI;
|
|
11
|
-
var panel_default =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
setup(props, context) {
|
|
20
|
-
const xID = XEUtils.uniqueId();
|
|
21
|
-
const VxeUIScrollbarComponent = VxeUI.getComponent("VxeScrollbar");
|
|
22
|
-
const $xeTable = inject("$xeTable", {});
|
|
23
|
-
const { reactData: tableReactData, internalData: tableInternalData, getComputeMaps } = $xeTable;
|
|
24
|
-
const { computeFilterOpts, computeRendererOpts } = getComputeMaps();
|
|
25
|
-
const refElem = ref();
|
|
26
|
-
const refMaps = {
|
|
27
|
-
refElem
|
|
28
|
-
};
|
|
29
|
-
const $xeFilterPanel = {
|
|
30
|
-
xID,
|
|
31
|
-
props,
|
|
32
|
-
context,
|
|
33
|
-
getRefMaps: () => refMaps
|
|
34
|
-
};
|
|
35
|
-
const computeHasCheckOption = computed(() => {
|
|
36
|
-
const { filterStore } = props;
|
|
37
|
-
const { column } = filterStore;
|
|
38
|
-
return column && column.filters && column.filters.some((option) => option.checked);
|
|
39
|
-
});
|
|
40
|
-
const filterCheckAllEvent = (evnt, value) => {
|
|
41
|
-
const { filterStore } = props;
|
|
42
|
-
const { column } = filterStore;
|
|
43
|
-
if (column && column.filters) {
|
|
44
|
-
column.filters.forEach((option) => {
|
|
45
|
-
option._checked = value;
|
|
46
|
-
option.checked = value;
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
filterStore.isAllSelected = value;
|
|
50
|
-
filterStore.isIndeterminate = false;
|
|
51
|
-
};
|
|
52
|
-
const confirmFilter = (evnt) => {
|
|
53
|
-
const { filterStore } = props;
|
|
54
|
-
if (!evnt) {
|
|
55
|
-
warnLog("vxe.error.delFunc", ["confirmFilter", "saveFilterPanelByEvent"]);
|
|
11
|
+
var panel_default = (
|
|
12
|
+
/* define-vxe-component start */
|
|
13
|
+
defineVxeComponent({
|
|
14
|
+
name: "VxeTableFilterPanel",
|
|
15
|
+
props: {
|
|
16
|
+
filterStore: {
|
|
17
|
+
type: Object,
|
|
18
|
+
default: () => ({})
|
|
56
19
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
const
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
20
|
+
},
|
|
21
|
+
setup(props, context) {
|
|
22
|
+
const xID = XEUtils.uniqueId();
|
|
23
|
+
const VxeUIScrollbarComponent = VxeUI.getComponent("VxeScrollbar");
|
|
24
|
+
const $xeTable = inject("$xeTable", {});
|
|
25
|
+
const { reactData: tableReactData, internalData: tableInternalData, getComputeMaps } = $xeTable;
|
|
26
|
+
const { computeFilterOpts, computeRendererOpts } = getComputeMaps();
|
|
27
|
+
const refElem = ref();
|
|
28
|
+
const refMaps = {
|
|
29
|
+
refElem
|
|
30
|
+
};
|
|
31
|
+
const $xeFilterPanel = {
|
|
32
|
+
xID,
|
|
33
|
+
props,
|
|
34
|
+
context,
|
|
35
|
+
getRefMaps: () => refMaps
|
|
36
|
+
};
|
|
37
|
+
const computeHasCheckOption = computed(() => {
|
|
38
|
+
const { filterStore } = props;
|
|
39
|
+
const { column } = filterStore;
|
|
40
|
+
return column && column.filters && column.filters.some((option) => option.checked);
|
|
41
|
+
});
|
|
42
|
+
const filterCheckAllEvent = (evnt, value) => {
|
|
43
|
+
const { filterStore } = props;
|
|
44
|
+
const { column } = filterStore;
|
|
45
|
+
if (column && column.filters) {
|
|
46
|
+
column.filters.forEach((option) => {
|
|
47
|
+
option._checked = value;
|
|
48
|
+
option.checked = value;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
filterStore.isAllSelected = value;
|
|
52
|
+
filterStore.isIndeterminate = false;
|
|
53
|
+
};
|
|
54
|
+
const confirmFilter = (evnt) => {
|
|
55
|
+
const { filterStore } = props;
|
|
56
|
+
if (!evnt) {
|
|
57
|
+
warnLog("vxe.error.delFunc", ["confirmFilter", "saveFilterPanelByEvent"]);
|
|
58
|
+
}
|
|
59
|
+
$xeTable.handleFilterConfirmFilter(evnt || new Event("click"), filterStore.column || null);
|
|
60
|
+
};
|
|
61
|
+
const changeRadioOption = (evnt, checked, item) => {
|
|
62
|
+
$xeTable.handleFilterChangeRadioOption(evnt, checked, item);
|
|
63
|
+
};
|
|
64
|
+
const resetFilter = (evnt) => {
|
|
65
|
+
const { filterStore } = props;
|
|
66
|
+
$xeTable.handleFilterResetFilter(evnt, filterStore.column || null);
|
|
67
|
+
};
|
|
68
|
+
const changeMultipleOption = (evnt, checked, item) => {
|
|
69
|
+
$xeTable.handleFilterChangeMultipleOption(evnt, checked, item);
|
|
70
|
+
};
|
|
71
|
+
const changeOption = (evnt, checked, item) => {
|
|
72
|
+
$xeTable.handleFilterChangeOption(evnt, checked, item);
|
|
73
|
+
};
|
|
74
|
+
const changeAllOption = (evnt, checked) => {
|
|
75
|
+
const { filterStore } = props;
|
|
76
|
+
const { column } = filterStore;
|
|
77
|
+
if (column && column.filterMultiple) {
|
|
78
|
+
filterCheckAllEvent(evnt, checked);
|
|
79
|
+
} else {
|
|
80
|
+
resetFilter(evnt);
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
const filterPanelMethods = {
|
|
84
|
+
changeRadioOption,
|
|
85
|
+
changeMultipleOption,
|
|
86
|
+
changeAllOption,
|
|
87
|
+
changeOption,
|
|
88
|
+
confirmFilter,
|
|
89
|
+
resetFilter
|
|
90
|
+
};
|
|
91
|
+
Object.assign($xeFilterPanel, filterPanelMethods);
|
|
92
|
+
const renderOptions = (filterRender, compConf) => {
|
|
93
|
+
const { filterStore } = props;
|
|
94
|
+
const { column } = filterStore;
|
|
95
|
+
if (!column) {
|
|
96
|
+
return [];
|
|
97
|
+
}
|
|
98
|
+
const filterOpts = computeFilterOpts.value;
|
|
99
|
+
const { useScrollbar } = filterOpts;
|
|
100
|
+
const { filterMultiple, filters, slots } = column;
|
|
101
|
+
const filterOptions = filters || [];
|
|
102
|
+
const filterSlot = slots ? slots.filter : null;
|
|
103
|
+
const params = Object.assign({}, tableInternalData._currFilterParams, { option: filterOptions[0], $panel: $xeFilterPanel, $table: $xeTable });
|
|
104
|
+
const rtFilter = compConf ? compConf.renderTableFilter || compConf.renderFilter : null;
|
|
105
|
+
if (filterSlot) {
|
|
106
|
+
return [
|
|
107
|
+
h(
|
|
108
|
+
"div",
|
|
109
|
+
{
|
|
110
|
+
class: "vxe-table--filter-template"
|
|
111
|
+
},
|
|
112
|
+
$xeTable.callSlot(filterSlot, params)
|
|
113
|
+
)
|
|
114
|
+
];
|
|
115
|
+
} else if (filterRender && rtFilter) {
|
|
116
|
+
return [
|
|
117
|
+
h(
|
|
118
|
+
"div",
|
|
119
|
+
{
|
|
120
|
+
class: "vxe-table--filter-template"
|
|
121
|
+
},
|
|
122
|
+
getSlotVNs(rtFilter(filterRender, params))
|
|
123
|
+
)
|
|
124
|
+
];
|
|
125
|
+
}
|
|
126
|
+
const isAllChecked = filterMultiple ? filterStore.isAllSelected : !filterOptions.some((item) => item._checked);
|
|
127
|
+
const isAllIndeterminate = filterMultiple && filterStore.isIndeterminate;
|
|
128
|
+
const optVNs = filterOptions.map((item) => {
|
|
129
|
+
const isChecked = item._checked;
|
|
130
|
+
const isIndeterminate = false;
|
|
131
|
+
return h(
|
|
132
|
+
"div",
|
|
133
|
+
{
|
|
134
|
+
class: [
|
|
135
|
+
"vxe-table--filter-option",
|
|
136
|
+
{
|
|
137
|
+
"is--checked": item._checked
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
title: item.label,
|
|
141
|
+
onClick: (evnt) => {
|
|
142
|
+
changeOption(evnt, !item._checked, item);
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
(filterMultiple ? [
|
|
146
|
+
h("span", {
|
|
147
|
+
class: ["vxe-checkbox--icon", isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
148
|
+
})
|
|
149
|
+
] : []).concat([
|
|
150
|
+
h(
|
|
151
|
+
"span",
|
|
152
|
+
{
|
|
153
|
+
class: "vxe-checkbox--label"
|
|
154
|
+
},
|
|
155
|
+
formatText(item.label, 1)
|
|
156
|
+
)
|
|
157
|
+
])
|
|
158
|
+
);
|
|
159
|
+
});
|
|
104
160
|
return [
|
|
105
161
|
h(
|
|
106
162
|
"div",
|
|
107
163
|
{
|
|
108
|
-
class: "vxe-table--filter-
|
|
164
|
+
class: "vxe-table--filter-header"
|
|
165
|
+
},
|
|
166
|
+
[
|
|
167
|
+
h(
|
|
168
|
+
"div",
|
|
169
|
+
{
|
|
170
|
+
class: [
|
|
171
|
+
"vxe-table--filter-option",
|
|
172
|
+
{
|
|
173
|
+
"is--checked": isAllChecked,
|
|
174
|
+
"is--indeterminate": isAllIndeterminate
|
|
175
|
+
}
|
|
176
|
+
],
|
|
177
|
+
title: getI18n(filterMultiple ? "vxe.table.allTitle" : "vxe.table.allFilter"),
|
|
178
|
+
onClick: (evnt) => {
|
|
179
|
+
changeAllOption(evnt, !filterStore.isAllSelected);
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
(filterMultiple ? [
|
|
183
|
+
h("span", {
|
|
184
|
+
class: ["vxe-checkbox--icon", isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
185
|
+
})
|
|
186
|
+
] : []).concat([
|
|
187
|
+
h(
|
|
188
|
+
"span",
|
|
189
|
+
{
|
|
190
|
+
class: "vxe-checkbox--label"
|
|
191
|
+
},
|
|
192
|
+
getI18n("vxe.table.allFilter")
|
|
193
|
+
)
|
|
194
|
+
])
|
|
195
|
+
)
|
|
196
|
+
]
|
|
197
|
+
),
|
|
198
|
+
useScrollbar ? h(
|
|
199
|
+
VxeUIScrollbarComponent,
|
|
200
|
+
{
|
|
201
|
+
class: "vxe-table--scrollbar-filter-body",
|
|
202
|
+
viewClassName: "vxe-table--scrollbar-filter-body-view"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
default: () => optVNs
|
|
206
|
+
}
|
|
207
|
+
) : h(
|
|
208
|
+
"div",
|
|
209
|
+
{
|
|
210
|
+
class: "vxe-table--filter-body"
|
|
109
211
|
},
|
|
110
|
-
|
|
212
|
+
optVNs
|
|
111
213
|
)
|
|
112
214
|
];
|
|
113
|
-
}
|
|
114
|
-
|
|
215
|
+
};
|
|
216
|
+
const renderFooters = () => {
|
|
217
|
+
const { filterStore } = props;
|
|
218
|
+
const { column } = filterStore;
|
|
219
|
+
if (!column) {
|
|
220
|
+
return [];
|
|
221
|
+
}
|
|
222
|
+
const filterOpts = computeFilterOpts.value;
|
|
223
|
+
const rendererOpts = computeRendererOpts.value;
|
|
224
|
+
const hasCheckOption = computeHasCheckOption.value;
|
|
225
|
+
const { filterRender, filterMultiple } = column;
|
|
226
|
+
const { confirmButtonText, resetButtonText, showFooter } = filterOpts;
|
|
227
|
+
const compConf = filterRender && isEnableConf(filterRender) && filterRender.name ? rendererOpts[filterRender.name] || renderer.get(filterRender.name) : null;
|
|
228
|
+
const isDisabled = !hasCheckOption && !filterStore.isAllSelected && !filterStore.isIndeterminate;
|
|
229
|
+
let showFlFoot = !!filterMultiple;
|
|
230
|
+
if (XEUtils.isBoolean(showFooter)) {
|
|
231
|
+
showFlFoot = showFooter;
|
|
232
|
+
} else if (compConf) {
|
|
233
|
+
showFlFoot = !(compConf.showTableFilterFooter === false || compConf.showFilterFooter === false || compConf.isFooter === false);
|
|
234
|
+
}
|
|
235
|
+
return showFlFoot ? [
|
|
115
236
|
h(
|
|
116
237
|
"div",
|
|
117
238
|
{
|
|
118
|
-
class: "vxe-table--filter-
|
|
239
|
+
class: "vxe-table--filter-footer"
|
|
119
240
|
},
|
|
120
|
-
|
|
241
|
+
[
|
|
242
|
+
h(
|
|
243
|
+
"button",
|
|
244
|
+
{
|
|
245
|
+
class: {
|
|
246
|
+
"is--disabled": isDisabled
|
|
247
|
+
},
|
|
248
|
+
disabled: isDisabled,
|
|
249
|
+
onClick: confirmFilter
|
|
250
|
+
},
|
|
251
|
+
confirmButtonText || getI18n("vxe.table.confirmFilter")
|
|
252
|
+
),
|
|
253
|
+
h(
|
|
254
|
+
"button",
|
|
255
|
+
{
|
|
256
|
+
onClick: resetFilter
|
|
257
|
+
},
|
|
258
|
+
resetButtonText || getI18n("vxe.table.resetFilter")
|
|
259
|
+
)
|
|
260
|
+
]
|
|
121
261
|
)
|
|
122
|
-
];
|
|
123
|
-
}
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
|
|
262
|
+
] : [];
|
|
263
|
+
};
|
|
264
|
+
const renderVN = () => {
|
|
265
|
+
const { filterStore } = props;
|
|
266
|
+
const { initStore } = tableReactData;
|
|
267
|
+
const { visible, column } = filterStore;
|
|
268
|
+
if (!column) {
|
|
269
|
+
return renderEmptyElement($xeFilterPanel);
|
|
270
|
+
}
|
|
271
|
+
const rendererOpts = computeRendererOpts.value;
|
|
272
|
+
const filterRender = column ? column.filterRender : null;
|
|
273
|
+
const compConf = filterRender && isEnableConf(filterRender) && filterRender.name ? rendererOpts[filterRender.name] || renderer.get(filterRender.name) : null;
|
|
274
|
+
const filterClassName = compConf ? compConf.tableFilterClassName || compConf.filterClassName : "";
|
|
275
|
+
const params = Object.assign({}, tableInternalData._currFilterParams, { $panel: $xeFilterPanel, $table: $xeTable });
|
|
276
|
+
const tableProps = $xeTable.props;
|
|
277
|
+
const { computeSize } = $xeTable.getComputeMaps();
|
|
278
|
+
const vSize = computeSize.value;
|
|
279
|
+
const filterOpts = computeFilterOpts.value;
|
|
280
|
+
const { transfer, destroyOnClose, className } = filterOpts;
|
|
129
281
|
return h(
|
|
130
|
-
|
|
282
|
+
Teleport,
|
|
131
283
|
{
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
{
|
|
135
|
-
"is--checked": item._checked
|
|
136
|
-
}
|
|
137
|
-
],
|
|
138
|
-
title: item.label,
|
|
139
|
-
onClick: (evnt) => {
|
|
140
|
-
changeOption(evnt, !item._checked, item);
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
(filterMultiple ? [
|
|
144
|
-
h("span", {
|
|
145
|
-
class: ["vxe-checkbox--icon", isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
146
|
-
})
|
|
147
|
-
] : []).concat([
|
|
148
|
-
h(
|
|
149
|
-
"span",
|
|
150
|
-
{
|
|
151
|
-
class: "vxe-checkbox--label"
|
|
152
|
-
},
|
|
153
|
-
formatText(item.label, 1)
|
|
154
|
-
)
|
|
155
|
-
])
|
|
156
|
-
);
|
|
157
|
-
});
|
|
158
|
-
return [
|
|
159
|
-
h(
|
|
160
|
-
"div",
|
|
161
|
-
{
|
|
162
|
-
class: "vxe-table--filter-header"
|
|
284
|
+
to: "body",
|
|
285
|
+
disabled: !transfer
|
|
163
286
|
},
|
|
164
287
|
[
|
|
165
288
|
h(
|
|
166
289
|
"div",
|
|
167
290
|
{
|
|
291
|
+
ref: refElem,
|
|
168
292
|
class: [
|
|
169
|
-
"vxe-table--filter-
|
|
293
|
+
"vxe-table--filter-wrapper",
|
|
294
|
+
"filter--prevent-default",
|
|
295
|
+
className,
|
|
296
|
+
getPropClass(filterClassName, params),
|
|
170
297
|
{
|
|
171
|
-
|
|
172
|
-
"is--
|
|
298
|
+
[`size--${vSize}`]: vSize,
|
|
299
|
+
"is--animat": tableProps.animat,
|
|
300
|
+
"is--multiple": column.filterMultiple,
|
|
301
|
+
"is--active": visible
|
|
173
302
|
}
|
|
174
303
|
],
|
|
175
|
-
|
|
176
|
-
onClick: (evnt) => {
|
|
177
|
-
changeAllOption(evnt, !filterStore.isAllSelected);
|
|
178
|
-
}
|
|
304
|
+
style: filterStore.style
|
|
179
305
|
},
|
|
180
|
-
(
|
|
181
|
-
h("span", {
|
|
182
|
-
class: ["vxe-checkbox--icon", isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
183
|
-
})
|
|
184
|
-
] : []).concat([
|
|
185
|
-
h(
|
|
186
|
-
"span",
|
|
187
|
-
{
|
|
188
|
-
class: "vxe-checkbox--label"
|
|
189
|
-
},
|
|
190
|
-
getI18n("vxe.table.allFilter")
|
|
191
|
-
)
|
|
192
|
-
])
|
|
306
|
+
initStore.filter && (destroyOnClose ? visible : true) && column ? renderOptions(filterRender, compConf).concat(renderFooters()) : []
|
|
193
307
|
)
|
|
194
308
|
]
|
|
195
|
-
)
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
) : h(
|
|
206
|
-
"div",
|
|
207
|
-
{
|
|
208
|
-
class: "vxe-table--filter-body"
|
|
209
|
-
},
|
|
210
|
-
optVNs
|
|
211
|
-
)
|
|
212
|
-
];
|
|
213
|
-
};
|
|
214
|
-
const renderFooters = () => {
|
|
215
|
-
const { filterStore } = props;
|
|
216
|
-
const { column } = filterStore;
|
|
217
|
-
if (!column) {
|
|
218
|
-
return [];
|
|
219
|
-
}
|
|
220
|
-
const filterOpts = computeFilterOpts.value;
|
|
221
|
-
const rendererOpts = computeRendererOpts.value;
|
|
222
|
-
const hasCheckOption = computeHasCheckOption.value;
|
|
223
|
-
const { filterRender, filterMultiple } = column;
|
|
224
|
-
const { confirmButtonText, resetButtonText, showFooter } = filterOpts;
|
|
225
|
-
const compConf = filterRender && isEnableConf(filterRender) && filterRender.name ? rendererOpts[filterRender.name] || renderer.get(filterRender.name) : null;
|
|
226
|
-
const isDisabled = !hasCheckOption && !filterStore.isAllSelected && !filterStore.isIndeterminate;
|
|
227
|
-
let showFlFoot = !!filterMultiple;
|
|
228
|
-
if (XEUtils.isBoolean(showFooter)) {
|
|
229
|
-
showFlFoot = showFooter;
|
|
230
|
-
} else if (compConf) {
|
|
231
|
-
showFlFoot = !(compConf.showTableFilterFooter === false || compConf.showFilterFooter === false || compConf.isFooter === false);
|
|
232
|
-
}
|
|
233
|
-
return showFlFoot ? [
|
|
234
|
-
h(
|
|
235
|
-
"div",
|
|
236
|
-
{
|
|
237
|
-
class: "vxe-table--filter-footer"
|
|
238
|
-
},
|
|
239
|
-
[
|
|
240
|
-
h(
|
|
241
|
-
"button",
|
|
242
|
-
{
|
|
243
|
-
class: {
|
|
244
|
-
"is--disabled": isDisabled
|
|
245
|
-
},
|
|
246
|
-
disabled: isDisabled,
|
|
247
|
-
onClick: confirmFilter
|
|
248
|
-
},
|
|
249
|
-
confirmButtonText || getI18n("vxe.table.confirmFilter")
|
|
250
|
-
),
|
|
251
|
-
h(
|
|
252
|
-
"button",
|
|
253
|
-
{
|
|
254
|
-
onClick: resetFilter
|
|
255
|
-
},
|
|
256
|
-
resetButtonText || getI18n("vxe.table.resetFilter")
|
|
257
|
-
)
|
|
258
|
-
]
|
|
259
|
-
)
|
|
260
|
-
] : [];
|
|
261
|
-
};
|
|
262
|
-
const renderVN = () => {
|
|
263
|
-
const { filterStore } = props;
|
|
264
|
-
const { initStore } = tableReactData;
|
|
265
|
-
const { visible, column } = filterStore;
|
|
266
|
-
if (!column) {
|
|
267
|
-
return renderEmptyElement($xeFilterPanel);
|
|
268
|
-
}
|
|
269
|
-
const rendererOpts = computeRendererOpts.value;
|
|
270
|
-
const filterRender = column ? column.filterRender : null;
|
|
271
|
-
const compConf = filterRender && isEnableConf(filterRender) && filterRender.name ? rendererOpts[filterRender.name] || renderer.get(filterRender.name) : null;
|
|
272
|
-
const filterClassName = compConf ? compConf.tableFilterClassName || compConf.filterClassName : "";
|
|
273
|
-
const params = Object.assign({}, tableInternalData._currFilterParams, { $panel: $xeFilterPanel, $table: $xeTable });
|
|
274
|
-
const tableProps = $xeTable.props;
|
|
275
|
-
const { computeSize } = $xeTable.getComputeMaps();
|
|
276
|
-
const vSize = computeSize.value;
|
|
277
|
-
const filterOpts = computeFilterOpts.value;
|
|
278
|
-
const { transfer, destroyOnClose, className } = filterOpts;
|
|
279
|
-
return h(
|
|
280
|
-
Teleport,
|
|
281
|
-
{
|
|
282
|
-
to: "body",
|
|
283
|
-
disabled: !transfer
|
|
284
|
-
},
|
|
285
|
-
[
|
|
286
|
-
h(
|
|
287
|
-
"div",
|
|
288
|
-
{
|
|
289
|
-
ref: refElem,
|
|
290
|
-
class: [
|
|
291
|
-
"vxe-table--filter-wrapper",
|
|
292
|
-
"filter--prevent-default",
|
|
293
|
-
className,
|
|
294
|
-
getPropClass(filterClassName, params),
|
|
295
|
-
{
|
|
296
|
-
[`size--${vSize}`]: vSize,
|
|
297
|
-
"is--animat": tableProps.animat,
|
|
298
|
-
"is--multiple": column.filterMultiple,
|
|
299
|
-
"is--active": visible
|
|
300
|
-
}
|
|
301
|
-
],
|
|
302
|
-
style: filterStore.style
|
|
303
|
-
},
|
|
304
|
-
initStore.filter && (destroyOnClose ? visible : true) && column ? renderOptions(filterRender, compConf).concat(renderFooters()) : []
|
|
305
|
-
)
|
|
306
|
-
]
|
|
307
|
-
);
|
|
308
|
-
};
|
|
309
|
-
$xeFilterPanel.renderVN = renderVN;
|
|
310
|
-
return $xeFilterPanel;
|
|
311
|
-
},
|
|
312
|
-
render() {
|
|
313
|
-
return this.renderVN();
|
|
314
|
-
}
|
|
315
|
-
});
|
|
309
|
+
);
|
|
310
|
+
};
|
|
311
|
+
$xeFilterPanel.renderVN = renderVN;
|
|
312
|
+
return $xeFilterPanel;
|
|
313
|
+
},
|
|
314
|
+
render() {
|
|
315
|
+
return this.renderVN();
|
|
316
|
+
}
|
|
317
|
+
})
|
|
318
|
+
);
|
|
316
319
|
export {
|
|
317
320
|
panel_default as default
|
|
318
321
|
};
|