vxe-table 4.23.12 → 4.23.13

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 (216) hide show
  1. package/dist/all.esm.js +4789 -4773
  2. package/dist/all.esm.min.js +3 -3
  3. package/es/colgroup/index.d.ts +18 -18
  4. package/es/column/index.d.ts +18 -18
  5. package/es/grid/index.d.ts +174 -174
  6. package/es/grid/src/emits.d.ts +1 -1
  7. package/es/grid/src/emits.js +3 -3
  8. package/es/grid/src/grid.d.ts +27 -27
  9. package/es/grid/src/grid.js +10 -10
  10. package/es/grid/src/props.d.ts +2 -2
  11. package/es/grid/src/props.js +4 -4
  12. package/es/index.esm.js +1 -0
  13. package/es/index.js +1 -0
  14. package/es/table/index.d.ts +174 -174
  15. package/es/table/module/custom/panel.js +1588 -1585
  16. package/es/table/module/export/export-panel.js +587 -584
  17. package/es/table/module/export/import-panel.js +258 -255
  18. package/es/table/module/filter/hook.js +1 -15
  19. package/es/table/module/filter/panel.js +281 -278
  20. package/es/table/module/menu/panel.js +225 -222
  21. package/es/table/src/body.js +895 -892
  22. package/es/table/src/column.d.ts +3 -3
  23. package/es/table/src/emits.d.ts +1 -1
  24. package/es/table/src/emits.js +2 -2
  25. package/es/table/src/footer.d.ts +2 -2
  26. package/es/table/src/footer.js +341 -338
  27. package/es/table/src/group.d.ts +3 -3
  28. package/es/table/src/header.js +539 -536
  29. package/es/table/src/props.d.ts +2 -2
  30. package/es/table/src/props.js +2 -2
  31. package/es/table/src/table.d.ts +27 -27
  32. package/es/table/src/table.js +15 -10
  33. package/es/toolbar/index.d.ts +18 -18
  34. package/es/toolbar/src/toolbar.d.ts +3 -3
  35. package/es/ui/index.js +1 -1
  36. package/es/ui/src/dom.d.ts +1 -1
  37. package/es/ui/src/log.js +1 -1
  38. package/es/ui/src/vn.d.ts +2 -2
  39. package/lib/colgroup/index.d.ts +760 -0
  40. package/lib/column/index.d.ts +760 -0
  41. package/lib/components.d.ts +13 -0
  42. package/lib/grid/index.d.ts +2824 -0
  43. package/lib/grid/src/emits.d.ts +2 -0
  44. package/lib/grid/src/emits.js +2 -2
  45. package/lib/grid/src/grid.d.ts +556 -0
  46. package/lib/grid/src/grid.js +6 -6
  47. package/lib/grid/src/props.d.ts +200 -0
  48. package/lib/grid/src/props.js +3 -3
  49. package/lib/index.common.js +1 -0
  50. package/lib/index.d.ts +3 -0
  51. package/lib/index.js +1 -0
  52. package/lib/index.umd.js +4789 -4773
  53. package/lib/index.umd.min.js +3 -3
  54. package/lib/locale/ar-EG.umd.d.ts +908 -0
  55. package/lib/locale/de-DE.umd.d.ts +908 -0
  56. package/lib/locale/en-US.umd.d.ts +908 -0
  57. package/lib/locale/es-ES.umd.d.ts +908 -0
  58. package/lib/locale/fr-FR.umd.d.ts +908 -0
  59. package/lib/locale/hu-HU.umd.d.ts +908 -0
  60. package/lib/locale/hy-AM.umd.d.ts +908 -0
  61. package/lib/locale/id-ID.umd.d.ts +908 -0
  62. package/lib/locale/it-IT.umd.d.ts +908 -0
  63. package/lib/locale/ja-JP.umd.d.ts +908 -0
  64. package/lib/locale/ko-KR.umd.d.ts +908 -0
  65. package/lib/locale/lang/ar-EG.d.ts +908 -0
  66. package/lib/locale/lang/ar-EG.umd.d.ts +908 -0
  67. package/lib/locale/lang/de-DE.d.ts +908 -0
  68. package/lib/locale/lang/de-DE.umd.d.ts +908 -0
  69. package/lib/locale/lang/en-US.d.ts +908 -0
  70. package/lib/locale/lang/en-US.umd.d.ts +908 -0
  71. package/lib/locale/lang/es-ES.d.ts +908 -0
  72. package/lib/locale/lang/es-ES.umd.d.ts +908 -0
  73. package/lib/locale/lang/fr-FR.d.ts +908 -0
  74. package/lib/locale/lang/fr-FR.umd.d.ts +908 -0
  75. package/lib/locale/lang/hu-HU.d.ts +908 -0
  76. package/lib/locale/lang/hu-HU.umd.d.ts +908 -0
  77. package/lib/locale/lang/hy-AM.d.ts +908 -0
  78. package/lib/locale/lang/hy-AM.umd.d.ts +908 -0
  79. package/lib/locale/lang/id-ID.d.ts +908 -0
  80. package/lib/locale/lang/id-ID.umd.d.ts +908 -0
  81. package/lib/locale/lang/it-IT.d.ts +908 -0
  82. package/lib/locale/lang/it-IT.umd.d.ts +908 -0
  83. package/lib/locale/lang/ja-JP.d.ts +908 -0
  84. package/lib/locale/lang/ja-JP.umd.d.ts +908 -0
  85. package/lib/locale/lang/ko-KR.d.ts +908 -0
  86. package/lib/locale/lang/ko-KR.umd.d.ts +908 -0
  87. package/lib/locale/lang/ms-MY.d.ts +908 -0
  88. package/lib/locale/lang/ms-MY.umd.d.ts +908 -0
  89. package/lib/locale/lang/nb-NO.d.ts +908 -0
  90. package/lib/locale/lang/nb-NO.umd.d.ts +908 -0
  91. package/lib/locale/lang/pt-BR.d.ts +908 -0
  92. package/lib/locale/lang/pt-BR.umd.d.ts +908 -0
  93. package/lib/locale/lang/ru-RU.d.ts +908 -0
  94. package/lib/locale/lang/ru-RU.umd.d.ts +908 -0
  95. package/lib/locale/lang/th-TH.d.ts +908 -0
  96. package/lib/locale/lang/th-TH.umd.d.ts +908 -0
  97. package/lib/locale/lang/ug-CN.d.ts +908 -0
  98. package/lib/locale/lang/ug-CN.umd.d.ts +908 -0
  99. package/lib/locale/lang/uk-UA.d.ts +908 -0
  100. package/lib/locale/lang/uk-UA.umd.d.ts +908 -0
  101. package/lib/locale/lang/uz-UZ.d.ts +908 -0
  102. package/lib/locale/lang/uz-UZ.umd.d.ts +908 -0
  103. package/lib/locale/lang/vi-VN.d.ts +908 -0
  104. package/lib/locale/lang/vi-VN.umd.d.ts +908 -0
  105. package/lib/locale/lang/zh-CHT.d.ts +908 -0
  106. package/lib/locale/lang/zh-CHT.umd.d.ts +908 -0
  107. package/lib/locale/lang/zh-CN.d.ts +908 -0
  108. package/lib/locale/lang/zh-CN.umd.d.ts +908 -0
  109. package/lib/locale/lang/zh-HK.d.ts +908 -0
  110. package/lib/locale/lang/zh-HK.umd.d.ts +908 -0
  111. package/lib/locale/lang/zh-MO.d.ts +908 -0
  112. package/lib/locale/lang/zh-MO.umd.d.ts +908 -0
  113. package/lib/locale/lang/zh-TC.d.ts +908 -0
  114. package/lib/locale/lang/zh-TC.umd.d.ts +908 -0
  115. package/lib/locale/lang/zh-TW.d.ts +908 -0
  116. package/lib/locale/lang/zh-TW.umd.d.ts +908 -0
  117. package/lib/locale/ms-MY.umd.d.ts +908 -0
  118. package/lib/locale/nb-NO.umd.d.ts +908 -0
  119. package/lib/locale/pt-BR.umd.d.ts +908 -0
  120. package/lib/locale/ru-RU.umd.d.ts +908 -0
  121. package/lib/locale/th-TH.umd.d.ts +908 -0
  122. package/lib/locale/ug-CN.umd.d.ts +908 -0
  123. package/lib/locale/uk-UA.umd.d.ts +908 -0
  124. package/lib/locale/uz-UZ.umd.d.ts +908 -0
  125. package/lib/locale/vi-VN.umd.d.ts +908 -0
  126. package/lib/locale/zh-CHT.umd.d.ts +908 -0
  127. package/lib/locale/zh-CN.umd.d.ts +908 -0
  128. package/lib/locale/zh-HK.umd.d.ts +908 -0
  129. package/lib/locale/zh-MO.umd.d.ts +908 -0
  130. package/lib/locale/zh-TC.umd.d.ts +908 -0
  131. package/lib/locale/zh-TW.umd.d.ts +908 -0
  132. package/lib/table/index.d.ts +2672 -0
  133. package/lib/table/module/custom/hook.d.ts +1 -0
  134. package/lib/table/module/custom/panel.d.ts +17 -0
  135. package/lib/table/module/custom/panel.js +1588 -1585
  136. package/lib/table/module/edit/hook.d.ts +1 -0
  137. package/lib/table/module/export/export-panel.d.ts +27 -0
  138. package/lib/table/module/export/export-panel.js +587 -584
  139. package/lib/table/module/export/hook.d.ts +1 -0
  140. package/lib/table/module/export/import-panel.d.ts +27 -0
  141. package/lib/table/module/export/import-panel.js +258 -255
  142. package/lib/table/module/export/util.d.ts +5 -0
  143. package/lib/table/module/filter/hook.d.ts +1 -0
  144. package/lib/table/module/filter/hook.js +1 -15
  145. package/lib/table/module/filter/panel.d.ts +16 -0
  146. package/lib/table/module/filter/panel.js +281 -278
  147. package/lib/table/module/keyboard/hook.d.ts +1 -0
  148. package/lib/table/module/menu/hook.d.ts +1 -0
  149. package/lib/table/module/menu/panel.d.ts +2 -0
  150. package/lib/table/module/menu/panel.js +225 -222
  151. package/lib/table/module/validator/hook.d.ts +1 -0
  152. package/lib/table/render/index.d.ts +1 -0
  153. package/lib/table/src/body.d.ts +24 -0
  154. package/lib/table/src/body.js +895 -892
  155. package/lib/table/src/cell.d.ts +192 -0
  156. package/lib/table/src/column.d.ts +263 -0
  157. package/lib/table/src/columnInfo.d.ts +13 -0
  158. package/lib/table/src/emits.d.ts +2 -0
  159. package/lib/table/src/emits.js +2 -2
  160. package/lib/table/src/footer.d.ts +45 -0
  161. package/lib/table/src/footer.js +341 -338
  162. package/lib/table/src/group.d.ts +178 -0
  163. package/lib/table/src/header.d.ts +26 -0
  164. package/lib/table/src/header.js +539 -536
  165. package/lib/table/src/props.d.ts +238 -0
  166. package/lib/table/src/props.js +2 -2
  167. package/lib/table/src/store.d.ts +6 -0
  168. package/lib/table/src/table.d.ts +539 -0
  169. package/lib/table/src/table.js +13 -8
  170. package/lib/table/src/use/cell-view.d.ts +10 -0
  171. package/lib/table/src/use/index.d.ts +1 -0
  172. package/lib/table/src/util.d.ts +74 -0
  173. package/lib/toolbar/index.d.ts +340 -0
  174. package/lib/toolbar/src/toolbar.d.ts +75 -0
  175. package/lib/ui/index.d.ts +85 -0
  176. package/lib/ui/index.js +1 -1
  177. package/lib/ui/src/anime.d.ts +10 -0
  178. package/lib/ui/src/comp.d.ts +2 -0
  179. package/lib/ui/src/dom.d.ts +80 -0
  180. package/lib/ui/src/log.d.ts +6 -0
  181. package/lib/ui/src/log.js +1 -1
  182. package/lib/ui/src/utils.d.ts +23 -0
  183. package/lib/ui/src/vn.d.ts +7 -0
  184. package/lib/v-x-e-table/index.d.ts +2 -0
  185. package/lib/vxe-colgroup/index.d.ts +3 -0
  186. package/lib/vxe-column/index.d.ts +3 -0
  187. package/lib/vxe-grid/index.d.ts +3 -0
  188. package/lib/vxe-table/index.d.ts +3 -0
  189. package/lib/vxe-toolbar/index.d.ts +3 -0
  190. package/lib/vxe-ui/index.d.ts +3 -0
  191. package/package.json +2 -2
  192. package/packages/grid/src/emits.ts +2 -2
  193. package/packages/grid/src/grid.ts +8 -8
  194. package/packages/grid/src/props.ts +3 -3
  195. package/packages/index.ts +2 -2
  196. package/packages/table/module/custom/panel.ts +2 -2
  197. package/packages/table/module/export/export-panel.ts +2 -2
  198. package/packages/table/module/export/import-panel.ts +2 -2
  199. package/packages/table/module/filter/hook.ts +1 -15
  200. package/packages/table/module/filter/panel.ts +2 -2
  201. package/packages/table/module/menu/panel.ts +2 -2
  202. package/packages/table/src/body.ts +2 -2
  203. package/packages/table/src/emits.ts +1 -1
  204. package/packages/table/src/footer.ts +2 -2
  205. package/packages/table/src/header.ts +2 -2
  206. package/packages/table/src/props.ts +1 -1
  207. package/packages/table/src/table.ts +21 -33
  208. /package/dist/{iconfont.1793090564415.ttf → iconfont.1793627868721.ttf} +0 -0
  209. /package/dist/{iconfont.1793090564415.woff → iconfont.1793627868721.woff} +0 -0
  210. /package/dist/{iconfont.1793090564415.woff2 → iconfont.1793627868721.woff2} +0 -0
  211. /package/es/{iconfont.1793090564415.ttf → iconfont.1793627868721.ttf} +0 -0
  212. /package/es/{iconfont.1793090564415.woff → iconfont.1793627868721.woff} +0 -0
  213. /package/es/{iconfont.1793090564415.woff2 → iconfont.1793627868721.woff2} +0 -0
  214. /package/lib/{iconfont.1793090564415.ttf → iconfont.1793627868721.ttf} +0 -0
  215. /package/lib/{iconfont.1793090564415.woff → iconfont.1793627868721.woff} +0 -0
  216. /package/lib/{iconfont.1793090564415.woff2 → iconfont.1793627868721.woff2} +0 -0
