ember-source 4.4.0-alpha.5 → 4.4.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -4
- package/blueprints/-addon-import.js +9 -0
- package/blueprints/-maybe-polyfill-typescript-blueprints.js +17 -0
- package/blueprints/acceptance-test/index.js +8 -0
- package/blueprints/acceptance-test/mocha-rfc-232-files/tests/acceptance/{__name__-test.js → __name__-test.ts} +0 -0
- package/blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/{__name__-test.js → __name__-test.ts} +0 -0
- package/blueprints/component/files/__root__/__path__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/component/index.js +6 -1
- package/blueprints/component-addon/files/__root__/__path__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/component-addon/index.js +9 -0
- package/blueprints/component-class/files/__root__/__path__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/component-class/index.js +5 -0
- package/blueprints/component-class-addon/files/__root__/__path__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/component-class-addon/index.js +9 -0
- package/blueprints/component-test/index.js +8 -0
- package/blueprints/component-test/mocha-rfc-232-files/__root__/__testType__/__path__/{__test__.js → __test__.ts} +0 -0
- package/blueprints/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/{__test__.js → __test__.ts} +1 -1
- package/blueprints/controller/files/__root__/__path__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/controller/index.js +10 -0
- package/blueprints/controller-test/index.js +10 -0
- package/blueprints/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/{__test__.js → __test__.ts} +0 -0
- package/blueprints/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/{__test__.js → __test__.ts} +0 -0
- package/blueprints/helper/files/__root__/__collection__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/helper/index.js +9 -0
- package/blueprints/helper-addon/files/__root__/__path__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/helper-test/index.js +9 -0
- package/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/{__name__-test.js → __name__-test.ts} +0 -0
- package/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/{__name__-test.js → __name__-test.ts} +0 -0
- package/blueprints/initializer/files/__root__/initializers/__name__.ts +6 -0
- package/blueprints/initializer/index.js +9 -0
- package/blueprints/initializer-addon/files/__root__/__path__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/initializer-test/index.js +8 -0
- package/blueprints/initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/{__name__-test.js → __name__-test.ts} +3 -1
- package/blueprints/initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.ts +37 -0
- package/blueprints/instance-initializer/files/__root__/instance-initializers/__name__.ts +6 -0
- package/blueprints/instance-initializer/index.js +9 -0
- package/blueprints/instance-initializer-addon/files/__root__/__path__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/instance-initializer-test/index.js +8 -0
- package/blueprints/instance-initializer-test/mocha-rfc-232-files/__root__/__testType__/__path__/{__name__-test.js → __name__-test.ts} +5 -1
- package/blueprints/instance-initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/{__name__-test.js → __name__-test.ts} +6 -1
- package/blueprints/route/files/__root__/__path__/{__name__.js → __name__.ts} +2 -4
- package/blueprints/route/index.js +9 -0
- package/blueprints/route-addon/files/__root__/__path__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/route-addon/index.js +9 -0
- package/blueprints/route-test/index.js +9 -0
- package/blueprints/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/{__test__.js → __test__.ts} +0 -0
- package/blueprints/route-test/qunit-rfc-232-files/__root__/__testType__/__path__/{__test__.js → __test__.ts} +0 -0
- package/blueprints/service/files/__root__/__path__/{__name__.js → __name__.ts} +0 -0
- package/blueprints/service/index.js +10 -0
- package/blueprints/service-test/index.js +8 -0
- package/blueprints/service-test/mocha-rfc-232-files/__root__/__testType__/__path__/{__test__.js → __test__.ts} +0 -0
- package/blueprints/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/{__test__.js → __test__.ts} +0 -0
- package/blueprints/util/files/__root__/utils/{__name__.js → __name__.ts} +0 -0
- package/blueprints/util/index.js +10 -0
- package/blueprints/util-test/index.js +8 -0
- package/blueprints/util-test/mocha-rfc-232-files/__root__/__testType__/{__name__-test.js → __name__-test.ts} +0 -0
- package/blueprints/util-test/qunit-rfc-232-files/__root__/__testType__/{__name__-test.js → __name__-test.ts} +0 -0
- package/build-metadata.json +3 -3
- package/dist/ember-template-compiler.js +5 -11
- package/dist/ember-template-compiler.map +1 -1
- package/dist/ember-testing.js +1 -1
- package/dist/ember-testing.map +1 -1
- package/dist/ember.debug.js +475 -783
- package/dist/ember.debug.map +1 -1
- package/dist/header/license.js +1 -1
- package/dist/packages/@ember/-internals/container/index.js +1 -10
- package/dist/packages/@ember/-internals/glimmer/index.js +102 -217
- package/dist/packages/@ember/-internals/meta/lib/meta.js +1 -1
- package/dist/packages/@ember/-internals/metal/index.js +22 -21
- package/dist/packages/@ember/-internals/routing/lib/services/router.js +140 -145
- package/dist/packages/@ember/-internals/routing/lib/system/route-info.js +4 -0
- package/dist/packages/@ember/-internals/routing/lib/system/router.js +2 -0
- package/dist/packages/@ember/-internals/routing/lib/system/transition.js +4 -0
- package/dist/packages/@ember/-internals/runtime/lib/system/core_object.js +118 -302
- package/dist/packages/@ember/-internals/runtime/lib/system/object.js +8 -23
- package/dist/packages/@ember/-internals/views/lib/views/core_view.js +47 -29
- package/dist/packages/@ember/canary-features/index.js +2 -6
- package/dist/packages/ember/version.js +1 -1
- package/docs/data.json +447 -809
- package/package.json +20 -17
- package/blueprints/initializer/files/__root__/initializers/__name__.js +0 -5
- package/blueprints/initializer-test/qunit-rfc-232-files/__root__/__testType__/__path__/__name__-test.js +0 -34
- package/blueprints/instance-initializer/files/__root__/instance-initializers/__name__.js +0 -5
- package/dist/packages/@ember/renderer/index.js +0 -21
package/dist/ember.debug.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
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 4.4.0-
|
|
9
|
+
* @version 4.4.0-beta.1
|
|
10
10
|
*/
|
|
11
11
|
/* eslint-disable no-var */
|
|
12
12
|
|
|
@@ -564,11 +564,6 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
|
|
|
564
564
|
this.normalizedName = normalizedName;
|
|
565
565
|
this.madeToString = undefined;
|
|
566
566
|
this.injections = undefined;
|
|
567
|
-
setFactoryFor(this, this);
|
|
568
|
-
|
|
569
|
-
if (isInstantiatable(container, fullName)) {
|
|
570
|
-
setFactoryFor(factory, this);
|
|
571
|
-
}
|
|
572
567
|
}
|
|
573
568
|
|
|
574
569
|
toString() {
|
|
@@ -588,14 +583,10 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
|
|
|
588
583
|
throw new Error(`Cannot create new instances after the owner has been destroyed (you attempted to create ${this.fullName})`);
|
|
589
584
|
}
|
|
590
585
|
|
|
591
|
-
var props = {};
|
|
586
|
+
var props = options ? Object.assign({}, options) : {};
|
|
592
587
|
(0, _owner.setOwner)(props, container.owner);
|
|
593
588
|
setFactoryFor(props, this);
|
|
594
589
|
|
|
595
|
-
if (options !== undefined) {
|
|
596
|
-
props = Object.assign({}, props, options);
|
|
597
|
-
}
|
|
598
|
-
|
|
599
590
|
if (true
|
|
600
591
|
/* DEBUG */
|
|
601
592
|
) {
|
|
@@ -4712,12 +4703,35 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
4712
4703
|
|
|
4713
4704
|
var lazyEventsProcessed = new WeakMap();
|
|
4714
4705
|
|
|
4715
|
-
|
|
4716
|
-
|
|
4706
|
+
class Component extends _views.CoreView.extend(_views.ChildViewsSupport, _views.ViewStateSupport, _views.ClassNamesSupport, _runtime2.TargetActionSupport, _views.ActionSupport, _views.ViewMixin, {
|
|
4707
|
+
// These need to be overridable via extend/create but should still
|
|
4708
|
+
// have a default. Defining them here is the best way to achieve that.
|
|
4709
|
+
didReceiveAttrs() {},
|
|
4717
4710
|
|
|
4718
|
-
|
|
4719
|
-
|
|
4711
|
+
didRender() {},
|
|
4712
|
+
|
|
4713
|
+
didUpdate() {},
|
|
4714
|
+
|
|
4715
|
+
didUpdateAttrs() {},
|
|
4716
|
+
|
|
4717
|
+
willRender() {},
|
|
4718
|
+
|
|
4719
|
+
willUpdate() {}
|
|
4720
|
+
|
|
4721
|
+
}) {
|
|
4722
|
+
constructor() {
|
|
4723
|
+
super(...arguments);
|
|
4724
|
+
this.isComponent = true;
|
|
4725
|
+
}
|
|
4726
|
+
|
|
4727
|
+
init(properties) {
|
|
4728
|
+
super.init(properties); // Handle methods from ViewMixin.
|
|
4729
|
+
// The native class inheritance will not work for mixins. To work around this,
|
|
4730
|
+
// we copy the existing rerender method provided by the mixin and swap in the
|
|
4731
|
+
// new rerender method from our class.
|
|
4720
4732
|
|
|
4733
|
+
this._superRerender = this.rerender;
|
|
4734
|
+
this.rerender = this._rerender;
|
|
4721
4735
|
this[IS_DISPATCHING_ATTRS] = false;
|
|
4722
4736
|
this[DIRTY_TAG] = (0, _validator.createTag)();
|
|
4723
4737
|
this[BOUNDS] = null;
|
|
@@ -4753,7 +4767,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
4753
4767
|
for (var key in events) {
|
|
4754
4768
|
var methodName = events[key];
|
|
4755
4769
|
|
|
4756
|
-
if (typeof this[methodName] === 'function') {
|
|
4770
|
+
if (methodName && typeof this[methodName] === 'function') {
|
|
4757
4771
|
eventNames.push(methodName);
|
|
4758
4772
|
}
|
|
4759
4773
|
} // If in a tagless component, assert that no event handlers are defined
|
|
@@ -4761,7 +4775,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
4761
4775
|
|
|
4762
4776
|
(true && !(!eventNames.length) && (0, _debug.assert)(`You can not define \`${eventNames}\` function(s) to handle DOM event in the \`${this}\` tagless component since it doesn't have any DOM element.`, !eventNames.length));
|
|
4763
4777
|
}
|
|
4764
|
-
}
|
|
4778
|
+
}
|
|
4765
4779
|
|
|
4766
4780
|
get _dispatcher() {
|
|
4767
4781
|
if (this.__dispatcher === undefined) {
|
|
@@ -4769,8 +4783,9 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
4769
4783
|
(true && !(owner) && (0, _debug.assert)('Component is unexpectedly missing an owner', owner));
|
|
4770
4784
|
|
|
4771
4785
|
if (owner.lookup('-environment:main').isInteractive) {
|
|
4772
|
-
|
|
4773
|
-
(true && !(
|
|
4786
|
+
var dispatcher = owner.lookup('event_dispatcher:main');
|
|
4787
|
+
(true && !(dispatcher instanceof _views.EventDispatcher) && (0, _debug.assert)('Expected dispatcher to be an EventDispatcher', dispatcher instanceof _views.EventDispatcher));
|
|
4788
|
+
this.__dispatcher = dispatcher;
|
|
4774
4789
|
} else {
|
|
4775
4790
|
// In FastBoot we have no EventDispatcher. Set to null to not try again to look it up.
|
|
4776
4791
|
this.__dispatcher = null;
|
|
@@ -4778,20 +4793,24 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
4778
4793
|
}
|
|
4779
4794
|
|
|
4780
4795
|
return this.__dispatcher;
|
|
4781
|
-
}
|
|
4796
|
+
}
|
|
4782
4797
|
|
|
4783
|
-
on(
|
|
4798
|
+
on(name, target, method) {
|
|
4784
4799
|
var _a;
|
|
4785
4800
|
|
|
4786
|
-
(_a = this._dispatcher) === null || _a === void 0 ? void 0 : _a.setupHandlerForEmberEvent(
|
|
4787
|
-
|
|
4788
|
-
|
|
4801
|
+
(_a = this._dispatcher) === null || _a === void 0 ? void 0 : _a.setupHandlerForEmberEvent(name); // The `on` method here comes from the Evented mixin. Since this mixin
|
|
4802
|
+
// is applied to the parent of this class, however, we are still able
|
|
4803
|
+
// to use `super`.
|
|
4789
4804
|
|
|
4790
|
-
|
|
4805
|
+
return super.on(name, target, method);
|
|
4806
|
+
} // Changed to `rerender` on init
|
|
4807
|
+
|
|
4808
|
+
|
|
4809
|
+
_rerender() {
|
|
4791
4810
|
(0, _validator.dirtyTag)(this[DIRTY_TAG]);
|
|
4792
4811
|
|
|
4793
|
-
this.
|
|
4794
|
-
}
|
|
4812
|
+
this._superRerender();
|
|
4813
|
+
}
|
|
4795
4814
|
|
|
4796
4815
|
[_metal.PROPERTY_DID_CHANGE](key, value) {
|
|
4797
4816
|
if (this[IS_DISPATCHING_ATTRS]) {
|
|
@@ -4804,39 +4823,40 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
4804
4823
|
if (reference !== undefined && (0, _reference.isUpdatableRef)(reference)) {
|
|
4805
4824
|
(0, _reference.updateRef)(reference, arguments.length === 2 ? value : (0, _metal.get)(this, key));
|
|
4806
4825
|
}
|
|
4807
|
-
}
|
|
4826
|
+
}
|
|
4808
4827
|
|
|
4809
4828
|
getAttr(key) {
|
|
4810
4829
|
// TODO Intimate API should be deprecated
|
|
4811
4830
|
return this.get(key);
|
|
4812
|
-
}
|
|
4813
|
-
|
|
4831
|
+
}
|
|
4814
4832
|
/**
|
|
4815
4833
|
Normally, Ember's component model is "write-only". The component takes a
|
|
4816
4834
|
bunch of attributes that it got passed in, and uses them to render its
|
|
4817
4835
|
template.
|
|
4818
|
-
|
|
4836
|
+
One nice thing about this model is that if you try to set a value to the
|
|
4819
4837
|
same thing as last time, Ember (through HTMLBars) will avoid doing any
|
|
4820
4838
|
work on the DOM.
|
|
4821
|
-
|
|
4839
|
+
This is not just a performance optimization. If an attribute has not
|
|
4822
4840
|
changed, it is important not to clobber the element's "hidden state".
|
|
4823
4841
|
For example, if you set an input's `value` to the same value as before,
|
|
4824
4842
|
it will clobber selection state and cursor position. In other words,
|
|
4825
4843
|
setting an attribute is not **always** idempotent.
|
|
4826
|
-
|
|
4844
|
+
This method provides a way to read an element's attribute and also
|
|
4827
4845
|
update the last value Ember knows about at the same time. This makes
|
|
4828
4846
|
setting an attribute idempotent.
|
|
4829
|
-
|
|
4847
|
+
In particular, what this means is that if you get an `<input>` element's
|
|
4830
4848
|
`value` attribute and then re-render the template with the same value,
|
|
4831
4849
|
it will avoid clobbering the cursor and selection position.
|
|
4832
4850
|
Since most attribute sets are idempotent in the browser, you typically
|
|
4833
4851
|
can get away with reading attributes using jQuery, but the most reliable
|
|
4834
4852
|
way to do so is through this method.
|
|
4835
4853
|
@method readDOMAttr
|
|
4836
|
-
|
|
4854
|
+
@param {String} name the name of the attribute
|
|
4837
4855
|
@return String
|
|
4838
4856
|
@public
|
|
4839
|
-
|
|
4857
|
+
*/
|
|
4858
|
+
|
|
4859
|
+
|
|
4840
4860
|
readDOMAttr(name) {
|
|
4841
4861
|
// TODO revisit this
|
|
4842
4862
|
var _element = (0, _views.getViewElement)(this);
|
|
@@ -4856,207 +4876,61 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
4856
4876
|
}
|
|
4857
4877
|
|
|
4858
4878
|
return element[normalized];
|
|
4859
|
-
}
|
|
4860
|
-
|
|
4861
|
-
/**
|
|
4862
|
-
The WAI-ARIA role of the control represented by this view. For example, a
|
|
4863
|
-
button may have a role of type 'button', or a pane may have a role of
|
|
4864
|
-
type 'alertdialog'. This property is used by assistive software to help
|
|
4865
|
-
visually challenged users navigate rich web applications.
|
|
4866
|
-
The full list of valid WAI-ARIA roles is available at:
|
|
4867
|
-
[https://www.w3.org/TR/wai-aria/#roles_categorization](https://www.w3.org/TR/wai-aria/#roles_categorization)
|
|
4868
|
-
@property ariaRole
|
|
4869
|
-
@type String
|
|
4870
|
-
@default null
|
|
4871
|
-
@public
|
|
4872
|
-
*/
|
|
4873
|
-
|
|
4874
|
-
/**
|
|
4875
|
-
Enables components to take a list of parameters as arguments.
|
|
4876
|
-
For example, a component that takes two parameters with the names
|
|
4877
|
-
`name` and `age`:
|
|
4878
|
-
```app/components/my-component.js
|
|
4879
|
-
import Component from '@ember/component';
|
|
4880
|
-
let MyComponent = Component.extend();
|
|
4881
|
-
MyComponent.reopenClass({
|
|
4882
|
-
positionalParams: ['name', 'age']
|
|
4883
|
-
});
|
|
4884
|
-
export default MyComponent;
|
|
4885
|
-
```
|
|
4886
|
-
It can then be invoked like this:
|
|
4887
|
-
```hbs
|
|
4888
|
-
{{my-component "John" 38}}
|
|
4889
|
-
```
|
|
4890
|
-
The parameters can be referred to just like named parameters:
|
|
4891
|
-
```hbs
|
|
4892
|
-
Name: {{name}}, Age: {{age}}.
|
|
4893
|
-
```
|
|
4894
|
-
Using a string instead of an array allows for an arbitrary number of
|
|
4895
|
-
parameters:
|
|
4896
|
-
```app/components/my-component.js
|
|
4897
|
-
import Component from '@ember/component';
|
|
4898
|
-
let MyComponent = Component.extend();
|
|
4899
|
-
MyComponent.reopenClass({
|
|
4900
|
-
positionalParams: 'names'
|
|
4901
|
-
});
|
|
4902
|
-
export default MyComponent;
|
|
4903
|
-
```
|
|
4904
|
-
It can then be invoked like this:
|
|
4905
|
-
```hbs
|
|
4906
|
-
{{my-component "John" "Michael" "Scott"}}
|
|
4907
|
-
```
|
|
4908
|
-
The parameters can then be referred to by enumerating over the list:
|
|
4909
|
-
```hbs
|
|
4910
|
-
{{#each names as |name|}}{{name}}{{/each}}
|
|
4911
|
-
```
|
|
4912
|
-
@static
|
|
4913
|
-
@public
|
|
4914
|
-
@property positionalParams
|
|
4915
|
-
@since 1.13.0
|
|
4916
|
-
*/
|
|
4917
|
-
|
|
4918
|
-
/**
|
|
4919
|
-
Called when the attributes passed into the component have been updated.
|
|
4920
|
-
Called both during the initial render of a container and during a rerender.
|
|
4921
|
-
Can be used in place of an observer; code placed here will be executed
|
|
4922
|
-
every time any attribute updates.
|
|
4923
|
-
@method didReceiveAttrs
|
|
4924
|
-
@public
|
|
4925
|
-
@since 1.13.0
|
|
4926
|
-
*/
|
|
4927
|
-
didReceiveAttrs() {},
|
|
4928
|
-
|
|
4929
|
-
/**
|
|
4930
|
-
Called when the attributes passed into the component have been updated.
|
|
4931
|
-
Called both during the initial render of a container and during a rerender.
|
|
4932
|
-
Can be used in place of an observer; code placed here will be executed
|
|
4933
|
-
every time any attribute updates.
|
|
4934
|
-
@event didReceiveAttrs
|
|
4935
|
-
@public
|
|
4936
|
-
@since 1.13.0
|
|
4937
|
-
*/
|
|
4938
|
-
|
|
4939
|
-
/**
|
|
4940
|
-
Called after a component has been rendered, both on initial render and
|
|
4941
|
-
in subsequent rerenders.
|
|
4942
|
-
@method didRender
|
|
4943
|
-
@public
|
|
4944
|
-
@since 1.13.0
|
|
4945
|
-
*/
|
|
4946
|
-
didRender() {},
|
|
4947
|
-
|
|
4948
|
-
/**
|
|
4949
|
-
Called after a component has been rendered, both on initial render and
|
|
4950
|
-
in subsequent rerenders.
|
|
4951
|
-
@event didRender
|
|
4952
|
-
@public
|
|
4953
|
-
@since 1.13.0
|
|
4954
|
-
*/
|
|
4955
|
-
|
|
4956
|
-
/**
|
|
4957
|
-
Called before a component has been rendered, both on initial render and
|
|
4958
|
-
in subsequent rerenders.
|
|
4959
|
-
@method willRender
|
|
4960
|
-
@public
|
|
4961
|
-
@since 1.13.0
|
|
4962
|
-
*/
|
|
4963
|
-
willRender() {},
|
|
4964
|
-
|
|
4965
|
-
/**
|
|
4966
|
-
Called before a component has been rendered, both on initial render and
|
|
4967
|
-
in subsequent rerenders.
|
|
4968
|
-
@event willRender
|
|
4969
|
-
@public
|
|
4970
|
-
@since 1.13.0
|
|
4971
|
-
*/
|
|
4972
|
-
|
|
4973
|
-
/**
|
|
4974
|
-
Called when the attributes passed into the component have been changed.
|
|
4975
|
-
Called only during a rerender, not during an initial render.
|
|
4976
|
-
@method didUpdateAttrs
|
|
4977
|
-
@public
|
|
4978
|
-
@since 1.13.0
|
|
4979
|
-
*/
|
|
4980
|
-
didUpdateAttrs() {},
|
|
4981
|
-
|
|
4982
|
-
/**
|
|
4983
|
-
Called when the attributes passed into the component have been changed.
|
|
4984
|
-
Called only during a rerender, not during an initial render.
|
|
4985
|
-
@event didUpdateAttrs
|
|
4986
|
-
@public
|
|
4987
|
-
@since 1.13.0
|
|
4988
|
-
*/
|
|
4879
|
+
}
|
|
4989
4880
|
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
@method willUpdate
|
|
4994
|
-
@public
|
|
4995
|
-
@since 1.13.0
|
|
4996
|
-
*/
|
|
4997
|
-
willUpdate() {},
|
|
4881
|
+
static toString() {
|
|
4882
|
+
return '@ember/component';
|
|
4883
|
+
}
|
|
4998
4884
|
|
|
4999
|
-
|
|
5000
|
-
Called when the component is about to update and rerender itself.
|
|
5001
|
-
Called only during a rerender, not during an initial render.
|
|
5002
|
-
@event willUpdate
|
|
5003
|
-
@public
|
|
5004
|
-
@since 1.13.0
|
|
5005
|
-
*/
|
|
4885
|
+
}
|
|
5006
4886
|
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
Called only during a rerender, not during an initial render.
|
|
5010
|
-
@method didUpdate
|
|
5011
|
-
@public
|
|
5012
|
-
@since 1.13.0
|
|
5013
|
-
*/
|
|
5014
|
-
didUpdate() {}
|
|
5015
|
-
/**
|
|
5016
|
-
Called when the component has updated and rerendered itself.
|
|
5017
|
-
Called only during a rerender, not during an initial render.
|
|
5018
|
-
@event didUpdate
|
|
5019
|
-
@public
|
|
5020
|
-
@since 1.13.0
|
|
5021
|
-
*/
|
|
4887
|
+
_exports.Component = Component;
|
|
4888
|
+
Component.isComponentFactory = true; // We continue to use reopenClass here so that positionalParams can be overridden with reopenClass in subclasses.
|
|
5022
4889
|
|
|
4890
|
+
Component.reopenClass({
|
|
5023
4891
|
/**
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
4892
|
+
Enables components to take a list of parameters as arguments.
|
|
4893
|
+
For example, a component that takes two parameters with the names
|
|
4894
|
+
`name` and `age`:
|
|
4895
|
+
```app/components/my-component.js
|
|
4896
|
+
import Component from '@ember/component';
|
|
4897
|
+
let MyComponent = Component.extend();
|
|
4898
|
+
MyComponent.reopenClass({
|
|
4899
|
+
positionalParams: ['name', 'age']
|
|
4900
|
+
});
|
|
4901
|
+
export default MyComponent;
|
|
5028
4902
|
```
|
|
5029
|
-
|
|
5030
|
-
|
|
4903
|
+
It can then be invoked like this:
|
|
4904
|
+
```hbs
|
|
4905
|
+
{{my-component "John" 38}}
|
|
5031
4906
|
```
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5037
|
-
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
}
|
|
4907
|
+
The parameters can be referred to just like named parameters:
|
|
4908
|
+
```hbs
|
|
4909
|
+
Name: {{name}}, Age: {{age}}.
|
|
4910
|
+
```
|
|
4911
|
+
Using a string instead of an array allows for an arbitrary number of
|
|
4912
|
+
parameters:
|
|
4913
|
+
```app/components/my-component.js
|
|
4914
|
+
import Component from '@ember/component';
|
|
4915
|
+
let MyComponent = Component.extend();
|
|
4916
|
+
MyComponent.reopenClass({
|
|
4917
|
+
positionalParams: 'names'
|
|
5044
4918
|
});
|
|
4919
|
+
export default MyComponent;
|
|
4920
|
+
```
|
|
4921
|
+
It can then be invoked like this:
|
|
4922
|
+
```hbs
|
|
4923
|
+
{{my-component "John" "Michael" "Scott"}}
|
|
4924
|
+
```
|
|
4925
|
+
The parameters can then be referred to by enumerating over the list:
|
|
4926
|
+
```hbs
|
|
4927
|
+
{{#each names as |name|}}{{name}}{{/each}}
|
|
5045
4928
|
```
|
|
5046
|
-
|
|
5047
|
-
@type String
|
|
4929
|
+
@static
|
|
5048
4930
|
@public
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
});
|
|
5053
|
-
|
|
5054
|
-
_exports.Component = Component;
|
|
5055
|
-
|
|
5056
|
-
Component.toString = () => '@ember/component';
|
|
5057
|
-
|
|
5058
|
-
Component.reopenClass({
|
|
5059
|
-
isComponentFactory: true,
|
|
4931
|
+
@property positionalParams
|
|
4932
|
+
@since 1.13.0
|
|
4933
|
+
*/
|
|
5060
4934
|
positionalParams: []
|
|
5061
4935
|
});
|
|
5062
4936
|
(0, _manager2.setInternalComponentManager)(CURLY_COMPONENT_MANAGER, Component);
|
|
@@ -5070,8 +4944,8 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
5070
4944
|
var IS_CLASSIC_HELPER = Symbol('IS_CLASSIC_HELPER');
|
|
5071
4945
|
|
|
5072
4946
|
class Helper extends _runtime2.FrameworkObject {
|
|
5073
|
-
init() {
|
|
5074
|
-
super.init();
|
|
4947
|
+
init(properties) {
|
|
4948
|
+
super.init(properties);
|
|
5075
4949
|
this[RECOMPUTE_TAG] = (0, _validator.createTag)();
|
|
5076
4950
|
}
|
|
5077
4951
|
/**
|
|
@@ -8608,7 +8482,7 @@ define("@ember/-internals/meta/lib/meta", ["exports", "@ember/-internals/utils",
|
|
|
8608
8482
|
/* ADD */
|
|
8609
8483
|
&& kind === 0
|
|
8610
8484
|
/* ADD */
|
|
8611
|
-
&& listener.sync !== sync)) && (0, _debug.assert)(`You attempted to add an observer for the same method on '${event.split(':')[0]}' twice to ${target} as both sync and async. Observers must be either sync or async, they cannot be both. This is likely a mistake, you should either remove the code that added the observer a second time, or update it to always be sync or async. The method was ${method}.`, !(listener.kind === 0 && kind === 0 && listener.sync !== sync))); // update own listener
|
|
8485
|
+
&& listener.sync !== sync)) && (0, _debug.assert)(`You attempted to add an observer for the same method on '${event.split(':')[0]}' twice to ${target} as both sync and async. Observers must be either sync or async, they cannot be both. This is likely a mistake, you should either remove the code that added the observer a second time, or update it to always be sync or async. The method was ${String(method)}.`, !(listener.kind === 0 && kind === 0 && listener.sync !== sync))); // update own listener
|
|
8612
8486
|
|
|
8613
8487
|
listener.kind = kind;
|
|
8614
8488
|
listener.sync = sync;
|
|
@@ -8967,6 +8841,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
|
|
|
8967
8841
|
}
|
|
8968
8842
|
});
|
|
8969
8843
|
_exports.hasListeners = hasListeners;
|
|
8844
|
+
_exports.hasUnknownProperty = hasUnknownProperty;
|
|
8970
8845
|
_exports.inject = inject;
|
|
8971
8846
|
_exports.isBlank = isBlank;
|
|
8972
8847
|
_exports.isClassicDecorator = isClassicDecorator;
|
|
@@ -10892,6 +10767,10 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
|
|
|
10892
10767
|
};
|
|
10893
10768
|
}
|
|
10894
10769
|
|
|
10770
|
+
function hasUnknownProperty(val) {
|
|
10771
|
+
return typeof val === 'object' && val !== null && typeof val.unknownProperty === 'function';
|
|
10772
|
+
}
|
|
10773
|
+
|
|
10895
10774
|
function get(obj, keyName) {
|
|
10896
10775
|
(true && !(arguments.length === 2) && (0, _debug.assert)(`Get must be called with two arguments; an object and a property key`, arguments.length === 2));
|
|
10897
10776
|
(true && !(obj !== undefined && obj !== null) && (0, _debug.assert)(`Cannot call get with '${keyName}' on an undefined object.`, obj !== undefined && obj !== null));
|
|
@@ -10916,7 +10795,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
|
|
|
10916
10795
|
value = obj[keyName];
|
|
10917
10796
|
}
|
|
10918
10797
|
|
|
10919
|
-
if (value === undefined && typeof obj === 'object' && !(keyName in obj) &&
|
|
10798
|
+
if (value === undefined && typeof obj === 'object' && !(keyName in obj) && hasUnknownProperty(obj)) {
|
|
10920
10799
|
value = obj.unknownProperty(keyName);
|
|
10921
10800
|
}
|
|
10922
10801
|
|
|
@@ -11317,7 +11196,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
|
|
|
11317
11196
|
return true;
|
|
11318
11197
|
}
|
|
11319
11198
|
|
|
11320
|
-
if (
|
|
11199
|
+
if (!hasUnknownProperty(obj) && typeof obj.size === 'number') {
|
|
11321
11200
|
return !obj.size;
|
|
11322
11201
|
}
|
|
11323
11202
|
|
|
@@ -12643,40 +12522,38 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
|
|
|
12643
12522
|
_exports.TrackedDescriptor = TrackedDescriptor;
|
|
12644
12523
|
|
|
12645
12524
|
var cached = function () {
|
|
12646
|
-
{
|
|
12647
|
-
|
|
12648
|
-
|
|
12649
|
-
}
|
|
12525
|
+
for (var _len12 = arguments.length, args = new Array(_len12), _key13 = 0; _key13 < _len12; _key13++) {
|
|
12526
|
+
args[_key13] = arguments[_key13];
|
|
12527
|
+
}
|
|
12650
12528
|
|
|
12651
|
-
|
|
12529
|
+
var [target, key, descriptor] = args; // Error on `@cached()`, `@cached(...args)`, and `@cached propName = value;`
|
|
12652
12530
|
|
|
12653
|
-
|
|
12654
|
-
|
|
12655
|
-
|
|
12531
|
+
if (true
|
|
12532
|
+
/* DEBUG */
|
|
12533
|
+
&& target === undefined) throwCachedExtraneousParens();
|
|
12656
12534
|
|
|
12657
|
-
|
|
12658
|
-
|
|
12659
|
-
|
|
12660
|
-
|
|
12661
|
-
|
|
12535
|
+
if (true
|
|
12536
|
+
/* DEBUG */
|
|
12537
|
+
&& (typeof target !== 'object' || typeof key !== 'string' || typeof descriptor !== 'object' || args.length !== 3)) {
|
|
12538
|
+
throwCachedInvalidArgsError(args);
|
|
12539
|
+
}
|
|
12662
12540
|
|
|
12663
|
-
|
|
12664
|
-
|
|
12665
|
-
|
|
12666
|
-
|
|
12667
|
-
|
|
12541
|
+
if (true
|
|
12542
|
+
/* DEBUG */
|
|
12543
|
+
&& (!('get' in descriptor) || typeof descriptor.get !== 'function')) {
|
|
12544
|
+
throwCachedGetterOnlyError(key);
|
|
12545
|
+
}
|
|
12668
12546
|
|
|
12669
|
-
|
|
12670
|
-
|
|
12547
|
+
var caches = new WeakMap();
|
|
12548
|
+
var getter = descriptor.get;
|
|
12671
12549
|
|
|
12672
|
-
|
|
12673
|
-
|
|
12674
|
-
|
|
12675
|
-
|
|
12550
|
+
descriptor.get = function () {
|
|
12551
|
+
if (!caches.has(this)) {
|
|
12552
|
+
caches.set(this, (0, _validator.createCache)(getter.bind(this)));
|
|
12553
|
+
}
|
|
12676
12554
|
|
|
12677
|
-
|
|
12678
|
-
|
|
12679
|
-
}
|
|
12555
|
+
return (0, _validator.getValue)(caches.get(this));
|
|
12556
|
+
};
|
|
12680
12557
|
};
|
|
12681
12558
|
|
|
12682
12559
|
_exports.cached = cached;
|
|
@@ -14369,151 +14246,6 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
|
|
|
14369
14246
|
}
|
|
14370
14247
|
|
|
14371
14248
|
class RouterService extends _service.default.extend(_runtime.Evented) {
|
|
14372
|
-
constructor() {
|
|
14373
|
-
super(...arguments);
|
|
14374
|
-
/**
|
|
14375
|
-
You can register a listener for events emitted by this service with `.on()`:
|
|
14376
|
-
```app/routes/contact-form.js
|
|
14377
|
-
import Route from '@ember/routing';
|
|
14378
|
-
import { service } from '@ember/service';
|
|
14379
|
-
export default class extends Route {
|
|
14380
|
-
@service router;
|
|
14381
|
-
activate() {
|
|
14382
|
-
this.router.on('routeWillChange', (transition) => {
|
|
14383
|
-
if (!transition.to.find(route => route.name === this.routeName)) {
|
|
14384
|
-
alert("Please save or cancel your changes.");
|
|
14385
|
-
transition.abort();
|
|
14386
|
-
}
|
|
14387
|
-
})
|
|
14388
|
-
}
|
|
14389
|
-
}
|
|
14390
|
-
```
|
|
14391
|
-
@method on
|
|
14392
|
-
@param {String} eventName
|
|
14393
|
-
@param {Function} callback
|
|
14394
|
-
@public
|
|
14395
|
-
*/
|
|
14396
|
-
|
|
14397
|
-
/**
|
|
14398
|
-
You can unregister a listener for events emitted by this service with `.off()`:
|
|
14399
|
-
```app/routes/contact-form.js
|
|
14400
|
-
import Route from '@ember/routing';
|
|
14401
|
-
import { service } from '@ember/service';
|
|
14402
|
-
export default class extends Route {
|
|
14403
|
-
@service router;
|
|
14404
|
-
callback = (transition) => {
|
|
14405
|
-
if (!transition.to.find(route => route.name === this.routeName)) {
|
|
14406
|
-
alert("Please save or cancel your changes.");
|
|
14407
|
-
transition.abort();
|
|
14408
|
-
}
|
|
14409
|
-
};
|
|
14410
|
-
activate() {
|
|
14411
|
-
this.router.on('routeWillChange', this.callback);
|
|
14412
|
-
}
|
|
14413
|
-
deactivate() {
|
|
14414
|
-
this.router.off('routeWillChange', this.callback);
|
|
14415
|
-
}
|
|
14416
|
-
```
|
|
14417
|
-
@method off
|
|
14418
|
-
@param {String} eventName
|
|
14419
|
-
@param {Function} callback
|
|
14420
|
-
@public
|
|
14421
|
-
*/
|
|
14422
|
-
|
|
14423
|
-
/**
|
|
14424
|
-
The `routeWillChange` event is fired at the beginning of any
|
|
14425
|
-
attempted transition with a `Transition` object as the sole
|
|
14426
|
-
argument. This action can be used for aborting, redirecting,
|
|
14427
|
-
or decorating the transition from the currently active routes.
|
|
14428
|
-
A good example is preventing navigation when a form is
|
|
14429
|
-
half-filled out:
|
|
14430
|
-
```app/routes/contact-form.js
|
|
14431
|
-
import Route from '@ember/routing';
|
|
14432
|
-
import { service } from '@ember/service';
|
|
14433
|
-
export default class extends Route {
|
|
14434
|
-
@service router;
|
|
14435
|
-
activate() {
|
|
14436
|
-
this.router.on('routeWillChange', (transition) => {
|
|
14437
|
-
if (!transition.to.find(route => route.name === this.routeName)) {
|
|
14438
|
-
alert("Please save or cancel your changes.");
|
|
14439
|
-
transition.abort();
|
|
14440
|
-
}
|
|
14441
|
-
})
|
|
14442
|
-
}
|
|
14443
|
-
}
|
|
14444
|
-
```
|
|
14445
|
-
The `routeWillChange` event fires whenever a new route is chosen as the desired target of a transition. This includes `transitionTo`, `replaceWith`, all redirection for any reason including error handling, and abort. Aborting implies changing the desired target back to where you already were. Once a transition has completed, `routeDidChange` fires.
|
|
14446
|
-
@event routeWillChange
|
|
14447
|
-
@param {Transition} transition
|
|
14448
|
-
@public
|
|
14449
|
-
*/
|
|
14450
|
-
|
|
14451
|
-
/**
|
|
14452
|
-
The `routeDidChange` event only fires once a transition has settled.
|
|
14453
|
-
This includes aborts and error substates. Like the `routeWillChange` event
|
|
14454
|
-
it receives a Transition as the sole argument.
|
|
14455
|
-
A good example is sending some analytics when the route has transitioned:
|
|
14456
|
-
```app/routes/contact-form.js
|
|
14457
|
-
import Route from '@ember/routing';
|
|
14458
|
-
import { service } from '@ember/service';
|
|
14459
|
-
export default class extends Route {
|
|
14460
|
-
@service router;
|
|
14461
|
-
activate() {
|
|
14462
|
-
this.router.on('routeDidChange', (transition) => {
|
|
14463
|
-
ga.send('pageView', {
|
|
14464
|
-
current: transition.to.name,
|
|
14465
|
-
from: transition.from.name
|
|
14466
|
-
});
|
|
14467
|
-
})
|
|
14468
|
-
}
|
|
14469
|
-
}
|
|
14470
|
-
```
|
|
14471
|
-
`routeDidChange` will be called after any `Route`'s
|
|
14472
|
-
[didTransition](/ember/release/classes/Route/events/didTransition?anchor=didTransition)
|
|
14473
|
-
action has been fired.
|
|
14474
|
-
The updates of properties
|
|
14475
|
-
[currentURL](/ember/release/classes/RouterService/properties/currentURL?anchor=currentURL),
|
|
14476
|
-
[currentRouteName](/ember/release/classes/RouterService/properties/currentURL?anchor=currentRouteName)
|
|
14477
|
-
and
|
|
14478
|
-
[currentRoute](/ember/release/classes/RouterService/properties/currentURL?anchor=currentRoute)
|
|
14479
|
-
are completed at the time `routeDidChange` is called.
|
|
14480
|
-
@event routeDidChange
|
|
14481
|
-
@param {Transition} transition
|
|
14482
|
-
@public
|
|
14483
|
-
*/
|
|
14484
|
-
// Canary features
|
|
14485
|
-
|
|
14486
|
-
/**
|
|
14487
|
-
* Refreshes all currently active routes, doing a full transition.
|
|
14488
|
-
* If a route name is provided and refers to a currently active route,
|
|
14489
|
-
* it will refresh only that route and its descendents.
|
|
14490
|
-
* Returns a promise that will be resolved once the refresh is complete.
|
|
14491
|
-
* All resetController, beforeModel, model, afterModel, redirect, and setupController
|
|
14492
|
-
* hooks will be called again. You will get new data from the model hook.
|
|
14493
|
-
*
|
|
14494
|
-
* @method refresh
|
|
14495
|
-
* @param {String} [routeName] the route to refresh (along with all child routes)
|
|
14496
|
-
* @return Transition
|
|
14497
|
-
* @category EMBER_ROUTING_ROUTER_SERVICE_REFRESH
|
|
14498
|
-
* @public
|
|
14499
|
-
*/
|
|
14500
|
-
|
|
14501
|
-
this.refresh = true
|
|
14502
|
-
/* EMBER_ROUTING_ROUTER_SERVICE_REFRESH */
|
|
14503
|
-
? function (pivotRouteName) {
|
|
14504
|
-
if (!pivotRouteName) {
|
|
14505
|
-
return this._router._routerMicrolib.refresh();
|
|
14506
|
-
}
|
|
14507
|
-
|
|
14508
|
-
(true && !(this._router.hasRoute(pivotRouteName)) && (0, _debug.assert)(`The route "${pivotRouteName}" was not found`, this._router.hasRoute(pivotRouteName)));
|
|
14509
|
-
(true && !(this.isActive(pivotRouteName)) && (0, _debug.assert)(`The route "${pivotRouteName}" is currently not active`, this.isActive(pivotRouteName)));
|
|
14510
|
-
var owner = (0, _owner.getOwner)(this);
|
|
14511
|
-
(true && !(owner) && (0, _debug.assert)('RouterService is unexpectedly missing an owner', owner));
|
|
14512
|
-
var pivotRoute = owner.lookup(`route:${pivotRouteName}`);
|
|
14513
|
-
return this._router._routerMicrolib.refresh(pivotRoute);
|
|
14514
|
-
} : undefined;
|
|
14515
|
-
}
|
|
14516
|
-
|
|
14517
14249
|
get _router() {
|
|
14518
14250
|
var router = this[ROUTER];
|
|
14519
14251
|
|
|
@@ -14849,6 +14581,146 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
|
|
|
14849
14581
|
var internalURL = cleanURL(url, this.rootURL);
|
|
14850
14582
|
return this._router._routerMicrolib.recognizeAndLoad(internalURL);
|
|
14851
14583
|
}
|
|
14584
|
+
/**
|
|
14585
|
+
You can register a listener for events emitted by this service with `.on()`:
|
|
14586
|
+
```app/routes/contact-form.js
|
|
14587
|
+
import Route from '@ember/routing';
|
|
14588
|
+
import { service } from '@ember/service';
|
|
14589
|
+
export default class extends Route {
|
|
14590
|
+
@service router;
|
|
14591
|
+
activate() {
|
|
14592
|
+
this.router.on('routeWillChange', (transition) => {
|
|
14593
|
+
if (!transition.to.find(route => route.name === this.routeName)) {
|
|
14594
|
+
alert("Please save or cancel your changes.");
|
|
14595
|
+
transition.abort();
|
|
14596
|
+
}
|
|
14597
|
+
})
|
|
14598
|
+
}
|
|
14599
|
+
}
|
|
14600
|
+
```
|
|
14601
|
+
@method on
|
|
14602
|
+
@param {String} eventName
|
|
14603
|
+
@param {Function} callback
|
|
14604
|
+
@public
|
|
14605
|
+
*/
|
|
14606
|
+
|
|
14607
|
+
/**
|
|
14608
|
+
You can unregister a listener for events emitted by this service with `.off()`:
|
|
14609
|
+
```app/routes/contact-form.js
|
|
14610
|
+
import Route from '@ember/routing';
|
|
14611
|
+
import { service } from '@ember/service';
|
|
14612
|
+
export default class extends Route {
|
|
14613
|
+
@service router;
|
|
14614
|
+
callback = (transition) => {
|
|
14615
|
+
if (!transition.to.find(route => route.name === this.routeName)) {
|
|
14616
|
+
alert("Please save or cancel your changes.");
|
|
14617
|
+
transition.abort();
|
|
14618
|
+
}
|
|
14619
|
+
};
|
|
14620
|
+
activate() {
|
|
14621
|
+
this.router.on('routeWillChange', this.callback);
|
|
14622
|
+
}
|
|
14623
|
+
deactivate() {
|
|
14624
|
+
this.router.off('routeWillChange', this.callback);
|
|
14625
|
+
}
|
|
14626
|
+
```
|
|
14627
|
+
@method off
|
|
14628
|
+
@param {String} eventName
|
|
14629
|
+
@param {Function} callback
|
|
14630
|
+
@public
|
|
14631
|
+
*/
|
|
14632
|
+
|
|
14633
|
+
/**
|
|
14634
|
+
The `routeWillChange` event is fired at the beginning of any
|
|
14635
|
+
attempted transition with a `Transition` object as the sole
|
|
14636
|
+
argument. This action can be used for aborting, redirecting,
|
|
14637
|
+
or decorating the transition from the currently active routes.
|
|
14638
|
+
A good example is preventing navigation when a form is
|
|
14639
|
+
half-filled out:
|
|
14640
|
+
```app/routes/contact-form.js
|
|
14641
|
+
import Route from '@ember/routing';
|
|
14642
|
+
import { service } from '@ember/service';
|
|
14643
|
+
export default class extends Route {
|
|
14644
|
+
@service router;
|
|
14645
|
+
activate() {
|
|
14646
|
+
this.router.on('routeWillChange', (transition) => {
|
|
14647
|
+
if (!transition.to.find(route => route.name === this.routeName)) {
|
|
14648
|
+
alert("Please save or cancel your changes.");
|
|
14649
|
+
transition.abort();
|
|
14650
|
+
}
|
|
14651
|
+
})
|
|
14652
|
+
}
|
|
14653
|
+
}
|
|
14654
|
+
```
|
|
14655
|
+
The `routeWillChange` event fires whenever a new route is chosen as the desired target of a transition. This includes `transitionTo`, `replaceWith`, all redirection for any reason including error handling, and abort. Aborting implies changing the desired target back to where you already were. Once a transition has completed, `routeDidChange` fires.
|
|
14656
|
+
@event routeWillChange
|
|
14657
|
+
@param {Transition} transition
|
|
14658
|
+
@public
|
|
14659
|
+
*/
|
|
14660
|
+
|
|
14661
|
+
/**
|
|
14662
|
+
The `routeDidChange` event only fires once a transition has settled.
|
|
14663
|
+
This includes aborts and error substates. Like the `routeWillChange` event
|
|
14664
|
+
it receives a Transition as the sole argument.
|
|
14665
|
+
A good example is sending some analytics when the route has transitioned:
|
|
14666
|
+
```app/routes/contact-form.js
|
|
14667
|
+
import Route from '@ember/routing';
|
|
14668
|
+
import { service } from '@ember/service';
|
|
14669
|
+
export default class extends Route {
|
|
14670
|
+
@service router;
|
|
14671
|
+
activate() {
|
|
14672
|
+
this.router.on('routeDidChange', (transition) => {
|
|
14673
|
+
ga.send('pageView', {
|
|
14674
|
+
current: transition.to.name,
|
|
14675
|
+
from: transition.from.name
|
|
14676
|
+
});
|
|
14677
|
+
})
|
|
14678
|
+
}
|
|
14679
|
+
}
|
|
14680
|
+
```
|
|
14681
|
+
`routeDidChange` will be called after any `Route`'s
|
|
14682
|
+
[didTransition](/ember/release/classes/Route/events/didTransition?anchor=didTransition)
|
|
14683
|
+
action has been fired.
|
|
14684
|
+
The updates of properties
|
|
14685
|
+
[currentURL](/ember/release/classes/RouterService/properties/currentURL?anchor=currentURL),
|
|
14686
|
+
[currentRouteName](/ember/release/classes/RouterService/properties/currentURL?anchor=currentRouteName)
|
|
14687
|
+
and
|
|
14688
|
+
[currentRoute](/ember/release/classes/RouterService/properties/currentURL?anchor=currentRoute)
|
|
14689
|
+
are completed at the time `routeDidChange` is called.
|
|
14690
|
+
@event routeDidChange
|
|
14691
|
+
@param {Transition} transition
|
|
14692
|
+
@public
|
|
14693
|
+
*/
|
|
14694
|
+
|
|
14695
|
+
/**
|
|
14696
|
+
* Refreshes all currently active routes, doing a full transition.
|
|
14697
|
+
* If a route name is provided and refers to a currently active route,
|
|
14698
|
+
* it will refresh only that route and its descendents.
|
|
14699
|
+
* Returns a promise that will be resolved once the refresh is complete.
|
|
14700
|
+
* All resetController, beforeModel, model, afterModel, redirect, and setupController
|
|
14701
|
+
* hooks will be called again. You will get new data from the model hook.
|
|
14702
|
+
*
|
|
14703
|
+
* @method refresh
|
|
14704
|
+
* @param {String} [routeName] the route to refresh (along with all child routes)
|
|
14705
|
+
* @return Transition
|
|
14706
|
+
* @public
|
|
14707
|
+
*/
|
|
14708
|
+
|
|
14709
|
+
|
|
14710
|
+
refresh(pivotRouteName) {
|
|
14711
|
+
if (!pivotRouteName) {
|
|
14712
|
+
return this._router._routerMicrolib.refresh();
|
|
14713
|
+
}
|
|
14714
|
+
|
|
14715
|
+
(true && !(this._router.hasRoute(pivotRouteName)) && (0, _debug.assert)(`The route "${pivotRouteName}" was not found`, this._router.hasRoute(pivotRouteName)));
|
|
14716
|
+
(true && !(this.isActive(pivotRouteName)) && (0, _debug.assert)(`The route "${pivotRouteName}" is currently not active`, this.isActive(pivotRouteName)));
|
|
14717
|
+
var owner = (0, _owner.getOwner)(this);
|
|
14718
|
+
(true && !(owner) && (0, _debug.assert)('RouterService is unexpectedly missing an owner', owner));
|
|
14719
|
+
var pivotRoute = owner.lookup(`route:${pivotRouteName}`); // R could be instantiated with a different sub-type
|
|
14720
|
+
// @ts-ignore
|
|
14721
|
+
|
|
14722
|
+
return this._router._routerMicrolib.refresh(pivotRoute);
|
|
14723
|
+
}
|
|
14852
14724
|
|
|
14853
14725
|
}
|
|
14854
14726
|
|
|
@@ -17366,6 +17238,8 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
|
|
|
17366
17238
|
seen[name] = true;
|
|
17367
17239
|
|
|
17368
17240
|
if (!route) {
|
|
17241
|
+
// SAFETY: this is configured in `commonSetupRegistry` in the
|
|
17242
|
+
// `@ember/application/lib` package.
|
|
17369
17243
|
var DefaultRoute = routeOwner.factoryFor('route:basic').class;
|
|
17370
17244
|
routeOwner.register(fullRouteName, DefaultRoute.extend());
|
|
17371
17245
|
route = routeOwner.lookup(fullRouteName);
|
|
@@ -18883,6 +18757,10 @@ define("@ember/-internals/routing/lib/system/router_state", ["exports", "@ember/
|
|
|
18883
18757
|
});
|
|
18884
18758
|
define("@ember/-internals/routing/lib/system/transition", [], function () {
|
|
18885
18759
|
"use strict";
|
|
18760
|
+
/**
|
|
18761
|
+
@module @ember/routing
|
|
18762
|
+
*/
|
|
18763
|
+
|
|
18886
18764
|
/**
|
|
18887
18765
|
A Transition is a thennable (a promise-like object) that represents
|
|
18888
18766
|
an attempt to transition to another route. It can be aborted, either
|
|
@@ -23606,6 +23484,14 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
23606
23484
|
/**
|
|
23607
23485
|
@module @ember/object
|
|
23608
23486
|
*/
|
|
23487
|
+
function hasSetUnknownProperty(val) {
|
|
23488
|
+
return typeof val === 'object' && val !== null && typeof val.setUnknownProperty === 'function';
|
|
23489
|
+
}
|
|
23490
|
+
|
|
23491
|
+
function hasToStringExtension(val) {
|
|
23492
|
+
return typeof val === 'object' && val !== null && typeof val.toStringExtension === 'function';
|
|
23493
|
+
}
|
|
23494
|
+
|
|
23609
23495
|
var reopen = _metal.Mixin.prototype.reopen;
|
|
23610
23496
|
var wasApplied = new _util._WeakSet();
|
|
23611
23497
|
var prototypeMixinMap = new WeakMap();
|
|
@@ -23629,12 +23515,9 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
23629
23515
|
(true && !(!(properties instanceof _metal.Mixin)) && (0, _debug.assert)('EmberObject.create no longer supports mixing in other ' + 'definitions, use .extend & .create separately instead.', !(properties instanceof _metal.Mixin)));
|
|
23630
23516
|
var concatenatedProperties = obj.concatenatedProperties;
|
|
23631
23517
|
var mergedProperties = obj.mergedProperties;
|
|
23632
|
-
var hasConcatenatedProps = concatenatedProperties !== undefined && concatenatedProperties.length > 0;
|
|
23633
|
-
var hasMergedProps = mergedProperties !== undefined && mergedProperties.length > 0;
|
|
23634
23518
|
var keyNames = Object.keys(properties);
|
|
23635
23519
|
|
|
23636
|
-
for (var
|
|
23637
|
-
var keyName = keyNames[i];
|
|
23520
|
+
for (var keyName of keyNames) {
|
|
23638
23521
|
var value = properties[keyName];
|
|
23639
23522
|
(true && !(!(0, _metal.isClassicDecorator)(value)) && (0, _debug.assert)('EmberObject.create no longer supports defining computed ' + 'properties. Define computed properties using extend() or reopen() ' + 'before calling create().', !(0, _metal.isClassicDecorator)(value)));
|
|
23640
23523
|
(true && !(!(typeof value === 'function' && value.toString().indexOf('._super') !== -1)) && (0, _debug.assert)('EmberObject.create no longer supports defining methods that call _super.', !(typeof value === 'function' && value.toString().indexOf('._super') !== -1)));
|
|
@@ -23643,7 +23526,7 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
23643
23526
|
var isDescriptor = possibleDesc !== undefined;
|
|
23644
23527
|
|
|
23645
23528
|
if (!isDescriptor) {
|
|
23646
|
-
if (
|
|
23529
|
+
if (concatenatedProperties !== undefined && concatenatedProperties.length > 0 && concatenatedProperties.includes(keyName)) {
|
|
23647
23530
|
var baseValue = obj[keyName];
|
|
23648
23531
|
|
|
23649
23532
|
if (baseValue) {
|
|
@@ -23653,7 +23536,7 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
23653
23536
|
}
|
|
23654
23537
|
}
|
|
23655
23538
|
|
|
23656
|
-
if (
|
|
23539
|
+
if (mergedProperties !== undefined && mergedProperties.length > 0 && mergedProperties.includes(keyName)) {
|
|
23657
23540
|
var _baseValue = obj[keyName];
|
|
23658
23541
|
value = Object.assign({}, _baseValue, value);
|
|
23659
23542
|
}
|
|
@@ -23661,7 +23544,7 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
23661
23544
|
|
|
23662
23545
|
if (isDescriptor) {
|
|
23663
23546
|
possibleDesc.set(obj, keyName, value);
|
|
23664
|
-
} else if (
|
|
23547
|
+
} else if (hasSetUnknownProperty(obj) && !(keyName in obj)) {
|
|
23665
23548
|
obj.setUnknownProperty(keyName, value);
|
|
23666
23549
|
} else {
|
|
23667
23550
|
if (true
|
|
@@ -23687,86 +23570,24 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
23687
23570
|
var observerEvents = m.observerEvents();
|
|
23688
23571
|
|
|
23689
23572
|
if (observerEvents !== undefined) {
|
|
23690
|
-
for (var
|
|
23691
|
-
(0, _metal.activateObserver)(obj, observerEvents[
|
|
23573
|
+
for (var i = 0; i < observerEvents.length; i++) {
|
|
23574
|
+
(0, _metal.activateObserver)(obj, observerEvents[i].event, observerEvents[i].sync);
|
|
23692
23575
|
}
|
|
23693
23576
|
}
|
|
23694
23577
|
|
|
23695
|
-
(0, _metal.sendEvent)(obj, 'init', undefined, undefined,
|
|
23578
|
+
(0, _metal.sendEvent)(obj, 'init', undefined, undefined, m);
|
|
23696
23579
|
}
|
|
23697
|
-
/**
|
|
23698
|
-
`CoreObject` is the base class for all Ember constructs. It establishes a
|
|
23699
|
-
class system based on Ember's Mixin system, and provides the basis for the
|
|
23700
|
-
Ember Object Model. `CoreObject` should generally not be used directly,
|
|
23701
|
-
instead you should use `EmberObject`.
|
|
23702
|
-
|
|
23703
|
-
## Usage
|
|
23704
|
-
|
|
23705
|
-
You can define a class by extending from `CoreObject` using the `extend`
|
|
23706
|
-
method:
|
|
23707
|
-
|
|
23708
|
-
```js
|
|
23709
|
-
const Person = CoreObject.extend({
|
|
23710
|
-
name: 'Tomster',
|
|
23711
|
-
});
|
|
23712
|
-
```
|
|
23713
|
-
|
|
23714
|
-
For detailed usage, see the [Object Model](https://guides.emberjs.com/release/object-model/)
|
|
23715
|
-
section of the guides.
|
|
23716
|
-
|
|
23717
|
-
## Usage with Native Classes
|
|
23718
|
-
|
|
23719
|
-
Native JavaScript `class` syntax can be used to extend from any `CoreObject`
|
|
23720
|
-
based class:
|
|
23721
|
-
|
|
23722
|
-
```js
|
|
23723
|
-
class Person extends CoreObject {
|
|
23724
|
-
init() {
|
|
23725
|
-
super.init(...arguments);
|
|
23726
|
-
this.name = 'Tomster';
|
|
23727
|
-
}
|
|
23728
|
-
}
|
|
23729
|
-
```
|
|
23730
|
-
|
|
23731
|
-
Some notes about `class` usage:
|
|
23732
|
-
|
|
23733
|
-
* `new` syntax is not currently supported with classes that extend from
|
|
23734
|
-
`EmberObject` or `CoreObject`. You must continue to use the `create` method
|
|
23735
|
-
when making new instances of classes, even if they are defined using native
|
|
23736
|
-
class syntax. If you want to use `new` syntax, consider creating classes
|
|
23737
|
-
which do _not_ extend from `EmberObject` or `CoreObject`. Ember features,
|
|
23738
|
-
such as computed properties and decorators, will still work with base-less
|
|
23739
|
-
classes.
|
|
23740
|
-
* Instead of using `this._super()`, you must use standard `super` syntax in
|
|
23741
|
-
native classes. See the [MDN docs on classes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Super_class_calls_with_super)
|
|
23742
|
-
for more details.
|
|
23743
|
-
* Native classes support using [constructors](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#Constructor)
|
|
23744
|
-
to set up newly-created instances. Ember uses these to, among other things,
|
|
23745
|
-
support features that need to retrieve other entities by name, like Service
|
|
23746
|
-
injection and `getOwner`. To ensure your custom instance setup logic takes
|
|
23747
|
-
place after this important work is done, avoid using the `constructor` in
|
|
23748
|
-
favor of `init`.
|
|
23749
|
-
* Properties passed to `create` will be available on the instance by the time
|
|
23750
|
-
`init` runs, so any code that requires these values should work at that
|
|
23751
|
-
time.
|
|
23752
|
-
* Using native classes, and switching back to the old Ember Object model is
|
|
23753
|
-
fully supported.
|
|
23754
|
-
|
|
23755
|
-
@class CoreObject
|
|
23756
|
-
@public
|
|
23757
|
-
*/
|
|
23758
|
-
|
|
23759
23580
|
|
|
23760
23581
|
class CoreObject {
|
|
23761
23582
|
constructor(owner) {
|
|
23762
23583
|
this[_owner2.OWNER] = owner; // prepare prototype...
|
|
23763
23584
|
|
|
23764
23585
|
this.constructor.proto();
|
|
23765
|
-
var self
|
|
23586
|
+
var self;
|
|
23766
23587
|
|
|
23767
23588
|
if (true
|
|
23768
23589
|
/* DEBUG */
|
|
23769
|
-
&&
|
|
23590
|
+
&& (0, _metal.hasUnknownProperty)(this)) {
|
|
23770
23591
|
var messageFor = (obj, property) => {
|
|
23771
23592
|
return `You attempted to access the \`${String(property)}\` property (of ${obj}).\n` + `Since Ember 3.1, this is usually fine as you no longer need to use \`.get()\`\n` + `to access computed properties. However, in this case, the object in question\n` + `is a special kind of Ember object (a proxy). Therefore, it is still necessary\n` + `to use \`.get('${String(property)}')\` in this case.\n\n` + `If you encountered this error because of third-party code that you don't control,\n` + `there is more information at https://github.com/emberjs/ember.js/issues/16148, and\n` + `you can help us improve this error message by telling us more about what happened in\n` + `this situation.`;
|
|
23772
23593
|
};
|
|
@@ -23790,10 +23611,13 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
23790
23611
|
}
|
|
23791
23612
|
|
|
23792
23613
|
});
|
|
23614
|
+
} else {
|
|
23615
|
+
self = this;
|
|
23793
23616
|
}
|
|
23794
23617
|
|
|
23618
|
+
var destroyable = self;
|
|
23795
23619
|
(0, _destroyable.registerDestructor)(self, ensureDestroyCalled, true);
|
|
23796
|
-
(0, _destroyable.registerDestructor)(self, () =>
|
|
23620
|
+
(0, _destroyable.registerDestructor)(self, () => destroyable.willDestroy()); // disable chains
|
|
23797
23621
|
|
|
23798
23622
|
var m = (0, _meta2.meta)(self);
|
|
23799
23623
|
m.setInitializing(); // only return when in debug builds and `self` is the proxy created above
|
|
@@ -23816,61 +23640,61 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
23816
23640
|
/**
|
|
23817
23641
|
An overridable method called when objects are instantiated. By default,
|
|
23818
23642
|
does nothing unless it is overridden during class definition.
|
|
23819
|
-
|
|
23820
|
-
|
|
23643
|
+
Example:
|
|
23644
|
+
```javascript
|
|
23821
23645
|
import EmberObject from '@ember/object';
|
|
23822
|
-
|
|
23646
|
+
const Person = EmberObject.extend({
|
|
23823
23647
|
init() {
|
|
23824
23648
|
alert(`Name is ${this.get('name')}`);
|
|
23825
23649
|
}
|
|
23826
23650
|
});
|
|
23827
|
-
|
|
23651
|
+
let steve = Person.create({
|
|
23828
23652
|
name: 'Steve'
|
|
23829
23653
|
});
|
|
23830
|
-
|
|
23654
|
+
// alerts 'Name is Steve'.
|
|
23831
23655
|
```
|
|
23832
|
-
|
|
23656
|
+
NOTE: If you do override `init` for a framework class like `Component`
|
|
23833
23657
|
from `@ember/component`, be sure to call `this._super(...arguments)`
|
|
23834
23658
|
in your `init` declaration!
|
|
23835
23659
|
If you don't, Ember may not have an opportunity to
|
|
23836
23660
|
do important setup work, and you'll see strange behavior in your
|
|
23837
23661
|
application.
|
|
23838
|
-
|
|
23662
|
+
@method init
|
|
23839
23663
|
@public
|
|
23840
23664
|
*/
|
|
23841
23665
|
|
|
23842
23666
|
|
|
23843
|
-
init() {}
|
|
23667
|
+
init(_properties) {}
|
|
23844
23668
|
/**
|
|
23845
23669
|
Defines the properties that will be concatenated from the superclass
|
|
23846
23670
|
(instead of overridden).
|
|
23847
|
-
|
|
23671
|
+
By default, when you extend an Ember class a property defined in
|
|
23848
23672
|
the subclass overrides a property with the same name that is defined
|
|
23849
23673
|
in the superclass. However, there are some cases where it is preferable
|
|
23850
23674
|
to build up a property's value by combining the superclass' property
|
|
23851
23675
|
value with the subclass' value. An example of this in use within Ember
|
|
23852
23676
|
is the `classNames` property of `Component` from `@ember/component`.
|
|
23853
|
-
|
|
23677
|
+
Here is some sample code showing the difference between a concatenated
|
|
23854
23678
|
property and a normal one:
|
|
23855
|
-
|
|
23679
|
+
```javascript
|
|
23856
23680
|
import EmberObject from '@ember/object';
|
|
23857
|
-
|
|
23681
|
+
const Bar = EmberObject.extend({
|
|
23858
23682
|
// Configure which properties to concatenate
|
|
23859
23683
|
concatenatedProperties: ['concatenatedProperty'],
|
|
23860
|
-
|
|
23684
|
+
someNonConcatenatedProperty: ['bar'],
|
|
23861
23685
|
concatenatedProperty: ['bar']
|
|
23862
23686
|
});
|
|
23863
|
-
|
|
23687
|
+
const FooBar = Bar.extend({
|
|
23864
23688
|
someNonConcatenatedProperty: ['foo'],
|
|
23865
23689
|
concatenatedProperty: ['foo']
|
|
23866
23690
|
});
|
|
23867
|
-
|
|
23691
|
+
let fooBar = FooBar.create();
|
|
23868
23692
|
fooBar.get('someNonConcatenatedProperty'); // ['foo']
|
|
23869
23693
|
fooBar.get('concatenatedProperty'); // ['bar', 'foo']
|
|
23870
23694
|
```
|
|
23871
|
-
|
|
23695
|
+
This behavior extends to object creation as well. Continuing the
|
|
23872
23696
|
above example:
|
|
23873
|
-
|
|
23697
|
+
```javascript
|
|
23874
23698
|
let fooBar = FooBar.create({
|
|
23875
23699
|
someNonConcatenatedProperty: ['baz'],
|
|
23876
23700
|
concatenatedProperty: ['baz']
|
|
@@ -23878,23 +23702,23 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
23878
23702
|
fooBar.get('someNonConcatenatedProperty'); // ['baz']
|
|
23879
23703
|
fooBar.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
|
|
23880
23704
|
```
|
|
23881
|
-
|
|
23882
|
-
|
|
23705
|
+
Adding a single property that is not an array will just add it in the array:
|
|
23706
|
+
```javascript
|
|
23883
23707
|
let fooBar = FooBar.create({
|
|
23884
23708
|
concatenatedProperty: 'baz'
|
|
23885
23709
|
})
|
|
23886
23710
|
view.get('concatenatedProperty'); // ['bar', 'foo', 'baz']
|
|
23887
23711
|
```
|
|
23888
|
-
|
|
23712
|
+
Using the `concatenatedProperties` property, we can tell Ember to mix the
|
|
23889
23713
|
content of the properties.
|
|
23890
|
-
|
|
23714
|
+
In `Component` the `classNames`, `classNameBindings` and
|
|
23891
23715
|
`attributeBindings` properties are concatenated.
|
|
23892
|
-
|
|
23716
|
+
This feature is available for you to use throughout the Ember object model,
|
|
23893
23717
|
although typical app developers are likely to use it infrequently. Since
|
|
23894
23718
|
it changes expectations about behavior of properties, you should properly
|
|
23895
23719
|
document its usage in each individual concatenated property (to not
|
|
23896
23720
|
mislead your users to think they can override the property in a subclass).
|
|
23897
|
-
|
|
23721
|
+
@property concatenatedProperties
|
|
23898
23722
|
@type Array
|
|
23899
23723
|
@default null
|
|
23900
23724
|
@public
|
|
@@ -23903,20 +23727,20 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
23903
23727
|
/**
|
|
23904
23728
|
Defines the properties that will be merged from the superclass
|
|
23905
23729
|
(instead of overridden).
|
|
23906
|
-
|
|
23730
|
+
By default, when you extend an Ember class a property defined in
|
|
23907
23731
|
the subclass overrides a property with the same name that is defined
|
|
23908
23732
|
in the superclass. However, there are some cases where it is preferable
|
|
23909
23733
|
to build up a property's value by merging the superclass property value
|
|
23910
23734
|
with the subclass property's value. An example of this in use within Ember
|
|
23911
23735
|
is the `queryParams` property of routes.
|
|
23912
|
-
|
|
23736
|
+
Here is some sample code showing the difference between a merged
|
|
23913
23737
|
property and a normal one:
|
|
23914
|
-
|
|
23738
|
+
```javascript
|
|
23915
23739
|
import EmberObject from '@ember/object';
|
|
23916
|
-
|
|
23740
|
+
const Bar = EmberObject.extend({
|
|
23917
23741
|
// Configure which properties are to be merged
|
|
23918
23742
|
mergedProperties: ['mergedProperty'],
|
|
23919
|
-
|
|
23743
|
+
someNonMergedProperty: {
|
|
23920
23744
|
nonMerged: 'superclass value of nonMerged'
|
|
23921
23745
|
},
|
|
23922
23746
|
mergedProperty: {
|
|
@@ -23924,7 +23748,7 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
23924
23748
|
limit: { replace: true }
|
|
23925
23749
|
}
|
|
23926
23750
|
});
|
|
23927
|
-
|
|
23751
|
+
const FooBar = Bar.extend({
|
|
23928
23752
|
someNonMergedProperty: {
|
|
23929
23753
|
completelyNonMerged: 'subclass value of nonMerged'
|
|
23930
23754
|
},
|
|
@@ -23932,13 +23756,13 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
23932
23756
|
limit: { replace: false }
|
|
23933
23757
|
}
|
|
23934
23758
|
});
|
|
23935
|
-
|
|
23936
|
-
|
|
23759
|
+
let fooBar = FooBar.create();
|
|
23760
|
+
fooBar.get('someNonMergedProperty');
|
|
23937
23761
|
// => { completelyNonMerged: 'subclass value of nonMerged' }
|
|
23938
23762
|
//
|
|
23939
23763
|
// Note the entire object, including the nonMerged property of
|
|
23940
23764
|
// the superclass object, has been replaced
|
|
23941
|
-
|
|
23765
|
+
fooBar.get('mergedProperty');
|
|
23942
23766
|
// => {
|
|
23943
23767
|
// page: {replace: false},
|
|
23944
23768
|
// limit: {replace: false}
|
|
@@ -23948,15 +23772,15 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
23948
23772
|
// `limit` property's value of `false` has been merged from
|
|
23949
23773
|
// the subclass.
|
|
23950
23774
|
```
|
|
23951
|
-
|
|
23775
|
+
This behavior is not available during object `create` calls. It is only
|
|
23952
23776
|
available at `extend` time.
|
|
23953
|
-
|
|
23954
|
-
|
|
23777
|
+
In `Route` the `queryParams` property is merged.
|
|
23778
|
+
This feature is available for you to use throughout the Ember object model,
|
|
23955
23779
|
although typical app developers are likely to use it infrequently. Since
|
|
23956
23780
|
it changes expectations about behavior of properties, you should properly
|
|
23957
23781
|
document its usage in each individual merged property (to not
|
|
23958
23782
|
mislead your users to think they can override the property in a subclass).
|
|
23959
|
-
|
|
23783
|
+
@property mergedProperties
|
|
23960
23784
|
@type Array
|
|
23961
23785
|
@default null
|
|
23962
23786
|
@public
|
|
@@ -23964,9 +23788,9 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
23964
23788
|
|
|
23965
23789
|
/**
|
|
23966
23790
|
Destroyed object property flag.
|
|
23967
|
-
|
|
23791
|
+
if this property is `true` the observers and bindings were already
|
|
23968
23792
|
removed by the effect of calling the `destroy()` method.
|
|
23969
|
-
|
|
23793
|
+
@property isDestroyed
|
|
23970
23794
|
@default false
|
|
23971
23795
|
@public
|
|
23972
23796
|
*/
|
|
@@ -23976,14 +23800,14 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
23976
23800
|
return (0, _destroyable.isDestroyed)(this);
|
|
23977
23801
|
}
|
|
23978
23802
|
|
|
23979
|
-
set isDestroyed(
|
|
23803
|
+
set isDestroyed(_value) {
|
|
23980
23804
|
(true && !(false) && (0, _debug.assert)(`You cannot set \`${this}.isDestroyed\` directly, please use \`.destroy()\`.`, false));
|
|
23981
23805
|
}
|
|
23982
23806
|
/**
|
|
23983
23807
|
Destruction scheduled flag. The `destroy()` method has been called.
|
|
23984
|
-
|
|
23808
|
+
The object stays intact until the end of the run loop at which point
|
|
23985
23809
|
the `isDestroyed` flag is set.
|
|
23986
|
-
|
|
23810
|
+
@property isDestroying
|
|
23987
23811
|
@default false
|
|
23988
23812
|
@public
|
|
23989
23813
|
*/
|
|
@@ -23993,17 +23817,17 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
23993
23817
|
return (0, _destroyable.isDestroying)(this);
|
|
23994
23818
|
}
|
|
23995
23819
|
|
|
23996
|
-
set isDestroying(
|
|
23820
|
+
set isDestroying(_value) {
|
|
23997
23821
|
(true && !(false) && (0, _debug.assert)(`You cannot set \`${this}.isDestroying\` directly, please use \`.destroy()\`.`, false));
|
|
23998
23822
|
}
|
|
23999
23823
|
/**
|
|
24000
23824
|
Destroys an object by setting the `isDestroyed` flag and removing its
|
|
24001
23825
|
metadata, which effectively destroys observers and bindings.
|
|
24002
|
-
|
|
23826
|
+
If you try to set a property on a destroyed object, an exception will be
|
|
24003
23827
|
raised.
|
|
24004
|
-
|
|
23828
|
+
Note that destruction is scheduled for the end of the run loop and does not
|
|
24005
23829
|
happen immediately. It will set an isDestroying flag immediately.
|
|
24006
|
-
|
|
23830
|
+
@method destroy
|
|
24007
23831
|
@return {EmberObject} receiver
|
|
24008
23832
|
@public
|
|
24009
23833
|
*/
|
|
@@ -24023,7 +23847,7 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
24023
23847
|
}
|
|
24024
23848
|
/**
|
|
24025
23849
|
Override to implement teardown.
|
|
24026
|
-
|
|
23850
|
+
@method willDestroy
|
|
24027
23851
|
@public
|
|
24028
23852
|
*/
|
|
24029
23853
|
|
|
@@ -24033,22 +23857,22 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
24033
23857
|
Returns a string representation which attempts to provide more information
|
|
24034
23858
|
than Javascript's `toString` typically does, in a generic way for all Ember
|
|
24035
23859
|
objects.
|
|
24036
|
-
|
|
23860
|
+
```javascript
|
|
24037
23861
|
import EmberObject from '@ember/object';
|
|
24038
|
-
|
|
23862
|
+
const Person = EmberObject.extend();
|
|
24039
23863
|
person = Person.create();
|
|
24040
23864
|
person.toString(); //=> "<Person:ember1024>"
|
|
24041
23865
|
```
|
|
24042
|
-
|
|
23866
|
+
If the object's class is not defined on an Ember namespace, it will
|
|
24043
23867
|
indicate it is a subclass of the registered superclass:
|
|
24044
|
-
|
|
23868
|
+
```javascript
|
|
24045
23869
|
const Student = Person.extend();
|
|
24046
23870
|
let student = Student.create();
|
|
24047
23871
|
student.toString(); //=> "<(subclass of Person):ember1025>"
|
|
24048
23872
|
```
|
|
24049
|
-
|
|
23873
|
+
If the method `toStringExtension` is defined, its return value will be
|
|
24050
23874
|
included in the output.
|
|
24051
|
-
|
|
23875
|
+
```javascript
|
|
24052
23876
|
const Teacher = Person.extend({
|
|
24053
23877
|
toStringExtension() {
|
|
24054
23878
|
return this.get('fullName');
|
|
@@ -24057,133 +23881,34 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
24057
23881
|
teacher = Teacher.create();
|
|
24058
23882
|
teacher.toString(); //=> "<Teacher:ember1026:Tom Dale>"
|
|
24059
23883
|
```
|
|
24060
|
-
|
|
23884
|
+
@method toString
|
|
24061
23885
|
@return {String} string representation
|
|
24062
23886
|
@public
|
|
24063
23887
|
*/
|
|
24064
23888
|
|
|
24065
23889
|
|
|
24066
23890
|
toString() {
|
|
24067
|
-
var
|
|
24068
|
-
var extension = hasToStringExtension ? `:${this.toStringExtension()}` : '';
|
|
23891
|
+
var extension = hasToStringExtension(this) ? `:${this.toStringExtension()}` : '';
|
|
24069
23892
|
return `<${(0, _container.getFactoryFor)(this) || '(unknown)'}:${(0, _utils.guidFor)(this)}${extension}>`;
|
|
24070
23893
|
}
|
|
24071
|
-
/**
|
|
24072
|
-
Creates a new subclass.
|
|
24073
|
-
```javascript
|
|
24074
|
-
import EmberObject from '@ember/object';
|
|
24075
|
-
const Person = EmberObject.extend({
|
|
24076
|
-
say(thing) {
|
|
24077
|
-
alert(thing);
|
|
24078
|
-
}
|
|
24079
|
-
});
|
|
24080
|
-
```
|
|
24081
|
-
This defines a new subclass of EmberObject: `Person`. It contains one method: `say()`.
|
|
24082
|
-
You can also create a subclass from any existing class by calling its `extend()` method.
|
|
24083
|
-
For example, you might want to create a subclass of Ember's built-in `Component` class:
|
|
24084
|
-
```javascript
|
|
24085
|
-
import Component from '@ember/component';
|
|
24086
|
-
const PersonComponent = Component.extend({
|
|
24087
|
-
tagName: 'li',
|
|
24088
|
-
classNameBindings: ['isAdministrator']
|
|
24089
|
-
});
|
|
24090
|
-
```
|
|
24091
|
-
When defining a subclass, you can override methods but still access the
|
|
24092
|
-
implementation of your parent class by calling the special `_super()` method:
|
|
24093
|
-
```javascript
|
|
24094
|
-
import EmberObject from '@ember/object';
|
|
24095
|
-
const Person = EmberObject.extend({
|
|
24096
|
-
say(thing) {
|
|
24097
|
-
let name = this.get('name');
|
|
24098
|
-
alert(`${name} says: ${thing}`);
|
|
24099
|
-
}
|
|
24100
|
-
});
|
|
24101
|
-
const Soldier = Person.extend({
|
|
24102
|
-
say(thing) {
|
|
24103
|
-
this._super(`${thing}, sir!`);
|
|
24104
|
-
},
|
|
24105
|
-
march(numberOfHours) {
|
|
24106
|
-
alert(`${this.get('name')} marches for ${numberOfHours} hours.`);
|
|
24107
|
-
}
|
|
24108
|
-
});
|
|
24109
|
-
let yehuda = Soldier.create({
|
|
24110
|
-
name: 'Yehuda Katz'
|
|
24111
|
-
});
|
|
24112
|
-
yehuda.say('Yes'); // alerts "Yehuda Katz says: Yes, sir!"
|
|
24113
|
-
```
|
|
24114
|
-
The `create()` on line #17 creates an *instance* of the `Soldier` class.
|
|
24115
|
-
The `extend()` on line #8 creates a *subclass* of `Person`. Any instance
|
|
24116
|
-
of the `Person` class will *not* have the `march()` method.
|
|
24117
|
-
You can also pass `Mixin` classes to add additional properties to the subclass.
|
|
24118
|
-
```javascript
|
|
24119
|
-
import EmberObject from '@ember/object';
|
|
24120
|
-
import Mixin from '@ember/object/mixin';
|
|
24121
|
-
const Person = EmberObject.extend({
|
|
24122
|
-
say(thing) {
|
|
24123
|
-
alert(`${this.get('name')} says: ${thing}`);
|
|
24124
|
-
}
|
|
24125
|
-
});
|
|
24126
|
-
const SingingMixin = Mixin.create({
|
|
24127
|
-
sing(thing) {
|
|
24128
|
-
alert(`${this.get('name')} sings: la la la ${thing}`);
|
|
24129
|
-
}
|
|
24130
|
-
});
|
|
24131
|
-
const BroadwayStar = Person.extend(SingingMixin, {
|
|
24132
|
-
dance() {
|
|
24133
|
-
alert(`${this.get('name')} dances: tap tap tap tap `);
|
|
24134
|
-
}
|
|
24135
|
-
});
|
|
24136
|
-
```
|
|
24137
|
-
The `BroadwayStar` class contains three methods: `say()`, `sing()`, and `dance()`.
|
|
24138
|
-
@method extend
|
|
24139
|
-
@static
|
|
24140
|
-
@for @ember/object
|
|
24141
|
-
@param {Mixin} [mixins]* One or more Mixin classes
|
|
24142
|
-
@param {Object} [arguments]* Object containing values to use within the new class
|
|
24143
|
-
@public
|
|
24144
|
-
*/
|
|
24145
|
-
|
|
24146
23894
|
|
|
24147
23895
|
static extend() {
|
|
24148
23896
|
var Class = class extends this {};
|
|
24149
|
-
|
|
23897
|
+
|
|
23898
|
+
for (var _len2 = arguments.length, mixins = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
23899
|
+
mixins[_key2] = arguments[_key2];
|
|
23900
|
+
}
|
|
23901
|
+
|
|
23902
|
+
reopen.apply(Class.PrototypeMixin, mixins);
|
|
24150
23903
|
return Class;
|
|
24151
23904
|
}
|
|
24152
|
-
/**
|
|
24153
|
-
Creates an instance of a class. Accepts either no arguments, or an object
|
|
24154
|
-
containing values to initialize the newly instantiated object with.
|
|
24155
|
-
```javascript
|
|
24156
|
-
import EmberObject from '@ember/object';
|
|
24157
|
-
const Person = EmberObject.extend({
|
|
24158
|
-
helloWorld() {
|
|
24159
|
-
alert(`Hi, my name is ${this.get('name')}`);
|
|
24160
|
-
}
|
|
24161
|
-
});
|
|
24162
|
-
let tom = Person.create({
|
|
24163
|
-
name: 'Tom Dale'
|
|
24164
|
-
});
|
|
24165
|
-
tom.helloWorld(); // alerts "Hi, my name is Tom Dale".
|
|
24166
|
-
```
|
|
24167
|
-
`create` will call the `init` function if defined during
|
|
24168
|
-
`AnyObject.extend`
|
|
24169
|
-
If no arguments are passed to `create`, it will not set values to the new
|
|
24170
|
-
instance during initialization:
|
|
24171
|
-
```javascript
|
|
24172
|
-
let noName = Person.create();
|
|
24173
|
-
noName.helloWorld(); // alerts undefined
|
|
24174
|
-
```
|
|
24175
|
-
NOTE: For performance reasons, you cannot declare methods or computed
|
|
24176
|
-
properties during `create`. You should instead declare methods and computed
|
|
24177
|
-
properties when using `extend`.
|
|
24178
|
-
@method create
|
|
24179
|
-
@for @ember/object
|
|
24180
|
-
@static
|
|
24181
|
-
@param [arguments]*
|
|
24182
|
-
@public
|
|
24183
|
-
*/
|
|
24184
23905
|
|
|
23906
|
+
static create() {
|
|
23907
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
23908
|
+
args[_key3] = arguments[_key3];
|
|
23909
|
+
}
|
|
24185
23910
|
|
|
24186
|
-
|
|
23911
|
+
var props = args[0];
|
|
24187
23912
|
var instance;
|
|
24188
23913
|
|
|
24189
23914
|
if (props !== undefined) {
|
|
@@ -24193,10 +23918,10 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
24193
23918
|
instance = new this();
|
|
24194
23919
|
}
|
|
24195
23920
|
|
|
24196
|
-
if (
|
|
23921
|
+
if (args.length <= 1) {
|
|
24197
23922
|
initialize(instance, props);
|
|
24198
23923
|
} else {
|
|
24199
|
-
initialize(instance, flattenProps.apply(this,
|
|
23924
|
+
initialize(instance, flattenProps.apply(this, args));
|
|
24200
23925
|
}
|
|
24201
23926
|
|
|
24202
23927
|
return instance;
|
|
@@ -24204,25 +23929,25 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
24204
23929
|
/**
|
|
24205
23930
|
Augments a constructor's prototype with additional
|
|
24206
23931
|
properties and functions:
|
|
24207
|
-
|
|
23932
|
+
```javascript
|
|
24208
23933
|
import EmberObject from '@ember/object';
|
|
24209
|
-
|
|
23934
|
+
const MyObject = EmberObject.extend({
|
|
24210
23935
|
name: 'an object'
|
|
24211
23936
|
});
|
|
24212
|
-
|
|
23937
|
+
o = MyObject.create();
|
|
24213
23938
|
o.get('name'); // 'an object'
|
|
24214
|
-
|
|
23939
|
+
MyObject.reopen({
|
|
24215
23940
|
say(msg) {
|
|
24216
23941
|
console.log(msg);
|
|
24217
23942
|
}
|
|
24218
23943
|
});
|
|
24219
|
-
|
|
23944
|
+
o2 = MyObject.create();
|
|
24220
23945
|
o2.say('hello'); // logs "hello"
|
|
24221
|
-
|
|
23946
|
+
o.say('goodbye'); // logs "goodbye"
|
|
24222
23947
|
```
|
|
24223
|
-
|
|
23948
|
+
To add functions and properties to the constructor itself,
|
|
24224
23949
|
see `reopenClass`
|
|
24225
|
-
|
|
23950
|
+
@method reopen
|
|
24226
23951
|
@for @ember/object
|
|
24227
23952
|
@static
|
|
24228
23953
|
@public
|
|
@@ -24231,7 +23956,12 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
24231
23956
|
|
|
24232
23957
|
static reopen() {
|
|
24233
23958
|
this.willReopen();
|
|
24234
|
-
|
|
23959
|
+
|
|
23960
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
23961
|
+
args[_key4] = arguments[_key4];
|
|
23962
|
+
}
|
|
23963
|
+
|
|
23964
|
+
reopen.apply(this.PrototypeMixin, args);
|
|
24235
23965
|
return this;
|
|
24236
23966
|
}
|
|
24237
23967
|
|
|
@@ -24250,47 +23980,47 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
24250
23980
|
}
|
|
24251
23981
|
/**
|
|
24252
23982
|
Augments a constructor's own properties and functions:
|
|
24253
|
-
|
|
23983
|
+
```javascript
|
|
24254
23984
|
import EmberObject from '@ember/object';
|
|
24255
|
-
|
|
23985
|
+
const MyObject = EmberObject.extend({
|
|
24256
23986
|
name: 'an object'
|
|
24257
23987
|
});
|
|
24258
|
-
|
|
23988
|
+
MyObject.reopenClass({
|
|
24259
23989
|
canBuild: false
|
|
24260
23990
|
});
|
|
24261
|
-
|
|
23991
|
+
MyObject.canBuild; // false
|
|
24262
23992
|
o = MyObject.create();
|
|
24263
23993
|
```
|
|
24264
|
-
|
|
23994
|
+
In other words, this creates static properties and functions for the class.
|
|
24265
23995
|
These are only available on the class and not on any instance of that class.
|
|
24266
|
-
|
|
23996
|
+
```javascript
|
|
24267
23997
|
import EmberObject from '@ember/object';
|
|
24268
|
-
|
|
23998
|
+
const Person = EmberObject.extend({
|
|
24269
23999
|
name: '',
|
|
24270
24000
|
sayHello() {
|
|
24271
24001
|
alert(`Hello. My name is ${this.get('name')}`);
|
|
24272
24002
|
}
|
|
24273
24003
|
});
|
|
24274
|
-
|
|
24004
|
+
Person.reopenClass({
|
|
24275
24005
|
species: 'Homo sapiens',
|
|
24276
|
-
|
|
24006
|
+
createPerson(name) {
|
|
24277
24007
|
return Person.create({ name });
|
|
24278
24008
|
}
|
|
24279
24009
|
});
|
|
24280
|
-
|
|
24010
|
+
let tom = Person.create({
|
|
24281
24011
|
name: 'Tom Dale'
|
|
24282
24012
|
});
|
|
24283
24013
|
let yehuda = Person.createPerson('Yehuda Katz');
|
|
24284
|
-
|
|
24014
|
+
tom.sayHello(); // "Hello. My name is Tom Dale"
|
|
24285
24015
|
yehuda.sayHello(); // "Hello. My name is Yehuda Katz"
|
|
24286
24016
|
alert(Person.species); // "Homo sapiens"
|
|
24287
24017
|
```
|
|
24288
|
-
|
|
24018
|
+
Note that `species` and `createPerson` are *not* valid on the `tom` and `yehuda`
|
|
24289
24019
|
variables. They are only valid on `Person`.
|
|
24290
|
-
|
|
24020
|
+
To add functions and properties to instances of
|
|
24291
24021
|
a constructor by extending the constructor's prototype
|
|
24292
24022
|
see `reopen`
|
|
24293
|
-
|
|
24023
|
+
@method reopenClass
|
|
24294
24024
|
@for @ember/object
|
|
24295
24025
|
@static
|
|
24296
24026
|
@public
|
|
@@ -24298,7 +24028,11 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
24298
24028
|
|
|
24299
24029
|
|
|
24300
24030
|
static reopenClass() {
|
|
24301
|
-
(
|
|
24031
|
+
for (var _len5 = arguments.length, mixins = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
24032
|
+
mixins[_key5] = arguments[_key5];
|
|
24033
|
+
}
|
|
24034
|
+
|
|
24035
|
+
(0, _metal.applyMixin)(this, mixins);
|
|
24302
24036
|
return this;
|
|
24303
24037
|
}
|
|
24304
24038
|
|
|
@@ -24326,21 +24060,21 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
24326
24060
|
metadata about how they function or what values they operate on. For
|
|
24327
24061
|
example, computed property functions may close over variables that are then
|
|
24328
24062
|
no longer available for introspection.
|
|
24329
|
-
|
|
24330
|
-
|
|
24063
|
+
You can pass a hash of these values to a computed property like this:
|
|
24064
|
+
```javascript
|
|
24331
24065
|
import { computed } from '@ember/object';
|
|
24332
|
-
|
|
24066
|
+
person: computed(function() {
|
|
24333
24067
|
let personId = this.get('personId');
|
|
24334
24068
|
return Person.create({ id: personId });
|
|
24335
24069
|
}).meta({ type: Person })
|
|
24336
24070
|
```
|
|
24337
|
-
|
|
24071
|
+
Once you've done this, you can retrieve the values saved to the computed
|
|
24338
24072
|
property from your class like this:
|
|
24339
|
-
|
|
24073
|
+
```javascript
|
|
24340
24074
|
MyClass.metaForProperty('person');
|
|
24341
24075
|
```
|
|
24342
|
-
|
|
24343
|
-
|
|
24076
|
+
This will return the original hash that was passed to `meta()`.
|
|
24077
|
+
@static
|
|
24344
24078
|
@method metaForProperty
|
|
24345
24079
|
@param key {String} property name
|
|
24346
24080
|
@private
|
|
@@ -24357,7 +24091,7 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
24357
24091
|
/**
|
|
24358
24092
|
Iterate over each computed property for the class, passing its name
|
|
24359
24093
|
and any associated metadata (see `metaForProperty`) to the callback.
|
|
24360
|
-
|
|
24094
|
+
@static
|
|
24361
24095
|
@method eachComputedProperty
|
|
24362
24096
|
@param {Function} callback
|
|
24363
24097
|
@param {Object} binding
|
|
@@ -24430,38 +24164,19 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
24430
24164
|
CoreObject.isMethod = false;
|
|
24431
24165
|
|
|
24432
24166
|
function flattenProps() {
|
|
24433
|
-
var {
|
|
24434
|
-
concatenatedProperties,
|
|
24435
|
-
mergedProperties
|
|
24436
|
-
} = this;
|
|
24437
|
-
var hasConcatenatedProps = concatenatedProperties !== undefined && concatenatedProperties.length > 0;
|
|
24438
|
-
var hasMergedProps = mergedProperties !== undefined && mergedProperties.length > 0;
|
|
24439
24167
|
var initProperties = {};
|
|
24440
24168
|
|
|
24441
|
-
for (var
|
|
24442
|
-
|
|
24169
|
+
for (var _len6 = arguments.length, props = new Array(_len6), _key6 = 0; _key6 < _len6; _key6++) {
|
|
24170
|
+
props[_key6] = arguments[_key6];
|
|
24171
|
+
}
|
|
24172
|
+
|
|
24173
|
+
for (var properties of props) {
|
|
24443
24174
|
(true && !(!(properties instanceof _metal.Mixin)) && (0, _debug.assert)('EmberObject.create no longer supports mixing in other ' + 'definitions, use .extend & .create separately instead.', !(properties instanceof _metal.Mixin)));
|
|
24444
24175
|
var keyNames = Object.keys(properties);
|
|
24445
24176
|
|
|
24446
24177
|
for (var j = 0, k = keyNames.length; j < k; j++) {
|
|
24447
24178
|
var keyName = keyNames[j];
|
|
24448
24179
|
var value = properties[keyName];
|
|
24449
|
-
|
|
24450
|
-
if (hasConcatenatedProps && concatenatedProperties.indexOf(keyName) > -1) {
|
|
24451
|
-
var baseValue = initProperties[keyName];
|
|
24452
|
-
|
|
24453
|
-
if (baseValue) {
|
|
24454
|
-
value = (0, _utils.makeArray)(baseValue).concat(value);
|
|
24455
|
-
} else {
|
|
24456
|
-
value = (0, _utils.makeArray)(value);
|
|
24457
|
-
}
|
|
24458
|
-
}
|
|
24459
|
-
|
|
24460
|
-
if (hasMergedProps && mergedProperties.indexOf(keyName) > -1) {
|
|
24461
|
-
var _baseValue2 = initProperties[keyName];
|
|
24462
|
-
value = Object.assign({}, _baseValue2, value);
|
|
24463
|
-
}
|
|
24464
|
-
|
|
24465
24180
|
initProperties[keyName] = value;
|
|
24466
24181
|
}
|
|
24467
24182
|
}
|
|
@@ -24474,7 +24189,7 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
24474
24189
|
) {
|
|
24475
24190
|
/**
|
|
24476
24191
|
Provides lookup-time type validation for injected properties.
|
|
24477
|
-
|
|
24192
|
+
@private
|
|
24478
24193
|
@method _onLookup
|
|
24479
24194
|
*/
|
|
24480
24195
|
CoreObject._onLookup = function injectedPropertyAssertion(debugContainerKey) {
|
|
@@ -24492,7 +24207,7 @@ define("@ember/-internals/runtime/lib/system/core_object", ["exports", "@ember/-
|
|
|
24492
24207
|
/**
|
|
24493
24208
|
Returns a hash of property names and container names that injected
|
|
24494
24209
|
properties will lookup on the container lazily.
|
|
24495
|
-
|
|
24210
|
+
@method _lazyInjections
|
|
24496
24211
|
@return {Object} Hash of all lazy injected property keys to container names
|
|
24497
24212
|
@private
|
|
24498
24213
|
*/
|
|
@@ -24612,18 +24327,7 @@ define("@ember/-internals/runtime/lib/system/object", ["exports", "@ember/-inter
|
|
|
24612
24327
|
/**
|
|
24613
24328
|
@module @ember/object
|
|
24614
24329
|
*/
|
|
24615
|
-
|
|
24616
|
-
/**
|
|
24617
|
-
`EmberObject` is the main base class for all Ember objects. It is a subclass
|
|
24618
|
-
of `CoreObject` with the `Observable` mixin applied. For details,
|
|
24619
|
-
see the documentation for each of these.
|
|
24620
|
-
|
|
24621
|
-
@class EmberObject
|
|
24622
|
-
@extends CoreObject
|
|
24623
|
-
@uses Observable
|
|
24624
|
-
@public
|
|
24625
|
-
*/
|
|
24626
|
-
class EmberObject extends _core_object.default {
|
|
24330
|
+
class EmberObject extends _core_object.default.extend(_observable.default) {
|
|
24627
24331
|
get _debugContainerKey() {
|
|
24628
24332
|
var factory = (0, _container.getFactoryFor)(this);
|
|
24629
24333
|
return factory !== undefined && factory.fullName;
|
|
@@ -24631,21 +24335,10 @@ define("@ember/-internals/runtime/lib/system/object", ["exports", "@ember/-inter
|
|
|
24631
24335
|
|
|
24632
24336
|
}
|
|
24633
24337
|
|
|
24634
|
-
|
|
24635
|
-
|
|
24636
|
-
|
|
24637
|
-
|
|
24638
|
-
var FrameworkObject;
|
|
24338
|
+
var _default = EmberObject;
|
|
24339
|
+
_exports.default = _default;
|
|
24340
|
+
var FrameworkObject = class FrameworkObject extends EmberObject {};
|
|
24639
24341
|
_exports.FrameworkObject = FrameworkObject;
|
|
24640
|
-
_exports.FrameworkObject = FrameworkObject = class FrameworkObject extends _core_object.default {
|
|
24641
|
-
get _debugContainerKey() {
|
|
24642
|
-
var factory = (0, _container.getFactoryFor)(this);
|
|
24643
|
-
return factory !== undefined && factory.fullName;
|
|
24644
|
-
}
|
|
24645
|
-
|
|
24646
|
-
};
|
|
24647
|
-
|
|
24648
|
-
_observable.default.apply(FrameworkObject.prototype);
|
|
24649
24342
|
|
|
24650
24343
|
if (true
|
|
24651
24344
|
/* DEBUG */
|
|
@@ -24653,8 +24346,8 @@ define("@ember/-internals/runtime/lib/system/object", ["exports", "@ember/-inter
|
|
|
24653
24346
|
var INIT_WAS_CALLED = (0, _utils.symbol)('INIT_WAS_CALLED');
|
|
24654
24347
|
var ASSERT_INIT_WAS_CALLED = (0, _utils.symbol)('ASSERT_INIT_WAS_CALLED');
|
|
24655
24348
|
_exports.FrameworkObject = FrameworkObject = class DebugFrameworkObject extends EmberObject {
|
|
24656
|
-
init() {
|
|
24657
|
-
super.init(
|
|
24349
|
+
init(properties) {
|
|
24350
|
+
super.init(properties);
|
|
24658
24351
|
this[INIT_WAS_CALLED] = true;
|
|
24659
24352
|
}
|
|
24660
24353
|
|
|
@@ -27181,36 +26874,49 @@ define("@ember/-internals/views/lib/views/core_view", ["exports", "@ember/-inter
|
|
|
27181
26874
|
});
|
|
27182
26875
|
_exports.default = void 0;
|
|
27183
26876
|
|
|
27184
|
-
var
|
|
27185
|
-
|
|
27186
|
-
|
|
26877
|
+
var __decorate = void 0 && (void 0).__decorate || function (decorators, target, key, desc) {
|
|
26878
|
+
var c = arguments.length,
|
|
26879
|
+
r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
|
|
26880
|
+
d;
|
|
26881
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) {
|
|
26882
|
+
if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
26883
|
+
}
|
|
26884
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
26885
|
+
};
|
|
27187
26886
|
|
|
27188
|
-
|
|
27189
|
-
|
|
26887
|
+
class CoreView extends _runtime.FrameworkObject.extend(_runtime.Evented, _runtime.ActionHandler, {
|
|
26888
|
+
// Continue to declare `_states` here so that we have a single reference on the prototype
|
|
26889
|
+
// instead of one on each instance.
|
|
26890
|
+
_states: _states.default
|
|
26891
|
+
}) {
|
|
26892
|
+
constructor() {
|
|
26893
|
+
super(...arguments);
|
|
26894
|
+
this.isView = true;
|
|
26895
|
+
}
|
|
27190
26896
|
|
|
27191
|
-
|
|
27192
|
-
|
|
27193
|
-
},
|
|
26897
|
+
init(properties) {
|
|
26898
|
+
var _a;
|
|
27194
26899
|
|
|
27195
|
-
|
|
26900
|
+
super.init(properties); // Handle methods from Evented
|
|
26901
|
+
// The native class inheritance will not work for mixins. To work around this,
|
|
26902
|
+
// we copy the existing trigger and has methods provided by the mixin and swap in the
|
|
26903
|
+
// new ones from our class.
|
|
27196
26904
|
|
|
27197
|
-
|
|
27198
|
-
|
|
27199
|
-
|
|
27200
|
-
|
|
27201
|
-
|
|
27202
|
-
|
|
27203
|
-
|
|
27204
|
-
|
|
27205
|
-
parentView: null,
|
|
26905
|
+
this._superTrigger = this.trigger;
|
|
26906
|
+
this.trigger = this._trigger;
|
|
26907
|
+
this._superHas = this.has;
|
|
26908
|
+
this.has = this._has;
|
|
26909
|
+
(_a = this.parentView) !== null && _a !== void 0 ? _a : this.parentView = null;
|
|
26910
|
+
this._state = 'preRender';
|
|
26911
|
+
this._currentState = this._states.preRender;
|
|
26912
|
+
}
|
|
27206
26913
|
|
|
27207
26914
|
instrumentDetails(hash) {
|
|
27208
26915
|
hash['object'] = this.toString();
|
|
27209
26916
|
hash['containerKey'] = this._debugContainerKey;
|
|
27210
26917
|
hash['view'] = this;
|
|
27211
26918
|
return hash;
|
|
27212
|
-
}
|
|
27213
|
-
|
|
26919
|
+
}
|
|
27214
26920
|
/**
|
|
27215
26921
|
Override the default event firing from `Evented` to
|
|
27216
26922
|
also call methods with the given name.
|
|
@@ -27218,29 +26924,34 @@ define("@ember/-internals/views/lib/views/core_view", ["exports", "@ember/-inter
|
|
|
27218
26924
|
@param name {String}
|
|
27219
26925
|
@private
|
|
27220
26926
|
*/
|
|
27221
|
-
trigger
|
|
26927
|
+
// Changed to `trigger` on init
|
|
26928
|
+
|
|
26929
|
+
|
|
26930
|
+
_trigger(name) {
|
|
27222
26931
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
27223
26932
|
args[_key - 1] = arguments[_key];
|
|
27224
26933
|
}
|
|
27225
26934
|
|
|
27226
|
-
this.
|
|
26935
|
+
this._superTrigger(name, ...args);
|
|
27227
26936
|
|
|
27228
26937
|
var method = this[name];
|
|
27229
26938
|
|
|
27230
26939
|
if (typeof method === 'function') {
|
|
27231
26940
|
return method.apply(this, args);
|
|
27232
26941
|
}
|
|
27233
|
-
}
|
|
26942
|
+
} // Changed to `has` on init
|
|
27234
26943
|
|
|
27235
|
-
|
|
27236
|
-
|
|
26944
|
+
|
|
26945
|
+
_has(name) {
|
|
26946
|
+
return typeof this[name] === 'function' || this._superHas(name);
|
|
27237
26947
|
}
|
|
27238
26948
|
|
|
27239
|
-
}
|
|
26949
|
+
}
|
|
26950
|
+
|
|
26951
|
+
CoreView.isViewFactory = true;
|
|
26952
|
+
|
|
26953
|
+
__decorate([(0, _metal.inject)('renderer', '-dom')], CoreView.prototype, "renderer", void 0);
|
|
27240
26954
|
|
|
27241
|
-
CoreView.reopenClass({
|
|
27242
|
-
isViewFactory: true
|
|
27243
|
-
});
|
|
27244
26955
|
var _default = CoreView;
|
|
27245
26956
|
_exports.default = _default;
|
|
27246
26957
|
});
|
|
@@ -29058,7 +28769,7 @@ define("@ember/canary-features/index", ["exports", "@ember/-internals/environmen
|
|
|
29058
28769
|
Object.defineProperty(_exports, "__esModule", {
|
|
29059
28770
|
value: true
|
|
29060
28771
|
});
|
|
29061
|
-
_exports.FEATURES = _exports.EMBER_UNIQUE_ID_HELPER = _exports.
|
|
28772
|
+
_exports.FEATURES = _exports.EMBER_UNIQUE_ID_HELPER = _exports.EMBER_LIBRARIES_ISREGISTERED = _exports.EMBER_IMPROVED_INSTRUMENTATION = _exports.DEFAULT_FEATURES = void 0;
|
|
29062
28773
|
_exports.isEnabled = isEnabled;
|
|
29063
28774
|
|
|
29064
28775
|
/**
|
|
@@ -29072,10 +28783,8 @@ define("@ember/canary-features/index", ["exports", "@ember/-internals/environmen
|
|
|
29072
28783
|
@public
|
|
29073
28784
|
*/
|
|
29074
28785
|
var DEFAULT_FEATURES = {
|
|
29075
|
-
EMBER_LIBRARIES_ISREGISTERED:
|
|
29076
|
-
EMBER_IMPROVED_INSTRUMENTATION:
|
|
29077
|
-
EMBER_ROUTING_ROUTER_SERVICE_REFRESH: true,
|
|
29078
|
-
EMBER_CACHED: true,
|
|
28786
|
+
EMBER_LIBRARIES_ISREGISTERED: false,
|
|
28787
|
+
EMBER_IMPROVED_INSTRUMENTATION: false,
|
|
29079
28788
|
EMBER_UNIQUE_ID_HELPER: true
|
|
29080
28789
|
};
|
|
29081
28790
|
/**
|
|
@@ -29132,10 +28841,6 @@ define("@ember/canary-features/index", ["exports", "@ember/-internals/environmen
|
|
|
29132
28841
|
_exports.EMBER_LIBRARIES_ISREGISTERED = EMBER_LIBRARIES_ISREGISTERED;
|
|
29133
28842
|
var EMBER_IMPROVED_INSTRUMENTATION = featureValue(FEATURES.EMBER_IMPROVED_INSTRUMENTATION);
|
|
29134
28843
|
_exports.EMBER_IMPROVED_INSTRUMENTATION = EMBER_IMPROVED_INSTRUMENTATION;
|
|
29135
|
-
var EMBER_ROUTING_ROUTER_SERVICE_REFRESH = featureValue(FEATURES.EMBER_ROUTING_ROUTER_SERVICE_REFRESH);
|
|
29136
|
-
_exports.EMBER_ROUTING_ROUTER_SERVICE_REFRESH = EMBER_ROUTING_ROUTER_SERVICE_REFRESH;
|
|
29137
|
-
var EMBER_CACHED = featureValue(FEATURES.EMBER_CACHED);
|
|
29138
|
-
_exports.EMBER_CACHED = EMBER_CACHED;
|
|
29139
28844
|
var EMBER_UNIQUE_ID_HELPER = featureValue(FEATURES.EMBER_UNIQUE_ID_HELPER);
|
|
29140
28845
|
_exports.EMBER_UNIQUE_ID_HELPER = EMBER_UNIQUE_ID_HELPER;
|
|
29141
28846
|
});
|
|
@@ -34095,19 +33800,6 @@ define("@ember/polyfills/lib/assign", ["exports", "@ember/debug"], function (_ex
|
|
|
34095
33800
|
return Object.assign(target, ...rest);
|
|
34096
33801
|
}
|
|
34097
33802
|
});
|
|
34098
|
-
define("@ember/renderer/index", ["exports", "@ember/-internals/glimmer"], function (_exports, _glimmer) {
|
|
34099
|
-
"use strict";
|
|
34100
|
-
|
|
34101
|
-
Object.defineProperty(_exports, "__esModule", {
|
|
34102
|
-
value: true
|
|
34103
|
-
});
|
|
34104
|
-
Object.defineProperty(_exports, "renderSettled", {
|
|
34105
|
-
enumerable: true,
|
|
34106
|
-
get: function () {
|
|
34107
|
-
return _glimmer.renderSettled;
|
|
34108
|
-
}
|
|
34109
|
-
});
|
|
34110
|
-
});
|
|
34111
33803
|
define("@ember/routing/auto-location", ["exports", "@ember/-internals/routing"], function (_exports, _routing) {
|
|
34112
33804
|
"use strict";
|
|
34113
33805
|
|
|
@@ -55070,7 +54762,7 @@ define("ember/version", ["exports"], function (_exports) {
|
|
|
55070
54762
|
value: true
|
|
55071
54763
|
});
|
|
55072
54764
|
_exports.default = void 0;
|
|
55073
|
-
var _default = "4.4.0-
|
|
54765
|
+
var _default = "4.4.0-beta.1";
|
|
55074
54766
|
_exports.default = _default;
|
|
55075
54767
|
});
|
|
55076
54768
|
define("route-recognizer", ["exports"], function (_exports) {
|