vxe-table 4.5.0-beta.11 → 4.5.0-beta.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.
- package/README.en.md +1 -1
- package/README.md +1 -1
- package/README.zh-TW.md +1 -1
- package/es/footer/src/footer.js +5 -1
- package/es/form/src/form.js +27 -5
- package/es/icon/style.css +1 -1
- package/es/input/src/input.js +4 -1
- package/es/locale/lang/en-US.js +4 -0
- package/es/locale/lang/es-ES.js +5 -0
- package/es/locale/lang/ja-JP.js +5 -0
- package/es/locale/lang/zh-CN.js +5 -0
- package/es/locale/lang/zh-TC.js +5 -0
- package/es/menu/src/hooks.js +3 -3
- package/es/select/src/select.js +4 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/src/body.js +7 -3
- package/es/table/src/table.js +30 -7
- package/es/table/style.css +14 -3
- package/es/textarea/src/textarea.js +4 -1
- package/es/tools/log.js +1 -1
- package/es/tooltip/style.css +0 -6
- package/es/v-x-e-table/index.js +4 -1
- package/es/v-x-e-table/src/conf.js +4 -1
- package/es/v-x-e-table/src/menus.js +48 -2
- package/es/v-x-e-table/src/store.js +4 -1
- package/es/v-x-e-table/src/validators.js +5 -0
- package/es/validator/src/hook.js +100 -22
- package/es/vxe-table/style.css +14 -3
- package/es/vxe-tooltip/style.css +0 -6
- package/lib/footer/src/footer.js +6 -1
- package/lib/footer/src/footer.min.js +1 -1
- package/lib/form/src/form.js +24 -4
- package/lib/form/src/form.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +271 -48
- 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 +4 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +4 -0
- package/lib/locale/lang/es-ES.js +5 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +5 -0
- package/lib/locale/lang/ja-JP.js +5 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +5 -0
- package/lib/locale/lang/zh-CN.js +5 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +5 -0
- package/lib/locale/lang/zh-HK.min.js +1 -1
- package/lib/locale/lang/zh-HK.umd.js +5 -0
- package/lib/locale/lang/zh-MO.min.js +1 -1
- package/lib/locale/lang/zh-MO.umd.js +5 -0
- package/lib/locale/lang/zh-TC.js +5 -0
- package/lib/locale/lang/zh-TC.min.js +1 -1
- package/lib/locale/lang/zh-TC.umd.js +5 -0
- package/lib/locale/lang/zh-TW.min.js +1 -1
- package/lib/locale/lang/zh-TW.umd.js +5 -0
- package/lib/menu/src/hooks.js +3 -3
- package/lib/menu/src/hooks.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/body.js +8 -2
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/table.js +38 -9
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +14 -3
- 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/tools/log.js +1 -1
- package/lib/tools/log.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 +14 -1
- package/lib/v-x-e-table/index.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/menus.js +48 -2
- package/lib/v-x-e-table/src/menus.min.js +1 -1
- package/lib/v-x-e-table/src/store.js +4 -1
- 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/hook.js +94 -20
- package/lib/validator/src/hook.min.js +1 -1
- package/lib/vxe-table/style/style.css +14 -3
- package/lib/vxe-table/style/style.min.css +1 -1
- package/lib/vxe-tooltip/style/style.css +0 -6
- package/lib/vxe-tooltip/style/style.min.css +1 -1
- package/package.json +2 -2
- package/packages/footer/src/footer.ts +5 -1
- package/packages/form/src/form.ts +24 -5
- package/packages/input/src/input.ts +4 -1
- package/packages/locale/lang/en-US.ts +4 -0
- package/packages/locale/lang/es-ES.ts +5 -0
- package/packages/locale/lang/ja-JP.ts +5 -0
- package/packages/locale/lang/zh-CN.ts +5 -0
- package/packages/locale/lang/zh-TC.ts +5 -0
- package/packages/menu/src/hooks.ts +3 -3
- package/packages/select/src/select.ts +4 -1
- package/packages/table/src/body.ts +7 -3
- package/packages/table/src/table.ts +34 -7
- package/packages/textarea/src/textarea.ts +4 -1
- package/packages/v-x-e-table/index.ts +3 -0
- package/packages/v-x-e-table/src/conf.ts +4 -1
- package/packages/v-x-e-table/src/menus.ts +52 -2
- package/packages/v-x-e-table/src/store.ts +3 -1
- package/packages/v-x-e-table/src/validators.ts +9 -0
- package/packages/validator/src/hook.ts +117 -36
- package/styles/cssvar.scss +1 -2
- package/styles/table.scss +27 -6
- package/styles/tooltip.scss +0 -8
- package/styles/variable.scss +1 -2
- package/types/form.d.ts +9 -12
- package/types/table.d.ts +20 -1
- package/types/v-x-e-table/index.d.ts +8 -1
- package/types/v-x-e-table/menus.d.ts +19 -7
- package/types/v-x-e-table/validators.d.ts +30 -0
- package/types/validator.d.ts +14 -1
- /package/es/icon/style/{iconfont.1689813279210.ttf → iconfont.1690032028705.ttf} +0 -0
- /package/es/icon/style/{iconfont.1689813279210.woff → iconfont.1690032028705.woff} +0 -0
- /package/es/icon/style/{iconfont.1689813279210.woff2 → iconfont.1690032028705.woff2} +0 -0
- /package/es/{iconfont.1689813279210.ttf → iconfont.1690032028705.ttf} +0 -0
- /package/es/{iconfont.1689813279210.woff → iconfont.1690032028705.woff} +0 -0
- /package/es/{iconfont.1689813279210.woff2 → iconfont.1690032028705.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1689813279210.ttf → iconfont.1690032028705.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1689813279210.woff → iconfont.1690032028705.woff} +0 -0
- /package/lib/icon/style/{iconfont.1689813279210.woff2 → iconfont.1690032028705.woff2} +0 -0
- /package/lib/{iconfont.1689813279210.ttf → iconfont.1690032028705.ttf} +0 -0
- /package/lib/{iconfont.1689813279210.woff → iconfont.1690032028705.woff} +0 -0
- /package/lib/{iconfont.1689813279210.woff2 → iconfont.1690032028705.woff2} +0 -0
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
vxe: {
|
|
3
|
+
base: {
|
|
4
|
+
pleaseInput: 'Please input',
|
|
5
|
+
pleaseSelect: 'Select'
|
|
6
|
+
},
|
|
3
7
|
loading: {
|
|
4
8
|
text: 'Cargando...'
|
|
5
9
|
},
|
|
@@ -19,6 +23,7 @@ export default {
|
|
|
19
23
|
errProp: 'Parámetro no compatible "{0}", posiblemente "{1}".',
|
|
20
24
|
colRepet: 'columna.{0}="{0}" está duplicado, lo que puede hacer que algunas funciones sean inutilizables',
|
|
21
25
|
notFunc: 'El método "{0}" no existe.',
|
|
26
|
+
notValidators: 'Global validators "{0}" no existe.',
|
|
22
27
|
notSlot: 'La ranura "{0}" no existe.',
|
|
23
28
|
noTree: 'La estructura de árbol no soporta "{0}".',
|
|
24
29
|
notProp: 'Parámetros no compatibles "{0}"',
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
vxe: {
|
|
3
|
+
base: {
|
|
4
|
+
pleaseInput: 'Please input',
|
|
5
|
+
pleaseSelect: 'Select'
|
|
6
|
+
},
|
|
3
7
|
loading: {
|
|
4
8
|
text: 'Loading...'
|
|
5
9
|
},
|
|
@@ -19,6 +23,7 @@ export default {
|
|
|
19
23
|
errProp: 'サポートされていないパラメーター "{0}","{1}" の可能性があります',
|
|
20
24
|
colRepet: 'column.{0}="{0}" が重複しているため、機能が使えなくなることがあります。',
|
|
21
25
|
notFunc: 'method "{0}" はありません',
|
|
26
|
+
notValidators: 'Global validators "{0}" no existe.',
|
|
22
27
|
notSlot: 'slot "{0}" はありません',
|
|
23
28
|
noTree: 'Tree structureは "{0}" をサポートしていません',
|
|
24
29
|
notProp: 'サポートされていないパラメータ "{0}"',
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
vxe: {
|
|
3
|
+
base: {
|
|
4
|
+
pleaseInput: '请输入',
|
|
5
|
+
pleaseSelect: '请选择'
|
|
6
|
+
},
|
|
3
7
|
loading: {
|
|
4
8
|
text: '加载中...'
|
|
5
9
|
},
|
|
@@ -19,6 +23,7 @@ export default {
|
|
|
19
23
|
errProp: '不支持的参数 "{0}",可能为 "{1}"',
|
|
20
24
|
colRepet: 'column.{0}="{1}" 重复了,这可能会导致某些功能无法使用',
|
|
21
25
|
notFunc: '方法 "{0}" 不存在',
|
|
26
|
+
notValidators: '全局校验 "{0}" 不存在',
|
|
22
27
|
notSlot: '插槽 "{0}" 不存在',
|
|
23
28
|
noTree: '树结构不支持 "{0}"',
|
|
24
29
|
notProp: '不支持的参数 "{0}"',
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
vxe: {
|
|
3
|
+
base: {
|
|
4
|
+
pleaseInput: '请输入',
|
|
5
|
+
pleaseSelect: '请选择'
|
|
6
|
+
},
|
|
3
7
|
loading: {
|
|
4
8
|
text: '加載中...'
|
|
5
9
|
},
|
|
@@ -19,6 +23,7 @@ export default {
|
|
|
19
23
|
errProp: '不支持的參數 "{0}",可能為 "{1}"',
|
|
20
24
|
colRepet: 'column.{0}="{1}" 重複了,這可能會導致某些功能無法使用',
|
|
21
25
|
notFunc: '方法 "{0}" 不存在',
|
|
26
|
+
notValidators: '全局校验 "{0}" 不存在',
|
|
22
27
|
notSlot: '插槽 "{0}" 不存在',
|
|
23
28
|
noTree: '樹狀結構不支援 {0}',
|
|
24
29
|
notProp: '不支持的參數 "{0}"',
|
|
@@ -279,10 +279,10 @@ const tableMenuHook: VxeGlobalHooksHandles.HookOptions = {
|
|
|
279
279
|
ctxMenuLinkEvent (evnt, menu) {
|
|
280
280
|
// 如果一级菜单有配置 code 则允许点击,否则不能点击
|
|
281
281
|
if (!menu.disabled && (menu.code || !menu.children || !menu.children.length)) {
|
|
282
|
-
const
|
|
282
|
+
const gMenuOpts = VXETable.menus.get(menu.code)
|
|
283
283
|
const params = Object.assign({}, internalData._currMenuParams, { menu, $table: $xetable, $grid: $xetable.xegrid, $event: evnt })
|
|
284
|
-
if (
|
|
285
|
-
|
|
284
|
+
if (gMenuOpts && gMenuOpts.menuMethod) {
|
|
285
|
+
gMenuOpts.menuMethod(params, evnt)
|
|
286
286
|
}
|
|
287
287
|
$xetable.dispatchEvent('menu-click', params, evnt)
|
|
288
288
|
menuMethods.closeMenu()
|
|
@@ -23,7 +23,10 @@ export default defineComponent({
|
|
|
23
23
|
props: {
|
|
24
24
|
modelValue: null,
|
|
25
25
|
clearable: Boolean as PropType<VxeSelectPropTypes.Clearable>,
|
|
26
|
-
placeholder:
|
|
26
|
+
placeholder: {
|
|
27
|
+
type: String as PropType<VxeSelectPropTypes.Placeholder>,
|
|
28
|
+
default: () => XEUtils.eqNull(GlobalConfig.select.placeholder) ? GlobalConfig.i18n('vxe.base.pleaseSelect') : GlobalConfig.select.placeholder
|
|
29
|
+
},
|
|
27
30
|
loading: Boolean as PropType<VxeSelectPropTypes.Loading>,
|
|
28
31
|
disabled: Boolean as PropType<VxeSelectPropTypes.Disabled>,
|
|
29
32
|
multiple: Boolean as PropType<VxeSelectPropTypes.Multiple>,
|
|
@@ -31,7 +31,7 @@ export default defineComponent({
|
|
|
31
31
|
const xesize = inject('xesize', null as ComputedRef<SizeType> | null)
|
|
32
32
|
|
|
33
33
|
const { xID, props: tableProps, context: tableContext, reactData: tableReactData, internalData: tableInternalData } = $xetable
|
|
34
|
-
const { refTableHeader, refTableBody, refTableFooter, refTableLeftBody, refTableRightBody } = $xetable.getRefMaps()
|
|
34
|
+
const { refTableHeader, refTableBody, refTableFooter, refTableLeftBody, refTableRightBody, refValidTooltip } = $xetable.getRefMaps()
|
|
35
35
|
const { computeEditOpts, computeMouseOpts, computeSYOpts, computeEmptyOpts, computeKeyboardOpts, computeTooltipOpts, computeRadioOpts, computeExpandOpts, computeTreeOpts, computeCheckboxOpts, computeValidOpts, computeRowOpts, computeColumnOpts } = $xetable.getComputeMaps()
|
|
36
36
|
|
|
37
37
|
const refElem = ref() as Ref<XEBodyScrollElement>
|
|
@@ -123,7 +123,7 @@ export default defineComponent({
|
|
|
123
123
|
* 渲染列
|
|
124
124
|
*/
|
|
125
125
|
const renderColumn = (seq: number | string, rowid: string, fixedType: any, rowLevel: number, row: any, rowIndex: number, $rowIndex: number, _rowIndex: number, column: any, $columnIndex: number, columns: any, items: any[]) => {
|
|
126
|
-
const { columnKey, showOverflow: allColumnOverflow, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig } = tableProps
|
|
126
|
+
const { columnKey, height, showOverflow: allColumnOverflow, cellClassName: allCellClassName, cellStyle, align: allAlign, spanMethod, mouseConfig, editConfig, editRules, tooltipConfig } = tableProps
|
|
127
127
|
const { tableData, overflowX, scrollYLoad, currentColumn, mergeList, editStore, isAllOverflow, validErrorMaps } = tableReactData
|
|
128
128
|
const { afterFullData } = tableInternalData
|
|
129
129
|
const validOpts = computeValidOpts.value
|
|
@@ -155,7 +155,7 @@ export default defineComponent({
|
|
|
155
155
|
const tdOns: any = {}
|
|
156
156
|
const cellAlign = align || allAlign
|
|
157
157
|
const errorValidItem = validErrorMaps[`${rowid}:${column.id}`]
|
|
158
|
-
const showValidTip = editRules && validOpts.showMessage
|
|
158
|
+
const showValidTip = editRules && validOpts.showMessage && (validOpts.message === 'default' ? (height || tableData.length > 1) : validOpts.message === 'inline')
|
|
159
159
|
const attrs: any = { colid: column.id }
|
|
160
160
|
const params: VxeTableDefines.CellRenderBodyParams = { $table: $xetable, $grid: $xetable.xegrid, seq, rowid, row, rowIndex, $rowIndex, _rowIndex, column, columnIndex, $columnIndex, _columnIndex, fixed: fixedType, type: renderType, isHidden: fixedHiddenColumn, level: rowLevel, visibleData: afterFullData, data: tableData, items }
|
|
161
161
|
// 虚拟滚动不支持动态高度
|
|
@@ -508,6 +508,7 @@ export default defineComponent({
|
|
|
508
508
|
const tableFooter = refTableFooter.value
|
|
509
509
|
const leftBody = refTableLeftBody.value
|
|
510
510
|
const rightBody = refTableRightBody.value
|
|
511
|
+
const validTip = refValidTooltip.value
|
|
511
512
|
const scrollBodyElem = refElem.value
|
|
512
513
|
const headerElem = tableHeader ? tableHeader.$el as HTMLDivElement : null
|
|
513
514
|
const footerElem = tableFooter ? tableFooter.$el as HTMLDivElement : null
|
|
@@ -558,6 +559,9 @@ export default defineComponent({
|
|
|
558
559
|
if (scrollYLoad && isRollY) {
|
|
559
560
|
$xetable.triggerScrollYEvent(evnt)
|
|
560
561
|
}
|
|
562
|
+
if (isRollX && validTip && validTip.reactData.visible) {
|
|
563
|
+
validTip.updatePlacement()
|
|
564
|
+
}
|
|
561
565
|
$xetable.dispatchEvent('scroll', {
|
|
562
566
|
type: renderType,
|
|
563
567
|
fixed: fixedType,
|
|
@@ -309,6 +309,7 @@ export default defineComponent({
|
|
|
309
309
|
const refElem = ref() as Ref<HTMLDivElement>
|
|
310
310
|
const refTooltip = ref() as Ref<VxeTooltipInstance>
|
|
311
311
|
const refCommTooltip = ref() as Ref<VxeTooltipInstance>
|
|
312
|
+
const refValidTooltip = ref() as Ref<VxeTooltipInstance>
|
|
312
313
|
const refTableFilter = ref() as Ref<ComponentPublicInstance>
|
|
313
314
|
const refTableMenu = ref() as Ref<VxeMenuPanelInstance>
|
|
314
315
|
|
|
@@ -394,6 +395,11 @@ export default defineComponent({
|
|
|
394
395
|
}
|
|
395
396
|
})
|
|
396
397
|
|
|
398
|
+
const computeValidTipOpts = computed(() => {
|
|
399
|
+
const tooltipOpts = computeTooltipOpts.value
|
|
400
|
+
return Object.assign({ isArrow: false }, tooltipOpts)
|
|
401
|
+
})
|
|
402
|
+
|
|
397
403
|
const computeEditOpts = computed(() => {
|
|
398
404
|
return Object.assign({}, GlobalConfig.table.editConfig, props.editConfig) as VxeTablePropTypes.EditOpts
|
|
399
405
|
})
|
|
@@ -560,6 +566,7 @@ export default defineComponent({
|
|
|
560
566
|
const refMaps: VxeTablePrivateRef = {
|
|
561
567
|
refElem,
|
|
562
568
|
refTooltip,
|
|
569
|
+
refValidTooltip,
|
|
563
570
|
refTableFilter,
|
|
564
571
|
refTableMenu,
|
|
565
572
|
refTableHeader,
|
|
@@ -4162,14 +4169,14 @@ export default defineComponent({
|
|
|
4162
4169
|
* 如果组件值 v-model 发生 change 时,调用改函数用于更新某一列编辑状态
|
|
4163
4170
|
* 如果单元格配置了校验规则,则会进行校验
|
|
4164
4171
|
*/
|
|
4165
|
-
updateStatus (
|
|
4172
|
+
updateStatus (slotParams, cellValue) {
|
|
4166
4173
|
const customVal = !XEUtils.isUndefined(cellValue)
|
|
4167
4174
|
return nextTick().then(() => {
|
|
4168
4175
|
const { editRules } = props
|
|
4169
4176
|
const { validStore } = reactData
|
|
4170
4177
|
const tableBody = refTableBody.value
|
|
4171
|
-
if (
|
|
4172
|
-
const { row, column } =
|
|
4178
|
+
if (slotParams && tableBody && editRules) {
|
|
4179
|
+
const { row, column } = slotParams
|
|
4173
4180
|
const type = 'change'
|
|
4174
4181
|
if ($xetable.hasCellRules) {
|
|
4175
4182
|
if ($xetable.hasCellRules(type, row, column)) {
|
|
@@ -4298,10 +4305,12 @@ export default defineComponent({
|
|
|
4298
4305
|
*/
|
|
4299
4306
|
const handleGlobalMousedownEvent = (evnt: MouseEvent) => {
|
|
4300
4307
|
const { editStore, ctxMenuStore, filterStore } = reactData
|
|
4301
|
-
const { mouseConfig } = props
|
|
4308
|
+
const { mouseConfig, editRules } = props
|
|
4302
4309
|
const el = refElem.value
|
|
4303
4310
|
const editOpts = computeEditOpts.value
|
|
4311
|
+
const validOpts = computeValidOpts.value
|
|
4304
4312
|
const { actived } = editStore
|
|
4313
|
+
const $validTooltip = refValidTooltip.value
|
|
4305
4314
|
const tableFilter = refTableFilter.value
|
|
4306
4315
|
const tableMenu = refTableMenu.value
|
|
4307
4316
|
if (tableFilter) {
|
|
@@ -4321,7 +4330,9 @@ export default defineComponent({
|
|
|
4321
4330
|
// 如果是激活状态,点击了单元格之外
|
|
4322
4331
|
const cell = actived.args.cell
|
|
4323
4332
|
if ((!cell || !getEventTargetNode(evnt, cell).flag)) {
|
|
4324
|
-
if (
|
|
4333
|
+
if ($validTooltip && getEventTargetNode(evnt, $validTooltip.$el as HTMLDivElement).flag) {
|
|
4334
|
+
// 如果是激活状态,且点击了校验提示框
|
|
4335
|
+
} else if (!internalData._lastCallTime || internalData._lastCallTime + 50 < Date.now()) {
|
|
4325
4336
|
// 如果是激活状态,点击了单元格之外
|
|
4326
4337
|
if (!getEventTargetNode(evnt, document.body, 'vxe-table--ignore-clear').flag) {
|
|
4327
4338
|
// 如果手动调用了激活单元格,避免触发源被移除后导致重复关闭
|
|
@@ -4382,8 +4393,13 @@ export default defineComponent({
|
|
|
4382
4393
|
$xetable.closeMenu()
|
|
4383
4394
|
}
|
|
4384
4395
|
}
|
|
4396
|
+
const isActivated = getEventTargetNode(evnt, $xegrid ? $xegrid.getRefMaps().refElem.value : el).flag
|
|
4397
|
+
// 如果存在校验,点击了表格之外则清除
|
|
4398
|
+
if (!isActivated && editRules && validOpts.autoClear) {
|
|
4399
|
+
reactData.validErrorMaps = {}
|
|
4400
|
+
}
|
|
4385
4401
|
// 最后激活的表格
|
|
4386
|
-
internalData.isActivated =
|
|
4402
|
+
internalData.isActivated = isActivated
|
|
4387
4403
|
}
|
|
4388
4404
|
|
|
4389
4405
|
/**
|
|
@@ -6310,23 +6326,26 @@ export default defineComponent({
|
|
|
6310
6326
|
})
|
|
6311
6327
|
|
|
6312
6328
|
const renderVN = () => {
|
|
6313
|
-
const { loading, stripe, showHeader, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig } = props
|
|
6329
|
+
const { loading, stripe, showHeader, height, treeConfig, mouseConfig, showFooter, highlightCell, highlightHoverRow, highlightHoverColumn, editConfig, editRules } = props
|
|
6314
6330
|
const { isGroup, overflowX, overflowY, scrollXLoad, scrollYLoad, scrollbarHeight, tableData, tableColumn, tableGroupColumn, footerTableData, initStore, columnStore, filterStore } = reactData
|
|
6315
6331
|
const { leftList, rightList } = columnStore
|
|
6316
6332
|
const loadingSlot = slots.loading
|
|
6317
6333
|
const tipConfig = computeTipConfig.value
|
|
6334
|
+
const validOpts = computeValidOpts.value
|
|
6318
6335
|
const treeOpts = computeTreeOpts.value
|
|
6319
6336
|
const rowOpts = computeRowOpts.value
|
|
6320
6337
|
const columnOpts = computeColumnOpts.value
|
|
6321
6338
|
const vSize = computeSize.value
|
|
6322
6339
|
const tableBorder = computeTableBorder.value
|
|
6323
6340
|
const mouseOpts = computeMouseOpts.value
|
|
6341
|
+
const validTipOpts = computeValidTipOpts.value
|
|
6324
6342
|
const loadingOpts = computeLoadingOpts.value
|
|
6325
6343
|
const isMenu = computeIsMenu.value
|
|
6326
6344
|
return h('div', {
|
|
6327
6345
|
ref: refElem,
|
|
6328
6346
|
class: ['vxe-table', 'vxe-table--render-default', `tid_${xID}`, `border--${tableBorder}`, {
|
|
6329
6347
|
[`size--${vSize}`]: vSize,
|
|
6348
|
+
[`vaild-msg--${validOpts.msgMode}`]: !!editRules,
|
|
6330
6349
|
'vxe-editable': !!editConfig,
|
|
6331
6350
|
'cell--highlight': highlightCell,
|
|
6332
6351
|
'cell--selected': mouseConfig && mouseOpts.selected,
|
|
@@ -6475,6 +6494,14 @@ export default defineComponent({
|
|
|
6475
6494
|
isArrow: false,
|
|
6476
6495
|
enterable: false
|
|
6477
6496
|
}) : createCommentVNode(),
|
|
6497
|
+
/**
|
|
6498
|
+
* 校验提示
|
|
6499
|
+
*/
|
|
6500
|
+
hasUseTooltip && props.editRules && validOpts.showMessage && (validOpts.message === 'default' ? !height : validOpts.message === 'tooltip') ? h(resolveComponent('vxe-tooltip') as ComponentOptions, {
|
|
6501
|
+
ref: refValidTooltip,
|
|
6502
|
+
class: 'vxe-table--valid-error',
|
|
6503
|
+
...(validOpts.message === 'tooltip' || tableData.length === 1 ? validTipOpts : {})
|
|
6504
|
+
}) : createCommentVNode(),
|
|
6478
6505
|
/**
|
|
6479
6506
|
* 工具提示
|
|
6480
6507
|
*/
|
|
@@ -17,7 +17,10 @@ export default defineComponent({
|
|
|
17
17
|
name: String as PropType<VxeTextareaPropTypes.Name>,
|
|
18
18
|
readonly: Boolean as PropType<VxeTextareaPropTypes.Readonly>,
|
|
19
19
|
disabled: Boolean as PropType<VxeTextareaPropTypes.Disabled>,
|
|
20
|
-
placeholder:
|
|
20
|
+
placeholder: {
|
|
21
|
+
type: String as PropType<VxeTextareaPropTypes.Placeholder>,
|
|
22
|
+
default: () => XEUtils.eqNull(GlobalConfig.textarea.placeholder) ? GlobalConfig.i18n('vxe.base.pleaseInput') : GlobalConfig.textarea.placeholder
|
|
23
|
+
},
|
|
21
24
|
maxlength: [String, Number] as PropType<VxeTextareaPropTypes.Maxlength>,
|
|
22
25
|
rows: { type: [String, Number] as PropType<VxeTextareaPropTypes.Rows>, default: 2 },
|
|
23
26
|
cols: { type: [String, Number] as PropType<VxeTextareaPropTypes.Cols>, default: null },
|
|
@@ -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 { hooks } from './src/hooks'
|
|
9
10
|
import { setup } from './src/setup'
|
|
10
11
|
import { getLastZIndex, nextZIndex } from '../tools/utils'
|
|
@@ -83,6 +84,7 @@ export const VXETable = {
|
|
|
83
84
|
renderer,
|
|
84
85
|
commands,
|
|
85
86
|
formats,
|
|
87
|
+
validators,
|
|
86
88
|
menus,
|
|
87
89
|
hooks,
|
|
88
90
|
config,
|
|
@@ -96,6 +98,7 @@ export * from './src/renderer'
|
|
|
96
98
|
export * from './src/commands'
|
|
97
99
|
export * from './src/menus'
|
|
98
100
|
export * from './src/formats'
|
|
101
|
+
export * from './src/validators'
|
|
99
102
|
export * from './src/hooks'
|
|
100
103
|
export * from './src/setup'
|
|
101
104
|
|
|
@@ -1,8 +1,58 @@
|
|
|
1
|
-
import
|
|
1
|
+
import XEUtils from 'xe-utils'
|
|
2
|
+
import { warnLog } from '../../tools/log'
|
|
2
3
|
|
|
3
4
|
import { VxeGlobalMenus } from '../../../types/v-x-e-table'
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
class VXEMenusStore {
|
|
7
|
+
private store: any = {}
|
|
8
|
+
|
|
9
|
+
mixin (options: any): VXEMenusStore {
|
|
10
|
+
XEUtils.each(options, (item, key) => {
|
|
11
|
+
this.add(key, item)
|
|
12
|
+
})
|
|
13
|
+
return this
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
has (name: string): boolean {
|
|
17
|
+
return !!this.get(name)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
get (name: string): any {
|
|
21
|
+
return this.store[name]
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
add (name: string, render: any): VXEMenusStore {
|
|
25
|
+
const conf = this.store[name]
|
|
26
|
+
// 兼容
|
|
27
|
+
if (XEUtils.isFunction(render)) {
|
|
28
|
+
render = {
|
|
29
|
+
menuMethod: render
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 检测是否覆盖
|
|
34
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
35
|
+
const confKeys = XEUtils.keys(conf)
|
|
36
|
+
XEUtils.each(render, (item, key) => {
|
|
37
|
+
if (confKeys.includes(key)) {
|
|
38
|
+
warnLog('vxe.error.coverProp', [name, key])
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
this.store[name] = conf ? XEUtils.merge(conf, render) : render
|
|
43
|
+
return this
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
delete (name: string): void {
|
|
47
|
+
delete this.store[name]
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
forEach (callback: any): void {
|
|
51
|
+
XEUtils.objectEach(this.store, callback)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export const menus = new VXEMenusStore() as VxeGlobalMenus
|
|
6
56
|
|
|
7
57
|
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
8
58
|
Object.assign(menus, { _name: 'Menus' })
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import VXEStore from './store'
|
|
2
|
+
|
|
3
|
+
import { VxeGlobalValidators } from '../../../types/v-x-e-table'
|
|
4
|
+
|
|
5
|
+
export const validators = new VXEStore() as VxeGlobalValidators
|
|
6
|
+
|
|
7
|
+
if (process.env.VUE_APP_VXE_TABLE_ENV === 'development') {
|
|
8
|
+
Object.assign(validators, { _name: 'Validators' })
|
|
9
|
+
}
|