vxe-table 4.7.0-alpha.5 → 4.7.0-alpha.8

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.
package/README.en.md CHANGED
@@ -12,7 +12,7 @@
12
12
  [![pull requests closed](https://img.shields.io/github/issues-pr-closed/x-extends/vxe-table.svg)](https://github.com/x-extends/vxe-table/pulls?q=is%3Apr+is%3Aclosed)
13
13
  [![npm license](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE)
14
14
 
15
- A [vue](https://www.npmjs.com/package/vue) based PC form component, support add delete change check, virtual tree, column drag and drop, lazy loading, shortcut menu, data verification, print export, form rendering, custom template, renderer, JSON configuration...
15
+ A [vue](https://www.npmjs.com/package/vue) based PC form component, support add delete change check, virtual tree, column drag and drop, lazy loading, shortcut menu, data verification, import/export/print, form rendering, custom template, renderer, JSON configuration...
16
16
 
17
17
  * Design concept
18
18
  * Efficient and concise API design for modern browsers.
@@ -24,6 +24,7 @@ A [vue](https://www.npmjs.com/package/vue) based PC form component, support add
24
24
  * [x] ~~v2.0 Based on vue2.6, Support for all major browsers.~~
25
25
  * [x] v3.0 Based on vue2.6, supports modern browsers and retains compatibility with IE11.
26
26
  * [x] v4.0 Based on vue3.x, Only support modern browser, not IE.
27
+ * [x] v4.7 Based on vue3.x, refactor the components, split the excess components, and keep only the table.
27
28
 
28
29
  ## Browser Support
29
30
 
package/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
  [![pull requests closed](https://img.shields.io/github/issues-pr-closed/x-extends/vxe-table.svg)](https://github.com/x-extends/vxe-table/pulls?q=is%3Apr+is%3Aclosed)
13
13
  [![npm license](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE)
14
14
 
15
- 一个基于 [vue](https://www.npmjs.com/package/vue) 的 PC 端表单/表格组件,支持增删改查、虚拟树、列拖拽、懒加载、快捷菜单、数据校验、打印导出、表单渲染、自定义模板、渲染器、JSON 配置式...
15
+ 一个基于 [vue](https://www.npmjs.com/package/vue) 的 PC 端表单/表格组件,支持增删改查、虚拟树、列拖拽、懒加载、快捷菜单、数据校验、导入/导出/打印、表单渲染、自定义模板、渲染器、JSON 配置式...
16
16
 
17
17
  * 设计理念
18
18
  * 面向现代浏览器,高效的简洁 API 设计
@@ -24,6 +24,7 @@
24
24
  * [x] ~~v2.0 基于 vue2.6,支持所有主流的浏览器,同时兼具功能与性能~~
25
25
  * [x] v3.0 基于 vue2.6,支持现代浏览器并保留兼容 IE11
26
26
  * [x] v4.0 基于 vue3.x,只支持现代浏览器,不支持 IE
27
+ * [x] v4.7 基于 vue3.x,重构组件,拆分多余组件,只保留表格
27
28
  * [ ] 下一阶段:sticky 渲染模式、将虚拟滚动提升到极致、虚拟滚动动态行高、数据图表可视化
28
29
 
29
30
  ## 浏览器支持
package/README.zh-TW.md CHANGED
@@ -12,7 +12,7 @@
12
12
  [![pull requests closed](https://img.shields.io/github/issues-pr-closed/x-extends/vxe-table.svg)](https://github.com/x-extends/vxe-table/pulls?q=is%3Apr+is%3Aclosed)
13
13
  [![npm license](https://img.shields.io/github/license/mashape/apistatus.svg)](LICENSE)
14
14
 
15
- 一個基於 [vue](https://www.npmjs.com/package/vue) 的PC端表格組件,支持增刪改查、虛擬樹、列拖拽、懶加載、快捷菜單、數據校驗、打印導出、表單渲染、自定義模板、渲染器、JSON 配置式…
15
+ 一個基於 [vue](https://www.npmjs.com/package/vue) 的PC端表格組件,支持增刪改查、虛擬樹、列拖拽、懶加載、快捷菜單、數據校驗、導入/匯出/列印、表單渲染、自定義模板、渲染器、JSON 配置式…
16
16
 
17
17
  * 設計理念
18
18
  * 面向現代瀏覽器,高效的簡潔 API 設計
@@ -24,6 +24,7 @@
24
24
  * [x] ~~v2.0 基於 vue2.6,支持所有主流的瀏覽器,同時兼具功能與效能~~
25
25
  * [x] v3.0 基於 vue2.6,支持現代瀏覽器並保留相容IE11
26
26
  * [x] v4.0 基于 vue3.x,只支持現代瀏覽器,不支持IE
27
+ * [x] v4.7 基於 vue3.x,重構組件,拆分多餘組件,只保留表格
27
28
 
28
29
  ## 瀏覽器支持
29
30
 
@@ -1,6 +1,6 @@
1
1
  import { inject, nextTick } from 'vue';
2
2
  import XEUtils from 'xe-utils';
3
- import { VxeUI, getConfig, getI18n, hooks, renderer, log } from '@vxe-ui/core';
3
+ import { VxeUI, getI18n, hooks, renderer, log } from '@vxe-ui/core';
4
4
  import { isColumnInfo, mergeBodyMethod, getCellValue } from '../../src/util';
5
5
  import { parseFile, formatText } from '../../../ui/src/utils';
6
6
  import { createHtmlPage, getExportBlobByContent } from './util';
@@ -807,8 +807,9 @@ hooks.add('tableExportModule', {
807
807
  const handleFileImport = (file, opts) => {
808
808
  const { importMethod, afterImportMethod } = opts;
809
809
  const { type, filename } = parseFile(file);
810
+ const importOpts = computeImportOpts.value;
810
811
  // 检查类型,如果为自定义导出,则不需要校验类型
811
- if (!importMethod && !XEUtils.includes(getConfig().importTypes, type)) {
812
+ if (!importMethod && !XEUtils.includes(XEUtils.keys(importOpts._typeMaps), type)) {
812
813
  if (opts.message !== false) {
813
814
  if (VxeUI.modal) {
814
815
  VxeUI.modal.message({ content: getI18n('vxe.error.notType', [type]), status: 'error' });
@@ -882,13 +883,14 @@ hooks.add('tableExportModule', {
882
883
  const { treeConfig, showHeader, showFooter } = props;
883
884
  const { initStore, mergeList, isGroup, footerTableData, exportStore, exportParams } = reactData;
884
885
  const { collectColumn } = internalData;
886
+ const exportOpts = computeExportOpts.value;
885
887
  const hasTree = treeConfig;
886
888
  const customOpts = computeCustomOpts.value;
887
889
  const selectRecords = $xeTable.getCheckboxRecords();
888
890
  const hasFooter = !!footerTableData.length;
889
891
  const hasMerge = !hasTree && mergeList.length;
890
892
  const defOpts = Object.assign({ message: true, isHeader: showHeader, isFooter: showFooter }, options);
891
- const types = defOpts.types || getConfig().exportTypes;
893
+ const types = defOpts.types || XEUtils.keys(exportOpts._typeMaps);
892
894
  const modes = defOpts.modes;
893
895
  const checkMethod = customOpts.checkMethod;
894
896
  const exportColumns = collectColumn.slice(0);
@@ -1072,7 +1074,7 @@ hooks.add('tableExportModule', {
1072
1074
  opts.sheetName = document.title;
1073
1075
  }
1074
1076
  // 检查类型,如果为自定义导出,则不需要校验类型
1075
- if (!opts.exportMethod && !XEUtils.includes(getConfig().exportTypes, type)) {
1077
+ if (!opts.exportMethod && !XEUtils.includes(XEUtils.keys(exportOpts._typeMaps), type)) {
1076
1078
  if (process.env.NODE_ENV === 'development') {
1077
1079
  log.err('vxe.error.notType', [type]);
1078
1080
  }
@@ -1148,7 +1150,7 @@ hooks.add('tableExportModule', {
1148
1150
  importData(options) {
1149
1151
  const importOpts = computeImportOpts.value;
1150
1152
  const opts = Object.assign({
1151
- types: getConfig().importTypes
1153
+ types: XEUtils.keys(importOpts._typeMaps)
1152
1154
  // beforeImportMethod: null,
1153
1155
  // afterImportMethod: null
1154
1156
  }, importOpts, options);
@@ -1211,7 +1213,7 @@ hooks.add('tableExportModule', {
1211
1213
  const { treeConfig, importConfig } = props;
1212
1214
  const { initStore, importStore, importParams } = reactData;
1213
1215
  const importOpts = computeImportOpts.value;
1214
- const defOpts = Object.assign({ mode: 'insert', message: true, types: getConfig().importTypes }, options, importOpts);
1216
+ const defOpts = Object.assign({ mode: 'insert', message: true, types: XEUtils.keys(importOpts._typeMaps) }, options, importOpts);
1215
1217
  const { types } = defOpts;
1216
1218
  const isTree = !!treeConfig;
1217
1219
  if (isTree) {
@@ -6607,11 +6607,11 @@ export default defineComponent({
6607
6607
  const { exportConfig, importConfig } = props;
6608
6608
  const exportOpts = computeExportOpts.value;
6609
6609
  const importOpts = computeImportOpts.value;
6610
- if (importConfig && importOpts.types && !importOpts.importMethod && !XEUtils.includeArrays(getConfig().importTypes, importOpts.types)) {
6611
- log.warn('vxe.error.errProp', [`export-config.types=${importOpts.types.join(',')}`, importOpts.types.filter((type) => XEUtils.includes(getConfig().importTypes, type)).join(',') || getConfig().importTypes.join(',')]);
6610
+ if (importConfig && importOpts.types && !importOpts.importMethod && !XEUtils.includeArrays(XEUtils.keys(importOpts._typeMaps), importOpts.types)) {
6611
+ log.warn('vxe.error.errProp', [`export-config.types=${importOpts.types.join(',')}`, importOpts.types.filter((type) => XEUtils.includes(XEUtils.keys(importOpts._typeMaps), type)).join(',') || XEUtils.keys(importOpts._typeMaps).join(',')]);
6612
6612
  }
6613
- if (exportConfig && exportOpts.types && !exportOpts.exportMethod && !XEUtils.includeArrays(getConfig().exportTypes, exportOpts.types)) {
6614
- log.warn('vxe.error.errProp', [`export-config.types=${exportOpts.types.join(',')}`, exportOpts.types.filter((type) => XEUtils.includes(getConfig().exportTypes, type)).join(',') || getConfig().exportTypes.join(',')]);
6613
+ if (exportConfig && exportOpts.types && !exportOpts.exportMethod && !XEUtils.includeArrays(XEUtils.keys(exportOpts._typeMaps), exportOpts.types)) {
6614
+ log.warn('vxe.error.errProp', [`export-config.types=${exportOpts.types.join(',')}`, exportOpts.types.filter((type) => XEUtils.includes(XEUtils.keys(exportOpts._typeMaps), type)).join(',') || XEUtils.keys(exportOpts._typeMaps).join(',')]);
6615
6615
  }
6616
6616
  }
6617
6617
  if (process.env.NODE_ENV === 'development') {
package/es/ui/index.js CHANGED
@@ -2,8 +2,6 @@ import { VxeUI, setConfig, setIcon, log } from '@vxe-ui/core';
2
2
  VxeUI.tableVersion = process.env.VUE_APP_VXE_TABLE_VERSION;
3
3
  setConfig({
4
4
  emptyCell: ' ',
5
- exportTypes: [],
6
- importTypes: [],
7
5
  table: {
8
6
  fit: true,
9
7
  showHeader: true,
@@ -93,9 +91,16 @@ setConfig({
93
91
  showAsterisk: true
94
92
  },
95
93
  importConfig: {
94
+ _typeMaps: {},
96
95
  modes: ['insert', 'covering']
97
96
  },
98
97
  exportConfig: {
98
+ _typeMaps: {
99
+ csv: 1,
100
+ html: 1,
101
+ xml: 1,
102
+ txt: 1
103
+ },
99
104
  modes: ['current', 'selected']
100
105
  },
101
106
  printConfig: {
package/lib/index.umd.js CHANGED
@@ -12584,11 +12584,11 @@ const sortStorageKey = 'VXE_TABLE_CUSTOM_COLUMN_SORT';
12584
12584
  } = props;
12585
12585
  const exportOpts = computeExportOpts.value;
12586
12586
  const importOpts = computeImportOpts.value;
12587
- if (importConfig && importOpts.types && !importOpts.importMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includeArrays((0,core_.getConfig)().importTypes, importOpts.types)) {
12588
- core_.log.warn('vxe.error.errProp', [`export-config.types=${importOpts.types.join(',')}`, importOpts.types.filter(type => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes((0,core_.getConfig)().importTypes, type)).join(',') || (0,core_.getConfig)().importTypes.join(',')]);
12587
+ if (importConfig && importOpts.types && !importOpts.importMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includeArrays(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps), importOpts.types)) {
12588
+ core_.log.warn('vxe.error.errProp', [`export-config.types=${importOpts.types.join(',')}`, importOpts.types.filter(type => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps), type)).join(',') || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps).join(',')]);
12589
12589
  }
12590
- if (exportConfig && exportOpts.types && !exportOpts.exportMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includeArrays((0,core_.getConfig)().exportTypes, exportOpts.types)) {
12591
- core_.log.warn('vxe.error.errProp', [`export-config.types=${exportOpts.types.join(',')}`, exportOpts.types.filter(type => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes((0,core_.getConfig)().exportTypes, type)).join(',') || (0,core_.getConfig)().exportTypes.join(',')]);
12590
+ if (exportConfig && exportOpts.types && !exportOpts.exportMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includeArrays(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps), exportOpts.types)) {
12591
+ core_.log.warn('vxe.error.errProp', [`export-config.types=${exportOpts.types.join(',')}`, exportOpts.types.filter(type => external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps), type)).join(',') || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps).join(',')]);
12592
12592
  }
12593
12593
  }
12594
12594
  if (true) {
@@ -15735,8 +15735,9 @@ core_.hooks.add('tableExportModule', {
15735
15735
  type,
15736
15736
  filename
15737
15737
  } = (0,utils/* parseFile */.CJ)(file);
15738
+ const importOpts = computeImportOpts.value;
15738
15739
  // 检查类型,如果为自定义导出,则不需要校验类型
15739
- if (!importMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes((0,core_.getConfig)().importTypes, type)) {
15740
+ if (!importMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps), type)) {
15740
15741
  if (opts.message !== false) {
15741
15742
  if (core_.VxeUI.modal) {
15742
15743
  core_.VxeUI.modal.message({
@@ -15858,6 +15859,7 @@ core_.hooks.add('tableExportModule', {
15858
15859
  const {
15859
15860
  collectColumn
15860
15861
  } = internalData;
15862
+ const exportOpts = computeExportOpts.value;
15861
15863
  const hasTree = treeConfig;
15862
15864
  const customOpts = computeCustomOpts.value;
15863
15865
  const selectRecords = $xeTable.getCheckboxRecords();
@@ -15868,7 +15870,7 @@ core_.hooks.add('tableExportModule', {
15868
15870
  isHeader: showHeader,
15869
15871
  isFooter: showFooter
15870
15872
  }, options);
15871
- const types = defOpts.types || (0,core_.getConfig)().exportTypes;
15873
+ const types = defOpts.types || external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps);
15872
15874
  const modes = defOpts.modes;
15873
15875
  const checkMethod = customOpts.checkMethod;
15874
15876
  const exportColumns = collectColumn.slice(0);
@@ -16073,7 +16075,7 @@ core_.hooks.add('tableExportModule', {
16073
16075
  opts.sheetName = document.title;
16074
16076
  }
16075
16077
  // 检查类型,如果为自定义导出,则不需要校验类型
16076
- if (!opts.exportMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes((0,core_.getConfig)().exportTypes, type)) {
16078
+ if (!opts.exportMethod && !external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().includes(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(exportOpts._typeMaps), type)) {
16077
16079
  if (true) {
16078
16080
  core_.log.err('vxe.error.notType', [type]);
16079
16081
  }
@@ -16167,7 +16169,7 @@ core_.hooks.add('tableExportModule', {
16167
16169
  importData(options) {
16168
16170
  const importOpts = computeImportOpts.value;
16169
16171
  const opts = Object.assign({
16170
- types: (0,core_.getConfig)().importTypes
16172
+ types: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps)
16171
16173
  // beforeImportMethod: null,
16172
16174
  // afterImportMethod: null
16173
16175
  }, importOpts, options);
@@ -16254,7 +16256,7 @@ core_.hooks.add('tableExportModule', {
16254
16256
  const defOpts = Object.assign({
16255
16257
  mode: 'insert',
16256
16258
  message: true,
16257
- types: (0,core_.getConfig)().importTypes
16259
+ types: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().keys(importOpts._typeMaps)
16258
16260
  }, options, importOpts);
16259
16261
  const {
16260
16262
  types
@@ -21066,11 +21068,9 @@ __webpack_require__.r(__webpack_exports__);
21066
21068
  /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _vxe_ui_core__WEBPACK_IMPORTED_MODULE_0__) if(["default","config","setup","VXETable"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = function(key) { return _vxe_ui_core__WEBPACK_IMPORTED_MODULE_0__[key]; }.bind(0, __WEBPACK_IMPORT_KEY__)
21067
21069
  /* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
21068
21070
 
21069
- _vxe_ui_core__WEBPACK_IMPORTED_MODULE_0__.VxeUI.tableVersion = ({"NODE_ENV":"production","VUE_APP_VXE_ENV":"development","VUE_APP_VXE_VERSION":"4.7.0-alpha.5","BASE_URL":"/"}).VUE_APP_VXE_TABLE_VERSION;
21071
+ _vxe_ui_core__WEBPACK_IMPORTED_MODULE_0__.VxeUI.tableVersion = ({"NODE_ENV":"production","VUE_APP_VXE_ENV":"development","VUE_APP_VXE_VERSION":"4.7.0-alpha.8","BASE_URL":"/"}).VUE_APP_VXE_TABLE_VERSION;
21070
21072
  (0,_vxe_ui_core__WEBPACK_IMPORTED_MODULE_0__.setConfig)({
21071
21073
  emptyCell: ' ',
21072
- exportTypes: [],
21073
- importTypes: [],
21074
21074
  table: {
21075
21075
  fit: true,
21076
21076
  showHeader: true,
@@ -21160,9 +21160,16 @@ _vxe_ui_core__WEBPACK_IMPORTED_MODULE_0__.VxeUI.tableVersion = ({"NODE_ENV":"pro
21160
21160
  showAsterisk: true
21161
21161
  },
21162
21162
  importConfig: {
21163
+ _typeMaps: {},
21163
21164
  modes: ['insert', 'covering']
21164
21165
  },
21165
21166
  exportConfig: {
21167
+ _typeMaps: {
21168
+ csv: 1,
21169
+ html: 1,
21170
+ xml: 1,
21171
+ txt: 1
21172
+ },
21166
21173
  modes: ['current', 'selected']
21167
21174
  },
21168
21175
  printConfig: {