@vue/compat 3.2.9 → 3.2.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,4 +1,4 @@
1
- var Vue = (function (exports) {
1
+ var Vue = (function () {
2
2
  'use strict';
3
3
 
4
4
  /**
@@ -1413,7 +1413,8 @@ var Vue = (function (exports) {
1413
1413
  function computed(getterOrOptions, debugOptions) {
1414
1414
  let getter;
1415
1415
  let setter;
1416
- if (isFunction(getterOrOptions)) {
1416
+ const onlyGetter = isFunction(getterOrOptions);
1417
+ if (onlyGetter) {
1417
1418
  getter = getterOrOptions;
1418
1419
  setter = () => {
1419
1420
  console.warn('Write operation failed: computed value is readonly');
@@ -1424,7 +1425,7 @@ var Vue = (function (exports) {
1424
1425
  getter = getterOrOptions.get;
1425
1426
  setter = getterOrOptions.set;
1426
1427
  }
1427
- const cRef = new ComputedRefImpl(getter, setter, isFunction(getterOrOptions) || !getterOrOptions.set);
1428
+ const cRef = new ComputedRefImpl(getter, setter, onlyGetter || !setter);
1428
1429
  if (debugOptions) {
1429
1430
  cRef.effect.onTrack = debugOptions.onTrack;
1430
1431
  cRef.effect.onTrigger = debugOptions.onTrigger;
@@ -1459,41 +1460,33 @@ var Vue = (function (exports) {
1459
1460
  const id = instance.type.__hmrId;
1460
1461
  let record = map.get(id);
1461
1462
  if (!record) {
1462
- createRecord(id, instance.type);
1463
+ createRecord(id);
1463
1464
  record = map.get(id);
1464
1465
  }
1465
- record.instances.add(instance);
1466
+ record.add(instance);
1466
1467
  }
1467
1468
  function unregisterHMR(instance) {
1468
- map.get(instance.type.__hmrId).instances.delete(instance);
1469
+ map.get(instance.type.__hmrId).delete(instance);
1469
1470
  }
1470
- function createRecord(id, component) {
1471
- if (!component) {
1472
- warn$1(`HMR API usage is out of date.\n` +
1473
- `Please upgrade vue-loader/vite/rollup-plugin-vue or other relevant ` +
1474
- `dependency that handles Vue SFC compilation.`);
1475
- component = {};
1476
- }
1471
+ function createRecord(id) {
1477
1472
  if (map.has(id)) {
1478
1473
  return false;
1479
1474
  }
1480
- map.set(id, {
1481
- component: isClassComponent(component) ? component.__vccOpts : component,
1482
- instances: new Set()
1483
- });
1475
+ map.set(id, new Set());
1484
1476
  return true;
1485
1477
  }
1478
+ function normalizeClassComponent(component) {
1479
+ return isClassComponent(component) ? component.__vccOpts : component;
1480
+ }
1486
1481
  function rerender(id, newRender) {
1487
1482
  const record = map.get(id);
1488
- if (!record)
1483
+ if (!record) {
1489
1484
  return;
1490
- if (newRender)
1491
- record.component.render = newRender;
1492
- // Array.from creates a snapshot which avoids the set being mutated during
1493
- // updates
1494
- Array.from(record.instances).forEach(instance => {
1485
+ }
1486
+ [...record].forEach(instance => {
1495
1487
  if (newRender) {
1496
1488
  instance.render = newRender;
1489
+ normalizeClassComponent(instance.type).render = newRender;
1497
1490
  }
1498
1491
  instance.renderCache = [];
1499
1492
  // this flag forces child components with slot content to update
@@ -1506,34 +1499,31 @@ var Vue = (function (exports) {
1506
1499
  const record = map.get(id);
1507
1500
  if (!record)
1508
1501
  return;
1509
- // Array.from creates a snapshot which avoids the set being mutated during
1510
- // updates
1511
- const { component, instances } = record;
1512
- if (!hmrDirtyComponents.has(component)) {
1513
- // 1. Update existing comp definition to match new one
1514
- newComp = isClassComponent(newComp) ? newComp.__vccOpts : newComp;
1515
- extend(component, newComp);
1516
- for (const key in component) {
1517
- if (key !== '__file' && !(key in newComp)) {
1518
- delete component[key];
1519
- }
1520
- }
1521
- // 2. Mark component dirty. This forces the renderer to replace the component
1522
- // on patch.
1523
- hmrDirtyComponents.add(component);
1524
- // 3. Make sure to unmark the component after the reload.
1525
- queuePostFlushCb(() => {
1526
- hmrDirtyComponents.delete(component);
1527
- });
1528
- }
1529
- Array.from(instances).forEach(instance => {
1530
- // invalidate options resolution cache
1502
+ newComp = normalizeClassComponent(newComp);
1503
+ // create a snapshot which avoids the set being mutated during updates
1504
+ const instances = [...record];
1505
+ for (const instance of instances) {
1506
+ const oldComp = normalizeClassComponent(instance.type);
1507
+ if (!hmrDirtyComponents.has(oldComp)) {
1508
+ // 1. Update existing comp definition to match new one
1509
+ extend(oldComp, newComp);
1510
+ for (const key in oldComp) {
1511
+ if (key !== '__file' && !(key in newComp)) {
1512
+ delete oldComp[key];
1513
+ }
1514
+ }
1515
+ // 2. mark definition dirty. This forces the renderer to replace the
1516
+ // component on patch.
1517
+ hmrDirtyComponents.add(oldComp);
1518
+ }
1519
+ // 3. invalidate options resolution cache
1531
1520
  instance.appContext.optionsCache.delete(instance.type);
1521
+ // 4. actually update
1532
1522
  if (instance.ceReload) {
1533
1523
  // custom element
1534
- hmrDirtyComponents.add(component);
1524
+ hmrDirtyComponents.add(oldComp);
1535
1525
  instance.ceReload(newComp.styles);
1536
- hmrDirtyComponents.delete(component);
1526
+ hmrDirtyComponents.delete(oldComp);
1537
1527
  }
1538
1528
  else if (instance.parent) {
1539
1529
  // 4. Force the parent instance to re-render. This will cause all updated
@@ -1558,6 +1548,12 @@ var Vue = (function (exports) {
1558
1548
  else {
1559
1549
  console.warn('[HMR] Root or manually mounted instance modified. Full reload required.');
1560
1550
  }
1551
+ }
1552
+ // 5. make sure to cleanup dirty hmr components after update
1553
+ queuePostFlushCb(() => {
1554
+ for (const instance of instances) {
1555
+ hmrDirtyComponents.delete(normalizeClassComponent(instance.type));
1556
+ }
1561
1557
  });
1562
1558
  }
1563
1559
  function tryWrap(fn) {
@@ -1884,7 +1880,7 @@ var Vue = (function (exports) {
1884
1880
  ["PRIVATE_APIS" /* PRIVATE_APIS */]: {
1885
1881
  message: name => `"${name}" is a Vue 2 private API that no longer exists in Vue 3. ` +
1886
1882
  `If you are seeing this warning only due to a dependency, you can ` +
1887
- `suppress this warning via { PRIVATE_APIS: 'supress-warning' }.`
1883
+ `suppress this warning via { PRIVATE_APIS: 'suppress-warning' }.`
1888
1884
  }
1889
1885
  };
1890
1886
  const instanceWarned = Object.create(null);
@@ -2371,12 +2367,12 @@ var Vue = (function (exports) {
2371
2367
  function renderComponentRoot(instance) {
2372
2368
  const { type: Component, vnode, proxy, withProxy, props, propsOptions: [propsOptions], slots, attrs, emit, render, renderCache, data, setupState, ctx, inheritAttrs } = instance;
2373
2369
  let result;
2370
+ let fallthroughAttrs;
2374
2371
  const prev = setCurrentRenderingInstance(instance);
2375
2372
  {
2376
2373
  accessedAttrs = false;
2377
2374
  }
2378
2375
  try {
2379
- let fallthroughAttrs;
2380
2376
  if (vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */) {
2381
2377
  // withProxy is a proxy with a different `has` trap only for
2382
2378
  // runtime-compiled render functions using `with` block.
@@ -2407,108 +2403,105 @@ var Vue = (function (exports) {
2407
2403
  ? attrs
2408
2404
  : getFunctionalFallthrough(attrs);
2409
2405
  }
2410
- // attr merging
2411
- // in dev mode, comments are preserved, and it's possible for a template
2412
- // to have comments along side the root element which makes it a fragment
2413
- let root = result;
2414
- let setRoot = undefined;
2415
- if (true &&
2416
- result.patchFlag > 0 &&
2417
- result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
2418
- ;
2419
- [root, setRoot] = getChildRoot(result);
2420
- }
2421
- if (fallthroughAttrs && inheritAttrs !== false) {
2422
- const keys = Object.keys(fallthroughAttrs);
2423
- const { shapeFlag } = root;
2424
- if (keys.length) {
2425
- if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
2426
- if (propsOptions && keys.some(isModelListener)) {
2427
- // If a v-model listener (onUpdate:xxx) has a corresponding declared
2428
- // prop, it indicates this component expects to handle v-model and
2429
- // it should not fallthrough.
2430
- // related: #1543, #1643, #1989
2431
- fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
2432
- }
2433
- root = cloneVNode(root, fallthroughAttrs);
2434
- }
2435
- else if (true && !accessedAttrs && root.type !== Comment) {
2436
- const allAttrs = Object.keys(attrs);
2437
- const eventAttrs = [];
2438
- const extraAttrs = [];
2439
- for (let i = 0, l = allAttrs.length; i < l; i++) {
2440
- const key = allAttrs[i];
2441
- if (isOn(key)) {
2442
- // ignore v-model handlers when they fail to fallthrough
2443
- if (!isModelListener(key)) {
2444
- // remove `on`, lowercase first letter to reflect event casing
2445
- // accurately
2446
- eventAttrs.push(key[2].toLowerCase() + key.slice(3));
2447
- }
2448
- }
2449
- else {
2450
- extraAttrs.push(key);
2406
+ }
2407
+ catch (err) {
2408
+ blockStack.length = 0;
2409
+ handleError(err, instance, 1 /* RENDER_FUNCTION */);
2410
+ result = createVNode(Comment);
2411
+ }
2412
+ // attr merging
2413
+ // in dev mode, comments are preserved, and it's possible for a template
2414
+ // to have comments along side the root element which makes it a fragment
2415
+ let root = result;
2416
+ let setRoot = undefined;
2417
+ if (result.patchFlag > 0 &&
2418
+ result.patchFlag & 2048 /* DEV_ROOT_FRAGMENT */) {
2419
+ [root, setRoot] = getChildRoot(result);
2420
+ }
2421
+ if (fallthroughAttrs && inheritAttrs !== false) {
2422
+ const keys = Object.keys(fallthroughAttrs);
2423
+ const { shapeFlag } = root;
2424
+ if (keys.length) {
2425
+ if (shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
2426
+ if (propsOptions && keys.some(isModelListener)) {
2427
+ // If a v-model listener (onUpdate:xxx) has a corresponding declared
2428
+ // prop, it indicates this component expects to handle v-model and
2429
+ // it should not fallthrough.
2430
+ // related: #1543, #1643, #1989
2431
+ fallthroughAttrs = filterModelListeners(fallthroughAttrs, propsOptions);
2432
+ }
2433
+ root = cloneVNode(root, fallthroughAttrs);
2434
+ }
2435
+ else if (!accessedAttrs && root.type !== Comment) {
2436
+ const allAttrs = Object.keys(attrs);
2437
+ const eventAttrs = [];
2438
+ const extraAttrs = [];
2439
+ for (let i = 0, l = allAttrs.length; i < l; i++) {
2440
+ const key = allAttrs[i];
2441
+ if (isOn(key)) {
2442
+ // ignore v-model handlers when they fail to fallthrough
2443
+ if (!isModelListener(key)) {
2444
+ // remove `on`, lowercase first letter to reflect event casing
2445
+ // accurately
2446
+ eventAttrs.push(key[2].toLowerCase() + key.slice(3));
2451
2447
  }
2452
2448
  }
2453
- if (extraAttrs.length) {
2454
- warn$1(`Extraneous non-props attributes (` +
2455
- `${extraAttrs.join(', ')}) ` +
2456
- `were passed to component but could not be automatically inherited ` +
2457
- `because component renders fragment or text root nodes.`);
2458
- }
2459
- if (eventAttrs.length) {
2460
- warn$1(`Extraneous non-emits event listeners (` +
2461
- `${eventAttrs.join(', ')}) ` +
2462
- `were passed to component but could not be automatically inherited ` +
2463
- `because component renders fragment or text root nodes. ` +
2464
- `If the listener is intended to be a component custom event listener only, ` +
2465
- `declare it using the "emits" option.`);
2449
+ else {
2450
+ extraAttrs.push(key);
2466
2451
  }
2467
2452
  }
2468
- }
2469
- }
2470
- if (true &&
2471
- isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
2472
- vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */ &&
2473
- root.shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
2474
- const { class: cls, style } = vnode.props || {};
2475
- if (cls || style) {
2476
- if (true && inheritAttrs === false) {
2477
- warnDeprecation("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
2453
+ if (extraAttrs.length) {
2454
+ warn$1(`Extraneous non-props attributes (` +
2455
+ `${extraAttrs.join(', ')}) ` +
2456
+ `were passed to component but could not be automatically inherited ` +
2457
+ `because component renders fragment or text root nodes.`);
2458
+ }
2459
+ if (eventAttrs.length) {
2460
+ warn$1(`Extraneous non-emits event listeners (` +
2461
+ `${eventAttrs.join(', ')}) ` +
2462
+ `were passed to component but could not be automatically inherited ` +
2463
+ `because component renders fragment or text root nodes. ` +
2464
+ `If the listener is intended to be a component custom event listener only, ` +
2465
+ `declare it using the "emits" option.`);
2478
2466
  }
2479
- root = cloneVNode(root, {
2480
- class: cls,
2481
- style: style
2482
- });
2483
- }
2484
- }
2485
- // inherit directives
2486
- if (vnode.dirs) {
2487
- if (true && !isElementRoot(root)) {
2488
- warn$1(`Runtime directive used on component with non-element root node. ` +
2489
- `The directives will not function as intended.`);
2490
2467
  }
2491
- root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
2492
2468
  }
2493
- // inherit transition data
2494
- if (vnode.transition) {
2495
- if (true && !isElementRoot(root)) {
2496
- warn$1(`Component inside <Transition> renders non-element root node ` +
2497
- `that cannot be animated.`);
2469
+ }
2470
+ if (isCompatEnabled("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance) &&
2471
+ vnode.shapeFlag & 4 /* STATEFUL_COMPONENT */ &&
2472
+ root.shapeFlag & (1 /* ELEMENT */ | 6 /* COMPONENT */)) {
2473
+ const { class: cls, style } = vnode.props || {};
2474
+ if (cls || style) {
2475
+ if (inheritAttrs === false) {
2476
+ warnDeprecation("INSTANCE_ATTRS_CLASS_STYLE" /* INSTANCE_ATTRS_CLASS_STYLE */, instance, getComponentName(instance.type));
2498
2477
  }
2499
- root.transition = vnode.transition;
2478
+ root = cloneVNode(root, {
2479
+ class: cls,
2480
+ style: style
2481
+ });
2500
2482
  }
2501
- if (true && setRoot) {
2502
- setRoot(root);
2483
+ }
2484
+ // inherit directives
2485
+ if (vnode.dirs) {
2486
+ if (!isElementRoot(root)) {
2487
+ warn$1(`Runtime directive used on component with non-element root node. ` +
2488
+ `The directives will not function as intended.`);
2503
2489
  }
2504
- else {
2505
- result = root;
2490
+ root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs;
2491
+ }
2492
+ // inherit transition data
2493
+ if (vnode.transition) {
2494
+ if (!isElementRoot(root)) {
2495
+ warn$1(`Component inside <Transition> renders non-element root node ` +
2496
+ `that cannot be animated.`);
2506
2497
  }
2498
+ root.transition = vnode.transition;
2507
2499
  }
2508
- catch (err) {
2509
- blockStack.length = 0;
2510
- handleError(err, instance, 1 /* RENDER_FUNCTION */);
2511
- result = createVNode(Comment);
2500
+ if (setRoot) {
2501
+ setRoot(root);
2502
+ }
2503
+ else {
2504
+ result = root;
2512
2505
  }
2513
2506
  setCurrentRenderingInstance(prev);
2514
2507
  return result;
@@ -3043,8 +3036,8 @@ var Vue = (function (exports) {
3043
3036
  function normalizeSuspenseSlot(s) {
3044
3037
  let block;
3045
3038
  if (isFunction(s)) {
3046
- const isCompiledSlot = s._c;
3047
- if (isCompiledSlot) {
3039
+ const trackBlock = isBlockTreeEnabled && s._c;
3040
+ if (trackBlock) {
3048
3041
  // disableTracking: false
3049
3042
  // allow block tracking for compiled slots
3050
3043
  // (see ./componentRenderContext.ts)
@@ -3052,7 +3045,7 @@ var Vue = (function (exports) {
3052
3045
  openBlock();
3053
3046
  }
3054
3047
  s = s();
3055
- if (isCompiledSlot) {
3048
+ if (trackBlock) {
3056
3049
  s._d = true;
3057
3050
  block = currentBlock;
3058
3051
  closeBlock();
@@ -5208,7 +5201,7 @@ var Vue = (function (exports) {
5208
5201
  return vm;
5209
5202
  }
5210
5203
  }
5211
- Vue.version = "3.2.9";
5204
+ Vue.version = "3.2.13";
5212
5205
  Vue.config = singletonApp.config;
5213
5206
  Vue.use = (p, ...options) => {
5214
5207
  if (p && isFunction(p.install)) {
@@ -5739,7 +5732,7 @@ var Vue = (function (exports) {
5739
5732
  app._instance = vnode.component;
5740
5733
  devtoolsInitApp(app, version);
5741
5734
  }
5742
- return vnode.component.proxy;
5735
+ return getExposeProxy(vnode.component) || vnode.component.proxy;
5743
5736
  }
5744
5737
  else {
5745
5738
  warn$1(`App has already been mounted.\n` +
@@ -5948,14 +5941,14 @@ var Vue = (function (exports) {
5948
5941
  for (const key in props) {
5949
5942
  if ((forcePatchValue && key.endsWith('value')) ||
5950
5943
  (isOn(key) && !isReservedProp(key))) {
5951
- patchProp(el, key, null, props[key]);
5944
+ patchProp(el, key, null, props[key], false, undefined, parentComponent);
5952
5945
  }
5953
5946
  }
5954
5947
  }
5955
5948
  else if (props.onClick) {
5956
5949
  // Fast path for click listeners (which is most often) to avoid
5957
5950
  // iterating through props.
5958
- patchProp(el, 'onClick', null, props.onClick);
5951
+ patchProp(el, 'onClick', null, props.onClick, false, undefined, parentComponent);
5959
5952
  }
5960
5953
  }
5961
5954
  // vnode / directive hooks
@@ -7856,7 +7849,11 @@ var Vue = (function (exports) {
7856
7849
  return Component;
7857
7850
  }
7858
7851
  if (warnMissing && !res) {
7859
- warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}`);
7852
+ const extra = type === COMPONENTS
7853
+ ? `\nIf this is a native custom element, make sure to exclude it from ` +
7854
+ `component resolution via compilerOptions.isCustomElement.`
7855
+ : ``;
7856
+ warn$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`);
7860
7857
  }
7861
7858
  return res;
7862
7859
  }
@@ -9298,17 +9295,19 @@ var Vue = (function (exports) {
9298
9295
  function exposeSetupStateOnRenderContext(instance) {
9299
9296
  const { ctx, setupState } = instance;
9300
9297
  Object.keys(toRaw(setupState)).forEach(key => {
9301
- if (!setupState.__isScriptSetup && (key[0] === '$' || key[0] === '_')) {
9302
- warn$1(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
9303
- `which are reserved prefixes for Vue internals.`);
9304
- return;
9298
+ if (!setupState.__isScriptSetup) {
9299
+ if (key[0] === '$' || key[0] === '_') {
9300
+ warn$1(`setup() return property ${JSON.stringify(key)} should not start with "$" or "_" ` +
9301
+ `which are reserved prefixes for Vue internals.`);
9302
+ return;
9303
+ }
9304
+ Object.defineProperty(ctx, key, {
9305
+ enumerable: true,
9306
+ configurable: true,
9307
+ get: () => setupState[key],
9308
+ set: NOOP
9309
+ });
9305
9310
  }
9306
- Object.defineProperty(ctx, key, {
9307
- enumerable: true,
9308
- configurable: true,
9309
- get: () => setupState[key],
9310
- set: NOOP
9311
- });
9312
9311
  });
9313
9312
  }
9314
9313
 
@@ -10067,11 +10066,18 @@ var Vue = (function (exports) {
10067
10066
  // 2. If a component is unmounted during a parent component's update,
10068
10067
  // its update can be skipped.
10069
10068
  queue.sort((a, b) => getId(a) - getId(b));
10069
+ // conditional usage of checkRecursiveUpdate must be determined out of
10070
+ // try ... catch block since Rollup by default de-optimizes treeshaking
10071
+ // inside try-catch. This can leave all warning code unshaked. Although
10072
+ // they would get eventually shaken by a minifier like terser, some minifiers
10073
+ // would fail to do that (e.g. https://github.com/evanw/esbuild/issues/1610)
10074
+ const check = (job) => checkRecursiveUpdates(seen, job)
10075
+ ;
10070
10076
  try {
10071
10077
  for (flushIndex = 0; flushIndex < queue.length; flushIndex++) {
10072
10078
  const job = queue[flushIndex];
10073
10079
  if (job && job.active !== false) {
10074
- if (true && checkRecursiveUpdates(seen, job)) {
10080
+ if (true && check(job)) {
10075
10081
  continue;
10076
10082
  }
10077
10083
  // console.log(`running:`, job.id)
@@ -10348,7 +10354,7 @@ var Vue = (function (exports) {
10348
10354
  return cur;
10349
10355
  };
10350
10356
  }
10351
- function traverse(value, seen = new Set()) {
10357
+ function traverse(value, seen) {
10352
10358
  if (!isObject(value) || value["__v_skip" /* SKIP */]) {
10353
10359
  return value;
10354
10360
  }
@@ -10759,7 +10765,7 @@ var Vue = (function (exports) {
10759
10765
  }
10760
10766
 
10761
10767
  // Core API ------------------------------------------------------------------
10762
- const version = "3.2.9";
10768
+ const version = "3.2.13";
10763
10769
  /**
10764
10770
  * SSR utils for \@vue/server-renderer. Only exposed in cjs builds.
10765
10771
  * @internal
@@ -10888,19 +10894,13 @@ var Vue = (function (exports) {
10888
10894
 
10889
10895
  function patchStyle(el, prev, next) {
10890
10896
  const style = el.style;
10897
+ const currentDisplay = style.display;
10891
10898
  if (!next) {
10892
10899
  el.removeAttribute('style');
10893
10900
  }
10894
10901
  else if (isString(next)) {
10895
10902
  if (prev !== next) {
10896
- const current = style.display;
10897
10903
  style.cssText = next;
10898
- // indicates that the `display` of the element is controlled by `v-show`,
10899
- // so we always keep the current `display` value regardless of the `style` value,
10900
- // thus handing over control to `v-show`.
10901
- if ('_vod' in el) {
10902
- style.display = current;
10903
- }
10904
10904
  }
10905
10905
  }
10906
10906
  else {
@@ -10915,6 +10915,12 @@ var Vue = (function (exports) {
10915
10915
  }
10916
10916
  }
10917
10917
  }
10918
+ // indicates that the `display` of the element is controlled by `v-show`,
10919
+ // so we always keep the current `display` value regardless of the `style` value,
10920
+ // thus handing over control to `v-show`.
10921
+ if ('_vod' in el) {
10922
+ style.display = currentDisplay;
10923
+ }
10918
10924
  }
10919
10925
  const importantRE = /\s*!important$/;
10920
10926
  function setStyle(style, name, val) {
@@ -11285,6 +11291,7 @@ var Vue = (function (exports) {
11285
11291
  this._instance = null;
11286
11292
  this._connected = false;
11287
11293
  this._resolved = false;
11294
+ this._numberProps = null;
11288
11295
  if (this.shadowRoot && hydrate) {
11289
11296
  hydrate(this._createVNode(), this.shadowRoot);
11290
11297
  }
@@ -11300,18 +11307,17 @@ var Vue = (function (exports) {
11300
11307
  this._setAttr(this.attributes[i].name);
11301
11308
  }
11302
11309
  // watch future attr changes
11303
- const observer = new MutationObserver(mutations => {
11310
+ new MutationObserver(mutations => {
11304
11311
  for (const m of mutations) {
11305
11312
  this._setAttr(m.attributeName);
11306
11313
  }
11307
- });
11308
- observer.observe(this, { attributes: true });
11314
+ }).observe(this, { attributes: true });
11309
11315
  }
11310
11316
  connectedCallback() {
11311
11317
  this._connected = true;
11312
11318
  if (!this._instance) {
11313
11319
  this._resolveDef();
11314
- render(this._createVNode(), this.shadowRoot);
11320
+ this._update();
11315
11321
  }
11316
11322
  }
11317
11323
  disconnectedCallback() {
@@ -11332,15 +11338,31 @@ var Vue = (function (exports) {
11332
11338
  }
11333
11339
  const resolve = (def) => {
11334
11340
  this._resolved = true;
11341
+ const { props, styles } = def;
11342
+ const hasOptions = !isArray(props);
11343
+ const rawKeys = props ? (hasOptions ? Object.keys(props) : props) : [];
11344
+ // cast Number-type props set before resolve
11345
+ let numberProps;
11346
+ if (hasOptions) {
11347
+ for (const key in this._props) {
11348
+ const opt = props[key];
11349
+ if (opt === Number || (opt && opt.type === Number)) {
11350
+ this._props[key] = toNumber(this._props[key]);
11351
+ (numberProps || (numberProps = Object.create(null)))[key] = true;
11352
+ }
11353
+ }
11354
+ }
11355
+ if (numberProps) {
11356
+ this._numberProps = numberProps;
11357
+ this._update();
11358
+ }
11335
11359
  // check if there are props set pre-upgrade or connect
11336
11360
  for (const key of Object.keys(this)) {
11337
11361
  if (key[0] !== '_') {
11338
11362
  this._setProp(key, this[key]);
11339
11363
  }
11340
11364
  }
11341
- const { props, styles } = def;
11342
11365
  // defining getter/setters on prototype
11343
- const rawKeys = props ? (isArray(props) ? props : Object.keys(props)) : [];
11344
11366
  for (const key of rawKeys.map(camelize)) {
11345
11367
  Object.defineProperty(this, key, {
11346
11368
  get() {
@@ -11362,7 +11384,11 @@ var Vue = (function (exports) {
11362
11384
  }
11363
11385
  }
11364
11386
  _setAttr(key) {
11365
- this._setProp(camelize(key), toNumber(this.getAttribute(key)), false);
11387
+ let value = this.getAttribute(key);
11388
+ if (this._numberProps && this._numberProps[key]) {
11389
+ value = toNumber(value);
11390
+ }
11391
+ this._setProp(camelize(key), value, false);
11366
11392
  }
11367
11393
  /**
11368
11394
  * @internal
@@ -11377,7 +11403,7 @@ var Vue = (function (exports) {
11377
11403
  if (val !== this._props[key]) {
11378
11404
  this._props[key] = val;
11379
11405
  if (this._instance) {
11380
- render(this._createVNode(), this.shadowRoot);
11406
+ this._update();
11381
11407
  }
11382
11408
  // reflect
11383
11409
  if (shouldReflect) {
@@ -11393,6 +11419,9 @@ var Vue = (function (exports) {
11393
11419
  }
11394
11420
  }
11395
11421
  }
11422
+ _update() {
11423
+ render(this._createVNode(), this.shadowRoot);
11424
+ }
11396
11425
  _createVNode() {
11397
11426
  const vnode = createVNode(this._def, extend({}, this._props));
11398
11427
  if (!this._instance) {
@@ -11413,7 +11442,7 @@ var Vue = (function (exports) {
11413
11442
  if (!this._def.__asyncLoader) {
11414
11443
  // reload
11415
11444
  this._instance = null;
11416
- render(this._createVNode(), this.shadowRoot);
11445
+ this._update();
11417
11446
  }
11418
11447
  };
11419
11448
  }
@@ -12669,10 +12698,6 @@ var Vue = (function (exports) {
12669
12698
  }
12670
12699
  });
12671
12700
 
12672
- exports.default = Vue;
12673
-
12674
- Object.defineProperty(exports, '__esModule', { value: true });
12675
-
12676
- return exports;
12701
+ return Vue;
12677
12702
 
12678
- }({}));
12703
+ }());