@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,15 +1,15 @@
|
|
|
1
1
|
import { defineComponent, createVNode, h, renderSlot, getCurrentInstance, ref, computed, watch, nextTick, onMounted } from 'vue';
|
|
2
|
-
import { N as NOOP, c as buildProps, u as useNamespace, d as definePropType, q as isBoolean, x as defaultNamespace, p as isObject, e as debugWarn, i as isArray, j as isFunction } from './
|
|
3
|
-
import { P as PatchFlags } from './
|
|
2
|
+
import { N as NOOP, c as buildProps, u as useNamespace, d as definePropType, q as isBoolean, x as defaultNamespace, p as isObject, e as debugWarn, i as isArray, j as isFunction } from './CcKUdl3e.mjs';
|
|
3
|
+
import { P as PatchFlags } from './BYVaz5Or.mjs';
|
|
4
4
|
import { i as iconPropType } from '../components/icon/icon2.mjs';
|
|
5
|
-
import { t as teleportProps } from './
|
|
5
|
+
import { t as teleportProps } from './DMYHOxhk.mjs';
|
|
6
6
|
import { U as UPDATE_MODEL_EVENT } from './Ct6q2FXg.mjs';
|
|
7
7
|
import { useTimeoutFn, isClient } from '@vueuse/core';
|
|
8
|
-
import { u as useLockscreen } from './
|
|
9
|
-
import { u as useZIndex } from './
|
|
10
|
-
import { u as useId } from './
|
|
11
|
-
import { u as useGlobalConfig } from './
|
|
12
|
-
import { a as addUnit } from './
|
|
8
|
+
import { u as useLockscreen } from './Bnot0Gwc.mjs';
|
|
9
|
+
import { u as useZIndex } from './BI-fNJhk.mjs';
|
|
10
|
+
import { u as useId } from './DQHGjqG5.mjs';
|
|
11
|
+
import { u as useGlobalConfig } from './BUf50Y7Y.mjs';
|
|
12
|
+
import { a as addUnit } from './Bl0WQiki.mjs';
|
|
13
13
|
|
|
14
14
|
const useSameTarget = (handleClick) => {
|
|
15
15
|
if (!handleClick) {
|
|
@@ -62,27 +62,39 @@ var Overlay = defineComponent({
|
|
|
62
62
|
const onMaskClick = (e) => {
|
|
63
63
|
emit("click", e);
|
|
64
64
|
};
|
|
65
|
-
const { onClick, onMousedown, onMouseup } = useSameTarget(
|
|
65
|
+
const { onClick, onMousedown, onMouseup } = useSameTarget(
|
|
66
|
+
props.customMaskEvent ? void 0 : onMaskClick
|
|
67
|
+
);
|
|
66
68
|
return () => {
|
|
67
|
-
return props.mask ? createVNode(
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
69
|
+
return props.mask ? createVNode(
|
|
70
|
+
"div",
|
|
71
|
+
{
|
|
72
|
+
class: [ns.b(), props.overlayClass],
|
|
73
|
+
style: {
|
|
74
|
+
zIndex: props.zIndex
|
|
75
|
+
},
|
|
76
|
+
onClick,
|
|
77
|
+
onMousedown,
|
|
78
|
+
onMouseup
|
|
71
79
|
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
onMouseup
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
[renderSlot(slots, "default")],
|
|
81
|
+
PatchFlags.STYLE | PatchFlags.CLASS | PatchFlags.PROPS,
|
|
82
|
+
["onClick", "onMouseup", "onMousedown"]
|
|
83
|
+
) : h(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
class: props.overlayClass,
|
|
87
|
+
style: {
|
|
88
|
+
zIndex: props.zIndex,
|
|
89
|
+
position: "fixed",
|
|
90
|
+
top: "0px",
|
|
91
|
+
right: "0px",
|
|
92
|
+
bottom: "0px",
|
|
93
|
+
left: "0px"
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
[renderSlot(slots, "default")]
|
|
97
|
+
);
|
|
86
98
|
};
|
|
87
99
|
}
|
|
88
100
|
});
|
|
@@ -213,6 +225,7 @@ const useDialog = (props, targetRef) => {
|
|
|
213
225
|
const closed = ref(false);
|
|
214
226
|
const rendered = ref(false);
|
|
215
227
|
const zIndex = ref((_a = props.zIndex) != null ? _a : nextZIndex());
|
|
228
|
+
const closing = ref(false);
|
|
216
229
|
let openTimer = void 0;
|
|
217
230
|
let closeTimer = void 0;
|
|
218
231
|
const config = useGlobalConfig();
|
|
@@ -238,18 +251,24 @@ const useDialog = (props, targetRef) => {
|
|
|
238
251
|
}
|
|
239
252
|
return style2;
|
|
240
253
|
});
|
|
241
|
-
const _draggable = computed(
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
254
|
+
const _draggable = computed(
|
|
255
|
+
() => {
|
|
256
|
+
var _a2, _b, _c;
|
|
257
|
+
return ((_c = (_b = props.draggable) != null ? _b : (_a2 = globalConfig.value) == null ? void 0 : _a2.draggable) != null ? _c : false) && !props.fullscreen;
|
|
258
|
+
}
|
|
259
|
+
);
|
|
260
|
+
const _alignCenter = computed(
|
|
261
|
+
() => {
|
|
262
|
+
var _a2, _b, _c;
|
|
263
|
+
return (_c = (_b = props.alignCenter) != null ? _b : (_a2 = globalConfig.value) == null ? void 0 : _a2.alignCenter) != null ? _c : false;
|
|
264
|
+
}
|
|
265
|
+
);
|
|
266
|
+
const _overflow = computed(
|
|
267
|
+
() => {
|
|
268
|
+
var _a2, _b, _c;
|
|
269
|
+
return (_c = (_b = props.overflow) != null ? _b : (_a2 = globalConfig.value) == null ? void 0 : _a2.overflow) != null ? _c : false;
|
|
270
|
+
}
|
|
271
|
+
);
|
|
253
272
|
const overlayDialogStyle = computed(() => {
|
|
254
273
|
if (_alignCenter.value) {
|
|
255
274
|
return { display: "flex" };
|
|
@@ -285,7 +304,10 @@ const useDialog = (props, targetRef) => {
|
|
|
285
304
|
config2.onAfterLeave = _mergeHook(config2.onAfterLeave, afterLeave);
|
|
286
305
|
if (!config2.name) {
|
|
287
306
|
config2.name = DEFAULT_DIALOG_TRANSITION;
|
|
288
|
-
debugWarn(
|
|
307
|
+
debugWarn(
|
|
308
|
+
COMPONENT_NAME,
|
|
309
|
+
`transition.name is missing when using object syntax, fallback to '${DEFAULT_DIALOG_TRANSITION}'`
|
|
310
|
+
);
|
|
289
311
|
}
|
|
290
312
|
return config2;
|
|
291
313
|
}
|
|
@@ -300,8 +322,10 @@ const useDialog = (props, targetRef) => {
|
|
|
300
322
|
if (props.destroyOnClose) {
|
|
301
323
|
rendered.value = false;
|
|
302
324
|
}
|
|
325
|
+
closing.value = false;
|
|
303
326
|
}
|
|
304
327
|
function beforeLeave() {
|
|
328
|
+
closing.value = true;
|
|
305
329
|
emit("close");
|
|
306
330
|
}
|
|
307
331
|
function open() {
|
|
@@ -368,41 +392,51 @@ const useDialog = (props, targetRef) => {
|
|
|
368
392
|
handleClose();
|
|
369
393
|
}
|
|
370
394
|
}
|
|
371
|
-
watch(
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
watch(() => props.modelValue, (val) => {
|
|
376
|
-
var _a2;
|
|
377
|
-
if (val) {
|
|
378
|
-
closed.value = false;
|
|
379
|
-
open();
|
|
380
|
-
rendered.value = true;
|
|
395
|
+
watch(
|
|
396
|
+
() => props.zIndex,
|
|
397
|
+
() => {
|
|
398
|
+
var _a2;
|
|
381
399
|
zIndex.value = (_a2 = props.zIndex) != null ? _a2 : nextZIndex();
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
400
|
+
}
|
|
401
|
+
);
|
|
402
|
+
watch(
|
|
403
|
+
() => props.modelValue,
|
|
404
|
+
(val) => {
|
|
405
|
+
var _a2;
|
|
406
|
+
if (val) {
|
|
407
|
+
closed.value = false;
|
|
408
|
+
closing.value = false;
|
|
409
|
+
open();
|
|
410
|
+
rendered.value = true;
|
|
411
|
+
zIndex.value = (_a2 = props.zIndex) != null ? _a2 : nextZIndex();
|
|
412
|
+
nextTick(() => {
|
|
413
|
+
emit("open");
|
|
414
|
+
if (targetRef.value) {
|
|
415
|
+
targetRef.value.parentElement.scrollTop = 0;
|
|
416
|
+
targetRef.value.parentElement.scrollLeft = 0;
|
|
417
|
+
targetRef.value.scrollTop = 0;
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
} else {
|
|
421
|
+
if (visible.value) {
|
|
422
|
+
close();
|
|
388
423
|
}
|
|
389
|
-
});
|
|
390
|
-
} else {
|
|
391
|
-
if (visible.value) {
|
|
392
|
-
close();
|
|
393
424
|
}
|
|
394
425
|
}
|
|
395
|
-
|
|
396
|
-
watch(
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
426
|
+
);
|
|
427
|
+
watch(
|
|
428
|
+
() => props.fullscreen,
|
|
429
|
+
(val) => {
|
|
430
|
+
if (!targetRef.value)
|
|
431
|
+
return;
|
|
432
|
+
if (val) {
|
|
433
|
+
lastPosition = targetRef.value.style.transform;
|
|
434
|
+
targetRef.value.style.transform = "";
|
|
435
|
+
} else {
|
|
436
|
+
targetRef.value.style.transform = lastPosition;
|
|
437
|
+
}
|
|
404
438
|
}
|
|
405
|
-
|
|
439
|
+
);
|
|
406
440
|
onMounted(() => {
|
|
407
441
|
if (props.modelValue) {
|
|
408
442
|
visible.value = true;
|
|
@@ -433,7 +467,8 @@ const useDialog = (props, targetRef) => {
|
|
|
433
467
|
transitionConfig,
|
|
434
468
|
_draggable,
|
|
435
469
|
_alignCenter,
|
|
436
|
-
_overflow
|
|
470
|
+
_overflow,
|
|
471
|
+
closing
|
|
437
472
|
};
|
|
438
473
|
};
|
|
439
474
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getCurrentInstance, inject, ref, computed } from 'vue';
|
|
2
|
-
import { c as buildProps, d as definePropType, j as isFunction, i as isArray, e as debugWarn } from './
|
|
3
|
-
import { i as isEqual } from './
|
|
2
|
+
import { c as buildProps, d as definePropType, j as isFunction, i as isArray, e as debugWarn } from './CcKUdl3e.mjs';
|
|
3
|
+
import { i as isEqual } from './Dw-yyl2m.mjs';
|
|
4
4
|
|
|
5
5
|
const emptyValuesContextKey = Symbol("emptyValuesContextKey");
|
|
6
6
|
const SCOPE = "use-empty-values";
|
|
@@ -27,7 +27,9 @@ const useEmptyValuesProps = buildProps({
|
|
|
27
27
|
});
|
|
28
28
|
const useEmptyValues = (props, defaultValue) => {
|
|
29
29
|
const config = getCurrentInstance() ? inject(emptyValuesContextKey, ref({})) : ref({});
|
|
30
|
-
const emptyValues = computed(
|
|
30
|
+
const emptyValues = computed(
|
|
31
|
+
() => props.emptyValues || config.value.emptyValues || DEFAULT_EMPTY_VALUES
|
|
32
|
+
);
|
|
31
33
|
const valueOnClear = computed(() => {
|
|
32
34
|
if (isFunction(props.valueOnClear)) {
|
|
33
35
|
return props.valueOnClear();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as getNative, r as root, h as isLength, j as isFunction, e as isObjectLike, f as baseGetTag, k as freeGlobal, l as isArguments, m as isIndex, b as isArray, L as ListCache, M as Map, n as MapCache, o as arrayPush, p as toSource, S as Symbol$1, q as eq } from './DWcIzeMM.mjs';
|
|
2
2
|
|
|
3
3
|
/* Built-in method references that are verified to be native. */
|
|
4
4
|
var WeakMap = getNative(root, 'WeakMap');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { inject, ref, getCurrentInstance, computed, onMounted, watch, toRef, onUnmounted, unref } from 'vue';
|
|
2
|
-
import { b as formContextKey, f as formItemContextKey, u as useId } from './
|
|
3
|
-
import { a as useGlobalSize } from './
|
|
2
|
+
import { b as formContextKey, f as formItemContextKey, u as useId } from './DQHGjqG5.mjs';
|
|
3
|
+
import { a as useGlobalSize } from './BK4T_2ha.mjs';
|
|
4
4
|
|
|
5
5
|
const useFormItem = () => {
|
|
6
6
|
const form = inject(formContextKey, void 0);
|
|
@@ -42,18 +42,22 @@ const useFormItemInputId = (props, {
|
|
|
42
42
|
return !!(!(props.label || props.ariaLabel) && formItemContext && formItemContext.inputIds && ((_a = formItemContext.inputIds) == null ? void 0 : _a.length) <= 1);
|
|
43
43
|
});
|
|
44
44
|
onMounted(() => {
|
|
45
|
-
idUnwatch = watch(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (
|
|
51
|
-
formItemContext.
|
|
45
|
+
idUnwatch = watch(
|
|
46
|
+
[toRef(props, "id"), disableIdGeneration],
|
|
47
|
+
([id, disableIdGeneration2]) => {
|
|
48
|
+
const newId = id != null ? id : !disableIdGeneration2 ? useId().value : void 0;
|
|
49
|
+
if (newId !== inputId.value) {
|
|
50
|
+
if ((formItemContext == null ? void 0 : formItemContext.removeInputId) && !inLabel()) {
|
|
51
|
+
inputId.value && formItemContext.removeInputId(inputId.value);
|
|
52
|
+
if (!(disableIdManagement == null ? void 0 : disableIdManagement.value) && !disableIdGeneration2 && newId) {
|
|
53
|
+
formItemContext.addInputId(newId);
|
|
54
|
+
}
|
|
52
55
|
}
|
|
56
|
+
inputId.value = newId;
|
|
53
57
|
}
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
58
|
+
},
|
|
59
|
+
{ immediate: true }
|
|
60
|
+
);
|
|
57
61
|
});
|
|
58
62
|
onUnmounted(() => {
|
|
59
63
|
idUnwatch && idUnwatch();
|
|
@@ -81,7 +85,9 @@ const useFormSize = (fallback, ignore = {}) => {
|
|
|
81
85
|
const globalConfig = ignore.global ? emptyRef : useGlobalSize();
|
|
82
86
|
const form = ignore.form ? { size: void 0 } : inject(formContextKey, void 0);
|
|
83
87
|
const formItem = ignore.formItem ? { size: void 0 } : inject(formItemContextKey, void 0);
|
|
84
|
-
return computed(
|
|
88
|
+
return computed(
|
|
89
|
+
() => size.value || unref(fallback) || (formItem == null ? void 0 : formItem.size) || (form == null ? void 0 : form.size) || globalConfig.value || ""
|
|
90
|
+
);
|
|
85
91
|
};
|
|
86
92
|
const useFormDisabled = (fallback) => {
|
|
87
93
|
const disabled = useProp("disabled");
|