@element-plus/nightly 0.0.20260323 → 0.0.20260324
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/attributes.json +1 -1
- package/dist/index.full.js +92 -19
- package/dist/index.full.min.js +4 -4
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +4 -4
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +92 -19
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hi.js +1 -1
- package/dist/locale/hi.min.js +1 -1
- package/dist/locale/hi.min.mjs +1 -1
- package/dist/locale/hi.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lo.js +1 -1
- package/dist/locale/lo.min.js +1 -1
- package/dist/locale/lo.min.mjs +1 -1
- package/dist/locale/lo.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/ms.js +1 -1
- package/dist/locale/ms.min.js +1 -1
- package/dist/locale/ms.min.mjs +1 -1
- package/dist/locale/ms.mjs +1 -1
- package/dist/locale/my.js +1 -1
- package/dist/locale/my.min.js +1 -1
- package/dist/locale/my.min.mjs +1 -1
- package/dist/locale/my.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/no.js +1 -1
- package/dist/locale/no.min.js +1 -1
- package/dist/locale/no.min.mjs +1 -1
- package/dist/locale/no.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/te.js +1 -1
- package/dist/locale/te.min.js +1 -1
- package/dist/locale/te.min.mjs +1 -1
- package/dist/locale/te.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-hk.js +1 -1
- package/dist/locale/zh-hk.min.js +1 -1
- package/dist/locale/zh-hk.min.mjs +1 -1
- package/dist/locale/zh-hk.mjs +1 -1
- package/dist/locale/zh-mo.js +1 -1
- package/dist/locale/zh-mo.min.js +1 -1
- package/dist/locale/zh-mo.min.mjs +1 -1
- package/dist/locale/zh-mo.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/autocomplete/src/autocomplete.d.ts +6 -0
- package/es/components/dialog/src/dialog.vue.d.ts +6 -6
- package/es/components/dialog/src/dialog.vue_vue_type_script_setup_true_lang.mjs +6 -5
- package/es/components/dialog/src/dialog.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/dialog/src/dialog2.mjs.map +1 -1
- package/es/components/dialog/src/use-dialog.d.ts +2 -0
- package/es/components/dialog/src/use-dialog.mjs +8 -1
- package/es/components/dialog/src/use-dialog.mjs.map +1 -1
- package/es/components/input/src/input.d.ts +10 -0
- package/es/components/input/src/input.mjs +1 -0
- package/es/components/input/src/input.mjs.map +1 -1
- package/es/components/input/src/input.vue_vue_type_script_setup_true_lang.mjs +75 -11
- package/es/components/input/src/input.vue_vue_type_script_setup_true_lang.mjs.map +1 -1
- package/es/components/input/src/input2.mjs.map +1 -1
- package/es/components/mention/src/mention.d.ts +6 -0
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/autocomplete/src/autocomplete.d.ts +6 -0
- package/lib/components/dialog/src/dialog.vue.d.ts +6 -6
- package/lib/components/dialog/src/dialog.vue_vue_type_script_setup_true_lang.js +6 -5
- package/lib/components/dialog/src/dialog.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/dialog/src/dialog2.js.map +1 -1
- package/lib/components/dialog/src/use-dialog.d.ts +2 -0
- package/lib/components/dialog/src/use-dialog.js +8 -1
- package/lib/components/dialog/src/use-dialog.js.map +1 -1
- package/lib/components/input/src/input.d.ts +10 -0
- package/lib/components/input/src/input.js +1 -0
- package/lib/components/input/src/input.js.map +1 -1
- package/lib/components/input/src/input.vue_vue_type_script_setup_true_lang.js +75 -11
- package/lib/components/input/src/input.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/lib/components/input/src/input2.js.map +1 -1
- package/lib/components/mention/src/mention.d.ts +6 -0
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/tags.json +1 -1
- package/web-types.json +1 -1
package/es/version.mjs
CHANGED
package/es/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","names":[],"sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.
|
|
1
|
+
{"version":3,"file":"version.mjs","names":[],"sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20260324'\n"],"mappings":";AAAA,MAAa,UAAU"}
|
|
@@ -292,6 +292,12 @@ declare const autocompleteProps: {
|
|
|
292
292
|
readonly tabindex: EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, 0, boolean>;
|
|
293
293
|
readonly validateEvent: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
294
294
|
readonly inputStyle: EpPropFinalized<(new (...args: any[]) => string | false | vue.CSSProperties | vue.StyleValue[]) | (() => vue.StyleValue) | (((new (...args: any[]) => string | false | vue.CSSProperties | vue.StyleValue[]) | (() => vue.StyleValue)) | null)[], unknown, unknown, () => Mutable<{}>, boolean>;
|
|
295
|
+
readonly countGraphemes: {
|
|
296
|
+
readonly type: vue.PropType<(value: string) => number>;
|
|
297
|
+
readonly required: false;
|
|
298
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
299
|
+
__epPropKey: true;
|
|
300
|
+
};
|
|
295
301
|
readonly autofocus: BooleanConstructor;
|
|
296
302
|
readonly rows: EpPropFinalized<NumberConstructor, unknown, unknown, 2, boolean>;
|
|
297
303
|
};
|
|
@@ -2,19 +2,19 @@ import { DialogProps, DialogTransition } from "./dialog.js";
|
|
|
2
2
|
import * as vue from "vue";
|
|
3
3
|
|
|
4
4
|
//#region ../../packages/components/dialog/src/dialog.vue.d.ts
|
|
5
|
-
declare var
|
|
5
|
+
declare var __VLS_43: {
|
|
6
6
|
close: () => void;
|
|
7
7
|
titleId: string;
|
|
8
8
|
titleClass: string;
|
|
9
|
-
},
|
|
9
|
+
}, __VLS_45: {}, __VLS_47: {}, __VLS_50: {};
|
|
10
10
|
type __VLS_Slots = {} & {
|
|
11
|
-
header?: (props: typeof
|
|
11
|
+
header?: (props: typeof __VLS_43) => any;
|
|
12
12
|
} & {
|
|
13
|
-
title?: (props: typeof
|
|
13
|
+
title?: (props: typeof __VLS_45) => any;
|
|
14
14
|
} & {
|
|
15
|
-
default?: (props: typeof
|
|
15
|
+
default?: (props: typeof __VLS_47) => any;
|
|
16
16
|
} & {
|
|
17
|
-
footer?: (props: typeof
|
|
17
|
+
footer?: (props: typeof __VLS_50) => any;
|
|
18
18
|
};
|
|
19
19
|
declare const __VLS_base: vue.DefineComponent<DialogProps, {
|
|
20
20
|
/** @description whether the dialog is visible */visible: vue.Ref<boolean, boolean>;
|
|
@@ -37,7 +37,7 @@ var dialog_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue
|
|
|
37
37
|
const dialogRef = (0, vue.ref)();
|
|
38
38
|
const headerRef = (0, vue.ref)();
|
|
39
39
|
const dialogContentRef = (0, vue.ref)();
|
|
40
|
-
const { visible, titleId, bodyId, style, overlayDialogStyle, rendered, transitionConfig, zIndex, _draggable, _alignCenter, _overflow, handleClose, onModalClick, onOpenAutoFocus, onCloseAutoFocus, onCloseRequested, onFocusoutPrevented, closing } = require_use_dialog.useDialog(props, dialogRef);
|
|
40
|
+
const { visible, titleId, bodyId, style, overlayDialogStyle, rendered, transitionConfig, zIndex, _draggable, _alignCenter, _overflow, penetrable, handleClose, onModalClick, onOpenAutoFocus, onCloseAutoFocus, onCloseRequested, onFocusoutPrevented, bringToFront, closing } = require_use_dialog.useDialog(props, dialogRef);
|
|
41
41
|
(0, vue.provide)(require_constants.dialogInjectionKey, {
|
|
42
42
|
dialogRef,
|
|
43
43
|
headerRef,
|
|
@@ -47,7 +47,6 @@ var dialog_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue
|
|
|
47
47
|
style
|
|
48
48
|
});
|
|
49
49
|
const overlayEvent = require_index$3.useSameTarget(onModalClick);
|
|
50
|
-
const penetrable = (0, vue.computed)(() => props.modalPenetrable && !props.modal && !props.fullscreen);
|
|
51
50
|
const resetPosition = () => {
|
|
52
51
|
dialogContentRef.value?.resetPosition();
|
|
53
52
|
};
|
|
@@ -69,7 +68,7 @@ var dialog_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue
|
|
|
69
68
|
"overlay-class": [
|
|
70
69
|
__props.modalClass ?? "",
|
|
71
70
|
`${(0, vue.unref)(ns).namespace.value}-modal-dialog`,
|
|
72
|
-
(0, vue.unref)(ns).is("penetrable",
|
|
71
|
+
(0, vue.unref)(ns).is("penetrable", (0, vue.unref)(penetrable))
|
|
73
72
|
],
|
|
74
73
|
"z-index": (0, vue.unref)(zIndex)
|
|
75
74
|
}, {
|
|
@@ -110,7 +109,8 @@ var dialog_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue
|
|
|
110
109
|
"show-close": __props.showClose,
|
|
111
110
|
title: __props.title,
|
|
112
111
|
"aria-level": __props.headerAriaLevel,
|
|
113
|
-
onClose: (0, vue.unref)(handleClose)
|
|
112
|
+
onClose: (0, vue.unref)(handleClose),
|
|
113
|
+
onMousedown: (0, vue.unref)(bringToFront)
|
|
114
114
|
}), (0, vue.createSlots)({
|
|
115
115
|
header: (0, vue.withCtx)(() => [!_ctx.$slots.title ? (0, vue.renderSlot)(_ctx.$slots, "header", {
|
|
116
116
|
key: 0,
|
|
@@ -137,7 +137,8 @@ var dialog_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue
|
|
|
137
137
|
"show-close",
|
|
138
138
|
"title",
|
|
139
139
|
"aria-level",
|
|
140
|
-
"onClose"
|
|
140
|
+
"onClose",
|
|
141
|
+
"onMousedown"
|
|
141
142
|
])) : (0, vue.createCommentVNode)("v-if", true)]),
|
|
142
143
|
_: 3
|
|
143
144
|
}, 8, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.vue_vue_type_script_setup_true_lang.js","names":["$attrs","$slots"],"sources":["../../../../../../packages/components/dialog/src/dialog.vue"],"sourcesContent":["<template>\n <el-teleport\n :to=\"appendTo\"\n :disabled=\"appendTo !== 'body' ? false : !appendToBody\"\n >\n <transition v-bind=\"transitionConfig\">\n <el-overlay\n v-show=\"visible\"\n custom-mask-event\n :mask=\"modal\"\n :overlay-class=\"[\n modalClass ?? '',\n `${ns.namespace.value}-modal-dialog`,\n ns.is('penetrable', penetrable),\n ]\"\n :z-index=\"zIndex\"\n >\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-label=\"title || undefined\"\n :aria-labelledby=\"!title ? titleId : undefined\"\n :aria-describedby=\"bodyId\"\n :class=\"[\n `${ns.namespace.value}-overlay-dialog`,\n ns.is('closing', closing),\n ]\"\n :style=\"overlayDialogStyle\"\n @click=\"overlayEvent.onClick\"\n @mousedown=\"overlayEvent.onMousedown\"\n @mouseup=\"overlayEvent.onMouseup\"\n >\n <el-focus-trap\n loop\n :trapped=\"visible\"\n focus-start-el=\"container\"\n @focus-after-trapped=\"onOpenAutoFocus\"\n @focus-after-released=\"onCloseAutoFocus\"\n @focusout-prevented=\"onFocusoutPrevented\"\n @release-requested=\"onCloseRequested\"\n >\n <el-dialog-content\n v-if=\"rendered\"\n ref=\"dialogContentRef\"\n v-bind=\"$attrs\"\n :center=\"center\"\n :align-center=\"_alignCenter\"\n :close-icon=\"closeIcon\"\n :draggable=\"_draggable\"\n :overflow=\"_overflow\"\n :fullscreen=\"fullscreen\"\n :header-class=\"headerClass\"\n :body-class=\"bodyClass\"\n :footer-class=\"footerClass\"\n :show-close=\"showClose\"\n :title=\"title\"\n :aria-level=\"headerAriaLevel\"\n @close=\"handleClose\"\n >\n <template #header>\n <slot\n v-if=\"!$slots.title\"\n name=\"header\"\n :close=\"handleClose\"\n :title-id=\"titleId\"\n :title-class=\"ns.e('title')\"\n />\n <slot v-else name=\"title\" />\n </template>\n <slot />\n <template v-if=\"$slots.footer\" #footer>\n <slot name=\"footer\" />\n </template>\n </el-dialog-content>\n </el-focus-trap>\n </div>\n </el-overlay>\n </transition>\n </el-teleport>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide, ref, useSlots } from 'vue'\nimport { ElOverlay } from '@element-plus/components/overlay'\nimport { useDeprecated, useNamespace, useSameTarget } from '@element-plus/hooks'\nimport ElFocusTrap from '@element-plus/components/focus-trap'\nimport ElTeleport from '@element-plus/components/teleport'\nimport ElDialogContent from './dialog-content.vue'\nimport { dialogInjectionKey } from './constants'\nimport { dialogEmits, dialogPropsDefaults } from './dialog'\nimport { useDialog } from './use-dialog'\n\nimport type { DialogProps } from './dialog'\n\ndefineOptions({\n name: 'ElDialog',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<DialogProps>(), dialogPropsDefaults)\ndefineEmits(dialogEmits)\nconst slots = useSlots()\n\nuseDeprecated(\n {\n scope: 'el-dialog',\n from: 'the title slot',\n replacement: 'the header slot',\n version: '3.0.0',\n ref: 'https://element-plus.org/en-US/component/dialog.html#slots',\n },\n computed(() => !!slots.title)\n)\n\nconst ns = useNamespace('dialog')\nconst dialogRef = ref<HTMLElement>()\nconst headerRef = ref<HTMLElement>()\nconst dialogContentRef = ref()\n\nconst {\n visible,\n titleId,\n bodyId,\n style,\n overlayDialogStyle,\n rendered,\n transitionConfig,\n zIndex,\n _draggable,\n _alignCenter,\n _overflow,\n handleClose,\n onModalClick,\n onOpenAutoFocus,\n onCloseAutoFocus,\n onCloseRequested,\n onFocusoutPrevented,\n closing,\n} = useDialog(props, dialogRef)\n\nprovide(dialogInjectionKey, {\n dialogRef,\n headerRef,\n bodyId,\n ns,\n rendered,\n style,\n})\n\nconst overlayEvent = useSameTarget(onModalClick)\n\nconst
|
|
1
|
+
{"version":3,"file":"dialog.vue_vue_type_script_setup_true_lang.js","names":["$attrs","$slots"],"sources":["../../../../../../packages/components/dialog/src/dialog.vue"],"sourcesContent":["<template>\n <el-teleport\n :to=\"appendTo\"\n :disabled=\"appendTo !== 'body' ? false : !appendToBody\"\n >\n <transition v-bind=\"transitionConfig\">\n <el-overlay\n v-show=\"visible\"\n custom-mask-event\n :mask=\"modal\"\n :overlay-class=\"[\n modalClass ?? '',\n `${ns.namespace.value}-modal-dialog`,\n ns.is('penetrable', penetrable),\n ]\"\n :z-index=\"zIndex\"\n >\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-label=\"title || undefined\"\n :aria-labelledby=\"!title ? titleId : undefined\"\n :aria-describedby=\"bodyId\"\n :class=\"[\n `${ns.namespace.value}-overlay-dialog`,\n ns.is('closing', closing),\n ]\"\n :style=\"overlayDialogStyle\"\n @click=\"overlayEvent.onClick\"\n @mousedown=\"overlayEvent.onMousedown\"\n @mouseup=\"overlayEvent.onMouseup\"\n >\n <el-focus-trap\n loop\n :trapped=\"visible\"\n focus-start-el=\"container\"\n @focus-after-trapped=\"onOpenAutoFocus\"\n @focus-after-released=\"onCloseAutoFocus\"\n @focusout-prevented=\"onFocusoutPrevented\"\n @release-requested=\"onCloseRequested\"\n >\n <el-dialog-content\n v-if=\"rendered\"\n ref=\"dialogContentRef\"\n v-bind=\"$attrs\"\n :center=\"center\"\n :align-center=\"_alignCenter\"\n :close-icon=\"closeIcon\"\n :draggable=\"_draggable\"\n :overflow=\"_overflow\"\n :fullscreen=\"fullscreen\"\n :header-class=\"headerClass\"\n :body-class=\"bodyClass\"\n :footer-class=\"footerClass\"\n :show-close=\"showClose\"\n :title=\"title\"\n :aria-level=\"headerAriaLevel\"\n @close=\"handleClose\"\n @mousedown=\"bringToFront\"\n >\n <template #header>\n <slot\n v-if=\"!$slots.title\"\n name=\"header\"\n :close=\"handleClose\"\n :title-id=\"titleId\"\n :title-class=\"ns.e('title')\"\n />\n <slot v-else name=\"title\" />\n </template>\n <slot />\n <template v-if=\"$slots.footer\" #footer>\n <slot name=\"footer\" />\n </template>\n </el-dialog-content>\n </el-focus-trap>\n </div>\n </el-overlay>\n </transition>\n </el-teleport>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide, ref, useSlots } from 'vue'\nimport { ElOverlay } from '@element-plus/components/overlay'\nimport { useDeprecated, useNamespace, useSameTarget } from '@element-plus/hooks'\nimport ElFocusTrap from '@element-plus/components/focus-trap'\nimport ElTeleport from '@element-plus/components/teleport'\nimport ElDialogContent from './dialog-content.vue'\nimport { dialogInjectionKey } from './constants'\nimport { dialogEmits, dialogPropsDefaults } from './dialog'\nimport { useDialog } from './use-dialog'\n\nimport type { DialogProps } from './dialog'\n\ndefineOptions({\n name: 'ElDialog',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<DialogProps>(), dialogPropsDefaults)\ndefineEmits(dialogEmits)\nconst slots = useSlots()\n\nuseDeprecated(\n {\n scope: 'el-dialog',\n from: 'the title slot',\n replacement: 'the header slot',\n version: '3.0.0',\n ref: 'https://element-plus.org/en-US/component/dialog.html#slots',\n },\n computed(() => !!slots.title)\n)\n\nconst ns = useNamespace('dialog')\nconst dialogRef = ref<HTMLElement>()\nconst headerRef = ref<HTMLElement>()\nconst dialogContentRef = ref()\n\nconst {\n visible,\n titleId,\n bodyId,\n style,\n overlayDialogStyle,\n rendered,\n transitionConfig,\n zIndex,\n _draggable,\n _alignCenter,\n _overflow,\n penetrable,\n handleClose,\n onModalClick,\n onOpenAutoFocus,\n onCloseAutoFocus,\n onCloseRequested,\n onFocusoutPrevented,\n bringToFront,\n closing,\n} = useDialog(props, dialogRef)\n\nprovide(dialogInjectionKey, {\n dialogRef,\n headerRef,\n bodyId,\n ns,\n rendered,\n style,\n})\n\nconst overlayEvent = useSameTarget(onModalClick)\n\nconst resetPosition = () => {\n dialogContentRef.value?.resetPosition()\n}\n\ndefineExpose({\n /** @description whether the dialog is visible */\n visible,\n dialogContentRef,\n resetPosition,\n handleClose,\n})\n</script>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;EAoGA,MAAM,QAAQ;EAEd,MAAM,2BAAiB;AAEvB,gCACE;GACE,OAAO;GACP,MAAM;GACN,aAAa;GACb,SAAS;GACT,KAAK;GACN,0BACc,CAAC,CAAC,MAAM,MAAK,CAC9B;EAEA,MAAM,KAAK,6BAAa,SAAQ;EAChC,MAAM,0BAA6B;EACnC,MAAM,0BAA6B;EACnC,MAAM,iCAAuB;EAE7B,MAAM,EACJ,SACA,SACA,QACA,OACA,oBACA,UACA,kBACA,QACA,YACA,cACA,WACA,YACA,aACA,cACA,iBACA,kBACA,kBACA,qBACA,cACA,YACE,6BAAU,OAAO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A,gBAhCZ,SAAQ,+CAgCI,oDAAA;;iBA/Bd;QAAJ,KAAI;UACIA,KAAAA,QAAM;QACb,QAAQ,QAAA;QACR,+BAAc,aAAY;QAC1B,cAAY,QAAA;QACZ,0BAAW,WAAU;QACrB,yBAAU,UAAS;QACnB,YAAY,QAAA;QACZ,gBAAc,QAAA;QACd,cAAY,QAAA;QACZ,gBAAc,QAAA;QACd,cAAY,QAAA;QACZ,OAAO,QAAA;QACP,cAAY,QAAA;QACZ,wBAAO,YAAW;QAClB,4BAAW,aAAA;;QAED,+BAOP,EALOC,KAAAA,OAAO,4BAKd,KAAA,QAAA,UAAA;;SAHC,sBAAO,YAAW;SAClB,wBAAU,QAAO;SACjB,2BAAa,GAAE,CAAC,EAAC,QAAA;iCAEQ,KAAA,QAAA,SAAA,EAAA,KAAA,GAAA,CAAA;wCAEtB,qBAAA,KAAA,QAAA,UAAA;;WACQA,KAAAA,OAAO;cAAS;mCACR,qBAAA,KAAA,QAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qCAjEtB,QAAO,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog2.js","names":[],"sources":["../../../../../../packages/components/dialog/src/dialog.vue"],"sourcesContent":["<template>\n <el-teleport\n :to=\"appendTo\"\n :disabled=\"appendTo !== 'body' ? false : !appendToBody\"\n >\n <transition v-bind=\"transitionConfig\">\n <el-overlay\n v-show=\"visible\"\n custom-mask-event\n :mask=\"modal\"\n :overlay-class=\"[\n modalClass ?? '',\n `${ns.namespace.value}-modal-dialog`,\n ns.is('penetrable', penetrable),\n ]\"\n :z-index=\"zIndex\"\n >\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-label=\"title || undefined\"\n :aria-labelledby=\"!title ? titleId : undefined\"\n :aria-describedby=\"bodyId\"\n :class=\"[\n `${ns.namespace.value}-overlay-dialog`,\n ns.is('closing', closing),\n ]\"\n :style=\"overlayDialogStyle\"\n @click=\"overlayEvent.onClick\"\n @mousedown=\"overlayEvent.onMousedown\"\n @mouseup=\"overlayEvent.onMouseup\"\n >\n <el-focus-trap\n loop\n :trapped=\"visible\"\n focus-start-el=\"container\"\n @focus-after-trapped=\"onOpenAutoFocus\"\n @focus-after-released=\"onCloseAutoFocus\"\n @focusout-prevented=\"onFocusoutPrevented\"\n @release-requested=\"onCloseRequested\"\n >\n <el-dialog-content\n v-if=\"rendered\"\n ref=\"dialogContentRef\"\n v-bind=\"$attrs\"\n :center=\"center\"\n :align-center=\"_alignCenter\"\n :close-icon=\"closeIcon\"\n :draggable=\"_draggable\"\n :overflow=\"_overflow\"\n :fullscreen=\"fullscreen\"\n :header-class=\"headerClass\"\n :body-class=\"bodyClass\"\n :footer-class=\"footerClass\"\n :show-close=\"showClose\"\n :title=\"title\"\n :aria-level=\"headerAriaLevel\"\n @close=\"handleClose\"\n >\n <template #header>\n <slot\n v-if=\"!$slots.title\"\n name=\"header\"\n :close=\"handleClose\"\n :title-id=\"titleId\"\n :title-class=\"ns.e('title')\"\n />\n <slot v-else name=\"title\" />\n </template>\n <slot />\n <template v-if=\"$slots.footer\" #footer>\n <slot name=\"footer\" />\n </template>\n </el-dialog-content>\n </el-focus-trap>\n </div>\n </el-overlay>\n </transition>\n </el-teleport>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide, ref, useSlots } from 'vue'\nimport { ElOverlay } from '@element-plus/components/overlay'\nimport { useDeprecated, useNamespace, useSameTarget } from '@element-plus/hooks'\nimport ElFocusTrap from '@element-plus/components/focus-trap'\nimport ElTeleport from '@element-plus/components/teleport'\nimport ElDialogContent from './dialog-content.vue'\nimport { dialogInjectionKey } from './constants'\nimport { dialogEmits, dialogPropsDefaults } from './dialog'\nimport { useDialog } from './use-dialog'\n\nimport type { DialogProps } from './dialog'\n\ndefineOptions({\n name: 'ElDialog',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<DialogProps>(), dialogPropsDefaults)\ndefineEmits(dialogEmits)\nconst slots = useSlots()\n\nuseDeprecated(\n {\n scope: 'el-dialog',\n from: 'the title slot',\n replacement: 'the header slot',\n version: '3.0.0',\n ref: 'https://element-plus.org/en-US/component/dialog.html#slots',\n },\n computed(() => !!slots.title)\n)\n\nconst ns = useNamespace('dialog')\nconst dialogRef = ref<HTMLElement>()\nconst headerRef = ref<HTMLElement>()\nconst dialogContentRef = ref()\n\nconst {\n visible,\n titleId,\n bodyId,\n style,\n overlayDialogStyle,\n rendered,\n transitionConfig,\n zIndex,\n _draggable,\n _alignCenter,\n _overflow,\n handleClose,\n onModalClick,\n onOpenAutoFocus,\n onCloseAutoFocus,\n onCloseRequested,\n onFocusoutPrevented,\n closing,\n} = useDialog(props, dialogRef)\n\nprovide(dialogInjectionKey, {\n dialogRef,\n headerRef,\n bodyId,\n ns,\n rendered,\n style,\n})\n\nconst overlayEvent = useSameTarget(onModalClick)\n\nconst
|
|
1
|
+
{"version":3,"file":"dialog2.js","names":[],"sources":["../../../../../../packages/components/dialog/src/dialog.vue"],"sourcesContent":["<template>\n <el-teleport\n :to=\"appendTo\"\n :disabled=\"appendTo !== 'body' ? false : !appendToBody\"\n >\n <transition v-bind=\"transitionConfig\">\n <el-overlay\n v-show=\"visible\"\n custom-mask-event\n :mask=\"modal\"\n :overlay-class=\"[\n modalClass ?? '',\n `${ns.namespace.value}-modal-dialog`,\n ns.is('penetrable', penetrable),\n ]\"\n :z-index=\"zIndex\"\n >\n <div\n role=\"dialog\"\n aria-modal=\"true\"\n :aria-label=\"title || undefined\"\n :aria-labelledby=\"!title ? titleId : undefined\"\n :aria-describedby=\"bodyId\"\n :class=\"[\n `${ns.namespace.value}-overlay-dialog`,\n ns.is('closing', closing),\n ]\"\n :style=\"overlayDialogStyle\"\n @click=\"overlayEvent.onClick\"\n @mousedown=\"overlayEvent.onMousedown\"\n @mouseup=\"overlayEvent.onMouseup\"\n >\n <el-focus-trap\n loop\n :trapped=\"visible\"\n focus-start-el=\"container\"\n @focus-after-trapped=\"onOpenAutoFocus\"\n @focus-after-released=\"onCloseAutoFocus\"\n @focusout-prevented=\"onFocusoutPrevented\"\n @release-requested=\"onCloseRequested\"\n >\n <el-dialog-content\n v-if=\"rendered\"\n ref=\"dialogContentRef\"\n v-bind=\"$attrs\"\n :center=\"center\"\n :align-center=\"_alignCenter\"\n :close-icon=\"closeIcon\"\n :draggable=\"_draggable\"\n :overflow=\"_overflow\"\n :fullscreen=\"fullscreen\"\n :header-class=\"headerClass\"\n :body-class=\"bodyClass\"\n :footer-class=\"footerClass\"\n :show-close=\"showClose\"\n :title=\"title\"\n :aria-level=\"headerAriaLevel\"\n @close=\"handleClose\"\n @mousedown=\"bringToFront\"\n >\n <template #header>\n <slot\n v-if=\"!$slots.title\"\n name=\"header\"\n :close=\"handleClose\"\n :title-id=\"titleId\"\n :title-class=\"ns.e('title')\"\n />\n <slot v-else name=\"title\" />\n </template>\n <slot />\n <template v-if=\"$slots.footer\" #footer>\n <slot name=\"footer\" />\n </template>\n </el-dialog-content>\n </el-focus-trap>\n </div>\n </el-overlay>\n </transition>\n </el-teleport>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide, ref, useSlots } from 'vue'\nimport { ElOverlay } from '@element-plus/components/overlay'\nimport { useDeprecated, useNamespace, useSameTarget } from '@element-plus/hooks'\nimport ElFocusTrap from '@element-plus/components/focus-trap'\nimport ElTeleport from '@element-plus/components/teleport'\nimport ElDialogContent from './dialog-content.vue'\nimport { dialogInjectionKey } from './constants'\nimport { dialogEmits, dialogPropsDefaults } from './dialog'\nimport { useDialog } from './use-dialog'\n\nimport type { DialogProps } from './dialog'\n\ndefineOptions({\n name: 'ElDialog',\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<DialogProps>(), dialogPropsDefaults)\ndefineEmits(dialogEmits)\nconst slots = useSlots()\n\nuseDeprecated(\n {\n scope: 'el-dialog',\n from: 'the title slot',\n replacement: 'the header slot',\n version: '3.0.0',\n ref: 'https://element-plus.org/en-US/component/dialog.html#slots',\n },\n computed(() => !!slots.title)\n)\n\nconst ns = useNamespace('dialog')\nconst dialogRef = ref<HTMLElement>()\nconst headerRef = ref<HTMLElement>()\nconst dialogContentRef = ref()\n\nconst {\n visible,\n titleId,\n bodyId,\n style,\n overlayDialogStyle,\n rendered,\n transitionConfig,\n zIndex,\n _draggable,\n _alignCenter,\n _overflow,\n penetrable,\n handleClose,\n onModalClick,\n onOpenAutoFocus,\n onCloseAutoFocus,\n onCloseRequested,\n onFocusoutPrevented,\n bringToFront,\n closing,\n} = useDialog(props, dialogRef)\n\nprovide(dialogInjectionKey, {\n dialogRef,\n headerRef,\n bodyId,\n ns,\n rendered,\n style,\n})\n\nconst overlayEvent = useSameTarget(onModalClick)\n\nconst resetPosition = () => {\n dialogContentRef.value?.resetPosition()\n}\n\ndefineExpose({\n /** @description whether the dialog is visible */\n visible,\n dialogContentRef,\n resetPosition,\n handleClose,\n})\n</script>\n"],"mappings":""}
|
|
@@ -15,6 +15,7 @@ declare const useDialog: (props: DialogProps, targetRef: Ref<HTMLElement | undef
|
|
|
15
15
|
onCloseAutoFocus: () => void;
|
|
16
16
|
onCloseRequested: () => void;
|
|
17
17
|
onFocusoutPrevented: (event: CustomEvent) => void;
|
|
18
|
+
bringToFront: () => void;
|
|
18
19
|
titleId: Ref<string, string>;
|
|
19
20
|
bodyId: Ref<string, string>;
|
|
20
21
|
closed: Ref<boolean, boolean>;
|
|
@@ -33,6 +34,7 @@ declare const useDialog: (props: DialogProps, targetRef: Ref<HTMLElement | undef
|
|
|
33
34
|
_alignCenter: vue.ComputedRef<boolean>;
|
|
34
35
|
_overflow: vue.ComputedRef<boolean>;
|
|
35
36
|
closing: Ref<boolean, boolean>;
|
|
37
|
+
penetrable: vue.ComputedRef<boolean | undefined>;
|
|
36
38
|
};
|
|
37
39
|
//#endregion
|
|
38
40
|
export { useDialog };
|
|
@@ -44,6 +44,7 @@ const useDialog = (props, targetRef) => {
|
|
|
44
44
|
const _draggable = (0, vue.computed)(() => (props.draggable ?? globalConfig.value?.draggable ?? false) && !props.fullscreen);
|
|
45
45
|
const _alignCenter = (0, vue.computed)(() => props.alignCenter ?? globalConfig.value?.alignCenter ?? false);
|
|
46
46
|
const _overflow = (0, vue.computed)(() => props.overflow ?? globalConfig.value?.overflow ?? false);
|
|
47
|
+
const penetrable = (0, vue.computed)(() => props.modalPenetrable && !props.modal && !props.fullscreen);
|
|
47
48
|
const overlayDialogStyle = (0, vue.computed)(() => {
|
|
48
49
|
if (_alignCenter.value) return { display: "flex" };
|
|
49
50
|
return {};
|
|
@@ -135,6 +136,10 @@ const useDialog = (props, targetRef) => {
|
|
|
135
136
|
function onCloseRequested() {
|
|
136
137
|
if (props.closeOnPressEscape) handleClose();
|
|
137
138
|
}
|
|
139
|
+
function bringToFront() {
|
|
140
|
+
if (!visible.value || !penetrable.value || props.zIndex !== void 0) return;
|
|
141
|
+
zIndex.value = nextZIndex();
|
|
142
|
+
}
|
|
138
143
|
(0, vue.watch)(() => props.zIndex, () => {
|
|
139
144
|
zIndex.value = props.zIndex ?? nextZIndex();
|
|
140
145
|
});
|
|
@@ -181,6 +186,7 @@ const useDialog = (props, targetRef) => {
|
|
|
181
186
|
onCloseAutoFocus,
|
|
182
187
|
onCloseRequested,
|
|
183
188
|
onFocusoutPrevented,
|
|
189
|
+
bringToFront,
|
|
184
190
|
titleId,
|
|
185
191
|
bodyId,
|
|
186
192
|
closed,
|
|
@@ -193,7 +199,8 @@ const useDialog = (props, targetRef) => {
|
|
|
193
199
|
_draggable,
|
|
194
200
|
_alignCenter,
|
|
195
201
|
_overflow,
|
|
196
|
-
closing
|
|
202
|
+
closing,
|
|
203
|
+
penetrable
|
|
197
204
|
};
|
|
198
205
|
};
|
|
199
206
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-dialog.js","names":["useZIndex","useId","useGlobalConfig","defaultNamespace","addUnit","DEFAULT_DIALOG_TRANSITION","UPDATE_MODEL_EVENT","isClient"],"sources":["../../../../../../packages/components/dialog/src/use-dialog.ts"],"sourcesContent":["import {\n computed,\n getCurrentInstance,\n nextTick,\n onMounted,\n ref,\n watch,\n} from 'vue'\nimport { useTimeoutFn } from '@vueuse/core'\nimport {\n defaultNamespace,\n useId,\n useLockscreen,\n useZIndex,\n} from '@element-plus/hooks'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport {\n addUnit,\n debugWarn,\n isArray,\n isClient,\n isFunction,\n isObject,\n} from '@element-plus/utils'\nimport { useGlobalConfig } from '@element-plus/components/config-provider'\nimport { DEFAULT_DIALOG_TRANSITION } from './constants'\n\nimport type { CSSProperties, Ref, SetupContext, TransitionProps } from 'vue'\nimport type { Arrayable } from '@element-plus/utils'\nimport type { DialogEmits, DialogProps } from './dialog'\n\nconst COMPONENT_NAME = 'ElDialog'\n\nexport const useDialog = (\n props: DialogProps,\n targetRef: Ref<HTMLElement | undefined>\n) => {\n const instance = getCurrentInstance()!\n const emit = instance.emit as SetupContext<DialogEmits>['emit']\n const { nextZIndex } = useZIndex()\n\n let lastPosition = ''\n const titleId = useId()\n const bodyId = useId()\n const visible = ref(false)\n const closed = ref(false)\n const rendered = ref(false) // when destroyOnClose is true, we initialize it as false vise versa\n const zIndex = ref(props.zIndex ?? nextZIndex())\n const closing = ref(false)\n\n let openTimer: (() => void) | undefined = undefined\n let closeTimer: (() => void) | undefined = undefined\n\n const config = useGlobalConfig()\n\n const namespace = computed(() => config.value?.namespace ?? defaultNamespace)\n const globalConfig = computed(() => config.value?.dialog)\n\n const style = computed<CSSProperties>(() => {\n const style: CSSProperties = {}\n const varPrefix = `--${namespace.value}-dialog` as const\n if (!props.fullscreen) {\n if (props.top) {\n style[`${varPrefix}-margin-top`] = props.top\n }\n const width = addUnit(props.width)\n if (width) {\n style[`${varPrefix}-width`] = width\n }\n }\n return style\n })\n\n const _draggable = computed(\n () =>\n (props.draggable ?? globalConfig.value?.draggable ?? false) &&\n !props.fullscreen\n )\n\n const _alignCenter = computed(\n () => props.alignCenter ?? globalConfig.value?.alignCenter ?? false\n )\n\n const _overflow = computed(\n () => props.overflow ?? globalConfig.value?.overflow ?? false\n )\n\n const overlayDialogStyle = computed<CSSProperties>(() => {\n if (_alignCenter.value) {\n return { display: 'flex' }\n }\n return {}\n })\n\n const transitionConfig = computed(() => {\n const transition =\n props.transition ??\n globalConfig.value?.transition ??\n DEFAULT_DIALOG_TRANSITION\n const baseConfig = {\n name: transition,\n onAfterEnter: afterEnter,\n onBeforeLeave: beforeLeave,\n onAfterLeave: afterLeave,\n }\n if (isObject(transition)) {\n const config = { ...transition } as TransitionProps\n const _mergeHook = (\n userHook: Arrayable<(el: Element) => void> | undefined,\n defaultHook: () => void\n ) => {\n return (el: Element) => {\n if (isArray(userHook)) {\n userHook.forEach((fn) => {\n if (isFunction(fn)) fn(el)\n })\n } else if (isFunction(userHook)) {\n userHook(el)\n }\n defaultHook()\n }\n }\n config.onAfterEnter = _mergeHook(config.onAfterEnter, afterEnter)\n config.onBeforeLeave = _mergeHook(config.onBeforeLeave, beforeLeave)\n config.onAfterLeave = _mergeHook(config.onAfterLeave, afterLeave)\n if (!config.name) {\n config.name = DEFAULT_DIALOG_TRANSITION\n debugWarn(\n COMPONENT_NAME,\n `transition.name is missing when using object syntax, fallback to '${DEFAULT_DIALOG_TRANSITION}'`\n )\n }\n return config\n }\n\n return baseConfig\n })\n\n function afterEnter() {\n emit('opened')\n }\n\n function afterLeave() {\n emit('closed')\n emit(UPDATE_MODEL_EVENT, false)\n if (props.destroyOnClose) {\n rendered.value = false\n }\n closing.value = false\n }\n\n function beforeLeave() {\n closing.value = true\n emit('close')\n }\n\n function open() {\n closeTimer?.()\n openTimer?.()\n\n if (props.openDelay && props.openDelay > 0) {\n ;({ stop: openTimer } = useTimeoutFn(() => doOpen(), props.openDelay))\n } else {\n doOpen()\n }\n }\n\n function close() {\n openTimer?.()\n closeTimer?.()\n\n if (props.closeDelay && props.closeDelay > 0) {\n ;({ stop: closeTimer } = useTimeoutFn(() => doClose(), props.closeDelay))\n } else {\n doClose()\n }\n }\n\n function handleClose() {\n function hide(shouldCancel?: boolean) {\n if (shouldCancel) return\n closed.value = true\n visible.value = false\n }\n\n if (props.beforeClose) {\n props.beforeClose(hide)\n } else {\n close()\n }\n }\n\n function onModalClick() {\n if (props.closeOnClickModal) {\n handleClose()\n }\n }\n\n function doOpen() {\n if (!isClient) return\n visible.value = true\n }\n\n function doClose() {\n visible.value = false\n }\n\n function onOpenAutoFocus() {\n emit('openAutoFocus')\n }\n\n function onCloseAutoFocus() {\n emit('closeAutoFocus')\n }\n\n function onFocusoutPrevented(event: CustomEvent) {\n if (event.detail?.focusReason === 'pointer') {\n event.preventDefault()\n }\n }\n\n if (props.lockScroll) {\n useLockscreen(visible)\n }\n\n function onCloseRequested() {\n if (props.closeOnPressEscape) {\n handleClose()\n }\n }\n\n watch(\n () => props.zIndex,\n () => {\n zIndex.value = props.zIndex ?? nextZIndex()\n }\n )\n\n watch(\n () => props.modelValue,\n (val) => {\n if (val) {\n closed.value = false\n closing.value = false\n open()\n rendered.value = true // enables lazy rendering\n zIndex.value = props.zIndex ?? nextZIndex()\n // this.$el.addEventListener('scroll', this.updatePopper)\n nextTick(() => {\n emit('open')\n if (targetRef.value) {\n targetRef.value.parentElement!.scrollTop = 0\n targetRef.value.parentElement!.scrollLeft = 0\n targetRef.value.scrollTop = 0\n }\n })\n } else {\n // this.$el.removeEventListener('scroll', this.updatePopper\n if (visible.value) {\n close()\n }\n }\n }\n )\n\n watch(\n () => props.fullscreen,\n (val) => {\n if (!targetRef.value) return\n if (val) {\n lastPosition = targetRef.value.style.transform\n targetRef.value.style.transform = ''\n } else {\n targetRef.value.style.transform = lastPosition\n }\n }\n )\n\n onMounted(() => {\n if (props.modelValue) {\n visible.value = true\n rendered.value = true // enables lazy rendering\n open()\n }\n })\n\n return {\n afterEnter,\n afterLeave,\n beforeLeave,\n handleClose,\n onModalClick,\n close,\n doClose,\n onOpenAutoFocus,\n onCloseAutoFocus,\n onCloseRequested,\n onFocusoutPrevented,\n titleId,\n bodyId,\n closed,\n style,\n overlayDialogStyle,\n rendered,\n visible,\n zIndex,\n transitionConfig,\n _draggable,\n _alignCenter,\n _overflow,\n closing,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA+BA,MAAM,iBAAiB;AAEvB,MAAa,aACX,OACA,cACG;CAEH,MAAM,oCAD+B,CACf;CACtB,MAAM,EAAE,eAAeA,2BAAW;CAElC,IAAI,eAAe;CACnB,MAAM,UAAUC,uBAAO;CACvB,MAAM,SAASA,uBAAO;CACtB,MAAM,uBAAc,MAAM;CAC1B,MAAM,sBAAa,MAAM;CACzB,MAAM,wBAAe,MAAM;CAC3B,MAAM,sBAAa,MAAM,UAAU,YAAY,CAAC;CAChD,MAAM,uBAAc,MAAM;CAE1B,IAAI,YAAsC;CAC1C,IAAI,aAAuC;CAE3C,MAAM,SAASC,2CAAiB;CAEhC,MAAM,oCAA2B,OAAO,OAAO,aAAaC,+BAAiB;CAC7E,MAAM,uCAA8B,OAAO,OAAO,OAAO;CAEzD,MAAM,gCAAsC;EAC1C,MAAM,QAAuB,EAAE;EAC/B,MAAM,YAAY,KAAK,UAAU,MAAM;AACvC,MAAI,CAAC,MAAM,YAAY;AACrB,OAAI,MAAM,IACR,OAAM,GAAG,UAAU,gBAAgB,MAAM;GAE3C,MAAM,QAAQC,sBAAQ,MAAM,MAAM;AAClC,OAAI,MACF,OAAM,GAAG,UAAU,WAAW;;AAGlC,SAAO;GACP;CAEF,MAAM,sCAED,MAAM,aAAa,aAAa,OAAO,aAAa,UACrD,CAAC,MAAM,WACV;CAED,MAAM,uCACE,MAAM,eAAe,aAAa,OAAO,eAAe,MAC/D;CAED,MAAM,oCACE,MAAM,YAAY,aAAa,OAAO,YAAY,MACzD;CAED,MAAM,6CAAmD;AACvD,MAAI,aAAa,MACf,QAAO,EAAE,SAAS,QAAQ;AAE5B,SAAO,EAAE;GACT;CAEF,MAAM,2CAAkC;EACtC,MAAM,aACJ,MAAM,cACN,aAAa,OAAO,cACpBC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
|
|
1
|
+
{"version":3,"file":"use-dialog.js","names":["useZIndex","useId","useGlobalConfig","defaultNamespace","addUnit","DEFAULT_DIALOG_TRANSITION","UPDATE_MODEL_EVENT","isClient"],"sources":["../../../../../../packages/components/dialog/src/use-dialog.ts"],"sourcesContent":["import {\n computed,\n getCurrentInstance,\n nextTick,\n onMounted,\n ref,\n watch,\n} from 'vue'\nimport { useTimeoutFn } from '@vueuse/core'\nimport {\n defaultNamespace,\n useId,\n useLockscreen,\n useZIndex,\n} from '@element-plus/hooks'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport {\n addUnit,\n debugWarn,\n isArray,\n isClient,\n isFunction,\n isObject,\n} from '@element-plus/utils'\nimport { useGlobalConfig } from '@element-plus/components/config-provider'\nimport { DEFAULT_DIALOG_TRANSITION } from './constants'\n\nimport type { CSSProperties, Ref, SetupContext, TransitionProps } from 'vue'\nimport type { Arrayable } from '@element-plus/utils'\nimport type { DialogEmits, DialogProps } from './dialog'\n\nconst COMPONENT_NAME = 'ElDialog'\n\nexport const useDialog = (\n props: DialogProps,\n targetRef: Ref<HTMLElement | undefined>\n) => {\n const instance = getCurrentInstance()!\n const emit = instance.emit as SetupContext<DialogEmits>['emit']\n const { nextZIndex } = useZIndex()\n\n let lastPosition = ''\n const titleId = useId()\n const bodyId = useId()\n const visible = ref(false)\n const closed = ref(false)\n const rendered = ref(false) // when destroyOnClose is true, we initialize it as false vise versa\n const zIndex = ref(props.zIndex ?? nextZIndex())\n const closing = ref(false)\n\n let openTimer: (() => void) | undefined = undefined\n let closeTimer: (() => void) | undefined = undefined\n\n const config = useGlobalConfig()\n\n const namespace = computed(() => config.value?.namespace ?? defaultNamespace)\n const globalConfig = computed(() => config.value?.dialog)\n\n const style = computed<CSSProperties>(() => {\n const style: CSSProperties = {}\n const varPrefix = `--${namespace.value}-dialog` as const\n if (!props.fullscreen) {\n if (props.top) {\n style[`${varPrefix}-margin-top`] = props.top\n }\n const width = addUnit(props.width)\n if (width) {\n style[`${varPrefix}-width`] = width\n }\n }\n return style\n })\n\n const _draggable = computed(\n () =>\n (props.draggable ?? globalConfig.value?.draggable ?? false) &&\n !props.fullscreen\n )\n\n const _alignCenter = computed(\n () => props.alignCenter ?? globalConfig.value?.alignCenter ?? false\n )\n\n const _overflow = computed(\n () => props.overflow ?? globalConfig.value?.overflow ?? false\n )\n\n const penetrable = computed(\n () => props.modalPenetrable && !props.modal && !props.fullscreen\n )\n\n const overlayDialogStyle = computed<CSSProperties>(() => {\n if (_alignCenter.value) {\n return { display: 'flex' }\n }\n return {}\n })\n\n const transitionConfig = computed(() => {\n const transition =\n props.transition ??\n globalConfig.value?.transition ??\n DEFAULT_DIALOG_TRANSITION\n const baseConfig = {\n name: transition,\n onAfterEnter: afterEnter,\n onBeforeLeave: beforeLeave,\n onAfterLeave: afterLeave,\n }\n if (isObject(transition)) {\n const config = { ...transition } as TransitionProps\n const _mergeHook = (\n userHook: Arrayable<(el: Element) => void> | undefined,\n defaultHook: () => void\n ) => {\n return (el: Element) => {\n if (isArray(userHook)) {\n userHook.forEach((fn) => {\n if (isFunction(fn)) fn(el)\n })\n } else if (isFunction(userHook)) {\n userHook(el)\n }\n defaultHook()\n }\n }\n config.onAfterEnter = _mergeHook(config.onAfterEnter, afterEnter)\n config.onBeforeLeave = _mergeHook(config.onBeforeLeave, beforeLeave)\n config.onAfterLeave = _mergeHook(config.onAfterLeave, afterLeave)\n if (!config.name) {\n config.name = DEFAULT_DIALOG_TRANSITION\n debugWarn(\n COMPONENT_NAME,\n `transition.name is missing when using object syntax, fallback to '${DEFAULT_DIALOG_TRANSITION}'`\n )\n }\n return config\n }\n\n return baseConfig\n })\n\n function afterEnter() {\n emit('opened')\n }\n\n function afterLeave() {\n emit('closed')\n emit(UPDATE_MODEL_EVENT, false)\n if (props.destroyOnClose) {\n rendered.value = false\n }\n closing.value = false\n }\n\n function beforeLeave() {\n closing.value = true\n emit('close')\n }\n\n function open() {\n closeTimer?.()\n openTimer?.()\n\n if (props.openDelay && props.openDelay > 0) {\n ;({ stop: openTimer } = useTimeoutFn(() => doOpen(), props.openDelay))\n } else {\n doOpen()\n }\n }\n\n function close() {\n openTimer?.()\n closeTimer?.()\n\n if (props.closeDelay && props.closeDelay > 0) {\n ;({ stop: closeTimer } = useTimeoutFn(() => doClose(), props.closeDelay))\n } else {\n doClose()\n }\n }\n\n function handleClose() {\n function hide(shouldCancel?: boolean) {\n if (shouldCancel) return\n closed.value = true\n visible.value = false\n }\n\n if (props.beforeClose) {\n props.beforeClose(hide)\n } else {\n close()\n }\n }\n\n function onModalClick() {\n if (props.closeOnClickModal) {\n handleClose()\n }\n }\n\n function doOpen() {\n if (!isClient) return\n visible.value = true\n }\n\n function doClose() {\n visible.value = false\n }\n\n function onOpenAutoFocus() {\n emit('openAutoFocus')\n }\n\n function onCloseAutoFocus() {\n emit('closeAutoFocus')\n }\n\n function onFocusoutPrevented(event: CustomEvent) {\n if (event.detail?.focusReason === 'pointer') {\n event.preventDefault()\n }\n }\n\n if (props.lockScroll) {\n useLockscreen(visible)\n }\n\n function onCloseRequested() {\n if (props.closeOnPressEscape) {\n handleClose()\n }\n }\n\n function bringToFront() {\n if (!visible.value || !penetrable.value || props.zIndex !== undefined) {\n return\n }\n\n zIndex.value = nextZIndex()\n }\n\n watch(\n () => props.zIndex,\n () => {\n zIndex.value = props.zIndex ?? nextZIndex()\n }\n )\n\n watch(\n () => props.modelValue,\n (val) => {\n if (val) {\n closed.value = false\n closing.value = false\n open()\n rendered.value = true // enables lazy rendering\n zIndex.value = props.zIndex ?? nextZIndex()\n // this.$el.addEventListener('scroll', this.updatePopper)\n nextTick(() => {\n emit('open')\n if (targetRef.value) {\n targetRef.value.parentElement!.scrollTop = 0\n targetRef.value.parentElement!.scrollLeft = 0\n targetRef.value.scrollTop = 0\n }\n })\n } else {\n // this.$el.removeEventListener('scroll', this.updatePopper\n if (visible.value) {\n close()\n }\n }\n }\n )\n\n watch(\n () => props.fullscreen,\n (val) => {\n if (!targetRef.value) return\n if (val) {\n lastPosition = targetRef.value.style.transform\n targetRef.value.style.transform = ''\n } else {\n targetRef.value.style.transform = lastPosition\n }\n }\n )\n\n onMounted(() => {\n if (props.modelValue) {\n visible.value = true\n rendered.value = true // enables lazy rendering\n open()\n }\n })\n\n return {\n afterEnter,\n afterLeave,\n beforeLeave,\n handleClose,\n onModalClick,\n close,\n doClose,\n onOpenAutoFocus,\n onCloseAutoFocus,\n onCloseRequested,\n onFocusoutPrevented,\n bringToFront,\n titleId,\n bodyId,\n closed,\n style,\n overlayDialogStyle,\n rendered,\n visible,\n zIndex,\n transitionConfig,\n _draggable,\n _alignCenter,\n _overflow,\n closing,\n penetrable,\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA+BA,MAAM,iBAAiB;AAEvB,MAAa,aACX,OACA,cACG;CAEH,MAAM,oCAD+B,CACf;CACtB,MAAM,EAAE,eAAeA,2BAAW;CAElC,IAAI,eAAe;CACnB,MAAM,UAAUC,uBAAO;CACvB,MAAM,SAASA,uBAAO;CACtB,MAAM,uBAAc,MAAM;CAC1B,MAAM,sBAAa,MAAM;CACzB,MAAM,wBAAe,MAAM;CAC3B,MAAM,sBAAa,MAAM,UAAU,YAAY,CAAC;CAChD,MAAM,uBAAc,MAAM;CAE1B,IAAI,YAAsC;CAC1C,IAAI,aAAuC;CAE3C,MAAM,SAASC,2CAAiB;CAEhC,MAAM,oCAA2B,OAAO,OAAO,aAAaC,+BAAiB;CAC7E,MAAM,uCAA8B,OAAO,OAAO,OAAO;CAEzD,MAAM,gCAAsC;EAC1C,MAAM,QAAuB,EAAE;EAC/B,MAAM,YAAY,KAAK,UAAU,MAAM;AACvC,MAAI,CAAC,MAAM,YAAY;AACrB,OAAI,MAAM,IACR,OAAM,GAAG,UAAU,gBAAgB,MAAM;GAE3C,MAAM,QAAQC,sBAAQ,MAAM,MAAM;AAClC,OAAI,MACF,OAAM,GAAG,UAAU,WAAW;;AAGlC,SAAO;GACP;CAEF,MAAM,sCAED,MAAM,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AC3C,eAAU,MAAM,cAAe,aAAa;AAC5C,eAAU,MAAM,YAAY;;KAE9B;aAGE,QAAQ,MACV,QAAO;GAId;AAED,sBACQ,MAAM,aACX,QAAQ;AACP,MAAI,CAAC,UAAU,MAAO;AACtB,MAAI,KAAK;AACP,kBAAe,UAAU,MAAM,MAAM;AACrC,aAAU,MAAM,MAAM,YAAY;QAElC,WAAU,MAAM,MAAM,YAAY;GAGvC;AAED,0BAAgB;AACd,MAAI,MAAM,YAAY;AACpB,WAAQ,QAAQ;AAChB,YAAS,QAAQ;AACjB,SAAM;;GAER;AAEF,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
|
|
@@ -147,6 +147,10 @@ interface InputProps {
|
|
|
147
147
|
* @description same as `name` in native input
|
|
148
148
|
*/
|
|
149
149
|
name?: string;
|
|
150
|
+
/**
|
|
151
|
+
* @description Count graphemes of input value. If it's set, native maxlength and minlength won't be used.
|
|
152
|
+
*/
|
|
153
|
+
countGraphemes?: (value: string) => number;
|
|
150
154
|
}
|
|
151
155
|
/**
|
|
152
156
|
* @deprecated Removed after 3.0.0, Use `InputProps` instead.
|
|
@@ -238,6 +242,12 @@ declare const inputProps: {
|
|
|
238
242
|
readonly tabindex: EpPropFinalized<readonly [StringConstructor, NumberConstructor], unknown, unknown, 0, boolean>;
|
|
239
243
|
readonly validateEvent: EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
240
244
|
readonly inputStyle: EpPropFinalized<(new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue) | (((new (...args: any[]) => string | false | vue.CSSProperties | StyleValue[]) | (() => StyleValue)) | null)[], unknown, unknown, () => Mutable<{}>, boolean>;
|
|
245
|
+
readonly countGraphemes: {
|
|
246
|
+
readonly type: vue.PropType<(value: string) => number>;
|
|
247
|
+
readonly required: false;
|
|
248
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
249
|
+
__epPropKey: true;
|
|
250
|
+
};
|
|
241
251
|
readonly autofocus: BooleanConstructor;
|
|
242
252
|
readonly rows: EpPropFinalized<NumberConstructor, unknown, unknown, 2, boolean>;
|
|
243
253
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","names":["buildProps","useSizeProp","definePropType","iconPropType","CircleClose","mutable","useAriaProps","UPDATE_MODEL_EVENT"],"sources":["../../../../../../packages/components/input/src/input.ts"],"sourcesContent":["import { markRaw } from 'vue'\nimport {\n buildProps,\n definePropType,\n iconPropType,\n isString,\n mutable,\n} from '@element-plus/utils'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { useAriaProps, useSizeProp } from '@element-plus/hooks'\nimport { CircleClose } from '@element-plus/icons-vue'\n\nimport type { ExtractPublicPropTypes, HTMLAttributes, StyleValue } from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type { IconPropType } from '@element-plus/utils'\n\nexport type InputModelModifiers = {\n lazy?: true\n number?: true\n trim?: true\n}\nexport type InputAutoSize = { minRows?: number; maxRows?: number } | boolean\n// Some commonly used values for input type\nexport type InputType =\n | 'text'\n | 'textarea'\n | 'number'\n | 'password'\n | 'email'\n | 'search'\n | 'tel'\n | 'url'\n | (string & NonNullable<unknown>)\n\nexport interface InputProps {\n /**\n * @description native input id\n */\n id?: string\n /**\n * @description input box size\n */\n size?: ComponentSize\n /**\n * @description whether to disable\n */\n disabled?: boolean\n /**\n * @description binding value\n */\n modelValue?: string | number | null | undefined\n /**\n * @description v-model modifiers, reference [Vue modifiers](https://vuejs.org/guide/essentials/forms.html#modifiers)\n */\n modelModifiers?: InputModelModifiers\n /**\n * @description same as `maxlength` in native input\n */\n maxlength?: string | number\n /**\n * @description same as `minlength` in native input\n */\n minlength?: string | number\n /**\n * @description type of input, see more in [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types)\n */\n type?: InputType\n /**\n * @description control the resizability\n */\n resize?: 'none' | 'both' | 'horizontal' | 'vertical'\n /**\n * @description whether textarea has an adaptive height\n */\n autosize?: InputAutoSize\n /**\n * @description native input autocomplete\n * - When the number of literal types in a union exceeds 315, the TS2590 error occurs. see: https://github.com/vuejs/core/issues/10514\n */\n autocomplete?: string // HTMLInputElement['autocomplete']\n /**\n * @description format content\n */\n formatter?: (value: string) => string\n /**\n * @description parse content\n */\n parser?: (value: string) => string\n /**\n * @description placeholder\n */\n placeholder?: string\n /**\n * @description native input form\n */\n form?: string\n /**\n * @description native input readonly\n */\n readonly?: boolean\n /**\n * @description whether to show clear button\n */\n clearable?: boolean\n /**\n * @description custom clear icon component\n */\n clearIcon?: IconPropType\n /**\n * @description toggleable password input\n */\n showPassword?: boolean\n /**\n * @description word count\n */\n showWordLimit?: boolean\n /**\n * @description word count position, valid when `show-word-limit` is true\n */\n wordLimitPosition?: 'inside' | 'outside'\n /**\n * @description suffix icon\n */\n suffixIcon?: IconPropType\n /**\n * @description prefix icon\n */\n prefixIcon?: IconPropType\n /**\n * @description container role, internal properties provided for use by the picker component\n */\n containerRole?: string\n /**\n * @description input tabindex\n */\n tabindex?: string | number\n /**\n * @description whether to trigger form validation\n */\n validateEvent?: boolean\n /**\n * @description input or textarea element style\n */\n inputStyle?: StyleValue\n /**\n * @description native input autofocus\n */\n autofocus?: boolean\n /**\n * @description number of rows of textarea, only works when `type` is 'textarea'\n */\n rows?: number\n /**\n * @description native `aria-label` attribute\n */\n ariaLabel?: string\n /**\n * @description native input mode for virtual keyboards\n */\n inputmode?: HTMLAttributes['inputmode']\n /**\n * @description same as `name` in native input\n */\n name?: string\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `InputProps` instead.\n */\nexport const inputProps = buildProps({\n /**\n * @description native input id\n */\n id: {\n type: String,\n default: undefined,\n },\n /**\n * @description input box size\n */\n size: useSizeProp,\n /**\n * @description whether to disable\n */\n disabled: {\n type: Boolean,\n default: undefined,\n },\n /**\n * @description binding value\n */\n modelValue: {\n type: definePropType<string | number | null | undefined>([\n String,\n Number,\n Object,\n ]),\n default: '',\n },\n /**\n * @description v-model modifiers, reference [Vue modifiers](https://vuejs.org/guide/essentials/forms.html#modifiers)\n */\n modelModifiers: {\n type: definePropType<InputModelModifiers>(Object),\n default: () => ({}),\n },\n /**\n * @description same as `maxlength` in native input\n */\n maxlength: {\n type: [String, Number],\n },\n /**\n * @description same as `minlength` in native input\n */\n minlength: {\n type: [String, Number],\n },\n /**\n * @description type of input, see more in [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types)\n */\n type: {\n type: definePropType<InputType>(String),\n default: 'text',\n },\n /**\n * @description control the resizability\n */\n resize: {\n type: String,\n values: ['none', 'both', 'horizontal', 'vertical'],\n },\n /**\n * @description whether textarea has an adaptive height\n */\n autosize: {\n type: definePropType<InputAutoSize>([Boolean, Object]),\n default: false,\n },\n /**\n * @description native input autocomplete\n */\n autocomplete: {\n type: definePropType<HTMLInputElement['autocomplete']>(String),\n default: 'off',\n },\n /**\n * @description format content\n */\n formatter: {\n type: Function,\n },\n /**\n * @description parse content\n */\n parser: {\n type: Function,\n },\n /**\n * @description placeholder\n */\n placeholder: {\n type: String,\n },\n /**\n * @description native input form\n */\n form: {\n type: String,\n },\n /**\n * @description native input readonly\n */\n readonly: Boolean,\n /**\n * @description whether to show clear button\n */\n clearable: Boolean,\n /**\n * @description custom clear icon component\n */\n clearIcon: {\n type: iconPropType,\n default: CircleClose,\n },\n /**\n * @description toggleable password input\n */\n showPassword: Boolean,\n /**\n * @description word count\n */\n showWordLimit: Boolean,\n /**\n * @description word count position, valid when `show-word-limit` is true\n */\n wordLimitPosition: {\n type: String,\n values: ['inside', 'outside'],\n default: 'inside',\n },\n /**\n * @description suffix icon\n */\n suffixIcon: {\n type: iconPropType,\n },\n /**\n * @description prefix icon\n */\n prefixIcon: {\n type: iconPropType,\n },\n /**\n * @description container role, internal properties provided for use by the picker component\n */\n containerRole: {\n type: String,\n default: undefined,\n },\n /**\n * @description input tabindex\n */\n tabindex: {\n type: [String, Number],\n default: 0,\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description input or textarea element style\n */\n inputStyle: {\n type: definePropType<StyleValue>([Object, Array, String]),\n default: () => mutable({} as const),\n },\n /**\n * @description native input autofocus\n */\n autofocus: Boolean,\n rows: {\n type: Number,\n default: 2,\n },\n ...useAriaProps(['ariaLabel']),\n /**\n * @description native input mode for virtual keyboards\n */\n inputmode: {\n type: definePropType<HTMLAttributes['inputmode']>(String),\n default: undefined,\n },\n /**\n * @description same as `name` in native input\n */\n name: String,\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `InputProps` instead.\n */\nexport type InputPropsPublic = ExtractPublicPropTypes<typeof inputProps>\n\nexport const inputEmits = {\n [UPDATE_MODEL_EVENT]: (value: string) => isString(value),\n input: (value: string) => isString(value),\n change: (value: string, evt?: Event) =>\n isString(value) && (evt instanceof Event || evt === undefined),\n focus: (evt: FocusEvent) => evt instanceof FocusEvent,\n blur: (evt: FocusEvent) => evt instanceof FocusEvent,\n clear: (evt: MouseEvent | undefined) =>\n evt === undefined || evt instanceof MouseEvent,\n mouseleave: (evt: MouseEvent) => evt instanceof MouseEvent,\n mouseenter: (evt: MouseEvent) => evt instanceof MouseEvent,\n // NOTE: when autofill by browser, the keydown event is instanceof Event, not KeyboardEvent\n // relative bug report https://github.com/element-plus/element-plus/issues/6665\n keydown: (evt: KeyboardEvent | Event) => evt instanceof Event,\n compositionstart: (evt: CompositionEvent) => evt instanceof CompositionEvent,\n compositionupdate: (evt: CompositionEvent) => evt instanceof CompositionEvent,\n compositionend: (evt: CompositionEvent) => evt instanceof CompositionEvent,\n}\nexport type InputEmits = typeof inputEmits\n\n/**\n * @description default values for InputProps, used in components that extend InputProps like Autocomplete\n */\nexport const inputPropsDefaults = {\n disabled: undefined,\n modelValue: '',\n modelModifiers: () => ({}),\n type: 'text' as InputType,\n autocomplete: 'off',\n clearIcon: markRaw(CircleClose),\n wordLimitPosition: 'inside',\n tabindex: 0,\n validateEvent: true,\n inputStyle: () => ({}),\n rows: 2,\n} as const\n"],"mappings":";;;;;;;;;;;;;;;;AAyKA,MAAa,aAAaA,6BAAW;CAInC,IAAI;EACF,MAAM;EACN,SAAS;EACV;CAID,MAAMC;CAIN,UAAU;EACR,MAAM;EACN,SAAS;EACV;CAID,YAAY;EACV,MAAMC,iCAAmD;GACvD;GACA;GACA;GACD,CAAC;EACF,SAAS;EACV;CAID,gBAAgB;EACd,MAAMA,iCAAoC,OAAO;EACjD,gBAAgB,EAAE;EACnB;CAID,WAAW,EACT,MAAM,CAAC,QAAQ,OAAO,EACvB;CAID,WAAW,EACT,MAAM,CAAC,QAAQ,OAAO,EACvB;CAID,MAAM;EACJ,MAAMA,iCAA0B,OAAO;EACvC,SAAS;EACV;CAID,QAAQ;EACN,MAAM;EACN,QAAQ;GAAC;GAAQ;GAAQ;GAAc;GAAW;EACnD;CAID,UAAU;EACR,MAAMA,iCAA8B,CAAC,SAAS,OAAO,CAAC;EACtD,SAAS;EACV;CAID,cAAc;EACZ,MAAMA,iCAAiD,OAAO;EAC9D,SAAS;EACV;CAID,WAAW,EACT,MAAM,UACP;CAID,QAAQ,EACN,MAAM,UACP;CAID,aAAa,EACX,MAAM,QACP;CAID,MAAM,EACJ,MAAM,QACP;CAID,UAAU;CAIV,WAAW;CAIX,WAAW;EACT,MAAMC;EACN,SAASC;EACV;CAID,cAAc;CAId,eAAe;CAIf,mBAAmB;EACjB,MAAM;EACN,QAAQ,CAAC,UAAU,UAAU;EAC7B,SAAS;EACV;CAID,YAAY,EACV,MAAMD,2BACP;CAID,YAAY,EACV,MAAMA,2BACP;CAID,eAAe;EACb,MAAM;EACN,SAAS;EACV;CAID,UAAU;EACR,MAAM,CAAC,QAAQ,OAAO;EACtB,SAAS;EACV;CAID,eAAe;EACb,MAAM;EACN,SAAS;EACV;CAID,YAAY;EACV,MAAMD,iCAA2B;GAAC;GAAQ;GAAO;GAAO,CAAC;EACzD,eAAeG,2BAAQ,EAAE,CAAU;EACpC;CAID,WAAW;CACX,MAAM;EACJ,MAAM;EACN,SAAS;EACV;CACD,GAAGC,6BAAa,CAAC,YAAY,CAAC;CAI9B,WAAW;EACT,MAAMJ,iCAA4C,OAAO;EACzD,SAAS;EACV;CAID,MAAM;CACP,CAAU;AAOX,MAAa,aAAa;EACvBK,oCAAsB,oCAA2B,MAAM;CACxD,QAAQ,oCAA2B,MAAM;CACzC,SAAS,OAAe,kCACb,MAAM,KAAK,eAAe,SAAS,QAAQ;CACtD,QAAQ,QAAoB,eAAe;CAC3C,OAAO,QAAoB,eAAe;CAC1C,QAAQ,QACN,QAAQ,UAAa,eAAe;CACtC,aAAa,QAAoB,eAAe;CAChD,aAAa,QAAoB,eAAe;CAGhD,UAAU,QAA+B,eAAe;CACxD,mBAAmB,QAA0B,eAAe;CAC5D,oBAAoB,QAA0B,eAAe;CAC7D,iBAAiB,QAA0B,eAAe;CAC3D;;;;AAMD,MAAa,qBAAqB;CAChC,UAAU;CACV,YAAY;CACZ,uBAAuB,EAAE;CACzB,MAAM;CACN,cAAc;CACd,4BAAmBH,oCAAY;CAC/B,mBAAmB;CACnB,UAAU;CACV,eAAe;CACf,mBAAmB,EAAE;CACrB,MAAM;CACP"}
|
|
1
|
+
{"version":3,"file":"input.js","names":["buildProps","useSizeProp","definePropType","iconPropType","CircleClose","mutable","useAriaProps","UPDATE_MODEL_EVENT"],"sources":["../../../../../../packages/components/input/src/input.ts"],"sourcesContent":["import { markRaw } from 'vue'\nimport {\n buildProps,\n definePropType,\n iconPropType,\n isString,\n mutable,\n} from '@element-plus/utils'\nimport { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { useAriaProps, useSizeProp } from '@element-plus/hooks'\nimport { CircleClose } from '@element-plus/icons-vue'\n\nimport type { ExtractPublicPropTypes, HTMLAttributes, StyleValue } from 'vue'\nimport type { ComponentSize } from '@element-plus/constants'\nimport type { IconPropType } from '@element-plus/utils'\n\nexport type InputModelModifiers = {\n lazy?: true\n number?: true\n trim?: true\n}\nexport type InputAutoSize = { minRows?: number; maxRows?: number } | boolean\n// Some commonly used values for input type\nexport type InputType =\n | 'text'\n | 'textarea'\n | 'number'\n | 'password'\n | 'email'\n | 'search'\n | 'tel'\n | 'url'\n | (string & NonNullable<unknown>)\n\nexport interface InputProps {\n /**\n * @description native input id\n */\n id?: string\n /**\n * @description input box size\n */\n size?: ComponentSize\n /**\n * @description whether to disable\n */\n disabled?: boolean\n /**\n * @description binding value\n */\n modelValue?: string | number | null | undefined\n /**\n * @description v-model modifiers, reference [Vue modifiers](https://vuejs.org/guide/essentials/forms.html#modifiers)\n */\n modelModifiers?: InputModelModifiers\n /**\n * @description same as `maxlength` in native input\n */\n maxlength?: string | number\n /**\n * @description same as `minlength` in native input\n */\n minlength?: string | number\n /**\n * @description type of input, see more in [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types)\n */\n type?: InputType\n /**\n * @description control the resizability\n */\n resize?: 'none' | 'both' | 'horizontal' | 'vertical'\n /**\n * @description whether textarea has an adaptive height\n */\n autosize?: InputAutoSize\n /**\n * @description native input autocomplete\n * - When the number of literal types in a union exceeds 315, the TS2590 error occurs. see: https://github.com/vuejs/core/issues/10514\n */\n autocomplete?: string // HTMLInputElement['autocomplete']\n /**\n * @description format content\n */\n formatter?: (value: string) => string\n /**\n * @description parse content\n */\n parser?: (value: string) => string\n /**\n * @description placeholder\n */\n placeholder?: string\n /**\n * @description native input form\n */\n form?: string\n /**\n * @description native input readonly\n */\n readonly?: boolean\n /**\n * @description whether to show clear button\n */\n clearable?: boolean\n /**\n * @description custom clear icon component\n */\n clearIcon?: IconPropType\n /**\n * @description toggleable password input\n */\n showPassword?: boolean\n /**\n * @description word count\n */\n showWordLimit?: boolean\n /**\n * @description word count position, valid when `show-word-limit` is true\n */\n wordLimitPosition?: 'inside' | 'outside'\n /**\n * @description suffix icon\n */\n suffixIcon?: IconPropType\n /**\n * @description prefix icon\n */\n prefixIcon?: IconPropType\n /**\n * @description container role, internal properties provided for use by the picker component\n */\n containerRole?: string\n /**\n * @description input tabindex\n */\n tabindex?: string | number\n /**\n * @description whether to trigger form validation\n */\n validateEvent?: boolean\n /**\n * @description input or textarea element style\n */\n inputStyle?: StyleValue\n /**\n * @description native input autofocus\n */\n autofocus?: boolean\n /**\n * @description number of rows of textarea, only works when `type` is 'textarea'\n */\n rows?: number\n /**\n * @description native `aria-label` attribute\n */\n ariaLabel?: string\n /**\n * @description native input mode for virtual keyboards\n */\n inputmode?: HTMLAttributes['inputmode']\n /**\n * @description same as `name` in native input\n */\n name?: string\n /**\n * @description Count graphemes of input value. If it's set, native maxlength and minlength won't be used.\n */\n countGraphemes?: (value: string) => number\n}\n\n/**\n * @deprecated Removed after 3.0.0, Use `InputProps` instead.\n */\nexport const inputProps = buildProps({\n /**\n * @description native input id\n */\n id: {\n type: String,\n default: undefined,\n },\n /**\n * @description input box size\n */\n size: useSizeProp,\n /**\n * @description whether to disable\n */\n disabled: {\n type: Boolean,\n default: undefined,\n },\n /**\n * @description binding value\n */\n modelValue: {\n type: definePropType<string | number | null | undefined>([\n String,\n Number,\n Object,\n ]),\n default: '',\n },\n /**\n * @description v-model modifiers, reference [Vue modifiers](https://vuejs.org/guide/essentials/forms.html#modifiers)\n */\n modelModifiers: {\n type: definePropType<InputModelModifiers>(Object),\n default: () => ({}),\n },\n /**\n * @description same as `maxlength` in native input\n */\n maxlength: {\n type: [String, Number],\n },\n /**\n * @description same as `minlength` in native input\n */\n minlength: {\n type: [String, Number],\n },\n /**\n * @description type of input, see more in [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types)\n */\n type: {\n type: definePropType<InputType>(String),\n default: 'text',\n },\n /**\n * @description control the resizability\n */\n resize: {\n type: String,\n values: ['none', 'both', 'horizontal', 'vertical'],\n },\n /**\n * @description whether textarea has an adaptive height\n */\n autosize: {\n type: definePropType<InputAutoSize>([Boolean, Object]),\n default: false,\n },\n /**\n * @description native input autocomplete\n */\n autocomplete: {\n type: definePropType<HTMLInputElement['autocomplete']>(String),\n default: 'off',\n },\n /**\n * @description format content\n */\n formatter: {\n type: Function,\n },\n /**\n * @description parse content\n */\n parser: {\n type: Function,\n },\n /**\n * @description placeholder\n */\n placeholder: {\n type: String,\n },\n /**\n * @description native input form\n */\n form: {\n type: String,\n },\n /**\n * @description native input readonly\n */\n readonly: Boolean,\n /**\n * @description whether to show clear button\n */\n clearable: Boolean,\n /**\n * @description custom clear icon component\n */\n clearIcon: {\n type: iconPropType,\n default: CircleClose,\n },\n /**\n * @description toggleable password input\n */\n showPassword: Boolean,\n /**\n * @description word count\n */\n showWordLimit: Boolean,\n /**\n * @description word count position, valid when `show-word-limit` is true\n */\n wordLimitPosition: {\n type: String,\n values: ['inside', 'outside'],\n default: 'inside',\n },\n /**\n * @description suffix icon\n */\n suffixIcon: {\n type: iconPropType,\n },\n /**\n * @description prefix icon\n */\n prefixIcon: {\n type: iconPropType,\n },\n /**\n * @description container role, internal properties provided for use by the picker component\n */\n containerRole: {\n type: String,\n default: undefined,\n },\n /**\n * @description input tabindex\n */\n tabindex: {\n type: [String, Number],\n default: 0,\n },\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n /**\n * @description input or textarea element style\n */\n inputStyle: {\n type: definePropType<StyleValue>([Object, Array, String]),\n default: () => mutable({} as const),\n },\n /**\n * @description Count graphemes of input value. If it's set, native maxlength and minlength won't be used.\n */\n countGraphemes: {\n type: definePropType<(value: string) => number>(Function),\n },\n /**\n * @description native input autofocus\n */\n autofocus: Boolean,\n rows: {\n type: Number,\n default: 2,\n },\n ...useAriaProps(['ariaLabel']),\n /**\n * @description native input mode for virtual keyboards\n */\n inputmode: {\n type: definePropType<HTMLAttributes['inputmode']>(String),\n default: undefined,\n },\n /**\n * @description same as `name` in native input\n */\n name: String,\n} as const)\n\n/**\n * @deprecated Removed after 3.0.0, Use `InputProps` instead.\n */\nexport type InputPropsPublic = ExtractPublicPropTypes<typeof inputProps>\n\nexport const inputEmits = {\n [UPDATE_MODEL_EVENT]: (value: string) => isString(value),\n input: (value: string) => isString(value),\n change: (value: string, evt?: Event) =>\n isString(value) && (evt instanceof Event || evt === undefined),\n focus: (evt: FocusEvent) => evt instanceof FocusEvent,\n blur: (evt: FocusEvent) => evt instanceof FocusEvent,\n clear: (evt: MouseEvent | undefined) =>\n evt === undefined || evt instanceof MouseEvent,\n mouseleave: (evt: MouseEvent) => evt instanceof MouseEvent,\n mouseenter: (evt: MouseEvent) => evt instanceof MouseEvent,\n // NOTE: when autofill by browser, the keydown event is instanceof Event, not KeyboardEvent\n // relative bug report https://github.com/element-plus/element-plus/issues/6665\n keydown: (evt: KeyboardEvent | Event) => evt instanceof Event,\n compositionstart: (evt: CompositionEvent) => evt instanceof CompositionEvent,\n compositionupdate: (evt: CompositionEvent) => evt instanceof CompositionEvent,\n compositionend: (evt: CompositionEvent) => evt instanceof CompositionEvent,\n}\nexport type InputEmits = typeof inputEmits\n\n/**\n * @description default values for InputProps, used in components that extend InputProps like Autocomplete\n */\nexport const inputPropsDefaults = {\n disabled: undefined,\n modelValue: '',\n modelModifiers: () => ({}),\n type: 'text' as InputType,\n autocomplete: 'off',\n clearIcon: markRaw(CircleClose),\n wordLimitPosition: 'inside',\n tabindex: 0,\n validateEvent: true,\n inputStyle: () => ({}),\n rows: 2,\n} as const\n"],"mappings":";;;;;;;;;;;;;;;;AA6KA,MAAa,aAAaA,6BAAW;CAInC,IAAI;EACF,MAAM;EACN,SAAS;EACV;CAID,MAAMC;CAIN,UAAU;EACR,MAAM;EACN,SAAS;EACV;CAID,YAAY;EACV,MAAMC,iCAAmD;GACvD;GACA;GACA;GACD,CAAC;EACF,SAAS;EACV;CAID,gBAAgB;EACd,MAAMA,iCAAoC,OAAO;EACjD,gBA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e,kCACb,MAAM,KAAK,eAAe,SAAS,QAAQ;CACtD,QAAQ,QAAoB,eAAe;CAC3C,OAAO,QAAoB,eAAe;CAC1C,QAAQ,QACN,QAAQ,UAAa,eAAe;CACtC,aAAa,QAAoB,eAAe;CAChD,aAAa,QAAoB,eAAe;CAGhD,UAAU,QAA+B,eAAe;CACxD,mBAAmB,QAA0B,eAAe;CAC5D,oBAAoB,QAA0B,eAAe;CAC7D,iBAAiB,QAA0B,eAAe;CAC3D;;;;AAMD,MAAa,qBAAqB;CAChC,UAAU;CACV,YAAY;CACZ,uBAAuB,EAAE;CACzB,MAAM;CACN,cAAc;CACd,4BAAmBH,oCAAY;CAC/B,mBAAmB;CACnB,UAAU;CACV,eAAe;CACf,mBAAmB,EAAE;CACrB,MAAM;CACP"}
|
|
@@ -64,7 +64,6 @@ var input_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.
|
|
|
64
64
|
const props = __props;
|
|
65
65
|
const emit = __emit;
|
|
66
66
|
const rawAttrs = (0, vue.useAttrs)();
|
|
67
|
-
const attrs = require_index.useAttrs();
|
|
68
67
|
const slots = (0, vue.useSlots)();
|
|
69
68
|
const containerKls = (0, vue.computed)(() => [
|
|
70
69
|
props.type === "textarea" ? nsTextarea.b() : nsInput.b(),
|
|
@@ -81,6 +80,8 @@ var input_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.
|
|
|
81
80
|
rawAttrs.class
|
|
82
81
|
]);
|
|
83
82
|
const wrapperKls = (0, vue.computed)(() => [nsInput.e("wrapper"), nsInput.is("focus", isFocused.value)]);
|
|
83
|
+
const attrs = require_index.useAttrs();
|
|
84
|
+
const maxlength = (0, vue.computed)(() => props.maxlength?.toString());
|
|
84
85
|
const { form: elForm, formItem: elFormItem } = require_use_form_item.useFormItem();
|
|
85
86
|
const { inputId } = require_use_form_item.useFormItemInputId(props, { formItemContext: elFormItem });
|
|
86
87
|
const inputSize = require_use_form_common_props.useFormSize();
|
|
@@ -93,6 +94,7 @@ var input_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.
|
|
|
93
94
|
const passwordVisible = (0, vue.ref)(false);
|
|
94
95
|
const countStyle = (0, vue.ref)();
|
|
95
96
|
const textareaCalcStyle = (0, vue.shallowRef)(props.inputStyle);
|
|
97
|
+
const saveValue = (0, vue.ref)("");
|
|
96
98
|
const _ref = (0, vue.computed)(() => input.value || textarea.value);
|
|
97
99
|
const { wrapperRef, isFocused, handleFocus, handleBlur } = require_index$3.useFocusController(_ref, {
|
|
98
100
|
disabled: inputDisabled,
|
|
@@ -113,9 +115,12 @@ var input_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.
|
|
|
113
115
|
const nativeInputValue = (0, vue.computed)(() => (0, lodash_unified.isNil)(props.modelValue) ? "" : String(props.modelValue));
|
|
114
116
|
const showClear = (0, vue.computed)(() => props.clearable && !inputDisabled.value && !props.readonly && !!nativeInputValue.value && (isFocused.value || hovering.value));
|
|
115
117
|
const showPwdVisible = (0, vue.computed)(() => props.showPassword && !inputDisabled.value && !!nativeInputValue.value);
|
|
116
|
-
const isWordLimitVisible = (0, vue.computed)(() => props.showWordLimit && !!
|
|
117
|
-
const textLength = (0, vue.computed)(() =>
|
|
118
|
-
|
|
118
|
+
const isWordLimitVisible = (0, vue.computed)(() => props.showWordLimit && !!maxlength.value && (props.type === "text" || props.type === "textarea") && !inputDisabled.value && !props.readonly && !props.showPassword);
|
|
119
|
+
const textLength = (0, vue.computed)(() => {
|
|
120
|
+
if (props.countGraphemes && props.showWordLimit) return props.countGraphemes(nativeInputValue.value);
|
|
121
|
+
return nativeInputValue.value.length;
|
|
122
|
+
});
|
|
123
|
+
const inputExceed = (0, vue.computed)(() => !!isWordLimitVisible.value && textLength.value > Number(maxlength.value));
|
|
119
124
|
const suffixVisible = (0, vue.computed)(() => !!slots.suffix || !!props.suffixIcon || showClear.value || props.showPassword || isWordLimitVisible.value || !!validateState.value && needStatusIcon.value);
|
|
120
125
|
const hasModelModifiers = (0, vue.computed)(() => !!Object.keys(props.modelModifiers).length);
|
|
121
126
|
const [recordCursor, setCursor] = require_index$2.useCursor(input);
|
|
@@ -170,15 +175,71 @@ var input_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.
|
|
|
170
175
|
if (isComposing.value) return;
|
|
171
176
|
const { lazy } = props.modelModifiers;
|
|
172
177
|
let { value } = event.target;
|
|
178
|
+
let shouldForceNativeUpdate = false;
|
|
173
179
|
if (lazy) {
|
|
174
180
|
emit(require_event.INPUT_EVENT, value);
|
|
175
181
|
return;
|
|
176
182
|
}
|
|
177
183
|
value = formatValue(value);
|
|
184
|
+
if (props.countGraphemes && maxlength.value != null) {
|
|
185
|
+
const limit = Number(maxlength.value);
|
|
186
|
+
const graphemes = props.countGraphemes(value);
|
|
187
|
+
const saveGraphemes = props.countGraphemes(saveValue.value);
|
|
188
|
+
if (graphemes > limit && graphemes > saveGraphemes) if (saveGraphemes > limit) {
|
|
189
|
+
value = saveValue.value;
|
|
190
|
+
shouldForceNativeUpdate = true;
|
|
191
|
+
} else {
|
|
192
|
+
const prevValue = saveValue.value;
|
|
193
|
+
const nextValue = value;
|
|
194
|
+
let prefixLen = 0;
|
|
195
|
+
while (prefixLen < prevValue.length && prefixLen < nextValue.length && prevValue[prefixLen] === nextValue[prefixLen]) prefixLen++;
|
|
196
|
+
let prevSuffixIndex = prevValue.length;
|
|
197
|
+
let nextSuffixIndex = nextValue.length;
|
|
198
|
+
while (prevSuffixIndex > prefixLen && nextSuffixIndex > prefixLen && prevValue[prevSuffixIndex - 1] === nextValue[nextSuffixIndex - 1]) {
|
|
199
|
+
prevSuffixIndex--;
|
|
200
|
+
nextSuffixIndex--;
|
|
201
|
+
}
|
|
202
|
+
const before = nextValue.slice(0, prefixLen);
|
|
203
|
+
const removed = prevValue.slice(prefixLen, prevSuffixIndex);
|
|
204
|
+
const inserted = nextValue.slice(prefixLen, nextSuffixIndex);
|
|
205
|
+
const after = nextValue.slice(nextSuffixIndex);
|
|
206
|
+
const baseCount = saveGraphemes - props.countGraphemes(removed);
|
|
207
|
+
const availableInserted = Math.max(0, limit - baseCount);
|
|
208
|
+
let acceptedInserted = "";
|
|
209
|
+
if (availableInserted > 0) if (typeof Intl !== "undefined" && "Segmenter" in Intl) {
|
|
210
|
+
const segmenter = new Intl.Segmenter(void 0, { granularity: "grapheme" });
|
|
211
|
+
for (const { segment } of segmenter.segment(inserted)) {
|
|
212
|
+
const candidate = acceptedInserted + segment;
|
|
213
|
+
if (props.countGraphemes(candidate) > availableInserted) break;
|
|
214
|
+
acceptedInserted = candidate;
|
|
215
|
+
}
|
|
216
|
+
} else for (const char of Array.from(inserted)) {
|
|
217
|
+
const candidate = acceptedInserted + char;
|
|
218
|
+
if (props.countGraphemes(candidate) > availableInserted) break;
|
|
219
|
+
acceptedInserted = candidate;
|
|
220
|
+
}
|
|
221
|
+
value = before + acceptedInserted + after;
|
|
222
|
+
shouldForceNativeUpdate = true;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
178
225
|
if (String(value) === nativeInputValue.value) {
|
|
179
|
-
if (props.formatter)
|
|
226
|
+
if (props.formatter || shouldForceNativeUpdate) {
|
|
227
|
+
const target = event.target;
|
|
228
|
+
const blockedValue = target.value;
|
|
229
|
+
const selectionStart = target.selectionStart;
|
|
230
|
+
const selectionEnd = target.selectionEnd;
|
|
231
|
+
setNativeInputValue();
|
|
232
|
+
if (shouldForceNativeUpdate && _ref.value && selectionStart != null && selectionEnd != null) {
|
|
233
|
+
const restoredValue = _ref.value.value;
|
|
234
|
+
const afterTxt = blockedValue.slice(Math.max(0, selectionEnd));
|
|
235
|
+
let caretPos = Math.min(selectionStart, restoredValue.length);
|
|
236
|
+
if (afterTxt && restoredValue.endsWith(afterTxt)) caretPos = restoredValue.length - afterTxt.length;
|
|
237
|
+
_ref.value.setSelectionRange(caretPos, caretPos);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
180
240
|
return;
|
|
181
241
|
}
|
|
242
|
+
saveValue.value = value;
|
|
182
243
|
recordCursor();
|
|
183
244
|
emit(require_event.UPDATE_MODEL_EVENT, value);
|
|
184
245
|
emit(require_event.INPUT_EVENT, value);
|
|
@@ -227,6 +288,9 @@ var input_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.
|
|
|
227
288
|
(0, vue.nextTick)(() => resizeTextarea());
|
|
228
289
|
if (props.validateEvent) elFormItem?.validate?.("change").catch((err) => require_error.debugWarn(err));
|
|
229
290
|
});
|
|
291
|
+
(0, vue.watch)(() => nativeInputValue.value, (val) => {
|
|
292
|
+
saveValue.value = val;
|
|
293
|
+
}, { immediate: true });
|
|
230
294
|
(0, vue.watch)(nativeInputValue, (newValue) => {
|
|
231
295
|
if (!_ref.value) return;
|
|
232
296
|
const { trim, number } = props.modelModifiers;
|
|
@@ -299,8 +363,8 @@ var input_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.
|
|
|
299
363
|
class: (0, vue.unref)(nsInput).e("inner")
|
|
300
364
|
}, (0, vue.unref)(attrs), {
|
|
301
365
|
name: __props.name,
|
|
302
|
-
minlength: __props.minlength,
|
|
303
|
-
maxlength: __props.maxlength,
|
|
366
|
+
minlength: __props.countGraphemes ? void 0 : __props.minlength,
|
|
367
|
+
maxlength: __props.countGraphemes ? void 0 : maxlength.value,
|
|
304
368
|
type: __props.showPassword ? passwordVisible.value ? "text" : "password" : __props.type,
|
|
305
369
|
disabled: (0, vue.unref)(inputDisabled),
|
|
306
370
|
readonly: __props.readonly,
|
|
@@ -358,7 +422,7 @@ var input_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.
|
|
|
358
422
|
isWordLimitVisible.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("span", {
|
|
359
423
|
key: 3,
|
|
360
424
|
class: (0, vue.normalizeClass)([(0, vue.unref)(nsInput).e("count"), (0, vue.unref)(nsInput).is("outside", __props.wordLimitPosition === "outside")])
|
|
361
|
-
}, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(nsInput).e("count-inner")) }, (0, vue.toDisplayString)(textLength.value) + " / " + (0, vue.toDisplayString)(
|
|
425
|
+
}, [(0, vue.createElementVNode)("span", { class: (0, vue.normalizeClass)((0, vue.unref)(nsInput).e("count-inner")) }, (0, vue.toDisplayString)(textLength.value) + " / " + (0, vue.toDisplayString)(maxlength.value), 3)], 2)) : (0, vue.createCommentVNode)("v-if", true),
|
|
362
426
|
validateState.value && validateIcon.value && needStatusIcon.value ? ((0, vue.openBlock)(), (0, vue.createBlock)((0, vue.unref)(require_index$5.ElIcon), {
|
|
363
427
|
key: 4,
|
|
364
428
|
class: (0, vue.normalizeClass)([
|
|
@@ -390,8 +454,8 @@ var input_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.
|
|
|
390
454
|
]
|
|
391
455
|
}, (0, vue.unref)(attrs), {
|
|
392
456
|
name: __props.name,
|
|
393
|
-
minlength: __props.minlength,
|
|
394
|
-
maxlength: __props.maxlength,
|
|
457
|
+
minlength: __props.countGraphemes ? void 0 : __props.minlength,
|
|
458
|
+
maxlength: __props.countGraphemes ? void 0 : maxlength.value,
|
|
395
459
|
tabindex: __props.tabindex,
|
|
396
460
|
disabled: (0, vue.unref)(inputDisabled),
|
|
397
461
|
readonly: __props.readonly,
|
|
@@ -426,7 +490,7 @@ var input_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ (0, vue.
|
|
|
426
490
|
key: 1,
|
|
427
491
|
style: (0, vue.normalizeStyle)(countStyle.value),
|
|
428
492
|
class: (0, vue.normalizeClass)([(0, vue.unref)(nsInput).e("count"), (0, vue.unref)(nsInput).is("outside", __props.wordLimitPosition === "outside")])
|
|
429
|
-
}, (0, vue.toDisplayString)(textLength.value) + " / " + (0, vue.toDisplayString)(
|
|
493
|
+
}, (0, vue.toDisplayString)(textLength.value) + " / " + (0, vue.toDisplayString)(maxlength.value), 7)) : (0, vue.createCommentVNode)("v-if", true)
|
|
430
494
|
], 64))], 38);
|
|
431
495
|
};
|
|
432
496
|
}
|