vxe-table 3.19.39 → 3.20.0-beta.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 (109) hide show
  1. package/es/index.css +1 -1
  2. package/es/index.esm.js +2 -1
  3. package/es/index.min.css +1 -1
  4. package/es/style.css +1 -1
  5. package/es/style.min.css +1 -1
  6. package/es/table/module/custom/mixin.js +6 -4
  7. package/es/table/module/custom/panel.js +806 -799
  8. package/es/table/module/edit/mixin.js +43 -31
  9. package/es/table/module/export/export-panel.js +511 -458
  10. package/es/table/module/export/import-panel.js +224 -192
  11. package/es/table/module/keyboard/mixin.js +2 -2
  12. package/es/table/module/menu/panel.js +165 -161
  13. package/es/table/module/validator/mixin.js +255 -236
  14. package/es/table/src/body.js +2 -1
  15. package/es/table/src/cell.js +2 -2
  16. package/es/table/src/methods.js +33 -43
  17. package/es/table/src/table.js +13 -249
  18. package/es/table/src/util.js +242 -0
  19. package/es/table/style.css +23 -50
  20. package/es/table/style.min.css +1 -1
  21. package/es/ui/index.js +2 -2
  22. package/es/ui/src/dom.js +22 -0
  23. package/es/ui/src/log.js +1 -1
  24. package/es/vxe-table/style.css +23 -50
  25. package/es/vxe-table/style.min.css +1 -1
  26. package/lib/index.common.js +2 -1
  27. package/lib/index.css +1 -1
  28. package/lib/index.min.css +1 -1
  29. package/lib/index.umd.js +3640 -4790
  30. package/lib/index.umd.min.js +1 -1
  31. package/lib/style.css +1 -1
  32. package/lib/style.min.css +1 -1
  33. package/lib/table/module/custom/mixin.js +6 -4
  34. package/lib/table/module/custom/mixin.min.js +1 -1
  35. package/lib/table/module/custom/panel.js +693 -685
  36. package/lib/table/module/custom/panel.min.js +1 -1
  37. package/lib/table/module/edit/mixin.js +47 -31
  38. package/lib/table/module/edit/mixin.min.js +1 -1
  39. package/lib/table/module/export/export-panel.js +450 -384
  40. package/lib/table/module/export/export-panel.min.js +1 -1
  41. package/lib/table/module/export/import-panel.js +200 -159
  42. package/lib/table/module/export/import-panel.min.js +1 -1
  43. package/lib/table/module/keyboard/mixin.js +2 -2
  44. package/lib/table/module/keyboard/mixin.min.js +1 -1
  45. package/lib/table/module/menu/panel.js +119 -114
  46. package/lib/table/module/menu/panel.min.js +1 -1
  47. package/lib/table/module/validator/mixin.js +271 -259
  48. package/lib/table/module/validator/mixin.min.js +1 -1
  49. package/lib/table/src/body.js +2 -1
  50. package/lib/table/src/body.min.js +1 -1
  51. package/lib/table/src/cell.js +2 -2
  52. package/lib/table/src/cell.min.js +1 -1
  53. package/lib/table/src/methods.js +33 -45
  54. package/lib/table/src/methods.min.js +1 -1
  55. package/lib/table/src/table.js +12 -248
  56. package/lib/table/src/table.min.js +1 -1
  57. package/lib/table/src/util.js +243 -0
  58. package/lib/table/src/util.min.js +1 -1
  59. package/lib/table/style/style.css +23 -50
  60. package/lib/table/style/style.min.css +1 -1
  61. package/lib/ui/index.js +2 -2
  62. package/lib/ui/index.min.js +1 -1
  63. package/lib/ui/src/dom.js +22 -0
  64. package/lib/ui/src/dom.min.js +1 -1
  65. package/lib/ui/src/log.js +1 -1
  66. package/lib/ui/src/log.min.js +1 -1
  67. package/lib/v-x-e-table/index.js +2 -1
  68. package/lib/v-x-e-table/index.min.js +1 -1
  69. package/lib/vxe-colgroup/index.js +2 -1
  70. package/lib/vxe-colgroup/index.min.js +1 -1
  71. package/lib/vxe-column/index.js +2 -1
  72. package/lib/vxe-column/index.min.js +1 -1
  73. package/lib/vxe-grid/index.js +2 -1
  74. package/lib/vxe-grid/index.min.js +1 -1
  75. package/lib/vxe-table/index.js +2 -1
  76. package/lib/vxe-table/index.min.js +1 -1
  77. package/lib/vxe-table/style/style.css +23 -50
  78. package/lib/vxe-table/style/style.min.css +1 -1
  79. package/lib/vxe-toolbar/index.js +2 -1
  80. package/lib/vxe-toolbar/index.min.js +1 -1
  81. package/lib/vxe-ui/index.js +2 -1
  82. package/lib/vxe-ui/index.min.js +1 -1
  83. package/lib/vxe-v-x-e-table/index.js +2 -1
  84. package/lib/vxe-v-x-e-table/index.min.js +1 -1
  85. package/package.json +1 -1
  86. package/packages/table/module/custom/mixin.ts +7 -4
  87. package/packages/table/module/custom/panel.ts +846 -839
  88. package/packages/table/module/edit/mixin.ts +55 -35
  89. package/packages/table/module/export/export-panel.ts +545 -469
  90. package/packages/table/module/export/import-panel.ts +245 -202
  91. package/packages/table/module/filter/panel.ts +4 -18
  92. package/packages/table/module/keyboard/mixin.ts +2 -2
  93. package/packages/table/module/menu/panel.ts +171 -163
  94. package/packages/table/module/validator/mixin.ts +279 -240
  95. package/packages/table/src/body.ts +2 -1
  96. package/packages/table/src/cell.ts +2 -2
  97. package/packages/table/src/methods.ts +43 -45
  98. package/packages/table/src/table.ts +14 -260
  99. package/packages/table/src/util.ts +254 -0
  100. package/packages/ui/index.ts +1 -1
  101. package/packages/ui/src/dom.ts +22 -0
  102. package/styles/components/table.scss +5 -2
  103. package/styles/theme/base.scss +2 -1
  104. /package/es/{iconfont.1767145426781.ttf → iconfont.1767492234857.ttf} +0 -0
  105. /package/es/{iconfont.1767145426781.woff → iconfont.1767492234857.woff} +0 -0
  106. /package/es/{iconfont.1767145426781.woff2 → iconfont.1767492234857.woff2} +0 -0
  107. /package/lib/{iconfont.1767145426781.ttf → iconfont.1767492234857.ttf} +0 -0
  108. /package/lib/{iconfont.1767145426781.woff → iconfont.1767492234857.woff} +0 -0
  109. /package/lib/{iconfont.1767145426781.woff2 → iconfont.1767492234857.woff2} +0 -0
