@abp/ng.core 7.0.0 → 7.0.2
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/esm2020/lib/abstracts/ng-model.component.mjs +1 -1
- package/esm2020/lib/clients/http.client.mjs +34 -0
- package/esm2020/lib/clients/index.mjs +2 -0
- package/esm2020/lib/components/dynamic-layout.component.mjs +6 -4
- package/esm2020/lib/components/replaceable-route-container.component.mjs +1 -1
- package/esm2020/lib/core.module.mjs +7 -1
- package/esm2020/lib/directives/debounce.directive.mjs +1 -1
- package/esm2020/lib/directives/for.directive.mjs +20 -12
- package/esm2020/lib/directives/form-submit.directive.mjs +2 -2
- package/esm2020/lib/directives/permission.directive.mjs +11 -6
- package/esm2020/lib/directives/replaceable-template.directive.mjs +9 -5
- package/esm2020/lib/directives/stop-propagation.directive.mjs +2 -2
- package/esm2020/lib/handlers/routes.handler.mjs +9 -7
- package/esm2020/lib/interceptors/api.interceptor.mjs +3 -2
- package/esm2020/lib/models/auth.mjs +1 -1
- package/esm2020/lib/models/dtos.mjs +6 -6
- package/esm2020/lib/models/environment.mjs +1 -1
- package/esm2020/lib/models/session.mjs +1 -1
- package/esm2020/lib/providers/include-localization-resources.provider.mjs +2 -2
- package/esm2020/lib/providers/locale.provider.mjs +6 -2
- package/esm2020/lib/proxy/pages/abp/multi-tenancy/abp-tenant.service.mjs +1 -1
- package/esm2020/lib/proxy/volo/abp/asp-net-core/mvc/api-exploring/abp-api-definition.service.mjs +1 -1
- package/esm2020/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service.mjs +1 -1
- package/esm2020/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-localization.service.mjs +2 -2
- package/esm2020/lib/proxy/volo/abp/http/modeling/models.mjs +1 -1
- package/esm2020/lib/proxy/volo/abp/localization/models.mjs +1 -1
- package/esm2020/lib/services/config-state.service.mjs +4 -1
- package/esm2020/lib/services/dom-insertion.service.mjs +6 -4
- package/esm2020/lib/services/environment.service.mjs +5 -5
- package/esm2020/lib/services/http-wait.service.mjs +4 -1
- package/esm2020/lib/services/lazy-load.service.mjs +6 -4
- package/esm2020/lib/services/localization.service.mjs +7 -7
- package/esm2020/lib/services/multi-tenancy.service.mjs +1 -1
- package/esm2020/lib/services/permission.service.mjs +1 -1
- package/esm2020/lib/services/replaceable-components.service.mjs +1 -1
- package/esm2020/lib/services/resource-wait.service.mjs +2 -2
- package/esm2020/lib/services/rest.service.mjs +2 -3
- package/esm2020/lib/services/router-events.service.mjs +2 -2
- package/esm2020/lib/services/routes.service.mjs +2 -2
- package/esm2020/lib/services/session-state.service.mjs +1 -1
- package/esm2020/lib/services/subscription.service.mjs +4 -2
- package/esm2020/lib/strategies/content-security.strategy.mjs +4 -2
- package/esm2020/lib/strategies/content.strategy.mjs +6 -2
- package/esm2020/lib/strategies/context.strategy.mjs +1 -1
- package/esm2020/lib/strategies/cross-origin.strategy.mjs +4 -2
- package/esm2020/lib/strategies/loading.strategy.mjs +1 -1
- package/esm2020/lib/tokens/http-context.token.mjs +3 -0
- package/esm2020/lib/tokens/include-localization-resources.token.mjs +2 -2
- package/esm2020/lib/tokens/index.mjs +3 -1
- package/esm2020/lib/tokens/localization.token.mjs +1 -1
- package/esm2020/lib/tokens/queue.token.mjs +3 -0
- package/esm2020/lib/tokens/set-token-response-to-storage.token.mjs +4 -1
- package/esm2020/lib/utils/common-utils.mjs +4 -1
- package/esm2020/lib/utils/date-utils.mjs +3 -3
- package/esm2020/lib/utils/environment-utils.mjs +2 -2
- package/esm2020/lib/utils/factory-utils.mjs +2 -2
- package/esm2020/lib/utils/index.mjs +2 -1
- package/esm2020/lib/utils/internal-store-utils.mjs +2 -1
- package/esm2020/lib/utils/lazy-load-utils.mjs +2 -2
- package/esm2020/lib/utils/localization-utils.mjs +1 -1
- package/esm2020/lib/utils/multi-tenancy-utils.mjs +7 -4
- package/esm2020/lib/utils/object-utils.mjs +1 -1
- package/esm2020/lib/utils/queue.mjs +41 -0
- package/esm2020/lib/utils/route-utils.mjs +2 -2
- package/esm2020/lib/utils/tree-utils.mjs +1 -1
- package/esm2020/lib/validators/range.validator.mjs +1 -1
- package/esm2020/lib/validators/required.validator.mjs +1 -1
- package/esm2020/lib/validators/string-length.validator.mjs +1 -1
- package/esm2020/lib/validators/username.validator.mjs +2 -2
- package/esm2020/locale/utils/register-locale.mjs +2 -2
- package/esm2020/public-api.mjs +2 -1
- package/esm2020/testing/lib/services/mock-permission.service.mjs +1 -1
- package/esm2020/testing/lib/services/mock-rest.service.mjs +2 -2
- package/fesm2015/abp-ng.core-locale.mjs +1 -1
- package/fesm2015/abp-ng.core-locale.mjs.map +1 -1
- package/fesm2015/abp-ng.core-testing.mjs.map +1 -1
- package/fesm2015/abp-ng.core.mjs +213 -77
- package/fesm2015/abp-ng.core.mjs.map +1 -1
- package/fesm2020/abp-ng.core-locale.mjs +1 -1
- package/fesm2020/abp-ng.core-locale.mjs.map +1 -1
- package/fesm2020/abp-ng.core-testing.mjs.map +1 -1
- package/fesm2020/abp-ng.core.mjs +203 -73
- package/fesm2020/abp-ng.core.mjs.map +1 -1
- package/lib/abstracts/ng-model.component.d.ts +4 -4
- package/lib/clients/http.client.d.ts +11 -0
- package/lib/clients/index.d.ts +1 -0
- package/lib/components/dynamic-layout.component.d.ts +2 -2
- package/lib/components/replaceable-route-container.component.d.ts +1 -1
- package/lib/directives/for.directive.d.ts +6 -6
- package/lib/directives/form-submit.directive.d.ts +1 -1
- package/lib/directives/permission.directive.d.ts +4 -2
- package/lib/models/auth.d.ts +4 -1
- package/lib/models/dtos.d.ts +11 -11
- package/lib/models/environment.d.ts +3 -1
- package/lib/models/session.d.ts +1 -1
- package/lib/providers/include-localization-resources.provider.d.ts +1 -1
- package/lib/proxy/volo/abp/http/modeling/models.d.ts +1 -1
- package/lib/proxy/volo/abp/localization/models.d.ts +1 -0
- package/lib/services/config-state.service.d.ts +5 -3
- package/lib/services/dom-insertion.service.d.ts +1 -1
- package/lib/services/environment.service.d.ts +1 -1
- package/lib/services/localization.service.d.ts +5 -2
- package/lib/services/multi-tenancy.service.d.ts +1 -1
- package/lib/services/permission.service.d.ts +2 -2
- package/lib/services/replaceable-components.service.d.ts +2 -2
- package/lib/services/rest.service.d.ts +1 -1
- package/lib/services/router-events.service.d.ts +2 -2
- package/lib/services/routes.service.d.ts +3 -1
- package/lib/services/session-state.service.d.ts +1 -1
- package/lib/services/subscription.service.d.ts +1 -1
- package/lib/strategies/cross-origin.strategy.d.ts +2 -2
- package/lib/tokens/http-context.token.d.ts +2 -0
- package/lib/tokens/include-localization-resources.token.d.ts +1 -1
- package/lib/tokens/index.d.ts +2 -0
- package/lib/tokens/localization.token.d.ts +2 -2
- package/lib/tokens/queue.token.d.ts +3 -0
- package/lib/tokens/set-token-response-to-storage.token.d.ts +3 -0
- package/lib/utils/common-utils.d.ts +9 -8
- package/lib/utils/factory-utils.d.ts +3 -1
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/localization-utils.d.ts +1 -1
- package/lib/utils/object-utils.d.ts +2 -1
- package/lib/utils/queue.d.ts +14 -0
- package/lib/utils/route-utils.d.ts +2 -2
- package/lib/utils/tree-utils.d.ts +3 -3
- package/package.json +3 -3
- package/public-api.d.ts +1 -0
package/fesm2015/abp-ng.core.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { ChangeDetectorRef, Component, Input, Injectable, InjectionToken, Inject, isDevMode, Optional, SkipSelf, Directive, EventEmitter, Output, Self, Injector, Pipe, NgModule, APP_INITIALIZER, LOCALE_ID, NgModuleFactory, Compiler, ComponentFactoryResolver, ApplicationRef } from '@angular/core';
|
|
3
|
-
import { of, BehaviorSubject, Subject, throwError, Subscription, combineLatest, from, fromEvent, ReplaySubject, lastValueFrom, Observable, timer, concat } from 'rxjs';
|
|
3
|
+
import { of, BehaviorSubject, Subject, throwError, Subscription, combineLatest, from, fromEvent, ReplaySubject, lastValueFrom, Observable, timer, pipe, concat } from 'rxjs';
|
|
4
4
|
import * as i1$1 from '@angular/router';
|
|
5
5
|
import { PRIMARY_OUTLET, NavigationCancel, NavigationEnd, NavigationError, NavigationStart, ActivatedRoute, Router, RouterModule } from '@angular/router';
|
|
6
|
-
import { map, distinctUntilChanged, filter, catchError, switchMap, take, tap, debounceTime, mapTo, takeUntil,
|
|
6
|
+
import { map, distinctUntilChanged, filter, catchError, switchMap, take, tap, debounceTime, mapTo, takeUntil, delay, retryWhen, shareReplay, finalize } from 'rxjs/operators';
|
|
7
7
|
import compare from 'just-compare';
|
|
8
|
-
import { __rest, __awaiter } from 'tslib';
|
|
8
|
+
import { __rest, __awaiter, __classPrivateFieldGet } from 'tslib';
|
|
9
9
|
import * as i1 from '@angular/common/http';
|
|
10
|
-
import { HttpParams, HttpClient, HttpClientModule, HttpClientXsrfModule } from '@angular/common/http';
|
|
10
|
+
import { HttpParams, HttpClient, HttpClientModule, HttpClientXsrfModule, HttpContextToken, HttpHeaders, HttpContext } from '@angular/common/http';
|
|
11
11
|
import * as i5 from '@angular/common';
|
|
12
12
|
import { registerLocaleData, DOCUMENT, DatePipe, DATE_PIPE_DEFAULT_TIMEZONE, CommonModule } from '@angular/common';
|
|
13
13
|
import * as i1$2 from '@angular/forms';
|
|
@@ -218,6 +218,9 @@ function isNode(obj) {
|
|
|
218
218
|
}
|
|
219
219
|
function isObjectAndNotArrayNotNode(obj) {
|
|
220
220
|
return isObjectAndNotArray(obj) && !isNode(obj);
|
|
221
|
+
}
|
|
222
|
+
function checkHasProp(object, key) {
|
|
223
|
+
return Object.prototype.hasOwnProperty.call(object, key);
|
|
221
224
|
}
|
|
222
225
|
|
|
223
226
|
function deepMerge(target, source) {
|
|
@@ -276,6 +279,7 @@ class InternalStore {
|
|
|
276
279
|
this.update$.next(patchedState);
|
|
277
280
|
}
|
|
278
281
|
deepPatch(state) {
|
|
282
|
+
// TODO: Strict improve deepMerge
|
|
279
283
|
this.state$.next(deepMerge(this.state, state));
|
|
280
284
|
this.update$.next(state);
|
|
281
285
|
}
|
|
@@ -294,7 +298,7 @@ function coreOptionsFactory(_a) {
|
|
|
294
298
|
return Object.assign({}, options);
|
|
295
299
|
}
|
|
296
300
|
|
|
297
|
-
const mapToApiUrl = (key) => (apis) => (apis[key] || apis.default).url || apis.default.url;
|
|
301
|
+
const mapToApiUrl = (key) => (apis) => ((key && apis[key]) || apis.default).url || apis.default.url;
|
|
298
302
|
const mapToIssuer = (issuer) => {
|
|
299
303
|
if (!issuer) {
|
|
300
304
|
return issuer;
|
|
@@ -315,7 +319,8 @@ class EnvironmentService {
|
|
|
315
319
|
return this.store.state;
|
|
316
320
|
}
|
|
317
321
|
getApiUrl(key) {
|
|
318
|
-
|
|
322
|
+
var _a;
|
|
323
|
+
return mapToApiUrl(key)((_a = this.store.state) === null || _a === void 0 ? void 0 : _a.apis);
|
|
319
324
|
}
|
|
320
325
|
getApiUrl$(key) {
|
|
321
326
|
return this.store.sliceState(state => state.apis).pipe(map(mapToApiUrl(key)));
|
|
@@ -324,11 +329,12 @@ class EnvironmentService {
|
|
|
324
329
|
this.store.set(environment);
|
|
325
330
|
}
|
|
326
331
|
getIssuer() {
|
|
327
|
-
|
|
332
|
+
var _a, _b;
|
|
333
|
+
const issuer = (_b = (_a = this.store.state) === null || _a === void 0 ? void 0 : _a.oAuthConfig) === null || _b === void 0 ? void 0 : _b.issuer;
|
|
328
334
|
return mapToIssuer(issuer);
|
|
329
335
|
}
|
|
330
336
|
getIssuer$() {
|
|
331
|
-
return this.store.sliceState(state => state.oAuthConfig.issuer).pipe(map(mapToIssuer));
|
|
337
|
+
return this.store.sliceState(state => { var _a; return (_a = state === null || state === void 0 ? void 0 : state.oAuthConfig) === null || _a === void 0 ? void 0 : _a.issuer; }).pipe(map(mapToIssuer));
|
|
332
338
|
}
|
|
333
339
|
}
|
|
334
340
|
EnvironmentService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: EnvironmentService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -391,8 +397,7 @@ class RestService {
|
|
|
391
397
|
.pipe(catchError(err => (skipHandleError ? throwError(err) : this.handleError(err))));
|
|
392
398
|
}
|
|
393
399
|
getParams(params, encoder) {
|
|
394
|
-
const filteredParams = Object.
|
|
395
|
-
const value = params[key];
|
|
400
|
+
const filteredParams = Object.entries(params).reduce((acc, [key, value]) => {
|
|
396
401
|
if (isUndefinedOrEmptyString(value))
|
|
397
402
|
return acc;
|
|
398
403
|
if (value === null && !this.options.sendNullsAsQueryParam)
|
|
@@ -483,6 +488,9 @@ class ConfigStateService {
|
|
|
483
488
|
.subscribe(res => this.store.set(res));
|
|
484
489
|
}
|
|
485
490
|
getLocalizationAndCombineWithAppState(appState) {
|
|
491
|
+
if (!appState.localization.currentCulture.cultureName) {
|
|
492
|
+
throw new Error('culture name should defined');
|
|
493
|
+
}
|
|
486
494
|
return this.getlocalizationResource(appState.localization.currentCulture.cultureName).pipe(map(result => (Object.assign(Object.assign({}, appState), { localization: Object.assign(Object.assign({}, appState.localization), result) }))));
|
|
487
495
|
}
|
|
488
496
|
getlocalizationResource(cultureName) {
|
|
@@ -808,7 +816,7 @@ class AbstractNavTreeService extends AbstractTreeService {
|
|
|
808
816
|
hasInvisibleChild(identifier) {
|
|
809
817
|
var _a;
|
|
810
818
|
const node = this.find(item => item[this.id] === identifier);
|
|
811
|
-
return (_a = node === null || node === void 0 ? void 0 : node.children) === null || _a === void 0 ? void 0 : _a.some(child => child.invisible);
|
|
819
|
+
return ((_a = node === null || node === void 0 ? void 0 : node.children) === null || _a === void 0 ? void 0 : _a.some(child => child.invisible)) || false;
|
|
812
820
|
}
|
|
813
821
|
/* istanbul ignore next */
|
|
814
822
|
ngOnDestroy() {
|
|
@@ -846,7 +854,9 @@ class SubscriptionService {
|
|
|
846
854
|
}
|
|
847
855
|
closeOne(subscription) {
|
|
848
856
|
this.removeOne(subscription);
|
|
849
|
-
subscription
|
|
857
|
+
if (subscription) {
|
|
858
|
+
subscription.unsubscribe();
|
|
859
|
+
}
|
|
850
860
|
}
|
|
851
861
|
ngOnDestroy() {
|
|
852
862
|
this.subscription.unsubscribe();
|
|
@@ -1097,13 +1107,13 @@ class LocalizationService {
|
|
|
1097
1107
|
Object.entries(remote).forEach(entry => {
|
|
1098
1108
|
const resourceName = entry[0];
|
|
1099
1109
|
const remoteTexts = entry[1];
|
|
1100
|
-
let resource = local.get(resourceName) || {};
|
|
1110
|
+
let resource = (local === null || local === void 0 ? void 0 : local.get(resourceName)) || {};
|
|
1101
1111
|
resource = Object.assign(Object.assign({}, resource), remoteTexts);
|
|
1102
|
-
local.set(resourceName, resource);
|
|
1112
|
+
local === null || local === void 0 ? void 0 : local.set(resourceName, resource);
|
|
1103
1113
|
});
|
|
1104
1114
|
}
|
|
1105
1115
|
return local;
|
|
1106
|
-
}))
|
|
1116
|
+
}), filter(Boolean))
|
|
1107
1117
|
.subscribe(val => this.localizations$.next(val));
|
|
1108
1118
|
}
|
|
1109
1119
|
addLocalization(localizations) {
|
|
@@ -1124,7 +1134,7 @@ class LocalizationService {
|
|
|
1124
1134
|
listenToSetLanguage() {
|
|
1125
1135
|
this.sessionState
|
|
1126
1136
|
.onLanguageChange$()
|
|
1127
|
-
.pipe(filter(lang => this.configState.getDeep('localization.currentCulture.cultureName') !== lang), switchMap(lang => this.configState.
|
|
1137
|
+
.pipe(filter(lang => this.configState.getDeep('localization.currentCulture.cultureName') !== lang), switchMap(lang => this.configState.refreshAppState().pipe(map(() => lang))), filter(Boolean), switchMap(lang => from(this.registerLocale(lang).then(() => lang))))
|
|
1128
1138
|
.subscribe(lang => this._languageChange$.next(lang));
|
|
1129
1139
|
}
|
|
1130
1140
|
registerLocale(locale) {
|
|
@@ -1176,14 +1186,14 @@ class LocalizationService {
|
|
|
1176
1186
|
getLocalization(state, key, ...interpolateParams) {
|
|
1177
1187
|
if (!key)
|
|
1178
1188
|
key = '';
|
|
1179
|
-
let defaultValue;
|
|
1189
|
+
let defaultValue = '';
|
|
1180
1190
|
if (typeof key !== 'string') {
|
|
1181
1191
|
defaultValue = key.defaultValue;
|
|
1182
1192
|
key = key.key;
|
|
1183
1193
|
}
|
|
1184
1194
|
const keys = key.split('::');
|
|
1185
1195
|
const warn = (message) => {
|
|
1186
|
-
if (isDevMode)
|
|
1196
|
+
if (isDevMode())
|
|
1187
1197
|
console.warn(message);
|
|
1188
1198
|
};
|
|
1189
1199
|
if (keys.length < 2) {
|
|
@@ -1344,7 +1354,7 @@ class DynamicLayoutComponent {
|
|
|
1344
1354
|
]);
|
|
1345
1355
|
this.isLayoutVisible = true;
|
|
1346
1356
|
if (dynamicLayoutComponent) {
|
|
1347
|
-
if (isDevMode)
|
|
1357
|
+
if (isDevMode())
|
|
1348
1358
|
console.warn('DynamicLayoutComponent must be used only in AppComponent.');
|
|
1349
1359
|
return;
|
|
1350
1360
|
}
|
|
@@ -1377,8 +1387,10 @@ class DynamicLayoutComponent {
|
|
|
1377
1387
|
if (this.layoutKey === expectedLayout)
|
|
1378
1388
|
return;
|
|
1379
1389
|
const key = this.layouts.get(expectedLayout);
|
|
1380
|
-
|
|
1381
|
-
|
|
1390
|
+
if (key) {
|
|
1391
|
+
this.layout = (_a = this.getComponent(key)) === null || _a === void 0 ? void 0 : _a.component;
|
|
1392
|
+
this.layoutKey = expectedLayout;
|
|
1393
|
+
}
|
|
1382
1394
|
if (!this.layout) {
|
|
1383
1395
|
this.showLayoutNotFoundError(expectedLayout);
|
|
1384
1396
|
}
|
|
@@ -1886,16 +1898,20 @@ class ForDirective {
|
|
|
1886
1898
|
const rw = [];
|
|
1887
1899
|
changes.forEachOperation((record, previousIndex, currentIndex) => {
|
|
1888
1900
|
if (record.previousIndex == null) {
|
|
1889
|
-
const view = this.vcRef.createEmbeddedView(this.tempRef, new AbpForContext(null, -1, -1, this.items), currentIndex);
|
|
1901
|
+
const view = this.vcRef.createEmbeddedView(this.tempRef, new AbpForContext(null, -1, -1, this.items), currentIndex || 0);
|
|
1890
1902
|
rw.push(new RecordView(record, view));
|
|
1891
1903
|
}
|
|
1892
|
-
else if (currentIndex == null) {
|
|
1904
|
+
else if (currentIndex == null && previousIndex !== null) {
|
|
1893
1905
|
this.vcRef.remove(previousIndex);
|
|
1894
1906
|
}
|
|
1895
1907
|
else {
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1908
|
+
if (previousIndex !== null) {
|
|
1909
|
+
const view = this.vcRef.get(previousIndex);
|
|
1910
|
+
if (view && currentIndex !== null) {
|
|
1911
|
+
this.vcRef.move(view, currentIndex);
|
|
1912
|
+
rw.push(new RecordView(record, view));
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1899
1915
|
}
|
|
1900
1916
|
});
|
|
1901
1917
|
for (let i = 0, l = rw.length; i < l; i++) {
|
|
@@ -1910,8 +1926,10 @@ class ForDirective {
|
|
|
1910
1926
|
viewRef.context.list = this.items;
|
|
1911
1927
|
}
|
|
1912
1928
|
changes.forEachIdentityChange((record) => {
|
|
1913
|
-
|
|
1914
|
-
|
|
1929
|
+
if (record.currentIndex !== null) {
|
|
1930
|
+
const viewRef = this.vcRef.get(record.currentIndex);
|
|
1931
|
+
viewRef.context.$implicit = record.item;
|
|
1932
|
+
}
|
|
1915
1933
|
});
|
|
1916
1934
|
}
|
|
1917
1935
|
projectItems(items) {
|
|
@@ -1938,8 +1956,9 @@ class ForDirective {
|
|
|
1938
1956
|
}
|
|
1939
1957
|
}
|
|
1940
1958
|
sortItems(items) {
|
|
1941
|
-
|
|
1942
|
-
|
|
1959
|
+
const orderBy = this.orderBy;
|
|
1960
|
+
if (orderBy) {
|
|
1961
|
+
items.sort((a, b) => (a[orderBy] > b[orderBy] ? 1 : a[orderBy] < b[orderBy] ? -1 : 0));
|
|
1943
1962
|
}
|
|
1944
1963
|
else {
|
|
1945
1964
|
items.sort();
|
|
@@ -1950,10 +1969,11 @@ class ForDirective {
|
|
|
1950
1969
|
if (!Array.isArray(items))
|
|
1951
1970
|
return;
|
|
1952
1971
|
const compareFn = this.compareFn;
|
|
1953
|
-
|
|
1972
|
+
const filterBy = this.filterBy;
|
|
1973
|
+
if (typeof filterBy !== 'undefined' &&
|
|
1954
1974
|
typeof this.filterVal !== 'undefined' &&
|
|
1955
1975
|
this.filterVal !== '') {
|
|
1956
|
-
items = items.filter(item => compareFn(item[
|
|
1976
|
+
items = items.filter(item => compareFn(item[filterBy], this.filterVal));
|
|
1957
1977
|
}
|
|
1958
1978
|
switch (this.orderDir) {
|
|
1959
1979
|
case 'ASC':
|
|
@@ -2024,7 +2044,7 @@ class FormSubmitDirective {
|
|
|
2024
2044
|
}
|
|
2025
2045
|
this.executedNgSubmit = true;
|
|
2026
2046
|
});
|
|
2027
|
-
const keyup$ = fromEvent(this.host.nativeElement, 'keyup').pipe(debounceTime(this.debounce), filter(event => !(event.target instanceof HTMLTextAreaElement)), filter(
|
|
2047
|
+
const keyup$ = fromEvent(this.host.nativeElement, 'keyup').pipe(debounceTime(this.debounce), filter(event => !(event.target instanceof HTMLTextAreaElement)), filter(event => event && event.key === 'Enter'));
|
|
2028
2048
|
this.subscription.addOne(keyup$, () => {
|
|
2029
2049
|
if (!this.executedNgSubmit) {
|
|
2030
2050
|
this.host.nativeElement.dispatchEvent(new Event('submit', { bubbles: true, cancelable: true }));
|
|
@@ -2093,12 +2113,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
2093
2113
|
args: ['abpInit']
|
|
2094
2114
|
}] } });
|
|
2095
2115
|
|
|
2116
|
+
const QUEUE_MANAGER = new InjectionToken("QUEUE_MANAGER");
|
|
2117
|
+
|
|
2096
2118
|
class PermissionDirective {
|
|
2097
|
-
constructor(templateRef, vcRef, permissionService, cdRef) {
|
|
2119
|
+
constructor(templateRef, vcRef, permissionService, cdRef, queue) {
|
|
2098
2120
|
this.templateRef = templateRef;
|
|
2099
2121
|
this.vcRef = vcRef;
|
|
2100
2122
|
this.permissionService = permissionService;
|
|
2101
2123
|
this.cdRef = cdRef;
|
|
2124
|
+
this.queue = queue;
|
|
2102
2125
|
this.runChangeDetection = true;
|
|
2103
2126
|
this.cdrSubject = new ReplaySubject();
|
|
2104
2127
|
this.rendered = false;
|
|
@@ -2135,11 +2158,11 @@ class PermissionDirective {
|
|
|
2135
2158
|
this.check();
|
|
2136
2159
|
}
|
|
2137
2160
|
ngAfterViewInit() {
|
|
2138
|
-
this.cdrSubject.pipe(take(1)).subscribe(() => this.cdRef.detectChanges());
|
|
2161
|
+
this.cdrSubject.pipe(take(1)).subscribe(() => this.queue.add(() => this.cdRef.detectChanges()));
|
|
2139
2162
|
this.rendered = true;
|
|
2140
2163
|
}
|
|
2141
2164
|
}
|
|
2142
|
-
PermissionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PermissionDirective, deps: [{ token: i0.TemplateRef, optional: true }, { token: i0.ViewContainerRef }, { token: PermissionService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2165
|
+
PermissionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PermissionDirective, deps: [{ token: i0.TemplateRef, optional: true }, { token: i0.ViewContainerRef }, { token: PermissionService }, { token: i0.ChangeDetectorRef }, { token: QUEUE_MANAGER }], target: i0.ɵɵFactoryTarget.Directive });
|
|
2143
2166
|
PermissionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: PermissionDirective, selector: "[abpPermission]", inputs: { condition: ["abpPermission", "condition"], runChangeDetection: ["abpPermissionRunChangeDetection", "runChangeDetection"] }, usesOnChanges: true, ngImport: i0 });
|
|
2144
2167
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PermissionDirective, decorators: [{
|
|
2145
2168
|
type: Directive,
|
|
@@ -2149,7 +2172,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
2149
2172
|
}], ctorParameters: function () {
|
|
2150
2173
|
return [{ type: i0.TemplateRef, decorators: [{
|
|
2151
2174
|
type: Optional
|
|
2152
|
-
}] }, { type: i0.ViewContainerRef }, { type: PermissionService }, { type: i0.ChangeDetectorRef }
|
|
2175
|
+
}] }, { type: i0.ViewContainerRef }, { type: PermissionService }, { type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
|
|
2176
|
+
type: Inject,
|
|
2177
|
+
args: [QUEUE_MANAGER]
|
|
2178
|
+
}] }];
|
|
2153
2179
|
}, propDecorators: { condition: [{
|
|
2154
2180
|
type: Input,
|
|
2155
2181
|
args: ['abpPermission']
|
|
@@ -2243,11 +2269,16 @@ class ReplaceableTemplateDirective {
|
|
|
2243
2269
|
if (!this.data.inputs)
|
|
2244
2270
|
return;
|
|
2245
2271
|
Object.defineProperties(this.providedData.inputs, Object.assign({}, Object.keys(this.data.inputs).reduce((acc, key) => {
|
|
2246
|
-
var _a;
|
|
2247
|
-
return (Object.assign(Object.assign({}, acc), { [key]: Object.assign({ enumerable: true, configurable: true, get: () => { var _a; return (_a = this.data.inputs[key]) === null ||
|
|
2272
|
+
var _a, _b;
|
|
2273
|
+
return (Object.assign(Object.assign({}, acc), { [key]: Object.assign({ enumerable: true, configurable: true, get: () => { var _a, _b; return (_b = (_a = this.data.inputs) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.value; } }, (((_b = (_a = this.data.inputs) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.twoWay) && {
|
|
2248
2274
|
set: (newValue) => {
|
|
2249
|
-
|
|
2250
|
-
this.data.
|
|
2275
|
+
var _a, _b;
|
|
2276
|
+
if ((_a = this.data.inputs) === null || _a === void 0 ? void 0 : _a[key]) {
|
|
2277
|
+
this.data.inputs[key].value = newValue;
|
|
2278
|
+
}
|
|
2279
|
+
if ((_b = this.data.outputs) === null || _b === void 0 ? void 0 : _b[`${key}Change`]) {
|
|
2280
|
+
this.data.outputs[`${key}Change`](newValue);
|
|
2281
|
+
}
|
|
2251
2282
|
},
|
|
2252
2283
|
})) }));
|
|
2253
2284
|
}, {})));
|
|
@@ -2280,7 +2311,7 @@ class StopPropagationDirective {
|
|
|
2280
2311
|
this.stopPropEvent = new EventEmitter();
|
|
2281
2312
|
}
|
|
2282
2313
|
ngOnInit() {
|
|
2283
|
-
this.subscription.addOne(fromEvent(this.el.nativeElement, 'click'),
|
|
2314
|
+
this.subscription.addOne(fromEvent(this.el.nativeElement, 'click'), event => {
|
|
2284
2315
|
event.stopPropagation();
|
|
2285
2316
|
this.stopPropEvent.emit(event);
|
|
2286
2317
|
});
|
|
@@ -2309,14 +2340,16 @@ class RoutesHandler {
|
|
|
2309
2340
|
addRoutes() {
|
|
2310
2341
|
var _a, _b;
|
|
2311
2342
|
(_b = (_a = this.router) === null || _a === void 0 ? void 0 : _a.config) === null || _b === void 0 ? void 0 : _b.forEach(({ path = '', data }) => {
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
if (Array.isArray(data.routes)) {
|
|
2315
|
-
this.routes.add(data.routes);
|
|
2343
|
+
const routes = data === null || data === void 0 ? void 0 : data.routes;
|
|
2344
|
+
if (!routes)
|
|
2316
2345
|
return;
|
|
2346
|
+
if (Array.isArray(routes)) {
|
|
2347
|
+
this.routes.add(routes);
|
|
2348
|
+
}
|
|
2349
|
+
else {
|
|
2350
|
+
const routesFlatten = flatRoutes([Object.assign({ path }, routes)], { path: '' });
|
|
2351
|
+
this.routes.add(routesFlatten);
|
|
2317
2352
|
}
|
|
2318
|
-
const routes = flatRoutes([Object.assign({ path }, data.routes)], { path: '' });
|
|
2319
|
-
this.routes.add(routes);
|
|
2320
2353
|
});
|
|
2321
2354
|
}
|
|
2322
2355
|
}
|
|
@@ -2487,7 +2520,10 @@ class LocaleId extends String {
|
|
|
2487
2520
|
}
|
|
2488
2521
|
toString() {
|
|
2489
2522
|
const { currentLang } = this.localizationService;
|
|
2490
|
-
|
|
2523
|
+
if (checkHasProp(differentLocales, currentLang)) {
|
|
2524
|
+
return differentLocales[currentLang];
|
|
2525
|
+
}
|
|
2526
|
+
return currentLang;
|
|
2491
2527
|
}
|
|
2492
2528
|
valueOf() {
|
|
2493
2529
|
return this.toString();
|
|
@@ -2522,7 +2558,7 @@ function getRemoteEnv(injector, environment) {
|
|
|
2522
2558
|
httpErrorReporter.reportError(err);
|
|
2523
2559
|
return of(null);
|
|
2524
2560
|
}), // TODO: Consider get handle function from a provider
|
|
2525
|
-
tap(env => environmentService.setState(mergeEnvironments(environment, env, remoteEnv))))
|
|
2561
|
+
tap(env => environmentService.setState(mergeEnvironments(environment, env || {}, remoteEnv))))
|
|
2526
2562
|
.toPromise();
|
|
2527
2563
|
}
|
|
2528
2564
|
function mergeEnvironments(local, remote, config) {
|
|
@@ -2659,18 +2695,22 @@ function parseTenantFromUrl(injector) {
|
|
|
2659
2695
|
});
|
|
2660
2696
|
}
|
|
2661
2697
|
function replaceTenantNameWithinEnvironment(injector, tenancyName, placeholder = tenancyPlaceholder) {
|
|
2698
|
+
var _a;
|
|
2662
2699
|
const environmentService = injector.get(EnvironmentService);
|
|
2663
2700
|
const environment = clone(environmentService.getEnvironment());
|
|
2664
2701
|
if (environment.application.baseUrl) {
|
|
2665
2702
|
environment.application.baseUrl = environment.application.baseUrl.replace(placeholder, tenancyName);
|
|
2666
2703
|
}
|
|
2667
|
-
if (environment.oAuthConfig.redirectUri) {
|
|
2704
|
+
if ((_a = environment.oAuthConfig) === null || _a === void 0 ? void 0 : _a.redirectUri) {
|
|
2668
2705
|
environment.oAuthConfig.redirectUri = environment.oAuthConfig.redirectUri.replace(placeholder, tenancyName);
|
|
2669
2706
|
}
|
|
2670
|
-
|
|
2707
|
+
if (!environment.oAuthConfig) {
|
|
2708
|
+
environment.oAuthConfig = {};
|
|
2709
|
+
}
|
|
2710
|
+
environment.oAuthConfig.issuer = (environment.oAuthConfig.issuer || '').replace(placeholder, tenancyName);
|
|
2671
2711
|
Object.keys(environment.apis).forEach(api => {
|
|
2672
2712
|
Object.keys(environment.apis[api]).forEach(key => {
|
|
2673
|
-
environment.apis[api][key] = environment.apis[api][key].replace(placeholder, tenancyName);
|
|
2713
|
+
environment.apis[api][key] = (environment.apis[api][key] || '').replace(placeholder, tenancyName);
|
|
2674
2714
|
});
|
|
2675
2715
|
});
|
|
2676
2716
|
return environmentService.setState(environment);
|
|
@@ -2730,12 +2770,14 @@ function getShortDateFormat(configStateService) {
|
|
|
2730
2770
|
return dateTimeFormat.shortDatePattern;
|
|
2731
2771
|
}
|
|
2732
2772
|
function getShortTimeFormat(configStateService) {
|
|
2773
|
+
var _a;
|
|
2733
2774
|
const dateTimeFormat = configStateService.getDeep('localization.currentCulture.dateTimeFormat');
|
|
2734
|
-
return dateTimeFormat.shortTimePattern.replace('tt', 'a');
|
|
2775
|
+
return (_a = dateTimeFormat === null || dateTimeFormat === void 0 ? void 0 : dateTimeFormat.shortTimePattern) === null || _a === void 0 ? void 0 : _a.replace('tt', 'a');
|
|
2735
2776
|
}
|
|
2736
2777
|
function getShortDateShortTimeFormat(configStateService) {
|
|
2778
|
+
var _a;
|
|
2737
2779
|
const dateTimeFormat = configStateService.getDeep('localization.currentCulture.dateTimeFormat');
|
|
2738
|
-
return `${dateTimeFormat.shortDatePattern} ${dateTimeFormat.shortTimePattern.replace('tt', 'a')}`;
|
|
2780
|
+
return `${dateTimeFormat.shortDatePattern} ${(_a = dateTimeFormat === null || dateTimeFormat === void 0 ? void 0 : dateTimeFormat.shortTimePattern) === null || _a === void 0 ? void 0 : _a.replace('tt', 'a')}`;
|
|
2739
2781
|
}
|
|
2740
2782
|
|
|
2741
2783
|
class ContentProjectionService {
|
|
@@ -2762,10 +2804,7 @@ class LazyModuleFactory extends NgModuleFactory {
|
|
|
2762
2804
|
return this.moduleWithProviders.ngModule;
|
|
2763
2805
|
}
|
|
2764
2806
|
create(parentInjector) {
|
|
2765
|
-
const injector = Injector.create({
|
|
2766
|
-
parent: parentInjector,
|
|
2767
|
-
providers: this.moduleWithProviders.providers,
|
|
2768
|
-
});
|
|
2807
|
+
const injector = Injector.create(Object.assign(Object.assign({}, (parentInjector && { parent: parentInjector })), { providers: this.moduleWithProviders.providers }));
|
|
2769
2808
|
const compiler = injector.get(Compiler);
|
|
2770
2809
|
const factory = compiler.compileModuleSync(this.moduleType);
|
|
2771
2810
|
return factory.create(injector);
|
|
@@ -2865,7 +2904,9 @@ class CrossOriginStrategy {
|
|
|
2865
2904
|
setCrossOrigin(element) {
|
|
2866
2905
|
if (this.integrity)
|
|
2867
2906
|
element.setAttribute('integrity', this.integrity);
|
|
2868
|
-
|
|
2907
|
+
if (this.crossorigin) {
|
|
2908
|
+
element.setAttribute('crossorigin', this.crossorigin);
|
|
2909
|
+
}
|
|
2869
2910
|
}
|
|
2870
2911
|
}
|
|
2871
2912
|
class NoCrossOriginStrategy extends CrossOriginStrategy {
|
|
@@ -2933,8 +2974,9 @@ function fromLazyLoad(element, domStrategy = DOM_STRATEGY.AppendToHead(), crossO
|
|
|
2933
2974
|
}
|
|
2934
2975
|
function createErrorHandler(observer, element) {
|
|
2935
2976
|
return function (event) {
|
|
2977
|
+
var _a;
|
|
2936
2978
|
clearCallbacks(element);
|
|
2937
|
-
element.parentNode.removeChild(element);
|
|
2979
|
+
(_a = element.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(element);
|
|
2938
2980
|
observer.error(event);
|
|
2939
2981
|
};
|
|
2940
2982
|
}
|
|
@@ -2947,6 +2989,47 @@ function clearCallbacks(element) {
|
|
|
2947
2989
|
element.onsuspend = null;
|
|
2948
2990
|
}
|
|
2949
2991
|
|
|
2992
|
+
class DefaultQueueManager {
|
|
2993
|
+
constructor() {
|
|
2994
|
+
this.queue = [];
|
|
2995
|
+
this.isRunning = false;
|
|
2996
|
+
this.stack = 0;
|
|
2997
|
+
this.interval = 0;
|
|
2998
|
+
this.stackSize = 100;
|
|
2999
|
+
}
|
|
3000
|
+
init(interval, stackSize) {
|
|
3001
|
+
this.interval = interval;
|
|
3002
|
+
this.stackSize = stackSize;
|
|
3003
|
+
}
|
|
3004
|
+
add(fn) {
|
|
3005
|
+
this.queue.push(fn);
|
|
3006
|
+
this.run();
|
|
3007
|
+
}
|
|
3008
|
+
run() {
|
|
3009
|
+
if (this.isRunning)
|
|
3010
|
+
return;
|
|
3011
|
+
this.stack++;
|
|
3012
|
+
this.isRunning = true;
|
|
3013
|
+
const fn = this.queue.shift();
|
|
3014
|
+
if (!fn) {
|
|
3015
|
+
this.isRunning = false;
|
|
3016
|
+
return;
|
|
3017
|
+
}
|
|
3018
|
+
fn();
|
|
3019
|
+
if (this.stack > this.stackSize) {
|
|
3020
|
+
setTimeout(() => {
|
|
3021
|
+
this.isRunning = false;
|
|
3022
|
+
this.run();
|
|
3023
|
+
this.stack = 0;
|
|
3024
|
+
}, this.interval);
|
|
3025
|
+
}
|
|
3026
|
+
else {
|
|
3027
|
+
this.isRunning = false;
|
|
3028
|
+
this.run();
|
|
3029
|
+
}
|
|
3030
|
+
}
|
|
3031
|
+
}
|
|
3032
|
+
|
|
2950
3033
|
class DomInsertionService {
|
|
2951
3034
|
constructor() {
|
|
2952
3035
|
this.inserted = new Set();
|
|
@@ -2960,9 +3043,12 @@ class DomInsertionService {
|
|
|
2960
3043
|
return element;
|
|
2961
3044
|
}
|
|
2962
3045
|
removeContent(element) {
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
3046
|
+
var _a;
|
|
3047
|
+
if (element.textContent) {
|
|
3048
|
+
const hash = generateHash(element.textContent);
|
|
3049
|
+
this.inserted.delete(hash);
|
|
3050
|
+
(_a = element.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(element);
|
|
3051
|
+
}
|
|
2966
3052
|
}
|
|
2967
3053
|
has(content) {
|
|
2968
3054
|
const hash = generateHash(content);
|
|
@@ -3026,6 +3112,9 @@ class HttpWaitService {
|
|
|
3026
3112
|
this.store.patch({ filteredRequests });
|
|
3027
3113
|
}
|
|
3028
3114
|
applyFilter(requests) {
|
|
3115
|
+
if (!requests) {
|
|
3116
|
+
return [];
|
|
3117
|
+
}
|
|
3029
3118
|
const { filteredRequests } = this.store.state;
|
|
3030
3119
|
return requests.filter(({ method, url }) => !filteredRequests.find(filteredRequest => this.isSameRequest(filteredRequest, { method, endpoint: getPathName(url) })));
|
|
3031
3120
|
}
|
|
@@ -3054,7 +3143,7 @@ class ResourceWaitService {
|
|
|
3054
3143
|
return this.store.sliceState(({ resources }) => !!resources.size);
|
|
3055
3144
|
}
|
|
3056
3145
|
updateLoading$() {
|
|
3057
|
-
return this.store.sliceUpdate(({ resources }) => !!resources.size);
|
|
3146
|
+
return this.store.sliceUpdate(({ resources }) => !!(resources === null || resources === void 0 ? void 0 : resources.size));
|
|
3058
3147
|
}
|
|
3059
3148
|
clearLoading() {
|
|
3060
3149
|
this.store.patch({ resources: new Set() });
|
|
@@ -3088,16 +3177,19 @@ class LazyLoadService {
|
|
|
3088
3177
|
if (this.loaded.has(strategy.path))
|
|
3089
3178
|
return of(new CustomEvent('load'));
|
|
3090
3179
|
this.resourceWaitService.addResource(strategy.path);
|
|
3091
|
-
|
|
3180
|
+
const delayOperator = retryDelay ? pipe(delay(retryDelay)) : pipe();
|
|
3181
|
+
const takeOp = retryTimes ? pipe(take(retryTimes)) : pipe();
|
|
3182
|
+
return strategy.createStream().pipe(retryWhen(error$ => concat(error$.pipe(delayOperator, takeOp), throwError(() => new CustomEvent('error')))), tap(() => {
|
|
3092
3183
|
this.loaded.set(strategy.path, strategy.element);
|
|
3093
3184
|
this.resourceWaitService.deleteResource(strategy.path);
|
|
3094
3185
|
}), delay(100), shareReplay({ bufferSize: 1, refCount: true }));
|
|
3095
3186
|
}
|
|
3096
3187
|
remove(path) {
|
|
3188
|
+
var _a;
|
|
3097
3189
|
const element = this.loaded.get(path);
|
|
3098
3190
|
if (!element)
|
|
3099
3191
|
return false;
|
|
3100
|
-
element.parentNode.removeChild(element);
|
|
3192
|
+
(_a = element.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(element);
|
|
3101
3193
|
this.loaded.delete(path);
|
|
3102
3194
|
return true;
|
|
3103
3195
|
}
|
|
@@ -3566,6 +3658,10 @@ class CoreModule {
|
|
|
3566
3658
|
useValue: localizationContributor(options.localizations),
|
|
3567
3659
|
deps: [LocalizationService],
|
|
3568
3660
|
},
|
|
3661
|
+
{
|
|
3662
|
+
provide: QUEUE_MANAGER,
|
|
3663
|
+
useClass: DefaultQueueManager,
|
|
3664
|
+
},
|
|
3569
3665
|
IncludeLocalizationResourcesProvider,
|
|
3570
3666
|
],
|
|
3571
3667
|
};
|
|
@@ -3629,7 +3725,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
3629
3725
|
class ListResultDto {
|
|
3630
3726
|
constructor(initialValues = {}) {
|
|
3631
3727
|
for (const key in initialValues) {
|
|
3632
|
-
if (
|
|
3728
|
+
if (checkHasProp(initialValues, key)) {
|
|
3633
3729
|
this[key] = initialValues[key];
|
|
3634
3730
|
}
|
|
3635
3731
|
}
|
|
@@ -3644,8 +3740,7 @@ class LimitedResultRequestDto {
|
|
|
3644
3740
|
constructor(initialValues = {}) {
|
|
3645
3741
|
this.maxResultCount = 10;
|
|
3646
3742
|
for (const key in initialValues) {
|
|
3647
|
-
if (
|
|
3648
|
-
initialValues[key] !== undefined) {
|
|
3743
|
+
if (checkHasProp(initialValues, key) && initialValues[key] !== undefined) {
|
|
3649
3744
|
this[key] = initialValues[key];
|
|
3650
3745
|
}
|
|
3651
3746
|
}
|
|
@@ -3664,7 +3759,7 @@ class PagedAndSortedResultRequestDto extends PagedResultRequestDto {
|
|
|
3664
3759
|
class EntityDto {
|
|
3665
3760
|
constructor(initialValues = {}) {
|
|
3666
3761
|
for (const key in initialValues) {
|
|
3667
|
-
if (
|
|
3762
|
+
if (checkHasProp(initialValues, key)) {
|
|
3668
3763
|
this[key] = initialValues[key];
|
|
3669
3764
|
}
|
|
3670
3765
|
}
|
|
@@ -3703,7 +3798,7 @@ class FullAuditedEntityWithUserDto extends FullAuditedEntityDto {
|
|
|
3703
3798
|
class ExtensibleObject {
|
|
3704
3799
|
constructor(initialValues = {}) {
|
|
3705
3800
|
for (const key in initialValues) {
|
|
3706
|
-
if (
|
|
3801
|
+
if (checkHasProp(initialValues, key)) {
|
|
3707
3802
|
this[key] = initialValues[key];
|
|
3708
3803
|
}
|
|
3709
3804
|
}
|
|
@@ -3817,7 +3912,9 @@ class LooseContentSecurityStrategy extends ContentSecurityStrategy {
|
|
|
3817
3912
|
super(nonce);
|
|
3818
3913
|
}
|
|
3819
3914
|
applyCSP(element) {
|
|
3820
|
-
|
|
3915
|
+
if (this.nonce) {
|
|
3916
|
+
element.setAttribute('nonce', this.nonce);
|
|
3917
|
+
}
|
|
3821
3918
|
}
|
|
3822
3919
|
}
|
|
3823
3920
|
class NoContentSecurityStrategy extends ContentSecurityStrategy {
|
|
@@ -3845,7 +3942,11 @@ class ContentStrategy {
|
|
|
3845
3942
|
insertElement() {
|
|
3846
3943
|
const element = this.createElement();
|
|
3847
3944
|
if (this.options && Object.keys(this.options).length > 0) {
|
|
3848
|
-
Object.keys(this.options).forEach(key =>
|
|
3945
|
+
Object.keys(this.options).forEach(key => {
|
|
3946
|
+
if (this.options[key]) {
|
|
3947
|
+
element[key] = this.options[key];
|
|
3948
|
+
}
|
|
3949
|
+
});
|
|
3849
3950
|
}
|
|
3850
3951
|
this.contentSecurityStrategy.applyCSP(element);
|
|
3851
3952
|
this.domStrategy.insertElement(element);
|
|
@@ -4051,8 +4152,13 @@ const NAVIGATE_TO_MANAGE_PROFILE = new InjectionToken('NAVIGATE_TO_MANAGE_PROFIL
|
|
|
4051
4152
|
|
|
4052
4153
|
const PIPE_TO_LOGIN_FN_KEY = new InjectionToken('PIPE_TO_LOGIN_FN_KEY');
|
|
4053
4154
|
|
|
4155
|
+
/**
|
|
4156
|
+
* @deprecated The token should not be used anymore.
|
|
4157
|
+
*/
|
|
4054
4158
|
const SET_TOKEN_RESPONSE_TO_STORAGE_FN_KEY = new InjectionToken('SET_TOKEN_RESPONSE_TO_STORAGE_FN_KEY');
|
|
4055
4159
|
|
|
4160
|
+
const IS_EXTERNAL_REQUEST = new HttpContextToken(() => false);
|
|
4161
|
+
|
|
4056
4162
|
function validateMinAge({ age = 18 } = {}) {
|
|
4057
4163
|
return (control) => {
|
|
4058
4164
|
if (['', null, undefined].indexOf(control.value) > -1)
|
|
@@ -4150,7 +4256,7 @@ function isValidUrl(value) {
|
|
|
4150
4256
|
}
|
|
4151
4257
|
|
|
4152
4258
|
const onlyLetterAndNumberRegex = /^[a-zA-Z0-9]+$/;
|
|
4153
|
-
function validateUsername({ pattern } = { pattern: onlyLetterAndNumberRegex }) {
|
|
4259
|
+
function validateUsername({ pattern = /.*/ } = { pattern: onlyLetterAndNumberRegex }) {
|
|
4154
4260
|
return (control) => {
|
|
4155
4261
|
const isValid = isValidUserName(control.value, pattern);
|
|
4156
4262
|
return isValid ? null : { usernamePattern: { actualValue: control.value } };
|
|
@@ -4178,7 +4284,7 @@ class ApiInterceptor {
|
|
|
4178
4284
|
this.httpWaitService = httpWaitService;
|
|
4179
4285
|
}
|
|
4180
4286
|
getAdditionalHeaders(existingHeaders) {
|
|
4181
|
-
return existingHeaders;
|
|
4287
|
+
return existingHeaders || new HttpHeaders();
|
|
4182
4288
|
}
|
|
4183
4289
|
intercept(request, next) {
|
|
4184
4290
|
this.httpWaitService.addRequest(request);
|
|
@@ -4194,11 +4300,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
|
|
|
4194
4300
|
}]
|
|
4195
4301
|
}], ctorParameters: function () { return [{ type: HttpWaitService }]; } });
|
|
4196
4302
|
|
|
4303
|
+
var _ExternalHttpClient_instances, _ExternalHttpClient_setPlaceholderContext;
|
|
4304
|
+
// source : https://github.com/armanozak/demo-angular-server-specific-interceptors
|
|
4305
|
+
class ExternalHttpClient extends HttpClient {
|
|
4306
|
+
constructor() {
|
|
4307
|
+
super(...arguments);
|
|
4308
|
+
_ExternalHttpClient_instances.add(this);
|
|
4309
|
+
}
|
|
4310
|
+
request(first, url, options = {}) {
|
|
4311
|
+
if (typeof first === 'string') {
|
|
4312
|
+
__classPrivateFieldGet(this, _ExternalHttpClient_instances, "m", _ExternalHttpClient_setPlaceholderContext).call(this, options);
|
|
4313
|
+
return super.request(first, url || '', options);
|
|
4314
|
+
}
|
|
4315
|
+
__classPrivateFieldGet(this, _ExternalHttpClient_instances, "m", _ExternalHttpClient_setPlaceholderContext).call(this, first);
|
|
4316
|
+
return super.request(first);
|
|
4317
|
+
}
|
|
4318
|
+
}
|
|
4319
|
+
_ExternalHttpClient_instances = new WeakSet(), _ExternalHttpClient_setPlaceholderContext = function _ExternalHttpClient_setPlaceholderContext(optionsOrRequest) {
|
|
4320
|
+
var _a;
|
|
4321
|
+
(_a = optionsOrRequest.context) !== null && _a !== void 0 ? _a : (optionsOrRequest.context = new HttpContext());
|
|
4322
|
+
optionsOrRequest.context.set(IS_EXTERNAL_REQUEST, true);
|
|
4323
|
+
};
|
|
4324
|
+
ExternalHttpClient.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ExternalHttpClient, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
4325
|
+
ExternalHttpClient.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ExternalHttpClient, providedIn: 'root' });
|
|
4326
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: ExternalHttpClient, decorators: [{
|
|
4327
|
+
type: Injectable,
|
|
4328
|
+
args: [{
|
|
4329
|
+
providedIn: 'root',
|
|
4330
|
+
}]
|
|
4331
|
+
}] });
|
|
4332
|
+
|
|
4197
4333
|
// export * from './lib/handlers';
|
|
4198
4334
|
|
|
4199
4335
|
/**
|
|
4200
4336
|
* Generated bundle index. Do not edit.
|
|
4201
4337
|
*/
|
|
4202
4338
|
|
|
4203
|
-
export { APP_INIT_ERROR_HANDLERS, AbpApiDefinitionService, AbpApplicationConfigurationService, AbpApplicationLocalizationService, AbpTenantService, AbpValidators, AbstractNavTreeService, AbstractNgModelComponent, AbstractTreeService, ApiInterceptor, AuditedEntityDto, AuditedEntityWithUserDto, AuthGuard, AuthService, AutofocusDirective, BaseCoreModule, BaseTreeNode, CHECK_AUTHENTICATION_STATE_FN_KEY, CONTAINER_STRATEGY, CONTENT_SECURITY_STRATEGY, CONTENT_STRATEGY, CONTEXT_STRATEGY, COOKIE_LANGUAGE_KEY, CORE_OPTIONS, CROSS_ORIGIN_STRATEGY, ClearContainerStrategy, ComponentContextStrategy, ComponentProjectionStrategy, ConfigStateService, ContainerStrategy, ContentProjectionService, ContentSecurityStrategy, ContentStrategy, ContextStrategy, CoreModule, CreationAuditedEntityDto, CreationAuditedEntityWithUserDto, CrossOriginStrategy, DOM_STRATEGY, DomInsertionService, DomStrategy, DynamicLayoutComponent, EntityDto, EnvironmentService, ExtensibleAuditedEntityDto, ExtensibleAuditedEntityWithUserDto, ExtensibleCreationAuditedEntityDto, ExtensibleCreationAuditedEntityWithUserDto, ExtensibleEntityDto, ExtensibleFullAuditedEntityDto, ExtensibleFullAuditedEntityWithUserDto, ExtensibleObject, ForDirective, FormSubmitDirective, FullAuditedEntityDto, FullAuditedEntityWithUserDto, HttpErrorReporterService, HttpWaitService, INCUDE_LOCALIZATION_RESOURCES_TOKEN, INJECTOR_PIPE_DATA_TOKEN, InitDirective, InputEventDebounceDirective, InsertIntoContainerStrategy, InternalStore, LIST_QUERY_DEBOUNCE_TIME, LOADER_DELAY, LOADING_STRATEGY, LOCALIZATIONS, LazyLoadService, LazyModuleFactory, LimitedResultRequestDto, ListResultDto, ListService, LoadingStrategy, LocalizationModule, LocalizationPipe, LocalizationService, LooseContentSecurityStrategy, MultiTenancyService, NAVIGATE_TO_MANAGE_PROFILE, NavigationEvent, NoContentSecurityStrategy, NoContextStrategy, NoCrossOriginStrategy, index as ObjectExtending, PIPE_TO_LOGIN_FN_KEY, PROJECTION_STRATEGY, PagedAndSortedResultRequestDto, PagedResultDto, PagedResultRequestDto, PermissionDirective, PermissionGuard, PermissionService, ProjectionStrategy, ReplaceableComponentsService, ReplaceableRouteContainerComponent, ReplaceableTemplateDirective, ResourceWaitService, RestService, RootComponentProjectionStrategy, RootCoreModule, RouterEvents, RouterOutletComponent, RouterWaitService, RoutesService, SET_TOKEN_RESPONSE_TO_STORAGE_FN_KEY, ScriptContentStrategy, ScriptLoadingStrategy, SessionStateService, ShortDatePipe, ShortDateTimePipe, ShortTimePipe, SortPipe, StopPropagationDirective, StyleContentStrategy, StyleLoadingStrategy, SubscriptionService, TENANT_KEY, TemplateContextStrategy, TemplateProjectionStrategy, ToInjectorPipe, TrackByService, WebHttpUrlEncodingCodec, coreOptionsFactory, createLocalizationPipeKeyGenerator, createLocalizer, createLocalizerWithFallback, createMapFromList, createTokenParser, createTreeFromList, createTreeNodeFilterCreator, deepMerge, differentLocales, downloadBlob, escapeHtmlChars, exists, featuresFactory, findRoute, fromLazyLoad, generateHash, generatePassword, getInitialData, getLocaleDirection, getPathName, getRemoteEnv, getRoutePath, getShortDateFormat, getShortDateShortTimeFormat, getShortTimeFormat, interpolate, isArray, isNode, isNullOrEmpty, isNullOrUndefined, isNumber, isObject, isObjectAndNotArray, isObjectAndNotArrayNotNode, isUndefinedOrEmptyString, localeInitializer, localizationContributor, localizations$, mapEnumToOptions, noop, parseTenantFromUrl, pushValueTo, reloadRoute, trackBy, trackByDeep, uuid, validateCreditCard, validateMinAge, validateRange, validateRequired, validateStringLength, validateUrl };
|
|
4339
|
+
export { APP_INIT_ERROR_HANDLERS, AbpApiDefinitionService, AbpApplicationConfigurationService, AbpApplicationLocalizationService, AbpTenantService, AbpValidators, AbstractNavTreeService, AbstractNgModelComponent, AbstractTreeService, ApiInterceptor, AuditedEntityDto, AuditedEntityWithUserDto, AuthGuard, AuthService, AutofocusDirective, BaseCoreModule, BaseTreeNode, CHECK_AUTHENTICATION_STATE_FN_KEY, CONTAINER_STRATEGY, CONTENT_SECURITY_STRATEGY, CONTENT_STRATEGY, CONTEXT_STRATEGY, COOKIE_LANGUAGE_KEY, CORE_OPTIONS, CROSS_ORIGIN_STRATEGY, ClearContainerStrategy, ComponentContextStrategy, ComponentProjectionStrategy, ConfigStateService, ContainerStrategy, ContentProjectionService, ContentSecurityStrategy, ContentStrategy, ContextStrategy, CoreModule, CreationAuditedEntityDto, CreationAuditedEntityWithUserDto, CrossOriginStrategy, DOM_STRATEGY, DefaultQueueManager, DomInsertionService, DomStrategy, DynamicLayoutComponent, EntityDto, EnvironmentService, ExtensibleAuditedEntityDto, ExtensibleAuditedEntityWithUserDto, ExtensibleCreationAuditedEntityDto, ExtensibleCreationAuditedEntityWithUserDto, ExtensibleEntityDto, ExtensibleFullAuditedEntityDto, ExtensibleFullAuditedEntityWithUserDto, ExtensibleObject, ExternalHttpClient, ForDirective, FormSubmitDirective, FullAuditedEntityDto, FullAuditedEntityWithUserDto, HttpErrorReporterService, HttpWaitService, INCUDE_LOCALIZATION_RESOURCES_TOKEN, INJECTOR_PIPE_DATA_TOKEN, IS_EXTERNAL_REQUEST, InitDirective, InputEventDebounceDirective, InsertIntoContainerStrategy, InternalStore, LIST_QUERY_DEBOUNCE_TIME, LOADER_DELAY, LOADING_STRATEGY, LOCALIZATIONS, LazyLoadService, LazyModuleFactory, LimitedResultRequestDto, ListResultDto, ListService, LoadingStrategy, LocalizationModule, LocalizationPipe, LocalizationService, LooseContentSecurityStrategy, MultiTenancyService, NAVIGATE_TO_MANAGE_PROFILE, NavigationEvent, NoContentSecurityStrategy, NoContextStrategy, NoCrossOriginStrategy, index as ObjectExtending, PIPE_TO_LOGIN_FN_KEY, PROJECTION_STRATEGY, PagedAndSortedResultRequestDto, PagedResultDto, PagedResultRequestDto, PermissionDirective, PermissionGuard, PermissionService, ProjectionStrategy, QUEUE_MANAGER, ReplaceableComponentsService, ReplaceableRouteContainerComponent, ReplaceableTemplateDirective, ResourceWaitService, RestService, RootComponentProjectionStrategy, RootCoreModule, RouterEvents, RouterOutletComponent, RouterWaitService, RoutesService, SET_TOKEN_RESPONSE_TO_STORAGE_FN_KEY, ScriptContentStrategy, ScriptLoadingStrategy, SessionStateService, ShortDatePipe, ShortDateTimePipe, ShortTimePipe, SortPipe, StopPropagationDirective, StyleContentStrategy, StyleLoadingStrategy, SubscriptionService, TENANT_KEY, TemplateContextStrategy, TemplateProjectionStrategy, ToInjectorPipe, TrackByService, WebHttpUrlEncodingCodec, checkHasProp, coreOptionsFactory, createLocalizationPipeKeyGenerator, createLocalizer, createLocalizerWithFallback, createMapFromList, createTokenParser, createTreeFromList, createTreeNodeFilterCreator, deepMerge, differentLocales, downloadBlob, escapeHtmlChars, exists, featuresFactory, findRoute, fromLazyLoad, generateHash, generatePassword, getInitialData, getLocaleDirection, getPathName, getRemoteEnv, getRoutePath, getShortDateFormat, getShortDateShortTimeFormat, getShortTimeFormat, interpolate, isArray, isNode, isNullOrEmpty, isNullOrUndefined, isNumber, isObject, isObjectAndNotArray, isObjectAndNotArrayNotNode, isUndefinedOrEmptyString, localeInitializer, localizationContributor, localizations$, mapEnumToOptions, noop, parseTenantFromUrl, pushValueTo, reloadRoute, trackBy, trackByDeep, uuid, validateCreditCard, validateMinAge, validateRange, validateRequired, validateStringLength, validateUrl };
|
|
4204
4340
|
//# sourceMappingURL=abp-ng.core.mjs.map
|