@vue/runtime-core 3.5.10 → 3.5.12
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-core.cjs.js +64 -39
- package/dist/runtime-core.cjs.prod.js +51 -34
- package/dist/runtime-core.d.ts +7 -7
- package/dist/runtime-core.esm-bundler.js +65 -40
- package/package.json +3 -3
package/dist/runtime-core.cjs.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.5.
|
|
2
|
+
* @vue/runtime-core v3.5.12
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -273,10 +273,8 @@ function logError(err, type, contextVNode, throwInDev = true, throwInProd = fals
|
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
let isFlushing = false;
|
|
277
|
-
let isFlushPending = false;
|
|
278
276
|
const queue = [];
|
|
279
|
-
let flushIndex =
|
|
277
|
+
let flushIndex = -1;
|
|
280
278
|
const pendingPostFlushCbs = [];
|
|
281
279
|
let activePostFlushCbs = null;
|
|
282
280
|
let postFlushIndex = 0;
|
|
@@ -288,7 +286,7 @@ function nextTick(fn) {
|
|
|
288
286
|
return fn ? p.then(this ? fn.bind(this) : fn) : p;
|
|
289
287
|
}
|
|
290
288
|
function findInsertionIndex(id) {
|
|
291
|
-
let start =
|
|
289
|
+
let start = flushIndex + 1;
|
|
292
290
|
let end = queue.length;
|
|
293
291
|
while (start < end) {
|
|
294
292
|
const middle = start + end >>> 1;
|
|
@@ -317,8 +315,7 @@ function queueJob(job) {
|
|
|
317
315
|
}
|
|
318
316
|
}
|
|
319
317
|
function queueFlush() {
|
|
320
|
-
if (!
|
|
321
|
-
isFlushPending = true;
|
|
318
|
+
if (!currentFlushPromise) {
|
|
322
319
|
currentFlushPromise = resolvedPromise.then(flushJobs);
|
|
323
320
|
}
|
|
324
321
|
}
|
|
@@ -335,7 +332,7 @@ function queuePostFlushCb(cb) {
|
|
|
335
332
|
}
|
|
336
333
|
queueFlush();
|
|
337
334
|
}
|
|
338
|
-
function flushPreFlushCbs(instance, seen, i =
|
|
335
|
+
function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
|
|
339
336
|
{
|
|
340
337
|
seen = seen || /* @__PURE__ */ new Map();
|
|
341
338
|
}
|
|
@@ -391,8 +388,6 @@ function flushPostFlushCbs(seen) {
|
|
|
391
388
|
}
|
|
392
389
|
const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
|
|
393
390
|
function flushJobs(seen) {
|
|
394
|
-
isFlushPending = false;
|
|
395
|
-
isFlushing = true;
|
|
396
391
|
{
|
|
397
392
|
seen = seen || /* @__PURE__ */ new Map();
|
|
398
393
|
}
|
|
@@ -424,10 +419,9 @@ function flushJobs(seen) {
|
|
|
424
419
|
job.flags &= ~1;
|
|
425
420
|
}
|
|
426
421
|
}
|
|
427
|
-
flushIndex =
|
|
422
|
+
flushIndex = -1;
|
|
428
423
|
queue.length = 0;
|
|
429
424
|
flushPostFlushCbs(seen);
|
|
430
|
-
isFlushing = false;
|
|
431
425
|
currentFlushPromise = null;
|
|
432
426
|
if (queue.length || pendingPostFlushCbs.length) {
|
|
433
427
|
flushJobs(seen);
|
|
@@ -847,7 +841,7 @@ const TeleportImpl = {
|
|
|
847
841
|
}
|
|
848
842
|
if (!disabled) {
|
|
849
843
|
mount(target, targetAnchor);
|
|
850
|
-
updateCssVars(n2);
|
|
844
|
+
updateCssVars(n2, false);
|
|
851
845
|
}
|
|
852
846
|
} else if (!disabled) {
|
|
853
847
|
warn$1(
|
|
@@ -859,7 +853,7 @@ const TeleportImpl = {
|
|
|
859
853
|
};
|
|
860
854
|
if (disabled) {
|
|
861
855
|
mount(container, mainAnchor);
|
|
862
|
-
updateCssVars(n2);
|
|
856
|
+
updateCssVars(n2, true);
|
|
863
857
|
}
|
|
864
858
|
if (isTeleportDeferred(n2.props)) {
|
|
865
859
|
queuePostRenderEffect(mountToTarget, parentSuspense);
|
|
@@ -949,7 +943,7 @@ const TeleportImpl = {
|
|
|
949
943
|
);
|
|
950
944
|
}
|
|
951
945
|
}
|
|
952
|
-
updateCssVars(n2);
|
|
946
|
+
updateCssVars(n2, disabled);
|
|
953
947
|
}
|
|
954
948
|
},
|
|
955
949
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
@@ -1017,9 +1011,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
1017
1011
|
querySelector
|
|
1018
1012
|
);
|
|
1019
1013
|
if (target) {
|
|
1014
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
1020
1015
|
const targetNode = target._lpa || target.firstChild;
|
|
1021
1016
|
if (vnode.shapeFlag & 16) {
|
|
1022
|
-
if (
|
|
1017
|
+
if (disabled) {
|
|
1023
1018
|
vnode.anchor = hydrateChildren(
|
|
1024
1019
|
nextSibling(node),
|
|
1025
1020
|
vnode,
|
|
@@ -1060,16 +1055,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
1060
1055
|
);
|
|
1061
1056
|
}
|
|
1062
1057
|
}
|
|
1063
|
-
updateCssVars(vnode);
|
|
1058
|
+
updateCssVars(vnode, disabled);
|
|
1064
1059
|
}
|
|
1065
1060
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
1066
1061
|
}
|
|
1067
1062
|
const Teleport = TeleportImpl;
|
|
1068
|
-
function updateCssVars(vnode) {
|
|
1063
|
+
function updateCssVars(vnode, isDisabled) {
|
|
1069
1064
|
const ctx = vnode.ctx;
|
|
1070
1065
|
if (ctx && ctx.ut) {
|
|
1071
|
-
let node
|
|
1072
|
-
|
|
1066
|
+
let node, anchor;
|
|
1067
|
+
if (isDisabled) {
|
|
1068
|
+
node = vnode.el;
|
|
1069
|
+
anchor = vnode.anchor;
|
|
1070
|
+
} else {
|
|
1071
|
+
node = vnode.targetStart;
|
|
1072
|
+
anchor = vnode.targetAnchor;
|
|
1073
|
+
}
|
|
1074
|
+
while (node && node !== anchor) {
|
|
1073
1075
|
if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
|
|
1074
1076
|
node = node.nextSibling;
|
|
1075
1077
|
}
|
|
@@ -1519,8 +1521,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1519
1521
|
const setupState = owner.setupState;
|
|
1520
1522
|
const rawSetupState = reactivity.toRaw(setupState);
|
|
1521
1523
|
const canSetSetupRef = setupState === shared.EMPTY_OBJ ? () => false : (key) => {
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
+
{
|
|
1525
|
+
if (shared.hasOwn(rawSetupState, key) && !reactivity.isRef(rawSetupState[key])) {
|
|
1526
|
+
warn$1(
|
|
1527
|
+
`Template ref "${key}" used on a non-ref value. It will not work in the production build.`
|
|
1528
|
+
);
|
|
1529
|
+
}
|
|
1530
|
+
if (knownTemplateRefs.has(rawSetupState[key])) {
|
|
1531
|
+
return false;
|
|
1532
|
+
}
|
|
1524
1533
|
}
|
|
1525
1534
|
return shared.hasOwn(rawSetupState, key);
|
|
1526
1535
|
};
|
|
@@ -1817,7 +1826,11 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1817
1826
|
}
|
|
1818
1827
|
let needCallTransitionHooks = false;
|
|
1819
1828
|
if (isTemplateNode(el)) {
|
|
1820
|
-
needCallTransitionHooks = needTransition(
|
|
1829
|
+
needCallTransitionHooks = needTransition(
|
|
1830
|
+
null,
|
|
1831
|
+
// no need check parentSuspense in hydration
|
|
1832
|
+
transition
|
|
1833
|
+
) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
1821
1834
|
const content = el.content.firstChild;
|
|
1822
1835
|
if (needCallTransitionHooks) {
|
|
1823
1836
|
transition.beforeEnter(content);
|
|
@@ -2210,6 +2223,8 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
2210
2223
|
}
|
|
2211
2224
|
}
|
|
2212
2225
|
|
|
2226
|
+
const requestIdleCallback = shared.getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
|
|
2227
|
+
const cancelIdleCallback = shared.getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
|
|
2213
2228
|
const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
|
|
2214
2229
|
const id = requestIdleCallback(hydrate, { timeout });
|
|
2215
2230
|
return () => cancelIdleCallback(id);
|
|
@@ -2912,12 +2927,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
2912
2927
|
}
|
|
2913
2928
|
openBlock();
|
|
2914
2929
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
2930
|
+
const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
|
|
2931
|
+
// key attached in the `createSlots` helper, respect that
|
|
2932
|
+
validSlotContent && validSlotContent.key;
|
|
2915
2933
|
const rendered = createBlock(
|
|
2916
2934
|
Fragment,
|
|
2917
2935
|
{
|
|
2918
|
-
key: (
|
|
2919
|
-
// key attached in the `createSlots` helper, respect that
|
|
2920
|
-
validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
2936
|
+
key: (slotKey && !shared.isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
2921
2937
|
(!validSlotContent && fallback ? "_fb" : "")
|
|
2922
2938
|
},
|
|
2923
2939
|
validSlotContent || (fallback ? fallback() : []),
|
|
@@ -4275,6 +4291,7 @@ function getType(ctor) {
|
|
|
4275
4291
|
function validateProps(rawProps, props, instance) {
|
|
4276
4292
|
const resolvedValues = reactivity.toRaw(props);
|
|
4277
4293
|
const options = instance.propsOptions[0];
|
|
4294
|
+
const camelizePropsKey = Object.keys(rawProps).map((key) => shared.camelize(key));
|
|
4278
4295
|
for (const key in options) {
|
|
4279
4296
|
let opt = options[key];
|
|
4280
4297
|
if (opt == null) continue;
|
|
@@ -4283,7 +4300,7 @@ function validateProps(rawProps, props, instance) {
|
|
|
4283
4300
|
resolvedValues[key],
|
|
4284
4301
|
opt,
|
|
4285
4302
|
reactivity.shallowReadonly(resolvedValues) ,
|
|
4286
|
-
!
|
|
4303
|
+
!camelizePropsKey.includes(key)
|
|
4287
4304
|
);
|
|
4288
4305
|
}
|
|
4289
4306
|
}
|
|
@@ -6063,14 +6080,13 @@ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
|
6063
6080
|
}
|
|
6064
6081
|
const baseWatchOptions = shared.extend({}, options);
|
|
6065
6082
|
baseWatchOptions.onWarn = warn$1;
|
|
6083
|
+
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
6066
6084
|
let ssrCleanup;
|
|
6067
6085
|
if (isInSSRComponentSetup) {
|
|
6068
6086
|
if (flush === "sync") {
|
|
6069
6087
|
const ctx = useSSRContext();
|
|
6070
6088
|
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
6071
|
-
} else if (!
|
|
6072
|
-
baseWatchOptions.once = true;
|
|
6073
|
-
} else {
|
|
6089
|
+
} else if (!runsImmediately) {
|
|
6074
6090
|
const watchStopHandle = () => {
|
|
6075
6091
|
};
|
|
6076
6092
|
watchStopHandle.stop = shared.NOOP;
|
|
@@ -6109,7 +6125,13 @@ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
|
6109
6125
|
}
|
|
6110
6126
|
};
|
|
6111
6127
|
const watchHandle = reactivity.watch(source, cb, baseWatchOptions);
|
|
6112
|
-
if (
|
|
6128
|
+
if (isInSSRComponentSetup) {
|
|
6129
|
+
if (ssrCleanup) {
|
|
6130
|
+
ssrCleanup.push(watchHandle);
|
|
6131
|
+
} else if (runsImmediately) {
|
|
6132
|
+
watchHandle();
|
|
6133
|
+
}
|
|
6134
|
+
}
|
|
6113
6135
|
return watchHandle;
|
|
6114
6136
|
}
|
|
6115
6137
|
function instanceWatch(source, value, options) {
|
|
@@ -6144,19 +6166,19 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
|
6144
6166
|
warn$1(`useModel() called without active instance.`);
|
|
6145
6167
|
return reactivity.ref();
|
|
6146
6168
|
}
|
|
6147
|
-
|
|
6169
|
+
const camelizedName = shared.camelize(name);
|
|
6170
|
+
if (!i.propsOptions[0][camelizedName]) {
|
|
6148
6171
|
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
6149
6172
|
return reactivity.ref();
|
|
6150
6173
|
}
|
|
6151
|
-
const camelizedName = shared.camelize(name);
|
|
6152
6174
|
const hyphenatedName = shared.hyphenate(name);
|
|
6153
|
-
const modifiers = getModelModifiers(props,
|
|
6175
|
+
const modifiers = getModelModifiers(props, camelizedName);
|
|
6154
6176
|
const res = reactivity.customRef((track, trigger) => {
|
|
6155
6177
|
let localValue;
|
|
6156
6178
|
let prevSetValue = shared.EMPTY_OBJ;
|
|
6157
6179
|
let prevEmittedValue;
|
|
6158
6180
|
watchSyncEffect(() => {
|
|
6159
|
-
const propValue = props[
|
|
6181
|
+
const propValue = props[camelizedName];
|
|
6160
6182
|
if (shared.hasChanged(localValue, propValue)) {
|
|
6161
6183
|
localValue = propValue;
|
|
6162
6184
|
trigger();
|
|
@@ -7783,9 +7805,9 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
7783
7805
|
}
|
|
7784
7806
|
const { setup } = Component;
|
|
7785
7807
|
if (setup) {
|
|
7808
|
+
reactivity.pauseTracking();
|
|
7786
7809
|
const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
|
|
7787
7810
|
const reset = setCurrentInstance(instance);
|
|
7788
|
-
reactivity.pauseTracking();
|
|
7789
7811
|
const setupResult = callWithErrorHandling(
|
|
7790
7812
|
setup,
|
|
7791
7813
|
instance,
|
|
@@ -7795,10 +7817,13 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
7795
7817
|
setupContext
|
|
7796
7818
|
]
|
|
7797
7819
|
);
|
|
7820
|
+
const isAsyncSetup = shared.isPromise(setupResult);
|
|
7798
7821
|
reactivity.resetTracking();
|
|
7799
7822
|
reset();
|
|
7800
|
-
if (
|
|
7801
|
-
|
|
7823
|
+
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
|
|
7824
|
+
markAsyncBoundary(instance);
|
|
7825
|
+
}
|
|
7826
|
+
if (isAsyncSetup) {
|
|
7802
7827
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
7803
7828
|
if (isSSR) {
|
|
7804
7829
|
return setupResult.then((resolvedResult) => {
|
|
@@ -8261,7 +8286,7 @@ function isMemoSame(cached, memo) {
|
|
|
8261
8286
|
return true;
|
|
8262
8287
|
}
|
|
8263
8288
|
|
|
8264
|
-
const version = "3.5.
|
|
8289
|
+
const version = "3.5.12";
|
|
8265
8290
|
const warn = warn$1 ;
|
|
8266
8291
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
8267
8292
|
const devtools = devtools$1 ;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.5.
|
|
2
|
+
* @vue/runtime-core v3.5.12
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
@@ -145,10 +145,8 @@ function logError(err, type, contextVNode, throwInDev = true, throwInProd = fals
|
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
let isFlushing = false;
|
|
149
|
-
let isFlushPending = false;
|
|
150
148
|
const queue = [];
|
|
151
|
-
let flushIndex =
|
|
149
|
+
let flushIndex = -1;
|
|
152
150
|
const pendingPostFlushCbs = [];
|
|
153
151
|
let activePostFlushCbs = null;
|
|
154
152
|
let postFlushIndex = 0;
|
|
@@ -159,7 +157,7 @@ function nextTick(fn) {
|
|
|
159
157
|
return fn ? p.then(this ? fn.bind(this) : fn) : p;
|
|
160
158
|
}
|
|
161
159
|
function findInsertionIndex(id) {
|
|
162
|
-
let start =
|
|
160
|
+
let start = flushIndex + 1;
|
|
163
161
|
let end = queue.length;
|
|
164
162
|
while (start < end) {
|
|
165
163
|
const middle = start + end >>> 1;
|
|
@@ -188,8 +186,7 @@ function queueJob(job) {
|
|
|
188
186
|
}
|
|
189
187
|
}
|
|
190
188
|
function queueFlush() {
|
|
191
|
-
if (!
|
|
192
|
-
isFlushPending = true;
|
|
189
|
+
if (!currentFlushPromise) {
|
|
193
190
|
currentFlushPromise = resolvedPromise.then(flushJobs);
|
|
194
191
|
}
|
|
195
192
|
}
|
|
@@ -206,7 +203,7 @@ function queuePostFlushCb(cb) {
|
|
|
206
203
|
}
|
|
207
204
|
queueFlush();
|
|
208
205
|
}
|
|
209
|
-
function flushPreFlushCbs(instance, seen, i =
|
|
206
|
+
function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
|
|
210
207
|
for (; i < queue.length; i++) {
|
|
211
208
|
const cb = queue[i];
|
|
212
209
|
if (cb && cb.flags & 2) {
|
|
@@ -250,8 +247,6 @@ function flushPostFlushCbs(seen) {
|
|
|
250
247
|
}
|
|
251
248
|
const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
|
|
252
249
|
function flushJobs(seen) {
|
|
253
|
-
isFlushPending = false;
|
|
254
|
-
isFlushing = true;
|
|
255
250
|
try {
|
|
256
251
|
for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
|
|
257
252
|
const job = queue[flushIndex];
|
|
@@ -277,10 +272,9 @@ function flushJobs(seen) {
|
|
|
277
272
|
job.flags &= ~1;
|
|
278
273
|
}
|
|
279
274
|
}
|
|
280
|
-
flushIndex =
|
|
275
|
+
flushIndex = -1;
|
|
281
276
|
queue.length = 0;
|
|
282
277
|
flushPostFlushCbs();
|
|
283
|
-
isFlushing = false;
|
|
284
278
|
currentFlushPromise = null;
|
|
285
279
|
if (queue.length || pendingPostFlushCbs.length) {
|
|
286
280
|
flushJobs();
|
|
@@ -446,13 +440,13 @@ const TeleportImpl = {
|
|
|
446
440
|
}
|
|
447
441
|
if (!disabled) {
|
|
448
442
|
mount(target, targetAnchor);
|
|
449
|
-
updateCssVars(n2);
|
|
443
|
+
updateCssVars(n2, false);
|
|
450
444
|
}
|
|
451
445
|
}
|
|
452
446
|
};
|
|
453
447
|
if (disabled) {
|
|
454
448
|
mount(container, mainAnchor);
|
|
455
|
-
updateCssVars(n2);
|
|
449
|
+
updateCssVars(n2, true);
|
|
456
450
|
}
|
|
457
451
|
if (isTeleportDeferred(n2.props)) {
|
|
458
452
|
queuePostRenderEffect(mountToTarget, parentSuspense);
|
|
@@ -536,7 +530,7 @@ const TeleportImpl = {
|
|
|
536
530
|
);
|
|
537
531
|
}
|
|
538
532
|
}
|
|
539
|
-
updateCssVars(n2);
|
|
533
|
+
updateCssVars(n2, disabled);
|
|
540
534
|
}
|
|
541
535
|
},
|
|
542
536
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
@@ -604,9 +598,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
604
598
|
querySelector
|
|
605
599
|
);
|
|
606
600
|
if (target) {
|
|
601
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
607
602
|
const targetNode = target._lpa || target.firstChild;
|
|
608
603
|
if (vnode.shapeFlag & 16) {
|
|
609
|
-
if (
|
|
604
|
+
if (disabled) {
|
|
610
605
|
vnode.anchor = hydrateChildren(
|
|
611
606
|
nextSibling(node),
|
|
612
607
|
vnode,
|
|
@@ -647,16 +642,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
647
642
|
);
|
|
648
643
|
}
|
|
649
644
|
}
|
|
650
|
-
updateCssVars(vnode);
|
|
645
|
+
updateCssVars(vnode, disabled);
|
|
651
646
|
}
|
|
652
647
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
653
648
|
}
|
|
654
649
|
const Teleport = TeleportImpl;
|
|
655
|
-
function updateCssVars(vnode) {
|
|
650
|
+
function updateCssVars(vnode, isDisabled) {
|
|
656
651
|
const ctx = vnode.ctx;
|
|
657
652
|
if (ctx && ctx.ut) {
|
|
658
|
-
let node
|
|
659
|
-
|
|
653
|
+
let node, anchor;
|
|
654
|
+
if (isDisabled) {
|
|
655
|
+
node = vnode.el;
|
|
656
|
+
anchor = vnode.anchor;
|
|
657
|
+
} else {
|
|
658
|
+
node = vnode.targetStart;
|
|
659
|
+
anchor = vnode.targetAnchor;
|
|
660
|
+
}
|
|
661
|
+
while (node && node !== anchor) {
|
|
660
662
|
if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
|
|
661
663
|
node = node.nextSibling;
|
|
662
664
|
}
|
|
@@ -1345,7 +1347,11 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1345
1347
|
}
|
|
1346
1348
|
let needCallTransitionHooks = false;
|
|
1347
1349
|
if (isTemplateNode(el)) {
|
|
1348
|
-
needCallTransitionHooks = needTransition(
|
|
1350
|
+
needCallTransitionHooks = needTransition(
|
|
1351
|
+
null,
|
|
1352
|
+
// no need check parentSuspense in hydration
|
|
1353
|
+
transition
|
|
1354
|
+
) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
1349
1355
|
const content = el.content.firstChild;
|
|
1350
1356
|
if (needCallTransitionHooks) {
|
|
1351
1357
|
transition.beforeEnter(content);
|
|
@@ -1588,6 +1594,8 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
1588
1594
|
}
|
|
1589
1595
|
}
|
|
1590
1596
|
|
|
1597
|
+
const requestIdleCallback = shared.getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
|
|
1598
|
+
const cancelIdleCallback = shared.getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
|
|
1591
1599
|
const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
|
|
1592
1600
|
const id = requestIdleCallback(hydrate, { timeout });
|
|
1593
1601
|
return () => cancelIdleCallback(id);
|
|
@@ -2247,12 +2255,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
2247
2255
|
}
|
|
2248
2256
|
openBlock();
|
|
2249
2257
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
2258
|
+
const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
|
|
2259
|
+
// key attached in the `createSlots` helper, respect that
|
|
2260
|
+
validSlotContent && validSlotContent.key;
|
|
2250
2261
|
const rendered = createBlock(
|
|
2251
2262
|
Fragment,
|
|
2252
2263
|
{
|
|
2253
|
-
key: (
|
|
2254
|
-
// key attached in the `createSlots` helper, respect that
|
|
2255
|
-
validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
2264
|
+
key: (slotKey && !shared.isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
2256
2265
|
(!validSlotContent && fallback ? "_fb" : "")
|
|
2257
2266
|
},
|
|
2258
2267
|
validSlotContent || (fallback ? fallback() : []),
|
|
@@ -4745,14 +4754,13 @@ function watch(source, cb, options) {
|
|
|
4745
4754
|
function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
4746
4755
|
const { immediate, deep, flush, once } = options;
|
|
4747
4756
|
const baseWatchOptions = shared.extend({}, options);
|
|
4757
|
+
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
4748
4758
|
let ssrCleanup;
|
|
4749
4759
|
if (isInSSRComponentSetup) {
|
|
4750
4760
|
if (flush === "sync") {
|
|
4751
4761
|
const ctx = useSSRContext();
|
|
4752
4762
|
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
4753
|
-
} else if (!
|
|
4754
|
-
baseWatchOptions.once = true;
|
|
4755
|
-
} else {
|
|
4763
|
+
} else if (!runsImmediately) {
|
|
4756
4764
|
const watchStopHandle = () => {
|
|
4757
4765
|
};
|
|
4758
4766
|
watchStopHandle.stop = shared.NOOP;
|
|
@@ -4791,7 +4799,13 @@ function doWatch(source, cb, options = shared.EMPTY_OBJ) {
|
|
|
4791
4799
|
}
|
|
4792
4800
|
};
|
|
4793
4801
|
const watchHandle = reactivity.watch(source, cb, baseWatchOptions);
|
|
4794
|
-
if (
|
|
4802
|
+
if (isInSSRComponentSetup) {
|
|
4803
|
+
if (ssrCleanup) {
|
|
4804
|
+
ssrCleanup.push(watchHandle);
|
|
4805
|
+
} else if (runsImmediately) {
|
|
4806
|
+
watchHandle();
|
|
4807
|
+
}
|
|
4808
|
+
}
|
|
4795
4809
|
return watchHandle;
|
|
4796
4810
|
}
|
|
4797
4811
|
function instanceWatch(source, value, options) {
|
|
@@ -4824,13 +4838,13 @@ function useModel(props, name, options = shared.EMPTY_OBJ) {
|
|
|
4824
4838
|
const i = getCurrentInstance();
|
|
4825
4839
|
const camelizedName = shared.camelize(name);
|
|
4826
4840
|
const hyphenatedName = shared.hyphenate(name);
|
|
4827
|
-
const modifiers = getModelModifiers(props,
|
|
4841
|
+
const modifiers = getModelModifiers(props, camelizedName);
|
|
4828
4842
|
const res = reactivity.customRef((track, trigger) => {
|
|
4829
4843
|
let localValue;
|
|
4830
4844
|
let prevSetValue = shared.EMPTY_OBJ;
|
|
4831
4845
|
let prevEmittedValue;
|
|
4832
4846
|
watchSyncEffect(() => {
|
|
4833
|
-
const propValue = props[
|
|
4847
|
+
const propValue = props[camelizedName];
|
|
4834
4848
|
if (shared.hasChanged(localValue, propValue)) {
|
|
4835
4849
|
localValue = propValue;
|
|
4836
4850
|
trigger();
|
|
@@ -6235,9 +6249,9 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
6235
6249
|
instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers);
|
|
6236
6250
|
const { setup } = Component;
|
|
6237
6251
|
if (setup) {
|
|
6252
|
+
reactivity.pauseTracking();
|
|
6238
6253
|
const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
|
|
6239
6254
|
const reset = setCurrentInstance(instance);
|
|
6240
|
-
reactivity.pauseTracking();
|
|
6241
6255
|
const setupResult = callWithErrorHandling(
|
|
6242
6256
|
setup,
|
|
6243
6257
|
instance,
|
|
@@ -6247,10 +6261,13 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
6247
6261
|
setupContext
|
|
6248
6262
|
]
|
|
6249
6263
|
);
|
|
6264
|
+
const isAsyncSetup = shared.isPromise(setupResult);
|
|
6250
6265
|
reactivity.resetTracking();
|
|
6251
6266
|
reset();
|
|
6252
|
-
if (
|
|
6253
|
-
|
|
6267
|
+
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
|
|
6268
|
+
markAsyncBoundary(instance);
|
|
6269
|
+
}
|
|
6270
|
+
if (isAsyncSetup) {
|
|
6254
6271
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
6255
6272
|
if (isSSR) {
|
|
6256
6273
|
return setupResult.then((resolvedResult) => {
|
|
@@ -6430,7 +6447,7 @@ function isMemoSame(cached, memo) {
|
|
|
6430
6447
|
return true;
|
|
6431
6448
|
}
|
|
6432
6449
|
|
|
6433
|
-
const version = "3.5.
|
|
6450
|
+
const version = "3.5.12";
|
|
6434
6451
|
const warn$1 = shared.NOOP;
|
|
6435
6452
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
6436
6453
|
const devtools = void 0;
|
package/dist/runtime-core.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { computed as computed$1, Ref, OnCleanup, WatchStopHandle, ShallowUnwrapRef, UnwrapNestedRefs, DebuggerEvent, ComputedGetter, WritableComputedOptions, WatchCallback, ReactiveEffect, DebuggerOptions, WatchEffect, WatchHandle, WatchSource, ReactiveMarker, ShallowRef, WatchErrorCodes, reactive } from '@vue/reactivity';
|
|
2
2
|
export { ComputedGetter, ComputedRef, ComputedSetter, CustomRefFactory, DebuggerEvent, DebuggerEventExtraInfo, DebuggerOptions, DeepReadonly, EffectScheduler, EffectScope, MaybeRef, MaybeRefOrGetter, Raw, Reactive, ReactiveEffect, ReactiveEffectOptions, ReactiveEffectRunner, ReactiveFlags, Ref, ShallowReactive, ShallowRef, ShallowUnwrapRef, ToRef, ToRefs, TrackOpTypes, TriggerOpTypes, UnwrapNestedRefs, UnwrapRef, WatchCallback, WatchEffect, WatchHandle, WatchSource, WatchStopHandle, WritableComputedOptions, WritableComputedRef, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
|
|
3
|
-
import { IfAny, Prettify, LooseRequired, UnionToIntersection, OverloadParameters } from '@vue/shared';
|
|
3
|
+
import { IfAny, Prettify, LooseRequired, UnionToIntersection, OverloadParameters, IsKeyValues } from '@vue/shared';
|
|
4
4
|
export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
|
|
5
5
|
|
|
6
6
|
export declare const computed: typeof computed$1;
|
|
@@ -331,11 +331,11 @@ type InferDefaults<T> = {
|
|
|
331
331
|
};
|
|
332
332
|
type NativeType = null | number | string | boolean | symbol | Function;
|
|
333
333
|
type InferDefault<P, T> = ((props: P) => T & {}) | (T extends NativeType ? T : never);
|
|
334
|
-
type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = Readonly<MappedOmit<T, keyof Defaults>> & {
|
|
334
|
+
type PropsWithDefaults<T, Defaults extends InferDefaults<T>, BKeys extends keyof T> = T extends unknown ? Readonly<MappedOmit<T, keyof Defaults>> & {
|
|
335
335
|
readonly [K in keyof Defaults as K extends keyof T ? K : never]-?: K extends keyof T ? Defaults[K] extends undefined ? IfAny<Defaults[K], NotUndefined<T[K]>, T[K]> : NotUndefined<T[K]> : never;
|
|
336
336
|
} & {
|
|
337
337
|
readonly [K in BKeys]-?: K extends keyof Defaults ? Defaults[K] extends undefined ? boolean | undefined : boolean : boolean;
|
|
338
|
-
};
|
|
338
|
+
} : never;
|
|
339
339
|
/**
|
|
340
340
|
* Vue `<script setup>` compiler macro for providing props default values when
|
|
341
341
|
* using type-based `defineProps` declaration.
|
|
@@ -978,7 +978,7 @@ export declare function hasInjectionContext(): boolean;
|
|
|
978
978
|
|
|
979
979
|
export type PublicProps = VNodeProps & AllowedComponentProps & ComponentCustomProps;
|
|
980
980
|
type ResolveProps<PropsOrPropOptions, E extends EmitsOptions> = Readonly<PropsOrPropOptions extends ComponentPropsOptions ? ExtractPropTypes<PropsOrPropOptions> : PropsOrPropOptions> & ({} extends E ? {} : EmitsToProps<E>);
|
|
981
|
-
export type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, PP = PublicProps, Props = ResolveProps<PropsOrPropOptions, E>, Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, MakeDefaultsOptional extends boolean = true, TypeRefs extends Record<string, unknown> = {}, TypeEl extends Element = any> = ComponentPublicInstanceConstructor<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, PP
|
|
981
|
+
export type DefineComponent<PropsOrPropOptions = {}, RawBindings = {}, D = {}, C extends ComputedOptions = ComputedOptions, M extends MethodOptions = MethodOptions, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, E extends EmitsOptions = {}, EE extends string = string, PP = PublicProps, Props = ResolveProps<PropsOrPropOptions, E>, Defaults = ExtractDefaultPropTypes<PropsOrPropOptions>, S extends SlotsType = {}, LC extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, MakeDefaultsOptional extends boolean = true, TypeRefs extends Record<string, unknown> = {}, TypeEl extends Element = any> = ComponentPublicInstanceConstructor<CreateComponentPublicInstanceWithMixins<Props, RawBindings, D, C, M, Mixin, Extends, E, PP, Defaults, MakeDefaultsOptional, {}, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, TypeRefs, TypeEl>> & ComponentOptionsBase<Props, RawBindings, D, C, M, Mixin, Extends, E, EE, Defaults, {}, string, S, LC & GlobalComponents, Directives & GlobalDirectives, Exposed, Provide> & PP;
|
|
982
982
|
export type DefineSetupFnComponent<P extends Record<string, any>, E extends EmitsOptions = {}, S extends SlotsType = SlotsType, Props = P & EmitsToProps<E>, PP = PublicProps> = new (props: Props & PP) => CreateComponentPublicInstanceWithMixins<Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, E, PP, {}, false, {}, S>;
|
|
983
983
|
type ToResolvedProps<Props, Emits extends EmitsOptions> = Readonly<Props> & Readonly<EmitsToProps<Emits>>;
|
|
984
984
|
export declare function defineComponent<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(setup: (props: Props, ctx: SetupContext<E, S>) => RenderFunction | Promise<RenderFunction>, options?: Pick<ComponentOptions, 'name' | 'inheritAttrs'> & {
|
|
@@ -991,9 +991,9 @@ export declare function defineComponent<Props extends Record<string, any>, E ext
|
|
|
991
991
|
emits?: E | EE[];
|
|
992
992
|
slots?: S;
|
|
993
993
|
}): DefineSetupFnComponent<Props, E, S>;
|
|
994
|
-
export declare function defineComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Data = {}, SetupBindings = {}, Computed extends ComputedOptions = {}, Methods extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, InjectOptions extends ComponentInjectOptions = {}, InjectKeys extends string = string, Slots extends SlotsType = {}, LocalComponents extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, ResolvedEmits extends EmitsOptions = {} extends RuntimeEmitsOptions ? TypeEmitsToOptions<TypeEmits> : RuntimeEmitsOptions, InferredProps =
|
|
994
|
+
export declare function defineComponent<TypeProps, RuntimePropsOptions extends ComponentObjectPropsOptions = ComponentObjectPropsOptions, RuntimePropsKeys extends string = string, TypeEmits extends ComponentTypeEmits = {}, RuntimeEmitsOptions extends EmitsOptions = {}, RuntimeEmitsKeys extends string = string, Data = {}, SetupBindings = {}, Computed extends ComputedOptions = {}, Methods extends MethodOptions = {}, Mixin extends ComponentOptionsMixin = ComponentOptionsMixin, Extends extends ComponentOptionsMixin = ComponentOptionsMixin, InjectOptions extends ComponentInjectOptions = {}, InjectKeys extends string = string, Slots extends SlotsType = {}, LocalComponents extends Record<string, Component> = {}, Directives extends Record<string, Directive> = {}, Exposed extends string = string, Provide extends ComponentProvideOptions = ComponentProvideOptions, ResolvedEmits extends EmitsOptions = {} extends RuntimeEmitsOptions ? TypeEmitsToOptions<TypeEmits> : RuntimeEmitsOptions, InferredProps = IsKeyValues<TypeProps> extends true ? TypeProps : string extends RuntimePropsKeys ? ComponentObjectPropsOptions extends RuntimePropsOptions ? {} : ExtractPropTypes<RuntimePropsOptions> : {
|
|
995
995
|
[key in RuntimePropsKeys]?: any;
|
|
996
|
-
}
|
|
996
|
+
}, TypeRefs extends Record<string, unknown> = {}, TypeEl extends Element = any>(options: {
|
|
997
997
|
props?: (RuntimePropsOptions & ThisType<void>) | RuntimePropsKeys[];
|
|
998
998
|
/**
|
|
999
999
|
* @private for language-tools use only
|
|
@@ -1012,7 +1012,7 @@ export declare function defineComponent<TypeProps, RuntimePropsOptions extends C
|
|
|
1012
1012
|
*/
|
|
1013
1013
|
__typeEl?: TypeEl;
|
|
1014
1014
|
} & ComponentOptionsBase<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, RuntimeEmitsOptions, RuntimeEmitsKeys, {}, // Defaults
|
|
1015
|
-
InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits,
|
|
1015
|
+
InjectOptions, InjectKeys, Slots, LocalComponents, Directives, Exposed, Provide> & ThisType<CreateComponentPublicInstanceWithMixins<ToResolvedProps<InferredProps, ResolvedEmits>, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, {}, {}, false, InjectOptions, Slots, LocalComponents, Directives, Exposed>>): DefineComponent<InferredProps, SetupBindings, Data, Computed, Methods, Mixin, Extends, ResolvedEmits, RuntimeEmitsKeys, PublicProps, ToResolvedProps<InferredProps, ResolvedEmits>, ExtractDefaultPropTypes<RuntimePropsOptions>, Slots, LocalComponents, Directives, Exposed, Provide, unknown extends TypeProps ? true : false, TypeRefs, TypeEl>;
|
|
1016
1016
|
|
|
1017
1017
|
export interface App<HostElement = any> {
|
|
1018
1018
|
version: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @vue/runtime-core v3.5.
|
|
2
|
+
* @vue/runtime-core v3.5.12
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
5
|
**/
|
|
6
6
|
import { pauseTracking, resetTracking, isRef, toRaw, traverse, shallowRef, readonly, isReactive, ref, isShallow, shallowReadArray, toReactive, shallowReadonly, track, reactive, shallowReactive, trigger, ReactiveEffect, watch as watch$1, customRef, isProxy, proxyRefs, markRaw, EffectScope, computed as computed$1, isReadonly } from '@vue/reactivity';
|
|
7
7
|
export { EffectScope, ReactiveEffect, TrackOpTypes, TriggerOpTypes, customRef, effect, effectScope, getCurrentScope, getCurrentWatcher, isProxy, isReactive, isReadonly, isRef, isShallow, markRaw, onScopeDispose, onWatcherCleanup, proxyRefs, reactive, readonly, ref, shallowReactive, shallowReadonly, shallowRef, stop, toRaw, toRef, toRefs, toValue, triggerRef, unref } from '@vue/reactivity';
|
|
8
|
-
import { isString, isFunction, isPromise, isArray, EMPTY_OBJ, NOOP, getGlobalThis, extend, isBuiltInDirective, hasOwn, remove, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, capitalize, camelize, isGloballyAllowed, NO, hyphenate, EMPTY_ARR, toRawType, makeMap, hasChanged, looseToNumber, isModelListener, toNumber } from '@vue/shared';
|
|
8
|
+
import { isString, isFunction, isPromise, isArray, EMPTY_OBJ, NOOP, getGlobalThis, extend, isBuiltInDirective, hasOwn, remove, def, isOn, isReservedProp, normalizeClass, stringifyStyle, normalizeStyle, isKnownSvgAttr, isBooleanAttr, isKnownHtmlAttr, includeBooleanAttr, isRenderableAttrValue, getEscapedCssVarName, isObject, isRegExp, invokeArrayFns, toHandlerKey, capitalize, camelize, isSymbol, isGloballyAllowed, NO, hyphenate, EMPTY_ARR, toRawType, makeMap, hasChanged, looseToNumber, isModelListener, toNumber } from '@vue/shared';
|
|
9
9
|
export { camelize, capitalize, normalizeClass, normalizeProps, normalizeStyle, toDisplayString, toHandlerKey } from '@vue/shared';
|
|
10
10
|
|
|
11
11
|
const stack = [];
|
|
@@ -276,10 +276,8 @@ function logError(err, type, contextVNode, throwInDev = true, throwInProd = fals
|
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
|
|
279
|
-
let isFlushing = false;
|
|
280
|
-
let isFlushPending = false;
|
|
281
279
|
const queue = [];
|
|
282
|
-
let flushIndex =
|
|
280
|
+
let flushIndex = -1;
|
|
283
281
|
const pendingPostFlushCbs = [];
|
|
284
282
|
let activePostFlushCbs = null;
|
|
285
283
|
let postFlushIndex = 0;
|
|
@@ -291,7 +289,7 @@ function nextTick(fn) {
|
|
|
291
289
|
return fn ? p.then(this ? fn.bind(this) : fn) : p;
|
|
292
290
|
}
|
|
293
291
|
function findInsertionIndex(id) {
|
|
294
|
-
let start =
|
|
292
|
+
let start = flushIndex + 1;
|
|
295
293
|
let end = queue.length;
|
|
296
294
|
while (start < end) {
|
|
297
295
|
const middle = start + end >>> 1;
|
|
@@ -320,8 +318,7 @@ function queueJob(job) {
|
|
|
320
318
|
}
|
|
321
319
|
}
|
|
322
320
|
function queueFlush() {
|
|
323
|
-
if (!
|
|
324
|
-
isFlushPending = true;
|
|
321
|
+
if (!currentFlushPromise) {
|
|
325
322
|
currentFlushPromise = resolvedPromise.then(flushJobs);
|
|
326
323
|
}
|
|
327
324
|
}
|
|
@@ -338,7 +335,7 @@ function queuePostFlushCb(cb) {
|
|
|
338
335
|
}
|
|
339
336
|
queueFlush();
|
|
340
337
|
}
|
|
341
|
-
function flushPreFlushCbs(instance, seen, i =
|
|
338
|
+
function flushPreFlushCbs(instance, seen, i = flushIndex + 1) {
|
|
342
339
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
343
340
|
seen = seen || /* @__PURE__ */ new Map();
|
|
344
341
|
}
|
|
@@ -394,8 +391,6 @@ function flushPostFlushCbs(seen) {
|
|
|
394
391
|
}
|
|
395
392
|
const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id;
|
|
396
393
|
function flushJobs(seen) {
|
|
397
|
-
isFlushPending = false;
|
|
398
|
-
isFlushing = true;
|
|
399
394
|
if (!!(process.env.NODE_ENV !== "production")) {
|
|
400
395
|
seen = seen || /* @__PURE__ */ new Map();
|
|
401
396
|
}
|
|
@@ -427,10 +422,9 @@ function flushJobs(seen) {
|
|
|
427
422
|
job.flags &= ~1;
|
|
428
423
|
}
|
|
429
424
|
}
|
|
430
|
-
flushIndex =
|
|
425
|
+
flushIndex = -1;
|
|
431
426
|
queue.length = 0;
|
|
432
427
|
flushPostFlushCbs(seen);
|
|
433
|
-
isFlushing = false;
|
|
434
428
|
currentFlushPromise = null;
|
|
435
429
|
if (queue.length || pendingPostFlushCbs.length) {
|
|
436
430
|
flushJobs(seen);
|
|
@@ -850,7 +844,7 @@ const TeleportImpl = {
|
|
|
850
844
|
}
|
|
851
845
|
if (!disabled) {
|
|
852
846
|
mount(target, targetAnchor);
|
|
853
|
-
updateCssVars(n2);
|
|
847
|
+
updateCssVars(n2, false);
|
|
854
848
|
}
|
|
855
849
|
} else if (!!(process.env.NODE_ENV !== "production") && !disabled) {
|
|
856
850
|
warn$1(
|
|
@@ -862,7 +856,7 @@ const TeleportImpl = {
|
|
|
862
856
|
};
|
|
863
857
|
if (disabled) {
|
|
864
858
|
mount(container, mainAnchor);
|
|
865
|
-
updateCssVars(n2);
|
|
859
|
+
updateCssVars(n2, true);
|
|
866
860
|
}
|
|
867
861
|
if (isTeleportDeferred(n2.props)) {
|
|
868
862
|
queuePostRenderEffect(mountToTarget, parentSuspense);
|
|
@@ -952,7 +946,7 @@ const TeleportImpl = {
|
|
|
952
946
|
);
|
|
953
947
|
}
|
|
954
948
|
}
|
|
955
|
-
updateCssVars(n2);
|
|
949
|
+
updateCssVars(n2, disabled);
|
|
956
950
|
}
|
|
957
951
|
},
|
|
958
952
|
remove(vnode, parentComponent, parentSuspense, { um: unmount, o: { remove: hostRemove } }, doRemove) {
|
|
@@ -1020,9 +1014,10 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
1020
1014
|
querySelector
|
|
1021
1015
|
);
|
|
1022
1016
|
if (target) {
|
|
1017
|
+
const disabled = isTeleportDisabled(vnode.props);
|
|
1023
1018
|
const targetNode = target._lpa || target.firstChild;
|
|
1024
1019
|
if (vnode.shapeFlag & 16) {
|
|
1025
|
-
if (
|
|
1020
|
+
if (disabled) {
|
|
1026
1021
|
vnode.anchor = hydrateChildren(
|
|
1027
1022
|
nextSibling(node),
|
|
1028
1023
|
vnode,
|
|
@@ -1063,16 +1058,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
|
|
|
1063
1058
|
);
|
|
1064
1059
|
}
|
|
1065
1060
|
}
|
|
1066
|
-
updateCssVars(vnode);
|
|
1061
|
+
updateCssVars(vnode, disabled);
|
|
1067
1062
|
}
|
|
1068
1063
|
return vnode.anchor && nextSibling(vnode.anchor);
|
|
1069
1064
|
}
|
|
1070
1065
|
const Teleport = TeleportImpl;
|
|
1071
|
-
function updateCssVars(vnode) {
|
|
1066
|
+
function updateCssVars(vnode, isDisabled) {
|
|
1072
1067
|
const ctx = vnode.ctx;
|
|
1073
1068
|
if (ctx && ctx.ut) {
|
|
1074
|
-
let node
|
|
1075
|
-
|
|
1069
|
+
let node, anchor;
|
|
1070
|
+
if (isDisabled) {
|
|
1071
|
+
node = vnode.el;
|
|
1072
|
+
anchor = vnode.anchor;
|
|
1073
|
+
} else {
|
|
1074
|
+
node = vnode.targetStart;
|
|
1075
|
+
anchor = vnode.targetAnchor;
|
|
1076
|
+
}
|
|
1077
|
+
while (node && node !== anchor) {
|
|
1076
1078
|
if (node.nodeType === 1) node.setAttribute("data-v-owner", ctx.uid);
|
|
1077
1079
|
node = node.nextSibling;
|
|
1078
1080
|
}
|
|
@@ -1523,8 +1525,15 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
1523
1525
|
const setupState = owner.setupState;
|
|
1524
1526
|
const rawSetupState = toRaw(setupState);
|
|
1525
1527
|
const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
|
|
1526
|
-
if (!!(process.env.NODE_ENV !== "production")
|
|
1527
|
-
|
|
1528
|
+
if (!!(process.env.NODE_ENV !== "production")) {
|
|
1529
|
+
if (hasOwn(rawSetupState, key) && !isRef(rawSetupState[key])) {
|
|
1530
|
+
warn$1(
|
|
1531
|
+
`Template ref "${key}" used on a non-ref value. It will not work in the production build.`
|
|
1532
|
+
);
|
|
1533
|
+
}
|
|
1534
|
+
if (knownTemplateRefs.has(rawSetupState[key])) {
|
|
1535
|
+
return false;
|
|
1536
|
+
}
|
|
1528
1537
|
}
|
|
1529
1538
|
return hasOwn(rawSetupState, key);
|
|
1530
1539
|
};
|
|
@@ -1821,7 +1830,11 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
1821
1830
|
}
|
|
1822
1831
|
let needCallTransitionHooks = false;
|
|
1823
1832
|
if (isTemplateNode(el)) {
|
|
1824
|
-
needCallTransitionHooks = needTransition(
|
|
1833
|
+
needCallTransitionHooks = needTransition(
|
|
1834
|
+
null,
|
|
1835
|
+
// no need check parentSuspense in hydration
|
|
1836
|
+
transition
|
|
1837
|
+
) && parentComponent && parentComponent.vnode.props && parentComponent.vnode.props.appear;
|
|
1825
1838
|
const content = el.content.firstChild;
|
|
1826
1839
|
if (needCallTransitionHooks) {
|
|
1827
1840
|
transition.beforeEnter(content);
|
|
@@ -2225,6 +2238,8 @@ function isMismatchAllowed(el, allowedType) {
|
|
|
2225
2238
|
}
|
|
2226
2239
|
}
|
|
2227
2240
|
|
|
2241
|
+
const requestIdleCallback = getGlobalThis().requestIdleCallback || ((cb) => setTimeout(cb, 1));
|
|
2242
|
+
const cancelIdleCallback = getGlobalThis().cancelIdleCallback || ((id) => clearTimeout(id));
|
|
2228
2243
|
const hydrateOnIdle = (timeout = 1e4) => (hydrate) => {
|
|
2229
2244
|
const id = requestIdleCallback(hydrate, { timeout });
|
|
2230
2245
|
return () => cancelIdleCallback(id);
|
|
@@ -2927,12 +2942,13 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
|
|
|
2927
2942
|
}
|
|
2928
2943
|
openBlock();
|
|
2929
2944
|
const validSlotContent = slot && ensureValidVNode(slot(props));
|
|
2945
|
+
const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
|
|
2946
|
+
// key attached in the `createSlots` helper, respect that
|
|
2947
|
+
validSlotContent && validSlotContent.key;
|
|
2930
2948
|
const rendered = createBlock(
|
|
2931
2949
|
Fragment,
|
|
2932
2950
|
{
|
|
2933
|
-
key: (
|
|
2934
|
-
// key attached in the `createSlots` helper, respect that
|
|
2935
|
-
validSlotContent && validSlotContent.key || `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
2951
|
+
key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
|
|
2936
2952
|
(!validSlotContent && fallback ? "_fb" : "")
|
|
2937
2953
|
},
|
|
2938
2954
|
validSlotContent || (fallback ? fallback() : []),
|
|
@@ -4294,6 +4310,7 @@ function getType(ctor) {
|
|
|
4294
4310
|
function validateProps(rawProps, props, instance) {
|
|
4295
4311
|
const resolvedValues = toRaw(props);
|
|
4296
4312
|
const options = instance.propsOptions[0];
|
|
4313
|
+
const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key));
|
|
4297
4314
|
for (const key in options) {
|
|
4298
4315
|
let opt = options[key];
|
|
4299
4316
|
if (opt == null) continue;
|
|
@@ -4302,7 +4319,7 @@ function validateProps(rawProps, props, instance) {
|
|
|
4302
4319
|
resolvedValues[key],
|
|
4303
4320
|
opt,
|
|
4304
4321
|
!!(process.env.NODE_ENV !== "production") ? shallowReadonly(resolvedValues) : resolvedValues,
|
|
4305
|
-
!
|
|
4322
|
+
!camelizePropsKey.includes(key)
|
|
4306
4323
|
);
|
|
4307
4324
|
}
|
|
4308
4325
|
}
|
|
@@ -6120,14 +6137,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
|
|
|
6120
6137
|
}
|
|
6121
6138
|
const baseWatchOptions = extend({}, options);
|
|
6122
6139
|
if (!!(process.env.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1;
|
|
6140
|
+
const runsImmediately = cb && immediate || !cb && flush !== "post";
|
|
6123
6141
|
let ssrCleanup;
|
|
6124
6142
|
if (isInSSRComponentSetup) {
|
|
6125
6143
|
if (flush === "sync") {
|
|
6126
6144
|
const ctx = useSSRContext();
|
|
6127
6145
|
ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
|
|
6128
|
-
} else if (!
|
|
6129
|
-
baseWatchOptions.once = true;
|
|
6130
|
-
} else {
|
|
6146
|
+
} else if (!runsImmediately) {
|
|
6131
6147
|
const watchStopHandle = () => {
|
|
6132
6148
|
};
|
|
6133
6149
|
watchStopHandle.stop = NOOP;
|
|
@@ -6166,7 +6182,13 @@ function doWatch(source, cb, options = EMPTY_OBJ) {
|
|
|
6166
6182
|
}
|
|
6167
6183
|
};
|
|
6168
6184
|
const watchHandle = watch$1(source, cb, baseWatchOptions);
|
|
6169
|
-
if (
|
|
6185
|
+
if (isInSSRComponentSetup) {
|
|
6186
|
+
if (ssrCleanup) {
|
|
6187
|
+
ssrCleanup.push(watchHandle);
|
|
6188
|
+
} else if (runsImmediately) {
|
|
6189
|
+
watchHandle();
|
|
6190
|
+
}
|
|
6191
|
+
}
|
|
6170
6192
|
return watchHandle;
|
|
6171
6193
|
}
|
|
6172
6194
|
function instanceWatch(source, value, options) {
|
|
@@ -6201,19 +6223,19 @@ function useModel(props, name, options = EMPTY_OBJ) {
|
|
|
6201
6223
|
warn$1(`useModel() called without active instance.`);
|
|
6202
6224
|
return ref();
|
|
6203
6225
|
}
|
|
6204
|
-
|
|
6226
|
+
const camelizedName = camelize(name);
|
|
6227
|
+
if (!!(process.env.NODE_ENV !== "production") && !i.propsOptions[0][camelizedName]) {
|
|
6205
6228
|
warn$1(`useModel() called with prop "${name}" which is not declared.`);
|
|
6206
6229
|
return ref();
|
|
6207
6230
|
}
|
|
6208
|
-
const camelizedName = camelize(name);
|
|
6209
6231
|
const hyphenatedName = hyphenate(name);
|
|
6210
|
-
const modifiers = getModelModifiers(props,
|
|
6232
|
+
const modifiers = getModelModifiers(props, camelizedName);
|
|
6211
6233
|
const res = customRef((track, trigger) => {
|
|
6212
6234
|
let localValue;
|
|
6213
6235
|
let prevSetValue = EMPTY_OBJ;
|
|
6214
6236
|
let prevEmittedValue;
|
|
6215
6237
|
watchSyncEffect(() => {
|
|
6216
|
-
const propValue = props[
|
|
6238
|
+
const propValue = props[camelizedName];
|
|
6217
6239
|
if (hasChanged(localValue, propValue)) {
|
|
6218
6240
|
localValue = propValue;
|
|
6219
6241
|
trigger();
|
|
@@ -7842,9 +7864,9 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
7842
7864
|
}
|
|
7843
7865
|
const { setup } = Component;
|
|
7844
7866
|
if (setup) {
|
|
7867
|
+
pauseTracking();
|
|
7845
7868
|
const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null;
|
|
7846
7869
|
const reset = setCurrentInstance(instance);
|
|
7847
|
-
pauseTracking();
|
|
7848
7870
|
const setupResult = callWithErrorHandling(
|
|
7849
7871
|
setup,
|
|
7850
7872
|
instance,
|
|
@@ -7854,10 +7876,13 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
7854
7876
|
setupContext
|
|
7855
7877
|
]
|
|
7856
7878
|
);
|
|
7879
|
+
const isAsyncSetup = isPromise(setupResult);
|
|
7857
7880
|
resetTracking();
|
|
7858
7881
|
reset();
|
|
7859
|
-
if (
|
|
7860
|
-
|
|
7882
|
+
if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) {
|
|
7883
|
+
markAsyncBoundary(instance);
|
|
7884
|
+
}
|
|
7885
|
+
if (isAsyncSetup) {
|
|
7861
7886
|
setupResult.then(unsetCurrentInstance, unsetCurrentInstance);
|
|
7862
7887
|
if (isSSR) {
|
|
7863
7888
|
return setupResult.then((resolvedResult) => {
|
|
@@ -8332,7 +8357,7 @@ function isMemoSame(cached, memo) {
|
|
|
8332
8357
|
return true;
|
|
8333
8358
|
}
|
|
8334
8359
|
|
|
8335
|
-
const version = "3.5.
|
|
8360
|
+
const version = "3.5.12";
|
|
8336
8361
|
const warn = !!(process.env.NODE_ENV !== "production") ? warn$1 : NOOP;
|
|
8337
8362
|
const ErrorTypeStrings = ErrorTypeStrings$1 ;
|
|
8338
8363
|
const devtools = !!(process.env.NODE_ENV !== "production") || true ? devtools$1 : void 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/runtime-core",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.12",
|
|
4
4
|
"description": "@vue/runtime-core",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/runtime-core.esm-bundler.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/runtime-core#readme",
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@vue/shared": "3.5.
|
|
50
|
-
"@vue/reactivity": "3.5.
|
|
49
|
+
"@vue/shared": "3.5.12",
|
|
50
|
+
"@vue/reactivity": "3.5.12"
|
|
51
51
|
}
|
|
52
52
|
}
|