vuejs 1.0.22 → 1.0.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vuejs/version.rb +1 -1
- data/vendor/assets/javascripts/vue.js +237 -139
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9b884d876ff204b6d451015e5c943802e5de94c
|
4
|
+
data.tar.gz: ab4add787fb074248a2c9b964a6e6300e0bc9eff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a3792ed517447ecffcb0a3289604de7e1871e7203fd1842a19df30cf0068cf40f3990dedc2ef813f346ca50528126e80c74edd47a0c9b042798bade34dca933
|
7
|
+
data.tar.gz: e25ae465a8759d64d04e40c7265d4e2328a8258bf421ed909eb2ed96bd02f60e6b42f10b028b7e5dd05f87cf941743689c950ba3ebb5b122e213a955d5284a5c
|
data/lib/vuejs/version.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Vue.js v1.0.
|
2
|
+
* Vue.js v1.0.22
|
3
3
|
* (c) 2016 Evan You
|
4
4
|
* Released under the MIT License.
|
5
5
|
*/
|
@@ -50,6 +50,10 @@
|
|
50
50
|
delete obj[key];
|
51
51
|
var ob = obj.__ob__;
|
52
52
|
if (!ob) {
|
53
|
+
if (obj._isVue) {
|
54
|
+
delete obj._data[key];
|
55
|
+
obj._digest();
|
56
|
+
}
|
53
57
|
return;
|
54
58
|
}
|
55
59
|
ob.dep.notify();
|
@@ -400,6 +404,8 @@
|
|
400
404
|
var UA = inBrowser && window.navigator.userAgent.toLowerCase();
|
401
405
|
var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
|
402
406
|
var isAndroid = UA && UA.indexOf('android') > 0;
|
407
|
+
var isIos = UA && /(iphone|ipad|ipod|ios)/i.test(UA);
|
408
|
+
var isWechat = UA && UA.indexOf('micromessenger') > 0;
|
403
409
|
|
404
410
|
var transitionProp = undefined;
|
405
411
|
var transitionEndEvent = undefined;
|
@@ -440,7 +446,7 @@
|
|
440
446
|
}
|
441
447
|
|
442
448
|
/* istanbul ignore if */
|
443
|
-
if (typeof MutationObserver !== 'undefined') {
|
449
|
+
if (typeof MutationObserver !== 'undefined' && !(isWechat && isIos)) {
|
444
450
|
var counter = 1;
|
445
451
|
var observer = new MutationObserver(nextTickHandler);
|
446
452
|
var textNode = document.createTextNode(counter);
|
@@ -469,6 +475,27 @@
|
|
469
475
|
};
|
470
476
|
})();
|
471
477
|
|
478
|
+
var _Set = undefined;
|
479
|
+
/* istanbul ignore if */
|
480
|
+
if (typeof Set !== 'undefined' && Set.toString().match(/native code/)) {
|
481
|
+
// use native Set when available.
|
482
|
+
_Set = Set;
|
483
|
+
} else {
|
484
|
+
// a non-standard Set polyfill that only works with primitive keys.
|
485
|
+
_Set = function () {
|
486
|
+
this.set = Object.create(null);
|
487
|
+
};
|
488
|
+
_Set.prototype.has = function (key) {
|
489
|
+
return this.set[key] !== undefined;
|
490
|
+
};
|
491
|
+
_Set.prototype.add = function (key) {
|
492
|
+
this.set[key] = 1;
|
493
|
+
};
|
494
|
+
_Set.prototype.clear = function () {
|
495
|
+
this.set = Object.create(null);
|
496
|
+
};
|
497
|
+
}
|
498
|
+
|
472
499
|
function Cache(limit) {
|
473
500
|
this.size = 0;
|
474
501
|
this.limit = limit;
|
@@ -1549,7 +1576,7 @@ var transition = Object.freeze({
|
|
1549
1576
|
if (resolveAsset(options, 'components', tag)) {
|
1550
1577
|
return { id: tag };
|
1551
1578
|
} else {
|
1552
|
-
var is = hasAttrs && getIsBinding(el);
|
1579
|
+
var is = hasAttrs && getIsBinding(el, options);
|
1553
1580
|
if (is) {
|
1554
1581
|
return is;
|
1555
1582
|
} else if ('development' !== 'production') {
|
@@ -1562,7 +1589,7 @@ var transition = Object.freeze({
|
|
1562
1589
|
}
|
1563
1590
|
}
|
1564
1591
|
} else if (hasAttrs) {
|
1565
|
-
return getIsBinding(el);
|
1592
|
+
return getIsBinding(el, options);
|
1566
1593
|
}
|
1567
1594
|
}
|
1568
1595
|
|
@@ -1570,14 +1597,18 @@ var transition = Object.freeze({
|
|
1570
1597
|
* Get "is" binding from an element.
|
1571
1598
|
*
|
1572
1599
|
* @param {Element} el
|
1600
|
+
* @param {Object} options
|
1573
1601
|
* @return {Object|undefined}
|
1574
1602
|
*/
|
1575
1603
|
|
1576
|
-
function getIsBinding(el) {
|
1604
|
+
function getIsBinding(el, options) {
|
1577
1605
|
// dynamic syntax
|
1578
|
-
var exp =
|
1606
|
+
var exp = el.getAttribute('is');
|
1579
1607
|
if (exp != null) {
|
1580
|
-
|
1608
|
+
if (resolveAsset(options, 'components', exp)) {
|
1609
|
+
el.removeAttribute('is');
|
1610
|
+
return { id: exp };
|
1611
|
+
}
|
1581
1612
|
} else {
|
1582
1613
|
exp = getBindAttr(el, 'is');
|
1583
1614
|
if (exp != null) {
|
@@ -1688,7 +1719,7 @@ var transition = Object.freeze({
|
|
1688
1719
|
*/
|
1689
1720
|
|
1690
1721
|
function mergeAssets(parentVal, childVal) {
|
1691
|
-
var res = Object.create(parentVal);
|
1722
|
+
var res = Object.create(parentVal || null);
|
1692
1723
|
return childVal ? extend(res, guardArrayAssets(childVal)) : res;
|
1693
1724
|
}
|
1694
1725
|
|
@@ -1847,8 +1878,16 @@ var transition = Object.freeze({
|
|
1847
1878
|
function mergeOptions(parent, child, vm) {
|
1848
1879
|
guardComponents(child);
|
1849
1880
|
guardProps(child);
|
1881
|
+
if ('development' !== 'production') {
|
1882
|
+
if (child.propsData && !vm) {
|
1883
|
+
warn('propsData can only be used as an instantiation option.');
|
1884
|
+
}
|
1885
|
+
}
|
1850
1886
|
var options = {};
|
1851
1887
|
var key;
|
1888
|
+
if (child['extends']) {
|
1889
|
+
parent = typeof child['extends'] === 'function' ? mergeOptions(parent, child['extends'].options, vm) : mergeOptions(parent, child['extends'], vm);
|
1890
|
+
}
|
1852
1891
|
if (child.mixins) {
|
1853
1892
|
for (var i = 0, l = child.mixins.length; i < l; i++) {
|
1854
1893
|
parent = mergeOptions(parent, child.mixins[i], vm);
|
@@ -2281,11 +2320,14 @@ var transition = Object.freeze({
|
|
2281
2320
|
devtools: devtools,
|
2282
2321
|
isIE9: isIE9,
|
2283
2322
|
isAndroid: isAndroid,
|
2323
|
+
isIos: isIos,
|
2324
|
+
isWechat: isWechat,
|
2284
2325
|
get transitionProp () { return transitionProp; },
|
2285
2326
|
get transitionEndEvent () { return transitionEndEvent; },
|
2286
2327
|
get animationProp () { return animationProp; },
|
2287
2328
|
get animationEndEvent () { return animationEndEvent; },
|
2288
2329
|
nextTick: nextTick,
|
2330
|
+
get _Set () { return _Set; },
|
2289
2331
|
query: query,
|
2290
2332
|
inDoc: inDoc,
|
2291
2333
|
getAttr: getAttr,
|
@@ -2398,14 +2440,9 @@ var transition = Object.freeze({
|
|
2398
2440
|
this._updateRef();
|
2399
2441
|
|
2400
2442
|
// initialize data as empty object.
|
2401
|
-
// it will be filled up in
|
2443
|
+
// it will be filled up in _initData().
|
2402
2444
|
this._data = {};
|
2403
2445
|
|
2404
|
-
// save raw constructor data before merge
|
2405
|
-
// so that we know which properties are provided at
|
2406
|
-
// instantiation.
|
2407
|
-
this._runtimeData = options.data;
|
2408
|
-
|
2409
2446
|
// call init hook
|
2410
2447
|
this._callHook('init');
|
2411
2448
|
|
@@ -2955,24 +2992,22 @@ var expression = Object.freeze({
|
|
2955
2992
|
// triggered, the DOM would have already been in updated
|
2956
2993
|
// state.
|
2957
2994
|
|
2958
|
-
var queueIndex;
|
2959
2995
|
var queue = [];
|
2960
2996
|
var userQueue = [];
|
2961
2997
|
var has = {};
|
2962
2998
|
var circular = {};
|
2963
2999
|
var waiting = false;
|
2964
|
-
var internalQueueDepleted = false;
|
2965
3000
|
|
2966
3001
|
/**
|
2967
3002
|
* Reset the batcher's state.
|
2968
3003
|
*/
|
2969
3004
|
|
2970
3005
|
function resetBatcherState() {
|
2971
|
-
queue =
|
2972
|
-
userQueue =
|
3006
|
+
queue.length = 0;
|
3007
|
+
userQueue.length = 0;
|
2973
3008
|
has = {};
|
2974
3009
|
circular = {};
|
2975
|
-
waiting =
|
3010
|
+
waiting = false;
|
2976
3011
|
}
|
2977
3012
|
|
2978
3013
|
/**
|
@@ -2981,8 +3016,12 @@ var expression = Object.freeze({
|
|
2981
3016
|
|
2982
3017
|
function flushBatcherQueue() {
|
2983
3018
|
runBatcherQueue(queue);
|
2984
|
-
|
3019
|
+
queue.length = 0;
|
2985
3020
|
runBatcherQueue(userQueue);
|
3021
|
+
// user watchers triggered more internal watchers
|
3022
|
+
if (queue.length) {
|
3023
|
+
runBatcherQueue(queue);
|
3024
|
+
}
|
2986
3025
|
// dev tool hook
|
2987
3026
|
/* istanbul ignore if */
|
2988
3027
|
if (devtools && config.devtools) {
|
@@ -3000,8 +3039,8 @@ var expression = Object.freeze({
|
|
3000
3039
|
function runBatcherQueue(queue) {
|
3001
3040
|
// do not cache length because more watchers might be pushed
|
3002
3041
|
// as we run existing watchers
|
3003
|
-
for (
|
3004
|
-
var watcher = queue[
|
3042
|
+
for (var i = 0; i < queue.length; i++) {
|
3043
|
+
var watcher = queue[i];
|
3005
3044
|
var id = watcher.id;
|
3006
3045
|
has[id] = null;
|
3007
3046
|
watcher.run();
|
@@ -3030,20 +3069,14 @@ var expression = Object.freeze({
|
|
3030
3069
|
function pushWatcher(watcher) {
|
3031
3070
|
var id = watcher.id;
|
3032
3071
|
if (has[id] == null) {
|
3033
|
-
|
3034
|
-
|
3035
|
-
|
3036
|
-
|
3037
|
-
|
3038
|
-
|
3039
|
-
|
3040
|
-
|
3041
|
-
q.push(watcher);
|
3042
|
-
// queue the flush
|
3043
|
-
if (!waiting) {
|
3044
|
-
waiting = true;
|
3045
|
-
nextTick(flushBatcherQueue);
|
3046
|
-
}
|
3072
|
+
// push watcher into appropriate queue
|
3073
|
+
var q = watcher.user ? userQueue : queue;
|
3074
|
+
has[id] = q.length;
|
3075
|
+
q.push(watcher);
|
3076
|
+
// queue the flush
|
3077
|
+
if (!waiting) {
|
3078
|
+
waiting = true;
|
3079
|
+
nextTick(flushBatcherQueue);
|
3047
3080
|
}
|
3048
3081
|
}
|
3049
3082
|
}
|
@@ -3084,8 +3117,8 @@ var expression = Object.freeze({
|
|
3084
3117
|
this.dirty = this.lazy; // for lazy watchers
|
3085
3118
|
this.deps = [];
|
3086
3119
|
this.newDeps = [];
|
3087
|
-
this.depIds =
|
3088
|
-
this.newDepIds =
|
3120
|
+
this.depIds = new _Set();
|
3121
|
+
this.newDepIds = new _Set();
|
3089
3122
|
this.prevError = null; // for async error stacks
|
3090
3123
|
// parse expression for getter/setter
|
3091
3124
|
if (isFn) {
|
@@ -3177,8 +3210,6 @@ var expression = Object.freeze({
|
|
3177
3210
|
|
3178
3211
|
Watcher.prototype.beforeGet = function () {
|
3179
3212
|
Dep.target = this;
|
3180
|
-
this.newDepIds = Object.create(null);
|
3181
|
-
this.newDeps.length = 0;
|
3182
3213
|
};
|
3183
3214
|
|
3184
3215
|
/**
|
@@ -3189,10 +3220,10 @@ var expression = Object.freeze({
|
|
3189
3220
|
|
3190
3221
|
Watcher.prototype.addDep = function (dep) {
|
3191
3222
|
var id = dep.id;
|
3192
|
-
if (!this.newDepIds
|
3193
|
-
this.newDepIds
|
3223
|
+
if (!this.newDepIds.has(id)) {
|
3224
|
+
this.newDepIds.add(id);
|
3194
3225
|
this.newDeps.push(dep);
|
3195
|
-
if (!this.depIds
|
3226
|
+
if (!this.depIds.has(id)) {
|
3196
3227
|
dep.addSub(this);
|
3197
3228
|
}
|
3198
3229
|
}
|
@@ -3207,14 +3238,18 @@ var expression = Object.freeze({
|
|
3207
3238
|
var i = this.deps.length;
|
3208
3239
|
while (i--) {
|
3209
3240
|
var dep = this.deps[i];
|
3210
|
-
if (!this.newDepIds
|
3241
|
+
if (!this.newDepIds.has(dep.id)) {
|
3211
3242
|
dep.removeSub(this);
|
3212
3243
|
}
|
3213
3244
|
}
|
3245
|
+
var tmp = this.depIds;
|
3214
3246
|
this.depIds = this.newDepIds;
|
3215
|
-
|
3247
|
+
this.newDepIds = tmp;
|
3248
|
+
this.newDepIds.clear();
|
3249
|
+
tmp = this.deps;
|
3216
3250
|
this.deps = this.newDeps;
|
3217
3251
|
this.newDeps = tmp;
|
3252
|
+
this.newDeps.length = 0;
|
3218
3253
|
};
|
3219
3254
|
|
3220
3255
|
/**
|
@@ -3338,15 +3373,33 @@ var expression = Object.freeze({
|
|
3338
3373
|
* @param {*} val
|
3339
3374
|
*/
|
3340
3375
|
|
3341
|
-
|
3342
|
-
|
3343
|
-
|
3344
|
-
|
3345
|
-
|
3346
|
-
|
3347
|
-
|
3348
|
-
|
3349
|
-
|
3376
|
+
var seenObjects = new _Set();
|
3377
|
+
function traverse(val, seen) {
|
3378
|
+
var i = undefined,
|
3379
|
+
keys = undefined;
|
3380
|
+
if (!seen) {
|
3381
|
+
seen = seenObjects;
|
3382
|
+
seen.clear();
|
3383
|
+
}
|
3384
|
+
var isA = isArray(val);
|
3385
|
+
var isO = isObject(val);
|
3386
|
+
if (isA || isO) {
|
3387
|
+
if (val.__ob__) {
|
3388
|
+
var depId = val.__ob__.dep.id;
|
3389
|
+
if (seen.has(depId)) {
|
3390
|
+
return;
|
3391
|
+
} else {
|
3392
|
+
seen.add(depId);
|
3393
|
+
}
|
3394
|
+
}
|
3395
|
+
if (isA) {
|
3396
|
+
i = val.length;
|
3397
|
+
while (i--) traverse(val[i], seen);
|
3398
|
+
} else if (isO) {
|
3399
|
+
keys = Object.keys(val);
|
3400
|
+
i = keys.length;
|
3401
|
+
while (i--) traverse(val[keys[i]], seen);
|
3402
|
+
}
|
3350
3403
|
}
|
3351
3404
|
}
|
3352
3405
|
|
@@ -3455,10 +3508,13 @@ var expression = Object.freeze({
|
|
3455
3508
|
|
3456
3509
|
function nodeToFragment(node) {
|
3457
3510
|
// if its a template tag and the browser supports it,
|
3458
|
-
// its content is already a document fragment.
|
3511
|
+
// its content is already a document fragment. However, iOS Safari has
|
3512
|
+
// bug when using directly cloned template content with touch
|
3513
|
+
// events and can cause crashes when the nodes are removed from DOM, so we
|
3514
|
+
// have to treat template elements as string templates. (#2805)
|
3515
|
+
/* istanbul ignore if */
|
3459
3516
|
if (isRealTemplate(node)) {
|
3460
|
-
|
3461
|
-
return node.content;
|
3517
|
+
return stringToFragment(node.innerHTML);
|
3462
3518
|
}
|
3463
3519
|
// script template
|
3464
3520
|
if (node.tagName === 'SCRIPT') {
|
@@ -3854,7 +3910,7 @@ var template = Object.freeze({
|
|
3854
3910
|
this.vm = vm;
|
3855
3911
|
var template;
|
3856
3912
|
var isString = typeof el === 'string';
|
3857
|
-
if (isString || isTemplate(el)) {
|
3913
|
+
if (isString || isTemplate(el) && !el.hasAttribute('v-if')) {
|
3858
3914
|
template = parseTemplate(el, true);
|
3859
3915
|
} else {
|
3860
3916
|
template = document.createDocumentFragment();
|
@@ -4196,7 +4252,15 @@ var template = Object.freeze({
|
|
4196
4252
|
});
|
4197
4253
|
setTimeout(op, staggerAmount);
|
4198
4254
|
} else {
|
4199
|
-
|
4255
|
+
var target = prevEl.nextSibling;
|
4256
|
+
/* istanbul ignore if */
|
4257
|
+
if (!target) {
|
4258
|
+
// reset end anchor position in case the position was messed up
|
4259
|
+
// by an external drag-n-drop library.
|
4260
|
+
after(this.end, prevEl);
|
4261
|
+
target = this.end;
|
4262
|
+
}
|
4263
|
+
frag.before(target);
|
4200
4264
|
}
|
4201
4265
|
},
|
4202
4266
|
|
@@ -4267,7 +4331,7 @@ var template = Object.freeze({
|
|
4267
4331
|
var primitive = !isObject(value);
|
4268
4332
|
var id;
|
4269
4333
|
if (key || trackByKey || primitive) {
|
4270
|
-
id =
|
4334
|
+
id = getTrackByKey(index, key, value, trackByKey);
|
4271
4335
|
if (!cache[id]) {
|
4272
4336
|
cache[id] = frag;
|
4273
4337
|
} else if (trackByKey !== '$index') {
|
@@ -4281,8 +4345,10 @@ var template = Object.freeze({
|
|
4281
4345
|
} else {
|
4282
4346
|
'development' !== 'production' && this.warnDuplicate(value);
|
4283
4347
|
}
|
4284
|
-
} else {
|
4348
|
+
} else if (Object.isExtensible(value)) {
|
4285
4349
|
def(value, id, frag);
|
4350
|
+
} else if ('development' !== 'production') {
|
4351
|
+
warn('Frozen v-for objects cannot be automatically tracked, make sure to ' + 'provide a track-by key.');
|
4286
4352
|
}
|
4287
4353
|
}
|
4288
4354
|
frag.raw = value;
|
@@ -4302,7 +4368,7 @@ var template = Object.freeze({
|
|
4302
4368
|
var primitive = !isObject(value);
|
4303
4369
|
var frag;
|
4304
4370
|
if (key || trackByKey || primitive) {
|
4305
|
-
var id =
|
4371
|
+
var id = getTrackByKey(index, key, value, trackByKey);
|
4306
4372
|
frag = this.cache[id];
|
4307
4373
|
} else {
|
4308
4374
|
frag = value[this.id];
|
@@ -4329,7 +4395,7 @@ var template = Object.freeze({
|
|
4329
4395
|
var key = hasOwn(scope, '$key') && scope.$key;
|
4330
4396
|
var primitive = !isObject(value);
|
4331
4397
|
if (trackByKey || key || primitive) {
|
4332
|
-
var id =
|
4398
|
+
var id = getTrackByKey(index, key, value, trackByKey);
|
4333
4399
|
this.cache[id] = null;
|
4334
4400
|
} else {
|
4335
4401
|
value[this.id] = null;
|
@@ -4479,6 +4545,19 @@ var template = Object.freeze({
|
|
4479
4545
|
return ret;
|
4480
4546
|
}
|
4481
4547
|
|
4548
|
+
/**
|
4549
|
+
* Get the track by key for an item.
|
4550
|
+
*
|
4551
|
+
* @param {Number} index
|
4552
|
+
* @param {String} key
|
4553
|
+
* @param {*} value
|
4554
|
+
* @param {String} [trackByKey]
|
4555
|
+
*/
|
4556
|
+
|
4557
|
+
function getTrackByKey(index, key, value, trackByKey) {
|
4558
|
+
return trackByKey ? trackByKey === '$index' ? index : trackByKey.charAt(0).match(/\w/) ? getPath(value, trackByKey) : value[trackByKey] : key || value;
|
4559
|
+
}
|
4560
|
+
|
4482
4561
|
if ('development' !== 'production') {
|
4483
4562
|
vFor.warnDuplicate = function (value) {
|
4484
4563
|
warn('Duplicate value found in v-for="' + this.descriptor.raw + '": ' + JSON.stringify(value) + '. Use track-by="$index" if ' + 'you are expecting duplicate values.', this.vm);
|
@@ -5080,7 +5159,7 @@ var template = Object.freeze({
|
|
5080
5159
|
}
|
5081
5160
|
// key filter
|
5082
5161
|
var keys = Object.keys(this.modifiers).filter(function (key) {
|
5083
|
-
return key !== 'stop' && key !== 'prevent' && key !== 'self';
|
5162
|
+
return key !== 'stop' && key !== 'prevent' && key !== 'self' && key !== 'capture';
|
5084
5163
|
});
|
5085
5164
|
if (keys.length) {
|
5086
5165
|
handler = keyFilter(handler, keys);
|
@@ -5209,6 +5288,12 @@ var template = Object.freeze({
|
|
5209
5288
|
}
|
5210
5289
|
var i = prefixes.length;
|
5211
5290
|
var prefixed;
|
5291
|
+
if (camel !== 'filter' && camel in testEl.style) {
|
5292
|
+
return {
|
5293
|
+
kebab: prop,
|
5294
|
+
camel: camel
|
5295
|
+
};
|
5296
|
+
}
|
5212
5297
|
while (i--) {
|
5213
5298
|
prefixed = camelPrefixes[i] + upper;
|
5214
5299
|
if (prefixed in testEl.style) {
|
@@ -5218,12 +5303,6 @@ var template = Object.freeze({
|
|
5218
5303
|
};
|
5219
5304
|
}
|
5220
5305
|
}
|
5221
|
-
if (camel in testEl.style) {
|
5222
|
-
return {
|
5223
|
-
kebab: prop,
|
5224
|
-
camel: camel
|
5225
|
-
};
|
5226
|
-
}
|
5227
5306
|
}
|
5228
5307
|
|
5229
5308
|
// xlink
|
@@ -5312,8 +5391,12 @@ var template = Object.freeze({
|
|
5312
5391
|
attr = camelize(attr);
|
5313
5392
|
}
|
5314
5393
|
if (!interp && attrWithPropsRE.test(attr) && attr in el) {
|
5315
|
-
|
5394
|
+
var attrValue = attr === 'value' ? value == null // IE9 will set input.value to "null" for null...
|
5316
5395
|
? '' : value : value;
|
5396
|
+
|
5397
|
+
if (el[attr] !== attrValue) {
|
5398
|
+
el[attr] = attrValue;
|
5399
|
+
}
|
5317
5400
|
}
|
5318
5401
|
// set model props
|
5319
5402
|
var modelProp = modelProps[attr];
|
@@ -5413,66 +5496,66 @@ var template = Object.freeze({
|
|
5413
5496
|
deep: true,
|
5414
5497
|
|
5415
5498
|
update: function update(value) {
|
5416
|
-
if (value
|
5417
|
-
this.handleObject(stringToObject(value));
|
5418
|
-
} else if (isPlainObject(value)) {
|
5419
|
-
this.handleObject(value);
|
5420
|
-
} else if (isArray(value)) {
|
5421
|
-
this.handleArray(value);
|
5422
|
-
} else {
|
5499
|
+
if (!value) {
|
5423
5500
|
this.cleanup();
|
5501
|
+
} else if (typeof value === 'string') {
|
5502
|
+
this.setClass(value.trim().split(/\s+/));
|
5503
|
+
} else {
|
5504
|
+
this.setClass(normalize$1(value));
|
5424
5505
|
}
|
5425
5506
|
},
|
5426
5507
|
|
5427
|
-
|
5428
|
-
this.cleanup(value);
|
5429
|
-
this.prevKeys = Object.keys(value);
|
5430
|
-
setObjectClasses(this.el, value);
|
5431
|
-
},
|
5432
|
-
|
5433
|
-
handleArray: function handleArray(value) {
|
5508
|
+
setClass: function setClass(value) {
|
5434
5509
|
this.cleanup(value);
|
5435
5510
|
for (var i = 0, l = value.length; i < l; i++) {
|
5436
5511
|
var val = value[i];
|
5437
|
-
if (val
|
5438
|
-
|
5439
|
-
} else if (val && typeof val === 'string') {
|
5440
|
-
addClass(this.el, val);
|
5512
|
+
if (val) {
|
5513
|
+
apply(this.el, val, addClass);
|
5441
5514
|
}
|
5442
5515
|
}
|
5443
|
-
this.prevKeys = value
|
5516
|
+
this.prevKeys = value;
|
5444
5517
|
},
|
5445
5518
|
|
5446
5519
|
cleanup: function cleanup(value) {
|
5447
|
-
|
5448
|
-
|
5449
|
-
var i =
|
5520
|
+
var prevKeys = this.prevKeys;
|
5521
|
+
if (!prevKeys) return;
|
5522
|
+
var i = prevKeys.length;
|
5450
5523
|
while (i--) {
|
5451
|
-
var key =
|
5452
|
-
if (!key)
|
5453
|
-
|
5454
|
-
var keys = isPlainObject(key) ? Object.keys(key) : [key];
|
5455
|
-
for (var j = 0, l = keys.length; j < l; j++) {
|
5456
|
-
toggleClasses(this.el, keys[j], removeClass);
|
5524
|
+
var key = prevKeys[i];
|
5525
|
+
if (!value || value.indexOf(key) < 0) {
|
5526
|
+
apply(this.el, key, removeClass);
|
5457
5527
|
}
|
5458
5528
|
}
|
5459
5529
|
}
|
5460
5530
|
};
|
5461
5531
|
|
5462
|
-
|
5463
|
-
|
5464
|
-
|
5465
|
-
|
5466
|
-
|
5467
|
-
|
5468
|
-
|
5469
|
-
}
|
5532
|
+
/**
|
5533
|
+
* Normalize objects and arrays (potentially containing objects)
|
5534
|
+
* into array of strings.
|
5535
|
+
*
|
5536
|
+
* @param {Object|Array<String|Object>} value
|
5537
|
+
* @return {Array<String>}
|
5538
|
+
*/
|
5470
5539
|
|
5471
|
-
function
|
5472
|
-
var res =
|
5473
|
-
|
5474
|
-
|
5475
|
-
|
5540
|
+
function normalize$1(value) {
|
5541
|
+
var res = [];
|
5542
|
+
if (isArray(value)) {
|
5543
|
+
for (var i = 0, l = value.length; i < l; i++) {
|
5544
|
+
var _key = value[i];
|
5545
|
+
if (_key) {
|
5546
|
+
if (typeof _key === 'string') {
|
5547
|
+
res.push(_key);
|
5548
|
+
} else {
|
5549
|
+
for (var k in _key) {
|
5550
|
+
if (_key[k]) res.push(k);
|
5551
|
+
}
|
5552
|
+
}
|
5553
|
+
}
|
5554
|
+
}
|
5555
|
+
} else if (isObject(value)) {
|
5556
|
+
for (var key in value) {
|
5557
|
+
if (value[key]) res.push(key);
|
5558
|
+
}
|
5476
5559
|
}
|
5477
5560
|
return res;
|
5478
5561
|
}
|
@@ -5488,14 +5571,12 @@ var template = Object.freeze({
|
|
5488
5571
|
* @param {Function} fn
|
5489
5572
|
*/
|
5490
5573
|
|
5491
|
-
function
|
5574
|
+
function apply(el, key, fn) {
|
5492
5575
|
key = key.trim();
|
5493
|
-
|
5494
5576
|
if (key.indexOf(' ') === -1) {
|
5495
5577
|
fn(el, key);
|
5496
5578
|
return;
|
5497
5579
|
}
|
5498
|
-
|
5499
5580
|
// The key contains one or more space characters.
|
5500
5581
|
// Since a class name doesn't accept such characters, we
|
5501
5582
|
// treat it as multiple classes.
|
@@ -5546,6 +5627,7 @@ var template = Object.freeze({
|
|
5546
5627
|
// cached, when the component is used elsewhere this attribute
|
5547
5628
|
// will remain at link time.
|
5548
5629
|
this.el.removeAttribute('is');
|
5630
|
+
this.el.removeAttribute(':is');
|
5549
5631
|
// remove ref, same as above
|
5550
5632
|
if (this.descriptor.ref) {
|
5551
5633
|
this.el.removeAttribute('v-ref:' + hyphenate(this.descriptor.ref));
|
@@ -5980,6 +6062,7 @@ var template = Object.freeze({
|
|
5980
6062
|
return function propsLinkFn(vm, scope) {
|
5981
6063
|
// store resolved props info
|
5982
6064
|
vm._props = {};
|
6065
|
+
var inlineProps = vm.$options.propsData;
|
5983
6066
|
var i = props.length;
|
5984
6067
|
var prop, path, options, value, raw;
|
5985
6068
|
while (i--) {
|
@@ -5988,7 +6071,9 @@ var template = Object.freeze({
|
|
5988
6071
|
path = prop.path;
|
5989
6072
|
options = prop.options;
|
5990
6073
|
vm._props[path] = prop;
|
5991
|
-
if (
|
6074
|
+
if (inlineProps && hasOwn(inlineProps, path)) {
|
6075
|
+
initProp(vm, prop, inlineProps[path]);
|
6076
|
+
}if (raw === null) {
|
5992
6077
|
// initialize absent prop
|
5993
6078
|
initProp(vm, prop, undefined);
|
5994
6079
|
} else if (prop.dynamic) {
|
@@ -6749,7 +6834,7 @@ var template = Object.freeze({
|
|
6749
6834
|
// link function for the node itself.
|
6750
6835
|
var nodeLinkFn = partial || !options._asComponent ? compileNode(el, options) : null;
|
6751
6836
|
// link function for the childNodes
|
6752
|
-
var childLinkFn = !(nodeLinkFn && nodeLinkFn.terminal) && el
|
6837
|
+
var childLinkFn = !(nodeLinkFn && nodeLinkFn.terminal) && !isScript(el) && el.hasChildNodes() ? compileNodeList(el.childNodes, options) : null;
|
6753
6838
|
|
6754
6839
|
/**
|
6755
6840
|
* A composite linker function to be called on a already
|
@@ -6925,7 +7010,7 @@ var template = Object.freeze({
|
|
6925
7010
|
});
|
6926
7011
|
if (names.length) {
|
6927
7012
|
var plural = names.length > 1;
|
6928
|
-
warn('Attribute' + (plural ? 's ' : ' ') + names.join(', ') + (plural ? ' are' : ' is') + ' ignored on component ' + '<' + options.el.tagName.toLowerCase() + '> because ' + 'the component is a fragment instance: ' + 'http://vuejs.org/guide/components.html#
|
7013
|
+
warn('Attribute' + (plural ? 's ' : ' ') + names.join(', ') + (plural ? ' are' : ' is') + ' ignored on component ' + '<' + options.el.tagName.toLowerCase() + '> because ' + 'the component is a fragment instance: ' + 'http://vuejs.org/guide/components.html#Fragment-Instance');
|
6929
7014
|
}
|
6930
7015
|
}
|
6931
7016
|
|
@@ -6962,7 +7047,7 @@ var template = Object.freeze({
|
|
6962
7047
|
|
6963
7048
|
function compileNode(node, options) {
|
6964
7049
|
var type = node.nodeType;
|
6965
|
-
if (type === 1 && node
|
7050
|
+
if (type === 1 && !isScript(node)) {
|
6966
7051
|
return compileElement(node, options);
|
6967
7052
|
} else if (type === 3 && node.data.trim()) {
|
6968
7053
|
return compileTextNode(node, options);
|
@@ -7257,7 +7342,6 @@ var template = Object.freeze({
|
|
7257
7342
|
var attr, name, value, modifiers, matched, dirName, rawName, arg, def, termDef;
|
7258
7343
|
for (var i = 0, j = attrs.length; i < j; i++) {
|
7259
7344
|
attr = attrs[i];
|
7260
|
-
modifiers = parseModifiers(attr.name);
|
7261
7345
|
name = attr.name.replace(modifierRE, '');
|
7262
7346
|
if (matched = name.match(dirAttrRE)) {
|
7263
7347
|
def = resolveAsset(options, 'directives', matched[1]);
|
@@ -7265,6 +7349,7 @@ var template = Object.freeze({
|
|
7265
7349
|
if (!termDef || (def.priority || DEFAULT_TERMINAL_PRIORITY) > termDef.priority) {
|
7266
7350
|
termDef = def;
|
7267
7351
|
rawName = attr.name;
|
7352
|
+
modifiers = parseModifiers(attr.name);
|
7268
7353
|
value = attr.value;
|
7269
7354
|
dirName = matched[1];
|
7270
7355
|
arg = matched[2];
|
@@ -7485,6 +7570,10 @@ var template = Object.freeze({
|
|
7485
7570
|
}
|
7486
7571
|
}
|
7487
7572
|
|
7573
|
+
function isScript(el) {
|
7574
|
+
return el.tagName === 'SCRIPT' && (!el.hasAttribute('type') || el.getAttribute('type') === 'text/javascript');
|
7575
|
+
}
|
7576
|
+
|
7488
7577
|
var specialCharRE = /[^\w\-:\.]/;
|
7489
7578
|
|
7490
7579
|
/**
|
@@ -7614,8 +7703,8 @@ var template = Object.freeze({
|
|
7614
7703
|
value = attrs[i].value;
|
7615
7704
|
if (!to.hasAttribute(name) && !specialCharRE.test(name)) {
|
7616
7705
|
to.setAttribute(name, value);
|
7617
|
-
} else if (name === 'class' && !parseText(value)) {
|
7618
|
-
value.
|
7706
|
+
} else if (name === 'class' && !parseText(value) && (value = value.trim())) {
|
7707
|
+
value.split(/\s+/).forEach(function (cls) {
|
7619
7708
|
addClass(to, cls);
|
7620
7709
|
});
|
7621
7710
|
}
|
@@ -7654,6 +7743,10 @@ var template = Object.freeze({
|
|
7654
7743
|
contents[name] = extractFragment(contents[name], content);
|
7655
7744
|
}
|
7656
7745
|
if (content.hasChildNodes()) {
|
7746
|
+
var nodes = content.childNodes;
|
7747
|
+
if (nodes.length === 1 && nodes[0].nodeType === 3 && !nodes[0].data.trim()) {
|
7748
|
+
return;
|
7749
|
+
}
|
7657
7750
|
contents['default'] = extractFragment(content.childNodes, content);
|
7658
7751
|
}
|
7659
7752
|
}
|
@@ -7753,7 +7846,6 @@ var template = Object.freeze({
|
|
7753
7846
|
'development' !== 'production' && warn('data functions should return an object.', this);
|
7754
7847
|
}
|
7755
7848
|
var props = this._props;
|
7756
|
-
var runtimeData = this._runtimeData ? typeof this._runtimeData === 'function' ? this._runtimeData() : this._runtimeData : null;
|
7757
7849
|
// proxy data on instance
|
7758
7850
|
var keys = Object.keys(data);
|
7759
7851
|
var i, key;
|
@@ -7764,10 +7856,10 @@ var template = Object.freeze({
|
|
7764
7856
|
// 1. it's not already defined as a prop
|
7765
7857
|
// 2. it's provided via a instantiation option AND there are no
|
7766
7858
|
// template prop present
|
7767
|
-
if (!props || !hasOwn(props, key)
|
7859
|
+
if (!props || !hasOwn(props, key)) {
|
7768
7860
|
this._proxy(key);
|
7769
7861
|
} else if ('development' !== 'production') {
|
7770
|
-
warn('Data field "' + key + '" is already defined ' + 'as a prop.
|
7862
|
+
warn('Data field "' + key + '" is already defined ' + 'as a prop. To provide default value for a prop, use the "default" ' + 'prop option; if you want to pass prop values to an instantiation ' + 'call, use the "propsData" option.', this);
|
7771
7863
|
}
|
7772
7864
|
}
|
7773
7865
|
// observe data
|
@@ -7957,18 +8049,21 @@ var template = Object.freeze({
|
|
7957
8049
|
|
7958
8050
|
function registerComponentEvents(vm, el) {
|
7959
8051
|
var attrs = el.attributes;
|
7960
|
-
var name, handler;
|
8052
|
+
var name, value, handler;
|
7961
8053
|
for (var i = 0, l = attrs.length; i < l; i++) {
|
7962
8054
|
name = attrs[i].name;
|
7963
8055
|
if (eventRE.test(name)) {
|
7964
8056
|
name = name.replace(eventRE, '');
|
7965
|
-
|
7966
|
-
|
7967
|
-
|
7968
|
-
|
7969
|
-
|
7970
|
-
|
8057
|
+
// force the expression into a statement so that
|
8058
|
+
// it always dynamically resolves the method to call (#2670)
|
8059
|
+
// kinda ugly hack, but does the job.
|
8060
|
+
value = attrs[i].value;
|
8061
|
+
if (isSimplePath(value)) {
|
8062
|
+
value += '.apply(this, $arguments)';
|
7971
8063
|
}
|
8064
|
+
handler = (vm._scope || vm._context).$eval(value, true);
|
8065
|
+
handler._fromParent = true;
|
8066
|
+
vm.$on(name.replace(eventRE), handler);
|
7972
8067
|
}
|
7973
8068
|
}
|
7974
8069
|
}
|
@@ -8619,7 +8714,7 @@ var template = Object.freeze({
|
|
8619
8714
|
}
|
8620
8715
|
// remove reference from data ob
|
8621
8716
|
// frozen object may not have observer.
|
8622
|
-
if (this._data.__ob__) {
|
8717
|
+
if (this._data && this._data.__ob__) {
|
8623
8718
|
this._data.__ob__.removeVm(this);
|
8624
8719
|
}
|
8625
8720
|
// Clean up references to private properties and other
|
@@ -8692,6 +8787,7 @@ var template = Object.freeze({
|
|
8692
8787
|
} else {
|
8693
8788
|
factory = resolveAsset(this.$options, 'components', value, true);
|
8694
8789
|
}
|
8790
|
+
/* istanbul ignore if */
|
8695
8791
|
if (!factory) {
|
8696
8792
|
return;
|
8697
8793
|
}
|
@@ -8741,7 +8837,7 @@ var template = Object.freeze({
|
|
8741
8837
|
Vue.prototype.$get = function (exp, asStatement) {
|
8742
8838
|
var res = parseExpression(exp);
|
8743
8839
|
if (res) {
|
8744
|
-
if (asStatement
|
8840
|
+
if (asStatement) {
|
8745
8841
|
var self = this;
|
8746
8842
|
return function statementHandler() {
|
8747
8843
|
self.$arguments = toArray(arguments);
|
@@ -9673,17 +9769,19 @@ var template = Object.freeze({
|
|
9673
9769
|
* 12345 => $12,345.00
|
9674
9770
|
*
|
9675
9771
|
* @param {String} sign
|
9772
|
+
* @param {Number} decimals Decimal places
|
9676
9773
|
*/
|
9677
9774
|
|
9678
|
-
currency: function currency(value, _currency) {
|
9775
|
+
currency: function currency(value, _currency, decimals) {
|
9679
9776
|
value = parseFloat(value);
|
9680
9777
|
if (!isFinite(value) || !value && value !== 0) return '';
|
9681
9778
|
_currency = _currency != null ? _currency : '$';
|
9682
|
-
|
9683
|
-
var
|
9779
|
+
decimals = decimals != null ? decimals : 2;
|
9780
|
+
var stringified = Math.abs(value).toFixed(decimals);
|
9781
|
+
var _int = decimals ? stringified.slice(0, -1 - decimals) : stringified;
|
9684
9782
|
var i = _int.length % 3;
|
9685
9783
|
var head = i > 0 ? _int.slice(0, i) + (_int.length > 3 ? ',' : '') : '';
|
9686
|
-
var _float = stringified.slice(-
|
9784
|
+
var _float = decimals ? stringified.slice(-1 - decimals) : '';
|
9687
9785
|
var sign = value < 0 ? '-' : '';
|
9688
9786
|
return sign + _currency + head + _int.slice(i).replace(digitsRE, '$1,') + _float;
|
9689
9787
|
},
|
@@ -9903,7 +10001,7 @@ var template = Object.freeze({
|
|
9903
10001
|
|
9904
10002
|
installGlobalAPI(Vue);
|
9905
10003
|
|
9906
|
-
Vue.version = '1.0.
|
10004
|
+
Vue.version = '1.0.22';
|
9907
10005
|
|
9908
10006
|
// devtools global hook
|
9909
10007
|
/* istanbul ignore next */
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vuejs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.23
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bryan Lim
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|