@angular-wave/angular.ts 0.0.2 → 0.0.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/dist/angular-ts.cjs.js +29 -96
- package/dist/angular-ts.esm.js +29 -96
- package/dist/angular-ts.umd.js +29 -96
- package/package.json +1 -4
- package/public/README.md +1 -0
- package/src/core/cache.js +2 -0
- package/src/core/compile.js +2 -1
- package/src/core/utils.js +8 -0
- package/src/directive/csp.md +2 -0
- package/src/directive/switch.js +5 -63
- package/src/directive/switch.md +66 -0
- package/src/jqLite.js +14 -33
- package/test/jqlite.spec.js +6 -17
- package/test/ng/compile.spec.js +6 -5
- package/test/original-test.html +1 -1
- package/dist/build/angular-mocks.js +0 -3757
- package/dist/build/angular-parse-ext.js +0 -1275
- package/dist/build/angular-resource.js +0 -911
- package/dist/build/angular-touch.js +0 -368
- /package/{dist/build → legacy}/angular-animate.js +0 -0
- /package/{dist/build → legacy}/angular-aria.js +0 -0
- /package/{dist/build → legacy}/angular-message-format.js +0 -0
- /package/{dist/build → legacy}/angular-messages.js +0 -0
- /package/{dist/build → legacy}/angular-route.js +0 -0
- /package/{dist/build → legacy}/angular-sanitize.js +0 -0
- /package/{dist/build → legacy}/angular.js +0 -0
package/dist/angular-ts.cjs.js
CHANGED
|
@@ -616,6 +616,14 @@ function includes(array, obj) {
|
|
|
616
616
|
return Array.prototype.indexOf.call(array, obj) !== -1;
|
|
617
617
|
}
|
|
618
618
|
|
|
619
|
+
/**
|
|
620
|
+
* Removes the first occurrence of a specified value from an array.
|
|
621
|
+
*
|
|
622
|
+
* @template T
|
|
623
|
+
* @param {Array<T>} array - The array from which to remove the value.
|
|
624
|
+
* @param {T} value - The value to remove.
|
|
625
|
+
* @returns {number} - The index of the removed value, or -1 if the value was not found.
|
|
626
|
+
*/
|
|
619
627
|
function arrayRemove(array, value) {
|
|
620
628
|
const index = array.indexOf(value);
|
|
621
629
|
if (index >= 0) {
|
|
@@ -1351,6 +1359,8 @@ function directiveNormalize(name) {
|
|
|
1351
1359
|
*
|
|
1352
1360
|
*/
|
|
1353
1361
|
|
|
1362
|
+
const EXPANDO = "ngId";
|
|
1363
|
+
|
|
1354
1364
|
/**
|
|
1355
1365
|
* Expando cache for adding properties to DOM nodes with JavaScript.
|
|
1356
1366
|
* This used to be an Object in JQLite decorator, but swapped out for a Map
|
|
@@ -1465,18 +1475,8 @@ const CACHE = new Proxy(new Map(), {
|
|
|
1465
1475
|
* @returns {Object} jQuery object.
|
|
1466
1476
|
*/
|
|
1467
1477
|
|
|
1468
|
-
JQLite.cache = CACHE;
|
|
1469
|
-
|
|
1470
|
-
const EXPANDO = "ngId";
|
|
1471
1478
|
let jqId = 1;
|
|
1472
1479
|
|
|
1473
|
-
/**
|
|
1474
|
-
* !!! This is an undocumented "private" function !!!
|
|
1475
|
-
* @param {JQLite|Element} node
|
|
1476
|
-
* @returns
|
|
1477
|
-
*/
|
|
1478
|
-
JQLite._data = (node) => JQLite.cache.get(node[EXPANDO]) || {};
|
|
1479
|
-
|
|
1480
1480
|
function jqNextId() {
|
|
1481
1481
|
return ++jqId;
|
|
1482
1482
|
}
|
|
@@ -1562,13 +1562,6 @@ function elementAcceptsData(node) {
|
|
|
1562
1562
|
}
|
|
1563
1563
|
}
|
|
1564
1564
|
|
|
1565
|
-
function jqLiteHasData(node) {
|
|
1566
|
-
for (const key in JQLite.cache.get(node[EXPANDO])) {
|
|
1567
|
-
return true;
|
|
1568
|
-
}
|
|
1569
|
-
return false;
|
|
1570
|
-
}
|
|
1571
|
-
|
|
1572
1565
|
function jqLiteBuildFragment(html, context) {
|
|
1573
1566
|
let tmp;
|
|
1574
1567
|
let tag;
|
|
@@ -1668,6 +1661,11 @@ function JQLite(element) {
|
|
|
1668
1661
|
}
|
|
1669
1662
|
var jqLite = JQLite;
|
|
1670
1663
|
|
|
1664
|
+
/**
|
|
1665
|
+
* @param {Element} element
|
|
1666
|
+
* @param {boolean} [onlyDescendants]
|
|
1667
|
+
* @returns {void}
|
|
1668
|
+
*/
|
|
1671
1669
|
function dealoc(element, onlyDescendants) {
|
|
1672
1670
|
if (!element) return;
|
|
1673
1671
|
if (!onlyDescendants && elementAcceptsData(element))
|
|
@@ -1686,13 +1684,13 @@ function dealoc(element, onlyDescendants) {
|
|
|
1686
1684
|
*/
|
|
1687
1685
|
function removeIfEmptyData(element) {
|
|
1688
1686
|
const expandoId = element[EXPANDO];
|
|
1689
|
-
const { events, data } =
|
|
1687
|
+
const { events, data } = CACHE.get(expandoId);
|
|
1690
1688
|
|
|
1691
1689
|
if (
|
|
1692
1690
|
(!data || !Object.keys(data).length) &&
|
|
1693
1691
|
(!events || !Object.keys(events).length)
|
|
1694
1692
|
) {
|
|
1695
|
-
|
|
1693
|
+
CACHE.delete(expandoId);
|
|
1696
1694
|
element[EXPANDO] = undefined; // don't delete DOM expandos. IE and Chrome don't like it
|
|
1697
1695
|
}
|
|
1698
1696
|
}
|
|
@@ -1720,8 +1718,8 @@ function jqLiteOff(element, type, fn, unsupported) {
|
|
|
1720
1718
|
} else {
|
|
1721
1719
|
const removeHandler = function (type) {
|
|
1722
1720
|
const listenerFns = events[type];
|
|
1723
|
-
if (isDefined(fn)) {
|
|
1724
|
-
arrayRemove(listenerFns
|
|
1721
|
+
if (isDefined(fn) && isArray(listenerFns)) {
|
|
1722
|
+
arrayRemove(listenerFns, fn);
|
|
1725
1723
|
}
|
|
1726
1724
|
if (!(isDefined(fn) && listenerFns && listenerFns.length > 0)) {
|
|
1727
1725
|
element.removeEventListener(type, handle);
|
|
@@ -1749,7 +1747,7 @@ function jqLiteOff(element, type, fn, unsupported) {
|
|
|
1749
1747
|
*/
|
|
1750
1748
|
function jqLiteRemoveData(element, name) {
|
|
1751
1749
|
const expandoId = element[EXPANDO];
|
|
1752
|
-
const expandoStore = expandoId &&
|
|
1750
|
+
const expandoStore = expandoId && CACHE.get(expandoId);
|
|
1753
1751
|
|
|
1754
1752
|
if (expandoStore) {
|
|
1755
1753
|
if (name) {
|
|
@@ -1770,7 +1768,7 @@ function jqLiteRemoveData(element, name) {
|
|
|
1770
1768
|
*/
|
|
1771
1769
|
function jqLiteExpandoStore(element, createIfNecessary = false) {
|
|
1772
1770
|
let expandoId = element[EXPANDO];
|
|
1773
|
-
let expandoStore = expandoId &&
|
|
1771
|
+
let expandoStore = expandoId && CACHE.get(expandoId);
|
|
1774
1772
|
|
|
1775
1773
|
if (createIfNecessary && !expandoStore) {
|
|
1776
1774
|
element[EXPANDO] = expandoId = jqNextId();
|
|
@@ -1779,7 +1777,7 @@ function jqLiteExpandoStore(element, createIfNecessary = false) {
|
|
|
1779
1777
|
data: {},
|
|
1780
1778
|
handle: null,
|
|
1781
1779
|
};
|
|
1782
|
-
|
|
1780
|
+
CACHE.set(expandoId, expandoStore);
|
|
1783
1781
|
}
|
|
1784
1782
|
|
|
1785
1783
|
return expandoStore;
|
|
@@ -1796,15 +1794,12 @@ function jqLiteData(element, key, value) {
|
|
|
1796
1794
|
const data = expandoStore && expandoStore.data;
|
|
1797
1795
|
|
|
1798
1796
|
if (isSimpleSetter) {
|
|
1799
|
-
// data('key', value)
|
|
1800
1797
|
data[kebabToCamel(key)] = value;
|
|
1801
1798
|
} else {
|
|
1802
1799
|
if (massGetter) {
|
|
1803
|
-
// data()
|
|
1804
1800
|
return data;
|
|
1805
1801
|
}
|
|
1806
1802
|
if (isSimpleGetter) {
|
|
1807
|
-
// data('key')
|
|
1808
1803
|
// don't force creation of expandoStore if it doesn't exist yet
|
|
1809
1804
|
return data && data[kebabToCamel(key)];
|
|
1810
1805
|
}
|
|
@@ -1951,7 +1946,7 @@ function getBooleanAttrName(element, name) {
|
|
|
1951
1946
|
|
|
1952
1947
|
function jqLiteCleanData(nodes) {
|
|
1953
1948
|
for (let i = 0, ii = nodes.length; i < ii; i++) {
|
|
1954
|
-
var events = (
|
|
1949
|
+
var events = (CACHE.get(nodes[i][EXPANDO]) || {}).events;
|
|
1955
1950
|
if (events && events.$destroy) {
|
|
1956
1951
|
jqLite(nodes[i]).triggerHandler("$destroy");
|
|
1957
1952
|
}
|
|
@@ -1964,7 +1959,6 @@ forEach(
|
|
|
1964
1959
|
{
|
|
1965
1960
|
data: jqLiteData,
|
|
1966
1961
|
removeData: jqLiteRemoveData,
|
|
1967
|
-
hasData: jqLiteHasData,
|
|
1968
1962
|
cleanData: jqLiteCleanData,
|
|
1969
1963
|
},
|
|
1970
1964
|
(fn, name) => {
|
|
@@ -2087,8 +2081,6 @@ forEach(
|
|
|
2087
2081
|
let key;
|
|
2088
2082
|
const nodeCount = this.length;
|
|
2089
2083
|
|
|
2090
|
-
// jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it
|
|
2091
|
-
// in a way that survives minification.
|
|
2092
2084
|
// jqLiteEmpty takes no arguments but is a setter.
|
|
2093
2085
|
if (
|
|
2094
2086
|
fn !== jqLiteEmpty &&
|
|
@@ -2098,7 +2090,6 @@ forEach(
|
|
|
2098
2090
|
// we are a write, but the object properties are the key/values
|
|
2099
2091
|
for (i = 0; i < nodeCount; i++) {
|
|
2100
2092
|
if (fn === jqLiteData) {
|
|
2101
|
-
// data() takes the whole object in jQuery
|
|
2102
2093
|
fn(this[i], arg1);
|
|
2103
2094
|
} else {
|
|
2104
2095
|
for (key in arg1) {
|
|
@@ -9641,7 +9632,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
|
9641
9632
|
fragment.appendChild(elementsToRemove[i]);
|
|
9642
9633
|
}
|
|
9643
9634
|
|
|
9644
|
-
if (
|
|
9635
|
+
if (CACHE.has(firstElementToRemove[EXPANDO])) {
|
|
9645
9636
|
// Copy over user data (that includes AngularJS's $scope etc.). Don't copy private
|
|
9646
9637
|
// data here because there's no public interface in jQuery to do that and copying over
|
|
9647
9638
|
// event listeners (which is the main use of private data) wouldn't work anyway.
|
|
@@ -16741,66 +16732,6 @@ function ngStyleDirective() {
|
|
|
16741
16732
|
};
|
|
16742
16733
|
}
|
|
16743
16734
|
|
|
16744
|
-
/**
|
|
16745
|
-
* @ngdoc directive
|
|
16746
|
-
* @name ngSwitch
|
|
16747
|
-
* @restrict EA
|
|
16748
|
-
*
|
|
16749
|
-
* @description
|
|
16750
|
-
* The `ngSwitch` directive is used to conditionally swap DOM structure on your template based on a scope expression.
|
|
16751
|
-
* Elements within `ngSwitch` but without `ngSwitchWhen` or `ngSwitchDefault` directives will be preserved at the location
|
|
16752
|
-
* as specified in the template.
|
|
16753
|
-
*
|
|
16754
|
-
* The directive itself works similar to ngInclude, however, instead of downloading template code (or loading it
|
|
16755
|
-
* from the template cache), `ngSwitch` simply chooses one of the nested elements and makes it visible based on which element
|
|
16756
|
-
* matches the value obtained from the evaluated expression. In other words, you define a container element
|
|
16757
|
-
* (where you place the directive), place an expression on the **`on="..."` attribute**
|
|
16758
|
-
* (or the **`ng-switch="..."` attribute**), define any inner elements inside of the directive and place
|
|
16759
|
-
* a when attribute per element. The when attribute is used to inform ngSwitch which element to display when the on
|
|
16760
|
-
* expression is evaluated. If a matching expression is not found via a when attribute then an element with the default
|
|
16761
|
-
* attribute is displayed.
|
|
16762
|
-
*
|
|
16763
|
-
* <div class="alert alert-info">
|
|
16764
|
-
* Be aware that the attribute values to match against cannot be expressions. They are interpreted
|
|
16765
|
-
* as literal string values to match against.
|
|
16766
|
-
* For example, **`ng-switch-when="someVal"`** will match against the string `"someVal"` not against the
|
|
16767
|
-
* value of the expression `$scope.someVal`.
|
|
16768
|
-
* </div>
|
|
16769
|
-
|
|
16770
|
-
* @animations
|
|
16771
|
-
* | Animation | Occurs |
|
|
16772
|
-
* |----------------------------------|-------------------------------------|
|
|
16773
|
-
* | {@link ng.$animate#enter enter} | after the ngSwitch contents change and the matched child element is placed inside the container |
|
|
16774
|
-
* | {@link ng.$animate#leave leave} | after the ngSwitch contents change and just before the former contents are removed from the DOM |
|
|
16775
|
-
*
|
|
16776
|
-
* @usage
|
|
16777
|
-
*
|
|
16778
|
-
* ```
|
|
16779
|
-
* <ANY ng-switch="expression">
|
|
16780
|
-
* <ANY ng-switch-when="matchValue1">...</ANY>
|
|
16781
|
-
* <ANY ng-switch-when="matchValue2">...</ANY>
|
|
16782
|
-
* <ANY ng-switch-default>...</ANY>
|
|
16783
|
-
* </ANY>
|
|
16784
|
-
* ```
|
|
16785
|
-
*
|
|
16786
|
-
*
|
|
16787
|
-
* @scope
|
|
16788
|
-
* @priority 1200
|
|
16789
|
-
* @param {*} ngSwitch|on expression to match against <code>ng-switch-when</code>.
|
|
16790
|
-
* On child elements add:
|
|
16791
|
-
*
|
|
16792
|
-
* * `ngSwitchWhen`: the case statement to match against. If match then this
|
|
16793
|
-
* case will be displayed. If the same match appears multiple times, all the
|
|
16794
|
-
* elements will be displayed. It is possible to associate multiple values to
|
|
16795
|
-
* the same `ngSwitchWhen` by defining the optional attribute
|
|
16796
|
-
* `ngSwitchWhenSeparator`. The separator will be used to split the value of
|
|
16797
|
-
* the `ngSwitchWhen` attribute into multiple tokens, and the element will show
|
|
16798
|
-
* if any of the `ngSwitch` evaluates to any of these tokens.
|
|
16799
|
-
* * `ngSwitchDefault`: the default case when no other case match. If there
|
|
16800
|
-
* are multiple default cases, all of them will be displayed when no other
|
|
16801
|
-
* case match.
|
|
16802
|
-
*
|
|
16803
|
-
*/
|
|
16804
16735
|
const ngSwitchDirective = [
|
|
16805
16736
|
"$animate",
|
|
16806
16737
|
"$compile",
|
|
@@ -16810,11 +16741,13 @@ const ngSwitchDirective = [
|
|
|
16810
16741
|
// asks for $scope to fool the BC controller module
|
|
16811
16742
|
controller: [
|
|
16812
16743
|
"$scope",
|
|
16813
|
-
|
|
16814
|
-
|
|
16744
|
+
class {
|
|
16745
|
+
constructor() {
|
|
16746
|
+
this.cases = {};
|
|
16747
|
+
}
|
|
16815
16748
|
},
|
|
16816
16749
|
],
|
|
16817
|
-
link(scope,
|
|
16750
|
+
link(scope, _element, attr, ngSwitchController) {
|
|
16818
16751
|
const watchExpr = attr.ngSwitch || attr.on;
|
|
16819
16752
|
let selectedTranscludes = [];
|
|
16820
16753
|
const selectedElements = [];
|
package/dist/angular-ts.esm.js
CHANGED
|
@@ -614,6 +614,14 @@ function includes(array, obj) {
|
|
|
614
614
|
return Array.prototype.indexOf.call(array, obj) !== -1;
|
|
615
615
|
}
|
|
616
616
|
|
|
617
|
+
/**
|
|
618
|
+
* Removes the first occurrence of a specified value from an array.
|
|
619
|
+
*
|
|
620
|
+
* @template T
|
|
621
|
+
* @param {Array<T>} array - The array from which to remove the value.
|
|
622
|
+
* @param {T} value - The value to remove.
|
|
623
|
+
* @returns {number} - The index of the removed value, or -1 if the value was not found.
|
|
624
|
+
*/
|
|
617
625
|
function arrayRemove(array, value) {
|
|
618
626
|
const index = array.indexOf(value);
|
|
619
627
|
if (index >= 0) {
|
|
@@ -1349,6 +1357,8 @@ function directiveNormalize(name) {
|
|
|
1349
1357
|
*
|
|
1350
1358
|
*/
|
|
1351
1359
|
|
|
1360
|
+
const EXPANDO = "ngId";
|
|
1361
|
+
|
|
1352
1362
|
/**
|
|
1353
1363
|
* Expando cache for adding properties to DOM nodes with JavaScript.
|
|
1354
1364
|
* This used to be an Object in JQLite decorator, but swapped out for a Map
|
|
@@ -1463,18 +1473,8 @@ const CACHE = new Proxy(new Map(), {
|
|
|
1463
1473
|
* @returns {Object} jQuery object.
|
|
1464
1474
|
*/
|
|
1465
1475
|
|
|
1466
|
-
JQLite.cache = CACHE;
|
|
1467
|
-
|
|
1468
|
-
const EXPANDO = "ngId";
|
|
1469
1476
|
let jqId = 1;
|
|
1470
1477
|
|
|
1471
|
-
/**
|
|
1472
|
-
* !!! This is an undocumented "private" function !!!
|
|
1473
|
-
* @param {JQLite|Element} node
|
|
1474
|
-
* @returns
|
|
1475
|
-
*/
|
|
1476
|
-
JQLite._data = (node) => JQLite.cache.get(node[EXPANDO]) || {};
|
|
1477
|
-
|
|
1478
1478
|
function jqNextId() {
|
|
1479
1479
|
return ++jqId;
|
|
1480
1480
|
}
|
|
@@ -1560,13 +1560,6 @@ function elementAcceptsData(node) {
|
|
|
1560
1560
|
}
|
|
1561
1561
|
}
|
|
1562
1562
|
|
|
1563
|
-
function jqLiteHasData(node) {
|
|
1564
|
-
for (const key in JQLite.cache.get(node[EXPANDO])) {
|
|
1565
|
-
return true;
|
|
1566
|
-
}
|
|
1567
|
-
return false;
|
|
1568
|
-
}
|
|
1569
|
-
|
|
1570
1563
|
function jqLiteBuildFragment(html, context) {
|
|
1571
1564
|
let tmp;
|
|
1572
1565
|
let tag;
|
|
@@ -1666,6 +1659,11 @@ function JQLite(element) {
|
|
|
1666
1659
|
}
|
|
1667
1660
|
var jqLite = JQLite;
|
|
1668
1661
|
|
|
1662
|
+
/**
|
|
1663
|
+
* @param {Element} element
|
|
1664
|
+
* @param {boolean} [onlyDescendants]
|
|
1665
|
+
* @returns {void}
|
|
1666
|
+
*/
|
|
1669
1667
|
function dealoc(element, onlyDescendants) {
|
|
1670
1668
|
if (!element) return;
|
|
1671
1669
|
if (!onlyDescendants && elementAcceptsData(element))
|
|
@@ -1684,13 +1682,13 @@ function dealoc(element, onlyDescendants) {
|
|
|
1684
1682
|
*/
|
|
1685
1683
|
function removeIfEmptyData(element) {
|
|
1686
1684
|
const expandoId = element[EXPANDO];
|
|
1687
|
-
const { events, data } =
|
|
1685
|
+
const { events, data } = CACHE.get(expandoId);
|
|
1688
1686
|
|
|
1689
1687
|
if (
|
|
1690
1688
|
(!data || !Object.keys(data).length) &&
|
|
1691
1689
|
(!events || !Object.keys(events).length)
|
|
1692
1690
|
) {
|
|
1693
|
-
|
|
1691
|
+
CACHE.delete(expandoId);
|
|
1694
1692
|
element[EXPANDO] = undefined; // don't delete DOM expandos. IE and Chrome don't like it
|
|
1695
1693
|
}
|
|
1696
1694
|
}
|
|
@@ -1718,8 +1716,8 @@ function jqLiteOff(element, type, fn, unsupported) {
|
|
|
1718
1716
|
} else {
|
|
1719
1717
|
const removeHandler = function (type) {
|
|
1720
1718
|
const listenerFns = events[type];
|
|
1721
|
-
if (isDefined(fn)) {
|
|
1722
|
-
arrayRemove(listenerFns
|
|
1719
|
+
if (isDefined(fn) && isArray(listenerFns)) {
|
|
1720
|
+
arrayRemove(listenerFns, fn);
|
|
1723
1721
|
}
|
|
1724
1722
|
if (!(isDefined(fn) && listenerFns && listenerFns.length > 0)) {
|
|
1725
1723
|
element.removeEventListener(type, handle);
|
|
@@ -1747,7 +1745,7 @@ function jqLiteOff(element, type, fn, unsupported) {
|
|
|
1747
1745
|
*/
|
|
1748
1746
|
function jqLiteRemoveData(element, name) {
|
|
1749
1747
|
const expandoId = element[EXPANDO];
|
|
1750
|
-
const expandoStore = expandoId &&
|
|
1748
|
+
const expandoStore = expandoId && CACHE.get(expandoId);
|
|
1751
1749
|
|
|
1752
1750
|
if (expandoStore) {
|
|
1753
1751
|
if (name) {
|
|
@@ -1768,7 +1766,7 @@ function jqLiteRemoveData(element, name) {
|
|
|
1768
1766
|
*/
|
|
1769
1767
|
function jqLiteExpandoStore(element, createIfNecessary = false) {
|
|
1770
1768
|
let expandoId = element[EXPANDO];
|
|
1771
|
-
let expandoStore = expandoId &&
|
|
1769
|
+
let expandoStore = expandoId && CACHE.get(expandoId);
|
|
1772
1770
|
|
|
1773
1771
|
if (createIfNecessary && !expandoStore) {
|
|
1774
1772
|
element[EXPANDO] = expandoId = jqNextId();
|
|
@@ -1777,7 +1775,7 @@ function jqLiteExpandoStore(element, createIfNecessary = false) {
|
|
|
1777
1775
|
data: {},
|
|
1778
1776
|
handle: null,
|
|
1779
1777
|
};
|
|
1780
|
-
|
|
1778
|
+
CACHE.set(expandoId, expandoStore);
|
|
1781
1779
|
}
|
|
1782
1780
|
|
|
1783
1781
|
return expandoStore;
|
|
@@ -1794,15 +1792,12 @@ function jqLiteData(element, key, value) {
|
|
|
1794
1792
|
const data = expandoStore && expandoStore.data;
|
|
1795
1793
|
|
|
1796
1794
|
if (isSimpleSetter) {
|
|
1797
|
-
// data('key', value)
|
|
1798
1795
|
data[kebabToCamel(key)] = value;
|
|
1799
1796
|
} else {
|
|
1800
1797
|
if (massGetter) {
|
|
1801
|
-
// data()
|
|
1802
1798
|
return data;
|
|
1803
1799
|
}
|
|
1804
1800
|
if (isSimpleGetter) {
|
|
1805
|
-
// data('key')
|
|
1806
1801
|
// don't force creation of expandoStore if it doesn't exist yet
|
|
1807
1802
|
return data && data[kebabToCamel(key)];
|
|
1808
1803
|
}
|
|
@@ -1949,7 +1944,7 @@ function getBooleanAttrName(element, name) {
|
|
|
1949
1944
|
|
|
1950
1945
|
function jqLiteCleanData(nodes) {
|
|
1951
1946
|
for (let i = 0, ii = nodes.length; i < ii; i++) {
|
|
1952
|
-
var events = (
|
|
1947
|
+
var events = (CACHE.get(nodes[i][EXPANDO]) || {}).events;
|
|
1953
1948
|
if (events && events.$destroy) {
|
|
1954
1949
|
jqLite(nodes[i]).triggerHandler("$destroy");
|
|
1955
1950
|
}
|
|
@@ -1962,7 +1957,6 @@ forEach(
|
|
|
1962
1957
|
{
|
|
1963
1958
|
data: jqLiteData,
|
|
1964
1959
|
removeData: jqLiteRemoveData,
|
|
1965
|
-
hasData: jqLiteHasData,
|
|
1966
1960
|
cleanData: jqLiteCleanData,
|
|
1967
1961
|
},
|
|
1968
1962
|
(fn, name) => {
|
|
@@ -2085,8 +2079,6 @@ forEach(
|
|
|
2085
2079
|
let key;
|
|
2086
2080
|
const nodeCount = this.length;
|
|
2087
2081
|
|
|
2088
|
-
// jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it
|
|
2089
|
-
// in a way that survives minification.
|
|
2090
2082
|
// jqLiteEmpty takes no arguments but is a setter.
|
|
2091
2083
|
if (
|
|
2092
2084
|
fn !== jqLiteEmpty &&
|
|
@@ -2096,7 +2088,6 @@ forEach(
|
|
|
2096
2088
|
// we are a write, but the object properties are the key/values
|
|
2097
2089
|
for (i = 0; i < nodeCount; i++) {
|
|
2098
2090
|
if (fn === jqLiteData) {
|
|
2099
|
-
// data() takes the whole object in jQuery
|
|
2100
2091
|
fn(this[i], arg1);
|
|
2101
2092
|
} else {
|
|
2102
2093
|
for (key in arg1) {
|
|
@@ -9639,7 +9630,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
|
|
|
9639
9630
|
fragment.appendChild(elementsToRemove[i]);
|
|
9640
9631
|
}
|
|
9641
9632
|
|
|
9642
|
-
if (
|
|
9633
|
+
if (CACHE.has(firstElementToRemove[EXPANDO])) {
|
|
9643
9634
|
// Copy over user data (that includes AngularJS's $scope etc.). Don't copy private
|
|
9644
9635
|
// data here because there's no public interface in jQuery to do that and copying over
|
|
9645
9636
|
// event listeners (which is the main use of private data) wouldn't work anyway.
|
|
@@ -16739,66 +16730,6 @@ function ngStyleDirective() {
|
|
|
16739
16730
|
};
|
|
16740
16731
|
}
|
|
16741
16732
|
|
|
16742
|
-
/**
|
|
16743
|
-
* @ngdoc directive
|
|
16744
|
-
* @name ngSwitch
|
|
16745
|
-
* @restrict EA
|
|
16746
|
-
*
|
|
16747
|
-
* @description
|
|
16748
|
-
* The `ngSwitch` directive is used to conditionally swap DOM structure on your template based on a scope expression.
|
|
16749
|
-
* Elements within `ngSwitch` but without `ngSwitchWhen` or `ngSwitchDefault` directives will be preserved at the location
|
|
16750
|
-
* as specified in the template.
|
|
16751
|
-
*
|
|
16752
|
-
* The directive itself works similar to ngInclude, however, instead of downloading template code (or loading it
|
|
16753
|
-
* from the template cache), `ngSwitch` simply chooses one of the nested elements and makes it visible based on which element
|
|
16754
|
-
* matches the value obtained from the evaluated expression. In other words, you define a container element
|
|
16755
|
-
* (where you place the directive), place an expression on the **`on="..."` attribute**
|
|
16756
|
-
* (or the **`ng-switch="..."` attribute**), define any inner elements inside of the directive and place
|
|
16757
|
-
* a when attribute per element. The when attribute is used to inform ngSwitch which element to display when the on
|
|
16758
|
-
* expression is evaluated. If a matching expression is not found via a when attribute then an element with the default
|
|
16759
|
-
* attribute is displayed.
|
|
16760
|
-
*
|
|
16761
|
-
* <div class="alert alert-info">
|
|
16762
|
-
* Be aware that the attribute values to match against cannot be expressions. They are interpreted
|
|
16763
|
-
* as literal string values to match against.
|
|
16764
|
-
* For example, **`ng-switch-when="someVal"`** will match against the string `"someVal"` not against the
|
|
16765
|
-
* value of the expression `$scope.someVal`.
|
|
16766
|
-
* </div>
|
|
16767
|
-
|
|
16768
|
-
* @animations
|
|
16769
|
-
* | Animation | Occurs |
|
|
16770
|
-
* |----------------------------------|-------------------------------------|
|
|
16771
|
-
* | {@link ng.$animate#enter enter} | after the ngSwitch contents change and the matched child element is placed inside the container |
|
|
16772
|
-
* | {@link ng.$animate#leave leave} | after the ngSwitch contents change and just before the former contents are removed from the DOM |
|
|
16773
|
-
*
|
|
16774
|
-
* @usage
|
|
16775
|
-
*
|
|
16776
|
-
* ```
|
|
16777
|
-
* <ANY ng-switch="expression">
|
|
16778
|
-
* <ANY ng-switch-when="matchValue1">...</ANY>
|
|
16779
|
-
* <ANY ng-switch-when="matchValue2">...</ANY>
|
|
16780
|
-
* <ANY ng-switch-default>...</ANY>
|
|
16781
|
-
* </ANY>
|
|
16782
|
-
* ```
|
|
16783
|
-
*
|
|
16784
|
-
*
|
|
16785
|
-
* @scope
|
|
16786
|
-
* @priority 1200
|
|
16787
|
-
* @param {*} ngSwitch|on expression to match against <code>ng-switch-when</code>.
|
|
16788
|
-
* On child elements add:
|
|
16789
|
-
*
|
|
16790
|
-
* * `ngSwitchWhen`: the case statement to match against. If match then this
|
|
16791
|
-
* case will be displayed. If the same match appears multiple times, all the
|
|
16792
|
-
* elements will be displayed. It is possible to associate multiple values to
|
|
16793
|
-
* the same `ngSwitchWhen` by defining the optional attribute
|
|
16794
|
-
* `ngSwitchWhenSeparator`. The separator will be used to split the value of
|
|
16795
|
-
* the `ngSwitchWhen` attribute into multiple tokens, and the element will show
|
|
16796
|
-
* if any of the `ngSwitch` evaluates to any of these tokens.
|
|
16797
|
-
* * `ngSwitchDefault`: the default case when no other case match. If there
|
|
16798
|
-
* are multiple default cases, all of them will be displayed when no other
|
|
16799
|
-
* case match.
|
|
16800
|
-
*
|
|
16801
|
-
*/
|
|
16802
16733
|
const ngSwitchDirective = [
|
|
16803
16734
|
"$animate",
|
|
16804
16735
|
"$compile",
|
|
@@ -16808,11 +16739,13 @@ const ngSwitchDirective = [
|
|
|
16808
16739
|
// asks for $scope to fool the BC controller module
|
|
16809
16740
|
controller: [
|
|
16810
16741
|
"$scope",
|
|
16811
|
-
|
|
16812
|
-
|
|
16742
|
+
class {
|
|
16743
|
+
constructor() {
|
|
16744
|
+
this.cases = {};
|
|
16745
|
+
}
|
|
16813
16746
|
},
|
|
16814
16747
|
],
|
|
16815
|
-
link(scope,
|
|
16748
|
+
link(scope, _element, attr, ngSwitchController) {
|
|
16816
16749
|
const watchExpr = attr.ngSwitch || attr.on;
|
|
16817
16750
|
let selectedTranscludes = [];
|
|
16818
16751
|
const selectedElements = [];
|