@vue/runtime-dom 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/dist/runtime-dom.cjs.js +41 -38
- package/dist/runtime-dom.cjs.prod.js +41 -38
- package/dist/runtime-dom.esm-browser.js +166 -69
- package/dist/runtime-dom.esm-browser.prod.js +1 -1
- package/dist/runtime-dom.esm-bundler.js +41 -38
- package/dist/runtime-dom.global.js +166 -69
- package/dist/runtime-dom.global.prod.js +1 -1
- package/package.json +3 -3
|
@@ -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;
|
|
@@ -2097,6 +2122,8 @@ function devtoolsComponentEmit(component, event, params) {
|
|
|
2097
2122
|
}
|
|
2098
2123
|
|
|
2099
2124
|
function emit$1(instance, event, ...rawArgs) {
|
|
2125
|
+
if (instance.isUnmounted)
|
|
2126
|
+
return;
|
|
2100
2127
|
const props = instance.vnode.props || EMPTY_OBJ;
|
|
2101
2128
|
{
|
|
2102
2129
|
const { emitsOptions, propsOptions: [propsOptions] } = instance;
|
|
@@ -3084,12 +3111,10 @@ function watchEffect(effect, options) {
|
|
|
3084
3111
|
return doWatch(effect, null, options);
|
|
3085
3112
|
}
|
|
3086
3113
|
function watchPostEffect(effect, options) {
|
|
3087
|
-
return doWatch(effect, null, (Object.assign(
|
|
3088
|
-
));
|
|
3114
|
+
return doWatch(effect, null, (Object.assign(Object.assign({}, options), { flush: 'post' }) ));
|
|
3089
3115
|
}
|
|
3090
3116
|
function watchSyncEffect(effect, options) {
|
|
3091
|
-
return doWatch(effect, null, (Object.assign(
|
|
3092
|
-
));
|
|
3117
|
+
return doWatch(effect, null, (Object.assign(Object.assign({}, options), { flush: 'sync' }) ));
|
|
3093
3118
|
}
|
|
3094
3119
|
// initial value for watchers to trigger on undefined initial values
|
|
3095
3120
|
const INITIAL_WATCHER_VALUE = {};
|
|
@@ -3375,10 +3400,22 @@ const BaseTransitionImpl = {
|
|
|
3375
3400
|
if (!children || !children.length) {
|
|
3376
3401
|
return;
|
|
3377
3402
|
}
|
|
3378
|
-
|
|
3403
|
+
let child = children[0];
|
|
3379
3404
|
if (children.length > 1) {
|
|
3380
|
-
|
|
3381
|
-
|
|
3405
|
+
let hasFound = false;
|
|
3406
|
+
// locate first non-comment child
|
|
3407
|
+
for (const c of children) {
|
|
3408
|
+
if (c.type !== Comment) {
|
|
3409
|
+
if (hasFound) {
|
|
3410
|
+
// warn more than one non-comment child
|
|
3411
|
+
warn$1('<transition> can only be used on a single element or component. ' +
|
|
3412
|
+
'Use <transition-group> for lists.');
|
|
3413
|
+
break;
|
|
3414
|
+
}
|
|
3415
|
+
child = c;
|
|
3416
|
+
hasFound = true;
|
|
3417
|
+
}
|
|
3418
|
+
}
|
|
3382
3419
|
}
|
|
3383
3420
|
// there's no need to track reactivity for these props so use the raw
|
|
3384
3421
|
// props for a bit better perf
|
|
@@ -3386,11 +3423,11 @@ const BaseTransitionImpl = {
|
|
|
3386
3423
|
const { mode } = rawProps;
|
|
3387
3424
|
// check mode
|
|
3388
3425
|
if (mode &&
|
|
3389
|
-
mode !== 'in-out' &&
|
|
3426
|
+
mode !== 'in-out' &&
|
|
3427
|
+
mode !== 'out-in' &&
|
|
3428
|
+
mode !== 'default') {
|
|
3390
3429
|
warn$1(`invalid <transition> mode: ${mode}`);
|
|
3391
3430
|
}
|
|
3392
|
-
// at this point children has a guaranteed length of 1.
|
|
3393
|
-
const child = children[0];
|
|
3394
3431
|
if (state.isLeaving) {
|
|
3395
3432
|
return emptyPlaceholder(child);
|
|
3396
3433
|
}
|
|
@@ -3613,20 +3650,24 @@ function setTransitionHooks(vnode, hooks) {
|
|
|
3613
3650
|
vnode.transition = hooks;
|
|
3614
3651
|
}
|
|
3615
3652
|
}
|
|
3616
|
-
function getTransitionRawChildren(children, keepComment = false) {
|
|
3653
|
+
function getTransitionRawChildren(children, keepComment = false, parentKey) {
|
|
3617
3654
|
let ret = [];
|
|
3618
3655
|
let keyedFragmentCount = 0;
|
|
3619
3656
|
for (let i = 0; i < children.length; i++) {
|
|
3620
|
-
|
|
3657
|
+
let child = children[i];
|
|
3658
|
+
// #5360 inherit parent key in case of <template v-for>
|
|
3659
|
+
const key = parentKey == null
|
|
3660
|
+
? child.key
|
|
3661
|
+
: String(parentKey) + String(child.key != null ? child.key : i);
|
|
3621
3662
|
// handle fragment children case, e.g. v-for
|
|
3622
3663
|
if (child.type === Fragment) {
|
|
3623
3664
|
if (child.patchFlag & 128 /* KEYED_FRAGMENT */)
|
|
3624
3665
|
keyedFragmentCount++;
|
|
3625
|
-
ret = ret.concat(getTransitionRawChildren(child.children, keepComment));
|
|
3666
|
+
ret = ret.concat(getTransitionRawChildren(child.children, keepComment, key));
|
|
3626
3667
|
}
|
|
3627
3668
|
// comment placeholders should be skipped, e.g. v-if
|
|
3628
3669
|
else if (keepComment || child.type !== Comment) {
|
|
3629
|
-
ret.push(child);
|
|
3670
|
+
ret.push(key != null ? cloneVNode(child, { key }) : child);
|
|
3630
3671
|
}
|
|
3631
3672
|
}
|
|
3632
3673
|
// #1126 if a transition children list contains multiple sub fragments, these
|
|
@@ -4592,6 +4633,10 @@ function updateProps(instance, rawProps, rawPrevProps, optimized) {
|
|
|
4592
4633
|
const propsToUpdate = instance.vnode.dynamicProps;
|
|
4593
4634
|
for (let i = 0; i < propsToUpdate.length; i++) {
|
|
4594
4635
|
let key = propsToUpdate[i];
|
|
4636
|
+
// skip if the prop key is a declared emit event listener
|
|
4637
|
+
if (isEmitListener(instance.emitsOptions, key)) {
|
|
4638
|
+
continue;
|
|
4639
|
+
}
|
|
4595
4640
|
// PROPS flag guarantees rawProps to be non-null
|
|
4596
4641
|
const value = rawProps[key];
|
|
4597
4642
|
if (options) {
|
|
@@ -5116,7 +5161,8 @@ function withDirectives(vnode, directives) {
|
|
|
5116
5161
|
warn$1(`withDirectives can only be used inside render functions.`);
|
|
5117
5162
|
return vnode;
|
|
5118
5163
|
}
|
|
5119
|
-
const instance = internalInstance
|
|
5164
|
+
const instance = getExposeProxy(internalInstance) ||
|
|
5165
|
+
internalInstance.proxy;
|
|
5120
5166
|
const bindings = vnode.dirs || (vnode.dirs = []);
|
|
5121
5167
|
for (let i = 0; i < directives.length; i++) {
|
|
5122
5168
|
let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
|
|
@@ -5188,6 +5234,9 @@ function createAppContext() {
|
|
|
5188
5234
|
let uid = 0;
|
|
5189
5235
|
function createAppAPI(render, hydrate) {
|
|
5190
5236
|
return function createApp(rootComponent, rootProps = null) {
|
|
5237
|
+
if (!isFunction(rootComponent)) {
|
|
5238
|
+
rootComponent = Object.assign({}, rootComponent);
|
|
5239
|
+
}
|
|
5191
5240
|
if (rootProps != null && !isObject(rootProps)) {
|
|
5192
5241
|
warn$1(`root props passed to app.mount() must be an object.`);
|
|
5193
5242
|
rootProps = null;
|
|
@@ -5384,6 +5433,9 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
|
|
|
5384
5433
|
if (!isArray(existing)) {
|
|
5385
5434
|
if (_isString) {
|
|
5386
5435
|
refs[ref] = [refValue];
|
|
5436
|
+
if (hasOwn(setupState, ref)) {
|
|
5437
|
+
setupState[ref] = refs[ref];
|
|
5438
|
+
}
|
|
5387
5439
|
}
|
|
5388
5440
|
else {
|
|
5389
5441
|
ref.value = [refValue];
|
|
@@ -5582,7 +5634,8 @@ function createHydrationFunctions(rendererInternals) {
|
|
|
5582
5634
|
// e.g. <option :value="obj">, <input type="checkbox" :true-value="1">
|
|
5583
5635
|
const forcePatchValue = (type === 'input' && dirs) || type === 'option';
|
|
5584
5636
|
// skip props & children if this is hoisted static nodes
|
|
5585
|
-
|
|
5637
|
+
// #5405 in dev, always hydrate children for HMR
|
|
5638
|
+
{
|
|
5586
5639
|
if (dirs) {
|
|
5587
5640
|
invokeDirectiveHook(vnode, null, parentComponent, 'created');
|
|
5588
5641
|
}
|
|
@@ -5755,7 +5808,7 @@ function startMeasure(instance, type) {
|
|
|
5755
5808
|
perf.mark(`vue-${type}-${instance.uid}`);
|
|
5756
5809
|
}
|
|
5757
5810
|
{
|
|
5758
|
-
devtoolsPerfStart(instance, type,
|
|
5811
|
+
devtoolsPerfStart(instance, type, isSupported() ? perf.now() : Date.now());
|
|
5759
5812
|
}
|
|
5760
5813
|
}
|
|
5761
5814
|
function endMeasure(instance, type) {
|
|
@@ -5768,7 +5821,7 @@ function endMeasure(instance, type) {
|
|
|
5768
5821
|
perf.clearMarks(endTag);
|
|
5769
5822
|
}
|
|
5770
5823
|
{
|
|
5771
|
-
devtoolsPerfEnd(instance, type,
|
|
5824
|
+
devtoolsPerfEnd(instance, type, isSupported() ? perf.now() : Date.now());
|
|
5772
5825
|
}
|
|
5773
5826
|
}
|
|
5774
5827
|
function isSupported() {
|
|
@@ -6896,7 +6949,22 @@ function baseCreateRenderer(options, createHydrationFns) {
|
|
|
6896
6949
|
const remove = vnode => {
|
|
6897
6950
|
const { type, el, anchor, transition } = vnode;
|
|
6898
6951
|
if (type === Fragment) {
|
|
6899
|
-
|
|
6952
|
+
if (vnode.patchFlag > 0 &&
|
|
6953
|
+
vnode.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */ &&
|
|
6954
|
+
transition &&
|
|
6955
|
+
!transition.persisted) {
|
|
6956
|
+
vnode.children.forEach(child => {
|
|
6957
|
+
if (child.type === Comment) {
|
|
6958
|
+
hostRemove(child.el);
|
|
6959
|
+
}
|
|
6960
|
+
else {
|
|
6961
|
+
remove(child);
|
|
6962
|
+
}
|
|
6963
|
+
});
|
|
6964
|
+
}
|
|
6965
|
+
else {
|
|
6966
|
+
removeFragment(el, anchor);
|
|
6967
|
+
}
|
|
6900
6968
|
return;
|
|
6901
6969
|
}
|
|
6902
6970
|
if (type === Static) {
|
|
@@ -7915,7 +7983,10 @@ function renderSlot(slots, name, props = {},
|
|
|
7915
7983
|
// this is not a user-facing function, so the fallback is always generated by
|
|
7916
7984
|
// the compiler and guaranteed to be a function returning an array
|
|
7917
7985
|
fallback, noSlotted) {
|
|
7918
|
-
if (currentRenderingInstance.isCE
|
|
7986
|
+
if (currentRenderingInstance.isCE ||
|
|
7987
|
+
(currentRenderingInstance.parent &&
|
|
7988
|
+
isAsyncWrapper(currentRenderingInstance.parent) &&
|
|
7989
|
+
currentRenderingInstance.parent.isCE)) {
|
|
7919
7990
|
return createVNode('slot', name === 'default' ? null : { name }, fallback && fallback());
|
|
7920
7991
|
}
|
|
7921
7992
|
let slot = slots[name];
|
|
@@ -7988,7 +8059,10 @@ const getPublicInstance = (i) => {
|
|
|
7988
8059
|
return getExposeProxy(i) || i.proxy;
|
|
7989
8060
|
return getPublicInstance(i.parent);
|
|
7990
8061
|
};
|
|
7991
|
-
const publicPropertiesMap =
|
|
8062
|
+
const publicPropertiesMap =
|
|
8063
|
+
// Move PURE marker to new line to workaround compiler discarding it
|
|
8064
|
+
// due to type annotation
|
|
8065
|
+
/*#__PURE__*/ extend(Object.create(null), {
|
|
7992
8066
|
$: i => i,
|
|
7993
8067
|
$el: i => i.vnode.el,
|
|
7994
8068
|
$data: i => i.data,
|
|
@@ -8116,9 +8190,11 @@ const PublicInstanceProxyHandlers = {
|
|
|
8116
8190
|
const { data, setupState, ctx } = instance;
|
|
8117
8191
|
if (setupState !== EMPTY_OBJ && hasOwn(setupState, key)) {
|
|
8118
8192
|
setupState[key] = value;
|
|
8193
|
+
return true;
|
|
8119
8194
|
}
|
|
8120
8195
|
else if (data !== EMPTY_OBJ && hasOwn(data, key)) {
|
|
8121
8196
|
data[key] = value;
|
|
8197
|
+
return true;
|
|
8122
8198
|
}
|
|
8123
8199
|
else if (hasOwn(instance.props, key)) {
|
|
8124
8200
|
warn$1(`Attempting to mutate prop "${key}". Props are readonly.`, instance);
|
|
@@ -8152,6 +8228,16 @@ const PublicInstanceProxyHandlers = {
|
|
|
8152
8228
|
hasOwn(ctx, key) ||
|
|
8153
8229
|
hasOwn(publicPropertiesMap, key) ||
|
|
8154
8230
|
hasOwn(appContext.config.globalProperties, key));
|
|
8231
|
+
},
|
|
8232
|
+
defineProperty(target, key, descriptor) {
|
|
8233
|
+
if (descriptor.get != null) {
|
|
8234
|
+
// invalidate key cache of a getter based property #5417
|
|
8235
|
+
target._.accessCache[key] = 0;
|
|
8236
|
+
}
|
|
8237
|
+
else if (hasOwn(descriptor, 'value')) {
|
|
8238
|
+
this.set(target, key, descriptor.value, null);
|
|
8239
|
+
}
|
|
8240
|
+
return Reflect.defineProperty(target, key, descriptor);
|
|
8155
8241
|
}
|
|
8156
8242
|
};
|
|
8157
8243
|
{
|
|
@@ -8354,6 +8440,7 @@ function setupComponent(instance, isSSR = false) {
|
|
|
8354
8440
|
return setupResult;
|
|
8355
8441
|
}
|
|
8356
8442
|
function setupStatefulComponent(instance, isSSR) {
|
|
8443
|
+
var _a;
|
|
8357
8444
|
const Component = instance.type;
|
|
8358
8445
|
{
|
|
8359
8446
|
if (Component.name) {
|
|
@@ -8411,6 +8498,13 @@ function setupStatefulComponent(instance, isSSR) {
|
|
|
8411
8498
|
// async setup returned Promise.
|
|
8412
8499
|
// bail here and wait for re-entry.
|
|
8413
8500
|
instance.asyncDep = setupResult;
|
|
8501
|
+
if (!instance.suspense) {
|
|
8502
|
+
const name = (_a = Component.name) !== null && _a !== void 0 ? _a : 'Anonymous';
|
|
8503
|
+
warn$1(`Component <${name}>: setup function returned a promise, but no ` +
|
|
8504
|
+
`<Suspense> boundary was found in the parent component tree. ` +
|
|
8505
|
+
`A component with async setup() must be nested in a <Suspense> ` +
|
|
8506
|
+
`in order to be rendered.`);
|
|
8507
|
+
}
|
|
8414
8508
|
}
|
|
8415
8509
|
}
|
|
8416
8510
|
else {
|
|
@@ -9027,7 +9121,7 @@ function isMemoSame(cached, memo) {
|
|
|
9027
9121
|
}
|
|
9028
9122
|
|
|
9029
9123
|
// Core API ------------------------------------------------------------------
|
|
9030
|
-
const version = "3.2.
|
|
9124
|
+
const version = "3.2.33";
|
|
9031
9125
|
/**
|
|
9032
9126
|
* SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
|
|
9033
9127
|
* @internal
|
|
@@ -9044,7 +9138,7 @@ const compatUtils = (null);
|
|
|
9044
9138
|
|
|
9045
9139
|
const svgNS = 'http://www.w3.org/2000/svg';
|
|
9046
9140
|
const doc = (typeof document !== 'undefined' ? document : null);
|
|
9047
|
-
const templateContainer = doc && doc.createElement('template');
|
|
9141
|
+
const templateContainer = doc && /*#__PURE__*/ doc.createElement('template');
|
|
9048
9142
|
const nodeOps = {
|
|
9049
9143
|
insert: (child, parent, anchor) => {
|
|
9050
9144
|
parent.insertBefore(child, anchor || null);
|
|
@@ -9195,6 +9289,8 @@ function setStyle(style, name, val) {
|
|
|
9195
9289
|
val.forEach(v => setStyle(style, name, v));
|
|
9196
9290
|
}
|
|
9197
9291
|
else {
|
|
9292
|
+
if (val == null)
|
|
9293
|
+
val = '';
|
|
9198
9294
|
if (name.startsWith('--')) {
|
|
9199
9295
|
// custom property definition
|
|
9200
9296
|
style.setProperty(name, val);
|
|
@@ -9289,31 +9385,28 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
9289
9385
|
}
|
|
9290
9386
|
return;
|
|
9291
9387
|
}
|
|
9388
|
+
let needRemove = false;
|
|
9292
9389
|
if (value === '' || value == null) {
|
|
9293
9390
|
const type = typeof el[key];
|
|
9294
9391
|
if (type === 'boolean') {
|
|
9295
9392
|
// e.g. <select multiple> compiles to { multiple: '' }
|
|
9296
|
-
|
|
9297
|
-
return;
|
|
9393
|
+
value = includeBooleanAttr(value);
|
|
9298
9394
|
}
|
|
9299
9395
|
else if (value == null && type === 'string') {
|
|
9300
9396
|
// e.g. <div :id="null">
|
|
9301
|
-
|
|
9302
|
-
|
|
9303
|
-
return;
|
|
9397
|
+
value = '';
|
|
9398
|
+
needRemove = true;
|
|
9304
9399
|
}
|
|
9305
9400
|
else if (type === 'number') {
|
|
9306
9401
|
// e.g. <img :width="null">
|
|
9307
9402
|
// the value of some IDL attr must be greater than 0, e.g. input.size = 0 -> error
|
|
9308
|
-
|
|
9309
|
-
|
|
9310
|
-
}
|
|
9311
|
-
catch (_a) { }
|
|
9312
|
-
el.removeAttribute(key);
|
|
9313
|
-
return;
|
|
9403
|
+
value = 0;
|
|
9404
|
+
needRemove = true;
|
|
9314
9405
|
}
|
|
9315
9406
|
}
|
|
9316
|
-
// some properties perform value validation and throw
|
|
9407
|
+
// some properties perform value validation and throw,
|
|
9408
|
+
// some properties has getter, no setter, will error in 'use strict'
|
|
9409
|
+
// eg. <select :type="null"></select> <select :willValidate="null"></select>
|
|
9317
9410
|
try {
|
|
9318
9411
|
el[key] = value;
|
|
9319
9412
|
}
|
|
@@ -9323,31 +9416,35 @@ prevChildren, parentComponent, parentSuspense, unmountChildren) {
|
|
|
9323
9416
|
`value ${value} is invalid.`, e);
|
|
9324
9417
|
}
|
|
9325
9418
|
}
|
|
9419
|
+
needRemove && el.removeAttribute(key);
|
|
9326
9420
|
}
|
|
9327
9421
|
|
|
9328
9422
|
// Async edge case fix requires storing an event listener's attach timestamp.
|
|
9329
|
-
|
|
9330
|
-
let
|
|
9331
|
-
|
|
9332
|
-
|
|
9333
|
-
|
|
9334
|
-
|
|
9335
|
-
|
|
9336
|
-
|
|
9337
|
-
|
|
9338
|
-
|
|
9339
|
-
|
|
9340
|
-
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
|
|
9344
|
-
|
|
9345
|
-
|
|
9346
|
-
|
|
9423
|
+
const [_getNow, skipTimestampCheck] = /*#__PURE__*/ (() => {
|
|
9424
|
+
let _getNow = Date.now;
|
|
9425
|
+
let skipTimestampCheck = false;
|
|
9426
|
+
if (typeof window !== 'undefined') {
|
|
9427
|
+
// Determine what event timestamp the browser is using. Annoyingly, the
|
|
9428
|
+
// timestamp can either be hi-res (relative to page load) or low-res
|
|
9429
|
+
// (relative to UNIX epoch), so in order to compare time we have to use the
|
|
9430
|
+
// same timestamp type when saving the flush timestamp.
|
|
9431
|
+
if (Date.now() > document.createEvent('Event').timeStamp) {
|
|
9432
|
+
// if the low-res timestamp which is bigger than the event timestamp
|
|
9433
|
+
// (which is evaluated AFTER) it means the event is using a hi-res timestamp,
|
|
9434
|
+
// and we need to use the hi-res version for event listeners as well.
|
|
9435
|
+
_getNow = () => performance.now();
|
|
9436
|
+
}
|
|
9437
|
+
// #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
|
|
9438
|
+
// and does not fire microtasks in between event propagation, so safe to exclude.
|
|
9439
|
+
const ffMatch = navigator.userAgent.match(/firefox\/(\d+)/i);
|
|
9440
|
+
skipTimestampCheck = !!(ffMatch && Number(ffMatch[1]) <= 53);
|
|
9441
|
+
}
|
|
9442
|
+
return [_getNow, skipTimestampCheck];
|
|
9443
|
+
})();
|
|
9347
9444
|
// To avoid the overhead of repeatedly calling performance.now(), we cache
|
|
9348
9445
|
// and use the same timestamp for all event listeners attached in the same tick.
|
|
9349
9446
|
let cachedNow = 0;
|
|
9350
|
-
const p = Promise.resolve();
|
|
9447
|
+
const p = /*#__PURE__*/ Promise.resolve();
|
|
9351
9448
|
const reset = () => {
|
|
9352
9449
|
cachedNow = 0;
|
|
9353
9450
|
};
|
|
@@ -9472,13 +9569,13 @@ function shouldSetAsProp(el, key, value, isSVG) {
|
|
|
9472
9569
|
}
|
|
9473
9570
|
return false;
|
|
9474
9571
|
}
|
|
9475
|
-
//
|
|
9476
|
-
//
|
|
9477
|
-
//
|
|
9478
|
-
//
|
|
9572
|
+
// these are enumerated attrs, however their corresponding DOM properties
|
|
9573
|
+
// are actually booleans - this leads to setting it with a string "false"
|
|
9574
|
+
// value leading it to be coerced to `true`, so we need to always treat
|
|
9575
|
+
// them as attributes.
|
|
9479
9576
|
// Note that `contentEditable` doesn't have this problem: its DOM
|
|
9480
9577
|
// property is also enumerated string values.
|
|
9481
|
-
if (key === 'spellcheck' || key === 'draggable') {
|
|
9578
|
+
if (key === 'spellcheck' || key === 'draggable' || key === 'translate') {
|
|
9482
9579
|
return false;
|
|
9483
9580
|
}
|
|
9484
9581
|
// #1787, #2840 form property on form elements is readonly and must be set as
|
|
@@ -10545,7 +10642,7 @@ function setDisplay(el, value) {
|
|
|
10545
10642
|
el.style.display = value ? el._vod : 'none';
|
|
10546
10643
|
}
|
|
10547
10644
|
|
|
10548
|
-
const rendererOptions = extend({ patchProp }, nodeOps);
|
|
10645
|
+
const rendererOptions = /*#__PURE__*/ extend({ patchProp }, nodeOps);
|
|
10549
10646
|
// lazy create the renderer - this makes core renderer logic tree-shakable
|
|
10550
10647
|
// in case the user only imports reactivity utilities from Vue.
|
|
10551
10648
|
let renderer;
|