@vue/runtime-dom 3.6.0-beta.5 → 3.6.0-beta.7
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 +21 -10
- package/dist/runtime-dom.cjs.prod.js +21 -10
- package/dist/runtime-dom.d.ts +3 -2
- package/dist/runtime-dom.esm-browser.js +96 -59
- package/dist/runtime-dom.esm-browser.prod.js +3 -3
- package/dist/runtime-dom.esm-bundler.js +21 -10
- package/dist/runtime-dom.global.js +96 -59
- package/dist/runtime-dom.global.prod.js +3 -3
- package/package.json +4 -4
package/dist/runtime-dom.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.6.0-beta.
|
|
2
|
+
* @vue/runtime-dom v3.6.0-beta.7
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -1029,10 +1029,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
1029
1029
|
if (child.el && child.el instanceof Element) {
|
|
1030
1030
|
prevChildren.push(child);
|
|
1031
1031
|
(0, _vue_runtime_core.setTransitionHooks)(child, (0, _vue_runtime_core.resolveTransitionHooks)(child, cssTransitionProps, state, instance));
|
|
1032
|
-
positionMap.set(child,
|
|
1033
|
-
left: child.el.offsetLeft,
|
|
1034
|
-
top: child.el.offsetTop
|
|
1035
|
-
});
|
|
1032
|
+
positionMap.set(child, getPosition(child.el));
|
|
1036
1033
|
}
|
|
1037
1034
|
}
|
|
1038
1035
|
children = slots.default ? (0, _vue_runtime_core.getTransitionRawChildren)(slots.default()) : [];
|
|
@@ -1051,10 +1048,7 @@ function callPendingCbs(el) {
|
|
|
1051
1048
|
if (el[enterCbKey]) el[enterCbKey]();
|
|
1052
1049
|
}
|
|
1053
1050
|
function recordPosition(c) {
|
|
1054
|
-
newPositionMap.set(c,
|
|
1055
|
-
left: c.el.offsetLeft,
|
|
1056
|
-
top: c.el.offsetTop
|
|
1057
|
-
});
|
|
1051
|
+
newPositionMap.set(c, getPosition(c.el));
|
|
1058
1052
|
}
|
|
1059
1053
|
function applyTranslation(c) {
|
|
1060
1054
|
if (baseApplyTranslation(positionMap.get(c), newPositionMap.get(c), c.el)) return c;
|
|
@@ -1064,12 +1058,28 @@ function baseApplyTranslation(oldPos, newPos, el) {
|
|
|
1064
1058
|
const dy = oldPos.top - newPos.top;
|
|
1065
1059
|
if (dx || dy) {
|
|
1066
1060
|
const s = el.style;
|
|
1067
|
-
|
|
1061
|
+
const rect = el.getBoundingClientRect();
|
|
1062
|
+
let scaleX = 1;
|
|
1063
|
+
let scaleY = 1;
|
|
1064
|
+
if (el.offsetWidth) scaleX = rect.width / el.offsetWidth;
|
|
1065
|
+
if (el.offsetHeight) scaleY = rect.height / el.offsetHeight;
|
|
1066
|
+
if (!Number.isFinite(scaleX) || scaleX === 0) scaleX = 1;
|
|
1067
|
+
if (!Number.isFinite(scaleY) || scaleY === 0) scaleY = 1;
|
|
1068
|
+
if (Math.abs(scaleX - 1) < .01) scaleX = 1;
|
|
1069
|
+
if (Math.abs(scaleY - 1) < .01) scaleY = 1;
|
|
1070
|
+
s.transform = s.webkitTransform = `translate(${dx / scaleX}px,${dy / scaleY}px)`;
|
|
1068
1071
|
s.transitionDuration = "0s";
|
|
1069
1072
|
return true;
|
|
1070
1073
|
}
|
|
1071
1074
|
return false;
|
|
1072
1075
|
}
|
|
1076
|
+
function getPosition(el) {
|
|
1077
|
+
const rect = el.getBoundingClientRect();
|
|
1078
|
+
return {
|
|
1079
|
+
left: rect.left,
|
|
1080
|
+
top: rect.top
|
|
1081
|
+
};
|
|
1082
|
+
}
|
|
1073
1083
|
function hasCSSTransform(el, root, moveClass) {
|
|
1074
1084
|
const clone = el.cloneNode();
|
|
1075
1085
|
const _vtc = el[vtcKey];
|
|
@@ -1374,6 +1384,7 @@ const modifierGuards = {
|
|
|
1374
1384
|
* @private
|
|
1375
1385
|
*/
|
|
1376
1386
|
const withModifiers = (fn, modifiers) => {
|
|
1387
|
+
if (!fn) return fn;
|
|
1377
1388
|
const cache = fn._withMods || (fn._withMods = {});
|
|
1378
1389
|
const cacheKey = modifiers.join(".");
|
|
1379
1390
|
return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.6.0-beta.
|
|
2
|
+
* @vue/runtime-dom v3.6.0-beta.7
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -975,10 +975,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
975
975
|
if (child.el && child.el instanceof Element) {
|
|
976
976
|
prevChildren.push(child);
|
|
977
977
|
(0, _vue_runtime_core.setTransitionHooks)(child, (0, _vue_runtime_core.resolveTransitionHooks)(child, cssTransitionProps, state, instance));
|
|
978
|
-
positionMap.set(child,
|
|
979
|
-
left: child.el.offsetLeft,
|
|
980
|
-
top: child.el.offsetTop
|
|
981
|
-
});
|
|
978
|
+
positionMap.set(child, getPosition(child.el));
|
|
982
979
|
}
|
|
983
980
|
}
|
|
984
981
|
children = slots.default ? (0, _vue_runtime_core.getTransitionRawChildren)(slots.default()) : [];
|
|
@@ -996,10 +993,7 @@ function callPendingCbs(el) {
|
|
|
996
993
|
if (el[enterCbKey]) el[enterCbKey]();
|
|
997
994
|
}
|
|
998
995
|
function recordPosition(c) {
|
|
999
|
-
newPositionMap.set(c,
|
|
1000
|
-
left: c.el.offsetLeft,
|
|
1001
|
-
top: c.el.offsetTop
|
|
1002
|
-
});
|
|
996
|
+
newPositionMap.set(c, getPosition(c.el));
|
|
1003
997
|
}
|
|
1004
998
|
function applyTranslation(c) {
|
|
1005
999
|
if (baseApplyTranslation(positionMap.get(c), newPositionMap.get(c), c.el)) return c;
|
|
@@ -1009,12 +1003,28 @@ function baseApplyTranslation(oldPos, newPos, el) {
|
|
|
1009
1003
|
const dy = oldPos.top - newPos.top;
|
|
1010
1004
|
if (dx || dy) {
|
|
1011
1005
|
const s = el.style;
|
|
1012
|
-
|
|
1006
|
+
const rect = el.getBoundingClientRect();
|
|
1007
|
+
let scaleX = 1;
|
|
1008
|
+
let scaleY = 1;
|
|
1009
|
+
if (el.offsetWidth) scaleX = rect.width / el.offsetWidth;
|
|
1010
|
+
if (el.offsetHeight) scaleY = rect.height / el.offsetHeight;
|
|
1011
|
+
if (!Number.isFinite(scaleX) || scaleX === 0) scaleX = 1;
|
|
1012
|
+
if (!Number.isFinite(scaleY) || scaleY === 0) scaleY = 1;
|
|
1013
|
+
if (Math.abs(scaleX - 1) < .01) scaleX = 1;
|
|
1014
|
+
if (Math.abs(scaleY - 1) < .01) scaleY = 1;
|
|
1015
|
+
s.transform = s.webkitTransform = `translate(${dx / scaleX}px,${dy / scaleY}px)`;
|
|
1013
1016
|
s.transitionDuration = "0s";
|
|
1014
1017
|
return true;
|
|
1015
1018
|
}
|
|
1016
1019
|
return false;
|
|
1017
1020
|
}
|
|
1021
|
+
function getPosition(el) {
|
|
1022
|
+
const rect = el.getBoundingClientRect();
|
|
1023
|
+
return {
|
|
1024
|
+
left: rect.left,
|
|
1025
|
+
top: rect.top
|
|
1026
|
+
};
|
|
1027
|
+
}
|
|
1018
1028
|
function hasCSSTransform(el, root, moveClass) {
|
|
1019
1029
|
const clone = el.cloneNode();
|
|
1020
1030
|
const _vtc = el[vtcKey];
|
|
@@ -1316,6 +1326,7 @@ const modifierGuards = {
|
|
|
1316
1326
|
* @private
|
|
1317
1327
|
*/
|
|
1318
1328
|
const withModifiers = (fn, modifiers) => {
|
|
1329
|
+
if (!fn) return fn;
|
|
1319
1330
|
const cache = fn._withMods || (fn._withMods = {});
|
|
1320
1331
|
const cacheKey = modifiers.join(".");
|
|
1321
1332
|
return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
|
package/dist/runtime-dom.d.ts
CHANGED
|
@@ -414,9 +414,10 @@ export interface AriaAttributes {
|
|
|
414
414
|
"aria-valuetext"?: string | undefined;
|
|
415
415
|
}
|
|
416
416
|
export type StyleValue = false | null | undefined | string | CSSProperties | Array<StyleValue>;
|
|
417
|
+
export type ClassValue = false | null | undefined | string | Record<string, any> | Array<ClassValue>;
|
|
417
418
|
export interface HTMLAttributes extends AriaAttributes, EventHandlers<Events> {
|
|
418
419
|
innerHTML?: string | undefined;
|
|
419
|
-
class?:
|
|
420
|
+
class?: ClassValue | undefined;
|
|
420
421
|
style?: StyleValue | undefined;
|
|
421
422
|
accesskey?: string | undefined;
|
|
422
423
|
contenteditable?: Booleanish | "inherit" | "plaintext-only" | undefined;
|
|
@@ -889,7 +890,7 @@ export interface SVGAttributes extends AriaAttributes, EventHandlers<Events> {
|
|
|
889
890
|
* SVG Styling Attributes
|
|
890
891
|
* @see https://www.w3.org/TR/SVG/styling.html#ElementSpecificStyling
|
|
891
892
|
*/
|
|
892
|
-
class?:
|
|
893
|
+
class?: ClassValue | undefined;
|
|
893
894
|
style?: StyleValue | undefined;
|
|
894
895
|
color?: string | undefined;
|
|
895
896
|
height?: Numberish | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.6.0-beta.
|
|
2
|
+
* @vue/runtime-dom v3.6.0-beta.7
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -3202,36 +3202,44 @@ function moveTeleport(vnode, container, parentAnchor, { o: { insert }, m: move }
|
|
|
3202
3202
|
if (isReorder) insert(anchor, container, parentAnchor);
|
|
3203
3203
|
}
|
|
3204
3204
|
function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScopeIds, optimized, { o: { nextSibling, parentNode, querySelector, insert, createText } }, hydrateChildren) {
|
|
3205
|
-
function
|
|
3205
|
+
function hydrateAnchor(target, targetNode) {
|
|
3206
|
+
let targetAnchor = targetNode;
|
|
3207
|
+
while (targetAnchor) {
|
|
3208
|
+
if (targetAnchor && targetAnchor.nodeType === 8) {
|
|
3209
|
+
if (targetAnchor.data === "teleport start anchor") vnode.targetStart = targetAnchor;
|
|
3210
|
+
else if (targetAnchor.data === "teleport anchor") {
|
|
3211
|
+
vnode.targetAnchor = targetAnchor;
|
|
3212
|
+
target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
|
|
3213
|
+
break;
|
|
3214
|
+
}
|
|
3215
|
+
}
|
|
3216
|
+
targetAnchor = nextSibling(targetAnchor);
|
|
3217
|
+
}
|
|
3218
|
+
}
|
|
3219
|
+
function hydrateDisabledTeleport(node, vnode) {
|
|
3206
3220
|
vnode.anchor = hydrateChildren(nextSibling(node), vnode, parentNode(node), parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3207
|
-
vnode.targetStart = targetStart;
|
|
3208
|
-
vnode.targetAnchor = targetAnchor;
|
|
3209
3221
|
}
|
|
3210
3222
|
const target = vnode.target = resolveTarget(vnode.props, querySelector);
|
|
3211
3223
|
const disabled = isTeleportDisabled(vnode.props);
|
|
3212
3224
|
if (target) {
|
|
3213
3225
|
const targetNode = target._lpa || target.firstChild;
|
|
3214
|
-
if (vnode.shapeFlag & 16) if (disabled)
|
|
3215
|
-
|
|
3226
|
+
if (vnode.shapeFlag & 16) if (disabled) {
|
|
3227
|
+
hydrateDisabledTeleport(node, vnode);
|
|
3228
|
+
hydrateAnchor(target, targetNode);
|
|
3229
|
+
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert, parentNode(node) === target ? node : null);
|
|
3230
|
+
} else {
|
|
3216
3231
|
vnode.anchor = nextSibling(node);
|
|
3217
|
-
|
|
3218
|
-
while (targetAnchor) {
|
|
3219
|
-
if (targetAnchor && targetAnchor.nodeType === 8) {
|
|
3220
|
-
if (targetAnchor.data === "teleport start anchor") vnode.targetStart = targetAnchor;
|
|
3221
|
-
else if (targetAnchor.data === "teleport anchor") {
|
|
3222
|
-
vnode.targetAnchor = targetAnchor;
|
|
3223
|
-
target._lpa = vnode.targetAnchor && nextSibling(vnode.targetAnchor);
|
|
3224
|
-
break;
|
|
3225
|
-
}
|
|
3226
|
-
}
|
|
3227
|
-
targetAnchor = nextSibling(targetAnchor);
|
|
3228
|
-
}
|
|
3232
|
+
hydrateAnchor(target, targetNode);
|
|
3229
3233
|
if (!vnode.targetAnchor) prepareAnchor(target, vnode, createText, insert);
|
|
3230
3234
|
hydrateChildren(targetNode && nextSibling(targetNode), vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
|
|
3231
3235
|
}
|
|
3232
3236
|
updateCssVars(vnode, disabled);
|
|
3233
3237
|
} else if (disabled) {
|
|
3234
|
-
if (vnode.shapeFlag & 16)
|
|
3238
|
+
if (vnode.shapeFlag & 16) {
|
|
3239
|
+
hydrateDisabledTeleport(node, vnode);
|
|
3240
|
+
vnode.targetStart = node;
|
|
3241
|
+
vnode.targetAnchor = nextSibling(node);
|
|
3242
|
+
}
|
|
3235
3243
|
}
|
|
3236
3244
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
3237
3245
|
}
|
|
@@ -3254,13 +3262,13 @@ function updateCssVars(vnode, isDisabled) {
|
|
|
3254
3262
|
ctx.ut();
|
|
3255
3263
|
}
|
|
3256
3264
|
}
|
|
3257
|
-
function prepareAnchor(target, vnode, createText, insert) {
|
|
3265
|
+
function prepareAnchor(target, vnode, createText, insert, anchor = null) {
|
|
3258
3266
|
const targetStart = vnode.targetStart = createText("");
|
|
3259
3267
|
const targetAnchor = vnode.targetAnchor = createText("");
|
|
3260
3268
|
targetStart[TeleportEndKey] = targetAnchor;
|
|
3261
3269
|
if (target) {
|
|
3262
|
-
insert(targetStart, target);
|
|
3263
|
-
insert(targetAnchor, target);
|
|
3270
|
+
insert(targetStart, target, anchor);
|
|
3271
|
+
insert(targetAnchor, target, anchor);
|
|
3264
3272
|
}
|
|
3265
3273
|
return targetAnchor;
|
|
3266
3274
|
}
|
|
@@ -3387,6 +3395,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
3387
3395
|
const key = String(vnode.key);
|
|
3388
3396
|
const leavingVNodesCache = getLeavingNodesForType(state, vnode);
|
|
3389
3397
|
return baseResolveTransitionHooks({
|
|
3398
|
+
isLeaving: () => leavingVNodesCache[key] === vnode,
|
|
3390
3399
|
setLeavingNodeCache: () => {
|
|
3391
3400
|
leavingVNodesCache[key] = vnode;
|
|
3392
3401
|
},
|
|
@@ -3405,7 +3414,7 @@ function resolveTransitionHooks(vnode, props, state, instance, postClone) {
|
|
|
3405
3414
|
}, props, state, instance);
|
|
3406
3415
|
}
|
|
3407
3416
|
function baseResolveTransitionHooks(context, props, state, instance) {
|
|
3408
|
-
const { setLeavingNodeCache, unsetLeavingNodeCache, earlyRemove, cloneHooks } = context;
|
|
3417
|
+
const { isLeaving, setLeavingNodeCache, unsetLeavingNodeCache, earlyRemove, cloneHooks } = context;
|
|
3409
3418
|
const { appear, mode, persisted = false, onBeforeEnter, onEnter, onAfterEnter, onEnterCancelled, onBeforeLeave, onLeave, onAfterLeave, onLeaveCancelled, onBeforeAppear, onAppear, onAfterAppear, onAppearCancelled } = props;
|
|
3410
3419
|
const callHook = (hook, args) => {
|
|
3411
3420
|
hook && callWithAsyncErrorHandling(hook, instance, 9, args);
|
|
@@ -3429,6 +3438,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
3429
3438
|
callHook(hook, [el]);
|
|
3430
3439
|
},
|
|
3431
3440
|
enter(el) {
|
|
3441
|
+
if (isLeaving()) return;
|
|
3432
3442
|
let hook = onEnter;
|
|
3433
3443
|
let afterHook = onAfterEnter;
|
|
3434
3444
|
let cancelHook = onEnterCancelled;
|
|
@@ -3438,7 +3448,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
3438
3448
|
cancelHook = onAppearCancelled || onEnterCancelled;
|
|
3439
3449
|
} else return;
|
|
3440
3450
|
let called = false;
|
|
3441
|
-
|
|
3451
|
+
el[enterCbKey$1] = (cancelled) => {
|
|
3442
3452
|
if (called) return;
|
|
3443
3453
|
called = true;
|
|
3444
3454
|
if (cancelled) callHook(cancelHook, [el]);
|
|
@@ -3446,6 +3456,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
3446
3456
|
if (hooks.delayedLeave) hooks.delayedLeave();
|
|
3447
3457
|
el[enterCbKey$1] = void 0;
|
|
3448
3458
|
};
|
|
3459
|
+
const done = el[enterCbKey$1].bind(null, false);
|
|
3449
3460
|
if (hook) callAsyncHook(hook, [el, done]);
|
|
3450
3461
|
else done();
|
|
3451
3462
|
},
|
|
@@ -3454,7 +3465,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
3454
3465
|
if (state.isUnmounting) return remove();
|
|
3455
3466
|
callHook(onBeforeLeave, [el]);
|
|
3456
3467
|
let called = false;
|
|
3457
|
-
|
|
3468
|
+
el[leaveCbKey] = (cancelled) => {
|
|
3458
3469
|
if (called) return;
|
|
3459
3470
|
called = true;
|
|
3460
3471
|
remove();
|
|
@@ -3464,6 +3475,7 @@ function baseResolveTransitionHooks(context, props, state, instance) {
|
|
|
3464
3475
|
unsetLeavingNodeCache(el);
|
|
3465
3476
|
};
|
|
3466
3477
|
setLeavingNodeCache(el);
|
|
3478
|
+
const done = el[leaveCbKey].bind(null, false);
|
|
3467
3479
|
if (onLeave) callAsyncHook(onLeave, [el, done]);
|
|
3468
3480
|
else done();
|
|
3469
3481
|
},
|
|
@@ -3561,8 +3573,7 @@ function useTemplateRef(key) {
|
|
|
3561
3573
|
const r = /* @__PURE__ */ shallowRef(null);
|
|
3562
3574
|
if (i) {
|
|
3563
3575
|
const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
|
|
3564
|
-
|
|
3565
|
-
if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) warn$1(`useTemplateRef('${key}') already exists.`);
|
|
3576
|
+
if (isTemplateRefKey(refs, key)) warn$1(`useTemplateRef('${key}') already exists.`);
|
|
3566
3577
|
else Object.defineProperty(refs, key, {
|
|
3567
3578
|
enumerable: true,
|
|
3568
3579
|
get: () => r.value,
|
|
@@ -3573,6 +3584,10 @@ function useTemplateRef(key) {
|
|
|
3573
3584
|
knownTemplateRefs.add(ret);
|
|
3574
3585
|
return ret;
|
|
3575
3586
|
}
|
|
3587
|
+
function isTemplateRefKey(refs, key) {
|
|
3588
|
+
let desc;
|
|
3589
|
+
return !!((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable);
|
|
3590
|
+
}
|
|
3576
3591
|
|
|
3577
3592
|
//#endregion
|
|
3578
3593
|
//#region packages/runtime-core/src/rendererTemplateRef.ts
|
|
@@ -3599,9 +3614,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
3599
3614
|
const oldRef = oldRawRef && oldRawRef.r;
|
|
3600
3615
|
const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
|
|
3601
3616
|
const setupState = owner.setupState;
|
|
3602
|
-
const canSetSetupRef = createCanSetSetupRefChecker(setupState);
|
|
3603
|
-
const canSetRef = (ref) => {
|
|
3604
|
-
|
|
3617
|
+
const canSetSetupRef = createCanSetSetupRefChecker(setupState, refs);
|
|
3618
|
+
const canSetRef = (ref, key) => {
|
|
3619
|
+
if (knownTemplateRefs.has(ref)) return false;
|
|
3620
|
+
if (key && isTemplateRefKey(refs, key)) return false;
|
|
3621
|
+
return true;
|
|
3605
3622
|
};
|
|
3606
3623
|
if (oldRef != null && oldRef !== ref) {
|
|
3607
3624
|
invalidatePendingSetRef(oldRawRef);
|
|
@@ -3609,8 +3626,8 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
3609
3626
|
refs[oldRef] = null;
|
|
3610
3627
|
if (canSetSetupRef(oldRef)) setupState[oldRef] = null;
|
|
3611
3628
|
} else if (/* @__PURE__ */ isRef(oldRef)) {
|
|
3612
|
-
if (canSetRef(oldRef)) oldRef.value = null;
|
|
3613
3629
|
const oldRawRefAtom = oldRawRef;
|
|
3630
|
+
if (canSetRef(oldRef, oldRawRefAtom.k)) oldRef.value = null;
|
|
3614
3631
|
if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null;
|
|
3615
3632
|
}
|
|
3616
3633
|
}
|
|
@@ -3628,7 +3645,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
3628
3645
|
if (canSetSetupRef(ref)) setupState[ref] = refs[ref];
|
|
3629
3646
|
} else {
|
|
3630
3647
|
const newVal = [refValue];
|
|
3631
|
-
if (canSetRef(ref)) ref.value = newVal;
|
|
3648
|
+
if (canSetRef(ref, rawRef.k)) ref.value = newVal;
|
|
3632
3649
|
if (rawRef.k) refs[rawRef.k] = newVal;
|
|
3633
3650
|
}
|
|
3634
3651
|
else if (!existing.includes(refValue)) existing.push(refValue);
|
|
@@ -3636,7 +3653,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
3636
3653
|
refs[ref] = value;
|
|
3637
3654
|
if (canSetSetupRef(ref)) setupState[ref] = value;
|
|
3638
3655
|
} else if (_isRef) {
|
|
3639
|
-
if (canSetRef(ref)) ref.value = value;
|
|
3656
|
+
if (canSetRef(ref, rawRef.k)) ref.value = value;
|
|
3640
3657
|
if (rawRef.k) refs[rawRef.k] = value;
|
|
3641
3658
|
} else warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
|
|
3642
3659
|
};
|
|
@@ -3654,11 +3671,12 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
3654
3671
|
} else warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
|
|
3655
3672
|
}
|
|
3656
3673
|
}
|
|
3657
|
-
function createCanSetSetupRefChecker(setupState) {
|
|
3674
|
+
function createCanSetSetupRefChecker(setupState, refs) {
|
|
3658
3675
|
const rawSetupState = /* @__PURE__ */ toRaw(setupState);
|
|
3659
3676
|
return setupState === void 0 || setupState === EMPTY_OBJ ? NO : (key) => {
|
|
3660
3677
|
if (hasOwn(rawSetupState, key) && !/* @__PURE__ */ isRef(rawSetupState[key])) warn$1(`Template ref "${key}" used on a non-ref value. It will not work in the production build.`);
|
|
3661
3678
|
if (knownTemplateRefs.has(rawSetupState[key])) return false;
|
|
3679
|
+
if (isTemplateRefKey(refs, key)) return false;
|
|
3662
3680
|
return hasOwn(rawSetupState, key);
|
|
3663
3681
|
};
|
|
3664
3682
|
}
|
|
@@ -4522,7 +4540,6 @@ function deactivate(vnode, container, { m: move }, parentComponent, parentSuspen
|
|
|
4522
4540
|
instance.isDeactivated = true;
|
|
4523
4541
|
}, void 0, parentSuspense);
|
|
4524
4542
|
devtoolsComponentAdded(instance);
|
|
4525
|
-
instance.__keepAliveStorageContainer = container;
|
|
4526
4543
|
}
|
|
4527
4544
|
|
|
4528
4545
|
//#endregion
|
|
@@ -5066,11 +5083,16 @@ function withAsyncContext(getAwaitable) {
|
|
|
5066
5083
|
if (!ctx) warn$1("withAsyncContext called without active current instance. This is likely a bug.");
|
|
5067
5084
|
let awaitable = getAwaitable();
|
|
5068
5085
|
setCurrentInstance(null, void 0);
|
|
5086
|
+
const cleanup = () => setCurrentInstance(null, void 0);
|
|
5069
5087
|
if (isPromise(awaitable)) awaitable = awaitable.catch((e) => {
|
|
5070
5088
|
setCurrentInstance(ctx);
|
|
5089
|
+
Promise.resolve().then(() => Promise.resolve().then(cleanup));
|
|
5071
5090
|
throw e;
|
|
5072
5091
|
});
|
|
5073
|
-
return [awaitable, () =>
|
|
5092
|
+
return [awaitable, () => {
|
|
5093
|
+
setCurrentInstance(ctx);
|
|
5094
|
+
Promise.resolve().then(cleanup);
|
|
5095
|
+
}];
|
|
5074
5096
|
}
|
|
5075
5097
|
|
|
5076
5098
|
//#endregion
|
|
@@ -5765,7 +5787,7 @@ function shouldUpdateComponent(prevVNode, nextVNode, optimized) {
|
|
|
5765
5787
|
const dynamicProps = nextVNode.dynamicProps;
|
|
5766
5788
|
for (let i = 0; i < dynamicProps.length; i++) {
|
|
5767
5789
|
const key = dynamicProps[i];
|
|
5768
|
-
if (nextProps
|
|
5790
|
+
if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emits, key)) return true;
|
|
5769
5791
|
}
|
|
5770
5792
|
}
|
|
5771
5793
|
} else {
|
|
@@ -5784,10 +5806,16 @@ function hasPropsChanged(prevProps, nextProps, emitsOptions) {
|
|
|
5784
5806
|
if (nextKeys.length !== Object.keys(prevProps).length) return true;
|
|
5785
5807
|
for (let i = 0; i < nextKeys.length; i++) {
|
|
5786
5808
|
const key = nextKeys[i];
|
|
5787
|
-
if (nextProps
|
|
5809
|
+
if (hasPropValueChanged(nextProps, prevProps, key) && !isEmitListener(emitsOptions, key)) return true;
|
|
5788
5810
|
}
|
|
5789
5811
|
return false;
|
|
5790
5812
|
}
|
|
5813
|
+
function hasPropValueChanged(nextProps, prevProps, key) {
|
|
5814
|
+
const nextProp = nextProps[key];
|
|
5815
|
+
const prevProp = prevProps[key];
|
|
5816
|
+
if (key === "style" && isObject(nextProp) && isObject(prevProp)) return !looseEqual(nextProp, prevProp);
|
|
5817
|
+
return nextProp !== prevProp;
|
|
5818
|
+
}
|
|
5791
5819
|
function updateHOCHostEl({ vnode, parent }, el) {
|
|
5792
5820
|
while (parent && !parent.vapor) {
|
|
5793
5821
|
const root = parent.subTree;
|
|
@@ -6279,7 +6307,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6279
6307
|
processFragment(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
6280
6308
|
break;
|
|
6281
6309
|
case VaporSlot:
|
|
6282
|
-
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent);
|
|
6310
|
+
getVaporInterface(parentComponent, n2).slot(n1, n2, container, anchor, parentComponent, parentSuspense);
|
|
6283
6311
|
break;
|
|
6284
6312
|
default: if (shapeFlag & 1) processElement(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
6285
6313
|
else if (shapeFlag & 6) processComponent(n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized);
|
|
@@ -6294,13 +6322,7 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6294
6322
|
if (n1 == null) hostInsert(n2.el = hostCreateText(n2.children), container, anchor);
|
|
6295
6323
|
else {
|
|
6296
6324
|
const el = n2.el = n1.el;
|
|
6297
|
-
if (n2.children !== n1.children)
|
|
6298
|
-
const childNodes = container.childNodes;
|
|
6299
|
-
const newChild = hostCreateText(n2.children);
|
|
6300
|
-
const oldChild = childNodes[n2.__elIndex = n1.__elIndex];
|
|
6301
|
-
hostInsert(newChild, container, oldChild);
|
|
6302
|
-
hostRemove(oldChild);
|
|
6303
|
-
} else hostSetText(el, n2.children);
|
|
6325
|
+
if (n2.children !== n1.children) hostSetText(el, n2.children);
|
|
6304
6326
|
}
|
|
6305
6327
|
};
|
|
6306
6328
|
const processCommentNode = (n1, n2, container, anchor) => {
|
|
@@ -6636,7 +6658,9 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6636
6658
|
updateComponentPreRender(instance, next, optimized);
|
|
6637
6659
|
}
|
|
6638
6660
|
nonHydratedAsyncRoot.asyncDep.then(() => {
|
|
6639
|
-
|
|
6661
|
+
queuePostRenderEffect(() => {
|
|
6662
|
+
if (!instance.isUnmounted) instance.update();
|
|
6663
|
+
}, void 0, parentSuspense);
|
|
6640
6664
|
});
|
|
6641
6665
|
return;
|
|
6642
6666
|
}
|
|
@@ -7045,8 +7069,10 @@ function traverseStaticChildren(n1, n2, shallow = false) {
|
|
|
7045
7069
|
}
|
|
7046
7070
|
if (!shallow && c2.patchFlag !== -2) traverseStaticChildren(c1, c2);
|
|
7047
7071
|
}
|
|
7048
|
-
if (c2.type === Text)
|
|
7049
|
-
|
|
7072
|
+
if (c2.type === Text) {
|
|
7073
|
+
if (c2.patchFlag === -1) c2 = ch2[i] = cloneIfMounted(c2);
|
|
7074
|
+
c2.el = c1.el;
|
|
7075
|
+
}
|
|
7050
7076
|
if (c2.type === Comment && !c2.el) c2.el = c1.el;
|
|
7051
7077
|
c2.el && (c2.el.__vnode = c2);
|
|
7052
7078
|
}
|
|
@@ -8287,7 +8313,7 @@ function isMemoSame(cached, memo) {
|
|
|
8287
8313
|
|
|
8288
8314
|
//#endregion
|
|
8289
8315
|
//#region packages/runtime-core/src/index.ts
|
|
8290
|
-
const version = "3.6.0-beta.
|
|
8316
|
+
const version = "3.6.0-beta.7";
|
|
8291
8317
|
const warn = warn$1;
|
|
8292
8318
|
/**
|
|
8293
8319
|
* Runtime error messages. Only exposed in dev or esm builds.
|
|
@@ -9405,10 +9431,7 @@ const TransitionGroupImpl = /* @__PURE__ */ decorate({
|
|
|
9405
9431
|
if (child.el && child.el instanceof Element) {
|
|
9406
9432
|
prevChildren.push(child);
|
|
9407
9433
|
setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
|
|
9408
|
-
positionMap.set(child,
|
|
9409
|
-
left: child.el.offsetLeft,
|
|
9410
|
-
top: child.el.offsetTop
|
|
9411
|
-
});
|
|
9434
|
+
positionMap.set(child, getPosition(child.el));
|
|
9412
9435
|
}
|
|
9413
9436
|
}
|
|
9414
9437
|
children = slots.default ? getTransitionRawChildren(slots.default()) : [];
|
|
@@ -9427,10 +9450,7 @@ function callPendingCbs(el) {
|
|
|
9427
9450
|
if (el[enterCbKey]) el[enterCbKey]();
|
|
9428
9451
|
}
|
|
9429
9452
|
function recordPosition(c) {
|
|
9430
|
-
newPositionMap.set(c,
|
|
9431
|
-
left: c.el.offsetLeft,
|
|
9432
|
-
top: c.el.offsetTop
|
|
9433
|
-
});
|
|
9453
|
+
newPositionMap.set(c, getPosition(c.el));
|
|
9434
9454
|
}
|
|
9435
9455
|
function applyTranslation(c) {
|
|
9436
9456
|
if (baseApplyTranslation(positionMap.get(c), newPositionMap.get(c), c.el)) return c;
|
|
@@ -9440,12 +9460,28 @@ function baseApplyTranslation(oldPos, newPos, el) {
|
|
|
9440
9460
|
const dy = oldPos.top - newPos.top;
|
|
9441
9461
|
if (dx || dy) {
|
|
9442
9462
|
const s = el.style;
|
|
9443
|
-
|
|
9463
|
+
const rect = el.getBoundingClientRect();
|
|
9464
|
+
let scaleX = 1;
|
|
9465
|
+
let scaleY = 1;
|
|
9466
|
+
if (el.offsetWidth) scaleX = rect.width / el.offsetWidth;
|
|
9467
|
+
if (el.offsetHeight) scaleY = rect.height / el.offsetHeight;
|
|
9468
|
+
if (!Number.isFinite(scaleX) || scaleX === 0) scaleX = 1;
|
|
9469
|
+
if (!Number.isFinite(scaleY) || scaleY === 0) scaleY = 1;
|
|
9470
|
+
if (Math.abs(scaleX - 1) < .01) scaleX = 1;
|
|
9471
|
+
if (Math.abs(scaleY - 1) < .01) scaleY = 1;
|
|
9472
|
+
s.transform = s.webkitTransform = `translate(${dx / scaleX}px,${dy / scaleY}px)`;
|
|
9444
9473
|
s.transitionDuration = "0s";
|
|
9445
9474
|
return true;
|
|
9446
9475
|
}
|
|
9447
9476
|
return false;
|
|
9448
9477
|
}
|
|
9478
|
+
function getPosition(el) {
|
|
9479
|
+
const rect = el.getBoundingClientRect();
|
|
9480
|
+
return {
|
|
9481
|
+
left: rect.left,
|
|
9482
|
+
top: rect.top
|
|
9483
|
+
};
|
|
9484
|
+
}
|
|
9449
9485
|
function hasCSSTransform(el, root, moveClass) {
|
|
9450
9486
|
const clone = el.cloneNode();
|
|
9451
9487
|
const _vtc = el[vtcKey];
|
|
@@ -9732,6 +9768,7 @@ const modifierGuards = {
|
|
|
9732
9768
|
* @private
|
|
9733
9769
|
*/
|
|
9734
9770
|
const withModifiers = (fn, modifiers) => {
|
|
9771
|
+
if (!fn) return fn;
|
|
9735
9772
|
const cache = fn._withMods || (fn._withMods = {});
|
|
9736
9773
|
const cacheKey = modifiers.join(".");
|
|
9737
9774
|
return cache[cacheKey] || (cache[cacheKey] = ((event, ...args) => {
|