@vxe-ui/plugin-render-antd 3.3.1 → 3.4.1
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/LICENSE +20 -20
- package/README.md +166 -166
- package/dist/index.umd.js +116 -18
- package/dist/index.umd.min.js +1 -1
- package/es/index.esm.js +3 -3
- package/es/index.js +3 -3
- package/es/table/index.js +92 -4
- package/lib/index.common.js +3 -3
- package/lib/index.js +3 -3
- package/lib/index.umd.js +116 -18
- package/lib/index.umd.min.js +1 -1
- package/lib/table/index.js +113 -15
- package/package.json +75 -76
- package/src/form/index.ts +359 -359
- package/src/index.ts +109 -109
- package/src/store/index.ts +3 -3
- package/src/table/index.ts +670 -583
- package/src/util/comp.ts +9 -9
- package/types/index.d.ts +18 -18
package/lib/table/index.js
CHANGED
|
@@ -156,22 +156,83 @@ function defineTableRender(VxeUI) {
|
|
|
156
156
|
return getCellLabelVNs(h, renderOpts, params, cellValue);
|
|
157
157
|
};
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function handleFormatSelect(renderOpts, renderParams) {
|
|
160
|
+
var cellValue = renderParams.cellValue;
|
|
161
|
+
return handleSelectCellValue(cellValue, renderOpts);
|
|
162
|
+
}
|
|
163
|
+
function handleSetSelectValue(renderOpts, renderParams) {
|
|
164
|
+
var row = renderParams.row,
|
|
165
|
+
column = renderParams.column,
|
|
166
|
+
cellValue = renderParams.cellValue;
|
|
167
|
+
var field = column.field;
|
|
168
|
+
if (field) {
|
|
169
|
+
var options = renderOpts.options,
|
|
170
|
+
optionGroups = renderOpts.optionGroups,
|
|
171
|
+
_renderOpts$optionPro = renderOpts.optionProps,
|
|
172
|
+
optionProps = _renderOpts$optionPro === void 0 ? {} : _renderOpts$optionPro,
|
|
173
|
+
_renderOpts$optionGro = renderOpts.optionGroupProps,
|
|
174
|
+
optionGroupProps = _renderOpts$optionGro === void 0 ? {} : _renderOpts$optionGro,
|
|
175
|
+
props = renderOpts.props;
|
|
176
|
+
if (isEmptyValue(cellValue)) {
|
|
177
|
+
_xeUtils["default"].set(row, field, props && props.mode === 'multiple' ? [] : null);
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
var isMultiVal = _xeUtils["default"].indexOf("".concat(cellValue), ',') > -1;
|
|
181
|
+
var labelProp = optionProps.label || 'label';
|
|
182
|
+
var valueProp = optionProps.value || 'value';
|
|
183
|
+
var labelMpas = {};
|
|
184
|
+
if (optionGroups && optionGroups.length) {
|
|
185
|
+
var groupOptions = optionGroupProps.options || 'options';
|
|
186
|
+
for (var i = 0; i < optionGroups.length; i++) {
|
|
187
|
+
var opts = optionGroups[i][groupOptions] || {};
|
|
188
|
+
for (var j = 0; j < opts.length; j++) {
|
|
189
|
+
var item = opts[j];
|
|
190
|
+
if (isMultiVal) {
|
|
191
|
+
labelMpas[item[labelProp]] = item;
|
|
192
|
+
/* eslint-disable eqeqeq */
|
|
193
|
+
} else if (item[labelProp] == cellValue) {
|
|
194
|
+
_xeUtils["default"].set(row, field, item[valueProp]);
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
} else {
|
|
200
|
+
if (options) {
|
|
201
|
+
for (var _i = 0; _i < options.length; _i++) {
|
|
202
|
+
var _item = options[_i];
|
|
203
|
+
if (isMultiVal) {
|
|
204
|
+
labelMpas[_item[labelProp]] = _item;
|
|
205
|
+
/* eslint-disable eqeqeq */
|
|
206
|
+
} else if (_item[labelProp] == cellValue) {
|
|
207
|
+
_xeUtils["default"].set(row, field, _item[valueProp]);
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
if (isMultiVal) {
|
|
214
|
+
_xeUtils["default"].set(row, field, (isMultiVal ? cellValue.split(',') : [cellValue]).map(function (label) {
|
|
215
|
+
var item = labelMpas[label];
|
|
216
|
+
return item ? item[valueProp] : label;
|
|
217
|
+
}));
|
|
218
|
+
} else {
|
|
219
|
+
_xeUtils["default"].set(row, field, cellValue);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
function handleSelectCellValue(cellValue, renderOpts) {
|
|
160
224
|
var _renderOpts$options = renderOpts.options,
|
|
161
225
|
options = _renderOpts$options === void 0 ? [] : _renderOpts$options,
|
|
162
226
|
optionGroups = renderOpts.optionGroups,
|
|
163
227
|
_renderOpts$props2 = renderOpts.props,
|
|
164
228
|
props = _renderOpts$props2 === void 0 ? {} : _renderOpts$props2,
|
|
165
|
-
_renderOpts$
|
|
166
|
-
optionProps = _renderOpts$
|
|
167
|
-
_renderOpts$
|
|
168
|
-
optionGroupProps = _renderOpts$
|
|
169
|
-
var row = params.row,
|
|
170
|
-
column = params.column;
|
|
229
|
+
_renderOpts$optionPro2 = renderOpts.optionProps,
|
|
230
|
+
optionProps = _renderOpts$optionPro2 === void 0 ? {} : _renderOpts$optionPro2,
|
|
231
|
+
_renderOpts$optionGro2 = renderOpts.optionGroupProps,
|
|
232
|
+
optionGroupProps = _renderOpts$optionGro2 === void 0 ? {} : _renderOpts$optionGro2;
|
|
171
233
|
var labelProp = optionProps.label || 'label';
|
|
172
234
|
var valueProp = optionProps.value || 'value';
|
|
173
235
|
var groupOptions = optionGroupProps.options || 'options';
|
|
174
|
-
var cellValue = _xeUtils["default"].get(row, column.field);
|
|
175
236
|
if (!isEmptyValue(cellValue)) {
|
|
176
237
|
return _xeUtils["default"].map(props.mode === 'multiple' ? cellValue : [cellValue], optionGroups ? function (value) {
|
|
177
238
|
var selectItem;
|
|
@@ -193,6 +254,12 @@ function defineTableRender(VxeUI) {
|
|
|
193
254
|
}
|
|
194
255
|
return '';
|
|
195
256
|
}
|
|
257
|
+
function getSelectCellValue(renderOpts, params) {
|
|
258
|
+
var row = params.row,
|
|
259
|
+
column = params.column;
|
|
260
|
+
var cellValue = _xeUtils["default"].get(row, column.field);
|
|
261
|
+
return handleSelectCellValue(cellValue, renderOpts);
|
|
262
|
+
}
|
|
196
263
|
function getCascaderCellValue(renderOpts, params) {
|
|
197
264
|
var _renderOpts$props3 = renderOpts.props,
|
|
198
265
|
props = _renderOpts$props3 === void 0 ? {} : _renderOpts$props3;
|
|
@@ -408,10 +475,10 @@ function defineTableRender(VxeUI) {
|
|
|
408
475
|
var _renderOpts$options2 = renderOpts.options,
|
|
409
476
|
options = _renderOpts$options2 === void 0 ? [] : _renderOpts$options2,
|
|
410
477
|
optionGroups = renderOpts.optionGroups,
|
|
411
|
-
_renderOpts$
|
|
412
|
-
optionProps = _renderOpts$
|
|
413
|
-
_renderOpts$
|
|
414
|
-
optionGroupProps = _renderOpts$
|
|
478
|
+
_renderOpts$optionPro3 = renderOpts.optionProps,
|
|
479
|
+
optionProps = _renderOpts$optionPro3 === void 0 ? {} : _renderOpts$optionPro3,
|
|
480
|
+
_renderOpts$optionGro3 = renderOpts.optionGroupProps,
|
|
481
|
+
optionGroupProps = _renderOpts$optionGro3 === void 0 ? {} : _renderOpts$optionGro3;
|
|
415
482
|
var row = params.row,
|
|
416
483
|
column = params.column;
|
|
417
484
|
var attrs = renderOpts.attrs;
|
|
@@ -444,14 +511,42 @@ function defineTableRender(VxeUI) {
|
|
|
444
511
|
})];
|
|
445
512
|
},
|
|
446
513
|
renderTableCell: function renderTableCell(h, renderOpts, params) {
|
|
447
|
-
|
|
514
|
+
var options = renderOpts.options,
|
|
515
|
+
optionGroups = renderOpts.optionGroups;
|
|
516
|
+
var $table = params.$table,
|
|
517
|
+
row = params.row,
|
|
518
|
+
column = params.column;
|
|
519
|
+
var opSize = options ? options.length : null;
|
|
520
|
+
var ogSize = optionGroups ? optionGroups.length : null;
|
|
521
|
+
if ($table.effectCellData) {
|
|
522
|
+
var _$table$effectCellDat = $table.effectCellData(row, column, {
|
|
523
|
+
key: 'render_table_cell',
|
|
524
|
+
isChanged: function isChanged(_ref) {
|
|
525
|
+
var oldValue = _ref.oldValue,
|
|
526
|
+
cellValue = _ref.cellValue;
|
|
527
|
+
return oldValue && oldValue[0] === cellValue && oldValue[1] === opSize && oldValue[2] === ogSize;
|
|
528
|
+
},
|
|
529
|
+
setValue: function setValue(_ref2) {
|
|
530
|
+
var cellValue = _ref2.cellValue;
|
|
531
|
+
return [cellValue, opSize, ogSize];
|
|
532
|
+
},
|
|
533
|
+
getResult: function getResult(_ref3) {
|
|
534
|
+
var cellValue = _ref3.cellValue;
|
|
535
|
+
return handleSelectCellValue(cellValue, renderOpts);
|
|
536
|
+
}
|
|
537
|
+
}),
|
|
538
|
+
_cellResult = _$table$effectCellDat.cellResult;
|
|
539
|
+
return getCellLabelVNs(h, renderOpts, params, _cellResult);
|
|
540
|
+
}
|
|
541
|
+
var cellResult = getSelectCellValue(renderOpts, params);
|
|
542
|
+
return getCellLabelVNs(h, renderOpts, params, cellResult);
|
|
448
543
|
},
|
|
449
544
|
renderTableFilter: function renderTableFilter(h, renderOpts, params) {
|
|
450
545
|
var _renderOpts$options3 = renderOpts.options,
|
|
451
546
|
options = _renderOpts$options3 === void 0 ? [] : _renderOpts$options3,
|
|
452
547
|
optionGroups = renderOpts.optionGroups,
|
|
453
|
-
_renderOpts$
|
|
454
|
-
optionGroupProps = _renderOpts$
|
|
548
|
+
_renderOpts$optionGro4 = renderOpts.optionGroupProps,
|
|
549
|
+
optionGroupProps = _renderOpts$optionGro4 === void 0 ? {} : _renderOpts$optionGro4;
|
|
455
550
|
var groupOptions = optionGroupProps.options || 'options';
|
|
456
551
|
var column = params.column;
|
|
457
552
|
var attrs = renderOpts.attrs;
|
|
@@ -487,6 +582,9 @@ function defineTableRender(VxeUI) {
|
|
|
487
582
|
});
|
|
488
583
|
}))];
|
|
489
584
|
},
|
|
585
|
+
tableCellFormatter: handleFormatSelect,
|
|
586
|
+
tableCellCopyMethod: handleFormatSelect,
|
|
587
|
+
tableCellPasteMethod: handleSetSelectValue,
|
|
490
588
|
tableFilterDefaultMethod: function tableFilterDefaultMethod(params) {
|
|
491
589
|
var option = params.option,
|
|
492
590
|
row = params.row,
|
package/package.json
CHANGED
|
@@ -1,76 +1,75 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@vxe-ui/plugin-render-antd",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "Vxe UI plug-in for compatibility with the ant-design-vue component.",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"lib": "gulp build"
|
|
7
|
-
},
|
|
8
|
-
"files": [
|
|
9
|
-
"types",
|
|
10
|
-
"dist",
|
|
11
|
-
"es",
|
|
12
|
-
"lib",
|
|
13
|
-
"src"
|
|
14
|
-
],
|
|
15
|
-
"main": "lib/index.common.js",
|
|
16
|
-
"module": "es/index.esm.js",
|
|
17
|
-
"unpkg": "lib/index.umd.js",
|
|
18
|
-
"jsdelivr": "lib/index.umd.js",
|
|
19
|
-
"style": "lib/style.css",
|
|
20
|
-
"typings": "types/index.d.ts",
|
|
21
|
-
"devDependencies": {
|
|
22
|
-
"@types/node": "
|
|
23
|
-
"@babel/core": "~7.28.6",
|
|
24
|
-
"@babel/preset-env": "~7.28.6",
|
|
25
|
-
"@babel/runtime": "~7.28.6",
|
|
26
|
-
"@rollup/plugin-commonjs": "^29.0.0",
|
|
27
|
-
"@typescript-eslint/eslint-plugin": "~4.6.1",
|
|
28
|
-
"@typescript-eslint/parser": "~4.6.1",
|
|
29
|
-
"del": "~6.0.0",
|
|
30
|
-
"eslint": "~7.
|
|
31
|
-
"eslint-config-prettier": "~6.15.0",
|
|
32
|
-
"eslint-config-standard": "~16.0.1",
|
|
33
|
-
"eslint-
|
|
34
|
-
"eslint-plugin-
|
|
35
|
-
"eslint-plugin-
|
|
36
|
-
"eslint-plugin-
|
|
37
|
-
"eslint-plugin-
|
|
38
|
-
"eslint-plugin-
|
|
39
|
-
"
|
|
40
|
-
"gulp": "~
|
|
41
|
-
"gulp-
|
|
42
|
-
"gulp-
|
|
43
|
-
"gulp-
|
|
44
|
-
"gulp-
|
|
45
|
-
"gulp-
|
|
46
|
-
"gulp-
|
|
47
|
-
"gulp-
|
|
48
|
-
"gulp-
|
|
49
|
-
"gulp-
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"vxe-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@vxe-ui/plugin-render-antd",
|
|
3
|
+
"version": "3.4.1",
|
|
4
|
+
"description": "Vxe UI plug-in for compatibility with the ant-design-vue component.",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"lib": "gulp build"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"types",
|
|
10
|
+
"dist",
|
|
11
|
+
"es",
|
|
12
|
+
"lib",
|
|
13
|
+
"src"
|
|
14
|
+
],
|
|
15
|
+
"main": "lib/index.common.js",
|
|
16
|
+
"module": "es/index.esm.js",
|
|
17
|
+
"unpkg": "lib/index.umd.js",
|
|
18
|
+
"jsdelivr": "lib/index.umd.js",
|
|
19
|
+
"style": "lib/style.css",
|
|
20
|
+
"typings": "types/index.d.ts",
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/node": "~24.12.3",
|
|
23
|
+
"@babel/core": "~7.28.6",
|
|
24
|
+
"@babel/preset-env": "~7.28.6",
|
|
25
|
+
"@babel/runtime": "~7.28.6",
|
|
26
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
27
|
+
"@typescript-eslint/eslint-plugin": "~4.6.1",
|
|
28
|
+
"@typescript-eslint/parser": "~4.6.1",
|
|
29
|
+
"del": "~6.0.0",
|
|
30
|
+
"eslint": "~7.32.0",
|
|
31
|
+
"eslint-config-prettier": "~6.15.0",
|
|
32
|
+
"eslint-config-standard": "~16.0.1",
|
|
33
|
+
"eslint-plugin-import": "~2.22.1",
|
|
34
|
+
"eslint-plugin-node": "~11.1.0",
|
|
35
|
+
"eslint-plugin-prettier": "~3.1.4",
|
|
36
|
+
"eslint-plugin-promise": "~4.2.1",
|
|
37
|
+
"eslint-plugin-standard": "~4.0.2",
|
|
38
|
+
"eslint-plugin-typescript": "~0.14.0",
|
|
39
|
+
"gulp": "~4.0.2",
|
|
40
|
+
"gulp-autoprefixer": "~8.0.0",
|
|
41
|
+
"gulp-babel": "~8.0.0",
|
|
42
|
+
"gulp-clean-css": "~4.3.0",
|
|
43
|
+
"gulp-concat": "~2.6.1",
|
|
44
|
+
"gulp-rename": "~2.0.0",
|
|
45
|
+
"gulp-replace": "~1.1.3",
|
|
46
|
+
"gulp-sass": "~5.1.0",
|
|
47
|
+
"gulp-sourcemaps": "~3.0.0",
|
|
48
|
+
"gulp-typescript": "~5.0.1",
|
|
49
|
+
"gulp-uglify": "~3.0.2",
|
|
50
|
+
"markdown-doctest": "~1.1.0",
|
|
51
|
+
"prettier": "~2.1.2",
|
|
52
|
+
"rollup": "^4.53.3",
|
|
53
|
+
"sass": "~1.55.0",
|
|
54
|
+
"typescript": "~5.9.3",
|
|
55
|
+
"vue": "2.6.14",
|
|
56
|
+
"vxe-pc-ui": "~3.16.19",
|
|
57
|
+
"vxe-table": "~3.22.6"
|
|
58
|
+
},
|
|
59
|
+
"repository": {
|
|
60
|
+
"type": "git",
|
|
61
|
+
"url": "git+https://github.com/x-extends/vxe-ui-plugins.git"
|
|
62
|
+
},
|
|
63
|
+
"keywords": [
|
|
64
|
+
"vxe-ui-plugins"
|
|
65
|
+
],
|
|
66
|
+
"author": {
|
|
67
|
+
"name": "Xu Liangzhan",
|
|
68
|
+
"email": "xu_liangzhan@163.com"
|
|
69
|
+
},
|
|
70
|
+
"license": "MIT",
|
|
71
|
+
"bugs": {
|
|
72
|
+
"url": "https://github.com/x-extends/vxe-ui-plugins/issues"
|
|
73
|
+
},
|
|
74
|
+
"homepage": "https://github.com/x-extends/vxe-ui-plugins#readme"
|
|
75
|
+
}
|