vxe-table 4.12.0-beta.2 → 4.12.0-beta.20
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 +61 -44
- package/es/locale/lang/ar-EG.js +7 -1
- package/es/locale/lang/de-DE.js +7 -1
- package/es/locale/lang/en-US.js +7 -1
- package/es/locale/lang/es-ES.js +7 -1
- package/es/locale/lang/fr-FR.js +7 -1
- package/es/locale/lang/hu-HU.js +7 -1
- package/es/locale/lang/hy-AM.js +7 -1
- package/es/locale/lang/id-ID.js +7 -1
- package/es/locale/lang/it-IT.js +7 -1
- package/es/locale/lang/ja-JP.js +7 -1
- package/es/locale/lang/ko-KR.js +7 -1
- package/es/locale/lang/nb-NO.js +7 -1
- package/es/locale/lang/pt-BR.js +7 -1
- package/es/locale/lang/ru-RU.js +7 -1
- package/es/locale/lang/th-TH.js +7 -1
- package/es/locale/lang/ug-CN.js +7 -1
- package/es/locale/lang/uk-UA.js +7 -1
- package/es/locale/lang/vi-VN.js +7 -1
- package/es/locale/lang/zh-CHT.js +7 -1
- package/es/locale/lang/zh-CN.js +7 -1
- package/es/style.css +1 -1
- package/es/table/module/filter/panel.js +12 -2
- package/es/table/module/keyboard/hook.js +47 -4
- package/es/table/render/index.js +91 -60
- package/es/table/src/body.js +12 -7
- package/es/table/src/cell.js +10 -9
- package/es/table/src/footer.js +9 -4
- package/es/table/src/header.js +2 -2
- package/es/table/src/props.js +4 -0
- package/es/table/src/table.js +366 -182
- package/es/table/src/util.js +58 -3
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/helper/vetur/attributes.json +1 -1
- package/helper/vetur/tags.json +1 -1
- package/lib/grid/src/grid.js +58 -48
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +1245 -12123
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ar-EG.js +7 -1
- package/lib/locale/lang/ar-EG.min.js +1 -1
- package/lib/locale/lang/de-DE.js +7 -1
- package/lib/locale/lang/de-DE.min.js +1 -1
- package/lib/locale/lang/en-US.js +7 -1
- package/lib/locale/lang/en-US.min.js +1 -1
- package/lib/locale/lang/en-US.umd.js +7 -1
- package/lib/locale/lang/es-ES.js +7 -1
- package/lib/locale/lang/es-ES.min.js +1 -1
- package/lib/locale/lang/es-ES.umd.js +7 -1
- package/lib/locale/lang/fr-FR.js +7 -1
- package/lib/locale/lang/fr-FR.min.js +1 -1
- package/lib/locale/lang/hu-HU.js +7 -1
- package/lib/locale/lang/hu-HU.min.js +1 -1
- package/lib/locale/lang/hu-HU.umd.js +7 -1
- package/lib/locale/lang/hy-AM.js +7 -1
- package/lib/locale/lang/hy-AM.min.js +1 -1
- package/lib/locale/lang/id-ID.js +7 -1
- package/lib/locale/lang/id-ID.min.js +1 -1
- package/lib/locale/lang/it-IT.js +7 -1
- package/lib/locale/lang/it-IT.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +7 -1
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +7 -1
- package/lib/locale/lang/ko-KR.js +7 -1
- package/lib/locale/lang/ko-KR.min.js +1 -1
- package/lib/locale/lang/ko-KR.umd.js +7 -1
- package/lib/locale/lang/nb-NO.js +7 -1
- package/lib/locale/lang/nb-NO.min.js +1 -1
- package/lib/locale/lang/pt-BR.js +7 -1
- package/lib/locale/lang/pt-BR.min.js +1 -1
- package/lib/locale/lang/pt-BR.umd.js +7 -1
- package/lib/locale/lang/ru-RU.js +7 -1
- package/lib/locale/lang/ru-RU.min.js +1 -1
- package/lib/locale/lang/ru-RU.umd.js +7 -1
- package/lib/locale/lang/th-TH.js +7 -1
- package/lib/locale/lang/th-TH.min.js +1 -1
- package/lib/locale/lang/ug-CN.js +7 -1
- package/lib/locale/lang/ug-CN.min.js +1 -1
- package/lib/locale/lang/uk-UA.js +7 -1
- package/lib/locale/lang/uk-UA.min.js +1 -1
- package/lib/locale/lang/uk-UA.umd.js +7 -1
- package/lib/locale/lang/vi-VN.js +7 -1
- package/lib/locale/lang/vi-VN.min.js +1 -1
- package/lib/locale/lang/zh-CHT.js +7 -1
- package/lib/locale/lang/zh-CHT.min.js +1 -1
- package/lib/locale/lang/zh-CN.js +7 -1
- package/lib/locale/lang/zh-CN.min.js +1 -1
- package/lib/locale/lang/zh-CN.umd.js +7 -1
- package/lib/style.css +1 -1
- package/lib/table/module/filter/panel.js +8 -2
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/module/keyboard/hook.js +51 -4
- package/lib/table/module/keyboard/hook.min.js +1 -1
- package/lib/table/render/index.js +100 -65
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/body.js +11 -6
- package/lib/table/src/body.min.js +1 -1
- package/lib/table/src/cell.js +15 -8
- package/lib/table/src/cell.min.js +1 -1
- package/lib/table/src/footer.js +9 -3
- package/lib/table/src/footer.min.js +1 -1
- package/lib/table/src/header.js +2 -1
- package/lib/table/src/header.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 +402 -188
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/src/util.js +65 -6
- package/lib/table/src/util.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 +65 -50
- package/packages/locale/lang/ar-EG.ts +7 -1
- package/packages/locale/lang/de-DE.ts +7 -1
- package/packages/locale/lang/en-US.ts +7 -1
- package/packages/locale/lang/es-ES.ts +7 -1
- package/packages/locale/lang/fr-FR.ts +7 -1
- package/packages/locale/lang/hu-HU.ts +7 -1
- package/packages/locale/lang/hy-AM.ts +7 -1
- package/packages/locale/lang/id-ID.ts +7 -1
- package/packages/locale/lang/it-IT.ts +7 -1
- package/packages/locale/lang/ja-JP.ts +7 -1
- package/packages/locale/lang/ko-KR.ts +7 -1
- package/packages/locale/lang/nb-NO.ts +7 -1
- package/packages/locale/lang/pt-BR.ts +7 -1
- package/packages/locale/lang/ru-RU.ts +7 -1
- package/packages/locale/lang/th-TH.ts +7 -1
- package/packages/locale/lang/ug-CN.ts +7 -1
- package/packages/locale/lang/uk-UA.ts +7 -1
- package/packages/locale/lang/vi-VN.ts +7 -1
- package/packages/locale/lang/zh-CHT.ts +7 -1
- package/packages/locale/lang/zh-CN.ts +7 -1
- package/packages/table/module/filter/panel.ts +12 -2
- package/packages/table/module/keyboard/hook.ts +47 -6
- package/packages/table/render/index.ts +90 -59
- package/packages/table/src/body.ts +11 -6
- package/packages/table/src/cell.ts +10 -9
- package/packages/table/src/footer.ts +9 -4
- package/packages/table/src/header.ts +2 -2
- package/packages/table/src/props.ts +4 -0
- package/packages/table/src/table.ts +373 -183
- package/packages/table/src/util.ts +66 -3
- /package/es/{iconfont.1741080000843.ttf → iconfont.1742353689933.ttf} +0 -0
- /package/es/{iconfont.1741080000843.woff → iconfont.1742353689933.woff} +0 -0
- /package/es/{iconfont.1741080000843.woff2 → iconfont.1742353689933.woff2} +0 -0
- /package/lib/{iconfont.1741080000843.ttf → iconfont.1742353689933.ttf} +0 -0
- /package/lib/{iconfont.1741080000843.woff → iconfont.1742353689933.woff} +0 -0
- /package/lib/{iconfont.1741080000843.woff2 → iconfont.1742353689933.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,69 @@ 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
|
+
export function createHandleUpdateRowId ($xeTable: VxeTableConstructor) {
|
|
116
|
+
const rowKey = getRowkey($xeTable)
|
|
117
|
+
const isDeepKey = rowKey.indexOf('.') > -1
|
|
118
|
+
const updateRId = isDeepKey ? updateDeepRowKey : updateFastRowKey
|
|
119
|
+
return {
|
|
120
|
+
rowKey,
|
|
121
|
+
handleUpdateRowId (row: any) {
|
|
122
|
+
return updateRId(row, rowKey)
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function createHandleGetRowId ($xeTable: VxeTableConstructor) {
|
|
128
|
+
const rowKey = getRowkey($xeTable)
|
|
129
|
+
const isDeepKey = rowKey.indexOf('.') > -1
|
|
130
|
+
const getRId = isDeepKey ? getDeepRowIdByKey : getFastRowIdByKey
|
|
131
|
+
return {
|
|
132
|
+
rowKey,
|
|
133
|
+
handleGetRowId (row: any) {
|
|
134
|
+
return getRId(row, rowKey)
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
// 编码行主键
|
|
140
|
+
export function encodeRowid (rowVal: string) {
|
|
141
|
+
return XEUtils.eqNull(rowVal) ? '' : encodeURIComponent(rowVal)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function getDeepRowIdByKey (row: any, rowKey: string) {
|
|
145
|
+
return XEUtils.get(row, rowKey)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export function updateDeepRowKey (row: any, rowKey: string) {
|
|
149
|
+
let rowid = getDeepRowIdByKey(row, rowKey)
|
|
150
|
+
if (eqEmptyValue(rowid)) {
|
|
151
|
+
rowid = getRowUniqueId()
|
|
152
|
+
XEUtils.set(row, rowKey, rowid)
|
|
153
|
+
}
|
|
154
|
+
return rowid
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
function getFastRowIdByKey (row: any, rowKey: string) {
|
|
158
|
+
return row[rowKey]
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function updateFastRowKey (row: any, rowKey: string) {
|
|
162
|
+
let rowid = getFastRowIdByKey(row, rowKey)
|
|
163
|
+
if (eqEmptyValue(rowid)) {
|
|
164
|
+
rowid = getRowUniqueId()
|
|
165
|
+
row[rowKey] = rowid
|
|
166
|
+
}
|
|
167
|
+
return rowid
|
|
113
168
|
}
|
|
114
169
|
|
|
115
170
|
export interface XEColumnInstance {
|
|
@@ -123,6 +178,14 @@ export const handleFieldOrColumn = ($xeTable: VxeTableConstructor, fieldOrColumn
|
|
|
123
178
|
return null
|
|
124
179
|
}
|
|
125
180
|
|
|
181
|
+
export const handleRowidOrRow = ($xeTable: VxeTableConstructor, rowidOrRow: any) => {
|
|
182
|
+
if (rowidOrRow) {
|
|
183
|
+
const rowid = XEUtils.isString(rowidOrRow) || XEUtils.isNumber(rowidOrRow) ? rowidOrRow : getRowid($xeTable, rowidOrRow)
|
|
184
|
+
return $xeTable.getRowById(rowid)
|
|
185
|
+
}
|
|
186
|
+
return null
|
|
187
|
+
}
|
|
188
|
+
|
|
126
189
|
function getPaddingLeftRightSize (elem: HTMLElement | null) {
|
|
127
190
|
if (elem) {
|
|
128
191
|
const computedStyle = getComputedStyle(elem)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|