vxe-table 4.12.0-beta.2 → 4.12.0-beta.3

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/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.hooks = 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 = "4.12.0-beta.2";
16
+ const version = exports.version = "4.12.0-beta.3";
17
17
  _core.VxeUI.version = version;
18
18
  _core.VxeUI.tableVersion = version;
19
19
  _core.VxeUI.setConfig({
@@ -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.hooks=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="4.12.0-beta.2",iconPrefix=(_core.VxeUI.version=version,_core.VxeUI.tableVersion=version,_core.VxeUI.setConfig({emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,minHeight:144,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},validConfig:{showMessage:!0,autoClear:!0,autoPos:!0,message:"inline",msgMode:"single",theme:"beautify"},columnConfig:{maxFixedSize:4},cellConfig:{padding:!0},headerCellConfig:{height:"unset"},footerCellConfig:{height:"unset"},customConfig:{allowVisible:!0,allowResizable:!0,allowFixed:!0,allowSort:!0,showFooter:!0,placement:"top-right",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:{showIcon:!0},treeConfig:{rowField:"id",parentField:"parentId",childrenField:"children",hasChildField:"hasChild",mapChildrenField:"_X_ROW_CHILD",indent:20,showIcon:!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:{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:{enabled:!0,gt:60,preSize:1,oSize:2},virtualYConfig:{enabled:!0,gt:100,preSize:1,oSize:2},scrollbarConfig:{}},grid:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,showResponseMsg:!0,showActiveMsg:!0,props:{list:null,result:"result",total:"page.total",message:"message"}}},toolbar:{}}),"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_RADIO_CHECKED:iconPrefix+"radio-checked-fill",TABLE_RADIO_UNCHECKED:iconPrefix+"radio-unchecked",TABLE_CUSTOM_SORT:iconPrefix+"drag-handle",TABLE_MENU_OPTIONS:iconPrefix+"arrow-right",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_COLUMN:iconPrefix+"swap",TABLE_DRAG_DISABLED:iconPrefix+"no-drop",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,hooks=exports.hooks=_core.VxeUI.hooks,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,r){return _core.VxeUI.modal.alert(e,o,r)},confirm(e,o,r){return _core.VxeUI.modal.confirm(e,o,r)},message(e,o){return _core.VxeUI.modal.message(e,o)},notification(e,o,r){return _core.VxeUI.modal.notification(e,o,r)}});var _default=exports.default=_core.VxeUI;
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.hooks=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="4.12.0-beta.3",iconPrefix=(_core.VxeUI.version=version,_core.VxeUI.tableVersion=version,_core.VxeUI.setConfig({emptyCell:" ",table:{fit:!0,showHeader:!0,animat:!0,delayHover:250,autoResize:!0,minHeight:144,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},validConfig:{showMessage:!0,autoClear:!0,autoPos:!0,message:"inline",msgMode:"single",theme:"beautify"},columnConfig:{maxFixedSize:4},cellConfig:{padding:!0},headerCellConfig:{height:"unset"},footerCellConfig:{height:"unset"},customConfig:{allowVisible:!0,allowResizable:!0,allowFixed:!0,allowSort:!0,showFooter:!0,placement:"top-right",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:{showIcon:!0},treeConfig:{rowField:"id",parentField:"parentId",childrenField:"children",hasChildField:"hasChild",mapChildrenField:"_X_ROW_CHILD",indent:20,showIcon:!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:{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:{enabled:!0,gt:60,preSize:1,oSize:2},virtualYConfig:{enabled:!0,gt:100,preSize:1,oSize:2},scrollbarConfig:{}},grid:{formConfig:{enabled:!0},pagerConfig:{enabled:!0},toolbarConfig:{enabled:!0},proxyConfig:{enabled:!0,autoLoad:!0,showResponseMsg:!0,showActiveMsg:!0,props:{list:null,result:"result",total:"page.total",message:"message"}}},toolbar:{}}),"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_RADIO_CHECKED:iconPrefix+"radio-checked-fill",TABLE_RADIO_UNCHECKED:iconPrefix+"radio-unchecked",TABLE_CUSTOM_SORT:iconPrefix+"drag-handle",TABLE_MENU_OPTIONS:iconPrefix+"arrow-right",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_COLUMN:iconPrefix+"swap",TABLE_DRAG_DISABLED:iconPrefix+"no-drop",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,hooks=exports.hooks=_core.VxeUI.hooks,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,r){return _core.VxeUI.modal.alert(e,o,r)},confirm(e,o,r){return _core.VxeUI.modal.confirm(e,o,r)},message(e,o){return _core.VxeUI.modal.message(e,o)},notification(e,o,r){return _core.VxeUI.modal.notification(e,o,r)}});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${"4.12.0-beta.2"}`;
11
+ const version = `table v${"4.12.0-beta.3"}`;
12
12
  const warnLog = exports.warnLog = log.create('warn', version);
13
13
  const errLog = exports.errLog = log.create('error', version);
@@ -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 v4.12.0-beta.2",warnLog=exports.warnLog=log.create("warn",version),errLog=exports.errLog=log.create("error",version);
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 v4.12.0-beta.3",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": "4.12.0-beta.2",
3
+ "version": "4.12.0-beta.3",
4
4
  "description": "一个基于 vue 的 PC 端表格组件,支持增删改查、虚拟树、拖拽排序,懒加载、快捷菜单、数据校验、树形结构、打印、导入导出、自定义模板、渲染器、JSON 配置式...",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -609,6 +609,62 @@ function handleExportTreeSelectMethod (params: any) {
609
609
  return options.original ? getCellValue(row, column) : getTreeSelectCellValue(column.editRender || column.cellRender, params)
610
610
  }
611
611
 
612
+ function handleNumberCell (renderOpts: VxeGlobalRendererHandles.RenderTableDefaultOptions, params: VxeGlobalRendererHandles.RenderTableDefaultParams) {
613
+ const { props = {}, showNegativeStatus } = renderOpts
614
+ const { row, column } = params
615
+ const { type } = props
616
+ let cellValue = XEUtils.get(row, column.field)
617
+ let isNegative = false
618
+ if (!isEmptyValue(cellValue)) {
619
+ const numberInputConfig = getConfig().numberInput || {}
620
+ if (type === 'float') {
621
+ const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true)
622
+ const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1)
623
+ cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits)
624
+ if (!autoFill) {
625
+ cellValue = XEUtils.toNumber(cellValue)
626
+ }
627
+ if (showNegativeStatus) {
628
+ if (cellValue < 0) {
629
+ isNegative = true
630
+ }
631
+ }
632
+ } else if (type === 'amount') {
633
+ const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true)
634
+ const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2)
635
+ const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false)
636
+ cellValue = XEUtils.toNumber(cellValue)
637
+ if (showNegativeStatus) {
638
+ if (cellValue < 0) {
639
+ isNegative = true
640
+ }
641
+ }
642
+ cellValue = XEUtils.commafy(cellValue, { digits })
643
+ if (!autoFill) {
644
+ const [iStr, dStr] = cellValue.split('.')
645
+ if (dStr) {
646
+ const dRest = dStr.replace(/0+$/, '')
647
+ cellValue = dRest ? [iStr, '.', dRest].join('') : iStr
648
+ }
649
+ }
650
+ if (showCurrency) {
651
+ cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`
652
+ }
653
+ } else {
654
+ if (showNegativeStatus) {
655
+ if (XEUtils.toNumber(cellValue) < 0) {
656
+ isNegative = true
657
+ }
658
+ }
659
+ }
660
+ }
661
+ return getCellLabelVNs(renderOpts, params, cellValue, isNegative
662
+ ? {
663
+ class: 'is--negative'
664
+ }
665
+ : {})
666
+ }
667
+
612
668
  /**
613
669
  * 表格 - 渲染器
614
670
  */
@@ -674,64 +730,13 @@ renderer.mixin({
674
730
  renderTableFilter: defaultFilterRender,
675
731
  tableFilterDefaultMethod: handleInputFilterMethod
676
732
  },
733
+ FormatNumberInput: {
734
+ renderTableDefault: handleNumberCell
735
+ },
677
736
  VxeNumberInput: {
678
737
  tableAutoFocus: 'input',
679
738
  renderTableEdit: defaultEditRender,
680
- renderTableCell (renderOpts, params) {
681
- const { props = {}, showNegativeStatus } = renderOpts
682
- const { row, column } = params
683
- const { type } = props
684
- let cellValue = XEUtils.get(row, column.field)
685
- let isNegative = false
686
- if (!isEmptyValue(cellValue)) {
687
- const numberInputConfig = getConfig().numberInput || {}
688
- if (type === 'float') {
689
- const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true)
690
- const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1)
691
- cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits)
692
- if (!autoFill) {
693
- cellValue = XEUtils.toNumber(cellValue)
694
- }
695
- if (showNegativeStatus) {
696
- if (cellValue < 0) {
697
- isNegative = true
698
- }
699
- }
700
- } else if (type === 'amount') {
701
- const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true)
702
- const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2)
703
- const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false)
704
- cellValue = XEUtils.toNumber(cellValue)
705
- if (showNegativeStatus) {
706
- if (cellValue < 0) {
707
- isNegative = true
708
- }
709
- }
710
- cellValue = XEUtils.commafy(cellValue, { digits })
711
- if (!autoFill) {
712
- const [iStr, dStr] = cellValue.split('.')
713
- if (dStr) {
714
- const dRest = dStr.replace(/0+$/, '')
715
- cellValue = dRest ? [iStr, '.', dRest].join('') : iStr
716
- }
717
- }
718
- if (showCurrency) {
719
- cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`
720
- }
721
- } else {
722
- if (showNegativeStatus) {
723
- if (XEUtils.toNumber(cellValue) < 0) {
724
- isNegative = true
725
- }
726
- }
727
- }
728
- }
729
- return getCellLabelVNs(renderOpts, params, cellValue, isNegative
730
- ? {
731
- class: 'is--negative'
732
- }
733
- : {})
734
- },
739
+ renderTableCell: handleNumberCell,
735
740
  renderTableFooter (renderOpts, params) {
736
741
  const { props = {} } = renderOpts
737
742
  const { row, column, _columnIndex } = params
@@ -841,11 +846,20 @@ renderer.mixin({
841
846
  tableFilterDefaultMethod: handleFilterMethod,
842
847
  tableExportMethod: handleExportSelectMethod
843
848
  },
849
+ /**
850
+ * 已废弃,被 FormatSelect 替换
851
+ * @deprecated
852
+ */
844
853
  formatOption: {
845
854
  renderTableDefault (renderOpts, params) {
846
855
  return getCellLabelVNs(renderOpts, params, getSelectCellValue(renderOpts, params))
847
856
  }
848
857
  },
858
+ FormatSelect: {
859
+ renderTableDefault (renderOpts, params) {
860
+ return getCellLabelVNs(renderOpts, params, getSelectCellValue(renderOpts, params))
861
+ }
862
+ },
849
863
  VxeTreeSelect: {
850
864
  tableAutoFocus: 'input',
851
865
  renderTableEdit: defaultTableOrTreeSelectEditRender,
@@ -854,11 +868,20 @@ renderer.mixin({
854
868
  },
855
869
  tableExportMethod: handleExportTreeSelectMethod
856
870
  },
871
+ /**
872
+ * 已废弃,被 FormatTreeSelect 替换
873
+ * @deprecated
874
+ */
857
875
  formatTree: {
858
876
  renderTableDefault (renderOpts, params) {
859
877
  return getCellLabelVNs(renderOpts, params, getTreeSelectCellValue(renderOpts, params))
860
878
  }
861
879
  },
880
+ FormatTreeSelect: {
881
+ renderTableDefault (renderOpts, params) {
882
+ return getCellLabelVNs(renderOpts, params, getTreeSelectCellValue(renderOpts, params))
883
+ }
884
+ },
862
885
  VxeTableSelect: {
863
886
  tableAutoFocus: 'input',
864
887
  renderTableEdit: defaultTableOrTreeSelectEditRender,
@@ -2876,7 +2876,7 @@ export default defineComponent({
2876
2876
  // warnLog('vxe.error.reqProp', ['table.show-overflow'])
2877
2877
  // }
2878
2878
  if (props.spanMethod) {
2879
- warnLog('vxe.error.scrollErrProp', ['table.span-method'])
2879
+ errLog('vxe.error.scrollErrProp', ['table.span-method'])
2880
2880
  }
2881
2881
  }
2882
2882