@vxe-ui/plugin-render-element 4.2.2 → 4.2.4
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/dist/index.common.js +3 -3
- package/dist/index.js +3 -3
- package/dist/index.umd.js +2958 -2985
- package/dist/index.umd.min.js +1 -1
- package/dist/table/index.js +140 -26
- package/dist/util/comp.js +10 -0
- package/package.json +3 -3
- package/src/table/index.ts +157 -39
- package/src/util/comp.ts +11 -0
- package/dist/all.common.js +0 -2728
package/src/table/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, ComponentOptions } from 'vue'
|
|
2
|
-
import { getCurrComponent } from '../util/comp'
|
|
2
|
+
import { getCurrComponent, hasInputType } from '../util/comp'
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
4
|
import dayjs from 'dayjs'
|
|
5
5
|
|
|
@@ -65,7 +65,7 @@ export function defineTableRender (VxeUI: VxeUIExport) {
|
|
|
65
65
|
return cellValue >= getFormatDate(data[0], props, defaultFormat) && cellValue <= getFormatDate(data[1], props, defaultFormat)
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
function getCellEditFilterProps (renderOpts: any, params: VxeGlobalRendererHandles.
|
|
68
|
+
function getCellEditFilterProps (renderOpts: any, params: VxeGlobalRendererHandles.RenderTableEditParams | VxeGlobalRendererHandles.RenderTableFilterParams | VxeGlobalRendererHandles.RenderTableFloatingFilterParams, value: any, defaultProps?: { [prop: string]: any }) {
|
|
69
69
|
return XEUtils.assign({}, defaultProps, renderOpts.props, { [getModelProp(renderOpts)]: value })
|
|
70
70
|
}
|
|
71
71
|
|
|
@@ -73,7 +73,17 @@ export function defineTableRender (VxeUI: VxeUIExport) {
|
|
|
73
73
|
return '' + (isEmptyValue(cellValue) ? '' : cellValue)
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
function
|
|
76
|
+
function updateFilterChangeOption (params: VxeGlobalRendererHandles.RenderTableFilterParams | VxeGlobalRendererHandles.RenderTableFloatingFilterParams, checked: boolean, option: VxeTableDefines.FilterOption) {
|
|
77
|
+
const { $table } = params
|
|
78
|
+
$table.updateFilterOptionStatus(option, checked)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function saveFilterEvent (params: VxeGlobalRendererHandles.RenderTableFilterParams | VxeGlobalRendererHandles.RenderTableFloatingFilterParams) {
|
|
82
|
+
const { $table, column } = params
|
|
83
|
+
$table.saveFilterByEvent(new Event('change'), column)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function getCellLabelVNs (renderOpts: VxeColumnPropTypes.EditRender, params: VxeGlobalRendererHandles.RenderTableCellParams, cellLabel: any) {
|
|
77
87
|
const { placeholder } = renderOpts
|
|
78
88
|
return [
|
|
79
89
|
h('span', {
|
|
@@ -88,29 +98,44 @@ export function defineTableRender (VxeUI: VxeUIExport) {
|
|
|
88
98
|
]
|
|
89
99
|
}
|
|
90
100
|
|
|
91
|
-
|
|
101
|
+
const blurEvent = 'blur'
|
|
102
|
+
const clearEvent = 'clear'
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* 组件事件处理
|
|
106
|
+
* @param renderOpts
|
|
107
|
+
* @param params
|
|
108
|
+
* @param modelFunc
|
|
109
|
+
* @param changeFunc
|
|
110
|
+
*/
|
|
111
|
+
function getComponentOns (renderOpts: VxeGlobalRendererHandles.RenderTableCellOptions | VxeGlobalRendererHandles.RenderTableFilterOptions, params: any, eFns?: {
|
|
112
|
+
model: (cellValue: any) => void
|
|
113
|
+
change?: (...args: any[]) => void
|
|
114
|
+
blur?: (...args: any[]) => void
|
|
115
|
+
clear?: (...args: any[]) => void
|
|
116
|
+
}, eventOns?: Record<string, any>) {
|
|
92
117
|
const { events } = renderOpts
|
|
93
118
|
const modelEvent = getModelEvent(renderOpts)
|
|
94
119
|
const changeEvent = getChangeEvent(renderOpts)
|
|
95
|
-
const
|
|
96
|
-
const ons:
|
|
97
|
-
XEUtils.objectEach(events, (func
|
|
120
|
+
const { model: modelFunc, change: changeFunc, blur: blurFunc, clear: clearFunc } = eFns || {}
|
|
121
|
+
const ons: any = {}
|
|
122
|
+
XEUtils.objectEach(events, (func, key: any) => {
|
|
98
123
|
ons[getOnName(key)] = function (...args: any[]) {
|
|
124
|
+
if (!XEUtils.isFunction(func)) {
|
|
125
|
+
console.error(`Parameter "${func}" is not a method`)
|
|
126
|
+
}
|
|
99
127
|
func(params, ...args)
|
|
100
128
|
}
|
|
101
129
|
})
|
|
102
|
-
if (
|
|
130
|
+
if (modelFunc) {
|
|
103
131
|
ons[getOnName(modelEvent)] = function (targetEvnt: any) {
|
|
104
|
-
|
|
132
|
+
modelFunc(targetEvnt)
|
|
105
133
|
if (events && events[modelEvent]) {
|
|
106
134
|
events[modelEvent](params, targetEvnt)
|
|
107
135
|
}
|
|
108
|
-
if (isSameEvent && changeFunc) {
|
|
109
|
-
changeFunc(targetEvnt)
|
|
110
|
-
}
|
|
111
136
|
}
|
|
112
137
|
}
|
|
113
|
-
if (
|
|
138
|
+
if (changeFunc) {
|
|
114
139
|
ons[getOnName(changeEvent)] = function (...args: any[]) {
|
|
115
140
|
changeFunc(...args)
|
|
116
141
|
if (events && events[changeEvent]) {
|
|
@@ -118,25 +143,83 @@ export function defineTableRender (VxeUI: VxeUIExport) {
|
|
|
118
143
|
}
|
|
119
144
|
}
|
|
120
145
|
}
|
|
121
|
-
|
|
146
|
+
if (blurFunc) {
|
|
147
|
+
ons[getOnName(blurEvent)] = function (...args: any[]) {
|
|
148
|
+
blurFunc(...args)
|
|
149
|
+
if (events && events[blurEvent]) {
|
|
150
|
+
events[blurEvent](params, ...args)
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
if (clearFunc) {
|
|
155
|
+
ons[getOnName(clearEvent)] = function (...args: any[]) {
|
|
156
|
+
clearFunc(...args)
|
|
157
|
+
if (events && events[clearEvent]) {
|
|
158
|
+
events[clearEvent](params, ...args)
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return eventOns ? Object.assign(ons, eventOns) : ons
|
|
122
163
|
}
|
|
123
164
|
|
|
124
|
-
function getEditOns (renderOpts: VxeGlobalRendererHandles.RenderOptions, params: VxeGlobalRendererHandles.
|
|
165
|
+
function getEditOns (renderOpts: VxeGlobalRendererHandles.RenderOptions, params: VxeGlobalRendererHandles.RenderTableEditParams) {
|
|
125
166
|
const { $table, row, column } = params
|
|
126
|
-
return
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
167
|
+
return getComponentOns(renderOpts, params, {
|
|
168
|
+
model (value) {
|
|
169
|
+
// 处理 model 值双向绑定
|
|
170
|
+
XEUtils.set(row, column.field, value)
|
|
171
|
+
},
|
|
172
|
+
change () {
|
|
173
|
+
// 处理 change 事件相关逻辑
|
|
174
|
+
$table.updateStatus(params)
|
|
175
|
+
}
|
|
132
176
|
})
|
|
133
177
|
}
|
|
134
178
|
|
|
135
|
-
function getFilterOns (renderOpts: any, params: VxeGlobalRendererHandles.
|
|
136
|
-
return
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
179
|
+
function getFilterOns (renderOpts: any, params: VxeGlobalRendererHandles.RenderTableFilterParams, option: VxeTableDefines.FilterOption, changeFunc: ((...args: any[]) => void)) {
|
|
180
|
+
return getComponentOns(renderOpts, params, {
|
|
181
|
+
model (value: any) {
|
|
182
|
+
// 处理 model 值双向绑定
|
|
183
|
+
option.data = value
|
|
184
|
+
},
|
|
185
|
+
change: changeFunc
|
|
186
|
+
})
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function getFloatingFilterOns (renderOpts: VxeGlobalRendererHandles.RenderTableFilterOptions, params: VxeGlobalRendererHandles.RenderTableFloatingFilterParams, option: VxeTableDefines.FilterOption) {
|
|
190
|
+
const { $table, column } = params
|
|
191
|
+
if (hasInputType(renderOpts)) {
|
|
192
|
+
return getComponentOns(renderOpts, params, {
|
|
193
|
+
model (value: any) {
|
|
194
|
+
// 处理 model 值双向绑定
|
|
195
|
+
option.data = value
|
|
196
|
+
},
|
|
197
|
+
change () {
|
|
198
|
+
updateFilterChangeOption(params, !isEmptyValue(option.data), option)
|
|
199
|
+
},
|
|
200
|
+
clear () {
|
|
201
|
+
updateFilterChangeOption(params, !isEmptyValue(option.data), option)
|
|
202
|
+
saveFilterEvent(params)
|
|
203
|
+
},
|
|
204
|
+
blur () {
|
|
205
|
+
$table.saveFilterByEvent(new Event('change'), column)
|
|
206
|
+
}
|
|
207
|
+
})
|
|
208
|
+
}
|
|
209
|
+
return getComponentOns(renderOpts, params, {
|
|
210
|
+
model (value: any) {
|
|
211
|
+
// 处理 model 值双向绑定
|
|
212
|
+
option.data = value
|
|
213
|
+
},
|
|
214
|
+
clear () {
|
|
215
|
+
updateFilterChangeOption(params, !isEmptyValue(option.data), option)
|
|
216
|
+
$table.saveFilterByEvent(new Event('change'), column)
|
|
217
|
+
},
|
|
218
|
+
change () {
|
|
219
|
+
updateFilterChangeOption(params, !isEmptyValue(option.data), option)
|
|
220
|
+
$table.saveFilterByEvent(new Event('change'), column)
|
|
221
|
+
}
|
|
222
|
+
})
|
|
140
223
|
}
|
|
141
224
|
|
|
142
225
|
function matchCascaderData (index: number, list: any[], values: any[], labels: any[]) {
|
|
@@ -151,7 +234,7 @@ export function defineTableRender (VxeUI: VxeUIExport) {
|
|
|
151
234
|
}
|
|
152
235
|
}
|
|
153
236
|
|
|
154
|
-
function getSelectCellValue (renderOpts: VxeColumnPropTypes.EditRender, params: VxeGlobalRendererHandles.
|
|
237
|
+
function getSelectCellValue (renderOpts: VxeColumnPropTypes.EditRender, params: VxeGlobalRendererHandles.RenderTableCellParams) {
|
|
155
238
|
const { options = [], optionGroups, props = {}, optionProps = {}, optionGroupProps = {} } = renderOpts
|
|
156
239
|
const { $table, rowid, row, column } = params
|
|
157
240
|
const { filterable, multiple } = props
|
|
@@ -199,7 +282,7 @@ export function defineTableRender (VxeUI: VxeUIExport) {
|
|
|
199
282
|
return ''
|
|
200
283
|
}
|
|
201
284
|
|
|
202
|
-
function getCascaderCellValue (renderOpts: VxeGlobalRendererHandles.RenderOptions, params: VxeGlobalRendererHandles.
|
|
285
|
+
function getCascaderCellValue (renderOpts: VxeGlobalRendererHandles.RenderOptions, params: VxeGlobalRendererHandles.RenderTableCellParams) {
|
|
203
286
|
const { props = {} } = renderOpts
|
|
204
287
|
const { row, column } = params
|
|
205
288
|
const cellValue = XEUtils.get(row, column.field)
|
|
@@ -209,7 +292,7 @@ export function defineTableRender (VxeUI: VxeUIExport) {
|
|
|
209
292
|
return (props.showAllLevels === false ? labels.slice(labels.length - 1, labels.length) : labels).join(` ${props.separator || '/'} `)
|
|
210
293
|
}
|
|
211
294
|
|
|
212
|
-
function getDatePickerCellValue (renderOpts: VxeGlobalRendererHandles.RenderOptions, params: VxeGlobalRendererHandles.
|
|
295
|
+
function getDatePickerCellValue (renderOpts: VxeGlobalRendererHandles.RenderOptions, params: VxeGlobalRendererHandles.RenderTableCellParams | VxeGlobalRendererHandles.ExportMethodParams) {
|
|
213
296
|
const { props = {} } = renderOpts
|
|
214
297
|
const { row, column } = params
|
|
215
298
|
const { rangeSeparator = '-' } = props
|
|
@@ -242,7 +325,7 @@ export function defineTableRender (VxeUI: VxeUIExport) {
|
|
|
242
325
|
return cellValue
|
|
243
326
|
}
|
|
244
327
|
|
|
245
|
-
function getTimePickerCellValue (renderOpts: VxeGlobalRendererHandles.RenderOptions, params: VxeGlobalRendererHandles.
|
|
328
|
+
function getTimePickerCellValue (renderOpts: VxeGlobalRendererHandles.RenderOptions, params: VxeGlobalRendererHandles.RenderTableCellParams | VxeGlobalRendererHandles.RenderTableEditParams) {
|
|
246
329
|
const { props = {} } = renderOpts
|
|
247
330
|
const { row, column } = params
|
|
248
331
|
const { isRange, format = 'HH:mm:ss', rangeSeparator = '-' } = props
|
|
@@ -254,13 +337,14 @@ export function defineTableRender (VxeUI: VxeUIExport) {
|
|
|
254
337
|
}
|
|
255
338
|
|
|
256
339
|
function createEditRender (defaultProps?: { [key: string]: any }) {
|
|
257
|
-
return function (renderOpts: VxeColumnPropTypes.EditRender & { name: string }, params: VxeGlobalRendererHandles.
|
|
340
|
+
return function (renderOpts: VxeColumnPropTypes.EditRender & { name: string }, params: VxeGlobalRendererHandles.RenderTableEditParams) {
|
|
258
341
|
const { row, column } = params
|
|
259
|
-
const { name, attrs } = renderOpts
|
|
342
|
+
const { name, attrs, props } = renderOpts
|
|
260
343
|
const cellValue = XEUtils.get(row, column.field)
|
|
261
344
|
return [
|
|
262
345
|
h(getCurrComponent(name), {
|
|
263
346
|
...attrs,
|
|
347
|
+
...props,
|
|
264
348
|
...getCellEditFilterProps(renderOpts, params, cellValue, defaultProps),
|
|
265
349
|
...getEditOns(renderOpts, params)
|
|
266
350
|
})
|
|
@@ -268,18 +352,19 @@ export function defineTableRender (VxeUI: VxeUIExport) {
|
|
|
268
352
|
}
|
|
269
353
|
}
|
|
270
354
|
|
|
271
|
-
function defaultButtonEditRender (renderOpts: VxeColumnPropTypes.EditRender, params: VxeGlobalRendererHandles.
|
|
272
|
-
const { attrs } = renderOpts
|
|
355
|
+
function defaultButtonEditRender (renderOpts: VxeColumnPropTypes.EditRender, params: VxeGlobalRendererHandles.RenderTableEditParams) {
|
|
356
|
+
const { attrs, props } = renderOpts
|
|
273
357
|
return [
|
|
274
358
|
h(getCurrComponent('el-button'), {
|
|
275
359
|
...attrs,
|
|
360
|
+
...props,
|
|
276
361
|
...getCellEditFilterProps(renderOpts, params, null),
|
|
277
|
-
...
|
|
362
|
+
...getComponentOns(renderOpts, params)
|
|
278
363
|
}, cellText(renderOpts.content))
|
|
279
364
|
]
|
|
280
365
|
}
|
|
281
366
|
|
|
282
|
-
function defaultButtonsEditRender (renderOpts: VxeColumnPropTypes.EditRender, params: VxeGlobalRendererHandles.
|
|
367
|
+
function defaultButtonsEditRender (renderOpts: VxeColumnPropTypes.EditRender, params: VxeGlobalRendererHandles.RenderTableEditParams) {
|
|
283
368
|
const { children } = renderOpts
|
|
284
369
|
if (children) {
|
|
285
370
|
return children.map((childRenderOpts: VxeColumnPropTypes.EditRender) => defaultButtonEditRender(childRenderOpts, params)[0])
|
|
@@ -288,9 +373,9 @@ export function defineTableRender (VxeUI: VxeUIExport) {
|
|
|
288
373
|
}
|
|
289
374
|
|
|
290
375
|
function createFilterRender (defaultProps?: { [key: string]: any }) {
|
|
291
|
-
return function (renderOpts: VxeColumnPropTypes.FilterRender & { name: string }, params: VxeGlobalRendererHandles.
|
|
376
|
+
return function (renderOpts: VxeColumnPropTypes.FilterRender & { name: string }, params: VxeGlobalRendererHandles.RenderTableFilterParams) {
|
|
292
377
|
const { column } = params
|
|
293
|
-
const { name, attrs } = renderOpts
|
|
378
|
+
const { name, attrs, props } = renderOpts
|
|
294
379
|
return [
|
|
295
380
|
h('div', {
|
|
296
381
|
class: 'vxe-table--filter-element-wrapper'
|
|
@@ -299,6 +384,7 @@ export function defineTableRender (VxeUI: VxeUIExport) {
|
|
|
299
384
|
return h(getCurrComponent(name), {
|
|
300
385
|
key: oIndex,
|
|
301
386
|
...attrs,
|
|
387
|
+
...props,
|
|
302
388
|
...getCellEditFilterProps(renderOpts, params, optionValue, defaultProps),
|
|
303
389
|
...getFilterOns(renderOpts, params, option, () => {
|
|
304
390
|
// 处理 change 事件相关逻辑
|
|
@@ -310,7 +396,23 @@ export function defineTableRender (VxeUI: VxeUIExport) {
|
|
|
310
396
|
}
|
|
311
397
|
}
|
|
312
398
|
|
|
313
|
-
function
|
|
399
|
+
function createFloatingFilterRender (defaultProps?: { [key: string]: any }) {
|
|
400
|
+
return function (renderOpts: VxeGlobalRendererHandles.RenderTableFloatingFilterOptions & { name: string }, params: VxeGlobalRendererHandles.RenderTableFloatingFilterParams) {
|
|
401
|
+
const { option } = params
|
|
402
|
+
const { name, attrs, props } = renderOpts
|
|
403
|
+
const optionValue = option.data
|
|
404
|
+
return [
|
|
405
|
+
h(getCurrComponent(name), {
|
|
406
|
+
...attrs,
|
|
407
|
+
...props,
|
|
408
|
+
...getCellEditFilterProps(renderOpts, params, optionValue, defaultProps),
|
|
409
|
+
...getFloatingFilterOns(renderOpts, params, option)
|
|
410
|
+
})
|
|
411
|
+
]
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
function handleConfirmFilter (params: VxeGlobalRendererHandles.RenderTableFilterParams, checked: boolean, option: VxeTableDefines.FilterOption) {
|
|
314
416
|
const { $panel } = params
|
|
315
417
|
$panel.changeOption(null, checked, option)
|
|
316
418
|
}
|
|
@@ -362,11 +464,18 @@ export function defineTableRender (VxeUI: VxeUIExport) {
|
|
|
362
464
|
}
|
|
363
465
|
}
|
|
364
466
|
|
|
467
|
+
function defaultFilterOptions () {
|
|
468
|
+
return [
|
|
469
|
+
{ data: null }
|
|
470
|
+
]
|
|
471
|
+
}
|
|
472
|
+
|
|
365
473
|
VxeUI.renderer.mixin({
|
|
366
474
|
ElAutocomplete: {
|
|
367
475
|
tableAutoFocus: 'input',
|
|
368
476
|
renderTableDefault: createEditRender(),
|
|
369
477
|
renderTableEdit: createEditRender(),
|
|
478
|
+
createTableFilterOptions: defaultFilterOptions,
|
|
370
479
|
renderTableFilter: createFilterRender(),
|
|
371
480
|
tableFilterDefaultMethod: defaultExactFilterMethod
|
|
372
481
|
},
|
|
@@ -374,14 +483,18 @@ export function defineTableRender (VxeUI: VxeUIExport) {
|
|
|
374
483
|
tableAutoFocus: 'input',
|
|
375
484
|
renderTableDefault: createEditRender(),
|
|
376
485
|
renderTableEdit: createEditRender(),
|
|
486
|
+
createTableFilterOptions: defaultFilterOptions,
|
|
377
487
|
renderTableFilter: createFilterRender(),
|
|
488
|
+
renderTableFloatingFilter: createFloatingFilterRender(),
|
|
378
489
|
tableFilterDefaultMethod: defaultFuzzyFilterMethod
|
|
379
490
|
},
|
|
380
491
|
ElInputNumber: {
|
|
381
492
|
tableAutoFocus: 'input',
|
|
382
493
|
renderTableDefault: createEditRender(),
|
|
383
494
|
renderTableEdit: createEditRender(),
|
|
495
|
+
createTableFilterOptions: defaultFilterOptions,
|
|
384
496
|
renderTableFilter: createFilterRender(),
|
|
497
|
+
renderTableFloatingFilter: createFloatingFilterRender(),
|
|
385
498
|
tableFilterDefaultMethod: defaultFuzzyFilterMethod
|
|
386
499
|
},
|
|
387
500
|
ElSelect: {
|
|
@@ -428,6 +541,7 @@ export function defineTableRender (VxeUI: VxeUIExport) {
|
|
|
428
541
|
renderTableCell (renderOpts, params) {
|
|
429
542
|
return getCellLabelVNs(renderOpts, params, getSelectCellValue(renderOpts, params))
|
|
430
543
|
},
|
|
544
|
+
createTableFilterOptions: defaultFilterOptions,
|
|
431
545
|
renderTableFilter (renderOpts, params) {
|
|
432
546
|
const { options = [], optionGroups, optionProps = {}, optionGroupProps = {} } = renderOpts
|
|
433
547
|
const groupOptions = optionGroupProps.options || 'options'
|
|
@@ -510,6 +624,7 @@ export function defineTableRender (VxeUI: VxeUIExport) {
|
|
|
510
624
|
renderTableCell (renderOpts, params) {
|
|
511
625
|
return getCellLabelVNs(renderOpts, params, getDatePickerCellValue(renderOpts, params))
|
|
512
626
|
},
|
|
627
|
+
createTableFilterOptions: defaultFilterOptions,
|
|
513
628
|
renderTableFilter (renderOpts, params) {
|
|
514
629
|
const { column } = params
|
|
515
630
|
const { name, attrs } = renderOpts
|
|
@@ -530,6 +645,7 @@ export function defineTableRender (VxeUI: VxeUIExport) {
|
|
|
530
645
|
}))
|
|
531
646
|
]
|
|
532
647
|
},
|
|
648
|
+
renderTableFloatingFilter: createFloatingFilterRender(),
|
|
533
649
|
tableFilterDefaultMethod (params) {
|
|
534
650
|
const { option, row, column } = params
|
|
535
651
|
const { data } = option
|
|
@@ -567,6 +683,7 @@ export function defineTableRender (VxeUI: VxeUIExport) {
|
|
|
567
683
|
ElRate: {
|
|
568
684
|
renderTableDefault: createEditRender(),
|
|
569
685
|
renderTableEdit: createEditRender(),
|
|
686
|
+
createTableFilterOptions: defaultFilterOptions,
|
|
570
687
|
renderTableFilter: createFilterRender(),
|
|
571
688
|
tableFilterDefaultMethod: defaultExactFilterMethod
|
|
572
689
|
},
|
|
@@ -598,6 +715,7 @@ export function defineTableRender (VxeUI: VxeUIExport) {
|
|
|
598
715
|
ElSlider: {
|
|
599
716
|
renderTableDefault: createEditRender(),
|
|
600
717
|
renderTableEdit: createEditRender(),
|
|
718
|
+
createTableFilterOptions: defaultFilterOptions,
|
|
601
719
|
renderTableFilter: createFilterRender(),
|
|
602
720
|
tableFilterDefaultMethod: defaultExactFilterMethod
|
|
603
721
|
},
|
package/src/util/comp.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { resolveComponent } from 'vue'
|
|
2
2
|
import { globalConfig, componentMaps } from '../store'
|
|
3
|
+
import type { VxeGlobalRendererHandles } from 'vxe-table'
|
|
3
4
|
|
|
4
5
|
export function getCurrComponent (name: string) {
|
|
5
6
|
const comp = componentMaps[name] || (globalConfig.ElementPlus ? globalConfig.ElementPlus[name] : null)
|
|
@@ -8,3 +9,13 @@ export function getCurrComponent (name: string) {
|
|
|
8
9
|
}
|
|
9
10
|
return resolveComponent(name)
|
|
10
11
|
}
|
|
12
|
+
|
|
13
|
+
export function hasInputType (renderOpts: VxeGlobalRendererHandles.RenderOptions) {
|
|
14
|
+
switch (renderOpts.name) {
|
|
15
|
+
case 'ElInput':
|
|
16
|
+
case 'ElInputNumber':
|
|
17
|
+
case 'ElTextarea':
|
|
18
|
+
return true
|
|
19
|
+
}
|
|
20
|
+
return false
|
|
21
|
+
}
|