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