@vue/runtime-dom 3.2.34-beta.1 → 3.2.36
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 +26 -18
- package/dist/runtime-dom.cjs.prod.js +26 -18
- package/dist/runtime-dom.d.ts +1 -5
- package/dist/runtime-dom.esm-browser.js +51 -33
- package/dist/runtime-dom.esm-browser.prod.js +1 -1
- package/dist/runtime-dom.esm-bundler.js +26 -18
- package/dist/runtime-dom.global.js +51 -33
- package/dist/runtime-dom.global.prod.js +1 -1
- package/package.json +3 -3
package/dist/runtime-dom.cjs.js
CHANGED
|
@@ -301,7 +301,7 @@ const [_getNow, skipTimestampCheck] = /*#__PURE__*/ (() => {
|
|
|
301
301
|
// if the low-res timestamp which is bigger than the event timestamp
|
|
302
302
|
// (which is evaluated AFTER) it means the event is using a hi-res timestamp,
|
|
303
303
|
// and we need to use the hi-res version for event listeners as well.
|
|
304
|
-
_getNow =
|
|
304
|
+
_getNow = performance.now.bind(performance);
|
|
305
305
|
}
|
|
306
306
|
// #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
|
|
307
307
|
// and does not fire microtasks in between event propagation, so safe to exclude.
|
|
@@ -781,9 +781,8 @@ function resolveTransitionProps(rawProps) {
|
|
|
781
781
|
removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
|
|
782
782
|
done && done();
|
|
783
783
|
};
|
|
784
|
-
let isLeaving = false;
|
|
785
784
|
const finishLeave = (el, done) => {
|
|
786
|
-
|
|
785
|
+
el._isLeaving = false;
|
|
787
786
|
removeTransitionClass(el, leaveFromClass);
|
|
788
787
|
removeTransitionClass(el, leaveToClass);
|
|
789
788
|
removeTransitionClass(el, leaveActiveClass);
|
|
@@ -817,14 +816,14 @@ function resolveTransitionProps(rawProps) {
|
|
|
817
816
|
onEnter: makeEnterHook(false),
|
|
818
817
|
onAppear: makeEnterHook(true),
|
|
819
818
|
onLeave(el, done) {
|
|
820
|
-
|
|
819
|
+
el._isLeaving = true;
|
|
821
820
|
const resolve = () => finishLeave(el, done);
|
|
822
821
|
addTransitionClass(el, leaveFromClass);
|
|
823
822
|
// force reflow so *-leave-from classes immediately take effect (#2593)
|
|
824
823
|
forceReflow();
|
|
825
824
|
addTransitionClass(el, leaveActiveClass);
|
|
826
825
|
nextFrame(() => {
|
|
827
|
-
if (!
|
|
826
|
+
if (!el._isLeaving) {
|
|
828
827
|
// cancelled
|
|
829
828
|
return;
|
|
830
829
|
}
|
|
@@ -1345,27 +1344,25 @@ const vModelDynamic = {
|
|
|
1345
1344
|
callModelHook(el, binding, vnode, prevVNode, 'updated');
|
|
1346
1345
|
}
|
|
1347
1346
|
};
|
|
1348
|
-
function
|
|
1349
|
-
|
|
1350
|
-
switch (el.tagName) {
|
|
1347
|
+
function resolveDynamicModel(tagName, type) {
|
|
1348
|
+
switch (tagName) {
|
|
1351
1349
|
case 'SELECT':
|
|
1352
|
-
|
|
1353
|
-
break;
|
|
1350
|
+
return vModelSelect;
|
|
1354
1351
|
case 'TEXTAREA':
|
|
1355
|
-
|
|
1356
|
-
break;
|
|
1352
|
+
return vModelText;
|
|
1357
1353
|
default:
|
|
1358
|
-
switch (
|
|
1354
|
+
switch (type) {
|
|
1359
1355
|
case 'checkbox':
|
|
1360
|
-
|
|
1361
|
-
break;
|
|
1356
|
+
return vModelCheckbox;
|
|
1362
1357
|
case 'radio':
|
|
1363
|
-
|
|
1364
|
-
break;
|
|
1358
|
+
return vModelRadio;
|
|
1365
1359
|
default:
|
|
1366
|
-
|
|
1360
|
+
return vModelText;
|
|
1367
1361
|
}
|
|
1368
1362
|
}
|
|
1363
|
+
}
|
|
1364
|
+
function callModelHook(el, binding, vnode, prevVNode, hook) {
|
|
1365
|
+
const modelToUse = resolveDynamicModel(el.tagName, vnode.props && vnode.props.type);
|
|
1369
1366
|
const fn = modelToUse[hook];
|
|
1370
1367
|
fn && fn(el, binding, vnode, prevVNode);
|
|
1371
1368
|
}
|
|
@@ -1393,6 +1390,17 @@ function initVModelForSSR() {
|
|
|
1393
1390
|
return { checked: true };
|
|
1394
1391
|
}
|
|
1395
1392
|
};
|
|
1393
|
+
vModelDynamic.getSSRProps = (binding, vnode) => {
|
|
1394
|
+
if (typeof vnode.type !== 'string') {
|
|
1395
|
+
return;
|
|
1396
|
+
}
|
|
1397
|
+
const modelToUse = resolveDynamicModel(
|
|
1398
|
+
// resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase
|
|
1399
|
+
vnode.type.toUpperCase(), vnode.props && vnode.props.type);
|
|
1400
|
+
if (modelToUse.getSSRProps) {
|
|
1401
|
+
return modelToUse.getSSRProps(binding, vnode);
|
|
1402
|
+
}
|
|
1403
|
+
};
|
|
1396
1404
|
}
|
|
1397
1405
|
|
|
1398
1406
|
const systemModifiers = ['ctrl', 'shift', 'alt', 'meta'];
|
|
@@ -297,7 +297,7 @@ const [_getNow, skipTimestampCheck] = /*#__PURE__*/ (() => {
|
|
|
297
297
|
// if the low-res timestamp which is bigger than the event timestamp
|
|
298
298
|
// (which is evaluated AFTER) it means the event is using a hi-res timestamp,
|
|
299
299
|
// and we need to use the hi-res version for event listeners as well.
|
|
300
|
-
_getNow =
|
|
300
|
+
_getNow = performance.now.bind(performance);
|
|
301
301
|
}
|
|
302
302
|
// #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
|
|
303
303
|
// and does not fire microtasks in between event propagation, so safe to exclude.
|
|
@@ -748,9 +748,8 @@ function resolveTransitionProps(rawProps) {
|
|
|
748
748
|
removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
|
|
749
749
|
done && done();
|
|
750
750
|
};
|
|
751
|
-
let isLeaving = false;
|
|
752
751
|
const finishLeave = (el, done) => {
|
|
753
|
-
|
|
752
|
+
el._isLeaving = false;
|
|
754
753
|
removeTransitionClass(el, leaveFromClass);
|
|
755
754
|
removeTransitionClass(el, leaveToClass);
|
|
756
755
|
removeTransitionClass(el, leaveActiveClass);
|
|
@@ -784,14 +783,14 @@ function resolveTransitionProps(rawProps) {
|
|
|
784
783
|
onEnter: makeEnterHook(false),
|
|
785
784
|
onAppear: makeEnterHook(true),
|
|
786
785
|
onLeave(el, done) {
|
|
787
|
-
|
|
786
|
+
el._isLeaving = true;
|
|
788
787
|
const resolve = () => finishLeave(el, done);
|
|
789
788
|
addTransitionClass(el, leaveFromClass);
|
|
790
789
|
// force reflow so *-leave-from classes immediately take effect (#2593)
|
|
791
790
|
forceReflow();
|
|
792
791
|
addTransitionClass(el, leaveActiveClass);
|
|
793
792
|
nextFrame(() => {
|
|
794
|
-
if (!
|
|
793
|
+
if (!el._isLeaving) {
|
|
795
794
|
// cancelled
|
|
796
795
|
return;
|
|
797
796
|
}
|
|
@@ -1296,27 +1295,25 @@ const vModelDynamic = {
|
|
|
1296
1295
|
callModelHook(el, binding, vnode, prevVNode, 'updated');
|
|
1297
1296
|
}
|
|
1298
1297
|
};
|
|
1299
|
-
function
|
|
1300
|
-
|
|
1301
|
-
switch (el.tagName) {
|
|
1298
|
+
function resolveDynamicModel(tagName, type) {
|
|
1299
|
+
switch (tagName) {
|
|
1302
1300
|
case 'SELECT':
|
|
1303
|
-
|
|
1304
|
-
break;
|
|
1301
|
+
return vModelSelect;
|
|
1305
1302
|
case 'TEXTAREA':
|
|
1306
|
-
|
|
1307
|
-
break;
|
|
1303
|
+
return vModelText;
|
|
1308
1304
|
default:
|
|
1309
|
-
switch (
|
|
1305
|
+
switch (type) {
|
|
1310
1306
|
case 'checkbox':
|
|
1311
|
-
|
|
1312
|
-
break;
|
|
1307
|
+
return vModelCheckbox;
|
|
1313
1308
|
case 'radio':
|
|
1314
|
-
|
|
1315
|
-
break;
|
|
1309
|
+
return vModelRadio;
|
|
1316
1310
|
default:
|
|
1317
|
-
|
|
1311
|
+
return vModelText;
|
|
1318
1312
|
}
|
|
1319
1313
|
}
|
|
1314
|
+
}
|
|
1315
|
+
function callModelHook(el, binding, vnode, prevVNode, hook) {
|
|
1316
|
+
const modelToUse = resolveDynamicModel(el.tagName, vnode.props && vnode.props.type);
|
|
1320
1317
|
const fn = modelToUse[hook];
|
|
1321
1318
|
fn && fn(el, binding, vnode, prevVNode);
|
|
1322
1319
|
}
|
|
@@ -1344,6 +1341,17 @@ function initVModelForSSR() {
|
|
|
1344
1341
|
return { checked: true };
|
|
1345
1342
|
}
|
|
1346
1343
|
};
|
|
1344
|
+
vModelDynamic.getSSRProps = (binding, vnode) => {
|
|
1345
|
+
if (typeof vnode.type !== 'string') {
|
|
1346
|
+
return;
|
|
1347
|
+
}
|
|
1348
|
+
const modelToUse = resolveDynamicModel(
|
|
1349
|
+
// resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase
|
|
1350
|
+
vnode.type.toUpperCase(), vnode.props && vnode.props.type);
|
|
1351
|
+
if (modelToUse.getSSRProps) {
|
|
1352
|
+
return modelToUse.getSSRProps(binding, vnode);
|
|
1353
|
+
}
|
|
1354
|
+
};
|
|
1347
1355
|
}
|
|
1348
1356
|
|
|
1349
1357
|
const systemModifiers = ['ctrl', 'shift', 'alt', 'meta'];
|
package/dist/runtime-dom.d.ts
CHANGED
|
@@ -208,7 +208,6 @@ 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
211
|
[v: `--${string}`]: string | number | undefined
|
|
213
212
|
}
|
|
214
213
|
|
|
@@ -1479,10 +1478,7 @@ import * as RuntimeCore from '@vue/runtime-core'
|
|
|
1479
1478
|
|
|
1480
1479
|
type ReservedProps = {
|
|
1481
1480
|
key?: string | number | symbol
|
|
1482
|
-
ref?:
|
|
1483
|
-
| string
|
|
1484
|
-
| RuntimeCore.Ref
|
|
1485
|
-
| ((ref: Element | RuntimeCore.ComponentPublicInstance | null) => void)
|
|
1481
|
+
ref?: RuntimeCore.VNodeRef
|
|
1486
1482
|
ref_for?: boolean
|
|
1487
1483
|
ref_key?: string
|
|
1488
1484
|
}
|
|
@@ -3867,11 +3867,6 @@ const KeepAliveImpl = {
|
|
|
3867
3867
|
// The whole point of this is to avoid importing KeepAlive directly in the
|
|
3868
3868
|
// renderer to facilitate tree-shaking.
|
|
3869
3869
|
const sharedContext = instance.ctx;
|
|
3870
|
-
// if the internal renderer is not registered, it indicates that this is server-side rendering,
|
|
3871
|
-
// for KeepAlive, we just need to render its children
|
|
3872
|
-
if (!sharedContext.renderer) {
|
|
3873
|
-
return slots.default;
|
|
3874
|
-
}
|
|
3875
3870
|
const cache = new Map();
|
|
3876
3871
|
const keys = new Set();
|
|
3877
3872
|
let current = null;
|
|
@@ -5999,7 +5994,7 @@ const isComment = (node) => node.nodeType === 8 /* COMMENT */;
|
|
|
5999
5994
|
// Hydration also depends on some renderer internal logic which needs to be
|
|
6000
5995
|
// passed in via arguments.
|
|
6001
5996
|
function createHydrationFunctions(rendererInternals) {
|
|
6002
|
-
const { mt: mountComponent, p: patch, o: { patchProp, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
5997
|
+
const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
|
|
6003
5998
|
const hydrate = (vnode, container) => {
|
|
6004
5999
|
if (!container.hasChildNodes()) {
|
|
6005
6000
|
warn$1(`Attempting to hydrate existing markup but container is empty. ` +
|
|
@@ -6030,7 +6025,15 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6030
6025
|
switch (type) {
|
|
6031
6026
|
case Text:
|
|
6032
6027
|
if (domType !== 3 /* TEXT */) {
|
|
6033
|
-
|
|
6028
|
+
// #5728 empty text node inside a slot can cause hydration failure
|
|
6029
|
+
// because the server rendered HTML won't contain a text node
|
|
6030
|
+
if (vnode.children === '') {
|
|
6031
|
+
insert((vnode.el = createText('')), parentNode(node), node);
|
|
6032
|
+
nextNode = node;
|
|
6033
|
+
}
|
|
6034
|
+
else {
|
|
6035
|
+
nextNode = onMismatch();
|
|
6036
|
+
}
|
|
6034
6037
|
}
|
|
6035
6038
|
else {
|
|
6036
6039
|
if (node.data !== vnode.children) {
|
|
@@ -6104,6 +6107,12 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6104
6107
|
nextNode = isFragmentStart
|
|
6105
6108
|
? locateClosingAsyncAnchor(node)
|
|
6106
6109
|
: nextSibling(node);
|
|
6110
|
+
// #4293 teleport as component root
|
|
6111
|
+
if (nextNode &&
|
|
6112
|
+
isComment(nextNode) &&
|
|
6113
|
+
nextNode.data === 'teleport end') {
|
|
6114
|
+
nextNode = nextSibling(nextNode);
|
|
6115
|
+
}
|
|
6107
6116
|
// #3787
|
|
6108
6117
|
// if component is async, it may get moved / unmounted before its
|
|
6109
6118
|
// inner component is loaded, so we need to give it a placeholder
|
|
@@ -6767,8 +6776,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6767
6776
|
const fragmentStartAnchor = (n2.el = n1 ? n1.el : hostCreateText(''));
|
|
6768
6777
|
const fragmentEndAnchor = (n2.anchor = n1 ? n1.anchor : hostCreateText(''));
|
|
6769
6778
|
let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
|
|
6770
|
-
if (
|
|
6771
|
-
|
|
6779
|
+
if (// #5523 dev root fragment may inherit directives
|
|
6780
|
+
(isHmrUpdating || patchFlag & 2048 /* DEV_ROOT_FRAGMENT */)) {
|
|
6781
|
+
// HMR updated / Dev root fragment (w/ comments), force full diff
|
|
6772
6782
|
patchFlag = 0;
|
|
6773
6783
|
optimized = false;
|
|
6774
6784
|
dynamicChildren = null;
|
|
@@ -6790,8 +6800,6 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6790
6800
|
else {
|
|
6791
6801
|
if (patchFlag > 0 &&
|
|
6792
6802
|
patchFlag & 64 /* STABLE_FRAGMENT */ &&
|
|
6793
|
-
// #5523 dev root fragment may inherit directives so always force update
|
|
6794
|
-
!(patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) &&
|
|
6795
6803
|
dynamicChildren &&
|
|
6796
6804
|
// #2715 the previous fragment could've been a BAILed one as a result
|
|
6797
6805
|
// of renderSlot() with no valid children
|
|
@@ -7877,10 +7885,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
7877
7885
|
}
|
|
7878
7886
|
else {
|
|
7879
7887
|
vnode.anchor = nextSibling(node);
|
|
7880
|
-
|
|
7888
|
+
// lookahead until we find the target anchor
|
|
7889
|
+
// we cannot rely on return value of hydrateChildren() because there
|
|
7890
|
+
// could be nested teleports
|
|
7891
|
+
let targetAnchor = targetNode;
|
|
7892
|
+
while (targetAnchor) {
|
|
7893
|
+
targetAnchor = nextSibling(targetAnchor);
|
|
7894
|
+
if (targetAnchor &&
|
|
7895
|
+
targetAnchor.nodeType === 8 &&
|
|
7896
|
+
targetAnchor.data === 'teleport anchor') {
|
|
7897
|
+
vnode.targetAnchor = targetAnchor;
|
|
7898
|
+
target._lpa =
|
|
7899
|
+
vnode.targetAnchor && nextSibling(vnode.targetAnchor);
|
|
7900
|
+
break;
|
|
7901
|
+
}
|
|
7902
|
+
}
|
|
7903
|
+
hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
7881
7904
|
}
|
|
7882
|
-
target._lpa =
|
|
7883
|
-
vnode.targetAnchor && nextSibling(vnode.targetAnchor);
|
|
7884
7905
|
}
|
|
7885
7906
|
}
|
|
7886
7907
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
@@ -9165,7 +9186,7 @@ function isMemoSame(cached, memo) {
|
|
|
9165
9186
|
}
|
|
9166
9187
|
|
|
9167
9188
|
// Core API ------------------------------------------------------------------
|
|
9168
|
-
const version = "3.2.
|
|
9189
|
+
const version = "3.2.36";
|
|
9169
9190
|
/**
|
|
9170
9191
|
* SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
|
|
9171
9192
|
* @internal
|
|
@@ -9476,7 +9497,7 @@ const [_getNow, skipTimestampCheck] = /*#__PURE__*/ (() => {
|
|
|
9476
9497
|
// if the low-res timestamp which is bigger than the event timestamp
|
|
9477
9498
|
// (which is evaluated AFTER) it means the event is using a hi-res timestamp,
|
|
9478
9499
|
// and we need to use the hi-res version for event listeners as well.
|
|
9479
|
-
_getNow =
|
|
9500
|
+
_getNow = performance.now.bind(performance);
|
|
9480
9501
|
}
|
|
9481
9502
|
// #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
|
|
9482
9503
|
// and does not fire microtasks in between event propagation, so safe to exclude.
|
|
@@ -10006,9 +10027,8 @@ function resolveTransitionProps(rawProps) {
|
|
|
10006
10027
|
removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
|
|
10007
10028
|
done && done();
|
|
10008
10029
|
};
|
|
10009
|
-
let isLeaving = false;
|
|
10010
10030
|
const finishLeave = (el, done) => {
|
|
10011
|
-
|
|
10031
|
+
el._isLeaving = false;
|
|
10012
10032
|
removeTransitionClass(el, leaveFromClass);
|
|
10013
10033
|
removeTransitionClass(el, leaveToClass);
|
|
10014
10034
|
removeTransitionClass(el, leaveActiveClass);
|
|
@@ -10042,14 +10062,14 @@ function resolveTransitionProps(rawProps) {
|
|
|
10042
10062
|
onEnter: makeEnterHook(false),
|
|
10043
10063
|
onAppear: makeEnterHook(true),
|
|
10044
10064
|
onLeave(el, done) {
|
|
10045
|
-
|
|
10065
|
+
el._isLeaving = true;
|
|
10046
10066
|
const resolve = () => finishLeave(el, done);
|
|
10047
10067
|
addTransitionClass(el, leaveFromClass);
|
|
10048
10068
|
// force reflow so *-leave-from classes immediately take effect (#2593)
|
|
10049
10069
|
forceReflow();
|
|
10050
10070
|
addTransitionClass(el, leaveActiveClass);
|
|
10051
10071
|
nextFrame(() => {
|
|
10052
|
-
if (!
|
|
10072
|
+
if (!el._isLeaving) {
|
|
10053
10073
|
// cancelled
|
|
10054
10074
|
return;
|
|
10055
10075
|
}
|
|
@@ -10570,27 +10590,25 @@ const vModelDynamic = {
|
|
|
10570
10590
|
callModelHook(el, binding, vnode, prevVNode, 'updated');
|
|
10571
10591
|
}
|
|
10572
10592
|
};
|
|
10573
|
-
function
|
|
10574
|
-
|
|
10575
|
-
switch (el.tagName) {
|
|
10593
|
+
function resolveDynamicModel(tagName, type) {
|
|
10594
|
+
switch (tagName) {
|
|
10576
10595
|
case 'SELECT':
|
|
10577
|
-
|
|
10578
|
-
break;
|
|
10596
|
+
return vModelSelect;
|
|
10579
10597
|
case 'TEXTAREA':
|
|
10580
|
-
|
|
10581
|
-
break;
|
|
10598
|
+
return vModelText;
|
|
10582
10599
|
default:
|
|
10583
|
-
switch (
|
|
10600
|
+
switch (type) {
|
|
10584
10601
|
case 'checkbox':
|
|
10585
|
-
|
|
10586
|
-
break;
|
|
10602
|
+
return vModelCheckbox;
|
|
10587
10603
|
case 'radio':
|
|
10588
|
-
|
|
10589
|
-
break;
|
|
10604
|
+
return vModelRadio;
|
|
10590
10605
|
default:
|
|
10591
|
-
|
|
10606
|
+
return vModelText;
|
|
10592
10607
|
}
|
|
10593
10608
|
}
|
|
10609
|
+
}
|
|
10610
|
+
function callModelHook(el, binding, vnode, prevVNode, hook) {
|
|
10611
|
+
const modelToUse = resolveDynamicModel(el.tagName, vnode.props && vnode.props.type);
|
|
10594
10612
|
const fn = modelToUse[hook];
|
|
10595
10613
|
fn && fn(el, binding, vnode, prevVNode);
|
|
10596
10614
|
}
|