vxe-table 3.7.0-beta.6 → 3.7.0-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.
- package/README.md +6 -9
- package/lib/filter/src/mixin.js +13 -7
- package/lib/filter/src/mixin.min.js +1 -1
- package/lib/form/src/form.js +24 -4
- package/lib/form/src/form.min.js +1 -1
- package/lib/grid/src/grid.js +7 -3
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.css +1 -1
- package/lib/index.umd.js +352 -89
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +6 -1
- package/lib/input/src/input.min.js +1 -1
- package/lib/locale/lang/en-US.js +8 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +8 -0
- package/lib/locale/lang/es-ES.js +8 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +8 -0
- package/lib/locale/lang/ja-JP.d.ts +1 -1
- package/lib/locale/lang/ja-JP.js +8 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +8 -0
- package/lib/locale/lang/pt-BR.d.ts +8 -0
- package/lib/locale/lang/pt-BR.js +330 -0
- package/lib/locale/lang/pt-BR.min.js +1 -0
- package/lib/locale/lang/pt-BR.umd.js +344 -0
- package/lib/locale/lang/zh-CN.d.ts +1 -1
- package/lib/locale/lang/zh-CN.js +8 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +8 -0
- package/lib/locale/lang/zh-HK.d.ts +1 -1
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +8 -0
- package/lib/locale/lang/zh-MO.d.ts +1 -1
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +8 -0
- package/lib/locale/lang/zh-TC.d.ts +1 -1
- package/lib/locale/lang/zh-TC.js +8 -0
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +8 -0
- package/lib/locale/lang/zh-TW.d.ts +1 -1
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +8 -0
- package/lib/menu/src/mixin.js +3 -3
- package/lib/menu/src/mixin.min.js +1 -1
- package/lib/select/src/select.js +6 -1
- package/lib/select/src/select.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/src/cell.js +2 -0
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/columnInfo.js +6 -6
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +43 -16
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +11 -24
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +2 -2
- package/lib/table/style/style.min.css +1 -1
- package/lib/textarea/src/textarea.js +6 -1
- package/lib/textarea/src/textarea.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +18 -6
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/tools/log.js +1 -1
- package/lib/tools/log.min.js +1 -1
- package/lib/v-x-e-table/index.js +3 -1
- package/lib/v-x-e-table/index.min.js +1 -1
- package/lib/v-x-e-table/src/commands.js +58 -2
- package/lib/v-x-e-table/src/commands.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +4 -1
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/v-x-e-table/src/formats.js +58 -2
- package/lib/v-x-e-table/src/formats.min.js +1 -1
- package/lib/v-x-e-table/src/menus.js +58 -2
- package/lib/v-x-e-table/src/menus.min.js +1 -1
- package/lib/v-x-e-table/src/renderer.js +10 -0
- package/lib/v-x-e-table/src/renderer.min.js +1 -1
- package/lib/v-x-e-table/src/store.js +5 -2
- package/lib/v-x-e-table/src/store.min.js +1 -1
- package/lib/v-x-e-table/src/validators.js +15 -0
- package/lib/v-x-e-table/src/validators.min.js +1 -0
- package/lib/validator/src/mixin.js +26 -4
- package/lib/validator/src/mixin.min.js +1 -1
- package/package.json +2 -2
- package/packages/filter/src/mixin.js +5 -1
- package/packages/form/src/form.js +24 -5
- package/packages/grid/src/grid.js +7 -3
- package/packages/input/src/input.js +4 -1
- package/packages/locale/lang/en-US.js +8 -0
- package/packages/locale/lang/es-ES.js +8 -0
- package/packages/locale/lang/ja-JP.d.ts +1 -1
- package/packages/locale/lang/ja-JP.js +8 -0
- package/packages/locale/lang/pt-BR.d.ts +8 -0
- package/packages/locale/lang/pt-BR.js +323 -0
- package/packages/locale/lang/zh-CN.d.ts +1 -1
- package/packages/locale/lang/zh-CN.js +8 -0
- package/packages/locale/lang/zh-HK.d.ts +1 -1
- package/packages/locale/lang/zh-MO.d.ts +1 -1
- package/packages/locale/lang/zh-TC.d.ts +1 -1
- package/packages/locale/lang/zh-TC.js +8 -0
- package/packages/locale/lang/zh-TW.d.ts +1 -1
- package/packages/menu/src/mixin.js +3 -3
- package/packages/select/src/select.js +4 -1
- package/packages/table/src/cell.js +2 -0
- package/packages/table/src/columnInfo.js +6 -6
- package/packages/table/src/methods.js +36 -15
- package/packages/table/src/table.js +5 -1
- package/packages/textarea/src/textarea.js +4 -1
- package/packages/toolbar/src/toolbar.js +18 -6
- package/packages/v-x-e-table/index.js +2 -0
- package/packages/v-x-e-table/src/commands.js +48 -2
- package/packages/v-x-e-table/src/conf.js +4 -1
- package/packages/v-x-e-table/src/formats.js +48 -2
- package/packages/v-x-e-table/src/menus.js +48 -2
- package/packages/v-x-e-table/src/renderer.js +11 -1
- package/packages/v-x-e-table/src/store.js +4 -2
- package/packages/v-x-e-table/src/validators.js +7 -0
- package/packages/validator/src/mixin.js +25 -4
- package/styles/all.scss +30 -0
- package/styles/css-variable.scss +272 -0
- package/styles/cssvar.scss +2 -275
- package/styles/index.scss +2 -0
- package/styles/modules.scss +4 -1
- package/styles/table.scss +4 -4
- package/styles/tooltip.scss +2 -2
- package/styles/variable.scss +1 -4
- package/types/form.d.ts +14 -12
- package/types/table.d.ts +4 -0
- package/types/v-x-e-table/commands.d.ts +21 -13
- package/types/v-x-e-table/formats.d.ts +19 -12
- package/types/v-x-e-table/index.d.ts +7 -1
- package/types/v-x-e-table/menus.d.ts +17 -6
- package/types/v-x-e-table/validators.d.ts +30 -0
- package/types/validator.d.ts +15 -4
- /package/lib/icon/style/{iconfont.1689639571797.ttf → iconfont.1690504677290.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1689639571797.woff → iconfont.1690504677290.woff} +0 -0
- /package/lib/icon/style/{iconfont.1689639571797.woff2 → iconfont.1690504677290.woff2} +0 -0
- /package/lib/{iconfont.1689639571797.ttf → iconfont.1690504677290.ttf} +0 -0
- /package/lib/{iconfont.1689639571797.woff → iconfont.1690504677290.woff} +0 -0
- /package/lib/{iconfont.1689639571797.woff2 → iconfont.1690504677290.woff2} +0 -0
|
@@ -96,6 +96,8 @@ export default {
|
|
|
96
96
|
data: Array,
|
|
97
97
|
// 表格的高度
|
|
98
98
|
height: [Number, String],
|
|
99
|
+
// 表格的最小高度
|
|
100
|
+
minHeight: { type: [Number, String], default: () => GlobalConfig.table.minHeight },
|
|
99
101
|
// 表格的最大高度
|
|
100
102
|
maxHeight: [Number, String],
|
|
101
103
|
// 已废弃,被 column-config.resizable 替换
|
|
@@ -1015,11 +1017,13 @@ export default {
|
|
|
1015
1017
|
hasTip,
|
|
1016
1018
|
columnOpts,
|
|
1017
1019
|
rowOpts,
|
|
1018
|
-
loadingOpts
|
|
1020
|
+
loadingOpts,
|
|
1021
|
+
editRules
|
|
1019
1022
|
} = this
|
|
1020
1023
|
const { leftList, rightList } = columnStore
|
|
1021
1024
|
return h('div', {
|
|
1022
1025
|
class: ['vxe-table', 'vxe-table--render-default', `tid_${tId}`, vSize ? `size--${vSize}` : '', `border--${tableBorder}`, {
|
|
1026
|
+
[`vaild-msg--${validOpts.msgMode}`]: !!editRules,
|
|
1023
1027
|
'vxe-editable': !!editConfig,
|
|
1024
1028
|
'cell--highlight': highlightCell,
|
|
1025
1029
|
'cell--selected': mouseConfig && mouseOpts.selected,
|
|
@@ -18,7 +18,10 @@ export default {
|
|
|
18
18
|
name: String,
|
|
19
19
|
readonly: Boolean,
|
|
20
20
|
disabled: Boolean,
|
|
21
|
-
placeholder:
|
|
21
|
+
placeholder: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: () => XEUtils.eqNull(GlobalConfig.textarea.placeholder) ? GlobalConfig.i18n('vxe.base.pleaseInput') : GlobalConfig.textarea.placeholder
|
|
24
|
+
},
|
|
22
25
|
maxlength: [String, Number],
|
|
23
26
|
rows: { type: [String, Number], default: 2 },
|
|
24
27
|
cols: { type: [String, Number], default: null },
|
|
@@ -649,10 +649,16 @@ export default {
|
|
|
649
649
|
if ($xegrid) {
|
|
650
650
|
$xegrid.triggerToolbarBtnEvent(item, evnt)
|
|
651
651
|
} else {
|
|
652
|
-
const
|
|
652
|
+
const gCommandOpts = VXETable.commands.get(code)
|
|
653
653
|
const params = { code, button: item, $table: $xetable, $grid: $xegrid, $event: evnt }
|
|
654
|
-
if (
|
|
655
|
-
commandMethod
|
|
654
|
+
if (gCommandOpts) {
|
|
655
|
+
if (gCommandOpts.commandMethod) {
|
|
656
|
+
gCommandOpts.commandMethod(params)
|
|
657
|
+
} else {
|
|
658
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
659
|
+
errLog('vxe.error.notCommands', [code])
|
|
660
|
+
}
|
|
661
|
+
}
|
|
656
662
|
}
|
|
657
663
|
this.$emit('button-click', params)
|
|
658
664
|
}
|
|
@@ -665,10 +671,16 @@ export default {
|
|
|
665
671
|
if ($xegrid) {
|
|
666
672
|
$xegrid.triggerToolbarTolEvent(item, evnt)
|
|
667
673
|
} else {
|
|
668
|
-
const
|
|
674
|
+
const gCommandOpts = VXETable.commands.get(code)
|
|
669
675
|
const params = { code, tool: item, $xegrid, $table: $xetable, $event: evnt }
|
|
670
|
-
if (
|
|
671
|
-
commandMethod
|
|
676
|
+
if (gCommandOpts) {
|
|
677
|
+
if (gCommandOpts.commandMethod) {
|
|
678
|
+
gCommandOpts.commandMethod(params)
|
|
679
|
+
} else {
|
|
680
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
681
|
+
errLog('vxe.error.notCommands', [code])
|
|
682
|
+
}
|
|
683
|
+
}
|
|
672
684
|
}
|
|
673
685
|
this.$emit('tool-click', params)
|
|
674
686
|
}
|
|
@@ -5,6 +5,7 @@ import { renderer } from './src/renderer'
|
|
|
5
5
|
import { commands } from './src/commands'
|
|
6
6
|
import { menus } from './src/menus'
|
|
7
7
|
import { formats } from './src/formats'
|
|
8
|
+
import { validators } from './src/validators'
|
|
8
9
|
import { setup } from './src/setup'
|
|
9
10
|
import { UtilTools } from '../tools/utils'
|
|
10
11
|
import { errLog } from '../tools/log'
|
|
@@ -98,6 +99,7 @@ export const VXETable = {
|
|
|
98
99
|
commands,
|
|
99
100
|
formats,
|
|
100
101
|
menus,
|
|
102
|
+
validators,
|
|
101
103
|
config,
|
|
102
104
|
t,
|
|
103
105
|
_t
|
|
@@ -1,6 +1,52 @@
|
|
|
1
|
-
import
|
|
1
|
+
import XEUtils from 'xe-utils'
|
|
2
|
+
import { warnLog } from '../../tools/log'
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
class VXECommandsStore {
|
|
5
|
+
constructor () {
|
|
6
|
+
this.store = {}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
mixin (options) {
|
|
10
|
+
XEUtils.each(options, (item, key) => {
|
|
11
|
+
this.add(key, item)
|
|
12
|
+
})
|
|
13
|
+
return VXECommandsStore
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
get (name) {
|
|
17
|
+
return this.store[name]
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
add (name, render) {
|
|
21
|
+
const conf = this.store[name]
|
|
22
|
+
// 兼容
|
|
23
|
+
if (XEUtils.isFunction(render)) {
|
|
24
|
+
// warnLog('vxe.error.delProp', ['callback', 'commandMethod'])
|
|
25
|
+
render = {
|
|
26
|
+
commandMethod: render
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// 检测是否覆盖
|
|
31
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
32
|
+
const confKeys = XEUtils.keys(conf)
|
|
33
|
+
XEUtils.each(render, (item, key) => {
|
|
34
|
+
if (confKeys.includes(key)) {
|
|
35
|
+
warnLog('vxe.error.coverProp', [name, key])
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
this.store[name] = conf ? XEUtils.merge(conf, render) : render
|
|
40
|
+
return VXECommandsStore
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
delete (name) {
|
|
44
|
+
delete this.store[name]
|
|
45
|
+
return VXECommandsStore
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const commands = new VXECommandsStore()
|
|
4
50
|
|
|
5
51
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
6
52
|
Object.assign(commands, { _name: 'Commands' })
|
|
@@ -13,6 +13,7 @@ export default {
|
|
|
13
13
|
animat: true,
|
|
14
14
|
delayHover: 250,
|
|
15
15
|
autoResize: true,
|
|
16
|
+
minHeight: 144,
|
|
16
17
|
// keepSource: false,
|
|
17
18
|
// showOverflow: null,
|
|
18
19
|
// showHeaderOverflow: null,
|
|
@@ -46,7 +47,9 @@ export default {
|
|
|
46
47
|
},
|
|
47
48
|
validConfig: {
|
|
48
49
|
showMessage: true,
|
|
49
|
-
|
|
50
|
+
autoClear: true,
|
|
51
|
+
message: 'inline',
|
|
52
|
+
msgMode: 'single'
|
|
50
53
|
},
|
|
51
54
|
columnConfig: {
|
|
52
55
|
maxFixedSize: 4
|
|
@@ -1,6 +1,52 @@
|
|
|
1
|
-
import
|
|
1
|
+
import XEUtils from 'xe-utils'
|
|
2
|
+
import { warnLog } from '../../tools/log'
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
class VXEFormatsStore {
|
|
5
|
+
constructor () {
|
|
6
|
+
this.store = {}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
mixin (options) {
|
|
10
|
+
XEUtils.each(options, (item, key) => {
|
|
11
|
+
this.add(key, item)
|
|
12
|
+
})
|
|
13
|
+
return VXEFormatsStore
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
get (name) {
|
|
17
|
+
return this.store[name]
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
add (name, render) {
|
|
21
|
+
const conf = this.store[name]
|
|
22
|
+
// 兼容
|
|
23
|
+
if (XEUtils.isFunction(render)) {
|
|
24
|
+
// warnLog('vxe.error.delProp', ['callback', 'formatMethod'])
|
|
25
|
+
render = {
|
|
26
|
+
formatMethod: render
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// 检测是否覆盖
|
|
31
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
32
|
+
const confKeys = XEUtils.keys(conf)
|
|
33
|
+
XEUtils.each(render, (item, key) => {
|
|
34
|
+
if (confKeys.includes(key)) {
|
|
35
|
+
warnLog('vxe.error.coverProp', [name, key])
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
this.store[name] = conf ? XEUtils.merge(conf, render) : render
|
|
40
|
+
return VXEFormatsStore
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
delete (name) {
|
|
44
|
+
delete this.store[name]
|
|
45
|
+
return VXEFormatsStore
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const formats = new VXEFormatsStore()
|
|
4
50
|
|
|
5
51
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
6
52
|
Object.assign(formats, { _name: 'Formats' })
|
|
@@ -1,6 +1,52 @@
|
|
|
1
|
-
import
|
|
1
|
+
import XEUtils from 'xe-utils'
|
|
2
|
+
import { warnLog } from '../../tools/log'
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
class VXEMenusStore {
|
|
5
|
+
constructor () {
|
|
6
|
+
this.store = {}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
mixin (options) {
|
|
10
|
+
XEUtils.each(options, (item, key) => {
|
|
11
|
+
this.add(key, item)
|
|
12
|
+
})
|
|
13
|
+
return VXEMenusStore
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
get (name) {
|
|
17
|
+
return this.store[name]
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
add (name, render) {
|
|
21
|
+
const conf = this.store[name]
|
|
22
|
+
// 兼容
|
|
23
|
+
if (XEUtils.isFunction(render)) {
|
|
24
|
+
// warnLog('vxe.error.delProp', ['callback', 'menuMethod'])
|
|
25
|
+
render = {
|
|
26
|
+
menuMethod: render
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// 检测是否覆盖
|
|
31
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
32
|
+
const confKeys = XEUtils.keys(conf)
|
|
33
|
+
XEUtils.each(render, (item, key) => {
|
|
34
|
+
if (confKeys.includes(key)) {
|
|
35
|
+
warnLog('vxe.error.coverProp', [name, key])
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
}
|
|
39
|
+
this.store[name] = conf ? XEUtils.merge(conf, render) : render
|
|
40
|
+
return VXEMenusStore
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
delete (name) {
|
|
44
|
+
delete this.store[name]
|
|
45
|
+
return VXEMenusStore
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const menus = new VXEMenusStore()
|
|
4
50
|
|
|
5
51
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
6
52
|
Object.assign(menus, { _name: 'Menus' })
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
2
|
import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
3
3
|
import UtilTools, { getFuncText } from '../../tools/utils'
|
|
4
|
-
import { warnLog } from '../../tools/log'
|
|
4
|
+
import { errLog, warnLog } from '../../tools/log'
|
|
5
5
|
|
|
6
6
|
const defaultCompProps = { transfer: true }
|
|
7
7
|
|
|
@@ -103,6 +103,11 @@ function getNativeOns (renderOpts, params) {
|
|
|
103
103
|
const nativeOns = {}
|
|
104
104
|
XEUtils.objectEach(nativeEvents, (func, key) => {
|
|
105
105
|
nativeOns[key] = function (...args) {
|
|
106
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
107
|
+
if (!XEUtils.isFunction(key)) {
|
|
108
|
+
errLog('vxe.error.errFunc', [key])
|
|
109
|
+
}
|
|
110
|
+
}
|
|
106
111
|
func(params, ...args)
|
|
107
112
|
}
|
|
108
113
|
})
|
|
@@ -117,6 +122,11 @@ function getOns (renderOpts, params, inputFunc, changeFunc) {
|
|
|
117
122
|
const ons = {}
|
|
118
123
|
XEUtils.objectEach(events, (func, key) => {
|
|
119
124
|
ons[key] = function (...args) {
|
|
125
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
126
|
+
if (!XEUtils.isFunction(key)) {
|
|
127
|
+
errLog('vxe.error.errFunc', [key])
|
|
128
|
+
}
|
|
129
|
+
}
|
|
120
130
|
func(params, ...args)
|
|
121
131
|
}
|
|
122
132
|
})
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils'
|
|
2
|
+
import VXETable from '../../v-x-e-table'
|
|
2
3
|
import GlobalConfig from '../../v-x-e-table/src/conf'
|
|
3
4
|
import { eqEmptyValue, getFuncText } from '../../tools/utils'
|
|
5
|
+
import { warnLog, errLog } from '../../tools/log'
|
|
4
6
|
import DomTools from '../../tools/dom'
|
|
5
7
|
|
|
6
8
|
/**
|
|
@@ -248,10 +250,10 @@ export default {
|
|
|
248
250
|
if (rules) {
|
|
249
251
|
const cellValue = XEUtils.isUndefined(val) ? XEUtils.get(row, property) : val
|
|
250
252
|
rules.forEach(rule => {
|
|
251
|
-
const { type, trigger, required } = rule
|
|
253
|
+
const { type, trigger, required, validator } = rule
|
|
252
254
|
if (validType === 'all' || !trigger || validType === trigger) {
|
|
253
|
-
if (
|
|
254
|
-
const
|
|
255
|
+
if (validator) {
|
|
256
|
+
const validParams = {
|
|
255
257
|
cellValue,
|
|
256
258
|
rule,
|
|
257
259
|
rules,
|
|
@@ -261,7 +263,26 @@ export default {
|
|
|
261
263
|
columnIndex: this.getColumnIndex(column),
|
|
262
264
|
field: column.property,
|
|
263
265
|
$table: this
|
|
264
|
-
}
|
|
266
|
+
}
|
|
267
|
+
let customValid
|
|
268
|
+
if (XEUtils.isString(validator)) {
|
|
269
|
+
const gvItem = VXETable.validators.get(validator)
|
|
270
|
+
if (gvItem) {
|
|
271
|
+
if (gvItem.cellValidatorMethod) {
|
|
272
|
+
customValid = gvItem.cellValidatorMethod(validParams)
|
|
273
|
+
} else {
|
|
274
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
275
|
+
warnLog('vxe.error.notValidators', [validator])
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
} else {
|
|
279
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
280
|
+
errLog('vxe.error.notValidators', [validator])
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
} else {
|
|
284
|
+
customValid = validator(validParams)
|
|
285
|
+
}
|
|
265
286
|
if (customValid) {
|
|
266
287
|
if (XEUtils.isError(customValid)) {
|
|
267
288
|
this.validRuleErr = true
|
package/styles/all.scss
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
@import './variable.scss';
|
|
2
|
+
// @import './css-variable.scss';
|
|
3
|
+
@import './icon.scss';
|
|
4
|
+
@import './filter.scss';
|
|
5
|
+
@import './menu.scss';
|
|
6
|
+
@import './export.scss';
|
|
7
|
+
|
|
8
|
+
@import './table.scss';
|
|
9
|
+
@import './grid.scss';
|
|
10
|
+
@import './toolbar.scss';
|
|
11
|
+
@import './pager.scss';
|
|
12
|
+
@import './checkbox.scss';
|
|
13
|
+
@import './checkbox-group.scss';
|
|
14
|
+
@import './radio.scss';
|
|
15
|
+
@import './radio-group.scss';
|
|
16
|
+
@import './radio-button.scss';
|
|
17
|
+
@import './input.scss';
|
|
18
|
+
@import './textarea.scss';
|
|
19
|
+
@import './button.scss';
|
|
20
|
+
@import './modal.scss';
|
|
21
|
+
@import './tooltip.scss';
|
|
22
|
+
@import './form.scss';
|
|
23
|
+
@import './form-item.scss';
|
|
24
|
+
@import './form-gather.scss';
|
|
25
|
+
@import './select.scss';
|
|
26
|
+
@import './optgroup.scss';
|
|
27
|
+
@import './option.scss';
|
|
28
|
+
@import './switch.scss';
|
|
29
|
+
@import './list.scss';
|
|
30
|
+
@import './pulldown.scss';
|