ember-source 4.0.0-beta.1 → 4.0.0-beta.10
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 +72 -0
- 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/blueprints/initializer/files/__root__/initializers/__name__.js +0 -1
- package/blueprints/instance-initializer/files/__root__/instance-initializers/__name__.js +0 -1
- 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 +383 -961
- package/dist/ember-template-compiler.map +1 -1
- package/dist/ember-testing.js +4 -513
- package/dist/ember-testing.map +1 -1
- package/dist/ember.debug.js +3246 -8084
- package/dist/ember.debug.map +1 -1
- package/dist/header/license.js +1 -1
- package/dist/packages/@ember/-internals/container/index.js +17 -183
- package/dist/packages/@ember/-internals/environment/index.js +0 -27
- package/dist/packages/@ember/-internals/extension-support/lib/container_debug_adapter.js +7 -0
- package/dist/packages/@ember/-internals/glimmer/index.js +4827 -6812
- package/dist/packages/@ember/-internals/metal/index.js +21 -45
- package/dist/packages/@ember/-internals/routing/lib/services/router.js +8 -0
- package/dist/packages/@ember/-internals/routing/lib/services/routing.js +1 -1
- package/dist/packages/@ember/-internals/routing/lib/system/route.js +1 -41
- package/dist/packages/@ember/-internals/routing/lib/system/router.js +22 -91
- 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/runtime/lib/system/core_object.js +4 -90
- package/dist/packages/@ember/-internals/utils/index.js +0 -3
- package/dist/packages/@ember/-internals/views/index.js +0 -2
- package/dist/packages/@ember/-internals/views/lib/mixins/view_support.js +4 -4
- package/dist/packages/@ember/-internals/views/lib/system/event_dispatcher.js +22 -72
- package/dist/packages/@ember/application/instance.js +1 -22
- package/dist/packages/@ember/application/lib/application.js +14 -32
- package/dist/packages/@ember/canary-features/index.js +0 -2
- package/dist/packages/@ember/component/index.js +1 -1
- package/dist/packages/@ember/deprecated-features/index.js +0 -4
- package/dist/packages/@ember/engine/index.js +2 -7
- package/dist/packages/@ember/engine/instance.js +0 -4
- package/dist/packages/@ember/object/lib/computed/computed_macros.js +0 -373
- package/dist/packages/@ember/object/lib/computed/reduce_computed_macros.js +0 -351
- package/dist/packages/@ember/routing/index.js +1 -1
- package/dist/packages/ember/index.js +9 -62
- package/dist/packages/ember/version.js +1 -1
- package/dist/packages/ember-testing/index.js +0 -2
- package/dist/packages/ember-testing/lib/helpers.js +0 -12
- package/dist/packages/ember-testing/lib/setup_for_testing.js +0 -10
- package/docs/data.json +598 -1901
- package/lib/index.js +13 -51
- package/package.json +18 -18
- package/dist/packages/@ember/-internals/views/lib/mixins/text_support.js +0 -345
- package/dist/packages/@ember/-internals/views/lib/system/jquery.js +0 -26
- 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/dist/packages/ember-testing/lib/events.js +0 -101
- package/dist/packages/ember-testing/lib/helpers/-is-form-control.js +0 -19
- package/dist/packages/ember-testing/lib/helpers/click.js +0 -32
- package/dist/packages/ember-testing/lib/helpers/fill_in.js +0 -47
- package/dist/packages/ember-testing/lib/helpers/find.js +0 -40
- package/dist/packages/ember-testing/lib/helpers/find_with_assert.js +0 -37
- package/dist/packages/ember-testing/lib/helpers/key_event.js +0 -37
- package/dist/packages/ember-testing/lib/helpers/trigger_event.js +0 -61
- package/dist/packages/ember-testing/lib/support.js +0 -57
- package/dist/packages/jquery/index.js +0 -2
package/lib/index.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
const MergeTrees = require('broccoli-merge-trees');
|
|
4
4
|
const Funnel = require('broccoli-funnel');
|
|
5
5
|
const path = require('path');
|
|
6
|
-
const resolve = require('resolve');
|
|
7
6
|
const concatBundle = require('./concat-bundle');
|
|
8
7
|
const buildDebugMacroPlugin = require('./build-debug-macro-plugin');
|
|
9
8
|
const buildStripClassCallcheckPlugin = require('./build-strip-class-callcheck-plugin');
|
|
@@ -11,6 +10,7 @@ const injectBabelHelpers = require('./transforms/inject-babel-helpers').injectBa
|
|
|
11
10
|
const debugTree = require('broccoli-debug').buildDebugCallback('ember-source:addon');
|
|
12
11
|
const vmBabelPlugins = require('@glimmer/vm-babel-plugins');
|
|
13
12
|
const Overrides = require('./overrides');
|
|
13
|
+
const SilentError = require('silent-error');
|
|
14
14
|
|
|
15
15
|
const PRE_BUILT_TARGETS = [
|
|
16
16
|
'last 1 Chrome versions',
|
|
@@ -33,7 +33,6 @@ function add(paths, name, path) {
|
|
|
33
33
|
add(paths, 'prod', 'vendor/ember/ember.js');
|
|
34
34
|
add(paths, 'debug', 'vendor/ember/ember.js');
|
|
35
35
|
add(paths, 'testing', 'vendor/ember/ember-testing.js');
|
|
36
|
-
add(paths, 'jquery', 'vendor/ember/jquery/jquery.js');
|
|
37
36
|
|
|
38
37
|
add(
|
|
39
38
|
absolutePaths,
|
|
@@ -65,7 +64,6 @@ module.exports = {
|
|
|
65
64
|
name: 'ember-source',
|
|
66
65
|
paths,
|
|
67
66
|
absolutePaths,
|
|
68
|
-
_jqueryIntegrationEnabled: true,
|
|
69
67
|
_overrideTree: undefined,
|
|
70
68
|
|
|
71
69
|
included() {
|
|
@@ -95,25 +93,6 @@ module.exports = {
|
|
|
95
93
|
);
|
|
96
94
|
}
|
|
97
95
|
|
|
98
|
-
if (
|
|
99
|
-
optionalFeaturesMissing ||
|
|
100
|
-
typeof optionalFeatures.isFeatureExplicitlySet !== 'function'
|
|
101
|
-
) {
|
|
102
|
-
message.push(
|
|
103
|
-
'* Unable to detect if jquery-integration is explicitly set to a value, please update `@ember/optional-features` to the latest version'
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
if (
|
|
108
|
-
optionalFeaturesMissing ||
|
|
109
|
-
(typeof optionalFeatures.isFeatureExplicitlySet === 'function' &&
|
|
110
|
-
!optionalFeatures.isFeatureExplicitlySet('jquery-integration'))
|
|
111
|
-
) {
|
|
112
|
-
message.push(
|
|
113
|
-
`* The jquery-integration optional feature should be explicitly set to a value under Octane, run \`ember feature:disable jquery-integration\` to disable it, or \`ember feature:enable jquery-integration\` to explicitly enable it`
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
96
|
if (
|
|
118
97
|
optionalFeaturesMissing ||
|
|
119
98
|
optionalFeatures.isFeatureEnabled('application-template-wrapper')
|
|
@@ -137,7 +116,6 @@ module.exports = {
|
|
|
137
116
|
`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`
|
|
138
117
|
);
|
|
139
118
|
|
|
140
|
-
const SilentError = require('silent-error');
|
|
141
119
|
throw new SilentError(message.join('\n\t'));
|
|
142
120
|
}
|
|
143
121
|
} else {
|
|
@@ -158,18 +136,20 @@ module.exports = {
|
|
|
158
136
|
optionalFeaturesMissing ||
|
|
159
137
|
!optionalFeatures.isFeatureEnabled('template-only-glimmer-components')
|
|
160
138
|
) {
|
|
161
|
-
|
|
162
|
-
'Setting the `template-only-glimmer-components` optional feature flag to `false`, or not providing a setting at all,
|
|
139
|
+
throw new SilentError(
|
|
140
|
+
'Setting the `template-only-glimmer-components` optional feature flag to `false`, or not providing a setting at all, 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 `true`.\n\nFor more information, see the deprecation guide: https://deprecations.emberjs.com/v3.x/#toc_optional-feature-template-only-glimmer-components'
|
|
163
141
|
);
|
|
164
142
|
}
|
|
165
143
|
}
|
|
166
144
|
|
|
167
|
-
|
|
168
|
-
optionalFeaturesMissing
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
145
|
+
if (
|
|
146
|
+
!optionalFeaturesMissing &&
|
|
147
|
+
optionalFeatures.isFeatureEnabled('jquery-integration') &&
|
|
148
|
+
typeof optionalFeatures.isFeatureExplicitlySet === 'function' &&
|
|
149
|
+
optionalFeatures.isFeatureExplicitlySet('jquery-integration')
|
|
150
|
+
) {
|
|
151
|
+
throw new SilentError(
|
|
152
|
+
'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'
|
|
173
153
|
);
|
|
174
154
|
}
|
|
175
155
|
},
|
|
@@ -237,10 +217,7 @@ module.exports = {
|
|
|
237
217
|
false
|
|
238
218
|
);
|
|
239
219
|
|
|
240
|
-
let exclude = [
|
|
241
|
-
isProduction ? 'ember-testing/**' : null,
|
|
242
|
-
!this._jqueryIntegrationEnabled ? 'jquery' : null,
|
|
243
|
-
].filter((value) => value !== null);
|
|
220
|
+
let exclude = isProduction ? ['ember-testing/**'] : [];
|
|
244
221
|
|
|
245
222
|
let emberFiles = new MergeTrees([new Funnel(packages, { exclude }), dependencies, headerFiles]);
|
|
246
223
|
|
|
@@ -270,21 +247,6 @@ module.exports = {
|
|
|
270
247
|
},
|
|
271
248
|
|
|
272
249
|
treeForVendor(tree) {
|
|
273
|
-
let jqueryPath;
|
|
274
|
-
|
|
275
|
-
try {
|
|
276
|
-
jqueryPath = path.dirname(
|
|
277
|
-
resolve.sync('jquery/package.json', { basedir: this.project.root })
|
|
278
|
-
);
|
|
279
|
-
} catch (error) {
|
|
280
|
-
jqueryPath = path.dirname(require.resolve('jquery/package.json'));
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
let jquery = new Funnel(jqueryPath + '/dist', {
|
|
284
|
-
destDir: 'ember/jquery',
|
|
285
|
-
files: ['jquery.js'],
|
|
286
|
-
});
|
|
287
|
-
|
|
288
250
|
let templateCompiler = new Funnel(tree, {
|
|
289
251
|
destDir: 'ember',
|
|
290
252
|
include: ['ember-template-compiler.js', 'ember-template-compiler.map'],
|
|
@@ -319,6 +281,6 @@ module.exports = {
|
|
|
319
281
|
});
|
|
320
282
|
}
|
|
321
283
|
|
|
322
|
-
return debugTree(new MergeTrees([ember, templateCompiler
|
|
284
|
+
return debugTree(new MergeTrees([ember, templateCompiler]), 'vendor:final');
|
|
323
285
|
},
|
|
324
286
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ember-source",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.10",
|
|
4
4
|
"description": "A JavaScript framework for creating ambitious web applications",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ember-addon"
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"@babel/helper-module-imports": "^7.8.3",
|
|
51
51
|
"@babel/plugin-transform-block-scoping": "^7.8.3",
|
|
52
52
|
"@ember/edition-utils": "^1.2.0",
|
|
53
|
-
"@glimmer/vm-babel-plugins": "0.
|
|
54
|
-
"babel-plugin-debug-macros": "^0.3.
|
|
53
|
+
"@glimmer/vm-babel-plugins": "0.83.1",
|
|
54
|
+
"babel-plugin-debug-macros": "^0.3.4",
|
|
55
55
|
"babel-plugin-filter-imports": "^4.0.0",
|
|
56
56
|
"broccoli-concat": "^4.2.4",
|
|
57
57
|
"broccoli-debug": "^0.6.4",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"broccoli-funnel": "^2.0.2",
|
|
60
60
|
"broccoli-merge-trees": "^4.2.0",
|
|
61
61
|
"chalk": "^4.0.0",
|
|
62
|
+
"ember-auto-import": "^2.2.0",
|
|
62
63
|
"ember-cli-babel": "^7.23.0",
|
|
63
64
|
"ember-cli-get-component-path-option": "^1.0.0",
|
|
64
65
|
"ember-cli-is-package-missing": "^1.0.0",
|
|
@@ -68,26 +69,25 @@
|
|
|
68
69
|
"ember-cli-version-checker": "^5.1.1",
|
|
69
70
|
"ember-router-generator": "^2.0.0",
|
|
70
71
|
"inflection": "^1.12.0",
|
|
71
|
-
"jquery": "^3.5.1",
|
|
72
72
|
"resolve": "^1.17.0",
|
|
73
73
|
"semver": "^7.3.4",
|
|
74
74
|
"silent-error": "^1.1.1"
|
|
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.3",
|
|
@@ -151,12 +151,12 @@
|
|
|
151
151
|
"typescript": "^4.2.4"
|
|
152
152
|
},
|
|
153
153
|
"engines": {
|
|
154
|
-
"node": "
|
|
154
|
+
"node": ">= 12.*"
|
|
155
155
|
},
|
|
156
156
|
"ember-addon": {
|
|
157
157
|
"after": "ember-cli-legacy-blueprints"
|
|
158
158
|
},
|
|
159
|
-
"_originalVersion": "4.0.0-beta.
|
|
159
|
+
"_originalVersion": "4.0.0-beta.10",
|
|
160
160
|
"_versionPreviouslyCalculated": true,
|
|
161
161
|
"publishConfig": {
|
|
162
162
|
"tag": "beta"
|
|
@@ -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,26 +0,0 @@
|
|
|
1
|
-
import { context } from '@ember/-internals/environment';
|
|
2
|
-
import { hasDOM } from '@ember/-internals/browser-environment';
|
|
3
|
-
import { ENV } from '@ember/-internals/environment';
|
|
4
|
-
import { JQUERY_INTEGRATION } from '@ember/deprecated-features';
|
|
5
|
-
export let jQuery;
|
|
6
|
-
export let jQueryDisabled = !JQUERY_INTEGRATION || ENV._JQUERY_INTEGRATION === false;
|
|
7
|
-
|
|
8
|
-
if (JQUERY_INTEGRATION && hasDOM) {
|
|
9
|
-
jQuery = context.imports.jQuery;
|
|
10
|
-
|
|
11
|
-
if (!jQueryDisabled && jQuery) {
|
|
12
|
-
if (jQuery.event.addProp) {
|
|
13
|
-
jQuery.event.addProp('dataTransfer');
|
|
14
|
-
} else {
|
|
15
|
-
// http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#dndevents
|
|
16
|
-
['dragstart', 'drag', 'dragenter', 'dragleave', 'dragover', 'drop', 'dragend'].forEach(eventName => {
|
|
17
|
-
jQuery.event.fixHooks[eventName] = {
|
|
18
|
-
props: ['dataTransfer']
|
|
19
|
-
};
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
} else {
|
|
23
|
-
jQuery = undefined;
|
|
24
|
-
jQueryDisabled = true;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -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';
|