vxe-table 4.2.6-beta.0 → 4.2.6-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.
Files changed (94) hide show
  1. package/es/edit/src/hook.js +3 -2
  2. package/es/form/src/form.js +8 -9
  3. package/es/form/style.css +2 -1
  4. package/es/grid/src/grid.js +8 -5
  5. package/es/list/src/list.js +8 -9
  6. package/es/loading/index.js +7 -0
  7. package/es/loading/src/loading.js +31 -0
  8. package/es/locale/lang/en-US.js +3 -0
  9. package/es/locale/lang/ja-JP.js +3 -0
  10. package/es/locale/lang/zh-CN.js +3 -0
  11. package/es/locale/lang/zh-TC.js +3 -0
  12. package/es/modal/src/modal.js +17 -13
  13. package/es/select/style.css +0 -64
  14. package/es/style.css +1 -1
  15. package/es/style.min.css +1 -1
  16. package/es/table/src/table.js +10 -10
  17. package/es/table/style.css +0 -63
  18. package/es/tools/log.js +1 -1
  19. package/es/v-x-e-table/index.js +1 -1
  20. package/es/v-x-e-table/src/conf.js +3 -0
  21. package/es/v-x-e-table/style.css +558 -0
  22. package/lib/edit/src/hook.js +3 -3
  23. package/lib/edit/src/hook.min.js +1 -1
  24. package/lib/form/src/form.js +10 -7
  25. package/lib/form/src/form.min.js +1 -1
  26. package/lib/form/style/style.css +2 -1
  27. package/lib/form/style/style.min.css +1 -1
  28. package/lib/grid/src/grid.js +12 -7
  29. package/lib/grid/src/grid.min.js +1 -1
  30. package/lib/index.umd.js +108 -46
  31. package/lib/index.umd.min.js +1 -1
  32. package/lib/list/src/list.js +10 -7
  33. package/lib/list/src/list.min.js +1 -1
  34. package/lib/loading/index.js +19 -0
  35. package/lib/loading/index.min.js +1 -0
  36. package/lib/loading/src/loading.js +39 -0
  37. package/lib/loading/src/loading.min.js +1 -0
  38. package/lib/locale/lang/en-US.js +3 -0
  39. package/lib/locale/lang/en-US.min.js +1 -1
  40. package/lib/locale/lang/en-US.umd.js +3 -0
  41. package/lib/locale/lang/ja-JP.js +3 -0
  42. package/lib/locale/lang/ja-JP.min.js +1 -1
  43. package/lib/locale/lang/ja-JP.umd.js +3 -0
  44. package/lib/locale/lang/zh-CN.js +3 -0
  45. package/lib/locale/lang/zh-CN.min.js +1 -1
  46. package/lib/locale/lang/zh-CN.umd.js +3 -0
  47. package/lib/locale/lang/zh-HK.min.js +1 -1
  48. package/lib/locale/lang/zh-HK.umd.js +3 -0
  49. package/lib/locale/lang/zh-MO.min.js +1 -1
  50. package/lib/locale/lang/zh-MO.umd.js +3 -0
  51. package/lib/locale/lang/zh-TC.js +3 -0
  52. package/lib/locale/lang/zh-TC.min.js +1 -1
  53. package/lib/locale/lang/zh-TC.umd.js +3 -0
  54. package/lib/locale/lang/zh-TW.min.js +1 -1
  55. package/lib/locale/lang/zh-TW.umd.js +3 -0
  56. package/lib/modal/src/modal.js +19 -11
  57. package/lib/modal/src/modal.min.js +1 -1
  58. package/lib/select/style/style.css +0 -64
  59. package/lib/select/style/style.min.css +1 -1
  60. package/lib/style.css +1 -1
  61. package/lib/style.min.css +1 -1
  62. package/lib/table/src/table.js +13 -9
  63. package/lib/table/src/table.min.js +1 -1
  64. package/lib/table/style/style.css +0 -63
  65. package/lib/table/style/style.min.css +1 -1
  66. package/lib/tools/log.js +1 -1
  67. package/lib/tools/log.min.js +1 -1
  68. package/lib/v-x-e-table/index.js +1 -1
  69. package/lib/v-x-e-table/index.min.js +1 -1
  70. package/lib/v-x-e-table/src/conf.js +3 -0
  71. package/lib/v-x-e-table/src/conf.min.js +1 -1
  72. package/lib/v-x-e-table/style/style.css +558 -0
  73. package/lib/v-x-e-table/style/style.min.css +1 -0
  74. package/package.json +1 -1
  75. package/packages/edit/src/hook.ts +3 -2
  76. package/packages/form/src/form.ts +8 -9
  77. package/packages/grid/src/grid.ts +8 -5
  78. package/packages/list/src/list.ts +8 -9
  79. package/packages/loading/index.ts +10 -0
  80. package/packages/loading/src/loading.ts +32 -0
  81. package/packages/locale/lang/en-US.ts +3 -0
  82. package/packages/locale/lang/ja-JP.ts +3 -0
  83. package/packages/locale/lang/zh-CN.ts +3 -0
  84. package/packages/locale/lang/zh-TC.ts +3 -0
  85. package/packages/modal/src/modal.ts +16 -13
  86. package/packages/table/src/table.ts +10 -10
  87. package/packages/v-x-e-table/src/conf.ts +4 -0
  88. package/styles/form.scss +1 -0
  89. package/styles/{base/loading.scss → loading.scss} +17 -4
  90. package/styles/modules.scss +1 -0
  91. package/styles/select.scss +0 -1
  92. package/styles/table.scss +0 -1
  93. package/styles/v-x-e-table.scss +2 -0
  94. package/types/table.d.ts +12 -0
