vxe-pc-ui 4.6.8 → 4.6.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/alert/src/alert.js +5 -5
- package/es/anchor/src/anchor-link.js +3 -2
- package/es/anchor/src/anchor.js +3 -3
- package/es/breadcrumb/src/breadcrumb-item.js +3 -2
- package/es/button/src/button-group.js +3 -3
- package/es/button/src/button.js +7 -8
- package/es/card/src/card.js +7 -7
- package/es/carousel/src/carousel.js +3 -3
- package/es/countdown/src/countdown.js +4 -4
- package/es/form/render/index.js +2 -4
- package/es/form/src/form-group.js +5 -3
- package/es/form/src/form-item.js +6 -4
- package/es/form/src/form.js +97 -37
- package/es/form-design/src/default-setting-form.js +1 -1
- package/es/form-design/src/form-view.js +7 -9
- package/es/icon/style.css +1 -1
- package/es/icon-picker/src/icon-picker.js +4 -4
- package/es/image/src/group.js +3 -1
- package/es/image/src/image.js +3 -1
- package/es/image/src/preview.js +33 -19
- package/es/image/src/util.js +1 -0
- package/es/list-design/src/layout-preview.js +5 -7
- package/es/list-design/src/list-view.js +8 -10
- package/es/loading/src/loading.js +3 -3
- package/es/menu/src/menu.js +9 -9
- package/es/modal/src/modal.js +16 -18
- package/es/pager/src/pager.js +1 -3
- package/es/password-input/src/password-input.js +7 -7
- package/es/print/src/print.js +6 -6
- package/es/pulldown/src/pulldown.js +4 -4
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/switch/src/switch.js +4 -4
- package/es/table-select/src/table-select.js +5 -7
- package/es/tabs/src/tabs.js +11 -15
- package/es/tag/src/tag.js +3 -3
- package/es/tip/src/tip.js +5 -5
- package/es/tree/src/tree.js +245 -180
- package/es/ui/index.js +3 -7
- package/es/ui/src/log.js +1 -1
- package/es/upload/src/upload.js +31 -33
- package/lib/alert/src/alert.js +3 -3
- package/lib/alert/src/alert.min.js +1 -1
- package/lib/anchor/src/anchor-link.js +2 -1
- package/lib/anchor/src/anchor-link.min.js +1 -1
- package/lib/anchor/src/anchor.js +3 -3
- package/lib/anchor/src/anchor.min.js +1 -1
- package/lib/breadcrumb/src/breadcrumb-item.js +2 -1
- package/lib/breadcrumb/src/breadcrumb-item.min.js +1 -1
- package/lib/button/src/button-group.js +6 -6
- package/lib/button/src/button-group.min.js +1 -1
- package/lib/button/src/button.js +4 -6
- package/lib/button/src/button.min.js +1 -1
- package/lib/card/src/card.js +4 -4
- package/lib/card/src/card.min.js +1 -1
- package/lib/carousel/src/carousel.js +1 -1
- package/lib/carousel/src/carousel.min.js +1 -1
- package/lib/countdown/src/countdown.js +2 -2
- package/lib/countdown/src/countdown.min.js +1 -1
- package/lib/form/render/index.js +2 -4
- package/lib/form/render/index.min.js +1 -1
- package/lib/form/src/form-group.js +3 -1
- package/lib/form/src/form-group.min.js +1 -1
- package/lib/form/src/form-item.js +4 -2
- package/lib/form/src/form-item.min.js +1 -1
- package/lib/form/src/form.js +95 -36
- package/lib/form/src/form.min.js +1 -1
- package/lib/form-design/src/default-setting-form.js +12 -12
- package/lib/form-design/src/default-setting-form.min.js +1 -1
- package/lib/form-design/src/form-view.js +5 -7
- package/lib/form-design/src/form-view.min.js +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/icon-picker/src/icon-picker.js +2 -2
- package/lib/icon-picker/src/icon-picker.min.js +1 -1
- package/lib/image/src/group.js +3 -0
- package/lib/image/src/group.min.js +1 -1
- package/lib/image/src/image.js +3 -0
- package/lib/image/src/image.min.js +1 -1
- package/lib/image/src/preview.js +20 -8
- package/lib/image/src/preview.min.js +1 -1
- package/lib/image/src/util.js +1 -0
- package/lib/image/src/util.min.js +1 -1
- package/lib/index.umd.js +549 -377
- package/lib/index.umd.min.js +1 -1
- package/lib/list-design/src/layout-preview.js +5 -7
- package/lib/list-design/src/layout-preview.min.js +1 -1
- package/lib/list-design/src/list-view.js +6 -8
- package/lib/list-design/src/list-view.min.js +1 -1
- package/lib/loading/src/loading.js +1 -1
- package/lib/loading/src/loading.min.js +1 -1
- package/lib/menu/src/menu.js +6 -6
- package/lib/menu/src/menu.min.js +1 -1
- package/lib/modal/src/modal.js +12 -14
- package/lib/modal/src/modal.min.js +1 -1
- package/lib/pager/src/pager.js +1 -3
- package/lib/pager/src/pager.min.js +1 -1
- package/lib/password-input/src/password-input.js +4 -4
- package/lib/password-input/src/password-input.min.js +1 -1
- package/lib/print/src/print.js +4 -4
- package/lib/print/src/print.min.js +1 -1
- package/lib/pulldown/src/pulldown.js +2 -2
- package/lib/pulldown/src/pulldown.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/switch/src/switch.js +2 -2
- package/lib/switch/src/switch.min.js +1 -1
- package/lib/table-select/src/table-select.js +5 -7
- package/lib/table-select/src/table-select.min.js +1 -1
- package/lib/tabs/src/tabs.js +10 -14
- package/lib/tabs/src/tabs.min.js +1 -1
- package/lib/tag/src/tag.js +1 -1
- package/lib/tag/src/tag.min.js +1 -1
- package/lib/tip/src/tip.js +3 -3
- package/lib/tip/src/tip.min.js +1 -1
- package/lib/tree/src/tree.js +298 -184
- package/lib/tree/src/tree.min.js +1 -1
- package/lib/ui/index.js +3 -7
- 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 +27 -29
- package/lib/upload/src/upload.min.js +1 -1
- package/package.json +1 -1
- package/packages/alert/src/alert.ts +5 -5
- package/packages/anchor/src/anchor-link.ts +3 -2
- package/packages/anchor/src/anchor.ts +3 -3
- package/packages/breadcrumb/src/breadcrumb-item.ts +3 -2
- package/packages/button/src/button-group.ts +3 -3
- package/packages/button/src/button.ts +7 -8
- package/packages/card/src/card.ts +7 -7
- package/packages/carousel/src/carousel.ts +3 -3
- package/packages/countdown/src/countdown.ts +4 -4
- package/packages/form/render/index.ts +2 -4
- package/packages/form/src/form-group.ts +7 -3
- package/packages/form/src/form-item.ts +7 -4
- package/packages/form/src/form.ts +98 -35
- package/packages/form-design/src/default-setting-form.ts +1 -1
- package/packages/form-design/src/form-view.ts +7 -9
- package/packages/icon-picker/src/icon-picker.ts +4 -4
- package/packages/image/src/group.ts +3 -1
- package/packages/image/src/image.ts +3 -1
- package/packages/image/src/preview.ts +37 -22
- package/packages/image/src/util.ts +1 -0
- package/packages/list-design/src/layout-preview.ts +5 -7
- package/packages/list-design/src/list-view.ts +8 -10
- package/packages/loading/src/loading.ts +3 -3
- package/packages/menu/src/menu.ts +9 -9
- package/packages/modal/src/modal.ts +16 -18
- package/packages/pager/src/pager.ts +1 -3
- package/packages/password-input/src/password-input.ts +7 -7
- package/packages/print/src/print.ts +6 -6
- package/packages/pulldown/src/pulldown.ts +5 -5
- package/packages/switch/src/switch.ts +4 -4
- package/packages/table-select/src/table-select.ts +5 -7
- package/packages/tabs/src/tabs.ts +11 -15
- package/packages/tag/src/tag.ts +3 -3
- package/packages/tip/src/tip.ts +5 -5
- package/packages/tree/src/tree.ts +242 -179
- package/packages/ui/index.ts +2 -6
- package/packages/upload/src/upload.ts +31 -33
- package/types/components/button.d.ts +2 -1
- package/types/components/image-group.d.ts +3 -0
- package/types/components/image-preview.d.ts +32 -0
- package/types/components/image.d.ts +2 -0
- package/types/components/tree.d.ts +7 -5
- /package/es/icon/{iconfont.1747192660271.ttf → iconfont.1747318422186.ttf} +0 -0
- /package/es/icon/{iconfont.1747192660271.woff → iconfont.1747318422186.woff} +0 -0
- /package/es/icon/{iconfont.1747192660271.woff2 → iconfont.1747318422186.woff2} +0 -0
- /package/es/{iconfont.1747192660271.ttf → iconfont.1747318422186.ttf} +0 -0
- /package/es/{iconfont.1747192660271.woff → iconfont.1747318422186.woff} +0 -0
- /package/es/{iconfont.1747192660271.woff2 → iconfont.1747318422186.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1747192660271.ttf → iconfont.1747318422186.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1747192660271.woff → iconfont.1747318422186.woff} +0 -0
- /package/lib/icon/style/{iconfont.1747192660271.woff2 → iconfont.1747318422186.woff2} +0 -0
- /package/lib/{iconfont.1747192660271.ttf → iconfont.1747318422186.ttf} +0 -0
- /package/lib/{iconfont.1747192660271.woff → iconfont.1747318422186.woff} +0 -0
- /package/lib/{iconfont.1747192660271.woff2 → iconfont.1747318422186.woff2} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent, ref, h, reactive, PropType, VNode, provide, nextTick, onBeforeUnmount, onMounted, watch,
|
|
1
|
+
import { defineComponent, ref, h, reactive, PropType, VNode, provide, nextTick, onBeforeUnmount, onMounted, watch, computed } from 'vue'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
|
-
import { createEvent } from '
|
|
3
|
+
import { createEvent, renderEmptyElement } from '../../ui'
|
|
4
4
|
import { getOffsetPos } from '../../ui/src/dom'
|
|
5
5
|
import VxeAnchorLinkComponent from './anchor-link'
|
|
6
6
|
|
|
@@ -197,7 +197,7 @@ export default defineComponent({
|
|
|
197
197
|
ref: refMarkerElem,
|
|
198
198
|
class: 'vxe-anchor--marker'
|
|
199
199
|
})
|
|
200
|
-
:
|
|
200
|
+
: renderEmptyElement($xeAnchor)
|
|
201
201
|
])
|
|
202
202
|
}
|
|
203
203
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { defineComponent, ref, h, reactive, computed, resolveComponent, inject,
|
|
1
|
+
import { defineComponent, ref, h, reactive, computed, resolveComponent, inject, PropType } from 'vue'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
|
+
import { renderEmptyElement } from '../../ui'
|
|
3
4
|
|
|
4
5
|
import type { VxeBreadcrumbItemPropTypes, VxeBreadcrumbItemEmits, BreadcrumbItemReactData, BreadcrumbItemPrivateRef, VxeBreadcrumbItemPrivateComputed, VxeBreadcrumbItemConstructor, VxeBreadcrumbItemPrivateMethods, VxeBreadcrumbConstructor, VxeBreadcrumbPrivateMethods } from '../../../types'
|
|
5
6
|
|
|
@@ -90,7 +91,7 @@ export default defineComponent({
|
|
|
90
91
|
? h('span', {
|
|
91
92
|
class: 'vxe-breadcrumb-item--separator'
|
|
92
93
|
}, `${separator}`)
|
|
93
|
-
:
|
|
94
|
+
: renderEmptyElement($xeBreadcrumbItem)
|
|
94
95
|
])
|
|
95
96
|
}
|
|
96
97
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, h, reactive, provide, PropType
|
|
2
|
-
import { getConfig, createEvent, useSize, usePermission } from '
|
|
1
|
+
import { defineComponent, h, reactive, provide, PropType } from 'vue'
|
|
2
|
+
import { getConfig, createEvent, useSize, usePermission, renderEmptyElement } from '../../ui'
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
4
|
import VxeButtonComponent from './button'
|
|
5
5
|
|
|
@@ -71,7 +71,7 @@ export default defineComponent({
|
|
|
71
71
|
const permissionInfo = computePermissionInfo.value
|
|
72
72
|
const defaultSlot = slots.default
|
|
73
73
|
if (!permissionInfo.visible) {
|
|
74
|
-
return
|
|
74
|
+
return renderEmptyElement($xeButtonGroup)
|
|
75
75
|
}
|
|
76
76
|
return h('div', {
|
|
77
77
|
class: ['vxe-button-group', className ? (XEUtils.isFunction(className) ? className({ $buttonGroup: $xeButtonGroup }) : className) : '', {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent, h, ref, computed, Teleport, resolveComponent, VNode, onUnmounted, reactive, nextTick, PropType, onMounted, inject
|
|
1
|
+
import { defineComponent, h, ref, computed, Teleport, resolveComponent, VNode, onUnmounted, reactive, nextTick, PropType, onMounted, inject } from 'vue'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
|
-
import { getConfig, globalEvents, getIcon, createEvent, useSize, usePermission, permission } from '../../ui'
|
|
3
|
+
import { getConfig, globalEvents, getIcon, createEvent, useSize, usePermission, permission, renderEmptyElement } from '../../ui'
|
|
4
4
|
import { getEventTargetNode, updatePanelPlacement } from '../../ui/src/dom'
|
|
5
5
|
import { getFuncText, getLastZIndex, nextZIndex } from '../../ui/src/utils'
|
|
6
6
|
import { warnLog } from '../../ui/src/log'
|
|
@@ -98,7 +98,8 @@ const VxeButtonComponent = defineComponent({
|
|
|
98
98
|
'click',
|
|
99
99
|
'mouseenter',
|
|
100
100
|
'mouseleave',
|
|
101
|
-
'dropdown-click'
|
|
101
|
+
'dropdown-click',
|
|
102
|
+
'dropdownClick'
|
|
102
103
|
] as VxeButtonEmits,
|
|
103
104
|
setup (props, context) {
|
|
104
105
|
const { slots, emit } = context
|
|
@@ -545,7 +546,7 @@ const VxeButtonComponent = defineComponent({
|
|
|
545
546
|
const dropdownsSlot = slots.dropdowns
|
|
546
547
|
|
|
547
548
|
if (!permissionInfo.visible) {
|
|
548
|
-
return
|
|
549
|
+
return renderEmptyElement($xeButton)
|
|
549
550
|
}
|
|
550
551
|
if (dropdownsSlot || downBtnList.length) {
|
|
551
552
|
const btnOns: Record<string, any> = {}
|
|
@@ -716,10 +717,8 @@ const VxeButtonComponent = defineComponent({
|
|
|
716
717
|
$xeButton.renderVN = renderVN
|
|
717
718
|
|
|
718
719
|
onMounted(() => {
|
|
719
|
-
if (
|
|
720
|
-
|
|
721
|
-
warnLog('vxe.error.delProp', ['type=text', 'mode=text'])
|
|
722
|
-
}
|
|
720
|
+
if (props.type === 'text') {
|
|
721
|
+
warnLog('vxe.error.delProp', ['type=text', 'mode=text'])
|
|
723
722
|
}
|
|
724
723
|
|
|
725
724
|
globalEvents.on($xeButton, 'mousewheel', handleGlobalMousewheelEvent)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent, ref, h, reactive, PropType,
|
|
1
|
+
import { defineComponent, ref, h, reactive, PropType, computed } from 'vue'
|
|
2
2
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
3
|
-
import { getConfig, createEvent } from '../../ui'
|
|
3
|
+
import { getConfig, createEvent, renderEmptyElement } from '../../ui'
|
|
4
4
|
import { toCssUnit } from '../../ui/src/dom'
|
|
5
5
|
import VxeLoadingComponent from '../../loading/src/loading'
|
|
6
6
|
import XEUtils from 'xe-utils'
|
|
@@ -120,9 +120,9 @@ export default defineComponent({
|
|
|
120
120
|
? h('div', {
|
|
121
121
|
class: 'vxe-card--header-extra'
|
|
122
122
|
}, getSlotVNs(extraSlot({})))
|
|
123
|
-
:
|
|
123
|
+
: renderEmptyElement($xeCard)
|
|
124
124
|
])
|
|
125
|
-
:
|
|
125
|
+
: renderEmptyElement($xeCard),
|
|
126
126
|
h('div', {
|
|
127
127
|
class: 'vxe-card--body'
|
|
128
128
|
}, [
|
|
@@ -130,7 +130,7 @@ export default defineComponent({
|
|
|
130
130
|
? h('div', {
|
|
131
131
|
class: 'vxe-card--body-left'
|
|
132
132
|
}, getSlotVNs(leftSlot({})))
|
|
133
|
-
:
|
|
133
|
+
: renderEmptyElement($xeCard),
|
|
134
134
|
h('div', {
|
|
135
135
|
class: 'vxe-card--body-content'
|
|
136
136
|
}, defaultSlot ? getSlotVNs(defaultSlot({})) : []),
|
|
@@ -138,13 +138,13 @@ export default defineComponent({
|
|
|
138
138
|
? h('div', {
|
|
139
139
|
class: 'vxe-card--body-right'
|
|
140
140
|
}, getSlotVNs(rightSlot({})))
|
|
141
|
-
:
|
|
141
|
+
: renderEmptyElement($xeCard)
|
|
142
142
|
]),
|
|
143
143
|
footerSlot
|
|
144
144
|
? h('div', {
|
|
145
145
|
class: 'vxe-card--footer'
|
|
146
146
|
}, getSlotVNs(footerSlot({})))
|
|
147
|
-
:
|
|
147
|
+
: renderEmptyElement($xeCard),
|
|
148
148
|
/**
|
|
149
149
|
* 加载中
|
|
150
150
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, ref, h, reactive, provide, PropType, watch, nextTick, onMounted, computed, onUnmounted
|
|
2
|
-
import { getConfig, getIcon, createEvent } from '../../ui'
|
|
1
|
+
import { defineComponent, ref, h, reactive, provide, PropType, watch, nextTick, onMounted, computed, onUnmounted } from 'vue'
|
|
2
|
+
import { getConfig, getIcon, createEvent, renderEmptyElement } from '../../ui'
|
|
3
3
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
4
4
|
import { toCssUnit } from '../../ui/src/dom'
|
|
5
5
|
import VxeLoadingComponent from '../../loading/src/loading'
|
|
@@ -333,7 +333,7 @@ export default defineComponent({
|
|
|
333
333
|
}, [
|
|
334
334
|
renderItemWrapper(list)
|
|
335
335
|
]),
|
|
336
|
-
showIndicators ? renderIndicators(list) :
|
|
336
|
+
showIndicators ? renderIndicators(list) : renderEmptyElement($xeCarousel),
|
|
337
337
|
h('div', {
|
|
338
338
|
class: 'vxe-carousel--btn-wrapper'
|
|
339
339
|
}, [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, ref, h, reactive, watch, computed, PropType, onUnmounted, onMounted
|
|
2
|
-
import { getConfig, getI18n, createEvent, useSize } from '../../ui'
|
|
1
|
+
import { defineComponent, ref, h, reactive, watch, computed, PropType, onUnmounted, onMounted } from 'vue'
|
|
2
|
+
import { getConfig, getI18n, createEvent, useSize, renderEmptyElement } from '../../ui'
|
|
3
3
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
4
4
|
import VxeTextComponent from '../../text/src/text'
|
|
5
5
|
import XEUtils from 'xe-utils'
|
|
@@ -211,7 +211,7 @@ export default defineComponent({
|
|
|
211
211
|
status: prefixOpts.status
|
|
212
212
|
})
|
|
213
213
|
])
|
|
214
|
-
:
|
|
214
|
+
: renderEmptyElement($xeCountdown),
|
|
215
215
|
h('div', {
|
|
216
216
|
class: 'vxe-countdown--content'
|
|
217
217
|
}, defaultSlot
|
|
@@ -230,7 +230,7 @@ export default defineComponent({
|
|
|
230
230
|
status: suffixOpts.status
|
|
231
231
|
})
|
|
232
232
|
])
|
|
233
|
-
:
|
|
233
|
+
: renderEmptyElement($xeCountdown)
|
|
234
234
|
])
|
|
235
235
|
}
|
|
236
236
|
|
|
@@ -100,10 +100,8 @@ function getComponentOns (renderOpts: any, params: any, eFns?: {
|
|
|
100
100
|
const ons: any = {}
|
|
101
101
|
XEUtils.objectEach(events, (func, key: any) => {
|
|
102
102
|
ons[getOnName(key)] = function (...args: any[]) {
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
errLog('vxe.error.errFunc', [func])
|
|
106
|
-
}
|
|
103
|
+
if (!XEUtils.isFunction(func)) {
|
|
104
|
+
errLog('vxe.error.errFunc', [func])
|
|
107
105
|
}
|
|
108
106
|
func(params, ...args)
|
|
109
107
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent, onUnmounted, inject, ref, h, reactive, onMounted, provide
|
|
1
|
+
import { defineComponent, onUnmounted, inject, ref, h, reactive, onMounted, provide } from 'vue'
|
|
2
2
|
import { createItem, watchItem, destroyItem, assembleItem, XEFormItemProvide } from './util'
|
|
3
|
-
import { renderer } from '../../ui'
|
|
3
|
+
import { renderer, renderEmptyElement } from '../../ui'
|
|
4
4
|
import { isEnableConf } from '../../ui/src/utils'
|
|
5
5
|
import { formItemProps } from './form-item'
|
|
6
6
|
import { renderTitle, getItemClass, getItemContentClass } from './render'
|
|
@@ -13,6 +13,9 @@ export default defineComponent({
|
|
|
13
13
|
props: formItemProps,
|
|
14
14
|
setup (props, context) {
|
|
15
15
|
const { slots } = context
|
|
16
|
+
|
|
17
|
+
const xID = XEUtils.uniqueId()
|
|
18
|
+
|
|
16
19
|
const refElem = ref<HTMLDivElement>()
|
|
17
20
|
const $xeForm = inject('$xeForm', {} as VxeFormConstructor & VxeFormPrivateMethods)
|
|
18
21
|
const $xeParentFormGroup = inject<XEFormItemProvide | null>('$xeFormGroup', null)
|
|
@@ -36,7 +39,7 @@ export default defineComponent({
|
|
|
36
39
|
const defaultSlot = slots ? slots.default : null
|
|
37
40
|
const params = { data, disabled, readonly, field, property: field, item, $form: $xeForm, $grid: $xeGrid }
|
|
38
41
|
if (visible === false) {
|
|
39
|
-
return
|
|
42
|
+
return renderEmptyElement($xeFormGroup)
|
|
40
43
|
}
|
|
41
44
|
return h('div', {
|
|
42
45
|
ref: refElem,
|
|
@@ -53,6 +56,7 @@ export default defineComponent({
|
|
|
53
56
|
}
|
|
54
57
|
|
|
55
58
|
const $xeFormGroup = {
|
|
59
|
+
xID,
|
|
56
60
|
formItem,
|
|
57
61
|
|
|
58
62
|
renderVN
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent, h, onUnmounted, inject, ref, provide, onMounted, PropType, reactive
|
|
1
|
+
import { defineComponent, h, onUnmounted, inject, ref, provide, onMounted, PropType, reactive } from 'vue'
|
|
2
2
|
import { createItem, watchItem, destroyItem, assembleItem, XEFormItemProvide } from './util'
|
|
3
|
-
import { renderer } from '../../ui'
|
|
3
|
+
import { renderer, renderEmptyElement } from '../../ui'
|
|
4
4
|
import { isEnableConf } from '../../ui/src/utils'
|
|
5
5
|
import { renderTitle, renderItemContent, getItemClass, getItemContentClass } from './render'
|
|
6
6
|
import XEUtils from 'xe-utils'
|
|
@@ -90,6 +90,8 @@ export default defineComponent({
|
|
|
90
90
|
name: 'VxeFormItem',
|
|
91
91
|
props: formItemProps,
|
|
92
92
|
setup (props, { slots }) {
|
|
93
|
+
const xID = XEUtils.uniqueId()
|
|
94
|
+
|
|
93
95
|
const refElem = ref<HTMLDivElement>()
|
|
94
96
|
const $xeForm = inject('$xeForm', {} as VxeFormConstructor & VxeFormPrivateMethods)
|
|
95
97
|
const $xeFormGroup = inject<XEFormItemProvide | null>('$xeFormGroup', null)
|
|
@@ -110,7 +112,7 @@ export default defineComponent({
|
|
|
110
112
|
const itemContentStyle = compConf ? (compConf.formItemContentStyle || compConf.itemContentStyle) : null
|
|
111
113
|
const params = { data, disabled, readonly, field, property: field, item, $form: $xeForm, $grid: $xeGrid }
|
|
112
114
|
if (visible === false) {
|
|
113
|
-
return
|
|
115
|
+
return renderEmptyElement($xeFormitem)
|
|
114
116
|
}
|
|
115
117
|
return h('div', {
|
|
116
118
|
ref: refElem,
|
|
@@ -120,7 +122,7 @@ export default defineComponent({
|
|
|
120
122
|
}, [
|
|
121
123
|
renderTitle($xeForm, item),
|
|
122
124
|
showContent === false
|
|
123
|
-
?
|
|
125
|
+
? renderEmptyElement($xeFormitem)
|
|
124
126
|
: h('div', {
|
|
125
127
|
class: getItemContentClass($xeForm, item),
|
|
126
128
|
style: Object.assign({}, XEUtils.isFunction(itemContentStyle) ? itemContentStyle(params) : itemContentStyle, XEUtils.isFunction(contentStyle) ? contentStyle(params) : contentStyle)
|
|
@@ -140,6 +142,7 @@ export default defineComponent({
|
|
|
140
142
|
}
|
|
141
143
|
|
|
142
144
|
const $xeFormitem = {
|
|
145
|
+
xID,
|
|
143
146
|
formItem,
|
|
144
147
|
|
|
145
148
|
renderVN
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, h, ref, Ref, provide, computed, inject, reactive, watch, nextTick, PropType, onMounted } from 'vue'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
3
|
import { getConfig, validators, renderer, createEvent, useSize } from '../../ui'
|
|
4
|
-
import { getFuncText, isEnableConf
|
|
4
|
+
import { getFuncText, isEnableConf } from '../../ui/src/utils'
|
|
5
5
|
import { scrollToView } from '../../ui/src/dom'
|
|
6
6
|
import { createItem, handleFieldOrItem, isHiddenItem, isActiveItem } from './util'
|
|
7
7
|
import VxeTooltipComponent from '../../tooltip/src/tooltip'
|
|
@@ -39,27 +39,104 @@ class Rule {
|
|
|
39
39
|
[key: string]: any
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
// 如果存在 pattern,判断正则
|
|
43
|
+
function validREValue (pattern: string | RegExp | undefined, val: string) {
|
|
44
|
+
if (pattern && !(XEUtils.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)) {
|
|
45
|
+
return false
|
|
46
|
+
}
|
|
47
|
+
return true
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 如果存在 max,判断最大值
|
|
51
|
+
function validMaxValue (max: string | number | undefined, num: number) {
|
|
52
|
+
if (!XEUtils.eqNull(max) && num > XEUtils.toNumber(max)) {
|
|
53
|
+
return false
|
|
54
|
+
}
|
|
55
|
+
return true
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// 如果存在 min,判断最小值
|
|
59
|
+
function validMinValue (min: string | number | undefined, num: number) {
|
|
60
|
+
if (!XEUtils.eqNull(min) && num < XEUtils.toNumber(min)) {
|
|
61
|
+
return false
|
|
62
|
+
}
|
|
63
|
+
return true
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function validRuleValue (rule: VxeFormDefines.FormRule, val: any, required: boolean | undefined) {
|
|
43
67
|
const { type, min, max, pattern } = rule
|
|
68
|
+
const isArrType = type === 'array'
|
|
44
69
|
const isNumType = type === 'number'
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
if (
|
|
48
|
-
return
|
|
49
|
-
}
|
|
50
|
-
// 如果存在 min,判断最小值
|
|
51
|
-
if (!XEUtils.eqNull(min) && numVal < XEUtils.toNumber(min)) {
|
|
52
|
-
return true
|
|
70
|
+
const isStrType = type === 'string'
|
|
71
|
+
const strVal = `${val}`
|
|
72
|
+
if (!validREValue(pattern, strVal)) {
|
|
73
|
+
return false
|
|
53
74
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
75
|
+
if (isArrType) {
|
|
76
|
+
if (!XEUtils.isArray(val)) {
|
|
77
|
+
return false
|
|
78
|
+
}
|
|
79
|
+
if (required) {
|
|
80
|
+
if (!val.length) {
|
|
81
|
+
return false
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
if (!validMinValue(min, val.length)) {
|
|
85
|
+
return false
|
|
86
|
+
}
|
|
87
|
+
if (!validMaxValue(max, val.length)) {
|
|
88
|
+
return false
|
|
89
|
+
}
|
|
90
|
+
} else if (isNumType) {
|
|
91
|
+
const numVal = Number(val)
|
|
92
|
+
if (isNaN(numVal)) {
|
|
93
|
+
return false
|
|
94
|
+
}
|
|
95
|
+
if (!validMinValue(min, numVal)) {
|
|
96
|
+
return false
|
|
97
|
+
}
|
|
98
|
+
if (!validMaxValue(max, numVal)) {
|
|
99
|
+
return false
|
|
100
|
+
}
|
|
101
|
+
} else {
|
|
102
|
+
if (isStrType) {
|
|
103
|
+
if (!XEUtils.isString(val)) {
|
|
104
|
+
return false
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
if (required) {
|
|
108
|
+
if (!strVal) {
|
|
109
|
+
return false
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (!validMinValue(min, strVal.length)) {
|
|
113
|
+
return false
|
|
114
|
+
}
|
|
115
|
+
if (!validMaxValue(max, strVal.length)) {
|
|
116
|
+
return false
|
|
117
|
+
}
|
|
57
118
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
119
|
+
return true
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function checkRuleStatus (rule: VxeFormDefines.FormRule, val: any) {
|
|
123
|
+
const { required } = rule
|
|
124
|
+
const isEmptyVal = XEUtils.eqNull(val)
|
|
125
|
+
if (required) {
|
|
126
|
+
if (isEmptyVal) {
|
|
127
|
+
return false
|
|
128
|
+
}
|
|
129
|
+
if (!validRuleValue(rule, val, required)) {
|
|
130
|
+
return false
|
|
131
|
+
}
|
|
132
|
+
} else {
|
|
133
|
+
if (!isEmptyVal) {
|
|
134
|
+
if (!validRuleValue(rule, val, required)) {
|
|
135
|
+
return false
|
|
136
|
+
}
|
|
137
|
+
}
|
|
61
138
|
}
|
|
62
|
-
return
|
|
139
|
+
return true
|
|
63
140
|
}
|
|
64
141
|
|
|
65
142
|
export default defineComponent({
|
|
@@ -416,7 +493,7 @@ export default defineComponent({
|
|
|
416
493
|
if (rules) {
|
|
417
494
|
const itemValue = XEUtils.isUndefined(val) ? XEUtils.get(data, property) : val
|
|
418
495
|
rules.forEach((rule) => {
|
|
419
|
-
const {
|
|
496
|
+
const { trigger, validator } = rule
|
|
420
497
|
if (validType === 'all' || !trigger || validType === trigger) {
|
|
421
498
|
if (validator) {
|
|
422
499
|
const validParams = {
|
|
@@ -436,14 +513,10 @@ export default defineComponent({
|
|
|
436
513
|
if (validatorMethod) {
|
|
437
514
|
customValid = validatorMethod(validParams)
|
|
438
515
|
} else {
|
|
439
|
-
|
|
440
|
-
warnLog('vxe.error.notValidators', [validator])
|
|
441
|
-
}
|
|
516
|
+
warnLog('vxe.error.notValidators', [validator])
|
|
442
517
|
}
|
|
443
518
|
} else {
|
|
444
|
-
|
|
445
|
-
errLog('vxe.error.notValidators', [validator])
|
|
446
|
-
}
|
|
519
|
+
errLog('vxe.error.notValidators', [validator])
|
|
447
520
|
}
|
|
448
521
|
} else {
|
|
449
522
|
customValid = validator(validParams)
|
|
@@ -461,17 +534,7 @@ export default defineComponent({
|
|
|
461
534
|
}
|
|
462
535
|
}
|
|
463
536
|
} else {
|
|
464
|
-
|
|
465
|
-
const isArrVal = XEUtils.isArray(itemValue)
|
|
466
|
-
let hasEmpty = true
|
|
467
|
-
if (isArrType || isArrVal) {
|
|
468
|
-
hasEmpty = !isArrVal || !itemValue.length
|
|
469
|
-
} else if (XEUtils.isString(itemValue)) {
|
|
470
|
-
hasEmpty = eqEmptyValue(itemValue.trim())
|
|
471
|
-
} else {
|
|
472
|
-
hasEmpty = eqEmptyValue(itemValue)
|
|
473
|
-
}
|
|
474
|
-
if (required ? (hasEmpty || validErrorRuleValue(rule, itemValue)) : (!hasEmpty && validErrorRuleValue(rule, itemValue))) {
|
|
537
|
+
if (!checkRuleStatus(rule, itemValue)) {
|
|
475
538
|
errorRules.push(new Rule(rule))
|
|
476
539
|
}
|
|
477
540
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, defineComponent, PropType, inject, createCommentVNode } from 'vue'
|
|
2
|
-
import { getIcon, getI18n } from '
|
|
2
|
+
import { getIcon, getI18n } from '../../ui'
|
|
3
3
|
import VxeFormComponent from '../../form/src/form'
|
|
4
4
|
import VxeFormItemComponent from '../../form/src/form-item'
|
|
5
5
|
import VxeSwitchComponent from '../../switch/src/switch'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent, ref, h, reactive, nextTick, PropType, inject, provide, watch
|
|
1
|
+
import { defineComponent, ref, h, reactive, nextTick, PropType, inject, provide, watch } from 'vue'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
|
-
import { getConfig, renderer, useSize, createEvent } from '../../ui'
|
|
3
|
+
import { getConfig, renderer, useSize, createEvent, renderEmptyElement } from '../../ui'
|
|
4
4
|
import { getSlotVNs } from '../../ui/src/vn'
|
|
5
5
|
import { createDefaultFormViewPCFormConfig } from './default-setting-data'
|
|
6
6
|
import VxeFormComponent from '../../form/src/form'
|
|
@@ -248,9 +248,7 @@ export default defineComponent({
|
|
|
248
248
|
* @deprecated
|
|
249
249
|
*/
|
|
250
250
|
updateItemStatus (widget, value) {
|
|
251
|
-
|
|
252
|
-
warnLog('vxe.error.delFunc', ['updateItemStatus', 'updateWidgetStatus'])
|
|
253
|
-
}
|
|
251
|
+
warnLog('vxe.error.delFunc', ['updateItemStatus', 'updateWidgetStatus'])
|
|
254
252
|
return updateWidgetStatus(widget, value)
|
|
255
253
|
}
|
|
256
254
|
}
|
|
@@ -287,7 +285,7 @@ export default defineComponent({
|
|
|
287
285
|
? h('div', {
|
|
288
286
|
class: 'vxe-form-view--top'
|
|
289
287
|
}, getSlotVNs(topSlot({ $formView: $xeFormView })))
|
|
290
|
-
:
|
|
288
|
+
: renderEmptyElement($xeFormView),
|
|
291
289
|
h(VxeFormComponent, {
|
|
292
290
|
ref: formRef,
|
|
293
291
|
...formConfig,
|
|
@@ -309,7 +307,7 @@ export default defineComponent({
|
|
|
309
307
|
return headerSlot({})
|
|
310
308
|
}
|
|
311
309
|
})
|
|
312
|
-
:
|
|
310
|
+
: renderEmptyElement($xeFormView),
|
|
313
311
|
...widgetObjList.map(widget => {
|
|
314
312
|
const { name } = widget
|
|
315
313
|
const compConf = renderer.get(name) || {}
|
|
@@ -347,7 +345,7 @@ export default defineComponent({
|
|
|
347
345
|
return footerSlot({})
|
|
348
346
|
}
|
|
349
347
|
})
|
|
350
|
-
:
|
|
348
|
+
: renderEmptyElement($xeFormView)
|
|
351
349
|
]
|
|
352
350
|
}
|
|
353
351
|
}),
|
|
@@ -355,7 +353,7 @@ export default defineComponent({
|
|
|
355
353
|
? h('div', {
|
|
356
354
|
class: 'vxe-form-view--bottom'
|
|
357
355
|
}, getSlotVNs(bottomSlot({ $formView: $xeFormView })))
|
|
358
|
-
:
|
|
356
|
+
: renderEmptyElement($xeFormView)
|
|
359
357
|
])
|
|
360
358
|
}
|
|
361
359
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent, h, Teleport, PropType, ref, inject, watch, computed, provide, onUnmounted, reactive, nextTick, onMounted
|
|
1
|
+
import { defineComponent, h, Teleport, PropType, ref, inject, watch, computed, provide, onUnmounted, reactive, nextTick, onMounted } from 'vue'
|
|
2
2
|
import XEUtils from 'xe-utils'
|
|
3
|
-
import { getConfig, getIcon, getI18n, globalEvents, createEvent, useSize, GLOBAL_EVENT_KEYS } from '../../ui'
|
|
3
|
+
import { getConfig, getIcon, getI18n, globalEvents, createEvent, useSize, GLOBAL_EVENT_KEYS, renderEmptyElement } from '../../ui'
|
|
4
4
|
import { getEventTargetNode, getAbsolutePos } from '../../ui/src/dom'
|
|
5
5
|
import { getLastZIndex, nextZIndex, getFuncText } from '../../ui/src/utils'
|
|
6
6
|
|
|
@@ -478,7 +478,7 @@ export default defineComponent({
|
|
|
478
478
|
? h('div', {
|
|
479
479
|
class: 'vxe-ico-picker--item-title'
|
|
480
480
|
}, `${item.title || ''}`)
|
|
481
|
-
:
|
|
481
|
+
: renderEmptyElement($xeIconPicker)
|
|
482
482
|
])
|
|
483
483
|
}))
|
|
484
484
|
}))
|
|
@@ -575,7 +575,7 @@ export default defineComponent({
|
|
|
575
575
|
}, [
|
|
576
576
|
renderIconWrapper()
|
|
577
577
|
])
|
|
578
|
-
:
|
|
578
|
+
: renderEmptyElement($xeIconPicker)
|
|
579
579
|
])
|
|
580
580
|
])
|
|
581
581
|
])
|
|
@@ -16,6 +16,7 @@ export default defineComponent({
|
|
|
16
16
|
},
|
|
17
17
|
imageStyle: Object as PropType<VxeImageGroupPropTypes.ImageStyle>,
|
|
18
18
|
size: { type: String as PropType<VxeImageGroupPropTypes.Size>, default: () => getConfig().imageGroup.size || getConfig().size },
|
|
19
|
+
toolbarConfig: Object as PropType<VxeImageGroupPropTypes.ToolbarConfig>,
|
|
19
20
|
showPrintButton: {
|
|
20
21
|
type: Boolean as PropType<VxeImageGroupPropTypes.ShowPrintButton>,
|
|
21
22
|
default: () => getConfig().imageGroup.showPrintButton
|
|
@@ -78,13 +79,14 @@ export default defineComponent({
|
|
|
78
79
|
|
|
79
80
|
const imageGroupPrivateMethods: ImageGroupPrivateMethods = {
|
|
80
81
|
handleClickImgEvent (evnt, params) {
|
|
81
|
-
const { showPreview, showPrintButton, showDownloadButton } = props
|
|
82
|
+
const { showPreview, toolbarConfig, showPrintButton, showDownloadButton } = props
|
|
82
83
|
const { url } = params
|
|
83
84
|
const imgList = computeImgList.value
|
|
84
85
|
if (showPreview && url) {
|
|
85
86
|
openPreviewImage({
|
|
86
87
|
activeIndex: Math.max(0, XEUtils.findIndexOf(imgList, item => item.url === url)),
|
|
87
88
|
urlList: imgList,
|
|
89
|
+
toolbarConfig,
|
|
88
90
|
showPrintButton,
|
|
89
91
|
showDownloadButton
|
|
90
92
|
})
|
|
@@ -20,6 +20,7 @@ export default defineComponent({
|
|
|
20
20
|
type: Boolean as PropType<VxeImagePropTypes.MaskClosable>,
|
|
21
21
|
default: () => getConfig().image.maskClosable
|
|
22
22
|
},
|
|
23
|
+
toolbarConfig: Object as PropType<VxeImagePropTypes.ToolbarConfig>,
|
|
23
24
|
showPreview: {
|
|
24
25
|
type: Boolean as PropType<VxeImagePropTypes.ShowPreview>,
|
|
25
26
|
default: () => getConfig().image.showPreview
|
|
@@ -122,7 +123,7 @@ export default defineComponent({
|
|
|
122
123
|
}
|
|
123
124
|
|
|
124
125
|
const clickEvent = (evnt: MouseEvent) => {
|
|
125
|
-
const { showPreview, showPrintButton, showDownloadButton, maskClosable } = props
|
|
126
|
+
const { showPreview, toolbarConfig, showPrintButton, showDownloadButton, maskClosable } = props
|
|
126
127
|
const imgList = computeImgList.value
|
|
127
128
|
const imgUrl = computeImgUrl.value
|
|
128
129
|
if ($xeImageGroup) {
|
|
@@ -131,6 +132,7 @@ export default defineComponent({
|
|
|
131
132
|
if (showPreview && imgUrl) {
|
|
132
133
|
openPreviewImage({
|
|
133
134
|
urlList: imgList,
|
|
135
|
+
toolbarConfig,
|
|
134
136
|
showPrintButton,
|
|
135
137
|
showDownloadButton,
|
|
136
138
|
maskClosable
|