vxe-table 3.19.35 → 3.19.36
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/es/style.css +1 -1
- package/es/table/src/cell.js +53 -23
- package/es/table/src/props.js +2 -0
- package/es/table/src/table.js +5 -0
- package/es/ui/index.js +4 -1
- package/es/ui/src/log.js +1 -1
- package/lib/index.umd.js +75 -25
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/cell.js +63 -23
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/props.js +2 -0
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +5 -0
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +4 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/table/src/cell.ts +53 -23
- package/packages/table/src/props.ts +2 -0
- package/packages/table/src/table.ts +6 -0
- package/packages/ui/index.ts +3 -0
- /package/es/{iconfont.1766728191601.ttf → iconfont.1766978388668.ttf} +0 -0
- /package/es/{iconfont.1766728191601.woff → iconfont.1766978388668.woff} +0 -0
- /package/es/{iconfont.1766728191601.woff2 → iconfont.1766978388668.woff2} +0 -0
- /package/lib/{iconfont.1766728191601.ttf → iconfont.1766978388668.ttf} +0 -0
- /package/lib/{iconfont.1766728191601.woff → iconfont.1766978388668.woff} +0 -0
- /package/lib/{iconfont.1766728191601.woff2 → iconfont.1766978388668.woff2} +0 -0
package/lib/ui/index.js
CHANGED
|
@@ -13,7 +13,7 @@ Object.defineProperty(exports, "VxeUI", {
|
|
|
13
13
|
exports.version = exports.validators = exports.use = exports.t = exports.setup = exports.setTheme = exports.setLanguage = exports.setIcon = exports.setI18n = exports.setConfig = exports.saveFile = exports.renderer = exports.readFile = exports.print = exports.modal = exports.menus = exports.log = exports.interceptor = exports.globalResize = exports.globalEvents = exports.getTheme = exports.getIcon = exports.getI18n = exports.getConfig = exports.formats = exports.default = exports.config = exports.commands = exports.clipboard = exports._t = void 0;
|
|
14
14
|
var _core = require("@vxe-ui/core");
|
|
15
15
|
var _utils = require("./src/utils");
|
|
16
|
-
const version = exports.version = "3.19.
|
|
16
|
+
const version = exports.version = "3.19.36";
|
|
17
17
|
_core.VxeUI.version = version;
|
|
18
18
|
_core.VxeUI.tableVersion = version;
|
|
19
19
|
_core.VxeUI.setConfig({
|
|
@@ -268,6 +268,9 @@ _core.VxeUI.setConfig({
|
|
|
268
268
|
// position: 'right',
|
|
269
269
|
visible: true
|
|
270
270
|
}
|
|
271
|
+
},
|
|
272
|
+
undoHistoryConfig: {
|
|
273
|
+
isEditRow: true
|
|
271
274
|
}
|
|
272
275
|
},
|
|
273
276
|
grid: {
|
package/lib/ui/index.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.VXETable=void 0,Object.defineProperty(exports,"VxeUI",{enumerable:!0,get:function(){return _core.VxeUI}}),exports.version=exports.validators=exports.use=exports.t=exports.setup=exports.setTheme=exports.setLanguage=exports.setIcon=exports.setI18n=exports.setConfig=exports.saveFile=exports.renderer=exports.readFile=exports.print=exports.modal=exports.menus=exports.log=exports.interceptor=exports.globalResize=exports.globalEvents=exports.getTheme=exports.getIcon=exports.getI18n=exports.getConfig=exports.formats=exports.default=exports.config=exports.commands=exports.clipboard=exports._t=void 0;var _core=require("@vxe-ui/core"),_utils=require("./src/utils");let version=exports.version="3.19.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.VXETable=void 0,Object.defineProperty(exports,"VxeUI",{enumerable:!0,get:function(){return _core.VxeUI}}),exports.version=exports.validators=exports.use=exports.t=exports.setup=exports.setTheme=exports.setLanguage=exports.setIcon=exports.setI18n=exports.setConfig=exports.saveFile=exports.renderer=exports.readFile=exports.print=exports.modal=exports.menus=exports.log=exports.interceptor=exports.globalResize=exports.globalEvents=exports.getTheme=exports.getIcon=exports.getI18n=exports.getConfig=exports.formats=exports.default=exports.config=exports.commands=exports.clipboard=exports._t=void 0;var _core=require("@vxe-ui/core"),_utils=require("./src/utils");let version=exports.version="3.19.36",iconPrefix=(_core.VxeUI.version=version,_core.VxeUI.tableVersion=version,_core.VxeUI.setConfig({emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,padding:!0,resizeConfig:{},resizableConfig:{dragMode:"auto",showDragTip:!0,isSyncAutoHeight:!0,isSyncAutoWidth:!0,minHeight:18},radioConfig:{strict:!0},rowDragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0,showDragTip:!0},columnDragConfig:{showIcon:!0,animation:!0,showGuidesStatus:!0,showDragTip:!0},checkboxConfig:{strict:!0},tooltipConfig:{enterable:!0},headerTooltipConfig:{enterable:!0},footerTooltipConfig:{enterable:!0},validConfig:{showMessage:!0,autoClear:!0,autoPos:!0,message:"inline",msgMode:"single",theme:"beautify"},columnConfig:{autoOptions:{isCalcHeader:!0,isCalcBody:!0,isCalcFooter:!0},maxFixedSize:4},cellConfig:{padding:!0},headerCellConfig:{height:"unset"},footerCellConfig:{height:"unset"},menuConfig:{destroyOnClose:!0},customConfig:{allowVisible:!0,allowResizable:!0,allowFixed:!0,allowSort:!0,showFooter:!0,placement:"top-right",storeOptions:{visible:!0,resizable:!0,sort:!0,fixed:!0},modalOptions:{showMaximize:!0,mask:!0,lockView:!0,resize:!0,escClosable:!0},drawerOptions:{mask:!0,lockView:!0,escClosable:!0,resize:!0}},sortConfig:{showIcon:!0,allowClear:!0,allowBtn:!0,iconLayout:"vertical"},filterConfig:{destroyOnClose:!0,multiple:!0,showIcon:!0},floatingFilterConfig:{},aggregateConfig:{padding:!0,rowField:"id",parentField:"_X_ROW_PARENT_KEY",childrenField:"_X_ROW_CHILDREN",mapChildrenField:"_X_ROW_CHILD_LIST",indent:20,showIcon:!0,maxGroupSize:4,showAggFuncTitle:!0},treeConfig:{padding:!0,rowField:"id",parentField:"parentId",childrenField:"children",hasChildField:"hasChild",mapChildrenField:"_X_ROW_CHILD",indent:20,showIcon:!0,showRootLine:!0},expandConfig:{showIcon:!0,mode:"fixed"},editConfig:{showIcon:!0,showAsterisk:!0,autoFocus:!0},importConfig:{_typeMaps:{csv:1,html:1,xml:1,txt:1}},exportConfig:{_typeMaps:{csv:1,html:1,xml:1,txt:1}},printConfig:{},mouseConfig:{extension:!0},keyboardConfig:{isAll:!0,isEsc:!0},areaConfig:{autoClear:!0,selectCellByHeader:!0,selectCellByBody:!0,extendDirection:{top:!0,left:!0,bottom:!0,right:!0}},clipConfig:{isCopy:!0,isCut:!0,isPaste:!0},fnrConfig:{isFind:!0,isReplace:!0},virtualXConfig:{gt:24,preSize:0,oSize:0},virtualYConfig:{gt:100,preSize:1,oSize:0},scrollbarConfig:{x:{visible:!0},y:{visible:!0}},undoHistoryConfig:{isEditRow:!0}},grid:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,showLoading:!0,showResponseMsg:!0,showActionMsg:!0,response:{list:"list",result:"result",total:"page.total",footerData:"footerData",message:"message"}}},toolbar:{},gantt:{}}),"vxe-table-icon-"),setTheme=(_core.VxeUI.setIcon({TABLE_SORT_ASC:iconPrefix+"caret-up",TABLE_SORT_DESC:iconPrefix+"caret-down",TABLE_FILTER_NONE:iconPrefix+"funnel",TABLE_FILTER_MATCH:iconPrefix+"funnel",TABLE_EDIT:iconPrefix+"edit",TABLE_TITLE_PREFIX:iconPrefix+"question-circle-fill",TABLE_TITLE_SUFFIX:iconPrefix+"question-circle-fill",TABLE_TREE_LOADED:iconPrefix+"spinner roll",TABLE_TREE_OPEN:iconPrefix+"caret-right rotate90",TABLE_TREE_CLOSE:iconPrefix+"caret-right",TABLE_EXPAND_LOADED:iconPrefix+"spinner roll",TABLE_EXPAND_OPEN:iconPrefix+"arrow-right rotate90",TABLE_EXPAND_CLOSE:iconPrefix+"arrow-right",TABLE_CHECKBOX_CHECKED:iconPrefix+"checkbox-checked-fill",TABLE_CHECKBOX_UNCHECKED:iconPrefix+"checkbox-unchecked",TABLE_CHECKBOX_INDETERMINATE:iconPrefix+"checkbox-indeterminate-fill",TABLE_CHECKBOX_DISABLED_UNCHECKED:iconPrefix+"checkbox-unchecked-fill",TABLE_RADIO_CHECKED:iconPrefix+"radio-checked-fill",TABLE_RADIO_UNCHECKED:iconPrefix+"radio-unchecked",TABLE_RADIO_DISABLED_UNCHECKED:iconPrefix+"radio-unchecked-fill",TABLE_CUSTOM_SORT:iconPrefix+"drag-handle",TABLE_MENU_OPTIONS:iconPrefix+"arrow-right",TABLE_MENU_OPTION_LOADING:iconPrefix+"repeat roll",TABLE_DRAG_ROW:iconPrefix+"drag-handle",TABLE_DRAG_COLUMN:iconPrefix+"drag-handle",TABLE_DRAG_STATUS_ROW:iconPrefix+"sort",TABLE_DRAG_STATUS_SUB_ROW:iconPrefix+"add-sub",TABLE_DRAG_STATUS_AGG_GROUP:iconPrefix+"grouping",TABLE_DRAG_STATUS_AGG_VALUES:iconPrefix+"values",TABLE_DRAG_STATUS_COLUMN:iconPrefix+"swap",TABLE_DRAG_DISABLED:iconPrefix+"no-drop",TABLE_ROW_GROUP_OPEN:iconPrefix+"arrow-right rotate90",TABLE_ROW_GROUP_CLOSE:iconPrefix+"arrow-right",TABLE_AGGREGATE_GROUPING:iconPrefix+"grouping",TABLE_AGGREGATE_VALUES:iconPrefix+"values",TABLE_AGGREGATE_SORT:iconPrefix+"drag-handle",TABLE_AGGREGATE_DELETE:iconPrefix+"close",TOOLBAR_TOOLS_REFRESH:iconPrefix+"repeat",TOOLBAR_TOOLS_REFRESH_LOADING:iconPrefix+"repeat roll",TOOLBAR_TOOLS_IMPORT:iconPrefix+"upload",TOOLBAR_TOOLS_EXPORT:iconPrefix+"download",TOOLBAR_TOOLS_PRINT:iconPrefix+"print",TOOLBAR_TOOLS_FULLSCREEN:iconPrefix+"fullscreen",TOOLBAR_TOOLS_MINIMIZE:iconPrefix+"minimize",TOOLBAR_TOOLS_CUSTOM:iconPrefix+"custom-column",TOOLBAR_TOOLS_FIXED_LEFT:iconPrefix+"fixed-left",TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE:iconPrefix+"fixed-left-fill",TOOLBAR_TOOLS_FIXED_RIGHT:iconPrefix+"fixed-right",TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE:iconPrefix+"fixed-right-fill"}),exports.setTheme=_core.VxeUI.setTheme),getTheme=exports.getTheme=_core.VxeUI.getTheme,setConfig=exports.setConfig=_core.VxeUI.setConfig,getConfig=exports.getConfig=_core.VxeUI.getConfig,setIcon=exports.setIcon=_core.VxeUI.setIcon,getIcon=exports.getIcon=_core.VxeUI.getIcon,setLanguage=exports.setLanguage=_core.VxeUI.setLanguage,setI18n=exports.setI18n=_core.VxeUI.setI18n,getI18n=exports.getI18n=_core.VxeUI.getI18n,globalEvents=exports.globalEvents=_core.VxeUI.globalEvents,globalResize=exports.globalResize=_core.VxeUI.globalResize,renderer=exports.renderer=_core.VxeUI.renderer,validators=exports.validators=_core.VxeUI.validators,menus=exports.menus=_core.VxeUI.menus,formats=exports.formats=_core.VxeUI.formats,commands=exports.commands=_core.VxeUI.commands,interceptor=exports.interceptor=_core.VxeUI.interceptor,clipboard=exports.clipboard=_core.VxeUI.clipboard,log=exports.log=_core.VxeUI.log,use=exports.use=_core.VxeUI.use,setup=e=>_core.VxeUI.setConfig(e),config=(exports.setup=setup,_core.VxeUI.setup=setup,e=>_core.VxeUI.setConfig(e)),t=(exports.config=config,_core.VxeUI.config=config,(e,o)=>_core.VxeUI.getI18n(e,o)),_t=(exports.t=t,_core.VxeUI.t=t,(e,o)=>(0,_utils.getFuncText)(e,o)),VXETable=(exports._t=_t,_core.VxeUI._t=_t,exports.VXETable=_core.VxeUI),saveFile=e=>_core.VxeUI.saveFile(e),readFile=(exports.saveFile=saveFile,e=>_core.VxeUI.readFile(e)),print=(exports.readFile=readFile,e=>_core.VxeUI.print(e)),modal=(exports.print=print,exports.modal={get(e){return _core.VxeUI.modal.get(e)},close(e){return _core.VxeUI.modal.close(e)},open(e){return _core.VxeUI.modal.open(e)},alert(e,o,i){return _core.VxeUI.modal.alert(e,o,i)},confirm(e,o,i){return _core.VxeUI.modal.confirm(e,o,i)},message(e,o){return _core.VxeUI.modal.message(e,o)},notification(e,o,i){return _core.VxeUI.modal.notification(e,o,i)}});var _default=exports.default=_core.VxeUI;
|
package/lib/ui/src/log.js
CHANGED
|
@@ -8,6 +8,6 @@ var _core = require("@vxe-ui/core");
|
|
|
8
8
|
const {
|
|
9
9
|
log
|
|
10
10
|
} = _core.VxeUI;
|
|
11
|
-
const version = `table v${"3.19.
|
|
11
|
+
const version = `table v${"3.19.36"}`;
|
|
12
12
|
const warnLog = exports.warnLog = log.create('warn', version);
|
|
13
13
|
const errLog = exports.errLog = log.create('error', version);
|
package/lib/ui/src/log.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");let log=_core.VxeUI.log,version="table v3.19.
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.warnLog=exports.errLog=void 0;var _core=require("@vxe-ui/core");let log=_core.VxeUI.log,version="table v3.19.36",warnLog=exports.warnLog=log.create("warn",version),errLog=exports.errLog=log.create("error",version);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vxe-table",
|
|
3
|
-
"version": "3.19.
|
|
3
|
+
"version": "3.19.36",
|
|
4
4
|
"description": "A PC-end table component based on Vxe UI, supporting copy-paste, data pivot table, and high-performance virtual list table solution.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"update": "npm install --legacy-peer-deps",
|
|
@@ -232,11 +232,17 @@ function renderTitleContent (h: CreateElement, params: VxeTableDefines.CellRende
|
|
|
232
232
|
|
|
233
233
|
function getFooterContent (h: CreateElement, params: VxeTableDefines.CellRenderFooterParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
234
234
|
const { $table, column, row } = params
|
|
235
|
+
const tableProps = $table
|
|
236
|
+
const { editConfig } = tableProps
|
|
235
237
|
const { slots, editRender, cellRender } = column
|
|
236
|
-
const
|
|
237
|
-
if (
|
|
238
|
-
return $table.callSlot(
|
|
238
|
+
const footerSlot = slots ? slots.footer : null
|
|
239
|
+
if (footerSlot) {
|
|
240
|
+
return $table.callSlot(footerSlot, params, h)
|
|
239
241
|
}
|
|
242
|
+
const isEnableEdit = editConfig && isEnableConf(editConfig)
|
|
243
|
+
const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null
|
|
244
|
+
const cellRenderOpts = isEnableConf(cellRender) ? cellRender : null
|
|
245
|
+
const renderOpts = editRenderOpts || cellRenderOpts
|
|
240
246
|
const itemValue = $table.getFooterCellLabel(row, column)
|
|
241
247
|
if (renderOpts) {
|
|
242
248
|
const compConf = renderer.get(renderOpts.name)
|
|
@@ -285,7 +291,9 @@ function renderCellHandle (h: CreateElement, params: VxeTableDefines.CellRenderB
|
|
|
285
291
|
case 'html':
|
|
286
292
|
return isDeepCell ? Cell.renderDeepHTMLCell(h, params) : Cell.renderHTMLCell(h, params)
|
|
287
293
|
}
|
|
288
|
-
|
|
294
|
+
const isEnableEdit = editConfig && isEnableConf(editConfig)
|
|
295
|
+
const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null
|
|
296
|
+
if (editRenderOpts) {
|
|
289
297
|
return editOpts.mode === 'cell' ? (isDeepCell ? Cell.renderDeepCellEdit(h, params) : Cell.renderCellEdit(h, params)) : (isDeepCell ? Cell.renderDeepRowEdit(h, params) : Cell.renderRowEdit(h, params))
|
|
290
298
|
}
|
|
291
299
|
return isDeepCell ? Cell.renderDeepCell(h, params) : Cell.renderDefaultCell(h, params)
|
|
@@ -297,7 +305,6 @@ function renderHeaderHandle (h: CreateElement, params: VxeTableDefines.CellRende
|
|
|
297
305
|
const { column, $table } = params
|
|
298
306
|
const tableProps = $table
|
|
299
307
|
const { editConfig } = tableProps
|
|
300
|
-
const editOpts = $table.computeEditOpts
|
|
301
308
|
const { type, filters, sortable, editRender } = column
|
|
302
309
|
switch (type) {
|
|
303
310
|
case 'seq':
|
|
@@ -316,7 +323,9 @@ function renderHeaderHandle (h: CreateElement, params: VxeTableDefines.CellRende
|
|
|
316
323
|
}
|
|
317
324
|
break
|
|
318
325
|
}
|
|
319
|
-
|
|
326
|
+
const isEnableEdit = editConfig && isEnableConf(editConfig)
|
|
327
|
+
const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null
|
|
328
|
+
if (editRenderOpts) {
|
|
320
329
|
return Cell.renderEditHeader(h, params)
|
|
321
330
|
} else if (filters && sortable) {
|
|
322
331
|
return Cell.renderSortAndFilterHeader(h, params)
|
|
@@ -352,11 +361,17 @@ export const Cell = {
|
|
|
352
361
|
*/
|
|
353
362
|
renderHeaderTitle (h: CreateElement, params: VxeTableDefines.CellRenderHeaderParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
354
363
|
const { $table, column } = params
|
|
364
|
+
const tableProps = $table
|
|
365
|
+
const { editConfig } = tableProps
|
|
355
366
|
const { slots, editRender, cellRender } = column
|
|
356
|
-
const
|
|
357
|
-
if (
|
|
358
|
-
return renderTitleContent(h, params, $table.callSlot(
|
|
367
|
+
const headerSlot = slots ? slots.header : null
|
|
368
|
+
if (headerSlot) {
|
|
369
|
+
return renderTitleContent(h, params, $table.callSlot(headerSlot, params, h))
|
|
359
370
|
}
|
|
371
|
+
const isEnableEdit = editConfig && isEnableConf(editConfig)
|
|
372
|
+
const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null
|
|
373
|
+
const cellRenderOpts = isEnableConf(cellRender) ? cellRender : null
|
|
374
|
+
const renderOpts = editRenderOpts || cellRenderOpts
|
|
360
375
|
if (renderOpts) {
|
|
361
376
|
const compConf = renderer.get(renderOpts.name)
|
|
362
377
|
const rtHeader = compConf ? (compConf.renderTableHeader || compConf.renderHeader) : null
|
|
@@ -377,7 +392,9 @@ export const Cell = {
|
|
|
377
392
|
const { isRowGroupStatus } = tableReactData
|
|
378
393
|
const { editConfig } = tableProps
|
|
379
394
|
const { field, slots, editRender, cellRender, rowGroupNode, aggFunc, formatter } = column
|
|
380
|
-
const
|
|
395
|
+
const isEnableEdit = editConfig && isEnableConf(editConfig)
|
|
396
|
+
const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null
|
|
397
|
+
const cellRenderOpts = isEnableConf(cellRender) ? cellRender : null
|
|
381
398
|
const defaultSlot = slots ? slots.default : null
|
|
382
399
|
const gcSlot = slots ? (slots.groupContent || slots['group-content']) : null
|
|
383
400
|
const gvSlot = slots ? (slots.groupValues || slots['group-values']) : null
|
|
@@ -446,25 +463,24 @@ export const Cell = {
|
|
|
446
463
|
if (defaultSlot) {
|
|
447
464
|
return renderCellBaseVNs(h, params, $table.callSlot(defaultSlot, params, h))
|
|
448
465
|
}
|
|
466
|
+
const renderOpts = editRenderOpts || cellRenderOpts
|
|
449
467
|
// formatter > (renderTableCell | renderTableDefault)
|
|
450
468
|
if (renderOpts && !formatter) {
|
|
451
469
|
const compConf = renderer.get(renderOpts.name)
|
|
452
|
-
const
|
|
453
|
-
const rtCell = compConf ? (compConf.renderTableCell || compConf.renderCell) : null
|
|
454
|
-
const renderFn = editRender ? rtCell : rtDefault
|
|
470
|
+
const renderFn = editRenderOpts ? (compConf.renderTableCell || compConf.renderCell) : (compConf.renderTableDefault || compConf.renderDefault)
|
|
455
471
|
if (renderFn) {
|
|
456
|
-
return renderCellBaseVNs(h, params, getSlotVNs(renderFn.call($table, h, renderOpts, Object.assign({ $type:
|
|
472
|
+
return renderCellBaseVNs(h, params, getSlotVNs(renderFn.call($table, h, renderOpts, Object.assign({ $type: editRenderOpts ? 'edit' : 'cell' }, params))))
|
|
457
473
|
}
|
|
458
474
|
}
|
|
459
475
|
cellValue = $table.getCellLabel(row, column)
|
|
460
476
|
}
|
|
461
|
-
const cellPlaceholder =
|
|
477
|
+
const cellPlaceholder = editRenderOpts ? editRenderOpts.placeholder : ''
|
|
462
478
|
return renderCellBaseVNs(h, params, [
|
|
463
479
|
h('span', {
|
|
464
480
|
class: 'vxe-cell--label'
|
|
465
481
|
}, [
|
|
466
482
|
// 如果设置占位符
|
|
467
|
-
|
|
483
|
+
editRenderOpts && eqEmptyValue(cellValue)
|
|
468
484
|
? h('span', {
|
|
469
485
|
class: 'vxe-cell--placeholder'
|
|
470
486
|
}, formatText(getFuncText(cellPlaceholder), 1))
|
|
@@ -1139,6 +1155,8 @@ export const Cell = {
|
|
|
1139
1155
|
const { editConfig, editRules } = tableProps
|
|
1140
1156
|
const editOpts = $table.computeEditOpts
|
|
1141
1157
|
const { sortable, filters, editRender } = column
|
|
1158
|
+
const isEnableEdit = editConfig && isEnableConf(editConfig)
|
|
1159
|
+
const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null
|
|
1142
1160
|
let isRequired = false
|
|
1143
1161
|
if (editRules) {
|
|
1144
1162
|
const columnRules = XEUtils.get(editRules, column.field)
|
|
@@ -1147,7 +1165,7 @@ export const Cell = {
|
|
|
1147
1165
|
}
|
|
1148
1166
|
}
|
|
1149
1167
|
let editIconVNs: VNode[] = []
|
|
1150
|
-
if (
|
|
1168
|
+
if (isEnableEdit) {
|
|
1151
1169
|
const { showAsterisk, showIcon, icon } = editOpts
|
|
1152
1170
|
editIconVNs = [
|
|
1153
1171
|
isRequired && showAsterisk
|
|
@@ -1159,7 +1177,7 @@ export const Cell = {
|
|
|
1159
1177
|
})
|
|
1160
1178
|
])
|
|
1161
1179
|
: renderEmptyElement($table),
|
|
1162
|
-
|
|
1180
|
+
editRenderOpts && showIcon
|
|
1163
1181
|
? h('i', {
|
|
1164
1182
|
class: 'vxe-cell--edit-icon'
|
|
1165
1183
|
}, XEUtils.isFunction(icon)
|
|
@@ -1181,11 +1199,15 @@ export const Cell = {
|
|
|
1181
1199
|
// 行格编辑模式
|
|
1182
1200
|
renderRowEdit (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
1183
1201
|
const { $table, column } = params
|
|
1202
|
+
const tableProps = $table
|
|
1184
1203
|
const tableReactData = $table as unknown as TableReactData
|
|
1204
|
+
const { editConfig } = tableProps
|
|
1185
1205
|
const { editStore } = tableReactData
|
|
1186
1206
|
const { actived } = editStore
|
|
1187
1207
|
const { editRender } = column
|
|
1188
|
-
|
|
1208
|
+
const isEnableEdit = editConfig && isEnableConf(editConfig)
|
|
1209
|
+
const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null
|
|
1210
|
+
return Cell.runRenderer(h, params, !!(editRenderOpts && actived && actived.row === params.row))
|
|
1189
1211
|
},
|
|
1190
1212
|
renderDeepRowEdit (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
1191
1213
|
return Cell.renderDeepNodeBtn(h, params, Cell.renderRowEdit(h, params))
|
|
@@ -1193,29 +1215,37 @@ export const Cell = {
|
|
|
1193
1215
|
// 单元格编辑模式
|
|
1194
1216
|
renderCellEdit (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
1195
1217
|
const { $table, column } = params
|
|
1218
|
+
const tableProps = $table
|
|
1196
1219
|
const tableReactData = $table as unknown as TableReactData
|
|
1220
|
+
const { editConfig } = tableProps
|
|
1197
1221
|
const { editStore } = tableReactData
|
|
1198
1222
|
const { actived } = editStore
|
|
1199
1223
|
const { editRender } = column
|
|
1200
|
-
|
|
1224
|
+
const isEnableEdit = editConfig && isEnableConf(editConfig)
|
|
1225
|
+
const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null
|
|
1226
|
+
return Cell.runRenderer(h, params, !!(editRenderOpts && actived && actived.row === params.row && actived.column === params.column))
|
|
1201
1227
|
},
|
|
1202
1228
|
renderDeepCellEdit (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }) {
|
|
1203
1229
|
return Cell.renderDeepNodeBtn(h, params, Cell.renderCellEdit(h, params))
|
|
1204
1230
|
},
|
|
1205
1231
|
runRenderer (h: CreateElement, params: VxeTableDefines.CellRenderBodyParams & { $table: VxeTableConstructor & VxeTablePrivateMethods }, _vm: any, isEdit: boolean) {
|
|
1206
1232
|
const { $table, row, column } = params
|
|
1233
|
+
const tableProps = $table
|
|
1207
1234
|
const tableReactData = $table as unknown as TableReactData
|
|
1235
|
+
const { editConfig } = tableProps
|
|
1208
1236
|
const { isRowGroupStatus } = tableReactData
|
|
1209
1237
|
const { slots, field, editRender, formatter } = column
|
|
1210
|
-
const
|
|
1211
|
-
const
|
|
1238
|
+
const isEnableEdit = editConfig && isEnableConf(editConfig)
|
|
1239
|
+
const editRenderOpts = isEnableEdit && isEnableConf(editRender) ? editRender : null
|
|
1212
1240
|
const defaultSlot = slots ? slots.default : null
|
|
1213
1241
|
const gcSlot = slots ? (slots.groupContent || slots['group-content']) : null
|
|
1214
1242
|
const cellParams = Object.assign({ $type: '', isEdit }, params)
|
|
1215
|
-
if (isEdit) {
|
|
1243
|
+
if (isEdit && editRenderOpts) {
|
|
1216
1244
|
if (slots && slots.edit) {
|
|
1217
1245
|
return $table.callSlot(slots.edit, cellParams, h)
|
|
1218
1246
|
}
|
|
1247
|
+
const compConf = renderer.get(editRender.name)
|
|
1248
|
+
const rtEdit = compConf ? (compConf.renderTableEdit || compConf.renderEdit) : null
|
|
1219
1249
|
if (rtEdit) {
|
|
1220
1250
|
return getSlotVNs(rtEdit.call($table, h, editRender, cellParams))
|
|
1221
1251
|
}
|
|
@@ -296,6 +296,8 @@ export const tableProps = {
|
|
|
296
296
|
virtualYConfig: Object as PropType<VxeTablePropTypes.VirtualYConfig>,
|
|
297
297
|
// 滚动条配置项
|
|
298
298
|
scrollbarConfig: Object as PropType<VxeTablePropTypes.ScrollbarConfig>,
|
|
299
|
+
// 可撤销配置项
|
|
300
|
+
undoHistoryConfig: Object as PropType<VxeTablePropTypes.UndoHistoryConfig>,
|
|
299
301
|
// (即将废弃)优化相关
|
|
300
302
|
animat: { type: Boolean, default: () => getConfig().table.animat },
|
|
301
303
|
// (可能会被废弃的参数,不要使用)
|
|
@@ -1575,6 +1575,12 @@ export default {
|
|
|
1575
1575
|
}
|
|
1576
1576
|
return []
|
|
1577
1577
|
},
|
|
1578
|
+
computeUndoHistoryOpts () {
|
|
1579
|
+
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1580
|
+
const props = $xeTable
|
|
1581
|
+
|
|
1582
|
+
return Object.assign({}, getConfig().table.undoHistoryConfig, props.undoHistoryConfig)
|
|
1583
|
+
},
|
|
1578
1584
|
tabsResizeFlag () {
|
|
1579
1585
|
const $xeTable = this as VxeTableConstructor & VxeTablePrivateMethods
|
|
1580
1586
|
const $xeTabs = $xeTable.$xeTabs
|
package/packages/ui/index.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|