@vue/compat 3.2.34-beta.1 → 3.2.36

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.
@@ -4563,7 +4563,10 @@ const KeepAliveImpl = {
4563
4563
  // if the internal renderer is not registered, it indicates that this is server-side rendering,
4564
4564
  // for KeepAlive, we just need to render its children
4565
4565
  if (!sharedContext.renderer) {
4566
- return slots.default;
4566
+ return () => {
4567
+ const children = slots.default && slots.default();
4568
+ return children && children.length === 1 ? children[0] : children;
4569
+ };
4567
4570
  }
4568
4571
  const cache = new Map();
4569
4572
  const keys = new Set();
@@ -7176,7 +7179,7 @@ function createCompatVue(createApp, createSingletonApp) {
7176
7179
  return vm;
7177
7180
  }
7178
7181
  }
7179
- Vue.version = `2.6.14-compat:${"3.2.34-beta.1"}`;
7182
+ Vue.version = `2.6.14-compat:${"3.2.36"}`;
7180
7183
  Vue.config = singletonApp.config;
7181
7184
  Vue.use = (p, ...options) => {
7182
7185
  if (p && isFunction(p.install)) {
@@ -7343,9 +7346,11 @@ function installLegacyAPIs(app) {
7343
7346
  });
7344
7347
  }
