vxe-table 3.10.0-beta.2 → 3.10.0-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 (98) hide show
  1. package/es/locale/lang/en-US.js +1 -0
  2. package/es/locale/lang/es-ES.js +1 -0
  3. package/es/locale/lang/hu-HU.js +1 -0
  4. package/es/locale/lang/ja-JP.js +1 -0
  5. package/es/locale/lang/ko-KR.js +1 -0
  6. package/es/locale/lang/pt-BR.js +1 -0
  7. package/es/locale/lang/ru-RU.js +1 -0
  8. package/es/locale/lang/uk-UA.js +1 -0
  9. package/es/locale/lang/vi-VN.js +1 -0
  10. package/es/locale/lang/zh-CHT.js +1 -0
  11. package/es/locale/lang/zh-CN.js +1 -0
  12. package/es/style.css +1 -1
  13. package/es/style.min.css +1 -1
  14. package/es/table/module/export/export-panel.js +325 -258
  15. package/es/table/module/export/import-panel.js +138 -81
  16. package/es/table/module/export/mixin.js +14 -0
  17. package/es/table/src/methods.js +1 -1
  18. package/es/table/style.css +48 -47
  19. package/es/table/style.min.css +1 -1
  20. package/es/ui/index.js +1 -1
  21. package/es/ui/src/log.js +1 -1
  22. package/es/vxe-table/style.css +48 -47
  23. package/es/vxe-table/style.min.css +1 -1
  24. package/lib/index.umd.js +356 -240
  25. package/lib/index.umd.min.js +1 -1
  26. package/lib/locale/lang/en-US.js +1 -0
  27. package/lib/locale/lang/en-US.min.js +1 -1
  28. package/lib/locale/lang/en-US.umd.js +1 -0
  29. package/lib/locale/lang/es-ES.js +1 -0
  30. package/lib/locale/lang/es-ES.min.js +1 -1
  31. package/lib/locale/lang/es-ES.umd.js +1 -0
  32. package/lib/locale/lang/hu-HU.js +1 -0
  33. package/lib/locale/lang/hu-HU.min.js +1 -1
  34. package/lib/locale/lang/hu-HU.umd.js +1 -0
  35. package/lib/locale/lang/ja-JP.js +1 -0
  36. package/lib/locale/lang/ja-JP.min.js +1 -1
  37. package/lib/locale/lang/ja-JP.umd.js +1 -0
  38. package/lib/locale/lang/ko-KR.js +1 -0
  39. package/lib/locale/lang/ko-KR.min.js +1 -1
  40. package/lib/locale/lang/ko-KR.umd.js +1 -0
  41. package/lib/locale/lang/pt-BR.js +1 -0
  42. package/lib/locale/lang/pt-BR.min.js +1 -1
  43. package/lib/locale/lang/pt-BR.umd.js +1 -0
  44. package/lib/locale/lang/ru-RU.js +1 -0
  45. package/lib/locale/lang/ru-RU.min.js +1 -1
  46. package/lib/locale/lang/ru-RU.umd.js +1 -0
  47. package/lib/locale/lang/uk-UA.js +1 -0
  48. package/lib/locale/lang/uk-UA.min.js +1 -1
  49. package/lib/locale/lang/uk-UA.umd.js +1 -0
  50. package/lib/locale/lang/vi-VN.js +1 -0
  51. package/lib/locale/lang/vi-VN.min.js +1 -1
  52. package/lib/locale/lang/zh-CHT.js +1 -0
  53. package/lib/locale/lang/zh-CHT.min.js +1 -1
  54. package/lib/locale/lang/zh-CHT.umd.js +1 -0
  55. package/lib/locale/lang/zh-CN.js +1 -0
  56. package/lib/locale/lang/zh-CN.min.js +1 -1
  57. package/lib/locale/lang/zh-CN.umd.js +1 -0
  58. package/lib/style.css +1 -1
  59. package/lib/style.min.css +1 -1
  60. package/lib/table/module/export/export-panel.js +239 -185
  61. package/lib/table/module/export/export-panel.min.js +1 -1
  62. package/lib/table/module/export/import-panel.js +99 -52
  63. package/lib/table/module/export/import-panel.min.js +1 -1
  64. package/lib/table/module/export/mixin.js +14 -0
  65. package/lib/table/module/export/mixin.min.js +1 -1
  66. package/lib/table/src/methods.js +1 -1
  67. package/lib/table/src/methods.min.js +1 -1
  68. package/lib/table/style/style.css +48 -47
  69. package/lib/table/style/style.min.css +1 -1
  70. package/lib/ui/index.js +1 -1
  71. package/lib/ui/index.min.js +1 -1
  72. package/lib/ui/src/log.js +1 -1
  73. package/lib/ui/src/log.min.js +1 -1
  74. package/lib/vxe-table/style/style.css +48 -47
  75. package/lib/vxe-table/style/style.min.css +1 -1
  76. package/package.json +2 -2
  77. package/packages/locale/lang/en-US.ts +1 -0
  78. package/packages/locale/lang/es-ES.ts +1 -0
  79. package/packages/locale/lang/hu-HU.ts +1 -0
  80. package/packages/locale/lang/ja-JP.ts +1 -0
  81. package/packages/locale/lang/ko-KR.ts +1 -0
  82. package/packages/locale/lang/pt-BR.ts +1 -0
  83. package/packages/locale/lang/ru-RU.ts +1 -0
  84. package/packages/locale/lang/uk-UA.ts +1 -0
  85. package/packages/locale/lang/vi-VN.ts +1 -0
  86. package/packages/locale/lang/zh-CHT.ts +1 -0
  87. package/packages/locale/lang/zh-CN.ts +1 -0
  88. package/packages/table/module/export/export-panel.ts +323 -253
  89. package/packages/table/module/export/import-panel.ts +141 -79
  90. package/packages/table/module/export/mixin.ts +15 -0
  91. package/packages/table/src/methods.ts +1 -1
  92. package/styles/components/table-module/export.scss +17 -14
  93. /package/es/{iconfont.1730365807487.ttf → iconfont.1730447026880.ttf} +0 -0
  94. /package/es/{iconfont.1730365807487.woff → iconfont.1730447026880.woff} +0 -0
  95. /package/es/{iconfont.1730365807487.woff2 → iconfont.1730447026880.woff2} +0 -0
  96. /package/lib/{iconfont.1730365807487.ttf → iconfont.1730447026880.ttf} +0 -0
  97. /package/lib/{iconfont.1730365807487.woff → iconfont.1730447026880.woff} +0 -0
  98. /package/lib/{iconfont.1730365807487.woff2 → iconfont.1730447026880.woff2} +0 -0
