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.
package/dist/vue.cjs.js CHANGED
@@ -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
  **/
@@ -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
  **/
@@ -265,6 +265,13 @@ const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
265
265
  const isKnownSvgAttr = /* @__PURE__ */ makeMap(
266
266
  `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`
267
267
  );
268
+ function isRenderableAttrValue(value) {
269
+ if (value == null) {
270
+ return false;
271
+ }
272
+ const type = typeof value;
273
+ return type === "string" || type === "number" || type === "boolean";
274
+ }
268
275
 
269
276
  function looseCompareArrays(a, b) {
270
277
  if (a.length !== b.length)
@@ -627,10 +634,7 @@ function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
627
634
  var _a;
628
635
  pauseScheduling();
629
636
  for (const effect2 of dep.keys()) {
630
- if (dep.get(effect2) !== effect2._trackId) {
631
- continue;
632
- }
633
- if (effect2._dirtyLevel < dirtyLevel) {
637
+ if (effect2._dirtyLevel < dirtyLevel && dep.get(effect2) === effect2._trackId) {
634
638
  const lastDirtyLevel = effect2._dirtyLevel;
635
639
  effect2._dirtyLevel = dirtyLevel;
636
640
  if (lastDirtyLevel === 0) {
@@ -641,12 +645,17 @@ function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
641
645
  effect2.trigger();
642
646
  }
643
647
  }
644
- if (effect2.scheduler && effect2._shouldSchedule && (!effect2._runnings || effect2.allowRecurse)) {
648
+ }
649
+ scheduleEffects(dep);
650
+ resetScheduling();
651
+ }
652
+ function scheduleEffects(dep) {
653
+ for (const effect2 of dep.keys()) {
654
+ if (effect2.scheduler && effect2._shouldSchedule && (!effect2._runnings || effect2.allowRecurse) && dep.get(effect2) === effect2._trackId) {
645
655
  effect2._shouldSchedule = false;
646
656
  queueEffectSchedulers.push(effect2.scheduler);
647
657
  }
648
658
  }
649
- resetScheduling();
650
659
  }
651
660
 
652
661
  const createDep = (cleanup, computed) => {
@@ -1329,7 +1338,8 @@ class ComputedRefImpl {
1329
1338
  this["__v_isReadonly"] = false;
1330
1339
  this.effect = new ReactiveEffect(
1331
1340
  () => getter(this._value),
1332
- () => triggerRefValue(this, 1)
1341
+ () => triggerRefValue(this, 1),
1342
+ () => this.dep && scheduleEffects(this.dep)
1333
1343
  );
1334
1344
  this.effect.computed = this;
1335
1345
  this.effect.active = this._cacheable = !isSSR;
@@ -1343,6 +1353,9 @@ class ComputedRefImpl {
1343
1353
  }
1344
1354
  }
1345
1355
  trackRefValue(self);
1356
+ if (self.effect._dirtyLevel >= 1) {
1357
+ triggerRefValue(self, 1);
1358
+ }
1346
1359
  return self._value;
1347
1360
  }
1348
1361
  set value(newValue) {
@@ -5929,7 +5942,7 @@ const normalizeSlot = (key, rawSlot, ctx) => {
5929
5942
  return rawSlot;
5930
5943
  }
5931
5944
  const normalized = withCtx((...args) => {
5932
- if (currentInstance) {
5945
+ if (currentInstance && (!ctx || ctx.root === currentInstance.root)) {
5933
5946
  warn$1(
5934
5947
  `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.`
5935
5948
  );
@@ -6065,9 +6078,10 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
6065
6078
  } else {
6066
6079
  const _isString = isString(ref);
6067
6080
  const _isRef = isRef(ref);
6081
+ const isVFor = rawRef.f;
6068
6082
  if (_isString || _isRef) {
6069
6083
  const doSet = () => {
6070
- if (rawRef.f) {
6084
+ if (isVFor) {
6071
6085
  const existing = _isString ? hasOwn(setupState, ref) ? setupState[ref] : refs[ref] : ref.value;
6072
6086
  if (isUnmount) {
6073
6087
  isArray(existing) && remove(existing, refValue);
@@ -6100,11 +6114,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
6100
6114
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
6101
6115
  }
6102
6116
  };
6103
- if (value) {
6117
+ if (isUnmount || isVFor) {
6118
+ doSet();
6119
+ } else {
6104
6120
  doSet.id = -1;
6105
6121
  queuePostRenderEffect(doSet, parentSuspense);
6106
- } else {
6107
- doSet();
6108
6122
  }
6109
6123
  } else {
6110
6124
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
@@ -6614,11 +6628,12 @@ function propHasMismatch(el, key, clientValue, vnode) {
6614
6628
  } else {
6615
6629
  if (el.hasAttribute(key)) {
6616
6630
  actual = el.getAttribute(key);
6631
+ } else if (key === "value" && el.tagName === "TEXTAREA") {
6632
+ actual = el.value;
6617
6633
  } else {
6618
- const serverValue = el[key];
6619
- actual = isObject(serverValue) || serverValue == null ? "" : String(serverValue);
6634
+ actual = false;
6620
6635
  }
6621
- expected = isObject(clientValue) || clientValue == null ? "" : String(clientValue);
6636
+ expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
6622
6637
  }
6623
6638
  if (actual !== expected) {
6624
6639
  mismatchType = `attribute`;
@@ -9566,7 +9581,7 @@ function isMemoSame(cached, memo) {
9566
9581
  return true;
9567
9582
  }
9568
9583
 
9569
- const version = "3.4.13";
9584
+ const version = "3.4.15";
9570
9585
  const warn = warn$1 ;
9571
9586
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
9572
9587
  const devtools = devtools$1 ;
@@ -10829,35 +10844,52 @@ const vModelSelect = {
10829
10844
  el[assignKey](
10830
10845
  el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
10831
10846
  );
10847
+ el._assigning = true;
10848
+ nextTick(() => {
10849
+ el._assigning = false;
10850
+ });
10832
10851
  });
10833
10852
  el[assignKey] = getModelAssigner(vnode);
10834
10853
  },
10835
10854
  // set value in mounted & updated because <select> relies on its children
10836
10855
  // <option>s.
10837
- mounted(el, { value }) {
10838
- setSelected(el, value);
10856
+ mounted(el, { value, oldValue, modifiers: { number } }) {
10857
+ setSelected(el, value, oldValue, number);
10839
10858
  },
10840
10859
  beforeUpdate(el, _binding, vnode) {
10841
10860
  el[assignKey] = getModelAssigner(vnode);
10842
10861
  },
10843
- updated(el, { value }) {
10844
- setSelected(el, value);
10862
+ updated(el, { value, oldValue, modifiers: { number } }) {
10863
+ if (!el._assigning) {
10864
+ setSelected(el, value, oldValue, number);
10865
+ }
10845
10866
  }
10846
10867
  };
10847
- function setSelected(el, value) {
10868
+ function setSelected(el, value, oldValue, number) {
10848
10869
  const isMultiple = el.multiple;
10849
- if (isMultiple && !isArray(value) && !isSet(value)) {
10870
+ const isArrayValue = isArray(value);
10871
+ if (isMultiple && !isArrayValue && !isSet(value)) {
10850
10872
  warn(
10851
10873
  `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
10852
10874
  );
10853
10875
  return;
10854
10876
  }
10877
+ if (isArrayValue && looseEqual(value, oldValue)) {
10878
+ return;
10879
+ }
10855
10880
  for (let i = 0, l = el.options.length; i < l; i++) {
10856
10881
  const option = el.options[i];
10857
10882
  const optionValue = getValue(option);
10858
10883
  if (isMultiple) {
10859
- if (isArray(value)) {
10860
- option.selected = looseIndexOf(value, optionValue) > -1;
10884
+ if (isArrayValue) {
10885
+ const optionType = typeof optionValue;
10886
+ if (optionType === "string" || optionType === "number") {
10887
+ option.selected = value.includes(
10888
+ number ? looseToNumber(optionValue) : optionValue
10889
+ );
10890
+ } else {
10891
+ option.selected = looseIndexOf(value, optionValue) > -1;
10892
+ }
10861
10893
  } else {
10862
10894
  option.selected = value.has(optionValue);
10863
10895
  }