@vue/compat 3.4.14 → 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/compat v3.4.14
2
+ * @vue/compat v3.4.15
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -200,6 +200,13 @@ const isKnownHtmlAttr = /* @__PURE__ */ makeMap(
200
200
  const isKnownSvgAttr = /* @__PURE__ */ makeMap(
201
201
  `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`
202
202
  );
203
+ function isRenderableAttrValue(value) {
204
+ if (value == null) {
205
+ return false;
206
+ }
207
+ const type = typeof value;
208
+ return type === "string" || type === "number" || type === "boolean";
209
+ }
203
210
 
204
211
  function looseCompareArrays(a, b) {
205
212
  if (a.length !== b.length)
@@ -562,10 +569,7 @@ function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
562
569
  var _a;
563
570
  pauseScheduling();
564
571
  for (const effect2 of dep.keys()) {
565
- if (dep.get(effect2) !== effect2._trackId) {
566
- continue;
567
- }
568
- if (effect2._dirtyLevel < dirtyLevel && !(effect2._runnings && !effect2.allowRecurse)) {
572
+ if (effect2._dirtyLevel < dirtyLevel && dep.get(effect2) === effect2._trackId) {
569
573
  const lastDirtyLevel = effect2._dirtyLevel;
570
574
  effect2._dirtyLevel = dirtyLevel;
571
575
  if (lastDirtyLevel === 0) {
@@ -576,12 +580,17 @@ function triggerEffects(dep, dirtyLevel, debuggerEventExtraInfo) {
576
580
  effect2.trigger();
577
581
  }
578
582
  }
579
- if (effect2.scheduler && effect2._shouldSchedule && (!effect2._runnings || effect2.allowRecurse)) {
583
+ }
584
+ scheduleEffects(dep);
585
+ resetScheduling();
586
+ }
587
+ function scheduleEffects(dep) {
588
+ for (const effect2 of dep.keys()) {
589
+ if (effect2.scheduler && effect2._shouldSchedule && (!effect2._runnings || effect2.allowRecurse) && dep.get(effect2) === effect2._trackId) {
580
590
  effect2._shouldSchedule = false;
581
591
  queueEffectSchedulers.push(effect2.scheduler);
582
592
  }
583
593
  }
584
- resetScheduling();
585
594
  }
586
595
 
587
596
  const createDep = (cleanup, computed) => {
@@ -1264,7 +1273,8 @@ class ComputedRefImpl {
1264
1273
  this["__v_isReadonly"] = false;
1265
1274
  this.effect = new ReactiveEffect(
1266
1275
  () => getter(this._value),
1267
- () => triggerRefValue(this, 1)
1276
+ () => triggerRefValue(this, 1),
1277
+ () => this.dep && scheduleEffects(this.dep)
1268
1278
  );
1269
1279
  this.effect.computed = this;
1270
1280
  this.effect.active = this._cacheable = !isSSR;
@@ -1278,6 +1288,9 @@ class ComputedRefImpl {
1278
1288
  }
1279
1289
  }
1280
1290
  trackRefValue(self);
1291
+ if (self.effect._dirtyLevel >= 1) {
1292
+ triggerRefValue(self, 1);
1293
+ }
1281
1294
  return self._value;
1282
1295
  }
1283
1296
  set value(newValue) {
@@ -6423,7 +6436,7 @@ function createCompatVue$1(createApp, createSingletonApp) {
6423
6436
  return vm;
6424
6437
  }
6425
6438
  }
6426
- Vue.version = `2.6.14-compat:${"3.4.14"}`;
6439
+ Vue.version = `2.6.14-compat:${"3.4.15"}`;
6427
6440
  Vue.config = singletonApp.config;
6428
6441
  Vue.use = (p, ...options) => {
6429
6442
  if (p && isFunction(p.install)) {
@@ -7492,7 +7505,7 @@ const normalizeSlot = (key, rawSlot, ctx) => {
7492
7505
  return rawSlot;
7493
7506
  }
7494
7507
  const normalized = withCtx((...args) => {
7495
- if (currentInstance) {
7508
+ if (currentInstance && (!ctx || ctx.root === currentInstance.root)) {
7496
7509
  warn$1(
7497
7510
  `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.`
7498
7511
  );
@@ -7630,9 +7643,10 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
7630
7643
  } else {
7631
7644
  const _isString = isString(ref);
7632
7645
  const _isRef = isRef(ref);
7646
+ const isVFor = rawRef.f;
7633
7647
  if (_isString || _isRef) {
7634
7648
  const doSet = () => {
7635
- if (rawRef.f) {
7649
+ if (isVFor) {
7636
7650
  const existing = _isString ? hasOwn(setupState, ref) ? setupState[ref] : refs[ref] : ref.value;
7637
7651
  if (isUnmount) {
7638
7652
  isArray(existing) && remove(existing, refValue);
@@ -7665,11 +7679,11 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
7665
7679
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
7666
7680
  }
7667
7681
  };
7668
- if (value) {
7682
+ if (isUnmount || isVFor) {
7683
+ doSet();
7684
+ } else {
7669
7685
  doSet.id = -1;
7670
7686
  queuePostRenderEffect(doSet, parentSuspense);
7671
- } else {
7672
- doSet();
7673
7687
  }
7674
7688
  } else {
7675
7689
  warn$1("Invalid template ref type:", ref, `(${typeof ref})`);
@@ -8179,11 +8193,12 @@ function propHasMismatch(el, key, clientValue, vnode) {
8179
8193
  } else {
8180
8194
  if (el.hasAttribute(key)) {
8181
8195
  actual = el.getAttribute(key);
8196
+ } else if (key === "value" && el.tagName === "TEXTAREA") {
8197
+ actual = el.value;
8182
8198
  } else {
8183
- const serverValue = el[key];
8184
- actual = isObject(serverValue) || serverValue == null ? "" : String(serverValue);
8199
+ actual = false;
8185
8200
  }
8186
- expected = isObject(clientValue) || clientValue == null ? "" : String(clientValue);
8201
+ expected = isRenderableAttrValue(clientValue) ? String(clientValue) : false;
8187
8202
  }
8188
8203
  if (actual !== expected) {
8189
8204
  mismatchType = `attribute`;
@@ -11238,7 +11253,7 @@ function isMemoSame(cached, memo) {
11238
11253
  return true;
11239
11254
  }
11240
11255
 
11241
- const version = "3.4.14";
11256
+ const version = "3.4.15";
11242
11257
  const warn = warn$1 ;
11243
11258
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
11244
11259
  const devtools = devtools$1 ;
@@ -12597,35 +12612,52 @@ const vModelSelect = {
12597
12612
  el[assignKey](
12598
12613
  el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
12599
12614
  );
12615
+ el._assigning = true;
12616
+ nextTick(() => {
12617
+ el._assigning = false;
12618
+ });
12600
12619
  });
12601
12620
  el[assignKey] = getModelAssigner(vnode);
12602
12621
  },
12603
12622
  // set value in mounted & updated because <select> relies on its children
12604
12623
  // <option>s.
12605
- mounted(el, { value }) {
12606
- setSelected(el, value);
12624
+ mounted(el, { value, oldValue, modifiers: { number } }) {
12625
+ setSelected(el, value, oldValue, number);
12607
12626
  },
12608
12627
  beforeUpdate(el, _binding, vnode) {
12609
12628
  el[assignKey] = getModelAssigner(vnode);
12610
12629
  },
12611
- updated(el, { value }) {
12612
- setSelected(el, value);
12630
+ updated(el, { value, oldValue, modifiers: { number } }) {
12631
+ if (!el._assigning) {
12632
+ setSelected(el, value, oldValue, number);
12633
+ }
12613
12634
  }
12614
12635
  };
12615
- function setSelected(el, value) {
12636
+ function setSelected(el, value, oldValue, number) {
12616
12637
  const isMultiple = el.multiple;
12617
- if (isMultiple && !isArray(value) && !isSet(value)) {
12638
+ const isArrayValue = isArray(value);
12639
+ if (isMultiple && !isArrayValue && !isSet(value)) {
12618
12640
  warn(
12619
12641
  `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.`
12620
12642
  );
12621
12643
  return;
12622
12644
  }
12645
+ if (isArrayValue && looseEqual(value, oldValue)) {
12646
+ return;
12647
+ }
12623
12648
  for (let i = 0, l = el.options.length; i < l; i++) {
12624
12649
  const option = el.options[i];
12625
12650
  const optionValue = getValue(option);
12626
12651
  if (isMultiple) {
12627
- if (isArray(value)) {
12628
- option.selected = looseIndexOf(value, optionValue) > -1;
12652
+ if (isArrayValue) {
12653
+ const optionType = typeof optionValue;
12654
+ if (optionType === "string" || optionType === "number") {
12655
+ option.selected = value.includes(
12656
+ number ? looseToNumber(optionValue) : optionValue
12657
+ );
12658
+ } else {
12659
+ option.selected = looseIndexOf(value, optionValue) > -1;
12660
+ }
12629
12661
  } else {
12630
12662
  option.selected = value.has(optionValue);
12631
12663
  }