vxe-table 3.7.0-beta.1 → 3.7.0-beta.11
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/helper/vetur/attributes.json +86 -22
- package/helper/vetur/tags.json +17 -1
- package/lib/button/src/button.js +9 -3
- package/lib/button/src/button.min.js +1 -1
- package/lib/edit/src/mixin.js +10 -10
- package/lib/edit/src/mixin.min.js +1 -1
- package/lib/export/src/mixin.js +24 -13
- package/lib/export/src/mixin.min.js +1 -1
- package/lib/filter/src/mixin.js +13 -7
- package/lib/filter/src/mixin.min.js +1 -1
- package/lib/form/src/form.js +27 -5
- 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 +559 -229
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +11 -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/pulldown/src/pulldown.js +11 -2
- package/lib/pulldown/src/pulldown.min.js +1 -1
- package/lib/select/src/select.js +11 -2
- 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/body.js +3 -2
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +9 -7
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/columnInfo.js +7 -7
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/methods.js +171 -124
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +22 -29
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +3 -1
- package/lib/table/src/util.min.js +1 -1
- package/lib/table/style/style.css +7 -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 +23 -7
- 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/tooltip/src/tooltip.js +5 -1
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/tooltip/style/style.css +0 -6
- package/lib/tooltip/style/style.min.css +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 +60 -2
- package/lib/v-x-e-table/src/commands.min.js +1 -1
- package/lib/v-x-e-table/src/conf.js +7 -4
- package/lib/v-x-e-table/src/conf.min.js +1 -1
- package/lib/v-x-e-table/src/formats.js +60 -2
- package/lib/v-x-e-table/src/formats.min.js +1 -1
- package/lib/v-x-e-table/src/menus.js +60 -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 +36 -4
- package/lib/validator/src/mixin.min.js +1 -1
- package/package.json +2 -2
- package/packages/button/src/button.js +5 -4
- package/packages/edit/src/mixin.js +10 -9
- package/packages/export/src/mixin.js +22 -13
- package/packages/filter/src/mixin.js +5 -1
- package/packages/form/src/form.js +27 -6
- package/packages/grid/src/grid.js +7 -3
- package/packages/input/src/input.js +9 -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/pulldown/src/pulldown.js +6 -3
- package/packages/select/src/select.js +7 -3
- package/packages/table/src/body.js +3 -2
- package/packages/table/src/cell.js +9 -5
- package/packages/table/src/columnInfo.js +7 -7
- package/packages/table/src/methods.js +142 -93
- package/packages/table/src/table.js +17 -7
- package/packages/table/src/util.js +3 -1
- package/packages/textarea/src/textarea.js +4 -1
- package/packages/toolbar/src/toolbar.js +22 -7
- package/packages/tooltip/src/tooltip.js +3 -2
- package/packages/v-x-e-table/index.js +2 -0
- package/packages/v-x-e-table/src/commands.js +50 -2
- package/packages/v-x-e-table/src/conf.js +7 -4
- package/packages/v-x-e-table/src/formats.js +50 -2
- package/packages/v-x-e-table/src/menus.js +50 -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 +35 -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 +11 -4
- package/styles/tooltip.scss +0 -8
- package/styles/variable.scss +1 -4
- package/types/all.d.ts +2 -2
- package/types/colgroup.d.ts +3 -1
- package/types/column.d.ts +3 -0
- package/types/edit.d.ts +4 -2
- package/types/export.d.ts +3 -0
- package/types/filter.d.ts +3 -1
- package/types/footer.d.ts +3 -1
- package/types/form-item.d.ts +2 -0
- package/types/form.d.ts +16 -12
- package/types/grid.d.ts +3 -0
- package/types/header.d.ts +3 -1
- package/types/index.d.ts +1 -1
- package/types/input.d.ts +2 -0
- package/types/list.d.ts +1 -1
- package/types/menu.d.ts +2 -0
- package/types/modal.d.ts +7 -3
- package/types/pulldown.d.ts +2 -3
- package/types/table.d.ts +54 -30
- package/types/textarea.d.ts +1 -0
- package/types/toolbar.d.ts +2 -0
- package/types/tooltip.d.ts +1 -1
- package/types/v-x-e-table/commands.d.ts +23 -13
- package/types/v-x-e-table/formats.d.ts +21 -12
- package/types/v-x-e-table/index.d.ts +33 -26
- package/types/v-x-e-table/interceptor.d.ts +1 -1
- package/types/v-x-e-table/menus.d.ts +17 -6
- package/types/v-x-e-table/renderer.d.ts +5 -3
- package/types/v-x-e-table/setup.d.ts +10 -33
- package/types/v-x-e-table/validators.d.ts +30 -0
- package/types/validator.d.ts +15 -4
- /package/lib/icon/style/{iconfont.1688948811910.ttf → iconfont.1691021948915.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1688948811910.woff → iconfont.1691021948915.woff} +0 -0
- /package/lib/icon/style/{iconfont.1688948811910.woff2 → iconfont.1691021948915.woff2} +0 -0
- /package/lib/{iconfont.1688948811910.ttf → iconfont.1691021948915.ttf} +0 -0
- /package/lib/{iconfont.1688948811910.woff → iconfont.1691021948915.woff} +0 -0
- /package/lib/{iconfont.1688948811910.woff2 → iconfont.1691021948915.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 替换
|
|
@@ -303,7 +305,7 @@ export default {
|
|
|
303
305
|
// 复选框属性,有选中且非全选状态
|
|
304
306
|
isIndeterminate: false,
|
|
305
307
|
// 复选框属性,已选中的行
|
|
306
|
-
|
|
308
|
+
selectCheckboxRows: [],
|
|
307
309
|
// 当前行
|
|
308
310
|
currentRow: null,
|
|
309
311
|
// 单选框属性,选中列
|
|
@@ -773,7 +775,7 @@ export default {
|
|
|
773
775
|
if (this.editConfig && editOpts.showStatus && !this.keepSource) {
|
|
774
776
|
warnLog('vxe.error.reqProp', ['keep-source'])
|
|
775
777
|
}
|
|
776
|
-
if (treeConfig && treeOpts.line && (!(this.rowKey || rowOpts.useKey) || !showOverflow)) {
|
|
778
|
+
if (treeConfig && (treeOpts.showLine || treeOpts.line) && (!(this.rowKey || rowOpts.useKey) || !showOverflow)) {
|
|
777
779
|
warnLog('vxe.error.reqProp', ['row-config.useKey | show-overflow'])
|
|
778
780
|
}
|
|
779
781
|
if (this.showFooter && !this.footerMethod) {
|
|
@@ -830,6 +832,12 @@ export default {
|
|
|
830
832
|
return
|
|
831
833
|
}
|
|
832
834
|
}
|
|
835
|
+
if (this.treeConfig && treeOpts.children) {
|
|
836
|
+
warnLog('vxe.error.delProp', ['tree-config.children', 'tree-config.childrenField'])
|
|
837
|
+
}
|
|
838
|
+
if (this.treeConfig && treeOpts.line) {
|
|
839
|
+
warnLog('vxe.error.delProp', ['tree-config.line', 'tree-config.showLine'])
|
|
840
|
+
}
|
|
833
841
|
if (this.mouseOpts.area && this.mouseOpts.selected) {
|
|
834
842
|
warnLog('vxe.error.errConflicts', ['mouse-config.area', 'mouse-config.selected'])
|
|
835
843
|
}
|
|
@@ -874,9 +882,9 @@ export default {
|
|
|
874
882
|
if (this.emptyRender && !XEUtils.isObject(this.emptyRender)) {
|
|
875
883
|
warnLog('vxe.error.errProp', [`table.empty-render=${this.emptyRender}`, 'table.empty-render={}'])
|
|
876
884
|
}
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
885
|
+
if (this.editConfig && this.editOpts.activeMethod) {
|
|
886
|
+
warnLog('vxe.error.delProp', ['table.edit-config.activeMethod', 'table.edit-config.beforeEditMethod'])
|
|
887
|
+
}
|
|
880
888
|
}
|
|
881
889
|
|
|
882
890
|
// 检查是否有安装需要的模块
|
|
@@ -1015,11 +1023,13 @@ export default {
|
|
|
1015
1023
|
hasTip,
|
|
1016
1024
|
columnOpts,
|
|
1017
1025
|
rowOpts,
|
|
1018
|
-
loadingOpts
|
|
1026
|
+
loadingOpts,
|
|
1027
|
+
editRules
|
|
1019
1028
|
} = this
|
|
1020
1029
|
const { leftList, rightList } = columnStore
|
|
1021
1030
|
return h('div', {
|
|
1022
1031
|
class: ['vxe-table', 'vxe-table--render-default', `tid_${tId}`, vSize ? `size--${vSize}` : '', `border--${tableBorder}`, {
|
|
1032
|
+
[`vaild-msg--${validOpts.msgMode}`]: !!editRules,
|
|
1023
1033
|
'vxe-editable': !!editConfig,
|
|
1024
1034
|
'cell--highlight': highlightCell,
|
|
1025
1035
|
'cell--selected': mouseConfig && mouseOpts.selected,
|
|
@@ -1029,7 +1039,7 @@ export default {
|
|
|
1029
1039
|
'is--header': showHeader,
|
|
1030
1040
|
'is--footer': showFooter,
|
|
1031
1041
|
'is--group': isGroup,
|
|
1032
|
-
'is--tree-line': treeConfig && treeOpts.line,
|
|
1042
|
+
'is--tree-line': treeConfig && (treeOpts.showLine || treeOpts.line),
|
|
1033
1043
|
'is--fixed-left': leftList.length,
|
|
1034
1044
|
'is--fixed-right': rightList.length,
|
|
1035
1045
|
'is--animat': !!this.animat,
|
|
@@ -157,7 +157,9 @@ function countTreeExpand (prevRow, params) {
|
|
|
157
157
|
return count
|
|
158
158
|
}
|
|
159
159
|
const { $table } = params
|
|
160
|
-
const
|
|
160
|
+
const { treeOpts } = $table
|
|
161
|
+
const childrenField = treeOpts.children || treeOpts.childrenField
|
|
162
|
+
const rowChildren = prevRow[childrenField]
|
|
161
163
|
if ($table.isTreeExpandByRow(prevRow)) {
|
|
162
164
|
for (let index = 0; index < rowChildren.length; index++) {
|
|
163
165
|
count += countTreeExpand(rowChildren[index], params)
|
|
@@ -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 },
|
|
@@ -352,7 +352,7 @@ export default {
|
|
|
352
352
|
}
|
|
353
353
|
},
|
|
354
354
|
created () {
|
|
355
|
-
const { refresh, refreshOpts } = this
|
|
355
|
+
const { refresh, refreshOpts, customOpts } = this
|
|
356
356
|
this.$nextTick(() => {
|
|
357
357
|
const $xetable = this.fintTable()
|
|
358
358
|
const queryMethod = refreshOpts.queryMethod || refreshOpts.query
|
|
@@ -363,6 +363,9 @@ export default {
|
|
|
363
363
|
$xetable.connect(this)
|
|
364
364
|
}
|
|
365
365
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
366
|
+
if (customOpts.isFooter) {
|
|
367
|
+
warnLog('vxe.error.notValidators', ['custom.isFooter', 'custom.showFooter'])
|
|
368
|
+
}
|
|
366
369
|
if (this.buttons) {
|
|
367
370
|
this.buttons.forEach(item => {
|
|
368
371
|
const { buttonRender } = item
|
|
@@ -649,10 +652,16 @@ export default {
|
|
|
649
652
|
if ($xegrid) {
|
|
650
653
|
$xegrid.triggerToolbarBtnEvent(item, evnt)
|
|
651
654
|
} else {
|
|
652
|
-
const
|
|
655
|
+
const gCommandOpts = VXETable.commands.get(code)
|
|
653
656
|
const params = { code, button: item, $table: $xetable, $grid: $xegrid, $event: evnt }
|
|
654
|
-
if (
|
|
655
|
-
commandMethod
|
|
657
|
+
if (gCommandOpts) {
|
|
658
|
+
if (gCommandOpts.commandMethod) {
|
|
659
|
+
gCommandOpts.commandMethod(params)
|
|
660
|
+
} else {
|
|
661
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
662
|
+
errLog('vxe.error.notCommands', [code])
|
|
663
|
+
}
|
|
664
|
+
}
|
|
656
665
|
}
|
|
657
666
|
this.$emit('button-click', params)
|
|
658
667
|
}
|
|
@@ -665,10 +674,16 @@ export default {
|
|
|
665
674
|
if ($xegrid) {
|
|
666
675
|
$xegrid.triggerToolbarTolEvent(item, evnt)
|
|
667
676
|
} else {
|
|
668
|
-
const
|
|
677
|
+
const gCommandOpts = VXETable.commands.get(code)
|
|
669
678
|
const params = { code, tool: item, $xegrid, $table: $xetable, $event: evnt }
|
|
670
|
-
if (
|
|
671
|
-
commandMethod
|
|
679
|
+
if (gCommandOpts) {
|
|
680
|
+
if (gCommandOpts.commandMethod) {
|
|
681
|
+
gCommandOpts.commandMethod(params)
|
|
682
|
+
} else {
|
|
683
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
684
|
+
errLog('vxe.error.notCommands', [code])
|
|
685
|
+
}
|
|
686
|
+
}
|
|
672
687
|
}
|
|
673
688
|
this.$emit('tool-click', params)
|
|
674
689
|
}
|
|
@@ -75,6 +75,7 @@ export default {
|
|
|
75
75
|
content: { type: [String, Number], default: null },
|
|
76
76
|
useHTML: Boolean,
|
|
77
77
|
zIndex: [String, Number],
|
|
78
|
+
popupClassName: [String, Function],
|
|
78
79
|
isArrow: { type: Boolean, default: true },
|
|
79
80
|
enterable: Boolean,
|
|
80
81
|
enterDelay: { type: Number, default: () => GlobalConfig.tooltip.enterDelay },
|
|
@@ -159,7 +160,7 @@ export default {
|
|
|
159
160
|
}
|
|
160
161
|
},
|
|
161
162
|
render (h) {
|
|
162
|
-
const { $scopedSlots, vSize, theme, tipActive, isArrow, visible, tipStore, enterable } = this
|
|
163
|
+
const { $scopedSlots, vSize, popupClassName, theme, tipActive, isArrow, visible, tipStore, enterable } = this
|
|
163
164
|
let on
|
|
164
165
|
if (enterable) {
|
|
165
166
|
on = {
|
|
@@ -168,7 +169,7 @@ export default {
|
|
|
168
169
|
}
|
|
169
170
|
}
|
|
170
171
|
return h('div', {
|
|
171
|
-
class: ['vxe-table--tooltip-wrapper', `theme--${theme}`, {
|
|
172
|
+
class: ['vxe-table--tooltip-wrapper', `theme--${theme}`, popupClassName ? (XEUtils.isFunction(popupClassName) ? popupClassName({ $tooltip: this }) : popupClassName) : '', {
|
|
172
173
|
[`size--${vSize}`]: vSize,
|
|
173
174
|
[`placement--${tipStore.placement}`]: tipStore.placement,
|
|
174
175
|
'is--enterable': enterable,
|
|
@@ -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,54 @@
|
|
|
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
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
25
|
+
warnLog('vxe.error.delProp', ['callback', 'commandMethod'])
|
|
26
|
+
}
|
|
27
|
+
render = {
|
|
28
|
+
commandMethod: render
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// 检测是否覆盖
|
|
33
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
34
|
+
const confKeys = XEUtils.keys(conf)
|
|
35
|
+
XEUtils.each(render, (item, key) => {
|
|
36
|
+
if (confKeys.includes(key)) {
|
|
37
|
+
warnLog('vxe.error.coverProp', [name, key])
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
this.store[name] = conf ? XEUtils.merge(conf, render) : render
|
|
42
|
+
return VXECommandsStore
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
delete (name) {
|
|
46
|
+
delete this.store[name]
|
|
47
|
+
return VXECommandsStore
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const commands = new VXECommandsStore()
|
|
4
52
|
|
|
5
53
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
6
54
|
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
|
|
@@ -73,9 +76,9 @@ export default {
|
|
|
73
76
|
treeConfig: {
|
|
74
77
|
rowField: 'id',
|
|
75
78
|
parentField: 'parentId',
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
childrenField: 'children',
|
|
80
|
+
hasChildField: 'hasChild',
|
|
81
|
+
mapChildrenField: '_X_ROW_CHILD',
|
|
79
82
|
indent: 20,
|
|
80
83
|
showIcon: true
|
|
81
84
|
},
|
|
@@ -1,6 +1,54 @@
|
|
|
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
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
25
|
+
warnLog('vxe.error.delProp', ['callback', 'cellFormatMethod'])
|
|
26
|
+
}
|
|
27
|
+
render = {
|
|
28
|
+
cellFormatMethod: render
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// 检测是否覆盖
|
|
33
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
34
|
+
const confKeys = XEUtils.keys(conf)
|
|
35
|
+
XEUtils.each(render, (item, key) => {
|
|
36
|
+
if (confKeys.includes(key)) {
|
|
37
|
+
warnLog('vxe.error.coverProp', [name, key])
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
this.store[name] = conf ? XEUtils.merge(conf, render) : render
|
|
42
|
+
return VXEFormatsStore
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
delete (name) {
|
|
46
|
+
delete this.store[name]
|
|
47
|
+
return VXEFormatsStore
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const formats = new VXEFormatsStore()
|
|
4
52
|
|
|
5
53
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
6
54
|
Object.assign(formats, { _name: 'Formats' })
|
|
@@ -1,6 +1,54 @@
|
|
|
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
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
25
|
+
warnLog('vxe.error.delProp', ['callback', 'menuMethod'])
|
|
26
|
+
}
|
|
27
|
+
render = {
|
|
28
|
+
menuMethod: render
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// 检测是否覆盖
|
|
33
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
34
|
+
const confKeys = XEUtils.keys(conf)
|
|
35
|
+
XEUtils.each(render, (item, key) => {
|
|
36
|
+
if (confKeys.includes(key)) {
|
|
37
|
+
warnLog('vxe.error.coverProp', [name, key])
|
|
38
|
+
}
|
|
39
|
+
})
|
|
40
|
+
}
|
|
41
|
+
this.store[name] = conf ? XEUtils.merge(conf, render) : render
|
|
42
|
+
return VXEMenusStore
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
delete (name) {
|
|
46
|
+
delete this.store[name]
|
|
47
|
+
return VXEMenusStore
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const menus = new VXEMenusStore()
|
|
4
52
|
|
|
5
53
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
6
54
|
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
|
/**
|
|
@@ -63,12 +65,22 @@ export default {
|
|
|
63
65
|
* 完整校验,和 validate 的区别就是会给有效数据中的每一行进行校验
|
|
64
66
|
*/
|
|
65
67
|
_fullValidate (rows, cb) {
|
|
68
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
69
|
+
if (XEUtils.isFunction(cb)) {
|
|
70
|
+
warnLog('vxe.error.notValidators', ['fullValidate(rows, callback)', 'fullValidate(rows)'])
|
|
71
|
+
}
|
|
72
|
+
}
|
|
66
73
|
return this.beginValidate(rows, cb, true)
|
|
67
74
|
},
|
|
68
75
|
/**
|
|
69
76
|
* 快速校验,如果存在记录不通过的记录,则返回不再继续校验(异步校验除外)
|
|
70
77
|
*/
|
|
71
78
|
_validate (rows, cb) {
|
|
79
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
80
|
+
if (XEUtils.isFunction(cb)) {
|
|
81
|
+
warnLog('vxe.error.notValidators', ['validate(rows, callback)', 'validate(rows)'])
|
|
82
|
+
}
|
|
83
|
+
}
|
|
72
84
|
return this.beginValidate(rows, cb)
|
|
73
85
|
},
|
|
74
86
|
/**
|
|
@@ -248,10 +260,10 @@ export default {
|
|
|
248
260
|
if (rules) {
|
|
249
261
|
const cellValue = XEUtils.isUndefined(val) ? XEUtils.get(row, property) : val
|
|
250
262
|
rules.forEach(rule => {
|
|
251
|
-
const { type, trigger, required } = rule
|
|
263
|
+
const { type, trigger, required, validator } = rule
|
|
252
264
|
if (validType === 'all' || !trigger || validType === trigger) {
|
|
253
|
-
if (
|
|
254
|
-
const
|
|
265
|
+
if (validator) {
|
|
266
|
+
const validParams = {
|
|
255
267
|
cellValue,
|
|
256
268
|
rule,
|
|
257
269
|
rules,
|
|
@@ -261,7 +273,26 @@ export default {
|
|
|
261
273
|
columnIndex: this.getColumnIndex(column),
|
|
262
274
|
field: column.property,
|
|
263
275
|
$table: this
|
|
264
|
-
}
|
|
276
|
+
}
|
|
277
|
+
let customValid
|
|
278
|
+
if (XEUtils.isString(validator)) {
|
|
279
|
+
const gvItem = VXETable.validators.get(validator)
|
|
280
|
+
if (gvItem) {
|
|
281
|
+
if (gvItem.cellValidatorMethod) {
|
|
282
|
+
customValid = gvItem.cellValidatorMethod(validParams)
|
|
283
|
+
} else {
|
|
284
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
285
|
+
warnLog('vxe.error.notValidators', [validator])
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
} else {
|
|
289
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
290
|
+
errLog('vxe.error.notValidators', [validator])
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
} else {
|
|
294
|
+
customValid = validator(validParams)
|
|
295
|
+
}
|
|
265
296
|
if (customValid) {
|
|
266
297
|
if (XEUtils.isError(customValid)) {
|
|
267
298
|
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';
|