vxe-table 4.12.0-beta.0 → 4.12.0-beta.10
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/es/grid/src/grid.js +70 -76
- package/es/locale/lang/ar-EG.js +3 -0
- package/es/locale/lang/de-DE.js +3 -0
- package/es/locale/lang/en-US.js +3 -0
- package/es/locale/lang/es-ES.js +3 -0
- package/es/locale/lang/fr-FR.js +3 -0
- package/es/locale/lang/hu-HU.js +3 -0
- package/es/locale/lang/hy-AM.js +3 -0
- package/es/locale/lang/id-ID.js +3 -0
- package/es/locale/lang/it-IT.js +3 -0
- package/es/locale/lang/ja-JP.js +3 -0
- package/es/locale/lang/ko-KR.js +3 -0
- package/es/locale/lang/nb-NO.js +3 -0
- package/es/locale/lang/pt-BR.js +3 -0
- package/es/locale/lang/ru-RU.js +3 -0
- package/es/locale/lang/th-TH.js +3 -0
- package/es/locale/lang/ug-CN.js +3 -0
- package/es/locale/lang/uk-UA.js +3 -0
- package/es/locale/lang/vi-VN.js +3 -0
- package/es/locale/lang/zh-CHT.js +3 -0
- package/es/locale/lang/zh-CN.js +3 -0
- package/es/style.css +1 -1
- package/es/table/module/custom/panel.js +19 -21
- package/es/table/module/edit/hook.js +1 -1
- package/es/table/module/export/export-panel.js +17 -19
- package/es/table/module/export/hook.js +5 -11
- package/es/table/module/export/import-panel.js +11 -13
- package/es/table/module/keyboard/hook.js +49 -6
- package/es/table/module/validator/hook.js +1 -3
- package/es/table/render/index.js +90 -61
- package/es/table/src/body.js +13 -8
- package/es/table/src/columnInfo.js +26 -28
- package/es/table/src/footer.js +7 -2
- package/es/table/src/props.js +4 -0
- package/es/table/src/table.js +374 -191
- package/es/table/src/util.js +30 -3
- package/es/toolbar/src/toolbar.js +16 -24
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +67 -82
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +1276 -12214
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +3 -0
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +3 -0
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +3 -0
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +3 -0
- package/lib/locale/lang/es-ES.js +3 -0
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +3 -0
- package/lib/locale/lang/fr-FR.js +3 -0
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +3 -0
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +3 -0
- package/lib/locale/lang/hy-AM.js +3 -0
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/id-ID.js +3 -0
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/it-IT.js +3 -0
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +3 -0
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +3 -0
- package/lib/locale/lang/ko-KR.js +3 -0
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +3 -0
- package/lib/locale/lang/nb-NO.js +3 -0
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +3 -0
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +3 -0
- package/lib/locale/lang/ru-RU.js +3 -0
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +3 -0
- package/lib/locale/lang/th-TH.js +3 -0
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +3 -0
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +3 -0
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +3 -0
- package/lib/locale/lang/vi-VN.js +3 -0
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +3 -0
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CN.js +3 -0
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +3 -0
- package/lib/style.css +1 -1
- package/lib/table/module/custom/panel.js +21 -23
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/edit/hook.js +1 -1
- package/lib/table/module/edit/hook.min.js +1 -1
- package/lib/table/module/export/export-panel.js +17 -19
- package/lib/table/module/export/export-panel.min.js +1 -1
- package/lib/table/module/export/hook.js +5 -11
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/module/export/import-panel.js +11 -13
- package/lib/table/module/export/import-panel.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +53 -6
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/module/validator/hook.js +1 -3
- package/lib/table/module/validator/hook.min.js +1 -1
- package/lib/table/render/index.js +98 -66
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +12 -6
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/columnInfo.js +30 -32
- package/lib/table/src/columnInfo.min.js +1 -1
- package/lib/table/src/footer.js +7 -2
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/props.js +4 -0
- package/lib/table/src/props.min.js +1 -1
- package/lib/table/src/table.js +409 -189
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +35 -6
- package/lib/table/src/util.min.js +1 -1
- package/lib/toolbar/src/toolbar.js +16 -24
- package/lib/toolbar/src/toolbar.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +2 -2
- package/packages/grid/src/grid.ts +75 -82
- package/packages/locale/lang/ar-EG.ts +3 -0
- package/packages/locale/lang/de-DE.ts +3 -0
- package/packages/locale/lang/en-US.ts +3 -0
- package/packages/locale/lang/es-ES.ts +3 -0
- package/packages/locale/lang/fr-FR.ts +3 -0
- package/packages/locale/lang/hu-HU.ts +3 -0
- package/packages/locale/lang/hy-AM.ts +3 -0
- package/packages/locale/lang/id-ID.ts +3 -0
- package/packages/locale/lang/it-IT.ts +3 -0
- package/packages/locale/lang/ja-JP.ts +3 -0
- package/packages/locale/lang/ko-KR.ts +3 -0
- package/packages/locale/lang/nb-NO.ts +3 -0
- package/packages/locale/lang/pt-BR.ts +3 -0
- package/packages/locale/lang/ru-RU.ts +3 -0
- package/packages/locale/lang/th-TH.ts +3 -0
- package/packages/locale/lang/ug-CN.ts +3 -0
- package/packages/locale/lang/uk-UA.ts +3 -0
- package/packages/locale/lang/vi-VN.ts +3 -0
- package/packages/locale/lang/zh-CHT.ts +3 -0
- package/packages/locale/lang/zh-CN.ts +3 -0
- package/packages/table/module/custom/panel.ts +19 -21
- package/packages/table/module/edit/hook.ts +1 -1
- package/packages/table/module/export/export-panel.ts +17 -19
- package/packages/table/module/export/hook.ts +5 -11
- package/packages/table/module/export/import-panel.ts +11 -13
- package/packages/table/module/keyboard/hook.ts +49 -8
- package/packages/table/module/validator/hook.ts +1 -3
- package/packages/table/render/index.ts +89 -59
- package/packages/table/src/body.ts +12 -7
- package/packages/table/src/columnInfo.ts +26 -28
- package/packages/table/src/footer.ts +7 -2
- package/packages/table/src/props.ts +4 -0
- package/packages/table/src/table.ts +380 -189
- package/packages/table/src/util.ts +34 -3
- package/packages/toolbar/src/toolbar.ts +16 -24
- /package/es/{iconfont.1740732137800.ttf → iconfont.1741664494856.ttf} +0 -0
- /package/es/{iconfont.1740732137800.woff → iconfont.1741664494856.woff} +0 -0
- /package/es/{iconfont.1740732137800.woff2 → iconfont.1741664494856.woff2} +0 -0
- /package/lib/{iconfont.1740732137800.ttf → iconfont.1741664494856.ttf} +0 -0
- /package/lib/{iconfont.1740732137800.woff → iconfont.1741664494856.woff} +0 -0
- /package/lib/{iconfont.1740732137800.woff2 → iconfont.1741664494856.woff2} +0 -0
|
@@ -2,6 +2,7 @@ import { watch, reactive } from 'vue'
|
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
import { ColumnInfo } from './columnInfo'
|
|
4
4
|
import { isPx, isScale } from '../../ui/src/dom'
|
|
5
|
+
import { eqEmptyValue } from '../../ui/src/utils'
|
|
5
6
|
|
|
6
7
|
import type { VxeTableConstructor, VxeTablePrivateMethods, VxeTableDefines } from '../../../types'
|
|
7
8
|
|
|
@@ -101,15 +102,37 @@ export function getRowUniqueId () {
|
|
|
101
102
|
export function getRowkey ($xeTable: VxeTableConstructor) {
|
|
102
103
|
const { props } = $xeTable
|
|
103
104
|
const { computeRowOpts } = $xeTable.getComputeMaps()
|
|
104
|
-
const { rowId } = props
|
|
105
105
|
const rowOpts = computeRowOpts.value
|
|
106
|
-
return rowId || rowOpts.keyField || '_X_ROW_KEY'
|
|
106
|
+
return `${props.rowId || rowOpts.keyField || '_X_ROW_KEY'}`
|
|
107
107
|
}
|
|
108
108
|
|
|
109
109
|
// 行主键 value
|
|
110
110
|
export function getRowid ($xeTable: VxeTableConstructor, row: any) {
|
|
111
111
|
const rowid = XEUtils.get(row, getRowkey($xeTable))
|
|
112
|
-
return
|
|
112
|
+
return encodeRowid(rowid)
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// 编码行主键
|
|
116
|
+
export function encodeRowid (rowVal: string) {
|
|
117
|
+
return XEUtils.eqNull(rowVal) ? '' : encodeURIComponent(rowVal)
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export function updateDeepRowKey (row: any, rowkey: string) {
|
|
121
|
+
let rowid = XEUtils.get(row, rowkey)
|
|
122
|
+
if (eqEmptyValue(rowid)) {
|
|
123
|
+
rowid = getRowUniqueId()
|
|
124
|
+
XEUtils.set(row, rowkey, rowid)
|
|
125
|
+
}
|
|
126
|
+
return rowid
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function updateFastRowKey (row: any, rowkey: string) {
|
|
130
|
+
let rowid = row[rowkey]
|
|
131
|
+
if (eqEmptyValue(rowid)) {
|
|
132
|
+
rowid = getRowUniqueId()
|
|
133
|
+
row[rowkey] = rowid
|
|
134
|
+
}
|
|
135
|
+
return rowid
|
|
113
136
|
}
|
|
114
137
|
|
|
115
138
|
export interface XEColumnInstance {
|
|
@@ -123,6 +146,14 @@ export const handleFieldOrColumn = ($xeTable: VxeTableConstructor, fieldOrColumn
|
|
|
123
146
|
return null
|
|
124
147
|
}
|
|
125
148
|
|
|
149
|
+
export const handleRowidOrRow = ($xeTable: VxeTableConstructor, rowidOrRow: any) => {
|
|
150
|
+
if (rowidOrRow) {
|
|
151
|
+
const rowid = XEUtils.isString(rowidOrRow) || XEUtils.isNumber(rowidOrRow) ? rowidOrRow : getRowid($xeTable, rowidOrRow)
|
|
152
|
+
return $xeTable.getRowById(rowid)
|
|
153
|
+
}
|
|
154
|
+
return null
|
|
155
|
+
}
|
|
156
|
+
|
|
126
157
|
function getPaddingLeftRightSize (elem: HTMLElement | null) {
|
|
127
158
|
if (elem) {
|
|
128
159
|
const computedStyle = getComputedStyle(elem)
|
|
@@ -210,9 +210,7 @@ export default defineComponent({
|
|
|
210
210
|
if (tCommandMethod) {
|
|
211
211
|
tCommandMethod(params)
|
|
212
212
|
} else {
|
|
213
|
-
|
|
214
|
-
errLog('vxe.error.notCommands', [code])
|
|
215
|
-
}
|
|
213
|
+
errLog('vxe.error.notCommands', [code])
|
|
216
214
|
}
|
|
217
215
|
}
|
|
218
216
|
$xeToolbar.dispatchEvent('button-click', params, evnt)
|
|
@@ -235,9 +233,7 @@ export default defineComponent({
|
|
|
235
233
|
if (tCommandMethod) {
|
|
236
234
|
tCommandMethod(params)
|
|
237
235
|
} else {
|
|
238
|
-
|
|
239
|
-
errLog('vxe.error.notCommands', [code])
|
|
240
|
-
}
|
|
236
|
+
errLog('vxe.error.notCommands', [code])
|
|
241
237
|
}
|
|
242
238
|
}
|
|
243
239
|
$xeToolbar.dispatchEvent('tool-click', params, evnt)
|
|
@@ -598,25 +594,21 @@ export default defineComponent({
|
|
|
598
594
|
warnLog('vxe.error.notFunc', ['queryMethod'])
|
|
599
595
|
}
|
|
600
596
|
const customOpts = computeCustomOpts.value
|
|
601
|
-
if (
|
|
602
|
-
|
|
603
|
-
warnLog('vxe.error.delProp', ['toolbar.custom.isFooter', 'table.custom-config.showFooter'])
|
|
604
|
-
}
|
|
605
|
-
if (customOpts.showFooter) {
|
|
606
|
-
warnLog('vxe.error.delProp', ['toolbar.custom.showFooter', 'table.custom-config.showFooter'])
|
|
607
|
-
}
|
|
608
|
-
if (customOpts.immediate) {
|
|
609
|
-
warnLog('vxe.error.delProp', ['toolbar.custom.immediate', 'table.custom-config.immediate'])
|
|
610
|
-
}
|
|
611
|
-
if (customOpts.trigger) {
|
|
612
|
-
warnLog('vxe.error.delProp', ['toolbar.custom.trigger', 'table.custom-config.trigger'])
|
|
613
|
-
}
|
|
597
|
+
if (customOpts.isFooter) {
|
|
598
|
+
warnLog('vxe.error.delProp', ['toolbar.custom.isFooter', 'table.custom-config.showFooter'])
|
|
614
599
|
}
|
|
615
|
-
if (
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
600
|
+
if (customOpts.showFooter) {
|
|
601
|
+
warnLog('vxe.error.delProp', ['toolbar.custom.showFooter', 'table.custom-config.showFooter'])
|
|
602
|
+
}
|
|
603
|
+
if (customOpts.immediate) {
|
|
604
|
+
warnLog('vxe.error.delProp', ['toolbar.custom.immediate', 'table.custom-config.immediate'])
|
|
605
|
+
}
|
|
606
|
+
if (customOpts.trigger) {
|
|
607
|
+
warnLog('vxe.error.delProp', ['toolbar.custom.trigger', 'table.custom-config.trigger'])
|
|
608
|
+
}
|
|
609
|
+
if (props.refresh || props.import || props.export || props.print || props.zoom) {
|
|
610
|
+
if (!VxeUIButtonComponent) {
|
|
611
|
+
errLog('vxe.error.reqComp', ['vxe-button'])
|
|
620
612
|
}
|
|
621
613
|
}
|
|
622
614
|
})
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|