vxe-table 3.9.0-rc.8 → 3.9.0
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/README.md +1 -1
- package/es/grid/src/grid.js +120 -66
- package/es/grid/style.css +0 -1
- package/es/grid/style.min.css +1 -1
- package/es/index.esm.js +22 -3
- package/es/locale/lang/en-US.js +2 -8
- package/es/locale/lang/es-ES.js +2 -1
- package/es/locale/lang/hu-HU.d.ts +2 -0
- package/es/locale/lang/hu-HU.js +497 -501
- package/es/locale/lang/ja-JP.js +2 -8
- package/es/locale/lang/ko-KR.d.ts +2 -0
- package/es/locale/lang/ko-KR.js +2 -8
- package/es/locale/lang/pt-BR.js +2 -8
- package/es/locale/lang/ru-RU.d.ts +2 -0
- package/es/locale/lang/ru-RU.js +497 -503
- package/es/locale/lang/uk-UA.d.ts +2 -0
- package/es/locale/lang/uk-UA.js +667 -0
- package/es/locale/lang/vi-VN.js +2 -8
- package/es/locale/lang/zh-CHT.d.ts +2 -0
- package/es/locale/lang/zh-CHT.js +667 -0
- package/es/locale/lang/zh-CN.js +2 -8
- package/es/locale/lang/zh-HK.js +2 -2
- package/es/locale/lang/zh-MO.js +2 -2
- package/es/locale/lang/zh-TC.js +2 -673
- package/es/locale/lang/zh-TW.js +2 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/custom/panel.js +183 -173
- package/es/table/module/edit/mixin.js +33 -24
- package/es/table/module/export/export-panel.js +32 -4
- package/es/table/module/export/import-panel.js +25 -6
- package/es/table/module/export/mixin.js +11 -11
- package/es/table/module/menu/mixin.js +2 -2
- package/es/table/module/validator/mixin.js +4 -4
- package/es/table/render/index.js +17 -11
- package/es/table/src/body.js +1 -0
- package/es/table/src/columnInfo.js +3 -3
- package/es/table/src/methods.js +54 -42
- package/es/table/src/props.js +65 -15
- package/es/table/src/table.js +175 -60
- package/es/table/src/util.js +3 -2
- package/es/table/style.css +37 -48
- package/es/table/style.min.css +1 -1
- package/es/toolbar/src/toolbar.js +21 -7
- package/es/toolbar/style.css +0 -1
- package/es/toolbar/style.min.css +1 -1
- package/es/ui/index.js +5 -3
- package/es/ui/src/log.js +1 -1
- package/es/vxe-grid/style.css +0 -1
- package/es/vxe-grid/style.min.css +1 -1
- package/es/vxe-table/style.css +37 -48
- package/es/vxe-table/style.min.css +1 -1
- package/es/vxe-toolbar/style.css +0 -1
- package/es/vxe-toolbar/style.min.css +1 -1
- package/lib/colgroup/index.js +3 -3
- package/lib/colgroup/index.min.js +1 -1
- package/lib/column/index.js +3 -3
- package/lib/column/index.min.js +1 -1
- package/lib/components.js +9 -11
- package/lib/components.min.js +1 -1
- package/lib/grid/index.js +3 -3
- package/lib/grid/index.min.js +1 -1
- package/lib/grid/src/grid.js +581 -491
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/grid/style/style.css +0 -1
- package/lib/grid/style/style.min.css +1 -1
- package/lib/index.common.js +3 -4
- package/lib/index.umd.js +9212 -17224
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +2 -8
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -8
- package/lib/locale/lang/es-ES.js +2 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +2 -1
- package/lib/locale/lang/hu-HU.d.ts +2 -0
- package/lib/locale/lang/hu-HU.js +497 -501
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +687 -0
- package/lib/locale/lang/ja-JP.js +2 -8
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -8
- package/lib/locale/lang/ko-KR.d.ts +2 -0
- package/lib/locale/lang/ko-KR.js +2 -8
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +687 -0
- package/lib/locale/lang/pt-BR.js +2 -8
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -8
- package/lib/locale/lang/ru-RU.d.ts +2 -0
- package/lib/locale/lang/ru-RU.js +497 -503
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +687 -0
- package/lib/locale/lang/uk-UA.d.ts +2 -0
- package/lib/locale/lang/uk-UA.js +673 -0
- package/lib/locale/lang/uk-UA.min.js +1 -0
- package/lib/locale/lang/uk-UA.umd.js +687 -0
- package/lib/locale/lang/vi-VN.js +2 -8
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.d.ts +2 -0
- package/lib/locale/lang/zh-CHT.js +673 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -0
- package/lib/locale/lang/zh-CHT.umd.js +687 -0
- package/lib/locale/lang/zh-CN.js +2 -8
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -8
- package/lib/locale/lang/zh-HK.js +2 -2
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +7 -677
- package/lib/locale/lang/zh-MO.js +2 -2
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +7 -677
- package/lib/locale/lang/zh-TC.js +3 -673
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +7 -677
- package/lib/locale/lang/zh-TW.js +2 -2
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +7 -677
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/index.js +4 -4
- package/lib/table/index.min.js +1 -1
- package/lib/table/module/custom/mixin.js +53 -44
- package/lib/table/module/custom/mixin.min.js +1 -1
- package/lib/table/module/custom/panel.js +310 -239
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/mixin.js +436 -371
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/export/export-panel.js +136 -106
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/import-panel.js +75 -54
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/export/mixin.js +592 -597
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/module/export/util.js +6 -4
- package/lib/table/module/export/util.min.js +1 -1
- package/lib/table/module/filter/mixin.js +147 -118
- package/lib/table/module/filter/mixin.min.js +1 -1
- package/lib/table/module/filter/panel.js +86 -65
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/module/keyboard/mixin.js +163 -151
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/module/menu/mixin.js +125 -114
- package/lib/table/module/menu/mixin.min.js +1 -1
- package/lib/table/module/menu/panel.js +36 -34
- package/lib/table/module/menu/panel.min.js +1 -1
- package/lib/table/module/validator/mixin.js +225 -214
- package/lib/table/module/validator/mixin.min.js +1 -1
- package/lib/table/render/index.js +401 -297
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +411 -349
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +470 -344
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/column.js +10 -10
- package/lib/table/src/column.min.js +1 -1
- package/lib/table/src/columnInfo.js +46 -55
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +157 -132
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/group.js +1 -1
- package/lib/table/src/group.min.js +1 -1
- package/lib/table/src/header.js +170 -153
- package/lib/table/src/header.min.js +1 -1
- package/lib/table/src/methods.js +2758 -2478
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/props.js +33 -74
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +519 -397
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +143 -131
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +37 -48
- package/lib/table/style/style.min.css +1 -1
- package/lib/toolbar/index.js +3 -3
- package/lib/toolbar/index.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +332 -284
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/toolbar/style/style.css +0 -1
- package/lib/toolbar/style/style.min.css +1 -1
- package/lib/ui/index.js +50 -41
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/comp.js +2 -3
- package/lib/ui/src/comp.min.js +1 -1
- package/lib/ui/src/dom.js +29 -28
- package/lib/ui/src/dom.min.js +1 -1
- package/lib/ui/src/log.js +6 -4
- package/lib/ui/src/log.min.js +1 -1
- package/lib/ui/src/utils.js +7 -7
- package/lib/v-x-e-table/index.js +3 -4
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/vxe-colgroup/index.js +3 -4
- package/lib/vxe-colgroup/index.min.js +1 -1
- package/lib/vxe-column/index.js +3 -4
- package/lib/vxe-column/index.min.js +1 -1
- package/lib/vxe-grid/index.js +3 -4
- package/lib/vxe-grid/index.min.js +1 -1
- package/lib/vxe-grid/style/style.css +0 -1
- package/lib/vxe-grid/style/style.min.css +1 -1
- package/lib/vxe-table/index.js +3 -4
- package/lib/vxe-table/index.min.js +1 -1
- package/lib/vxe-table/style/style.css +37 -48
- package/lib/vxe-table/style/style.min.css +1 -1
- package/lib/vxe-toolbar/index.js +3 -4
- package/lib/vxe-toolbar/index.min.js +1 -1
- package/lib/vxe-toolbar/style/style.css +0 -1
- package/lib/vxe-toolbar/style/style.min.css +1 -1
- package/lib/vxe-ui/index.js +3 -4
- package/lib/vxe-ui/index.min.js +1 -1
- package/lib/vxe-v-x-e-table/index.js +3 -4
- package/lib/vxe-v-x-e-table/index.min.js +1 -1
- package/package.json +5 -4
- package/packages/grid/src/grid.ts +127 -65
- package/packages/locale/lang/en-US.ts +2 -10
- package/packages/locale/lang/es-ES.ts +2 -1
- package/packages/locale/lang/hu-HU.ts +497 -503
- package/packages/locale/lang/ja-JP.ts +2 -10
- package/packages/locale/lang/ko-KR.ts +2 -10
- package/packages/locale/lang/pt-BR.ts +2 -10
- package/packages/locale/lang/ru-RU.ts +497 -505
- package/packages/locale/lang/uk-UA.ts +667 -0
- package/packages/locale/lang/vi-VN.ts +2 -10
- package/packages/locale/lang/zh-CHT.ts +667 -0
- package/packages/locale/lang/zh-CN.ts +2 -10
- package/packages/locale/lang/zh-HK.ts +2 -2
- package/packages/locale/lang/zh-MO.ts +2 -2
- package/packages/locale/lang/zh-TC.ts +2 -674
- package/packages/locale/lang/zh-TW.ts +2 -2
- package/packages/table/module/custom/panel.ts +186 -175
- package/packages/table/module/edit/mixin.ts +32 -23
- package/packages/table/module/export/export-panel.ts +36 -4
- package/packages/table/module/export/import-panel.ts +29 -6
- package/packages/table/module/export/mixin.ts +11 -11
- package/packages/table/module/menu/mixin.ts +2 -2
- package/packages/table/module/validator/mixin.ts +4 -4
- package/packages/table/render/index.ts +20 -11
- package/packages/table/src/body.ts +1 -0
- package/packages/table/src/columnInfo.ts +3 -3
- package/packages/table/src/methods.ts +53 -42
- package/packages/table/src/props.ts +68 -15
- package/packages/table/src/table.ts +183 -57
- package/packages/table/src/util.ts +3 -2
- package/packages/toolbar/src/toolbar.ts +21 -7
- package/packages/ui/index.ts +3 -1
- package/styles/components/table.scss +82 -17
- package/types/all.d.ts +1 -0
- /package/es/{iconfont.1726318179195.ttf → iconfont.1728348263835.ttf} +0 -0
- /package/es/{iconfont.1726318179195.woff → iconfont.1728348263835.woff} +0 -0
- /package/es/{iconfont.1726318179195.woff2 → iconfont.1728348263835.woff2} +0 -0
- /package/lib/{iconfont.1726318179195.ttf → iconfont.1728348263835.ttf} +0 -0
- /package/lib/{iconfont.1726318179195.woff → iconfont.1728348263835.woff} +0 -0
- /package/lib/{iconfont.1726318179195.woff2 → iconfont.1728348263835.woff2} +0 -0
package/lib/table/src/cell.js
CHANGED
|
@@ -11,62 +11,68 @@ var _dom = require("../../ui/src/dom");
|
|
|
11
11
|
var _util = require("./util");
|
|
12
12
|
var _vn = require("../../ui/src/vn");
|
|
13
13
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
var getI18n = _ui.VxeUI.getI18n,
|
|
21
|
-
getIcon = _ui.VxeUI.getIcon,
|
|
22
|
-
renderer = _ui.VxeUI.renderer,
|
|
23
|
-
formats = _ui.VxeUI.formats;
|
|
14
|
+
const {
|
|
15
|
+
getI18n,
|
|
16
|
+
getIcon,
|
|
17
|
+
renderer,
|
|
18
|
+
formats
|
|
19
|
+
} = _ui.VxeUI;
|
|
24
20
|
function renderTitlePrefixIcon(h, params) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
const {
|
|
22
|
+
$table,
|
|
23
|
+
column
|
|
24
|
+
} = params;
|
|
25
|
+
const titlePrefix = column.titlePrefix || column.titleHelp;
|
|
28
26
|
return titlePrefix ? [h('i', {
|
|
29
27
|
class: ['vxe-cell-title-prefix-icon', titlePrefix.icon || getIcon().TABLE_TITLE_PREFIX],
|
|
30
28
|
on: {
|
|
31
|
-
mouseenter
|
|
29
|
+
mouseenter(evnt) {
|
|
32
30
|
$table.triggerHeaderTitleEvent(evnt, titlePrefix, params);
|
|
33
31
|
},
|
|
34
|
-
mouseleave
|
|
32
|
+
mouseleave(evnt) {
|
|
35
33
|
$table.handleTargetLeaveEvent(evnt);
|
|
36
34
|
}
|
|
37
35
|
}
|
|
38
36
|
})] : [];
|
|
39
37
|
}
|
|
40
38
|
function renderTitleSuffixIcon(h, params) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
const {
|
|
40
|
+
$table,
|
|
41
|
+
column
|
|
42
|
+
} = params;
|
|
43
|
+
const titleSuffix = column.titleSuffix;
|
|
44
44
|
return titleSuffix ? [h('i', {
|
|
45
45
|
class: ['vxe-cell-title-suffix-icon', titleSuffix.icon || getIcon().TABLE_TITLE_SUFFIX],
|
|
46
46
|
on: {
|
|
47
|
-
mouseenter
|
|
47
|
+
mouseenter(evnt) {
|
|
48
48
|
$table.triggerHeaderTitleEvent(evnt, titleSuffix, params);
|
|
49
49
|
},
|
|
50
|
-
mouseleave
|
|
50
|
+
mouseleave(evnt) {
|
|
51
51
|
$table.handleTargetLeaveEvent(evnt);
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
})] : [];
|
|
55
55
|
}
|
|
56
56
|
function renderTitleContent(h, params, content) {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
57
|
+
const {
|
|
58
|
+
$table,
|
|
59
|
+
column
|
|
60
|
+
} = params;
|
|
61
|
+
const {
|
|
62
|
+
type,
|
|
63
|
+
showHeaderOverflow
|
|
64
|
+
} = column;
|
|
65
|
+
const {
|
|
66
|
+
showHeaderOverflow: allColumnHeaderOverflow,
|
|
67
|
+
tooltipOpts
|
|
68
|
+
} = $table;
|
|
69
|
+
const showAllTip = tooltipOpts.showAll || tooltipOpts.enabled;
|
|
70
|
+
const headOverflow = _xeUtils.default.isUndefined(showHeaderOverflow) || _xeUtils.default.isNull(showHeaderOverflow) ? allColumnHeaderOverflow : showHeaderOverflow;
|
|
71
|
+
const showTitle = headOverflow === 'title';
|
|
72
|
+
const showTooltip = headOverflow === true || headOverflow === 'tooltip';
|
|
73
|
+
const ons = {};
|
|
68
74
|
if (showTitle || showTooltip || showAllTip) {
|
|
69
|
-
ons.mouseenter =
|
|
75
|
+
ons.mouseenter = evnt => {
|
|
70
76
|
if ($table._isResize) {
|
|
71
77
|
return;
|
|
72
78
|
}
|
|
@@ -78,7 +84,7 @@ function renderTitleContent(h, params, content) {
|
|
|
78
84
|
};
|
|
79
85
|
}
|
|
80
86
|
if (showTooltip || showAllTip) {
|
|
81
|
-
ons.mouseleave =
|
|
87
|
+
ons.mouseleave = evnt => {
|
|
82
88
|
if ($table._isResize) {
|
|
83
89
|
return;
|
|
84
90
|
}
|
|
@@ -102,74 +108,84 @@ function formatFooterLabel(footerFormatter, params) {
|
|
|
102
108
|
if (_xeUtils.default.isFunction(footerFormatter)) {
|
|
103
109
|
return footerFormatter(params);
|
|
104
110
|
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
111
|
+
const isArr = _xeUtils.default.isArray(footerFormatter);
|
|
112
|
+
const gFormatOpts = isArr ? formats.get(footerFormatter[0]) : formats.get(footerFormatter);
|
|
113
|
+
const footerFormatMethod = gFormatOpts ? gFormatOpts.tableFooterCellFormatMethod : null;
|
|
108
114
|
if (footerFormatMethod) {
|
|
109
|
-
return isArr ? footerFormatMethod
|
|
115
|
+
return isArr ? footerFormatMethod(params, ...footerFormatter.slice(1)) : footerFormatMethod(params);
|
|
110
116
|
}
|
|
111
117
|
return '';
|
|
112
118
|
}
|
|
113
119
|
function getFooterContent(h, params) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
const {
|
|
121
|
+
$table,
|
|
122
|
+
column,
|
|
123
|
+
_columnIndex,
|
|
124
|
+
row,
|
|
125
|
+
items
|
|
126
|
+
} = params;
|
|
127
|
+
const {
|
|
128
|
+
slots,
|
|
129
|
+
editRender,
|
|
130
|
+
cellRender,
|
|
131
|
+
footerFormatter
|
|
132
|
+
} = column;
|
|
133
|
+
const renderOpts = editRender || cellRender;
|
|
124
134
|
if (slots && slots.footer) {
|
|
125
135
|
return $table.callSlot(slots.footer, params, h);
|
|
126
136
|
}
|
|
127
137
|
if (renderOpts) {
|
|
128
|
-
|
|
129
|
-
|
|
138
|
+
const compConf = renderer.get(renderOpts.name);
|
|
139
|
+
const rtFooter = compConf ? compConf.renderTableFooter || compConf.renderFooter : null;
|
|
130
140
|
if (rtFooter) {
|
|
131
141
|
return (0, _vn.getSlotVNs)(rtFooter.call($table, h, renderOpts, params));
|
|
132
142
|
}
|
|
133
143
|
}
|
|
134
|
-
|
|
144
|
+
let itemValue = '';
|
|
135
145
|
// 兼容老模式
|
|
136
146
|
if (_xeUtils.default.isArray(items)) {
|
|
137
147
|
itemValue = items[_columnIndex];
|
|
138
148
|
return [footerFormatter ? formatFooterLabel(footerFormatter, {
|
|
139
|
-
itemValue
|
|
140
|
-
column
|
|
141
|
-
row
|
|
142
|
-
items
|
|
143
|
-
_columnIndex
|
|
149
|
+
itemValue,
|
|
150
|
+
column,
|
|
151
|
+
row,
|
|
152
|
+
items,
|
|
153
|
+
_columnIndex
|
|
144
154
|
}) : (0, _utils.formatText)(itemValue, 1)];
|
|
145
155
|
}
|
|
146
156
|
itemValue = _xeUtils.default.get(row, column.field);
|
|
147
157
|
return [footerFormatter ? formatFooterLabel(footerFormatter, {
|
|
148
|
-
itemValue
|
|
149
|
-
column
|
|
150
|
-
row
|
|
151
|
-
items
|
|
152
|
-
_columnIndex
|
|
158
|
+
itemValue,
|
|
159
|
+
column,
|
|
160
|
+
row,
|
|
161
|
+
items,
|
|
162
|
+
_columnIndex
|
|
153
163
|
}) : (0, _utils.formatText)(itemValue, 1)];
|
|
154
164
|
}
|
|
155
165
|
function getDefaultCellLabel(params) {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
166
|
+
const {
|
|
167
|
+
$table,
|
|
168
|
+
row,
|
|
169
|
+
column
|
|
170
|
+
} = params;
|
|
159
171
|
return (0, _utils.formatText)($table.getCellLabel(row, column), 1);
|
|
160
172
|
}
|
|
161
|
-
|
|
162
|
-
createColumn
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
+
const Cell = exports.Cell = {
|
|
174
|
+
createColumn($xetable, _vm) {
|
|
175
|
+
const {
|
|
176
|
+
type,
|
|
177
|
+
sortable,
|
|
178
|
+
remoteSort,
|
|
179
|
+
filters,
|
|
180
|
+
editRender,
|
|
181
|
+
treeNode
|
|
182
|
+
} = _vm;
|
|
183
|
+
const {
|
|
184
|
+
editConfig,
|
|
185
|
+
editOpts,
|
|
186
|
+
checkboxOpts
|
|
187
|
+
} = $xetable;
|
|
188
|
+
const renMaps = {
|
|
173
189
|
renderHeader: this.renderDefaultHeader,
|
|
174
190
|
renderCell: treeNode ? this.renderTreeCell : this.renderDefaultCell,
|
|
175
191
|
renderFooter: this.renderDefaultFooter
|
|
@@ -218,52 +234,60 @@ var Cell = exports.Cell = {
|
|
|
218
234
|
/**
|
|
219
235
|
* 单元格
|
|
220
236
|
*/
|
|
221
|
-
renderHeaderTitle
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
237
|
+
renderHeaderTitle(h, params) {
|
|
238
|
+
const {
|
|
239
|
+
$table,
|
|
240
|
+
column
|
|
241
|
+
} = params;
|
|
242
|
+
const {
|
|
243
|
+
slots,
|
|
244
|
+
editRender,
|
|
245
|
+
cellRender
|
|
246
|
+
} = column;
|
|
247
|
+
const renderOpts = editRender || cellRender;
|
|
228
248
|
if (slots && slots.header) {
|
|
229
249
|
return renderTitleContent(h, params, $table.callSlot(slots.header, params, h));
|
|
230
250
|
}
|
|
231
251
|
if (renderOpts) {
|
|
232
|
-
|
|
233
|
-
|
|
252
|
+
const compConf = renderer.get(renderOpts.name);
|
|
253
|
+
const rtHeader = compConf ? compConf.renderTableHeader || compConf.renderHeader : null;
|
|
234
254
|
if (rtHeader) {
|
|
235
255
|
return (0, _vn.getSlotVNs)(renderTitleContent(h, params, rtHeader.call($table, h, renderOpts, params)));
|
|
236
256
|
}
|
|
237
257
|
}
|
|
238
258
|
return renderTitleContent(h, params, (0, _utils.formatText)(column.getTitle(), 1));
|
|
239
259
|
},
|
|
240
|
-
renderDefaultHeader
|
|
260
|
+
renderDefaultHeader(h, params) {
|
|
241
261
|
return renderTitlePrefixIcon(h, params).concat(Cell.renderHeaderTitle(h, params)).concat(renderTitleSuffixIcon(h, params));
|
|
242
262
|
},
|
|
243
|
-
renderDefaultCell
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
263
|
+
renderDefaultCell(h, params) {
|
|
264
|
+
const {
|
|
265
|
+
$table,
|
|
266
|
+
row,
|
|
267
|
+
column
|
|
268
|
+
} = params;
|
|
269
|
+
const {
|
|
270
|
+
slots,
|
|
271
|
+
editRender,
|
|
272
|
+
cellRender
|
|
273
|
+
} = column;
|
|
274
|
+
const renderOpts = editRender || cellRender;
|
|
251
275
|
if (slots && slots.default) {
|
|
252
276
|
return $table.callSlot(slots.default, params, h);
|
|
253
277
|
}
|
|
254
278
|
if (renderOpts) {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
279
|
+
const compConf = renderer.get(renderOpts.name);
|
|
280
|
+
const rtDefault = compConf ? compConf.renderTableDefault || compConf.renderDefault : null;
|
|
281
|
+
const rtCell = compConf ? compConf.renderTableCell || compConf.renderCell : null;
|
|
282
|
+
const renderFn = editRender ? rtCell : rtDefault;
|
|
259
283
|
if (renderFn) {
|
|
260
284
|
return (0, _vn.getSlotVNs)(renderFn.call($table, h, renderOpts, Object.assign({
|
|
261
285
|
$type: editRender ? 'edit' : 'cell'
|
|
262
286
|
}, params)));
|
|
263
287
|
}
|
|
264
288
|
}
|
|
265
|
-
|
|
266
|
-
|
|
289
|
+
const cellValue = $table.getCellLabel(row, column);
|
|
290
|
+
const cellPlaceholder = editRender ? editRender.placeholder : '';
|
|
267
291
|
return [h('span', {
|
|
268
292
|
class: 'vxe-cell--label'
|
|
269
293
|
}, [
|
|
@@ -272,10 +296,10 @@ var Cell = exports.Cell = {
|
|
|
272
296
|
class: 'vxe-cell--placeholder'
|
|
273
297
|
}, (0, _utils.formatText)((0, _utils.getFuncText)(cellPlaceholder), 1)) : h('span', (0, _utils.formatText)(cellValue, 1))])];
|
|
274
298
|
},
|
|
275
|
-
renderTreeCell
|
|
299
|
+
renderTreeCell(h, params) {
|
|
276
300
|
return Cell.renderTreeIcon(h, params, Cell.renderDefaultCell.call(this, h, params));
|
|
277
301
|
},
|
|
278
|
-
renderDefaultFooter
|
|
302
|
+
renderDefaultFooter(h, params) {
|
|
279
303
|
return [h('span', {
|
|
280
304
|
class: 'vxe-cell--item'
|
|
281
305
|
}, getFooterContent(h, params))];
|
|
@@ -283,48 +307,58 @@ var Cell = exports.Cell = {
|
|
|
283
307
|
/**
|
|
284
308
|
* 树节点
|
|
285
309
|
*/
|
|
286
|
-
renderTreeIcon
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
310
|
+
renderTreeIcon(h, params, cellVNodes) {
|
|
311
|
+
const {
|
|
312
|
+
$table,
|
|
313
|
+
isHidden
|
|
314
|
+
} = params;
|
|
315
|
+
const {
|
|
316
|
+
treeOpts,
|
|
317
|
+
treeExpandedMaps,
|
|
318
|
+
treeExpandLazyLoadedMaps,
|
|
319
|
+
fullAllDataRowIdData
|
|
320
|
+
} = $table;
|
|
321
|
+
const {
|
|
322
|
+
row,
|
|
323
|
+
column,
|
|
324
|
+
level
|
|
325
|
+
} = params;
|
|
326
|
+
const {
|
|
327
|
+
slots
|
|
328
|
+
} = column;
|
|
329
|
+
const {
|
|
330
|
+
indent,
|
|
331
|
+
lazy,
|
|
332
|
+
trigger,
|
|
333
|
+
iconLoaded,
|
|
334
|
+
showIcon,
|
|
335
|
+
iconOpen,
|
|
336
|
+
iconClose
|
|
337
|
+
} = treeOpts;
|
|
338
|
+
const childrenField = treeOpts.children || treeOpts.childrenField;
|
|
339
|
+
const hasChildField = treeOpts.hasChild || treeOpts.hasChildField;
|
|
340
|
+
const rowChilds = row[childrenField];
|
|
341
|
+
const hasChild = rowChilds && rowChilds.length;
|
|
342
|
+
let hasLazyChilds = false;
|
|
343
|
+
let isAceived = false;
|
|
344
|
+
let isLazyLoading = false;
|
|
345
|
+
let isLazyLoaded = false;
|
|
346
|
+
const on = {};
|
|
313
347
|
if (slots && slots.icon) {
|
|
314
348
|
return $table.callSlot(slots.icon, params, h, cellVNodes);
|
|
315
349
|
}
|
|
316
350
|
if (!isHidden) {
|
|
317
|
-
|
|
351
|
+
const rowid = (0, _util.getRowid)($table, row);
|
|
318
352
|
isAceived = !!treeExpandedMaps[rowid];
|
|
319
353
|
if (lazy) {
|
|
320
|
-
|
|
354
|
+
const rest = fullAllDataRowIdData[rowid];
|
|
321
355
|
isLazyLoading = !!treeExpandLazyLoadedMaps[rowid];
|
|
322
356
|
hasLazyChilds = row[hasChildField];
|
|
323
357
|
isLazyLoaded = !!rest.treeLoaded;
|
|
324
358
|
}
|
|
325
359
|
}
|
|
326
360
|
if (!trigger || trigger === 'default') {
|
|
327
|
-
on.click =
|
|
361
|
+
on.click = evnt => {
|
|
328
362
|
$table.triggerTreeExpandEvent(evnt, params);
|
|
329
363
|
};
|
|
330
364
|
}
|
|
@@ -333,11 +367,11 @@ var Cell = exports.Cell = {
|
|
|
333
367
|
'is--active': isAceived
|
|
334
368
|
}],
|
|
335
369
|
style: {
|
|
336
|
-
paddingLeft:
|
|
370
|
+
paddingLeft: `${level * indent}px`
|
|
337
371
|
}
|
|
338
372
|
}, [showIcon && (lazy ? isLazyLoaded ? hasChild : hasLazyChilds : hasChild) ? [h('div', {
|
|
339
373
|
class: 'vxe-tree--btn-wrapper',
|
|
340
|
-
on
|
|
374
|
+
on
|
|
341
375
|
}, [h('i', {
|
|
342
376
|
class: ['vxe-tree--node-btn', isLazyLoading ? iconLoaded || getIcon().TABLE_TREE_LOADED : isAceived ? iconOpen || getIcon().TABLE_TREE_OPEN : iconClose || getIcon().TABLE_TREE_CLOSE]
|
|
343
377
|
})])] : null, h('div', {
|
|
@@ -347,63 +381,89 @@ var Cell = exports.Cell = {
|
|
|
347
381
|
/**
|
|
348
382
|
* 索引
|
|
349
383
|
*/
|
|
350
|
-
renderSeqHeader
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
384
|
+
renderSeqHeader(h, params) {
|
|
385
|
+
const {
|
|
386
|
+
$table,
|
|
387
|
+
column
|
|
388
|
+
} = params;
|
|
389
|
+
const {
|
|
390
|
+
slots
|
|
391
|
+
} = column;
|
|
354
392
|
return renderTitleContent(h, params, slots && slots.header ? $table.callSlot(slots.header, params, h) : (0, _utils.formatText)(column.getTitle(), 1));
|
|
355
393
|
},
|
|
356
|
-
renderSeqCell
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
394
|
+
renderSeqCell(h, params) {
|
|
395
|
+
const {
|
|
396
|
+
$table,
|
|
397
|
+
column
|
|
398
|
+
} = params;
|
|
399
|
+
const {
|
|
400
|
+
treeConfig,
|
|
401
|
+
seqOpts
|
|
402
|
+
} = $table;
|
|
403
|
+
const {
|
|
404
|
+
slots
|
|
405
|
+
} = column;
|
|
362
406
|
if (slots && slots.default) {
|
|
363
407
|
return $table.callSlot(slots.default, params, h);
|
|
364
408
|
}
|
|
365
|
-
|
|
366
|
-
|
|
409
|
+
const {
|
|
410
|
+
seq
|
|
411
|
+
} = params;
|
|
412
|
+
const seqMethod = seqOpts.seqMethod;
|
|
367
413
|
return [(0, _utils.formatText)(seqMethod ? seqMethod(params) : treeConfig ? seq : (seqOpts.startIndex || 0) + seq, 1)];
|
|
368
414
|
},
|
|
369
|
-
renderTreeIndexCell
|
|
415
|
+
renderTreeIndexCell(h, params) {
|
|
370
416
|
return Cell.renderTreeIcon(h, params, Cell.renderSeqCell(h, params));
|
|
371
417
|
},
|
|
372
418
|
/**
|
|
373
419
|
* 单选
|
|
374
420
|
*/
|
|
375
|
-
renderRadioHeader
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
421
|
+
renderRadioHeader(h, params) {
|
|
422
|
+
const {
|
|
423
|
+
$table,
|
|
424
|
+
column
|
|
425
|
+
} = params;
|
|
426
|
+
const {
|
|
427
|
+
slots
|
|
428
|
+
} = column;
|
|
429
|
+
const headerSlot = slots ? slots.header : null;
|
|
430
|
+
const titleSlot = slots ? slots.title : null;
|
|
381
431
|
return renderTitleContent(h, params, headerSlot ? $table.callSlot(headerSlot, params, h) : [h('span', {
|
|
382
432
|
class: 'vxe-radio--label'
|
|
383
433
|
}, titleSlot ? $table.callSlot(titleSlot, params, h) : (0, _utils.formatText)(column.getTitle(), 1))]);
|
|
384
434
|
},
|
|
385
|
-
renderRadioCell
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
435
|
+
renderRadioCell(h, params) {
|
|
436
|
+
const {
|
|
437
|
+
$table,
|
|
438
|
+
column,
|
|
439
|
+
isHidden
|
|
440
|
+
} = params;
|
|
441
|
+
const {
|
|
442
|
+
radioOpts,
|
|
443
|
+
selectRadioRow
|
|
444
|
+
} = $table;
|
|
445
|
+
const {
|
|
446
|
+
slots
|
|
447
|
+
} = column;
|
|
448
|
+
const {
|
|
449
|
+
labelField,
|
|
450
|
+
checkMethod,
|
|
451
|
+
visibleMethod
|
|
452
|
+
} = radioOpts;
|
|
453
|
+
const {
|
|
454
|
+
row
|
|
455
|
+
} = params;
|
|
456
|
+
const defaultSlot = slots ? slots.default : null;
|
|
457
|
+
const radioSlot = slots ? slots.radio : null;
|
|
458
|
+
const isChecked = row === selectRadioRow;
|
|
459
|
+
const isVisible = !visibleMethod || visibleMethod({
|
|
460
|
+
row
|
|
401
461
|
});
|
|
402
|
-
|
|
403
|
-
|
|
462
|
+
let isDisabled = !!checkMethod;
|
|
463
|
+
let on;
|
|
404
464
|
if (!isHidden) {
|
|
405
465
|
on = {
|
|
406
|
-
click
|
|
466
|
+
click(evnt) {
|
|
407
467
|
if (!isDisabled && isVisible) {
|
|
408
468
|
$table.triggerRadioRowEvent(evnt, params);
|
|
409
469
|
}
|
|
@@ -411,11 +471,11 @@ var Cell = exports.Cell = {
|
|
|
411
471
|
};
|
|
412
472
|
if (checkMethod) {
|
|
413
473
|
isDisabled = !checkMethod({
|
|
414
|
-
row
|
|
474
|
+
row
|
|
415
475
|
});
|
|
416
476
|
}
|
|
417
477
|
}
|
|
418
|
-
|
|
478
|
+
const radioParams = Object.assign(Object.assign({}, params), {
|
|
419
479
|
checked: isChecked,
|
|
420
480
|
disabled: isDisabled,
|
|
421
481
|
visible: isVisible
|
|
@@ -423,7 +483,7 @@ var Cell = exports.Cell = {
|
|
|
423
483
|
if (radioSlot) {
|
|
424
484
|
return $table.callSlot(radioSlot, radioParams, h);
|
|
425
485
|
}
|
|
426
|
-
|
|
486
|
+
const radioVNs = [];
|
|
427
487
|
if (isVisible) {
|
|
428
488
|
radioVNs.push(h('span', {
|
|
429
489
|
class: ['vxe-radio--icon', isChecked ? getIcon().TABLE_RADIO_CHECKED : getIcon().TABLE_RADIO_UNCHECKED]
|
|
@@ -439,38 +499,44 @@ var Cell = exports.Cell = {
|
|
|
439
499
|
'is--checked': isChecked,
|
|
440
500
|
'is--disabled': isDisabled
|
|
441
501
|
}],
|
|
442
|
-
on
|
|
502
|
+
on
|
|
443
503
|
}, radioVNs)];
|
|
444
504
|
},
|
|
445
|
-
renderTreeRadioCell
|
|
505
|
+
renderTreeRadioCell(h, params) {
|
|
446
506
|
return Cell.renderTreeIcon(h, params, Cell.renderRadioCell(h, params));
|
|
447
507
|
},
|
|
448
508
|
/**
|
|
449
509
|
* 多选
|
|
450
510
|
*/
|
|
451
|
-
renderCheckboxHeader
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
511
|
+
renderCheckboxHeader(h, params) {
|
|
512
|
+
const {
|
|
513
|
+
$table,
|
|
514
|
+
column,
|
|
515
|
+
isHidden
|
|
516
|
+
} = params;
|
|
517
|
+
const {
|
|
518
|
+
isAllSelected: isAllCheckboxSelected,
|
|
519
|
+
isIndeterminate: isAllCheckboxIndeterminate,
|
|
520
|
+
isAllCheckboxDisabled
|
|
521
|
+
} = $table;
|
|
522
|
+
const {
|
|
523
|
+
slots
|
|
524
|
+
} = column;
|
|
525
|
+
const headerSlot = slots ? slots.header : null;
|
|
526
|
+
const titleSlot = slots ? slots.title : null;
|
|
527
|
+
const checkboxOpts = $table.checkboxOpts;
|
|
528
|
+
const headerTitle = column.getTitle();
|
|
529
|
+
let on;
|
|
464
530
|
if (!isHidden) {
|
|
465
531
|
on = {
|
|
466
|
-
click
|
|
532
|
+
click(evnt) {
|
|
467
533
|
if (!isAllCheckboxDisabled) {
|
|
468
534
|
$table.triggerCheckAllEvent(evnt, !isAllCheckboxSelected);
|
|
469
535
|
}
|
|
470
536
|
}
|
|
471
537
|
};
|
|
472
538
|
}
|
|
473
|
-
|
|
539
|
+
const checkboxParams = Object.assign(Object.assign({}, params), {
|
|
474
540
|
checked: isAllCheckboxSelected,
|
|
475
541
|
disabled: isAllCheckboxDisabled,
|
|
476
542
|
indeterminate: isAllCheckboxIndeterminate
|
|
@@ -492,40 +558,47 @@ var Cell = exports.Cell = {
|
|
|
492
558
|
attrs: {
|
|
493
559
|
title: getI18n('vxe.table.allTitle')
|
|
494
560
|
},
|
|
495
|
-
on
|
|
561
|
+
on
|
|
496
562
|
}, [h('span', {
|
|
497
563
|
class: ['vxe-checkbox--icon', isAllCheckboxIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllCheckboxSelected ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
498
564
|
})].concat(titleSlot || headerTitle ? [h('span', {
|
|
499
565
|
class: 'vxe-checkbox--label'
|
|
500
566
|
}, titleSlot ? $table.callSlot(titleSlot, checkboxParams, h) : headerTitle)] : []))]);
|
|
501
567
|
},
|
|
502
|
-
renderCheckboxCell
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
568
|
+
renderCheckboxCell(h, params) {
|
|
569
|
+
const {
|
|
570
|
+
$table,
|
|
571
|
+
row,
|
|
572
|
+
column,
|
|
573
|
+
isHidden
|
|
574
|
+
} = params;
|
|
575
|
+
const {
|
|
576
|
+
treeConfig,
|
|
577
|
+
treeIndeterminateMaps,
|
|
578
|
+
selectCheckboxMaps
|
|
579
|
+
} = $table;
|
|
580
|
+
const {
|
|
581
|
+
labelField,
|
|
582
|
+
checkMethod,
|
|
583
|
+
visibleMethod
|
|
584
|
+
} = $table.checkboxOpts;
|
|
585
|
+
const {
|
|
586
|
+
slots
|
|
587
|
+
} = column;
|
|
588
|
+
const defaultSlot = slots ? slots.default : null;
|
|
589
|
+
const checkboxSlot = slots ? slots.checkbox : null;
|
|
590
|
+
let indeterminate = false;
|
|
591
|
+
let isChecked = false;
|
|
592
|
+
const isVisible = !visibleMethod || visibleMethod({
|
|
593
|
+
row
|
|
521
594
|
});
|
|
522
|
-
|
|
523
|
-
|
|
595
|
+
let isDisabled = !!checkMethod;
|
|
596
|
+
let on;
|
|
524
597
|
if (!isHidden) {
|
|
525
|
-
|
|
598
|
+
const rowid = (0, _util.getRowid)($table, row);
|
|
526
599
|
isChecked = !!selectCheckboxMaps[rowid];
|
|
527
600
|
on = {
|
|
528
|
-
click
|
|
601
|
+
click(evnt) {
|
|
529
602
|
if (!isDisabled && isVisible) {
|
|
530
603
|
$table.triggerCheckRowEvent(evnt, params, !isChecked);
|
|
531
604
|
}
|
|
@@ -533,23 +606,23 @@ var Cell = exports.Cell = {
|
|
|
533
606
|
};
|
|
534
607
|
if (checkMethod) {
|
|
535
608
|
isDisabled = !checkMethod({
|
|
536
|
-
row
|
|
609
|
+
row
|
|
537
610
|
});
|
|
538
611
|
}
|
|
539
612
|
if (treeConfig) {
|
|
540
613
|
indeterminate = !!treeIndeterminateMaps[rowid];
|
|
541
614
|
}
|
|
542
615
|
}
|
|
543
|
-
|
|
616
|
+
const checkboxParams = Object.assign(Object.assign({}, params), {
|
|
544
617
|
checked: isChecked,
|
|
545
618
|
disabled: isDisabled,
|
|
546
619
|
visible: isVisible,
|
|
547
|
-
indeterminate
|
|
620
|
+
indeterminate
|
|
548
621
|
});
|
|
549
622
|
if (checkboxSlot) {
|
|
550
623
|
return $table.callSlot(checkboxSlot, checkboxParams, h);
|
|
551
624
|
}
|
|
552
|
-
|
|
625
|
+
const checkVNs = [];
|
|
553
626
|
if (isVisible) {
|
|
554
627
|
checkVNs.push(h('span', {
|
|
555
628
|
class: ['vxe-checkbox--icon', indeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
@@ -567,40 +640,48 @@ var Cell = exports.Cell = {
|
|
|
567
640
|
'is--indeterminate': indeterminate,
|
|
568
641
|
'is--hidden': !isVisible
|
|
569
642
|
}],
|
|
570
|
-
on
|
|
643
|
+
on
|
|
571
644
|
}, checkVNs)];
|
|
572
645
|
},
|
|
573
|
-
renderTreeSelectionCell
|
|
646
|
+
renderTreeSelectionCell(h, params) {
|
|
574
647
|
return Cell.renderTreeIcon(h, params, Cell.renderCheckboxCell(h, params));
|
|
575
648
|
},
|
|
576
|
-
renderCheckboxCellByProp
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
649
|
+
renderCheckboxCellByProp(h, params) {
|
|
650
|
+
const {
|
|
651
|
+
$table,
|
|
652
|
+
row,
|
|
653
|
+
column,
|
|
654
|
+
isHidden
|
|
655
|
+
} = params;
|
|
656
|
+
const {
|
|
657
|
+
treeConfig,
|
|
658
|
+
treeIndeterminateMaps,
|
|
659
|
+
checkboxOpts
|
|
660
|
+
} = $table;
|
|
661
|
+
const {
|
|
662
|
+
labelField,
|
|
663
|
+
checkField,
|
|
664
|
+
checkMethod,
|
|
665
|
+
visibleMethod
|
|
666
|
+
} = checkboxOpts;
|
|
667
|
+
const indeterminateField = checkboxOpts.indeterminateField || checkboxOpts.halfField;
|
|
668
|
+
const {
|
|
669
|
+
slots
|
|
670
|
+
} = column;
|
|
671
|
+
const defaultSlot = slots ? slots.default : null;
|
|
672
|
+
const checkboxSlot = slots ? slots.checkbox : null;
|
|
673
|
+
let isIndeterminate = false;
|
|
674
|
+
let isChecked = false;
|
|
675
|
+
const isVisible = !visibleMethod || visibleMethod({
|
|
676
|
+
row
|
|
596
677
|
});
|
|
597
|
-
|
|
598
|
-
|
|
678
|
+
let isDisabled = !!checkMethod;
|
|
679
|
+
let on;
|
|
599
680
|
if (!isHidden) {
|
|
600
|
-
|
|
681
|
+
const rowid = (0, _util.getRowid)($table, row);
|
|
601
682
|
isChecked = _xeUtils.default.get(row, checkField);
|
|
602
683
|
on = {
|
|
603
|
-
click
|
|
684
|
+
click(evnt) {
|
|
604
685
|
if (!isDisabled && isVisible) {
|
|
605
686
|
$table.triggerCheckRowEvent(evnt, params, !isChecked);
|
|
606
687
|
}
|
|
@@ -608,14 +689,14 @@ var Cell = exports.Cell = {
|
|
|
608
689
|
};
|
|
609
690
|
if (checkMethod) {
|
|
610
691
|
isDisabled = !checkMethod({
|
|
611
|
-
row
|
|
692
|
+
row
|
|
612
693
|
});
|
|
613
694
|
}
|
|
614
695
|
if (treeConfig) {
|
|
615
696
|
isIndeterminate = !!treeIndeterminateMaps[rowid];
|
|
616
697
|
}
|
|
617
698
|
}
|
|
618
|
-
|
|
699
|
+
const checkboxParams = Object.assign(Object.assign({}, params), {
|
|
619
700
|
checked: isChecked,
|
|
620
701
|
disabled: isDisabled,
|
|
621
702
|
visible: isVisible,
|
|
@@ -624,7 +705,7 @@ var Cell = exports.Cell = {
|
|
|
624
705
|
if (checkboxSlot) {
|
|
625
706
|
return $table.callSlot(checkboxSlot, checkboxParams, h);
|
|
626
707
|
}
|
|
627
|
-
|
|
708
|
+
const checkVNs = [];
|
|
628
709
|
if (isVisible) {
|
|
629
710
|
checkVNs.push(h('span', {
|
|
630
711
|
class: ['vxe-checkbox--icon', isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
|
|
@@ -642,39 +723,47 @@ var Cell = exports.Cell = {
|
|
|
642
723
|
'is--indeterminate': indeterminateField && !isChecked ? row[indeterminateField] : isIndeterminate,
|
|
643
724
|
'is--hidden': !isVisible
|
|
644
725
|
}],
|
|
645
|
-
on
|
|
726
|
+
on
|
|
646
727
|
}, checkVNs)];
|
|
647
728
|
},
|
|
648
|
-
renderTreeSelectionCellByProp
|
|
729
|
+
renderTreeSelectionCellByProp(h, params) {
|
|
649
730
|
return Cell.renderTreeIcon(h, params, Cell.renderCheckboxCellByProp(h, params));
|
|
650
731
|
},
|
|
651
732
|
/**
|
|
652
733
|
* 展开行
|
|
653
734
|
*/
|
|
654
|
-
renderExpandCell
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
735
|
+
renderExpandCell(h, params) {
|
|
736
|
+
const {
|
|
737
|
+
$table,
|
|
738
|
+
isHidden,
|
|
739
|
+
row,
|
|
740
|
+
column
|
|
741
|
+
} = params;
|
|
742
|
+
const {
|
|
743
|
+
expandOpts,
|
|
744
|
+
rowExpandedMaps,
|
|
745
|
+
rowExpandLazyLoadedMaps
|
|
746
|
+
} = $table;
|
|
747
|
+
const {
|
|
748
|
+
lazy,
|
|
749
|
+
labelField,
|
|
750
|
+
iconLoaded,
|
|
751
|
+
showIcon,
|
|
752
|
+
iconOpen,
|
|
753
|
+
iconClose,
|
|
754
|
+
visibleMethod
|
|
755
|
+
} = expandOpts;
|
|
756
|
+
const {
|
|
757
|
+
slots
|
|
758
|
+
} = column;
|
|
759
|
+
const defaultSlot = slots ? slots.default : null;
|
|
760
|
+
let isAceived = false;
|
|
761
|
+
let isLazyLoading = false;
|
|
673
762
|
if (slots && slots.icon) {
|
|
674
763
|
return $table.callSlot(slots.icon, params, h);
|
|
675
764
|
}
|
|
676
765
|
if (!isHidden) {
|
|
677
|
-
|
|
766
|
+
const rowid = (0, _util.getRowid)($table, row);
|
|
678
767
|
isAceived = !!rowExpandedMaps[rowid];
|
|
679
768
|
if (lazy) {
|
|
680
769
|
isLazyLoading = !!rowExpandLazyLoadedMaps[rowid];
|
|
@@ -685,7 +774,7 @@ var Cell = exports.Cell = {
|
|
|
685
774
|
'is--active': isAceived
|
|
686
775
|
}],
|
|
687
776
|
on: {
|
|
688
|
-
click
|
|
777
|
+
click(evnt) {
|
|
689
778
|
$table.triggerRowExpandEvent(evnt, params);
|
|
690
779
|
}
|
|
691
780
|
}
|
|
@@ -695,17 +784,21 @@ var Cell = exports.Cell = {
|
|
|
695
784
|
class: 'vxe-table--expand-label'
|
|
696
785
|
}, defaultSlot ? $table.callSlot(defaultSlot, params, h) : _xeUtils.default.get(row, labelField)) : null];
|
|
697
786
|
},
|
|
698
|
-
renderExpandData
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
787
|
+
renderExpandData(h, params) {
|
|
788
|
+
const {
|
|
789
|
+
$table,
|
|
790
|
+
column
|
|
791
|
+
} = params;
|
|
792
|
+
const {
|
|
793
|
+
slots,
|
|
794
|
+
contentRender
|
|
795
|
+
} = column;
|
|
703
796
|
if (slots && slots.content) {
|
|
704
797
|
return $table.callSlot(slots.content, params, h);
|
|
705
798
|
}
|
|
706
799
|
if (contentRender) {
|
|
707
|
-
|
|
708
|
-
|
|
800
|
+
const compConf = renderer.get(contentRender.name);
|
|
801
|
+
const rtExpand = compConf ? compConf.renderTableExpand || compConf.renderExpand : null;
|
|
709
802
|
if (rtExpand) {
|
|
710
803
|
return (0, _vn.getSlotVNs)(rtExpand.call($table, h, contentRender, params));
|
|
711
804
|
}
|
|
@@ -715,10 +808,14 @@ var Cell = exports.Cell = {
|
|
|
715
808
|
/**
|
|
716
809
|
* HTML 标签
|
|
717
810
|
*/
|
|
718
|
-
renderHTMLCell
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
811
|
+
renderHTMLCell(h, params) {
|
|
812
|
+
const {
|
|
813
|
+
$table,
|
|
814
|
+
column
|
|
815
|
+
} = params;
|
|
816
|
+
const {
|
|
817
|
+
slots
|
|
818
|
+
} = column;
|
|
722
819
|
if (slots && slots.default) {
|
|
723
820
|
return $table.callSlot(slots.default, params, h);
|
|
724
821
|
}
|
|
@@ -729,31 +826,34 @@ var Cell = exports.Cell = {
|
|
|
729
826
|
}
|
|
730
827
|
})];
|
|
731
828
|
},
|
|
732
|
-
renderTreeHTMLCell
|
|
829
|
+
renderTreeHTMLCell(h, params) {
|
|
733
830
|
return Cell.renderTreeIcon(h, params, Cell.renderHTMLCell(h, params));
|
|
734
831
|
},
|
|
735
832
|
/**
|
|
736
833
|
* 排序和筛选
|
|
737
834
|
*/
|
|
738
|
-
renderSortAndFilterHeader
|
|
835
|
+
renderSortAndFilterHeader(h, params) {
|
|
739
836
|
return Cell.renderDefaultHeader(h, params).concat(Cell.renderSortIcon(h, params)).concat(Cell.renderFilterIcon(h, params));
|
|
740
837
|
},
|
|
741
838
|
/**
|
|
742
839
|
* 排序
|
|
743
840
|
*/
|
|
744
|
-
renderSortHeader
|
|
841
|
+
renderSortHeader(h, params) {
|
|
745
842
|
return Cell.renderDefaultHeader(h, params).concat(Cell.renderSortIcon(h, params));
|
|
746
843
|
},
|
|
747
|
-
renderSortIcon
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
844
|
+
renderSortIcon(h, params) {
|
|
845
|
+
const {
|
|
846
|
+
$table,
|
|
847
|
+
column
|
|
848
|
+
} = params;
|
|
849
|
+
const {
|
|
850
|
+
showIcon,
|
|
851
|
+
iconLayout,
|
|
852
|
+
iconAsc,
|
|
853
|
+
iconDesc
|
|
854
|
+
} = $table.sortOpts;
|
|
755
855
|
return showIcon ? [h('span', {
|
|
756
|
-
class: ['vxe-cell--sort',
|
|
856
|
+
class: ['vxe-cell--sort', `vxe-cell--sort-${iconLayout}-layout`]
|
|
757
857
|
}, [h('i', {
|
|
758
858
|
class: ['vxe-sort--asc-btn', iconAsc || getIcon().TABLE_SORT_ASC, {
|
|
759
859
|
'sort--active': column.order === 'asc'
|
|
@@ -762,7 +862,7 @@ var Cell = exports.Cell = {
|
|
|
762
862
|
title: getI18n('vxe.table.sortAsc')
|
|
763
863
|
},
|
|
764
864
|
on: {
|
|
765
|
-
click
|
|
865
|
+
click(evnt) {
|
|
766
866
|
evnt.stopPropagation();
|
|
767
867
|
$table.triggerSortEvent(evnt, column, 'asc');
|
|
768
868
|
}
|
|
@@ -775,7 +875,7 @@ var Cell = exports.Cell = {
|
|
|
775
875
|
title: getI18n('vxe.table.sortDesc')
|
|
776
876
|
},
|
|
777
877
|
on: {
|
|
778
|
-
click
|
|
878
|
+
click(evnt) {
|
|
779
879
|
evnt.stopPropagation();
|
|
780
880
|
$table.triggerSortEvent(evnt, column, 'desc');
|
|
781
881
|
}
|
|
@@ -785,18 +885,24 @@ var Cell = exports.Cell = {
|
|
|
785
885
|
/**
|
|
786
886
|
* 筛选
|
|
787
887
|
*/
|
|
788
|
-
renderFilterHeader
|
|
888
|
+
renderFilterHeader(h, params) {
|
|
789
889
|
return Cell.renderDefaultHeader(h, params).concat(Cell.renderFilterIcon(h, params));
|
|
790
890
|
},
|
|
791
|
-
renderFilterIcon
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
891
|
+
renderFilterIcon(h, params) {
|
|
892
|
+
const {
|
|
893
|
+
$table,
|
|
894
|
+
column,
|
|
895
|
+
hasFilter
|
|
896
|
+
} = params;
|
|
897
|
+
const {
|
|
898
|
+
filterStore,
|
|
899
|
+
filterOpts
|
|
900
|
+
} = $table;
|
|
901
|
+
const {
|
|
902
|
+
showIcon,
|
|
903
|
+
iconNone,
|
|
904
|
+
iconMatch
|
|
905
|
+
} = filterOpts;
|
|
800
906
|
return showIcon ? [h('span', {
|
|
801
907
|
class: ['vxe-cell--filter', {
|
|
802
908
|
'is--active': filterStore.visible && filterStore.column === column
|
|
@@ -807,7 +913,7 @@ var Cell = exports.Cell = {
|
|
|
807
913
|
title: getI18n('vxe.table.filter')
|
|
808
914
|
},
|
|
809
915
|
on: {
|
|
810
|
-
click
|
|
916
|
+
click(evnt) {
|
|
811
917
|
if ($table.triggerFilterEvent) {
|
|
812
918
|
$table.triggerFilterEvent(evnt, params.column, params);
|
|
813
919
|
}
|
|
@@ -818,23 +924,27 @@ var Cell = exports.Cell = {
|
|
|
818
924
|
/**
|
|
819
925
|
* 可编辑
|
|
820
926
|
*/
|
|
821
|
-
renderEditHeader
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
927
|
+
renderEditHeader(h, params) {
|
|
928
|
+
const {
|
|
929
|
+
$table,
|
|
930
|
+
column
|
|
931
|
+
} = params;
|
|
932
|
+
const {
|
|
933
|
+
editConfig,
|
|
934
|
+
editRules,
|
|
935
|
+
editOpts
|
|
936
|
+
} = $table;
|
|
937
|
+
const {
|
|
938
|
+
sortable,
|
|
939
|
+
remoteSort,
|
|
940
|
+
filters,
|
|
941
|
+
editRender
|
|
942
|
+
} = column;
|
|
943
|
+
let isRequired = false;
|
|
832
944
|
if (editRules) {
|
|
833
|
-
|
|
945
|
+
const columnRules = _xeUtils.default.get(editRules, column.field);
|
|
834
946
|
if (columnRules) {
|
|
835
|
-
isRequired = columnRules.some(
|
|
836
|
-
return rule.required;
|
|
837
|
-
});
|
|
947
|
+
isRequired = columnRules.some(rule => rule.required);
|
|
838
948
|
}
|
|
839
949
|
}
|
|
840
950
|
return ((0, _utils.isEnableConf)(editConfig) ? [isRequired && editOpts.showAsterisk ? h('i', {
|
|
@@ -844,38 +954,54 @@ var Cell = exports.Cell = {
|
|
|
844
954
|
}) : null] : []).concat(Cell.renderDefaultHeader(h, params)).concat(sortable || remoteSort ? Cell.renderSortIcon(h, params) : []).concat(filters ? Cell.renderFilterIcon(h, params) : []);
|
|
845
955
|
},
|
|
846
956
|
// 行格编辑模式
|
|
847
|
-
renderRowEdit
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
957
|
+
renderRowEdit(h, params) {
|
|
958
|
+
const {
|
|
959
|
+
$table,
|
|
960
|
+
column
|
|
961
|
+
} = params;
|
|
962
|
+
const {
|
|
963
|
+
editRender
|
|
964
|
+
} = column;
|
|
965
|
+
const {
|
|
966
|
+
actived
|
|
967
|
+
} = $table.editStore;
|
|
852
968
|
return Cell.runRenderer(h, params, this, (0, _utils.isEnableConf)(editRender) && actived && actived.row === params.row);
|
|
853
969
|
},
|
|
854
|
-
renderTreeRowEdit
|
|
970
|
+
renderTreeRowEdit(h, params) {
|
|
855
971
|
return Cell.renderTreeIcon(h, params, Cell.renderRowEdit(h, params));
|
|
856
972
|
},
|
|
857
973
|
// 单元格编辑模式
|
|
858
|
-
renderCellEdit
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
974
|
+
renderCellEdit(h, params) {
|
|
975
|
+
const {
|
|
976
|
+
$table,
|
|
977
|
+
column
|
|
978
|
+
} = params;
|
|
979
|
+
const {
|
|
980
|
+
editRender
|
|
981
|
+
} = column;
|
|
982
|
+
const {
|
|
983
|
+
actived
|
|
984
|
+
} = $table.editStore;
|
|
863
985
|
return Cell.runRenderer(h, params, this, (0, _utils.isEnableConf)(editRender) && actived && actived.row === params.row && actived.column === params.column);
|
|
864
986
|
},
|
|
865
|
-
renderTreeCellEdit
|
|
987
|
+
renderTreeCellEdit(h, params) {
|
|
866
988
|
return Cell.renderTreeIcon(h, params, Cell.renderCellEdit(h, params));
|
|
867
989
|
},
|
|
868
|
-
runRenderer
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
990
|
+
runRenderer(h, params, _vm, isEdit) {
|
|
991
|
+
const {
|
|
992
|
+
$table,
|
|
993
|
+
column
|
|
994
|
+
} = params;
|
|
995
|
+
const {
|
|
996
|
+
slots,
|
|
997
|
+
editRender,
|
|
998
|
+
formatter
|
|
999
|
+
} = column;
|
|
1000
|
+
const compConf = renderer.get(editRender.name);
|
|
1001
|
+
const rtEdit = compConf ? compConf.renderTableEdit || compConf.renderEdit : null;
|
|
1002
|
+
const cellParams = Object.assign({
|
|
877
1003
|
$type: '',
|
|
878
|
-
isEdit
|
|
1004
|
+
isEdit
|
|
879
1005
|
}, params);
|
|
880
1006
|
if (isEdit) {
|
|
881
1007
|
if (slots && slots.edit) {
|