7345
7348
  function applySingletonAppMutations(app) {
7346
- ['mixins', 'components', 'directives', 'filters', 'deopt'].forEach(key => {
7349
+ // copy over asset registries and deopt flag
7350
+ app._context.mixins = [...singletonApp._context.mixins];
7351
+ ['components', 'directives', 'filters'].forEach(key => {
7347
7352
  // @ts-ignore
7348
- app._context[key] = singletonApp._context[key];
7353
+ app._context[key] = Object.create(singletonApp._context[key]);
7349
7354
  });
7350
7355
  // copy over global config mutations
7351
7356
  isCopyingConfig = true;
@@ -7358,7 +7363,7 @@ function applySingletonAppMutations(app) {
7358
7363
  }
7359
7364
  const val = singletonApp.config[key];
7360
7365
  // @ts-ignore
7361
- app.config[key] = val;
7366
+ app.config[key] = isObject(val) ? Object.create(val) : val;
7362
7367
  // compat for runtime ignoredElements -> isCustomElement
7363
7368
  if (key === 'ignoredElements' &&
7364
7369
  isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */, null) &&
@@ -7867,7 +7872,7 @@ const isComment = (node) => node.nodeType === 8 /* COMMENT */;
7867
7872
  // Hydration also depends on some renderer internal logic which needs to be
7868
7873
  // passed in via arguments.
7869
7874
  function createHydrationFunctions(rendererInternals) {
7870
- const { mt: mountComponent, p: patch, o: { patchProp, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
7875
+ const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
7871
7876
  const hydrate = (vnode, container) => {
7872
7877
  if (!container.hasChildNodes()) {
7873
7878
  (process.env.NODE_ENV !== 'production') &&
@@ -7899,7 +7904,15 @@ function createHydrationFunctions(rendererInternals) {
7899
7904
  switch (type) {
7900
7905
  case Text:
7901
7906
  if (domType !== 3 /* TEXT */) {
7902
- nextNode = onMismatch();
7907
+ // #5728 empty text node inside a slot can cause hydration failure
7908
+ // because the server rendered HTML won't contain a text node
7909
+ if (vnode.children === '') {
7910
+ insert((vnode.el = createText('')), parentNode(node), node);
7911
+ nextNode = node;
7912
+ }
7913
+ else {
7914
+ nextNode = onMismatch();
7915
+ }
7903
7916
  }
7904
7917
  else {
7905
7918
  if (node.data !== vnode.children) {
@@ -7974,6 +7987,12 @@ function createHydrationFunctions(rendererInternals) {
7974
7987
  nextNode = isFragmentStart
7975
7988
  ? locateClosingAsyncAnchor(node)
7976
7989
  : nextSibling(node);
7990
+ // #4293 teleport as component root
7991
+ if (nextNode &&
7992
+ isComment(nextNode) &&
7993
+ nextNode.data === 'teleport end') {
7994
+ nextNode = nextSibling(nextNode);
7995
+ }
7977
7996
  // #3787
7978
7997
  // if component is async, it may get moved / unmounted before its
7979
7998
  // inner component is loaded, so we need to give it a placeholder
@@ -8681,8 +8700,10 @@ function baseCreateRenderer(options, createHydrationFns) {
8681
8700
  const fragmentStartAnchor = (n2.el = n1 ? n1.el : hostCreateText(''));
8682
8701
  const fragmentEndAnchor = (n2.anchor = n1 ? n1.anchor : hostCreateText(''));
8683
8702
  let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
8684
- if ((process.env.NODE_ENV !== 'production') && isHmrUpdating) {
8685
- // HMR updated, force full diff
8703
+ if ((process.env.NODE_ENV !== 'production') &&
8704
+ // #5523 dev root fragment may inherit directives
8705
+ (isHmrUpdating || patchFlag & 2048 /* DEV_ROOT_FRAGMENT */)) {
8706
+ // HMR updated / Dev root fragment (w/ comments), force full diff
8686
8707
  patchFlag = 0;
8687
8708
  optimized = false;
8688
8709
  dynamicChildren = null;
@@ -8704,8 +8725,6 @@ function baseCreateRenderer(options, createHydrationFns) {
8704
8725
  else {
8705
8726
  if (patchFlag > 0 &&
8706
8727
  patchFlag & 64 /* STABLE_FRAGMENT */ &&
8707
- // #5523 dev root fragment may inherit directives so always force update
8708
- !((process.env.NODE_ENV !== 'production') && patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) &&
8709
8728
  dynamicChildren &&
8710
8729
  // #2715 the previous fragment could've been a BAILed one as a result
8711
8730
  // of renderSlot() with no valid children
@@ -9821,10 +9840,23 @@ function hydrateTeleport(node, vnode, parentComponent, parentSuspense, slotScope
9821
9840
  }
9822
9841
  else {
9823
9842
  vnode.anchor = nextSibling(node);
9824
- vnode.targetAnchor = hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
9843
+ // lookahead until we find the target anchor
9844
+ // we cannot rely on return value of hydrateChildren() because there
9845
+ // could be nested teleports
9846
+ let targetAnchor = targetNode;
9847
+ while (targetAnchor) {
9848
+ targetAnchor = nextSibling(targetAnchor);
9849
+ if (targetAnchor &&
9850
+ targetAnchor.nodeType === 8 &&
9851
+ targetAnchor.data === 'teleport anchor') {
9852
+ vnode.targetAnchor = targetAnchor;
9853
+ target._lpa =
9854
+ vnode.targetAnchor && nextSibling(vnode.targetAnchor);
9855
+ break;
9856
+ }
9857
+ }
9858
+ hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
9825
9859
  }
9826
- target._lpa =
9827
- vnode.targetAnchor && nextSibling(vnode.targetAnchor);
9828
9860
  }
9829
9861
  }
9830
9862
  return vnode.anchor && nextSibling(vnode.anchor);
@@ -11220,7 +11252,7 @@ function isMemoSame(cached, memo) {
11220
11252
  }
11221
11253
 
11222
11254
  // Core API ------------------------------------------------------------------
11223
- const version = "3.2.34-beta.1";
11255
+ const version = "3.2.36";
11224
11256
  const _ssrUtils = {
11225
11257
  createComponentInstance,
11226
11258
  setupComponent,
@@ -11585,7 +11617,7 @@ const [_getNow, skipTimestampCheck] = /*#__PURE__*/ (() => {
11585
11617
  // if the low-res timestamp which is bigger than the event timestamp
11586
11618
  // (which is evaluated AFTER) it means the event is using a hi-res timestamp,
11587
11619
  // and we need to use the hi-res version for event listeners as well.
11588
- _getNow = () => performance.now();
11620
+ _getNow = performance.now.bind(performance);
11589
11621
  }
11590
11622
  // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
11591
11623
  // and does not fire microtasks in between event propagation, so safe to exclude.
@@ -12137,9 +12169,8 @@ function resolveTransitionProps(rawProps) {
12137
12169
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
12138
12170
  done && done();
12139
12171
  };
12140
- let isLeaving = false;
12141
12172
  const finishLeave = (el, done) => {
12142
- isLeaving = false;
12173
+ el._isLeaving = false;
12143
12174
  removeTransitionClass(el, leaveFromClass);
12144
12175
  removeTransitionClass(el, leaveToClass);
12145
12176
  removeTransitionClass(el, leaveActiveClass);
@@ -12182,7 +12213,7 @@ function resolveTransitionProps(rawProps) {
12182
12213
  onEnter: makeEnterHook(false),
12183
12214
  onAppear: makeEnterHook(true),
12184
12215
  onLeave(el, done) {
12185
- isLeaving = true;
12216
+ el._isLeaving = true;
12186
12217
  const resolve = () => finishLeave(el, done);
12187
12218
  addTransitionClass(el, leaveFromClass);
12188
12219
  if (legacyClassEnabled) {
@@ -12192,7 +12223,7 @@ function resolveTransitionProps(rawProps) {
12192
12223
  forceReflow();
12193
12224
  addTransitionClass(el, leaveActiveClass);
12194
12225
  nextFrame(() => {
12195
- if (!isLeaving) {
12226
+ if (!el._isLeaving) {
12196
12227
  // cancelled
12197
12228
  return;
12198
12229
  }
@@ -12725,27 +12756,25 @@ const vModelDynamic = {
12725
12756
  callModelHook(el, binding, vnode, prevVNode, 'updated');
12726
12757
  }
12727
12758
  };
12728
- function callModelHook(el, binding, vnode, prevVNode, hook) {
12729
- let modelToUse;
12730
- switch (el.tagName) {
12759
+ function resolveDynamicModel(tagName, type) {
12760
+ switch (tagName) {
12731
12761
  case 'SELECT':
12732
- modelToUse = vModelSelect;
12733
- break;
12762
+ return vModelSelect;
12734
12763
  case 'TEXTAREA':
12735
- modelToUse = vModelText;
12736
- break;
12764
+ return vModelText;
12737
12765
  default:
12738
- switch (vnode.props && vnode.props.type) {
12766
+ switch (type) {
12739
12767
  case 'checkbox':
12740
- modelToUse = vModelCheckbox;
12741
- break;
12768
+ return vModelCheckbox;
12742
12769
  case 'radio':
12743
- modelToUse = vModelRadio;
12744
- break;
12770
+ return vModelRadio;
12745
12771
  default:
12746
- modelToUse = vModelText;
12772
+ return vModelText;
12747
12773
  }
12748
12774
  }
12775
+ }
12776
+ function callModelHook(el, binding, vnode, prevVNode, hook) {
12777
+ const modelToUse = resolveDynamicModel(el.tagName, vnode.props && vnode.props.type);
12749
12778
  const fn = modelToUse[hook];
12750
12779
  fn && fn(el, binding, vnode, prevVNode);
12751
12780
  }
@@ -12773,6 +12802,17 @@ function initVModelForSSR() {
12773
12802
  return { checked: true };
12774
12803
  }
12775
12804
  };
12805
+ vModelDynamic.getSSRProps = (binding, vnode) => {
12806
+ if (typeof vnode.type !== 'string') {
12807
+ return;
12808
+ }
12809
+ const modelToUse = resolveDynamicModel(
12810
+ // resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase
12811
+ vnode.type.toUpperCase(), vnode.props && vnode.props.type);
12812
+ if (modelToUse.getSSRProps) {
12813
+ return modelToUse.getSSRProps(binding, vnode);
12814
+ }
12815
+ };
12776
12816
  }
12777
12817
 
12778
12818
  const systemModifiers = ['ctrl', 'shift', 'alt', 'meta'];
@@ -14929,6 +14969,14 @@ function getConstantType(node, context) {
14929
14969
  // static then they don't need to be blocks since there will be no
14930
14970
  // nested updates.
14931
14971
  if (codegenNode.isBlock) {
14972
+ // except set custom directives.
14973
+ for (let i = 0; i < node.props.length; i++) {
14974
+ const p = node.props[i];
14975
+ if (p.type === 7 /* DIRECTIVE */) {
14976
+ constantCache.set(node, 0 /* NOT_CONSTANT */);
14977
+ return 0 /* NOT_CONSTANT */;
14978
+ }
14979
+ }
14932
14980
  context.removeHelper(OPEN_BLOCK);
14933
14981
  context.removeHelper(getVNodeBlockHelper(context.inSSR, codegenNode.isComponent));
14934
14982
  codegenNode.isBlock = false;
@@ -16691,7 +16739,7 @@ const transformElement = (node, context) => {
16691
16739
  (tag === 'svg' || tag === 'foreignObject'));
16692
16740
  // props
16693
16741
  if (props.length > 0) {
16694
- const propsBuildResult = buildProps(node, context);
16742
+ const propsBuildResult = buildProps(node, context, undefined, isComponent, isDynamicComponent);
16695
16743
  vnodeProps = propsBuildResult.props;
16696
16744
  patchFlag = propsBuildResult.patchFlag;
16697
16745
  dynamicPropNames = propsBuildResult.dynamicPropNames;
@@ -16833,9 +16881,8 @@ function resolveComponentType(node, context, ssr = false) {
16833
16881
  context.components.add(tag);
16834
16882
  return toValidAssetId(tag, `component`);
16835
16883
  }
16836
- function buildProps(node, context, props = node.props, ssr = false) {
16884
+ function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) {
16837
16885
  const { tag, loc: elementLoc, children } = node;
16838
- const isComponent = node.tagType === 1 /* COMPONENT */;
16839
16886
  let properties = [];
16840
16887
  const mergeArgs = [];
16841
16888
  const runtimeDirectives = [];
@@ -16854,8 +16901,8 @@ function buildProps(node, context, props = node.props, ssr = false) {
16854
16901
  if (isStaticExp(key)) {
16855
16902
  const name = key.content;
16856
16903
  const isEventHandler = isOn(name);
16857
- if (!isComponent &&
16858
- isEventHandler &&
16904
+ if (isEventHandler &&
16905
+ (!isComponent || isDynamicComponent) &&
16859
16906
  // omit the flag for click handlers because hydration gives click
16860
16907
  // dedicated fast path.
16861
16908
  name.toLowerCase() !== 'onclick' &&
@@ -17293,7 +17340,7 @@ function processSlotOutlet(node, context) {
17293
17340
  }
17294
17341
  }
17295
17342
  if (nonNameProps.length > 0) {
17296
- const { props, directives } = buildProps(node, context, nonNameProps);
17343
+ const { props, directives } = buildProps(node, context, nonNameProps, false, false);
17297
17344
  slotProps = props;
17298
17345
  if (directives.length) {
17299
17346
  context.onError(createCompilerError(36 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */, directives[0].loc));
@@ -4513,11 +4513,6 @@ var Vue = (function () {
4513
4513
  // The whole point of this is to avoid importing KeepAlive directly in the
4514
4514
  // renderer to facilitate tree-shaking.
4515
4515
  const sharedContext = instance.ctx;
4516
- // if the internal renderer is not registered, it indicates that this is server-side rendering,
4517
- // for KeepAlive, we just need to render its children
4518
- if (!sharedContext.renderer) {
4519
- return slots.default;
4520
- }
4521
4516
  const cache = new Map();
4522
4517
  const keys = new Set();
4523
4518
  let current = null;
@@ -7116,7 +7111,7 @@ var Vue = (function () {
7116
7111
  return vm;
7117
7112
  }
7118
7113
  }
7119
- Vue.version = `2.6.14-compat:${"3.2.34-beta.1"}`;
7114
+ Vue.version = `2.6.14-compat:${"3.2.36"}`;
7120
7115
  Vue.config = singletonApp.config;
7121
7116
  Vue.use = (p, ...options) => {
7122
7117
  if (p && isFunction(p.install)) {
@@ -7282,9 +7277,11 @@ var Vue = (function () {
7282
7277
  });
7283
7278
  }
7284
7279
  function applySingletonAppMutations(app) {
7285
- ['mixins', 'components', 'directives', 'filters', 'deopt'].forEach(key => {
7280
+ // copy over asset registries and deopt flag
7281
+ app._context.mixins = [...singletonApp._context.mixins];
7282
+ ['components', 'directives', 'filters'].forEach(key => {
7286
7283
  // @ts-ignore
7287
- app._context[key] = singletonApp._context[key];
7284
+ app._context[key] = Object.create(singletonApp._context[key]);
7288
7285
  });
7289
7286
  // copy over global config mutations
7290
7287
  isCopyingConfig = true;
@@ -7297,7 +7294,7 @@ var Vue = (function () {
7297
7294
  }
7298
7295
  const val = singletonApp.config[key];
7299
7296
  // @ts-ignore
7300
- app.config[key] = val;
7297
+ app.config[key] = isObject(val) ? Object.create(val) : val;
7301
7298
  // compat for runtime ignoredElements -> isCustomElement
7302
7299
  if (key === 'ignoredElements' &&
7303
7300
  isCompatEnabled("CONFIG_IGNORED_ELEMENTS" /* CONFIG_IGNORED_ELEMENTS */, null) &&
@@ -7802,7 +7799,7 @@ var Vue = (function () {
7802
7799
  // Hydration also depends on some renderer internal logic which needs to be
7803
7800
  // passed in via arguments.
7804
7801
  function createHydrationFunctions(rendererInternals) {
7805
- const { mt: mountComponent, p: patch, o: { patchProp, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
7802
+ const { mt: mountComponent, p: patch, o: { patchProp, createText, nextSibling, parentNode, remove, insert, createComment } } = rendererInternals;
7806
7803
  const hydrate = (vnode, container) => {
7807
7804
  if (!container.hasChildNodes()) {
7808
7805
  warn$1(`Attempting to hydrate existing markup but container is empty. ` +
@@ -7833,7 +7830,15 @@ var Vue = (function () {
7833
7830
  switch (type) {
7834
7831
  case Text:
7835
7832
  if (domType !== 3 /* TEXT */) {
7836
- nextNode = onMismatch();
7833
+ // #5728 empty text node inside a slot can cause hydration failure
7834
+ // because the server rendered HTML won't contain a text node
7835
+ if (vnode.children === '') {
7836
+ insert((vnode.el = createText('')), parentNode(node), node);
7837
+ nextNode = node;
7838
+ }
7839
+ else {
7840
+ nextNode = onMismatch();
7841
+ }
7837
7842
  }
7838
7843
  else {
7839
7844
  if (node.data !== vnode.children) {
@@ -7907,6 +7912,12 @@ var Vue = (function () {
7907
7912
  nextNode = isFragmentStart
7908
7913
  ? locateClosingAsyncAnchor(node)
7909
7914
  : nextSibling(node);
7915
+ // #4293 teleport as component root
7916
+ if (nextNode &&
7917
+ isComment(nextNode) &&
7918
+ nextNode.data === 'teleport end') {
7919
+ nextNode = nextSibling(nextNode);
7920
+ }
7910
7921
  // #3787
7911
7922
  // if component is async, it may get moved / unmounted before its
7912
7923
  // inner component is loaded, so we need to give it a placeholder
@@ -8570,8 +8581,9 @@ var Vue = (function () {
8570
8581
  const fragmentStartAnchor = (n2.el = n1 ? n1.el : hostCreateText(''));
8571
8582
  const fragmentEndAnchor = (n2.anchor = n1 ? n1.anchor : hostCreateText(''));
8572
8583
  let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2;
8573
- if (isHmrUpdating) {
8574
- // HMR updated, force full diff
8584
+ if (// #5523 dev root fragment may inherit directives
8585
+ (isHmrUpdating || patchFlag & 2048 /* DEV_ROOT_FRAGMENT */)) {
8586
+ // HMR updated / Dev root fragment (w/ comments), force full diff
8575
8587
  patchFlag = 0;
8576
8588
  optimized = false;
8577
8589
  dynamicChildren = null;
@@ -8593,8 +8605,6 @@ var Vue = (function () {
8593
8605
  else {
8594
8606
  if (patchFlag > 0 &&
8595
8607
  patchFlag & 64 /* STABLE_FRAGMENT */ &&
8596
- // #5523 dev root fragment may inherit directives so always force update
8597
- !(patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) &&
8598
8608
  dynamicChildren &&
8599
8609
  // #2715 the previous fragment could've been a BAILed one as a result
8600
8610
  // of renderSlot() with no valid children
@@ -9705,10 +9715,23 @@ var Vue = (function () {
9705
9715
  }
9706
9716
  else {
9707
9717
  vnode.anchor = nextSibling(node);
9708
- vnode.targetAnchor = hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
9718
+ // lookahead until we find the target anchor
9719
+ // we cannot rely on return value of hydrateChildren() because there
9720
+ // could be nested teleports
9721
+ let targetAnchor = targetNode;
9722
+ while (targetAnchor) {
9723
+ targetAnchor = nextSibling(targetAnchor);
9724
+ if (targetAnchor &&
9725
+ targetAnchor.nodeType === 8 &&
9726
+ targetAnchor.data === 'teleport anchor') {
9727
+ vnode.targetAnchor = targetAnchor;
9728
+ target._lpa =
9729
+ vnode.targetAnchor && nextSibling(vnode.targetAnchor);
9730
+ break;
9731
+ }
9732
+ }
9733
+ hydrateChildren(targetNode, vnode, target, parentComponent, parentSuspense, slotScopeIds, optimized);
9709
9734
  }
9710
- target._lpa =
9711
- vnode.targetAnchor && nextSibling(vnode.targetAnchor);
9712
9735
  }
9713
9736
  }
9714
9737
  return vnode.anchor && nextSibling(vnode.anchor);
@@ -11074,7 +11097,7 @@ var Vue = (function () {
11074
11097
  }
11075
11098
 
11076
11099
  // Core API ------------------------------------------------------------------
11077
- const version = "3.2.34-beta.1";
11100
+ const version = "3.2.36";
11078
11101
  /**
11079
11102
  * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
11080
11103
  * @internal
@@ -11430,7 +11453,7 @@ var Vue = (function () {
11430
11453
  // if the low-res timestamp which is bigger than the event timestamp
11431
11454
  // (which is evaluated AFTER) it means the event is using a hi-res timestamp,
11432
11455
  // and we need to use the hi-res version for event listeners as well.
11433
- _getNow = () => performance.now();
11456
+ _getNow = performance.now.bind(performance);
11434
11457
  }
11435
11458
  // #3485: Firefox <= 53 has incorrect Event.timeStamp implementation
11436
11459
  // and does not fire microtasks in between event propagation, so safe to exclude.
@@ -11968,9 +11991,8 @@ var Vue = (function () {
11968
11991
  removeTransitionClass(el, isAppear ? appearActiveClass : enterActiveClass);
11969
11992
  done && done();
11970
11993
  };
11971
- let isLeaving = false;
11972
11994
  const finishLeave = (el, done) => {
11973
- isLeaving = false;
11995
+ el._isLeaving = false;
11974
11996
  removeTransitionClass(el, leaveFromClass);
11975
11997
  removeTransitionClass(el, leaveToClass);
11976
11998
  removeTransitionClass(el, leaveActiveClass);
@@ -12013,7 +12035,7 @@ var Vue = (function () {
12013
12035
  onEnter: makeEnterHook(false),
12014
12036
  onAppear: makeEnterHook(true),
12015
12037
  onLeave(el, done) {
12016
- isLeaving = true;
12038
+ el._isLeaving = true;
12017
12039
  const resolve = () => finishLeave(el, done);
12018
12040
  addTransitionClass(el, leaveFromClass);
12019
12041
  if (legacyClassEnabled) {
@@ -12023,7 +12045,7 @@ var Vue = (function () {
12023
12045
  forceReflow();
12024
12046
  addTransitionClass(el, leaveActiveClass);
12025
12047
  nextFrame(() => {
12026
- if (!isLeaving) {
12048
+ if (!el._isLeaving) {
12027
12049
  // cancelled
12028
12050
  return;
12029
12051
  }
@@ -12554,27 +12576,25 @@ var Vue = (function () {
12554
12576
  callModelHook(el, binding, vnode, prevVNode, 'updated');
12555
12577
  }
12556
12578
  };
12557
- function callModelHook(el, binding, vnode, prevVNode, hook) {
12558
- let modelToUse;
12559
- switch (el.tagName) {
12579
+ function resolveDynamicModel(tagName, type) {
12580
+ switch (tagName) {
12560
12581
  case 'SELECT':
12561
- modelToUse = vModelSelect;
12562
- break;
12582
+ return vModelSelect;
12563
12583
  case 'TEXTAREA':
12564
- modelToUse = vModelText;
12565
- break;
12584
+ return vModelText;
12566
12585
  default:
12567
- switch (vnode.props && vnode.props.type) {
12586
+ switch (type) {
12568
12587
  case 'checkbox':
12569
- modelToUse = vModelCheckbox;
12570
- break;
12588
+ return vModelCheckbox;
12571
12589
  case 'radio':
12572
- modelToUse = vModelRadio;
12573
- break;
12590
+ return vModelRadio;
12574
12591
  default:
12575
- modelToUse = vModelText;
12592
+ return vModelText;
12576
12593
  }
12577
12594
  }
12595
+ }
12596
+ function callModelHook(el, binding, vnode, prevVNode, hook) {
12597
+ const modelToUse = resolveDynamicModel(el.tagName, vnode.props && vnode.props.type);
12578
12598
  const fn = modelToUse[hook];
12579
12599
  fn && fn(el, binding, vnode, prevVNode);
12580
12600
  }
@@ -14716,6 +14736,14 @@ var Vue = (function () {
14716
14736
  // static then they don't need to be blocks since there will be no
14717
14737
  // nested updates.
14718
14738
  if (codegenNode.isBlock) {
14739
+ // except set custom directives.
14740
+ for (let i = 0; i < node.props.length; i++) {
14741
+ const p = node.props[i];
14742
+ if (p.type === 7 /* DIRECTIVE */) {
14743
+ constantCache.set(node, 0 /* NOT_CONSTANT */);
14744
+ return 0 /* NOT_CONSTANT */;
14745
+ }
14746
+ }
14719
14747
  context.removeHelper(OPEN_BLOCK);
14720
14748
  context.removeHelper(getVNodeBlockHelper(context.inSSR, codegenNode.isComponent));
14721
14749
  codegenNode.isBlock = false;
@@ -16471,7 +16499,7 @@ var Vue = (function () {
16471
16499
  (tag === 'svg' || tag === 'foreignObject'));
16472
16500
  // props
16473
16501
  if (props.length > 0) {
16474
- const propsBuildResult = buildProps(node, context);
16502
+ const propsBuildResult = buildProps(node, context, undefined, isComponent, isDynamicComponent);
16475
16503
  vnodeProps = propsBuildResult.props;
16476
16504
  patchFlag = propsBuildResult.patchFlag;
16477
16505
  dynamicPropNames = propsBuildResult.dynamicPropNames;
@@ -16610,9 +16638,8 @@ var Vue = (function () {
16610
16638
  context.components.add(tag);
16611
16639
  return toValidAssetId(tag, `component`);
16612
16640
  }
16613
- function buildProps(node, context, props = node.props, ssr = false) {
16641
+ function buildProps(node, context, props = node.props, isComponent, isDynamicComponent, ssr = false) {
16614
16642
  const { tag, loc: elementLoc, children } = node;
16615
- const isComponent = node.tagType === 1 /* COMPONENT */;
16616
16643
  let properties = [];
16617
16644
  const mergeArgs = [];
16618
16645
  const runtimeDirectives = [];
@@ -16631,8 +16658,8 @@ var Vue = (function () {
16631
16658
  if (isStaticExp(key)) {
16632
16659
  const name = key.content;
16633
16660
  const isEventHandler = isOn(name);
16634
- if (!isComponent &&
16635
- isEventHandler &&
16661
+ if (isEventHandler &&
16662
+ (!isComponent || isDynamicComponent) &&
16636
16663
  // omit the flag for click handlers because hydration gives click
16637
16664
  // dedicated fast path.
16638
16665
  name.toLowerCase() !== 'onclick' &&
@@ -17070,7 +17097,7 @@ var Vue = (function () {
17070
17097
  }
17071
17098
  }
17072
17099
  if (nonNameProps.length > 0) {
17073
- const { props, directives } = buildProps(node, context, nonNameProps);
17100
+ const { props, directives } = buildProps(node, context, nonNameProps, false, false);
17074
17101
  slotProps = props;
17075
17102
  if (directives.length) {
17076
17103
  context.onError(createCompilerError(36 /* X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET */, directives[0].loc));