vxe-table 4.3.0-beta.7 → 4.3.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.
Files changed (167) hide show
  1. package/README.en.md +3 -3
  2. package/README.md +3 -3
  3. package/README.zh-TW.md +3 -3
  4. package/es/checkbox/src/checkbox.js +20 -7
  5. package/es/checkbox/src/group.js +14 -2
  6. package/es/checkbox/style.css +1 -1
  7. package/es/export/style.css +1 -1
  8. package/es/filter/style.css +1 -1
  9. package/es/form/src/form.js +1 -1
  10. package/es/form/style.css +1 -0
  11. package/es/grid/style.css +1 -1
  12. package/es/icon/src/icon.js +3 -2
  13. package/es/icon/style.css +73 -512
  14. package/es/list/src/list.js +1 -1
  15. package/es/loading/src/loading.js +33 -23
  16. package/es/locale/lang/en-US.js +1 -1
  17. package/es/locale/lang/ja-JP.js +1 -1
  18. package/es/locale/lang/zh-CN.js +1 -1
  19. package/es/locale/lang/zh-TC.js +1 -1
  20. package/es/modal/src/modal.js +1 -1
  21. package/es/modal/style.css +2 -2
  22. package/es/pager/style.css +1 -1
  23. package/es/select/src/select.js +25 -3
  24. package/es/style.css +1 -1
  25. package/es/style.min.css +1 -1
  26. package/es/table/src/body.js +17 -10
  27. package/es/table/src/props.js +2 -0
  28. package/es/table/src/table.js +8 -1
  29. package/es/table/style.css +4 -1
  30. package/es/toolbar/src/toolbar.js +7 -6
  31. package/es/toolbar/style.css +2 -2
  32. package/es/tools/log.js +1 -1
  33. package/es/v-x-e-table/index.js +1 -1
  34. package/es/v-x-e-table/style.css +74 -513
  35. package/es/vxe-checkbox/style.css +1 -1
  36. package/es/vxe-form/style.css +1 -0
  37. package/es/vxe-grid/style.css +1 -1
  38. package/es/vxe-icon/style.css +73 -512
  39. package/es/vxe-modal/style.css +2 -2
  40. package/es/vxe-module-export/style.css +1 -1
  41. package/es/vxe-module-filter/style.css +1 -1
  42. package/es/vxe-pager/style.css +1 -1
  43. package/es/vxe-table/style.css +4 -1
  44. package/es/vxe-toolbar/style.css +2 -2
  45. package/helper/vetur/attributes.json +17 -5
  46. package/helper/vetur/tags.json +10 -2
  47. package/lib/checkbox/src/checkbox.js +23 -7
  48. package/lib/checkbox/src/checkbox.min.js +1 -1
  49. package/lib/checkbox/src/group.js +21 -1
  50. package/lib/checkbox/src/group.min.js +1 -1
  51. package/lib/checkbox/style/style.css +1 -1
  52. package/lib/checkbox/style/style.min.css +1 -1
  53. package/lib/export/style/style.css +1 -1
  54. package/lib/export/style/style.min.css +1 -1
  55. package/lib/filter/style/style.css +1 -1
  56. package/lib/filter/style/style.min.css +1 -1
  57. package/lib/form/src/form.js +1 -1
  58. package/lib/form/src/form.min.js +1 -1
  59. package/lib/form/style/style.css +1 -0
  60. package/lib/form/style/style.min.css +1 -1
  61. package/lib/grid/style/style.css +1 -1
  62. package/lib/grid/style/style.min.css +1 -1
  63. package/lib/icon/src/icon.js +3 -2
  64. package/lib/icon/src/icon.min.js +1 -1
  65. package/lib/icon/style/style.css +73 -512
  66. package/lib/icon/style/style.min.css +1 -1
  67. package/lib/index.umd.js +155 -51
  68. package/lib/index.umd.min.js +1 -1
  69. package/lib/list/src/list.js +1 -1
  70. package/lib/list/src/list.min.js +1 -1
  71. package/lib/loading/src/loading.js +28 -18
  72. package/lib/loading/src/loading.min.js +1 -1
  73. package/lib/locale/lang/en-US.js +1 -1
  74. package/lib/locale/lang/en-US.min.js +1 -1
  75. package/lib/locale/lang/en-US.umd.js +1 -1
  76. package/lib/locale/lang/ja-JP.js +1 -1
  77. package/lib/locale/lang/ja-JP.min.js +1 -1
  78. package/lib/locale/lang/ja-JP.umd.js +1 -1
  79. package/lib/locale/lang/zh-CN.js +1 -1
  80. package/lib/locale/lang/zh-CN.min.js +1 -1
  81. package/lib/locale/lang/zh-CN.umd.js +1 -1
  82. package/lib/locale/lang/zh-HK.min.js +1 -1
  83. package/lib/locale/lang/zh-HK.umd.js +1 -1
  84. package/lib/locale/lang/zh-MO.min.js +1 -1
  85. package/lib/locale/lang/zh-MO.umd.js +1 -1
  86. package/lib/locale/lang/zh-TC.js +1 -1
  87. package/lib/locale/lang/zh-TC.min.js +1 -1
  88. package/lib/locale/lang/zh-TC.umd.js +1 -1
  89. package/lib/locale/lang/zh-TW.min.js +1 -1
  90. package/lib/locale/lang/zh-TW.umd.js +1 -1
  91. package/lib/modal/src/modal.js +1 -1
  92. package/lib/modal/src/modal.min.js +1 -1
  93. package/lib/modal/style/style.css +2 -2
  94. package/lib/modal/style/style.min.css +1 -1
  95. package/lib/pager/style/style.css +1 -1
  96. package/lib/pager/style/style.min.css +1 -1
  97. package/lib/select/src/select.js +37 -3
  98. package/lib/select/src/select.min.js +1 -1
  99. package/lib/style.css +1 -1
  100. package/lib/style.min.css +1 -1
  101. package/lib/table/src/body.js +16 -7
  102. package/lib/table/src/body.min.js +1 -1
  103. package/lib/table/src/props.js +2 -0
  104. package/lib/table/src/props.min.js +1 -1
  105. package/lib/table/src/table.js +8 -1
  106. package/lib/table/src/table.min.js +1 -1
  107. package/lib/table/style/style.css +4 -1
  108. package/lib/table/style/style.min.css +1 -1
  109. package/lib/toolbar/src/toolbar.js +7 -6
  110. package/lib/toolbar/src/toolbar.min.js +1 -1
  111. package/lib/toolbar/style/style.css +2 -2
  112. package/lib/toolbar/style/style.min.css +1 -1
  113. package/lib/tools/log.js +1 -1
  114. package/lib/tools/log.min.js +1 -1
  115. package/lib/v-x-e-table/index.js +1 -1
  116. package/lib/v-x-e-table/index.min.js +1 -1
  117. package/lib/v-x-e-table/style/style.css +74 -513
  118. package/lib/v-x-e-table/style/style.min.css +1 -1
  119. package/lib/vxe-checkbox/style/style.css +1 -1
  120. package/lib/vxe-checkbox/style/style.min.css +1 -1
  121. package/lib/vxe-form/style/style.css +1 -0
  122. package/lib/vxe-form/style/style.min.css +1 -1
  123. package/lib/vxe-grid/style/style.css +1 -1
  124. package/lib/vxe-grid/style/style.min.css +1 -1
  125. package/lib/vxe-icon/style/style.css +73 -512
  126. package/lib/vxe-icon/style/style.min.css +1 -1
  127. package/lib/vxe-modal/style/style.css +2 -2
  128. package/lib/vxe-modal/style/style.min.css +1 -1
  129. package/lib/vxe-module-export/style/style.css +1 -1
  130. package/lib/vxe-module-export/style/style.min.css +1 -1
  131. package/lib/vxe-module-filter/style/style.css +1 -1
  132. package/lib/vxe-module-filter/style/style.min.css +1 -1
  133. package/lib/vxe-pager/style/style.css +1 -1
  134. package/lib/vxe-pager/style/style.min.css +1 -1
  135. package/lib/vxe-table/style/style.css +4 -1
  136. package/lib/vxe-table/style/style.min.css +1 -1
  137. package/lib/vxe-toolbar/style/style.css +2 -2
  138. package/lib/vxe-toolbar/style/style.min.css +1 -1
  139. package/package.json +2 -2
  140. package/packages/checkbox/src/checkbox.ts +20 -7
  141. package/packages/checkbox/src/group.ts +18 -3
  142. package/packages/form/src/form.ts +1 -1
  143. package/packages/icon/src/icon.ts +3 -2
  144. package/packages/list/src/list.ts +1 -1
  145. package/packages/loading/src/loading.ts +34 -22
  146. package/packages/locale/lang/en-US.ts +1 -1
  147. package/packages/locale/lang/ja-JP.ts +1 -1
  148. package/packages/locale/lang/zh-CN.ts +1 -1
  149. package/packages/locale/lang/zh-TC.ts +1 -1
  150. package/packages/modal/src/modal.ts +1 -1
  151. package/packages/select/src/select.ts +27 -3
  152. package/packages/table/src/body.ts +15 -8
  153. package/packages/table/src/props.ts +2 -0
  154. package/packages/table/src/table.ts +9 -1
  155. package/packages/toolbar/src/toolbar.ts +7 -6
  156. package/styles/base/checked.scss +1 -1
  157. package/styles/form.scss +1 -0
  158. package/styles/icon.scss +103 -21
  159. package/styles/loading.scss +1 -1
  160. package/styles/table.scss +4 -0
  161. package/styles/variable.scss +2 -1
  162. package/types/checkbox-group.d.ts +8 -1
  163. package/types/icon.d.ts +2 -0
  164. package/types/select.d.ts +2 -0
  165. package/types/table.d.ts +9 -0
  166. package/types/toolbar.d.ts +6 -1
  167. package/types/v-x-e-table/index.d.ts +1 -1
