vxe-table 3.5.9-beta.2 → 3.5.9-beta.5

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.
Files changed (78) hide show
  1. package/lib/edit/src/mixin.js +3 -3
  2. package/lib/edit/src/mixin.min.js +1 -1
  3. package/lib/form/src/form.js +12 -7
  4. package/lib/form/src/form.min.js +1 -1
  5. package/lib/grid/src/grid.js +11 -6
  6. package/lib/grid/src/grid.min.js +1 -1
  7. package/lib/index.css +1 -1
  8. package/lib/index.umd.js +104 -41
  9. package/lib/index.umd.min.js +1 -1
  10. package/lib/list/src/list.js +12 -7
  11. package/lib/list/src/list.min.js +1 -1
  12. package/lib/loading/index.js +19 -0
  13. package/lib/loading/index.min.js +1 -0
  14. package/lib/loading/src/loading.js +36 -0
  15. package/lib/loading/src/loading.min.js +1 -0
  16. package/lib/locale/lang/en-US.js +3 -0
  17. package/lib/locale/lang/en-US.min.js +1 -1
  18. package/lib/locale/lang/en-US.umd.js +3 -0
  19. package/lib/locale/lang/ja-JP.js +3 -0
  20. package/lib/locale/lang/ja-JP.min.js +1 -1
  21. package/lib/locale/lang/ja-JP.umd.js +3 -0
  22. package/lib/locale/lang/zh-CN.js +3 -0
  23. package/lib/locale/lang/zh-CN.min.js +1 -1
  24. package/lib/locale/lang/zh-CN.umd.js +3 -0
  25. package/lib/locale/lang/zh-HK.min.js +1 -1
  26. package/lib/locale/lang/zh-HK.umd.js +3 -0
  27. package/lib/locale/lang/zh-MO.min.js +1 -1
  28. package/lib/locale/lang/zh-MO.umd.js +3 -0
  29. package/lib/locale/lang/zh-TC.js +3 -0
  30. package/lib/locale/lang/zh-TC.min.js +1 -1
  31. package/lib/locale/lang/zh-TC.umd.js +3 -0
  32. package/lib/locale/lang/zh-TW.min.js +1 -1
  33. package/lib/locale/lang/zh-TW.umd.js +3 -0
  34. package/lib/modal/src/modal.js +12 -7
  35. package/lib/modal/src/modal.min.js +1 -1
  36. package/lib/select/style/style.css +0 -69
  37. package/lib/select/style/style.min.css +1 -1
  38. package/lib/style.css +1 -1
  39. package/lib/style.min.css +1 -1
  40. package/lib/table/src/methods.js +5 -2
  41. package/lib/table/src/methods.min.js +1 -1
  42. package/lib/table/src/table.js +12 -8
  43. package/lib/table/src/table.min.js +1 -1
  44. package/lib/table/style/style.css +0 -68
  45. package/lib/table/style/style.min.css +1 -1
  46. package/lib/toolbar/style/style.css +13 -10
  47. package/lib/toolbar/style/style.min.css +1 -1
  48. package/lib/tools/log.js +1 -1
  49. package/lib/tools/log.min.js +1 -1
  50. package/lib/v-x-e-table/index.js +1 -1
  51. package/lib/v-x-e-table/index.min.js +1 -1
  52. package/lib/v-x-e-table/src/conf.js +4 -0
  53. package/lib/v-x-e-table/src/conf.min.js +1 -1
  54. package/lib/v-x-e-table/style/style.css +590 -0
  55. package/lib/v-x-e-table/style/style.min.css +1 -0
  56. package/package.json +1 -1
  57. package/packages/edit/src/mixin.js +3 -2
  58. package/packages/form/src/form.js +10 -9
  59. package/packages/grid/src/grid.js +7 -4
  60. package/packages/list/src/list.js +10 -9
  61. package/packages/loading/index.js +9 -0
  62. package/packages/loading/src/loading.js +31 -0
  63. package/packages/locale/lang/en-US.js +3 -0
  64. package/packages/locale/lang/ja-JP.js +3 -0
  65. package/packages/locale/lang/zh-CN.js +3 -0
  66. package/packages/locale/lang/zh-TC.js +3 -0
  67. package/packages/modal/src/modal.js +10 -9
  68. package/packages/table/src/methods.js +4 -2
  69. package/packages/table/src/table.js +10 -9
  70. package/packages/v-x-e-table/src/conf.js +4 -0
  71. package/styles/{base/loading.scss → loading.scss} +17 -4
  72. package/styles/modules.scss +1 -0
  73. package/styles/select.scss +0 -1
  74. package/styles/table.scss +0 -1
  75. package/styles/toolbar.scss +9 -5
  76. package/styles/v-x-e-table.scss +2 -0
  77. package/styles/variable.scss +0 -4
  78. package/types/table.d.ts +5 -0
