vxe-table 4.11.17 → 4.11.18

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.
@@ -500,6 +500,63 @@ function handleExportTreeSelectMethod(params) {
500
500
  const { row, column, options } = params;
501
501
  return options.original ? getCellValue(row, column) : getTreeSelectCellValue(column.editRender || column.cellRender, params);
502
502
  }
503
+ function handleNumberCell(renderOpts, params) {
504
+ const { props = {}, showNegativeStatus } = renderOpts;
505
+ const { row, column } = params;
506
+ const { type } = props;
507
+ let cellValue = XEUtils.get(row, column.field);
508
+ let isNegative = false;
509
+ if (!isEmptyValue(cellValue)) {
510
+ const numberInputConfig = getConfig().numberInput || {};
511
+ if (type === 'float') {
512
+ const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
513
+ const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
514
+ cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
515
+ if (!autoFill) {
516
+ cellValue = XEUtils.toNumber(cellValue);
517
+ }
518
+ if (showNegativeStatus) {
519
+ if (cellValue < 0) {
520
+ isNegative = true;
521
+ }
522
+ }
523
+ }
524
+ else if (type === 'amount') {
525
+ const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
526
+ const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
527
+ const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
528
+ cellValue = XEUtils.toNumber(cellValue);
529
+ if (showNegativeStatus) {
530
+ if (cellValue < 0) {
531
+ isNegative = true;
532
+ }
533
+ }
534
+ cellValue = XEUtils.commafy(cellValue, { digits });
535
+ if (!autoFill) {
536
+ const [iStr, dStr] = cellValue.split('.');
537
+ if (dStr) {
538
+ const dRest = dStr.replace(/0+$/, '');
539
+ cellValue = dRest ? [iStr, '.', dRest].join('') : iStr;
540
+ }
541
+ }
542
+ if (showCurrency) {
543
+ cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`;
544
+ }
545
+ }
546
+ else {
547
+ if (showNegativeStatus) {
548
+ if (XEUtils.toNumber(cellValue) < 0) {
549
+ isNegative = true;
550
+ }
551
+ }
552
+ }
553
+ }
554
+ return getCellLabelVNs(renderOpts, params, cellValue, isNegative
555
+ ? {
556
+ class: 'is--negative'
557
+ }
558
+ : {});
559
+ }
503
560
  /**
504
561
  * 表格 - 渲染器
505
562
  */
@@ -559,66 +616,19 @@ renderer.mixin({
559
616
  renderTableFilter: defaultFilterRender,
560
617
  tableFilterDefaultMethod: handleInputFilterMethod
561
618
  },
619
+ FormatNumberInput: {
620
+ renderTableDefault: handleNumberCell,
621
+ tableFilterDefaultMethod: handleInputFilterMethod,
622
+ tableExportMethod(params) {
623
+ const { row, column } = params;
624
+ const cellValue = XEUtils.get(row, column.field);
625
+ return cellValue;
626
+ }
627
+ },
562
628
  VxeNumberInput: {
563
629
  tableAutoFocus: 'input',
564
630
  renderTableEdit: defaultEditRender,
565
- renderTableCell(renderOpts, params) {
566
- const { props = {}, showNegativeStatus } = renderOpts;
567
- const { row, column } = params;
568
- const { type } = props;
569
- let cellValue = XEUtils.get(row, column.field);
570
- let isNegative = false;
571
- if (!isEmptyValue(cellValue)) {
572
- const numberInputConfig = getConfig().numberInput || {};
573
- if (type === 'float') {
574
- const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
575
- const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
576
- cellValue = XEUtils.toFixed(XEUtils.floor(cellValue, digits), digits);
577
- if (!autoFill) {
578
- cellValue = XEUtils.toNumber(cellValue);
579
- }
580
- if (showNegativeStatus) {
581
- if (cellValue < 0) {
582
- isNegative = true;
583
- }
584
- }
585
- }
586
- else if (type === 'amount') {
587
- const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
588
- const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
589
- const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
590
- cellValue = XEUtils.toNumber(cellValue);
591
- if (showNegativeStatus) {
592
- if (cellValue < 0) {
593
- isNegative = true;
594
- }
595
- }
596
- cellValue = XEUtils.commafy(cellValue, { digits });
597
- if (!autoFill) {
598
- const [iStr, dStr] = cellValue.split('.');
599
- if (dStr) {
600
- const dRest = dStr.replace(/0+$/, '');
601
- cellValue = dRest ? [iStr, '.', dRest].join('') : iStr;
602
- }
603
- }
604
- if (showCurrency) {
605
- cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`;
606
- }
607
- }
608
- else {
609
- if (showNegativeStatus) {
610
- if (XEUtils.toNumber(cellValue) < 0) {
611
- isNegative = true;
612
- }
613
- }
614
- }
615
- }
616
- return getCellLabelVNs(renderOpts, params, cellValue, isNegative
617
- ? {
618
- class: 'is--negative'
619
- }
620
- : {});
621
- },
631
+ renderTableCell: handleNumberCell,
622
632
  renderTableFooter(renderOpts, params) {
623
633
  const { props = {} } = renderOpts;
624
634
  const { row, column, _columnIndex } = params;
@@ -721,11 +731,22 @@ renderer.mixin({
721
731
  tableFilterDefaultMethod: handleFilterMethod,
722
732
  tableExportMethod: handleExportSelectMethod
723
733
  },
734
+ /**
735
+ * 已废弃,被 FormatSelect 替换
736
+ * @deprecated
737
+ */
724
738
  formatOption: {
725
739
  renderTableDefault(renderOpts, params) {
726
740
  return getCellLabelVNs(renderOpts, params, getSelectCellValue(renderOpts, params));
727
741
  }
728
742
  },
743
+ FormatSelect: {
744
+ renderTableDefault(renderOpts, params) {
745
+ return getCellLabelVNs(renderOpts, params, getSelectCellValue(renderOpts, params));
746
+ },
747
+ tableFilterDefaultMethod: handleFilterMethod,
748
+ tableExportMethod: handleExportSelectMethod
749
+ },
729
750
  VxeTreeSelect: {
730
751
  tableAutoFocus: 'input',
731
752
  renderTableEdit: defaultTableOrTreeSelectEditRender,
@@ -734,11 +755,21 @@ renderer.mixin({
734
755
  },
735
756
  tableExportMethod: handleExportTreeSelectMethod
736
757
  },
758
+ /**
759
+ * 已废弃,被 FormatTreeSelect 替换
760
+ * @deprecated
761
+ */
737
762
  formatTree: {
738
763
  renderTableDefault(renderOpts, params) {
739
764
  return getCellLabelVNs(renderOpts, params, getTreeSelectCellValue(renderOpts, params));
740
765
  }
741
766
  },
767
+ FormatTreeSelect: {
768
+ renderTableDefault(renderOpts, params) {
769
+ return getCellLabelVNs(renderOpts, params, getTreeSelectCellValue(renderOpts, params));
770
+ },
771
+ tableExportMethod: handleExportTreeSelectMethod
772
+ },
742
773
  VxeTableSelect: {
743
774
  tableAutoFocus: 'input',
744
775
  renderTableEdit: defaultTableOrTreeSelectEditRender,
@@ -2715,7 +2715,7 @@ export default defineComponent({
2715
2715
  // warnLog('vxe.error.reqProp', ['table.show-overflow'])
2716
2716
  // }
2717
2717
  if (props.spanMethod) {
2718
- warnLog('vxe.error.scrollErrProp', ['table.span-method']);
2718
+ errLog('vxe.error.scrollErrProp', ['table.span-method']);
2719
2719
  }
2720
2720
  }
2721
2721
  handleReserveStatus();
@@ -3693,12 +3693,12 @@ export default defineComponent({
3693
3693
  */
3694
3694
  revertData(rows, field) {
3695
3695
  const { keepSource, treeConfig } = props;
3696
- const { fullAllDataRowIdData, tableSourceData, sourceDataRowIdData, tableFullData, afterFullData } = internalData;
3696
+ const { fullAllDataRowIdData, fullDataRowIdData, tableSourceData, sourceDataRowIdData, tableFullData, afterFullData } = internalData;
3697
3697
  const treeOpts = computeTreeOpts.value;
3698
3698
  const { transform } = treeOpts;
3699
3699
  if (!keepSource) {
3700
3700
  if (process.env.NODE_ENV === 'development') {
3701
- warnLog('vxe.error.reqProp', ['keep-source']);
3701
+ errLog('vxe.error.reqProp', ['keep-source']);
3702
3702
  }
3703
3703
  return nextTick();
3704
3704
  }
@@ -3713,23 +3713,23 @@ export default defineComponent({
3713
3713
  }
3714
3714
  let reDelFlag = false;
3715
3715
  if (targetRows.length) {
3716
- targetRows.forEach((row) => {
3717
- if (!$xeTable.isInsertByRow(row)) {
3718
- const rowid = getRowid($xeTable, row);
3719
- const oRow = sourceDataRowIdData[rowid];
3720
- if (oRow && row) {
3721
- if (field) {
3722
- XEUtils.set(row, field, XEUtils.clone(XEUtils.get(oRow, field), true));
3723
- }
3724
- else {
3725
- XEUtils.destructuring(row, XEUtils.clone(oRow, true));
3726
- }
3727
- if ($xeTable.isRemoveByRow(row)) {
3728
- const rowRest = fullAllDataRowIdData[rowid];
3729
- if (rowRest) {
3730
- const reRow = rowRest.row;
3731
- tableFullData.unshift(reRow);
3732
- afterFullData.unshift(reRow);
3716
+ targetRows.forEach((item) => {
3717
+ const rowid = getRowid($xeTable, item);
3718
+ const rowRest = fullAllDataRowIdData[rowid];
3719
+ if (rowRest) {
3720
+ const row = rowRest.row;
3721
+ if (!$xeTable.isInsertByRow(row)) {
3722
+ const oRow = sourceDataRowIdData[rowid];
3723
+ if (oRow && row) {
3724
+ if (field) {
3725
+ XEUtils.set(row, field, XEUtils.clone(XEUtils.get(oRow, field), true));
3726
+ }
3727
+ else {
3728
+ XEUtils.destructuring(row, XEUtils.clone(oRow, true));
3729
+ }
3730
+ if (!fullDataRowIdData[rowid] && $xeTable.isRemoveByRow(row)) {
3731
+ tableFullData.unshift(row);
3732
+ afterFullData.unshift(row);
3733
3733
  reDelFlag = true;
3734
3734
  }
3735
3735
  }
@@ -6596,7 +6596,16 @@ export default defineComponent({
6596
6596
  if (el) {
6597
6597
  const parentElem = el.parentNode;
6598
6598
  const parentPaddingSize = height === '100%' || height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0;
6599
- return Math.floor($xeGrid ? $xeGrid.getParentHeight() : XEUtils.toNumber(getComputedStyle(parentElem).height) - parentPaddingSize);
6599
+ let parentWrapperHeight = 0;
6600
+ if (parentElem) {
6601
+ if ($xeGrid && hasClass(parentElem, 'vxe-grid--table-wrapper')) {
6602
+ parentWrapperHeight = $xeGrid.getParentHeight();
6603
+ }
6604
+ else {
6605
+ parentWrapperHeight = parentElem.clientHeight;
6606
+ }
6607
+ }
6608
+ return Math.floor(parentWrapperHeight - parentPaddingSize);
6600
6609
  }
6601
6610
  return 0;
6602
6611
  },
package/es/ui/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  import { getFuncText } from './src/utils';
3
- export const version = "4.11.17";
3
+ export const version = "4.11.18";
4
4
  VxeUI.version = version;
5
5
  VxeUI.tableVersion = version;
6
6
  VxeUI.setConfig({
package/es/ui/src/log.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { VxeUI } from '@vxe-ui/core';
2
2
  const { log } = VxeUI;
3
- const version = `table v${"4.11.17"}`;
3
+ const version = `table v${"4.11.18"}`;
4
4
  export const warnLog = log.create('warn', version);
5
5
  export const errLog = log.create('error', version);
package/lib/index.umd.js CHANGED
@@ -3051,7 +3051,7 @@ function eqEmptyValue(cellValue) {
3051
3051
  ;// ./packages/ui/index.ts
3052
3052
 
3053
3053
 
3054
- const version = "4.11.17";
3054
+ const version = "4.11.18";
3055
3055
  core_.VxeUI.version = version;
3056
3056
  core_.VxeUI.tableVersion = version;
3057
3057
  core_.VxeUI.setConfig({
@@ -3499,7 +3499,7 @@ var es_iterator_some = __webpack_require__(3579);
3499
3499
  const {
3500
3500
  log: log_log
3501
3501
  } = core_.VxeUI;
3502
- const log_version = `table v${"4.11.17"}`;
3502
+ const log_version = `table v${"4.11.18"}`;
3503
3503
  const warnLog = log_log.create('warn', log_version);
3504
3504
  const errLog = log_log.create('error', log_version);
3505
3505
  ;// ./packages/table/src/columnInfo.ts
@@ -13405,7 +13405,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
13405
13405
  // warnLog('vxe.error.reqProp', ['table.show-overflow'])
13406
13406
  // }
13407
13407
  if (props.spanMethod) {
13408
- warnLog('vxe.error.scrollErrProp', ['table.span-method']);
13408
+ errLog('vxe.error.scrollErrProp', ['table.span-method']);
13409
13409
  }
13410
13410
  }
13411
13411
  handleReserveStatus();
@@ -14533,6 +14533,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14533
14533
  } = props;
14534
14534
  const {
14535
14535
  fullAllDataRowIdData,
14536
+ fullDataRowIdData,
14536
14537
  tableSourceData,
14537
14538
  sourceDataRowIdData,
14538
14539
  tableFullData,
@@ -14544,7 +14545,7 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14544
14545
  } = treeOpts;
14545
14546
  if (!keepSource) {
14546
14547
  if (true) {
14547
- warnLog('vxe.error.reqProp', ['keep-source']);
14548
+ errLog('vxe.error.reqProp', ['keep-source']);
14548
14549
  }
14549
14550
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
14550
14551
  }
@@ -14558,22 +14559,22 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
14558
14559
  }
14559
14560
  let reDelFlag = false;
14560
14561
  if (targetRows.length) {
14561
- targetRows.forEach(row => {
14562
- if (!$xeTable.isInsertByRow(row)) {
14563
- const rowid = getRowid($xeTable, row);
14564
- const oRow = sourceDataRowIdData[rowid];
14565
- if (oRow && row) {
14566
- if (field) {
14567
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, field, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(oRow, field), true));
14568
- } else {
14569
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().destructuring(row, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(oRow, true));
14570
- }
14571
- if ($xeTable.isRemoveByRow(row)) {
14572
- const rowRest = fullAllDataRowIdData[rowid];
14573
- if (rowRest) {
14574
- const reRow = rowRest.row;
14575
- tableFullData.unshift(reRow);
14576
- afterFullData.unshift(reRow);
14562
+ targetRows.forEach(item => {
14563
+ const rowid = getRowid($xeTable, item);
14564
+ const rowRest = fullAllDataRowIdData[rowid];
14565
+ if (rowRest) {
14566
+ const row = rowRest.row;
14567
+ if (!$xeTable.isInsertByRow(row)) {
14568
+ const oRow = sourceDataRowIdData[rowid];
14569
+ if (oRow && row) {
14570
+ if (field) {
14571
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().set(row, field, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(oRow, field), true));
14572
+ } else {
14573
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().destructuring(row, external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().clone(oRow, true));
14574
+ }
14575
+ if (!fullDataRowIdData[rowid] && $xeTable.isRemoveByRow(row)) {
14576
+ tableFullData.unshift(row);
14577
+ afterFullData.unshift(row);
14577
14578
  reDelFlag = true;
14578
14579
  }
14579
14580
  }
@@ -17818,7 +17819,15 @@ const customStorageKey = 'VXE_CUSTOM_STORE';
17818
17819
  if (el) {
17819
17820
  const parentElem = el.parentNode;
17820
17821
  const parentPaddingSize = height === '100%' || height === 'auto' ? getPaddingTopBottomSize(parentElem) : 0;
17821
- return Math.floor($xeGrid ? $xeGrid.getParentHeight() : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(getComputedStyle(parentElem).height) - parentPaddingSize);
17822
+ let parentWrapperHeight = 0;
17823
+ if (parentElem) {
17824
+ if ($xeGrid && hasClass(parentElem, 'vxe-grid--table-wrapper')) {
17825
+ parentWrapperHeight = $xeGrid.getParentHeight();
17826
+ } else {
17827
+ parentWrapperHeight = parentElem.clientHeight;
17828
+ }
17829
+ }
17830
+ return Math.floor(parentWrapperHeight - parentPaddingSize);
17822
17831
  }
17823
17832
  return 0;
17824
17833
  },
@@ -28059,6 +28068,69 @@ function handleExportTreeSelectMethod(params) {
28059
28068
  } = params;
28060
28069
  return options.original ? getCellValue(row, column) : getTreeSelectCellValue(column.editRender || column.cellRender, params);
28061
28070
  }
28071
+ function handleNumberCell(renderOpts, params) {
28072
+ const {
28073
+ props = {},
28074
+ showNegativeStatus
28075
+ } = renderOpts;
28076
+ const {
28077
+ row,
28078
+ column
28079
+ } = params;
28080
+ const {
28081
+ type
28082
+ } = props;
28083
+ let cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
28084
+ let isNegative = false;
28085
+ if (!isEmptyValue(cellValue)) {
28086
+ const numberInputConfig = render_getConfig().numberInput || {};
28087
+ if (type === 'float') {
28088
+ const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
28089
+ const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
28090
+ cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().floor(cellValue, digits), digits);
28091
+ if (!autoFill) {
28092
+ cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);
28093
+ }
28094
+ if (showNegativeStatus) {
28095
+ if (cellValue < 0) {
28096
+ isNegative = true;
28097
+ }
28098
+ }
28099
+ } else if (type === 'amount') {
28100
+ const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
28101
+ const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
28102
+ const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
28103
+ cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);
28104
+ if (showNegativeStatus) {
28105
+ if (cellValue < 0) {
28106
+ isNegative = true;
28107
+ }
28108
+ }
28109
+ cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().commafy(cellValue, {
28110
+ digits
28111
+ });
28112
+ if (!autoFill) {
28113
+ const [iStr, dStr] = cellValue.split('.');
28114
+ if (dStr) {
28115
+ const dRest = dStr.replace(/0+$/, '');
28116
+ cellValue = dRest ? [iStr, '.', dRest].join('') : iStr;
28117
+ }
28118
+ }
28119
+ if (showCurrency) {
28120
+ cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || render_getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`;
28121
+ }
28122
+ } else {
28123
+ if (showNegativeStatus) {
28124
+ if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue) < 0) {
28125
+ isNegative = true;
28126
+ }
28127
+ }
28128
+ }
28129
+ }
28130
+ return getCellLabelVNs(renderOpts, params, cellValue, isNegative ? {
28131
+ class: 'is--negative'
28132
+ } : {});
28133
+ }
28062
28134
  /**
28063
28135
  * 表格 - 渲染器
28064
28136
  */
@@ -28130,72 +28202,22 @@ render_renderer.mixin({
28130
28202
  renderTableFilter: defaultFilterRender,
28131
28203
  tableFilterDefaultMethod: handleInputFilterMethod
28132
28204
  },
28133
- VxeNumberInput: {
28134
- tableAutoFocus: 'input',
28135
- renderTableEdit: defaultEditRender,
28136
- renderTableCell(renderOpts, params) {
28137
- const {
28138
- props = {},
28139
- showNegativeStatus
28140
- } = renderOpts;
28205
+ FormatNumberInput: {
28206
+ renderTableDefault: handleNumberCell,
28207
+ tableFilterDefaultMethod: handleInputFilterMethod,
28208
+ tableExportMethod(params) {
28141
28209
  const {
28142
28210
  row,
28143
28211
  column
28144
28212
  } = params;
28145
- const {
28146
- type
28147
- } = props;
28148
- let cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
28149
- let isNegative = false;
28150
- if (!isEmptyValue(cellValue)) {
28151
- const numberInputConfig = render_getConfig().numberInput || {};
28152
- if (type === 'float') {
28153
- const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
28154
- const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 1);
28155
- cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toFixed(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().floor(cellValue, digits), digits);
28156
- if (!autoFill) {
28157
- cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);
28158
- }
28159
- if (showNegativeStatus) {
28160
- if (cellValue < 0) {
28161
- isNegative = true;
28162
- }
28163
- }
28164
- } else if (type === 'amount') {
28165
- const autoFill = handleDefaultValue(props.autoFill, numberInputConfig.autoFill, true);
28166
- const digits = handleDefaultValue(props.digits, numberInputConfig.digits, 2);
28167
- const showCurrency = handleDefaultValue(props.showCurrency, numberInputConfig.showCurrency, false);
28168
- cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue);
28169
- if (showNegativeStatus) {
28170
- if (cellValue < 0) {
28171
- isNegative = true;
28172
- }
28173
- }
28174
- cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().commafy(cellValue, {
28175
- digits
28176
- });
28177
- if (!autoFill) {
28178
- const [iStr, dStr] = cellValue.split('.');
28179
- if (dStr) {
28180
- const dRest = dStr.replace(/0+$/, '');
28181
- cellValue = dRest ? [iStr, '.', dRest].join('') : iStr;
28182
- }
28183
- }
28184
- if (showCurrency) {
28185
- cellValue = `${props.currencySymbol || numberInputConfig.currencySymbol || render_getI18n('vxe.numberInput.currencySymbol') || ''}${cellValue}`;
28186
- }
28187
- } else {
28188
- if (showNegativeStatus) {
28189
- if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(cellValue) < 0) {
28190
- isNegative = true;
28191
- }
28192
- }
28193
- }
28194
- }
28195
- return getCellLabelVNs(renderOpts, params, cellValue, isNegative ? {
28196
- class: 'is--negative'
28197
- } : {});
28198
- },
28213
+ const cellValue = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().get(row, column.field);
28214
+ return cellValue;
28215
+ }
28216
+ },
28217
+ VxeNumberInput: {
28218
+ tableAutoFocus: 'input',
28219
+ renderTableEdit: defaultEditRender,
28220
+ renderTableCell: handleNumberCell,
28199
28221
  renderTableFooter(renderOpts, params) {
28200
28222
  const {
28201
28223
  props = {}
@@ -28338,11 +28360,22 @@ render_renderer.mixin({
28338
28360
  tableFilterDefaultMethod: handleFilterMethod,
28339
28361
  tableExportMethod: handleExportSelectMethod
28340
28362
  },
28363
+ /**
28364
+ * 已废弃,被 FormatSelect 替换
28365
+ * @deprecated
28366
+ */
28341
28367
  formatOption: {
28342
28368
  renderTableDefault(renderOpts, params) {
28343
28369
  return getCellLabelVNs(renderOpts, params, getSelectCellValue(renderOpts, params));
28344
28370
  }
28345
28371
  },
28372
+ FormatSelect: {
28373
+ renderTableDefault(renderOpts, params) {
28374
+ return getCellLabelVNs(renderOpts, params, getSelectCellValue(renderOpts, params));
28375
+ },
28376
+ tableFilterDefaultMethod: handleFilterMethod,
28377
+ tableExportMethod: handleExportSelectMethod
28378
+ },
28346
28379
  VxeTreeSelect: {
28347
28380
  tableAutoFocus: 'input',
28348
28381
  renderTableEdit: defaultTableOrTreeSelectEditRender,
@@ -28351,11 +28384,21 @@ render_renderer.mixin({
28351
28384
  },
28352
28385
  tableExportMethod: handleExportTreeSelectMethod
28353
28386
  },
28387
+ /**
28388
+ * 已废弃,被 FormatTreeSelect 替换
28389
+ * @deprecated
28390
+ */
28354
28391
  formatTree: {
28355
28392
  renderTableDefault(renderOpts, params) {
28356
28393
  return getCellLabelVNs(renderOpts, params, getTreeSelectCellValue(renderOpts, params));
28357
28394
  }
28358
28395
  },
28396
+ FormatTreeSelect: {
28397
+ renderTableDefault(renderOpts, params) {
28398
+ return getCellLabelVNs(renderOpts, params, getTreeSelectCellValue(renderOpts, params));
28399
+ },
28400
+ tableExportMethod: handleExportTreeSelectMethod
28401
+ },
28359
28402
  VxeTableSelect: {
28360
28403
  tableAutoFocus: 'input',
28361
28404
  renderTableEdit: defaultTableOrTreeSelectEditRender,