ember-source 4.4.0-alpha.2 → 4.4.0-alpha.5
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 +5 -1
- package/blueprints/acceptance-test/mocha-rfc-232-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/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +2 -2
- package/blueprints/component-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +2 -2
- package/blueprints/controller-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
- package/blueprints/controller-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
- package/blueprints/helper-test/mocha-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +1 -1
- package/blueprints/helper-test/qunit-rfc-232-files/__root__/__testType__/__collection__/__name__-test.js +1 -1
- package/blueprints/route-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
- package/blueprints/route-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
- package/blueprints/service-test/mocha-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
- package/blueprints/service-test/qunit-rfc-232-files/__root__/__testType__/__path__/__test__.js +1 -1
- package/build-metadata.json +3 -3
- package/dist/ember-template-compiler.js +19 -8
- package/dist/ember-template-compiler.map +1 -1
- package/dist/ember-testing.js +9 -5
- package/dist/ember-testing.map +1 -1
- package/dist/ember.debug.js +994 -1537
- package/dist/ember.debug.map +1 -1
- package/dist/header/license.js +1 -1
- package/dist/packages/@ember/-internals/container/index.js +0 -16
- package/dist/packages/@ember/-internals/extension-support/lib/container_debug_adapter.js +10 -19
- package/dist/packages/@ember/-internals/extension-support/lib/data_adapter.js +113 -112
- package/dist/packages/@ember/-internals/glimmer/index.js +150 -749
- package/dist/packages/@ember/-internals/metal/index.js +6 -17
- package/dist/packages/@ember/-internals/routing/lib/location/hash_location.js +1 -1
- package/dist/packages/@ember/-internals/routing/lib/services/router.js +65 -12
- package/dist/packages/@ember/-internals/routing/lib/system/route.js +1 -1
- package/dist/packages/@ember/-internals/routing/lib/system/router.js +11 -8
- package/dist/packages/@ember/-internals/runtime/lib/compare.js +19 -5
- package/dist/packages/@ember/-internals/runtime/lib/ext/rsvp.js +8 -4
- package/dist/packages/@ember/-internals/runtime/lib/mixins/-proxy.js +1 -1
- package/dist/packages/@ember/-internals/runtime/lib/mixins/array.js +1 -1
- package/dist/packages/@ember/-internals/runtime/lib/mixins/comparable.js +4 -4
- package/dist/packages/@ember/-internals/runtime/lib/mixins/promise_proxy.js +16 -16
- package/dist/packages/@ember/-internals/runtime/lib/mixins/target_action_support.js +8 -8
- package/dist/packages/@ember/-internals/views/lib/system/utils.js +4 -2
- package/dist/packages/@ember/-internals/views/lib/views/core_view.js +5 -22
- package/dist/packages/@ember/canary-features/index.js +4 -2
- package/dist/packages/@ember/debug/index.js +1 -1
- package/dist/packages/@ember/debug/lib/deprecate.js +6 -2
- package/dist/packages/@ember/debug/lib/handlers.js +1 -1
- package/dist/packages/@ember/renderer/index.js +21 -0
- package/dist/packages/@ember/runloop/index.js +31 -528
- package/dist/packages/@ember/runloop/type-tests.ts/begin-end.test.js +5 -0
- package/dist/packages/@ember/runloop/type-tests.ts/bind.test.js +59 -0
- package/dist/packages/@ember/runloop/type-tests.ts/cancel.test.js +5 -0
- package/dist/packages/@ember/runloop/type-tests.ts/debounce.test.js +77 -0
- package/dist/packages/@ember/runloop/type-tests.ts/join.test.js +38 -0
- package/dist/packages/@ember/runloop/type-tests.ts/later.test.js +38 -0
- package/dist/packages/@ember/runloop/type-tests.ts/next.test.js +38 -0
- package/dist/packages/@ember/runloop/type-tests.ts/once.test.js +38 -0
- package/dist/packages/@ember/runloop/type-tests.ts/run.test.js +38 -0
- package/dist/packages/@ember/runloop/type-tests.ts/schedule-once.test.js +39 -0
- package/dist/packages/@ember/runloop/type-tests.ts/schedule.test.js +39 -0
- package/dist/packages/@ember/runloop/type-tests.ts/throttle.test.js +77 -0
- package/dist/packages/ember/index.js +1 -0
- package/dist/packages/ember/version.js +1 -1
- package/docs/data.json +591 -300
- package/package.json +11 -11
package/dist/ember.debug.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Portions Copyright 2008-2011 Apple Inc. All rights reserved.
|
|
7
7
|
* @license Licensed under MIT license
|
|
8
8
|
* See https://raw.github.com/emberjs/ember.js/master/LICENSE
|
|
9
|
-
* @version 4.4.0-alpha.
|
|
9
|
+
* @version 4.4.0-alpha.5
|
|
10
10
|
*/
|
|
11
11
|
/* eslint-disable no-var */
|
|
12
12
|
|
|
@@ -704,22 +704,6 @@ define("@ember/-internals/container/index", ["exports", "@ember/-internals/owner
|
|
|
704
704
|
container(options) {
|
|
705
705
|
return new Container(this, options);
|
|
706
706
|
}
|
|
707
|
-
/**
|
|
708
|
-
Registers a factory for later injection.
|
|
709
|
-
Example:
|
|
710
|
-
```javascript
|
|
711
|
-
let registry = new Registry();
|
|
712
|
-
registry.register('model:user', Person, {singleton: false });
|
|
713
|
-
registry.register('fruit:favorite', Orange);
|
|
714
|
-
registry.register('communication:main', Email, {singleton: false});
|
|
715
|
-
```
|
|
716
|
-
@private
|
|
717
|
-
@method register
|
|
718
|
-
@param {String} fullName
|
|
719
|
-
@param {Function} factory
|
|
720
|
-
@param {Object} options
|
|
721
|
-
*/
|
|
722
|
-
|
|
723
707
|
|
|
724
708
|
register(fullName, factory, options) {
|
|
725
709
|
if (options === void 0) {
|
|
@@ -1497,23 +1481,11 @@ define("@ember/-internals/extension-support/lib/container_debug_adapter", ["expo
|
|
|
1497
1481
|
@since 1.5.0
|
|
1498
1482
|
@public
|
|
1499
1483
|
*/
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1484
|
+
class ContainerDebugAdapter extends _runtime.Object {
|
|
1485
|
+
constructor(owner) {
|
|
1486
|
+
super(owner);
|
|
1504
1487
|
this.resolver = (0, _owner.getOwner)(this).lookup('resolver-for-debugging:main');
|
|
1505
|
-
}
|
|
1506
|
-
|
|
1507
|
-
/**
|
|
1508
|
-
The resolver instance of the application
|
|
1509
|
-
being debugged. This property will be injected
|
|
1510
|
-
on creation.
|
|
1511
|
-
@property resolver
|
|
1512
|
-
@default null
|
|
1513
|
-
@public
|
|
1514
|
-
*/
|
|
1515
|
-
resolver: null,
|
|
1516
|
-
|
|
1488
|
+
}
|
|
1517
1489
|
/**
|
|
1518
1490
|
Returns true if it is possible to catalog a list of available
|
|
1519
1491
|
classes in the resolver for a given type.
|
|
@@ -1522,14 +1494,15 @@ define("@ember/-internals/extension-support/lib/container_debug_adapter", ["expo
|
|
|
1522
1494
|
@return {boolean} whether a list is available for this type.
|
|
1523
1495
|
@public
|
|
1524
1496
|
*/
|
|
1497
|
+
|
|
1498
|
+
|
|
1525
1499
|
canCatalogEntriesByType(type) {
|
|
1526
1500
|
if (type === 'model' || type === 'template') {
|
|
1527
1501
|
return false;
|
|
1528
1502
|
}
|
|
1529
1503
|
|
|
1530
1504
|
return true;
|
|
1531
|
-
}
|
|
1532
|
-
|
|
1505
|
+
}
|
|
1533
1506
|
/**
|
|
1534
1507
|
Returns the available classes a given type.
|
|
1535
1508
|
@method catalogEntriesByType
|
|
@@ -1537,6 +1510,8 @@ define("@ember/-internals/extension-support/lib/container_debug_adapter", ["expo
|
|
|
1537
1510
|
@return {Array} An array of strings.
|
|
1538
1511
|
@public
|
|
1539
1512
|
*/
|
|
1513
|
+
|
|
1514
|
+
|
|
1540
1515
|
catalogEntriesByType(type) {
|
|
1541
1516
|
var namespaces = (0, _runtime.A)(_runtime.Namespace.NAMESPACES);
|
|
1542
1517
|
var types = (0, _runtime.A)();
|
|
@@ -1559,9 +1534,9 @@ define("@ember/-internals/extension-support/lib/container_debug_adapter", ["expo
|
|
|
1559
1534
|
return types;
|
|
1560
1535
|
}
|
|
1561
1536
|
|
|
1562
|
-
}
|
|
1537
|
+
}
|
|
1563
1538
|
|
|
1564
|
-
_exports.default =
|
|
1539
|
+
_exports.default = ContainerDebugAdapter;
|
|
1565
1540
|
});
|
|
1566
1541
|
define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@ember/-internals/owner", "@ember/runloop", "@ember/-internals/metal", "@ember/string", "@ember/-internals/runtime", "@glimmer/validator"], function (_exports, _owner, _runloop, _metal, _string, _runtime, _validator) {
|
|
1567
1542
|
"use strict";
|
|
@@ -1583,12 +1558,12 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
1583
1558
|
|
|
1584
1559
|
class RecordsWatcher {
|
|
1585
1560
|
constructor(records, recordsAdded, recordsUpdated, recordsRemoved, wrapRecord, release) {
|
|
1561
|
+
this.wrapRecord = wrapRecord;
|
|
1562
|
+
this.release = release;
|
|
1586
1563
|
this.recordCaches = new Map();
|
|
1587
1564
|
this.added = [];
|
|
1588
1565
|
this.updated = [];
|
|
1589
1566
|
this.removed = [];
|
|
1590
|
-
this.release = release;
|
|
1591
|
-
this.wrapRecord = wrapRecord;
|
|
1592
1567
|
this.recordArrayCache = (0, _validator.createCache)(() => {
|
|
1593
1568
|
var seen = new Set(); // Track `[]` for legacy support
|
|
1594
1569
|
|
|
@@ -1600,7 +1575,7 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
1600
1575
|
// should not be polled again in the future
|
|
1601
1576
|
|
|
1602
1577
|
(0, _validator.untrack)(() => {
|
|
1603
|
-
this.recordCaches.forEach((
|
|
1578
|
+
this.recordCaches.forEach((_cache, record) => {
|
|
1604
1579
|
if (!seen.has(record)) {
|
|
1605
1580
|
this.removed.push(wrapRecord(record));
|
|
1606
1581
|
this.recordCaches.delete(record);
|
|
@@ -1652,6 +1627,7 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
1652
1627
|
|
|
1653
1628
|
class TypeWatcher {
|
|
1654
1629
|
constructor(records, onChange, release) {
|
|
1630
|
+
this.release = release;
|
|
1655
1631
|
var hasBeenAccessed = false;
|
|
1656
1632
|
this.cache = (0, _validator.createCache)(() => {
|
|
1657
1633
|
// Empty iteration, we're doing this just
|
|
@@ -1720,49 +1696,47 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
1720
1696
|
*/
|
|
1721
1697
|
|
|
1722
1698
|
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
this.containerDebugAdapter = (0, _owner.getOwner)(this).lookup('container-debug-adapter:main');
|
|
1699
|
+
class DataAdapter extends _runtime.Object {
|
|
1700
|
+
constructor(owner) {
|
|
1701
|
+
super(owner);
|
|
1728
1702
|
this.releaseMethods = (0, _runtime.A)();
|
|
1729
1703
|
this.recordsWatchers = new Map();
|
|
1730
1704
|
this.typeWatchers = new Map();
|
|
1731
1705
|
this.flushWatchers = null;
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
@public
|
|
1741
|
-
**/
|
|
1706
|
+
/**
|
|
1707
|
+
The container-debug-adapter which is used
|
|
1708
|
+
to list all models.
|
|
1709
|
+
@property containerDebugAdapter
|
|
1710
|
+
@default undefined
|
|
1711
|
+
@since 1.5.0
|
|
1712
|
+
@public
|
|
1713
|
+
**/
|
|
1742
1714
|
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
attributeLimit: 3,
|
|
1715
|
+
/**
|
|
1716
|
+
The number of attributes to send
|
|
1717
|
+
as columns. (Enough to make the record
|
|
1718
|
+
identifiable).
|
|
1719
|
+
@private
|
|
1720
|
+
@property attributeLimit
|
|
1721
|
+
@default 3
|
|
1722
|
+
@since 1.3.0
|
|
1723
|
+
*/
|
|
1753
1724
|
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1725
|
+
this.attributeLimit = 3;
|
|
1726
|
+
/**
|
|
1727
|
+
Ember Data > v1.0.0-beta.18
|
|
1728
|
+
requires string model names to be passed
|
|
1729
|
+
around instead of the actual factories.
|
|
1730
|
+
This is a stamp for the Ember Inspector
|
|
1731
|
+
to differentiate between the versions
|
|
1732
|
+
to be able to support older versions too.
|
|
1733
|
+
@public
|
|
1734
|
+
@property acceptsModelName
|
|
1735
|
+
*/
|
|
1765
1736
|
|
|
1737
|
+
this.acceptsModelName = true;
|
|
1738
|
+
this.containerDebugAdapter = (0, _owner.getOwner)(this).lookup('container-debug-adapter:main');
|
|
1739
|
+
}
|
|
1766
1740
|
/**
|
|
1767
1741
|
Map from records arrays to RecordsWatcher instances
|
|
1768
1742
|
@private
|
|
@@ -1802,10 +1776,11 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
1802
1776
|
@return {Array} List of objects defining filters.
|
|
1803
1777
|
The object should have a `name` and `desc` property.
|
|
1804
1778
|
*/
|
|
1779
|
+
|
|
1780
|
+
|
|
1805
1781
|
getFilters() {
|
|
1806
1782
|
return (0, _runtime.A)();
|
|
1807
|
-
}
|
|
1808
|
-
|
|
1783
|
+
}
|
|
1809
1784
|
/**
|
|
1810
1785
|
Fetch the model types and observe them for changes.
|
|
1811
1786
|
@public
|
|
@@ -1816,6 +1791,8 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
1816
1791
|
Takes an array of objects containing wrapped types.
|
|
1817
1792
|
@return {Function} Method to call to remove all observers
|
|
1818
1793
|
*/
|
|
1794
|
+
|
|
1795
|
+
|
|
1819
1796
|
watchModelTypes(typesAdded, typesUpdated) {
|
|
1820
1797
|
var modelTypes = this.getModelTypes();
|
|
1821
1798
|
var releaseMethods = (0, _runtime.A)();
|
|
@@ -1835,7 +1812,7 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
1835
1812
|
|
|
1836
1813
|
this.releaseMethods.pushObject(release);
|
|
1837
1814
|
return release;
|
|
1838
|
-
}
|
|
1815
|
+
}
|
|
1839
1816
|
|
|
1840
1817
|
_nameToClass(type) {
|
|
1841
1818
|
if (typeof type === 'string') {
|
|
@@ -1845,8 +1822,7 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
1845
1822
|
}
|
|
1846
1823
|
|
|
1847
1824
|
return type;
|
|
1848
|
-
}
|
|
1849
|
-
|
|
1825
|
+
}
|
|
1850
1826
|
/**
|
|
1851
1827
|
Fetch the records of a given type and observe them for changes.
|
|
1852
1828
|
@public
|
|
@@ -1863,6 +1839,8 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
1863
1839
|
Takes an array of objects containing wrapped records.
|
|
1864
1840
|
@return {Function} Method to call to remove all observers.
|
|
1865
1841
|
*/
|
|
1842
|
+
|
|
1843
|
+
|
|
1866
1844
|
watchRecords(modelName, recordsAdded, recordsUpdated, recordsRemoved) {
|
|
1867
1845
|
var klass = this._nameToClass(modelName);
|
|
1868
1846
|
|
|
@@ -1883,7 +1861,7 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
1883
1861
|
}
|
|
1884
1862
|
|
|
1885
1863
|
return recordsWatcher.release;
|
|
1886
|
-
}
|
|
1864
|
+
}
|
|
1887
1865
|
|
|
1888
1866
|
updateFlushWatchers() {
|
|
1889
1867
|
if (this.flushWatchers === null) {
|
|
@@ -1900,13 +1878,14 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
1900
1878
|
|
|
1901
1879
|
this.flushWatchers = null;
|
|
1902
1880
|
}
|
|
1903
|
-
}
|
|
1904
|
-
|
|
1881
|
+
}
|
|
1905
1882
|
/**
|
|
1906
1883
|
Clear all observers before destruction
|
|
1907
1884
|
@private
|
|
1908
1885
|
@method willDestroy
|
|
1909
1886
|
*/
|
|
1887
|
+
|
|
1888
|
+
|
|
1910
1889
|
willDestroy() {
|
|
1911
1890
|
this._super(...arguments);
|
|
1912
1891
|
|
|
@@ -1917,8 +1896,7 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
1917
1896
|
if (this.flushWatchers) {
|
|
1918
1897
|
_runloop._backburner.off('end', this.flushWatchers);
|
|
1919
1898
|
}
|
|
1920
|
-
}
|
|
1921
|
-
|
|
1899
|
+
}
|
|
1922
1900
|
/**
|
|
1923
1901
|
Detect whether a class is a model.
|
|
1924
1902
|
Test that against the model class
|
|
@@ -1927,10 +1905,11 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
1927
1905
|
@method detect
|
|
1928
1906
|
@return boolean Whether the class is a model class or not.
|
|
1929
1907
|
*/
|
|
1930
|
-
detect() {
|
|
1931
|
-
return false;
|
|
1932
|
-
},
|
|
1933
1908
|
|
|
1909
|
+
|
|
1910
|
+
detect(_klass) {
|
|
1911
|
+
return false;
|
|
1912
|
+
}
|
|
1934
1913
|
/**
|
|
1935
1914
|
Get the columns for a given model type.
|
|
1936
1915
|
@public
|
|
@@ -1939,10 +1918,11 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
1939
1918
|
name: {String} The name of the column.
|
|
1940
1919
|
desc: {String} Humanized description (what would show in a table column name).
|
|
1941
1920
|
*/
|
|
1942
|
-
columnsForType() {
|
|
1943
|
-
return (0, _runtime.A)();
|
|
1944
|
-
},
|
|
1945
1921
|
|
|
1922
|
+
|
|
1923
|
+
columnsForType(_klass) {
|
|
1924
|
+
return (0, _runtime.A)();
|
|
1925
|
+
}
|
|
1946
1926
|
/**
|
|
1947
1927
|
Adds observers to a model type class.
|
|
1948
1928
|
@private
|
|
@@ -1951,6 +1931,8 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
1951
1931
|
@param {Function} typesUpdated Called when a type is modified.
|
|
1952
1932
|
@return {Function} The function to call to remove observers.
|
|
1953
1933
|
*/
|
|
1934
|
+
|
|
1935
|
+
|
|
1954
1936
|
observeModelType(modelName, typesUpdated) {
|
|
1955
1937
|
var klass = this._nameToClass(modelName);
|
|
1956
1938
|
|
|
@@ -1976,63 +1958,50 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
1976
1958
|
}
|
|
1977
1959
|
|
|
1978
1960
|
return typeWatcher.release;
|
|
1979
|
-
}
|
|
1980
|
-
|
|
1961
|
+
}
|
|
1981
1962
|
/**
|
|
1982
1963
|
Wraps a given model type and observes changes to it.
|
|
1983
1964
|
@private
|
|
1984
1965
|
@method wrapModelType
|
|
1985
1966
|
@param {Class} klass A model class.
|
|
1986
1967
|
@param {String} modelName Name of the class.
|
|
1987
|
-
@return {Object}
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
count: {Integer} The number of records available.
|
|
1993
|
-
columns: {Columns} An array of columns to describe the record.
|
|
1994
|
-
object: {Class} The actual Model type class.
|
|
1995
|
-
release: {Function} The function to remove observers.
|
|
1968
|
+
@return {Object} The wrapped type has the following format:
|
|
1969
|
+
name: {String} The name of the type.
|
|
1970
|
+
count: {Integer} The number of records available.
|
|
1971
|
+
columns: {Columns} An array of columns to describe the record.
|
|
1972
|
+
object: {Class} The actual Model type class.
|
|
1996
1973
|
*/
|
|
1974
|
+
|
|
1975
|
+
|
|
1997
1976
|
wrapModelType(klass, name) {
|
|
1998
1977
|
var records = this.getRecords(klass, name);
|
|
1999
|
-
|
|
2000
|
-
typeToSend = {
|
|
1978
|
+
return {
|
|
2001
1979
|
name,
|
|
2002
1980
|
count: (0, _metal.get)(records, 'length'),
|
|
2003
1981
|
columns: this.columnsForType(klass),
|
|
2004
1982
|
object: klass
|
|
2005
1983
|
};
|
|
2006
|
-
|
|
2007
|
-
},
|
|
2008
|
-
|
|
1984
|
+
}
|
|
2009
1985
|
/**
|
|
2010
1986
|
Fetches all models defined in the application.
|
|
2011
1987
|
@private
|
|
2012
1988
|
@method getModelTypes
|
|
2013
1989
|
@return {Array} Array of model types.
|
|
2014
1990
|
*/
|
|
2015
|
-
getModelTypes() {
|
|
2016
|
-
var containerDebugAdapter = this.get('containerDebugAdapter');
|
|
2017
|
-
var types;
|
|
2018
1991
|
|
|
2019
|
-
if (containerDebugAdapter.canCatalogEntriesByType('model')) {
|
|
2020
|
-
types = containerDebugAdapter.catalogEntriesByType('model');
|
|
2021
|
-
} else {
|
|
2022
|
-
types = this._getObjectsOnNamespaces();
|
|
2023
|
-
} // New adapters return strings instead of classes.
|
|
2024
1992
|
|
|
1993
|
+
getModelTypes() {
|
|
1994
|
+
var containerDebugAdapter = this.containerDebugAdapter;
|
|
1995
|
+
var stringTypes = containerDebugAdapter.canCatalogEntriesByType('model') ? containerDebugAdapter.catalogEntriesByType('model') : this._getObjectsOnNamespaces(); // New adapters return strings instead of classes.
|
|
2025
1996
|
|
|
2026
|
-
|
|
1997
|
+
var klassTypes = (0, _runtime.A)(stringTypes).map(name => {
|
|
2027
1998
|
return {
|
|
2028
1999
|
klass: this._nameToClass(name),
|
|
2029
2000
|
name
|
|
2030
2001
|
};
|
|
2031
2002
|
});
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
},
|
|
2035
|
-
|
|
2003
|
+
return (0, _runtime.A)(klassTypes).filter(type => this.detect(type.klass));
|
|
2004
|
+
}
|
|
2036
2005
|
/**
|
|
2037
2006
|
Loops over all namespaces and all objects
|
|
2038
2007
|
attached to them.
|
|
@@ -2040,6 +2009,8 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
2040
2009
|
@method _getObjectsOnNamespaces
|
|
2041
2010
|
@return {Array} Array of model type strings.
|
|
2042
2011
|
*/
|
|
2012
|
+
|
|
2013
|
+
|
|
2043
2014
|
_getObjectsOnNamespaces() {
|
|
2044
2015
|
var namespaces = (0, _runtime.A)(_runtime.Namespace.NAMESPACES);
|
|
2045
2016
|
var types = (0, _runtime.A)();
|
|
@@ -2060,8 +2031,7 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
2060
2031
|
}
|
|
2061
2032
|
});
|
|
2062
2033
|
return types;
|
|
2063
|
-
}
|
|
2064
|
-
|
|
2034
|
+
}
|
|
2065
2035
|
/**
|
|
2066
2036
|
Fetches all loaded records for a given type.
|
|
2067
2037
|
@public
|
|
@@ -2070,10 +2040,11 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
2070
2040
|
This array will be observed for changes,
|
|
2071
2041
|
so it should update when new records are added/removed.
|
|
2072
2042
|
*/
|
|
2073
|
-
getRecords() {
|
|
2074
|
-
return (0, _runtime.A)();
|
|
2075
|
-
},
|
|
2076
2043
|
|
|
2044
|
+
|
|
2045
|
+
getRecords(_klass, _name) {
|
|
2046
|
+
return (0, _runtime.A)();
|
|
2047
|
+
}
|
|
2077
2048
|
/**
|
|
2078
2049
|
Wraps a record and observers changes to it.
|
|
2079
2050
|
@private
|
|
@@ -2083,17 +2054,17 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
2083
2054
|
columnValues: {Array}
|
|
2084
2055
|
searchKeywords: {Array}
|
|
2085
2056
|
*/
|
|
2057
|
+
|
|
2058
|
+
|
|
2086
2059
|
wrapRecord(record) {
|
|
2087
|
-
|
|
2088
|
-
object: record
|
|
2060
|
+
return {
|
|
2061
|
+
object: record,
|
|
2062
|
+
columnValues: this.getRecordColumnValues(record),
|
|
2063
|
+
searchKeywords: this.getRecordKeywords(record),
|
|
2064
|
+
filterValues: this.getRecordFilterValues(record),
|
|
2065
|
+
color: this.getRecordColor(record)
|
|
2089
2066
|
};
|
|
2090
|
-
|
|
2091
|
-
recordToSend.searchKeywords = this.getRecordKeywords(record);
|
|
2092
|
-
recordToSend.filterValues = this.getRecordFilterValues(record);
|
|
2093
|
-
recordToSend.color = this.getRecordColor(record);
|
|
2094
|
-
return recordToSend;
|
|
2095
|
-
},
|
|
2096
|
-
|
|
2067
|
+
}
|
|
2097
2068
|
/**
|
|
2098
2069
|
Gets the values for each column.
|
|
2099
2070
|
@public
|
|
@@ -2101,20 +2072,22 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
2101
2072
|
@return {Object} Keys should match column names defined
|
|
2102
2073
|
by the model type.
|
|
2103
2074
|
*/
|
|
2104
|
-
getRecordColumnValues() {
|
|
2105
|
-
return {};
|
|
2106
|
-
},
|
|
2107
2075
|
|
|
2076
|
+
|
|
2077
|
+
getRecordColumnValues(_record) {
|
|
2078
|
+
return {};
|
|
2079
|
+
}
|
|
2108
2080
|
/**
|
|
2109
2081
|
Returns keywords to match when searching records.
|
|
2110
2082
|
@public
|
|
2111
2083
|
@method getRecordKeywords
|
|
2112
2084
|
@return {Array} Relevant keywords for search.
|
|
2113
2085
|
*/
|
|
2114
|
-
getRecordKeywords() {
|
|
2115
|
-
return (0, _runtime.A)();
|
|
2116
|
-
},
|
|
2117
2086
|
|
|
2087
|
+
|
|
2088
|
+
getRecordKeywords(_record) {
|
|
2089
|
+
return (0, _runtime.A)();
|
|
2090
|
+
}
|
|
2118
2091
|
/**
|
|
2119
2092
|
Returns the values of filters defined by `getFilters`.
|
|
2120
2093
|
@public
|
|
@@ -2122,10 +2095,11 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
2122
2095
|
@param {Object} record The record instance.
|
|
2123
2096
|
@return {Object} The filter values.
|
|
2124
2097
|
*/
|
|
2125
|
-
getRecordFilterValues() {
|
|
2126
|
-
return {};
|
|
2127
|
-
},
|
|
2128
2098
|
|
|
2099
|
+
|
|
2100
|
+
getRecordFilterValues(_record) {
|
|
2101
|
+
return {};
|
|
2102
|
+
}
|
|
2129
2103
|
/**
|
|
2130
2104
|
Each record can have a color that represents its state.
|
|
2131
2105
|
@public
|
|
@@ -2134,13 +2108,15 @@ define("@ember/-internals/extension-support/lib/data_adapter", ["exports", "@emb
|
|
|
2134
2108
|
@return {String} The records color.
|
|
2135
2109
|
Possible options: black, red, blue, green.
|
|
2136
2110
|
*/
|
|
2137
|
-
|
|
2111
|
+
|
|
2112
|
+
|
|
2113
|
+
getRecordColor(_record) {
|
|
2138
2114
|
return null;
|
|
2139
2115
|
}
|
|
2140
2116
|
|
|
2141
|
-
}
|
|
2117
|
+
}
|
|
2142
2118
|
|
|
2143
|
-
_exports.default =
|
|
2119
|
+
_exports.default = DataAdapter;
|
|
2144
2120
|
});
|
|
2145
2121
|
define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler", "@ember/-internals/owner", "@ember/-internals/utils", "@ember/debug", "@glimmer/manager", "@glimmer/reference", "@glimmer/validator", "@ember/-internals/metal", "@ember/object", "@ember/-internals/browser-environment", "@ember/-internals/views", "@ember/engine", "@ember/engine/instance", "@ember/instrumentation", "@ember/service", "@ember/string", "@glimmer/destroyable", "@ember/runloop", "@glimmer/util", "@glimmer/runtime", "@ember/-internals/runtime", "@ember/-internals/environment", "@ember/-internals/container", "@glimmer/node", "@ember/-internals/glimmer", "@glimmer/global-context", "@ember/-internals/routing", "@glimmer/program", "rsvp"], function (_exports, _opcodeCompiler, _owner2, _utils, _debug, _manager2, _reference, _validator, _metal, _object, _browserEnvironment, _views, _engine, _instance, _instrumentation, _service, _string, _destroyable, _runloop, _util, _runtime, _runtime2, _environment2, _container, _node, _glimmer, _globalContext, _routing2, _program, _rsvp) {
|
|
2146
2122
|
"use strict";
|
|
@@ -2476,7 +2452,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
2476
2452
|
class AbstractInput extends InternalComponent {
|
|
2477
2453
|
constructor() {
|
|
2478
2454
|
super(...arguments);
|
|
2479
|
-
this._value = valueFrom(this.args.named
|
|
2455
|
+
this._value = valueFrom(this.args.named['value']);
|
|
2480
2456
|
}
|
|
2481
2457
|
|
|
2482
2458
|
validateArguments() {
|
|
@@ -2734,7 +2710,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
2734
2710
|
class Input extends AbstractInput {
|
|
2735
2711
|
constructor() {
|
|
2736
2712
|
super(...arguments);
|
|
2737
|
-
this._checked = valueFrom(this.args.named
|
|
2713
|
+
this._checked = valueFrom(this.args.named['checked']);
|
|
2738
2714
|
}
|
|
2739
2715
|
|
|
2740
2716
|
static toString() {
|
|
@@ -2774,7 +2750,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
2774
2750
|
|
|
2775
2751
|
get checked() {
|
|
2776
2752
|
if (this.isCheckbox) {
|
|
2777
|
-
(true && (0, _debug.warn)('`<Input @type="checkbox" />` reflects its checked state via the `@checked` argument. ' + 'You wrote `<Input @type="checkbox" @value={{...}} />` which is likely not what you intended. ' + 'Did you mean `<Input @type="checkbox" @checked={{...}} />`?', (0, _validator.untrack)(() => this.args.named
|
|
2753
|
+
(true && (0, _debug.warn)('`<Input @type="checkbox" />` reflects its checked state via the `@checked` argument. ' + 'You wrote `<Input @type="checkbox" @value={{...}} />` which is likely not what you intended. ' + 'Did you mean `<Input @type="checkbox" @checked={{...}} />`?', (0, _validator.untrack)(() => this.args.named['checked'] !== undefined || this.args.named['value'] === undefined || typeof (0, _reference.valueForRef)(this.args.named['value']) === 'string'), {
|
|
2778
2754
|
id: 'ember.built-in-components.input-checkbox-value'
|
|
2779
2755
|
}));
|
|
2780
2756
|
return this._checked.get();
|
|
@@ -2784,7 +2760,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
2784
2760
|
}
|
|
2785
2761
|
|
|
2786
2762
|
set checked(checked) {
|
|
2787
|
-
(true && (0, _debug.warn)('`<Input @type="checkbox" />` reflects its checked state via the `@checked` argument. ' + 'You wrote `<Input @type="checkbox" @value={{...}} />` which is likely not what you intended. ' + 'Did you mean `<Input @type="checkbox" @checked={{...}} />`?', (0, _validator.untrack)(() => this.args.named
|
|
2763
|
+
(true && (0, _debug.warn)('`<Input @type="checkbox" />` reflects its checked state via the `@checked` argument. ' + 'You wrote `<Input @type="checkbox" @value={{...}} />` which is likely not what you intended. ' + 'Did you mean `<Input @type="checkbox" @checked={{...}} />`?', (0, _validator.untrack)(() => this.args.named['checked'] !== undefined || this.args.named['value'] === undefined || typeof (0, _reference.valueForRef)(this.args.named['value']) === 'string'), {
|
|
2788
2764
|
id: 'ember.built-in-components.input-checkbox-value'
|
|
2789
2765
|
}));
|
|
2790
2766
|
|
|
@@ -4093,8 +4069,8 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
4093
4069
|
var [context, action$$1, ...restArgs] = positional;
|
|
4094
4070
|
(true && !(context && action$$1) && (0, _debug.assert)('hash position arguments', context && action$$1));
|
|
4095
4071
|
var debugKey = action$$1.debugLabel;
|
|
4096
|
-
var target = 'target' in named
|
|
4097
|
-
var processArgs = makeArgsProcessor('value' in named && named
|
|
4072
|
+
var target = 'target' in named ? named['target'] : context;
|
|
4073
|
+
var processArgs = makeArgsProcessor('value' in named && named['value'] || false, restArgs);
|
|
4098
4074
|
var fn$$1;
|
|
4099
4075
|
|
|
4100
4076
|
if ((0, _reference.isInvokableRef)(action$$1)) {
|
|
@@ -4160,13 +4136,12 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
4160
4136
|
var self;
|
|
4161
4137
|
var fn$$1;
|
|
4162
4138
|
(true && !(action$$1 !== undefined && action$$1 !== null) && (0, _debug.assert)(`Action passed is null or undefined in (action) from ${target}.`, action$$1 !== undefined && action$$1 !== null));
|
|
4163
|
-
var typeofAction = typeof action$$1;
|
|
4164
4139
|
|
|
4165
|
-
if (
|
|
4140
|
+
if (typeof action$$1 === 'string') {
|
|
4166
4141
|
self = target;
|
|
4167
4142
|
fn$$1 = target.actions && target.actions[action$$1];
|
|
4168
4143
|
(true && !(Boolean(fn$$1)) && (0, _debug.assert)(`An action named '${action$$1}' was not found in ${target}`, Boolean(fn$$1)));
|
|
4169
|
-
} else if (
|
|
4144
|
+
} else if (typeof action$$1 === 'function') {
|
|
4170
4145
|
self = context;
|
|
4171
4146
|
fn$$1 = action$$1;
|
|
4172
4147
|
} else {
|
|
@@ -4736,624 +4711,6 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
4736
4711
|
}
|
|
4737
4712
|
|
|
4738
4713
|
var lazyEventsProcessed = new WeakMap();
|
|
4739
|
-
/**
|
|
4740
|
-
@module @ember/component
|
|
4741
|
-
*/
|
|
4742
|
-
|
|
4743
|
-
/**
|
|
4744
|
-
A component is a reusable UI element that consists of a `.hbs` template and an
|
|
4745
|
-
optional JavaScript class that defines its behavior. For example, someone
|
|
4746
|
-
might make a `button` in the template and handle the click behavior in the
|
|
4747
|
-
JavaScript file that shares the same name as the template.
|
|
4748
|
-
|
|
4749
|
-
Components are broken down into two categories:
|
|
4750
|
-
|
|
4751
|
-
- Components _without_ JavaScript, that are based only on a template. These
|
|
4752
|
-
are called Template-only or TO components.
|
|
4753
|
-
- Components _with_ JavaScript, which consist of a template and a backing
|
|
4754
|
-
class.
|
|
4755
|
-
|
|
4756
|
-
Ember ships with two types of JavaScript classes for components:
|
|
4757
|
-
|
|
4758
|
-
1. Glimmer components, imported from `@glimmer/component`, which are the
|
|
4759
|
-
default component's for Ember Octane (3.15) and more recent editions.
|
|
4760
|
-
2. Classic components, imported from `@ember/component`, which were the
|
|
4761
|
-
default for older editions of Ember (pre 3.15).
|
|
4762
|
-
|
|
4763
|
-
Below is the documentation for Classic components. If you are looking for the
|
|
4764
|
-
API documentation for Template-only or Glimmer components, it is
|
|
4765
|
-
[available here](/ember/release/modules/@glimmer%2Fcomponent).
|
|
4766
|
-
|
|
4767
|
-
## Defining a Classic Component
|
|
4768
|
-
|
|
4769
|
-
If you want to customize the component in order to handle events, transform
|
|
4770
|
-
arguments or maintain internal state, you implement a subclass of `Component`.
|
|
4771
|
-
|
|
4772
|
-
One example is to add computed properties to your component:
|
|
4773
|
-
|
|
4774
|
-
```app/components/person-profile.js
|
|
4775
|
-
import Component from '@ember/component';
|
|
4776
|
-
|
|
4777
|
-
export default Component.extend({
|
|
4778
|
-
displayName: computed('person.title', 'person.firstName', 'person.lastName', function() {
|
|
4779
|
-
let { title, firstName, lastName } = this.person;
|
|
4780
|
-
|
|
4781
|
-
if (title) {
|
|
4782
|
-
return `${title} ${lastName}`;
|
|
4783
|
-
} else {
|
|
4784
|
-
return `${firstName} ${lastName}`;
|
|
4785
|
-
}
|
|
4786
|
-
})
|
|
4787
|
-
});
|
|
4788
|
-
```
|
|
4789
|
-
|
|
4790
|
-
And then use it in the component's template:
|
|
4791
|
-
|
|
4792
|
-
```app/templates/components/person-profile.hbs
|
|
4793
|
-
<h1>{{this.displayName}}</h1>
|
|
4794
|
-
{{yield}}
|
|
4795
|
-
```
|
|
4796
|
-
|
|
4797
|
-
## Customizing a Classic Component's HTML Element in JavaScript
|
|
4798
|
-
|
|
4799
|
-
### HTML Tag
|
|
4800
|
-
|
|
4801
|
-
The default HTML tag name used for a component's HTML representation is `div`.
|
|
4802
|
-
This can be customized by setting the `tagName` property.
|
|
4803
|
-
|
|
4804
|
-
Consider the following component class:
|
|
4805
|
-
|
|
4806
|
-
```app/components/emphasized-paragraph.js
|
|
4807
|
-
import Component from '@ember/component';
|
|
4808
|
-
|
|
4809
|
-
export default Component.extend({
|
|
4810
|
-
tagName: 'em'
|
|
4811
|
-
});
|
|
4812
|
-
```
|
|
4813
|
-
|
|
4814
|
-
When invoked, this component would produce output that looks something like
|
|
4815
|
-
this:
|
|
4816
|
-
|
|
4817
|
-
```html
|
|
4818
|
-
<em id="ember1" class="ember-view"></em>
|
|
4819
|
-
```
|
|
4820
|
-
|
|
4821
|
-
### HTML `class` Attribute
|
|
4822
|
-
|
|
4823
|
-
The HTML `class` attribute of a component's tag can be set by providing a
|
|
4824
|
-
`classNames` property that is set to an array of strings:
|
|
4825
|
-
|
|
4826
|
-
```app/components/my-widget.js
|
|
4827
|
-
import Component from '@ember/component';
|
|
4828
|
-
|
|
4829
|
-
export default Component.extend({
|
|
4830
|
-
classNames: ['my-class', 'my-other-class']
|
|
4831
|
-
});
|
|
4832
|
-
```
|
|
4833
|
-
|
|
4834
|
-
Invoking this component will produce output that looks like this:
|
|
4835
|
-
|
|
4836
|
-
```html
|
|
4837
|
-
<div id="ember1" class="ember-view my-class my-other-class"></div>
|
|
4838
|
-
```
|
|
4839
|
-
|
|
4840
|
-
`class` attribute values can also be set by providing a `classNameBindings`
|
|
4841
|
-
property set to an array of properties names for the component. The return
|
|
4842
|
-
value of these properties will be added as part of the value for the
|
|
4843
|
-
components's `class` attribute. These properties can be computed properties:
|
|
4844
|
-
|
|
4845
|
-
```app/components/my-widget.js
|
|
4846
|
-
import Component from '@ember/component';
|
|
4847
|
-
import { computed } from '@ember/object';
|
|
4848
|
-
|
|
4849
|
-
export default Component.extend({
|
|
4850
|
-
classNames: ['my-class', 'my-other-class'],
|
|
4851
|
-
classNameBindings: ['propertyA', 'propertyB'],
|
|
4852
|
-
|
|
4853
|
-
propertyA: 'from-a',
|
|
4854
|
-
propertyB: computed(function() {
|
|
4855
|
-
if (someLogic) { return 'from-b'; }
|
|
4856
|
-
})
|
|
4857
|
-
});
|
|
4858
|
-
```
|
|
4859
|
-
|
|
4860
|
-
Invoking this component will produce HTML that looks like:
|
|
4861
|
-
|
|
4862
|
-
```html
|
|
4863
|
-
<div id="ember1" class="ember-view my-class my-other-class from-a from-b"></div>
|
|
4864
|
-
```
|
|
4865
|
-
|
|
4866
|
-
Note that `classNames` and `classNameBindings` is in addition to the `class`
|
|
4867
|
-
attribute passed with the angle bracket invocation syntax. Therefore, if this
|
|
4868
|
-
component was invoked like so:
|
|
4869
|
-
|
|
4870
|
-
```handlebars
|
|
4871
|
-
<MyWidget class="from-invocation" />
|
|
4872
|
-
```
|
|
4873
|
-
|
|
4874
|
-
The resulting HTML will look similar to this:
|
|
4875
|
-
|
|
4876
|
-
```html
|
|
4877
|
-
<div id="ember1" class="from-invocation ember-view my-class my-other-class from-a from-b"></div>
|
|
4878
|
-
```
|
|
4879
|
-
|
|
4880
|
-
If the value of a class name binding returns a boolean the property name
|
|
4881
|
-
itself will be used as the class name if the property is true. The class name
|
|
4882
|
-
will not be added if the value is `false` or `undefined`.
|
|
4883
|
-
|
|
4884
|
-
```app/components/my-widget.js
|
|
4885
|
-
import Component from '@ember/component';
|
|
4886
|
-
|
|
4887
|
-
export default Component.extend({
|
|
4888
|
-
classNameBindings: ['hovered'],
|
|
4889
|
-
|
|
4890
|
-
hovered: true
|
|
4891
|
-
});
|
|
4892
|
-
```
|
|
4893
|
-
|
|
4894
|
-
Invoking this component will produce HTML that looks like:
|
|
4895
|
-
|
|
4896
|
-
```html
|
|
4897
|
-
<div id="ember1" class="ember-view hovered"></div>
|
|
4898
|
-
```
|
|
4899
|
-
|
|
4900
|
-
### Custom Class Names for Boolean Values
|
|
4901
|
-
|
|
4902
|
-
When using boolean class name bindings you can supply a string value other
|
|
4903
|
-
than the property name for use as the `class` HTML attribute by appending the
|
|
4904
|
-
preferred value after a ":" character when defining the binding:
|
|
4905
|
-
|
|
4906
|
-
```app/components/my-widget.js
|
|
4907
|
-
import Component from '@ember/component';
|
|
4908
|
-
|
|
4909
|
-
export default Component.extend({
|
|
4910
|
-
classNameBindings: ['awesome:so-very-cool'],
|
|
4911
|
-
|
|
4912
|
-
awesome: true
|
|
4913
|
-
});
|
|
4914
|
-
```
|
|
4915
|
-
|
|
4916
|
-
Invoking this component will produce HTML that looks like:
|
|
4917
|
-
|
|
4918
|
-
```html
|
|
4919
|
-
<div id="ember1" class="ember-view so-very-cool"></div>
|
|
4920
|
-
```
|
|
4921
|
-
|
|
4922
|
-
Boolean value class name bindings whose property names are in a
|
|
4923
|
-
camelCase-style format will be converted to a dasherized format:
|
|
4924
|
-
|
|
4925
|
-
```app/components/my-widget.js
|
|
4926
|
-
import Component from '@ember/component';
|
|
4927
|
-
|
|
4928
|
-
export default Component.extend({
|
|
4929
|
-
classNameBindings: ['isUrgent'],
|
|
4930
|
-
|
|
4931
|
-
isUrgent: true
|
|
4932
|
-
});
|
|
4933
|
-
```
|
|
4934
|
-
|
|
4935
|
-
Invoking this component will produce HTML that looks like:
|
|
4936
|
-
|
|
4937
|
-
```html
|
|
4938
|
-
<div id="ember1" class="ember-view is-urgent"></div>
|
|
4939
|
-
```
|
|
4940
|
-
|
|
4941
|
-
Class name bindings can also refer to object values that are found by
|
|
4942
|
-
traversing a path relative to the component itself:
|
|
4943
|
-
|
|
4944
|
-
```app/components/my-widget.js
|
|
4945
|
-
import Component from '@ember/component';
|
|
4946
|
-
import EmberObject from '@ember/object';
|
|
4947
|
-
|
|
4948
|
-
export default Component.extend({
|
|
4949
|
-
classNameBindings: ['messages.empty'],
|
|
4950
|
-
|
|
4951
|
-
messages: EmberObject.create({
|
|
4952
|
-
empty: true
|
|
4953
|
-
})
|
|
4954
|
-
});
|
|
4955
|
-
```
|
|
4956
|
-
|
|
4957
|
-
Invoking this component will produce HTML that looks like:
|
|
4958
|
-
|
|
4959
|
-
```html
|
|
4960
|
-
<div id="ember1" class="ember-view empty"></div>
|
|
4961
|
-
```
|
|
4962
|
-
|
|
4963
|
-
If you want to add a class name for a property which evaluates to true and
|
|
4964
|
-
and a different class name if it evaluates to false, you can pass a binding
|
|
4965
|
-
like this:
|
|
4966
|
-
|
|
4967
|
-
```app/components/my-widget.js
|
|
4968
|
-
import Component from '@ember/component';
|
|
4969
|
-
|
|
4970
|
-
export default Component.extend({
|
|
4971
|
-
classNameBindings: ['isEnabled:enabled:disabled'],
|
|
4972
|
-
isEnabled: true
|
|
4973
|
-
});
|
|
4974
|
-
```
|
|
4975
|
-
|
|
4976
|
-
Invoking this component will produce HTML that looks like:
|
|
4977
|
-
|
|
4978
|
-
```html
|
|
4979
|
-
<div id="ember1" class="ember-view enabled"></div>
|
|
4980
|
-
```
|
|
4981
|
-
|
|
4982
|
-
When isEnabled is `false`, the resulting HTML representation looks like this:
|
|
4983
|
-
|
|
4984
|
-
```html
|
|
4985
|
-
<div id="ember1" class="ember-view disabled"></div>
|
|
4986
|
-
```
|
|
4987
|
-
|
|
4988
|
-
This syntax offers the convenience to add a class if a property is `false`:
|
|
4989
|
-
|
|
4990
|
-
```app/components/my-widget.js
|
|
4991
|
-
import Component from '@ember/component';
|
|
4992
|
-
|
|
4993
|
-
// Applies no class when isEnabled is true and class 'disabled' when isEnabled is false
|
|
4994
|
-
export default Component.extend({
|
|
4995
|
-
classNameBindings: ['isEnabled::disabled'],
|
|
4996
|
-
isEnabled: true
|
|
4997
|
-
});
|
|
4998
|
-
```
|
|
4999
|
-
|
|
5000
|
-
Invoking this component when the `isEnabled` property is true will produce
|
|
5001
|
-
HTML that looks like:
|
|
5002
|
-
|
|
5003
|
-
```html
|
|
5004
|
-
<div id="ember1" class="ember-view"></div>
|
|
5005
|
-
```
|
|
5006
|
-
|
|
5007
|
-
Invoking it when the `isEnabled` property on the component is `false` will
|
|
5008
|
-
produce HTML that looks like:
|
|
5009
|
-
|
|
5010
|
-
```html
|
|
5011
|
-
<div id="ember1" class="ember-view disabled"></div>
|
|
5012
|
-
```
|
|
5013
|
-
|
|
5014
|
-
Updates to the value of a class name binding will result in automatic update
|
|
5015
|
-
of the HTML `class` attribute in the component's rendered HTML
|
|
5016
|
-
representation. If the value becomes `false` or `undefined` the class name
|
|
5017
|
-
will be removed.
|
|
5018
|
-
|
|
5019
|
-
Both `classNames` and `classNameBindings` are concatenated properties. See
|
|
5020
|
-
[EmberObject](/ember/release/classes/EmberObject) documentation for more
|
|
5021
|
-
information about concatenated properties.
|
|
5022
|
-
|
|
5023
|
-
### Other HTML Attributes
|
|
5024
|
-
|
|
5025
|
-
The HTML attribute section of a component's tag can be set by providing an
|
|
5026
|
-
`attributeBindings` property set to an array of property names on the component.
|
|
5027
|
-
The return value of these properties will be used as the value of the component's
|
|
5028
|
-
HTML associated attribute:
|
|
5029
|
-
|
|
5030
|
-
```app/components/my-anchor.js
|
|
5031
|
-
import Component from '@ember/component';
|
|
5032
|
-
|
|
5033
|
-
export default Component.extend({
|
|
5034
|
-
tagName: 'a',
|
|
5035
|
-
attributeBindings: ['href'],
|
|
5036
|
-
|
|
5037
|
-
href: 'http://google.com'
|
|
5038
|
-
});
|
|
5039
|
-
```
|
|
5040
|
-
|
|
5041
|
-
Invoking this component will produce HTML that looks like:
|
|
5042
|
-
|
|
5043
|
-
```html
|
|
5044
|
-
<a id="ember1" class="ember-view" href="http://google.com"></a>
|
|
5045
|
-
```
|
|
5046
|
-
|
|
5047
|
-
One property can be mapped on to another by placing a ":" between
|
|
5048
|
-
the source property and the destination property:
|
|
5049
|
-
|
|
5050
|
-
```app/components/my-anchor.js
|
|
5051
|
-
import Component from '@ember/component';
|
|
5052
|
-
|
|
5053
|
-
export default Component.extend({
|
|
5054
|
-
tagName: 'a',
|
|
5055
|
-
attributeBindings: ['url:href'],
|
|
5056
|
-
|
|
5057
|
-
url: 'http://google.com'
|
|
5058
|
-
});
|
|
5059
|
-
```
|
|
5060
|
-
|
|
5061
|
-
Invoking this component will produce HTML that looks like:
|
|
5062
|
-
|
|
5063
|
-
```html
|
|
5064
|
-
<a id="ember1" class="ember-view" href="http://google.com"></a>
|
|
5065
|
-
```
|
|
5066
|
-
|
|
5067
|
-
HTML attributes passed with angle bracket invocations will take precedence
|
|
5068
|
-
over those specified in `attributeBindings`. Therefore, if this component was
|
|
5069
|
-
invoked like so:
|
|
5070
|
-
|
|
5071
|
-
```handlebars
|
|
5072
|
-
<MyAnchor href="http://bing.com" @url="http://google.com" />
|
|
5073
|
-
```
|
|
5074
|
-
|
|
5075
|
-
The resulting HTML will looks like this:
|
|
5076
|
-
|
|
5077
|
-
```html
|
|
5078
|
-
<a id="ember1" class="ember-view" href="http://bing.com"></a>
|
|
5079
|
-
```
|
|
5080
|
-
|
|
5081
|
-
Note that the `href` attribute is ultimately set to `http://bing.com`,
|
|
5082
|
-
despite it having attribute binidng to the `url` property, which was
|
|
5083
|
-
set to `http://google.com`.
|
|
5084
|
-
|
|
5085
|
-
Namespaced attributes (e.g. `xlink:href`) are supported, but have to be
|
|
5086
|
-
mapped, since `:` is not a valid character for properties in Javascript:
|
|
5087
|
-
|
|
5088
|
-
```app/components/my-use.js
|
|
5089
|
-
import Component from '@ember/component';
|
|
5090
|
-
|
|
5091
|
-
export default Component.extend({
|
|
5092
|
-
tagName: 'use',
|
|
5093
|
-
attributeBindings: ['xlinkHref:xlink:href'],
|
|
5094
|
-
|
|
5095
|
-
xlinkHref: '#triangle'
|
|
5096
|
-
});
|
|
5097
|
-
```
|
|
5098
|
-
|
|
5099
|
-
Invoking this component will produce HTML that looks like:
|
|
5100
|
-
|
|
5101
|
-
```html
|
|
5102
|
-
<use xlink:href="#triangle"></use>
|
|
5103
|
-
```
|
|
5104
|
-
|
|
5105
|
-
If the value of a property monitored by `attributeBindings` is a boolean, the
|
|
5106
|
-
attribute will be present or absent depending on the value:
|
|
5107
|
-
|
|
5108
|
-
```app/components/my-text-input.js
|
|
5109
|
-
import Component from '@ember/component';
|
|
5110
|
-
|
|
5111
|
-
export default Component.extend({
|
|
5112
|
-
tagName: 'input',
|
|
5113
|
-
attributeBindings: ['disabled'],
|
|
5114
|
-
|
|
5115
|
-
disabled: false
|
|
5116
|
-
});
|
|
5117
|
-
```
|
|
5118
|
-
|
|
5119
|
-
Invoking this component will produce HTML that looks like:
|
|
5120
|
-
|
|
5121
|
-
```html
|
|
5122
|
-
<input id="ember1" class="ember-view" />
|
|
5123
|
-
```
|
|
5124
|
-
|
|
5125
|
-
`attributeBindings` can refer to computed properties:
|
|
5126
|
-
|
|
5127
|
-
```app/components/my-text-input.js
|
|
5128
|
-
import Component from '@ember/component';
|
|
5129
|
-
import { computed } from '@ember/object';
|
|
5130
|
-
|
|
5131
|
-
export default Component.extend({
|
|
5132
|
-
tagName: 'input',
|
|
5133
|
-
attributeBindings: ['disabled'],
|
|
5134
|
-
|
|
5135
|
-
disabled: computed(function() {
|
|
5136
|
-
if (someLogic) {
|
|
5137
|
-
return true;
|
|
5138
|
-
} else {
|
|
5139
|
-
return false;
|
|
5140
|
-
}
|
|
5141
|
-
})
|
|
5142
|
-
});
|
|
5143
|
-
```
|
|
5144
|
-
|
|
5145
|
-
To prevent setting an attribute altogether, use `null` or `undefined` as the
|
|
5146
|
-
value of the property used in `attributeBindings`:
|
|
5147
|
-
|
|
5148
|
-
```app/components/my-text-input.js
|
|
5149
|
-
import Component from '@ember/component';
|
|
5150
|
-
|
|
5151
|
-
export default Component.extend({
|
|
5152
|
-
tagName: 'form',
|
|
5153
|
-
attributeBindings: ['novalidate'],
|
|
5154
|
-
novalidate: null
|
|
5155
|
-
});
|
|
5156
|
-
```
|
|
5157
|
-
|
|
5158
|
-
Updates to the property of an attribute binding will result in automatic
|
|
5159
|
-
update of the HTML attribute in the component's HTML output.
|
|
5160
|
-
|
|
5161
|
-
`attributeBindings` is a concatenated property. See
|
|
5162
|
-
[EmberObject](/ember/release/classes/EmberObject) documentation for more
|
|
5163
|
-
information about concatenated properties.
|
|
5164
|
-
|
|
5165
|
-
## Layouts
|
|
5166
|
-
|
|
5167
|
-
The `layout` property can be used to dynamically specify a template associated
|
|
5168
|
-
with a component class, instead of relying on Ember to link together a
|
|
5169
|
-
component class and a template based on file names.
|
|
5170
|
-
|
|
5171
|
-
In general, applications should not use this feature, but it's commonly used
|
|
5172
|
-
in addons for historical reasons.
|
|
5173
|
-
|
|
5174
|
-
The `layout` property should be set to the default export of a template
|
|
5175
|
-
module, which is the name of a template file without the `.hbs` extension.
|
|
5176
|
-
|
|
5177
|
-
```app/templates/components/person-profile.hbs
|
|
5178
|
-
<h1>Person's Title</h1>
|
|
5179
|
-
<div class='details'>{{yield}}</div>
|
|
5180
|
-
```
|
|
5181
|
-
|
|
5182
|
-
```app/components/person-profile.js
|
|
5183
|
-
import Component from '@ember/component';
|
|
5184
|
-
import layout from '../templates/components/person-profile';
|
|
5185
|
-
|
|
5186
|
-
export default Component.extend({
|
|
5187
|
-
layout
|
|
5188
|
-
});
|
|
5189
|
-
```
|
|
5190
|
-
|
|
5191
|
-
If you invoke the component:
|
|
5192
|
-
|
|
5193
|
-
```handlebars
|
|
5194
|
-
<PersonProfile>
|
|
5195
|
-
<h2>Chief Basket Weaver</h2>
|
|
5196
|
-
<h3>Fisherman Industries</h3>
|
|
5197
|
-
</PersonProfile>
|
|
5198
|
-
```
|
|
5199
|
-
|
|
5200
|
-
or
|
|
5201
|
-
|
|
5202
|
-
```handlebars
|
|
5203
|
-
{{#person-profile}}
|
|
5204
|
-
<h2>Chief Basket Weaver</h2>
|
|
5205
|
-
<h3>Fisherman Industries</h3>
|
|
5206
|
-
{{/person-profile}}
|
|
5207
|
-
```
|
|
5208
|
-
|
|
5209
|
-
It will result in the following HTML output:
|
|
5210
|
-
|
|
5211
|
-
```html
|
|
5212
|
-
<h1>Person's Title</h1>
|
|
5213
|
-
<div class="details">
|
|
5214
|
-
<h2>Chief Basket Weaver</h2>
|
|
5215
|
-
<h3>Fisherman Industries</h3>
|
|
5216
|
-
</div>
|
|
5217
|
-
```
|
|
5218
|
-
|
|
5219
|
-
## Handling Browser Events
|
|
5220
|
-
|
|
5221
|
-
Components can respond to user-initiated events in one of three ways: passing
|
|
5222
|
-
actions with angle bracket invocation, adding event handler methods to the
|
|
5223
|
-
component's class, or adding actions to the component's template.
|
|
5224
|
-
|
|
5225
|
-
### Passing Actions With Angle Bracket Invocation
|
|
5226
|
-
|
|
5227
|
-
For one-off events specific to particular instance of a component, it is possible
|
|
5228
|
-
to pass actions to the component's element using angle bracket invocation syntax.
|
|
5229
|
-
|
|
5230
|
-
```handlebars
|
|
5231
|
-
<MyWidget {{action 'firstWidgetClicked'}} />
|
|
5232
|
-
|
|
5233
|
-
<MyWidget {{action 'secondWidgetClicked'}} />
|
|
5234
|
-
```
|
|
5235
|
-
|
|
5236
|
-
In this case, when the first component is clicked on, Ember will invoke the
|
|
5237
|
-
`firstWidgetClicked` action. When the second component is clicked on, Ember
|
|
5238
|
-
will invoke the `secondWidgetClicked` action instead.
|
|
5239
|
-
|
|
5240
|
-
Besides `{{action}}`, it is also possible to pass any arbitrary element modifiers
|
|
5241
|
-
using the angle bracket invocation syntax.
|
|
5242
|
-
|
|
5243
|
-
### Event Handler Methods
|
|
5244
|
-
|
|
5245
|
-
Components can also respond to user-initiated events by implementing a method
|
|
5246
|
-
that matches the event name. This approach is appropriate when the same event
|
|
5247
|
-
should be handled by all instances of the same component.
|
|
5248
|
-
|
|
5249
|
-
An event object will be passed as the argument to the event handler method.
|
|
5250
|
-
|
|
5251
|
-
```app/components/my-widget.js
|
|
5252
|
-
import Component from '@ember/component';
|
|
5253
|
-
|
|
5254
|
-
export default Component.extend({
|
|
5255
|
-
click(event) {
|
|
5256
|
-
// `event.target` is either the component's element or one of its children
|
|
5257
|
-
let tag = event.target.tagName.toLowerCase();
|
|
5258
|
-
console.log('clicked on a `<${tag}>` HTML element!');
|
|
5259
|
-
}
|
|
5260
|
-
});
|
|
5261
|
-
```
|
|
5262
|
-
|
|
5263
|
-
In this example, whenever the user clicked anywhere inside the component, it
|
|
5264
|
-
will log a message to the console.
|
|
5265
|
-
|
|
5266
|
-
It is possible to handle event types other than `click` by implementing the
|
|
5267
|
-
following event handler methods. In addition, custom events can be registered
|
|
5268
|
-
by using `Application.customEvents`.
|
|
5269
|
-
|
|
5270
|
-
Touch events:
|
|
5271
|
-
|
|
5272
|
-
* `touchStart`
|
|
5273
|
-
* `touchMove`
|
|
5274
|
-
* `touchEnd`
|
|
5275
|
-
* `touchCancel`
|
|
5276
|
-
|
|
5277
|
-
Keyboard events:
|
|
5278
|
-
|
|
5279
|
-
* `keyDown`
|
|
5280
|
-
* `keyUp`
|
|
5281
|
-
* `keyPress`
|
|
5282
|
-
|
|
5283
|
-
Mouse events:
|
|
5284
|
-
|
|
5285
|
-
* `mouseDown`
|
|
5286
|
-
* `mouseUp`
|
|
5287
|
-
* `contextMenu`
|
|
5288
|
-
* `click`
|
|
5289
|
-
* `doubleClick`
|
|
5290
|
-
* `focusIn`
|
|
5291
|
-
* `focusOut`
|
|
5292
|
-
|
|
5293
|
-
Form events:
|
|
5294
|
-
|
|
5295
|
-
* `submit`
|
|
5296
|
-
* `change`
|
|
5297
|
-
* `focusIn`
|
|
5298
|
-
* `focusOut`
|
|
5299
|
-
* `input`
|
|
5300
|
-
|
|
5301
|
-
Drag and drop events:
|
|
5302
|
-
|
|
5303
|
-
* `dragStart`
|
|
5304
|
-
* `drag`
|
|
5305
|
-
* `dragEnter`
|
|
5306
|
-
* `dragLeave`
|
|
5307
|
-
* `dragOver`
|
|
5308
|
-
* `dragEnd`
|
|
5309
|
-
* `drop`
|
|
5310
|
-
|
|
5311
|
-
### `{{action}}` Helper
|
|
5312
|
-
|
|
5313
|
-
Instead of handling all events of a particular type anywhere inside the
|
|
5314
|
-
component's element, you may instead want to limit it to a particular
|
|
5315
|
-
element in the component's template. In this case, it would be more
|
|
5316
|
-
convenient to implement an action instead.
|
|
5317
|
-
|
|
5318
|
-
For example, you could implement the action `hello` for the `person-profile`
|
|
5319
|
-
component:
|
|
5320
|
-
|
|
5321
|
-
```app/components/person-profile.js
|
|
5322
|
-
import Component from '@ember/component';
|
|
5323
|
-
|
|
5324
|
-
export default Component.extend({
|
|
5325
|
-
actions: {
|
|
5326
|
-
hello(name) {
|
|
5327
|
-
console.log("Hello", name);
|
|
5328
|
-
}
|
|
5329
|
-
}
|
|
5330
|
-
});
|
|
5331
|
-
```
|
|
5332
|
-
|
|
5333
|
-
And then use it in the component's template:
|
|
5334
|
-
|
|
5335
|
-
```app/templates/components/person-profile.hbs
|
|
5336
|
-
<h1>{{@person.name}}</h1>
|
|
5337
|
-
|
|
5338
|
-
<button {{action 'hello' @person.name}}>
|
|
5339
|
-
Say Hello to {{@person.name}}
|
|
5340
|
-
</button>
|
|
5341
|
-
```
|
|
5342
|
-
|
|
5343
|
-
When the user clicks the button, Ember will invoke the `hello` action,
|
|
5344
|
-
passing in the current value of `@person.name` as an argument.
|
|
5345
|
-
|
|
5346
|
-
See [Ember.Templates.helpers.action](/ember/release/classes/Ember.Templates.helpers/methods/action?anchor=action).
|
|
5347
|
-
|
|
5348
|
-
@class Component
|
|
5349
|
-
@extends Ember.CoreView
|
|
5350
|
-
@uses Ember.TargetActionSupport
|
|
5351
|
-
@uses Ember.ClassNamesSupport
|
|
5352
|
-
@uses Ember.ActionSupport
|
|
5353
|
-
@uses Ember.ViewMixin
|
|
5354
|
-
@uses Ember.ViewStateSupport
|
|
5355
|
-
@public
|
|
5356
|
-
*/
|
|
5357
4714
|
|
|
5358
4715
|
var Component = _views.CoreView.extend(_views.ChildViewsSupport, _views.ViewStateSupport, _views.ClassNamesSupport, _runtime2.TargetActionSupport, _views.ActionSupport, _views.ViewMixin, {
|
|
5359
4716
|
isComponent: true,
|
|
@@ -5663,23 +5020,6 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
5663
5020
|
@since 1.13.0
|
|
5664
5021
|
*/
|
|
5665
5022
|
|
|
5666
|
-
/**
|
|
5667
|
-
Layout can be used to wrap content in a component.
|
|
5668
|
-
@property layout
|
|
5669
|
-
@type Function
|
|
5670
|
-
@public
|
|
5671
|
-
*/
|
|
5672
|
-
|
|
5673
|
-
/**
|
|
5674
|
-
The name of the layout to lookup if no layout is provided.
|
|
5675
|
-
By default `Component` will lookup a template with this name in
|
|
5676
|
-
`Ember.TEMPLATES` (a shared global object).
|
|
5677
|
-
@property layoutName
|
|
5678
|
-
@type String
|
|
5679
|
-
@default null
|
|
5680
|
-
@private
|
|
5681
|
-
*/
|
|
5682
|
-
|
|
5683
5023
|
/**
|
|
5684
5024
|
The HTML `id` of the component's element in the DOM. You can provide this
|
|
5685
5025
|
value yourself but it must be unique (just as in HTML):
|
|
@@ -6740,7 +6080,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
6740
6080
|
},
|
|
6741
6081
|
|
|
6742
6082
|
warnIfStyleNotTrusted(value) {
|
|
6743
|
-
(true && (0, _debug.warn)((0, _views.constructStyleDeprecationMessage)(value), (() => {
|
|
6083
|
+
(true && (0, _debug.warn)((0, _views.constructStyleDeprecationMessage)(String(value)), (() => {
|
|
6744
6084
|
if (value === null || value === undefined || isHTMLSafe$1(value)) {
|
|
6745
6085
|
return true;
|
|
6746
6086
|
}
|
|
@@ -6836,9 +6176,9 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
6836
6176
|
} = _ref12;
|
|
6837
6177
|
var nameOrValueRef = positional[0];
|
|
6838
6178
|
(true && !(positional.length === 1 && nameOrValueRef) && (0, _debug.assert)(`[BUG] wrong number of positional arguments, expecting 1, got ${positional.length}`, positional.length === 1 && nameOrValueRef));
|
|
6839
|
-
var typeRef = named
|
|
6840
|
-
var locRef = named
|
|
6841
|
-
var originalRef = named
|
|
6179
|
+
var typeRef = named['type'];
|
|
6180
|
+
var locRef = named['loc'];
|
|
6181
|
+
var originalRef = named['original'];
|
|
6842
6182
|
(true && !(typeRef) && (0, _debug.assert)(`[BUG] expecting \`type\` named argument`, typeRef));
|
|
6843
6183
|
(true && !(locRef) && (0, _debug.assert)(`[BUG] expecting \`loc\` named argument`, locRef));
|
|
6844
6184
|
(true && !(originalRef) && (0, _debug.assert)(`[BUG] expecting \`original\` named argument`, originalRef)); // Bug: why do these fail?
|
|
@@ -7218,6 +6558,26 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
7218
6558
|
(true && !(positional.length === 1 && Object.keys(named).length === 0) && (0, _debug.assert)('unbound helper cannot be called with multiple params or hash params', positional.length === 1 && Object.keys(named).length === 0));
|
|
7219
6559
|
return (0, _reference.createUnboundRef)((0, _reference.valueForRef)(positional[0]), '(result of an `unbound` helper)');
|
|
7220
6560
|
});
|
|
6561
|
+
/**
|
|
6562
|
+
@module ember
|
|
6563
|
+
*/
|
|
6564
|
+
|
|
6565
|
+
var uniqueId = internalHelper(() => {
|
|
6566
|
+
return (0, _reference.createConstRef)(uniqueId$1(), 'unique-id');
|
|
6567
|
+
}); // From https://gist.github.com/selfish/fef2c0ba6cdfe07af76e64cecd74888b
|
|
6568
|
+
//
|
|
6569
|
+
// This code should be reasonably fast, and provide a unique value every time
|
|
6570
|
+
// it's called, which is what we need here. It produces a string formatted as a
|
|
6571
|
+
// standard UUID, which avoids accidentally turning Ember-specific
|
|
6572
|
+
// implementation details into an intimate API.
|
|
6573
|
+
|
|
6574
|
+
function uniqueId$1() {
|
|
6575
|
+
// @ts-expect-error this one-liner abuses weird JavaScript semantics that
|
|
6576
|
+
// TypeScript (legitimately) doesn't like, but they're nonetheless valid and
|
|
6577
|
+
// specced.
|
|
6578
|
+
return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, a => (a ^ Math.random() * 16 >> a / 4).toString(16));
|
|
6579
|
+
}
|
|
6580
|
+
|
|
7221
6581
|
var MODIFIERS = ['alt', 'shift', 'meta', 'ctrl'];
|
|
7222
6582
|
var POINTER_EVENT_TYPE_REGEX = /^click|mouse|touch/;
|
|
7223
6583
|
|
|
@@ -7735,7 +7095,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
7735
7095
|
var outletRef = (0, _reference.createComputeRef)(() => {
|
|
7736
7096
|
var state = (0, _reference.valueForRef)(scope.get('outletState'));
|
|
7737
7097
|
var outlets = state !== undefined ? state.outlets : undefined;
|
|
7738
|
-
return outlets !== undefined ? outlets
|
|
7098
|
+
return outlets !== undefined ? outlets['main'] : undefined;
|
|
7739
7099
|
});
|
|
7740
7100
|
var lastState = null;
|
|
7741
7101
|
var definition = null;
|
|
@@ -7760,7 +7120,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
7760
7120
|
// provide the correct updated value. So we stop updating and return
|
|
7761
7121
|
// the _last_ model value for that outlet.
|
|
7762
7122
|
|
|
7763
|
-
named
|
|
7123
|
+
named['model'] = (0, _reference.createComputeRef)(() => {
|
|
7764
7124
|
if (lastState === state) {
|
|
7765
7125
|
model = (0, _reference.valueForRef)(modelRef);
|
|
7766
7126
|
}
|
|
@@ -7771,7 +7131,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
7771
7131
|
if (true
|
|
7772
7132
|
/* DEBUG */
|
|
7773
7133
|
) {
|
|
7774
|
-
named
|
|
7134
|
+
named['model'] = (0, _reference.createDebugAliasRef)('@model', named['model']);
|
|
7775
7135
|
}
|
|
7776
7136
|
|
|
7777
7137
|
var args = (0, _runtime.createCapturedArgs)(named, _runtime.EMPTY_POSITIONAL);
|
|
@@ -7901,6 +7261,9 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
7901
7261
|
get: _runtime.get,
|
|
7902
7262
|
hash: _runtime.hash
|
|
7903
7263
|
});
|
|
7264
|
+
{
|
|
7265
|
+
BUILTIN_HELPERS['unique-id'] = uniqueId;
|
|
7266
|
+
}
|
|
7904
7267
|
var BUILTIN_KEYWORD_MODIFIERS = {
|
|
7905
7268
|
action: actionModifier
|
|
7906
7269
|
};
|
|
@@ -8057,6 +7420,107 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
8057
7420
|
|
|
8058
7421
|
}
|
|
8059
7422
|
|
|
7423
|
+
var TOP_LEVEL_NAME = '-top-level';
|
|
7424
|
+
var TOP_LEVEL_OUTLET = 'main';
|
|
7425
|
+
|
|
7426
|
+
class OutletView {
|
|
7427
|
+
constructor(_environment, owner, template, namespace) {
|
|
7428
|
+
this._environment = _environment;
|
|
7429
|
+
this.owner = owner;
|
|
7430
|
+
this.template = template;
|
|
7431
|
+
this.namespace = namespace;
|
|
7432
|
+
var outletStateTag = (0, _validator.createTag)();
|
|
7433
|
+
var outletState = {
|
|
7434
|
+
outlets: {
|
|
7435
|
+
main: undefined
|
|
7436
|
+
},
|
|
7437
|
+
render: {
|
|
7438
|
+
owner: owner,
|
|
7439
|
+
into: undefined,
|
|
7440
|
+
outlet: TOP_LEVEL_OUTLET,
|
|
7441
|
+
name: TOP_LEVEL_NAME,
|
|
7442
|
+
controller: undefined,
|
|
7443
|
+
model: undefined,
|
|
7444
|
+
template
|
|
7445
|
+
}
|
|
7446
|
+
};
|
|
7447
|
+
var ref = this.ref = (0, _reference.createComputeRef)(() => {
|
|
7448
|
+
(0, _validator.consumeTag)(outletStateTag);
|
|
7449
|
+
return outletState;
|
|
7450
|
+
}, state => {
|
|
7451
|
+
(0, _validator.dirtyTag)(outletStateTag);
|
|
7452
|
+
outletState.outlets['main'] = state;
|
|
7453
|
+
});
|
|
7454
|
+
this.state = {
|
|
7455
|
+
ref,
|
|
7456
|
+
name: TOP_LEVEL_NAME,
|
|
7457
|
+
outlet: TOP_LEVEL_OUTLET,
|
|
7458
|
+
template,
|
|
7459
|
+
controller: undefined,
|
|
7460
|
+
model: undefined
|
|
7461
|
+
};
|
|
7462
|
+
}
|
|
7463
|
+
|
|
7464
|
+
static extend(injections) {
|
|
7465
|
+
return class extends OutletView {
|
|
7466
|
+
static create(options) {
|
|
7467
|
+
if (options) {
|
|
7468
|
+
return super.create(Object.assign({}, injections, options));
|
|
7469
|
+
} else {
|
|
7470
|
+
return super.create(injections);
|
|
7471
|
+
}
|
|
7472
|
+
}
|
|
7473
|
+
|
|
7474
|
+
};
|
|
7475
|
+
}
|
|
7476
|
+
|
|
7477
|
+
static reopenClass(injections) {
|
|
7478
|
+
Object.assign(this, injections);
|
|
7479
|
+
}
|
|
7480
|
+
|
|
7481
|
+
static create(options) {
|
|
7482
|
+
var {
|
|
7483
|
+
environment: _environment,
|
|
7484
|
+
application: namespace,
|
|
7485
|
+
template: templateFactory$$1
|
|
7486
|
+
} = options;
|
|
7487
|
+
var owner = (0, _owner2.getOwner)(options);
|
|
7488
|
+
(true && !(owner) && (0, _debug.assert)('OutletView is unexpectedly missing an owner', owner));
|
|
7489
|
+
var template = templateFactory$$1(owner);
|
|
7490
|
+
return new OutletView(_environment, owner, template, namespace);
|
|
7491
|
+
}
|
|
7492
|
+
|
|
7493
|
+
appendTo(selector) {
|
|
7494
|
+
var target;
|
|
7495
|
+
|
|
7496
|
+
if (this._environment.hasDOM) {
|
|
7497
|
+
target = typeof selector === 'string' ? document.querySelector(selector) : selector;
|
|
7498
|
+
} else {
|
|
7499
|
+
target = selector;
|
|
7500
|
+
}
|
|
7501
|
+
|
|
7502
|
+
var renderer = this.owner.lookup('renderer:-dom'); // SAFETY: It's not clear that this cast is safe.
|
|
7503
|
+
// The types for appendOutletView may be incorrect or this is a potential bug.
|
|
7504
|
+
|
|
7505
|
+
(0, _runloop.schedule)('render', renderer, 'appendOutletView', this, target);
|
|
7506
|
+
}
|
|
7507
|
+
|
|
7508
|
+
rerender() {
|
|
7509
|
+
/**/
|
|
7510
|
+
}
|
|
7511
|
+
|
|
7512
|
+
setOutletState(state) {
|
|
7513
|
+
(0, _reference.updateRef)(this.ref, state);
|
|
7514
|
+
}
|
|
7515
|
+
|
|
7516
|
+
destroy() {
|
|
7517
|
+
/**/
|
|
7518
|
+
}
|
|
7519
|
+
|
|
7520
|
+
}
|
|
7521
|
+
|
|
7522
|
+
_exports.OutletView = OutletView;
|
|
7523
|
+
|
|
8060
7524
|
class DynamicScope {
|
|
8061
7525
|
constructor(view, outletState) {
|
|
8062
7526
|
this.view = view;
|
|
@@ -8114,7 +7578,7 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
8114
7578
|
this.root = root;
|
|
8115
7579
|
this.runtime = runtime;
|
|
8116
7580
|
(true && !(template !== undefined) && (0, _debug.assert)(`You cannot render \`${(0, _reference.valueForRef)(self)}\` without a template.`, template !== undefined));
|
|
8117
|
-
this.id = (0, _views.getViewId)(root);
|
|
7581
|
+
this.id = root instanceof OutletView ? (0, _utils.guidFor)(root) : (0, _views.getViewId)(root);
|
|
8118
7582
|
this.result = undefined;
|
|
8119
7583
|
this.destroyed = false;
|
|
8120
7584
|
this.render = errorLoopTransaction(() => {
|
|
@@ -8556,104 +8020,6 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
8556
8020
|
"moduleName": "packages/@ember/-internals/glimmer/lib/templates/outlet.hbs",
|
|
8557
8021
|
"isStrictMode": false
|
|
8558
8022
|
});
|
|
8559
|
-
var TOP_LEVEL_NAME = '-top-level';
|
|
8560
|
-
var TOP_LEVEL_OUTLET = 'main';
|
|
8561
|
-
|
|
8562
|
-
class OutletView {
|
|
8563
|
-
constructor(_environment, owner, template, namespace) {
|
|
8564
|
-
this._environment = _environment;
|
|
8565
|
-
this.owner = owner;
|
|
8566
|
-
this.template = template;
|
|
8567
|
-
this.namespace = namespace;
|
|
8568
|
-
var outletStateTag = (0, _validator.createTag)();
|
|
8569
|
-
var outletState = {
|
|
8570
|
-
outlets: {
|
|
8571
|
-
main: undefined
|
|
8572
|
-
},
|
|
8573
|
-
render: {
|
|
8574
|
-
owner: owner,
|
|
8575
|
-
into: undefined,
|
|
8576
|
-
outlet: TOP_LEVEL_OUTLET,
|
|
8577
|
-
name: TOP_LEVEL_NAME,
|
|
8578
|
-
controller: undefined,
|
|
8579
|
-
model: undefined,
|
|
8580
|
-
template
|
|
8581
|
-
}
|
|
8582
|
-
};
|
|
8583
|
-
var ref = this.ref = (0, _reference.createComputeRef)(() => {
|
|
8584
|
-
(0, _validator.consumeTag)(outletStateTag);
|
|
8585
|
-
return outletState;
|
|
8586
|
-
}, state => {
|
|
8587
|
-
(0, _validator.dirtyTag)(outletStateTag);
|
|
8588
|
-
outletState.outlets.main = state;
|
|
8589
|
-
});
|
|
8590
|
-
this.state = {
|
|
8591
|
-
ref,
|
|
8592
|
-
name: TOP_LEVEL_NAME,
|
|
8593
|
-
outlet: TOP_LEVEL_OUTLET,
|
|
8594
|
-
template,
|
|
8595
|
-
controller: undefined,
|
|
8596
|
-
model: undefined
|
|
8597
|
-
};
|
|
8598
|
-
}
|
|
8599
|
-
|
|
8600
|
-
static extend(injections) {
|
|
8601
|
-
return class extends OutletView {
|
|
8602
|
-
static create(options) {
|
|
8603
|
-
if (options) {
|
|
8604
|
-
return super.create(Object.assign({}, injections, options));
|
|
8605
|
-
} else {
|
|
8606
|
-
return super.create(injections);
|
|
8607
|
-
}
|
|
8608
|
-
}
|
|
8609
|
-
|
|
8610
|
-
};
|
|
8611
|
-
}
|
|
8612
|
-
|
|
8613
|
-
static reopenClass(injections) {
|
|
8614
|
-
Object.assign(this, injections);
|
|
8615
|
-
}
|
|
8616
|
-
|
|
8617
|
-
static create(options) {
|
|
8618
|
-
var {
|
|
8619
|
-
environment: _environment,
|
|
8620
|
-
application: namespace,
|
|
8621
|
-
template: templateFactory$$1
|
|
8622
|
-
} = options;
|
|
8623
|
-
var owner = (0, _owner2.getOwner)(options);
|
|
8624
|
-
(true && !(owner) && (0, _debug.assert)('OutletView is unexpectedly missing an owner', owner));
|
|
8625
|
-
var template = templateFactory$$1(owner);
|
|
8626
|
-
return new OutletView(_environment, owner, template, namespace);
|
|
8627
|
-
}
|
|
8628
|
-
|
|
8629
|
-
appendTo(selector) {
|
|
8630
|
-
var target;
|
|
8631
|
-
|
|
8632
|
-
if (this._environment.hasDOM) {
|
|
8633
|
-
target = typeof selector === 'string' ? document.querySelector(selector) : selector;
|
|
8634
|
-
} else {
|
|
8635
|
-
target = selector;
|
|
8636
|
-
}
|
|
8637
|
-
|
|
8638
|
-
var renderer = this.owner.lookup('renderer:-dom');
|
|
8639
|
-
(0, _runloop.schedule)('render', renderer, 'appendOutletView', this, target);
|
|
8640
|
-
}
|
|
8641
|
-
|
|
8642
|
-
rerender() {
|
|
8643
|
-
/**/
|
|
8644
|
-
}
|
|
8645
|
-
|
|
8646
|
-
setOutletState(state) {
|
|
8647
|
-
(0, _reference.updateRef)(this.ref, state);
|
|
8648
|
-
}
|
|
8649
|
-
|
|
8650
|
-
destroy() {
|
|
8651
|
-
/**/
|
|
8652
|
-
}
|
|
8653
|
-
|
|
8654
|
-
}
|
|
8655
|
-
|
|
8656
|
-
_exports.OutletView = OutletView;
|
|
8657
8023
|
|
|
8658
8024
|
function setupApplicationRegistry(registry) {
|
|
8659
8025
|
// because we are using injections we can't use instantiate false
|
|
@@ -8699,6 +8065,18 @@ define("@ember/-internals/glimmer/index", ["exports", "@glimmer/opcode-compiler"
|
|
|
8699
8065
|
registry.register((0, _container.privatize)`component:-default`, Component);
|
|
8700
8066
|
}
|
|
8701
8067
|
}
|
|
8068
|
+
/**
|
|
8069
|
+
Associate a class with a component manager (an object that is responsible for
|
|
8070
|
+
coordinating the lifecycle events that occurs when invoking, rendering and
|
|
8071
|
+
re-rendering a component).
|
|
8072
|
+
|
|
8073
|
+
@method setComponentManager
|
|
8074
|
+
@param {Function} factory a function to create the owner for an object
|
|
8075
|
+
@param {Object} obj the object to associate with the componetn manager
|
|
8076
|
+
@return {Object} the same object passed in
|
|
8077
|
+
@public
|
|
8078
|
+
*/
|
|
8079
|
+
|
|
8702
8080
|
|
|
8703
8081
|
function setComponentManager$1(manager, obj) {
|
|
8704
8082
|
return (0, _manager2.setComponentManager)(manager, obj);
|
|
@@ -9767,7 +9145,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
|
|
|
9767
9145
|
return true;
|
|
9768
9146
|
}
|
|
9769
9147
|
/**
|
|
9770
|
-
@
|
|
9148
|
+
@public
|
|
9771
9149
|
@method hasListeners
|
|
9772
9150
|
@static
|
|
9773
9151
|
@for @ember/object/events
|
|
@@ -11494,10 +10872,6 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
|
|
|
11494
10872
|
function isPath(path) {
|
|
11495
10873
|
return typeof path === 'string' && firstDotIndexCache.get(path) !== -1;
|
|
11496
10874
|
}
|
|
11497
|
-
/**
|
|
11498
|
-
@module @ember/object
|
|
11499
|
-
*/
|
|
11500
|
-
|
|
11501
10875
|
|
|
11502
10876
|
var PROXY_CONTENT = (0, _utils.symbol)('PROXY_CONTENT');
|
|
11503
10877
|
_exports.PROXY_CONTENT = PROXY_CONTENT;
|
|
@@ -11881,7 +11255,6 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
|
|
|
11881
11255
|
confusing.
|
|
11882
11256
|
|
|
11883
11257
|
```javascript
|
|
11884
|
-
isNone(); // true
|
|
11885
11258
|
isNone(null); // true
|
|
11886
11259
|
isNone(undefined); // true
|
|
11887
11260
|
isNone(''); // false
|
|
@@ -11916,7 +11289,6 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
|
|
|
11916
11289
|
to check emptiness.
|
|
11917
11290
|
|
|
11918
11291
|
```javascript
|
|
11919
|
-
isEmpty(); // true
|
|
11920
11292
|
isEmpty(null); // true
|
|
11921
11293
|
isEmpty(undefined); // true
|
|
11922
11294
|
isEmpty(''); // true
|
|
@@ -11941,19 +11313,15 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
|
|
|
11941
11313
|
|
|
11942
11314
|
|
|
11943
11315
|
function isEmpty(obj) {
|
|
11944
|
-
|
|
11945
|
-
|
|
11946
|
-
if (none) {
|
|
11947
|
-
return none;
|
|
11316
|
+
if (obj === null || obj === undefined) {
|
|
11317
|
+
return true;
|
|
11948
11318
|
}
|
|
11949
11319
|
|
|
11950
11320
|
if (typeof obj.unknownProperty !== 'function' && typeof obj.size === 'number') {
|
|
11951
11321
|
return !obj.size;
|
|
11952
11322
|
}
|
|
11953
11323
|
|
|
11954
|
-
|
|
11955
|
-
|
|
11956
|
-
if (objectType === 'object') {
|
|
11324
|
+
if (typeof obj === 'object') {
|
|
11957
11325
|
var size = get(obj, 'size');
|
|
11958
11326
|
|
|
11959
11327
|
if (typeof size === 'number') {
|
|
@@ -11967,7 +11335,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
|
|
|
11967
11335
|
}
|
|
11968
11336
|
}
|
|
11969
11337
|
|
|
11970
|
-
if (typeof obj.length === 'number' &&
|
|
11338
|
+
if (typeof obj.length === 'number' && typeof obj !== 'function') {
|
|
11971
11339
|
return !obj.length;
|
|
11972
11340
|
}
|
|
11973
11341
|
|
|
@@ -11983,7 +11351,6 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
|
|
|
11983
11351
|
```javascript
|
|
11984
11352
|
import { isBlank } from '@ember/utils';
|
|
11985
11353
|
|
|
11986
|
-
isBlank(); // true
|
|
11987
11354
|
isBlank(null); // true
|
|
11988
11355
|
isBlank(undefined); // true
|
|
11989
11356
|
isBlank(''); // true
|
|
@@ -12017,7 +11384,6 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
|
|
|
12017
11384
|
A value is present if it not `isBlank`.
|
|
12018
11385
|
|
|
12019
11386
|
```javascript
|
|
12020
|
-
isPresent(); // false
|
|
12021
11387
|
isPresent(null); // false
|
|
12022
11388
|
isPresent(undefined); // false
|
|
12023
11389
|
isPresent(''); // false
|
|
@@ -12544,7 +11910,7 @@ define("@ember/-internals/metal/index", ["exports", "@ember/-internals/meta", "@
|
|
|
12544
11910
|
} else if (_mixins !== undefined) {
|
|
12545
11911
|
mergeMixins(_mixins, meta$$1, descs, values, base, keys, keysWithSuper);
|
|
12546
11912
|
|
|
12547
|
-
if (currentMixin._without !== undefined) {
|
|
11913
|
+
if (currentMixin instanceof Mixin && currentMixin._without !== undefined) {
|
|
12548
11914
|
currentMixin._without.forEach(keyName => {
|
|
12549
11915
|
// deleting the key means we won't process the value
|
|
12550
11916
|
var index = keys.indexOf(keyName);
|
|
@@ -14379,7 +13745,7 @@ define("@ember/-internals/routing/lib/location/hash_location", ["exports", "@emb
|
|
|
14379
13745
|
onUpdateURL(callback) {
|
|
14380
13746
|
this._removeEventListener();
|
|
14381
13747
|
|
|
14382
|
-
this._hashchangeHandler = (0, _runloop.bind)(this, function () {
|
|
13748
|
+
this._hashchangeHandler = (0, _runloop.bind)(this, function (_event) {
|
|
14383
13749
|
var path = this.getURL();
|
|
14384
13750
|
|
|
14385
13751
|
if (this.lastSetURL === path) {
|
|
@@ -15005,6 +14371,55 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
|
|
|
15005
14371
|
class RouterService extends _service.default.extend(_runtime.Evented) {
|
|
15006
14372
|
constructor() {
|
|
15007
14373
|
super(...arguments);
|
|
14374
|
+
/**
|
|
14375
|
+
You can register a listener for events emitted by this service with `.on()`:
|
|
14376
|
+
```app/routes/contact-form.js
|
|
14377
|
+
import Route from '@ember/routing';
|
|
14378
|
+
import { service } from '@ember/service';
|
|
14379
|
+
export default class extends Route {
|
|
14380
|
+
@service router;
|
|
14381
|
+
activate() {
|
|
14382
|
+
this.router.on('routeWillChange', (transition) => {
|
|
14383
|
+
if (!transition.to.find(route => route.name === this.routeName)) {
|
|
14384
|
+
alert("Please save or cancel your changes.");
|
|
14385
|
+
transition.abort();
|
|
14386
|
+
}
|
|
14387
|
+
})
|
|
14388
|
+
}
|
|
14389
|
+
}
|
|
14390
|
+
```
|
|
14391
|
+
@method on
|
|
14392
|
+
@param {String} eventName
|
|
14393
|
+
@param {Function} callback
|
|
14394
|
+
@public
|
|
14395
|
+
*/
|
|
14396
|
+
|
|
14397
|
+
/**
|
|
14398
|
+
You can unregister a listener for events emitted by this service with `.off()`:
|
|
14399
|
+
```app/routes/contact-form.js
|
|
14400
|
+
import Route from '@ember/routing';
|
|
14401
|
+
import { service } from '@ember/service';
|
|
14402
|
+
export default class extends Route {
|
|
14403
|
+
@service router;
|
|
14404
|
+
callback = (transition) => {
|
|
14405
|
+
if (!transition.to.find(route => route.name === this.routeName)) {
|
|
14406
|
+
alert("Please save or cancel your changes.");
|
|
14407
|
+
transition.abort();
|
|
14408
|
+
}
|
|
14409
|
+
};
|
|
14410
|
+
activate() {
|
|
14411
|
+
this.router.on('routeWillChange', this.callback);
|
|
14412
|
+
}
|
|
14413
|
+
deactivate() {
|
|
14414
|
+
this.router.off('routeWillChange', this.callback);
|
|
14415
|
+
}
|
|
14416
|
+
```
|
|
14417
|
+
@method off
|
|
14418
|
+
@param {String} eventName
|
|
14419
|
+
@param {Function} callback
|
|
14420
|
+
@public
|
|
14421
|
+
*/
|
|
14422
|
+
|
|
15008
14423
|
/**
|
|
15009
14424
|
The `routeWillChange` event is fired at the beginning of any
|
|
15010
14425
|
attempted transition with a `Transition` object as the sole
|
|
@@ -15017,9 +14432,8 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
|
|
|
15017
14432
|
import { service } from '@ember/service';
|
|
15018
14433
|
export default class extends Route {
|
|
15019
14434
|
@service router;
|
|
15020
|
-
|
|
15021
|
-
|
|
15022
|
-
this.router.on('routeWillChange', (transition) => {
|
|
14435
|
+
activate() {
|
|
14436
|
+
this.router.on('routeWillChange', (transition) => {
|
|
15023
14437
|
if (!transition.to.find(route => route.name === this.routeName)) {
|
|
15024
14438
|
alert("Please save or cancel your changes.");
|
|
15025
14439
|
transition.abort();
|
|
@@ -15044,9 +14458,8 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
|
|
|
15044
14458
|
import { service } from '@ember/service';
|
|
15045
14459
|
export default class extends Route {
|
|
15046
14460
|
@service router;
|
|
15047
|
-
|
|
15048
|
-
|
|
15049
|
-
this.router.on('routeDidChange', (transition) => {
|
|
14461
|
+
activate() {
|
|
14462
|
+
this.router.on('routeDidChange', (transition) => {
|
|
15050
14463
|
ga.send('pageView', {
|
|
15051
14464
|
current: transition.to.name,
|
|
15052
14465
|
from: transition.from.name
|
|
@@ -15178,7 +14591,6 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
|
|
|
15178
14591
|
|
|
15179
14592
|
var transition = this._router._doTransition(routeName, models, queryParams, true);
|
|
15180
14593
|
|
|
15181
|
-
transition['_keepDefaultQueryParamValues'] = true;
|
|
15182
14594
|
return transition;
|
|
15183
14595
|
}
|
|
15184
14596
|
/**
|
|
@@ -15357,19 +14769,26 @@ define("@ember/-internals/routing/lib/services/router", ["exports", "@ember/-int
|
|
|
15357
14769
|
var hasQueryParams = Object.keys(queryParams).length > 0;
|
|
15358
14770
|
|
|
15359
14771
|
if (hasQueryParams) {
|
|
15360
|
-
|
|
15361
|
-
|
|
15362
|
-
this._router._prepareQueryParams( // UNSAFE: casting `routeName as string` here encodes the existing
|
|
14772
|
+
// UNSAFE: casting `routeName as string` here encodes the existing
|
|
15363
14773
|
// assumption but may be wrong: `extractRouteArgs` correctly returns it
|
|
15364
14774
|
// as `string | undefined`. There may be bugs if `_prepareQueryParams`
|
|
15365
14775
|
// does not correctly account for `undefined` values for `routeName`.
|
|
15366
14776
|
// Spoilers: under the hood this currently uses router.js APIs which
|
|
15367
14777
|
// *do not* account for this being `undefined`.
|
|
15368
|
-
|
|
14778
|
+
var targetRouteName = routeName;
|
|
14779
|
+
queryParams = Object.assign({}, queryParams);
|
|
14780
|
+
|
|
14781
|
+
this._router._prepareQueryParams(targetRouteName, models, queryParams, true
|
|
14782
|
+
/* fromRouterService */
|
|
14783
|
+
);
|
|
14784
|
+
|
|
14785
|
+
var currentQueryParams = Object.assign({}, routerMicrolib.state.queryParams);
|
|
14786
|
+
|
|
14787
|
+
this._router._prepareQueryParams(targetRouteName, models, currentQueryParams, true
|
|
15369
14788
|
/* fromRouterService */
|
|
15370
14789
|
);
|
|
15371
14790
|
|
|
15372
|
-
return (0, _utils2.shallowEqual)(queryParams,
|
|
14791
|
+
return (0, _utils2.shallowEqual)(queryParams, currentQueryParams);
|
|
15373
14792
|
}
|
|
15374
14793
|
|
|
15375
14794
|
return true;
|
|
@@ -17687,7 +17106,7 @@ define("@ember/-internals/routing/lib/system/route", ["exports", "@ember/-intern
|
|
|
17687
17106
|
qp.serializedValue = svalue;
|
|
17688
17107
|
var thisQueryParamHasDefaultValue = qp.serializedDefaultValue === svalue;
|
|
17689
17108
|
|
|
17690
|
-
if (!thisQueryParamHasDefaultValue
|
|
17109
|
+
if (!thisQueryParamHasDefaultValue) {
|
|
17691
17110
|
finalParams.push({
|
|
17692
17111
|
value: svalue,
|
|
17693
17112
|
visible: true,
|
|
@@ -17816,6 +17235,7 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
|
|
|
17816
17235
|
this._handledErrors = new Set();
|
|
17817
17236
|
this._engineInstances = Object.create(null);
|
|
17818
17237
|
this._engineInfoByRoute = Object.create(null);
|
|
17238
|
+
this._slowTransitionTimer = null;
|
|
17819
17239
|
this.currentState = null;
|
|
17820
17240
|
this.targetState = null;
|
|
17821
17241
|
|
|
@@ -18451,11 +17871,13 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
|
|
|
18451
17871
|
var instances = this._engineInstances;
|
|
18452
17872
|
|
|
18453
17873
|
for (var name in instances) {
|
|
18454
|
-
var
|
|
18455
|
-
(true && !(
|
|
17874
|
+
var instanceMap = instances[name];
|
|
17875
|
+
(true && !(instanceMap) && (0, _debug.assert)('has instanceMap', instanceMap));
|
|
18456
17876
|
|
|
18457
|
-
for (var id in
|
|
18458
|
-
|
|
17877
|
+
for (var id in instanceMap) {
|
|
17878
|
+
var instance = instanceMap[id];
|
|
17879
|
+
(true && !(instance) && (0, _debug.assert)('has instance', instance));
|
|
17880
|
+
(0, _runloop.run)(instance, 'destroy');
|
|
18459
17881
|
}
|
|
18460
17882
|
}
|
|
18461
17883
|
}
|
|
@@ -18668,7 +18090,7 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
|
|
|
18668
18090
|
}
|
|
18669
18091
|
}
|
|
18670
18092
|
|
|
18671
|
-
_doTransition(_targetRouteName, models, _queryParams,
|
|
18093
|
+
_doTransition(_targetRouteName, models, _queryParams, _fromRouterService) {
|
|
18672
18094
|
var targetRouteName = _targetRouteName || (0, _utils.getActiveTargetName)(this._routerMicrolib);
|
|
18673
18095
|
|
|
18674
18096
|
(true && !(Boolean(targetRouteName) && this._routerMicrolib.hasRoute(targetRouteName)) && (0, _debug.assert)(`The route ${targetRouteName} was not found`, Boolean(targetRouteName) && this._routerMicrolib.hasRoute(targetRouteName)));
|
|
@@ -18679,7 +18101,7 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
|
|
|
18679
18101
|
|
|
18680
18102
|
Object.assign(queryParams, _queryParams);
|
|
18681
18103
|
|
|
18682
|
-
this._prepareQueryParams(targetRouteName, models, queryParams, Boolean(
|
|
18104
|
+
this._prepareQueryParams(targetRouteName, models, queryParams, Boolean(_fromRouterService));
|
|
18683
18105
|
|
|
18684
18106
|
var transition = this._routerMicrolib.transitionTo(targetRouteName, ...models, {
|
|
18685
18107
|
queryParams
|
|
@@ -18931,7 +18353,7 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
|
|
|
18931
18353
|
_scheduleLoadingEvent(transition, originRoute) {
|
|
18932
18354
|
this._cancelSlowTransitionTimer();
|
|
18933
18355
|
|
|
18934
|
-
this._slowTransitionTimer = (0, _runloop.scheduleOnce)('routerTransitions', this,
|
|
18356
|
+
this._slowTransitionTimer = (0, _runloop.scheduleOnce)('routerTransitions', this, this._handleSlowTransition, transition, originRoute);
|
|
18935
18357
|
}
|
|
18936
18358
|
|
|
18937
18359
|
_handleSlowTransition(transition, originRoute) {
|
|
@@ -19392,7 +18814,7 @@ define("@ember/-internals/routing/lib/system/router", ["exports", "@ember/-inter
|
|
|
19392
18814
|
// Create an entry to represent our default template name,
|
|
19393
18815
|
// just so other routes can target it and inherit its place
|
|
19394
18816
|
// in the outlet hierarchy.
|
|
19395
|
-
defaultParentState.outlets
|
|
18817
|
+
defaultParentState.outlets['main'] = {
|
|
19396
18818
|
render: {
|
|
19397
18819
|
name: routeName,
|
|
19398
18820
|
outlet: 'main'
|
|
@@ -20149,7 +19571,7 @@ define("@ember/-internals/runtime/index", ["exports", "@ember/-internals/runtime
|
|
|
20149
19571
|
}
|
|
20150
19572
|
});
|
|
20151
19573
|
});
|
|
20152
|
-
define("@ember/-internals/runtime/lib/compare", ["exports", "@ember/-internals/runtime/lib/type-of", "@ember/-internals/runtime/lib/mixins/comparable"], function (_exports, _typeOf, _comparable) {
|
|
19574
|
+
define("@ember/-internals/runtime/lib/compare", ["exports", "@ember/-internals/runtime/lib/type-of", "@ember/-internals/runtime/lib/mixins/comparable", "@ember/debug"], function (_exports, _typeOf, _comparable, _debug) {
|
|
20153
19575
|
"use strict";
|
|
20154
19576
|
|
|
20155
19577
|
Object.defineProperty(_exports, "__esModule", {
|
|
@@ -20187,8 +19609,9 @@ define("@ember/-internals/runtime/lib/compare", ["exports", "@ember/-internals/r
|
|
|
20187
19609
|
// SSt `------'`
|
|
20188
19610
|
|
|
20189
19611
|
function spaceship(a, b) {
|
|
20190
|
-
var diff = a - b;
|
|
20191
|
-
|
|
19612
|
+
var diff = a - b; // SAFETY: Number casts true into 1 and false into 0. Therefore, this must end up as one of the Compare values.
|
|
19613
|
+
|
|
19614
|
+
return Number(diff > 0) - Number(diff < 0);
|
|
20192
19615
|
}
|
|
20193
19616
|
/**
|
|
20194
19617
|
@module @ember/utils
|
|
@@ -20250,11 +19673,12 @@ define("@ember/-internals/runtime/lib/compare", ["exports", "@ember/-internals/r
|
|
|
20250
19673
|
var type1 = (0, _typeOf.typeOf)(v);
|
|
20251
19674
|
var type2 = (0, _typeOf.typeOf)(w);
|
|
20252
19675
|
|
|
20253
|
-
if (type1 === 'instance' &&
|
|
19676
|
+
if (type1 === 'instance' && isComparable(v) && v.constructor.compare) {
|
|
20254
19677
|
return v.constructor.compare(v, w);
|
|
20255
19678
|
}
|
|
20256
19679
|
|
|
20257
|
-
if (type2 === 'instance' &&
|
|
19680
|
+
if (type2 === 'instance' && isComparable(w) && w.constructor.compare) {
|
|
19681
|
+
// SAFETY: Multiplying by a negative just changes the sign
|
|
20258
19682
|
return w.constructor.compare(w, v) * -1;
|
|
20259
19683
|
}
|
|
20260
19684
|
|
|
@@ -20267,14 +19691,20 @@ define("@ember/-internals/runtime/lib/compare", ["exports", "@ember/-internals/r
|
|
|
20267
19691
|
|
|
20268
19692
|
switch (type1) {
|
|
20269
19693
|
case 'boolean':
|
|
19694
|
+
(true && !(typeof v === 'boolean' && typeof w === 'boolean') && (0, _debug.assert)('both are boolean', typeof v === 'boolean' && typeof w === 'boolean'));
|
|
19695
|
+
return spaceship(Number(v), Number(w));
|
|
19696
|
+
|
|
20270
19697
|
case 'number':
|
|
19698
|
+
(true && !(typeof v === 'number' && typeof w === 'number') && (0, _debug.assert)('both are numbers', typeof v === 'number' && typeof w === 'number'));
|
|
20271
19699
|
return spaceship(v, w);
|
|
20272
19700
|
|
|
20273
19701
|
case 'string':
|
|
19702
|
+
(true && !(typeof v === 'string' && typeof w === 'string') && (0, _debug.assert)('both are strings', typeof v === 'string' && typeof w === 'string'));
|
|
20274
19703
|
return spaceship(v.localeCompare(w), 0);
|
|
20275
19704
|
|
|
20276
19705
|
case 'array':
|
|
20277
19706
|
{
|
|
19707
|
+
(true && !(Array.isArray(v) && Array.isArray(w)) && (0, _debug.assert)('both are arrays', Array.isArray(v) && Array.isArray(w)));
|
|
20278
19708
|
var vLen = v.length;
|
|
20279
19709
|
var wLen = w.length;
|
|
20280
19710
|
var len = Math.min(vLen, wLen);
|
|
@@ -20293,19 +19723,24 @@ define("@ember/-internals/runtime/lib/compare", ["exports", "@ember/-internals/r
|
|
|
20293
19723
|
}
|
|
20294
19724
|
|
|
20295
19725
|
case 'instance':
|
|
20296
|
-
if (
|
|
19726
|
+
if (isComparable(v) && v.compare) {
|
|
20297
19727
|
return v.compare(v, w);
|
|
20298
19728
|
}
|
|
20299
19729
|
|
|
20300
19730
|
return 0;
|
|
20301
19731
|
|
|
20302
19732
|
case 'date':
|
|
19733
|
+
(true && !(v instanceof Date && w instanceof Date) && (0, _debug.assert)('both are dates', v instanceof Date && w instanceof Date));
|
|
20303
19734
|
return spaceship(v.getTime(), w.getTime());
|
|
20304
19735
|
|
|
20305
19736
|
default:
|
|
20306
19737
|
return 0;
|
|
20307
19738
|
}
|
|
20308
19739
|
}
|
|
19740
|
+
|
|
19741
|
+
function isComparable(value) {
|
|
19742
|
+
return _comparable.default.detect(value);
|
|
19743
|
+
}
|
|
20309
19744
|
});
|
|
20310
19745
|
define("@ember/-internals/runtime/lib/ext/rsvp", ["exports", "rsvp", "@ember/runloop", "@ember/-internals/error-handling", "@ember/debug"], function (_exports, RSVP, _runloop, _errorHandling, _debug) {
|
|
20311
19746
|
"use strict";
|
|
@@ -20339,13 +19774,17 @@ define("@ember/-internals/runtime/lib/ext/rsvp", ["exports", "rsvp", "@ember/run
|
|
|
20339
19774
|
|
|
20340
19775
|
function errorFor(reason) {
|
|
20341
19776
|
if (!reason) return;
|
|
19777
|
+
var withErrorThrown = reason;
|
|
20342
19778
|
|
|
20343
|
-
if (
|
|
20344
|
-
return unwrapErrorThrown(
|
|
19779
|
+
if (withErrorThrown.errorThrown) {
|
|
19780
|
+
return unwrapErrorThrown(withErrorThrown);
|
|
20345
19781
|
}
|
|
20346
19782
|
|
|
20347
|
-
|
|
20348
|
-
|
|
19783
|
+
var withName = reason;
|
|
19784
|
+
|
|
19785
|
+
if (withName.name === 'UnrecognizedURLError') {
|
|
19786
|
+
(true && !(false) && (0, _debug.assert)(`The URL '${withName.message}' did not match any routes in your application`, false)); // @ts-expect-error We'll hit this if the assert is stripped
|
|
19787
|
+
|
|
20349
19788
|
return;
|
|
20350
19789
|
}
|
|
20351
19790
|
|
|
@@ -20504,7 +19943,7 @@ define("@ember/-internals/runtime/lib/mixins/-proxy", ["exports", "@ember/-inter
|
|
|
20504
19943
|
var _default = _metal.Mixin.create({
|
|
20505
19944
|
/**
|
|
20506
19945
|
The object whose properties will be forwarded.
|
|
20507
|
-
|
|
19946
|
+
@property content
|
|
20508
19947
|
@type {unknown}
|
|
20509
19948
|
@default null
|
|
20510
19949
|
@public
|
|
@@ -22160,7 +21599,7 @@ define("@ember/-internals/runtime/lib/mixins/array", ["exports", "@ember/-intern
|
|
|
22160
21599
|
colors.unshiftObjects('yellow'); // Type Error: 'undefined' is not a function
|
|
22161
21600
|
```
|
|
22162
21601
|
@method unshiftObjects
|
|
22163
|
-
@param {
|
|
21602
|
+
@param {Enumerable} objects the objects to add
|
|
22164
21603
|
@return {EmberArray} receiver
|
|
22165
21604
|
@public
|
|
22166
21605
|
*/
|
|
@@ -22432,13 +21871,13 @@ define("@ember/-internals/runtime/lib/mixins/comparable", ["exports", "@ember/-i
|
|
|
22432
21871
|
var _default = _metal.Mixin.create({
|
|
22433
21872
|
/**
|
|
22434
21873
|
__Required.__ You must implement this method to apply this mixin.
|
|
22435
|
-
|
|
21874
|
+
Override to return the result of the comparison of the two parameters. The
|
|
22436
21875
|
compare method should return:
|
|
22437
|
-
|
|
21876
|
+
- `-1` if `a < b`
|
|
22438
21877
|
- `0` if `a == b`
|
|
22439
21878
|
- `1` if `a > b`
|
|
22440
|
-
|
|
22441
|
-
|
|
21879
|
+
Default implementation raises an exception.
|
|
21880
|
+
@method compare
|
|
22442
21881
|
@param a {Object} the first object to compare
|
|
22443
21882
|
@param b {Object} the second object to compare
|
|
22444
21883
|
@return {Number} the result of the comparison
|
|
@@ -23325,7 +22764,7 @@ define("@ember/-internals/runtime/lib/mixins/promise_proxy", ["exports", "@ember
|
|
|
23325
22764
|
/**
|
|
23326
22765
|
If the proxied promise is rejected this will contain the reason
|
|
23327
22766
|
provided.
|
|
23328
|
-
|
|
22767
|
+
@property reason
|
|
23329
22768
|
@default null
|
|
23330
22769
|
@public
|
|
23331
22770
|
*/
|
|
@@ -23333,7 +22772,7 @@ define("@ember/-internals/runtime/lib/mixins/promise_proxy", ["exports", "@ember
|
|
|
23333
22772
|
|
|
23334
22773
|
/**
|
|
23335
22774
|
Once the proxied promise has settled this will become `false`.
|
|
23336
|
-
|
|
22775
|
+
@property isPending
|
|
23337
22776
|
@default true
|
|
23338
22777
|
@public
|
|
23339
22778
|
*/
|
|
@@ -23343,7 +22782,7 @@ define("@ember/-internals/runtime/lib/mixins/promise_proxy", ["exports", "@ember
|
|
|
23343
22782
|
|
|
23344
22783
|
/**
|
|
23345
22784
|
Once the proxied promise has settled this will become `true`.
|
|
23346
|
-
|
|
22785
|
+
@property isSettled
|
|
23347
22786
|
@default false
|
|
23348
22787
|
@public
|
|
23349
22788
|
*/
|
|
@@ -23353,7 +22792,7 @@ define("@ember/-internals/runtime/lib/mixins/promise_proxy", ["exports", "@ember
|
|
|
23353
22792
|
|
|
23354
22793
|
/**
|
|
23355
22794
|
Will become `true` if the proxied promise is rejected.
|
|
23356
|
-
|
|
22795
|
+
@property isRejected
|
|
23357
22796
|
@default false
|
|
23358
22797
|
@public
|
|
23359
22798
|
*/
|
|
@@ -23361,7 +22800,7 @@ define("@ember/-internals/runtime/lib/mixins/promise_proxy", ["exports", "@ember
|
|
|
23361
22800
|
|
|
23362
22801
|
/**
|
|
23363
22802
|
Will become `true` if the proxied promise is fulfilled.
|
|
23364
|
-
|
|
22803
|
+
@property isFulfilled
|
|
23365
22804
|
@default false
|
|
23366
22805
|
@public
|
|
23367
22806
|
*/
|
|
@@ -23369,17 +22808,17 @@ define("@ember/-internals/runtime/lib/mixins/promise_proxy", ["exports", "@ember
|
|
|
23369
22808
|
|
|
23370
22809
|
/**
|
|
23371
22810
|
The promise whose fulfillment value is being proxied by this object.
|
|
23372
|
-
|
|
22811
|
+
This property must be specified upon creation, and should not be
|
|
23373
22812
|
changed once created.
|
|
23374
|
-
|
|
23375
|
-
|
|
22813
|
+
Example:
|
|
22814
|
+
```javascript
|
|
23376
22815
|
import ObjectProxy from '@ember/object/proxy';
|
|
23377
22816
|
import PromiseProxyMixin from '@ember/object/promise-proxy-mixin';
|
|
23378
|
-
|
|
22817
|
+
ObjectProxy.extend(PromiseProxyMixin).create({
|
|
23379
22818
|
promise: <thenable>
|
|
23380
22819
|
});
|
|
23381
22820
|
```
|
|
23382
|
-
|
|
22821
|
+
@property promise
|
|
23383
22822
|
@public
|
|
23384
22823
|
*/
|
|
23385
22824
|
promise: (0, _metal.computed)({
|
|
@@ -23395,8 +22834,8 @@ define("@ember/-internals/runtime/lib/mixins/promise_proxy", ["exports", "@ember
|
|
|
23395
22834
|
|
|
23396
22835
|
/**
|
|
23397
22836
|
An alias to the proxied promise's `then`.
|
|
23398
|
-
|
|
23399
|
-
|
|
22837
|
+
See RSVP.Promise.then.
|
|
22838
|
+
@method then
|
|
23400
22839
|
@param {Function} callback
|
|
23401
22840
|
@return {RSVP.Promise}
|
|
23402
22841
|
@public
|
|
@@ -23405,8 +22844,8 @@ define("@ember/-internals/runtime/lib/mixins/promise_proxy", ["exports", "@ember
|
|
|
23405
22844
|
|
|
23406
22845
|
/**
|
|
23407
22846
|
An alias to the proxied promise's `catch`.
|
|
23408
|
-
|
|
23409
|
-
|
|
22847
|
+
See RSVP.Promise.catch.
|
|
22848
|
+
@method catch
|
|
23410
22849
|
@param {Function} callback
|
|
23411
22850
|
@return {RSVP.Promise}
|
|
23412
22851
|
@since 1.3.0
|
|
@@ -23416,8 +22855,8 @@ define("@ember/-internals/runtime/lib/mixins/promise_proxy", ["exports", "@ember
|
|
|
23416
22855
|
|
|
23417
22856
|
/**
|
|
23418
22857
|
An alias to the proxied promise's `finally`.
|
|
23419
|
-
|
|
23420
|
-
|
|
22858
|
+
See RSVP.Promise.finally.
|
|
22859
|
+
@method finally
|
|
23421
22860
|
@param {Function} callback
|
|
23422
22861
|
@return {RSVP.Promise}
|
|
23423
22862
|
@since 1.3.0
|
|
@@ -23708,9 +23147,9 @@ define("@ember/-internals/runtime/lib/mixins/target_action_support", ["exports",
|
|
|
23708
23147
|
/**
|
|
23709
23148
|
Send an `action` with an `actionContext` to a `target`. The action, actionContext
|
|
23710
23149
|
and target will be retrieved from properties of the object. For example:
|
|
23711
|
-
|
|
23150
|
+
```javascript
|
|
23712
23151
|
import { alias } from '@ember/object/computed';
|
|
23713
|
-
|
|
23152
|
+
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {
|
|
23714
23153
|
target: alias('controller'),
|
|
23715
23154
|
action: 'save',
|
|
23716
23155
|
actionContext: alias('context'),
|
|
@@ -23720,9 +23159,9 @@ define("@ember/-internals/runtime/lib/mixins/target_action_support", ["exports",
|
|
|
23720
23159
|
}
|
|
23721
23160
|
});
|
|
23722
23161
|
```
|
|
23723
|
-
|
|
23162
|
+
The `target`, `action`, and `actionContext` can be provided as properties of
|
|
23724
23163
|
an optional object argument to `triggerAction` as well.
|
|
23725
|
-
|
|
23164
|
+
```javascript
|
|
23726
23165
|
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {
|
|
23727
23166
|
click() {
|
|
23728
23167
|
this.triggerAction({
|
|
@@ -23734,12 +23173,12 @@ define("@ember/-internals/runtime/lib/mixins/target_action_support", ["exports",
|
|
|
23734
23173
|
}
|
|
23735
23174
|
});
|
|
23736
23175
|
```
|
|
23737
|
-
|
|
23176
|
+
The `actionContext` defaults to the object you are mixing `TargetActionSupport` into.
|
|
23738
23177
|
But `target` and `action` must be specified either as properties or with the argument
|
|
23739
23178
|
to `triggerAction`, or a combination:
|
|
23740
|
-
|
|
23179
|
+
```javascript
|
|
23741
23180
|
import { alias } from '@ember/object/computed';
|
|
23742
|
-
|
|
23181
|
+
App.SaveButtonView = Ember.View.extend(Ember.TargetActionSupport, {
|
|
23743
23182
|
target: alias('controller'),
|
|
23744
23183
|
click() {
|
|
23745
23184
|
this.triggerAction({
|
|
@@ -23749,7 +23188,7 @@ define("@ember/-internals/runtime/lib/mixins/target_action_support", ["exports",
|
|
|
23749
23188
|
}
|
|
23750
23189
|
});
|
|
23751
23190
|
```
|
|
23752
|
-
|
|
23191
|
+
@method triggerAction
|
|
23753
23192
|
@param opts {Object} (optional, with the optional keys action, target and/or actionContext)
|
|
23754
23193
|
@return {Boolean} true if the action was sent successfully and did not return false
|
|
23755
23194
|
@private
|
|
@@ -27507,12 +26946,14 @@ define("@ember/-internals/views/lib/system/utils", ["exports", "@ember/-internal
|
|
|
27507
26946
|
_exports.setElementView = setElementView;
|
|
27508
26947
|
_exports.setViewElement = setViewElement;
|
|
27509
26948
|
|
|
27510
|
-
/* globals Element */
|
|
27511
|
-
|
|
27512
26949
|
/**
|
|
27513
26950
|
@module ember
|
|
27514
26951
|
*/
|
|
27515
26952
|
function isSimpleClick(event) {
|
|
26953
|
+
if (!(event instanceof MouseEvent)) {
|
|
26954
|
+
return false;
|
|
26955
|
+
}
|
|
26956
|
+
|
|
27516
26957
|
var modifier = event.shiftKey || event.metaKey || event.altKey || event.ctrlKey;
|
|
27517
26958
|
var secondaryClick = event.which > 1; // IE9 may return undefined
|
|
27518
26959
|
|
|
@@ -27740,22 +27181,6 @@ define("@ember/-internals/views/lib/views/core_view", ["exports", "@ember/-inter
|
|
|
27740
27181
|
});
|
|
27741
27182
|
_exports.default = void 0;
|
|
27742
27183
|
|
|
27743
|
-
/**
|
|
27744
|
-
`Ember.CoreView` is an abstract class that exists to give view-like behavior
|
|
27745
|
-
to both Ember's main view class `Component` and other classes that don't need
|
|
27746
|
-
the full functionality of `Component`.
|
|
27747
|
-
|
|
27748
|
-
Unless you have specific needs for `CoreView`, you will use `Component`
|
|
27749
|
-
in your applications.
|
|
27750
|
-
|
|
27751
|
-
@class CoreView
|
|
27752
|
-
@namespace Ember
|
|
27753
|
-
@extends EmberObject
|
|
27754
|
-
@deprecated Use `Component` instead.
|
|
27755
|
-
@uses Evented
|
|
27756
|
-
@uses Ember.ActionHandler
|
|
27757
|
-
@private
|
|
27758
|
-
*/
|
|
27759
27184
|
var CoreView = _runtime.FrameworkObject.extend(_runtime.Evented, _runtime.ActionHandler, {
|
|
27760
27185
|
isView: true,
|
|
27761
27186
|
_states: _states.default,
|
|
@@ -27772,7 +27197,7 @@ define("@ember/-internals/views/lib/views/core_view", ["exports", "@ember/-inter
|
|
|
27772
27197
|
/**
|
|
27773
27198
|
If the view is currently inserted into the DOM of a parent view, this
|
|
27774
27199
|
property will point to the parent of the view.
|
|
27775
|
-
|
|
27200
|
+
@property parentView
|
|
27776
27201
|
@type Ember.View
|
|
27777
27202
|
@default null
|
|
27778
27203
|
@private
|
|
@@ -27780,16 +27205,16 @@ define("@ember/-internals/views/lib/views/core_view", ["exports", "@ember/-inter
|
|
|
27780
27205
|
parentView: null,
|
|
27781
27206
|
|
|
27782
27207
|
instrumentDetails(hash) {
|
|
27783
|
-
hash
|
|
27784
|
-
hash
|
|
27785
|
-
hash
|
|
27208
|
+
hash['object'] = this.toString();
|
|
27209
|
+
hash['containerKey'] = this._debugContainerKey;
|
|
27210
|
+
hash['view'] = this;
|
|
27786
27211
|
return hash;
|
|
27787
27212
|
},
|
|
27788
27213
|
|
|
27789
27214
|
/**
|
|
27790
27215
|
Override the default event firing from `Evented` to
|
|
27791
27216
|
also call methods with the given name.
|
|
27792
|
-
|
|
27217
|
+
@method trigger
|
|
27793
27218
|
@param name {String}
|
|
27794
27219
|
@private
|
|
27795
27220
|
*/
|
|
@@ -29633,7 +29058,7 @@ define("@ember/canary-features/index", ["exports", "@ember/-internals/environmen
|
|
|
29633
29058
|
Object.defineProperty(_exports, "__esModule", {
|
|
29634
29059
|
value: true
|
|
29635
29060
|
});
|
|
29636
|
-
_exports.FEATURES = _exports.EMBER_ROUTING_ROUTER_SERVICE_REFRESH = _exports.EMBER_LIBRARIES_ISREGISTERED = _exports.EMBER_IMPROVED_INSTRUMENTATION = _exports.EMBER_CACHED = _exports.DEFAULT_FEATURES = void 0;
|
|
29061
|
+
_exports.FEATURES = _exports.EMBER_UNIQUE_ID_HELPER = _exports.EMBER_ROUTING_ROUTER_SERVICE_REFRESH = _exports.EMBER_LIBRARIES_ISREGISTERED = _exports.EMBER_IMPROVED_INSTRUMENTATION = _exports.EMBER_CACHED = _exports.DEFAULT_FEATURES = void 0;
|
|
29637
29062
|
_exports.isEnabled = isEnabled;
|
|
29638
29063
|
|
|
29639
29064
|
/**
|
|
@@ -29650,7 +29075,8 @@ define("@ember/canary-features/index", ["exports", "@ember/-internals/environmen
|
|
|
29650
29075
|
EMBER_LIBRARIES_ISREGISTERED: null,
|
|
29651
29076
|
EMBER_IMPROVED_INSTRUMENTATION: null,
|
|
29652
29077
|
EMBER_ROUTING_ROUTER_SERVICE_REFRESH: true,
|
|
29653
|
-
EMBER_CACHED: true
|
|
29078
|
+
EMBER_CACHED: true,
|
|
29079
|
+
EMBER_UNIQUE_ID_HELPER: true
|
|
29654
29080
|
};
|
|
29655
29081
|
/**
|
|
29656
29082
|
The hash of enabled Canary features. Add to this, any canary features
|
|
@@ -29710,6 +29136,8 @@ define("@ember/canary-features/index", ["exports", "@ember/-internals/environmen
|
|
|
29710
29136
|
_exports.EMBER_ROUTING_ROUTER_SERVICE_REFRESH = EMBER_ROUTING_ROUTER_SERVICE_REFRESH;
|
|
29711
29137
|
var EMBER_CACHED = featureValue(FEATURES.EMBER_CACHED);
|
|
29712
29138
|
_exports.EMBER_CACHED = EMBER_CACHED;
|
|
29139
|
+
var EMBER_UNIQUE_ID_HELPER = featureValue(FEATURES.EMBER_UNIQUE_ID_HELPER);
|
|
29140
|
+
_exports.EMBER_UNIQUE_ID_HELPER = EMBER_UNIQUE_ID_HELPER;
|
|
29713
29141
|
});
|
|
29714
29142
|
define("@ember/component/helper", ["exports", "@ember/-internals/glimmer"], function (_exports, _glimmer) {
|
|
29715
29143
|
"use strict";
|
|
@@ -30226,7 +29654,7 @@ define("@ember/debug/index", ["exports", "@ember/-internals/browser-environment"
|
|
|
30226
29654
|
&& !(0, _testing.isTesting)()) {
|
|
30227
29655
|
if (typeof window !== 'undefined' && (_browserEnvironment.isFirefox || _browserEnvironment.isChrome) && window.addEventListener) {
|
|
30228
29656
|
window.addEventListener('load', () => {
|
|
30229
|
-
if (document.documentElement && document.documentElement.dataset && !document.documentElement.dataset
|
|
29657
|
+
if (document.documentElement && document.documentElement.dataset && !document.documentElement.dataset['emberExtension']) {
|
|
30230
29658
|
var downloadURL;
|
|
30231
29659
|
|
|
30232
29660
|
if (_browserEnvironment.isChrome) {
|
|
@@ -30348,11 +29776,15 @@ define("@ember/debug/lib/deprecate", ["exports", "@ember/-internals/environment"
|
|
|
30348
29776
|
var formatMessage = function formatMessage(_message, options) {
|
|
30349
29777
|
var message = _message;
|
|
30350
29778
|
|
|
30351
|
-
if (options
|
|
29779
|
+
if (options === null || options === void 0 ? void 0 : options.id) {
|
|
30352
29780
|
message = message + ` [deprecation id: ${options.id}]`;
|
|
30353
29781
|
}
|
|
30354
29782
|
|
|
30355
|
-
if (options
|
|
29783
|
+
if (options === null || options === void 0 ? void 0 : options.until) {
|
|
29784
|
+
message = message + ` This will be removed in Ember ${options.until}.`;
|
|
29785
|
+
}
|
|
29786
|
+
|
|
29787
|
+
if (options === null || options === void 0 ? void 0 : options.url) {
|
|
30356
29788
|
message += ` See ${options.url} for more details.`;
|
|
30357
29789
|
}
|
|
30358
29790
|
|
|
@@ -30472,7 +29904,7 @@ define("@ember/debug/lib/handlers", ["exports"], function (_exports) {
|
|
|
30472
29904
|
var HANDLERS = {};
|
|
30473
29905
|
_exports.HANDLERS = HANDLERS;
|
|
30474
29906
|
|
|
30475
|
-
var registerHandler = ()
|
|
29907
|
+
var registerHandler = function registerHandler(_type, _callback) {};
|
|
30476
29908
|
|
|
30477
29909
|
_exports.registerHandler = registerHandler;
|
|
30478
29910
|
|
|
@@ -34663,6 +34095,19 @@ define("@ember/polyfills/lib/assign", ["exports", "@ember/debug"], function (_ex
|
|
|
34663
34095
|
return Object.assign(target, ...rest);
|
|
34664
34096
|
}
|
|
34665
34097
|
});
|
|
34098
|
+
define("@ember/renderer/index", ["exports", "@ember/-internals/glimmer"], function (_exports, _glimmer) {
|
|
34099
|
+
"use strict";
|
|
34100
|
+
|
|
34101
|
+
Object.defineProperty(_exports, "__esModule", {
|
|
34102
|
+
value: true
|
|
34103
|
+
});
|
|
34104
|
+
Object.defineProperty(_exports, "renderSettled", {
|
|
34105
|
+
enumerable: true,
|
|
34106
|
+
get: function () {
|
|
34107
|
+
return _glimmer.renderSettled;
|
|
34108
|
+
}
|
|
34109
|
+
});
|
|
34110
|
+
});
|
|
34666
34111
|
define("@ember/routing/auto-location", ["exports", "@ember/-internals/routing"], function (_exports, _routing) {
|
|
34667
34112
|
"use strict";
|
|
34668
34113
|
|
|
@@ -34792,7 +34237,7 @@ define("@ember/runloop/index", ["exports", "@ember/debug", "@ember/-internals/er
|
|
|
34792
34237
|
_exports._hasScheduledTimers = _hasScheduledTimers;
|
|
34793
34238
|
_exports._rsvpErrorQueue = _exports._queues = void 0;
|
|
34794
34239
|
_exports.begin = begin;
|
|
34795
|
-
_exports.bind =
|
|
34240
|
+
_exports.bind = bind;
|
|
34796
34241
|
_exports.cancel = cancel;
|
|
34797
34242
|
_exports.debounce = debounce;
|
|
34798
34243
|
_exports.end = end;
|
|
@@ -34814,7 +34259,7 @@ define("@ember/runloop/index", ["exports", "@ember/debug", "@ember/-internals/er
|
|
|
34814
34259
|
currentRunLoop = current;
|
|
34815
34260
|
}
|
|
34816
34261
|
|
|
34817
|
-
function onEnd(
|
|
34262
|
+
function onEnd(_current, next) {
|
|
34818
34263
|
currentRunLoop = next;
|
|
34819
34264
|
(0, _metal.flushAsyncObservers)();
|
|
34820
34265
|
}
|
|
@@ -34857,164 +34302,25 @@ define("@ember/runloop/index", ["exports", "@ember/debug", "@ember/-internals/er
|
|
|
34857
34302
|
onErrorMethod: 'onerror',
|
|
34858
34303
|
flush
|
|
34859
34304
|
});
|
|
34860
|
-
/**
|
|
34861
|
-
@module @ember/runloop
|
|
34862
|
-
*/
|
|
34863
|
-
// ..........................................................
|
|
34864
|
-
// run - this is ideally the only public API the dev sees
|
|
34865
|
-
//
|
|
34866
|
-
|
|
34867
|
-
/**
|
|
34868
|
-
Runs the passed target and method inside of a RunLoop, ensuring any
|
|
34869
|
-
deferred actions including bindings and views updates are flushed at the
|
|
34870
|
-
end.
|
|
34871
|
-
|
|
34872
|
-
Normally you should not need to invoke this method yourself. However if
|
|
34873
|
-
you are implementing raw event handlers when interfacing with other
|
|
34874
|
-
libraries or plugins, you should probably wrap all of your code inside this
|
|
34875
|
-
call.
|
|
34876
|
-
|
|
34877
|
-
```javascript
|
|
34878
|
-
import { run } from '@ember/runloop';
|
|
34879
|
-
|
|
34880
|
-
run(function() {
|
|
34881
|
-
// code to be executed within a RunLoop
|
|
34882
|
-
});
|
|
34883
|
-
```
|
|
34884
|
-
@method run
|
|
34885
|
-
@for @ember/runloop
|
|
34886
|
-
@static
|
|
34887
|
-
@param {Object} [target] target of method to call
|
|
34888
|
-
@param {Function|String} method Method to invoke.
|
|
34889
|
-
May be a function or a string. If you pass a string
|
|
34890
|
-
then it will be looked up on the passed target.
|
|
34891
|
-
@param {Object} [args*] Any additional arguments you wish to pass to the method.
|
|
34892
|
-
@return {Object} return value from invoking the passed function.
|
|
34893
|
-
@public
|
|
34894
|
-
*/
|
|
34895
|
-
|
|
34896
34305
|
|
|
34897
34306
|
_exports._backburner = _backburner;
|
|
34898
34307
|
|
|
34899
34308
|
function run() {
|
|
34309
|
+
// @ts-expect-error TS doesn't like our spread args
|
|
34900
34310
|
return _backburner.run(...arguments);
|
|
34901
34311
|
}
|
|
34902
|
-
/**
|
|
34903
|
-
If no run-loop is present, it creates a new one. If a run loop is
|
|
34904
|
-
present it will queue itself to run on the existing run-loops action
|
|
34905
|
-
queue.
|
|
34906
|
-
|
|
34907
|
-
Please note: This is not for normal usage, and should be used sparingly.
|
|
34908
|
-
|
|
34909
|
-
If invoked when not within a run loop:
|
|
34910
|
-
|
|
34911
|
-
```javascript
|
|
34912
|
-
import { join } from '@ember/runloop';
|
|
34913
|
-
|
|
34914
|
-
join(function() {
|
|
34915
|
-
// creates a new run-loop
|
|
34916
|
-
});
|
|
34917
|
-
```
|
|
34918
|
-
|
|
34919
|
-
Alternatively, if called within an existing run loop:
|
|
34920
|
-
|
|
34921
|
-
```javascript
|
|
34922
|
-
import { run, join } from '@ember/runloop';
|
|
34923
|
-
|
|
34924
|
-
run(function() {
|
|
34925
|
-
// creates a new run-loop
|
|
34926
|
-
|
|
34927
|
-
join(function() {
|
|
34928
|
-
// joins with the existing run-loop, and queues for invocation on
|
|
34929
|
-
// the existing run-loops action queue.
|
|
34930
|
-
});
|
|
34931
|
-
});
|
|
34932
|
-
```
|
|
34933
|
-
|
|
34934
|
-
@method join
|
|
34935
|
-
@static
|
|
34936
|
-
@for @ember/runloop
|
|
34937
|
-
@param {Object} [target] target of method to call
|
|
34938
|
-
@param {Function|String} method Method to invoke.
|
|
34939
|
-
May be a function or a string. If you pass a string
|
|
34940
|
-
then it will be looked up on the passed target.
|
|
34941
|
-
@param {Object} [args*] Any additional arguments you wish to pass to the method.
|
|
34942
|
-
@return {Object} Return value from invoking the passed function. Please note,
|
|
34943
|
-
when called within an existing loop, no return value is possible.
|
|
34944
|
-
@public
|
|
34945
|
-
*/
|
|
34946
34312
|
|
|
34313
|
+
function join(methodOrTarget, methodOrArg) {
|
|
34314
|
+
for (var _len = arguments.length, additionalArgs = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
34315
|
+
additionalArgs[_key - 2] = arguments[_key];
|
|
34316
|
+
}
|
|
34947
34317
|
|
|
34948
|
-
|
|
34949
|
-
return _backburner.join(...arguments);
|
|
34318
|
+
return _backburner.join(methodOrTarget, methodOrArg, ...additionalArgs);
|
|
34950
34319
|
}
|
|
34951
|
-
/**
|
|
34952
|
-
Allows you to specify which context to call the specified function in while
|
|
34953
|
-
adding the execution of that function to the Ember run loop. This ability
|
|
34954
|
-
makes this method a great way to asynchronously integrate third-party libraries
|
|
34955
|
-
into your Ember application.
|
|
34956
|
-
|
|
34957
|
-
`bind` takes two main arguments, the desired context and the function to
|
|
34958
|
-
invoke in that context. Any additional arguments will be supplied as arguments
|
|
34959
|
-
to the function that is passed in.
|
|
34960
|
-
|
|
34961
|
-
Let's use the creation of a TinyMCE component as an example. Currently,
|
|
34962
|
-
TinyMCE provides a setup configuration option we can use to do some processing
|
|
34963
|
-
after the TinyMCE instance is initialized but before it is actually rendered.
|
|
34964
|
-
We can use that setup option to do some additional setup for our component.
|
|
34965
|
-
The component itself could look something like the following:
|
|
34966
|
-
|
|
34967
|
-
```app/components/rich-text-editor.js
|
|
34968
|
-
import Component from '@ember/component';
|
|
34969
|
-
import { on } from '@ember/object/evented';
|
|
34970
|
-
import { bind } from '@ember/runloop';
|
|
34971
|
-
|
|
34972
|
-
export default Component.extend({
|
|
34973
|
-
initializeTinyMCE: on('didInsertElement', function() {
|
|
34974
|
-
tinymce.init({
|
|
34975
|
-
selector: '#' + this.$().prop('id'),
|
|
34976
|
-
setup: bind(this, this.setupEditor)
|
|
34977
|
-
});
|
|
34978
|
-
}),
|
|
34979
|
-
|
|
34980
|
-
didInsertElement() {
|
|
34981
|
-
tinymce.init({
|
|
34982
|
-
selector: '#' + this.$().prop('id'),
|
|
34983
|
-
setup: bind(this, this.setupEditor)
|
|
34984
|
-
});
|
|
34985
|
-
}
|
|
34986
|
-
|
|
34987
|
-
setupEditor(editor) {
|
|
34988
|
-
this.set('editor', editor);
|
|
34989
|
-
|
|
34990
|
-
editor.on('change', function() {
|
|
34991
|
-
console.log('content changed!');
|
|
34992
|
-
});
|
|
34993
|
-
}
|
|
34994
|
-
});
|
|
34995
|
-
```
|
|
34996
|
-
|
|
34997
|
-
In this example, we use `bind` to bind the setupEditor method to the
|
|
34998
|
-
context of the RichTextEditor component and to have the invocation of that
|
|
34999
|
-
method be safely handled and executed by the Ember run loop.
|
|
35000
|
-
|
|
35001
|
-
@method bind
|
|
35002
|
-
@static
|
|
35003
|
-
@for @ember/runloop
|
|
35004
|
-
@param {Object} [target] target of method to call
|
|
35005
|
-
@param {Function|String} method Method to invoke.
|
|
35006
|
-
May be a function or a string. If you pass a string
|
|
35007
|
-
then it will be looked up on the passed target.
|
|
35008
|
-
@param {Object} [args*] Any additional arguments you wish to pass to the method.
|
|
35009
|
-
@return {Function} returns a new function that will always have a particular context
|
|
35010
|
-
@since 1.4.0
|
|
35011
|
-
@public
|
|
35012
|
-
*/
|
|
35013
34320
|
|
|
35014
|
-
|
|
35015
|
-
|
|
35016
|
-
|
|
35017
|
-
curried[_key] = arguments[_key];
|
|
34321
|
+
function bind() {
|
|
34322
|
+
for (var _len2 = arguments.length, curried = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
34323
|
+
curried[_key2] = arguments[_key2];
|
|
35018
34324
|
}
|
|
35019
34325
|
|
|
35020
34326
|
(true && !(function (methodOrTarget, methodOrArg) {
|
|
@@ -35027,12 +34333,12 @@ define("@ember/runloop/index", ["exports", "@ember/debug", "@ember/-internals/er
|
|
|
35027
34333
|
} else if (length === 1) {
|
|
35028
34334
|
return typeof methodOrTarget === 'function';
|
|
35029
34335
|
} else {
|
|
35030
|
-
|
|
35031
|
-
|
|
35032
|
-
methodOrTarget !== null && type === 'string' && methodOrArg in methodOrTarget || // second argument is the name of a method in first argument
|
|
34336
|
+
return typeof methodOrArg === 'function' || // second argument is a function
|
|
34337
|
+
methodOrTarget !== null && typeof methodOrArg === 'string' && methodOrArg in methodOrTarget || // second argument is the name of a method in first argument
|
|
35033
34338
|
typeof methodOrTarget === 'function' //first argument is a function
|
|
35034
34339
|
;
|
|
35035
|
-
}
|
|
34340
|
+
} // @ts-expect-error TS doesn't like our spread args
|
|
34341
|
+
|
|
35036
34342
|
}(...curried)) && (0, _debug.assert)('could not find a suitable method to bind', function (methodOrTarget, methodOrArg) {
|
|
35037
34343
|
var length = arguments.length;
|
|
35038
34344
|
|
|
@@ -35041,18 +34347,18 @@ define("@ember/runloop/index", ["exports", "@ember/debug", "@ember/-internals/er
|
|
|
35041
34347
|
} else if (length === 1) {
|
|
35042
34348
|
return typeof methodOrTarget === 'function';
|
|
35043
34349
|
} else {
|
|
35044
|
-
|
|
35045
|
-
return type === 'function' || methodOrTarget !== null && type === 'string' && methodOrArg in methodOrTarget || typeof methodOrTarget === 'function';
|
|
34350
|
+
return typeof methodOrArg === 'function' || methodOrTarget !== null && typeof methodOrArg === 'string' && methodOrArg in methodOrTarget || typeof methodOrTarget === 'function';
|
|
35046
34351
|
}
|
|
35047
|
-
}(...curried)));
|
|
34352
|
+
}(...curried))); // @ts-expect-error TS doesn't like our spread args
|
|
34353
|
+
|
|
35048
34354
|
return function () {
|
|
35049
|
-
for (var
|
|
35050
|
-
args[
|
|
34355
|
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
|
34356
|
+
args[_key3] = arguments[_key3];
|
|
35051
34357
|
}
|
|
35052
34358
|
|
|
35053
34359
|
return join(...curried.concat(args));
|
|
35054
34360
|
};
|
|
35055
|
-
}
|
|
34361
|
+
}
|
|
35056
34362
|
/**
|
|
35057
34363
|
Begins a new RunLoop. Any deferred actions invoked after the begin will
|
|
35058
34364
|
be buffered until you invoke a matching call to `end()`. This is
|
|
@@ -35074,8 +34380,6 @@ define("@ember/runloop/index", ["exports", "@ember/debug", "@ember/-internals/er
|
|
|
35074
34380
|
*/
|
|
35075
34381
|
|
|
35076
34382
|
|
|
35077
|
-
_exports.bind = bind;
|
|
35078
|
-
|
|
35079
34383
|
function begin() {
|
|
35080
34384
|
_backburner.begin();
|
|
35081
34385
|
}
|
|
@@ -35103,52 +34407,9 @@ define("@ember/runloop/index", ["exports", "@ember/debug", "@ember/-internals/er
|
|
|
35103
34407
|
function end() {
|
|
35104
34408
|
_backburner.end();
|
|
35105
34409
|
}
|
|
35106
|
-
/**
|
|
35107
|
-
Adds the passed target/method and any optional arguments to the named
|
|
35108
|
-
queue to be executed at the end of the RunLoop. If you have not already
|
|
35109
|
-
started a RunLoop when calling this method one will be started for you
|
|
35110
|
-
automatically.
|
|
35111
|
-
|
|
35112
|
-
At the end of a RunLoop, any methods scheduled in this way will be invoked.
|
|
35113
|
-
Methods will be invoked in an order matching the named queues defined in
|
|
35114
|
-
the `queues` property.
|
|
35115
|
-
|
|
35116
|
-
```javascript
|
|
35117
|
-
import { schedule } from '@ember/runloop';
|
|
35118
|
-
|
|
35119
|
-
schedule('afterRender', this, function() {
|
|
35120
|
-
// this will be executed in the 'afterRender' queue
|
|
35121
|
-
console.log('scheduled on afterRender queue');
|
|
35122
|
-
});
|
|
35123
|
-
|
|
35124
|
-
schedule('actions', this, function() {
|
|
35125
|
-
// this will be executed in the 'actions' queue
|
|
35126
|
-
console.log('scheduled on actions queue');
|
|
35127
|
-
});
|
|
35128
|
-
|
|
35129
|
-
// Note the functions will be run in order based on the run queues order.
|
|
35130
|
-
// Output would be:
|
|
35131
|
-
// scheduled on actions queue
|
|
35132
|
-
// scheduled on afterRender queue
|
|
35133
|
-
```
|
|
35134
|
-
|
|
35135
|
-
@method schedule
|
|
35136
|
-
@static
|
|
35137
|
-
@for @ember/runloop
|
|
35138
|
-
@param {String} queue The name of the queue to schedule against. Default queues is 'actions'
|
|
35139
|
-
@param {Object} [target] target object to use as the context when invoking a method.
|
|
35140
|
-
@param {String|Function} method The method to invoke. If you pass a string it
|
|
35141
|
-
will be resolved on the target object at the time the scheduled item is
|
|
35142
|
-
invoked allowing you to change the target function.
|
|
35143
|
-
@param {Object} [arguments*] Optional arguments to be passed to the queued method.
|
|
35144
|
-
@return {*} Timer information for use in canceling, see `cancel`.
|
|
35145
|
-
@public
|
|
35146
|
-
*/
|
|
35147
34410
|
|
|
35148
|
-
|
|
35149
|
-
|
|
35150
|
-
/* queue, target, method */
|
|
35151
|
-
schedule() {
|
|
34411
|
+
function schedule() {
|
|
34412
|
+
// @ts-expect-error TS doesn't like the rest args here
|
|
35152
34413
|
return _backburner.schedule(...arguments);
|
|
35153
34414
|
} // Used by global test teardown
|
|
35154
34415
|
|
|
@@ -35161,226 +34422,31 @@ define("@ember/runloop/index", ["exports", "@ember/debug", "@ember/-internals/er
|
|
|
35161
34422
|
function _cancelTimers() {
|
|
35162
34423
|
_backburner.cancelTimers();
|
|
35163
34424
|
}
|
|
35164
|
-
/**
|
|
35165
|
-
Invokes the passed target/method and optional arguments after a specified
|
|
35166
|
-
period of time. The last parameter of this method must always be a number
|
|
35167
|
-
of milliseconds.
|
|
35168
|
-
|
|
35169
|
-
You should use this method whenever you need to run some action after a
|
|
35170
|
-
period of time instead of using `setTimeout()`. This method will ensure that
|
|
35171
|
-
items that expire during the same script execution cycle all execute
|
|
35172
|
-
together, which is often more efficient than using a real setTimeout.
|
|
35173
|
-
|
|
35174
|
-
```javascript
|
|
35175
|
-
import { later } from '@ember/runloop';
|
|
35176
|
-
|
|
35177
|
-
later(myContext, function() {
|
|
35178
|
-
// code here will execute within a RunLoop in about 500ms with this == myContext
|
|
35179
|
-
}, 500);
|
|
35180
|
-
```
|
|
35181
|
-
|
|
35182
|
-
@method later
|
|
35183
|
-
@static
|
|
35184
|
-
@for @ember/runloop
|
|
35185
|
-
@param {Object} [target] target of method to invoke
|
|
35186
|
-
@param {Function|String} method The method to invoke.
|
|
35187
|
-
If you pass a string it will be resolved on the
|
|
35188
|
-
target at the time the method is invoked.
|
|
35189
|
-
@param {Object} [args*] Optional arguments to pass to the timeout.
|
|
35190
|
-
@param {Number} wait Number of milliseconds to wait.
|
|
35191
|
-
@return {*} Timer information for use in canceling, see `cancel`.
|
|
35192
|
-
@public
|
|
35193
|
-
*/
|
|
35194
34425
|
|
|
35195
|
-
|
|
35196
|
-
function
|
|
35197
|
-
/*target, method*/
|
|
35198
|
-
later() {
|
|
34426
|
+
function later() {
|
|
35199
34427
|
return _backburner.later(...arguments);
|
|
35200
34428
|
}
|
|
35201
|
-
/**
|
|
35202
|
-
Schedule a function to run one time during the current RunLoop. This is equivalent
|
|
35203
|
-
to calling `scheduleOnce` with the "actions" queue.
|
|
35204
|
-
|
|
35205
|
-
@method once
|
|
35206
|
-
@static
|
|
35207
|
-
@for @ember/runloop
|
|
35208
|
-
@param {Object} [target] The target of the method to invoke.
|
|
35209
|
-
@param {Function|String} method The method to invoke.
|
|
35210
|
-
If you pass a string it will be resolved on the
|
|
35211
|
-
target at the time the method is invoked.
|
|
35212
|
-
@param {Object} [args*] Optional arguments to pass to the timeout.
|
|
35213
|
-
@return {Object} Timer information for use in canceling, see `cancel`.
|
|
35214
|
-
@public
|
|
35215
|
-
*/
|
|
35216
|
-
|
|
35217
34429
|
|
|
35218
34430
|
function once() {
|
|
35219
|
-
for (var
|
|
35220
|
-
args[
|
|
34431
|
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
|
34432
|
+
args[_key4] = arguments[_key4];
|
|
35221
34433
|
}
|
|
35222
34434
|
|
|
35223
|
-
args
|
|
35224
|
-
return _backburner.scheduleOnce(...args);
|
|
34435
|
+
// @ts-expect-error TS doesn't like the rest args here
|
|
34436
|
+
return _backburner.scheduleOnce('actions', ...args);
|
|
35225
34437
|
}
|
|
35226
|
-
/**
|
|
35227
|
-
Schedules a function to run one time in a given queue of the current RunLoop.
|
|
35228
|
-
Calling this method with the same queue/target/method combination will have
|
|
35229
|
-
no effect (past the initial call).
|
|
35230
|
-
|
|
35231
|
-
Note that although you can pass optional arguments these will not be
|
|
35232
|
-
considered when looking for duplicates. New arguments will replace previous
|
|
35233
|
-
calls.
|
|
35234
|
-
|
|
35235
|
-
```javascript
|
|
35236
|
-
import { run, scheduleOnce } from '@ember/runloop';
|
|
35237
|
-
|
|
35238
|
-
function sayHi() {
|
|
35239
|
-
console.log('hi');
|
|
35240
|
-
}
|
|
35241
|
-
|
|
35242
|
-
run(function() {
|
|
35243
|
-
scheduleOnce('afterRender', myContext, sayHi);
|
|
35244
|
-
scheduleOnce('afterRender', myContext, sayHi);
|
|
35245
|
-
// sayHi will only be executed once, in the afterRender queue of the RunLoop
|
|
35246
|
-
});
|
|
35247
|
-
```
|
|
35248
|
-
|
|
35249
|
-
Also note that for `scheduleOnce` to prevent additional calls, you need to
|
|
35250
|
-
pass the same function instance. The following case works as expected:
|
|
35251
|
-
|
|
35252
|
-
```javascript
|
|
35253
|
-
function log() {
|
|
35254
|
-
console.log('Logging only once');
|
|
35255
|
-
}
|
|
35256
|
-
|
|
35257
|
-
function scheduleIt() {
|
|
35258
|
-
scheduleOnce('actions', myContext, log);
|
|
35259
|
-
}
|
|
35260
|
-
|
|
35261
|
-
scheduleIt();
|
|
35262
|
-
scheduleIt();
|
|
35263
|
-
```
|
|
35264
|
-
|
|
35265
|
-
But this other case will schedule the function multiple times:
|
|
35266
|
-
|
|
35267
|
-
```javascript
|
|
35268
|
-
import { scheduleOnce } from '@ember/runloop';
|
|
35269
|
-
|
|
35270
|
-
function scheduleIt() {
|
|
35271
|
-
scheduleOnce('actions', myContext, function() {
|
|
35272
|
-
console.log('Closure');
|
|
35273
|
-
});
|
|
35274
|
-
}
|
|
35275
|
-
|
|
35276
|
-
scheduleIt();
|
|
35277
|
-
scheduleIt();
|
|
35278
|
-
|
|
35279
|
-
// "Closure" will print twice, even though we're using `scheduleOnce`,
|
|
35280
|
-
// because the function we pass to it won't match the
|
|
35281
|
-
// previously scheduled operation.
|
|
35282
|
-
```
|
|
35283
|
-
|
|
35284
|
-
Available queues, and their order, can be found at `queues`
|
|
35285
|
-
|
|
35286
|
-
@method scheduleOnce
|
|
35287
|
-
@static
|
|
35288
|
-
@for @ember/runloop
|
|
35289
|
-
@param {String} [queue] The name of the queue to schedule against. Default queues is 'actions'.
|
|
35290
|
-
@param {Object} [target] The target of the method to invoke.
|
|
35291
|
-
@param {Function|String} method The method to invoke.
|
|
35292
|
-
If you pass a string it will be resolved on the
|
|
35293
|
-
target at the time the method is invoked.
|
|
35294
|
-
@param {Object} [args*] Optional arguments to pass to the timeout.
|
|
35295
|
-
@return {Object} Timer information for use in canceling, see `cancel`.
|
|
35296
|
-
@public
|
|
35297
|
-
*/
|
|
35298
|
-
|
|
35299
34438
|
|
|
35300
|
-
function
|
|
35301
|
-
|
|
35302
|
-
scheduleOnce() {
|
|
34439
|
+
function scheduleOnce() {
|
|
34440
|
+
// @ts-expect-error TS doesn't like the rest args here
|
|
35303
34441
|
return _backburner.scheduleOnce(...arguments);
|
|
35304
34442
|
}
|
|
35305
|
-
/**
|
|
35306
|
-
Schedules an item to run from within a separate run loop, after
|
|
35307
|
-
control has been returned to the system. This is equivalent to calling
|
|
35308
|
-
`later` with a wait time of 1ms.
|
|
35309
|
-
|
|
35310
|
-
```javascript
|
|
35311
|
-
import { next } from '@ember/runloop';
|
|
35312
|
-
|
|
35313
|
-
next(myContext, function() {
|
|
35314
|
-
// code to be executed in the next run loop,
|
|
35315
|
-
// which will be scheduled after the current one
|
|
35316
|
-
});
|
|
35317
|
-
```
|
|
35318
|
-
|
|
35319
|
-
Multiple operations scheduled with `next` will coalesce
|
|
35320
|
-
into the same later run loop, along with any other operations
|
|
35321
|
-
scheduled by `later` that expire right around the same
|
|
35322
|
-
time that `next` operations will fire.
|
|
35323
|
-
|
|
35324
|
-
Note that there are often alternatives to using `next`.
|
|
35325
|
-
For instance, if you'd like to schedule an operation to happen
|
|
35326
|
-
after all DOM element operations have completed within the current
|
|
35327
|
-
run loop, you can make use of the `afterRender` run loop queue (added
|
|
35328
|
-
by the `ember-views` package, along with the preceding `render` queue
|
|
35329
|
-
where all the DOM element operations happen).
|
|
35330
|
-
|
|
35331
|
-
Example:
|
|
35332
|
-
|
|
35333
|
-
```app/components/my-component.js
|
|
35334
|
-
import Component from '@ember/component';
|
|
35335
|
-
import { scheduleOnce } from '@ember/runloop';
|
|
35336
|
-
|
|
35337
|
-
export Component.extend({
|
|
35338
|
-
didInsertElement() {
|
|
35339
|
-
this._super(...arguments);
|
|
35340
|
-
scheduleOnce('afterRender', this, 'processChildElements');
|
|
35341
|
-
},
|
|
35342
|
-
|
|
35343
|
-
processChildElements() {
|
|
35344
|
-
// ... do something with component's child component
|
|
35345
|
-
// elements after they've finished rendering, which
|
|
35346
|
-
// can't be done within this component's
|
|
35347
|
-
// `didInsertElement` hook because that gets run
|
|
35348
|
-
// before the child elements have been added to the DOM.
|
|
35349
|
-
}
|
|
35350
|
-
});
|
|
35351
|
-
```
|
|
35352
|
-
|
|
35353
|
-
One benefit of the above approach compared to using `next` is
|
|
35354
|
-
that you will be able to perform DOM/CSS operations before unprocessed
|
|
35355
|
-
elements are rendered to the screen, which may prevent flickering or
|
|
35356
|
-
other artifacts caused by delaying processing until after rendering.
|
|
35357
|
-
|
|
35358
|
-
The other major benefit to the above approach is that `next`
|
|
35359
|
-
introduces an element of non-determinism, which can make things much
|
|
35360
|
-
harder to test, due to its reliance on `setTimeout`; it's much harder
|
|
35361
|
-
to guarantee the order of scheduled operations when they are scheduled
|
|
35362
|
-
outside of the current run loop, i.e. with `next`.
|
|
35363
|
-
|
|
35364
|
-
@method next
|
|
35365
|
-
@static
|
|
35366
|
-
@for @ember/runloop
|
|
35367
|
-
@param {Object} [target] target of method to invoke
|
|
35368
|
-
@param {Function|String} method The method to invoke.
|
|
35369
|
-
If you pass a string it will be resolved on the
|
|
35370
|
-
target at the time the method is invoked.
|
|
35371
|
-
@param {Object} [args*] Optional arguments to pass to the timeout.
|
|
35372
|
-
@return {Object} Timer information for use in canceling, see `cancel`.
|
|
35373
|
-
@public
|
|
35374
|
-
*/
|
|
35375
|
-
|
|
35376
34443
|
|
|
35377
34444
|
function next() {
|
|
35378
|
-
for (var
|
|
35379
|
-
args[
|
|
34445
|
+
for (var _len5 = arguments.length, args = new Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
34446
|
+
args[_key5] = arguments[_key5];
|
|
35380
34447
|
}
|
|
35381
34448
|
|
|
35382
|
-
|
|
35383
|
-
return _backburner.later(...args);
|
|
34449
|
+
return _backburner.later(...args, 1);
|
|
35384
34450
|
}
|
|
35385
34451
|
/**
|
|
35386
34452
|
Cancels a scheduled item. Must be a value returned by `later()`,
|
|
@@ -35454,133 +34520,523 @@ define("@ember/runloop/index", ["exports", "@ember/debug", "@ember/-internals/er
|
|
|
35454
34520
|
function cancel(timer) {
|
|
35455
34521
|
return _backburner.cancel(timer);
|
|
35456
34522
|
}
|
|
35457
|
-
|
|
35458
|
-
|
|
35459
|
-
|
|
35460
|
-
|
|
35461
|
-
|
|
35462
|
-
|
|
35463
|
-
|
|
35464
|
-
|
|
35465
|
-
|
|
35466
|
-
|
|
35467
|
-
|
|
35468
|
-
|
|
35469
|
-
|
|
35470
|
-
|
|
35471
|
-
|
|
35472
|
-
|
|
34523
|
+
|
|
34524
|
+
function debounce() {
|
|
34525
|
+
// @ts-expect-error TS doesn't like the rest args here
|
|
34526
|
+
return _backburner.debounce(...arguments);
|
|
34527
|
+
}
|
|
34528
|
+
|
|
34529
|
+
function throttle() {
|
|
34530
|
+
// @ts-expect-error TS doesn't like the rest args here
|
|
34531
|
+
return _backburner.throttle(...arguments);
|
|
34532
|
+
}
|
|
34533
|
+
});
|
|
34534
|
+
define("@ember/runloop/type-tests.ts/begin-end.test", ["@ember/runloop", "expect-type"], function (_runloop, _expectType) {
|
|
34535
|
+
"use strict";
|
|
34536
|
+
|
|
34537
|
+
(0, _expectType.expectTypeOf)((0, _runloop.begin)()).toEqualTypeOf(); // code to be executed within a RunLoop
|
|
34538
|
+
|
|
34539
|
+
(0, _expectType.expectTypeOf)((0, _runloop.end)()).toEqualTypeOf();
|
|
34540
|
+
});
|
|
34541
|
+
define("@ember/runloop/type-tests.ts/bind.test", ["@ember/runloop", "expect-type"], function (_runloop, _expectType) {
|
|
34542
|
+
"use strict";
|
|
34543
|
+
|
|
34544
|
+
class Foo {
|
|
34545
|
+
test(_foo, _bar, _baz) {
|
|
34546
|
+
return 1;
|
|
35473
34547
|
}
|
|
35474
|
-
|
|
35475
|
-
|
|
35476
|
-
|
|
35477
|
-
|
|
35478
|
-
|
|
35479
|
-
|
|
35480
|
-
|
|
35481
|
-
|
|
35482
|
-
|
|
35483
|
-
|
|
35484
|
-
|
|
35485
|
-
|
|
35486
|
-
|
|
35487
|
-
|
|
35488
|
-
|
|
35489
|
-
|
|
35490
|
-
|
|
35491
|
-
|
|
35492
|
-
|
|
35493
|
-
|
|
35494
|
-
|
|
35495
|
-
|
|
35496
|
-
|
|
35497
|
-
|
|
34548
|
+
|
|
34549
|
+
}
|
|
34550
|
+
|
|
34551
|
+
var foo = new Foo(); // With only function
|
|
34552
|
+
|
|
34553
|
+
(0, _expectType.expectTypeOf)((0, _runloop.bind)((_foo, _bar, _baz) => {
|
|
34554
|
+
return 1;
|
|
34555
|
+
})).toEqualTypeOf();
|
|
34556
|
+
(0, _expectType.expectTypeOf)((0, _runloop.bind)((_foo, _bar, _baz) => {
|
|
34557
|
+
return 1;
|
|
34558
|
+
}, 1)).toEqualTypeOf();
|
|
34559
|
+
(0, _expectType.expectTypeOf)((0, _runloop.bind)((_foo, _bar, _baz) => {
|
|
34560
|
+
return 1;
|
|
34561
|
+
}, 1, true)).toEqualTypeOf();
|
|
34562
|
+
(0, _expectType.expectTypeOf)((0, _runloop.bind)((_foo, _bar, _baz) => {
|
|
34563
|
+
return 1;
|
|
34564
|
+
}, 1, true, 'baz')).toEqualTypeOf();
|
|
34565
|
+
(0, _expectType.expectTypeOf)((0, _runloop.bind)((_foo, _bar, _baz) => {
|
|
34566
|
+
return 1;
|
|
34567
|
+
}, 1, true, undefined)).toEqualTypeOf();
|
|
34568
|
+
(0, _runloop.bind)(_foo => {
|
|
34569
|
+
return 1; // @ts-expect-error invalid argument
|
|
34570
|
+
}, 'string'); // With target and function
|
|
34571
|
+
|
|
34572
|
+
(0, _expectType.expectTypeOf)((0, _runloop.bind)(foo, function (_foo, _bar, _baz) {
|
|
34573
|
+
(0, _expectType.expectTypeOf)(this).toEqualTypeOf();
|
|
34574
|
+
return 1;
|
|
34575
|
+
})).toEqualTypeOf();
|
|
34576
|
+
(0, _expectType.expectTypeOf)((0, _runloop.bind)(foo, function (_foo, _bar, _baz) {
|
|
34577
|
+
return 1;
|
|
34578
|
+
}, 1)).toEqualTypeOf();
|
|
34579
|
+
(0, _expectType.expectTypeOf)((0, _runloop.bind)(foo, function (_foo, _bar, _baz) {
|
|
34580
|
+
return 1;
|
|
34581
|
+
}, 1, true)).toEqualTypeOf();
|
|
34582
|
+
(0, _expectType.expectTypeOf)((0, _runloop.bind)(foo, function (_foo, _bar, _baz) {
|
|
34583
|
+
return 1;
|
|
34584
|
+
}, 1, true, 'baz')).toEqualTypeOf();
|
|
34585
|
+
(0, _expectType.expectTypeOf)((0, _runloop.bind)(foo, function (_foo, _bar, _baz) {
|
|
34586
|
+
return 1;
|
|
34587
|
+
}, 1, true, undefined)).toEqualTypeOf(); // @ts-expect-error Invalid args
|
|
34588
|
+
|
|
34589
|
+
(0, _runloop.bind)(foo, function (_foo) {
|
|
34590
|
+
return 1;
|
|
34591
|
+
}, 'string'); // With function string reference
|
|
34592
|
+
|
|
34593
|
+
(0, _expectType.expectTypeOf)((0, _runloop.bind)(foo, 'test')).toEqualTypeOf();
|
|
34594
|
+
(0, _expectType.expectTypeOf)((0, _runloop.bind)(foo, 'test', 1)).toEqualTypeOf();
|
|
34595
|
+
(0, _expectType.expectTypeOf)((0, _runloop.bind)(foo, 'test', 1, true)).toEqualTypeOf();
|
|
34596
|
+
(0, _expectType.expectTypeOf)((0, _runloop.bind)(foo, 'test', 1, true, 'baz')).toEqualTypeOf();
|
|
34597
|
+
(0, _expectType.expectTypeOf)((0, _runloop.bind)(foo, 'test', 1, true, undefined)).toEqualTypeOf(); // @ts-expect-error Invalid args
|
|
34598
|
+
|
|
34599
|
+
(0, _runloop.bind)(foo, 'test', 'string');
|
|
34600
|
+
});
|
|
34601
|
+
define("@ember/runloop/type-tests.ts/cancel.test", ["@ember/runloop", "expect-type"], function (_runloop, _expectType) {
|
|
34602
|
+
"use strict";
|
|
34603
|
+
|
|
34604
|
+
var runNext = (0, _runloop.next)(null, () => {// will not be executed
|
|
34605
|
+
});
|
|
34606
|
+
(0, _expectType.expectTypeOf)((0, _runloop.cancel)(runNext)).toEqualTypeOf();
|
|
34607
|
+
});
|
|
34608
|
+
define("@ember/runloop/type-tests.ts/debounce.test", ["@ember/runloop", "expect-type"], function (_runloop, _expectType) {
|
|
34609
|
+
"use strict";
|
|
34610
|
+
|
|
34611
|
+
// From Docs
|
|
34612
|
+
function whoRan() {// Do stuff
|
|
34613
|
+
}
|
|
34614
|
+
|
|
34615
|
+
var myContext = {
|
|
34616
|
+
name: 'debounce',
|
|
34617
|
+
|
|
34618
|
+
test(_foo, _baz) {}
|
|
34619
|
+
|
|
34620
|
+
};
|
|
34621
|
+
(0, _runloop.debounce)(myContext, whoRan, 150); // less than 150ms passes
|
|
34622
|
+
|
|
34623
|
+
(0, _runloop.debounce)(myContext, whoRan, 150);
|
|
34624
|
+
(0, _runloop.debounce)(myContext, whoRan, 150, true); // console logs 'debounce ran.' one time immediately.
|
|
34625
|
+
// 100ms passes
|
|
34626
|
+
|
|
34627
|
+
(0, _runloop.debounce)(myContext, whoRan, 150, true); // 150ms passes and nothing else is logged to the console and
|
|
34628
|
+
// the debouncee is no longer being watched
|
|
34629
|
+
|
|
34630
|
+
(0, _runloop.debounce)(myContext, whoRan, 150, true); // console logs 'debounce ran.' one time immediately.
|
|
34631
|
+
// 150ms passes and nothing else is logged to the console and
|
|
34632
|
+
// the debouncee is no longer being watched
|
|
34633
|
+
// Method only
|
|
34634
|
+
|
|
34635
|
+
(0, _expectType.expectTypeOf)((0, _runloop.debounce)((_foo, _baz) => {}, 1, undefined, 1)).toEqualTypeOf(); // @ts-expect-error Requires wait
|
|
34636
|
+
|
|
34637
|
+
(0, _runloop.debounce)((_foo, _baz) => {}, 1, true); // @ts-expect-error Requires all args
|
|
34638
|
+
|
|
34639
|
+
(0, _runloop.debounce)((_foo, _baz) => {}, 1, 1); // Can set immediate
|
|
34640
|
+
|
|
34641
|
+
(0, _runloop.debounce)((_foo, _baz) => {}, 1, true, 1, true); // With target
|
|
34642
|
+
|
|
34643
|
+
(0, _runloop.debounce)(myContext, function (_foo, _baz) {
|
|
34644
|
+
(0, _expectType.expectTypeOf)(this).toEqualTypeOf(myContext);
|
|
34645
|
+
}, 1, true, 1, true); // With key
|
|
34646
|
+
|
|
34647
|
+
(0, _runloop.debounce)(myContext, 'test', 1, true, 1, true); // @ts-expect-error invalid key
|
|
34648
|
+
|
|
34649
|
+
(0, _runloop.debounce)(myContext, 'invalid');
|
|
34650
|
+
|
|
34651
|
+
class Foo {
|
|
34652
|
+
test(_foo, _bar, _baz) {
|
|
34653
|
+
return 1;
|
|
35498
34654
|
}
|
|
35499
|
-
|
|
35500
|
-
let myContext = { name: 'debounce' };
|
|
35501
|
-
|
|
35502
|
-
debounce(myContext, whoRan, 150, true);
|
|
35503
|
-
|
|
35504
|
-
// console logs 'debounce ran.' one time immediately.
|
|
35505
|
-
// 100ms passes
|
|
35506
|
-
debounce(myContext, whoRan, 150, true);
|
|
35507
|
-
|
|
35508
|
-
// 150ms passes and nothing else is logged to the console and
|
|
35509
|
-
// the debouncee is no longer being watched
|
|
35510
|
-
debounce(myContext, whoRan, 150, true);
|
|
35511
|
-
|
|
35512
|
-
// console logs 'debounce ran.' one time immediately.
|
|
35513
|
-
// 150ms passes and nothing else is logged to the console and
|
|
35514
|
-
// the debouncee is no longer being watched
|
|
35515
|
-
```
|
|
35516
|
-
|
|
35517
|
-
@method debounce
|
|
35518
|
-
@static
|
|
35519
|
-
@for @ember/runloop
|
|
35520
|
-
@param {Object} [target] target of method to invoke
|
|
35521
|
-
@param {Function|String} method The method to invoke.
|
|
35522
|
-
May be a function or a string. If you pass a string
|
|
35523
|
-
then it will be looked up on the passed target.
|
|
35524
|
-
@param {Object} [args*] Optional arguments to pass to the timeout.
|
|
35525
|
-
@param {Number} wait Number of milliseconds to wait.
|
|
35526
|
-
@param {Boolean} immediate Trigger the function on the leading instead
|
|
35527
|
-
of the trailing edge of the wait interval. Defaults to false.
|
|
35528
|
-
@return {Array} Timer information for use in canceling, see `cancel`.
|
|
35529
|
-
@public
|
|
35530
|
-
*/
|
|
35531
34655
|
|
|
34656
|
+
}
|
|
34657
|
+
|
|
34658
|
+
var foo = new Foo(); // With only function
|
|
34659
|
+
|
|
34660
|
+
(0, _expectType.expectTypeOf)((0, _runloop.debounce)((_foo, _bar, _baz) => {
|
|
34661
|
+
return 1;
|
|
34662
|
+
}, 1, true, undefined, 1)).toEqualTypeOf();
|
|
34663
|
+
(0, _expectType.expectTypeOf)((0, _runloop.debounce)((_foo, _bar, _baz) => {
|
|
34664
|
+
return 1;
|
|
34665
|
+
}, 1, true, 'string', 1)).toEqualTypeOf();
|
|
34666
|
+
(0, _runloop.debounce)(_foo => {
|
|
34667
|
+
return 1; // @ts-expect-error invalid argument
|
|
34668
|
+
}, 'string'); // With target and function
|
|
34669
|
+
|
|
34670
|
+
(0, _expectType.expectTypeOf)((0, _runloop.debounce)(foo, function (_foo, _bar, _baz) {
|
|
34671
|
+
(0, _expectType.expectTypeOf)(this).toEqualTypeOf();
|
|
34672
|
+
return 1;
|
|
34673
|
+
}, 1, true, undefined, 1)).toEqualTypeOf();
|
|
34674
|
+
(0, _expectType.expectTypeOf)((0, _runloop.debounce)(foo, function (_foo, _bar, _baz) {
|
|
34675
|
+
return 1;
|
|
34676
|
+
}, 1, true, 'string', 1)).toEqualTypeOf(); // @ts-expect-error invalid args
|
|
34677
|
+
|
|
34678
|
+
(0, _runloop.debounce)(foo, function (_foo, _bar, _baz) {
|
|
34679
|
+
return 1;
|
|
34680
|
+
}, 1, 'string', true, 1); // With function string reference
|
|
34681
|
+
|
|
34682
|
+
(0, _expectType.expectTypeOf)((0, _runloop.debounce)(foo, 'test', 1, true, 'string', 1)).toEqualTypeOf();
|
|
34683
|
+
(0, _expectType.expectTypeOf)((0, _runloop.debounce)(foo, 'test', 1, true, undefined, 1)).toEqualTypeOf(); // @ts-expect-error Invalid args
|
|
34684
|
+
|
|
34685
|
+
(0, _runloop.debounce)(foo, 'test', 'string');
|
|
34686
|
+
});
|
|
34687
|
+
define("@ember/runloop/type-tests.ts/join.test", ["@ember/runloop", "expect-type"], function (_runloop, _expectType) {
|
|
34688
|
+
"use strict";
|
|
34689
|
+
|
|
34690
|
+
class Foo {
|
|
34691
|
+
test(_foo, _bar, _baz) {
|
|
34692
|
+
return 1;
|
|
34693
|
+
}
|
|
35532
34694
|
|
|
35533
|
-
function debounce() {
|
|
35534
|
-
return _backburner.debounce(...arguments);
|
|
35535
34695
|
}
|
|
35536
|
-
|
|
35537
|
-
|
|
35538
|
-
|
|
35539
|
-
|
|
35540
|
-
|
|
35541
|
-
|
|
35542
|
-
|
|
35543
|
-
|
|
35544
|
-
|
|
34696
|
+
|
|
34697
|
+
var foo = new Foo(); // With only function
|
|
34698
|
+
|
|
34699
|
+
(0, _expectType.expectTypeOf)((0, _runloop.join)((_foo, _bar, _baz) => {
|
|
34700
|
+
return 1;
|
|
34701
|
+
}, 1, true)).toEqualTypeOf();
|
|
34702
|
+
(0, _expectType.expectTypeOf)((0, _runloop.join)((_foo, _bar, _baz) => {
|
|
34703
|
+
return 1;
|
|
34704
|
+
}, 1, true, 'string')).toEqualTypeOf();
|
|
34705
|
+
(0, _runloop.join)(_foo => {
|
|
34706
|
+
return 1; // @ts-expect-error invalid argument
|
|
34707
|
+
}, 'string'); // With target and function
|
|
34708
|
+
|
|
34709
|
+
(0, _expectType.expectTypeOf)((0, _runloop.join)(foo, function (_foo, _bar, _baz) {
|
|
34710
|
+
(0, _expectType.expectTypeOf)(this).toEqualTypeOf();
|
|
34711
|
+
return 1;
|
|
34712
|
+
}, 1, true)).toEqualTypeOf();
|
|
34713
|
+
(0, _expectType.expectTypeOf)((0, _runloop.join)(foo, function (_foo, _bar, _baz) {
|
|
34714
|
+
return 1;
|
|
34715
|
+
}, 1, true, 'string')).toEqualTypeOf(); // @ts-expect-error invalid args
|
|
34716
|
+
|
|
34717
|
+
(0, _runloop.join)(foo, function (_foo, _bar, _baz) {
|
|
34718
|
+
return 1;
|
|
34719
|
+
}, 1, 'string'); // With function string reference
|
|
34720
|
+
|
|
34721
|
+
(0, _expectType.expectTypeOf)((0, _runloop.join)(foo, 'test', 1, true)).toEqualTypeOf();
|
|
34722
|
+
(0, _expectType.expectTypeOf)((0, _runloop.join)(foo, 'test', 1, true, 'string')).toEqualTypeOf(); // @ts-expect-error Invalid args
|
|
34723
|
+
|
|
34724
|
+
(0, _runloop.join)(foo, 'test', 'string');
|
|
34725
|
+
});
|
|
34726
|
+
define("@ember/runloop/type-tests.ts/later.test", ["@ember/runloop", "expect-type"], function (_runloop, _expectType) {
|
|
34727
|
+
"use strict";
|
|
34728
|
+
|
|
34729
|
+
class Foo {
|
|
34730
|
+
test(_foo, _bar, _baz) {
|
|
34731
|
+
return 1;
|
|
35545
34732
|
}
|
|
35546
|
-
|
|
35547
|
-
let myContext = { name: 'throttle' };
|
|
35548
|
-
|
|
35549
|
-
throttle(myContext, whoRan, 150);
|
|
35550
|
-
// whoRan is invoked with context myContext
|
|
35551
|
-
// console logs 'throttle ran.'
|
|
35552
|
-
|
|
35553
|
-
// 50ms passes
|
|
35554
|
-
throttle(myContext, whoRan, 150);
|
|
35555
|
-
|
|
35556
|
-
// 50ms passes
|
|
35557
|
-
throttle(myContext, whoRan, 150);
|
|
35558
|
-
|
|
35559
|
-
// 150ms passes
|
|
35560
|
-
throttle(myContext, whoRan, 150);
|
|
35561
|
-
// whoRan is invoked with context myContext
|
|
35562
|
-
// console logs 'throttle ran.'
|
|
35563
|
-
```
|
|
35564
|
-
|
|
35565
|
-
@method throttle
|
|
35566
|
-
@static
|
|
35567
|
-
@for @ember/runloop
|
|
35568
|
-
@param {Object} [target] target of method to invoke
|
|
35569
|
-
@param {Function|String} method The method to invoke.
|
|
35570
|
-
May be a function or a string. If you pass a string
|
|
35571
|
-
then it will be looked up on the passed target.
|
|
35572
|
-
@param {Object} [args*] Optional arguments to pass to the timeout.
|
|
35573
|
-
@param {Number} spacing Number of milliseconds to space out requests.
|
|
35574
|
-
@param {Boolean} immediate Trigger the function on the leading instead
|
|
35575
|
-
of the trailing edge of the wait interval. Defaults to true.
|
|
35576
|
-
@return {Array} Timer information for use in canceling, see `cancel`.
|
|
35577
|
-
@public
|
|
35578
|
-
*/
|
|
35579
34733
|
|
|
34734
|
+
}
|
|
34735
|
+
|
|
34736
|
+
var foo = new Foo(); // With only function
|
|
34737
|
+
|
|
34738
|
+
(0, _expectType.expectTypeOf)((0, _runloop.later)((_foo, _bar, _baz) => {
|
|
34739
|
+
return 1;
|
|
34740
|
+
}, 1, true, undefined, 1)).toEqualTypeOf();
|
|
34741
|
+
(0, _expectType.expectTypeOf)((0, _runloop.later)((_foo, _bar, _baz) => {
|
|
34742
|
+
return 1;
|
|
34743
|
+
}, 1, true, 'string', 1)).toEqualTypeOf();
|
|
34744
|
+
(0, _runloop.later)(_foo => {
|
|
34745
|
+
return 1; // @ts-expect-error invalid argument
|
|
34746
|
+
}, 'string'); // With target and function
|
|
34747
|
+
|
|
34748
|
+
(0, _expectType.expectTypeOf)((0, _runloop.later)(foo, function (_foo, _bar, _baz) {
|
|
34749
|
+
(0, _expectType.expectTypeOf)(this).toEqualTypeOf();
|
|
34750
|
+
return 1;
|
|
34751
|
+
}, 1, true, undefined, 1)).toEqualTypeOf();
|
|
34752
|
+
(0, _expectType.expectTypeOf)((0, _runloop.later)(foo, function (_foo, _bar, _baz) {
|
|
34753
|
+
return 1;
|
|
34754
|
+
}, 1, true, 'string', 1)).toEqualTypeOf(); // @ts-expect-error invalid args
|
|
34755
|
+
|
|
34756
|
+
(0, _runloop.later)(foo, function (_foo, _bar, _baz) {
|
|
34757
|
+
return 1;
|
|
34758
|
+
}, 1, 'string', true, 1); // With function string reference
|
|
34759
|
+
|
|
34760
|
+
(0, _expectType.expectTypeOf)((0, _runloop.later)(foo, 'test', 1, true, 'string', 1)).toEqualTypeOf();
|
|
34761
|
+
(0, _expectType.expectTypeOf)((0, _runloop.later)(foo, 'test', 1, true, undefined, 1)).toEqualTypeOf(); // @ts-expect-error Invalid args
|
|
34762
|
+
|
|
34763
|
+
(0, _runloop.later)(foo, 'test', 'string');
|
|
34764
|
+
});
|
|
34765
|
+
define("@ember/runloop/type-tests.ts/next.test", ["@ember/runloop", "expect-type"], function (_runloop, _expectType) {
|
|
34766
|
+
"use strict";
|
|
34767
|
+
|
|
34768
|
+
class Foo {
|
|
34769
|
+
test(_foo, _bar, _baz) {
|
|
34770
|
+
return 1;
|
|
34771
|
+
}
|
|
35580
34772
|
|
|
35581
|
-
function throttle() {
|
|
35582
|
-
return _backburner.throttle(...arguments);
|
|
35583
34773
|
}
|
|
34774
|
+
|
|
34775
|
+
var foo = new Foo(); // With only function
|
|
34776
|
+
|
|
34777
|
+
(0, _expectType.expectTypeOf)((0, _runloop.next)((_foo, _bar, _baz) => {
|
|
34778
|
+
return 1;
|
|
34779
|
+
}, 1, true, undefined)).toEqualTypeOf();
|
|
34780
|
+
(0, _expectType.expectTypeOf)((0, _runloop.next)((_foo, _bar, _baz) => {
|
|
34781
|
+
return 1;
|
|
34782
|
+
}, 1, true, 'string')).toEqualTypeOf();
|
|
34783
|
+
(0, _runloop.next)(_foo => {
|
|
34784
|
+
return 1; // @ts-expect-error invalid argument
|
|
34785
|
+
}, 'string'); // With target and function
|
|
34786
|
+
|
|
34787
|
+
(0, _expectType.expectTypeOf)((0, _runloop.next)(foo, function (_foo, _bar, _baz) {
|
|
34788
|
+
(0, _expectType.expectTypeOf)(this).toEqualTypeOf();
|
|
34789
|
+
return 1;
|
|
34790
|
+
}, 1, true)).toEqualTypeOf();
|
|
34791
|
+
(0, _expectType.expectTypeOf)((0, _runloop.next)(foo, function (_foo, _bar, _baz) {
|
|
34792
|
+
return 1;
|
|
34793
|
+
}, 1, true, 'string')).toEqualTypeOf(); // @ts-expect-error invalid args
|
|
34794
|
+
|
|
34795
|
+
(0, _runloop.next)(foo, function (_foo, _bar, _baz) {
|
|
34796
|
+
return 1;
|
|
34797
|
+
}, 1, 'string', true); // With function string reference
|
|
34798
|
+
|
|
34799
|
+
(0, _expectType.expectTypeOf)((0, _runloop.next)(foo, 'test', 1, true, 'string')).toEqualTypeOf();
|
|
34800
|
+
(0, _expectType.expectTypeOf)((0, _runloop.next)(foo, 'test', 1, true)).toEqualTypeOf(); // @ts-expect-error Invalid args
|
|
34801
|
+
|
|
34802
|
+
(0, _runloop.next)(foo, 'test', 'string');
|
|
34803
|
+
});
|
|
34804
|
+
define("@ember/runloop/type-tests.ts/once.test", ["@ember/runloop", "expect-type"], function (_runloop, _expectType) {
|
|
34805
|
+
"use strict";
|
|
34806
|
+
|
|
34807
|
+
class Foo {
|
|
34808
|
+
test(_foo, _bar, _baz) {
|
|
34809
|
+
return 1;
|
|
34810
|
+
}
|
|
34811
|
+
|
|
34812
|
+
}
|
|
34813
|
+
|
|
34814
|
+
var foo = new Foo(); // With only function
|
|
34815
|
+
|
|
34816
|
+
(0, _expectType.expectTypeOf)((0, _runloop.once)((_foo, _bar, _baz) => {
|
|
34817
|
+
return 1;
|
|
34818
|
+
}, 1, true, undefined)).toEqualTypeOf();
|
|
34819
|
+
(0, _expectType.expectTypeOf)((0, _runloop.once)((_foo, _bar, _baz) => {
|
|
34820
|
+
return 1;
|
|
34821
|
+
}, 1, true, 'string')).toEqualTypeOf();
|
|
34822
|
+
(0, _runloop.once)(_foo => {
|
|
34823
|
+
return 1; // @ts-expect-error invalid argument
|
|
34824
|
+
}, 'string'); // With target and function
|
|
34825
|
+
|
|
34826
|
+
(0, _expectType.expectTypeOf)((0, _runloop.once)(foo, function (_foo, _bar, _baz) {
|
|
34827
|
+
(0, _expectType.expectTypeOf)(this).toEqualTypeOf();
|
|
34828
|
+
return 1;
|
|
34829
|
+
}, 1, true)).toEqualTypeOf();
|
|
34830
|
+
(0, _expectType.expectTypeOf)((0, _runloop.once)(foo, function (_foo, _bar, _baz) {
|
|
34831
|
+
return 1;
|
|
34832
|
+
}, 1, true, 'string')).toEqualTypeOf(); // @ts-expect-error invalid args
|
|
34833
|
+
|
|
34834
|
+
(0, _runloop.once)(foo, function (_foo, _bar, _baz) {
|
|
34835
|
+
return 1;
|
|
34836
|
+
}, 1, 'string', true); // With function string reference
|
|
34837
|
+
|
|
34838
|
+
(0, _expectType.expectTypeOf)((0, _runloop.once)(foo, 'test', 1, true, 'string')).toEqualTypeOf();
|
|
34839
|
+
(0, _expectType.expectTypeOf)((0, _runloop.once)(foo, 'test', 1, true)).toEqualTypeOf(); // @ts-expect-error Invalid args
|
|
34840
|
+
|
|
34841
|
+
(0, _runloop.once)(foo, 'test', 'string');
|
|
34842
|
+
});
|
|
34843
|
+
define("@ember/runloop/type-tests.ts/run.test", ["@ember/runloop", "expect-type"], function (_runloop, _expectType) {
|
|
34844
|
+
"use strict";
|
|
34845
|
+
|
|
34846
|
+
class Foo {
|
|
34847
|
+
test(_foo, _bar, _baz) {
|
|
34848
|
+
return 1;
|
|
34849
|
+
}
|
|
34850
|
+
|
|
34851
|
+
}
|
|
34852
|
+
|
|
34853
|
+
var foo = new Foo(); // With only function
|
|
34854
|
+
|
|
34855
|
+
(0, _expectType.expectTypeOf)((0, _runloop.run)((_foo, _bar, _baz) => {
|
|
34856
|
+
return 1;
|
|
34857
|
+
}, 1, true, undefined)).toEqualTypeOf();
|
|
34858
|
+
(0, _expectType.expectTypeOf)((0, _runloop.run)((_foo, _bar, _baz) => {
|
|
34859
|
+
return 1;
|
|
34860
|
+
}, 1, true, 'string')).toEqualTypeOf();
|
|
34861
|
+
(0, _runloop.run)(_foo => {
|
|
34862
|
+
return 1; // @ts-expect-error invalid argument
|
|
34863
|
+
}, 'string'); // With target and function
|
|
34864
|
+
|
|
34865
|
+
(0, _expectType.expectTypeOf)((0, _runloop.run)(foo, function (_foo, _bar, _baz) {
|
|
34866
|
+
(0, _expectType.expectTypeOf)(this).toEqualTypeOf();
|
|
34867
|
+
return 1;
|
|
34868
|
+
}, 1, true)).toEqualTypeOf();
|
|
34869
|
+
(0, _expectType.expectTypeOf)((0, _runloop.run)(foo, function (_foo, _bar, _baz) {
|
|
34870
|
+
return 1;
|
|
34871
|
+
}, 1, true, 'string')).toEqualTypeOf(); // @ts-expect-error invalid args
|
|
34872
|
+
|
|
34873
|
+
(0, _runloop.run)(foo, function (_foo, _bar, _baz) {
|
|
34874
|
+
return 1;
|
|
34875
|
+
}, 1, 'string', true); // With function string reference
|
|
34876
|
+
|
|
34877
|
+
(0, _expectType.expectTypeOf)((0, _runloop.run)(foo, 'test', 1, true, 'string')).toEqualTypeOf();
|
|
34878
|
+
(0, _expectType.expectTypeOf)((0, _runloop.run)(foo, 'test', 1, true)).toEqualTypeOf(); // @ts-expect-error Invalid args
|
|
34879
|
+
|
|
34880
|
+
(0, _runloop.run)(foo, 'test', 'string');
|
|
34881
|
+
});
|
|
34882
|
+
define("@ember/runloop/type-tests.ts/schedule-once.test", ["@ember/runloop", "expect-type"], function (_runloop, _expectType) {
|
|
34883
|
+
"use strict";
|
|
34884
|
+
|
|
34885
|
+
class Foo {
|
|
34886
|
+
test(_foo, _bar, _baz) {
|
|
34887
|
+
return 1;
|
|
34888
|
+
}
|
|
34889
|
+
|
|
34890
|
+
}
|
|
34891
|
+
|
|
34892
|
+
var foo = new Foo(); // With only function
|
|
34893
|
+
|
|
34894
|
+
(0, _expectType.expectTypeOf)((0, _runloop.scheduleOnce)('my-queue', (_foo, _bar, _baz) => {
|
|
34895
|
+
return 1;
|
|
34896
|
+
}, 1, true, undefined)).toEqualTypeOf();
|
|
34897
|
+
(0, _expectType.expectTypeOf)((0, _runloop.scheduleOnce)('my-queue', (_foo, _bar, _baz) => {
|
|
34898
|
+
return 1;
|
|
34899
|
+
}, 1, true, 'string')).toEqualTypeOf();
|
|
34900
|
+
(0, _runloop.scheduleOnce)('my-queue', _foo => {
|
|
34901
|
+
return 1;
|
|
34902
|
+
}, // @ts-expect-error invalid argument
|
|
34903
|
+
'string'); // With target and function
|
|
34904
|
+
|
|
34905
|
+
(0, _expectType.expectTypeOf)((0, _runloop.scheduleOnce)('my-queue', foo, function (_foo, _bar, _baz) {
|
|
34906
|
+
(0, _expectType.expectTypeOf)(this).toEqualTypeOf();
|
|
34907
|
+
return 1;
|
|
34908
|
+
}, 1, true)).toEqualTypeOf();
|
|
34909
|
+
(0, _expectType.expectTypeOf)((0, _runloop.scheduleOnce)('my-queue', foo, function (_foo, _bar, _baz) {
|
|
34910
|
+
return 1;
|
|
34911
|
+
}, 1, true, 'string')).toEqualTypeOf(); // @ts-expect-error invalid args
|
|
34912
|
+
|
|
34913
|
+
(0, _runloop.scheduleOnce)('my-queue', foo, function (_foo, _bar, _baz) {
|
|
34914
|
+
return 1;
|
|
34915
|
+
}, 1, 'string', true); // With function string reference
|
|
34916
|
+
|
|
34917
|
+
(0, _expectType.expectTypeOf)((0, _runloop.scheduleOnce)('my-queue', foo, 'test', 1, true, 'string')).toEqualTypeOf();
|
|
34918
|
+
(0, _expectType.expectTypeOf)((0, _runloop.scheduleOnce)('my-queue', foo, 'test', 1, true)).toEqualTypeOf(); // @ts-expect-error Invalid args
|
|
34919
|
+
|
|
34920
|
+
(0, _runloop.scheduleOnce)('my-queue', foo, 'test', 'string');
|
|
34921
|
+
});
|
|
34922
|
+
define("@ember/runloop/type-tests.ts/schedule.test", ["@ember/runloop", "expect-type"], function (_runloop, _expectType) {
|
|
34923
|
+
"use strict";
|
|
34924
|
+
|
|
34925
|
+
class Foo {
|
|
34926
|
+
test(_foo, _bar, _baz) {
|
|
34927
|
+
return 1;
|
|
34928
|
+
}
|
|
34929
|
+
|
|
34930
|
+
}
|
|
34931
|
+
|
|
34932
|
+
var foo = new Foo(); // With only function
|
|
34933
|
+
|
|
34934
|
+
(0, _expectType.expectTypeOf)((0, _runloop.schedule)('my-queue', (_foo, _bar, _baz) => {
|
|
34935
|
+
return 1;
|
|
34936
|
+
}, 1, true, undefined)).toEqualTypeOf();
|
|
34937
|
+
(0, _expectType.expectTypeOf)((0, _runloop.schedule)('my-queue', (_foo, _bar, _baz) => {
|
|
34938
|
+
return 1;
|
|
34939
|
+
}, 1, true, 'string')).toEqualTypeOf();
|
|
34940
|
+
(0, _runloop.schedule)('my-queue', _foo => {
|
|
34941
|
+
return 1;
|
|
34942
|
+
}, // @ts-expect-error invalid argument
|
|
34943
|
+
'string'); // With target and function
|
|
34944
|
+
|
|
34945
|
+
(0, _expectType.expectTypeOf)((0, _runloop.schedule)('my-queue', foo, function (_foo, _bar, _baz) {
|
|
34946
|
+
(0, _expectType.expectTypeOf)(this).toEqualTypeOf();
|
|
34947
|
+
return 1;
|
|
34948
|
+
}, 1, true)).toEqualTypeOf();
|
|
34949
|
+
(0, _expectType.expectTypeOf)((0, _runloop.schedule)('my-queue', foo, function (_foo, _bar, _baz) {
|
|
34950
|
+
return 1;
|
|
34951
|
+
}, 1, true, 'string')).toEqualTypeOf(); // @ts-expect-error invalid args
|
|
34952
|
+
|
|
34953
|
+
(0, _runloop.schedule)('my-queue', foo, function (_foo, _bar, _baz) {
|
|
34954
|
+
return 1;
|
|
34955
|
+
}, 1, 'string', true); // With function string reference
|
|
34956
|
+
|
|
34957
|
+
(0, _expectType.expectTypeOf)((0, _runloop.schedule)('my-queue', foo, 'test', 1, true, 'string')).toEqualTypeOf();
|
|
34958
|
+
(0, _expectType.expectTypeOf)((0, _runloop.schedule)('my-queue', foo, 'test', 1, true)).toEqualTypeOf(); // @ts-expect-error Invalid args
|
|
34959
|
+
|
|
34960
|
+
(0, _runloop.schedule)('my-queue', foo, 'test', 'string');
|
|
34961
|
+
});
|
|
34962
|
+
define("@ember/runloop/type-tests.ts/throttle.test", ["@ember/runloop", "expect-type"], function (_runloop, _expectType) {
|
|
34963
|
+
"use strict";
|
|
34964
|
+
|
|
34965
|
+
// From Docs
|
|
34966
|
+
function whoRan() {// Do stuff
|
|
34967
|
+
}
|
|
34968
|
+
|
|
34969
|
+
var myContext = {
|
|
34970
|
+
name: 'throttle',
|
|
34971
|
+
|
|
34972
|
+
test(_foo, _baz) {}
|
|
34973
|
+
|
|
34974
|
+
};
|
|
34975
|
+
(0, _runloop.throttle)(myContext, whoRan, 150); // less than 150ms passes
|
|
34976
|
+
|
|
34977
|
+
(0, _runloop.throttle)(myContext, whoRan, 150);
|
|
34978
|
+
(0, _runloop.throttle)(myContext, whoRan, 150, true); // console logs 'throttle ran.' one time immediately.
|
|
34979
|
+
// 100ms passes
|
|
34980
|
+
|
|
34981
|
+
(0, _runloop.throttle)(myContext, whoRan, 150, true); // 150ms passes and nothing else is logged to the console and
|
|
34982
|
+
// the throttlee is no longer being watched
|
|
34983
|
+
|
|
34984
|
+
(0, _runloop.throttle)(myContext, whoRan, 150, true); // console logs 'throttle ran.' one time immediately.
|
|
34985
|
+
// 150ms passes and nothing else is logged to the console and
|
|
34986
|
+
// the throttlee is no longer being watched
|
|
34987
|
+
// Method only
|
|
34988
|
+
|
|
34989
|
+
(0, _expectType.expectTypeOf)((0, _runloop.throttle)((_foo, _baz) => {}, 1, undefined, 1)).toEqualTypeOf(); // Wait is optional
|
|
34990
|
+
|
|
34991
|
+
(0, _runloop.throttle)((_foo, _baz) => {}, 1, true); // @ts-expect-error Requires all args
|
|
34992
|
+
|
|
34993
|
+
(0, _runloop.throttle)((_foo, _baz) => {}, 1, 1); // Can set immediate
|
|
34994
|
+
|
|
34995
|
+
(0, _runloop.throttle)((_foo, _baz) => {}, 1, true, 1, true); // With target
|
|
34996
|
+
|
|
34997
|
+
(0, _runloop.throttle)(myContext, function (_foo, _baz) {
|
|
34998
|
+
(0, _expectType.expectTypeOf)(this).toEqualTypeOf(myContext);
|
|
34999
|
+
}, 1, true, 1, true); // With key
|
|
35000
|
+
|
|
35001
|
+
(0, _runloop.throttle)(myContext, 'test', 1, true, 1, true); // @ts-expect-error invalid key
|
|
35002
|
+
|
|
35003
|
+
(0, _runloop.throttle)(myContext, 'invalid');
|
|
35004
|
+
|
|
35005
|
+
class Foo {
|
|
35006
|
+
test(_foo, _bar, _baz) {
|
|
35007
|
+
return 1;
|
|
35008
|
+
}
|
|
35009
|
+
|
|
35010
|
+
}
|
|
35011
|
+
|
|
35012
|
+
var foo = new Foo(); // With only function
|
|
35013
|
+
|
|
35014
|
+
(0, _expectType.expectTypeOf)((0, _runloop.throttle)((_foo, _bar, _baz) => {
|
|
35015
|
+
return 1;
|
|
35016
|
+
}, 1, true, undefined, 1)).toEqualTypeOf();
|
|
35017
|
+
(0, _expectType.expectTypeOf)((0, _runloop.throttle)((_foo, _bar, _baz) => {
|
|
35018
|
+
return 1;
|
|
35019
|
+
}, 1, true, 'string', 1)).toEqualTypeOf();
|
|
35020
|
+
(0, _runloop.throttle)(_foo => {
|
|
35021
|
+
return 1; // @ts-expect-error invalid argument
|
|
35022
|
+
}, 'string'); // With target and function
|
|
35023
|
+
|
|
35024
|
+
(0, _expectType.expectTypeOf)((0, _runloop.throttle)(foo, function (_foo, _bar, _baz) {
|
|
35025
|
+
(0, _expectType.expectTypeOf)(this).toEqualTypeOf();
|
|
35026
|
+
return 1;
|
|
35027
|
+
}, 1, true, undefined, 1)).toEqualTypeOf();
|
|
35028
|
+
(0, _expectType.expectTypeOf)((0, _runloop.throttle)(foo, function (_foo, _bar, _baz) {
|
|
35029
|
+
return 1;
|
|
35030
|
+
}, 1, true, 'string', 1)).toEqualTypeOf(); // @ts-expect-error invalid args
|
|
35031
|
+
|
|
35032
|
+
(0, _runloop.throttle)(foo, function (_foo, _bar, _baz) {
|
|
35033
|
+
return 1;
|
|
35034
|
+
}, 1, 'string', true, 1); // With function string reference
|
|
35035
|
+
|
|
35036
|
+
(0, _expectType.expectTypeOf)((0, _runloop.throttle)(foo, 'test', 1, true, 'string', 1)).toEqualTypeOf();
|
|
35037
|
+
(0, _expectType.expectTypeOf)((0, _runloop.throttle)(foo, 'test', 1, true, undefined, 1)).toEqualTypeOf(); // @ts-expect-error Invalid args
|
|
35038
|
+
|
|
35039
|
+
(0, _runloop.throttle)(foo, 'test', 'string');
|
|
35584
35040
|
});
|
|
35585
35041
|
define("@ember/service/index", ["exports", "@ember/-internals/runtime", "@ember/-internals/metal"], function (_exports, _runtime, _metal) {
|
|
35586
35042
|
"use strict";
|
|
@@ -55431,6 +54887,7 @@ define("ember/index", ["exports", "require", "@ember/-internals/environment", "@
|
|
|
55431
54887
|
id: 'ember-string.htmlsafe-ishtmlsafe',
|
|
55432
54888
|
for: 'ember-source',
|
|
55433
54889
|
since: {
|
|
54890
|
+
available: '3.25',
|
|
55434
54891
|
enabled: '3.25'
|
|
55435
54892
|
},
|
|
55436
54893
|
until: '4.0.0',
|
|
@@ -55613,7 +55070,7 @@ define("ember/version", ["exports"], function (_exports) {
|
|
|
55613
55070
|
value: true
|
|
55614
55071
|
});
|
|
55615
55072
|
_exports.default = void 0;
|
|
55616
|
-
var _default = "4.4.0-alpha.
|
|
55073
|
+
var _default = "4.4.0-alpha.5";
|
|
55617
55074
|
_exports.default = _default;
|
|
55618
55075
|
});
|
|
55619
55076
|
define("route-recognizer", ["exports"], function (_exports) {
|