package/lib/index.umd.js CHANGED
@@ -8457,6 +8457,8 @@ var iconPrefix = 'vxe-icon--';
8457
8457
  // 版本号,对于某些带数据缓存的功能有用到,上升版本号可以用于重置数据
8458
8458
  // resizeInterval: 500,
8459
8459
  emptyCell: ' ',
8460
+ loadingText: null,
8461
+ // 自定义loading提示内容,如果为null则不显示文本
8460
8462
  table: {
8461
8463
  fit: true,
8462
8464
  showHeader: true,
@@ -8574,6 +8576,8 @@ var iconPrefix = 'vxe-icon--';
8574
8576
  types: {}
8575
8577
  },
8576
8578
  icon: {
8579
+ // loading
8580
+ // LOADING: iconPrefix + 'refresh roll vxe-loading--default-icon',
8577
8581
  // table
8578
8582
  TABLE_SORT_ASC: iconPrefix + 'caret-top',
8579
8583
  TABLE_SORT_DESC: iconPrefix + 'caret-bottom',
@@ -8804,7 +8808,7 @@ var es_array_concat = __webpack_require__("99af");
8804
8808
 
8805
8809
 
8806
8810
  function getLog(message, params) {
8807
- return "[vxe-table v".concat("3.5.9-beta.1", "] ").concat(conf.i18n(message, params));
8811
+ return "[vxe-table v".concat("3.5.9-beta.4", "] ").concat(conf.i18n(message, params));
8808
8812
  }
8809
8813
 
8810
8814
  function outLog(type) {
@@ -10073,7 +10077,7 @@ function _t(key, args) {
10073
10077
  var v = 'v3';
10074
10078
  var VXETable = {
10075
10079
  v: v,
10076
- version: "3.5.9-beta.1",
10080
+ version: "3.5.9-beta.4",
10077
10081
  reg: reg,
10078
10082
  use: use,
10079
10083
  setup: setup,
@@ -15208,8 +15212,9 @@ var Methods = {
15208
15212
  * 根据行的唯一主键获取行
15209
15213
  * @param {String/Number} rowid 行主键
15210
15214
  */
15211
- getRowById: function getRowById(rowid) {
15215
+ getRowById: function getRowById(cellValue) {
15212
15216
  var fullDataRowIdData = this.fullDataRowIdData;
15217
+ var rowid = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.eqNull(cellValue) ? '' : encodeURIComponent(cellValue);
15213
15218
  return fullDataRowIdData[rowid] ? fullDataRowIdData[rowid].row : null;
15214
15219
  },
15215
15220
 
@@ -16660,7 +16665,9 @@ var Methods = {
16660
16665
  // 如果是按下非功能键之外允许直接编辑
16661
16666
 
16662
16667
  if (selected.column && selected.row && isEnableConf(selected.column.editRender)) {
16663
- if (!editOpts.activeMethod || editOpts.activeMethod(_objectSpread2(_objectSpread2({}, selected.args), {}, {
16668
+ var beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
16669
+
16670
+ if (!beforeEditMethod || beforeEditMethod(_objectSpread2(_objectSpread2({}, selected.args), {}, {
16664
16671
  $table: _this28
16665
16672
  }))) {
16666
16673
  if (editMethod) {
@@ -19755,6 +19762,42 @@ funcs.forEach(function (name) {
19755
19762
  };
19756
19763
  });
19757
19764
  /* harmony default export */ var methods = (Methods);
19765
+ // CONCATENATED MODULE: ./packages/loading/src/loading.js
19766
+
19767
+ /* harmony default export */ var src_loading = ({
19768
+ name: 'VxeLoading',
19769
+ props: {
19770
+ loading: Boolean
19771
+ },
19772
+ render: function render(h) {
19773
+ var icon = conf.icon.LOADING;
19774
+ var loadingText = conf.loadingText;
19775
+ var text = loadingText === null ? loadingText : conf.i18n('vxe.loading.text');
19776
+ return h('div', {
19777
+ class: ['vxe-loading', {
19778
+ 'is--visible': this.loading
19779
+ }]
19780
+ }, [h('div', {
19781
+ class: 'vxe-loading--chunk'
19782
+ }, [icon ? h('i', {
19783
+ class: icon
19784
+ }) : h('div', {
19785
+ class: 'vxe-loading--spinner'
19786
+ }), text ? h('div', {
19787
+ class: 'vxe-loading--text'
19788
+ }, "".concat(text)) : null])]);
19789
+ }
19790
+ });
19791
+ // CONCATENATED MODULE: ./packages/loading/index.js
19792
+
19793
+
19794
+
19795
+ var Loading = Object.assign(src_loading, {
19796
+ install: function install(Vue) {
19797
+ Vue.component(src_loading.name, src_loading);
19798
+ }
19799
+ });
19800
+ /* harmony default export */ var packages_loading = (src_loading);
19758
19801
  // CONCATENATED MODULE: ./packages/table/src/table.js
19759
19802
 
19760
19803
 
@@ -19779,6 +19822,7 @@ funcs.forEach(function (name) {
19779
19822
 
19780
19823
 
19781
19824
 
19825
+
19782
19826
 
19783
19827
 
19784
19828
  /**
@@ -20923,13 +20967,12 @@ function handleUupdateResize(_vm) {
20923
20967
  /**
20924
20968
  * 加载中
20925
20969
  */
20926
- h('div', {
20927
- class: ['vxe-table--loading vxe-loading', {
20928
- 'is--visible': loading
20929
- }]
20930
- }, [h('div', {
20931
- class: 'vxe-loading--spinner'
20932
- })]),
20970
+ h(packages_loading, {
20971
+ class: 'vxe-table--loading',
20972
+ props: {
20973
+ loading: loading
20974
+ }
20975
+ }),
20933
20976
  /**
20934
20977
  * 筛选
20935
20978
  */
@@ -22641,20 +22684,20 @@ function insertTreeRow(_vm, newRecords, isAppend) {
22641
22684
  tableColumn = this.tableColumn,
22642
22685
  editConfig = this.editConfig,
22643
22686
  mouseConfig = this.mouseConfig;
22644
- var mode = editOpts.mode,
22645
- activeMethod = editOpts.activeMethod;
22687
+ var mode = editOpts.mode;
22646
22688
  var actived = editStore.actived;
22647
22689
  var row = params.row,
22648
22690
  column = params.column;
22649
22691
  var editRender = column.editRender;
22650
22692
  var cell = params.cell = params.cell || this.getCell(row, column);
22693
+ var beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
22651
22694
 
22652
22695
  if (isEnableConf(editConfig) && isEnableConf(editRender) && cell) {
22653
22696
  if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
22654
22697
  // 判断是否禁用编辑
22655
22698
  var type = 'edit-disabled';
22656
22699
 
22657
- if (!activeMethod || activeMethod(_objectSpread2(_objectSpread2({}, params), {}, {
22700
+ if (!beforeEditMethod || beforeEditMethod(_objectSpread2(_objectSpread2({}, params), {}, {
22658
22701
  $table: this
22659
22702
  }))) {
22660
22703
  if (mouseConfig) {
@@ -23157,6 +23200,7 @@ function _slicedToArray(arr, i) {
23157
23200
 
23158
23201
 
23159
23202
 
23203
+
23160
23204
  var allActivedModals = [];
23161
23205
  var msgQueue = [];
23162
23206
  /* harmony default export */ var modal = ({
@@ -23522,13 +23566,16 @@ var msgQueue = [];
23522
23566
  class: 'vxe-modal--content'
23523
23567
  }, defaultSlot ? !inited || destroyOnClose && !visible ? [] : defaultSlot.call(this, {
23524
23568
  $modal: this
23525
- }, h) : getFuncText(content)), !isMsg ? h('div', {
23526
- class: ['vxe-loading', {
23527
- 'is--visible': loading
23528
- }]
23529
- }, [h('div', {
23530
- class: 'vxe-loading--spinner'
23531
- })]) : null]), showFooter ? h('div', {
23569
+ }, h) : getFuncText(content)),
23570
+ /**
23571
+ * 加载中
23572
+ */
23573
+ !isMsg ? h(packages_loading, {
23574
+ class: 'vxe-modal--loading',
23575
+ props: {
23576
+ loading: loading
23577
+ }
23578
+ }) : null]), showFooter ? h('div', {
23532
23579
  class: 'vxe-modal--footer'
23533
23580
  }, footerSlot ? !inited || destroyOnClose && !visible ? [] : footerSlot.call(this, {
23534
23581
  $modal: this
@@ -32712,7 +32759,7 @@ Object.keys(packages_table.methods).forEach(function (name) {
32712
32759
 
32713
32760
  if (editConfig) {
32714
32761
  tableProps.editConfig = Object.assign({}, editConfig, {
32715
- activeMethod: this.handleActiveMethod
32762
+ beforeEditMethod: this.handleBeforeEditMethod
32716
32763
  });
32717
32764
  }
32718
32765
 
@@ -32899,12 +32946,17 @@ Object.keys(packages_table.methods).forEach(function (name) {
32899
32946
  clss.push(rowClassName ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default.a.isFunction(rowClassName) ? rowClassName(params) : rowClassName : '');
32900
32947
  return clss;
32901
32948
  },
32902
- handleActiveMethod: function handleActiveMethod(params) {
32949
+ handleBeforeEditMethod: function handleBeforeEditMethod(params) {
32903
32950
  var editConfig = this.editConfig;
32904
- var activeMethod = editConfig ? editConfig.activeMethod : null;
32905
- return this.pendingRecords.indexOf(params.row) === -1 && (!activeMethod || activeMethod(_objectSpread2(_objectSpread2({}, params), {}, {
32906
- $grid: this
32907
- })));
32951
+ var beforeEditMethod = editConfig ? editConfig.beforeEditMethod || editConfig.activeMethod : null;
32952
+
32953
+ if (this.pendingRecords.indexOf(params.row) === -1) {
32954
+ return !beforeEditMethod || beforeEditMethod(_objectSpread2(_objectSpread2({}, params), {}, {
32955
+ $grid: this
32956
+ }));
32957
+ }
32958
+
32959
+ return false;
32908
32960
  },
32909
32961
  initToolbar: function initToolbar() {
32910
32962
  var _this3 = this;
@@ -36898,6 +36950,7 @@ var VxeFormConfigItem = {
36898
36950
 
36899
36951
 
36900
36952
 
36953
+
36901
36954
 
36902
36955
 
36903
36956
  var form_Rule = /*#__PURE__*/function () {
@@ -37131,13 +37184,16 @@ function getResetValue(value, resetValue) {
37131
37184
  })), h('div', {
37132
37185
  class: 'vxe-form-slots',
37133
37186
  ref: 'hideItem'
37134
- }, customLayout ? [] : defaultSlot ? defaultSlot.call(this, h, {}) : []), h('div', {
37135
- class: ['vxe-loading', {
37136
- 'is--visible': loading
37137
- }]
37138
- }, [h('div', {
37139
- class: 'vxe-loading--spinner'
37140
- })]),
37187
+ }, customLayout ? [] : defaultSlot ? defaultSlot.call(this, h, {}) : []),
37188
+ /**
37189
+ * 加载中
37190
+ */
37191
+ h(packages_loading, {
37192
+ class: 'vxe-form--loading',
37193
+ props: {
37194
+ loading: loading
37195
+ }
37196
+ }),
37141
37197
  /**
37142
37198
  * 工具提示
37143
37199
  */
@@ -38129,6 +38185,7 @@ var Switch = Object.assign(src_switch, {
38129
38185
 
38130
38186
 
38131
38187
 
38188
+
38132
38189
  /* harmony default export */ var src_list = ({
38133
38190
  name: 'VxeList',
38134
38191
  mixins: [size],
@@ -38266,13 +38323,16 @@ var Switch = Object.assign(src_switch, {
38266
38323
  }, $scopedSlots.default ? $scopedSlots.default.call(this, {
38267
38324
  items: items,
38268
38325
  $list: this
38269
- }, h) : [])]), h('div', {
38270
- class: ['vxe-list--loading vxe-loading', {
38271
- 'is--visible': loading
38272
- }]
38273
- }, [h('div', {
38274
- class: 'vxe-loading--spinner'
38275
- })])]);
38326
+ }, h) : [])]),
38327
+ /**
38328
+ * 加载中
38329
+ */
38330
+ h(packages_loading, {
38331
+ class: 'vxe-list--loading',
38332
+ props: {
38333
+ loading: loading
38334
+ }
38335
+ })]);
38276
38336
  },
38277
38337
  methods: {
38278
38338
  getParentElem: function getParentElem() {
@@ -38835,6 +38895,9 @@ var Pulldown = Object.assign(pulldown, {
38835
38895
  // CONCATENATED MODULE: ./packages/locale/lang/zh-CN.js
38836
38896
  /* harmony default export */ var zh_CN = ({
38837
38897
  vxe: {
38898
+ loading: {
38899
+ text: '加载中'
38900
+ },
38838
38901
  error: {
38839
38902
  groupFixed: '如果使用分组表头,固定列必须按组设置',
38840
38903
  groupMouseRange: '分组表头与 "{0}" 不能同时使用,这可能会出现错误',