vxe-table 3.8.7-beta.6 → 3.8.7-beta.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.
Files changed (43) hide show
  1. package/lib/all.js +3 -3
  2. package/lib/all.min.js +1 -1
  3. package/lib/form/src/form.js +33 -41
  4. package/lib/form/src/form.min.js +1 -1
  5. package/lib/icon/style/style.css +1 -1
  6. package/lib/icon/style/style.min.css +1 -1
  7. package/lib/index.css +1 -1
  8. package/lib/index.umd.js +73 -61
  9. package/lib/index.umd.min.js +1 -1
  10. package/lib/style.css +1 -1
  11. package/lib/style.min.css +1 -1
  12. package/lib/table/src/methods.js +8 -2
  13. package/lib/table/src/methods.min.js +1 -1
  14. package/lib/table/style/style.css +1 -1
  15. package/lib/table/style/style.min.css +1 -1
  16. package/lib/tools/log.js +1 -1
  17. package/lib/tools/log.min.js +1 -1
  18. package/lib/v-x-e-table/index.js +3 -3
  19. package/lib/v-x-e-table/index.min.js +1 -1
  20. package/lib/v-x-e-table/src/conf.js +7 -0
  21. package/lib/v-x-e-table/src/conf.min.js +1 -1
  22. package/lib/v-x-e-table/src/theme.js +6 -3
  23. package/lib/v-x-e-table/src/theme.min.js +1 -1
  24. package/lib/validator/src/mixin.js +12 -12
  25. package/lib/vxe-table/style/style.css +1 -1
  26. package/lib/vxe-table/style/style.min.css +1 -1
  27. package/package.json +2 -2
  28. package/packages/all.js +4 -4
  29. package/packages/form/src/form.js +4 -11
  30. package/packages/table/src/methods.js +8 -2
  31. package/packages/v-x-e-table/index.js +2 -2
  32. package/packages/v-x-e-table/src/conf.js +7 -0
  33. package/packages/v-x-e-table/src/theme.js +6 -3
  34. package/packages/validator/src/mixin.js +12 -12
  35. package/styles/table.scss +1 -1
  36. package/types/module/export.d.ts +6 -0
  37. package/types/v-x-e-table/index.d.ts +3 -0
  38. /package/lib/icon/style/{iconfont.1716215368165.ttf → iconfont.1716698685311.ttf} +0 -0
  39. /package/lib/icon/style/{iconfont.1716215368165.woff → iconfont.1716698685311.woff} +0 -0
  40. /package/lib/icon/style/{iconfont.1716215368165.woff2 → iconfont.1716698685311.woff2} +0 -0
  41. /package/lib/{iconfont.1716215368165.ttf → iconfont.1716698685311.ttf} +0 -0
  42. /package/lib/{iconfont.1716215368165.woff → iconfont.1716698685311.woff} +0 -0
  43. /package/lib/{iconfont.1716215368165.woff2 → iconfont.1716698685311.woff2} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vxe-table",
3
- "version": "3.8.7-beta.6",
3
+ "version": "3.8.7-beta.8",
4
4
  "description": "一个基于 vue 的 PC 端表单/表格组件,支持增删改查、虚拟树、列拖拽,懒加载、快捷菜单、数据校验、树形结构、打印导出、自定义模板、渲染器、JSON 配置式...",
