@vue/compat 3.2.30 → 3.2.33
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/README.md +0 -1
- package/dist/vue.cjs.js +179 -79
- package/dist/vue.cjs.prod.js +141 -62
- package/dist/vue.esm-browser.js +179 -79
- package/dist/vue.esm-browser.prod.js +1 -1
- package/dist/vue.esm-bundler.js +184 -81
- package/dist/vue.global.js +179 -79
- package/dist/vue.global.prod.js +1 -1
- package/dist/vue.runtime.esm-browser.js +179 -79
- package/dist/vue.runtime.esm-browser.prod.js +1 -1
- package/dist/vue.runtime.esm-bundler.js +184 -81
- package/dist/vue.runtime.global.js +179 -79
- package/dist/vue.runtime.global.prod.js +1 -1
- package/package.json +2 -2
|
@@ -348,8 +348,17 @@ function warn(msg, ...args) {
|
|
|
348
348
|
let activeEffectScope;
|
|
349
349
|
class EffectScope {
|
|
350
350
|
constructor(detached = false) {
|
|
351
|
+
/**
|
|
352
|
+
* @internal
|
|
353
|
+
*/
|
|
351
354
|
this.active = true;
|
|
355
|
+
/**
|
|
356
|
+
* @internal
|
|
357
|
+
*/
|
|
352
358
|
this.effects = [];
|
|
359
|
+
/**
|
|
360
|
+
* @internal
|
|
361
|
+
*/
|
|
353
362
|
this.cleanups = [];
|
|
354
363
|
if (!detached && activeEffectScope) {
|
|
355
364
|
this.parent = activeEffectScope;
|
|
@@ -359,21 +368,30 @@ class EffectScope {
|
|
|
359
368
|
}
|
|
360
369
|
run(fn) {
|
|
361
370
|
if (this.active) {
|
|
371
|
+
const currentEffectScope = activeEffectScope;
|
|
362
372
|
try {
|
|
363
373
|
activeEffectScope = this;
|
|
364
374
|
return fn();
|
|
365
375
|
}
|
|
366
376
|
finally {
|
|
367
|
-
activeEffectScope =
|
|
377
|
+
activeEffectScope = currentEffectScope;
|
|
368
378
|
}
|
|
369
379
|
}
|
|
370
380
|
else {
|
|
371
381
|
warn(`cannot run an inactive effect scope.`);
|
|
372
382
|
}
|
|
373
383
|
}
|
|
384
|
+
/**
|
|
385
|
+
* This should only be called on non-detached scopes
|
|
386
|
+
* @internal
|
|
387
|
+
*/
|
|
374
388
|
on() {
|
|
375
389
|
activeEffectScope = this;
|
|
376
390
|
}
|
|
391
|
+
/**
|
|
392
|
+
* This should only be called on non-detached scopes
|
|
393
|
+
* @internal
|
|
394
|
+
*/
|
|
377
395
|
off() {
|
|
378
396
|
activeEffectScope = this.parent;
|
|
379
397
|
}
|
|
@@ -515,10 +533,17 @@ class ReactiveEffect {
|
|
|
515
533
|
activeEffect = this.parent;
|
|
516
534
|
shouldTrack = lastShouldTrack;
|
|
517
535
|
this.parent = undefined;
|
|
536
|
+
if (this.deferStop) {
|
|
537
|
+
this.stop();
|
|
538
|
+
}
|
|
518
539
|
}
|
|
519
540
|
}
|
|
520
541
|
stop() {
|
|
521
|
-
|
|
542
|
+
// stopped while running itself - defer the cleanup
|
|
543
|
+
if (activeEffect === this) {
|
|
544
|
+
this.deferStop = true;
|
|
545
|
+
}
|
|
546
|
+
else if (this.active) {
|
|
522
547
|
cleanupEffect(this);
|
|
523
548
|
if (this.onStop) {
|
|
524
549
|
this.onStop();
|
|
@@ -597,9 +622,7 @@ function trackEffects(dep, debuggerEventExtraInfo) {
|
|
|
597
622
|
dep.add(activeEffect);
|
|
598
623
|
activeEffect.deps.push(dep);
|
|
599
624
|
if (activeEffect.onTrack) {
|
|
600
|
-
activeEffect.onTrack(Object.assign({
|
|
601
|
-
effect: activeEffect
|
|
602
|
-
}, debuggerEventExtraInfo));
|
|
625
|
+
activeEffect.onTrack(Object.assign({ effect: activeEffect }, debuggerEventExtraInfo));
|
|
603
626
|
}
|
|
604
627
|
}
|
|
605
628
|
}
|
|
@@ -695,7 +718,9 @@ function triggerEffects(dep, debuggerEventExtraInfo) {
|
|
|
695
718
|
}
|
|
696
719
|
|
|
697
720
|
const isNonTrackableKeys = /*#__PURE__*/ makeMap(`__proto__,__v_isRef,__isVue`);
|
|
698
|
-
const builtInSymbols = new Set(
|
|
721
|
+
const builtInSymbols = new Set(
|
|
722
|
+
/*#__PURE__*/
|
|
723
|
+
Object.getOwnPropertyNames(Symbol)
|
|
699
724
|
.map(key => Symbol[key])
|
|
700
725
|
.filter(isSymbol));
|
|
701
726
|
const get = /*#__PURE__*/ createGetter();
|
|
@@ -847,13 +872,13 @@ const readonlyHandlers = {
|
|
|
847
872
|
get: readonlyGet,
|
|
848
873
|
set(target, key) {
|
|
849
874
|
{
|
|
850
|
-
|
|
875
|
+
warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
851
876
|
}
|
|
852
877
|
return true;
|
|
853
878
|
},
|
|
854
879
|
deleteProperty(target, key) {
|
|
855
880
|
{
|
|
856
|
-
|
|
881
|
+
warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target);
|
|
857
882
|
}
|
|
858
883
|
return true;
|
|
859
884
|
}
|
|
@@ -1681,7 +1706,7 @@ let preFlushIndex = 0;
|
|
|
1681
1706
|
const pendingPostFlushCbs = [];
|
|
1682
1707
|
let activePostFlushCbs = null;
|
|
1683
1708
|
let postFlushIndex = 0;
|
|
1684
|
-
const resolvedPromise = Promise.resolve();
|
|
1709
|
+
const resolvedPromise = /*#__PURE__*/ Promise.resolve();
|
|
1685
1710
|
let currentFlushPromise = null;
|
|
1686
1711
|
let currentPreFlushParentJob = null;
|
|
1687
1712
|
const RECURSION_LIMIT = 100;
|
|
@@ -2615,6 +2640,8 @@ function compatModelEmit(instance, event, args) {
|
|
|
2615
2640
|
}
|
|
2616
2641
|
|
|
2617
2642
|
function emit$2(instance, event, ...rawArgs) {
|
|
2643
|
+
if (instance.isUnmounted)
|
|
2644
|
+
return;
|
|
2618
2645
|
const props = instance.vnode.props || EMPTY_OBJ;
|
|
2619
2646
|
{
|
|
2620
2647
|
const { emitsOptions, propsOptions: [propsOptions] } = instance;
|
|
@@ -3632,12 +3659,10 @@ function watchEffect(effect, options) {
|
|
|
3632
3659
|
return doWatch(effect, null, options);
|
|
3633
3660
|
}
|
|
3634
3661
|
function watchPostEffect(effect, options) {
|
|
3635
|
-
return doWatch(effect, null, (Object.assign(
|
|
3636
|
-
));
|
|
3662
|
+
return doWatch(effect, null, (Object.assign(Object.assign({}, options), { flush: 'post' }) ));
|
|
3637
3663
|
}
|
|
3638
3664
|
function watchSyncEffect(effect, options) {
|
|
3639
|
-
return doWatch(effect, null, (Object.assign(
|
|
3640
|
-
));
|
|
3665
|
+
return doWatch(effect, null, (Object.assign(Object.assign({}, options), { flush: 'sync' }) ));
|
|
3641
3666
|
}
|
|
3642
3667
|
// initial value for watchers to trigger on undefined initial values
|
|
3643
3668
|
const INITIAL_WATCHER_VALUE = {};
|
|
@@ -3936,10 +3961,22 @@ const BaseTransitionImpl = {
|
|
|
3936
3961
|
if (!children || !children.length) {
|
|
3937
3962
|
return;
|
|
3938
3963
|
}
|
|
3939
|
-
|
|
3964
|
+
let child = children[0];
|
|
3940
3965
|
if (children.length > 1) {
|
|
3941
|
-
|
|
3942
|
-
|
|
3966
|
+
let hasFound = false;
|
|
3967
|
+
// locate first non-comment child
|
|
3968
|
+
for (const c of children) {
|
|
3969
|
+
if (c.type !== Comment) {
|
|
3970
|
+
if (hasFound) {
|
|
3971
|
+
// warn more than one non-comment child
|
|
3972
|
+
warn$1('<transition> can only be used on a single element or component. ' +
|
|
3973
|
+
'Use <transition-group> for lists.');
|
|
3974
|
+
break;
|
|
3975
|
+
}
|
|
3976
|
+
child = c;
|
|
3977
|
+
hasFound = true;
|
|
3978
|
+
}
|
|
3979
|
+
}
|
|
3943
3980
|
}
|
|
3944
3981
|
// there's no need to track reactivity for these props so use the raw
|
|
3945
3982
|
// props for a bit better perf
|
|
@@ -3947,11 +3984,11 @@ const BaseTransitionImpl = {
|
|
|
3947
3984
|
const { mode } = rawProps;
|
|
3948
3985
|
// check mode
|
|
3949
3986
|
if (mode &&
|
|
3950
|
-
mode !== 'in-out' &&
|
|
3987
|
+
mode !== 'in-out' &&
|
|
3988
|
+
mode !== 'out-in' &&
|
|
3989
|
+
mode !== 'default') {
|
|
3951
3990
|
warn$1(`invalid <transition> mode: ${mode}`);
|
|
3952
3991
|
}
|
|
3953
|
-
// at this point children has a guaranteed length of 1.
|
|
3954
|
-
const child = children[0];
|
|
3955
3992
|
if (state.isLeaving) {
|
|
3956
3993
|
return emptyPlaceholder(child);
|
|
3957
3994
|
}
|
|
@@ -4177,20 +4214,24 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
4177
4214
|
vnode.transition = hooks;
|
|
4178
4215
|
}
|
|
4179
4216
|
}
|
|
4180
|
-
function getTransitionRawChildren(children, keepComment = false) {
|
|
4217
|
+
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
4181
4218
|
let ret = [];
|
|
4182
4219
|
let keyedFragmentCount = 0;
|
|
4183
4220
|
for (let i = 0; i < children.length; i++) {
|
|
4184
|
-
|
|
4221
|
+
let child = children[i];
|
|
4222
|
+
// #5360 inherit parent key in case of <template v-for>
|
|
4223
|
+
const key = parentKey == null
|
|
4224
|
+
? child.key
|
|
4225
|
+
: String(parentKey) + String(child.key != null ? child.key : i);
|
|
4185
4226
|
// handle fragment children case, e.g. v-for
|
|
4186
4227
|
if (child.type === Fragment) {
|
|
4187
4228
|
if (child.patchFlag & 128 /* KEYED_FRAGMENT */)
|
|
4188
4229
|
keyedFragmentCount++;
|
|
4189
|
-
ret = ret.concat(getTransitionRawChildren(child.children, keepComment));
|
|
4230
|
+
ret = ret.concat(getTransitionRawChildren(child.children, keepComment, key));
|
|
4190
4231
|
}
|
|
4191
4232
|
// comment placeholders should be skipped, e.g. v-if
|
|
4192
4233
|
else if (keepComment || child.type !== Comment) {
|
|
4193
|
-
ret.push(child);
|
|
4234
|
+
ret.push(key != null ? cloneVNode(child, { key }) : child);
|
|
4194
4235
|
}
|
|
4195
4236
|
}
|
|
4196
4237
|
// #1126 if a transition children list contains multiple sub fragments, these
|
|
@@ -5248,6 +5289,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
5248
5289
|
const propsToUpdate = instance.vnode.dynamicProps;
|
|
5249
5290
|
for (let i = 0; i < propsToUpdate.length; i++) {
|
|
5250
5291
|
let key = propsToUpdate[i];
|
|
5292
|
+
// skip if the prop key is a declared emit event listener
|
|
5293
|
+
if (isEmitListener(instance.emitsOptions, key)) {
|
|
5294
|
+
continue;
|
|
5295
|
+
}
|
|
5251
5296
|
// PROPS flag guarantees rawProps to be non-null
|
|
5252
5297
|
const value = rawProps[key];
|
|
5253
5298
|
if (options) {
|
|
@@ -5833,7 +5878,8 @@ function withDirectives(vnode, directives) {
|
|
|
5833
5878
|
warn$1(`withDirectives can only be used inside render functions.`);
|
|
5834
5879
|
return vnode;
|
|
5835
5880
|
}
|
|
5836
|
-
const instance = internalInstance
|
|
5881
|
+
const instance = getExposeProxy(internalInstance) ||
|
|
5882
|
+
internalInstance.proxy;
|
|
5837
5883
|
const bindings = vnode.dirs || (vnode.dirs = []);
|
|
5838
5884
|
for (let i = 0; i < directives.length; i++) {
|
|
5839
5885
|
let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
|
|
@@ -5953,7 +5999,7 @@ function createCompatVue(createApp, createSingletonApp) {
|
|
|
5953
5999
|
return vm;
|
|
5954
6000
|
}
|
|
5955
6001
|
}
|
|
5956
|
-
Vue.version = `2.6.14-compat:${"3.2.
|
|
6002
|
+
Vue.version = `2.6.14-compat:${"3.2.33"}`;
|
|
5957
6003
|
Vue.config = singletonApp.config;
|
|
5958
6004
|
Vue.use = (p, ...options) => {
|
|
5959
6005
|
if (p && isFunction(p.install)) {
|
|
@@ -6380,6 +6426,9 @@ function createAppContext() {
|
|
|
6380
6426
|
let uid = 0;
|
|
6381
6427
|
function createAppAPI(render, hydrate) {
|
|
6382
6428
|
return function createApp(rootComponent, rootProps = null) {
|
|
6429
|
+
if (!isFunction(rootComponent)) {
|
|
6430
|
+
rootComponent = Object.assign({}, rootComponent);
|
|
6431
|
+
}
|
|
6383
6432
|
if (rootProps != null && !isObject(rootProps)) {
|
|
6384
6433
|
warn$1(`root props passed to app.mount() must be an object.`);
|
|
6385
6434
|
rootProps = null;
|
|
@@ -6579,6 +6628,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
6579
6628
|
if (!isArray(existing)) {
|
|
6580
6629
|
if (_isString) {
|
|
6581
6630
|
refs[ref] = [refValue];
|
|
6631
|
+
if (hasOwn(setupState, ref)) {
|
|
6632
|
+
setupState[ref] = refs[ref];
|
|
6633
|
+
}
|
|
6582
6634
|
}
|
|
6583
6635
|
else {
|
|
6584
6636
|
ref.value = [refValue];
|
|
@@ -6777,7 +6829,8 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
6777
6829
|
// e.g. <option :value="obj">, <input type="checkbox" :true-value="1">
|
|
6778
6830
|
const forcePatchValue = (type === 'input' && dirs) || type === 'option';
|
|
6779
6831
|
// skip props & children if this is hoisted static nodes
|
|
6780
|
-
|
|
6832
|
+
// #5405 in dev, always hydrate children for HMR
|
|
6833
|
+
{
|
|
6781
6834
|
if (dirs) {
|
|
6782
6835
|
invokeDirectiveHook(vnode, null, parentComponent, 'created');
|
|
6783
6836
|
}
|
|
@@ -6950,7 +7003,7 @@ function startMeasure(instance, type) {
|
|
|
6950
7003
|
perf.mark(`vue-${type}-${instance.uid}`);
|
|
6951
7004
|
}
|
|
6952
7005
|
{
|
|
6953
|
-
devtoolsPerfStart(instance, type,
|
|
7006
|
+
devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
|
|
6954
7007
|
}
|
|
6955
7008
|
}
|
|
6956
7009
|
function endMeasure(instance, type) {
|
|
@@ -6963,7 +7016,7 @@ function endMeasure(instance, type) {
|
|
|
6963
7016
|
perf.clearMarks(endTag);
|
|
6964
7017
|
}
|
|
6965
7018
|
{
|
|
6966
|
-
devtoolsPerfEnd(instance, type,
|
|
7019
|
+
devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
|
|
6967
7020
|
}
|
|
6968
7021
|
}
|
|
6969
7022
|
function isSupported() {
|
|
@@ -8110,7 +8163,22 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
8110
8163
|
const remove = vnode => {
|
|
8111
8164
|
const { type, el, anchor, transition } = vnode;
|
|
8112
8165
|
if (type === Fragment) {
|
|
8113
|
-
|
|
8166
|
+
if (vnode.patchFlag > 0 &&
|
|
8167
|
+
vnode.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */ &&
|
|
8168
|
+
transition &&
|
|
8169
|
+
!transition.persisted) {
|
|
8170
|
+
vnode.children.forEach(child => {
|
|
8171
|
+
if (child.type === Comment) {
|
|
8172
|
+
hostRemove(child.el);
|
|
8173
|
+
}
|
|
8174
|
+
else {
|
|
8175
|
+
remove(child);
|
|
8176
|
+
}
|
|
8177
|
+
});
|
|
8178
|
+
}
|
|
8179
|
+
else {
|
|
8180
|
+
removeFragment(el, anchor);
|
|
8181
|
+
}
|
|
8114
8182
|
return;
|
|
8115
8183
|
}
|
|
8116
8184
|
if (type === Static) {
|
|
@@ -9503,7 +9571,10 @@ function renderSlot(slots, name, props = {},
|
|
|
9503
9571
|
// this is not a user-facing function, so the fallback is always generated by
|
|
9504
9572
|
// the compiler and guaranteed to be a function returning an array
|
|
9505
9573
|
fallback, noSlotted) {
|
|
9506
|
-
if (currentRenderingInstance.isCE
|
|
9574
|
+
if (currentRenderingInstance.isCE ||
|
|
9575
|
+
(currentRenderingInstance.parent &&
|
|
9576
|
+
isAsyncWrapper(currentRenderingInstance.parent) &&
|
|
9577
|
+
currentRenderingInstance.parent.isCE)) {
|
|
9507
9578
|
return createVNode('slot', name === 'default' ? null : { name }, fallback && fallback());
|
|
9508
9579
|
}
|
|
9509
9580
|
let slot = slots[name];
|
|
@@ -9793,7 +9864,10 @@ const getPublicInstance = (i) => {
|
|
|
9793
9864
|
return getExposeProxy(i) || i.proxy;
|
|
9794
9865
|
return getPublicInstance(i.parent);
|
|
9795
9866
|
};
|
|
9796
|
-
const publicPropertiesMap =
|
|
9867
|
+
const publicPropertiesMap =
|
|
9868
|
+
// Move PURE marker to new line to workaround compiler discarding it
|
|
9869
|
+
// due to type annotation
|
|
9870
|
+
/*#__PURE__*/ extend(Object.create(null), {
|
|
9797
9871
|
$: i => i,
|
|
9798
9872
|
$el: i => i.vnode.el,
|
|
9799
9873
|
$data: i => i.data,
|
|
@@ -9906,7 +9980,9 @@ const PublicInstanceProxyHandlers = {
|
|
|
9906
9980
|
}
|
|
9907
9981
|
else {
|
|
9908
9982
|
const val = globalProperties[key];
|
|
9909
|
-
return isFunction(val)
|
|
9983
|
+
return isFunction(val)
|
|
9984
|
+
? Object.assign(val.bind(instance.proxy), val)
|
|
9985
|
+
: val;
|
|
9910
9986
|
}
|
|
9911
9987
|
}
|
|
9912
9988
|
}
|
|
@@ -9931,9 +10007,11 @@ const PublicInstanceProxyHandlers = {
|
|
|
9931
10007
|
const { data, setupState, ctx } = instance;
|
|
9932
10008
|
if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
|
|
9933
10009
|
setupState[key] = value;
|
|
10010
|
+
return true;
|
|
9934
10011
|
}
|
|
9935
10012
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
9936
10013
|
data[key] = value;
|
|
10014
|
+
return true;
|
|
9937
10015
|
}
|
|
9938
10016
|
else if (hasOwn(instance.props, key)) {
|
|
9939
10017
|
warn$1(`Attempting to mutate prop "${key}". Props are readonly.`, instance);
|
|
@@ -9967,6 +10045,16 @@ const PublicInstanceProxyHandlers = {
|
|
|
9967
10045
|
hasOwn(ctx, key) ||
|
|
9968
10046
|
hasOwn(publicPropertiesMap, key) ||
|
|
9969
10047
|
hasOwn(appContext.config.globalProperties, key));
|
|
10048
|
+
},
|
|
10049
|
+
defineProperty(target, key, descriptor) {
|
|
10050
|
+
if (descriptor.get != null) {
|
|
10051
|
+
// invalidate key cache of a getter based property #5417
|
|
10052
|
+
target._.accessCache[key] = 0;
|
|
10053
|
+
}
|
|
10054
|
+
else if (hasOwn(descriptor, 'value')) {
|
|
10055
|
+
this.set(target, key, descriptor.value, null);
|
|
10056
|
+
}
|
|
10057
|
+
return Reflect.defineProperty(target, key, descriptor);
|
|
9970
10058
|
}
|
|
9971
10059
|
};
|
|
9972
10060
|
{
|
|
@@ -10169,6 +10257,7 @@ function setupComponent(instance, isSSR = false) {
|
|
|
10169
10257
|
return setupResult;
|
|
10170
10258
|
}
|
|
10171
10259
|
function setupStatefulComponent(instance, isSSR) {
|
|
10260
|
+
var _a;
|
|
10172
10261
|
const Component = instance.type;
|
|
10173
10262
|
{
|
|
10174
10263
|
if (Component.name) {
|
|
@@ -10226,6 +10315,13 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
10226
10315
|
// async setup returned Promise.
|
|
10227
10316
|
// bail here and wait for re-entry.
|
|
10228
10317
|
instance.asyncDep = setupResult;
|
|
10318
|
+
if (!instance.suspense) {
|
|
10319
|
+
const name = (_a = Component.name) !== null && _a !== void 0 ? _a : 'Anonymous';
|
|
10320
|
+
warn$1(`Component <${name}>: setup function returned a promise, but no ` +
|
|
10321
|
+
`<Suspense> boundary was found in the parent component tree. ` +
|
|
10322
|
+
`A component with async setup() must be nested in a <Suspense> ` +
|
|
10323
|
+
`in order to be rendered.`);
|
|
10324
|
+
}
|
|
10229
10325
|
}
|
|
10230
10326
|
}
|
|
10231
10327
|
else {
|
|
@@ -10857,7 +10953,7 @@ function isMemoSame(cached, memo) {
|
|
|
10857
10953
|
}
|
|
10858
10954
|
|
|
10859
10955
|
// Core API ------------------------------------------------------------------
|
|
10860
|
-
const version = "3.2.
|
|
10956
|
+
const version = "3.2.33";
|
|
10861
10957
|
/**
|
|
10862
10958
|
* SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
|
|
10863
10959
|
* @internal
|
|
@@ -10881,7 +10977,7 @@ const compatUtils = (_compatUtils );
|
|
|
10881
10977
|
|
|
10882
10978
|
const svgNS = 'http://www.w3.org/2000/svg';
|
|
10883
10979
|
const doc = (typeof document !== 'undefined' ? document : null);
|
|
10884
|
-
const templateContainer = doc && doc.createElement('template');
|
|
10980
|
+
const templateContainer = doc && /*#__PURE__*/ doc.createElement('template');
|
|
10885
10981
|
const nodeOps = {
|
|
10886
10982
|
insert: (child, parent, anchor) => {
|
|
10887
10983
|
parent.insertBefore(child, anchor || null);
|
|
@@ -11032,6 +11128,8 @@ function setStyle(style, name, val) {
|
|
|
11032
11128
|
val.forEach(v => setStyle(style, name, v));
|
|
11033
11129
|
}
|
|
11034
11130
|
else {
|
|
11131
|
+
if (val == null)
|
|
11132
|
+
val = '';
|
|
11035
11133
|
if (name.startsWith('--')) {
|
|
11036
11134
|
// custom property definition
|
|
11037
11135
|
style.setProperty(name, val);
|
|
@@ -11153,41 +11251,39 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
11153
11251
|
}
|
|
11154
11252
|
return;
|
|
11155
11253
|
}
|
|
11254
|
+
let needRemove = false;
|
|
11156
11255
|
if (value === '' || value == null) {
|
|
11157
11256
|
const type = typeof el[key];
|
|
11158
11257
|
if (type === 'boolean') {
|
|
11159
11258
|
// e.g. <select multiple> compiles to { multiple: '' }
|
|
11160
|
-
|
|
11161
|
-
return;
|
|
11259
|
+
value = includeBooleanAttr(value);
|
|
11162
11260
|
}
|
|
11163
11261
|
else if (value == null && type === 'string') {
|
|
11164
11262
|
// e.g. <div :id="null">
|
|
11165
|
-
|
|
11166
|
-
|
|
11167
|
-
return;
|
|
11263
|
+
value = '';
|
|
11264
|
+
needRemove = true;
|
|
11168
11265
|
}
|
|
11169
11266
|
else if (type === 'number') {
|
|
11170
11267
|
// e.g. <img :width="null">
|
|
11171
11268
|
// the value of some IDL attr must be greater than 0, e.g. input.size = 0 -> error
|
|
11172
|
-
|
|
11173
|
-
|
|
11174
|
-
}
|
|
11175
|
-
catch (_a) { }
|
|
11176
|
-
el.removeAttribute(key);
|
|
11177
|
-
return;
|
|
11269
|
+
value = 0;
|
|
11270
|
+
needRemove = true;
|
|
11178
11271
|
}
|
|
11179
11272
|
}
|
|
11180
|
-
|
|
11181
|
-
|
|
11182
|
-
|
|
11183
|
-
|
|
11184
|
-
|
|
11185
|
-
|
|
11186
|
-
|
|
11187
|
-
|
|
11273
|
+
else {
|
|
11274
|
+
if (value === false &&
|
|
11275
|
+
compatUtils.isCompatEnabled("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, parentComponent)) {
|
|
11276
|
+
const type = typeof el[key];
|
|
11277
|
+
if (type === 'string' || type === 'number') {
|
|
11278
|
+
compatUtils.warnDeprecation("ATTR_FALSE_VALUE" /* ATTR_FALSE_VALUE */, parentComponent, key);
|
|
11279
|
+
value = type === 'number' ? 0 : '';
|
|
11280
|
+
needRemove = true;
|
|
11281
|
+
}
|
|
11188
11282
|
}
|
|
11189
11283
|
}
|
|
11190
|
-
// some properties perform value validation and throw
|
|
11284
|
+
// some properties perform value validation and throw,
|
|
11285
|
+
// some properties has getter, no setter, will error in 'use strict'
|
|
11286
|
+
// eg. <select :type="null"></select> <select :willValidate="null"></select>
|
|
11191
11287
|
try {
|
|
11192
11288
|
el[key] = value;
|
|
11193
11289
|
}
|
|
@@ -11197,31 +11293,35 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
11197
11293
|
`value ${value} is invalid.`, e);
|
|
11198
11294
|
}
|
|
11199
11295
|
}
|
|
11296
|
+
needRemove && el.removeAttribute(key);
|
|
11200
11297
|
}
|
|
11201
11298
|
|
|
11202
11299
|
// Async edge case fix requires storing an event listener's attach timestamp.
|
|
11203
|
-
|
|
11204
|
-
let
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
|
|
11208
|
-
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
|
|
11212
|
-
|
|
11213
|
-
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
|
|
11217
|
-
|
|
11218
|
-
|
|
11219
|
-
|
|
11220
|
-
|
|
11300
|
+
const [_getNow, skipTimestampCheck] = /*#__PURE__*/ (() => {
|
|
11301
|
+
let _getNow = Date.now;
|
|
11302
|
+
let skipTimestampCheck = false;
|
|
11303
|
+
if (typeof window !== 'undefined') {
|
|
11304
|
+
// Determine what event timestamp the browser is using. Annoyingly, the
|
|
11305
|
+
// timestamp can either be hi-res (relative to page load) or low-res
|
|
11306
|
+
// (relative to UNIX epoch), so in order to compare time we have to use the
|
|
11307
|
+
// same timestamp type when saving the flush timestamp.
|
|
11308
|
+
if (Date.now() > document.createEvent('Event').timeStamp) {
|
|
11309
|
+
// if the low-res timestamp which is bigger than the event timestamp
|
|
11310
|
+
// (which is evaluated AFTER) it means the event is using a hi-res timestamp,
|
|
11311
|
+
// and we need to use the hi-res version for event listeners as well.
|
|
11312
|
+
_getNow = () => performance.now();
|
|
11313
|
+
}
|
|
11314
|
+
// #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
|
|
11315
|
+
// and does not fire microtasks in between event propagation, so safe to exclude.
|
|
11316
|
+
const ffMatch = navigator.userAgent.match(/firefox\/(\d+)/i);
|
|
11317
|
+
skipTimestampCheck = !!(ffMatch && Number(ffMatch[1]) <= 53);
|
|
11318
|
+
}
|
|
11319
|
+
return [_getNow, skipTimestampCheck];
|
|
11320
|
+
})();
|
|
11221
11321
|
// To avoid the overhead of repeatedly calling performance.now(), we cache
|
|
11222
11322
|
// and use the same timestamp for all event listeners attached in the same tick.
|
|
11223
11323
|
let cachedNow = 0;
|
|
11224
|
-
const p = Promise.resolve();
|
|
11324
|
+
const p = /*#__PURE__*/ Promise.resolve();
|
|
11225
11325
|
const reset = () => {
|
|
11226
11326
|
cachedNow = 0;
|
|
11227
11327
|
};
|
|
@@ -11346,13 +11446,13 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
11346
11446
|
}
|
|
11347
11447
|
return false;
|
|
11348
11448
|
}
|
|
11349
|
-
//
|
|
11350
|
-
//
|
|
11351
|
-
//
|
|
11352
|
-
//
|
|
11449
|
+
// these are enumerated attrs, however their corresponding DOM properties
|
|
11450
|
+
// are actually booleans - this leads to setting it with a string "false"
|
|
11451
|
+
// value leading it to be coerced to `true`, so we need to always treat
|
|
11452
|
+
// them as attributes.
|
|
11353
11453
|
// Note that `contentEditable` doesn't have this problem: its DOM
|
|
11354
11454
|
// property is also enumerated string values.
|
|
11355
|
-
if (key === 'spellcheck' || key === 'draggable') {
|
|
11455
|
+
if (key === 'spellcheck' || key === 'draggable' || key === 'translate') {
|
|
11356
11456
|
return false;
|
|
11357
11457
|
}
|
|
11358
11458
|
// #1787, #2840 form property on form elements is readonly and must be set as
|
|
@@ -12494,7 +12594,7 @@ function setDisplay(el, value) {
|
|
|
12494
12594
|
el.style.display = value ? el._vod : 'none';
|
|
12495
12595
|
}
|
|
12496
12596
|
|
|
12497
|
-
const rendererOptions = extend({ patchProp }, nodeOps);
|
|
12597
|
+
const rendererOptions = /*#__PURE__*/ extend({ patchProp }, nodeOps);
|
|
12498
12598
|
// lazy create the renderer - this makes core renderer logic tree-shakable
|
|
12499
12599
|
// in case the user only imports reactivity utilities from Vue.
|
|
12500
12600
|
let renderer;
|