@angular-wave/angular.ts 0.7.7 → 0.7.8
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/@types/animations/raf-scheduler.d.ts +2 -2
- package/@types/animations/shared.d.ts +0 -1
- package/@types/core/compile/attributes.d.ts +3 -3
- package/@types/core/compile/compile.d.ts +1 -1
- package/@types/core/di/injector.d.ts +0 -1
- package/@types/core/di/internal-injector.d.ts +1 -0
- package/@types/core/di/ng-module.d.ts +5 -0
- package/@types/core/filter/filter.d.ts +11 -13
- package/@types/core/sanitize/sanitize-uri.d.ts +3 -6
- package/@types/core/scope/scope.d.ts +1 -1
- package/@types/directive/attrs/attrs.d.ts +7 -1
- package/@types/directive/events/events.d.ts +9 -3
- package/@types/directive/http/http.d.ts +6 -2
- package/@types/directive/include/include.d.ts +2 -2
- package/@types/directive/input/input.d.ts +2 -12
- package/@types/directive/messages/messages.d.ts +9 -48
- package/@types/directive/model/model.d.ts +3 -3
- package/@types/directive/options/options.d.ts +13 -20
- package/@types/directive/switch/switch.d.ts +1 -0
- package/@types/directive/transclude/transclude.d.ts +10 -6
- package/@types/interface.d.ts +54 -18
- package/@types/router/common/glob.d.ts +5 -1
- package/@types/router/directives/view-directive.d.ts +2 -19
- package/@types/router/globals.d.ts +1 -2
- package/@types/router/state/state-registry.d.ts +1 -2
- package/@types/router/url/url-service.d.ts +7 -9
- package/@types/services/anchor-scroll.d.ts +1 -1
- package/@types/{core → services/exception}/exception-handler.d.ts +4 -4
- package/@types/{core/error-handler.d.ts → services/exception/interface.d.ts} +1 -1
- package/@types/services/http/http.d.ts +0 -2
- package/@types/services/http/interface.d.ts +2 -2
- package/@types/services/http-backend/http-backend.d.ts +13 -21
- package/@types/services/location/interface.d.ts +8 -0
- package/@types/{core → services}/location/location.d.ts +52 -12
- package/@types/{core → services}/sce/sce.d.ts +1 -1
- package/@types/services/template-cache/interface.d.ts +8 -2
- package/@types/services/template-cache/template-cache.d.ts +1 -1
- package/@types/services/template-request.d.ts +1 -1
- package/@types/shared/cache.d.ts +0 -2
- package/@types/shared/dom.d.ts +6 -0
- package/@types/shared/test-utils.d.ts +1 -0
- package/@types/shared/url-utils/interface.d.ts +47 -0
- package/@types/{core → shared}/url-utils/url-utils.d.ts +26 -13
- package/@types/shared/utils.d.ts +15 -0
- package/Makefile +3 -2
- package/dist/angular-ts.esm.js +982 -1190
- package/dist/angular-ts.umd.js +982 -1190
- package/dist/angular-ts.umd.min.js +1 -1
- package/docs/content/docs/directive/bind.md +9 -7
- package/docs/content/docs/directive/get.md +203 -0
- package/docs/content/docs/provider/templateCacheProvider.md +66 -1
- package/docs/content/docs/service/templateCache.md +2 -2
- package/docs/layouts/partials/hooks/head-end.html +1 -1
- package/docs/layouts/shortcodes/showcss.html +2 -0
- package/docs/static/examples/ng-bind/ng-bind.html +2 -2
- package/docs/static/typedoc/assets/hierarchy.js +1 -1
- package/docs/static/typedoc/assets/navigation.js +1 -1
- package/docs/static/typedoc/assets/search.js +1 -1
- package/docs/static/typedoc/classes/NgModule.html +32 -0
- package/docs/static/typedoc/classes/TemplateCacheProvider.html +1 -1
- package/docs/static/typedoc/hierarchy.html +1 -1
- package/docs/static/typedoc/index.html +1 -1
- package/docs/static/typedoc/interfaces/Directive.html +5 -4
- package/docs/static/typedoc/interfaces/HttpProviderDefaults.html +1 -1
- package/docs/static/typedoc/interfaces/HttpResponse.html +2 -3
- package/docs/static/typedoc/interfaces/Provider.html +15 -10
- package/docs/static/typedoc/interfaces/RequestConfig.html +1 -1
- package/docs/static/typedoc/interfaces/RequestShortcutConfig.html +1 -1
- package/docs/static/typedoc/interfaces/TemplateCache.html +7 -0
- package/docs/static/typedoc/types/AnnotatedDirectiveFactory.html +1 -0
- package/docs/static/typedoc/types/DirectiveFactory.html +1 -2
- package/docs/static/typedoc/types/DirectiveFactoryFn.html +1 -0
- package/docs/static/typedoc/types/HttpResponseStatus.html +1 -0
- package/docs/static/typedoc/types/{TemplateCache.html → SwapModeType.html} +1 -1
- package/docs/static/typedoc/variables/SwapMode.html +11 -0
- package/legacy.d.ts +0 -10
- package/package.json +1 -3
- package/src/animations/animate-children-directive.js +2 -2
- package/src/animations/raf-scheduler.js +1 -1
- package/src/animations/shared.js +0 -9
- package/src/core/compile/attributes.js +1 -1
- package/src/core/compile/compile.js +3 -3
- package/src/core/di/injector.js +4 -17
- package/src/core/di/internal-injector.js +4 -1
- package/src/core/di/ng-module.js +12 -27
- package/src/core/filter/filter.js +28 -28
- package/src/core/parse/interpreter.js +32 -38
- package/src/core/sanitize/sanitize-uri.js +3 -3
- package/src/core/scope/scope.js +2 -2
- package/src/directive/attrs/attrs.js +7 -4
- package/src/directive/events/events.js +6 -2
- package/src/directive/http/delete.spec.js +2 -0
- package/src/directive/http/get.spec.js +280 -3
- package/src/directive/http/http.js +100 -12
- package/src/directive/http/http.test.js +2 -2
- package/src/directive/http/post.spec.js +2 -0
- package/src/directive/http/put.spec.js +2 -0
- package/src/directive/include/include.js +7 -7
- package/src/directive/input/input.js +6 -28
- package/src/directive/messages/messages.js +4 -0
- package/src/directive/model/model.js +1 -1
- package/src/directive/options/options.js +454 -464
- package/src/directive/setter/setter.js +12 -14
- package/src/directive/setter/setter.spec.js +39 -16
- package/src/directive/switch/switch.js +1 -0
- package/src/directive/transclude/transclude.js +87 -89
- package/src/injection-tokens.js +1 -1
- package/src/interface.ts +68 -19
- package/src/loader.js +4 -9
- package/src/public.js +9 -15
- package/src/router/common/glob.js +5 -0
- package/src/router/directives/state-directives.spec.js +1 -1
- package/src/router/directives/view-directive.js +9 -1
- package/src/router/globals.js +0 -1
- package/src/router/state/state-registry.js +0 -1
- package/src/router/state-filters.js +2 -2
- package/src/router/url/url-service.js +5 -9
- package/src/services/anchor-scroll.html +0 -7
- package/src/services/anchor-scroll.js +1 -1
- package/src/{core → services/exception}/exception-handler.js +2 -2
- package/src/{core/error-handler.ts → services/exception/interface.ts} +1 -1
- package/src/services/http/http.js +2 -13
- package/src/services/http/interface.ts +2 -2
- package/src/services/http-backend/http-backend.js +4 -14
- package/src/services/http-backend/http-backend.spec.js +1 -4
- package/src/services/location/interface.ts +8 -0
- package/src/{core → services}/location/location.html +4 -1
- package/src/{core → services}/location/location.js +128 -26
- package/src/{core → services}/location/location.spec.js +2 -2
- package/src/{core → services}/location/location.test.js +1 -1
- package/src/{core → services}/sce/sce.html +1 -1
- package/src/{core → services}/sce/sce.js +9 -3
- package/src/{core → services}/sce/sce.spec.js +2 -3
- package/src/{core → services}/sce/sce.test.js +1 -1
- package/src/services/template-cache/interface.ts +8 -2
- package/src/services/template-cache/template-cache.js +3 -1
- package/src/services/template-cache/template-cache.spec.js +72 -0
- package/src/services/template-request.js +2 -1
- package/src/shared/cache.js +0 -2
- package/src/shared/dom.js +10 -0
- package/src/shared/test-utils.js +1 -0
- package/src/shared/url-utils/interface.ts +56 -0
- package/src/{core → shared}/url-utils/url-utils.html +4 -1
- package/src/{core → shared}/url-utils/url-utils.js +26 -23
- package/src/{core → shared}/url-utils/url-utils.spec.js +0 -8
- package/src/{core → shared}/url-utils/url-utils.test.js +1 -1
- package/src/shared/utils.js +28 -0
- package/utils/express.js +9 -1
- package/@types/core/task-tracker-factory.d.ts +0 -76
- package/@types/services/browser.d.ts +0 -101
- package/docs/static/typedoc/types/SwapInsertPosition.html +0 -2
- package/jsdoc.json +0 -22
- package/src/core/task-tracker-factory.js +0 -145
- package/src/services/browser.js +0 -212
- /package/src/{core → services}/location/location.md +0 -0
- /package/src/{core → services}/sce/sce.md +0 -0
- /package/src/{core → shared}/url-utils/url-utils.md +0 -0
package/dist/angular-ts.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Version: 0.7.
|
|
1
|
+
/* Version: 0.7.8 - July 17, 2025 02:51:18 */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
|
@@ -1154,11 +1154,37 @@
|
|
|
1154
1154
|
};
|
|
1155
1155
|
}
|
|
1156
1156
|
|
|
1157
|
+
/**
|
|
1158
|
+
* Wraps a function so it will only be called starting from the second invocation.
|
|
1159
|
+
* The first call does nothing and returns undefined.
|
|
1160
|
+
*
|
|
1161
|
+
* @param {Function} fn - The function to wrap.
|
|
1162
|
+
* @returns {Function} A new function that will skip the first call.
|
|
1163
|
+
*/
|
|
1164
|
+
function callBackAfterFirst(fn) {
|
|
1165
|
+
let calledOnce = false;
|
|
1166
|
+
|
|
1167
|
+
return function (...args) {
|
|
1168
|
+
if (calledOnce) {
|
|
1169
|
+
return fn.apply(this, args);
|
|
1170
|
+
}
|
|
1171
|
+
calledOnce = true;
|
|
1172
|
+
};
|
|
1173
|
+
}
|
|
1174
|
+
|
|
1175
|
+
/**
|
|
1176
|
+
* Delays execution for a specified number of milliseconds.
|
|
1177
|
+
*
|
|
1178
|
+
* @param {number} [t=0] - The number of milliseconds to wait. Defaults to 0.
|
|
1179
|
+
* @returns {Promise<void>} A promise that resolves after the delay.
|
|
1180
|
+
*/
|
|
1181
|
+
function wait(t = 0) {
|
|
1182
|
+
return new Promise((resolve) => setTimeout(resolve, t));
|
|
1183
|
+
}
|
|
1184
|
+
|
|
1157
1185
|
/**
|
|
1158
1186
|
* Expando cache for adding properties to DOM nodes with JavaScript.
|
|
1159
1187
|
* This used to be an Object in JQLite decorator, but swapped out for a Map
|
|
1160
|
-
* for performance reasons and convenience methods. A proxy is available for
|
|
1161
|
-
* additional logic handling.
|
|
1162
1188
|
*
|
|
1163
1189
|
* @type {Map<number, import('../interface.ts').ExpandoStore>}
|
|
1164
1190
|
*/
|
|
@@ -1711,6 +1737,16 @@
|
|
|
1711
1737
|
}
|
|
1712
1738
|
}
|
|
1713
1739
|
|
|
1740
|
+
/**
|
|
1741
|
+
* Returns the base href of the document.
|
|
1742
|
+
*
|
|
1743
|
+
* @returns {string} The base href.
|
|
1744
|
+
*/
|
|
1745
|
+
function getBaseHref() {
|
|
1746
|
+
const href = document.querySelector("base")?.getAttribute("href");
|
|
1747
|
+
return href ? href.replace(/^(https?:)?\/\/[^/]*/, "") : "";
|
|
1748
|
+
}
|
|
1749
|
+
|
|
1714
1750
|
/**
|
|
1715
1751
|
* A helper list of tokens matching the standard injectables that come predefined in the core `ng` module.
|
|
1716
1752
|
* These string tokens are commonly injected into services, directives, or components via `$inject`.
|
|
@@ -1743,7 +1779,7 @@
|
|
|
1743
1779
|
$animate: "$animate",
|
|
1744
1780
|
$animateCss: "$animateCss",
|
|
1745
1781
|
$aria: "$aria",
|
|
1746
|
-
$
|
|
1782
|
+
$compile: "$compile",
|
|
1747
1783
|
$controller: "$controller",
|
|
1748
1784
|
$eventBus: "$eventBus",
|
|
1749
1785
|
$exceptionHandler: "$exceptionHandler",
|
|
@@ -1786,10 +1822,15 @@
|
|
|
1786
1822
|
return services.map((x) => x + "Provider");
|
|
1787
1823
|
}
|
|
1788
1824
|
|
|
1825
|
+
/** @private */
|
|
1789
1826
|
const INJECTOR_LITERAL = "$injector";
|
|
1827
|
+
/** @private */
|
|
1790
1828
|
const COMPILE_LITERAL = "$compileProvider";
|
|
1829
|
+
/** @private */
|
|
1791
1830
|
const ANIMATION_LITERAL = "$animateProvider";
|
|
1831
|
+
/** @private */
|
|
1792
1832
|
const FILTER_LITERAL = "$filterProvider";
|
|
1833
|
+
/** @private */
|
|
1793
1834
|
const CONTROLLER_LITERAL = "$controllerProvider";
|
|
1794
1835
|
|
|
1795
1836
|
/**
|
|
@@ -1856,11 +1897,7 @@
|
|
|
1856
1897
|
* @returns {NgModule}
|
|
1857
1898
|
*/
|
|
1858
1899
|
constant(name, object) {
|
|
1859
|
-
this.invokeQueue.unshift([
|
|
1860
|
-
$injectTokens.$provide,
|
|
1861
|
-
"constant",
|
|
1862
|
-
[name, object],
|
|
1863
|
-
]);
|
|
1900
|
+
this.invokeQueue.unshift([$injectTokens.$provide, "constant", [name, object]]);
|
|
1864
1901
|
return this;
|
|
1865
1902
|
}
|
|
1866
1903
|
|
|
@@ -1905,11 +1942,7 @@
|
|
|
1905
1942
|
if (providerFunction && isFunction(providerFunction)) {
|
|
1906
1943
|
providerFunction.$$moduleName = name;
|
|
1907
1944
|
}
|
|
1908
|
-
this.invokeQueue.push([
|
|
1909
|
-
$injectTokens.$provide,
|
|
1910
|
-
"factory",
|
|
1911
|
-
[name, providerFunction],
|
|
1912
|
-
]);
|
|
1945
|
+
this.invokeQueue.push([$injectTokens.$provide, "factory", [name, providerFunction]]);
|
|
1913
1946
|
return this;
|
|
1914
1947
|
}
|
|
1915
1948
|
|
|
@@ -1922,11 +1955,7 @@
|
|
|
1922
1955
|
if (serviceFunction && isFunction(serviceFunction)) {
|
|
1923
1956
|
serviceFunction.$$moduleName = name;
|
|
1924
1957
|
}
|
|
1925
|
-
this.invokeQueue.push([
|
|
1926
|
-
$injectTokens.$provide,
|
|
1927
|
-
"service",
|
|
1928
|
-
[name, serviceFunction],
|
|
1929
|
-
]);
|
|
1958
|
+
this.invokeQueue.push([$injectTokens.$provide, "service", [name, serviceFunction]]);
|
|
1930
1959
|
return this;
|
|
1931
1960
|
}
|
|
1932
1961
|
|
|
@@ -1939,11 +1968,7 @@
|
|
|
1939
1968
|
if (providerType && isFunction(providerType)) {
|
|
1940
1969
|
providerType.$$moduleName = name;
|
|
1941
1970
|
}
|
|
1942
|
-
this.invokeQueue.push([
|
|
1943
|
-
$injectTokens.$provide,
|
|
1944
|
-
"provider",
|
|
1945
|
-
[name, providerType],
|
|
1946
|
-
]);
|
|
1971
|
+
this.invokeQueue.push([$injectTokens.$provide, "provider", [name, providerType]]);
|
|
1947
1972
|
return this;
|
|
1948
1973
|
}
|
|
1949
1974
|
|
|
@@ -1956,11 +1981,7 @@
|
|
|
1956
1981
|
if (decorFn && isFunction(decorFn)) {
|
|
1957
1982
|
decorFn.$$moduleName = name;
|
|
1958
1983
|
}
|
|
1959
|
-
this.configBlocks.push([
|
|
1960
|
-
$injectTokens.$provide,
|
|
1961
|
-
"decorator",
|
|
1962
|
-
[name, decorFn],
|
|
1963
|
-
]);
|
|
1984
|
+
this.configBlocks.push([$injectTokens.$provide, "decorator", [name, decorFn]]);
|
|
1964
1985
|
return this;
|
|
1965
1986
|
}
|
|
1966
1987
|
|
|
@@ -2205,8 +2226,11 @@
|
|
|
2205
2226
|
*/
|
|
2206
2227
|
constructor(providerInjector, strictDi) {
|
|
2207
2228
|
super(strictDi);
|
|
2229
|
+
|
|
2230
|
+
/** @type {ProviderInjector} */
|
|
2208
2231
|
this.providerInjector = providerInjector;
|
|
2209
|
-
|
|
2232
|
+
/** @type {Object.<string, import("./ng-module.js").NgModule>} */
|
|
2233
|
+
this.modules = providerInjector.modules;
|
|
2210
2234
|
}
|
|
2211
2235
|
|
|
2212
2236
|
/**
|
|
@@ -2323,9 +2347,6 @@
|
|
|
2323
2347
|
const loadedModules = new Map(); // Keep track of loaded modules to avoid circular dependencies
|
|
2324
2348
|
|
|
2325
2349
|
const providerCache = {
|
|
2326
|
-
/**
|
|
2327
|
-
* @type {import('../../interface.ts').Provider}
|
|
2328
|
-
*/
|
|
2329
2350
|
$provide: {
|
|
2330
2351
|
provider: supportObject(provider),
|
|
2331
2352
|
factory: supportObject(factory),
|
|
@@ -2352,15 +2373,10 @@
|
|
|
2352
2373
|
const runBlocks = loadModules(modulesToLoad);
|
|
2353
2374
|
instanceInjector = protoInstanceInjector.get(INJECTOR_LITERAL);
|
|
2354
2375
|
|
|
2355
|
-
runBlocks.forEach((fn) =>
|
|
2356
|
-
if (fn) instanceInjector.invoke(fn);
|
|
2357
|
-
});
|
|
2376
|
+
runBlocks.forEach((fn) => fn && instanceInjector.invoke(fn));
|
|
2358
2377
|
|
|
2359
|
-
instanceInjector.loadNewModules =
|
|
2360
|
-
loadModules(mods).forEach((fn) =>
|
|
2361
|
-
if (fn) instanceInjector.invoke(fn);
|
|
2362
|
-
});
|
|
2363
|
-
};
|
|
2378
|
+
instanceInjector.loadNewModules = (mods) =>
|
|
2379
|
+
loadModules(mods).forEach((fn) => fn && instanceInjector.invoke(fn));
|
|
2364
2380
|
|
|
2365
2381
|
return instanceInjector;
|
|
2366
2382
|
|
|
@@ -2489,7 +2505,7 @@
|
|
|
2489
2505
|
|
|
2490
2506
|
try {
|
|
2491
2507
|
if (isString(module)) {
|
|
2492
|
-
/** @type {import('./ng-module').NgModule} */
|
|
2508
|
+
/** @type {import('./ng-module.js').NgModule} */
|
|
2493
2509
|
const moduleFn = window["angular"].module(module);
|
|
2494
2510
|
instanceInjector.modules[/** @type {string } */ (module)] = moduleFn;
|
|
2495
2511
|
runBlocks = runBlocks
|
|
@@ -2555,7 +2571,6 @@
|
|
|
2555
2571
|
}
|
|
2556
2572
|
|
|
2557
2573
|
/**
|
|
2558
|
-
*
|
|
2559
2574
|
* @param {any} fn
|
|
2560
2575
|
* @param {boolean} [strictDi]
|
|
2561
2576
|
* @param {String} [name]
|
|
@@ -2594,10 +2609,6 @@
|
|
|
2594
2609
|
return $inject;
|
|
2595
2610
|
}
|
|
2596
2611
|
|
|
2597
|
-
/**
|
|
2598
|
-
* @param {function(string, any):any} delegate
|
|
2599
|
-
* @returns {any}
|
|
2600
|
-
*/
|
|
2601
2612
|
function supportObject(delegate) {
|
|
2602
2613
|
return function (key, value) {
|
|
2603
2614
|
if (isObject(key)) {
|
|
@@ -3013,32 +3024,25 @@
|
|
|
3013
3024
|
}
|
|
3014
3025
|
}
|
|
3015
3026
|
|
|
3016
|
-
/**
|
|
3017
|
-
* HTTP protocol
|
|
3018
|
-
* @typedef {"http"|"https"} HttpProtocol
|
|
3019
|
-
*/
|
|
3020
|
-
|
|
3021
3027
|
const urlParsingNode = document.createElement("a");
|
|
3022
3028
|
const originUrl = urlResolve(window.location.href);
|
|
3023
3029
|
let baseUrlParsingNode;
|
|
3024
3030
|
|
|
3025
3031
|
urlParsingNode.href = "http://[::1]";
|
|
3026
3032
|
|
|
3033
|
+
/**
|
|
3034
|
+
* @param {import("./interface.js").ResolvableUrl} url
|
|
3035
|
+
* @return {import("./interface.js").ParsedUrl}
|
|
3036
|
+
*/
|
|
3027
3037
|
function urlResolve(url) {
|
|
3028
|
-
if (!isString(url))
|
|
3029
|
-
|
|
3030
|
-
const href = url;
|
|
3038
|
+
if (!isString(url))
|
|
3039
|
+
return /** @type {import("./interface.js").ParsedUrl} */ (url);
|
|
3031
3040
|
|
|
3032
|
-
urlParsingNode.setAttribute("href",
|
|
3041
|
+
urlParsingNode.setAttribute("href", /** @type {string} */ (url));
|
|
3033
3042
|
|
|
3034
|
-
|
|
3035
|
-
|
|
3036
|
-
|
|
3037
|
-
// when parsed out of an anchor element.
|
|
3038
|
-
const ipv6InBrackets = urlParsingNode.hostname === "[::1]";
|
|
3039
|
-
if (!ipv6InBrackets && hostname.indexOf(":") > -1) {
|
|
3040
|
-
hostname = `[${hostname}]`;
|
|
3041
|
-
}
|
|
3043
|
+
const hostname = urlParsingNode.hostname.includes(":")
|
|
3044
|
+
? `[${urlParsingNode.hostname}]`
|
|
3045
|
+
: urlParsingNode.hostname;
|
|
3042
3046
|
|
|
3043
3047
|
return {
|
|
3044
3048
|
href: urlParsingNode.href,
|
|
@@ -3063,7 +3067,7 @@
|
|
|
3063
3067
|
* Parse a request URL and determine whether this is a same-origin request as the application
|
|
3064
3068
|
* document.
|
|
3065
3069
|
*
|
|
3066
|
-
* @param {
|
|
3070
|
+
* @param {import("./interface.js").ResolvableUrl} requestUrl The url of the request as a string that will be resolved
|
|
3067
3071
|
* or a parsed URL object.
|
|
3068
3072
|
* @returns {boolean} Whether the request is for the same origin as the application document.
|
|
3069
3073
|
*/
|
|
@@ -3077,7 +3081,7 @@
|
|
|
3077
3081
|
* Note: The base URL is usually the same as the document location (`location.href`) but can
|
|
3078
3082
|
* be overriden by using the `<base>` tag.
|
|
3079
3083
|
*
|
|
3080
|
-
* @param {
|
|
3084
|
+
* @param {import("./interface.js").ResolvableUrl} requestUrl The url of the request as a string that will be resolved
|
|
3081
3085
|
* or a parsed URL object.
|
|
3082
3086
|
* @returns {boolean} Whether the URL is same-origin as the document base URL.
|
|
3083
3087
|
*/
|
|
@@ -3091,7 +3095,7 @@
|
|
|
3091
3095
|
*
|
|
3092
3096
|
* @param {string[]} trustedOriginUrls - A list of URLs (strings), whose origins are trusted.
|
|
3093
3097
|
*
|
|
3094
|
-
* @returns {
|
|
3098
|
+
* @returns {(url: import("./interface.js").ResolvableUrl) => boolean } - A function that receives a URL (string or parsed URL object) and returns
|
|
3095
3099
|
* whether it is of an allowed origin.
|
|
3096
3100
|
*/
|
|
3097
3101
|
function urlIsAllowedOriginFactory(trustedOriginUrls) {
|
|
@@ -3104,7 +3108,7 @@
|
|
|
3104
3108
|
* based on a list of trusted-origin URLs. The current location's origin is implicitly
|
|
3105
3109
|
* trusted.
|
|
3106
3110
|
*
|
|
3107
|
-
* @param {
|
|
3111
|
+
* @param {import("./interface.js").ResolvableUrl} requestUrl - The URL to be checked (provided as a string that will be
|
|
3108
3112
|
* resolved or a parsed URL object).
|
|
3109
3113
|
*
|
|
3110
3114
|
* @returns {boolean} - Whether the specified URL is of an allowed origin.
|
|
@@ -3120,9 +3124,9 @@
|
|
|
3120
3124
|
/**
|
|
3121
3125
|
* Determine if two URLs share the same origin.
|
|
3122
3126
|
*
|
|
3123
|
-
* @param {
|
|
3127
|
+
* @param {import("./interface.js").ResolvableUrl} url1 - First URL to compare as a string or a normalized URL in the form of
|
|
3124
3128
|
* a dictionary object returned by `urlResolve()`.
|
|
3125
|
-
* @param {
|
|
3129
|
+
* @param {import("./interface.js").ResolvableUrl} url2 - Second URL to compare as a string or a normalized URL in the form
|
|
3126
3130
|
* of a dictionary object returned by `urlResolve()`.
|
|
3127
3131
|
*
|
|
3128
3132
|
* @returns {boolean} - True if both URLs have the same origin, and false otherwise.
|
|
@@ -3155,7 +3159,17 @@
|
|
|
3155
3159
|
return baseUrlParsingNode.href;
|
|
3156
3160
|
}
|
|
3157
3161
|
|
|
3158
|
-
/**
|
|
3162
|
+
/**
|
|
3163
|
+
* Removes a trailing hash ('#') from the given URL if it exists.
|
|
3164
|
+
*
|
|
3165
|
+
* @param {string} url
|
|
3166
|
+
* @returns {string}
|
|
3167
|
+
*/
|
|
3168
|
+
function trimEmptyHash(url) {
|
|
3169
|
+
return url.replace(/#$/, "");
|
|
3170
|
+
}
|
|
3171
|
+
|
|
3172
|
+
/** @typedef {import("../exception/interface.ts").Interface } ErrorHandler */
|
|
3159
3173
|
|
|
3160
3174
|
const $sceMinErr = minErr("$sce");
|
|
3161
3175
|
|
|
@@ -3211,6 +3225,7 @@
|
|
|
3211
3225
|
.replace(/\\\*/g, "[^:/.?&;]*");
|
|
3212
3226
|
return new RegExp(`^${matcher}$`);
|
|
3213
3227
|
}
|
|
3228
|
+
|
|
3214
3229
|
if (isRegExp(matcher)) {
|
|
3215
3230
|
// The only other type of matcher allowed is a Regexp.
|
|
3216
3231
|
// Match entire URL / disallow partial matches.
|
|
@@ -3472,6 +3487,11 @@
|
|
|
3472
3487
|
htmlSanitizer = $injector.get("$sanitize");
|
|
3473
3488
|
}
|
|
3474
3489
|
|
|
3490
|
+
/**
|
|
3491
|
+
* @param {string|RegExp} matcher
|
|
3492
|
+
* @param {import("../../shared/url-utils/interface").ParsedUrl} parsedUrl
|
|
3493
|
+
* @return {boolean}
|
|
3494
|
+
*/
|
|
3475
3495
|
function matchUrl(matcher, parsedUrl) {
|
|
3476
3496
|
if (matcher === "self") {
|
|
3477
3497
|
return (
|
|
@@ -3479,7 +3499,7 @@
|
|
|
3479
3499
|
);
|
|
3480
3500
|
}
|
|
3481
3501
|
// definitely a regex. See adjustMatchers()
|
|
3482
|
-
return !!matcher.exec(parsedUrl.href);
|
|
3502
|
+
return !!(/** @type {RegExp} */ (matcher).exec(parsedUrl.href));
|
|
3483
3503
|
}
|
|
3484
3504
|
|
|
3485
3505
|
function isResourceUrlAllowedByPolicy(url) {
|
|
@@ -3984,6 +4004,10 @@
|
|
|
3984
4004
|
* A collection of directives that allows creation of custom event handlers that are defined as
|
|
3985
4005
|
* AngularTS expressions and are compiled and executed within the current scope.
|
|
3986
4006
|
*/
|
|
4007
|
+
|
|
4008
|
+
/**
|
|
4009
|
+
* @type {Record<string, import("../../interface.js").DirectiveFactory>}
|
|
4010
|
+
*/
|
|
3987
4011
|
const ngEventDirectives = {};
|
|
3988
4012
|
|
|
3989
4013
|
"click copy cut dblclick focus blur keydown keyup load mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup paste submit touchstart touchend touchmove"
|
|
@@ -3995,7 +4019,7 @@
|
|
|
3995
4019
|
"$exceptionHandler",
|
|
3996
4020
|
/**
|
|
3997
4021
|
* @param {import("../../core/parse/interface.ts").ParseService} $parse
|
|
3998
|
-
* @param {import('../../
|
|
4022
|
+
* @param {import('../../services/exception/exception-handler.js').ErrorHandler} $exceptionHandler
|
|
3999
4023
|
* @returns
|
|
4000
4024
|
*/
|
|
4001
4025
|
($parse, $exceptionHandler) => {
|
|
@@ -4012,7 +4036,7 @@
|
|
|
4012
4036
|
/**
|
|
4013
4037
|
*
|
|
4014
4038
|
* @param {import("../../core/parse/interface.ts").ParseService} $parse
|
|
4015
|
-
* @param {import('../../
|
|
4039
|
+
* @param {import('../../services/exception/exception-handler.js').ErrorHandler} $exceptionHandler
|
|
4016
4040
|
* @param {string} directiveName
|
|
4017
4041
|
* @param {string} eventName
|
|
4018
4042
|
* @returns {import("../../interface.ts").Directive}
|
|
@@ -4053,7 +4077,7 @@
|
|
|
4053
4077
|
/**
|
|
4054
4078
|
* @param {import('../scope/scope.js').Scope} $rootScope
|
|
4055
4079
|
* @param {*} $animate
|
|
4056
|
-
* @param {import("
|
|
4080
|
+
* @param {import("../../services/exception/exception-handler.js").ErrorHandler} $exceptionHandler
|
|
4057
4081
|
* @param {*} $sce
|
|
4058
4082
|
* @param {import("../../shared/noderef.js").NodeRef} [nodeRef]
|
|
4059
4083
|
* @param {Object} [attributesToCopy]
|
|
@@ -4651,7 +4675,7 @@
|
|
|
4651
4675
|
"$exceptionHandler",
|
|
4652
4676
|
/**
|
|
4653
4677
|
* @param {import("../../core/di/internal-injector.js").InjectorService} $injector
|
|
4654
|
-
* @param {import('
|
|
4678
|
+
* @param {import('../../services/exception/exception-handler.js').ErrorHandler} $exceptionHandler
|
|
4655
4679
|
*/
|
|
4656
4680
|
function ($injector, $exceptionHandler) {
|
|
4657
4681
|
const directives = [];
|
|
@@ -4979,7 +5003,7 @@
|
|
|
4979
5003
|
/**
|
|
4980
5004
|
* @param {import("../../core/di/internal-injector.js").InjectorService} $injector
|
|
4981
5005
|
* @param {*} $interpolate
|
|
4982
|
-
* @param {import("
|
|
5006
|
+
* @param {import("../../services/exception/exception-handler.js").ErrorHandler} $exceptionHandler
|
|
4983
5007
|
* @param {*} $templateRequest
|
|
4984
5008
|
* @param {import("../parse/interface.ts").ParseService} $parse
|
|
4985
5009
|
* @param {*} $controller
|
|
@@ -8464,7 +8488,7 @@
|
|
|
8464
8488
|
|
|
8465
8489
|
/**
|
|
8466
8490
|
* @param {import('../../core/scope/scope.js').Scope} $scope
|
|
8467
|
-
* @param {import('../../
|
|
8491
|
+
* @param {import('../../services/exception/exception-handler.js').ErrorHandler} $exceptionHandler
|
|
8468
8492
|
* @param {import('../../core/compile/attributes.js').Attributes} $attr
|
|
8469
8493
|
* @param {Element} $element
|
|
8470
8494
|
* @param {import("../../core/parse/interface.ts").ParseService} $parse
|
|
@@ -9861,7 +9885,6 @@
|
|
|
9861
9885
|
element,
|
|
9862
9886
|
attr,
|
|
9863
9887
|
ctrl,
|
|
9864
|
-
$browser,
|
|
9865
9888
|
$filter,
|
|
9866
9889
|
$parse,
|
|
9867
9890
|
) {
|
|
@@ -10138,15 +10161,7 @@
|
|
|
10138
10161
|
return (value - stepBase) % step === 0;
|
|
10139
10162
|
}
|
|
10140
10163
|
|
|
10141
|
-
function numberInputType(
|
|
10142
|
-
scope,
|
|
10143
|
-
element,
|
|
10144
|
-
attr,
|
|
10145
|
-
ctrl,
|
|
10146
|
-
$browser,
|
|
10147
|
-
$filter,
|
|
10148
|
-
$parse,
|
|
10149
|
-
) {
|
|
10164
|
+
function numberInputType(scope, element, attr, ctrl, $filter, $parse) {
|
|
10150
10165
|
badInputChecker(scope, element, attr, ctrl, "number");
|
|
10151
10166
|
numberFormatterParser(ctrl);
|
|
10152
10167
|
baseInputType(scope, element, attr, ctrl);
|
|
@@ -10462,15 +10477,7 @@
|
|
|
10462
10477
|
return fallback;
|
|
10463
10478
|
}
|
|
10464
10479
|
|
|
10465
|
-
function checkboxInputType(
|
|
10466
|
-
scope,
|
|
10467
|
-
element,
|
|
10468
|
-
attr,
|
|
10469
|
-
ctrl,
|
|
10470
|
-
$browser,
|
|
10471
|
-
$filter,
|
|
10472
|
-
$parse,
|
|
10473
|
-
) {
|
|
10480
|
+
function checkboxInputType(scope, element, attr, ctrl, $filter, $parse) {
|
|
10474
10481
|
const trueValue = parseConstantExpr(
|
|
10475
10482
|
$parse,
|
|
10476
10483
|
scope,
|
|
@@ -10508,30 +10515,25 @@
|
|
|
10508
10515
|
ctrl.$parsers.push((value) => (value ? trueValue : falseValue));
|
|
10509
10516
|
}
|
|
10510
10517
|
|
|
10511
|
-
|
|
10512
|
-
* @returns {import('../../interface.ts').Directive}
|
|
10513
|
-
*/
|
|
10514
|
-
inputDirective.$inject = ["$browser", "$filter", "$parse"];
|
|
10518
|
+
inputDirective.$inject = ["$filter", "$parse"];
|
|
10515
10519
|
|
|
10516
10520
|
/**
|
|
10517
|
-
* @param {import('../../services/browser').Browser} $browser
|
|
10518
10521
|
* @param {*} $filter
|
|
10519
10522
|
* @param {*} $parse
|
|
10520
|
-
* @returns
|
|
10523
|
+
* @returns {import('../../interface.ts').Directive}
|
|
10521
10524
|
*/
|
|
10522
|
-
function inputDirective($
|
|
10525
|
+
function inputDirective($filter, $parse) {
|
|
10523
10526
|
return {
|
|
10524
10527
|
restrict: "E",
|
|
10525
10528
|
require: ["?ngModel"],
|
|
10526
10529
|
link: {
|
|
10527
10530
|
pre(scope, element, attr, ctrls) {
|
|
10528
10531
|
if (ctrls[0]) {
|
|
10529
|
-
(inputType[lowercase(attr
|
|
10532
|
+
(inputType[lowercase(attr["type"])] || inputType.text)(
|
|
10530
10533
|
scope,
|
|
10531
10534
|
element,
|
|
10532
10535
|
attr,
|
|
10533
10536
|
ctrls[0],
|
|
10534
|
-
$browser,
|
|
10535
10537
|
$filter,
|
|
10536
10538
|
$parse,
|
|
10537
10539
|
);
|
|
@@ -11650,7 +11652,7 @@
|
|
|
11650
11652
|
* @param {*} $templateRequest
|
|
11651
11653
|
* @param {import("../../services/anchor-scroll.js").AnchorScrollFunction} $anchorScroll
|
|
11652
11654
|
* @param {*} $animate
|
|
11653
|
-
* @param {import('../../
|
|
11655
|
+
* @param {import('../../services/exception/interface.ts').Interface} $exceptionHandler
|
|
11654
11656
|
* @returns {import('../../interface.js').Directive}
|
|
11655
11657
|
*/
|
|
11656
11658
|
function ngIncludeDirective(
|
|
@@ -11769,7 +11771,7 @@
|
|
|
11769
11771
|
// We need this directive so that the element content is already filled when
|
|
11770
11772
|
// the link function of another directive on the same element as ngInclude
|
|
11771
11773
|
// is called.
|
|
11772
|
-
ngIncludeFillContentDirective.$inject = [
|
|
11774
|
+
ngIncludeFillContentDirective.$inject = [$injectTokens.$compile];
|
|
11773
11775
|
|
|
11774
11776
|
/**
|
|
11775
11777
|
* @param {import("../../core/compile/compile.js").CompileFn} $compile
|
|
@@ -12251,6 +12253,7 @@
|
|
|
12251
12253
|
ngSwitchDirective.$inject = ["$animate"];
|
|
12252
12254
|
|
|
12253
12255
|
/**
|
|
12256
|
+
* @param {*} $animate
|
|
12254
12257
|
* @returns {import('../../interface.ts').Directive}
|
|
12255
12258
|
*/
|
|
12256
12259
|
function ngSwitchDirective($animate) {
|
|
@@ -12398,525 +12401,515 @@
|
|
|
12398
12401
|
// 8: collection expression
|
|
12399
12402
|
// 9: track by expression
|
|
12400
12403
|
|
|
12401
|
-
|
|
12402
|
-
|
|
12403
|
-
|
|
12404
|
+
ngOptionsDirective.$inject = ["$compile", "$parse"];
|
|
12405
|
+
/**
|
|
12406
|
+
*
|
|
12407
|
+
* @param {import("../../core/compile/compile.js").CompileFn} $compile
|
|
12408
|
+
* @param {import("../../core/parse/interface.ts").ParseService} $parse
|
|
12409
|
+
* @returns {import("../../interface.ts").Directive}
|
|
12410
|
+
*/
|
|
12411
|
+
function ngOptionsDirective($compile, $parse) {
|
|
12404
12412
|
/**
|
|
12405
|
-
*
|
|
12406
|
-
* @param {
|
|
12407
|
-
* @param {import(
|
|
12413
|
+
* @param {import('../../interface.ts').Expression} optionsExp
|
|
12414
|
+
* @param {HTMLSelectElement} selectElement
|
|
12415
|
+
* @param {import('../../core/scope/scope.js').Scope} scope
|
|
12408
12416
|
* @returns
|
|
12409
12417
|
*/
|
|
12410
|
-
function (
|
|
12411
|
-
|
|
12412
|
-
|
|
12413
|
-
|
|
12414
|
-
|
|
12415
|
-
|
|
12416
|
-
|
|
12417
|
-
|
|
12418
|
-
|
|
12419
|
-
|
|
12420
|
-
|
|
12421
|
-
|
|
12422
|
-
|
|
12423
|
-
|
|
12424
|
-
|
|
12425
|
-
|
|
12426
|
-
|
|
12427
|
-
|
|
12428
|
-
|
|
12429
|
-
|
|
12430
|
-
|
|
12431
|
-
|
|
12432
|
-
|
|
12433
|
-
|
|
12434
|
-
|
|
12435
|
-
|
|
12436
|
-
|
|
12437
|
-
|
|
12438
|
-
|
|
12439
|
-
|
|
12440
|
-
|
|
12441
|
-
|
|
12442
|
-
|
|
12443
|
-
|
|
12444
|
-
|
|
12445
|
-
|
|
12446
|
-
|
|
12447
|
-
|
|
12448
|
-
|
|
12449
|
-
|
|
12450
|
-
|
|
12451
|
-
|
|
12452
|
-
}
|
|
12453
|
-
: function getHashOfValue(value) {
|
|
12454
|
-
return hashKey(value);
|
|
12455
|
-
};
|
|
12456
|
-
const getTrackByValue = function (value, key) {
|
|
12457
|
-
return getTrackByValueFn(value, getLocals(value, key));
|
|
12458
|
-
};
|
|
12418
|
+
function parseOptionsExpression(optionsExp, selectElement, scope) {
|
|
12419
|
+
const match = optionsExp.match(NG_OPTIONS_REGEXP);
|
|
12420
|
+
if (!match) {
|
|
12421
|
+
throw ngOptionsMinErr(
|
|
12422
|
+
"iexp",
|
|
12423
|
+
"Expected expression in form of " +
|
|
12424
|
+
"'_select_ (as _label_)? for (_key_,)?_value_ in _collection_'" +
|
|
12425
|
+
" but got '{0}'. Element: {1}",
|
|
12426
|
+
optionsExp,
|
|
12427
|
+
startingTag(selectElement),
|
|
12428
|
+
);
|
|
12429
|
+
}
|
|
12430
|
+
// Extract the parts from the ngOptions expression
|
|
12431
|
+
|
|
12432
|
+
// The variable name for the value of the item in the collection
|
|
12433
|
+
const valueName = match[5] || match[7];
|
|
12434
|
+
// The variable name for the key of the item in the collection
|
|
12435
|
+
const keyName = match[6];
|
|
12436
|
+
|
|
12437
|
+
// An expression that generates the viewValue for an option if there is a label expression
|
|
12438
|
+
const selectAs = / as /.test(match[0]) && match[1];
|
|
12439
|
+
// An expression that is used to track the id of each object in the options collection
|
|
12440
|
+
const trackBy = match[9];
|
|
12441
|
+
// An expression that generates the viewValue for an option if there is no label expression
|
|
12442
|
+
const valueFn = $parse(match[2] ? match[1] : valueName);
|
|
12443
|
+
const selectAsFn = selectAs && $parse(selectAs);
|
|
12444
|
+
const viewValueFn = selectAsFn || valueFn;
|
|
12445
|
+
const trackByFn = trackBy && $parse(trackBy);
|
|
12446
|
+
|
|
12447
|
+
// Get the value by which we are going to track the option
|
|
12448
|
+
// if we have a trackFn then use that (passing scope and locals)
|
|
12449
|
+
// otherwise just hash the given viewValue
|
|
12450
|
+
const getTrackByValueFn = trackBy
|
|
12451
|
+
? function (value, locals) {
|
|
12452
|
+
return trackByFn(scope, locals);
|
|
12453
|
+
}
|
|
12454
|
+
: function getHashOfValue(value) {
|
|
12455
|
+
return hashKey(value);
|
|
12456
|
+
};
|
|
12457
|
+
const getTrackByValue = function (value, key) {
|
|
12458
|
+
return getTrackByValueFn(value, getLocals(value, key));
|
|
12459
|
+
};
|
|
12459
12460
|
|
|
12460
|
-
|
|
12461
|
-
|
|
12462
|
-
|
|
12463
|
-
|
|
12464
|
-
|
|
12465
|
-
|
|
12466
|
-
|
|
12467
|
-
|
|
12468
|
-
|
|
12469
|
-
|
|
12470
|
-
|
|
12471
|
-
|
|
12472
|
-
|
|
12473
|
-
|
|
12474
|
-
|
|
12475
|
-
|
|
12461
|
+
const displayFn = $parse(match[2] || match[1]);
|
|
12462
|
+
const groupByFn = $parse(match[3] || "");
|
|
12463
|
+
const disableWhenFn = $parse(match[4] || "");
|
|
12464
|
+
const valuesFn = $parse(match[8]);
|
|
12465
|
+
|
|
12466
|
+
const locals = {};
|
|
12467
|
+
let getLocals = keyName
|
|
12468
|
+
? function (value, key) {
|
|
12469
|
+
locals[keyName] = key;
|
|
12470
|
+
locals[valueName] = value;
|
|
12471
|
+
return locals;
|
|
12472
|
+
}
|
|
12473
|
+
: function (value) {
|
|
12474
|
+
locals[valueName] = value;
|
|
12475
|
+
return locals;
|
|
12476
|
+
};
|
|
12476
12477
|
|
|
12477
|
-
|
|
12478
|
-
|
|
12479
|
-
|
|
12480
|
-
|
|
12481
|
-
|
|
12482
|
-
|
|
12483
|
-
|
|
12484
|
-
}
|
|
12478
|
+
class Option {
|
|
12479
|
+
constructor(selectValue, viewValue, label, group, disabled) {
|
|
12480
|
+
this.selectValue = selectValue;
|
|
12481
|
+
this.viewValue = viewValue;
|
|
12482
|
+
this.label = label;
|
|
12483
|
+
this.group = group;
|
|
12484
|
+
this.disabled = disabled;
|
|
12485
12485
|
}
|
|
12486
|
+
}
|
|
12486
12487
|
|
|
12487
|
-
|
|
12488
|
-
|
|
12488
|
+
function getOptionValuesKeys(optionValues) {
|
|
12489
|
+
let optionValuesKeys;
|
|
12489
12490
|
|
|
12490
|
-
|
|
12491
|
-
|
|
12492
|
-
|
|
12493
|
-
|
|
12494
|
-
|
|
12495
|
-
|
|
12496
|
-
|
|
12497
|
-
|
|
12498
|
-
}
|
|
12491
|
+
if (!keyName && isArrayLike(optionValues)) {
|
|
12492
|
+
optionValuesKeys = optionValues;
|
|
12493
|
+
} else {
|
|
12494
|
+
// if object, extract keys, in enumeration order, unsorted
|
|
12495
|
+
optionValuesKeys = [];
|
|
12496
|
+
for (const itemKey in optionValues) {
|
|
12497
|
+
if (hasOwn(optionValues, itemKey) && itemKey.charAt(0) !== "$") {
|
|
12498
|
+
optionValuesKeys.push(itemKey);
|
|
12499
12499
|
}
|
|
12500
12500
|
}
|
|
12501
|
-
return optionValuesKeys;
|
|
12502
12501
|
}
|
|
12502
|
+
return optionValuesKeys;
|
|
12503
|
+
}
|
|
12503
12504
|
|
|
12504
|
-
|
|
12505
|
-
|
|
12506
|
-
|
|
12507
|
-
|
|
12508
|
-
|
|
12509
|
-
|
|
12510
|
-
|
|
12511
|
-
|
|
12512
|
-
|
|
12513
|
-
|
|
12514
|
-
|
|
12515
|
-
|
|
12516
|
-
|
|
12517
|
-
|
|
12518
|
-
|
|
12519
|
-
|
|
12520
|
-
|
|
12521
|
-
|
|
12522
|
-
|
|
12523
|
-
|
|
12524
|
-
|
|
12525
|
-
|
|
12526
|
-
|
|
12527
|
-
// Only need to watch the displayFn if there is a specific label expression
|
|
12528
|
-
if (match[2] || match[1]) {
|
|
12529
|
-
const label = displayFn(scope, locals);
|
|
12530
|
-
watchedArray.push(label);
|
|
12531
|
-
}
|
|
12532
|
-
|
|
12533
|
-
// Only need to watch the disableWhenFn if there is a specific disable expression
|
|
12534
|
-
if (match[4]) {
|
|
12535
|
-
const disableWhen = disableWhenFn(scope, locals);
|
|
12536
|
-
watchedArray.push(disableWhen);
|
|
12537
|
-
}
|
|
12538
|
-
}
|
|
12539
|
-
return watchedArray;
|
|
12540
|
-
}),
|
|
12541
|
-
|
|
12542
|
-
getOptions() {
|
|
12543
|
-
/** @type {Option[]} */
|
|
12544
|
-
const optionItems = [];
|
|
12545
|
-
/** @type {Object.<string, Option>} */
|
|
12546
|
-
const selectValueMap = {};
|
|
12547
|
-
|
|
12548
|
-
// The option values were already computed in the `getWatchables` fn,
|
|
12549
|
-
// which must have been called to trigger `getOptions`
|
|
12550
|
-
const optionValues = valuesFn(scope) || [];
|
|
12551
|
-
const optionValuesKeys = getOptionValuesKeys(optionValues);
|
|
12552
|
-
const optionValuesLength = optionValuesKeys.length;
|
|
12553
|
-
|
|
12554
|
-
for (let index = 0; index < optionValuesLength; index++) {
|
|
12555
|
-
const key =
|
|
12556
|
-
optionValues === optionValuesKeys
|
|
12557
|
-
? index
|
|
12558
|
-
: optionValuesKeys[index];
|
|
12559
|
-
const value = optionValues[key];
|
|
12560
|
-
const locals = getLocals(value, key);
|
|
12561
|
-
const viewValue = viewValueFn(scope, locals);
|
|
12562
|
-
const selectValue = getTrackByValueFn(viewValue, locals);
|
|
12505
|
+
return {
|
|
12506
|
+
trackBy,
|
|
12507
|
+
getTrackByValue,
|
|
12508
|
+
getWatchables: $parse(valuesFn, (optionValues) => {
|
|
12509
|
+
// Create a collection of things that we would like to watch (watchedArray)
|
|
12510
|
+
// so that they can all be watched using a single $watchCollection
|
|
12511
|
+
// that only runs the handler once if anything changes
|
|
12512
|
+
const watchedArray = [];
|
|
12513
|
+
optionValues = optionValues || [];
|
|
12514
|
+
|
|
12515
|
+
const optionValuesKeys = getOptionValuesKeys(optionValues);
|
|
12516
|
+
const optionValuesLength = optionValuesKeys.length;
|
|
12517
|
+
for (let index = 0; index < optionValuesLength; index++) {
|
|
12518
|
+
const key =
|
|
12519
|
+
optionValues === optionValuesKeys ? index : optionValuesKeys[index];
|
|
12520
|
+
const value = optionValues[key];
|
|
12521
|
+
|
|
12522
|
+
const locals = getLocals(value, key);
|
|
12523
|
+
const selectValue = getTrackByValueFn(value, locals);
|
|
12524
|
+
watchedArray.push(selectValue);
|
|
12525
|
+
|
|
12526
|
+
// Only need to watch the displayFn if there is a specific label expression
|
|
12527
|
+
if (match[2] || match[1]) {
|
|
12563
12528
|
const label = displayFn(scope, locals);
|
|
12564
|
-
|
|
12565
|
-
|
|
12566
|
-
|
|
12567
|
-
|
|
12568
|
-
|
|
12569
|
-
|
|
12570
|
-
|
|
12571
|
-
|
|
12572
|
-
|
|
12529
|
+
watchedArray.push(label);
|
|
12530
|
+
}
|
|
12531
|
+
|
|
12532
|
+
// Only need to watch the disableWhenFn if there is a specific disable expression
|
|
12533
|
+
if (match[4]) {
|
|
12534
|
+
const disableWhen = disableWhenFn(scope, locals);
|
|
12535
|
+
watchedArray.push(disableWhen);
|
|
12536
|
+
}
|
|
12537
|
+
}
|
|
12538
|
+
return watchedArray;
|
|
12539
|
+
}),
|
|
12540
|
+
|
|
12541
|
+
getOptions() {
|
|
12542
|
+
/** @type {Option[]} */
|
|
12543
|
+
const optionItems = [];
|
|
12544
|
+
/** @type {Object.<string, Option>} */
|
|
12545
|
+
const selectValueMap = {};
|
|
12546
|
+
|
|
12547
|
+
// The option values were already computed in the `getWatchables` fn,
|
|
12548
|
+
// which must have been called to trigger `getOptions`
|
|
12549
|
+
const optionValues = valuesFn(scope) || [];
|
|
12550
|
+
const optionValuesKeys = getOptionValuesKeys(optionValues);
|
|
12551
|
+
const optionValuesLength = optionValuesKeys.length;
|
|
12552
|
+
|
|
12553
|
+
for (let index = 0; index < optionValuesLength; index++) {
|
|
12554
|
+
const key =
|
|
12555
|
+
optionValues === optionValuesKeys ? index : optionValuesKeys[index];
|
|
12556
|
+
const value = optionValues[key];
|
|
12557
|
+
const locals = getLocals(value, key);
|
|
12558
|
+
const viewValue = viewValueFn(scope, locals);
|
|
12559
|
+
const selectValue = getTrackByValueFn(viewValue, locals);
|
|
12560
|
+
const label = displayFn(scope, locals);
|
|
12561
|
+
const group = groupByFn(scope, locals);
|
|
12562
|
+
const disabled = disableWhenFn(scope, locals);
|
|
12563
|
+
const optionItem = new Option(
|
|
12564
|
+
selectValue,
|
|
12565
|
+
viewValue,
|
|
12566
|
+
label,
|
|
12567
|
+
group,
|
|
12568
|
+
disabled,
|
|
12569
|
+
);
|
|
12573
12570
|
|
|
12574
|
-
|
|
12575
|
-
|
|
12576
|
-
|
|
12571
|
+
optionItems.push(optionItem);
|
|
12572
|
+
selectValueMap[selectValue] = optionItem;
|
|
12573
|
+
}
|
|
12577
12574
|
|
|
12578
|
-
|
|
12579
|
-
|
|
12580
|
-
|
|
12581
|
-
|
|
12582
|
-
|
|
12583
|
-
|
|
12584
|
-
|
|
12585
|
-
|
|
12586
|
-
|
|
12587
|
-
|
|
12588
|
-
|
|
12589
|
-
|
|
12590
|
-
|
|
12591
|
-
|
|
12592
|
-
|
|
12593
|
-
|
|
12594
|
-
|
|
12575
|
+
return {
|
|
12576
|
+
items: optionItems,
|
|
12577
|
+
selectValueMap,
|
|
12578
|
+
getOptionFromViewValue(value) {
|
|
12579
|
+
return selectValueMap[getTrackByValue(value)];
|
|
12580
|
+
},
|
|
12581
|
+
getViewValueFromOption(option) {
|
|
12582
|
+
// If the viewValue could be an object that may be mutated by the application,
|
|
12583
|
+
// we need to make a copy and not return the reference to the value on the option.
|
|
12584
|
+
return trackBy
|
|
12585
|
+
? structuredClone(option.viewValue)
|
|
12586
|
+
: option.viewValue;
|
|
12587
|
+
},
|
|
12588
|
+
};
|
|
12589
|
+
},
|
|
12590
|
+
};
|
|
12591
|
+
}
|
|
12595
12592
|
|
|
12596
|
-
|
|
12597
|
-
|
|
12598
|
-
|
|
12599
|
-
|
|
12600
|
-
|
|
12601
|
-
|
|
12602
|
-
|
|
12603
|
-
|
|
12604
|
-
|
|
12605
|
-
|
|
12606
|
-
|
|
12607
|
-
|
|
12608
|
-
|
|
12609
|
-
|
|
12610
|
-
|
|
12611
|
-
|
|
12612
|
-
|
|
12613
|
-
|
|
12614
|
-
|
|
12615
|
-
|
|
12616
|
-
|
|
12617
|
-
|
|
12618
|
-
|
|
12619
|
-
}
|
|
12593
|
+
/**
|
|
12594
|
+
*
|
|
12595
|
+
* @param {import("../../core/scope/scope.js").Scope} scope
|
|
12596
|
+
* @param {HTMLSelectElement} selectElement
|
|
12597
|
+
* @param {import("../../core/compile/attributes.js").Attributes} attr
|
|
12598
|
+
* @param {*} ctrls
|
|
12599
|
+
*/
|
|
12600
|
+
function ngOptionsPostLink(scope, selectElement, attr, ctrls) {
|
|
12601
|
+
const selectCtrl = ctrls[0];
|
|
12602
|
+
const ngModelCtrl = ctrls[1];
|
|
12603
|
+
const multiple = attr["multiple"];
|
|
12604
|
+
|
|
12605
|
+
// The emptyOption allows the application developer to provide their own custom "empty"
|
|
12606
|
+
// option when the viewValue does not match any of the option values.
|
|
12607
|
+
for (
|
|
12608
|
+
let i = 0, children = selectElement.childNodes, ii = children.length;
|
|
12609
|
+
i < ii;
|
|
12610
|
+
i++
|
|
12611
|
+
) {
|
|
12612
|
+
if (/** @type {HTMLOptionElement} */ (children[i]).value === "") {
|
|
12613
|
+
selectCtrl.hasEmptyOption = true;
|
|
12614
|
+
selectCtrl.emptyOption = children[i];
|
|
12615
|
+
break;
|
|
12620
12616
|
}
|
|
12617
|
+
}
|
|
12621
12618
|
|
|
12622
|
-
|
|
12623
|
-
|
|
12619
|
+
// The empty option will be compiled and rendered before we first generate the options
|
|
12620
|
+
emptyElement(selectElement);
|
|
12624
12621
|
|
|
12625
|
-
|
|
12622
|
+
const providedEmptyOption = !!selectCtrl.emptyOption;
|
|
12626
12623
|
|
|
12627
|
-
|
|
12628
|
-
|
|
12629
|
-
|
|
12624
|
+
const unknownOption = optionTemplate.cloneNode(false);
|
|
12625
|
+
// TODO double check
|
|
12626
|
+
unknownOption.nodeValue = "?";
|
|
12630
12627
|
|
|
12631
|
-
|
|
12632
|
-
|
|
12633
|
-
|
|
12634
|
-
|
|
12635
|
-
|
|
12636
|
-
|
|
12637
|
-
|
|
12638
|
-
|
|
12639
|
-
|
|
12640
|
-
|
|
12641
|
-
|
|
12642
|
-
|
|
12643
|
-
|
|
12644
|
-
|
|
12645
|
-
|
|
12646
|
-
|
|
12647
|
-
|
|
12648
|
-
|
|
12649
|
-
|
|
12650
|
-
|
|
12651
|
-
|
|
12652
|
-
|
|
12653
|
-
|
|
12654
|
-
|
|
12655
|
-
|
|
12656
|
-
|
|
12657
|
-
|
|
12658
|
-
|
|
12659
|
-
|
|
12660
|
-
|
|
12661
|
-
|
|
12662
|
-
|
|
12663
|
-
|
|
12664
|
-
|
|
12665
|
-
|
|
12666
|
-
|
|
12667
|
-
|
|
12668
|
-
selectElement.value = option.selectValue;
|
|
12669
|
-
option.element.selected = true;
|
|
12670
|
-
}
|
|
12628
|
+
let options;
|
|
12629
|
+
const ngOptions = parseOptionsExpression(
|
|
12630
|
+
attr["ngOptions"],
|
|
12631
|
+
selectElement,
|
|
12632
|
+
scope,
|
|
12633
|
+
);
|
|
12634
|
+
// This stores the newly created options before they are appended to the select.
|
|
12635
|
+
// Since the contents are removed from the fragment when it is appended,
|
|
12636
|
+
// we only need to create it once.
|
|
12637
|
+
const listFragment = document.createDocumentFragment();
|
|
12638
|
+
|
|
12639
|
+
// Overwrite the implementation. ngOptions doesn't use hashes
|
|
12640
|
+
selectCtrl.generateUnknownOptionValue = () => "?";
|
|
12641
|
+
|
|
12642
|
+
// Update the controller methods for multiple selectable options
|
|
12643
|
+
if (!multiple) {
|
|
12644
|
+
selectCtrl.writeValue = function writeNgOptionsValue(value) {
|
|
12645
|
+
// The options might not be defined yet when ngModel tries to render
|
|
12646
|
+
if (!options) return;
|
|
12647
|
+
|
|
12648
|
+
const selectedOption =
|
|
12649
|
+
selectElement.options[selectElement.selectedIndex];
|
|
12650
|
+
const option = options.getOptionFromViewValue(value);
|
|
12651
|
+
|
|
12652
|
+
// Make sure to remove the selected attribute from the previously selected option
|
|
12653
|
+
// Otherwise, screen readers might get confused
|
|
12654
|
+
if (selectedOption) selectedOption.removeAttribute("selected");
|
|
12655
|
+
|
|
12656
|
+
if (option) {
|
|
12657
|
+
// Don't update the option when it is already selected.
|
|
12658
|
+
// For example, the browser will select the first option by default. In that case,
|
|
12659
|
+
// most properties are set automatically - except the `selected` attribute, which we
|
|
12660
|
+
// set always
|
|
12661
|
+
|
|
12662
|
+
if (selectElement.value !== option.selectValue) {
|
|
12663
|
+
selectCtrl.removeUnknownOption();
|
|
12671
12664
|
|
|
12672
|
-
option.
|
|
12673
|
-
|
|
12674
|
-
selectCtrl.selectUnknownOrEmptyOption(value);
|
|
12665
|
+
selectElement.value = option.selectValue;
|
|
12666
|
+
option.element.selected = true;
|
|
12675
12667
|
}
|
|
12676
|
-
};
|
|
12677
12668
|
|
|
12678
|
-
|
|
12679
|
-
|
|
12669
|
+
option.element.setAttribute("selected", "selected");
|
|
12670
|
+
} else {
|
|
12671
|
+
selectCtrl.selectUnknownOrEmptyOption(value);
|
|
12672
|
+
}
|
|
12673
|
+
};
|
|
12680
12674
|
|
|
12681
|
-
|
|
12682
|
-
|
|
12683
|
-
selectCtrl.removeUnknownOption();
|
|
12684
|
-
return options.getViewValueFromOption(selectedOption);
|
|
12685
|
-
}
|
|
12686
|
-
return null;
|
|
12687
|
-
};
|
|
12675
|
+
selectCtrl.readValue = function readNgOptionsValue() {
|
|
12676
|
+
const selectedOption = options.selectValueMap[selectElement.value];
|
|
12688
12677
|
|
|
12689
|
-
|
|
12690
|
-
|
|
12691
|
-
|
|
12692
|
-
|
|
12693
|
-
scope.$watch(
|
|
12694
|
-
ngOptions.getTrackByValue(ngModelCtrl.$viewValue),
|
|
12695
|
-
() => {
|
|
12696
|
-
ngModelCtrl.$render();
|
|
12697
|
-
},
|
|
12698
|
-
);
|
|
12678
|
+
if (selectedOption && !selectedOption.disabled) {
|
|
12679
|
+
selectCtrl.unselectEmptyOption();
|
|
12680
|
+
selectCtrl.removeUnknownOption();
|
|
12681
|
+
return options.getViewValueFromOption(selectedOption);
|
|
12699
12682
|
}
|
|
12700
|
-
|
|
12701
|
-
|
|
12702
|
-
// The options might not be defined yet when ngModel tries to render
|
|
12703
|
-
if (!options) return;
|
|
12704
|
-
|
|
12705
|
-
// Only set `<option>.selected` if necessary, in order to prevent some browsers from
|
|
12706
|
-
// scrolling to `<option>` elements that are outside the `<select>` element's viewport.
|
|
12707
|
-
const selectedOptions =
|
|
12708
|
-
(values && values.map(getAndUpdateSelectedOption)) || [];
|
|
12709
|
-
|
|
12710
|
-
options.items.forEach((option) => {
|
|
12711
|
-
if (option.element.selected && !includes(selectedOptions, option)) {
|
|
12712
|
-
option.element.selected = false;
|
|
12713
|
-
}
|
|
12714
|
-
});
|
|
12715
|
-
};
|
|
12683
|
+
return null;
|
|
12684
|
+
};
|
|
12716
12685
|
|
|
12717
|
-
|
|
12718
|
-
|
|
12719
|
-
|
|
12720
|
-
|
|
12721
|
-
|
|
12722
|
-
|
|
12723
|
-
|
|
12724
|
-
|
|
12725
|
-
|
|
12686
|
+
// If we are using `track by` then we must watch the tracked value on the model
|
|
12687
|
+
// since ngModel only watches for object identity change
|
|
12688
|
+
// FIXME: When a user selects an option, this watch will fire needlessly
|
|
12689
|
+
if (ngOptions.trackBy) {
|
|
12690
|
+
scope.$watch(ngOptions.getTrackByValue(ngModelCtrl.$viewValue), () => {
|
|
12691
|
+
ngModelCtrl.$render();
|
|
12692
|
+
});
|
|
12693
|
+
}
|
|
12694
|
+
} else {
|
|
12695
|
+
selectCtrl.writeValue = function writeNgOptionsMultiple(values) {
|
|
12696
|
+
// The options might not be defined yet when ngModel tries to render
|
|
12697
|
+
if (!options) return;
|
|
12726
12698
|
|
|
12727
|
-
|
|
12728
|
-
|
|
12699
|
+
// Only set `<option>.selected` if necessary, in order to prevent some browsers from
|
|
12700
|
+
// scrolling to `<option>` elements that are outside the `<select>` element's viewport.
|
|
12701
|
+
const selectedOptions =
|
|
12702
|
+
(values && values.map(getAndUpdateSelectedOption)) || [];
|
|
12729
12703
|
|
|
12730
|
-
|
|
12731
|
-
|
|
12732
|
-
|
|
12733
|
-
|
|
12734
|
-
|
|
12735
|
-
|
|
12736
|
-
// return ngModelCtrl.$viewValue.map((value) =>
|
|
12737
|
-
// ngOptions.getTrackByValue(value),
|
|
12738
|
-
// );
|
|
12739
|
-
// }
|
|
12740
|
-
// },
|
|
12741
|
-
// () => {
|
|
12742
|
-
// ngModelCtrl.$render();
|
|
12743
|
-
// },
|
|
12744
|
-
// );
|
|
12745
|
-
// }
|
|
12746
|
-
}
|
|
12704
|
+
options.items.forEach((option) => {
|
|
12705
|
+
if (option.element.selected && !includes(selectedOptions, option)) {
|
|
12706
|
+
option.element.selected = false;
|
|
12707
|
+
}
|
|
12708
|
+
});
|
|
12709
|
+
};
|
|
12747
12710
|
|
|
12748
|
-
|
|
12749
|
-
|
|
12750
|
-
const
|
|
12751
|
-
|
|
12752
|
-
|
|
12753
|
-
|
|
12711
|
+
selectCtrl.readValue = function readNgOptionsMultiple() {
|
|
12712
|
+
const selectedValues = selectElement.value || [];
|
|
12713
|
+
const selections = [];
|
|
12714
|
+
// @ts-ignore
|
|
12715
|
+
selectedValues.forEach((value) => {
|
|
12716
|
+
const option = options.selectValueMap[value];
|
|
12717
|
+
if (option && !option.disabled)
|
|
12718
|
+
selections.push(options.getViewValueFromOption(option));
|
|
12719
|
+
});
|
|
12754
12720
|
|
|
12755
|
-
|
|
12756
|
-
|
|
12757
|
-
// it has been modified by a transclusion directive.
|
|
12758
|
-
selectCtrl.hasEmptyOption = false;
|
|
12721
|
+
return selections;
|
|
12722
|
+
};
|
|
12759
12723
|
|
|
12760
|
-
|
|
12761
|
-
|
|
12762
|
-
|
|
12763
|
-
|
|
12764
|
-
|
|
12765
|
-
|
|
12766
|
-
|
|
12767
|
-
|
|
12768
|
-
|
|
12724
|
+
// If we are using `track by` then we must watch these tracked values on the model
|
|
12725
|
+
// since ngModel only watches for object identity change
|
|
12726
|
+
// if (ngOptions.trackBy) {
|
|
12727
|
+
// scope.$watchCollection(
|
|
12728
|
+
// () => {
|
|
12729
|
+
// if (Array.isArray(ngModelCtrl.$viewValue)) {
|
|
12730
|
+
// return ngModelCtrl.$viewValue.map((value) =>
|
|
12731
|
+
// ngOptions.getTrackByValue(value),
|
|
12732
|
+
// );
|
|
12733
|
+
// }
|
|
12734
|
+
// },
|
|
12735
|
+
// () => {
|
|
12736
|
+
// ngModelCtrl.$render();
|
|
12737
|
+
// },
|
|
12738
|
+
// );
|
|
12739
|
+
// }
|
|
12740
|
+
}
|
|
12769
12741
|
|
|
12770
|
-
|
|
12771
|
-
|
|
12742
|
+
if (providedEmptyOption) {
|
|
12743
|
+
// compile the element since there might be bindings in it
|
|
12744
|
+
const linkFn = $compile(selectCtrl.emptyOption);
|
|
12745
|
+
assertArg$1(linkFn, "LinkFn required");
|
|
12746
|
+
selectElement.prepend(selectCtrl.emptyOption);
|
|
12747
|
+
linkFn(scope);
|
|
12748
|
+
|
|
12749
|
+
if (selectCtrl.emptyOption.nodeType === Node.COMMENT_NODE) {
|
|
12750
|
+
// This means the empty option has currently no actual DOM node, probably because
|
|
12751
|
+
// it has been modified by a transclusion directive.
|
|
12752
|
+
selectCtrl.hasEmptyOption = false;
|
|
12753
|
+
|
|
12754
|
+
// Redefine the registerOption function, which will catch
|
|
12755
|
+
// options that are added by ngIf etc. (rendering of the node is async because of
|
|
12756
|
+
// lazy transclusion)
|
|
12757
|
+
selectCtrl.registerOption = function (optionScope, optionEl) {
|
|
12758
|
+
if (optionEl.value === "") {
|
|
12759
|
+
selectCtrl.hasEmptyOption = true;
|
|
12760
|
+
selectCtrl.emptyOption = optionEl;
|
|
12761
|
+
// This ensures the new empty option is selected if previously no option was selected
|
|
12762
|
+
ngModelCtrl.$render();
|
|
12772
12763
|
|
|
12773
|
-
|
|
12774
|
-
|
|
12764
|
+
optionEl.addEventListener("$destroy", () => {
|
|
12765
|
+
const needsRerender = selectCtrl.$isEmptyOptionSelected();
|
|
12775
12766
|
|
|
12776
|
-
|
|
12777
|
-
|
|
12778
|
-
|
|
12779
|
-
|
|
12780
|
-
|
|
12767
|
+
selectCtrl.hasEmptyOption = false;
|
|
12768
|
+
selectCtrl.emptyOption = undefined;
|
|
12769
|
+
|
|
12770
|
+
if (needsRerender) ngModelCtrl.$render();
|
|
12771
|
+
});
|
|
12772
|
+
}
|
|
12773
|
+
};
|
|
12781
12774
|
}
|
|
12775
|
+
}
|
|
12782
12776
|
|
|
12783
|
-
|
|
12777
|
+
// We will re-render the option elements if the option values or labels change
|
|
12784
12778
|
|
|
12785
|
-
|
|
12786
|
-
|
|
12787
|
-
|
|
12788
|
-
|
|
12789
|
-
|
|
12790
|
-
|
|
12791
|
-
|
|
12792
|
-
|
|
12779
|
+
// let watchables = ngOptions.getWatchables();
|
|
12780
|
+
// watchables.forEach((i) => {
|
|
12781
|
+
// scope.$watch(i, updateOptions);
|
|
12782
|
+
// });
|
|
12783
|
+
scope.$watch(
|
|
12784
|
+
ngOptions.getWatchables.decoratedNode.body[0].expression.name,
|
|
12785
|
+
updateOptions,
|
|
12786
|
+
);
|
|
12793
12787
|
|
|
12794
|
-
|
|
12788
|
+
// ------------------------------------------------------------------ //
|
|
12795
12789
|
|
|
12796
|
-
|
|
12797
|
-
|
|
12798
|
-
|
|
12799
|
-
|
|
12800
|
-
|
|
12801
|
-
|
|
12802
|
-
|
|
12803
|
-
|
|
12804
|
-
|
|
12805
|
-
|
|
12790
|
+
function addOptionElement(option, parent) {
|
|
12791
|
+
/**
|
|
12792
|
+
* @type {HTMLOptionElement}
|
|
12793
|
+
*/
|
|
12794
|
+
const optionElement = /** @type {HTMLOptionElement} */ (
|
|
12795
|
+
optionTemplate.cloneNode(false)
|
|
12796
|
+
);
|
|
12797
|
+
parent.appendChild(optionElement);
|
|
12798
|
+
updateOptionElement(option, optionElement);
|
|
12799
|
+
}
|
|
12806
12800
|
|
|
12807
|
-
|
|
12808
|
-
|
|
12809
|
-
|
|
12801
|
+
function getAndUpdateSelectedOption(viewValue) {
|
|
12802
|
+
const option = options.getOptionFromViewValue(viewValue);
|
|
12803
|
+
const element = option && option.element;
|
|
12810
12804
|
|
|
12811
|
-
|
|
12805
|
+
if (element && !element.selected) element.selected = true;
|
|
12812
12806
|
|
|
12813
|
-
|
|
12814
|
-
|
|
12807
|
+
return option;
|
|
12808
|
+
}
|
|
12815
12809
|
|
|
12816
|
-
|
|
12817
|
-
|
|
12818
|
-
|
|
12819
|
-
|
|
12820
|
-
|
|
12821
|
-
|
|
12822
|
-
|
|
12823
|
-
|
|
12824
|
-
|
|
12825
|
-
|
|
12826
|
-
|
|
12827
|
-
|
|
12828
|
-
}
|
|
12829
|
-
element.value = option.selectValue;
|
|
12810
|
+
function updateOptionElement(option, element) {
|
|
12811
|
+
option.element = element;
|
|
12812
|
+
element.disabled = option.disabled;
|
|
12813
|
+
// Support: IE 11 only, Edge 12-13 only
|
|
12814
|
+
// NOTE: The label must be set before the value, otherwise IE 11 & Edge create unresponsive
|
|
12815
|
+
// selects in certain circumstances when multiple selects are next to each other and display
|
|
12816
|
+
// the option list in listbox style, i.e. the select is [multiple], or specifies a [size].
|
|
12817
|
+
// See https://github.com/angular/angular.js/issues/11314 for more info.
|
|
12818
|
+
// This is unfortunately untestable with unit / e2e tests
|
|
12819
|
+
if (option.label !== element.label) {
|
|
12820
|
+
element.label = option.label;
|
|
12821
|
+
element.textContent = option.label;
|
|
12830
12822
|
}
|
|
12823
|
+
element.value = option.selectValue;
|
|
12824
|
+
}
|
|
12831
12825
|
|
|
12832
|
-
|
|
12833
|
-
|
|
12826
|
+
function updateOptions() {
|
|
12827
|
+
const previousValue = options && selectCtrl.readValue();
|
|
12834
12828
|
|
|
12835
|
-
|
|
12836
|
-
|
|
12837
|
-
|
|
12838
|
-
|
|
12839
|
-
|
|
12840
|
-
|
|
12841
|
-
|
|
12842
|
-
|
|
12843
|
-
|
|
12844
|
-
|
|
12845
|
-
|
|
12846
|
-
|
|
12847
|
-
}
|
|
12829
|
+
// We must remove all current options, but cannot simply set innerHTML = null
|
|
12830
|
+
// since the providedEmptyOption might have an ngIf on it that inserts comments which we
|
|
12831
|
+
// must preserve.
|
|
12832
|
+
// Instead, iterate over the current option elements and remove them or their optgroup
|
|
12833
|
+
// parents
|
|
12834
|
+
if (options) {
|
|
12835
|
+
for (let i = options.items.length - 1; i >= 0; i--) {
|
|
12836
|
+
const option = options.items[i];
|
|
12837
|
+
if (isDefined(option.group)) {
|
|
12838
|
+
removeElement(option.element.parentNode);
|
|
12839
|
+
} else {
|
|
12840
|
+
removeElement(option.element);
|
|
12848
12841
|
}
|
|
12849
12842
|
}
|
|
12843
|
+
}
|
|
12850
12844
|
|
|
12851
|
-
|
|
12845
|
+
options = ngOptions.getOptions();
|
|
12852
12846
|
|
|
12853
|
-
|
|
12847
|
+
const groupElementMap = {};
|
|
12854
12848
|
|
|
12855
|
-
|
|
12856
|
-
|
|
12849
|
+
options.items.forEach((option) => {
|
|
12850
|
+
let groupElement;
|
|
12857
12851
|
|
|
12858
|
-
|
|
12859
|
-
|
|
12860
|
-
|
|
12861
|
-
|
|
12862
|
-
|
|
12863
|
-
if (!groupElement) {
|
|
12864
|
-
groupElement = optGroupTemplate.cloneNode(false);
|
|
12865
|
-
listFragment.appendChild(groupElement);
|
|
12866
|
-
|
|
12867
|
-
// Update the label on the group element
|
|
12868
|
-
// "null" is special cased because of Safari
|
|
12869
|
-
/** @type {HTMLOptGroupElement} */
|
|
12870
|
-
(groupElement).label =
|
|
12871
|
-
option.group === null ? "null" : option.group;
|
|
12872
|
-
|
|
12873
|
-
// Store it for use later
|
|
12874
|
-
groupElementMap[option.group] = groupElement;
|
|
12875
|
-
}
|
|
12852
|
+
if (isDefined(option.group)) {
|
|
12853
|
+
// This option is to live in a group
|
|
12854
|
+
// See if we have already created this group
|
|
12855
|
+
groupElement = groupElementMap[option.group];
|
|
12876
12856
|
|
|
12877
|
-
|
|
12878
|
-
|
|
12879
|
-
|
|
12880
|
-
|
|
12857
|
+
if (!groupElement) {
|
|
12858
|
+
groupElement = optGroupTemplate.cloneNode(false);
|
|
12859
|
+
listFragment.appendChild(groupElement);
|
|
12860
|
+
|
|
12861
|
+
// Update the label on the group element
|
|
12862
|
+
// "null" is special cased because of Safari
|
|
12863
|
+
/** @type {HTMLOptGroupElement} */
|
|
12864
|
+
(groupElement).label =
|
|
12865
|
+
option.group === null ? "null" : option.group;
|
|
12866
|
+
|
|
12867
|
+
// Store it for use later
|
|
12868
|
+
groupElementMap[option.group] = groupElement;
|
|
12881
12869
|
}
|
|
12882
|
-
});
|
|
12883
12870
|
|
|
12884
|
-
|
|
12871
|
+
addOptionElement(option, groupElement);
|
|
12872
|
+
} else {
|
|
12873
|
+
// This option is not in a group
|
|
12874
|
+
addOptionElement(option, listFragment);
|
|
12875
|
+
}
|
|
12876
|
+
});
|
|
12885
12877
|
|
|
12886
|
-
|
|
12878
|
+
selectElement.appendChild(listFragment);
|
|
12887
12879
|
|
|
12888
|
-
|
|
12889
|
-
|
|
12890
|
-
|
|
12891
|
-
|
|
12892
|
-
|
|
12893
|
-
|
|
12894
|
-
|
|
12895
|
-
|
|
12896
|
-
|
|
12897
|
-
|
|
12898
|
-
|
|
12899
|
-
|
|
12880
|
+
ngModelCtrl.$render();
|
|
12881
|
+
|
|
12882
|
+
// Check to see if the value has changed due to the update to the options
|
|
12883
|
+
if (!ngModelCtrl.$isEmpty(previousValue)) {
|
|
12884
|
+
const nextValue = selectCtrl.readValue();
|
|
12885
|
+
const isNotPrimitive = ngOptions.trackBy || multiple;
|
|
12886
|
+
if (
|
|
12887
|
+
isNotPrimitive
|
|
12888
|
+
? !equals$1(previousValue, nextValue)
|
|
12889
|
+
: previousValue !== nextValue
|
|
12890
|
+
) {
|
|
12891
|
+
ngModelCtrl.$setViewValue(nextValue);
|
|
12892
|
+
ngModelCtrl.$render();
|
|
12900
12893
|
}
|
|
12901
12894
|
}
|
|
12902
12895
|
}
|
|
12896
|
+
}
|
|
12903
12897
|
|
|
12904
|
-
|
|
12905
|
-
|
|
12906
|
-
|
|
12907
|
-
|
|
12908
|
-
|
|
12909
|
-
|
|
12910
|
-
|
|
12911
|
-
|
|
12912
|
-
|
|
12913
|
-
|
|
12914
|
-
},
|
|
12915
|
-
post: ngOptionsPostLink,
|
|
12898
|
+
return {
|
|
12899
|
+
restrict: "A",
|
|
12900
|
+
terminal: true,
|
|
12901
|
+
require: ["select", "ngModel"],
|
|
12902
|
+
link: {
|
|
12903
|
+
pre: function ngOptionsPreLink(scope, selectElement, attr, ctrls) {
|
|
12904
|
+
// Deactivate the SelectController.register method to prevent
|
|
12905
|
+
// option directives from accidentally registering themselves
|
|
12906
|
+
// (and unwanted $destroy handlers etc.)
|
|
12907
|
+
ctrls[0].registerOption = () => {};
|
|
12916
12908
|
},
|
|
12917
|
-
|
|
12918
|
-
|
|
12919
|
-
|
|
12909
|
+
post: ngOptionsPostLink,
|
|
12910
|
+
},
|
|
12911
|
+
};
|
|
12912
|
+
}
|
|
12920
12913
|
|
|
12921
12914
|
/**
|
|
12922
12915
|
* Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion.
|
|
@@ -12935,113 +12928,114 @@
|
|
|
12935
12928
|
* or its value is the same as the name of the attribute then the default slot is used.
|
|
12936
12929
|
*/
|
|
12937
12930
|
const ngTranscludeMinErr = minErr("ngTransclude");
|
|
12938
|
-
const ngTranscludeDirective = [
|
|
12939
|
-
"$compile",
|
|
12940
12931
|
|
|
12941
|
-
|
|
12942
|
-
|
|
12943
|
-
|
|
12944
|
-
|
|
12945
|
-
|
|
12946
|
-
|
|
12947
|
-
|
|
12948
|
-
|
|
12949
|
-
|
|
12950
|
-
|
|
12932
|
+
ngTranscludeDirective.$inject = ["$compile"];
|
|
12933
|
+
/**
|
|
12934
|
+
* @param {import("../../core/compile/compile.js").CompileFn} $compile
|
|
12935
|
+
* @returns {import("../../interface.ts").Directive}
|
|
12936
|
+
*/
|
|
12937
|
+
function ngTranscludeDirective($compile) {
|
|
12938
|
+
return {
|
|
12939
|
+
compile: function ngTranscludeCompile(tElement) {
|
|
12940
|
+
// Remove and cache any original content to act as a fallback
|
|
12941
|
+
const fallbackLinkFn = $compile(tElement.childNodes);
|
|
12942
|
+
emptyElement(tElement);
|
|
12951
12943
|
|
|
12952
|
-
|
|
12953
|
-
|
|
12954
|
-
|
|
12955
|
-
|
|
12956
|
-
|
|
12957
|
-
|
|
12958
|
-
|
|
12959
|
-
|
|
12960
|
-
|
|
12961
|
-
|
|
12962
|
-
|
|
12963
|
-
|
|
12964
|
-
|
|
12965
|
-
|
|
12966
|
-
|
|
12967
|
-
|
|
12968
|
-
|
|
12969
|
-
|
|
12970
|
-
|
|
12971
|
-
|
|
12972
|
-
|
|
12973
|
-
|
|
12974
|
-
|
|
12975
|
-
|
|
12944
|
+
/**
|
|
12945
|
+
*
|
|
12946
|
+
* @param {import("../../core/scope/scope.js").Scope} $scope
|
|
12947
|
+
* @param {Element} $element
|
|
12948
|
+
* @param {import("../../core/compile/attributes.js").Attributes} $attrs
|
|
12949
|
+
* @param {*} _controller
|
|
12950
|
+
* @param {*} $transclude
|
|
12951
|
+
*/
|
|
12952
|
+
function ngTranscludePostLink(
|
|
12953
|
+
$scope,
|
|
12954
|
+
$element,
|
|
12955
|
+
$attrs,
|
|
12956
|
+
_controller,
|
|
12957
|
+
$transclude,
|
|
12958
|
+
) {
|
|
12959
|
+
if (!$transclude) {
|
|
12960
|
+
throw ngTranscludeMinErr(
|
|
12961
|
+
"orphan",
|
|
12962
|
+
"Illegal use of ngTransclude directive in the template! " +
|
|
12963
|
+
"No parent directive that requires a transclusion found. " +
|
|
12964
|
+
"Element: {0}",
|
|
12965
|
+
startingTag($element),
|
|
12966
|
+
);
|
|
12967
|
+
}
|
|
12976
12968
|
|
|
12977
|
-
|
|
12978
|
-
|
|
12979
|
-
|
|
12980
|
-
|
|
12981
|
-
|
|
12969
|
+
// If the attribute is of the form: `ng-transclude="ng-transclude"` then treat it like the default
|
|
12970
|
+
if ($attrs["ngTransclude"] === $attrs.$attr.ngTransclude) {
|
|
12971
|
+
$attrs["ngTransclude"] = "";
|
|
12972
|
+
}
|
|
12973
|
+
const slotName = $attrs["ngTransclude"] || $attrs["ngTranscludeSlot"];
|
|
12982
12974
|
|
|
12983
|
-
|
|
12984
|
-
|
|
12975
|
+
// If the slot is required and no transclusion content is provided then this call will throw an error
|
|
12976
|
+
$transclude(ngTranscludeCloneAttachFn, null, slotName);
|
|
12985
12977
|
|
|
12986
|
-
|
|
12987
|
-
|
|
12988
|
-
|
|
12989
|
-
|
|
12978
|
+
// If the slot is optional and no transclusion content is provided then use the fallback content
|
|
12979
|
+
if (slotName && !$transclude.isSlotFilled(slotName)) {
|
|
12980
|
+
useFallbackContent();
|
|
12981
|
+
}
|
|
12990
12982
|
|
|
12991
|
-
|
|
12992
|
-
|
|
12993
|
-
|
|
12994
|
-
|
|
12995
|
-
|
|
12996
|
-
|
|
12997
|
-
|
|
12998
|
-
|
|
12999
|
-
|
|
13000
|
-
|
|
13001
|
-
} else {
|
|
13002
|
-
$element.append(/** @type {Node} */ (clone));
|
|
13003
|
-
}
|
|
12983
|
+
/**
|
|
12984
|
+
* @param {NodeList | Node} clone
|
|
12985
|
+
* @param {import("../../core/scope/scope.js").Scope} transcludedScope
|
|
12986
|
+
*/
|
|
12987
|
+
function ngTranscludeCloneAttachFn(clone, transcludedScope) {
|
|
12988
|
+
if (notWhitespace(clone)) {
|
|
12989
|
+
if (clone instanceof NodeList) {
|
|
12990
|
+
Array.from(clone).forEach((el) => {
|
|
12991
|
+
$element.append(el);
|
|
12992
|
+
});
|
|
13004
12993
|
} else {
|
|
13005
|
-
|
|
13006
|
-
// There is nothing linked against the transcluded scope since no content was available,
|
|
13007
|
-
// so it should be safe to clean up the generated scope.
|
|
13008
|
-
transcludedScope.$destroy();
|
|
12994
|
+
$element.append(/** @type {Node} */ (clone));
|
|
13009
12995
|
}
|
|
12996
|
+
} else {
|
|
12997
|
+
useFallbackContent();
|
|
12998
|
+
// There is nothing linked against the transcluded scope since no content was available,
|
|
12999
|
+
// so it should be safe to clean up the generated scope.
|
|
13000
|
+
transcludedScope.$destroy();
|
|
13010
13001
|
}
|
|
13002
|
+
}
|
|
13011
13003
|
|
|
13012
|
-
|
|
13013
|
-
|
|
13014
|
-
|
|
13015
|
-
|
|
13016
|
-
|
|
13004
|
+
function useFallbackContent() {
|
|
13005
|
+
// Since this is the fallback content rather than the transcluded content,
|
|
13006
|
+
// we link against the scope of this directive rather than the transcluded scope
|
|
13007
|
+
fallbackLinkFn(
|
|
13008
|
+
$scope,
|
|
13017
13009
|
|
|
13018
|
-
|
|
13019
|
-
|
|
13020
|
-
|
|
13021
|
-
|
|
13022
|
-
|
|
13023
|
-
|
|
13010
|
+
(clone) => {
|
|
13011
|
+
// @ts-ignore
|
|
13012
|
+
$element.append(clone);
|
|
13013
|
+
},
|
|
13014
|
+
);
|
|
13015
|
+
}
|
|
13024
13016
|
|
|
13025
|
-
|
|
13026
|
-
|
|
13027
|
-
|
|
13028
|
-
|
|
13029
|
-
|
|
13030
|
-
|
|
13031
|
-
|
|
13032
|
-
|
|
13033
|
-
}
|
|
13017
|
+
function notWhitespace(node) {
|
|
13018
|
+
if (node instanceof Array) {
|
|
13019
|
+
return false;
|
|
13020
|
+
} else if (
|
|
13021
|
+
node.nodeType !== Node.TEXT_NODE ||
|
|
13022
|
+
node.nodeValue.trim()
|
|
13023
|
+
) {
|
|
13024
|
+
return true;
|
|
13034
13025
|
}
|
|
13035
13026
|
}
|
|
13027
|
+
}
|
|
13036
13028
|
|
|
13037
|
-
|
|
13038
|
-
|
|
13039
|
-
|
|
13040
|
-
|
|
13041
|
-
];
|
|
13029
|
+
return ngTranscludePostLink;
|
|
13030
|
+
},
|
|
13031
|
+
};
|
|
13032
|
+
}
|
|
13042
13033
|
|
|
13043
13034
|
const REGEX_STRING_REGEXP = /^\/(.+)\/([a-z]*)$/;
|
|
13044
13035
|
|
|
13036
|
+
/**
|
|
13037
|
+
* @type {Record<string, import("../../interface.js").DirectiveFactory>}
|
|
13038
|
+
*/
|
|
13045
13039
|
const ngAttributeAliasDirectives = {};
|
|
13046
13040
|
|
|
13047
13041
|
// boolean attrs are evaluated
|
|
@@ -13084,10 +13078,10 @@
|
|
|
13084
13078
|
link(scope, element, attr) {
|
|
13085
13079
|
// special case ngPattern when a literal regular expression value
|
|
13086
13080
|
// is used as the expression (this way we don't have to watch anything).
|
|
13087
|
-
if (ngAttr === "ngPattern" && attr
|
|
13088
|
-
const match = attr
|
|
13081
|
+
if (ngAttr === "ngPattern" && attr["ngPattern"].charAt(0) === "/") {
|
|
13082
|
+
const match = attr["ngPattern"].match(REGEX_STRING_REGEXP);
|
|
13089
13083
|
if (match) {
|
|
13090
|
-
attr.$set("ngPattern", new RegExp(match[1], match[2]));
|
|
13084
|
+
attr.$set("ngPattern", new RegExp(match[1], match[2]).toString());
|
|
13091
13085
|
return;
|
|
13092
13086
|
}
|
|
13093
13087
|
}
|
|
@@ -13113,7 +13107,7 @@
|
|
|
13113
13107
|
|
|
13114
13108
|
if (
|
|
13115
13109
|
attrName === "href" &&
|
|
13116
|
-
toString.call(element
|
|
13110
|
+
toString.call(element["href"]) === "[object SVGAnimatedString]"
|
|
13117
13111
|
) {
|
|
13118
13112
|
name = "xlinkHref";
|
|
13119
13113
|
attr.$attr[name] = "href";
|
|
@@ -13499,7 +13493,7 @@
|
|
|
13499
13493
|
"$rootScope",
|
|
13500
13494
|
/**
|
|
13501
13495
|
*
|
|
13502
|
-
* @param {import('../
|
|
13496
|
+
* @param {import('../services/location/location.js').Location} $location
|
|
13503
13497
|
* @param {import('../core/scope/scope.js').Scope} $rootScope
|
|
13504
13498
|
* @returns
|
|
13505
13499
|
*/
|
|
@@ -14517,216 +14511,6 @@
|
|
|
14517
14511
|
];
|
|
14518
14512
|
}
|
|
14519
14513
|
|
|
14520
|
-
/**
|
|
14521
|
-
* Removes a trailing hash ('#') from the given URL if it exists.
|
|
14522
|
-
*
|
|
14523
|
-
* @param {string} url
|
|
14524
|
-
* @returns {string}
|
|
14525
|
-
*/
|
|
14526
|
-
function trimEmptyHash(url) {
|
|
14527
|
-
return url.replace(/#$/, "");
|
|
14528
|
-
}
|
|
14529
|
-
|
|
14530
|
-
/**
|
|
14531
|
-
* @typedef {function(string, string|null): any} UrlChangeListener
|
|
14532
|
-
*/
|
|
14533
|
-
|
|
14534
|
-
/**
|
|
14535
|
-
* This object has two goals:
|
|
14536
|
-
*
|
|
14537
|
-
* - hide all the global state in the browser caused by the window object
|
|
14538
|
-
* - abstract away all the browser specific features and inconsistencies
|
|
14539
|
-
*/
|
|
14540
|
-
class Browser {
|
|
14541
|
-
/**
|
|
14542
|
-
* @param {import('../core/task-tracker-factory.js').TaskTracker} taskTracker
|
|
14543
|
-
*/
|
|
14544
|
-
constructor(taskTracker) {
|
|
14545
|
-
/**
|
|
14546
|
-
* @type {import('../core/task-tracker-factory.js').TaskTracker} taskTracker
|
|
14547
|
-
*/
|
|
14548
|
-
this.taskTracker = taskTracker;
|
|
14549
|
-
this.pendingDeferIds = {};
|
|
14550
|
-
/** @type {Array<UrlChangeListener>} */
|
|
14551
|
-
this.urlChangeListeners = [];
|
|
14552
|
-
this.urlChangeInit = false;
|
|
14553
|
-
|
|
14554
|
-
/** @type {any} */
|
|
14555
|
-
this.cachedState = null;
|
|
14556
|
-
/** @type {any} */
|
|
14557
|
-
this.lastHistoryState = null;
|
|
14558
|
-
/** @type {string} */
|
|
14559
|
-
this.lastBrowserUrl = window.location.href;
|
|
14560
|
-
/** @type {HTMLBaseElement | null} */
|
|
14561
|
-
this.baseElement = document.querySelector("base");
|
|
14562
|
-
|
|
14563
|
-
// Task-tracking API
|
|
14564
|
-
this.$$completeOutstandingRequest =
|
|
14565
|
-
this.taskTracker.completeTask.bind(taskTracker);
|
|
14566
|
-
this.$$incOutstandingRequestCount =
|
|
14567
|
-
this.taskTracker.incTaskCount.bind(taskTracker);
|
|
14568
|
-
this.notifyWhenNoOutstandingRequests =
|
|
14569
|
-
this.taskTracker.notifyWhenNoPendingTasks.bind(taskTracker);
|
|
14570
|
-
|
|
14571
|
-
this.cacheState();
|
|
14572
|
-
}
|
|
14573
|
-
|
|
14574
|
-
/// ///////////////////////////////////////////////////////////
|
|
14575
|
-
// URL API
|
|
14576
|
-
/// ///////////////////////////////////////////////////////////
|
|
14577
|
-
|
|
14578
|
-
url(url, state) {
|
|
14579
|
-
if (state === undefined) {
|
|
14580
|
-
state = null;
|
|
14581
|
-
}
|
|
14582
|
-
|
|
14583
|
-
// setter
|
|
14584
|
-
if (url) {
|
|
14585
|
-
url = urlResolve(url).href;
|
|
14586
|
-
|
|
14587
|
-
if (this.lastBrowserUrl === url && this.lastHistoryState === state) {
|
|
14588
|
-
return this;
|
|
14589
|
-
}
|
|
14590
|
-
|
|
14591
|
-
this.lastBrowserUrl = url;
|
|
14592
|
-
this.lastHistoryState = state;
|
|
14593
|
-
history.pushState(state, "", url);
|
|
14594
|
-
this.cacheState();
|
|
14595
|
-
return this;
|
|
14596
|
-
}
|
|
14597
|
-
|
|
14598
|
-
// getter
|
|
14599
|
-
return trimEmptyHash(window.location.href);
|
|
14600
|
-
}
|
|
14601
|
-
|
|
14602
|
-
/**
|
|
14603
|
-
* Returns the cached state.
|
|
14604
|
-
*
|
|
14605
|
-
* @returns {any} The cached state.
|
|
14606
|
-
*/
|
|
14607
|
-
state() {
|
|
14608
|
-
return this.cachedState;
|
|
14609
|
-
}
|
|
14610
|
-
|
|
14611
|
-
/**
|
|
14612
|
-
* Caches the current state and fires the URL change event.
|
|
14613
|
-
*
|
|
14614
|
-
* @private
|
|
14615
|
-
*/
|
|
14616
|
-
cacheStateAndFireUrlChange() {
|
|
14617
|
-
this.fireStateOrUrlChange();
|
|
14618
|
-
}
|
|
14619
|
-
|
|
14620
|
-
/**
|
|
14621
|
-
* Caches the current state.
|
|
14622
|
-
*
|
|
14623
|
-
* @private
|
|
14624
|
-
*/
|
|
14625
|
-
cacheState() {
|
|
14626
|
-
const currentState = history.state ?? null;
|
|
14627
|
-
if (!equals$1(currentState, this.lastCachedState)) {
|
|
14628
|
-
this.cachedState = currentState;
|
|
14629
|
-
this.lastCachedState = currentState;
|
|
14630
|
-
this.lastHistoryState = currentState;
|
|
14631
|
-
}
|
|
14632
|
-
}
|
|
14633
|
-
|
|
14634
|
-
/**
|
|
14635
|
-
* Fires the state or URL change event.
|
|
14636
|
-
*
|
|
14637
|
-
* @private
|
|
14638
|
-
*/
|
|
14639
|
-
fireStateOrUrlChange() {
|
|
14640
|
-
const prevLastHistoryState = this.lastHistoryState;
|
|
14641
|
-
this.cacheState();
|
|
14642
|
-
|
|
14643
|
-
if (
|
|
14644
|
-
this.lastBrowserUrl === this.url() &&
|
|
14645
|
-
prevLastHistoryState === this.cachedState
|
|
14646
|
-
) {
|
|
14647
|
-
return;
|
|
14648
|
-
}
|
|
14649
|
-
|
|
14650
|
-
this.lastBrowserUrl = /** @type {string} */ (this.url());
|
|
14651
|
-
this.lastHistoryState = this.cachedState;
|
|
14652
|
-
this.urlChangeListeners.forEach((listener) => {
|
|
14653
|
-
listener(trimEmptyHash(window.location.href), this.cachedState);
|
|
14654
|
-
});
|
|
14655
|
-
}
|
|
14656
|
-
|
|
14657
|
-
/**
|
|
14658
|
-
* Registers a callback to be called when the URL changes.
|
|
14659
|
-
*
|
|
14660
|
-
* @param {UrlChangeListener} callback - The callback function to register.
|
|
14661
|
-
* @returns {UrlChangeListener} The registered callback function.
|
|
14662
|
-
*/
|
|
14663
|
-
onUrlChange(callback) {
|
|
14664
|
-
if (!this.urlChangeInit) {
|
|
14665
|
-
window.addEventListener(
|
|
14666
|
-
"popstate",
|
|
14667
|
-
this.cacheStateAndFireUrlChange.bind(this),
|
|
14668
|
-
);
|
|
14669
|
-
window.addEventListener(
|
|
14670
|
-
"hashchange",
|
|
14671
|
-
this.cacheStateAndFireUrlChange.bind(this),
|
|
14672
|
-
);
|
|
14673
|
-
|
|
14674
|
-
this.urlChangeInit = true;
|
|
14675
|
-
}
|
|
14676
|
-
|
|
14677
|
-
this.urlChangeListeners.push(callback);
|
|
14678
|
-
return callback;
|
|
14679
|
-
}
|
|
14680
|
-
|
|
14681
|
-
$$applicationDestroyed() {
|
|
14682
|
-
window.removeEventListener(
|
|
14683
|
-
"popstate",
|
|
14684
|
-
this.cacheStateAndFireUrlChange.bind(this),
|
|
14685
|
-
);
|
|
14686
|
-
window.removeEventListener(
|
|
14687
|
-
"hashchange",
|
|
14688
|
-
this.cacheStateAndFireUrlChange.bind(this),
|
|
14689
|
-
);
|
|
14690
|
-
}
|
|
14691
|
-
|
|
14692
|
-
$$checkUrlChange() {
|
|
14693
|
-
this.fireStateOrUrlChange();
|
|
14694
|
-
}
|
|
14695
|
-
|
|
14696
|
-
/// ///////////////////////////////////////////////////////////
|
|
14697
|
-
// Misc API
|
|
14698
|
-
/// ///////////////////////////////////////////////////////////
|
|
14699
|
-
|
|
14700
|
-
/**
|
|
14701
|
-
* Returns the base href of the document.
|
|
14702
|
-
*
|
|
14703
|
-
* @returns {string} The base href.
|
|
14704
|
-
*/
|
|
14705
|
-
baseHref() {
|
|
14706
|
-
const href = this.baseElement?.getAttribute("href");
|
|
14707
|
-
return href ? href.replace(/^(https?:)?\/\/[^/]*/, "") : "";
|
|
14708
|
-
}
|
|
14709
|
-
}
|
|
14710
|
-
|
|
14711
|
-
/**
|
|
14712
|
-
* This object has two goals:
|
|
14713
|
-
*
|
|
14714
|
-
* - hide all the global state in the browser caused by the window object
|
|
14715
|
-
* - abstract away all the browser specific features and inconsistencies
|
|
14716
|
-
*
|
|
14717
|
-
* Remove this in the future
|
|
14718
|
-
*/
|
|
14719
|
-
class BrowserProvider {
|
|
14720
|
-
$get = [
|
|
14721
|
-
"$$taskTrackerFactory",
|
|
14722
|
-
/**
|
|
14723
|
-
* @param {import('../core/task-tracker-factory.js').TaskTracker} $$taskTrackerFactory
|
|
14724
|
-
* @returns {Browser}
|
|
14725
|
-
*/
|
|
14726
|
-
($$taskTrackerFactory) => new Browser($$taskTrackerFactory),
|
|
14727
|
-
];
|
|
14728
|
-
}
|
|
14729
|
-
|
|
14730
14514
|
function AnimateAsyncRunFactoryProvider() {
|
|
14731
14515
|
this.$get = [
|
|
14732
14516
|
function () {
|
|
@@ -14932,7 +14716,9 @@
|
|
|
14932
14716
|
/**
|
|
14933
14717
|
* @returns {import('./interface.ts').TemplateCache}
|
|
14934
14718
|
*/
|
|
14935
|
-
$get
|
|
14719
|
+
$get() {
|
|
14720
|
+
return this.cache;
|
|
14721
|
+
}
|
|
14936
14722
|
}
|
|
14937
14723
|
|
|
14938
14724
|
/**
|
|
@@ -14979,9 +14765,9 @@
|
|
|
14979
14765
|
* @see {@link angular.ErrorHandler AngularTS ErrorHandler}
|
|
14980
14766
|
*/
|
|
14981
14767
|
|
|
14982
|
-
/** @typedef {import('../
|
|
14768
|
+
/** @typedef {import('../log/interface.ts').LogService} LogService */
|
|
14983
14769
|
|
|
14984
|
-
/** @typedef {import("./
|
|
14770
|
+
/** @typedef {import("./interface.ts").Interface} ErrorHandler */
|
|
14985
14771
|
|
|
14986
14772
|
/**
|
|
14987
14773
|
* Provider for `$exceptionHandler` service. Delegates uncaught exceptions to `$log.error()` by default.
|
|
@@ -15465,7 +15251,7 @@
|
|
|
15465
15251
|
const isFilter = function (state, params, options) {
|
|
15466
15252
|
return $state.is(state, params, options);
|
|
15467
15253
|
};
|
|
15468
|
-
|
|
15254
|
+
isFilter.$stateful = true;
|
|
15469
15255
|
return isFilter;
|
|
15470
15256
|
}
|
|
15471
15257
|
/**
|
|
@@ -15486,53 +15272,52 @@
|
|
|
15486
15272
|
const includesFilter = function (state, params, options) {
|
|
15487
15273
|
return $state.includes(state, params, options);
|
|
15488
15274
|
};
|
|
15489
|
-
|
|
15275
|
+
includesFilter.$stateful = true;
|
|
15490
15276
|
return includesFilter;
|
|
15491
15277
|
}
|
|
15492
15278
|
|
|
15493
|
-
|
|
15279
|
+
const SUFFIX = "Filter";
|
|
15494
15280
|
|
|
15495
|
-
|
|
15496
|
-
|
|
15497
|
-
|
|
15498
|
-
|
|
15499
|
-
|
|
15281
|
+
class FilterProvider {
|
|
15282
|
+
static $inject = [$injectTokens.$provide];
|
|
15283
|
+
|
|
15284
|
+
/**
|
|
15285
|
+
* @param {import('../../interface.ts').Provider} $provide
|
|
15286
|
+
*/
|
|
15287
|
+
constructor($provide) {
|
|
15288
|
+
this.$provide = $provide;
|
|
15289
|
+
this.register({
|
|
15290
|
+
filter: filterFilter,
|
|
15291
|
+
json: jsonFilter,
|
|
15292
|
+
limitTo: limitToFilter,
|
|
15293
|
+
orderBy: orderByFilter,
|
|
15294
|
+
isState: $IsStateFilter,
|
|
15295
|
+
includedByState: $IncludedByStateFilter,
|
|
15296
|
+
});
|
|
15297
|
+
}
|
|
15500
15298
|
|
|
15501
15299
|
/**
|
|
15502
15300
|
* @param {string|Record<string, import('../../interface.ts').FilterFactory>} name
|
|
15503
|
-
* @param {import('../../interface.ts').FilterFactory} factory
|
|
15504
|
-
* @return {import('../../interface.ts').
|
|
15301
|
+
* @param {import('../../interface.ts').FilterFactory} [factory]
|
|
15302
|
+
* @return {import('../../interface.ts').Provider}
|
|
15505
15303
|
*/
|
|
15506
|
-
|
|
15304
|
+
register(name, factory) {
|
|
15507
15305
|
if (isObject(name)) {
|
|
15508
15306
|
Object.entries(name).forEach(([key, filter]) => {
|
|
15509
|
-
register(key, filter);
|
|
15307
|
+
this.register(key, filter);
|
|
15510
15308
|
});
|
|
15511
15309
|
}
|
|
15512
|
-
return
|
|
15310
|
+
return this.$provide.factory(name + SUFFIX, factory);
|
|
15513
15311
|
}
|
|
15514
15312
|
|
|
15515
|
-
|
|
15516
|
-
|
|
15517
|
-
this.$get = [
|
|
15518
|
-
"$injector",
|
|
15313
|
+
$get = [
|
|
15314
|
+
$injectTokens.$injector,
|
|
15519
15315
|
/**
|
|
15520
15316
|
* @param {import("../../core/di/internal-injector.js").InjectorService} $injector
|
|
15521
|
-
* @returns
|
|
15317
|
+
* @returns {import('../../interface.ts').FilterFn}
|
|
15522
15318
|
*/
|
|
15523
|
-
|
|
15524
|
-
return function (name) {
|
|
15525
|
-
return $injector.get(name + suffix);
|
|
15526
|
-
};
|
|
15527
|
-
},
|
|
15319
|
+
($injector) => (/** @type {string} */ name) => $injector.get(name + SUFFIX),
|
|
15528
15320
|
];
|
|
15529
|
-
|
|
15530
|
-
register("filter", filterFilter);
|
|
15531
|
-
register("json", jsonFilter);
|
|
15532
|
-
register("limitTo", limitToFilter);
|
|
15533
|
-
register("orderBy", orderByFilter);
|
|
15534
|
-
register("isState", $IsStateFilter);
|
|
15535
|
-
register("includedByState", $IncludedByStateFilter);
|
|
15536
15321
|
}
|
|
15537
15322
|
|
|
15538
15323
|
const PURITY_ABSOLUTE = 1;
|
|
@@ -15671,7 +15456,7 @@
|
|
|
15671
15456
|
if (ast.filter) right = this.$filter(ast.callee.name);
|
|
15672
15457
|
if (!ast.filter) right = this.recurse(ast.callee, true);
|
|
15673
15458
|
return ast.filter
|
|
15674
|
-
?
|
|
15459
|
+
? (scope, locals, assign) => {
|
|
15675
15460
|
const values = [];
|
|
15676
15461
|
for (let i = 0; i < args.length; ++i) {
|
|
15677
15462
|
const res = args[i](scope, locals, assign);
|
|
@@ -15684,7 +15469,7 @@
|
|
|
15684
15469
|
? { context: undefined, name: undefined, value }
|
|
15685
15470
|
: value;
|
|
15686
15471
|
}
|
|
15687
|
-
:
|
|
15472
|
+
: (scope, locals, assign) => {
|
|
15688
15473
|
const rhs = right(scope, locals, assign);
|
|
15689
15474
|
let value;
|
|
15690
15475
|
if (rhs.value != null && isFunction(rhs.value)) {
|
|
@@ -15700,7 +15485,7 @@
|
|
|
15700
15485
|
case ASTType.AssignmentExpression:
|
|
15701
15486
|
left = this.recurse(ast.left, true, 1);
|
|
15702
15487
|
right = this.recurse(ast.right);
|
|
15703
|
-
return
|
|
15488
|
+
return (scope, locals, assign) => {
|
|
15704
15489
|
const lhs = left(scope, locals, assign);
|
|
15705
15490
|
const rhs = right(scope, locals, assign);
|
|
15706
15491
|
lhs.context[lhs.name] = rhs;
|
|
@@ -15711,7 +15496,7 @@
|
|
|
15711
15496
|
ast.elements.forEach((expr) => {
|
|
15712
15497
|
args.push(self.recurse(expr));
|
|
15713
15498
|
});
|
|
15714
|
-
return
|
|
15499
|
+
return (scope, locals, assign) => {
|
|
15715
15500
|
const value = [];
|
|
15716
15501
|
for (let i = 0; i < args.length; ++i) {
|
|
15717
15502
|
value.push(args[i](scope, locals, assign));
|
|
@@ -15738,7 +15523,7 @@
|
|
|
15738
15523
|
});
|
|
15739
15524
|
}
|
|
15740
15525
|
});
|
|
15741
|
-
return
|
|
15526
|
+
return (scope, locals, assign) => {
|
|
15742
15527
|
const value = {};
|
|
15743
15528
|
for (let i = 0; i < args.length; ++i) {
|
|
15744
15529
|
if (args[i].computed) {
|
|
@@ -15754,17 +15539,12 @@
|
|
|
15754
15539
|
return context ? { value } : value;
|
|
15755
15540
|
};
|
|
15756
15541
|
case ASTType.ThisExpression:
|
|
15757
|
-
return
|
|
15758
|
-
return context ? { value: scope } : scope;
|
|
15759
|
-
};
|
|
15542
|
+
return (scope) => (context ? { value: scope } : scope);
|
|
15760
15543
|
case ASTType.LocalsExpression:
|
|
15761
|
-
return
|
|
15762
|
-
return context ? { value: locals } : locals;
|
|
15763
|
-
};
|
|
15544
|
+
return (scope, locals) => (context ? { value: locals } : locals);
|
|
15764
15545
|
case ASTType.NGValueParameter:
|
|
15765
|
-
return
|
|
15766
|
-
|
|
15767
|
-
};
|
|
15546
|
+
return (scope, locals, assign) =>
|
|
15547
|
+
context ? { value: assign } : assign;
|
|
15768
15548
|
}
|
|
15769
15549
|
}
|
|
15770
15550
|
|
|
@@ -15775,7 +15555,7 @@
|
|
|
15775
15555
|
* @returns {function} The unary plus function.
|
|
15776
15556
|
*/
|
|
15777
15557
|
"unary+"(argument, context) {
|
|
15778
|
-
return
|
|
15558
|
+
return (scope, locals, assign) => {
|
|
15779
15559
|
let arg = argument(scope, locals, assign);
|
|
15780
15560
|
if (isDefined(arg)) {
|
|
15781
15561
|
arg = +arg;
|
|
@@ -15793,7 +15573,7 @@
|
|
|
15793
15573
|
* @returns {function} The unary minus function.
|
|
15794
15574
|
*/
|
|
15795
15575
|
"unary-"(argument, context) {
|
|
15796
|
-
return
|
|
15576
|
+
return (scope, locals, assign) => {
|
|
15797
15577
|
let arg = argument(scope, locals, assign);
|
|
15798
15578
|
if (isDefined(arg)) {
|
|
15799
15579
|
arg = -arg;
|
|
@@ -15811,7 +15591,7 @@
|
|
|
15811
15591
|
* @returns {function} The unary negation function.
|
|
15812
15592
|
*/
|
|
15813
15593
|
"unary!"(argument, context) {
|
|
15814
|
-
return
|
|
15594
|
+
return (scope, locals, assign) => {
|
|
15815
15595
|
const arg = !argument(scope, locals, assign);
|
|
15816
15596
|
return context ? { value: arg } : arg;
|
|
15817
15597
|
};
|
|
@@ -15825,7 +15605,7 @@
|
|
|
15825
15605
|
* @returns {function} The binary plus function.
|
|
15826
15606
|
*/
|
|
15827
15607
|
"binary+"(left, right, context) {
|
|
15828
|
-
return
|
|
15608
|
+
return (scope, locals, assign) => {
|
|
15829
15609
|
const lhs = left(scope, locals, assign);
|
|
15830
15610
|
const rhs = right(scope, locals, assign);
|
|
15831
15611
|
const arg = plusFn(lhs, rhs);
|
|
@@ -15841,7 +15621,7 @@
|
|
|
15841
15621
|
* @returns {function} The binary minus function.
|
|
15842
15622
|
*/
|
|
15843
15623
|
"binary-"(left, right, context) {
|
|
15844
|
-
return
|
|
15624
|
+
return (scope, locals, assign) => {
|
|
15845
15625
|
const lhs = left(scope, locals, assign);
|
|
15846
15626
|
const rhs = right(scope, locals, assign);
|
|
15847
15627
|
const arg = (isDefined(lhs) ? lhs : 0) - (isDefined(rhs) ? rhs : 0);
|
|
@@ -15857,14 +15637,14 @@
|
|
|
15857
15637
|
* @returns {function} The binary multiplication function.
|
|
15858
15638
|
*/
|
|
15859
15639
|
"binary*"(left, right, context) {
|
|
15860
|
-
return
|
|
15640
|
+
return (scope, locals, assign) => {
|
|
15861
15641
|
const arg = left(scope, locals, assign) * right(scope, locals, assign);
|
|
15862
15642
|
return context ? { value: arg } : arg;
|
|
15863
15643
|
};
|
|
15864
15644
|
}
|
|
15865
15645
|
|
|
15866
15646
|
"binary/"(left, right, context) {
|
|
15867
|
-
return
|
|
15647
|
+
return (scope, locals, assign) => {
|
|
15868
15648
|
const arg = left(scope, locals, assign) / right(scope, locals, assign);
|
|
15869
15649
|
return context ? { value: arg } : arg;
|
|
15870
15650
|
};
|
|
@@ -15878,7 +15658,7 @@
|
|
|
15878
15658
|
* @returns {function} The binary division function.
|
|
15879
15659
|
*/
|
|
15880
15660
|
"binary%"(left, right, context) {
|
|
15881
|
-
return
|
|
15661
|
+
return (scope, locals, assign) => {
|
|
15882
15662
|
const arg = left(scope, locals, assign) % right(scope, locals, assign);
|
|
15883
15663
|
return context ? { value: arg } : arg;
|
|
15884
15664
|
};
|
|
@@ -15892,7 +15672,7 @@
|
|
|
15892
15672
|
* @returns {function} The binary strict equality function.
|
|
15893
15673
|
*/
|
|
15894
15674
|
"binary==="(left, right, context) {
|
|
15895
|
-
return
|
|
15675
|
+
return (scope, locals, assign) => {
|
|
15896
15676
|
const arg = left(scope, locals, assign) === right(scope, locals, assign);
|
|
15897
15677
|
return context ? { value: arg } : arg;
|
|
15898
15678
|
};
|
|
@@ -15906,7 +15686,7 @@
|
|
|
15906
15686
|
* @returns {function} The binary strict inequality function.
|
|
15907
15687
|
*/
|
|
15908
15688
|
"binary!=="(left, right, context) {
|
|
15909
|
-
return
|
|
15689
|
+
return (scope, locals, assign) => {
|
|
15910
15690
|
const arg = left(scope, locals, assign) !== right(scope, locals, assign);
|
|
15911
15691
|
return context ? { value: arg } : arg;
|
|
15912
15692
|
};
|
|
@@ -15920,7 +15700,7 @@
|
|
|
15920
15700
|
* @returns {function} The binary equality function.
|
|
15921
15701
|
*/
|
|
15922
15702
|
"binary=="(left, right, context) {
|
|
15923
|
-
return
|
|
15703
|
+
return (scope, locals, assign) => {
|
|
15924
15704
|
const arg = left(scope, locals, assign) == right(scope, locals, assign);
|
|
15925
15705
|
return context ? { value: arg } : arg;
|
|
15926
15706
|
};
|
|
@@ -15934,7 +15714,7 @@
|
|
|
15934
15714
|
* @returns {function} The binary inequality function.
|
|
15935
15715
|
*/
|
|
15936
15716
|
"binary!="(left, right, context) {
|
|
15937
|
-
return
|
|
15717
|
+
return (scope, locals, assign) => {
|
|
15938
15718
|
const arg = left(scope, locals, assign) != right(scope, locals, assign);
|
|
15939
15719
|
return context ? { value: arg } : arg;
|
|
15940
15720
|
};
|
|
@@ -15948,7 +15728,7 @@
|
|
|
15948
15728
|
* @returns {function} The binary less-than function.
|
|
15949
15729
|
*/
|
|
15950
15730
|
"binary<"(left, right, context) {
|
|
15951
|
-
return
|
|
15731
|
+
return (scope, locals, assign) => {
|
|
15952
15732
|
const arg = left(scope, locals, assign) < right(scope, locals, assign);
|
|
15953
15733
|
return context ? { value: arg } : arg;
|
|
15954
15734
|
};
|
|
@@ -15962,7 +15742,7 @@
|
|
|
15962
15742
|
* @returns {function} The binary greater-than function.
|
|
15963
15743
|
*/
|
|
15964
15744
|
"binary>"(left, right, context) {
|
|
15965
|
-
return
|
|
15745
|
+
return (scope, locals, assign) => {
|
|
15966
15746
|
const arg = left(scope, locals, assign) > right(scope, locals, assign);
|
|
15967
15747
|
return context ? { value: arg } : arg;
|
|
15968
15748
|
};
|
|
@@ -15976,7 +15756,7 @@
|
|
|
15976
15756
|
* @returns {function} The binary less-than-or-equal-to function.
|
|
15977
15757
|
*/
|
|
15978
15758
|
"binary<="(left, right, context) {
|
|
15979
|
-
return
|
|
15759
|
+
return (scope, locals, assign) => {
|
|
15980
15760
|
const arg = left(scope, locals, assign) <= right(scope, locals, assign);
|
|
15981
15761
|
return context ? { value: arg } : arg;
|
|
15982
15762
|
};
|
|
@@ -15990,7 +15770,7 @@
|
|
|
15990
15770
|
* @returns {function} The binary greater-than-or-equal-to function.
|
|
15991
15771
|
*/
|
|
15992
15772
|
"binary>="(left, right, context) {
|
|
15993
|
-
return
|
|
15773
|
+
return (scope, locals, assign) => {
|
|
15994
15774
|
const arg = left(scope, locals, assign) >= right(scope, locals, assign);
|
|
15995
15775
|
return context ? { value: arg } : arg;
|
|
15996
15776
|
};
|
|
@@ -16017,7 +15797,7 @@
|
|
|
16017
15797
|
* @returns {function} The binary logical OR function.
|
|
16018
15798
|
*/
|
|
16019
15799
|
"binary||"(left, right, context) {
|
|
16020
|
-
return
|
|
15800
|
+
return (scope, locals, assign) => {
|
|
16021
15801
|
const arg = left(scope, locals, assign) || right(scope, locals, assign);
|
|
16022
15802
|
return context ? { value: arg } : arg;
|
|
16023
15803
|
};
|
|
@@ -16032,7 +15812,7 @@
|
|
|
16032
15812
|
* @returns {function} The ternary conditional function.
|
|
16033
15813
|
*/
|
|
16034
15814
|
"ternary?:"(test, alternate, consequent, context) {
|
|
16035
|
-
return
|
|
15815
|
+
return (scope, locals, assign) => {
|
|
16036
15816
|
const arg = test(scope, locals, assign)
|
|
16037
15817
|
? alternate(scope, locals, assign)
|
|
16038
15818
|
: consequent(scope, locals, assign);
|
|
@@ -16047,9 +15827,8 @@
|
|
|
16047
15827
|
* @returns {import("./interface.ts").CompiledExpressionFunction} The function returning the literal value.
|
|
16048
15828
|
*/
|
|
16049
15829
|
value(value, context) {
|
|
16050
|
-
return
|
|
16051
|
-
|
|
16052
|
-
};
|
|
15830
|
+
return () =>
|
|
15831
|
+
context ? { context: undefined, name: undefined, value } : value;
|
|
16053
15832
|
}
|
|
16054
15833
|
|
|
16055
15834
|
/**
|
|
@@ -16060,7 +15839,7 @@
|
|
|
16060
15839
|
* @returns {import("./interface.ts").CompiledExpressionFunction} The function returning the identifier value.
|
|
16061
15840
|
*/
|
|
16062
15841
|
identifier(name, context, create) {
|
|
16063
|
-
return
|
|
15842
|
+
return (scope, locals) => {
|
|
16064
15843
|
const base = locals && name in locals ? locals : scope;
|
|
16065
15844
|
if (create && create !== 1 && base && base[name] == null) {
|
|
16066
15845
|
base[name] = {};
|
|
@@ -16085,7 +15864,7 @@
|
|
|
16085
15864
|
* @returns {function} The function returning the computed member value.
|
|
16086
15865
|
*/
|
|
16087
15866
|
computedMember(left, right, context, create) {
|
|
16088
|
-
return
|
|
15867
|
+
return (scope, locals, assign) => {
|
|
16089
15868
|
const lhs = left(scope, locals, assign);
|
|
16090
15869
|
let rhs;
|
|
16091
15870
|
let value;
|
|
@@ -16115,7 +15894,7 @@
|
|
|
16115
15894
|
* @returns {function} The function returning the non-computed member value.
|
|
16116
15895
|
*/
|
|
16117
15896
|
nonComputedMember(left, right, context, create) {
|
|
16118
|
-
return
|
|
15897
|
+
return (scope, locals, assign) => {
|
|
16119
15898
|
const lhs = left(scope, locals, assign);
|
|
16120
15899
|
if (create && create !== 1) {
|
|
16121
15900
|
if (lhs && lhs[right] == null) {
|
|
@@ -18536,21 +18315,17 @@
|
|
|
18536
18315
|
});
|
|
18537
18316
|
|
|
18538
18317
|
this.$get = [
|
|
18539
|
-
"$browser",
|
|
18540
18318
|
"$httpBackend",
|
|
18541
|
-
"$rootScope",
|
|
18542
18319
|
"$injector",
|
|
18543
18320
|
"$sce",
|
|
18544
18321
|
/**
|
|
18545
18322
|
*
|
|
18546
|
-
* @param {*} $browser
|
|
18547
18323
|
* @param {*} $httpBackend
|
|
18548
|
-
* @param {import("../../core/scope/scope.js").Scope} $rootScope
|
|
18549
18324
|
* @param {import("../../core/di/internal-injector.js").InjectorService} $injector
|
|
18550
18325
|
* @param {*} $sce
|
|
18551
18326
|
* @returns
|
|
18552
18327
|
*/
|
|
18553
|
-
function ($
|
|
18328
|
+
function ($httpBackend, $injector, $sce) {
|
|
18554
18329
|
/**
|
|
18555
18330
|
* @type {Map<string, string>}
|
|
18556
18331
|
*/
|
|
@@ -18620,8 +18395,6 @@
|
|
|
18620
18395
|
? $injector.get(config.paramSerializer)
|
|
18621
18396
|
: config.paramSerializer;
|
|
18622
18397
|
|
|
18623
|
-
$browser.$$incOutstandingRequestCount("$http");
|
|
18624
|
-
|
|
18625
18398
|
const requestInterceptors = [];
|
|
18626
18399
|
const responseInterceptors = [];
|
|
18627
18400
|
let promise = Promise.resolve(config);
|
|
@@ -18645,7 +18418,6 @@
|
|
|
18645
18418
|
promise = chainInterceptors(promise, requestInterceptors);
|
|
18646
18419
|
promise = promise.then(serverRequest);
|
|
18647
18420
|
promise = chainInterceptors(promise, responseInterceptors);
|
|
18648
|
-
promise = promise.finally(completeOutstandingRequest);
|
|
18649
18421
|
|
|
18650
18422
|
return promise;
|
|
18651
18423
|
|
|
@@ -18662,10 +18434,6 @@
|
|
|
18662
18434
|
return promise;
|
|
18663
18435
|
}
|
|
18664
18436
|
|
|
18665
|
-
function completeOutstandingRequest() {
|
|
18666
|
-
$browser.$$completeOutstandingRequest(() => {}, "$http");
|
|
18667
|
-
}
|
|
18668
|
-
|
|
18669
18437
|
function executeHeaderFns(headers, config) {
|
|
18670
18438
|
let headerContent;
|
|
18671
18439
|
const processedHeaders = {};
|
|
@@ -19104,24 +18872,14 @@
|
|
|
19104
18872
|
*/
|
|
19105
18873
|
class HttpBackendProvider {
|
|
19106
18874
|
constructor() {
|
|
19107
|
-
this.$get = [
|
|
19108
|
-
"$browser",
|
|
19109
|
-
/**
|
|
19110
|
-
* @param {import('../browser.js').Browser} $browser
|
|
19111
|
-
* @returns
|
|
19112
|
-
*/
|
|
19113
|
-
function ($browser) {
|
|
19114
|
-
return createHttpBackend($browser);
|
|
19115
|
-
},
|
|
19116
|
-
];
|
|
18875
|
+
this.$get = [() => createHttpBackend()];
|
|
19117
18876
|
}
|
|
19118
18877
|
}
|
|
19119
18878
|
|
|
19120
18879
|
/**
|
|
19121
|
-
* @param {import('../browser.js').Browser} $browser
|
|
19122
18880
|
* @returns
|
|
19123
18881
|
*/
|
|
19124
|
-
function createHttpBackend(
|
|
18882
|
+
function createHttpBackend() {
|
|
19125
18883
|
// TODO(vojta): fix the signature
|
|
19126
18884
|
return function (
|
|
19127
18885
|
method,
|
|
@@ -19135,7 +18893,7 @@
|
|
|
19135
18893
|
eventHandlers,
|
|
19136
18894
|
uploadEventHandlers,
|
|
19137
18895
|
) {
|
|
19138
|
-
url = url ||
|
|
18896
|
+
url = url || trimEmptyHash(window.location.href);
|
|
19139
18897
|
|
|
19140
18898
|
const xhr = new XMLHttpRequest();
|
|
19141
18899
|
let abortedByTimeout = false;
|
|
@@ -19343,7 +19101,7 @@
|
|
|
19343
19101
|
*/
|
|
19344
19102
|
this.$$replace = false;
|
|
19345
19103
|
|
|
19346
|
-
/** @type {
|
|
19104
|
+
/** @type {string} */
|
|
19347
19105
|
this.$$protocol = parsedUrl.protocol;
|
|
19348
19106
|
|
|
19349
19107
|
/** @type {string} */
|
|
@@ -19410,7 +19168,7 @@
|
|
|
19410
19168
|
/**
|
|
19411
19169
|
*
|
|
19412
19170
|
* Return protocol of current URL.
|
|
19413
|
-
* @return {
|
|
19171
|
+
* @return {string} protocol of current URL
|
|
19414
19172
|
*/
|
|
19415
19173
|
protocol() {
|
|
19416
19174
|
return this.$$protocol;
|
|
@@ -19711,12 +19469,13 @@
|
|
|
19711
19469
|
* This object is exposed as $location service when developer doesn't opt into html5 mode.
|
|
19712
19470
|
* It also serves as the base class for html5 mode fallback on legacy browsers.
|
|
19713
19471
|
*
|
|
19714
|
-
* @constructor
|
|
19715
|
-
* @param {string} appBase application base URL
|
|
19716
|
-
* @param {string} appBaseNoFile application base URL stripped of any filename
|
|
19717
|
-
* @param {string} hashPrefix hashbang prefix
|
|
19718
19472
|
*/
|
|
19719
19473
|
class LocationHashbangUrl extends Location {
|
|
19474
|
+
/**
|
|
19475
|
+
* @param {string} appBase application base URL
|
|
19476
|
+
* @param {string} appBaseNoFile application base URL stripped of any filename
|
|
19477
|
+
* @param {string} hashPrefix hashbang prefix
|
|
19478
|
+
*/
|
|
19720
19479
|
constructor(appBase, appBaseNoFile, hashPrefix) {
|
|
19721
19480
|
super(appBase, appBaseNoFile);
|
|
19722
19481
|
this.hashPrefix = hashPrefix;
|
|
@@ -19827,6 +19586,111 @@
|
|
|
19827
19586
|
requireBase: true,
|
|
19828
19587
|
rewriteLinks: true,
|
|
19829
19588
|
};
|
|
19589
|
+
|
|
19590
|
+
/** @type {Array<import("./interface.js").UrlChangeListener>} */
|
|
19591
|
+
this.urlChangeListeners = [];
|
|
19592
|
+
this.urlChangeInit = false;
|
|
19593
|
+
|
|
19594
|
+
/** @type {History['state']} */
|
|
19595
|
+
this.cachedState = null;
|
|
19596
|
+
/** @typeof {History.state} */
|
|
19597
|
+
this.lastHistoryState = null;
|
|
19598
|
+
/** @type {string} */
|
|
19599
|
+
this.lastBrowserUrl = window.location.href;
|
|
19600
|
+
this.cacheState();
|
|
19601
|
+
}
|
|
19602
|
+
|
|
19603
|
+
/// ///////////////////////////////////////////////////////////
|
|
19604
|
+
// URL API
|
|
19605
|
+
/// ///////////////////////////////////////////////////////////
|
|
19606
|
+
|
|
19607
|
+
setUrl(url, state) {
|
|
19608
|
+
if (state === undefined) {
|
|
19609
|
+
state = null;
|
|
19610
|
+
}
|
|
19611
|
+
|
|
19612
|
+
// setter
|
|
19613
|
+
if (url) {
|
|
19614
|
+
url = urlResolve(url).href;
|
|
19615
|
+
|
|
19616
|
+
if (this.lastBrowserUrl === url && this.lastHistoryState === state) {
|
|
19617
|
+
return this;
|
|
19618
|
+
}
|
|
19619
|
+
|
|
19620
|
+
this.lastBrowserUrl = url;
|
|
19621
|
+
this.lastHistoryState = state;
|
|
19622
|
+
history.pushState(state, "", url);
|
|
19623
|
+
this.cacheState();
|
|
19624
|
+
}
|
|
19625
|
+
}
|
|
19626
|
+
|
|
19627
|
+
/**
|
|
19628
|
+
* Returns the current URL with any empty hash (`#`) removed.
|
|
19629
|
+
* @return {string}
|
|
19630
|
+
*/
|
|
19631
|
+
getUrl() {
|
|
19632
|
+
return trimEmptyHash(window.location.href);
|
|
19633
|
+
}
|
|
19634
|
+
|
|
19635
|
+
/**
|
|
19636
|
+
* Returns the cached state.
|
|
19637
|
+
* @returns {History['state']} The cached state.
|
|
19638
|
+
*/
|
|
19639
|
+
state() {
|
|
19640
|
+
return this.cachedState;
|
|
19641
|
+
}
|
|
19642
|
+
|
|
19643
|
+
/**
|
|
19644
|
+
* Caches the current state.
|
|
19645
|
+
*
|
|
19646
|
+
* @private
|
|
19647
|
+
*/
|
|
19648
|
+
cacheState() {
|
|
19649
|
+
const currentState = history.state ?? null;
|
|
19650
|
+
if (!equals$1(currentState, this.lastCachedState)) {
|
|
19651
|
+
this.cachedState = currentState;
|
|
19652
|
+
this.lastCachedState = currentState;
|
|
19653
|
+
this.lastHistoryState = currentState;
|
|
19654
|
+
}
|
|
19655
|
+
}
|
|
19656
|
+
|
|
19657
|
+
/**
|
|
19658
|
+
* Fires the state or URL change event.
|
|
19659
|
+
*
|
|
19660
|
+
* @private
|
|
19661
|
+
*/
|
|
19662
|
+
fireStateOrUrlChange() {
|
|
19663
|
+
const prevLastHistoryState = this.lastHistoryState;
|
|
19664
|
+
this.cacheState();
|
|
19665
|
+
if (
|
|
19666
|
+
this.lastBrowserUrl === this.getUrl() &&
|
|
19667
|
+
prevLastHistoryState === this.cachedState
|
|
19668
|
+
) {
|
|
19669
|
+
return;
|
|
19670
|
+
}
|
|
19671
|
+
this.lastBrowserUrl = this.getUrl();
|
|
19672
|
+
this.lastHistoryState = this.cachedState;
|
|
19673
|
+
this.urlChangeListeners.forEach((listener) => {
|
|
19674
|
+
listener(trimEmptyHash(window.location.href), this.cachedState);
|
|
19675
|
+
});
|
|
19676
|
+
}
|
|
19677
|
+
|
|
19678
|
+
/**
|
|
19679
|
+
* Registers a callback to be called when the URL changes.
|
|
19680
|
+
*
|
|
19681
|
+
* @param {import("./interface.js").UrlChangeListener} callback - The callback function to register.
|
|
19682
|
+
* @returns void
|
|
19683
|
+
*/
|
|
19684
|
+
onUrlChange(callback) {
|
|
19685
|
+
if (!this.urlChangeInit) {
|
|
19686
|
+
window.addEventListener("popstate", this.fireStateOrUrlChange.bind(this));
|
|
19687
|
+
window.addEventListener(
|
|
19688
|
+
"hashchange",
|
|
19689
|
+
this.fireStateOrUrlChange.bind(this),
|
|
19690
|
+
);
|
|
19691
|
+
this.urlChangeInit = true;
|
|
19692
|
+
}
|
|
19693
|
+
this.urlChangeListeners.push(callback);
|
|
19830
19694
|
}
|
|
19831
19695
|
|
|
19832
19696
|
/**
|
|
@@ -19888,21 +19752,19 @@
|
|
|
19888
19752
|
|
|
19889
19753
|
$get = [
|
|
19890
19754
|
"$rootScope",
|
|
19891
|
-
"$browser",
|
|
19892
19755
|
"$rootElement",
|
|
19893
19756
|
/**
|
|
19894
19757
|
*
|
|
19895
|
-
* @param {import('
|
|
19896
|
-
* @param {import('../../services/browser').Browser} $browser
|
|
19758
|
+
* @param {import('../../core/scope/scope.js').Scope} $rootScope
|
|
19897
19759
|
* @param {Element} $rootElement
|
|
19898
19760
|
* @returns
|
|
19899
19761
|
*/
|
|
19900
|
-
($rootScope, $
|
|
19762
|
+
($rootScope, $rootElement) => {
|
|
19901
19763
|
/** @type {Location} */
|
|
19902
19764
|
let $location;
|
|
19903
19765
|
let LocationMode;
|
|
19904
|
-
const baseHref =
|
|
19905
|
-
const initialUrl =
|
|
19766
|
+
const baseHref = getBaseHref(); // if base[href] is undefined, it defaults to ''
|
|
19767
|
+
const initialUrl = trimEmptyHash(window.location.href);
|
|
19906
19768
|
let appBase;
|
|
19907
19769
|
|
|
19908
19770
|
if (this.getHtml5Mode().enabled) {
|
|
@@ -19927,20 +19789,20 @@
|
|
|
19927
19789
|
);
|
|
19928
19790
|
$location.$$parseLinkUrl(initialUrl, initialUrl);
|
|
19929
19791
|
|
|
19930
|
-
$location.$$state =
|
|
19792
|
+
$location.$$state = this.state();
|
|
19931
19793
|
|
|
19932
19794
|
const IGNORE_URI_REGEXP = /^\s*(javascript|mailto):/i;
|
|
19933
19795
|
|
|
19934
|
-
|
|
19796
|
+
const setBrowserUrlWithFallback = (url, state) => {
|
|
19935
19797
|
const oldUrl = $location.url();
|
|
19936
19798
|
const oldState = $location.$$state;
|
|
19937
19799
|
try {
|
|
19938
|
-
|
|
19800
|
+
this.setUrl(url, state);
|
|
19939
19801
|
|
|
19940
19802
|
// Make sure $location.state() returns referentially identical (not just deeply equal)
|
|
19941
19803
|
// state object; this makes possible quick checking if the state changed in the digest
|
|
19942
19804
|
// loop. Checking deep equality would be too expensive.
|
|
19943
|
-
$location.$$state =
|
|
19805
|
+
$location.$$state = this.state();
|
|
19944
19806
|
} catch (e) {
|
|
19945
19807
|
// Restore old values if pushState fails
|
|
19946
19808
|
$location.url(/** @type {string} */ (oldUrl));
|
|
@@ -19948,7 +19810,7 @@
|
|
|
19948
19810
|
|
|
19949
19811
|
throw e;
|
|
19950
19812
|
}
|
|
19951
|
-
}
|
|
19813
|
+
};
|
|
19952
19814
|
|
|
19953
19815
|
$rootElement.addEventListener(
|
|
19954
19816
|
"click",
|
|
@@ -20016,10 +19878,6 @@
|
|
|
20016
19878
|
// in html5mode and also without, so that we are able to abort navigation without
|
|
20017
19879
|
// getting double entries in the location history.
|
|
20018
19880
|
event.preventDefault();
|
|
20019
|
-
// update location manually
|
|
20020
|
-
// if ($location.absUrl() !== $browser.url()) {
|
|
20021
|
-
// $rootScope.$apply();
|
|
20022
|
-
// }
|
|
20023
19881
|
}
|
|
20024
19882
|
}
|
|
20025
19883
|
},
|
|
@@ -20027,13 +19885,13 @@
|
|
|
20027
19885
|
|
|
20028
19886
|
// rewrite hashbang url <> html5 url
|
|
20029
19887
|
if ($location.absUrl() !== initialUrl) {
|
|
20030
|
-
|
|
19888
|
+
this.setUrl($location.absUrl(), true);
|
|
20031
19889
|
}
|
|
20032
19890
|
|
|
20033
19891
|
let initializing = true;
|
|
20034
19892
|
|
|
20035
19893
|
// update $location when $browser url changes
|
|
20036
|
-
|
|
19894
|
+
this.onUrlChange((newUrl, newState) => {
|
|
20037
19895
|
if (!startsWith(newUrl, appBaseNoFile)) {
|
|
20038
19896
|
// If we are navigating outside of the app then force a reload
|
|
20039
19897
|
window.location.href = newUrl;
|
|
@@ -20075,9 +19933,9 @@
|
|
|
20075
19933
|
if (initializing || $location.$$urlUpdatedByLocation) {
|
|
20076
19934
|
$location.$$urlUpdatedByLocation = false;
|
|
20077
19935
|
|
|
20078
|
-
const oldUrl = /** @type {string} */ (
|
|
19936
|
+
const oldUrl = /** @type {string} */ (this.getUrl());
|
|
20079
19937
|
const newUrl = $location.absUrl();
|
|
20080
|
-
const oldState =
|
|
19938
|
+
const oldState = this.state();
|
|
20081
19939
|
const urlOrStateChanged =
|
|
20082
19940
|
!urlsEqual(oldUrl, newUrl) ||
|
|
20083
19941
|
($location.$$html5 && oldState !== $location.$$state);
|
|
@@ -20336,7 +20194,7 @@
|
|
|
20336
20194
|
*/
|
|
20337
20195
|
let $parse;
|
|
20338
20196
|
|
|
20339
|
-
/**@type {import('
|
|
20197
|
+
/**@type {import('../../services/exception/exception-handler.js').ErrorHandler} */
|
|
20340
20198
|
let $exceptionHandler;
|
|
20341
20199
|
|
|
20342
20200
|
/**
|
|
@@ -20357,7 +20215,7 @@
|
|
|
20357
20215
|
"$exceptionHandler",
|
|
20358
20216
|
"$parse",
|
|
20359
20217
|
/**
|
|
20360
|
-
* @param {import('
|
|
20218
|
+
* @param {import('../../services/exception/exception-handler.js').ErrorHandler} exceptionHandler
|
|
20361
20219
|
* @param {import('../parse/interface.ts').ParseService} parse
|
|
20362
20220
|
*/
|
|
20363
20221
|
(exceptionHandler, parse) => {
|
|
@@ -21554,152 +21412,6 @@
|
|
|
21554
21412
|
return ids;
|
|
21555
21413
|
}
|
|
21556
21414
|
|
|
21557
|
-
/** @typedef {import('../interface.ts').ServiceProvider} ServiceProvider */
|
|
21558
|
-
/** @typedef {import('../interface.ts').AnnotatedFactory} AnnotatedFactory */
|
|
21559
|
-
|
|
21560
|
-
/**
|
|
21561
|
-
* @implements {ServiceProvider}
|
|
21562
|
-
*/
|
|
21563
|
-
class TaskTrackerFactoryProvider {
|
|
21564
|
-
/** @type {AnnotatedFactory} */
|
|
21565
|
-
$get = [
|
|
21566
|
-
"$log",
|
|
21567
|
-
/**
|
|
21568
|
-
* Creates a new `TaskTracker` instance.
|
|
21569
|
-
*
|
|
21570
|
-
* @param {import('../services/log/interface.ts').LogService} log - The logging service.
|
|
21571
|
-
* @returns {TaskTracker} A new `TaskTracker` instance.
|
|
21572
|
-
*/
|
|
21573
|
-
(log) => new TaskTracker(log),
|
|
21574
|
-
];
|
|
21575
|
-
}
|
|
21576
|
-
|
|
21577
|
-
/**
|
|
21578
|
-
* A factory function to create `TaskTracker` instances.
|
|
21579
|
-
*
|
|
21580
|
-
* A `TaskTracker` tracks pending tasks (grouped by type) and notifies interested
|
|
21581
|
-
* parties when all pending tasks (or tasks of a specific type) have been completed.
|
|
21582
|
-
*/
|
|
21583
|
-
class TaskTracker {
|
|
21584
|
-
/**
|
|
21585
|
-
* @param {import('../services/log/interface.ts').LogService} log - The logging service.
|
|
21586
|
-
*/
|
|
21587
|
-
constructor(log) {
|
|
21588
|
-
/** @private */
|
|
21589
|
-
this.log = log;
|
|
21590
|
-
|
|
21591
|
-
/** @private */
|
|
21592
|
-
this.taskCounts = {};
|
|
21593
|
-
|
|
21594
|
-
/** @private */
|
|
21595
|
-
this.taskCallbacks = [];
|
|
21596
|
-
|
|
21597
|
-
/**
|
|
21598
|
-
* Special task types used for tracking all tasks and default tasks.
|
|
21599
|
-
* @type {string}
|
|
21600
|
-
*/
|
|
21601
|
-
this.ALL_TASKS_TYPE = "$$all$$";
|
|
21602
|
-
|
|
21603
|
-
/**
|
|
21604
|
-
* Default task type.
|
|
21605
|
-
* @type {string}
|
|
21606
|
-
*/
|
|
21607
|
-
this.DEFAULT_TASK_TYPE = "$$default$$";
|
|
21608
|
-
}
|
|
21609
|
-
|
|
21610
|
-
/**
|
|
21611
|
-
* Completes a task and decrements the associated task counter.
|
|
21612
|
-
* If the counter reaches 0, all corresponding callbacks are executed.
|
|
21613
|
-
*
|
|
21614
|
-
* @param {Function} fn - The function to execute when completing the task.
|
|
21615
|
-
* @param {string} [taskType=this.DEFAULT_TASK_TYPE] - The type of task being completed.
|
|
21616
|
-
*/
|
|
21617
|
-
completeTask(fn, taskType = this.DEFAULT_TASK_TYPE) {
|
|
21618
|
-
try {
|
|
21619
|
-
fn();
|
|
21620
|
-
} finally {
|
|
21621
|
-
if (this.taskCounts[taskType]) {
|
|
21622
|
-
this.taskCounts[taskType]--;
|
|
21623
|
-
this.taskCounts[this.ALL_TASKS_TYPE]--;
|
|
21624
|
-
}
|
|
21625
|
-
|
|
21626
|
-
const countForType = this.taskCounts[taskType];
|
|
21627
|
-
const countForAll = this.taskCounts[this.ALL_TASKS_TYPE];
|
|
21628
|
-
|
|
21629
|
-
// If either the overall task queue or the specific task type queue is empty, run callbacks.
|
|
21630
|
-
if (!countForAll || !countForType) {
|
|
21631
|
-
const getNextCallback = !countForAll
|
|
21632
|
-
? this.getLastCallback.bind(this)
|
|
21633
|
-
: () => this.getLastCallbackForType(taskType);
|
|
21634
|
-
|
|
21635
|
-
let nextCb;
|
|
21636
|
-
while ((nextCb = getNextCallback())) {
|
|
21637
|
-
try {
|
|
21638
|
-
nextCb();
|
|
21639
|
-
} catch (e) {
|
|
21640
|
-
this.log.error(e);
|
|
21641
|
-
}
|
|
21642
|
-
}
|
|
21643
|
-
}
|
|
21644
|
-
}
|
|
21645
|
-
}
|
|
21646
|
-
|
|
21647
|
-
/**
|
|
21648
|
-
* Increments the task count for the specified task type.
|
|
21649
|
-
*
|
|
21650
|
-
* @param {string} [taskType=this.DEFAULT_TASK_TYPE] - The type of task whose count will be increased.
|
|
21651
|
-
*/
|
|
21652
|
-
incTaskCount(taskType = this.DEFAULT_TASK_TYPE) {
|
|
21653
|
-
this.taskCounts[taskType] = (this.taskCounts[taskType] || 0) + 1;
|
|
21654
|
-
this.taskCounts[this.ALL_TASKS_TYPE] =
|
|
21655
|
-
(this.taskCounts[this.ALL_TASKS_TYPE] || 0) + 1;
|
|
21656
|
-
}
|
|
21657
|
-
|
|
21658
|
-
/**
|
|
21659
|
-
* Registers a callback to be executed when all pending tasks of the specified type are completed.
|
|
21660
|
-
* If there are no pending tasks of the specified type, the callback is executed immediately.
|
|
21661
|
-
*
|
|
21662
|
-
* @param {Function} callback - The function to execute when no pending tasks remain.
|
|
21663
|
-
* @param {string} [taskType=this.ALL_TASKS_TYPE] - The type of tasks to wait for completion.
|
|
21664
|
-
*/
|
|
21665
|
-
notifyWhenNoPendingTasks(callback, taskType = this.ALL_TASKS_TYPE) {
|
|
21666
|
-
if (!this.taskCounts[taskType]) {
|
|
21667
|
-
callback();
|
|
21668
|
-
} else {
|
|
21669
|
-
this.taskCallbacks.push({ type: taskType, cb: callback });
|
|
21670
|
-
}
|
|
21671
|
-
}
|
|
21672
|
-
|
|
21673
|
-
/**
|
|
21674
|
-
* Retrieves and removes the last registered callback from the queue.
|
|
21675
|
-
*
|
|
21676
|
-
* @private
|
|
21677
|
-
* @returns {Function|undefined} The last callback function or undefined if none exist.
|
|
21678
|
-
*/
|
|
21679
|
-
getLastCallback() {
|
|
21680
|
-
const cbInfo = this.taskCallbacks.pop();
|
|
21681
|
-
return cbInfo ? cbInfo.cb : undefined;
|
|
21682
|
-
}
|
|
21683
|
-
|
|
21684
|
-
/**
|
|
21685
|
-
* Retrieves and removes the last registered callback for the specified task type.
|
|
21686
|
-
*
|
|
21687
|
-
* @private
|
|
21688
|
-
* @param {string} taskType - The type of task for which the callback was registered.
|
|
21689
|
-
* @returns {Function|undefined} The last callback function for the task type, or undefined if none exist.
|
|
21690
|
-
*/
|
|
21691
|
-
getLastCallbackForType(taskType) {
|
|
21692
|
-
for (let i = this.taskCallbacks.length - 1; i >= 0; --i) {
|
|
21693
|
-
const cbInfo = this.taskCallbacks[i];
|
|
21694
|
-
if (cbInfo.type === taskType) {
|
|
21695
|
-
this.taskCallbacks.splice(i, 1);
|
|
21696
|
-
return cbInfo.cb;
|
|
21697
|
-
}
|
|
21698
|
-
}
|
|
21699
|
-
return undefined;
|
|
21700
|
-
}
|
|
21701
|
-
}
|
|
21702
|
-
|
|
21703
21415
|
const $templateRequestMinErr = minErr("$templateRequest");
|
|
21704
21416
|
|
|
21705
21417
|
/**
|
|
@@ -21759,7 +21471,7 @@
|
|
|
21759
21471
|
"$sce",
|
|
21760
21472
|
/**
|
|
21761
21473
|
*
|
|
21762
|
-
* @param {import('
|
|
21474
|
+
* @param {import('./exception/exception-handler.js').ErrorHandler} $exceptionHandler
|
|
21763
21475
|
* @param {import('../services/template-cache/interface.ts').TemplateCache} $templateCache
|
|
21764
21476
|
* @param {import("interface.ts").HttpService} $http
|
|
21765
21477
|
* @param {*} $sce
|
|
@@ -21774,6 +21486,7 @@
|
|
|
21774
21486
|
// resources for keys that already are included in there. This also makes
|
|
21775
21487
|
// AngularTS accept any script directive, no matter its name. However, we
|
|
21776
21488
|
// still need to unwrap trusted types.
|
|
21489
|
+
|
|
21777
21490
|
if (!isString(tpl) || !$templateCache.has(tpl)) {
|
|
21778
21491
|
try {
|
|
21779
21492
|
tpl = $sce.getTrustedResourceUrl(tpl);
|
|
@@ -21839,7 +21552,7 @@
|
|
|
21839
21552
|
];
|
|
21840
21553
|
}
|
|
21841
21554
|
|
|
21842
|
-
/** @typedef {import('../../interface.ts').ServiceProvider} ServiceProvider
|
|
21555
|
+
/** @typedef {import('../../interface.ts').ServiceProvider} ServiceProvider */
|
|
21843
21556
|
|
|
21844
21557
|
/**
|
|
21845
21558
|
* Private service to sanitize uris for links and images. Used by $compile.
|
|
@@ -21891,7 +21604,7 @@
|
|
|
21891
21604
|
}
|
|
21892
21605
|
|
|
21893
21606
|
/**
|
|
21894
|
-
* @returns {import("./interface
|
|
21607
|
+
* @returns {import("./interface").SanitizerFn}
|
|
21895
21608
|
*/
|
|
21896
21609
|
$get() {
|
|
21897
21610
|
return (uri, isMediaUrl) => {
|
|
@@ -22148,6 +21861,10 @@
|
|
|
22148
21861
|
const ngMessageExpDirective = ngMessageDirectiveFactory(false);
|
|
22149
21862
|
const ngMessageDefaultDirective = ngMessageDirectiveFactory(true);
|
|
22150
21863
|
|
|
21864
|
+
/**
|
|
21865
|
+
* @param {boolean} isDefault
|
|
21866
|
+
* @returns {(any) => import("../../interface.js").Directive}
|
|
21867
|
+
*/
|
|
22151
21868
|
function ngMessageDirectiveFactory(isDefault) {
|
|
22152
21869
|
ngMessageDirective.$inject = ["$animate"];
|
|
22153
21870
|
function ngMessageDirective($animate) {
|
|
@@ -25228,7 +24945,7 @@
|
|
|
25228
24945
|
|
|
25229
24946
|
/**
|
|
25230
24947
|
* Service provider that creates a requestAnimationFrame-based scheduler.
|
|
25231
|
-
* @
|
|
24948
|
+
* @type {ServiceProvider}
|
|
25232
24949
|
*/
|
|
25233
24950
|
class RafSchedulerProvider {
|
|
25234
24951
|
constructor() {
|
|
@@ -26980,7 +26697,6 @@
|
|
|
26980
26697
|
*
|
|
26981
26698
|
* This is where we hold the global mutable state such as current state, current
|
|
26982
26699
|
* params, current transition, etc.
|
|
26983
|
-
* @implements {ServiceProvider}
|
|
26984
26700
|
*/
|
|
26985
26701
|
class RouterGlobals {
|
|
26986
26702
|
constructor() {
|
|
@@ -29621,6 +29337,11 @@
|
|
|
29621
29337
|
*/
|
|
29622
29338
|
this.regexp = new RegExp("^" + regexpString + "$");
|
|
29623
29339
|
}
|
|
29340
|
+
|
|
29341
|
+
/**
|
|
29342
|
+
* @param {string} name
|
|
29343
|
+
* @return {boolean}
|
|
29344
|
+
*/
|
|
29624
29345
|
matches(name) {
|
|
29625
29346
|
return this.regexp.test("." + name);
|
|
29626
29347
|
}
|
|
@@ -33555,7 +33276,7 @@
|
|
|
33555
33276
|
];
|
|
33556
33277
|
|
|
33557
33278
|
/**
|
|
33558
|
-
* @param {import("../../
|
|
33279
|
+
* @param {import("../../services/location/location").LocationProvider} $locationProvider
|
|
33559
33280
|
* @param {import("../../router/state/state-service.js").StateProvider} stateService
|
|
33560
33281
|
* @param globals
|
|
33561
33282
|
* @param {import("../../router/url/url-config.js").UrlConfigProvider} urlConfigProvider
|
|
@@ -33564,9 +33285,7 @@
|
|
|
33564
33285
|
this.stateService = stateService;
|
|
33565
33286
|
this.stateService.urlService = this; // circular wiring
|
|
33566
33287
|
this.$locationProvider = $locationProvider;
|
|
33567
|
-
|
|
33568
33288
|
this.$location = undefined;
|
|
33569
|
-
this.$browser = undefined;
|
|
33570
33289
|
|
|
33571
33290
|
/** Provides services related to the URL */
|
|
33572
33291
|
this.urlRuleFactory = new UrlRuleFactory(this, this.stateService, globals);
|
|
@@ -33619,18 +33338,15 @@
|
|
|
33619
33338
|
|
|
33620
33339
|
$get = [
|
|
33621
33340
|
"$location",
|
|
33622
|
-
"$browser",
|
|
33623
33341
|
"$rootScope",
|
|
33624
33342
|
/**
|
|
33625
33343
|
*
|
|
33626
|
-
* @param {import('../../
|
|
33627
|
-
* @param {import('../../services/browser.js').Browser} $browser
|
|
33344
|
+
* @param {import('../../services/location/location.js').Location} $location
|
|
33628
33345
|
* @param {import('../../core/scope/scope.js').Scope} $rootScope
|
|
33629
33346
|
* @returns {UrlService}
|
|
33630
33347
|
*/
|
|
33631
|
-
($location, $
|
|
33348
|
+
($location, $rootScope) => {
|
|
33632
33349
|
this.$location = $location;
|
|
33633
|
-
this.$browser = $browser;
|
|
33634
33350
|
$rootScope.$on("$locationChangeSuccess", (evt) => {
|
|
33635
33351
|
this._urlListeners.forEach((fn) => {
|
|
33636
33352
|
fn(evt);
|
|
@@ -33654,7 +33370,7 @@
|
|
|
33654
33370
|
baseHref() {
|
|
33655
33371
|
return (
|
|
33656
33372
|
this._baseHref ||
|
|
33657
|
-
(this._baseHref =
|
|
33373
|
+
(this._baseHref = getBaseHref() || window.location.pathname)
|
|
33658
33374
|
);
|
|
33659
33375
|
}
|
|
33660
33376
|
|
|
@@ -34501,7 +34217,6 @@
|
|
|
34501
34217
|
*
|
|
34502
34218
|
* This API is found at `$stateRegistry` ([[UIRouter.stateRegistry]])
|
|
34503
34219
|
*
|
|
34504
|
-
* @implements {ServiceProvider}
|
|
34505
34220
|
*/
|
|
34506
34221
|
class StateRegistryProvider {
|
|
34507
34222
|
static $inject = provider([
|
|
@@ -35265,11 +34980,20 @@
|
|
|
35265
34980
|
* });
|
|
35266
34981
|
* ```
|
|
35267
34982
|
*/
|
|
34983
|
+
|
|
34984
|
+
/** @type {import("../../interface.js").AnnotatedDirectiveFactory} */
|
|
35268
34985
|
let ngView = [
|
|
35269
34986
|
"$view",
|
|
35270
34987
|
"$animate",
|
|
35271
34988
|
"$ngViewScroll",
|
|
35272
34989
|
"$interpolate",
|
|
34990
|
+
/**
|
|
34991
|
+
* @param {*} $view
|
|
34992
|
+
* @param {*} $animate
|
|
34993
|
+
* @param {*} $ngViewScroll
|
|
34994
|
+
* @param {*} $interpolate
|
|
34995
|
+
* @returns {import("../../interface.js").Directive}
|
|
34996
|
+
*/
|
|
35273
34997
|
function $ViewDirective($view, $animate, $ngViewScroll, $interpolate) {
|
|
35274
34998
|
function getRenderer() {
|
|
35275
34999
|
return {
|
|
@@ -35300,7 +35024,6 @@
|
|
|
35300
35024
|
};
|
|
35301
35025
|
const directive = {
|
|
35302
35026
|
count: 0,
|
|
35303
|
-
|
|
35304
35027
|
terminal: true,
|
|
35305
35028
|
priority: 400,
|
|
35306
35029
|
transclude: "element",
|
|
@@ -35637,7 +35360,8 @@
|
|
|
35637
35360
|
};
|
|
35638
35361
|
}
|
|
35639
35362
|
|
|
35640
|
-
ngSetterDirective.$inject = [
|
|
35363
|
+
ngSetterDirective.$inject = [$injectTokens.$parse, $injectTokens.$log];
|
|
35364
|
+
|
|
35641
35365
|
/**
|
|
35642
35366
|
* @param {import('../../core/parse/interface.ts').ParseService} $parse
|
|
35643
35367
|
* @param {import('../../services/log/interface.ts').LogService} $log
|
|
@@ -35650,19 +35374,19 @@
|
|
|
35650
35374
|
const modelExpression = attrs["ngSetter"];
|
|
35651
35375
|
|
|
35652
35376
|
if (!modelExpression) {
|
|
35653
|
-
$log.warn("
|
|
35377
|
+
$log.warn("ng-setter: expression null");
|
|
35654
35378
|
return;
|
|
35655
35379
|
}
|
|
35656
35380
|
|
|
35657
35381
|
const assignModel = $parse(modelExpression).assign;
|
|
35658
35382
|
|
|
35659
35383
|
if (!assignModel) {
|
|
35660
|
-
$log.warn("
|
|
35384
|
+
$log.warn("ng-setter: expression invalid");
|
|
35661
35385
|
return;
|
|
35662
35386
|
}
|
|
35663
35387
|
|
|
35664
35388
|
const updateModel = (value) => {
|
|
35665
|
-
assignModel(scope, value);
|
|
35389
|
+
assignModel(scope, value.trim());
|
|
35666
35390
|
};
|
|
35667
35391
|
|
|
35668
35392
|
const observer = new MutationObserver((mutationsList) => {
|
|
@@ -35682,16 +35406,11 @@
|
|
|
35682
35406
|
}
|
|
35683
35407
|
});
|
|
35684
35408
|
|
|
35685
|
-
|
|
35686
|
-
|
|
35687
|
-
|
|
35688
|
-
|
|
35689
|
-
|
|
35690
|
-
});
|
|
35691
|
-
} else {
|
|
35692
|
-
$log.warn("ngSetter: Element is not a valid DOM node.");
|
|
35693
|
-
return;
|
|
35694
|
-
}
|
|
35409
|
+
observer.observe(element, {
|
|
35410
|
+
childList: true,
|
|
35411
|
+
subtree: true,
|
|
35412
|
+
characterData: true,
|
|
35413
|
+
});
|
|
35695
35414
|
|
|
35696
35415
|
scope.$on("$destroy", () => observer.disconnect());
|
|
35697
35416
|
updateModel(element.innerHTML);
|
|
@@ -35706,13 +35425,20 @@
|
|
|
35706
35425
|
function defineDirective(method) {
|
|
35707
35426
|
const attrName = "ng" + method.charAt(0).toUpperCase() + method.slice(1);
|
|
35708
35427
|
const directive = createHttpDirective(method, attrName);
|
|
35709
|
-
directive["$inject"] = [
|
|
35428
|
+
directive["$inject"] = [$injectTokens.$http, $injectTokens.$compile, $injectTokens.$log, $injectTokens.$parse, $injectTokens.$state];
|
|
35710
35429
|
return directive;
|
|
35711
35430
|
}
|
|
35712
35431
|
|
|
35432
|
+
/** @type {import('../../interface.ts').DirectiveFactory} */
|
|
35713
35433
|
const ngGetDirective = defineDirective("get");
|
|
35434
|
+
|
|
35435
|
+
/** @type {import('../../interface.ts').DirectiveFactory} */
|
|
35714
35436
|
const ngDeleteDirective = defineDirective("delete");
|
|
35437
|
+
|
|
35438
|
+
/** @type {import('../../interface.ts').DirectiveFactory} */
|
|
35715
35439
|
const ngPostDirective = defineDirective("post");
|
|
35440
|
+
|
|
35441
|
+
/** @type {import('../../interface.ts').DirectiveFactory} */
|
|
35716
35442
|
const ngPutDirective = defineDirective("put");
|
|
35717
35443
|
|
|
35718
35444
|
/**
|
|
@@ -35739,7 +35465,7 @@
|
|
|
35739
35465
|
* Handles DOM manipulation based on a swap strategy and server-rendered HTML.
|
|
35740
35466
|
*
|
|
35741
35467
|
* @param {string} html - The HTML string returned from the server.
|
|
35742
|
-
* @param {import("../../interface.ts").
|
|
35468
|
+
* @param {import("../../interface.ts").SwapModeType} swap
|
|
35743
35469
|
* @param {Element} target - The target DOM element to apply the swap to.
|
|
35744
35470
|
* @param {import('../../core/scope/scope.js').Scope} scope
|
|
35745
35471
|
* @param {import('../../core/compile/compile.js').CompileFn} $compile
|
|
@@ -35830,9 +35556,11 @@
|
|
|
35830
35556
|
* @param {import("interface.ts").HttpService} $http
|
|
35831
35557
|
* @param {import("../../core/compile/compile.js").CompileFn} $compile
|
|
35832
35558
|
* @param {import("../../services/log/interface.ts").LogService} $log
|
|
35559
|
+
* @param {import("../../core/parse/interface.ts").ParseService} $parse
|
|
35560
|
+
* @param {import("../../router/state/state-service.js").StateProvider} $state
|
|
35833
35561
|
* @returns {import('../../interface.ts').Directive}
|
|
35834
35562
|
*/
|
|
35835
|
-
return function ($http, $compile, $log) {
|
|
35563
|
+
return function ($http, $compile, $log, $parse, $state) {
|
|
35836
35564
|
/**
|
|
35837
35565
|
* Collects form data from the element or its associated form.
|
|
35838
35566
|
*
|
|
@@ -35893,16 +35621,38 @@
|
|
|
35893
35621
|
restrict: "A",
|
|
35894
35622
|
terminal: true,
|
|
35895
35623
|
link(scope, element, attrs) {
|
|
35896
|
-
|
|
35897
|
-
|
|
35624
|
+
const eventName =
|
|
35625
|
+
attrs["trigger"] ||
|
|
35626
|
+
/** @type {EventType} */ getEventNameForElement(element);
|
|
35627
|
+
|
|
35898
35628
|
const tag = element.tagName.toLowerCase();
|
|
35899
35629
|
|
|
35900
|
-
|
|
35630
|
+
if (isDefined(attrs["latch"])) {
|
|
35631
|
+
attrs.$observe(
|
|
35632
|
+
"latch",
|
|
35633
|
+
callBackAfterFirst(() =>
|
|
35634
|
+
element.dispatchEvent(new Event(eventName)),
|
|
35635
|
+
),
|
|
35636
|
+
);
|
|
35637
|
+
}
|
|
35638
|
+
|
|
35639
|
+
let throttled = false;
|
|
35640
|
+
let intervalId;
|
|
35641
|
+
|
|
35642
|
+
if (isDefined(attrs["interval"])) {
|
|
35643
|
+
element.dispatchEvent(new Event(eventName));
|
|
35644
|
+
intervalId = setInterval(
|
|
35645
|
+
() => element.dispatchEvent(new Event(eventName)),
|
|
35646
|
+
parseInt(attrs["interval"]) || 1000,
|
|
35647
|
+
);
|
|
35648
|
+
}
|
|
35649
|
+
|
|
35650
|
+
element.addEventListener(eventName, async (event) => {
|
|
35901
35651
|
if (/** @type {HTMLButtonElement} */ (element).disabled) return;
|
|
35902
35652
|
if (tag === "form") event.preventDefault();
|
|
35903
35653
|
|
|
35904
|
-
const swap =
|
|
35905
|
-
const targetSelector =
|
|
35654
|
+
const swap = attrs["swap"] || "innerHTML";
|
|
35655
|
+
const targetSelector = attrs["target"];
|
|
35906
35656
|
const target = targetSelector
|
|
35907
35657
|
? document.querySelector(targetSelector)
|
|
35908
35658
|
: element;
|
|
@@ -35919,18 +35669,67 @@
|
|
|
35919
35669
|
}
|
|
35920
35670
|
|
|
35921
35671
|
const handler = (res) => {
|
|
35672
|
+
if (isDefined(attrs["loading"])) {
|
|
35673
|
+
attrs.$set("loading", false);
|
|
35674
|
+
}
|
|
35675
|
+
|
|
35676
|
+
if (isDefined(attrs["loadingClass"])) {
|
|
35677
|
+
attrs.$removeClass(attrs["loadingClass"]);
|
|
35678
|
+
}
|
|
35679
|
+
|
|
35922
35680
|
const html = res.data;
|
|
35681
|
+
if (200 <= res.status && res.status <= 299) {
|
|
35682
|
+
if (isDefined(attrs["success"])) {
|
|
35683
|
+
$parse(attrs["success"])(scope, { $res: html });
|
|
35684
|
+
}
|
|
35685
|
+
|
|
35686
|
+
if (isDefined(attrs["stateSuccess"])) {
|
|
35687
|
+
$state.go(attrs["stateSuccess"]);
|
|
35688
|
+
}
|
|
35689
|
+
} else if (400 <= res.status && res.status <= 599) {
|
|
35690
|
+
if (isDefined(attrs["error"])) {
|
|
35691
|
+
$parse(attrs["error"])(scope, { $res: html });
|
|
35692
|
+
}
|
|
35693
|
+
|
|
35694
|
+
if (isDefined(attrs["stateError"])) {
|
|
35695
|
+
$state.go(attrs["stateError"]);
|
|
35696
|
+
}
|
|
35697
|
+
}
|
|
35698
|
+
|
|
35923
35699
|
handleSwapResponse(
|
|
35924
35700
|
html,
|
|
35925
|
-
/** @type {import("../../interface.ts").
|
|
35926
|
-
swap
|
|
35927
|
-
),
|
|
35701
|
+
/** @type {import("../../interface.ts").SwapModeType} */ (swap),
|
|
35928
35702
|
target,
|
|
35929
35703
|
scope,
|
|
35930
35704
|
$compile,
|
|
35931
35705
|
);
|
|
35932
35706
|
};
|
|
35933
35707
|
|
|
35708
|
+
if (isDefined(attrs["delay"])) {
|
|
35709
|
+
await wait(parseInt(attrs["delay"]) | 0);
|
|
35710
|
+
}
|
|
35711
|
+
|
|
35712
|
+
if (throttled) {
|
|
35713
|
+
return;
|
|
35714
|
+
}
|
|
35715
|
+
|
|
35716
|
+
if (isDefined(attrs["throttle"])) {
|
|
35717
|
+
throttled = true;
|
|
35718
|
+
attrs.$set("throttled", true);
|
|
35719
|
+
setTimeout(() => {
|
|
35720
|
+
attrs.$set("throttled", false);
|
|
35721
|
+
throttled = false;
|
|
35722
|
+
}, parseInt(attrs["throttle"]));
|
|
35723
|
+
}
|
|
35724
|
+
|
|
35725
|
+
if (isDefined(attrs["loading"])) {
|
|
35726
|
+
attrs.$set("loading", true);
|
|
35727
|
+
}
|
|
35728
|
+
|
|
35729
|
+
if (isDefined(attrs["loadingClass"])) {
|
|
35730
|
+
attrs.$addClass(attrs["loadingClass"]);
|
|
35731
|
+
}
|
|
35732
|
+
|
|
35934
35733
|
if (method === "post" || method === "put") {
|
|
35935
35734
|
const data = collectFormData(element);
|
|
35936
35735
|
$http[method](url, data).then(handler).catch(handler);
|
|
@@ -35938,6 +35737,8 @@
|
|
|
35938
35737
|
$http[method](url).then(handler).catch(handler);
|
|
35939
35738
|
}
|
|
35940
35739
|
});
|
|
35740
|
+
|
|
35741
|
+
scope.$on("$destroy", () => clearInterval(intervalId));
|
|
35941
35742
|
},
|
|
35942
35743
|
};
|
|
35943
35744
|
};
|
|
@@ -35949,13 +35750,13 @@
|
|
|
35949
35750
|
* @returns {import('./core/di/ng-module.js').NgModule} `ng` module
|
|
35950
35751
|
*/
|
|
35951
35752
|
function registerNgModule(angular) {
|
|
35952
|
-
|
|
35753
|
+
return angular
|
|
35953
35754
|
.module(
|
|
35954
35755
|
"ng",
|
|
35955
35756
|
[],
|
|
35956
35757
|
[
|
|
35957
35758
|
"$provide",
|
|
35958
|
-
/** @
|
|
35759
|
+
/** @param {import("./interface.js").Provider} $provide */
|
|
35959
35760
|
($provide) => {
|
|
35960
35761
|
// $$sanitizeUriProvider needs to be before $compileProvider as it is used by it.
|
|
35961
35762
|
$provide.provider({
|
|
@@ -36056,7 +35857,6 @@
|
|
|
36056
35857
|
$$animateQueue: AnimateQueueProvider,
|
|
36057
35858
|
$$AnimateRunner: AnimateRunnerFactoryProvider,
|
|
36058
35859
|
$$animateAsyncRun: AnimateAsyncRunFactoryProvider,
|
|
36059
|
-
$browser: BrowserProvider,
|
|
36060
35860
|
$controller: ControllerProvider,
|
|
36061
35861
|
$exceptionHandler: ExceptionHandlerProvider,
|
|
36062
35862
|
$filter: FilterProvider,
|
|
@@ -36072,7 +35872,6 @@
|
|
|
36072
35872
|
$routerGlobals: RouterGlobals,
|
|
36073
35873
|
$sce: SceProvider,
|
|
36074
35874
|
$sceDelegate: SceDelegateProvider,
|
|
36075
|
-
$$taskTrackerFactory: TaskTrackerFactoryProvider,
|
|
36076
35875
|
$templateCache: TemplateCacheProvider,
|
|
36077
35876
|
$templateRequest: TemplateRequestProvider,
|
|
36078
35877
|
$urlConfig: UrlConfigProvider,
|
|
@@ -36099,8 +35898,6 @@
|
|
|
36099
35898
|
},
|
|
36100
35899
|
])
|
|
36101
35900
|
.value("$trace", trace);
|
|
36102
|
-
|
|
36103
|
-
return ng;
|
|
36104
35901
|
}
|
|
36105
35902
|
|
|
36106
35903
|
const ngMinErr = minErr("ng");
|
|
@@ -36126,7 +35923,7 @@
|
|
|
36126
35923
|
/**
|
|
36127
35924
|
* @type {string} `version` from `package.json`
|
|
36128
35925
|
*/
|
|
36129
|
-
this.version = "0.7.
|
|
35926
|
+
this.version = "0.7.8"; //inserted via rollup plugin
|
|
36130
35927
|
|
|
36131
35928
|
/** @type {!Array<string|any>} */
|
|
36132
35929
|
this.bootsrappedModules = [];
|
|
@@ -36366,12 +36163,7 @@
|
|
|
36366
36163
|
name,
|
|
36367
36164
|
);
|
|
36368
36165
|
}
|
|
36369
|
-
|
|
36370
|
-
name,
|
|
36371
|
-
requires,
|
|
36372
|
-
/** @type {Function} */ (configFn),
|
|
36373
|
-
);
|
|
36374
|
-
return moduleInstance;
|
|
36166
|
+
return new NgModule(name, requires, /** @type {Function} */ (configFn));
|
|
36375
36167
|
});
|
|
36376
36168
|
}
|
|
36377
36169
|
}
|