5
5
  "scripts": {
6
6
  "update": "npm install --legacy-peer-deps",
@@ -26,7 +26,7 @@
26
26
  "style": "lib/style.css",
27
27
  "typings": "types/index.d.ts",
28
28
  "dependencies": {
29
- "dom-zindex": "^1.0.2",
29
+ "dom-zindex": "^1.0.4",
30
30
  "xe-utils": "^3.5.26"
31
31
  },
32
32
  "devDependencies": {
package/packages/all.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import XEUtils from 'xe-utils'
2
- import { VXETable } from './v-x-e-table'
2
+ import { setConfig } from './v-x-e-table'
3
3
  import { setTheme } from './v-x-e-table/src/theme'
4
4
 
5
5
  import { Filter } from './filter'
@@ -84,16 +84,16 @@ const components = [
84
84
  // 默认安装
85
85
  export function install (Vue, options) {
86
86
  if (XEUtils.isPlainObject(options)) {
87
- VXETable.setConfig(options)
87
+ setConfig(options)
88
88
  if (options.theme) {
89
- setTheme(options)
89
+ setTheme(options.theme)
90
90
  }
91
91
  }
92
92
  components.map(component => component.install(Vue))
93
93
  }
94
94
 
95
95
  // 默认中文
96
- VXETable.setConfig({
96
+ setConfig({
97
97
  i18n: (key, args) => XEUtils.toFormatString(XEUtils.get(zhCN, key), args)
98
98
  })
99
99
 
@@ -141,17 +141,10 @@ export default {
141
141
  }
142
142
  },
143
143
  created () {
144
- this.$nextTick(() => {
145
- const { items } = this
146
- if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
147
- if (this.customLayout && this.items) {
148
- errLog('vxe.error.errConflicts', ['custom-layout', 'items'])
149
- }
150
- }
151
- if (items) {
152
- this.loadItem(items)
153
- }
154
- })
144
+ const { items } = this
145
+ if (items && items.length) {
146
+ this.loadItem(items)
147
+ }
155
148
  },
156
149
  render (h) {
157
150
  const { _e, loading, className, data, vSize, tooltipOpts, formItems, customLayout } = this
@@ -1197,8 +1197,14 @@ const Methods = {
1197
1197
  } else {
1198
1198
  const { selectCheckboxMaps, fullDataRowIdData } = this
1199
1199
  XEUtils.each(selectCheckboxMaps, (row, rowid) => {
1200
- if (isFull ? fullDataRowIdData[rowid] : afterFullRowMaps[rowid]) {
1201
- rowList.push(row)
1200
+ if (isFull) {
1201
+ if (fullDataRowIdData[rowid]) {
1202
+ rowList.push(fullDataRowIdData[rowid].row)
1203
+ }
1204
+ } else {
1205
+ if (afterFullRowMaps[rowid]) {
1206
+ rowList.push(afterFullRowMaps[rowid])
1207
+ }
1202
1208
  }
1203
1209
  })
1204
1210
  }
@@ -54,7 +54,7 @@ function getExportOrImpotType (types, flag) {
54
54
  export const setConfig = (options) => {
55
55
  if (options) {
56
56
  if (options.theme) {
57
- setTheme(options)
57
+ setTheme(options.theme)
58
58
  }
59
59
  if (options.zIndex) {
60
60
  DomZIndex.setCurrent(options.zIndex)
@@ -163,7 +163,7 @@ export const VXETable = {
163
163
 
164
164
  export const VxeUI = VXETable
165
165
 
166
- setTheme(globalStore)
166
+ setTheme('light')
167
167
 
168
168
  export * from './src/interceptor'
169
169
  export * from './src/renderer'
@@ -96,9 +96,16 @@ export default {
96
96
  showAsterisk: true
97
97
  },
98
98
  importConfig: {
99
+ _typeMaps: {},
99
100
  modes: ['insert', 'covering']
100
101
  },
101
102
  exportConfig: {
103
+ _typeMaps: {
104
+ csv: 1,
105
+ html: 1,
106
+ xml: 1,
107
+ txt: 1
108
+ },
102
109
  modes: ['current', 'selected']
103
110
  },
104
111
  printConfig: {
@@ -1,11 +1,14 @@
1
1
  import GlobalConfig from '../../v-x-e-table/src/conf'
2
2
 
3
- export function setTheme (options) {
4
- const theme = (options ? options.theme : null) || GlobalConfig.theme || 'default'
3
+ export function setTheme (name) {
4
+ let theme = name || GlobalConfig.theme
5
+ if (!theme || theme === 'default') {
6
+ theme = 'light'
7
+ }
5
8
  if (typeof document !== 'undefined') {
6
9
  const documentElement = document.documentElement
7
10
  if (documentElement) {
8
- documentElement.setAttribute('data-vxe-table-theme', theme)
11
+ documentElement.setAttribute('data-vxe-ui-theme', theme)
9
12
  }
10
13
  }
11
14
  }
@@ -128,18 +128,18 @@ export default {
128
128
  const validRest = {}
129
129
  const { editRules, afterFullData, visibleColumn, treeConfig, treeOpts } = this
130
130
  const childrenField = treeOpts.children || treeOpts.childrenField
131
- let validDatas
131
+ let validList
132
132
  if (rows === true) {
133
- validDatas = afterFullData
133
+ validList = afterFullData
134
134
  } else if (rows) {
135
135
  if (XEUtils.isFunction(rows)) {
136
136
  cb = rows
137
137
  } else {
138
- validDatas = XEUtils.isArray(rows) ? rows : [rows]
138
+ validList = XEUtils.isArray(rows) ? rows : [rows]
139
139
  }
140
140
  }
141
- if (!validDatas) {
142
- validDatas = this.getInsertRecords().concat(this.getUpdateRecords())
141
+ if (!validList) {
142
+ validList = this.getInsertRecords().concat(this.getUpdateRecords())
143
143
  }
144
144
  const rowValidErrs = []
145
145
  this.lastCallTime = Date.now()
@@ -188,9 +188,9 @@ export default {
188
188
  }
189
189
  }
190
190
  if (treeConfig) {
191
- XEUtils.eachTree(validDatas, handleVaild, { children: childrenField })
191
+ XEUtils.eachTree(validList, handleVaild, { children: childrenField })
192
192
  } else {
193
- validDatas.forEach(handleVaild)
193
+ validList.forEach(handleVaild)
194
194
  }
195
195
  return Promise.all(rowValidErrs).then(() => {
196
196
  const ruleProps = Object.keys(validRest)
@@ -279,7 +279,7 @@ export default {
279
279
  const { editRules } = this
280
280
  const { property } = column
281
281
  const errorRules = []
282
- const syncVailds = []
282
+ const syncValidList = []
283
283
  if (property && editRules) {
284
284
  const rules = XEUtils.get(editRules, property)
285
285
  if (rules) {
@@ -324,7 +324,7 @@ export default {
324
324
  errorRules.push(new Rule({ type: 'custom', trigger, content: customValid.message, rule: new Rule(rule) }))
325
325
  } else if (customValid.catch) {
326
326
  // 如果为异步校验(注:异步校验是并发无序的)
327
- syncVailds.push(
327
+ syncValidList.push(
328
328
  customValid.catch(e => {
329
329
  this.validRuleErr = true
330
330
  errorRules.push(new Rule({ type: 'custom', trigger, content: e && e.message ? e.message : (rule.content || rule.message), rule: new Rule(rule) }))
@@ -352,7 +352,7 @@ export default {
352
352
  })
353
353
  }
354
354
  }
355
- return Promise.all(syncVailds).then(() => {
355
+ return Promise.all(syncValidList).then(() => {
356
356
  if (errorRules.length) {
357
357
  const rest = { rules: errorRules, rule: errorRules[0] }
358
358
  return Promise.reject(rest)
@@ -384,9 +384,9 @@ export default {
384
384
  })
385
385
  })
386
386
  } else if (rowList.length) {
387
- const rowidList = rowList.map(row => `${getRowid(this, row)}`)
387
+ const rowIdList = rowList.map(row => `${getRowid(this, row)}`)
388
388
  XEUtils.each(validErrorMaps, (item, key) => {
389
- if (rowidList.indexOf(key.split(':')[0]) > -1) {
389
+ if (rowIdList.indexOf(key.split(':')[0]) > -1) {
390
390
  validErrMaps[key] = item
391
391
  }
392
392
  })
package/styles/table.scss CHANGED
@@ -609,7 +609,7 @@
609
609
  }
610
610
  }
611
611
  &.cell--area {
612
- .vxe-table--main-wrapper {
612
+ .vxe-body--row {
613
613
  user-select: none;
614
614
  }
615
615
  }
@@ -20,6 +20,9 @@ export declare class Export extends VXETableComponent {}
20
20
  * 导出参数
21
21
  */
22
22
  export interface TableExportConfig {
23
+ // 内置属性
24
+ _typeMaps?: Record<string, number>
25
+
23
26
  /**
24
27
  * 文件名
25
28
  */
@@ -110,6 +113,9 @@ export interface ExportParams extends TableExportConfig {
110
113
  * 导入参数
111
114
  */
112
115
  export interface TableImportConfig {
116
+ // 内置属性
117
+ _typeMaps?: Record<string, number>
118
+
113
119
  /**
114
120
  * 可选文件类型列表
115
121
  */
@@ -57,6 +57,7 @@ export interface VxeGlobalIcon {
57
57
  }
58
58
 
59
59
  export type VxeGlobalConfigMethod = (options?: VXETableConfigOptions) => VxeGlobalStore
60
+ export type VxeGlobalThemeMethod = (name?: '' | 'light' | 'dark') => VxeGlobalStore
60
61
 
61
62
  /**
62
63
  * @deprecated
@@ -81,6 +82,7 @@ export interface VxeGlobalStore {
81
82
  export const globalStore: VxeGlobalStore
82
83
 
83
84
  export const setConfig: VxeGlobalConfigMethod
85
+ export const setTheme: VxeGlobalThemeMethod
84
86
  /**
85
87
  * 请使用 setConfig
86
88
  * @deprecated
@@ -125,6 +127,7 @@ export interface VXETableCore {
125
127
  * 设置全局参数/获取所有参数
126
128
  */
127
129
  setConfig: VxeGlobalConfigMethod;
130
+ setTheme: VxeGlobalThemeMethod
128
131
  setIcon: typeof setIcon
129
132
  /**
130
133
  * 读取内部数据