ember-source 2.5.1 → 2.6.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/dist/ember-runtime.js +724 -536
- data/dist/ember-template-compiler.js +317 -175
- data/dist/ember-testing.js +42 -25
- data/dist/ember.debug.js +1135 -3397
- data/dist/ember.js +1135 -3397
- data/dist/ember.min.js +14 -15
- data/dist/ember.prod.js +1070 -3333
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fe27b26c635f95296bbcb34fc9f229e413bc6463
|
4
|
+
data.tar.gz: 389f5ea2e08951c91bc2f653125aeb9e4695ba03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a498d8373db0f9a6835806035c1836c8678006f9e2cda05794f841f4cb94d6a8ddab54a1aa4ef62a18f384faefc90d7372f189c4dee946237f56e74d60e53ef
|
7
|
+
data.tar.gz: c421b688d28e06cf7403369c93c3154112e1109a01b5442a841e5c6839c634de2d557abcb3a0e2b82091369ef2ecf644e00566d2690ba59058f290a2ba652e17
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.6.0-beta.1
|
data/dist/ember-runtime.js
CHANGED
@@ -6,10 +6,10 @@
|
|
6
6
|
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
|
7
7
|
* @license Licensed under MIT license
|
8
8
|
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
|
9
|
-
* @version 2.
|
9
|
+
* @version 2.6.0-beta.1
|
10
10
|
*/
|
11
11
|
|
12
|
-
var enifed, requireModule, require,
|
12
|
+
var enifed, requireModule, require, Ember;
|
13
13
|
var mainContext = this;
|
14
14
|
|
15
15
|
(function() {
|
@@ -20,7 +20,7 @@ var mainContext = this;
|
|
20
20
|
Ember = this.Ember = this.Ember || {};
|
21
21
|
}
|
22
22
|
|
23
|
-
if (typeof Ember === 'undefined') { Ember = {}; }
|
23
|
+
if (typeof Ember === 'undefined') { Ember = {}; }
|
24
24
|
|
25
25
|
if (typeof Ember.__loader === 'undefined') {
|
26
26
|
var registry = {};
|
@@ -40,9 +40,9 @@ var mainContext = this;
|
|
40
40
|
registry[name] = value;
|
41
41
|
};
|
42
42
|
|
43
|
-
|
43
|
+
require = requireModule = function(name) {
|
44
44
|
return internalRequire(name, null);
|
45
|
-
}
|
45
|
+
};
|
46
46
|
|
47
47
|
// setup `require` module
|
48
48
|
require['default'] = require;
|
@@ -83,7 +83,7 @@ var mainContext = this;
|
|
83
83
|
var deps = mod.deps;
|
84
84
|
var callback = mod.callback;
|
85
85
|
var length = deps.length;
|
86
|
-
var reified = new Array(length)
|
86
|
+
var reified = new Array(length);
|
87
87
|
|
88
88
|
for (var i = 0; i < length; i++) {
|
89
89
|
if (deps[i] === 'exports') {
|
@@ -98,9 +98,9 @@ var mainContext = this;
|
|
98
98
|
callback.apply(this, reified);
|
99
99
|
|
100
100
|
return exports;
|
101
|
-
}
|
101
|
+
}
|
102
102
|
|
103
|
-
|
103
|
+
requireModule._eak_seen = registry;
|
104
104
|
|
105
105
|
Ember.__loader = {
|
106
106
|
define: enifed,
|
@@ -109,7 +109,7 @@ var mainContext = this;
|
|
109
109
|
};
|
110
110
|
} else {
|
111
111
|
enifed = Ember.__loader.define;
|
112
|
-
|
112
|
+
require = requireModule = Ember.__loader.require;
|
113
113
|
}
|
114
114
|
})();
|
115
115
|
|
@@ -1178,11 +1178,8 @@ enifed('container/container', ['exports', 'ember-metal/core', 'ember-metal/debug
|
|
1178
1178
|
this.cache = _emberMetalDictionary.default(options && options.cache ? options.cache : null);
|
1179
1179
|
this.factoryCache = _emberMetalDictionary.default(options && options.factoryCache ? options.factoryCache : null);
|
1180
1180
|
this.validationCache = _emberMetalDictionary.default(options && options.validationCache ? options.validationCache : null);
|
1181
|
-
|
1182
|
-
|
1183
|
-
this._fakeContainerToInject = _emberRuntimeMixinsContainer_proxy.buildFakeContainerWithDeprecations(this);
|
1184
|
-
this[CONTAINER_OVERRIDE] = undefined;
|
1185
|
-
}
|
1181
|
+
this._fakeContainerToInject = _emberRuntimeMixinsContainer_proxy.buildFakeContainerWithDeprecations(this);
|
1182
|
+
this[CONTAINER_OVERRIDE] = undefined;
|
1186
1183
|
}
|
1187
1184
|
|
1188
1185
|
Container.prototype = {
|
@@ -1433,12 +1430,7 @@ enifed('container/container', ['exports', 'ember-metal/core', 'ember-metal/debug
|
|
1433
1430
|
var injectedFactory = factory.extend(injections);
|
1434
1431
|
|
1435
1432
|
// TODO - remove all `container` injections when Ember reaches v3.0.0
|
1436
|
-
|
1437
|
-
injectDeprecatedContainer(injectedFactory.prototype, container);
|
1438
|
-
} else {
|
1439
|
-
injectedFactory.prototype.container = container;
|
1440
|
-
}
|
1441
|
-
|
1433
|
+
injectDeprecatedContainer(injectedFactory.prototype, container);
|
1442
1434
|
injectedFactory.reopenClass(factoryInjections);
|
1443
1435
|
|
1444
1436
|
if (factory && typeof factory._onLookup === 'function') {
|
@@ -1515,21 +1507,14 @@ enifed('container/container', ['exports', 'ember-metal/core', 'ember-metal/debug
|
|
1515
1507
|
|
1516
1508
|
// Ensure that a container is available to an object during instantiation.
|
1517
1509
|
// TODO - remove when Ember reaches v3.0.0
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
injections.container = container._fakeContainerToInject;
|
1522
|
-
} else {
|
1523
|
-
injections.container = container;
|
1524
|
-
}
|
1525
|
-
|
1510
|
+
// This "fake" container will be replaced after instantiation with a
|
1511
|
+
// property that raises deprecations every time it is accessed.
|
1512
|
+
injections.container = container._fakeContainerToInject;
|
1526
1513
|
obj = factory.create(injections);
|
1527
1514
|
|
1528
1515
|
// TODO - remove when Ember reaches v3.0.0
|
1529
|
-
if (
|
1530
|
-
|
1531
|
-
injectDeprecatedContainer(obj, container);
|
1532
|
-
}
|
1516
|
+
if (!Object.isFrozen(obj) && 'container' in obj) {
|
1517
|
+
injectDeprecatedContainer(obj, container);
|
1533
1518
|
}
|
1534
1519
|
}
|
1535
1520
|
|
@@ -1696,9 +1681,11 @@ enifed('container/owner', ['exports', 'ember-metal/symbol'], function (exports,
|
|
1696
1681
|
object[OWNER] = owner;
|
1697
1682
|
}
|
1698
1683
|
});
|
1699
|
-
enifed('container/registry', ['exports', 'ember-metal/features', 'ember-metal/debug', 'ember-metal/dictionary', 'ember-metal/empty_object', 'ember-metal/assign', 'container/container'], function (exports, _emberMetalFeatures, _emberMetalDebug, _emberMetalDictionary, _emberMetalEmpty_object, _emberMetalAssign, _containerContainer) {
|
1684
|
+
enifed('container/registry', ['exports', 'ember-metal/features', 'ember-metal/debug', 'ember-metal/dictionary', 'ember-metal/empty_object', 'ember-metal/assign', 'container/container', 'ember-metal/utils'], function (exports, _emberMetalFeatures, _emberMetalDebug, _emberMetalDictionary, _emberMetalEmpty_object, _emberMetalAssign, _containerContainer, _emberMetalUtils) {
|
1700
1685
|
'use strict';
|
1701
1686
|
|
1687
|
+
exports.privatize = privatize;
|
1688
|
+
|
1702
1689
|
var VALID_FULL_NAME_REGEXP = /^[^:]+.+:[^:]+$/;
|
1703
1690
|
|
1704
1691
|
/**
|
@@ -2480,6 +2467,25 @@ enifed('container/registry', ['exports', 'ember-metal/features', 'ember-metal/de
|
|
2480
2467
|
return registry.resolve(fullName, { source: source }) !== undefined;
|
2481
2468
|
}
|
2482
2469
|
|
2470
|
+
var privateNames = _emberMetalDictionary.default(null);
|
2471
|
+
var privateSuffix = Math.floor(Math.random() * new Date()) + '';
|
2472
|
+
|
2473
|
+
function privatize(_ref) {
|
2474
|
+
var fullName = _ref[0];
|
2475
|
+
|
2476
|
+
var name = privateNames[fullName];
|
2477
|
+
if (name) {
|
2478
|
+
return name;
|
2479
|
+
}
|
2480
|
+
|
2481
|
+
var _fullName$split = fullName.split(':');
|
2482
|
+
|
2483
|
+
var type = _fullName$split[0];
|
2484
|
+
var rawName = _fullName$split[1];
|
2485
|
+
|
2486
|
+
return privateNames[fullName] = _emberMetalUtils.intern(type + ':' + rawName + '-' + privateSuffix);
|
2487
|
+
}
|
2488
|
+
|
2483
2489
|
exports.default = Registry;
|
2484
2490
|
});
|
2485
2491
|
enifed('ember-metal/alias', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/error', 'ember-metal/properties', 'ember-metal/computed', 'ember-metal/utils', 'ember-metal/meta', 'ember-metal/dependent_keys'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalError, _emberMetalProperties, _emberMetalComputed, _emberMetalUtils, _emberMetalMeta, _emberMetalDependent_keys) {
|
@@ -4067,7 +4073,7 @@ enifed('ember-metal/computed', ['exports', 'ember-metal/debug', 'ember-metal/pro
|
|
4067
4073
|
exports.computed = computed;
|
4068
4074
|
exports.cacheFor = cacheFor;
|
4069
4075
|
});
|
4070
|
-
enifed('ember-metal/computed_macros', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/computed', 'ember-metal/is_empty', 'ember-metal/is_none', 'ember-metal/alias'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalComputed, _emberMetalIs_empty, _emberMetalIs_none, _emberMetalAlias) {
|
4076
|
+
enifed('ember-metal/computed_macros', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/computed', 'ember-metal/is_empty', 'ember-metal/is_none', 'ember-metal/alias', 'ember-metal/expand_properties'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalComputed, _emberMetalIs_empty, _emberMetalIs_none, _emberMetalAlias, _emberMetalExpand_properties) {
|
4071
4077
|
'use strict';
|
4072
4078
|
|
4073
4079
|
exports.empty = empty;
|
@@ -4100,15 +4106,24 @@ enifed('ember-metal/computed_macros', ['exports', 'ember-metal/debug', 'ember-me
|
|
4100
4106
|
|
4101
4107
|
function generateComputedWithProperties(macro) {
|
4102
4108
|
return function () {
|
4109
|
+
var expandedProperties = [];
|
4110
|
+
var computedFunc = _emberMetalComputed.computed(function () {
|
4111
|
+
return macro.apply(this, [getProperties(this, expandedProperties)]);
|
4112
|
+
});
|
4113
|
+
|
4114
|
+
function extractProperty(entry) {
|
4115
|
+
expandedProperties.push(entry);
|
4116
|
+
}
|
4117
|
+
|
4103
4118
|
for (var _len = arguments.length, properties = Array(_len), _key = 0; _key < _len; _key++) {
|
4104
4119
|
properties[_key] = arguments[_key];
|
4105
4120
|
}
|
4106
4121
|
|
4107
|
-
var
|
4108
|
-
|
4109
|
-
}
|
4122
|
+
for (var i = 0; i < properties.length; i++) {
|
4123
|
+
_emberMetalExpand_properties.default(properties[i], extractProperty);
|
4124
|
+
}
|
4110
4125
|
|
4111
|
-
return computedFunc.property.apply(computedFunc,
|
4126
|
+
return computedFunc.property.apply(computedFunc, expandedProperties);
|
4112
4127
|
};
|
4113
4128
|
}
|
4114
4129
|
|
@@ -4497,22 +4512,30 @@ enifed('ember-metal/computed_macros', ['exports', 'ember-metal/debug', 'ember-me
|
|
4497
4512
|
A computed property that performs a logical `and` on the
|
4498
4513
|
original values for the provided dependent properties.
|
4499
4514
|
|
4515
|
+
You may pass in more than two properties and even use
|
4516
|
+
property brace expansion. The computed property will
|
4517
|
+
returns the first falsy value or last truthy value
|
4518
|
+
just like JavaScript's `||` operator.
|
4519
|
+
|
4500
4520
|
Example
|
4501
4521
|
|
4502
4522
|
```javascript
|
4503
4523
|
var Hamster = Ember.Object.extend({
|
4504
|
-
readyForCamp: Ember.computed.and('hasTent', 'hasBackpack')
|
4524
|
+
readyForCamp: Ember.computed.and('hasTent', 'hasBackpack'),
|
4525
|
+
readyForHike: Ember.computed.and('hasWalkingStick', 'hasBackpack')
|
4505
4526
|
});
|
4506
4527
|
|
4507
|
-
var
|
4508
|
-
|
4509
|
-
|
4510
|
-
|
4511
|
-
|
4512
|
-
|
4513
|
-
|
4514
|
-
|
4515
|
-
|
4528
|
+
var tomster = Hamster.create();
|
4529
|
+
|
4530
|
+
tomster.get('readyForCamp'); // false
|
4531
|
+
tomster.set('hasTent', true);
|
4532
|
+
tomster.get('readyForCamp'); // false
|
4533
|
+
tomster.set('hasBackpack', true);
|
4534
|
+
tomster.get('readyForCamp'); // true
|
4535
|
+
tomster.set('hasBackpack', 'Yes');
|
4536
|
+
tomster.get('readyForCamp'); // 'Yes'
|
4537
|
+
tomster.set('hasWalkingStick', null);
|
4538
|
+
tomster.get('readyForHike'); // null
|
4516
4539
|
```
|
4517
4540
|
|
4518
4541
|
@method and
|
@@ -4527,7 +4550,7 @@ enifed('ember-metal/computed_macros', ['exports', 'ember-metal/debug', 'ember-me
|
|
4527
4550
|
for (var key in properties) {
|
4528
4551
|
value = properties[key];
|
4529
4552
|
if (properties.hasOwnProperty(key) && !value) {
|
4530
|
-
return
|
4553
|
+
return value;
|
4531
4554
|
}
|
4532
4555
|
}
|
4533
4556
|
return value;
|
@@ -4538,20 +4561,28 @@ enifed('ember-metal/computed_macros', ['exports', 'ember-metal/debug', 'ember-me
|
|
4538
4561
|
A computed property which performs a logical `or` on the
|
4539
4562
|
original values for the provided dependent properties.
|
4540
4563
|
|
4564
|
+
You may pass in more than two properties and even use
|
4565
|
+
property brace expansion. The computed property will
|
4566
|
+
returns the first truthy value or last falsy value just
|
4567
|
+
like JavaScript's `||` operator.
|
4568
|
+
|
4541
4569
|
Example
|
4542
4570
|
|
4543
4571
|
```javascript
|
4544
4572
|
var Hamster = Ember.Object.extend({
|
4545
|
-
readyForRain: Ember.computed.or('hasJacket', 'hasUmbrella')
|
4573
|
+
readyForRain: Ember.computed.or('hasJacket', 'hasUmbrella'),
|
4574
|
+
readyForBeach: Ember.computed.or('{hasSunscreen,hasUmbrella}')
|
4546
4575
|
});
|
4547
4576
|
|
4548
|
-
var
|
4577
|
+
var tomster = Hamster.create();
|
4549
4578
|
|
4550
|
-
|
4551
|
-
|
4552
|
-
|
4553
|
-
|
4554
|
-
|
4579
|
+
tomster.get('readyForRain'); // undefined
|
4580
|
+
tomster.set('hasUmbrella', true);
|
4581
|
+
tomster.get('readyForRain'); // true
|
4582
|
+
tomster.set('hasJacket', 'Yes');
|
4583
|
+
tomster.get('readyForRain'); // 'Yes'
|
4584
|
+
tomster.set('hasSunscreen', 'Check');
|
4585
|
+
tomster.get('readyForBeach'); // 'Check'
|
4555
4586
|
```
|
4556
4587
|
|
4557
4588
|
@method or
|
@@ -4743,7 +4774,7 @@ enifed('ember-metal/core', ['exports', 'require'], function (exports, _require)
|
|
4743
4774
|
|
4744
4775
|
@class Ember
|
4745
4776
|
@static
|
4746
|
-
@version 2.
|
4777
|
+
@version 2.6.0-beta.1
|
4747
4778
|
@public
|
4748
4779
|
*/
|
4749
4780
|
|
@@ -4785,11 +4816,11 @@ enifed('ember-metal/core', ['exports', 'require'], function (exports, _require)
|
|
4785
4816
|
|
4786
4817
|
@property VERSION
|
4787
4818
|
@type String
|
4788
|
-
@default '2.
|
4819
|
+
@default '2.6.0-beta.1'
|
4789
4820
|
@static
|
4790
4821
|
@public
|
4791
4822
|
*/
|
4792
|
-
Ember.VERSION = '2.
|
4823
|
+
Ember.VERSION = '2.6.0-beta.1';
|
4793
4824
|
|
4794
4825
|
/**
|
4795
4826
|
The hash of environment variables used to control various configuration
|
@@ -5277,6 +5308,14 @@ enifed('ember-metal/events', ['exports', 'ember-metal/debug', 'ember-metal/utils
|
|
5277
5308
|
function addListener(obj, eventName, target, method, once) {
|
5278
5309
|
_emberMetalDebug.assert('You must pass at least an object and event name to Ember.addListener', !!obj && !!eventName);
|
5279
5310
|
|
5311
|
+
if (eventName === 'didInitAttrs' && obj.isComponent) {
|
5312
|
+
_emberMetalDebug.deprecate('[DEPRECATED] didInitAttrs called in ' + obj.toString() + '.', false, {
|
5313
|
+
id: 'ember-views.did-init-attrs',
|
5314
|
+
until: '3.0.0',
|
5315
|
+
url: 'http://emberjs.com/deprecations/v2.x#toc_ember-component-didinitattrs'
|
5316
|
+
});
|
5317
|
+
}
|
5318
|
+
|
5280
5319
|
if (!method && 'function' === typeof target) {
|
5281
5320
|
method = target;
|
5282
5321
|
target = null;
|
@@ -5895,11 +5934,8 @@ enifed('ember-metal/index', ['exports', 'require', 'ember-metal/core', 'ember-me
|
|
5895
5934
|
_require.default('ember-debug');
|
5896
5935
|
} else {
|
5897
5936
|
_emberMetalCore.default.Debug = {};
|
5898
|
-
|
5899
|
-
|
5900
|
-
_emberMetalCore.default.Debug.registerDeprecationHandler = function () {};
|
5901
|
-
_emberMetalCore.default.Debug.registerWarnHandler = function () {};
|
5902
|
-
}
|
5937
|
+
_emberMetalCore.default.Debug.registerDeprecationHandler = function () {};
|
5938
|
+
_emberMetalCore.default.Debug.registerWarnHandler = function () {};
|
5903
5939
|
}
|
5904
5940
|
|
5905
5941
|
_emberMetalCore.default.create = _emberMetalDebug.deprecateFunc('Ember.create is deprecated in favor of Object.create', { id: 'ember-metal.ember-create', until: '3.0.0' }, Object.create);
|
@@ -5931,7 +5967,7 @@ enifed('ember-metal/injected_property', ['exports', 'ember-metal/debug', 'ember-
|
|
5931
5967
|
|
5932
5968
|
function injectedPropertyGet(keyName) {
|
5933
5969
|
var desc = this[keyName];
|
5934
|
-
var owner = _containerOwner.getOwner(this)
|
5970
|
+
var owner = _containerOwner.getOwner(this);
|
5935
5971
|
|
5936
5972
|
_emberMetalDebug.assert('InjectedProperties should be defined with the Ember.inject computed property macros.', desc && desc.isDescriptor && desc.type);
|
5937
5973
|
_emberMetalDebug.assert('Attempting to lookup an injected property on an object without a container, ensure that the object was instantiated via a container.', owner);
|
@@ -5954,7 +5990,7 @@ enifed('ember-metal/injected_property', ['exports', 'ember-metal/debug', 'ember-
|
|
5954
5990
|
|
5955
5991
|
exports.default = InjectedProperty;
|
5956
5992
|
});
|
5957
|
-
enifed('ember-metal/instrumentation', ['exports', 'ember-metal/core'], function (exports, _emberMetalCore) {
|
5993
|
+
enifed('ember-metal/instrumentation', ['exports', 'ember-metal/core', 'ember-metal/features'], function (exports, _emberMetalCore, _emberMetalFeatures) {
|
5958
5994
|
'use strict';
|
5959
5995
|
|
5960
5996
|
exports.instrument = instrument;
|
@@ -6072,14 +6108,26 @@ enifed('ember-metal/instrumentation', ['exports', 'ember-metal/core'], function
|
|
6072
6108
|
}
|
6073
6109
|
}
|
6074
6110
|
|
6111
|
+
var flaggedInstrument;
|
6112
|
+
if (_emberMetalFeatures.default('ember-improved-instrumentation')) {
|
6113
|
+
exports.flaggedInstrument = flaggedInstrument = instrument;
|
6114
|
+
} else {
|
6115
|
+
exports.flaggedInstrument = flaggedInstrument = function (name, payload, callback) {
|
6116
|
+
return callback();
|
6117
|
+
};
|
6118
|
+
}
|
6119
|
+
exports.flaggedInstrument = flaggedInstrument;
|
6120
|
+
|
6075
6121
|
function withFinalizer(callback, finalizer, payload, binding) {
|
6122
|
+
var result = undefined;
|
6076
6123
|
try {
|
6077
|
-
|
6124
|
+
result = callback.call(binding);
|
6078
6125
|
} catch (e) {
|
6079
6126
|
payload.exception = e;
|
6080
|
-
|
6127
|
+
result = payload;
|
6081
6128
|
} finally {
|
6082
|
-
|
6129
|
+
finalizer();
|
6130
|
+
return result;
|
6083
6131
|
}
|
6084
6132
|
}
|
6085
6133
|
|
@@ -6119,7 +6167,9 @@ enifed('ember-metal/instrumentation', ['exports', 'ember-metal/core'], function
|
|
6119
6167
|
var timestamp = time();
|
6120
6168
|
for (i = 0, l = listeners.length; i < l; i++) {
|
6121
6169
|
listener = listeners[i];
|
6122
|
-
listener.after
|
6170
|
+
if (typeof listener.after === 'function') {
|
6171
|
+
listener.after(name, timestamp, payload, beforeValues[i]);
|
6172
|
+
}
|
6123
6173
|
}
|
6124
6174
|
|
6125
6175
|
if (STRUCTURED_PROFILE) {
|
@@ -7085,7 +7135,11 @@ enifed('ember-metal/map', ['exports', 'ember-metal/core', 'ember-metal/utils', '
|
|
7085
7135
|
exports.Map = Map;
|
7086
7136
|
exports.MapWithDefault = MapWithDefault;
|
7087
7137
|
});
|
7088
|
-
enifed('ember-metal/merge', ['exports'], function (exports) {
|
7138
|
+
enifed('ember-metal/merge', ['exports', 'ember-metal/debug', 'ember-metal/features'], function (exports, _emberMetalDebug, _emberMetalFeatures) {
|
7139
|
+
'use strict';
|
7140
|
+
|
7141
|
+
exports.default = merge;
|
7142
|
+
|
7089
7143
|
/**
|
7090
7144
|
Merge the contents of two objects together into the first object.
|
7091
7145
|
|
@@ -7103,11 +7157,14 @@ enifed('ember-metal/merge', ['exports'], function (exports) {
|
|
7103
7157
|
@return {Object}
|
7104
7158
|
@public
|
7105
7159
|
*/
|
7106
|
-
'use strict';
|
7107
|
-
|
7108
|
-
exports.default = merge;
|
7109
7160
|
|
7110
7161
|
function merge(original, updates) {
|
7162
|
+
if (_emberMetalFeatures.default('ember-metal-ember-assign')) {
|
7163
|
+
_emberMetalDebug.deprecate('Usage of `Ember.merge` is deprecated, use `Ember.assign` instead.', false, {
|
7164
|
+
id: 'ember-metal.merge', until: '3.0.0', url: 'http://emberjs.com/deprecations/v2.x/#toc_ember-merge'
|
7165
|
+
});
|
7166
|
+
}
|
7167
|
+
|
7111
7168
|
if (!updates || typeof updates !== 'object') {
|
7112
7169
|
return original;
|
7113
7170
|
}
|
@@ -7155,7 +7212,7 @@ enifed('ember-metal/meta', ['exports', 'ember-metal/meta_listeners', 'ember-meta
|
|
7155
7212
|
peekBindings, clearBindings, writeValues,
|
7156
7213
|
peekValues, clearValues, writeDeps, forEachInDeps
|
7157
7214
|
writableChainWatchers, readableChainWatchers, writableChains,
|
7158
|
-
readableChains
|
7215
|
+
readableChains, writableTag, readableTag
|
7159
7216
|
|
7160
7217
|
*/
|
7161
7218
|
var members = {
|
@@ -7167,7 +7224,8 @@ enifed('ember-metal/meta', ['exports', 'ember-metal/meta_listeners', 'ember-meta
|
|
7167
7224
|
values: inheritedMap,
|
7168
7225
|
deps: inheritedMapOfMaps,
|
7169
7226
|
chainWatchers: ownCustomObject,
|
7170
|
-
chains: inheritedCustomObject
|
7227
|
+
chains: inheritedCustomObject,
|
7228
|
+
tag: ownCustomObject
|
7171
7229
|
};
|
7172
7230
|
|
7173
7231
|
var memberNames = Object.keys(members);
|
@@ -7183,6 +7241,8 @@ enifed('ember-metal/meta', ['exports', 'ember-metal/meta_listeners', 'ember-meta
|
|
7183
7241
|
this._deps = undefined;
|
7184
7242
|
this._chainWatchers = undefined;
|
7185
7243
|
this._chains = undefined;
|
7244
|
+
this._tag = undefined;
|
7245
|
+
|
7186
7246
|
// used only internally
|
7187
7247
|
this.source = obj;
|
7188
7248
|
|
@@ -9476,7 +9536,7 @@ enifed('ember-metal/property_get', ['exports', 'ember-metal/debug', 'ember-metal
|
|
9476
9536
|
|
9477
9537
|
exports.default = get;
|
9478
9538
|
});
|
9479
|
-
enifed('ember-metal/property_set', ['exports', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/error', 'ember-metal/path_cache', 'ember-metal/meta', 'ember-metal/utils'], function (exports, _emberMetalDebug, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_events, _emberMetalProperties, _emberMetalError, _emberMetalPath_cache, _emberMetalMeta, _emberMetalUtils) {
|
9539
|
+
enifed('ember-metal/property_set', ['exports', 'ember-metal/debug', 'ember-metal/features', 'ember-metal/property_get', 'ember-metal/property_events', 'ember-metal/properties', 'ember-metal/error', 'ember-metal/path_cache', 'ember-metal/meta', 'ember-metal/utils', 'ember-metal/tags'], function (exports, _emberMetalDebug, _emberMetalFeatures, _emberMetalProperty_get, _emberMetalProperty_events, _emberMetalProperties, _emberMetalError, _emberMetalPath_cache, _emberMetalMeta, _emberMetalUtils, _emberMetalTags) {
|
9480
9540
|
'use strict';
|
9481
9541
|
|
9482
9542
|
exports.set = set;
|
@@ -9503,11 +9563,15 @@ enifed('ember-metal/property_set', ['exports', 'ember-metal/debug', 'ember-metal
|
|
9503
9563
|
_emberMetalDebug.assert('The key provided to set must be a string, you passed ' + keyName, typeof keyName === 'string');
|
9504
9564
|
_emberMetalDebug.assert('\'this\' in paths is not supported', !_emberMetalPath_cache.hasThis(keyName));
|
9505
9565
|
|
9506
|
-
var meta
|
9566
|
+
var meta = undefined,
|
9567
|
+
possibleDesc = undefined,
|
9568
|
+
desc = undefined;
|
9569
|
+
|
9507
9570
|
if (obj) {
|
9508
9571
|
meta = _emberMetalMeta.peekMeta(obj);
|
9509
9572
|
possibleDesc = obj[keyName];
|
9510
9573
|
desc = possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor ? possibleDesc : undefined;
|
9574
|
+
_emberMetalTags.markObjectAsDirty(meta);
|
9511
9575
|
}
|
9512
9576
|
|
9513
9577
|
var isUnknown, currentValue;
|
@@ -10117,17 +10181,21 @@ enifed('ember-metal/run_loop', ['exports', 'ember-metal/core', 'ember-metal/debu
|
|
10117
10181
|
after all DOM element operations have completed within the current
|
10118
10182
|
run loop, you can make use of the `afterRender` run loop queue (added
|
10119
10183
|
by the `ember-views` package, along with the preceding `render` queue
|
10120
|
-
where all the DOM element operations happen).
|
10184
|
+
where all the DOM element operations happen).
|
10185
|
+
|
10186
|
+
Example:
|
10121
10187
|
|
10122
10188
|
```javascript
|
10123
|
-
|
10124
|
-
didInsertElement
|
10189
|
+
export default Ember.Component.extend({
|
10190
|
+
didInsertElement() {
|
10191
|
+
this._super(...arguments);
|
10125
10192
|
run.scheduleOnce('afterRender', this, 'processChildElements');
|
10126
10193
|
},
|
10127
|
-
|
10128
|
-
|
10194
|
+
|
10195
|
+
processChildElements() {
|
10196
|
+
// ... do something with component's child component
|
10129
10197
|
// elements after they've finished rendering, which
|
10130
|
-
// can't be done within
|
10198
|
+
// can't be done within this component's
|
10131
10199
|
// `didInsertElement` hook because that gets run
|
10132
10200
|
// before the child elements have been added to the DOM.
|
10133
10201
|
}
|
@@ -11388,6 +11456,53 @@ enifed('ember-metal/symbol', ['exports', 'ember-metal/utils'], function (exports
|
|
11388
11456
|
return _emberMetalUtils.intern(debugName + ' [id=' + _emberMetalUtils.GUID_KEY + Math.floor(Math.random() * new Date()) + ']');
|
11389
11457
|
}
|
11390
11458
|
});
|
11459
|
+
enifed('ember-metal/tags', ['exports', 'ember-metal/meta', 'require'], function (exports, _emberMetalMeta, _require2) {
|
11460
|
+
'use strict';
|
11461
|
+
|
11462
|
+
exports.tagFor = tagFor;
|
11463
|
+
|
11464
|
+
var hasGlimmer = _require2.has('glimmer-reference');
|
11465
|
+
var CONSTANT_TAG = undefined,
|
11466
|
+
CURRENT_TAG = undefined,
|
11467
|
+
DirtyableTag = undefined,
|
11468
|
+
makeTag = undefined;
|
11469
|
+
|
11470
|
+
var markObjectAsDirty = undefined;
|
11471
|
+
|
11472
|
+
exports.markObjectAsDirty = markObjectAsDirty;
|
11473
|
+
|
11474
|
+
function tagFor(object, _meta) {
|
11475
|
+
if (!hasGlimmer) {
|
11476
|
+
throw new Error('Cannot call tagFor without Glimmer');
|
11477
|
+
}
|
11478
|
+
|
11479
|
+
if (object && typeof object === 'object') {
|
11480
|
+
var meta = _meta || _emberMetalMeta.meta(object);
|
11481
|
+
return meta.writableTag(makeTag);
|
11482
|
+
} else {
|
11483
|
+
return CONSTANT_TAG;
|
11484
|
+
}
|
11485
|
+
}
|
11486
|
+
|
11487
|
+
if (hasGlimmer) {
|
11488
|
+
var _require = _require2.default('glimmer-reference');
|
11489
|
+
|
11490
|
+
DirtyableTag = _require.DirtyableTag;
|
11491
|
+
CONSTANT_TAG = _require.CONSTANT_TAG;
|
11492
|
+
CURRENT_TAG = _require.CURRENT_TAG;
|
11493
|
+
|
11494
|
+
makeTag = function () {
|
11495
|
+
return new DirtyableTag();
|
11496
|
+
};
|
11497
|
+
|
11498
|
+
exports.markObjectAsDirty = markObjectAsDirty = function (meta) {
|
11499
|
+
var tag = meta && meta.readableTag() || CURRENT_TAG;
|
11500
|
+
tag.dirty();
|
11501
|
+
};
|
11502
|
+
} else {
|
11503
|
+
exports.markObjectAsDirty = markObjectAsDirty = function () {};
|
11504
|
+
}
|
11505
|
+
});
|
11391
11506
|
enifed('ember-metal/utils', ['exports'], function (exports) {
|
11392
11507
|
'no use strict';
|
11393
11508
|
// Remove "use strict"; from transpiled module until
|
@@ -12501,7 +12616,7 @@ enifed('ember-runtime/compare', ['exports', 'ember-runtime/utils', 'ember-runtim
|
|
12501
12616
|
}
|
12502
12617
|
}
|
12503
12618
|
});
|
12504
|
-
enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/error', 'ember-metal/computed', 'ember-metal/observer', 'ember-runtime/compare', 'ember-runtime/utils', 'ember-runtime/system/native_array', 'ember-metal/is_none', 'ember-metal/get_properties', 'ember-metal/weak_map'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalError, _emberMetalComputed, _emberMetalObserver, _emberRuntimeCompare, _emberRuntimeUtils, _emberRuntimeSystemNative_array, _emberMetalIs_none, _emberMetalGet_properties, _emberMetalWeak_map) {
|
12619
|
+
enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/error', 'ember-metal/computed', 'ember-metal/observer', 'ember-runtime/compare', 'ember-runtime/utils', 'ember-runtime/system/native_array', 'ember-metal/is_none', 'ember-metal/get_properties', 'ember-metal/empty_object', 'ember-metal/utils', 'ember-metal/weak_map'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalError, _emberMetalComputed, _emberMetalObserver, _emberRuntimeCompare, _emberRuntimeUtils, _emberRuntimeSystemNative_array, _emberMetalIs_none, _emberMetalGet_properties, _emberMetalEmpty_object, _emberMetalUtils, _emberMetalWeak_map) {
|
12505
12620
|
/**
|
12506
12621
|
@module ember
|
12507
12622
|
@submodule ember-runtime
|
@@ -12517,6 +12632,7 @@ enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal
|
|
12517
12632
|
exports.filter = filter;
|
12518
12633
|
exports.filterBy = filterBy;
|
12519
12634
|
exports.uniq = uniq;
|
12635
|
+
exports.uniqBy = uniqBy;
|
12520
12636
|
exports.intersect = intersect;
|
12521
12637
|
exports.setDiff = setDiff;
|
12522
12638
|
exports.collect = collect;
|
@@ -12894,6 +13010,51 @@ enifed('ember-runtime/computed/reduce_computed_macros', ['exports', 'ember-metal
|
|
12894
13010
|
});
|
12895
13011
|
}
|
12896
13012
|
|
13013
|
+
/**
|
13014
|
+
A computed property which returns a new array with all the unique
|
13015
|
+
elements from an array, with uniqueness determined by specific key.
|
13016
|
+
Example
|
13017
|
+
```javascript
|
13018
|
+
var Hamster = Ember.Object.extend({
|
13019
|
+
uniqueFruits: Ember.computed.uniqBy('fruits', 'id')
|
13020
|
+
});
|
13021
|
+
var hamster = Hamster.create({
|
13022
|
+
fruits: [
|
13023
|
+
{ id: 1, 'banana' },
|
13024
|
+
{ id: 2, 'grape' },
|
13025
|
+
{ id: 3, 'peach' },
|
13026
|
+
{ id: 1, 'banana' }
|
13027
|
+
]
|
13028
|
+
});
|
13029
|
+
hamster.get('uniqueFruits'); // [ { id: 1, 'banana' }, { id: 2, 'grape' }, { id: 3, 'peach' }]
|
13030
|
+
```
|
13031
|
+
@method uniqBy
|
13032
|
+
@for Ember.computed
|
13033
|
+
@param {String} dependentKey
|
13034
|
+
@param {String} propertyKey
|
13035
|
+
@return {Ember.ComputedProperty} computes a new array with all the
|
13036
|
+
unique elements from the dependent array
|
13037
|
+
@public
|
13038
|
+
*/
|
13039
|
+
|
13040
|
+
function uniqBy(dependentKey, propertyKey) {
|
13041
|
+
return _emberMetalComputed.computed(dependentKey + '.[]', function () {
|
13042
|
+
var uniq = _emberRuntimeSystemNative_array.A();
|
13043
|
+
var seen = new _emberMetalEmpty_object.default();
|
13044
|
+
var list = _emberMetalProperty_get.get(this, dependentKey);
|
13045
|
+
if (_emberRuntimeUtils.isArray(list)) {
|
13046
|
+
list.forEach(function (item) {
|
13047
|
+
var guid = _emberMetalUtils.guidFor(_emberMetalProperty_get.get(item, propertyKey));
|
13048
|
+
if (!(guid in seen)) {
|
13049
|
+
seen[guid] = true;
|
13050
|
+
uniq.push(item);
|
13051
|
+
}
|
13052
|
+
});
|
13053
|
+
}
|
13054
|
+
return uniq;
|
13055
|
+
}).readOnly();
|
13056
|
+
}
|
13057
|
+
|
12897
13058
|
/**
|
12898
13059
|
Alias for [Ember.computed.uniq](/api/#method_computed_uniq).
|
12899
13060
|
|
@@ -13614,8 +13775,8 @@ enifed('ember-runtime/ext/rsvp', ['exports', 'ember-metal/core', 'require', 'emb
|
|
13614
13775
|
error = reason;
|
13615
13776
|
}
|
13616
13777
|
|
13617
|
-
if (error && error.name ===
|
13618
|
-
_emberMetalDebug.assert(
|
13778
|
+
if (error && error.name === 'UnrecognizedURLError') {
|
13779
|
+
_emberMetalDebug.assert('The URL \'' + error.message + '\' did not match any routes in your application', false);
|
13619
13780
|
return;
|
13620
13781
|
}
|
13621
13782
|
|
@@ -13761,7 +13922,7 @@ enifed('ember-runtime/ext/string', ['exports', 'ember-metal/core', 'ember-runtim
|
|
13761
13922
|
}
|
13762
13923
|
});
|
13763
13924
|
// Ember.EXTEND_PROTOTYPES
|
13764
|
-
enifed('ember-runtime/index', ['exports', 'ember-metal', 'ember-runtime/is-equal', 'ember-runtime/compare', 'ember-runtime/copy', 'ember-runtime/inject', 'ember-runtime/system/namespace', 'ember-runtime/system/object', 'ember-runtime/system/container', 'ember-runtime/system/array_proxy', 'ember-runtime/system/object_proxy', 'ember-runtime/system/core_object', 'ember-runtime/system/native_array', 'ember-runtime/system/string', 'ember-runtime/system/lazy_load', 'ember-runtime/mixins/array', 'ember-runtime/mixins/comparable', 'ember-runtime/mixins/copyable', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/freezable', 'ember-runtime/mixins/-proxy', 'ember-runtime/mixins/observable', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/mixins/mutable_array', 'ember-runtime/mixins/target_action_support', 'ember-runtime/mixins/evented', 'ember-runtime/mixins/promise_proxy', 'ember-runtime/computed/reduce_computed_macros', 'ember-runtime/controllers/controller', 'ember-runtime/mixins/controller', 'ember-runtime/system/service', 'ember-runtime/ext/rsvp', 'ember-runtime/ext/string', 'ember-runtime/ext/function', 'ember-runtime/utils', 'ember-
|
13925
|
+
enifed('ember-runtime/index', ['exports', 'ember-metal', 'ember-runtime/is-equal', 'ember-runtime/compare', 'ember-runtime/copy', 'ember-runtime/inject', 'ember-runtime/system/namespace', 'ember-runtime/system/object', 'ember-runtime/system/container', 'ember-runtime/system/array_proxy', 'ember-runtime/system/object_proxy', 'ember-runtime/system/core_object', 'ember-runtime/system/native_array', 'ember-runtime/system/string', 'ember-runtime/system/lazy_load', 'ember-runtime/mixins/array', 'ember-runtime/mixins/comparable', 'ember-runtime/mixins/copyable', 'ember-runtime/mixins/enumerable', 'ember-runtime/mixins/freezable', 'ember-runtime/mixins/-proxy', 'ember-runtime/mixins/observable', 'ember-runtime/mixins/action_handler', 'ember-runtime/mixins/mutable_enumerable', 'ember-runtime/mixins/mutable_array', 'ember-runtime/mixins/target_action_support', 'ember-runtime/mixins/evented', 'ember-runtime/mixins/promise_proxy', 'ember-metal/features', 'ember-runtime/computed/reduce_computed_macros', 'ember-runtime/controllers/controller', 'ember-runtime/mixins/controller', 'ember-runtime/system/service', 'ember-runtime/ext/rsvp', 'ember-runtime/ext/string', 'ember-runtime/ext/function', 'ember-runtime/utils', 'ember-runtime/mixins/registry_proxy', 'ember-runtime/mixins/container_proxy', 'ember-runtime/string_registry'], function (exports, _emberMetal, _emberRuntimeIsEqual, _emberRuntimeCompare, _emberRuntimeCopy, _emberRuntimeInject, _emberRuntimeSystemNamespace, _emberRuntimeSystemObject, _emberRuntimeSystemContainer, _emberRuntimeSystemArray_proxy, _emberRuntimeSystemObject_proxy, _emberRuntimeSystemCore_object, _emberRuntimeSystemNative_array, _emberRuntimeSystemString, _emberRuntimeSystemLazy_load, _emberRuntimeMixinsArray, _emberRuntimeMixinsComparable, _emberRuntimeMixinsCopyable, _emberRuntimeMixinsEnumerable, _emberRuntimeMixinsFreezable, _emberRuntimeMixinsProxy, _emberRuntimeMixinsObservable, _emberRuntimeMixinsAction_handler, _emberRuntimeMixinsMutable_enumerable, _emberRuntimeMixinsMutable_array, _emberRuntimeMixinsTarget_action_support, _emberRuntimeMixinsEvented, _emberRuntimeMixinsPromise_proxy, _emberMetalFeatures, _emberRuntimeComputedReduce_computed_macros, _emberRuntimeControllersController, _emberRuntimeMixinsController, _emberRuntimeSystemService, _emberRuntimeExtRsvp, _emberRuntimeExtString, _emberRuntimeExtFunction, _emberRuntimeUtils, _emberRuntimeMixinsRegistry_proxy, _emberRuntimeMixinsContainer_proxy, _emberRuntimeString_registry) {
|
13765
13926
|
/**
|
13766
13927
|
@module ember
|
13767
13928
|
@submodule ember-runtime
|
@@ -13813,6 +13974,11 @@ enifed('ember-runtime/index', ['exports', 'ember-metal', 'ember-runtime/is-equal
|
|
13813
13974
|
EmComputed.filter = _emberRuntimeComputedReduce_computed_macros.filter;
|
13814
13975
|
EmComputed.filterBy = _emberRuntimeComputedReduce_computed_macros.filterBy;
|
13815
13976
|
EmComputed.uniq = _emberRuntimeComputedReduce_computed_macros.uniq;
|
13977
|
+
|
13978
|
+
if (_emberMetalFeatures.default('ember-runtime-computed-uniq-by')) {
|
13979
|
+
EmComputed.uniqBy = _emberRuntimeComputedReduce_computed_macros.uniqBy;
|
13980
|
+
}
|
13981
|
+
|
13816
13982
|
EmComputed.union = _emberRuntimeComputedReduce_computed_macros.union;
|
13817
13983
|
EmComputed.intersect = _emberRuntimeComputedReduce_computed_macros.intersect;
|
13818
13984
|
EmComputed.collect = _emberRuntimeComputedReduce_computed_macros.collect;
|
@@ -13822,13 +13988,11 @@ enifed('ember-runtime/index', ['exports', 'ember-metal', 'ember-runtime/is-equal
|
|
13822
13988
|
_emberMetal.default.Container = _emberRuntimeSystemContainer.Container;
|
13823
13989
|
_emberMetal.default.Registry = _emberRuntimeSystemContainer.Registry;
|
13824
13990
|
|
13825
|
-
|
13826
|
-
|
13827
|
-
_emberMetal.default.setOwner = _emberRuntimeSystemContainer.setOwner;
|
13991
|
+
_emberMetal.default.getOwner = _emberRuntimeSystemContainer.getOwner;
|
13992
|
+
_emberMetal.default.setOwner = _emberRuntimeSystemContainer.setOwner;
|
13828
13993
|
|
13829
|
-
|
13830
|
-
|
13831
|
-
}
|
13994
|
+
_emberMetal.default._RegistryProxyMixin = _emberRuntimeMixinsRegistry_proxy.default;
|
13995
|
+
_emberMetal.default._ContainerProxyMixin = _emberRuntimeMixinsContainer_proxy.default;
|
13832
13996
|
|
13833
13997
|
_emberMetal.default.Namespace = _emberRuntimeSystemNamespace.default;
|
13834
13998
|
_emberMetal.default.Enumerable = _emberRuntimeMixinsEnumerable.default;
|
@@ -14008,7 +14172,7 @@ enifed('ember-runtime/is-equal', ['exports'], function (exports) {
|
|
14008
14172
|
return a === b;
|
14009
14173
|
}
|
14010
14174
|
});
|
14011
|
-
enifed('ember-runtime/mixins/-proxy', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/meta', 'ember-metal/observer', 'ember-metal/property_events', 'ember-metal/computed', 'ember-metal/properties', 'ember-metal/mixin'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMeta, _emberMetalObserver, _emberMetalProperty_events, _emberMetalComputed, _emberMetalProperties, _emberMetalMixin) {
|
14175
|
+
enifed('ember-runtime/mixins/-proxy', ['exports', 'ember-metal/debug', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/meta', 'ember-metal/observer', 'ember-metal/property_events', 'ember-metal/computed', 'ember-metal/properties', 'ember-metal/mixin', 'ember-metal/symbol'], function (exports, _emberMetalDebug, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMeta, _emberMetalObserver, _emberMetalProperty_events, _emberMetalComputed, _emberMetalProperties, _emberMetalMixin, _emberMetalSymbol) {
|
14012
14176
|
/**
|
14013
14177
|
@module ember
|
14014
14178
|
@submodule ember-runtime
|
@@ -14016,6 +14180,16 @@ enifed('ember-runtime/mixins/-proxy', ['exports', 'ember-metal/debug', 'ember-me
|
|
14016
14180
|
|
14017
14181
|
'use strict';
|
14018
14182
|
|
14183
|
+
var _Mixin$create;
|
14184
|
+
|
14185
|
+
exports.isProxy = isProxy;
|
14186
|
+
|
14187
|
+
var IS_PROXY = _emberMetalSymbol.default('IS_PROXY');
|
14188
|
+
|
14189
|
+
function isProxy(value) {
|
14190
|
+
return value && value[IS_PROXY];
|
14191
|
+
}
|
14192
|
+
|
14019
14193
|
function contentPropertyWillChange(content, contentKey) {
|
14020
14194
|
var key = contentKey.slice(8); // remove "content."
|
14021
14195
|
if (key in this) {
|
@@ -14040,61 +14214,46 @@ enifed('ember-runtime/mixins/-proxy', ['exports', 'ember-metal/debug', 'ember-me
|
|
14040
14214
|
@namespace Ember
|
14041
14215
|
@private
|
14042
14216
|
*/
|
14043
|
-
exports.default = _emberMetalMixin.Mixin.create({
|
14044
|
-
|
14045
|
-
|
14046
|
-
|
14047
|
-
|
14048
|
-
|
14049
|
-
|
14050
|
-
|
14051
|
-
|
14052
|
-
|
14053
|
-
|
14054
|
-
|
14055
|
-
|
14056
|
-
|
14057
|
-
|
14058
|
-
|
14059
|
-
|
14060
|
-
|
14061
|
-
|
14062
|
-
|
14063
|
-
|
14064
|
-
|
14065
|
-
|
14066
|
-
didUnwatchProperty: function (key) {
|
14067
|
-
var contentKey = 'content.' + key;
|
14068
|
-
_emberMetalObserver._removeBeforeObserver(this, contentKey, null, contentPropertyWillChange);
|
14069
|
-
_emberMetalObserver.removeObserver(this, contentKey, null, contentPropertyDidChange);
|
14070
|
-
},
|
14071
|
-
|
14072
|
-
unknownProperty: function (key) {
|
14073
|
-
var content = _emberMetalProperty_get.get(this, 'content');
|
14074
|
-
if (content) {
|
14075
|
-
_emberMetalDebug.deprecate('You attempted to access `' + key + '` from `' + this + '`, but object proxying is deprecated. Please use `model.' + key + '` instead.', !this.isController, { id: 'ember-runtime.controller-proxy', until: '3.0.0' });
|
14076
|
-
return _emberMetalProperty_get.get(content, key);
|
14077
|
-
}
|
14078
|
-
},
|
14079
|
-
|
14080
|
-
setUnknownProperty: function (key, value) {
|
14081
|
-
var m = _emberMetalMeta.meta(this);
|
14082
|
-
if (m.proto === this) {
|
14083
|
-
// if marked as prototype then just defineProperty
|
14084
|
-
// rather than delegate
|
14085
|
-
_emberMetalProperties.defineProperty(this, key, null, value);
|
14086
|
-
return value;
|
14087
|
-
}
|
14088
|
-
|
14089
|
-
var content = _emberMetalProperty_get.get(this, 'content');
|
14090
|
-
_emberMetalDebug.assert('Cannot delegate set(\'' + key + '\', ' + value + ') to the \'content\' property of object proxy ' + this + ': its \'content\' is undefined.', content);
|
14091
|
-
|
14092
|
-
_emberMetalDebug.deprecate('You attempted to set `' + key + '` from `' + this + '`, but object proxying is deprecated. Please use `model.' + key + '` instead.', !this.isController, { id: 'ember-runtime.controller-proxy', until: '3.0.0' });
|
14093
|
-
return _emberMetalProperty_set.set(content, key, value);
|
14217
|
+
exports.default = _emberMetalMixin.Mixin.create((_Mixin$create = {}, _Mixin$create[IS_PROXY] = true, _Mixin$create.content = null, _Mixin$create._contentDidChange = _emberMetalMixin.observer('content', function () {
|
14218
|
+
_emberMetalDebug.assert('Can\'t set Proxy\'s content to itself', _emberMetalProperty_get.get(this, 'content') !== this);
|
14219
|
+
}), _Mixin$create.isTruthy = _emberMetalComputed.computed.bool('content'), _Mixin$create._debugContainerKey = null, _Mixin$create.willWatchProperty = function (key) {
|
14220
|
+
var contentKey = 'content.' + key;
|
14221
|
+
_emberMetalObserver._addBeforeObserver(this, contentKey, null, contentPropertyWillChange);
|
14222
|
+
_emberMetalObserver.addObserver(this, contentKey, null, contentPropertyDidChange);
|
14223
|
+
}, _Mixin$create.didUnwatchProperty = function (key) {
|
14224
|
+
var contentKey = 'content.' + key;
|
14225
|
+
_emberMetalObserver._removeBeforeObserver(this, contentKey, null, contentPropertyWillChange);
|
14226
|
+
_emberMetalObserver.removeObserver(this, contentKey, null, contentPropertyDidChange);
|
14227
|
+
}, _Mixin$create.unknownProperty = function (key) {
|
14228
|
+
var content = _emberMetalProperty_get.get(this, 'content');
|
14229
|
+
if (content) {
|
14230
|
+
_emberMetalDebug.deprecate('You attempted to access `' + key + '` from `' + this + '`, but object proxying is deprecated. Please use `model.' + key + '` instead.', !this.isController, { id: 'ember-runtime.controller-proxy', until: '3.0.0' });
|
14231
|
+
return _emberMetalProperty_get.get(content, key);
|
14232
|
+
}
|
14233
|
+
}, _Mixin$create.setUnknownProperty = function (key, value) {
|
14234
|
+
var m = _emberMetalMeta.meta(this);
|
14235
|
+
if (m.proto === this) {
|
14236
|
+
// if marked as prototype then just defineProperty
|
14237
|
+
// rather than delegate
|
14238
|
+
_emberMetalProperties.defineProperty(this, key, null, value);
|
14239
|
+
return value;
|
14094
14240
|
}
|
14095
14241
|
|
14096
|
-
|
14242
|
+
var content = _emberMetalProperty_get.get(this, 'content');
|
14243
|
+
_emberMetalDebug.assert('Cannot delegate set(\'' + key + '\', ' + value + ') to the \'content\' property of object proxy ' + this + ': its \'content\' is undefined.', content);
|
14244
|
+
|
14245
|
+
_emberMetalDebug.deprecate('You attempted to set `' + key + '` from `' + this + '`, but object proxying is deprecated. Please use `model.' + key + '` instead.', !this.isController, { id: 'ember-runtime.controller-proxy', until: '3.0.0' });
|
14246
|
+
return _emberMetalProperty_set.set(content, key, value);
|
14247
|
+
}, _Mixin$create));
|
14097
14248
|
});
|
14249
|
+
|
14250
|
+
/**
|
14251
|
+
The object whose properties will be forwarded.
|
14252
|
+
@property content
|
14253
|
+
@type Ember.Object
|
14254
|
+
@default null
|
14255
|
+
@private
|
14256
|
+
*/
|
14098
14257
|
enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal/debug', 'ember-metal/mixin', 'ember-metal/property_get'], function (exports, _emberMetalDebug, _emberMetalMixin, _emberMetalProperty_get) {
|
14099
14258
|
/**
|
14100
14259
|
@module ember
|
@@ -14296,7 +14455,7 @@ enifed('ember-runtime/mixins/action_handler', ['exports', 'ember-metal/debug', '
|
|
14296
14455
|
});
|
14297
14456
|
}
|
14298
14457
|
});
|
14299
|
-
enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-metal/property_get', 'ember-metal/computed', 'ember-metal/is_none', 'ember-runtime/mixins/enumerable', 'ember-metal/mixin', 'ember-metal/property_events', 'ember-metal/events', 'ember-runtime/system/each_proxy'], function (exports, _emberMetalCore, _emberMetalProperty_get, _emberMetalComputed, _emberMetalIs_none, _emberRuntimeMixinsEnumerable, _emberMetalMixin, _emberMetalProperty_events, _emberMetalEvents, _emberRuntimeSystemEach_proxy) {
|
14458
|
+
enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-metal/symbol', 'ember-metal/property_get', 'ember-metal/computed', 'ember-metal/is_none', 'ember-runtime/mixins/enumerable', 'ember-metal/mixin', 'ember-metal/property_events', 'ember-metal/events', 'ember-metal/meta', 'ember-metal/tags', 'ember-runtime/system/each_proxy'], function (exports, _emberMetalCore, _emberMetalSymbol, _emberMetalProperty_get, _emberMetalComputed, _emberMetalIs_none, _emberRuntimeMixinsEnumerable, _emberMetalMixin, _emberMetalProperty_events, _emberMetalEvents, _emberMetalMeta, _emberMetalTags, _emberRuntimeSystemEach_proxy) {
|
14300
14459
|
/**
|
14301
14460
|
@module ember
|
14302
14461
|
@submodule ember-runtime
|
@@ -14307,9 +14466,12 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-meta
|
|
14307
14466
|
//
|
14308
14467
|
'use strict';
|
14309
14468
|
|
14469
|
+
var _Mixin$create;
|
14470
|
+
|
14310
14471
|
exports.addArrayObserver = addArrayObserver;
|
14311
14472
|
exports.removeArrayObserver = removeArrayObserver;
|
14312
14473
|
exports.objectAt = objectAt;
|
14474
|
+
exports.isEmberArray = isEmberArray;
|
14313
14475
|
|
14314
14476
|
function arrayObserversHelper(obj, target, opts, operation, notify) {
|
14315
14477
|
var willChange = opts && opts.willChange || 'arrayWillChange';
|
@@ -14346,6 +14508,12 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-meta
|
|
14346
14508
|
return content[idx];
|
14347
14509
|
}
|
14348
14510
|
|
14511
|
+
var EMBER_ARRAY = _emberMetalSymbol.default('EMBER_ARRAY');
|
14512
|
+
|
14513
|
+
function isEmberArray(obj) {
|
14514
|
+
return obj && !!obj[EMBER_ARRAY];
|
14515
|
+
}
|
14516
|
+
|
14349
14517
|
// ..........................................................
|
14350
14518
|
// ARRAY
|
14351
14519
|
//
|
@@ -14386,435 +14554,416 @@ enifed('ember-runtime/mixins/array', ['exports', 'ember-metal/core', 'ember-meta
|
|
14386
14554
|
@since Ember 0.9.0
|
14387
14555
|
@public
|
14388
14556
|
*/
|
14389
|
-
exports.default = _emberMetalMixin.Mixin.create(_emberRuntimeMixinsEnumerable.default, {
|
14390
|
-
|
14391
|
-
|
14392
|
-
|
14393
|
-
Your array must support the `length` property. Your replace methods should
|
14394
|
-
set this property whenever it changes.
|
14395
|
-
@property {Number} length
|
14396
|
-
@public
|
14397
|
-
*/
|
14398
|
-
length: null,
|
14557
|
+
exports.default = _emberMetalMixin.Mixin.create(_emberRuntimeMixinsEnumerable.default, (_Mixin$create = {}, _Mixin$create[EMBER_ARRAY] = true, _Mixin$create.length = null, _Mixin$create.objectAt = function (idx) {
|
14558
|
+
if (idx < 0 || idx >= _emberMetalProperty_get.get(this, 'length')) {
|
14559
|
+
return undefined;
|
14560
|
+
}
|
14399
14561
|
|
14400
|
-
|
14401
|
-
|
14402
|
-
|
14403
|
-
This is one of the primitives you must implement to support `Ember.Array`.
|
14404
|
-
If your object supports retrieving the value of an array item using `get()`
|
14405
|
-
(i.e. `myArray.get(0)`), then you do not need to implement this method
|
14406
|
-
yourself.
|
14407
|
-
```javascript
|
14408
|
-
var arr = ['a', 'b', 'c', 'd'];
|
14409
|
-
arr.objectAt(0); // 'a'
|
14410
|
-
arr.objectAt(3); // 'd'
|
14411
|
-
arr.objectAt(-1); // undefined
|
14412
|
-
arr.objectAt(4); // undefined
|
14413
|
-
arr.objectAt(5); // undefined
|
14414
|
-
```
|
14415
|
-
@method objectAt
|
14416
|
-
@param {Number} idx The index of the item to return.
|
14417
|
-
@return {*} item at index or undefined
|
14418
|
-
@public
|
14419
|
-
*/
|
14420
|
-
objectAt: function (idx) {
|
14421
|
-
if (idx < 0 || idx >= _emberMetalProperty_get.get(this, 'length')) {
|
14422
|
-
return undefined;
|
14423
|
-
}
|
14562
|
+
return _emberMetalProperty_get.get(this, idx);
|
14563
|
+
}, _Mixin$create.objectsAt = function (indexes) {
|
14564
|
+
var _this = this;
|
14424
14565
|
|
14425
|
-
|
14566
|
+
return indexes.map(function (idx) {
|
14567
|
+
return objectAt(_this, idx);
|
14568
|
+
});
|
14569
|
+
}, _Mixin$create.nextObject = function (idx) {
|
14570
|
+
return objectAt(this, idx);
|
14571
|
+
}, _Mixin$create['[]'] = _emberMetalComputed.computed({
|
14572
|
+
get: function (key) {
|
14573
|
+
return this;
|
14426
14574
|
},
|
14575
|
+
set: function (key, value) {
|
14576
|
+
this.replace(0, _emberMetalProperty_get.get(this, 'length'), value);
|
14577
|
+
return this;
|
14578
|
+
}
|
14579
|
+
}), _Mixin$create.firstObject = _emberMetalComputed.computed(function () {
|
14580
|
+
return objectAt(this, 0);
|
14581
|
+
}).readOnly(), _Mixin$create.lastObject = _emberMetalComputed.computed(function () {
|
14582
|
+
return objectAt(this, _emberMetalProperty_get.get(this, 'length') - 1);
|
14583
|
+
}).readOnly(), _Mixin$create.contains = function (obj) {
|
14584
|
+
return this.indexOf(obj) >= 0;
|
14585
|
+
}, _Mixin$create.slice = function (beginIndex, endIndex) {
|
14586
|
+
var ret = _emberMetalCore.default.A();
|
14587
|
+
var length = _emberMetalProperty_get.get(this, 'length');
|
14427
14588
|
|
14428
|
-
|
14429
|
-
|
14430
|
-
|
14431
|
-
var arr = ['a', 'b', 'c', 'd'];
|
14432
|
-
arr.objectsAt([0, 1, 2]); // ['a', 'b', 'c']
|
14433
|
-
arr.objectsAt([2, 3, 4]); // ['c', 'd', undefined]
|
14434
|
-
```
|
14435
|
-
@method objectsAt
|
14436
|
-
@param {Array} indexes An array of indexes of items to return.
|
14437
|
-
@return {Array}
|
14438
|
-
@public
|
14439
|
-
*/
|
14440
|
-
objectsAt: function (indexes) {
|
14441
|
-
var _this = this;
|
14589
|
+
if (_emberMetalIs_none.default(beginIndex)) {
|
14590
|
+
beginIndex = 0;
|
14591
|
+
}
|
14442
14592
|
|
14443
|
-
|
14444
|
-
|
14445
|
-
|
14446
|
-
},
|
14593
|
+
if (_emberMetalIs_none.default(endIndex) || endIndex > length) {
|
14594
|
+
endIndex = length;
|
14595
|
+
}
|
14447
14596
|
|
14448
|
-
|
14449
|
-
|
14450
|
-
|
14451
|
-
},
|
14597
|
+
if (beginIndex < 0) {
|
14598
|
+
beginIndex = length + beginIndex;
|
14599
|
+
}
|
14452
14600
|
|
14453
|
-
|
14454
|
-
|
14455
|
-
|
14456
|
-
array, it will replace the current content.
|
14457
|
-
This property overrides the default property defined in `Ember.Enumerable`.
|
14458
|
-
@property []
|
14459
|
-
@return this
|
14460
|
-
@public
|
14461
|
-
*/
|
14462
|
-
'[]': _emberMetalComputed.computed({
|
14463
|
-
get: function (key) {
|
14464
|
-
return this;
|
14465
|
-
},
|
14466
|
-
set: function (key, value) {
|
14467
|
-
this.replace(0, _emberMetalProperty_get.get(this, 'length'), value);
|
14468
|
-
return this;
|
14469
|
-
}
|
14470
|
-
}),
|
14601
|
+
if (endIndex < 0) {
|
14602
|
+
endIndex = length + endIndex;
|
14603
|
+
}
|
14471
14604
|
|
14472
|
-
|
14473
|
-
|
14474
|
-
}
|
14605
|
+
while (beginIndex < endIndex) {
|
14606
|
+
ret[ret.length] = objectAt(this, beginIndex++);
|
14607
|
+
}
|
14475
14608
|
|
14476
|
-
|
14477
|
-
|
14478
|
-
|
14609
|
+
return ret;
|
14610
|
+
}, _Mixin$create.indexOf = function (object, startAt) {
|
14611
|
+
var len = _emberMetalProperty_get.get(this, 'length');
|
14612
|
+
var idx;
|
14479
14613
|
|
14480
|
-
|
14481
|
-
|
14482
|
-
|
14483
|
-
},
|
14614
|
+
if (startAt === undefined) {
|
14615
|
+
startAt = 0;
|
14616
|
+
}
|
14484
14617
|
|
14485
|
-
|
14486
|
-
|
14487
|
-
|
14488
|
-
uses the observable array methods to retrieve the objects for the new
|
14489
|
-
slice.
|
14490
|
-
```javascript
|
14491
|
-
var arr = ['red', 'green', 'blue'];
|
14492
|
-
arr.slice(0); // ['red', 'green', 'blue']
|
14493
|
-
arr.slice(0, 2); // ['red', 'green']
|
14494
|
-
arr.slice(1, 100); // ['green', 'blue']
|
14495
|
-
```
|
14496
|
-
@method slice
|
14497
|
-
@param {Number} beginIndex (Optional) index to begin slicing from.
|
14498
|
-
@param {Number} endIndex (Optional) index to end the slice at (but not included).
|
14499
|
-
@return {Array} New array with specified slice
|
14500
|
-
@public
|
14501
|
-
*/
|
14502
|
-
slice: function (beginIndex, endIndex) {
|
14503
|
-
var ret = _emberMetalCore.default.A();
|
14504
|
-
var length = _emberMetalProperty_get.get(this, 'length');
|
14618
|
+
if (startAt < 0) {
|
14619
|
+
startAt += len;
|
14620
|
+
}
|
14505
14621
|
|
14506
|
-
|
14507
|
-
|
14622
|
+
for (idx = startAt; idx < len; idx++) {
|
14623
|
+
if (objectAt(this, idx) === object) {
|
14624
|
+
return idx;
|
14508
14625
|
}
|
14626
|
+
}
|
14509
14627
|
|
14510
|
-
|
14511
|
-
|
14512
|
-
|
14628
|
+
return -1;
|
14629
|
+
}, _Mixin$create.lastIndexOf = function (object, startAt) {
|
14630
|
+
var len = _emberMetalProperty_get.get(this, 'length');
|
14631
|
+
var idx;
|
14513
14632
|
|
14514
|
-
|
14515
|
-
|
14516
|
-
|
14633
|
+
if (startAt === undefined || startAt >= len) {
|
14634
|
+
startAt = len - 1;
|
14635
|
+
}
|
14517
14636
|
|
14518
|
-
|
14519
|
-
|
14520
|
-
|
14637
|
+
if (startAt < 0) {
|
14638
|
+
startAt += len;
|
14639
|
+
}
|
14521
14640
|
|
14522
|
-
|
14523
|
-
|
14641
|
+
for (idx = startAt; idx >= 0; idx--) {
|
14642
|
+
if (objectAt(this, idx) === object) {
|
14643
|
+
return idx;
|
14524
14644
|
}
|
14645
|
+
}
|
14525
14646
|
|
14526
|
-
|
14527
|
-
|
14528
|
-
|
14529
|
-
|
14530
|
-
|
14531
|
-
|
14532
|
-
|
14533
|
-
|
14534
|
-
|
14535
|
-
|
14536
|
-
|
14537
|
-
|
14538
|
-
|
14539
|
-
|
14540
|
-
|
14541
|
-
|
14542
|
-
|
14543
|
-
@method indexOf
|
14544
|
-
@param {Object} object the item to search for
|
14545
|
-
@param {Number} startAt optional starting location to search, default 0
|
14546
|
-
@return {Number} index or -1 if not found
|
14547
|
-
@public
|
14548
|
-
*/
|
14549
|
-
indexOf: function (object, startAt) {
|
14550
|
-
var len = _emberMetalProperty_get.get(this, 'length');
|
14551
|
-
var idx;
|
14552
|
-
|
14553
|
-
if (startAt === undefined) {
|
14554
|
-
startAt = 0;
|
14647
|
+
return -1;
|
14648
|
+
}, _Mixin$create.addArrayObserver = function (target, opts) {
|
14649
|
+
return addArrayObserver(this, target, opts);
|
14650
|
+
}, _Mixin$create.removeArrayObserver = function (target, opts) {
|
14651
|
+
return removeArrayObserver(this, target, opts);
|
14652
|
+
}, _Mixin$create.hasArrayObservers = _emberMetalComputed.computed(function () {
|
14653
|
+
return _emberMetalEvents.hasListeners(this, '@array:change') || _emberMetalEvents.hasListeners(this, '@array:before');
|
14654
|
+
}), _Mixin$create.arrayContentWillChange = function (startIdx, removeAmt, addAmt) {
|
14655
|
+
var removing, lim;
|
14656
|
+
|
14657
|
+
// if no args are passed assume everything changes
|
14658
|
+
if (startIdx === undefined) {
|
14659
|
+
startIdx = 0;
|
14660
|
+
removeAmt = addAmt = -1;
|
14661
|
+
} else {
|
14662
|
+
if (removeAmt === undefined) {
|
14663
|
+
removeAmt = -1;
|
14555
14664
|
}
|
14556
14665
|
|
14557
|
-
if (
|
14558
|
-
|
14666
|
+
if (addAmt === undefined) {
|
14667
|
+
addAmt = -1;
|
14559
14668
|
}
|
14669
|
+
}
|
14560
14670
|
|
14561
|
-
|
14562
|
-
|
14563
|
-
|
14564
|
-
}
|
14565
|
-
}
|
14671
|
+
if (this.__each) {
|
14672
|
+
this.__each.arrayWillChange(this, startIdx, removeAmt, addAmt);
|
14673
|
+
}
|
14566
14674
|
|
14567
|
-
|
14568
|
-
},
|
14675
|
+
_emberMetalEvents.sendEvent(this, '@array:before', [this, startIdx, removeAmt, addAmt]);
|
14569
14676
|
|
14570
|
-
|
14571
|
-
|
14572
|
-
|
14573
|
-
the last position. If it's negative, will count backward
|
14574
|
-
from the end of the array. Returns -1 if no match is found.
|
14575
|
-
```javascript
|
14576
|
-
var arr = ['a', 'b', 'c', 'd', 'a'];
|
14577
|
-
arr.lastIndexOf('a'); // 4
|
14578
|
-
arr.lastIndexOf('z'); // -1
|
14579
|
-
arr.lastIndexOf('a', 2); // 0
|
14580
|
-
arr.lastIndexOf('a', -1); // 4
|
14581
|
-
arr.lastIndexOf('b', 3); // 1
|
14582
|
-
arr.lastIndexOf('a', 100); // 4
|
14583
|
-
```
|
14584
|
-
@method lastIndexOf
|
14585
|
-
@param {Object} object the item to search for
|
14586
|
-
@param {Number} startAt optional starting location to search, default 0
|
14587
|
-
@return {Number} index or -1 if not found
|
14588
|
-
@public
|
14589
|
-
*/
|
14590
|
-
lastIndexOf: function (object, startAt) {
|
14591
|
-
var len = _emberMetalProperty_get.get(this, 'length');
|
14592
|
-
var idx;
|
14677
|
+
if (startIdx >= 0 && removeAmt >= 0 && _emberMetalProperty_get.get(this, 'hasEnumerableObservers')) {
|
14678
|
+
removing = [];
|
14679
|
+
lim = startIdx + removeAmt;
|
14593
14680
|
|
14594
|
-
|
14595
|
-
|
14681
|
+
for (var idx = startIdx; idx < lim; idx++) {
|
14682
|
+
removing.push(objectAt(this, idx));
|
14596
14683
|
}
|
14684
|
+
} else {
|
14685
|
+
removing = removeAmt;
|
14686
|
+
}
|
14597
14687
|
|
14598
|
-
|
14599
|
-
startAt += len;
|
14600
|
-
}
|
14688
|
+
this.enumerableContentWillChange(removing, addAmt);
|
14601
14689
|
|
14602
|
-
|
14603
|
-
|
14604
|
-
|
14605
|
-
}
|
14606
|
-
}
|
14690
|
+
return this;
|
14691
|
+
}, _Mixin$create.arrayContentDidChange = function (startIdx, removeAmt, addAmt) {
|
14692
|
+
var adding, lim;
|
14607
14693
|
|
14608
|
-
|
14609
|
-
},
|
14694
|
+
_emberMetalTags.markObjectAsDirty(_emberMetalMeta.meta(this));
|
14610
14695
|
|
14611
|
-
//
|
14612
|
-
|
14613
|
-
|
14696
|
+
// if no args are passed assume everything changes
|
14697
|
+
if (startIdx === undefined) {
|
14698
|
+
startIdx = 0;
|
14699
|
+
removeAmt = addAmt = -1;
|
14700
|
+
} else {
|
14701
|
+
if (removeAmt === undefined) {
|
14702
|
+
removeAmt = -1;
|
14703
|
+
}
|
14614
14704
|
|
14615
|
-
|
14616
|
-
|
14617
|
-
|
14618
|
-
|
14619
|
-
called just before the array is modified.
|
14620
|
-
* `arrayDidChange(observedObj, start, removeCount, addCount)` - This method will be
|
14621
|
-
called just after the array is modified.
|
14622
|
-
Both callbacks will be passed the observed object, starting index of the
|
14623
|
-
change as well as a count of the items to be removed and added. You can use
|
14624
|
-
these callbacks to optionally inspect the array during the change, clear
|
14625
|
-
caches, or do any other bookkeeping necessary.
|
14626
|
-
In addition to passing a target, you can also include an options hash
|
14627
|
-
which you can use to override the method names that will be invoked on the
|
14628
|
-
target.
|
14629
|
-
@method addArrayObserver
|
14630
|
-
@param {Object} target The observer object.
|
14631
|
-
@param {Object} opts Optional hash of configuration options including
|
14632
|
-
`willChange` and `didChange` option.
|
14633
|
-
@return {Ember.Array} receiver
|
14634
|
-
@public
|
14635
|
-
*/
|
14705
|
+
if (addAmt === undefined) {
|
14706
|
+
addAmt = -1;
|
14707
|
+
}
|
14708
|
+
}
|
14636
14709
|
|
14637
|
-
|
14638
|
-
|
14639
|
-
|
14710
|
+
if (startIdx >= 0 && addAmt >= 0 && _emberMetalProperty_get.get(this, 'hasEnumerableObservers')) {
|
14711
|
+
adding = [];
|
14712
|
+
lim = startIdx + addAmt;
|
14640
14713
|
|
14641
|
-
|
14642
|
-
|
14643
|
-
|
14644
|
-
|
14645
|
-
|
14646
|
-
|
14647
|
-
@param {Object} opts Optional hash of configuration options including
|
14648
|
-
`willChange` and `didChange` option.
|
14649
|
-
@return {Ember.Array} receiver
|
14650
|
-
@public
|
14651
|
-
*/
|
14652
|
-
removeArrayObserver: function (target, opts) {
|
14653
|
-
return removeArrayObserver(this, target, opts);
|
14654
|
-
},
|
14714
|
+
for (var idx = startIdx; idx < lim; idx++) {
|
14715
|
+
adding.push(objectAt(this, idx));
|
14716
|
+
}
|
14717
|
+
} else {
|
14718
|
+
adding = addAmt;
|
14719
|
+
}
|
14655
14720
|
|
14656
|
-
|
14657
|
-
Becomes true whenever the array currently has observers watching changes
|
14658
|
-
on the array.
|
14659
|
-
@property {Boolean} hasArrayObservers
|
14660
|
-
@public
|
14661
|
-
*/
|
14662
|
-
hasArrayObservers: _emberMetalComputed.computed(function () {
|
14663
|
-
return _emberMetalEvents.hasListeners(this, '@array:change') || _emberMetalEvents.hasListeners(this, '@array:before');
|
14664
|
-
}),
|
14721
|
+
this.enumerableContentDidChange(removeAmt, adding);
|
14665
14722
|
|
14666
|
-
|
14667
|
-
|
14668
|
-
|
14669
|
-
invalidate any related properties. Pass the starting index of the change
|
14670
|
-
as well as a delta of the amounts to change.
|
14671
|
-
@method arrayContentWillChange
|
14672
|
-
@param {Number} startIdx The starting index in the array that will change.
|
14673
|
-
@param {Number} removeAmt The number of items that will be removed. If you
|
14674
|
-
pass `null` assumes 0
|
14675
|
-
@param {Number} addAmt The number of items that will be added. If you
|
14676
|
-
pass `null` assumes 0.
|
14677
|
-
@return {Ember.Array} receiver
|
14678
|
-
@public
|
14679
|
-
*/
|
14680
|
-
arrayContentWillChange: function (startIdx, removeAmt, addAmt) {
|
14681
|
-
var removing, lim;
|
14723
|
+
if (this.__each) {
|
14724
|
+
this.__each.arrayDidChange(this, startIdx, removeAmt, addAmt);
|
14725
|
+
}
|
14682
14726
|
|
14683
|
-
|
14684
|
-
if (startIdx === undefined) {
|
14685
|
-
startIdx = 0;
|
14686
|
-
removeAmt = addAmt = -1;
|
14687
|
-
} else {
|
14688
|
-
if (removeAmt === undefined) {
|
14689
|
-
removeAmt = -1;
|
14690
|
-
}
|
14727
|
+
_emberMetalEvents.sendEvent(this, '@array:change', [this, startIdx, removeAmt, addAmt]);
|
14691
14728
|
|
14692
|
-
|
14693
|
-
|
14694
|
-
|
14695
|
-
}
|
14729
|
+
var length = _emberMetalProperty_get.get(this, 'length');
|
14730
|
+
var cachedFirst = _emberMetalComputed.cacheFor(this, 'firstObject');
|
14731
|
+
var cachedLast = _emberMetalComputed.cacheFor(this, 'lastObject');
|
14696
14732
|
|
14697
|
-
|
14698
|
-
|
14699
|
-
|
14733
|
+
if (objectAt(this, 0) !== cachedFirst) {
|
14734
|
+
_emberMetalProperty_events.propertyWillChange(this, 'firstObject');
|
14735
|
+
_emberMetalProperty_events.propertyDidChange(this, 'firstObject');
|
14736
|
+
}
|
14700
14737
|
|
14701
|
-
|
14738
|
+
if (objectAt(this, length - 1) !== cachedLast) {
|
14739
|
+
_emberMetalProperty_events.propertyWillChange(this, 'lastObject');
|
14740
|
+
_emberMetalProperty_events.propertyDidChange(this, 'lastObject');
|
14741
|
+
}
|
14702
14742
|
|
14703
|
-
|
14704
|
-
|
14705
|
-
|
14743
|
+
return this;
|
14744
|
+
}, _Mixin$create['@each'] = _emberMetalComputed.computed(function () {
|
14745
|
+
// TODO use Symbol or add to meta
|
14746
|
+
if (!this.__each) {
|
14747
|
+
this.__each = new _emberRuntimeSystemEach_proxy.default(this);
|
14748
|
+
}
|
14706
14749
|
|
14707
|
-
|
14708
|
-
|
14709
|
-
|
14710
|
-
|
14711
|
-
removing = removeAmt;
|
14712
|
-
}
|
14750
|
+
return this.__each;
|
14751
|
+
}).volatile(), _Mixin$create));
|
14752
|
+
});
|
14753
|
+
// ES6TODO: Ember.A
|
14713
14754
|
|
14714
|
-
|
14755
|
+
/**
|
14756
|
+
__Required.__ You must implement this method to apply this mixin.
|
14757
|
+
Your array must support the `length` property. Your replace methods should
|
14758
|
+
set this property whenever it changes.
|
14759
|
+
@property {Number} length
|
14760
|
+
@public
|
14761
|
+
*/
|
14715
14762
|
|
14716
|
-
|
14717
|
-
|
14763
|
+
/**
|
14764
|
+
Returns the object at the given `index`. If the given `index` is negative
|
14765
|
+
or is greater or equal than the array length, returns `undefined`.
|
14766
|
+
This is one of the primitives you must implement to support `Ember.Array`.
|
14767
|
+
If your object supports retrieving the value of an array item using `get()`
|
14768
|
+
(i.e. `myArray.get(0)`), then you do not need to implement this method
|
14769
|
+
yourself.
|
14770
|
+
```javascript
|
14771
|
+
var arr = ['a', 'b', 'c', 'd'];
|
14772
|
+
arr.objectAt(0); // 'a'
|
14773
|
+
arr.objectAt(3); // 'd'
|
14774
|
+
arr.objectAt(-1); // undefined
|
14775
|
+
arr.objectAt(4); // undefined
|
14776
|
+
arr.objectAt(5); // undefined
|
14777
|
+
```
|
14778
|
+
@method objectAt
|
14779
|
+
@param {Number} idx The index of the item to return.
|
14780
|
+
@return {*} item at index or undefined
|
14781
|
+
@public
|
14782
|
+
*/
|
14718
14783
|
|
14719
|
-
|
14720
|
-
|
14721
|
-
|
14722
|
-
|
14723
|
-
|
14724
|
-
|
14725
|
-
|
14726
|
-
|
14727
|
-
|
14728
|
-
|
14729
|
-
|
14730
|
-
|
14731
|
-
@public
|
14732
|
-
*/
|
14733
|
-
arrayContentDidChange: function (startIdx, removeAmt, addAmt) {
|
14734
|
-
var adding, lim;
|
14784
|
+
/**
|
14785
|
+
This returns the objects at the specified indexes, using `objectAt`.
|
14786
|
+
```javascript
|
14787
|
+
var arr = ['a', 'b', 'c', 'd'];
|
14788
|
+
arr.objectsAt([0, 1, 2]); // ['a', 'b', 'c']
|
14789
|
+
arr.objectsAt([2, 3, 4]); // ['c', 'd', undefined]
|
14790
|
+
```
|
14791
|
+
@method objectsAt
|
14792
|
+
@param {Array} indexes An array of indexes of items to return.
|
14793
|
+
@return {Array}
|
14794
|
+
@public
|
14795
|
+
*/
|
14735
14796
|
|
14736
|
-
|
14737
|
-
if (startIdx === undefined) {
|
14738
|
-
startIdx = 0;
|
14739
|
-
removeAmt = addAmt = -1;
|
14740
|
-
} else {
|
14741
|
-
if (removeAmt === undefined) {
|
14742
|
-
removeAmt = -1;
|
14743
|
-
}
|
14797
|
+
// overrides Ember.Enumerable version
|
14744
14798
|
|
14745
|
-
|
14746
|
-
|
14747
|
-
|
14748
|
-
|
14799
|
+
/**
|
14800
|
+
This is the handler for the special array content property. If you get
|
14801
|
+
this property, it will return this. If you set this property to a new
|
14802
|
+
array, it will replace the current content.
|
14803
|
+
This property overrides the default property defined in `Ember.Enumerable`.
|
14804
|
+
@property []
|
14805
|
+
@return this
|
14806
|
+
@public
|
14807
|
+
*/
|
14749
14808
|
|
14750
|
-
|
14751
|
-
adding = [];
|
14752
|
-
lim = startIdx + addAmt;
|
14809
|
+
// optimized version from Enumerable
|
14753
14810
|
|
14754
|
-
|
14755
|
-
|
14756
|
-
|
14757
|
-
|
14758
|
-
|
14759
|
-
|
14811
|
+
// Add any extra methods to Ember.Array that are native to the built-in Array.
|
14812
|
+
/**
|
14813
|
+
Returns a new array that is a slice of the receiver. This implementation
|
14814
|
+
uses the observable array methods to retrieve the objects for the new
|
14815
|
+
slice.
|
14816
|
+
```javascript
|
14817
|
+
var arr = ['red', 'green', 'blue'];
|
14818
|
+
arr.slice(0); // ['red', 'green', 'blue']
|
14819
|
+
arr.slice(0, 2); // ['red', 'green']
|
14820
|
+
arr.slice(1, 100); // ['green', 'blue']
|
14821
|
+
```
|
14822
|
+
@method slice
|
14823
|
+
@param {Number} beginIndex (Optional) index to begin slicing from.
|
14824
|
+
@param {Number} endIndex (Optional) index to end the slice at (but not included).
|
14825
|
+
@return {Array} New array with specified slice
|
14826
|
+
@public
|
14827
|
+
*/
|
14760
14828
|
|
14761
|
-
|
14829
|
+
/**
|
14830
|
+
Returns the index of the given object's first occurrence.
|
14831
|
+
If no `startAt` argument is given, the starting location to
|
14832
|
+
search is 0. If it's negative, will count backward from
|
14833
|
+
the end of the array. Returns -1 if no match is found.
|
14834
|
+
```javascript
|
14835
|
+
var arr = ['a', 'b', 'c', 'd', 'a'];
|
14836
|
+
arr.indexOf('a'); // 0
|
14837
|
+
arr.indexOf('z'); // -1
|
14838
|
+
arr.indexOf('a', 2); // 4
|
14839
|
+
arr.indexOf('a', -1); // 4
|
14840
|
+
arr.indexOf('b', 3); // -1
|
14841
|
+
arr.indexOf('a', 100); // -1
|
14842
|
+
```
|
14843
|
+
@method indexOf
|
14844
|
+
@param {Object} object the item to search for
|
14845
|
+
@param {Number} startAt optional starting location to search, default 0
|
14846
|
+
@return {Number} index or -1 if not found
|
14847
|
+
@public
|
14848
|
+
*/
|
14762
14849
|
|
14763
|
-
|
14764
|
-
|
14765
|
-
|
14850
|
+
/**
|
14851
|
+
Returns the index of the given object's last occurrence.
|
14852
|
+
If no `startAt` argument is given, the search starts from
|
14853
|
+
the last position. If it's negative, will count backward
|
14854
|
+
from the end of the array. Returns -1 if no match is found.
|
14855
|
+
```javascript
|
14856
|
+
var arr = ['a', 'b', 'c', 'd', 'a'];
|
14857
|
+
arr.lastIndexOf('a'); // 4
|
14858
|
+
arr.lastIndexOf('z'); // -1
|
14859
|
+
arr.lastIndexOf('a', 2); // 0
|
14860
|
+
arr.lastIndexOf('a', -1); // 4
|
14861
|
+
arr.lastIndexOf('b', 3); // 1
|
14862
|
+
arr.lastIndexOf('a', 100); // 4
|
14863
|
+
```
|
14864
|
+
@method lastIndexOf
|
14865
|
+
@param {Object} object the item to search for
|
14866
|
+
@param {Number} startAt optional starting location to search, default 0
|
14867
|
+
@return {Number} index or -1 if not found
|
14868
|
+
@public
|
14869
|
+
*/
|
14766
14870
|
|
14767
|
-
|
14871
|
+
// ..........................................................
|
14872
|
+
// ARRAY OBSERVERS
|
14873
|
+
//
|
14768
14874
|
|
14769
|
-
|
14770
|
-
|
14771
|
-
|
14875
|
+
/**
|
14876
|
+
Adds an array observer to the receiving array. The array observer object
|
14877
|
+
normally must implement two methods:
|
14878
|
+
* `arrayWillChange(observedObj, start, removeCount, addCount)` - This method will be
|
14879
|
+
called just before the array is modified.
|
14880
|
+
* `arrayDidChange(observedObj, start, removeCount, addCount)` - This method will be
|
14881
|
+
called just after the array is modified.
|
14882
|
+
Both callbacks will be passed the observed object, starting index of the
|
14883
|
+
change as well as a count of the items to be removed and added. You can use
|
14884
|
+
these callbacks to optionally inspect the array during the change, clear
|
14885
|
+
caches, or do any other bookkeeping necessary.
|
14886
|
+
In addition to passing a target, you can also include an options hash
|
14887
|
+
which you can use to override the method names that will be invoked on the
|
14888
|
+
target.
|
14889
|
+
@method addArrayObserver
|
14890
|
+
@param {Object} target The observer object.
|
14891
|
+
@param {Object} opts Optional hash of configuration options including
|
14892
|
+
`willChange` and `didChange` option.
|
14893
|
+
@return {Ember.Array} receiver
|
14894
|
+
@public
|
14895
|
+
*/
|
14772
14896
|
|
14773
|
-
|
14774
|
-
|
14775
|
-
|
14776
|
-
|
14897
|
+
/**
|
14898
|
+
Removes an array observer from the object if the observer is current
|
14899
|
+
registered. Calling this method multiple times with the same object will
|
14900
|
+
have no effect.
|
14901
|
+
@method removeArrayObserver
|
14902
|
+
@param {Object} target The object observing the array.
|
14903
|
+
@param {Object} opts Optional hash of configuration options including
|
14904
|
+
`willChange` and `didChange` option.
|
14905
|
+
@return {Ember.Array} receiver
|
14906
|
+
@public
|
14907
|
+
*/
|
14777
14908
|
|
14778
|
-
|
14779
|
-
|
14780
|
-
|
14781
|
-
|
14909
|
+
/**
|
14910
|
+
Becomes true whenever the array currently has observers watching changes
|
14911
|
+
on the array.
|
14912
|
+
@property {Boolean} hasArrayObservers
|
14913
|
+
@public
|
14914
|
+
*/
|
14782
14915
|
|
14783
|
-
|
14784
|
-
|
14916
|
+
/**
|
14917
|
+
If you are implementing an object that supports `Ember.Array`, call this
|
14918
|
+
method just before the array content changes to notify any observers and
|
14919
|
+
invalidate any related properties. Pass the starting index of the change
|
14920
|
+
as well as a delta of the amounts to change.
|
14921
|
+
@method arrayContentWillChange
|
14922
|
+
@param {Number} startIdx The starting index in the array that will change.
|
14923
|
+
@param {Number} removeAmt The number of items that will be removed. If you
|
14924
|
+
pass `null` assumes 0
|
14925
|
+
@param {Number} addAmt The number of items that will be added. If you
|
14926
|
+
pass `null` assumes 0.
|
14927
|
+
@return {Ember.Array} receiver
|
14928
|
+
@public
|
14929
|
+
*/
|
14785
14930
|
|
14786
|
-
|
14787
|
-
|
14788
|
-
|
14789
|
-
|
14790
|
-
|
14791
|
-
|
14792
|
-
|
14793
|
-
|
14794
|
-
|
14795
|
-
|
14796
|
-
|
14797
|
-
|
14798
|
-
|
14799
|
-
|
14800
|
-
myMethod: computed('posts.[]', function(){
|
14801
|
-
...
|
14802
|
-
});
|
14803
|
-
```
|
14804
|
-
@property @each
|
14805
|
-
@public
|
14806
|
-
*/
|
14807
|
-
'@each': _emberMetalComputed.computed(function () {
|
14808
|
-
// TODO use Symbol or add to meta
|
14809
|
-
if (!this.__each) {
|
14810
|
-
this.__each = new _emberRuntimeSystemEach_proxy.default(this);
|
14811
|
-
}
|
14931
|
+
/**
|
14932
|
+
If you are implementing an object that supports `Ember.Array`, call this
|
14933
|
+
method just after the array content changes to notify any observers and
|
14934
|
+
invalidate any related properties. Pass the starting index of the change
|
14935
|
+
as well as a delta of the amounts to change.
|
14936
|
+
@method arrayContentDidChange
|
14937
|
+
@param {Number} startIdx The starting index in the array that did change.
|
14938
|
+
@param {Number} removeAmt The number of items that were removed. If you
|
14939
|
+
pass `null` assumes 0
|
14940
|
+
@param {Number} addAmt The number of items that were added. If you
|
14941
|
+
pass `null` assumes 0.
|
14942
|
+
@return {Ember.Array} receiver
|
14943
|
+
@public
|
14944
|
+
*/
|
14812
14945
|
|
14813
|
-
|
14814
|
-
|
14946
|
+
/**
|
14947
|
+
Returns a special object that can be used to observe individual properties
|
14948
|
+
on the array. Just get an equivalent property on this object and it will
|
14949
|
+
return an enumerable that maps automatically to the named key on the
|
14950
|
+
member objects.
|
14951
|
+
`@each` should only be used in a non-terminal context. Example:
|
14952
|
+
```javascript
|
14953
|
+
myMethod: computed('posts.@each.author', function(){
|
14954
|
+
...
|
14815
14955
|
});
|
14816
|
-
|
14817
|
-
|
14956
|
+
```
|
14957
|
+
If you merely want to watch for the array being changed, like an object being
|
14958
|
+
replaced, added or removed, use `[]` instead of `@each`.
|
14959
|
+
```javascript
|
14960
|
+
myMethod: computed('posts.[]', function(){
|
14961
|
+
...
|
14962
|
+
});
|
14963
|
+
```
|
14964
|
+
@property @each
|
14965
|
+
@public
|
14966
|
+
*/
|
14818
14967
|
enifed('ember-runtime/mixins/comparable', ['exports', 'ember-metal/mixin'], function (exports, _emberMetalMixin) {
|
14819
14968
|
'use strict';
|
14820
14969
|
|
@@ -14892,7 +15041,9 @@ enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal/run_loop
|
|
14892
15041
|
@method ownerInjection
|
14893
15042
|
@return {Object}
|
14894
15043
|
*/
|
14895
|
-
ownerInjection:
|
15044
|
+
ownerInjection: function () {
|
15045
|
+
return this.__container__.ownerInjection();
|
15046
|
+
},
|
14896
15047
|
|
14897
15048
|
/**
|
14898
15049
|
Given a fullName return a corresponding instance.
|
@@ -14925,7 +15076,9 @@ enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal/run_loop
|
|
14925
15076
|
@param {Object} options
|
14926
15077
|
@return {any}
|
14927
15078
|
*/
|
14928
|
-
lookup:
|
15079
|
+
lookup: function (fullName, options) {
|
15080
|
+
return this.__container__.lookup(fullName, options);
|
15081
|
+
},
|
14929
15082
|
|
14930
15083
|
/**
|
14931
15084
|
Given a fullName return the corresponding factory.
|
@@ -14934,7 +15087,9 @@ enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal/run_loop
|
|
14934
15087
|
@param {String} fullName
|
14935
15088
|
@return {any}
|
14936
15089
|
*/
|
14937
|
-
_lookupFactory:
|
15090
|
+
_lookupFactory: function (fullName, options) {
|
15091
|
+
return this.__container__.lookupFactory(fullName, options);
|
15092
|
+
},
|
14938
15093
|
|
14939
15094
|
/**
|
14940
15095
|
@private
|
@@ -14948,14 +15103,6 @@ enifed('ember-runtime/mixins/container_proxy', ['exports', 'ember-metal/run_loop
|
|
14948
15103
|
}
|
14949
15104
|
});
|
14950
15105
|
|
14951
|
-
function containerAlias(name) {
|
14952
|
-
return function () {
|
14953
|
-
var _container__;
|
14954
|
-
|
14955
|
-
return (_container__ = this.__container__)[name].apply(_container__, arguments);
|
14956
|
-
};
|
14957
|
-
}
|
14958
|
-
|
14959
15106
|
function buildFakeContainerWithDeprecations(container) {
|
14960
15107
|
var fakeContainer = {};
|
14961
15108
|
var propertyMappings = {
|
@@ -15130,7 +15277,7 @@ enifed('ember-runtime/mixins/copyable', ['exports', 'ember-metal/debug', 'ember-
|
|
15130
15277
|
}
|
15131
15278
|
});
|
15132
15279
|
});
|
15133
|
-
enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/mixin', 'ember-metal/computed', 'ember-metal/property_events', 'ember-metal/events', 'ember-runtime/compare', 'require'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMixin, _emberMetalComputed, _emberMetalProperty_events, _emberMetalEvents, _emberRuntimeCompare, _require) {
|
15280
|
+
enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-metal/property_get', 'ember-metal/property_set', 'ember-metal/mixin', 'ember-metal/utils', 'ember-metal/computed', 'ember-metal/empty_object', 'ember-metal/features', 'ember-metal/property_events', 'ember-metal/events', 'ember-runtime/compare', 'require'], function (exports, _emberMetalProperty_get, _emberMetalProperty_set, _emberMetalMixin, _emberMetalUtils, _emberMetalComputed, _emberMetalEmpty_object, _emberMetalFeatures, _emberMetalProperty_events, _emberMetalEvents, _emberRuntimeCompare, _require) {
|
15134
15281
|
/**
|
15135
15282
|
@module ember
|
15136
15283
|
@submodule ember-runtime
|
@@ -15208,7 +15355,7 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-metal/property_get'
|
|
15208
15355
|
@since Ember 0.9
|
15209
15356
|
@private
|
15210
15357
|
*/
|
15211
|
-
|
15358
|
+
var Enumerable = _emberMetalMixin.Mixin.create({
|
15212
15359
|
|
15213
15360
|
/**
|
15214
15361
|
__Required.__ You must implement this method to apply this mixin.
|
@@ -15272,7 +15419,7 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-metal/property_get'
|
|
15272
15419
|
pushCtx(context);
|
15273
15420
|
|
15274
15421
|
return ret;
|
15275
|
-
}),
|
15422
|
+
}).readOnly(),
|
15276
15423
|
|
15277
15424
|
/**
|
15278
15425
|
Helper method returns the last object from a collection. If your enumerable
|
@@ -15309,7 +15456,7 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-metal/property_get'
|
|
15309
15456
|
pushCtx(context);
|
15310
15457
|
|
15311
15458
|
return last;
|
15312
|
-
}),
|
15459
|
+
}).readOnly(),
|
15313
15460
|
|
15314
15461
|
/**
|
15315
15462
|
Returns `true` if the passed object can be found in the receiver. The
|
@@ -16106,6 +16253,39 @@ enifed('ember-runtime/mixins/enumerable', ['exports', 'ember-metal/property_get'
|
|
16106
16253
|
});
|
16107
16254
|
}
|
16108
16255
|
});
|
16256
|
+
|
16257
|
+
if (_emberMetalFeatures.default('ember-runtime-computed-uniq-by')) {
|
16258
|
+
Enumerable.reopen({
|
16259
|
+
/**
|
16260
|
+
Returns a new enumerable that contains only items containing a unique property value.
|
16261
|
+
The default implementation returns an array regardless of the receiver type.
|
16262
|
+
```javascript
|
16263
|
+
var arr = [{ value: 'a' }, { value: 'a' }, { value: 'b' }, { value: 'b' }];
|
16264
|
+
arr.uniqBy('value'); // [{ value: 'a' }, { value: 'b' }]
|
16265
|
+
```
|
16266
|
+
@method uniqBy
|
16267
|
+
@return {Ember.Enumerable}
|
16268
|
+
@public
|
16269
|
+
*/
|
16270
|
+
|
16271
|
+
uniqBy: function (key) {
|
16272
|
+
var ret = emberA();
|
16273
|
+
var seen = new _emberMetalEmpty_object.default();
|
16274
|
+
|
16275
|
+
this.forEach(function (item) {
|
16276
|
+
var guid = _emberMetalUtils.guidFor(_emberMetalProperty_get.get(item, key));
|
16277
|
+
if (!(guid in seen)) {
|
16278
|
+
seen[guid] = true;
|
16279
|
+
ret.push(item);
|
16280
|
+
}
|
16281
|
+
});
|
16282
|
+
|
16283
|
+
return ret;
|
16284
|
+
}
|
16285
|
+
});
|
16286
|
+
}
|
16287
|
+
|
16288
|
+
exports.default = Enumerable;
|
16109
16289
|
});
|
16110
16290
|
enifed('ember-runtime/mixins/evented', ['exports', 'ember-metal/mixin', 'ember-metal/events'], function (exports, _emberMetalMixin, _emberMetalEvents) {
|
16111
16291
|
'use strict';
|
@@ -18508,11 +18688,18 @@ enifed('ember-runtime/system/core_object', ['exports', 'ember-metal/debug', 'emb
|
|
18508
18688
|
var extension = hasToStringExtension ? ':' + this.toStringExtension() : '';
|
18509
18689
|
var ret = '<' + this.constructor.toString() + ':' + _emberMetalUtils.guidFor(this) + extension + '>';
|
18510
18690
|
|
18691
|
+
this.toString = makeToString(ret);
|
18511
18692
|
return ret;
|
18512
18693
|
}, _Mixin$create));
|
18513
18694
|
|
18514
18695
|
CoreObject.PrototypeMixin.ownerConstructor = CoreObject;
|
18515
18696
|
|
18697
|
+
function makeToString(ret) {
|
18698
|
+
return function () {
|
18699
|
+
return ret;
|
18700
|
+
};
|
18701
|
+
}
|
18702
|
+
|
18516
18703
|
CoreObject.__super__ = null;
|
18517
18704
|
|
18518
18705
|
var ClassMixinProps = {
|
@@ -19528,7 +19715,7 @@ enifed('ember-runtime/system/native_array', ['exports', 'ember-metal/core', 'emb
|
|
19528
19715
|
Array support Ember.MutableArray and all of its dependent APIs. Unless you
|
19529
19716
|
have `Ember.EXTEND_PROTOTYPES` or `Ember.EXTEND_PROTOTYPES.Array` set to
|
19530
19717
|
false, this will be applied automatically. Otherwise you can apply the mixin
|
19531
|
-
at anytime by calling `Ember.NativeArray.
|
19718
|
+
at anytime by calling `Ember.NativeArray.apply(Array.prototype)`.
|
19532
19719
|
|
19533
19720
|
@class NativeArray
|
19534
19721
|
@namespace Ember
|
@@ -19623,12 +19810,13 @@ enifed('ember-runtime/system/native_array', ['exports', 'ember-metal/core', 'emb
|
|
19623
19810
|
Example
|
19624
19811
|
|
19625
19812
|
```js
|
19626
|
-
|
19813
|
+
export default Ember.Component.extend({
|
19627
19814
|
tagName: 'ul',
|
19628
19815
|
classNames: ['pagination'],
|
19629
19816
|
|
19630
|
-
init
|
19817
|
+
init() {
|
19631
19818
|
this._super(...arguments);
|
19819
|
+
|
19632
19820
|
if (!this.get('content')) {
|
19633
19821
|
this.set('content', Ember.A());
|
19634
19822
|
}
|