ember-source 7.4.0-alpha.1 → 7.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/build-metadata.json +3 -3
- package/dist/dev/packages/@ember/-internals/deprecations/index.js +45 -0
- package/dist/dev/packages/@ember/-internals/glimmer/index.js +9 -9
- package/dist/dev/packages/@ember/-internals/metal/index.js +12 -12
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +6 -6
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +2 -2
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/comparable.js +2 -2
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/container_proxy.js +2 -2
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js +2 -2
- package/dist/dev/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -3
- package/dist/dev/packages/@ember/-internals/views/index.js +1 -0
- package/dist/dev/packages/@ember/-internals/views/lib/mixins/action_support.js +2 -2
- package/dist/dev/packages/@ember/-internals/views/lib/system/event_dispatcher.js +1 -1
- package/dist/dev/packages/@ember/-internals/views/lib/views/core-view-utils.js +14 -0
- package/dist/dev/packages/@ember/-internals/views/lib/views/core_view.js +25 -21
- package/dist/dev/packages/@ember/-internals/views/lib/views/states.js +5 -2
- package/dist/dev/packages/@ember/application/index.js +1 -1
- package/dist/dev/packages/@ember/application/instance.js +16 -13
- package/dist/dev/packages/@ember/application/namespace.js +1 -1
- package/dist/dev/packages/@ember/array/index.js +8 -8
- package/dist/dev/packages/@ember/array/proxy.js +8 -5
- package/dist/dev/packages/@ember/component/helper.js +2 -2
- package/dist/dev/packages/@ember/component/index.js +7 -7
- package/dist/dev/packages/@ember/component/template-only.js +1 -1
- package/dist/dev/packages/@ember/controller/index.js +4 -4
- package/dist/dev/packages/@ember/engine/index.js +2 -2
- package/dist/dev/packages/@ember/enumerable/index.js +2 -2
- package/dist/dev/packages/@ember/enumerable/mutable.js +2 -2
- package/dist/dev/packages/@ember/helper/index.js +8 -8
- package/dist/dev/packages/@ember/modifier/index.js +2 -2
- package/dist/dev/packages/@ember/modifier/on.js +1 -1
- package/dist/dev/packages/@ember/object/-internals.js +1 -1
- package/dist/dev/packages/@ember/object/computed.js +2 -2
- package/dist/dev/packages/@ember/object/core.js +7 -7
- package/dist/dev/packages/@ember/object/evented.js +3 -71
- package/dist/dev/packages/@ember/object/events.js +17 -1
- package/dist/dev/packages/@ember/object/index.js +4 -4
- package/dist/dev/packages/@ember/object/lib/computed/computed_macros.js +3 -3
- package/dist/dev/packages/@ember/object/lib/computed/reduce_computed_macros.js +1 -1
- package/dist/dev/packages/@ember/object/mixin.js +11 -592
- package/dist/dev/packages/@ember/object/observable.js +7 -7
- package/dist/dev/packages/@ember/object/observers.js +1 -1
- package/dist/dev/packages/@ember/object/promise-proxy-mixin.js +10 -4
- package/dist/dev/packages/@ember/object/proxy.js +8 -1
- package/dist/dev/packages/@ember/renderer/index.js +1 -1
- package/dist/dev/packages/@ember/routing/index.js +1 -1
- package/dist/dev/packages/@ember/routing/lib/routing-service.js +2 -2
- package/dist/dev/packages/@ember/routing/route.js +34 -9
- package/dist/dev/packages/@ember/routing/router-service.js +71 -6
- package/dist/dev/packages/@ember/routing/router.js +32 -6
- package/dist/dev/packages/@ember/runloop/index.js +1 -1
- package/dist/dev/packages/@ember/service/index.js +1 -1
- package/dist/dev/packages/@ember/template-compiler/lib/compile-options.js +3 -3
- package/dist/dev/packages/@glimmer/destroyable/index.js +43 -14
- package/dist/dev/packages/@glimmer/manager/index.js +3 -3
- package/dist/dev/packages/@glimmer/node/index.js +2 -2
- package/dist/dev/packages/@glimmer/program/index.js +1 -1
- package/dist/dev/packages/@glimmer/reference/index.js +2 -2
- package/dist/dev/packages/@glimmer/runtime/index.js +11 -11
- package/dist/dev/packages/@glimmer/tracking/index.js +1 -1
- package/dist/dev/packages/ember/version.js +1 -1
- package/dist/dev/packages/shared-chunks/{alias-3DBxvoim.js → alias-CSzPOqZC.js} +3 -3
- package/dist/dev/packages/shared-chunks/{api-BlZDPg1n.js → api-B0N4oLJG.js} +3 -3
- package/dist/dev/packages/shared-chunks/{api-Dz70AUL_.js → api-CK8FxDZV.js} +2 -0
- package/dist/dev/packages/shared-chunks/{api-DuLOZMO_.js → api-PyzZqscb.js} +2 -2
- package/dist/dev/packages/shared-chunks/{args-proxy-CS5Brs3_.js → args-proxy-C39f5UPF.js} +1 -1
- package/dist/dev/packages/shared-chunks/{arguments-DniR8eF2.js → arguments-LEaMCStR.js} +7 -3
- package/dist/dev/packages/shared-chunks/{array-DvaweI_T.js → array-CxZAmpTY.js} +2 -2
- package/dist/dev/packages/shared-chunks/{chain-tags-uWSImHzB.js → chain-tags-uYrtCZq1.js} +1 -1
- package/dist/dev/packages/shared-chunks/{computed-DGxbeUbf.js → computed-CXIM4Sjc.js} +3 -3
- package/dist/dev/packages/shared-chunks/{curly-BCD_vyHq.js → curly-DbGgDeux.js} +18 -17
- package/dist/dev/packages/shared-chunks/destroyable-key-BsfVBM7f.js +12 -0
- package/dist/dev/packages/shared-chunks/{element-Cgoi4ldD.js → element-DLh78jeJ.js} +3 -3
- package/dist/dev/packages/shared-chunks/evented-cAr_RO4u.js +100 -0
- package/dist/dev/packages/shared-chunks/{events-6aFVjD4k.js → events-e_Do73jh.js} +3 -0
- package/dist/dev/packages/shared-chunks/{get-zsePWrJL.js → get-fzmvcT9R.js} +3 -3
- package/dist/dev/packages/shared-chunks/{hash-BFu91gtE.js → hash-D1O4fZ99.js} +3 -3
- package/dist/dev/packages/shared-chunks/{index-Bv9SQpEx.js → index-D8La4_AP.js} +12 -12
- package/dist/dev/packages/shared-chunks/{injected_property-DbXd6Gax.js → injected_property-DyyWscn-.js} +1 -1
- package/dist/dev/packages/shared-chunks/{internal-DTOXyEGM.js → internal-CZjbPyX3.js} +2 -2
- package/dist/dev/packages/shared-chunks/{internal-helper-CKrni0b_.js → internal-helper-BkRVvV7p.js} +1 -1
- package/dist/dev/packages/shared-chunks/{invoke-CgF42joE.js → invoke-BPNErlhO.js} +2 -2
- package/dist/dev/packages/shared-chunks/mixin-M88Ghbyw.js +612 -0
- package/dist/dev/packages/shared-chunks/{namespace_search-BfvzEQzN.js → namespace_search-TFdmjK_a.js} +1 -1
- package/dist/dev/packages/shared-chunks/{not-0cVb-rLf.js → not-DNpbxEvj.js} +2 -2
- package/dist/dev/packages/shared-chunks/{observers-DMlX2nCi.js → observers-BsxKjjpC.js} +2 -2
- package/dist/dev/packages/shared-chunks/{on-CVIjn2C-.js → on-Dfya_9b_.js} +3 -3
- package/dist/dev/packages/shared-chunks/{outlet-BO5-QFmm.js → outlet-wIOlGMfN.js} +3 -3
- package/dist/dev/packages/shared-chunks/{property_set-DezUwDX4.js → property_set-CxxTalOq.js} +1 -1
- package/dist/dev/packages/shared-chunks/{reference-BqOLhKFy.js → reference-De0V3Vxp.js} +2 -0
- package/dist/dev/packages/shared-chunks/{rehydrate-builder-CsnkZkur.js → rehydrate-builder-B3wE1O5a.js} +1 -1
- package/dist/dev/packages/shared-chunks/{render-D_Rawf-r.js → render-CNXCIKfb.js} +16 -5
- package/dist/dev/packages/shared-chunks/{serialize-builder-D1oAeiyl.js → serialize-builder-v4amW_JS.js} +1 -1
- package/dist/{prod/packages/shared-chunks/set_properties-DYiBfzdk.js → dev/packages/shared-chunks/set_properties-KoN0q2wj.js} +2 -2
- package/dist/dev/packages/shared-chunks/{setup-registry-Ci8Af2Bz.js → setup-registry-BPb25ZxQ.js} +16 -15
- package/dist/dev/packages/shared-chunks/{template-only-Cu639ICT.js → template-only-DHdQevpG.js} +2 -2
- package/dist/dev/packages/shared-chunks/{textarea-DvS6Xmdh.js → textarea-Obtv2iCY.js} +3 -3
- package/dist/dev/packages/shared-chunks/{tracked-57EW14Ny.js → tracked-CLY9ttD5.js} +1 -1
- package/dist/dev/packages/shared-chunks/{unique-id-Csxuh1I7.js → unique-id-CdB2MG3m.js} +2 -2
- package/dist/prod/packages/@ember/-internals/deprecations/index.js +45 -0
- package/dist/prod/packages/@ember/-internals/glimmer/index.js +9 -9
- package/dist/prod/packages/@ember/-internals/metal/index.js +13 -13
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +6 -6
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/action_handler.js +2 -2
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/comparable.js +2 -2
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/container_proxy.js +2 -2
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/registry_proxy.js +2 -2
- package/dist/prod/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -3
- package/dist/prod/packages/@ember/-internals/views/index.js +1 -0
- package/dist/prod/packages/@ember/-internals/views/lib/mixins/action_support.js +2 -2
- package/dist/prod/packages/@ember/-internals/views/lib/system/event_dispatcher.js +1 -1
- package/dist/prod/packages/@ember/-internals/views/lib/views/core-view-utils.js +14 -0
- package/dist/prod/packages/@ember/-internals/views/lib/views/core_view.js +25 -21
- package/dist/prod/packages/@ember/-internals/views/lib/views/states.js +5 -2
- package/dist/prod/packages/@ember/application/index.js +1 -1
- package/dist/prod/packages/@ember/application/instance.js +14 -12
- package/dist/prod/packages/@ember/application/namespace.js +1 -1
- package/dist/prod/packages/@ember/array/index.js +8 -8
- package/dist/prod/packages/@ember/array/proxy.js +8 -5
- package/dist/prod/packages/@ember/component/helper.js +2 -2
- package/dist/prod/packages/@ember/component/index.js +8 -8
- package/dist/prod/packages/@ember/component/template-only.js +1 -1
- package/dist/prod/packages/@ember/controller/index.js +4 -4
- package/dist/prod/packages/@ember/engine/index.js +2 -2
- package/dist/prod/packages/@ember/enumerable/index.js +2 -2
- package/dist/prod/packages/@ember/enumerable/mutable.js +2 -2
- package/dist/prod/packages/@ember/helper/index.js +8 -8
- package/dist/prod/packages/@ember/modifier/index.js +2 -2
- package/dist/prod/packages/@ember/modifier/on.js +1 -1
- package/dist/prod/packages/@ember/object/-internals.js +1 -0
- package/dist/prod/packages/@ember/object/compat.js +1 -1
- package/dist/prod/packages/@ember/object/computed.js +2 -2
- package/dist/prod/packages/@ember/object/core.js +7 -7
- package/dist/prod/packages/@ember/object/evented.js +3 -71
- package/dist/prod/packages/@ember/object/events.js +17 -1
- package/dist/prod/packages/@ember/object/index.js +5 -5
- package/dist/prod/packages/@ember/object/internals.js +1 -0
- package/dist/prod/packages/@ember/object/lib/computed/computed_macros.js +3 -3
- package/dist/prod/packages/@ember/object/lib/computed/reduce_computed_macros.js +1 -1
- package/dist/prod/packages/@ember/object/mixin.js +9 -557
- package/dist/prod/packages/@ember/object/observable.js +7 -7
- package/dist/prod/packages/@ember/object/observers.js +1 -1
- package/dist/prod/packages/@ember/object/promise-proxy-mixin.js +10 -4
- package/dist/prod/packages/@ember/object/proxy.js +8 -1
- package/dist/prod/packages/@ember/renderer/index.js +1 -1
- package/dist/prod/packages/@ember/routing/index.js +1 -1
- package/dist/prod/packages/@ember/routing/lib/routing-service.js +2 -2
- package/dist/prod/packages/@ember/routing/route.js +35 -10
- package/dist/prod/packages/@ember/routing/router-service.js +71 -6
- package/dist/prod/packages/@ember/routing/router.js +32 -6
- package/dist/prod/packages/@ember/runloop/index.js +1 -1
- package/dist/prod/packages/@ember/service/index.js +1 -1
- package/dist/prod/packages/@ember/template-compiler/lib/compile-options.js +3 -3
- package/dist/prod/packages/@glimmer/destroyable/index.js +37 -11
- package/dist/prod/packages/@glimmer/manager/index.js +3 -3
- package/dist/prod/packages/@glimmer/node/index.js +2 -2
- package/dist/prod/packages/@glimmer/program/index.js +1 -1
- package/dist/prod/packages/@glimmer/reference/index.js +2 -2
- package/dist/prod/packages/@glimmer/runtime/index.js +11 -11
- package/dist/prod/packages/@glimmer/tracking/index.js +1 -1
- package/dist/prod/packages/ember/version.js +1 -1
- package/dist/prod/packages/shared-chunks/{alias-IFzw6sv_.js → alias-DvgufSYq.js} +4 -4
- package/dist/prod/packages/shared-chunks/{api-DzOa0Acr.js → api-B3M8aF1d.js} +2 -0
- package/dist/prod/packages/shared-chunks/{api-B_poQGXS.js → api-CoUjEXgs.js} +3 -3
- package/dist/prod/packages/shared-chunks/{api-DlJKfm_f.js → api-DJnXAjon.js} +2 -2
- package/dist/prod/packages/shared-chunks/{args-proxy-CCoFtYLS.js → args-proxy-BHODnDyt.js} +1 -1
- package/dist/prod/packages/shared-chunks/{arguments-CCYATlEH.js → arguments-xjTAZ6VE.js} +7 -3
- package/dist/prod/packages/shared-chunks/{array-CnXdmzOG.js → array-CK__rqeu.js} +2 -2
- package/dist/prod/packages/shared-chunks/{chain-tags-B2J7DsxO.js → chain-tags-BlsXEpE-.js} +1 -1
- package/dist/prod/packages/shared-chunks/{computed-BNdMwGhH.js → computed-ZvOk7SJQ.js} +4 -4
- package/dist/prod/packages/shared-chunks/{curly-CdvJuTyW.js → curly-Bg--Dj0X.js} +18 -17
- package/dist/prod/packages/shared-chunks/{decorator-9ikVwsjY.js → decorator-DcvVDSJV.js} +1 -1
- package/dist/prod/packages/shared-chunks/destroyable-key-BsfVBM7f.js +12 -0
- package/dist/prod/packages/shared-chunks/{element-BmBjPjkQ.js → element-CZnh4CbF.js} +3 -3
- package/dist/prod/packages/shared-chunks/evented-DYsL5t87.js +100 -0
- package/dist/prod/packages/shared-chunks/{events-DYrYz3V8.js → events-3Q5Qvo6Q.js} +3 -0
- package/dist/prod/packages/shared-chunks/{get-CEjFJzGs.js → get-B1Vq9Mmk.js} +3 -3
- package/dist/prod/packages/shared-chunks/{hash-BitfXhCx.js → hash-pP7ZP_NN.js} +3 -3
- package/dist/prod/packages/shared-chunks/{index-D8cl-pfl.js → index-Dncpaycf.js} +12 -12
- package/dist/prod/packages/shared-chunks/{injected_property-DqQ0XV7k.js → injected_property-4vB_6fM8.js} +2 -2
- package/dist/prod/packages/shared-chunks/{internal-BQ7zHrqS.js → internal-D1sloI2P.js} +2 -2
- package/dist/prod/packages/shared-chunks/{internal-helper-Bz1lpDXr.js → internal-helper-Becm19An.js} +1 -1
- package/dist/prod/packages/shared-chunks/{invoke-4JGJYH7Z.js → invoke-BqNxG81o.js} +2 -2
- package/dist/prod/packages/shared-chunks/mixin-AGmJaAAY.js +576 -0
- package/dist/prod/packages/shared-chunks/{namespace_search-BfvzEQzN.js → namespace_search-TFdmjK_a.js} +1 -1
- package/dist/prod/packages/shared-chunks/{not-Dn5s9qVZ.js → not-BRssU6nS.js} +2 -2
- package/dist/prod/packages/shared-chunks/{observers-BmobpXAF.js → observers-B1wiwQeH.js} +2 -2
- package/dist/prod/packages/shared-chunks/{on-ov4KAucw.js → on-BFt-Sx9A.js} +3 -3
- package/dist/prod/packages/shared-chunks/{outlet-BWnaVOrA.js → outlet-bc38zkd8.js} +3 -3
- package/dist/prod/packages/shared-chunks/{property_set-BmAQ0MGK.js → property_set-CVmdjPdh.js} +2 -2
- package/dist/prod/packages/shared-chunks/{reference-CG0yPgLy.js → reference-CccCE8mJ.js} +2 -0
- package/dist/prod/packages/shared-chunks/{rehydrate-builder-n_8RCUj9.js → rehydrate-builder-B9bh-2Dy.js} +1 -1
- package/dist/prod/packages/shared-chunks/{render-BAVl5E6X.js → render-C_iak8Db.js} +16 -5
- package/dist/prod/packages/shared-chunks/{serialize-builder-CsG9WHVw.js → serialize-builder-Du-432zt.js} +1 -1
- package/dist/{dev/packages/shared-chunks/set_properties-BzM_irwA.js → prod/packages/shared-chunks/set_properties-BObIgkE-.js} +2 -2
- package/dist/prod/packages/shared-chunks/{setup-registry-DeyoFe6Q.js → setup-registry-Czh4z4t2.js} +16 -15
- package/dist/prod/packages/shared-chunks/{template-only-DKNcKM5b.js → template-only-CWsfnbVm.js} +2 -2
- package/dist/prod/packages/shared-chunks/{textarea-B-sssXGa.js → textarea-DbUSajBD.js} +3 -3
- package/dist/prod/packages/shared-chunks/{tracked-DvOpYI0o.js → tracked-z77O-F0O.js} +2 -2
- package/dist/prod/packages/shared-chunks/{unique-id-BJb1p8EG.js → unique-id-DNqsbhfh.js} +2 -2
- package/docs/data.json +855 -507
- package/lib/browsers.cjs +33 -33
- package/package.json +4 -3
- package/types/stable/@ember/-internals/deprecations/index.d.ts +30 -0
- package/types/stable/@ember/-internals/glimmer/index.d.ts +1 -1
- package/types/stable/@ember/-internals/metal/lib/evented-methods.d.ts +22 -0
- package/types/stable/@ember/-internals/metal/lib/events.d.ts +1 -0
- package/types/stable/@ember/-internals/utils/lib/internal-mixin-create.d.ts +13 -0
- package/types/stable/@ember/-internals/views/index.d.ts +1 -0
- package/types/stable/@ember/-internals/views/lib/views/core-view-utils.d.ts +5 -0
- package/types/stable/@ember/-internals/views/lib/views/core_view.d.ts +9 -6
- package/types/stable/@ember/array/proxy.d.ts +1 -0
- package/types/stable/@ember/object/evented.d.ts +6 -0
- package/types/stable/@ember/object/events.d.ts +26 -1
- package/types/stable/@ember/object/mixin.d.ts +3 -0
- package/types/stable/@ember/object/promise-proxy-mixin.d.ts +1 -0
- package/types/stable/@ember/object/proxy.d.ts +2 -0
- package/types/stable/@ember/routing/route.d.ts +9 -2
- package/types/stable/@ember/routing/router-service.d.ts +54 -6
- package/types/stable/@ember/routing/router.d.ts +9 -8
- package/types/stable/@glimmer/destroyable/index.d.ts +1 -0
- package/types/stable/@glimmer/runtime/lib/vm/element-builder.d.ts +2 -0
- package/types/stable/@glimmer/runtime/lib/vm/render-result.d.ts +2 -0
- package/types/stable/@glimmer/runtime/lib/vm/update.d.ts +2 -0
- package/types/stable/@glimmer/syntax/lib/keywords.d.ts +2 -2
- package/types/stable/@glimmer/util/lib/destroyable-key.d.ts +15 -0
- package/types/stable/index.d.ts +4 -0
|
@@ -1,593 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import '../../shared-chunks/container-BzzHmCNj.js';
|
|
2
|
+
import '../-internals/meta/lib/meta.js';
|
|
3
|
+
import '../../shared-chunks/super-BBBjgF69.js';
|
|
4
|
+
export { a as applyMixin, M as default, m as mixin } from '../../shared-chunks/mixin-M88Ghbyw.js';
|
|
4
5
|
import '../debug/index.js';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
@module @ember/object/mixin
|
|
14
|
-
*/
|
|
15
|
-
const a_concat = Array.prototype.concat;
|
|
16
|
-
const {
|
|
17
|
-
isArray
|
|
18
|
-
} = Array;
|
|
19
|
-
function extractAccessors(properties) {
|
|
20
|
-
if (properties !== undefined) {
|
|
21
|
-
for (let key of Object.keys(properties)) {
|
|
22
|
-
let desc = Object.getOwnPropertyDescriptor(properties, key);
|
|
23
|
-
if (desc.get !== undefined || desc.set !== undefined) {
|
|
24
|
-
Object.defineProperty(properties, key, {
|
|
25
|
-
value: nativeDescDecorator(desc)
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return properties;
|
|
31
|
-
}
|
|
32
|
-
function concatenatedMixinProperties(concatProp, props, values, base) {
|
|
33
|
-
// reset before adding each new mixin to pickup concats from previous
|
|
34
|
-
let concats = values[concatProp] || base[concatProp];
|
|
35
|
-
if (props[concatProp]) {
|
|
36
|
-
concats = concats ? a_concat.call(concats, props[concatProp]) : props[concatProp];
|
|
37
|
-
}
|
|
38
|
-
return concats;
|
|
39
|
-
}
|
|
40
|
-
function giveDecoratorSuper(key, decorator, property, descs) {
|
|
41
|
-
if (property === true) {
|
|
42
|
-
return decorator;
|
|
43
|
-
}
|
|
44
|
-
let originalGetter = property._getter;
|
|
45
|
-
if (originalGetter === undefined) {
|
|
46
|
-
return decorator;
|
|
47
|
-
}
|
|
48
|
-
let superDesc = descs[key];
|
|
49
|
-
|
|
50
|
-
// Check to see if the super property is a decorator first, if so load its descriptor
|
|
51
|
-
let superProperty = typeof superDesc === 'function' ? descriptorForDecorator(superDesc) : superDesc;
|
|
52
|
-
if (superProperty === undefined || superProperty === true) {
|
|
53
|
-
return decorator;
|
|
54
|
-
}
|
|
55
|
-
let superGetter = superProperty._getter;
|
|
56
|
-
if (superGetter === undefined) {
|
|
57
|
-
return decorator;
|
|
58
|
-
}
|
|
59
|
-
let get = wrap(originalGetter, superGetter);
|
|
60
|
-
let set;
|
|
61
|
-
let originalSetter = property._setter;
|
|
62
|
-
let superSetter = superProperty._setter;
|
|
63
|
-
if (superSetter !== undefined) {
|
|
64
|
-
if (originalSetter !== undefined) {
|
|
65
|
-
set = wrap(originalSetter, superSetter);
|
|
66
|
-
} else {
|
|
67
|
-
// If the super property has a setter, we default to using it no matter what.
|
|
68
|
-
// This is clearly very broken and weird, but it's what was here so we have
|
|
69
|
-
// to keep it until the next major at least.
|
|
70
|
-
//
|
|
71
|
-
// TODO: Add a deprecation here.
|
|
72
|
-
set = superSetter;
|
|
73
|
-
}
|
|
74
|
-
} else {
|
|
75
|
-
set = originalSetter;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
// only create a new CP if we must
|
|
79
|
-
if (get !== originalGetter || set !== originalSetter) {
|
|
80
|
-
// Since multiple mixins may inherit from the same parent, we need
|
|
81
|
-
// to clone the computed property so that other mixins do not receive
|
|
82
|
-
// the wrapped version.
|
|
83
|
-
let dependentKeys = property._dependentKeys || [];
|
|
84
|
-
let newProperty = new ComputedProperty([...dependentKeys, {
|
|
85
|
-
get,
|
|
86
|
-
set
|
|
87
|
-
}]);
|
|
88
|
-
newProperty._readOnly = property._readOnly;
|
|
89
|
-
newProperty._meta = property._meta;
|
|
90
|
-
newProperty.enumerable = property.enumerable;
|
|
91
|
-
|
|
92
|
-
// SAFETY: We passed in the impl for this class
|
|
93
|
-
return makeComputedDecorator(newProperty, ComputedProperty);
|
|
94
|
-
}
|
|
95
|
-
return decorator;
|
|
96
|
-
}
|
|
97
|
-
function giveMethodSuper(key, method, values, descs) {
|
|
98
|
-
// Methods overwrite computed properties, and do not call super to them.
|
|
99
|
-
if (descs[key] !== undefined) {
|
|
100
|
-
return method;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// Find the original method in a parent mixin
|
|
104
|
-
let superMethod = values[key];
|
|
105
|
-
|
|
106
|
-
// Only wrap the new method if the original method was a function
|
|
107
|
-
if (typeof superMethod === 'function') {
|
|
108
|
-
return wrap(method, superMethod);
|
|
109
|
-
}
|
|
110
|
-
return method;
|
|
111
|
-
}
|
|
112
|
-
function simpleMakeArray(value) {
|
|
113
|
-
if (!value) {
|
|
114
|
-
return [];
|
|
115
|
-
} else if (!Array.isArray(value)) {
|
|
116
|
-
return [value];
|
|
117
|
-
} else {
|
|
118
|
-
return value;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
function applyConcatenatedProperties(key, value, values) {
|
|
122
|
-
let baseValue = values[key];
|
|
123
|
-
let ret = simpleMakeArray(baseValue).concat(simpleMakeArray(value));
|
|
124
|
-
{
|
|
125
|
-
// it is possible to use concatenatedProperties with strings (which cannot be frozen)
|
|
126
|
-
// only freeze objects...
|
|
127
|
-
if (typeof ret === 'object' && ret !== null) {
|
|
128
|
-
// prevent mutating `concatenatedProperties` array after it is applied
|
|
129
|
-
Object.freeze(ret);
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return ret;
|
|
133
|
-
}
|
|
134
|
-
function applyMergedProperties(key, value, values) {
|
|
135
|
-
let baseValue = values[key];
|
|
136
|
-
(!(!isArray(value)) && assert(`You passed in \`${JSON.stringify(value)}\` as the value for \`${key}\` but \`${key}\` cannot be an Array`, !isArray(value)));
|
|
137
|
-
if (!baseValue) {
|
|
138
|
-
return value;
|
|
139
|
-
}
|
|
140
|
-
let newBase = Object.assign({}, baseValue);
|
|
141
|
-
let hasFunction = false;
|
|
142
|
-
let props = Object.keys(value);
|
|
143
|
-
for (let prop of props) {
|
|
144
|
-
let propValue = value[prop];
|
|
145
|
-
if (typeof propValue === 'function') {
|
|
146
|
-
hasFunction = true;
|
|
147
|
-
newBase[prop] = giveMethodSuper(prop, propValue, baseValue, {});
|
|
148
|
-
} else {
|
|
149
|
-
newBase[prop] = propValue;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
if (hasFunction) {
|
|
153
|
-
newBase._super = ROOT;
|
|
154
|
-
}
|
|
155
|
-
return newBase;
|
|
156
|
-
}
|
|
157
|
-
function mergeMixins(mixins, meta, descs, values, base, keys, keysWithSuper) {
|
|
158
|
-
let currentMixin;
|
|
159
|
-
for (let i = 0; i < mixins.length; i++) {
|
|
160
|
-
currentMixin = mixins[i];
|
|
161
|
-
(!(typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]') && assert(`Expected hash or Mixin instance, got ${Object.prototype.toString.call(currentMixin)}`, typeof currentMixin === 'object' && currentMixin !== null && Object.prototype.toString.call(currentMixin) !== '[object Array]'));
|
|
162
|
-
if (MIXINS.has(currentMixin)) {
|
|
163
|
-
if (meta.hasMixin(currentMixin)) {
|
|
164
|
-
continue;
|
|
165
|
-
}
|
|
166
|
-
meta.addMixin(currentMixin);
|
|
167
|
-
let {
|
|
168
|
-
properties,
|
|
169
|
-
mixins
|
|
170
|
-
} = currentMixin;
|
|
171
|
-
if (properties !== undefined) {
|
|
172
|
-
mergeProps(meta, properties, descs, values, base, keys, keysWithSuper);
|
|
173
|
-
} else if (mixins !== undefined) {
|
|
174
|
-
mergeMixins(mixins, meta, descs, values, base, keys, keysWithSuper);
|
|
175
|
-
if (currentMixin instanceof Mixin && currentMixin._without !== undefined) {
|
|
176
|
-
currentMixin._without.forEach(keyName => {
|
|
177
|
-
// deleting the key means we won't process the value
|
|
178
|
-
let index = keys.indexOf(keyName);
|
|
179
|
-
if (index !== -1) {
|
|
180
|
-
keys.splice(index, 1);
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
} else {
|
|
186
|
-
mergeProps(meta, currentMixin, descs, values, base, keys, keysWithSuper);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
function mergeProps(meta, props, descs, values, base, keys, keysWithSuper) {
|
|
191
|
-
let concats = concatenatedMixinProperties('concatenatedProperties', props, values, base);
|
|
192
|
-
let mergings = concatenatedMixinProperties('mergedProperties', props, values, base);
|
|
193
|
-
let propKeys = Object.keys(props);
|
|
194
|
-
for (let key of propKeys) {
|
|
195
|
-
let value = props[key];
|
|
196
|
-
if (value === undefined) continue;
|
|
197
|
-
if (keys.indexOf(key) === -1) {
|
|
198
|
-
keys.push(key);
|
|
199
|
-
let desc = meta.peekDescriptors(key);
|
|
200
|
-
if (desc === undefined) {
|
|
201
|
-
// If the value is a classic decorator, we don't want to actually
|
|
202
|
-
// access it, because that will execute the decorator while we're
|
|
203
|
-
// building the class.
|
|
204
|
-
if (!isClassicDecorator(value)) {
|
|
205
|
-
// The superclass did not have a CP, which means it may have
|
|
206
|
-
// observers or listeners on that property.
|
|
207
|
-
let prev = values[key] = base[key];
|
|
208
|
-
if (typeof prev === 'function') {
|
|
209
|
-
updateObserversAndListeners(base, key, prev, false);
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
} else {
|
|
213
|
-
descs[key] = desc;
|
|
214
|
-
|
|
215
|
-
// The super desc will be overwritten on descs, so save off the fact that
|
|
216
|
-
// there was a super so we know to Object.defineProperty when writing
|
|
217
|
-
// the value
|
|
218
|
-
keysWithSuper.push(key);
|
|
219
|
-
desc.teardown(base, key, meta);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
let isFunction = typeof value === 'function';
|
|
223
|
-
if (isFunction) {
|
|
224
|
-
let desc = descriptorForDecorator(value);
|
|
225
|
-
if (desc !== undefined) {
|
|
226
|
-
// Wrap descriptor function to implement _super() if needed
|
|
227
|
-
descs[key] = giveDecoratorSuper(key, value, desc, descs);
|
|
228
|
-
values[key] = undefined;
|
|
229
|
-
continue;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
if (concats && concats.indexOf(key) >= 0 || key === 'concatenatedProperties' || key === 'mergedProperties') {
|
|
233
|
-
value = applyConcatenatedProperties(key, value, values);
|
|
234
|
-
} else if (mergings && mergings.indexOf(key) > -1) {
|
|
235
|
-
value = applyMergedProperties(key, value, values);
|
|
236
|
-
} else if (isFunction) {
|
|
237
|
-
value = giveMethodSuper(key, value, values, descs);
|
|
238
|
-
}
|
|
239
|
-
values[key] = value;
|
|
240
|
-
descs[key] = undefined;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
function updateObserversAndListeners(obj, key, fn, add) {
|
|
244
|
-
let meta = observerListenerMetaFor(fn);
|
|
245
|
-
if (meta === undefined) return;
|
|
246
|
-
let {
|
|
247
|
-
observers,
|
|
248
|
-
listeners
|
|
249
|
-
} = meta;
|
|
250
|
-
if (observers !== undefined) {
|
|
251
|
-
let updateObserver = add ? addObserver : removeObserver;
|
|
252
|
-
for (let path of observers.paths) {
|
|
253
|
-
updateObserver(obj, path, null, key, observers.sync);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
if (listeners !== undefined) {
|
|
257
|
-
let updateListener = add ? addListener : removeListener;
|
|
258
|
-
for (let listener of listeners) {
|
|
259
|
-
updateListener(obj, listener, null, key);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
function applyMixin(obj, mixins, _hideKeys = false) {
|
|
264
|
-
let descs = Object.create(null);
|
|
265
|
-
let values = Object.create(null);
|
|
266
|
-
let meta$1 = meta(obj);
|
|
267
|
-
let keys = [];
|
|
268
|
-
let keysWithSuper = [];
|
|
269
|
-
obj._super = ROOT;
|
|
270
|
-
|
|
271
|
-
// Go through all mixins and hashes passed in, and:
|
|
272
|
-
//
|
|
273
|
-
// * Handle concatenated properties
|
|
274
|
-
// * Handle merged properties
|
|
275
|
-
// * Set up _super wrapping if necessary
|
|
276
|
-
// * Set up computed property descriptors
|
|
277
|
-
// * Copying `toString` in broken browsers
|
|
278
|
-
mergeMixins(mixins, meta$1, descs, values, obj, keys, keysWithSuper);
|
|
279
|
-
for (let key of keys) {
|
|
280
|
-
let value = values[key];
|
|
281
|
-
let desc = descs[key];
|
|
282
|
-
if (value !== undefined) {
|
|
283
|
-
if (typeof value === 'function') {
|
|
284
|
-
updateObserversAndListeners(obj, key, value, true);
|
|
285
|
-
}
|
|
286
|
-
defineValue(obj, key, value, keysWithSuper.indexOf(key) !== -1, !_hideKeys);
|
|
287
|
-
} else if (desc !== undefined) {
|
|
288
|
-
defineDecorator(obj, key, desc, meta$1);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
if (!meta$1.isPrototypeMeta(obj)) {
|
|
292
|
-
revalidateObservers(obj);
|
|
293
|
-
}
|
|
294
|
-
return obj;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
/**
|
|
298
|
-
@method mixin
|
|
299
|
-
@param obj
|
|
300
|
-
@param mixins*
|
|
301
|
-
@return obj
|
|
302
|
-
@private
|
|
303
|
-
*/
|
|
304
|
-
function mixin(obj, ...args) {
|
|
305
|
-
applyMixin(obj, args);
|
|
306
|
-
return obj;
|
|
307
|
-
}
|
|
308
|
-
const MIXINS = new WeakSet();
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
The `Mixin` class allows you to create mixins, whose properties can be
|
|
312
|
-
added to other classes. For instance,
|
|
313
|
-
|
|
314
|
-
```javascript
|
|
315
|
-
import Mixin from '@ember/object/mixin';
|
|
316
|
-
|
|
317
|
-
const EditableMixin = Mixin.create({
|
|
318
|
-
edit() {
|
|
319
|
-
console.log('starting to edit');
|
|
320
|
-
this.set('isEditing', true);
|
|
321
|
-
},
|
|
322
|
-
isEditing: false
|
|
323
|
-
});
|
|
324
|
-
```
|
|
325
|
-
|
|
326
|
-
```javascript
|
|
327
|
-
import EmberObject from '@ember/object';
|
|
328
|
-
import EditableMixin from '../mixins/editable';
|
|
329
|
-
|
|
330
|
-
// Mix mixins into classes by passing them as the first arguments to
|
|
331
|
-
// `.extend.`
|
|
332
|
-
class Comment extends EmberObject.extend(EditableMixin) {
|
|
333
|
-
post = null
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
let comment = Comment.create({
|
|
337
|
-
post: somePost
|
|
338
|
-
});
|
|
339
|
-
|
|
340
|
-
comment.edit(); // outputs 'starting to edit'
|
|
341
|
-
```
|
|
342
|
-
|
|
343
|
-
Note that Mixins are created with `Mixin.create`, not
|
|
344
|
-
`Mixin.extend`.
|
|
345
|
-
|
|
346
|
-
Note that mixins extend a constructor's prototype so arrays and object literals
|
|
347
|
-
defined as properties will be shared amongst objects that implement the mixin.
|
|
348
|
-
If you want to define a property in a mixin that is not shared, you can define
|
|
349
|
-
it either as a computed property or have it be created on initialization of the object.
|
|
350
|
-
|
|
351
|
-
```javascript
|
|
352
|
-
// filters array will be shared amongst any object implementing mixin
|
|
353
|
-
import Mixin from '@ember/object/mixin';
|
|
354
|
-
import { A } from '@ember/array';
|
|
355
|
-
|
|
356
|
-
const FilterableMixin = Mixin.create({
|
|
357
|
-
filters: A()
|
|
358
|
-
});
|
|
359
|
-
```
|
|
360
|
-
|
|
361
|
-
```javascript
|
|
362
|
-
import Mixin from '@ember/object/mixin';
|
|
363
|
-
import { A } from '@ember/array';
|
|
364
|
-
import { computed } from '@ember/object';
|
|
365
|
-
|
|
366
|
-
// filters will be a separate array for every object implementing the mixin
|
|
367
|
-
const FilterableMixin = Mixin.create({
|
|
368
|
-
filters: computed(function() {
|
|
369
|
-
return A();
|
|
370
|
-
})
|
|
371
|
-
});
|
|
372
|
-
```
|
|
373
|
-
|
|
374
|
-
```javascript
|
|
375
|
-
import Mixin from '@ember/object/mixin';
|
|
376
|
-
import { A } from '@ember/array';
|
|
377
|
-
|
|
378
|
-
// filters will be created as a separate array during the object's initialization
|
|
379
|
-
const Filterable = Mixin.create({
|
|
380
|
-
filters: null,
|
|
381
|
-
|
|
382
|
-
init() {
|
|
383
|
-
this._super(...arguments);
|
|
384
|
-
this.set("filters", A());
|
|
385
|
-
}
|
|
386
|
-
});
|
|
387
|
-
```
|
|
388
|
-
|
|
389
|
-
@class Mixin
|
|
390
|
-
@public
|
|
391
|
-
*/
|
|
392
|
-
class Mixin {
|
|
393
|
-
/** @internal */
|
|
394
|
-
|
|
395
|
-
/** @internal */
|
|
396
|
-
mixins;
|
|
397
|
-
|
|
398
|
-
/** @internal */
|
|
399
|
-
properties;
|
|
400
|
-
|
|
401
|
-
/** @internal */
|
|
402
|
-
ownerConstructor;
|
|
403
|
-
|
|
404
|
-
/** @internal */
|
|
405
|
-
_without;
|
|
406
|
-
/** @internal */
|
|
407
|
-
constructor(mixins, properties) {
|
|
408
|
-
MIXINS.add(this);
|
|
409
|
-
this.properties = extractAccessors(properties);
|
|
410
|
-
this.mixins = buildMixinsArray(mixins);
|
|
411
|
-
this.ownerConstructor = undefined;
|
|
412
|
-
this._without = undefined;
|
|
413
|
-
{
|
|
414
|
-
// Eagerly add INIT_FACTORY to avoid issues in DEBUG as a result of Object.seal(mixin)
|
|
415
|
-
this[INIT_FACTORY] = null;
|
|
416
|
-
if (Mixin._disableDebugSeal !== true) {
|
|
417
|
-
Object.seal(this);
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
/**
|
|
423
|
-
@method create
|
|
424
|
-
@for @ember/object/mixin
|
|
425
|
-
@static
|
|
426
|
-
@param arguments*
|
|
427
|
-
@public
|
|
428
|
-
*/
|
|
429
|
-
static create(...args) {
|
|
430
|
-
setUnprocessedMixins();
|
|
431
|
-
let M = this;
|
|
432
|
-
return new M(args, undefined);
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
// returns the mixins currently applied to the specified object
|
|
436
|
-
// TODO: Make `mixin`
|
|
437
|
-
/** @internal */
|
|
438
|
-
static mixins(obj) {
|
|
439
|
-
let meta = peekMeta(obj);
|
|
440
|
-
let ret = [];
|
|
441
|
-
if (meta === null) {
|
|
442
|
-
return ret;
|
|
443
|
-
}
|
|
444
|
-
meta.forEachMixins(currentMixin => {
|
|
445
|
-
// skip primitive mixins since these are always anonymous
|
|
446
|
-
if (!currentMixin.properties) {
|
|
447
|
-
ret.push(currentMixin);
|
|
448
|
-
}
|
|
449
|
-
});
|
|
450
|
-
return ret;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
/**
|
|
454
|
-
@method reopen
|
|
455
|
-
@param arguments*
|
|
456
|
-
@private
|
|
457
|
-
@internal
|
|
458
|
-
*/
|
|
459
|
-
reopen(...args) {
|
|
460
|
-
if (args.length === 0) {
|
|
461
|
-
return this;
|
|
462
|
-
}
|
|
463
|
-
if (this.properties) {
|
|
464
|
-
let currentMixin = new Mixin(undefined, this.properties);
|
|
465
|
-
this.properties = undefined;
|
|
466
|
-
this.mixins = [currentMixin];
|
|
467
|
-
} else if (!this.mixins) {
|
|
468
|
-
this.mixins = [];
|
|
469
|
-
}
|
|
470
|
-
this.mixins = this.mixins.concat(buildMixinsArray(args));
|
|
471
|
-
return this;
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
/**
|
|
475
|
-
@method apply
|
|
476
|
-
@param obj
|
|
477
|
-
@return applied object
|
|
478
|
-
@private
|
|
479
|
-
@internal
|
|
480
|
-
*/
|
|
481
|
-
apply(obj, _hideKeys = false) {
|
|
482
|
-
// Ember.NativeArray is a normal Ember.Mixin that we mix into `Array.prototype` when prototype extensions are enabled
|
|
483
|
-
// mutating a native object prototype like this should _not_ result in enumerable properties being added (or we have significant
|
|
484
|
-
// issues with things like deep equality checks from test frameworks, or things like jQuery.extend(true, [], [])).
|
|
485
|
-
//
|
|
486
|
-
// _hideKeys disables enumerablity when applying the mixin. This is a hack, and we should stop mutating the array prototype by default 😫
|
|
487
|
-
return applyMixin(obj, [this], _hideKeys);
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
/** @internal */
|
|
491
|
-
applyPartial(obj) {
|
|
492
|
-
return applyMixin(obj, [this]);
|
|
493
|
-
}
|
|
494
|
-
|
|
495
|
-
/**
|
|
496
|
-
@method detect
|
|
497
|
-
@param obj
|
|
498
|
-
@return {Boolean}
|
|
499
|
-
@private
|
|
500
|
-
@internal
|
|
501
|
-
*/
|
|
502
|
-
detect(obj) {
|
|
503
|
-
if (typeof obj !== 'object' || obj === null) {
|
|
504
|
-
return false;
|
|
505
|
-
}
|
|
506
|
-
if (MIXINS.has(obj)) {
|
|
507
|
-
return _detect(obj, this);
|
|
508
|
-
}
|
|
509
|
-
let meta = peekMeta(obj);
|
|
510
|
-
if (meta === null) {
|
|
511
|
-
return false;
|
|
512
|
-
}
|
|
513
|
-
return meta.hasMixin(this);
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
/** @internal */
|
|
517
|
-
without(...args) {
|
|
518
|
-
let ret = new Mixin([this]);
|
|
519
|
-
ret._without = args;
|
|
520
|
-
return ret;
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
/** @internal */
|
|
524
|
-
keys() {
|
|
525
|
-
let keys = _keys(this);
|
|
526
|
-
(!(keys) && assert('[BUG] Missing keys for mixin!', keys));
|
|
527
|
-
return keys;
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
/** @internal */
|
|
531
|
-
toString() {
|
|
532
|
-
return '(unknown mixin)';
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
{
|
|
536
|
-
Object.defineProperty(Mixin, '_disableDebugSeal', {
|
|
537
|
-
configurable: true,
|
|
538
|
-
enumerable: false,
|
|
539
|
-
writable: true,
|
|
540
|
-
value: false
|
|
541
|
-
});
|
|
542
|
-
}
|
|
543
|
-
function buildMixinsArray(mixins) {
|
|
544
|
-
let length = mixins && mixins.length || 0;
|
|
545
|
-
let m = undefined;
|
|
546
|
-
if (length > 0) {
|
|
547
|
-
m = new Array(length);
|
|
548
|
-
for (let i = 0; i < length; i++) {
|
|
549
|
-
let x = mixins[i];
|
|
550
|
-
(!(typeof x === 'object' && x !== null && Object.prototype.toString.call(x) !== '[object Array]') && assert(`Expected hash or Mixin instance, got ${Object.prototype.toString.call(x)}`, typeof x === 'object' && x !== null && Object.prototype.toString.call(x) !== '[object Array]'));
|
|
551
|
-
if (MIXINS.has(x)) {
|
|
552
|
-
m[i] = x;
|
|
553
|
-
} else {
|
|
554
|
-
m[i] = new Mixin(undefined, x);
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
return m;
|
|
559
|
-
}
|
|
560
|
-
{
|
|
561
|
-
Object.seal(Mixin.prototype);
|
|
562
|
-
}
|
|
563
|
-
function _detect(curMixin, targetMixin, seen = new Set()) {
|
|
564
|
-
if (seen.has(curMixin)) {
|
|
565
|
-
return false;
|
|
566
|
-
}
|
|
567
|
-
seen.add(curMixin);
|
|
568
|
-
if (curMixin === targetMixin) {
|
|
569
|
-
return true;
|
|
570
|
-
}
|
|
571
|
-
let mixins = curMixin.mixins;
|
|
572
|
-
if (mixins) {
|
|
573
|
-
return mixins.some(mixin => _detect(mixin, targetMixin, seen));
|
|
574
|
-
}
|
|
575
|
-
return false;
|
|
576
|
-
}
|
|
577
|
-
function _keys(mixin, ret = new Set(), seen = new Set()) {
|
|
578
|
-
if (seen.has(mixin)) {
|
|
579
|
-
return;
|
|
580
|
-
}
|
|
581
|
-
seen.add(mixin);
|
|
582
|
-
if (mixin.properties) {
|
|
583
|
-
let props = Object.keys(mixin.properties);
|
|
584
|
-
for (let prop of props) {
|
|
585
|
-
ret.add(prop);
|
|
586
|
-
}
|
|
587
|
-
} else if (mixin.mixins) {
|
|
588
|
-
mixin.mixins.forEach(x => _keys(x, ret, seen));
|
|
589
|
-
}
|
|
590
|
-
return ret;
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
export { applyMixin, Mixin as default, mixin };
|
|
6
|
+
import '../../shared-chunks/decorator-B5Uh5NFI.js';
|
|
7
|
+
import '../../shared-chunks/computed-CXIM4Sjc.js';
|
|
8
|
+
import '../../shared-chunks/namespace_search-TFdmjK_a.js';
|
|
9
|
+
import '../../shared-chunks/observers-BsxKjjpC.js';
|
|
10
|
+
import '../../shared-chunks/events-e_Do73jh.js';
|
|
11
|
+
import '../-internals/deprecations/index.js';
|
|
12
|
+
import '../debug/lib/assert.js';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { peekMeta } from '../-internals/meta/lib/meta.js';
|
|
2
|
-
import { h as hasListeners } from '../../shared-chunks/events-
|
|
3
|
-
import { n as notifyPropertyChange, a as endPropertyChanges, b as beginPropertyChanges } from '../../shared-chunks/computed-
|
|
4
|
-
import { r as removeObserver, b as addObserver } from '../../shared-chunks/observers-
|
|
2
|
+
import { h as hasListeners } from '../../shared-chunks/events-e_Do73jh.js';
|
|
3
|
+
import { n as notifyPropertyChange, a as endPropertyChanges, b as beginPropertyChanges } from '../../shared-chunks/computed-CXIM4Sjc.js';
|
|
4
|
+
import { r as removeObserver, b as addObserver } from '../../shared-chunks/observers-BsxKjjpC.js';
|
|
5
5
|
import { g as get } from '../../shared-chunks/property_get-DXwpgTe7.js';
|
|
6
|
-
import { s as set } from '../../shared-chunks/property_set-
|
|
6
|
+
import { s as set } from '../../shared-chunks/property_set-CxxTalOq.js';
|
|
7
7
|
import { g as getProperties } from '../../shared-chunks/get_properties-BlyZny5J.js';
|
|
8
|
-
import { s as setProperties } from '../../shared-chunks/set_properties-
|
|
9
|
-
import Mixin from '
|
|
8
|
+
import { s as setProperties } from '../../shared-chunks/set_properties-KoN0q2wj.js';
|
|
9
|
+
import { M as Mixin, I as INTERNAL_MIXIN_CREATE } from '../../shared-chunks/mixin-M88Ghbyw.js';
|
|
10
10
|
import '../debug/index.js';
|
|
11
11
|
import { assert } from '../debug/lib/assert.js';
|
|
12
12
|
|
|
@@ -86,7 +86,7 @@ import { assert } from '../debug/lib/assert.js';
|
|
|
86
86
|
@public
|
|
87
87
|
*/
|
|
88
88
|
|
|
89
|
-
const Observable = Mixin
|
|
89
|
+
const Observable = Mixin[INTERNAL_MIXIN_CREATE]({
|
|
90
90
|
get(keyName) {
|
|
91
91
|
return get(this, keyName);
|
|
92
92
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { b as addObserver, r as removeObserver } from '../../shared-chunks/observers-
|
|
1
|
+
export { b as addObserver, r as removeObserver } from '../../shared-chunks/observers-BsxKjjpC.js';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { g as get } from '../../shared-chunks/property_get-DXwpgTe7.js';
|
|
2
|
-
import { s as setProperties } from '../../shared-chunks/set_properties-
|
|
3
|
-
import { c as computed } from '../../shared-chunks/computed-
|
|
4
|
-
import Mixin from '
|
|
2
|
+
import { s as setProperties } from '../../shared-chunks/set_properties-KoN0q2wj.js';
|
|
3
|
+
import { c as computed } from '../../shared-chunks/computed-CXIM4Sjc.js';
|
|
4
|
+
import { M as Mixin, I as INTERNAL_MIXIN_CREATE } from '../../shared-chunks/mixin-M88Ghbyw.js';
|
|
5
|
+
import { deprecateUntil, DEPRECATIONS } from '../-internals/deprecations/index.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
@module @ember/object/promise-proxy-mixin
|
|
@@ -93,9 +94,14 @@ function tap(proxy, promise) {
|
|
|
93
94
|
|
|
94
95
|
@class PromiseProxyMixin
|
|
95
96
|
@public
|
|
97
|
+
@deprecated Use native `async`/`await` and promises directly instead.
|
|
96
98
|
*/
|
|
97
99
|
|
|
98
|
-
const PromiseProxyMixin = Mixin
|
|
100
|
+
const PromiseProxyMixin = Mixin[INTERNAL_MIXIN_CREATE]({
|
|
101
|
+
init() {
|
|
102
|
+
this._super(...arguments);
|
|
103
|
+
deprecateUntil('`PromiseProxyMixin` is deprecated. Use native `async`/`await` and promises directly, tracking the loading state on your own class instead.', DEPRECATIONS.DEPRECATE_PROMISE_PROXY_MIXIN);
|
|
104
|
+
},
|
|
99
105
|
reason: null,
|
|
100
106
|
isPending: computed('isSettled', function () {
|
|
101
107
|
return !get(this, 'isSettled');
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FrameworkObject } from './-internals.js';
|
|
2
2
|
import ProxyMixin from '../-internals/runtime/lib/mixins/-proxy.js';
|
|
3
|
+
import { deprecateUntil, DEPRECATIONS } from '../-internals/deprecations/index.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
@module @ember/object/proxy
|
|
@@ -82,10 +83,16 @@ import ProxyMixin from '../-internals/runtime/lib/mixins/-proxy.js';
|
|
|
82
83
|
@extends EmberObject
|
|
83
84
|
@uses Ember.ProxyMixin
|
|
84
85
|
@public
|
|
86
|
+
@deprecated Use tracked properties or a native `Proxy` instead.
|
|
85
87
|
*/
|
|
86
88
|
|
|
87
89
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
88
|
-
class ObjectProxy extends FrameworkObject {
|
|
90
|
+
class ObjectProxy extends FrameworkObject {
|
|
91
|
+
init(properties) {
|
|
92
|
+
super.init(properties);
|
|
93
|
+
deprecateUntil('`ObjectProxy` is deprecated. Use tracked properties or a native `Proxy` instead.', DEPRECATIONS.DEPRECATE_OBJECT_PROXY);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
89
96
|
ObjectProxy.PrototypeMixin.reopen(ProxyMixin);
|
|
90
97
|
|
|
91
98
|
export { ObjectProxy as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { r as renderComponent, a as renderSettled } from '../../shared-chunks/index-
|
|
1
|
+
export { r as renderComponent, a as renderSettled } from '../../shared-chunks/index-D8La4_AP.js';
|