vxe-pc-ui 4.17.24 → 4.17.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/all.esm.js +156 -52
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/icon/style.css +1 -1
- package/es/input/src/input.js +12 -8
- package/es/input/style.css +13 -2
- package/es/input/style.min.css +1 -1
- package/es/number-input/src/number-input.js +82 -13
- package/es/number-input/style.css +13 -3
- package/es/number-input/style.min.css +1 -1
- package/es/password-input/src/password-input.js +13 -9
- package/es/password-input/style.css +13 -2
- package/es/password-input/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/tooltip/index.js +8 -2
- package/es/tooltip/src/tooltip.js +25 -8
- package/es/ui/index.js +6 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-input/style.css +13 -2
- package/es/vxe-input/style.min.css +1 -1
- package/es/vxe-number-input/style.css +13 -3
- package/es/vxe-number-input/style.min.css +1 -1
- package/es/vxe-password-input/style.css +13 -2
- package/es/vxe-password-input/style.min.css +1 -1
- package/lib/icon/style/style.css +1 -1
- package/lib/icon/style/style.min.css +1 -1
- package/lib/index.umd.js +148 -27
- package/lib/index.umd.min.js +1 -1
- package/lib/input/src/input.js +9 -4
- package/lib/input/src/input.min.js +1 -1
- package/lib/input/style/style.css +13 -2
- package/lib/input/style/style.min.css +1 -1
- package/lib/number-input/src/number-input.js +89 -5
- package/lib/number-input/src/number-input.min.js +1 -1
- package/lib/number-input/style/style.css +13 -3
- package/lib/number-input/style/style.min.css +1 -1
- package/lib/password-input/src/password-input.js +9 -4
- package/lib/password-input/src/password-input.min.js +1 -1
- package/lib/password-input/style/style.css +13 -2
- package/lib/password-input/style/style.min.css +1 -1
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/tooltip/index.js +12 -6
- package/lib/tooltip/index.min.js +1 -1
- package/lib/tooltip/src/tooltip.js +21 -6
- package/lib/tooltip/src/tooltip.min.js +1 -1
- package/lib/ui/index.js +6 -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/vxe-input/style/style.css +13 -2
- package/lib/vxe-input/style/style.min.css +1 -1
- package/lib/vxe-number-input/style/style.css +13 -3
- package/lib/vxe-number-input/style/style.min.css +1 -1
- package/lib/vxe-password-input/style/style.css +13 -2
- package/lib/vxe-password-input/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/input/src/input.ts +12 -8
- package/packages/number-input/src/number-input.ts +90 -13
- package/packages/password-input/src/password-input.ts +13 -9
- package/packages/tooltip/index.ts +8 -2
- package/packages/tooltip/src/tooltip.ts +27 -9
- package/packages/ui/index.ts +5 -0
- package/styles/components/input.scss +20 -2
- package/styles/components/number-input.scss +20 -3
- package/styles/components/password-input.scss +20 -2
- package/types/components/input.d.ts +2 -0
- package/types/components/number-input.d.ts +22 -2
- package/types/components/password-input.d.ts +3 -1
- package/types/components/tooltip.d.ts +15 -1
- /package/es/icon/{iconfont.1788249701081.ttf → iconfont.1788319620112.ttf} +0 -0
- /package/es/icon/{iconfont.1788249701081.woff → iconfont.1788319620112.woff} +0 -0
- /package/es/icon/{iconfont.1788249701081.woff2 → iconfont.1788319620112.woff2} +0 -0
- /package/es/{iconfont.1788249701081.ttf → iconfont.1788319620112.ttf} +0 -0
- /package/es/{iconfont.1788249701081.woff → iconfont.1788319620112.woff} +0 -0
- /package/es/{iconfont.1788249701081.woff2 → iconfont.1788319620112.woff2} +0 -0
- /package/lib/icon/style/{iconfont.1788249701081.ttf → iconfont.1788319620112.ttf} +0 -0
- /package/lib/icon/style/{iconfont.1788249701081.woff → iconfont.1788319620112.woff} +0 -0
- /package/lib/icon/style/{iconfont.1788249701081.woff2 → iconfont.1788319620112.woff2} +0 -0
- /package/lib/{iconfont.1788249701081.ttf → iconfont.1788319620112.ttf} +0 -0
- /package/lib/{iconfont.1788249701081.woff → iconfont.1788319620112.woff} +0 -0
- /package/lib/{iconfont.1788249701081.woff2 → iconfont.1788319620112.woff2} +0 -0
package/dist/all.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as core from '@vxe-ui/core';
|
|
2
|
-
import { VxeUI, setConfig as setConfig$1, setIcon, getConfig as getConfig$3, createEvent, getIcon as getIcon$2, renderEmptyElement, useSize, usePermission, permission,
|
|
2
|
+
import { VxeUI, setConfig as setConfig$1, setIcon, getConfig as getConfig$3, createEvent, getIcon as getIcon$2, renderEmptyElement, useSize, globalEvents, usePermission, permission, renderer, getI18n as getI18n$2, globalResize, menus as menus$3, GLOBAL_EVENT_KEYS, getSlotVNs as getSlotVNs$1, commands, formats, getComponent, validators } from '@vxe-ui/core';
|
|
3
3
|
export * from '@vxe-ui/core';
|
|
4
4
|
import { defineComponent, ref, reactive, h, createCommentVNode, createApp, inject, computed, watch, onMounted, onUnmounted, provide, nextTick, onBeforeUnmount, resolveComponent, Teleport, onActivated, onDeactivated, TransitionGroup } from 'vue';
|
|
5
5
|
import XEUtils from 'xe-utils';
|
|
@@ -101,7 +101,7 @@ function checkDynamic() {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
const { log } = VxeUI;
|
|
104
|
-
const uiVersion = `ui v${"4.17.
|
|
104
|
+
const uiVersion = `ui v${"4.17.26"}`;
|
|
105
105
|
function createComponentLog(name) {
|
|
106
106
|
const tableVersion = VxeUI.tableVersion ? `table v${VxeUI.tableVersion}` : '';
|
|
107
107
|
const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
|
|
@@ -115,7 +115,7 @@ function createComponentLog(name) {
|
|
|
115
115
|
const warnLog$i = log.create('warn', uiVersion);
|
|
116
116
|
log.create('error', uiVersion);
|
|
117
117
|
|
|
118
|
-
const version = "4.17.
|
|
118
|
+
const version = "4.17.26";
|
|
119
119
|
VxeUI.uiVersion = version;
|
|
120
120
|
VxeUI.dynamicApp = dynamicApp;
|
|
121
121
|
function config(options) {
|
|
@@ -409,6 +409,11 @@ setConfig$1({
|
|
|
409
409
|
showButton: true,
|
|
410
410
|
isWheel: true,
|
|
411
411
|
isArrow: true
|
|
412
|
+
},
|
|
413
|
+
tooltipConfig: {
|
|
414
|
+
minWidth: 60,
|
|
415
|
+
enterable: true,
|
|
416
|
+
enterDelay: 0
|
|
412
417
|
}
|
|
413
418
|
},
|
|
414
419
|
optgroup: {},
|
|
@@ -2765,7 +2770,9 @@ var VxeTooltipComponent = defineVxeComponent({
|
|
|
2765
2770
|
}
|
|
2766
2771
|
},
|
|
2767
2772
|
emits: [
|
|
2768
|
-
'update:modelValue'
|
|
2773
|
+
'update:modelValue',
|
|
2774
|
+
'show',
|
|
2775
|
+
'hide'
|
|
2769
2776
|
],
|
|
2770
2777
|
setup(props, context) {
|
|
2771
2778
|
const { slots, emit } = context;
|
|
@@ -2882,7 +2889,7 @@ var VxeTooltipComponent = defineVxeComponent({
|
|
|
2882
2889
|
tipStore.placement = 'top';
|
|
2883
2890
|
tipStore.style = { width: 'auto', left: 0, top: 0, zIndex: props.zIndex || reactData.tipZindex };
|
|
2884
2891
|
tipStore.arrowStyle = { left: '50%' };
|
|
2885
|
-
return
|
|
2892
|
+
return $xeTooltip.updatePlacement();
|
|
2886
2893
|
};
|
|
2887
2894
|
const handleDelayFn = () => {
|
|
2888
2895
|
internalData.showDelayTip = XEUtils.debounce(() => {
|
|
@@ -2920,9 +2927,12 @@ var VxeTooltipComponent = defineVxeComponent({
|
|
|
2920
2927
|
if (showDelayTip) {
|
|
2921
2928
|
showDelayTip();
|
|
2922
2929
|
}
|
|
2930
|
+
dispatchEvent('show', {}, evnt || null);
|
|
2923
2931
|
}
|
|
2924
2932
|
else {
|
|
2925
|
-
|
|
2933
|
+
const rest = showTip();
|
|
2934
|
+
dispatchEvent('show', {}, evnt || null);
|
|
2935
|
+
return rest;
|
|
2926
2936
|
}
|
|
2927
2937
|
}
|
|
2928
2938
|
return nextTick();
|
|
@@ -2971,6 +2981,7 @@ var VxeTooltipComponent = defineVxeComponent({
|
|
|
2971
2981
|
defaultLeft: left,
|
|
2972
2982
|
placement: placement,
|
|
2973
2983
|
defaultPlacement: defaultPlacement,
|
|
2984
|
+
isMinWidth: false,
|
|
2974
2985
|
teleportTo: true
|
|
2975
2986
|
});
|
|
2976
2987
|
const panelStyle = Object.assign(ppObj.style, {
|
|
@@ -2978,7 +2989,7 @@ var VxeTooltipComponent = defineVxeComponent({
|
|
|
2978
2989
|
});
|
|
2979
2990
|
tipStore.placement = ppObj.placement;
|
|
2980
2991
|
tipStore.style = panelStyle;
|
|
2981
|
-
tipStore.arrowStyle.left = `${ppObj.arrowLeft}px
|
|
2992
|
+
tipStore.arrowStyle.left = ppObj.arrowLeft ? `${ppObj.arrowLeft}px` : '';
|
|
2982
2993
|
};
|
|
2983
2994
|
const tooltipMethods = {
|
|
2984
2995
|
dispatchEvent,
|
|
@@ -2998,6 +3009,7 @@ var VxeTooltipComponent = defineVxeComponent({
|
|
|
2998
3009
|
arrowStyle: null
|
|
2999
3010
|
});
|
|
3000
3011
|
updateValue(false);
|
|
3012
|
+
dispatchEvent('hide', {}, null);
|
|
3001
3013
|
return nextTick();
|
|
3002
3014
|
},
|
|
3003
3015
|
toVisible(target, content) {
|
|
@@ -3017,6 +3029,14 @@ var VxeTooltipComponent = defineVxeComponent({
|
|
|
3017
3029
|
const wheelEvent = (evnt) => {
|
|
3018
3030
|
evnt.stopPropagation();
|
|
3019
3031
|
};
|
|
3032
|
+
const handleGlobalScrollEvent = () => {
|
|
3033
|
+
if (reactData.visible) {
|
|
3034
|
+
$xeTooltip.updatePlacement();
|
|
3035
|
+
}
|
|
3036
|
+
};
|
|
3037
|
+
const handleGlobalBlurEvent = () => {
|
|
3038
|
+
$xeTooltip.close();
|
|
3039
|
+
};
|
|
3020
3040
|
const tooltipPrivateMethods = {
|
|
3021
3041
|
handleCloseEvent: targetMouseleaveEvent
|
|
3022
3042
|
};
|
|
@@ -3139,6 +3159,8 @@ var VxeTooltipComponent = defineVxeComponent({
|
|
|
3139
3159
|
}
|
|
3140
3160
|
}
|
|
3141
3161
|
});
|
|
3162
|
+
globalEvents.on($xeTooltip, 'blur', handleGlobalBlurEvent);
|
|
3163
|
+
globalEvents.on($xeTooltip, 'scroll', handleGlobalScrollEvent);
|
|
3142
3164
|
});
|
|
3143
3165
|
onBeforeUnmount(() => {
|
|
3144
3166
|
const { target } = reactData;
|
|
@@ -3158,8 +3180,8 @@ var VxeTooltipComponent = defineVxeComponent({
|
|
|
3158
3180
|
parentNode.removeChild(panelElem);
|
|
3159
3181
|
}
|
|
3160
3182
|
}
|
|
3161
|
-
|
|
3162
|
-
|
|
3183
|
+
globalEvents.off($xeTooltip, 'blur');
|
|
3184
|
+
globalEvents.off($xeTooltip, 'scroll');
|
|
3163
3185
|
XEUtils.assign(reactData, createReactData$n());
|
|
3164
3186
|
XEUtils.assign(internalData, createInternalData$m());
|
|
3165
3187
|
});
|
|
@@ -3197,12 +3219,15 @@ const TooltipController = {
|
|
|
3197
3219
|
return Promise.resolve();
|
|
3198
3220
|
},
|
|
3199
3221
|
close() {
|
|
3222
|
+
const { globalTooltip } = dynamicStore;
|
|
3223
|
+
if (!globalTooltip || !globalTooltip.modelValue) {
|
|
3224
|
+
return Promise.resolve();
|
|
3225
|
+
}
|
|
3200
3226
|
const $tooltip = refTooltip.value;
|
|
3201
3227
|
if ($tooltip) {
|
|
3202
3228
|
$tooltip.handleCloseEvent();
|
|
3203
3229
|
}
|
|
3204
3230
|
else {
|
|
3205
|
-
const { globalTooltip } = dynamicStore;
|
|
3206
3231
|
if (globalTooltip) {
|
|
3207
3232
|
globalTooltip.modelValue = false;
|
|
3208
3233
|
}
|
|
@@ -3210,6 +3235,10 @@ const TooltipController = {
|
|
|
3210
3235
|
return Promise.resolve();
|
|
3211
3236
|
},
|
|
3212
3237
|
destroy() {
|
|
3238
|
+
const { globalTooltip } = dynamicStore;
|
|
3239
|
+
if (!globalTooltip || !globalTooltip.modelValue) {
|
|
3240
|
+
return Promise.resolve();
|
|
3241
|
+
}
|
|
3213
3242
|
const $tooltip = refTooltip.value;
|
|
3214
3243
|
if ($tooltip) {
|
|
3215
3244
|
return $tooltip.close().then(() => {
|
|
@@ -3217,7 +3246,6 @@ const TooltipController = {
|
|
|
3217
3246
|
dynamicStore.isTipInit = false;
|
|
3218
3247
|
});
|
|
3219
3248
|
}
|
|
3220
|
-
const { globalTooltip } = dynamicStore;
|
|
3221
3249
|
if (globalTooltip) {
|
|
3222
3250
|
globalTooltip.modelValue = false;
|
|
3223
3251
|
}
|
|
@@ -3976,7 +4004,7 @@ dynamicApp.use(VxeButton);
|
|
|
3976
4004
|
VxeUI.component(VxeButtonComponent);
|
|
3977
4005
|
const Button = VxeButton;
|
|
3978
4006
|
|
|
3979
|
-
const { errLog: errLog$
|
|
4007
|
+
const { errLog: errLog$k } = createComponentLog('backtop');
|
|
3980
4008
|
function createInternalData$l() {
|
|
3981
4009
|
return {
|
|
3982
4010
|
targetEl: null
|
|
@@ -4154,7 +4182,7 @@ var VxeBacktopComponent = defineVxeComponent({
|
|
|
4154
4182
|
const { target } = props;
|
|
4155
4183
|
if (!target) {
|
|
4156
4184
|
removeScrollEvent();
|
|
4157
|
-
errLog$
|
|
4185
|
+
errLog$k('vxe.error.reqProp', ['target']);
|
|
4158
4186
|
return;
|
|
4159
4187
|
}
|
|
4160
4188
|
if (XEUtils.isString(target)) {
|
|
@@ -4895,7 +4923,7 @@ const getNextMonth = (date) => {
|
|
|
4895
4923
|
return date;
|
|
4896
4924
|
};
|
|
4897
4925
|
|
|
4898
|
-
const { errLog: errLog$
|
|
4926
|
+
const { errLog: errLog$j } = createComponentLog('calendar');
|
|
4899
4927
|
const { menus: menus$2, getConfig: getConfig$2, getI18n: getI18n$1 } = VxeUI;
|
|
4900
4928
|
var VxeCalendarComponent = defineVxeComponent({
|
|
4901
4929
|
name: 'VxeCalendar',
|
|
@@ -6163,7 +6191,7 @@ var VxeCalendarComponent = defineVxeComponent({
|
|
|
6163
6191
|
const { menuConfig } = props;
|
|
6164
6192
|
const VxeUIContextMenu = VxeUI.getComponent('VxeContextMenu');
|
|
6165
6193
|
if (menuConfig && !VxeUIContextMenu) {
|
|
6166
|
-
errLog$
|
|
6194
|
+
errLog$j('vxe.error.reqComp', ['vxe-context-menu']);
|
|
6167
6195
|
}
|
|
6168
6196
|
dateOpenPanel();
|
|
6169
6197
|
});
|
|
@@ -6985,7 +7013,7 @@ function getItemCacheObj$1(item) {
|
|
|
6985
7013
|
};
|
|
6986
7014
|
}
|
|
6987
7015
|
|
|
6988
|
-
const { warnLog: warnLog$g, errLog: errLog$
|
|
7016
|
+
const { warnLog: warnLog$g, errLog: errLog$i } = createComponentLog('tree');
|
|
6989
7017
|
function getRowKeyByField(row, keyField) {
|
|
6990
7018
|
return row ? ('' + (row[keyField] || '')) : '';
|
|
6991
7019
|
}
|
|
@@ -8240,7 +8268,7 @@ var VxeListComponent = defineVxeComponent({
|
|
|
8240
8268
|
const { fullData, rowMaps, removeRowMaps, insertRowMaps } = internalData;
|
|
8241
8269
|
const keyField = computeKeyField.value;
|
|
8242
8270
|
if (!keyField) {
|
|
8243
|
-
errLog$
|
|
8271
|
+
errLog$i('vxe.error.reqSupportProp', ['insert() | insertAt() | insertNextAt()', 'row-config.keyField']);
|
|
8244
8272
|
return Promise.resolve({ row: null, rows: [] });
|
|
8245
8273
|
}
|
|
8246
8274
|
if (!XEUtils.isArray(records)) {
|
|
@@ -8427,7 +8455,7 @@ var VxeListComponent = defineVxeComponent({
|
|
|
8427
8455
|
const { fullData, insertRowMaps, removeRowMaps } = internalData;
|
|
8428
8456
|
const keyField = computeKeyField.value;
|
|
8429
8457
|
if (!keyField) {
|
|
8430
|
-
errLog$
|
|
8458
|
+
errLog$i('vxe.error.reqSupportProp', ['insert() | insertAt() | insertNextAt()', 'row-config.keyField']);
|
|
8431
8459
|
return Promise.resolve({ row: null, rows: [] });
|
|
8432
8460
|
}
|
|
8433
8461
|
let delList = [];
|
|
@@ -9037,20 +9065,20 @@ var VxeListComponent = defineVxeComponent({
|
|
|
9037
9065
|
const keyField = computeKeyField.value;
|
|
9038
9066
|
if (!keyField) {
|
|
9039
9067
|
if (showSeq) {
|
|
9040
|
-
errLog$
|
|
9068
|
+
errLog$i('vxe.error.reqSupportProp', ['show-seq', 'row-config.keyField']);
|
|
9041
9069
|
}
|
|
9042
9070
|
if (showRadio) {
|
|
9043
|
-
errLog$
|
|
9071
|
+
errLog$i('vxe.error.reqSupportProp', ['show-radio', 'row-config.keyField']);
|
|
9044
9072
|
}
|
|
9045
9073
|
if (showCheckbox) {
|
|
9046
|
-
errLog$
|
|
9074
|
+
errLog$i('vxe.error.reqSupportProp', ['show-checkbox', 'row-config.keyField']);
|
|
9047
9075
|
}
|
|
9048
9076
|
if (isDrag) {
|
|
9049
|
-
errLog$
|
|
9077
|
+
errLog$i('vxe.error.reqSupportProp', ['drag-config', 'row-config.keyField']);
|
|
9050
9078
|
}
|
|
9051
9079
|
}
|
|
9052
9080
|
if (useKey && !keyField) {
|
|
9053
|
-
errLog$
|
|
9081
|
+
errLog$i('vxe.error.reqSupportProp', ['row-config.useKey', 'row-config.keyField']);
|
|
9054
9082
|
}
|
|
9055
9083
|
if (props.autoResize) {
|
|
9056
9084
|
const el = refElem.value;
|
|
@@ -9154,6 +9182,10 @@ var VxeInputComponent = defineVxeComponent({
|
|
|
9154
9182
|
type: String,
|
|
9155
9183
|
default: () => getConfig$3().input.floatContent
|
|
9156
9184
|
},
|
|
9185
|
+
floatAlign: {
|
|
9186
|
+
type: String,
|
|
9187
|
+
default: () => getConfig$3().input.floatAlign
|
|
9188
|
+
},
|
|
9157
9189
|
maxLength: {
|
|
9158
9190
|
type: [String, Number],
|
|
9159
9191
|
default: () => getConfig$3().input.maxLength
|
|
@@ -11683,7 +11715,7 @@ var VxeInputComponent = defineVxeComponent({
|
|
|
11683
11715
|
return createCommentVNode();
|
|
11684
11716
|
};
|
|
11685
11717
|
const renderVN = () => {
|
|
11686
|
-
const { className, inputClassName, controls, type, title, floatContent, align, showWordCount, countMethod, name, autoComplete, autocomplete } = props;
|
|
11718
|
+
const { className, inputClassName, controls, type, title, floatContent, align, showWordCount, countMethod, name, autoComplete, autocomplete, floatAlign } = props;
|
|
11687
11719
|
const { inputValue, visiblePanel, isActivated } = reactData;
|
|
11688
11720
|
const vSize = computeSize.value;
|
|
11689
11721
|
const isDisabled = computeIsDisabled.value;
|
|
@@ -11707,7 +11739,7 @@ var VxeInputComponent = defineVxeComponent({
|
|
|
11707
11739
|
const floatSlot = slots.float;
|
|
11708
11740
|
return h('div', {
|
|
11709
11741
|
ref: refElem,
|
|
11710
|
-
class: ['vxe-input', `type--${type}`, className, {
|
|
11742
|
+
class: ['vxe-input', `type--${type}`, floatContent ? (`fla--${floatAlign || 'center'}`) : '', className, {
|
|
11711
11743
|
[`size--${vSize}`]: vSize,
|
|
11712
11744
|
[`is--${align}`]: align,
|
|
11713
11745
|
'is--controls': controls,
|
|
@@ -11744,14 +11776,14 @@ var VxeInputComponent = defineVxeComponent({
|
|
|
11744
11776
|
onChange: changeEvent,
|
|
11745
11777
|
onFocus: focusEvent,
|
|
11746
11778
|
onBlur: blurEvent
|
|
11747
|
-
})
|
|
11779
|
+
}),
|
|
11780
|
+
floatContent || floatSlot
|
|
11781
|
+
? h('span', {
|
|
11782
|
+
class: 'vxe-input--float-wrapper'
|
|
11783
|
+
}, floatSlot ? floatSlot({}) : getText(floatContent))
|
|
11784
|
+
: renderEmptyElement($xeInput)
|
|
11748
11785
|
]),
|
|
11749
11786
|
suffix || createCommentVNode(),
|
|
11750
|
-
floatContent || floatSlot
|
|
11751
|
-
? h('span', {
|
|
11752
|
-
class: 'vxe-input--float-wrapper'
|
|
11753
|
-
}, floatSlot ? floatSlot({}) : getText(floatContent))
|
|
11754
|
-
: renderEmptyElement($xeInput),
|
|
11755
11787
|
// 下拉面板
|
|
11756
11788
|
renderPanel(),
|
|
11757
11789
|
// 字数统计
|
|
@@ -15239,6 +15271,7 @@ function hexToRgb(str) {
|
|
|
15239
15271
|
return null;
|
|
15240
15272
|
}
|
|
15241
15273
|
|
|
15274
|
+
const { errLog: errLog$h } = createComponentLog('number-input');
|
|
15242
15275
|
var VxeNumberInputComponent = defineVxeComponent({
|
|
15243
15276
|
name: 'VxeNumberInput',
|
|
15244
15277
|
props: {
|
|
@@ -15269,6 +15302,10 @@ var VxeNumberInputComponent = defineVxeComponent({
|
|
|
15269
15302
|
type: String,
|
|
15270
15303
|
default: () => getConfig$3().numberInput.floatContent
|
|
15271
15304
|
},
|
|
15305
|
+
floatAlign: {
|
|
15306
|
+
type: String,
|
|
15307
|
+
default: () => getConfig$3().numberInput.floatAlign
|
|
15308
|
+
},
|
|
15272
15309
|
maxLength: {
|
|
15273
15310
|
type: [String, Number],
|
|
15274
15311
|
default: () => getConfig$3().numberInput.maxLength
|
|
@@ -15338,6 +15375,11 @@ var VxeNumberInputComponent = defineVxeComponent({
|
|
|
15338
15375
|
prefixConfig: Object,
|
|
15339
15376
|
suffixIcon: String,
|
|
15340
15377
|
suffixConfig: Object,
|
|
15378
|
+
showTooltip: {
|
|
15379
|
+
type: Boolean,
|
|
15380
|
+
default: () => getConfig$3().numberInput.showTooltip
|
|
15381
|
+
},
|
|
15382
|
+
tooltipConfig: Object,
|
|
15341
15383
|
// 已废弃
|
|
15342
15384
|
controls: {
|
|
15343
15385
|
type: Boolean,
|
|
@@ -15430,6 +15472,9 @@ var VxeNumberInputComponent = defineVxeComponent({
|
|
|
15430
15472
|
const computeSuffixOpts = computed(() => {
|
|
15431
15473
|
return Object.assign({}, getConfig$3().numberInput.suffixConfig, props.suffixConfig);
|
|
15432
15474
|
});
|
|
15475
|
+
const computeTooltipOpts = computed(() => {
|
|
15476
|
+
return Object.assign({}, getConfig$3().numberInput.tooltipConfig, props.tooltipConfig);
|
|
15477
|
+
});
|
|
15433
15478
|
const computeDecimalsType = computed(() => {
|
|
15434
15479
|
const { type } = props;
|
|
15435
15480
|
return type === 'float' || type === 'amount';
|
|
@@ -15662,6 +15707,9 @@ var VxeNumberInputComponent = defineVxeComponent({
|
|
|
15662
15707
|
handleChange(null, '', evnt);
|
|
15663
15708
|
dispatchEvent('clear', { value }, evnt);
|
|
15664
15709
|
dispatchEvent('lazy-change', { value }, evnt);
|
|
15710
|
+
nextTick(() => {
|
|
15711
|
+
handleShowTip();
|
|
15712
|
+
});
|
|
15665
15713
|
};
|
|
15666
15714
|
const clickSuffixEvent = (evnt) => {
|
|
15667
15715
|
const isDisabled = computeIsDisabled.value;
|
|
@@ -15782,6 +15830,12 @@ var VxeNumberInputComponent = defineVxeComponent({
|
|
|
15782
15830
|
$xeForm.triggerItemEvent(evnt, formItemInfo.itemConfig.field, value);
|
|
15783
15831
|
}
|
|
15784
15832
|
};
|
|
15833
|
+
const mouseenterEvent = () => {
|
|
15834
|
+
handleShowTip();
|
|
15835
|
+
};
|
|
15836
|
+
const mouseleaveEvent = () => {
|
|
15837
|
+
handleHideTip();
|
|
15838
|
+
};
|
|
15785
15839
|
// 数值
|
|
15786
15840
|
const numberChange = (isPlus, evnt) => {
|
|
15787
15841
|
const { min, max, type } = props;
|
|
@@ -15809,6 +15863,7 @@ var VxeNumberInputComponent = defineVxeComponent({
|
|
|
15809
15863
|
numberChange(true, evnt);
|
|
15810
15864
|
}
|
|
15811
15865
|
reactData.isActivated = true;
|
|
15866
|
+
handleShowTip();
|
|
15812
15867
|
dispatchEvent('plus-number', { value: reactData.inputValue }, evnt);
|
|
15813
15868
|
dispatchEvent('lazy-change', { value: reactData.inputValue }, evnt);
|
|
15814
15869
|
// 已废弃
|
|
@@ -15822,6 +15877,7 @@ var VxeNumberInputComponent = defineVxeComponent({
|
|
|
15822
15877
|
numberChange(false, evnt);
|
|
15823
15878
|
}
|
|
15824
15879
|
reactData.isActivated = true;
|
|
15880
|
+
handleShowTip();
|
|
15825
15881
|
dispatchEvent('minus-number', { value: reactData.inputValue }, evnt);
|
|
15826
15882
|
dispatchEvent('lazy-change', { value: reactData.inputValue }, evnt);
|
|
15827
15883
|
// 已废弃
|
|
@@ -15840,6 +15896,43 @@ var VxeNumberInputComponent = defineVxeComponent({
|
|
|
15840
15896
|
}
|
|
15841
15897
|
}
|
|
15842
15898
|
};
|
|
15899
|
+
const handleShowTip = () => {
|
|
15900
|
+
const { type, showTooltip } = props;
|
|
15901
|
+
const { inputValue } = reactData;
|
|
15902
|
+
if (showTooltip) {
|
|
15903
|
+
if (VxeUI.tooltip) {
|
|
15904
|
+
const numLabel = computeNumLabel.value;
|
|
15905
|
+
const tooltipOpts = computeTooltipOpts.value;
|
|
15906
|
+
const { contentMethod } = tooltipOpts;
|
|
15907
|
+
const inputElem = refInputTarget.value;
|
|
15908
|
+
const content = getText(contentMethod
|
|
15909
|
+
? contentMethod({
|
|
15910
|
+
$mumberInput: $xeNumberInput,
|
|
15911
|
+
type,
|
|
15912
|
+
inputValue: inputElem.value,
|
|
15913
|
+
value: inputValue || '',
|
|
15914
|
+
label: numLabel
|
|
15915
|
+
})
|
|
15916
|
+
: numLabel);
|
|
15917
|
+
if (content) {
|
|
15918
|
+
VxeUI.tooltip.open(inputElem, Object.assign({}, Object.assign(Object.assign({}, tooltipOpts), { content }), {
|
|
15919
|
+
contentMethod: undefined
|
|
15920
|
+
}));
|
|
15921
|
+
}
|
|
15922
|
+
else {
|
|
15923
|
+
VxeUI.tooltip.close();
|
|
15924
|
+
}
|
|
15925
|
+
}
|
|
15926
|
+
}
|
|
15927
|
+
};
|
|
15928
|
+
const handleHideTip = () => {
|
|
15929
|
+
const { showTooltip } = props;
|
|
15930
|
+
if (showTooltip) {
|
|
15931
|
+
if (VxeUI.tooltip) {
|
|
15932
|
+
VxeUI.tooltip.close();
|
|
15933
|
+
}
|
|
15934
|
+
}
|
|
15935
|
+
};
|
|
15843
15936
|
const keydownEvent = (evnt) => {
|
|
15844
15937
|
const { type, negative, exponential, controls } = props;
|
|
15845
15938
|
const controlOpts = computeControlOpts.value;
|
|
@@ -15874,6 +15967,7 @@ var VxeNumberInputComponent = defineVxeComponent({
|
|
|
15874
15967
|
triggerEvent(evnt);
|
|
15875
15968
|
};
|
|
15876
15969
|
const keyupEvent = (evnt) => {
|
|
15970
|
+
handleShowTip();
|
|
15877
15971
|
triggerEvent(evnt);
|
|
15878
15972
|
};
|
|
15879
15973
|
// 数值
|
|
@@ -15968,6 +16062,7 @@ var VxeNumberInputComponent = defineVxeComponent({
|
|
|
15968
16062
|
triggerEvent(evnt);
|
|
15969
16063
|
};
|
|
15970
16064
|
const clickEvent = (evnt) => {
|
|
16065
|
+
handleShowTip();
|
|
15971
16066
|
triggerEvent(evnt);
|
|
15972
16067
|
};
|
|
15973
16068
|
// 全局事件
|
|
@@ -15987,6 +16082,7 @@ var VxeNumberInputComponent = defineVxeComponent({
|
|
|
15987
16082
|
handleChange(value, handleNumberString(inputValue), evnt);
|
|
15988
16083
|
}
|
|
15989
16084
|
afterCheckValue();
|
|
16085
|
+
handleHideTip();
|
|
15990
16086
|
}
|
|
15991
16087
|
}
|
|
15992
16088
|
};
|
|
@@ -16153,7 +16249,8 @@ var VxeNumberInputComponent = defineVxeComponent({
|
|
|
16153
16249
|
onChange: changeEvent,
|
|
16154
16250
|
onFocus: focusEvent,
|
|
16155
16251
|
onBlur: blurEvent
|
|
16156
|
-
})
|
|
16252
|
+
}),
|
|
16253
|
+
renderFloat()
|
|
16157
16254
|
]),
|
|
16158
16255
|
renderSuffixIcon()
|
|
16159
16256
|
]);
|
|
@@ -16216,7 +16313,7 @@ var VxeNumberInputComponent = defineVxeComponent({
|
|
|
16216
16313
|
return renderEmptyElement($xeNumberInput);
|
|
16217
16314
|
};
|
|
16218
16315
|
const renderVN = () => {
|
|
16219
|
-
const { className, controls, type, align, prefixIcon, suffixIcon } = props;
|
|
16316
|
+
const { className, controls, type, align, prefixIcon, suffixIcon, floatContent, floatAlign } = props;
|
|
16220
16317
|
const { inputValue, isActivated } = reactData;
|
|
16221
16318
|
const vSize = computeSize.value;
|
|
16222
16319
|
const controlOpts = computeControlOpts.value;
|
|
@@ -16237,7 +16334,7 @@ var VxeNumberInputComponent = defineVxeComponent({
|
|
|
16237
16334
|
const isControls = isEnableConf(controlOpts) && (controls === false ? controls : showButton);
|
|
16238
16335
|
return h('div', {
|
|
16239
16336
|
ref: refElem,
|
|
16240
|
-
class: ['vxe-number-input', `type--${type}`, isControls ? (`ctl--${layout === 'right' || layout === 'left' ? layout : 'default'}`) : '', className, {
|
|
16337
|
+
class: ['vxe-number-input', `type--${type}`, isControls ? (`ctl--${layout === 'right' || layout === 'left' ? layout : 'default'}`) : '', floatContent ? (`fla--${floatAlign || 'center'}`) : '', className, {
|
|
16241
16338
|
[`size--${vSize}`]: vSize,
|
|
16242
16339
|
[`is--${align}`]: align,
|
|
16243
16340
|
'is--controls': isControls && !inputReadonly,
|
|
@@ -16247,29 +16344,27 @@ var VxeNumberInputComponent = defineVxeComponent({
|
|
|
16247
16344
|
'is--active': isActivated,
|
|
16248
16345
|
'show--clear': isClearable && !isDisabled && !(inputValue === '' || XEUtils.eqNull(inputValue))
|
|
16249
16346
|
}],
|
|
16250
|
-
spellcheck: false
|
|
16347
|
+
spellcheck: false,
|
|
16348
|
+
onMouseenter: mouseenterEvent,
|
|
16349
|
+
onMouseleave: mouseleaveEvent
|
|
16251
16350
|
}, isControls
|
|
16252
16351
|
? (layout === 'right'
|
|
16253
16352
|
? [
|
|
16254
16353
|
renderInput(),
|
|
16255
|
-
renderSideControl()
|
|
16256
|
-
renderFloat()
|
|
16354
|
+
renderSideControl()
|
|
16257
16355
|
]
|
|
16258
16356
|
: (layout === 'left'
|
|
16259
16357
|
? [
|
|
16260
16358
|
renderSideControl(),
|
|
16261
|
-
renderInput()
|
|
16262
|
-
renderFloat()
|
|
16359
|
+
renderInput()
|
|
16263
16360
|
]
|
|
16264
16361
|
: [
|
|
16265
16362
|
renderMinusBtn(),
|
|
16266
16363
|
renderInput(),
|
|
16267
|
-
renderPlusBtn()
|
|
16268
|
-
renderFloat()
|
|
16364
|
+
renderPlusBtn()
|
|
16269
16365
|
]))
|
|
16270
16366
|
: [
|
|
16271
|
-
renderInput()
|
|
16272
|
-
renderFloat()
|
|
16367
|
+
renderInput()
|
|
16273
16368
|
]);
|
|
16274
16369
|
};
|
|
16275
16370
|
$xeNumberInput.renderVN = renderVN;
|
|
@@ -16287,6 +16382,11 @@ var VxeNumberInputComponent = defineVxeComponent({
|
|
|
16287
16382
|
initValue();
|
|
16288
16383
|
});
|
|
16289
16384
|
onMounted(() => {
|
|
16385
|
+
if (props.showTooltip) {
|
|
16386
|
+
if (!VxeUI.tooltip) {
|
|
16387
|
+
errLog$h('vxe.error.reqComp', ['vxe-tooltip']);
|
|
16388
|
+
}
|
|
16389
|
+
}
|
|
16290
16390
|
updateModel(props.modelValue);
|
|
16291
16391
|
const targetElem = refInputTarget.value;
|
|
16292
16392
|
if (targetElem) {
|
|
@@ -33992,6 +34092,10 @@ var VxePasswordInputComponent = defineVxeComponent({
|
|
|
33992
34092
|
type: String,
|
|
33993
34093
|
default: () => getConfig$3().passwordInput.floatContent
|
|
33994
34094
|
},
|
|
34095
|
+
floatAlign: {
|
|
34096
|
+
type: String,
|
|
34097
|
+
default: () => getConfig$3().passwordInput.floatAlign
|
|
34098
|
+
},
|
|
33995
34099
|
autoComplete: {
|
|
33996
34100
|
type: String,
|
|
33997
34101
|
default: 'off'
|
|
@@ -34302,7 +34406,7 @@ var VxePasswordInputComponent = defineVxeComponent({
|
|
|
34302
34406
|
: null;
|
|
34303
34407
|
};
|
|
34304
34408
|
const renderVN = () => {
|
|
34305
|
-
const { className, inputClassName, name, readonly, floatContent, autocomplete, autoComplete, maxLength } = props;
|
|
34409
|
+
const { className, inputClassName, name, readonly, floatContent, autocomplete, autoComplete, maxLength, floatAlign } = props;
|
|
34306
34410
|
const { inputValue, isActivated } = reactData;
|
|
34307
34411
|
const isDisabled = computeIsDisabled.value;
|
|
34308
34412
|
const formReadonly = computeFormReadonly.value;
|
|
@@ -34322,7 +34426,7 @@ var VxePasswordInputComponent = defineVxeComponent({
|
|
|
34322
34426
|
const floatSlot = slots.float;
|
|
34323
34427
|
return h('div', {
|
|
34324
34428
|
ref: refElem,
|
|
34325
|
-
class: ['vxe-password-input', className, {
|
|
34429
|
+
class: ['vxe-password-input', floatContent ? (`fla--${floatAlign || 'center'}`) : '', className, {
|
|
34326
34430
|
[`size--${vSize}`]: vSize,
|
|
34327
34431
|
'is--prefix': !!prefix,
|
|
34328
34432
|
'is--suffix': !!suffix,
|
|
@@ -34352,14 +34456,14 @@ var VxePasswordInputComponent = defineVxeComponent({
|
|
|
34352
34456
|
onChange: changeEvent,
|
|
34353
34457
|
onFocus: focusEvent,
|
|
34354
34458
|
onBlur: blurEvent
|
|
34355
|
-
})
|
|
34459
|
+
}),
|
|
34460
|
+
floatContent || floatSlot
|
|
34461
|
+
? h('span', {
|
|
34462
|
+
class: 'vxe-password-input--float-wrapper'
|
|
34463
|
+
}, floatSlot ? floatSlot({}) : getText(floatContent))
|
|
34464
|
+
: renderEmptyElement($xePasswordInput)
|
|
34356
34465
|
]),
|
|
34357
|
-
suffix || renderEmptyElement($xePasswordInput)
|
|
34358
|
-
floatContent || floatSlot
|
|
34359
|
-
? h('span', {
|
|
34360
|
-
class: 'vxe-password-input--float-wrapper'
|
|
34361
|
-
}, floatSlot ? floatSlot({}) : getText(floatContent))
|
|
34362
|
-
: renderEmptyElement($xePasswordInput)
|
|
34466
|
+
suffix || renderEmptyElement($xePasswordInput)
|
|
34363
34467
|
]);
|
|
34364
34468
|
};
|
|
34365
34469
|
watch(() => props.modelValue, (val) => {
|