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.
package/dist/vue.cjs.js CHANGED
@@ -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
  **/
@@ -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
  **/
@@ -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
  **/
@@ -449,8 +449,9 @@ class EffectScope {
449
449
  this._isPaused = true;
450
450
  let i, l;
451
451
  if (this.scopes) {
452
- for (i = 0, l = this.scopes.length; i < l; i++) {
453
- this.scopes[i].pause();
452
+ const scopes = this.scopes.slice();
453
+ for (i = 0, l = scopes.length; i < l; i++) {
454
+ scopes[i].pause();
454
455
  }
455
456
  }
456
457
  for (i = 0, l = this.effects.length; i < l; i++) {
@@ -467,12 +468,14 @@ class EffectScope {
467
468
  this._isPaused = false;
468
469
  let i, l;
469
470
  if (this.scopes) {
470
- for (i = 0, l = this.scopes.length; i < l; i++) {
471
- this.scopes[i].resume();
471
+ const scopes = this.scopes.slice();
472
+ for (i = 0, l = scopes.length; i < l; i++) {
473
+ scopes[i].resume();
472
474
  }
473
475
  }
474
- for (i = 0, l = this.effects.length; i < l; i++) {
475
- this.effects[i].resume();
476
+ const effects = this.effects.slice();
477
+ for (i = 0, l = effects.length; i < l; i++) {
478
+ effects[i].resume();
476
479
  }
477
480
  }
478
481
  }
@@ -534,8 +537,9 @@ class EffectScope {
534
537
  }
535
538
  this.cleanups.length = 0;
536
539
  if (this.scopes) {
537
- for (i = 0, l = this.scopes.length; i < l; i++) {
538
- this.scopes[i].stop(true);
540
+ const scopes = this.scopes.slice();
541
+ for (i = 0, l = scopes.length; i < l; i++) {
542
+ scopes[i].stop(true);
539
543
  }
540
544
  this.scopes.length = 0;
541
545
  }
@@ -3032,10 +3036,12 @@ function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) {
3032
3036
  setBlockTracking(-1);
3033
3037
  }
3034
3038
  const prevInstance = setCurrentRenderingInstance(ctx);
3039
+ const prevStackSize = blockStack.length;
3035
3040
  let res;
3036
3041
  try {
3037
3042
  res = fn(...args);
3038
3043
  } finally {
3044
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
3039
3045
  setCurrentRenderingInstance(prevInstance);
3040
3046
  if (renderFnWithContext._d) {
3041
3047
  setBlockTracking(1);
@@ -4149,12 +4155,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
4149
4155
  }
4150
4156
  }
4151
4157
  if (isFunction(ref)) {
4152
- pauseTracking();
4153
- try {
4154
- callWithErrorHandling(ref, owner, 12, [value, refs]);
4155
- } finally {
4156
- resetTracking();
4157
- }
4158
+ callWithErrorHandling(ref, owner, 12, [value, refs]);
4158
4159
  } else {
4159
4160
  const _isString = isString(ref);
4160
4161
  const _isRef = isRef(ref);
@@ -4525,6 +4526,7 @@ Server rendered element contains more child nodes than client vdom.`
4525
4526
  if (props) {
4526
4527
  {
4527
4528
  const isCustomElement = el.tagName.includes("-");
4529
+ const namespace = el.namespaceURI.includes("svg") ? "svg" : el.namespaceURI.includes("MathML") ? "mathml" : void 0;
4528
4530
  for (const key in props) {
4529
4531
  if (// #11189 skip if this node has directives that have created hooks
4530
4532
  // as it could have mutated the DOM in any possible way
@@ -4533,7 +4535,7 @@ Server rendered element contains more child nodes than client vdom.`
4533
4535
  }
4534
4536
  if (forcePatch && (key.endsWith("value") || key === "indeterminate") || isOn(key) && !isReservedProp(key) || // force hydrate v-bind with .prop modifiers
4535
4537
  key[0] === "." || isCustomElement && !isReservedProp(key) || dynamicProps && dynamicProps.includes(key)) {
4536
- patchProp(el, key, null, props[key], void 0, parentComponent);
4538
+ patchProp(el, key, null, props[key], namespace, parentComponent);
4537
4539
  }
4538
4540
  }
4539
4541
  }
@@ -5036,6 +5038,7 @@ function defineAsyncComponent(source) {
5036
5038
  name: "AsyncComponentWrapper",
5037
5039
  __asyncLoader: load,
5038
5040
  __asyncHydrate(el, instance, hydrate) {
5041
+ const wasConnected = el.isConnected;
5039
5042
  let patched = false;
5040
5043
  (instance.bu || (instance.bu = [])).push(() => patched = true);
5041
5044
  const performHydrate = () => {
@@ -5047,6 +5050,7 @@ function defineAsyncComponent(source) {
5047
5050
  }
5048
5051
  return;
5049
5052
  }
5053
+ if (!el.parentNode || wasConnected && !el.isConnected) return;
5050
5054
  hydrate();
5051
5055
  };
5052
5056
  const doHydrate = hydrateStrategy ? () => {
@@ -5605,14 +5609,15 @@ function createSlots(slots, dynamicSlots) {
5605
5609
  return slots;
5606
5610
  }
5607
5611
 
5608
- function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5612
+ function renderSlot(slots, name, props = {}, fallback, noSlotted, branchKey) {
5609
5613
  if (currentRenderingInstance.ce || currentRenderingInstance.parent && isAsyncWrapper(currentRenderingInstance.parent) && currentRenderingInstance.parent.ce) {
5610
- const hasProps = Object.keys(props).length > 0;
5611
- if (name !== "default") props.name = name;
5614
+ const slotProps = branchKey != null && props.key == null ? extend({}, props, { key: branchKey }) : props;
5615
+ const hasProps = Object.keys(slotProps).length > 0;
5616
+ if (name !== "default") slotProps.name = name;
5612
5617
  return openBlock(), createBlock(
5613
5618
  Fragment,
5614
5619
  null,
5615
- [createVNode("slot", props, fallback && fallback())],
5620
+ [createVNode("slot", slotProps, fallback && fallback())],
5616
5621
  hasProps ? -2 : 64
5617
5622
  );
5618
5623
  }
@@ -5626,26 +5631,34 @@ function renderSlot(slots, name, props = {}, fallback, noSlotted) {
5626
5631
  if (slot && slot._c) {
5627
5632
  slot._d = false;
5628
5633
  }
5634
+ const prevStackSize = blockStack.length;
5629
5635
  openBlock();
5630
- const validSlotContent = slot && ensureValidVNode(slot(props));
5631
- const slotKey = props.key || // slot content array of a dynamic conditional slot may have a branch
5632
- // key attached in the `createSlots` helper, respect that
5633
- validSlotContent && validSlotContent.key;
5634
- const rendered = createBlock(
5635
- Fragment,
5636
- {
5637
- key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
5638
- (!validSlotContent && fallback ? "_fb" : "")
5639
- },
5640
- validSlotContent || (fallback ? fallback() : []),
5641
- validSlotContent && slots._ === 1 ? 64 : -2
5642
- );
5636
+ let rendered;
5637
+ try {
5638
+ const validSlotContent = slot && ensureValidVNode(slot(props));
5639
+ const slotKey = props.key || branchKey || // slot content array of a dynamic conditional slot may have a branch
5640
+ // key attached in the `createSlots` helper, respect that
5641
+ validSlotContent && validSlotContent.key;
5642
+ rendered = createBlock(
5643
+ Fragment,
5644
+ {
5645
+ key: (slotKey && !isSymbol(slotKey) ? slotKey : `_${name}`) + // #7256 force differentiate fallback content from actual content
5646
+ (!validSlotContent && fallback ? "_fb" : "")
5647
+ },
5648
+ validSlotContent || (fallback ? fallback() : []),
5649
+ validSlotContent && slots._ === 1 ? 64 : -2
5650
+ );
5651
+ } catch (err) {
5652
+ for (let i = blockStack.length; i > prevStackSize; i--) closeBlock();
5653
+ throw err;
5654
+ } finally {
5655
+ if (slot && slot._c) {
5656
+ slot._d = true;
5657
+ }
5658
+ }
5643
5659
  if (!noSlotted && rendered.scopeId) {
5644
5660
  rendered.slotScopeIds = [rendered.scopeId + "-s"];
5645
5661
  }
5646
- if (slot && slot._c) {
5647
- slot._d = true;
5648
- }
5649
5662
  return rendered;
5650
5663
  }
5651
5664
  function ensureValidVNode(vnodes) {
@@ -10965,7 +10978,7 @@ function isMemoSame(cached, memo) {
10965
10978
  return true;
10966
10979
  }
10967
10980
 
10968
- const version = "3.5.39";
10981
+ const version = "3.5.40";
10969
10982
  const warn = warn$1 ;
10970
10983
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10971
10984
  const devtools = devtools$1 ;
@@ -12668,13 +12681,13 @@ const vModelSelect = {
12668
12681
  // <select multiple> value need to be deep traversed
12669
12682
  deep: true,
12670
12683
  created(el, { value, modifiers: { number } }, vnode) {
12671
- const isSetModel = isSet(value);
12684
+ el._modelValue = value;
12672
12685
  addEventListener(el, "change", () => {
12673
12686
  const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map(
12674
12687
  (o) => number ? looseToNumber(getValue(o)) : getValue(o)
12675
12688
  );
12676
12689
  el[assignKey](
12677
- el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0]
12690
+ el.multiple ? isSet(el._modelValue) ? new Set(selectedVal) : selectedVal : selectedVal[0]
12678
12691
  );
12679
12692
  el._assigning = true;
12680
12693
  nextTick(() => {
@@ -12688,7 +12701,8 @@ const vModelSelect = {
12688
12701
  mounted(el, { value }) {
12689
12702
  setSelected(el, value);
12690
12703
  },
12691
- beforeUpdate(el, _binding, vnode) {
12704
+ beforeUpdate(el, { value }, vnode) {
12705
+ el._modelValue = value;
12692
12706
  el[assignKey] = getModelAssigner(vnode);
12693
12707
  },
12694
12708
  updated(el, { value }) {
@@ -14492,6 +14506,9 @@ function getUnnormalizedProps(props, callPath = []) {
14492
14506
  return [props, callPath];
14493
14507
  }
14494
14508
  function injectProp(node, prop, context) {
14509
+ if (node.type !== 13 && injectSlotKey(node, prop)) {
14510
+ return;
14511
+ }
14495
14512
  let propsWithInjection;
14496
14513
  let props = node.type === 13 ? node.props : node.arguments[2];
14497
14514
  let callPath = [];
@@ -14549,6 +14566,24 @@ function injectProp(node, prop, context) {
14549
14566
  }
14550
14567
  }
14551
14568
  }
14569
+ function injectSlotKey(node, prop) {
14570
+ var _a, _b, _c;
14571
+ if (prop.key.type !== 4 || prop.key.content !== "key") {
14572
+ return false;
14573
+ }
14574
+ const props = node.arguments[2];
14575
+ if (props && !isString(props)) {
14576
+ const [unnormalizedProps] = getUnnormalizedProps(props);
14577
+ if (unnormalizedProps && !isString(unnormalizedProps) && unnormalizedProps.type === 15 && hasProp(prop, unnormalizedProps)) {
14578
+ return true;
14579
+ }
14580
+ }
14581
+ (_a = node.arguments)[2] || (_a[2] = "{}");
14582
+ (_b = node.arguments)[3] || (_b[3] = "undefined");
14583
+ (_c = node.arguments)[4] || (_c[4] = "undefined");
14584
+ node.arguments[5] = prop.value;
14585
+ return true;
14586
+ }
14552
14587
  function hasProp(prop, props) {
14553
14588
  let result = false;
14554
14589
  if (prop.key.type === 4) {