@@ -6,606 +6,609 @@ import { formatText, getDefaultConfig } from "../../../ui/src/utils";
6
6
  import { createComponentLog } from "../../../ui/src/log";
7
7
  const { errLog } = createComponentLog("table");
8
8
  const { getI18n, getIcon, renderEmptyElement } = VxeUI;
9
- var export_panel_default = defineVxeComponent({
10
- name: "VxeTableExportPanel",
11
- props: {
12
- defaultOptions: {
13
- type: Object,
14
- default: () => ({})
15
- },
16
- storeData: {
17
- type: Object,
18
- default: () => ({})
19
- }
20
- },
21
- setup(props) {
22
- const VxeUIModalComponent = VxeUI.getComponent("VxeModal");
23
- const VxeUIButtonComponent = VxeUI.getComponent("VxeButton");
24
- const VxeUISelectComponent = VxeUI.getComponent("VxeSelect");
25
- const VxeUIInputComponent = VxeUI.getComponent("VxeInput");
26
- const VxeUICheckboxComponent = VxeUI.getComponent("VxeCheckbox");
27
- const $xeTable = inject("$xeTable", {});
28
- const { computeExportOpts, computePrintOpts } = $xeTable.getComputeMaps();
29
- const reactData = reactive({
30
- isAll: false,
31
- isIndeterminate: false,
32
- loading: false
33
- });
34
- const xButtonConfirm = ref();
35
- const xInputFilename = ref();
36
- const xInputSheetname = ref();
37
- const computeColWidthModeOptions = computed(() => {
38
- return [
39
- { value: "", label: getI18n("vxe.export.wdModes.default") },
40
- { value: "auto", label: getI18n("vxe.export.wdModes.auto") },
41
- { value: "scale", label: getI18n("vxe.export.wdModes.scale") }
42
- ];
43
- });
44
- const computeCheckedAll = computed(() => {
45
- const { storeData } = props;
46
- return storeData.columns.every((column) => column.checked);
47
- });
48
- const computeShowSheet = computed(() => {
49
- const { defaultOptions } = props;
50
- return ["html", "xml", "xlsx", "pdf"].indexOf(defaultOptions.type) > -1;
51
- });
52
- const computeSupportMerge = computed(() => {
53
- const { storeData, defaultOptions } = props;
54
- return !defaultOptions.original && defaultOptions.mode === "current" && (storeData.isPrint || ["html", "xlsx"].indexOf(defaultOptions.type) > -1);
55
- });
56
- const computeSupportStyle = computed(() => {
57
- const { defaultOptions } = props;
58
- return !defaultOptions.original && ["xlsx"].indexOf(defaultOptions.type) > -1;
59
- });
60
- const handleOptionCheck = (column) => {
61
- const { storeData } = props;
62
- const matchObj = XEUtils.findTree(storeData.columns, (item) => item === column);
63
- if (matchObj && matchObj.parent) {
64
- const { parent } = matchObj;
65
- if (parent.children && parent.children.length) {
66
- parent.checked = parent.children.every((column2) => column2.checked);
67
- parent.halfChecked = !parent.checked && parent.children.some((column2) => column2.checked || column2.halfChecked);
68
- handleOptionCheck(parent);
69
- }
9
+ var export_panel_default = (
10
+ /* define-vxe-component start */
11
+ defineVxeComponent({
12
+ name: "VxeTableExportPanel",
13
+ props: {
14
+ defaultOptions: {
15
+ type: Object,
16
+ default: () => ({})
17
+ },
18
+ storeData: {
19
+ type: Object,
20
+ default: () => ({})
70
21
  }
71
- };
72
- const checkStatus = () => {
73
- const { storeData } = props;
74
- const columns = storeData.columns;
75
- reactData.isAll = columns.every((column) => column.disabled || column.checked);
76
- reactData.isIndeterminate = !reactData.isAll && columns.some((column) => !column.disabled && (column.checked || column.halfChecked));
77
- };
78
- const changeOption = (column) => {
79
- const isChecked = !column.checked;
80
- XEUtils.eachTree([column], (item) => {
81
- item.checked = isChecked;
82
- item.halfChecked = false;
22
+ },
23
+ setup(props) {
24
+ const VxeUIModalComponent = VxeUI.getComponent("VxeModal");
25
+ const VxeUIButtonComponent = VxeUI.getComponent("VxeButton");
26
+ const VxeUISelectComponent = VxeUI.getComponent("VxeSelect");
27
+ const VxeUIInputComponent = VxeUI.getComponent("VxeInput");
28
+ const VxeUICheckboxComponent = VxeUI.getComponent("VxeCheckbox");
29
+ const $xeTable = inject("$xeTable", {});
30
+ const { computeExportOpts, computePrintOpts } = $xeTable.getComputeMaps();
31
+ const reactData = reactive({
32
+ isAll: false,
33
+ isIndeterminate: false,
34
+ loading: false
83
35
  });
84
- handleOptionCheck(column);
85
- checkStatus();
86
- };
87
- const allColumnEvent = () => {
88
- const { storeData } = props;
89
- const isAll = !reactData.isAll;
90
- XEUtils.eachTree(storeData.columns, (column) => {
91
- if (!column.disabled) {
92
- column.checked = isAll;
93
- column.halfChecked = false;
94
- }
36
+ const xButtonConfirm = ref();
37
+ const xInputFilename = ref();
38
+ const xInputSheetname = ref();
39
+ const computeColWidthModeOptions = computed(() => {
40
+ return [
41
+ { value: "", label: getI18n("vxe.export.wdModes.default") },
42
+ { value: "auto", label: getI18n("vxe.export.wdModes.auto") },
43
+ { value: "scale", label: getI18n("vxe.export.wdModes.scale") }
44
+ ];
95
45
  });
96
- reactData.isAll = isAll;
97
- checkStatus();
98
- };
99
- const showEvent = () => {
100
- nextTick(() => {
101
- const filenameInp = xInputFilename.value;
102
- const sheetnameInp = xInputSheetname.value;
103
- const confirmBtn = xButtonConfirm.value;
104
- const targetElem = filenameInp || sheetnameInp || confirmBtn;
105
- if (targetElem) {
106
- targetElem.focus();
107
- }
46
+ const computeCheckedAll = computed(() => {
47
+ const { storeData } = props;
48
+ return storeData.columns.every((column) => column.checked);
108
49
  });
109
- checkStatus();
110
- };
111
- const getExportOption = () => {
112
- const { storeData, defaultOptions } = props;
113
- const { hasMerge, columns } = storeData;
114
- const checkedAll = computeCheckedAll.value;
115
- const supportMerge = computeSupportMerge.value;
116
- const expColumns = XEUtils.searchTree(columns, (column) => column.checked, { children: "children", mapChildren: "_children", original: true });
117
- return Object.assign({}, defaultOptions, {
118
- _columns: expColumns,
119
- isMerge: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false
50
+ const computeShowSheet = computed(() => {
51
+ const { defaultOptions } = props;
52
+ return ["html", "xml", "xlsx", "pdf"].indexOf(defaultOptions.type) > -1;
120
53
  });
121
- };
122
- const printEvent = () => {
123
- const { storeData } = props;
124
- const printOpts = computePrintOpts.value;
125
- storeData.visible = false;
126
- $xeTable.print(Object.assign({}, printOpts, getExportOption()));
127
- };
128
- const exportEvent = () => {
129
- const { storeData } = props;
130
- const exportOpts = computeExportOpts.value;
131
- reactData.loading = true;
132
- $xeTable.exportData(Object.assign({}, exportOpts, getExportOption())).then(() => {
133
- reactData.loading = false;
134
- storeData.visible = false;
135
- }).catch(() => {
136
- reactData.loading = false;
54
+ const computeSupportMerge = computed(() => {
55
+ const { storeData, defaultOptions } = props;
56
+ return !defaultOptions.original && defaultOptions.mode === "current" && (storeData.isPrint || ["html", "xlsx"].indexOf(defaultOptions.type) > -1);
137
57
  });
138
- };
139
- const cancelEvent = () => {
140
- const { storeData } = props;
141
- storeData.visible = false;
142
- };
143
- const confirmEvent = () => {
144
- const { storeData } = props;
145
- if (storeData.isPrint) {
146
- printEvent();
147
- } else {
148
- exportEvent();
149
- }
150
- };
151
- const renderVN = () => {
152
- const $xeGrid = $xeTable.xeGrid;
153
- const $xeGantt = $xeTable.xeGantt;
154
- const { defaultOptions, storeData } = props;
155
- const { isAll: isAllChecked, isIndeterminate: isAllIndeterminate } = reactData;
156
- const { hasTree, hasRowGroup, hasMerge, isPrint, hasColgroup, columns } = storeData;
157
- const { isHeader } = defaultOptions;
158
- const colVNs = [];
159
- const exportOpts = computeExportOpts.value;
160
- const printOpts = computePrintOpts.value;
161
- const modelOptions = (isPrint ? printOpts : exportOpts).modelOptions || {};
162
- const settingOptions = (isPrint ? printOpts : exportOpts).settingOptions || {};
163
- const checkedAll = computeCheckedAll.value;
164
- const showSheet = computeShowSheet.value;
165
- const supportMerge = computeSupportMerge.value;
166
- const supportStyle = computeSupportStyle.value;
167
- const colWidthModeOptions = computeColWidthModeOptions.value;
168
- const slots = defaultOptions.slots || {};
169
- const topSlot = slots.top;
170
- const bottomSlot = slots.bottom;
171
- const defaultSlot = slots.default;
172
- const footerSlot = slots.footer;
173
- const parameterSlot = slots.parameter;
174
- XEUtils.eachTree(columns, (column) => {
175
- const colTitle = formatText(column.getTitle(), 1);
176
- const isColGroup = column.children && column.children.length;
177
- const isChecked = column.checked;
178
- const indeterminate = column.halfChecked;
179
- const isHtml = column.type === "html";
180
- colVNs.push(
181
- h(
182
- "li",
183
- {
184
- key: column.id,
185
- class: [
186
- "vxe-table-export--panel-column-option",
187
- `level--${column.level}`,
188
- {
189
- "is--group": isColGroup,
190
- "is--checked": isChecked,
191
- "is--indeterminate": indeterminate,
192
- "is--disabled": column.disabled
193
- }
194
- ],
195
- title: isHtml ? "" : colTitle,
196
- onClick: () => {
197
- if (!column.disabled) {
198
- changeOption(column);
199
- }
200
- }
201
- },
202
- [
203
- h("span", {
204
- class: ["vxe-checkbox--icon", indeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
205
- }),
206
- isHtml ? h("span", {
207
- key: "1",
208
- class: "vxe-checkbox--label",
209
- innerHTML: colTitle
210
- }) : h(
211
- "span",
212
- {
213
- key: "0",
214
- class: "vxe-checkbox--label"
215
- },
216
- colTitle
217
- )
218
- ]
219
- )
220
- );
58
+ const computeSupportStyle = computed(() => {
59
+ const { defaultOptions } = props;
60
+ return !defaultOptions.original && ["xlsx"].indexOf(defaultOptions.type) > -1;
221
61
  });
222
- return VxeUIModalComponent ? h(
223
- VxeUIModalComponent,
224
- {
225
- id: "VXE_EXPORT_MODAL",
226
- modelValue: storeData.visible,
227
- title: modelOptions.title || getI18n(isPrint ? "vxe.export.printTitle" : "vxe.export.expTitle"),
228
- className: "vxe-table-export-popup-wrapper",
229
- width: modelOptions.width || 660,
230
- height: modelOptions.height,
231
- minWidth: modelOptions.minWidth || 500,
232
- minHeight: modelOptions.minHeight || 400,
233
- mask: getDefaultConfig(modelOptions.mask, true),
234
- lockView: getDefaultConfig(modelOptions.lockView, true),
235
- showFooter: true,
236
- escClosable: true,
237
- maskClosable: true,
238
- position: modelOptions.position,
239
- fullscreen: modelOptions.fullscreen,
240
- remember: modelOptions.remember,
241
- showMinimize: modelOptions.showMinimize,
242
- showMaximize: getDefaultConfig(modelOptions.showMaximize, true),
243
- resize: getDefaultConfig(modelOptions.resize, true),
244
- loading: reactData.loading,
245
- "onUpdate:modelValue"(value) {
246
- storeData.visible = value;
247
- },
248
- onShow: showEvent
249
- },
250
- {
251
- default: () => {
252
- const params = {
253
- $table: $xeTable,
254
- $grid: $xeGrid,
255
- $gantt: $xeGantt,
256
- options: defaultOptions,
257
- columns,
258
- params: defaultOptions.params
259
- };
260
- const hasEmptyData = defaultOptions.mode === "empty";
261
- return h(
262
- "div",
62
+ const handleOptionCheck = (column) => {
63
+ const { storeData } = props;
64
+ const matchObj = XEUtils.findTree(storeData.columns, (item) => item === column);
65
+ if (matchObj && matchObj.parent) {
66
+ const { parent } = matchObj;
67
+ if (parent.children && parent.children.length) {
68
+ parent.checked = parent.children.every((column2) => column2.checked);
69
+ parent.halfChecked = !parent.checked && parent.children.some((column2) => column2.checked || column2.halfChecked);
70
+ handleOptionCheck(parent);
71
+ }
72
+ }
73
+ };
74
+ const checkStatus = () => {
75
+ const { storeData } = props;
76
+ const columns = storeData.columns;
77
+ reactData.isAll = columns.every((column) => column.disabled || column.checked);
78
+ reactData.isIndeterminate = !reactData.isAll && columns.some((column) => !column.disabled && (column.checked || column.halfChecked));
79
+ };
80
+ const changeOption = (column) => {
81
+ const isChecked = !column.checked;
82
+ XEUtils.eachTree([column], (item) => {
83
+ item.checked = isChecked;
84
+ item.halfChecked = false;
85
+ });
86
+ handleOptionCheck(column);
87
+ checkStatus();
88
+ };
89
+ const allColumnEvent = () => {
90
+ const { storeData } = props;
91
+ const isAll = !reactData.isAll;
92
+ XEUtils.eachTree(storeData.columns, (column) => {
93
+ if (!column.disabled) {
94
+ column.checked = isAll;
95
+ column.halfChecked = false;
96
+ }
97
+ });
98
+ reactData.isAll = isAll;
99
+ checkStatus();
100
+ };
101
+ const showEvent = () => {
102
+ nextTick(() => {
103
+ const filenameInp = xInputFilename.value;
104
+ const sheetnameInp = xInputSheetname.value;
105
+ const confirmBtn = xButtonConfirm.value;
106
+ const targetElem = filenameInp || sheetnameInp || confirmBtn;
107
+ if (targetElem) {
108
+ targetElem.focus();
109
+ }
110
+ });
111
+ checkStatus();
112
+ };
113
+ const getExportOption = () => {
114
+ const { storeData, defaultOptions } = props;
115
+ const { hasMerge, columns } = storeData;
116
+ const checkedAll = computeCheckedAll.value;
117
+ const supportMerge = computeSupportMerge.value;
118
+ const expColumns = XEUtils.searchTree(columns, (column) => column.checked, { children: "children", mapChildren: "_children", original: true });
119
+ return Object.assign({}, defaultOptions, {
120
+ _columns: expColumns,
121
+ isMerge: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false
122
+ });
123
+ };
124
+ const printEvent = () => {
125
+ const { storeData } = props;
126
+ const printOpts = computePrintOpts.value;
127
+ storeData.visible = false;
128
+ $xeTable.print(Object.assign({}, printOpts, getExportOption()));
129
+ };
130
+ const exportEvent = () => {
131
+ const { storeData } = props;
132
+ const exportOpts = computeExportOpts.value;
133
+ reactData.loading = true;
134
+ $xeTable.exportData(Object.assign({}, exportOpts, getExportOption())).then(() => {
135
+ reactData.loading = false;
136
+ storeData.visible = false;
137
+ }).catch(() => {
138
+ reactData.loading = false;
139
+ });
140
+ };
141
+ const cancelEvent = () => {
142
+ const { storeData } = props;
143
+ storeData.visible = false;
144
+ };
145
+ const confirmEvent = () => {
146
+ const { storeData } = props;
147
+ if (storeData.isPrint) {
148
+ printEvent();
149
+ } else {
150
+ exportEvent();
151
+ }
152
+ };
153
+ const renderVN = () => {
154
+ const $xeGrid = $xeTable.xeGrid;
155
+ const $xeGantt = $xeTable.xeGantt;
156
+ const { defaultOptions, storeData } = props;
157
+ const { isAll: isAllChecked, isIndeterminate: isAllIndeterminate } = reactData;
158
+ const { hasTree, hasRowGroup, hasMerge, isPrint, hasColgroup, columns } = storeData;
159
+ const { isHeader } = defaultOptions;
160
+ const colVNs = [];
161
+ const exportOpts = computeExportOpts.value;
162
+ const printOpts = computePrintOpts.value;
163
+ const modelOptions = (isPrint ? printOpts : exportOpts).modelOptions || {};
164
+ const settingOptions = (isPrint ? printOpts : exportOpts).settingOptions || {};
165
+ const checkedAll = computeCheckedAll.value;
166
+ const showSheet = computeShowSheet.value;
167
+ const supportMerge = computeSupportMerge.value;
168
+ const supportStyle = computeSupportStyle.value;
169
+ const colWidthModeOptions = computeColWidthModeOptions.value;
170
+ const slots = defaultOptions.slots || {};
171
+ const topSlot = slots.top;
172
+ const bottomSlot = slots.bottom;
173
+ const defaultSlot = slots.default;
174
+ const footerSlot = slots.footer;
175
+ const parameterSlot = slots.parameter;
176
+ XEUtils.eachTree(columns, (column) => {
177
+ const colTitle = formatText(column.getTitle(), 1);
178
+ const isColGroup = column.children && column.children.length;
179
+ const isChecked = column.checked;
180
+ const indeterminate = column.halfChecked;
181
+ const isHtml = column.type === "html";
182
+ colVNs.push(
183
+ h(
184
+ "li",
263
185
  {
264
- class: "vxe-table-export--panel"
265
- },
266
- [
267
- topSlot ? h(
268
- "div",
269
- {
270
- class: "vxe-table-export--panel-top"
271
- },
272
- $xeTable.callSlot(topSlot, params)
273
- ) : renderEmptyElement($xeTable),
274
- h(
275
- "div",
186
+ key: column.id,
187
+ class: [
188
+ "vxe-table-export--panel-column-option",
189
+ `level--${column.level}`,
276
190
  {
277
- class: "vxe-table-export--panel-body"
278
- },
279
- defaultSlot ? $xeTable.callSlot(defaultSlot, params) : [
280
- h(
281
- "table",
282
- {
283
- class: "vxe-table-export--panel-table",
284
- cellspacing: 0,
285
- cellpadding: 0,
286
- border: 0
287
- },
288
- [
289
- h("tbody", [
290
- [
291
- isPrint || settingOptions.showFileName === false ? renderEmptyElement($xeTable) : h("tr", [
292
- h("td", getI18n("vxe.export.expName")),
293
- h("td", [
294
- VxeUIInputComponent ? h(VxeUIInputComponent, {
295
- ref: xInputFilename,
296
- modelValue: defaultOptions.filename,
297
- type: "text",
298
- clearable: true,
299
- placeholder: getI18n("vxe.export.expNamePlaceholder"),
300
- "onUpdate:modelValue"(value) {
301
- defaultOptions.filename = value;
302
- }
303
- }) : renderEmptyElement($xeTable)
304
- ])
305
- ]),
306
- isPrint || settingOptions.showType === false ? renderEmptyElement($xeTable) : h("tr", [
307
- h("td", getI18n("vxe.export.expType")),
308
- h("td", [
309
- VxeUISelectComponent ? h(VxeUISelectComponent, {
310
- modelValue: defaultOptions.type,
311
- options: storeData.typeList,
312
- "onUpdate:modelValue"(value) {
313
- defaultOptions.type = value;
314
- }
315
- }) : renderEmptyElement($xeTable)
316
- ])
317
- ]),
318
- (isPrint || showSheet) && settingOptions.showSheet !== false ? h("tr", [
319
- h("td", getI18n("vxe.export.expSheetName")),
320
- h("td", [
321
- VxeUIInputComponent ? h(VxeUIInputComponent, {
322
- ref: xInputSheetname,
323
- modelValue: defaultOptions.sheetName,
324
- type: "text",
325
- clearable: true,
326
- placeholder: getI18n("vxe.export.expSheetNamePlaceholder"),
327
- "onUpdate:modelValue"(value) {
328
- defaultOptions.sheetName = value;
329
- }
330
- }) : renderEmptyElement($xeTable)
331
- ])
332
- ]) : renderEmptyElement($xeTable),
333
- settingOptions.showMode === false ? renderEmptyElement($xeTable) : h("tr", [
334
- h("td", getI18n("vxe.export.expMode")),
335
- h("td", [
336
- VxeUISelectComponent ? h(VxeUISelectComponent, {
337
- modelValue: defaultOptions.mode,
338
- options: storeData.modeList.map((item) => {
339
- return {
340
- value: item.value,
341
- label: getI18n(item.label)
342
- };
343
- }),
344
- "onUpdate:modelValue"(value) {
345
- defaultOptions.mode = value;
346
- }
347
- }) : renderEmptyElement($xeTable)
348
- ])
349
- ]),
350
- settingOptions.showColumn === false ? renderEmptyElement($xeTable) : h("tr", [
351
- h("td", [getI18n("vxe.export.expColumn")]),
352
- h("td", [
353
- h(
354
- "div",
355
- {
356
- class: "vxe-table-export--panel-column"
357
- },
358
- [
359
- h(
360
- "ul",
361
- {
362
- class: "vxe-table-export--panel-column-header"
363
- },
364
- [
365
- h(
366
- "li",
367
- {
368
- class: [
369
- "vxe-table-export--panel-column-option",
370
- {
371
- "is--checked": isAllChecked,
372
- "is--indeterminate": isAllIndeterminate
373
- }
374
- ],
375
- title: getI18n("vxe.table.allTitle"),
376
- onClick: allColumnEvent
377
- },
378
- [
379
- h("span", {
380
- class: ["vxe-checkbox--icon", isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
381
- }),
382
- h(
383
- "span",
384
- {
385
- class: "vxe-checkbox--label"
386
- },
387
- getI18n("vxe.export.expCurrentColumn")
388
- )
389
- ]
390
- )
391
- ]
392
- ),
393
- h(
394
- "ul",
395
- {
396
- class: "vxe-table-export--panel-column-body"
397
- },
398
- colVNs
399
- )
400
- ]
401
- )
402
- ])
403
- ]),
404
- isPrint && settingOptions.showWidthMode !== false ? h("tr", [
405
- h("td", getI18n("vxe.export.widthMode")),
406
- h("td", [
407
- VxeUISelectComponent ? h(VxeUISelectComponent, {
408
- modelValue: defaultOptions.widthMode,
409
- options: colWidthModeOptions,
410
- "onUpdate:modelValue"(value) {
411
- defaultOptions.widthMode = value;
412
- }
413
- }) : renderEmptyElement($xeTable)
414
- ])
415
- ]) : renderEmptyElement($xeTable),
416
- settingOptions.showParameter === false ? renderEmptyElement($xeTable) : h("tr", [
417
- h("td", getI18n("vxe.export.expOpts")),
418
- parameterSlot ? h("td", [
419
- h(
420
- "div",
421
- {
422
- class: "vxe-table-export--panel-option-row"
423
- },
424
- $xeTable.callSlot(parameterSlot, params)
425
- )
426
- ]) : h("td", [
427
- h(
428
- "div",
429
- {
430
- class: "vxe-table-export--panel-option-row"
431
- },
432
- VxeUICheckboxComponent ? [
433
- h(VxeUICheckboxComponent, {
434
- modelValue: hasEmptyData || isHeader,
435
- disabled: hasEmptyData,
436
- title: getI18n("vxe.export.expHeaderTitle"),
437
- content: getI18n("vxe.export.expOptHeader"),
438
- "onUpdate:modelValue"(value) {
439
- defaultOptions.isHeader = value;
440
- }
441
- }),
442
- h(VxeUICheckboxComponent, {
443
- modelValue: defaultOptions.isFooter,
444
- disabled: !storeData.hasFooter,
445
- title: getI18n("vxe.export.expFooterTitle"),
446
- content: getI18n("vxe.export.expOptFooter"),
447
- "onUpdate:modelValue"(value) {
448
- defaultOptions.isFooter = value;
449
- }
450
- }),
451
- h(VxeUICheckboxComponent, {
452
- modelValue: isHeader ? defaultOptions.isTitle : false,
453
- disabled: !isHeader,
454
- title: getI18n("vxe.export.expTitleTitle"),
455
- content: getI18n("vxe.export.expOptTitle"),
456
- "onUpdate:modelValue"(value) {
457
- defaultOptions.isTitle = value;
458
- }
459
- }),
460
- h(VxeUICheckboxComponent, {
461
- modelValue: isHeader && hasColgroup && supportMerge ? defaultOptions.isColgroup : false,
462
- title: getI18n("vxe.export.expColgroupTitle"),
463
- disabled: !isHeader || !hasColgroup || !supportMerge,
464
- content: getI18n("vxe.export.expOptColgroup"),
465
- "onUpdate:modelValue"(value) {
466
- defaultOptions.isColgroup = value;
467
- }
468
- })
469
- ] : []
470
- ),
471
- h(
472
- "div",
473
- {
474
- class: "vxe-table-export--panel-option-row"
475
- },
476
- VxeUICheckboxComponent ? [
477
- h(VxeUICheckboxComponent, {
478
- modelValue: hasEmptyData ? false : defaultOptions.original,
479
- disabled: hasEmptyData,
480
- title: getI18n("vxe.export.expOriginalTitle"),
481
- content: getI18n("vxe.export.expOptOriginal"),
482
- "onUpdate:modelValue"(value) {
483
- defaultOptions.original = value;
484
- }
485
- }),
486
- h(VxeUICheckboxComponent, {
487
- modelValue: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false,
488
- title: getI18n("vxe.export.expMergeTitle"),
489
- disabled: hasEmptyData || !hasMerge || !supportMerge || !checkedAll,
490
- content: getI18n("vxe.export.expOptMerge"),
491
- "onUpdate:modelValue"(value) {
492
- defaultOptions.isMerge = value;
493
- }
494
- }),
495
- isPrint ? renderEmptyElement($xeTable) : h(VxeUICheckboxComponent, {
496
- modelValue: supportStyle ? defaultOptions.useStyle : false,
497
- disabled: !supportStyle,
498
- title: getI18n("vxe.export.expUseStyleTitle"),
499
- content: getI18n("vxe.export.expOptUseStyle"),
500
- "onUpdate:modelValue"(value) {
501
- defaultOptions.useStyle = value;
502
- }
503
- })
504
- ] : []
505
- ),
506
- h(
507
- "div",
508
- {
509
- class: "vxe-table-export--panel-option-row"
510
- },
511
- VxeUICheckboxComponent ? [
512
- h(VxeUICheckboxComponent, {
513
- modelValue: hasTree ? defaultOptions.isTreeAllExpanded : false,
514
- disabled: hasEmptyData || !hasTree,
515
- title: getI18n("vxe.export.expTreeAllExpandTitle"),
516
- content: getI18n("vxe.export.expOptTreeAllExpand"),
517
- "onUpdate:modelValue"(value) {
518
- defaultOptions.isTreeAllExpanded = value;
519
- }
520
- }),
521
- h(VxeUICheckboxComponent, {
522
- modelValue: hasRowGroup ? defaultOptions.isRowGroupAllExpanded : false,
523
- disabled: hasEmptyData || !hasRowGroup,
524
- title: getI18n("vxe.export.expRowGroupAllExpandTitle"),
525
- content: getI18n("vxe.export.expOptRowGroupAllExpand"),
526
- "onUpdate:modelValue"(value) {
527
- defaultOptions.isRowGroupAllExpanded = value;
528
- }
529
- })
530
- ] : []
531
- )
532
- ])
533
- ])
534
- ]
535
- ])
536
- ]
537
- )
538
- ]
539
- ),
540
- bottomSlot ? h(
541
- "div",
542
- {
543
- class: "vxe-table-export--panel-bottom"
544
- },
545
- $xeTable.callSlot(bottomSlot, params)
546
- ) : renderEmptyElement($xeTable)
547
- ]
548
- );
549
- },
550
- footer() {
551
- const params = {
552
- $table: $xeTable,
553
- $grid: $xeGrid,
554
- $gantt: $xeGantt,
555
- options: defaultOptions,
556
- columns,
557
- params: defaultOptions.params
558
- };
559
- return h(
560
- "div",
561
- {
562
- class: "vxe-table-export--panel-footer"
191
+ "is--group": isColGroup,
192
+ "is--checked": isChecked,
193
+ "is--indeterminate": indeterminate,
194
+ "is--disabled": column.disabled
195
+ }
196
+ ],
197
+ title: isHtml ? "" : colTitle,
198
+ onClick: () => {
199
+ if (!column.disabled) {
200
+ changeOption(column);
201
+ }
202
+ }
563
203
  },
564
- footerSlot ? $xeTable.callSlot(footerSlot, params) : [
565
- h(
566
- "div",
204
+ [
205
+ h("span", {
206
+ class: ["vxe-checkbox--icon", indeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
207
+ }),
208
+ isHtml ? h("span", {
209
+ key: "1",
210
+ class: "vxe-checkbox--label",
211
+ innerHTML: colTitle
212
+ }) : h(
213
+ "span",
567
214
  {
568
- class: "vxe-table-export--panel-btns"
215
+ key: "0",
216
+ class: "vxe-checkbox--label"
569
217
  },
570
- [
571
- VxeUIButtonComponent ? h(VxeUIButtonComponent, {
572
- content: getI18n("vxe.export.expCancel"),
573
- onClick: cancelEvent
574
- }) : renderEmptyElement($xeTable),
575
- VxeUIButtonComponent ? h(VxeUIButtonComponent, {
576
- ref: xButtonConfirm,
577
- status: "primary",
578
- content: getI18n(isPrint ? "vxe.export.expPrint" : "vxe.export.expConfirm"),
579
- onClick: confirmEvent
580
- }) : renderEmptyElement($xeTable)
581
- ]
218
+ colTitle
582
219
  )
583
220
  ]
584
- );
221
+ )
222
+ );
223
+ });
224
+ return VxeUIModalComponent ? h(
225
+ VxeUIModalComponent,
226
+ {
227
+ id: "VXE_EXPORT_MODAL",
228
+ modelValue: storeData.visible,
229
+ title: modelOptions.title || getI18n(isPrint ? "vxe.export.printTitle" : "vxe.export.expTitle"),
230
+ className: "vxe-table-export-popup-wrapper",
231
+ width: modelOptions.width || 660,
232
+ height: modelOptions.height,
233
+ minWidth: modelOptions.minWidth || 500,
234
+ minHeight: modelOptions.minHeight || 400,
235
+ mask: getDefaultConfig(modelOptions.mask, true),
236
+ lockView: getDefaultConfig(modelOptions.lockView, true),
237
+ showFooter: true,
238
+ escClosable: true,
239
+ maskClosable: true,
240
+ position: modelOptions.position,
241
+ fullscreen: modelOptions.fullscreen,
242
+ remember: modelOptions.remember,
243
+ showMinimize: modelOptions.showMinimize,
244
+ showMaximize: getDefaultConfig(modelOptions.showMaximize, true),
245
+ resize: getDefaultConfig(modelOptions.resize, true),
246
+ loading: reactData.loading,
247
+ "onUpdate:modelValue"(value) {
248
+ storeData.visible = value;
249
+ },
250
+ onShow: showEvent
251
+ },
252
+ {
253
+ default: () => {
254
+ const params = {
255
+ $table: $xeTable,
256
+ $grid: $xeGrid,
257
+ $gantt: $xeGantt,
258
+ options: defaultOptions,
259
+ columns,
260
+ params: defaultOptions.params
261
+ };
262
+ const hasEmptyData = defaultOptions.mode === "empty";
263
+ return h(
264
+ "div",
265
+ {
266
+ class: "vxe-table-export--panel"
267
+ },
268
+ [
269
+ topSlot ? h(
270
+ "div",
271
+ {
272
+ class: "vxe-table-export--panel-top"
273
+ },
274
+ $xeTable.callSlot(topSlot, params)
275
+ ) : renderEmptyElement($xeTable),
276
+ h(
277
+ "div",
278
+ {
279
+ class: "vxe-table-export--panel-body"
280
+ },
281
+ defaultSlot ? $xeTable.callSlot(defaultSlot, params) : [
282
+ h(
283
+ "table",
284
+ {
285
+ class: "vxe-table-export--panel-table",
286
+ cellspacing: 0,
287
+ cellpadding: 0,
288
+ border: 0
289
+ },
290
+ [
291
+ h("tbody", [
292
+ [
293
+ isPrint || settingOptions.showFileName === false ? renderEmptyElement($xeTable) : h("tr", [
294
+ h("td", getI18n("vxe.export.expName")),
295
+ h("td", [
296
+ VxeUIInputComponent ? h(VxeUIInputComponent, {
297
+ ref: xInputFilename,
298
+ modelValue: defaultOptions.filename,
299
+ type: "text",
300
+ clearable: true,
301
+ placeholder: getI18n("vxe.export.expNamePlaceholder"),
302
+ "onUpdate:modelValue"(value) {
303
+ defaultOptions.filename = value;
304
+ }
305
+ }) : renderEmptyElement($xeTable)
306
+ ])
307
+ ]),
308
+ isPrint || settingOptions.showType === false ? renderEmptyElement($xeTable) : h("tr", [
309
+ h("td", getI18n("vxe.export.expType")),
310
+ h("td", [
311
+ VxeUISelectComponent ? h(VxeUISelectComponent, {
312
+ modelValue: defaultOptions.type,
313
+ options: storeData.typeList,
314
+ "onUpdate:modelValue"(value) {
315
+ defaultOptions.type = value;
316
+ }
317
+ }) : renderEmptyElement($xeTable)
318
+ ])
319
+ ]),
320
+ (isPrint || showSheet) && settingOptions.showSheet !== false ? h("tr", [
321
+ h("td", getI18n("vxe.export.expSheetName")),
322
+ h("td", [
323
+ VxeUIInputComponent ? h(VxeUIInputComponent, {
324
+ ref: xInputSheetname,
325
+ modelValue: defaultOptions.sheetName,
326
+ type: "text",
327
+ clearable: true,
328
+ placeholder: getI18n("vxe.export.expSheetNamePlaceholder"),
329
+ "onUpdate:modelValue"(value) {
330
+ defaultOptions.sheetName = value;
331
+ }
332
+ }) : renderEmptyElement($xeTable)
333
+ ])
334
+ ]) : renderEmptyElement($xeTable),
335
+ settingOptions.showMode === false ? renderEmptyElement($xeTable) : h("tr", [
336
+ h("td", getI18n("vxe.export.expMode")),
337
+ h("td", [
338
+ VxeUISelectComponent ? h(VxeUISelectComponent, {
339
+ modelValue: defaultOptions.mode,
340
+ options: storeData.modeList.map((item) => {
341
+ return {
342
+ value: item.value,
343
+ label: getI18n(item.label)
344
+ };
345
+ }),
346
+ "onUpdate:modelValue"(value) {
347
+ defaultOptions.mode = value;
348
+ }
349
+ }) : renderEmptyElement($xeTable)
350
+ ])
351
+ ]),
352
+ settingOptions.showColumn === false ? renderEmptyElement($xeTable) : h("tr", [
353
+ h("td", [getI18n("vxe.export.expColumn")]),
354
+ h("td", [
355
+ h(
356
+ "div",
357
+ {
358
+ class: "vxe-table-export--panel-column"
359
+ },
360
+ [
361
+ h(
362
+ "ul",
363
+ {
364
+ class: "vxe-table-export--panel-column-header"
365
+ },
366
+ [
367
+ h(
368
+ "li",
369
+ {
370
+ class: [
371
+ "vxe-table-export--panel-column-option",
372
+ {
373
+ "is--checked": isAllChecked,
374
+ "is--indeterminate": isAllIndeterminate
375
+ }
376
+ ],
377
+ title: getI18n("vxe.table.allTitle"),
378
+ onClick: allColumnEvent
379
+ },
380
+ [
381
+ h("span", {
382
+ class: ["vxe-checkbox--icon", isAllIndeterminate ? getIcon().TABLE_CHECKBOX_INDETERMINATE : isAllChecked ? getIcon().TABLE_CHECKBOX_CHECKED : getIcon().TABLE_CHECKBOX_UNCHECKED]
383
+ }),
384
+ h(
385
+ "span",
386
+ {
387
+ class: "vxe-checkbox--label"
388
+ },
389
+ getI18n("vxe.export.expCurrentColumn")
390
+ )
391
+ ]
392
+ )
393
+ ]
394
+ ),
395
+ h(
396
+ "ul",
397
+ {
398
+ class: "vxe-table-export--panel-column-body"
399
+ },
400
+ colVNs
401
+ )
402
+ ]
403
+ )
404
+ ])
405
+ ]),
406
+ isPrint && settingOptions.showWidthMode !== false ? h("tr", [
407
+ h("td", getI18n("vxe.export.widthMode")),
408
+ h("td", [
409
+ VxeUISelectComponent ? h(VxeUISelectComponent, {
410
+ modelValue: defaultOptions.widthMode,
411
+ options: colWidthModeOptions,
412
+ "onUpdate:modelValue"(value) {
413
+ defaultOptions.widthMode = value;
414
+ }
415
+ }) : renderEmptyElement($xeTable)
416
+ ])
417
+ ]) : renderEmptyElement($xeTable),
418
+ settingOptions.showParameter === false ? renderEmptyElement($xeTable) : h("tr", [
419
+ h("td", getI18n("vxe.export.expOpts")),
420
+ parameterSlot ? h("td", [
421
+ h(
422
+ "div",
423
+ {
424
+ class: "vxe-table-export--panel-option-row"
425
+ },
426
+ $xeTable.callSlot(parameterSlot, params)
427
+ )
428
+ ]) : h("td", [
429
+ h(
430
+ "div",
431
+ {
432
+ class: "vxe-table-export--panel-option-row"
433
+ },
434
+ VxeUICheckboxComponent ? [
435
+ h(VxeUICheckboxComponent, {
436
+ modelValue: hasEmptyData || isHeader,
437
+ disabled: hasEmptyData,
438
+ title: getI18n("vxe.export.expHeaderTitle"),
439
+ content: getI18n("vxe.export.expOptHeader"),
440
+ "onUpdate:modelValue"(value) {
441
+ defaultOptions.isHeader = value;
442
+ }
443
+ }),
444
+ h(VxeUICheckboxComponent, {
445
+ modelValue: defaultOptions.isFooter,
446
+ disabled: !storeData.hasFooter,
447
+ title: getI18n("vxe.export.expFooterTitle"),
448
+ content: getI18n("vxe.export.expOptFooter"),
449
+ "onUpdate:modelValue"(value) {
450
+ defaultOptions.isFooter = value;
451
+ }
452
+ }),
453
+ h(VxeUICheckboxComponent, {
454
+ modelValue: isHeader ? defaultOptions.isTitle : false,
455
+ disabled: !isHeader,
456
+ title: getI18n("vxe.export.expTitleTitle"),
457
+ content: getI18n("vxe.export.expOptTitle"),
458
+ "onUpdate:modelValue"(value) {
459
+ defaultOptions.isTitle = value;
460
+ }
461
+ }),
462
+ h(VxeUICheckboxComponent, {
463
+ modelValue: isHeader && hasColgroup && supportMerge ? defaultOptions.isColgroup : false,
464
+ title: getI18n("vxe.export.expColgroupTitle"),
465
+ disabled: !isHeader || !hasColgroup || !supportMerge,
466
+ content: getI18n("vxe.export.expOptColgroup"),
467
+ "onUpdate:modelValue"(value) {
468
+ defaultOptions.isColgroup = value;
469
+ }
470
+ })
471
+ ] : []
472
+ ),
473
+ h(
474
+ "div",
475
+ {
476
+ class: "vxe-table-export--panel-option-row"
477
+ },
478
+ VxeUICheckboxComponent ? [
479
+ h(VxeUICheckboxComponent, {
480
+ modelValue: hasEmptyData ? false : defaultOptions.original,
481
+ disabled: hasEmptyData,
482
+ title: getI18n("vxe.export.expOriginalTitle"),
483
+ content: getI18n("vxe.export.expOptOriginal"),
484
+ "onUpdate:modelValue"(value) {
485
+ defaultOptions.original = value;
486
+ }
487
+ }),
488
+ h(VxeUICheckboxComponent, {
489
+ modelValue: hasMerge && supportMerge && checkedAll ? defaultOptions.isMerge : false,
490
+ title: getI18n("vxe.export.expMergeTitle"),
491
+ disabled: hasEmptyData || !hasMerge || !supportMerge || !checkedAll,
492
+ content: getI18n("vxe.export.expOptMerge"),
493
+ "onUpdate:modelValue"(value) {
494
+ defaultOptions.isMerge = value;
495
+ }
496
+ }),
497
+ isPrint ? renderEmptyElement($xeTable) : h(VxeUICheckboxComponent, {
498
+ modelValue: supportStyle ? defaultOptions.useStyle : false,
499
+ disabled: !supportStyle,
500
+ title: getI18n("vxe.export.expUseStyleTitle"),
501
+ content: getI18n("vxe.export.expOptUseStyle"),
502
+ "onUpdate:modelValue"(value) {
503
+ defaultOptions.useStyle = value;
504
+ }
505
+ })
506
+ ] : []
507
+ ),
508
+ h(
509
+ "div",
510
+ {
511
+ class: "vxe-table-export--panel-option-row"
512
+ },
513
+ VxeUICheckboxComponent ? [
514
+ h(VxeUICheckboxComponent, {
515
+ modelValue: hasTree ? defaultOptions.isTreeAllExpanded : false,
516
+ disabled: hasEmptyData || !hasTree,
517
+ title: getI18n("vxe.export.expTreeAllExpandTitle"),
518
+ content: getI18n("vxe.export.expOptTreeAllExpand"),
519
+ "onUpdate:modelValue"(value) {
520
+ defaultOptions.isTreeAllExpanded = value;
521
+ }
522
+ }),
523
+ h(VxeUICheckboxComponent, {
524
+ modelValue: hasRowGroup ? defaultOptions.isRowGroupAllExpanded : false,
525
+ disabled: hasEmptyData || !hasRowGroup,
526
+ title: getI18n("vxe.export.expRowGroupAllExpandTitle"),
527
+ content: getI18n("vxe.export.expOptRowGroupAllExpand"),
528
+ "onUpdate:modelValue"(value) {
529
+ defaultOptions.isRowGroupAllExpanded = value;
530
+ }
531
+ })
532
+ ] : []
533
+ )
534
+ ])
535
+ ])
536
+ ]
537
+ ])
538
+ ]
539
+ )
540
+ ]
541
+ ),
542
+ bottomSlot ? h(
543
+ "div",
544
+ {
545
+ class: "vxe-table-export--panel-bottom"
546
+ },
547
+ $xeTable.callSlot(bottomSlot, params)
548
+ ) : renderEmptyElement($xeTable)
549
+ ]
550
+ );
551
+ },
552
+ footer() {
553
+ const params = {
554
+ $table: $xeTable,
555
+ $grid: $xeGrid,
556
+ $gantt: $xeGantt,
557
+ options: defaultOptions,
558
+ columns,
559
+ params: defaultOptions.params
560
+ };
561
+ return h(
562
+ "div",
563
+ {
564
+ class: "vxe-table-export--panel-footer"
565
+ },
566
+ footerSlot ? $xeTable.callSlot(footerSlot, params) : [
567
+ h(
568
+ "div",
569
+ {
570
+ class: "vxe-table-export--panel-btns"
571
+ },
572
+ [
573
+ VxeUIButtonComponent ? h(VxeUIButtonComponent, {
574
+ content: getI18n("vxe.export.expCancel"),
575
+ onClick: cancelEvent
576
+ }) : renderEmptyElement($xeTable),
577
+ VxeUIButtonComponent ? h(VxeUIButtonComponent, {
578
+ ref: xButtonConfirm,
579
+ status: "primary",
580
+ content: getI18n(isPrint ? "vxe.export.expPrint" : "vxe.export.expConfirm"),
581
+ onClick: confirmEvent
582
+ }) : renderEmptyElement($xeTable)
583
+ ]
584
+ )
585
+ ]
586
+ );
587
+ }
585
588
  }
589
+ ) : renderEmptyElement($xeTable);
590
+ };
591
+ nextTick(() => {
592
+ if (!VxeUIModalComponent) {
593
+ errLog("vxe.error.reqComp", ["vxe-modal"]);
586
594
  }
587
- ) : renderEmptyElement($xeTable);
588
- };
589
- nextTick(() => {
590
- if (!VxeUIModalComponent) {
591
- errLog("vxe.error.reqComp", ["vxe-modal"]);
592
- }
593
- if (!VxeUIButtonComponent) {
594
- errLog("vxe.error.reqComp", ["vxe-button"]);
595
- }
596
- if (!VxeUISelectComponent) {
597
- errLog("vxe.error.reqComp", ["vxe-select"]);
598
- }
599
- if (!VxeUIInputComponent) {
600
- errLog("vxe.error.reqComp", ["vxe-input"]);
601
- }
602
- if (!VxeUICheckboxComponent) {
603
- errLog("vxe.error.reqComp", ["vxe-checkbox"]);
604
- }
605
- });
606
- return renderVN;
607
- }
608
- });
595
+ if (!VxeUIButtonComponent) {
596
+ errLog("vxe.error.reqComp", ["vxe-button"]);
597
+ }
598
+ if (!VxeUISelectComponent) {
599
+ errLog("vxe.error.reqComp", ["vxe-select"]);
600
+ }
601
+ if (!VxeUIInputComponent) {
602
+ errLog("vxe.error.reqComp", ["vxe-input"]);
603
+ }
604
+ if (!VxeUICheckboxComponent) {
605
+ errLog("vxe.error.reqComp", ["vxe-checkbox"]);
606
+ }
607
+ });
608
+ return renderVN;
609
+ }
610
+ })
611
+ );
609
612
  export {
610
613
  export_panel_default as default
611
614
  };