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
package/es/alert/src/alert.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent, ref, h, reactive
|
|
1
|
+
import { defineComponent, ref, h, reactive } from 'vue';
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
|
-
import { getConfig, getIcon, createEvent } from '../../ui';
|
|
3
|
+
import { getConfig, getIcon, createEvent, renderEmptyElement } from '../../ui';
|
|
4
4
|
import { getSlotVNs } from '../../ui/src/vn';
|
|
5
5
|
export default defineComponent({
|
|
6
6
|
name: 'VxeAlert',
|
|
@@ -69,7 +69,7 @@ export default defineComponent({
|
|
|
69
69
|
class: icon || getIcon()[`ALERT_${status === null || status === void 0 ? void 0 : status.toUpperCase()}`]
|
|
70
70
|
})
|
|
71
71
|
])
|
|
72
|
-
:
|
|
72
|
+
: renderEmptyElement($xeAlert),
|
|
73
73
|
h('div', {
|
|
74
74
|
class: 'vxe-alert--body'
|
|
75
75
|
}, [
|
|
@@ -77,7 +77,7 @@ export default defineComponent({
|
|
|
77
77
|
? h('div', {
|
|
78
78
|
class: 'vxe-alert--title'
|
|
79
79
|
}, titleSlot ? getSlotVNs(titleSlot({})) : XEUtils.toValueString(title))
|
|
80
|
-
:
|
|
80
|
+
: renderEmptyElement($xeAlert),
|
|
81
81
|
h('div', {
|
|
82
82
|
class: 'vxe-alert--content'
|
|
83
83
|
}, defaultSlot ? getSlotVNs(defaultSlot({})) : XEUtils.toValueString(content))
|
|
@@ -91,7 +91,7 @@ export default defineComponent({
|
|
|
91
91
|
class: getIcon().ALERT_CLOSE
|
|
92
92
|
})
|
|
93
93
|
])
|
|
94
|
-
:
|
|
94
|
+
: renderEmptyElement($xeAlert)
|
|
95
95
|
]);
|
|
96
96
|
};
|
|
97
97
|
$xeAlert.renderVN = renderVN;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { defineComponent, ref, h, computed, reactive, inject,
|
|
1
|
+
import { defineComponent, ref, h, computed, reactive, inject, onMounted, onUnmounted, provide, watch } from 'vue';
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
|
+
import { renderEmptyElement } from '../../ui';
|
|
3
4
|
import { assembleAnchorLink, destroyAnchorLink } from './util';
|
|
4
5
|
export default defineComponent({
|
|
5
6
|
name: 'VxeAnchorLink',
|
|
@@ -82,7 +83,7 @@ export default defineComponent({
|
|
|
82
83
|
? h('div', {
|
|
83
84
|
class: 'vxe-anchor-link--sub-items'
|
|
84
85
|
}, subSlot({}))
|
|
85
|
-
:
|
|
86
|
+
: renderEmptyElement($xeAnchorLink)
|
|
86
87
|
]);
|
|
87
88
|
};
|
|
88
89
|
provide('$xeAnchorLink', $xeAnchorLink);
|
package/es/anchor/src/anchor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent, ref, h, reactive, provide, nextTick, onBeforeUnmount, onMounted, watch,
|
|
1
|
+
import { defineComponent, ref, h, reactive, 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
|
export default defineComponent({
|
|
@@ -175,7 +175,7 @@ export default defineComponent({
|
|
|
175
175
|
ref: refMarkerElem,
|
|
176
176
|
class: 'vxe-anchor--marker'
|
|
177
177
|
})
|
|
178
|
-
:
|
|
178
|
+
: renderEmptyElement($xeAnchor)
|
|
179
179
|
]);
|
|
180
180
|
};
|
|
181
181
|
watch(() => props.modelValue, (val) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { defineComponent, ref, h, reactive, computed, resolveComponent, inject
|
|
1
|
+
import { defineComponent, ref, h, reactive, computed, resolveComponent, inject } from 'vue';
|
|
2
2
|
import XEUtils from 'xe-utils';
|
|
3
|
+
import { renderEmptyElement } from '../../ui';
|
|
3
4
|
export default defineComponent({
|
|
4
5
|
name: 'VxeBreadcrumbItem',
|
|
5
6
|
props: {
|
|
@@ -72,7 +73,7 @@ export default defineComponent({
|
|
|
72
73
|
? h('span', {
|
|
73
74
|
class: 'vxe-breadcrumb-item--separator'
|
|
74
75
|
}, `${separator}`)
|
|
75
|
-
:
|
|
76
|
+
: renderEmptyElement($xeBreadcrumbItem)
|
|
76
77
|
]);
|
|
77
78
|
};
|
|
78
79
|
$xeBreadcrumbItem.renderVN = renderVN;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, h, reactive, provide
|
|
2
|
-
import { getConfig, createEvent, useSize, usePermission } from '
|
|
1
|
+
import { defineComponent, h, reactive, provide } 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
|
export default defineComponent({
|
|
@@ -56,7 +56,7 @@ export default defineComponent({
|
|
|
56
56
|
const permissionInfo = computePermissionInfo.value;
|
|
57
57
|
const defaultSlot = slots.default;
|
|
58
58
|
if (!permissionInfo.visible) {
|
|
59
|
-
return
|
|
59
|
+
return renderEmptyElement($xeButtonGroup);
|
|
60
60
|
}
|
|
61
61
|
return h('div', {
|
|
62
62
|
class: ['vxe-button-group', className ? (XEUtils.isFunction(className) ? className({ $buttonGroup: $xeButtonGroup }) : className) : '', {
|
package/es/button/src/button.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent, h, ref, computed, Teleport, resolveComponent, onUnmounted, reactive, nextTick, onMounted, inject
|
|
1
|
+
import { defineComponent, h, ref, computed, Teleport, resolveComponent, onUnmounted, reactive, nextTick, 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';
|
|
@@ -94,7 +94,8 @@ const VxeButtonComponent = defineComponent({
|
|
|
94
94
|
'click',
|
|
95
95
|
'mouseenter',
|
|
96
96
|
'mouseleave',
|
|
97
|
-
'dropdown-click'
|
|
97
|
+
'dropdown-click',
|
|
98
|
+
'dropdownClick'
|
|
98
99
|
],
|
|
99
100
|
setup(props, context) {
|
|
100
101
|
const { slots, emit } = context;
|
|
@@ -488,7 +489,7 @@ const VxeButtonComponent = defineComponent({
|
|
|
488
489
|
const vSize = computeSize.value;
|
|
489
490
|
const dropdownsSlot = slots.dropdowns;
|
|
490
491
|
if (!permissionInfo.visible) {
|
|
491
|
-
return
|
|
492
|
+
return renderEmptyElement($xeButton);
|
|
492
493
|
}
|
|
493
494
|
if (dropdownsSlot || downBtnList.length) {
|
|
494
495
|
const btnOns = {};
|
|
@@ -633,10 +634,8 @@ const VxeButtonComponent = defineComponent({
|
|
|
633
634
|
};
|
|
634
635
|
$xeButton.renderVN = renderVN;
|
|
635
636
|
onMounted(() => {
|
|
636
|
-
if (
|
|
637
|
-
|
|
638
|
-
warnLog('vxe.error.delProp', ['type=text', 'mode=text']);
|
|
639
|
-
}
|
|
637
|
+
if (props.type === 'text') {
|
|
638
|
+
warnLog('vxe.error.delProp', ['type=text', 'mode=text']);
|
|
640
639
|
}
|
|
641
640
|
globalEvents.on($xeButton, 'mousewheel', handleGlobalMousewheelEvent);
|
|
642
641
|
globalEvents.on($xeButton, 'mousedown', handleGlobalMousedownEvent);
|
package/es/card/src/card.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent, ref, h, reactive,
|
|
1
|
+
import { defineComponent, ref, h, reactive, 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';
|
|
@@ -99,9 +99,9 @@ export default defineComponent({
|
|
|
99
99
|
? h('div', {
|
|
100
100
|
class: 'vxe-card--header-extra'
|
|
101
101
|
}, getSlotVNs(extraSlot({})))
|
|
102
|
-
:
|
|
102
|
+
: renderEmptyElement($xeCard)
|
|
103
103
|
])
|
|
104
|
-
:
|
|
104
|
+
: renderEmptyElement($xeCard),
|
|
105
105
|
h('div', {
|
|
106
106
|
class: 'vxe-card--body'
|
|
107
107
|
}, [
|
|
@@ -109,7 +109,7 @@ export default defineComponent({
|
|
|
109
109
|
? h('div', {
|
|
110
110
|
class: 'vxe-card--body-left'
|
|
111
111
|
}, getSlotVNs(leftSlot({})))
|
|
112
|
-
:
|
|
112
|
+
: renderEmptyElement($xeCard),
|
|
113
113
|
h('div', {
|
|
114
114
|
class: 'vxe-card--body-content'
|
|
115
115
|
}, defaultSlot ? getSlotVNs(defaultSlot({})) : []),
|
|
@@ -117,13 +117,13 @@ export default defineComponent({
|
|
|
117
117
|
? h('div', {
|
|
118
118
|
class: 'vxe-card--body-right'
|
|
119
119
|
}, getSlotVNs(rightSlot({})))
|
|
120
|
-
:
|
|
120
|
+
: renderEmptyElement($xeCard)
|
|
121
121
|
]),
|
|
122
122
|
footerSlot
|
|
123
123
|
? h('div', {
|
|
124
124
|
class: 'vxe-card--footer'
|
|
125
125
|
}, getSlotVNs(footerSlot({})))
|
|
126
|
-
:
|
|
126
|
+
: renderEmptyElement($xeCard),
|
|
127
127
|
/**
|
|
128
128
|
* 加载中
|
|
129
129
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, ref, h, reactive, provide, watch, nextTick, onMounted, computed, onUnmounted
|
|
2
|
-
import { getConfig, getIcon, createEvent } from '../../ui';
|
|
1
|
+
import { defineComponent, ref, h, reactive, provide, 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';
|
|
@@ -303,7 +303,7 @@ export default defineComponent({
|
|
|
303
303
|
}, [
|
|
304
304
|
renderItemWrapper(list)
|
|
305
305
|
]),
|
|
306
|
-
showIndicators ? renderIndicators(list) :
|
|
306
|
+
showIndicators ? renderIndicators(list) : renderEmptyElement($xeCarousel),
|
|
307
307
|
h('div', {
|
|
308
308
|
class: 'vxe-carousel--btn-wrapper'
|
|
309
309
|
}, [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, ref, h, reactive, watch, computed, onUnmounted, onMounted
|
|
2
|
-
import { getConfig, getI18n, createEvent, useSize } from '../../ui';
|
|
1
|
+
import { defineComponent, ref, h, reactive, watch, computed, 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';
|
|
@@ -182,7 +182,7 @@ export default defineComponent({
|
|
|
182
182
|
status: prefixOpts.status
|
|
183
183
|
})
|
|
184
184
|
])
|
|
185
|
-
:
|
|
185
|
+
: renderEmptyElement($xeCountdown),
|
|
186
186
|
h('div', {
|
|
187
187
|
class: 'vxe-countdown--content'
|
|
188
188
|
}, defaultSlot
|
|
@@ -200,7 +200,7 @@ export default defineComponent({
|
|
|
200
200
|
status: suffixOpts.status
|
|
201
201
|
})
|
|
202
202
|
])
|
|
203
|
-
:
|
|
203
|
+
: renderEmptyElement($xeCountdown)
|
|
204
204
|
]);
|
|
205
205
|
};
|
|
206
206
|
watch(() => props.modelValue, () => {
|
package/es/form/render/index.js
CHANGED
|
@@ -87,10 +87,8 @@ function getComponentOns(renderOpts, params, eFns, eventOns) {
|
|
|
87
87
|
const ons = {};
|
|
88
88
|
XEUtils.objectEach(events, (func, key) => {
|
|
89
89
|
ons[getOnName(key)] = function (...args) {
|
|
90
|
-
if (
|
|
91
|
-
|
|
92
|
-
errLog('vxe.error.errFunc', [func]);
|
|
93
|
-
}
|
|
90
|
+
if (!XEUtils.isFunction(func)) {
|
|
91
|
+
errLog('vxe.error.errFunc', [func]);
|
|
94
92
|
}
|
|
95
93
|
func(params, ...args);
|
|
96
94
|
};
|
|
@@ -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 } 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';
|
|
@@ -10,6 +10,7 @@ export default defineComponent({
|
|
|
10
10
|
props: formItemProps,
|
|
11
11
|
setup(props, context) {
|
|
12
12
|
const { slots } = context;
|
|
13
|
+
const xID = XEUtils.uniqueId();
|
|
13
14
|
const refElem = ref();
|
|
14
15
|
const $xeForm = inject('$xeForm', {});
|
|
15
16
|
const $xeParentFormGroup = inject('$xeFormGroup', null);
|
|
@@ -30,7 +31,7 @@ export default defineComponent({
|
|
|
30
31
|
const defaultSlot = slots ? slots.default : null;
|
|
31
32
|
const params = { data, disabled, readonly, field, property: field, item, $form: $xeForm, $grid: $xeGrid };
|
|
32
33
|
if (visible === false) {
|
|
33
|
-
return
|
|
34
|
+
return renderEmptyElement($xeFormGroup);
|
|
34
35
|
}
|
|
35
36
|
return h('div', {
|
|
36
37
|
ref: refElem,
|
|
@@ -46,6 +47,7 @@ export default defineComponent({
|
|
|
46
47
|
]);
|
|
47
48
|
};
|
|
48
49
|
const $xeFormGroup = {
|
|
50
|
+
xID,
|
|
49
51
|
formItem,
|
|
50
52
|
renderVN
|
|
51
53
|
};
|
package/es/form/src/form-item.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent, h, onUnmounted, inject, ref, provide, onMounted, reactive
|
|
1
|
+
import { defineComponent, h, onUnmounted, inject, ref, provide, onMounted, reactive } from 'vue';
|
|
2
2
|
import { createItem, watchItem, destroyItem, assembleItem } 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';
|
|
@@ -86,6 +86,7 @@ export default defineComponent({
|
|
|
86
86
|
name: 'VxeFormItem',
|
|
87
87
|
props: formItemProps,
|
|
88
88
|
setup(props, { slots }) {
|
|
89
|
+
const xID = XEUtils.uniqueId();
|
|
89
90
|
const refElem = ref();
|
|
90
91
|
const $xeForm = inject('$xeForm', {});
|
|
91
92
|
const $xeFormGroup = inject('$xeFormGroup', null);
|
|
@@ -103,7 +104,7 @@ export default defineComponent({
|
|
|
103
104
|
const itemContentStyle = compConf ? (compConf.formItemContentStyle || compConf.itemContentStyle) : null;
|
|
104
105
|
const params = { data, disabled, readonly, field, property: field, item, $form: $xeForm, $grid: $xeGrid };
|
|
105
106
|
if (visible === false) {
|
|
106
|
-
return
|
|
107
|
+
return renderEmptyElement($xeFormitem);
|
|
107
108
|
}
|
|
108
109
|
return h('div', {
|
|
109
110
|
ref: refElem,
|
|
@@ -113,7 +114,7 @@ export default defineComponent({
|
|
|
113
114
|
}, [
|
|
114
115
|
renderTitle($xeForm, item),
|
|
115
116
|
showContent === false
|
|
116
|
-
?
|
|
117
|
+
? renderEmptyElement($xeFormitem)
|
|
117
118
|
: h('div', {
|
|
118
119
|
class: getItemContentClass($xeForm, item),
|
|
119
120
|
style: Object.assign({}, XEUtils.isFunction(itemContentStyle) ? itemContentStyle(params) : itemContentStyle, XEUtils.isFunction(contentStyle) ? contentStyle(params) : contentStyle)
|
|
@@ -132,6 +133,7 @@ export default defineComponent({
|
|
|
132
133
|
});
|
|
133
134
|
};
|
|
134
135
|
const $xeFormitem = {
|
|
136
|
+
xID,
|
|
135
137
|
formItem,
|
|
136
138
|
renderVN
|
|
137
139
|
};
|
package/es/form/src/form.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, h, ref, provide, computed, inject, reactive, watch, nextTick, 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';
|
|
@@ -30,28 +30,104 @@ class Rule {
|
|
|
30
30
|
return this.content;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
// 如果存在 pattern,判断正则
|
|
34
|
+
function validREValue(pattern, val) {
|
|
35
|
+
if (pattern && !(XEUtils.isRegExp(pattern) ? pattern : new RegExp(pattern)).test(val)) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
// 如果存在 max,判断最大值
|
|
41
|
+
function validMaxValue(max, num) {
|
|
42
|
+
if (!XEUtils.eqNull(max) && num > XEUtils.toNumber(max)) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
// 如果存在 min,判断最小值
|
|
48
|
+
function validMinValue(min, num) {
|
|
49
|
+
if (!XEUtils.eqNull(min) && num < XEUtils.toNumber(min)) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
function validRuleValue(rule, val, required) {
|
|
34
55
|
const { type, min, max, pattern } = rule;
|
|
56
|
+
const isArrType = type === 'array';
|
|
35
57
|
const isNumType = type === 'number';
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
if (
|
|
39
|
-
return
|
|
58
|
+
const isStrType = type === 'string';
|
|
59
|
+
const strVal = `${val}`;
|
|
60
|
+
if (!validREValue(pattern, strVal)) {
|
|
61
|
+
return false;
|
|
40
62
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
63
|
+
if (isArrType) {
|
|
64
|
+
if (!XEUtils.isArray(val)) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
if (required) {
|
|
68
|
+
if (!val.length) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
if (!validMinValue(min, val.length)) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
if (!validMaxValue(max, val.length)) {
|
|
76
|
+
return false;
|
|
77
|
+
}
|
|
44
78
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
79
|
+
else if (isNumType) {
|
|
80
|
+
const numVal = Number(val);
|
|
81
|
+
if (isNaN(numVal)) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
if (!validMinValue(min, numVal)) {
|
|
85
|
+
return false;
|
|
86
|
+
}
|
|
87
|
+
if (!validMaxValue(max, numVal)) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
48
90
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
91
|
+
else {
|
|
92
|
+
if (isStrType) {
|
|
93
|
+
if (!XEUtils.isString(val)) {
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (required) {
|
|
98
|
+
if (!strVal) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
if (!validMinValue(min, strVal.length)) {
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
if (!validMaxValue(max, strVal.length)) {
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
52
108
|
}
|
|
53
|
-
return
|
|
54
|
-
}
|
|
109
|
+
return true;
|
|
110
|
+
}
|
|
111
|
+
function checkRuleStatus(rule, val) {
|
|
112
|
+
const { required } = rule;
|
|
113
|
+
const isEmptyVal = XEUtils.eqNull(val);
|
|
114
|
+
if (required) {
|
|
115
|
+
if (isEmptyVal) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
if (!validRuleValue(rule, val, required)) {
|
|
119
|
+
return false;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
if (!isEmptyVal) {
|
|
124
|
+
if (!validRuleValue(rule, val, required)) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
55
131
|
export default defineComponent({
|
|
56
132
|
name: 'VxeForm',
|
|
57
133
|
props: {
|
|
@@ -383,7 +459,7 @@ export default defineComponent({
|
|
|
383
459
|
if (rules) {
|
|
384
460
|
const itemValue = XEUtils.isUndefined(val) ? XEUtils.get(data, property) : val;
|
|
385
461
|
rules.forEach((rule) => {
|
|
386
|
-
const {
|
|
462
|
+
const { trigger, validator } = rule;
|
|
387
463
|
if (validType === 'all' || !trigger || validType === trigger) {
|
|
388
464
|
if (validator) {
|
|
389
465
|
const validParams = {
|
|
@@ -404,15 +480,11 @@ export default defineComponent({
|
|
|
404
480
|
customValid = validatorMethod(validParams);
|
|
405
481
|
}
|
|
406
482
|
else {
|
|
407
|
-
|
|
408
|
-
warnLog('vxe.error.notValidators', [validator]);
|
|
409
|
-
}
|
|
483
|
+
warnLog('vxe.error.notValidators', [validator]);
|
|
410
484
|
}
|
|
411
485
|
}
|
|
412
486
|
else {
|
|
413
|
-
|
|
414
|
-
errLog('vxe.error.notValidators', [validator]);
|
|
415
|
-
}
|
|
487
|
+
errLog('vxe.error.notValidators', [validator]);
|
|
416
488
|
}
|
|
417
489
|
}
|
|
418
490
|
else {
|
|
@@ -431,19 +503,7 @@ export default defineComponent({
|
|
|
431
503
|
}
|
|
432
504
|
}
|
|
433
505
|
else {
|
|
434
|
-
|
|
435
|
-
const isArrVal = XEUtils.isArray(itemValue);
|
|
436
|
-
let hasEmpty = true;
|
|
437
|
-
if (isArrType || isArrVal) {
|
|
438
|
-
hasEmpty = !isArrVal || !itemValue.length;
|
|
439
|
-
}
|
|
440
|
-
else if (XEUtils.isString(itemValue)) {
|
|
441
|
-
hasEmpty = eqEmptyValue(itemValue.trim());
|
|
442
|
-
}
|
|
443
|
-
else {
|
|
444
|
-
hasEmpty = eqEmptyValue(itemValue);
|
|
445
|
-
}
|
|
446
|
-
if (required ? (hasEmpty || validErrorRuleValue(rule, itemValue)) : (!hasEmpty && validErrorRuleValue(rule, itemValue))) {
|
|
506
|
+
if (!checkRuleStatus(rule, itemValue)) {
|
|
447
507
|
errorRules.push(new Rule(rule));
|
|
448
508
|
}
|
|
449
509
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, defineComponent, 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, inject, provide, watch
|
|
1
|
+
import { defineComponent, ref, h, reactive, nextTick, 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';
|
|
@@ -218,9 +218,7 @@ export default defineComponent({
|
|
|
218
218
|
* @deprecated
|
|
219
219
|
*/
|
|
220
220
|
updateItemStatus(widget, value) {
|
|
221
|
-
|
|
222
|
-
warnLog('vxe.error.delFunc', ['updateItemStatus', 'updateWidgetStatus']);
|
|
223
|
-
}
|
|
221
|
+
warnLog('vxe.error.delFunc', ['updateItemStatus', 'updateWidgetStatus']);
|
|
224
222
|
return updateWidgetStatus(widget, value);
|
|
225
223
|
}
|
|
226
224
|
};
|
|
@@ -250,7 +248,7 @@ export default defineComponent({
|
|
|
250
248
|
? h('div', {
|
|
251
249
|
class: 'vxe-form-view--top'
|
|
252
250
|
}, getSlotVNs(topSlot({ $formView: $xeFormView })))
|
|
253
|
-
:
|
|
251
|
+
: renderEmptyElement($xeFormView),
|
|
254
252
|
h(VxeFormComponent, Object.assign(Object.assign({ ref: formRef }, formConfig), { data: modelValue, customLayout: true, readonly,
|
|
255
253
|
disabled, span: 24, rules: formRules, onSubmit: handleSubmit, onReset: handleReset }), {
|
|
256
254
|
default() {
|
|
@@ -262,7 +260,7 @@ export default defineComponent({
|
|
|
262
260
|
return headerSlot({});
|
|
263
261
|
}
|
|
264
262
|
})
|
|
265
|
-
:
|
|
263
|
+
: renderEmptyElement($xeFormView),
|
|
266
264
|
...widgetObjList.map(widget => {
|
|
267
265
|
const { name } = widget;
|
|
268
266
|
const compConf = renderer.get(name) || {};
|
|
@@ -301,7 +299,7 @@ export default defineComponent({
|
|
|
301
299
|
return footerSlot({});
|
|
302
300
|
}
|
|
303
301
|
})
|
|
304
|
-
:
|
|
302
|
+
: renderEmptyElement($xeFormView)
|
|
305
303
|
];
|
|
306
304
|
}
|
|
307
305
|
}),
|
|
@@ -309,7 +307,7 @@ export default defineComponent({
|
|
|
309
307
|
? h('div', {
|
|
310
308
|
class: 'vxe-form-view--bottom'
|
|
311
309
|
}, getSlotVNs(bottomSlot({ $formView: $xeFormView })))
|
|
312
|
-
:
|
|
310
|
+
: renderEmptyElement($xeFormView)
|
|
313
311
|
]);
|
|
314
312
|
};
|
|
315
313
|
$xeFormView.renderVN = renderVN;
|