@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.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Version: 0.7.
|
|
1
|
+
/* Version: 0.7.8 - July 17, 2025 02:51:20 */
|
|
2
2
|
const VALID_CLASS = "ng-valid";
|
|
3
3
|
const INVALID_CLASS = "ng-invalid";
|
|
4
4
|
const PRISTINE_CLASS = "ng-pristine";
|
|
@@ -1148,11 +1148,37 @@ function callBackOnce(fn) {
|
|
|
1148
1148
|
};
|
|
1149
1149
|
}
|
|
1150
1150
|
|
|
1151
|
+
/**
|
|
1152
|
+
* Wraps a function so it will only be called starting from the second invocation.
|
|
1153
|
+
* The first call does nothing and returns undefined.
|
|
1154
|
+
*
|
|
1155
|
+
* @param {Function} fn - The function to wrap.
|
|
1156
|
+
* @returns {Function} A new function that will skip the first call.
|
|
1157
|
+
*/
|
|
1158
|
+
function callBackAfterFirst(fn) {
|
|
1159
|
+
let calledOnce = false;
|
|
1160
|
+
|
|
1161
|
+
return function (...args) {
|
|
1162
|
+
if (calledOnce) {
|
|
1163
|
+
return fn.apply(this, args);
|
|
1164
|
+
}
|
|
1165
|
+
calledOnce = true;
|
|
1166
|
+
};
|
|
1167
|
+
}
|
|
1168
|
+
|
|
1169
|
+
/**
|
|
1170
|
+
* Delays execution for a specified number of milliseconds.
|
|
1171
|
+
*
|
|
1172
|
+
* @param {number} [t=0] - The number of milliseconds to wait. Defaults to 0.
|
|
1173
|
+
* @returns {Promise<void>} A promise that resolves after the delay.
|
|
1174
|
+
*/
|
|
1175
|
+
function wait(t = 0) {
|
|
1176
|
+
return new Promise((resolve) => setTimeout(resolve, t));
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1151
1179
|
/**
|
|
1152
1180
|
* Expando cache for adding properties to DOM nodes with JavaScript.
|
|
1153
1181
|
* This used to be an Object in JQLite decorator, but swapped out for a Map
|
|
1154
|
-
* for performance reasons and convenience methods. A proxy is available for
|
|
1155
|
-
* additional logic handling.
|
|
1156
1182
|
*
|
|
1157
1183
|
* @type {Map<number, import('../interface.ts').ExpandoStore>}
|
|
1158
1184
|
*/
|
|
@@ -1705,6 +1731,16 @@ function extractElementNode$1(element) {
|
|
|
1705
1731
|
}
|
|
1706
1732
|
}
|
|
1707
1733
|
|
|
1734
|
+
/**
|
|
1735
|
+
* Returns the base href of the document.
|
|
1736
|
+
*
|
|
1737
|
+
* @returns {string} The base href.
|
|
1738
|
+
*/
|
|
1739
|
+
function getBaseHref() {
|
|
1740
|
+
const href = document.querySelector("base")?.getAttribute("href");
|
|
1741
|
+
return href ? href.replace(/^(https?:)?\/\/[^/]*/, "") : "";
|
|
1742
|
+
}
|
|
1743
|
+
|
|
1708
1744
|
/**
|
|
1709
1745
|
* A helper list of tokens matching the standard injectables that come predefined in the core `ng` module.
|
|
1710
1746
|
* These string tokens are commonly injected into services, directives, or components via `$inject`.
|
|
@@ -1737,7 +1773,7 @@ const $injectTokens = Object.freeze({
|
|
|
1737
1773
|
$animate: "$animate",
|
|
1738
1774
|
$animateCss: "$animateCss",
|
|
1739
1775
|
$aria: "$aria",
|
|
1740
|
-
$
|
|
1776
|
+
$compile: "$compile",
|
|
1741
1777
|
$controller: "$controller",
|
|
1742
1778
|
$eventBus: "$eventBus",
|
|
1743
1779
|
$exceptionHandler: "$exceptionHandler",
|
|
@@ -1780,10 +1816,15 @@ function provider(services) {
|
|
|
1780
1816
|
return services.map((x) => x + "Provider");
|
|
1781
1817
|
}
|
|
1782
1818
|
|
|
1819
|
+
/** @private */
|
|
1783
1820
|
const INJECTOR_LITERAL = "$injector";
|
|
1821
|
+
/** @private */
|
|
1784
1822
|
const COMPILE_LITERAL = "$compileProvider";
|
|
1823
|
+
/** @private */
|
|
1785
1824
|
const ANIMATION_LITERAL = "$animateProvider";
|
|
1825
|
+
/** @private */
|
|
1786
1826
|
const FILTER_LITERAL = "$filterProvider";
|
|
1827
|
+
/** @private */
|
|
1787
1828
|
const CONTROLLER_LITERAL = "$controllerProvider";
|
|
1788
1829
|
|
|
1789
1830
|
/**
|
|
@@ -1850,11 +1891,7 @@ class NgModule {
|
|
|
1850
1891
|
* @returns {NgModule}
|
|
1851
1892
|
*/
|
|
1852
1893
|
constant(name, object) {
|
|
1853
|
-
this.invokeQueue.unshift([
|
|
1854
|
-
$injectTokens.$provide,
|
|
1855
|
-
"constant",
|
|
1856
|
-
[name, object],
|
|
1857
|
-
]);
|
|
1894
|
+
this.invokeQueue.unshift([$injectTokens.$provide, "constant", [name, object]]);
|
|
1858
1895
|
return this;
|
|
1859
1896
|
}
|
|
1860
1897
|
|
|
@@ -1899,11 +1936,7 @@ class NgModule {
|
|
|
1899
1936
|
if (providerFunction && isFunction(providerFunction)) {
|
|
1900
1937
|
providerFunction.$$moduleName = name;
|
|
1901
1938
|
}
|
|
1902
|
-
this.invokeQueue.push([
|
|
1903
|
-
$injectTokens.$provide,
|
|
1904
|
-
"factory",
|
|
1905
|
-
[name, providerFunction],
|
|
1906
|
-
]);
|
|
1939
|
+
this.invokeQueue.push([$injectTokens.$provide, "factory", [name, providerFunction]]);
|
|
1907
1940
|
return this;
|
|
1908
1941
|
}
|
|
1909
1942
|
|
|
@@ -1916,11 +1949,7 @@ class NgModule {
|
|
|
1916
1949
|
if (serviceFunction && isFunction(serviceFunction)) {
|
|
1917
1950
|
serviceFunction.$$moduleName = name;
|
|
1918
1951
|
}
|
|
1919
|
-
this.invokeQueue.push([
|
|
1920
|
-
$injectTokens.$provide,
|
|
1921
|
-
"service",
|
|
1922
|
-
[name, serviceFunction],
|
|
1923
|
-
]);
|
|
1952
|
+
this.invokeQueue.push([$injectTokens.$provide, "service", [name, serviceFunction]]);
|
|
1924
1953
|
return this;
|
|
1925
1954
|
}
|
|
1926
1955
|
|
|
@@ -1933,11 +1962,7 @@ class NgModule {
|
|
|
1933
1962
|
if (providerType && isFunction(providerType)) {
|
|
1934
1963
|
providerType.$$moduleName = name;
|
|
1935
1964
|
}
|
|
1936
|
-
this.invokeQueue.push([
|
|
1937
|
-
$injectTokens.$provide,
|
|
1938
|
-
"provider",
|
|
1939
|
-
[name, providerType],
|
|
1940
|
-
]);
|
|
1965
|
+
this.invokeQueue.push([$injectTokens.$provide, "provider", [name, providerType]]);
|
|
1941
1966
|
return this;
|
|
1942
1967
|
}
|
|
1943
1968
|
|
|
@@ -1950,11 +1975,7 @@ class NgModule {
|
|
|
1950
1975
|
if (decorFn && isFunction(decorFn)) {
|
|
1951
1976
|
decorFn.$$moduleName = name;
|
|
1952
1977
|
}
|
|
1953
|
-
this.configBlocks.push([
|
|
1954
|
-
$injectTokens.$provide,
|
|
1955
|
-
"decorator",
|
|
1956
|
-
[name, decorFn],
|
|
1957
|
-
]);
|
|
1978
|
+
this.configBlocks.push([$injectTokens.$provide, "decorator", [name, decorFn]]);
|
|
1958
1979
|
return this;
|
|
1959
1980
|
}
|
|
1960
1981
|
|
|
@@ -2199,8 +2220,11 @@ class InjectorService extends AbstractInjector {
|
|
|
2199
2220
|
*/
|
|
2200
2221
|
constructor(providerInjector, strictDi) {
|
|
2201
2222
|
super(strictDi);
|
|
2223
|
+
|
|
2224
|
+
/** @type {ProviderInjector} */
|
|
2202
2225
|
this.providerInjector = providerInjector;
|
|
2203
|
-
|
|
2226
|
+
/** @type {Object.<string, import("./ng-module.js").NgModule>} */
|
|
2227
|
+
this.modules = providerInjector.modules;
|
|
2204
2228
|
}
|
|
2205
2229
|
|
|
2206
2230
|
/**
|
|
@@ -2317,9 +2341,6 @@ function createInjector(modulesToLoad, strictDi = false) {
|
|
|
2317
2341
|
const loadedModules = new Map(); // Keep track of loaded modules to avoid circular dependencies
|
|
2318
2342
|
|
|
2319
2343
|
const providerCache = {
|
|
2320
|
-
/**
|
|
2321
|
-
* @type {import('../../interface.ts').Provider}
|
|
2322
|
-
*/
|
|
2323
2344
|
$provide: {
|
|
2324
2345
|
provider: supportObject(provider),
|
|
2325
2346
|
factory: supportObject(factory),
|
|
@@ -2346,15 +2367,10 @@ function createInjector(modulesToLoad, strictDi = false) {
|
|
|
2346
2367
|
const runBlocks = loadModules(modulesToLoad);
|
|
2347
2368
|
instanceInjector = protoInstanceInjector.get(INJECTOR_LITERAL);
|
|
2348
2369
|
|
|
2349
|
-
runBlocks.forEach((fn) =>
|
|
2350
|
-
if (fn) instanceInjector.invoke(fn);
|
|
2351
|
-
});
|
|
2370
|
+
runBlocks.forEach((fn) => fn && instanceInjector.invoke(fn));
|
|
2352
2371
|
|
|
2353
|
-
instanceInjector.loadNewModules =
|
|
2354
|
-
loadModules(mods).forEach((fn) =>
|
|
2355
|
-
if (fn) instanceInjector.invoke(fn);
|
|
2356
|
-
});
|
|
2357
|
-
};
|
|
2372
|
+
instanceInjector.loadNewModules = (mods) =>
|
|
2373
|
+
loadModules(mods).forEach((fn) => fn && instanceInjector.invoke(fn));
|
|
2358
2374
|
|
|
2359
2375
|
return instanceInjector;
|
|
2360
2376
|
|
|
@@ -2483,7 +2499,7 @@ function createInjector(modulesToLoad, strictDi = false) {
|
|
|
2483
2499
|
|
|
2484
2500
|
try {
|
|
2485
2501
|
if (isString(module)) {
|
|
2486
|
-
/** @type {import('./ng-module').NgModule} */
|
|
2502
|
+
/** @type {import('./ng-module.js').NgModule} */
|
|
2487
2503
|
const moduleFn = window["angular"].module(module);
|
|
2488
2504
|
instanceInjector.modules[/** @type {string } */ (module)] = moduleFn;
|
|
2489
2505
|
runBlocks = runBlocks
|
|
@@ -2549,7 +2565,6 @@ function extractArgs(fn) {
|
|
|
2549
2565
|
}
|
|
2550
2566
|
|
|
2551
2567
|
/**
|
|
2552
|
-
*
|
|
2553
2568
|
* @param {any} fn
|
|
2554
2569
|
* @param {boolean} [strictDi]
|
|
2555
2570
|
* @param {String} [name]
|
|
@@ -2588,10 +2603,6 @@ function annotate(fn, strictDi, name) {
|
|
|
2588
2603
|
return $inject;
|
|
2589
2604
|
}
|
|
2590
2605
|
|
|
2591
|
-
/**
|
|
2592
|
-
* @param {function(string, any):any} delegate
|
|
2593
|
-
* @returns {any}
|
|
2594
|
-
*/
|
|
2595
2606
|
function supportObject(delegate) {
|
|
2596
2607
|
return function (key, value) {
|
|
2597
2608
|
if (isObject(key)) {
|
|
@@ -3007,32 +3018,25 @@ class ControllerProvider {
|
|
|
3007
3018
|
}
|
|
3008
3019
|
}
|
|
3009
3020
|
|
|
3010
|
-
/**
|
|
3011
|
-
* HTTP protocol
|
|
3012
|
-
* @typedef {"http"|"https"} HttpProtocol
|
|
3013
|
-
*/
|
|
3014
|
-
|
|
3015
3021
|
const urlParsingNode = document.createElement("a");
|
|
3016
3022
|
const originUrl = urlResolve(window.location.href);
|
|
3017
3023
|
let baseUrlParsingNode;
|
|
3018
3024
|
|
|
3019
3025
|
urlParsingNode.href = "http://[::1]";
|
|
3020
3026
|
|
|
3027
|
+
/**
|
|
3028
|
+
* @param {import("./interface.js").ResolvableUrl} url
|
|
3029
|
+
* @return {import("./interface.js").ParsedUrl}
|
|
3030
|
+
*/
|
|
3021
3031
|
function urlResolve(url) {
|
|
3022
|
-
if (!isString(url))
|
|
3023
|
-
|
|
3024
|
-
const href = url;
|
|
3032
|
+
if (!isString(url))
|
|
3033
|
+
return /** @type {import("./interface.js").ParsedUrl} */ (url);
|
|
3025
3034
|
|
|
3026
|
-
urlParsingNode.setAttribute("href",
|
|
3035
|
+
urlParsingNode.setAttribute("href", /** @type {string} */ (url));
|
|
3027
3036
|
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
// when parsed out of an anchor element.
|
|
3032
|
-
const ipv6InBrackets = urlParsingNode.hostname === "[::1]";
|
|
3033
|
-
if (!ipv6InBrackets && hostname.indexOf(":") > -1) {
|
|
3034
|
-
hostname = `[${hostname}]`;
|
|
3035
|
-
}
|
|
3037
|
+
const hostname = urlParsingNode.hostname.includes(":")
|
|
3038
|
+
? `[${urlParsingNode.hostname}]`
|
|
3039
|
+
: urlParsingNode.hostname;
|
|
3036
3040
|
|
|
3037
3041
|
return {
|
|
3038
3042
|
href: urlParsingNode.href,
|
|
@@ -3057,7 +3061,7 @@ function urlResolve(url) {
|
|
|
3057
3061
|
* Parse a request URL and determine whether this is a same-origin request as the application
|
|
3058
3062
|
* document.
|
|
3059
3063
|
*
|
|
3060
|
-
* @param {
|
|
3064
|
+
* @param {import("./interface.js").ResolvableUrl} requestUrl The url of the request as a string that will be resolved
|
|
3061
3065
|
* or a parsed URL object.
|
|
3062
3066
|
* @returns {boolean} Whether the request is for the same origin as the application document.
|
|
3063
3067
|
*/
|
|
@@ -3071,7 +3075,7 @@ function urlIsSameOrigin(requestUrl) {
|
|
|
3071
3075
|
* Note: The base URL is usually the same as the document location (`location.href`) but can
|
|
3072
3076
|
* be overriden by using the `<base>` tag.
|
|
3073
3077
|
*
|
|
3074
|
-
* @param {
|
|
3078
|
+
* @param {import("./interface.js").ResolvableUrl} requestUrl The url of the request as a string that will be resolved
|
|
3075
3079
|
* or a parsed URL object.
|
|
3076
3080
|
* @returns {boolean} Whether the URL is same-origin as the document base URL.
|
|
3077
3081
|
*/
|
|
@@ -3085,7 +3089,7 @@ function urlIsSameOriginAsBaseUrl(requestUrl) {
|
|
|
3085
3089
|
*
|
|
3086
3090
|
* @param {string[]} trustedOriginUrls - A list of URLs (strings), whose origins are trusted.
|
|
3087
3091
|
*
|
|
3088
|
-
* @returns {
|
|
3092
|
+
* @returns {(url: import("./interface.js").ResolvableUrl) => boolean } - A function that receives a URL (string or parsed URL object) and returns
|
|
3089
3093
|
* whether it is of an allowed origin.
|
|
3090
3094
|
*/
|
|
3091
3095
|
function urlIsAllowedOriginFactory(trustedOriginUrls) {
|
|
@@ -3098,7 +3102,7 @@ function urlIsAllowedOriginFactory(trustedOriginUrls) {
|
|
|
3098
3102
|
* based on a list of trusted-origin URLs. The current location's origin is implicitly
|
|
3099
3103
|
* trusted.
|
|
3100
3104
|
*
|
|
3101
|
-
* @param {
|
|
3105
|
+
* @param {import("./interface.js").ResolvableUrl} requestUrl - The URL to be checked (provided as a string that will be
|
|
3102
3106
|
* resolved or a parsed URL object).
|
|
3103
3107
|
*
|
|
3104
3108
|
* @returns {boolean} - Whether the specified URL is of an allowed origin.
|
|
@@ -3114,9 +3118,9 @@ function urlIsAllowedOriginFactory(trustedOriginUrls) {
|
|
|
3114
3118
|
/**
|
|
3115
3119
|
* Determine if two URLs share the same origin.
|
|
3116
3120
|
*
|
|
3117
|
-
* @param {
|
|
3121
|
+
* @param {import("./interface.js").ResolvableUrl} url1 - First URL to compare as a string or a normalized URL in the form of
|
|
3118
3122
|
* a dictionary object returned by `urlResolve()`.
|
|
3119
|
-
* @param {
|
|
3123
|
+
* @param {import("./interface.js").ResolvableUrl} url2 - Second URL to compare as a string or a normalized URL in the form
|
|
3120
3124
|
* of a dictionary object returned by `urlResolve()`.
|
|
3121
3125
|
*
|
|
3122
3126
|
* @returns {boolean} - True if both URLs have the same origin, and false otherwise.
|
|
@@ -3149,7 +3153,17 @@ function getBaseUrl() {
|
|
|
3149
3153
|
return baseUrlParsingNode.href;
|
|
3150
3154
|
}
|
|
3151
3155
|
|
|
3152
|
-
/**
|
|
3156
|
+
/**
|
|
3157
|
+
* Removes a trailing hash ('#') from the given URL if it exists.
|
|
3158
|
+
*
|
|
3159
|
+
* @param {string} url
|
|
3160
|
+
* @returns {string}
|
|
3161
|
+
*/
|
|
3162
|
+
function trimEmptyHash(url) {
|
|
3163
|
+
return url.replace(/#$/, "");
|
|
3164
|
+
}
|
|
3165
|
+
|
|
3166
|
+
/** @typedef {import("../exception/interface.ts").Interface } ErrorHandler */
|
|
3153
3167
|
|
|
3154
3168
|
const $sceMinErr = minErr("$sce");
|
|
3155
3169
|
|
|
@@ -3205,6 +3219,7 @@ function adjustMatcher(matcher) {
|
|
|
3205
3219
|
.replace(/\\\*/g, "[^:/.?&;]*");
|
|
3206
3220
|
return new RegExp(`^${matcher}$`);
|
|
3207
3221
|
}
|
|
3222
|
+
|
|
3208
3223
|
if (isRegExp(matcher)) {
|
|
3209
3224
|
// The only other type of matcher allowed is a Regexp.
|
|
3210
3225
|
// Match entire URL / disallow partial matches.
|
|
@@ -3466,6 +3481,11 @@ class SceDelegateProvider {
|
|
|
3466
3481
|
htmlSanitizer = $injector.get("$sanitize");
|
|
3467
3482
|
}
|
|
3468
3483
|
|
|
3484
|
+
/**
|
|
3485
|
+
* @param {string|RegExp} matcher
|
|
3486
|
+
* @param {import("../../shared/url-utils/interface").ParsedUrl} parsedUrl
|
|
3487
|
+
* @return {boolean}
|
|
3488
|
+
*/
|
|
3469
3489
|
function matchUrl(matcher, parsedUrl) {
|
|
3470
3490
|
if (matcher === "self") {
|
|
3471
3491
|
return (
|
|
@@ -3473,7 +3493,7 @@ class SceDelegateProvider {
|
|
|
3473
3493
|
);
|
|
3474
3494
|
}
|
|
3475
3495
|
// definitely a regex. See adjustMatchers()
|
|
3476
|
-
return !!matcher.exec(parsedUrl.href);
|
|
3496
|
+
return !!(/** @type {RegExp} */ (matcher).exec(parsedUrl.href));
|
|
3477
3497
|
}
|
|
3478
3498
|
|
|
3479
3499
|
function isResourceUrlAllowedByPolicy(url) {
|
|
@@ -3978,6 +3998,10 @@ function SceProvider() {
|
|
|
3978
3998
|
* A collection of directives that allows creation of custom event handlers that are defined as
|
|
3979
3999
|
* AngularTS expressions and are compiled and executed within the current scope.
|
|
3980
4000
|
*/
|
|
4001
|
+
|
|
4002
|
+
/**
|
|
4003
|
+
* @type {Record<string, import("../../interface.js").DirectiveFactory>}
|
|
4004
|
+
*/
|
|
3981
4005
|
const ngEventDirectives = {};
|
|
3982
4006
|
|
|
3983
4007
|
"click copy cut dblclick focus blur keydown keyup load mousedown mouseenter mouseleave mousemove mouseout mouseover mouseup paste submit touchstart touchend touchmove"
|
|
@@ -3989,7 +4013,7 @@ const ngEventDirectives = {};
|
|
|
3989
4013
|
"$exceptionHandler",
|
|
3990
4014
|
/**
|
|
3991
4015
|
* @param {import("../../core/parse/interface.ts").ParseService} $parse
|
|
3992
|
-
* @param {import('../../
|
|
4016
|
+
* @param {import('../../services/exception/exception-handler.js').ErrorHandler} $exceptionHandler
|
|
3993
4017
|
* @returns
|
|
3994
4018
|
*/
|
|
3995
4019
|
($parse, $exceptionHandler) => {
|
|
@@ -4006,7 +4030,7 @@ const ngEventDirectives = {};
|
|
|
4006
4030
|
/**
|
|
4007
4031
|
*
|
|
4008
4032
|
* @param {import("../../core/parse/interface.ts").ParseService} $parse
|
|
4009
|
-
* @param {import('../../
|
|
4033
|
+
* @param {import('../../services/exception/exception-handler.js').ErrorHandler} $exceptionHandler
|
|
4010
4034
|
* @param {string} directiveName
|
|
4011
4035
|
* @param {string} eventName
|
|
4012
4036
|
* @returns {import("../../interface.ts").Directive}
|
|
@@ -4047,7 +4071,7 @@ class Attributes {
|
|
|
4047
4071
|
/**
|
|
4048
4072
|
* @param {import('../scope/scope.js').Scope} $rootScope
|
|
4049
4073
|
* @param {*} $animate
|
|
4050
|
-
* @param {import("
|
|
4074
|
+
* @param {import("../../services/exception/exception-handler.js").ErrorHandler} $exceptionHandler
|
|
4051
4075
|
* @param {*} $sce
|
|
4052
4076
|
* @param {import("../../shared/noderef.js").NodeRef} [nodeRef]
|
|
4053
4077
|
* @param {Object} [attributesToCopy]
|
|
@@ -4645,7 +4669,7 @@ class CompileProvider {
|
|
|
4645
4669
|
"$exceptionHandler",
|
|
4646
4670
|
/**
|
|
4647
4671
|
* @param {import("../../core/di/internal-injector.js").InjectorService} $injector
|
|
4648
|
-
* @param {import('
|
|
4672
|
+
* @param {import('../../services/exception/exception-handler.js').ErrorHandler} $exceptionHandler
|
|
4649
4673
|
*/
|
|
4650
4674
|
function ($injector, $exceptionHandler) {
|
|
4651
4675
|
const directives = [];
|
|
@@ -4973,7 +4997,7 @@ class CompileProvider {
|
|
|
4973
4997
|
/**
|
|
4974
4998
|
* @param {import("../../core/di/internal-injector.js").InjectorService} $injector
|
|
4975
4999
|
* @param {*} $interpolate
|
|
4976
|
-
* @param {import("
|
|
5000
|
+
* @param {import("../../services/exception/exception-handler.js").ErrorHandler} $exceptionHandler
|
|
4977
5001
|
* @param {*} $templateRequest
|
|
4978
5002
|
* @param {import("../parse/interface.ts").ParseService} $parse
|
|
4979
5003
|
* @param {*} $controller
|
|
@@ -8458,7 +8482,7 @@ class NgModelController {
|
|
|
8458
8482
|
|
|
8459
8483
|
/**
|
|
8460
8484
|
* @param {import('../../core/scope/scope.js').Scope} $scope
|
|
8461
|
-
* @param {import('../../
|
|
8485
|
+
* @param {import('../../services/exception/exception-handler.js').ErrorHandler} $exceptionHandler
|
|
8462
8486
|
* @param {import('../../core/compile/attributes.js').Attributes} $attr
|
|
8463
8487
|
* @param {Element} $element
|
|
8464
8488
|
* @param {import("../../core/parse/interface.ts").ParseService} $parse
|
|
@@ -9855,7 +9879,6 @@ function createDateInputType(type, regexp, parseDate) {
|
|
|
9855
9879
|
element,
|
|
9856
9880
|
attr,
|
|
9857
9881
|
ctrl,
|
|
9858
|
-
$browser,
|
|
9859
9882
|
$filter,
|
|
9860
9883
|
$parse,
|
|
9861
9884
|
) {
|
|
@@ -10132,15 +10155,7 @@ function isValidForStep(viewValue, stepBase, step) {
|
|
|
10132
10155
|
return (value - stepBase) % step === 0;
|
|
10133
10156
|
}
|
|
10134
10157
|
|
|
10135
|
-
function numberInputType(
|
|
10136
|
-
scope,
|
|
10137
|
-
element,
|
|
10138
|
-
attr,
|
|
10139
|
-
ctrl,
|
|
10140
|
-
$browser,
|
|
10141
|
-
$filter,
|
|
10142
|
-
$parse,
|
|
10143
|
-
) {
|
|
10158
|
+
function numberInputType(scope, element, attr, ctrl, $filter, $parse) {
|
|
10144
10159
|
badInputChecker(scope, element, attr, ctrl, "number");
|
|
10145
10160
|
numberFormatterParser(ctrl);
|
|
10146
10161
|
baseInputType(scope, element, attr, ctrl);
|
|
@@ -10456,15 +10471,7 @@ function parseConstantExpr($parse, context, name, expression, fallback) {
|
|
|
10456
10471
|
return fallback;
|
|
10457
10472
|
}
|
|
10458
10473
|
|
|
10459
|
-
function checkboxInputType(
|
|
10460
|
-
scope,
|
|
10461
|
-
element,
|
|
10462
|
-
attr,
|
|
10463
|
-
ctrl,
|
|
10464
|
-
$browser,
|
|
10465
|
-
$filter,
|
|
10466
|
-
$parse,
|
|
10467
|
-
) {
|
|
10474
|
+
function checkboxInputType(scope, element, attr, ctrl, $filter, $parse) {
|
|
10468
10475
|
const trueValue = parseConstantExpr(
|
|
10469
10476
|
$parse,
|
|
10470
10477
|
scope,
|
|
@@ -10502,30 +10509,25 @@ function checkboxInputType(
|
|
|
10502
10509
|
ctrl.$parsers.push((value) => (value ? trueValue : falseValue));
|
|
10503
10510
|
}
|
|
10504
10511
|
|
|
10505
|
-
|
|
10506
|
-
* @returns {import('../../interface.ts').Directive}
|
|
10507
|
-
*/
|
|
10508
|
-
inputDirective.$inject = ["$browser", "$filter", "$parse"];
|
|
10512
|
+
inputDirective.$inject = ["$filter", "$parse"];
|
|
10509
10513
|
|
|
10510
10514
|
/**
|
|
10511
|
-
* @param {import('../../services/browser').Browser} $browser
|
|
10512
10515
|
* @param {*} $filter
|
|
10513
10516
|
* @param {*} $parse
|
|
10514
|
-
* @returns
|
|
10517
|
+
* @returns {import('../../interface.ts').Directive}
|
|
10515
10518
|
*/
|
|
10516
|
-
function inputDirective($
|
|
10519
|
+
function inputDirective($filter, $parse) {
|
|
10517
10520
|
return {
|
|
10518
10521
|
restrict: "E",
|
|
10519
10522
|
require: ["?ngModel"],
|
|
10520
10523
|
link: {
|
|
10521
10524
|
pre(scope, element, attr, ctrls) {
|
|
10522
10525
|
if (ctrls[0]) {
|
|
10523
|
-
(inputType[lowercase(attr
|
|
10526
|
+
(inputType[lowercase(attr["type"])] || inputType.text)(
|
|
10524
10527
|
scope,
|
|
10525
10528
|
element,
|
|
10526
10529
|
attr,
|
|
10527
10530
|
ctrls[0],
|
|
10528
|
-
$browser,
|
|
10529
10531
|
$filter,
|
|
10530
10532
|
$parse,
|
|
10531
10533
|
);
|
|
@@ -11644,7 +11646,7 @@ ngIncludeDirective.$inject = [
|
|
|
11644
11646
|
* @param {*} $templateRequest
|
|
11645
11647
|
* @param {import("../../services/anchor-scroll.js").AnchorScrollFunction} $anchorScroll
|
|
11646
11648
|
* @param {*} $animate
|
|
11647
|
-
* @param {import('../../
|
|
11649
|
+
* @param {import('../../services/exception/interface.ts').Interface} $exceptionHandler
|
|
11648
11650
|
* @returns {import('../../interface.js').Directive}
|
|
11649
11651
|
*/
|
|
11650
11652
|
function ngIncludeDirective(
|
|
@@ -11763,7 +11765,7 @@ function ngIncludeDirective(
|
|
|
11763
11765
|
// We need this directive so that the element content is already filled when
|
|
11764
11766
|
// the link function of another directive on the same element as ngInclude
|
|
11765
11767
|
// is called.
|
|
11766
|
-
ngIncludeFillContentDirective.$inject = [
|
|
11768
|
+
ngIncludeFillContentDirective.$inject = [$injectTokens.$compile];
|
|
11767
11769
|
|
|
11768
11770
|
/**
|
|
11769
11771
|
* @param {import("../../core/compile/compile.js").CompileFn} $compile
|
|
@@ -12245,6 +12247,7 @@ function ngStyleDirective() {
|
|
|
12245
12247
|
ngSwitchDirective.$inject = ["$animate"];
|
|
12246
12248
|
|
|
12247
12249
|
/**
|
|
12250
|
+
* @param {*} $animate
|
|
12248
12251
|
* @returns {import('../../interface.ts').Directive}
|
|
12249
12252
|
*/
|
|
12250
12253
|
function ngSwitchDirective($animate) {
|
|
@@ -12392,525 +12395,515 @@ const NG_OPTIONS_REGEXP =
|
|
|
12392
12395
|
// 8: collection expression
|
|
12393
12396
|
// 9: track by expression
|
|
12394
12397
|
|
|
12395
|
-
|
|
12396
|
-
|
|
12397
|
-
|
|
12398
|
+
ngOptionsDirective.$inject = ["$compile", "$parse"];
|
|
12399
|
+
/**
|
|
12400
|
+
*
|
|
12401
|
+
* @param {import("../../core/compile/compile.js").CompileFn} $compile
|
|
12402
|
+
* @param {import("../../core/parse/interface.ts").ParseService} $parse
|
|
12403
|
+
* @returns {import("../../interface.ts").Directive}
|
|
12404
|
+
*/
|
|
12405
|
+
function ngOptionsDirective($compile, $parse) {
|
|
12398
12406
|
/**
|
|
12399
|
-
*
|
|
12400
|
-
* @param {
|
|
12401
|
-
* @param {import(
|
|
12407
|
+
* @param {import('../../interface.ts').Expression} optionsExp
|
|
12408
|
+
* @param {HTMLSelectElement} selectElement
|
|
12409
|
+
* @param {import('../../core/scope/scope.js').Scope} scope
|
|
12402
12410
|
* @returns
|
|
12403
12411
|
*/
|
|
12404
|
-
function (
|
|
12405
|
-
|
|
12406
|
-
|
|
12407
|
-
|
|
12408
|
-
|
|
12409
|
-
|
|
12410
|
-
|
|
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
|
-
: function getHashOfValue(value) {
|
|
12448
|
-
return hashKey(value);
|
|
12449
|
-
};
|
|
12450
|
-
const getTrackByValue = function (value, key) {
|
|
12451
|
-
return getTrackByValueFn(value, getLocals(value, key));
|
|
12452
|
-
};
|
|
12412
|
+
function parseOptionsExpression(optionsExp, selectElement, scope) {
|
|
12413
|
+
const match = optionsExp.match(NG_OPTIONS_REGEXP);
|
|
12414
|
+
if (!match) {
|
|
12415
|
+
throw ngOptionsMinErr(
|
|
12416
|
+
"iexp",
|
|
12417
|
+
"Expected expression in form of " +
|
|
12418
|
+
"'_select_ (as _label_)? for (_key_,)?_value_ in _collection_'" +
|
|
12419
|
+
" but got '{0}'. Element: {1}",
|
|
12420
|
+
optionsExp,
|
|
12421
|
+
startingTag(selectElement),
|
|
12422
|
+
);
|
|
12423
|
+
}
|
|
12424
|
+
// Extract the parts from the ngOptions expression
|
|
12425
|
+
|
|
12426
|
+
// The variable name for the value of the item in the collection
|
|
12427
|
+
const valueName = match[5] || match[7];
|
|
12428
|
+
// The variable name for the key of the item in the collection
|
|
12429
|
+
const keyName = match[6];
|
|
12430
|
+
|
|
12431
|
+
// An expression that generates the viewValue for an option if there is a label expression
|
|
12432
|
+
const selectAs = / as /.test(match[0]) && match[1];
|
|
12433
|
+
// An expression that is used to track the id of each object in the options collection
|
|
12434
|
+
const trackBy = match[9];
|
|
12435
|
+
// An expression that generates the viewValue for an option if there is no label expression
|
|
12436
|
+
const valueFn = $parse(match[2] ? match[1] : valueName);
|
|
12437
|
+
const selectAsFn = selectAs && $parse(selectAs);
|
|
12438
|
+
const viewValueFn = selectAsFn || valueFn;
|
|
12439
|
+
const trackByFn = trackBy && $parse(trackBy);
|
|
12440
|
+
|
|
12441
|
+
// Get the value by which we are going to track the option
|
|
12442
|
+
// if we have a trackFn then use that (passing scope and locals)
|
|
12443
|
+
// otherwise just hash the given viewValue
|
|
12444
|
+
const getTrackByValueFn = trackBy
|
|
12445
|
+
? function (value, locals) {
|
|
12446
|
+
return trackByFn(scope, locals);
|
|
12447
|
+
}
|
|
12448
|
+
: function getHashOfValue(value) {
|
|
12449
|
+
return hashKey(value);
|
|
12450
|
+
};
|
|
12451
|
+
const getTrackByValue = function (value, key) {
|
|
12452
|
+
return getTrackByValueFn(value, getLocals(value, key));
|
|
12453
|
+
};
|
|
12453
12454
|
|
|
12454
|
-
|
|
12455
|
-
|
|
12456
|
-
|
|
12457
|
-
|
|
12458
|
-
|
|
12459
|
-
|
|
12460
|
-
|
|
12461
|
-
|
|
12462
|
-
|
|
12463
|
-
|
|
12464
|
-
|
|
12465
|
-
|
|
12466
|
-
|
|
12467
|
-
|
|
12468
|
-
|
|
12469
|
-
|
|
12455
|
+
const displayFn = $parse(match[2] || match[1]);
|
|
12456
|
+
const groupByFn = $parse(match[3] || "");
|
|
12457
|
+
const disableWhenFn = $parse(match[4] || "");
|
|
12458
|
+
const valuesFn = $parse(match[8]);
|
|
12459
|
+
|
|
12460
|
+
const locals = {};
|
|
12461
|
+
let getLocals = keyName
|
|
12462
|
+
? function (value, key) {
|
|
12463
|
+
locals[keyName] = key;
|
|
12464
|
+
locals[valueName] = value;
|
|
12465
|
+
return locals;
|
|
12466
|
+
}
|
|
12467
|
+
: function (value) {
|
|
12468
|
+
locals[valueName] = value;
|
|
12469
|
+
return locals;
|
|
12470
|
+
};
|
|
12470
12471
|
|
|
12471
|
-
|
|
12472
|
-
|
|
12473
|
-
|
|
12474
|
-
|
|
12475
|
-
|
|
12476
|
-
|
|
12477
|
-
|
|
12478
|
-
}
|
|
12472
|
+
class Option {
|
|
12473
|
+
constructor(selectValue, viewValue, label, group, disabled) {
|
|
12474
|
+
this.selectValue = selectValue;
|
|
12475
|
+
this.viewValue = viewValue;
|
|
12476
|
+
this.label = label;
|
|
12477
|
+
this.group = group;
|
|
12478
|
+
this.disabled = disabled;
|
|
12479
12479
|
}
|
|
12480
|
+
}
|
|
12480
12481
|
|
|
12481
|
-
|
|
12482
|
-
|
|
12482
|
+
function getOptionValuesKeys(optionValues) {
|
|
12483
|
+
let optionValuesKeys;
|
|
12483
12484
|
|
|
12484
|
-
|
|
12485
|
-
|
|
12486
|
-
|
|
12487
|
-
|
|
12488
|
-
|
|
12489
|
-
|
|
12490
|
-
|
|
12491
|
-
|
|
12492
|
-
}
|
|
12485
|
+
if (!keyName && isArrayLike(optionValues)) {
|
|
12486
|
+
optionValuesKeys = optionValues;
|
|
12487
|
+
} else {
|
|
12488
|
+
// if object, extract keys, in enumeration order, unsorted
|
|
12489
|
+
optionValuesKeys = [];
|
|
12490
|
+
for (const itemKey in optionValues) {
|
|
12491
|
+
if (hasOwn(optionValues, itemKey) && itemKey.charAt(0) !== "$") {
|
|
12492
|
+
optionValuesKeys.push(itemKey);
|
|
12493
12493
|
}
|
|
12494
12494
|
}
|
|
12495
|
-
return optionValuesKeys;
|
|
12496
12495
|
}
|
|
12496
|
+
return optionValuesKeys;
|
|
12497
|
+
}
|
|
12497
12498
|
|
|
12498
|
-
|
|
12499
|
-
|
|
12500
|
-
|
|
12501
|
-
|
|
12502
|
-
|
|
12503
|
-
|
|
12504
|
-
|
|
12505
|
-
|
|
12506
|
-
|
|
12507
|
-
|
|
12508
|
-
|
|
12509
|
-
|
|
12510
|
-
|
|
12511
|
-
|
|
12512
|
-
|
|
12513
|
-
|
|
12514
|
-
|
|
12515
|
-
|
|
12516
|
-
|
|
12517
|
-
|
|
12518
|
-
|
|
12519
|
-
|
|
12520
|
-
|
|
12521
|
-
// Only need to watch the displayFn if there is a specific label expression
|
|
12522
|
-
if (match[2] || match[1]) {
|
|
12523
|
-
const label = displayFn(scope, locals);
|
|
12524
|
-
watchedArray.push(label);
|
|
12525
|
-
}
|
|
12526
|
-
|
|
12527
|
-
// Only need to watch the disableWhenFn if there is a specific disable expression
|
|
12528
|
-
if (match[4]) {
|
|
12529
|
-
const disableWhen = disableWhenFn(scope, locals);
|
|
12530
|
-
watchedArray.push(disableWhen);
|
|
12531
|
-
}
|
|
12532
|
-
}
|
|
12533
|
-
return watchedArray;
|
|
12534
|
-
}),
|
|
12535
|
-
|
|
12536
|
-
getOptions() {
|
|
12537
|
-
/** @type {Option[]} */
|
|
12538
|
-
const optionItems = [];
|
|
12539
|
-
/** @type {Object.<string, Option>} */
|
|
12540
|
-
const selectValueMap = {};
|
|
12541
|
-
|
|
12542
|
-
// The option values were already computed in the `getWatchables` fn,
|
|
12543
|
-
// which must have been called to trigger `getOptions`
|
|
12544
|
-
const optionValues = valuesFn(scope) || [];
|
|
12545
|
-
const optionValuesKeys = getOptionValuesKeys(optionValues);
|
|
12546
|
-
const optionValuesLength = optionValuesKeys.length;
|
|
12547
|
-
|
|
12548
|
-
for (let index = 0; index < optionValuesLength; index++) {
|
|
12549
|
-
const key =
|
|
12550
|
-
optionValues === optionValuesKeys
|
|
12551
|
-
? index
|
|
12552
|
-
: optionValuesKeys[index];
|
|
12553
|
-
const value = optionValues[key];
|
|
12554
|
-
const locals = getLocals(value, key);
|
|
12555
|
-
const viewValue = viewValueFn(scope, locals);
|
|
12556
|
-
const selectValue = getTrackByValueFn(viewValue, locals);
|
|
12499
|
+
return {
|
|
12500
|
+
trackBy,
|
|
12501
|
+
getTrackByValue,
|
|
12502
|
+
getWatchables: $parse(valuesFn, (optionValues) => {
|
|
12503
|
+
// Create a collection of things that we would like to watch (watchedArray)
|
|
12504
|
+
// so that they can all be watched using a single $watchCollection
|
|
12505
|
+
// that only runs the handler once if anything changes
|
|
12506
|
+
const watchedArray = [];
|
|
12507
|
+
optionValues = optionValues || [];
|
|
12508
|
+
|
|
12509
|
+
const optionValuesKeys = getOptionValuesKeys(optionValues);
|
|
12510
|
+
const optionValuesLength = optionValuesKeys.length;
|
|
12511
|
+
for (let index = 0; index < optionValuesLength; index++) {
|
|
12512
|
+
const key =
|
|
12513
|
+
optionValues === optionValuesKeys ? index : optionValuesKeys[index];
|
|
12514
|
+
const value = optionValues[key];
|
|
12515
|
+
|
|
12516
|
+
const locals = getLocals(value, key);
|
|
12517
|
+
const selectValue = getTrackByValueFn(value, locals);
|
|
12518
|
+
watchedArray.push(selectValue);
|
|
12519
|
+
|
|
12520
|
+
// Only need to watch the displayFn if there is a specific label expression
|
|
12521
|
+
if (match[2] || match[1]) {
|
|
12557
12522
|
const label = displayFn(scope, locals);
|
|
12558
|
-
|
|
12559
|
-
|
|
12560
|
-
|
|
12561
|
-
|
|
12562
|
-
|
|
12563
|
-
|
|
12564
|
-
|
|
12565
|
-
|
|
12566
|
-
|
|
12523
|
+
watchedArray.push(label);
|
|
12524
|
+
}
|
|
12525
|
+
|
|
12526
|
+
// Only need to watch the disableWhenFn if there is a specific disable expression
|
|
12527
|
+
if (match[4]) {
|
|
12528
|
+
const disableWhen = disableWhenFn(scope, locals);
|
|
12529
|
+
watchedArray.push(disableWhen);
|
|
12530
|
+
}
|
|
12531
|
+
}
|
|
12532
|
+
return watchedArray;
|
|
12533
|
+
}),
|
|
12534
|
+
|
|
12535
|
+
getOptions() {
|
|
12536
|
+
/** @type {Option[]} */
|
|
12537
|
+
const optionItems = [];
|
|
12538
|
+
/** @type {Object.<string, Option>} */
|
|
12539
|
+
const selectValueMap = {};
|
|
12540
|
+
|
|
12541
|
+
// The option values were already computed in the `getWatchables` fn,
|
|
12542
|
+
// which must have been called to trigger `getOptions`
|
|
12543
|
+
const optionValues = valuesFn(scope) || [];
|
|
12544
|
+
const optionValuesKeys = getOptionValuesKeys(optionValues);
|
|
12545
|
+
const optionValuesLength = optionValuesKeys.length;
|
|
12546
|
+
|
|
12547
|
+
for (let index = 0; index < optionValuesLength; index++) {
|
|
12548
|
+
const key =
|
|
12549
|
+
optionValues === optionValuesKeys ? index : optionValuesKeys[index];
|
|
12550
|
+
const value = optionValues[key];
|
|
12551
|
+
const locals = getLocals(value, key);
|
|
12552
|
+
const viewValue = viewValueFn(scope, locals);
|
|
12553
|
+
const selectValue = getTrackByValueFn(viewValue, locals);
|
|
12554
|
+
const label = displayFn(scope, locals);
|
|
12555
|
+
const group = groupByFn(scope, locals);
|
|
12556
|
+
const disabled = disableWhenFn(scope, locals);
|
|
12557
|
+
const optionItem = new Option(
|
|
12558
|
+
selectValue,
|
|
12559
|
+
viewValue,
|
|
12560
|
+
label,
|
|
12561
|
+
group,
|
|
12562
|
+
disabled,
|
|
12563
|
+
);
|
|
12567
12564
|
|
|
12568
|
-
|
|
12569
|
-
|
|
12570
|
-
|
|
12565
|
+
optionItems.push(optionItem);
|
|
12566
|
+
selectValueMap[selectValue] = optionItem;
|
|
12567
|
+
}
|
|
12571
12568
|
|
|
12572
|
-
|
|
12573
|
-
|
|
12574
|
-
|
|
12575
|
-
|
|
12576
|
-
|
|
12577
|
-
|
|
12578
|
-
|
|
12579
|
-
|
|
12580
|
-
|
|
12581
|
-
|
|
12582
|
-
|
|
12583
|
-
|
|
12584
|
-
|
|
12585
|
-
|
|
12586
|
-
|
|
12587
|
-
|
|
12588
|
-
|
|
12569
|
+
return {
|
|
12570
|
+
items: optionItems,
|
|
12571
|
+
selectValueMap,
|
|
12572
|
+
getOptionFromViewValue(value) {
|
|
12573
|
+
return selectValueMap[getTrackByValue(value)];
|
|
12574
|
+
},
|
|
12575
|
+
getViewValueFromOption(option) {
|
|
12576
|
+
// If the viewValue could be an object that may be mutated by the application,
|
|
12577
|
+
// we need to make a copy and not return the reference to the value on the option.
|
|
12578
|
+
return trackBy
|
|
12579
|
+
? structuredClone(option.viewValue)
|
|
12580
|
+
: option.viewValue;
|
|
12581
|
+
},
|
|
12582
|
+
};
|
|
12583
|
+
},
|
|
12584
|
+
};
|
|
12585
|
+
}
|
|
12589
12586
|
|
|
12590
|
-
|
|
12591
|
-
|
|
12592
|
-
|
|
12593
|
-
|
|
12594
|
-
|
|
12595
|
-
|
|
12596
|
-
|
|
12597
|
-
|
|
12598
|
-
|
|
12599
|
-
|
|
12600
|
-
|
|
12601
|
-
|
|
12602
|
-
|
|
12603
|
-
|
|
12604
|
-
|
|
12605
|
-
|
|
12606
|
-
|
|
12607
|
-
|
|
12608
|
-
|
|
12609
|
-
|
|
12610
|
-
|
|
12611
|
-
|
|
12612
|
-
|
|
12613
|
-
}
|
|
12587
|
+
/**
|
|
12588
|
+
*
|
|
12589
|
+
* @param {import("../../core/scope/scope.js").Scope} scope
|
|
12590
|
+
* @param {HTMLSelectElement} selectElement
|
|
12591
|
+
* @param {import("../../core/compile/attributes.js").Attributes} attr
|
|
12592
|
+
* @param {*} ctrls
|
|
12593
|
+
*/
|
|
12594
|
+
function ngOptionsPostLink(scope, selectElement, attr, ctrls) {
|
|
12595
|
+
const selectCtrl = ctrls[0];
|
|
12596
|
+
const ngModelCtrl = ctrls[1];
|
|
12597
|
+
const multiple = attr["multiple"];
|
|
12598
|
+
|
|
12599
|
+
// The emptyOption allows the application developer to provide their own custom "empty"
|
|
12600
|
+
// option when the viewValue does not match any of the option values.
|
|
12601
|
+
for (
|
|
12602
|
+
let i = 0, children = selectElement.childNodes, ii = children.length;
|
|
12603
|
+
i < ii;
|
|
12604
|
+
i++
|
|
12605
|
+
) {
|
|
12606
|
+
if (/** @type {HTMLOptionElement} */ (children[i]).value === "") {
|
|
12607
|
+
selectCtrl.hasEmptyOption = true;
|
|
12608
|
+
selectCtrl.emptyOption = children[i];
|
|
12609
|
+
break;
|
|
12614
12610
|
}
|
|
12611
|
+
}
|
|
12615
12612
|
|
|
12616
|
-
|
|
12617
|
-
|
|
12613
|
+
// The empty option will be compiled and rendered before we first generate the options
|
|
12614
|
+
emptyElement(selectElement);
|
|
12618
12615
|
|
|
12619
|
-
|
|
12616
|
+
const providedEmptyOption = !!selectCtrl.emptyOption;
|
|
12620
12617
|
|
|
12621
|
-
|
|
12622
|
-
|
|
12623
|
-
|
|
12618
|
+
const unknownOption = optionTemplate.cloneNode(false);
|
|
12619
|
+
// TODO double check
|
|
12620
|
+
unknownOption.nodeValue = "?";
|
|
12624
12621
|
|
|
12625
|
-
|
|
12626
|
-
|
|
12627
|
-
|
|
12628
|
-
|
|
12629
|
-
|
|
12630
|
-
|
|
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
|
-
selectElement.value = option.selectValue;
|
|
12663
|
-
option.element.selected = true;
|
|
12664
|
-
}
|
|
12622
|
+
let options;
|
|
12623
|
+
const ngOptions = parseOptionsExpression(
|
|
12624
|
+
attr["ngOptions"],
|
|
12625
|
+
selectElement,
|
|
12626
|
+
scope,
|
|
12627
|
+
);
|
|
12628
|
+
// This stores the newly created options before they are appended to the select.
|
|
12629
|
+
// Since the contents are removed from the fragment when it is appended,
|
|
12630
|
+
// we only need to create it once.
|
|
12631
|
+
const listFragment = document.createDocumentFragment();
|
|
12632
|
+
|
|
12633
|
+
// Overwrite the implementation. ngOptions doesn't use hashes
|
|
12634
|
+
selectCtrl.generateUnknownOptionValue = () => "?";
|
|
12635
|
+
|
|
12636
|
+
// Update the controller methods for multiple selectable options
|
|
12637
|
+
if (!multiple) {
|
|
12638
|
+
selectCtrl.writeValue = function writeNgOptionsValue(value) {
|
|
12639
|
+
// The options might not be defined yet when ngModel tries to render
|
|
12640
|
+
if (!options) return;
|
|
12641
|
+
|
|
12642
|
+
const selectedOption =
|
|
12643
|
+
selectElement.options[selectElement.selectedIndex];
|
|
12644
|
+
const option = options.getOptionFromViewValue(value);
|
|
12645
|
+
|
|
12646
|
+
// Make sure to remove the selected attribute from the previously selected option
|
|
12647
|
+
// Otherwise, screen readers might get confused
|
|
12648
|
+
if (selectedOption) selectedOption.removeAttribute("selected");
|
|
12649
|
+
|
|
12650
|
+
if (option) {
|
|
12651
|
+
// Don't update the option when it is already selected.
|
|
12652
|
+
// For example, the browser will select the first option by default. In that case,
|
|
12653
|
+
// most properties are set automatically - except the `selected` attribute, which we
|
|
12654
|
+
// set always
|
|
12655
|
+
|
|
12656
|
+
if (selectElement.value !== option.selectValue) {
|
|
12657
|
+
selectCtrl.removeUnknownOption();
|
|
12665
12658
|
|
|
12666
|
-
option.
|
|
12667
|
-
|
|
12668
|
-
selectCtrl.selectUnknownOrEmptyOption(value);
|
|
12659
|
+
selectElement.value = option.selectValue;
|
|
12660
|
+
option.element.selected = true;
|
|
12669
12661
|
}
|
|
12670
|
-
};
|
|
12671
12662
|
|
|
12672
|
-
|
|
12673
|
-
|
|
12663
|
+
option.element.setAttribute("selected", "selected");
|
|
12664
|
+
} else {
|
|
12665
|
+
selectCtrl.selectUnknownOrEmptyOption(value);
|
|
12666
|
+
}
|
|
12667
|
+
};
|
|
12674
12668
|
|
|
12675
|
-
|
|
12676
|
-
|
|
12677
|
-
selectCtrl.removeUnknownOption();
|
|
12678
|
-
return options.getViewValueFromOption(selectedOption);
|
|
12679
|
-
}
|
|
12680
|
-
return null;
|
|
12681
|
-
};
|
|
12669
|
+
selectCtrl.readValue = function readNgOptionsValue() {
|
|
12670
|
+
const selectedOption = options.selectValueMap[selectElement.value];
|
|
12682
12671
|
|
|
12683
|
-
|
|
12684
|
-
|
|
12685
|
-
|
|
12686
|
-
|
|
12687
|
-
scope.$watch(
|
|
12688
|
-
ngOptions.getTrackByValue(ngModelCtrl.$viewValue),
|
|
12689
|
-
() => {
|
|
12690
|
-
ngModelCtrl.$render();
|
|
12691
|
-
},
|
|
12692
|
-
);
|
|
12672
|
+
if (selectedOption && !selectedOption.disabled) {
|
|
12673
|
+
selectCtrl.unselectEmptyOption();
|
|
12674
|
+
selectCtrl.removeUnknownOption();
|
|
12675
|
+
return options.getViewValueFromOption(selectedOption);
|
|
12693
12676
|
}
|
|
12694
|
-
|
|
12695
|
-
|
|
12696
|
-
// The options might not be defined yet when ngModel tries to render
|
|
12697
|
-
if (!options) return;
|
|
12698
|
-
|
|
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)) || [];
|
|
12703
|
-
|
|
12704
|
-
options.items.forEach((option) => {
|
|
12705
|
-
if (option.element.selected && !includes(selectedOptions, option)) {
|
|
12706
|
-
option.element.selected = false;
|
|
12707
|
-
}
|
|
12708
|
-
});
|
|
12709
|
-
};
|
|
12677
|
+
return null;
|
|
12678
|
+
};
|
|
12710
12679
|
|
|
12711
|
-
|
|
12712
|
-
|
|
12713
|
-
|
|
12714
|
-
|
|
12715
|
-
|
|
12716
|
-
|
|
12717
|
-
|
|
12718
|
-
|
|
12719
|
-
|
|
12680
|
+
// If we are using `track by` then we must watch the tracked value on the model
|
|
12681
|
+
// since ngModel only watches for object identity change
|
|
12682
|
+
// FIXME: When a user selects an option, this watch will fire needlessly
|
|
12683
|
+
if (ngOptions.trackBy) {
|
|
12684
|
+
scope.$watch(ngOptions.getTrackByValue(ngModelCtrl.$viewValue), () => {
|
|
12685
|
+
ngModelCtrl.$render();
|
|
12686
|
+
});
|
|
12687
|
+
}
|
|
12688
|
+
} else {
|
|
12689
|
+
selectCtrl.writeValue = function writeNgOptionsMultiple(values) {
|
|
12690
|
+
// The options might not be defined yet when ngModel tries to render
|
|
12691
|
+
if (!options) return;
|
|
12720
12692
|
|
|
12721
|
-
|
|
12722
|
-
|
|
12693
|
+
// Only set `<option>.selected` if necessary, in order to prevent some browsers from
|
|
12694
|
+
// scrolling to `<option>` elements that are outside the `<select>` element's viewport.
|
|
12695
|
+
const selectedOptions =
|
|
12696
|
+
(values && values.map(getAndUpdateSelectedOption)) || [];
|
|
12723
12697
|
|
|
12724
|
-
|
|
12725
|
-
|
|
12726
|
-
|
|
12727
|
-
|
|
12728
|
-
|
|
12729
|
-
|
|
12730
|
-
// return ngModelCtrl.$viewValue.map((value) =>
|
|
12731
|
-
// ngOptions.getTrackByValue(value),
|
|
12732
|
-
// );
|
|
12733
|
-
// }
|
|
12734
|
-
// },
|
|
12735
|
-
// () => {
|
|
12736
|
-
// ngModelCtrl.$render();
|
|
12737
|
-
// },
|
|
12738
|
-
// );
|
|
12739
|
-
// }
|
|
12740
|
-
}
|
|
12698
|
+
options.items.forEach((option) => {
|
|
12699
|
+
if (option.element.selected && !includes(selectedOptions, option)) {
|
|
12700
|
+
option.element.selected = false;
|
|
12701
|
+
}
|
|
12702
|
+
});
|
|
12703
|
+
};
|
|
12741
12704
|
|
|
12742
|
-
|
|
12743
|
-
|
|
12744
|
-
const
|
|
12745
|
-
|
|
12746
|
-
|
|
12747
|
-
|
|
12705
|
+
selectCtrl.readValue = function readNgOptionsMultiple() {
|
|
12706
|
+
const selectedValues = selectElement.value || [];
|
|
12707
|
+
const selections = [];
|
|
12708
|
+
// @ts-ignore
|
|
12709
|
+
selectedValues.forEach((value) => {
|
|
12710
|
+
const option = options.selectValueMap[value];
|
|
12711
|
+
if (option && !option.disabled)
|
|
12712
|
+
selections.push(options.getViewValueFromOption(option));
|
|
12713
|
+
});
|
|
12748
12714
|
|
|
12749
|
-
|
|
12750
|
-
|
|
12751
|
-
// it has been modified by a transclusion directive.
|
|
12752
|
-
selectCtrl.hasEmptyOption = false;
|
|
12715
|
+
return selections;
|
|
12716
|
+
};
|
|
12753
12717
|
|
|
12754
|
-
|
|
12755
|
-
|
|
12756
|
-
|
|
12757
|
-
|
|
12758
|
-
|
|
12759
|
-
|
|
12760
|
-
|
|
12761
|
-
|
|
12762
|
-
|
|
12718
|
+
// If we are using `track by` then we must watch these tracked values on the model
|
|
12719
|
+
// since ngModel only watches for object identity change
|
|
12720
|
+
// if (ngOptions.trackBy) {
|
|
12721
|
+
// scope.$watchCollection(
|
|
12722
|
+
// () => {
|
|
12723
|
+
// if (Array.isArray(ngModelCtrl.$viewValue)) {
|
|
12724
|
+
// return ngModelCtrl.$viewValue.map((value) =>
|
|
12725
|
+
// ngOptions.getTrackByValue(value),
|
|
12726
|
+
// );
|
|
12727
|
+
// }
|
|
12728
|
+
// },
|
|
12729
|
+
// () => {
|
|
12730
|
+
// ngModelCtrl.$render();
|
|
12731
|
+
// },
|
|
12732
|
+
// );
|
|
12733
|
+
// }
|
|
12734
|
+
}
|
|
12763
12735
|
|
|
12764
|
-
|
|
12765
|
-
|
|
12736
|
+
if (providedEmptyOption) {
|
|
12737
|
+
// compile the element since there might be bindings in it
|
|
12738
|
+
const linkFn = $compile(selectCtrl.emptyOption);
|
|
12739
|
+
assertArg$1(linkFn, "LinkFn required");
|
|
12740
|
+
selectElement.prepend(selectCtrl.emptyOption);
|
|
12741
|
+
linkFn(scope);
|
|
12742
|
+
|
|
12743
|
+
if (selectCtrl.emptyOption.nodeType === Node.COMMENT_NODE) {
|
|
12744
|
+
// This means the empty option has currently no actual DOM node, probably because
|
|
12745
|
+
// it has been modified by a transclusion directive.
|
|
12746
|
+
selectCtrl.hasEmptyOption = false;
|
|
12747
|
+
|
|
12748
|
+
// Redefine the registerOption function, which will catch
|
|
12749
|
+
// options that are added by ngIf etc. (rendering of the node is async because of
|
|
12750
|
+
// lazy transclusion)
|
|
12751
|
+
selectCtrl.registerOption = function (optionScope, optionEl) {
|
|
12752
|
+
if (optionEl.value === "") {
|
|
12753
|
+
selectCtrl.hasEmptyOption = true;
|
|
12754
|
+
selectCtrl.emptyOption = optionEl;
|
|
12755
|
+
// This ensures the new empty option is selected if previously no option was selected
|
|
12756
|
+
ngModelCtrl.$render();
|
|
12766
12757
|
|
|
12767
|
-
|
|
12768
|
-
|
|
12758
|
+
optionEl.addEventListener("$destroy", () => {
|
|
12759
|
+
const needsRerender = selectCtrl.$isEmptyOptionSelected();
|
|
12769
12760
|
|
|
12770
|
-
|
|
12771
|
-
|
|
12772
|
-
|
|
12773
|
-
|
|
12774
|
-
|
|
12761
|
+
selectCtrl.hasEmptyOption = false;
|
|
12762
|
+
selectCtrl.emptyOption = undefined;
|
|
12763
|
+
|
|
12764
|
+
if (needsRerender) ngModelCtrl.$render();
|
|
12765
|
+
});
|
|
12766
|
+
}
|
|
12767
|
+
};
|
|
12775
12768
|
}
|
|
12769
|
+
}
|
|
12776
12770
|
|
|
12777
|
-
|
|
12771
|
+
// We will re-render the option elements if the option values or labels change
|
|
12778
12772
|
|
|
12779
|
-
|
|
12780
|
-
|
|
12781
|
-
|
|
12782
|
-
|
|
12783
|
-
|
|
12784
|
-
|
|
12785
|
-
|
|
12786
|
-
|
|
12773
|
+
// let watchables = ngOptions.getWatchables();
|
|
12774
|
+
// watchables.forEach((i) => {
|
|
12775
|
+
// scope.$watch(i, updateOptions);
|
|
12776
|
+
// });
|
|
12777
|
+
scope.$watch(
|
|
12778
|
+
ngOptions.getWatchables.decoratedNode.body[0].expression.name,
|
|
12779
|
+
updateOptions,
|
|
12780
|
+
);
|
|
12787
12781
|
|
|
12788
|
-
|
|
12782
|
+
// ------------------------------------------------------------------ //
|
|
12789
12783
|
|
|
12790
|
-
|
|
12791
|
-
|
|
12792
|
-
|
|
12793
|
-
|
|
12794
|
-
|
|
12795
|
-
|
|
12796
|
-
|
|
12797
|
-
|
|
12798
|
-
|
|
12799
|
-
|
|
12784
|
+
function addOptionElement(option, parent) {
|
|
12785
|
+
/**
|
|
12786
|
+
* @type {HTMLOptionElement}
|
|
12787
|
+
*/
|
|
12788
|
+
const optionElement = /** @type {HTMLOptionElement} */ (
|
|
12789
|
+
optionTemplate.cloneNode(false)
|
|
12790
|
+
);
|
|
12791
|
+
parent.appendChild(optionElement);
|
|
12792
|
+
updateOptionElement(option, optionElement);
|
|
12793
|
+
}
|
|
12800
12794
|
|
|
12801
|
-
|
|
12802
|
-
|
|
12803
|
-
|
|
12795
|
+
function getAndUpdateSelectedOption(viewValue) {
|
|
12796
|
+
const option = options.getOptionFromViewValue(viewValue);
|
|
12797
|
+
const element = option && option.element;
|
|
12804
12798
|
|
|
12805
|
-
|
|
12799
|
+
if (element && !element.selected) element.selected = true;
|
|
12806
12800
|
|
|
12807
|
-
|
|
12808
|
-
|
|
12801
|
+
return option;
|
|
12802
|
+
}
|
|
12809
12803
|
|
|
12810
|
-
|
|
12811
|
-
|
|
12812
|
-
|
|
12813
|
-
|
|
12814
|
-
|
|
12815
|
-
|
|
12816
|
-
|
|
12817
|
-
|
|
12818
|
-
|
|
12819
|
-
|
|
12820
|
-
|
|
12821
|
-
|
|
12822
|
-
}
|
|
12823
|
-
element.value = option.selectValue;
|
|
12804
|
+
function updateOptionElement(option, element) {
|
|
12805
|
+
option.element = element;
|
|
12806
|
+
element.disabled = option.disabled;
|
|
12807
|
+
// Support: IE 11 only, Edge 12-13 only
|
|
12808
|
+
// NOTE: The label must be set before the value, otherwise IE 11 & Edge create unresponsive
|
|
12809
|
+
// selects in certain circumstances when multiple selects are next to each other and display
|
|
12810
|
+
// the option list in listbox style, i.e. the select is [multiple], or specifies a [size].
|
|
12811
|
+
// See https://github.com/angular/angular.js/issues/11314 for more info.
|
|
12812
|
+
// This is unfortunately untestable with unit / e2e tests
|
|
12813
|
+
if (option.label !== element.label) {
|
|
12814
|
+
element.label = option.label;
|
|
12815
|
+
element.textContent = option.label;
|
|
12824
12816
|
}
|
|
12817
|
+
element.value = option.selectValue;
|
|
12818
|
+
}
|
|
12825
12819
|
|
|
12826
|
-
|
|
12827
|
-
|
|
12820
|
+
function updateOptions() {
|
|
12821
|
+
const previousValue = options && selectCtrl.readValue();
|
|
12828
12822
|
|
|
12829
|
-
|
|
12830
|
-
|
|
12831
|
-
|
|
12832
|
-
|
|
12833
|
-
|
|
12834
|
-
|
|
12835
|
-
|
|
12836
|
-
|
|
12837
|
-
|
|
12838
|
-
|
|
12839
|
-
|
|
12840
|
-
|
|
12841
|
-
}
|
|
12823
|
+
// We must remove all current options, but cannot simply set innerHTML = null
|
|
12824
|
+
// since the providedEmptyOption might have an ngIf on it that inserts comments which we
|
|
12825
|
+
// must preserve.
|
|
12826
|
+
// Instead, iterate over the current option elements and remove them or their optgroup
|
|
12827
|
+
// parents
|
|
12828
|
+
if (options) {
|
|
12829
|
+
for (let i = options.items.length - 1; i >= 0; i--) {
|
|
12830
|
+
const option = options.items[i];
|
|
12831
|
+
if (isDefined(option.group)) {
|
|
12832
|
+
removeElement(option.element.parentNode);
|
|
12833
|
+
} else {
|
|
12834
|
+
removeElement(option.element);
|
|
12842
12835
|
}
|
|
12843
12836
|
}
|
|
12837
|
+
}
|
|
12844
12838
|
|
|
12845
|
-
|
|
12839
|
+
options = ngOptions.getOptions();
|
|
12846
12840
|
|
|
12847
|
-
|
|
12841
|
+
const groupElementMap = {};
|
|
12848
12842
|
|
|
12849
|
-
|
|
12850
|
-
|
|
12843
|
+
options.items.forEach((option) => {
|
|
12844
|
+
let groupElement;
|
|
12851
12845
|
|
|
12852
|
-
|
|
12853
|
-
|
|
12854
|
-
|
|
12855
|
-
|
|
12856
|
-
|
|
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;
|
|
12869
|
-
}
|
|
12846
|
+
if (isDefined(option.group)) {
|
|
12847
|
+
// This option is to live in a group
|
|
12848
|
+
// See if we have already created this group
|
|
12849
|
+
groupElement = groupElementMap[option.group];
|
|
12870
12850
|
|
|
12871
|
-
|
|
12872
|
-
|
|
12873
|
-
|
|
12874
|
-
|
|
12851
|
+
if (!groupElement) {
|
|
12852
|
+
groupElement = optGroupTemplate.cloneNode(false);
|
|
12853
|
+
listFragment.appendChild(groupElement);
|
|
12854
|
+
|
|
12855
|
+
// Update the label on the group element
|
|
12856
|
+
// "null" is special cased because of Safari
|
|
12857
|
+
/** @type {HTMLOptGroupElement} */
|
|
12858
|
+
(groupElement).label =
|
|
12859
|
+
option.group === null ? "null" : option.group;
|
|
12860
|
+
|
|
12861
|
+
// Store it for use later
|
|
12862
|
+
groupElementMap[option.group] = groupElement;
|
|
12875
12863
|
}
|
|
12876
|
-
});
|
|
12877
12864
|
|
|
12878
|
-
|
|
12865
|
+
addOptionElement(option, groupElement);
|
|
12866
|
+
} else {
|
|
12867
|
+
// This option is not in a group
|
|
12868
|
+
addOptionElement(option, listFragment);
|
|
12869
|
+
}
|
|
12870
|
+
});
|
|
12879
12871
|
|
|
12880
|
-
|
|
12872
|
+
selectElement.appendChild(listFragment);
|
|
12881
12873
|
|
|
12882
|
-
|
|
12883
|
-
|
|
12884
|
-
|
|
12885
|
-
|
|
12886
|
-
|
|
12887
|
-
|
|
12888
|
-
|
|
12889
|
-
|
|
12890
|
-
|
|
12891
|
-
|
|
12892
|
-
|
|
12893
|
-
|
|
12874
|
+
ngModelCtrl.$render();
|
|
12875
|
+
|
|
12876
|
+
// Check to see if the value has changed due to the update to the options
|
|
12877
|
+
if (!ngModelCtrl.$isEmpty(previousValue)) {
|
|
12878
|
+
const nextValue = selectCtrl.readValue();
|
|
12879
|
+
const isNotPrimitive = ngOptions.trackBy || multiple;
|
|
12880
|
+
if (
|
|
12881
|
+
isNotPrimitive
|
|
12882
|
+
? !equals$1(previousValue, nextValue)
|
|
12883
|
+
: previousValue !== nextValue
|
|
12884
|
+
) {
|
|
12885
|
+
ngModelCtrl.$setViewValue(nextValue);
|
|
12886
|
+
ngModelCtrl.$render();
|
|
12894
12887
|
}
|
|
12895
12888
|
}
|
|
12896
12889
|
}
|
|
12890
|
+
}
|
|
12897
12891
|
|
|
12898
|
-
|
|
12899
|
-
|
|
12900
|
-
|
|
12901
|
-
|
|
12902
|
-
|
|
12903
|
-
|
|
12904
|
-
|
|
12905
|
-
|
|
12906
|
-
|
|
12907
|
-
|
|
12908
|
-
},
|
|
12909
|
-
post: ngOptionsPostLink,
|
|
12892
|
+
return {
|
|
12893
|
+
restrict: "A",
|
|
12894
|
+
terminal: true,
|
|
12895
|
+
require: ["select", "ngModel"],
|
|
12896
|
+
link: {
|
|
12897
|
+
pre: function ngOptionsPreLink(scope, selectElement, attr, ctrls) {
|
|
12898
|
+
// Deactivate the SelectController.register method to prevent
|
|
12899
|
+
// option directives from accidentally registering themselves
|
|
12900
|
+
// (and unwanted $destroy handlers etc.)
|
|
12901
|
+
ctrls[0].registerOption = () => {};
|
|
12910
12902
|
},
|
|
12911
|
-
|
|
12912
|
-
|
|
12913
|
-
|
|
12903
|
+
post: ngOptionsPostLink,
|
|
12904
|
+
},
|
|
12905
|
+
};
|
|
12906
|
+
}
|
|
12914
12907
|
|
|
12915
12908
|
/**
|
|
12916
12909
|
* Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion.
|
|
@@ -12929,113 +12922,114 @@ const ngOptionsDirective = [
|
|
|
12929
12922
|
* or its value is the same as the name of the attribute then the default slot is used.
|
|
12930
12923
|
*/
|
|
12931
12924
|
const ngTranscludeMinErr = minErr("ngTransclude");
|
|
12932
|
-
const ngTranscludeDirective = [
|
|
12933
|
-
"$compile",
|
|
12934
12925
|
|
|
12935
|
-
|
|
12936
|
-
|
|
12937
|
-
|
|
12938
|
-
|
|
12939
|
-
|
|
12940
|
-
|
|
12941
|
-
|
|
12942
|
-
|
|
12943
|
-
|
|
12944
|
-
|
|
12926
|
+
ngTranscludeDirective.$inject = ["$compile"];
|
|
12927
|
+
/**
|
|
12928
|
+
* @param {import("../../core/compile/compile.js").CompileFn} $compile
|
|
12929
|
+
* @returns {import("../../interface.ts").Directive}
|
|
12930
|
+
*/
|
|
12931
|
+
function ngTranscludeDirective($compile) {
|
|
12932
|
+
return {
|
|
12933
|
+
compile: function ngTranscludeCompile(tElement) {
|
|
12934
|
+
// Remove and cache any original content to act as a fallback
|
|
12935
|
+
const fallbackLinkFn = $compile(tElement.childNodes);
|
|
12936
|
+
emptyElement(tElement);
|
|
12945
12937
|
|
|
12946
|
-
|
|
12947
|
-
|
|
12948
|
-
|
|
12949
|
-
|
|
12950
|
-
|
|
12951
|
-
|
|
12952
|
-
|
|
12953
|
-
|
|
12954
|
-
|
|
12955
|
-
|
|
12956
|
-
|
|
12957
|
-
|
|
12958
|
-
|
|
12959
|
-
|
|
12960
|
-
|
|
12961
|
-
|
|
12962
|
-
|
|
12963
|
-
|
|
12964
|
-
|
|
12965
|
-
|
|
12966
|
-
|
|
12967
|
-
|
|
12968
|
-
|
|
12969
|
-
|
|
12938
|
+
/**
|
|
12939
|
+
*
|
|
12940
|
+
* @param {import("../../core/scope/scope.js").Scope} $scope
|
|
12941
|
+
* @param {Element} $element
|
|
12942
|
+
* @param {import("../../core/compile/attributes.js").Attributes} $attrs
|
|
12943
|
+
* @param {*} _controller
|
|
12944
|
+
* @param {*} $transclude
|
|
12945
|
+
*/
|
|
12946
|
+
function ngTranscludePostLink(
|
|
12947
|
+
$scope,
|
|
12948
|
+
$element,
|
|
12949
|
+
$attrs,
|
|
12950
|
+
_controller,
|
|
12951
|
+
$transclude,
|
|
12952
|
+
) {
|
|
12953
|
+
if (!$transclude) {
|
|
12954
|
+
throw ngTranscludeMinErr(
|
|
12955
|
+
"orphan",
|
|
12956
|
+
"Illegal use of ngTransclude directive in the template! " +
|
|
12957
|
+
"No parent directive that requires a transclusion found. " +
|
|
12958
|
+
"Element: {0}",
|
|
12959
|
+
startingTag($element),
|
|
12960
|
+
);
|
|
12961
|
+
}
|
|
12970
12962
|
|
|
12971
|
-
|
|
12972
|
-
|
|
12973
|
-
|
|
12974
|
-
|
|
12975
|
-
|
|
12963
|
+
// If the attribute is of the form: `ng-transclude="ng-transclude"` then treat it like the default
|
|
12964
|
+
if ($attrs["ngTransclude"] === $attrs.$attr.ngTransclude) {
|
|
12965
|
+
$attrs["ngTransclude"] = "";
|
|
12966
|
+
}
|
|
12967
|
+
const slotName = $attrs["ngTransclude"] || $attrs["ngTranscludeSlot"];
|
|
12976
12968
|
|
|
12977
|
-
|
|
12978
|
-
|
|
12969
|
+
// If the slot is required and no transclusion content is provided then this call will throw an error
|
|
12970
|
+
$transclude(ngTranscludeCloneAttachFn, null, slotName);
|
|
12979
12971
|
|
|
12980
|
-
|
|
12981
|
-
|
|
12982
|
-
|
|
12983
|
-
|
|
12972
|
+
// If the slot is optional and no transclusion content is provided then use the fallback content
|
|
12973
|
+
if (slotName && !$transclude.isSlotFilled(slotName)) {
|
|
12974
|
+
useFallbackContent();
|
|
12975
|
+
}
|
|
12984
12976
|
|
|
12985
|
-
|
|
12986
|
-
|
|
12987
|
-
|
|
12988
|
-
|
|
12989
|
-
|
|
12990
|
-
|
|
12991
|
-
|
|
12992
|
-
|
|
12993
|
-
|
|
12994
|
-
|
|
12995
|
-
} else {
|
|
12996
|
-
$element.append(/** @type {Node} */ (clone));
|
|
12997
|
-
}
|
|
12977
|
+
/**
|
|
12978
|
+
* @param {NodeList | Node} clone
|
|
12979
|
+
* @param {import("../../core/scope/scope.js").Scope} transcludedScope
|
|
12980
|
+
*/
|
|
12981
|
+
function ngTranscludeCloneAttachFn(clone, transcludedScope) {
|
|
12982
|
+
if (notWhitespace(clone)) {
|
|
12983
|
+
if (clone instanceof NodeList) {
|
|
12984
|
+
Array.from(clone).forEach((el) => {
|
|
12985
|
+
$element.append(el);
|
|
12986
|
+
});
|
|
12998
12987
|
} else {
|
|
12999
|
-
|
|
13000
|
-
// There is nothing linked against the transcluded scope since no content was available,
|
|
13001
|
-
// so it should be safe to clean up the generated scope.
|
|
13002
|
-
transcludedScope.$destroy();
|
|
12988
|
+
$element.append(/** @type {Node} */ (clone));
|
|
13003
12989
|
}
|
|
12990
|
+
} else {
|
|
12991
|
+
useFallbackContent();
|
|
12992
|
+
// There is nothing linked against the transcluded scope since no content was available,
|
|
12993
|
+
// so it should be safe to clean up the generated scope.
|
|
12994
|
+
transcludedScope.$destroy();
|
|
13004
12995
|
}
|
|
12996
|
+
}
|
|
13005
12997
|
|
|
13006
|
-
|
|
13007
|
-
|
|
13008
|
-
|
|
13009
|
-
|
|
13010
|
-
|
|
12998
|
+
function useFallbackContent() {
|
|
12999
|
+
// Since this is the fallback content rather than the transcluded content,
|
|
13000
|
+
// we link against the scope of this directive rather than the transcluded scope
|
|
13001
|
+
fallbackLinkFn(
|
|
13002
|
+
$scope,
|
|
13011
13003
|
|
|
13012
|
-
|
|
13013
|
-
|
|
13014
|
-
|
|
13015
|
-
|
|
13016
|
-
|
|
13017
|
-
|
|
13004
|
+
(clone) => {
|
|
13005
|
+
// @ts-ignore
|
|
13006
|
+
$element.append(clone);
|
|
13007
|
+
},
|
|
13008
|
+
);
|
|
13009
|
+
}
|
|
13018
13010
|
|
|
13019
|
-
|
|
13020
|
-
|
|
13021
|
-
|
|
13022
|
-
|
|
13023
|
-
|
|
13024
|
-
|
|
13025
|
-
|
|
13026
|
-
|
|
13027
|
-
}
|
|
13011
|
+
function notWhitespace(node) {
|
|
13012
|
+
if (node instanceof Array) {
|
|
13013
|
+
return false;
|
|
13014
|
+
} else if (
|
|
13015
|
+
node.nodeType !== Node.TEXT_NODE ||
|
|
13016
|
+
node.nodeValue.trim()
|
|
13017
|
+
) {
|
|
13018
|
+
return true;
|
|
13028
13019
|
}
|
|
13029
13020
|
}
|
|
13021
|
+
}
|
|
13030
13022
|
|
|
13031
|
-
|
|
13032
|
-
|
|
13033
|
-
|
|
13034
|
-
|
|
13035
|
-
];
|
|
13023
|
+
return ngTranscludePostLink;
|
|
13024
|
+
},
|
|
13025
|
+
};
|
|
13026
|
+
}
|
|
13036
13027
|
|
|
13037
13028
|
const REGEX_STRING_REGEXP = /^\/(.+)\/([a-z]*)$/;
|
|
13038
13029
|
|
|
13030
|
+
/**
|
|
13031
|
+
* @type {Record<string, import("../../interface.js").DirectiveFactory>}
|
|
13032
|
+
*/
|
|
13039
13033
|
const ngAttributeAliasDirectives = {};
|
|
13040
13034
|
|
|
13041
13035
|
// boolean attrs are evaluated
|
|
@@ -13078,10 +13072,10 @@ Object.entries(ALIASED_ATTR).forEach(([ngAttr]) => {
|
|
|
13078
13072
|
link(scope, element, attr) {
|
|
13079
13073
|
// special case ngPattern when a literal regular expression value
|
|
13080
13074
|
// is used as the expression (this way we don't have to watch anything).
|
|
13081
|
-
if (ngAttr === "ngPattern" && attr
|
|
13082
|
-
const match = attr
|
|
13075
|
+
if (ngAttr === "ngPattern" && attr["ngPattern"].charAt(0) === "/") {
|
|
13076
|
+
const match = attr["ngPattern"].match(REGEX_STRING_REGEXP);
|
|
13083
13077
|
if (match) {
|
|
13084
|
-
attr.$set("ngPattern", new RegExp(match[1], match[2]));
|
|
13078
|
+
attr.$set("ngPattern", new RegExp(match[1], match[2]).toString());
|
|
13085
13079
|
return;
|
|
13086
13080
|
}
|
|
13087
13081
|
}
|
|
@@ -13107,7 +13101,7 @@ Object.entries(ALIASED_ATTR).forEach(([ngAttr]) => {
|
|
|
13107
13101
|
|
|
13108
13102
|
if (
|
|
13109
13103
|
attrName === "href" &&
|
|
13110
|
-
toString.call(element
|
|
13104
|
+
toString.call(element["href"]) === "[object SVGAnimatedString]"
|
|
13111
13105
|
) {
|
|
13112
13106
|
name = "xlinkHref";
|
|
13113
13107
|
attr.$attr[name] = "href";
|
|
@@ -13493,7 +13487,7 @@ class AnchorScrollProvider {
|
|
|
13493
13487
|
"$rootScope",
|
|
13494
13488
|
/**
|
|
13495
13489
|
*
|
|
13496
|
-
* @param {import('../
|
|
13490
|
+
* @param {import('../services/location/location.js').Location} $location
|
|
13497
13491
|
* @param {import('../core/scope/scope.js').Scope} $rootScope
|
|
13498
13492
|
* @returns
|
|
13499
13493
|
*/
|
|
@@ -14511,216 +14505,6 @@ function AnimateProvider($provide) {
|
|
|
14511
14505
|
];
|
|
14512
14506
|
}
|
|
14513
14507
|
|
|
14514
|
-
/**
|
|
14515
|
-
* Removes a trailing hash ('#') from the given URL if it exists.
|
|
14516
|
-
*
|
|
14517
|
-
* @param {string} url
|
|
14518
|
-
* @returns {string}
|
|
14519
|
-
*/
|
|
14520
|
-
function trimEmptyHash(url) {
|
|
14521
|
-
return url.replace(/#$/, "");
|
|
14522
|
-
}
|
|
14523
|
-
|
|
14524
|
-
/**
|
|
14525
|
-
* @typedef {function(string, string|null): any} UrlChangeListener
|
|
14526
|
-
*/
|
|
14527
|
-
|
|
14528
|
-
/**
|
|
14529
|
-
* This object has two goals:
|
|
14530
|
-
*
|
|
14531
|
-
* - hide all the global state in the browser caused by the window object
|
|
14532
|
-
* - abstract away all the browser specific features and inconsistencies
|
|
14533
|
-
*/
|
|
14534
|
-
class Browser {
|
|
14535
|
-
/**
|
|
14536
|
-
* @param {import('../core/task-tracker-factory.js').TaskTracker} taskTracker
|
|
14537
|
-
*/
|
|
14538
|
-
constructor(taskTracker) {
|
|
14539
|
-
/**
|
|
14540
|
-
* @type {import('../core/task-tracker-factory.js').TaskTracker} taskTracker
|
|
14541
|
-
*/
|
|
14542
|
-
this.taskTracker = taskTracker;
|
|
14543
|
-
this.pendingDeferIds = {};
|
|
14544
|
-
/** @type {Array<UrlChangeListener>} */
|
|
14545
|
-
this.urlChangeListeners = [];
|
|
14546
|
-
this.urlChangeInit = false;
|
|
14547
|
-
|
|
14548
|
-
/** @type {any} */
|
|
14549
|
-
this.cachedState = null;
|
|
14550
|
-
/** @type {any} */
|
|
14551
|
-
this.lastHistoryState = null;
|
|
14552
|
-
/** @type {string} */
|
|
14553
|
-
this.lastBrowserUrl = window.location.href;
|
|
14554
|
-
/** @type {HTMLBaseElement | null} */
|
|
14555
|
-
this.baseElement = document.querySelector("base");
|
|
14556
|
-
|
|
14557
|
-
// Task-tracking API
|
|
14558
|
-
this.$$completeOutstandingRequest =
|
|
14559
|
-
this.taskTracker.completeTask.bind(taskTracker);
|
|
14560
|
-
this.$$incOutstandingRequestCount =
|
|
14561
|
-
this.taskTracker.incTaskCount.bind(taskTracker);
|
|
14562
|
-
this.notifyWhenNoOutstandingRequests =
|
|
14563
|
-
this.taskTracker.notifyWhenNoPendingTasks.bind(taskTracker);
|
|
14564
|
-
|
|
14565
|
-
this.cacheState();
|
|
14566
|
-
}
|
|
14567
|
-
|
|
14568
|
-
/// ///////////////////////////////////////////////////////////
|
|
14569
|
-
// URL API
|
|
14570
|
-
/// ///////////////////////////////////////////////////////////
|
|
14571
|
-
|
|
14572
|
-
url(url, state) {
|
|
14573
|
-
if (state === undefined) {
|
|
14574
|
-
state = null;
|
|
14575
|
-
}
|
|
14576
|
-
|
|
14577
|
-
// setter
|
|
14578
|
-
if (url) {
|
|
14579
|
-
url = urlResolve(url).href;
|
|
14580
|
-
|
|
14581
|
-
if (this.lastBrowserUrl === url && this.lastHistoryState === state) {
|
|
14582
|
-
return this;
|
|
14583
|
-
}
|
|
14584
|
-
|
|
14585
|
-
this.lastBrowserUrl = url;
|
|
14586
|
-
this.lastHistoryState = state;
|
|
14587
|
-
history.pushState(state, "", url);
|
|
14588
|
-
this.cacheState();
|
|
14589
|
-
return this;
|
|
14590
|
-
}
|
|
14591
|
-
|
|
14592
|
-
// getter
|
|
14593
|
-
return trimEmptyHash(window.location.href);
|
|
14594
|
-
}
|
|
14595
|
-
|
|
14596
|
-
/**
|
|
14597
|
-
* Returns the cached state.
|
|
14598
|
-
*
|
|
14599
|
-
* @returns {any} The cached state.
|
|
14600
|
-
*/
|
|
14601
|
-
state() {
|
|
14602
|
-
return this.cachedState;
|
|
14603
|
-
}
|
|
14604
|
-
|
|
14605
|
-
/**
|
|
14606
|
-
* Caches the current state and fires the URL change event.
|
|
14607
|
-
*
|
|
14608
|
-
* @private
|
|
14609
|
-
*/
|
|
14610
|
-
cacheStateAndFireUrlChange() {
|
|
14611
|
-
this.fireStateOrUrlChange();
|
|
14612
|
-
}
|
|
14613
|
-
|
|
14614
|
-
/**
|
|
14615
|
-
* Caches the current state.
|
|
14616
|
-
*
|
|
14617
|
-
* @private
|
|
14618
|
-
*/
|
|
14619
|
-
cacheState() {
|
|
14620
|
-
const currentState = history.state ?? null;
|
|
14621
|
-
if (!equals$1(currentState, this.lastCachedState)) {
|
|
14622
|
-
this.cachedState = currentState;
|
|
14623
|
-
this.lastCachedState = currentState;
|
|
14624
|
-
this.lastHistoryState = currentState;
|
|
14625
|
-
}
|
|
14626
|
-
}
|
|
14627
|
-
|
|
14628
|
-
/**
|
|
14629
|
-
* Fires the state or URL change event.
|
|
14630
|
-
*
|
|
14631
|
-
* @private
|
|
14632
|
-
*/
|
|
14633
|
-
fireStateOrUrlChange() {
|
|
14634
|
-
const prevLastHistoryState = this.lastHistoryState;
|
|
14635
|
-
this.cacheState();
|
|
14636
|
-
|
|
14637
|
-
if (
|
|
14638
|
-
this.lastBrowserUrl === this.url() &&
|
|
14639
|
-
prevLastHistoryState === this.cachedState
|
|
14640
|
-
) {
|
|
14641
|
-
return;
|
|
14642
|
-
}
|
|
14643
|
-
|
|
14644
|
-
this.lastBrowserUrl = /** @type {string} */ (this.url());
|
|
14645
|
-
this.lastHistoryState = this.cachedState;
|
|
14646
|
-
this.urlChangeListeners.forEach((listener) => {
|
|
14647
|
-
listener(trimEmptyHash(window.location.href), this.cachedState);
|
|
14648
|
-
});
|
|
14649
|
-
}
|
|
14650
|
-
|
|
14651
|
-
/**
|
|
14652
|
-
* Registers a callback to be called when the URL changes.
|
|
14653
|
-
*
|
|
14654
|
-
* @param {UrlChangeListener} callback - The callback function to register.
|
|
14655
|
-
* @returns {UrlChangeListener} The registered callback function.
|
|
14656
|
-
*/
|
|
14657
|
-
onUrlChange(callback) {
|
|
14658
|
-
if (!this.urlChangeInit) {
|
|
14659
|
-
window.addEventListener(
|
|
14660
|
-
"popstate",
|
|
14661
|
-
this.cacheStateAndFireUrlChange.bind(this),
|
|
14662
|
-
);
|
|
14663
|
-
window.addEventListener(
|
|
14664
|
-
"hashchange",
|
|
14665
|
-
this.cacheStateAndFireUrlChange.bind(this),
|
|
14666
|
-
);
|
|
14667
|
-
|
|
14668
|
-
this.urlChangeInit = true;
|
|
14669
|
-
}
|
|
14670
|
-
|
|
14671
|
-
this.urlChangeListeners.push(callback);
|
|
14672
|
-
return callback;
|
|
14673
|
-
}
|
|
14674
|
-
|
|
14675
|
-
$$applicationDestroyed() {
|
|
14676
|
-
window.removeEventListener(
|
|
14677
|
-
"popstate",
|
|
14678
|
-
this.cacheStateAndFireUrlChange.bind(this),
|
|
14679
|
-
);
|
|
14680
|
-
window.removeEventListener(
|
|
14681
|
-
"hashchange",
|
|
14682
|
-
this.cacheStateAndFireUrlChange.bind(this),
|
|
14683
|
-
);
|
|
14684
|
-
}
|
|
14685
|
-
|
|
14686
|
-
$$checkUrlChange() {
|
|
14687
|
-
this.fireStateOrUrlChange();
|
|
14688
|
-
}
|
|
14689
|
-
|
|
14690
|
-
/// ///////////////////////////////////////////////////////////
|
|
14691
|
-
// Misc API
|
|
14692
|
-
/// ///////////////////////////////////////////////////////////
|
|
14693
|
-
|
|
14694
|
-
/**
|
|
14695
|
-
* Returns the base href of the document.
|
|
14696
|
-
*
|
|
14697
|
-
* @returns {string} The base href.
|
|
14698
|
-
*/
|
|
14699
|
-
baseHref() {
|
|
14700
|
-
const href = this.baseElement?.getAttribute("href");
|
|
14701
|
-
return href ? href.replace(/^(https?:)?\/\/[^/]*/, "") : "";
|
|
14702
|
-
}
|
|
14703
|
-
}
|
|
14704
|
-
|
|
14705
|
-
/**
|
|
14706
|
-
* This object has two goals:
|
|
14707
|
-
*
|
|
14708
|
-
* - hide all the global state in the browser caused by the window object
|
|
14709
|
-
* - abstract away all the browser specific features and inconsistencies
|
|
14710
|
-
*
|
|
14711
|
-
* Remove this in the future
|
|
14712
|
-
*/
|
|
14713
|
-
class BrowserProvider {
|
|
14714
|
-
$get = [
|
|
14715
|
-
"$$taskTrackerFactory",
|
|
14716
|
-
/**
|
|
14717
|
-
* @param {import('../core/task-tracker-factory.js').TaskTracker} $$taskTrackerFactory
|
|
14718
|
-
* @returns {Browser}
|
|
14719
|
-
*/
|
|
14720
|
-
($$taskTrackerFactory) => new Browser($$taskTrackerFactory),
|
|
14721
|
-
];
|
|
14722
|
-
}
|
|
14723
|
-
|
|
14724
14508
|
function AnimateAsyncRunFactoryProvider() {
|
|
14725
14509
|
this.$get = [
|
|
14726
14510
|
function () {
|
|
@@ -14926,7 +14710,9 @@ class TemplateCacheProvider {
|
|
|
14926
14710
|
/**
|
|
14927
14711
|
* @returns {import('./interface.ts').TemplateCache}
|
|
14928
14712
|
*/
|
|
14929
|
-
$get
|
|
14713
|
+
$get() {
|
|
14714
|
+
return this.cache;
|
|
14715
|
+
}
|
|
14930
14716
|
}
|
|
14931
14717
|
|
|
14932
14718
|
/**
|
|
@@ -14973,9 +14759,9 @@ class TemplateCacheProvider {
|
|
|
14973
14759
|
* @see {@link angular.ErrorHandler AngularTS ErrorHandler}
|
|
14974
14760
|
*/
|
|
14975
14761
|
|
|
14976
|
-
/** @typedef {import('../
|
|
14762
|
+
/** @typedef {import('../log/interface.ts').LogService} LogService */
|
|
14977
14763
|
|
|
14978
|
-
/** @typedef {import("./
|
|
14764
|
+
/** @typedef {import("./interface.ts").Interface} ErrorHandler */
|
|
14979
14765
|
|
|
14980
14766
|
/**
|
|
14981
14767
|
* Provider for `$exceptionHandler` service. Delegates uncaught exceptions to `$log.error()` by default.
|
|
@@ -15459,7 +15245,7 @@ function $IsStateFilter($state) {
|
|
|
15459
15245
|
const isFilter = function (state, params, options) {
|
|
15460
15246
|
return $state.is(state, params, options);
|
|
15461
15247
|
};
|
|
15462
|
-
|
|
15248
|
+
isFilter.$stateful = true;
|
|
15463
15249
|
return isFilter;
|
|
15464
15250
|
}
|
|
15465
15251
|
/**
|
|
@@ -15480,53 +15266,52 @@ function $IncludedByStateFilter($state) {
|
|
|
15480
15266
|
const includesFilter = function (state, params, options) {
|
|
15481
15267
|
return $state.includes(state, params, options);
|
|
15482
15268
|
};
|
|
15483
|
-
|
|
15269
|
+
includesFilter.$stateful = true;
|
|
15484
15270
|
return includesFilter;
|
|
15485
15271
|
}
|
|
15486
15272
|
|
|
15487
|
-
|
|
15273
|
+
const SUFFIX = "Filter";
|
|
15488
15274
|
|
|
15489
|
-
|
|
15490
|
-
|
|
15491
|
-
|
|
15492
|
-
|
|
15493
|
-
|
|
15275
|
+
class FilterProvider {
|
|
15276
|
+
static $inject = [$injectTokens.$provide];
|
|
15277
|
+
|
|
15278
|
+
/**
|
|
15279
|
+
* @param {import('../../interface.ts').Provider} $provide
|
|
15280
|
+
*/
|
|
15281
|
+
constructor($provide) {
|
|
15282
|
+
this.$provide = $provide;
|
|
15283
|
+
this.register({
|
|
15284
|
+
filter: filterFilter,
|
|
15285
|
+
json: jsonFilter,
|
|
15286
|
+
limitTo: limitToFilter,
|
|
15287
|
+
orderBy: orderByFilter,
|
|
15288
|
+
isState: $IsStateFilter,
|
|
15289
|
+
includedByState: $IncludedByStateFilter,
|
|
15290
|
+
});
|
|
15291
|
+
}
|
|
15494
15292
|
|
|
15495
15293
|
/**
|
|
15496
15294
|
* @param {string|Record<string, import('../../interface.ts').FilterFactory>} name
|
|
15497
|
-
* @param {import('../../interface.ts').FilterFactory} factory
|
|
15498
|
-
* @return {import('../../interface.ts').
|
|
15295
|
+
* @param {import('../../interface.ts').FilterFactory} [factory]
|
|
15296
|
+
* @return {import('../../interface.ts').Provider}
|
|
15499
15297
|
*/
|
|
15500
|
-
|
|
15298
|
+
register(name, factory) {
|
|
15501
15299
|
if (isObject(name)) {
|
|
15502
15300
|
Object.entries(name).forEach(([key, filter]) => {
|
|
15503
|
-
register(key, filter);
|
|
15301
|
+
this.register(key, filter);
|
|
15504
15302
|
});
|
|
15505
15303
|
}
|
|
15506
|
-
return
|
|
15304
|
+
return this.$provide.factory(name + SUFFIX, factory);
|
|
15507
15305
|
}
|
|
15508
15306
|
|
|
15509
|
-
|
|
15510
|
-
|
|
15511
|
-
this.$get = [
|
|
15512
|
-
"$injector",
|
|
15307
|
+
$get = [
|
|
15308
|
+
$injectTokens.$injector,
|
|
15513
15309
|
/**
|
|
15514
15310
|
* @param {import("../../core/di/internal-injector.js").InjectorService} $injector
|
|
15515
|
-
* @returns
|
|
15311
|
+
* @returns {import('../../interface.ts').FilterFn}
|
|
15516
15312
|
*/
|
|
15517
|
-
|
|
15518
|
-
return function (name) {
|
|
15519
|
-
return $injector.get(name + suffix);
|
|
15520
|
-
};
|
|
15521
|
-
},
|
|
15313
|
+
($injector) => (/** @type {string} */ name) => $injector.get(name + SUFFIX),
|
|
15522
15314
|
];
|
|
15523
|
-
|
|
15524
|
-
register("filter", filterFilter);
|
|
15525
|
-
register("json", jsonFilter);
|
|
15526
|
-
register("limitTo", limitToFilter);
|
|
15527
|
-
register("orderBy", orderByFilter);
|
|
15528
|
-
register("isState", $IsStateFilter);
|
|
15529
|
-
register("includedByState", $IncludedByStateFilter);
|
|
15530
15315
|
}
|
|
15531
15316
|
|
|
15532
15317
|
const PURITY_ABSOLUTE = 1;
|
|
@@ -15665,7 +15450,7 @@ class ASTInterpreter {
|
|
|
15665
15450
|
if (ast.filter) right = this.$filter(ast.callee.name);
|
|
15666
15451
|
if (!ast.filter) right = this.recurse(ast.callee, true);
|
|
15667
15452
|
return ast.filter
|
|
15668
|
-
?
|
|
15453
|
+
? (scope, locals, assign) => {
|
|
15669
15454
|
const values = [];
|
|
15670
15455
|
for (let i = 0; i < args.length; ++i) {
|
|
15671
15456
|
const res = args[i](scope, locals, assign);
|
|
@@ -15678,7 +15463,7 @@ class ASTInterpreter {
|
|
|
15678
15463
|
? { context: undefined, name: undefined, value }
|
|
15679
15464
|
: value;
|
|
15680
15465
|
}
|
|
15681
|
-
:
|
|
15466
|
+
: (scope, locals, assign) => {
|
|
15682
15467
|
const rhs = right(scope, locals, assign);
|
|
15683
15468
|
let value;
|
|
15684
15469
|
if (rhs.value != null && isFunction(rhs.value)) {
|
|
@@ -15694,7 +15479,7 @@ class ASTInterpreter {
|
|
|
15694
15479
|
case ASTType.AssignmentExpression:
|
|
15695
15480
|
left = this.recurse(ast.left, true, 1);
|
|
15696
15481
|
right = this.recurse(ast.right);
|
|
15697
|
-
return
|
|
15482
|
+
return (scope, locals, assign) => {
|
|
15698
15483
|
const lhs = left(scope, locals, assign);
|
|
15699
15484
|
const rhs = right(scope, locals, assign);
|
|
15700
15485
|
lhs.context[lhs.name] = rhs;
|
|
@@ -15705,7 +15490,7 @@ class ASTInterpreter {
|
|
|
15705
15490
|
ast.elements.forEach((expr) => {
|
|
15706
15491
|
args.push(self.recurse(expr));
|
|
15707
15492
|
});
|
|
15708
|
-
return
|
|
15493
|
+
return (scope, locals, assign) => {
|
|
15709
15494
|
const value = [];
|
|
15710
15495
|
for (let i = 0; i < args.length; ++i) {
|
|
15711
15496
|
value.push(args[i](scope, locals, assign));
|
|
@@ -15732,7 +15517,7 @@ class ASTInterpreter {
|
|
|
15732
15517
|
});
|
|
15733
15518
|
}
|
|
15734
15519
|
});
|
|
15735
|
-
return
|
|
15520
|
+
return (scope, locals, assign) => {
|
|
15736
15521
|
const value = {};
|
|
15737
15522
|
for (let i = 0; i < args.length; ++i) {
|
|
15738
15523
|
if (args[i].computed) {
|
|
@@ -15748,17 +15533,12 @@ class ASTInterpreter {
|
|
|
15748
15533
|
return context ? { value } : value;
|
|
15749
15534
|
};
|
|
15750
15535
|
case ASTType.ThisExpression:
|
|
15751
|
-
return
|
|
15752
|
-
return context ? { value: scope } : scope;
|
|
15753
|
-
};
|
|
15536
|
+
return (scope) => (context ? { value: scope } : scope);
|
|
15754
15537
|
case ASTType.LocalsExpression:
|
|
15755
|
-
return
|
|
15756
|
-
return context ? { value: locals } : locals;
|
|
15757
|
-
};
|
|
15538
|
+
return (scope, locals) => (context ? { value: locals } : locals);
|
|
15758
15539
|
case ASTType.NGValueParameter:
|
|
15759
|
-
return
|
|
15760
|
-
|
|
15761
|
-
};
|
|
15540
|
+
return (scope, locals, assign) =>
|
|
15541
|
+
context ? { value: assign } : assign;
|
|
15762
15542
|
}
|
|
15763
15543
|
}
|
|
15764
15544
|
|
|
@@ -15769,7 +15549,7 @@ class ASTInterpreter {
|
|
|
15769
15549
|
* @returns {function} The unary plus function.
|
|
15770
15550
|
*/
|
|
15771
15551
|
"unary+"(argument, context) {
|
|
15772
|
-
return
|
|
15552
|
+
return (scope, locals, assign) => {
|
|
15773
15553
|
let arg = argument(scope, locals, assign);
|
|
15774
15554
|
if (isDefined(arg)) {
|
|
15775
15555
|
arg = +arg;
|
|
@@ -15787,7 +15567,7 @@ class ASTInterpreter {
|
|
|
15787
15567
|
* @returns {function} The unary minus function.
|
|
15788
15568
|
*/
|
|
15789
15569
|
"unary-"(argument, context) {
|
|
15790
|
-
return
|
|
15570
|
+
return (scope, locals, assign) => {
|
|
15791
15571
|
let arg = argument(scope, locals, assign);
|
|
15792
15572
|
if (isDefined(arg)) {
|
|
15793
15573
|
arg = -arg;
|
|
@@ -15805,7 +15585,7 @@ class ASTInterpreter {
|
|
|
15805
15585
|
* @returns {function} The unary negation function.
|
|
15806
15586
|
*/
|
|
15807
15587
|
"unary!"(argument, context) {
|
|
15808
|
-
return
|
|
15588
|
+
return (scope, locals, assign) => {
|
|
15809
15589
|
const arg = !argument(scope, locals, assign);
|
|
15810
15590
|
return context ? { value: arg } : arg;
|
|
15811
15591
|
};
|
|
@@ -15819,7 +15599,7 @@ class ASTInterpreter {
|
|
|
15819
15599
|
* @returns {function} The binary plus function.
|
|
15820
15600
|
*/
|
|
15821
15601
|
"binary+"(left, right, context) {
|
|
15822
|
-
return
|
|
15602
|
+
return (scope, locals, assign) => {
|
|
15823
15603
|
const lhs = left(scope, locals, assign);
|
|
15824
15604
|
const rhs = right(scope, locals, assign);
|
|
15825
15605
|
const arg = plusFn(lhs, rhs);
|
|
@@ -15835,7 +15615,7 @@ class ASTInterpreter {
|
|
|
15835
15615
|
* @returns {function} The binary minus function.
|
|
15836
15616
|
*/
|
|
15837
15617
|
"binary-"(left, right, context) {
|
|
15838
|
-
return
|
|
15618
|
+
return (scope, locals, assign) => {
|
|
15839
15619
|
const lhs = left(scope, locals, assign);
|
|
15840
15620
|
const rhs = right(scope, locals, assign);
|
|
15841
15621
|
const arg = (isDefined(lhs) ? lhs : 0) - (isDefined(rhs) ? rhs : 0);
|
|
@@ -15851,14 +15631,14 @@ class ASTInterpreter {
|
|
|
15851
15631
|
* @returns {function} The binary multiplication function.
|
|
15852
15632
|
*/
|
|
15853
15633
|
"binary*"(left, right, context) {
|
|
15854
|
-
return
|
|
15634
|
+
return (scope, locals, assign) => {
|
|
15855
15635
|
const arg = left(scope, locals, assign) * right(scope, locals, assign);
|
|
15856
15636
|
return context ? { value: arg } : arg;
|
|
15857
15637
|
};
|
|
15858
15638
|
}
|
|
15859
15639
|
|
|
15860
15640
|
"binary/"(left, right, context) {
|
|
15861
|
-
return
|
|
15641
|
+
return (scope, locals, assign) => {
|
|
15862
15642
|
const arg = left(scope, locals, assign) / right(scope, locals, assign);
|
|
15863
15643
|
return context ? { value: arg } : arg;
|
|
15864
15644
|
};
|
|
@@ -15872,7 +15652,7 @@ class ASTInterpreter {
|
|
|
15872
15652
|
* @returns {function} The binary division function.
|
|
15873
15653
|
*/
|
|
15874
15654
|
"binary%"(left, right, context) {
|
|
15875
|
-
return
|
|
15655
|
+
return (scope, locals, assign) => {
|
|
15876
15656
|
const arg = left(scope, locals, assign) % right(scope, locals, assign);
|
|
15877
15657
|
return context ? { value: arg } : arg;
|
|
15878
15658
|
};
|
|
@@ -15886,7 +15666,7 @@ class ASTInterpreter {
|
|
|
15886
15666
|
* @returns {function} The binary strict equality function.
|
|
15887
15667
|
*/
|
|
15888
15668
|
"binary==="(left, right, context) {
|
|
15889
|
-
return
|
|
15669
|
+
return (scope, locals, assign) => {
|
|
15890
15670
|
const arg = left(scope, locals, assign) === right(scope, locals, assign);
|
|
15891
15671
|
return context ? { value: arg } : arg;
|
|
15892
15672
|
};
|
|
@@ -15900,7 +15680,7 @@ class ASTInterpreter {
|
|
|
15900
15680
|
* @returns {function} The binary strict inequality function.
|
|
15901
15681
|
*/
|
|
15902
15682
|
"binary!=="(left, right, context) {
|
|
15903
|
-
return
|
|
15683
|
+
return (scope, locals, assign) => {
|
|
15904
15684
|
const arg = left(scope, locals, assign) !== right(scope, locals, assign);
|
|
15905
15685
|
return context ? { value: arg } : arg;
|
|
15906
15686
|
};
|
|
@@ -15914,7 +15694,7 @@ class ASTInterpreter {
|
|
|
15914
15694
|
* @returns {function} The binary equality function.
|
|
15915
15695
|
*/
|
|
15916
15696
|
"binary=="(left, right, context) {
|
|
15917
|
-
return
|
|
15697
|
+
return (scope, locals, assign) => {
|
|
15918
15698
|
const arg = left(scope, locals, assign) == right(scope, locals, assign);
|
|
15919
15699
|
return context ? { value: arg } : arg;
|
|
15920
15700
|
};
|
|
@@ -15928,7 +15708,7 @@ class ASTInterpreter {
|
|
|
15928
15708
|
* @returns {function} The binary inequality function.
|
|
15929
15709
|
*/
|
|
15930
15710
|
"binary!="(left, right, context) {
|
|
15931
|
-
return
|
|
15711
|
+
return (scope, locals, assign) => {
|
|
15932
15712
|
const arg = left(scope, locals, assign) != right(scope, locals, assign);
|
|
15933
15713
|
return context ? { value: arg } : arg;
|
|
15934
15714
|
};
|
|
@@ -15942,7 +15722,7 @@ class ASTInterpreter {
|
|
|
15942
15722
|
* @returns {function} The binary less-than function.
|
|
15943
15723
|
*/
|
|
15944
15724
|
"binary<"(left, right, context) {
|
|
15945
|
-
return
|
|
15725
|
+
return (scope, locals, assign) => {
|
|
15946
15726
|
const arg = left(scope, locals, assign) < right(scope, locals, assign);
|
|
15947
15727
|
return context ? { value: arg } : arg;
|
|
15948
15728
|
};
|
|
@@ -15956,7 +15736,7 @@ class ASTInterpreter {
|
|
|
15956
15736
|
* @returns {function} The binary greater-than function.
|
|
15957
15737
|
*/
|
|
15958
15738
|
"binary>"(left, right, context) {
|
|
15959
|
-
return
|
|
15739
|
+
return (scope, locals, assign) => {
|
|
15960
15740
|
const arg = left(scope, locals, assign) > right(scope, locals, assign);
|
|
15961
15741
|
return context ? { value: arg } : arg;
|
|
15962
15742
|
};
|
|
@@ -15970,7 +15750,7 @@ class ASTInterpreter {
|
|
|
15970
15750
|
* @returns {function} The binary less-than-or-equal-to function.
|
|
15971
15751
|
*/
|
|
15972
15752
|
"binary<="(left, right, context) {
|
|
15973
|
-
return
|
|
15753
|
+
return (scope, locals, assign) => {
|
|
15974
15754
|
const arg = left(scope, locals, assign) <= right(scope, locals, assign);
|
|
15975
15755
|
return context ? { value: arg } : arg;
|
|
15976
15756
|
};
|
|
@@ -15984,7 +15764,7 @@ class ASTInterpreter {
|
|
|
15984
15764
|
* @returns {function} The binary greater-than-or-equal-to function.
|
|
15985
15765
|
*/
|
|
15986
15766
|
"binary>="(left, right, context) {
|
|
15987
|
-
return
|
|
15767
|
+
return (scope, locals, assign) => {
|
|
15988
15768
|
const arg = left(scope, locals, assign) >= right(scope, locals, assign);
|
|
15989
15769
|
return context ? { value: arg } : arg;
|
|
15990
15770
|
};
|
|
@@ -16011,7 +15791,7 @@ class ASTInterpreter {
|
|
|
16011
15791
|
* @returns {function} The binary logical OR function.
|
|
16012
15792
|
*/
|
|
16013
15793
|
"binary||"(left, right, context) {
|
|
16014
|
-
return
|
|
15794
|
+
return (scope, locals, assign) => {
|
|
16015
15795
|
const arg = left(scope, locals, assign) || right(scope, locals, assign);
|
|
16016
15796
|
return context ? { value: arg } : arg;
|
|
16017
15797
|
};
|
|
@@ -16026,7 +15806,7 @@ class ASTInterpreter {
|
|
|
16026
15806
|
* @returns {function} The ternary conditional function.
|
|
16027
15807
|
*/
|
|
16028
15808
|
"ternary?:"(test, alternate, consequent, context) {
|
|
16029
|
-
return
|
|
15809
|
+
return (scope, locals, assign) => {
|
|
16030
15810
|
const arg = test(scope, locals, assign)
|
|
16031
15811
|
? alternate(scope, locals, assign)
|
|
16032
15812
|
: consequent(scope, locals, assign);
|
|
@@ -16041,9 +15821,8 @@ class ASTInterpreter {
|
|
|
16041
15821
|
* @returns {import("./interface.ts").CompiledExpressionFunction} The function returning the literal value.
|
|
16042
15822
|
*/
|
|
16043
15823
|
value(value, context) {
|
|
16044
|
-
return
|
|
16045
|
-
|
|
16046
|
-
};
|
|
15824
|
+
return () =>
|
|
15825
|
+
context ? { context: undefined, name: undefined, value } : value;
|
|
16047
15826
|
}
|
|
16048
15827
|
|
|
16049
15828
|
/**
|
|
@@ -16054,7 +15833,7 @@ class ASTInterpreter {
|
|
|
16054
15833
|
* @returns {import("./interface.ts").CompiledExpressionFunction} The function returning the identifier value.
|
|
16055
15834
|
*/
|
|
16056
15835
|
identifier(name, context, create) {
|
|
16057
|
-
return
|
|
15836
|
+
return (scope, locals) => {
|
|
16058
15837
|
const base = locals && name in locals ? locals : scope;
|
|
16059
15838
|
if (create && create !== 1 && base && base[name] == null) {
|
|
16060
15839
|
base[name] = {};
|
|
@@ -16079,7 +15858,7 @@ class ASTInterpreter {
|
|
|
16079
15858
|
* @returns {function} The function returning the computed member value.
|
|
16080
15859
|
*/
|
|
16081
15860
|
computedMember(left, right, context, create) {
|
|
16082
|
-
return
|
|
15861
|
+
return (scope, locals, assign) => {
|
|
16083
15862
|
const lhs = left(scope, locals, assign);
|
|
16084
15863
|
let rhs;
|
|
16085
15864
|
let value;
|
|
@@ -16109,7 +15888,7 @@ class ASTInterpreter {
|
|
|
16109
15888
|
* @returns {function} The function returning the non-computed member value.
|
|
16110
15889
|
*/
|
|
16111
15890
|
nonComputedMember(left, right, context, create) {
|
|
16112
|
-
return
|
|
15891
|
+
return (scope, locals, assign) => {
|
|
16113
15892
|
const lhs = left(scope, locals, assign);
|
|
16114
15893
|
if (create && create !== 1) {
|
|
16115
15894
|
if (lhs && lhs[right] == null) {
|
|
@@ -18530,21 +18309,17 @@ function HttpProvider() {
|
|
|
18530
18309
|
});
|
|
18531
18310
|
|
|
18532
18311
|
this.$get = [
|
|
18533
|
-
"$browser",
|
|
18534
18312
|
"$httpBackend",
|
|
18535
|
-
"$rootScope",
|
|
18536
18313
|
"$injector",
|
|
18537
18314
|
"$sce",
|
|
18538
18315
|
/**
|
|
18539
18316
|
*
|
|
18540
|
-
* @param {*} $browser
|
|
18541
18317
|
* @param {*} $httpBackend
|
|
18542
|
-
* @param {import("../../core/scope/scope.js").Scope} $rootScope
|
|
18543
18318
|
* @param {import("../../core/di/internal-injector.js").InjectorService} $injector
|
|
18544
18319
|
* @param {*} $sce
|
|
18545
18320
|
* @returns
|
|
18546
18321
|
*/
|
|
18547
|
-
function ($
|
|
18322
|
+
function ($httpBackend, $injector, $sce) {
|
|
18548
18323
|
/**
|
|
18549
18324
|
* @type {Map<string, string>}
|
|
18550
18325
|
*/
|
|
@@ -18614,8 +18389,6 @@ function HttpProvider() {
|
|
|
18614
18389
|
? $injector.get(config.paramSerializer)
|
|
18615
18390
|
: config.paramSerializer;
|
|
18616
18391
|
|
|
18617
|
-
$browser.$$incOutstandingRequestCount("$http");
|
|
18618
|
-
|
|
18619
18392
|
const requestInterceptors = [];
|
|
18620
18393
|
const responseInterceptors = [];
|
|
18621
18394
|
let promise = Promise.resolve(config);
|
|
@@ -18639,7 +18412,6 @@ function HttpProvider() {
|
|
|
18639
18412
|
promise = chainInterceptors(promise, requestInterceptors);
|
|
18640
18413
|
promise = promise.then(serverRequest);
|
|
18641
18414
|
promise = chainInterceptors(promise, responseInterceptors);
|
|
18642
|
-
promise = promise.finally(completeOutstandingRequest);
|
|
18643
18415
|
|
|
18644
18416
|
return promise;
|
|
18645
18417
|
|
|
@@ -18656,10 +18428,6 @@ function HttpProvider() {
|
|
|
18656
18428
|
return promise;
|
|
18657
18429
|
}
|
|
18658
18430
|
|
|
18659
|
-
function completeOutstandingRequest() {
|
|
18660
|
-
$browser.$$completeOutstandingRequest(() => {}, "$http");
|
|
18661
|
-
}
|
|
18662
|
-
|
|
18663
18431
|
function executeHeaderFns(headers, config) {
|
|
18664
18432
|
let headerContent;
|
|
18665
18433
|
const processedHeaders = {};
|
|
@@ -19098,24 +18866,14 @@ function HttpProvider() {
|
|
|
19098
18866
|
*/
|
|
19099
18867
|
class HttpBackendProvider {
|
|
19100
18868
|
constructor() {
|
|
19101
|
-
this.$get = [
|
|
19102
|
-
"$browser",
|
|
19103
|
-
/**
|
|
19104
|
-
* @param {import('../browser.js').Browser} $browser
|
|
19105
|
-
* @returns
|
|
19106
|
-
*/
|
|
19107
|
-
function ($browser) {
|
|
19108
|
-
return createHttpBackend($browser);
|
|
19109
|
-
},
|
|
19110
|
-
];
|
|
18869
|
+
this.$get = [() => createHttpBackend()];
|
|
19111
18870
|
}
|
|
19112
18871
|
}
|
|
19113
18872
|
|
|
19114
18873
|
/**
|
|
19115
|
-
* @param {import('../browser.js').Browser} $browser
|
|
19116
18874
|
* @returns
|
|
19117
18875
|
*/
|
|
19118
|
-
function createHttpBackend(
|
|
18876
|
+
function createHttpBackend() {
|
|
19119
18877
|
// TODO(vojta): fix the signature
|
|
19120
18878
|
return function (
|
|
19121
18879
|
method,
|
|
@@ -19129,7 +18887,7 @@ function createHttpBackend($browser) {
|
|
|
19129
18887
|
eventHandlers,
|
|
19130
18888
|
uploadEventHandlers,
|
|
19131
18889
|
) {
|
|
19132
|
-
url = url ||
|
|
18890
|
+
url = url || trimEmptyHash(window.location.href);
|
|
19133
18891
|
|
|
19134
18892
|
const xhr = new XMLHttpRequest();
|
|
19135
18893
|
let abortedByTimeout = false;
|
|
@@ -19337,7 +19095,7 @@ class Location {
|
|
|
19337
19095
|
*/
|
|
19338
19096
|
this.$$replace = false;
|
|
19339
19097
|
|
|
19340
|
-
/** @type {
|
|
19098
|
+
/** @type {string} */
|
|
19341
19099
|
this.$$protocol = parsedUrl.protocol;
|
|
19342
19100
|
|
|
19343
19101
|
/** @type {string} */
|
|
@@ -19404,7 +19162,7 @@ class Location {
|
|
|
19404
19162
|
/**
|
|
19405
19163
|
*
|
|
19406
19164
|
* Return protocol of current URL.
|
|
19407
|
-
* @return {
|
|
19165
|
+
* @return {string} protocol of current URL
|
|
19408
19166
|
*/
|
|
19409
19167
|
protocol() {
|
|
19410
19168
|
return this.$$protocol;
|
|
@@ -19705,12 +19463,13 @@ class LocationHtml5Url extends Location {
|
|
|
19705
19463
|
* This object is exposed as $location service when developer doesn't opt into html5 mode.
|
|
19706
19464
|
* It also serves as the base class for html5 mode fallback on legacy browsers.
|
|
19707
19465
|
*
|
|
19708
|
-
* @constructor
|
|
19709
|
-
* @param {string} appBase application base URL
|
|
19710
|
-
* @param {string} appBaseNoFile application base URL stripped of any filename
|
|
19711
|
-
* @param {string} hashPrefix hashbang prefix
|
|
19712
19466
|
*/
|
|
19713
19467
|
class LocationHashbangUrl extends Location {
|
|
19468
|
+
/**
|
|
19469
|
+
* @param {string} appBase application base URL
|
|
19470
|
+
* @param {string} appBaseNoFile application base URL stripped of any filename
|
|
19471
|
+
* @param {string} hashPrefix hashbang prefix
|
|
19472
|
+
*/
|
|
19714
19473
|
constructor(appBase, appBaseNoFile, hashPrefix) {
|
|
19715
19474
|
super(appBase, appBaseNoFile);
|
|
19716
19475
|
this.hashPrefix = hashPrefix;
|
|
@@ -19821,6 +19580,111 @@ class LocationProvider {
|
|
|
19821
19580
|
requireBase: true,
|
|
19822
19581
|
rewriteLinks: true,
|
|
19823
19582
|
};
|
|
19583
|
+
|
|
19584
|
+
/** @type {Array<import("./interface.js").UrlChangeListener>} */
|
|
19585
|
+
this.urlChangeListeners = [];
|
|
19586
|
+
this.urlChangeInit = false;
|
|
19587
|
+
|
|
19588
|
+
/** @type {History['state']} */
|
|
19589
|
+
this.cachedState = null;
|
|
19590
|
+
/** @typeof {History.state} */
|
|
19591
|
+
this.lastHistoryState = null;
|
|
19592
|
+
/** @type {string} */
|
|
19593
|
+
this.lastBrowserUrl = window.location.href;
|
|
19594
|
+
this.cacheState();
|
|
19595
|
+
}
|
|
19596
|
+
|
|
19597
|
+
/// ///////////////////////////////////////////////////////////
|
|
19598
|
+
// URL API
|
|
19599
|
+
/// ///////////////////////////////////////////////////////////
|
|
19600
|
+
|
|
19601
|
+
setUrl(url, state) {
|
|
19602
|
+
if (state === undefined) {
|
|
19603
|
+
state = null;
|
|
19604
|
+
}
|
|
19605
|
+
|
|
19606
|
+
// setter
|
|
19607
|
+
if (url) {
|
|
19608
|
+
url = urlResolve(url).href;
|
|
19609
|
+
|
|
19610
|
+
if (this.lastBrowserUrl === url && this.lastHistoryState === state) {
|
|
19611
|
+
return this;
|
|
19612
|
+
}
|
|
19613
|
+
|
|
19614
|
+
this.lastBrowserUrl = url;
|
|
19615
|
+
this.lastHistoryState = state;
|
|
19616
|
+
history.pushState(state, "", url);
|
|
19617
|
+
this.cacheState();
|
|
19618
|
+
}
|
|
19619
|
+
}
|
|
19620
|
+
|
|
19621
|
+
/**
|
|
19622
|
+
* Returns the current URL with any empty hash (`#`) removed.
|
|
19623
|
+
* @return {string}
|
|
19624
|
+
*/
|
|
19625
|
+
getUrl() {
|
|
19626
|
+
return trimEmptyHash(window.location.href);
|
|
19627
|
+
}
|
|
19628
|
+
|
|
19629
|
+
/**
|
|
19630
|
+
* Returns the cached state.
|
|
19631
|
+
* @returns {History['state']} The cached state.
|
|
19632
|
+
*/
|
|
19633
|
+
state() {
|
|
19634
|
+
return this.cachedState;
|
|
19635
|
+
}
|
|
19636
|
+
|
|
19637
|
+
/**
|
|
19638
|
+
* Caches the current state.
|
|
19639
|
+
*
|
|
19640
|
+
* @private
|
|
19641
|
+
*/
|
|
19642
|
+
cacheState() {
|
|
19643
|
+
const currentState = history.state ?? null;
|
|
19644
|
+
if (!equals$1(currentState, this.lastCachedState)) {
|
|
19645
|
+
this.cachedState = currentState;
|
|
19646
|
+
this.lastCachedState = currentState;
|
|
19647
|
+
this.lastHistoryState = currentState;
|
|
19648
|
+
}
|
|
19649
|
+
}
|
|
19650
|
+
|
|
19651
|
+
/**
|
|
19652
|
+
* Fires the state or URL change event.
|
|
19653
|
+
*
|
|
19654
|
+
* @private
|
|
19655
|
+
*/
|
|
19656
|
+
fireStateOrUrlChange() {
|
|
19657
|
+
const prevLastHistoryState = this.lastHistoryState;
|
|
19658
|
+
this.cacheState();
|
|
19659
|
+
if (
|
|
19660
|
+
this.lastBrowserUrl === this.getUrl() &&
|
|
19661
|
+
prevLastHistoryState === this.cachedState
|
|
19662
|
+
) {
|
|
19663
|
+
return;
|
|
19664
|
+
}
|
|
19665
|
+
this.lastBrowserUrl = this.getUrl();
|
|
19666
|
+
this.lastHistoryState = this.cachedState;
|
|
19667
|
+
this.urlChangeListeners.forEach((listener) => {
|
|
19668
|
+
listener(trimEmptyHash(window.location.href), this.cachedState);
|
|
19669
|
+
});
|
|
19670
|
+
}
|
|
19671
|
+
|
|
19672
|
+
/**
|
|
19673
|
+
* Registers a callback to be called when the URL changes.
|
|
19674
|
+
*
|
|
19675
|
+
* @param {import("./interface.js").UrlChangeListener} callback - The callback function to register.
|
|
19676
|
+
* @returns void
|
|
19677
|
+
*/
|
|
19678
|
+
onUrlChange(callback) {
|
|
19679
|
+
if (!this.urlChangeInit) {
|
|
19680
|
+
window.addEventListener("popstate", this.fireStateOrUrlChange.bind(this));
|
|
19681
|
+
window.addEventListener(
|
|
19682
|
+
"hashchange",
|
|
19683
|
+
this.fireStateOrUrlChange.bind(this),
|
|
19684
|
+
);
|
|
19685
|
+
this.urlChangeInit = true;
|
|
19686
|
+
}
|
|
19687
|
+
this.urlChangeListeners.push(callback);
|
|
19824
19688
|
}
|
|
19825
19689
|
|
|
19826
19690
|
/**
|
|
@@ -19882,21 +19746,19 @@ class LocationProvider {
|
|
|
19882
19746
|
|
|
19883
19747
|
$get = [
|
|
19884
19748
|
"$rootScope",
|
|
19885
|
-
"$browser",
|
|
19886
19749
|
"$rootElement",
|
|
19887
19750
|
/**
|
|
19888
19751
|
*
|
|
19889
|
-
* @param {import('
|
|
19890
|
-
* @param {import('../../services/browser').Browser} $browser
|
|
19752
|
+
* @param {import('../../core/scope/scope.js').Scope} $rootScope
|
|
19891
19753
|
* @param {Element} $rootElement
|
|
19892
19754
|
* @returns
|
|
19893
19755
|
*/
|
|
19894
|
-
($rootScope, $
|
|
19756
|
+
($rootScope, $rootElement) => {
|
|
19895
19757
|
/** @type {Location} */
|
|
19896
19758
|
let $location;
|
|
19897
19759
|
let LocationMode;
|
|
19898
|
-
const baseHref =
|
|
19899
|
-
const initialUrl =
|
|
19760
|
+
const baseHref = getBaseHref(); // if base[href] is undefined, it defaults to ''
|
|
19761
|
+
const initialUrl = trimEmptyHash(window.location.href);
|
|
19900
19762
|
let appBase;
|
|
19901
19763
|
|
|
19902
19764
|
if (this.getHtml5Mode().enabled) {
|
|
@@ -19921,20 +19783,20 @@ class LocationProvider {
|
|
|
19921
19783
|
);
|
|
19922
19784
|
$location.$$parseLinkUrl(initialUrl, initialUrl);
|
|
19923
19785
|
|
|
19924
|
-
$location.$$state =
|
|
19786
|
+
$location.$$state = this.state();
|
|
19925
19787
|
|
|
19926
19788
|
const IGNORE_URI_REGEXP = /^\s*(javascript|mailto):/i;
|
|
19927
19789
|
|
|
19928
|
-
|
|
19790
|
+
const setBrowserUrlWithFallback = (url, state) => {
|
|
19929
19791
|
const oldUrl = $location.url();
|
|
19930
19792
|
const oldState = $location.$$state;
|
|
19931
19793
|
try {
|
|
19932
|
-
|
|
19794
|
+
this.setUrl(url, state);
|
|
19933
19795
|
|
|
19934
19796
|
// Make sure $location.state() returns referentially identical (not just deeply equal)
|
|
19935
19797
|
// state object; this makes possible quick checking if the state changed in the digest
|
|
19936
19798
|
// loop. Checking deep equality would be too expensive.
|
|
19937
|
-
$location.$$state =
|
|
19799
|
+
$location.$$state = this.state();
|
|
19938
19800
|
} catch (e) {
|
|
19939
19801
|
// Restore old values if pushState fails
|
|
19940
19802
|
$location.url(/** @type {string} */ (oldUrl));
|
|
@@ -19942,7 +19804,7 @@ class LocationProvider {
|
|
|
19942
19804
|
|
|
19943
19805
|
throw e;
|
|
19944
19806
|
}
|
|
19945
|
-
}
|
|
19807
|
+
};
|
|
19946
19808
|
|
|
19947
19809
|
$rootElement.addEventListener(
|
|
19948
19810
|
"click",
|
|
@@ -20010,10 +19872,6 @@ class LocationProvider {
|
|
|
20010
19872
|
// in html5mode and also without, so that we are able to abort navigation without
|
|
20011
19873
|
// getting double entries in the location history.
|
|
20012
19874
|
event.preventDefault();
|
|
20013
|
-
// update location manually
|
|
20014
|
-
// if ($location.absUrl() !== $browser.url()) {
|
|
20015
|
-
// $rootScope.$apply();
|
|
20016
|
-
// }
|
|
20017
19875
|
}
|
|
20018
19876
|
}
|
|
20019
19877
|
},
|
|
@@ -20021,13 +19879,13 @@ class LocationProvider {
|
|
|
20021
19879
|
|
|
20022
19880
|
// rewrite hashbang url <> html5 url
|
|
20023
19881
|
if ($location.absUrl() !== initialUrl) {
|
|
20024
|
-
|
|
19882
|
+
this.setUrl($location.absUrl(), true);
|
|
20025
19883
|
}
|
|
20026
19884
|
|
|
20027
19885
|
let initializing = true;
|
|
20028
19886
|
|
|
20029
19887
|
// update $location when $browser url changes
|
|
20030
|
-
|
|
19888
|
+
this.onUrlChange((newUrl, newState) => {
|
|
20031
19889
|
if (!startsWith(newUrl, appBaseNoFile)) {
|
|
20032
19890
|
// If we are navigating outside of the app then force a reload
|
|
20033
19891
|
window.location.href = newUrl;
|
|
@@ -20069,9 +19927,9 @@ class LocationProvider {
|
|
|
20069
19927
|
if (initializing || $location.$$urlUpdatedByLocation) {
|
|
20070
19928
|
$location.$$urlUpdatedByLocation = false;
|
|
20071
19929
|
|
|
20072
|
-
const oldUrl = /** @type {string} */ (
|
|
19930
|
+
const oldUrl = /** @type {string} */ (this.getUrl());
|
|
20073
19931
|
const newUrl = $location.absUrl();
|
|
20074
|
-
const oldState =
|
|
19932
|
+
const oldState = this.state();
|
|
20075
19933
|
const urlOrStateChanged =
|
|
20076
19934
|
!urlsEqual(oldUrl, newUrl) ||
|
|
20077
19935
|
($location.$$html5 && oldState !== $location.$$state);
|
|
@@ -20330,7 +20188,7 @@ function nextId() {
|
|
|
20330
20188
|
*/
|
|
20331
20189
|
let $parse;
|
|
20332
20190
|
|
|
20333
|
-
/**@type {import('
|
|
20191
|
+
/**@type {import('../../services/exception/exception-handler.js').ErrorHandler} */
|
|
20334
20192
|
let $exceptionHandler;
|
|
20335
20193
|
|
|
20336
20194
|
/**
|
|
@@ -20351,7 +20209,7 @@ class RootScopeProvider {
|
|
|
20351
20209
|
"$exceptionHandler",
|
|
20352
20210
|
"$parse",
|
|
20353
20211
|
/**
|
|
20354
|
-
* @param {import('
|
|
20212
|
+
* @param {import('../../services/exception/exception-handler.js').ErrorHandler} exceptionHandler
|
|
20355
20213
|
* @param {import('../parse/interface.ts').ParseService} parse
|
|
20356
20214
|
*/
|
|
20357
20215
|
(exceptionHandler, parse) => {
|
|
@@ -21548,152 +21406,6 @@ function collectChildIds(child) {
|
|
|
21548
21406
|
return ids;
|
|
21549
21407
|
}
|
|
21550
21408
|
|
|
21551
|
-
/** @typedef {import('../interface.ts').ServiceProvider} ServiceProvider */
|
|
21552
|
-
/** @typedef {import('../interface.ts').AnnotatedFactory} AnnotatedFactory */
|
|
21553
|
-
|
|
21554
|
-
/**
|
|
21555
|
-
* @implements {ServiceProvider}
|
|
21556
|
-
*/
|
|
21557
|
-
class TaskTrackerFactoryProvider {
|
|
21558
|
-
/** @type {AnnotatedFactory} */
|
|
21559
|
-
$get = [
|
|
21560
|
-
"$log",
|
|
21561
|
-
/**
|
|
21562
|
-
* Creates a new `TaskTracker` instance.
|
|
21563
|
-
*
|
|
21564
|
-
* @param {import('../services/log/interface.ts').LogService} log - The logging service.
|
|
21565
|
-
* @returns {TaskTracker} A new `TaskTracker` instance.
|
|
21566
|
-
*/
|
|
21567
|
-
(log) => new TaskTracker(log),
|
|
21568
|
-
];
|
|
21569
|
-
}
|
|
21570
|
-
|
|
21571
|
-
/**
|
|
21572
|
-
* A factory function to create `TaskTracker` instances.
|
|
21573
|
-
*
|
|
21574
|
-
* A `TaskTracker` tracks pending tasks (grouped by type) and notifies interested
|
|
21575
|
-
* parties when all pending tasks (or tasks of a specific type) have been completed.
|
|
21576
|
-
*/
|
|
21577
|
-
class TaskTracker {
|
|
21578
|
-
/**
|
|
21579
|
-
* @param {import('../services/log/interface.ts').LogService} log - The logging service.
|
|
21580
|
-
*/
|
|
21581
|
-
constructor(log) {
|
|
21582
|
-
/** @private */
|
|
21583
|
-
this.log = log;
|
|
21584
|
-
|
|
21585
|
-
/** @private */
|
|
21586
|
-
this.taskCounts = {};
|
|
21587
|
-
|
|
21588
|
-
/** @private */
|
|
21589
|
-
this.taskCallbacks = [];
|
|
21590
|
-
|
|
21591
|
-
/**
|
|
21592
|
-
* Special task types used for tracking all tasks and default tasks.
|
|
21593
|
-
* @type {string}
|
|
21594
|
-
*/
|
|
21595
|
-
this.ALL_TASKS_TYPE = "$$all$$";
|
|
21596
|
-
|
|
21597
|
-
/**
|
|
21598
|
-
* Default task type.
|
|
21599
|
-
* @type {string}
|
|
21600
|
-
*/
|
|
21601
|
-
this.DEFAULT_TASK_TYPE = "$$default$$";
|
|
21602
|
-
}
|
|
21603
|
-
|
|
21604
|
-
/**
|
|
21605
|
-
* Completes a task and decrements the associated task counter.
|
|
21606
|
-
* If the counter reaches 0, all corresponding callbacks are executed.
|
|
21607
|
-
*
|
|
21608
|
-
* @param {Function} fn - The function to execute when completing the task.
|
|
21609
|
-
* @param {string} [taskType=this.DEFAULT_TASK_TYPE] - The type of task being completed.
|
|
21610
|
-
*/
|
|
21611
|
-
completeTask(fn, taskType = this.DEFAULT_TASK_TYPE) {
|
|
21612
|
-
try {
|
|
21613
|
-
fn();
|
|
21614
|
-
} finally {
|
|
21615
|
-
if (this.taskCounts[taskType]) {
|
|
21616
|
-
this.taskCounts[taskType]--;
|
|
21617
|
-
this.taskCounts[this.ALL_TASKS_TYPE]--;
|
|
21618
|
-
}
|
|
21619
|
-
|
|
21620
|
-
const countForType = this.taskCounts[taskType];
|
|
21621
|
-
const countForAll = this.taskCounts[this.ALL_TASKS_TYPE];
|
|
21622
|
-
|
|
21623
|
-
// If either the overall task queue or the specific task type queue is empty, run callbacks.
|
|
21624
|
-
if (!countForAll || !countForType) {
|
|
21625
|
-
const getNextCallback = !countForAll
|
|
21626
|
-
? this.getLastCallback.bind(this)
|
|
21627
|
-
: () => this.getLastCallbackForType(taskType);
|
|
21628
|
-
|
|
21629
|
-
let nextCb;
|
|
21630
|
-
while ((nextCb = getNextCallback())) {
|
|
21631
|
-
try {
|
|
21632
|
-
nextCb();
|
|
21633
|
-
} catch (e) {
|
|
21634
|
-
this.log.error(e);
|
|
21635
|
-
}
|
|
21636
|
-
}
|
|
21637
|
-
}
|
|
21638
|
-
}
|
|
21639
|
-
}
|
|
21640
|
-
|
|
21641
|
-
/**
|
|
21642
|
-
* Increments the task count for the specified task type.
|
|
21643
|
-
*
|
|
21644
|
-
* @param {string} [taskType=this.DEFAULT_TASK_TYPE] - The type of task whose count will be increased.
|
|
21645
|
-
*/
|
|
21646
|
-
incTaskCount(taskType = this.DEFAULT_TASK_TYPE) {
|
|
21647
|
-
this.taskCounts[taskType] = (this.taskCounts[taskType] || 0) + 1;
|
|
21648
|
-
this.taskCounts[this.ALL_TASKS_TYPE] =
|
|
21649
|
-
(this.taskCounts[this.ALL_TASKS_TYPE] || 0) + 1;
|
|
21650
|
-
}
|
|
21651
|
-
|
|
21652
|
-
/**
|
|
21653
|
-
* Registers a callback to be executed when all pending tasks of the specified type are completed.
|
|
21654
|
-
* If there are no pending tasks of the specified type, the callback is executed immediately.
|
|
21655
|
-
*
|
|
21656
|
-
* @param {Function} callback - The function to execute when no pending tasks remain.
|
|
21657
|
-
* @param {string} [taskType=this.ALL_TASKS_TYPE] - The type of tasks to wait for completion.
|
|
21658
|
-
*/
|
|
21659
|
-
notifyWhenNoPendingTasks(callback, taskType = this.ALL_TASKS_TYPE) {
|
|
21660
|
-
if (!this.taskCounts[taskType]) {
|
|
21661
|
-
callback();
|
|
21662
|
-
} else {
|
|
21663
|
-
this.taskCallbacks.push({ type: taskType, cb: callback });
|
|
21664
|
-
}
|
|
21665
|
-
}
|
|
21666
|
-
|
|
21667
|
-
/**
|
|
21668
|
-
* Retrieves and removes the last registered callback from the queue.
|
|
21669
|
-
*
|
|
21670
|
-
* @private
|
|
21671
|
-
* @returns {Function|undefined} The last callback function or undefined if none exist.
|
|
21672
|
-
*/
|
|
21673
|
-
getLastCallback() {
|
|
21674
|
-
const cbInfo = this.taskCallbacks.pop();
|
|
21675
|
-
return cbInfo ? cbInfo.cb : undefined;
|
|
21676
|
-
}
|
|
21677
|
-
|
|
21678
|
-
/**
|
|
21679
|
-
* Retrieves and removes the last registered callback for the specified task type.
|
|
21680
|
-
*
|
|
21681
|
-
* @private
|
|
21682
|
-
* @param {string} taskType - The type of task for which the callback was registered.
|
|
21683
|
-
* @returns {Function|undefined} The last callback function for the task type, or undefined if none exist.
|
|
21684
|
-
*/
|
|
21685
|
-
getLastCallbackForType(taskType) {
|
|
21686
|
-
for (let i = this.taskCallbacks.length - 1; i >= 0; --i) {
|
|
21687
|
-
const cbInfo = this.taskCallbacks[i];
|
|
21688
|
-
if (cbInfo.type === taskType) {
|
|
21689
|
-
this.taskCallbacks.splice(i, 1);
|
|
21690
|
-
return cbInfo.cb;
|
|
21691
|
-
}
|
|
21692
|
-
}
|
|
21693
|
-
return undefined;
|
|
21694
|
-
}
|
|
21695
|
-
}
|
|
21696
|
-
|
|
21697
21409
|
const $templateRequestMinErr = minErr("$templateRequest");
|
|
21698
21410
|
|
|
21699
21411
|
/**
|
|
@@ -21753,7 +21465,7 @@ function TemplateRequestProvider() {
|
|
|
21753
21465
|
"$sce",
|
|
21754
21466
|
/**
|
|
21755
21467
|
*
|
|
21756
|
-
* @param {import('
|
|
21468
|
+
* @param {import('./exception/exception-handler.js').ErrorHandler} $exceptionHandler
|
|
21757
21469
|
* @param {import('../services/template-cache/interface.ts').TemplateCache} $templateCache
|
|
21758
21470
|
* @param {import("interface.ts").HttpService} $http
|
|
21759
21471
|
* @param {*} $sce
|
|
@@ -21768,6 +21480,7 @@ function TemplateRequestProvider() {
|
|
|
21768
21480
|
// resources for keys that already are included in there. This also makes
|
|
21769
21481
|
// AngularTS accept any script directive, no matter its name. However, we
|
|
21770
21482
|
// still need to unwrap trusted types.
|
|
21483
|
+
|
|
21771
21484
|
if (!isString(tpl) || !$templateCache.has(tpl)) {
|
|
21772
21485
|
try {
|
|
21773
21486
|
tpl = $sce.getTrustedResourceUrl(tpl);
|
|
@@ -21833,7 +21546,7 @@ function TemplateRequestProvider() {
|
|
|
21833
21546
|
];
|
|
21834
21547
|
}
|
|
21835
21548
|
|
|
21836
|
-
/** @typedef {import('../../interface.ts').ServiceProvider} ServiceProvider
|
|
21549
|
+
/** @typedef {import('../../interface.ts').ServiceProvider} ServiceProvider */
|
|
21837
21550
|
|
|
21838
21551
|
/**
|
|
21839
21552
|
* Private service to sanitize uris for links and images. Used by $compile.
|
|
@@ -21885,7 +21598,7 @@ class SanitizeUriProvider {
|
|
|
21885
21598
|
}
|
|
21886
21599
|
|
|
21887
21600
|
/**
|
|
21888
|
-
* @returns {import("./interface
|
|
21601
|
+
* @returns {import("./interface").SanitizerFn}
|
|
21889
21602
|
*/
|
|
21890
21603
|
$get() {
|
|
21891
21604
|
return (uri, isMediaUrl) => {
|
|
@@ -22142,6 +21855,10 @@ const ngMessageDirective = ngMessageDirectiveFactory(false);
|
|
|
22142
21855
|
const ngMessageExpDirective = ngMessageDirectiveFactory(false);
|
|
22143
21856
|
const ngMessageDefaultDirective = ngMessageDirectiveFactory(true);
|
|
22144
21857
|
|
|
21858
|
+
/**
|
|
21859
|
+
* @param {boolean} isDefault
|
|
21860
|
+
* @returns {(any) => import("../../interface.js").Directive}
|
|
21861
|
+
*/
|
|
22145
21862
|
function ngMessageDirectiveFactory(isDefault) {
|
|
22146
21863
|
ngMessageDirective.$inject = ["$animate"];
|
|
22147
21864
|
function ngMessageDirective($animate) {
|
|
@@ -25222,7 +24939,7 @@ function AnimationProvider() {
|
|
|
25222
24939
|
|
|
25223
24940
|
/**
|
|
25224
24941
|
* Service provider that creates a requestAnimationFrame-based scheduler.
|
|
25225
|
-
* @
|
|
24942
|
+
* @type {ServiceProvider}
|
|
25226
24943
|
*/
|
|
25227
24944
|
class RafSchedulerProvider {
|
|
25228
24945
|
constructor() {
|
|
@@ -26974,7 +26691,6 @@ class Queue {
|
|
|
26974
26691
|
*
|
|
26975
26692
|
* This is where we hold the global mutable state such as current state, current
|
|
26976
26693
|
* params, current transition, etc.
|
|
26977
|
-
* @implements {ServiceProvider}
|
|
26978
26694
|
*/
|
|
26979
26695
|
class RouterGlobals {
|
|
26980
26696
|
constructor() {
|
|
@@ -29615,6 +29331,11 @@ class Glob {
|
|
|
29615
29331
|
*/
|
|
29616
29332
|
this.regexp = new RegExp("^" + regexpString + "$");
|
|
29617
29333
|
}
|
|
29334
|
+
|
|
29335
|
+
/**
|
|
29336
|
+
* @param {string} name
|
|
29337
|
+
* @return {boolean}
|
|
29338
|
+
*/
|
|
29618
29339
|
matches(name) {
|
|
29619
29340
|
return this.regexp.test("." + name);
|
|
29620
29341
|
}
|
|
@@ -33549,7 +33270,7 @@ class UrlService {
|
|
|
33549
33270
|
];
|
|
33550
33271
|
|
|
33551
33272
|
/**
|
|
33552
|
-
* @param {import("../../
|
|
33273
|
+
* @param {import("../../services/location/location").LocationProvider} $locationProvider
|
|
33553
33274
|
* @param {import("../../router/state/state-service.js").StateProvider} stateService
|
|
33554
33275
|
* @param globals
|
|
33555
33276
|
* @param {import("../../router/url/url-config.js").UrlConfigProvider} urlConfigProvider
|
|
@@ -33558,9 +33279,7 @@ class UrlService {
|
|
|
33558
33279
|
this.stateService = stateService;
|
|
33559
33280
|
this.stateService.urlService = this; // circular wiring
|
|
33560
33281
|
this.$locationProvider = $locationProvider;
|
|
33561
|
-
|
|
33562
33282
|
this.$location = undefined;
|
|
33563
|
-
this.$browser = undefined;
|
|
33564
33283
|
|
|
33565
33284
|
/** Provides services related to the URL */
|
|
33566
33285
|
this.urlRuleFactory = new UrlRuleFactory(this, this.stateService, globals);
|
|
@@ -33613,18 +33332,15 @@ class UrlService {
|
|
|
33613
33332
|
|
|
33614
33333
|
$get = [
|
|
33615
33334
|
"$location",
|
|
33616
|
-
"$browser",
|
|
33617
33335
|
"$rootScope",
|
|
33618
33336
|
/**
|
|
33619
33337
|
*
|
|
33620
|
-
* @param {import('../../
|
|
33621
|
-
* @param {import('../../services/browser.js').Browser} $browser
|
|
33338
|
+
* @param {import('../../services/location/location.js').Location} $location
|
|
33622
33339
|
* @param {import('../../core/scope/scope.js').Scope} $rootScope
|
|
33623
33340
|
* @returns {UrlService}
|
|
33624
33341
|
*/
|
|
33625
|
-
($location, $
|
|
33342
|
+
($location, $rootScope) => {
|
|
33626
33343
|
this.$location = $location;
|
|
33627
|
-
this.$browser = $browser;
|
|
33628
33344
|
$rootScope.$on("$locationChangeSuccess", (evt) => {
|
|
33629
33345
|
this._urlListeners.forEach((fn) => {
|
|
33630
33346
|
fn(evt);
|
|
@@ -33648,7 +33364,7 @@ class UrlService {
|
|
|
33648
33364
|
baseHref() {
|
|
33649
33365
|
return (
|
|
33650
33366
|
this._baseHref ||
|
|
33651
|
-
(this._baseHref =
|
|
33367
|
+
(this._baseHref = getBaseHref() || window.location.pathname)
|
|
33652
33368
|
);
|
|
33653
33369
|
}
|
|
33654
33370
|
|
|
@@ -34495,7 +34211,6 @@ class StateQueueManager {
|
|
|
34495
34211
|
*
|
|
34496
34212
|
* This API is found at `$stateRegistry` ([[UIRouter.stateRegistry]])
|
|
34497
34213
|
*
|
|
34498
|
-
* @implements {ServiceProvider}
|
|
34499
34214
|
*/
|
|
34500
34215
|
class StateRegistryProvider {
|
|
34501
34216
|
static $inject = provider([
|
|
@@ -35259,11 +34974,20 @@ function $StateRefActiveDirective(
|
|
|
35259
34974
|
* });
|
|
35260
34975
|
* ```
|
|
35261
34976
|
*/
|
|
34977
|
+
|
|
34978
|
+
/** @type {import("../../interface.js").AnnotatedDirectiveFactory} */
|
|
35262
34979
|
let ngView = [
|
|
35263
34980
|
"$view",
|
|
35264
34981
|
"$animate",
|
|
35265
34982
|
"$ngViewScroll",
|
|
35266
34983
|
"$interpolate",
|
|
34984
|
+
/**
|
|
34985
|
+
* @param {*} $view
|
|
34986
|
+
* @param {*} $animate
|
|
34987
|
+
* @param {*} $ngViewScroll
|
|
34988
|
+
* @param {*} $interpolate
|
|
34989
|
+
* @returns {import("../../interface.js").Directive}
|
|
34990
|
+
*/
|
|
35267
34991
|
function $ViewDirective($view, $animate, $ngViewScroll, $interpolate) {
|
|
35268
34992
|
function getRenderer() {
|
|
35269
34993
|
return {
|
|
@@ -35294,7 +35018,6 @@ let ngView = [
|
|
|
35294
35018
|
};
|
|
35295
35019
|
const directive = {
|
|
35296
35020
|
count: 0,
|
|
35297
|
-
|
|
35298
35021
|
terminal: true,
|
|
35299
35022
|
priority: 400,
|
|
35300
35023
|
transclude: "element",
|
|
@@ -35631,7 +35354,8 @@ function ngChannelDirective($eventBus) {
|
|
|
35631
35354
|
};
|
|
35632
35355
|
}
|
|
35633
35356
|
|
|
35634
|
-
ngSetterDirective.$inject = [
|
|
35357
|
+
ngSetterDirective.$inject = [$injectTokens.$parse, $injectTokens.$log];
|
|
35358
|
+
|
|
35635
35359
|
/**
|
|
35636
35360
|
* @param {import('../../core/parse/interface.ts').ParseService} $parse
|
|
35637
35361
|
* @param {import('../../services/log/interface.ts').LogService} $log
|
|
@@ -35644,19 +35368,19 @@ function ngSetterDirective($parse, $log) {
|
|
|
35644
35368
|
const modelExpression = attrs["ngSetter"];
|
|
35645
35369
|
|
|
35646
35370
|
if (!modelExpression) {
|
|
35647
|
-
$log.warn("
|
|
35371
|
+
$log.warn("ng-setter: expression null");
|
|
35648
35372
|
return;
|
|
35649
35373
|
}
|
|
35650
35374
|
|
|
35651
35375
|
const assignModel = $parse(modelExpression).assign;
|
|
35652
35376
|
|
|
35653
35377
|
if (!assignModel) {
|
|
35654
|
-
$log.warn("
|
|
35378
|
+
$log.warn("ng-setter: expression invalid");
|
|
35655
35379
|
return;
|
|
35656
35380
|
}
|
|
35657
35381
|
|
|
35658
35382
|
const updateModel = (value) => {
|
|
35659
|
-
assignModel(scope, value);
|
|
35383
|
+
assignModel(scope, value.trim());
|
|
35660
35384
|
};
|
|
35661
35385
|
|
|
35662
35386
|
const observer = new MutationObserver((mutationsList) => {
|
|
@@ -35676,16 +35400,11 @@ function ngSetterDirective($parse, $log) {
|
|
|
35676
35400
|
}
|
|
35677
35401
|
});
|
|
35678
35402
|
|
|
35679
|
-
|
|
35680
|
-
|
|
35681
|
-
|
|
35682
|
-
|
|
35683
|
-
|
|
35684
|
-
});
|
|
35685
|
-
} else {
|
|
35686
|
-
$log.warn("ngSetter: Element is not a valid DOM node.");
|
|
35687
|
-
return;
|
|
35688
|
-
}
|
|
35403
|
+
observer.observe(element, {
|
|
35404
|
+
childList: true,
|
|
35405
|
+
subtree: true,
|
|
35406
|
+
characterData: true,
|
|
35407
|
+
});
|
|
35689
35408
|
|
|
35690
35409
|
scope.$on("$destroy", () => observer.disconnect());
|
|
35691
35410
|
updateModel(element.innerHTML);
|
|
@@ -35700,13 +35419,20 @@ function ngSetterDirective($parse, $log) {
|
|
|
35700
35419
|
function defineDirective(method) {
|
|
35701
35420
|
const attrName = "ng" + method.charAt(0).toUpperCase() + method.slice(1);
|
|
35702
35421
|
const directive = createHttpDirective(method, attrName);
|
|
35703
|
-
directive["$inject"] = [
|
|
35422
|
+
directive["$inject"] = [$injectTokens.$http, $injectTokens.$compile, $injectTokens.$log, $injectTokens.$parse, $injectTokens.$state];
|
|
35704
35423
|
return directive;
|
|
35705
35424
|
}
|
|
35706
35425
|
|
|
35426
|
+
/** @type {import('../../interface.ts').DirectiveFactory} */
|
|
35707
35427
|
const ngGetDirective = defineDirective("get");
|
|
35428
|
+
|
|
35429
|
+
/** @type {import('../../interface.ts').DirectiveFactory} */
|
|
35708
35430
|
const ngDeleteDirective = defineDirective("delete");
|
|
35431
|
+
|
|
35432
|
+
/** @type {import('../../interface.ts').DirectiveFactory} */
|
|
35709
35433
|
const ngPostDirective = defineDirective("post");
|
|
35434
|
+
|
|
35435
|
+
/** @type {import('../../interface.ts').DirectiveFactory} */
|
|
35710
35436
|
const ngPutDirective = defineDirective("put");
|
|
35711
35437
|
|
|
35712
35438
|
/**
|
|
@@ -35733,7 +35459,7 @@ function getEventNameForElement(element) {
|
|
|
35733
35459
|
* Handles DOM manipulation based on a swap strategy and server-rendered HTML.
|
|
35734
35460
|
*
|
|
35735
35461
|
* @param {string} html - The HTML string returned from the server.
|
|
35736
|
-
* @param {import("../../interface.ts").
|
|
35462
|
+
* @param {import("../../interface.ts").SwapModeType} swap
|
|
35737
35463
|
* @param {Element} target - The target DOM element to apply the swap to.
|
|
35738
35464
|
* @param {import('../../core/scope/scope.js').Scope} scope
|
|
35739
35465
|
* @param {import('../../core/compile/compile.js').CompileFn} $compile
|
|
@@ -35824,9 +35550,11 @@ function createHttpDirective(method, attrName) {
|
|
|
35824
35550
|
* @param {import("interface.ts").HttpService} $http
|
|
35825
35551
|
* @param {import("../../core/compile/compile.js").CompileFn} $compile
|
|
35826
35552
|
* @param {import("../../services/log/interface.ts").LogService} $log
|
|
35553
|
+
* @param {import("../../core/parse/interface.ts").ParseService} $parse
|
|
35554
|
+
* @param {import("../../router/state/state-service.js").StateProvider} $state
|
|
35827
35555
|
* @returns {import('../../interface.ts').Directive}
|
|
35828
35556
|
*/
|
|
35829
|
-
return function ($http, $compile, $log) {
|
|
35557
|
+
return function ($http, $compile, $log, $parse, $state) {
|
|
35830
35558
|
/**
|
|
35831
35559
|
* Collects form data from the element or its associated form.
|
|
35832
35560
|
*
|
|
@@ -35887,16 +35615,38 @@ function createHttpDirective(method, attrName) {
|
|
|
35887
35615
|
restrict: "A",
|
|
35888
35616
|
terminal: true,
|
|
35889
35617
|
link(scope, element, attrs) {
|
|
35890
|
-
|
|
35891
|
-
|
|
35618
|
+
const eventName =
|
|
35619
|
+
attrs["trigger"] ||
|
|
35620
|
+
/** @type {EventType} */ getEventNameForElement(element);
|
|
35621
|
+
|
|
35892
35622
|
const tag = element.tagName.toLowerCase();
|
|
35893
35623
|
|
|
35894
|
-
|
|
35624
|
+
if (isDefined(attrs["latch"])) {
|
|
35625
|
+
attrs.$observe(
|
|
35626
|
+
"latch",
|
|
35627
|
+
callBackAfterFirst(() =>
|
|
35628
|
+
element.dispatchEvent(new Event(eventName)),
|
|
35629
|
+
),
|
|
35630
|
+
);
|
|
35631
|
+
}
|
|
35632
|
+
|
|
35633
|
+
let throttled = false;
|
|
35634
|
+
let intervalId;
|
|
35635
|
+
|
|
35636
|
+
if (isDefined(attrs["interval"])) {
|
|
35637
|
+
element.dispatchEvent(new Event(eventName));
|
|
35638
|
+
intervalId = setInterval(
|
|
35639
|
+
() => element.dispatchEvent(new Event(eventName)),
|
|
35640
|
+
parseInt(attrs["interval"]) || 1000,
|
|
35641
|
+
);
|
|
35642
|
+
}
|
|
35643
|
+
|
|
35644
|
+
element.addEventListener(eventName, async (event) => {
|
|
35895
35645
|
if (/** @type {HTMLButtonElement} */ (element).disabled) return;
|
|
35896
35646
|
if (tag === "form") event.preventDefault();
|
|
35897
35647
|
|
|
35898
|
-
const swap =
|
|
35899
|
-
const targetSelector =
|
|
35648
|
+
const swap = attrs["swap"] || "innerHTML";
|
|
35649
|
+
const targetSelector = attrs["target"];
|
|
35900
35650
|
const target = targetSelector
|
|
35901
35651
|
? document.querySelector(targetSelector)
|
|
35902
35652
|
: element;
|
|
@@ -35913,18 +35663,67 @@ function createHttpDirective(method, attrName) {
|
|
|
35913
35663
|
}
|
|
35914
35664
|
|
|
35915
35665
|
const handler = (res) => {
|
|
35666
|
+
if (isDefined(attrs["loading"])) {
|
|
35667
|
+
attrs.$set("loading", false);
|
|
35668
|
+
}
|
|
35669
|
+
|
|
35670
|
+
if (isDefined(attrs["loadingClass"])) {
|
|
35671
|
+
attrs.$removeClass(attrs["loadingClass"]);
|
|
35672
|
+
}
|
|
35673
|
+
|
|
35916
35674
|
const html = res.data;
|
|
35675
|
+
if (200 <= res.status && res.status <= 299) {
|
|
35676
|
+
if (isDefined(attrs["success"])) {
|
|
35677
|
+
$parse(attrs["success"])(scope, { $res: html });
|
|
35678
|
+
}
|
|
35679
|
+
|
|
35680
|
+
if (isDefined(attrs["stateSuccess"])) {
|
|
35681
|
+
$state.go(attrs["stateSuccess"]);
|
|
35682
|
+
}
|
|
35683
|
+
} else if (400 <= res.status && res.status <= 599) {
|
|
35684
|
+
if (isDefined(attrs["error"])) {
|
|
35685
|
+
$parse(attrs["error"])(scope, { $res: html });
|
|
35686
|
+
}
|
|
35687
|
+
|
|
35688
|
+
if (isDefined(attrs["stateError"])) {
|
|
35689
|
+
$state.go(attrs["stateError"]);
|
|
35690
|
+
}
|
|
35691
|
+
}
|
|
35692
|
+
|
|
35917
35693
|
handleSwapResponse(
|
|
35918
35694
|
html,
|
|
35919
|
-
/** @type {import("../../interface.ts").
|
|
35920
|
-
swap
|
|
35921
|
-
),
|
|
35695
|
+
/** @type {import("../../interface.ts").SwapModeType} */ (swap),
|
|
35922
35696
|
target,
|
|
35923
35697
|
scope,
|
|
35924
35698
|
$compile,
|
|
35925
35699
|
);
|
|
35926
35700
|
};
|
|
35927
35701
|
|
|
35702
|
+
if (isDefined(attrs["delay"])) {
|
|
35703
|
+
await wait(parseInt(attrs["delay"]) | 0);
|
|
35704
|
+
}
|
|
35705
|
+
|
|
35706
|
+
if (throttled) {
|
|
35707
|
+
return;
|
|
35708
|
+
}
|
|
35709
|
+
|
|
35710
|
+
if (isDefined(attrs["throttle"])) {
|
|
35711
|
+
throttled = true;
|
|
35712
|
+
attrs.$set("throttled", true);
|
|
35713
|
+
setTimeout(() => {
|
|
35714
|
+
attrs.$set("throttled", false);
|
|
35715
|
+
throttled = false;
|
|
35716
|
+
}, parseInt(attrs["throttle"]));
|
|
35717
|
+
}
|
|
35718
|
+
|
|
35719
|
+
if (isDefined(attrs["loading"])) {
|
|
35720
|
+
attrs.$set("loading", true);
|
|
35721
|
+
}
|
|
35722
|
+
|
|
35723
|
+
if (isDefined(attrs["loadingClass"])) {
|
|
35724
|
+
attrs.$addClass(attrs["loadingClass"]);
|
|
35725
|
+
}
|
|
35726
|
+
|
|
35928
35727
|
if (method === "post" || method === "put") {
|
|
35929
35728
|
const data = collectFormData(element);
|
|
35930
35729
|
$http[method](url, data).then(handler).catch(handler);
|
|
@@ -35932,6 +35731,8 @@ function createHttpDirective(method, attrName) {
|
|
|
35932
35731
|
$http[method](url).then(handler).catch(handler);
|
|
35933
35732
|
}
|
|
35934
35733
|
});
|
|
35734
|
+
|
|
35735
|
+
scope.$on("$destroy", () => clearInterval(intervalId));
|
|
35935
35736
|
},
|
|
35936
35737
|
};
|
|
35937
35738
|
};
|
|
@@ -35943,13 +35744,13 @@ function createHttpDirective(method, attrName) {
|
|
|
35943
35744
|
* @returns {import('./core/di/ng-module.js').NgModule} `ng` module
|
|
35944
35745
|
*/
|
|
35945
35746
|
function registerNgModule(angular) {
|
|
35946
|
-
|
|
35747
|
+
return angular
|
|
35947
35748
|
.module(
|
|
35948
35749
|
"ng",
|
|
35949
35750
|
[],
|
|
35950
35751
|
[
|
|
35951
35752
|
"$provide",
|
|
35952
|
-
/** @
|
|
35753
|
+
/** @param {import("./interface.js").Provider} $provide */
|
|
35953
35754
|
($provide) => {
|
|
35954
35755
|
// $$sanitizeUriProvider needs to be before $compileProvider as it is used by it.
|
|
35955
35756
|
$provide.provider({
|
|
@@ -36050,7 +35851,6 @@ function registerNgModule(angular) {
|
|
|
36050
35851
|
$$animateQueue: AnimateQueueProvider,
|
|
36051
35852
|
$$AnimateRunner: AnimateRunnerFactoryProvider,
|
|
36052
35853
|
$$animateAsyncRun: AnimateAsyncRunFactoryProvider,
|
|
36053
|
-
$browser: BrowserProvider,
|
|
36054
35854
|
$controller: ControllerProvider,
|
|
36055
35855
|
$exceptionHandler: ExceptionHandlerProvider,
|
|
36056
35856
|
$filter: FilterProvider,
|
|
@@ -36066,7 +35866,6 @@ function registerNgModule(angular) {
|
|
|
36066
35866
|
$routerGlobals: RouterGlobals,
|
|
36067
35867
|
$sce: SceProvider,
|
|
36068
35868
|
$sceDelegate: SceDelegateProvider,
|
|
36069
|
-
$$taskTrackerFactory: TaskTrackerFactoryProvider,
|
|
36070
35869
|
$templateCache: TemplateCacheProvider,
|
|
36071
35870
|
$templateRequest: TemplateRequestProvider,
|
|
36072
35871
|
$urlConfig: UrlConfigProvider,
|
|
@@ -36093,8 +35892,6 @@ function registerNgModule(angular) {
|
|
|
36093
35892
|
},
|
|
36094
35893
|
])
|
|
36095
35894
|
.value("$trace", trace);
|
|
36096
|
-
|
|
36097
|
-
return ng;
|
|
36098
35895
|
}
|
|
36099
35896
|
|
|
36100
35897
|
const ngMinErr = minErr("ng");
|
|
@@ -36120,7 +35917,7 @@ class Angular {
|
|
|
36120
35917
|
/**
|
|
36121
35918
|
* @type {string} `version` from `package.json`
|
|
36122
35919
|
*/
|
|
36123
|
-
this.version = "0.7.
|
|
35920
|
+
this.version = "0.7.8"; //inserted via rollup plugin
|
|
36124
35921
|
|
|
36125
35922
|
/** @type {!Array<string|any>} */
|
|
36126
35923
|
this.bootsrappedModules = [];
|
|
@@ -36360,12 +36157,7 @@ class Angular {
|
|
|
36360
36157
|
name,
|
|
36361
36158
|
);
|
|
36362
36159
|
}
|
|
36363
|
-
|
|
36364
|
-
name,
|
|
36365
|
-
requires,
|
|
36366
|
-
/** @type {Function} */ (configFn),
|
|
36367
|
-
);
|
|
36368
|
-
return moduleInstance;
|
|
36160
|
+
return new NgModule(name, requires, /** @type {Function} */ (configFn));
|
|
36369
36161
|
});
|
|
36370
36162
|
}
|
|
36371
36163
|
}
|