@@ -6,7 +6,7 @@ import { errLog } from '../../../ui/src/log'
6
6
 
7
7
  import type { VxeModalComponent, VxeSelectComponent, VxeButtonComponent } from 'vxe-pc-ui'
8
8
 
9
- const { getI18n, getIcon, globalMixins } = VxeUI
9
+ const { getI18n, getIcon, globalMixins, renderEmptyElement } = VxeUI
10
10
 
11
11
  export default {
12
12
  name: 'VxeTableImportPanel',
@@ -21,6 +21,11 @@ export default {
21
21
  // VxeModal,
22
22
  // VxeRadio
23
23
  },
24
+ inject: {
25
+ $xeTable: {
26
+ default: null
27
+ }
28
+ },
24
29
  data () {
25
30
  return {
26
31
  loading: false
@@ -65,18 +70,32 @@ export default {
65
70
  }
66
71
  },
67
72
  render (this: any, h: CreateElement) {
73
+ const $xeTable = this.$xeTable
74
+
75
+ const importOpts = $xeTable.importOpts
68
76
  const { hasFile, parseTypeLabel, defaultOptions, storeData, selectName } = this
77
+ const slots = importOpts.slots || {}
78
+ const topSlot = slots.top
79
+ const bottomSlot = slots.bottom
80
+ const defaultSlot = slots.default
81
+ const footerSlot = slots.footer
82
+
69
83
  return h('vxe-modal', {
70
84
  ref: 'modal',
71
85
  props: {
86
+ id: 'VXE_IMPORT_MODAL',
72
87
  value: storeData.visible,
73
88
  title: getI18n('vxe.import.impTitle'),
74
89
  width: 540,
90
+ minWidth: 360,
91
+ minHeight: 240,
75
92
  mask: true,
76
93
  lockView: true,
77
- showFooter: false,
94
+ showFooter: true,
78
95
  escClosable: true,
79
96
  maskClosable: true,
97
+ showMaximize: true,
98
+ resize: true,
80
99
  loading: this.loading
81
100
  },
82
101
  on: {
@@ -84,91 +103,134 @@ export default {
84
103
  storeData.visible = value
85
104
  },
86
105
  show: this.showEvent
87
- }
88
- }, [
89
- h('div', {
90
- class: 'vxe-export--panel'
91
- }, [
92
- h('table', {
93
- attrs: {
94
- cellspacing: 0,
95
- cellpadding: 0,
96
- border: 0
106
+ },
107
+ scopedSlots: {
108
+ default: () => {
109
+ const params = {
110
+ $table: $xeTable,
111
+ $grid: $xeTable.xegrid,
112
+ options: importOpts,
113
+ params: importOpts.params as any
97
114
  }
98
- }, [
99
- h('tbody', [
100
- h('tr', [
101
- h('td', getI18n('vxe.import.impFile')),
102
- h('td', [
103
- hasFile
104
- ? h('div', {
105
- class: 'vxe-import-selected--file',
115
+
116
+ return h('div', {
117
+ class: 'vxe-table-export--panel'
118
+ }, [
119
+ topSlot
120
+ ? h('div', {
121
+ class: 'vxe-table-export--panel-top'
122
+ }, $xeTable.callSlot(topSlot, params, h))
123
+ : renderEmptyElement(this),
124
+ h('div', {
125
+ class: 'vxe-table-export--panel-body'
126
+ }, defaultSlot
127
+ ? $xeTable.callSlot(defaultSlot, params, h)
128
+ : [
129
+ h('table', {
130
+ class: 'vxe-table-export--panel-table',
106
131
  attrs: {
107
- title: selectName
132
+ cellspacing: 0,
133
+ cellpadding: 0,
134
+ border: 0
108
135
  }
109
136
  }, [
110
- h('span', selectName),
111
- h('i', {
112
- class: getIcon().INPUT_CLEAR,
113
- on: {
114
- click: this.clearFileEvent
115
- }
116
- })
137
+ h('tbody', [
138
+ h('tr', [
139
+ h('td', getI18n('vxe.import.impFile')),
140
+ h('td', [
141
+ hasFile
142
+ ? h('div', {
143
+ class: 'vxe-table-export--selected--file',
144
+ attrs: {
145
+ title: selectName
146
+ }
147
+ }, [
148
+ h('span', selectName),
149
+ h('i', {
150
+ class: getIcon().INPUT_CLEAR,
151
+ on: {
152
+ click: this.clearFileEvent
153
+ }
154
+ })
155
+ ])
156
+ : h('button', {
157
+ ref: 'fileBtn',
158
+ class: 'vxe-table-export--select--file',
159
+ attrs: {
160
+ type: 'button'
161
+ },
162
+ on: {
163
+ click: this.selectFileEvent
164
+ }
165
+ }, getI18n('vxe.import.impSelect'))
166
+ ])
167
+ ]),
168
+ h('tr', [
169
+ h('td', getI18n('vxe.import.impType')),
170
+ h('td', parseTypeLabel)
171
+ ]),
172
+ h('tr', [
173
+ h('td', getI18n('vxe.import.impMode')),
174
+ h('td', [
175
+ h('vxe-select', {
176
+ props: {
177
+ value: defaultOptions.mode,
178
+ options: storeData.modeList
179
+ },
180
+ on: {
181
+ input (value: any) {
182
+ defaultOptions.mode = value
183
+ }
184
+ }
185
+ })
186
+ ])
187
+ ])
188
+ ])
117
189
  ])
118
- : h('button', {
119
- ref: 'fileBtn',
120
- class: 'vxe-import-select--file',
121
- attrs: {
122
- type: 'button'
123
- },
190
+ ]
191
+ ),
192
+ bottomSlot
193
+ ? h('div', {
194
+ class: 'vxe-table-export--panel-bottom'
195
+ }, $xeTable.callSlot(bottomSlot, params, h))
196
+ : renderEmptyElement(this)
197
+ ])
198
+ },
199
+ footer: () => {
200
+ const params = {
201
+ $table: $xeTable,
202
+ $grid: $xeTable.xegrid,
203
+ options: importOpts,
204
+ params: importOpts.params as any
205
+ }
206
+ return h('div', {
207
+ class: 'vxe-table-export--panel-footer'
208
+ }, footerSlot
209
+ ? $xeTable.callSlot(footerSlot, params, h)
210
+ : [
211
+ h('div', {
212
+ class: 'vxe-table-export--panel-btns'
213
+ }, [
214
+ h('vxe-button', {
124
215
  on: {
125
- click: this.selectFileEvent
216
+ click: this.cancelEvent
126
217
  }
127
- }, getI18n('vxe.import.impSelect'))
128
- ])
129
- ]),
130
- h('tr', [
131
- h('td', getI18n('vxe.import.impType')),
132
- h('td', parseTypeLabel)
133
- ]),
134
- h('tr', [
135
- h('td', getI18n('vxe.import.impMode')),
136
- h('td', [
137
- h('vxe-select', {
138
- props: {
139
- value: defaultOptions.mode,
140
- options: storeData.modeList
141
- },
142
- on: {
143
- input (value: any) {
144
- defaultOptions.mode = value
218
+ }, getI18n('vxe.import.impCancel')),
219
+ h('vxe-button', {
220
+ props: {
221
+ status: 'primary',
222
+ disabled: !hasFile
223
+ },
224
+ on: {
225
+ click: this.importEvent
145
226
  }
146
- }
147
- })
148
- ])
149
- ])
150
- ])
151
- ]),
152
- h('div', {
153
- class: 'vxe-export--panel-btns'
154
- }, [
155
- h('vxe-button', {
156
- on: {
157
- click: this.cancelEvent
158
- }
159
- }, getI18n('vxe.import.impCancel')),
160
- h('vxe-button', {
161
- props: {
162
- status: 'primary',
163
- disabled: !hasFile
164
- },
165
- on: {
166
- click: this.importEvent
167
- }
168
- }, getI18n('vxe.import.impConfirm'))
169
- ])
170
- ])
171
- ])
227
+ }, getI18n('vxe.import.impConfirm'))
228
+ ])
229
+ ]
230
+ )
231
+ }
232
+ }
233
+ })
172
234
  },
173
235
  methods: {
174
236
  clearFileEvent () {
@@ -919,6 +919,13 @@ function handleFileImport ($xetable: any, file: any, opts: any) {
919
919
  })
920
920
  }
921
921
 
922
+ function handleCloseExport () {
923
+ if (VxeUI.modal) {
924
+ return VxeUI.modal.close('VXE_EXPORT_MODAL')
925
+ }
926
+ return Promise.resolve()
927
+ }
928
+
922
929
  /**
923
930
  * 读取本地文件
924
931
  * @param {*} options 参数
@@ -1429,6 +1436,12 @@ export default {
1429
1436
  }
1430
1437
  })
1431
1438
  },
1439
+ _closeImport () {
1440
+ if (VxeUI.modal) {
1441
+ return VxeUI.modal.close('VXE_IMPORT_MODAL')
1442
+ }
1443
+ return Promise.resolve()
1444
+ },
1432
1445
  _openImport (options: any) {
1433
1446
  const { importOpts } = this
1434
1447
  const defOpts = Object.assign({
@@ -1482,6 +1495,7 @@ export default {
1482
1495
  }
1483
1496
  this.initStore.import = true
1484
1497
  },
1498
+ _closeExport: handleCloseExport,
1485
1499
  _openExport (options: any) {
1486
1500
  const { exportOpts } = this
1487
1501
  if (process.env.VUE_APP_VXE_ENV === 'development') {
@@ -1491,6 +1505,7 @@ export default {
1491
1505
  }
1492
1506
  return handleExportAndPrint(this, Object.assign({}, exportOpts, options))
1493
1507
  },
1508
+ _closePrint: handleCloseExport,
1494
1509
  _openPrint (options: any) {
1495
1510
  const { printOpts } = this
1496
1511
  if (process.env.VUE_APP_VXE_ENV === 'development') {
@@ -5971,7 +5971,7 @@ const Methods = {
5971
5971
  } as any
5972
5972
 
5973
5973
  // Module methods
5974
- const funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,openPrint,getPrintHtml,exportData,openImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom'.split(',')
5974
+ const funcs = 'setFilter,openFilter,clearFilter,getCheckedFilters,updateFilterOptionStatus,closeMenu,setActiveCellArea,getActiveCellArea,getCellAreas,clearCellAreas,copyCellArea,cutCellArea,pasteCellArea,getCopyCellArea,getCopyCellAreas,clearCopyCellArea,setCellAreas,openFNR,openFind,openReplace,closeFNR,getSelectedCell,clearSelected,insert,insertAt,insertNextAt,remove,removeCheckboxRow,removeRadioRow,removeCurrentRow,getRecordset,getInsertRecords,getRemoveRecords,getUpdateRecords,clearEdit,clearActived,getEditRecord,getActiveRecord,isEditByRow,isActiveByRow,setEditRow,setActiveRow,setEditCell,setActiveCell,setSelectCell,clearValidate,fullValidate,validate,openExport,closeExport,openPrint,closePrint,getPrintHtml,exportData,openImport,closeImport,importData,saveFile,readFile,importByFile,print,openCustom,closeCustom'.split(',')
5975
5975
 
5976
5976
  funcs.forEach(name => {
5977
5977
  Methods[name] = function (...args: any[]) {
@@ -1,6 +1,6 @@
1
1
  @use '../../helpers/baseMixin.scss';
2
2
 
3
- .vxe-export--panel-column > ul {
3
+ .vxe-table-export--panel-column > ul {
4
4
  list-style-type: none;
5
5
  overflow: auto;
6
6
  margin: 0;
@@ -15,8 +15,8 @@
15
15
  }
16
16
  }
17
17
 
18
- .vxe-export--panel {
19
- & > table {
18
+ .vxe-table-export--panel {
19
+ .vxe-table-export--panel-table {
20
20
  width: 100%;
21
21
  border: 0;
22
22
  table-layout: fixed;
@@ -36,13 +36,13 @@
36
36
  & > .vxe-select {
37
37
  width: 80%;
38
38
  }
39
- & > .vxe-export--panel-option-row {
39
+ & > .vxe-table-export--panel-option-row {
40
40
  padding: 0.25em 0;
41
41
  }
42
42
  }
43
43
  }
44
44
  }
45
- .vxe-export--panel-column {
45
+ .vxe-table-export--panel-column {
46
46
  width: 80%;
47
47
  border: 1px solid var(--vxe-ui-input-border-color);
48
48
  margin: 3px 0;
@@ -62,19 +62,26 @@
62
62
  }
63
63
  }
64
64
  }
65
- .vxe-export--panel-column-header {
65
+ .vxe-table-export--panel-column-header {
66
66
  padding: 0.1em 0;
67
67
  background-color: var(--vxe-ui-table-header-background-color);
68
68
  font-weight: 700;
69
69
  border-bottom: 1px solid var(--vxe-ui-table-border-color);
70
70
  }
71
- .vxe-export--panel-column-body {
71
+ .vxe-table-export--panel-column-body {
72
72
  padding: 0.2em 0;
73
73
  min-height: 10em;
74
74
  max-height: 17.6em;
75
75
  }
76
76
  }
77
- .vxe-import-selected--file {
77
+ .vxe-table-export--panel-btns {
78
+ text-align: right;
79
+ padding: 0.8em 0.25em 0.25em 0.25em;
80
+ }
81
+ }
82
+
83
+ .vxe-table-export--panel {
84
+ .vxe-table-export--selected--file {
78
85
  padding-right: 40px;
79
86
  position: relative;
80
87
  overflow: hidden;
@@ -97,7 +104,7 @@
97
104
  }
98
105
  }
99
106
  }
100
- .vxe-import-select--file {
107
+ .vxe-table-export--select--file {
101
108
  width: 80%;
102
109
  border: 1px dashed var(--vxe-ui-input-border-color);
103
110
  padding: 6px 34px;
@@ -116,12 +123,8 @@
116
123
  border-color: var(--vxe-ui-font-primary-color);
117
124
  }
118
125
  }
119
- .vxe-export--panel-btns {
120
- text-align: right;
121
- padding: 0.8em 0.25em 0.25em 0.25em;
122
- }
123
126
  }
124
127
 
125
- .vxe-export--panel-column-option {
128
+ .vxe-table-export--panel-column-option {
126
129
  @include baseMixin.createCheckboxIcon();
127
130
  }