@vue/compat 3.2.41 → 3.2.42

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.
@@ -25,109 +25,6 @@ const GLOBALS_WHITE_LISTED = 'Infinity,undefined,NaN,isFinite,isNaN,parseFloat,p
25
25
  'Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt';
26
26
  const isGloballyWhitelisted = /*#__PURE__*/ makeMap(GLOBALS_WHITE_LISTED);
27
27
 
28
- /**
29
- * On the client we only need to offer special cases for boolean attributes that
30
- * have different names from their corresponding dom properties:
31
- * - itemscope -> N/A
32
- * - allowfullscreen -> allowFullscreen
33
- * - formnovalidate -> formNoValidate
34
- * - ismap -> isMap
35
- * - nomodule -> noModule
36
- * - novalidate -> noValidate
37
- * - readonly -> readOnly
38
- */
39
- const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
40
- const isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);
41
- /**
42
- * The full list is needed during SSR to produce the correct initial markup.
43
- */
44
- const isBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs +
45
- `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,` +
46
- `loop,open,required,reversed,scoped,seamless,` +
47
- `checked,muted,multiple,selected`);
48
- /**
49
- * Boolean attributes should be included if the value is truthy or ''.
50
- * e.g. `<select multiple>` compiles to `{ multiple: '' }`
51
- */
52
- function includeBooleanAttr(value) {
53
- return !!value || value === '';
54
- }
55
- /**
56
- * CSS properties that accept plain numbers
57
- */
58
- const isNoUnitNumericStyleProp = /*#__PURE__*/ makeMap(`animation-iteration-count,border-image-outset,border-image-slice,` +
59
- `border-image-width,box-flex,box-flex-group,box-ordinal-group,column-count,` +
60
- `columns,flex,flex-grow,flex-positive,flex-shrink,flex-negative,flex-order,` +
61
- `grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,` +
62
- `grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,` +
63
- `line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,` +
64
- // SVG
65
- `fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,` +
66
- `stroke-miterlimit,stroke-opacity,stroke-width`);
67
- /**
68
- * Known attributes, this is used for stringification of runtime static nodes
69
- * so that we don't stringify bindings that cannot be set from HTML.
70
- * Don't also forget to allow `data-*` and `aria-*`!
71
- * Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
72
- */
73
- const isKnownHtmlAttr = /*#__PURE__*/ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,` +
74
- `autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,` +
75
- `border,buffered,capture,challenge,charset,checked,cite,class,code,` +
76
- `codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,` +
77
- `coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,` +
78
- `disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,` +
79
- `formaction,formenctype,formmethod,formnovalidate,formtarget,headers,` +
80
- `height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,` +
81
- `ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,` +
82
- `manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,` +
83
- `open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,` +
84
- `referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,` +
85
- `selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,` +
86
- `start,step,style,summary,tabindex,target,title,translate,type,usemap,` +
87
- `value,width,wrap`);
88
- /**
89
- * Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
90
- */
91
- const isKnownSvgAttr = /*#__PURE__*/ makeMap(`xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,` +
92
- `arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,` +
93
- `baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,` +
94
- `clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,` +
95
- `color-interpolation-filters,color-profile,color-rendering,` +
96
- `contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,` +
97
- `descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,` +
98
- `dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,` +
99
- `fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,` +
100
- `font-family,font-size,font-size-adjust,font-stretch,font-style,` +
101
- `font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,` +
102
- `glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,` +
103
- `gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,` +
104
- `horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,` +
105
- `k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,` +
106
- `lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,` +
107
- `marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,` +
108
- `mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,` +
109
- `name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,` +
110
- `overflow,overline-position,overline-thickness,panose-1,paint-order,path,` +
111
- `pathLength,patternContentUnits,patternTransform,patternUnits,ping,` +
112
- `pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,` +
113
- `preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,` +
114
- `rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,` +
115
- `restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,` +
116
- `specularConstant,specularExponent,speed,spreadMethod,startOffset,` +
117
- `stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,` +
118
- `strikethrough-position,strikethrough-thickness,string,stroke,` +
119
- `stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,` +
120
- `stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,` +
121
- `systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,` +
122
- `text-decoration,text-rendering,textLength,to,transform,transform-origin,` +
123
- `type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,` +
124
- `unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,` +
125
- `v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,` +
126
- `vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,` +
127
- `writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,` +
128
- `xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,` +
129
- `xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`);
130
-
131
28
  function normalizeStyle(value) {
132
29
  if (isArray(value)) {
133
30
  const res = {};
@@ -152,10 +49,14 @@ function normalizeStyle(value) {
152
49
  }
153
50
  }
154
51
  const listDelimiterRE = /;(?![^(]*\))/g;
155
- const propertyDelimiterRE = /:(.+)/;
52
+ const propertyDelimiterRE = /:([^]+)/;
53
+ const styleCommentRE = /\/\*.*?\*\//gs;
156
54
  function parseStringStyle(cssText) {
157
55
  const ret = {};
158
- cssText.split(listDelimiterRE).forEach(item => {
56
+ cssText
57
+ .replace(styleCommentRE, '')
58
+ .split(listDelimiterRE)
59
+ .forEach(item => {
159
60
  if (item) {
160
61
  const tmp = item.split(propertyDelimiterRE);
161
62
  tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim());
@@ -171,8 +72,7 @@ function stringifyStyle(styles) {
171
72
  for (const key in styles) {
172
73
  const value = styles[key];
173
74
  const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key);
174
- if (isString(value) ||
175
- (typeof value === 'number' && isNoUnitNumericStyleProp(normalizedKey))) {
75
+ if (isString(value) || typeof value === 'number') {
176
76
  // only render valid values
177
77
  ret += `${normalizedKey}:${value};`;
178
78
  }
@@ -253,6 +153,97 @@ const isSVGTag = /*#__PURE__*/ makeMap(SVG_TAGS);
253
153
  */
254
154
  const isVoidTag = /*#__PURE__*/ makeMap(VOID_TAGS);
255
155
 
156
+ /**
157
+ * On the client we only need to offer special cases for boolean attributes that
158
+ * have different names from their corresponding dom properties:
159
+ * - itemscope -> N/A
160
+ * - allowfullscreen -> allowFullscreen
161
+ * - formnovalidate -> formNoValidate
162
+ * - ismap -> isMap
163
+ * - nomodule -> noModule
164
+ * - novalidate -> noValidate
165
+ * - readonly -> readOnly
166
+ */
167
+ const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`;
168
+ const isSpecialBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs);
169
+ /**
170
+ * The full list is needed during SSR to produce the correct initial markup.
171
+ */
172
+ const isBooleanAttr = /*#__PURE__*/ makeMap(specialBooleanAttrs +
173
+ `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,` +
174
+ `loop,open,required,reversed,scoped,seamless,` +
175
+ `checked,muted,multiple,selected`);
176
+ /**
177
+ * Boolean attributes should be included if the value is truthy or ''.
178
+ * e.g. `<select multiple>` compiles to `{ multiple: '' }`
179
+ */
180
+ function includeBooleanAttr(value) {
181
+ return !!value || value === '';
182
+ }
183
+ /**
184
+ * Known attributes, this is used for stringification of runtime static nodes
185
+ * so that we don't stringify bindings that cannot be set from HTML.
186
+ * Don't also forget to allow `data-*` and `aria-*`!
187
+ * Generated from https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes
188
+ */
189
+ const isKnownHtmlAttr = /*#__PURE__*/ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,` +
190
+ `autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,` +
191
+ `border,buffered,capture,challenge,charset,checked,cite,class,code,` +
192
+ `codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,` +
193
+ `coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,` +
194
+ `disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,` +
195
+ `formaction,formenctype,formmethod,formnovalidate,formtarget,headers,` +
196
+ `height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,` +
197
+ `ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,` +
198
+ `manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,` +
199
+ `open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,` +
200
+ `referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,` +
201
+ `selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,` +
202
+ `start,step,style,summary,tabindex,target,title,translate,type,usemap,` +
203
+ `value,width,wrap`);
204
+ /**
205
+ * Generated from https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute
206
+ */
207
+ const isKnownSvgAttr = /*#__PURE__*/ makeMap(`xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,` +
208
+ `arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,` +
209
+ `baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,` +
210
+ `clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,` +
211
+ `color-interpolation-filters,color-profile,color-rendering,` +
212
+ `contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,` +
213
+ `descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,` +
214
+ `dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,` +
215
+ `fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,` +
216
+ `font-family,font-size,font-size-adjust,font-stretch,font-style,` +
217
+ `font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,` +
218
+ `glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,` +
219
+ `gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,` +
220
+ `horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,` +
221
+ `k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,` +
222
+ `lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,` +
223
+ `marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,` +
224
+ `mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,` +
225
+ `name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,` +
226
+ `overflow,overline-position,overline-thickness,panose-1,paint-order,path,` +
227
+ `pathLength,patternContentUnits,patternTransform,patternUnits,ping,` +
228
+ `pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,` +
229
+ `preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,` +
230
+ `rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,` +
231
+ `restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,` +
232
+ `specularConstant,specularExponent,speed,spreadMethod,startOffset,` +
233
+ `stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,` +
234
+ `strikethrough-position,strikethrough-thickness,string,stroke,` +
235
+ `stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,` +
236
+ `stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,` +
237
+ `systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,` +
238
+ `text-decoration,text-rendering,textLength,to,transform,transform-origin,` +
239
+ `type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,` +
240
+ `unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,` +
241
+ `v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,` +
242
+ `vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,` +
243
+ `writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,` +
244
+ `xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xml:base,xml:lang,` +
245
+ `xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan`);
246
+
256
247
  const escapeRE = /["'&<>]/;
257
248
  function escapeHtml(string) {
258
249
  const str = '' + string;
@@ -785,8 +776,9 @@ function trigger(target, type, key, newValue, oldValue, oldTarget) {
785
776
  deps = [...depsMap.values()];
786
777
  }
787
778
  else if (key === 'length' && isArray(target)) {
779
+ const newLength = toNumber(newValue);
788
780
  depsMap.forEach((dep, key) => {
789
- if (key === 'length' || key >= newValue) {
781
+ if (key === 'length' || key >= newLength) {
790
782
  deps.push(dep);
791
783
  }
792
784
  });
@@ -2138,7 +2130,7 @@ function emit$1(instance, event, ...rawArgs) {
2138
2130
  const modifiersKey = `${modelArg === 'modelValue' ? 'model' : modelArg}Modifiers`;
2139
2131
  const { number, trim } = props[modifiersKey] || EMPTY_OBJ;
2140
2132
  if (trim) {
2141
- args = rawArgs.map(a => a.trim());
2133
+ args = rawArgs.map(a => (isString(a) ? a.trim() : a));
2142
2134
  }
2143
2135
  if (number) {
2144
2136
  args = rawArgs.map(toNumber);
@@ -3068,7 +3060,8 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3068
3060
  };
3069
3061
  };
3070
3062
  // in SSR there is no need to setup an actual effect, and it should be noop
3071
- // unless it's eager
3063
+ // unless it's eager or sync flush
3064
+ let ssrCleanup;
3072
3065
  if (isInSSRComponentSetup) {
3073
3066
  // we will also not call the invalidate callback (+ runner is not set up)
3074
3067
  onCleanup = NOOP;
@@ -3082,9 +3075,17 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3082
3075
  onCleanup
3083
3076
  ]);
3084
3077
  }
3085
- return NOOP;
3078
+ if (flush === 'sync') {
3079
+ const ctx = useSSRContext();
3080
+ ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []);
3081
+ }
3082
+ else {
3083
+ return NOOP;
3084
+ }
3086
3085
  }
3087
- let oldValue = isMultiSource ? [] : INITIAL_WATCHER_VALUE;
3086
+ let oldValue = isMultiSource
3087
+ ? new Array(source.length).fill(INITIAL_WATCHER_VALUE)
3088
+ : INITIAL_WATCHER_VALUE;
3088
3089
  const job = () => {
3089
3090
  if (!effect.active) {
3090
3091
  return;
@@ -3106,7 +3107,10 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3106
3107
  callWithAsyncErrorHandling(cb, instance, 3 /* ErrorCodes.WATCH_CALLBACK */, [
3107
3108
  newValue,
3108
3109
  // pass undefined as the old value when it's changed for the first time
3109
- oldValue === INITIAL_WATCHER_VALUE ? undefined : oldValue,
3110
+ oldValue === INITIAL_WATCHER_VALUE ||
3111
+ (isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE)
3112
+ ? undefined
3113
+ : oldValue,
3110
3114
  onCleanup
3111
3115
  ]);
3112
3116
  oldValue = newValue;
@@ -3150,12 +3154,15 @@ function doWatch(source, cb, { immediate, deep, flush, onTrack, onTrigger } = EM
3150
3154
  else {
3151
3155
  effect.run();
3152
3156
  }
3153
- return () => {
3157
+ const unwatch = () => {
3154
3158
  effect.stop();
3155
3159
  if (instance && instance.scope) {
3156
3160
  remove(instance.scope.effects, effect);
3157
3161
  }
3158
3162
  };
3163
+ if (ssrCleanup)
3164
+ ssrCleanup.push(unwatch);
3165
+ return unwatch;
3159
3166
  }
3160
3167
  // this.$watch
3161
3168
  function instanceWatch(source, value, options) {
@@ -3323,7 +3330,11 @@ const BaseTransitionImpl = {
3323
3330
  // return placeholder node and queue update when leave finishes
3324
3331
  leavingHooks.afterLeave = () => {
3325
3332
  state.isLeaving = false;
3326
- instance.update();
3333
+ // #6835
3334
+ // it also needs to be updated when active is undefined
3335
+ if (instance.update.active !== false) {
3336
+ instance.update();
3337
+ }
3327
3338
  };
3328
3339
  return emptyPlaceholder(child);
3329
3340
  }
@@ -3831,7 +3842,8 @@ const KeepAliveImpl = {
3831
3842
  : comp);
3832
3843
  const { include, exclude, max } = props;
3833
3844
  if ((include && (!name || !matches(include, name))) ||
3834
- (exclude && name && matches(exclude, name))) {
3845
+ (exclude && name && matches(exclude, name)) ||
3846
+ (false )) {
3835
3847
  current = vnode;
3836
3848
  return rawVNode;
3837
3849
  }
@@ -4096,23 +4108,25 @@ function withDirectives(vnode, directives) {
4096
4108
  const bindings = vnode.dirs || (vnode.dirs = []);
4097
4109
  for (let i = 0; i < directives.length; i++) {
4098
4110
  let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i];
4099
- if (isFunction(dir)) {
4100
- dir = {
4101
- mounted: dir,
4102
- updated: dir
4103
- };
4104
- }
4105
- if (dir.deep) {
4106
- traverse(value);
4111
+ if (dir) {
4112
+ if (isFunction(dir)) {
4113
+ dir = {
4114
+ mounted: dir,
4115
+ updated: dir
4116
+ };
4117
+ }
4118
+ if (dir.deep) {
4119
+ traverse(value);
4120
+ }
4121
+ bindings.push({
4122
+ dir,
4123
+ instance,
4124
+ value,
4125
+ oldValue: void 0,
4126
+ arg,
4127
+ modifiers
4128
+ });
4107
4129
  }
4108
- bindings.push({
4109
- dir,
4110
- instance,
4111
- value,
4112
- oldValue: void 0,
4113
- arg,
4114
- modifiers
4115
- });
4116
4130
  }
4117
4131
  return vnode;
4118
4132
  }
@@ -5700,7 +5714,7 @@ function normalizePropsOptions(comp, appContext, asMixin = false) {
5700
5714
  if (validatePropName(normalizedKey)) {
5701
5715
  const opt = raw[key];
5702
5716
  const prop = (normalized[normalizedKey] =
5703
- isArray(opt) || isFunction(opt) ? { type: opt } : opt);
5717
+ isArray(opt) || isFunction(opt) ? { type: opt } : { ...opt });
5704
5718
  if (prop) {
5705
5719
  const booleanIndex = getTypeIndex(Boolean, prop.type);
5706
5720
  const stringIndex = getTypeIndex(String, prop.type);
@@ -5893,7 +5907,7 @@ function createCompatVue(createApp, createSingletonApp) {
5893
5907
  return vm;
5894
5908
  }
5895
5909
  }
5896
- Vue.version = `2.6.14-compat:${"3.2.41"}`;
5910
+ Vue.version = `2.6.14-compat:${"3.2.42"}`;
5897
5911
  Vue.config = singletonApp.config;
5898
5912
  Vue.use = (p, ...options) => {
5899
5913
  if (p && isFunction(p.install)) {
@@ -8953,6 +8967,9 @@ function getExposeProxy(instance) {
8953
8967
  else if (key in publicPropertiesMap) {
8954
8968
  return publicPropertiesMap[key](instance);
8955
8969
  }
8970
+ },
8971
+ has(target, key) {
8972
+ return key in target || key in publicPropertiesMap;
8956
8973
  }
8957
8974
  })));
8958
8975
  }
@@ -9199,7 +9216,7 @@ function isMemoSame(cached, memo) {
9199
9216
  }
9200
9217
 
9201
9218
  // Core API ------------------------------------------------------------------
9202
- const version = "3.2.41";
9219
+ const version = "3.2.42";
9203
9220
  const _ssrUtils = {
9204
9221
  createComponentInstance,
9205
9222
  setupComponent,
@@ -9761,7 +9778,7 @@ class VueElement extends BaseClass {
9761
9778
  }
9762
9779
  }).observe(this, { attributes: true });
9763
9780
  const resolve = (def) => {
9764
- const { props, styles } = def;
9781
+ const { props = {}, styles } = def;
9765
9782
  const hasOptions = !isArray(props);
9766
9783
  const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
9767
9784
  // cast Number-type props set before resolve
@@ -9808,10 +9825,11 @@ class VueElement extends BaseClass {
9808
9825
  }
9809
9826
  _setAttr(key) {
9810
9827
  let value = this.getAttribute(key);
9811
- if (this._numberProps && this._numberProps[key]) {
9828
+ const camelKey = camelize(key);
9829
+ if (this._numberProps && this._numberProps[camelKey]) {
9812
9830
  value = toNumber(value);
9813
9831
  }
9814
- this._setProp(camelize(key), value, false);
9832
+ this._setProp(camelKey, value, false);
9815
9833
  }
9816
9834
  /**
9817
9835
  * @internal
@@ -10153,11 +10171,11 @@ function getTransitionInfo(el, expectedType) {
10153
10171
  const styles = window.getComputedStyle(el);
10154
10172
  // JSDOM may return undefined for transition properties
10155
10173
  const getStyleProperties = (key) => (styles[key] || '').split(', ');
10156
- const transitionDelays = getStyleProperties(TRANSITION + 'Delay');
10157
- const transitionDurations = getStyleProperties(TRANSITION + 'Duration');
10174
+ const transitionDelays = getStyleProperties(`${TRANSITION}Delay`);
10175
+ const transitionDurations = getStyleProperties(`${TRANSITION}Duration`);
10158
10176
  const transitionTimeout = getTimeout(transitionDelays, transitionDurations);
10159
- const animationDelays = getStyleProperties(ANIMATION + 'Delay');
10160
- const animationDurations = getStyleProperties(ANIMATION + 'Duration');
10177
+ const animationDelays = getStyleProperties(`${ANIMATION}Delay`);
10178
+ const animationDurations = getStyleProperties(`${ANIMATION}Duration`);
10161
10179
  const animationTimeout = getTimeout(animationDelays, animationDurations);
10162
10180
  let type = null;
10163
10181
  let timeout = 0;
@@ -10192,7 +10210,7 @@ function getTransitionInfo(el, expectedType) {
10192
10210
  : 0;
10193
10211
  }
10194
10212
  const hasTransform = type === TRANSITION &&
10195
- /\b(transform|all)(,|$)/.test(styles[TRANSITION + 'Property']);
10213
+ /\b(transform|all)(,|$)/.test(getStyleProperties(`${TRANSITION}Property`).toString());
10196
10214
  return {
10197
10215
  type,
10198
10216
  timeout,
@@ -11476,7 +11494,10 @@ function injectProp(node, prop, context) {
11476
11494
  // if doesn't override user provided keys
11477
11495
  const first = props.arguments[0];
11478
11496
  if (!isString(first) && first.type === 15 /* NodeTypes.JS_OBJECT_EXPRESSION */) {
11479
- first.properties.unshift(prop);
11497
+ // #6631
11498
+ if (!hasProp(prop, first)) {
11499
+ first.properties.unshift(prop);
11500
+ }
11480
11501
  }
11481
11502
  else {
11482
11503
  if (props.callee === TO_HANDLERS) {
@@ -11493,14 +11514,7 @@ function injectProp(node, prop, context) {
11493
11514
  !propsWithInjection && (propsWithInjection = props);
11494
11515
  }
11495
11516
  else if (props.type === 15 /* NodeTypes.JS_OBJECT_EXPRESSION */) {
11496
- let alreadyExists = false;
11497
- // check existing key to avoid overriding user provided keys
11498
- if (prop.key.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */) {
11499
- const propKeyName = prop.key.content;
11500
- alreadyExists = props.properties.some(p => p.key.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ &&
11501
- p.key.content === propKeyName);
11502
- }
11503
- if (!alreadyExists) {
11517
+ if (!hasProp(prop, props)) {
11504
11518
  props.properties.unshift(prop);
11505
11519
  }
11506
11520
  propsWithInjection = props;
@@ -11535,6 +11549,16 @@ function injectProp(node, prop, context) {
11535
11549
  }
11536
11550
  }
11537
11551
  }
11552
+ // check existing key to avoid overriding user provided keys
11553
+ function hasProp(prop, props) {
11554
+ let result = false;
11555
+ if (prop.key.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */) {
11556
+ const propKeyName = prop.key.content;
11557
+ result = props.properties.some(p => p.key.type === 4 /* NodeTypes.SIMPLE_EXPRESSION */ &&
11558
+ p.key.content === propKeyName);
11559
+ }
11560
+ return result;
11561
+ }
11538
11562
  function toValidAssetId(name, type) {
11539
11563
  // see issue#4422, we need adding identifier on validAssetId if variable `name` has specific character
11540
11564
  return `_${type}_${name.replace(/[^\w]/g, (searchValue, replaceValue) => {
@@ -11780,13 +11804,18 @@ function parseChildren(context, mode, ancestors) {
11780
11804
  const next = nodes[i + 1];
11781
11805
  // Remove if:
11782
11806
  // - the whitespace is the first or last node, or:
11783
- // - (condense mode) the whitespace is adjacent to a comment, or:
11807
+ // - (condense mode) the whitespace is between twos comments, or:
11808
+ // - (condense mode) the whitespace is between comment and element, or:
11784
11809
  // - (condense mode) the whitespace is between two elements AND contains newline
11785
11810
  if (!prev ||
11786
11811
  !next ||
11787
11812
  (shouldCondense &&
11788
- (prev.type === 3 /* NodeTypes.COMMENT */ ||
11789
- next.type === 3 /* NodeTypes.COMMENT */ ||
11813
+ ((prev.type === 3 /* NodeTypes.COMMENT */ &&
11814
+ next.type === 3 /* NodeTypes.COMMENT */) ||
11815
+ (prev.type === 3 /* NodeTypes.COMMENT */ &&
11816
+ next.type === 1 /* NodeTypes.ELEMENT */) ||
11817
+ (prev.type === 1 /* NodeTypes.ELEMENT */ &&
11818
+ next.type === 3 /* NodeTypes.COMMENT */) ||
11790
11819
  (prev.type === 1 /* NodeTypes.ELEMENT */ &&
11791
11820
  next.type === 1 /* NodeTypes.ELEMENT */ &&
11792
11821
  /[\r\n]/.test(node.content))))) {
@@ -14384,6 +14413,10 @@ function processIf(node, dir, context, processCodegen) {
14384
14413
  let i = siblings.indexOf(node);
14385
14414
  while (i-- >= -1) {
14386
14415
  const sibling = siblings[i];
14416
+ if (sibling && sibling.type === 3 /* NodeTypes.COMMENT */) {
14417
+ context.removeNode(sibling);
14418
+ continue;
14419
+ }
14387
14420
  if (sibling &&
14388
14421
  sibling.type === 2 /* NodeTypes.TEXT */ &&
14389
14422
  !sibling.content.trim().length) {
@@ -15348,11 +15381,14 @@ function buildProps(node, context, props = node.props, isComponent, isDynamicCom
15348
15381
  // in inline mode there is no setupState object, so we can't use string
15349
15382
  // keys to set the ref. Instead, we need to transform it to pass the
15350
15383
  // actual ref instead.
15351
- if (value &&
15352
- context.inline &&
15353
- context.bindingMetadata[value.content]) {
15354
- isStatic = false;
15355
- properties.push(createObjectProperty(createSimpleExpression('ref_key', true), createSimpleExpression(value.content, true, value.loc)));
15384
+ if (value && context.inline) {
15385
+ const binding = context.bindingMetadata[value.content];
15386
+ if (binding === "setup-let" /* BindingTypes.SETUP_LET */ ||
15387
+ binding === "setup-ref" /* BindingTypes.SETUP_REF */ ||
15388
+ binding === "setup-maybe-ref" /* BindingTypes.SETUP_MAYBE_REF */) {
15389
+ isStatic = false;
15390
+ properties.push(createObjectProperty(createSimpleExpression('ref_key', true), createSimpleExpression(value.content, true, value.loc)));
15391
+ }
15356
15392
  }
15357
15393
  }
15358
15394
  // skip is on <component>, or is="vue:xxx"
@@ -15735,7 +15771,7 @@ function processSlotOutlet(node, context) {
15735
15771
  };
15736
15772
  }
15737
15773
 
15738
- const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
15774
+ const fnExpRE = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/;
15739
15775
  const transformOn = (dir, node, context, augmentor) => {
15740
15776
  const { loc, modifiers, arg } = dir;
15741
15777
  if (!dir.exp && !modifiers.length) {
@@ -15749,10 +15785,10 @@ const transformOn = (dir, node, context, augmentor) => {
15749
15785
  if (rawName.startsWith('vue:')) {
15750
15786
  rawName = `vnode-${rawName.slice(4)}`;
15751
15787
  }
15752
- const eventString = node.tagType === 1 /* ElementTypes.COMPONENT */ ||
15788
+ const eventString = node.tagType !== 0 /* ElementTypes.ELEMENT */ ||
15753
15789
  rawName.startsWith('vnode') ||
15754
15790
  !/[A-Z]/.test(rawName)
15755
- ? // for component and vnode lifecycle event listeners, auto convert
15791
+ ? // for non-element and vnode lifecycle event listeners, auto convert
15756
15792
  // it to camelCase. See issue #2249
15757
15793
  toHandlerKey(camelize(rawName))
15758
15794
  : // preserve case for plain element listeners that have uppercase