@morozeckiy/dd-lib 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/common/lib-common-button.mjs +62 -0
- package/esm2022/lib/common/lib-common-input-text.mjs +172 -0
- package/esm2022/lib/core/dialog/dialog-config.mjs +15 -0
- package/esm2022/lib/core/dialog/dialog-container.component.mjs +40 -0
- package/esm2022/lib/core/dialog/dialog-ref.mjs +19 -0
- package/esm2022/lib/core/dialog/dialog.service.mjs +106 -0
- package/esm2022/lib/core/directives/auto-height.directive.mjs +36 -0
- package/esm2022/lib/core/directives/click-outside.directive.mjs +42 -0
- package/esm2022/lib/core/directives/counter.directive.mjs +64 -0
- package/esm2022/lib/core/directives/declension.directive.mjs +40 -0
- package/esm2022/lib/core/directives/resize-textarea.directive.mjs +26 -0
- package/esm2022/lib/core/directives/triangle.directive.mjs +75 -0
- package/esm2022/lib/core/index.mjs +26 -0
- package/esm2022/lib/core/pipes/filter-tabs.pipe.mjs +31 -0
- package/esm2022/lib/core/pipes/filter.pipe.mjs +49 -0
- package/esm2022/lib/core/pipes/highlight.pipe.mjs +23 -0
- package/esm2022/lib/core/pipes/reverse.pipe.mjs +17 -0
- package/esm2022/lib/core/pipes/safe.pipe.mjs +34 -0
- package/esm2022/lib/core/services/date.service.mjs +113 -0
- package/esm2022/lib/core/services/destroy.service.mjs +15 -0
- package/esm2022/lib/core/services/fetcher.service.mjs +92 -0
- package/esm2022/lib/core/services/interceptors.service.mjs +27 -0
- package/esm2022/lib/core/services/svg-icons.service.mjs +26 -0
- package/esm2022/lib/core/services/theme-constructor.service.mjs +64 -0
- package/esm2022/lib/core/services/validators.service.mjs +73 -0
- package/esm2022/lib/core/tools.mjs +128 -0
- package/esm2022/lib/core/tooltip/tooltip.component.mjs +27 -0
- package/esm2022/lib/core/tooltip/tooltip.directive.mjs +137 -0
- package/esm2022/lib/lib-accordion/lib-accordion.component.mjs +15 -0
- package/esm2022/lib/lib-back-button/lib-back-button.component.mjs +37 -0
- package/esm2022/lib/lib-button/lib-button.component.mjs +30 -0
- package/esm2022/lib/lib-calendar/lib-calendar.component.mjs +222 -0
- package/esm2022/lib/lib-card/lib-card.component.mjs +34 -0
- package/esm2022/lib/lib-checkbox/lib-checkbox.component.mjs +66 -0
- package/esm2022/lib/lib-comment-input/lib-comment-input.component.mjs +20 -0
- package/esm2022/lib/lib-file-upload/lib-file-upload.component.mjs +34 -0
- package/esm2022/lib/lib-filter-button/lib-filter-button.component.mjs +42 -0
- package/esm2022/lib/lib-image-loader/lib-image-loader.component.mjs +14 -0
- package/esm2022/lib/lib-input/lib-input.component.mjs +55 -0
- package/esm2022/lib/lib-loader/lib-loader.component.mjs +16 -0
- package/esm2022/lib/lib-period/lib-period.component.mjs +114 -0
- package/esm2022/lib/lib-radio/lib-radio.component.mjs +76 -0
- package/esm2022/lib/lib-search-input/lib-search-input.component.mjs +91 -0
- package/esm2022/lib/lib-select/lib-select.component.mjs +137 -0
- package/esm2022/lib/lib-skeleton/lib-skeleton.component.mjs +45 -0
- package/esm2022/lib/lib-sort/lib-sort.component.mjs +44 -0
- package/esm2022/lib/lib-step/lib-step.component.mjs +19 -0
- package/esm2022/lib/lib-svg/lib-svg.component.mjs +75 -0
- package/esm2022/lib/lib-svg-icon/lib-svg-icon.component.mjs +55 -0
- package/esm2022/lib/lib-tabs-fragment/lib-tabs-fragment.component.mjs +79 -0
- package/esm2022/lib/lib-textarea/lib-textarea.component.mjs +50 -0
- package/esm2022/lib/toast/toast-base/toast-base.component.mjs +29 -0
- package/esm2022/lib/toast/toast-placeholder/toast-placeholder.component.mjs +29 -0
- package/esm2022/lib/toast/toast.service.mjs +124 -0
- package/esm2022/lib/utils/decorators.mjs +102 -0
- package/esm2022/morozeckiy-dd-lib.mjs +5 -0
- package/esm2022/public-api.mjs +35 -0
- package/fesm2022/morozeckiy-dd-lib.mjs +3004 -0
- package/fesm2022/morozeckiy-dd-lib.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/common/lib-common-button.d.ts +20 -0
- package/lib/common/lib-common-input-text.d.ts +53 -0
- package/lib/core/dialog/dialog-config.d.ts +14 -0
- package/lib/core/dialog/dialog-container.component.d.ts +18 -0
- package/lib/core/dialog/dialog-ref.d.ts +18 -0
- package/lib/core/dialog/dialog.service.d.ts +28 -0
- package/lib/core/directives/auto-height.directive.d.ts +11 -0
- package/lib/core/directives/click-outside.directive.d.ts +11 -0
- package/lib/core/directives/counter.directive.d.ts +11 -0
- package/lib/core/directives/declension.directive.d.ts +13 -0
- package/lib/core/directives/resize-textarea.directive.d.ts +10 -0
- package/lib/core/directives/triangle.directive.d.ts +16 -0
- package/lib/core/index.d.ts +20 -0
- package/lib/core/pipes/filter-tabs.pipe.d.ts +7 -0
- package/lib/core/pipes/filter.pipe.d.ts +12 -0
- package/lib/core/pipes/highlight.pipe.d.ts +7 -0
- package/lib/core/pipes/reverse.pipe.d.ts +7 -0
- package/lib/core/pipes/safe.pipe.d.ts +10 -0
- package/lib/core/services/date.service.d.ts +41 -0
- package/lib/core/services/destroy.service.d.ts +8 -0
- package/lib/core/services/fetcher.service.d.ts +29 -0
- package/lib/core/services/interceptors.service.d.ts +12 -0
- package/lib/core/services/svg-icons.service.d.ts +9 -0
- package/lib/core/services/theme-constructor.service.d.ts +27 -0
- package/lib/core/services/validators.service.d.ts +18 -0
- package/lib/core/tools.d.ts +16 -0
- package/lib/core/tooltip/tooltip.component.d.ts +12 -0
- package/lib/core/tooltip/tooltip.directive.d.ts +22 -0
- package/lib/lib-accordion/lib-accordion.component.d.ts +8 -0
- package/lib/lib-back-button/lib-back-button.component.d.ts +13 -0
- package/lib/lib-button/lib-button.component.d.ts +10 -0
- package/lib/lib-calendar/lib-calendar.component.d.ts +76 -0
- package/lib/lib-card/lib-card.component.d.ts +16 -0
- package/lib/lib-checkbox/lib-checkbox.component.d.ts +23 -0
- package/lib/lib-comment-input/lib-comment-input.component.d.ts +8 -0
- package/lib/lib-file-upload/lib-file-upload.component.d.ts +12 -0
- package/lib/lib-filter-button/lib-filter-button.component.d.ts +13 -0
- package/lib/lib-image-loader/lib-image-loader.component.d.ts +6 -0
- package/lib/lib-input/lib-input.component.d.ts +13 -0
- package/lib/lib-loader/lib-loader.component.d.ts +6 -0
- package/lib/lib-period/lib-period.component.d.ts +41 -0
- package/lib/lib-radio/lib-radio.component.d.ts +25 -0
- package/lib/lib-search-input/lib-search-input.component.d.ts +29 -0
- package/lib/lib-select/lib-select.component.d.ts +30 -0
- package/lib/lib-skeleton/lib-skeleton.component.d.ts +16 -0
- package/lib/lib-sort/lib-sort.component.d.ts +18 -0
- package/lib/lib-step/lib-step.component.d.ts +7 -0
- package/{src/lib/lib-svg/lib-svg.component.ts → lib/lib-svg/lib-svg.component.d.ts} +38 -66
- package/lib/lib-svg-icon/lib-svg-icon.component.d.ts +18 -0
- package/lib/lib-tabs-fragment/lib-tabs-fragment.component.d.ts +29 -0
- package/lib/lib-textarea/lib-textarea.component.d.ts +13 -0
- package/lib/toast/toast-base/toast-base.component.d.ts +21 -0
- package/lib/toast/toast-placeholder/toast-placeholder.component.d.ts +12 -0
- package/lib/toast/toast.service.d.ts +35 -0
- package/lib/utils/decorators.d.ts +4 -0
- package/package.json +16 -3
- package/public-api.d.ts +30 -0
- package/ekgip-dd-lib-0.0.1.tgz +0 -0
- package/ng-package.json +0 -8
- package/src/lib/common/lib-common-button.ts +0 -34
- package/src/lib/common/lib-common-input-text.ts +0 -154
- package/src/lib/core/dialog/dialog-config.ts +0 -19
- package/src/lib/core/dialog/dialog-container.component.ts +0 -38
- package/src/lib/core/dialog/dialog-ref.ts +0 -28
- package/src/lib/core/dialog/dialog.service.ts +0 -144
- package/src/lib/core/directives/auto-height.directive.ts +0 -29
- package/src/lib/core/directives/click-outside.directive.ts +0 -33
- package/src/lib/core/directives/counter.directive.ts +0 -54
- package/src/lib/core/directives/declension.directive.ts +0 -29
- package/src/lib/core/directives/resize-textarea.directive.ts +0 -16
- package/src/lib/core/directives/triangle.directive.ts +0 -56
- package/src/lib/core/index.ts +0 -27
- package/src/lib/core/pipes/filter-tabs.pipe.ts +0 -25
- package/src/lib/core/pipes/filter.pipe.ts +0 -36
- package/src/lib/core/pipes/highlight.pipe.ts +0 -17
- package/src/lib/core/pipes/reverse.pipe.ts +0 -11
- package/src/lib/core/pipes/safe.pipe.ts +0 -37
- package/src/lib/core/services/date.service.ts +0 -153
- package/src/lib/core/services/destroy.service.ts +0 -10
- package/src/lib/core/services/fetcher.service.ts +0 -109
- package/src/lib/core/services/interceptors.service.ts +0 -26
- package/src/lib/core/services/svg-icons.service.ts +0 -25
- package/src/lib/core/services/theme-constructor.service.ts +0 -68
- package/src/lib/core/services/validators.service.ts +0 -73
- package/src/lib/core/tools.ts +0 -159
- package/src/lib/core/tooltip/tooltip.component.html +0 -10
- package/src/lib/core/tooltip/tooltip.component.scss +0 -59
- package/src/lib/core/tooltip/tooltip.component.ts +0 -27
- package/src/lib/core/tooltip/tooltip.directive.ts +0 -137
- package/src/lib/core/utils.ts +0 -28
- package/src/lib/lib-accordion/lib-accordion.component.html +0 -15
- package/src/lib/lib-accordion/lib-accordion.component.scss +0 -23
- package/src/lib/lib-accordion/lib-accordion.component.ts +0 -17
- package/src/lib/lib-back-button/lib-back-button.component.html +0 -4
- package/src/lib/lib-back-button/lib-back-button.component.scss +0 -3
- package/src/lib/lib-back-button/lib-back-button.component.ts +0 -31
- package/src/lib/lib-button/lib-button.component.html +0 -30
- package/src/lib/lib-button/lib-button.component.scss +0 -89
- package/src/lib/lib-button/lib-button.component.ts +0 -33
- package/src/lib/lib-calendar/lib-calendar.component.html +0 -64
- package/src/lib/lib-calendar/lib-calendar.component.scss +0 -88
- package/src/lib/lib-calendar/lib-calendar.component.ts +0 -227
- package/src/lib/lib-card/lib-card.component.html +0 -23
- package/src/lib/lib-card/lib-card.component.scss +0 -64
- package/src/lib/lib-card/lib-card.component.ts +0 -32
- package/src/lib/lib-checkbox/lib-checkbox.component.html +0 -15
- package/src/lib/lib-checkbox/lib-checkbox.component.scss +0 -80
- package/src/lib/lib-checkbox/lib-checkbox.component.ts +0 -67
- package/src/lib/lib-comment-input/lib-comment-input.component.html +0 -32
- package/src/lib/lib-comment-input/lib-comment-input.component.scss +0 -28
- package/src/lib/lib-comment-input/lib-comment-input.component.ts +0 -20
- package/src/lib/lib-file-upload/lib-file-upload.component.html +0 -14
- package/src/lib/lib-file-upload/lib-file-upload.component.scss +0 -3
- package/src/lib/lib-file-upload/lib-file-upload.component.ts +0 -26
- package/src/lib/lib-filter-button/lib-filter-button.component.html +0 -46
- package/src/lib/lib-filter-button/lib-filter-button.component.scss +0 -62
- package/src/lib/lib-filter-button/lib-filter-button.component.ts +0 -45
- package/src/lib/lib-image-loader/lib-image-loader.component.html +0 -17
- package/src/lib/lib-image-loader/lib-image-loader.component.scss +0 -6
- package/src/lib/lib-image-loader/lib-image-loader.component.ts +0 -16
- package/src/lib/lib-input/lib-input.component.html +0 -32
- package/src/lib/lib-input/lib-input.component.scss +0 -72
- package/src/lib/lib-input/lib-input.component.ts +0 -62
- package/src/lib/lib-loader/lib-loader.component.html +0 -29
- package/src/lib/lib-loader/lib-loader.component.scss +0 -26
- package/src/lib/lib-loader/lib-loader.component.ts +0 -13
- package/src/lib/lib-period/lib-period.component.html +0 -41
- package/src/lib/lib-period/lib-period.component.scss +0 -77
- package/src/lib/lib-period/lib-period.component.ts +0 -131
- package/src/lib/lib-radio/lib-radio.component.html +0 -22
- package/src/lib/lib-radio/lib-radio.component.scss +0 -113
- package/src/lib/lib-radio/lib-radio.component.ts +0 -78
- package/src/lib/lib-search-input/lib-search-input.component.html +0 -48
- package/src/lib/lib-search-input/lib-search-input.component.scss +0 -86
- package/src/lib/lib-search-input/lib-search-input.component.ts +0 -94
- package/src/lib/lib-select/lib-select.component.html +0 -83
- package/src/lib/lib-select/lib-select.component.scss +0 -130
- package/src/lib/lib-select/lib-select.component.ts +0 -152
- package/src/lib/lib-skeleton/lib-skeleton.component.html +0 -11
- package/src/lib/lib-skeleton/lib-skeleton.component.scss +0 -36
- package/src/lib/lib-skeleton/lib-skeleton.component.ts +0 -41
- package/src/lib/lib-sort/lib-sort.component.html +0 -21
- package/src/lib/lib-sort/lib-sort.component.scss +0 -21
- package/src/lib/lib-sort/lib-sort.component.ts +0 -52
- package/src/lib/lib-step/lib-step.component.html +0 -4
- package/src/lib/lib-step/lib-step.component.scss +0 -23
- package/src/lib/lib-step/lib-step.component.ts +0 -14
- package/src/lib/lib-svg/lib-svg.component.html +0 -15
- package/src/lib/lib-svg/lib-svg.component.scss +0 -81
- package/src/lib/lib-svg-icon/lib-svg-icon.component.css +0 -0
- package/src/lib/lib-svg-icon/lib-svg-icon.component.ts +0 -58
- package/src/lib/lib-tabs-fragment/lib-tabs-fragment.component.html +0 -12
- package/src/lib/lib-tabs-fragment/lib-tabs-fragment.component.scss +0 -19
- package/src/lib/lib-tabs-fragment/lib-tabs-fragment.component.ts +0 -88
- package/src/lib/lib-textarea/lib-textarea.component.html +0 -37
- package/src/lib/lib-textarea/lib-textarea.component.scss +0 -77
- package/src/lib/lib-textarea/lib-textarea.component.ts +0 -49
- package/src/lib/toast/toast-base/toast-base.component.html +0 -7
- package/src/lib/toast/toast-base/toast-base.component.scss +0 -44
- package/src/lib/toast/toast-base/toast-base.component.ts +0 -38
- package/src/lib/toast/toast-placeholder/toast-placeholder.component.ts +0 -20
- package/src/lib/toast/toast.service.ts +0 -130
- package/src/lib/utils/decorators.ts +0 -124
- package/src/public-api.ts +0 -35
- package/tsconfig.lib.json +0 -14
- package/tsconfig.lib.prod.json +0 -10
- package/tsconfig.spec.json +0 -14
|
@@ -0,0 +1,3004 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, Component, Input, ViewChild, Output, forwardRef, ChangeDetectionStrategy, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA, Injectable, Inject, Pipe, Directive, HostListener, InjectionToken, TemplateRef, Injector, Optional, Host, SkipSelf, ViewContainerRef } from '@angular/core';
|
|
3
|
+
import * as i1$5 from '@angular/forms';
|
|
4
|
+
import { NG_VALUE_ACCESSOR, FormsModule, Validators, ReactiveFormsModule } from '@angular/forms';
|
|
5
|
+
import * as i1 from '@angular/common';
|
|
6
|
+
import { CommonModule, DecimalPipe, DOCUMENT, NgOptimizedImage, NgTemplateOutlet, NgIf } from '@angular/common';
|
|
7
|
+
import { BehaviorSubject, Subject, of, fromEvent, combineLatest } from 'rxjs';
|
|
8
|
+
import { format, parse } from 'date-fns';
|
|
9
|
+
import * as i1$2 from '@angular/common/http';
|
|
10
|
+
import { HttpErrorResponse, HttpParams, HttpHeaders } from '@angular/common/http';
|
|
11
|
+
import { catchError, switchMap, filter, takeUntil, map, debounceTime, mergeMap, delay } from 'rxjs/operators';
|
|
12
|
+
import * as i1$1 from '@angular/router';
|
|
13
|
+
import { isArray } from '@angular/compiler-cli/src/ngtsc/annotations/common';
|
|
14
|
+
import * as i1$3 from '@angular/platform-browser';
|
|
15
|
+
import { ComponentPortal, CdkPortalOutlet, PortalInjector, TemplatePortal } from '@angular/cdk/portal';
|
|
16
|
+
import * as i1$4 from '@angular/cdk/overlay';
|
|
17
|
+
import { GlobalPositionStrategy } from '@angular/cdk/overlay';
|
|
18
|
+
import * as i2 from '@angular/cdk/a11y';
|
|
19
|
+
|
|
20
|
+
class LibCommonButtonComponent {
|
|
21
|
+
constructor() {
|
|
22
|
+
this.size = '';
|
|
23
|
+
this.autofocus = false;
|
|
24
|
+
this.btnColor = 'green';
|
|
25
|
+
this.active = false;
|
|
26
|
+
this.disabled = false;
|
|
27
|
+
this.showLoader = false;
|
|
28
|
+
this.buttonType = 'button';
|
|
29
|
+
this.clickEvent = new EventEmitter();
|
|
30
|
+
}
|
|
31
|
+
onClick(event) {
|
|
32
|
+
if (this.disabled || this.showLoader || this.active) {
|
|
33
|
+
event.stopPropagation();
|
|
34
|
+
event.preventDefault();
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
this.clickEvent.emit();
|
|
38
|
+
const el = document.activeElement;
|
|
39
|
+
el?.blur();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibCommonButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
43
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LibCommonButtonComponent, selector: "ng-component", inputs: { width: "width", height: "height", size: "size", fontSize: "fontSize", autofocus: "autofocus", btnColor: "btnColor", active: "active", disabled: "disabled", showLoader: "showLoader", buttonType: "buttonType" }, outputs: { clickEvent: "clickEvent" }, viewQueries: [{ propertyName: "content", first: true, predicate: ["contentData"], descendants: true }, { propertyName: "button", first: true, predicate: ["btn"], descendants: true }], ngImport: i0, template: '', isInline: true }); }
|
|
44
|
+
}
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibCommonButtonComponent, decorators: [{
|
|
46
|
+
type: Component,
|
|
47
|
+
args: [{
|
|
48
|
+
template: '',
|
|
49
|
+
}]
|
|
50
|
+
}], propDecorators: { width: [{
|
|
51
|
+
type: Input
|
|
52
|
+
}], height: [{
|
|
53
|
+
type: Input
|
|
54
|
+
}], size: [{
|
|
55
|
+
type: Input
|
|
56
|
+
}], fontSize: [{
|
|
57
|
+
type: Input
|
|
58
|
+
}], autofocus: [{
|
|
59
|
+
type: Input
|
|
60
|
+
}], btnColor: [{
|
|
61
|
+
type: Input
|
|
62
|
+
}], active: [{
|
|
63
|
+
type: Input
|
|
64
|
+
}], disabled: [{
|
|
65
|
+
type: Input
|
|
66
|
+
}], showLoader: [{
|
|
67
|
+
type: Input
|
|
68
|
+
}], buttonType: [{
|
|
69
|
+
type: Input
|
|
70
|
+
}], content: [{
|
|
71
|
+
type: ViewChild,
|
|
72
|
+
args: ['contentData', { static: false }]
|
|
73
|
+
}], button: [{
|
|
74
|
+
type: ViewChild,
|
|
75
|
+
args: ['btn', { static: false }]
|
|
76
|
+
}], clickEvent: [{
|
|
77
|
+
type: Output
|
|
78
|
+
}] } });
|
|
79
|
+
|
|
80
|
+
class LibCommonInputTextComponent {
|
|
81
|
+
get id() {
|
|
82
|
+
return this._ID;
|
|
83
|
+
}
|
|
84
|
+
constructor(changeDetection) {
|
|
85
|
+
this.maxlength = 700;
|
|
86
|
+
this.required = false;
|
|
87
|
+
this.disabled = false;
|
|
88
|
+
this.commitOnInput = true; // коммитить по input или по change
|
|
89
|
+
this.clearable = false;
|
|
90
|
+
this.uppercase = false;
|
|
91
|
+
this.invalid = false;
|
|
92
|
+
this.cleared = new EventEmitter();
|
|
93
|
+
this.focus = new EventEmitter();
|
|
94
|
+
this.blur = new EventEmitter();
|
|
95
|
+
this.focused = false;
|
|
96
|
+
this.touched = false;
|
|
97
|
+
this.value = '';
|
|
98
|
+
this.destroyed = false;
|
|
99
|
+
this._ID = '';
|
|
100
|
+
this.changeDetection = changeDetection;
|
|
101
|
+
}
|
|
102
|
+
handleInput(_e) {
|
|
103
|
+
if (this.commitOnInput) {
|
|
104
|
+
this.commit(this.value);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
notifyFocusEvent(e) {
|
|
108
|
+
// this.focusManager.notifyFocusMayChanged(this, e.type === 'focus');
|
|
109
|
+
}
|
|
110
|
+
// public writeValue(value: string | number | null): void {
|
|
111
|
+
// this.value = value === null || value === undefined ? '' : '' + value;
|
|
112
|
+
// if (!this.destroyed) {
|
|
113
|
+
// this.changeDetection.detectChanges();
|
|
114
|
+
// }
|
|
115
|
+
// }
|
|
116
|
+
// public clearValue(e: Event): void {
|
|
117
|
+
// if (!this.disabled) {
|
|
118
|
+
// this.writeValue(null);
|
|
119
|
+
// this.commit(null);
|
|
120
|
+
// this.cleared.emit();
|
|
121
|
+
// this.returnFocus(e);
|
|
122
|
+
// }
|
|
123
|
+
// e.stopPropagation();
|
|
124
|
+
// }
|
|
125
|
+
handleBlur() {
|
|
126
|
+
this.focused = false;
|
|
127
|
+
if (this.onTouchedCallback) {
|
|
128
|
+
this.onTouchedCallback();
|
|
129
|
+
}
|
|
130
|
+
this.blur.emit();
|
|
131
|
+
this.changeDetection.detectChanges();
|
|
132
|
+
}
|
|
133
|
+
handleFocus() {
|
|
134
|
+
this.focused = this.touched = true;
|
|
135
|
+
if (this.onTouchedCallback) {
|
|
136
|
+
this.onTouchedCallback();
|
|
137
|
+
}
|
|
138
|
+
this.focus.emit();
|
|
139
|
+
}
|
|
140
|
+
returnFocus(e) {
|
|
141
|
+
if (this.inputElement &&
|
|
142
|
+
this.inputElement.nativeElement &&
|
|
143
|
+
(!e || e.target !== this.inputElement.nativeElement)) {
|
|
144
|
+
this.inputElement.nativeElement.focus();
|
|
145
|
+
// HelperService.resetSelection(this.inputElement.nativeElement);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
loseFocus() {
|
|
149
|
+
this.inputElement?.nativeElement.blur();
|
|
150
|
+
}
|
|
151
|
+
forceChange() {
|
|
152
|
+
if (this.inputElement) {
|
|
153
|
+
// this.inputElement.nativeElement.dispatchEvent(HelperService.createEvent('change', true, false));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
registerOnChange(fn) {
|
|
157
|
+
this.commit = fn;
|
|
158
|
+
}
|
|
159
|
+
registerOnTouched(fn) {
|
|
160
|
+
this.onTouchedCallback = fn;
|
|
161
|
+
}
|
|
162
|
+
setDisabledState(isDisabled) {
|
|
163
|
+
this.disabled = isDisabled;
|
|
164
|
+
if (!this.destroyed) {
|
|
165
|
+
this.changeDetection.detectChanges();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
handleChange() {
|
|
169
|
+
if (!this.commitOnInput) {
|
|
170
|
+
this.commit(this.value);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
commit(_value) { }
|
|
174
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibCommonInputTextComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
175
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LibCommonInputTextComponent, selector: "dd-lib-common-input", inputs: { name: "name", label: "label", formControlName: "formControlName", type: "type", contextClass: "contextClass", minlength: "minlength", maxlength: "maxlength", placeholder: "placeholder", autocomplete: "autocomplete", tabIndex: "tabIndex", readOnly: "readOnly", required: "required", disabled: "disabled", commitOnInput: "commitOnInput", clearable: "clearable", uppercase: "uppercase", invalid: "invalid", errorText: "errorText" }, outputs: { cleared: "cleared", focus: "focus", blur: "blur" }, providers: [
|
|
176
|
+
{
|
|
177
|
+
provide: NG_VALUE_ACCESSOR,
|
|
178
|
+
useExisting: forwardRef(() => LibCommonInputTextComponent),
|
|
179
|
+
multi: true,
|
|
180
|
+
},
|
|
181
|
+
], viewQueries: [{ propertyName: "inputSearchElement", first: true, predicate: ["searchInput"], descendants: true }, { propertyName: "inputElement", first: true, predicate: ["input"], descendants: true }, { propertyName: "textAreaElement", first: true, predicate: ["textarea"], descendants: true }], ngImport: i0, template: '', isInline: true }); }
|
|
182
|
+
}
|
|
183
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibCommonInputTextComponent, decorators: [{
|
|
184
|
+
type: Component,
|
|
185
|
+
args: [{
|
|
186
|
+
selector: 'dd-lib-common-input',
|
|
187
|
+
template: '',
|
|
188
|
+
providers: [
|
|
189
|
+
{
|
|
190
|
+
provide: NG_VALUE_ACCESSOR,
|
|
191
|
+
useExisting: forwardRef(() => LibCommonInputTextComponent),
|
|
192
|
+
multi: true,
|
|
193
|
+
},
|
|
194
|
+
],
|
|
195
|
+
}]
|
|
196
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { inputSearchElement: [{
|
|
197
|
+
type: ViewChild,
|
|
198
|
+
args: ['searchInput']
|
|
199
|
+
}], inputElement: [{
|
|
200
|
+
type: ViewChild,
|
|
201
|
+
args: ['input']
|
|
202
|
+
}], textAreaElement: [{
|
|
203
|
+
type: ViewChild,
|
|
204
|
+
args: ['textarea']
|
|
205
|
+
}], name: [{
|
|
206
|
+
type: Input
|
|
207
|
+
}], label: [{
|
|
208
|
+
type: Input
|
|
209
|
+
}], formControlName: [{
|
|
210
|
+
type: Input
|
|
211
|
+
}], type: [{
|
|
212
|
+
type: Input
|
|
213
|
+
}], contextClass: [{
|
|
214
|
+
type: Input
|
|
215
|
+
}], minlength: [{
|
|
216
|
+
type: Input
|
|
217
|
+
}], maxlength: [{
|
|
218
|
+
type: Input
|
|
219
|
+
}], placeholder: [{
|
|
220
|
+
type: Input
|
|
221
|
+
}], autocomplete: [{
|
|
222
|
+
type: Input
|
|
223
|
+
}], tabIndex: [{
|
|
224
|
+
type: Input
|
|
225
|
+
}], readOnly: [{
|
|
226
|
+
type: Input
|
|
227
|
+
}], required: [{
|
|
228
|
+
type: Input
|
|
229
|
+
}], disabled: [{
|
|
230
|
+
type: Input
|
|
231
|
+
}], commitOnInput: [{
|
|
232
|
+
type: Input
|
|
233
|
+
}], clearable: [{
|
|
234
|
+
type: Input
|
|
235
|
+
}], uppercase: [{
|
|
236
|
+
type: Input
|
|
237
|
+
}], invalid: [{
|
|
238
|
+
type: Input
|
|
239
|
+
}], errorText: [{
|
|
240
|
+
type: Input
|
|
241
|
+
}], cleared: [{
|
|
242
|
+
type: Output
|
|
243
|
+
}], focus: [{
|
|
244
|
+
type: Output
|
|
245
|
+
}], blur: [{
|
|
246
|
+
type: Output
|
|
247
|
+
}] } });
|
|
248
|
+
|
|
249
|
+
class LibLoaderComponent {
|
|
250
|
+
constructor() {
|
|
251
|
+
this.color = '#07b700';
|
|
252
|
+
}
|
|
253
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
254
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LibLoaderComponent, isStandalone: true, selector: "dd-lib-loader", inputs: { color: "color" }, ngImport: i0, template: "<div class=\"loader\">\n <svg fill=\"none\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_728_22764)\">\n <path\n [attr.stroke]=\"color\"\n d=\"M12 6V3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.7\" />\n <path\n [attr.stroke]=\"color\"\n d=\"M6 12H3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\" />\n <path\n [attr.stroke]=\"color\"\n d=\"M7.74961 7.74961L5.59961 5.59961\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\" />\n </g>\n <defs>\n <clipPath id=\"clip0_728_22764\">\n <rect fill=\"white\" height=\"24\" width=\"24\" />\n </clipPath>\n </defs>\n </svg>\n</div>\n", styles: [":host{display:flex;align-items:center;width:100%;justify-content:center;overflow:hidden}.loader{width:24px;height:24px}.loader svg{animation:rotate 1.5s linear infinite}@keyframes rotate{to{transform:rotate(360deg)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
255
|
+
}
|
|
256
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibLoaderComponent, decorators: [{
|
|
257
|
+
type: Component,
|
|
258
|
+
args: [{ selector: 'dd-lib-loader', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"loader\">\n <svg fill=\"none\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_728_22764)\">\n <path\n [attr.stroke]=\"color\"\n d=\"M12 6V3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.7\" />\n <path\n [attr.stroke]=\"color\"\n d=\"M6 12H3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\" />\n <path\n [attr.stroke]=\"color\"\n d=\"M7.74961 7.74961L5.59961 5.59961\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"2\" />\n </g>\n <defs>\n <clipPath id=\"clip0_728_22764\">\n <rect fill=\"white\" height=\"24\" width=\"24\" />\n </clipPath>\n </defs>\n </svg>\n</div>\n", styles: [":host{display:flex;align-items:center;width:100%;justify-content:center;overflow:hidden}.loader{width:24px;height:24px}.loader svg{animation:rotate 1.5s linear infinite}@keyframes rotate{to{transform:rotate(360deg)}}\n"] }]
|
|
259
|
+
}], propDecorators: { color: [{
|
|
260
|
+
type: Input
|
|
261
|
+
}] } });
|
|
262
|
+
|
|
263
|
+
class LibButtonComponent extends LibCommonButtonComponent {
|
|
264
|
+
constructor() {
|
|
265
|
+
super(...arguments);
|
|
266
|
+
this.loaderColor = this.btnColor === 'green' ? '#fff' : '';
|
|
267
|
+
}
|
|
268
|
+
ngAfterViewInit() {
|
|
269
|
+
const btn = this.button?.nativeElement;
|
|
270
|
+
if (btn && btn.attributes?.autofocus) {
|
|
271
|
+
btn.focus();
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
275
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: LibButtonComponent, isStandalone: true, selector: "dd-lib-button", inputs: { noPadding: "noPadding", loaderColor: "loaderColor" }, usesInheritance: true, ngImport: i0, template: "<div (click)=\"onClick($event)\" [ngStyle]=\"{width, height}\" class=\"button-container\">\r\n <button\r\n #btn\r\n [attr.tabIndex]=\"disabled ? -1 : 0\"\r\n [autofocus]=\"autofocus\"\r\n [class.active]=\"active\"\r\n [class.disabled]=\"disabled\"\r\n [class.green]=\"btnColor === 'green'\"\r\n [class.loader]=\"showLoader\"\r\n [class.no-padding]=\"noPadding\"\r\n [class.red]=\"btnColor === 'red'\"\r\n [class.transparent]=\"btnColor === 'transparent'\"\r\n [class.white]=\"btnColor === 'white'\"\r\n [class.dark]=\"btnColor === 'dark'\"\r\n [disabled]=\"disabled\"\r\n [ngStyle]=\"{width, height}\"\r\n [type]=\"buttonType\"\r\n class=\"\"\r\n role=\"button\">\r\n @if (!showLoader) {\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n } @if (showLoader) {\r\n <dd-lib-loader [color]=\"loaderColor\"></dd-lib-loader>\r\n }\r\n </button>\r\n</div>\r\n\r\n<ng-template #content>\r\n <span #contentData><ng-content></ng-content></span>\r\n</ng-template>\r\n", styles: [".button-container{display:inline-block}.button-container button{display:flex;align-items:center;justify-content:center;height:var(--btn-height);padding:var(--btn-padding);font-size:14px;line-height:24px;font-weight:var(--font-wheit-big);border-radius:var(--btn-border-radius);outline:none;cursor:pointer;white-space:nowrap;border:none;background-color:var(--btn-green-bgc);color:#fff}.button-container button:hover,.button-container button:focus{background-color:var(--btn-green-hover)}.button-container button:active,.button-container button.active{background-color:var(--btn-green-hover)}.button-container button.disabled{color:var(--disabled-color);background-color:var(--btn-disabled-bgc);pointer-events:none;cursor:default}.button-container button.loader{min-width:100px}.button-container button.white{background-color:var(--btn-light-green-bgc);color:var(--btn-white-color)}.button-container button.white:hover{color:var(--btn-white-hover-color)}.button-container button.transparent{background-color:transparent;color:var(--btn-white-color);border:none}.button-container button.transparent:hover{color:var(--btn-white-hover-color)}.button-container button.red{background-color:var(--btn-red-bgc);color:var(--btn-red-color)}.button-container button.red:hover{color:var(--btn-red-hover-color)}.button-container button.dark{background-color:var(--btn-dark-bgc);color:var(--btn-dark-color)}.button-container button.dark:hover{background-color:var(--btn-dark-hover-color)}.button-container button.no-padding{padding:0}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: LibLoaderComponent, selector: "dd-lib-loader", inputs: ["color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
276
|
+
}
|
|
277
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibButtonComponent, decorators: [{
|
|
278
|
+
type: Component,
|
|
279
|
+
args: [{ selector: 'dd-lib-button', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, FormsModule, LibLoaderComponent], schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], template: "<div (click)=\"onClick($event)\" [ngStyle]=\"{width, height}\" class=\"button-container\">\r\n <button\r\n #btn\r\n [attr.tabIndex]=\"disabled ? -1 : 0\"\r\n [autofocus]=\"autofocus\"\r\n [class.active]=\"active\"\r\n [class.disabled]=\"disabled\"\r\n [class.green]=\"btnColor === 'green'\"\r\n [class.loader]=\"showLoader\"\r\n [class.no-padding]=\"noPadding\"\r\n [class.red]=\"btnColor === 'red'\"\r\n [class.transparent]=\"btnColor === 'transparent'\"\r\n [class.white]=\"btnColor === 'white'\"\r\n [class.dark]=\"btnColor === 'dark'\"\r\n [disabled]=\"disabled\"\r\n [ngStyle]=\"{width, height}\"\r\n [type]=\"buttonType\"\r\n class=\"\"\r\n role=\"button\">\r\n @if (!showLoader) {\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n } @if (showLoader) {\r\n <dd-lib-loader [color]=\"loaderColor\"></dd-lib-loader>\r\n }\r\n </button>\r\n</div>\r\n\r\n<ng-template #content>\r\n <span #contentData><ng-content></ng-content></span>\r\n</ng-template>\r\n", styles: [".button-container{display:inline-block}.button-container button{display:flex;align-items:center;justify-content:center;height:var(--btn-height);padding:var(--btn-padding);font-size:14px;line-height:24px;font-weight:var(--font-wheit-big);border-radius:var(--btn-border-radius);outline:none;cursor:pointer;white-space:nowrap;border:none;background-color:var(--btn-green-bgc);color:#fff}.button-container button:hover,.button-container button:focus{background-color:var(--btn-green-hover)}.button-container button:active,.button-container button.active{background-color:var(--btn-green-hover)}.button-container button.disabled{color:var(--disabled-color);background-color:var(--btn-disabled-bgc);pointer-events:none;cursor:default}.button-container button.loader{min-width:100px}.button-container button.white{background-color:var(--btn-light-green-bgc);color:var(--btn-white-color)}.button-container button.white:hover{color:var(--btn-white-hover-color)}.button-container button.transparent{background-color:transparent;color:var(--btn-white-color);border:none}.button-container button.transparent:hover{color:var(--btn-white-hover-color)}.button-container button.red{background-color:var(--btn-red-bgc);color:var(--btn-red-color)}.button-container button.red:hover{color:var(--btn-red-hover-color)}.button-container button.dark{background-color:var(--btn-dark-bgc);color:var(--btn-dark-color)}.button-container button.dark:hover{background-color:var(--btn-dark-hover-color)}.button-container button.no-padding{padding:0}\n"] }]
|
|
280
|
+
}], propDecorators: { noPadding: [{
|
|
281
|
+
type: Input
|
|
282
|
+
}], loaderColor: [{
|
|
283
|
+
type: Input
|
|
284
|
+
}] } });
|
|
285
|
+
|
|
286
|
+
class ThemeConstructorService {
|
|
287
|
+
get getTheme() {
|
|
288
|
+
return this.themeConfigurator.theme;
|
|
289
|
+
}
|
|
290
|
+
constructor(rendererFactory) {
|
|
291
|
+
this.rendererFactory = rendererFactory;
|
|
292
|
+
this.renderer = rendererFactory.createRenderer(null, null);
|
|
293
|
+
}
|
|
294
|
+
setThemeConfiguratorRoot(document) {
|
|
295
|
+
this.themeConfigurator = new ThemeConfigurator(document, this.renderer);
|
|
296
|
+
this.isDarkTheme = this.themeConfigurator.isDarkThemeObservable;
|
|
297
|
+
}
|
|
298
|
+
changeTheme(darkMode) {
|
|
299
|
+
this.themeConfigurator.setTheme(darkMode);
|
|
300
|
+
}
|
|
301
|
+
switchTheme() {
|
|
302
|
+
this.themeConfigurator.switchTheme();
|
|
303
|
+
}
|
|
304
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ThemeConstructorService, deps: [{ token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
305
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ThemeConstructorService, providedIn: 'root' }); }
|
|
306
|
+
}
|
|
307
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ThemeConstructorService, decorators: [{
|
|
308
|
+
type: Injectable,
|
|
309
|
+
args: [{
|
|
310
|
+
providedIn: 'root',
|
|
311
|
+
}]
|
|
312
|
+
}], ctorParameters: () => [{ type: i0.RendererFactory2 }] });
|
|
313
|
+
class ThemeConfigurator {
|
|
314
|
+
set theme(value) {
|
|
315
|
+
localStorage.setItem('theme', value.toString());
|
|
316
|
+
this.isDarkTheme$.next(value);
|
|
317
|
+
}
|
|
318
|
+
get theme() {
|
|
319
|
+
return this.isDarkTheme$.getValue();
|
|
320
|
+
}
|
|
321
|
+
constructor(document, renderer) {
|
|
322
|
+
this.document = document;
|
|
323
|
+
this.renderer = renderer;
|
|
324
|
+
this.isDarkTheme$ = new BehaviorSubject(false);
|
|
325
|
+
this.isDarkThemeObservable = this.isDarkTheme$.asObservable();
|
|
326
|
+
this.isDarkThemeObservable.subscribe(ref => this.setTheme(ref));
|
|
327
|
+
const theme = localStorage.getItem('theme');
|
|
328
|
+
if (!theme) {
|
|
329
|
+
this.theme = false;
|
|
330
|
+
}
|
|
331
|
+
else {
|
|
332
|
+
this.theme = localStorage.getItem('theme') !== 'false';
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
switchTheme() {
|
|
336
|
+
this.theme = !this.theme;
|
|
337
|
+
}
|
|
338
|
+
setTheme(isDarkMode) {
|
|
339
|
+
if (!this.document) {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
const hostClass = isDarkMode ? 'theme-dark' : 'theme-light';
|
|
343
|
+
this.renderer.setAttribute(this.document.body, 'class', hostClass);
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
const DEFAULT_FORMAT = 'yyyy-MM-dd';
|
|
348
|
+
const DEFAULT_COMMON_DATE_DATA = {
|
|
349
|
+
active: false,
|
|
350
|
+
visible: ['all'],
|
|
351
|
+
};
|
|
352
|
+
class DateService {
|
|
353
|
+
constructor() {
|
|
354
|
+
this.commonDateDataBy = {
|
|
355
|
+
day: {
|
|
356
|
+
...DEFAULT_COMMON_DATE_DATA,
|
|
357
|
+
title: 'за день',
|
|
358
|
+
name: 'day',
|
|
359
|
+
},
|
|
360
|
+
week: {
|
|
361
|
+
...DEFAULT_COMMON_DATE_DATA,
|
|
362
|
+
title: 'за неделю',
|
|
363
|
+
name: 'week',
|
|
364
|
+
},
|
|
365
|
+
month: {
|
|
366
|
+
...DEFAULT_COMMON_DATE_DATA,
|
|
367
|
+
title: 'за месяц',
|
|
368
|
+
name: 'month',
|
|
369
|
+
},
|
|
370
|
+
month_3: {
|
|
371
|
+
...DEFAULT_COMMON_DATE_DATA,
|
|
372
|
+
title: 'за 3 месяца',
|
|
373
|
+
name: 'month_3',
|
|
374
|
+
},
|
|
375
|
+
half_year: {
|
|
376
|
+
...DEFAULT_COMMON_DATE_DATA,
|
|
377
|
+
title: 'за полгода',
|
|
378
|
+
name: 'half_year',
|
|
379
|
+
},
|
|
380
|
+
year: {
|
|
381
|
+
...DEFAULT_COMMON_DATE_DATA,
|
|
382
|
+
title: 'за год',
|
|
383
|
+
name: 'year',
|
|
384
|
+
},
|
|
385
|
+
calendar: {
|
|
386
|
+
active: false,
|
|
387
|
+
visible: [],
|
|
388
|
+
name: 'calendar',
|
|
389
|
+
title: '',
|
|
390
|
+
},
|
|
391
|
+
};
|
|
392
|
+
this.getDateBy = {
|
|
393
|
+
day: () => new Date(new Date().setDate(new Date().getDate() - 1)),
|
|
394
|
+
week: () => new Date(new Date().setDate(new Date().getDate() - 7)),
|
|
395
|
+
month: () => new Date(new Date().setMonth(new Date().getMonth() - 1)),
|
|
396
|
+
month_3: () => new Date(new Date().setMonth(new Date().getMonth() - 3)),
|
|
397
|
+
half_year: () => new Date(new Date().setMonth(new Date().getMonth() - 6)),
|
|
398
|
+
year: () => new Date(new Date().setFullYear(new Date().getFullYear() - 1)),
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
getFormattedDate(dateType, f = DEFAULT_FORMAT) {
|
|
402
|
+
const date = this.getDateBy[dateType] || this.getDateBy.day;
|
|
403
|
+
return format(date(), f);
|
|
404
|
+
}
|
|
405
|
+
getPeriodMenuDate(dateType, f) {
|
|
406
|
+
return {
|
|
407
|
+
time: this.getFormattedDate(dateType, f),
|
|
408
|
+
...this.commonDateDataBy[dateType],
|
|
409
|
+
};
|
|
410
|
+
}
|
|
411
|
+
getPeriodMenuDateRange(dateTypes, f) {
|
|
412
|
+
return dateTypes.map(dateType => this.getPeriodMenuDate(dateType, f));
|
|
413
|
+
}
|
|
414
|
+
getPeriodTime(name) {
|
|
415
|
+
const period = this.getPeriodMenu();
|
|
416
|
+
return period.find(p => p.name === name) || period[0];
|
|
417
|
+
}
|
|
418
|
+
getPeriodMenu(activePeriodName = 'month') {
|
|
419
|
+
const arr = ['day', 'week', 'month', 'month_3', 'half_year', 'year'];
|
|
420
|
+
const periodMenus = this.getPeriodMenuDateRange(arr);
|
|
421
|
+
const activePeriod = periodMenus.find(p => p.name === activePeriodName) || periodMenus[0];
|
|
422
|
+
activePeriod.active = true;
|
|
423
|
+
return periodMenus;
|
|
424
|
+
}
|
|
425
|
+
getDaysInMonth(month, year) {
|
|
426
|
+
const date = new Date(year, month, 1);
|
|
427
|
+
const datePrev = new Date(year, month, 0);
|
|
428
|
+
const days = [];
|
|
429
|
+
const prevDays = [];
|
|
430
|
+
while (date.getMonth() === month) {
|
|
431
|
+
days.push(date.getDay());
|
|
432
|
+
date.setDate(date.getDate() + 1);
|
|
433
|
+
}
|
|
434
|
+
const needFirstDays = days[0] === 1 ? 0 : days[0] === 0 ? 6 : days[0] - 1;
|
|
435
|
+
const firstDays = [...Array(needFirstDays)].map(() => 0);
|
|
436
|
+
const m = month === 0 ? 12 : month;
|
|
437
|
+
while (datePrev.getMonth() === m - 1 && firstDays.length !== prevDays.length) {
|
|
438
|
+
prevDays.push(datePrev.getDate());
|
|
439
|
+
datePrev.setDate(datePrev.getDate() - 1);
|
|
440
|
+
}
|
|
441
|
+
const needLastDays = days[days.length - 1] === 0 ? 0 : 7 - days[days.length - 1];
|
|
442
|
+
const lastDays = [...Array(needLastDays)].map((_d, i) => ++i);
|
|
443
|
+
return {
|
|
444
|
+
prevDays: prevDays.reverse(),
|
|
445
|
+
days: days.map((_d, i) => ++i),
|
|
446
|
+
lastDays,
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DateService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
450
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DateService, providedIn: 'root' }); }
|
|
451
|
+
}
|
|
452
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DateService, decorators: [{
|
|
453
|
+
type: Injectable,
|
|
454
|
+
args: [{ providedIn: 'root' }]
|
|
455
|
+
}] });
|
|
456
|
+
|
|
457
|
+
class SvgIconsService {
|
|
458
|
+
constructor() {
|
|
459
|
+
this.registry = new Map();
|
|
460
|
+
}
|
|
461
|
+
registerIcons(icons) {
|
|
462
|
+
icons.forEach((icon) => this.registry.set(icon.name, icon.data));
|
|
463
|
+
}
|
|
464
|
+
getIcon(iconName) {
|
|
465
|
+
if (!this.registry.has(iconName)) {
|
|
466
|
+
// eslint-disable-next-line no-console
|
|
467
|
+
console.warn(`We could not find the icon with name ${iconName}, did you add it to the icon registry?`);
|
|
468
|
+
}
|
|
469
|
+
return this.registry.get(iconName);
|
|
470
|
+
}
|
|
471
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SvgIconsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
472
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SvgIconsService, providedIn: 'root' }); }
|
|
473
|
+
}
|
|
474
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SvgIconsService, decorators: [{
|
|
475
|
+
type: Injectable,
|
|
476
|
+
args: [{
|
|
477
|
+
providedIn: 'root'
|
|
478
|
+
}]
|
|
479
|
+
}] });
|
|
480
|
+
|
|
481
|
+
class DestroyService extends Subject {
|
|
482
|
+
ngOnDestroy() {
|
|
483
|
+
this.next();
|
|
484
|
+
this.complete();
|
|
485
|
+
}
|
|
486
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DestroyService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
487
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DestroyService }); }
|
|
488
|
+
}
|
|
489
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DestroyService, decorators: [{
|
|
490
|
+
type: Injectable
|
|
491
|
+
}] });
|
|
492
|
+
|
|
493
|
+
class InterceptorsService {
|
|
494
|
+
constructor(router) {
|
|
495
|
+
this.router = router;
|
|
496
|
+
}
|
|
497
|
+
/** перехватчик состояния запросов к api */
|
|
498
|
+
intercept(req, next) {
|
|
499
|
+
return next.handle(req).pipe(catchError(err => {
|
|
500
|
+
if (err instanceof HttpErrorResponse) {
|
|
501
|
+
if (err.status >= 500) {
|
|
502
|
+
this.router.navigate(['tech-works']);
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
throw err;
|
|
506
|
+
}));
|
|
507
|
+
}
|
|
508
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InterceptorsService, deps: [{ token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
509
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InterceptorsService }); }
|
|
510
|
+
}
|
|
511
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: InterceptorsService, decorators: [{
|
|
512
|
+
type: Injectable
|
|
513
|
+
}], ctorParameters: () => [{ type: i1$1.Router }] });
|
|
514
|
+
|
|
515
|
+
class ValidatorsService {
|
|
516
|
+
constructor() { }
|
|
517
|
+
/** валидатор совпадения пароллей. При использовании указывать поля pswd & confPswd*/
|
|
518
|
+
static passEqual(el) {
|
|
519
|
+
if (!el.get('pswd') || !el.get('oldPswd')) {
|
|
520
|
+
return null;
|
|
521
|
+
}
|
|
522
|
+
if (!(el.dirty || el.touched) || el.get('pswd')?.value === el.get('confPswd')?.value) {
|
|
523
|
+
return null;
|
|
524
|
+
}
|
|
525
|
+
return {
|
|
526
|
+
passEqual: 'Пароли не совпадают',
|
|
527
|
+
};
|
|
528
|
+
}
|
|
529
|
+
static passNotEqual(el) {
|
|
530
|
+
if (!el.get('pswd') || !el.get('oldPswd')) {
|
|
531
|
+
return null;
|
|
532
|
+
}
|
|
533
|
+
if (!(el.dirty || el.touched) || el.get('pswd')?.value !== el.get('oldPswd')?.value) {
|
|
534
|
+
return null;
|
|
535
|
+
}
|
|
536
|
+
return {
|
|
537
|
+
passNotEqual: 'Старый и новый пароли не должны совпадать',
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
static wrongLogin() {
|
|
541
|
+
return {
|
|
542
|
+
wrongMail: 'Неверный логин!',
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
static wrongLoginOrPswd() {
|
|
546
|
+
return {
|
|
547
|
+
wrongLogin: 'Неверный логин или пароль!',
|
|
548
|
+
};
|
|
549
|
+
}
|
|
550
|
+
static existLogin() {
|
|
551
|
+
return {
|
|
552
|
+
mailErr: 'Пользователь с таким адресом уже зарегистрирован.',
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
/** валидатор имени*/
|
|
556
|
+
static getNameValid() {
|
|
557
|
+
return [Validators.required, Validators.pattern(/^[A-ZА-Яa-zа-яЁё0-9- .]+$/), Validators.maxLength(35)];
|
|
558
|
+
}
|
|
559
|
+
/** валидатор email*/
|
|
560
|
+
static getMailValid(el) {
|
|
561
|
+
const pattern = /^([A-Za-z0-9+_-]+\.)*[A-Za-z0-9+_-]+@[A-Za-z0-9+_-]+(\.[A-Za-z0-9+_-]+)*\.[A-Za-z]{2,6}$/;
|
|
562
|
+
if (!el?.value) {
|
|
563
|
+
return of({
|
|
564
|
+
required: 'Это поле обязательно для заполнения',
|
|
565
|
+
});
|
|
566
|
+
}
|
|
567
|
+
else if (!pattern.test(el.value) && el.value !== 'test_admin' && el.value !== 'admin') {
|
|
568
|
+
return of({
|
|
569
|
+
email: 'Некорректно введены данные',
|
|
570
|
+
});
|
|
571
|
+
}
|
|
572
|
+
else {
|
|
573
|
+
return of(null);
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ValidatorsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
577
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ValidatorsService, providedIn: 'root' }); }
|
|
578
|
+
}
|
|
579
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ValidatorsService, decorators: [{
|
|
580
|
+
type: Injectable,
|
|
581
|
+
args: [{ providedIn: 'root' }]
|
|
582
|
+
}], ctorParameters: () => [] });
|
|
583
|
+
|
|
584
|
+
class FetcherService {
|
|
585
|
+
constructor(http, apiUrl = 'api') {
|
|
586
|
+
this.http = http;
|
|
587
|
+
this.apiUrl = apiUrl;
|
|
588
|
+
// private apiUrl = 'api';
|
|
589
|
+
this.payloadMethods = ['post', 'put'];
|
|
590
|
+
}
|
|
591
|
+
get(urlParts, options = {}, urlId) {
|
|
592
|
+
urlParts = urlId ? urlParts.replace(/{[^}]+}/g, urlId.toString()) : urlParts;
|
|
593
|
+
const url = urlParts ? [this.apiUrl].concat(urlParts).join('/') : this.apiUrl;
|
|
594
|
+
let params = new HttpParams();
|
|
595
|
+
for (const key of Object.keys(options)) {
|
|
596
|
+
if (options[key] != null) {
|
|
597
|
+
if (options[key].length && isArray(options[key])) {
|
|
598
|
+
options[key].forEach((f) => {
|
|
599
|
+
params = params.append(key, f);
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
else {
|
|
603
|
+
params = params.append(key, options[key]);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
return this.request('get', url, { params });
|
|
608
|
+
}
|
|
609
|
+
post(urlParts, data, options = {}) {
|
|
610
|
+
const url = [this.apiUrl].concat(urlParts).join('/');
|
|
611
|
+
if (options?.params) {
|
|
612
|
+
let params = new HttpParams();
|
|
613
|
+
for (const key of Object.keys(options.params)) {
|
|
614
|
+
if (options.params[key] != null) {
|
|
615
|
+
params = params.append(key, options.params[key]);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
options.params = params;
|
|
619
|
+
}
|
|
620
|
+
return this.request('post', url, options, data);
|
|
621
|
+
}
|
|
622
|
+
put(urlParts, options = {}, data) {
|
|
623
|
+
const url = [this.apiUrl].concat(urlParts).join('/');
|
|
624
|
+
return this.request('put', url, options, data);
|
|
625
|
+
}
|
|
626
|
+
delete(urlParts, options = {}) {
|
|
627
|
+
const url = [this.apiUrl].concat(urlParts).join('/');
|
|
628
|
+
return this.request('delete', url, options);
|
|
629
|
+
}
|
|
630
|
+
/** перегоняем объкты в форм дату*/
|
|
631
|
+
createFormData(form) {
|
|
632
|
+
const formData = new FormData();
|
|
633
|
+
Object.keys(form).forEach((item) => {
|
|
634
|
+
formData.append(item, form[item]);
|
|
635
|
+
});
|
|
636
|
+
return formData;
|
|
637
|
+
}
|
|
638
|
+
request(method, url, options, data) {
|
|
639
|
+
if (options.headers) {
|
|
640
|
+
options.headers = new HttpHeaders(options.headers);
|
|
641
|
+
}
|
|
642
|
+
let request;
|
|
643
|
+
options.withCredentials = true;
|
|
644
|
+
if (this.payloadMethods.includes(method)) {
|
|
645
|
+
request = this.http[method](url, data, options);
|
|
646
|
+
}
|
|
647
|
+
else {
|
|
648
|
+
request = this.http[method](url, options);
|
|
649
|
+
}
|
|
650
|
+
return request.pipe(switchMap((response) => {
|
|
651
|
+
if (response && response.error) {
|
|
652
|
+
console.error(`API error with status: ${response.status}`);
|
|
653
|
+
console.error(response.error);
|
|
654
|
+
}
|
|
655
|
+
return of(response);
|
|
656
|
+
}));
|
|
657
|
+
}
|
|
658
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FetcherService, deps: [{ token: i1$2.HttpClient }, { token: 'apiUrl' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
659
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FetcherService, providedIn: 'root' }); }
|
|
660
|
+
}
|
|
661
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FetcherService, decorators: [{
|
|
662
|
+
type: Injectable,
|
|
663
|
+
args: [{ providedIn: 'root' }]
|
|
664
|
+
}], ctorParameters: () => [{ type: i1$2.HttpClient }, { type: undefined, decorators: [{
|
|
665
|
+
type: Inject,
|
|
666
|
+
args: ['apiUrl']
|
|
667
|
+
}] }] });
|
|
668
|
+
|
|
669
|
+
function compare(field, order, ...args) {
|
|
670
|
+
let len = args.length;
|
|
671
|
+
if (len === 0) {
|
|
672
|
+
return (a, b) => (a < b && -1) || (a > b && 1) || 0;
|
|
673
|
+
}
|
|
674
|
+
if (len === 1) {
|
|
675
|
+
switch (typeof field) {
|
|
676
|
+
case 'number':
|
|
677
|
+
return field < 0
|
|
678
|
+
? (a, b) => (a < b && 1) || (a > b && -1) || 0
|
|
679
|
+
: (a, b) => (a < b && -1) || (a > b && 1) || 0;
|
|
680
|
+
case 'string':
|
|
681
|
+
return (a, b) => (a[field] ? a[field].toLowerCase() : '' < b[field] ? b[field].toLowerCase() : '' && -1) ||
|
|
682
|
+
(a[field] ? a[field].toLowerCase() : '' > b[field] ? b[field].toLowerCase() : '' && 1) ||
|
|
683
|
+
0;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
if (field && len === 2 && typeof order === 'number') {
|
|
687
|
+
return order < 0
|
|
688
|
+
? (a, b) => (b[field] || '').toLowerCase().localeCompare((a[field] || '').toLowerCase())
|
|
689
|
+
: (a, b) => (a[field] || '').toLowerCase().localeCompare((b[field] || '').toLowerCase());
|
|
690
|
+
}
|
|
691
|
+
let fields;
|
|
692
|
+
let orders;
|
|
693
|
+
if (typeof field === 'object') {
|
|
694
|
+
fields = Object.getOwnPropertyNames(field);
|
|
695
|
+
orders = fields.map(key => field[key]);
|
|
696
|
+
len = fields.length;
|
|
697
|
+
}
|
|
698
|
+
else {
|
|
699
|
+
fields = new Array(len);
|
|
700
|
+
orders = new Array(len);
|
|
701
|
+
for (let i = len; i--;) {
|
|
702
|
+
fields[i] = args[i];
|
|
703
|
+
orders[i] = 1;
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
return (a, b) => {
|
|
707
|
+
for (let i = 0; i < len; i++) {
|
|
708
|
+
if (a[fields[i]].toLowerCase() < b[fields[i]].toLowerCase()) {
|
|
709
|
+
return orders[i];
|
|
710
|
+
}
|
|
711
|
+
if (a[fields[i]].toLowerCase() > b[fields[i]].toLowerCase()) {
|
|
712
|
+
return -orders[i];
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
return 0;
|
|
716
|
+
};
|
|
717
|
+
}
|
|
718
|
+
// export function parseDate(value) {
|
|
719
|
+
// if (value && value.length === 6) {
|
|
720
|
+
// const year = parseInt(value.slice(2, 6), 10);
|
|
721
|
+
// const month = parseInt(value.slice(0, 2), 10) - 1;
|
|
722
|
+
// return new Date(year, month);
|
|
723
|
+
// }
|
|
724
|
+
// }
|
|
725
|
+
function rndRgb() {
|
|
726
|
+
const x = Math.floor(Math.random() * 256);
|
|
727
|
+
const y = Math.floor(Math.random() * 256);
|
|
728
|
+
const z = Math.floor(Math.random() * 256);
|
|
729
|
+
return 'rgb(' + x + ',' + y + ',' + z + ')';
|
|
730
|
+
}
|
|
731
|
+
function setMinDate() {
|
|
732
|
+
let curYear = new Date().getFullYear();
|
|
733
|
+
let curMonth = new Date().getMonth();
|
|
734
|
+
const curDay = new Date().getDate();
|
|
735
|
+
if (curMonth < 6) {
|
|
736
|
+
curYear -= 1;
|
|
737
|
+
curMonth = curMonth - 6 + 12;
|
|
738
|
+
}
|
|
739
|
+
else {
|
|
740
|
+
curMonth -= 6;
|
|
741
|
+
}
|
|
742
|
+
return new Date(curYear, curMonth, curDay);
|
|
743
|
+
}
|
|
744
|
+
function isNil(value) {
|
|
745
|
+
return value === null || typeof value === 'undefined';
|
|
746
|
+
}
|
|
747
|
+
function isString(value) {
|
|
748
|
+
return typeof value === 'string';
|
|
749
|
+
}
|
|
750
|
+
function isObject(value) {
|
|
751
|
+
return value !== null && typeof value === 'object';
|
|
752
|
+
}
|
|
753
|
+
function getProperty(value, key) {
|
|
754
|
+
if (isNil(value) || !isObject(value)) {
|
|
755
|
+
return undefined;
|
|
756
|
+
}
|
|
757
|
+
const keys = key.split('.');
|
|
758
|
+
let result = value[keys.shift()];
|
|
759
|
+
for (const k of keys) {
|
|
760
|
+
if (isNil(result) || !isObject(result)) {
|
|
761
|
+
return undefined;
|
|
762
|
+
}
|
|
763
|
+
result = result[k];
|
|
764
|
+
}
|
|
765
|
+
return result;
|
|
766
|
+
}
|
|
767
|
+
function isMobile() {
|
|
768
|
+
return Android() || BlackBerry() || iOS() || Opera() || Windows();
|
|
769
|
+
}
|
|
770
|
+
function Android() {
|
|
771
|
+
return !!navigator.userAgent.match(/Android/i);
|
|
772
|
+
}
|
|
773
|
+
function BlackBerry() {
|
|
774
|
+
return !!navigator.userAgent.match(/BlackBerry/i);
|
|
775
|
+
}
|
|
776
|
+
function iOS() {
|
|
777
|
+
return !!navigator.userAgent.match(/iPhone|iPad|iPod/i);
|
|
778
|
+
}
|
|
779
|
+
function Opera() {
|
|
780
|
+
return !!navigator.userAgent.match(/Opera Mini/i);
|
|
781
|
+
}
|
|
782
|
+
function Windows() {
|
|
783
|
+
return !!navigator.userAgent.match(/IEMobile/i) || navigator.userAgent.match(/WPDesktop/i);
|
|
784
|
+
}
|
|
785
|
+
function dataURLtoFile(dataUrl, filename) {
|
|
786
|
+
const arr = dataUrl.split(',');
|
|
787
|
+
const mime = arr[0].match(/:(.*?);/)[1];
|
|
788
|
+
const bstr = atob(arr[1]);
|
|
789
|
+
let n = bstr.length;
|
|
790
|
+
const u8arr = new Uint8Array(n);
|
|
791
|
+
while (n--) {
|
|
792
|
+
u8arr[n] = bstr.charCodeAt(n);
|
|
793
|
+
}
|
|
794
|
+
return new File([u8arr], filename, { type: mime });
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
class FilterPipe {
|
|
798
|
+
transform(value, args) {
|
|
799
|
+
if (value && value.length) {
|
|
800
|
+
return value.filter((item, i) => i === args);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FilterPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
804
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: FilterPipe, isStandalone: true, name: "filter" }); }
|
|
805
|
+
}
|
|
806
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FilterPipe, decorators: [{
|
|
807
|
+
type: Pipe,
|
|
808
|
+
args: [{
|
|
809
|
+
name: 'filter',
|
|
810
|
+
standalone: true,
|
|
811
|
+
}]
|
|
812
|
+
}] });
|
|
813
|
+
class FilterByKeyPipe {
|
|
814
|
+
transform(arr, fn) {
|
|
815
|
+
if (!arr?.length) {
|
|
816
|
+
return arr;
|
|
817
|
+
}
|
|
818
|
+
if (typeof fn === 'function') {
|
|
819
|
+
return arr.filter(fn);
|
|
820
|
+
}
|
|
821
|
+
else if (fn?.length) {
|
|
822
|
+
const [key, value] = fn;
|
|
823
|
+
return arr.filter((item) => getProperty(item, key) === value);
|
|
824
|
+
}
|
|
825
|
+
else if (fn) {
|
|
826
|
+
return arr.filter((item) => item === fn);
|
|
827
|
+
}
|
|
828
|
+
else {
|
|
829
|
+
return arr;
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FilterByKeyPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
833
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: FilterByKeyPipe, isStandalone: true, name: "filterByKey" }); }
|
|
834
|
+
}
|
|
835
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FilterByKeyPipe, decorators: [{
|
|
836
|
+
type: Pipe,
|
|
837
|
+
args: [{
|
|
838
|
+
name: 'filterByKey',
|
|
839
|
+
standalone: true,
|
|
840
|
+
}]
|
|
841
|
+
}] });
|
|
842
|
+
|
|
843
|
+
class HighlightPipe {
|
|
844
|
+
transform(name, val) {
|
|
845
|
+
if (val) {
|
|
846
|
+
const re = new RegExp(val, 'gi');
|
|
847
|
+
return name.toString().replace(re, `<span style="color: #07B700">$&</span>`);
|
|
848
|
+
}
|
|
849
|
+
else {
|
|
850
|
+
return name;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HighlightPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
854
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: HighlightPipe, isStandalone: true, name: "highlight" }); }
|
|
855
|
+
}
|
|
856
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: HighlightPipe, decorators: [{
|
|
857
|
+
type: Pipe,
|
|
858
|
+
args: [{
|
|
859
|
+
name: 'highlight',
|
|
860
|
+
standalone: true,
|
|
861
|
+
}]
|
|
862
|
+
}] });
|
|
863
|
+
|
|
864
|
+
class SafePipe {
|
|
865
|
+
constructor(sanitizer) {
|
|
866
|
+
this.sanitizer = sanitizer;
|
|
867
|
+
}
|
|
868
|
+
transform(value, type) {
|
|
869
|
+
switch (type) {
|
|
870
|
+
case 'html':
|
|
871
|
+
return this.sanitizer.bypassSecurityTrustHtml(value);
|
|
872
|
+
case 'style':
|
|
873
|
+
return this.sanitizer.bypassSecurityTrustStyle(value);
|
|
874
|
+
case 'script':
|
|
875
|
+
return this.sanitizer.bypassSecurityTrustScript(value);
|
|
876
|
+
case 'url':
|
|
877
|
+
return this.sanitizer.bypassSecurityTrustUrl(value);
|
|
878
|
+
case 'resourceUrl':
|
|
879
|
+
return this.sanitizer.bypassSecurityTrustResourceUrl(value);
|
|
880
|
+
default:
|
|
881
|
+
throw new Error(`Invalid safe type specified: ${type}`);
|
|
882
|
+
}
|
|
883
|
+
}
|
|
884
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SafePipe, deps: [{ token: i1$3.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
885
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: SafePipe, isStandalone: true, name: "safe" }); }
|
|
886
|
+
}
|
|
887
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: SafePipe, decorators: [{
|
|
888
|
+
type: Pipe,
|
|
889
|
+
args: [{
|
|
890
|
+
name: 'safe',
|
|
891
|
+
standalone: true,
|
|
892
|
+
}]
|
|
893
|
+
}], ctorParameters: () => [{ type: i1$3.DomSanitizer }] });
|
|
894
|
+
|
|
895
|
+
class ReversePipe {
|
|
896
|
+
transform(value, sort) {
|
|
897
|
+
return sort === 'asc' ? value : value.reverse();
|
|
898
|
+
}
|
|
899
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ReversePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
900
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: ReversePipe, isStandalone: true, name: "reverse" }); }
|
|
901
|
+
}
|
|
902
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ReversePipe, decorators: [{
|
|
903
|
+
type: Pipe,
|
|
904
|
+
args: [{
|
|
905
|
+
name: 'reverse',
|
|
906
|
+
standalone: true,
|
|
907
|
+
}]
|
|
908
|
+
}] });
|
|
909
|
+
|
|
910
|
+
class FilterTabsPipe {
|
|
911
|
+
transform(arr, tab) {
|
|
912
|
+
if (arr) {
|
|
913
|
+
return arr.filter(v => {
|
|
914
|
+
if (tab === 0) {
|
|
915
|
+
return [1, 2].indexOf(v.status.id) !== -1;
|
|
916
|
+
}
|
|
917
|
+
if (tab === 1) {
|
|
918
|
+
return [3, 4].indexOf(v.status.id) !== -1;
|
|
919
|
+
}
|
|
920
|
+
if (tab === 2) {
|
|
921
|
+
return [6].indexOf(v.status.id) !== -1;
|
|
922
|
+
}
|
|
923
|
+
return arr;
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
return [];
|
|
927
|
+
}
|
|
928
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FilterTabsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
929
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "17.3.12", ngImport: i0, type: FilterTabsPipe, isStandalone: true, name: "filterTabs" }); }
|
|
930
|
+
}
|
|
931
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: FilterTabsPipe, decorators: [{
|
|
932
|
+
type: Pipe,
|
|
933
|
+
args: [{
|
|
934
|
+
name: 'filterTabs',
|
|
935
|
+
standalone: true,
|
|
936
|
+
}]
|
|
937
|
+
}] });
|
|
938
|
+
|
|
939
|
+
class AutoHeightDirective {
|
|
940
|
+
constructor(el, rdr) {
|
|
941
|
+
this.el = el;
|
|
942
|
+
this.rdr = rdr;
|
|
943
|
+
}
|
|
944
|
+
ngOnInit() {
|
|
945
|
+
setTimeout(() => {
|
|
946
|
+
if (this.ddAutoHeight) {
|
|
947
|
+
let i = 1;
|
|
948
|
+
let parent;
|
|
949
|
+
while (i <= this.ddAutoHeight) {
|
|
950
|
+
parent = parent ? parent.parentNode : this.el.nativeElement.parentNode;
|
|
951
|
+
i++;
|
|
952
|
+
}
|
|
953
|
+
const height = parent.clientHeight;
|
|
954
|
+
if (height) {
|
|
955
|
+
this.rdr.setStyle(this.el.nativeElement, 'height', height + 'px');
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
}, 0);
|
|
959
|
+
}
|
|
960
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AutoHeightDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
961
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.12", type: AutoHeightDirective, isStandalone: true, selector: "[ddAutoHeight]", inputs: { ddAutoHeight: "ddAutoHeight" }, ngImport: i0 }); }
|
|
962
|
+
}
|
|
963
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: AutoHeightDirective, decorators: [{
|
|
964
|
+
type: Directive,
|
|
965
|
+
args: [{
|
|
966
|
+
selector: '[ddAutoHeight]',
|
|
967
|
+
standalone: true,
|
|
968
|
+
}]
|
|
969
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { ddAutoHeight: [{
|
|
970
|
+
type: Input
|
|
971
|
+
}] } });
|
|
972
|
+
|
|
973
|
+
class CounterDirective {
|
|
974
|
+
constructor(el) {
|
|
975
|
+
this.el = el;
|
|
976
|
+
this.needPositive = false;
|
|
977
|
+
}
|
|
978
|
+
ngOnChanges(change) {
|
|
979
|
+
this.el.nativeElement.innerHTML = 0;
|
|
980
|
+
let interval;
|
|
981
|
+
if (change['ddCounter']?.currentValue) {
|
|
982
|
+
/** получаем шаг для инкремента делением конечного числа на 20*/
|
|
983
|
+
let step = Math.floor(change['ddCounter'].currentValue / 20);
|
|
984
|
+
/** бывают маленькие и отрицательные числа*/
|
|
985
|
+
step = step >= 1 || step <= -1 ? step : 1;
|
|
986
|
+
let x = 0;
|
|
987
|
+
if (change['ddCounter'].currentValue > 0) {
|
|
988
|
+
interval = setInterval(() => {
|
|
989
|
+
if (x + step >= change['ddCounter'].currentValue) {
|
|
990
|
+
/** Если шаг увеличивает значение больше чем исходные число, приравниваем к исходнику и заканчиваем*/
|
|
991
|
+
const transformNumberFirst = new DecimalPipe('ru').transform(change['ddCounter'].currentValue);
|
|
992
|
+
this.el.nativeElement.innerHTML = this.needPositive
|
|
993
|
+
? '+' + transformNumberFirst
|
|
994
|
+
: transformNumberFirst;
|
|
995
|
+
clearInterval(interval);
|
|
996
|
+
return;
|
|
997
|
+
}
|
|
998
|
+
x += step;
|
|
999
|
+
const transformNumber = new DecimalPipe('ru').transform(x);
|
|
1000
|
+
this.el.nativeElement.innerHTML = this.needPositive ? '+' + transformNumber : transformNumber;
|
|
1001
|
+
}, 1);
|
|
1002
|
+
}
|
|
1003
|
+
else if (change['ddCounter'].currentValue < 0) {
|
|
1004
|
+
interval = setInterval(() => {
|
|
1005
|
+
if (x - step <= change['ddCounter'].currentValue) {
|
|
1006
|
+
this.el.nativeElement.innerHTML = new DecimalPipe('ru').transform(change['ddCounter'].currentValue);
|
|
1007
|
+
clearInterval(interval);
|
|
1008
|
+
return;
|
|
1009
|
+
}
|
|
1010
|
+
x += step;
|
|
1011
|
+
this.el.nativeElement.innerHTML = new DecimalPipe('ru').transform(x);
|
|
1012
|
+
}, 10);
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
setTimeout(() => {
|
|
1016
|
+
clearInterval(interval);
|
|
1017
|
+
}, 4000);
|
|
1018
|
+
}
|
|
1019
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CounterDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1020
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.12", type: CounterDirective, isStandalone: true, selector: "[ddCounter]", inputs: { ddCounter: "ddCounter", needPositive: "needPositive" }, usesOnChanges: true, ngImport: i0 }); }
|
|
1021
|
+
}
|
|
1022
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CounterDirective, decorators: [{
|
|
1023
|
+
type: Directive,
|
|
1024
|
+
args: [{
|
|
1025
|
+
selector: '[ddCounter]',
|
|
1026
|
+
standalone: true,
|
|
1027
|
+
}]
|
|
1028
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { ddCounter: [{
|
|
1029
|
+
type: Input
|
|
1030
|
+
}], needPositive: [{
|
|
1031
|
+
type: Input
|
|
1032
|
+
}] } });
|
|
1033
|
+
|
|
1034
|
+
class DeclensionDirective {
|
|
1035
|
+
constructor(el) {
|
|
1036
|
+
this.el = el;
|
|
1037
|
+
this.count = 0;
|
|
1038
|
+
this.whitespace = true;
|
|
1039
|
+
this.needCount = true;
|
|
1040
|
+
}
|
|
1041
|
+
ngOnInit() {
|
|
1042
|
+
const declension = { 1: this.ddDeclension[0], 2: this.ddDeclension[1], 5: this.ddDeclension[2] };
|
|
1043
|
+
let x = this.count >= 10 && this.count <= 20 ? 5 : this.count % 10;
|
|
1044
|
+
if (this.count > 999) {
|
|
1045
|
+
x = this.count % 100;
|
|
1046
|
+
}
|
|
1047
|
+
const keys = Object.keys(declension).map(Number).sort();
|
|
1048
|
+
const text = !x
|
|
1049
|
+
? `${declension[keys.pop() || 1]}`
|
|
1050
|
+
: keys.reduce((result, key) => (x >= +key ? declension[key] : result), '');
|
|
1051
|
+
this.el.nativeElement.innerHTML = `${this.whitespace ? ' ' : ''}${this.needCount ? this.count : ''} ${text}`;
|
|
1052
|
+
}
|
|
1053
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DeclensionDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1054
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.12", type: DeclensionDirective, isStandalone: true, selector: "[ddDeclension]", inputs: { ddDeclension: "ddDeclension", count: "count", whitespace: "whitespace", needCount: "needCount" }, ngImport: i0 }); }
|
|
1055
|
+
}
|
|
1056
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DeclensionDirective, decorators: [{
|
|
1057
|
+
type: Directive,
|
|
1058
|
+
args: [{
|
|
1059
|
+
selector: '[ddDeclension]',
|
|
1060
|
+
standalone: true,
|
|
1061
|
+
}]
|
|
1062
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { ddDeclension: [{
|
|
1063
|
+
type: Input
|
|
1064
|
+
}], count: [{
|
|
1065
|
+
type: Input
|
|
1066
|
+
}], whitespace: [{
|
|
1067
|
+
type: Input
|
|
1068
|
+
}], needCount: [{
|
|
1069
|
+
type: Input
|
|
1070
|
+
}] } });
|
|
1071
|
+
|
|
1072
|
+
class ClickOutsideDirective {
|
|
1073
|
+
constructor(el) {
|
|
1074
|
+
this.el = el;
|
|
1075
|
+
this.ddClickOutside = new EventEmitter();
|
|
1076
|
+
}
|
|
1077
|
+
onClick(targetElement) {
|
|
1078
|
+
let clickedElemInside = false;
|
|
1079
|
+
if (this.elements?.length) {
|
|
1080
|
+
this.elements.forEach(el => {
|
|
1081
|
+
if (el) {
|
|
1082
|
+
const elem = document.getElementById(el);
|
|
1083
|
+
if (elem && !clickedElemInside) {
|
|
1084
|
+
clickedElemInside = elem.contains(targetElement.target);
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
});
|
|
1088
|
+
}
|
|
1089
|
+
const clickedInside = this.el.nativeElement.contains(targetElement.target);
|
|
1090
|
+
if (!clickedElemInside) {
|
|
1091
|
+
this.ddClickOutside.emit(clickedInside);
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ClickOutsideDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1095
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.12", type: ClickOutsideDirective, isStandalone: true, selector: "[ddClickOutside]", inputs: { elements: "elements" }, outputs: { ddClickOutside: "ddClickOutside" }, host: { listeners: { "document:click": "onClick($event)" } }, ngImport: i0 }); }
|
|
1096
|
+
}
|
|
1097
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ClickOutsideDirective, decorators: [{
|
|
1098
|
+
type: Directive,
|
|
1099
|
+
args: [{
|
|
1100
|
+
standalone: true,
|
|
1101
|
+
selector: '[ddClickOutside]',
|
|
1102
|
+
}]
|
|
1103
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { elements: [{
|
|
1104
|
+
type: Input
|
|
1105
|
+
}], ddClickOutside: [{
|
|
1106
|
+
type: Output
|
|
1107
|
+
}], onClick: [{
|
|
1108
|
+
type: HostListener,
|
|
1109
|
+
args: ['document:click', ['$event']]
|
|
1110
|
+
}] } });
|
|
1111
|
+
|
|
1112
|
+
class ResizeTextareaDirective {
|
|
1113
|
+
constructor(el, rdr) {
|
|
1114
|
+
this.el = el;
|
|
1115
|
+
this.rdr = rdr;
|
|
1116
|
+
}
|
|
1117
|
+
onKeyup() {
|
|
1118
|
+
const h = this.el.nativeElement.scrollHeight;
|
|
1119
|
+
this.rdr.setStyle(this.el.nativeElement, 'max-height', h + 'px');
|
|
1120
|
+
this.rdr.setStyle(this.el.nativeElement, 'height', h + 'px');
|
|
1121
|
+
}
|
|
1122
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ResizeTextareaDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1123
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.12", type: ResizeTextareaDirective, isStandalone: true, selector: "[ddResizeTextarea]", host: { listeners: { "input": "onKeyup($event)" } }, ngImport: i0 }); }
|
|
1124
|
+
}
|
|
1125
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ResizeTextareaDirective, decorators: [{
|
|
1126
|
+
type: Directive,
|
|
1127
|
+
args: [{
|
|
1128
|
+
selector: '[ddResizeTextarea]',
|
|
1129
|
+
standalone: true,
|
|
1130
|
+
}]
|
|
1131
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { onKeyup: [{
|
|
1132
|
+
type: HostListener,
|
|
1133
|
+
args: ['input', ['$event']]
|
|
1134
|
+
}] } });
|
|
1135
|
+
|
|
1136
|
+
class TriangleDirective {
|
|
1137
|
+
constructor(rdr, el) {
|
|
1138
|
+
this.rdr = rdr;
|
|
1139
|
+
this.el = el;
|
|
1140
|
+
this.width = 16;
|
|
1141
|
+
this.height = 16;
|
|
1142
|
+
this.fill = '#fff';
|
|
1143
|
+
this.stroke = '#fff';
|
|
1144
|
+
this.points = '0,8 4,0 8,8';
|
|
1145
|
+
this.drTriangle = 'left';
|
|
1146
|
+
}
|
|
1147
|
+
ngOnInit() {
|
|
1148
|
+
setTimeout(() => {
|
|
1149
|
+
const option = this.el.nativeElement.getBoundingClientRect();
|
|
1150
|
+
let left = option.width / 2 - this.width / 2;
|
|
1151
|
+
let top = -this.height / 2;
|
|
1152
|
+
if (this.drTriangle === 'left') {
|
|
1153
|
+
this.points = '8,0 0,8 8,16';
|
|
1154
|
+
left = -this.width / 2;
|
|
1155
|
+
top = option.height / 2 - this.width / 2;
|
|
1156
|
+
}
|
|
1157
|
+
if (this.drTriangle === 'right') {
|
|
1158
|
+
this.points = '8,0 16,8 8,16';
|
|
1159
|
+
left = option.width - this.width / 2 - 2;
|
|
1160
|
+
top = option.height / 2 - this.width;
|
|
1161
|
+
}
|
|
1162
|
+
if (this.drTriangle === 'bottom') {
|
|
1163
|
+
this.points = '16,8 8,16 0,8';
|
|
1164
|
+
top = option.height - this.height / 2 - 2;
|
|
1165
|
+
}
|
|
1166
|
+
if (this.drTriangle === 'top-left') {
|
|
1167
|
+
left = 46 - this.width / 2;
|
|
1168
|
+
}
|
|
1169
|
+
const svg = this.rdr.createElement('svg', 'svg');
|
|
1170
|
+
this.rdr.setAttribute(svg, 'width', `${this.width}`);
|
|
1171
|
+
this.rdr.setAttribute(svg, 'height', `${this.height}`);
|
|
1172
|
+
this.rdr.setStyle(svg, 'width', `${this.width}px`);
|
|
1173
|
+
this.rdr.setStyle(svg, 'height', `${this.height}px`);
|
|
1174
|
+
this.rdr.setStyle(svg, 'position', 'absolute');
|
|
1175
|
+
this.rdr.setStyle(svg, 'fill', this.fill);
|
|
1176
|
+
this.rdr.setStyle(svg, 'stroke', this.stroke);
|
|
1177
|
+
this.rdr.setStyle(svg, 'top', `${top}px`);
|
|
1178
|
+
this.rdr.setStyle(svg, 'left', `${left}px`);
|
|
1179
|
+
this.rdr.setStyle(svg, 'box-shadow', `0 14px 64px -4px #18274B0F, 0px 8px 22px -6px #18274B0F`);
|
|
1180
|
+
const polyline = this.rdr.createElement('polyline', 'svg');
|
|
1181
|
+
this.rdr.setAttribute(polyline, 'points', this.points);
|
|
1182
|
+
this.rdr.appendChild(svg, polyline);
|
|
1183
|
+
this.rdr.appendChild(this.el.nativeElement, svg);
|
|
1184
|
+
});
|
|
1185
|
+
}
|
|
1186
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TriangleDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1187
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.12", type: TriangleDirective, isStandalone: true, selector: "[ddTriangle]", inputs: { width: "width", height: "height", fill: "fill", stroke: "stroke", points: "points", drTriangle: "drTriangle" }, ngImport: i0 }); }
|
|
1188
|
+
}
|
|
1189
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TriangleDirective, decorators: [{
|
|
1190
|
+
type: Directive,
|
|
1191
|
+
args: [{
|
|
1192
|
+
standalone: true,
|
|
1193
|
+
selector: '[ddTriangle]',
|
|
1194
|
+
}]
|
|
1195
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }], propDecorators: { width: [{
|
|
1196
|
+
type: Input
|
|
1197
|
+
}], height: [{
|
|
1198
|
+
type: Input
|
|
1199
|
+
}], fill: [{
|
|
1200
|
+
type: Input
|
|
1201
|
+
}], stroke: [{
|
|
1202
|
+
type: Input
|
|
1203
|
+
}], points: [{
|
|
1204
|
+
type: Input
|
|
1205
|
+
}], drTriangle: [{
|
|
1206
|
+
type: Input
|
|
1207
|
+
}] } });
|
|
1208
|
+
|
|
1209
|
+
const TOOLTIP_DATA = new InjectionToken('Подсказка');
|
|
1210
|
+
class TooltipComponent {
|
|
1211
|
+
get asString() {
|
|
1212
|
+
return typeof this.tooltipData === 'string' ? this.tooltipData : false;
|
|
1213
|
+
}
|
|
1214
|
+
get asTemplate() {
|
|
1215
|
+
return this.tooltipData instanceof TemplateRef ? this.tooltipData : false;
|
|
1216
|
+
}
|
|
1217
|
+
constructor(tooltipData) {
|
|
1218
|
+
this.tooltipData = tooltipData;
|
|
1219
|
+
}
|
|
1220
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TooltipComponent, deps: [{ token: TOOLTIP_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1221
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: TooltipComponent, isStandalone: true, selector: "dd-tooltip", ngImport: i0, template: "<div class=\"tooltip-container\">\r\n @if (asString; as string) {\r\n {{ string }}\r\n } @if (asTemplate; as template) {\r\n <ng-template [ngTemplateOutlet]=\"template\"></ng-template>\r\n }\r\n <svg class=\"tooltip-container__triangle\" width=\"16\" height=\"16\">\r\n <polyline points=\"8,0 0,8 8,16\"></polyline>\r\n </svg>\r\n</div>\r\n", styles: [":host{position:relative}.tooltip-container{position:relative;display:block;max-width:312px;padding:6px 12px;background:var(--white-color);border-radius:8px;box-sizing:border-box;box-shadow:0 14px 64px -4px #18274b0f,0 8px 22px -6px #18274b0f}.tooltip-container__triangle{width:16px;height:16px;position:absolute;fill:#fff;stroke:#fff;box-shadow:#18274b0f 0 14px 64px -4px,#18274b0f 0 8px 22px -6px}:host-context(.left) svg{top:calc(50% - 8px);right:-8px;rotate:180deg}:host-context(.right) svg{top:calc(50% - 8px);left:-8px}:host-context(.top) svg{right:calc(50% - 8px);bottom:-8px;rotate:-90deg}:host-context(.bottom) svg{right:calc(50% - 8px);top:-8px;rotate:90deg}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1222
|
+
}
|
|
1223
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TooltipComponent, decorators: [{
|
|
1224
|
+
type: Component,
|
|
1225
|
+
args: [{ selector: 'dd-tooltip', standalone: true, imports: [CommonModule, TriangleDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"tooltip-container\">\r\n @if (asString; as string) {\r\n {{ string }}\r\n } @if (asTemplate; as template) {\r\n <ng-template [ngTemplateOutlet]=\"template\"></ng-template>\r\n }\r\n <svg class=\"tooltip-container__triangle\" width=\"16\" height=\"16\">\r\n <polyline points=\"8,0 0,8 8,16\"></polyline>\r\n </svg>\r\n</div>\r\n", styles: [":host{position:relative}.tooltip-container{position:relative;display:block;max-width:312px;padding:6px 12px;background:var(--white-color);border-radius:8px;box-sizing:border-box;box-shadow:0 14px 64px -4px #18274b0f,0 8px 22px -6px #18274b0f}.tooltip-container__triangle{width:16px;height:16px;position:absolute;fill:#fff;stroke:#fff;box-shadow:#18274b0f 0 14px 64px -4px,#18274b0f 0 8px 22px -6px}:host-context(.left) svg{top:calc(50% - 8px);right:-8px;rotate:180deg}:host-context(.right) svg{top:calc(50% - 8px);left:-8px}:host-context(.top) svg{right:calc(50% - 8px);bottom:-8px;rotate:-90deg}:host-context(.bottom) svg{right:calc(50% - 8px);top:-8px;rotate:90deg}\n"] }]
|
|
1226
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1227
|
+
type: Inject,
|
|
1228
|
+
args: [TOOLTIP_DATA]
|
|
1229
|
+
}] }] });
|
|
1230
|
+
|
|
1231
|
+
class TooltipDirective {
|
|
1232
|
+
constructor(element, overlay, viewContainer, rdr) {
|
|
1233
|
+
this.element = element;
|
|
1234
|
+
this.overlay = overlay;
|
|
1235
|
+
this.viewContainer = viewContainer;
|
|
1236
|
+
this.rdr = rdr;
|
|
1237
|
+
this.withClick = false;
|
|
1238
|
+
this.overlayRef = null;
|
|
1239
|
+
}
|
|
1240
|
+
onClick(targetElement) {
|
|
1241
|
+
const clickedInside = this.element.nativeElement.contains(targetElement.target);
|
|
1242
|
+
if (!clickedInside) {
|
|
1243
|
+
if (this.overlayRef?.hasAttached() === true) {
|
|
1244
|
+
this.overlayRef?.detach();
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
}
|
|
1248
|
+
showTooltipOnClick() {
|
|
1249
|
+
const overlay = document.getElementsByClassName('cdk-overlay-container')?.[0];
|
|
1250
|
+
if (overlay && overlay.firstChild) {
|
|
1251
|
+
overlay.removeChild(overlay.firstChild);
|
|
1252
|
+
}
|
|
1253
|
+
if (this.overlayRef?.hasAttached() === true) {
|
|
1254
|
+
this.overlayRef?.detach();
|
|
1255
|
+
return;
|
|
1256
|
+
}
|
|
1257
|
+
this.attachTooltip();
|
|
1258
|
+
}
|
|
1259
|
+
showTooltip() {
|
|
1260
|
+
if (this.withClick) {
|
|
1261
|
+
return;
|
|
1262
|
+
}
|
|
1263
|
+
if (this.overlayRef?.hasAttached() === true) {
|
|
1264
|
+
return;
|
|
1265
|
+
}
|
|
1266
|
+
this.attachTooltip();
|
|
1267
|
+
}
|
|
1268
|
+
hideTooltip() {
|
|
1269
|
+
if (this.withClick) {
|
|
1270
|
+
return;
|
|
1271
|
+
}
|
|
1272
|
+
if (this.overlayRef?.hasAttached() === true) {
|
|
1273
|
+
this.overlayRef?.detach();
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
ngOnDestroy() {
|
|
1277
|
+
this.overlayRef?.dispose();
|
|
1278
|
+
}
|
|
1279
|
+
attachTooltip() {
|
|
1280
|
+
if (this.overlayRef === null) {
|
|
1281
|
+
const positionStrategy = this.getPositionStrategy();
|
|
1282
|
+
this.overlayRef = this.overlay.create({ positionStrategy });
|
|
1283
|
+
}
|
|
1284
|
+
const injector = Injector.create({
|
|
1285
|
+
providers: [
|
|
1286
|
+
{
|
|
1287
|
+
provide: TOOLTIP_DATA,
|
|
1288
|
+
useValue: this.ddTooltip,
|
|
1289
|
+
},
|
|
1290
|
+
],
|
|
1291
|
+
});
|
|
1292
|
+
const component = new ComponentPortal(TooltipComponent, this.viewContainer, injector);
|
|
1293
|
+
this.overlayRef.attach(component);
|
|
1294
|
+
}
|
|
1295
|
+
getPositionStrategy() {
|
|
1296
|
+
return this.overlay
|
|
1297
|
+
.position()
|
|
1298
|
+
.flexibleConnectedTo(this.element)
|
|
1299
|
+
.withPositions([
|
|
1300
|
+
{
|
|
1301
|
+
originX: 'start',
|
|
1302
|
+
originY: 'center',
|
|
1303
|
+
overlayX: 'start',
|
|
1304
|
+
overlayY: 'center',
|
|
1305
|
+
panelClass: 'right',
|
|
1306
|
+
},
|
|
1307
|
+
{
|
|
1308
|
+
originX: 'center',
|
|
1309
|
+
originY: 'bottom',
|
|
1310
|
+
overlayX: 'center',
|
|
1311
|
+
overlayY: 'top',
|
|
1312
|
+
panelClass: 'bottom',
|
|
1313
|
+
},
|
|
1314
|
+
{
|
|
1315
|
+
originX: 'center',
|
|
1316
|
+
originY: 'top',
|
|
1317
|
+
overlayX: 'center',
|
|
1318
|
+
overlayY: 'bottom',
|
|
1319
|
+
panelClass: 'top',
|
|
1320
|
+
},
|
|
1321
|
+
{
|
|
1322
|
+
originX: 'end',
|
|
1323
|
+
originY: 'center',
|
|
1324
|
+
overlayX: 'end',
|
|
1325
|
+
overlayY: 'center',
|
|
1326
|
+
panelClass: 'left',
|
|
1327
|
+
},
|
|
1328
|
+
]);
|
|
1329
|
+
}
|
|
1330
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TooltipDirective, deps: [{ token: i0.ElementRef }, { token: i1$4.Overlay }, { token: i0.ViewContainerRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1331
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.12", type: TooltipDirective, isStandalone: true, selector: "[ddTooltip]", inputs: { ddTooltip: "ddTooltip", withClick: "withClick" }, host: { listeners: { "document:click": "onClick($event)", "click": "showTooltipOnClick()", "mouseenter": "showTooltip()", "focus": "showTooltip()", "mouseleave": "hideTooltip()", "blur": "hideTooltip()" } }, ngImport: i0 }); }
|
|
1332
|
+
}
|
|
1333
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: TooltipDirective, decorators: [{
|
|
1334
|
+
type: Directive,
|
|
1335
|
+
args: [{
|
|
1336
|
+
selector: '[ddTooltip]',
|
|
1337
|
+
standalone: true,
|
|
1338
|
+
}]
|
|
1339
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$4.Overlay }, { type: i0.ViewContainerRef }, { type: i0.Renderer2 }], propDecorators: { ddTooltip: [{
|
|
1340
|
+
type: Input
|
|
1341
|
+
}], withClick: [{
|
|
1342
|
+
type: Input
|
|
1343
|
+
}], onClick: [{
|
|
1344
|
+
type: HostListener,
|
|
1345
|
+
args: ['document:click', ['$event']]
|
|
1346
|
+
}], showTooltipOnClick: [{
|
|
1347
|
+
type: HostListener,
|
|
1348
|
+
args: ['click']
|
|
1349
|
+
}], showTooltip: [{
|
|
1350
|
+
type: HostListener,
|
|
1351
|
+
args: ['mouseenter']
|
|
1352
|
+
}, {
|
|
1353
|
+
type: HostListener,
|
|
1354
|
+
args: ['focus']
|
|
1355
|
+
}], hideTooltip: [{
|
|
1356
|
+
type: HostListener,
|
|
1357
|
+
args: ['mouseleave']
|
|
1358
|
+
}, {
|
|
1359
|
+
type: HostListener,
|
|
1360
|
+
args: ['blur']
|
|
1361
|
+
}] } });
|
|
1362
|
+
|
|
1363
|
+
class DDDialogRef {
|
|
1364
|
+
constructor(overlayRef) {
|
|
1365
|
+
this.overlayRef = overlayRef;
|
|
1366
|
+
this.onClose$ = new Subject();
|
|
1367
|
+
this.onClose = this.onClose$.asObservable();
|
|
1368
|
+
this.onBackdropClick = this.overlayRef.backdropClick();
|
|
1369
|
+
}
|
|
1370
|
+
/**
|
|
1371
|
+
* Hides dialog.
|
|
1372
|
+
* */
|
|
1373
|
+
close(res) {
|
|
1374
|
+
this.overlayRef.detach();
|
|
1375
|
+
this.overlayRef.dispose();
|
|
1376
|
+
this.onClose$.next(res);
|
|
1377
|
+
this.onClose$.complete();
|
|
1378
|
+
}
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
const DIALOG_CONFIG = new InjectionToken('Default options');
|
|
1382
|
+
class DialogConfig {
|
|
1383
|
+
constructor(config) {
|
|
1384
|
+
this.hasBackdrop = true;
|
|
1385
|
+
this.backdropClass = 'modal-overlay';
|
|
1386
|
+
this.dialogClass = '';
|
|
1387
|
+
this.closeOnBackdropClick = true;
|
|
1388
|
+
this.closeOnEsc = true;
|
|
1389
|
+
this.hasScroll = false;
|
|
1390
|
+
this.autoFocus = true;
|
|
1391
|
+
Object.assign(this, config);
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
|
|
1395
|
+
class DialogContainerComponent {
|
|
1396
|
+
constructor(config, elementRef, focusTrapFactory) {
|
|
1397
|
+
this.config = config;
|
|
1398
|
+
this.elementRef = elementRef;
|
|
1399
|
+
this.focusTrapFactory = focusTrapFactory;
|
|
1400
|
+
}
|
|
1401
|
+
ngOnInit() {
|
|
1402
|
+
if (this.config.autoFocus) {
|
|
1403
|
+
this.focusTrap = this.focusTrapFactory.create(this.elementRef.nativeElement);
|
|
1404
|
+
// this.focusTrap.blurPreviouslyFocusedElement();
|
|
1405
|
+
this.focusTrap.focusInitialElement();
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
attachComponentPortal(portal) {
|
|
1409
|
+
return this.portalOutlet.attachComponentPortal(portal);
|
|
1410
|
+
}
|
|
1411
|
+
attachTemplatePortal(portal) {
|
|
1412
|
+
return this.portalOutlet.attachTemplatePortal(portal);
|
|
1413
|
+
}
|
|
1414
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DialogContainerComponent, deps: [{ token: DialogConfig }, { token: i0.ElementRef }, { token: i2.FocusTrapFactory }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1415
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: DialogContainerComponent, isStandalone: true, selector: "dd-dialog-container", viewQueries: [{ propertyName: "portalOutlet", first: true, predicate: CdkPortalOutlet, descendants: true, static: true }], ngImport: i0, template: '<ng-template cdkPortalOutlet></ng-template>', isInline: true, dependencies: [{ kind: "directive", type: CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }] }); }
|
|
1416
|
+
}
|
|
1417
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DialogContainerComponent, decorators: [{
|
|
1418
|
+
type: Component,
|
|
1419
|
+
args: [{
|
|
1420
|
+
selector: 'dd-dialog-container',
|
|
1421
|
+
standalone: true,
|
|
1422
|
+
imports: [CdkPortalOutlet],
|
|
1423
|
+
template: '<ng-template cdkPortalOutlet></ng-template>',
|
|
1424
|
+
}]
|
|
1425
|
+
}], ctorParameters: () => [{ type: DialogConfig }, { type: i0.ElementRef }, { type: i2.FocusTrapFactory }], propDecorators: { portalOutlet: [{
|
|
1426
|
+
type: ViewChild,
|
|
1427
|
+
args: [CdkPortalOutlet, { static: true }]
|
|
1428
|
+
}] } });
|
|
1429
|
+
|
|
1430
|
+
class DialogService {
|
|
1431
|
+
constructor(document, globalConfig, overlay, injector, cfr) {
|
|
1432
|
+
this.document = document;
|
|
1433
|
+
this.globalConfig = globalConfig;
|
|
1434
|
+
this.overlay = overlay;
|
|
1435
|
+
this.injector = injector;
|
|
1436
|
+
this.cfr = cfr;
|
|
1437
|
+
}
|
|
1438
|
+
open(content, userConfig = {}) {
|
|
1439
|
+
const config = new DialogConfig({ ...this.globalConfig, ...userConfig });
|
|
1440
|
+
const overlayRef = this.createOverlay(config);
|
|
1441
|
+
const dialogRef = new DDDialogRef(overlayRef);
|
|
1442
|
+
this.dialogRef = dialogRef;
|
|
1443
|
+
const container = this.createContainer(config, overlayRef);
|
|
1444
|
+
this.createContent(config, content, container, dialogRef);
|
|
1445
|
+
this.registerCloseListeners(config, overlayRef, dialogRef);
|
|
1446
|
+
return dialogRef;
|
|
1447
|
+
}
|
|
1448
|
+
createOverlay(config) {
|
|
1449
|
+
const positionStrategy = this.createPositionStrategy();
|
|
1450
|
+
const scrollStrategy = this.createScrollStrategy(config.hasScroll);
|
|
1451
|
+
return this.overlay.create({
|
|
1452
|
+
positionStrategy,
|
|
1453
|
+
scrollStrategy,
|
|
1454
|
+
hasBackdrop: config.hasBackdrop,
|
|
1455
|
+
backdropClass: config.backdropClass,
|
|
1456
|
+
panelClass: config.dialogClass,
|
|
1457
|
+
});
|
|
1458
|
+
}
|
|
1459
|
+
createPositionStrategy() {
|
|
1460
|
+
return new GlobalPositionStrategy().centerVertically().centerHorizontally();
|
|
1461
|
+
}
|
|
1462
|
+
createScrollStrategy(hasScroll) {
|
|
1463
|
+
if (hasScroll) {
|
|
1464
|
+
return this.overlay.scrollStrategies.noop();
|
|
1465
|
+
}
|
|
1466
|
+
else {
|
|
1467
|
+
return this.overlay.scrollStrategies.block();
|
|
1468
|
+
}
|
|
1469
|
+
}
|
|
1470
|
+
createContainer(config, overlayRef) {
|
|
1471
|
+
const injector = new PortalInjector(this.createInjector(config), new WeakMap([[DialogConfig, config]]));
|
|
1472
|
+
const containerPortal = new ComponentPortal(DialogContainerComponent, null, injector, this.cfr);
|
|
1473
|
+
const containerRef = overlayRef.attach(containerPortal);
|
|
1474
|
+
return containerRef.instance;
|
|
1475
|
+
}
|
|
1476
|
+
createInjector(config) {
|
|
1477
|
+
return (config.viewContainerRef && config.viewContainerRef.injector) || this.injector;
|
|
1478
|
+
}
|
|
1479
|
+
createContent(config, content, container, dialogRef) {
|
|
1480
|
+
if (content instanceof TemplateRef) {
|
|
1481
|
+
const portal = this.createTemplatePortal(config, content, dialogRef);
|
|
1482
|
+
container.attachTemplatePortal(portal);
|
|
1483
|
+
}
|
|
1484
|
+
else {
|
|
1485
|
+
const portal = this.createComponentPortal(config, content, dialogRef);
|
|
1486
|
+
dialogRef.componentRef = container.attachComponentPortal(portal);
|
|
1487
|
+
if (config.context) {
|
|
1488
|
+
Object.assign(dialogRef.componentRef.instance, { ...config.context });
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
createTemplatePortal(config, content, dialogRef) {
|
|
1493
|
+
return new TemplatePortal(content, {}, { $implicit: config.context, dialogRef });
|
|
1494
|
+
}
|
|
1495
|
+
createComponentPortal(config, content, dialogRef) {
|
|
1496
|
+
const injector = this.createInjector(config);
|
|
1497
|
+
const portalInjector = new PortalInjector(injector, new WeakMap([[DDDialogRef, dialogRef]]));
|
|
1498
|
+
return new ComponentPortal(content, config.viewContainerRef, portalInjector);
|
|
1499
|
+
}
|
|
1500
|
+
registerCloseListeners(config, overlayRef, dialogRef) {
|
|
1501
|
+
if (config.closeOnBackdropClick) {
|
|
1502
|
+
overlayRef.backdropClick().subscribe(() => dialogRef.close());
|
|
1503
|
+
}
|
|
1504
|
+
if (config.closeOnEsc) {
|
|
1505
|
+
fromEvent(this.document, 'keyup')
|
|
1506
|
+
.pipe(filter((event) => event.keyCode === 27), takeUntil(dialogRef.onClose))
|
|
1507
|
+
.subscribe(() => dialogRef.close());
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DialogService, deps: [{ token: DOCUMENT }, { token: DIALOG_CONFIG }, { token: i1$4.Overlay }, { token: i0.Injector }, { token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1511
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DialogService, providedIn: 'root' }); }
|
|
1512
|
+
}
|
|
1513
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: DialogService, decorators: [{
|
|
1514
|
+
type: Injectable,
|
|
1515
|
+
args: [{ providedIn: 'root' }]
|
|
1516
|
+
}], ctorParameters: () => [{ type: Document, decorators: [{
|
|
1517
|
+
type: Inject,
|
|
1518
|
+
args: [DOCUMENT]
|
|
1519
|
+
}] }, { type: DialogConfig, decorators: [{
|
|
1520
|
+
type: Inject,
|
|
1521
|
+
args: [DIALOG_CONFIG]
|
|
1522
|
+
}] }, { type: i1$4.Overlay }, { type: i0.Injector }, { type: i0.ComponentFactoryResolver }] });
|
|
1523
|
+
|
|
1524
|
+
// services
|
|
1525
|
+
|
|
1526
|
+
class LibSvgIconComponent {
|
|
1527
|
+
set icon(iconName) {
|
|
1528
|
+
const svgData = this.svgIconRegistry.getIcon(iconName);
|
|
1529
|
+
if (this.svgIcon) {
|
|
1530
|
+
this.el.nativeElement.removeChild(this.svgIcon);
|
|
1531
|
+
}
|
|
1532
|
+
if (svgData) {
|
|
1533
|
+
this.svgIcon = this.svgElementFromString(svgData);
|
|
1534
|
+
if (this.width) {
|
|
1535
|
+
this.rdr.setStyle(this.svgIcon, 'width', this.width);
|
|
1536
|
+
}
|
|
1537
|
+
if (this.height) {
|
|
1538
|
+
}
|
|
1539
|
+
if (this.color) {
|
|
1540
|
+
this.rdr.setStyle(this.svgIcon, 'fill', this.color);
|
|
1541
|
+
}
|
|
1542
|
+
this.el.nativeElement.appendChild(this.svgIcon);
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
1545
|
+
constructor(el, rdr, svgIconRegistry, document) {
|
|
1546
|
+
this.el = el;
|
|
1547
|
+
this.rdr = rdr;
|
|
1548
|
+
this.svgIconRegistry = svgIconRegistry;
|
|
1549
|
+
this.document = document;
|
|
1550
|
+
}
|
|
1551
|
+
svgElementFromString(svgContent) {
|
|
1552
|
+
const div = this.document.createElement('DIV');
|
|
1553
|
+
div.innerHTML = svgContent;
|
|
1554
|
+
return div.querySelector('svg') || this.document.createElementNS('http://www.w3.org/200/svg', 'path');
|
|
1555
|
+
}
|
|
1556
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibSvgIconComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: SvgIconsService }, { token: DOCUMENT, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1557
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LibSvgIconComponent, isStandalone: true, selector: "dd-lib-svg-icon", inputs: { width: "width", height: "height", color: "color", icon: "icon" }, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, styles: [""], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1558
|
+
}
|
|
1559
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibSvgIconComponent, decorators: [{
|
|
1560
|
+
type: Component,
|
|
1561
|
+
args: [{ selector: 'dd-lib-svg-icon', standalone: true, imports: [], template: '<ng-content></ng-content>', changeDetection: ChangeDetectionStrategy.OnPush }]
|
|
1562
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: SvgIconsService }, { type: undefined, decorators: [{
|
|
1563
|
+
type: Optional
|
|
1564
|
+
}, {
|
|
1565
|
+
type: Inject,
|
|
1566
|
+
args: [DOCUMENT]
|
|
1567
|
+
}] }], propDecorators: { width: [{
|
|
1568
|
+
type: Input
|
|
1569
|
+
}], height: [{
|
|
1570
|
+
type: Input
|
|
1571
|
+
}], color: [{
|
|
1572
|
+
type: Input
|
|
1573
|
+
}], icon: [{
|
|
1574
|
+
type: Input
|
|
1575
|
+
}] } });
|
|
1576
|
+
|
|
1577
|
+
class LibAccordionComponent {
|
|
1578
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibAccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1579
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: LibAccordionComponent, isStandalone: true, selector: "dd-lib-accordion", inputs: { accTitle: "accTitle" }, ngImport: i0, template: "<div class=\"accordion\">\r\n <div (click)=\"showAccordionContent = !showAccordionContent\" class=\"accordion__header\">\r\n @if (accTitle) {\r\n <div [innerHTML]=\"accTitle\" class=\"accordion__title\"></div>\r\n }\r\n <div>\r\n <dd-lib-svg-icon class=\"cup\" icon=\"{{ showAccordionContent ? 'minus' : 'plus' }}\"></dd-lib-svg-icon>\r\n </div>\r\n </div>\r\n @if (showAccordionContent) {\r\n <div class=\"mt-8\">\r\n <ng-content></ng-content>\r\n </div>\r\n }\r\n</div>\r\n", styles: [""], dependencies: [{ kind: "component", type: LibSvgIconComponent, selector: "dd-lib-svg-icon", inputs: ["width", "height", "color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1580
|
+
}
|
|
1581
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibAccordionComponent, decorators: [{
|
|
1582
|
+
type: Component,
|
|
1583
|
+
args: [{ selector: 'dd-lib-accordion', standalone: true, imports: [NgOptimizedImage, LibSvgIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"accordion\">\r\n <div (click)=\"showAccordionContent = !showAccordionContent\" class=\"accordion__header\">\r\n @if (accTitle) {\r\n <div [innerHTML]=\"accTitle\" class=\"accordion__title\"></div>\r\n }\r\n <div>\r\n <dd-lib-svg-icon class=\"cup\" icon=\"{{ showAccordionContent ? 'minus' : 'plus' }}\"></dd-lib-svg-icon>\r\n </div>\r\n </div>\r\n @if (showAccordionContent) {\r\n <div class=\"mt-8\">\r\n <ng-content></ng-content>\r\n </div>\r\n }\r\n</div>\r\n" }]
|
|
1584
|
+
}], propDecorators: { accTitle: [{
|
|
1585
|
+
type: Input
|
|
1586
|
+
}] } });
|
|
1587
|
+
|
|
1588
|
+
class LibBackButtonComponent {
|
|
1589
|
+
constructor(location, router) {
|
|
1590
|
+
this.location = location;
|
|
1591
|
+
this.router = router;
|
|
1592
|
+
this.backTitle = 'Назад';
|
|
1593
|
+
}
|
|
1594
|
+
onBack() {
|
|
1595
|
+
if (this.rout) {
|
|
1596
|
+
this.router.navigate([this.rout]);
|
|
1597
|
+
}
|
|
1598
|
+
else {
|
|
1599
|
+
try {
|
|
1600
|
+
this.location.back();
|
|
1601
|
+
}
|
|
1602
|
+
catch (err) {
|
|
1603
|
+
this.router.navigate(['/']);
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
}
|
|
1607
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibBackButtonComponent, deps: [{ token: i1.Location }, { token: i1$1.Router }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1608
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LibBackButtonComponent, isStandalone: true, selector: "dd-lib-back-button", inputs: { backTitle: "backTitle", rout: "rout" }, ngImport: i0, template: "<div (click)=\"onBack()\" class=\"mr-8 align-center cup d-inline-flex\">\r\n <dd-lib-svg-icon icon=\"back_arrow\"></dd-lib-svg-icon>\r\n <div class=\"b3-title gray cup\">{{ backTitle }}</div>\r\n</div>\r\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "component", type: LibSvgIconComponent, selector: "dd-lib-svg-icon", inputs: ["width", "height", "color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1609
|
+
}
|
|
1610
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibBackButtonComponent, decorators: [{
|
|
1611
|
+
type: Component,
|
|
1612
|
+
args: [{ selector: 'dd-lib-back-button', standalone: true, imports: [NgOptimizedImage, LibSvgIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div (click)=\"onBack()\" class=\"mr-8 align-center cup d-inline-flex\">\r\n <dd-lib-svg-icon icon=\"back_arrow\"></dd-lib-svg-icon>\r\n <div class=\"b3-title gray cup\">{{ backTitle }}</div>\r\n</div>\r\n", styles: [":host{display:block}\n"] }]
|
|
1613
|
+
}], ctorParameters: () => [{ type: i1.Location }, { type: i1$1.Router }], propDecorators: { backTitle: [{
|
|
1614
|
+
type: Input
|
|
1615
|
+
}], rout: [{
|
|
1616
|
+
type: Input
|
|
1617
|
+
}] } });
|
|
1618
|
+
|
|
1619
|
+
class LibFilterButtonComponent extends LibCommonButtonComponent {
|
|
1620
|
+
constructor() {
|
|
1621
|
+
super(...arguments);
|
|
1622
|
+
// public onClick(event: Event): void {
|
|
1623
|
+
// super.onClick(event);
|
|
1624
|
+
// // this.active = !this.active;
|
|
1625
|
+
// }
|
|
1626
|
+
this.clearEvent = new EventEmitter();
|
|
1627
|
+
this.hintEvent = new EventEmitter();
|
|
1628
|
+
}
|
|
1629
|
+
onClear($event) {
|
|
1630
|
+
$event.preventDefault();
|
|
1631
|
+
$event.stopPropagation();
|
|
1632
|
+
this.active = false;
|
|
1633
|
+
this.clearEvent.emit();
|
|
1634
|
+
}
|
|
1635
|
+
hintClick($event) {
|
|
1636
|
+
$event.stopPropagation();
|
|
1637
|
+
$event.preventDefault();
|
|
1638
|
+
this.hintEvent.emit();
|
|
1639
|
+
}
|
|
1640
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibFilterButtonComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
1641
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: LibFilterButtonComponent, isStandalone: true, selector: "dd-lib-filter-button", inputs: { hintContent: "hintContent" }, outputs: { clearEvent: "clearEvent", hintEvent: "hintEvent" }, usesInheritance: true, ngImport: i0, template: "<div (click)=\"onClick($event)\" [class.disabled]=\"disabled\" [ngStyle]=\"{width}\" class=\"button-container\">\r\n <button\r\n #btn\r\n [attr.tabIndex]=\"disabled ? -1 : 0\"\r\n [autofocus]=\"autofocus\"\r\n [disabled]=\"disabled\"\r\n [ngClass]=\"{\r\n disabled: disabled,\r\n loader: showLoader,\r\n active: active,\r\n white: btnColor === 'white',\r\n transparent: btnColor === 'transparent',\r\n }\"\r\n [type]=\"buttonType\"\r\n class=\"\"\r\n role=\"button\">\r\n @if (!showLoader) {\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n } @if (showLoader) {\r\n <div class=\"loader\"></div>\r\n }\r\n </button>\r\n</div>\r\n\r\n<ng-template #content>\r\n <span #contentData><ng-content></ng-content></span>\r\n @if (hintContent) {\r\n <img\r\n (click)=\"hintClick($event)\"\r\n alt=\"\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435\"\r\n [ddTooltip]=\"hintContent\"\r\n [withClick]=\"true\"\r\n class=\"ml-8\"\r\n height=\"16\"\r\n ngSrc=\"assets/images/svg/question{{ active ? '-white-g' : '' }}.svg\"\r\n width=\"16\" />\r\n } @if (active) {\r\n <img\r\n (click)=\"onClear($event)\"\r\n alt=\"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C\"\r\n class=\"ml-8 cup\"\r\n height=\"20\"\r\n ngSrc=\"assets/images/svg/close.svg\"\r\n width=\"20\" />\r\n }\r\n</ng-template>\r\n", styles: [".button-container{display:inline-block}.button-container button{display:flex;align-items:center;justify-content:center;height:var(--btn-height);font-size:14px;line-height:24px;outline:none;cursor:pointer;white-space:nowrap;color:var(--black-color);background-color:var(--btn-white-bgc);border:1px solid var(--gray-color-200);border-radius:var(--btn-border-round-radius);padding:var(--btn-round-padding);font-weight:var(--font-wheit-small)}.button-container button.loader{min-width:100px}.button-container button .loader{width:24px;height:24px;background:url('data:image/svg+xml,<svg fill=\"none\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\">%0D%0A <path%0D%0A d=\"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z\"%0D%0A stroke=\"%23306030E8\" stroke-width=\"4\"/>%0D%0A <mask height=\"24\" id=\"mask0\" mask-type=\"alpha\" maskUnits=\"userSpaceOnUse\" width=\"24\" x=\"0\" y=\"0\">%0D%0A <path%0D%0A d=\"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z\"%0D%0A stroke=\"%23FAFCFF\" stroke-width=\"4\"/>%0D%0A </mask>%0D%0A <g mask=\"url(%23mask0)\">%0D%0A <path d=\"M24.5621 -0.445973L12.0781 -0.00292969L12.9376 24.2163L25.4216 23.7733L24.5621 -0.445973Z\" fill=\"white\"/>%0D%0A <path%0D%0A d=\"M12.2578 4C13.3624 4 14.2578 3.10457 14.2578 2C14.2578 0.89543 13.3624 0 12.2578 0C11.1532 0 10.2578 0.89543 10.2578 2C10.2578 3.10457 11.1532 4 12.2578 4Z\"%0D%0A fill=\"white\"/>%0D%0A <path%0D%0A d=\"M12.916 23.9609C14.0206 23.9609 14.916 23.0655 14.916 21.9609C14.916 20.8564 14.0206 19.9609 12.916 19.9609C11.8114 19.9609 10.916 20.8564 10.916 21.9609C10.916 23.0655 11.8114 23.9609 12.916 23.9609Z\"%0D%0A fill=\"white\"/>%0D%0A </g>%0D%0A</svg>%0D%0A') center no-repeat;animation:rotate 1.5s linear infinite}.button-container button:hover{color:var(--btn-white-hover-color)}.button-container button.transparent{background-color:transparent}.button-container button.active{color:var(--white-color);background-color:var(--primary-green-color)}.button-container button.active:hover{background-color:var(--btn-green-hover)}.button-container button.disabled{color:var(--disabled-color);background-color:var(--btn-disabled-bgc);pointer-events:none;cursor:default}@keyframes rotate{to{transform:rotate(360deg)}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "placeholder", "placeholderConfig", "src", "srcset"] }, { kind: "directive", type: TooltipDirective, selector: "[ddTooltip]", inputs: ["ddTooltip", "withClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1642
|
+
}
|
|
1643
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibFilterButtonComponent, decorators: [{
|
|
1644
|
+
type: Component,
|
|
1645
|
+
args: [{ selector: 'dd-lib-filter-button', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, FormsModule, NgOptimizedImage, TooltipDirective], schemas: [CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA], template: "<div (click)=\"onClick($event)\" [class.disabled]=\"disabled\" [ngStyle]=\"{width}\" class=\"button-container\">\r\n <button\r\n #btn\r\n [attr.tabIndex]=\"disabled ? -1 : 0\"\r\n [autofocus]=\"autofocus\"\r\n [disabled]=\"disabled\"\r\n [ngClass]=\"{\r\n disabled: disabled,\r\n loader: showLoader,\r\n active: active,\r\n white: btnColor === 'white',\r\n transparent: btnColor === 'transparent',\r\n }\"\r\n [type]=\"buttonType\"\r\n class=\"\"\r\n role=\"button\">\r\n @if (!showLoader) {\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n } @if (showLoader) {\r\n <div class=\"loader\"></div>\r\n }\r\n </button>\r\n</div>\r\n\r\n<ng-template #content>\r\n <span #contentData><ng-content></ng-content></span>\r\n @if (hintContent) {\r\n <img\r\n (click)=\"hintClick($event)\"\r\n alt=\"\u041E\u043F\u0438\u0441\u0430\u043D\u0438\u0435\"\r\n [ddTooltip]=\"hintContent\"\r\n [withClick]=\"true\"\r\n class=\"ml-8\"\r\n height=\"16\"\r\n ngSrc=\"assets/images/svg/question{{ active ? '-white-g' : '' }}.svg\"\r\n width=\"16\" />\r\n } @if (active) {\r\n <img\r\n (click)=\"onClear($event)\"\r\n alt=\"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C\"\r\n class=\"ml-8 cup\"\r\n height=\"20\"\r\n ngSrc=\"assets/images/svg/close.svg\"\r\n width=\"20\" />\r\n }\r\n</ng-template>\r\n", styles: [".button-container{display:inline-block}.button-container button{display:flex;align-items:center;justify-content:center;height:var(--btn-height);font-size:14px;line-height:24px;outline:none;cursor:pointer;white-space:nowrap;color:var(--black-color);background-color:var(--btn-white-bgc);border:1px solid var(--gray-color-200);border-radius:var(--btn-border-round-radius);padding:var(--btn-round-padding);font-weight:var(--font-wheit-small)}.button-container button.loader{min-width:100px}.button-container button .loader{width:24px;height:24px;background:url('data:image/svg+xml,<svg fill=\"none\" height=\"24\" viewBox=\"0 0 24 24\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\">%0D%0A <path%0D%0A d=\"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z\"%0D%0A stroke=\"%23306030E8\" stroke-width=\"4\"/>%0D%0A <mask height=\"24\" id=\"mask0\" mask-type=\"alpha\" maskUnits=\"userSpaceOnUse\" width=\"24\" x=\"0\" y=\"0\">%0D%0A <path%0D%0A d=\"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z\"%0D%0A stroke=\"%23FAFCFF\" stroke-width=\"4\"/>%0D%0A </mask>%0D%0A <g mask=\"url(%23mask0)\">%0D%0A <path d=\"M24.5621 -0.445973L12.0781 -0.00292969L12.9376 24.2163L25.4216 23.7733L24.5621 -0.445973Z\" fill=\"white\"/>%0D%0A <path%0D%0A d=\"M12.2578 4C13.3624 4 14.2578 3.10457 14.2578 2C14.2578 0.89543 13.3624 0 12.2578 0C11.1532 0 10.2578 0.89543 10.2578 2C10.2578 3.10457 11.1532 4 12.2578 4Z\"%0D%0A fill=\"white\"/>%0D%0A <path%0D%0A d=\"M12.916 23.9609C14.0206 23.9609 14.916 23.0655 14.916 21.9609C14.916 20.8564 14.0206 19.9609 12.916 19.9609C11.8114 19.9609 10.916 20.8564 10.916 21.9609C10.916 23.0655 11.8114 23.9609 12.916 23.9609Z\"%0D%0A fill=\"white\"/>%0D%0A </g>%0D%0A</svg>%0D%0A') center no-repeat;animation:rotate 1.5s linear infinite}.button-container button:hover{color:var(--btn-white-hover-color)}.button-container button.transparent{background-color:transparent}.button-container button.active{color:var(--white-color);background-color:var(--primary-green-color)}.button-container button.active:hover{background-color:var(--btn-green-hover)}.button-container button.disabled{color:var(--disabled-color);background-color:var(--btn-disabled-bgc);pointer-events:none;cursor:default}@keyframes rotate{to{transform:rotate(360deg)}}\n"] }]
|
|
1646
|
+
}], propDecorators: { clearEvent: [{
|
|
1647
|
+
type: Output
|
|
1648
|
+
}], hintEvent: [{
|
|
1649
|
+
type: Output
|
|
1650
|
+
}], hintContent: [{
|
|
1651
|
+
type: Input
|
|
1652
|
+
}] } });
|
|
1653
|
+
|
|
1654
|
+
class LibSkeletonComponent {
|
|
1655
|
+
set skeleton(s) {
|
|
1656
|
+
if (s === true) {
|
|
1657
|
+
this._skeleton = s;
|
|
1658
|
+
this.cdr.detectChanges();
|
|
1659
|
+
}
|
|
1660
|
+
else {
|
|
1661
|
+
setTimeout(() => {
|
|
1662
|
+
this._skeleton = s;
|
|
1663
|
+
this.cdr.detectChanges();
|
|
1664
|
+
}, 1000);
|
|
1665
|
+
}
|
|
1666
|
+
}
|
|
1667
|
+
set plugs(n) {
|
|
1668
|
+
if (n && n > 0) {
|
|
1669
|
+
this._plugs = Array.from(Array(n).keys());
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
constructor(cdr) {
|
|
1673
|
+
this.cdr = cdr;
|
|
1674
|
+
this.sHeight = '200px';
|
|
1675
|
+
this._plugs = [];
|
|
1676
|
+
this.length = length;
|
|
1677
|
+
}
|
|
1678
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibSkeletonComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1679
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: LibSkeletonComponent, isStandalone: true, selector: "dd-lib-skeleton", inputs: { deepParent: "deepParent", sHeight: "sHeight", sMb: "sMb", skeleton: "skeleton", plugs: "plugs" }, ngImport: i0, template: "@if (_skeleton && _plugs.length) { @for (plug of _plugs; track plug) {\r\n<div\r\n [class.skeleton]=\"_skeleton\"\r\n [style.height]=\"_skeleton ? sHeight : ''\"\r\n [style.margin-bottom]=\"sMb\"\r\n class=\"skelet full-width full-height\"></div>\r\n} } @else {\r\n<div [style.height]=\"_skeleton ? sHeight : ''\" [class.skeleton]=\"_skeleton\" [ddAutoHeight]=\"deepParent\">\r\n <ng-content></ng-content>\r\n</div>\r\n}\r\n", styles: [":host{min-width:100%}.skeleton{position:relative;overflow:hidden;min-height:100%}.skeleton:after{position:absolute;inset:0;transform:translate(-100%);background-image:linear-gradient(90deg,#d0cdcd00 0,#d0cdcd33 20%,#d0cdcd80 60%,#d0cdcd00);animation:shimmer 2s infinite;content:\"\"}@keyframes shimmer{to{transform:translate(100%)}}.skelet{min-height:100%;border-radius:24px}\n"], dependencies: [{ kind: "directive", type: AutoHeightDirective, selector: "[ddAutoHeight]", inputs: ["ddAutoHeight"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1680
|
+
}
|
|
1681
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibSkeletonComponent, decorators: [{
|
|
1682
|
+
type: Component,
|
|
1683
|
+
args: [{ selector: 'dd-lib-skeleton', standalone: true, imports: [AutoHeightDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (_skeleton && _plugs.length) { @for (plug of _plugs; track plug) {\r\n<div\r\n [class.skeleton]=\"_skeleton\"\r\n [style.height]=\"_skeleton ? sHeight : ''\"\r\n [style.margin-bottom]=\"sMb\"\r\n class=\"skelet full-width full-height\"></div>\r\n} } @else {\r\n<div [style.height]=\"_skeleton ? sHeight : ''\" [class.skeleton]=\"_skeleton\" [ddAutoHeight]=\"deepParent\">\r\n <ng-content></ng-content>\r\n</div>\r\n}\r\n", styles: [":host{min-width:100%}.skeleton{position:relative;overflow:hidden;min-height:100%}.skeleton:after{position:absolute;inset:0;transform:translate(-100%);background-image:linear-gradient(90deg,#d0cdcd00 0,#d0cdcd33 20%,#d0cdcd80 60%,#d0cdcd00);animation:shimmer 2s infinite;content:\"\"}@keyframes shimmer{to{transform:translate(100%)}}.skelet{min-height:100%;border-radius:24px}\n"] }]
|
|
1684
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { deepParent: [{
|
|
1685
|
+
type: Input
|
|
1686
|
+
}], sHeight: [{
|
|
1687
|
+
type: Input
|
|
1688
|
+
}], sMb: [{
|
|
1689
|
+
type: Input
|
|
1690
|
+
}], skeleton: [{
|
|
1691
|
+
type: Input
|
|
1692
|
+
}], plugs: [{
|
|
1693
|
+
type: Input
|
|
1694
|
+
}] } });
|
|
1695
|
+
|
|
1696
|
+
class LibCardComponent {
|
|
1697
|
+
constructor(cdr) {
|
|
1698
|
+
this.cdr = cdr;
|
|
1699
|
+
this.type = 'standard';
|
|
1700
|
+
this.borderRadius = 'all';
|
|
1701
|
+
this.cardBtnEvent = new EventEmitter();
|
|
1702
|
+
}
|
|
1703
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibCardComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1704
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: LibCardComponent, isStandalone: true, selector: "dd-lib-card", inputs: { type: "type", footerBtn: "footerBtn", sHeight: "sHeight", skeleton: "skeleton", parentLvlForSkeleton: "parentLvlForSkeleton", plugs: "plugs", borderRadius: "borderRadius" }, outputs: { cardBtnEvent: "cardBtnEvent" }, ngImport: i0, template: "<div\r\n class=\"lib-card-wrapper\"\r\n [class.border-r-bottom]=\"borderRadius === 'bottom'\"\r\n [class.border-r-none]=\"borderRadius === 'none'\"\r\n [class.border-r-top]=\"borderRadius === 'top'\"\r\n [class.giant-card]=\"type === 'giant'\"\r\n [class.small-card]=\"type === 'small'\"\r\n [class.with-footer]=\"!!footerBtn\">\r\n <dd-lib-skeleton\r\n [deepParent]=\"parentLvlForSkeleton\"\r\n [skeleton]=\"skeleton\"\r\n [plugs]=\"plugs\"\r\n [sHeight]=\"sHeight\">\r\n <div class=\"lib-card\">\r\n <ng-content></ng-content>\r\n </div>\r\n </dd-lib-skeleton>\r\n</div>\r\n@if (footerBtn) {\r\n<div (click)=\"cardBtnEvent.emit(); cdr.detectChanges()\" class=\"lib-card-footer-btn\">\r\n {{ footerBtn }}\r\n</div>\r\n}\r\n", styles: [":host{display:block}.lib-card-wrapper{overflow:hidden;border-radius:24px;box-shadow:var(--main-card-shadow);background-color:var(--main-card-color);min-height:100%}.lib-card-wrapper.border-r-bottom{border-radius:0 0 24px 24px}.lib-card-wrapper.border-r-top{border-radius:24px 24px 0 0}.lib-card-wrapper.border-r-none{border-radius:0}.lib-card-wrapper.small-card{border-radius:12px}.lib-card-wrapper.giant-card .lib-card{padding:32px}@media screen and (max-width: 480px){.lib-card-wrapper.giant-card .lib-card{padding:16px}}.lib-card-wrapper.with-footer{border-radius:24px 24px 0 0}.lib-card{min-height:100%;padding:24px}@media screen and (max-width: 480px){.lib-card{padding:16px}}.lib-card-footer-btn{border-radius:0 0 12px 12px;font-weight:500;background-color:var(--primary-green-color);color:var(--white-color);cursor:pointer;height:48px;display:flex;align-items:center;justify-content:center}\n"], dependencies: [{ kind: "component", type: LibSkeletonComponent, selector: "dd-lib-skeleton", inputs: ["deepParent", "sHeight", "sMb", "skeleton", "plugs"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1705
|
+
}
|
|
1706
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibCardComponent, decorators: [{
|
|
1707
|
+
type: Component,
|
|
1708
|
+
args: [{ selector: 'dd-lib-card', standalone: true, imports: [LibSkeletonComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\r\n class=\"lib-card-wrapper\"\r\n [class.border-r-bottom]=\"borderRadius === 'bottom'\"\r\n [class.border-r-none]=\"borderRadius === 'none'\"\r\n [class.border-r-top]=\"borderRadius === 'top'\"\r\n [class.giant-card]=\"type === 'giant'\"\r\n [class.small-card]=\"type === 'small'\"\r\n [class.with-footer]=\"!!footerBtn\">\r\n <dd-lib-skeleton\r\n [deepParent]=\"parentLvlForSkeleton\"\r\n [skeleton]=\"skeleton\"\r\n [plugs]=\"plugs\"\r\n [sHeight]=\"sHeight\">\r\n <div class=\"lib-card\">\r\n <ng-content></ng-content>\r\n </div>\r\n </dd-lib-skeleton>\r\n</div>\r\n@if (footerBtn) {\r\n<div (click)=\"cardBtnEvent.emit(); cdr.detectChanges()\" class=\"lib-card-footer-btn\">\r\n {{ footerBtn }}\r\n</div>\r\n}\r\n", styles: [":host{display:block}.lib-card-wrapper{overflow:hidden;border-radius:24px;box-shadow:var(--main-card-shadow);background-color:var(--main-card-color);min-height:100%}.lib-card-wrapper.border-r-bottom{border-radius:0 0 24px 24px}.lib-card-wrapper.border-r-top{border-radius:24px 24px 0 0}.lib-card-wrapper.border-r-none{border-radius:0}.lib-card-wrapper.small-card{border-radius:12px}.lib-card-wrapper.giant-card .lib-card{padding:32px}@media screen and (max-width: 480px){.lib-card-wrapper.giant-card .lib-card{padding:16px}}.lib-card-wrapper.with-footer{border-radius:24px 24px 0 0}.lib-card{min-height:100%;padding:24px}@media screen and (max-width: 480px){.lib-card{padding:16px}}.lib-card-footer-btn{border-radius:0 0 12px 12px;font-weight:500;background-color:var(--primary-green-color);color:var(--white-color);cursor:pointer;height:48px;display:flex;align-items:center;justify-content:center}\n"] }]
|
|
1709
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { type: [{
|
|
1710
|
+
type: Input
|
|
1711
|
+
}], footerBtn: [{
|
|
1712
|
+
type: Input
|
|
1713
|
+
}], sHeight: [{
|
|
1714
|
+
type: Input
|
|
1715
|
+
}], skeleton: [{
|
|
1716
|
+
type: Input
|
|
1717
|
+
}], parentLvlForSkeleton: [{
|
|
1718
|
+
type: Input
|
|
1719
|
+
}], plugs: [{
|
|
1720
|
+
type: Input
|
|
1721
|
+
}], borderRadius: [{
|
|
1722
|
+
type: Input
|
|
1723
|
+
}], cardBtnEvent: [{
|
|
1724
|
+
type: Output
|
|
1725
|
+
}] } });
|
|
1726
|
+
|
|
1727
|
+
class LibRadioComponent {
|
|
1728
|
+
constructor() {
|
|
1729
|
+
this.disabled = false; // состояние: по умолчанию - активное
|
|
1730
|
+
this.required = false;
|
|
1731
|
+
this.checked = false;
|
|
1732
|
+
this.changed = new EventEmitter();
|
|
1733
|
+
this.modelInitialization = true;
|
|
1734
|
+
}
|
|
1735
|
+
static { this.idCounter = 1; }
|
|
1736
|
+
ngOnInit() {
|
|
1737
|
+
if (!this.radioId) {
|
|
1738
|
+
this.radioId = 'dd-radio-' + LibRadioComponent.idCounter++;
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
onSelected(target) {
|
|
1742
|
+
this.checked = target?.checked;
|
|
1743
|
+
this.propagateChange(this.value);
|
|
1744
|
+
this.changed.emit(this.value);
|
|
1745
|
+
}
|
|
1746
|
+
registerOnChange(fn) {
|
|
1747
|
+
this.propagateChange = fn;
|
|
1748
|
+
}
|
|
1749
|
+
setDisabledState(disabled) {
|
|
1750
|
+
this.disabled = disabled;
|
|
1751
|
+
}
|
|
1752
|
+
registerOnTouched(fn) {
|
|
1753
|
+
this.onTouchedCallback = fn;
|
|
1754
|
+
}
|
|
1755
|
+
writeValue(value) {
|
|
1756
|
+
const isInitialization = this.modelInitialization;
|
|
1757
|
+
this.modelInitialization = false;
|
|
1758
|
+
if (this.checked !== undefined && value === undefined && isInitialization) {
|
|
1759
|
+
return;
|
|
1760
|
+
}
|
|
1761
|
+
this.checked = value === this.value;
|
|
1762
|
+
}
|
|
1763
|
+
propagateChange(_value) { }
|
|
1764
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibRadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1765
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LibRadioComponent, isStandalone: true, selector: "dd-lib-radio", inputs: { radioId: "radioId", disabled: "disabled", required: "required", name: "name", value: "value", checked: "checked" }, outputs: { changed: "changed" }, providers: [
|
|
1766
|
+
{
|
|
1767
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1768
|
+
useExisting: forwardRef(() => LibRadioComponent),
|
|
1769
|
+
multi: true,
|
|
1770
|
+
},
|
|
1771
|
+
], ngImport: i0, template: "<label [for]=\"radioId\" class=\"radio\">\n <input\n (change)=\"onSelected($event.target)\"\n [attr.aria-checked]=\"checked\"\n [attr.tabIndex]=\"disabled ? -1 : 0\"\n [attr.value]=\"value\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [id]=\"radioId\"\n [name]=\"name\"\n [ngClass]=\"{ disabled: disabled }\"\n [required]=\"required\"\n class=\"radio-input\"\n role=\"radio\"\n type=\"radio\" />\n <div [class.focused]=\"focused\" class=\"mark-wrap\">\n <div class=\"radio-button\"></div>\n </div>\n <div class=\"label-wrap\">\n <span><ng-content></ng-content></span>\n </div>\n</label>\n", styles: [":host{outline:none}.radio{display:flex;align-items:center;position:relative;font-size:16px;cursor:pointer}.radio-input{opacity:0;position:absolute;z-index:-1}.radio-input:focus{opacity:1;width:24px;height:24px;left:0;top:0;margin:0;border-color:#000}.radio-input:focus:not(:focus-visible){opacity:0;border:0;outline:0;margin:0;width:inherit;height:inherit}.radio-input:checked~.label-wrap{font-weight:700}.radio-input:checked+.mark-wrap{border:2px solid var(--radio-active-color)}.radio-input:checked+.mark-wrap .radio-button{background-color:var(--radio-active-color);border:2px solid #fff;width:16px;height:16px}.radio-input:checked:disabled+.mark-wrap,.radio-input:checked:disabled:hover+.mark-wrap{border-color:var(--radio-disabled);cursor:default}.radio-input:checked:disabled+.mark-wrap .radio-button,.radio-input:checked:disabled:hover+.mark-wrap .radio-button{cursor:default;background-color:var(--radio-disabled);border:2px solid #fff}.radio-input:disabled+.mark-wrap,.radio-input:disabled:hover+.mark-wrap{border-color:var(--radio-disabled);cursor:default}.radio-input:disabled+.mark-wrap .radio-button,.radio-input:disabled:hover+.mark-wrap .radio-button{cursor:default;border:2px solid #fff}.radio-input:hover+.mark-wrap{border-color:#1c1c1c}.radio-input:hover+.mark-wrap .radio-button{border-color:#1c1c1c}.radio-input:checked:hover+.mark-wrap{cursor:pointer;border:2px solid var(--radio-hover-color)}.radio-input:checked:hover+.mark-wrap .radio-button{cursor:pointer;background-color:var(--radio-hover-color);border:2px solid #fff}.mark-wrap{border-radius:100%;border:1px solid #d7d7d7;background:#fff;margin-right:12px}.radio-button{box-sizing:border-box;border-radius:100%;width:18px;height:18px}.label-wrap{display:inline-block;line-height:19px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: ReactiveFormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1772
|
+
}
|
|
1773
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibRadioComponent, decorators: [{
|
|
1774
|
+
type: Component,
|
|
1775
|
+
args: [{ selector: 'dd-lib-radio', standalone: true, imports: [CommonModule, FormsModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
1776
|
+
{
|
|
1777
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1778
|
+
useExisting: forwardRef(() => LibRadioComponent),
|
|
1779
|
+
multi: true,
|
|
1780
|
+
},
|
|
1781
|
+
], template: "<label [for]=\"radioId\" class=\"radio\">\n <input\n (change)=\"onSelected($event.target)\"\n [attr.aria-checked]=\"checked\"\n [attr.tabIndex]=\"disabled ? -1 : 0\"\n [attr.value]=\"value\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [id]=\"radioId\"\n [name]=\"name\"\n [ngClass]=\"{ disabled: disabled }\"\n [required]=\"required\"\n class=\"radio-input\"\n role=\"radio\"\n type=\"radio\" />\n <div [class.focused]=\"focused\" class=\"mark-wrap\">\n <div class=\"radio-button\"></div>\n </div>\n <div class=\"label-wrap\">\n <span><ng-content></ng-content></span>\n </div>\n</label>\n", styles: [":host{outline:none}.radio{display:flex;align-items:center;position:relative;font-size:16px;cursor:pointer}.radio-input{opacity:0;position:absolute;z-index:-1}.radio-input:focus{opacity:1;width:24px;height:24px;left:0;top:0;margin:0;border-color:#000}.radio-input:focus:not(:focus-visible){opacity:0;border:0;outline:0;margin:0;width:inherit;height:inherit}.radio-input:checked~.label-wrap{font-weight:700}.radio-input:checked+.mark-wrap{border:2px solid var(--radio-active-color)}.radio-input:checked+.mark-wrap .radio-button{background-color:var(--radio-active-color);border:2px solid #fff;width:16px;height:16px}.radio-input:checked:disabled+.mark-wrap,.radio-input:checked:disabled:hover+.mark-wrap{border-color:var(--radio-disabled);cursor:default}.radio-input:checked:disabled+.mark-wrap .radio-button,.radio-input:checked:disabled:hover+.mark-wrap .radio-button{cursor:default;background-color:var(--radio-disabled);border:2px solid #fff}.radio-input:disabled+.mark-wrap,.radio-input:disabled:hover+.mark-wrap{border-color:var(--radio-disabled);cursor:default}.radio-input:disabled+.mark-wrap .radio-button,.radio-input:disabled:hover+.mark-wrap .radio-button{cursor:default;border:2px solid #fff}.radio-input:hover+.mark-wrap{border-color:#1c1c1c}.radio-input:hover+.mark-wrap .radio-button{border-color:#1c1c1c}.radio-input:checked:hover+.mark-wrap{cursor:pointer;border:2px solid var(--radio-hover-color)}.radio-input:checked:hover+.mark-wrap .radio-button{cursor:pointer;background-color:var(--radio-hover-color);border:2px solid #fff}.mark-wrap{border-radius:100%;border:1px solid #d7d7d7;background:#fff;margin-right:12px}.radio-button{box-sizing:border-box;border-radius:100%;width:18px;height:18px}.label-wrap{display:inline-block;line-height:19px}\n"] }]
|
|
1782
|
+
}], propDecorators: { radioId: [{
|
|
1783
|
+
type: Input
|
|
1784
|
+
}], disabled: [{
|
|
1785
|
+
type: Input
|
|
1786
|
+
}], required: [{
|
|
1787
|
+
type: Input
|
|
1788
|
+
}], name: [{
|
|
1789
|
+
type: Input
|
|
1790
|
+
}], value: [{
|
|
1791
|
+
type: Input
|
|
1792
|
+
}], checked: [{
|
|
1793
|
+
type: Input
|
|
1794
|
+
}], changed: [{
|
|
1795
|
+
type: Output
|
|
1796
|
+
}] } });
|
|
1797
|
+
|
|
1798
|
+
const Months = [
|
|
1799
|
+
'Январь',
|
|
1800
|
+
'Февраль',
|
|
1801
|
+
'Март',
|
|
1802
|
+
'Апрель',
|
|
1803
|
+
'Май',
|
|
1804
|
+
'Июнь',
|
|
1805
|
+
'Июль',
|
|
1806
|
+
'Август',
|
|
1807
|
+
'Сентябрь',
|
|
1808
|
+
'Октябрь',
|
|
1809
|
+
'Ноябрь',
|
|
1810
|
+
'Декабрь',
|
|
1811
|
+
];
|
|
1812
|
+
/**
|
|
1813
|
+
Этот компонент используется для отображения календаря с возможностью выбора даты.
|
|
1814
|
+
Ниже приведено описание свойств и методов данного компонента:
|
|
1815
|
+
|
|
1816
|
+
Свойства:
|
|
1817
|
+
- @Input() public type: 'string' | 'number' | 'date' = 'string'; - тип данных для выбора даты.
|
|
1818
|
+
- @Input() public format = 'dd.MM.yyyy HH:mm'; - формат отображения даты.
|
|
1819
|
+
- @Input() public maxDate = new Date(); - максимальная дата, которую можно выбрать.
|
|
1820
|
+
- @Output() public emitDate = new EventEmitter<date | undefined>(); - событие, срабатывающее при выборе даты.
|
|
1821
|
+
- public dateValue: Date | undefined; - выбранная пользователем дата.
|
|
1822
|
+
- public months = Months; - массив с названиями месяцев.
|
|
1823
|
+
- public week = ['ПН', 'ВТ', 'СР', 'ЧТ', 'ПТ', 'СБ', 'ВС']; - массив с названиями дней недели.
|
|
1824
|
+
- public year = new Date().getFullYear(); - текущий год.
|
|
1825
|
+
- public month = new Date().getMonth(); - текущий месяц.
|
|
1826
|
+
- public day = new Date().getDay(); - текущий день недели.
|
|
1827
|
+
- public daysInMonth: IDaysInMonth; - количество дней в текущем месяце.
|
|
1828
|
+
- public currentDate = new Date(); - текущая выбранная дата.
|
|
1829
|
+
- public dateNow = new Date(); - текущая дата.
|
|
1830
|
+
- public onTouchedCallback: () => void; - функция обратного вызова при касании.
|
|
1831
|
+
|
|
1832
|
+
Методы:
|
|
1833
|
+
- public propagateChange(_value: Date): void {} - метод для обновления значения выбранной даты.
|
|
1834
|
+
- public ngOnInit(): void {} - метод жизненного цикла компонента, вызываемый при инициализации.
|
|
1835
|
+
- public setDayInMonth(): void {} - метод для установки количества дней в текущем месяце.
|
|
1836
|
+
- public changeMonth(number: number): void {} - метод для изменения месяца в календаре.
|
|
1837
|
+
- public getMonth(): string {} - метод для получения названия текущего месяца.
|
|
1838
|
+
- public registerOnChange(fn: any): void {} - метод для регистрации функции обратного вызова при изменении значения.
|
|
1839
|
+
- public registerOnTouched(fn: any): void {} - метод для регистрации функции обратного вызова при касании.
|
|
1840
|
+
- public writeValue(val: Date): void {} - метод для установки значения даты.
|
|
1841
|
+
- public selectDay(day: number): void {} - метод для выбора конкретного дня в календаре.
|
|
1842
|
+
- public selectDate(): void {} - метод для выбора даты и передачи значения через propagateChange и emitDate.
|
|
1843
|
+
- public checkHideDay(day: number): boolean {} - метод для проверки скрытия определенного дня в календаре.
|
|
1844
|
+
- public canselDate(): void {} - метод для отмены выбранной даты и сброса значений.
|
|
1845
|
+
**/
|
|
1846
|
+
class LibCalendarComponent {
|
|
1847
|
+
set maxDate(date) {
|
|
1848
|
+
if (date === 'current') {
|
|
1849
|
+
this._maxDate = new Date();
|
|
1850
|
+
}
|
|
1851
|
+
else if (typeof date === 'object') {
|
|
1852
|
+
this._maxDate = date;
|
|
1853
|
+
}
|
|
1854
|
+
else if (typeof date === 'string') {
|
|
1855
|
+
this._maxDate = parse(date, `${this.formatDate}${this.formatTime ? ' ' + this.formatTime : ''}`, new Date());
|
|
1856
|
+
}
|
|
1857
|
+
}
|
|
1858
|
+
set minDate(date) {
|
|
1859
|
+
if (date === 'current') {
|
|
1860
|
+
this._minDate = new Date();
|
|
1861
|
+
}
|
|
1862
|
+
else if (date === 'year') {
|
|
1863
|
+
this._minDate = new Date(new Date().setFullYear(new Date().getFullYear() - 1));
|
|
1864
|
+
}
|
|
1865
|
+
else if (date === 'month') {
|
|
1866
|
+
this._minDate = new Date(new Date().setMonth(new Date().getMonth() - 1));
|
|
1867
|
+
}
|
|
1868
|
+
else if (typeof date === 'object') {
|
|
1869
|
+
this._minDate = date;
|
|
1870
|
+
}
|
|
1871
|
+
else if (typeof date === 'string') {
|
|
1872
|
+
this._minDate = parse(date, `${this.formatDate}${this.formatTime ? ' ' + this.formatTime : ''}`, new Date());
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
constructor(dateService) {
|
|
1876
|
+
this.dateService = dateService;
|
|
1877
|
+
this.type = 'string';
|
|
1878
|
+
this.formatDate = 'dd.MM.yyyy';
|
|
1879
|
+
this.mode = 'full';
|
|
1880
|
+
this.emitDate = new EventEmitter();
|
|
1881
|
+
this.months = Months;
|
|
1882
|
+
this.week = ['ПН', 'ВТ', 'СР', 'ЧТ', 'ПТ', 'СБ', 'ВС'];
|
|
1883
|
+
this.year = new Date().getFullYear();
|
|
1884
|
+
this.month = new Date().getMonth();
|
|
1885
|
+
this.day = new Date().getDay();
|
|
1886
|
+
// minDate = setMinDate();
|
|
1887
|
+
this.currentDate = new Date();
|
|
1888
|
+
this.dateNow = new Date();
|
|
1889
|
+
}
|
|
1890
|
+
propagateChange(_value) { }
|
|
1891
|
+
ngOnInit() {
|
|
1892
|
+
this.setDayInMonth();
|
|
1893
|
+
}
|
|
1894
|
+
setDayInMonth() {
|
|
1895
|
+
this.daysInMonth = this.dateService.getDaysInMonth(this.month, this.year);
|
|
1896
|
+
}
|
|
1897
|
+
changeMonth(number) {
|
|
1898
|
+
const temp = new Date(this.currentDate);
|
|
1899
|
+
temp.setMonth(temp.getMonth() + number);
|
|
1900
|
+
this.month = temp.getMonth();
|
|
1901
|
+
this.year = temp.getFullYear();
|
|
1902
|
+
this.currentDate = temp;
|
|
1903
|
+
this.setDayInMonth();
|
|
1904
|
+
}
|
|
1905
|
+
getMonth() {
|
|
1906
|
+
if (this.currentDate) {
|
|
1907
|
+
return this.months[this.currentDate.getMonth()];
|
|
1908
|
+
}
|
|
1909
|
+
else {
|
|
1910
|
+
return this.months[this.month];
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
registerOnChange(fn) {
|
|
1914
|
+
this.propagateChange = fn;
|
|
1915
|
+
}
|
|
1916
|
+
registerOnTouched(fn) {
|
|
1917
|
+
this.onTouchedCallback = fn;
|
|
1918
|
+
}
|
|
1919
|
+
writeValue(val) {
|
|
1920
|
+
this.dateValue = val;
|
|
1921
|
+
}
|
|
1922
|
+
selectDay(day) {
|
|
1923
|
+
if (!this.checkHideDay(day)) {
|
|
1924
|
+
this.dateValue = new Date(this.year, this.month, day);
|
|
1925
|
+
}
|
|
1926
|
+
}
|
|
1927
|
+
selectDate() {
|
|
1928
|
+
this.propagateChange(this.dateValue);
|
|
1929
|
+
this.emitDate.emit(this.dateValue);
|
|
1930
|
+
this.showCalendar = false;
|
|
1931
|
+
}
|
|
1932
|
+
checkHideDay(day) {
|
|
1933
|
+
let moreDay = false;
|
|
1934
|
+
let moreMonth = false;
|
|
1935
|
+
let moreYear = false;
|
|
1936
|
+
const lessDay = false;
|
|
1937
|
+
const lessMonth = false;
|
|
1938
|
+
const lessYear = false;
|
|
1939
|
+
if (this._maxDate) {
|
|
1940
|
+
const [maxYear, maxMonth, maxDay] = [
|
|
1941
|
+
this._maxDate.getFullYear(),
|
|
1942
|
+
this._maxDate.getMonth(),
|
|
1943
|
+
this._maxDate.getDate(),
|
|
1944
|
+
];
|
|
1945
|
+
moreDay = this.year >= maxYear && this.month >= maxMonth && day > maxDay;
|
|
1946
|
+
moreMonth = this.year >= maxYear && this.month > maxMonth;
|
|
1947
|
+
moreYear = this.year > maxYear;
|
|
1948
|
+
}
|
|
1949
|
+
if (this._minDate) {
|
|
1950
|
+
const [minYear, minMonth, minDay] = [
|
|
1951
|
+
this._minDate.getFullYear(),
|
|
1952
|
+
this._minDate.getMonth(),
|
|
1953
|
+
this._minDate.getDate(),
|
|
1954
|
+
];
|
|
1955
|
+
moreDay = this.year <= minYear && this.month <= minMonth && day < minDay;
|
|
1956
|
+
moreMonth = this.year <= minYear && this.month < minMonth;
|
|
1957
|
+
moreYear = this.year < minYear;
|
|
1958
|
+
}
|
|
1959
|
+
return moreDay || moreMonth || moreYear || lessDay || lessMonth || lessYear;
|
|
1960
|
+
}
|
|
1961
|
+
canselDate() {
|
|
1962
|
+
this.emitDate.emit();
|
|
1963
|
+
this.dateValue = undefined;
|
|
1964
|
+
this.showCalendar = false;
|
|
1965
|
+
}
|
|
1966
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibCalendarComponent, deps: [{ token: DateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1967
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: LibCalendarComponent, isStandalone: true, selector: "dd-lib-calendar", inputs: { type: "type", formatDate: "formatDate", formatTime: "formatTime", mode: "mode", maxDate: "maxDate", minDate: "minDate" }, outputs: { emitDate: "emitDate" }, providers: [
|
|
1968
|
+
{
|
|
1969
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1970
|
+
useExisting: forwardRef(() => LibCalendarComponent),
|
|
1971
|
+
multi: true,
|
|
1972
|
+
},
|
|
1973
|
+
], ngImport: i0, template: "@if (mode === 'icon') {\r\n<div class=\"pos-relative d-flex align-center\">\r\n @if (dateValue) {\r\n <span class=\"mr-12 green\">{{ dateValue | date: 'dd.MM.yyyy' }}</span>\r\n }\r\n <dd-lib-svg-icon class=\"cup\" (click)=\"showCalendar = !showCalendar\" icon=\"calendar\"></dd-lib-svg-icon>\r\n @if (dateValue) {\r\n <dd-lib-svg-icon class=\"cup\" (click)=\"canselDate()\" icon=\"clear\"></dd-lib-svg-icon>\r\n } @if (showCalendar) {\r\n <div class=\"calendar-abs-wrapper\">\r\n <ng-template [ngTemplateOutlet]=\"calendar\"></ng-template>\r\n </div>\r\n }\r\n</div>\r\n} @if (mode === 'full') {\r\n<ng-template [ngTemplateOutlet]=\"calendar\"></ng-template>\r\n}\r\n\r\n<ng-template #calendar>\r\n <dd-lib-card class=\"calendar-block\" type=\"small\">\r\n <div class=\"calendar-block__header\">\r\n <div class=\"calendar-block__header_arrow\">\r\n <dd-lib-svg-icon (click)=\"changeMonth(-1)\" icon=\"left_chevron\"></dd-lib-svg-icon>\r\n </div>\r\n <div class=\"calendar-block__header_year\">{{ getMonth() + ' ' + year }}</div>\r\n <div class=\"calendar-block__header_arrow\">\r\n <dd-lib-svg-icon (click)=\"changeMonth(1)\" icon=\"right_chevron\"></dd-lib-svg-icon>\r\n </div>\r\n </div>\r\n <div class=\"calendar-block__week\">\r\n @for (day of week; track day) {\r\n <div class=\"calendar-block__week_day\">{{ day }}</div>\r\n }\r\n </div>\r\n <div class=\"calendar-block__days\">\r\n @for (day of daysInMonth?.prevDays; track day) {\r\n <div class=\"calendar-block__days_day hide\">{{ day }}</div>\r\n } @for (day of daysInMonth?.days; track day) {\r\n <div\r\n (click)=\"selectDay(day)\"\r\n [class.active]=\"\r\n dateValue?.getDate() === day && dateValue?.getMonth() === month && dateValue?.getFullYear() === year\r\n \"\r\n [class.current]=\"\r\n dateNow.getDate() === day && dateNow.getMonth() === month && dateNow.getFullYear() === year\r\n \"\r\n [class.hide]=\"checkHideDay(day)\"\r\n class=\"calendar-block__days_day normal\">\r\n {{ day }}\r\n </div>\r\n } @for (day of daysInMonth?.lastDays; track day) {\r\n <div class=\"calendar-block__days_day hide\">{{ day }}</div>\r\n }\r\n </div>\r\n <div class=\"calendar-block__footer\">\r\n <dd-lib-button (click)=\"canselDate()\" [btnColor]=\"'transparent'\" class=\"calendar-block__footer_btn\"\r\n >\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C\r\n </dd-lib-button>\r\n <dd-lib-button (click)=\"selectDate()\" [disabled]=\"!dateValue\" class=\"calendar-block__footer_btn\"\r\n >\u0412\u044B\u0431\u0440\u0430\u0442\u044C\r\n </dd-lib-button>\r\n </div>\r\n </dd-lib-card>\r\n</ng-template>\r\n", styles: [":host{display:block}.calendar-block{z-index:1100;display:block}.calendar-block__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:22px;color:var(--calendar-gray-color);font-size:14px;font-weight:400;line-height:24px}.calendar-block__header_arrow{cursor:pointer}.calendar-block__week{display:flex;align-items:center;justify-content:space-around;color:var(--primary-green-color);font-size:10px;font-weight:400;line-height:12px;letter-spacing:1.5px;margin-bottom:22px}.calendar-block__week_day{min-width:45px;display:flex;align-items:center;justify-content:space-around}.calendar-block__days{display:grid;grid-template-columns:repeat(auto-fit,minmax(30px,1fr));gap:14px;justify-items:center;margin-bottom:22px}.calendar-block__days_day{cursor:pointer;width:30px;height:30px;display:flex;align-items:center;justify-content:center;border-radius:29px}.calendar-block__days_day.current{border:1px solid var(--primary-green-color)}.calendar-block__days_day.active,.calendar-block__days_day.normal:hover{background-color:var(--primary-green-color);color:var(--white-color)}.calendar-block__days_day.hide{pointer-events:none;cursor:default;color:var(--calendar-gray-hide-color)}.calendar-block__footer{display:flex;align-items:center;justify-content:space-between}.calendar-abs-wrapper{position:absolute;box-shadow:var(--main-card-shadow);right:0;z-index:1111}\n"], dependencies: [{ kind: "component", type: LibCardComponent, selector: "dd-lib-card", inputs: ["type", "footerBtn", "sHeight", "skeleton", "parentLvlForSkeleton", "plugs", "borderRadius"], outputs: ["cardBtnEvent"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }, { kind: "component", type: LibButtonComponent, selector: "dd-lib-button", inputs: ["noPadding", "loaderColor"] }, { kind: "component", type: LibSvgIconComponent, selector: "dd-lib-svg-icon", inputs: ["width", "height", "color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1974
|
+
}
|
|
1975
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibCalendarComponent, decorators: [{
|
|
1976
|
+
type: Component,
|
|
1977
|
+
args: [{ selector: 'dd-lib-calendar', standalone: true, imports: [
|
|
1978
|
+
LibFilterButtonComponent,
|
|
1979
|
+
LibCardComponent,
|
|
1980
|
+
LibRadioComponent,
|
|
1981
|
+
CommonModule,
|
|
1982
|
+
LibButtonComponent,
|
|
1983
|
+
NgOptimizedImage,
|
|
1984
|
+
LibSvgIconComponent,
|
|
1985
|
+
], providers: [
|
|
1986
|
+
{
|
|
1987
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1988
|
+
useExisting: forwardRef(() => LibCalendarComponent),
|
|
1989
|
+
multi: true,
|
|
1990
|
+
},
|
|
1991
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (mode === 'icon') {\r\n<div class=\"pos-relative d-flex align-center\">\r\n @if (dateValue) {\r\n <span class=\"mr-12 green\">{{ dateValue | date: 'dd.MM.yyyy' }}</span>\r\n }\r\n <dd-lib-svg-icon class=\"cup\" (click)=\"showCalendar = !showCalendar\" icon=\"calendar\"></dd-lib-svg-icon>\r\n @if (dateValue) {\r\n <dd-lib-svg-icon class=\"cup\" (click)=\"canselDate()\" icon=\"clear\"></dd-lib-svg-icon>\r\n } @if (showCalendar) {\r\n <div class=\"calendar-abs-wrapper\">\r\n <ng-template [ngTemplateOutlet]=\"calendar\"></ng-template>\r\n </div>\r\n }\r\n</div>\r\n} @if (mode === 'full') {\r\n<ng-template [ngTemplateOutlet]=\"calendar\"></ng-template>\r\n}\r\n\r\n<ng-template #calendar>\r\n <dd-lib-card class=\"calendar-block\" type=\"small\">\r\n <div class=\"calendar-block__header\">\r\n <div class=\"calendar-block__header_arrow\">\r\n <dd-lib-svg-icon (click)=\"changeMonth(-1)\" icon=\"left_chevron\"></dd-lib-svg-icon>\r\n </div>\r\n <div class=\"calendar-block__header_year\">{{ getMonth() + ' ' + year }}</div>\r\n <div class=\"calendar-block__header_arrow\">\r\n <dd-lib-svg-icon (click)=\"changeMonth(1)\" icon=\"right_chevron\"></dd-lib-svg-icon>\r\n </div>\r\n </div>\r\n <div class=\"calendar-block__week\">\r\n @for (day of week; track day) {\r\n <div class=\"calendar-block__week_day\">{{ day }}</div>\r\n }\r\n </div>\r\n <div class=\"calendar-block__days\">\r\n @for (day of daysInMonth?.prevDays; track day) {\r\n <div class=\"calendar-block__days_day hide\">{{ day }}</div>\r\n } @for (day of daysInMonth?.days; track day) {\r\n <div\r\n (click)=\"selectDay(day)\"\r\n [class.active]=\"\r\n dateValue?.getDate() === day && dateValue?.getMonth() === month && dateValue?.getFullYear() === year\r\n \"\r\n [class.current]=\"\r\n dateNow.getDate() === day && dateNow.getMonth() === month && dateNow.getFullYear() === year\r\n \"\r\n [class.hide]=\"checkHideDay(day)\"\r\n class=\"calendar-block__days_day normal\">\r\n {{ day }}\r\n </div>\r\n } @for (day of daysInMonth?.lastDays; track day) {\r\n <div class=\"calendar-block__days_day hide\">{{ day }}</div>\r\n }\r\n </div>\r\n <div class=\"calendar-block__footer\">\r\n <dd-lib-button (click)=\"canselDate()\" [btnColor]=\"'transparent'\" class=\"calendar-block__footer_btn\"\r\n >\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C\r\n </dd-lib-button>\r\n <dd-lib-button (click)=\"selectDate()\" [disabled]=\"!dateValue\" class=\"calendar-block__footer_btn\"\r\n >\u0412\u044B\u0431\u0440\u0430\u0442\u044C\r\n </dd-lib-button>\r\n </div>\r\n </dd-lib-card>\r\n</ng-template>\r\n", styles: [":host{display:block}.calendar-block{z-index:1100;display:block}.calendar-block__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:22px;color:var(--calendar-gray-color);font-size:14px;font-weight:400;line-height:24px}.calendar-block__header_arrow{cursor:pointer}.calendar-block__week{display:flex;align-items:center;justify-content:space-around;color:var(--primary-green-color);font-size:10px;font-weight:400;line-height:12px;letter-spacing:1.5px;margin-bottom:22px}.calendar-block__week_day{min-width:45px;display:flex;align-items:center;justify-content:space-around}.calendar-block__days{display:grid;grid-template-columns:repeat(auto-fit,minmax(30px,1fr));gap:14px;justify-items:center;margin-bottom:22px}.calendar-block__days_day{cursor:pointer;width:30px;height:30px;display:flex;align-items:center;justify-content:center;border-radius:29px}.calendar-block__days_day.current{border:1px solid var(--primary-green-color)}.calendar-block__days_day.active,.calendar-block__days_day.normal:hover{background-color:var(--primary-green-color);color:var(--white-color)}.calendar-block__days_day.hide{pointer-events:none;cursor:default;color:var(--calendar-gray-hide-color)}.calendar-block__footer{display:flex;align-items:center;justify-content:space-between}.calendar-abs-wrapper{position:absolute;box-shadow:var(--main-card-shadow);right:0;z-index:1111}\n"] }]
|
|
1992
|
+
}], ctorParameters: () => [{ type: DateService }], propDecorators: { type: [{
|
|
1993
|
+
type: Input
|
|
1994
|
+
}], formatDate: [{
|
|
1995
|
+
type: Input
|
|
1996
|
+
}], formatTime: [{
|
|
1997
|
+
type: Input
|
|
1998
|
+
}], mode: [{
|
|
1999
|
+
type: Input
|
|
2000
|
+
}], emitDate: [{
|
|
2001
|
+
type: Output
|
|
2002
|
+
}], maxDate: [{
|
|
2003
|
+
type: Input
|
|
2004
|
+
}], minDate: [{
|
|
2005
|
+
type: Input
|
|
2006
|
+
}] } });
|
|
2007
|
+
|
|
2008
|
+
class LibCheckboxComponent {
|
|
2009
|
+
constructor() {
|
|
2010
|
+
this.required = false;
|
|
2011
|
+
this.disabled = false;
|
|
2012
|
+
this.checked = false;
|
|
2013
|
+
this.invalid = false;
|
|
2014
|
+
this.checkEvent = new EventEmitter();
|
|
2015
|
+
}
|
|
2016
|
+
static { this.idCounter = 1; }
|
|
2017
|
+
ngOnInit() {
|
|
2018
|
+
if (!this.checkboxId) {
|
|
2019
|
+
this.checkboxId = 'dd-checkbox-' + LibCheckboxComponent.idCounter++;
|
|
2020
|
+
}
|
|
2021
|
+
}
|
|
2022
|
+
registerOnChange(fn) {
|
|
2023
|
+
this.propagateChange = fn;
|
|
2024
|
+
}
|
|
2025
|
+
registerOnTouched(fn) {
|
|
2026
|
+
this.onTouchedCallback = fn;
|
|
2027
|
+
}
|
|
2028
|
+
onChecked(target) {
|
|
2029
|
+
this.checked = target?.checked;
|
|
2030
|
+
this.propagateChange(this.checked);
|
|
2031
|
+
this.checkEvent.emit(this.checked);
|
|
2032
|
+
}
|
|
2033
|
+
writeValue(value) {
|
|
2034
|
+
this.checked = value;
|
|
2035
|
+
}
|
|
2036
|
+
propagateChange(value) { }
|
|
2037
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibCheckboxComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2038
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LibCheckboxComponent, isStandalone: true, selector: "dd-lib-checkbox", inputs: { checkboxId: "checkboxId", required: "required", disabled: "disabled", checked: "checked", customClass: "customClass", invalid: "invalid" }, outputs: { checkEvent: "checkEvent" }, providers: [
|
|
2039
|
+
{
|
|
2040
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2041
|
+
useExisting: forwardRef(() => LibCheckboxComponent),
|
|
2042
|
+
multi: true,
|
|
2043
|
+
},
|
|
2044
|
+
], ngImport: i0, template: "<input\n (change)=\"onChecked($event.target)\"\n [checked]=\"checked\"\n [class.disabled]=\"disabled\"\n [class.invalid]=\"invalid\"\n [disabled]=\"disabled\"\n [id]=\"checkboxId\"\n [required]=\"required\"\n [tabindex]=\"disabled ? -1 : null\"\n class=\"check-input\"\n type=\"checkbox\" />\n<label [for]=\"checkboxId\" class=\"{{ customClass }} check\">\n <span [class.focused]=\"focused\" class=\"checkbox\"></span>\n <ng-content></ng-content>\n</label>\n", styles: [":host{outline:none;position:relative}.check{display:flex;position:relative;font-size:16px;width:fit-content;cursor:pointer;align-items:center}.check-input{appearance:none;position:absolute;opacity:0;width:20px;height:20px}.check-input:hover+label .checkbox{border-color:var(--light-black-color)}.check-input:hover:checked+label .checkbox{background:var(--cb-hover-bgc);border:none}.check-input:disabled+label,.check-input:disabled+label .checkbox,.check-input:hover:disabled+label,.check-input:hover:disabled+label .checkbox{cursor:default;pointer-events:none;border-color:var(--cb-init-border)}.check-input:disabled:checked+label .checkbox{cursor:default;pointer-events:none;border-color:var(--cb-init-border);background-color:var(--cb-init-border);font-weight:700}.check-input:checked+label{font-weight:700}.check-input:checked+label .checkbox{background:var(--cb-checked-bgc);border:none;position:relative}.check-input:checked+label .checkbox:before{content:\"\";background:url('data:image/svg+xml,<svg fill=\"none\" height=\"10\" viewBox=\"0 0 13 10\" width=\"13\" xmlns=\"http://www.w3.org/2000/svg\">%0D%0A <path d=\"M1.33301 5.00008L4.66634 8.33341L11.333 1.66675\" stroke=\"white\" stroke-linecap=\"round\"%0D%0A stroke-linejoin=\"round\"%0D%0A stroke-width=\"1.7\"/>%0D%0A</svg>%0D%0A') no-repeat;height:10px;position:absolute;width:13px;top:5px;left:4px}.checkbox{min-width:20px;min-height:20px;padding:3px;background-color:var(--white-color);border-radius:5px;border:1px solid var(--cb-init-border);cursor:pointer;margin-right:12px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2045
|
+
}
|
|
2046
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibCheckboxComponent, decorators: [{
|
|
2047
|
+
type: Component,
|
|
2048
|
+
args: [{ selector: 'dd-lib-checkbox', standalone: true, imports: [FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
2049
|
+
{
|
|
2050
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2051
|
+
useExisting: forwardRef(() => LibCheckboxComponent),
|
|
2052
|
+
multi: true,
|
|
2053
|
+
},
|
|
2054
|
+
], template: "<input\n (change)=\"onChecked($event.target)\"\n [checked]=\"checked\"\n [class.disabled]=\"disabled\"\n [class.invalid]=\"invalid\"\n [disabled]=\"disabled\"\n [id]=\"checkboxId\"\n [required]=\"required\"\n [tabindex]=\"disabled ? -1 : null\"\n class=\"check-input\"\n type=\"checkbox\" />\n<label [for]=\"checkboxId\" class=\"{{ customClass }} check\">\n <span [class.focused]=\"focused\" class=\"checkbox\"></span>\n <ng-content></ng-content>\n</label>\n", styles: [":host{outline:none;position:relative}.check{display:flex;position:relative;font-size:16px;width:fit-content;cursor:pointer;align-items:center}.check-input{appearance:none;position:absolute;opacity:0;width:20px;height:20px}.check-input:hover+label .checkbox{border-color:var(--light-black-color)}.check-input:hover:checked+label .checkbox{background:var(--cb-hover-bgc);border:none}.check-input:disabled+label,.check-input:disabled+label .checkbox,.check-input:hover:disabled+label,.check-input:hover:disabled+label .checkbox{cursor:default;pointer-events:none;border-color:var(--cb-init-border)}.check-input:disabled:checked+label .checkbox{cursor:default;pointer-events:none;border-color:var(--cb-init-border);background-color:var(--cb-init-border);font-weight:700}.check-input:checked+label{font-weight:700}.check-input:checked+label .checkbox{background:var(--cb-checked-bgc);border:none;position:relative}.check-input:checked+label .checkbox:before{content:\"\";background:url('data:image/svg+xml,<svg fill=\"none\" height=\"10\" viewBox=\"0 0 13 10\" width=\"13\" xmlns=\"http://www.w3.org/2000/svg\">%0D%0A <path d=\"M1.33301 5.00008L4.66634 8.33341L11.333 1.66675\" stroke=\"white\" stroke-linecap=\"round\"%0D%0A stroke-linejoin=\"round\"%0D%0A stroke-width=\"1.7\"/>%0D%0A</svg>%0D%0A') no-repeat;height:10px;position:absolute;width:13px;top:5px;left:4px}.checkbox{min-width:20px;min-height:20px;padding:3px;background-color:var(--white-color);border-radius:5px;border:1px solid var(--cb-init-border);cursor:pointer;margin-right:12px}\n"] }]
|
|
2055
|
+
}], propDecorators: { checkboxId: [{
|
|
2056
|
+
type: Input
|
|
2057
|
+
}], required: [{
|
|
2058
|
+
type: Input
|
|
2059
|
+
}], disabled: [{
|
|
2060
|
+
type: Input
|
|
2061
|
+
}], checked: [{
|
|
2062
|
+
type: Input
|
|
2063
|
+
}], customClass: [{
|
|
2064
|
+
type: Input
|
|
2065
|
+
}], invalid: [{
|
|
2066
|
+
type: Input
|
|
2067
|
+
}], checkEvent: [{
|
|
2068
|
+
type: Output
|
|
2069
|
+
}] } });
|
|
2070
|
+
|
|
2071
|
+
class LibCommentInputComponent extends LibCommonInputTextComponent {
|
|
2072
|
+
constructor(changeDetection) {
|
|
2073
|
+
super(changeDetection);
|
|
2074
|
+
}
|
|
2075
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibCommentInputComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2076
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LibCommentInputComponent, isStandalone: true, selector: "dd-lib-comment-input", usesInheritance: true, ngImport: i0, template: "<div class=\"lib-comment-textarea\">\n <textarea\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n [readOnly]=\"readOnly\"\n ddResizeTextarea\n type=\"text\"></textarea>\n <dd-lib-button [disabled]=\"disabled\" [noPadding]=\"true\" height=\"48px\" width=\"48px\">\n <svg fill=\"none\" height=\"28\" viewBox=\"0 0 24 22\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_429_4922)\">\n <path\n [attr.stroke]=\"disabled ? '#8e9cbe' : 'white'\"\n d=\"M10 14L21 3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.7\" />\n <path\n [attr.stroke]=\"disabled ? '#8e9cbe' : 'white'\"\n d=\"M21.0001 3L14.5001 21C14.4562 21.0957 14.3858 21.1769 14.2971 21.2338C14.2085 21.2906 14.1054 21.3209 14.0001 21.3209C13.8948 21.3209 13.7917 21.2906 13.703 21.2338C13.6144 21.1769 13.5439 21.0957 13.5001 21L10.0001 14L3.00007 10.5C2.90433 10.4561 2.8232 10.3857 2.76632 10.2971C2.70944 10.2084 2.6792 10.1053 2.6792 10C2.6792 9.89468 2.70944 9.79158 2.76632 9.70295C2.8232 9.61431 2.90433 9.54387 3.00007 9.5L21.0001 3Z\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.7\" />\n </g>\n <defs>\n <clipPath id=\"clip0_429_4922\">\n <rect [attr.fill]=\"disabled ? '#8e9cbe' : 'white'\" height=\"28\" width=\"24\" />\n </clipPath>\n </defs>\n </svg>\n </dd-lib-button>\n</div>\n", styles: [".lib-comment-textarea{position:relative;display:flex;align-items:center;flex-direction:row}.lib-comment-textarea textarea{margin-right:16px;width:100%;max-height:48px;padding:12px 16px;border-radius:12px;border:none;background-color:var(--gray-color-200);resize:none;box-sizing:inherit}.lib-comment-textarea textarea:disabled{background-color:var(--input-disable-input);pointer-events:none}.lib-comment-textarea textarea:disabled::placeholder{color:var(--disabled-color)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: LibButtonComponent, selector: "dd-lib-button", inputs: ["noPadding", "loaderColor"] }, { kind: "directive", type: ResizeTextareaDirective, selector: "[ddResizeTextarea]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2077
|
+
}
|
|
2078
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibCommentInputComponent, decorators: [{
|
|
2079
|
+
type: Component,
|
|
2080
|
+
args: [{ selector: 'dd-lib-comment-input', standalone: true, imports: [FormsModule, LibButtonComponent, NgOptimizedImage, ResizeTextareaDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"lib-comment-textarea\">\n <textarea\n [(ngModel)]=\"value\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder\"\n [readOnly]=\"readOnly\"\n ddResizeTextarea\n type=\"text\"></textarea>\n <dd-lib-button [disabled]=\"disabled\" [noPadding]=\"true\" height=\"48px\" width=\"48px\">\n <svg fill=\"none\" height=\"28\" viewBox=\"0 0 24 22\" width=\"24\" xmlns=\"http://www.w3.org/2000/svg\">\n <g clip-path=\"url(#clip0_429_4922)\">\n <path\n [attr.stroke]=\"disabled ? '#8e9cbe' : 'white'\"\n d=\"M10 14L21 3\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.7\" />\n <path\n [attr.stroke]=\"disabled ? '#8e9cbe' : 'white'\"\n d=\"M21.0001 3L14.5001 21C14.4562 21.0957 14.3858 21.1769 14.2971 21.2338C14.2085 21.2906 14.1054 21.3209 14.0001 21.3209C13.8948 21.3209 13.7917 21.2906 13.703 21.2338C13.6144 21.1769 13.5439 21.0957 13.5001 21L10.0001 14L3.00007 10.5C2.90433 10.4561 2.8232 10.3857 2.76632 10.2971C2.70944 10.2084 2.6792 10.1053 2.6792 10C2.6792 9.89468 2.70944 9.79158 2.76632 9.70295C2.8232 9.61431 2.90433 9.54387 3.00007 9.5L21.0001 3Z\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n stroke-width=\"1.7\" />\n </g>\n <defs>\n <clipPath id=\"clip0_429_4922\">\n <rect [attr.fill]=\"disabled ? '#8e9cbe' : 'white'\" height=\"28\" width=\"24\" />\n </clipPath>\n </defs>\n </svg>\n </dd-lib-button>\n</div>\n", styles: [".lib-comment-textarea{position:relative;display:flex;align-items:center;flex-direction:row}.lib-comment-textarea textarea{margin-right:16px;width:100%;max-height:48px;padding:12px 16px;border-radius:12px;border:none;background-color:var(--gray-color-200);resize:none;box-sizing:inherit}.lib-comment-textarea textarea:disabled{background-color:var(--input-disable-input);pointer-events:none}.lib-comment-textarea textarea:disabled::placeholder{color:var(--disabled-color)}\n"] }]
|
|
2081
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }] });
|
|
2082
|
+
|
|
2083
|
+
class LibFileUploadComponent {
|
|
2084
|
+
constructor() {
|
|
2085
|
+
this.outputFile = new EventEmitter();
|
|
2086
|
+
this.outputFiles = new EventEmitter();
|
|
2087
|
+
}
|
|
2088
|
+
onFileSelected($event) {
|
|
2089
|
+
if (!this.multi) {
|
|
2090
|
+
const file = $event?.target?.files?.[0];
|
|
2091
|
+
if (file) {
|
|
2092
|
+
this.outputFile.emit(file);
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
}
|
|
2096
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibFileUploadComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2097
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: LibFileUploadComponent, isStandalone: true, selector: "dd-lib-file-upload", inputs: { multi: "multi", requiredFileType: "requiredFileType", template: "template" }, outputs: { outputFile: "outputFile", outputFiles: "outputFiles" }, ngImport: i0, template: "<input\r\n type=\"file\"\r\n class=\"file-input\"\r\n [accept]=\"requiredFileType\"\r\n (change)=\"onFileSelected($event)\"\r\n #fileUpload />\r\n\r\n<div class=\"file-upload\">\r\n <div class=\"upload-btn\" (click)=\"fileUpload.click()\">\r\n @if (template) {\r\n <ng-template [ngTemplateOutlet]=\"template\"></ng-template>\r\n } @else { \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C }\r\n </div>\r\n</div>\r\n", styles: [".file-input{display:none}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2098
|
+
}
|
|
2099
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibFileUploadComponent, decorators: [{
|
|
2100
|
+
type: Component,
|
|
2101
|
+
args: [{ selector: 'dd-lib-file-upload', standalone: true, imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<input\r\n type=\"file\"\r\n class=\"file-input\"\r\n [accept]=\"requiredFileType\"\r\n (change)=\"onFileSelected($event)\"\r\n #fileUpload />\r\n\r\n<div class=\"file-upload\">\r\n <div class=\"upload-btn\" (click)=\"fileUpload.click()\">\r\n @if (template) {\r\n <ng-template [ngTemplateOutlet]=\"template\"></ng-template>\r\n } @else { \u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044C }\r\n </div>\r\n</div>\r\n", styles: [".file-input{display:none}\n"] }]
|
|
2102
|
+
}], propDecorators: { multi: [{
|
|
2103
|
+
type: Input
|
|
2104
|
+
}], requiredFileType: [{
|
|
2105
|
+
type: Input
|
|
2106
|
+
}], template: [{
|
|
2107
|
+
type: Input
|
|
2108
|
+
}], outputFile: [{
|
|
2109
|
+
type: Output
|
|
2110
|
+
}], outputFiles: [{
|
|
2111
|
+
type: Output
|
|
2112
|
+
}] } });
|
|
2113
|
+
|
|
2114
|
+
class LibImageLoaderComponent {
|
|
2115
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibImageLoaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2116
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: LibImageLoaderComponent, isStandalone: true, selector: "dd-lib-image-loader", ngImport: i0, template: "<div class=\"image-loader\">\r\n <div class=\"b3-title mb-4\">\u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u043F\u0440\u0438\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0434\u043E 5 \u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0439</div>\r\n <div class=\"gray b6-title mb-16\">\u0422\u043E\u043B\u044C\u043A\u043E .png \u0438 .jpg \u0444\u0430\u0439\u043B\u044B. \u041E\u0431\u0449\u0438\u0439 \u043E\u0431\u044A\u0435\u043C \u043D\u0435 \u0434\u043E\u043B\u0436\u0435\u043D \u043F\u0440\u0435\u0432\u044B\u0448\u0430\u0442\u044C 5 \u043C\u0435\u0433\u0430\u0431\u0430\u0439\u0442</div>\r\n @if (images) {\r\n <div class=\"loaded-images\"></div>\r\n }\r\n <div>\r\n <dd-lib-button btnColor=\"white\">\r\n <div class=\"d-flex align-center\">\r\n <div class=\"mr-8\">\r\n <dd-lib-svg-icon icon=\"paperclip\"></dd-lib-svg-icon>\r\n </div>\r\n <div class=\"title-soc-btn\">\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438</div>\r\n </div>\r\n </dd-lib-button>\r\n </div>\r\n</div>\r\n", styles: [".image-loader .loaded-images{margin-bottom:16px;display:flex}\n"], dependencies: [{ kind: "component", type: LibButtonComponent, selector: "dd-lib-button", inputs: ["noPadding", "loaderColor"] }, { kind: "component", type: LibSvgIconComponent, selector: "dd-lib-svg-icon", inputs: ["width", "height", "color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2117
|
+
}
|
|
2118
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibImageLoaderComponent, decorators: [{
|
|
2119
|
+
type: Component,
|
|
2120
|
+
args: [{ selector: 'dd-lib-image-loader', standalone: true, imports: [LibButtonComponent, NgOptimizedImage, LibSvgIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"image-loader\">\r\n <div class=\"b3-title mb-4\">\u0412\u044B \u043C\u043E\u0436\u0435\u0442\u0435 \u043F\u0440\u0438\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0434\u043E 5 \u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0439</div>\r\n <div class=\"gray b6-title mb-16\">\u0422\u043E\u043B\u044C\u043A\u043E .png \u0438 .jpg \u0444\u0430\u0439\u043B\u044B. \u041E\u0431\u0449\u0438\u0439 \u043E\u0431\u044A\u0435\u043C \u043D\u0435 \u0434\u043E\u043B\u0436\u0435\u043D \u043F\u0440\u0435\u0432\u044B\u0448\u0430\u0442\u044C 5 \u043C\u0435\u0433\u0430\u0431\u0430\u0439\u0442</div>\r\n @if (images) {\r\n <div class=\"loaded-images\"></div>\r\n }\r\n <div>\r\n <dd-lib-button btnColor=\"white\">\r\n <div class=\"d-flex align-center\">\r\n <div class=\"mr-8\">\r\n <dd-lib-svg-icon icon=\"paperclip\"></dd-lib-svg-icon>\r\n </div>\r\n <div class=\"title-soc-btn\">\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0444\u043E\u0442\u043E\u0433\u0440\u0430\u0444\u0438\u0438</div>\r\n </div>\r\n </dd-lib-button>\r\n </div>\r\n</div>\r\n", styles: [".image-loader .loaded-images{margin-bottom:16px;display:flex}\n"] }]
|
|
2121
|
+
}] });
|
|
2122
|
+
|
|
2123
|
+
class LibInputComponent extends LibCommonInputTextComponent {
|
|
2124
|
+
constructor(changeDetection, controlContainer) {
|
|
2125
|
+
super(changeDetection);
|
|
2126
|
+
this.controlContainer = controlContainer;
|
|
2127
|
+
}
|
|
2128
|
+
ngOnInit() {
|
|
2129
|
+
this.control =
|
|
2130
|
+
this.controlContainer && this.formControlName
|
|
2131
|
+
? this.controlContainer?.control?.get(this.formControlName)
|
|
2132
|
+
: null;
|
|
2133
|
+
}
|
|
2134
|
+
writeValue(value) {
|
|
2135
|
+
this.value = value === null || value === undefined ? '' : '' + value;
|
|
2136
|
+
if (!this.destroyed) {
|
|
2137
|
+
this.changeDetection.detectChanges();
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
ngOnDestroy() {
|
|
2141
|
+
this.destroyed = true;
|
|
2142
|
+
// this.focusManager.unregister(this);
|
|
2143
|
+
}
|
|
2144
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibInputComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$5.ControlContainer, host: true, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2145
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: LibInputComponent, isStandalone: true, selector: "dd-lib-input", providers: [
|
|
2146
|
+
{
|
|
2147
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2148
|
+
useExisting: forwardRef(() => LibInputComponent),
|
|
2149
|
+
multi: true,
|
|
2150
|
+
},
|
|
2151
|
+
], usesInheritance: true, ngImport: i0, template: "<div class=\"lib-input\">\n <label [for]=\"id\" class=\"lib-input__title\">\n {{ label }}\n @if (required) {\n <dd-lib-svg-icon icon=\"error_hint\"></dd-lib-svg-icon>\n }\n </label>\n <input\n #input\n (blur)=\"notifyFocusEvent($event)\"\n (change)=\"handleChange()\"\n (focus)=\"notifyFocusEvent($event)\"\n (input)=\"handleInput($event)\"\n (keyup.enter)=\"forceChange()\"\n [(ngModel)]=\"value\"\n [attr.autocomplete]=\"autocomplete === undefined ? null : autocomplete\"\n [attr.id]=\"id ? id : null\"\n [attr.maxlength]=\"maxlength\"\n [attr.minlength]=\"minlength\"\n [attr.name]=\"name\"\n [attr.placeholder]=\"placeholder\"\n [attr.tabIndex]=\"tabIndex\"\n [attr.type]=\"type || 'text'\"\n [class.focused]=\"focused\"\n [class.invalid]=\"invalid\"\n [disabled]=\"disabled\"\n [readOnly]=\"readOnly\"\n class=\"text-input\" />\n @if (errorText && invalid) {\n <div class=\"lib-input__error\">{{ errorText }}</div>\n }\n</div>\n", styles: [":host{display:block}.lib-input{position:relative}.lib-input input{width:100%;height:48px;padding:15px 16px;border-radius:8px;border:1px solid var(--input-border-color);background-color:transparent;position:relative}.lib-input input:hover{border-color:var(--input-active-border-colort)}.lib-input input:focus{border-color:var(--input-active-border-colort);box-shadow:var(--input-active-border-shadow)}.lib-input input:disabled{border:none;background-color:var(--input-disable-input);color:var(--input-disable-text);pointer-events:none}.lib-input input:disabled::placeholder{color:var(--input-placeholder)}.lib-input input.invalid,.lib-input input.invalid:hover{border-color:var(--input-error-border-color)}.lib-input input.invalid:focus{border-color:var(--input-error-border-color);box-shadow:var(--input-error-border-shadow)}.lib-input__title{margin-bottom:4px;font-size:14px;line-height:24px;display:flex;align-items:flex-start}.lib-input__error{color:var(--primary-red-color);font-size:14px;font-weight:400;line-height:20px;margin-top:4px}.lib-input .password-eye{position:absolute;right:16px;top:40px;cursor:pointer}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: LibSvgIconComponent, selector: "dd-lib-svg-icon", inputs: ["width", "height", "color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2152
|
+
}
|
|
2153
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibInputComponent, decorators: [{
|
|
2154
|
+
type: Component,
|
|
2155
|
+
args: [{ selector: 'dd-lib-input', standalone: true, providers: [
|
|
2156
|
+
{
|
|
2157
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2158
|
+
useExisting: forwardRef(() => LibInputComponent),
|
|
2159
|
+
multi: true,
|
|
2160
|
+
},
|
|
2161
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, imports: [FormsModule, NgOptimizedImage, LibCardComponent, LibSvgIconComponent], template: "<div class=\"lib-input\">\n <label [for]=\"id\" class=\"lib-input__title\">\n {{ label }}\n @if (required) {\n <dd-lib-svg-icon icon=\"error_hint\"></dd-lib-svg-icon>\n }\n </label>\n <input\n #input\n (blur)=\"notifyFocusEvent($event)\"\n (change)=\"handleChange()\"\n (focus)=\"notifyFocusEvent($event)\"\n (input)=\"handleInput($event)\"\n (keyup.enter)=\"forceChange()\"\n [(ngModel)]=\"value\"\n [attr.autocomplete]=\"autocomplete === undefined ? null : autocomplete\"\n [attr.id]=\"id ? id : null\"\n [attr.maxlength]=\"maxlength\"\n [attr.minlength]=\"minlength\"\n [attr.name]=\"name\"\n [attr.placeholder]=\"placeholder\"\n [attr.tabIndex]=\"tabIndex\"\n [attr.type]=\"type || 'text'\"\n [class.focused]=\"focused\"\n [class.invalid]=\"invalid\"\n [disabled]=\"disabled\"\n [readOnly]=\"readOnly\"\n class=\"text-input\" />\n @if (errorText && invalid) {\n <div class=\"lib-input__error\">{{ errorText }}</div>\n }\n</div>\n", styles: [":host{display:block}.lib-input{position:relative}.lib-input input{width:100%;height:48px;padding:15px 16px;border-radius:8px;border:1px solid var(--input-border-color);background-color:transparent;position:relative}.lib-input input:hover{border-color:var(--input-active-border-colort)}.lib-input input:focus{border-color:var(--input-active-border-colort);box-shadow:var(--input-active-border-shadow)}.lib-input input:disabled{border:none;background-color:var(--input-disable-input);color:var(--input-disable-text);pointer-events:none}.lib-input input:disabled::placeholder{color:var(--input-placeholder)}.lib-input input.invalid,.lib-input input.invalid:hover{border-color:var(--input-error-border-color)}.lib-input input.invalid:focus{border-color:var(--input-error-border-color);box-shadow:var(--input-error-border-shadow)}.lib-input__title{margin-bottom:4px;font-size:14px;line-height:24px;display:flex;align-items:flex-start}.lib-input__error{color:var(--primary-red-color);font-size:14px;font-weight:400;line-height:20px;margin-top:4px}.lib-input .password-eye{position:absolute;right:16px;top:40px;cursor:pointer}\n"] }]
|
|
2162
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$5.ControlContainer, decorators: [{
|
|
2163
|
+
type: Optional
|
|
2164
|
+
}, {
|
|
2165
|
+
type: Host
|
|
2166
|
+
}, {
|
|
2167
|
+
type: SkipSelf
|
|
2168
|
+
}] }] });
|
|
2169
|
+
|
|
2170
|
+
class LibPeriodComponent {
|
|
2171
|
+
static { this.idCounter = 1; }
|
|
2172
|
+
constructor(dateService) {
|
|
2173
|
+
this.dateService = dateService;
|
|
2174
|
+
this.setPeriodDate = new EventEmitter();
|
|
2175
|
+
this.periodIsShown = false;
|
|
2176
|
+
this.calendarIsShown = false;
|
|
2177
|
+
this.periodIsSelected = false;
|
|
2178
|
+
this.calendarIsSelected = false;
|
|
2179
|
+
}
|
|
2180
|
+
ngOnInit() {
|
|
2181
|
+
this.idPeriod = 'period-wrapper-' + LibPeriodComponent.idCounter++;
|
|
2182
|
+
this.idCalendar = 'calendar-wrapper-' + LibPeriodComponent.idCounter++;
|
|
2183
|
+
this.periodMenu = this.dateService.getPeriodMenu();
|
|
2184
|
+
}
|
|
2185
|
+
registerOnChange(fn) {
|
|
2186
|
+
this.propagateChange = fn;
|
|
2187
|
+
}
|
|
2188
|
+
registerOnTouched(fn) {
|
|
2189
|
+
this.onTouchedCallback = fn;
|
|
2190
|
+
}
|
|
2191
|
+
showPeriod() {
|
|
2192
|
+
this.periodIsShown = !this.periodIsShown;
|
|
2193
|
+
this.calendarIsShown = !!this.selectedDate;
|
|
2194
|
+
}
|
|
2195
|
+
clearPeriod() {
|
|
2196
|
+
this.periodIsSelected = false;
|
|
2197
|
+
this.calendarIsSelected = false;
|
|
2198
|
+
this.periodIsShown = false;
|
|
2199
|
+
this.calendarIsShown = false;
|
|
2200
|
+
this.selectedPeriod = undefined;
|
|
2201
|
+
this.selectedDate = undefined;
|
|
2202
|
+
this.setPeriodDate.emit(null);
|
|
2203
|
+
}
|
|
2204
|
+
selectPeriod(type) {
|
|
2205
|
+
this.periodIsShown = false;
|
|
2206
|
+
this.calendarIsShown = false;
|
|
2207
|
+
this.periodIsSelected = true;
|
|
2208
|
+
this.calendarIsSelected = false;
|
|
2209
|
+
const date = this.dateService.getFormattedDate(type);
|
|
2210
|
+
this.propagateChange(type);
|
|
2211
|
+
this.setPeriodDate.emit({ [type]: date });
|
|
2212
|
+
}
|
|
2213
|
+
writeValue(value) {
|
|
2214
|
+
this.selectedPeriod = value;
|
|
2215
|
+
}
|
|
2216
|
+
selectDate($event) {
|
|
2217
|
+
this.calendarIsShown = false;
|
|
2218
|
+
if ($event) {
|
|
2219
|
+
this.selectedPeriod = 'calendar';
|
|
2220
|
+
this.propagateChange(this.selectedPeriod);
|
|
2221
|
+
this.periodIsShown = false;
|
|
2222
|
+
this.periodIsSelected = false;
|
|
2223
|
+
this.calendarIsSelected = true;
|
|
2224
|
+
this.setPeriodDate.emit({ calendar: format($event, DEFAULT_FORMAT) });
|
|
2225
|
+
}
|
|
2226
|
+
else {
|
|
2227
|
+
this.selectedDate = undefined;
|
|
2228
|
+
this.setPeriodDate.emit(null);
|
|
2229
|
+
if (!this.selectedPeriod) {
|
|
2230
|
+
this.periodIsSelected = false;
|
|
2231
|
+
}
|
|
2232
|
+
this.calendarIsSelected = false;
|
|
2233
|
+
}
|
|
2234
|
+
}
|
|
2235
|
+
clickOutside($event) {
|
|
2236
|
+
this.periodIsShown = $event;
|
|
2237
|
+
if (this.periodIsShown && !$event) {
|
|
2238
|
+
this.calendarIsShown = $event;
|
|
2239
|
+
}
|
|
2240
|
+
}
|
|
2241
|
+
propagateChange(value) { }
|
|
2242
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibPeriodComponent, deps: [{ token: DateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2243
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: LibPeriodComponent, isStandalone: true, selector: "dd-lib-period", inputs: { maxDate: "maxDate" }, outputs: { setPeriodDate: "setPeriodDate" }, providers: [
|
|
2244
|
+
{
|
|
2245
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2246
|
+
useExisting: forwardRef(() => LibPeriodComponent),
|
|
2247
|
+
multi: true,
|
|
2248
|
+
},
|
|
2249
|
+
], ngImport: i0, template: "<div class=\"pos-relative\">\r\n <dd-lib-filter-button\r\n (clearEvent)=\"clearPeriod()\"\r\n (clickEvent)=\"showPeriod()\"\r\n [active]=\"periodIsSelected || calendarIsSelected\"\r\n [id]=\"idPeriod\"\r\n btnColor=\"transparent\">\r\n <div>\u041F\u0435\u0440\u0438\u043E\u0434</div>\r\n </dd-lib-filter-button>\r\n @if (periodIsShown) {\r\n <div (ddClickOutside)=\"clickOutside($event)\" [elements]=\"[idPeriod, idCalendar]\" class=\"wrapper-calendar\">\r\n <dd-lib-card class=\"period-block\" type=\"small\">\r\n <div>\r\n <div class=\"period-block__header\">\r\n <div class=\"period-block__header_title\">\u041F\u0435\u0440\u0438\u043E\u0434</div>\r\n <div (click)=\"clearPeriod()\" class=\"period-block__header_clear\">\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C</div>\r\n </div>\r\n <div class=\"period-block__list\">\r\n @for (period of periodMenu; track period) {\r\n <dd-lib-radio (changed)=\"selectPeriod($event)\" [(ngModel)]=\"selectedPeriod\" [value]=\"period.name\">{{\r\n period.title\r\n }}</dd-lib-radio>\r\n }\r\n </div>\r\n <div (click)=\"calendarIsShown = !calendarIsShown\" class=\"period-block__footer\">\r\n {{ calendarIsShown ? '\u0417\u0430\u043A\u0440\u044B\u0442\u044C' : '\u041E\u0442\u043A\u0440\u044B\u0442\u044C' }} \u043A\u0430\u043B\u0435\u043D\u0434\u0430\u0440\u044C\r\n </div>\r\n </div>\r\n </dd-lib-card>\r\n @if (calendarIsShown) {\r\n <dd-lib-calendar\r\n (emitDate)=\"selectDate($event)\"\r\n [(ngModel)]=\"selectedDate\"\r\n [id]=\"idCalendar\"\r\n [maxDate]=\"maxDate\"\r\n class=\"calendar-block\">\r\n </dd-lib-calendar>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: ["dd-lib-filter-button{position:relative}.wrapper-calendar{position:absolute;left:0;width:352px;height:348px;z-index:101;display:block;margin-top:8px}.period-block{z-index:400;display:block;position:relative;animation:period .5s forwards}.period-block__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.period-block__header_title{font-weight:500}.period-block__header_clear{font-weight:500;color:var(--primary-green-color);cursor:pointer}.period-block__list dd-lib-radio{display:block;margin-bottom:16px}.period-block__footer{margin-top:8px;font-weight:500;color:var(--primary-green-color);cursor:pointer}.calendar-block{margin-top:8px;display:block;transform:translateY(-10%);animation:date .5s forwards}@keyframes period{0%{transform:translateY(-10%)}to{transform:translate(0)}}@keyframes date{0%{transform:translateY(-10%)}to{transform:translate(0)}}\n"], dependencies: [{ kind: "component", type: LibCardComponent, selector: "dd-lib-card", inputs: ["type", "footerBtn", "sHeight", "skeleton", "parentLvlForSkeleton", "plugs", "borderRadius"], outputs: ["cardBtnEvent"] }, { kind: "component", type: LibFilterButtonComponent, selector: "dd-lib-filter-button", inputs: ["hintContent"], outputs: ["clearEvent", "hintEvent"] }, { kind: "component", type: LibRadioComponent, selector: "dd-lib-radio", inputs: ["radioId", "disabled", "required", "name", "value", "checked"], outputs: ["changed"] }, { kind: "component", type: LibCalendarComponent, selector: "dd-lib-calendar", inputs: ["type", "formatDate", "formatTime", "mode", "maxDate", "minDate"], outputs: ["emitDate"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[ddClickOutside]", inputs: ["elements"], outputs: ["ddClickOutside"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2250
|
+
}
|
|
2251
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibPeriodComponent, decorators: [{
|
|
2252
|
+
type: Component,
|
|
2253
|
+
args: [{ selector: 'dd-lib-period', standalone: true, imports: [
|
|
2254
|
+
LibCardComponent,
|
|
2255
|
+
LibFilterButtonComponent,
|
|
2256
|
+
LibRadioComponent,
|
|
2257
|
+
LibCalendarComponent,
|
|
2258
|
+
FormsModule,
|
|
2259
|
+
ClickOutsideDirective,
|
|
2260
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
2261
|
+
{
|
|
2262
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2263
|
+
useExisting: forwardRef(() => LibPeriodComponent),
|
|
2264
|
+
multi: true,
|
|
2265
|
+
},
|
|
2266
|
+
], template: "<div class=\"pos-relative\">\r\n <dd-lib-filter-button\r\n (clearEvent)=\"clearPeriod()\"\r\n (clickEvent)=\"showPeriod()\"\r\n [active]=\"periodIsSelected || calendarIsSelected\"\r\n [id]=\"idPeriod\"\r\n btnColor=\"transparent\">\r\n <div>\u041F\u0435\u0440\u0438\u043E\u0434</div>\r\n </dd-lib-filter-button>\r\n @if (periodIsShown) {\r\n <div (ddClickOutside)=\"clickOutside($event)\" [elements]=\"[idPeriod, idCalendar]\" class=\"wrapper-calendar\">\r\n <dd-lib-card class=\"period-block\" type=\"small\">\r\n <div>\r\n <div class=\"period-block__header\">\r\n <div class=\"period-block__header_title\">\u041F\u0435\u0440\u0438\u043E\u0434</div>\r\n <div (click)=\"clearPeriod()\" class=\"period-block__header_clear\">\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C</div>\r\n </div>\r\n <div class=\"period-block__list\">\r\n @for (period of periodMenu; track period) {\r\n <dd-lib-radio (changed)=\"selectPeriod($event)\" [(ngModel)]=\"selectedPeriod\" [value]=\"period.name\">{{\r\n period.title\r\n }}</dd-lib-radio>\r\n }\r\n </div>\r\n <div (click)=\"calendarIsShown = !calendarIsShown\" class=\"period-block__footer\">\r\n {{ calendarIsShown ? '\u0417\u0430\u043A\u0440\u044B\u0442\u044C' : '\u041E\u0442\u043A\u0440\u044B\u0442\u044C' }} \u043A\u0430\u043B\u0435\u043D\u0434\u0430\u0440\u044C\r\n </div>\r\n </div>\r\n </dd-lib-card>\r\n @if (calendarIsShown) {\r\n <dd-lib-calendar\r\n (emitDate)=\"selectDate($event)\"\r\n [(ngModel)]=\"selectedDate\"\r\n [id]=\"idCalendar\"\r\n [maxDate]=\"maxDate\"\r\n class=\"calendar-block\">\r\n </dd-lib-calendar>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: ["dd-lib-filter-button{position:relative}.wrapper-calendar{position:absolute;left:0;width:352px;height:348px;z-index:101;display:block;margin-top:8px}.period-block{z-index:400;display:block;position:relative;animation:period .5s forwards}.period-block__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}.period-block__header_title{font-weight:500}.period-block__header_clear{font-weight:500;color:var(--primary-green-color);cursor:pointer}.period-block__list dd-lib-radio{display:block;margin-bottom:16px}.period-block__footer{margin-top:8px;font-weight:500;color:var(--primary-green-color);cursor:pointer}.calendar-block{margin-top:8px;display:block;transform:translateY(-10%);animation:date .5s forwards}@keyframes period{0%{transform:translateY(-10%)}to{transform:translate(0)}}@keyframes date{0%{transform:translateY(-10%)}to{transform:translate(0)}}\n"] }]
|
|
2267
|
+
}], ctorParameters: () => [{ type: DateService }], propDecorators: { maxDate: [{
|
|
2268
|
+
type: Input
|
|
2269
|
+
}], setPeriodDate: [{
|
|
2270
|
+
type: Output
|
|
2271
|
+
}] } });
|
|
2272
|
+
|
|
2273
|
+
class LibSearchInputComponent extends LibCommonInputTextComponent {
|
|
2274
|
+
constructor(destroy$, changeDetection, cdr) {
|
|
2275
|
+
super(changeDetection);
|
|
2276
|
+
this.destroy$ = destroy$;
|
|
2277
|
+
this.cdr = cdr;
|
|
2278
|
+
this.keyTitle = 'title';
|
|
2279
|
+
this.keyDesc = 'description';
|
|
2280
|
+
this.styleInput = 'standard';
|
|
2281
|
+
this.inputStyle = 'gray';
|
|
2282
|
+
this.debounceTime = 100;
|
|
2283
|
+
this.delay = 0;
|
|
2284
|
+
this.keyupEvent = new EventEmitter();
|
|
2285
|
+
this.selectedItem = new EventEmitter();
|
|
2286
|
+
this.keyUp = new Subject();
|
|
2287
|
+
}
|
|
2288
|
+
ngOnInit() {
|
|
2289
|
+
if (this.commitOnInput) {
|
|
2290
|
+
this.keyUp
|
|
2291
|
+
.pipe(map(event => event.target?.value), debounceTime(this.debounceTime),
|
|
2292
|
+
// distinctUntilChanged(), надо ли?
|
|
2293
|
+
mergeMap(search => of(search).pipe(delay(this.delay))), takeUntil(this.destroy$))
|
|
2294
|
+
.subscribe(str => {
|
|
2295
|
+
this.keyupEvent.emit(str);
|
|
2296
|
+
});
|
|
2297
|
+
}
|
|
2298
|
+
}
|
|
2299
|
+
forceChange() {
|
|
2300
|
+
if (!this.commitOnInput) {
|
|
2301
|
+
this.keyupEvent.emit(this.value);
|
|
2302
|
+
}
|
|
2303
|
+
}
|
|
2304
|
+
onClear(noEmit) {
|
|
2305
|
+
this.value = '';
|
|
2306
|
+
if (!noEmit) {
|
|
2307
|
+
this.cleared.emit();
|
|
2308
|
+
this.keyupEvent.emit('');
|
|
2309
|
+
}
|
|
2310
|
+
this.inputSearchElement?.nativeElement.focus();
|
|
2311
|
+
this.cdr.detectChanges();
|
|
2312
|
+
}
|
|
2313
|
+
onClickSearchItem(item) {
|
|
2314
|
+
this.onClear();
|
|
2315
|
+
this.selectedItem.emit(item);
|
|
2316
|
+
this.value = this.getTitle(item);
|
|
2317
|
+
}
|
|
2318
|
+
getTitle(item) {
|
|
2319
|
+
return item[this.keyTitle];
|
|
2320
|
+
}
|
|
2321
|
+
getDesc(item) {
|
|
2322
|
+
return item[this.keyDesc];
|
|
2323
|
+
}
|
|
2324
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibSearchInputComponent, deps: [{ token: DestroyService }, { token: i0.ChangeDetectorRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2325
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: LibSearchInputComponent, isStandalone: true, selector: "dd-lib-search-input", inputs: { keyTitle: "keyTitle", keyDesc: "keyDesc", styleInput: "styleInput", inputStyle: "inputStyle", searchData: "searchData", debounceTime: "debounceTime", delay: "delay", idClose: "idClose" }, outputs: { keyupEvent: "keyupEvent", selectedItem: "selectedItem" }, providers: [DestroyService], usesInheritance: true, ngImport: i0, template: "<div class=\"lib-search-input\">\r\n <label [for]=\"id\" class=\"lib-search-input__title\">\r\n {{ label }}\r\n @if (required) {\r\n <dd-lib-svg-icon icon=\"error_hint\"></dd-lib-svg-icon>\r\n }\r\n </label>\r\n <div class=\"pos-relative\">\r\n <dd-lib-svg-icon (click)=\"forceChange()\" class=\"search-icon\" icon=\"search\"></dd-lib-svg-icon>\r\n <input\r\n #searchInput\r\n (keyup)=\"keyUp.next($event)\"\r\n (keyup.enter)=\"forceChange()\"\r\n [(ngModel)]=\"value\"\r\n [attr.autocomplete]=\"autocomplete === undefined ? null : autocomplete\"\r\n [attr.id]=\"id ? id : null\"\r\n [attr.maxlength]=\"maxlength\"\r\n [attr.minlength]=\"minlength\"\r\n [attr.name]=\"name\"\r\n [attr.placeholder]=\"placeholder\"\r\n [attr.tabIndex]=\"tabIndex\"\r\n [attr.type]=\"type || 'text'\"\r\n [class.focused]=\"focused\"\r\n [class.round]=\"styleInput === 'round'\"\r\n [class.white]=\"inputStyle === 'white'\"\r\n [disabled]=\"disabled\"\r\n [readOnly]=\"readOnly\"\r\n class=\"search-input\" />\r\n <dd-lib-svg-icon\r\n (click)=\"onClear()\"\r\n [id]=\"idClose\" [style.display]=\"value?.length ? 'block' : 'none'\"\r\n class=\"clear-icon\" icon=\"clear\"></dd-lib-svg-icon>\r\n </div>\r\n\r\n @if (searchData?.length) {\r\n <dd-lib-card>\r\n @for (item of searchData; track item) {\r\n <div (click)=\"onClickSearchItem(item)\" class=\"search-result\">\r\n @if (getTitle(item); as title) {\r\n <div [innerHTML]=\"title | highlight: value | safe: 'html'\" class=\"search-result__title\"></div>\r\n } @if (getDesc(item); as desc) {\r\n <div [innerHTML]=\"desc | highlight: value | safe: 'html'\" class=\"search-result__desc\"></div>\r\n }\r\n </div>\r\n }\r\n </dd-lib-card>\r\n }\r\n</div>\r\n", styles: [":host{display:block}.lib-search-input{position:relative}.lib-search-input__title{margin-bottom:4px;font-size:14px;line-height:24px;display:flex;align-items:flex-start}.lib-search-input input{width:100%;height:48px;padding:16px 16px 15px 44px;border-radius:8px;border:none;background-color:var(--input-gray-bgc)}.lib-search-input input.white{background-color:var(--white-color);border:1px solid var(--primary-gray-color)}.lib-search-input .round{border-radius:24px}.lib-search-input .search-icon{position:absolute;left:16px;top:14px;cursor:pointer}.lib-search-input .clear-icon{position:absolute;right:16px;top:14px;cursor:pointer}.lib-search-input .search-result{font-size:16px;font-weight:400;line-height:24px;letter-spacing:0;text-align:left;cursor:pointer}.lib-search-input .search-result:hover{opacity:.8}.lib-search-input .search-result:last-child .search-result__desc{border:none;padding-bottom:0}.lib-search-input .search-result__title{color:var(--second-gray-color);margin:24px 0 2px}.lib-search-input .search-result__desc{padding-bottom:16px;border-bottom:1px solid var(--gray-color-200)}.lib-search-input dd-lib-card{position:absolute;display:block;top:76px;z-index:100;width:100%;max-height:400px;box-shadow:var(--main-card-shadow);overflow:auto}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: LibCardComponent, selector: "dd-lib-card", inputs: ["type", "footerBtn", "sHeight", "skeleton", "parentLvlForSkeleton", "plugs", "borderRadius"], outputs: ["cardBtnEvent"] }, { kind: "pipe", type: HighlightPipe, name: "highlight" }, { kind: "pipe", type: SafePipe, name: "safe" }, { kind: "component", type: LibSvgIconComponent, selector: "dd-lib-svg-icon", inputs: ["width", "height", "color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2326
|
+
}
|
|
2327
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibSearchInputComponent, decorators: [{
|
|
2328
|
+
type: Component,
|
|
2329
|
+
args: [{ selector: 'dd-lib-search-input', standalone: true, imports: [FormsModule, NgOptimizedImage, LibCardComponent, HighlightPipe, SafePipe, LibSvgIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, providers: [DestroyService], template: "<div class=\"lib-search-input\">\r\n <label [for]=\"id\" class=\"lib-search-input__title\">\r\n {{ label }}\r\n @if (required) {\r\n <dd-lib-svg-icon icon=\"error_hint\"></dd-lib-svg-icon>\r\n }\r\n </label>\r\n <div class=\"pos-relative\">\r\n <dd-lib-svg-icon (click)=\"forceChange()\" class=\"search-icon\" icon=\"search\"></dd-lib-svg-icon>\r\n <input\r\n #searchInput\r\n (keyup)=\"keyUp.next($event)\"\r\n (keyup.enter)=\"forceChange()\"\r\n [(ngModel)]=\"value\"\r\n [attr.autocomplete]=\"autocomplete === undefined ? null : autocomplete\"\r\n [attr.id]=\"id ? id : null\"\r\n [attr.maxlength]=\"maxlength\"\r\n [attr.minlength]=\"minlength\"\r\n [attr.name]=\"name\"\r\n [attr.placeholder]=\"placeholder\"\r\n [attr.tabIndex]=\"tabIndex\"\r\n [attr.type]=\"type || 'text'\"\r\n [class.focused]=\"focused\"\r\n [class.round]=\"styleInput === 'round'\"\r\n [class.white]=\"inputStyle === 'white'\"\r\n [disabled]=\"disabled\"\r\n [readOnly]=\"readOnly\"\r\n class=\"search-input\" />\r\n <dd-lib-svg-icon\r\n (click)=\"onClear()\"\r\n [id]=\"idClose\" [style.display]=\"value?.length ? 'block' : 'none'\"\r\n class=\"clear-icon\" icon=\"clear\"></dd-lib-svg-icon>\r\n </div>\r\n\r\n @if (searchData?.length) {\r\n <dd-lib-card>\r\n @for (item of searchData; track item) {\r\n <div (click)=\"onClickSearchItem(item)\" class=\"search-result\">\r\n @if (getTitle(item); as title) {\r\n <div [innerHTML]=\"title | highlight: value | safe: 'html'\" class=\"search-result__title\"></div>\r\n } @if (getDesc(item); as desc) {\r\n <div [innerHTML]=\"desc | highlight: value | safe: 'html'\" class=\"search-result__desc\"></div>\r\n }\r\n </div>\r\n }\r\n </dd-lib-card>\r\n }\r\n</div>\r\n", styles: [":host{display:block}.lib-search-input{position:relative}.lib-search-input__title{margin-bottom:4px;font-size:14px;line-height:24px;display:flex;align-items:flex-start}.lib-search-input input{width:100%;height:48px;padding:16px 16px 15px 44px;border-radius:8px;border:none;background-color:var(--input-gray-bgc)}.lib-search-input input.white{background-color:var(--white-color);border:1px solid var(--primary-gray-color)}.lib-search-input .round{border-radius:24px}.lib-search-input .search-icon{position:absolute;left:16px;top:14px;cursor:pointer}.lib-search-input .clear-icon{position:absolute;right:16px;top:14px;cursor:pointer}.lib-search-input .search-result{font-size:16px;font-weight:400;line-height:24px;letter-spacing:0;text-align:left;cursor:pointer}.lib-search-input .search-result:hover{opacity:.8}.lib-search-input .search-result:last-child .search-result__desc{border:none;padding-bottom:0}.lib-search-input .search-result__title{color:var(--second-gray-color);margin:24px 0 2px}.lib-search-input .search-result__desc{padding-bottom:16px;border-bottom:1px solid var(--gray-color-200)}.lib-search-input dd-lib-card{position:absolute;display:block;top:76px;z-index:100;width:100%;max-height:400px;box-shadow:var(--main-card-shadow);overflow:auto}\n"] }]
|
|
2330
|
+
}], ctorParameters: () => [{ type: DestroyService }, { type: i0.ChangeDetectorRef }, { type: i0.ChangeDetectorRef }], propDecorators: { keyTitle: [{
|
|
2331
|
+
type: Input
|
|
2332
|
+
}], keyDesc: [{
|
|
2333
|
+
type: Input
|
|
2334
|
+
}], styleInput: [{
|
|
2335
|
+
type: Input
|
|
2336
|
+
}], inputStyle: [{
|
|
2337
|
+
type: Input
|
|
2338
|
+
}], searchData: [{
|
|
2339
|
+
type: Input
|
|
2340
|
+
}], debounceTime: [{
|
|
2341
|
+
type: Input
|
|
2342
|
+
}], delay: [{
|
|
2343
|
+
type: Input
|
|
2344
|
+
}], idClose: [{
|
|
2345
|
+
type: Input
|
|
2346
|
+
}], keyupEvent: [{
|
|
2347
|
+
type: Output
|
|
2348
|
+
}], selectedItem: [{
|
|
2349
|
+
type: Output
|
|
2350
|
+
}] } });
|
|
2351
|
+
|
|
2352
|
+
class LibSelectComponent extends LibCommonInputTextComponent {
|
|
2353
|
+
static { this.idCounter = 1; }
|
|
2354
|
+
constructor(changeDetection, controlContainer) {
|
|
2355
|
+
super(changeDetection);
|
|
2356
|
+
this.controlContainer = controlContainer;
|
|
2357
|
+
this.placeholder = 'Выберите из списка';
|
|
2358
|
+
}
|
|
2359
|
+
ngOnInit() {
|
|
2360
|
+
if (!this.selectId) {
|
|
2361
|
+
this.selectId = 'dd-select-' + LibSelectComponent.idCounter++;
|
|
2362
|
+
}
|
|
2363
|
+
if (this.keyTitle && !this.keyValue) {
|
|
2364
|
+
this.keyValue = this.keyTitle;
|
|
2365
|
+
}
|
|
2366
|
+
this.control =
|
|
2367
|
+
this.controlContainer && this.formControlName
|
|
2368
|
+
? this.controlContainer?.control?.get(this.formControlName)
|
|
2369
|
+
: null;
|
|
2370
|
+
}
|
|
2371
|
+
registerOnChange(fn) {
|
|
2372
|
+
this.propagateChange = fn;
|
|
2373
|
+
super.registerOnChange(fn);
|
|
2374
|
+
}
|
|
2375
|
+
registerOnTouched(fn) {
|
|
2376
|
+
this.onTouchedCallback = fn;
|
|
2377
|
+
super.registerOnTouched(fn);
|
|
2378
|
+
}
|
|
2379
|
+
handleInput(e) {
|
|
2380
|
+
this.isShownList = true;
|
|
2381
|
+
this.searchValue = this.inputValue;
|
|
2382
|
+
super.handleInput(e);
|
|
2383
|
+
}
|
|
2384
|
+
notifyFocusEvent(e) {
|
|
2385
|
+
if (!this.disabled) {
|
|
2386
|
+
this.isShownList = !this.isShownList;
|
|
2387
|
+
}
|
|
2388
|
+
super.notifyFocusEvent(e);
|
|
2389
|
+
}
|
|
2390
|
+
writeValue(value) {
|
|
2391
|
+
this.value = value;
|
|
2392
|
+
this.inputValue = value;
|
|
2393
|
+
}
|
|
2394
|
+
selectItem(item) {
|
|
2395
|
+
if (typeof item === 'string') {
|
|
2396
|
+
if (!this.checkedItem) {
|
|
2397
|
+
this.checkedItem = item;
|
|
2398
|
+
this.inputValue = item;
|
|
2399
|
+
this.value = item;
|
|
2400
|
+
this.propagateChange(this.value);
|
|
2401
|
+
}
|
|
2402
|
+
else {
|
|
2403
|
+
this.checkedItem = null;
|
|
2404
|
+
this.inputValue = undefined;
|
|
2405
|
+
this.value = undefined;
|
|
2406
|
+
this.propagateChange(undefined);
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
else {
|
|
2410
|
+
if (!this.checkedItem || item[this.keyValue] !== this.checkedItem?.[this.keyValue]) {
|
|
2411
|
+
this.checkedItem = item;
|
|
2412
|
+
this.inputValue = this.checkedItem[this.keyTitle];
|
|
2413
|
+
this.value = item[this.keyValue];
|
|
2414
|
+
this.propagateChange(this.value);
|
|
2415
|
+
}
|
|
2416
|
+
else {
|
|
2417
|
+
this.checkedItem = null;
|
|
2418
|
+
this.inputValue = undefined;
|
|
2419
|
+
this.value = undefined;
|
|
2420
|
+
this.propagateChange(undefined);
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
this.searchValue = undefined;
|
|
2424
|
+
this.isShownList = false;
|
|
2425
|
+
}
|
|
2426
|
+
filterList(item) {
|
|
2427
|
+
return item[this.keyTitle]?.toLowerCase().includes(this.searchValue?.toLowerCase() || '');
|
|
2428
|
+
}
|
|
2429
|
+
propagateChange(_value) { }
|
|
2430
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibSelectComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$5.ControlContainer, host: true, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2431
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: LibSelectComponent, isStandalone: true, selector: "dd-lib-select", inputs: { selectId: "selectId", data: "data", keyTitle: "keyTitle", keyDesc: "keyDesc", keyValue: "keyValue", placeholder: "placeholder" }, providers: [
|
|
2432
|
+
{
|
|
2433
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2434
|
+
useExisting: forwardRef(() => LibSelectComponent),
|
|
2435
|
+
multi: true,
|
|
2436
|
+
},
|
|
2437
|
+
], usesInheritance: true, ngImport: i0, template: "<div class=\"lib-select\" id=\"lib-select-{{ selectId }}\">\n <label [for]=\"id\" class=\"lib-select__title\">\n {{ label }}\n @if (required) {\n <dd-lib-svg-icon icon=\"error_hint\"></dd-lib-svg-icon>\n }\n </label>\n\n <div class=\"pos-relative\">\n <input\n #select\n (change)=\"handleChange()\"\n (click)=\"notifyFocusEvent($event)\"\n (input)=\"handleInput($event)\"\n [(ngModel)]=\"inputValue\"\n [attr.id]=\"selectId\"\n [attr.name]=\"name\"\n [attr.placeholder]=\"placeholder\"\n [attr.tabIndex]=\"tabIndex\"\n [attr.type]=\"'text'\"\n [class.focused]=\"focused\"\n [class.invalid]=\"invalid\"\n [disabled]=\"disabled\"\n [readOnly]=\"readOnly\"\n [title]=\"inputValue\"\n class=\"text-select\" />\n <!-- (blur)=\"notifyFocusEvent($event)\"-->\n @if (!checkedItem) {\n <dd-lib-svg-icon\n (click)=\"notifyFocusEvent($event)\"\n [class.black-svg]=\"isShownList\"\n [class.disabled]=\"disabled\"\n [class.gray-svg]=\"!isShownList\"\n [class.up]=\"isShownList\"\n id=\"chevron-{{ selectId }}\" class=\"chevron\" icon=\"down_chevron\"></dd-lib-svg-icon>\n\n } @else {\n <dd-lib-svg-icon\n (click)=\"selectItem(checkedItem)\"\n class=\"clear\"\n id=\"chevron-{{ selectId }}\" icon=\"clear\"></dd-lib-svg-icon>\n\n }\n </div>\n\n @if (errorText && invalid) {\n <div class=\"lib-select__error\">{{ errorText }}</div>\n } @if (isShownList) {\n <div\n (ddClickOutside)=\"notifyFocusEvent($event)\"\n [elements]=\"['lib-select-' + selectId, 'chevron' + selectId]\"\n class=\"select-list-wrapper\">\n @if (data?.length) { @for (item of data | filterByKey: filterList.bind(this); track item) {\n <div\n (click)=\"selectItem(item)\"\n [class.active]=\"checkedItem?.[keyValue!] === item[keyValue!] || checkedItem === item\"\n class=\"select-data\">\n @if (!keyDesc && !keyTitle) {\n <div [innerHTML]=\"item | highlight: inputValue | safe: 'html'\" class=\"select-data__title\"></div>\n } @if (keyTitle) {\n <div\n [innerHTML]=\"item[keyTitle!] | highlight: inputValue | safe: 'html'\"\n class=\"select-data__title\"></div>\n } @if (keyDesc) {\n <div\n [innerHTML]=\"item[keyDesc!] | highlight: inputValue | safe: 'html'\"\n [title]=\"item[keyDesc]\"\n class=\"select-data__desc\"></div>\n } @if (checkedItem?.[keyValue!] === item?.[keyValue!] || checkedItem === item) {\n <dd-lib-svg-icon\n (click)=\"selectItem(checkedItem)\"\n class=\"checked\"\n id=\"chevron-{{ selectId }}\" icon=\"check_green\"></dd-lib-svg-icon>\n }\n </div>\n } } @else {\n <div class=\"select-loader\">\n <dd-lib-loader></dd-lib-loader>\n </div>\n }\n </div>\n }\n</div>\n", styles: [".lib-select{position:relative}.lib-select input{width:100%;height:48px;padding:15px 28px 15px 16px;overflow:hidden;text-overflow:ellipsis;border-radius:8px;border:1px solid var(--input-border-color);background-color:transparent;position:relative}.lib-select input:hover{border-color:var(--input-active-border-colort)}.lib-select input:focus{border-color:var(--input-active-border-colort);box-shadow:var(--input-active-border-shadow)}.lib-select input:disabled{border:none;background-color:var(--input-disable-input);color:var(--input-disable-text);pointer-events:none}.lib-select input:disabled::placeholder{color:var(--input-placeholder)}.lib-select input.invalid,.lib-select input.invalid:hover{border-color:var(--input-error-border-color)}.lib-select input.invalid:focus{border-color:var(--input-error-border-color);box-shadow:var(--input-error-border-shadow)}.lib-select .clear{cursor:pointer;position:absolute;right:8px;top:12px}.lib-select .chevron{cursor:pointer;position:absolute;right:16px;top:10px}.lib-select .chevron.up{transform:rotate(180deg)}.lib-select__title{margin-bottom:4px;font-size:14px;line-height:24px;display:flex;align-items:flex-start}.lib-select__error{color:var(--primary-red-color);font-size:12px;font-weight:400;line-height:10px;margin-top:2px}.lib-select .select-list-wrapper{position:absolute;display:block;top:80px;z-index:100;width:100%;max-height:300px;overflow:auto;border-radius:8px;box-shadow:var(--main-card-shadow);background-color:var(--main-card-color)}.lib-select .select-list-wrapper .select-data{padding:12px 16px;cursor:pointer;position:relative}.lib-select .select-list-wrapper .select-data__desc{font-size:14px;font-weight:400;line-height:24px;text-overflow:ellipsis;text-wrap:nowrap;padding-top:2px;overflow:hidden;color:var(--second-gray-color)}.lib-select .select-list-wrapper .select-data:hover,.lib-select .select-list-wrapper .select-data.active{background:var(--select-act-hov-bgc)}.lib-select .select-list-wrapper .select-data.active .checked{position:absolute;right:16px;top:10px}.lib-select .select-list-wrapper .select-loader{padding:24px}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: HighlightPipe, name: "highlight" }, { kind: "pipe", type: SafePipe, name: "safe" }, { kind: "directive", type: ClickOutsideDirective, selector: "[ddClickOutside]", inputs: ["elements"], outputs: ["ddClickOutside"] }, { kind: "component", type: LibLoaderComponent, selector: "dd-lib-loader", inputs: ["color"] }, { kind: "pipe", type: FilterByKeyPipe, name: "filterByKey" }, { kind: "component", type: LibSvgIconComponent, selector: "dd-lib-svg-icon", inputs: ["width", "height", "color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2438
|
+
}
|
|
2439
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibSelectComponent, decorators: [{
|
|
2440
|
+
type: Component,
|
|
2441
|
+
args: [{ selector: 'dd-lib-select', standalone: true, imports: [
|
|
2442
|
+
NgOptimizedImage,
|
|
2443
|
+
ReactiveFormsModule,
|
|
2444
|
+
FormsModule,
|
|
2445
|
+
HighlightPipe,
|
|
2446
|
+
LibCardComponent,
|
|
2447
|
+
SafePipe,
|
|
2448
|
+
ClickOutsideDirective,
|
|
2449
|
+
LibLoaderComponent,
|
|
2450
|
+
FilterByKeyPipe,
|
|
2451
|
+
LibSvgIconComponent,
|
|
2452
|
+
], providers: [
|
|
2453
|
+
{
|
|
2454
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2455
|
+
useExisting: forwardRef(() => LibSelectComponent),
|
|
2456
|
+
multi: true,
|
|
2457
|
+
},
|
|
2458
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"lib-select\" id=\"lib-select-{{ selectId }}\">\n <label [for]=\"id\" class=\"lib-select__title\">\n {{ label }}\n @if (required) {\n <dd-lib-svg-icon icon=\"error_hint\"></dd-lib-svg-icon>\n }\n </label>\n\n <div class=\"pos-relative\">\n <input\n #select\n (change)=\"handleChange()\"\n (click)=\"notifyFocusEvent($event)\"\n (input)=\"handleInput($event)\"\n [(ngModel)]=\"inputValue\"\n [attr.id]=\"selectId\"\n [attr.name]=\"name\"\n [attr.placeholder]=\"placeholder\"\n [attr.tabIndex]=\"tabIndex\"\n [attr.type]=\"'text'\"\n [class.focused]=\"focused\"\n [class.invalid]=\"invalid\"\n [disabled]=\"disabled\"\n [readOnly]=\"readOnly\"\n [title]=\"inputValue\"\n class=\"text-select\" />\n <!-- (blur)=\"notifyFocusEvent($event)\"-->\n @if (!checkedItem) {\n <dd-lib-svg-icon\n (click)=\"notifyFocusEvent($event)\"\n [class.black-svg]=\"isShownList\"\n [class.disabled]=\"disabled\"\n [class.gray-svg]=\"!isShownList\"\n [class.up]=\"isShownList\"\n id=\"chevron-{{ selectId }}\" class=\"chevron\" icon=\"down_chevron\"></dd-lib-svg-icon>\n\n } @else {\n <dd-lib-svg-icon\n (click)=\"selectItem(checkedItem)\"\n class=\"clear\"\n id=\"chevron-{{ selectId }}\" icon=\"clear\"></dd-lib-svg-icon>\n\n }\n </div>\n\n @if (errorText && invalid) {\n <div class=\"lib-select__error\">{{ errorText }}</div>\n } @if (isShownList) {\n <div\n (ddClickOutside)=\"notifyFocusEvent($event)\"\n [elements]=\"['lib-select-' + selectId, 'chevron' + selectId]\"\n class=\"select-list-wrapper\">\n @if (data?.length) { @for (item of data | filterByKey: filterList.bind(this); track item) {\n <div\n (click)=\"selectItem(item)\"\n [class.active]=\"checkedItem?.[keyValue!] === item[keyValue!] || checkedItem === item\"\n class=\"select-data\">\n @if (!keyDesc && !keyTitle) {\n <div [innerHTML]=\"item | highlight: inputValue | safe: 'html'\" class=\"select-data__title\"></div>\n } @if (keyTitle) {\n <div\n [innerHTML]=\"item[keyTitle!] | highlight: inputValue | safe: 'html'\"\n class=\"select-data__title\"></div>\n } @if (keyDesc) {\n <div\n [innerHTML]=\"item[keyDesc!] | highlight: inputValue | safe: 'html'\"\n [title]=\"item[keyDesc]\"\n class=\"select-data__desc\"></div>\n } @if (checkedItem?.[keyValue!] === item?.[keyValue!] || checkedItem === item) {\n <dd-lib-svg-icon\n (click)=\"selectItem(checkedItem)\"\n class=\"checked\"\n id=\"chevron-{{ selectId }}\" icon=\"check_green\"></dd-lib-svg-icon>\n }\n </div>\n } } @else {\n <div class=\"select-loader\">\n <dd-lib-loader></dd-lib-loader>\n </div>\n }\n </div>\n }\n</div>\n", styles: [".lib-select{position:relative}.lib-select input{width:100%;height:48px;padding:15px 28px 15px 16px;overflow:hidden;text-overflow:ellipsis;border-radius:8px;border:1px solid var(--input-border-color);background-color:transparent;position:relative}.lib-select input:hover{border-color:var(--input-active-border-colort)}.lib-select input:focus{border-color:var(--input-active-border-colort);box-shadow:var(--input-active-border-shadow)}.lib-select input:disabled{border:none;background-color:var(--input-disable-input);color:var(--input-disable-text);pointer-events:none}.lib-select input:disabled::placeholder{color:var(--input-placeholder)}.lib-select input.invalid,.lib-select input.invalid:hover{border-color:var(--input-error-border-color)}.lib-select input.invalid:focus{border-color:var(--input-error-border-color);box-shadow:var(--input-error-border-shadow)}.lib-select .clear{cursor:pointer;position:absolute;right:8px;top:12px}.lib-select .chevron{cursor:pointer;position:absolute;right:16px;top:10px}.lib-select .chevron.up{transform:rotate(180deg)}.lib-select__title{margin-bottom:4px;font-size:14px;line-height:24px;display:flex;align-items:flex-start}.lib-select__error{color:var(--primary-red-color);font-size:12px;font-weight:400;line-height:10px;margin-top:2px}.lib-select .select-list-wrapper{position:absolute;display:block;top:80px;z-index:100;width:100%;max-height:300px;overflow:auto;border-radius:8px;box-shadow:var(--main-card-shadow);background-color:var(--main-card-color)}.lib-select .select-list-wrapper .select-data{padding:12px 16px;cursor:pointer;position:relative}.lib-select .select-list-wrapper .select-data__desc{font-size:14px;font-weight:400;line-height:24px;text-overflow:ellipsis;text-wrap:nowrap;padding-top:2px;overflow:hidden;color:var(--second-gray-color)}.lib-select .select-list-wrapper .select-data:hover,.lib-select .select-list-wrapper .select-data.active{background:var(--select-act-hov-bgc)}.lib-select .select-list-wrapper .select-data.active .checked{position:absolute;right:16px;top:10px}.lib-select .select-list-wrapper .select-loader{padding:24px}\n"] }]
|
|
2459
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$5.ControlContainer, decorators: [{
|
|
2460
|
+
type: Optional
|
|
2461
|
+
}, {
|
|
2462
|
+
type: Host
|
|
2463
|
+
}, {
|
|
2464
|
+
type: SkipSelf
|
|
2465
|
+
}] }], propDecorators: { selectId: [{
|
|
2466
|
+
type: Input
|
|
2467
|
+
}], data: [{
|
|
2468
|
+
type: Input
|
|
2469
|
+
}], keyTitle: [{
|
|
2470
|
+
type: Input
|
|
2471
|
+
}], keyDesc: [{
|
|
2472
|
+
type: Input
|
|
2473
|
+
}], keyValue: [{
|
|
2474
|
+
type: Input
|
|
2475
|
+
}], placeholder: [{
|
|
2476
|
+
type: Input
|
|
2477
|
+
}] } });
|
|
2478
|
+
|
|
2479
|
+
const DefaultSort = [
|
|
2480
|
+
{ name: 'По возрастанию', value: 'asc', default: true },
|
|
2481
|
+
{ name: 'По убыванию', value: 'desc' },
|
|
2482
|
+
];
|
|
2483
|
+
class LibSortComponent {
|
|
2484
|
+
constructor() {
|
|
2485
|
+
this.sortItems = DefaultSort;
|
|
2486
|
+
this.sortEvent = new EventEmitter();
|
|
2487
|
+
}
|
|
2488
|
+
ngOnInit() {
|
|
2489
|
+
if (this.sortItems?.length) {
|
|
2490
|
+
this.sort = this.sortItems?.find(f => f.default)?.value || this.sortItems[0]?.value;
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2493
|
+
onSort(field) {
|
|
2494
|
+
if (field !== this.sort) {
|
|
2495
|
+
this.sort = field;
|
|
2496
|
+
this.sortEvent.emit(field);
|
|
2497
|
+
this.showSort = false;
|
|
2498
|
+
}
|
|
2499
|
+
}
|
|
2500
|
+
showSortList() {
|
|
2501
|
+
if (this.sortItems?.length) {
|
|
2502
|
+
this.showSort = !this.showSort;
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibSortComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2506
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: LibSortComponent, isStandalone: true, selector: "dd-lib-sort", inputs: { sortItems: "sortItems" }, outputs: { sortEvent: "sortEvent" }, ngImport: i0, template: "<div class=\"pos-relative\" id=\"js-sort-wrapper\">\r\n <div (click)=\"showSortList()\" class=\"d-flex align-center cup\">\r\n <div class=\"text-plain green mr-12\">\u0421\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0430</div>\r\n <div>\r\n <dd-lib-svg-icon icon=\"sort\"></dd-lib-svg-icon>\r\n </div>\r\n </div>\r\n @if (showSort) {\r\n <div (ddClickOutside)=\"showSort = false\" [elements]=\"['js-sort-wrapper']\" class=\"sort-list-container\">\r\n <dd-lib-card type=\"small\">\r\n <div class=\"sort-list-container__list\">\r\n @for (item of sortItems; track item) {\r\n <div (click)=\"onSort(item.value)\" [class.green]=\"sort === item.value\" class=\"mb-12 text-plain\">\r\n {{ item.name }}\r\n </div>\r\n }\r\n </div>\r\n </dd-lib-card>\r\n </div>\r\n }\r\n</div>\r\n", styles: [":host{display:block}.sort-list-container{position:absolute;z-index:1;top:36px}.sort-list-container__list{white-space:nowrap}.sort-list-container__list .text-plain{cursor:pointer}.sort-list-container__list .text-plain:hover{color:var(--primary-green-color)}\n"], dependencies: [{ kind: "directive", type: ClickOutsideDirective, selector: "[ddClickOutside]", inputs: ["elements"], outputs: ["ddClickOutside"] }, { kind: "component", type: LibCardComponent, selector: "dd-lib-card", inputs: ["type", "footerBtn", "sHeight", "skeleton", "parentLvlForSkeleton", "plugs", "borderRadius"], outputs: ["cardBtnEvent"] }, { kind: "component", type: LibSvgIconComponent, selector: "dd-lib-svg-icon", inputs: ["width", "height", "color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2507
|
+
}
|
|
2508
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibSortComponent, decorators: [{
|
|
2509
|
+
type: Component,
|
|
2510
|
+
args: [{ selector: 'dd-lib-sort', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [ClickOutsideDirective, LibCardComponent, NgOptimizedImage, LibSvgIconComponent], template: "<div class=\"pos-relative\" id=\"js-sort-wrapper\">\r\n <div (click)=\"showSortList()\" class=\"d-flex align-center cup\">\r\n <div class=\"text-plain green mr-12\">\u0421\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u043A\u0430</div>\r\n <div>\r\n <dd-lib-svg-icon icon=\"sort\"></dd-lib-svg-icon>\r\n </div>\r\n </div>\r\n @if (showSort) {\r\n <div (ddClickOutside)=\"showSort = false\" [elements]=\"['js-sort-wrapper']\" class=\"sort-list-container\">\r\n <dd-lib-card type=\"small\">\r\n <div class=\"sort-list-container__list\">\r\n @for (item of sortItems; track item) {\r\n <div (click)=\"onSort(item.value)\" [class.green]=\"sort === item.value\" class=\"mb-12 text-plain\">\r\n {{ item.name }}\r\n </div>\r\n }\r\n </div>\r\n </dd-lib-card>\r\n </div>\r\n }\r\n</div>\r\n", styles: [":host{display:block}.sort-list-container{position:absolute;z-index:1;top:36px}.sort-list-container__list{white-space:nowrap}.sort-list-container__list .text-plain{cursor:pointer}.sort-list-container__list .text-plain:hover{color:var(--primary-green-color)}\n"] }]
|
|
2511
|
+
}], propDecorators: { sortItems: [{
|
|
2512
|
+
type: Input
|
|
2513
|
+
}], sortEvent: [{
|
|
2514
|
+
type: Output
|
|
2515
|
+
}] } });
|
|
2516
|
+
|
|
2517
|
+
class LibStepComponent {
|
|
2518
|
+
constructor() {
|
|
2519
|
+
this.step = 1;
|
|
2520
|
+
this.name = 'шаг';
|
|
2521
|
+
}
|
|
2522
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibStepComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2523
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LibStepComponent, isStandalone: true, selector: "dd-lib-step", inputs: { step: "step", name: "name" }, ngImport: i0, template: "<span class=\"step-badge\">\r\n <span class=\"h3-title\">{{ step }}</span>\r\n <span class=\"h4-title\">{{ name }}</span>\r\n</span>\r\n", styles: [":host{display:flex}.step-badge{padding:8px 32px;border-radius:40px;background-color:var(--low-bgc-color);display:flex;align-items:baseline}@media screen and (max-width: 480px){.step-badge{width:100%;justify-content:center}}.step-badge span{color:var(--primary-green-color)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2524
|
+
}
|
|
2525
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibStepComponent, decorators: [{
|
|
2526
|
+
type: Component,
|
|
2527
|
+
args: [{ selector: 'dd-lib-step', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<span class=\"step-badge\">\r\n <span class=\"h3-title\">{{ step }}</span>\r\n <span class=\"h4-title\">{{ name }}</span>\r\n</span>\r\n", styles: [":host{display:flex}.step-badge{padding:8px 32px;border-radius:40px;background-color:var(--low-bgc-color);display:flex;align-items:baseline}@media screen and (max-width: 480px){.step-badge{width:100%;justify-content:center}}.step-badge span{color:var(--primary-green-color)}\n"] }]
|
|
2528
|
+
}], propDecorators: { step: [{
|
|
2529
|
+
type: Input
|
|
2530
|
+
}], name: [{
|
|
2531
|
+
type: Input
|
|
2532
|
+
}] } });
|
|
2533
|
+
|
|
2534
|
+
/**
|
|
2535
|
+
Компонент LibSvgComponent отвечает за отображение SVG иконок. Он содержит следующие свойства и методы:
|
|
2536
|
+
|
|
2537
|
+
Свойства:
|
|
2538
|
+
- @ViewChild('svgRef', { static: true }) public svg: ElementRef; - ссылка на элемент SVG.
|
|
2539
|
+
- @Input() public width: string; - ширина иконки.
|
|
2540
|
+
- @Input() public height: string; - высота иконки.
|
|
2541
|
+
- @Input() public icon: string; - название иконки.
|
|
2542
|
+
- @Input() public pack = 'svg'; - тип иконки (по умолчанию 'svg').
|
|
2543
|
+
- @Input() public color: TSvgColor = 'green'; - цвет иконки (зеленый по умолчанию).
|
|
2544
|
+
- @Input() public stroke: TSvgColor; - цвет обводки иконки.
|
|
2545
|
+
|
|
2546
|
+
Методы:
|
|
2547
|
+
- public ngOnInit(): void {} - метод жизненного цикла компонента, вызываемый при инициализации. В нем происходит загрузка SVG изображения и настройка его параметров, таких как ширина, высота и цвет.
|
|
2548
|
+
|
|
2549
|
+
В методе ngOnInit компонента LibSvgComponent происходит загрузка SVG изображения по указанному пути в зависимости от типа иконки и ее названия. Затем происходит обработка SVG элементов: удаление атрибутов fill и stroke у всех элементов path, а также у элементов svg и g. Задается ширина и высота SVG изображения в соответствии с переданными значениями.
|
|
2550
|
+
|
|
2551
|
+
Этот компонент значительно упрощает процесс отображения иконок на веб-странице, позволяя легко управлять их параметрами, такими как размеры и цвет.
|
|
2552
|
+
**/
|
|
2553
|
+
// @Deprecate
|
|
2554
|
+
class LibSvgComponent {
|
|
2555
|
+
constructor(http, rdr) {
|
|
2556
|
+
this.http = http;
|
|
2557
|
+
this.rdr = rdr;
|
|
2558
|
+
this.pack = 'svg';
|
|
2559
|
+
this.color = 'green';
|
|
2560
|
+
}
|
|
2561
|
+
ngOnInit() {
|
|
2562
|
+
this.http
|
|
2563
|
+
.get(`assets/images/${this.pack}/${this.icon}.svg`, { responseType: 'text', withCredentials: true })
|
|
2564
|
+
.subscribe(txt => {
|
|
2565
|
+
this.svg.nativeElement.innerHTML = txt;
|
|
2566
|
+
const svg = this.svg.nativeElement.children[0];
|
|
2567
|
+
const g = this.svg.nativeElement.children[0].children[0];
|
|
2568
|
+
const path = this.svg.nativeElement.children[0].children[0].children;
|
|
2569
|
+
for (const item of path) {
|
|
2570
|
+
this.rdr.removeAttribute(item, 'fill');
|
|
2571
|
+
this.rdr.removeAttribute(item, 'stroke');
|
|
2572
|
+
}
|
|
2573
|
+
this.rdr.removeAttribute(svg, 'fill');
|
|
2574
|
+
this.rdr.removeAttribute(g, 'fill');
|
|
2575
|
+
if (this.width) {
|
|
2576
|
+
this.rdr.setAttribute(svg, 'width', this.width);
|
|
2577
|
+
}
|
|
2578
|
+
if (this.height) {
|
|
2579
|
+
this.rdr.setAttribute(svg, 'height', this.height);
|
|
2580
|
+
}
|
|
2581
|
+
});
|
|
2582
|
+
}
|
|
2583
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibSvgComponent, deps: [{ token: i1$2.HttpClient }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2584
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: LibSvgComponent, isStandalone: true, selector: "dd-lib-svg", inputs: { width: "width", height: "height", icon: "icon", pack: "pack", color: "color", stroke: "stroke" }, viewQueries: [{ propertyName: "svg", first: true, predicate: ["svgRef"], descendants: true, static: true }], ngImport: i0, template: "<div\r\n #svgRef\r\n [class.black-stroke]=\"stroke === 'black'\"\r\n [class.black]=\"color === 'black'\"\r\n [class.gray-stroke]=\"stroke === 'gray'\"\r\n [class.gray]=\"color === 'gray'\"\r\n [class.green-stroke]=\"stroke === 'green'\"\r\n [class.green]=\"color === 'green'\"\r\n [class.white-stroke]=\"stroke === 'white'\"\r\n [class.white]=\"color === 'white'\"\r\n [class.gold-stroke]=\"stroke === 'gold'\"\r\n [class.gold]=\"color === 'gold'\"\r\n [class.blue-stroke]=\"stroke === 'blue'\"\r\n [class.blue]=\"color === 'blue'\"\r\n class=\"lib-icon\"></div>\r\n", styles: [".lib-icon{display:flex;align-items:center;justify-content:center}.lib-icon.green{fill:var(--primary-green-color)}.lib-icon.white{fill:#fff}.lib-icon.white path{fill:#fff;stroke:#fff}.lib-icon.white-stroke{stroke:var(--white-color)}.lib-icon.white-stroke g>path,.lib-icon.white-stroke path{stroke:var(--white-color)}.lib-icon.black{fill:var(--black-color)}.lib-icon.gray{fill:var(--second-gray-color)}.lib-icon.gray path{fill:var(--second-gray-color);stroke:var(--second-gray-color)}.lib-icon.gray-stroke{stroke:var(--second-gray-color)}.lib-icon.gray-stroke path{stroke:var(--second-gray-color)}.lib-icon.gold-stroke{stroke:var(--gold-svg-color)}.lib-icon.gold-stroke path{stroke:var(--gold-svg-color)}.lib-icon.gold{fill:var(--gold-bgc-color)}.lib-icon.gold path{fill:var(--gold-bgc-color);stroke:var(--gold-svg-color)}.lib-icon.blue-stroke{stroke:var(--blue-color)}.lib-icon.blue-stroke path{stroke:var(--blue-color)}.lib-icon.blue{fill:var(--blue-light-bgc)}.lib-icon.blue path{fill:var(--blue-light-bgc);stroke:var(--blue-light-bgc)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2585
|
+
}
|
|
2586
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibSvgComponent, decorators: [{
|
|
2587
|
+
type: Component,
|
|
2588
|
+
args: [{ selector: 'dd-lib-svg', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\r\n #svgRef\r\n [class.black-stroke]=\"stroke === 'black'\"\r\n [class.black]=\"color === 'black'\"\r\n [class.gray-stroke]=\"stroke === 'gray'\"\r\n [class.gray]=\"color === 'gray'\"\r\n [class.green-stroke]=\"stroke === 'green'\"\r\n [class.green]=\"color === 'green'\"\r\n [class.white-stroke]=\"stroke === 'white'\"\r\n [class.white]=\"color === 'white'\"\r\n [class.gold-stroke]=\"stroke === 'gold'\"\r\n [class.gold]=\"color === 'gold'\"\r\n [class.blue-stroke]=\"stroke === 'blue'\"\r\n [class.blue]=\"color === 'blue'\"\r\n class=\"lib-icon\"></div>\r\n", styles: [".lib-icon{display:flex;align-items:center;justify-content:center}.lib-icon.green{fill:var(--primary-green-color)}.lib-icon.white{fill:#fff}.lib-icon.white path{fill:#fff;stroke:#fff}.lib-icon.white-stroke{stroke:var(--white-color)}.lib-icon.white-stroke g>path,.lib-icon.white-stroke path{stroke:var(--white-color)}.lib-icon.black{fill:var(--black-color)}.lib-icon.gray{fill:var(--second-gray-color)}.lib-icon.gray path{fill:var(--second-gray-color);stroke:var(--second-gray-color)}.lib-icon.gray-stroke{stroke:var(--second-gray-color)}.lib-icon.gray-stroke path{stroke:var(--second-gray-color)}.lib-icon.gold-stroke{stroke:var(--gold-svg-color)}.lib-icon.gold-stroke path{stroke:var(--gold-svg-color)}.lib-icon.gold{fill:var(--gold-bgc-color)}.lib-icon.gold path{fill:var(--gold-bgc-color);stroke:var(--gold-svg-color)}.lib-icon.blue-stroke{stroke:var(--blue-color)}.lib-icon.blue-stroke path{stroke:var(--blue-color)}.lib-icon.blue{fill:var(--blue-light-bgc)}.lib-icon.blue path{fill:var(--blue-light-bgc);stroke:var(--blue-light-bgc)}\n"] }]
|
|
2589
|
+
}], ctorParameters: () => [{ type: i1$2.HttpClient }, { type: i0.Renderer2 }], propDecorators: { svg: [{
|
|
2590
|
+
type: ViewChild,
|
|
2591
|
+
args: ['svgRef', { static: true }]
|
|
2592
|
+
}], width: [{
|
|
2593
|
+
type: Input
|
|
2594
|
+
}], height: [{
|
|
2595
|
+
type: Input
|
|
2596
|
+
}], icon: [{
|
|
2597
|
+
type: Input
|
|
2598
|
+
}], pack: [{
|
|
2599
|
+
type: Input
|
|
2600
|
+
}], color: [{
|
|
2601
|
+
type: Input
|
|
2602
|
+
}], stroke: [{
|
|
2603
|
+
type: Input
|
|
2604
|
+
}] } });
|
|
2605
|
+
|
|
2606
|
+
class ITab {
|
|
2607
|
+
constructor(body) {
|
|
2608
|
+
this.id = body.id;
|
|
2609
|
+
this.title = body.namePage;
|
|
2610
|
+
this.name = body.name;
|
|
2611
|
+
this.fragment = body.address;
|
|
2612
|
+
this.welcomeText = body.welcomeText;
|
|
2613
|
+
this.type = body.type;
|
|
2614
|
+
for (const key in body) {
|
|
2615
|
+
if (key) {
|
|
2616
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2617
|
+
// @ts-ignore
|
|
2618
|
+
this[key] = body[key];
|
|
2619
|
+
}
|
|
2620
|
+
}
|
|
2621
|
+
}
|
|
2622
|
+
}
|
|
2623
|
+
class LibTabsFragmentComponent {
|
|
2624
|
+
constructor(route, router, cdr) {
|
|
2625
|
+
this.route = route;
|
|
2626
|
+
this.router = router;
|
|
2627
|
+
this.cdr = cdr;
|
|
2628
|
+
this.rout = location.pathname;
|
|
2629
|
+
this.setActiveTab = new EventEmitter();
|
|
2630
|
+
}
|
|
2631
|
+
ngOnInit() {
|
|
2632
|
+
if (this.tabs) {
|
|
2633
|
+
this.tabsFragment = this.tabs.map(t => t.fragment);
|
|
2634
|
+
this.getFragment();
|
|
2635
|
+
}
|
|
2636
|
+
}
|
|
2637
|
+
checkActiveTab(tab) {
|
|
2638
|
+
if (tab) {
|
|
2639
|
+
this.activeFragment = tab.id;
|
|
2640
|
+
if (this.rout) {
|
|
2641
|
+
this.router.navigate([this.rout], { fragment: tab.fragment });
|
|
2642
|
+
}
|
|
2643
|
+
this.setActiveTab.emit(this.activeFragment);
|
|
2644
|
+
}
|
|
2645
|
+
else {
|
|
2646
|
+
this.activeFragment = undefined;
|
|
2647
|
+
this.router.navigate([this.rout], { fragment: undefined });
|
|
2648
|
+
}
|
|
2649
|
+
this.cdr.detectChanges();
|
|
2650
|
+
}
|
|
2651
|
+
getFragment() {
|
|
2652
|
+
const activeFragment = this.route.snapshot.fragment;
|
|
2653
|
+
this.activeFragment = this.tabs?.[0]?.id || 0;
|
|
2654
|
+
if (this.tabsFragment?.includes(activeFragment)) {
|
|
2655
|
+
this.activeFragment = this.tabs?.find(f => f.fragment === activeFragment)?.id;
|
|
2656
|
+
if (this.needInitEvent) {
|
|
2657
|
+
this.setActiveTab.emit(this.activeFragment);
|
|
2658
|
+
}
|
|
2659
|
+
}
|
|
2660
|
+
else if (this.needInitEvent) {
|
|
2661
|
+
this.setActiveTab.emit(this.activeFragment);
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
2664
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibTabsFragmentComponent, deps: [{ token: i1$1.ActivatedRoute }, { token: i1$1.Router }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2665
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: LibTabsFragmentComponent, isStandalone: true, selector: "dd-lib-tabs-fragment", inputs: { rout: "rout", tabs: "tabs", tabsFragment: "tabsFragment", needInitEvent: "needInitEvent" }, outputs: { setActiveTab: "setActiveTab" }, ngImport: i0, template: "@if (tabs?.length) {\r\n<div class=\"tabs-filter-types\">\r\n @for (tab of tabs; track tab) {\r\n <div\r\n (click)=\"checkActiveTab(tab)\"\r\n [class.active]=\"tab.id === activeFragment\"\r\n class=\"tabs-filter-types__type\">\r\n {{ tab.title }}\r\n </div>\r\n }\r\n</div>\r\n}\r\n", styles: [".tabs-filter-types{display:flex;align-items:center}.tabs-filter-types__type{padding:16px 8px;border-bottom:1px solid var(--gray-color-200);color:var(--second-gray-color);cursor:pointer;transition:.5s}.tabs-filter-types__type:hover,.tabs-filter-types__type.active{border-color:var(--primary-green-color);box-shadow:0 -1px 0 0 var(--primary-green-color) inset;color:var(--primary-green-color)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2666
|
+
}
|
|
2667
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibTabsFragmentComponent, decorators: [{
|
|
2668
|
+
type: Component,
|
|
2669
|
+
args: [{ selector: 'dd-lib-tabs-fragment', standalone: true, imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (tabs?.length) {\r\n<div class=\"tabs-filter-types\">\r\n @for (tab of tabs; track tab) {\r\n <div\r\n (click)=\"checkActiveTab(tab)\"\r\n [class.active]=\"tab.id === activeFragment\"\r\n class=\"tabs-filter-types__type\">\r\n {{ tab.title }}\r\n </div>\r\n }\r\n</div>\r\n}\r\n", styles: [".tabs-filter-types{display:flex;align-items:center}.tabs-filter-types__type{padding:16px 8px;border-bottom:1px solid var(--gray-color-200);color:var(--second-gray-color);cursor:pointer;transition:.5s}.tabs-filter-types__type:hover,.tabs-filter-types__type.active{border-color:var(--primary-green-color);box-shadow:0 -1px 0 0 var(--primary-green-color) inset;color:var(--primary-green-color)}\n"] }]
|
|
2670
|
+
}], ctorParameters: () => [{ type: i1$1.ActivatedRoute }, { type: i1$1.Router }, { type: i0.ChangeDetectorRef }], propDecorators: { rout: [{
|
|
2671
|
+
type: Input
|
|
2672
|
+
}], tabs: [{
|
|
2673
|
+
type: Input
|
|
2674
|
+
}], tabsFragment: [{
|
|
2675
|
+
type: Input
|
|
2676
|
+
}], needInitEvent: [{
|
|
2677
|
+
type: Input
|
|
2678
|
+
}], setActiveTab: [{
|
|
2679
|
+
type: Output
|
|
2680
|
+
}] } });
|
|
2681
|
+
|
|
2682
|
+
class LibTextareaComponent extends LibCommonInputTextComponent {
|
|
2683
|
+
constructor(changeDetection, controlContainer) {
|
|
2684
|
+
super(changeDetection);
|
|
2685
|
+
this.controlContainer = controlContainer;
|
|
2686
|
+
this.rows = '6';
|
|
2687
|
+
this.needCounter = true;
|
|
2688
|
+
}
|
|
2689
|
+
ngOnInit() {
|
|
2690
|
+
this.control =
|
|
2691
|
+
this.controlContainer && this.formControlName
|
|
2692
|
+
? this.controlContainer?.control?.get(this.formControlName)
|
|
2693
|
+
: null;
|
|
2694
|
+
}
|
|
2695
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibTextareaComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$5.ControlContainer, host: true, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2696
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.12", type: LibTextareaComponent, isStandalone: true, selector: "dd-lib-textarea", inputs: { rows: "rows", needCounter: "needCounter" }, providers: [
|
|
2697
|
+
{
|
|
2698
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2699
|
+
useExisting: forwardRef(() => LibTextareaComponent),
|
|
2700
|
+
multi: true,
|
|
2701
|
+
},
|
|
2702
|
+
], usesInheritance: true, ngImport: i0, template: "<div class=\"lib-textarea\">\r\n <label [for]=\"id\" class=\"lib-textarea__title\">\r\n {{ label }} @if (needCounter) {\r\n <span>(\u043E\u0441\u0442\u0430\u043B\u043E\u0441\u044C {{ maxlength - (value?.length || 0) }} \u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432)</span>\r\n } @if (required) {\r\n <dd-lib-svg-icon icon=\"error_hint\"></dd-lib-svg-icon>\r\n }\r\n </label>\r\n <div class=\"pos-relative d-flex\">\r\n <textarea\r\n #textarea\r\n (blur)=\"notifyFocusEvent($event)\"\r\n (change)=\"handleChange()\"\r\n (focus)=\"notifyFocusEvent($event)\"\r\n (input)=\"handleInput($event)\"\r\n (keyup.enter)=\"forceChange()\"\r\n [(ngModel)]=\"value\"\r\n [attr.id]=\"id ? id : null\"\r\n [attr.maxlength]=\"maxlength\"\r\n [attr.minlength]=\"minlength\"\r\n [attr.name]=\"name\"\r\n [attr.placeholder]=\"placeholder\"\r\n [attr.tabIndex]=\"tabIndex\"\r\n [class.focused]=\"focused\"\r\n [class.invalid]=\"invalid\"\r\n [disabled]=\"disabled\"\r\n [readOnly]=\"readOnly\"\r\n [required]=\"required\"\r\n [rows]=\"rows\"\r\n class=\"textarea\"></textarea>\r\n <span class=\"lib-textarea__counter\">{{ value?.length || 0 }}/{{ maxlength }}</span>\r\n </div>\r\n\r\n @if (errorText && invalid) {\r\n <div class=\"lib-input__error\">{{ errorText }}</div>\r\n }\r\n</div>\r\n", styles: [".lib-textarea{position:relative;display:inline;flex-direction:column}.lib-textarea textarea{width:100%;min-height:48px;padding:12px 16px;border-radius:8px;border:1px solid var(--input-border-color);background-color:transparent;resize:none}.lib-textarea textarea:hover{border-color:var(--input-active-border-colort)}.lib-textarea textarea:focus{border-color:var(--input-active-border-colort);box-shadow:var(--input-active-border-shadow)}.lib-textarea textarea:disabled{border:none;background-color:var(--input-disable-input);color:var(--input-disable-text);pointer-events:none}.lib-textarea textarea:disabled::placeholder{color:var(--input-placeholder)}.lib-textarea textarea.invalid,.lib-textarea textarea.invalid:hover{border-color:var(--input-error-border-color)}.lib-textarea textarea.invalid:focus{border-color:var(--input-error-border-color);box-shadow:var(--input-error-border-shadow)}.lib-textarea__counter{position:absolute;font-size:12px;font-weight:400;right:16px;bottom:12px;color:var(--input-placeholder)}.lib-textarea__counter textarea:disabled+.lib-text-counter{color:var(--input-disable-text)}.lib-textarea__title{margin-bottom:4px;font-size:14px;line-height:24px;display:flex;align-items:flex-start}.lib-textarea__error{color:var(--primary-red-color);font-size:12px;font-weight:400;line-height:10px;margin-top:2px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$5.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: LibSvgIconComponent, selector: "dd-lib-svg-icon", inputs: ["width", "height", "color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2703
|
+
}
|
|
2704
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: LibTextareaComponent, decorators: [{
|
|
2705
|
+
type: Component,
|
|
2706
|
+
args: [{ selector: 'dd-lib-textarea', standalone: true, imports: [FormsModule, NgOptimizedImage, LibSvgIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
2707
|
+
{
|
|
2708
|
+
provide: NG_VALUE_ACCESSOR,
|
|
2709
|
+
useExisting: forwardRef(() => LibTextareaComponent),
|
|
2710
|
+
multi: true,
|
|
2711
|
+
},
|
|
2712
|
+
], template: "<div class=\"lib-textarea\">\r\n <label [for]=\"id\" class=\"lib-textarea__title\">\r\n {{ label }} @if (needCounter) {\r\n <span>(\u043E\u0441\u0442\u0430\u043B\u043E\u0441\u044C {{ maxlength - (value?.length || 0) }} \u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432)</span>\r\n } @if (required) {\r\n <dd-lib-svg-icon icon=\"error_hint\"></dd-lib-svg-icon>\r\n }\r\n </label>\r\n <div class=\"pos-relative d-flex\">\r\n <textarea\r\n #textarea\r\n (blur)=\"notifyFocusEvent($event)\"\r\n (change)=\"handleChange()\"\r\n (focus)=\"notifyFocusEvent($event)\"\r\n (input)=\"handleInput($event)\"\r\n (keyup.enter)=\"forceChange()\"\r\n [(ngModel)]=\"value\"\r\n [attr.id]=\"id ? id : null\"\r\n [attr.maxlength]=\"maxlength\"\r\n [attr.minlength]=\"minlength\"\r\n [attr.name]=\"name\"\r\n [attr.placeholder]=\"placeholder\"\r\n [attr.tabIndex]=\"tabIndex\"\r\n [class.focused]=\"focused\"\r\n [class.invalid]=\"invalid\"\r\n [disabled]=\"disabled\"\r\n [readOnly]=\"readOnly\"\r\n [required]=\"required\"\r\n [rows]=\"rows\"\r\n class=\"textarea\"></textarea>\r\n <span class=\"lib-textarea__counter\">{{ value?.length || 0 }}/{{ maxlength }}</span>\r\n </div>\r\n\r\n @if (errorText && invalid) {\r\n <div class=\"lib-input__error\">{{ errorText }}</div>\r\n }\r\n</div>\r\n", styles: [".lib-textarea{position:relative;display:inline;flex-direction:column}.lib-textarea textarea{width:100%;min-height:48px;padding:12px 16px;border-radius:8px;border:1px solid var(--input-border-color);background-color:transparent;resize:none}.lib-textarea textarea:hover{border-color:var(--input-active-border-colort)}.lib-textarea textarea:focus{border-color:var(--input-active-border-colort);box-shadow:var(--input-active-border-shadow)}.lib-textarea textarea:disabled{border:none;background-color:var(--input-disable-input);color:var(--input-disable-text);pointer-events:none}.lib-textarea textarea:disabled::placeholder{color:var(--input-placeholder)}.lib-textarea textarea.invalid,.lib-textarea textarea.invalid:hover{border-color:var(--input-error-border-color)}.lib-textarea textarea.invalid:focus{border-color:var(--input-error-border-color);box-shadow:var(--input-error-border-shadow)}.lib-textarea__counter{position:absolute;font-size:12px;font-weight:400;right:16px;bottom:12px;color:var(--input-placeholder)}.lib-textarea__counter textarea:disabled+.lib-text-counter{color:var(--input-disable-text)}.lib-textarea__title{margin-bottom:4px;font-size:14px;line-height:24px;display:flex;align-items:flex-start}.lib-textarea__error{color:var(--primary-red-color);font-size:12px;font-weight:400;line-height:10px;margin-top:2px}\n"] }]
|
|
2713
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1$5.ControlContainer, decorators: [{
|
|
2714
|
+
type: Optional
|
|
2715
|
+
}, {
|
|
2716
|
+
type: Host
|
|
2717
|
+
}, {
|
|
2718
|
+
type: SkipSelf
|
|
2719
|
+
}] }], propDecorators: { rows: [{
|
|
2720
|
+
type: Input
|
|
2721
|
+
}], needCounter: [{
|
|
2722
|
+
type: Input
|
|
2723
|
+
}] } });
|
|
2724
|
+
|
|
2725
|
+
// export function Debounce(delay: number = 1000): MethodDecorator {
|
|
2726
|
+
// return function (_target: any, _propertyKey: string | symbol, descriptor: PropertyDescriptor) {
|
|
2727
|
+
// let timeout: any = null;
|
|
2728
|
+
// const original = descriptor.value;
|
|
2729
|
+
//
|
|
2730
|
+
// descriptor.value = function (...args: any) {
|
|
2731
|
+
// clearTimeout(timeout);
|
|
2732
|
+
// timeout = setTimeout(() => original.apply(this, args), delay);
|
|
2733
|
+
// };
|
|
2734
|
+
//
|
|
2735
|
+
// return descriptor;
|
|
2736
|
+
// };
|
|
2737
|
+
//
|
|
2738
|
+
// }
|
|
2739
|
+
function Debounce(delay = 1000) {
|
|
2740
|
+
return function (_target, _propertyKey, descriptor) {
|
|
2741
|
+
const originalMethod = descriptor.value;
|
|
2742
|
+
const subject = new Subject();
|
|
2743
|
+
let lastArgs = null;
|
|
2744
|
+
let isFirstCall = true;
|
|
2745
|
+
descriptor.value = function (...args) {
|
|
2746
|
+
if (isFirstCall) {
|
|
2747
|
+
isFirstCall = false;
|
|
2748
|
+
originalMethod.apply(this, args);
|
|
2749
|
+
}
|
|
2750
|
+
else {
|
|
2751
|
+
lastArgs = args;
|
|
2752
|
+
if (!subject.isStopped) {
|
|
2753
|
+
subject.next(null);
|
|
2754
|
+
}
|
|
2755
|
+
}
|
|
2756
|
+
subject.pipe(debounceTime(delay)).subscribe(() => {
|
|
2757
|
+
if (lastArgs) {
|
|
2758
|
+
originalMethod.apply(this, lastArgs);
|
|
2759
|
+
lastArgs = null;
|
|
2760
|
+
}
|
|
2761
|
+
});
|
|
2762
|
+
};
|
|
2763
|
+
return descriptor;
|
|
2764
|
+
};
|
|
2765
|
+
}
|
|
2766
|
+
function Throttle(delay = 1000) {
|
|
2767
|
+
let isThrottled = false;
|
|
2768
|
+
return function (_target, _propertyKey, descriptor) {
|
|
2769
|
+
const originalMethod = descriptor.value;
|
|
2770
|
+
descriptor.value = function (...args) {
|
|
2771
|
+
if (!isThrottled) {
|
|
2772
|
+
isThrottled = true;
|
|
2773
|
+
originalMethod.apply(this, args);
|
|
2774
|
+
setTimeout(() => {
|
|
2775
|
+
isThrottled = false;
|
|
2776
|
+
}, delay);
|
|
2777
|
+
}
|
|
2778
|
+
};
|
|
2779
|
+
return descriptor;
|
|
2780
|
+
};
|
|
2781
|
+
}
|
|
2782
|
+
function Disabled(controlKey, streams = ['loadings', 'subloadings']) {
|
|
2783
|
+
return function (target, key) {
|
|
2784
|
+
Object.defineProperty(target, key, {
|
|
2785
|
+
enumerable: false,
|
|
2786
|
+
configurable: true,
|
|
2787
|
+
get() {
|
|
2788
|
+
const control = this[controlKey];
|
|
2789
|
+
if (!control) {
|
|
2790
|
+
return of(true);
|
|
2791
|
+
}
|
|
2792
|
+
if (streams.length === 0) {
|
|
2793
|
+
const checkControl = control.invalid || !control.dirty;
|
|
2794
|
+
return of(checkControl);
|
|
2795
|
+
}
|
|
2796
|
+
const streams$ = streams
|
|
2797
|
+
.filter(streamKey => !!this[streamKey])
|
|
2798
|
+
.map(streamKey => this[streamKey]);
|
|
2799
|
+
return combineLatest(streams$).pipe(switchMap(streamsSwitch => {
|
|
2800
|
+
const checkControl = control.invalid || !control.dirty;
|
|
2801
|
+
const checkLoaders = streamsSwitch.some(loader => loader);
|
|
2802
|
+
return of(checkControl || checkLoaders);
|
|
2803
|
+
}));
|
|
2804
|
+
},
|
|
2805
|
+
});
|
|
2806
|
+
};
|
|
2807
|
+
}
|
|
2808
|
+
function DisableAfterNCall(limit = 5) {
|
|
2809
|
+
return function (target, key, descriptor) {
|
|
2810
|
+
const originalMethod = descriptor.value;
|
|
2811
|
+
let count = 0;
|
|
2812
|
+
descriptor.value = function (...args) {
|
|
2813
|
+
count++;
|
|
2814
|
+
if (count <= limit) {
|
|
2815
|
+
return originalMethod.apply(this, args);
|
|
2816
|
+
}
|
|
2817
|
+
else {
|
|
2818
|
+
console.log(`Метод ${key} будет отключен после ${limit} вызовов`);
|
|
2819
|
+
}
|
|
2820
|
+
};
|
|
2821
|
+
return descriptor;
|
|
2822
|
+
};
|
|
2823
|
+
}
|
|
2824
|
+
|
|
2825
|
+
const TOAST_DATA = new InjectionToken('ToastData');
|
|
2826
|
+
class ToastBaseComponent {
|
|
2827
|
+
get id() {
|
|
2828
|
+
return this.data.id;
|
|
2829
|
+
}
|
|
2830
|
+
constructor(toastService, ddToastData) {
|
|
2831
|
+
this.toastService = toastService;
|
|
2832
|
+
this.ddToastData = ddToastData;
|
|
2833
|
+
this.data = { ...this.ddToastData };
|
|
2834
|
+
}
|
|
2835
|
+
destroy() {
|
|
2836
|
+
this.toastService.destroyToast(this.id);
|
|
2837
|
+
}
|
|
2838
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ToastBaseComponent, deps: [{ token: ToastService }, { token: TOAST_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2839
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ToastBaseComponent, isStandalone: true, selector: "dd-toast-base", ngImport: i0, template: "<div (click)=\"destroy()\" class=\"toast-wrapper {{ data.type }}\">\n <dd-lib-svg-icon [icon]=\"data.type\"></dd-lib-svg-icon>\n <div>\n <div>{{ data.title }}</div>\n <div>{{ data.description }}</div>\n </div>\n</div>\n", styles: [":host{display:block}.toast-wrapper{display:flex;margin:40px 40px 0 0;align-items:center;padding:20px;background:#eefaf3;border-radius:12px;opacity:1;max-width:350px;animation:fade 1s linear;width:100%}.toast-wrapper.success{background-color:var(--light-green-color)}.toast-wrapper.info{background-color:var(--light-blue-color)}.toast-wrapper.warning{background-color:var(--yellow-card)}.toast-wrapper.danger{background-color:var(--red-light-color)}@keyframes fade{0%{opacity:0}50%{opacity:.5}to{opacity:1}}\n"], dependencies: [{ kind: "component", type: LibSvgIconComponent, selector: "dd-lib-svg-icon", inputs: ["width", "height", "color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2840
|
+
}
|
|
2841
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ToastBaseComponent, decorators: [{
|
|
2842
|
+
type: Component,
|
|
2843
|
+
args: [{ selector: 'dd-toast-base', standalone: true, imports: [NgOptimizedImage, NgIf, LibSvgIconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div (click)=\"destroy()\" class=\"toast-wrapper {{ data.type }}\">\n <dd-lib-svg-icon [icon]=\"data.type\"></dd-lib-svg-icon>\n <div>\n <div>{{ data.title }}</div>\n <div>{{ data.description }}</div>\n </div>\n</div>\n", styles: [":host{display:block}.toast-wrapper{display:flex;margin:40px 40px 0 0;align-items:center;padding:20px;background:#eefaf3;border-radius:12px;opacity:1;max-width:350px;animation:fade 1s linear;width:100%}.toast-wrapper.success{background-color:var(--light-green-color)}.toast-wrapper.info{background-color:var(--light-blue-color)}.toast-wrapper.warning{background-color:var(--yellow-card)}.toast-wrapper.danger{background-color:var(--red-light-color)}@keyframes fade{0%{opacity:0}50%{opacity:.5}to{opacity:1}}\n"] }]
|
|
2844
|
+
}], ctorParameters: () => [{ type: ToastService }, { type: undefined, decorators: [{
|
|
2845
|
+
type: Inject,
|
|
2846
|
+
args: [TOAST_DATA]
|
|
2847
|
+
}] }] });
|
|
2848
|
+
|
|
2849
|
+
var ToastType;
|
|
2850
|
+
(function (ToastType) {
|
|
2851
|
+
ToastType["Warning"] = "warning_t";
|
|
2852
|
+
ToastType["Success"] = "success_t";
|
|
2853
|
+
ToastType["Info"] = "info_t";
|
|
2854
|
+
ToastType["Danger"] = "danger_t";
|
|
2855
|
+
})(ToastType || (ToastType = {}));
|
|
2856
|
+
class ToastConfig {
|
|
2857
|
+
constructor(config) {
|
|
2858
|
+
this.timeOut = 5000;
|
|
2859
|
+
if (config) {
|
|
2860
|
+
Object.keys(config).forEach(key => (this[key] = config[key]));
|
|
2861
|
+
}
|
|
2862
|
+
}
|
|
2863
|
+
}
|
|
2864
|
+
class ToastService {
|
|
2865
|
+
constructor(overlay) {
|
|
2866
|
+
this.overlay = overlay;
|
|
2867
|
+
this.config = new ToastConfig();
|
|
2868
|
+
this.counter = 0;
|
|
2869
|
+
this.ddToastData = { type: ToastType.Success, id: this.counter };
|
|
2870
|
+
this.overlayRefs = {};
|
|
2871
|
+
}
|
|
2872
|
+
warning(title, description) {
|
|
2873
|
+
this.createToast(title, description, ToastType.Warning);
|
|
2874
|
+
}
|
|
2875
|
+
success(title, description) {
|
|
2876
|
+
this.createToast(title, description, ToastType.Success);
|
|
2877
|
+
}
|
|
2878
|
+
danger(title, description) {
|
|
2879
|
+
this.createToast(title, description, ToastType.Danger);
|
|
2880
|
+
}
|
|
2881
|
+
info(title, description) {
|
|
2882
|
+
this.createToast(title, description, ToastType.Info);
|
|
2883
|
+
}
|
|
2884
|
+
registerViewContainerRef(vcRef) {
|
|
2885
|
+
this.viewContainer = vcRef;
|
|
2886
|
+
}
|
|
2887
|
+
registerInjector(injector) {
|
|
2888
|
+
this.injector = injector;
|
|
2889
|
+
}
|
|
2890
|
+
destroyToast(id) {
|
|
2891
|
+
if (this.overlayRefs?.[id].hasAttached() === true) {
|
|
2892
|
+
this.overlayRefs?.[id].detach();
|
|
2893
|
+
}
|
|
2894
|
+
}
|
|
2895
|
+
createToast(title, description, type) {
|
|
2896
|
+
const positionStrategy = this.getPositionStrategy();
|
|
2897
|
+
// this.overlayRef = this.overlay.create({ positionStrategy });
|
|
2898
|
+
this.overlayRefs[this.counter] = this.overlay.create({ positionStrategy });
|
|
2899
|
+
this.ddToastData.title = title;
|
|
2900
|
+
this.ddToastData.description = description;
|
|
2901
|
+
this.ddToastData.type = type;
|
|
2902
|
+
this.ddToastData.id = this.counter;
|
|
2903
|
+
const injector = Injector.create({
|
|
2904
|
+
providers: [
|
|
2905
|
+
{
|
|
2906
|
+
provide: TOAST_DATA,
|
|
2907
|
+
useValue: this.ddToastData,
|
|
2908
|
+
},
|
|
2909
|
+
],
|
|
2910
|
+
parent: this.injector,
|
|
2911
|
+
});
|
|
2912
|
+
const component = new ComponentPortal(ToastBaseComponent, this.viewContainer, injector);
|
|
2913
|
+
console.log(component);
|
|
2914
|
+
// this.overlayRef.attach(component);
|
|
2915
|
+
this.overlayRefs[this.counter].attach(component);
|
|
2916
|
+
setTimeout(() => {
|
|
2917
|
+
for (const id in this.overlayRefs) {
|
|
2918
|
+
if (this.overlayRefs[id]?.hasAttached()) {
|
|
2919
|
+
this.overlayRefs[id]?.detach();
|
|
2920
|
+
}
|
|
2921
|
+
}
|
|
2922
|
+
// if (this.overlayRef?.hasAttached() === true) {
|
|
2923
|
+
// this.overlayRef?.detach();
|
|
2924
|
+
// }
|
|
2925
|
+
}, this.config.timeOut);
|
|
2926
|
+
this.counter++;
|
|
2927
|
+
}
|
|
2928
|
+
getPositionStrategy() {
|
|
2929
|
+
let element;
|
|
2930
|
+
let positions;
|
|
2931
|
+
const haveToast = document.getElementsByClassName('cdk-overlay-pane');
|
|
2932
|
+
if (haveToast.length) {
|
|
2933
|
+
element = haveToast[haveToast.length - 1];
|
|
2934
|
+
positions = [
|
|
2935
|
+
{
|
|
2936
|
+
originX: 'start',
|
|
2937
|
+
originY: 'bottom',
|
|
2938
|
+
overlayX: 'start',
|
|
2939
|
+
overlayY: 'top',
|
|
2940
|
+
panelClass: 'toast-top',
|
|
2941
|
+
},
|
|
2942
|
+
];
|
|
2943
|
+
}
|
|
2944
|
+
else {
|
|
2945
|
+
element = document.getElementsByTagName('body')[0];
|
|
2946
|
+
positions = [
|
|
2947
|
+
{
|
|
2948
|
+
originX: 'end',
|
|
2949
|
+
originY: 'top',
|
|
2950
|
+
overlayX: 'end',
|
|
2951
|
+
overlayY: 'top',
|
|
2952
|
+
panelClass: '',
|
|
2953
|
+
},
|
|
2954
|
+
];
|
|
2955
|
+
}
|
|
2956
|
+
return this.overlay.position().flexibleConnectedTo(element).withPositions(positions);
|
|
2957
|
+
}
|
|
2958
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ToastService, deps: [{ token: i1$4.Overlay }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2959
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ToastService, providedIn: 'root' }); }
|
|
2960
|
+
}
|
|
2961
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ToastService, decorators: [{
|
|
2962
|
+
type: Injectable,
|
|
2963
|
+
args: [{
|
|
2964
|
+
providedIn: 'root',
|
|
2965
|
+
}]
|
|
2966
|
+
}], ctorParameters: () => [{ type: i1$4.Overlay }] });
|
|
2967
|
+
|
|
2968
|
+
class ToastPlaceholderComponent {
|
|
2969
|
+
constructor(toastService, injector) {
|
|
2970
|
+
this.toastService = toastService;
|
|
2971
|
+
this.injector = injector;
|
|
2972
|
+
}
|
|
2973
|
+
ngOnInit() {
|
|
2974
|
+
this.toastService.registerViewContainerRef(this.viewContainerRef);
|
|
2975
|
+
this.toastService.registerInjector(this.injector);
|
|
2976
|
+
}
|
|
2977
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ToastPlaceholderComponent, deps: [{ token: ToastService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2978
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.12", type: ToastPlaceholderComponent, isStandalone: true, selector: "dd-toast-placeholder", viewQueries: [{ propertyName: "viewContainerRef", first: true, predicate: ["toastPlaceholder"], descendants: true, read: ViewContainerRef, static: true }], ngImport: i0, template: ` <div #toastPlaceholder></div>
|
|
2979
|
+
<div id="toast-overlay"></div>`, isInline: true }); }
|
|
2980
|
+
}
|
|
2981
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: ToastPlaceholderComponent, decorators: [{
|
|
2982
|
+
type: Component,
|
|
2983
|
+
args: [{
|
|
2984
|
+
selector: 'dd-toast-placeholder',
|
|
2985
|
+
standalone: true,
|
|
2986
|
+
template: ` <div #toastPlaceholder></div>
|
|
2987
|
+
<div id="toast-overlay"></div>`,
|
|
2988
|
+
}]
|
|
2989
|
+
}], ctorParameters: () => [{ type: ToastService }, { type: i0.Injector }], propDecorators: { viewContainerRef: [{
|
|
2990
|
+
type: ViewChild,
|
|
2991
|
+
args: ['toastPlaceholder', { read: ViewContainerRef, static: true }]
|
|
2992
|
+
}] } });
|
|
2993
|
+
|
|
2994
|
+
/*
|
|
2995
|
+
* Public API Surface of dd-lib
|
|
2996
|
+
*/
|
|
2997
|
+
const t = true;
|
|
2998
|
+
|
|
2999
|
+
/**
|
|
3000
|
+
* Generated bundle index. Do not edit.
|
|
3001
|
+
*/
|
|
3002
|
+
|
|
3003
|
+
export { AutoHeightDirective, ClickOutsideDirective, CounterDirective, DEFAULT_FORMAT, DateService, Debounce, DeclensionDirective, DestroyService, DialogService, DisableAfterNCall, Disabled, FetcherService, FilterByKeyPipe, FilterPipe, FilterTabsPipe, HighlightPipe, ITab, InterceptorsService, LibAccordionComponent, LibBackButtonComponent, LibButtonComponent, LibCalendarComponent, LibCardComponent, LibCheckboxComponent, LibCommentInputComponent, LibCommonButtonComponent, LibCommonInputTextComponent, LibFileUploadComponent, LibFilterButtonComponent, LibImageLoaderComponent, LibInputComponent, LibLoaderComponent, LibPeriodComponent, LibRadioComponent, LibSearchInputComponent, LibSelectComponent, LibSkeletonComponent, LibSortComponent, LibStepComponent, LibSvgComponent, LibSvgIconComponent, LibTabsFragmentComponent, LibTextareaComponent, ResizeTextareaDirective, ReversePipe, SafePipe, SvgIconsService, TOOLTIP_DATA, ThemeConfigurator, ThemeConstructorService, Throttle, ToastConfig, ToastPlaceholderComponent, ToastService, ToastType, TooltipComponent, TooltipDirective, ValidatorsService, t };
|
|
3004
|
+
//# sourceMappingURL=morozeckiy-dd-lib.mjs.map
|