@@ -142,6 +142,260 @@ export function createInternalData (): TableInternalData {
142
142
  }
143
143
  }
144
144
 
145
+ export function createReactData (): TableReactData {
146
+ return {
147
+ // 低性能的静态列
148
+ staticColumns: [],
149
+ // 渲染的列分组
150
+ tableGroupColumn: [],
151
+ // 可视区渲染的列
152
+ tableColumn: [],
153
+ // 渲染中的数据
154
+ tableData: [],
155
+ // 是否启用了横向 X 可视渲染方式加载
156
+ scrollXLoad: false,
157
+ // 是否启用了纵向 Y 可视渲染方式加载
158
+ scrollYLoad: false,
159
+ // 是否存在纵向滚动条
160
+ overflowY: true,
161
+ // 是否存在横向滚动条
162
+ overflowX: false,
163
+ // 纵向滚动条的宽度
164
+ scrollbarWidth: 0,
165
+ // 横向滚动条的高度
166
+ scrollbarHeight: 0,
167
+ // 最后滚动时间戳
168
+ lastScrollTime: 0,
169
+ // 行高
170
+ rowHeight: 0,
171
+ // 表格父容器的高度
172
+ parentHeight: 0,
173
+ // 是否使用分组表头
174
+ isGroup: false,
175
+ isAllOverflow: false,
176
+ // 复选框属性,是否全选
177
+ isAllSelected: false,
178
+ // 复选框属性,有选中且非全选状态
179
+ isIndeterminate: false,
180
+ // 当前行
181
+ currentRow: null,
182
+ // 单选框属性,选中列
183
+ currentColumn: null,
184
+ // 单选框属性,选中行
185
+ selectRadioRow: null,
186
+ // 表尾合计数据
187
+ footerTableData: [],
188
+ // 行分组列信息
189
+ rowGroupColumn: null,
190
+ // 展开列信息
191
+ expandColumn: null,
192
+ checkboxColumn: null,
193
+ radioColumn: null,
194
+ // 树节点列信息
195
+ treeNodeColumn: null,
196
+ hasFixedColumn: false,
197
+ // 刷新列标识,当列筛选被改变时,触发表格刷新数据
198
+ upDataFlag: 0,
199
+ // 刷新列标识,当列的特定属性被改变时,触发表格刷新列
200
+ reColumnFlag: 0,
201
+ // 初始化标识
202
+ initStore: {
203
+ filter: false,
204
+ import: false,
205
+ export: false,
206
+ custom: false
207
+ },
208
+ // 自定义列相关的信息
209
+ customStore: {
210
+ btnEl: null,
211
+ isAll: false,
212
+ isIndeterminate: false,
213
+ activeBtn: false,
214
+ activeWrapper: false,
215
+ visible: false,
216
+ maxHeight: 0,
217
+ oldSortMaps: {},
218
+ oldFixedMaps: {},
219
+ oldVisibleMaps: {}
220
+ },
221
+ customColumnList: [],
222
+ // 当前选中的筛选列
223
+ filterStore: {
224
+ isAllSelected: false,
225
+ isIndeterminate: false,
226
+ style: null,
227
+ column: null,
228
+ visible: false,
229
+ maxHeight: null
230
+ },
231
+ // 存放列相关的信息
232
+ columnStore: {
233
+ leftList: [],
234
+ centerList: [],
235
+ rightList: [],
236
+ resizeList: [],
237
+ pxList: [],
238
+ pxMinList: [],
239
+ autoMinList: [],
240
+ scaleList: [],
241
+ scaleMinList: [],
242
+ autoList: [],
243
+ remainList: []
244
+ },
245
+ // 存放快捷菜单的信息
246
+ ctxMenuStore: {
247
+ selected: null,
248
+ visible: false,
249
+ showChild: false,
250
+ selectChild: null,
251
+ list: [],
252
+ style: null
253
+ },
254
+ // 存放可编辑相关信息
255
+ editStore: {
256
+ indexs: {
257
+ columns: []
258
+ },
259
+ titles: {
260
+ columns: []
261
+ },
262
+ // 选中源
263
+ selected: {
264
+ row: null,
265
+ column: null
266
+ },
267
+ // 已复制源
268
+ copyed: {
269
+ cut: false,
270
+ rows: [],
271
+ columns: []
272
+ },
273
+ // 激活
274
+ actived: {
275
+ row: null,
276
+ column: null
277
+ },
278
+ // 当前被强制聚焦单元格,只会在鼠标点击后算聚焦
279
+ focused: {
280
+ row: null,
281
+ column: null
282
+ }
283
+ },
284
+ // 存放 tooltip 相关信息
285
+ tooltipStore: {
286
+ row: null,
287
+ column: null,
288
+ content: null,
289
+ visible: false,
290
+ type: null,
291
+ currOpts: {}
292
+ },
293
+ // 存放数据校验相关信息
294
+ validStore: {
295
+ visible: false
296
+ },
297
+ validErrorMaps: {},
298
+ // 导入相关信息
299
+ importStore: {
300
+ inited: false,
301
+ file: null,
302
+ type: '',
303
+ modeList: [],
304
+ typeList: [],
305
+ filename: '',
306
+ visible: false
307
+ },
308
+ importParams: {
309
+ mode: '',
310
+ types: null,
311
+ message: true
312
+ },
313
+ // 导出相关信息
314
+ exportStore: {
315
+ inited: false,
316
+ name: '',
317
+ modeList: [],
318
+ typeList: [],
319
+ columns: [],
320
+ isPrint: false,
321
+ hasFooter: false,
322
+ hasMerge: false,
323
+ hasTree: false,
324
+ hasColgroup: false,
325
+ visible: false
326
+ },
327
+ exportParams: {
328
+ filename: '',
329
+ sheetName: '',
330
+ mode: '',
331
+ type: '',
332
+ isColgroup: false,
333
+ isMerge: false,
334
+ isAllExpand: false,
335
+ useStyle: false,
336
+ original: false,
337
+ message: true,
338
+ isHeader: false,
339
+ isTitle: false,
340
+ isFooter: false
341
+ },
342
+
343
+ visiblwRowsFlag: 1,
344
+
345
+ isRowGroupStatus: false,
346
+ rowGroupList: [],
347
+ aggHandleFields: [],
348
+ aggHandleAggColumns: [],
349
+
350
+ rowGroupExpandedFlag: 1,
351
+ rowExpandedFlag: 1,
352
+ treeExpandedFlag: 1,
353
+ updateCheckboxFlag: 1,
354
+ pendingRowFlag: 1,
355
+ insertRowFlag: 1,
356
+ removeRowFlag: 1,
357
+
358
+ mergeHeadFlag: 1,
359
+ mergeBodyFlag: 1,
360
+ mergeFootFlag: 1,
361
+
362
+ rowHeightStore: {
363
+ large: 52,
364
+ default: 48,
365
+ medium: 44,
366
+ small: 40,
367
+ mini: 36
368
+ },
369
+
370
+ scrollVMLoading: false,
371
+ scrollYHeight: 0,
372
+ scrollYTop: 0,
373
+ isScrollYBig: false,
374
+ scrollXLeft: 0,
375
+ scrollXWidth: 0,
376
+ isScrollXBig: false,
377
+
378
+ lazScrollLoading: false,
379
+
380
+ rowExpandHeightFlag: 1,
381
+ calcCellHeightFlag: 1,
382
+ resizeHeightFlag: 1,
383
+ resizeWidthFlag: 1,
384
+
385
+ isCustomStatus: false,
386
+
387
+ isCrossDragRow: false,
388
+ dragRow: null,
389
+ isCrossDragCol: false,
390
+ dragCol: null,
391
+ dragTipText: '',
392
+
393
+ isDragResize: false,
394
+ isRowLoading: false,
395
+ isColLoading: false
396
+ }
397
+ }
398
+
145
399
  const getAllConvertColumns = (columns: any, parentColumn?: any) => {
146
400
  const result: any[] = []
147
401
  columns.forEach((column: any) => {
@@ -76,7 +76,7 @@ VxeUI.setConfig({
76
76
  enterable: true
77
77
  },
78
78
  validConfig: {
79
- showMessage: true,
79
+ showErrorMessage: true,
80
80
  autoClear: true,
81
81
  autoPos: true,
82
82
  message: 'inline',
@@ -212,3 +212,25 @@ export function triggerEvent (targetElem: Element, type: string) {
212
212
  export function isNodeElement (elem: any): elem is HTMLElement {
213
213
  return elem && elem.nodeType === 1
214
214
  }
215
+
216
+ export function scrollTopTo (diffNum: number, cb: (progress: number) => void) {
217
+ const duration = Math.abs(diffNum)
218
+ const startTime = performance.now()
219
+ let countTop = 0
220
+ const step = (timestamp: number) => {
221
+ let progress = (timestamp - startTime) / duration
222
+ if (progress < 0) {
223
+ progress = 0
224
+ } else if (progress > 1) {
225
+ progress = 1
226
+ }
227
+ const easedProgress = Math.pow(progress, 2)
228
+ const offsetTop = Math.floor((diffNum * easedProgress)) - countTop
229
+ countTop += offsetTop
230
+ cb(offsetTop)
231
+ if (progress < 1) {
232
+ requestAnimationFrame(step)
233
+ }
234
+ }
235
+ requestAnimationFrame(step)
236
+ }
@@ -2454,13 +2454,16 @@ $btnThemeList: (
2454
2454
  }
2455
2455
  .vxe-cell--valid-error-theme-normal {
2456
2456
  color: var(--vxe-ui-table-validate-error-color);
2457
- background-color: var(--vxe-ui-table-validate-error-background-color);
2457
+ background-color: var(--vxe-ui-table-validate-error-theme-normal-background-color);
2458
2458
  }
2459
2459
  &.col--active,
2460
2460
  &.col--selected {
2461
2461
  position: relative;
2462
2462
  }
2463
2463
  &.col--valid-error {
2464
+ &.show--valid-bg {
2465
+ background-color: var(--vxe-ui-table-validate-error-cell-background-color);
2466
+ }
2464
2467
  .vxe-default-input,
2465
2468
  .vxe-default-textarea,
2466
2469
  .vxe-default-select {
@@ -2651,7 +2654,7 @@ div.vxe-table--tooltip-wrapper {
2651
2654
  &.vxe-table--valid-error {
2652
2655
  padding: 0;
2653
2656
  color: var(--vxe-ui-table-validate-error-color);
2654
- background-color: var(--vxe-ui-table-validate-error-background-color);
2657
+ background-color: var(--vxe-ui-table-validate-error-theme-normal-background-color);
2655
2658
  &.old-cell-valid {
2656
2659
  padding: 8px 12px;
2657
2660
  background-color: #f56c6c;
@@ -80,7 +80,8 @@
80
80
  --vxe-ui-table-menu-background-color: #fff;
81
81
 
82
82
  --vxe-ui-table-validate-error-color: #f56c6c;
83
- --vxe-ui-table-validate-error-background-color: var(--vxe-ui-layout-background-color);
83
+ --vxe-ui-table-validate-error-cell-background-color: rgba(245, 108,108, 0.1);
84
+ --vxe-ui-table-validate-error-theme-normal-background-color: var(--vxe-ui-layout-background-color);
84
85
 
85
86
  /*toolbar*/
86
87
  --vxe-ui-toolbar-custom-active-background-color: #D9DADB;