@vue/runtime-dom 3.5.0 → 3.5.2

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.5.0
2
+ * @vue/runtime-dom v3.5.2
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -94,8 +94,6 @@ const nodeOps = {
94
94
  const TRANSITION = "transition";
95
95
  const ANIMATION = "animation";
96
96
  const vtcKey = Symbol("_vtc");
97
- const Transition = (props, { slots }) => runtimeCore.h(runtimeCore.BaseTransition, resolveTransitionProps(props), slots);
98
- Transition.displayName = "Transition";
99
97
  const DOMTransitionPropsValidators = {
100
98
  name: String,
101
99
  type: String,
@@ -114,11 +112,19 @@ const DOMTransitionPropsValidators = {
114
112
  leaveActiveClass: String,
115
113
  leaveToClass: String
116
114
  };
117
- const TransitionPropsValidators = Transition.props = /* @__PURE__ */ shared.extend(
115
+ const TransitionPropsValidators = /* @__PURE__ */ shared.extend(
118
116
  {},
119
117
  runtimeCore.BaseTransitionPropsValidators,
120
118
  DOMTransitionPropsValidators
121
119
  );
120
+ const decorate$1 = (t) => {
121
+ t.displayName = "Transition";
122
+ t.props = TransitionPropsValidators;
123
+ return t;
124
+ };
125
+ const Transition = /* @__PURE__ */ decorate$1(
126
+ (props, { slots }) => runtimeCore.h(runtimeCore.BaseTransition, resolveTransitionProps(props), slots)
127
+ );
122
128
  const callHook = (hook, args = []) => {
123
129
  if (shared.isArray(hook)) {
124
130
  hook.forEach((h2) => h2(...args));
@@ -1188,7 +1194,11 @@ const positionMap = /* @__PURE__ */ new WeakMap();
1188
1194
  const newPositionMap = /* @__PURE__ */ new WeakMap();
1189
1195
  const moveCbKey = Symbol("_moveCb");
1190
1196
  const enterCbKey = Symbol("_enterCb");
1191
- const TransitionGroupImpl = {
1197
+ const decorate = (t) => {
1198
+ delete t.props.mode;
1199
+ return t;
1200
+ };
1201
+ const TransitionGroupImpl = /* @__PURE__ */ decorate({
1192
1202
  name: "TransitionGroup",
1193
1203
  props: /* @__PURE__ */ shared.extend({}, TransitionPropsValidators, {
1194
1204
  tag: String,
@@ -1274,9 +1284,7 @@ const TransitionGroupImpl = {
1274
1284
  return runtimeCore.createVNode(tag, null, children);
1275
1285
  };
1276
1286
  }
1277
- };
1278
- const removeMode = (props) => delete props.mode;
1279
- /* @__PURE__ */ removeMode(TransitionGroupImpl.props);
1287
+ });
1280
1288
  const TransitionGroup = TransitionGroupImpl;
1281
1289
  function callPendingCbs(c) {
1282
1290
  const el = c.el;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.0
2
+ * @vue/runtime-dom v3.5.2
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -93,8 +93,6 @@ const nodeOps = {
93
93
  const TRANSITION = "transition";
94
94
  const ANIMATION = "animation";
95
95
  const vtcKey = Symbol("_vtc");
96
- const Transition = (props, { slots }) => runtimeCore.h(runtimeCore.BaseTransition, resolveTransitionProps(props), slots);
97
- Transition.displayName = "Transition";
98
96
  const DOMTransitionPropsValidators = {
99
97
  name: String,
100
98
  type: String,
@@ -113,11 +111,19 @@ const DOMTransitionPropsValidators = {
113
111
  leaveActiveClass: String,
114
112
  leaveToClass: String
115
113
  };
116
- const TransitionPropsValidators = Transition.props = /* @__PURE__ */ shared.extend(
114
+ const TransitionPropsValidators = /* @__PURE__ */ shared.extend(
117
115
  {},
118
116
  runtimeCore.BaseTransitionPropsValidators,
119
117
  DOMTransitionPropsValidators
120
118
  );
119
+ const decorate$1 = (t) => {
120
+ t.displayName = "Transition";
121
+ t.props = TransitionPropsValidators;
122
+ return t;
123
+ };
124
+ const Transition = /* @__PURE__ */ decorate$1(
125
+ (props, { slots }) => runtimeCore.h(runtimeCore.BaseTransition, resolveTransitionProps(props), slots)
126
+ );
121
127
  const callHook = (hook, args = []) => {
122
128
  if (shared.isArray(hook)) {
123
129
  hook.forEach((h2) => h2(...args));
@@ -1095,7 +1101,11 @@ const positionMap = /* @__PURE__ */ new WeakMap();
1095
1101
  const newPositionMap = /* @__PURE__ */ new WeakMap();
1096
1102
  const moveCbKey = Symbol("_moveCb");
1097
1103
  const enterCbKey = Symbol("_enterCb");
1098
- const TransitionGroupImpl = {
1104
+ const decorate = (t) => {
1105
+ delete t.props.mode;
1106
+ return t;
1107
+ };
1108
+ const TransitionGroupImpl = /* @__PURE__ */ decorate({
1099
1109
  name: "TransitionGroup",
1100
1110
  props: /* @__PURE__ */ shared.extend({}, TransitionPropsValidators, {
1101
1111
  tag: String,
@@ -1179,9 +1189,7 @@ const TransitionGroupImpl = {
1179
1189
  return runtimeCore.createVNode(tag, null, children);
1180
1190
  };
1181
1191
  }
1182
- };
1183
- const removeMode = (props) => delete props.mode;
1184
- /* @__PURE__ */ removeMode(TransitionGroupImpl.props);
1192
+ });
1185
1193
  const TransitionGroup = TransitionGroupImpl;
1186
1194
  function callPendingCbs(c) {
1187
1195
  const el = c.el;
@@ -23,6 +23,10 @@ export interface TransitionProps extends BaseTransitionProps<Element> {
23
23
  leaveActiveClass?: string;
24
24
  leaveToClass?: string;
25
25
  }
26
+ /**
27
+ * DOM Transition is a higher-order-component based on the platform-agnostic
28
+ * base Transition component, with DOM-specific logic.
29
+ */
26
30
  export declare const Transition: FunctionalComponent<TransitionProps>;
27
31
 
28
32
  export type TransitionGroupProps = Omit<TransitionProps, 'mode'> & {
@@ -490,6 +494,7 @@ export interface DataHTMLAttributes extends HTMLAttributes {
490
494
  value?: string | ReadonlyArray<string> | number;
491
495
  }
492
496
  export interface DetailsHTMLAttributes extends HTMLAttributes {
497
+ name?: string;
493
498
  open?: Booleanish;
494
499
  onToggle?: (payload: ToggleEvent) => void;
495
500
  }
@@ -499,6 +504,7 @@ export interface DelHTMLAttributes extends HTMLAttributes {
499
504
  }
500
505
  export interface DialogHTMLAttributes extends HTMLAttributes {
501
506
  open?: Booleanish;
507
+ onClose?: (payload: Event) => void;
502
508
  }
503
509
  export interface EmbedHTMLAttributes extends HTMLAttributes {
504
510
  height?: Numberish;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/runtime-dom v3.5.0
2
+ * @vue/runtime-dom v3.5.2
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -621,9 +621,6 @@ function isDirty(sub) {
621
621
  return false;
622
622
  }
623
623
  function refreshComputed(computed) {
624
- if (computed.flags & 2) {
625
- return false;
626
- }
627
624
  if (computed.flags & 4 && !(computed.flags & 16)) {
628
625
  return;
629
626
  }
@@ -644,7 +641,7 @@ function refreshComputed(computed) {
644
641
  shouldTrack = true;
645
642
  try {
646
643
  prepareDeps(computed);
647
- const value = computed.fn();
644
+ const value = computed.fn(computed._value);
648
645
  if (dep.version === 0 || hasChanged(value, computed._value)) {
649
646
  computed._value = value;
650
647
  dep.version++;
@@ -753,7 +750,7 @@ class Dep {
753
750
  }
754
751
  }
755
752
  track(debugInfo) {
756
- if (!activeSub || !shouldTrack) {
753
+ if (!activeSub || !shouldTrack || activeSub === this.computed) {
757
754
  return;
758
755
  }
759
756
  let link = this.activeLink;
@@ -975,7 +972,7 @@ const arrayInstrumentations = {
975
972
  },
976
973
  concat(...args) {
977
974
  return reactiveReadArray(this).concat(
978
- ...args.map((x) => reactiveReadArray(x))
975
+ ...args.map((x) => isArray(x) ? reactiveReadArray(x) : x)
979
976
  );
980
977
  },
981
978
  entries() {
@@ -1766,7 +1763,7 @@ function toValue(source) {
1766
1763
  return isFunction(source) ? source() : unref(source);
1767
1764
  }
1768
1765
  const shallowUnwrapHandlers = {
1769
- get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)),
1766
+ get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)),
1770
1767
  set: (target, key, value, receiver) => {
1771
1768
  const oldValue = target[key];
1772
1769
  if (isRef(oldValue) && !isRef(value)) {
@@ -1898,8 +1895,8 @@ class ComputedRefImpl {
1898
1895
  * @internal
1899
1896
  */
1900
1897
  notify() {
1898
+ this.flags |= 16;
1901
1899
  if (activeSub !== this) {
1902
- this.flags |= 16;
1903
1900
  this.dep.notify();
1904
1901
  }
1905
1902
  }
@@ -2468,9 +2465,7 @@ function queueJob(job) {
2468
2465
  } else {
2469
2466
  queue.splice(findInsertionIndex(jobId), 0, job);
2470
2467
  }
2471
- if (!(job.flags & 4)) {
2472
- job.flags |= 1;
2473
- }
2468
+ job.flags |= 1;
2474
2469
  queueFlush();
2475
2470
  }
2476
2471
  }
@@ -2486,9 +2481,7 @@ function queuePostFlushCb(cb) {
2486
2481
  activePostFlushCbs.splice(postFlushIndex + 1, 0, cb);
2487
2482
  } else if (!(cb.flags & 1)) {
2488
2483
  pendingPostFlushCbs.push(cb);
2489
- if (!(cb.flags & 4)) {
2490
- cb.flags |= 1;
2491
- }
2484
+ cb.flags |= 1;
2492
2485
  }
2493
2486
  } else {
2494
2487
  pendingPostFlushCbs.push(...cb);
@@ -2510,6 +2503,9 @@ function flushPreFlushCbs(instance, seen, i = isFlushing ? flushIndex + 1 : 0) {
2510
2503
  }
2511
2504
  queue.splice(i, 1);
2512
2505
  i--;
2506
+ if (cb.flags & 4) {
2507
+ cb.flags &= ~1;
2508
+ }
2513
2509
  cb();
2514
2510
  cb.flags &= ~1;
2515
2511
  }
@@ -2534,6 +2530,9 @@ function flushPostFlushCbs(seen) {
2534
2530
  if (checkRecursiveUpdates(seen, cb)) {
2535
2531
  continue;
2536
2532
  }
2533
+ if (cb.flags & 4) {
2534
+ cb.flags &= ~1;
2535
+ }
2537
2536
  if (!(cb.flags & 8)) cb();
2538
2537
  cb.flags &= ~1;
2539
2538
  }
@@ -2556,6 +2555,9 @@ function flushJobs(seen) {
2556
2555
  if (check(job)) {
2557
2556
  continue;
2558
2557
  }
2558
+ if (job.flags & 4) {
2559
+ job.flags &= ~1;
2560
+ }
2559
2561
  callWithErrorHandling(
2560
2562
  job,
2561
2563
  job.i,
@@ -2565,6 +2567,12 @@ function flushJobs(seen) {
2565
2567
  }
2566
2568
  }
2567
2569
  } finally {
2570
+ for (; flushIndex < queue.length; flushIndex++) {
2571
+ const job = queue[flushIndex];
2572
+ if (job) {
2573
+ job.flags &= ~1;
2574
+ }
2575
+ }
2568
2576
  flushIndex = 0;
2569
2577
  queue.length = 0;
2570
2578
  flushPostFlushCbs(seen);
@@ -3301,7 +3309,9 @@ const BaseTransitionImpl = {
3301
3309
  // #11061, ensure enterHooks is fresh after clone
3302
3310
  (hooks) => enterHooks = hooks
3303
3311
  );
3304
- setTransitionHooks(innerChild, enterHooks);
3312
+ if (innerChild.type !== Comment) {
3313
+ setTransitionHooks(innerChild, enterHooks);
3314
+ }
3305
3315
  const oldChild = instance.subTree;
3306
3316
  const oldInnerChild = oldChild && getInnerChild$1(oldChild);
3307
3317
  if (oldInnerChild && oldInnerChild.type !== Comment && !isSameVNodeType(innerChild, oldInnerChild) && recursiveGetSubtree(instance).type !== Comment) {
@@ -3319,6 +3329,7 @@ const BaseTransitionImpl = {
3319
3329
  if (!(instance.job.flags & 8)) {
3320
3330
  instance.update();
3321
3331
  }
3332
+ delete leavingHooks.afterLeave;
3322
3333
  };
3323
3334
  return emptyPlaceholder(child);
3324
3335
  } else if (mode === "in-out" && innerChild.type !== Comment) {
@@ -3596,6 +3607,34 @@ function markAsyncBoundary(instance) {
3596
3607
  instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0];
3597
3608
  }
3598
3609
 
3610
+ const knownTemplateRefs = /* @__PURE__ */ new WeakSet();
3611
+ function useTemplateRef(key) {
3612
+ const i = getCurrentInstance();
3613
+ const r = shallowRef(null);
3614
+ if (i) {
3615
+ const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
3616
+ let desc;
3617
+ if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
3618
+ warn$1(`useTemplateRef('${key}') already exists.`);
3619
+ } else {
3620
+ Object.defineProperty(refs, key, {
3621
+ enumerable: true,
3622
+ get: () => r.value,
3623
+ set: (val) => r.value = val
3624
+ });
3625
+ }
3626
+ } else {
3627
+ warn$1(
3628
+ `useTemplateRef() is called when there is no active component instance to be associated with.`
3629
+ );
3630
+ }
3631
+ const ret = readonly(r) ;
3632
+ {
3633
+ knownTemplateRefs.add(ret);
3634
+ }
3635
+ return ret;
3636
+ }
3637
+
3599
3638
  function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3600
3639
  if (isArray(rawRef)) {
3601
3640
  rawRef.forEach(
@@ -3624,10 +3663,17 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3624
3663
  const oldRef = oldRawRef && oldRawRef.r;
3625
3664
  const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs;
3626
3665
  const setupState = owner.setupState;
3666
+ const rawSetupState = toRaw(setupState);
3667
+ const canSetSetupRef = setupState === EMPTY_OBJ ? () => false : (key) => {
3668
+ if (knownTemplateRefs.has(rawSetupState[key])) {
3669
+ return false;
3670
+ }
3671
+ return hasOwn(rawSetupState, key);
3672
+ };
3627
3673
  if (oldRef != null && oldRef !== ref) {
3628
3674
  if (isString(oldRef)) {
3629
3675
  refs[oldRef] = null;
3630
- if (hasOwn(setupState, oldRef)) {
3676
+ if (canSetSetupRef(oldRef)) {
3631
3677
  setupState[oldRef] = null;
3632
3678
  }
3633
3679
  } else if (isRef(oldRef)) {
@@ -3642,14 +3688,14 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3642
3688
  if (_isString || _isRef) {
3643
3689
  const doSet = () => {
3644
3690
  if (rawRef.f) {
3645
- const existing = _isString ? hasOwn(setupState, ref) ? setupState[ref] : refs[ref] : ref.value;
3691
+ const existing = _isString ? canSetSetupRef(ref) ? setupState[ref] : refs[ref] : ref.value;
3646
3692
  if (isUnmount) {
3647
3693
  isArray(existing) && remove(existing, refValue);
3648
3694
  } else {
3649
3695
  if (!isArray(existing)) {
3650
3696
  if (_isString) {
3651
3697
  refs[ref] = [refValue];
3652
- if (hasOwn(setupState, ref)) {
3698
+ if (canSetSetupRef(ref)) {
3653
3699
  setupState[ref] = refs[ref];
3654
3700
  }
3655
3701
  } else {
@@ -3662,7 +3708,7 @@ function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) {
3662
3708
  }
3663
3709
  } else if (_isString) {
3664
3710
  refs[ref] = value;
3665
- if (hasOwn(setupState, ref)) {
3711
+ if (canSetSetupRef(ref)) {
3666
3712
  setupState[ref] = value;
3667
3713
  }
3668
3714
  } else if (_isRef) {
@@ -4680,7 +4726,7 @@ const KeepAliveImpl = {
4680
4726
  return () => {
4681
4727
  pendingCacheKey = null;
4682
4728
  if (!slots.default) {
4683
- return null;
4729
+ return current = null;
4684
4730
  }
4685
4731
  const children = slots.default();
4686
4732
  const rawVNode = children[0];
@@ -8437,7 +8483,8 @@ function renderComponentRoot(instance) {
8437
8483
  data,
8438
8484
  setupState,
8439
8485
  ctx,
8440
- inheritAttrs
8486
+ inheritAttrs,
8487
+ isMounted
8441
8488
  } = instance;
8442
8489
  const prev = setCurrentRenderingInstance(instance);
8443
8490
  let result;
@@ -8557,7 +8604,7 @@ function renderComponentRoot(instance) {
8557
8604
  `Component inside <Transition> renders non-element root node that cannot be animated.`
8558
8605
  );
8559
8606
  }
8560
- root.transition = vnode.transition;
8607
+ root.transition = isMounted ? vnode.component.subTree.transition : vnode.transition;
8561
8608
  }
8562
8609
  if (setRoot) {
8563
8610
  setRoot(root);
@@ -9051,7 +9098,7 @@ function createSuspenseBoundary(vnode, parentSuspense, parentComponent, containe
9051
9098
  };
9052
9099
  }
9053
9100
  if (activeBranch) {
9054
- if (parentNode(activeBranch.el) !== suspense.hiddenContainer) {
9101
+ if (parentNode(activeBranch.el) === container2) {
9055
9102
  anchor = next(activeBranch);
9056
9103
  }
9057
9104
  unmount(activeBranch, parentComponent2, suspense, true);
@@ -10112,29 +10159,6 @@ const computed = (getterOrOptions, debugOptions) => {
10112
10159
  return c;
10113
10160
  };
10114
10161
 
10115
- function useTemplateRef(key) {
10116
- const i = getCurrentInstance();
10117
- const r = shallowRef(null);
10118
- if (i) {
10119
- const refs = i.refs === EMPTY_OBJ ? i.refs = {} : i.refs;
10120
- let desc;
10121
- if ((desc = Object.getOwnPropertyDescriptor(refs, key)) && !desc.configurable) {
10122
- warn$1(`useTemplateRef('${key}') already exists.`);
10123
- } else {
10124
- Object.defineProperty(refs, key, {
10125
- enumerable: true,
10126
- get: () => r.value,
10127
- set: (val) => r.value = val
10128
- });
10129
- }
10130
- } else {
10131
- warn$1(
10132
- `useTemplateRef() is called when there is no active component instance to be associated with.`
10133
- );
10134
- }
10135
- return readonly(r) ;
10136
- }
10137
-
10138
10162
  function h(type, propsOrChildren, children) {
10139
10163
  const l = arguments.length;
10140
10164
  if (l === 2) {
@@ -10360,7 +10384,7 @@ function isMemoSame(cached, memo) {
10360
10384
  return true;
10361
10385
  }
10362
10386
 
10363
- const version = "3.5.0";
10387
+ const version = "3.5.2";
10364
10388
  const warn = warn$1 ;
10365
10389
  const ErrorTypeStrings = ErrorTypeStrings$1 ;
10366
10390
  const devtools = devtools$1 ;
@@ -10464,8 +10488,6 @@ const nodeOps = {
10464
10488
  const TRANSITION = "transition";
10465
10489
  const ANIMATION = "animation";
10466
10490
  const vtcKey = Symbol("_vtc");
10467
- const Transition = (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots);
10468
- Transition.displayName = "Transition";
10469
10491
  const DOMTransitionPropsValidators = {
10470
10492
  name: String,
10471
10493
  type: String,
@@ -10484,11 +10506,19 @@ const DOMTransitionPropsValidators = {
10484
10506
  leaveActiveClass: String,
10485
10507
  leaveToClass: String
10486
10508
  };
10487
- const TransitionPropsValidators = Transition.props = /* @__PURE__ */ extend(
10509
+ const TransitionPropsValidators = /* @__PURE__ */ extend(
10488
10510
  {},
10489
10511
  BaseTransitionPropsValidators,
10490
10512
  DOMTransitionPropsValidators
10491
10513
  );
10514
+ const decorate$1 = (t) => {
10515
+ t.displayName = "Transition";
10516
+ t.props = TransitionPropsValidators;
10517
+ return t;
10518
+ };
10519
+ const Transition = /* @__PURE__ */ decorate$1(
10520
+ (props, { slots }) => h(BaseTransition, resolveTransitionProps(props), slots)
10521
+ );
10492
10522
  const callHook = (hook, args = []) => {
10493
10523
  if (isArray(hook)) {
10494
10524
  hook.forEach((h2) => h2(...args));
@@ -11624,7 +11654,11 @@ const positionMap = /* @__PURE__ */ new WeakMap();
11624
11654
  const newPositionMap = /* @__PURE__ */ new WeakMap();
11625
11655
  const moveCbKey = Symbol("_moveCb");
11626
11656
  const enterCbKey = Symbol("_enterCb");
11627
- const TransitionGroupImpl = {
11657
+ const decorate = (t) => {
11658
+ delete t.props.mode;
11659
+ return t;
11660
+ };
11661
+ const TransitionGroupImpl = /* @__PURE__ */ decorate({
11628
11662
  name: "TransitionGroup",
11629
11663
  props: /* @__PURE__ */ extend({}, TransitionPropsValidators, {
11630
11664
  tag: String,
@@ -11710,9 +11744,7 @@ const TransitionGroupImpl = {
11710
11744
  return createVNode(tag, null, children);
11711
11745
  };
11712
11746
  }
11713
- };
11714
- const removeMode = (props) => delete props.mode;
11715
- /* @__PURE__ */ removeMode(TransitionGroupImpl.props);
11747
+ });
11716
11748
  const TransitionGroup = TransitionGroupImpl;
11717
11749
  function callPendingCbs(c) {
11718
11750
  const el = c.el;