vxe-table 4.2.5 → 4.2.6-beta.2

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 (93) hide show
  1. package/es/form/src/form.js +8 -9
  2. package/es/form/style.css +2 -1
  3. package/es/grid/src/grid.js +1 -1
  4. package/es/list/src/list.js +8 -9
  5. package/es/loading/index.js +7 -0
  6. package/es/loading/src/loading.js +31 -0
  7. package/es/locale/lang/en-US.js +3 -0
  8. package/es/locale/lang/ja-JP.js +3 -0
  9. package/es/locale/lang/zh-CN.js +3 -0
  10. package/es/locale/lang/zh-TC.js +3 -0
  11. package/es/modal/src/modal.js +22 -14
  12. package/es/modal/style.css +1 -1
  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 +5 -9
  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/form/src/form.js +10 -7
  23. package/lib/form/src/form.min.js +1 -1
  24. package/lib/form/style/style.css +2 -1
  25. package/lib/form/style/style.min.css +1 -1
  26. package/lib/grid/src/grid.js +1 -1
  27. package/lib/grid/src/grid.min.js +1 -1
  28. package/lib/index.umd.js +93 -36
  29. package/lib/index.umd.min.js +1 -1
  30. package/lib/list/src/list.js +10 -7
  31. package/lib/list/src/list.min.js +1 -1
  32. package/lib/loading/index.js +19 -0
  33. package/lib/loading/index.min.js +1 -0
  34. package/lib/loading/src/loading.js +39 -0
  35. package/lib/loading/src/loading.min.js +1 -0
  36. package/lib/locale/lang/en-US.js +3 -0
  37. package/lib/locale/lang/en-US.min.js +1 -1
  38. package/lib/locale/lang/en-US.umd.js +3 -0
  39. package/lib/locale/lang/ja-JP.js +3 -0
  40. package/lib/locale/lang/ja-JP.min.js +1 -1
  41. package/lib/locale/lang/ja-JP.umd.js +3 -0
  42. package/lib/locale/lang/zh-CN.js +3 -0
  43. package/lib/locale/lang/zh-CN.min.js +1 -1
  44. package/lib/locale/lang/zh-CN.umd.js +3 -0
  45. package/lib/locale/lang/zh-HK.min.js +1 -1
  46. package/lib/locale/lang/zh-HK.umd.js +3 -0
  47. package/lib/locale/lang/zh-MO.min.js +1 -1
  48. package/lib/locale/lang/zh-MO.umd.js +3 -0
  49. package/lib/locale/lang/zh-TC.js +3 -0
  50. package/lib/locale/lang/zh-TC.min.js +1 -1
  51. package/lib/locale/lang/zh-TC.umd.js +3 -0
  52. package/lib/locale/lang/zh-TW.min.js +1 -1
  53. package/lib/locale/lang/zh-TW.umd.js +3 -0
  54. package/lib/modal/src/modal.js +25 -12
  55. package/lib/modal/src/modal.min.js +1 -1
  56. package/lib/modal/style/style.css +1 -1
  57. package/lib/modal/style/style.min.css +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 +6 -7
  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/form/src/form.ts +8 -9
  76. package/packages/grid/src/grid.ts +1 -1
  77. package/packages/list/src/list.ts +8 -9
  78. package/packages/loading/index.ts +10 -0
  79. package/packages/loading/src/loading.ts +32 -0
  80. package/packages/locale/lang/en-US.ts +3 -0
  81. package/packages/locale/lang/ja-JP.ts +3 -0
  82. package/packages/locale/lang/zh-CN.ts +3 -0
  83. package/packages/locale/lang/zh-TC.ts +3 -0
  84. package/packages/modal/src/modal.ts +21 -14
  85. package/packages/table/src/table.ts +5 -9
  86. package/packages/v-x-e-table/src/conf.ts +4 -0
  87. package/styles/form.scss +1 -0
  88. package/styles/{base/loading.scss → loading.scss} +17 -4
  89. package/styles/modal.scss +1 -1
  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
@@ -0,0 +1,32 @@
1
+ import { defineComponent, h } from 'vue'
2
+ import GlobalConfig from '../../v-x-e-table/src/conf'
3
+
4
+ export default defineComponent({
5
+ name: 'VxeLoading',
6
+ props: {
7
+ loading: Boolean
8
+ },
9
+ render () {
10
+ const icon = GlobalConfig.icon.LOADING
11
+ const loadingText = GlobalConfig.loadingText
12
+ const text = loadingText === null ? loadingText : GlobalConfig.i18n('vxe.loading.text')
13
+ return h('div', {
14
+ class: ['vxe-loading', {
15
+ 'is--visible': this.loading
16
+ }]
17
+ }, [
18
+ h('div', {
19
+ class: 'vxe-loading--chunk'
20
+ }, [
21
+ icon ? h('i', {
22
+ class: icon
23
+ }) : h('div', {
24
+ class: 'vxe-loading--spinner'
25
+ }),
26
+ text ? h('div', {
27
+ class: 'vxe-loading--text'
28
+ }, `${text}`) : null
29
+ ])
30
+ ])
31
+ }
32
+ })
@@ -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}" 不能同時使用,這可能會出現錯誤',
@@ -7,6 +7,7 @@ import { errLog } from '../../tools/log'
7
7
  import { GlobalEvent, hasEventKey, EVENT_KEYS } from '../../tools/event'
