@vue/runtime-dom 3.5.11 → 3.5.13

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,11 +1,11 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.11
2
+ * @vue/runtime-dom v3.5.13
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
6
- import { warn, h, BaseTransition, assertNumber, BaseTransitionPropsValidators, getCurrentInstance, onBeforeMount, watchPostEffect, onMounted, onUnmounted, Fragment, Static, camelize, callWithAsyncErrorHandling, defineComponent, nextTick, unref, createVNode, useTransitionState, onUpdated, toRaw, getTransitionRawChildren, setTransitionHooks, resolveTransitionHooks, Text, isRuntimeOnly, createRenderer, createHydrationRenderer } from '@vue/runtime-core';
6
+ import { warn, h, BaseTransition, assertNumber, BaseTransitionPropsValidators, getCurrentInstance, onBeforeUpdate, queuePostFlushCb, onMounted, watch, onUnmounted, Fragment, Static, camelize, callWithAsyncErrorHandling, defineComponent, nextTick, unref, createVNode, useTransitionState, onUpdated, toRaw, getTransitionRawChildren, setTransitionHooks, resolveTransitionHooks, Text, isRuntimeOnly, createRenderer, createHydrationRenderer } from '@vue/runtime-core';
7
7
  export * from '@vue/runtime-core';
8
- import { extend, isObject, toNumber, isArray, isString, hyphenate, capitalize, includeBooleanAttr, isSymbol, isSpecialBooleanAttr, isFunction, NOOP, isOn, isModelListener, camelize as camelize$1, isPlainObject, hasOwn, EMPTY_OBJ, looseToNumber, looseIndexOf, isSet, looseEqual, invokeArrayFns, isHTMLTag, isSVGTag, isMathMLTag } from '@vue/shared';
8
+ import { extend, isObject, toNumber, isArray, NOOP, isString, hyphenate, capitalize, includeBooleanAttr, isSymbol, isSpecialBooleanAttr, isFunction, isOn, isModelListener, camelize as camelize$1, isPlainObject, hasOwn, EMPTY_OBJ, looseToNumber, looseIndexOf, isSet, looseEqual, invokeArrayFns, isHTMLTag, isSVGTag, isMathMLTag } from '@vue/shared';
9
9
 
10
10
  let policy = void 0;
11
11
  const tt = typeof window !== "undefined" && window.trustedTypes;
@@ -169,7 +169,8 @@ function resolveTransitionProps(rawProps) {
169
169
  onAppear = onEnter,
170
170
  onAppearCancelled = onEnterCancelled
171
171
  } = baseProps;
172
- const finishEnter = (el, isAppear, done) => {
172
+ const finishEnter = (el, isAppear, done, isCancelled) => {
173
+ el._enterCancelled = isCancelled;
173
174
  removeTransitionClass(el, isAppear ? appearToClass : enterToClass);
174
175
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
175
176
  done && done();
@@ -212,8 +213,13 @@ function resolveTransitionProps(rawProps) {
212
213
  el._isLeaving = true;
213
214
  const resolve = () => finishLeave(el, done);
214
215
  addTransitionClass(el, leaveFromClass);
215
- addTransitionClass(el, leaveActiveClass);
216
- forceReflow();
216
+ if (!el._enterCancelled) {
217
+ forceReflow();
218
+ addTransitionClass(el, leaveActiveClass);
219
+ } else {
220
+ addTransitionClass(el, leaveActiveClass);
221
+ forceReflow();
222
+ }
217
223
  nextFrame(() => {
218
224
  if (!el._isLeaving) {
219
225
  return;
@@ -227,11 +233,11 @@ function resolveTransitionProps(rawProps) {
227
233
  callHook(onLeave, [el, resolve]);
228
234
  },
229
235
  onEnterCancelled(el) {
230
- finishEnter(el, false);
236
+ finishEnter(el, false, void 0, true);
231
237
  callHook(onEnterCancelled, [el]);
232
238
  },
233
239
  onAppearCancelled(el) {
234
- finishEnter(el, true);
240
+ finishEnter(el, true, void 0, true);
235
241
  callHook(onAppearCancelled, [el]);
236
242
  },
237
243
  onLeaveCancelled(el) {
@@ -451,10 +457,11 @@ function useCssVars(getter) {
451
457
  }
452
458
  updateTeleports(vars);
453
459
  };
454
- onBeforeMount(() => {
455
- watchPostEffect(setVars);
460
+ onBeforeUpdate(() => {
461
+ queuePostFlushCb(setVars);
456
462
  });
457
463
  onMounted(() => {
464
+ watch(setVars, NOOP, { flush: "post" });
458
465
  const ob = new MutationObserver(setVars);
459
466
  ob.observe(instance.subTree.el.parentNode, { childList: true });
460
467
  onUnmounted(() => ob.disconnect());
@@ -618,7 +625,7 @@ function patchAttr(el, key, value, isSVG, instance, isBoolean = isSpecialBoolean
618
625
  }
619
626
  }
620
627
 
621
- function patchDOMProp(el, key, value, parentComponent) {
628
+ function patchDOMProp(el, key, value, parentComponent, attrName) {
622
629
  if (key === "innerHTML" || key === "textContent") {
623
630
  if (value != null) {
624
631
  el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value;
@@ -666,7 +673,7 @@ function patchDOMProp(el, key, value, parentComponent) {
666
673
  );
667
674
  }
668
675
  }
669
- needRemove && el.removeAttribute(key);
676
+ needRemove && el.removeAttribute(attrName || key);
670
677
  }
671
678
 
672
679
  function addEventListener(el, event, handler, options) {
@@ -776,7 +783,7 @@ const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) =>
776
783
  // #11081 force set props for possible async custom element
777
784
  el._isVueCE && (/[A-Z]/.test(key) || !isString(nextValue))
778
785
  ) {
779
- patchDOMProp(el, camelize$1(key), nextValue);
786
+ patchDOMProp(el, camelize$1(key), nextValue, parentComponent, key);
780
787
  } else {
781
788
  if (key === "true-value") {
782
789
  el._trueValue = nextValue;
@@ -1061,6 +1068,8 @@ class VueElement extends BaseClass {
1061
1068
  this._update();
1062
1069
  }
1063
1070
  if (shouldReflect) {
1071
+ const ob = this._ob;
1072
+ ob && ob.disconnect();
1064
1073
  if (val === true) {
1065
1074
  this.setAttribute(hyphenate(key), "");
1066
1075
  } else if (typeof val === "string" || typeof val === "number") {
@@ -1068,6 +1077,7 @@ class VueElement extends BaseClass {
1068
1077
  } else if (!val) {
1069
1078
  this.removeAttribute(hyphenate(key));
1070
1079
  }
1080
+ ob && ob.observe(this, { attributes: true });
1071
1081
  }
1072
1082
  }
1073
1083
  }
@@ -1494,7 +1504,7 @@ const vModelCheckbox = {
1494
1504
  setChecked(el, binding, vnode);
1495
1505
  }
1496
1506
  };
1497
- function setChecked(el, { value }, vnode) {
1507
+ function setChecked(el, { value, oldValue }, vnode) {
1498
1508
  el._modelValue = value;
1499
1509
  let checked;
1500
1510
  if (isArray(value)) {
@@ -1502,6 +1512,7 @@ function setChecked(el, { value }, vnode) {
1502
1512
  } else if (isSet(value)) {
1503
1513
  checked = value.has(vnode.props.value);
1504
1514
  } else {
1515
+ if (value === oldValue) return;
1505
1516
  checked = looseEqual(value, getCheckboxValue(el, true));
1506
1517
  }
1507
1518
  if (el.checked !== checked) {