@abp/ng.theme.shared 5.0.1 → 5.1.3
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/{esm2015/abp-ng.theme.shared.js → esm2020/abp-ng.theme.shared.mjs} +0 -0
- package/{esm2015/extensions/abp-ng.theme.shared-extensions.js → esm2020/extensions/abp-ng.theme.shared-extensions.mjs} +0 -0
- package/esm2020/extensions/lib/adapters/date-time.adapter.mjs +44 -0
- package/{esm2015/extensions/lib/adapters/date.adapter.js → esm2020/extensions/lib/adapters/date.adapter.mjs} +4 -4
- package/{esm2015/extensions/lib/adapters/time.adapter.js → esm2020/extensions/lib/adapters/time.adapter.mjs} +4 -4
- package/{esm2015/extensions/lib/components/abstract-actions/abstract-actions.component.js → esm2020/extensions/lib/components/abstract-actions/abstract-actions.component.mjs} +4 -4
- package/{esm2015/extensions/lib/components/date-time-picker/date-time-picker.component.js → esm2020/extensions/lib/components/date-time-picker/date-time-picker.component.mjs} +5 -5
- package/esm2020/extensions/lib/components/extensible-form/extensible-form-prop.component.mjs +159 -0
- package/esm2020/extensions/lib/components/extensible-form/extensible-form.component.mjs +64 -0
- package/esm2020/extensions/lib/components/extensible-table/extensible-table.component.mjs +128 -0
- package/esm2020/extensions/lib/components/grid-actions/grid-actions.component.mjs +39 -0
- package/esm2020/extensions/lib/components/page-toolbar/page-toolbar.component.mjs +40 -0
- package/{esm2015/extensions/lib/constants/extra-properties.js → esm2020/extensions/lib/constants/extra-properties.mjs} +0 -0
- package/{esm2015/extensions/lib/directives/disabled.directive.js → esm2020/extensions/lib/directives/disabled.directive.mjs} +4 -4
- package/{esm2015/extensions/lib/directives/prop-data.directive.js → esm2020/extensions/lib/directives/prop-data.directive.mjs} +4 -4
- package/{esm2015/extensions/lib/enums/props.enum.js → esm2020/extensions/lib/enums/props.enum.mjs} +0 -0
- package/{esm2015/extensions/lib/models/actions.js → esm2020/extensions/lib/models/actions.mjs} +0 -0
- package/{esm2015/extensions/lib/models/entity-actions.js → esm2020/extensions/lib/models/entity-actions.mjs} +0 -0
- package/esm2020/extensions/lib/models/entity-props.mjs +36 -0
- package/{esm2015/extensions/lib/models/form-props.js → esm2020/extensions/lib/models/form-props.mjs} +0 -0
- package/{esm2015/extensions/lib/models/internal/object-extensions.js → esm2020/extensions/lib/models/internal/object-extensions.mjs} +0 -0
- package/{esm2015/extensions/lib/models/object-extensions.js → esm2020/extensions/lib/models/object-extensions.mjs} +0 -0
- package/{esm2015/extensions/lib/models/props.js → esm2020/extensions/lib/models/props.mjs} +0 -0
- package/{esm2015/extensions/lib/models/toolbar-actions.js → esm2020/extensions/lib/models/toolbar-actions.mjs} +0 -0
- package/{esm2015/extensions/lib/services/extensions.service.js → esm2020/extensions/lib/services/extensions.service.mjs} +4 -4
- package/{esm2015/extensions/lib/tokens/extensions.token.js → esm2020/extensions/lib/tokens/extensions.token.mjs} +0 -0
- package/{esm2015/extensions/lib/ui-extensions.module.js → esm2020/extensions/lib/ui-extensions.module.mjs} +9 -9
- package/{esm2015/extensions/lib/utils/actions.util.js → esm2020/extensions/lib/utils/actions.util.mjs} +0 -0
- package/{esm2015/extensions/lib/utils/enum.util.js → esm2020/extensions/lib/utils/enum.util.mjs} +0 -0
- package/{esm2015/extensions/lib/utils/factory.util.js → esm2020/extensions/lib/utils/factory.util.mjs} +0 -0
- package/{esm2015/extensions/lib/utils/form-props.util.js → esm2020/extensions/lib/utils/form-props.util.mjs} +0 -0
- package/{esm2015/extensions/lib/utils/localization.util.js → esm2020/extensions/lib/utils/localization.util.mjs} +0 -0
- package/{esm2015/extensions/lib/utils/props.util.js → esm2020/extensions/lib/utils/props.util.mjs} +0 -0
- package/{esm2015/extensions/lib/utils/state.util.js → esm2020/extensions/lib/utils/state.util.mjs} +2 -3
- package/{esm2015/extensions/lib/utils/typeahead.util.js → esm2020/extensions/lib/utils/typeahead.util.mjs} +0 -0
- package/{esm2015/extensions/lib/utils/validation.util.js → esm2020/extensions/lib/utils/validation.util.mjs} +0 -0
- package/{esm2015/extensions/public-api.js → esm2020/extensions/public-api.mjs} +0 -0
- package/{esm2015/lib/animations/bounce.animations.js → esm2020/lib/animations/bounce.animations.mjs} +0 -0
- package/{esm2015/lib/animations/collapse.animations.js → esm2020/lib/animations/collapse.animations.mjs} +0 -0
- package/{esm2015/lib/animations/fade.animations.js → esm2020/lib/animations/fade.animations.mjs} +0 -0
- package/{esm2015/lib/animations/index.js → esm2020/lib/animations/index.mjs} +0 -0
- package/{esm2015/lib/animations/modal.animations.js → esm2020/lib/animations/modal.animations.mjs} +0 -0
- package/{esm2015/lib/animations/slide.animations.js → esm2020/lib/animations/slide.animations.mjs} +0 -0
- package/{esm2015/lib/animations/toast.animations.js → esm2020/lib/animations/toast.animations.mjs} +0 -0
- package/esm2020/lib/components/breadcrumb/breadcrumb.component.mjs +43 -0
- package/esm2020/lib/components/breadcrumb-items/breadcrumb-items.component.mjs +19 -0
- package/esm2020/lib/components/button/button.component.mjs +97 -0
- package/esm2020/lib/components/confirmation/confirmation.component.mjs +36 -0
- package/esm2020/lib/components/http-error-wrapper/http-error-wrapper.component.mjs +59 -0
- package/{esm2015/lib/components/index.js → esm2020/lib/components/index.mjs} +0 -0
- package/{esm2015/lib/components/loader-bar/loader-bar.component.js → esm2020/lib/components/loader-bar/loader-bar.component.mjs} +6 -11
- package/{esm2015/lib/components/loading/loading.component.js → esm2020/lib/components/loading/loading.component.mjs} +5 -5
- package/{esm2015/lib/components/modal/modal-close.directive.js → esm2020/lib/components/modal/modal-close.directive.mjs} +5 -6
- package/{esm2015/lib/components/modal/modal-ref.service.js → esm2020/lib/components/modal/modal-ref.service.mjs} +4 -4
- package/esm2020/lib/components/modal/modal.component.mjs +189 -0
- package/esm2020/lib/components/toast/toast.component.mjs +55 -0
- package/esm2020/lib/components/toast-container/toast-container.component.mjs +43 -0
- package/{esm2015/lib/constants/styles.js → esm2020/lib/constants/styles.mjs} +0 -0
- package/{esm2015/lib/constants/validation.js → esm2020/lib/constants/validation.mjs} +0 -0
- package/{esm2015/lib/directives/ellipsis.directive.js → esm2020/lib/directives/ellipsis.directive.mjs} +8 -8
- package/{esm2015/lib/directives/index.js → esm2020/lib/directives/index.mjs} +0 -0
- package/esm2020/lib/directives/loading.directive.mjs +89 -0
- package/{esm2015/lib/directives/ngx-datatable-default.directive.js → esm2020/lib/directives/ngx-datatable-default.directive.mjs} +4 -4
- package/{esm2015/lib/directives/ngx-datatable-list.directive.js → esm2020/lib/directives/ngx-datatable-list.directive.mjs} +4 -4
- package/{esm2015/lib/enums/index.js → esm2020/lib/enums/index.mjs} +0 -0
- package/{esm2015/lib/enums/route-names.js → esm2020/lib/enums/route-names.mjs} +0 -0
- package/esm2020/lib/handlers/document-dir.handler.mjs +31 -0
- package/esm2020/lib/handlers/error.handler.mjs +286 -0
- package/{esm2015/lib/handlers/index.js → esm2020/lib/handlers/index.mjs} +0 -0
- package/{esm2015/lib/models/common.js → esm2020/lib/models/common.mjs} +0 -0
- package/{esm2015/lib/models/confirmation.js → esm2020/lib/models/confirmation.mjs} +0 -0
- package/esm2020/lib/models/index.mjs +7 -0
- package/esm2020/lib/models/nav-item.mjs +7 -0
- package/{esm2015/lib/models/statistics.js → esm2020/lib/models/statistics.mjs} +0 -0
- package/{esm2015/lib/models/toaster.js → esm2020/lib/models/toaster.mjs} +0 -0
- package/esm2020/lib/models/user-menu.mjs +4 -0
- package/{esm2015/lib/providers/index.js → esm2020/lib/providers/index.mjs} +0 -0
- package/{esm2015/lib/providers/ng-bootstrap-config.provider.js → esm2020/lib/providers/ng-bootstrap-config.provider.mjs} +0 -0
- package/{esm2015/lib/providers/route.provider.js → esm2020/lib/providers/route.provider.mjs} +0 -0
- package/esm2020/lib/services/abstract-menu.service.mjs +50 -0
- package/{esm2015/lib/services/confirmation.service.js → esm2020/lib/services/confirmation.service.mjs} +4 -4
- package/{esm2015/lib/services/index.js → esm2020/lib/services/index.mjs} +2 -1
- package/esm2020/lib/services/nav-items.service.mjs +17 -0
- package/esm2020/lib/services/page-alert.service.mjs +28 -0
- package/esm2020/lib/services/toaster.service.mjs +103 -0
- package/esm2020/lib/services/user-menu.service.mjs +17 -0
- package/esm2020/lib/theme-shared.module.mjs +162 -0
- package/{esm2015/lib/tokens/append-content.token.js → esm2020/lib/tokens/append-content.token.mjs} +0 -0
- package/esm2020/lib/tokens/http-error.token.mjs +14 -0
- package/{esm2015/lib/tokens/index.js → esm2020/lib/tokens/index.mjs} +0 -0
- package/{esm2015/lib/tokens/ngx-datatable-messages.token.js → esm2020/lib/tokens/ngx-datatable-messages.token.mjs} +0 -0
- package/{esm2015/lib/tokens/suppress-unsaved-changes-warning.token.js → esm2020/lib/tokens/suppress-unsaved-changes-warning.token.mjs} +0 -0
- package/{esm2015/lib/utils/date-parser-formatter.js → esm2020/lib/utils/date-parser-formatter.mjs} +5 -6
- package/{esm2015/lib/utils/index.js → esm2020/lib/utils/index.mjs} +0 -0
- package/{esm2015/lib/utils/validation-utils.js → esm2020/lib/utils/validation-utils.mjs} +0 -0
- package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
- package/{esm2015/testing/abp-ng.theme.shared-testing.js → esm2020/testing/abp-ng.theme.shared-testing.mjs} +0 -0
- package/{esm2015/testing/lib/models/config.js → esm2020/testing/lib/models/config.mjs} +0 -0
- package/{esm2015/testing/lib/models/index.js → esm2020/testing/lib/models/index.mjs} +0 -0
- package/esm2020/testing/lib/theme-shared-testing.module.mjs +46 -0
- package/{esm2015/testing/public-api.js → esm2020/testing/public-api.mjs} +0 -0
- package/extensions/lib/models/entity-props.d.ts +1 -1
- package/extensions/lib/tokens/extensions.token.d.ts +1 -1
- package/extensions/package.json +5 -5
- package/fesm2015/abp-ng.theme.shared-extensions.mjs +1329 -0
- package/fesm2015/abp-ng.theme.shared-extensions.mjs.map +1 -0
- package/fesm2015/{abp-ng.theme.shared-testing.js → abp-ng.theme.shared-testing.mjs} +5 -5
- package/fesm2015/abp-ng.theme.shared-testing.mjs.map +1 -0
- package/fesm2015/{abp-ng.theme.shared.js → abp-ng.theme.shared.mjs} +175 -178
- package/fesm2015/abp-ng.theme.shared.mjs.map +1 -0
- package/{fesm2015/abp-ng.theme.shared-extensions.js → fesm2020/abp-ng.theme.shared-extensions.mjs} +80 -99
- package/fesm2020/abp-ng.theme.shared-extensions.mjs.map +1 -0
- package/fesm2020/abp-ng.theme.shared-testing.mjs +57 -0
- package/fesm2020/abp-ng.theme.shared-testing.mjs.map +1 -0
- package/fesm2020/abp-ng.theme.shared.mjs +2200 -0
- package/fesm2020/abp-ng.theme.shared.mjs.map +1 -0
- package/lib/models/index.d.ts +2 -1
- package/lib/models/user-menu.d.ts +8 -0
- package/lib/services/abstract-menu.service.d.ts +12 -0
- package/lib/services/index.d.ts +1 -0
- package/lib/services/nav-items.service.d.ts +3 -8
- package/lib/services/user-menu.service.d.ts +8 -0
- package/package.json +38 -8
- package/testing/package.json +5 -5
- package/bundles/abp-ng.theme.shared-extensions.umd.js +0 -1904
- package/bundles/abp-ng.theme.shared-extensions.umd.js.map +0 -1
- package/bundles/abp-ng.theme.shared-testing.umd.js +0 -82
- package/bundles/abp-ng.theme.shared-testing.umd.js.map +0 -1
- package/bundles/abp-ng.theme.shared.umd.js +0 -2506
- package/bundles/abp-ng.theme.shared.umd.js.map +0 -1
- package/esm2015/extensions/lib/adapters/date-time.adapter.js +0 -34
- package/esm2015/extensions/lib/components/extensible-form/extensible-form-prop.component.js +0 -164
- package/esm2015/extensions/lib/components/extensible-form/extensible-form.component.js +0 -70
- package/esm2015/extensions/lib/components/extensible-table/extensible-table.component.js +0 -134
- package/esm2015/extensions/lib/components/grid-actions/grid-actions.component.js +0 -45
- package/esm2015/extensions/lib/components/page-toolbar/page-toolbar.component.js +0 -46
- package/esm2015/extensions/lib/models/entity-props.js +0 -34
- package/esm2015/lib/components/breadcrumb/breadcrumb.component.js +0 -49
- package/esm2015/lib/components/breadcrumb-items/breadcrumb-items.component.js +0 -22
- package/esm2015/lib/components/button/button.component.js +0 -98
- package/esm2015/lib/components/confirmation/confirmation.component.js +0 -40
- package/esm2015/lib/components/http-error-wrapper/http-error-wrapper.component.js +0 -65
- package/esm2015/lib/components/modal/modal.component.js +0 -188
- package/esm2015/lib/components/toast/toast.component.js +0 -61
- package/esm2015/lib/components/toast-container/toast-container.component.js +0 -49
- package/esm2015/lib/directives/loading.directive.js +0 -90
- package/esm2015/lib/handlers/document-dir.handler.js +0 -33
- package/esm2015/lib/handlers/error.handler.js +0 -292
- package/esm2015/lib/models/index.js +0 -6
- package/esm2015/lib/models/nav-item.js +0 -7
- package/esm2015/lib/services/nav-items.service.js +0 -51
- package/esm2015/lib/services/page-alert.service.js +0 -26
- package/esm2015/lib/services/toaster.service.js +0 -103
- package/esm2015/lib/theme-shared.module.js +0 -165
- package/esm2015/lib/tokens/http-error.token.js +0 -10
- package/esm2015/testing/lib/theme-shared-testing.module.js +0 -43
- package/fesm2015/abp-ng.theme.shared-extensions.js.map +0 -1
- package/fesm2015/abp-ng.theme.shared-testing.js.map +0 -1
- package/fesm2015/abp-ng.theme.shared.js.map +0 -1
|
@@ -0,0 +1,2200 @@
|
|
|
1
|
+
import { animation, style, animate, keyframes, trigger, state, transition, useAnimation, query } from '@angular/animations';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { Component, Input, ChangeDetectionStrategy, EventEmitter, Output, ViewChild, ViewEncapsulation, Injectable, InjectionToken, Optional, Inject, ContentChild, Directive, HostListener, HostBinding, NgModule, ComponentFactoryResolver, RendererFactory2, ApplicationRef, APP_INITIALIZER, inject, LOCALE_ID } from '@angular/core';
|
|
4
|
+
import * as i1 from '@angular/common';
|
|
5
|
+
import { DOCUMENT, formatDate, DatePipe } from '@angular/common';
|
|
6
|
+
import * as i1$1 from '@angular/router';
|
|
7
|
+
import { ResolveEnd } from '@angular/router';
|
|
8
|
+
import * as i2 from '@abp/ng.core';
|
|
9
|
+
import { getRoutePath, SubscriptionService, PROJECTION_STRATEGY, uuid, LocalizationService, getLocaleDirection, HttpErrorReporterService, RouterEvents, AuthService, RoutesService, InternalStore, DomInsertionService, CONTENT_STRATEGY, CoreModule, noop, ConfigStateService } from '@abp/ng.core';
|
|
10
|
+
import { startWith, map, debounceTime, filter, takeUntil, distinctUntilChanged, take, catchError, switchMap } from 'rxjs/operators';
|
|
11
|
+
import { fromEvent, Subscription, combineLatest, timer, ReplaySubject, Subject, BehaviorSubject, throwError, Observable, of } from 'rxjs';
|
|
12
|
+
import * as i3 from '@ng-bootstrap/ng-bootstrap';
|
|
13
|
+
import { NgbInputDatepickerConfig, NgbTypeaheadConfig, NgbDateParserFormatter, NgbPaginationModule } from '@ng-bootstrap/ng-bootstrap';
|
|
14
|
+
import * as i1$2 from '@swimlane/ngx-datatable';
|
|
15
|
+
import { ColumnMode, NgxDatatableModule } from '@swimlane/ngx-datatable';
|
|
16
|
+
import { HttpErrorResponse } from '@angular/common/http';
|
|
17
|
+
import { NgxValidateCoreModule, VALIDATION_BLUEPRINTS, VALIDATION_MAP_ERRORS_FN, defaultMapErrorsFn, VALIDATION_VALIDATE_ON_SUBMIT, validatePassword } from '@ngx-validate/core';
|
|
18
|
+
import { Validators } from '@angular/forms';
|
|
19
|
+
|
|
20
|
+
const bounceIn = animation([
|
|
21
|
+
style({ opacity: '0', display: '{{ display }}' }),
|
|
22
|
+
animate('{{ time}} {{ easing }}', keyframes([
|
|
23
|
+
style({ opacity: '0', transform: '{{ transform }} scale(0.0)', offset: 0 }),
|
|
24
|
+
style({ opacity: '0', transform: '{{ transform }} scale(0.8)', offset: 0.5 }),
|
|
25
|
+
style({ opacity: '1', transform: '{{ transform }} scale(1.0)', offset: 1 }),
|
|
26
|
+
])),
|
|
27
|
+
], {
|
|
28
|
+
params: {
|
|
29
|
+
time: '350ms',
|
|
30
|
+
easing: 'cubic-bezier(.7,.31,.72,1.47)',
|
|
31
|
+
display: 'block',
|
|
32
|
+
transform: 'translate(-50%, -50%)',
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const collapseY = animation([
|
|
37
|
+
style({ height: '*', overflow: 'hidden', 'box-sizing': 'border-box' }),
|
|
38
|
+
animate('{{ time }} {{ easing }}', style({ height: '0', padding: '0px' })),
|
|
39
|
+
], { params: { time: '350ms', easing: 'ease' } });
|
|
40
|
+
const collapseYWithMargin = animation([
|
|
41
|
+
style({ 'margin-top': '0' }),
|
|
42
|
+
animate('{{ time }} {{ easing }}', style({ 'margin-left': '-100%' })),
|
|
43
|
+
], {
|
|
44
|
+
params: { time: '500ms', easing: 'ease' },
|
|
45
|
+
});
|
|
46
|
+
const collapseX = animation([
|
|
47
|
+
style({ width: '*', overflow: 'hidden', 'box-sizing': 'border-box' }),
|
|
48
|
+
animate('{{ time }} {{ easing }}', style({ width: '0', padding: '0px' })),
|
|
49
|
+
], { params: { time: '350ms', easing: 'ease' } });
|
|
50
|
+
const expandY = animation([
|
|
51
|
+
style({ height: '0', overflow: 'hidden', 'box-sizing': 'border-box' }),
|
|
52
|
+
animate('{{ time }} {{ easing }}', style({ height: '*', padding: '*' })),
|
|
53
|
+
], { params: { time: '350ms', easing: 'ease' } });
|
|
54
|
+
const expandYWithMargin = animation([
|
|
55
|
+
style({ 'margin-top': '-100%' }),
|
|
56
|
+
animate('{{ time }} {{ easing }}', style({ 'margin-top': '0' })),
|
|
57
|
+
], {
|
|
58
|
+
params: { time: '500ms', easing: 'ease' },
|
|
59
|
+
});
|
|
60
|
+
const expandX = animation([
|
|
61
|
+
style({ width: '0', overflow: 'hidden', 'box-sizing': 'border-box' }),
|
|
62
|
+
animate('{{ time }} {{ easing }}', style({ width: '*', padding: '*' })),
|
|
63
|
+
], { params: { time: '350ms', easing: 'ease' } });
|
|
64
|
+
const collapse = trigger('collapse', [
|
|
65
|
+
state('collapsed', style({ height: '0', overflow: 'hidden' })),
|
|
66
|
+
state('expanded', style({ height: '*', overflow: 'hidden' })),
|
|
67
|
+
transition('expanded => collapsed', useAnimation(collapseY)),
|
|
68
|
+
transition('collapsed => expanded', useAnimation(expandY)),
|
|
69
|
+
]);
|
|
70
|
+
const collapseWithMargin = trigger('collapseWithMargin', [
|
|
71
|
+
state('collapsed', style({ 'margin-top': '-100%' })),
|
|
72
|
+
state('expanded', style({ 'margin-top': '0' })),
|
|
73
|
+
transition('expanded => collapsed', useAnimation(collapseYWithMargin), {
|
|
74
|
+
params: { time: '400ms', easing: 'linear' },
|
|
75
|
+
}),
|
|
76
|
+
transition('collapsed => expanded', useAnimation(expandYWithMargin)),
|
|
77
|
+
]);
|
|
78
|
+
const collapseLinearWithMargin = trigger('collapseLinearWithMargin', [
|
|
79
|
+
state('collapsed', style({ 'margin-top': '-100vh' })),
|
|
80
|
+
state('expanded', style({ 'margin-top': '0' })),
|
|
81
|
+
transition('expanded => collapsed', useAnimation(collapseYWithMargin, { params: { time: '200ms', easing: 'linear' } })),
|
|
82
|
+
transition('collapsed => expanded', useAnimation(expandYWithMargin, { params: { time: '250ms', easing: 'linear' } })),
|
|
83
|
+
]);
|
|
84
|
+
|
|
85
|
+
const fadeIn = animation([style({ opacity: '0' }), animate('{{ time}} {{ easing }}', style({ opacity: '1' }))], {
|
|
86
|
+
params: { time: '350ms', easing: 'ease' },
|
|
87
|
+
});
|
|
88
|
+
const fadeOut = animation([style({ opacity: '1' }), animate('{{ time}} {{ easing }}', style({ opacity: '0' }))], { params: { time: '350ms', easing: 'ease' } });
|
|
89
|
+
const fadeInDown = animation([
|
|
90
|
+
style({ opacity: '0', transform: '{{ transform }} translateY(-20px)' }),
|
|
91
|
+
animate('{{ time }} {{ easing }}', style({ opacity: '1', transform: '{{ transform }} translateY(0)' })),
|
|
92
|
+
], { params: { time: '350ms', easing: 'ease', transform: '' } });
|
|
93
|
+
const fadeInUp = animation([
|
|
94
|
+
style({ opacity: '0', transform: '{{ transform }} translateY(20px)' }),
|
|
95
|
+
animate('{{ time }} {{ easing }}', style({ opacity: '1', transform: '{{ transform }} translateY(0)' })),
|
|
96
|
+
], { params: { time: '350ms', easing: 'ease', transform: '' } });
|
|
97
|
+
const fadeInLeft = animation([
|
|
98
|
+
style({ opacity: '0', transform: '{{ transform }} translateX(20px)' }),
|
|
99
|
+
animate('{{ time }} {{ easing }}', style({ opacity: '1', transform: '{{ transform }} translateX(0)' })),
|
|
100
|
+
], { params: { time: '350ms', easing: 'ease', transform: '' } });
|
|
101
|
+
const fadeInRight = animation([
|
|
102
|
+
style({ opacity: '0', transform: '{{ transform }} translateX(-20px)' }),
|
|
103
|
+
animate('{{ time }} {{ easing }}', style({ opacity: '1', transform: '{{ transform }} translateX(0)' })),
|
|
104
|
+
], { params: { time: '350ms', easing: 'ease', transform: '' } });
|
|
105
|
+
const fadeOutDown = animation([
|
|
106
|
+
style({ opacity: '1', transform: '{{ transform }} translateY(0)' }),
|
|
107
|
+
animate('{{ time }} {{ easing }}', style({ opacity: '0', transform: '{{ transform }} translateY(20px)' })),
|
|
108
|
+
], { params: { time: '350ms', easing: 'ease', transform: '' } });
|
|
109
|
+
const fadeOutUp = animation([
|
|
110
|
+
style({ opacity: '1', transform: '{{ transform }} translateY(0)' }),
|
|
111
|
+
animate('{{ time }} {{ easing }}', style({ opacity: '0', transform: '{{ transform }} translateY(-20px)' })),
|
|
112
|
+
], { params: { time: '350ms', easing: 'ease', transform: '' } });
|
|
113
|
+
const fadeOutLeft = animation([
|
|
114
|
+
style({ opacity: '1', transform: '{{ transform }} translateX(0)' }),
|
|
115
|
+
animate('{{ time }} {{ easing }}', style({ opacity: '0', transform: '{{ transform }} translateX(20px)' })),
|
|
116
|
+
], { params: { time: '350ms', easing: 'ease', transform: '' } });
|
|
117
|
+
const fadeOutRight = animation([
|
|
118
|
+
style({ opacity: '1', transform: '{{ transform }} translateX(0)' }),
|
|
119
|
+
animate('{{ time }} {{ easing }}', style({ opacity: '0', transform: '{{ transform }} translateX(-20px)' })),
|
|
120
|
+
], { params: { time: '350ms', easing: 'ease', transform: '' } });
|
|
121
|
+
|
|
122
|
+
const fadeAnimation = trigger('fade', [
|
|
123
|
+
transition(':enter', useAnimation(fadeIn)),
|
|
124
|
+
transition(':leave', useAnimation(fadeOut)),
|
|
125
|
+
]);
|
|
126
|
+
const dialogAnimation = trigger('dialog', [
|
|
127
|
+
transition(':enter', useAnimation(fadeInDown)),
|
|
128
|
+
transition(':leave', useAnimation(fadeOut)),
|
|
129
|
+
]);
|
|
130
|
+
|
|
131
|
+
const slideFromBottom = trigger('slideFromBottom', [
|
|
132
|
+
transition('* <=> *', [
|
|
133
|
+
style({ 'margin-top': '20px', opacity: '0' }),
|
|
134
|
+
animate('0.2s ease-out', style({ opacity: '1', 'margin-top': '0px' })),
|
|
135
|
+
]),
|
|
136
|
+
]);
|
|
137
|
+
|
|
138
|
+
const toastInOut = trigger('toastInOut', [
|
|
139
|
+
transition('* <=> *', [
|
|
140
|
+
query(':enter', [
|
|
141
|
+
style({ opacity: 0, transform: 'translateY(20px)' }),
|
|
142
|
+
animate('350ms ease', style({ opacity: 1, transform: 'translateY(0)' })),
|
|
143
|
+
], { optional: true }),
|
|
144
|
+
query(':leave', animate('450ms ease', style({ opacity: 0 })), {
|
|
145
|
+
optional: true,
|
|
146
|
+
}),
|
|
147
|
+
]),
|
|
148
|
+
]);
|
|
149
|
+
|
|
150
|
+
class BreadcrumbItemsComponent {
|
|
151
|
+
constructor() {
|
|
152
|
+
this.items = [];
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
BreadcrumbItemsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BreadcrumbItemsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
156
|
+
BreadcrumbItemsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: BreadcrumbItemsComponent, selector: "abp-breadcrumb-items", inputs: { items: "items" }, ngImport: i0, template: "<ol class=\"breadcrumb\" *ngIf=\"items.length\">\r\n <li class=\"breadcrumb-item\">\r\n <a routerLink=\"/\"><i class=\"fa fa-home\"></i> </a>\r\n </li>\r\n <li\r\n *ngFor=\"let item of items; let last = last\"\r\n class=\"breadcrumb-item\"\r\n [class.active]=\"last\"\r\n aria-current=\"page\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"item.path ? linkTemplate : textTemplate; context: { $implicit: item }\"\r\n ></ng-container>\r\n </li>\r\n</ol>\r\n\r\n<ng-template #linkTemplate let-item>\r\n <a [routerLink]=\"item.path\"> {{ item.name | abpLocalization }}</a>\r\n</ng-template>\r\n\r\n<ng-template #textTemplate let-item>\r\n {{ item.name | abpLocalization }}\r\n</ng-template>\r\n", directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }, { type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], pipes: { "abpLocalization": i2.LocalizationPipe } });
|
|
157
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BreadcrumbItemsComponent, decorators: [{
|
|
158
|
+
type: Component,
|
|
159
|
+
args: [{ selector: 'abp-breadcrumb-items', template: "<ol class=\"breadcrumb\" *ngIf=\"items.length\">\r\n <li class=\"breadcrumb-item\">\r\n <a routerLink=\"/\"><i class=\"fa fa-home\"></i> </a>\r\n </li>\r\n <li\r\n *ngFor=\"let item of items; let last = last\"\r\n class=\"breadcrumb-item\"\r\n [class.active]=\"last\"\r\n aria-current=\"page\"\r\n >\r\n <ng-container\r\n *ngTemplateOutlet=\"item.path ? linkTemplate : textTemplate; context: { $implicit: item }\"\r\n ></ng-container>\r\n </li>\r\n</ol>\r\n\r\n<ng-template #linkTemplate let-item>\r\n <a [routerLink]=\"item.path\"> {{ item.name | abpLocalization }}</a>\r\n</ng-template>\r\n\r\n<ng-template #textTemplate let-item>\r\n {{ item.name | abpLocalization }}\r\n</ng-template>\r\n" }]
|
|
160
|
+
}], propDecorators: { items: [{
|
|
161
|
+
type: Input
|
|
162
|
+
}] } });
|
|
163
|
+
|
|
164
|
+
class BreadcrumbComponent {
|
|
165
|
+
constructor(cdRef, router, routes, subscription, routerEvents) {
|
|
166
|
+
this.cdRef = cdRef;
|
|
167
|
+
this.router = router;
|
|
168
|
+
this.routes = routes;
|
|
169
|
+
this.subscription = subscription;
|
|
170
|
+
this.routerEvents = routerEvents;
|
|
171
|
+
this.segments = [];
|
|
172
|
+
}
|
|
173
|
+
ngOnInit() {
|
|
174
|
+
this.subscription.addOne(this.routerEvents.getNavigationEvents('End').pipe(startWith(null), map(() => this.routes.search({ path: getRoutePath(this.router) }))), route => {
|
|
175
|
+
this.segments = [];
|
|
176
|
+
if (route) {
|
|
177
|
+
let node = { parent: route };
|
|
178
|
+
while (node.parent) {
|
|
179
|
+
node = node.parent;
|
|
180
|
+
const { parent, children, isLeaf, path, ...segment } = node;
|
|
181
|
+
if (!isAdministration(segment))
|
|
182
|
+
this.segments.unshift(segment);
|
|
183
|
+
}
|
|
184
|
+
this.cdRef.detectChanges();
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
BreadcrumbComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BreadcrumbComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$1.Router }, { token: i2.RoutesService }, { token: i2.SubscriptionService }, { token: i2.RouterEvents }], target: i0.ɵɵFactoryTarget.Component });
|
|
190
|
+
BreadcrumbComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: BreadcrumbComponent, selector: "abp-breadcrumb", providers: [SubscriptionService], ngImport: i0, template: "<abp-breadcrumb-items [items]=\"segments\"></abp-breadcrumb-items>\r\n", components: [{ type: BreadcrumbItemsComponent, selector: "abp-breadcrumb-items", inputs: ["items"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
191
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BreadcrumbComponent, decorators: [{
|
|
192
|
+
type: Component,
|
|
193
|
+
args: [{ selector: 'abp-breadcrumb', changeDetection: ChangeDetectionStrategy.OnPush, providers: [SubscriptionService], template: "<abp-breadcrumb-items [items]=\"segments\"></abp-breadcrumb-items>\r\n" }]
|
|
194
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1$1.Router }, { type: i2.RoutesService }, { type: i2.SubscriptionService }, { type: i2.RouterEvents }]; } });
|
|
195
|
+
function isAdministration(route) {
|
|
196
|
+
return route.name === "AbpUiNavigation::Menu:Administration" /* Administration */;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
class ButtonComponent {
|
|
200
|
+
constructor(renderer) {
|
|
201
|
+
this.renderer = renderer;
|
|
202
|
+
this.buttonId = '';
|
|
203
|
+
this.buttonClass = 'btn btn-primary';
|
|
204
|
+
this.buttonType = 'button';
|
|
205
|
+
this.loading = false;
|
|
206
|
+
this.disabled = false;
|
|
207
|
+
this.click = new EventEmitter();
|
|
208
|
+
this.focus = new EventEmitter();
|
|
209
|
+
this.blur = new EventEmitter();
|
|
210
|
+
this.abpClick = new EventEmitter();
|
|
211
|
+
this.abpFocus = new EventEmitter();
|
|
212
|
+
this.abpBlur = new EventEmitter();
|
|
213
|
+
}
|
|
214
|
+
get icon() {
|
|
215
|
+
return `${this.loading ? 'fa fa-spinner fa-spin' : this.iconClass || 'd-none'}`;
|
|
216
|
+
}
|
|
217
|
+
ngOnInit() {
|
|
218
|
+
if (this.attributes) {
|
|
219
|
+
Object.keys(this.attributes).forEach(key => {
|
|
220
|
+
if (this.attributes?.[key]) {
|
|
221
|
+
this.renderer.setAttribute(this.buttonRef.nativeElement, key, this.attributes[key]);
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
ButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ButtonComponent, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component });
|
|
228
|
+
ButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: ButtonComponent, selector: "abp-button", inputs: { buttonId: "buttonId", buttonClass: "buttonClass", buttonType: "buttonType", iconClass: "iconClass", loading: "loading", disabled: "disabled", attributes: "attributes" }, outputs: { click: "click", focus: "focus", blur: "blur", abpClick: "abpClick", abpFocus: "abpFocus", abpBlur: "abpBlur" }, viewQueries: [{ propertyName: "buttonRef", first: true, predicate: ["button"], descendants: true, static: true }], ngImport: i0, template: `
|
|
229
|
+
<button
|
|
230
|
+
#button
|
|
231
|
+
[id]="buttonId"
|
|
232
|
+
[attr.type]="buttonType"
|
|
233
|
+
[ngClass]="buttonClass"
|
|
234
|
+
[disabled]="loading || disabled"
|
|
235
|
+
(click.stop)="click.next($event); abpClick.next($event)"
|
|
236
|
+
(focus)="focus.next($event); abpFocus.next($event)"
|
|
237
|
+
(blur)="blur.next($event); abpBlur.next($event)"
|
|
238
|
+
>
|
|
239
|
+
<i [ngClass]="icon" class="me-1"></i><ng-content></ng-content>
|
|
240
|
+
</button>
|
|
241
|
+
`, isInline: true, directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.StopPropagationDirective, selector: "[click.stop]", outputs: ["click.stop"] }] });
|
|
242
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
243
|
+
type: Component,
|
|
244
|
+
args: [{
|
|
245
|
+
selector: 'abp-button',
|
|
246
|
+
template: `
|
|
247
|
+
<button
|
|
248
|
+
#button
|
|
249
|
+
[id]="buttonId"
|
|
250
|
+
[attr.type]="buttonType"
|
|
251
|
+
[ngClass]="buttonClass"
|
|
252
|
+
[disabled]="loading || disabled"
|
|
253
|
+
(click.stop)="click.next($event); abpClick.next($event)"
|
|
254
|
+
(focus)="focus.next($event); abpFocus.next($event)"
|
|
255
|
+
(blur)="blur.next($event); abpBlur.next($event)"
|
|
256
|
+
>
|
|
257
|
+
<i [ngClass]="icon" class="me-1"></i><ng-content></ng-content>
|
|
258
|
+
</button>
|
|
259
|
+
`,
|
|
260
|
+
}]
|
|
261
|
+
}], ctorParameters: function () { return [{ type: i0.Renderer2 }]; }, propDecorators: { buttonId: [{
|
|
262
|
+
type: Input
|
|
263
|
+
}], buttonClass: [{
|
|
264
|
+
type: Input
|
|
265
|
+
}], buttonType: [{
|
|
266
|
+
type: Input
|
|
267
|
+
}], iconClass: [{
|
|
268
|
+
type: Input
|
|
269
|
+
}], loading: [{
|
|
270
|
+
type: Input
|
|
271
|
+
}], disabled: [{
|
|
272
|
+
type: Input
|
|
273
|
+
}], attributes: [{
|
|
274
|
+
type: Input
|
|
275
|
+
}], click: [{
|
|
276
|
+
type: Output
|
|
277
|
+
}], focus: [{
|
|
278
|
+
type: Output
|
|
279
|
+
}], blur: [{
|
|
280
|
+
type: Output
|
|
281
|
+
}], abpClick: [{
|
|
282
|
+
type: Output
|
|
283
|
+
}], abpFocus: [{
|
|
284
|
+
type: Output
|
|
285
|
+
}], abpBlur: [{
|
|
286
|
+
type: Output
|
|
287
|
+
}], buttonRef: [{
|
|
288
|
+
type: ViewChild,
|
|
289
|
+
args: ['button', { static: true }]
|
|
290
|
+
}] } });
|
|
291
|
+
|
|
292
|
+
var Confirmation;
|
|
293
|
+
(function (Confirmation) {
|
|
294
|
+
let Status;
|
|
295
|
+
(function (Status) {
|
|
296
|
+
Status["confirm"] = "confirm";
|
|
297
|
+
Status["reject"] = "reject";
|
|
298
|
+
Status["dismiss"] = "dismiss";
|
|
299
|
+
})(Status = Confirmation.Status || (Confirmation.Status = {}));
|
|
300
|
+
})(Confirmation || (Confirmation = {}));
|
|
301
|
+
|
|
302
|
+
class ConfirmationComponent {
|
|
303
|
+
constructor() {
|
|
304
|
+
this.confirm = Confirmation.Status.confirm;
|
|
305
|
+
this.reject = Confirmation.Status.reject;
|
|
306
|
+
this.dismiss = Confirmation.Status.dismiss;
|
|
307
|
+
}
|
|
308
|
+
close(status) {
|
|
309
|
+
this.clear(status);
|
|
310
|
+
}
|
|
311
|
+
getIconClass({ severity }) {
|
|
312
|
+
switch (severity) {
|
|
313
|
+
case 'info':
|
|
314
|
+
return 'fa-info-circle';
|
|
315
|
+
case 'success':
|
|
316
|
+
return 'fa-check-circle';
|
|
317
|
+
case 'warning':
|
|
318
|
+
return 'fa-exclamation-triangle';
|
|
319
|
+
case 'error':
|
|
320
|
+
return 'fa-times-circle';
|
|
321
|
+
default:
|
|
322
|
+
return 'fa-question-circle';
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
ConfirmationComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ConfirmationComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
327
|
+
ConfirmationComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: ConfirmationComponent, selector: "abp-confirmation", ngImport: i0, template: "<div class=\"confirmation\" *ngIf=\"confirmation$ | async as data\">\r\n <div\r\n class=\"confirmation-backdrop\"\r\n (click)=\"data.options?.dismissible ? close(dismiss) : null\"\r\n ></div>\r\n <div class=\"confirmation-dialog\">\r\n <div class=\"icon-container\" [ngClass]=\"data.severity\" *ngIf=\"data.severity\">\r\n <i class=\"fa icon\" [ngClass]=\"getIconClass(data)\"></i>\r\n </div>\r\n <div class=\"content\">\r\n <h1\r\n class=\"title\"\r\n *ngIf=\"data.title\"\r\n [innerHTML]=\"data.title | abpLocalization: data.options?.titleLocalizationParams\"\r\n ></h1>\r\n <p\r\n class=\"message\"\r\n *ngIf=\"data.message\"\r\n [innerHTML]=\"data.message | abpLocalization: data.options?.messageLocalizationParams\"\r\n ></p>\r\n </div>\r\n <div class=\"footer\">\r\n <button\r\n id=\"cancel\"\r\n class=\"confirmation-button confirmation-button--reject\"\r\n [innerHTML]=\"data.options?.cancelText || 'AbpUi::Cancel' | abpLocalization\"\r\n *ngIf=\"!data?.options?.hideCancelBtn\"\r\n (click)=\"close(reject)\"\r\n ></button>\r\n <button\r\n id=\"confirm\"\r\n class=\"confirmation-button confirmation-button--approve\"\r\n [innerHTML]=\"data.options?.yesText || 'AbpUi::Yes' | abpLocalization\"\r\n *ngIf=\"!data?.options?.hideYesBtn\"\r\n (click)=\"close(confirm)\"\r\n ></button>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".confirmation{position:fixed;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;z-index:1060}.confirmation .confirmation-backdrop{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:1061!important}.confirmation .confirmation-dialog{display:flex;flex-direction:column;margin:20px auto;padding:0;width:450px;min-height:300px;z-index:1062!important}@media screen and (max-width: 500px){.confirmation .confirmation-dialog{width:90vw}}.confirmation .confirmation-dialog .icon-container{display:flex;align-items:center;justify-content:center;margin:0 0 10px;padding:20px}.confirmation .confirmation-dialog .icon-container .icon{width:100px;height:100px;stroke-width:1;font-size:80px;text-align:center}.confirmation .confirmation-dialog .content{flex-grow:1;display:block}.confirmation .confirmation-dialog .content .title{display:block;margin:0;padding:0;font-size:27px;font-weight:600;text-align:center}.confirmation .confirmation-dialog .content .message{display:block;margin:10px auto;padding:20px;font-size:16px;font-weight:400;text-align:center}.confirmation .confirmation-dialog .footer{display:flex;align-items:center;justify-content:flex-end;margin:10px 0 0;padding:20px;width:100%}.confirmation .confirmation-dialog .footer .confirmation-button{display:inline-block;margin:0 5px;padding:10px 20px;border:none;border-radius:6px;font-size:14px;font-weight:600}\n"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "async": i1.AsyncPipe, "abpLocalization": i2.LocalizationPipe } });
|
|
328
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ConfirmationComponent, decorators: [{
|
|
329
|
+
type: Component,
|
|
330
|
+
args: [{ selector: 'abp-confirmation', template: "<div class=\"confirmation\" *ngIf=\"confirmation$ | async as data\">\r\n <div\r\n class=\"confirmation-backdrop\"\r\n (click)=\"data.options?.dismissible ? close(dismiss) : null\"\r\n ></div>\r\n <div class=\"confirmation-dialog\">\r\n <div class=\"icon-container\" [ngClass]=\"data.severity\" *ngIf=\"data.severity\">\r\n <i class=\"fa icon\" [ngClass]=\"getIconClass(data)\"></i>\r\n </div>\r\n <div class=\"content\">\r\n <h1\r\n class=\"title\"\r\n *ngIf=\"data.title\"\r\n [innerHTML]=\"data.title | abpLocalization: data.options?.titleLocalizationParams\"\r\n ></h1>\r\n <p\r\n class=\"message\"\r\n *ngIf=\"data.message\"\r\n [innerHTML]=\"data.message | abpLocalization: data.options?.messageLocalizationParams\"\r\n ></p>\r\n </div>\r\n <div class=\"footer\">\r\n <button\r\n id=\"cancel\"\r\n class=\"confirmation-button confirmation-button--reject\"\r\n [innerHTML]=\"data.options?.cancelText || 'AbpUi::Cancel' | abpLocalization\"\r\n *ngIf=\"!data?.options?.hideCancelBtn\"\r\n (click)=\"close(reject)\"\r\n ></button>\r\n <button\r\n id=\"confirm\"\r\n class=\"confirmation-button confirmation-button--approve\"\r\n [innerHTML]=\"data.options?.yesText || 'AbpUi::Yes' | abpLocalization\"\r\n *ngIf=\"!data?.options?.hideYesBtn\"\r\n (click)=\"close(confirm)\"\r\n ></button>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".confirmation{position:fixed;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;z-index:1060}.confirmation .confirmation-backdrop{position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:1061!important}.confirmation .confirmation-dialog{display:flex;flex-direction:column;margin:20px auto;padding:0;width:450px;min-height:300px;z-index:1062!important}@media screen and (max-width: 500px){.confirmation .confirmation-dialog{width:90vw}}.confirmation .confirmation-dialog .icon-container{display:flex;align-items:center;justify-content:center;margin:0 0 10px;padding:20px}.confirmation .confirmation-dialog .icon-container .icon{width:100px;height:100px;stroke-width:1;font-size:80px;text-align:center}.confirmation .confirmation-dialog .content{flex-grow:1;display:block}.confirmation .confirmation-dialog .content .title{display:block;margin:0;padding:0;font-size:27px;font-weight:600;text-align:center}.confirmation .confirmation-dialog .content .message{display:block;margin:10px auto;padding:20px;font-size:16px;font-weight:400;text-align:center}.confirmation .confirmation-dialog .footer{display:flex;align-items:center;justify-content:flex-end;margin:10px 0 0;padding:20px;width:100%}.confirmation .confirmation-dialog .footer .confirmation-button{display:inline-block;margin:0 5px;padding:10px 20px;border:none;border-radius:6px;font-size:14px;font-weight:600}\n"] }]
|
|
331
|
+
}] });
|
|
332
|
+
|
|
333
|
+
class HttpErrorWrapperComponent {
|
|
334
|
+
constructor(subscription) {
|
|
335
|
+
this.subscription = subscription;
|
|
336
|
+
this.status = 0;
|
|
337
|
+
this.title = 'Oops!';
|
|
338
|
+
this.details = 'Sorry, an error has occured.';
|
|
339
|
+
this.customComponent = undefined;
|
|
340
|
+
this.hideCloseIcon = false;
|
|
341
|
+
this.isHomeShow = true;
|
|
342
|
+
}
|
|
343
|
+
get statusText() {
|
|
344
|
+
return this.status ? `[${this.status}]` : '';
|
|
345
|
+
}
|
|
346
|
+
ngOnInit() {
|
|
347
|
+
this.backgroundColor =
|
|
348
|
+
window.getComputedStyle(document.body)?.getPropertyValue('background-color') || '#fff';
|
|
349
|
+
}
|
|
350
|
+
ngAfterViewInit() {
|
|
351
|
+
if (this.customComponent) {
|
|
352
|
+
const customComponentRef = this.cfRes
|
|
353
|
+
.resolveComponentFactory(this.customComponent)
|
|
354
|
+
.create(this.injector);
|
|
355
|
+
customComponentRef.instance.errorStatus = this.status;
|
|
356
|
+
customComponentRef.instance.destroy$ = this.destroy$;
|
|
357
|
+
this.appRef.attachView(customComponentRef.hostView);
|
|
358
|
+
if (this.containerRef) {
|
|
359
|
+
this.containerRef.nativeElement.appendChild(customComponentRef.hostView.rootNodes[0]);
|
|
360
|
+
}
|
|
361
|
+
customComponentRef.changeDetectorRef.detectChanges();
|
|
362
|
+
}
|
|
363
|
+
const keyup$ = fromEvent(document, 'keyup').pipe(debounceTime(150), filter((key) => key && key.key === 'Escape'));
|
|
364
|
+
this.subscription.addOne(keyup$, () => this.destroy());
|
|
365
|
+
}
|
|
366
|
+
ngOnDestroy() {
|
|
367
|
+
this.destroy();
|
|
368
|
+
}
|
|
369
|
+
destroy() {
|
|
370
|
+
this.destroy$.next();
|
|
371
|
+
this.destroy$.complete();
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
HttpErrorWrapperComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: HttpErrorWrapperComponent, deps: [{ token: i2.SubscriptionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
375
|
+
HttpErrorWrapperComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: HttpErrorWrapperComponent, selector: "abp-http-error-wrapper", providers: [SubscriptionService], viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["container"], descendants: true }], ngImport: i0, template: "<div\r\n #container\r\n id=\"abp-http-error-container\"\r\n class=\"error\"\r\n [style.backgroundColor]=\"backgroundColor\"\r\n>\r\n <button\r\n *ngIf=\"!hideCloseIcon\"\r\n id=\"abp-close-button\"\r\n type=\"button\"\r\n class=\"btn-close me-2\"\r\n (click)=\"destroy()\"\r\n ></button>\r\n\r\n <div *ngIf=\"!customComponent\" class=\"row centered\">\r\n <div class=\"col-md-12\">\r\n <div class=\"error-template\">\r\n <h1>{{ statusText }} {{ title | abpLocalization }}</h1>\r\n <div class=\"error-details\">\r\n {{ details | abpLocalization }}\r\n </div>\r\n <div class=\"error-actions\">\r\n <a\r\n *ngIf=\"isHomeShow\"\r\n (click)=\"destroy()\"\r\n routerLink=\"/\"\r\n class=\"btn btn-primary btn-md mt-2\"\r\n ><span class=\"glyphicon glyphicon-home\"></span>\r\n {{ { key: '::Menu:Home', defaultValue: 'Home' } | abpLocalization }}\r\n </a>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".error{position:fixed;top:0;width:100vw;height:100vh;z-index:999999}.centered{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}\n"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.RouterLinkWithHref, selector: "a[routerLink],area[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "preserveFragment", "skipLocationChange", "replaceUrl", "state", "relativeTo", "routerLink"] }], pipes: { "abpLocalization": i2.LocalizationPipe } });
|
|
376
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: HttpErrorWrapperComponent, decorators: [{
|
|
377
|
+
type: Component,
|
|
378
|
+
args: [{ selector: 'abp-http-error-wrapper', providers: [SubscriptionService], template: "<div\r\n #container\r\n id=\"abp-http-error-container\"\r\n class=\"error\"\r\n [style.backgroundColor]=\"backgroundColor\"\r\n>\r\n <button\r\n *ngIf=\"!hideCloseIcon\"\r\n id=\"abp-close-button\"\r\n type=\"button\"\r\n class=\"btn-close me-2\"\r\n (click)=\"destroy()\"\r\n ></button>\r\n\r\n <div *ngIf=\"!customComponent\" class=\"row centered\">\r\n <div class=\"col-md-12\">\r\n <div class=\"error-template\">\r\n <h1>{{ statusText }} {{ title | abpLocalization }}</h1>\r\n <div class=\"error-details\">\r\n {{ details | abpLocalization }}\r\n </div>\r\n <div class=\"error-actions\">\r\n <a\r\n *ngIf=\"isHomeShow\"\r\n (click)=\"destroy()\"\r\n routerLink=\"/\"\r\n class=\"btn btn-primary btn-md mt-2\"\r\n ><span class=\"glyphicon glyphicon-home\"></span>\r\n {{ { key: '::Menu:Home', defaultValue: 'Home' } | abpLocalization }}\r\n </a>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n", styles: [".error{position:fixed;top:0;width:100vw;height:100vh;z-index:999999}.centered{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%)}\n"] }]
|
|
379
|
+
}], ctorParameters: function () { return [{ type: i2.SubscriptionService }]; }, propDecorators: { containerRef: [{
|
|
380
|
+
type: ViewChild,
|
|
381
|
+
args: ['container', { static: false }]
|
|
382
|
+
}] } });
|
|
383
|
+
|
|
384
|
+
class LoaderBarComponent {
|
|
385
|
+
constructor(router, cdRef, subscription, httpWaitService, routerWaitService) {
|
|
386
|
+
this.router = router;
|
|
387
|
+
this.cdRef = cdRef;
|
|
388
|
+
this.subscription = subscription;
|
|
389
|
+
this.httpWaitService = httpWaitService;
|
|
390
|
+
this.routerWaitService = routerWaitService;
|
|
391
|
+
this.containerClass = 'abp-loader-bar';
|
|
392
|
+
this.color = '#77b6ff';
|
|
393
|
+
this.progressLevel = 0;
|
|
394
|
+
this.interval = new Subscription();
|
|
395
|
+
this.timer = new Subscription();
|
|
396
|
+
this.intervalPeriod = 350;
|
|
397
|
+
this.stopDelay = 800;
|
|
398
|
+
this.clearProgress = () => {
|
|
399
|
+
this.progressLevel = 0;
|
|
400
|
+
this.cdRef.detectChanges();
|
|
401
|
+
};
|
|
402
|
+
this.reportProgress = () => {
|
|
403
|
+
if (this.progressLevel < 75) {
|
|
404
|
+
this.progressLevel += 1 + Math.random() * 9;
|
|
405
|
+
}
|
|
406
|
+
else if (this.progressLevel < 90) {
|
|
407
|
+
this.progressLevel += 0.4;
|
|
408
|
+
}
|
|
409
|
+
else if (this.progressLevel < 100) {
|
|
410
|
+
this.progressLevel += 0.1;
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
this.interval.unsubscribe();
|
|
414
|
+
}
|
|
415
|
+
this.cdRef.detectChanges();
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
set isLoading(value) {
|
|
419
|
+
this._isLoading = value;
|
|
420
|
+
this.cdRef.detectChanges();
|
|
421
|
+
}
|
|
422
|
+
get isLoading() {
|
|
423
|
+
return this._isLoading;
|
|
424
|
+
}
|
|
425
|
+
get boxShadow() {
|
|
426
|
+
return `0 0 10px rgba(${this.color}, 0.5)`;
|
|
427
|
+
}
|
|
428
|
+
ngOnInit() {
|
|
429
|
+
this.subscribeLoading();
|
|
430
|
+
}
|
|
431
|
+
subscribeLoading() {
|
|
432
|
+
this.subscription.addOne(combineLatest([this.httpWaitService.getLoading$(), this.routerWaitService.getLoading$()]), ([httpLoading, routerLoading]) => {
|
|
433
|
+
if (httpLoading || routerLoading)
|
|
434
|
+
this.startLoading();
|
|
435
|
+
else
|
|
436
|
+
this.stopLoading();
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
ngOnDestroy() {
|
|
440
|
+
this.interval.unsubscribe();
|
|
441
|
+
}
|
|
442
|
+
startLoading() {
|
|
443
|
+
if (this.isLoading || !this.interval.closed)
|
|
444
|
+
return;
|
|
445
|
+
this.isLoading = true;
|
|
446
|
+
this.progressLevel = 0;
|
|
447
|
+
this.cdRef.detectChanges();
|
|
448
|
+
this.interval = timer(0, this.intervalPeriod).subscribe(this.reportProgress);
|
|
449
|
+
this.timer.unsubscribe();
|
|
450
|
+
}
|
|
451
|
+
stopLoading() {
|
|
452
|
+
this.interval.unsubscribe();
|
|
453
|
+
this.progressLevel = 100;
|
|
454
|
+
this.isLoading = false;
|
|
455
|
+
if (!this.timer.closed)
|
|
456
|
+
return;
|
|
457
|
+
this.timer = timer(this.stopDelay).subscribe(this.clearProgress);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
LoaderBarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: LoaderBarComponent, deps: [{ token: i1$1.Router }, { token: i0.ChangeDetectorRef }, { token: i2.SubscriptionService }, { token: i2.HttpWaitService }, { token: i2.RouterWaitService }], target: i0.ɵɵFactoryTarget.Component });
|
|
461
|
+
LoaderBarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: LoaderBarComponent, selector: "abp-loader-bar", inputs: { isLoading: "isLoading", containerClass: "containerClass", color: "color" }, providers: [SubscriptionService], ngImport: i0, template: `
|
|
462
|
+
<div id="abp-loader-bar" [ngClass]="containerClass" [class.is-loading]="isLoading">
|
|
463
|
+
<div
|
|
464
|
+
class="abp-progress"
|
|
465
|
+
[class.progressing]="progressLevel"
|
|
466
|
+
[style.width.vw]="progressLevel"
|
|
467
|
+
[ngStyle]="{
|
|
468
|
+
'background-color': color,
|
|
469
|
+
'box-shadow': boxShadow
|
|
470
|
+
}"
|
|
471
|
+
></div>
|
|
472
|
+
</div>
|
|
473
|
+
`, isInline: true, styles: [".abp-loader-bar{left:0;opacity:0;position:fixed;top:0;transition:opacity .4s linear .4s;z-index:99999}.abp-loader-bar.is-loading{opacity:1;transition:none}.abp-loader-bar .abp-progress{height:3px;left:0;position:fixed;top:0}.abp-loader-bar .abp-progress.progressing{transition:width .4s ease}\n"], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
|
|
474
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: LoaderBarComponent, decorators: [{
|
|
475
|
+
type: Component,
|
|
476
|
+
args: [{ selector: 'abp-loader-bar', template: `
|
|
477
|
+
<div id="abp-loader-bar" [ngClass]="containerClass" [class.is-loading]="isLoading">
|
|
478
|
+
<div
|
|
479
|
+
class="abp-progress"
|
|
480
|
+
[class.progressing]="progressLevel"
|
|
481
|
+
[style.width.vw]="progressLevel"
|
|
482
|
+
[ngStyle]="{
|
|
483
|
+
'background-color': color,
|
|
484
|
+
'box-shadow': boxShadow
|
|
485
|
+
}"
|
|
486
|
+
></div>
|
|
487
|
+
</div>
|
|
488
|
+
`, providers: [SubscriptionService], styles: [".abp-loader-bar{left:0;opacity:0;position:fixed;top:0;transition:opacity .4s linear .4s;z-index:99999}.abp-loader-bar.is-loading{opacity:1;transition:none}.abp-loader-bar .abp-progress{height:3px;left:0;position:fixed;top:0}.abp-loader-bar .abp-progress.progressing{transition:width .4s ease}\n"] }]
|
|
489
|
+
}], ctorParameters: function () { return [{ type: i1$1.Router }, { type: i0.ChangeDetectorRef }, { type: i2.SubscriptionService }, { type: i2.HttpWaitService }, { type: i2.RouterWaitService }]; }, propDecorators: { isLoading: [{
|
|
490
|
+
type: Input
|
|
491
|
+
}], containerClass: [{
|
|
492
|
+
type: Input
|
|
493
|
+
}], color: [{
|
|
494
|
+
type: Input
|
|
495
|
+
}] } });
|
|
496
|
+
|
|
497
|
+
class LoadingComponent {
|
|
498
|
+
}
|
|
499
|
+
LoadingComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: LoadingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
500
|
+
LoadingComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: LoadingComponent, selector: "abp-loading", ngImport: i0, template: `
|
|
501
|
+
<div class="abp-loading">
|
|
502
|
+
<i class="fa fa-spinner fa-pulse abp-spinner"></i>
|
|
503
|
+
</div>
|
|
504
|
+
`, isInline: true, styles: [".abp-loading{position:absolute;width:100%;height:100%;top:0;left:0;z-index:1040}.abp-loading .abp-spinner{position:absolute;top:50%;left:50%;font-size:14px;transform:translate(-50%) translateY(-50%)}\n"], encapsulation: i0.ViewEncapsulation.None });
|
|
505
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: LoadingComponent, decorators: [{
|
|
506
|
+
type: Component,
|
|
507
|
+
args: [{
|
|
508
|
+
selector: 'abp-loading',
|
|
509
|
+
template: `
|
|
510
|
+
<div class="abp-loading">
|
|
511
|
+
<i class="fa fa-spinner fa-pulse abp-spinner"></i>
|
|
512
|
+
</div>
|
|
513
|
+
`,
|
|
514
|
+
encapsulation: ViewEncapsulation.None,
|
|
515
|
+
styles: [
|
|
516
|
+
`
|
|
517
|
+
.abp-loading {
|
|
518
|
+
position: absolute;
|
|
519
|
+
width: 100%;
|
|
520
|
+
height: 100%;
|
|
521
|
+
top: 0;
|
|
522
|
+
left: 0;
|
|
523
|
+
z-index: 1040;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.abp-loading .abp-spinner {
|
|
527
|
+
position: absolute;
|
|
528
|
+
top: 50%;
|
|
529
|
+
left: 50%;
|
|
530
|
+
font-size: 14px;
|
|
531
|
+
-moz-transform: translateX(-50%) translateY(-50%);
|
|
532
|
+
-o-transform: translateX(-50%) translateY(-50%);
|
|
533
|
+
-ms-transform: translateX(-50%) translateY(-50%);
|
|
534
|
+
-webkit-transform: translateX(-50%) translateY(-50%);
|
|
535
|
+
transform: translateX(-50%) translateY(-50%);
|
|
536
|
+
}
|
|
537
|
+
`,
|
|
538
|
+
],
|
|
539
|
+
}]
|
|
540
|
+
}] });
|
|
541
|
+
|
|
542
|
+
class ConfirmationService {
|
|
543
|
+
constructor(contentProjectionService) {
|
|
544
|
+
this.contentProjectionService = contentProjectionService;
|
|
545
|
+
this.confirmation$ = new ReplaySubject(1);
|
|
546
|
+
this.clear = (status = Confirmation.Status.dismiss) => {
|
|
547
|
+
this.confirmation$.next();
|
|
548
|
+
this.status$.next(status);
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
setContainer() {
|
|
552
|
+
this.containerComponentRef = this.contentProjectionService.projectContent(PROJECTION_STRATEGY.AppendComponentToBody(ConfirmationComponent, {
|
|
553
|
+
confirmation$: this.confirmation$,
|
|
554
|
+
clear: this.clear,
|
|
555
|
+
}));
|
|
556
|
+
setTimeout(() => {
|
|
557
|
+
this.containerComponentRef.changeDetectorRef.detectChanges();
|
|
558
|
+
}, 0);
|
|
559
|
+
}
|
|
560
|
+
info(message, title, options) {
|
|
561
|
+
return this.show(message, title, 'info', options);
|
|
562
|
+
}
|
|
563
|
+
success(message, title, options) {
|
|
564
|
+
return this.show(message, title, 'success', options);
|
|
565
|
+
}
|
|
566
|
+
warn(message, title, options) {
|
|
567
|
+
return this.show(message, title, 'warning', options);
|
|
568
|
+
}
|
|
569
|
+
error(message, title, options) {
|
|
570
|
+
return this.show(message, title, 'error', options);
|
|
571
|
+
}
|
|
572
|
+
show(message, title, severity, options = {}) {
|
|
573
|
+
if (!this.containerComponentRef)
|
|
574
|
+
this.setContainer();
|
|
575
|
+
this.confirmation$.next({
|
|
576
|
+
message,
|
|
577
|
+
title,
|
|
578
|
+
severity: severity || 'neutral',
|
|
579
|
+
options,
|
|
580
|
+
});
|
|
581
|
+
this.status$ = new Subject();
|
|
582
|
+
const { dismissible = true } = options;
|
|
583
|
+
if (dismissible)
|
|
584
|
+
this.listenToEscape();
|
|
585
|
+
return this.status$;
|
|
586
|
+
}
|
|
587
|
+
listenToEscape() {
|
|
588
|
+
fromEvent(document, 'keyup')
|
|
589
|
+
.pipe(takeUntil(this.status$), debounceTime(150), filter((key) => key && key.key === 'Escape'))
|
|
590
|
+
.subscribe(_ => {
|
|
591
|
+
this.clear();
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
ConfirmationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ConfirmationService, deps: [{ token: i2.ContentProjectionService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
596
|
+
ConfirmationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ConfirmationService, providedIn: 'root' });
|
|
597
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ConfirmationService, decorators: [{
|
|
598
|
+
type: Injectable,
|
|
599
|
+
args: [{ providedIn: 'root' }]
|
|
600
|
+
}], ctorParameters: function () { return [{ type: i2.ContentProjectionService }]; } });
|
|
601
|
+
|
|
602
|
+
const SUPPRESS_UNSAVED_CHANGES_WARNING = new InjectionToken('SUPPRESS_UNSAVED_CHANGES_WARNING');
|
|
603
|
+
|
|
604
|
+
class ModalRefService {
|
|
605
|
+
constructor() {
|
|
606
|
+
this.modalRefs = [];
|
|
607
|
+
}
|
|
608
|
+
register(modal) {
|
|
609
|
+
this.modalRefs.push(modal);
|
|
610
|
+
}
|
|
611
|
+
unregister(modal) {
|
|
612
|
+
const index = this.modalRefs.indexOf(modal);
|
|
613
|
+
if (index > -1) {
|
|
614
|
+
this.modalRefs.splice(index, 1);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
dismissAll(mode) {
|
|
618
|
+
this.modalRefs.forEach(modal => modal.dismiss(mode));
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
ModalRefService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ModalRefService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
622
|
+
ModalRefService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ModalRefService, providedIn: 'root' });
|
|
623
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ModalRefService, decorators: [{
|
|
624
|
+
type: Injectable,
|
|
625
|
+
args: [{ providedIn: 'root' }]
|
|
626
|
+
}] });
|
|
627
|
+
|
|
628
|
+
class ModalComponent {
|
|
629
|
+
constructor(confirmationService, subscription, suppressUnsavedChangesWarningToken, modal, modalRefService) {
|
|
630
|
+
this.confirmationService = confirmationService;
|
|
631
|
+
this.subscription = subscription;
|
|
632
|
+
this.suppressUnsavedChangesWarningToken = suppressUnsavedChangesWarningToken;
|
|
633
|
+
this.modal = modal;
|
|
634
|
+
this.modalRefService = modalRefService;
|
|
635
|
+
this.options = {};
|
|
636
|
+
this.suppressUnsavedChangesWarning = this.suppressUnsavedChangesWarningToken;
|
|
637
|
+
this.visibleChange = new EventEmitter();
|
|
638
|
+
this.init = new EventEmitter();
|
|
639
|
+
this.appear = new EventEmitter();
|
|
640
|
+
this.disappear = new EventEmitter();
|
|
641
|
+
this._visible = false;
|
|
642
|
+
this._busy = false;
|
|
643
|
+
this.isConfirmationOpen = false;
|
|
644
|
+
this.destroy$ = new Subject();
|
|
645
|
+
this.modalIdentifier = `modal-${uuid()}`;
|
|
646
|
+
this.toggle$ = new Subject();
|
|
647
|
+
this.initToggleStream();
|
|
648
|
+
}
|
|
649
|
+
get visible() {
|
|
650
|
+
return this._visible;
|
|
651
|
+
}
|
|
652
|
+
set visible(value) {
|
|
653
|
+
if (typeof value !== 'boolean')
|
|
654
|
+
return;
|
|
655
|
+
this.toggle$.next(value);
|
|
656
|
+
}
|
|
657
|
+
get busy() {
|
|
658
|
+
return this._busy;
|
|
659
|
+
}
|
|
660
|
+
set busy(value) {
|
|
661
|
+
if (this.abpSubmit && this.abpSubmit instanceof ButtonComponent) {
|
|
662
|
+
this.abpSubmit.loading = value;
|
|
663
|
+
}
|
|
664
|
+
this._busy = value;
|
|
665
|
+
}
|
|
666
|
+
get modalWindowRef() {
|
|
667
|
+
return document.querySelector(`ngb-modal-window.${this.modalIdentifier}`);
|
|
668
|
+
}
|
|
669
|
+
get isFormDirty() {
|
|
670
|
+
return Boolean(this.modalWindowRef?.querySelector('.ng-dirty'));
|
|
671
|
+
}
|
|
672
|
+
ngOnInit() {
|
|
673
|
+
this.modalRefService.register(this);
|
|
674
|
+
}
|
|
675
|
+
dismiss(mode) {
|
|
676
|
+
switch (mode) {
|
|
677
|
+
case 'hard':
|
|
678
|
+
this.visible = false;
|
|
679
|
+
break;
|
|
680
|
+
case 'soft':
|
|
681
|
+
this.close();
|
|
682
|
+
break;
|
|
683
|
+
default:
|
|
684
|
+
break;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
initToggleStream() {
|
|
688
|
+
this.subscription.addOne(this.toggle$.pipe(debounceTime(0), distinctUntilChanged()), value => this.toggle(value));
|
|
689
|
+
}
|
|
690
|
+
toggle(value) {
|
|
691
|
+
this._visible = value;
|
|
692
|
+
this.visibleChange.emit(value);
|
|
693
|
+
if (!value) {
|
|
694
|
+
this.modalRef?.dismiss();
|
|
695
|
+
this.disappear.emit();
|
|
696
|
+
this.destroy$.next();
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
setTimeout(() => this.listen(), 0);
|
|
700
|
+
this.modalRef = this.modal.open(this.modalContent, {
|
|
701
|
+
size: 'md',
|
|
702
|
+
centered: false,
|
|
703
|
+
keyboard: false,
|
|
704
|
+
scrollable: true,
|
|
705
|
+
beforeDismiss: () => {
|
|
706
|
+
if (!this.visible)
|
|
707
|
+
return true;
|
|
708
|
+
this.close();
|
|
709
|
+
return !this.visible;
|
|
710
|
+
},
|
|
711
|
+
...this.options,
|
|
712
|
+
windowClass: `${this.options.windowClass || ''} ${this.modalIdentifier}`,
|
|
713
|
+
});
|
|
714
|
+
this.appear.emit();
|
|
715
|
+
}
|
|
716
|
+
ngOnDestroy() {
|
|
717
|
+
this.modalRefService.unregister(this);
|
|
718
|
+
this.toggle(false);
|
|
719
|
+
this.destroy$.next();
|
|
720
|
+
}
|
|
721
|
+
close() {
|
|
722
|
+
if (this.busy)
|
|
723
|
+
return;
|
|
724
|
+
if (this.isFormDirty && !this.suppressUnsavedChangesWarning) {
|
|
725
|
+
if (this.isConfirmationOpen)
|
|
726
|
+
return;
|
|
727
|
+
this.isConfirmationOpen = true;
|
|
728
|
+
this.confirmationService
|
|
729
|
+
.warn('AbpUi::AreYouSureYouWantToCancelEditingWarningMessage', 'AbpUi::AreYouSure', { dismissible: false })
|
|
730
|
+
.subscribe((status) => {
|
|
731
|
+
this.isConfirmationOpen = false;
|
|
732
|
+
if (status === Confirmation.Status.confirm) {
|
|
733
|
+
this.visible = false;
|
|
734
|
+
}
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
else {
|
|
738
|
+
this.visible = false;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
listen() {
|
|
742
|
+
if (this.modalWindowRef) {
|
|
743
|
+
fromEvent(this.modalWindowRef, 'keyup')
|
|
744
|
+
.pipe(takeUntil(this.destroy$), debounceTime(150), filter((key) => key && key.key === 'Escape'))
|
|
745
|
+
.subscribe(() => this.close());
|
|
746
|
+
}
|
|
747
|
+
fromEvent(window, 'beforeunload')
|
|
748
|
+
.pipe(takeUntil(this.destroy$))
|
|
749
|
+
.subscribe(event => {
|
|
750
|
+
// TODO: check this
|
|
751
|
+
if (!this.isFormDirty || this.suppressUnsavedChangesWarning) {
|
|
752
|
+
event.preventDefault();
|
|
753
|
+
}
|
|
754
|
+
});
|
|
755
|
+
this.init.emit();
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
ModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ModalComponent, deps: [{ token: ConfirmationService }, { token: i2.SubscriptionService }, { token: SUPPRESS_UNSAVED_CHANGES_WARNING, optional: true }, { token: i3.NgbModal }, { token: ModalRefService }], target: i0.ɵɵFactoryTarget.Component });
|
|
759
|
+
ModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: ModalComponent, selector: "abp-modal", inputs: { visible: "visible", busy: "busy", options: "options", suppressUnsavedChangesWarning: "suppressUnsavedChangesWarning" }, outputs: { visibleChange: "visibleChange", init: "init", appear: "appear", disappear: "disappear" }, providers: [SubscriptionService], queries: [{ propertyName: "abpHeader", first: true, predicate: ["abpHeader"], descendants: true }, { propertyName: "abpBody", first: true, predicate: ["abpBody"], descendants: true }, { propertyName: "abpFooter", first: true, predicate: ["abpFooter"], descendants: true }, { propertyName: "abpSubmit", first: true, predicate: ButtonComponent, descendants: true, read: ButtonComponent }], viewQueries: [{ propertyName: "modalContent", first: true, predicate: ["modalContent"], descendants: true }], ngImport: i0, template: "<ng-content></ng-content>\r\n\r\n<ng-template #modalContent let-modal>\r\n <div *ngIf=\"abpHeader\" id=\"abp-modal-header\" class=\"modal-header\">\r\n <ng-container *ngTemplateOutlet=\"abpHeader\"></ng-container>\r\n \u200B\r\n <button\r\n id=\"abp-modal-close-button\"\r\n type=\"button\"\r\n class=\"btn-sm btn-close\"\r\n aria-label=\"Close\"\r\n (click)=\"modal.dismiss()\"\r\n ></button>\r\n </div>\r\n <div *ngIf=\"abpBody\" id=\"abp-modal-body\" class=\"modal-body\">\r\n <ng-container *ngTemplateOutlet=\"abpBody\"></ng-container>\r\n </div>\r\n <div *ngIf=\"abpFooter\" id=\"abp-modal-footer\" class=\"modal-footer\">\r\n <ng-container *ngTemplateOutlet=\"abpFooter\"></ng-container>\r\n </div>\r\n</ng-template>\r\n", styles: [".modal.show{display:block!important}.modal-backdrop{opacity:.8}.modal::-webkit-scrollbar{width:7px}.modal::-webkit-scrollbar-track{background:#ddd}.modal::-webkit-scrollbar-thumb{background:#8a8686}.modal-dialog{z-index:1050}\n"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
|
|
760
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ModalComponent, decorators: [{
|
|
761
|
+
type: Component,
|
|
762
|
+
args: [{ selector: 'abp-modal', providers: [SubscriptionService], template: "<ng-content></ng-content>\r\n\r\n<ng-template #modalContent let-modal>\r\n <div *ngIf=\"abpHeader\" id=\"abp-modal-header\" class=\"modal-header\">\r\n <ng-container *ngTemplateOutlet=\"abpHeader\"></ng-container>\r\n \u200B\r\n <button\r\n id=\"abp-modal-close-button\"\r\n type=\"button\"\r\n class=\"btn-sm btn-close\"\r\n aria-label=\"Close\"\r\n (click)=\"modal.dismiss()\"\r\n ></button>\r\n </div>\r\n <div *ngIf=\"abpBody\" id=\"abp-modal-body\" class=\"modal-body\">\r\n <ng-container *ngTemplateOutlet=\"abpBody\"></ng-container>\r\n </div>\r\n <div *ngIf=\"abpFooter\" id=\"abp-modal-footer\" class=\"modal-footer\">\r\n <ng-container *ngTemplateOutlet=\"abpFooter\"></ng-container>\r\n </div>\r\n</ng-template>\r\n", styles: [".modal.show{display:block!important}.modal-backdrop{opacity:.8}.modal::-webkit-scrollbar{width:7px}.modal::-webkit-scrollbar-track{background:#ddd}.modal::-webkit-scrollbar-thumb{background:#8a8686}.modal-dialog{z-index:1050}\n"] }]
|
|
763
|
+
}], ctorParameters: function () { return [{ type: ConfirmationService }, { type: i2.SubscriptionService }, { type: undefined, decorators: [{
|
|
764
|
+
type: Optional
|
|
765
|
+
}, {
|
|
766
|
+
type: Inject,
|
|
767
|
+
args: [SUPPRESS_UNSAVED_CHANGES_WARNING]
|
|
768
|
+
}] }, { type: i3.NgbModal }, { type: ModalRefService }]; }, propDecorators: { visible: [{
|
|
769
|
+
type: Input
|
|
770
|
+
}], busy: [{
|
|
771
|
+
type: Input
|
|
772
|
+
}], options: [{
|
|
773
|
+
type: Input
|
|
774
|
+
}], suppressUnsavedChangesWarning: [{
|
|
775
|
+
type: Input
|
|
776
|
+
}], modalContent: [{
|
|
777
|
+
type: ViewChild,
|
|
778
|
+
args: ['modalContent']
|
|
779
|
+
}], abpHeader: [{
|
|
780
|
+
type: ContentChild,
|
|
781
|
+
args: ['abpHeader', { static: false }]
|
|
782
|
+
}], abpBody: [{
|
|
783
|
+
type: ContentChild,
|
|
784
|
+
args: ['abpBody', { static: false }]
|
|
785
|
+
}], abpFooter: [{
|
|
786
|
+
type: ContentChild,
|
|
787
|
+
args: ['abpFooter', { static: false }]
|
|
788
|
+
}], abpSubmit: [{
|
|
789
|
+
type: ContentChild,
|
|
790
|
+
args: [ButtonComponent, { static: false, read: ButtonComponent }]
|
|
791
|
+
}], visibleChange: [{
|
|
792
|
+
type: Output
|
|
793
|
+
}], init: [{
|
|
794
|
+
type: Output
|
|
795
|
+
}], appear: [{
|
|
796
|
+
type: Output
|
|
797
|
+
}], disappear: [{
|
|
798
|
+
type: Output
|
|
799
|
+
}] } });
|
|
800
|
+
|
|
801
|
+
class ModalCloseDirective {
|
|
802
|
+
constructor(modal) {
|
|
803
|
+
this.modal = modal;
|
|
804
|
+
if (!modal) {
|
|
805
|
+
console.error('Please use abpClose within an abp-modal');
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
onClick() {
|
|
809
|
+
this.modal?.close();
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
ModalCloseDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ModalCloseDirective, deps: [{ token: ModalComponent, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
813
|
+
ModalCloseDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.1", type: ModalCloseDirective, selector: "[abpClose]", host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
|
|
814
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ModalCloseDirective, decorators: [{
|
|
815
|
+
type: Directive,
|
|
816
|
+
args: [{ selector: '[abpClose]' }]
|
|
817
|
+
}], ctorParameters: function () { return [{ type: ModalComponent, decorators: [{
|
|
818
|
+
type: Optional
|
|
819
|
+
}] }]; }, propDecorators: { onClick: [{
|
|
820
|
+
type: HostListener,
|
|
821
|
+
args: ['click']
|
|
822
|
+
}] } });
|
|
823
|
+
|
|
824
|
+
class ToastComponent {
|
|
825
|
+
constructor() {
|
|
826
|
+
this.remove = new EventEmitter();
|
|
827
|
+
}
|
|
828
|
+
get severityClass() {
|
|
829
|
+
if (!this.toast || !this.toast.severity)
|
|
830
|
+
return '';
|
|
831
|
+
return `abp-toast-${this.toast.severity}`;
|
|
832
|
+
}
|
|
833
|
+
get iconClass() {
|
|
834
|
+
switch (this.toast.severity) {
|
|
835
|
+
case 'success':
|
|
836
|
+
return 'fa-check-circle';
|
|
837
|
+
case 'info':
|
|
838
|
+
return 'fa-info-circle';
|
|
839
|
+
case 'warning':
|
|
840
|
+
return 'fa-exclamation-triangle';
|
|
841
|
+
case 'error':
|
|
842
|
+
return 'fa-times-circle';
|
|
843
|
+
default:
|
|
844
|
+
return 'fa-exclamation-circle';
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
ngOnInit() {
|
|
848
|
+
const { sticky, life } = this.toast.options || {};
|
|
849
|
+
if (sticky)
|
|
850
|
+
return;
|
|
851
|
+
const timeout = life || 5000;
|
|
852
|
+
setTimeout(() => {
|
|
853
|
+
this.close();
|
|
854
|
+
}, timeout);
|
|
855
|
+
}
|
|
856
|
+
close() {
|
|
857
|
+
this.remove.emit(this.toast.options?.id);
|
|
858
|
+
}
|
|
859
|
+
tap() {
|
|
860
|
+
if (this.toast.options?.tapToDismiss)
|
|
861
|
+
this.close();
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
ToastComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ToastComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
865
|
+
ToastComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: ToastComponent, selector: "abp-toast", inputs: { toast: "toast" }, outputs: { remove: "remove" }, ngImport: i0, template: "<div class=\"abp-toast\" [ngClass]=\"severityClass\" (click)=\"tap()\">\r\n <div class=\"abp-toast-icon\">\r\n <i class=\"fa icon\" [ngClass]=\"iconClass\"></i>\r\n </div>\r\n <div class=\"abp-toast-content\">\r\n <button class=\"abp-toast-close-button\" (click)=\"close()\" *ngIf=\"toast.options?.closable\">\r\n <i class=\"fa fa-times\"></i>\r\n </button>\r\n <div class=\"abp-toast-title\">\r\n {{ toast.title | abpLocalization: toast.options?.titleLocalizationParams }}\r\n </div>\r\n <p\r\n class=\"abp-toast-message\"\r\n [innerHTML]=\"toast.message | abpLocalization: toast.options?.messageLocalizationParams\"\r\n ></p>\r\n </div>\r\n</div>\r\n", styles: [".abp-toast{display:grid;grid-template-columns:50px 1fr;grid-gap:10px;gap:10px;margin:5px 0;padding:10px;border-radius:0;width:350px;-webkit-user-select:none;user-select:none;z-index:9999;border:2px solid #f0f0f0;background-color:#f0f0f0;color:#000;box-shadow:0 0 10px -5px #0006;opacity:1}.abp-toast:hover{border:2px solid #e3e3e3;background-color:#e3e3e3;box-shadow:0 0 15px -5px #0006}.abp-toast.abp-toast-success{border:2px solid #51a351;background-color:#51a351;color:#fff;box-shadow:0 0 10px -5px #0006}.abp-toast.abp-toast-success:hover{border:2px solid #499249;background-color:#499249;box-shadow:0 0 15px -5px #0006}.abp-toast.abp-toast-info{border:2px solid #2f96b4;background-color:#2f96b4;color:#fff;box-shadow:0 0 10px -5px #0006}.abp-toast.abp-toast-info:hover{border:2px solid #2a85a0;background-color:#2a85a0;box-shadow:0 0 15px -5px #0006}.abp-toast.abp-toast-warning{border:2px solid #f89406;background-color:#f89406;color:#fff;box-shadow:0 0 10px -5px #0006}.abp-toast.abp-toast-warning:hover{border:2px solid #df8505;background-color:#df8505;box-shadow:0 0 15px -5px #0006}.abp-toast.abp-toast-error{border:2px solid #bd362f;background-color:#bd362f;color:#fff;box-shadow:0 0 10px -5px #0006}.abp-toast.abp-toast-error:hover{border:2px solid #a9302a;background-color:#a9302a;box-shadow:0 0 15px -5px #0006}.abp-toast .abp-toast-icon{display:flex;align-items:center;justify-content:center}.abp-toast .abp-toast-icon .icon{font-size:36px}.abp-toast .abp-toast-content{position:relative}.abp-toast .abp-toast-content .abp-toast-close-button{position:absolute;top:0;right:0;display:flex;align-items:center;justify-content:center;margin:0;padding:0 5px 0 0;width:25px;height:25px;border:none;border-radius:50%;background:transparent;color:inherit}.abp-toast .abp-toast-content .abp-toast-close-button:focus{outline:none}.abp-toast .abp-toast-content .abp-toast-title{margin:0;padding:0;font-size:1rem;font-weight:600}.abp-toast .abp-toast-content .abp-toast-message{margin:0;padding:0;max-width:240px}\n"], directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], pipes: { "abpLocalization": i2.LocalizationPipe } });
|
|
866
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ToastComponent, decorators: [{
|
|
867
|
+
type: Component,
|
|
868
|
+
args: [{ selector: 'abp-toast', template: "<div class=\"abp-toast\" [ngClass]=\"severityClass\" (click)=\"tap()\">\r\n <div class=\"abp-toast-icon\">\r\n <i class=\"fa icon\" [ngClass]=\"iconClass\"></i>\r\n </div>\r\n <div class=\"abp-toast-content\">\r\n <button class=\"abp-toast-close-button\" (click)=\"close()\" *ngIf=\"toast.options?.closable\">\r\n <i class=\"fa fa-times\"></i>\r\n </button>\r\n <div class=\"abp-toast-title\">\r\n {{ toast.title | abpLocalization: toast.options?.titleLocalizationParams }}\r\n </div>\r\n <p\r\n class=\"abp-toast-message\"\r\n [innerHTML]=\"toast.message | abpLocalization: toast.options?.messageLocalizationParams\"\r\n ></p>\r\n </div>\r\n</div>\r\n", styles: [".abp-toast{display:grid;grid-template-columns:50px 1fr;grid-gap:10px;gap:10px;margin:5px 0;padding:10px;border-radius:0;width:350px;-webkit-user-select:none;user-select:none;z-index:9999;border:2px solid #f0f0f0;background-color:#f0f0f0;color:#000;box-shadow:0 0 10px -5px #0006;opacity:1}.abp-toast:hover{border:2px solid #e3e3e3;background-color:#e3e3e3;box-shadow:0 0 15px -5px #0006}.abp-toast.abp-toast-success{border:2px solid #51a351;background-color:#51a351;color:#fff;box-shadow:0 0 10px -5px #0006}.abp-toast.abp-toast-success:hover{border:2px solid #499249;background-color:#499249;box-shadow:0 0 15px -5px #0006}.abp-toast.abp-toast-info{border:2px solid #2f96b4;background-color:#2f96b4;color:#fff;box-shadow:0 0 10px -5px #0006}.abp-toast.abp-toast-info:hover{border:2px solid #2a85a0;background-color:#2a85a0;box-shadow:0 0 15px -5px #0006}.abp-toast.abp-toast-warning{border:2px solid #f89406;background-color:#f89406;color:#fff;box-shadow:0 0 10px -5px #0006}.abp-toast.abp-toast-warning:hover{border:2px solid #df8505;background-color:#df8505;box-shadow:0 0 15px -5px #0006}.abp-toast.abp-toast-error{border:2px solid #bd362f;background-color:#bd362f;color:#fff;box-shadow:0 0 10px -5px #0006}.abp-toast.abp-toast-error:hover{border:2px solid #a9302a;background-color:#a9302a;box-shadow:0 0 15px -5px #0006}.abp-toast .abp-toast-icon{display:flex;align-items:center;justify-content:center}.abp-toast .abp-toast-icon .icon{font-size:36px}.abp-toast .abp-toast-content{position:relative}.abp-toast .abp-toast-content .abp-toast-close-button{position:absolute;top:0;right:0;display:flex;align-items:center;justify-content:center;margin:0;padding:0 5px 0 0;width:25px;height:25px;border:none;border-radius:50%;background:transparent;color:inherit}.abp-toast .abp-toast-content .abp-toast-close-button:focus{outline:none}.abp-toast .abp-toast-content .abp-toast-title{margin:0;padding:0;font-size:1rem;font-weight:600}.abp-toast .abp-toast-content .abp-toast-message{margin:0;padding:0;max-width:240px}\n"] }]
|
|
869
|
+
}], propDecorators: { toast: [{
|
|
870
|
+
type: Input
|
|
871
|
+
}], remove: [{
|
|
872
|
+
type: Output
|
|
873
|
+
}] } });
|
|
874
|
+
|
|
875
|
+
class ToastContainerComponent {
|
|
876
|
+
constructor() {
|
|
877
|
+
this.toasts = [];
|
|
878
|
+
this.right = '30px';
|
|
879
|
+
this.bottom = '30px';
|
|
880
|
+
}
|
|
881
|
+
ngOnInit() {
|
|
882
|
+
this.toasts$.subscribe(toasts => {
|
|
883
|
+
this.toasts = this.toastKey
|
|
884
|
+
? toasts.filter(t => {
|
|
885
|
+
return t.options && t.options.containerKey !== this.toastKey;
|
|
886
|
+
})
|
|
887
|
+
: toasts;
|
|
888
|
+
});
|
|
889
|
+
}
|
|
890
|
+
trackByFunc(index, toast) {
|
|
891
|
+
if (!toast)
|
|
892
|
+
return null;
|
|
893
|
+
return toast.options?.id;
|
|
894
|
+
}
|
|
895
|
+
}
|
|
896
|
+
ToastContainerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ToastContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
897
|
+
ToastContainerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: ToastContainerComponent, selector: "abp-toast-container", inputs: { top: "top", right: "right", bottom: "bottom", left: "left", toastKey: "toastKey" }, ngImport: i0, template: "<div\r\n class=\"abp-toast-container\"\r\n [style.top]=\"top || 'auto'\"\r\n [style.right]=\"right || 'auto'\"\r\n [style.bottom]=\"bottom || 'auto'\"\r\n [style.left]=\"left || 'auto'\"\r\n [style.display]=\"toasts.length ? 'flex' : 'none'\"\r\n [@toastInOut]=\"toasts.length\"\r\n>\r\n <abp-toast\r\n [toast]=\"toast\"\r\n *ngFor=\"let toast of toasts; trackBy: trackByFunc\"\r\n (remove)=\"remove($event)\"\r\n ></abp-toast>\r\n</div>\r\n", styles: [".abp-toast-container{position:fixed;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;min-width:350px;min-height:80px;z-index:1900}.abp-toast-container.new-on-top{flex-direction:column-reverse}\n"], components: [{ type: ToastComponent, selector: "abp-toast", inputs: ["toast"], outputs: ["remove"] }], directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }], animations: [toastInOut] });
|
|
898
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ToastContainerComponent, decorators: [{
|
|
899
|
+
type: Component,
|
|
900
|
+
args: [{ selector: 'abp-toast-container', animations: [toastInOut], template: "<div\r\n class=\"abp-toast-container\"\r\n [style.top]=\"top || 'auto'\"\r\n [style.right]=\"right || 'auto'\"\r\n [style.bottom]=\"bottom || 'auto'\"\r\n [style.left]=\"left || 'auto'\"\r\n [style.display]=\"toasts.length ? 'flex' : 'none'\"\r\n [@toastInOut]=\"toasts.length\"\r\n>\r\n <abp-toast\r\n [toast]=\"toast\"\r\n *ngFor=\"let toast of toasts; trackBy: trackByFunc\"\r\n (remove)=\"remove($event)\"\r\n ></abp-toast>\r\n</div>\r\n", styles: [".abp-toast-container{position:fixed;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;min-width:350px;min-height:80px;z-index:1900}.abp-toast-container.new-on-top{flex-direction:column-reverse}\n"] }]
|
|
901
|
+
}], propDecorators: { top: [{
|
|
902
|
+
type: Input
|
|
903
|
+
}], right: [{
|
|
904
|
+
type: Input
|
|
905
|
+
}], bottom: [{
|
|
906
|
+
type: Input
|
|
907
|
+
}], left: [{
|
|
908
|
+
type: Input
|
|
909
|
+
}], toastKey: [{
|
|
910
|
+
type: Input
|
|
911
|
+
}] } });
|
|
912
|
+
|
|
913
|
+
const DEFAULT_VALIDATION_BLUEPRINTS = {
|
|
914
|
+
creditCard: 'AbpValidation::ThisFieldIsNotAValidCreditCardNumber.',
|
|
915
|
+
email: 'AbpValidation::ThisFieldIsNotAValidEmailAddress.',
|
|
916
|
+
invalid: 'AbpValidation::ThisFieldIsNotValid.',
|
|
917
|
+
max: 'AbpValidation::ThisFieldMustBeBetween{0}And{1}[{{ min }},{{ max }}]',
|
|
918
|
+
maxlength: 'AbpValidation::ThisFieldMustBeAStringOrArrayTypeWithAMaximumLengthOf{0}[{{ requiredLength }}]',
|
|
919
|
+
min: 'AbpValidation::ThisFieldMustBeBetween{0}And{1}[{{ min }},{{ max }}]',
|
|
920
|
+
minlength: 'AbpValidation::ThisFieldMustBeAStringOrArrayTypeWithAMinimumLengthOf{0}[{{ requiredLength }}]',
|
|
921
|
+
ngbDate: 'AbpValidation::ThisFieldIsNotValid.',
|
|
922
|
+
passwordMismatch: 'AbpIdentity::Volo.Abp.Identity:PasswordConfirmationFailed',
|
|
923
|
+
range: 'AbpValidation::ThisFieldMustBeBetween{0}And{1}[{{ min }},{{ max }}]',
|
|
924
|
+
required: 'AbpValidation::ThisFieldIsRequired.',
|
|
925
|
+
url: 'AbpValidation::ThisFieldIsNotAValidFullyQualifiedHttpHttpsOrFtpUrl',
|
|
926
|
+
};
|
|
927
|
+
|
|
928
|
+
class EllipsisDirective {
|
|
929
|
+
constructor(cdRef, elRef) {
|
|
930
|
+
this.cdRef = cdRef;
|
|
931
|
+
this.elRef = elRef;
|
|
932
|
+
this.enabled = true;
|
|
933
|
+
}
|
|
934
|
+
get inlineClass() {
|
|
935
|
+
return this.enabled && this.width;
|
|
936
|
+
}
|
|
937
|
+
get class() {
|
|
938
|
+
return this.enabled && !this.width;
|
|
939
|
+
}
|
|
940
|
+
get maxWidth() {
|
|
941
|
+
return this.enabled && this.width ? this.width || '170px' : undefined;
|
|
942
|
+
}
|
|
943
|
+
ngAfterViewInit() {
|
|
944
|
+
this.title = this.title || this.elRef.nativeElement.innerText;
|
|
945
|
+
this.cdRef.detectChanges();
|
|
946
|
+
}
|
|
947
|
+
}
|
|
948
|
+
EllipsisDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: EllipsisDirective, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
949
|
+
EllipsisDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.1", type: EllipsisDirective, selector: "[abpEllipsis]", inputs: { width: ["abpEllipsis", "width"], title: "title", enabled: ["abpEllipsisEnabled", "enabled"] }, host: { properties: { "title": "this.title", "class.abp-ellipsis-inline": "this.inlineClass", "class.abp-ellipsis": "this.class", "style.max-width": "this.maxWidth" } }, ngImport: i0 });
|
|
950
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: EllipsisDirective, decorators: [{
|
|
951
|
+
type: Directive,
|
|
952
|
+
args: [{
|
|
953
|
+
selector: '[abpEllipsis]',
|
|
954
|
+
}]
|
|
955
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { width: [{
|
|
956
|
+
type: Input,
|
|
957
|
+
args: ['abpEllipsis']
|
|
958
|
+
}], title: [{
|
|
959
|
+
type: HostBinding,
|
|
960
|
+
args: ['title']
|
|
961
|
+
}, {
|
|
962
|
+
type: Input
|
|
963
|
+
}], enabled: [{
|
|
964
|
+
type: Input,
|
|
965
|
+
args: ['abpEllipsisEnabled']
|
|
966
|
+
}], inlineClass: [{
|
|
967
|
+
type: HostBinding,
|
|
968
|
+
args: ['class.abp-ellipsis-inline']
|
|
969
|
+
}], class: [{
|
|
970
|
+
type: HostBinding,
|
|
971
|
+
args: ['class.abp-ellipsis']
|
|
972
|
+
}], maxWidth: [{
|
|
973
|
+
type: HostBinding,
|
|
974
|
+
args: ['style.max-width']
|
|
975
|
+
}] } });
|
|
976
|
+
class EllipsisModule {
|
|
977
|
+
}
|
|
978
|
+
EllipsisModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: EllipsisModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
979
|
+
EllipsisModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: EllipsisModule, declarations: [EllipsisDirective], exports: [EllipsisDirective] });
|
|
980
|
+
EllipsisModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: EllipsisModule });
|
|
981
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: EllipsisModule, decorators: [{
|
|
982
|
+
type: NgModule,
|
|
983
|
+
args: [{
|
|
984
|
+
exports: [EllipsisDirective],
|
|
985
|
+
declarations: [EllipsisDirective],
|
|
986
|
+
}]
|
|
987
|
+
}] });
|
|
988
|
+
|
|
989
|
+
class LoadingDirective {
|
|
990
|
+
constructor(elRef, vcRef, cdRes, injector, renderer) {
|
|
991
|
+
this.elRef = elRef;
|
|
992
|
+
this.vcRef = vcRef;
|
|
993
|
+
this.cdRes = cdRes;
|
|
994
|
+
this.injector = injector;
|
|
995
|
+
this.renderer = renderer;
|
|
996
|
+
this.position = 'relative';
|
|
997
|
+
this.delay = 0;
|
|
998
|
+
this.rootNode = null;
|
|
999
|
+
this.timerSubscription = null;
|
|
1000
|
+
}
|
|
1001
|
+
get loading() {
|
|
1002
|
+
return this._loading;
|
|
1003
|
+
}
|
|
1004
|
+
set loading(newValue) {
|
|
1005
|
+
setTimeout(() => {
|
|
1006
|
+
if (!newValue && this.timerSubscription) {
|
|
1007
|
+
this.timerSubscription.unsubscribe();
|
|
1008
|
+
this.timerSubscription = null;
|
|
1009
|
+
this._loading = newValue;
|
|
1010
|
+
if (this.rootNode) {
|
|
1011
|
+
this.renderer.removeChild(this.rootNode.parentElement, this.rootNode);
|
|
1012
|
+
this.rootNode = null;
|
|
1013
|
+
}
|
|
1014
|
+
return;
|
|
1015
|
+
}
|
|
1016
|
+
this.timerSubscription = timer(this.delay)
|
|
1017
|
+
.pipe(take(1))
|
|
1018
|
+
.subscribe(() => {
|
|
1019
|
+
if (!this.componentRef) {
|
|
1020
|
+
this.componentRef = this.cdRes
|
|
1021
|
+
.resolveComponentFactory(LoadingComponent)
|
|
1022
|
+
.create(this.injector);
|
|
1023
|
+
}
|
|
1024
|
+
if (newValue && !this.rootNode) {
|
|
1025
|
+
this.rootNode = this.componentRef.hostView.rootNodes[0];
|
|
1026
|
+
this.targetElement?.appendChild(this.rootNode);
|
|
1027
|
+
}
|
|
1028
|
+
else if (this.rootNode) {
|
|
1029
|
+
this.renderer.removeChild(this.rootNode.parentElement, this.rootNode);
|
|
1030
|
+
this.rootNode = null;
|
|
1031
|
+
}
|
|
1032
|
+
this._loading = newValue;
|
|
1033
|
+
this.timerSubscription = null;
|
|
1034
|
+
});
|
|
1035
|
+
}, 0);
|
|
1036
|
+
}
|
|
1037
|
+
ngOnInit() {
|
|
1038
|
+
if (!this.targetElement) {
|
|
1039
|
+
const { offsetHeight, offsetWidth } = this.elRef.nativeElement;
|
|
1040
|
+
if (!offsetHeight && !offsetWidth && this.elRef.nativeElement.children.length) {
|
|
1041
|
+
this.targetElement = this.elRef.nativeElement.children[0];
|
|
1042
|
+
}
|
|
1043
|
+
else {
|
|
1044
|
+
this.targetElement = this.elRef.nativeElement;
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
ngOnDestroy() {
|
|
1049
|
+
if (this.timerSubscription) {
|
|
1050
|
+
this.timerSubscription.unsubscribe();
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
LoadingDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: LoadingDirective, deps: [{ token: i0.ElementRef }, { token: i0.ViewContainerRef }, { token: i0.ComponentFactoryResolver }, { token: i0.Injector }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1055
|
+
LoadingDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.1", type: LoadingDirective, selector: "[abpLoading]", inputs: { loading: ["abpLoading", "loading"], targetElement: ["abpLoadingTargetElement", "targetElement"], delay: ["abpLoadingDelay", "delay"] }, host: { properties: { "style.position": "this.position" } }, ngImport: i0 });
|
|
1056
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: LoadingDirective, decorators: [{
|
|
1057
|
+
type: Directive,
|
|
1058
|
+
args: [{ selector: '[abpLoading]' }]
|
|
1059
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ViewContainerRef }, { type: i0.ComponentFactoryResolver }, { type: i0.Injector }, { type: i0.Renderer2 }]; }, propDecorators: { position: [{
|
|
1060
|
+
type: HostBinding,
|
|
1061
|
+
args: ['style.position']
|
|
1062
|
+
}], loading: [{
|
|
1063
|
+
type: Input,
|
|
1064
|
+
args: ['abpLoading']
|
|
1065
|
+
}], targetElement: [{
|
|
1066
|
+
type: Input,
|
|
1067
|
+
args: ['abpLoadingTargetElement']
|
|
1068
|
+
}], delay: [{
|
|
1069
|
+
type: Input,
|
|
1070
|
+
args: ['abpLoadingDelay']
|
|
1071
|
+
}] } });
|
|
1072
|
+
|
|
1073
|
+
class NgxDatatableDefaultDirective {
|
|
1074
|
+
constructor(table, document) {
|
|
1075
|
+
this.table = table;
|
|
1076
|
+
this.document = document;
|
|
1077
|
+
this.subscription = new Subscription();
|
|
1078
|
+
this.resizeDiff = 0;
|
|
1079
|
+
this.class = 'material bordered';
|
|
1080
|
+
this.table.columnMode = ColumnMode.force;
|
|
1081
|
+
this.table.footerHeight = 50;
|
|
1082
|
+
this.table.headerHeight = 50;
|
|
1083
|
+
this.table.rowHeight = 'auto';
|
|
1084
|
+
this.table.scrollbarH = true;
|
|
1085
|
+
this.table.virtualization = false;
|
|
1086
|
+
}
|
|
1087
|
+
get classes() {
|
|
1088
|
+
return `ngx-datatable ${this.class}`;
|
|
1089
|
+
}
|
|
1090
|
+
fixHorizontalGap(scroller) {
|
|
1091
|
+
const { body, documentElement } = this.document;
|
|
1092
|
+
if (documentElement.scrollHeight !== documentElement.clientHeight) {
|
|
1093
|
+
if (this.resizeDiff === 0) {
|
|
1094
|
+
this.resizeDiff = window.innerWidth - body.offsetWidth;
|
|
1095
|
+
scroller.scrollWidth -= this.resizeDiff;
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
else {
|
|
1099
|
+
scroller.scrollWidth += this.resizeDiff;
|
|
1100
|
+
this.resizeDiff = 0;
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
fixStyleOnWindowResize() {
|
|
1104
|
+
// avoided @HostListener('window:resize') in favor of performance
|
|
1105
|
+
const subscription = fromEvent(window, 'resize')
|
|
1106
|
+
.pipe(debounceTime(500))
|
|
1107
|
+
.subscribe(() => {
|
|
1108
|
+
const { scroller } = this.table.bodyComponent;
|
|
1109
|
+
if (!scroller)
|
|
1110
|
+
return;
|
|
1111
|
+
this.fixHorizontalGap(scroller);
|
|
1112
|
+
});
|
|
1113
|
+
this.subscription.add(subscription);
|
|
1114
|
+
}
|
|
1115
|
+
ngAfterViewInit() {
|
|
1116
|
+
this.fixStyleOnWindowResize();
|
|
1117
|
+
}
|
|
1118
|
+
ngOnDestroy() {
|
|
1119
|
+
this.subscription.unsubscribe();
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
NgxDatatableDefaultDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxDatatableDefaultDirective, deps: [{ token: i1$2.DatatableComponent }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1123
|
+
NgxDatatableDefaultDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.1", type: NgxDatatableDefaultDirective, selector: "ngx-datatable[default]", inputs: { class: "class" }, host: { properties: { "class": "this.classes" } }, exportAs: ["ngxDatatableDefault"], ngImport: i0 });
|
|
1124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxDatatableDefaultDirective, decorators: [{
|
|
1125
|
+
type: Directive,
|
|
1126
|
+
args: [{
|
|
1127
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
1128
|
+
selector: 'ngx-datatable[default]',
|
|
1129
|
+
exportAs: 'ngxDatatableDefault',
|
|
1130
|
+
}]
|
|
1131
|
+
}], ctorParameters: function () { return [{ type: i1$2.DatatableComponent }, { type: undefined, decorators: [{
|
|
1132
|
+
type: Inject,
|
|
1133
|
+
args: [DOCUMENT]
|
|
1134
|
+
}] }]; }, propDecorators: { class: [{
|
|
1135
|
+
type: Input
|
|
1136
|
+
}], classes: [{
|
|
1137
|
+
type: HostBinding,
|
|
1138
|
+
args: ['class']
|
|
1139
|
+
}] } });
|
|
1140
|
+
|
|
1141
|
+
const defaultNgxDatatableMessages = {
|
|
1142
|
+
emptyMessage: 'AbpUi::NoDataAvailableInDatatable',
|
|
1143
|
+
totalMessage: 'AbpUi::Total',
|
|
1144
|
+
selectedMessage: 'AbpUi::Selected',
|
|
1145
|
+
};
|
|
1146
|
+
const NGX_DATATABLE_MESSAGES = new InjectionToken('NGX_DATATABLE_MESSAGES');
|
|
1147
|
+
|
|
1148
|
+
class NgxDatatableListDirective {
|
|
1149
|
+
constructor(table, cdRef, localizationService, ngxDatatableMessages) {
|
|
1150
|
+
this.table = table;
|
|
1151
|
+
this.cdRef = cdRef;
|
|
1152
|
+
this.localizationService = localizationService;
|
|
1153
|
+
this.ngxDatatableMessages = ngxDatatableMessages;
|
|
1154
|
+
this.subscription = new Subscription();
|
|
1155
|
+
this.querySubscription = new Subscription();
|
|
1156
|
+
this.setInitialValues();
|
|
1157
|
+
}
|
|
1158
|
+
setInitialValues() {
|
|
1159
|
+
this.table.externalPaging = true;
|
|
1160
|
+
this.table.externalSorting = true;
|
|
1161
|
+
const { emptyMessage, selectedMessage, totalMessage } = this.ngxDatatableMessages || defaultNgxDatatableMessages;
|
|
1162
|
+
this.table.messages = {
|
|
1163
|
+
emptyMessage: this.localizationService.instant(emptyMessage),
|
|
1164
|
+
totalMessage: this.localizationService.instant(totalMessage),
|
|
1165
|
+
selectedMessage: this.localizationService.instant(selectedMessage),
|
|
1166
|
+
};
|
|
1167
|
+
}
|
|
1168
|
+
subscribeToPage() {
|
|
1169
|
+
const sub = this.table.page.subscribe(({ offset }) => {
|
|
1170
|
+
this.list.page = offset;
|
|
1171
|
+
this.table.offset = offset;
|
|
1172
|
+
});
|
|
1173
|
+
this.subscription.add(sub);
|
|
1174
|
+
}
|
|
1175
|
+
subscribeToSort() {
|
|
1176
|
+
const sub = this.table.sort.subscribe(({ sorts: [{ prop, dir }] }) => {
|
|
1177
|
+
if (prop === this.list.sortKey && this.list.sortOrder === 'desc') {
|
|
1178
|
+
this.list.sortKey = '';
|
|
1179
|
+
this.list.sortOrder = '';
|
|
1180
|
+
this.table.sorts = [];
|
|
1181
|
+
this.cdRef.detectChanges();
|
|
1182
|
+
}
|
|
1183
|
+
else {
|
|
1184
|
+
this.list.sortKey = prop;
|
|
1185
|
+
this.list.sortOrder = dir;
|
|
1186
|
+
}
|
|
1187
|
+
});
|
|
1188
|
+
this.subscription.add(sub);
|
|
1189
|
+
}
|
|
1190
|
+
subscribeToQuery() {
|
|
1191
|
+
if (!this.querySubscription.closed)
|
|
1192
|
+
this.querySubscription.unsubscribe();
|
|
1193
|
+
this.querySubscription = this.list.query$.subscribe(() => {
|
|
1194
|
+
const offset = this.list.page;
|
|
1195
|
+
if (this.table.offset !== offset)
|
|
1196
|
+
this.table.offset = offset;
|
|
1197
|
+
});
|
|
1198
|
+
}
|
|
1199
|
+
ngOnChanges({ list }) {
|
|
1200
|
+
this.subscribeToQuery();
|
|
1201
|
+
if (!list.firstChange)
|
|
1202
|
+
return;
|
|
1203
|
+
const { maxResultCount, page } = list.currentValue;
|
|
1204
|
+
this.table.limit = maxResultCount;
|
|
1205
|
+
this.table.offset = page;
|
|
1206
|
+
}
|
|
1207
|
+
ngOnDestroy() {
|
|
1208
|
+
this.subscription.unsubscribe();
|
|
1209
|
+
this.querySubscription.unsubscribe();
|
|
1210
|
+
}
|
|
1211
|
+
ngOnInit() {
|
|
1212
|
+
this.subscribeToPage();
|
|
1213
|
+
this.subscribeToSort();
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
NgxDatatableListDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxDatatableListDirective, deps: [{ token: i1$2.DatatableComponent }, { token: i0.ChangeDetectorRef }, { token: i2.LocalizationService }, { token: NGX_DATATABLE_MESSAGES, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1217
|
+
NgxDatatableListDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.1.1", type: NgxDatatableListDirective, selector: "ngx-datatable[list]", inputs: { list: "list" }, exportAs: ["ngxDatatableList"], usesOnChanges: true, ngImport: i0 });
|
|
1218
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NgxDatatableListDirective, decorators: [{
|
|
1219
|
+
type: Directive,
|
|
1220
|
+
args: [{
|
|
1221
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
1222
|
+
selector: 'ngx-datatable[list]',
|
|
1223
|
+
exportAs: 'ngxDatatableList',
|
|
1224
|
+
}]
|
|
1225
|
+
}], ctorParameters: function () { return [{ type: i1$2.DatatableComponent }, { type: i0.ChangeDetectorRef }, { type: i2.LocalizationService }, { type: undefined, decorators: [{
|
|
1226
|
+
type: Optional
|
|
1227
|
+
}, {
|
|
1228
|
+
type: Inject,
|
|
1229
|
+
args: [NGX_DATATABLE_MESSAGES]
|
|
1230
|
+
}] }]; }, propDecorators: { list: [{
|
|
1231
|
+
type: Input
|
|
1232
|
+
}] } });
|
|
1233
|
+
|
|
1234
|
+
class DocumentDirHandlerService {
|
|
1235
|
+
constructor(injector) {
|
|
1236
|
+
this.injector = injector;
|
|
1237
|
+
this.dir = new BehaviorSubject('ltr');
|
|
1238
|
+
this.dir$ = this.dir.asObservable();
|
|
1239
|
+
this.listenToLanguageChanges();
|
|
1240
|
+
}
|
|
1241
|
+
listenToLanguageChanges() {
|
|
1242
|
+
const l10n = this.injector.get(LocalizationService);
|
|
1243
|
+
// will always listen, no need to unsubscribe
|
|
1244
|
+
l10n.currentLang$.pipe(map(locale => getLocaleDirection(locale))).subscribe(dir => {
|
|
1245
|
+
this.dir.next(dir);
|
|
1246
|
+
this.setBodyDir(dir);
|
|
1247
|
+
});
|
|
1248
|
+
}
|
|
1249
|
+
setBodyDir(dir) {
|
|
1250
|
+
document.body.dir = dir;
|
|
1251
|
+
document.dir = dir;
|
|
1252
|
+
}
|
|
1253
|
+
}
|
|
1254
|
+
DocumentDirHandlerService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DocumentDirHandlerService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1255
|
+
DocumentDirHandlerService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DocumentDirHandlerService });
|
|
1256
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DocumentDirHandlerService, decorators: [{
|
|
1257
|
+
type: Injectable
|
|
1258
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
1259
|
+
|
|
1260
|
+
function httpErrorConfigFactory(config = {}) {
|
|
1261
|
+
if (config.errorScreen && config.errorScreen.component && !config.errorScreen.forWhichErrors) {
|
|
1262
|
+
config.errorScreen.forWhichErrors = [401, 403, 404, 500];
|
|
1263
|
+
}
|
|
1264
|
+
return {
|
|
1265
|
+
skipHandledErrorCodes: [],
|
|
1266
|
+
errorScreen: {},
|
|
1267
|
+
...config,
|
|
1268
|
+
};
|
|
1269
|
+
}
|
|
1270
|
+
const HTTP_ERROR_CONFIG = new InjectionToken('HTTP_ERROR_CONFIG');
|
|
1271
|
+
const HTTP_ERROR_HANDLER = new InjectionToken('HTTP_ERROR_HANDLER');
|
|
1272
|
+
|
|
1273
|
+
const DEFAULT_ERROR_MESSAGES = {
|
|
1274
|
+
defaultError: {
|
|
1275
|
+
title: 'An error has occurred!',
|
|
1276
|
+
details: 'Error detail not sent by server.',
|
|
1277
|
+
},
|
|
1278
|
+
defaultError401: {
|
|
1279
|
+
title: 'You are not authenticated!',
|
|
1280
|
+
details: 'You should be authenticated (sign in) in order to perform this operation.',
|
|
1281
|
+
},
|
|
1282
|
+
defaultError403: {
|
|
1283
|
+
title: 'You are not authorized!',
|
|
1284
|
+
details: 'You are not allowed to perform this operation.',
|
|
1285
|
+
},
|
|
1286
|
+
defaultError404: {
|
|
1287
|
+
title: 'Resource not found!',
|
|
1288
|
+
details: 'The resource requested could not found on the server.',
|
|
1289
|
+
},
|
|
1290
|
+
defaultError500: {
|
|
1291
|
+
title: 'Internal server error',
|
|
1292
|
+
details: 'Error detail not sent by server.',
|
|
1293
|
+
},
|
|
1294
|
+
};
|
|
1295
|
+
const DEFAULT_ERROR_LOCALIZATIONS = {
|
|
1296
|
+
defaultError: {
|
|
1297
|
+
title: 'AbpUi::DefaultErrorMessage',
|
|
1298
|
+
details: 'AbpUi::DefaultErrorMessageDetail',
|
|
1299
|
+
},
|
|
1300
|
+
defaultError401: {
|
|
1301
|
+
title: 'AbpUi::DefaultErrorMessage401',
|
|
1302
|
+
details: 'AbpUi::DefaultErrorMessage401Detail',
|
|
1303
|
+
},
|
|
1304
|
+
defaultError403: {
|
|
1305
|
+
title: 'AbpUi::DefaultErrorMessage403',
|
|
1306
|
+
details: 'AbpUi::DefaultErrorMessage403Detail',
|
|
1307
|
+
},
|
|
1308
|
+
defaultError404: {
|
|
1309
|
+
title: 'AbpUi::DefaultErrorMessage404',
|
|
1310
|
+
details: 'AbpUi::DefaultErrorMessage404Detail',
|
|
1311
|
+
},
|
|
1312
|
+
defaultError500: {
|
|
1313
|
+
title: 'AbpUi::500Message',
|
|
1314
|
+
details: 'AbpUi::DefaultErrorMessage',
|
|
1315
|
+
},
|
|
1316
|
+
};
|
|
1317
|
+
class ErrorHandler {
|
|
1318
|
+
constructor(injector) {
|
|
1319
|
+
this.injector = injector;
|
|
1320
|
+
this.componentRef = null;
|
|
1321
|
+
this.httpErrorHandler = this.injector.get(HTTP_ERROR_HANDLER, (_, err) => throwError(err));
|
|
1322
|
+
this.executeErrorHandler = (error) => {
|
|
1323
|
+
const returnValue = this.httpErrorHandler(this.injector, error);
|
|
1324
|
+
return (returnValue instanceof Observable ? returnValue : of(null)).pipe(catchError(err => {
|
|
1325
|
+
this.handleError(err);
|
|
1326
|
+
return of(null);
|
|
1327
|
+
}));
|
|
1328
|
+
};
|
|
1329
|
+
this.filterRestErrors = ({ status }) => {
|
|
1330
|
+
if (typeof status !== 'number')
|
|
1331
|
+
return false;
|
|
1332
|
+
return (!!this.httpErrorConfig.skipHandledErrorCodes &&
|
|
1333
|
+
this.httpErrorConfig.skipHandledErrorCodes.findIndex(code => code === status) < 0);
|
|
1334
|
+
};
|
|
1335
|
+
this.filterRouteErrors = (navigationError) => {
|
|
1336
|
+
return (navigationError.error?.message?.indexOf('Cannot match') > -1 &&
|
|
1337
|
+
!!this.httpErrorConfig.skipHandledErrorCodes &&
|
|
1338
|
+
this.httpErrorConfig.skipHandledErrorCodes.findIndex(code => code === 404) < 0);
|
|
1339
|
+
};
|
|
1340
|
+
this.httpErrorReporter = injector.get(HttpErrorReporterService);
|
|
1341
|
+
this.routerEvents = injector.get(RouterEvents);
|
|
1342
|
+
this.confirmationService = injector.get(ConfirmationService);
|
|
1343
|
+
this.cfRes = injector.get(ComponentFactoryResolver);
|
|
1344
|
+
this.rendererFactory = injector.get(RendererFactory2);
|
|
1345
|
+
this.httpErrorConfig = injector.get('HTTP_ERROR_CONFIG');
|
|
1346
|
+
this.listenToRestError();
|
|
1347
|
+
this.listenToRouterError();
|
|
1348
|
+
this.listenToRouterDataResolved();
|
|
1349
|
+
}
|
|
1350
|
+
listenToRouterError() {
|
|
1351
|
+
this.routerEvents
|
|
1352
|
+
.getNavigationEvents('Error')
|
|
1353
|
+
.pipe(filter(this.filterRouteErrors))
|
|
1354
|
+
.subscribe(() => this.show404Page());
|
|
1355
|
+
}
|
|
1356
|
+
listenToRouterDataResolved() {
|
|
1357
|
+
this.routerEvents
|
|
1358
|
+
.getEvents(ResolveEnd)
|
|
1359
|
+
.pipe(filter(() => !!this.componentRef))
|
|
1360
|
+
.subscribe(() => {
|
|
1361
|
+
this.componentRef?.destroy();
|
|
1362
|
+
this.componentRef = null;
|
|
1363
|
+
});
|
|
1364
|
+
}
|
|
1365
|
+
listenToRestError() {
|
|
1366
|
+
this.httpErrorReporter.reporter$
|
|
1367
|
+
.pipe(filter(this.filterRestErrors), switchMap(this.executeErrorHandler))
|
|
1368
|
+
.subscribe();
|
|
1369
|
+
}
|
|
1370
|
+
handleError(err) {
|
|
1371
|
+
const body = err?.error?.error || {
|
|
1372
|
+
key: DEFAULT_ERROR_LOCALIZATIONS.defaultError.title,
|
|
1373
|
+
defaultValue: DEFAULT_ERROR_MESSAGES.defaultError.title,
|
|
1374
|
+
};
|
|
1375
|
+
if (err instanceof HttpErrorResponse && err.headers.get('_AbpErrorFormat')) {
|
|
1376
|
+
const confirmation$ = this.showErrorWithRequestBody(body);
|
|
1377
|
+
if (err.status === 401) {
|
|
1378
|
+
confirmation$.subscribe(() => {
|
|
1379
|
+
this.navigateToLogin();
|
|
1380
|
+
});
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
else {
|
|
1384
|
+
switch (err.status) {
|
|
1385
|
+
case 401:
|
|
1386
|
+
this.canCreateCustomError(401)
|
|
1387
|
+
? this.show401Page()
|
|
1388
|
+
: this.showError({
|
|
1389
|
+
key: DEFAULT_ERROR_LOCALIZATIONS.defaultError401.title,
|
|
1390
|
+
defaultValue: DEFAULT_ERROR_MESSAGES.defaultError401.title,
|
|
1391
|
+
}, {
|
|
1392
|
+
key: DEFAULT_ERROR_LOCALIZATIONS.defaultError401.details,
|
|
1393
|
+
defaultValue: DEFAULT_ERROR_MESSAGES.defaultError401.details,
|
|
1394
|
+
}).subscribe(() => this.navigateToLogin());
|
|
1395
|
+
break;
|
|
1396
|
+
case 403:
|
|
1397
|
+
this.createErrorComponent({
|
|
1398
|
+
title: {
|
|
1399
|
+
key: DEFAULT_ERROR_LOCALIZATIONS.defaultError403.title,
|
|
1400
|
+
defaultValue: DEFAULT_ERROR_MESSAGES.defaultError403.title,
|
|
1401
|
+
},
|
|
1402
|
+
details: {
|
|
1403
|
+
key: DEFAULT_ERROR_LOCALIZATIONS.defaultError403.details,
|
|
1404
|
+
defaultValue: DEFAULT_ERROR_MESSAGES.defaultError403.details,
|
|
1405
|
+
},
|
|
1406
|
+
status: 403,
|
|
1407
|
+
});
|
|
1408
|
+
break;
|
|
1409
|
+
case 404:
|
|
1410
|
+
this.canCreateCustomError(404)
|
|
1411
|
+
? this.show404Page()
|
|
1412
|
+
: this.showError({
|
|
1413
|
+
key: DEFAULT_ERROR_LOCALIZATIONS.defaultError404.details,
|
|
1414
|
+
defaultValue: DEFAULT_ERROR_MESSAGES.defaultError404.details,
|
|
1415
|
+
}, {
|
|
1416
|
+
key: DEFAULT_ERROR_LOCALIZATIONS.defaultError404.title,
|
|
1417
|
+
defaultValue: DEFAULT_ERROR_MESSAGES.defaultError404.title,
|
|
1418
|
+
});
|
|
1419
|
+
break;
|
|
1420
|
+
case 500:
|
|
1421
|
+
this.createErrorComponent({
|
|
1422
|
+
title: {
|
|
1423
|
+
key: DEFAULT_ERROR_LOCALIZATIONS.defaultError500.title,
|
|
1424
|
+
defaultValue: DEFAULT_ERROR_MESSAGES.defaultError500.title,
|
|
1425
|
+
},
|
|
1426
|
+
details: {
|
|
1427
|
+
key: DEFAULT_ERROR_LOCALIZATIONS.defaultError500.details,
|
|
1428
|
+
defaultValue: DEFAULT_ERROR_MESSAGES.defaultError500.details,
|
|
1429
|
+
},
|
|
1430
|
+
status: 500,
|
|
1431
|
+
});
|
|
1432
|
+
break;
|
|
1433
|
+
case 0:
|
|
1434
|
+
if (err.statusText === 'Unknown Error') {
|
|
1435
|
+
this.createErrorComponent({
|
|
1436
|
+
title: {
|
|
1437
|
+
key: DEFAULT_ERROR_LOCALIZATIONS.defaultError.title,
|
|
1438
|
+
defaultValue: DEFAULT_ERROR_MESSAGES.defaultError.title,
|
|
1439
|
+
},
|
|
1440
|
+
details: err.message,
|
|
1441
|
+
isHomeShow: false,
|
|
1442
|
+
});
|
|
1443
|
+
}
|
|
1444
|
+
break;
|
|
1445
|
+
default:
|
|
1446
|
+
this.showError({
|
|
1447
|
+
key: DEFAULT_ERROR_LOCALIZATIONS.defaultError.details,
|
|
1448
|
+
defaultValue: DEFAULT_ERROR_MESSAGES.defaultError.details,
|
|
1449
|
+
}, {
|
|
1450
|
+
key: DEFAULT_ERROR_LOCALIZATIONS.defaultError.title,
|
|
1451
|
+
defaultValue: DEFAULT_ERROR_MESSAGES.defaultError.title,
|
|
1452
|
+
});
|
|
1453
|
+
break;
|
|
1454
|
+
}
|
|
1455
|
+
}
|
|
1456
|
+
}
|
|
1457
|
+
show401Page() {
|
|
1458
|
+
this.createErrorComponent({
|
|
1459
|
+
title: {
|
|
1460
|
+
key: DEFAULT_ERROR_LOCALIZATIONS.defaultError401.title,
|
|
1461
|
+
defaultValue: DEFAULT_ERROR_MESSAGES.defaultError401.title,
|
|
1462
|
+
},
|
|
1463
|
+
status: 401,
|
|
1464
|
+
});
|
|
1465
|
+
}
|
|
1466
|
+
show404Page() {
|
|
1467
|
+
this.createErrorComponent({
|
|
1468
|
+
title: {
|
|
1469
|
+
key: DEFAULT_ERROR_LOCALIZATIONS.defaultError404.title,
|
|
1470
|
+
defaultValue: DEFAULT_ERROR_MESSAGES.defaultError404.title,
|
|
1471
|
+
},
|
|
1472
|
+
status: 404,
|
|
1473
|
+
});
|
|
1474
|
+
}
|
|
1475
|
+
showErrorWithRequestBody(body) {
|
|
1476
|
+
let message;
|
|
1477
|
+
let title;
|
|
1478
|
+
if (body.details) {
|
|
1479
|
+
message = body.details;
|
|
1480
|
+
title = body.message;
|
|
1481
|
+
}
|
|
1482
|
+
else if (body.message) {
|
|
1483
|
+
title = {
|
|
1484
|
+
key: DEFAULT_ERROR_LOCALIZATIONS.defaultError.title,
|
|
1485
|
+
defaultValue: DEFAULT_ERROR_MESSAGES.defaultError.title,
|
|
1486
|
+
};
|
|
1487
|
+
message = body.message;
|
|
1488
|
+
}
|
|
1489
|
+
else {
|
|
1490
|
+
message = body.message || {
|
|
1491
|
+
key: DEFAULT_ERROR_LOCALIZATIONS.defaultError.title,
|
|
1492
|
+
defaultValue: DEFAULT_ERROR_MESSAGES.defaultError.title,
|
|
1493
|
+
};
|
|
1494
|
+
title = '';
|
|
1495
|
+
}
|
|
1496
|
+
return this.showError(message, title);
|
|
1497
|
+
}
|
|
1498
|
+
showError(message, title) {
|
|
1499
|
+
return this.confirmationService.error(message, title, {
|
|
1500
|
+
hideCancelBtn: true,
|
|
1501
|
+
yesText: 'AbpAccount::Close',
|
|
1502
|
+
});
|
|
1503
|
+
}
|
|
1504
|
+
navigateToLogin() {
|
|
1505
|
+
this.injector.get(AuthService).navigateToLogin();
|
|
1506
|
+
}
|
|
1507
|
+
createErrorComponent(instance) {
|
|
1508
|
+
const renderer = this.rendererFactory.createRenderer(null, null);
|
|
1509
|
+
const host = renderer.selectRootElement(document.body, true);
|
|
1510
|
+
this.componentRef = this.cfRes
|
|
1511
|
+
.resolveComponentFactory(HttpErrorWrapperComponent)
|
|
1512
|
+
.create(this.injector);
|
|
1513
|
+
for (const key in instance) {
|
|
1514
|
+
/* istanbul ignore else */
|
|
1515
|
+
if (Object.prototype.hasOwnProperty.call(this.componentRef.instance, key)) {
|
|
1516
|
+
this.componentRef.instance[key] = instance[key];
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1519
|
+
this.componentRef.instance.hideCloseIcon = !!this.httpErrorConfig.errorScreen?.hideCloseIcon;
|
|
1520
|
+
const appRef = this.injector.get(ApplicationRef);
|
|
1521
|
+
if (this.canCreateCustomError(instance.status)) {
|
|
1522
|
+
this.componentRef.instance.cfRes = this.cfRes;
|
|
1523
|
+
this.componentRef.instance.appRef = appRef;
|
|
1524
|
+
this.componentRef.instance.injector = this.injector;
|
|
1525
|
+
this.componentRef.instance.customComponent = this.httpErrorConfig.errorScreen?.component;
|
|
1526
|
+
}
|
|
1527
|
+
appRef.attachView(this.componentRef.hostView);
|
|
1528
|
+
renderer.appendChild(host, this.componentRef.hostView.rootNodes[0]);
|
|
1529
|
+
const destroy$ = new Subject();
|
|
1530
|
+
this.componentRef.instance.destroy$ = destroy$;
|
|
1531
|
+
destroy$.subscribe(() => {
|
|
1532
|
+
this.componentRef?.destroy();
|
|
1533
|
+
this.componentRef = null;
|
|
1534
|
+
});
|
|
1535
|
+
}
|
|
1536
|
+
canCreateCustomError(status) {
|
|
1537
|
+
return !!(this.httpErrorConfig?.errorScreen?.component &&
|
|
1538
|
+
this.httpErrorConfig?.errorScreen?.forWhichErrors &&
|
|
1539
|
+
this.httpErrorConfig?.errorScreen?.forWhichErrors.indexOf(status) > -1);
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
ErrorHandler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ErrorHandler, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1543
|
+
ErrorHandler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ErrorHandler, providedIn: 'root' });
|
|
1544
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ErrorHandler, decorators: [{
|
|
1545
|
+
type: Injectable,
|
|
1546
|
+
args: [{ providedIn: 'root' }]
|
|
1547
|
+
}], ctorParameters: function () { return [{ type: i0.Injector }]; } });
|
|
1548
|
+
|
|
1549
|
+
class NavItem {
|
|
1550
|
+
constructor(props) {
|
|
1551
|
+
props = { ...props, visible: props.visible || (() => true) };
|
|
1552
|
+
Object.assign(this, props);
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
class UserMenu extends NavItem {
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1559
|
+
const NG_BOOTSTRAP_CONFIG_PROVIDERS = [
|
|
1560
|
+
{
|
|
1561
|
+
provide: APP_INITIALIZER,
|
|
1562
|
+
useFactory: configureNgBootstrap,
|
|
1563
|
+
deps: [NgbInputDatepickerConfig, NgbTypeaheadConfig],
|
|
1564
|
+
multi: true,
|
|
1565
|
+
},
|
|
1566
|
+
];
|
|
1567
|
+
function configureNgBootstrap(datepicker, typeahead) {
|
|
1568
|
+
return () => {
|
|
1569
|
+
datepicker.container = 'body';
|
|
1570
|
+
typeahead.container = 'body';
|
|
1571
|
+
};
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
const THEME_SHARED_ROUTE_PROVIDERS = [
|
|
1575
|
+
{ provide: APP_INITIALIZER, useFactory: configureRoutes, deps: [RoutesService], multi: true },
|
|
1576
|
+
];
|
|
1577
|
+
function configureRoutes(routesService) {
|
|
1578
|
+
return () => {
|
|
1579
|
+
routesService.add([
|
|
1580
|
+
{
|
|
1581
|
+
path: undefined,
|
|
1582
|
+
name: "AbpUiNavigation::Menu:Administration" /* Administration */,
|
|
1583
|
+
iconClass: 'fa fa-wrench',
|
|
1584
|
+
order: 100,
|
|
1585
|
+
},
|
|
1586
|
+
]);
|
|
1587
|
+
};
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
class AbstractMenuService {
|
|
1591
|
+
constructor() {
|
|
1592
|
+
this._items$ = new BehaviorSubject([]);
|
|
1593
|
+
}
|
|
1594
|
+
get items() {
|
|
1595
|
+
return this._items$.value;
|
|
1596
|
+
}
|
|
1597
|
+
get items$() {
|
|
1598
|
+
return this._items$.asObservable();
|
|
1599
|
+
}
|
|
1600
|
+
addItems(newItems) {
|
|
1601
|
+
const items = [...this.items];
|
|
1602
|
+
newItems.forEach(item => {
|
|
1603
|
+
const index = items.findIndex(i => i.id === item.id);
|
|
1604
|
+
const data = new this.baseClass(item);
|
|
1605
|
+
if (index > -1) {
|
|
1606
|
+
items[index] = data;
|
|
1607
|
+
return;
|
|
1608
|
+
}
|
|
1609
|
+
items.push(data);
|
|
1610
|
+
});
|
|
1611
|
+
items.sort(this.sortItems);
|
|
1612
|
+
this._items$.next(items);
|
|
1613
|
+
}
|
|
1614
|
+
removeItem(id) {
|
|
1615
|
+
const index = this.items.findIndex(item => item.id === id);
|
|
1616
|
+
if (index < 0)
|
|
1617
|
+
return;
|
|
1618
|
+
const items = [...this.items.slice(0, index), ...this.items.slice(index + 1)];
|
|
1619
|
+
this._items$.next(items);
|
|
1620
|
+
}
|
|
1621
|
+
patchItem(id, item) {
|
|
1622
|
+
const index = this.items.findIndex(i => i.id === id);
|
|
1623
|
+
if (index < 0)
|
|
1624
|
+
return;
|
|
1625
|
+
const items = [...this.items];
|
|
1626
|
+
items[index] = new this.baseClass({ ...items[index], ...item });
|
|
1627
|
+
items.sort(this.sortItems);
|
|
1628
|
+
this._items$.next(items);
|
|
1629
|
+
}
|
|
1630
|
+
sortItems(a, b) {
|
|
1631
|
+
if (!a.order)
|
|
1632
|
+
return 1;
|
|
1633
|
+
if (!b.order)
|
|
1634
|
+
return -1;
|
|
1635
|
+
return a.order - b.order;
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
class NavItemsService extends AbstractMenuService {
|
|
1640
|
+
constructor() {
|
|
1641
|
+
super(...arguments);
|
|
1642
|
+
this.baseClass = NavItem;
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
NavItemsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NavItemsService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1646
|
+
NavItemsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NavItemsService, providedIn: 'root' });
|
|
1647
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: NavItemsService, decorators: [{
|
|
1648
|
+
type: Injectable,
|
|
1649
|
+
args: [{ providedIn: 'root' }]
|
|
1650
|
+
}] });
|
|
1651
|
+
|
|
1652
|
+
class PageAlertService {
|
|
1653
|
+
constructor() {
|
|
1654
|
+
this.alerts = new InternalStore([]);
|
|
1655
|
+
this.alerts$ = this.alerts.sliceState(state => state);
|
|
1656
|
+
}
|
|
1657
|
+
show(alert) {
|
|
1658
|
+
const newAlert = {
|
|
1659
|
+
...alert,
|
|
1660
|
+
dismissible: alert.dismissible ?? true,
|
|
1661
|
+
};
|
|
1662
|
+
this.alerts.set([newAlert, ...this.alerts.state]);
|
|
1663
|
+
}
|
|
1664
|
+
remove(index) {
|
|
1665
|
+
const alerts = [...this.alerts.state];
|
|
1666
|
+
alerts.splice(index, 1);
|
|
1667
|
+
this.alerts.set(alerts);
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
PageAlertService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: PageAlertService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1671
|
+
PageAlertService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: PageAlertService, providedIn: 'root' });
|
|
1672
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: PageAlertService, decorators: [{
|
|
1673
|
+
type: Injectable,
|
|
1674
|
+
args: [{ providedIn: 'root' }]
|
|
1675
|
+
}], ctorParameters: function () { return []; } });
|
|
1676
|
+
|
|
1677
|
+
class ToasterService {
|
|
1678
|
+
constructor(contentProjectionService) {
|
|
1679
|
+
this.contentProjectionService = contentProjectionService;
|
|
1680
|
+
this.toasts$ = new ReplaySubject(1);
|
|
1681
|
+
this.lastId = -1;
|
|
1682
|
+
this.toasts = [];
|
|
1683
|
+
/**
|
|
1684
|
+
* Removes the toast with given id.
|
|
1685
|
+
* @param id ID of the toast to be removed.
|
|
1686
|
+
*/
|
|
1687
|
+
this.remove = (id) => {
|
|
1688
|
+
this.toasts = this.toasts.filter(toast => toast.options?.id !== id);
|
|
1689
|
+
this.toasts$.next(this.toasts);
|
|
1690
|
+
};
|
|
1691
|
+
}
|
|
1692
|
+
setContainer() {
|
|
1693
|
+
this.containerComponentRef = this.contentProjectionService.projectContent(PROJECTION_STRATEGY.AppendComponentToBody(ToastContainerComponent, {
|
|
1694
|
+
toasts$: this.toasts$,
|
|
1695
|
+
remove: this.remove,
|
|
1696
|
+
}));
|
|
1697
|
+
this.containerComponentRef.changeDetectorRef.detectChanges();
|
|
1698
|
+
}
|
|
1699
|
+
/**
|
|
1700
|
+
* Creates an info toast with given parameters.
|
|
1701
|
+
* @param message Content of the toast
|
|
1702
|
+
* @param title Title of the toast
|
|
1703
|
+
* @param options Spesific style or structural options for individual toast
|
|
1704
|
+
*/
|
|
1705
|
+
info(message, title, options) {
|
|
1706
|
+
return this.show(message, title, 'info', options);
|
|
1707
|
+
}
|
|
1708
|
+
/**
|
|
1709
|
+
* Creates a success toast with given parameters.
|
|
1710
|
+
* @param message Content of the toast
|
|
1711
|
+
* @param title Title of the toast
|
|
1712
|
+
* @param options Spesific style or structural options for individual toast
|
|
1713
|
+
*/
|
|
1714
|
+
success(message, title, options) {
|
|
1715
|
+
return this.show(message, title, 'success', options);
|
|
1716
|
+
}
|
|
1717
|
+
/**
|
|
1718
|
+
* Creates a warning toast with given parameters.
|
|
1719
|
+
* @param message Content of the toast
|
|
1720
|
+
* @param title Title of the toast
|
|
1721
|
+
* @param options Spesific style or structural options for individual toast
|
|
1722
|
+
*/
|
|
1723
|
+
warn(message, title, options) {
|
|
1724
|
+
return this.show(message, title, 'warning', options);
|
|
1725
|
+
}
|
|
1726
|
+
/**
|
|
1727
|
+
* Creates an error toast with given parameters.
|
|
1728
|
+
* @param message Content of the toast
|
|
1729
|
+
* @param title Title of the toast
|
|
1730
|
+
* @param options Spesific style or structural options for individual toast
|
|
1731
|
+
*/
|
|
1732
|
+
error(message, title, options) {
|
|
1733
|
+
return this.show(message, title, 'error', options);
|
|
1734
|
+
}
|
|
1735
|
+
/**
|
|
1736
|
+
* Creates a toast with given parameters.
|
|
1737
|
+
* @param message Content of the toast
|
|
1738
|
+
* @param title Title of the toast
|
|
1739
|
+
* @param severity Sets color of the toast. "success", "warning" etc.
|
|
1740
|
+
* @param options Spesific style or structural options for individual toast
|
|
1741
|
+
*/
|
|
1742
|
+
show(message, title = undefined, severity = 'neutral', options = {}) {
|
|
1743
|
+
if (!this.containerComponentRef)
|
|
1744
|
+
this.setContainer();
|
|
1745
|
+
const id = ++this.lastId;
|
|
1746
|
+
this.toasts.push({
|
|
1747
|
+
message,
|
|
1748
|
+
title,
|
|
1749
|
+
severity,
|
|
1750
|
+
options: { closable: true, id, ...options },
|
|
1751
|
+
});
|
|
1752
|
+
this.toasts$.next(this.toasts);
|
|
1753
|
+
return id;
|
|
1754
|
+
}
|
|
1755
|
+
/**
|
|
1756
|
+
* Removes all open toasts at once.
|
|
1757
|
+
*/
|
|
1758
|
+
clear(containerKey) {
|
|
1759
|
+
this.toasts = !containerKey
|
|
1760
|
+
? []
|
|
1761
|
+
: this.toasts.filter(toast => toast.options?.containerKey !== containerKey);
|
|
1762
|
+
this.toasts$.next(this.toasts);
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
ToasterService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ToasterService, deps: [{ token: i2.ContentProjectionService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1766
|
+
ToasterService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ToasterService, providedIn: 'root' });
|
|
1767
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ToasterService, decorators: [{
|
|
1768
|
+
type: Injectable,
|
|
1769
|
+
args: [{
|
|
1770
|
+
providedIn: 'root',
|
|
1771
|
+
}]
|
|
1772
|
+
}], ctorParameters: function () { return [{ type: i2.ContentProjectionService }]; } });
|
|
1773
|
+
|
|
1774
|
+
class UserMenuService extends AbstractMenuService {
|
|
1775
|
+
constructor() {
|
|
1776
|
+
super(...arguments);
|
|
1777
|
+
this.baseClass = UserMenu;
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1780
|
+
UserMenuService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: UserMenuService, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
1781
|
+
UserMenuService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: UserMenuService, providedIn: 'root' });
|
|
1782
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: UserMenuService, decorators: [{
|
|
1783
|
+
type: Injectable,
|
|
1784
|
+
args: [{ providedIn: 'root' }]
|
|
1785
|
+
}] });
|
|
1786
|
+
|
|
1787
|
+
var styles = `
|
|
1788
|
+
.is-invalid .form-control {
|
|
1789
|
+
border-color: #dc3545;
|
|
1790
|
+
border-style: solid !important;
|
|
1791
|
+
padding-right: calc(1.5em + .75rem);
|
|
1792
|
+
background-image: url(data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%23dc3545' viewBox='0 0 12 12'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e);
|
|
1793
|
+
background-repeat: no-repeat;
|
|
1794
|
+
background-position: right calc(.375em + .1875rem) center;
|
|
1795
|
+
background-size: calc(.75em + .375rem) calc(.75em + .375rem);
|
|
1796
|
+
}
|
|
1797
|
+
|
|
1798
|
+
.is-invalid .invalid-feedback,
|
|
1799
|
+
.is-invalid + * .invalid-feedback {
|
|
1800
|
+
display: block;
|
|
1801
|
+
}
|
|
1802
|
+
|
|
1803
|
+
.data-tables-filter {
|
|
1804
|
+
text-align: right;
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
[dir=rtl] .data-tables-filter {
|
|
1808
|
+
text-align: left;
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
.pointer {
|
|
1812
|
+
cursor: pointer;
|
|
1813
|
+
}
|
|
1814
|
+
|
|
1815
|
+
.navbar .dropdown-submenu a::after {
|
|
1816
|
+
transform: rotate(-90deg);
|
|
1817
|
+
position: absolute;
|
|
1818
|
+
right: 16px;
|
|
1819
|
+
top: 18px;
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
.navbar .dropdown-menu {
|
|
1823
|
+
min-width: 215px;
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
.datatable-scroll {
|
|
1827
|
+
margin-bottom: 5px !important;
|
|
1828
|
+
width: unset !important;
|
|
1829
|
+
}
|
|
1830
|
+
|
|
1831
|
+
.ui-table-scrollable-body::-webkit-scrollbar {
|
|
1832
|
+
height: 5px !important;
|
|
1833
|
+
width: 5px !important;
|
|
1834
|
+
}
|
|
1835
|
+
|
|
1836
|
+
.ui-table-scrollable-body::-webkit-scrollbar-track {
|
|
1837
|
+
background: #ddd;
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
.ui-table-scrollable-body::-webkit-scrollbar-thumb {
|
|
1841
|
+
background: #8a8686;
|
|
1842
|
+
}
|
|
1843
|
+
|
|
1844
|
+
.abp-ellipsis-inline {
|
|
1845
|
+
display: inline-block;
|
|
1846
|
+
overflow: hidden;
|
|
1847
|
+
text-overflow: ellipsis;
|
|
1848
|
+
white-space: nowrap;
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1851
|
+
.abp-ellipsis {
|
|
1852
|
+
overflow: hidden !important;
|
|
1853
|
+
text-overflow: ellipsis;
|
|
1854
|
+
white-space: nowrap;
|
|
1855
|
+
}
|
|
1856
|
+
|
|
1857
|
+
.ui-widget-overlay {
|
|
1858
|
+
z-index: 1000;
|
|
1859
|
+
}
|
|
1860
|
+
|
|
1861
|
+
.color-white {
|
|
1862
|
+
color: #FFF !important;
|
|
1863
|
+
}
|
|
1864
|
+
|
|
1865
|
+
.custom-checkbox > label {
|
|
1866
|
+
cursor: pointer;
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
/* <animations */
|
|
1870
|
+
|
|
1871
|
+
.fade-in-top {
|
|
1872
|
+
animation: fadeInTop 0.2s ease-in-out;
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1875
|
+
.fade-out-top {
|
|
1876
|
+
animation: fadeOutTop 0.2s ease-in-out;
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
.abp-collapsed-height {
|
|
1880
|
+
-moz-transition: max-height linear 0.35s;
|
|
1881
|
+
-ms-transition: max-height linear 0.35s;
|
|
1882
|
+
-o-transition: max-height linear 0.35s;
|
|
1883
|
+
-webkit-transition: max-height linear 0.35s;
|
|
1884
|
+
overflow:hidden;
|
|
1885
|
+
transition:max-height 0.35s linear;
|
|
1886
|
+
height:auto;
|
|
1887
|
+
max-height: 0;
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
.abp-mh-25 {
|
|
1891
|
+
max-height: 25vh;
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
.abp-mh-50 {
|
|
1895
|
+
transition:max-height 0.65s linear;
|
|
1896
|
+
max-height: 50vh;
|
|
1897
|
+
}
|
|
1898
|
+
|
|
1899
|
+
.abp-mh-75 {
|
|
1900
|
+
transition:max-height 0.85s linear;
|
|
1901
|
+
max-height: 75vh;
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1904
|
+
.abp-mh-100 {
|
|
1905
|
+
transition:max-height 1s linear;
|
|
1906
|
+
max-height: 100vh;
|
|
1907
|
+
}
|
|
1908
|
+
|
|
1909
|
+
[class^="sorting"] {
|
|
1910
|
+
opacity: .3;
|
|
1911
|
+
cursor: pointer;
|
|
1912
|
+
}
|
|
1913
|
+
[class^="sorting"]:before {
|
|
1914
|
+
right: 0.5rem;
|
|
1915
|
+
content: "↑";
|
|
1916
|
+
}
|
|
1917
|
+
[class^="sorting"]:after {
|
|
1918
|
+
right: 0.5rem;
|
|
1919
|
+
content: "↓";
|
|
1920
|
+
}
|
|
1921
|
+
|
|
1922
|
+
.sorting_desc {
|
|
1923
|
+
opacity: 1;
|
|
1924
|
+
}
|
|
1925
|
+
.sorting_desc:before {
|
|
1926
|
+
opacity: .3;
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
.sorting_asc {
|
|
1930
|
+
opacity: 1;
|
|
1931
|
+
}
|
|
1932
|
+
.sorting_asc:after {
|
|
1933
|
+
opacity: .3;
|
|
1934
|
+
}
|
|
1935
|
+
.ngx-datatable.material {
|
|
1936
|
+
box-shadow: none;
|
|
1937
|
+
}
|
|
1938
|
+
ngb-typeahead-window, ngb-typeahead-window.dropdown-menu {
|
|
1939
|
+
max-height: 25em;
|
|
1940
|
+
overflow-y: scroll !important;
|
|
1941
|
+
z-index: 1050;
|
|
1942
|
+
}
|
|
1943
|
+
|
|
1944
|
+
@keyframes fadeInTop {
|
|
1945
|
+
from {
|
|
1946
|
+
transform: translateY(-5px);
|
|
1947
|
+
opacity: 0;
|
|
1948
|
+
}
|
|
1949
|
+
|
|
1950
|
+
to {
|
|
1951
|
+
transform: translateY(0px);
|
|
1952
|
+
opacity: 1;
|
|
1953
|
+
}
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
@keyframes fadeOutTop {
|
|
1957
|
+
to {
|
|
1958
|
+
transform: translateY(-5px);
|
|
1959
|
+
opacity: 0;
|
|
1960
|
+
}
|
|
1961
|
+
}
|
|
1962
|
+
|
|
1963
|
+
/* </animations */
|
|
1964
|
+
.ngb-dp-body {
|
|
1965
|
+
z-index: 1055 !important;
|
|
1966
|
+
}
|
|
1967
|
+
`;
|
|
1968
|
+
|
|
1969
|
+
const THEME_SHARED_APPEND_CONTENT = new InjectionToken('THEME_SHARED_APPEND_CONTENT', {
|
|
1970
|
+
providedIn: 'root',
|
|
1971
|
+
factory: () => {
|
|
1972
|
+
const domInsertion = inject(DomInsertionService);
|
|
1973
|
+
domInsertion.insertContent(CONTENT_STRATEGY.AppendStyleToHead(styles));
|
|
1974
|
+
},
|
|
1975
|
+
});
|
|
1976
|
+
|
|
1977
|
+
function isNumber(value) {
|
|
1978
|
+
return !isNaN(toInteger(value));
|
|
1979
|
+
}
|
|
1980
|
+
function toInteger(value) {
|
|
1981
|
+
return parseInt(`${value}`, 10);
|
|
1982
|
+
}
|
|
1983
|
+
class DateParserFormatter extends NgbDateParserFormatter {
|
|
1984
|
+
constructor(configState, locale) {
|
|
1985
|
+
super();
|
|
1986
|
+
this.configState = configState;
|
|
1987
|
+
this.locale = locale;
|
|
1988
|
+
}
|
|
1989
|
+
parse(value) {
|
|
1990
|
+
if (value) {
|
|
1991
|
+
const dateParts = value.trim().split('-');
|
|
1992
|
+
// TODO: CHANGED
|
|
1993
|
+
if (dateParts.length === 1 && isNumber(dateParts[0])) {
|
|
1994
|
+
return { year: toInteger(dateParts[0]), month: -1, day: -1 };
|
|
1995
|
+
}
|
|
1996
|
+
else if (dateParts.length === 2 && isNumber(dateParts[0]) && isNumber(dateParts[1])) {
|
|
1997
|
+
return { year: toInteger(dateParts[0]), month: toInteger(dateParts[1]), day: -1 };
|
|
1998
|
+
}
|
|
1999
|
+
else if (dateParts.length === 3 &&
|
|
2000
|
+
isNumber(dateParts[0]) &&
|
|
2001
|
+
isNumber(dateParts[1]) &&
|
|
2002
|
+
isNumber(dateParts[2])) {
|
|
2003
|
+
return {
|
|
2004
|
+
year: toInteger(dateParts[0]),
|
|
2005
|
+
month: toInteger(dateParts[1]),
|
|
2006
|
+
day: toInteger(dateParts[2]),
|
|
2007
|
+
};
|
|
2008
|
+
}
|
|
2009
|
+
}
|
|
2010
|
+
return null;
|
|
2011
|
+
}
|
|
2012
|
+
format(date) {
|
|
2013
|
+
if (!date)
|
|
2014
|
+
return '';
|
|
2015
|
+
const localization = this.configState.getOne('localization');
|
|
2016
|
+
const dateFormat = localization.currentCulture?.dateTimeFormat?.shortDatePattern || 'yyyy-MM-dd';
|
|
2017
|
+
return formatDate(new Date(date.year, date.month - 1, date.day), dateFormat, this.locale);
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2020
|
+
DateParserFormatter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DateParserFormatter, deps: [{ token: i2.ConfigStateService }, { token: LOCALE_ID }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
2021
|
+
DateParserFormatter.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DateParserFormatter });
|
|
2022
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: DateParserFormatter, decorators: [{
|
|
2023
|
+
type: Injectable
|
|
2024
|
+
}], ctorParameters: function () { return [{ type: i2.ConfigStateService }, { type: undefined, decorators: [{
|
|
2025
|
+
type: Inject,
|
|
2026
|
+
args: [LOCALE_ID]
|
|
2027
|
+
}] }]; } });
|
|
2028
|
+
|
|
2029
|
+
const declarationsWithExports = [
|
|
2030
|
+
BreadcrumbComponent,
|
|
2031
|
+
BreadcrumbItemsComponent,
|
|
2032
|
+
ButtonComponent,
|
|
2033
|
+
ConfirmationComponent,
|
|
2034
|
+
LoaderBarComponent,
|
|
2035
|
+
LoadingComponent,
|
|
2036
|
+
ModalComponent,
|
|
2037
|
+
ToastComponent,
|
|
2038
|
+
ToastContainerComponent,
|
|
2039
|
+
NgxDatatableDefaultDirective,
|
|
2040
|
+
NgxDatatableListDirective,
|
|
2041
|
+
LoadingDirective,
|
|
2042
|
+
ModalCloseDirective,
|
|
2043
|
+
];
|
|
2044
|
+
class BaseThemeSharedModule {
|
|
2045
|
+
}
|
|
2046
|
+
BaseThemeSharedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BaseThemeSharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2047
|
+
BaseThemeSharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BaseThemeSharedModule, declarations: [BreadcrumbComponent,
|
|
2048
|
+
BreadcrumbItemsComponent,
|
|
2049
|
+
ButtonComponent,
|
|
2050
|
+
ConfirmationComponent,
|
|
2051
|
+
LoaderBarComponent,
|
|
2052
|
+
LoadingComponent,
|
|
2053
|
+
ModalComponent,
|
|
2054
|
+
ToastComponent,
|
|
2055
|
+
ToastContainerComponent,
|
|
2056
|
+
NgxDatatableDefaultDirective,
|
|
2057
|
+
NgxDatatableListDirective,
|
|
2058
|
+
LoadingDirective,
|
|
2059
|
+
ModalCloseDirective, HttpErrorWrapperComponent], imports: [CoreModule,
|
|
2060
|
+
NgxDatatableModule,
|
|
2061
|
+
NgxValidateCoreModule,
|
|
2062
|
+
NgbPaginationModule,
|
|
2063
|
+
EllipsisModule], exports: [NgxDatatableModule, EllipsisModule, BreadcrumbComponent,
|
|
2064
|
+
BreadcrumbItemsComponent,
|
|
2065
|
+
ButtonComponent,
|
|
2066
|
+
ConfirmationComponent,
|
|
2067
|
+
LoaderBarComponent,
|
|
2068
|
+
LoadingComponent,
|
|
2069
|
+
ModalComponent,
|
|
2070
|
+
ToastComponent,
|
|
2071
|
+
ToastContainerComponent,
|
|
2072
|
+
NgxDatatableDefaultDirective,
|
|
2073
|
+
NgxDatatableListDirective,
|
|
2074
|
+
LoadingDirective,
|
|
2075
|
+
ModalCloseDirective] });
|
|
2076
|
+
BaseThemeSharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BaseThemeSharedModule, providers: [DatePipe], imports: [[
|
|
2077
|
+
CoreModule,
|
|
2078
|
+
NgxDatatableModule,
|
|
2079
|
+
NgxValidateCoreModule,
|
|
2080
|
+
NgbPaginationModule,
|
|
2081
|
+
EllipsisModule,
|
|
2082
|
+
], NgxDatatableModule, EllipsisModule] });
|
|
2083
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: BaseThemeSharedModule, decorators: [{
|
|
2084
|
+
type: NgModule,
|
|
2085
|
+
args: [{
|
|
2086
|
+
imports: [
|
|
2087
|
+
CoreModule,
|
|
2088
|
+
NgxDatatableModule,
|
|
2089
|
+
NgxValidateCoreModule,
|
|
2090
|
+
NgbPaginationModule,
|
|
2091
|
+
EllipsisModule,
|
|
2092
|
+
],
|
|
2093
|
+
declarations: [...declarationsWithExports, HttpErrorWrapperComponent],
|
|
2094
|
+
exports: [NgxDatatableModule, EllipsisModule, ...declarationsWithExports],
|
|
2095
|
+
providers: [DatePipe]
|
|
2096
|
+
}]
|
|
2097
|
+
}] });
|
|
2098
|
+
class ThemeSharedModule {
|
|
2099
|
+
static forRoot({ httpErrorConfig, validation = {} } = {}) {
|
|
2100
|
+
return {
|
|
2101
|
+
ngModule: ThemeSharedModule,
|
|
2102
|
+
providers: [
|
|
2103
|
+
{
|
|
2104
|
+
provide: APP_INITIALIZER,
|
|
2105
|
+
multi: true,
|
|
2106
|
+
deps: [ErrorHandler],
|
|
2107
|
+
useFactory: noop,
|
|
2108
|
+
},
|
|
2109
|
+
THEME_SHARED_ROUTE_PROVIDERS,
|
|
2110
|
+
{
|
|
2111
|
+
provide: APP_INITIALIZER,
|
|
2112
|
+
multi: true,
|
|
2113
|
+
deps: [THEME_SHARED_APPEND_CONTENT],
|
|
2114
|
+
useFactory: noop,
|
|
2115
|
+
},
|
|
2116
|
+
{ provide: HTTP_ERROR_CONFIG, useValue: httpErrorConfig },
|
|
2117
|
+
{
|
|
2118
|
+
provide: 'HTTP_ERROR_CONFIG',
|
|
2119
|
+
useFactory: httpErrorConfigFactory,
|
|
2120
|
+
deps: [HTTP_ERROR_CONFIG],
|
|
2121
|
+
},
|
|
2122
|
+
{ provide: NgbDateParserFormatter, useClass: DateParserFormatter },
|
|
2123
|
+
NG_BOOTSTRAP_CONFIG_PROVIDERS,
|
|
2124
|
+
{
|
|
2125
|
+
provide: VALIDATION_BLUEPRINTS,
|
|
2126
|
+
useValue: {
|
|
2127
|
+
...DEFAULT_VALIDATION_BLUEPRINTS,
|
|
2128
|
+
...(validation.blueprints || {}),
|
|
2129
|
+
},
|
|
2130
|
+
},
|
|
2131
|
+
{
|
|
2132
|
+
provide: VALIDATION_MAP_ERRORS_FN,
|
|
2133
|
+
useValue: validation.mapErrorsFn || defaultMapErrorsFn,
|
|
2134
|
+
},
|
|
2135
|
+
{
|
|
2136
|
+
provide: VALIDATION_VALIDATE_ON_SUBMIT,
|
|
2137
|
+
useValue: validation.validateOnSubmit,
|
|
2138
|
+
},
|
|
2139
|
+
DocumentDirHandlerService,
|
|
2140
|
+
{
|
|
2141
|
+
provide: APP_INITIALIZER,
|
|
2142
|
+
useFactory: noop,
|
|
2143
|
+
multi: true,
|
|
2144
|
+
deps: [DocumentDirHandlerService],
|
|
2145
|
+
},
|
|
2146
|
+
],
|
|
2147
|
+
};
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
ThemeSharedModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ThemeSharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2151
|
+
ThemeSharedModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ThemeSharedModule, imports: [BaseThemeSharedModule], exports: [BaseThemeSharedModule] });
|
|
2152
|
+
ThemeSharedModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ThemeSharedModule, imports: [[BaseThemeSharedModule], BaseThemeSharedModule] });
|
|
2153
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ThemeSharedModule, decorators: [{
|
|
2154
|
+
type: NgModule,
|
|
2155
|
+
args: [{
|
|
2156
|
+
imports: [BaseThemeSharedModule],
|
|
2157
|
+
exports: [BaseThemeSharedModule],
|
|
2158
|
+
}]
|
|
2159
|
+
}] });
|
|
2160
|
+
|
|
2161
|
+
const { minLength, maxLength } = Validators;
|
|
2162
|
+
function getPasswordValidators(injector) {
|
|
2163
|
+
const getRule = getRuleFn(injector);
|
|
2164
|
+
const passwordRulesArr = [];
|
|
2165
|
+
let requiredLength = 1;
|
|
2166
|
+
if (getRule('RequireDigit') === 'true') {
|
|
2167
|
+
passwordRulesArr.push('number');
|
|
2168
|
+
}
|
|
2169
|
+
if (getRule('RequireLowercase') === 'true') {
|
|
2170
|
+
passwordRulesArr.push('small');
|
|
2171
|
+
}
|
|
2172
|
+
if (getRule('RequireUppercase') === 'true') {
|
|
2173
|
+
passwordRulesArr.push('capital');
|
|
2174
|
+
}
|
|
2175
|
+
if (getRule('RequireNonAlphanumeric') === 'true') {
|
|
2176
|
+
passwordRulesArr.push('special');
|
|
2177
|
+
}
|
|
2178
|
+
if (Number.isInteger(+getRule('RequiredLength'))) {
|
|
2179
|
+
requiredLength = +getRule('RequiredLength');
|
|
2180
|
+
}
|
|
2181
|
+
return [validatePassword(passwordRulesArr), minLength(requiredLength), maxLength(128)];
|
|
2182
|
+
}
|
|
2183
|
+
function getRuleFn(injector) {
|
|
2184
|
+
const configState = injector.get(ConfigStateService);
|
|
2185
|
+
return (key) => {
|
|
2186
|
+
const passwordRules = configState.getSettings('Identity.Password');
|
|
2187
|
+
return (passwordRules[`Abp.Identity.Password.${key}`] || '').toLowerCase();
|
|
2188
|
+
};
|
|
2189
|
+
}
|
|
2190
|
+
|
|
2191
|
+
/*
|
|
2192
|
+
* Public API Surface of theme-shared
|
|
2193
|
+
*/
|
|
2194
|
+
|
|
2195
|
+
/**
|
|
2196
|
+
* Generated bundle index. Do not edit.
|
|
2197
|
+
*/
|
|
2198
|
+
|
|
2199
|
+
export { BaseThemeSharedModule, BreadcrumbComponent, BreadcrumbItemsComponent, ButtonComponent, Confirmation, ConfirmationComponent, ConfirmationService, DEFAULT_ERROR_LOCALIZATIONS, DEFAULT_ERROR_MESSAGES, DEFAULT_VALIDATION_BLUEPRINTS, DateParserFormatter, DocumentDirHandlerService, EllipsisDirective, EllipsisModule, ErrorHandler, HTTP_ERROR_CONFIG, HTTP_ERROR_HANDLER, HttpErrorWrapperComponent, LoaderBarComponent, LoadingComponent, LoadingDirective, ModalCloseDirective, ModalComponent, ModalRefService, NGX_DATATABLE_MESSAGES, NG_BOOTSTRAP_CONFIG_PROVIDERS, NavItem, NavItemsService, NgxDatatableDefaultDirective, NgxDatatableListDirective, PageAlertService, SUPPRESS_UNSAVED_CHANGES_WARNING, THEME_SHARED_APPEND_CONTENT, THEME_SHARED_ROUTE_PROVIDERS, ThemeSharedModule, ToastComponent, ToastContainerComponent, ToasterService, UserMenu, UserMenuService, bounceIn, collapse, collapseLinearWithMargin, collapseWithMargin, collapseX, collapseY, collapseYWithMargin, configureNgBootstrap, configureRoutes, defaultNgxDatatableMessages, dialogAnimation, expandX, expandY, expandYWithMargin, fadeAnimation, fadeIn, fadeInDown, fadeInLeft, fadeInRight, fadeInUp, fadeOut, fadeOutDown, fadeOutLeft, fadeOutRight, fadeOutUp, getPasswordValidators, httpErrorConfigFactory, slideFromBottom, toastInOut };
|
|
2200
|
+
//# sourceMappingURL=abp-ng.theme.shared.mjs.map
|