@@ -311,7 +311,7 @@ export default defineComponent({
311
311
  */
312
312
  h(VxeLoading, {
313
313
  class: 'vxe-list--loading',
314
- loading: loading
314
+ modelValue: loading
315
315
  })
316
316
  ]);
317
317
  };
@@ -1,31 +1,41 @@
1
- import { defineComponent, h } from 'vue';
1
+ import { defineComponent, h, computed } from 'vue';
2
2
  import GlobalConfig from '../../v-x-e-table/src/conf';
3
3
  export default defineComponent({
4
4
  name: 'VxeLoading',
5
5
  props: {
6
- loading: Boolean
6
+ modelValue: Boolean,
7
+ icon: String,
8
+ text: String
7
9
  },
8
- render: function () {
9
- var icon = GlobalConfig.icon.LOADING;
10
- var loadingText = GlobalConfig.loadingText;
11
- var text = loadingText === null ? loadingText : GlobalConfig.i18n('vxe.loading.text');
12
- return h('div', {
13
- class: ['vxe-loading', {
14
- 'is--visible': this.loading
15
- }]
16
- }, [
17
- h('div', {
18
- class: 'vxe-loading--chunk'
10
+ setup: function (props) {
11
+ var computeLoadingIcon = computed(function () {
12
+ return props.icon || GlobalConfig.icon.LOADING;
13
+ });
14
+ var computeLoadingText = computed(function () {
15
+ var loadingText = GlobalConfig.loadingText;
16
+ return props.text || (loadingText === null ? loadingText : GlobalConfig.i18n('vxe.loading.text'));
17
+ });
18
+ return function () {
19
+ var loadingIcon = computeLoadingIcon.value;
20
+ var loadingText = computeLoadingText.value;
21
+ return h('div', {
22
+ class: ['vxe-loading', {
23
+ 'is--visible': props.modelValue
24
+ }]
19
25
  }, [
20
- icon ? h('i', {
21
- class: icon
22
- }) : h('div', {
23
- class: 'vxe-loading--spinner'
24
- }),
25
- text ? h('div', {
26
- class: 'vxe-loading--text'
27
- }, "".concat(text)) : null
28
- ])
29
- ]);
26
+ h('div', {
27
+ class: 'vxe-loading--chunk'
28
+ }, [
29
+ loadingIcon ? h('i', {
30
+ class: loadingIcon
31
+ }) : h('div', {
32
+ class: 'vxe-loading--spinner'
33
+ }),
34
+ loadingText ? h('div', {
35
+ class: 'vxe-loading--text'
36
+ }, "".concat(loadingText)) : null
37
+ ])
38
+ ]);
39
+ };
30
40
  }
31
41
  });
@@ -1,7 +1,7 @@
1
1
  export default {
2
2
  vxe: {
3
3
  loading: {
4
- text: 'Loading'
4
+ text: 'Loading...'
5
5
  },
6
6
  error: {
7
7
  groupFixed: 'If you use group headers, the fixed columns must be set by group.',
@@ -1,7 +1,7 @@
1
1
  export default {
2
2
  vxe: {
3
3
  loading: {
4
- text: 'Loading'
4
+ text: 'Loading...'
5
5
  },
6
6
  error: {
7
7
  groupFixed: 'グループのヘッダを使用すると、固定列はグループで設定しなければなりません',
@@ -1,7 +1,7 @@
1
1
  export default {
2
2
  vxe: {
3
3
  loading: {
4
- text: '加载中'
4
+ text: '加载中...'
5
5
  },
6
6
  error: {
7
7
  groupFixed: '如果使用分组表头,固定列必须按组设置',
@@ -1,7 +1,7 @@
1
1
  export default {
2
2
  vxe: {
3
3
  loading: {
4
- text: '加載中'
4
+ text: '加載中...'
5
5
  },
6
6
  error: {
7
7
  groupFixed: '如果使用分組表頭,固定列必須按組設定',
@@ -739,7 +739,7 @@ export default defineComponent({
739
739
  */
740
740
  contVNs.push(h(VxeLoading, {
741
741
  class: 'vxe-modal--loading',
742
- loading: props.loading
742
+ modelValue: props.loading
743
743
  }));
744
744
  }
745
745
  return [
@@ -47,7 +47,7 @@
47
47
  .vxe-modal--wrapper.is--loading .vxe-modal--header,
48
48
  .vxe-modal--wrapper.is--loading .vxe-modal--footer {
49
49
  position: relative;
50
- border-bottom-color: rgba(0, 0, 0, 0.2); }
50
+ border-bottom-color: rgba(255, 255, 255, 0.5); }
51
51
  .vxe-modal--wrapper.is--loading .vxe-modal--header:before,
52
52
  .vxe-modal--wrapper.is--loading .vxe-modal--footer:before {
53
53
  content: "";
@@ -61,7 +61,7 @@
61
61
  -moz-user-select: none;
62
62
  -ms-user-select: none;
63
63
  user-select: none;
64
- background-color: rgba(0, 0, 0, 0.2); }
64
+ background-color: rgba(255, 255, 255, 0.5); }
65
65
  .vxe-modal--wrapper:not(.lock--view) {
66
66
  pointer-events: none; }
67
67
  .vxe-modal--wrapper:not(.type--message).lock--scroll {
@@ -50,7 +50,7 @@
50
50
  -moz-user-select: none;
51
51
  -ms-user-select: none;
52
52
  user-select: none;
53
- background-color: rgba(0, 0, 0, 0.2); }
53
+ background-color: rgba(255, 255, 255, 0.5); }
54
54
  .vxe-pager .vxe-pager--prev-btn,
55
55
  .vxe-pager .vxe-pager--next-btn,
56
56
  .vxe-pager .vxe-pager--num-btn,
@@ -31,6 +31,7 @@ export default defineComponent({
31
31
  optionGroupProps: Object,
32
32
  optionConfig: Object,
33
33
  className: [String, Function],
34
+ max: { type: [String, Number], default: null },
34
35
  size: { type: String, default: function () { return GlobalConfig.select.size || GlobalConfig.size; } },
35
36
  filterable: Boolean,
36
37
  filterMethod: Function,
@@ -111,6 +112,13 @@ export default defineComponent({
111
112
  var groupPropsOpts = computeGroupPropsOpts.value;
112
113
  return groupPropsOpts.options || 'options';
113
114
  });
115
+ var computeIsMaximize = computed(function () {
116
+ var modelValue = props.modelValue, multiple = props.multiple, max = props.max;
117
+ if (multiple && max) {
118
+ return (modelValue ? modelValue.length : 0) >= XEUtils.toNumber(max);
119
+ }
120
+ return false;
121
+ });
114
122
  var computeOptionOpts = computed(function () {
115
123
  return Object.assign({}, GlobalConfig.select.optionConfig, props.optionConfig);
116
124
  });
@@ -646,6 +654,19 @@ export default defineComponent({
646
654
  showOptionPanel();
647
655
  }
648
656
  };
657
+ var checkOptionDisabled = function (isSelected, option, group) {
658
+ if (option.disabled) {
659
+ return true;
660
+ }
661
+ if (group && group.disabled) {
662
+ return true;
663
+ }
664
+ var isMaximize = computeIsMaximize.value;
665
+ if (isMaximize && !isSelected) {
666
+ return true;
667
+ }
668
+ return false;
669
+ };
649
670
  var renderOption = function (list, group) {
650
671
  var optionKey = props.optionKey, modelValue = props.modelValue, multiple = props.multiple;
651
672
  var currentValue = reactData.currentValue;
@@ -656,16 +677,17 @@ export default defineComponent({
656
677
  var useKey = optionOpts.useKey;
657
678
  return list.map(function (option, cIndex) {
658
679
  var slots = option.slots, className = option.className;
659
- var isVisible = !isGroup || isOptionVisible(option);
660
- var isDisabled = (group && group.disabled) || option.disabled;
661
680
  var optionValue = option[valueField];
681
+ var isSelected = multiple ? (modelValue && modelValue.indexOf(optionValue) > -1) : modelValue === optionValue;
682
+ var isVisible = !isGroup || isOptionVisible(option);
683
+ var isDisabled = checkOptionDisabled(isSelected, option, group);
662
684
  var optid = getOptid(option);
663
685
  var defaultSlot = slots ? slots.default : null;
664
686
  return isVisible ? h('div', {
665
687
  key: useKey || optionKey ? optid : cIndex,
666
688
  class: ['vxe-select-option', className ? (XEUtils.isFunction(className) ? className({ option: option, $select: $xeselect }) : className) : '', {
667
689
  'is--disabled': isDisabled,
668
- 'is--selected': multiple ? (modelValue && modelValue.indexOf(optionValue) > -1) : modelValue === optionValue,
690
+ 'is--selected': isSelected,
669
691
  'is--hover': currentValue === optionValue
670
692
  }],
671
693
  // attrs