@angular-wave/angular.ts 0.9.3 → 0.9.4
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/angular.d.ts +4 -19
- package/@types/animations/animate.d.ts +2 -2
- package/@types/animations/animation.d.ts +1 -1
- package/@types/core/compile/attributes.d.ts +1 -1
- package/@types/core/compile/compile.d.ts +2 -2
- package/@types/core/controller/controller.d.ts +1 -1
- package/@types/core/controller/interface.d.ts +6 -0
- package/@types/core/di/ng-module.d.ts +27 -26
- package/@types/core/filter/filter.d.ts +5 -5
- package/@types/core/interpolate/interface.d.ts +13 -0
- package/@types/core/interpolate/interpolate.d.ts +1 -13
- package/@types/core/scope/scope.d.ts +4 -1
- package/@types/directive/http/http.d.ts +16 -16
- package/@types/directive/http/interface.d.ts +27 -0
- package/@types/directive/include/include.d.ts +4 -4
- package/@types/directive/inject/inject.d.ts +12 -0
- package/@types/directive/model/model.d.ts +1 -1
- package/@types/directive/script/script.d.ts +2 -2
- package/@types/directive/setter/setter.d.ts +4 -4
- package/@types/filters/filter.d.ts +2 -2
- package/@types/filters/filters.d.ts +2 -2
- package/@types/filters/interface.d.ts +8 -0
- package/@types/filters/limit-to.d.ts +2 -2
- package/@types/filters/order-by.d.ts +2 -2
- package/@types/index.d.ts +84 -1
- package/@types/interface.d.ts +105 -82
- package/@types/router/state/interface.d.ts +8 -8
- package/@types/router/state-filters.d.ts +4 -4
- package/@types/router/template-factory.d.ts +6 -6
- package/@types/router/transition/hook-builder.d.ts +5 -2
- package/@types/router/transition/hook-registry.d.ts +11 -2
- package/@types/router/transition/transition-service.d.ts +6 -2
- package/@types/router/transition/transition.d.ts +2 -2
- package/@types/router/view/view.d.ts +1 -8
- package/@types/router/view-scroll.d.ts +4 -2
- package/@types/services/{anchor-scroll.d.ts → anchor-scroll/anchor-scroll.d.ts} +2 -2
- package/@types/services/exception/exception-handler.d.ts +2 -2
- package/@types/services/exception/interface.d.ts +1 -1
- package/@types/services/http/http.d.ts +40 -2
- package/@types/services/http/interface.d.ts +11 -0
- package/@types/services/location/location.d.ts +1 -4
- package/@types/services/sce/sce.d.ts +3 -4
- package/@types/services/template-cache/template-cache.d.ts +4 -4
- package/@types/services/template-request/interface.d.ts +22 -0
- package/@types/services/{template-request.d.ts → template-request/template-request.d.ts} +4 -7
- package/@types/shared/common.d.ts +8 -69
- package/@types/shared/hof.d.ts +7 -7
- package/dist/angular-ts.esm.js +509 -569
- package/dist/angular-ts.umd.js +509 -569
- package/dist/angular-ts.umd.min.js +1 -1
- package/{src/filters → docs/content/docs/filter}/filter.md +18 -9
- package/{src/filters → docs/content/docs/filter}/json.md +6 -3
- package/docs/content/docs/filter/limit-to.md +30 -0
- package/docs/content/docs/filter/order-by.md +123 -0
- package/docs/content/docs/provider/sceProvider.md +194 -0
- package/docs/content/docs/provider/templateRequestProvider.md +5 -0
- package/docs/content/docs/service/compile.md +5 -0
- package/docs/content/docs/service/controller.md +5 -0
- package/docs/content/docs/service/http.md +161 -0
- package/docs/content/docs/service/interpolation.md +5 -0
- package/docs/content/docs/service/log.md +1 -1
- package/docs/content/docs/service/parse.md +5 -0
- package/docs/content/docs/service/rootElement.md +5 -0
- package/docs/content/docs/service/rootScope.md +5 -0
- package/docs/content/docs/service/sce.md +194 -0
- package/docs/content/docs/service/templateRequest.md +5 -0
- package/docs/content/docs/values/_index.md +4 -0
- package/docs/content/docs/values/document.md +29 -0
- package/docs/content/docs/values/window.md +29 -0
- package/docs/layouts/shortcodes/version.html +1 -1
- package/docs/static/examples/document/document.html +3 -0
- package/docs/static/examples/i18n/i18n.html +77 -0
- package/docs/static/examples/window/window.html +4 -0
- package/docs/static/typedoc/assets/hierarchy.js +1 -1
- package/docs/static/typedoc/assets/highlight.css +0 -49
- package/docs/static/typedoc/assets/navigation.js +1 -1
- package/docs/static/typedoc/assets/search.js +1 -1
- package/docs/static/typedoc/classes/PubSubProvider.html +3 -2
- 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/HttpProviderDefaults.html +1 -1
- package/docs/static/typedoc/interfaces/RequestConfig.html +1 -1
- package/docs/static/typedoc/interfaces/RequestShortcutConfig.html +1 -1
- package/docs/static/typedoc/interfaces/ServiceProvider.html +3 -3
- package/docs/static/typedoc/types/HttpParamSerializer.html +2 -0
- package/docs/static/typedoc/types/{Expression.html → HttpParams.html} +1 -5
- package/legacy.d.ts +0 -921
- package/package.json +1 -1
- package/src/angular.js +2 -9
- package/src/animations/animate.js +1 -1
- package/src/animations/animation.js +7 -7
- package/src/core/compile/compile.js +3 -2
- package/src/core/controller/controller.js +10 -6
- package/src/core/controller/interface.ts +6 -0
- package/src/core/di/injector.js +1 -1
- package/src/core/di/internal-injector.js +2 -0
- package/src/core/di/ng-module.js +16 -13
- package/src/core/filter/filter.js +3 -3
- package/src/core/interpolate/interface.ts +14 -0
- package/src/core/interpolate/interpolate.js +7 -5
- package/src/core/scope/scope.js +4 -1
- package/src/directive/http/delete.spec.js +5 -8
- package/src/directive/http/http.js +16 -16
- package/src/directive/http/interface.ts +36 -0
- package/src/directive/http/put.spec.js +5 -8
- package/src/directive/include/include.js +2 -2
- package/src/{services/http-backend/http-backend.html → directive/inject/inject.html} +1 -4
- package/src/directive/inject/inject.js +35 -0
- package/src/directive/inject/inject.spec.js +108 -0
- package/src/{services/http-backend/http-backend.test.js → directive/inject/inject.test.js} +1 -1
- package/src/directive/script/script.js +1 -1
- package/src/directive/setter/setter.js +2 -2
- package/src/filters/filter.js +1 -1
- package/src/filters/filters.js +1 -1
- package/src/filters/interface.ts +9 -0
- package/src/filters/limit-to.js +1 -1
- package/src/filters/order-by.js +1 -1
- package/src/index.ts +96 -0
- package/src/injection-tokens.js +4 -1
- package/src/interface.ts +102 -93
- package/src/ng.js +6 -4
- package/src/ng.spec.js +12 -0
- package/src/router/directives/state-directives.js +1 -1
- package/src/router/directives/view-directive.spec.js +19 -35
- package/src/router/state/interface.ts +8 -8
- package/src/router/state/state-builder.js +4 -4
- package/src/router/state/state-registry.js +7 -2
- package/src/router/state/state-service.js +2 -14
- package/src/router/state-filters.js +2 -2
- package/src/router/template-factory.js +3 -3
- package/src/router/template-factory.spec.js +10 -19
- package/src/router/transition/hook-builder.js +5 -1
- package/src/router/transition/hook-registry.js +12 -3
- package/src/router/transition/transition-service.js +4 -9
- package/src/router/transition/transition.js +3 -2
- package/src/router/url/url-service.js +2 -2
- package/src/router/view/view.js +3 -15
- package/src/router/view-scroll.js +2 -2
- package/src/services/{anchor-scroll.js → anchor-scroll/anchor-scroll.js} +4 -4
- package/src/services/exception/exception-handler.js +1 -1
- package/src/services/exception/interface.ts +1 -1
- package/src/services/http/http.js +200 -13
- package/src/services/http/http.spec.js +388 -9
- package/src/services/http/interface.ts +13 -0
- package/src/services/location/location.js +1 -1
- package/src/services/sce/sce.js +18 -13
- package/src/services/template-cache/template-cache.js +2 -2
- package/src/services/template-request/interface.ts +23 -0
- package/src/services/{template-request.js → template-request/template-request.js} +6 -6
- package/src/shared/common.js +7 -80
- package/src/shared/hof.js +23 -17
- package/typedoc.json +1 -1
- package/@types/services/cookie-reader.d.ts +0 -4
- package/@types/services/http-backend/http-backend.d.ts +0 -58
- package/@types/services/template-cache/interface.d.ts +0 -10
- package/docs/static/typedoc/interfaces/ChangesObject.html +0 -6
- package/docs/static/typedoc/interfaces/ComponentOptions.html +0 -16
- package/docs/static/typedoc/interfaces/Controller.html +0 -12
- package/docs/static/typedoc/interfaces/Directive.html +0 -37
- package/docs/static/typedoc/interfaces/DirectivePrePost.html +0 -4
- package/docs/static/typedoc/interfaces/NgModelController.html +0 -30
- package/docs/static/typedoc/interfaces/NgModelOptions.html +0 -16
- package/docs/static/typedoc/interfaces/Provider.html +0 -34
- package/docs/static/typedoc/interfaces/TemplateCache.html +0 -7
- package/docs/static/typedoc/interfaces/TranscludeFunctionObject.html +0 -8
- package/docs/static/typedoc/types/AnnotatedDirectiveFactory.html +0 -1
- package/docs/static/typedoc/types/AnnotatedFactory.html +0 -8
- package/docs/static/typedoc/types/CloneAttachFunction.html +0 -2
- package/docs/static/typedoc/types/ControllerConstructor.html +0 -2
- package/docs/static/typedoc/types/DirectiveCompileFn.html +0 -2
- package/docs/static/typedoc/types/DirectiveController.html +0 -2
- package/docs/static/typedoc/types/DirectiveFactory.html +0 -1
- package/docs/static/typedoc/types/DirectiveFactoryFn.html +0 -1
- package/docs/static/typedoc/types/DirectiveLinkFn.html +0 -2
- package/docs/static/typedoc/types/ExpandoStore.html +0 -2
- package/docs/static/typedoc/types/FilterFactory.html +0 -2
- package/docs/static/typedoc/types/FilterFn.html +0 -2
- package/docs/static/typedoc/types/Injectable.html +0 -4
- package/docs/static/typedoc/types/InjectableClass.html +0 -1
- package/docs/static/typedoc/types/InjectableFactory.html +0 -1
- package/docs/static/typedoc/types/OnChangesObject.html +0 -2
- package/docs/static/typedoc/types/SwapModeType.html +0 -2
- package/docs/static/typedoc/types/TController.html +0 -2
- package/docs/static/typedoc/variables/SwapMode.html +0 -11
- package/src/filters/limit-to.md +0 -19
- package/src/filters/order-by.md +0 -83
- package/src/router/state/README.md +0 -21
- package/src/services/cookie-reader.js +0 -48
- package/src/services/http/http.md +0 -413
- package/src/services/http-backend/http-backend.js +0 -158
- package/src/services/http-backend/http-backend.spec.js +0 -389
- package/src/services/sce/sce.md +0 -300
- package/src/services/template-cache/interface.ts +0 -10
- /package/src/services/{anchor-scroll.html → anchor-scroll/anchor-scroll.html} +0 -0
package/dist/angular-ts.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* Version: 0.9.
|
|
1
|
+
/* Version: 0.9.4 - October 22, 2025 23:02:04 */
|
|
2
2
|
const VALID_CLASS = "ng-valid";
|
|
3
3
|
const INVALID_CLASS = "ng-invalid";
|
|
4
4
|
const PRISTINE_CLASS = "ng-pristine";
|
|
@@ -1792,11 +1792,11 @@ const $injectTokens = Object.freeze({
|
|
|
1792
1792
|
$aria: "$aria",
|
|
1793
1793
|
$compile: "$compile",
|
|
1794
1794
|
$controller: "$controller",
|
|
1795
|
+
$document: "$document",
|
|
1795
1796
|
$eventBus: "$eventBus",
|
|
1796
1797
|
$exceptionHandler: "$exceptionHandler",
|
|
1797
1798
|
$filter: "$filter",
|
|
1798
1799
|
$http: "$http",
|
|
1799
|
-
$httpBackend: "$httpBackend",
|
|
1800
1800
|
$httpParamSerializer: "$httpParamSerializer",
|
|
1801
1801
|
$interpolate: "$interpolate",
|
|
1802
1802
|
$location: "$location",
|
|
@@ -1810,6 +1810,8 @@ const $injectTokens = Object.freeze({
|
|
|
1810
1810
|
$sceDelegate: "$sceDelegate",
|
|
1811
1811
|
$state: "$state",
|
|
1812
1812
|
$stateRegistry: "$stateRegistry",
|
|
1813
|
+
$$sanitizeUri: "$$sanitizeUri",
|
|
1814
|
+
$$sanitizeUriProvider: "$$sanitizeUriProvider",
|
|
1813
1815
|
$templateCache: "$templateCache",
|
|
1814
1816
|
$templateFactory: "$templateFactory",
|
|
1815
1817
|
$templateRequest: "$templateRequest",
|
|
@@ -1817,6 +1819,7 @@ const $injectTokens = Object.freeze({
|
|
|
1817
1819
|
$urlConfig: "$urlConfig",
|
|
1818
1820
|
$url: "$url",
|
|
1819
1821
|
$view: "$view",
|
|
1822
|
+
$window: "$window",
|
|
1820
1823
|
// provide literals
|
|
1821
1824
|
$provide: "$provide",
|
|
1822
1825
|
$injector: "$injector",
|
|
@@ -1859,7 +1862,7 @@ class NgModule {
|
|
|
1859
1862
|
/**
|
|
1860
1863
|
* @param {string} name - Name of the module
|
|
1861
1864
|
* @param {Array<string>} requires - List of modules which the injector will load before the current module
|
|
1862
|
-
* @param {import("../../interface.js").Injectable} [configFn]
|
|
1865
|
+
* @param {import("../../interface.js").Injectable<any>} [configFn]
|
|
1863
1866
|
*/
|
|
1864
1867
|
constructor(name, requires, configFn) {
|
|
1865
1868
|
assert(isString(name), "name required");
|
|
@@ -1885,12 +1888,14 @@ class NgModule {
|
|
|
1885
1888
|
/** @type {!Array<Array<*>>} */
|
|
1886
1889
|
this.configBlocks = [];
|
|
1887
1890
|
|
|
1888
|
-
/** @type {!Array.<import("../../interface.js").Injectable
|
|
1891
|
+
/** @type {!Array.<import("../../interface.js").Injectable<any>>} */
|
|
1889
1892
|
this.runBlocks = [];
|
|
1890
1893
|
|
|
1891
1894
|
if (configFn) {
|
|
1892
1895
|
this.config(configFn);
|
|
1893
1896
|
}
|
|
1897
|
+
|
|
1898
|
+
this.services = [];
|
|
1894
1899
|
}
|
|
1895
1900
|
|
|
1896
1901
|
/**
|
|
@@ -1915,7 +1920,7 @@ class NgModule {
|
|
|
1915
1920
|
|
|
1916
1921
|
/**
|
|
1917
1922
|
*
|
|
1918
|
-
* @param {import("../../interface.
|
|
1923
|
+
* @param {import("../../interface.ts").Injectable<any>} configFn
|
|
1919
1924
|
* @returns {NgModule}
|
|
1920
1925
|
*/
|
|
1921
1926
|
config(configFn) {
|
|
@@ -1924,7 +1929,7 @@ class NgModule {
|
|
|
1924
1929
|
}
|
|
1925
1930
|
|
|
1926
1931
|
/**
|
|
1927
|
-
* @param {import("../../interface.
|
|
1932
|
+
* @param {import("../../interface.ts").Injectable<any>} block
|
|
1928
1933
|
* @returns {NgModule}
|
|
1929
1934
|
*/
|
|
1930
1935
|
run(block) {
|
|
@@ -1934,7 +1939,7 @@ class NgModule {
|
|
|
1934
1939
|
|
|
1935
1940
|
/**
|
|
1936
1941
|
* @param {string} name
|
|
1937
|
-
* @param {import("../../interface.
|
|
1942
|
+
* @param {import("../../interface.ts").Component} options
|
|
1938
1943
|
* @returns {NgModule}
|
|
1939
1944
|
*/
|
|
1940
1945
|
component(name, options) {
|
|
@@ -1947,7 +1952,7 @@ class NgModule {
|
|
|
1947
1952
|
|
|
1948
1953
|
/**
|
|
1949
1954
|
* @param {string} name
|
|
1950
|
-
* @param {import("../../interface.
|
|
1955
|
+
* @param {import("../../interface.ts").Injectable<any>} providerFunction
|
|
1951
1956
|
* @returns {NgModule}
|
|
1952
1957
|
*/
|
|
1953
1958
|
factory(name, providerFunction) {
|
|
@@ -1960,20 +1965,21 @@ class NgModule {
|
|
|
1960
1965
|
|
|
1961
1966
|
/**
|
|
1962
1967
|
* @param {string} name
|
|
1963
|
-
* @param {import("../../interface.
|
|
1968
|
+
* @param {import("../../interface.ts").Injectable<any>} serviceFunction
|
|
1964
1969
|
* @returns {NgModule}
|
|
1965
1970
|
*/
|
|
1966
1971
|
service(name, serviceFunction) {
|
|
1967
1972
|
if (serviceFunction && isFunction(serviceFunction)) {
|
|
1968
1973
|
serviceFunction["$$moduleName"] = name;
|
|
1969
1974
|
}
|
|
1975
|
+
this.services.push(name);
|
|
1970
1976
|
this.invokeQueue.push([$injectTokens.$provide, "service", [name, serviceFunction]]);
|
|
1971
1977
|
return this;
|
|
1972
1978
|
}
|
|
1973
1979
|
|
|
1974
1980
|
/**
|
|
1975
1981
|
* @param {string} name
|
|
1976
|
-
* @param {import("../../interface.
|
|
1982
|
+
* @param {import("../../interface.ts").Injectable<any>} providerType
|
|
1977
1983
|
* @returns {NgModule}
|
|
1978
1984
|
*/
|
|
1979
1985
|
provider(name, providerType) {
|
|
@@ -1986,7 +1992,7 @@ class NgModule {
|
|
|
1986
1992
|
|
|
1987
1993
|
/**
|
|
1988
1994
|
* @param {string} name
|
|
1989
|
-
* @param {import("../../interface.js").Injectable} decorFn
|
|
1995
|
+
* @param {import("../../interface.js").Injectable<any>} decorFn
|
|
1990
1996
|
* @returns {NgModule}
|
|
1991
1997
|
*/
|
|
1992
1998
|
decorator(name, decorFn) {
|
|
@@ -1999,7 +2005,7 @@ class NgModule {
|
|
|
1999
2005
|
|
|
2000
2006
|
/**
|
|
2001
2007
|
* @param {string} name
|
|
2002
|
-
* @param {import("../../interface.js").Injectable} directiveFactory
|
|
2008
|
+
* @param {import("../../interface.js").Injectable<any>} directiveFactory
|
|
2003
2009
|
* @returns {NgModule}
|
|
2004
2010
|
*/
|
|
2005
2011
|
directive(name, directiveFactory) {
|
|
@@ -2016,7 +2022,7 @@ class NgModule {
|
|
|
2016
2022
|
|
|
2017
2023
|
/**
|
|
2018
2024
|
* @param {string} name
|
|
2019
|
-
* @param {import("../../interface.js").Injectable} animationFactory
|
|
2025
|
+
* @param {import("../../interface.js").Injectable<any>} animationFactory
|
|
2020
2026
|
* @returns {NgModule}
|
|
2021
2027
|
*/
|
|
2022
2028
|
animation(name, animationFactory) {
|
|
@@ -2033,7 +2039,7 @@ class NgModule {
|
|
|
2033
2039
|
|
|
2034
2040
|
/**
|
|
2035
2041
|
* @param {string} name
|
|
2036
|
-
* @param {import("../../interface.js").Injectable} filterFn
|
|
2042
|
+
* @param {import("../../interface.js").Injectable<any>} filterFn
|
|
2037
2043
|
* @return {NgModule}
|
|
2038
2044
|
*/
|
|
2039
2045
|
filter(name, filterFn) {
|
|
@@ -2046,7 +2052,7 @@ class NgModule {
|
|
|
2046
2052
|
|
|
2047
2053
|
/**
|
|
2048
2054
|
* @param {string} name
|
|
2049
|
-
* @param {import("../../interface.js").Injectable} ctlFn
|
|
2055
|
+
* @param {import("../../interface.js").Injectable<any>} ctlFn
|
|
2050
2056
|
* @returns {NgModule}
|
|
2051
2057
|
*/
|
|
2052
2058
|
controller(name, ctlFn) {
|
|
@@ -2230,6 +2236,8 @@ class ProviderInjector extends AbstractInjector {
|
|
|
2230
2236
|
this.path.join(" <- "),
|
|
2231
2237
|
);
|
|
2232
2238
|
}
|
|
2239
|
+
|
|
2240
|
+
loadNewModules() {}
|
|
2233
2241
|
}
|
|
2234
2242
|
|
|
2235
2243
|
/**
|
|
@@ -2401,7 +2409,7 @@ function createInjector(modulesToLoad, strictDi = false) {
|
|
|
2401
2409
|
/**
|
|
2402
2410
|
* Registers a provider.
|
|
2403
2411
|
* @param {string} name
|
|
2404
|
-
* @param {import('../../interface.ts').ServiceProvider | import('../../interface.ts').
|
|
2412
|
+
* @param {import('../../interface.ts').ServiceProvider | import('../../interface.ts').Injectable<any>} provider
|
|
2405
2413
|
* @returns {import('../../interface.ts').ServiceProvider}
|
|
2406
2414
|
*/
|
|
2407
2415
|
function provider(name, provider) {
|
|
@@ -2920,7 +2928,7 @@ class ControllerProvider {
|
|
|
2920
2928
|
|
|
2921
2929
|
/**
|
|
2922
2930
|
* @param {import("../../core/di/internal-injector.js").InjectorService} $injector
|
|
2923
|
-
* @returns {
|
|
2931
|
+
* @returns {import("./interface.js").ControllerService} A service function that creates controllers.
|
|
2924
2932
|
*/
|
|
2925
2933
|
($injector) => {
|
|
2926
2934
|
return (expression, locals, later, ident) => {
|
|
@@ -2931,7 +2939,7 @@ class ControllerProvider {
|
|
|
2931
2939
|
later = later === true;
|
|
2932
2940
|
|
|
2933
2941
|
if (isString(expression)) {
|
|
2934
|
-
match = expression.match(CNTRL_REG);
|
|
2942
|
+
match = /** @type {string} */ (expression).match(CNTRL_REG);
|
|
2935
2943
|
if (!match) {
|
|
2936
2944
|
throw $controllerMinErr(
|
|
2937
2945
|
"ctrlfmt",
|
|
@@ -2968,7 +2976,7 @@ class ControllerProvider {
|
|
|
2968
2976
|
locals,
|
|
2969
2977
|
identifier,
|
|
2970
2978
|
instance,
|
|
2971
|
-
constructor || expression.name,
|
|
2979
|
+
constructor || /** @type {any} */ (expression).name,
|
|
2972
2980
|
);
|
|
2973
2981
|
}
|
|
2974
2982
|
|
|
@@ -2991,7 +2999,7 @@ class ControllerProvider {
|
|
|
2991
2999
|
locals,
|
|
2992
3000
|
identifier,
|
|
2993
3001
|
instance,
|
|
2994
|
-
constructor || expression.name,
|
|
3002
|
+
constructor || /** @type {any} */ (expression).name,
|
|
2995
3003
|
);
|
|
2996
3004
|
}
|
|
2997
3005
|
}
|
|
@@ -3000,14 +3008,18 @@ class ControllerProvider {
|
|
|
3000
3008
|
}.bind(this, { instance, identifier });
|
|
3001
3009
|
}
|
|
3002
3010
|
|
|
3003
|
-
instance = $injector.instantiate(
|
|
3011
|
+
instance = $injector.instantiate(
|
|
3012
|
+
/** @type {any} */ (expression),
|
|
3013
|
+
locals,
|
|
3014
|
+
constructor,
|
|
3015
|
+
);
|
|
3004
3016
|
|
|
3005
3017
|
if (identifier) {
|
|
3006
3018
|
this.addIdentifier(
|
|
3007
3019
|
locals,
|
|
3008
3020
|
identifier,
|
|
3009
3021
|
instance,
|
|
3010
|
-
constructor || expression.name,
|
|
3022
|
+
constructor || /** @type {any} */ (expression).name,
|
|
3011
3023
|
);
|
|
3012
3024
|
}
|
|
3013
3025
|
|
|
@@ -3158,8 +3170,6 @@ function trimEmptyHash(url) {
|
|
|
3158
3170
|
return url.replace(/#$/, "");
|
|
3159
3171
|
}
|
|
3160
3172
|
|
|
3161
|
-
/** @typedef {import("../exception/interface.ts").Interface } ErrorHandler */
|
|
3162
|
-
|
|
3163
3173
|
const $sceMinErr = minErr("$sce");
|
|
3164
3174
|
|
|
3165
3175
|
const SCE_CONTEXTS = {
|
|
@@ -3449,14 +3459,14 @@ class SceDelegateProvider {
|
|
|
3449
3459
|
};
|
|
3450
3460
|
|
|
3451
3461
|
this.$get = [
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3462
|
+
$injectTokens.$injector,
|
|
3463
|
+
$injectTokens.$$sanitizeUri,
|
|
3464
|
+
$injectTokens.$exceptionHandler,
|
|
3455
3465
|
/**
|
|
3456
3466
|
*
|
|
3457
|
-
* @param {
|
|
3467
|
+
* @param {ng.InjectorService} $injector
|
|
3458
3468
|
* @param {*} $$sanitizeUri
|
|
3459
|
-
* @param {
|
|
3469
|
+
* @param {ng.ExceptionHandlerService} $exceptionHandler
|
|
3460
3470
|
* @returns
|
|
3461
3471
|
*/
|
|
3462
3472
|
function ($injector, $$sanitizeUri, $exceptionHandler) {
|
|
@@ -3475,7 +3485,7 @@ class SceDelegateProvider {
|
|
|
3475
3485
|
|
|
3476
3486
|
/**
|
|
3477
3487
|
* @param {string|RegExp} matcher
|
|
3478
|
-
* @param {import("../../shared/url-utils/interface").ParsedUrl} parsedUrl
|
|
3488
|
+
* @param {import("../../shared/url-utils/interface.ts").ParsedUrl} parsedUrl
|
|
3479
3489
|
* @return {boolean}
|
|
3480
3490
|
*/
|
|
3481
3491
|
function matchUrl(matcher, parsedUrl) {
|
|
@@ -3730,9 +3740,15 @@ function SceProvider() {
|
|
|
3730
3740
|
};
|
|
3731
3741
|
|
|
3732
3742
|
this.$get = [
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3743
|
+
$injectTokens.$parse,
|
|
3744
|
+
$injectTokens.$sceDelegate,
|
|
3745
|
+
/**
|
|
3746
|
+
*
|
|
3747
|
+
* @param {ng.ParseService} $parse
|
|
3748
|
+
* @param $sceDelegate
|
|
3749
|
+
* @return {*}
|
|
3750
|
+
*/
|
|
3751
|
+
($parse, $sceDelegate) => {
|
|
3736
3752
|
const sce = shallowCopy(SCE_CONTEXTS);
|
|
3737
3753
|
|
|
3738
3754
|
/**
|
|
@@ -3766,14 +3782,14 @@ function SceProvider() {
|
|
|
3766
3782
|
*
|
|
3767
3783
|
* @param {string} type The SCE context in which this result will be used.
|
|
3768
3784
|
* @param {string} expr String expression to compile.
|
|
3769
|
-
* @return {
|
|
3785
|
+
* @return {import("../../core/parse/interface.js").CompiledExpression} A function which represents the compiled expression:
|
|
3770
3786
|
*
|
|
3771
3787
|
* * `context` – `{object}` – an object against which any expressions embedded in the
|
|
3772
3788
|
* strings are evaluated against (typically a scope object).
|
|
3773
3789
|
* * `locals` – `{object=}` – local variables context object, useful for overriding values
|
|
3774
3790
|
* in `context`.
|
|
3775
3791
|
*/
|
|
3776
|
-
sce.parseAs =
|
|
3792
|
+
sce.parseAs = (type, expr) => {
|
|
3777
3793
|
const parsed = $parse(expr);
|
|
3778
3794
|
if (parsed.literal && parsed.constant) {
|
|
3779
3795
|
return parsed;
|
|
@@ -4511,7 +4527,7 @@ const EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/;
|
|
|
4511
4527
|
const DirectiveSuffix = "Directive";
|
|
4512
4528
|
|
|
4513
4529
|
class CompileProvider {
|
|
4514
|
-
/* @ignore */ static $inject = [
|
|
4530
|
+
/* @ignore */ static $inject = [$injectTokens.$provide, $injectTokens.$$sanitizeUriProvider];
|
|
4515
4531
|
|
|
4516
4532
|
/**
|
|
4517
4533
|
* @param {import('../../interface.js').Provider} $provide
|
|
@@ -4705,7 +4721,7 @@ class CompileProvider {
|
|
|
4705
4721
|
/**
|
|
4706
4722
|
* @param {string|Object} name Name of the component in camelCase (i.e. `myComp` which will match `<my-comp>`),
|
|
4707
4723
|
* or an object map of components where the keys are the names and the values are the component definition objects.
|
|
4708
|
-
* @param {import("../../interface.js").
|
|
4724
|
+
* @param {import("../../interface.js").Component} options Component definition object (a simplified
|
|
4709
4725
|
* {directive definition object}),
|
|
4710
4726
|
* with the following properties (all optional):
|
|
4711
4727
|
*
|
|
@@ -10619,7 +10635,7 @@ function ngValueDirective() {
|
|
|
10619
10635
|
scriptDirective.$inject = ["$templateCache"];
|
|
10620
10636
|
|
|
10621
10637
|
/**
|
|
10622
|
-
* @param {
|
|
10638
|
+
* @param {ng.TemplateCacheService} $templateCache
|
|
10623
10639
|
* @returns {import('../../interface.ts').Directive}
|
|
10624
10640
|
*/
|
|
10625
10641
|
function scriptDirective($templateCache) {
|
|
@@ -11636,9 +11652,9 @@ ngIncludeDirective.$inject = [
|
|
|
11636
11652
|
/**
|
|
11637
11653
|
*
|
|
11638
11654
|
* @param {*} $templateRequest
|
|
11639
|
-
* @param {import("../../services/anchor-scroll.js").AnchorScrollFunction} $anchorScroll
|
|
11655
|
+
* @param {import("../../services/anchor-scroll/anchor-scroll.js").AnchorScrollFunction} $anchorScroll
|
|
11640
11656
|
* @param {*} $animate
|
|
11641
|
-
* @param {import('../../services/exception/interface.ts').
|
|
11657
|
+
* @param {import('../../services/exception/interface.ts').ErrorHandler} $exceptionHandler
|
|
11642
11658
|
* @returns {import('../../interface.js').Directive}
|
|
11643
11659
|
*/
|
|
11644
11660
|
function ngIncludeDirective(
|
|
@@ -13478,8 +13494,8 @@ class AnchorScrollProvider {
|
|
|
13478
13494
|
$injectTokens.$rootScope,
|
|
13479
13495
|
/**
|
|
13480
13496
|
*
|
|
13481
|
-
* @param {import('
|
|
13482
|
-
* @param {import('
|
|
13497
|
+
* @param {import('../../services/location/location.js').Location} $location
|
|
13498
|
+
* @param {import('../../core/scope/scope.js').Scope} $rootScope
|
|
13483
13499
|
* @returns
|
|
13484
13500
|
*/
|
|
13485
13501
|
function ($location, $rootScope) {
|
|
@@ -14026,7 +14042,7 @@ function AnimateProvider($provide) {
|
|
|
14026
14042
|
* ```
|
|
14027
14043
|
*
|
|
14028
14044
|
* @param {string} name The name of the animation (this is what the class-based CSS value will be compared to).
|
|
14029
|
-
* @param {import("../interface.ts").Injectable} factory The factory function that will be executed to return the animation
|
|
14045
|
+
* @param {import("../interface.ts").Injectable<any>} factory The factory function that will be executed to return the animation
|
|
14030
14046
|
* object.
|
|
14031
14047
|
*/
|
|
14032
14048
|
this.register = function (name, factory) {
|
|
@@ -14694,11 +14710,11 @@ class AnimateRunner {
|
|
|
14694
14710
|
*/
|
|
14695
14711
|
class TemplateCacheProvider {
|
|
14696
14712
|
constructor() {
|
|
14697
|
-
/** @type {
|
|
14713
|
+
/** @type {ng.TemplateCacheService} */
|
|
14698
14714
|
this.cache = new Map();
|
|
14699
14715
|
}
|
|
14700
14716
|
/**
|
|
14701
|
-
* @returns {
|
|
14717
|
+
* @returns {ng.TemplateCacheService}
|
|
14702
14718
|
*/
|
|
14703
14719
|
$get() {
|
|
14704
14720
|
return this.cache;
|
|
@@ -14751,7 +14767,7 @@ class TemplateCacheProvider {
|
|
|
14751
14767
|
|
|
14752
14768
|
/** @typedef {import('../log/interface.ts').LogService} LogService */
|
|
14753
14769
|
|
|
14754
|
-
/** @typedef {import("./interface.ts").
|
|
14770
|
+
/** @typedef {import("./interface.ts").ErrorHandler} ErrorHandler */
|
|
14755
14771
|
|
|
14756
14772
|
/**
|
|
14757
14773
|
* Provider for `$exceptionHandler` service. Delegates uncaught exceptions to `$log.error()` by default.
|
|
@@ -14782,7 +14798,7 @@ class ExceptionHandlerProvider {
|
|
|
14782
14798
|
}
|
|
14783
14799
|
|
|
14784
14800
|
/**
|
|
14785
|
-
* @returns {
|
|
14801
|
+
* @returns {ng.FilterFn}
|
|
14786
14802
|
*/
|
|
14787
14803
|
function filterFilter() {
|
|
14788
14804
|
/**
|
|
@@ -14986,7 +15002,7 @@ function getTypeForFilter(val) {
|
|
|
14986
15002
|
}
|
|
14987
15003
|
|
|
14988
15004
|
/**
|
|
14989
|
-
* @returns {
|
|
15005
|
+
* @returns {ng.FilterFn}
|
|
14990
15006
|
*/
|
|
14991
15007
|
function jsonFilter() {
|
|
14992
15008
|
return function (object, spacing) {
|
|
@@ -14998,7 +15014,7 @@ function jsonFilter() {
|
|
|
14998
15014
|
}
|
|
14999
15015
|
|
|
15000
15016
|
/**
|
|
15001
|
-
* @returns {
|
|
15017
|
+
* @returns {ng.FilterFn}
|
|
15002
15018
|
*/
|
|
15003
15019
|
function limitToFilter() {
|
|
15004
15020
|
/**
|
|
@@ -15048,7 +15064,7 @@ function sliceFn(input, begin, end) {
|
|
|
15048
15064
|
orderByFilter.$inject = [$injectTokens.$parse];
|
|
15049
15065
|
|
|
15050
15066
|
/**
|
|
15051
|
-
* @returns {
|
|
15067
|
+
* @returns {ng.FilterFn}
|
|
15052
15068
|
*/
|
|
15053
15069
|
function orderByFilter($parse) {
|
|
15054
15070
|
return function (array, sortPredicate, reverseOrder, compareFn) {
|
|
@@ -15230,7 +15246,7 @@ $IsStateFilter.$inject = [$injectTokens.$state];
|
|
|
15230
15246
|
* ```
|
|
15231
15247
|
*
|
|
15232
15248
|
* @param {import('./state/state-service.js').StateProvider} $state
|
|
15233
|
-
* @returns {
|
|
15249
|
+
* @returns {ng.FilterFn}
|
|
15234
15250
|
*/
|
|
15235
15251
|
function $IsStateFilter($state) {
|
|
15236
15252
|
const isFilter = (state, params, options) =>
|
|
@@ -15252,7 +15268,7 @@ $IncludedByStateFilter.$inject = [$injectTokens.$state];
|
|
|
15252
15268
|
* ```
|
|
15253
15269
|
*
|
|
15254
15270
|
* @param {import('./state/state-service.js').StateProvider} $state
|
|
15255
|
-
* @returns {
|
|
15271
|
+
* @returns {ng.FilterFn}
|
|
15256
15272
|
*/
|
|
15257
15273
|
function $IncludedByStateFilter($state) {
|
|
15258
15274
|
const includesFilter = function (state, params, options) {
|
|
@@ -15283,8 +15299,8 @@ class FilterProvider {
|
|
|
15283
15299
|
}
|
|
15284
15300
|
|
|
15285
15301
|
/**
|
|
15286
|
-
* @param {string|Record<string,
|
|
15287
|
-
* @param {
|
|
15302
|
+
* @param {string|Record<string, ng.FilterFn>} name
|
|
15303
|
+
* @param {ng.FilterService} [factory]
|
|
15288
15304
|
* @return {import('../../interface.ts').Provider}
|
|
15289
15305
|
*/
|
|
15290
15306
|
register(name, factory) {
|
|
@@ -15300,7 +15316,7 @@ class FilterProvider {
|
|
|
15300
15316
|
$injectTokens.$injector,
|
|
15301
15317
|
/**
|
|
15302
15318
|
* @param {import("../../core/di/internal-injector.js").InjectorService} $injector
|
|
15303
|
-
* @returns {
|
|
15319
|
+
* @returns {ng.FilterService}
|
|
15304
15320
|
*/
|
|
15305
15321
|
($injector) => (/** @type {string} */ name) => $injector.get(name + SUFFIX),
|
|
15306
15322
|
];
|
|
@@ -17562,13 +17578,13 @@ class InterpolateProvider {
|
|
|
17562
17578
|
}
|
|
17563
17579
|
|
|
17564
17580
|
$get = [
|
|
17565
|
-
|
|
17566
|
-
|
|
17581
|
+
$injectTokens.$parse,
|
|
17582
|
+
$injectTokens.$sce,
|
|
17567
17583
|
/**
|
|
17568
17584
|
*
|
|
17569
|
-
* @param {
|
|
17585
|
+
* @param {ng.ParseService} $parse
|
|
17570
17586
|
* @param {*} $sce
|
|
17571
|
-
* @returns
|
|
17587
|
+
* @returns {ng.InterpolateService}
|
|
17572
17588
|
*/
|
|
17573
17589
|
function ($parse, $sce) {
|
|
17574
17590
|
/** @type {InterpolateProvider} */
|
|
@@ -17817,7 +17833,7 @@ class InterpolateProvider {
|
|
|
17817
17833
|
return concat.join("");
|
|
17818
17834
|
};
|
|
17819
17835
|
|
|
17820
|
-
return extend(
|
|
17836
|
+
return /**@type {import("./interface.js").InterpolationFunction} */ extend(
|
|
17821
17837
|
(context, cb) => {
|
|
17822
17838
|
let i = 0;
|
|
17823
17839
|
const ii = expressions.length;
|
|
@@ -17911,6 +17927,7 @@ class InterpolateProvider {
|
|
|
17911
17927
|
return provider.endSymbol;
|
|
17912
17928
|
};
|
|
17913
17929
|
|
|
17930
|
+
// @ts-ignore
|
|
17914
17931
|
return $interpolate;
|
|
17915
17932
|
},
|
|
17916
17933
|
];
|
|
@@ -17918,51 +17935,6 @@ class InterpolateProvider {
|
|
|
17918
17935
|
|
|
17919
17936
|
let lastCookies = {};
|
|
17920
17937
|
let lastCookieString = "";
|
|
17921
|
-
|
|
17922
|
-
/**
|
|
17923
|
-
* @returns {Object<String, String>} List of all cookies
|
|
17924
|
-
*/
|
|
17925
|
-
function getCookies() {
|
|
17926
|
-
let cookieArray;
|
|
17927
|
-
let cookie;
|
|
17928
|
-
let i;
|
|
17929
|
-
let index;
|
|
17930
|
-
let name;
|
|
17931
|
-
const currentCookieString = document.cookie;
|
|
17932
|
-
|
|
17933
|
-
if (currentCookieString !== lastCookieString) {
|
|
17934
|
-
lastCookieString = currentCookieString;
|
|
17935
|
-
cookieArray = lastCookieString.split("; ");
|
|
17936
|
-
lastCookies = {};
|
|
17937
|
-
|
|
17938
|
-
for (i = 0; i < cookieArray.length; i++) {
|
|
17939
|
-
cookie = cookieArray[i];
|
|
17940
|
-
index = cookie.indexOf("=");
|
|
17941
|
-
if (index > 0) {
|
|
17942
|
-
// ignore nameless cookies
|
|
17943
|
-
name = safeDecodeURIComponent(cookie.substring(0, index));
|
|
17944
|
-
// the first value that is seen for a cookie is the most
|
|
17945
|
-
// specific one. values for the same cookie name that
|
|
17946
|
-
// follow are for less specific paths.
|
|
17947
|
-
if (isUndefined(lastCookies[name])) {
|
|
17948
|
-
lastCookies[name] = safeDecodeURIComponent(
|
|
17949
|
-
cookie.substring(index + 1),
|
|
17950
|
-
);
|
|
17951
|
-
}
|
|
17952
|
-
}
|
|
17953
|
-
}
|
|
17954
|
-
}
|
|
17955
|
-
return lastCookies;
|
|
17956
|
-
}
|
|
17957
|
-
|
|
17958
|
-
function safeDecodeURIComponent(str) {
|
|
17959
|
-
try {
|
|
17960
|
-
return decodeURIComponent(str);
|
|
17961
|
-
} catch {
|
|
17962
|
-
return str;
|
|
17963
|
-
}
|
|
17964
|
-
}
|
|
17965
|
-
|
|
17966
17938
|
const APPLICATION_JSON = "application/json";
|
|
17967
17939
|
const CONTENT_TYPE_APPLICATION_JSON = {
|
|
17968
17940
|
"Content-Type": `${APPLICATION_JSON};charset=utf-8`,
|
|
@@ -17994,8 +17966,12 @@ function serializeValue(v) {
|
|
|
17994
17966
|
* Note that serializer will sort the request parameters alphabetically.
|
|
17995
17967
|
*/
|
|
17996
17968
|
function HttpParamSerializerProvider() {
|
|
17997
|
-
|
|
17998
|
-
|
|
17969
|
+
/**
|
|
17970
|
+
* @returns {import('./interface.ts').HttpParamSerializer}
|
|
17971
|
+
* A function that serializes parameters into a query string.
|
|
17972
|
+
*/
|
|
17973
|
+
this.$get = () => {
|
|
17974
|
+
return (params) => {
|
|
17999
17975
|
if (!params) return "";
|
|
18000
17976
|
const parts = [];
|
|
18001
17977
|
Object.keys(params)
|
|
@@ -18321,17 +18297,15 @@ function HttpProvider() {
|
|
|
18321
18297
|
});
|
|
18322
18298
|
|
|
18323
18299
|
this.$get = [
|
|
18324
|
-
|
|
18325
|
-
|
|
18326
|
-
"$sce",
|
|
18300
|
+
$injectTokens.$injector,
|
|
18301
|
+
$injectTokens.$sce,
|
|
18327
18302
|
/**
|
|
18328
18303
|
*
|
|
18329
|
-
* @param {*} $httpBackend
|
|
18330
18304
|
* @param {import("../../core/di/internal-injector.js").InjectorService} $injector
|
|
18331
18305
|
* @param {*} $sce
|
|
18332
18306
|
* @returns
|
|
18333
18307
|
*/
|
|
18334
|
-
function ($
|
|
18308
|
+
function ($injector, $sce) {
|
|
18335
18309
|
/**
|
|
18336
18310
|
* @type {Map<string, string>}
|
|
18337
18311
|
*/
|
|
@@ -18667,7 +18641,7 @@ function HttpProvider() {
|
|
|
18667
18641
|
* Makes the request.
|
|
18668
18642
|
*
|
|
18669
18643
|
* !!! ACCESSES CLOSURE VARS:
|
|
18670
|
-
*
|
|
18644
|
+
* defaults, $log, $rootScope, defaultCache, $http.pendingRequests
|
|
18671
18645
|
*/
|
|
18672
18646
|
function sendReq(config, reqData) {
|
|
18673
18647
|
const { promise, resolve, reject } = Promise.withResolvers();
|
|
@@ -18738,7 +18712,7 @@ function HttpProvider() {
|
|
|
18738
18712
|
xsrfValue;
|
|
18739
18713
|
}
|
|
18740
18714
|
|
|
18741
|
-
|
|
18715
|
+
http(
|
|
18742
18716
|
config.method,
|
|
18743
18717
|
url,
|
|
18744
18718
|
reqData,
|
|
@@ -18754,6 +18728,10 @@ function HttpProvider() {
|
|
|
18754
18728
|
|
|
18755
18729
|
return promise;
|
|
18756
18730
|
|
|
18731
|
+
/**
|
|
18732
|
+
* @param eventHandlers
|
|
18733
|
+
* @return {Record<string, EventListener>}
|
|
18734
|
+
*/
|
|
18757
18735
|
function createApplyHandlers(eventHandlers) {
|
|
18758
18736
|
if (eventHandlers) {
|
|
18759
18737
|
const applyHandlers = {};
|
|
@@ -18770,12 +18748,14 @@ function HttpProvider() {
|
|
|
18770
18748
|
}
|
|
18771
18749
|
};
|
|
18772
18750
|
});
|
|
18773
|
-
return applyHandlers;
|
|
18751
|
+
return /** @type {Record<string, EventListener>} */ (applyHandlers);
|
|
18752
|
+
} else {
|
|
18753
|
+
return {};
|
|
18774
18754
|
}
|
|
18775
18755
|
}
|
|
18776
18756
|
|
|
18777
18757
|
/**
|
|
18778
|
-
* Callback registered to
|
|
18758
|
+
* Callback registered to http():
|
|
18779
18759
|
* - caches the response if desired
|
|
18780
18760
|
* - resolves the raw $http promise
|
|
18781
18761
|
* - calls $apply
|
|
@@ -18863,159 +18843,177 @@ function HttpProvider() {
|
|
|
18863
18843
|
}
|
|
18864
18844
|
|
|
18865
18845
|
/**
|
|
18866
|
-
*
|
|
18867
|
-
*
|
|
18868
|
-
*
|
|
18869
|
-
|
|
18870
|
-
|
|
18871
|
-
|
|
18872
|
-
|
|
18873
|
-
|
|
18874
|
-
}
|
|
18875
|
-
|
|
18876
|
-
|
|
18877
|
-
* @
|
|
18846
|
+
* Makes an HTTP request using XMLHttpRequest with flexible options.
|
|
18847
|
+
*
|
|
18848
|
+
* @param {string} method - The HTTP method (e.g., "GET", "POST").
|
|
18849
|
+
* @param {string} [url] - The URL to send the request to. Defaults to the current page URL.
|
|
18850
|
+
* @param {*} [post] - The body to send with the request, if any.
|
|
18851
|
+
* @param {function(number, any, string|null, string, string): void} [callback] - Callback invoked when the request completes.
|
|
18852
|
+
* @param {Object<string, string|undefined>} [headers] - Headers to set on the request.
|
|
18853
|
+
* @param {number|Promise<any>} [timeout] - Timeout in ms or a cancellable promise.
|
|
18854
|
+
* @param {boolean} [withCredentials] - Whether to send credentials with the request.
|
|
18855
|
+
* @param {XMLHttpRequestResponseType} [responseType] - The type of data expected in the response.
|
|
18856
|
+
* @param {Record<string, EventListener>} [eventHandlers] - Event listeners for the XMLHttpRequest object.
|
|
18857
|
+
* @param {Record<string, EventListener>} [uploadEventHandlers] - Event listeners for the XMLHttpRequest.upload object.
|
|
18858
|
+
* @returns {void}
|
|
18878
18859
|
*/
|
|
18879
|
-
function
|
|
18880
|
-
|
|
18881
|
-
|
|
18882
|
-
|
|
18883
|
-
|
|
18884
|
-
|
|
18885
|
-
|
|
18886
|
-
|
|
18887
|
-
|
|
18888
|
-
|
|
18889
|
-
|
|
18890
|
-
|
|
18891
|
-
|
|
18892
|
-
* @param {Object<string, EventListener>} [uploadEventHandlers] - Event listeners for the XMLHttpRequest.upload object.
|
|
18893
|
-
* @returns {void}
|
|
18894
|
-
*/
|
|
18895
|
-
return function (
|
|
18896
|
-
method,
|
|
18897
|
-
url,
|
|
18898
|
-
post,
|
|
18899
|
-
callback,
|
|
18900
|
-
headers,
|
|
18901
|
-
timeout,
|
|
18902
|
-
withCredentials,
|
|
18903
|
-
responseType,
|
|
18904
|
-
eventHandlers,
|
|
18905
|
-
uploadEventHandlers,
|
|
18906
|
-
) {
|
|
18907
|
-
url = url || trimEmptyHash(window.location.href);
|
|
18860
|
+
function http(
|
|
18861
|
+
method,
|
|
18862
|
+
url,
|
|
18863
|
+
post,
|
|
18864
|
+
callback,
|
|
18865
|
+
headers,
|
|
18866
|
+
timeout,
|
|
18867
|
+
withCredentials,
|
|
18868
|
+
responseType,
|
|
18869
|
+
eventHandlers,
|
|
18870
|
+
uploadEventHandlers,
|
|
18871
|
+
) {
|
|
18872
|
+
url = url || trimEmptyHash(window.location.href);
|
|
18908
18873
|
|
|
18909
|
-
|
|
18910
|
-
|
|
18911
|
-
|
|
18874
|
+
const xhr = new XMLHttpRequest();
|
|
18875
|
+
let abortedByTimeout = false;
|
|
18876
|
+
let timeoutId;
|
|
18912
18877
|
|
|
18913
|
-
|
|
18878
|
+
xhr.open(method, url, true);
|
|
18914
18879
|
|
|
18915
|
-
|
|
18916
|
-
|
|
18917
|
-
|
|
18918
|
-
|
|
18919
|
-
}
|
|
18880
|
+
if (headers) {
|
|
18881
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
18882
|
+
if (isDefined(value)) {
|
|
18883
|
+
xhr.setRequestHeader(key, value);
|
|
18920
18884
|
}
|
|
18921
18885
|
}
|
|
18886
|
+
}
|
|
18922
18887
|
|
|
18923
|
-
|
|
18924
|
-
|
|
18925
|
-
|
|
18888
|
+
xhr.onload = () => {
|
|
18889
|
+
let status = xhr.status || 0;
|
|
18890
|
+
const statusText = xhr.statusText || "";
|
|
18926
18891
|
|
|
18927
|
-
|
|
18928
|
-
|
|
18929
|
-
|
|
18930
|
-
: new URL(url).protocol === "file:"
|
|
18931
|
-
? 404
|
|
18932
|
-
: 0;
|
|
18933
|
-
}
|
|
18892
|
+
if (status === 0) {
|
|
18893
|
+
status = xhr.response ? 200 : new URL(url).protocol === "file:" ? 404 : 0;
|
|
18894
|
+
}
|
|
18934
18895
|
|
|
18935
|
-
|
|
18936
|
-
|
|
18937
|
-
|
|
18938
|
-
|
|
18939
|
-
|
|
18940
|
-
|
|
18941
|
-
|
|
18942
|
-
|
|
18896
|
+
completeRequest(
|
|
18897
|
+
status,
|
|
18898
|
+
xhr.response,
|
|
18899
|
+
xhr.getAllResponseHeaders(),
|
|
18900
|
+
statusText,
|
|
18901
|
+
"complete",
|
|
18902
|
+
);
|
|
18903
|
+
};
|
|
18943
18904
|
|
|
18944
|
-
|
|
18945
|
-
|
|
18905
|
+
xhr.onerror = () => completeRequest(-1, null, null, "", "error");
|
|
18906
|
+
xhr.ontimeout = () => completeRequest(-1, null, null, "", "timeout");
|
|
18946
18907
|
|
|
18947
|
-
|
|
18948
|
-
|
|
18949
|
-
|
|
18950
|
-
null,
|
|
18951
|
-
null,
|
|
18952
|
-
"",
|
|
18953
|
-
abortedByTimeout ? "timeout" : "abort",
|
|
18954
|
-
);
|
|
18955
|
-
};
|
|
18908
|
+
xhr.onabort = () => {
|
|
18909
|
+
completeRequest(-1, null, null, "", abortedByTimeout ? "timeout" : "abort");
|
|
18910
|
+
};
|
|
18956
18911
|
|
|
18957
|
-
|
|
18958
|
-
|
|
18959
|
-
|
|
18960
|
-
}
|
|
18912
|
+
if (eventHandlers) {
|
|
18913
|
+
for (const [key, handler] of Object.entries(eventHandlers)) {
|
|
18914
|
+
xhr.addEventListener(key, handler);
|
|
18961
18915
|
}
|
|
18916
|
+
}
|
|
18962
18917
|
|
|
18963
|
-
|
|
18964
|
-
|
|
18965
|
-
|
|
18966
|
-
}
|
|
18918
|
+
if (uploadEventHandlers) {
|
|
18919
|
+
for (const [key, handler] of Object.entries(uploadEventHandlers)) {
|
|
18920
|
+
xhr.upload.addEventListener(key, handler);
|
|
18967
18921
|
}
|
|
18922
|
+
}
|
|
18968
18923
|
|
|
18969
|
-
|
|
18970
|
-
|
|
18971
|
-
|
|
18924
|
+
if (withCredentials) {
|
|
18925
|
+
xhr.withCredentials = true;
|
|
18926
|
+
}
|
|
18972
18927
|
|
|
18973
|
-
|
|
18974
|
-
|
|
18975
|
-
|
|
18976
|
-
|
|
18977
|
-
|
|
18978
|
-
}
|
|
18928
|
+
if (responseType) {
|
|
18929
|
+
try {
|
|
18930
|
+
xhr.responseType = responseType;
|
|
18931
|
+
} catch (e) {
|
|
18932
|
+
if (responseType !== "json") throw e;
|
|
18979
18933
|
}
|
|
18934
|
+
}
|
|
18980
18935
|
|
|
18981
|
-
|
|
18936
|
+
xhr.send(isUndefined(post) ? null : post);
|
|
18982
18937
|
|
|
18983
|
-
|
|
18984
|
-
|
|
18985
|
-
|
|
18986
|
-
|
|
18987
|
-
|
|
18988
|
-
|
|
18989
|
-
|
|
18938
|
+
if (typeof timeout === "number" && timeout > 0) {
|
|
18939
|
+
timeoutId = setTimeout(() => timeoutRequest("timeout"), timeout);
|
|
18940
|
+
} else if (isPromiseLike(timeout)) {
|
|
18941
|
+
/** @type {Promise} */ (timeout).then(() => {
|
|
18942
|
+
timeoutRequest(isDefined(timeout["$$timeoutId"]) ? "timeout" : "abort");
|
|
18943
|
+
});
|
|
18944
|
+
}
|
|
18990
18945
|
|
|
18991
|
-
|
|
18992
|
-
|
|
18993
|
-
|
|
18994
|
-
|
|
18995
|
-
|
|
18996
|
-
|
|
18946
|
+
/**
|
|
18947
|
+
* @param {"timeout"|"abort"} reason
|
|
18948
|
+
*/
|
|
18949
|
+
function timeoutRequest(reason) {
|
|
18950
|
+
abortedByTimeout = reason === "timeout";
|
|
18951
|
+
if (xhr) xhr.abort();
|
|
18952
|
+
}
|
|
18953
|
+
|
|
18954
|
+
/**
|
|
18955
|
+
* @param {number} status - HTTP status code or -1 for network errors.
|
|
18956
|
+
* @param {*} response - The parsed or raw response from the server.
|
|
18957
|
+
* @param {string|null} headersString - The raw response headers as a string.
|
|
18958
|
+
* @param {string} statusText - The status text returned by the server.
|
|
18959
|
+
* @param {"complete"|"error"|"timeout"|"abort"} xhrStatus - Final status of the request.
|
|
18960
|
+
*/
|
|
18961
|
+
function completeRequest(
|
|
18962
|
+
status,
|
|
18963
|
+
response,
|
|
18964
|
+
headersString,
|
|
18965
|
+
statusText,
|
|
18966
|
+
xhrStatus,
|
|
18967
|
+
) {
|
|
18968
|
+
if (isDefined(timeoutId)) {
|
|
18969
|
+
clearTimeout(timeoutId);
|
|
18997
18970
|
}
|
|
18971
|
+
callback(status, response, headersString, statusText, xhrStatus);
|
|
18972
|
+
}
|
|
18973
|
+
}
|
|
18998
18974
|
|
|
18999
|
-
|
|
19000
|
-
|
|
19001
|
-
|
|
19002
|
-
|
|
19003
|
-
|
|
19004
|
-
|
|
19005
|
-
|
|
19006
|
-
|
|
19007
|
-
|
|
19008
|
-
|
|
19009
|
-
|
|
19010
|
-
|
|
19011
|
-
|
|
19012
|
-
)
|
|
19013
|
-
|
|
19014
|
-
|
|
18975
|
+
/**
|
|
18976
|
+
* @returns {Object<String, String>} List of all cookies
|
|
18977
|
+
*/
|
|
18978
|
+
function getCookies() {
|
|
18979
|
+
let cookieArray;
|
|
18980
|
+
let cookie;
|
|
18981
|
+
let i;
|
|
18982
|
+
let index;
|
|
18983
|
+
let name;
|
|
18984
|
+
const currentCookieString = document.cookie;
|
|
18985
|
+
|
|
18986
|
+
if (currentCookieString !== lastCookieString) {
|
|
18987
|
+
lastCookieString = currentCookieString;
|
|
18988
|
+
cookieArray = lastCookieString.split("; ");
|
|
18989
|
+
lastCookies = {};
|
|
18990
|
+
|
|
18991
|
+
for (i = 0; i < cookieArray.length; i++) {
|
|
18992
|
+
cookie = cookieArray[i];
|
|
18993
|
+
index = cookie.indexOf("=");
|
|
18994
|
+
if (index > 0) {
|
|
18995
|
+
// ignore nameless cookies
|
|
18996
|
+
name = safeDecodeURIComponent(cookie.substring(0, index));
|
|
18997
|
+
// the first value that is seen for a cookie is the most
|
|
18998
|
+
// specific one. values for the same cookie name that
|
|
18999
|
+
// follow are for less specific paths.
|
|
19000
|
+
if (isUndefined(lastCookies[name])) {
|
|
19001
|
+
lastCookies[name] = safeDecodeURIComponent(
|
|
19002
|
+
cookie.substring(index + 1),
|
|
19003
|
+
);
|
|
19004
|
+
}
|
|
19015
19005
|
}
|
|
19016
|
-
callback(status, response, headersString, statusText, xhrStatus);
|
|
19017
19006
|
}
|
|
19018
|
-
}
|
|
19007
|
+
}
|
|
19008
|
+
return lastCookies;
|
|
19009
|
+
}
|
|
19010
|
+
|
|
19011
|
+
function safeDecodeURIComponent(str) {
|
|
19012
|
+
try {
|
|
19013
|
+
return decodeURIComponent(str);
|
|
19014
|
+
} catch {
|
|
19015
|
+
return str;
|
|
19016
|
+
}
|
|
19019
19017
|
}
|
|
19020
19018
|
|
|
19021
19019
|
const PATH_MATCH = /^([^?#]*)(\?([^#]*))?(#(.*))?$/;
|
|
@@ -19526,7 +19524,7 @@ class LocationProvider {
|
|
|
19526
19524
|
$injectTokens.$rootElement,
|
|
19527
19525
|
/**
|
|
19528
19526
|
*
|
|
19529
|
-
* @param {
|
|
19527
|
+
* @param {ng.Scope} $rootScope
|
|
19530
19528
|
* @param {Element} $rootElement
|
|
19531
19529
|
* @returns {Location}
|
|
19532
19530
|
*/
|
|
@@ -20092,7 +20090,7 @@ function nextId() {
|
|
|
20092
20090
|
}
|
|
20093
20091
|
|
|
20094
20092
|
/**
|
|
20095
|
-
* @type {
|
|
20093
|
+
* @type {ng.ParseService}
|
|
20096
20094
|
*/
|
|
20097
20095
|
let $parse;
|
|
20098
20096
|
|
|
@@ -21191,6 +21189,9 @@ class Scope {
|
|
|
21191
21189
|
return this.$root == /** @type {Scope} */ (this);
|
|
21192
21190
|
}
|
|
21193
21191
|
|
|
21192
|
+
/**
|
|
21193
|
+
* @param {Function} fn
|
|
21194
|
+
*/
|
|
21194
21195
|
$postUpdate(fn) {
|
|
21195
21196
|
$postUpdateQueue.push(fn);
|
|
21196
21197
|
}
|
|
@@ -21373,11 +21374,11 @@ function TemplateRequestProvider() {
|
|
|
21373
21374
|
"$sce",
|
|
21374
21375
|
/**
|
|
21375
21376
|
*
|
|
21376
|
-
* @param {
|
|
21377
|
-
* @param {
|
|
21378
|
-
* @param {
|
|
21377
|
+
* @param {ng.ExceptionHandlerService} $exceptionHandler
|
|
21378
|
+
* @param {ng.TemplateCacheService} $templateCache
|
|
21379
|
+
* @param {ng.HttpService} $http
|
|
21379
21380
|
* @param {*} $sce
|
|
21380
|
-
* @returns
|
|
21381
|
+
* @returns {ng.TemplateRequestService}
|
|
21381
21382
|
*/
|
|
21382
21383
|
function ($exceptionHandler, $templateCache, $http, $sce) {
|
|
21383
21384
|
function handleRequestFn(tpl, ignoreRequestError) {
|
|
@@ -24355,14 +24356,14 @@ function AnimationProvider() {
|
|
|
24355
24356
|
}
|
|
24356
24357
|
|
|
24357
24358
|
this.$get = [
|
|
24358
|
-
|
|
24359
|
-
|
|
24360
|
-
|
|
24361
|
-
|
|
24362
|
-
|
|
24359
|
+
$injectTokens.$rootScope,
|
|
24360
|
+
$injectTokens.$injector,
|
|
24361
|
+
$injectTokens.$$AnimateRunner,
|
|
24362
|
+
$injectTokens.$$rAFScheduler,
|
|
24363
|
+
$injectTokens.$$animateCache,
|
|
24363
24364
|
/**
|
|
24364
24365
|
*
|
|
24365
|
-
* @param {
|
|
24366
|
+
* @param {ng.RootScopeService} $rootScope
|
|
24366
24367
|
* @param {import("../core/di/internal-injector").InjectorService} $injector
|
|
24367
24368
|
* @param {*} $$AnimateRunner
|
|
24368
24369
|
* @param {import("./raf-scheduler").RafScheduler} $$rAFScheduler
|
|
@@ -24528,7 +24529,6 @@ function AnimationProvider() {
|
|
|
24528
24529
|
// block. This way we can group animations for all the animations that
|
|
24529
24530
|
// were apart of the same postDigest flush call.
|
|
24530
24531
|
if (animationQueue.length > 1) return runner;
|
|
24531
|
-
|
|
24532
24532
|
$rootScope.$postUpdate(() => {
|
|
24533
24533
|
const animations = [];
|
|
24534
24534
|
animationQueue.forEach((entry) => {
|
|
@@ -25418,158 +25418,6 @@ function $$AnimateChildrenDirective($interpolate) {
|
|
|
25418
25418
|
};
|
|
25419
25419
|
}
|
|
25420
25420
|
|
|
25421
|
-
/**
|
|
25422
|
-
* Returns a new function for [Partial Application](https://en.wikipedia.org/wiki/Partial_application) of the original function.
|
|
25423
|
-
*
|
|
25424
|
-
* Given a function with N parameters, returns a new function that supports partial application.
|
|
25425
|
-
* The new function accepts anywhere from 1 to N parameters. When that function is called with M parameters,
|
|
25426
|
-
* where M is less than N, it returns a new function that accepts the remaining parameters. It continues to
|
|
25427
|
-
* accept more parameters until all N parameters have been supplied.
|
|
25428
|
-
*
|
|
25429
|
-
*
|
|
25430
|
-
* This contrived example uses a partially applied function as an predicate, which returns true
|
|
25431
|
-
* if an object is found in both arrays.
|
|
25432
|
-
* @example
|
|
25433
|
-
* ```
|
|
25434
|
-
* // returns true if an object is in both of the two arrays
|
|
25435
|
-
* function inBoth(array1, array2, object) {
|
|
25436
|
-
* return array1.indexOf(object) !== -1 &&
|
|
25437
|
-
* array2.indexOf(object) !== 1;
|
|
25438
|
-
* }
|
|
25439
|
-
* let obj1, obj2, obj3, obj4, obj5, obj6, obj7
|
|
25440
|
-
* let foos = [obj1, obj3]
|
|
25441
|
-
* let bars = [obj3, obj4, obj5]
|
|
25442
|
-
*
|
|
25443
|
-
* // A curried "copy" of inBoth
|
|
25444
|
-
* let curriedInBoth = curry(inBoth);
|
|
25445
|
-
* // Partially apply both the array1 and array2
|
|
25446
|
-
* let inFoosAndBars = curriedInBoth(foos, bars);
|
|
25447
|
-
*
|
|
25448
|
-
* // Supply the final argument; since all arguments are
|
|
25449
|
-
* // supplied, the original inBoth function is then called.
|
|
25450
|
-
* let obj1InBoth = inFoosAndBars(obj1); // false
|
|
25451
|
-
*
|
|
25452
|
-
* // Use the inFoosAndBars as a predicate.
|
|
25453
|
-
* // Filter, on each iteration, supplies the final argument
|
|
25454
|
-
* let allObjs = [ obj1, obj2, obj3, obj4, obj5, obj6, obj7 ];
|
|
25455
|
-
* let foundInBoth = allObjs.filter(inFoosAndBars); // [ obj3 ]
|
|
25456
|
-
*
|
|
25457
|
-
* ```
|
|
25458
|
-
*
|
|
25459
|
-
* @param fn
|
|
25460
|
-
* @returns {*|function(): (*|any)}
|
|
25461
|
-
*/
|
|
25462
|
-
function curry(fn) {
|
|
25463
|
-
return function curried() {
|
|
25464
|
-
if (arguments.length >= fn.length) {
|
|
25465
|
-
return fn.apply(this, arguments);
|
|
25466
|
-
}
|
|
25467
|
-
const args = Array.prototype.slice.call(arguments);
|
|
25468
|
-
return curried.bind(this, ...args);
|
|
25469
|
-
};
|
|
25470
|
-
}
|
|
25471
|
-
/**
|
|
25472
|
-
* Given a varargs list of functions, returns a function that composes the argument functions, right-to-left
|
|
25473
|
-
* given: f(x), g(x), h(x)
|
|
25474
|
-
* let composed = compose(f,g,h)
|
|
25475
|
-
* then, composed is: f(g(h(x)))
|
|
25476
|
-
*/
|
|
25477
|
-
function compose() {
|
|
25478
|
-
const args = arguments;
|
|
25479
|
-
const start = args.length - 1;
|
|
25480
|
-
return function () {
|
|
25481
|
-
let i = start,
|
|
25482
|
-
result = args[start].apply(this, arguments);
|
|
25483
|
-
while (i--) result = args[i].call(this, result);
|
|
25484
|
-
return result;
|
|
25485
|
-
};
|
|
25486
|
-
}
|
|
25487
|
-
/**
|
|
25488
|
-
* Given a varargs list of functions, returns a function that is composes the argument functions, left-to-right
|
|
25489
|
-
* given: f(x), g(x), h(x)
|
|
25490
|
-
* let piped = pipe(f,g,h);
|
|
25491
|
-
* then, piped is: h(g(f(x)))
|
|
25492
|
-
*/
|
|
25493
|
-
function pipe() {
|
|
25494
|
-
return compose.apply(null, [].slice.call(arguments).reverse());
|
|
25495
|
-
}
|
|
25496
|
-
|
|
25497
|
-
/**
|
|
25498
|
-
* Given a property name and a value, returns a function that returns a boolean based on whether
|
|
25499
|
-
* the passed object has a property that matches the value
|
|
25500
|
-
* let obj = { foo: 1, name: "blarg" };
|
|
25501
|
-
* let getName = propEq("name", "blarg");
|
|
25502
|
-
* getName(obj) === true
|
|
25503
|
-
*/
|
|
25504
|
-
const propEq = curry((name, _val, obj) => obj && obj[name] === _val);
|
|
25505
|
-
/**
|
|
25506
|
-
* Given a dotted property name, returns a function that returns a nested property from an object, or undefined
|
|
25507
|
-
* let obj = { id: 1, nestedObj: { foo: 1, name: "blarg" }, };
|
|
25508
|
-
* let getName = prop("nestedObj.name");
|
|
25509
|
-
* getName(obj) === "blarg"
|
|
25510
|
-
* let propNotFound = prop("this.property.doesnt.exist");
|
|
25511
|
-
* propNotFound(obj) === undefined
|
|
25512
|
-
*/
|
|
25513
|
-
const parse = (name) =>
|
|
25514
|
-
pipe.apply(
|
|
25515
|
-
null,
|
|
25516
|
-
name.split(".").map((name) => (obj) => obj && obj[name]),
|
|
25517
|
-
);
|
|
25518
|
-
|
|
25519
|
-
/** Given a class, returns a Predicate function that returns true if the object is of that class */
|
|
25520
|
-
const is = (ctor) => (obj) =>
|
|
25521
|
-
(obj != null && obj.constructor === ctor) || obj instanceof ctor;
|
|
25522
|
-
|
|
25523
|
-
/** Given a value, returns a function which returns the value */
|
|
25524
|
-
const val = (v) => () => v;
|
|
25525
|
-
/**
|
|
25526
|
-
* Sorta like Pattern Matching (a functional programming conditional construct)
|
|
25527
|
-
*
|
|
25528
|
-
* See http://c2.com/cgi/wiki?PatternMatching
|
|
25529
|
-
*
|
|
25530
|
-
* This is a conditional construct which allows a series of predicates and output functions
|
|
25531
|
-
* to be checked and then applied. Each predicate receives the input. If the predicate
|
|
25532
|
-
* returns truthy, then its matching output function (mapping function) is provided with
|
|
25533
|
-
* the input and, then the result is returned.
|
|
25534
|
-
*
|
|
25535
|
-
* Each combination (2-tuple) of predicate + output function should be placed in an array
|
|
25536
|
-
* of size 2: [ predicate, mapFn ]
|
|
25537
|
-
*
|
|
25538
|
-
* These 2-tuples should be put in an outer array.
|
|
25539
|
-
*
|
|
25540
|
-
* @example
|
|
25541
|
-
* ```
|
|
25542
|
-
*
|
|
25543
|
-
* // Here's a 2-tuple where the first element is the isString predicate
|
|
25544
|
-
* // and the second element is a function that returns a description of the input
|
|
25545
|
-
* let firstTuple = [ angular.isString, (input) => `Heres your string ${input}` ];
|
|
25546
|
-
*
|
|
25547
|
-
* // Second tuple: predicate "isNumber", mapfn returns a description
|
|
25548
|
-
* let secondTuple = [ angular.isNumber, (input) => `(${input}) That's a number!` ];
|
|
25549
|
-
*
|
|
25550
|
-
* let third = [ (input) => input === null, (input) => `Oh, null...` ];
|
|
25551
|
-
*
|
|
25552
|
-
* let fourth = [ (input) => input === undefined, (input) => `notdefined` ];
|
|
25553
|
-
*
|
|
25554
|
-
* let descriptionOf = pattern([ firstTuple, secondTuple, third, fourth ]);
|
|
25555
|
-
*
|
|
25556
|
-
* console.log(descriptionOf(undefined)); // 'notdefined'
|
|
25557
|
-
* console.log(descriptionOf(55)); // '(55) That's a number!'
|
|
25558
|
-
* console.log(descriptionOf("foo")); // 'Here's your string foo'
|
|
25559
|
-
* ```
|
|
25560
|
-
*
|
|
25561
|
-
* @param struct A 2D array. Each element of the array should be an array, a 2-tuple,
|
|
25562
|
-
* with a Predicate and a mapping/output function
|
|
25563
|
-
* @returns {function(any): *}
|
|
25564
|
-
*/
|
|
25565
|
-
function pattern(struct) {
|
|
25566
|
-
return function (x) {
|
|
25567
|
-
for (let i = 0; i < struct.length; i++) {
|
|
25568
|
-
if (struct[i][0](x)) return struct[i][1](x);
|
|
25569
|
-
}
|
|
25570
|
-
};
|
|
25571
|
-
}
|
|
25572
|
-
|
|
25573
25421
|
function equals(o1, o2) {
|
|
25574
25422
|
if (o1 === o2) return true;
|
|
25575
25423
|
if (o1 === null || o2 === null) return false;
|
|
@@ -25596,81 +25444,7 @@ function equals(o1, o2) {
|
|
|
25596
25444
|
}
|
|
25597
25445
|
return true;
|
|
25598
25446
|
}
|
|
25599
|
-
|
|
25600
|
-
* Builds proxy functions on the `to` object which pass through to the `from` object.
|
|
25601
|
-
*
|
|
25602
|
-
* For each key in `fnNames`, creates a proxy function on the `to` object.
|
|
25603
|
-
* The proxy function calls the real function on the `from` object.
|
|
25604
|
-
*
|
|
25605
|
-
*
|
|
25606
|
-
* #### Example:
|
|
25607
|
-
* This example creates an new class instance whose functions are prebound to the new'd object.
|
|
25608
|
-
* ```js
|
|
25609
|
-
* class Foo {
|
|
25610
|
-
* constructor(data) {
|
|
25611
|
-
* // Binds all functions from Foo.prototype to 'this',
|
|
25612
|
-
* // then copies them to 'this'
|
|
25613
|
-
* bindFunctions(Foo.prototype, this, this);
|
|
25614
|
-
* this.data = data;
|
|
25615
|
-
* }
|
|
25616
|
-
*
|
|
25617
|
-
* log() {
|
|
25618
|
-
* console.log(this.data);
|
|
25619
|
-
* }
|
|
25620
|
-
* }
|
|
25621
|
-
*
|
|
25622
|
-
* let myFoo = new Foo([1,2,3]);
|
|
25623
|
-
* var logit = myFoo.log;
|
|
25624
|
-
* logit(); // logs [1, 2, 3] from the myFoo 'this' instance
|
|
25625
|
-
* ```
|
|
25626
|
-
*
|
|
25627
|
-
* #### Example:
|
|
25628
|
-
* This example creates a bound version of a service function, and copies it to another object
|
|
25629
|
-
* ```
|
|
25630
|
-
*
|
|
25631
|
-
* var SomeService = {
|
|
25632
|
-
* this.data = [3, 4, 5];
|
|
25633
|
-
* this.log = function() {
|
|
25634
|
-
* console.log(this.data);
|
|
25635
|
-
* }
|
|
25636
|
-
* }
|
|
25637
|
-
*
|
|
25638
|
-
* // Constructor fn
|
|
25639
|
-
* function OtherThing() {
|
|
25640
|
-
* // Binds all functions from SomeService to SomeService,
|
|
25641
|
-
* // then copies them to 'this'
|
|
25642
|
-
* bindFunctions(SomeService, this, SomeService);
|
|
25643
|
-
* }
|
|
25644
|
-
*
|
|
25645
|
-
* let myOtherThing = new OtherThing();
|
|
25646
|
-
* myOtherThing.log(); // logs [3, 4, 5] from SomeService's 'this'
|
|
25647
|
-
* ```
|
|
25648
|
-
*
|
|
25649
|
-
* @param source A function that returns the source object which contains the original functions to be bound
|
|
25650
|
-
* @param target A function that returns the target object which will receive the bound functions
|
|
25651
|
-
* @param bind A function that returns the object which the functions will be bound to
|
|
25652
|
-
* @param fnNames The function names which will be bound (Defaults to all the functions found on the 'from' object)
|
|
25653
|
-
* @param latebind If true, the binding of the function is delayed until the first time it's invoked
|
|
25654
|
-
*/
|
|
25655
|
-
function createProxyFunctions(
|
|
25656
|
-
source,
|
|
25657
|
-
target,
|
|
25658
|
-
bind,
|
|
25659
|
-
fnNames,
|
|
25660
|
-
latebind = false,
|
|
25661
|
-
) {
|
|
25662
|
-
const bindFunction = (fnName) => source()[fnName].bind(bind());
|
|
25663
|
-
const makeLateRebindFn = (fnName) =>
|
|
25664
|
-
function lateRebindFunction() {
|
|
25665
|
-
target[fnName] = bindFunction(fnName);
|
|
25666
|
-
return target[fnName].apply(null, arguments);
|
|
25667
|
-
};
|
|
25668
|
-
fnNames = fnNames || Object.keys(source());
|
|
25669
|
-
return fnNames.reduce((acc, name) => {
|
|
25670
|
-
acc[name] = latebind ? makeLateRebindFn(name) : bindFunction(name);
|
|
25671
|
-
return acc;
|
|
25672
|
-
}, target);
|
|
25673
|
-
}
|
|
25447
|
+
|
|
25674
25448
|
/**
|
|
25675
25449
|
* prototypal inheritance helper.
|
|
25676
25450
|
* Creates a new object which has `parent` object as its prototype, and then copies the properties from `extra` onto it
|
|
@@ -25695,11 +25469,13 @@ function inherit(parent, extra) {
|
|
|
25695
25469
|
/**
|
|
25696
25470
|
* Given an array, and an item, if the item is found in the array, it removes it (in-place).
|
|
25697
25471
|
* The same array is returned
|
|
25472
|
+
* @param {Array} array
|
|
25473
|
+
* @param {any} obj
|
|
25474
|
+
* @returns {Array}
|
|
25698
25475
|
*/
|
|
25699
|
-
|
|
25700
|
-
|
|
25701
|
-
|
|
25702
|
-
if (idx >= 0) array.splice(idx, 1);
|
|
25476
|
+
function removeFrom(array, obj) {
|
|
25477
|
+
const i = array.indexOf(obj);
|
|
25478
|
+
if (i !== -1) array.splice(i, 1);
|
|
25703
25479
|
return array;
|
|
25704
25480
|
}
|
|
25705
25481
|
|
|
@@ -25982,6 +25758,148 @@ const silenceUncaughtInPromise = (promise) =>
|
|
|
25982
25758
|
const silentRejection = (error) =>
|
|
25983
25759
|
silenceUncaughtInPromise(Promise.reject(error));
|
|
25984
25760
|
|
|
25761
|
+
/**
|
|
25762
|
+
* Returns a new function for [Partial Application](https://en.wikipedia.org/wiki/Partial_application) of the original function.
|
|
25763
|
+
*
|
|
25764
|
+
* Given a function with N parameters, returns a new function that supports partial application.
|
|
25765
|
+
* The new function accepts anywhere from 1 to N parameters. When that function is called with M parameters,
|
|
25766
|
+
* where M is less than N, it returns a new function that accepts the remaining parameters. It continues to
|
|
25767
|
+
* accept more parameters until all N parameters have been supplied.
|
|
25768
|
+
*
|
|
25769
|
+
*
|
|
25770
|
+
* This contrived example uses a partially applied function as an predicate, which returns true
|
|
25771
|
+
* if an object is found in both arrays.
|
|
25772
|
+
* @example
|
|
25773
|
+
* ```
|
|
25774
|
+
* // returns true if an object is in both of the two arrays
|
|
25775
|
+
* function inBoth(array1, array2, object) {
|
|
25776
|
+
* return array1.indexOf(object) !== -1 &&
|
|
25777
|
+
* array2.indexOf(object) !== 1;
|
|
25778
|
+
* }
|
|
25779
|
+
* let obj1, obj2, obj3, obj4, obj5, obj6, obj7
|
|
25780
|
+
* let foos = [obj1, obj3]
|
|
25781
|
+
* let bars = [obj3, obj4, obj5]
|
|
25782
|
+
*
|
|
25783
|
+
* // A curried "copy" of inBoth
|
|
25784
|
+
* let curriedInBoth = curry(inBoth);
|
|
25785
|
+
* // Partially apply both the array1 and array2
|
|
25786
|
+
* let inFoosAndBars = curriedInBoth(foos, bars);
|
|
25787
|
+
*
|
|
25788
|
+
* // Supply the final argument; since all arguments are
|
|
25789
|
+
* // supplied, the original inBoth function is then called.
|
|
25790
|
+
* let obj1InBoth = inFoosAndBars(obj1); // false
|
|
25791
|
+
*
|
|
25792
|
+
* // Use the inFoosAndBars as a predicate.
|
|
25793
|
+
* // Filter, on each iteration, supplies the final argument
|
|
25794
|
+
* let allObjs = [ obj1, obj2, obj3, obj4, obj5, obj6, obj7 ];
|
|
25795
|
+
* let foundInBoth = allObjs.filter(inFoosAndBars); // [ obj3 ]
|
|
25796
|
+
*
|
|
25797
|
+
* ```
|
|
25798
|
+
*
|
|
25799
|
+
* @param fn
|
|
25800
|
+
* @returns {*|function(): (*|any)}
|
|
25801
|
+
*/
|
|
25802
|
+
function curry(fn) {
|
|
25803
|
+
return function curried() {
|
|
25804
|
+
if (arguments.length >= fn.length) {
|
|
25805
|
+
return fn.apply(this, arguments);
|
|
25806
|
+
}
|
|
25807
|
+
const args = Array.prototype.slice.call(arguments);
|
|
25808
|
+
return curried.bind(this, ...args);
|
|
25809
|
+
};
|
|
25810
|
+
}
|
|
25811
|
+
|
|
25812
|
+
/**
|
|
25813
|
+
* Given a property name and a value, returns a function that returns a boolean based on whether
|
|
25814
|
+
* the passed object has a property that matches the value
|
|
25815
|
+
* let obj = { foo: 1, name: "blarg" };
|
|
25816
|
+
* let getName = propEq("name", "blarg");
|
|
25817
|
+
* getName(obj) === true
|
|
25818
|
+
*/
|
|
25819
|
+
const propEq = curry((name, _val, obj) => obj && obj[name] === _val);
|
|
25820
|
+
/**
|
|
25821
|
+
* Given a dotted property name, returns a function that returns a nested property from an object, or undefined
|
|
25822
|
+
* let obj = { id: 1, nestedObj: { foo: 1, name: "blarg" }, };
|
|
25823
|
+
* let getName = prop("nestedObj.name");
|
|
25824
|
+
* getName(obj) === "blarg"
|
|
25825
|
+
* let propNotFound = prop("this.property.doesnt.exist");
|
|
25826
|
+
* propNotFound(obj) === undefined
|
|
25827
|
+
*/
|
|
25828
|
+
const parse = (path) => {
|
|
25829
|
+
const parts = path.split(".");
|
|
25830
|
+
return (obj) => parts.reduce((acc, key) => acc && acc[key], obj);
|
|
25831
|
+
};
|
|
25832
|
+
|
|
25833
|
+
/**
|
|
25834
|
+
* Given a class constructor, returns a predicate function that checks
|
|
25835
|
+
* whether a given object is an instance of that class.
|
|
25836
|
+
*
|
|
25837
|
+
* @param {new (...args: any[]) => any} ctor - The class constructor to check against.
|
|
25838
|
+
* @returns {(obj: any) => boolean} A predicate function that returns true if the object is of the given class.
|
|
25839
|
+
*/
|
|
25840
|
+
function is(ctor) {
|
|
25841
|
+
/**
|
|
25842
|
+
* Checks if the provided object is an instance of the given constructor.
|
|
25843
|
+
*
|
|
25844
|
+
* @param {any} obj - The object to test.
|
|
25845
|
+
* @returns {boolean} True if the object is an instance of the given class.
|
|
25846
|
+
*/
|
|
25847
|
+
return function (obj) {
|
|
25848
|
+
return (obj != null && obj.constructor === ctor) || obj instanceof ctor;
|
|
25849
|
+
};
|
|
25850
|
+
}
|
|
25851
|
+
|
|
25852
|
+
/** Given a value, returns a function which returns the value */
|
|
25853
|
+
const val = (v) => () => v;
|
|
25854
|
+
|
|
25855
|
+
/**
|
|
25856
|
+
* Sorta like Pattern Matching (a functional programming conditional construct)
|
|
25857
|
+
*
|
|
25858
|
+
* See http://c2.com/cgi/wiki?PatternMatching
|
|
25859
|
+
*
|
|
25860
|
+
* This is a conditional construct which allows a series of predicates and output functions
|
|
25861
|
+
* to be checked and then applied. Each predicate receives the input. If the predicate
|
|
25862
|
+
* returns truthy, then its matching output function (mapping function) is provided with
|
|
25863
|
+
* the input and, then the result is returned.
|
|
25864
|
+
*
|
|
25865
|
+
* Each combination (2-tuple) of predicate + output function should be placed in an array
|
|
25866
|
+
* of size 2: [ predicate, mapFn ]
|
|
25867
|
+
*
|
|
25868
|
+
* These 2-tuples should be put in an outer array.
|
|
25869
|
+
*
|
|
25870
|
+
* @example
|
|
25871
|
+
* ```
|
|
25872
|
+
*
|
|
25873
|
+
* // Here's a 2-tuple where the first element is the isString predicate
|
|
25874
|
+
* // and the second element is a function that returns a description of the input
|
|
25875
|
+
* let firstTuple = [ angular.isString, (input) => `Heres your string ${input}` ];
|
|
25876
|
+
*
|
|
25877
|
+
* // Second tuple: predicate "isNumber", mapfn returns a description
|
|
25878
|
+
* let secondTuple = [ angular.isNumber, (input) => `(${input}) That's a number!` ];
|
|
25879
|
+
*
|
|
25880
|
+
* let third = [ (input) => input === null, (input) => `Oh, null...` ];
|
|
25881
|
+
*
|
|
25882
|
+
* let fourth = [ (input) => input === undefined, (input) => `notdefined` ];
|
|
25883
|
+
*
|
|
25884
|
+
* let descriptionOf = pattern([ firstTuple, secondTuple, third, fourth ]);
|
|
25885
|
+
*
|
|
25886
|
+
* console.log(descriptionOf(undefined)); // 'notdefined'
|
|
25887
|
+
* console.log(descriptionOf(55)); // '(55) That's a number!'
|
|
25888
|
+
* console.log(descriptionOf("foo")); // 'Here's your string foo'
|
|
25889
|
+
* ```
|
|
25890
|
+
*
|
|
25891
|
+
* @param struct A 2D array. Each element of the array should be an array, a 2-tuple,
|
|
25892
|
+
* with a Predicate and a mapping/output function
|
|
25893
|
+
* @returns {function(any): *}
|
|
25894
|
+
*/
|
|
25895
|
+
function pattern(struct) {
|
|
25896
|
+
return function (x) {
|
|
25897
|
+
for (let i = 0; i < struct.length; i++) {
|
|
25898
|
+
if (struct[i][0](x)) return struct[i][1](x);
|
|
25899
|
+
}
|
|
25900
|
+
};
|
|
25901
|
+
}
|
|
25902
|
+
|
|
25985
25903
|
/**
|
|
25986
25904
|
* An internal class which implements [[ParamTypeDefinition]].
|
|
25987
25905
|
*
|
|
@@ -28176,23 +28094,11 @@ class ViewService {
|
|
|
28176
28094
|
constructor() {
|
|
28177
28095
|
this._ngViews = [];
|
|
28178
28096
|
this._viewConfigs = [];
|
|
28179
|
-
this._viewConfigFactories = {};
|
|
28180
28097
|
this._listeners = [];
|
|
28181
|
-
this._pluginapi = {
|
|
28182
|
-
_registeredUIView: (id) => {
|
|
28183
|
-
return find(this._ngViews, (view) => view.id === id);
|
|
28184
|
-
},
|
|
28185
|
-
_registeredUIViews: () => this._ngViews,
|
|
28186
|
-
_activeViewConfigs: () => this._viewConfigs,
|
|
28187
|
-
_onSync: (listener) => {
|
|
28188
|
-
this._listeners.push(listener);
|
|
28189
|
-
return () => removeFrom(this._listeners, listener);
|
|
28190
|
-
},
|
|
28191
|
-
};
|
|
28192
28098
|
this.viewConfigFactory(getViewConfigFactory());
|
|
28193
28099
|
}
|
|
28194
28100
|
|
|
28195
|
-
$get =
|
|
28101
|
+
$get = () => this;
|
|
28196
28102
|
|
|
28197
28103
|
/**
|
|
28198
28104
|
* @param {?import('../state/state-object.js').StateObject} context
|
|
@@ -28330,7 +28236,7 @@ class ViewService {
|
|
|
28330
28236
|
return;
|
|
28331
28237
|
}
|
|
28332
28238
|
trace.traceViewServiceUIViewEvent("<- Deregistering", ngView);
|
|
28333
|
-
removeFrom(ngViews
|
|
28239
|
+
removeFrom(ngViews, ngView);
|
|
28334
28240
|
};
|
|
28335
28241
|
}
|
|
28336
28242
|
/**
|
|
@@ -29242,6 +29148,14 @@ function matchState(state, criterion, transition) {
|
|
|
29242
29148
|
* The registration data for a registered transition hook
|
|
29243
29149
|
*/
|
|
29244
29150
|
class RegisteredHook {
|
|
29151
|
+
/**
|
|
29152
|
+
* @param {import("./transition-service.js").TransitionProvider} tranSvc
|
|
29153
|
+
* @param eventType
|
|
29154
|
+
* @param callback
|
|
29155
|
+
* @param matchCriteria
|
|
29156
|
+
* @param removeHookFromRegistry
|
|
29157
|
+
* @param options
|
|
29158
|
+
*/
|
|
29245
29159
|
constructor(
|
|
29246
29160
|
tranSvc,
|
|
29247
29161
|
eventType,
|
|
@@ -29250,6 +29164,7 @@ class RegisteredHook {
|
|
|
29250
29164
|
removeHookFromRegistry,
|
|
29251
29165
|
options = {},
|
|
29252
29166
|
) {
|
|
29167
|
+
/** @type {import("./transition-service.js").TransitionProvider} */
|
|
29253
29168
|
this.tranSvc = tranSvc;
|
|
29254
29169
|
this.eventType = eventType;
|
|
29255
29170
|
this.callback = callback;
|
|
@@ -29298,7 +29213,7 @@ class RegisteredHook {
|
|
|
29298
29213
|
* }
|
|
29299
29214
|
*/
|
|
29300
29215
|
_getDefaultMatchCriteria() {
|
|
29301
|
-
return map(this.tranSvc.
|
|
29216
|
+
return map(this.tranSvc._getPathTypes(), () => true);
|
|
29302
29217
|
}
|
|
29303
29218
|
/**
|
|
29304
29219
|
* Gets matching nodes as [[IMatchingNodes]]
|
|
@@ -29320,7 +29235,7 @@ class RegisteredHook {
|
|
|
29320
29235
|
this._getDefaultMatchCriteria(),
|
|
29321
29236
|
this.matchCriteria,
|
|
29322
29237
|
);
|
|
29323
|
-
const paths = Object.values(this.tranSvc.
|
|
29238
|
+
const paths = Object.values(this.tranSvc._getPathTypes());
|
|
29324
29239
|
return paths.reduce((mn, pathtype) => {
|
|
29325
29240
|
// STATE scope criteria matches against every node in the path.
|
|
29326
29241
|
// TRANSITION scope criteria matches against only the last node in the path
|
|
@@ -29358,7 +29273,7 @@ function makeEvent(registry, transitionService, eventType) {
|
|
|
29358
29273
|
const _registeredHooks = (registry._registeredHooks =
|
|
29359
29274
|
registry._registeredHooks || {});
|
|
29360
29275
|
const hooks = (_registeredHooks[eventType.name] = []);
|
|
29361
|
-
const removeHookFn = removeFrom(hooks);
|
|
29276
|
+
const removeHookFn = (x) => removeFrom(hooks, x);
|
|
29362
29277
|
// Create hook registration function on the IHookRegistry for the event
|
|
29363
29278
|
registry[eventType.name] = hookRegistrationFn;
|
|
29364
29279
|
function hookRegistrationFn(matchObject, callback, options = {}) {
|
|
@@ -29390,6 +29305,9 @@ function makeEvent(registry, transitionService, eventType) {
|
|
|
29390
29305
|
* in the Transition class, so we must also provide the Transition's _treeChanges)
|
|
29391
29306
|
*/
|
|
29392
29307
|
class HookBuilder {
|
|
29308
|
+
/**
|
|
29309
|
+
* @param {import("./transition.js").Transition} transition
|
|
29310
|
+
*/
|
|
29393
29311
|
constructor(transition) {
|
|
29394
29312
|
this.transition = transition;
|
|
29395
29313
|
}
|
|
@@ -29399,7 +29317,7 @@ class HookBuilder {
|
|
|
29399
29317
|
* @returns
|
|
29400
29318
|
*/
|
|
29401
29319
|
buildHooksForPhase(phase) {
|
|
29402
|
-
return this.transition.transitionService
|
|
29320
|
+
return this.transition.transitionService
|
|
29403
29321
|
._getEvents(phase)
|
|
29404
29322
|
.map((type) => this.buildHooks(type))
|
|
29405
29323
|
.reduce(unnestR, [])
|
|
@@ -29587,7 +29505,7 @@ class Transition {
|
|
|
29587
29505
|
* (which can then be used to register hooks)
|
|
29588
29506
|
*/
|
|
29589
29507
|
createTransitionHookRegFns() {
|
|
29590
|
-
this.transitionService
|
|
29508
|
+
this.transitionService
|
|
29591
29509
|
._getEvents()
|
|
29592
29510
|
.filter((type) => type.hookPhase !== TransitionHookPhase.CREATE)
|
|
29593
29511
|
.forEach((type) => makeEvent(this, this.transitionService, type));
|
|
@@ -30002,6 +29920,7 @@ class Transition {
|
|
|
30002
29920
|
)
|
|
30003
29921
|
return "SameAsCurrent";
|
|
30004
29922
|
}
|
|
29923
|
+
|
|
30005
29924
|
/**
|
|
30006
29925
|
* Runs the transition
|
|
30007
29926
|
*
|
|
@@ -30009,7 +29928,7 @@ class Transition {
|
|
|
30009
29928
|
*
|
|
30010
29929
|
* @internal
|
|
30011
29930
|
*
|
|
30012
|
-
* @returns a promise for a successful transition.
|
|
29931
|
+
* @returns {Promise} a promise for a successful transition.
|
|
30013
29932
|
*/
|
|
30014
29933
|
run() {
|
|
30015
29934
|
// Gets transition hooks array for the given phase
|
|
@@ -30646,13 +30565,6 @@ class TransitionProvider {
|
|
|
30646
30565
|
this.globals = globals;
|
|
30647
30566
|
this.$view = viewService;
|
|
30648
30567
|
this._deregisterHookFns = {};
|
|
30649
|
-
this._pluginapi = createProxyFunctions(val(this), {}, val(this), [
|
|
30650
|
-
"_definePathType",
|
|
30651
|
-
"_defineEvent",
|
|
30652
|
-
"_getPathTypes",
|
|
30653
|
-
"_getEvents",
|
|
30654
|
-
"getHooks",
|
|
30655
|
-
]);
|
|
30656
30568
|
this._defineCorePaths();
|
|
30657
30569
|
this._defineCoreEvents();
|
|
30658
30570
|
this._registerCoreTransitionHooks();
|
|
@@ -30810,6 +30722,10 @@ class TransitionProvider {
|
|
|
30810
30722
|
makeEvent(this, this, eventType);
|
|
30811
30723
|
}
|
|
30812
30724
|
|
|
30725
|
+
/**
|
|
30726
|
+
* @param {TransitionHookPhase} [phase]
|
|
30727
|
+
* @return {any[]}
|
|
30728
|
+
*/
|
|
30813
30729
|
_getEvents(phase) {
|
|
30814
30730
|
const transitionHookTypes = isDefined(phase)
|
|
30815
30731
|
? this._eventTypes.filter((type) => type.hookPhase === phase)
|
|
@@ -30901,7 +30817,7 @@ class StateProvider {
|
|
|
30901
30817
|
return this.globals.$current;
|
|
30902
30818
|
}
|
|
30903
30819
|
|
|
30904
|
-
static $inject = ["$routerProvider", "$transitionsProvider"];
|
|
30820
|
+
/* @ignore */ static $inject = ["$routerProvider", "$transitionsProvider"];
|
|
30905
30821
|
|
|
30906
30822
|
/**
|
|
30907
30823
|
*
|
|
@@ -30926,16 +30842,6 @@ class StateProvider {
|
|
|
30926
30842
|
throw new Error($error$);
|
|
30927
30843
|
}
|
|
30928
30844
|
};
|
|
30929
|
-
const getters = ["current", "$current", "params", "transition"];
|
|
30930
|
-
const boundFns = Object.keys(StateProvider.prototype).filter(
|
|
30931
|
-
(x) => !getters.includes(x),
|
|
30932
|
-
);
|
|
30933
|
-
createProxyFunctions(
|
|
30934
|
-
val(StateProvider.prototype),
|
|
30935
|
-
this,
|
|
30936
|
-
val(this),
|
|
30937
|
-
boundFns,
|
|
30938
|
-
);
|
|
30939
30845
|
|
|
30940
30846
|
EventBus.subscribe("$stateService:defaultErrorHandler", (err) =>
|
|
30941
30847
|
this.defaultErrorHandler()(err),
|
|
@@ -31135,7 +31041,7 @@ class StateProvider {
|
|
|
31135
31041
|
onInvalid(callback) {
|
|
31136
31042
|
this.invalidCallbacks.push(callback);
|
|
31137
31043
|
return function deregisterListener() {
|
|
31138
|
-
removeFrom(this.invalidCallbacks
|
|
31044
|
+
removeFrom(this.invalidCallbacks, callback);
|
|
31139
31045
|
}.bind(this);
|
|
31140
31046
|
}
|
|
31141
31047
|
/**
|
|
@@ -31560,8 +31466,8 @@ class ViewScrollProvider {
|
|
|
31560
31466
|
$get = [
|
|
31561
31467
|
$injectTokens.$anchorScroll,
|
|
31562
31468
|
/**
|
|
31563
|
-
* @param {import('../services/anchor-scroll.js').AnchorScrollObject} $anchorScroll
|
|
31564
|
-
* @returns {import('../services/anchor-scroll.js').AnchorScrollObject|Function}
|
|
31469
|
+
* @param {import('../services/anchor-scroll/anchor-scroll.js').AnchorScrollObject} $anchorScroll
|
|
31470
|
+
* @returns {import('../services/anchor-scroll/anchor-scroll.js').AnchorScrollObject|Function}
|
|
31565
31471
|
*/
|
|
31566
31472
|
($anchorScroll) => {
|
|
31567
31473
|
if (this.enabled) {
|
|
@@ -31602,7 +31508,7 @@ class TemplateFactoryProvider {
|
|
|
31602
31508
|
$injectTokens.$injector,
|
|
31603
31509
|
/**
|
|
31604
31510
|
* @param {import("interface.ts").HttpService} $http
|
|
31605
|
-
* @param {
|
|
31511
|
+
* @param {ng.TemplateCacheService} $templateCache
|
|
31606
31512
|
* @param {any} $templateRequest
|
|
31607
31513
|
* @param {import("../core/di/internal-injector.js").InjectorService} $injector
|
|
31608
31514
|
* @returns
|
|
@@ -31714,7 +31620,7 @@ class TemplateFactoryProvider {
|
|
|
31714
31620
|
/**
|
|
31715
31621
|
* Creates a template by invoking an injectable provider function.
|
|
31716
31622
|
*
|
|
31717
|
-
* @param {import('../interface.ts').Injectable} provider Function to invoke via `locals`
|
|
31623
|
+
* @param {import('../interface.ts').Injectable<any>} provider Function to invoke via `locals`
|
|
31718
31624
|
* @param {Function} params a function used to invoke the template provider
|
|
31719
31625
|
* @param {import("./resolve/resolve-context.js").ResolveContext} context
|
|
31720
31626
|
* @return {string|Promise.<string>} The template html as a string, or a promise
|
|
@@ -31729,7 +31635,7 @@ class TemplateFactoryProvider {
|
|
|
31729
31635
|
/**
|
|
31730
31636
|
* Creates a component's template by invoking an injectable provider function.
|
|
31731
31637
|
*
|
|
31732
|
-
* @param {import('../interface.ts').Injectable} provider Function to invoke via `locals`
|
|
31638
|
+
* @param {import('../interface.ts').Injectable<any>} provider Function to invoke via `locals`
|
|
31733
31639
|
* @return {Promise<any>} The template html as a string: "<component-name input1='::$resolve.foo'></component-name>".
|
|
31734
31640
|
*/
|
|
31735
31641
|
fromComponentProvider(provider, context) {
|
|
@@ -33045,7 +32951,7 @@ class ParamFactory {
|
|
|
33045
32951
|
* API for URL management
|
|
33046
32952
|
*/
|
|
33047
32953
|
class UrlService {
|
|
33048
|
-
static $inject = provider([
|
|
32954
|
+
/* @ignore */ static $inject = provider([
|
|
33049
32955
|
$injectTokens.$location,
|
|
33050
32956
|
$injectTokens.$state,
|
|
33051
32957
|
$injectTokens.$router,
|
|
@@ -33226,7 +33132,7 @@ class UrlService {
|
|
|
33226
33132
|
*/
|
|
33227
33133
|
onChange(callback) {
|
|
33228
33134
|
this._urlListeners.push(callback);
|
|
33229
|
-
return () => removeFrom(this._urlListeners
|
|
33135
|
+
return () => removeFrom(this._urlListeners, callback);
|
|
33230
33136
|
}
|
|
33231
33137
|
|
|
33232
33138
|
/**
|
|
@@ -33732,12 +33638,12 @@ function resolvablesBuilder(state) {
|
|
|
33732
33638
|
]);
|
|
33733
33639
|
const tuple2Resolvable = pattern([
|
|
33734
33640
|
[
|
|
33735
|
-
|
|
33641
|
+
(x) => isString(x.val),
|
|
33736
33642
|
(tuple) =>
|
|
33737
33643
|
new Resolvable(tuple.token, (x) => x, [tuple.val], tuple.policy),
|
|
33738
33644
|
],
|
|
33739
33645
|
[
|
|
33740
|
-
|
|
33646
|
+
(x) => Array.isArray(x.val),
|
|
33741
33647
|
(tuple) =>
|
|
33742
33648
|
new Resolvable(
|
|
33743
33649
|
tuple.token,
|
|
@@ -33747,7 +33653,7 @@ function resolvablesBuilder(state) {
|
|
|
33747
33653
|
),
|
|
33748
33654
|
],
|
|
33749
33655
|
[
|
|
33750
|
-
|
|
33656
|
+
(x) => isFunction(x.val),
|
|
33751
33657
|
(tuple) =>
|
|
33752
33658
|
new Resolvable(
|
|
33753
33659
|
tuple.token,
|
|
@@ -33999,7 +33905,12 @@ class StateQueueManager {
|
|
|
33999
33905
|
*
|
|
34000
33906
|
*/
|
|
34001
33907
|
class StateRegistryProvider {
|
|
34002
|
-
static $inject = provider([
|
|
33908
|
+
/* @ignore */ static $inject = provider([
|
|
33909
|
+
$injectTokens.$url,
|
|
33910
|
+
$injectTokens.$state,
|
|
33911
|
+
$injectTokens.$router,
|
|
33912
|
+
$injectTokens.$view,
|
|
33913
|
+
]);
|
|
34003
33914
|
|
|
34004
33915
|
/**
|
|
34005
33916
|
* @param urlService
|
|
@@ -34128,7 +34039,7 @@ class StateRegistryProvider {
|
|
|
34128
34039
|
onStatesChanged(listener) {
|
|
34129
34040
|
this.listeners.push(listener);
|
|
34130
34041
|
return function deregisterListener() {
|
|
34131
|
-
removeFrom(this.listeners
|
|
34042
|
+
removeFrom(this.listeners, listener);
|
|
34132
34043
|
}.bind(this);
|
|
34133
34044
|
}
|
|
34134
34045
|
/**
|
|
@@ -34591,7 +34502,7 @@ function $StateRefActiveDirective(
|
|
|
34591
34502
|
};
|
|
34592
34503
|
states.push(stateInfo);
|
|
34593
34504
|
return function removeState() {
|
|
34594
|
-
removeFrom(states
|
|
34505
|
+
removeFrom(states, stateInfo);
|
|
34595
34506
|
};
|
|
34596
34507
|
}
|
|
34597
34508
|
// Update route state
|
|
@@ -35135,8 +35046,8 @@ function ngChannelDirective($eventBus) {
|
|
|
35135
35046
|
ngSetterDirective.$inject = [$injectTokens.$parse, $injectTokens.$log];
|
|
35136
35047
|
|
|
35137
35048
|
/**
|
|
35138
|
-
* @param {
|
|
35139
|
-
* @param {
|
|
35049
|
+
* @param {ng.ParseService} $parse
|
|
35050
|
+
* @param {ng.LogService} $log
|
|
35140
35051
|
* @returns {import('interface.ts').Directive}
|
|
35141
35052
|
*/
|
|
35142
35053
|
function ngSetterDirective($parse, $log) {
|
|
@@ -35192,7 +35103,7 @@ function ngSetterDirective($parse, $log) {
|
|
|
35192
35103
|
|
|
35193
35104
|
/**
|
|
35194
35105
|
* @param {"get" | "delete" | "post" | "put"} method
|
|
35195
|
-
* @returns {
|
|
35106
|
+
* @returns {ng.DirectiveFactory}
|
|
35196
35107
|
*/
|
|
35197
35108
|
function defineDirective(method) {
|
|
35198
35109
|
const attrName = "ng" + method.charAt(0).toUpperCase() + method.slice(1);
|
|
@@ -35201,16 +35112,16 @@ function defineDirective(method) {
|
|
|
35201
35112
|
return directive;
|
|
35202
35113
|
}
|
|
35203
35114
|
|
|
35204
|
-
/** @type {
|
|
35115
|
+
/** @type {ng.DirectiveFactory} */
|
|
35205
35116
|
const ngGetDirective = defineDirective("get");
|
|
35206
35117
|
|
|
35207
|
-
/** @type {
|
|
35118
|
+
/** @type {ng.DirectiveFactory} */
|
|
35208
35119
|
const ngDeleteDirective = defineDirective("delete");
|
|
35209
35120
|
|
|
35210
|
-
/** @type {
|
|
35121
|
+
/** @type {ng.DirectiveFactory} */
|
|
35211
35122
|
const ngPostDirective = defineDirective("post");
|
|
35212
35123
|
|
|
35213
|
-
/** @type {
|
|
35124
|
+
/** @type {ng.DirectiveFactory} */
|
|
35214
35125
|
const ngPutDirective = defineDirective("put");
|
|
35215
35126
|
|
|
35216
35127
|
/**
|
|
@@ -35237,10 +35148,10 @@ function getEventNameForElement(element) {
|
|
|
35237
35148
|
* Handles DOM manipulation based on a swap strategy and server-rendered HTML.
|
|
35238
35149
|
*
|
|
35239
35150
|
* @param {string} html - The HTML string returned from the server.
|
|
35240
|
-
* @param {import("
|
|
35151
|
+
* @param {import("./interface.ts").SwapModeType} swap
|
|
35241
35152
|
* @param {Element} target - The target DOM element to apply the swap to.
|
|
35242
|
-
* @param {
|
|
35243
|
-
* @param {
|
|
35153
|
+
* @param {ng.Scope} scope
|
|
35154
|
+
* @param {ng.CompileService} $compile
|
|
35244
35155
|
*/
|
|
35245
35156
|
function handleSwapResponse(html, swap, target, scope, $compile) {
|
|
35246
35157
|
let nodes = [];
|
|
@@ -35321,16 +35232,16 @@ function handleSwapResponse(html, swap, target, scope, $compile) {
|
|
|
35321
35232
|
*
|
|
35322
35233
|
* @param {"get" | "delete" | "post" | "put"} method - HTTP method to use.
|
|
35323
35234
|
* @param {string} attrName - Attribute name containing the URL.
|
|
35324
|
-
* @returns {
|
|
35235
|
+
* @returns {ng.DirectiveFactory}
|
|
35325
35236
|
*/
|
|
35326
35237
|
function createHttpDirective(method, attrName) {
|
|
35327
35238
|
/**
|
|
35328
|
-
* @param {
|
|
35329
|
-
* @param {
|
|
35330
|
-
* @param {
|
|
35331
|
-
* @param {
|
|
35332
|
-
* @param {
|
|
35333
|
-
* @returns {
|
|
35239
|
+
* @param {ng.HttpService} $http
|
|
35240
|
+
* @param {ng.CompileService} $compile
|
|
35241
|
+
* @param {ng.LogService} $log
|
|
35242
|
+
* @param {ng.ParseService} $parse
|
|
35243
|
+
* @param {ng.StateService} $state
|
|
35244
|
+
* @returns {ng.Directive}
|
|
35334
35245
|
*/
|
|
35335
35246
|
return function ($http, $compile, $log, $parse, $state) {
|
|
35336
35247
|
/**
|
|
@@ -35469,7 +35380,7 @@ function createHttpDirective(method, attrName) {
|
|
|
35469
35380
|
|
|
35470
35381
|
handleSwapResponse(
|
|
35471
35382
|
html,
|
|
35472
|
-
/** @type {import("
|
|
35383
|
+
/** @type {import("./interface.ts").SwapModeType} */ (swap),
|
|
35473
35384
|
target,
|
|
35474
35385
|
scope,
|
|
35475
35386
|
$compile,
|
|
@@ -35524,6 +35435,40 @@ function createHttpDirective(method, attrName) {
|
|
|
35524
35435
|
};
|
|
35525
35436
|
}
|
|
35526
35437
|
|
|
35438
|
+
ngInjectDirective.$inject = [$injectTokens.$log, $injectTokens.$injector];
|
|
35439
|
+
|
|
35440
|
+
/**
|
|
35441
|
+
* @param {ng.LogService} $log
|
|
35442
|
+
* @param {ng.InjectorService} $injector
|
|
35443
|
+
* @returns {import('interface.ts').Directive}
|
|
35444
|
+
*/
|
|
35445
|
+
function ngInjectDirective($log, $injector) {
|
|
35446
|
+
return {
|
|
35447
|
+
restrict: "A",
|
|
35448
|
+
link(scope, _element, attrs) {
|
|
35449
|
+
const expr = attrs["ngInject"];
|
|
35450
|
+
|
|
35451
|
+
if (!expr) return;
|
|
35452
|
+
// Match any identifier that starts with $, or ends with Service/Factory
|
|
35453
|
+
// Example matches: $http, userService, authFactory
|
|
35454
|
+
const replacedExpr = expr.replace(
|
|
35455
|
+
/(\$[\w]+|[\w]+(?:Service|Factory))/g,
|
|
35456
|
+
(match, name) => {
|
|
35457
|
+
try {
|
|
35458
|
+
const service = $injector.get(name);
|
|
35459
|
+
scope.$target[name] = service;
|
|
35460
|
+
return name;
|
|
35461
|
+
} catch {
|
|
35462
|
+
$log.warn(`Injectable ${name} not found in $injector`);
|
|
35463
|
+
return match;
|
|
35464
|
+
}
|
|
35465
|
+
},
|
|
35466
|
+
);
|
|
35467
|
+
scope.$apply(replacedExpr);
|
|
35468
|
+
},
|
|
35469
|
+
};
|
|
35470
|
+
}
|
|
35471
|
+
|
|
35527
35472
|
/**
|
|
35528
35473
|
* Initializes core `ng` module.
|
|
35529
35474
|
* @param {import('./angular.js').Angular} angular
|
|
@@ -35542,6 +35487,8 @@ function registerNgModule(angular) {
|
|
|
35542
35487
|
$provide.provider({
|
|
35543
35488
|
$$sanitizeUri: SanitizeUriProvider,
|
|
35544
35489
|
});
|
|
35490
|
+
$provide.value("$window", window);
|
|
35491
|
+
$provide.value("$document", document);
|
|
35545
35492
|
$provide
|
|
35546
35493
|
.provider($injectTokens.$compile, CompileProvider)
|
|
35547
35494
|
.directive({
|
|
@@ -35566,6 +35513,7 @@ function registerNgModule(angular) {
|
|
|
35566
35513
|
ngHide: ngHideDirective,
|
|
35567
35514
|
ngIf: ngIfDirective,
|
|
35568
35515
|
ngInclude: ngIncludeDirective,
|
|
35516
|
+
ngInject: ngInjectDirective,
|
|
35569
35517
|
ngInit: ngInitDirective,
|
|
35570
35518
|
ngMessages: ngMessagesDirective,
|
|
35571
35519
|
ngMessage: ngMessageDirective,
|
|
@@ -35643,7 +35591,6 @@ function registerNgModule(angular) {
|
|
|
35643
35591
|
$interpolate: InterpolateProvider,
|
|
35644
35592
|
$http: HttpProvider,
|
|
35645
35593
|
$httpParamSerializer: HttpParamSerializerProvider,
|
|
35646
|
-
$httpBackend: HttpBackendProvider,
|
|
35647
35594
|
$location: LocationProvider,
|
|
35648
35595
|
$log: LogProvider,
|
|
35649
35596
|
$parse: ParseProvider,
|
|
@@ -35684,13 +35631,6 @@ const $injectorMinErr = minErr("$injector");
|
|
|
35684
35631
|
/** @type {Object.<string, NgModule>} */
|
|
35685
35632
|
const modules = {};
|
|
35686
35633
|
|
|
35687
|
-
/**
|
|
35688
|
-
* Configuration option for AngularTS bootstrap process.
|
|
35689
|
-
*
|
|
35690
|
-
* @typedef {Object} AngularBootstrapConfig
|
|
35691
|
-
* @property {boolean} [strictDi] - Disable automatic function annotation for the application. This is meant to assist in finding bugs which break minified code. Defaults to `false`.
|
|
35692
|
-
*/
|
|
35693
|
-
|
|
35694
35634
|
class Angular {
|
|
35695
35635
|
constructor() {
|
|
35696
35636
|
this.$cache = Cache;
|
|
@@ -35701,7 +35641,7 @@ class Angular {
|
|
|
35701
35641
|
/**
|
|
35702
35642
|
* @type {string} `version` from `package.json`
|
|
35703
35643
|
*/
|
|
35704
|
-
this.version = "0.9.
|
|
35644
|
+
this.version = "0.9.4"; //inserted via rollup plugin
|
|
35705
35645
|
|
|
35706
35646
|
/** @type {!Array<string|any>} */
|
|
35707
35647
|
this.bootsrappedModules = [];
|
|
@@ -35756,7 +35696,7 @@ class Angular {
|
|
|
35756
35696
|
* Each item in the array should be the name of a predefined module or a (DI annotated)
|
|
35757
35697
|
* function that will be invoked by the injector as a `config` block.
|
|
35758
35698
|
* See: {@link angular.module modules}
|
|
35759
|
-
* @param {AngularBootstrapConfig} [config]
|
|
35699
|
+
* @param {import("./interface.ts").AngularBootstrapConfig} [config]
|
|
35760
35700
|
* @returns {import('./core/di/internal-injector.js').InjectorService} The created injector instance for this application.
|
|
35761
35701
|
*/
|
|
35762
35702
|
bootstrap(element, modules, config) {
|
|
@@ -35924,7 +35864,7 @@ class Angular {
|
|
|
35924
35864
|
* @param {string} name The name of the module to create or retrieve.
|
|
35925
35865
|
* @param {Array.<string>} [requires] If specified then new module is being created. If
|
|
35926
35866
|
* unspecified then the module is being retrieved for further configuration.
|
|
35927
|
-
* @param {import("./interface.js").Injectable} [configFn] Optional configuration function for the module that gets
|
|
35867
|
+
* @param {import("./interface.js").Injectable<any>} [configFn] Optional configuration function for the module that gets
|
|
35928
35868
|
* passed to {@link NgModule.config NgModule.config()}.
|
|
35929
35869
|
* @returns {NgModule} A newly registered module.
|
|
35930
35870
|
*/
|