vxe-pc-ui 4.5.4 → 4.5.6
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/collapse/src/collapse.js +5 -1
- package/es/form/src/form.js +12 -16
- package/es/icon/style.css +1 -1
- package/es/modal/src/modal.js +1 -2
- package/es/split/src/split.js +113 -30
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/upload/src/upload.js +15 -15
- package/es/upload/style.css +1 -1
- package/es/upload/style.min.css +1 -1
- package/es/vxe-upload/style.css +1 -1
- package/es/vxe-upload/style.min.css +1 -1
- package/lib/collapse/src/collapse.js +8 -1
- package/lib/collapse/src/collapse.min.js +1 -1
- package/lib/form/src/form.js +12 -16
- 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 +164 -65
- package/lib/index.umd.min.js +1 -1
- package/lib/modal/src/modal.js +1 -2
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/split/src/split.js +128 -30
- package/lib/split/src/split.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +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/lib/upload/src/upload.js +16 -16
- package/lib/upload/src/upload.min.js +1 -1
- package/lib/upload/style/style.css +1 -1
- package/lib/upload/style/style.min.css +1 -1
- package/lib/vxe-upload/style/style.css +1 -1
- package/lib/vxe-upload/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/collapse/src/collapse.ts +5 -1
- package/packages/form/src/form.ts +12 -16
- package/packages/modal/src/modal.ts +1 -2
- package/packages/split/src/split.ts +120 -33
- package/packages/upload/src/upload.ts +15 -15
- package/styles/components/upload.scss +1 -1
- package/types/components/carousel.d.ts +13 -3
- package/types/components/collapse.d.ts +23 -4
- package/types/components/split-item.d.ts +3 -0
- package/types/components/split.d.ts +62 -1
- /package/es/icon/{iconfont.1743125694154.ttf → iconfont.1743222214469.ttf} +0 -0
- /package/es/icon/{iconfont.1743125694154.woff → iconfont.1743222214469.woff} +0 -0
- /package/es/icon/{iconfont.1743125694154.woff2 → iconfont.1743222214469.woff2} +0 -0
- /package/es/{iconfont.1743125694154.ttf → iconfont.1743222214469.ttf} +0 -0
- /package/es/{iconfont.1743125694154.woff → iconfont.1743222214469.woff} +0 -0
- /package/es/{iconfont.1743125694154.woff2 → iconfont.1743222214469.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1743125694154.ttf → iconfont.1743222214469.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1743125694154.woff → iconfont.1743222214469.woff} +0 -0
- /package/lib/icon/style/{iconfont.1743125694154.woff2 → iconfont.1743222214469.woff2} +0 -0
- /package/lib/{iconfont.1743125694154.ttf → iconfont.1743222214469.ttf} +0 -0
- /package/lib/{iconfont.1743125694154.woff → iconfont.1743222214469.woff} +0 -0
- /package/lib/{iconfont.1743125694154.woff2 → iconfont.1743222214469.woff2} +0 -0
|
@@ -3,9 +3,10 @@ import { getConfig, getIcon, createEvent, globalEvents, renderEmptyElement } fro
|
|
|
3
3
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
4
4
|
import { toCssUnit, isScale, addClass, removeClass } from '../../ui/src/dom'
|
|
5
5
|
import { getGlobalDefaultConfig } from '../../ui/src/utils'
|
|
6
|
+
import { errLog } from '../../ui/src/log'
|
|
6
7
|
import XEUtils from 'xe-utils'
|
|
7
8
|
|
|
8
|
-
import type { SplitReactData, SplitPrivateRef, VxeSplitPropTypes, SplitInternalData, SplitMethods, VxeSplitDefines, VxeSplitPrivateComputed, SplitPrivateMethods, VxeSplitEmits, VxeSplitConstructor, ValueOf, VxeSplitPrivateMethods } from '../../../types'
|
|
9
|
+
import type { SplitReactData, SplitPrivateRef, VxeSplitPropTypes, SplitInternalData, SplitMethods, VxeSplitDefines, VxeSplitItemProps, VxeSplitPrivateComputed, SplitPrivateMethods, VxeSplitEmits, VxeSplitConstructor, ValueOf, VxeSplitPrivateMethods } from '../../../types'
|
|
9
10
|
|
|
10
11
|
export default defineComponent({
|
|
11
12
|
name: 'VxeSplit',
|
|
@@ -24,6 +25,7 @@ export default defineComponent({
|
|
|
24
25
|
type: Boolean as PropType<VxeSplitPropTypes.Padding>,
|
|
25
26
|
default: () => getConfig().split.padding
|
|
26
27
|
},
|
|
28
|
+
items: Array as PropType<VxeSplitPropTypes.Items>,
|
|
27
29
|
itemConfig: Object as PropType<VxeSplitPropTypes.ItemConfig>,
|
|
28
30
|
barConfig: Object as PropType<VxeSplitPropTypes.BarConfig>,
|
|
29
31
|
actionConfig: Object as PropType<VxeSplitPropTypes.ActionConfig>
|
|
@@ -31,6 +33,7 @@ export default defineComponent({
|
|
|
31
33
|
emits: [
|
|
32
34
|
'action-dblclick',
|
|
33
35
|
'action-click',
|
|
36
|
+
'toggle-expand',
|
|
34
37
|
'resize-start',
|
|
35
38
|
'resize-drag',
|
|
36
39
|
'resize-end'
|
|
@@ -43,7 +46,8 @@ export default defineComponent({
|
|
|
43
46
|
const refElem = ref<HTMLDivElement>()
|
|
44
47
|
|
|
45
48
|
const reactData = reactive<SplitReactData>({
|
|
46
|
-
staticItems: []
|
|
49
|
+
staticItems: [],
|
|
50
|
+
itemList: []
|
|
47
51
|
})
|
|
48
52
|
|
|
49
53
|
const internalData: SplitInternalData = {
|
|
@@ -148,8 +152,8 @@ export default defineComponent({
|
|
|
148
152
|
}
|
|
149
153
|
|
|
150
154
|
const reset = () => {
|
|
151
|
-
const {
|
|
152
|
-
|
|
155
|
+
const { itemList } = reactData
|
|
156
|
+
itemList.forEach(item => {
|
|
153
157
|
item.isExpand = true
|
|
154
158
|
item.isVisible = true
|
|
155
159
|
item.foldHeight = 0
|
|
@@ -160,10 +164,50 @@ export default defineComponent({
|
|
|
160
164
|
return nextTick()
|
|
161
165
|
}
|
|
162
166
|
|
|
167
|
+
const handleLoadItem = (list: VxeSplitItemProps[], isReset: boolean) => {
|
|
168
|
+
const { staticItems } = reactData
|
|
169
|
+
const itemDef = {
|
|
170
|
+
isVisible: true,
|
|
171
|
+
isExpand: true,
|
|
172
|
+
renderWidth: 0,
|
|
173
|
+
resizeWidth: 0,
|
|
174
|
+
foldWidth: 0,
|
|
175
|
+
renderHeight: 0,
|
|
176
|
+
resizeHeight: 0,
|
|
177
|
+
foldHeight: 0
|
|
178
|
+
}
|
|
179
|
+
reactData.itemList = list.map(item => {
|
|
180
|
+
if (item.slots) {
|
|
181
|
+
XEUtils.each(item.slots, (func) => {
|
|
182
|
+
if (!XEUtils.isFunction(func)) {
|
|
183
|
+
if (!slots[func]) {
|
|
184
|
+
errLog('vxe.error.notSlot', [func])
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
})
|
|
188
|
+
}
|
|
189
|
+
return Object.assign({}, isReset ? null : itemDef, item, isReset ? itemDef : null, {
|
|
190
|
+
id: XEUtils.uniqueId()
|
|
191
|
+
})
|
|
192
|
+
})
|
|
193
|
+
if (staticItems.length) {
|
|
194
|
+
errLog('vxe.error.errConflicts', ['<vxe-split-item ...>', 'items'])
|
|
195
|
+
}
|
|
196
|
+
return recalculate()
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const loadItem = (list: VxeSplitItemProps[]) => {
|
|
200
|
+
return handleLoadItem(list || [], false)
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
const reloadItem = (list: VxeSplitItemProps[]) => {
|
|
204
|
+
return handleLoadItem(list || [], true)
|
|
205
|
+
}
|
|
206
|
+
|
|
163
207
|
const recalculate = () => {
|
|
164
208
|
return nextTick().then(() => {
|
|
165
209
|
const { vertical } = props
|
|
166
|
-
const {
|
|
210
|
+
const { itemList } = reactData
|
|
167
211
|
const el = refElem.value
|
|
168
212
|
if (!el) {
|
|
169
213
|
return
|
|
@@ -179,7 +223,7 @@ export default defineComponent({
|
|
|
179
223
|
const residueItems: VxeSplitDefines.ChunkConfig[] = []
|
|
180
224
|
if (vertical) {
|
|
181
225
|
let countHeight = 0
|
|
182
|
-
|
|
226
|
+
itemList.forEach(item => {
|
|
183
227
|
const { height } = item
|
|
184
228
|
let itemHeight = 0
|
|
185
229
|
if (height) {
|
|
@@ -202,7 +246,7 @@ export default defineComponent({
|
|
|
202
246
|
}
|
|
203
247
|
} else {
|
|
204
248
|
let countWidth = 0
|
|
205
|
-
|
|
249
|
+
itemList.forEach(item => {
|
|
206
250
|
const { width } = item
|
|
207
251
|
let itemWidth = 0
|
|
208
252
|
if (width) {
|
|
@@ -230,7 +274,7 @@ export default defineComponent({
|
|
|
230
274
|
const dragEvent = (evnt: MouseEvent) => {
|
|
231
275
|
evnt.preventDefault()
|
|
232
276
|
const { vertical } = props
|
|
233
|
-
const {
|
|
277
|
+
const { itemList } = reactData
|
|
234
278
|
const barEl = evnt.currentTarget as HTMLDivElement
|
|
235
279
|
const handleEl = barEl.parentElement as HTMLDivElement
|
|
236
280
|
const el = refElem.value
|
|
@@ -238,8 +282,8 @@ export default defineComponent({
|
|
|
238
282
|
return
|
|
239
283
|
}
|
|
240
284
|
const itemId = handleEl.getAttribute('itemid')
|
|
241
|
-
const itemIndex = XEUtils.findIndexOf(
|
|
242
|
-
const item =
|
|
285
|
+
const itemIndex = XEUtils.findIndexOf(itemList, item => item.id === itemId)
|
|
286
|
+
const item = itemList[itemIndex]
|
|
243
287
|
if (!item) {
|
|
244
288
|
return
|
|
245
289
|
}
|
|
@@ -250,7 +294,7 @@ export default defineComponent({
|
|
|
250
294
|
const itemOpts = computeItemOpts.value
|
|
251
295
|
const allMinWidth = XEUtils.toNumber(itemOpts.minWidth)
|
|
252
296
|
const allMinHeight = XEUtils.toNumber(itemOpts.minHeight)
|
|
253
|
-
const targetItem =
|
|
297
|
+
const targetItem = itemList[itemIndex + (isFoldNext ? 1 : -1)]
|
|
254
298
|
const targetItemEl = targetItem ? el.querySelector<HTMLDivElement>(`.vxe-split-item[itemid="${targetItem.id}"]`) : null
|
|
255
299
|
const currItemEl = item ? el.querySelector<HTMLDivElement>(`.vxe-split-item[itemid="${item.id}"]`) : null
|
|
256
300
|
const targetWidth = targetItemEl ? targetItemEl.clientWidth : 0
|
|
@@ -326,14 +370,14 @@ export default defineComponent({
|
|
|
326
370
|
return
|
|
327
371
|
}
|
|
328
372
|
const { vertical } = props
|
|
329
|
-
const {
|
|
373
|
+
const { itemList } = reactData
|
|
330
374
|
const isFoldNext = computeIsFoldNext.value
|
|
331
375
|
const btnEl = evnt.currentTarget as HTMLDivElement
|
|
332
376
|
const handleEl = btnEl.parentElement as HTMLDivElement
|
|
333
377
|
const itemId = handleEl.getAttribute('itemid')
|
|
334
|
-
const itemIndex = XEUtils.findIndexOf(
|
|
335
|
-
const item =
|
|
336
|
-
const targetItem =
|
|
378
|
+
const itemIndex = XEUtils.findIndexOf(itemList, item => item.id === itemId)
|
|
379
|
+
const item = itemList[itemIndex]
|
|
380
|
+
const targetItem = itemList[itemIndex + (isFoldNext ? 1 : -1)]
|
|
337
381
|
if (item) {
|
|
338
382
|
const { showAction, isExpand } = item
|
|
339
383
|
if (showAction) {
|
|
@@ -354,12 +398,42 @@ export default defineComponent({
|
|
|
354
398
|
item.foldWidth = isExpand ? (targetItem.resizeWidth || targetItem.renderWidth) + (item.resizeWidth || item.renderWidth) : 0
|
|
355
399
|
}
|
|
356
400
|
}
|
|
357
|
-
dispatchEvent(
|
|
401
|
+
dispatchEvent('toggle-expand', { item, name: item.name, targetItem, targetName: targetItem ? targetItem.name : '', expanded: item.isExpand }, evnt)
|
|
358
402
|
recalculate()
|
|
359
403
|
}
|
|
360
404
|
}
|
|
361
405
|
}
|
|
362
406
|
|
|
407
|
+
const handleActionDblclickEvent = (evnt: MouseEvent) => {
|
|
408
|
+
const { itemList } = reactData
|
|
409
|
+
const actionOpts = computeActionOpts.value
|
|
410
|
+
const btnEl = evnt.currentTarget as HTMLDivElement
|
|
411
|
+
const handleEl = btnEl.parentElement as HTMLDivElement
|
|
412
|
+
const itemId = handleEl.getAttribute('itemid')
|
|
413
|
+
const itemIndex = XEUtils.findIndexOf(itemList, item => item.id === itemId)
|
|
414
|
+
const item = itemList[itemIndex]
|
|
415
|
+
|
|
416
|
+
if (actionOpts.trigger === 'dblclick') {
|
|
417
|
+
handleItemActionEvent(evnt)
|
|
418
|
+
}
|
|
419
|
+
dispatchEvent('action-dblclick', { item, name: item ? item.name : '' }, evnt)
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
const handleActionClickEvent = (evnt: MouseEvent) => {
|
|
423
|
+
const { itemList } = reactData
|
|
424
|
+
const actionOpts = computeActionOpts.value
|
|
425
|
+
const btnEl = evnt.currentTarget as HTMLDivElement
|
|
426
|
+
const handleEl = btnEl.parentElement as HTMLDivElement
|
|
427
|
+
const itemId = handleEl.getAttribute('itemid')
|
|
428
|
+
const itemIndex = XEUtils.findIndexOf(itemList, item => item.id === itemId)
|
|
429
|
+
const item = itemList[itemIndex]
|
|
430
|
+
|
|
431
|
+
if (actionOpts.trigger !== 'dblclick') {
|
|
432
|
+
handleItemActionEvent(evnt)
|
|
433
|
+
}
|
|
434
|
+
dispatchEvent('action-click', { item, name: item ? item.name : '' }, evnt)
|
|
435
|
+
}
|
|
436
|
+
|
|
363
437
|
const handleGlobalResizeEvent = () => {
|
|
364
438
|
recalculate()
|
|
365
439
|
}
|
|
@@ -367,7 +441,9 @@ export default defineComponent({
|
|
|
367
441
|
const splitMethods: SplitMethods = {
|
|
368
442
|
dispatchEvent,
|
|
369
443
|
recalculate,
|
|
370
|
-
reset
|
|
444
|
+
reset,
|
|
445
|
+
loadItem,
|
|
446
|
+
reloadItem
|
|
371
447
|
}
|
|
372
448
|
|
|
373
449
|
const splitPrivateMethods: SplitPrivateMethods = {
|
|
@@ -381,15 +457,6 @@ export default defineComponent({
|
|
|
381
457
|
const isFoldNext = computeIsFoldNext.value
|
|
382
458
|
const { id, isExpand, showAction } = item
|
|
383
459
|
|
|
384
|
-
const btnOns: {
|
|
385
|
-
onClick?: (evnt: MouseEvent) => void
|
|
386
|
-
onDblclick?: (evnt: MouseEvent) => void
|
|
387
|
-
} = {}
|
|
388
|
-
if (actionOpts.trigger === 'dblclick') {
|
|
389
|
-
btnOns.onDblclick = handleItemActionEvent
|
|
390
|
-
} else {
|
|
391
|
-
btnOns.onClick = handleItemActionEvent
|
|
392
|
-
}
|
|
393
460
|
return h('div', {
|
|
394
461
|
itemid: id,
|
|
395
462
|
class: ['vxe-split-item-handle', isFoldNext ? 'to--next' : 'to--prev']
|
|
@@ -402,7 +469,8 @@ export default defineComponent({
|
|
|
402
469
|
showAction
|
|
403
470
|
? h('span', {
|
|
404
471
|
class: 'vxe-split-item-action-btn',
|
|
405
|
-
|
|
472
|
+
onDblclick: handleActionDblclickEvent,
|
|
473
|
+
onClick: handleActionClickEvent
|
|
406
474
|
}, [
|
|
407
475
|
h('i', {
|
|
408
476
|
class: (isExpand ? actionOpts.openIcon : actionOpts.closeIcon) || getDefaultActionIcon(item)
|
|
@@ -414,11 +482,11 @@ export default defineComponent({
|
|
|
414
482
|
|
|
415
483
|
const renderItems = () => {
|
|
416
484
|
const { border, padding, vertical } = props
|
|
417
|
-
const {
|
|
485
|
+
const { itemList } = reactData
|
|
418
486
|
const isFoldNext = computeIsFoldNext.value
|
|
419
487
|
const itemVNs: VNode[] = []
|
|
420
|
-
|
|
421
|
-
const { id, slots, renderHeight, resizeHeight, foldHeight, renderWidth, resizeWidth, foldWidth, isVisible, isExpand } = item
|
|
488
|
+
itemList.forEach((item, index) => {
|
|
489
|
+
const { id, name, slots, renderHeight, resizeHeight, foldHeight, renderWidth, resizeWidth, foldWidth, isVisible, isExpand } = item
|
|
422
490
|
const defaultSlot = slots ? slots.default : null
|
|
423
491
|
const stys: Record<string, string | number> = {}
|
|
424
492
|
const itemWidth = isVisible ? (foldWidth || resizeWidth || renderWidth) : 0
|
|
@@ -454,9 +522,9 @@ export default defineComponent({
|
|
|
454
522
|
}, [
|
|
455
523
|
h('div', {
|
|
456
524
|
class: 'vxe-split-item--inner'
|
|
457
|
-
}, defaultSlot ? callSlot(defaultSlot, { }) : [])
|
|
525
|
+
}, defaultSlot ? callSlot(defaultSlot, { name, isVisible, isExpand }) : [])
|
|
458
526
|
]),
|
|
459
|
-
isFoldNext && index <
|
|
527
|
+
isFoldNext && index < itemList.length - 1 ? renderHandleBar(item) : renderEmptyElement($xeSplit)
|
|
460
528
|
])
|
|
461
529
|
)
|
|
462
530
|
})
|
|
@@ -487,7 +555,22 @@ export default defineComponent({
|
|
|
487
555
|
])
|
|
488
556
|
}
|
|
489
557
|
|
|
490
|
-
|
|
558
|
+
const itemFlag = ref(0)
|
|
559
|
+
watch(() => props.items ? props.items.length : -1, () => {
|
|
560
|
+
itemFlag.value++
|
|
561
|
+
})
|
|
562
|
+
watch(() => props.items, () => {
|
|
563
|
+
itemFlag.value++
|
|
564
|
+
})
|
|
565
|
+
watch(itemFlag, () => {
|
|
566
|
+
loadItem(props.items || [])
|
|
567
|
+
})
|
|
568
|
+
|
|
569
|
+
watch(() => reactData.staticItems, (val) => {
|
|
570
|
+
if (props.items && props.items.length) {
|
|
571
|
+
errLog('vxe.error.errConflicts', ['<vxe-split-item ...>', 'items'])
|
|
572
|
+
}
|
|
573
|
+
reactData.itemList = val
|
|
491
574
|
recalculate()
|
|
492
575
|
})
|
|
493
576
|
|
|
@@ -507,6 +590,10 @@ export default defineComponent({
|
|
|
507
590
|
recalculate()
|
|
508
591
|
})
|
|
509
592
|
|
|
593
|
+
if (props.items) {
|
|
594
|
+
loadItem(props.items)
|
|
595
|
+
}
|
|
596
|
+
|
|
510
597
|
provide('$xeSplit', $xeSplit)
|
|
511
598
|
|
|
512
599
|
$xeSplit.renderVN = renderVN
|
|
@@ -280,7 +280,7 @@ export default defineComponent({
|
|
|
280
280
|
return ''
|
|
281
281
|
})
|
|
282
282
|
|
|
283
|
-
const
|
|
283
|
+
const computedDefTipText = computed(() => {
|
|
284
284
|
const { limitSize, fileTypes, multiple, limitCount } = props
|
|
285
285
|
const tipText = props.tipText || props.hintText
|
|
286
286
|
const isImage = computeIsImage.value
|
|
@@ -288,26 +288,26 @@ export default defineComponent({
|
|
|
288
288
|
if (XEUtils.isString(tipText)) {
|
|
289
289
|
return tipText
|
|
290
290
|
}
|
|
291
|
-
const
|
|
291
|
+
const defTips: string[] = []
|
|
292
292
|
if (isImage) {
|
|
293
293
|
if (multiple && limitCount) {
|
|
294
|
-
|
|
294
|
+
defTips.push(getI18n('vxe.upload.imgCountHint', [limitCount]))
|
|
295
295
|
}
|
|
296
296
|
if (limitSize && limitSizeUnit) {
|
|
297
|
-
|
|
297
|
+
defTips.push(getI18n('vxe.upload.imgSizeHint', [limitSizeUnit]))
|
|
298
298
|
}
|
|
299
299
|
} else {
|
|
300
300
|
if (fileTypes && fileTypes.length) {
|
|
301
|
-
|
|
301
|
+
defTips.push(getI18n('vxe.upload.fileTypeHint', [fileTypes.join('/')]))
|
|
302
302
|
}
|
|
303
303
|
if (limitSize && limitSizeUnit) {
|
|
304
|
-
|
|
304
|
+
defTips.push(getI18n('vxe.upload.fileSizeHint', [limitSizeUnit]))
|
|
305
305
|
}
|
|
306
306
|
if (multiple && limitCount) {
|
|
307
|
-
|
|
307
|
+
defTips.push(getI18n('vxe.upload.fileCountHint', [limitCount]))
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
-
return
|
|
310
|
+
return defTips.join(getI18n('vxe.base.comma'))
|
|
311
311
|
})
|
|
312
312
|
|
|
313
313
|
const computeImageOpts = computed(() => {
|
|
@@ -1244,7 +1244,7 @@ export default defineComponent({
|
|
|
1244
1244
|
const { showUploadButton, buttonText, buttonIcon, showButtonText, showButtonIcon, autoHiddenButton } = props
|
|
1245
1245
|
const isDisabled = computeIsDisabled.value
|
|
1246
1246
|
const formReadonly = computeFormReadonly.value
|
|
1247
|
-
const
|
|
1247
|
+
const defTipText = computedDefTipText.value
|
|
1248
1248
|
const overCount = computeOverCount.value
|
|
1249
1249
|
const defaultSlot = slots.default
|
|
1250
1250
|
const tipSlot = slots.tip || slots.hint
|
|
@@ -1270,10 +1270,10 @@ export default defineComponent({
|
|
|
1270
1270
|
disabled: isDisabled
|
|
1271
1271
|
})
|
|
1272
1272
|
]),
|
|
1273
|
-
|
|
1273
|
+
defTipText || tipSlot
|
|
1274
1274
|
? h('div', {
|
|
1275
1275
|
class: 'vxe-upload--file-action-tip'
|
|
1276
|
-
}, tipSlot ? getSlotVNs(tipSlot({ $upload: $xeUpload })) :
|
|
1276
|
+
}, tipSlot ? getSlotVNs(tipSlot({ $upload: $xeUpload })) : defTipText)
|
|
1277
1277
|
: createCommentVNode()
|
|
1278
1278
|
])
|
|
1279
1279
|
}
|
|
@@ -1467,11 +1467,11 @@ export default defineComponent({
|
|
|
1467
1467
|
const renderImageAction = (isMoreView: boolean) => {
|
|
1468
1468
|
const { showUploadButton, buttonText, buttonIcon, showButtonText, showButtonIcon, autoHiddenButton } = props
|
|
1469
1469
|
const formReadonly = computeFormReadonly.value
|
|
1470
|
-
const
|
|
1470
|
+
const defTipText = computedDefTipText.value
|
|
1471
1471
|
const overCount = computeOverCount.value
|
|
1472
1472
|
const imgStyle = computeImgStyle.value
|
|
1473
1473
|
const defaultSlot = slots.default
|
|
1474
|
-
const
|
|
1474
|
+
const tipSlot = slots.tip || slots.hint
|
|
1475
1475
|
|
|
1476
1476
|
if (formReadonly || !showUploadButton || (autoHiddenButton && overCount)) {
|
|
1477
1477
|
return createCommentVNode()
|
|
@@ -1504,10 +1504,10 @@ export default defineComponent({
|
|
|
1504
1504
|
class: 'vxe-upload--image-action-content'
|
|
1505
1505
|
}, buttonText ? `${buttonText}` : getI18n('vxe.upload.imgBtnText'))
|
|
1506
1506
|
: createCommentVNode(),
|
|
1507
|
-
|
|
1507
|
+
defTipText || tipSlot
|
|
1508
1508
|
? h('div', {
|
|
1509
1509
|
class: 'vxe-upload--image-action-hint'
|
|
1510
|
-
},
|
|
1510
|
+
}, tipSlot ? getSlotVNs(tipSlot({ $upload: $xeUpload })) : defTipText)
|
|
1511
1511
|
: createCommentVNode()
|
|
1512
1512
|
])
|
|
1513
1513
|
])
|
|
@@ -101,13 +101,23 @@ export namespace VxeCarouselDefines {
|
|
|
101
101
|
className: VxeCarouselItemPropTypes.ClassName | undefined
|
|
102
102
|
slots: VxeCarouselItemSlots
|
|
103
103
|
}
|
|
104
|
+
|
|
105
|
+
export interface ChangeEventParams extends CarouselEventParams {
|
|
106
|
+
value: VxeCarouselPropTypes.ModelValue
|
|
107
|
+
}
|
|
104
108
|
}
|
|
105
109
|
|
|
106
|
-
export type VxeCarouselEventProps = {
|
|
110
|
+
export type VxeCarouselEventProps = {
|
|
111
|
+
onChange?: VxeCarouselEvents.Change
|
|
112
|
+
}
|
|
107
113
|
|
|
108
|
-
export interface VxeCarouselListeners {
|
|
114
|
+
export interface VxeCarouselListeners {
|
|
115
|
+
change?: VxeCarouselEvents.Change
|
|
116
|
+
}
|
|
109
117
|
|
|
110
|
-
export namespace VxeCarouselEvents {
|
|
118
|
+
export namespace VxeCarouselEvents {
|
|
119
|
+
export type Change = (params: VxeCarouselDefines.ChangeEventParams) => void
|
|
120
|
+
}
|
|
111
121
|
|
|
112
122
|
export namespace VxeCarouselSlotTypes {
|
|
113
123
|
export interface DefaultSlotParams {}
|
|
@@ -68,20 +68,39 @@ export interface VxeCollapsePrivateMethods extends CollapsePrivateMethods { }
|
|
|
68
68
|
export type VxeCollapseEmits = [
|
|
69
69
|
'update:modelValue',
|
|
70
70
|
'load',
|
|
71
|
-
'change'
|
|
71
|
+
'change',
|
|
72
|
+
'toggle-expand',
|
|
72
73
|
]
|
|
73
74
|
|
|
74
75
|
export namespace VxeCollapseDefines {
|
|
75
76
|
export interface CollapseEventParams extends VxeComponentEventParams {
|
|
76
77
|
$collapse: VxeCollapseConstructor
|
|
77
78
|
}
|
|
79
|
+
export interface ChangeEventParams extends CollapseEventParams {
|
|
80
|
+
value: (string | number)[]
|
|
81
|
+
name: VxeCollapsePanePropTypes.Name
|
|
82
|
+
}
|
|
83
|
+
export interface ToggleExpandEventParams extends CollapseEventParams {
|
|
84
|
+
value: (string | number)[]
|
|
85
|
+
name: VxeCollapsePanePropTypes.Name
|
|
86
|
+
expanded: boolean
|
|
87
|
+
}
|
|
78
88
|
}
|
|
79
89
|
|
|
80
|
-
export type VxeCollapseEventProps = {
|
|
90
|
+
export type VxeCollapseEventProps = {
|
|
91
|
+
onChange?: VxeCollapseEvents.Change
|
|
92
|
+
onToggleExpand?: VxeCollapseEvents.ToggleExpand
|
|
93
|
+
}
|
|
81
94
|
|
|
82
|
-
export interface VxeCollapseListeners {
|
|
95
|
+
export interface VxeCollapseListeners {
|
|
96
|
+
change?: VxeCollapseEvents.Change
|
|
97
|
+
onToggleExpand?: VxeCollapseEvents.ToggleExpand
|
|
98
|
+
}
|
|
83
99
|
|
|
84
|
-
export namespace VxeCollapseEvents {
|
|
100
|
+
export namespace VxeCollapseEvents {
|
|
101
|
+
export type Change = (params: VxeCollapseDefines.ChangeEventParams) => void
|
|
102
|
+
export type ToggleExpand = (params: VxeCollapseDefines.ToggleExpandEventParams) => void
|
|
103
|
+
}
|
|
85
104
|
|
|
86
105
|
export namespace VxeCollapseSlotTypes {
|
|
87
106
|
export interface DefaultSlotParams {}
|
|
@@ -29,6 +29,7 @@ export namespace VxeSplitPropTypes {
|
|
|
29
29
|
export type Padding = boolean
|
|
30
30
|
export type Vertical = boolean
|
|
31
31
|
export type Border = boolean
|
|
32
|
+
export type Items = VxeSplitItemProps[]
|
|
32
33
|
export interface ItemConfig {
|
|
33
34
|
minWidth?: string | number
|
|
34
35
|
minHeight?: string | number
|
|
@@ -63,13 +64,41 @@ export namespace VxeSplitPropTypes {
|
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
export type VxeSplitProps = {
|
|
67
|
+
/**
|
|
68
|
+
* 高度
|
|
69
|
+
*/
|
|
66
70
|
height?: VxeSplitPropTypes.Height
|
|
71
|
+
/**
|
|
72
|
+
* 宽度
|
|
73
|
+
*/
|
|
67
74
|
width?: VxeSplitPropTypes.Width
|
|
75
|
+
/**
|
|
76
|
+
* 显示边距
|
|
77
|
+
*/
|
|
68
78
|
padding?: VxeSplitPropTypes.Padding
|
|
79
|
+
/**
|
|
80
|
+
* 使用垂直布局
|
|
81
|
+
*/
|
|
69
82
|
vertical?: VxeSplitPropTypes.Vertical
|
|
83
|
+
/**
|
|
84
|
+
* 是否带有边框
|
|
85
|
+
*/
|
|
70
86
|
border?: VxeSplitPropTypes.Border
|
|
87
|
+
/**
|
|
88
|
+
* 面板列表
|
|
89
|
+
*/
|
|
90
|
+
items?: VxeSplitPropTypes.Items
|
|
91
|
+
/**
|
|
92
|
+
* 面板的配置项
|
|
93
|
+
*/
|
|
71
94
|
itemConfig?: VxeSplitPropTypes.ItemConfig
|
|
95
|
+
/**
|
|
96
|
+
* 拖动条配置项
|
|
97
|
+
*/
|
|
72
98
|
barConfig?: VxeSplitPropTypes.BarConfig
|
|
99
|
+
/**
|
|
100
|
+
* 折叠按钮配置项
|
|
101
|
+
*/
|
|
73
102
|
actionConfig?: VxeSplitPropTypes.ActionConfig
|
|
74
103
|
}
|
|
75
104
|
|
|
@@ -83,6 +112,7 @@ export interface VxeSplitPrivateComputed extends SplitPrivateComputed { }
|
|
|
83
112
|
|
|
84
113
|
export interface SplitReactData {
|
|
85
114
|
staticItems: VxeSplitDefines.ChunkConfig[]
|
|
115
|
+
itemList: VxeSplitDefines.ChunkConfig[]
|
|
86
116
|
}
|
|
87
117
|
|
|
88
118
|
export interface SplitInternalData {
|
|
@@ -90,8 +120,22 @@ export interface SplitInternalData {
|
|
|
90
120
|
|
|
91
121
|
export interface SplitMethods {
|
|
92
122
|
dispatchEvent(type: ValueOf<VxeSplitEmits>, params: Record<string, any>, evnt: Event | null): void
|
|
123
|
+
/**
|
|
124
|
+
* 重新计算布局
|
|
125
|
+
*/
|
|
93
126
|
recalculate(): Promise<void>
|
|
127
|
+
/**
|
|
128
|
+
* 重置面板
|
|
129
|
+
*/
|
|
94
130
|
reset(): Promise<void>
|
|
131
|
+
/**
|
|
132
|
+
* 加载面板配置
|
|
133
|
+
*/
|
|
134
|
+
loadItem(list: VxeSplitItemProps[]): Promise<void>
|
|
135
|
+
/**
|
|
136
|
+
* 重新加载面板配置,区别就是会重置
|
|
137
|
+
*/
|
|
138
|
+
reloadItem(list: VxeSplitItemProps[]): Promise<void>
|
|
95
139
|
}
|
|
96
140
|
export interface VxeSplitMethods extends SplitMethods { }
|
|
97
141
|
|
|
@@ -101,6 +145,7 @@ export interface VxeSplitPrivateMethods extends SplitPrivateMethods { }
|
|
|
101
145
|
export type VxeSplitEmits = [
|
|
102
146
|
'action-dblclick',
|
|
103
147
|
'action-click',
|
|
148
|
+
'toggle-expand',
|
|
104
149
|
'resize-start',
|
|
105
150
|
'resize-drag',
|
|
106
151
|
'resize-end'
|
|
@@ -126,11 +171,15 @@ export namespace VxeSplitDefines {
|
|
|
126
171
|
export interface ActionClickEventParams extends SplitEventParams {
|
|
127
172
|
item: ChunkConfig
|
|
128
173
|
name: VxeSplitItemPropTypes.Name
|
|
174
|
+
}
|
|
175
|
+
export interface ActionDblclickEventParams extends ActionClickEventParams {}
|
|
176
|
+
export interface ToggleExpandEventParams extends SplitEventParams {
|
|
177
|
+
item: ChunkConfig
|
|
178
|
+
name: VxeSplitItemPropTypes.Name
|
|
129
179
|
targetItem: ChunkConfig
|
|
130
180
|
targetName: VxeSplitItemPropTypes.Name
|
|
131
181
|
expanded: boolean
|
|
132
182
|
}
|
|
133
|
-
export interface ActionDblclickEventParams extends ActionClickEventParams {}
|
|
134
183
|
export interface ResizeStartEventParams extends SplitEventParams {
|
|
135
184
|
item: ChunkConfig
|
|
136
185
|
name: VxeSplitItemPropTypes.Name
|
|
@@ -154,6 +203,7 @@ export namespace VxeSplitDefines {
|
|
|
154
203
|
export type VxeSplitEventProps = {
|
|
155
204
|
onActionDblclick?: VxeSplitEvents.ActionDblclick
|
|
156
205
|
onActionClick?: VxeSplitEvents.ActionClick
|
|
206
|
+
onToggleExpand?: VxeSplitEvents.ToggleExpand
|
|
157
207
|
onResizeStart?: VxeSplitEvents.ResizeStart
|
|
158
208
|
onResizeDrag?: VxeSplitEvents.ResizeDrag
|
|
159
209
|
onResizeEnd?: VxeSplitEvents.ResizeEnd
|
|
@@ -162,6 +212,7 @@ export type VxeSplitEventProps = {
|
|
|
162
212
|
export interface VxeSplitListeners {
|
|
163
213
|
actionDblclick?: VxeSplitEvents.ActionDblclick
|
|
164
214
|
actionClick?: VxeSplitEvents.ActionClick
|
|
215
|
+
toggleExpand?: VxeSplitEvents.ToggleExpand
|
|
165
216
|
resizeStart?: VxeSplitEvents.ResizeStart
|
|
166
217
|
resizeDrag?: VxeSplitEvents.ResizeDrag
|
|
167
218
|
resizeEnd?: VxeSplitEvents.ResizeEnd
|
|
@@ -170,6 +221,7 @@ export interface VxeSplitListeners {
|
|
|
170
221
|
export namespace VxeSplitEvents {
|
|
171
222
|
export type ActionDblclick = (params: VxeSplitDefines.ActionDblclickEventParams) => void
|
|
172
223
|
export type ActionClick = (params: VxeSplitDefines.ActionClickEventParams) => void
|
|
224
|
+
export type ToggleExpand = (params: VxeSplitDefines.ToggleExpandEventParams) => void
|
|
173
225
|
export type ResizeStart = (params: VxeSplitDefines.ResizeStartEventParams) => void
|
|
174
226
|
export type ResizeDrag = (params: VxeSplitDefines.ResizeDragEventParams) => void
|
|
175
227
|
export type ResizeEnd = (params: VxeSplitDefines.ResizeEndEventParams) => void
|
|
@@ -181,6 +233,15 @@ export namespace VxeSplitSlotTypes {
|
|
|
181
233
|
}
|
|
182
234
|
|
|
183
235
|
export interface VxeSplitSlots {
|
|
236
|
+
/**
|
|
237
|
+
* 自定义插槽模板
|
|
238
|
+
*/
|
|
239
|
+
[key: string]: ((params: {
|
|
240
|
+
name: VxeSplitItemPropTypes.Name
|
|
241
|
+
isVisible: boolean
|
|
242
|
+
isExpand: boolean
|
|
243
|
+
}) => any) | undefined
|
|
244
|
+
|
|
184
245
|
default?: (params: VxeSplitSlotTypes.DefaultSlotParams) => any
|
|
185
246
|
}
|
|
186
247
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|