@@ -607,17 +607,18 @@ var editHook = {
607
607
  var editConfig = props.editConfig, mouseConfig = props.mouseConfig;
608
608
  var editStore = reactData.editStore, tableColumn = reactData.tableColumn;
609
609
  var editOpts = computeEditOpts.value;
610
- var mode = editOpts.mode, activeMethod = editOpts.activeMethod;
610
+ var mode = editOpts.mode;
611
611
  var actived = editStore.actived;
612
612
  var row = params.row, column = params.column;
613
613
  var editRender = column.editRender;
614
614
  var cell = (params.cell || $xetable.getCell(row, column));
615
+ var beforeEditMethod = editOpts.beforeEditMethod || editOpts.activeMethod;
615
616
  params.cell = cell;
616
617
  if (isEnableConf(editConfig) && isEnableConf(editRender) && cell) {
617
618
  if (actived.row !== row || (mode === 'cell' ? actived.column !== column : false)) {
618
619
  // 判断是否禁用编辑
619
620
  var type = 'edit-disabled';
620
- if (!activeMethod || activeMethod(__assign(__assign({}, params), { $table: $xetable }))) {
621
+ if (!beforeEditMethod || beforeEditMethod(__assign(__assign({}, params), { $table: $xetable }))) {
621
622
  if (mouseConfig) {
622
623
  editMethods.clearSelected();
623
624
  if ($xetable.clearCellAreas) {
@@ -19,6 +19,7 @@ import { scrollToView } from '../../tools/dom';
19
19
  import { createItem, handleFieldOrItem } from './util';
20
20
  import { useSize } from '../../hooks/size';
21
21
  import VxeFormConfigItem from './form-config-item';
22
+ import VxeLoading from '../../loading/index';
22
23
  var Rule = /** @class */ (function () {
23
24
  function Rule(rule) {
24
25
  Object.assign(this, {
@@ -567,15 +568,13 @@ export default defineComponent({
567
568
  class: 'vxe-form-slots',
568
569
  ref: 'hideItem'
569
570
  }, customLayout ? [] : (defaultSlot ? defaultSlot({}) : [])),
570
- h('div', {
571
- class: ['vxe-loading', {
572
- 'is--visible': loading
573
- }]
574
- }, [
575
- h('div', {
576
- class: 'vxe-loading--spinner'
577
- })
578
- ]),
571
+ /**
572
+ * 加载中
573
+ */
574
+ h(VxeLoading, {
575
+ class: 'vxe-form--loading',
576
+ loading: loading
577
+ }),
579
578
  /**
580
579
  * 工具提示
581
580
  */
package/es/form/style.css CHANGED
@@ -162,7 +162,8 @@
162
162
  flex-shrink: 0; }
163
163
  .vxe-form--item .vxe-form--item-inner .vxe-form--item-content {
164
164
  position: relative;
165
- flex-grow: 1; }
165
+ flex-grow: 1;
166
+ word-break: break-all; }
166
167
 
167
168
  .vxe-form--item .vxe-default-input,
168
169
  .vxe-form--item .vxe-default-textarea,
@@ -59,7 +59,7 @@ export default defineComponent({
59
59
  tZindex: 0,
60
60
  tablePage: {
61
61
  total: 0,
62
- pageSize: 10,
62
+ pageSize: GlobalConfig.pager.pageSize || 10,
63
63
  currentPage: 1
64
64
  }
65
65
  });
@@ -162,12 +162,15 @@ export default defineComponent({
162
162
  clss.push(rowClassName ? (XEUtils.isFunction(rowClassName) ? rowClassName(params) : rowClassName) : '');
163
163
  return clss;
164
164
  };
165
- var handleActiveMethod = function (params) {
165
+ var handleBeforeEditMethod = function (params) {
166
166
  var editConfig = props.editConfig;
167
167
  var pendingRecords = reactData.pendingRecords;
168
168
  var $xetable = refTable.value;
169
- var activeMethod = editConfig ? editConfig.activeMethod : null;
170
- return $xetable.findRowIndexOf(pendingRecords, params.row) === -1 && (!activeMethod || activeMethod(__assign(__assign({}, params), { $grid: $xegrid })));
169
+ var beforeEditMethod = editConfig ? (editConfig.beforeEditMethod || editConfig.activeMethod) : null;
170
+ if ($xetable.findRowIndexOf(pendingRecords, params.row) === -1) {
171
+ return !beforeEditMethod || beforeEditMethod(__assign(__assign({}, params), { $grid: $xegrid }));
172
+ }
173
+ return false;
171
174
  };
172
175
  var computeTableProps = computed(function () {
173
176
  var seqConfig = props.seqConfig, pagerConfig = props.pagerConfig, loading = props.loading, editConfig = props.editConfig, proxyConfig = props.proxyConfig;
@@ -192,7 +195,7 @@ export default defineComponent({
192
195
  }
193
196
  }
194
197
  if (editConfig) {
195
- tableProps.editConfig = Object.assign({}, editConfig, { activeMethod: handleActiveMethod });
198
+ tableProps.editConfig = Object.assign({}, editConfig, { beforeEditMethod: handleBeforeEditMethod });
196
199
  }
197
200
  return tableProps;
198
201
  });
@@ -5,6 +5,7 @@ import { useSize } from '../../hooks/size';
5
5
  import { createResizeEvent } from '../../tools/resize';
6
6
  import { browse } from '../../tools/dom';
7
7
  import { GlobalEvent } from '../../tools/event';
8
+ import VxeLoading from '../../loading/index';
8
9
  export default defineComponent({
9
10
  name: 'VxeList',
10
11
  props: {
@@ -305,15 +306,13 @@ export default defineComponent({
305
306
  }
306
307
  }, slots.default ? slots.default({ items: items, $list: $xelist }) : [])
307
308
  ]),
308
- h('div', {
309
- class: ['vxe-list--loading vxe-loading', {
310
- 'is--visible': loading
311
- }]
312
- }, [
313
- h('div', {
314
- class: 'vxe-loading--spinner'
315
- })
316
- ])
309
+ /**
310
+ * 加载中
311
+ */
312
+ h(VxeLoading, {
313
+ class: 'vxe-list--loading',
314
+ loading: loading
315
+ })
317
316
  ]);
318
317
  };
319
318
  $xelist.renderVN = renderVN;
@@ -0,0 +1,7 @@
1
+ import VxeLoading from './src/loading';
2
+ export var Loading = Object.assign(VxeLoading, {
3
+ install: function (app) {
4
+ app.component(VxeLoading.name, VxeLoading);
5
+ }
6
+ });
7
+ export default VxeLoading;
@@ -0,0 +1,31 @@
1
+ import { defineComponent, h } from 'vue';
2
+ import GlobalConfig from '../../v-x-e-table/src/conf';
3
+ export default defineComponent({
4
+ name: 'VxeLoading',
5
+ props: {
6
+ loading: Boolean
7
+ },
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'
19
+ }, [
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
+ }, "" + text) : null
28
+ ])
29
+ ]);
30
+ }
31
+ });
@@ -1,5 +1,8 @@
1
1
  export default {
2
2
  vxe: {
3
+ loading: {
4
+ text: 'Loading'
5
+ },
3
6
  error: {
4
7
  groupFixed: 'If you use group headers, the fixed columns must be set by group.',
5
8
  groupMouseRange: 'Grouping headers and "{0}" cannot be used at the same time, which may cause errors.',
@@ -1,5 +1,8 @@
1
1
  export default {
2
2
  vxe: {
3
+ loading: {
4
+ text: 'Loading'
5
+ },
3
6
  error: {
4
7
  groupFixed: 'グループのヘッダを使用すると、固定列はグループで設定しなければなりません',
5
8
  groupMouseRange: 'グループ化ヘッダーと「{0}」は同時に使用できません。これによりエラーが発生する可能性があります',
@@ -1,5 +1,8 @@
1
1
  export default {
2
2
  vxe: {
3
+ loading: {
4
+ text: '加载中'
5
+ },
3
6
  error: {
4
7
  groupFixed: '如果使用分组表头,固定列必须按组设置',
5
8
  groupMouseRange: '分组表头与 "{0}" 不能同时使用,这可能会出现错误',
@@ -1,5 +1,8 @@
1
1
  export default {
2
2
  vxe: {
3
+ loading: {
4
+ text: '加載中'
5
+ },
3
6
  error: {
4
7
  groupFixed: '如果使用分組表頭,固定列必須按組設定',
5
8
  groupMouseRange: '分组表頭與 "{0}" 不能同時使用,這可能會出現錯誤',
@@ -18,6 +18,7 @@ import { errLog } from '../../tools/log';
18
18
  import { GlobalEvent, hasEventKey, EVENT_KEYS } from '../../tools/event';
19
19
  import GlobalConfig from '../../v-x-e-table/src/conf';
20
20
  import VxeButtonConstructor from '../../button/src/button';
21
+ import VxeLoading from '../../loading/index';
21
22
  export var allActivedModals = [];
22
23
  export var msgQueue = [];
23
24
  export default defineComponent({
@@ -89,7 +90,7 @@ export default defineComponent({
89
90
  modalTop: 0,
90
91
  modalZindex: 0,
91
92
  zoomLocat: null,
92
- firstOpen: false
93
+ firstOpen: true
93
94
  });
94
95
  var refElem = ref();
95
96
  var refModalBox = ref();
@@ -347,13 +348,13 @@ export default defineComponent({
347
348
  nextTick(function () {
348
349
  var fullscreen = props.fullscreen;
349
350
  var firstOpen = reactData.firstOpen;
350
- if (!remember || !firstOpen) {
351
+ if (!remember || firstOpen) {
351
352
  updatePosition().then(function () {
352
353
  setTimeout(function () { return updatePosition(); }, 20);
353
354
  });
354
355
  }
355
- if (!firstOpen) {
356
- reactData.firstOpen = true;
356
+ if (firstOpen) {
357
+ reactData.firstOpen = false;
357
358
  if (hasPosStorage()) {
358
359
  restorePosStorage();
359
360
  }
@@ -361,6 +362,11 @@ export default defineComponent({
361
362
  nextTick(function () { return maximize(); });
362
363
  }
363
364
  }
365
+ else {
366
+ if (fullscreen) {
367
+ nextTick(function () { return maximize(); });
368
+ }
369
+ }
364
370
  });
365
371
  }
366
372
  }
@@ -717,15 +723,13 @@ export default defineComponent({
717
723
  class: 'vxe-modal--content'
718
724
  }, defaultSlot ? (!reactData.inited || (props.destroyOnClose && !reactData.visible) ? [] : defaultSlot({ $modal: $xemodal })) : getFuncText(content)));
719
725
  if (!isMsg) {
720
- contVNs.push(h('div', {
721
- class: ['vxe-loading', {
722
- 'is--visible': props.loading
723
- }]
724
- }, [
725
- h('div', {
726
- class: 'vxe-loading--spinner'
727
- })
728
- ]));
726
+ /**
727
+ * 加载中
728
+ */
729
+ contVNs.push(h(VxeLoading, {
730
+ class: 'vxe-modal--loading',
731
+ loading: props.loading
732
+ }));
729
733
  }
730
734
  return [
731
735
  h('div', {
@@ -1,4 +1,3 @@
1
- @charset "UTF-8";
2
1
  /*font*/
3
2
  /*size*/
4
3
  /*icon*/
@@ -24,69 +23,6 @@
24
23
  /*select*/
25
24
  /*switch*/
26
25
  /*pulldown*/
27
- /*加载中*/
28
- .vxe-loading {
29
- display: none;
30
- position: absolute;
31
- width: 100%;
32
- height: 100%;
33
- top: 0;
34
- left: 0;
35
- z-index: 99;
36
- -webkit-user-select: none;
37
- -moz-user-select: none;
38
- -ms-user-select: none;
39
- user-select: none;
40
- background-color: rgba(0, 0, 0, 0.2); }
41
- .vxe-loading.is--visible {
42
- display: block; }
43
- .vxe-loading .vxe-loading--spinner {
44
- width: 56px;
45
- height: 56px;
46
- position: absolute;
47
- top: 50%;
48
- left: 50%;
49
- transform: translate(-50%, -50%); }
50
- .vxe-loading .vxe-loading--spinner:before, .vxe-loading .vxe-loading--spinner:after {
51
- content: "";
52
- width: 100%;
53
- height: 100%;
54
- border-radius: 50%;
55
- background-color: #409eff;
56
- opacity: 0.6;
57
- position: absolute;
58
- top: 0;
59
- left: 0;
60
- -webkit-animation: bounce 2.0s infinite ease-in-out;
61
- animation: bounce 2.0s infinite ease-in-out; }
62
- .vxe-loading .vxe-loading--spinner:after {
63
- -webkit-animation-delay: -1.0s;
64
- animation-delay: -1.0s; }
65
-
66
- @-webkit-keyframes bounce {
67
- 0%, 100% {
68
- transform: scale(0); }
69
- 50% {
70
- transform: scale(1); } }
71
-
72
- @keyframes bounce {
73
- 0%, 100% {
74
- transform: scale(0); }
75
- 50% {
76
- transform: scale(1); } }
77
-
78
- .size--mini .vxe-loading .vxe-loading--spinner {
79
- width: 38px;
80
- height: 38px; }
81
-
82
- .size--small .vxe-loading .vxe-loading--spinner {
83
- width: 44px;
84
- height: 44px; }
85
-
86
- .size--medium .vxe-loading .vxe-loading--spinner {
87
- width: 50px;
88
- height: 50px; }
89
-
90
26
  .vxe-select {
91
27
  position: relative;
92
28
  display: inline-block;