@vue/runtime-dom 3.2.33 → 3.2.34-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/runtime-dom.cjs.js +15 -11
- package/dist/runtime-dom.cjs.prod.js +15 -11
- package/dist/runtime-dom.d.ts +5 -2
- package/dist/runtime-dom.esm-browser.js +3880 -3832
- package/dist/runtime-dom.esm-browser.prod.js +1 -1
- package/dist/runtime-dom.esm-bundler.js +15 -11
- package/dist/runtime-dom.global.js +3880 -3832
- package/dist/runtime-dom.global.prod.js +1 -1
- package/package.json +3 -3
package/dist/runtime-dom.cjs.js
CHANGED
|
@@ -467,11 +467,11 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
467
467
|
return key in el;
|
|
468
468
|
}
|
|
469
469
|
|
|
470
|
-
function defineCustomElement(options,
|
|
470
|
+
function defineCustomElement(options, hydrate) {
|
|
471
471
|
const Comp = runtimeCore.defineComponent(options);
|
|
472
472
|
class VueCustomElement extends VueElement {
|
|
473
473
|
constructor(initialProps) {
|
|
474
|
-
super(Comp, initialProps,
|
|
474
|
+
super(Comp, initialProps, hydrate);
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
477
|
VueCustomElement.def = Comp;
|
|
@@ -781,7 +781,10 @@ function resolveTransitionProps(rawProps) {
|
|
|
781
781
|
removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
|
|
782
782
|
done && done();
|
|
783
783
|
};
|
|
784
|
+
let isLeaving = false;
|
|
784
785
|
const finishLeave = (el, done) => {
|
|
786
|
+
isLeaving = false;
|
|
787
|
+
removeTransitionClass(el, leaveFromClass);
|
|
785
788
|
removeTransitionClass(el, leaveToClass);
|
|
786
789
|
removeTransitionClass(el, leaveActiveClass);
|
|
787
790
|
done && done();
|
|
@@ -814,12 +817,17 @@ function resolveTransitionProps(rawProps) {
|
|
|
814
817
|
onEnter: makeEnterHook(false),
|
|
815
818
|
onAppear: makeEnterHook(true),
|
|
816
819
|
onLeave(el, done) {
|
|
820
|
+
isLeaving = true;
|
|
817
821
|
const resolve = () => finishLeave(el, done);
|
|
818
822
|
addTransitionClass(el, leaveFromClass);
|
|
819
823
|
// force reflow so *-leave-from classes immediately take effect (#2593)
|
|
820
824
|
forceReflow();
|
|
821
825
|
addTransitionClass(el, leaveActiveClass);
|
|
822
826
|
nextFrame(() => {
|
|
827
|
+
if (!isLeaving) {
|
|
828
|
+
// cancelled
|
|
829
|
+
return;
|
|
830
|
+
}
|
|
823
831
|
removeTransitionClass(el, leaveFromClass);
|
|
824
832
|
addTransitionClass(el, leaveToClass);
|
|
825
833
|
if (!hasExplicitCallback(onLeave)) {
|
|
@@ -1111,7 +1119,8 @@ function hasCSSTransform(el, root, moveClass) {
|
|
|
1111
1119
|
}
|
|
1112
1120
|
|
|
1113
1121
|
const getModelAssigner = (vnode) => {
|
|
1114
|
-
const fn = vnode.props['onUpdate:modelValue']
|
|
1122
|
+
const fn = vnode.props['onUpdate:modelValue'] ||
|
|
1123
|
+
(false );
|
|
1115
1124
|
return shared.isArray(fn) ? value => shared.invokeArrayFns(fn, value) : fn;
|
|
1116
1125
|
};
|
|
1117
1126
|
function onCompositionStart(e) {
|
|
@@ -1121,14 +1130,9 @@ function onCompositionEnd(e) {
|
|
|
1121
1130
|
const target = e.target;
|
|
1122
1131
|
if (target.composing) {
|
|
1123
1132
|
target.composing = false;
|
|
1124
|
-
|
|
1133
|
+
target.dispatchEvent(new Event('input'));
|
|
1125
1134
|
}
|
|
1126
1135
|
}
|
|
1127
|
-
function trigger(el, type) {
|
|
1128
|
-
const e = document.createEvent('HTMLEvents');
|
|
1129
|
-
e.initEvent(type, true, true);
|
|
1130
|
-
el.dispatchEvent(e);
|
|
1131
|
-
}
|
|
1132
1136
|
// We are exporting the v-model runtime directly as vnode hooks so that it can
|
|
1133
1137
|
// be tree-shaken in case v-model is never used.
|
|
1134
1138
|
const vModelText = {
|
|
@@ -1142,7 +1146,7 @@ const vModelText = {
|
|
|
1142
1146
|
if (trim) {
|
|
1143
1147
|
domValue = domValue.trim();
|
|
1144
1148
|
}
|
|
1145
|
-
|
|
1149
|
+
if (castToNumber) {
|
|
1146
1150
|
domValue = shared.toNumber(domValue);
|
|
1147
1151
|
}
|
|
1148
1152
|
el._assign(domValue);
|
|
@@ -1171,7 +1175,7 @@ const vModelText = {
|
|
|
1171
1175
|
// avoid clearing unresolved text. #2302
|
|
1172
1176
|
if (el.composing)
|
|
1173
1177
|
return;
|
|
1174
|
-
if (document.activeElement === el) {
|
|
1178
|
+
if (document.activeElement === el && el.type !== 'range') {
|
|
1175
1179
|
if (lazy) {
|
|
1176
1180
|
return;
|
|
1177
1181
|
}
|
|
@@ -463,11 +463,11 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
463
463
|
return key in el;
|
|
464
464
|
}
|
|
465
465
|
|
|
466
|
-
function defineCustomElement(options,
|
|
466
|
+
function defineCustomElement(options, hydrate) {
|
|
467
467
|
const Comp = runtimeCore.defineComponent(options);
|
|
468
468
|
class VueCustomElement extends VueElement {
|
|
469
469
|
constructor(initialProps) {
|
|
470
|
-
super(Comp, initialProps,
|
|
470
|
+
super(Comp, initialProps, hydrate);
|
|
471
471
|
}
|
|
472
472
|
}
|
|
473
473
|
VueCustomElement.def = Comp;
|
|
@@ -748,7 +748,10 @@ function resolveTransitionProps(rawProps) {
|
|
|
748
748
|
removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
|
|
749
749
|
done && done();
|
|
750
750
|
};
|
|
751
|
+
let isLeaving = false;
|
|
751
752
|
const finishLeave = (el, done) => {
|
|
753
|
+
isLeaving = false;
|
|
754
|
+
removeTransitionClass(el, leaveFromClass);
|
|
752
755
|
removeTransitionClass(el, leaveToClass);
|
|
753
756
|
removeTransitionClass(el, leaveActiveClass);
|
|
754
757
|
done && done();
|
|
@@ -781,12 +784,17 @@ function resolveTransitionProps(rawProps) {
|
|
|
781
784
|
onEnter: makeEnterHook(false),
|
|
782
785
|
onAppear: makeEnterHook(true),
|
|
783
786
|
onLeave(el, done) {
|
|
787
|
+
isLeaving = true;
|
|
784
788
|
const resolve = () => finishLeave(el, done);
|
|
785
789
|
addTransitionClass(el, leaveFromClass);
|
|
786
790
|
// force reflow so *-leave-from classes immediately take effect (#2593)
|
|
787
791
|
forceReflow();
|
|
788
792
|
addTransitionClass(el, leaveActiveClass);
|
|
789
793
|
nextFrame(() => {
|
|
794
|
+
if (!isLeaving) {
|
|
795
|
+
// cancelled
|
|
796
|
+
return;
|
|
797
|
+
}
|
|
790
798
|
removeTransitionClass(el, leaveFromClass);
|
|
791
799
|
addTransitionClass(el, leaveToClass);
|
|
792
800
|
if (!hasExplicitCallback(onLeave)) {
|
|
@@ -1064,7 +1072,8 @@ function hasCSSTransform(el, root, moveClass) {
|
|
|
1064
1072
|
}
|
|
1065
1073
|
|
|
1066
1074
|
const getModelAssigner = (vnode) => {
|
|
1067
|
-
const fn = vnode.props['onUpdate:modelValue']
|
|
1075
|
+
const fn = vnode.props['onUpdate:modelValue'] ||
|
|
1076
|
+
(false );
|
|
1068
1077
|
return shared.isArray(fn) ? value => shared.invokeArrayFns(fn, value) : fn;
|
|
1069
1078
|
};
|
|
1070
1079
|
function onCompositionStart(e) {
|
|
@@ -1074,14 +1083,9 @@ function onCompositionEnd(e) {
|
|
|
1074
1083
|
const target = e.target;
|
|
1075
1084
|
if (target.composing) {
|
|
1076
1085
|
target.composing = false;
|
|
1077
|
-
|
|
1086
|
+
target.dispatchEvent(new Event('input'));
|
|
1078
1087
|
}
|
|
1079
1088
|
}
|
|
1080
|
-
function trigger(el, type) {
|
|
1081
|
-
const e = document.createEvent('HTMLEvents');
|
|
1082
|
-
e.initEvent(type, true, true);
|
|
1083
|
-
el.dispatchEvent(e);
|
|
1084
|
-
}
|
|
1085
1089
|
// We are exporting the v-model runtime directly as vnode hooks so that it can
|
|
1086
1090
|
// be tree-shaken in case v-model is never used.
|
|
1087
1091
|
const vModelText = {
|
|
@@ -1095,7 +1099,7 @@ const vModelText = {
|
|
|
1095
1099
|
if (trim) {
|
|
1096
1100
|
domValue = domValue.trim();
|
|
1097
1101
|
}
|
|
1098
|
-
|
|
1102
|
+
if (castToNumber) {
|
|
1099
1103
|
domValue = shared.toNumber(domValue);
|
|
1100
1104
|
}
|
|
1101
1105
|
el._assign(domValue);
|
|
@@ -1124,7 +1128,7 @@ const vModelText = {
|
|
|
1124
1128
|
// avoid clearing unresolved text. #2302
|
|
1125
1129
|
if (el.composing)
|
|
1126
1130
|
return;
|
|
1127
|
-
if (document.activeElement === el) {
|
|
1131
|
+
if (document.activeElement === el && el.type !== 'range') {
|
|
1128
1132
|
if (lazy) {
|
|
1129
1133
|
return;
|
|
1130
1134
|
}
|
package/dist/runtime-dom.d.ts
CHANGED
|
@@ -208,6 +208,8 @@ export interface CSSProperties
|
|
|
208
208
|
* For examples and more information, visit:
|
|
209
209
|
* https://github.com/frenic/csstype#what-should-i-do-when-i-get-type-errors
|
|
210
210
|
*/
|
|
211
|
+
|
|
212
|
+
[v: `--${string}`]: string | number | undefined
|
|
211
213
|
}
|
|
212
214
|
|
|
213
215
|
type Booleanish = boolean | 'true' | 'false'
|
|
@@ -444,7 +446,7 @@ export interface HTMLAttributes extends AriaAttributes, EventHandlers<Events> {
|
|
|
444
446
|
// Non-standard Attributes
|
|
445
447
|
autocapitalize?: string
|
|
446
448
|
autocorrect?: string
|
|
447
|
-
|
|
449
|
+
autosave?: string
|
|
448
450
|
color?: string
|
|
449
451
|
itemprop?: string
|
|
450
452
|
itemscope?: Booleanish
|
|
@@ -625,7 +627,7 @@ export interface InputHTMLAttributes extends HTMLAttributes {
|
|
|
625
627
|
autocomplete?: string
|
|
626
628
|
autofocus?: Booleanish
|
|
627
629
|
capture?: boolean | 'user' | 'environment' // https://www.w3.org/tr/html-media-capture/#the-capture-attribute
|
|
628
|
-
checked?: Booleanish | any[] // for IDE v-model multi-checkbox support
|
|
630
|
+
checked?: Booleanish | any[] | Set<any> // for IDE v-model multi-checkbox support
|
|
629
631
|
crossorigin?: string
|
|
630
632
|
disabled?: Booleanish
|
|
631
633
|
form?: string
|
|
@@ -635,6 +637,7 @@ export interface InputHTMLAttributes extends HTMLAttributes {
|
|
|
635
637
|
formnovalidate?: Booleanish
|
|
636
638
|
formtarget?: string
|
|
637
639
|
height?: Numberish
|
|
640
|
+
indeterminate?: boolean
|
|
638
641
|
list?: string
|
|
639
642
|
max?: Numberish
|
|
640
643
|
maxlength?: Numberish
|