vue 3.4.13 → 3.4.15

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 v3.4.13
2
+ * vue v3.4.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * vue v3.4.13
2
+ * vue v3.4.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -268,6 +268,13 @@ var Vue = (function (exports) {
268
268
  const isKnownSvgAttr = /* @__PURE__ */ makeMap(
269
269
  `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`
270
270
  );
271
+ function isRenderableAttrValue(value) {
272
+ if (value == null) {
273
+ return false;
274
+ }
275
+ const type = typeof value;
276
+ return type === "string" || type === "number" || type === "boolean";
277
+ }
271
278
 
272
279
  function looseCompareArrays(a, b) {
273
280
  if (a.length !== b.length)
@@ -630,10 +637,7 @@ var Vue = (function (exports) {
630
637
  var _a;
631
638
  pauseScheduling();
632
639
  for (const effect2 of dep.keys()) {
633
- if (dep.get(effect2) !== effect2._trackId) {
634
- continue;
635
- }
636
- if (effect2._dirtyLevel < dirtyLevel) {
640
+ if (effect2._dirtyLevel < dirtyLevel && dep.get(effect2) === effect2._trackId) {
637
641
  const lastDirtyLevel = effect2._dirtyLevel;
638
642
  effect2._dirtyLevel = dirtyLevel;
639
643
  if (lastDirtyLevel === 0) {
@@ -644,12 +648,17 @@ var Vue = (function (exports) {
644
648
  effect2.trigger();
645
649
  }
646
650
  }
647
- if (effect2.scheduler && effect2._shouldSchedule && (!effect2._runnings || effect2.allowRecurse)) {
651
+ }
652
+ scheduleEffects(dep);
653
+ resetScheduling();
654
+ }
655
+ function scheduleEffects(dep) {
656
+ for (const effect2 of dep.keys()) {
657
+ if (effect2.scheduler && effect2._shouldSchedule && (!effect2._runnings || effect2.allowRecurse) && dep.get(effect2) === effect2._trackId) {
648
658
  effect2._shouldSchedule = false;
649
659
  queueEffectSchedulers.push(effect2.scheduler);
650
660
  }
651
661
  }
652
- resetScheduling();
653
662
  }
654
663
 
655
664
  const createDep = (cleanup, computed) => {
@@ -1332,7 +1341,8 @@ var Vue = (function (exports) {
1332
1341
  this["__v_isReadonly"] = false;
1333
1342
  this.effect = new ReactiveEffect(
1334
1343
  () => getter(this._value),
1335
- () => triggerRefValue(this, 1)
1344
+ () => triggerRefValue(this, 1),
1345
+ () => this.dep && scheduleEffects(this.dep)
1336
1346
  );
1337
1347
  this.effect.computed = this;
1338
1348
  this.effect.active = this._cacheable = !isSSR;
@@ -1346,6 +1356,9 @@ var Vue = (function (exports) {
1346
1356
  }
1347
1357
  }
1348
1358
  trackRefValue(self);
1359
+ if (self.effect._dirtyLevel >= 1) {
1360
+ triggerRefValue(self, 1);
1361
+ }
1349
1362
  return self._value;
1350
1363
  }
1351
1364
  set value(newValue) {
@@ -5926,7 +5939,7 @@ If you want to remount the same app, move your app creation logic into a factory
5926
5939
  return rawSlot;
5927
5940
  }
5928
5941
  const normalized = withCtx((...args) => {
5929
- if (currentInstance) {
5942
+ if (currentInstance && (!ctx || ctx.root === currentInstance.root)) {
5930
5943
  warn$1(
5931
5944
  `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.`
5932
5945
  );
@@ -6062,9 +6075,10 @@ If you want to remount the same app, move your app creation logic into a factory
6062
6075
  } else {
6063
6076
  const _isString = isString(ref);
6064
6077
  const _isRef = isRef(ref);
6078
+ const isVFor = rawRef.f;
6065
6079
  if (_isString || _isRef) {
6066
6080
  const doSet = () => {
6067
- if (rawRef.f) {
6081
+ if (isVFor) {
6068
6082
  const existing = _isString ? hasOwn(setupState, ref) ? setupState[ref] : refs[ref] : ref.value;
6069
6083
  if (isUnmount) {
6070
6084
  isArray(existing) && remove(existing, refValue);
@@ -6097,11 +6111,11 @@ If you want to remount the same app, move your app creation logic into a factory
6097
6111
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
6098
6112
  }
6099
6113
  };
6100
- if (value) {
6114
+ if (isUnmount || isVFor) {
6115
+ doSet();
6116
+ } else {
6101
6117
  doSet.id = -1;
6102
6118
  queuePostRenderEffect(doSet, parentSuspense);
6103
- } else {
6104
- doSet();
6105
6119
  }
6106
6120
  } else {
6107
6121
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
@@ -6611,11 +6625,12 @@ Server rendered element contains fewer child nodes than client vdom.`
6611
6625
  } else {
6612
6626
  if (el.hasAttribute(key)) {
6613
6627
  actual = el.getAttribute(key);
6628
+ } else if (key === "value" && el.tagName === "TEXTAREA") {
6629
+ actual = el.value;
6614
6630
  } else {
6615
- const serverValue = el[key];
6616
- actual = isObject(serverValue) || serverValue == null ? "" : String(serverValue);
6631
+ actual = false;
6617
6632
  }
6618
- expected = isObject(clientValue) || clientValue == null ? "" : String(clientValue);
6633
+ expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
6619
6634
  }
6620
6635
  if (actual !== expected) {
6621
6636
  mismatchType = `attribute`;
@@ -9563,7 +9578,7 @@ Component that was made reactive: `,
9563
9578
  return true;
9564
9579
  }
9565
9580
 
9566
- const version = "3.4.13";
9581
+ const version = "3.4.15";
9567
9582
  const warn = warn$1 ;
9568
9583
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9569
9584
  const devtools = devtools$1 ;
@@ -10814,35 +10829,52 @@ Component that was made reactive: `,
10814
10829
  el[assignKey](
10815
10830
  el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
10816
10831
  );
10832
+ el._assigning = true;
10833
+ nextTick(() => {
10834
+ el._assigning = false;
10835
+ });
10817
10836
  });
10818
10837
  el[assignKey] = getModelAssigner(vnode);
10819
10838
  },
10820
10839
  // set value in mounted & updated because <select> relies on its children
10821
10840
  // <option>s.
10822
- mounted(el, { value }) {
10823
- setSelected(el, value);
10841
+ mounted(el, { value, oldValue, modifiers: { number } }) {
10842
+ setSelected(el, value, oldValue, number);
10824
10843
  },
10825
10844
  beforeUpdate(el, _binding, vnode) {
10826
10845
  el[assignKey] = getModelAssigner(vnode);
10827
10846
  },
10828
- updated(el, { value }) {
10829
- setSelected(el, value);
10847
+ updated(el, { value, oldValue, modifiers: { number } }) {
10848
+ if (!el._assigning) {
10849
+ setSelected(el, value, oldValue, number);
10850
+ }
10830
10851
  }
10831
10852
  };
10832
- function setSelected(el, value) {
10853
+ function setSelected(el, value, oldValue, number) {
10833
10854
  const isMultiple = el.multiple;
10834
- if (isMultiple && !isArray(value) && !isSet(value)) {
10855
+ const isArrayValue = isArray(value);
10856
+ if (isMultiple && !isArrayValue && !isSet(value)) {
10835
10857
  warn(
10836
10858
  `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
10837
10859
  );
10838
10860
  return;
10839
10861
  }
10862
+ if (isArrayValue && looseEqual(value, oldValue)) {
10863
+ return;
10864
+ }
10840
10865
  for (let i = 0, l = el.options.length; i < l; i++) {
10841
10866
  const option = el.options[i];
10842
10867
  const optionValue = getValue(option);
10843
10868
  if (isMultiple) {
10844
- if (isArray(value)) {
10845
- option.selected = looseIndexOf(value, optionValue) > -1;
10869
+ if (isArrayValue) {
10870
+ const optionType = typeof optionValue;
10871
+ if (optionType === "string" || optionType === "number") {
10872
+ option.selected = value.includes(
10873
+ number ? looseToNumber(optionValue) : optionValue
10874
+ );
10875
+ } else {
10876
+ option.selected = looseIndexOf(value, optionValue) > -1;
10877
+ }
10846
10878
  } else {
10847
10879
  option.selected = value.has(optionValue);
10848
10880
  }