8
8
  import GlobalConfig from '../../v-x-e-table/src/conf'
9
9
  import VxeButtonConstructor from '../../button/src/button'
10
+ import VxeLoading from '../../loading/index'
10
11
 
11
12
  import { VxeModalConstructor, VxeModalPropTypes, ModalReactData, VxeModalEmits, ModalEventTypes, VxeButtonInstance, ModalMethods, ModalPrivateRef, VxeModalMethods } from '../../../types/all'
12
13
 
@@ -85,7 +86,7 @@ export default defineComponent({
85
86
  modalTop: 0,
86
87
  modalZindex: 0,
87
88
  zoomLocat: null,
88
- firstOpen: false
89
+ firstOpen: true
89
90
  })
90
91
 
91
92
  const refElem = ref() as Ref<HTMLDivElement>
@@ -361,18 +362,22 @@ export default defineComponent({
361
362
  nextTick(() => {
362
363
  const { fullscreen } = props
363
364
  const { firstOpen } = reactData
364
- if (!remember || !firstOpen) {
365
+ if (!remember || firstOpen) {
365
366
  updatePosition().then(() => {
366
367
  setTimeout(() => updatePosition(), 20)
367
368
  })
368
369
  }
369
- if (!firstOpen) {
370
- reactData.firstOpen = true
370
+ if (firstOpen) {
371
+ reactData.firstOpen = false
371
372
  if (hasPosStorage()) {
372
373
  restorePosStorage()
373
374
  } else if (fullscreen) {
374
375
  nextTick(() => maximize())
375
376
  }
377
+ } else {
378
+ if (fullscreen) {
379
+ nextTick(() => maximize())
380
+ }
376
381
  }
377
382
  })
378
383
  }
@@ -510,6 +515,7 @@ export default defineComponent({
510
515
  }
511
516
  boxElem.style.left = `${left}px`
512
517
  boxElem.style.top = `${top}px`
518
+ boxElem.className = boxElem.className.replace(/\s?is--drag/, '') + ' is--drag'
513
519
  }
514
520
  document.onmouseup = () => {
515
521
  document.onmousemove = domMousemove
@@ -519,6 +525,9 @@ export default defineComponent({
519
525
  savePosStorage()
520
526
  })
521
527
  }
528
+ setTimeout(() => {
529
+ boxElem.className = boxElem.className.replace(/\s?is--drag/, '')
530
+ }, 50)
522
531
  }
523
532
  }
524
533
  }
