@abp/ng.core 5.0.1 → 5.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/README.md +3 -3
- package/abp-ng.core.d.ts +5 -5
- package/bundles/abp-ng.core-locale.umd.js +361 -361
- package/bundles/abp-ng.core-locale.umd.js.map +1 -1
- package/bundles/abp-ng.core-testing.umd.js +442 -442
- package/bundles/abp-ng.core-testing.umd.js.map +1 -1
- package/bundles/abp-ng.core.umd.js +4873 -4868
- package/bundles/abp-ng.core.umd.js.map +1 -1
- package/esm2015/abp-ng.core.js +4 -4
- package/esm2015/lib/abstracts/index.js +2 -2
- package/esm2015/lib/abstracts/ng-model.component.js +59 -59
- package/esm2015/lib/components/dynamic-layout.component.js +89 -89
- package/esm2015/lib/components/index.js +4 -4
- package/esm2015/lib/components/replaceable-route-container.component.js +42 -42
- package/esm2015/lib/components/router-outlet.component.js +15 -15
- package/esm2015/lib/constants/different-locales.js +337 -337
- package/esm2015/lib/constants/index.js +2 -2
- package/esm2015/lib/core.module.js +281 -281
- package/esm2015/lib/directives/autofocus.directive.js +30 -30
- package/esm2015/lib/directives/debounce.directive.js +36 -36
- package/esm2015/lib/directives/for.directive.js +151 -151
- package/esm2015/lib/directives/form-submit.directive.js +69 -69
- package/esm2015/lib/directives/index.js +9 -9
- package/esm2015/lib/directives/init.directive.js +21 -21
- package/esm2015/lib/directives/permission.directive.js +48 -48
- package/esm2015/lib/directives/replaceable-template.directive.js +121 -121
- package/esm2015/lib/directives/stop-propagation.directive.js +32 -32
- package/esm2015/lib/enums/common.js +2 -2
- package/esm2015/lib/enums/index.js +2 -2
- package/esm2015/lib/guards/auth.guard.js +29 -29
- package/esm2015/lib/guards/index.js +3 -3
- package/esm2015/lib/guards/permission.guard.js +44 -44
- package/esm2015/lib/handlers/oauth-configuration.handler.js +37 -37
- package/esm2015/lib/handlers/routes.handler.js +47 -47
- package/esm2015/lib/interceptors/api.interceptor.js +54 -54
- package/esm2015/lib/interceptors/index.js +2 -2
- package/esm2015/lib/localization.module.js +16 -16
- package/esm2015/lib/models/auth.js +2 -2
- package/esm2015/lib/models/common.js +2 -2
- package/esm2015/lib/models/dtos.js +119 -119
- package/esm2015/lib/models/environment.js +2 -2
- package/esm2015/lib/models/index.js +10 -10
- package/esm2015/lib/models/localization.js +2 -2
- package/esm2015/lib/models/replaceable-components.js +2 -2
- package/esm2015/lib/models/rest.js +2 -2
- package/esm2015/lib/models/session.js +2 -2
- package/esm2015/lib/models/utility.js +2 -2
- package/esm2015/lib/pipes/index.js +3 -3
- package/esm2015/lib/pipes/localization.pipe.js +33 -33
- package/esm2015/lib/pipes/sort.pipe.js +49 -49
- package/esm2015/lib/providers/cookie-language.provider.js +22 -22
- package/esm2015/lib/providers/locale.provider.js +22 -22
- package/esm2015/lib/proxy/pages/abp/multi-tenancy/abp-tenant.service.js +29 -29
- package/esm2015/lib/proxy/pages/abp/multi-tenancy/index.js +2 -2
- package/esm2015/lib/proxy/volo/abp/asp-net-core/mvc/api-exploring/abp-api-definition.service.js +24 -24
- package/esm2015/lib/proxy/volo/abp/asp-net-core/mvc/api-exploring/index.js +2 -2
- package/esm2015/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service.js +25 -25
- package/esm2015/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/index.js +5 -5
- package/esm2015/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/models.js +2 -2
- package/esm2015/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending/index.js +2 -2
- package/esm2015/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending/models.js +3 -3
- package/esm2015/lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy/index.js +2 -2
- package/esm2015/lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy/models.js +2 -2
- package/esm2015/lib/proxy/volo/abp/http/modeling/index.js +2 -2
- package/esm2015/lib/proxy/volo/abp/http/modeling/models.js +3 -3
- package/esm2015/lib/proxy/volo/abp/localization/index.js +2 -2
- package/esm2015/lib/proxy/volo/abp/localization/models.js +2 -2
- package/esm2015/lib/proxy/volo/abp/models.js +2 -2
- package/esm2015/lib/services/auth.service.js +47 -47
- package/esm2015/lib/services/config-state.service.js +130 -130
- package/esm2015/lib/services/content-projection.service.js +17 -17
- package/esm2015/lib/services/dom-insertion.service.js +32 -32
- package/esm2015/lib/services/environment.service.js +35 -35
- package/esm2015/lib/services/http-error-reporter.service.js +29 -29
- package/esm2015/lib/services/http-wait.service.js +72 -72
- package/esm2015/lib/services/index.js +22 -22
- package/esm2015/lib/services/lazy-load.service.js +38 -38
- package/esm2015/lib/services/list.service.js +103 -103
- package/esm2015/lib/services/localization.service.js +182 -182
- package/esm2015/lib/services/multi-tenancy.service.js +48 -48
- package/esm2015/lib/services/permission.service.js +64 -64
- package/esm2015/lib/services/replaceable-components.service.js +49 -49
- package/esm2015/lib/services/resource-wait.service.js +39 -39
- package/esm2015/lib/services/rest.service.js +63 -63
- package/esm2015/lib/services/router-events.service.js +38 -38
- package/esm2015/lib/services/router-wait.service.js +51 -51
- package/esm2015/lib/services/routes.service.js +147 -147
- package/esm2015/lib/services/session-state.service.js +76 -76
- package/esm2015/lib/services/subscription.service.js +41 -41
- package/esm2015/lib/services/track-by.service.js +21 -21
- package/esm2015/lib/strategies/auth-flow.strategy.js +202 -202
- package/esm2015/lib/strategies/container.strategy.js +38 -38
- package/esm2015/lib/strategies/content-security.strategy.js +28 -28
- package/esm2015/lib/strategies/content.strategy.js +48 -48
- package/esm2015/lib/strategies/context.strategy.js +37 -37
- package/esm2015/lib/strategies/cross-origin.strategy.js +26 -26
- package/esm2015/lib/strategies/dom.strategy.js +27 -27
- package/esm2015/lib/strategies/index.js +9 -9
- package/esm2015/lib/strategies/loading.strategy.js +58 -58
- package/esm2015/lib/strategies/projection.strategy.js +80 -80
- package/esm2015/lib/tokens/app-config.token.js +3 -3
- package/esm2015/lib/tokens/cookie-language-key.token.js +5 -5
- package/esm2015/lib/tokens/index.js +9 -9
- package/esm2015/lib/tokens/list.token.js +3 -3
- package/esm2015/lib/tokens/localization.token.js +10 -10
- package/esm2015/lib/tokens/lodaer-delay.token.js +3 -3
- package/esm2015/lib/tokens/manage-profile.token.js +12 -12
- package/esm2015/lib/tokens/options.token.js +8 -8
- package/esm2015/lib/tokens/tenant-key.token.js +3 -3
- package/esm2015/lib/utils/array-utils.js +7 -7
- package/esm2015/lib/utils/auth-utils.js +42 -42
- package/esm2015/lib/utils/common-utils.js +29 -29
- package/esm2015/lib/utils/date-extensions.js +6 -6
- package/esm2015/lib/utils/date-utils.js +13 -13
- package/esm2015/lib/utils/environment-utils.js +36 -36
- package/esm2015/lib/utils/factory-utils.js +24 -24
- package/esm2015/lib/utils/file-utils.js +14 -14
- package/esm2015/lib/utils/form-utils.js +12 -12
- package/esm2015/lib/utils/generator-utils.js +34 -34
- package/esm2015/lib/utils/http-utils.js +19 -19
- package/esm2015/lib/utils/index.js +21 -21
- package/esm2015/lib/utils/initial-utils.js +64 -64
- package/esm2015/lib/utils/internal-store-utils.js +36 -36
- package/esm2015/lib/utils/lazy-load-utils.js +40 -40
- package/esm2015/lib/utils/localization-utils.js +50 -50
- package/esm2015/lib/utils/multi-tenancy-utils.js +83 -83
- package/esm2015/lib/utils/number-utils.js +4 -4
- package/esm2015/lib/utils/object-utils.js +37 -37
- package/esm2015/lib/utils/route-utils.js +27 -27
- package/esm2015/lib/utils/string-utils.js +25 -21
- package/esm2015/lib/utils/tree-utils.js +54 -54
- package/esm2015/lib/validators/age.validator.js +14 -14
- package/esm2015/lib/validators/credit-card.validator.js +21 -21
- package/esm2015/lib/validators/index.js +23 -23
- package/esm2015/lib/validators/range.validator.js +15 -15
- package/esm2015/lib/validators/required.validator.js +13 -13
- package/esm2015/lib/validators/string-length.validator.js +15 -15
- package/esm2015/lib/validators/url.validator.js +16 -16
- package/esm2015/locale/abp-ng.core-locale.js +4 -4
- package/esm2015/locale/public-api.js +2 -2
- package/esm2015/locale/utils/register-locale.js +43 -43
- package/esm2015/public-api.js +26 -26
- package/esm2015/testing/abp-ng.core-testing.js +4 -4
- package/esm2015/testing/lib/core-testing.module.js +62 -62
- package/esm2015/testing/lib/services/index.js +3 -3
- package/esm2015/testing/lib/services/mock-permission.service.js +35 -35
- package/esm2015/testing/lib/services/mock-rest.service.js +30 -30
- package/esm2015/testing/lib/utils/clear-page.util.js +10 -10
- package/esm2015/testing/lib/utils/index.js +3 -3
- package/esm2015/testing/lib/utils/wait.util.js +5 -5
- package/esm2015/testing/public-api.js +4 -4
- package/fesm2015/abp-ng.core-locale.js +40 -40
- package/fesm2015/abp-ng.core-locale.js.map +1 -1
- package/fesm2015/abp-ng.core-testing.js +113 -113
- package/fesm2015/abp-ng.core-testing.js.map +1 -1
- package/fesm2015/abp-ng.core.js +3979 -3975
- package/fesm2015/abp-ng.core.js.map +1 -1
- package/lib/abstracts/index.d.ts +1 -1
- package/lib/abstracts/ng-model.component.d.ts +25 -25
- package/lib/components/dynamic-layout.component.d.ts +27 -27
- package/lib/components/index.d.ts +3 -3
- package/lib/components/replaceable-route-container.component.d.ts +17 -17
- package/lib/components/router-outlet.component.d.ts +5 -5
- package/lib/constants/different-locales.d.ts +334 -334
- package/lib/constants/index.d.ts +1 -1
- package/lib/core.module.d.ts +56 -56
- package/lib/directives/autofocus.directive.d.ts +12 -12
- package/lib/directives/debounce.directive.d.ts +13 -13
- package/lib/directives/for.directive.d.ts +36 -36
- package/lib/directives/form-submit.directive.d.ts +19 -19
- package/lib/directives/index.d.ts +8 -8
- package/lib/directives/init.directive.d.ts +10 -10
- package/lib/directives/permission.directive.d.ts +18 -18
- package/lib/directives/replaceable-template.directive.d.ts +30 -30
- package/lib/directives/stop-propagation.directive.d.ts +12 -12
- package/lib/enums/common.d.ts +5 -5
- package/lib/enums/index.d.ts +1 -1
- package/lib/guards/auth.guard.d.ts +13 -13
- package/lib/guards/index.d.ts +2 -2
- package/lib/guards/permission.guard.d.ts +16 -16
- package/lib/handlers/oauth-configuration.handler.d.ts +13 -13
- package/lib/handlers/routes.handler.d.ts +11 -11
- package/lib/interceptors/api.interceptor.d.ts +16 -16
- package/lib/interceptors/index.d.ts +1 -1
- package/lib/localization.module.d.ts +7 -7
- package/lib/models/auth.d.ts +6 -6
- package/lib/models/common.d.ts +77 -77
- package/lib/models/dtos.d.ts +95 -95
- package/lib/models/environment.d.ts +35 -35
- package/lib/models/index.d.ts +9 -9
- package/lib/models/localization.d.ts +5 -5
- package/lib/models/replaceable-components.d.ts +45 -45
- package/lib/models/rest.d.ts +35 -35
- package/lib/models/session.d.ts +7 -7
- package/lib/models/utility.d.ts +14 -14
- package/lib/pipes/index.d.ts +2 -2
- package/lib/pipes/localization.pipe.d.ts +12 -12
- package/lib/pipes/sort.pipe.d.ts +9 -9
- package/lib/providers/cookie-language.provider.d.ts +3 -3
- package/lib/providers/locale.provider.d.ts +9 -9
- package/lib/proxy/pages/abp/multi-tenancy/abp-tenant.service.d.ts +12 -12
- package/lib/proxy/pages/abp/multi-tenancy/index.d.ts +1 -1
- package/lib/proxy/volo/abp/asp-net-core/mvc/api-exploring/abp-api-definition.service.d.ts +11 -11
- package/lib/proxy/volo/abp/asp-net-core/mvc/api-exploring/index.d.ts +1 -1
- package/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/abp-application-configuration.service.d.ts +11 -11
- package/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/index.d.ts +4 -4
- package/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/models.d.ts +85 -85
- package/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending/index.d.ts +1 -1
- package/lib/proxy/volo/abp/asp-net-core/mvc/application-configurations/object-extending/models.d.ts +71 -71
- package/lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy/index.d.ts +1 -1
- package/lib/proxy/volo/abp/asp-net-core/mvc/multi-tenancy/models.d.ts +14 -14
- package/lib/proxy/volo/abp/http/modeling/index.d.ts +1 -1
- package/lib/proxy/volo/abp/http/modeling/models.d.ts +70 -70
- package/lib/proxy/volo/abp/localization/index.d.ts +1 -1
- package/lib/proxy/volo/abp/localization/models.d.ts +6 -6
- package/lib/proxy/volo/abp/models.d.ts +4 -4
- package/lib/services/auth.service.d.ts +17 -17
- package/lib/services/config-state.service.d.ts +339 -339
- package/lib/services/content-projection.service.d.ts +10 -10
- package/lib/services/dom-insertion.service.d.ts +10 -10
- package/lib/services/environment.service.d.ts +96 -96
- package/lib/services/http-error-reporter.service.d.ts +12 -12
- package/lib/services/http-wait.service.d.ts +30 -30
- package/lib/services/index.d.ts +21 -21
- package/lib/services/lazy-load.service.d.ts +13 -13
- package/lib/services/list.service.d.ts +39 -39
- package/lib/services/localization.service.d.ts +47 -47
- package/lib/services/multi-tenancy.service.d.ts +22 -22
- package/lib/services/permission.service.d.ts +19 -19
- package/lib/services/replaceable-components.service.d.ts +19 -19
- package/lib/services/resource-wait.service.d.ts +15 -15
- package/lib/services/rest.service.d.ts +20 -20
- package/lib/services/router-events.service.d.ts +29 -29
- package/lib/services/router-wait.service.d.ts +20 -20
- package/lib/services/routes.service.d.ts +50 -50
- package/lib/services/session-state.service.d.ts +25 -25
- package/lib/services/subscription.service.d.ts +17 -17
- package/lib/services/track-by.service.d.ts +11 -11
- package/lib/strategies/auth-flow.strategy.d.ts +367 -367
- package/lib/strategies/container.strategy.d.ts +22 -22
- package/lib/strategies/content-security.strategy.d.ts +17 -17
- package/lib/strategies/content.strategy.d.ts +26 -26
- package/lib/strategies/context.strategy.d.ts +23 -23
- package/lib/strategies/cross-origin.strategy.d.ts +14 -14
- package/lib/strategies/dom.strategy.d.ts +13 -13
- package/lib/strategies/index.d.ts +8 -8
- package/lib/strategies/loading.strategy.d.ts +28 -28
- package/lib/strategies/projection.strategy.d.ts +39 -39
- package/lib/tokens/app-config.token.d.ts +3 -3
- package/lib/tokens/cookie-language-key.token.d.ts +2 -2
- package/lib/tokens/index.d.ts +8 -8
- package/lib/tokens/list.token.d.ts +2 -2
- package/lib/tokens/localization.token.d.ts +6 -6
- package/lib/tokens/lodaer-delay.token.d.ts +2 -2
- package/lib/tokens/manage-profile.token.d.ts +2 -2
- package/lib/tokens/options.token.d.ts +4 -4
- package/lib/tokens/tenant-key.token.d.ts +2 -2
- package/lib/utils/array-utils.d.ts +1 -1
- package/lib/utils/auth-utils.d.ts +162 -162
- package/lib/utils/common-utils.d.ts +9 -9
- package/lib/utils/date-extensions.d.ts +6 -6
- package/lib/utils/date-utils.d.ts +4 -4
- package/lib/utils/environment-utils.d.ts +3 -3
- package/lib/utils/factory-utils.d.ts +9 -9
- package/lib/utils/file-utils.d.ts +1 -1
- package/lib/utils/form-utils.d.ts +2 -2
- package/lib/utils/generator-utils.d.ts +3 -3
- package/lib/utils/http-utils.d.ts +8 -8
- package/lib/utils/index.d.ts +20 -20
- package/lib/utils/initial-utils.d.ts +159 -159
- package/lib/utils/internal-store-utils.d.ts +14 -14
- package/lib/utils/lazy-load-utils.d.ts +4 -4
- package/lib/utils/localization-utils.d.ts +5 -5
- package/lib/utils/multi-tenancy-utils.d.ts +3 -3
- package/lib/utils/number-utils.d.ts +1 -1
- package/lib/utils/object-utils.d.ts +1 -1
- package/lib/utils/route-utils.d.ts +8 -8
- package/lib/utils/string-utils.d.ts +3 -2
- package/lib/utils/tree-utils.d.ts +19 -19
- package/lib/validators/age.validator.d.ts +10 -10
- package/lib/validators/credit-card.validator.d.ts +5 -5
- package/lib/validators/index.d.ts +22 -22
- package/lib/validators/range.validator.d.ts +12 -12
- package/lib/validators/required.validator.d.ts +8 -8
- package/lib/validators/string-length.validator.d.ts +14 -14
- package/lib/validators/url.validator.d.ts +5 -5
- package/locale/abp-ng.core-locale.d.ts +5 -5
- package/locale/public-api.d.ts +1 -1
- package/locale/utils/register-locale.d.ts +13 -13
- package/package.json +2 -2
- package/public-api.d.ts +24 -24
- package/testing/abp-ng.core-testing.d.ts +5 -5
- package/testing/lib/core-testing.module.d.ts +16 -16
- package/testing/lib/services/index.d.ts +2 -2
- package/testing/lib/services/mock-permission.service.d.ts +10 -10
- package/testing/lib/services/mock-rest.service.d.ts +13 -13
- package/testing/lib/utils/clear-page.util.d.ts +2 -2
- package/testing/lib/utils/index.d.ts +2 -2
- package/testing/lib/utils/wait.util.d.ts +2 -2
- package/testing/public-api.d.ts +3 -3
|
@@ -1,69 +1,69 @@
|
|
|
1
|
-
import { ChangeDetectorRef, Directive, ElementRef, EventEmitter, Input, Output, Self, } from '@angular/core';
|
|
2
|
-
import { FormGroupDirective } from '@angular/forms';
|
|
3
|
-
import { fromEvent } from 'rxjs';
|
|
4
|
-
import { debounceTime, filter } from 'rxjs/operators';
|
|
5
|
-
import { SubscriptionService } from '../services/subscription.service';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
import * as i1 from "@angular/forms";
|
|
8
|
-
import * as i2 from "../services/subscription.service";
|
|
9
|
-
export class FormSubmitDirective {
|
|
10
|
-
constructor(formGroupDirective, host, cdRef, subscription) {
|
|
11
|
-
this.formGroupDirective = formGroupDirective;
|
|
12
|
-
this.host = host;
|
|
13
|
-
this.cdRef = cdRef;
|
|
14
|
-
this.subscription = subscription;
|
|
15
|
-
this.debounce = 200;
|
|
16
|
-
this.ngSubmit = new EventEmitter();
|
|
17
|
-
this.executedNgSubmit = false;
|
|
18
|
-
}
|
|
19
|
-
ngOnInit() {
|
|
20
|
-
this.subscription.addOne(this.formGroupDirective.ngSubmit, () => {
|
|
21
|
-
this.markAsDirty();
|
|
22
|
-
this.executedNgSubmit = true;
|
|
23
|
-
});
|
|
24
|
-
const keyup$ = fromEvent(this.host.nativeElement, 'keyup').pipe(debounceTime(this.debounce), filter(event => !(event.target instanceof HTMLTextAreaElement)), filter((event) => event && event.key === 'Enter'));
|
|
25
|
-
this.subscription.addOne(keyup$, () => {
|
|
26
|
-
if (!this.executedNgSubmit) {
|
|
27
|
-
this.host.nativeElement.dispatchEvent(new Event('submit', { bubbles: true, cancelable: true }));
|
|
28
|
-
}
|
|
29
|
-
this.executedNgSubmit = false;
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
markAsDirty() {
|
|
33
|
-
const { form } = this.formGroupDirective;
|
|
34
|
-
setDirty(form.controls);
|
|
35
|
-
form.markAsDirty();
|
|
36
|
-
this.cdRef.detectChanges();
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
FormSubmitDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: FormSubmitDirective, deps: [{ token: i1.FormGroupDirective, self: true }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i2.SubscriptionService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
40
|
-
FormSubmitDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: { debounce: "debounce", notValidateOnSubmit: "notValidateOnSubmit" }, outputs: { ngSubmit: "ngSubmit" }, providers: [SubscriptionService], ngImport: i0 });
|
|
41
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: FormSubmitDirective, decorators: [{
|
|
42
|
-
type: Directive,
|
|
43
|
-
args: [{
|
|
44
|
-
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
45
|
-
selector: 'form[ngSubmit][formGroup]',
|
|
46
|
-
providers: [SubscriptionService],
|
|
47
|
-
}]
|
|
48
|
-
}], ctorParameters: function () { return [{ type: i1.FormGroupDirective, decorators: [{
|
|
49
|
-
type: Self
|
|
50
|
-
}] }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i2.SubscriptionService }]; }, propDecorators: { debounce: [{
|
|
51
|
-
type: Input
|
|
52
|
-
}], notValidateOnSubmit: [{
|
|
53
|
-
type: Input
|
|
54
|
-
}], ngSubmit: [{
|
|
55
|
-
type: Output
|
|
56
|
-
}] } });
|
|
57
|
-
function setDirty(controls) {
|
|
58
|
-
if (Array.isArray(controls)) {
|
|
59
|
-
controls.forEach(group => {
|
|
60
|
-
setDirty(group.controls);
|
|
61
|
-
});
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
Object.keys(controls).forEach(key => {
|
|
65
|
-
controls[key].markAsDirty();
|
|
66
|
-
controls[key].updateValueAndValidity();
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { ChangeDetectorRef, Directive, ElementRef, EventEmitter, Input, Output, Self, } from '@angular/core';
|
|
2
|
+
import { FormGroupDirective } from '@angular/forms';
|
|
3
|
+
import { fromEvent } from 'rxjs';
|
|
4
|
+
import { debounceTime, filter } from 'rxjs/operators';
|
|
5
|
+
import { SubscriptionService } from '../services/subscription.service';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
import * as i1 from "@angular/forms";
|
|
8
|
+
import * as i2 from "../services/subscription.service";
|
|
9
|
+
export class FormSubmitDirective {
|
|
10
|
+
constructor(formGroupDirective, host, cdRef, subscription) {
|
|
11
|
+
this.formGroupDirective = formGroupDirective;
|
|
12
|
+
this.host = host;
|
|
13
|
+
this.cdRef = cdRef;
|
|
14
|
+
this.subscription = subscription;
|
|
15
|
+
this.debounce = 200;
|
|
16
|
+
this.ngSubmit = new EventEmitter();
|
|
17
|
+
this.executedNgSubmit = false;
|
|
18
|
+
}
|
|
19
|
+
ngOnInit() {
|
|
20
|
+
this.subscription.addOne(this.formGroupDirective.ngSubmit, () => {
|
|
21
|
+
this.markAsDirty();
|
|
22
|
+
this.executedNgSubmit = true;
|
|
23
|
+
});
|
|
24
|
+
const keyup$ = fromEvent(this.host.nativeElement, 'keyup').pipe(debounceTime(this.debounce), filter(event => !(event.target instanceof HTMLTextAreaElement)), filter((event) => event && event.key === 'Enter'));
|
|
25
|
+
this.subscription.addOne(keyup$, () => {
|
|
26
|
+
if (!this.executedNgSubmit) {
|
|
27
|
+
this.host.nativeElement.dispatchEvent(new Event('submit', { bubbles: true, cancelable: true }));
|
|
28
|
+
}
|
|
29
|
+
this.executedNgSubmit = false;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
markAsDirty() {
|
|
33
|
+
const { form } = this.formGroupDirective;
|
|
34
|
+
setDirty(form.controls);
|
|
35
|
+
form.markAsDirty();
|
|
36
|
+
this.cdRef.detectChanges();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
FormSubmitDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: FormSubmitDirective, deps: [{ token: i1.FormGroupDirective, self: true }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i2.SubscriptionService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
40
|
+
FormSubmitDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: FormSubmitDirective, selector: "form[ngSubmit][formGroup]", inputs: { debounce: "debounce", notValidateOnSubmit: "notValidateOnSubmit" }, outputs: { ngSubmit: "ngSubmit" }, providers: [SubscriptionService], ngImport: i0 });
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: FormSubmitDirective, decorators: [{
|
|
42
|
+
type: Directive,
|
|
43
|
+
args: [{
|
|
44
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
45
|
+
selector: 'form[ngSubmit][formGroup]',
|
|
46
|
+
providers: [SubscriptionService],
|
|
47
|
+
}]
|
|
48
|
+
}], ctorParameters: function () { return [{ type: i1.FormGroupDirective, decorators: [{
|
|
49
|
+
type: Self
|
|
50
|
+
}] }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i2.SubscriptionService }]; }, propDecorators: { debounce: [{
|
|
51
|
+
type: Input
|
|
52
|
+
}], notValidateOnSubmit: [{
|
|
53
|
+
type: Input
|
|
54
|
+
}], ngSubmit: [{
|
|
55
|
+
type: Output
|
|
56
|
+
}] } });
|
|
57
|
+
function setDirty(controls) {
|
|
58
|
+
if (Array.isArray(controls)) {
|
|
59
|
+
controls.forEach(group => {
|
|
60
|
+
setDirty(group.controls);
|
|
61
|
+
});
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
Object.keys(controls).forEach(key => {
|
|
65
|
+
controls[key].markAsDirty();
|
|
66
|
+
controls[key].updateValueAndValidity();
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS1zdWJtaXQuZGlyZWN0aXZlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29yZS9zcmMvbGliL2RpcmVjdGl2ZXMvZm9ybS1zdWJtaXQuZGlyZWN0aXZlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxpQkFBaUIsRUFDakIsU0FBUyxFQUNULFVBQVUsRUFDVixZQUFZLEVBQ1osS0FBSyxFQUVMLE1BQU0sRUFDTixJQUFJLEdBQ0wsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUEwQixrQkFBa0IsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQzVFLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxNQUFNLENBQUM7QUFDakMsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUN0RCxPQUFPLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSxrQ0FBa0MsQ0FBQzs7OztBQVN2RSxNQUFNLE9BQU8sbUJBQW1CO0lBVzlCLFlBQ2tCLGtCQUFzQyxFQUM5QyxJQUFpQyxFQUNqQyxLQUF3QixFQUN4QixZQUFpQztRQUh6Qix1QkFBa0IsR0FBbEIsa0JBQWtCLENBQW9CO1FBQzlDLFNBQUks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mb3JFYWNoKGtleSA9PiB7XG4gICAgY29udHJvbHNba2V5XS5tYXJrQXNEaXJ0eSgpO1xuICAgIGNvbnRyb2xzW2tleV0udXBkYXRlVmFsdWVBbmRWYWxpZGl0eSgpO1xuICB9KTtcbn1cbiJdfQ==
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from './autofocus.directive';
|
|
2
|
-
export * from './debounce.directive';
|
|
3
|
-
export * from './for.directive';
|
|
4
|
-
export * from './form-submit.directive';
|
|
5
|
-
export * from './init.directive';
|
|
6
|
-
export * from './permission.directive';
|
|
7
|
-
export * from './replaceable-template.directive';
|
|
8
|
-
export * from './stop-propagation.directive';
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
export * from './autofocus.directive';
|
|
2
|
+
export * from './debounce.directive';
|
|
3
|
+
export * from './for.directive';
|
|
4
|
+
export * from './form-submit.directive';
|
|
5
|
+
export * from './init.directive';
|
|
6
|
+
export * from './permission.directive';
|
|
7
|
+
export * from './replaceable-template.directive';
|
|
8
|
+
export * from './stop-propagation.directive';
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb3JlL3NyYy9saWIvZGlyZWN0aXZlcy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMsc0JBQXNCLENBQUM7QUFDckMsY0FBYyxpQkFBaUIsQ0FBQztBQUNoQyxjQUFjLHlCQUF5QixDQUFDO0FBQ3hDLGNBQWMsa0JBQWtCLENBQUM7QUFDakMsY0FBYyx3QkFBd0IsQ0FBQztBQUN2QyxjQUFjLGtDQUFrQyxDQUFDO0FBQ2pELGNBQWMsOEJBQThCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2F1dG9mb2N1cy5kaXJlY3RpdmUnO1xuZXhwb3J0ICogZnJvbSAnLi9kZWJvdW5jZS5kaXJlY3RpdmUnO1xuZXhwb3J0ICogZnJvbSAnLi9mb3IuZGlyZWN0aXZlJztcbmV4cG9ydCAqIGZyb20gJy4vZm9ybS1zdWJtaXQuZGlyZWN0aXZlJztcbmV4cG9ydCAqIGZyb20gJy4vaW5pdC5kaXJlY3RpdmUnO1xuZXhwb3J0ICogZnJvbSAnLi9wZXJtaXNzaW9uLmRpcmVjdGl2ZSc7XG5leHBvcnQgKiBmcm9tICcuL3JlcGxhY2VhYmxlLXRlbXBsYXRlLmRpcmVjdGl2ZSc7XG5leHBvcnQgKiBmcm9tICcuL3N0b3AtcHJvcGFnYXRpb24uZGlyZWN0aXZlJztcbiJdfQ==
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { Directive, Output, EventEmitter, ElementRef } from '@angular/core';
|
|
2
|
-
import * as i0 from "@angular/core";
|
|
3
|
-
export class InitDirective {
|
|
4
|
-
constructor(elRef) {
|
|
5
|
-
this.elRef = elRef;
|
|
6
|
-
this.init = new EventEmitter();
|
|
7
|
-
}
|
|
8
|
-
ngAfterViewInit() {
|
|
9
|
-
this.init.emit(this.elRef);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
InitDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: InitDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
13
|
-
InitDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: InitDirective, selector: "[abpInit]", outputs: { init: "abpInit" }, ngImport: i0 });
|
|
14
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: InitDirective, decorators: [{
|
|
15
|
-
type: Directive,
|
|
16
|
-
args: [{ selector: '[abpInit]' }]
|
|
17
|
-
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { init: [{
|
|
18
|
-
type: Output,
|
|
19
|
-
args: ['abpInit']
|
|
20
|
-
}] } });
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { Directive, Output, EventEmitter, ElementRef } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export class InitDirective {
|
|
4
|
+
constructor(elRef) {
|
|
5
|
+
this.elRef = elRef;
|
|
6
|
+
this.init = new EventEmitter();
|
|
7
|
+
}
|
|
8
|
+
ngAfterViewInit() {
|
|
9
|
+
this.init.emit(this.elRef);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
InitDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: InitDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
13
|
+
InitDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: InitDirective, selector: "[abpInit]", outputs: { init: "abpInit" }, ngImport: i0 });
|
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: InitDirective, decorators: [{
|
|
15
|
+
type: Directive,
|
|
16
|
+
args: [{ selector: '[abpInit]' }]
|
|
17
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { init: [{
|
|
18
|
+
type: Output,
|
|
19
|
+
args: ['abpInit']
|
|
20
|
+
}] } });
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5pdC5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb3JlL3NyYy9saWIvZGlyZWN0aXZlcy9pbml0LmRpcmVjdGl2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iAgfVxufVxuIl19
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { ChangeDetectorRef, Directive, Input, Optional, TemplateRef, ViewContainerRef, } from '@angular/core';
|
|
2
|
-
import { distinctUntilChanged } from 'rxjs/operators';
|
|
3
|
-
import { PermissionService } from '../services/permission.service';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
import * as i1 from "../services/permission.service";
|
|
6
|
-
export class PermissionDirective {
|
|
7
|
-
constructor(templateRef, vcRef, permissionService, cdRef) {
|
|
8
|
-
this.templateRef = templateRef;
|
|
9
|
-
this.vcRef = vcRef;
|
|
10
|
-
this.permissionService = permissionService;
|
|
11
|
-
this.cdRef = cdRef;
|
|
12
|
-
}
|
|
13
|
-
check() {
|
|
14
|
-
if (this.subscription) {
|
|
15
|
-
this.subscription.unsubscribe();
|
|
16
|
-
}
|
|
17
|
-
this.subscription = this.permissionService
|
|
18
|
-
.getGrantedPolicy$(this.condition || '')
|
|
19
|
-
.pipe(distinctUntilChanged())
|
|
20
|
-
.subscribe(isGranted => {
|
|
21
|
-
this.vcRef.clear();
|
|
22
|
-
if (isGranted)
|
|
23
|
-
this.vcRef.createEmbeddedView(this.templateRef);
|
|
24
|
-
this.cdRef.detectChanges();
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
ngOnDestroy() {
|
|
28
|
-
if (this.subscription)
|
|
29
|
-
this.subscription.unsubscribe();
|
|
30
|
-
}
|
|
31
|
-
ngOnChanges() {
|
|
32
|
-
this.check();
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
PermissionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PermissionDirective, deps: [{ token: i0.TemplateRef, optional: true }, { token: i0.ViewContainerRef }, { token: i1.PermissionService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
36
|
-
PermissionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: PermissionDirective, selector: "[abpPermission]", inputs: { condition: ["abpPermission", "condition"] }, usesOnChanges: true, ngImport: i0 });
|
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PermissionDirective, decorators: [{
|
|
38
|
-
type: Directive,
|
|
39
|
-
args: [{
|
|
40
|
-
selector: '[abpPermission]',
|
|
41
|
-
}]
|
|
42
|
-
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
|
43
|
-
type: Optional
|
|
44
|
-
}] }, { type: i0.ViewContainerRef }, { type: i1.PermissionService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { condition: [{
|
|
45
|
-
type: Input,
|
|
46
|
-
args: ['abpPermission']
|
|
47
|
-
}] } });
|
|
48
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
1
|
+
import { ChangeDetectorRef, Directive, Input, Optional, TemplateRef, ViewContainerRef, } from '@angular/core';
|
|
2
|
+
import { distinctUntilChanged } from 'rxjs/operators';
|
|
3
|
+
import { PermissionService } from '../services/permission.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import * as i1 from "../services/permission.service";
|
|
6
|
+
export class PermissionDirective {
|
|
7
|
+
constructor(templateRef, vcRef, permissionService, cdRef) {
|
|
8
|
+
this.templateRef = templateRef;
|
|
9
|
+
this.vcRef = vcRef;
|
|
10
|
+
this.permissionService = permissionService;
|
|
11
|
+
this.cdRef = cdRef;
|
|
12
|
+
}
|
|
13
|
+
check() {
|
|
14
|
+
if (this.subscription) {
|
|
15
|
+
this.subscription.unsubscribe();
|
|
16
|
+
}
|
|
17
|
+
this.subscription = this.permissionService
|
|
18
|
+
.getGrantedPolicy$(this.condition || '')
|
|
19
|
+
.pipe(distinctUntilChanged())
|
|
20
|
+
.subscribe(isGranted => {
|
|
21
|
+
this.vcRef.clear();
|
|
22
|
+
if (isGranted)
|
|
23
|
+
this.vcRef.createEmbeddedView(this.templateRef);
|
|
24
|
+
this.cdRef.detectChanges();
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
ngOnDestroy() {
|
|
28
|
+
if (this.subscription)
|
|
29
|
+
this.subscription.unsubscribe();
|
|
30
|
+
}
|
|
31
|
+
ngOnChanges() {
|
|
32
|
+
this.check();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
PermissionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PermissionDirective, deps: [{ token: i0.TemplateRef, optional: true }, { token: i0.ViewContainerRef }, { token: i1.PermissionService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
36
|
+
PermissionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "12.2.13", type: PermissionDirective, selector: "[abpPermission]", inputs: { condition: ["abpPermission", "condition"] }, usesOnChanges: true, ngImport: i0 });
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: PermissionDirective, decorators: [{
|
|
38
|
+
type: Directive,
|
|
39
|
+
args: [{
|
|
40
|
+
selector: '[abpPermission]',
|
|
41
|
+
}]
|
|
42
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef, decorators: [{
|
|
43
|
+
type: Optional
|
|
44
|
+
}] }, { type: i0.ViewContainerRef }, { type: i1.PermissionService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { condition: [{
|
|
45
|
+
type: Input,
|
|
46
|
+
args: ['abpPermission']
|
|
47
|
+
}] } });
|
|
48
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGVybWlzc2lvbi5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb3JlL3NyYy9saWIvZGlyZWN0aXZlcy9wZXJtaXNzaW9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