vue 2.5.9 → 2.5.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.
Files changed (70) hide show
  1. package/README.md +39 -31
  2. package/dist/vue.common.js +245 -153
  3. package/dist/vue.esm.js +245 -153
  4. package/dist/vue.js +240 -152
  5. package/dist/vue.min.js +2 -2
  6. package/dist/vue.runtime.common.js +155 -92
  7. package/dist/vue.runtime.esm.js +155 -92
  8. package/dist/vue.runtime.js +150 -91
  9. package/dist/vue.runtime.min.js +2 -2
  10. package/package.json +12 -12
  11. package/src/compiler/codegen/events.js +30 -3
  12. package/src/compiler/codegen/index.js +20 -9
  13. package/src/compiler/create-compiler.js +1 -1
  14. package/src/compiler/helpers.js +12 -1
  15. package/src/compiler/index.js +3 -1
  16. package/src/compiler/parser/index.js +39 -30
  17. package/src/compiler/parser/text-parser.js +17 -5
  18. package/src/compiler/to-function.js +1 -3
  19. package/src/core/config.js +2 -0
  20. package/src/core/global-api/assets.js +3 -9
  21. package/src/core/global-api/extend.js +3 -9
  22. package/src/core/instance/init.js +10 -6
  23. package/src/core/instance/inject.js +5 -5
  24. package/src/core/instance/lifecycle.js +1 -1
  25. package/src/core/instance/render-helpers/render-static.js +7 -13
  26. package/src/core/instance/render-helpers/resolve-slots.js +4 -2
  27. package/src/core/instance/state.js +2 -1
  28. package/src/core/observer/array.js +1 -2
  29. package/src/core/util/options.js +23 -12
  30. package/src/core/util/props.js +5 -1
  31. package/src/core/vdom/create-component.js +15 -6
  32. package/src/core/vdom/create-element.js +7 -5
  33. package/src/core/vdom/helpers/update-listeners.js +12 -5
  34. package/src/core/vdom/modules/directives.js +3 -0
  35. package/src/core/vdom/patch.js +26 -8
  36. package/src/platforms/web/compiler/directives/model.js +11 -11
  37. package/src/platforms/web/compiler/modules/class.js +2 -2
  38. package/src/platforms/web/compiler/modules/model.js +1 -5
  39. package/src/platforms/web/compiler/modules/style.js +2 -2
  40. package/src/platforms/web/runtime/modules/dom-props.js +15 -9
  41. package/src/platforms/web/util/class.js +3 -3
  42. package/src/platforms/web/util/style.js +5 -2
  43. package/src/platforms/weex/compiler/index.js +26 -4
  44. package/src/platforms/weex/compiler/modules/append.js +7 -1
  45. package/src/platforms/weex/compiler/modules/class.js +1 -1
  46. package/src/platforms/weex/compiler/modules/index.js +2 -0
  47. package/src/platforms/weex/compiler/modules/recycle-list/component-root.js +15 -0
  48. package/src/platforms/weex/compiler/modules/recycle-list/component.js +16 -0
  49. package/src/platforms/weex/compiler/modules/recycle-list/index.js +56 -0
  50. package/src/platforms/weex/compiler/modules/recycle-list/text.js +23 -0
  51. package/src/platforms/weex/compiler/modules/recycle-list/v-bind.js +22 -0
  52. package/src/platforms/weex/compiler/modules/recycle-list/v-for.js +33 -0
  53. package/src/platforms/weex/compiler/modules/recycle-list/v-if.js +47 -0
  54. package/src/platforms/weex/compiler/modules/recycle-list/v-on.js +25 -0
  55. package/src/platforms/weex/compiler/modules/style.js +1 -1
  56. package/src/platforms/weex/entry-framework.js +10 -51
  57. package/src/platforms/weex/runtime/index.js +1 -1
  58. package/src/platforms/weex/runtime/modules/events.js +4 -2
  59. package/src/platforms/weex/runtime/recycle-list/render-component-template.js +34 -0
  60. package/src/platforms/weex/runtime/recycle-list/virtual-component.js +136 -0
  61. package/src/platforms/weex/util/element.js +52 -0
  62. package/src/platforms/weex/util/index.js +35 -37
  63. package/src/server/create-renderer.js +6 -2
  64. package/src/server/optimizing-compiler/modules.js +1 -1
  65. package/src/server/render-context.js +1 -1
  66. package/src/server/render.js +4 -7
  67. package/src/server/template-renderer/index.js +2 -3
  68. package/src/sfc/parser.js +4 -4
  69. package/src/shared/util.js +2 -0
  70. package/types/vue.d.ts +13 -11
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Vue.js v2.5.9
2
+ * Vue.js v2.5.13
3
3
  * (c) 2014-2017 Evan You
