@wfrog/vc-ui 1.1.0 → 1.2.0
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/README.md +3 -3
- package/dist/es/chunk/{OEa4tYPF.mjs → -ga82G_B.mjs} +1 -1
- package/dist/es/chunk/B1BnPYNG.mjs +163 -0
- package/dist/es/chunk/{DFOLES4O.mjs → BA2yoAwy.mjs} +403 -502
- package/dist/es/chunk/{BpqBBo4z.mjs → BDyXj_90.mjs} +2 -2
- package/dist/es/chunk/{BI0vrXwX.mjs → BI-fNJhk.mjs} +6 -3
- package/dist/es/chunk/{BsGCX4td.mjs → BK4T_2ha.mjs} +1 -1
- package/dist/es/chunk/{73YgKz3H.mjs → BLLKi_0v.mjs} +1 -1
- package/dist/es/chunk/{DTLPXrjb.mjs → BTsEMnf_.mjs} +1 -1
- package/dist/es/chunk/{B5UQmWXg.mjs → BUf50Y7Y.mjs} +41 -21
- package/dist/es/chunk/{BzedaLtg.mjs → BYVaz5Or.mjs} +2 -2
- package/dist/es/chunk/BaJ7k5Lg.mjs +209 -0
- package/dist/es/chunk/{Bp9jXKX0.mjs → BambM7zX.mjs} +2 -2
- package/dist/es/chunk/{CizMbf5K.mjs → Bl0WQiki.mjs} +1 -1
- package/dist/es/chunk/{CLbj8G-F.mjs → Bnot0Gwc.mjs} +12 -4
- package/dist/es/chunk/{4eyJqDa9.mjs → BoGGHTrJ.mjs} +4 -2
- package/dist/es/chunk/C7Dgjpd1.mjs +242 -0
- package/dist/es/chunk/{D0LB3gF-.mjs → CKbkzlkO.mjs} +104 -72
- package/dist/es/chunk/{DrgvuOYH.mjs → CL5WTCB3.mjs} +4 -2
- package/dist/es/chunk/{XwSiBVsA.mjs → CM_I1FoA.mjs} +2 -2
- package/dist/es/chunk/{DouIsSPi.mjs → CNILa-hz.mjs} +1 -1
- package/dist/es/chunk/{DRoyW749.mjs → CcKUdl3e.mjs} +12 -6
- package/dist/es/chunk/CidLkmft.mjs +188 -0
- package/dist/es/chunk/{HAog8AWU.mjs → CitH0taR.mjs} +816 -539
- package/dist/es/chunk/{Cu6erWl4.mjs → CzqeSQn4.mjs} +73 -38
- package/dist/es/chunk/{CLCfXfvv.mjs → D7JQbDFE.mjs} +154 -118
- package/dist/es/chunk/{DaCDeO95.mjs → D9iEroQw.mjs} +1 -207
- package/dist/es/chunk/{cPBw23yt.mjs → DEPZhJ0Z.mjs} +21 -16
- package/dist/es/chunk/{CPERtDRX.mjs → DHpbQMGk.mjs} +32 -22
- package/dist/es/chunk/{BHsNc7jl.mjs → DKpRXDRE.mjs} +82 -55
- package/dist/es/chunk/{CLMc8GzD.mjs → DMYHOxhk.mjs} +462 -311
- package/dist/es/chunk/{CBSopeeE.mjs → DQHGjqG5.mjs} +9 -4
- package/dist/es/chunk/DTEM_vYZ.mjs +23 -0
- package/dist/es/chunk/{NQBKROII.mjs → DWcIzeMM.mjs} +1 -1
- package/dist/es/chunk/{FHvLvzEB.mjs → DX38FfmL.mjs} +1088 -697
- package/dist/es/chunk/{DZD-YnCt.mjs → Dcm-lOj8.mjs} +4 -4
- package/dist/es/chunk/{09Ec85_u.mjs → DdmNdV7I.mjs} +398 -278
- package/dist/es/chunk/{f0-vIQGp.mjs → DfHTA5LW.mjs} +3 -3
- package/dist/es/chunk/DgFT6snA.mjs +835 -0
- package/dist/es/chunk/{DwKWIlzw.mjs → DgSzI6Fw.mjs} +106 -71
- package/dist/es/chunk/{BcTuAX8r.mjs → Dsye5ZEp.mjs} +5 -3
- package/dist/es/chunk/{BsLJxiSC.mjs → Dw-yyl2m.mjs} +1 -1
- package/dist/es/chunk/{DXPWe_a5.mjs → U13Qpiki.mjs} +19 -13
- package/dist/es/chunk/{axpwSky6.mjs → _8u_XVHh.mjs} +168 -120
- package/dist/es/chunk/egk9EEzo.mjs +66 -0
- package/dist/es/chunk/{BUEEWLrd.mjs → ezK_XQQd.mjs} +15 -6
- package/dist/es/chunk/{Bl2KlMdP.mjs → oW98L-44.mjs} +8 -3
- package/dist/es/chunk/{Dk6Bx0KT.mjs → plK2vnjp.mjs} +8 -5
- package/dist/es/components/awesome-icon/awesome-icon.mjs +2 -1
- package/dist/es/components/backbottom/backbottom.mjs +2 -2
- package/dist/es/components/button/button.mjs +105 -76
- package/dist/es/components/choice/choice.mjs +2 -2
- package/dist/es/components/config-provider/config-provider.d.ts +1 -0
- package/dist/es/components/config-provider/config-provider.mjs +13 -5
- package/dist/es/components/cropper/cropper.mjs +44 -33
- package/dist/es/components/currency/currency.mjs +5 -5
- package/dist/es/components/daterange-picker/daterange-picker.mjs +2267 -1522
- package/dist/es/components/dialog/dialog.mjs +213 -172
- package/dist/es/components/dialog/index.css +1 -1
- package/dist/es/components/dialog-camera-upload/dialog-camera-upload.mjs +11 -11
- package/dist/es/components/dialog-map-point/dialog-map-point.mjs +5 -4
- package/dist/es/components/dialog-upload-images/dialog-upload-images.mjs +495 -314
- package/dist/es/components/dialog-upload-images/index.css +1 -1
- package/dist/es/components/drag-verify/drag-verify.mjs +3 -3
- package/dist/es/components/drawer/drawer.mjs +136 -94
- package/dist/es/components/drawer/index.css +1 -1
- package/dist/es/components/easy-pagination/easy-pagination.mjs +2 -2
- package/dist/es/components/el-icon/el-icon.mjs +1 -1
- package/dist/es/components/el-icon/index.css +3 -2
- package/dist/es/components/flag/flag.mjs +2 -1
- package/dist/es/components/icon/icon.mjs +10 -31
- package/dist/es/components/icon/icon.vue.d.ts +1 -1
- package/dist/es/components/icon/icon2.mjs +1 -1
- package/dist/es/components/icon/index.mjs +2 -2
- package/dist/es/components/icon-picker/components/collections.vue.d.ts +625 -0
- package/dist/es/components/icon-picker/components/panel.vue.d.ts +9 -0
- package/dist/es/components/icon-picker/icon-picker.d.ts +40 -0
- package/dist/es/components/icon-picker/icon-picker.mjs +1375 -0
- package/dist/es/components/icon-picker/icon-picker.vue.d.ts +9 -0
- package/dist/es/components/icon-picker/index.css +121 -0
- package/dist/es/components/icon-picker/index.d.ts +4 -0
- package/dist/es/components/icon-picker/index.mjs +6 -0
- package/dist/es/components/iconify-icon/iconify-icon.d.ts +5 -0
- package/dist/es/components/iconify-icon/iconify-icon.mjs +1860 -0
- package/dist/es/components/iconify-icon/iconify-icon.vue.d.ts +6 -0
- package/dist/es/components/iconify-icon/index.css +11 -0
- package/dist/es/components/iconify-icon/index.d.ts +4 -0
- package/dist/es/components/iconify-icon/index.mjs +6 -0
- package/dist/es/components/image/image.mjs +5 -5
- package/dist/es/components/input/input.mjs +4 -4
- package/dist/es/components/input/input.vue.d.ts +63 -54
- package/dist/es/components/input-number/input-number.mjs +5 -5
- package/dist/es/components/pca-picker/components/c.vue.d.ts +4 -4
- package/dist/es/components/pca-picker/index.css +1 -1
- package/dist/es/components/pca-picker/pca-picker.mjs +154 -160
- package/dist/es/components/pca-picker/pca-picker.vue.d.ts +12 -11
- package/dist/es/components/qr-code/qr-code.mjs +2 -1
- package/dist/es/components/screenfull/screenfull.mjs +6 -5
- package/dist/es/components/scrollbar/index.css +18 -0
- package/dist/es/components/scrollbar/index.d.ts +4 -0
- package/dist/es/components/scrollbar/index.mjs +6 -0
- package/dist/es/components/scrollbar/scrollbar.d.ts +4 -0
- package/dist/es/components/scrollbar/scrollbar.mjs +65 -0
- package/dist/es/components/scrollbar/scrollbar.vue.d.ts +588 -0
- package/dist/es/components/select/select.mjs +7 -7
- package/dist/es/components/single-player/index.css +1 -1
- package/dist/es/components/single-player/single-player.mjs +265 -166
- package/dist/es/components/svg-icon/index.css +3 -2
- package/dist/es/components/svg-icon/svg-icon.mjs +3 -3
- package/dist/es/components/switch/switch.mjs +2 -2
- package/dist/es/components/sync-scroll-container/sync-scroll-container.mjs +2 -2
- package/dist/es/components/tags/tags.mjs +9 -9
- package/dist/es/components/text-ellipsis/text-ellipsis.mjs +4 -4
- package/dist/es/components/thousand-input/thousand-input.mjs +5 -4
- package/dist/es/components/thousand-input/thousand-input.vue.d.ts +126 -108
- package/dist/es/components/tinymce/index.css +1 -1
- package/dist/es/components/tinymce/tinymce.mjs +9 -8
- package/dist/es/components/tree-picker/components/popover-cascader.vue.d.ts +179 -141
- package/dist/es/components/tree-picker/popover-cascader.css +1 -1
- package/dist/es/components/tree-picker/tree-picker.mjs +10 -10
- package/dist/es/components/tree-picker/tree-picker.vue.d.ts +12 -11
- package/dist/es/components/upload-file/upload-file.mjs +3 -3
- package/dist/es/index.d.ts +3 -0
- package/dist/es/index.mjs +41 -31
- package/dist/global.d.ts +3 -0
- package/dist/index.css +166 -22
- package/package.json +8 -2
- package/dist/es/chunk/BtTIs3tG.mjs +0 -138
- package/dist/es/chunk/C7wQNvSS.mjs +0 -728
- package/dist/es/chunk/Cbhe4I9Z.mjs +0 -16
- package/dist/es/chunk/DihosKp1.mjs +0 -140
- package/dist/es/components/icon/index.css +0 -9
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent, computed, h, renderSlot, ref, watchEffect, createVNode, createTextVNode, isVNode, Comment } from 'vue';
|
|
2
|
-
import { c as buildProps, u as useNamespace, i as isArray, f as isNumber, h as isString, d as definePropType } from './
|
|
3
|
-
import { P as PatchFlags, i as isFragment, a as isValidElementNode } from './
|
|
4
|
-
import { c as componentSizes } from './
|
|
5
|
-
import { w as withInstall } from './
|
|
2
|
+
import { c as buildProps, u as useNamespace, i as isArray, f as isNumber, h as isString, d as definePropType } from './CcKUdl3e.mjs';
|
|
3
|
+
import { P as PatchFlags, i as isFragment, a as isValidElementNode } from './BYVaz5Or.mjs';
|
|
4
|
+
import { c as componentSizes } from './BK4T_2ha.mjs';
|
|
5
|
+
import { w as withInstall } from './BTsEMnf_.mjs';
|
|
6
6
|
|
|
7
7
|
const spaceItemProps = buildProps({
|
|
8
8
|
prefixCls: {
|
|
@@ -132,30 +132,50 @@ const Space = defineComponent({
|
|
|
132
132
|
if (isArray(child.children)) {
|
|
133
133
|
child.children.forEach((nested, key) => {
|
|
134
134
|
if (isFragment(nested) && isArray(nested.children)) {
|
|
135
|
-
extractChildren(
|
|
135
|
+
extractChildren(
|
|
136
|
+
nested.children,
|
|
137
|
+
`${parentKey + key}-`,
|
|
138
|
+
extractedChildren
|
|
139
|
+
);
|
|
136
140
|
} else {
|
|
137
141
|
if (isVNode(nested) && (nested == null ? void 0 : nested.type) === Comment) {
|
|
138
142
|
extractedChildren.push(nested);
|
|
139
143
|
} else {
|
|
140
|
-
extractedChildren.push(
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
extractedChildren.push(
|
|
145
|
+
createVNode(
|
|
146
|
+
SpaceItem,
|
|
147
|
+
{
|
|
148
|
+
style: itemStyle.value,
|
|
149
|
+
prefixCls,
|
|
150
|
+
key: `nested-${parentKey + key}`
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
default: () => [nested]
|
|
154
|
+
},
|
|
155
|
+
PatchFlags.PROPS | PatchFlags.STYLE,
|
|
156
|
+
["style", "prefixCls"]
|
|
157
|
+
)
|
|
158
|
+
);
|
|
147
159
|
}
|
|
148
160
|
}
|
|
149
161
|
});
|
|
150
162
|
}
|
|
151
163
|
} else if (isValidElementNode(child)) {
|
|
152
|
-
extractedChildren.push(
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
164
|
+
extractedChildren.push(
|
|
165
|
+
createVNode(
|
|
166
|
+
SpaceItem,
|
|
167
|
+
{
|
|
168
|
+
style: itemStyle.value,
|
|
169
|
+
prefixCls,
|
|
170
|
+
key: `LoopKey${parentKey + loopKey}`
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
default: () => [child]
|
|
174
|
+
},
|
|
175
|
+
PatchFlags.PROPS | PatchFlags.STYLE,
|
|
176
|
+
["style", "prefixCls"]
|
|
177
|
+
)
|
|
178
|
+
);
|
|
159
179
|
}
|
|
160
180
|
});
|
|
161
181
|
return extractedChildren;
|
|
@@ -170,26 +190,41 @@ const Space = defineComponent({
|
|
|
170
190
|
let extractedChildren = extractChildren(children.children);
|
|
171
191
|
if (spacer) {
|
|
172
192
|
const len = extractedChildren.length - 1;
|
|
173
|
-
extractedChildren = extractedChildren.reduce(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
193
|
+
extractedChildren = extractedChildren.reduce(
|
|
194
|
+
(acc, child, idx) => {
|
|
195
|
+
const children2 = [...acc, child];
|
|
196
|
+
if (idx !== len) {
|
|
197
|
+
children2.push(
|
|
198
|
+
createVNode(
|
|
199
|
+
"span",
|
|
200
|
+
{
|
|
201
|
+
style: [
|
|
202
|
+
itemStyle.value,
|
|
203
|
+
direction === "vertical" ? "width: 100%" : null
|
|
204
|
+
],
|
|
205
|
+
key: idx
|
|
206
|
+
},
|
|
207
|
+
[
|
|
208
|
+
isVNode(spacer) ? spacer : createTextVNode(spacer, PatchFlags.TEXT)
|
|
209
|
+
],
|
|
210
|
+
PatchFlags.STYLE
|
|
211
|
+
)
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
return children2;
|
|
215
|
+
},
|
|
216
|
+
[]
|
|
217
|
+
);
|
|
188
218
|
}
|
|
189
|
-
return createVNode(
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
219
|
+
return createVNode(
|
|
220
|
+
"div",
|
|
221
|
+
{
|
|
222
|
+
class: classes.value,
|
|
223
|
+
style: containerStyle.value
|
|
224
|
+
},
|
|
225
|
+
extractedChildren,
|
|
226
|
+
PatchFlags.STYLE | PatchFlags.CLASS
|
|
227
|
+
);
|
|
193
228
|
}
|
|
194
229
|
return children.children;
|
|
195
230
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { defineComponent, ref, reactive, computed, watch, onMounted, onUpdated, createElementBlock, openBlock, withModifiers, normalizeClass, unref, withDirectives, createCommentVNode, createVNode, withKeys, renderSlot, withCtx, createBlock, createSlots } from 'vue';
|
|
2
|
-
import { E as ElInput } from './
|
|
3
|
-
import { E as ElIcon } from './
|
|
2
|
+
import { E as ElInput } from './DgFT6snA.mjs';
|
|
3
|
+
import { E as ElIcon } from './DEPZhJ0Z.mjs';
|
|
4
4
|
import { ArrowDown, Minus, ArrowUp, Plus } from '@element-plus/icons-vue';
|
|
5
|
-
import { f as isNumber, k as isNil, c as buildProps, d as definePropType, u as useNamespace, g as isUndefined, e as debugWarn, t as throwError, h as isString } from './
|
|
6
|
-
import { u as useSizeProp } from './
|
|
7
|
-
import { u as useAriaProps } from './
|
|
5
|
+
import { f as isNumber, k as isNil, c as buildProps, d as definePropType, u as useNamespace, g as isUndefined, e as debugWarn, t as throwError, h as isString } from './CcKUdl3e.mjs';
|
|
6
|
+
import { u as useSizeProp } from './BK4T_2ha.mjs';
|
|
7
|
+
import { u as useAriaProps } from './BDyXj_90.mjs';
|
|
8
8
|
import { U as UPDATE_MODEL_EVENT, I as INPUT_EVENT, C as CHANGE_EVENT } from './Ct6q2FXg.mjs';
|
|
9
|
-
import { _ as _export_sfc, w as withInstall } from './
|
|
10
|
-
import { v as vRepeatClick } from './
|
|
9
|
+
import { _ as _export_sfc, w as withInstall } from './BTsEMnf_.mjs';
|
|
10
|
+
import { v as vRepeatClick } from './BoGGHTrJ.mjs';
|
|
11
11
|
import { g as getEventCode, a as getEventKey, E as EVENT_CODE } from './BTpNRPQW.mjs';
|
|
12
|
-
import { u as useLocale } from './
|
|
13
|
-
import { u as useFormItem, c as useFormSize, b as useFormDisabled } from './
|
|
12
|
+
import { u as useLocale } from './plK2vnjp.mjs';
|
|
13
|
+
import { u as useFormItem, c as useFormSize, b as useFormDisabled } from './U13Qpiki.mjs';
|
|
14
14
|
|
|
15
15
|
const inputNumberProps = buildProps({
|
|
16
16
|
id: {
|
|
@@ -49,7 +49,7 @@ const inputNumberProps = buildProps({
|
|
|
49
49
|
values: ["", "right"]
|
|
50
50
|
},
|
|
51
51
|
valueOnClear: {
|
|
52
|
-
type: [String, Number, null],
|
|
52
|
+
type: definePropType([String, Number, null]),
|
|
53
53
|
validator: (val) => val === null || isNumber(val) || ["min", "max"].includes(val),
|
|
54
54
|
default: null
|
|
55
55
|
},
|
|
@@ -82,15 +82,18 @@ const inputNumberEmits = {
|
|
|
82
82
|
[UPDATE_MODEL_EVENT]: (val) => isNumber(val) || isNil(val)
|
|
83
83
|
};
|
|
84
84
|
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
const _hoisted_1 = ["aria-label"];
|
|
86
|
+
const _hoisted_2 = ["aria-label"];
|
|
87
|
+
const _sfc_main = defineComponent({
|
|
88
|
+
...{
|
|
89
|
+
name: "ElInputNumber"
|
|
90
|
+
},
|
|
91
|
+
__name: "input-number",
|
|
90
92
|
props: inputNumberProps,
|
|
91
93
|
emits: inputNumberEmits,
|
|
92
|
-
setup(__props, { expose, emit }) {
|
|
94
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
93
95
|
const props = __props;
|
|
96
|
+
const emit = __emit;
|
|
94
97
|
const { t } = useLocale();
|
|
95
98
|
const ns = useNamespace("input-number");
|
|
96
99
|
const input = ref();
|
|
@@ -99,13 +102,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
99
102
|
userInput: null
|
|
100
103
|
});
|
|
101
104
|
const { formItem } = useFormItem();
|
|
102
|
-
const minDisabled = computed(
|
|
103
|
-
|
|
105
|
+
const minDisabled = computed(
|
|
106
|
+
() => isNumber(props.modelValue) && props.modelValue <= props.min
|
|
107
|
+
);
|
|
108
|
+
const maxDisabled = computed(
|
|
109
|
+
() => isNumber(props.modelValue) && props.modelValue >= props.max
|
|
110
|
+
);
|
|
104
111
|
const numPrecision = computed(() => {
|
|
105
112
|
const stepPrecision = getPrecision(props.step);
|
|
106
113
|
if (!isUndefined(props.precision)) {
|
|
107
114
|
if (stepPrecision > props.precision) {
|
|
108
|
-
debugWarn(
|
|
115
|
+
debugWarn(
|
|
116
|
+
"InputNumber",
|
|
117
|
+
"precision should not be less than the decimal places of step"
|
|
118
|
+
);
|
|
109
119
|
}
|
|
110
120
|
return props.precision;
|
|
111
121
|
} else {
|
|
@@ -167,10 +177,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
167
177
|
if (!isNumber(val))
|
|
168
178
|
return data.currentValue;
|
|
169
179
|
if (val >= Number.MAX_SAFE_INTEGER && coefficient === 1) {
|
|
170
|
-
debugWarn(
|
|
180
|
+
debugWarn(
|
|
181
|
+
"InputNumber",
|
|
182
|
+
"The value has reached the maximum safe integer limit."
|
|
183
|
+
);
|
|
171
184
|
return val;
|
|
172
185
|
} else if (val <= Number.MIN_SAFE_INTEGER && coefficient === -1) {
|
|
173
|
-
debugWarn(
|
|
186
|
+
debugWarn(
|
|
187
|
+
"InputNumber",
|
|
188
|
+
"The value has reached the minimum safe integer limit."
|
|
189
|
+
);
|
|
174
190
|
return val;
|
|
175
191
|
}
|
|
176
192
|
return toPrecision(val + props.step * coefficient);
|
|
@@ -229,7 +245,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
229
245
|
newVal = isString(valueOnClear) ? { min, max }[valueOnClear] : valueOnClear;
|
|
230
246
|
}
|
|
231
247
|
if (stepStrictly) {
|
|
232
|
-
newVal = toPrecision(
|
|
248
|
+
newVal = toPrecision(
|
|
249
|
+
Math.round(toPrecision(newVal / step)) * step,
|
|
250
|
+
precision
|
|
251
|
+
);
|
|
233
252
|
if (newVal !== value) {
|
|
234
253
|
update && emit(UPDATE_MODEL_EVENT, newVal);
|
|
235
254
|
}
|
|
@@ -308,15 +327,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
308
327
|
if (document.activeElement === e.target)
|
|
309
328
|
e.preventDefault();
|
|
310
329
|
};
|
|
311
|
-
watch(
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
330
|
+
watch(
|
|
331
|
+
() => props.modelValue,
|
|
332
|
+
(value, oldValue) => {
|
|
333
|
+
const newValue = verifyValue(value, true);
|
|
334
|
+
if (data.userInput === null && newValue !== oldValue) {
|
|
335
|
+
data.currentValue = newValue;
|
|
336
|
+
}
|
|
337
|
+
},
|
|
338
|
+
{ immediate: true }
|
|
339
|
+
);
|
|
340
|
+
watch(
|
|
341
|
+
() => props.precision,
|
|
342
|
+
() => {
|
|
343
|
+
data.currentValue = verifyValue(props.modelValue);
|
|
315
344
|
}
|
|
316
|
-
|
|
317
|
-
watch(() => props.precision, () => {
|
|
318
|
-
data.currentValue = verifyValue(props.modelValue);
|
|
319
|
-
});
|
|
345
|
+
);
|
|
320
346
|
onMounted(() => {
|
|
321
347
|
var _a;
|
|
322
348
|
const { min, max, modelValue } = props;
|
|
@@ -332,7 +358,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
332
358
|
} else {
|
|
333
359
|
innerInput.removeAttribute("aria-valuemin");
|
|
334
360
|
}
|
|
335
|
-
innerInput.setAttribute(
|
|
361
|
+
innerInput.setAttribute(
|
|
362
|
+
"aria-valuenow",
|
|
363
|
+
data.currentValue || data.currentValue === 0 ? String(data.currentValue) : ""
|
|
364
|
+
);
|
|
336
365
|
innerInput.setAttribute("aria-disabled", String(inputNumberDisabled.value));
|
|
337
366
|
if (!isNumber(modelValue) && modelValue != null) {
|
|
338
367
|
let val = Number(modelValue);
|
|
@@ -348,102 +377,109 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
348
377
|
const innerInput = (_a = input.value) == null ? void 0 : _a.input;
|
|
349
378
|
innerInput == null ? void 0 : innerInput.setAttribute("aria-valuenow", `${(_b = data.currentValue) != null ? _b : ""}`);
|
|
350
379
|
});
|
|
351
|
-
|
|
380
|
+
__expose({
|
|
352
381
|
focus,
|
|
353
382
|
blur
|
|
354
383
|
});
|
|
355
384
|
return (_ctx, _cache) => {
|
|
356
|
-
return openBlock(), createElementBlock(
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
]) : createCommentVNode("v-if", true),
|
|
386
|
-
_ctx.controls ? withDirectives((openBlock(), createElementBlock("span", {
|
|
387
|
-
key: 1,
|
|
388
|
-
role: "button",
|
|
389
|
-
"aria-label": unref(t)("el.inputNumber.increase"),
|
|
390
|
-
class: normalizeClass([unref(ns).e("increase"), unref(ns).is("disabled", unref(maxDisabled))]),
|
|
391
|
-
onKeydown: withKeys(increase, ["enter"])
|
|
392
|
-
}, [
|
|
393
|
-
renderSlot(_ctx.$slots, "increase-icon", {}, () => [
|
|
394
|
-
createVNode(unref(ElIcon), null, {
|
|
395
|
-
default: withCtx(() => [
|
|
396
|
-
unref(controlsAtRight) ? (openBlock(), createBlock(unref(ArrowUp), { key: 0 })) : (openBlock(), createBlock(unref(Plus), { key: 1 }))
|
|
397
|
-
]),
|
|
398
|
-
_: 1
|
|
399
|
-
})
|
|
400
|
-
])
|
|
401
|
-
], 42, ["aria-label", "onKeydown"])), [
|
|
402
|
-
[unref(vRepeatClick), increase]
|
|
403
|
-
]) : createCommentVNode("v-if", true),
|
|
404
|
-
createVNode(unref(ElInput), {
|
|
405
|
-
id: _ctx.id,
|
|
406
|
-
ref_key: "input",
|
|
407
|
-
ref: input,
|
|
408
|
-
type: "number",
|
|
409
|
-
step: _ctx.step,
|
|
410
|
-
"model-value": unref(displayValue),
|
|
411
|
-
placeholder: _ctx.placeholder,
|
|
412
|
-
readonly: _ctx.readonly,
|
|
413
|
-
disabled: unref(inputNumberDisabled),
|
|
414
|
-
size: unref(inputNumberSize),
|
|
415
|
-
max: _ctx.max,
|
|
416
|
-
min: _ctx.min,
|
|
417
|
-
name: _ctx.name,
|
|
418
|
-
"aria-label": _ctx.ariaLabel,
|
|
419
|
-
"validate-event": false,
|
|
420
|
-
inputmode: _ctx.inputmode,
|
|
421
|
-
onKeydown: handleKeydown,
|
|
422
|
-
onBlur: handleBlur,
|
|
423
|
-
onFocus: handleFocus,
|
|
424
|
-
onInput: handleInput,
|
|
425
|
-
onChange: handleInputChange
|
|
426
|
-
}, createSlots({
|
|
427
|
-
_: 2
|
|
428
|
-
}, [
|
|
429
|
-
_ctx.$slots.prefix ? {
|
|
430
|
-
name: "prefix",
|
|
431
|
-
fn: withCtx(() => [
|
|
432
|
-
renderSlot(_ctx.$slots, "prefix")
|
|
385
|
+
return openBlock(), createElementBlock(
|
|
386
|
+
"div",
|
|
387
|
+
{
|
|
388
|
+
class: normalizeClass([
|
|
389
|
+
unref(ns).b(),
|
|
390
|
+
unref(ns).m(unref(inputNumberSize)),
|
|
391
|
+
unref(ns).is("disabled", unref(inputNumberDisabled)),
|
|
392
|
+
unref(ns).is("without-controls", !_ctx.controls),
|
|
393
|
+
unref(ns).is("controls-right", controlsAtRight.value),
|
|
394
|
+
unref(ns).is(_ctx.align, !!_ctx.align)
|
|
395
|
+
]),
|
|
396
|
+
onDragstart: _cache[0] || (_cache[0] = withModifiers(() => {
|
|
397
|
+
}, ["prevent"]))
|
|
398
|
+
},
|
|
399
|
+
[
|
|
400
|
+
_ctx.controls ? withDirectives((openBlock(), createElementBlock("span", {
|
|
401
|
+
key: 0,
|
|
402
|
+
role: "button",
|
|
403
|
+
"aria-label": unref(t)("el.inputNumber.decrease"),
|
|
404
|
+
class: normalizeClass([unref(ns).e("decrease"), unref(ns).is("disabled", minDisabled.value)]),
|
|
405
|
+
onKeydown: withKeys(decrease, ["enter"])
|
|
406
|
+
}, [
|
|
407
|
+
renderSlot(_ctx.$slots, "decrease-icon", {}, () => [
|
|
408
|
+
createVNode(unref(ElIcon), null, {
|
|
409
|
+
default: withCtx(() => [
|
|
410
|
+
controlsAtRight.value ? (openBlock(), createBlock(unref(ArrowDown), { key: 0 })) : (openBlock(), createBlock(unref(Minus), { key: 1 }))
|
|
411
|
+
]),
|
|
412
|
+
_: 1
|
|
413
|
+
})
|
|
433
414
|
])
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
415
|
+
], 42, _hoisted_1)), [
|
|
416
|
+
[unref(vRepeatClick), decrease]
|
|
417
|
+
]) : createCommentVNode("v-if", true),
|
|
418
|
+
_ctx.controls ? withDirectives((openBlock(), createElementBlock("span", {
|
|
419
|
+
key: 1,
|
|
420
|
+
role: "button",
|
|
421
|
+
"aria-label": unref(t)("el.inputNumber.increase"),
|
|
422
|
+
class: normalizeClass([unref(ns).e("increase"), unref(ns).is("disabled", maxDisabled.value)]),
|
|
423
|
+
onKeydown: withKeys(increase, ["enter"])
|
|
424
|
+
}, [
|
|
425
|
+
renderSlot(_ctx.$slots, "increase-icon", {}, () => [
|
|
426
|
+
createVNode(unref(ElIcon), null, {
|
|
427
|
+
default: withCtx(() => [
|
|
428
|
+
controlsAtRight.value ? (openBlock(), createBlock(unref(ArrowUp), { key: 0 })) : (openBlock(), createBlock(unref(Plus), { key: 1 }))
|
|
429
|
+
]),
|
|
430
|
+
_: 1
|
|
431
|
+
})
|
|
439
432
|
])
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
433
|
+
], 42, _hoisted_2)), [
|
|
434
|
+
[unref(vRepeatClick), increase]
|
|
435
|
+
]) : createCommentVNode("v-if", true),
|
|
436
|
+
createVNode(unref(ElInput), {
|
|
437
|
+
id: _ctx.id,
|
|
438
|
+
ref_key: "input",
|
|
439
|
+
ref: input,
|
|
440
|
+
type: "number",
|
|
441
|
+
step: _ctx.step,
|
|
442
|
+
"model-value": displayValue.value,
|
|
443
|
+
placeholder: _ctx.placeholder,
|
|
444
|
+
readonly: _ctx.readonly,
|
|
445
|
+
disabled: unref(inputNumberDisabled),
|
|
446
|
+
size: unref(inputNumberSize),
|
|
447
|
+
max: _ctx.max,
|
|
448
|
+
min: _ctx.min,
|
|
449
|
+
name: _ctx.name,
|
|
450
|
+
"aria-label": _ctx.ariaLabel,
|
|
451
|
+
"validate-event": false,
|
|
452
|
+
inputmode: _ctx.inputmode,
|
|
453
|
+
onKeydown: handleKeydown,
|
|
454
|
+
onBlur: handleBlur,
|
|
455
|
+
onFocus: handleFocus,
|
|
456
|
+
onInput: handleInput,
|
|
457
|
+
onChange: handleInputChange
|
|
458
|
+
}, createSlots({
|
|
459
|
+
_: 2
|
|
460
|
+
}, [
|
|
461
|
+
_ctx.$slots.prefix ? {
|
|
462
|
+
name: "prefix",
|
|
463
|
+
fn: withCtx(() => [
|
|
464
|
+
renderSlot(_ctx.$slots, "prefix")
|
|
465
|
+
]),
|
|
466
|
+
key: "0"
|
|
467
|
+
} : void 0,
|
|
468
|
+
_ctx.$slots.suffix ? {
|
|
469
|
+
name: "suffix",
|
|
470
|
+
fn: withCtx(() => [
|
|
471
|
+
renderSlot(_ctx.$slots, "suffix")
|
|
472
|
+
]),
|
|
473
|
+
key: "1"
|
|
474
|
+
} : void 0
|
|
475
|
+
]), 1032, ["id", "step", "model-value", "placeholder", "readonly", "disabled", "size", "max", "min", "name", "aria-label", "inputmode"])
|
|
476
|
+
],
|
|
477
|
+
34
|
|
478
|
+
);
|
|
443
479
|
};
|
|
444
480
|
}
|
|
445
481
|
});
|
|
446
|
-
var InputNumber = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "input-number.vue"]]);
|
|
482
|
+
var InputNumber = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/input-number/src/input-number.vue"]]);
|
|
447
483
|
|
|
448
484
|
const ElInputNumber = withInstall(InputNumber);
|
|
449
485
|
|