@vue/runtime-dom 3.4.14 → 3.4.16

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.4.14
2
+ * @vue/runtime-dom v3.4.16
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -203,6 +203,13 @@ var VueRuntimeDOM = (function (exports) {
203
203
  const isKnownSvgAttr = /* @__PURE__ */ makeMap(
204
204
  `xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`
205
205
  );
206
+ function isRenderableAttrValue(value) {
207
+ if (value == null) {
208
+ return false;
209
+ }
210
+ const type = typeof value;
211
+ return type === "string" || type === "number" || type === "boolean";
212
+ }
206
213
 
207
214
  function looseCompareArrays(a, b) {
208
215
  if (a.length !== b.length)
@@ -403,7 +410,7 @@ var VueRuntimeDOM = (function (exports) {
403
410
  /**
404
411
  * @internal
405
412
  */
406
- this._dirtyLevel = 2;
413
+ this._dirtyLevel = 4;
407
414
  /**
408
415
  * @internal
409
416
  */
@@ -423,26 +430,27 @@ var VueRuntimeDOM = (function (exports) {
423
430
  recordEffectScope(this, scope);
424
431
  }
425
432
  get dirty() {
426
- if (this._dirtyLevel === 1) {
433
+ if (this._dirtyLevel === 2 || this._dirtyLevel === 3) {
434
+ this._dirtyLevel = 1;
427
435
  pauseTracking();
428
436
  for (let i = 0; i < this._depsLength; i++) {
429
437
  const dep = this.deps[i];
430
438
  if (dep.computed) {
431
439
  triggerComputed(dep.computed);
432
- if (this._dirtyLevel >= 2) {
440
+ if (this._dirtyLevel >= 4) {
433
441
  break;
434
442
  }
435
443
  }
436
444
  }
437
- if (this._dirtyLevel < 2) {
445
+ if (this._dirtyLevel === 1) {
438
446
  this._dirtyLevel = 0;
439
447
  }
440
448
  resetTracking();
441
449
  }
442
- return this._dirtyLevel >= 2;
450
+ return this._dirtyLevel >= 4;
443
451
  }
444
452
  set dirty(v) {
445
- this._dirtyLevel = v ? 2 : 0;
453
+ this._dirtyLevel = v ? 4 : 0;
446
454
  }
447
455
  run() {
448
456
  this._dirtyLevel = 0;
@@ -482,7 +490,7 @@ var VueRuntimeDOM = (function (exports) {
482
490
  effect2._depsLength = 0;
483
491
  }
484
492
  function postCleanupEffect(effect2) {
485
- if (effect2.deps && effect2.deps.length > effect2._depsLength) {
493
+ if (effect2.deps.length > effect2._depsLength) {
486
494
  for (let i = effect2._depsLength; i < effect2.deps.length; i++) {
487
495
  cleanupDepEffect(effect2.deps[i], effect2);
488
496
  }
@@ -565,24 +573,23 @@ var VueRuntimeDOM = (function (exports) {
565
573
  var _a;
566
574
  pauseScheduling();
567
575
  for (const effect2 of dep.keys()) {
568
- if (dep.get(effect2) !== effect2._trackId) {
569
- continue;
570
- }
571
- if (effect2._dirtyLevel < dirtyLevel && !(effect2._runnings && !effect2.allowRecurse)) {
572
- const lastDirtyLevel = effect2._dirtyLevel;
576
+ let tracking;
577
+ if (effect2._dirtyLevel < dirtyLevel && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
578
+ effect2._shouldSchedule || (effect2._shouldSchedule = effect2._dirtyLevel === 0);
573
579
  effect2._dirtyLevel = dirtyLevel;
574
- if (lastDirtyLevel === 0) {
575
- effect2._shouldSchedule = true;
576
- {
577
- (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
580
+ }
581
+ if (effect2._shouldSchedule && (tracking != null ? tracking : tracking = dep.get(effect2) === effect2._trackId)) {
582
+ {
583
+ (_a = effect2.onTrigger) == null ? void 0 : _a.call(effect2, extend({ effect: effect2 }, debuggerEventExtraInfo));
584
+ }
585
+ effect2.trigger();
586
+ if ((!effect2._runnings || effect2.allowRecurse) && effect2._dirtyLevel !== 2) {
587
+ effect2._shouldSchedule = false;
588
+ if (effect2.scheduler) {
589
+ queueEffectSchedulers.push(effect2.scheduler);
578
590
  }
579
- effect2.trigger();
580
591
  }
581
592
  }
582
- if (effect2.scheduler && effect2._shouldSchedule && (!effect2._runnings || effect2.allowRecurse)) {
583
- effect2._shouldSchedule = false;
584
- queueEffectSchedulers.push(effect2.scheduler);
585
- }
586
593
  }
587
594
  resetScheduling();
588
595
  }
@@ -668,7 +675,7 @@ var VueRuntimeDOM = (function (exports) {
668
675
  if (dep) {
669
676
  triggerEffects(
670
677
  dep,
671
- 2,
678
+ 4,
672
679
  {
673
680
  target,
674
681
  type,
@@ -1253,7 +1260,9 @@ var VueRuntimeDOM = (function (exports) {
1253
1260
  return raw ? toRaw(raw) : observed;
1254
1261
  }
1255
1262
  function markRaw(value) {
1256
- def(value, "__v_skip", true);
1263
+ if (Object.isExtensible(value)) {
1264
+ def(value, "__v_skip", true);
1265
+ }
1257
1266
  return value;
1258
1267
  }
1259
1268
  const toReactive = (value) => isObject(value) ? reactive(value) : value;
@@ -1267,7 +1276,10 @@ var VueRuntimeDOM = (function (exports) {
1267
1276
  this["__v_isReadonly"] = false;
1268
1277
  this.effect = new ReactiveEffect(
1269
1278
  () => getter(this._value),
1270
- () => triggerRefValue(this, 1)
1279
+ () => triggerRefValue(
1280
+ this,
1281
+ this.effect._dirtyLevel === 2 ? 2 : 3
1282
+ )
1271
1283
  );
1272
1284
  this.effect.computed = this;
1273
1285
  this.effect.active = this._cacheable = !isSSR;
@@ -1275,12 +1287,13 @@ var VueRuntimeDOM = (function (exports) {
1275
1287
  }
1276
1288
  get value() {
1277
1289
  const self = toRaw(this);
1278
- if (!self._cacheable || self.effect.dirty) {
1279
- if (hasChanged(self._value, self._value = self.effect.run())) {
1280
- triggerRefValue(self, 2);
1281
- }
1290
+ if ((!self._cacheable || self.effect.dirty) && hasChanged(self._value, self._value = self.effect.run())) {
1291
+ triggerRefValue(self, 4);
1282
1292
  }
1283
1293
  trackRefValue(self);
1294
+ if (self.effect._dirtyLevel >= 2) {
1295
+ triggerRefValue(self, 2);
1296
+ }
1284
1297
  return self._value;
1285
1298
  }
1286
1299
  set value(newValue) {
@@ -1317,14 +1330,15 @@ var VueRuntimeDOM = (function (exports) {
1317
1330
  }
1318
1331
 
1319
1332
  function trackRefValue(ref2) {
1333
+ var _a;
1320
1334
  if (shouldTrack && activeEffect) {
1321
1335
  ref2 = toRaw(ref2);
1322
1336
  trackEffect(
1323
1337
  activeEffect,
1324
- ref2.dep || (ref2.dep = createDep(
1338
+ (_a = ref2.dep) != null ? _a : ref2.dep = createDep(
1325
1339
  () => ref2.dep = void 0,
1326
1340
  ref2 instanceof ComputedRefImpl ? ref2 : void 0
1327
- )),
1341
+ ),
1328
1342
  {
1329
1343
  target: ref2,
1330
1344
  type: "get",
@@ -1333,7 +1347,7 @@ var VueRuntimeDOM = (function (exports) {
1333
1347
  );
1334
1348
  }
1335
1349
  }
1336
- function triggerRefValue(ref2, dirtyLevel = 2, newVal) {
1350
+ function triggerRefValue(ref2, dirtyLevel = 4, newVal) {
1337
1351
  ref2 = toRaw(ref2);
1338
1352
  const dep = ref2.dep;
1339
1353
  if (dep) {
@@ -1382,12 +1396,12 @@ var VueRuntimeDOM = (function (exports) {
1382
1396
  if (hasChanged(newVal, this._rawValue)) {
1383
1397
  this._rawValue = newVal;
1384
1398
  this._value = useDirectValue ? newVal : toReactive(newVal);
1385
- triggerRefValue(this, 2, newVal);
1399
+ triggerRefValue(this, 4, newVal);
1386
1400
  }
1387
1401
  }
1388
1402
  }
1389
1403
  function triggerRef(ref2) {
1390
- triggerRefValue(ref2, 2, ref2.value );
1404
+ triggerRefValue(ref2, 4, ref2.value );
1391
1405
  }
1392
1406
  function unref(ref2) {
1393
1407
  return isRef(ref2) ? ref2.value : ref2;
@@ -5412,11 +5426,12 @@ If you want to remount the same app, move your app creation logic into a factory
5412
5426
  return app;
5413
5427
  },
5414
5428
  runWithContext(fn) {
5429
+ const lastApp = currentApp;
5415
5430
  currentApp = app;
5416
5431
  try {
5417
5432
  return fn();
5418
5433
  } finally {
5419
- currentApp = null;
5434
+ currentApp = lastApp;
5420
5435
  }
5421
5436
  }
5422
5437
  };
@@ -5861,7 +5876,7 @@ If you want to remount the same app, move your app creation logic into a factory
5861
5876
  return rawSlot;
5862
5877
  }
5863
5878
  const normalized = withCtx((...args) => {
5864
- if (currentInstance) {
5879
+ if (currentInstance && (!ctx || ctx.root === currentInstance.root)) {
5865
5880
  warn$1(
5866
5881
  `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
5867
5882
  );
@@ -6335,7 +6350,7 @@ Server rendered element contains more child nodes than client vdom.`
6335
6350
  if (props) {
6336
6351
  {
6337
6352
  for (const key in props) {
6338
- if (propHasMismatch(el, key, props[key], vnode)) {
6353
+ if (propHasMismatch(el, key, props[key], vnode, parentComponent)) {
6339
6354
  hasMismatch = true;
6340
6355
  }
6341
6356
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
@@ -6510,7 +6525,8 @@ Server rendered element contains fewer child nodes than client vdom.`
6510
6525
  };
6511
6526
  return [hydrate, hydrateNode];
6512
6527
  }
6513
- function propHasMismatch(el, key, clientValue, vnode) {
6528
+ function propHasMismatch(el, key, clientValue, vnode, instance) {
6529
+ var _a;
6514
6530
  let mismatchType;
6515
6531
  let mismatchKey;
6516
6532
  let actual;
@@ -6533,6 +6549,10 @@ Server rendered element contains fewer child nodes than client vdom.`
6533
6549
  }
6534
6550
  }
6535
6551
  }
6552
+ const cssVars = (_a = instance == null ? void 0 : instance.getCssVars) == null ? void 0 : _a.call(instance);
6553
+ for (const key2 in cssVars) {
6554
+ expectedMap.set(`--${key2}`, String(cssVars[key2]));
6555
+ }
6536
6556
  if (!isMapEqual(actualMap, expectedMap)) {
6537
6557
  mismatchType = mismatchKey = "style";
6538
6558
  }
@@ -6546,11 +6566,12 @@ Server rendered element contains fewer child nodes than client vdom.`
6546
6566
  } else {
6547
6567
  if (el.hasAttribute(key)) {
6548
6568
  actual = el.getAttribute(key);
6569
+ } else if (key === "value" && el.tagName === "TEXTAREA") {
6570
+ actual = el.value;
6549
6571
  } else {
6550
- const serverValue = el[key];
6551
- actual = isObject(serverValue) || serverValue == null ? "" : String(serverValue);
6572
+ actual = false;
6552
6573
  }
6553
- expected = isObject(clientValue) || clientValue == null ? "" : String(clientValue);
6574
+ expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
6554
6575
  }
6555
6576
  if (actual !== expected) {
6556
6577
  mismatchType = `attribute`;
@@ -9498,7 +9519,7 @@ Component that was made reactive: `,
9498
9519
  return true;
9499
9520
  }
9500
9521
 
9501
- const version = "3.4.14";
9522
+ const version = "3.4.16";
9502
9523
  const warn = warn$1 ;
9503
9524
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9504
9525
  const devtools = devtools$1 ;
@@ -9875,7 +9896,7 @@ Component that was made reactive: `,
9875
9896
  }
9876
9897
  },
9877
9898
  updated(el, { value, oldValue }, { transition }) {
9878
- if (!value === !oldValue)
9899
+ if (!value === !oldValue && el.style.display === el[vShowOldKey])
9879
9900
  return;
9880
9901
  if (transition) {
9881
9902
  if (value) {
@@ -9914,6 +9935,9 @@ Component that was made reactive: `,
9914
9935
  document.querySelectorAll(`[data-v-owner="${instance.uid}"]`)
9915
9936
  ).forEach((node) => setVarsOnNode(node, vars));
9916
9937
  };
9938
+ {
9939
+ instance.getCssVars = () => getter(instance.proxy);
9940
+ }
9917
9941
  const setVars = () => {
9918
9942
  const vars = getter(instance.proxy);
9919
9943
  setVarsOnVNode(instance.subTree, vars);
@@ -9994,6 +10018,7 @@ Component that was made reactive: `,
9994
10018
  }
9995
10019
  }
9996
10020
  if (vShowOldKey in el) {
10021
+ el[vShowOldKey] = style.display;
9997
10022
  style.display = currentDisplay;
9998
10023
  }
9999
10024
  }
@@ -10749,24 +10774,31 @@ Component that was made reactive: `,
10749
10774
  el[assignKey](
10750
10775
  el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
10751
10776
  );
10777
+ el._assigning = true;
10778
+ nextTick(() => {
10779
+ el._assigning = false;
10780
+ });
10752
10781
  });
10753
10782
  el[assignKey] = getModelAssigner(vnode);
10754
10783
  },
10755
10784
  // set value in mounted & updated because <select> relies on its children
10756
10785
  // <option>s.
10757
- mounted(el, { value }) {
10758
- setSelected(el, value);
10786
+ mounted(el, { value, oldValue, modifiers: { number } }) {
10787
+ setSelected(el, value, oldValue, number);
10759
10788
  },
10760
10789
  beforeUpdate(el, _binding, vnode) {
10761
10790
  el[assignKey] = getModelAssigner(vnode);
10762
10791
  },
10763
- updated(el, { value }) {
10764
- setSelected(el, value);
10792
+ updated(el, { value, oldValue, modifiers: { number } }) {
10793
+ if (!el._assigning) {
10794
+ setSelected(el, value, oldValue, number);
10795
+ }
10765
10796
  }
10766
10797
  };
10767
- function setSelected(el, value) {
10798
+ function setSelected(el, value, oldValue, number) {
10768
10799
  const isMultiple = el.multiple;
10769
- if (isMultiple && !isArray(value) && !isSet(value)) {
10800
+ const isArrayValue = isArray(value);
10801
+ if (isMultiple && !isArrayValue && !isSet(value)) {
10770
10802
  warn(
10771
10803
  `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
10772
10804
  );
@@ -10776,8 +10808,15 @@ Component that was made reactive: `,
10776
10808
  const option = el.options[i];
10777
10809
  const optionValue = getValue(option);
10778
10810
  if (isMultiple) {
10779
- if (isArray(value)) {
10780
- option.selected = looseIndexOf(value, optionValue) > -1;
10811
+ if (isArrayValue) {
10812
+ const optionType = typeof optionValue;
10813
+ if (optionType === "string" || optionType === "number") {
10814
+ option.selected = value.includes(
10815
+ number ? looseToNumber(optionValue) : optionValue
10816
+ );
10817
+ } else {
10818
+ option.selected = looseIndexOf(value, optionValue) > -1;
10819
+ }
10781
10820
  } else {
10782
10821
  option.selected = value.has(optionValue);
10783
10822
  }