4
4
  * Released under the MIT License.
5
5
  */
@@ -32,6 +32,8 @@ function isPrimitive (value) {
32
32
  return (
33
33
  typeof value === 'string' ||
34
34
  typeof value === 'number' ||
35
+ // $flow-disable-line
36
+ typeof value === 'symbol' ||
35
37
  typeof value === 'boolean'
36
38
  )
37
39
  }
@@ -336,6 +338,7 @@ var config = ({
336
338
  /**
337
339
  * Option merge strategies (used in core/util/options)
338
340
  */
341
+ // $flow-disable-line
339
342
  optionMergeStrategies: Object.create(null),
340
343
 
341
344
  /**
@@ -376,6 +379,7 @@ var config = ({
376
379
  /**
377
380
  * Custom user key aliases for v-on
378
381
  */
382
+ // $flow-disable-line
379
383
  keyCodes: Object.create(null),
380
384
 
381
385
  /**
@@ -810,8 +814,7 @@ var arrayMethods = Object.create(arrayProto);[
810
814
  'splice',
811
815
  'sort',
812
816
  'reverse'
813
- ]
814
- .forEach(function (method) {
817
+ ].forEach(function (method) {
815
818
  // cache original method
816
819
  var original = arrayProto[method];
817
820
  def(arrayMethods, method, function mutator () {
@@ -1143,18 +1146,18 @@ function mergeDataOrFn (
1143
1146
  // it has to be a function to pass previous merges.
1144
1147
  return function mergedDataFn () {
1145
1148
  return mergeData(
1146
- typeof childVal === 'function' ? childVal.call(this) : childVal,
1147
- typeof parentVal === 'function' ? parentVal.call(this) : parentVal
1149
+ typeof childVal === 'function' ? childVal.call(this, this) : childVal,
1150
+ typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
1148
1151
  )
1149
1152
  }
1150
1153
  } else {
1151
1154
  return function mergedInstanceDataFn () {
1152
1155
  // instance merge
1153
1156
  var instanceData = typeof childVal === 'function'
1154
- ? childVal.call(vm)
1157
+ ? childVal.call(vm, vm)
1155
1158
  : childVal;
1156
1159
  var defaultData = typeof parentVal === 'function'
1157
- ? parentVal.call(vm)
1160
+ ? parentVal.call(vm, vm)
1158
1161
  : parentVal;
1159
1162
  if (instanceData) {
1160
1163
  return mergeData(instanceData, defaultData)
@@ -1306,13 +1309,23 @@ var defaultStrat = function (parentVal, childVal) {
1306
1309
  */
1307
1310
  function checkComponents (options) {
1308
1311
  for (var key in options.components) {
1309
- var lower = key.toLowerCase();
1310
- if (isBuiltInTag(lower) || config.isReservedTag(lower)) {
1311
- warn(
1312
- 'Do not use built-in or reserved HTML elements as component ' +
1313
- 'id: ' + key
1314
- );
1315
- }
1312
+ validateComponentName(key);
1313
+ }
1314
+ }
1315
+
1316
+ function validateComponentName (name) {
1317
+ if (!/^[a-zA-Z][\w-]*$/.test(name)) {
1318
+ warn(
1319
+ 'Invalid component name: "' + name + '". Component names ' +
1320
+ 'can only contain alphanumeric characters and the hyphen, ' +
1321
+ 'and must start with a letter.'
1322
+ );
1323
+ }
1324
+ if (isBuiltInTag(name) || config.isReservedTag(name)) {
1325
+ warn(
1326
+ 'Do not use built-in or reserved HTML elements as component ' +
1327
+ 'id: ' + name
1328
+ );
1316
1329
  }
1317
1330
  }
1318
1331
 
@@ -1359,6 +1372,7 @@ function normalizeProps (options, vm) {
1359
1372
  */
1360
1373
  function normalizeInject (options, vm) {
1361
1374
  var inject = options.inject;
1375
+ if (!inject) { return }
1362
1376
  var normalized = options.inject = {};
1363
1377
  if (Array.isArray(inject)) {
1364
1378
  for (var i = 0; i < inject.length; i++) {
@@ -1371,7 +1385,7 @@ function normalizeInject (options, vm) {
1371
1385
  ? extend({ from: key }, val)
1372
1386
  : { from: val };
1373
1387
  }
1374
- } else if (process.env.NODE_ENV !== 'production' && inject) {
1388
+ } else if (process.env.NODE_ENV !== 'production') {
1375
1389
  warn(
1376
1390
  "Invalid value for option \"inject\": expected an Array or an Object, " +
1377
1391
  "but got " + (toRawType(inject)) + ".",
@@ -1513,7 +1527,11 @@ function validateProp (
1513
1527
  observe(value);
1514
1528
  observerState.shouldConvert = prevShouldConvert;
1515
1529
  }
1516
- if (process.env.NODE_ENV !== 'production') {
1530
+ if (
1531
+ process.env.NODE_ENV !== 'production' &&
1532
+ // skip validation for weex recycle-list child component props
1533
+ !(false && isObject(value) && ('@binding' in value))
1534
+ ) {
1517
1535
  assertProp(prop, key, value, vm, absent);
1518
1536
  }
1519
1537
  return value
@@ -1993,11 +2011,12 @@ function updateListeners (
1993
2011
  remove$$1,
1994
2012
  vm
1995
2013
  ) {
1996
- var name, cur, old, event;
2014
+ var name, def, cur, old, event;
1997
2015
  for (name in on) {
1998
- cur = on[name];
2016
+ def = cur = on[name];
1999
2017
  old = oldOn[name];
2000
2018
  event = normalizeEvent(name);
2019
+ /* istanbul ignore if */
2001
2020
  if (isUndef(cur)) {
2002
2021
  process.env.NODE_ENV !== 'production' && warn(
2003
2022
  "Invalid handler for event \"" + (event.name) + "\": got " + String(cur),
@@ -2007,7 +2026,7 @@ function updateListeners (
2007
2026
  if (isUndef(cur.fns)) {
2008
2027
  cur = on[name] = createFnInvoker(cur);
2009
2028
  }
2010
- add(event.name, cur, event.once, event.capture, event.passive);
2029
+ add(event.name, cur, event.once, event.capture, event.passive, event.params);
2011
2030
  } else if (cur !== old) {
2012
2031
  old.fns = cur;
2013
2032
  on[name] = old;
@@ -2501,6 +2520,8 @@ function eventsMixin (Vue) {
2501
2520
 
2502
2521
  /* */
2503
2522
 
2523
+
2524
+
2504
2525
  /**
2505
2526
  * Runtime helper for resolving raw children VNodes into a slot object.
2506
2527
  */
@@ -2524,10 +2545,10 @@ function resolveSlots (
2524
2545
  if ((child.context === context || child.fnContext === context) &&
2525
2546
  data && data.slot != null
2526
2547
  ) {
2527
- var name = child.data.slot;
2548
+ var name = data.slot;
2528
2549
  var slot = (slots[name] || (slots[name] = []));
2529
2550
  if (child.tag === 'template') {
2530
- slot.push.apply(slot, child.children);
2551
+ slot.push.apply(slot, child.children || []);
2531
2552
  } else {
2532
2553
  slot.push(child);
2533
2554
  }
@@ -3368,6 +3389,7 @@ function getData (data, vm) {
3368
3389
  var computedWatcherOptions = { lazy: true };
3369
3390
 
3370
3391
  function initComputed (vm, computed) {
3392
+ // $flow-disable-line
3371
3393
  var watchers = vm._computedWatchers = Object.create(null);
3372
3394
  // computed properties are just getters during SSR
3373
3395
  var isSSR = isServerRendering();
@@ -3598,11 +3620,11 @@ function resolveInject (inject, vm) {
3598
3620
  // inject is :any because flow is not smart enough to figure out cached
3599
3621
  var result = Object.create(null);
3600
3622
  var keys = hasSymbol
3601
- ? Reflect.ownKeys(inject).filter(function (key) {
3602
- /* istanbul ignore next */
3603
- return Object.getOwnPropertyDescriptor(inject, key).enumerable
3604
- })
3605
- : Object.keys(inject);
3623
+ ? Reflect.ownKeys(inject).filter(function (key) {
3624
+ /* istanbul ignore next */
3625
+ return Object.getOwnPropertyDescriptor(inject, key).enumerable
3626
+ })
3627
+ : Object.keys(inject);
3606
3628
 
3607
3629
  for (var i = 0; i < keys.length; i++) {
3608
3630
  var key = keys[i];
@@ -3808,19 +3830,9 @@ function bindObjectProps (
3808
3830
  */
3809
3831
  function renderStatic (
3810
3832
  index,
3811
- isInFor,
3812
- isOnce
3833
+ isInFor
3813
3834
  ) {
3814
- // render fns generated by compiler < 2.5.4 does not provide v-once
3815
- // information to runtime so be conservative
3816
- var isOldVersion = arguments.length < 3;
3817
- // if a static tree is generated by v-once, it is cached on the instance;
3818
- // otherwise it is purely static and can be cached on the shared options
3819
- // across all instances.
3820
- var renderFns = this.$options.staticRenderFns;
3821
- var cached = isOldVersion || isOnce
3822
- ? (this._staticTrees || (this._staticTrees = []))
3823
- : (renderFns.cached || (renderFns.cached = []));
3835
+ var cached = this._staticTrees || (this._staticTrees = []);
3824
3836
  var tree = cached[index];
3825
3837
  // if has already-rendered static tree and not inside v-for,
3826
3838
  // we can reuse the same tree by doing a shallow clone.
@@ -3830,7 +3842,11 @@ function renderStatic (
3830
3842
  : cloneVNode(tree)
3831
3843
  }
3832
3844
  // otherwise, render a fresh tree.
3833
- tree = cached[index] = renderFns[index].call(this._renderProxy, null, this);
3845
+ tree = cached[index] = this.$options.staticRenderFns[index].call(
3846
+ this._renderProxy,
3847
+ null,
3848
+ this // for render fns generated for functional component templates
3849
+ );
3834
3850
  markStatic(tree, ("__static__" + index), false);
3835
3851
  return tree
3836
3852
  }
@@ -4008,6 +4024,25 @@ function mergeProps (to, from) {
4008
4024
 
4009
4025
  /* */
4010
4026
 
4027
+
4028
+
4029
+
4030
+ // Register the component hook to weex native render engine.
4031
+ // The hook will be triggered by native, not javascript.
4032
+
4033
+
4034
+ // Updates the state of the component to weex native render engine.
4035
+
4036
+ /* */
4037
+
4038
+ // https://github.com/Hanks10100/weex-native-directive/tree/master/component
4039
+
4040
+ // listening on native callback
4041
+
4042
+ /* */
4043
+
4044
+ /* */
4045
+
4011
4046
  // hooks to be invoked on component VNodes during patch
4012
4047
  var componentVNodeHooks = {
4013
4048
  init: function init (
@@ -4173,6 +4208,11 @@ function createComponent (
4173
4208
  { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children },
4174
4209
  asyncFactory
4175
4210
  );
4211
+
4212
+ // Weex specific: invoke recycle-list optimized @render function for
4213
+ // extracting cell-slot template.
4214
+ // https://github.com/Hanks10100/weex-native-directive/tree/master/component
4215
+ /* istanbul ignore if */
4176
4216
  return vnode
4177
4217
  }
4178
4218
 
@@ -4182,15 +4222,10 @@ function createComponentInstanceForVnode (
4182
4222
  parentElm,
4183
4223
  refElm
4184
4224
  ) {
4185
- var vnodeComponentOptions = vnode.componentOptions;
4186
4225
  var options = {
4187
4226
  _isComponent: true,
4188
4227
  parent: parent,
4189
- propsData: vnodeComponentOptions.propsData,
4190
- _componentTag: vnodeComponentOptions.tag,
4191
4228
  _parentVnode: vnode,
4192
- _parentListeners: vnodeComponentOptions.listeners,
4193
- _renderChildren: vnodeComponentOptions.children,
4194
4229
  _parentElm: parentElm || null,
4195
4230
  _refElm: refElm || null
4196
4231
  };
@@ -4200,7 +4235,7 @@ function createComponentInstanceForVnode (
4200
4235
  options.render = inlineTemplate.render;
4201
4236
  options.staticRenderFns = inlineTemplate.staticRenderFns;
4202
4237
  }
4203
- return new vnodeComponentOptions.Ctor(options)
4238
+ return new vnode.componentOptions.Ctor(options)
4204
4239
  }
4205
4240
 
4206
4241
  function mergeHooks (data) {
@@ -4288,11 +4323,13 @@ function _createElement (
4288
4323
  if (process.env.NODE_ENV !== 'production' &&
4289
4324
  isDef(data) && isDef(data.key) && !isPrimitive(data.key)
4290
4325
  ) {
4291
- warn(
4292
- 'Avoid using non-primitive value as key, ' +
4293
- 'use string/number value instead.',
4294
- context
4295
- );
4326
+ {
4327
+ warn(
4328
+ 'Avoid using non-primitive value as key, ' +
4329
+ 'use string/number value instead.',
4330
+ context
4331
+ );
4332
+ }
4296
4333
  }
4297
4334
  // support single function children as default scoped slot
4298
4335
  if (Array.isArray(children) &&
@@ -4534,14 +4571,18 @@ function initMixin (Vue) {
4534
4571
  function initInternalComponent (vm, options) {
4535
4572
  var opts = vm.$options = Object.create(vm.constructor.options);
4536
4573
  // doing this because it's faster than dynamic enumeration.
4574
+ var parentVnode = options._parentVnode;
4537
4575
  opts.parent = options.parent;
4538
- opts.propsData = options.propsData;
4539
- opts._parentVnode = options._parentVnode;
4540
- opts._parentListeners = options._parentListeners;
4541
- opts._renderChildren = options._renderChildren;
4542
- opts._componentTag = options._componentTag;
4576
+ opts._parentVnode = parentVnode;
4543
4577
  opts._parentElm = options._parentElm;
4544
4578
  opts._refElm = options._refElm;
4579
+
4580
+ var vnodeComponentOptions = parentVnode.componentOptions;
4581
+ opts.propsData = vnodeComponentOptions.propsData;
4582
+ opts._parentListeners = vnodeComponentOptions.listeners;
4583
+ opts._renderChildren = vnodeComponentOptions.children;
4584
+ opts._componentTag = vnodeComponentOptions.tag;
4585
+
4545
4586
  if (options.render) {
4546
4587
  opts.render = options.render;
4547
4588
  opts.staticRenderFns = options.staticRenderFns;
@@ -4675,14 +4716,8 @@ function initExtend (Vue) {
4675
4716
  }
4676
4717
 
4677
4718
  var name = extendOptions.name || Super.options.name;
4678
- if (process.env.NODE_ENV !== 'production') {
4679
- if (!/^[a-zA-Z][\w-]*$/.test(name)) {
4680
- warn(
4681
- 'Invalid component name: "' + name + '". Component names ' +
4682
- 'can only contain alphanumeric characters and the hyphen, ' +
4683
- 'and must start with a letter.'
4684
- );
4685
- }
4719
+ if (process.env.NODE_ENV !== 'production' && name) {
4720
+ validateComponentName(name);
4686
4721
  }
4687
4722
 
4688
4723
  var Sub = function VueComponent (options) {
@@ -4764,13 +4799,8 @@ function initAssetRegisters (Vue) {
4764
4799
  return this.options[type + 's'][id]
4765
4800
  } else {
4766
4801
  /* istanbul ignore if */
4767
- if (process.env.NODE_ENV !== 'production') {
4768
- if (type === 'component' && config.isReservedTag(id)) {
4769
- warn(
4770
- 'Do not use built-in or reserved HTML elements as component ' +
4771
- 'id: ' + id
4772
- );
4773
- }
4802
+ if (process.env.NODE_ENV !== 'production' && type === 'component') {
4803
+ validateComponentName(id);
4774
4804
  }
4775
4805
  if (type === 'component' && isPlainObject(definition)) {
4776
4806
  definition.name = definition.name || id;
@@ -4977,7 +5007,7 @@ Object.defineProperty(Vue$3.prototype, '$ssrContext', {
4977
5007
  }
4978
5008
  });
4979
5009
 
4980
- Vue$3.version = '2.5.9';
5010
+ Vue$3.version = '2.5.13';
4981
5011
 
4982
5012
  /* */
4983
5013
 
@@ -5029,12 +5059,12 @@ function genClassForVnode (vnode) {
5029
5059
  var childNode = vnode;
5030
5060
  while (isDef(childNode.componentInstance)) {
5031
5061
  childNode = childNode.componentInstance._vnode;
5032
- if (childNode.data) {
5062
+ if (childNode && childNode.data) {
5033
5063
  data = mergeClassData(childNode.data, data);
5034
5064
  }
5035
5065
  }
5036
5066
  while (isDef(parentNode = parentNode.parent)) {
5037
- if (parentNode.data) {
5067
+ if (parentNode && parentNode.data) {
5038
5068
  data = mergeClassData(data, parentNode.data);
5039
5069
  }
5040
5070
  }
@@ -5545,11 +5575,14 @@ function createPatchFunction (backend) {
5545
5575
 
5546
5576
  function createChildren (vnode, children, insertedVnodeQueue) {
5547
5577
  if (Array.isArray(children)) {
5578
+ if (process.env.NODE_ENV !== 'production') {
5579
+ checkDuplicateKeys(children);
5580
+ }
5548
5581
  for (var i = 0; i < children.length; ++i) {
5549
5582
  createElm(children[i], insertedVnodeQueue, vnode.elm, null, true);
5550
5583
  }
5551
5584
  } else if (isPrimitive(vnode.text)) {
5552
- nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(vnode.text));
5585
+ nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text)));
5553
5586
  }
5554
5587
  }
5555
5588
 
@@ -5676,6 +5709,10 @@ function createPatchFunction (backend) {
5676
5709
  // during leaving transitions
5677
5710
  var canMove = !removeOnly;
5678
5711
 
5712
+ if (process.env.NODE_ENV !== 'production') {
5713
+ checkDuplicateKeys(newCh);
5714
+ }
5715
+
5679
5716
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
5680
5717
  if (isUndef(oldStartVnode)) {
5681
5718
  oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left
@@ -5708,13 +5745,6 @@ function createPatchFunction (backend) {
5708
5745
  createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm);
5709
5746
  } else {
5710
5747
  vnodeToMove = oldCh[idxInOld];
5711
- /* istanbul ignore if */
5712
- if (process.env.NODE_ENV !== 'production' && !vnodeToMove) {
5713
- warn(
5714
- 'It seems there are duplicate keys that is causing an update error. ' +
5715
- 'Make sure each v-for item has a unique key.'
5716
- );
5717
- }
5718
5748
  if (sameVnode(vnodeToMove, newStartVnode)) {
5719
5749
  patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue);
5720
5750
  oldCh[idxInOld] = undefined;
@@ -5735,6 +5765,24 @@ function createPatchFunction (backend) {
5735
5765
  }
5736
5766
  }
5737
5767
 
5768
+ function checkDuplicateKeys (children) {
5769
+ var seenKeys = {};
5770
+ for (var i = 0; i < children.length; i++) {
5771
+ var vnode = children[i];
5772
+ var key = vnode.key;
5773
+ if (isDef(key)) {
5774
+ if (seenKeys[key]) {
5775
+ warn(
5776
+ ("Duplicate keys detected: '" + key + "'. This may cause an update error."),
5777
+ vnode.context
5778
+ );
5779
+ } else {
5780
+ seenKeys[key] = true;
5781
+ }
5782
+ }
5783
+ }
5784
+ }
5785
+
5738
5786
  function findIdxInOld (node, oldCh, start, end) {
5739
5787
  for (var i = start; i < end; i++) {
5740
5788
  var c = oldCh[i];
@@ -6117,17 +6165,20 @@ function normalizeDirectives$1 (
6117
6165
  ) {
6118
6166
  var res = Object.create(null);
6119
6167
  if (!dirs) {
6168
+ // $flow-disable-line
6120
6169
  return res
6121
6170
  }
6122
6171
  var i, dir;
6123
6172
  for (i = 0; i < dirs.length; i++) {
6124
6173
  dir = dirs[i];
6125
6174
  if (!dir.modifiers) {
6175
+ // $flow-disable-line
6126
6176
  dir.modifiers = emptyModifiers;
6127
6177
  }
6128
6178
  res[getRawDirName(dir)] = dir;
6129
6179
  dir.def = resolveAsset(vm.$options, 'directives', dir.name, true);
6130
6180
  }
6181
+ // $flow-disable-line
6131
6182
  return res
6132
6183
  }
6133
6184
 
@@ -6297,6 +6348,9 @@ var klass = {
6297
6348
 
6298
6349
 
6299
6350
 
6351
+ // add a raw attr (use this in preTransforms)
6352
+
6353
+
6300
6354
 
6301
6355
 
6302
6356
 
@@ -6465,12 +6519,12 @@ function updateDOMProps (oldVnode, vnode) {
6465
6519
  function shouldUpdateValue (elm, checkVal) {
6466
6520
  return (!elm.composing && (
6467
6521
  elm.tagName === 'OPTION' ||
6468
- isDirty(elm, checkVal) ||
6469
- isInputChanged(elm, checkVal)
6522
+ isNotInFocusAndDirty(elm, checkVal) ||
6523
+ isDirtyWithModifiers(elm, checkVal)
6470
6524
  ))
6471
6525
  }
6472
6526
 
6473
- function isDirty (elm, checkVal) {
6527
+ function isNotInFocusAndDirty (elm, checkVal) {
6474
6528
  // return true when textbox (.number and .trim) loses focus and its value is
6475
6529
  // not equal to the updated value
6476
6530
  var notInFocus = true;
@@ -6480,14 +6534,20 @@ function isDirty (elm, checkVal) {
6480
6534
  return notInFocus && elm.value !== checkVal
6481
6535
  }
6482
6536
 
6483
- function isInputChanged (elm, newVal) {
6537
+ function isDirtyWithModifiers (elm, newVal) {
6484
6538
  var value = elm.value;
6485
6539
  var modifiers = elm._vModifiers; // injected by v-model runtime
6486
- if (isDef(modifiers) && modifiers.number) {
6487
- return toNumber(value) !== toNumber(newVal)
6488
- }
6489
- if (isDef(modifiers) && modifiers.trim) {
6490
- return value.trim() !== newVal.trim()
6540
+ if (isDef(modifiers)) {
6541
+ if (modifiers.lazy) {
6542
+ // inputs with lazy should only be updated when not in focus
6543
+ return false
6544
+ }
6545
+ if (modifiers.number) {
6546
+ return toNumber(value) !== toNumber(newVal)
6547
+ }
6548
+ if (modifiers.trim) {
6549
+ return value.trim() !== newVal.trim()
6550
+ }
6491
6551
  }
6492
6552
  return value !== newVal
6493
6553
  }
@@ -6545,7 +6605,10 @@ function getStyle (vnode, checkChild) {
6545
6605
  var childNode = vnode;
6546
6606
  while (childNode.componentInstance) {
6547
6607
  childNode = childNode.componentInstance._vnode;
6548
- if (childNode.data && (styleData = normalizeStyleData(childNode.data))) {
6608
+ if (
6609
+ childNode && childNode.data &&
6610
+ (styleData = normalizeStyleData(childNode.data))
6611
+ ) {
6549
6612
  extend(res, styleData);
6550
6613
  }
6551
6614
  }
@@ -7701,7 +7764,7 @@ var TransitionGroup = {
7701
7764
  this._vnode,
7702
7765
  this.kept,
7703
7766
  false, // hydrating
7704
- true // removeOnly (!important, avoids unnecessary moves)
7767
+ true // removeOnly (!important avoids unnecessary moves)
7705
7768
  );
7706
7769
  this._vnode = this.kept;
7707
7770
  },