@@ -723,7 +732,7 @@ export default defineComponent({
723
732
  headVNs.push(
724
733
  h('div', {
725
734
  class: ['vxe-modal--header', {
726
- 'is--drag': draggable,
735
+ 'is--draggable': draggable,
727
736
  'is--ellipsis': !isMsg && props.showTitleOverflow
728
737
  }],
729
738
  ...headerOns
@@ -756,16 +765,14 @@ export default defineComponent({
756
765
  }, defaultSlot ? (!reactData.inited || (props.destroyOnClose && !reactData.visible) ? [] : defaultSlot({ $modal: $xemodal })) as VNode[] : getFuncText(content))
757
766
  )
758
767
  if (!isMsg) {
768
+ /**
769
+ * 加载中
770
+ */
759
771
  contVNs.push(
760
- h('div', {
761
- class: ['vxe-loading', {
762
- 'is--visible': props.loading
763
- }]
764
- }, [
765
- h('div', {
766
- class: 'vxe-loading--spinner'
767
- })
768
- ])
772
+ h(VxeLoading, {
773
+ class: 'vxe-modal--loading',
774
+ loading: props.loading
775
+ })
769
776
  )
770
777
  }
771
778
  return [
@@ -13,6 +13,7 @@ import TableBodyComponent from './body'
13
13
  import TableHeaderComponent from '../../header'
14
14
  import tableProps from './props'
15
15
  import tableEmits from './emits'
16
+ import VxeLoading from '../../loading/index'
16
17
  import { getRowUniqueId, clearTableAllStatus, getRowkey, getRowid, rowToVisible, colToVisible, getCellValue, setCellValue, handleFieldOrColumn, toTreePathSeq, restoreScrollLocation, restoreScrollListener, XEBodyScrollElement } from './util'
17
18
 
18
19
  import { VxeGridConstructor, VxeGridPrivateMethods, VxeTableConstructor, TableReactData, TableInternalData, VxeTablePropTypes, VxeToolbarConstructor, VxeTooltipInstance, TablePrivateMethods, VxeTablePrivateRef, VxeTablePrivateComputed, VxeTablePrivateMethods, VxeTableMethods, TableMethods, VxeMenuPanelInstance, VxeTableDefines, VxeTableProps } from '../../../types/all'
@@ -6030,15 +6031,10 @@ export default defineComponent({
6030
6031
  /**
6031
6032
  * 加载中
6032
6033
  */
6033
- h('div', {
6034
- class: ['vxe-table--loading vxe-loading', {
6035
- 'is--visible': loading
6036
- }]
6037
- }, [
6038
- h('div', {
6039
- class: 'vxe-loading--spinner'
6040
- })
6041
- ]),
6034
+ h(VxeLoading, {
6035
+ class: 'vxe-table--loading',
6036
+ loading
6037
+ }),
6042
6038
  /**
6043
6039
  * 筛选
6044
6040
  */
@@ -8,6 +8,7 @@ const GlobalConfig: VXETableGlobalConfig = {
8
8
  version: 0, // 版本号,对于某些带数据缓存的功能有用到,上升版本号可以用于重置数据
9
9
  // resizeInterval: 500,
10
10
  emptyCell: ' ',
11
+ loadingText: null, // 自定义loading提示内容,如果为null则不显示文本
11
12
  table: {
12
13
  fit: true,
13
14
  showHeader: true,
@@ -125,6 +126,9 @@ const GlobalConfig: VXETableGlobalConfig = {
125
126
  types: {}
126
127
  },
127
128
  icon: {
129
+ // loading
130
+ // LOADING: iconPrefix + 'refresh roll vxe-loading--default-icon',
131
+
128
132
  // table
129
133
  TABLE_SORT_ASC: iconPrefix + 'caret-top',
130
134
  TABLE_SORT_DESC: iconPrefix + 'caret-bottom',
package/styles/form.scss CHANGED
@@ -177,6 +177,7 @@
177
177
  .vxe-form--item-content {
178
178
  position: relative;
179
179
  flex-grow: 1;
180
+ word-break: break-all;
180
181
  }
181
182
  }
182
183
  .vxe-default-input,
@@ -12,13 +12,26 @@
12
12
  &.is--visible {
13
13
  display: block;
14
14
  }
15
+ & > .vxe-loading--chunk {
16
+ width: 100%;
17
+ position: absolute;
18
+ top: 50%;
19
+ left: 0;
20
+ transform: translateY(-50%);
21
+ text-align: center;
22
+ color: $vxe-primary-color;
23
+ }
24
+ .vxe-loading--default-icon {
25
+ font-size: 1.2em;
26
+ }
27
+ .vxe-loading--text {
28
+ padding: 0.4em 0;
29
+ }
15
30
  .vxe-loading--spinner {
31
+ display: inline-block;
32
+ position: relative;
16
33
  width: 56px;
17
34
  height: 56px;
18
- position: absolute;
19
- top: 50%;
20
- left: 50%;
21
- transform: translate(-50%, -50%);
22
35
  &:before,
23
36
  &:after {
24
37
  content: "";
package/styles/modal.scss CHANGED
@@ -246,7 +246,7 @@
246
246
  background-color: $vxe-modal-header-background-color;
247
247
  border-radius: $vxe-border-radius $vxe-border-radius 0 0;
248
248
  user-select: none;
249
- &.is--drag {
249
+ &.is--draggable {
250
250
  cursor: move;
251
251
  }
252
252
  &.is--ellipsis {
@@ -1,4 +1,5 @@
1
1
  @import './icon.scss';
2
+ @import './loading.scss';
2
3
  @import './table.scss';
3
4
  @import './column.scss';
4
5
  @import './colgroup.scss';
@@ -1,6 +1,5 @@
1
1
  /**Variable**/
2
2
  @import './helpers/mixin.scss';
3
- @import './base/loading.scss';
4
3
 
5
4
  .vxe-select {
6
5
  position: relative;
package/styles/table.scss CHANGED
@@ -2,7 +2,6 @@
2
2
  @import './helpers/mixin.scss';
3
3
  @import './base/checked.scss';
4
4
  @import './base/common.scss';
5
- @import './base/loading.scss';
6
5
 
7
6
  %DefaultColumnHeight {
8
7
  height: $vxe-table-row-height-default;
@@ -1 +1,3 @@
1
1
  /**Variable**/
2
+ @import './icon.scss';
3
+ @import './loading.scss';