vue 3.5.39 → 3.5.40

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.5.39
2
+ * vue v3.5.40
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -376,8 +376,9 @@ class EffectScope {
376
376
  this._isPaused = true;
377
377
  let i, l;
378
378
  if (this.scopes) {
379
- for (i = 0, l = this.scopes.length; i < l; i++) {
380
- this.scopes[i].pause();
379
+ const scopes = this.scopes.slice();
380
+ for (i = 0, l = scopes.length; i < l; i++) {
381
+ scopes[i].pause();
381
382
  }
382
383
  }
383
384
  for (i = 0, l = this.effects.length; i < l; i++) {
@@ -394,12 +395,14 @@ class EffectScope {
394
395
  this._isPaused = false;
395
396
  let i, l;
396
397
  if (this.scopes) {
397
- for (i = 0, l = this.scopes.length; i < l; i++) {
398
- this.scopes[i].resume();
398
+ const scopes = this.scopes.slice();
399
+ for (i = 0, l = scopes.length; i < l; i++) {
400
+ scopes[i].resume();
399
401
  }
400
402
  }
401
- for (i = 0, l = this.effects.length; i < l; i++) {
402
- this.effects[i].resume();
403
+ const effects = this.effects.slice();
404
+ for (i = 0, l = effects.length; i < l; i++) {
405
+ effects[i].resume();
403
406
  }
404
407
  }
405
408
  }
@@ -461,8 +464,9 @@ class EffectScope {
461
464
  }
462
465
  this.cleanups.length = 0;
463
466
  if (this.scopes) {
464
- for (i = 0, l = this.scopes.length; i < l; i++) {
465
- this.scopes[i].stop(true);
467
+ const scopes = this.scopes.slice();
468
+ for (i = 0, l = scopes.length; i < l; i++) {
469
+ scopes[i].stop(true);
466
470
  }
467
471
  this.scopes.length = 0;
468
472
  }
@@ -2959,10 +2963,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
2959
2963
  setBlockTracking(-1);
2960
2964
  }
2961
2965
  const prevInstance = setCurrentRenderingInstance(ctx);
2966
+ const prevStackSize = blockStack.length;
2962
2967
  let res;
2963
2968
  try {
2964
2969
  res = fn(...args);
2965
2970
  } finally {
2971
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
2966
2972
  setCurrentRenderingInstance(prevInstance);
2967
2973
  if (renderFnWithContext._d) {
2968
2974
  setBlockTracking(1);
@@ -4076,12 +4082,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4076
4082
  }
4077
4083
  }
4078
4084
  if (isFunction(ref)) {
4079
- pauseTracking();
4080
- try {
4081
- callWithErrorHandling(ref, owner, 12, [value, refs]);
4082
- } finally {
4083
- resetTracking();
4084
- }
4085
+ callWithErrorHandling(ref, owner, 12, [value, refs]);
4085
4086
  } else {
4086
4087
  const _isString = isString(ref);
4087
4088
  const _isRef = isRef(ref);
@@ -4452,6 +4453,7 @@ Server rendered element contains more child nodes than client vdom.`
4452
4453
  if (props) {
4453
4454
  {
4454
4455
  const isCustomElement = el.tagName.includes("-");
4456
+ const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
4455
4457
  for (const key in props) {
4456
4458
  if (// #11189 skip if this node has directives that have created hooks
4457
4459
  // as it could have mutated the DOM in any possible way
@@ -4460,7 +4462,7 @@ Server rendered element contains more child nodes than client vdom.`
4460
4462
  }
4461
4463
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
4462
4464
  key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
4463
- patchProp(el, key, null, props[key], void 0, parentComponent);
4465
+ patchProp(el, key, null, props[key], namespace, parentComponent);
4464
4466
  }
4465
4467
  }
4466
4468
  }
@@ -4963,6 +4965,7 @@ function defineAsyncComponent(source) {
4963
4965
  name: "AsyncComponentWrapper",
4964
4966
  __asyncLoader: load,
4965
4967
  __asyncHydrate(el, instance, hydrate) {
4968
+ const wasConnected = el.isConnected;
4966
4969
  let patched = false;
4967
4970
  (instance.bu || (instance.bu = [])).push(() => patched = true);
4968
4971
  const performHydrate = () => {
@@ -4974,6 +4977,7 @@ function defineAsyncComponent(source) {
4974
4977
  }
4975
4978
  return;
4976
4979
  }
4980
+ if (!el.parentNode || wasConnected && !el.isConnected) return;
4977
4981
  hydrate();
4978
4982
  };
4979
4983
  const doHydrate = hydrateStrategy ? () => {
@@ -5532,14 +5536,15 @@ function createSlots(slots, dynamicSlots) {
5532
5536
  return slots;
5533
5537
  }
5534
5538
 
5535
- function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5539
+ function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
5536
5540
  if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
5537
- const hasProps = Object.keys(props).length > 0;
5538
- if (name !== "default") props.name = name;
5541
+ const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
5542
+ const hasProps = Object.keys(slotProps).length > 0;
5543
+ if (name !== "default") slotProps.name = name;
5539
5544
  return openBlock(), createBlock(
5540
5545
  Fragment,
5541
5546
  null,
5542
- [createVNode("slot", props, fallback && fallback())],
5547
+ [createVNode("slot", slotProps, fallback && fallback())],
5543
5548
  hasProps ? -2 : 64
5544
5549
  );
5545
5550
  }
@@ -5553,26 +5558,34 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5553
5558
  if (slot && slot._c) {
5554
5559
  slot._d = false;
5555
5560
  }
5561
+ const prevStackSize = blockStack.length;
5556
5562
  openBlock();
5557
- const validSlotContent = slot && ensureValidVNode(slot(props));
5558
- const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
5559
- // key attached in the `createSlots` helper, respect that
5560
- validSlotContent && validSlotContent.key;
5561
- const rendered = createBlock(
5562
- Fragment,
5563
- {
5564
- key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
5565
- (!validSlotContent && fallback ? "_fb" : "")
5566
- },
5567
- validSlotContent || (fallback ? fallback() : []),
5568
- validSlotContent && slots._ === 1 ? 64 : -2
5569
- );
5563
+ let rendered;
5564
+ try {
5565
+ const validSlotContent = slot && ensureValidVNode(slot(props));
5566
+ const slotKey = props.key || branchKey || // slot content array of a dynamic conditional slot may have a branch
5567
+ // key attached in the `createSlots` helper, respect that
5568
+ validSlotContent && validSlotContent.key;
5569
+ rendered = createBlock(
5570
+ Fragment,
5571
+ {
5572
+ key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
5573
+ (!validSlotContent && fallback ? "_fb" : "")
5574
+ },
5575
+ validSlotContent || (fallback ? fallback() : []),
5576
+ validSlotContent && slots._ === 1 ? 64 : -2
5577
+ );
5578
+ } catch (err) {
5579
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
5580
+ throw err;
5581
+ } finally {
5582
+ if (slot && slot._c) {
5583
+ slot._d = true;
5584
+ }
5585
+ }
5570
5586
  if (!noSlotted && rendered.scopeId) {
5571
5587
  rendered.slotScopeIds = [rendered.scopeId + "-s"];
5572
5588
  }
5573
- if (slot && slot._c) {
5574
- slot._d = true;
5575
- }
5576
5589
  return rendered;
5577
5590
  }
5578
5591
  function ensureValidVNode(vnodes) {
@@ -10892,7 +10905,7 @@ function isMemoSame(cached, memo) {
10892
10905
  return true;
10893
10906
  }
10894
10907
 
10895
- const version = "3.5.39";
10908
+ const version = "3.5.40";
10896
10909
  const warn = warn$1 ;
10897
10910
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10898
10911
  const devtools = devtools$1 ;
@@ -12595,13 +12608,13 @@ const vModelSelect = {
12595
12608
  // <select multiple> value need to be deep traversed
12596
12609
  deep: true,
12597
12610
  created(el, { value, modifiers: { number } }, vnode) {
12598
- const isSetModel = isSet(value);
12611
+ el._modelValue = value;
12599
12612
  addEventListener(el, "change", () => {
12600
12613
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
12601
12614
  (o) => number ? looseToNumber(getValue(o)) : getValue(o)
12602
12615
  );
12603
12616
  el[assignKey](
12604
- el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
12617
+ el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]
12605
12618
  );
12606
12619
  el._assigning = true;
12607
12620
  nextTick(() => {
@@ -12615,7 +12628,8 @@ const vModelSelect = {
12615
12628
  mounted(el, { value }) {
12616
12629
  setSelected(el, value);
12617
12630
  },
12618
- beforeUpdate(el, _binding, vnode) {
12631
+ beforeUpdate(el, { value }, vnode) {
12632
+ el._modelValue = value;
12619
12633
  el[assignKey] = getModelAssigner(vnode);
12620
12634
  },
12621
12635
  updated(el, { value }) {