ember-source 4.1.0-alpha.6 → 4.1.0
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 +80 -63
- package/blueprints/acceptance-test/qunit-files/tests/acceptance/__name__-test.js +1 -1
- package/blueprints/acceptance-test/qunit-rfc-232-files/tests/acceptance/__name__-test.js +1 -1
- package/blueprints/component-test/qunit-files/__root__/__testType__/__path__/__test__.js +3 -3
- package/blueprints/helper-test/index.js +4 -22
- package/blueprints/helper-test/mocha-0.12-files/__root__/__testType__/__collection__/__name__-test.js +1 -13
- package/blueprints/helper-test/mocha-files/__root__/__testType__/__collection__/__name__-test.js +0 -13
- package/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +2 -12
- package/blueprints/helper-test/qunit-files/__root__/__testType__/__collection__/__name__-test.js +2 -13
- package/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +2 -14
- package/build-metadata.json +3 -3
- package/dist/dependencies/@glimmer/manager.js +19 -98
- package/dist/dependencies/@glimmer/opcode-compiler.js +9 -146
- package/dist/dependencies/@glimmer/runtime.js +1 -55
- package/dist/dependencies/@glimmer/validator.js +19 -51
- package/dist/ember-template-compiler.js +368 -693
- 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 +3261 -6351
- package/dist/ember.debug.map +1 -1
- package/dist/header/license.js +1 -1
- package/dist/packages/@ember/-internals/environment/index.js +0 -15
- package/dist/packages/@ember/-internals/glimmer/index.js +4815 -6763
- package/dist/packages/@ember/-internals/metal/index.js +57 -103
- package/dist/packages/@ember/-internals/routing/lib/location/api.js +10 -1
- package/dist/packages/@ember/-internals/routing/lib/location/none_location.js +7 -2
- package/dist/packages/@ember/-internals/routing/lib/services/router.js +1 -1
- package/dist/packages/@ember/-internals/routing/lib/services/routing.js +1 -1
- package/dist/packages/@ember/-internals/routing/lib/system/route.js +3 -42
- package/dist/packages/@ember/-internals/routing/lib/system/router.js +36 -46
- package/dist/packages/@ember/-internals/runtime/lib/mixins/array.js +2 -173
- package/dist/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +3 -43
- package/dist/packages/@ember/-internals/runtime/lib/system/array_proxy.js +8 -15
- package/dist/packages/@ember/-internals/utils/index.js +0 -3
- package/dist/packages/@ember/-internals/views/index.js +0 -1
- package/dist/packages/@ember/-internals/views/lib/mixins/view_support.js +4 -4
- package/dist/packages/@ember/application/lib/application.js +7 -8
- package/dist/packages/@ember/canary-features/index.js +4 -6
- package/dist/packages/@ember/component/index.js +1 -1
- package/dist/packages/@ember/deprecated-features/index.js +0 -1
- package/dist/packages/@ember/destroyable/index.js +15 -4
- package/dist/packages/@ember/engine/index.js +1 -2
- package/dist/packages/@ember/routing/index.js +1 -1
- package/dist/packages/@glimmer/tracking/index.js +203 -1
- package/dist/packages/ember/index.js +9 -61
- package/dist/packages/ember/version.js +1 -1
- package/docs/data.json +430 -1382
- package/lib/browsers.js +50 -0
- package/lib/index.js +7 -29
- package/package.json +19 -22
- package/dist/packages/@ember/-internals/views/lib/mixins/text_support.js +0 -345
- package/dist/packages/@ember/component/checkbox.js +0 -17
- package/dist/packages/@ember/component/text-area.js +0 -17
- package/dist/packages/@ember/component/text-field.js +0 -17
- package/dist/packages/@ember/routing/link-component.js +0 -17
package/lib/browsers.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
module.exports = [
|
|
2
|
+
'Chrome >= 92',
|
|
3
|
+
'Edge >= 93',
|
|
4
|
+
'Firefox >= 91',
|
|
5
|
+
'iOS >= 12',
|
|
6
|
+
'Safari >= 12',
|
|
7
|
+
'ChromeAndroid >= 96',
|
|
8
|
+
'FirefoxAndroid >= 94',
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
As of the release of 4.0.0, the above query expands to:
|
|
13
|
+
|
|
14
|
+
and_chr 96
|
|
15
|
+
and_ff 94
|
|
16
|
+
chrome 96
|
|
17
|
+
chrome 95
|
|
18
|
+
chrome 94
|
|
19
|
+
chrome 93
|
|
20
|
+
chrome 92
|
|
21
|
+
chrome 91
|
|
22
|
+
chrome 87
|
|
23
|
+
edge 96
|
|
24
|
+
edge 95
|
|
25
|
+
firefox 95
|
|
26
|
+
firefox 94
|
|
27
|
+
firefox 93
|
|
28
|
+
firefox 60
|
|
29
|
+
firefox 52
|
|
30
|
+
ios_saf 15.2
|
|
31
|
+
ios_saf 15.0-15.1
|
|
32
|
+
ios_saf 14.5-14.8
|
|
33
|
+
ios_saf 14.0-14.4
|
|
34
|
+
ios_saf 13.4-13.7
|
|
35
|
+
ios_saf 13.3
|
|
36
|
+
ios_saf 13.2
|
|
37
|
+
ios_saf 13.0-13.1
|
|
38
|
+
ios_saf 12.2-12.5
|
|
39
|
+
ios_saf 12.0-12.1
|
|
40
|
+
safari 15.2
|
|
41
|
+
safari 15.1
|
|
42
|
+
safari 15
|
|
43
|
+
safari 14.1
|
|
44
|
+
safari 14
|
|
45
|
+
safari 13.1
|
|
46
|
+
safari 13
|
|
47
|
+
safari 12.1
|
|
48
|
+
safari 12
|
|
49
|
+
|
|
50
|
+
*/
|
package/lib/index.js
CHANGED
|
@@ -10,6 +10,8 @@ const injectBabelHelpers = require('./transforms/inject-babel-helpers').injectBa
|
|
|
10
10
|
const debugTree = require('broccoli-debug').buildDebugCallback('ember-source:addon');
|
|
11
11
|
const vmBabelPlugins = require('@glimmer/vm-babel-plugins');
|
|
12
12
|
const Overrides = require('./overrides');
|
|
13
|
+
const SilentError = require('silent-error');
|
|
14
|
+
const SupportedBrowsers = require('./browsers');
|
|
13
15
|
|
|
14
16
|
const PRE_BUILT_TARGETS = [
|
|
15
17
|
'last 1 Chrome versions',
|
|
@@ -43,13 +45,6 @@ module.exports = {
|
|
|
43
45
|
init() {
|
|
44
46
|
this._super.init && this._super.init.apply(this, arguments);
|
|
45
47
|
|
|
46
|
-
if ('ember' in this.project.bowerDependencies()) {
|
|
47
|
-
// TODO: move this to a throw soon.
|
|
48
|
-
this.ui.writeWarnLine(
|
|
49
|
-
'Ember.js is now provided by node_module `ember-source`, please remove it from bower'
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
48
|
// resets `this.root` to the correct location by default ember-cli
|
|
54
49
|
// considers `__dirname` here to be the root, but since our main entry
|
|
55
50
|
// point is within a subfolder we need to correct that
|
|
@@ -65,6 +60,9 @@ module.exports = {
|
|
|
65
60
|
absolutePaths,
|
|
66
61
|
_overrideTree: undefined,
|
|
67
62
|
|
|
63
|
+
// Expose supported list of browsers for reference by other packages
|
|
64
|
+
supportedBrowsers: SupportedBrowsers,
|
|
65
|
+
|
|
68
66
|
included() {
|
|
69
67
|
this._super.included.apply(this, arguments);
|
|
70
68
|
|
|
@@ -115,31 +113,12 @@ module.exports = {
|
|
|
115
113
|
`You have configured your application to indicate that it is using the 'octane' edition (via \`setEdition('octane')\`), but the appropriate Octane features were not enabled:\n`
|
|
116
114
|
);
|
|
117
115
|
|
|
118
|
-
const SilentError = require('silent-error');
|
|
119
116
|
throw new SilentError(message.join('\n\t'));
|
|
120
117
|
}
|
|
121
118
|
} else {
|
|
122
|
-
|
|
123
|
-
'The Ember Classic edition has been
|
|
119
|
+
throw new SilentError(
|
|
120
|
+
'The Ember Classic edition has been removed. Specifying "classic" in your package.json, or not specifying a value at all, is no longer supported. You must explicitly set the "ember.edition" property to "octane". You can also run `npx @ember/octanify` to do this. \n\nFor more information, see the deprecation guide: https://deprecations.emberjs.com/v3.x/#toc_editions-classic'
|
|
124
121
|
);
|
|
125
|
-
|
|
126
|
-
if (
|
|
127
|
-
optionalFeaturesMissing ||
|
|
128
|
-
optionalFeatures.isFeatureEnabled('application-template-wrapper')
|
|
129
|
-
) {
|
|
130
|
-
this.ui.writeWarnLine(
|
|
131
|
-
'Setting the `application-template-wrapper` optional feature flag to `true`, or not providing a setting at all, has been deprecated. You must add the `@ember/optional-features` addon and set this feature to `false`. You can also run `npx @ember/octanify` to do this. This warning will become an error in Ember 4.0.0.\n\nFor more information, see the deprecation guide: https://deprecations.emberjs.com/v3.x/#toc_optional-feature-application-template-wrapper'
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (
|
|
136
|
-
optionalFeaturesMissing ||
|
|
137
|
-
!optionalFeatures.isFeatureEnabled('template-only-glimmer-components')
|
|
138
|
-
) {
|
|
139
|
-
this.ui.writeWarnLine(
|
|
140
|
-
'Setting the `template-only-glimmer-components` optional feature flag to `false`, or not providing a setting at all, has been deprecated. You must add the `@ember/optional-features` addon and set this feature to `true`. You can also run `npx @ember/octanify` to do this. This warning will become an error in Ember 4.0.0.\n\nFor more information, see the deprecation guide: https://deprecations.emberjs.com/v3.x/#toc_optional-feature-template-only-glimmer-components'
|
|
141
|
-
);
|
|
142
|
-
}
|
|
143
122
|
}
|
|
144
123
|
|
|
145
124
|
if (
|
|
@@ -148,7 +127,6 @@ module.exports = {
|
|
|
148
127
|
typeof optionalFeatures.isFeatureExplicitlySet === 'function' &&
|
|
149
128
|
optionalFeatures.isFeatureExplicitlySet('jquery-integration')
|
|
150
129
|
) {
|
|
151
|
-
const SilentError = require('silent-error');
|
|
152
130
|
throw new SilentError(
|
|
153
131
|
'Setting the `jquery-integration` optional feature flag to `true` was deprecated in Ember 3.x and removed in Ember 4.0.0. You must add the `@ember/optional-features` addon and set this feature to `false`.\n\nFor more information, see the deprecation guide: https://deprecations.emberjs.com/v3.x/#toc_optional-feature-jquery-integration'
|
|
154
132
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-source",
|
|
3
|
-
"version": "4.1.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "A JavaScript framework for creating ambitious web applications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@babel/helper-module-imports": "^7.16.0",
|
|
51
51
|
"@babel/plugin-transform-block-scoping": "^7.16.0",
|
|
52
52
|
"@ember/edition-utils": "^1.2.0",
|
|
53
|
-
"@glimmer/vm-babel-plugins": "0.
|
|
53
|
+
"@glimmer/vm-babel-plugins": "0.83.1",
|
|
54
54
|
"babel-plugin-debug-macros": "^0.3.4",
|
|
55
55
|
"babel-plugin-filter-imports": "^4.0.0",
|
|
56
56
|
"broccoli-concat": "^4.2.5",
|
|
@@ -75,26 +75,26 @@
|
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@babel/preset-env": "^7.9.5",
|
|
78
|
-
"@glimmer/compiler": "0.
|
|
79
|
-
"@glimmer/destroyable": "0.
|
|
78
|
+
"@glimmer/compiler": "0.83.1",
|
|
79
|
+
"@glimmer/destroyable": "0.83.1",
|
|
80
80
|
"@glimmer/env": "^0.1.7",
|
|
81
|
-
"@glimmer/global-context": "0.
|
|
82
|
-
"@glimmer/interfaces": "0.
|
|
83
|
-
"@glimmer/manager": "0.
|
|
84
|
-
"@glimmer/node": "0.
|
|
85
|
-
"@glimmer/opcode-compiler": "0.
|
|
86
|
-
"@glimmer/owner": "0.
|
|
87
|
-
"@glimmer/program": "0.
|
|
88
|
-
"@glimmer/reference": "0.
|
|
89
|
-
"@glimmer/runtime": "0.
|
|
90
|
-
"@glimmer/validator": "0.
|
|
81
|
+
"@glimmer/global-context": "0.83.1",
|
|
82
|
+
"@glimmer/interfaces": "0.83.1",
|
|
83
|
+
"@glimmer/manager": "0.83.1",
|
|
84
|
+
"@glimmer/node": "0.83.1",
|
|
85
|
+
"@glimmer/opcode-compiler": "0.83.1",
|
|
86
|
+
"@glimmer/owner": "0.83.1",
|
|
87
|
+
"@glimmer/program": "0.83.1",
|
|
88
|
+
"@glimmer/reference": "0.83.1",
|
|
89
|
+
"@glimmer/runtime": "0.83.1",
|
|
90
|
+
"@glimmer/validator": "0.83.1",
|
|
91
91
|
"@simple-dom/document": "^1.4.0",
|
|
92
92
|
"@types/qunit": "^2.11.1",
|
|
93
93
|
"@types/rsvp": "^4.0.4",
|
|
94
94
|
"@typescript-eslint/eslint-plugin": "^4.3.0",
|
|
95
95
|
"@typescript-eslint/parser": "^4.3.0",
|
|
96
96
|
"auto-dist-tag": "^1.0.0",
|
|
97
|
-
"aws-sdk": "^2.
|
|
97
|
+
"aws-sdk": "^2.814.0",
|
|
98
98
|
"babel-template": "^6.26.0",
|
|
99
99
|
"backburner.js": "^2.7.0",
|
|
100
100
|
"broccoli-babel-transpiler": "^7.8.0",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"eslint-import-resolver-node": "^0.3.3",
|
|
120
120
|
"eslint-plugin-disable-features": "^0.1.3",
|
|
121
121
|
"eslint-plugin-ember-internal": "^2.0.0",
|
|
122
|
-
"eslint-plugin-import": "^2.
|
|
122
|
+
"eslint-plugin-import": "^2.25.3",
|
|
123
123
|
"eslint-plugin-node": "^11.1.0",
|
|
124
124
|
"eslint-plugin-prettier": "^3.4.1",
|
|
125
125
|
"eslint-plugin-qunit": "^6.2.0",
|
|
@@ -156,9 +156,6 @@
|
|
|
156
156
|
"ember-addon": {
|
|
157
157
|
"after": "ember-cli-legacy-blueprints"
|
|
158
158
|
},
|
|
159
|
-
"_originalVersion": "4.1.0
|
|
160
|
-
"_versionPreviouslyCalculated": true
|
|
161
|
-
|
|
162
|
-
"tag": "alpha"
|
|
163
|
-
}
|
|
164
|
-
}
|
|
159
|
+
"_originalVersion": "4.1.0",
|
|
160
|
+
"_versionPreviouslyCalculated": true
|
|
161
|
+
}
|
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
@module ember
|
|
3
|
-
*/
|
|
4
|
-
import { get, set, Mixin } from '@ember/-internals/metal';
|
|
5
|
-
import { deprecate } from '@ember/debug';
|
|
6
|
-
import { MUTABLE_CELL } from '@ember/-internals/views';
|
|
7
|
-
import { DEBUG } from '@glimmer/env';
|
|
8
|
-
|
|
9
|
-
if (DEBUG && true
|
|
10
|
-
/* EMBER_MODERNIZED_BUILT_IN_COMPONENTS */
|
|
11
|
-
) {
|
|
12
|
-
Mixin._disableDebugSeal = true;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const KEY_EVENTS = {
|
|
16
|
-
Enter: 'insertNewline',
|
|
17
|
-
Escape: 'cancel'
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
`TextSupport` is a shared mixin used by both `TextField` and
|
|
21
|
-
`TextArea`. `TextSupport` adds a number of methods that allow you to
|
|
22
|
-
specify a controller action to invoke when a certain event is fired on your
|
|
23
|
-
text field or textarea. The specified controller action would get the current
|
|
24
|
-
value of the field passed in as the only argument unless the value of
|
|
25
|
-
the field is empty. In that case, the instance of the field itself is passed
|
|
26
|
-
in as the only argument.
|
|
27
|
-
|
|
28
|
-
Let's use the pressing of the escape key as an example. If you wanted to
|
|
29
|
-
invoke a controller action when a user presses the escape key while on your
|
|
30
|
-
field, you would use the `escape-press` attribute on your field like so:
|
|
31
|
-
|
|
32
|
-
```handlebars
|
|
33
|
-
{{! application.hbs}}
|
|
34
|
-
|
|
35
|
-
{{input escape-press='alertUser'}}
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
```javascript
|
|
39
|
-
import Application from '@ember/application';
|
|
40
|
-
import Controller from '@ember/controller';
|
|
41
|
-
App = Application.create();
|
|
42
|
-
|
|
43
|
-
App.ApplicationController = Controller.extend({
|
|
44
|
-
actions: {
|
|
45
|
-
alertUser: function ( currentValue ) {
|
|
46
|
-
alert( 'escape pressed, current value: ' + currentValue );
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
The following chart is a visual representation of what takes place when the
|
|
53
|
-
escape key is pressed in this scenario:
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
The Template
|
|
57
|
-
+---------------------------+
|
|
58
|
-
| |
|
|
59
|
-
| escape-press='alertUser' |
|
|
60
|
-
| | TextSupport Mixin
|
|
61
|
-
+----+----------------------+ +-------------------------------+
|
|
62
|
-
| | cancel method |
|
|
63
|
-
| escape button pressed | |
|
|
64
|
-
+-------------------------------> | checks for the `escape-press` |
|
|
65
|
-
| attribute and pulls out the |
|
|
66
|
-
+-------------------------------+ | `alertUser` value |
|
|
67
|
-
| action name 'alertUser' +-------------------------------+
|
|
68
|
-
| sent to controller
|
|
69
|
-
v
|
|
70
|
-
Controller
|
|
71
|
-
+------------------------------------------ +
|
|
72
|
-
| |
|
|
73
|
-
| actions: { |
|
|
74
|
-
| alertUser: function( currentValue ){ |
|
|
75
|
-
| alert( 'the esc key was pressed!' ) |
|
|
76
|
-
| } |
|
|
77
|
-
| } |
|
|
78
|
-
| |
|
|
79
|
-
+-------------------------------------------+
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
Here are the events that we currently support along with the name of the
|
|
83
|
-
attribute you would need to use on your field. To reiterate, you would use the
|
|
84
|
-
attribute name like so:
|
|
85
|
-
|
|
86
|
-
```handlebars
|
|
87
|
-
{{input attribute-name='controllerAction'}}
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
```
|
|
91
|
-
+--------------------+----------------+
|
|
92
|
-
| | |
|
|
93
|
-
| event | attribute name |
|
|
94
|
-
+--------------------+----------------+
|
|
95
|
-
| new line inserted | insert-newline |
|
|
96
|
-
| | |
|
|
97
|
-
| enter key pressed | enter |
|
|
98
|
-
| | |
|
|
99
|
-
| cancel key pressed | escape-press |
|
|
100
|
-
| | |
|
|
101
|
-
| focusin | focus-in |
|
|
102
|
-
| | |
|
|
103
|
-
| focusout | focus-out |
|
|
104
|
-
| | |
|
|
105
|
-
| keypress | key-press |
|
|
106
|
-
| | |
|
|
107
|
-
| keyup | key-up |
|
|
108
|
-
| | |
|
|
109
|
-
| keydown | key-down |
|
|
110
|
-
+--------------------+----------------+
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
@class TextSupport
|
|
114
|
-
@namespace Ember
|
|
115
|
-
@uses Ember.TargetActionSupport
|
|
116
|
-
@extends Mixin
|
|
117
|
-
@private
|
|
118
|
-
*/
|
|
119
|
-
|
|
120
|
-
const TextSupport = Mixin.create({
|
|
121
|
-
value: '',
|
|
122
|
-
attributeBindings: ['autocapitalize', 'autocorrect', 'autofocus', 'disabled', 'form', 'maxlength', 'minlength', 'placeholder', 'readonly', 'required', 'selectionDirection', 'spellcheck', 'tabindex', 'title'],
|
|
123
|
-
placeholder: null,
|
|
124
|
-
disabled: false,
|
|
125
|
-
maxlength: null,
|
|
126
|
-
|
|
127
|
-
/**
|
|
128
|
-
Whether the `keyUp` event that triggers an `action` to be sent continues
|
|
129
|
-
propagating to other views.
|
|
130
|
-
By default, when the user presses the return key on their keyboard and
|
|
131
|
-
the text field has an `action` set, the action will be sent to the view's
|
|
132
|
-
controller and the key event will stop propagating.
|
|
133
|
-
If you would like parent views to receive the `keyUp` event even after an
|
|
134
|
-
action has been dispatched, set `bubbles` to true.
|
|
135
|
-
@property bubbles
|
|
136
|
-
@type Boolean
|
|
137
|
-
@default false
|
|
138
|
-
@private
|
|
139
|
-
*/
|
|
140
|
-
bubbles: false,
|
|
141
|
-
|
|
142
|
-
interpretKeyEvents(event) {
|
|
143
|
-
let method = KEY_EVENTS[event.key];
|
|
144
|
-
|
|
145
|
-
this._elementValueDidChange();
|
|
146
|
-
|
|
147
|
-
if (method) {
|
|
148
|
-
return this[method](event);
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
|
|
152
|
-
_elementValueDidChange() {
|
|
153
|
-
set(this, 'value', this.element.value);
|
|
154
|
-
},
|
|
155
|
-
|
|
156
|
-
change(event) {
|
|
157
|
-
this._elementValueDidChange(event);
|
|
158
|
-
},
|
|
159
|
-
|
|
160
|
-
paste(event) {
|
|
161
|
-
this._elementValueDidChange(event);
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
cut(event) {
|
|
165
|
-
this._elementValueDidChange(event);
|
|
166
|
-
},
|
|
167
|
-
|
|
168
|
-
input(event) {
|
|
169
|
-
this._elementValueDidChange(event);
|
|
170
|
-
},
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
Allows you to specify a controller action to invoke when either the `enter`
|
|
174
|
-
key is pressed or, in the case of the field being a textarea, when a newline
|
|
175
|
-
is inserted. To use this method, give your field an `insert-newline`
|
|
176
|
-
attribute. The value of that attribute should be the name of the action
|
|
177
|
-
in your controller that you wish to invoke.
|
|
178
|
-
For an example on how to use the `insert-newline` attribute, please
|
|
179
|
-
reference the example near the top of this file.
|
|
180
|
-
@method insertNewline
|
|
181
|
-
@param {Event} event
|
|
182
|
-
@private
|
|
183
|
-
*/
|
|
184
|
-
insertNewline(event) {
|
|
185
|
-
sendAction('enter', this, event);
|
|
186
|
-
sendAction('insert-newline', this, event);
|
|
187
|
-
},
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
Allows you to specify a controller action to invoke when the escape button
|
|
191
|
-
is pressed. To use this method, give your field an `escape-press`
|
|
192
|
-
attribute. The value of that attribute should be the name of the action
|
|
193
|
-
in your controller that you wish to invoke.
|
|
194
|
-
For an example on how to use the `escape-press` attribute, please reference
|
|
195
|
-
the example near the top of this file.
|
|
196
|
-
@method cancel
|
|
197
|
-
@param {Event} event
|
|
198
|
-
@private
|
|
199
|
-
*/
|
|
200
|
-
cancel(event) {
|
|
201
|
-
sendAction('escape-press', this, event);
|
|
202
|
-
},
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
Allows you to specify a controller action to invoke when a field receives
|
|
206
|
-
focus. To use this method, give your field a `focus-in` attribute. The value
|
|
207
|
-
of that attribute should be the name of the action in your controller
|
|
208
|
-
that you wish to invoke.
|
|
209
|
-
For an example on how to use the `focus-in` attribute, please reference the
|
|
210
|
-
example near the top of this file.
|
|
211
|
-
@method focusIn
|
|
212
|
-
@param {Event} event
|
|
213
|
-
@private
|
|
214
|
-
*/
|
|
215
|
-
focusIn(event) {
|
|
216
|
-
sendAction('focus-in', this, event);
|
|
217
|
-
},
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
Allows you to specify a controller action to invoke when a field loses
|
|
221
|
-
focus. To use this method, give your field a `focus-out` attribute. The value
|
|
222
|
-
of that attribute should be the name of the action in your controller
|
|
223
|
-
that you wish to invoke.
|
|
224
|
-
For an example on how to use the `focus-out` attribute, please reference the
|
|
225
|
-
example near the top of this file.
|
|
226
|
-
@method focusOut
|
|
227
|
-
@param {Event} event
|
|
228
|
-
@private
|
|
229
|
-
*/
|
|
230
|
-
focusOut(event) {
|
|
231
|
-
this._elementValueDidChange(event);
|
|
232
|
-
|
|
233
|
-
sendAction('focus-out', this, event);
|
|
234
|
-
},
|
|
235
|
-
|
|
236
|
-
/**
|
|
237
|
-
Allows you to specify a controller action to invoke when a key is pressed.
|
|
238
|
-
To use this method, give your field a `key-press` attribute. The value of
|
|
239
|
-
that attribute should be the name of the action in your controller you
|
|
240
|
-
that wish to invoke.
|
|
241
|
-
For an example on how to use the `key-press` attribute, please reference the
|
|
242
|
-
example near the top of this file.
|
|
243
|
-
@method keyPress
|
|
244
|
-
@param {Event} event
|
|
245
|
-
@private
|
|
246
|
-
*/
|
|
247
|
-
keyPress(event) {
|
|
248
|
-
sendAction('key-press', this, event);
|
|
249
|
-
},
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
Allows you to specify a controller action to invoke when a key-up event is
|
|
253
|
-
fired. To use this method, give your field a `key-up` attribute. The value
|
|
254
|
-
of that attribute should be the name of the action in your controller
|
|
255
|
-
that you wish to invoke.
|
|
256
|
-
For an example on how to use the `key-up` attribute, please reference the
|
|
257
|
-
example near the top of this file.
|
|
258
|
-
@method keyUp
|
|
259
|
-
@param {Event} event
|
|
260
|
-
@private
|
|
261
|
-
*/
|
|
262
|
-
keyUp(event) {
|
|
263
|
-
this.interpretKeyEvents(event);
|
|
264
|
-
sendAction('key-up', this, event);
|
|
265
|
-
},
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
Allows you to specify a controller action to invoke when a key-down event is
|
|
269
|
-
fired. To use this method, give your field a `key-down` attribute. The value
|
|
270
|
-
of that attribute should be the name of the action in your controller that
|
|
271
|
-
you wish to invoke.
|
|
272
|
-
For an example on how to use the `key-down` attribute, please reference the
|
|
273
|
-
example near the top of this file.
|
|
274
|
-
@method keyDown
|
|
275
|
-
@param {Event} event
|
|
276
|
-
@private
|
|
277
|
-
*/
|
|
278
|
-
keyDown(event) {
|
|
279
|
-
sendAction('key-down', this, event);
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
}); // In principle, this shouldn't be necessary, but the legacy
|
|
283
|
-
// sendAction semantics for TextField are different from
|
|
284
|
-
// the component semantics so this method normalizes them.
|
|
285
|
-
|
|
286
|
-
function sendAction(eventName, view, event) {
|
|
287
|
-
let action = get(view, `attrs.${eventName}`);
|
|
288
|
-
|
|
289
|
-
if (action !== null && typeof action === 'object' && action[MUTABLE_CELL] === true) {
|
|
290
|
-
action = action.value;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
if (action === undefined) {
|
|
294
|
-
action = get(view, eventName);
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
let value = get(view, 'value');
|
|
298
|
-
|
|
299
|
-
if (typeof action === 'function') {
|
|
300
|
-
action(value, event);
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
if (action && !get(view, 'bubbles')) {
|
|
304
|
-
event.stopPropagation();
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
if (true
|
|
309
|
-
/* EMBER_MODERNIZED_BUILT_IN_COMPONENTS */
|
|
310
|
-
) {
|
|
311
|
-
Object.defineProperty(TextSupport, '_wasReopened', {
|
|
312
|
-
configurable: true,
|
|
313
|
-
enumerable: false,
|
|
314
|
-
writable: true,
|
|
315
|
-
value: false
|
|
316
|
-
});
|
|
317
|
-
Object.defineProperty(TextSupport, 'reopen', {
|
|
318
|
-
configurable: true,
|
|
319
|
-
enumerable: false,
|
|
320
|
-
writable: true,
|
|
321
|
-
value: function reopen(...args) {
|
|
322
|
-
if (this === TextSupport) {
|
|
323
|
-
deprecate('Reopening Ember.TextSupport is deprecated.', false, {
|
|
324
|
-
id: 'ember.built-in-components.reopen',
|
|
325
|
-
for: 'ember-source',
|
|
326
|
-
since: {
|
|
327
|
-
enabled: '3.27.0'
|
|
328
|
-
},
|
|
329
|
-
until: '4.0.0',
|
|
330
|
-
url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-reopen'
|
|
331
|
-
});
|
|
332
|
-
TextSupport._wasReopened = true;
|
|
333
|
-
}
|
|
334
|
-
|
|
335
|
-
return Mixin.prototype.reopen.call(this, ...args);
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
|
|
339
|
-
if (DEBUG) {
|
|
340
|
-
Object.seal(TextSupport);
|
|
341
|
-
Mixin._disableDebugSeal = false;
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
export default TextSupport;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { deprecate } from '@ember/debug';
|
|
2
|
-
|
|
3
|
-
if (true
|
|
4
|
-
/* EMBER_MODERNIZED_BUILT_IN_COMPONENTS */
|
|
5
|
-
) {
|
|
6
|
-
deprecate(`Using Ember.Checkbox or importing from 'Checkbox' has been deprecated, install the ` + `\`@ember/legacy-built-in-components\` addon and use \`import { Checkbox } from ` + `'@ember/legacy-built-in-components';\` instead`, false, {
|
|
7
|
-
id: 'ember.built-in-components.import',
|
|
8
|
-
until: '4.0.0',
|
|
9
|
-
for: 'ember-source',
|
|
10
|
-
since: {
|
|
11
|
-
enabled: '3.27.0'
|
|
12
|
-
},
|
|
13
|
-
url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-import'
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export { Checkbox as default } from '@ember/-internals/glimmer';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { deprecate } from '@ember/debug';
|
|
2
|
-
|
|
3
|
-
if (true
|
|
4
|
-
/* EMBER_MODERNIZED_BUILT_IN_COMPONENTS */
|
|
5
|
-
) {
|
|
6
|
-
deprecate(`Using Ember.TextArea or importing from 'TextArea' has been deprecated, install the ` + `\`@ember/legacy-built-in-components\` addon and use \`import { TextArea } from ` + `'@ember/legacy-built-in-components';\` instead`, false, {
|
|
7
|
-
id: 'ember.built-in-components.import',
|
|
8
|
-
until: '4.0.0',
|
|
9
|
-
for: 'ember-source',
|
|
10
|
-
since: {
|
|
11
|
-
enabled: '3.27.0'
|
|
12
|
-
},
|
|
13
|
-
url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-import'
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export { TextArea as default } from '@ember/-internals/glimmer';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { deprecate } from '@ember/debug';
|
|
2
|
-
|
|
3
|
-
if (true
|
|
4
|
-
/* EMBER_MODERNIZED_BUILT_IN_COMPONENTS */
|
|
5
|
-
) {
|
|
6
|
-
deprecate(`Using Ember.TextField or importing from 'TextField' has been deprecated, install the ` + `\`@ember/legacy-built-in-components\` addon and use \`import { TextField } from ` + `'@ember/legacy-built-in-components';\` instead`, false, {
|
|
7
|
-
id: 'ember.built-in-components.import',
|
|
8
|
-
until: '4.0.0',
|
|
9
|
-
for: 'ember-source',
|
|
10
|
-
since: {
|
|
11
|
-
enabled: '3.27.0'
|
|
12
|
-
},
|
|
13
|
-
url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-import'
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export { TextField as default } from '@ember/-internals/glimmer';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { deprecate } from '@ember/debug';
|
|
2
|
-
|
|
3
|
-
if (true
|
|
4
|
-
/* EMBER_MODERNIZED_BUILT_IN_COMPONENTS */
|
|
5
|
-
) {
|
|
6
|
-
deprecate(`Using Ember.LinkComponent or importing from 'LinkComponent' has been deprecated, install the ` + `\`@ember/legacy-built-in-components\` addon and use \`import { LinkComponent } from ` + `'@ember/legacy-built-in-components';\` instead`, false, {
|
|
7
|
-
id: 'ember.built-in-components.import',
|
|
8
|
-
until: '4.0.0',
|
|
9
|
-
for: 'ember-source',
|
|
10
|
-
since: {
|
|
11
|
-
enabled: '3.27.0'
|
|
12
|
-
},
|
|
13
|
-
url: 'https://deprecations.emberjs.com/v3.x#toc_ember-built-in-components-import'
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export { LinkComponent as default } from '@ember/-internals/glimmer';
|