vxe-table 3.9.0-rc.9 → 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 -1
- package/es/locale/lang/es-ES.js +2 -1
- package/es/locale/lang/hu-HU.js +2 -1
- package/es/locale/lang/ja-JP.js +2 -1
- package/es/locale/lang/ko-KR.js +2 -1
- package/es/locale/lang/pt-BR.js +2 -1
- package/es/locale/lang/ru-RU.js +2 -1
- package/es/locale/lang/uk-UA.js +2 -1
- package/es/locale/lang/vi-VN.js +2 -1
- package/es/locale/lang/zh-CHT.js +2 -1
- package/es/locale/lang/zh-CN.js +2 -1
- 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 +91 -57
- 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 +9174 -17260
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/en-US.js +2 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +2 -1
- 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.js +2 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +2 -1
- package/lib/locale/lang/ja-JP.js +2 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -1
- package/lib/locale/lang/ko-KR.js +2 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +2 -1
- package/lib/locale/lang/pt-BR.js +2 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +2 -1
- package/lib/locale/lang/ru-RU.js +2 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +2 -1
- package/lib/locale/lang/uk-UA.js +2 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +2 -1
- package/lib/locale/lang/vi-VN.js +2 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +2 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CHT.umd.js +2 -1
- package/lib/locale/lang/zh-CN.js +2 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +2 -1
- 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 +465 -424
- 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 -1
- package/packages/locale/lang/es-ES.ts +2 -1
- package/packages/locale/lang/hu-HU.ts +2 -1
- package/packages/locale/lang/ja-JP.ts +2 -1
- package/packages/locale/lang/ko-KR.ts +2 -1
- package/packages/locale/lang/pt-BR.ts +2 -1
- package/packages/locale/lang/ru-RU.ts +2 -1
- package/packages/locale/lang/uk-UA.ts +2 -1
- package/packages/locale/lang/vi-VN.ts +2 -1
- package/packages/locale/lang/zh-CHT.ts +2 -1
- package/packages/locale/lang/zh-CN.ts +2 -1
- 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 +99 -54
- 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.1726453742001.ttf → iconfont.1728348263835.ttf} +0 -0
- /package/es/{iconfont.1726453742001.woff → iconfont.1728348263835.woff} +0 -0
- /package/es/{iconfont.1726453742001.woff2 → iconfont.1728348263835.woff2} +0 -0
- /package/lib/{iconfont.1726453742001.ttf → iconfont.1728348263835.ttf} +0 -0
- /package/lib/{iconfont.1726453742001.woff → iconfont.1728348263835.woff} +0 -0
- /package/lib/{iconfont.1726453742001.woff2 → iconfont.1728348263835.woff2} +0 -0
|
@@ -7,54 +7,59 @@ var _utils = require("../../ui/src/utils");
|
|
|
7
7
|
var _vn = require("../../ui/src/vn");
|
|
8
8
|
var _log = require("../../ui/src/log");
|
|
9
9
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var componentDefaultModelProp = 'value';
|
|
18
|
-
var defaultCompProps = {
|
|
10
|
+
const {
|
|
11
|
+
getConfig,
|
|
12
|
+
renderer,
|
|
13
|
+
getI18n
|
|
14
|
+
} = _ui.VxeUI;
|
|
15
|
+
const componentDefaultModelProp = 'value';
|
|
16
|
+
const defaultCompProps = {
|
|
19
17
|
transfer: true
|
|
20
18
|
};
|
|
21
19
|
function parseDate(value, props) {
|
|
22
20
|
return value && props.valueFormat ? _xeUtils.default.toStringDate(value, props.valueFormat) : value;
|
|
23
21
|
}
|
|
24
22
|
function getFormatDate(value, props, defaultFormat) {
|
|
25
|
-
|
|
26
|
-
dateConfig =
|
|
23
|
+
const {
|
|
24
|
+
dateConfig = {}
|
|
25
|
+
} = props;
|
|
27
26
|
return _xeUtils.default.toDateString(parseDate(value, props), dateConfig.labelFormat || defaultFormat);
|
|
28
27
|
}
|
|
29
28
|
function getLabelFormatDate(value, props) {
|
|
30
|
-
return getFormatDate(value, props, getI18n(
|
|
29
|
+
return getFormatDate(value, props, getI18n(`vxe.input.date.labelFormat.${props.type || 'date'}`));
|
|
31
30
|
}
|
|
32
31
|
/**
|
|
33
32
|
* 已废弃
|
|
34
33
|
* @deprecated
|
|
35
34
|
*/
|
|
36
35
|
function getOldComponentName(name) {
|
|
37
|
-
return
|
|
36
|
+
return `vxe-${name.replace('$', '')}`;
|
|
38
37
|
}
|
|
39
38
|
/**
|
|
40
39
|
* 已废弃
|
|
41
40
|
* @deprecated
|
|
42
41
|
*/
|
|
43
|
-
function getOldComponent(
|
|
44
|
-
|
|
42
|
+
function getOldComponent({
|
|
43
|
+
name
|
|
44
|
+
}) {
|
|
45
45
|
return getOldComponentName(name);
|
|
46
46
|
}
|
|
47
|
-
function getDefaultComponent(
|
|
48
|
-
|
|
47
|
+
function getDefaultComponent({
|
|
48
|
+
name
|
|
49
|
+
}) {
|
|
49
50
|
return name;
|
|
50
51
|
}
|
|
51
52
|
function handleConfirmFilter(params, checked, option) {
|
|
52
|
-
|
|
53
|
+
const {
|
|
54
|
+
$panel
|
|
55
|
+
} = params;
|
|
53
56
|
$panel.changeOption({}, checked, option);
|
|
54
57
|
}
|
|
55
58
|
function getNativeAttrs(renderOpts) {
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
let {
|
|
60
|
+
name,
|
|
61
|
+
attrs
|
|
62
|
+
} = renderOpts;
|
|
58
63
|
if (name === 'input') {
|
|
59
64
|
attrs = Object.assign({
|
|
60
65
|
type: 'text'
|
|
@@ -63,13 +68,16 @@ function getNativeAttrs(renderOpts) {
|
|
|
63
68
|
return attrs;
|
|
64
69
|
}
|
|
65
70
|
function getInputImmediateModel(renderOpts) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
71
|
+
const {
|
|
72
|
+
name,
|
|
73
|
+
immediate,
|
|
74
|
+
props
|
|
75
|
+
} = renderOpts;
|
|
69
76
|
if (!immediate) {
|
|
70
77
|
if (name === 'VxeInput' || name === '$input') {
|
|
71
|
-
|
|
72
|
-
type
|
|
78
|
+
const {
|
|
79
|
+
type
|
|
80
|
+
} = props || {};
|
|
73
81
|
return !(!type || type === 'text' || type === 'number' || type === 'integer' || type === 'float');
|
|
74
82
|
}
|
|
75
83
|
if (name === 'input' || name === 'textarea' || name === '$textarea') {
|
|
@@ -82,16 +90,22 @@ function getInputImmediateModel(renderOpts) {
|
|
|
82
90
|
function getCellEditProps(renderOpts, params, value, defaultProps) {
|
|
83
91
|
return _xeUtils.default.assign({
|
|
84
92
|
immediate: getInputImmediateModel(renderOpts)
|
|
85
|
-
}, defaultCompProps, defaultProps, renderOpts.props,
|
|
93
|
+
}, defaultCompProps, defaultProps, renderOpts.props, {
|
|
94
|
+
[componentDefaultModelProp]: value
|
|
95
|
+
});
|
|
86
96
|
}
|
|
87
97
|
function getCellEditFilterProps(renderOpts, params, value, defaultProps) {
|
|
88
|
-
return _xeUtils.default.assign({}, defaultCompProps, defaultProps, renderOpts.props,
|
|
98
|
+
return _xeUtils.default.assign({}, defaultCompProps, defaultProps, renderOpts.props, {
|
|
99
|
+
[componentDefaultModelProp]: value
|
|
100
|
+
});
|
|
89
101
|
}
|
|
90
102
|
function isImmediateCell(renderOpts, params) {
|
|
91
103
|
return params.$type === 'cell' || getInputImmediateModel(renderOpts);
|
|
92
104
|
}
|
|
93
105
|
function getCellLabelVNs(h, renderOpts, params, cellLabel) {
|
|
94
|
-
|
|
106
|
+
const {
|
|
107
|
+
placeholder
|
|
108
|
+
} = renderOpts;
|
|
95
109
|
return [h('span', {
|
|
96
110
|
class: 'vxe-cell--label'
|
|
97
111
|
}, placeholder && (0, _utils.isEmptyValue)(cellLabel) ? [h('span', {
|
|
@@ -106,18 +120,17 @@ function getCellLabelVNs(h, renderOpts, params, cellLabel) {
|
|
|
106
120
|
* @param changeFunc
|
|
107
121
|
*/
|
|
108
122
|
function getNativeElementOns(renderOpts, params, modelFunc, changeFunc) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
123
|
+
const {
|
|
124
|
+
events
|
|
125
|
+
} = renderOpts;
|
|
126
|
+
const modelEvent = (0, _vn.getModelEvent)(renderOpts);
|
|
127
|
+
const changeEvent = (0, _vn.getChangeEvent)(renderOpts);
|
|
128
|
+
const isSameEvent = changeEvent === modelEvent;
|
|
129
|
+
const ons = {};
|
|
114
130
|
if (events) {
|
|
115
|
-
_xeUtils.default.objectEach(events,
|
|
116
|
-
ons[(0, _vn.getOnName)(key)] = function () {
|
|
117
|
-
|
|
118
|
-
args[_key] = arguments[_key];
|
|
119
|
-
}
|
|
120
|
-
func.apply(void 0, [params].concat(args));
|
|
131
|
+
_xeUtils.default.objectEach(events, (func, key) => {
|
|
132
|
+
ons[(0, _vn.getOnName)(key)] = function (...args) {
|
|
133
|
+
func(params, ...args);
|
|
121
134
|
};
|
|
122
135
|
});
|
|
123
136
|
}
|
|
@@ -133,13 +146,10 @@ function getNativeElementOns(renderOpts, params, modelFunc, changeFunc) {
|
|
|
133
146
|
};
|
|
134
147
|
}
|
|
135
148
|
if (!isSameEvent && changeFunc) {
|
|
136
|
-
ons[(0, _vn.getOnName)(changeEvent)] = function () {
|
|
137
|
-
|
|
138
|
-
args[_key2] = arguments[_key2];
|
|
139
|
-
}
|
|
140
|
-
changeFunc.apply(void 0, args);
|
|
149
|
+
ons[(0, _vn.getOnName)(changeEvent)] = function (...args) {
|
|
150
|
+
changeFunc(...args);
|
|
141
151
|
if (events && events[changeEvent]) {
|
|
142
|
-
events[changeEvent]
|
|
152
|
+
events[changeEvent](params, ...args);
|
|
143
153
|
}
|
|
144
154
|
};
|
|
145
155
|
}
|
|
@@ -153,21 +163,20 @@ function getNativeElementOns(renderOpts, params, modelFunc, changeFunc) {
|
|
|
153
163
|
* @param changeFunc
|
|
154
164
|
*/
|
|
155
165
|
function getComponentOns(renderOpts, params, modelFunc, changeFunc) {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
166
|
+
const {
|
|
167
|
+
events
|
|
168
|
+
} = renderOpts;
|
|
169
|
+
const modelEvent = (0, _vn.getModelEvent)(renderOpts);
|
|
170
|
+
const changeEvent = (0, _vn.getChangeEvent)(renderOpts);
|
|
171
|
+
const ons = {};
|
|
172
|
+
_xeUtils.default.objectEach(events, (func, key) => {
|
|
173
|
+
ons[(0, _vn.getOnName)(key)] = function (...args) {
|
|
162
174
|
if (process.env.NODE_ENV === 'development') {
|
|
163
175
|
if (!_xeUtils.default.isFunction(func)) {
|
|
164
176
|
(0, _log.errLog)('vxe.error.errFunc', [func]);
|
|
165
177
|
}
|
|
166
178
|
}
|
|
167
|
-
|
|
168
|
-
args[_key3] = arguments[_key3];
|
|
169
|
-
}
|
|
170
|
-
func.apply(void 0, [params].concat(args));
|
|
179
|
+
func(params, ...args);
|
|
171
180
|
};
|
|
172
181
|
});
|
|
173
182
|
if (modelFunc) {
|
|
@@ -179,36 +188,39 @@ function getComponentOns(renderOpts, params, modelFunc, changeFunc) {
|
|
|
179
188
|
};
|
|
180
189
|
}
|
|
181
190
|
if (changeFunc) {
|
|
182
|
-
ons[(0, _vn.getOnName)(changeEvent)] = function () {
|
|
183
|
-
|
|
184
|
-
args[_key4] = arguments[_key4];
|
|
185
|
-
}
|
|
186
|
-
changeFunc.apply(void 0, args);
|
|
191
|
+
ons[(0, _vn.getOnName)(changeEvent)] = function (...args) {
|
|
192
|
+
changeFunc(...args);
|
|
187
193
|
if (events && events[changeEvent]) {
|
|
188
|
-
events[changeEvent]
|
|
194
|
+
events[changeEvent](params, ...args);
|
|
189
195
|
}
|
|
190
196
|
};
|
|
191
197
|
}
|
|
192
198
|
return ons;
|
|
193
199
|
}
|
|
194
200
|
function getEditOns(renderOpts, params) {
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
201
|
+
const {
|
|
202
|
+
$table,
|
|
203
|
+
row,
|
|
204
|
+
column
|
|
205
|
+
} = params;
|
|
206
|
+
const {
|
|
207
|
+
name
|
|
208
|
+
} = renderOpts;
|
|
209
|
+
const {
|
|
210
|
+
model
|
|
211
|
+
} = column;
|
|
212
|
+
const isImmediate = isImmediateCell(renderOpts, params);
|
|
213
|
+
return getComponentOns(renderOpts, params, cellValue => {
|
|
202
214
|
// 处理 model 值双向绑定
|
|
203
215
|
model.update = true;
|
|
204
216
|
model.value = cellValue;
|
|
205
217
|
if (isImmediate) {
|
|
206
218
|
(0, _util.setCellValue)(row, column, cellValue);
|
|
207
219
|
}
|
|
208
|
-
},
|
|
220
|
+
}, eventParams => {
|
|
209
221
|
// 处理 change 事件相关逻辑
|
|
210
222
|
if (!isImmediate && ['VxeInput', 'VxeNumberInput', 'VxeTextarea', '$input', '$textarea'].includes(name)) {
|
|
211
|
-
|
|
223
|
+
const cellValue = eventParams.value;
|
|
212
224
|
model.update = true;
|
|
213
225
|
model.value = cellValue;
|
|
214
226
|
$table.updateStatus(params, cellValue);
|
|
@@ -218,38 +230,42 @@ function getEditOns(renderOpts, params) {
|
|
|
218
230
|
});
|
|
219
231
|
}
|
|
220
232
|
function getFilterOns(renderOpts, params, option) {
|
|
221
|
-
return getComponentOns(renderOpts, params,
|
|
233
|
+
return getComponentOns(renderOpts, params, value => {
|
|
222
234
|
// 处理 model 值双向绑定
|
|
223
235
|
option.data = value;
|
|
224
|
-
},
|
|
236
|
+
}, () => {
|
|
225
237
|
handleConfirmFilter(params, !_xeUtils.default.eqNull(option.data), option);
|
|
226
238
|
});
|
|
227
239
|
}
|
|
228
240
|
function getNativeEditOns(renderOpts, params) {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
241
|
+
const {
|
|
242
|
+
$table,
|
|
243
|
+
row,
|
|
244
|
+
column
|
|
245
|
+
} = params;
|
|
246
|
+
const {
|
|
247
|
+
model
|
|
248
|
+
} = column;
|
|
249
|
+
return getNativeElementOns(renderOpts, params, evnt => {
|
|
234
250
|
// 处理 model 值双向绑定
|
|
235
|
-
|
|
251
|
+
const cellValue = evnt.target.value;
|
|
236
252
|
if (isImmediateCell(renderOpts, params)) {
|
|
237
253
|
(0, _util.setCellValue)(row, column, cellValue);
|
|
238
254
|
} else {
|
|
239
255
|
model.update = true;
|
|
240
256
|
model.value = cellValue;
|
|
241
257
|
}
|
|
242
|
-
},
|
|
258
|
+
}, evnt => {
|
|
243
259
|
// 处理 change 事件相关逻辑
|
|
244
|
-
|
|
260
|
+
const cellValue = evnt.target.value;
|
|
245
261
|
$table.updateStatus(params, cellValue);
|
|
246
262
|
});
|
|
247
263
|
}
|
|
248
264
|
function getNativeFilterOns(renderOpts, params, option) {
|
|
249
|
-
return getNativeElementOns(renderOpts, params,
|
|
265
|
+
return getNativeElementOns(renderOpts, params, evnt => {
|
|
250
266
|
// 处理 model 值双向绑定
|
|
251
267
|
option.data = evnt.target.value;
|
|
252
|
-
},
|
|
268
|
+
}, () => {
|
|
253
269
|
handleConfirmFilter(params, !_xeUtils.default.eqNull(option.data), option);
|
|
254
270
|
});
|
|
255
271
|
}
|
|
@@ -258,12 +274,16 @@ function getNativeFilterOns(renderOpts, params, option) {
|
|
|
258
274
|
* input、textarea、select
|
|
259
275
|
*/
|
|
260
276
|
function nativeEditRender(h, renderOpts, params) {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
277
|
+
const {
|
|
278
|
+
row,
|
|
279
|
+
column
|
|
280
|
+
} = params;
|
|
281
|
+
const {
|
|
282
|
+
name
|
|
283
|
+
} = renderOpts;
|
|
284
|
+
const cellValue = isImmediateCell(renderOpts, params) ? (0, _util.getCellValue)(row, column) : column.model.value;
|
|
265
285
|
return [h(name, {
|
|
266
|
-
class:
|
|
286
|
+
class: `vxe-default-${name}`,
|
|
267
287
|
attrs: getNativeAttrs(renderOpts),
|
|
268
288
|
domProps: {
|
|
269
289
|
value: cellValue
|
|
@@ -278,22 +298,28 @@ function buttonCellRender(h, renderOpts, params) {
|
|
|
278
298
|
})];
|
|
279
299
|
}
|
|
280
300
|
function defaultEditRender(h, renderOpts, params) {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
301
|
+
const {
|
|
302
|
+
row,
|
|
303
|
+
column
|
|
304
|
+
} = params;
|
|
305
|
+
const cellValue = (0, _util.getCellValue)(row, column);
|
|
284
306
|
return [h(getDefaultComponent(renderOpts), {
|
|
285
307
|
props: getCellEditProps(renderOpts, params, cellValue),
|
|
286
308
|
on: getEditOns(renderOpts, params)
|
|
287
309
|
})];
|
|
288
310
|
}
|
|
289
311
|
function radioAndCheckboxEditRender(h, renderOpts, params) {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
312
|
+
const {
|
|
313
|
+
options
|
|
314
|
+
} = renderOpts;
|
|
315
|
+
const {
|
|
316
|
+
row,
|
|
317
|
+
column
|
|
318
|
+
} = params;
|
|
319
|
+
const cellValue = (0, _util.getCellValue)(row, column);
|
|
294
320
|
return [h(getDefaultComponent(renderOpts), {
|
|
295
321
|
props: Object.assign({
|
|
296
|
-
options
|
|
322
|
+
options
|
|
297
323
|
}, getCellEditProps(renderOpts, params, cellValue)),
|
|
298
324
|
on: getEditOns(renderOpts, params)
|
|
299
325
|
})];
|
|
@@ -303,9 +329,11 @@ function radioAndCheckboxEditRender(h, renderOpts, params) {
|
|
|
303
329
|
* @deprecated
|
|
304
330
|
*/
|
|
305
331
|
function oldEditRender(h, renderOpts, params) {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
332
|
+
const {
|
|
333
|
+
row,
|
|
334
|
+
column
|
|
335
|
+
} = params;
|
|
336
|
+
const cellValue = (0, _util.getCellValue)(row, column);
|
|
309
337
|
return [h(getOldComponent(renderOpts), {
|
|
310
338
|
props: getCellEditProps(renderOpts, params, cellValue),
|
|
311
339
|
on: getEditOns(renderOpts, params)
|
|
@@ -326,17 +354,16 @@ function oldButtonEditRender(h, renderOpts, params) {
|
|
|
326
354
|
* @deprecated
|
|
327
355
|
*/
|
|
328
356
|
function oldButtonsEditRender(h, renderOpts, params) {
|
|
329
|
-
return renderOpts.children.map(
|
|
330
|
-
return oldButtonEditRender(h, childRenderOpts, params)[0];
|
|
331
|
-
});
|
|
357
|
+
return renderOpts.children.map(childRenderOpts => oldButtonEditRender(h, childRenderOpts, params)[0]);
|
|
332
358
|
}
|
|
333
359
|
function renderNativeOptgroups(h, renderOpts, params, renderOptionsMethods) {
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
optionGroupProps =
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
360
|
+
const {
|
|
361
|
+
optionGroups,
|
|
362
|
+
optionGroupProps = {}
|
|
363
|
+
} = renderOpts;
|
|
364
|
+
const groupOptions = optionGroupProps.options || 'options';
|
|
365
|
+
const groupLabel = optionGroupProps.label || 'label';
|
|
366
|
+
return optionGroups.map((group, gIndex) => {
|
|
340
367
|
return h('optgroup', {
|
|
341
368
|
key: gIndex,
|
|
342
369
|
attrs: {
|
|
@@ -349,15 +376,18 @@ function renderNativeOptgroups(h, renderOpts, params, renderOptionsMethods) {
|
|
|
349
376
|
* 渲染原生的 option 标签
|
|
350
377
|
*/
|
|
351
378
|
function renderNativeOptions(h, options, renderOpts, params) {
|
|
352
|
-
|
|
353
|
-
optionProps =
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
379
|
+
const {
|
|
380
|
+
optionProps = {}
|
|
381
|
+
} = renderOpts;
|
|
382
|
+
const {
|
|
383
|
+
row,
|
|
384
|
+
column
|
|
385
|
+
} = params;
|
|
386
|
+
const labelProp = optionProps.label || 'label';
|
|
387
|
+
const valueProp = optionProps.value || 'value';
|
|
388
|
+
const disabledProp = optionProps.disabled || 'disabled';
|
|
389
|
+
const cellValue = isImmediateCell(renderOpts, params) ? (0, _util.getCellValue)(row, column) : column.model.value;
|
|
390
|
+
return options.map((option, oIndex) => {
|
|
361
391
|
return h('option', {
|
|
362
392
|
key: oIndex,
|
|
363
393
|
attrs: {
|
|
@@ -372,14 +402,18 @@ function renderNativeOptions(h, options, renderOpts, params) {
|
|
|
372
402
|
});
|
|
373
403
|
}
|
|
374
404
|
function nativeFilterRender(h, renderOpts, params) {
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
405
|
+
const {
|
|
406
|
+
column
|
|
407
|
+
} = params;
|
|
408
|
+
const {
|
|
409
|
+
name
|
|
410
|
+
} = renderOpts;
|
|
411
|
+
const attrs = getNativeAttrs(renderOpts);
|
|
412
|
+
return column.filters.map((option, oIndex) => {
|
|
379
413
|
return h(name, {
|
|
380
414
|
key: oIndex,
|
|
381
|
-
class:
|
|
382
|
-
attrs
|
|
415
|
+
class: `vxe-default-${name}`,
|
|
416
|
+
attrs,
|
|
383
417
|
domProps: {
|
|
384
418
|
value: option.data
|
|
385
419
|
},
|
|
@@ -388,9 +422,11 @@ function nativeFilterRender(h, renderOpts, params) {
|
|
|
388
422
|
});
|
|
389
423
|
}
|
|
390
424
|
function defaultFilterRender(h, renderOpts, params) {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
425
|
+
const {
|
|
426
|
+
column
|
|
427
|
+
} = params;
|
|
428
|
+
return column.filters.map((option, oIndex) => {
|
|
429
|
+
const optionValue = option.data;
|
|
394
430
|
return h(getDefaultComponent(renderOpts), {
|
|
395
431
|
key: oIndex,
|
|
396
432
|
props: getCellEditFilterProps(renderOpts, renderOpts, optionValue),
|
|
@@ -403,9 +439,11 @@ function defaultFilterRender(h, renderOpts, params) {
|
|
|
403
439
|
* @deprecated
|
|
404
440
|
*/
|
|
405
441
|
function oldFilterRender(h, renderOpts, params) {
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
442
|
+
const {
|
|
443
|
+
column
|
|
444
|
+
} = params;
|
|
445
|
+
return column.filters.map((option, oIndex) => {
|
|
446
|
+
const optionValue = option.data;
|
|
409
447
|
return h(getOldComponent(renderOpts), {
|
|
410
448
|
key: oIndex,
|
|
411
449
|
props: getCellEditFilterProps(renderOpts, renderOpts, optionValue),
|
|
@@ -413,21 +451,27 @@ function oldFilterRender(h, renderOpts, params) {
|
|
|
413
451
|
});
|
|
414
452
|
});
|
|
415
453
|
}
|
|
416
|
-
function handleFilterMethod(
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
454
|
+
function handleFilterMethod({
|
|
455
|
+
option,
|
|
456
|
+
row,
|
|
457
|
+
column
|
|
458
|
+
}) {
|
|
459
|
+
const {
|
|
460
|
+
data
|
|
461
|
+
} = option;
|
|
462
|
+
const cellValue = _xeUtils.default.get(row, column.field);
|
|
422
463
|
/* eslint-disable eqeqeq */
|
|
423
464
|
return cellValue == data;
|
|
424
465
|
}
|
|
425
|
-
function handleInputFilterMethod(
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
466
|
+
function handleInputFilterMethod({
|
|
467
|
+
option,
|
|
468
|
+
row,
|
|
469
|
+
column
|
|
470
|
+
}) {
|
|
471
|
+
const {
|
|
472
|
+
data
|
|
473
|
+
} = option;
|
|
474
|
+
const cellValue = _xeUtils.default.get(row, column.field);
|
|
431
475
|
/* eslint-disable eqeqeq */
|
|
432
476
|
return _xeUtils.default.toValueString(cellValue).indexOf(data) > -1;
|
|
433
477
|
}
|
|
@@ -439,33 +483,41 @@ function nativeSelectEditRender(h, renderOpts, params) {
|
|
|
439
483
|
}, renderOpts.optionGroups ? renderNativeOptgroups(h, renderOpts, params, renderNativeOptions) : renderNativeOptions(h, renderOpts.options, renderOpts, params))];
|
|
440
484
|
}
|
|
441
485
|
function defaultSelectEditRender(h, renderOpts, params) {
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
486
|
+
const {
|
|
487
|
+
row,
|
|
488
|
+
column
|
|
489
|
+
} = params;
|
|
490
|
+
const {
|
|
491
|
+
options,
|
|
492
|
+
optionProps,
|
|
493
|
+
optionGroups,
|
|
494
|
+
optionGroupProps
|
|
495
|
+
} = renderOpts;
|
|
496
|
+
const cellValue = (0, _util.getCellValue)(row, column);
|
|
449
497
|
return [h(getDefaultComponent(renderOpts), {
|
|
450
498
|
props: getCellEditProps(renderOpts, params, cellValue, {
|
|
451
|
-
options
|
|
452
|
-
optionProps
|
|
453
|
-
optionGroups
|
|
454
|
-
optionGroupProps
|
|
499
|
+
options,
|
|
500
|
+
optionProps,
|
|
501
|
+
optionGroups,
|
|
502
|
+
optionGroupProps
|
|
455
503
|
}),
|
|
456
504
|
on: getEditOns(renderOpts, params)
|
|
457
505
|
})];
|
|
458
506
|
}
|
|
459
507
|
function defaultTreeSelectEditRender(h, renderOpts, params) {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
508
|
+
const {
|
|
509
|
+
row,
|
|
510
|
+
column
|
|
511
|
+
} = params;
|
|
512
|
+
const {
|
|
513
|
+
options,
|
|
514
|
+
optionProps
|
|
515
|
+
} = renderOpts;
|
|
516
|
+
const cellValue = (0, _util.getCellValue)(row, column);
|
|
465
517
|
return [h(getDefaultComponent(renderOpts), {
|
|
466
518
|
props: getCellEditProps(renderOpts, params, cellValue, {
|
|
467
|
-
options
|
|
468
|
-
optionProps
|
|
519
|
+
options,
|
|
520
|
+
optionProps
|
|
469
521
|
}),
|
|
470
522
|
on: getEditOns(renderOpts, params)
|
|
471
523
|
})];
|
|
@@ -475,93 +527,100 @@ function defaultTreeSelectEditRender(h, renderOpts, params) {
|
|
|
475
527
|
* @deprecated
|
|
476
528
|
*/
|
|
477
529
|
function oldSelectEditRender(h, renderOpts, params) {
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
530
|
+
const {
|
|
531
|
+
row,
|
|
532
|
+
column
|
|
533
|
+
} = params;
|
|
534
|
+
const {
|
|
535
|
+
options,
|
|
536
|
+
optionProps,
|
|
537
|
+
optionGroups,
|
|
538
|
+
optionGroupProps
|
|
539
|
+
} = renderOpts;
|
|
540
|
+
const cellValue = (0, _util.getCellValue)(row, column);
|
|
485
541
|
return [h(getOldComponent(renderOpts), {
|
|
486
542
|
props: getCellEditProps(renderOpts, params, cellValue, {
|
|
487
|
-
options
|
|
488
|
-
optionProps
|
|
489
|
-
optionGroups
|
|
490
|
-
optionGroupProps
|
|
543
|
+
options,
|
|
544
|
+
optionProps,
|
|
545
|
+
optionGroups,
|
|
546
|
+
optionGroupProps
|
|
491
547
|
}),
|
|
492
548
|
on: getEditOns(renderOpts, params)
|
|
493
549
|
})];
|
|
494
550
|
}
|
|
495
|
-
function getSelectCellValue(renderOpts,
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
optionGroupProps =
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
551
|
+
function getSelectCellValue(renderOpts, {
|
|
552
|
+
row,
|
|
553
|
+
column
|
|
554
|
+
}) {
|
|
555
|
+
const {
|
|
556
|
+
options,
|
|
557
|
+
optionGroups,
|
|
558
|
+
optionProps = {},
|
|
559
|
+
optionGroupProps = {}
|
|
560
|
+
} = renderOpts;
|
|
561
|
+
const cellValue = _xeUtils.default.get(row, column.field);
|
|
562
|
+
let selectItem;
|
|
563
|
+
const labelProp = optionProps.label || 'label';
|
|
564
|
+
const valueProp = optionProps.value || 'value';
|
|
508
565
|
if (!(cellValue === null || cellValue === undefined)) {
|
|
509
|
-
return _xeUtils.default.map(_xeUtils.default.isArray(cellValue) ? cellValue : [cellValue], optionGroups ?
|
|
510
|
-
|
|
511
|
-
for (
|
|
566
|
+
return _xeUtils.default.map(_xeUtils.default.isArray(cellValue) ? cellValue : [cellValue], optionGroups ? value => {
|
|
567
|
+
const groupOptions = optionGroupProps.options || 'options';
|
|
568
|
+
for (let index = 0; index < optionGroups.length; index++) {
|
|
512
569
|
/* eslint-disable eqeqeq */
|
|
513
|
-
selectItem = _xeUtils.default.find(optionGroups[index][groupOptions],
|
|
514
|
-
return item[valueProp] == value;
|
|
515
|
-
});
|
|
570
|
+
selectItem = _xeUtils.default.find(optionGroups[index][groupOptions], item => item[valueProp] == value);
|
|
516
571
|
if (selectItem) {
|
|
517
572
|
break;
|
|
518
573
|
}
|
|
519
574
|
}
|
|
520
575
|
return selectItem ? selectItem[labelProp] : value;
|
|
521
|
-
} :
|
|
576
|
+
} : value => {
|
|
522
577
|
/* eslint-disable eqeqeq */
|
|
523
|
-
selectItem = _xeUtils.default.find(options,
|
|
524
|
-
return item[valueProp] == value;
|
|
525
|
-
});
|
|
578
|
+
selectItem = _xeUtils.default.find(options, item => item[valueProp] == value);
|
|
526
579
|
return selectItem ? selectItem[labelProp] : value;
|
|
527
580
|
}).join(', ');
|
|
528
581
|
}
|
|
529
582
|
return '';
|
|
530
583
|
}
|
|
531
584
|
function handleExportSelectMethod(params) {
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
585
|
+
const {
|
|
586
|
+
row,
|
|
587
|
+
column,
|
|
588
|
+
options
|
|
589
|
+
} = params;
|
|
535
590
|
return options.original ? (0, _util.getCellValue)(row, column) : getSelectCellValue(column.editRender || column.cellRender, params);
|
|
536
591
|
}
|
|
537
|
-
function getTreeSelectCellValue(renderOpts,
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
592
|
+
function getTreeSelectCellValue(renderOpts, {
|
|
593
|
+
row,
|
|
594
|
+
column
|
|
595
|
+
}) {
|
|
596
|
+
const {
|
|
597
|
+
options,
|
|
598
|
+
optionProps = {}
|
|
599
|
+
} = renderOpts;
|
|
600
|
+
const cellValue = _xeUtils.default.get(row, column.field);
|
|
601
|
+
const labelProp = optionProps.label || 'label';
|
|
602
|
+
const valueProp = optionProps.value || 'value';
|
|
603
|
+
const childrenProp = optionProps.children || 'children';
|
|
547
604
|
if (!(cellValue === null || cellValue === undefined)) {
|
|
548
|
-
|
|
549
|
-
_xeUtils.default.eachTree(options,
|
|
605
|
+
const keyMaps = {};
|
|
606
|
+
_xeUtils.default.eachTree(options, item => {
|
|
550
607
|
keyMaps[_xeUtils.default.get(item, valueProp)] = item;
|
|
551
608
|
}, {
|
|
552
609
|
children: childrenProp
|
|
553
610
|
});
|
|
554
|
-
return _xeUtils.default.map(_xeUtils.default.isArray(cellValue) ? cellValue : [cellValue],
|
|
555
|
-
|
|
611
|
+
return _xeUtils.default.map(_xeUtils.default.isArray(cellValue) ? cellValue : [cellValue], value => {
|
|
612
|
+
const item = keyMaps[value];
|
|
556
613
|
return item ? _xeUtils.default.get(item, labelProp) : item;
|
|
557
614
|
}).join(', ');
|
|
558
615
|
}
|
|
559
616
|
return '';
|
|
560
617
|
}
|
|
561
618
|
function handleExportTreeSelectMethod(params) {
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
619
|
+
const {
|
|
620
|
+
row,
|
|
621
|
+
column,
|
|
622
|
+
options
|
|
623
|
+
} = params;
|
|
565
624
|
return options.original ? (0, _util.getCellValue)(row, column) : getTreeSelectCellValue(column.editRender || column.cellRender, params);
|
|
566
625
|
}
|
|
567
626
|
/**
|
|
@@ -582,12 +641,14 @@ renderer.mixin({
|
|
|
582
641
|
select: {
|
|
583
642
|
renderTableEdit: nativeSelectEditRender,
|
|
584
643
|
renderTableDefault: nativeSelectEditRender,
|
|
585
|
-
renderTableCell
|
|
644
|
+
renderTableCell(h, renderOpts, params) {
|
|
586
645
|
return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
|
|
587
646
|
},
|
|
588
|
-
renderTableFilter
|
|
589
|
-
|
|
590
|
-
|
|
647
|
+
renderTableFilter(h, renderOpts, params) {
|
|
648
|
+
const {
|
|
649
|
+
column
|
|
650
|
+
} = params;
|
|
651
|
+
return column.filters.map((option, oIndex) => {
|
|
591
652
|
return h('select', {
|
|
592
653
|
key: oIndex,
|
|
593
654
|
class: 'vxe-default-select',
|
|
@@ -602,14 +663,17 @@ renderer.mixin({
|
|
|
602
663
|
VxeInput: {
|
|
603
664
|
tableAutoFocus: 'input',
|
|
604
665
|
renderTableEdit: defaultEditRender,
|
|
605
|
-
renderTableCell
|
|
666
|
+
renderTableCell(h, renderOpts, params) {
|
|
606
667
|
var _a;
|
|
607
|
-
|
|
608
|
-
props =
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
668
|
+
const {
|
|
669
|
+
props = {}
|
|
670
|
+
} = renderOpts;
|
|
671
|
+
const {
|
|
672
|
+
row,
|
|
673
|
+
column
|
|
674
|
+
} = params;
|
|
675
|
+
const digits = props.digits || ((_a = getConfig().input) === null || _a === void 0 ? void 0 : _a.digits) || 2;
|
|
676
|
+
let cellValue = _xeUtils.default.get(row, column.field);
|
|
613
677
|
if (cellValue) {
|
|
614
678
|
switch (props.type) {
|
|
615
679
|
case 'date':
|
|
@@ -633,14 +697,17 @@ renderer.mixin({
|
|
|
633
697
|
VxeNumberInput: {
|
|
634
698
|
tableAutoFocus: 'input',
|
|
635
699
|
renderTableEdit: defaultEditRender,
|
|
636
|
-
renderTableCell
|
|
700
|
+
renderTableCell(h, renderOpts, params) {
|
|
637
701
|
var _a;
|
|
638
|
-
|
|
639
|
-
props =
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
702
|
+
const {
|
|
703
|
+
props = {}
|
|
704
|
+
} = renderOpts;
|
|
705
|
+
const {
|
|
706
|
+
row,
|
|
707
|
+
column
|
|
708
|
+
} = params;
|
|
709
|
+
const digits = props.digits || ((_a = getConfig().numberInput) === null || _a === void 0 ? void 0 : _a.digits) || 2;
|
|
710
|
+
let cellValue = _xeUtils.default.get(row, column.field);
|
|
644
711
|
if (cellValue) {
|
|
645
712
|
switch (props.type) {
|
|
646
713
|
case 'float':
|
|
@@ -657,22 +724,17 @@ renderer.mixin({
|
|
|
657
724
|
VxeDatePicker: {
|
|
658
725
|
tableAutoFocus: 'input',
|
|
659
726
|
renderTableEdit: defaultEditRender,
|
|
660
|
-
renderTableCell
|
|
661
|
-
|
|
662
|
-
props =
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
727
|
+
renderTableCell(h, renderOpts, params) {
|
|
728
|
+
const {
|
|
729
|
+
props = {}
|
|
730
|
+
} = renderOpts;
|
|
731
|
+
const {
|
|
732
|
+
row,
|
|
733
|
+
column
|
|
734
|
+
} = params;
|
|
735
|
+
let cellValue = _xeUtils.default.get(row, column.field);
|
|
666
736
|
if (cellValue) {
|
|
667
|
-
|
|
668
|
-
case 'date':
|
|
669
|
-
case 'week':
|
|
670
|
-
case 'month':
|
|
671
|
-
case 'quarter':
|
|
672
|
-
case 'year':
|
|
673
|
-
cellValue = getLabelFormatDate(cellValue, props);
|
|
674
|
-
break;
|
|
675
|
-
}
|
|
737
|
+
cellValue = getLabelFormatDate(cellValue, props);
|
|
676
738
|
}
|
|
677
739
|
return getCellLabelVNs(h, renderOpts, params, cellValue);
|
|
678
740
|
},
|
|
@@ -681,17 +743,20 @@ renderer.mixin({
|
|
|
681
743
|
tableFilterDefaultMethod: handleFilterMethod
|
|
682
744
|
},
|
|
683
745
|
VxeTextarea: {
|
|
684
|
-
tableAutoFocus: '
|
|
746
|
+
tableAutoFocus: 'textarea',
|
|
747
|
+
renderTableEdit: defaultEditRender
|
|
685
748
|
},
|
|
686
749
|
VxeButton: {
|
|
687
750
|
renderTableDefault: buttonCellRender
|
|
688
751
|
},
|
|
689
752
|
VxeButtonGroup: {
|
|
690
|
-
renderTableDefault
|
|
691
|
-
|
|
753
|
+
renderTableDefault(h, renderOpts, params) {
|
|
754
|
+
const {
|
|
755
|
+
options
|
|
756
|
+
} = renderOpts;
|
|
692
757
|
return [h(getDefaultComponent(renderOpts), {
|
|
693
758
|
props: Object.assign({
|
|
694
|
-
options
|
|
759
|
+
options
|
|
695
760
|
}, getCellEditProps(renderOpts, params, null)),
|
|
696
761
|
on: getComponentOns(renderOpts, params)
|
|
697
762
|
})];
|
|
@@ -701,24 +766,28 @@ renderer.mixin({
|
|
|
701
766
|
tableAutoFocus: 'input',
|
|
702
767
|
renderTableEdit: defaultSelectEditRender,
|
|
703
768
|
renderTableDefault: defaultSelectEditRender,
|
|
704
|
-
renderTableCell
|
|
769
|
+
renderTableCell(h, renderOpts, params) {
|
|
705
770
|
return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
|
|
706
771
|
},
|
|
707
|
-
renderTableFilter
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
772
|
+
renderTableFilter(h, renderOpts, params) {
|
|
773
|
+
const {
|
|
774
|
+
column
|
|
775
|
+
} = params;
|
|
776
|
+
const {
|
|
777
|
+
options,
|
|
778
|
+
optionProps,
|
|
779
|
+
optionGroups,
|
|
780
|
+
optionGroupProps
|
|
781
|
+
} = renderOpts;
|
|
782
|
+
return column.filters.map((option, oIndex) => {
|
|
783
|
+
const optionValue = option.data;
|
|
715
784
|
return h(getDefaultComponent(renderOpts), Object.assign(Object.assign({
|
|
716
785
|
key: oIndex
|
|
717
786
|
}, getCellEditFilterProps(renderOpts, params, optionValue, {
|
|
718
|
-
options
|
|
719
|
-
optionProps
|
|
720
|
-
optionGroups
|
|
721
|
-
optionGroupProps
|
|
787
|
+
options,
|
|
788
|
+
optionProps,
|
|
789
|
+
optionGroups,
|
|
790
|
+
optionGroupProps
|
|
722
791
|
})), getFilterOns(renderOpts, params, option)));
|
|
723
792
|
});
|
|
724
793
|
},
|
|
@@ -728,7 +797,7 @@ renderer.mixin({
|
|
|
728
797
|
VxeTreeSelect: {
|
|
729
798
|
tableAutoFocus: 'input',
|
|
730
799
|
renderTableEdit: defaultTreeSelectEditRender,
|
|
731
|
-
renderTableCell
|
|
800
|
+
renderTableCell(h, renderOpts, params) {
|
|
732
801
|
return getCellLabelVNs(h, renderOpts, params, getTreeSelectCellValue(renderOpts, params));
|
|
733
802
|
},
|
|
734
803
|
tableExportMethod: handleExportTreeSelectMethod
|
|
@@ -736,10 +805,12 @@ renderer.mixin({
|
|
|
736
805
|
VxeIconPicker: {
|
|
737
806
|
tableAutoFocus: 'input',
|
|
738
807
|
renderTableEdit: defaultEditRender,
|
|
739
|
-
renderTableCell
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
808
|
+
renderTableCell(h, renderOpts, params) {
|
|
809
|
+
const {
|
|
810
|
+
row,
|
|
811
|
+
column
|
|
812
|
+
} = params;
|
|
813
|
+
const cellValue = _xeUtils.default.get(row, column.field);
|
|
743
814
|
return h('i', {
|
|
744
815
|
class: cellValue
|
|
745
816
|
});
|
|
@@ -762,11 +833,15 @@ renderer.mixin({
|
|
|
762
833
|
renderTableDefault: defaultEditRender
|
|
763
834
|
},
|
|
764
835
|
VxeImage: {
|
|
765
|
-
renderTableDefault
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
836
|
+
renderTableDefault(h, renderOpts, params) {
|
|
837
|
+
const {
|
|
838
|
+
row,
|
|
839
|
+
column
|
|
840
|
+
} = params;
|
|
841
|
+
const {
|
|
842
|
+
props
|
|
843
|
+
} = renderOpts;
|
|
844
|
+
const cellValue = (0, _util.getCellValue)(row, column);
|
|
770
845
|
return [h(getDefaultComponent(renderOpts), {
|
|
771
846
|
props: Object.assign(Object.assign({}, props), {
|
|
772
847
|
src: cellValue
|
|
@@ -776,11 +851,15 @@ renderer.mixin({
|
|
|
776
851
|
}
|
|
777
852
|
},
|
|
778
853
|
VxeImageGroup: {
|
|
779
|
-
renderTableDefault
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
854
|
+
renderTableDefault(h, renderOpts, params) {
|
|
855
|
+
const {
|
|
856
|
+
row,
|
|
857
|
+
column
|
|
858
|
+
} = params;
|
|
859
|
+
const {
|
|
860
|
+
props
|
|
861
|
+
} = renderOpts;
|
|
862
|
+
const cellValue = (0, _util.getCellValue)(row, column);
|
|
784
863
|
return [h(getDefaultComponent(renderOpts), {
|
|
785
864
|
props: Object.assign(Object.assign({}, props), {
|
|
786
865
|
urlList: cellValue
|
|
@@ -789,18 +868,39 @@ renderer.mixin({
|
|
|
789
868
|
})];
|
|
790
869
|
}
|
|
791
870
|
},
|
|
871
|
+
VxeTextEllipsis: {
|
|
872
|
+
renderTableDefault(h, renderOpts, params) {
|
|
873
|
+
const {
|
|
874
|
+
row,
|
|
875
|
+
column
|
|
876
|
+
} = params;
|
|
877
|
+
const {
|
|
878
|
+
props
|
|
879
|
+
} = renderOpts;
|
|
880
|
+
const cellValue = (0, _util.getCellValue)(row, column);
|
|
881
|
+
return [h(getDefaultComponent(renderOpts), {
|
|
882
|
+
props: Object.assign(Object.assign({}, props), {
|
|
883
|
+
content: cellValue
|
|
884
|
+
}),
|
|
885
|
+
on: getEditOns(renderOpts, params)
|
|
886
|
+
})];
|
|
887
|
+
}
|
|
888
|
+
},
|
|
792
889
|
// 以下已废弃
|
|
793
890
|
$input: {
|
|
794
891
|
tableAutoFocus: '.vxe-input--inner',
|
|
795
892
|
renderTableEdit: oldEditRender,
|
|
796
|
-
renderTableCell
|
|
893
|
+
renderTableCell(h, renderOpts, params) {
|
|
797
894
|
var _a;
|
|
798
|
-
|
|
799
|
-
props =
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
895
|
+
const {
|
|
896
|
+
props = {}
|
|
897
|
+
} = renderOpts;
|
|
898
|
+
const {
|
|
899
|
+
row,
|
|
900
|
+
column
|
|
901
|
+
} = params;
|
|
902
|
+
const digits = props.digits || ((_a = getConfig().input) === null || _a === void 0 ? void 0 : _a.digits) || 2;
|
|
903
|
+
let cellValue = _xeUtils.default.get(row, column.field);
|
|
804
904
|
if (cellValue) {
|
|
805
905
|
switch (props.type) {
|
|
806
906
|
case 'date':
|
|
@@ -833,24 +933,28 @@ renderer.mixin({
|
|
|
833
933
|
tableAutoFocus: '.vxe-input--inner',
|
|
834
934
|
renderTableEdit: oldSelectEditRender,
|
|
835
935
|
renderTableDefault: oldSelectEditRender,
|
|
836
|
-
renderTableCell
|
|
936
|
+
renderTableCell(h, renderOpts, params) {
|
|
837
937
|
return getCellLabelVNs(h, renderOpts, params, getSelectCellValue(renderOpts, params));
|
|
838
938
|
},
|
|
839
|
-
renderTableFilter
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
939
|
+
renderTableFilter(h, renderOpts, params) {
|
|
940
|
+
const {
|
|
941
|
+
column
|
|
942
|
+
} = params;
|
|
943
|
+
const {
|
|
944
|
+
options,
|
|
945
|
+
optionProps,
|
|
946
|
+
optionGroups,
|
|
947
|
+
optionGroupProps
|
|
948
|
+
} = renderOpts;
|
|
949
|
+
return column.filters.map((option, oIndex) => {
|
|
950
|
+
const optionValue = option.data;
|
|
847
951
|
return h(getOldComponent(renderOpts), {
|
|
848
952
|
key: oIndex,
|
|
849
953
|
props: getCellEditFilterProps(renderOpts, params, optionValue, {
|
|
850
|
-
options
|
|
851
|
-
optionProps
|
|
852
|
-
optionGroups
|
|
853
|
-
optionGroupProps
|
|
954
|
+
options,
|
|
955
|
+
optionProps,
|
|
956
|
+
optionGroups,
|
|
957
|
+
optionGroupProps
|
|
854
958
|
}),
|
|
855
959
|
on: getFilterOns(renderOpts, params, option)
|
|
856
960
|
});
|