@vue/runtime-dom 3.2.33 → 3.2.35
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 +37 -24
- package/dist/runtime-dom.cjs.prod.js +37 -24
- package/dist/runtime-dom.d.ts +5 -6
- package/dist/runtime-dom.esm-browser.js +1814 -1747
- package/dist/runtime-dom.esm-browser.prod.js +1 -1
- package/dist/runtime-dom.esm-bundler.js +37 -24
- package/dist/runtime-dom.global.js +1814 -1747
- 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
|
}
|
|
@@ -1341,27 +1345,25 @@ const vModelDynamic = {
|
|
|
1341
1345
|
callModelHook(el, binding, vnode, prevVNode, 'updated');
|
|
1342
1346
|
}
|
|
1343
1347
|
};
|
|
1344
|
-
function
|
|
1345
|
-
|
|
1346
|
-
switch (el.tagName) {
|
|
1348
|
+
function resolveDynamicModel(tagName, type) {
|
|
1349
|
+
switch (tagName) {
|
|
1347
1350
|
case 'SELECT':
|
|
1348
|
-
|
|
1349
|
-
break;
|
|
1351
|
+
return vModelSelect;
|
|
1350
1352
|
case 'TEXTAREA':
|
|
1351
|
-
|
|
1352
|
-
break;
|
|
1353
|
+
return vModelText;
|
|
1353
1354
|
default:
|
|
1354
|
-
switch (
|
|
1355
|
+
switch (type) {
|
|
1355
1356
|
case 'checkbox':
|
|
1356
|
-
|
|
1357
|
-
break;
|
|
1357
|
+
return vModelCheckbox;
|
|
1358
1358
|
case 'radio':
|
|
1359
|
-
|
|
1360
|
-
break;
|
|
1359
|
+
return vModelRadio;
|
|
1361
1360
|
default:
|
|
1362
|
-
|
|
1361
|
+
return vModelText;
|
|
1363
1362
|
}
|
|
1364
1363
|
}
|
|
1364
|
+
}
|
|
1365
|
+
function callModelHook(el, binding, vnode, prevVNode, hook) {
|
|
1366
|
+
const modelToUse = resolveDynamicModel(el.tagName, vnode.props && vnode.props.type);
|
|
1365
1367
|
const fn = modelToUse[hook];
|
|
1366
1368
|
fn && fn(el, binding, vnode, prevVNode);
|
|
1367
1369
|
}
|
|
@@ -1389,6 +1391,17 @@ function initVModelForSSR() {
|
|
|
1389
1391
|
return { checked: true };
|
|
1390
1392
|
}
|
|
1391
1393
|
};
|
|
1394
|
+
vModelDynamic.getSSRProps = (binding, vnode) => {
|
|
1395
|
+
if (typeof vnode.type !== 'string') {
|
|
1396
|
+
return;
|
|
1397
|
+
}
|
|
1398
|
+
const modelToUse = resolveDynamicModel(
|
|
1399
|
+
// resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase
|
|
1400
|
+
vnode.type.toUpperCase(), vnode.props && vnode.props.type);
|
|
1401
|
+
if (modelToUse.getSSRProps) {
|
|
1402
|
+
return modelToUse.getSSRProps(binding, vnode);
|
|
1403
|
+
}
|
|
1404
|
+
};
|
|
1392
1405
|
}
|
|
1393
1406
|
|
|
1394
1407
|
const systemModifiers = ['ctrl', 'shift', 'alt', 'meta'];
|
|
@@ -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
|
}
|
|
@@ -1292,27 +1296,25 @@ const vModelDynamic = {
|
|
|
1292
1296
|
callModelHook(el, binding, vnode, prevVNode, 'updated');
|
|
1293
1297
|
}
|
|
1294
1298
|
};
|
|
1295
|
-
function
|
|
1296
|
-
|
|
1297
|
-
switch (el.tagName) {
|
|
1299
|
+
function resolveDynamicModel(tagName, type) {
|
|
1300
|
+
switch (tagName) {
|
|
1298
1301
|
case 'SELECT':
|
|
1299
|
-
|
|
1300
|
-
break;
|
|
1302
|
+
return vModelSelect;
|
|
1301
1303
|
case 'TEXTAREA':
|
|
1302
|
-
|
|
1303
|
-
break;
|
|
1304
|
+
return vModelText;
|
|
1304
1305
|
default:
|
|
1305
|
-
switch (
|
|
1306
|
+
switch (type) {
|
|
1306
1307
|
case 'checkbox':
|
|
1307
|
-
|
|
1308
|
-
break;
|
|
1308
|
+
return vModelCheckbox;
|
|
1309
1309
|
case 'radio':
|
|
1310
|
-
|
|
1311
|
-
break;
|
|
1310
|
+
return vModelRadio;
|
|
1312
1311
|
default:
|
|
1313
|
-
|
|
1312
|
+
return vModelText;
|
|
1314
1313
|
}
|
|
1315
1314
|
}
|
|
1315
|
+
}
|
|
1316
|
+
function callModelHook(el, binding, vnode, prevVNode, hook) {
|
|
1317
|
+
const modelToUse = resolveDynamicModel(el.tagName, vnode.props && vnode.props.type);
|
|
1316
1318
|
const fn = modelToUse[hook];
|
|
1317
1319
|
fn && fn(el, binding, vnode, prevVNode);
|
|
1318
1320
|
}
|
|
@@ -1340,6 +1342,17 @@ function initVModelForSSR() {
|
|
|
1340
1342
|
return { checked: true };
|
|
1341
1343
|
}
|
|
1342
1344
|
};
|
|
1345
|
+
vModelDynamic.getSSRProps = (binding, vnode) => {
|
|
1346
|
+
if (typeof vnode.type !== 'string') {
|
|
1347
|
+
return;
|
|
1348
|
+
}
|
|
1349
|
+
const modelToUse = resolveDynamicModel(
|
|
1350
|
+
// resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase
|
|
1351
|
+
vnode.type.toUpperCase(), vnode.props && vnode.props.type);
|
|
1352
|
+
if (modelToUse.getSSRProps) {
|
|
1353
|
+
return modelToUse.getSSRProps(binding, vnode);
|
|
1354
|
+
}
|
|
1355
|
+
};
|
|
1343
1356
|
}
|
|
1344
1357
|
|
|
1345
1358
|
const systemModifiers = ['ctrl', 'shift', 'alt', 'meta'];
|
package/dist/runtime-dom.d.ts
CHANGED
|
@@ -208,6 +208,7 @@ 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
|
+
[v: `--${string}`]: string | number | undefined
|
|
211
212
|
}
|
|
212
213
|
|
|
213
214
|
type Booleanish = boolean | 'true' | 'false'
|
|
@@ -444,7 +445,7 @@ export interface HTMLAttributes extends AriaAttributes, EventHandlers<Events> {
|
|
|
444
445
|
// Non-standard Attributes
|
|
445
446
|
autocapitalize?: string
|
|
446
447
|
autocorrect?: string
|
|
447
|
-
|
|
448
|
+
autosave?: string
|
|
448
449
|
color?: string
|
|
449
450
|
itemprop?: string
|
|
450
451
|
itemscope?: Booleanish
|
|
@@ -625,7 +626,7 @@ export interface InputHTMLAttributes extends HTMLAttributes {
|
|
|
625
626
|
autocomplete?: string
|
|
626
627
|
autofocus?: Booleanish
|
|
627
628
|
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
|
|
629
|
+
checked?: Booleanish | any[] | Set<any> // for IDE v-model multi-checkbox support
|
|
629
630
|
crossorigin?: string
|
|
630
631
|
disabled?: Booleanish
|
|
631
632
|
form?: string
|
|
@@ -635,6 +636,7 @@ export interface InputHTMLAttributes extends HTMLAttributes {
|
|
|
635
636
|
formnovalidate?: Booleanish
|
|
636
637
|
formtarget?: string
|
|
637
638
|
height?: Numberish
|
|
639
|
+
indeterminate?: boolean
|
|
638
640
|
list?: string
|
|
639
641
|
max?: Numberish
|
|
640
642
|
maxlength?: Numberish
|
|
@@ -1476,10 +1478,7 @@ import * as RuntimeCore from '@vue/runtime-core'
|
|
|
1476
1478
|
|
|
1477
1479
|
type ReservedProps = {
|
|
1478
1480
|
key?: string | number | symbol
|
|
1479
|
-
ref?:
|
|
1480
|
-
| string
|
|
1481
|
-
| RuntimeCore.Ref
|
|
1482
|
-
| ((ref: Element | RuntimeCore.ComponentPublicInstance | null) => void)
|
|
1481
|
+
ref?: RuntimeCore.VNodeRef
|
|
1483
1482
|
ref_for?: boolean
|
|
1484
1483
|
ref_key?: string
|
|
1485
1484
|
}
|