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
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
+ var _comp = require("../../../ui/src/comp");
7
8
  var _ui = require("../../../ui");
8
9
  var _utils = require("../../../ui/src/utils");
9
10
  var _dom = require("../../../ui/src/dom");
@@ -69,679 +70,7 @@ function hideDropTip($xeTableCustomPanel) {
69
70
  dragLineEl.style.display = '';
70
71
  }
71
72
  }
72
- const renderDragTip = (h, $xeTableCustomPanel) => {
73
- const $xeTable = $xeTableCustomPanel.$xeTable;
74
- const customPanelReactData = $xeTableCustomPanel.reactData;
75
- const {
76
- dragTipText
77
- } = customPanelReactData;
78
- const columnDragOpts = $xeTable.computeColumnDragOpts;
79
- return h('div', {}, [h('div', {
80
- ref: 'refDragLineElem',
81
- class: ['vxe-table-custom-popup--drag-line', {
82
- 'is--guides': columnDragOpts.showGuidesStatus
83
- }]
84
- }), h('div', {
85
- ref: 'refDragTipElem',
86
- class: 'vxe-table-custom-popup--drag-tip'
87
- }, [h('div', {
88
- class: 'vxe-table-custom-popup--drag-tip-wrapper'
89
- }, [h('div', {
90
- class: 'vxe-table-custom-popup--drag-tip-status'
91
- }, [h('span', {
92
- class: ['vxe-table-custom-popup--drag-tip-normal-status', getIcon().TABLE_DRAG_STATUS_ROW]
93
- }), h('span', {
94
- class: ['vxe-table-custom-popup--drag-tip-sub-status', getIcon().TABLE_DRAG_STATUS_SUB_ROW]
95
- }), h('span', {
96
- class: ['vxe-table-custom-popup--drag-tip-group-status', getIcon().TABLE_DRAG_STATUS_AGG_GROUP]
97
- }), h('span', {
98
- class: ['vxe-table-custom-popup--drag-tip-values-status', getIcon().TABLE_DRAG_STATUS_AGG_VALUES]
99
- }), h('span', {
100
- class: ['vxe-table-custom-popup--drag-tip-disabled-status', getIcon().TABLE_DRAG_DISABLED]
101
- })]), h('div', {
102
- class: 'vxe-table-custom-popup--drag-tip-content'
103
- }, `${dragTipText || ''}`)])])]);
104
- };
105
- const renderSimplePanel = (h, _vm) => {
106
- const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
107
- const props = _vm;
108
- const $xeTable = _vm.$xeTable;
109
- const tableProps = $xeTable;
110
- const tableReactData = $xeTable;
111
- const $xeGrid = $xeTable.$xeGrid;
112
- const $xeGantt = $xeTable.$xeGantt;
113
- const {
114
- customStore
115
- } = props;
116
- const {
117
- treeConfig,
118
- rowGroupConfig,
119
- aggregateConfig
120
- } = tableProps;
121
- const {
122
- isCustomStatus,
123
- customColumnList
124
- } = tableReactData;
125
- const customOpts = $xeTable.computeCustomOpts;
126
- const {
127
- immediate
128
- } = customOpts;
129
- const columnDragOpts = $xeTable.computeColumnDragOpts;
130
- const {
131
- maxHeight
132
- } = customStore;
133
- const {
134
- checkMethod,
135
- visibleMethod,
136
- allowVisible,
137
- allowSort,
138
- allowFixed,
139
- trigger,
140
- placement
141
- } = customOpts;
142
- const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
143
- const {
144
- isCrossDrag
145
- } = columnDragOpts;
146
- const slots = customOpts.slots || {};
147
- const headerSlot = slots.header;
148
- const topSlot = slots.top;
149
- const bottomSlot = slots.bottom;
150
- const defaultSlot = slots.default;
151
- const footerSlot = slots.footer;
152
- const colVNs = [];
153
- const customWrapperOns = {};
154
- const isAllChecked = customStore.isAll;
155
- const isAllIndeterminate = customStore.isIndeterminate;
156
- // hover 触发
157
- if (trigger === 'hover') {
158
- customWrapperOns.mouseenter = _vm.handleWrapperMouseenterEvent;
159
- customWrapperOns.mouseleave = _vm.handleWrapperMouseleaveEvent;
160
- }
161
- const params = {
162
- $table: $xeTable,
163
- $grid: $xeGrid,
164
- $gantt: $xeGantt,
165
- columns: customColumnList,
166
- isAllChecked,
167
- isAllIndeterminate,
168
- isCustomStatus
169
- };
170
- _xeUtils.default.eachTree(customColumnList, (column, index, items, path, parent) => {
171
- const isVisible = visibleMethod ? visibleMethod({
172
- $table: $xeTable,
173
- column
174
- }) : true;
175
- if (isVisible) {
176
- const isChecked = column.renderVisible;
177
- const isIndeterminate = column.halfVisible;
178
- const isColGroup = column.children && column.children.length;
179
- const colTitle = (0, _utils.formatText)(column.getTitle(), 1);
180
- const isDisabled = checkMethod ? !checkMethod({
181
- $table: $xeTable,
182
- column
183
- }) : false;
184
- const isHidden = !isChecked;
185
- colVNs.push(h('li', {
186
- key: column.id,
187
- attrs: {
188
- colid: column.id
189
- },
190
- class: ['vxe-table-custom--option', `level--${column.level}`, {
191
- 'is--hidden': isDisabled || isHidden,
192
- 'is--group': isColGroup
193
- }],
194
- on: {
195
- dragstart: _vm.sortDragstartEvent,
196
- dragend: _vm.sortDragendEvent,
197
- dragover: _vm.sortDragoverEvent
198
- }
199
- }, [allowVisible ? h('div', {
200
- class: ['vxe-table-custom--checkbox-option', {
201
- 'is--checked': isChecked,
202
- 'is--indeterminate': isIndeterminate,
203
- 'is--disabled': isDisabled
204
- }],
205
- attrs: {
206
- title: getI18n('vxe.custom.setting.colVisible')
207
- },
208
- on: {
209
- click: evnt => {
210
- if (!isDisabled) {
211
- _vm.changeCheckboxOption(column, evnt);
212
- }
213
- }
214
- }
215
- }, [h('span', {
216
- class: ['vxe-checkbox--icon', isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
217
- })]) : renderEmptyElement($xeTable), h('div', {
218
- class: 'vxe-table-custom--name-option'
219
- }, [allowSort && ((isCrossDrag ? immediate : false) || column.level === 1) ? h('div', {
220
- class: 'vxe-table-custom--sort-option'
221
- }, [h('span', {
222
- class: ['vxe-table-custom--sort-btn', {
223
- 'is--disabled': isHidden
224
- }],
225
- attrs: {
226
- title: getI18n('vxe.custom.setting.sortHelpTip')
227
- },
228
- on: isHidden ? {} : {
229
- mousedown: _vm.sortMousedownEvent,
230
- mouseup: _vm.sortMouseupEvent
231
- }
232
- }, [h('i', {
233
- class: getIcon().TABLE_CUSTOM_SORT
234
- })])]) : renderEmptyElement($xeTable), column.type === 'html' ? h('div', {
235
- key: '1',
236
- class: 'vxe-table-custom--checkbox-label',
237
- domProps: {
238
- innerHTML: colTitle
239
- }
240
- }) : h('div', {
241
- key: '0',
242
- class: 'vxe-table-custom--checkbox-label',
243
- attrs: {
244
- title: colTitle
245
- }
246
- }, colTitle)]), !parent && allowFixed ? h('div', {
247
- class: 'vxe-table-custom--fixed-option'
248
- }, [h(VxeUIButtonComponent, {
249
- props: {
250
- mode: 'text',
251
- icon: column.renderFixed === 'left' ? getIcon().TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE : getIcon().TOOLBAR_TOOLS_FIXED_LEFT,
252
- status: column.renderFixed === 'left' ? 'primary' : '',
253
- disabled: isHidden || isMaxFixedColumn && !column.renderFixed,
254
- title: getI18n(column.renderFixed === 'left' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedLeft')
255
- },
256
- on: {
257
- click: ({
258
- $event
259
- }) => {
260
- _vm.changeFixedOption(column, 'left', $event);
261
- }
262
- }
263
- }), h(VxeUIButtonComponent, {
264
- props: {
265
- mode: 'text',
266
- icon: column.renderFixed === 'right' ? getIcon().TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE : getIcon().TOOLBAR_TOOLS_FIXED_RIGHT,
267
- status: column.renderFixed === 'right' ? 'primary' : '',
268
- disabled: isHidden || isMaxFixedColumn && !column.renderFixed,
269
- title: getI18n(column.renderFixed === 'right' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedRight')
270
- },
271
- on: {
272
- click: ({
273
- $event
274
- }) => {
275
- _vm.changeFixedOption(column, 'right', $event);
276
- }
277
- }
278
- })]) : renderEmptyElement($xeTable)]));
279
- }
280
- });
281
- return h('div', {
282
- ref: 'refElem',
283
- key: 'simple',
284
- class: ['vxe-table-custom-wrapper', `placement--${placement}`, {
285
- 'is--active': customStore.visible
286
- }],
287
- style: maxHeight && !['left', 'right'].includes(placement || '') ? {
288
- maxHeight: `${maxHeight}px`
289
- } : {}
290
- }, customStore.visible ? [h('div', {
291
- ref: 'refBodyWrapperElem',
292
- class: 'vxe-table-custom-simple--body-wrapper'
293
- }, [!treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregateSimplePanel ? h($xeTable.getPivotTableAggregateSimplePanel(), {
294
- props: {
295
- customStore
296
- }
297
- }) : renderEmptyElement($xeTable), h('div', {
298
- ref: 'refCustomBodyElem',
299
- class: 'vxe-table-custom--handle-wrapper'
300
- }, [h('div', {
301
- class: 'vxe-table-custom--header'
302
- }, headerSlot ? $xeTable.callSlot(headerSlot, params, h) : [h('ul', {
303
- class: 'vxe-table-custom--panel-list'
304
- }, [h('li', {
305
- class: 'vxe-table-custom--option'
306
- }, [allowVisible ? h('div', {
307
- class: ['vxe-table-custom--checkbox-option', {
308
- 'is--checked': isAllChecked,
309
- 'is--indeterminate': isAllIndeterminate
310
- }],
311
- attrs: {
312
- title: getI18n('vxe.table.allTitle')
313
- },
314
- on: {
315
- click: _vm.allOptionEvent
316
- }
317
- }, [h('span', {
318
- class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
319
- }), h('span', {
320
- class: 'vxe-checkbox--label'
321
- }, getI18n('vxe.toolbar.customAll'))]) : h('span', {
322
- class: 'vxe-checkbox--label'
323
- }, getI18n('vxe.table.customTitle'))])])]), h('div', {
324
- class: 'vxe-table-custom--body'
325
- }, [topSlot ? h('div', {
326
- class: 'vxe-table-custom--panel-top'
327
- }, $xeTable.callSlot(topSlot, params, h)) : renderEmptyElement($xeTable), defaultSlot ? h('div', {
328
- class: 'vxe-table-custom--panel-body'
329
- }, $xeTable.callSlot(defaultSlot, params, h)) : h('transition-group', {
330
- class: 'vxe-table-custom--panel-list',
331
- props: {
332
- name: 'vxe-table-custom--list',
333
- tag: 'ul'
334
- },
335
- on: customWrapperOns
336
- }, colVNs), bottomSlot ? h('div', {
337
- class: 'vxe-table-custom--panel-bottom'
338
- }, $xeTable.callSlot(bottomSlot, params, h)) : renderEmptyElement($xeTable)]), customOpts.showFooter ? h('div', {
339
- class: 'vxe-table-custom--footer'
340
- }, footerSlot ? $xeTable.callSlot(footerSlot, params, h) : [h('div', {
341
- class: 'vxe-table-custom--footer-buttons'
342
- }, [h(VxeUIButtonComponent, {
343
- props: {
344
- mode: 'text',
345
- content: customOpts.resetButtonText || getI18n('vxe.table.customRestore'),
346
- disabled: !isCustomStatus
347
- },
348
- on: {
349
- click: _vm.resetCustomEvent
350
- }
351
- }), immediate ? h(VxeUIButtonComponent, {
352
- props: {
353
- mode: 'text',
354
- content: customOpts.closeButtonText || getI18n('vxe.table.customClose')
355
- },
356
- on: {
357
- click: _vm.cancelCloseEvent
358
- }
359
- }) : h(VxeUIButtonComponent, {
360
- props: {
361
- mode: 'text',
362
- content: customOpts.resetButtonText || getI18n('vxe.table.customCancel')
363
- },
364
- on: {
365
- click: _vm.cancelCustomEvent
366
- }
367
- }), immediate ? renderEmptyElement($xeTable) : h(VxeUIButtonComponent, {
368
- props: {
369
- mode: 'text',
370
- status: 'primary',
371
- content: customOpts.confirmButtonText || getI18n('vxe.table.customConfirm')
372
- },
373
- on: {
374
- click: _vm.confirmCustomEvent
375
- }
376
- })])]) : null]), renderDragTip(h, _vm)])] : []);
377
- };
378
- const renderPopupPanel = (h, $xeTableCustomPanel) => {
379
- const VxeUIModalComponent = _ui.VxeUI.getComponent('VxeModal');
380
- const VxeUIDrawerComponent = _ui.VxeUI.getComponent('VxeDrawer');
381
- const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
382
- const VxeUINumberInputComponent = _ui.VxeUI.getComponent('VxeNumberInput');
383
- const _vm = $xeTableCustomPanel;
384
- const props = $xeTableCustomPanel;
385
- const $xeTable = $xeTableCustomPanel.$xeTable;
386
- const tableProps = $xeTable;
387
- const tableReactData = $xeTable;
388
- const $xeGrid = $xeTable.$xeGrid;
389
- const $xeGantt = $xeTable.$xeGantt;
390
- const {
391
- customStore
392
- } = props;
393
- const {
394
- treeConfig,
395
- rowGroupConfig,
396
- aggregateConfig,
397
- resizable: allResizable
398
- } = tableProps;
399
- const {
400
- isCustomStatus,
401
- customColumnList
402
- } = tableReactData;
403
- const customOpts = $xeTable.computeCustomOpts;
404
- const {
405
- immediate
406
- } = customOpts;
407
- const columnDragOpts = $xeTable.computeColumnDragOpts;
408
- const {
409
- mode,
410
- modalOptions,
411
- drawerOptions,
412
- allowVisible,
413
- allowSort,
414
- allowFixed,
415
- allowResizable,
416
- checkMethod,
417
- visibleMethod
418
- } = customOpts;
419
- const columnOpts = $xeTable.computeColumnOpts;
420
- const {
421
- maxFixedSize
422
- } = columnOpts;
423
- const resizableOpts = $xeTable.computeResizableOpts;
424
- const {
425
- minWidth: reMinWidth,
426
- maxWidth: reMaxWidth
427
- } = resizableOpts;
428
- const modalOpts = Object.assign({}, modalOptions);
429
- const drawerOpts = Object.assign({}, drawerOptions);
430
- const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
431
- const {
432
- isCrossDrag
433
- } = columnDragOpts;
434
- const slots = customOpts.slots || {};
435
- const headerSlot = slots.header;
436
- const topSlot = slots.top;
437
- const bottomSlot = slots.bottom;
438
- const defaultSlot = slots.default;
439
- const footerSlot = slots.footer;
440
- const trVNs = [];
441
- const isAllChecked = customStore.isAll;
442
- const isAllIndeterminate = customStore.isIndeterminate;
443
- const params = {
444
- $table: $xeTable,
445
- $grid: $xeGrid,
446
- $gantt: $xeGantt,
447
- columns: customColumnList,
448
- isAllChecked,
449
- isAllIndeterminate,
450
- isCustomStatus
451
- };
452
- _xeUtils.default.eachTree(customColumnList, (column, index, items, path, parent) => {
453
- const isVisible = visibleMethod ? visibleMethod({
454
- $table: $xeTable,
455
- column
456
- }) : true;
457
- if (isVisible) {
458
- // 默认继承调整宽度
459
- let customMinWidth = 0;
460
- let customMaxWidth = 0;
461
- if (allowResizable) {
462
- const resizeParams = {
463
- $table: $xeTable,
464
- column,
465
- columnIndex: index,
466
- $columnIndex: index,
467
- $rowIndex: -1
468
- };
469
- if (reMinWidth) {
470
- customMinWidth = _xeUtils.default.toNumber(_xeUtils.default.isFunction(reMinWidth) ? reMinWidth(resizeParams) : reMinWidth);
471
- }
472
- if (reMaxWidth) {
473
- customMaxWidth = _xeUtils.default.toNumber(_xeUtils.default.isFunction(reMaxWidth) ? reMaxWidth(resizeParams) : reMaxWidth);
474
- }
475
- }
476
- const isChecked = column.renderVisible;
477
- const isIndeterminate = column.halfVisible;
478
- const colTitle = (0, _utils.formatText)(column.getTitle(), 1);
479
- const isColGroup = column.children && column.children.length;
480
- const isDisabled = checkMethod ? !checkMethod({
481
- $table: $xeTable,
482
- column
483
- }) : false;
484
- const isHidden = !isChecked;
485
- trVNs.push(h('tr', {
486
- key: column.id,
487
- attrs: {
488
- colid: column.id
489
- },
490
- class: [`vxe-table-custom-popup--row level--${column.level}`, {
491
- 'is--group': isColGroup
492
- }],
493
- on: {
494
- dragstart: _vm.sortDragstartEvent,
495
- dragend: _vm.sortDragendEvent,
496
- dragover: _vm.sortDragoverEvent
497
- }
498
- }, [allowVisible ? h('td', {
499
- class: 'vxe-table-custom-popup--column-item col--visible'
500
- }, [h('div', {
501
- class: ['vxe-table-custom--checkbox-option', {
502
- 'is--checked': isChecked,
503
- 'is--indeterminate': isIndeterminate,
504
- 'is--disabled': isDisabled
505
- }],
506
- attrs: {
507
- title: getI18n('vxe.custom.setting.colVisible')
508
- },
509
- on: {
510
- click: evnt => {
511
- if (!isDisabled) {
512
- _vm.changeCheckboxOption(column, evnt);
513
- }
514
- }
515
- }
516
- }, [h('span', {
517
- class: ['vxe-checkbox--icon', isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
518
- })])]) : renderEmptyElement($xeTable), h('td', {
519
- class: 'vxe-table-custom-popup--column-item col--name'
520
- }, [h('div', {
521
- class: 'vxe-table-custom-popup--name'
522
- }, [allowSort ? (isCrossDrag ? immediate : false) || column.level === 1 ? h('div', {
523
- class: ['vxe-table-custom-popup--column-sort-btn', {
524
- 'is--disabled': isHidden
525
- }],
526
- attrs: {
527
- title: getI18n('vxe.custom.setting.sortHelpTip')
528
- },
529
- on: isHidden ? {} : {
530
- mousedown: _vm.sortMousedownEvent,
531
- mouseup: _vm.sortMouseupEvent
532
- }
533
- }, [h('i', {
534
- class: getIcon().TABLE_CUSTOM_SORT
535
- })]) : h('div', {
536
- class: 'vxe-table-custom-popup--column-sort-placeholder'
537
- }) : renderEmptyElement($xeTable), column.type === 'html' ? h('div', {
538
- key: '1',
539
- class: 'vxe-table-custom-popup--title',
540
- domProps: {
541
- innerHTML: colTitle
542
- }
543
- }) : h('div', {
544
- key: '0',
545
- class: 'vxe-table-custom-popup--title',
546
- attrs: {
547
- title: colTitle
548
- }
549
- }, colTitle)])]), allowResizable ? h('td', {
550
- class: 'vxe-table-custom-popup--column-item col--resizable'
551
- }, [column.children && column.children.length || !(_xeUtils.default.isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable) ? h('span', '-') : VxeUINumberInputComponent ? h(VxeUINumberInputComponent, {
552
- props: {
553
- type: 'integer',
554
- immediate: false,
555
- disabled: isHidden,
556
- value: column.renderResizeWidth,
557
- min: customMinWidth || undefined,
558
- max: customMaxWidth || undefined
559
- },
560
- on: {
561
- modelValue(value) {
562
- column.renderResizeWidth = Math.max(0, Number(value));
563
- },
564
- change() {
565
- _vm.changeColumnWidth(column);
566
- }
567
- }
568
- }) : renderEmptyElement($xeTableCustomPanel)]) : renderEmptyElement($xeTable), allowFixed ? h('td', {
569
- class: 'vxe-table-custom-popup--column-item col--fixed'
570
- }, [parent ? h('span', '-') : h('vxe-radio-group', {
571
- props: {
572
- value: column.renderFixed || '',
573
- type: 'button',
574
- size: 'mini',
575
- disabled: isHidden,
576
- options: [{
577
- label: getI18n('vxe.custom.setting.fixedLeft'),
578
- value: 'left',
579
- disabled: isHidden || isMaxFixedColumn
580
- }, {
581
- label: getI18n('vxe.custom.setting.fixedUnset'),
582
- value: '',
583
- disabled: isHidden
584
- }, {
585
- label: getI18n('vxe.custom.setting.fixedRight'),
586
- value: 'right',
587
- disabled: isHidden || isMaxFixedColumn
588
- }]
589
- },
590
- on: {
591
- change({
592
- label,
593
- $event
594
- }) {
595
- _vm.changeFixedOption(column, label, $event);
596
- }
597
- }
598
- })]) : renderEmptyElement($xeTable)]));
599
- }
600
- });
601
- const scopedSlots = {
602
- default: () => {
603
- return h('div', {
604
- ref: 'refBodyWrapperElem',
605
- class: 'vxe-table-custom-popup--body-wrapper'
606
- }, defaultSlot ? $xeTable.callSlot(defaultSlot, params, h) : [h('div', {
607
- ref: 'refCustomBodyElem',
608
- class: 'vxe-table-custom-popup--handle-wrapper'
609
- }, [topSlot ? h('div', {
610
- class: 'vxe-table-custom-popup--table-top'
611
- }, $xeTable.callSlot(topSlot, params, h)) : renderEmptyElement($xeTable), h('div', {
612
- class: 'vxe-table-custom-popup--table-wrapper'
613
- }, [h('table', {}, [h('colgroup', {}, [allowVisible ? h('col', {
614
- class: 'vxe-table-custom-popup--table-col-seq'
615
- }) : renderEmptyElement($xeTable), h('col', {
616
- class: 'vxe-table-custom-popup--table-col-title'
617
- }), allowResizable ? h('col', {
618
- class: 'vxe-table-custom-popup--table-col-width'
619
- }) : renderEmptyElement($xeTable), allowFixed ? h('col', {
620
- class: 'vxe-table-custom-popup--table-col-fixed'
621
- }) : renderEmptyElement($xeTable)]), h('thead', {}, [h('tr', {}, [allowVisible ? h('th', {}, [h('div', {
622
- class: ['vxe-table-custom--checkbox-option', {
623
- 'is--checked': isAllChecked,
624
- 'is--indeterminate': isAllIndeterminate
625
- }],
626
- attrs: {
627
- title: getI18n('vxe.table.allTitle')
628
- },
629
- on: {
630
- click: _vm.allOptionEvent
631
- }
632
- }, [h('span', {
633
- class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
634
- }), h('span', {
635
- class: 'vxe-checkbox--label'
636
- }, getI18n('vxe.toolbar.customAll'))])]) : renderEmptyElement($xeTable), h('th', {}, getI18n('vxe.custom.setting.colTitle')), allowResizable ? h('th', {}, getI18n('vxe.custom.setting.colResizable')) : renderEmptyElement($xeTable), allowFixed ? h('th', {}, getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize])) : renderEmptyElement($xeTable)])]), h('transition-group', {
637
- class: 'vxe-table-custom--panel-list',
638
- props: {
639
- tag: 'tbody',
640
- name: 'vxe-table-custom--list'
641
- }
642
- }, trVNs)])]), bottomSlot ? h('div', {
643
- class: 'vxe-table-custom-popup--table-bottom'
644
- }, $xeTable.callSlot(bottomSlot, params, h)) : renderEmptyElement($xeTable), renderDragTip(h, _vm)]), !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregatePopupPanel ? h($xeTable.getPivotTableAggregatePopupPanel(), {
645
- props: {
646
- customStore
647
- }
648
- }) : renderEmptyElement($xeTable)]);
649
- },
650
- footer: () => {
651
- if (footerSlot) {
652
- return $xeTable.callSlot(footerSlot, params, h);
653
- }
654
- return h('div', {
655
- class: 'vxe-table-custom-popup--footer'
656
- }, [h(VxeUIButtonComponent, {
657
- props: {
658
- content: customOpts.resetButtonText || getI18n('vxe.custom.cstmRestore'),
659
- disabled: !isCustomStatus
660
- },
661
- on: {
662
- click: _vm.resetCustomEvent
663
- }
664
- }), immediate ? h(VxeUIButtonComponent, {
665
- props: {
666
- content: customOpts.resetButtonText || getI18n('vxe.table.customClose')
667
- },
668
- on: {
669
- click: _vm.cancelCloseEvent
670
- }
671
- }) : h(VxeUIButtonComponent, {
672
- props: {
673
- content: customOpts.resetButtonText || getI18n('vxe.custom.cstmCancel')
674
- },
675
- on: {
676
- click: _vm.cancelCustomEvent
677
- }
678
- }), immediate ? renderEmptyElement($xeTable) : h(VxeUIButtonComponent, {
679
- props: {
680
- status: 'primary',
681
- content: customOpts.confirmButtonText || getI18n('vxe.custom.cstmConfirm')
682
- },
683
- on: {
684
- click: _vm.confirmCustomEvent
685
- }
686
- })]);
687
- }
688
- };
689
- if (headerSlot) {
690
- scopedSlots.header = () => $xeTable.callSlot(headerSlot, params, h);
691
- }
692
- if (mode === 'drawer') {
693
- return VxeUIDrawerComponent ? h(VxeUIDrawerComponent, {
694
- key: 'drawer',
695
- props: {
696
- className: ['vxe-table-custom-drawer-wrapper', 'vxe-table--ignore-clear', drawerOpts.className || ''].join(' '),
697
- value: customStore.visible,
698
- title: drawerOpts.title || getI18n('vxe.custom.cstmTitle'),
699
- width: drawerOpts.width || Math.min(880, Math.floor(document.documentElement.clientWidth * 0.6)),
700
- position: drawerOpts.position,
701
- resize: !!drawerOpts.resize,
702
- escClosable: !!drawerOpts.escClosable,
703
- maskClosable: !!drawerOpts.maskClosable,
704
- destroyOnClose: true,
705
- showFooter: true
706
- },
707
- on: {
708
- input(value) {
709
- customStore.visible = value;
710
- }
711
- },
712
- scopedSlots
713
- }) : renderEmptyElement($xeTableCustomPanel);
714
- }
715
- return VxeUIModalComponent ? h(VxeUIModalComponent, {
716
- key: 'modal',
717
- props: {
718
- className: ['vxe-table-custom-popup-wrapper', 'vxe-table--ignore-clear', modalOpts.className || ''].join(' '),
719
- value: customStore.visible,
720
- title: modalOpts.title || getI18n('vxe.custom.cstmTitle'),
721
- width: modalOpts.width || Math.min(880, document.documentElement.clientWidth),
722
- minWidth: modalOpts.minWidth || 700,
723
- height: modalOpts.height || Math.min(680, document.documentElement.clientHeight),
724
- minHeight: modalOpts.minHeight || 400,
725
- showZoom: modalOpts.showZoom,
726
- showMaximize: modalOpts.showMaximize,
727
- showMinimize: modalOpts.showMinimize,
728
- mask: modalOpts.mask,
729
- lockView: modalOpts.lockView,
730
- resize: modalOpts.resize,
731
- escClosable: !!modalOpts.escClosable,
732
- maskClosable: !!modalOpts.maskClosable,
733
- destroyOnClose: true,
734
- showFooter: true
735
- },
736
- on: {
737
- input(value) {
738
- customStore.visible = value;
739
- }
740
- },
741
- scopedSlots
742
- }) : renderEmptyElement($xeTableCustomPanel);
743
- };
744
- var _default = exports.default = {
73
+ var _default = exports.default = /* define-vxe-component start */(0, _comp.defineVxeComponent)({
745
74
  name: 'VxeTableCustomPanel',
746
75
  props: {
747
76
  customStore: {
@@ -779,7 +108,7 @@ var _default = exports.default = {
779
108
  internalData
780
109
  };
781
110
  },
782
- computed: {},
111
+ computed: Object.assign({}, {}),
783
112
  created() {
784
113
  const $xeTableCustomPanel = this;
785
114
  const VxeUIModalComponent = _ui.VxeUI.getComponent('VxeModal');
@@ -812,22 +141,14 @@ var _default = exports.default = {
812
141
  }
813
142
  });
814
143
  },
815
- render(h) {
816
- const $xeTableCustomPanel = this;
817
- const $xeTable = $xeTableCustomPanel.$xeTable;
818
- const customOpts = $xeTable.computeCustomOpts;
819
- if (['modal', 'drawer', 'popup'].includes(`${customOpts.mode}`)) {
820
- return renderPopupPanel(h, $xeTableCustomPanel);
821
- }
822
- return renderSimplePanel(h, $xeTableCustomPanel);
823
- },
824
144
  methods: {
825
145
  handleWrapperMouseenterEvent(evnt) {
826
146
  const $xeTableCustomPanel = this;
147
+ const props = $xeTableCustomPanel;
827
148
  const $xeTable = $xeTableCustomPanel.$xeTable;
828
149
  const {
829
150
  customStore
830
- } = this;
151
+ } = props;
831
152
  customStore.activeWrapper = true;
832
153
  $xeTable.customOpenEvent(evnt);
833
154
  },
@@ -1334,6 +655,693 @@ var _default = exports.default = {
1334
655
  customPanelInternalData.prevDragPos = dragPos;
1335
656
  showDropTip($xeTableCustomPanel, evnt, optEl, true, dragPos);
1336
657
  }
658
+ },
659
+ renderDragTip(h) {
660
+ const $xeTableCustomPanel = this;
661
+ const $xeTable = $xeTableCustomPanel.$xeTable;
662
+ const customPanelReactData = $xeTableCustomPanel.reactData;
663
+ const {
664
+ dragTipText
665
+ } = customPanelReactData;
666
+ const columnDragOpts = $xeTable.computeColumnDragOpts;
667
+ return h('div', {}, [h('div', {
668
+ ref: 'refDragLineElem',
669
+ class: ['vxe-table-custom-popup--drag-line', {
670
+ 'is--guides': columnDragOpts.showGuidesStatus
671
+ }]
672
+ }), h('div', {
673
+ ref: 'refDragTipElem',
674
+ class: 'vxe-table-custom-popup--drag-tip'
675
+ }, [h('div', {
676
+ class: 'vxe-table-custom-popup--drag-tip-wrapper'
677
+ }, [h('div', {
678
+ class: 'vxe-table-custom-popup--drag-tip-status'
679
+ }, [h('span', {
680
+ class: ['vxe-table-custom-popup--drag-tip-normal-status', getIcon().TABLE_DRAG_STATUS_ROW]
681
+ }), h('span', {
682
+ class: ['vxe-table-custom-popup--drag-tip-sub-status', getIcon().TABLE_DRAG_STATUS_SUB_ROW]
683
+ }), h('span', {
684
+ class: ['vxe-table-custom-popup--drag-tip-group-status', getIcon().TABLE_DRAG_STATUS_AGG_GROUP]
685
+ }), h('span', {
686
+ class: ['vxe-table-custom-popup--drag-tip-values-status', getIcon().TABLE_DRAG_STATUS_AGG_VALUES]
687
+ }), h('span', {
688
+ class: ['vxe-table-custom-popup--drag-tip-disabled-status', getIcon().TABLE_DRAG_DISABLED]
689
+ })]), h('div', {
690
+ class: 'vxe-table-custom-popup--drag-tip-content'
691
+ }, `${dragTipText || ''}`)])])]);
692
+ },
693
+ renderSimplePanel(h) {
694
+ const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
695
+ const $xeTableCustomPanel = this;
696
+ const props = $xeTableCustomPanel;
697
+ const $xeTable = $xeTableCustomPanel.$xeTable;
698
+ const tableProps = $xeTable;
699
+ const tableReactData = $xeTable;
700
+ const $xeGrid = $xeTable.$xeGrid;
701
+ const $xeGantt = $xeTable.$xeGantt;
702
+ const {
703
+ customStore
704
+ } = props;
705
+ const {
706
+ treeConfig,
707
+ rowGroupConfig,
708
+ aggregateConfig
709
+ } = tableProps;
710
+ const {
711
+ isCustomStatus,
712
+ customColumnList
713
+ } = tableReactData;
714
+ const customOpts = $xeTable.computeCustomOpts;
715
+ const {
716
+ immediate
717
+ } = customOpts;
718
+ const columnDragOpts = $xeTable.computeColumnDragOpts;
719
+ const {
720
+ maxHeight
721
+ } = customStore;
722
+ const {
723
+ checkMethod,
724
+ visibleMethod,
725
+ allowVisible,
726
+ allowSort,
727
+ allowFixed,
728
+ trigger,
729
+ placement
730
+ } = customOpts;
731
+ const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
732
+ const {
733
+ isCrossDrag
734
+ } = columnDragOpts;
735
+ const slots = customOpts.slots || {};
736
+ const headerSlot = slots.header;
737
+ const topSlot = slots.top;
738
+ const bottomSlot = slots.bottom;
739
+ const defaultSlot = slots.default;
740
+ const footerSlot = slots.footer;
741
+ const colVNs = [];
742
+ const customWrapperOns = {};
743
+ const isAllChecked = customStore.isAll;
744
+ const isAllIndeterminate = customStore.isIndeterminate;
745
+ // hover 触发
746
+ if (trigger === 'hover') {
747
+ customWrapperOns.mouseenter = $xeTableCustomPanel.handleWrapperMouseenterEvent;
748
+ customWrapperOns.mouseleave = $xeTableCustomPanel.handleWrapperMouseleaveEvent;
749
+ }
750
+ const params = {
751
+ $table: $xeTable,
752
+ $grid: $xeGrid,
753
+ $gantt: $xeGantt,
754
+ columns: customColumnList,
755
+ isAllChecked,
756
+ isAllIndeterminate,
757
+ isCustomStatus
758
+ };
759
+ _xeUtils.default.eachTree(customColumnList, (column, index, items, path, parent) => {
760
+ const isVisible = visibleMethod ? visibleMethod({
761
+ $table: $xeTable,
762
+ column
763
+ }) : true;
764
+ if (isVisible) {
765
+ const isChecked = column.renderVisible;
766
+ const isIndeterminate = column.halfVisible;
767
+ const isColGroup = column.children && column.children.length;
768
+ const colTitle = (0, _utils.formatText)(column.getTitle(), 1);
769
+ const isDisabled = checkMethod ? !checkMethod({
770
+ $table: $xeTable,
771
+ column
772
+ }) : false;
773
+ const isHidden = !isChecked;
774
+ colVNs.push(h('li', {
775
+ key: column.id,
776
+ attrs: {
777
+ colid: column.id
778
+ },
779
+ class: ['vxe-table-custom--option', `level--${column.level}`, {
780
+ 'is--hidden': isDisabled || isHidden,
781
+ 'is--group': isColGroup
782
+ }],
783
+ on: {
784
+ dragstart: $xeTableCustomPanel.sortDragstartEvent,
785
+ dragend: $xeTableCustomPanel.sortDragendEvent,
786
+ dragover: $xeTableCustomPanel.sortDragoverEvent
787
+ }
788
+ }, [allowVisible ? h('div', {
789
+ class: ['vxe-table-custom--checkbox-option', {
790
+ 'is--checked': isChecked,
791
+ 'is--indeterminate': isIndeterminate,
792
+ 'is--disabled': isDisabled
793
+ }],
794
+ attrs: {
795
+ title: getI18n('vxe.custom.setting.colVisible')
796
+ },
797
+ on: {
798
+ click: evnt => {
799
+ if (!isDisabled) {
800
+ $xeTableCustomPanel.changeCheckboxOption(column, evnt);
801
+ }
802
+ }
803
+ }
804
+ }, [h('span', {
805
+ class: ['vxe-checkbox--icon', isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
806
+ })]) : renderEmptyElement($xeTable), h('div', {
807
+ class: 'vxe-table-custom--name-option'
808
+ }, [allowSort && ((isCrossDrag ? immediate : false) || column.level === 1) ? h('div', {
809
+ class: 'vxe-table-custom--sort-option'
810
+ }, [h('span', {
811
+ class: ['vxe-table-custom--sort-btn', {
812
+ 'is--disabled': isHidden
813
+ }],
814
+ attrs: {
815
+ title: getI18n('vxe.custom.setting.sortHelpTip')
816
+ },
817
+ on: isHidden ? {} : {
818
+ mousedown: $xeTableCustomPanel.sortMousedownEvent,
819
+ mouseup: $xeTableCustomPanel.sortMouseupEvent
820
+ }
821
+ }, [h('i', {
822
+ class: getIcon().TABLE_CUSTOM_SORT
823
+ })])]) : renderEmptyElement($xeTable), column.type === 'html' ? h('div', {
824
+ key: '1',
825
+ class: 'vxe-table-custom--checkbox-label',
826
+ domProps: {
827
+ innerHTML: colTitle
828
+ }
829
+ }) : h('div', {
830
+ key: '0',
831
+ class: 'vxe-table-custom--checkbox-label',
832
+ attrs: {
833
+ title: colTitle
834
+ }
835
+ }, colTitle)]), !parent && allowFixed ? h('div', {
836
+ class: 'vxe-table-custom--fixed-option'
837
+ }, [h(VxeUIButtonComponent, {
838
+ props: {
839
+ mode: 'text',
840
+ icon: column.renderFixed === 'left' ? getIcon().TOOLBAR_TOOLS_FIXED_LEFT_ACTIVE : getIcon().TOOLBAR_TOOLS_FIXED_LEFT,
841
+ status: column.renderFixed === 'left' ? 'primary' : '',
842
+ disabled: isHidden || isMaxFixedColumn && !column.renderFixed,
843
+ title: getI18n(column.renderFixed === 'left' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedLeft')
844
+ },
845
+ on: {
846
+ click: ({
847
+ $event
848
+ }) => {
849
+ $xeTableCustomPanel.changeFixedOption(column, 'left', $event);
850
+ }
851
+ }
852
+ }), h(VxeUIButtonComponent, {
853
+ props: {
854
+ mode: 'text',
855
+ icon: column.renderFixed === 'right' ? getIcon().TOOLBAR_TOOLS_FIXED_RIGHT_ACTIVE : getIcon().TOOLBAR_TOOLS_FIXED_RIGHT,
856
+ status: column.renderFixed === 'right' ? 'primary' : '',
857
+ disabled: isHidden || isMaxFixedColumn && !column.renderFixed,
858
+ title: getI18n(column.renderFixed === 'right' ? 'vxe.toolbar.cancelFixed' : 'vxe.toolbar.fixedRight')
859
+ },
860
+ on: {
861
+ click: ({
862
+ $event
863
+ }) => {
864
+ $xeTableCustomPanel.changeFixedOption(column, 'right', $event);
865
+ }
866
+ }
867
+ })]) : renderEmptyElement($xeTable)]));
868
+ }
869
+ });
870
+ return h('div', {
871
+ ref: 'refElem',
872
+ key: 'simple',
873
+ class: ['vxe-table-custom-wrapper', `placement--${placement}`, {
874
+ 'is--active': customStore.visible
875
+ }],
876
+ style: maxHeight && !['left', 'right'].includes(placement || '') ? {
877
+ maxHeight: `${maxHeight}px`
878
+ } : {}
879
+ }, customStore.visible ? [h('div', {
880
+ ref: 'refBodyWrapperElem',
881
+ class: 'vxe-table-custom-simple--body-wrapper'
882
+ }, [!treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregateSimplePanel ? h($xeTable.getPivotTableAggregateSimplePanel(), {
883
+ props: {
884
+ customStore
885
+ }
886
+ }) : renderEmptyElement($xeTable), h('div', {
887
+ ref: 'refCustomBodyElem',
888
+ class: 'vxe-table-custom--handle-wrapper'
889
+ }, [h('div', {
890
+ class: 'vxe-table-custom--header'
891
+ }, headerSlot ? $xeTable.callSlot(headerSlot, params, h) : [h('ul', {
892
+ class: 'vxe-table-custom--panel-list'
893
+ }, [h('li', {
894
+ class: 'vxe-table-custom--option'
895
+ }, [allowVisible ? h('div', {
896
+ class: ['vxe-table-custom--checkbox-option', {
897
+ 'is--checked': isAllChecked,
898
+ 'is--indeterminate': isAllIndeterminate
899
+ }],
900
+ attrs: {
901
+ title: getI18n('vxe.table.allTitle')
902
+ },
903
+ on: {
904
+ click: $xeTableCustomPanel.allOptionEvent
905
+ }
906
+ }, [h('span', {
907
+ class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
908
+ }), h('span', {
909
+ class: 'vxe-checkbox--label'
910
+ }, getI18n('vxe.toolbar.customAll'))]) : h('span', {
911
+ class: 'vxe-checkbox--label'
912
+ }, getI18n('vxe.table.customTitle'))])])]), h('div', {
913
+ class: 'vxe-table-custom--body'
914
+ }, [topSlot ? h('div', {
915
+ class: 'vxe-table-custom--panel-top'
916
+ }, $xeTable.callSlot(topSlot, params, h)) : renderEmptyElement($xeTable), defaultSlot ? h('div', {
917
+ class: 'vxe-table-custom--panel-body'
918
+ }, $xeTable.callSlot(defaultSlot, params, h)) : h('transition-group', {
919
+ class: 'vxe-table-custom--panel-list',
920
+ props: {
921
+ name: 'vxe-table-custom--list',
922
+ tag: 'ul'
923
+ },
924
+ on: customWrapperOns
925
+ }, colVNs), bottomSlot ? h('div', {
926
+ class: 'vxe-table-custom--panel-bottom'
927
+ }, $xeTable.callSlot(bottomSlot, params, h)) : renderEmptyElement($xeTable)]), customOpts.showFooter ? h('div', {
928
+ class: 'vxe-table-custom--footer'
929
+ }, footerSlot ? $xeTable.callSlot(footerSlot, params, h) : [h('div', {
930
+ class: 'vxe-table-custom--footer-buttons'
931
+ }, [h(VxeUIButtonComponent, {
932
+ props: {
933
+ mode: 'text',
934
+ content: customOpts.resetButtonText || getI18n('vxe.table.customRestore'),
935
+ disabled: !isCustomStatus
936
+ },
937
+ on: {
938
+ click: $xeTableCustomPanel.resetCustomEvent
939
+ }
940
+ }), immediate ? h(VxeUIButtonComponent, {
941
+ props: {
942
+ mode: 'text',
943
+ content: customOpts.closeButtonText || getI18n('vxe.table.customClose')
944
+ },
945
+ on: {
946
+ click: $xeTableCustomPanel.cancelCloseEvent
947
+ }
948
+ }) : h(VxeUIButtonComponent, {
949
+ props: {
950
+ mode: 'text',
951
+ content: customOpts.resetButtonText || getI18n('vxe.table.customCancel')
952
+ },
953
+ on: {
954
+ click: $xeTableCustomPanel.cancelCustomEvent
955
+ }
956
+ }), immediate ? renderEmptyElement($xeTable) : h(VxeUIButtonComponent, {
957
+ props: {
958
+ mode: 'text',
959
+ status: 'primary',
960
+ content: customOpts.confirmButtonText || getI18n('vxe.table.customConfirm')
961
+ },
962
+ on: {
963
+ click: $xeTableCustomPanel.confirmCustomEvent
964
+ }
965
+ })])]) : null]), $xeTableCustomPanel.renderDragTip(h)])] : []);
966
+ },
967
+ renderPopupPanel(h) {
968
+ const VxeUIModalComponent = _ui.VxeUI.getComponent('VxeModal');
969
+ const VxeUIDrawerComponent = _ui.VxeUI.getComponent('VxeDrawer');
970
+ const VxeUIButtonComponent = _ui.VxeUI.getComponent('VxeButton');
971
+ const VxeUINumberInputComponent = _ui.VxeUI.getComponent('VxeNumberInput');
972
+ const $xeTableCustomPanel = this;
973
+ const props = $xeTableCustomPanel;
974
+ const $xeTable = $xeTableCustomPanel.$xeTable;
975
+ const tableProps = $xeTable;
976
+ const tableReactData = $xeTable;
977
+ const $xeGrid = $xeTable.$xeGrid;
978
+ const $xeGantt = $xeTable.$xeGantt;
979
+ const {
980
+ customStore
981
+ } = props;
982
+ const {
983
+ treeConfig,
984
+ rowGroupConfig,
985
+ aggregateConfig,
986
+ resizable: allResizable
987
+ } = tableProps;
988
+ const {
989
+ isCustomStatus,
990
+ customColumnList
991
+ } = tableReactData;
992
+ const customOpts = $xeTable.computeCustomOpts;
993
+ const {
994
+ immediate
995
+ } = customOpts;
996
+ const columnDragOpts = $xeTable.computeColumnDragOpts;
997
+ const {
998
+ mode,
999
+ modalOptions,
1000
+ drawerOptions,
1001
+ allowVisible,
1002
+ allowSort,
1003
+ allowFixed,
1004
+ allowResizable,
1005
+ checkMethod,
1006
+ visibleMethod
1007
+ } = customOpts;
1008
+ const columnOpts = $xeTable.computeColumnOpts;
1009
+ const {
1010
+ maxFixedSize
1011
+ } = columnOpts;
1012
+ const resizableOpts = $xeTable.computeResizableOpts;
1013
+ const {
1014
+ minWidth: reMinWidth,
1015
+ maxWidth: reMaxWidth
1016
+ } = resizableOpts;
1017
+ const modalOpts = Object.assign({}, modalOptions);
1018
+ const drawerOpts = Object.assign({}, drawerOptions);
1019
+ const isMaxFixedColumn = $xeTable.computeIsMaxFixedColumn;
1020
+ const {
1021
+ isCrossDrag
1022
+ } = columnDragOpts;
1023
+ const slots = customOpts.slots || {};
1024
+ const headerSlot = slots.header;
1025
+ const topSlot = slots.top;
1026
+ const bottomSlot = slots.bottom;
1027
+ const defaultSlot = slots.default;
1028
+ const footerSlot = slots.footer;
1029
+ const trVNs = [];
1030
+ const isAllChecked = customStore.isAll;
1031
+ const isAllIndeterminate = customStore.isIndeterminate;
1032
+ const params = {
1033
+ $table: $xeTable,
1034
+ $grid: $xeGrid,
1035
+ $gantt: $xeGantt,
1036
+ columns: customColumnList,
1037
+ isAllChecked,
1038
+ isAllIndeterminate,
1039
+ isCustomStatus
1040
+ };
1041
+ _xeUtils.default.eachTree(customColumnList, (column, index, items, path, parent) => {
1042
+ const isVisible = visibleMethod ? visibleMethod({
1043
+ $table: $xeTable,
1044
+ column
1045
+ }) : true;
1046
+ if (isVisible) {
1047
+ // 默认继承调整宽度
1048
+ let customMinWidth = 0;
1049
+ let customMaxWidth = 0;
1050
+ if (allowResizable) {
1051
+ const resizeParams = {
1052
+ $table: $xeTable,
1053
+ column,
1054
+ columnIndex: index,
1055
+ $columnIndex: index,
1056
+ $rowIndex: -1
1057
+ };
1058
+ if (reMinWidth) {
1059
+ customMinWidth = _xeUtils.default.toNumber(_xeUtils.default.isFunction(reMinWidth) ? reMinWidth(resizeParams) : reMinWidth);
1060
+ }
1061
+ if (reMaxWidth) {
1062
+ customMaxWidth = _xeUtils.default.toNumber(_xeUtils.default.isFunction(reMaxWidth) ? reMaxWidth(resizeParams) : reMaxWidth);
1063
+ }
1064
+ }
1065
+ const isChecked = column.renderVisible;
1066
+ const isIndeterminate = column.halfVisible;
1067
+ const colTitle = (0, _utils.formatText)(column.getTitle(), 1);
1068
+ const isColGroup = column.children && column.children.length;
1069
+ const isDisabled = checkMethod ? !checkMethod({
1070
+ $table: $xeTable,
1071
+ column
1072
+ }) : false;
1073
+ const isHidden = !isChecked;
1074
+ trVNs.push(h('tr', {
1075
+ key: column.id,
1076
+ attrs: {
1077
+ colid: column.id
1078
+ },
1079
+ class: [`vxe-table-custom-popup--row level--${column.level}`, {
1080
+ 'is--group': isColGroup
1081
+ }],
1082
+ on: {
1083
+ dragstart: $xeTableCustomPanel.sortDragstartEvent,
1084
+ dragend: $xeTableCustomPanel.sortDragendEvent,
1085
+ dragover: $xeTableCustomPanel.sortDragoverEvent
1086
+ }
1087
+ }, [allowVisible ? h('td', {
1088
+ class: 'vxe-table-custom-popup--column-item col--visible'
1089
+ }, [h('div', {
1090
+ class: ['vxe-table-custom--checkbox-option', {
1091
+ 'is--checked': isChecked,
1092
+ 'is--indeterminate': isIndeterminate,
1093
+ 'is--disabled': isDisabled
1094
+ }],
1095
+ attrs: {
1096
+ title: getI18n('vxe.custom.setting.colVisible')
1097
+ },
1098
+ on: {
1099
+ click: evnt => {
1100
+ if (!isDisabled) {
1101
+ $xeTableCustomPanel.changeCheckboxOption(column, evnt);
1102
+ }
1103
+ }
1104
+ }
1105
+ }, [h('span', {
1106
+ class: ['vxe-checkbox--icon', isIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
1107
+ })])]) : renderEmptyElement($xeTable), h('td', {
1108
+ class: 'vxe-table-custom-popup--column-item col--name'
1109
+ }, [h('div', {
1110
+ class: 'vxe-table-custom-popup--name'
1111
+ }, [allowSort ? (isCrossDrag ? immediate : false) || column.level === 1 ? h('div', {
1112
+ class: ['vxe-table-custom-popup--column-sort-btn', {
1113
+ 'is--disabled': isHidden
1114
+ }],
1115
+ attrs: {
1116
+ title: getI18n('vxe.custom.setting.sortHelpTip')
1117
+ },
1118
+ on: isHidden ? {} : {
1119
+ mousedown: $xeTableCustomPanel.sortMousedownEvent,
1120
+ mouseup: $xeTableCustomPanel.sortMouseupEvent
1121
+ }
1122
+ }, [h('i', {
1123
+ class: getIcon().TABLE_CUSTOM_SORT
1124
+ })]) : h('div', {
1125
+ class: 'vxe-table-custom-popup--column-sort-placeholder'
1126
+ }) : renderEmptyElement($xeTable), column.type === 'html' ? h('div', {
1127
+ key: '1',
1128
+ class: 'vxe-table-custom-popup--title',
1129
+ domProps: {
1130
+ innerHTML: colTitle
1131
+ }
1132
+ }) : h('div', {
1133
+ key: '0',
1134
+ class: 'vxe-table-custom-popup--title',
1135
+ attrs: {
1136
+ title: colTitle
1137
+ }
1138
+ }, colTitle)])]), allowResizable ? h('td', {
1139
+ class: 'vxe-table-custom-popup--column-item col--resizable'
1140
+ }, [column.children && column.children.length || !(_xeUtils.default.isBoolean(column.resizable) ? column.resizable : columnOpts.resizable || allResizable) ? h('span', '-') : VxeUINumberInputComponent ? h(VxeUINumberInputComponent, {
1141
+ props: {
1142
+ type: 'integer',
1143
+ immediate: false,
1144
+ disabled: isHidden,
1145
+ value: column.renderResizeWidth,
1146
+ min: customMinWidth || undefined,
1147
+ max: customMaxWidth || undefined
1148
+ },
1149
+ on: {
1150
+ modelValue(value) {
1151
+ column.renderResizeWidth = Math.max(0, Number(value));
1152
+ },
1153
+ change() {
1154
+ $xeTableCustomPanel.changeColumnWidth(column);
1155
+ }
1156
+ }
1157
+ }) : renderEmptyElement($xeTableCustomPanel)]) : renderEmptyElement($xeTable), allowFixed ? h('td', {
1158
+ class: 'vxe-table-custom-popup--column-item col--fixed'
1159
+ }, [parent ? h('span', '-') : h('vxe-radio-group', {
1160
+ props: {
1161
+ value: column.renderFixed || '',
1162
+ type: 'button',
1163
+ size: 'mini',
1164
+ disabled: isHidden,
1165
+ options: [{
1166
+ label: getI18n('vxe.custom.setting.fixedLeft'),
1167
+ value: 'left',
1168
+ disabled: isHidden || isMaxFixedColumn
1169
+ }, {
1170
+ label: getI18n('vxe.custom.setting.fixedUnset'),
1171
+ value: '',
1172
+ disabled: isHidden
1173
+ }, {
1174
+ label: getI18n('vxe.custom.setting.fixedRight'),
1175
+ value: 'right',
1176
+ disabled: isHidden || isMaxFixedColumn
1177
+ }]
1178
+ },
1179
+ on: {
1180
+ change({
1181
+ label,
1182
+ $event
1183
+ }) {
1184
+ $xeTableCustomPanel.changeFixedOption(column, label, $event);
1185
+ }
1186
+ }
1187
+ })]) : renderEmptyElement($xeTable)]));
1188
+ }
1189
+ });
1190
+ const scopedSlots = {
1191
+ default: () => {
1192
+ return h('div', {
1193
+ ref: 'refBodyWrapperElem',
1194
+ class: 'vxe-table-custom-popup--body-wrapper'
1195
+ }, defaultSlot ? $xeTable.callSlot(defaultSlot, params, h) : [h('div', {
1196
+ ref: 'refCustomBodyElem',
1197
+ class: 'vxe-table-custom-popup--handle-wrapper'
1198
+ }, [topSlot ? h('div', {
1199
+ class: 'vxe-table-custom-popup--table-top'
1200
+ }, $xeTable.callSlot(topSlot, params, h)) : renderEmptyElement($xeTable), h('div', {
1201
+ class: 'vxe-table-custom-popup--table-wrapper'
1202
+ }, [h('table', {}, [h('colgroup', {}, [allowVisible ? h('col', {
1203
+ class: 'vxe-table-custom-popup--table-col-seq'
1204
+ }) : renderEmptyElement($xeTable), h('col', {
1205
+ class: 'vxe-table-custom-popup--table-col-title'
1206
+ }), allowResizable ? h('col', {
1207
+ class: 'vxe-table-custom-popup--table-col-width'
1208
+ }) : renderEmptyElement($xeTable), allowFixed ? h('col', {
1209
+ class: 'vxe-table-custom-popup--table-col-fixed'
1210
+ }) : renderEmptyElement($xeTable)]), h('thead', {}, [h('tr', {}, [allowVisible ? h('th', {}, [h('div', {
1211
+ class: ['vxe-table-custom--checkbox-option', {
1212
+ 'is--checked': isAllChecked,
1213
+ 'is--indeterminate': isAllIndeterminate
1214
+ }],
1215
+ attrs: {
1216
+ title: getI18n('vxe.table.allTitle')
1217
+ },
1218
+ on: {
1219
+ click: $xeTableCustomPanel.allOptionEvent
1220
+ }
1221
+ }, [h('span', {
1222
+ class: ['vxe-checkbox--icon', isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
1223
+ }), h('span', {
1224
+ class: 'vxe-checkbox--label'
1225
+ }, getI18n('vxe.toolbar.customAll'))])]) : renderEmptyElement($xeTable), h('th', {}, getI18n('vxe.custom.setting.colTitle')), allowResizable ? h('th', {}, getI18n('vxe.custom.setting.colResizable')) : renderEmptyElement($xeTable), allowFixed ? h('th', {}, getI18n(`vxe.custom.setting.${maxFixedSize ? 'colFixedMax' : 'colFixed'}`, [maxFixedSize])) : renderEmptyElement($xeTable)])]), h('transition-group', {
1226
+ class: 'vxe-table-custom--panel-list',
1227
+ props: {
1228
+ tag: 'tbody',
1229
+ name: 'vxe-table-custom--list'
1230
+ }
1231
+ }, trVNs)])]), bottomSlot ? h('div', {
1232
+ class: 'vxe-table-custom-popup--table-bottom'
1233
+ }, $xeTable.callSlot(bottomSlot, params, h)) : renderEmptyElement($xeTable), $xeTableCustomPanel.renderDragTip(h)]), !treeConfig && (aggregateConfig || rowGroupConfig) && $xeTable.getPivotTableAggregatePopupPanel ? h($xeTable.getPivotTableAggregatePopupPanel(), {
1234
+ props: {
1235
+ customStore
1236
+ }
1237
+ }) : renderEmptyElement($xeTable)]);
1238
+ },
1239
+ footer: () => {
1240
+ if (footerSlot) {
1241
+ return $xeTable.callSlot(footerSlot, params, h);
1242
+ }
1243
+ return h('div', {
1244
+ class: 'vxe-table-custom-popup--footer'
1245
+ }, [h(VxeUIButtonComponent, {
1246
+ props: {
1247
+ content: customOpts.resetButtonText || getI18n('vxe.custom.cstmRestore'),
1248
+ disabled: !isCustomStatus
1249
+ },
1250
+ on: {
1251
+ click: $xeTableCustomPanel.resetCustomEvent
1252
+ }
1253
+ }), immediate ? h(VxeUIButtonComponent, {
1254
+ props: {
1255
+ content: customOpts.resetButtonText || getI18n('vxe.table.customClose')
1256
+ },
1257
+ on: {
1258
+ click: $xeTableCustomPanel.cancelCloseEvent
1259
+ }
1260
+ }) : h(VxeUIButtonComponent, {
1261
+ props: {
1262
+ content: customOpts.resetButtonText || getI18n('vxe.custom.cstmCancel')
1263
+ },
1264
+ on: {
1265
+ click: $xeTableCustomPanel.cancelCustomEvent
1266
+ }
1267
+ }), immediate ? renderEmptyElement($xeTable) : h(VxeUIButtonComponent, {
1268
+ props: {
1269
+ status: 'primary',
1270
+ content: customOpts.confirmButtonText || getI18n('vxe.custom.cstmConfirm')
1271
+ },
1272
+ on: {
1273
+ click: $xeTableCustomPanel.confirmCustomEvent
1274
+ }
1275
+ })]);
1276
+ }
1277
+ };
1278
+ if (headerSlot) {
1279
+ scopedSlots.header = () => $xeTable.callSlot(headerSlot, params, h);
1280
+ }
1281
+ if (mode === 'drawer') {
1282
+ return VxeUIDrawerComponent ? h(VxeUIDrawerComponent, {
1283
+ key: 'drawer',
1284
+ props: {
1285
+ className: ['vxe-table-custom-drawer-wrapper', 'vxe-table--ignore-clear', drawerOpts.className || ''].join(' '),
1286
+ value: customStore.visible,
1287
+ title: drawerOpts.title || getI18n('vxe.custom.cstmTitle'),
1288
+ width: drawerOpts.width || Math.min(880, Math.floor(document.documentElement.clientWidth * 0.6)),
1289
+ position: drawerOpts.position,
1290
+ resize: !!drawerOpts.resize,
1291
+ escClosable: !!drawerOpts.escClosable,
1292
+ maskClosable: !!drawerOpts.maskClosable,
1293
+ destroyOnClose: true,
1294
+ showFooter: true
1295
+ },
1296
+ on: {
1297
+ input(value) {
1298
+ customStore.visible = value;
1299
+ }
1300
+ },
1301
+ scopedSlots
1302
+ }) : renderEmptyElement($xeTableCustomPanel);
1303
+ }
1304
+ return VxeUIModalComponent ? h(VxeUIModalComponent, {
1305
+ key: 'modal',
1306
+ props: {
1307
+ className: ['vxe-table-custom-popup-wrapper', 'vxe-table--ignore-clear', modalOpts.className || ''].join(' '),
1308
+ value: customStore.visible,
1309
+ title: modalOpts.title || getI18n('vxe.custom.cstmTitle'),
1310
+ width: modalOpts.width || Math.min(880, document.documentElement.clientWidth),
1311
+ minWidth: modalOpts.minWidth || 700,
1312
+ height: modalOpts.height || Math.min(680, document.documentElement.clientHeight),
1313
+ minHeight: modalOpts.minHeight || 400,
1314
+ showZoom: modalOpts.showZoom,
1315
+ showMaximize: modalOpts.showMaximize,
1316
+ showMinimize: modalOpts.showMinimize,
1317
+ mask: modalOpts.mask,
1318
+ lockView: modalOpts.lockView,
1319
+ resize: modalOpts.resize,
1320
+ escClosable: !!modalOpts.escClosable,
1321
+ maskClosable: !!modalOpts.maskClosable,
1322
+ destroyOnClose: true,
1323
+ showFooter: true
1324
+ },
1325
+ on: {
1326
+ input(value) {
1327
+ customStore.visible = value;
1328
+ }
1329
+ },
1330
+ scopedSlots
1331
+ }) : renderEmptyElement($xeTableCustomPanel);
1332
+ },
1333
+ renderVN(h) {
1334
+ const $xeTableCustomPanel = this;
1335
+ const $xeTable = $xeTableCustomPanel.$xeTable;
1336
+ const customOpts = $xeTable.computeCustomOpts;
1337
+ if (['modal', 'drawer', 'popup'].includes(`${customOpts.mode}`)) {
1338
+ return $xeTableCustomPanel.renderPopupPanel(h);
1339
+ }
1340
+ return $xeTableCustomPanel.renderSimplePanel(h);
1337
1341
  }
1342
+ },
1343
+ render(h) {
1344
+ return this.renderVN(h);
1338
1345
  }
1339
- };
1346
+ });
1347
+ /* define-vxe-component end */