@vue/runtime-dom 3.6.0-beta.14 → 3.6.0-beta.16

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/runtime-dom v3.6.0-beta.14
2
+ * @vue/runtime-dom v3.6.0-beta.16
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -570,7 +570,7 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
570
570
  const existingInvoker = invokers[rawName];
571
571
  if (nextValue && existingInvoker) existingInvoker.value = !!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue;
572
572
  else {
573
- const [name, options] = parseName(rawName);
573
+ const [name, options] = parseEventName(rawName);
574
574
  if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(!!(process.env.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue, instance), options);
575
575
  else if (existingInvoker) {
576
576
  removeEventListener(el, name, existingInvoker, options);
@@ -579,7 +579,7 @@ function patchEvent(el, rawName, prevValue, nextValue, instance = null) {
579
579
  }
580
580
  }
581
581
  const optionsModifierRE = /(?:Once|Passive|Capture)$/;
582
- function parseName(name) {
582
+ function parseEventName(name) {
583
583
  let options;
584
584
  if (optionsModifierRE.test(name)) {
585
585
  options = {};
@@ -1143,7 +1143,7 @@ const TransitionGroup = /* @__PURE__ */ decorate({
1143
1143
  prevChildren = [];
1144
1144
  if (children) for (let i = 0; i < children.length; i++) {
1145
1145
  const child = children[i];
1146
- if (child.el && child.el instanceof Element) {
1146
+ if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
1147
1147
  prevChildren.push(child);
1148
1148
  setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
1149
1149
  positionMap.set(child, getPosition(child.el));
@@ -1644,4 +1644,4 @@ const initDirectivesForSSR = () => {
1644
1644
  }
1645
1645
  };
1646
1646
  //#endregion
1647
- export { Transition, TransitionGroup, TransitionPropsValidators, VueElement, VueElementBase, baseApplyTranslation, baseUseCssVars, callPendingCbs, createApp, createSSRApp, defineCustomElement, defineSSRCustomElement, ensureHydrationRenderer, ensureRenderer, forceReflow, handleMovedChildren, hasCSSTransform, hydrate, initDirectivesForSSR, nodeOps, normalizeContainer, patchProp, patchStyle, render, resolveTransitionProps, setVarsOnNode, shouldSetAsProp, shouldSetAsPropForVueCE, svgNS, unsafeToTrustedHTML, useCssModule, useCssVars, useHost, useShadowRoot, vModelCheckbox, vModelCheckboxInit, vModelCheckboxUpdate, vModelDynamic, getValue as vModelGetValue, vModelRadio, vModelSelect, vModelSelectInit, vModelSetSelected, vModelText, vModelTextInit, vModelTextUpdate, vShow, vShowHidden, vShowOriginalDisplay, withKeys, withModifiers, xlinkNS };
1647
+ export { Transition, TransitionGroup, TransitionPropsValidators, VueElement, VueElementBase, baseApplyTranslation, baseUseCssVars, callPendingCbs, createApp, createSSRApp, defineCustomElement, defineSSRCustomElement, ensureHydrationRenderer, ensureRenderer, forceReflow, handleMovedChildren, hasCSSTransform, hydrate, initDirectivesForSSR, nodeOps, normalizeContainer, parseEventName, patchProp, patchStyle, render, resolveTransitionProps, setVarsOnNode, shouldSetAsProp, shouldSetAsPropForVueCE, svgNS, unsafeToTrustedHTML, useCssModule, useCssVars, useHost, useShadowRoot, vModelCheckbox, vModelCheckboxInit, vModelCheckboxUpdate, vModelDynamic, getValue as vModelGetValue, vModelRadio, vModelSelect, vModelSelectInit, vModelSetSelected, vModelText, vModelTextInit, vModelTextUpdate, vShow, vShowHidden, vShowOriginalDisplay, withKeys, withModifiers, xlinkNS };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.6.0-beta.14
2
+ * @vue/runtime-dom v3.6.0-beta.16
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -2158,8 +2158,9 @@ var VueRuntimeDOM = (function(exports) {
2158
2158
  if (once && cb) {
2159
2159
  const _cb = cb;
2160
2160
  cb = (...args) => {
2161
- _cb(...args);
2161
+ const res = _cb(...args);
2162
2162
  this.stop();
2163
+ return res;
2163
2164
  };
2164
2165
  }
2165
2166
  this.cb = cb;
@@ -2173,7 +2174,7 @@ var VueRuntimeDOM = (function(exports) {
2173
2174
  if (!this.cb) return;
2174
2175
  const { immediate, deep, call } = this.options;
2175
2176
  if (initialRun && !immediate) return;
2176
- if (deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2177
+ if (initialRun || deep || this.forceTrigger || (this.isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) {
2177
2178
  cleanup(this);
2178
2179
  const currentWatcher = activeWatcher;
2179
2180
  activeWatcher = this;
@@ -4225,11 +4226,16 @@ var VueRuntimeDOM = (function(exports) {
4225
4226
  onError(err);
4226
4227
  return () => errorComponent ? createVNode(errorComponent, { error: err }) : null;
4227
4228
  });
4228
- const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError);
4229
+ const { loaded, error, delayed } = useAsyncComponentState(delay, timeout, onError, instance);
4229
4230
  load().then(() => {
4231
+ if (instance.isUnmounted) return;
4230
4232
  loaded.value = true;
4231
4233
  if (instance.parent && instance.parent.vnode && isKeepAlive(instance.parent.vnode)) instance.parent.update();
4232
4234
  }).catch((err) => {
4235
+ if (instance.isUnmounted) {
4236
+ setPendingRequest(null);
4237
+ return;
4238
+ }
4233
4239
  onError(err);
4234
4240
  error.value = err;
4235
4241
  });
@@ -4287,14 +4293,22 @@ var VueRuntimeDOM = (function(exports) {
4287
4293
  setPendingRequest: (request) => pendingRequest = request
4288
4294
  };
4289
4295
  }
4290
- const useAsyncComponentState = (delay, timeout, onError) => {
4296
+ const useAsyncComponentState = (delay, timeout, onError, instance = currentInstance) => {
4291
4297
  const loaded = /* @__PURE__ */ ref(false);
4292
4298
  const error = /* @__PURE__ */ ref();
4293
4299
  const delayed = /* @__PURE__ */ ref(!!delay);
4294
- if (delay) setTimeout(() => {
4300
+ let timeoutTimer;
4301
+ let delayTimer;
4302
+ if (instance) onUnmounted(() => {
4303
+ if (timeoutTimer != null) clearTimeout(timeoutTimer);
4304
+ if (delayTimer != null) clearTimeout(delayTimer);
4305
+ }, instance);
4306
+ if (delay) delayTimer = setTimeout(() => {
4307
+ if (instance && instance.isUnmounted) return;
4295
4308
  delayed.value = false;
4296
4309
  }, delay);
4297
- if (timeout != null) setTimeout(() => {
4310
+ if (timeout != null) timeoutTimer = setTimeout(() => {
4311
+ if (instance && instance.isUnmounted) return;
4298
4312
  if (!loaded.value && !error.value) {
4299
4313
  const err = /* @__PURE__ */ new Error(`Async component timed out after ${timeout}ms.`);
4300
4314
  onError(err);
@@ -5551,12 +5565,13 @@ var VueRuntimeDOM = (function(exports) {
5551
5565
  for (const key of rawPropKeys) if (key === name || key === camelizedName || key === hyphenatedName) parentPassedModelValue = true;
5552
5566
  else if (key === `onUpdate:${name}` || key === `onUpdate:${camelizedName}` || key === `onUpdate:${hyphenatedName}`) parentPassedModelUpdater = true;
5553
5567
  }
5554
- if (!parentPassedModelValue || !parentPassedModelUpdater) {
5568
+ const hasVModel = parentPassedModelValue && parentPassedModelUpdater;
5569
+ if (!hasVModel) {
5555
5570
  localValue = value;
5556
5571
  trigger();
5557
5572
  }
5558
5573
  i.emit(`update:${name}`, emittedValue);
5559
- if (hasChanged(value, emittedValue) && hasChanged(value, prevSetValue) && !hasChanged(emittedValue, prevEmittedValue)) trigger();
5574
+ if (hasChanged(value, prevSetValue) && (hasChanged(value, emittedValue) && !hasChanged(emittedValue, prevEmittedValue) || hasVModel && prevSetValue !== EMPTY_OBJ && !hasChanged(emittedValue, localValue))) trigger();
5560
5575
  prevSetValue = value;
5561
5576
  prevEmittedValue = emittedValue;
5562
5577
  }
@@ -8402,7 +8417,7 @@ var VueRuntimeDOM = (function(exports) {
8402
8417
  }
8403
8418
  //#endregion
8404
8419
  //#region packages/runtime-core/src/index.ts
8405
- const version = "3.6.0-beta.14";
8420
+ const version = "3.6.0-beta.16";
8406
8421
  const warn = warn$1;
8407
8422
  /**
8408
8423
  * Runtime error messages. Only exposed in dev or esm builds.
@@ -8982,7 +8997,7 @@ var VueRuntimeDOM = (function(exports) {
8982
8997
  const existingInvoker = invokers[rawName];
8983
8998
  if (nextValue && existingInvoker) existingInvoker.value = sanitizeEventValue(nextValue, rawName);
8984
8999
  else {
8985
- const [name, options] = parseName(rawName);
9000
+ const [name, options] = parseEventName(rawName);
8986
9001
  if (nextValue) addEventListener(el, name, invokers[rawName] = createInvoker(sanitizeEventValue(nextValue, rawName), instance), options);
8987
9002
  else if (existingInvoker) {
8988
9003
  removeEventListener(el, name, existingInvoker, options);
@@ -8991,7 +9006,7 @@ var VueRuntimeDOM = (function(exports) {
8991
9006
  }
8992
9007
  }
8993
9008
  const optionsModifierRE = /(?:Once|Passive|Capture)$/;
8994
- function parseName(name) {
9009
+ function parseEventName(name) {
8995
9010
  let options;
8996
9011
  if (optionsModifierRE.test(name)) {
8997
9012
  options = {};
@@ -9537,7 +9552,7 @@ var VueRuntimeDOM = (function(exports) {
9537
9552
  prevChildren = [];
9538
9553
  if (children) for (let i = 0; i < children.length; i++) {
9539
9554
  const child = children[i];
9540
- if (child.el && child.el instanceof Element) {
9555
+ if (child.el && child.el instanceof Element && !child.el[vShowHidden]) {
9541
9556
  prevChildren.push(child);
9542
9557
  setTransitionHooks(child, resolveTransitionHooks(child, cssTransitionProps, state, instance));
9543
9558
  positionMap.set(child, getPosition(child.el));