@vuact/runtime-dom 3.5.45-vuact.0 → 3.5.47-vuact.0
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 +27 -6
- package/dist/runtime-dom.cjs.prod.js +27 -6
- package/dist/runtime-dom.d.ts +3 -0
- package/dist/runtime-dom.esm-browser.js +234 -73
- package/dist/runtime-dom.esm-browser.prod.js +4 -4
- package/dist/runtime-dom.esm-bundler.js +92 -8
- package/dist/runtime-dom.global.js +234 -73
- package/dist/runtime-dom.global.prod.js +4 -4
- package/package.json +5 -5
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-dom v3.5.
|
|
2
|
+
* @vue/runtime-dom v3.5.47
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
|
-
import { warn, BaseTransitionPropsValidators, h, BaseTransition, assertNumber, getCurrentInstance, onBeforeUpdate, queuePostFlushCb, onMounted, watch, onUnmounted, Fragment, Static, camelize, callWithAsyncErrorHandling, nextTick, unref, createVNode, defineComponent, useTransitionState, onUpdated, toRaw, getTransitionRawChildren, setTransitionHooks, resolveTransitionHooks, Text, createRenderer, isRuntimeOnly, createHydrationRenderer } from '@vue/runtime-core';
|
|
6
|
+
import { warn, BaseTransitionPropsValidators, h, BaseTransition, assertNumber, getCurrentInstance, onScopeDispose, onBeforeUpdate, queuePostFlushCb, onMounted, watch, onUnmounted, Fragment, Static, camelize, callWithAsyncErrorHandling, nextTick, unref, createVNode, defineComponent, useTransitionState, onUpdated, toRaw, getTransitionRawChildren, setTransitionHooks, resolveTransitionHooks, Text, createRenderer, isRuntimeOnly, createHydrationRenderer } from '@vue/runtime-core';
|
|
7
7
|
export * from '@vue/runtime-core';
|
|
8
8
|
import { extend, isObject, toNumber, isArray, NOOP, normalizeCssVarValue, isString, hyphenate, capitalize, includeBooleanAttr, isSymbol, isSpecialBooleanAttr, isFunction, isOn, isModelListener, camelize as camelize$1, hasOwn, isPlainObject, EMPTY_OBJ, looseIndexOf, isSet, looseEqual, looseToNumber, invokeArrayFns, isHTMLTag, isSVGTag, isMathMLTag } from '@vue/shared';
|
|
9
9
|
|
|
@@ -170,12 +170,14 @@ function resolveTransitionProps(rawProps) {
|
|
|
170
170
|
onAppearCancelled = onEnterCancelled
|
|
171
171
|
} = baseProps;
|
|
172
172
|
const finishEnter = (el, isAppear, done, isCancelled) => {
|
|
173
|
+
el._enterResolve = void 0;
|
|
173
174
|
el._enterCancelled = isCancelled;
|
|
174
175
|
removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
|
|
175
176
|
removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
|
|
176
177
|
done && done();
|
|
177
178
|
};
|
|
178
179
|
const finishLeave = (el, done) => {
|
|
180
|
+
el._leaveResolve = void 0;
|
|
179
181
|
el._isLeaving = false;
|
|
180
182
|
removeTransitionClass(el, leaveFromClass);
|
|
181
183
|
removeTransitionClass(el, leaveToClass);
|
|
@@ -185,10 +187,18 @@ function resolveTransitionProps(rawProps) {
|
|
|
185
187
|
const makeEnterHook = (isAppear) => {
|
|
186
188
|
return (el, done) => {
|
|
187
189
|
const hook = isAppear ? onAppear : onEnter;
|
|
188
|
-
const resolve = () =>
|
|
190
|
+
const resolve = () => {
|
|
191
|
+
if (el._enterResolve === resolve) {
|
|
192
|
+
finishEnter(el, isAppear, done);
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
el._enterResolve = resolve;
|
|
189
196
|
callHook(hook, [el, resolve]);
|
|
190
197
|
nextFrame(() => {
|
|
191
198
|
removeTransitionClass(el, isAppear ? appearFromClass : enterFromClass);
|
|
199
|
+
if (el._enterResolve !== resolve) {
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
192
202
|
addTransitionClass(el, isAppear ? appearToClass : enterToClass);
|
|
193
203
|
if (!hasExplicitCallback(hook)) {
|
|
194
204
|
whenTransitionEnds(el, type, enterDuration, resolve);
|
|
@@ -211,7 +221,12 @@ function resolveTransitionProps(rawProps) {
|
|
|
211
221
|
onAppear: makeEnterHook(true),
|
|
212
222
|
onLeave(el, done) {
|
|
213
223
|
el._isLeaving = true;
|
|
214
|
-
const resolve = () =>
|
|
224
|
+
const resolve = () => {
|
|
225
|
+
if (el._leaveResolve === resolve) {
|
|
226
|
+
finishLeave(el, done);
|
|
227
|
+
}
|
|
228
|
+
};
|
|
229
|
+
el._leaveResolve = resolve;
|
|
215
230
|
addTransitionClass(el, leaveFromClass);
|
|
216
231
|
if (!el._enterCancelled) {
|
|
217
232
|
forceReflow(el);
|
|
@@ -221,7 +236,7 @@ function resolveTransitionProps(rawProps) {
|
|
|
221
236
|
forceReflow(el);
|
|
222
237
|
}
|
|
223
238
|
nextFrame(() => {
|
|
224
|
-
if (
|
|
239
|
+
if (el._leaveResolve !== resolve) {
|
|
225
240
|
return;
|
|
226
241
|
}
|
|
227
242
|
removeTransitionClass(el, leaveFromClass);
|
|
@@ -440,11 +455,24 @@ function useCssVars(getter) {
|
|
|
440
455
|
!!(process.env.NODE_ENV !== "production") && warn(`useCssVars is called without current active component instance.`);
|
|
441
456
|
return;
|
|
442
457
|
}
|
|
443
|
-
const updateTeleports =
|
|
458
|
+
const updateTeleports = (vars = getter(instance.proxy)) => {
|
|
444
459
|
Array.from(
|
|
445
460
|
document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
|
|
446
461
|
).forEach((node) => setVarsOnNode(node, vars));
|
|
447
462
|
};
|
|
463
|
+
const owner = {
|
|
464
|
+
uid: String(instance.uid),
|
|
465
|
+
update: updateTeleports
|
|
466
|
+
};
|
|
467
|
+
onScopeDispose(() => owner.update = void 0);
|
|
468
|
+
instance.ut = (start, end) => {
|
|
469
|
+
if (start) {
|
|
470
|
+
start[TELEPORT_KEY] = [end, owner];
|
|
471
|
+
observeTeleport(start);
|
|
472
|
+
markTeleport(start);
|
|
473
|
+
}
|
|
474
|
+
updateTeleports();
|
|
475
|
+
};
|
|
448
476
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
449
477
|
instance.getCssVars = () => getter(instance.proxy);
|
|
450
478
|
}
|
|
@@ -467,6 +495,56 @@ function useCssVars(getter) {
|
|
|
467
495
|
onUnmounted(() => ob.disconnect());
|
|
468
496
|
});
|
|
469
497
|
}
|
|
498
|
+
const TELEPORT_KEY = /* @__PURE__ */ Symbol(!!(process.env.NODE_ENV !== "production") ? "TELEPORT_KEY" : "");
|
|
499
|
+
function markTeleport(start, added) {
|
|
500
|
+
const [end, owner] = start[TELEPORT_KEY];
|
|
501
|
+
let update;
|
|
502
|
+
if (owner.update) {
|
|
503
|
+
for (let node = start; node && node !== end; node = node.nextSibling) {
|
|
504
|
+
if (node.nodeType === 1 && (!added || (added === true || added.has(node)) && (node.getAttribute("data-v-owner") || owner.uid) === owner.uid)) {
|
|
505
|
+
node.setAttribute("data-v-owner", owner.uid);
|
|
506
|
+
update = owner.update;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
return update;
|
|
511
|
+
}
|
|
512
|
+
function observeTeleport(start) {
|
|
513
|
+
const container = start.parentNode;
|
|
514
|
+
if (container) {
|
|
515
|
+
let starts = container[TELEPORT_KEY];
|
|
516
|
+
if (!starts) {
|
|
517
|
+
starts = container[TELEPORT_KEY] = /* @__PURE__ */ new Set();
|
|
518
|
+
new MutationObserver(onTeleportMutations).observe(container, {
|
|
519
|
+
childList: true
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
starts.add(start);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
function onTeleportMutations(records, ob) {
|
|
526
|
+
const container = records[0].target;
|
|
527
|
+
const starts = container[TELEPORT_KEY];
|
|
528
|
+
const added = /* @__PURE__ */ new Set();
|
|
529
|
+
for (const { addedNodes } of records) {
|
|
530
|
+
addedNodes.forEach((node) => added.add(node));
|
|
531
|
+
}
|
|
532
|
+
const updates = /* @__PURE__ */ new Set();
|
|
533
|
+
starts.forEach((start) => {
|
|
534
|
+
if (start.parentNode !== container) {
|
|
535
|
+
starts.delete(start);
|
|
536
|
+
observeTeleport(start);
|
|
537
|
+
updates.add(markTeleport(start, true));
|
|
538
|
+
} else if (added.size) {
|
|
539
|
+
updates.add(markTeleport(start, added));
|
|
540
|
+
}
|
|
541
|
+
});
|
|
542
|
+
updates.forEach((update) => update && update());
|
|
543
|
+
if (!starts.size) {
|
|
544
|
+
ob.disconnect();
|
|
545
|
+
container[TELEPORT_KEY] = void 0;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
470
548
|
function setVarsOnVNode(vnode, vars) {
|
|
471
549
|
if (vnode.shapeFlag & 128) {
|
|
472
550
|
const suspense = vnode.suspense;
|
|
@@ -1968,8 +2046,14 @@ const keyNames = {
|
|
|
1968
2046
|
const withKeys = (fn, modifiers) => {
|
|
1969
2047
|
const cache = fn._withKeys || (fn._withKeys = {});
|
|
1970
2048
|
const cacheKey = modifiers.join(".");
|
|
1971
|
-
|
|
2049
|
+
const cached = cache[cacheKey];
|
|
2050
|
+
if (cached) return cached;
|
|
2051
|
+
const hasButtonModifier = modifiers.some((m) => m === "left" || m === "right");
|
|
2052
|
+
return cache[cacheKey] = ((event) => {
|
|
1972
2053
|
if (!("key" in event)) {
|
|
2054
|
+
if (hasButtonModifier) {
|
|
2055
|
+
return fn(event);
|
|
2056
|
+
}
|
|
1973
2057
|
return;
|
|
1974
2058
|
}
|
|
1975
2059
|
const eventKey = hyphenate(event.key);
|
|
@@ -1978,7 +2062,7 @@ const withKeys = (fn, modifiers) => {
|
|
|
1978
2062
|
)) {
|
|
1979
2063
|
return fn(event);
|
|
1980
2064
|
}
|
|
1981
|
-
})
|
|
2065
|
+
});
|
|
1982
2066
|
};
|
|
1983
2067
|
|
|
1984
2068
|
const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps);
|