@morozeckiy/dd-lib 0.7.79 → 0.7.80
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/fesm2022/morozeckiy-dd-lib.mjs +245 -57
- package/fesm2022/morozeckiy-dd-lib.mjs.map +1 -1
- package/lib/core/directives/selectable-item.directive.d.ts +9 -2
- package/lib/core/index.d.ts +1 -0
- package/lib/core/pipes/sort-by-val.pipe.d.ts +11 -0
- package/lib/core/services/validators.service.d.ts +2 -2
- package/lib/lib-calendar/lib-calendar.component.d.ts +5 -4
- package/lib/lib-date-range/lib-date-range.component.d.ts +20 -6
- package/lib/lib-horizontal-scroll/lib-horizontal-scroll.component.d.ts +1 -0
- package/lib/lib-select/lib-select.component.d.ts +3 -1
- package/morozeckiy-dd-lib-0.7.80.tgz +0 -0
- package/package.json +1 -1
- package/morozeckiy-dd-lib-0.7.79.tgz +0 -0
|
@@ -11,7 +11,7 @@ import * as i2 from '@angular/router';
|
|
|
11
11
|
import { RouterLink } from '@angular/router';
|
|
12
12
|
import * as i1$1 from '@angular/platform-browser';
|
|
13
13
|
import * as i1$2 from '@angular/common';
|
|
14
|
-
import { DecimalPipe, CommonModule, AsyncPipe, DOCUMENT, NgTemplateOutlet, NgComponentOutlet, NgStyle, NgClass } from '@angular/common';
|
|
14
|
+
import { DecimalPipe, CommonModule, AsyncPipe, DOCUMENT, NgTemplateOutlet, NgComponentOutlet, NgStyle, JsonPipe, NgClass } from '@angular/common';
|
|
15
15
|
import { ComponentPortal, PortalInjector, CdkPortalOutlet, TemplatePortal } from '@angular/cdk/portal';
|
|
16
16
|
import * as i1$3 from '@angular/cdk/overlay';
|
|
17
17
|
import { OverlayModule, GlobalPositionStrategy } from '@angular/cdk/overlay';
|
|
@@ -612,6 +612,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
|
|
|
612
612
|
}]
|
|
613
613
|
}] });
|
|
614
614
|
|
|
615
|
+
class SortByValPipe {
|
|
616
|
+
transform(arr, key, direction = 'ASC') {
|
|
617
|
+
if (!arr?.length || !key)
|
|
618
|
+
return arr || [];
|
|
619
|
+
// Создаем копию массива, чтобы не мутировать исходный
|
|
620
|
+
const arrayCopy = [...arr];
|
|
621
|
+
return arrayCopy.sort((a, b) => {
|
|
622
|
+
let aValue;
|
|
623
|
+
let bValue;
|
|
624
|
+
// Если ключ - это функция, вызываем ее для получения значения
|
|
625
|
+
if (typeof key === 'function') {
|
|
626
|
+
aValue = key(a);
|
|
627
|
+
bValue = key(b);
|
|
628
|
+
}
|
|
629
|
+
else {
|
|
630
|
+
// Иначе получаем значение по ключу
|
|
631
|
+
aValue = a[key];
|
|
632
|
+
bValue = b[key];
|
|
633
|
+
}
|
|
634
|
+
// Приводим значения к строке для сравнения, если они разных типов
|
|
635
|
+
if (typeof aValue !== typeof bValue) {
|
|
636
|
+
aValue = String(aValue);
|
|
637
|
+
bValue = String(bValue);
|
|
638
|
+
}
|
|
639
|
+
let comparison = 0;
|
|
640
|
+
if (aValue > bValue) {
|
|
641
|
+
comparison = 1;
|
|
642
|
+
}
|
|
643
|
+
else if (aValue < bValue) {
|
|
644
|
+
comparison = -1;
|
|
645
|
+
}
|
|
646
|
+
// Инвертируем результат если направление DESC
|
|
647
|
+
return direction === 'DESC' ? -comparison : comparison;
|
|
648
|
+
});
|
|
649
|
+
}
|
|
650
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SortByValPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
651
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.2", ngImport: i0, type: SortByValPipe, isStandalone: true, name: "sortByVal" }); }
|
|
652
|
+
}
|
|
653
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SortByValPipe, decorators: [{
|
|
654
|
+
type: Pipe,
|
|
655
|
+
args: [{
|
|
656
|
+
name: 'sortByVal',
|
|
657
|
+
standalone: true
|
|
658
|
+
}]
|
|
659
|
+
}] });
|
|
660
|
+
|
|
615
661
|
class AutoHeightDirective {
|
|
616
662
|
constructor(el, rdr) {
|
|
617
663
|
this.el = el;
|
|
@@ -1249,9 +1295,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
|
|
|
1249
1295
|
}] } });
|
|
1250
1296
|
|
|
1251
1297
|
class SelectableItemDirective {
|
|
1252
|
-
constructor(el) {
|
|
1298
|
+
constructor(el, renderer) {
|
|
1253
1299
|
this.el = el;
|
|
1300
|
+
this.renderer = renderer;
|
|
1301
|
+
this.isMouseDown = false;
|
|
1302
|
+
this.lastSelectedItem = null;
|
|
1254
1303
|
this.itemSelected = new EventEmitter();
|
|
1304
|
+
this.firstSelection = true;
|
|
1255
1305
|
}
|
|
1256
1306
|
onEnter(event) {
|
|
1257
1307
|
if (this.el.nativeElement.classList.contains('key-down-active')) {
|
|
@@ -1259,8 +1309,33 @@ class SelectableItemDirective {
|
|
|
1259
1309
|
this.itemSelected.emit();
|
|
1260
1310
|
}
|
|
1261
1311
|
}
|
|
1262
|
-
|
|
1263
|
-
|
|
1312
|
+
onMouseDown(event) {
|
|
1313
|
+
this.isMouseDown = true;
|
|
1314
|
+
this.lastSelectedItem = this.el.nativeElement;
|
|
1315
|
+
event.preventDefault();
|
|
1316
|
+
}
|
|
1317
|
+
onMouseMove(event) {
|
|
1318
|
+
if (!this.isMouseDown)
|
|
1319
|
+
return;
|
|
1320
|
+
const elementUnderMouse = document.elementFromPoint(event.clientX, event.clientY);
|
|
1321
|
+
if (elementUnderMouse && elementUnderMouse.classList.contains('select-data')) {
|
|
1322
|
+
if (elementUnderMouse === this.lastSelectedItem && this.firstSelection) {
|
|
1323
|
+
this.lastSelectedItem = elementUnderMouse;
|
|
1324
|
+
elementUnderMouse.dispatchEvent(new MouseEvent('click'));
|
|
1325
|
+
this.firstSelection = false;
|
|
1326
|
+
}
|
|
1327
|
+
if (elementUnderMouse !== this.lastSelectedItem) {
|
|
1328
|
+
this.lastSelectedItem = elementUnderMouse;
|
|
1329
|
+
elementUnderMouse.dispatchEvent(new MouseEvent('click'));
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
onMouseUp() {
|
|
1334
|
+
this.isMouseDown = false;
|
|
1335
|
+
this.lastSelectedItem = null;
|
|
1336
|
+
}
|
|
1337
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SelectableItemDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1338
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.2", type: SelectableItemDirective, isStandalone: true, selector: "[ddSelectableItem]", outputs: { itemSelected: "itemSelected" }, host: { listeners: { "document:keyup.enter": "onEnter($event)", "mousedown": "onMouseDown($event)", "document:mousemove": "onMouseMove($event)", "document:mouseup": "onMouseUp()" } }, ngImport: i0 }); }
|
|
1264
1339
|
}
|
|
1265
1340
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: SelectableItemDirective, decorators: [{
|
|
1266
1341
|
type: Directive,
|
|
@@ -1268,11 +1343,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
|
|
|
1268
1343
|
selector: '[ddSelectableItem]',
|
|
1269
1344
|
standalone: true
|
|
1270
1345
|
}]
|
|
1271
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { itemSelected: [{
|
|
1346
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }], propDecorators: { itemSelected: [{
|
|
1272
1347
|
type: Output
|
|
1273
1348
|
}], onEnter: [{
|
|
1274
1349
|
type: HostListener,
|
|
1275
1350
|
args: ['document:keyup.enter', ['$event']]
|
|
1351
|
+
}], onMouseDown: [{
|
|
1352
|
+
type: HostListener,
|
|
1353
|
+
args: ['mousedown', ['$event']]
|
|
1354
|
+
}], onMouseMove: [{
|
|
1355
|
+
type: HostListener,
|
|
1356
|
+
args: ['document:mousemove', ['$event']]
|
|
1357
|
+
}], onMouseUp: [{
|
|
1358
|
+
type: HostListener,
|
|
1359
|
+
args: ['document:mouseup']
|
|
1276
1360
|
}] } });
|
|
1277
1361
|
|
|
1278
1362
|
class FixedPositionDirective {
|
|
@@ -2420,6 +2504,8 @@ const Months = [
|
|
|
2420
2504
|
'Ноябрь',
|
|
2421
2505
|
'Декабрь',
|
|
2422
2506
|
];
|
|
2507
|
+
class IDatePeriod {
|
|
2508
|
+
}
|
|
2423
2509
|
/**
|
|
2424
2510
|
Этот компонент используется для отображения календаря с возможностью выбора даты.
|
|
2425
2511
|
Ниже приведено описание свойств и методов данного компонента:
|
|
@@ -2493,6 +2579,7 @@ class LibCalendarComponent {
|
|
|
2493
2579
|
this.needTime = false;
|
|
2494
2580
|
this.mode = 'full';
|
|
2495
2581
|
this.emitDate = new EventEmitter();
|
|
2582
|
+
this.immediatelyEmitDate = new EventEmitter();
|
|
2496
2583
|
this.emitPeriod = new EventEmitter();
|
|
2497
2584
|
this.months = Months;
|
|
2498
2585
|
this.week = ['ПН', 'ВТ', 'СР', 'ЧТ', 'ПТ', 'СБ', 'ВС'];
|
|
@@ -2555,25 +2642,23 @@ class LibCalendarComponent {
|
|
|
2555
2642
|
}
|
|
2556
2643
|
selectDay(day) {
|
|
2557
2644
|
if (!this.checkHideDay(day)) {
|
|
2558
|
-
if (this.rangeMode) {
|
|
2559
|
-
if (!this.dateStart) {
|
|
2560
|
-
|
|
2561
|
-
}
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
}
|
|
2572
|
-
}
|
|
2573
|
-
else {
|
|
2645
|
+
if (!this.rangeMode) {
|
|
2646
|
+
// if (!this.dateStart) {
|
|
2647
|
+
// this.dateStart = new Date(this.year, this.month, day);
|
|
2648
|
+
// } else {
|
|
2649
|
+
// const eDate = new Date(this.year, this.month, day);
|
|
2650
|
+
// if (this.dateStart > eDate) {
|
|
2651
|
+
// this.dateEnd = undefined;
|
|
2652
|
+
// this.dateStart = eDate;
|
|
2653
|
+
// } else {
|
|
2654
|
+
// this.dateEnd = eDate;
|
|
2655
|
+
// }
|
|
2656
|
+
// }
|
|
2657
|
+
// } else {
|
|
2574
2658
|
this.dateValue = new Date(this.year, this.month, day);
|
|
2575
2659
|
}
|
|
2576
2660
|
}
|
|
2661
|
+
this.immediatelyEmitDate.emit(new Date(this.year, this.month, day));
|
|
2577
2662
|
}
|
|
2578
2663
|
selectDate() {
|
|
2579
2664
|
if (this.rangeMode) {
|
|
@@ -2653,13 +2738,13 @@ class LibCalendarComponent {
|
|
|
2653
2738
|
}
|
|
2654
2739
|
}
|
|
2655
2740
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: LibCalendarComponent, deps: [{ token: DateService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2656
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: LibCalendarComponent, isStandalone: true, selector: "dd-lib-calendar", inputs: { type: "type", formatDate: "formatDate", formatTime: "formatTime", rangeMode: "rangeMode", maxHours: "maxHours", maxMinutes: "maxMinutes", needTime: "needTime", mode: "mode", maxDate: "maxDate", minDate: "minDate" }, outputs: { emitDate: "emitDate", emitPeriod: "emitPeriod" }, providers: [
|
|
2741
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: LibCalendarComponent, isStandalone: true, selector: "dd-lib-calendar", inputs: { type: "type", formatDate: "formatDate", formatTime: "formatTime", rangeMode: "rangeMode", maxHours: "maxHours", maxMinutes: "maxMinutes", needTime: "needTime", mode: "mode", dateStart: "dateStart", dateEnd: "dateEnd", maxDate: "maxDate", minDate: "minDate" }, outputs: { emitDate: "emitDate", immediatelyEmitDate: "immediatelyEmitDate", emitPeriod: "emitPeriod" }, providers: [
|
|
2657
2742
|
{
|
|
2658
2743
|
provide: NG_VALUE_ACCESSOR,
|
|
2659
2744
|
useExisting: forwardRef(() => LibCalendarComponent),
|
|
2660
2745
|
multi: true,
|
|
2661
2746
|
},
|
|
2662
|
-
], ngImport: i0, template: "@if (mode === 'icon') {\
|
|
2747
|
+
], ngImport: i0, template: "@if (mode === 'icon') {\n<div class=\"pos-relative d-flex align-center\">\n @if (dateValue) {\n <span class=\"mr-12 green\">{{ dateValue | date: 'dd.MM.yyyy' }}</span>\n }\n <dd-lib-svg-icon class=\"cup\" (click)=\"showCalendar = !showCalendar\" icon=\"calendar\"></dd-lib-svg-icon>\n @if (dateValue) {\n <dd-lib-svg-icon class=\"cup\" (click)=\"canselDate()\" icon=\"clear\"></dd-lib-svg-icon>\n } @if (showCalendar) {\n <div class=\"calendar-abs-wrapper\">\n <ng-template [ngTemplateOutlet]=\"calendar\"></ng-template>\n </div>\n }\n</div>\n} @if (mode === 'full') {\n<ng-template [ngTemplateOutlet]=\"calendar\"></ng-template>\n}\n\n<ng-template #calendar>\n <dd-lib-card class=\"calendar-block\" type=\"small\">\n <div class=\"full-width\">\n <div class=\"calendar-block__header\">\n <div class=\"calendar-block__header_arrow\">\n <dd-lib-svg-icon (click)=\"changeMonth(-1)\" icon=\"left_chevron\"></dd-lib-svg-icon>\n </div>\n <div class=\"calendar-block__header_year\">{{ getMonth() + ' ' + year }}</div>\n <div class=\"calendar-block__header_arrow\">\n <dd-lib-svg-icon (click)=\"changeMonth(1)\" icon=\"right_chevron\"></dd-lib-svg-icon>\n </div>\n </div>\n <div class=\"calendar-block__week\">\n @for (day of week; track day) {\n <div class=\"calendar-block__week_day\">{{ day }}</div>\n }\n </div>\n <div class=\"calendar-block__days\">\n @for (day of daysInMonth?.prevDays; track day) {\n <div class=\"calendar-block__days_day hide\">{{ day }}</div>\n } @for (day of daysInMonth?.days; track day) {\n <div\n (click)=\"selectDay(day)\"\n [class.active]=\"checkActiveDay(day)\"\n\n [class.current]=\"\n dateNow.getDate() === day && dateNow.getMonth() === month && dateNow.getFullYear() === year\n \"\n [class.hide]=\"checkHideDay(day)\"\n class=\"calendar-block__days_day normal\">\n {{ day }}\n </div>\n } @for (day of daysInMonth?.lastDays; track day) {\n <div class=\"calendar-block__days_day hide\">{{ day }}</div>\n }\n </div>\n @if(needTime) {\n <div class=\"calendar-block__time\">\n <div class=\"d-flex justify-between\">\n <div class=\"text-plain\">\u0412\u0440\u0435\u043C\u044F</div>\n <div class=\"d-flex\">\n <input [(ngModel)]=\"hours\" class=\"calendar-block__time-input\"\n type=\"text\"\n [ddMaxNum]=\"maxHours\"\n [curVal]=\"hours\"\n [disabled]=\"!dateValue\"\n [regExp]=\"true\"\n ddBanSymbol=\"^\\d+$\"\n max=\"23\"\n maxlength=\"2\"\n pattern=\"^\\d+$\">\n <span class=\"second-dot\">:</span>\n <input [(ngModel)]=\"minutes\" class=\"calendar-block__time-input\"\n [ddMaxNum]=\"maxMinutes\"\n [curVal]=\"minutes\"\n [disabled]=\"!dateValue\"\n [regExp]=\"true\"\n ddBanSymbol=\"^\\d+$\"\n max=\"59\"\n maxlength=\"2\"\n pattern=\"^\\d+$\"\n type=\"text\">\n </div>\n </div>\n </div>\n }\n <div class=\"calendar-block__footer\">\n <dd-lib-button (click)=\"canselDate()\" [btnColor]=\"'transparent'\" class=\"calendar-block__footer_btn\"\n >\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C\n </dd-lib-button>\n <dd-lib-button (click)=\"selectDate()\"\n [disabled]=\"(!dateValue && !rangeMode) || (rangeMode && (!dateStart || !dateEnd))\"\n class=\"calendar-block__footer_btn\"\n >\u0412\u044B\u0431\u0440\u0430\u0442\u044C\n </dd-lib-button>\n </div>\n </div>\n </dd-lib-card>\n</ng-template>\n", styles: [":host{display:block;-webkit-user-select:none;user-select:none}.calendar-block{z-index:1100;display:block}@media screen and (max-width: 840px){.calendar-block{height:100%}}.calendar-block__time{padding:22px 0;margin:22px 0;border-top:1px solid var(--gray-color-200);border-bottom:1px solid var(--gray-color-200)}.calendar-block__time-input{width:56px;height:36px;border-radius:12px;border:1px solid var(--primary-gray-color);text-align:center}.calendar-block__time .second-dot{margin:auto 8px;animation:blink 1s step-end infinite}@keyframes blink{0%,to{opacity:1}50%{opacity:0}}.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:grid;grid-template-columns:repeat(7,1fr);gap:14px;justify-items:center;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{display:flex;align-items:center;justify-content:space-around}.calendar-block__days{display:grid;grid-template-columns:repeat(7,1fr);gap:10px;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;color:var(--light-black-color)}.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);top:0;right:0;z-index:1111}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}\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$2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1$2.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"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.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$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$4.PatternValidator, selector: "[pattern][formControlName],[pattern][formControl],[pattern][ngModel]", inputs: ["pattern"] }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: BanSymbolDirective, selector: "[ddBanSymbol]", inputs: ["ddBanSymbol", "regExp"] }, { kind: "directive", type: MaxNumDirective, selector: "[ddMaxNum]", inputs: ["ddMaxNum", "curVal"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
2663
2748
|
}
|
|
2664
2749
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: LibCalendarComponent, decorators: [{
|
|
2665
2750
|
type: Component,
|
|
@@ -2677,7 +2762,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
|
|
|
2677
2762
|
useExisting: forwardRef(() => LibCalendarComponent),
|
|
2678
2763
|
multi: true,
|
|
2679
2764
|
},
|
|
2680
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (mode === 'icon') {\
|
|
2765
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (mode === 'icon') {\n<div class=\"pos-relative d-flex align-center\">\n @if (dateValue) {\n <span class=\"mr-12 green\">{{ dateValue | date: 'dd.MM.yyyy' }}</span>\n }\n <dd-lib-svg-icon class=\"cup\" (click)=\"showCalendar = !showCalendar\" icon=\"calendar\"></dd-lib-svg-icon>\n @if (dateValue) {\n <dd-lib-svg-icon class=\"cup\" (click)=\"canselDate()\" icon=\"clear\"></dd-lib-svg-icon>\n } @if (showCalendar) {\n <div class=\"calendar-abs-wrapper\">\n <ng-template [ngTemplateOutlet]=\"calendar\"></ng-template>\n </div>\n }\n</div>\n} @if (mode === 'full') {\n<ng-template [ngTemplateOutlet]=\"calendar\"></ng-template>\n}\n\n<ng-template #calendar>\n <dd-lib-card class=\"calendar-block\" type=\"small\">\n <div class=\"full-width\">\n <div class=\"calendar-block__header\">\n <div class=\"calendar-block__header_arrow\">\n <dd-lib-svg-icon (click)=\"changeMonth(-1)\" icon=\"left_chevron\"></dd-lib-svg-icon>\n </div>\n <div class=\"calendar-block__header_year\">{{ getMonth() + ' ' + year }}</div>\n <div class=\"calendar-block__header_arrow\">\n <dd-lib-svg-icon (click)=\"changeMonth(1)\" icon=\"right_chevron\"></dd-lib-svg-icon>\n </div>\n </div>\n <div class=\"calendar-block__week\">\n @for (day of week; track day) {\n <div class=\"calendar-block__week_day\">{{ day }}</div>\n }\n </div>\n <div class=\"calendar-block__days\">\n @for (day of daysInMonth?.prevDays; track day) {\n <div class=\"calendar-block__days_day hide\">{{ day }}</div>\n } @for (day of daysInMonth?.days; track day) {\n <div\n (click)=\"selectDay(day)\"\n [class.active]=\"checkActiveDay(day)\"\n\n [class.current]=\"\n dateNow.getDate() === day && dateNow.getMonth() === month && dateNow.getFullYear() === year\n \"\n [class.hide]=\"checkHideDay(day)\"\n class=\"calendar-block__days_day normal\">\n {{ day }}\n </div>\n } @for (day of daysInMonth?.lastDays; track day) {\n <div class=\"calendar-block__days_day hide\">{{ day }}</div>\n }\n </div>\n @if(needTime) {\n <div class=\"calendar-block__time\">\n <div class=\"d-flex justify-between\">\n <div class=\"text-plain\">\u0412\u0440\u0435\u043C\u044F</div>\n <div class=\"d-flex\">\n <input [(ngModel)]=\"hours\" class=\"calendar-block__time-input\"\n type=\"text\"\n [ddMaxNum]=\"maxHours\"\n [curVal]=\"hours\"\n [disabled]=\"!dateValue\"\n [regExp]=\"true\"\n ddBanSymbol=\"^\\d+$\"\n max=\"23\"\n maxlength=\"2\"\n pattern=\"^\\d+$\">\n <span class=\"second-dot\">:</span>\n <input [(ngModel)]=\"minutes\" class=\"calendar-block__time-input\"\n [ddMaxNum]=\"maxMinutes\"\n [curVal]=\"minutes\"\n [disabled]=\"!dateValue\"\n [regExp]=\"true\"\n ddBanSymbol=\"^\\d+$\"\n max=\"59\"\n maxlength=\"2\"\n pattern=\"^\\d+$\"\n type=\"text\">\n </div>\n </div>\n </div>\n }\n <div class=\"calendar-block__footer\">\n <dd-lib-button (click)=\"canselDate()\" [btnColor]=\"'transparent'\" class=\"calendar-block__footer_btn\"\n >\u041E\u0442\u043C\u0435\u043D\u0438\u0442\u044C\n </dd-lib-button>\n <dd-lib-button (click)=\"selectDate()\"\n [disabled]=\"(!dateValue && !rangeMode) || (rangeMode && (!dateStart || !dateEnd))\"\n class=\"calendar-block__footer_btn\"\n >\u0412\u044B\u0431\u0440\u0430\u0442\u044C\n </dd-lib-button>\n </div>\n </div>\n </dd-lib-card>\n</ng-template>\n", styles: [":host{display:block;-webkit-user-select:none;user-select:none}.calendar-block{z-index:1100;display:block}@media screen and (max-width: 840px){.calendar-block{height:100%}}.calendar-block__time{padding:22px 0;margin:22px 0;border-top:1px solid var(--gray-color-200);border-bottom:1px solid var(--gray-color-200)}.calendar-block__time-input{width:56px;height:36px;border-radius:12px;border:1px solid var(--primary-gray-color);text-align:center}.calendar-block__time .second-dot{margin:auto 8px;animation:blink 1s step-end infinite}@keyframes blink{0%,to{opacity:1}50%{opacity:0}}.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:grid;grid-template-columns:repeat(7,1fr);gap:14px;justify-items:center;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{display:flex;align-items:center;justify-content:space-around}.calendar-block__days{display:grid;grid-template-columns:repeat(7,1fr);gap:10px;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;color:var(--light-black-color)}.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);top:0;right:0;z-index:1111}input::-webkit-outer-spin-button,input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}\n"] }]
|
|
2681
2766
|
}], ctorParameters: () => [{ type: DateService }], propDecorators: { type: [{
|
|
2682
2767
|
type: Input
|
|
2683
2768
|
}], formatDate: [{
|
|
@@ -2694,8 +2779,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
|
|
|
2694
2779
|
type: Input
|
|
2695
2780
|
}], mode: [{
|
|
2696
2781
|
type: Input
|
|
2782
|
+
}], dateStart: [{
|
|
2783
|
+
type: Input
|
|
2784
|
+
}], dateEnd: [{
|
|
2785
|
+
type: Input
|
|
2697
2786
|
}], emitDate: [{
|
|
2698
2787
|
type: Output
|
|
2788
|
+
}], immediatelyEmitDate: [{
|
|
2789
|
+
type: Output
|
|
2699
2790
|
}], emitPeriod: [{
|
|
2700
2791
|
type: Output
|
|
2701
2792
|
}], maxDate: [{
|
|
@@ -3114,7 +3205,7 @@ class LibPeriodComponent {
|
|
|
3114
3205
|
useExisting: forwardRef(() => LibPeriodComponent),
|
|
3115
3206
|
multi: true,
|
|
3116
3207
|
},
|
|
3117
|
-
], 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=\"period__wrapper\">\r\n <dd-lib-card class=\"period__block\" type=\"small\">\r\n <div>\r\n <div class=\"period__header\">\r\n <div class=\"period__back\" (click)=\"periodIsShown = false\">\r\n <dd-lib-svg-icon icon=\"toggle_arrow_left\"></dd-lib-svg-icon>\r\n <div class=\"g-h5-title\">\u041F\u0435\u0440\u0438\u043E\u0434</div>\r\n </div>\r\n <div class=\"g-h5-title hide-tablet\">\u041F\u0435\u0440\u0438\u043E\u0434</div>\r\n <div (click)=\"clearPeriod()\" class=\"g-text font-medium green cup\">\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C</div>\r\n </div>\r\n <div class=\"period__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=\"g-text font-medium green cup mt-8\">\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=\"period__calendar\">\r\n </dd-lib-calendar>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: ["dd-lib-filter-button{position:relative}.period__wrapper{position:absolute;left:0;z-index:400;display:block;width:352px;height:348px;margin-top:8px;animation:filter-show .5s forwards}@media screen and (max-width: 840px){.period__wrapper{position:fixed;top:0;width:100%;height:100%;overflow:auto;margin-top:0;animation:shift .3s}}@media screen and (max-width: 840px){.period__block{height:100%}}.period__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}@media screen and (max-width: 840px){.period__header{padding-bottom:24px;border-bottom:1px solid var(--gray-color-200)}}@media screen and (max-width: 480px){.period__header{padding-top:8px}}.period__back{display:none}@media screen and (max-width: 840px){.period__back{display:flex;align-items:center}}.period__back ::ng-deep svg{margin-right:16px}.period__back ::ng-deep svg path{stroke:var(--menu-arr-color)}.period__list{max-height:400px;overflow:auto}@media screen and (max-width: 840px){.period__list{max-height:none}}.period__list ::ng-deep dd-lib-radio{display:block;margin-bottom:16px}@media screen and (max-width: 840px){.period__list ::ng-deep dd-lib-radio:not(:last-child){padding-bottom:16px;border-bottom:1px solid var(--gray-color-200)}}.period__calendar{margin-top:8px;display:block;animation:filter-show .5s forwards}@media screen and (max-width: 840px){.period__calendar{position:fixed;top:0;left:0;width:100%;height:100%;overflow:auto;margin-top:0;animation:shift .3s}}\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: ["btnTitle", "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", "rangeMode", "maxHours", "maxMinutes", "needTime", "mode", "maxDate", "minDate"], outputs: ["emitDate", "emitPeriod"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.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"] }, { kind: "component", type: LibSvgIconComponent, selector: "dd-lib-svg-icon", inputs: ["width", "height", "color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3208
|
+
], 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=\"period__wrapper\">\r\n <dd-lib-card class=\"period__block\" type=\"small\">\r\n <div>\r\n <div class=\"period__header\">\r\n <div class=\"period__back\" (click)=\"periodIsShown = false\">\r\n <dd-lib-svg-icon icon=\"toggle_arrow_left\"></dd-lib-svg-icon>\r\n <div class=\"g-h5-title\">\u041F\u0435\u0440\u0438\u043E\u0434</div>\r\n </div>\r\n <div class=\"g-h5-title hide-tablet\">\u041F\u0435\u0440\u0438\u043E\u0434</div>\r\n <div (click)=\"clearPeriod()\" class=\"g-text font-medium green cup\">\u0421\u0431\u0440\u043E\u0441\u0438\u0442\u044C</div>\r\n </div>\r\n <div class=\"period__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=\"g-text font-medium green cup mt-8\">\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=\"period__calendar\">\r\n </dd-lib-calendar>\r\n }\r\n </div>\r\n }\r\n</div>\r\n", styles: ["dd-lib-filter-button{position:relative}.period__wrapper{position:absolute;left:0;z-index:400;display:block;width:352px;height:348px;margin-top:8px;animation:filter-show .5s forwards}@media screen and (max-width: 840px){.period__wrapper{position:fixed;top:0;width:100%;height:100%;overflow:auto;margin-top:0;animation:shift .3s}}@media screen and (max-width: 840px){.period__block{height:100%}}.period__header{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px}@media screen and (max-width: 840px){.period__header{padding-bottom:24px;border-bottom:1px solid var(--gray-color-200)}}@media screen and (max-width: 480px){.period__header{padding-top:8px}}.period__back{display:none}@media screen and (max-width: 840px){.period__back{display:flex;align-items:center}}.period__back ::ng-deep svg{margin-right:16px}.period__back ::ng-deep svg path{stroke:var(--menu-arr-color)}.period__list{max-height:400px;overflow:auto}@media screen and (max-width: 840px){.period__list{max-height:none}}.period__list ::ng-deep dd-lib-radio{display:block;margin-bottom:16px}@media screen and (max-width: 840px){.period__list ::ng-deep dd-lib-radio:not(:last-child){padding-bottom:16px;border-bottom:1px solid var(--gray-color-200)}}.period__calendar{margin-top:8px;display:block;animation:filter-show .5s forwards}@media screen and (max-width: 840px){.period__calendar{position:fixed;top:0;left:0;width:100%;height:100%;overflow:auto;margin-top:0;animation:shift .3s}}\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: ["btnTitle", "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", "rangeMode", "maxHours", "maxMinutes", "needTime", "mode", "dateStart", "dateEnd", "maxDate", "minDate"], outputs: ["emitDate", "immediatelyEmitDate", "emitPeriod"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.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"] }, { kind: "component", type: LibSvgIconComponent, selector: "dd-lib-svg-icon", inputs: ["width", "height", "color", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3118
3209
|
}
|
|
3119
3210
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: LibPeriodComponent, decorators: [{
|
|
3120
3211
|
type: Component,
|
|
@@ -3404,6 +3495,12 @@ class LibHorizontalScrollComponent {
|
|
|
3404
3495
|
this.lastTime = time;
|
|
3405
3496
|
this.lastScrollLeft = container.scrollLeft;
|
|
3406
3497
|
}
|
|
3498
|
+
onWheel(e) {
|
|
3499
|
+
const container = this.el.nativeElement.querySelector('.scroll-container');
|
|
3500
|
+
// Уменьшаем скорость прокрутки, умножая на коэффициент (например 0.5)
|
|
3501
|
+
container.scrollLeft += e.deltaY * 0.5;
|
|
3502
|
+
e.preventDefault();
|
|
3503
|
+
}
|
|
3407
3504
|
startInertialScroll() {
|
|
3408
3505
|
this.cancelAnimation();
|
|
3409
3506
|
const animate = () => {
|
|
@@ -3429,11 +3526,11 @@ class LibHorizontalScrollComponent {
|
|
|
3429
3526
|
this.cancelAnimation();
|
|
3430
3527
|
}
|
|
3431
3528
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: LibHorizontalScrollComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3432
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: LibHorizontalScrollComponent, isStandalone: true, selector: "dd-lib-horizontal-scroll", ngImport: i0, template: "<div class=\"scroll-container\"\r\n (mousedown)=\"onMouseDown($event)\"\r\n (mouseleave)=\"onMouseLeave()\"\r\n (mouseup)=\"onMouseUp()\"\r\n (mousemove)=\"onMouseMove($event)\"\r\n (touchstart)=\"onTouchStart($event)\"\r\n (touchend)=\"onTouchEnd()\"\r\n (touchmove)=\"onTouchMove($event)\">\r\n <div class=\"scroll-content\">\r\n <ng-content></ng-content>\r\n </div>\r\n</div>\r\n", styles: [".scroll-container{width:100%;overflow-x:auto;cursor:grab;-ms-overflow-style:none;scrollbar-width:none}.scroll-container:active{cursor:grabbing}.scroll-container::-webkit-scrollbar{display:none}.scroll-content{display:inline-flex;-webkit-user-select:none;user-select:none;gap:4px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3529
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.2", type: LibHorizontalScrollComponent, isStandalone: true, selector: "dd-lib-horizontal-scroll", ngImport: i0, template: "<div class=\"scroll-container\"\r\n (mousedown)=\"onMouseDown($event)\"\r\n (mouseleave)=\"onMouseLeave()\"\r\n (mouseup)=\"onMouseUp()\"\r\n (mousemove)=\"onMouseMove($event)\"\r\n (wheel)=\"onWheel($event)\"\r\n (touchstart)=\"onTouchStart($event)\"\r\n (touchend)=\"onTouchEnd()\"\r\n (touchmove)=\"onTouchMove($event)\">\r\n <div class=\"scroll-content\">\r\n <ng-content></ng-content>\r\n </div>\r\n</div>\r\n", styles: [".scroll-container{width:100%;overflow-x:auto;cursor:grab;-ms-overflow-style:none;scrollbar-width:none}.scroll-container:active{cursor:grabbing}.scroll-container::-webkit-scrollbar{display:none}.scroll-content{display:inline-flex;-webkit-user-select:none;user-select:none;gap:4px}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3433
3530
|
}
|
|
3434
3531
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: LibHorizontalScrollComponent, decorators: [{
|
|
3435
3532
|
type: Component,
|
|
3436
|
-
args: [{ selector: 'dd-lib-horizontal-scroll', imports: [], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"scroll-container\"\r\n (mousedown)=\"onMouseDown($event)\"\r\n (mouseleave)=\"onMouseLeave()\"\r\n (mouseup)=\"onMouseUp()\"\r\n (mousemove)=\"onMouseMove($event)\"\r\n (touchstart)=\"onTouchStart($event)\"\r\n (touchend)=\"onTouchEnd()\"\r\n (touchmove)=\"onTouchMove($event)\">\r\n <div class=\"scroll-content\">\r\n <ng-content></ng-content>\r\n </div>\r\n</div>\r\n", styles: [".scroll-container{width:100%;overflow-x:auto;cursor:grab;-ms-overflow-style:none;scrollbar-width:none}.scroll-container:active{cursor:grabbing}.scroll-container::-webkit-scrollbar{display:none}.scroll-content{display:inline-flex;-webkit-user-select:none;user-select:none;gap:4px}\n"] }]
|
|
3533
|
+
args: [{ selector: 'dd-lib-horizontal-scroll', imports: [], standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"scroll-container\"\r\n (mousedown)=\"onMouseDown($event)\"\r\n (mouseleave)=\"onMouseLeave()\"\r\n (mouseup)=\"onMouseUp()\"\r\n (mousemove)=\"onMouseMove($event)\"\r\n (wheel)=\"onWheel($event)\"\r\n (touchstart)=\"onTouchStart($event)\"\r\n (touchend)=\"onTouchEnd()\"\r\n (touchmove)=\"onTouchMove($event)\">\r\n <div class=\"scroll-content\">\r\n <ng-content></ng-content>\r\n </div>\r\n</div>\r\n", styles: [".scroll-container{width:100%;overflow-x:auto;cursor:grab;-ms-overflow-style:none;scrollbar-width:none}.scroll-container:active{cursor:grabbing}.scroll-container::-webkit-scrollbar{display:none}.scroll-content{display:inline-flex;-webkit-user-select:none;user-select:none;gap:4px}\n"] }]
|
|
3437
3534
|
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }] });
|
|
3438
3535
|
|
|
3439
3536
|
class LibSelectComponent extends LibCommonInputTextComponent {
|
|
@@ -3457,6 +3554,7 @@ class LibSelectComponent extends LibCommonInputTextComponent {
|
|
|
3457
3554
|
this.tooltipPosition = 'top';
|
|
3458
3555
|
this.highlight = true;
|
|
3459
3556
|
this.searchOn = true;
|
|
3557
|
+
this.canSortByChecked = true;
|
|
3460
3558
|
this.itemSize = 40;
|
|
3461
3559
|
this.keyTitle = '';
|
|
3462
3560
|
this.keyDesc = '';
|
|
@@ -3586,6 +3684,22 @@ class LibSelectComponent extends LibCommonInputTextComponent {
|
|
|
3586
3684
|
else {
|
|
3587
3685
|
this.isShownList = false;
|
|
3588
3686
|
}
|
|
3687
|
+
if (this.isShownList && this.canSortByChecked) {
|
|
3688
|
+
this._data.update(data => {
|
|
3689
|
+
if (!data) {
|
|
3690
|
+
return data;
|
|
3691
|
+
}
|
|
3692
|
+
return data.sort((a, b) => {
|
|
3693
|
+
const aSelected = this.checkSelected(a);
|
|
3694
|
+
const bSelected = this.checkSelected(b);
|
|
3695
|
+
if (aSelected && !bSelected)
|
|
3696
|
+
return -1;
|
|
3697
|
+
if (!aSelected && bSelected)
|
|
3698
|
+
return 1;
|
|
3699
|
+
return 0;
|
|
3700
|
+
});
|
|
3701
|
+
});
|
|
3702
|
+
}
|
|
3589
3703
|
super.notifyFocusEvent();
|
|
3590
3704
|
}
|
|
3591
3705
|
writeValue(value) {
|
|
@@ -3750,6 +3864,9 @@ class LibSelectComponent extends LibCommonInputTextComponent {
|
|
|
3750
3864
|
this.multiCountValue = undefined;
|
|
3751
3865
|
}
|
|
3752
3866
|
}
|
|
3867
|
+
sortByChecked(item) {
|
|
3868
|
+
return this.canSortByChecked ? this.checkSelected(item) : false;
|
|
3869
|
+
}
|
|
3753
3870
|
checkSelected(item) {
|
|
3754
3871
|
if (this.multi) {
|
|
3755
3872
|
if (this.keyValue) {
|
|
@@ -3784,39 +3901,23 @@ class LibSelectComponent extends LibCommonInputTextComponent {
|
|
|
3784
3901
|
// this.showMultiCountValue = false;
|
|
3785
3902
|
}
|
|
3786
3903
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: LibSelectComponent, deps: [{ token: i0.DestroyRef }, { token: i0.ChangeDetectorRef }, { token: i1$4.ControlContainer, host: true, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3787
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: LibSelectComponent, isStandalone: true, selector: "dd-lib-select", inputs: { data: "data", virtualScroll: "virtualScroll", multi: "multi", tooltipPosition: "tooltipPosition", highlight: "highlight", searchOn: "searchOn", selectId: "selectId", itemSize: "itemSize", keyTitle: "keyTitle", keyDesc: "keyDesc", keyValue: "keyValue", noDataError: "noDataError", searchPlaceholder: "searchPlaceholder", placeholder: "placeholder", keyGroupTitle: "keyGroupTitle", keyGroupChildren: "keyGroupChildren", selectAllInGroup: "selectAllInGroup" }, outputs: { selectedItem: "selectedItem", selectedItems: "selectedItems", deleteMultiItem: "deleteMultiItem" }, providers: [
|
|
3904
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: LibSelectComponent, isStandalone: true, selector: "dd-lib-select", inputs: { data: "data", virtualScroll: "virtualScroll", multi: "multi", tooltipPosition: "tooltipPosition", highlight: "highlight", searchOn: "searchOn", selectId: "selectId", canSortByChecked: "canSortByChecked", itemSize: "itemSize", keyTitle: "keyTitle", keyDesc: "keyDesc", keyValue: "keyValue", noDataError: "noDataError", searchPlaceholder: "searchPlaceholder", placeholder: "placeholder", keyGroupTitle: "keyGroupTitle", keyGroupChildren: "keyGroupChildren", selectAllInGroup: "selectAllInGroup" }, outputs: { selectedItem: "selectedItem", selectedItems: "selectedItems", deleteMultiItem: "deleteMultiItem" }, providers: [
|
|
3788
3905
|
{
|
|
3789
3906
|
provide: NG_VALUE_ACCESSOR,
|
|
3790
3907
|
useExisting: forwardRef(() => LibSelectComponent),
|
|
3791
3908
|
multi: true,
|
|
3792
3909
|
},
|
|
3793
|
-
], viewQueries: [{ propertyName: "selectEl", first: true, predicate: ["select"], descendants: true, read: ElementRef, static: true }, { propertyName: "searchInputEl", first: true, predicate: ["searchInputEl"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"lib-select\" id=\"lib-select-{{ selectId }}\" [destroyedItem]=\"isShownList\" ddFixedPosition>\n @if (label) {\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\n <div class=\"pos-relative\" data-child=\"input\">\n <input\n #select\n (change)=\"handleChange()\"\n (click)=\"notifyFocusEvent()\"\n (input)=\"handleInput($event)\"\n (blur)=\"handleBlur()\"\n (focus)=\"handleFocus()\"\n [attr.id]=\"selectId\"\n [attr.placeholder]=\"(multiCountValue || searchValue) ? '' : placeholder\"\n [attr.tabIndex]=\"tabIndex\"\n [attr.type]=\"'text'\"\n [class.focused]=\"focused\"\n [class.invalid]=\"showError\"\n [disabled]=\"disabled\"\n [readOnly]=\"true\"\n [(ngModel)]=\"inputValue\"\n [title]=\"inputValue || ''\"\n class=\"text-select select-block\" />\n\n @if (multiCountValue) {\n <div class=\"selected-items-container\" id=\"selected-{{selectId}}\">\n <dd-lib-horizontal-scroll>\n @for (item of checkedItems; track item) {\n <div class=\"selected-items__item\">\n @if (stringArray()) {\n <div [innerHTML]=\"item | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n class=\"selected-items__item-title\"></div>\n }\n @if (keyTitle && !stringArray()) {\n <div\n [innerHTML]=\"item[keyTitle!] | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n class=\"selected-items__item-title\"></div>\n }\n @if (keyDesc && !stringArray()) {\n <div\n [innerHTML]=\"item[keyDesc!] | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n [title]=\"item[keyDesc]\"\n class=\"selected-items__item-desc\"></div>\n }\n <dd-lib-svg-icon id=\"selected-clear-{{selectId}}\" icon=\"clear\" class=\"cup\"\n (click)=\"selectItem(item);deleteMultiItem.emit(item)\"></dd-lib-svg-icon>\n </div>\n }\n </dd-lib-horizontal-scroll>\n </div>\n }\n\n @if (!checkedItem) {\n <dd-lib-svg-icon\n (click)=\"notifyFocusEvent()\"\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 } @else if (clearable && !searchValue) {\n <dd-lib-svg-icon\n (click)=\"onClear(checkedItem)\"\n class=\"clear\"\n id=\"chevron-{{ selectId }}\" icon=\"clear\"></dd-lib-svg-icon>\n }\n </div>\n\n @if (errorTexts.length && showError) {\n @for (error of errorTexts; track error) {\n <div class=\"lib-select__error\">{{ error }}</div>\n }\n }\n @if (errorText && showSelfError && showError) {\n <div class=\"lib-select__error\">{{ errorText }}</div>\n }\n\n @if (isShownList) {\n <div\n id=\"dropdown\"\n [style.max-height]=\"searchOn ? '342px' : '300px'\"\n data-child=\"list\"\n (ddClickOutside)=\"notifyFocusEvent();fullBlur.emit($event)\"\n [elements]=\"['lib-select-' + selectId, 'chevron-' + selectId, 'selected-' + selectId, 'selected-clear-' + selectId]\"\n ddListKeyboardNavigation\n class=\"select-list-wrapper\">\n @if (initialized) {\n @if (!_data()?.length && noDataError) {\n <div class=\"info-container\">\n <div class=\"b2-title no-wrap-text\">\n {{ noDataError }}\n </div>\n </div>\n }\n\n @if (_data()?.length && _data()!.length > 5 && searchOn) {\n <div class=\"search-block\">\n <dd-lib-svg-icon class=\"search-icon\" id=\"chevron-{{ selectId }}\" icon=\"search\"></dd-lib-svg-icon>\n <input class=\"search-block__input\" #searchInputEl [attr.name]=\"name\"\n [readOnly]=\"readOnly\"\n (input)=\"searchInput()\"\n [placeholder]=\"searchPlaceholder\"\n (blur)=\"handleBlur()\"\n (focus)=\"handleFocus()\"\n [(ngModel)]=\"searchValue\" type=\"text\">\n <dd-lib-svg-icon\n [style.display]=\"searchValue ? 'block' : 'none'\"\n class=\"cup\"\n (click)=\"searchValue=''\"\n id=\"chevron-{{ selectId }}\" icon=\"clear\"></dd-lib-svg-icon>\n </div>\n }\n\n @if (_data()?.length && (_data() | filterByKey: filterList.bind(this))?.length === 0) {\n <div class=\"info-container\">\n <div class=\"b2-title no-wrap-text\">\n \u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u043E\u0432 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E\n </div>\n </div>\n }\n\n @if (virtualScroll) {\n <cdk-virtual-scroll-viewport [itemSize]=\"itemSize\" [style.height]=\"(_data()?.length || 0) * itemSize + 'px'\">\n <div *cdkVirtualFor=\"let item of _data() | filterByKey: filterList.bind(this)\">\n <ng-container [ngTemplateOutlet]=\"itemsList\" [ngTemplateOutletContext]=\"{items: [item]}\"></ng-container>\n </div>\n </cdk-virtual-scroll-viewport>\n } @else {\n <ng-container [ngTemplateOutlet]=\"itemsList\" [ngTemplateOutletContext]=\"{items: _data() | filterByKey: filterList.bind(this)}\"></ng-container>\n }\n } @else {\n <div class=\"info-container\">\n <div class=\"d-flex gap-12 align-center\">\n <div class=\"b2-title no-wrap-text\">\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0434\u0430\u043D\u043D\u044B\u0445</div>\n <dd-lib-loader></dd-lib-loader>\n </div>\n </div>\n }\n </div>\n }\n</div>\n\n<ng-template #rowItem let-item=\"item\">\n <div ddSelectableItem [ddTooltip]=\"item.tooltip ? item.tooltip : ''\" [position]=\"tooltipPosition\"\n (click)=\"selectItem(item)\"\n (itemSelected)=\"selectItem(item)\"\n [class.s-item-active]=\"checkSelected(item) && !item.disabled\"\n [class.s-item-disabled]=\"item.disabled\"\n class=\"select-data\">\n @if (stringArray()) {\n <div [innerHTML]=\"item | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n class=\"select-data__title\"></div>\n }\n @if (keyTitle && !stringArray()) {\n <div\n [innerHTML]=\"item[keyTitle!] | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n class=\"select-data__title\"></div>\n }\n @if (keyDesc && !stringArray()) {\n <div\n [innerHTML]=\"item[keyDesc!] | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n [title]=\"item[keyDesc]\"\n class=\"select-data__desc\"></div>\n }\n @if (checkSelected(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</ng-template>\n\n<ng-template #itemsList let-items=\"items\">\n @for (item of items | filterByKey: filterList.bind(this); track item) {\n @if (isGroup(item)) {\n <div class=\"group-header\" [class.select-all-enabled]=\"selectAllInGroup\"\n (click)=\"selectAllInGroup ? handleGroupClick(item) : null\">\n <div class=\"group-title\">{{ getGroupTitle(item) }}</div>\n @if (isGroupSelected(item)) {\n <dd-lib-svg-icon\n [class.checked]=\"isGroupSelected(item)\"\n icon=\"check_green\"></dd-lib-svg-icon>\n }\n </div>\n <div class=\"group-items\">\n @for (child of item[keyGroupChildren] | filterByKey: filterList.bind(this); track child) {\n <ng-container [ngTemplateOutlet]=\"rowItem\" [ngTemplateOutletContext]=\"{item: child}\"></ng-container>\n }\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"rowItem\" [ngTemplateOutletContext]=\"{item}\"></ng-container>\n }\n }\n</ng-template>\n", styles: [".lib-select{position:relative}.lib-select .select-block{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 .select-block:hover{border-color:var(--input-active-border-colort)}.lib-select .select-block:hover~.selected-items-container .selected-items__item{background:var(--light-green-color);color:var(--font-light-black-color)}.lib-select .select-block:focus{border-color:var(--input-active-border-colort);box-shadow:var(--input-active-border-shadow)}.lib-select .select-block:focus~.selected-items-container .selected-items__item{background:var(--light-green-color);color:var(--font-light-black-color)}.lib-select .select-block:disabled{border:none;background-color:var(--input-disable-input);color:var(--input-disable-text);pointer-events:none}.lib-select .select-block:disabled::placeholder{color:var(--input-placeholder)}.lib-select .select-block:disabled~.selected-items-container .selected-items__item{background:var(--gray-blue-300);color:var(--second-gray-color)}.lib-select .select-block.invalid,.lib-select .select-block.invalid:hover{border-color:var(--input-error-border-color)}.lib-select .select-block.invalid:focus{border-color:var(--input-error-border-color);box-shadow:var(--input-error-border-shadow)}.lib-select .select-block:invalid~.selected-items-container .selected-items__item{background:var(--red-light-color);color:var(--font-light-black-color)}.lib-select .multi-count{position:absolute;top:10px;right:42px;white-space:nowrap}.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;color:var(--light-black-color)}.lib-select__error{color:var(--primary-red-color);font-size:12px;font-weight:400;line-height:10px;margin-top:2px;position:absolute}.lib-select .select-list-wrapper{position:absolute;display:block;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 cdk-virtual-scroll-viewport{max-height:300px}.lib-select .select-list-wrapper.top{bottom:50px;top:unset}.lib-select .select-list-wrapper .select-data{padding:12px 42px 12px 16px;cursor:pointer;position:relative;min-height:40px}.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.key-down-active,.lib-select .select-list-wrapper .select-data:hover,.lib-select .select-list-wrapper .select-data.s-item-active{background:var(--select-act-hov-bgc)}.lib-select .select-list-wrapper .select-data.s-item-active .checked{position:absolute;right:16px;top:10px}.lib-select .select-list-wrapper .select-data.s-item-disabled{cursor:auto;background:var(--disabled-bgc);color:var(--disabled-color)}.lib-select .select-list-wrapper .group-items{padding-left:16px}.lib-select .select-list-wrapper .group-items .select-data{margin-left:-16px;padding-left:32px}.lib-select .select-list-wrapper .select-no-data{padding:12px 42px 12px 16px;cursor:auto;position:relative;color:var(--disabled-color)}.lib-select .select-list-wrapper .info-container{padding:36px;display:flex;align-items:center;justify-content:center}.search-block{position:relative;padding:12px;z-index:1;display:flex;gap:4px;align-items:center;border-bottom:1px solid var(--gray-bgc)}.search-block__input{border:none;background:transparent;width:100%;padding-left:40px}.search-block .search-icon{position:absolute;left:20px;top:0;bottom:0}.data-loader{position:absolute;right:0;left:0;bottom:12px}.selected-items-container{overflow:hidden;border-radius:8px;top:0;bottom:0;position:absolute;max-width:calc(100% - 60px);left:6px;margin:8px;align-items:center}.selected-items-container .selected-items__item{background:var(--blue-card);color:var(--font-light-black-color);padding:4px;border-radius:8px;display:flex;gap:4px;align-items:center}.selected-items-container .selected-items__item:hover{background:var(--light-green-color);color:var(--font-light-black-color)}.selected-items-container .selected-items__item-title{white-space:nowrap}.group-header{height:48px;padding:8px 16px;font-weight:600;color:var(--font-light-black-color);border-bottom:1px solid var(--gray-bgc);display:flex;justify-content:space-between;align-items:center}.group-header.select-all-enabled{cursor:pointer}.group-header.select-all-enabled:hover{background-color:var(--gray-color-300)}.group-title{flex-grow:1}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.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$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.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", "size"] }, { kind: "pipe", type: FilterByKeyPipe, name: "filterByKey" }, { kind: "component", type: LibSvgIconComponent, selector: "dd-lib-svg-icon", inputs: ["width", "height", "color", "icon"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i2$2.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i2$2.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i2$2.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: TooltipDirective, selector: "[ddTooltip]", inputs: ["ddTooltip", "withClick", "position"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: ListKeyboardNavigationDirective, selector: "[ddListKeyboardNavigation]" }, { kind: "directive", type: SelectableItemDirective, selector: "[ddSelectableItem]", outputs: ["itemSelected"] }, { kind: "directive", type: FixedPositionDirective, selector: "[ddFixedPosition]", inputs: ["childName1", "childName2", "destroyedItem"] }, { kind: "component", type: LibHorizontalScrollComponent, selector: "dd-lib-horizontal-scroll" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3910
|
+
], viewQueries: [{ propertyName: "selectEl", first: true, predicate: ["select"], descendants: true, read: ElementRef, static: true }, { propertyName: "searchInputEl", first: true, predicate: ["searchInputEl"], descendants: true, read: ElementRef, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<div class=\"lib-select\" id=\"lib-select-{{ selectId }}\" [destroyedItem]=\"isShownList\" ddFixedPosition>\n @if (label) {\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\n <div class=\"pos-relative\" data-child=\"input\">\n <input\n #select\n (change)=\"handleChange()\"\n (click)=\"notifyFocusEvent()\"\n (input)=\"handleInput($event)\"\n (blur)=\"handleBlur()\"\n (focus)=\"handleFocus()\"\n [attr.id]=\"selectId\"\n [attr.placeholder]=\"(multiCountValue || searchValue) ? '' : placeholder\"\n [attr.tabIndex]=\"tabIndex\"\n [attr.type]=\"'text'\"\n [class.focused]=\"focused\"\n [class.invalid]=\"showError\"\n [disabled]=\"disabled\"\n [readOnly]=\"true\"\n [(ngModel)]=\"inputValue\"\n [title]=\"inputValue || ''\"\n class=\"text-select select-block\" />\n\n @if (multiCountValue) {\n <div class=\"selected-items-container\" id=\"selected-{{selectId}}\">\n <dd-lib-horizontal-scroll>\n @for (item of checkedItems; track item) {\n <div class=\"selected-items__item\" >\n @if (stringArray()) {\n <div [title]=\"item\" [innerHTML]=\"item | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n class=\"selected-items__item-title\"></div>\n }\n @if (keyTitle && !stringArray()) {\n <div [title]=\"item[keyTitle!]\"\n [innerHTML]=\"item[keyTitle!] | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n class=\"selected-items__item-title\"></div>\n }\n @if (keyDesc && !stringArray()) {\n <div\n [innerHTML]=\"item[keyDesc!] | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n [title]=\"item[keyDesc]\"\n class=\"selected-items__item-desc\"></div>\n }\n <dd-lib-svg-icon id=\"selected-clear-{{selectId}}\" icon=\"clear\" class=\"cup\"\n (click)=\"selectItem(item);deleteMultiItem.emit(item)\"></dd-lib-svg-icon>\n </div>\n }\n </dd-lib-horizontal-scroll>\n </div>\n }\n\n @if (!checkedItem) {\n <dd-lib-svg-icon\n (click)=\"notifyFocusEvent()\"\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 } @else if (clearable && !searchValue) {\n <dd-lib-svg-icon\n (click)=\"onClear(checkedItem)\"\n class=\"clear\"\n id=\"chevron-{{ selectId }}\" icon=\"clear\"></dd-lib-svg-icon>\n }\n </div>\n\n @if (errorTexts.length && showError) {\n @for (error of errorTexts; track error) {\n <div class=\"lib-select__error\">{{ error }}</div>\n }\n }\n @if (errorText && showSelfError && showError) {\n <div class=\"lib-select__error\">{{ errorText }}</div>\n }\n\n @if (isShownList) {\n <div\n id=\"dropdown\"\n [style.max-height]=\"searchOn ? '342px' : '300px'\"\n data-child=\"list\"\n (ddClickOutside)=\"notifyFocusEvent();fullBlur.emit($event)\"\n [elements]=\"['lib-select-' + selectId, 'chevron-' + selectId, 'selected-' + selectId, 'selected-clear-' + selectId]\"\n ddListKeyboardNavigation\n class=\"select-list-wrapper\">\n @if (initialized) {\n @if (!_data()?.length && noDataError) {\n <div class=\"info-container\">\n <div class=\"b2-title no-wrap-text\">\n {{ noDataError }}\n </div>\n </div>\n }\n\n @if (_data()?.length && _data()!.length > 5 && searchOn) {\n <div class=\"search-block\">\n <dd-lib-svg-icon class=\"search-icon\" id=\"chevron-{{ selectId }}\" icon=\"search\"></dd-lib-svg-icon>\n <input class=\"search-block__input\" #searchInputEl [attr.name]=\"name\"\n [readOnly]=\"readOnly\"\n (input)=\"searchInput()\"\n [placeholder]=\"searchPlaceholder\"\n (blur)=\"handleBlur()\"\n (focus)=\"handleFocus()\"\n [(ngModel)]=\"searchValue\" type=\"text\">\n <dd-lib-svg-icon\n [style.display]=\"searchValue ? 'block' : 'none'\"\n class=\"cup\"\n (click)=\"searchValue=''\"\n id=\"chevron-{{ selectId }}\" icon=\"clear\"></dd-lib-svg-icon>\n </div>\n }\n\n @if (_data()?.length && (_data() | filterByKey: filterList.bind(this))?.length === 0) {\n <div class=\"info-container\">\n <div class=\"b2-title no-wrap-text\">\n \u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u043E\u0432 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E\n </div>\n </div>\n }\n\n @if (virtualScroll) {\n <cdk-virtual-scroll-viewport [itemSize]=\"itemSize\" [style.height]=\"(_data()?.length || 0) * itemSize + 'px'\">\n <div *cdkVirtualFor=\"let item of _data() | filterByKey: filterList.bind(this)\">\n <ng-container [ngTemplateOutlet]=\"itemsList\" [ngTemplateOutletContext]=\"{items: [item]}\"></ng-container>\n </div>\n </cdk-virtual-scroll-viewport>\n } @else {\n <ng-container [ngTemplateOutlet]=\"itemsList\" [ngTemplateOutletContext]=\"{items: _data() | filterByKey: filterList.bind(this)}\"></ng-container>\n }\n } @else {\n <div class=\"info-container\">\n <div class=\"d-flex gap-12 align-center\">\n <div class=\"b2-title no-wrap-text\">\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0434\u0430\u043D\u043D\u044B\u0445</div>\n <dd-lib-loader></dd-lib-loader>\n </div>\n </div>\n }\n </div>\n }\n</div>\n\n<ng-template #rowItem let-item=\"item\">\n <div ddSelectableItem [ddTooltip]=\"item.tooltip ? item.tooltip : ''\" [position]=\"tooltipPosition\"\n (click)=\"selectItem(item)\"\n (itemSelected)=\"selectItem(item)\"\n [class.s-item-active]=\"checkSelected(item) && !item.disabled\"\n [class.s-item-disabled]=\"item.disabled\"\n class=\"select-data\">\n @if (stringArray()) {\n <div [innerHTML]=\"item | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n class=\"select-data__title\"></div>\n }\n @if (keyTitle && !stringArray()) {\n <div\n [innerHTML]=\"item[keyTitle!] | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n class=\"select-data__title\"></div>\n }\n @if (keyDesc && !stringArray()) {\n <div\n [innerHTML]=\"item[keyDesc!] | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n [title]=\"item[keyDesc]\"\n class=\"select-data__desc\"></div>\n }\n @if (checkSelected(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</ng-template>\n\n<ng-template #itemsList let-items=\"items\">\n @for (item of items | filterByKey: filterList.bind(this); track item) {\n @if (isGroup(item)) {\n <div class=\"group-header\" [class.select-all-enabled]=\"selectAllInGroup\"\n (click)=\"selectAllInGroup ? handleGroupClick(item) : null\">\n <div class=\"group-title\">{{ getGroupTitle(item) }}</div>\n @if (isGroupSelected(item)) {\n <dd-lib-svg-icon\n [class.checked]=\"isGroupSelected(item)\"\n icon=\"check_green\"></dd-lib-svg-icon>\n }\n </div>\n <div class=\"group-items\">\n @for (child of item[keyGroupChildren] | filterByKey: filterList.bind(this); track child) {\n <ng-container [ngTemplateOutlet]=\"rowItem\" [ngTemplateOutletContext]=\"{item: child}\"></ng-container>\n }\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"rowItem\" [ngTemplateOutletContext]=\"{item}\"></ng-container>\n }\n }\n</ng-template>\n", styles: [".lib-select{position:relative}.lib-select .select-block{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 .select-block:hover{border-color:var(--input-active-border-colort)}.lib-select .select-block:hover~.selected-items-container .selected-items__item{background:var(--light-green-color);color:var(--font-light-black-color)}.lib-select .select-block:focus{border-color:var(--input-active-border-colort);box-shadow:var(--input-active-border-shadow)}.lib-select .select-block:focus~.selected-items-container .selected-items__item{background:var(--light-green-color);color:var(--font-light-black-color)}.lib-select .select-block:disabled{border:none;background-color:var(--input-disable-input);color:var(--input-disable-text);pointer-events:none}.lib-select .select-block:disabled::placeholder{color:var(--input-placeholder)}.lib-select .select-block:disabled~.selected-items-container .selected-items__item{background:var(--gray-blue-300);color:var(--second-gray-color)}.lib-select .select-block.invalid,.lib-select .select-block.invalid:hover{border-color:var(--input-error-border-color)}.lib-select .select-block.invalid:focus{border-color:var(--input-error-border-color);box-shadow:var(--input-error-border-shadow)}.lib-select .select-block:invalid~.selected-items-container .selected-items__item{background:var(--red-light-color);color:var(--font-light-black-color)}.lib-select .multi-count{position:absolute;top:10px;right:42px;white-space:nowrap}.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;color:var(--light-black-color)}.lib-select__error{color:var(--primary-red-color);font-size:12px;font-weight:400;line-height:10px;margin-top:2px;position:absolute}.lib-select .select-list-wrapper{position:absolute;display:block;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 cdk-virtual-scroll-viewport{max-height:300px}.lib-select .select-list-wrapper.top{bottom:50px;top:unset}.lib-select .select-list-wrapper .select-data{padding:12px 42px 12px 16px;cursor:pointer;position:relative;min-height:40px}.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.key-down-active,.lib-select .select-list-wrapper .select-data:hover,.lib-select .select-list-wrapper .select-data.s-item-active{background:var(--select-act-hov-bgc)}.lib-select .select-list-wrapper .select-data.s-item-active .checked{position:absolute;right:16px;top:10px}.lib-select .select-list-wrapper .select-data.s-item-disabled{cursor:auto;background:var(--disabled-bgc);color:var(--disabled-color)}.lib-select .select-list-wrapper .group-items{padding-left:16px}.lib-select .select-list-wrapper .group-items .select-data{margin-left:-16px;padding-left:32px}.lib-select .select-list-wrapper .select-no-data{padding:12px 42px 12px 16px;cursor:auto;position:relative;color:var(--disabled-color)}.lib-select .select-list-wrapper .info-container{padding:36px;display:flex;align-items:center;justify-content:center}.search-block{position:relative;padding:12px;z-index:1;display:flex;gap:4px;align-items:center;border-bottom:1px solid var(--gray-bgc)}.search-block__input{border:none;background:transparent;width:100%;padding-left:40px}.search-block .search-icon{position:absolute;left:20px;top:0;bottom:0}.data-loader{position:absolute;right:0;left:0;bottom:12px}.selected-items-container{overflow:hidden;border-radius:8px;top:0;bottom:0;position:absolute;max-width:calc(100% - 60px);left:6px;margin:8px;align-items:center}.selected-items-container .selected-items__item{background:var(--blue-card);color:var(--font-light-black-color);padding:4px;border-radius:8px;display:flex;gap:4px;align-items:center;max-width:170px;overflow:hidden}.selected-items-container .selected-items__item:hover{background:var(--light-green-color);color:var(--font-light-black-color)}.selected-items-container .selected-items__item-title{overflow:hidden;white-space:nowrap;max-width:150px;text-overflow:ellipsis}.group-header{height:48px;padding:8px 16px;font-weight:600;color:var(--font-light-black-color);border-bottom:1px solid var(--gray-bgc);display:flex;justify-content:space-between;align-items:center}.group-header.select-all-enabled{cursor:pointer}.group-header.select-all-enabled:hover{background-color:var(--gray-color-300)}.group-title{flex-grow:1}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$4.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$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.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", "size"] }, { kind: "pipe", type: FilterByKeyPipe, name: "filterByKey" }, { kind: "component", type: LibSvgIconComponent, selector: "dd-lib-svg-icon", inputs: ["width", "height", "color", "icon"] }, { kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i2$2.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i2$2.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i2$2.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: TooltipDirective, selector: "[ddTooltip]", inputs: ["ddTooltip", "withClick", "position"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: ListKeyboardNavigationDirective, selector: "[ddListKeyboardNavigation]" }, { kind: "directive", type: SelectableItemDirective, selector: "[ddSelectableItem]", outputs: ["itemSelected"] }, { kind: "directive", type: FixedPositionDirective, selector: "[ddFixedPosition]", inputs: ["childName1", "childName2", "destroyedItem"] }, { kind: "component", type: LibHorizontalScrollComponent, selector: "dd-lib-horizontal-scroll" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
3794
3911
|
}
|
|
3795
3912
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: LibSelectComponent, decorators: [{
|
|
3796
3913
|
type: Component,
|
|
3797
|
-
args: [{ selector: 'dd-lib-select', standalone: true, imports: [
|
|
3798
|
-
ReactiveFormsModule,
|
|
3799
|
-
FormsModule,
|
|
3800
|
-
HighlightPipe,
|
|
3801
|
-
SafePipe,
|
|
3802
|
-
ClickOutsideDirective,
|
|
3803
|
-
LibLoaderComponent,
|
|
3804
|
-
FilterByKeyPipe,
|
|
3805
|
-
LibSvgIconComponent,
|
|
3806
|
-
ScrollingModule,
|
|
3807
|
-
TooltipDirective,
|
|
3808
|
-
NgTemplateOutlet,
|
|
3809
|
-
ListKeyboardNavigationDirective,
|
|
3810
|
-
SelectableItemDirective,
|
|
3811
|
-
FixedPositionDirective,
|
|
3812
|
-
LibHorizontalScrollComponent
|
|
3813
|
-
], providers: [
|
|
3914
|
+
args: [{ selector: 'dd-lib-select', standalone: true, imports: [ReactiveFormsModule, FormsModule, HighlightPipe, SafePipe, ClickOutsideDirective, LibLoaderComponent, FilterByKeyPipe, LibSvgIconComponent, ScrollingModule, TooltipDirective, NgTemplateOutlet, ListKeyboardNavigationDirective, SelectableItemDirective, FixedPositionDirective, LibHorizontalScrollComponent, JsonPipe, SortByValPipe], providers: [
|
|
3814
3915
|
{
|
|
3815
3916
|
provide: NG_VALUE_ACCESSOR,
|
|
3816
3917
|
useExisting: forwardRef(() => LibSelectComponent),
|
|
3817
3918
|
multi: true,
|
|
3818
3919
|
},
|
|
3819
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"lib-select\" id=\"lib-select-{{ selectId }}\" [destroyedItem]=\"isShownList\" ddFixedPosition>\n @if (label) {\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\n <div class=\"pos-relative\" data-child=\"input\">\n <input\n #select\n (change)=\"handleChange()\"\n (click)=\"notifyFocusEvent()\"\n (input)=\"handleInput($event)\"\n (blur)=\"handleBlur()\"\n (focus)=\"handleFocus()\"\n [attr.id]=\"selectId\"\n [attr.placeholder]=\"(multiCountValue || searchValue) ? '' : placeholder\"\n [attr.tabIndex]=\"tabIndex\"\n [attr.type]=\"'text'\"\n [class.focused]=\"focused\"\n [class.invalid]=\"showError\"\n [disabled]=\"disabled\"\n [readOnly]=\"true\"\n [(ngModel)]=\"inputValue\"\n [title]=\"inputValue || ''\"\n class=\"text-select select-block\" />\n\n @if (multiCountValue) {\n <div class=\"selected-items-container\" id=\"selected-{{selectId}}\">\n <dd-lib-horizontal-scroll>\n @for (item of checkedItems; track item) {\n <div class=\"selected-items__item\">\n @if (stringArray()) {\n <div [innerHTML]=\"item | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n class=\"selected-items__item-title\"></div>\n }\n @if (keyTitle && !stringArray()) {\n <div\n [innerHTML]=\"item[keyTitle!] | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n class=\"selected-items__item-title\"></div>\n }\n @if (keyDesc && !stringArray()) {\n <div\n [innerHTML]=\"item[keyDesc!] | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n [title]=\"item[keyDesc]\"\n class=\"selected-items__item-desc\"></div>\n }\n <dd-lib-svg-icon id=\"selected-clear-{{selectId}}\" icon=\"clear\" class=\"cup\"\n (click)=\"selectItem(item);deleteMultiItem.emit(item)\"></dd-lib-svg-icon>\n </div>\n }\n </dd-lib-horizontal-scroll>\n </div>\n }\n\n @if (!checkedItem) {\n <dd-lib-svg-icon\n (click)=\"notifyFocusEvent()\"\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 } @else if (clearable && !searchValue) {\n <dd-lib-svg-icon\n (click)=\"onClear(checkedItem)\"\n class=\"clear\"\n id=\"chevron-{{ selectId }}\" icon=\"clear\"></dd-lib-svg-icon>\n }\n </div>\n\n @if (errorTexts.length && showError) {\n @for (error of errorTexts; track error) {\n <div class=\"lib-select__error\">{{ error }}</div>\n }\n }\n @if (errorText && showSelfError && showError) {\n <div class=\"lib-select__error\">{{ errorText }}</div>\n }\n\n @if (isShownList) {\n <div\n id=\"dropdown\"\n [style.max-height]=\"searchOn ? '342px' : '300px'\"\n data-child=\"list\"\n (ddClickOutside)=\"notifyFocusEvent();fullBlur.emit($event)\"\n [elements]=\"['lib-select-' + selectId, 'chevron-' + selectId, 'selected-' + selectId, 'selected-clear-' + selectId]\"\n ddListKeyboardNavigation\n class=\"select-list-wrapper\">\n @if (initialized) {\n @if (!_data()?.length && noDataError) {\n <div class=\"info-container\">\n <div class=\"b2-title no-wrap-text\">\n {{ noDataError }}\n </div>\n </div>\n }\n\n @if (_data()?.length && _data()!.length > 5 && searchOn) {\n <div class=\"search-block\">\n <dd-lib-svg-icon class=\"search-icon\" id=\"chevron-{{ selectId }}\" icon=\"search\"></dd-lib-svg-icon>\n <input class=\"search-block__input\" #searchInputEl [attr.name]=\"name\"\n [readOnly]=\"readOnly\"\n (input)=\"searchInput()\"\n [placeholder]=\"searchPlaceholder\"\n (blur)=\"handleBlur()\"\n (focus)=\"handleFocus()\"\n [(ngModel)]=\"searchValue\" type=\"text\">\n <dd-lib-svg-icon\n [style.display]=\"searchValue ? 'block' : 'none'\"\n class=\"cup\"\n (click)=\"searchValue=''\"\n id=\"chevron-{{ selectId }}\" icon=\"clear\"></dd-lib-svg-icon>\n </div>\n }\n\n @if (_data()?.length && (_data() | filterByKey: filterList.bind(this))?.length === 0) {\n <div class=\"info-container\">\n <div class=\"b2-title no-wrap-text\">\n \u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u043E\u0432 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E\n </div>\n </div>\n }\n\n @if (virtualScroll) {\n <cdk-virtual-scroll-viewport [itemSize]=\"itemSize\" [style.height]=\"(_data()?.length || 0) * itemSize + 'px'\">\n <div *cdkVirtualFor=\"let item of _data() | filterByKey: filterList.bind(this)\">\n <ng-container [ngTemplateOutlet]=\"itemsList\" [ngTemplateOutletContext]=\"{items: [item]}\"></ng-container>\n </div>\n </cdk-virtual-scroll-viewport>\n } @else {\n <ng-container [ngTemplateOutlet]=\"itemsList\" [ngTemplateOutletContext]=\"{items: _data() | filterByKey: filterList.bind(this)}\"></ng-container>\n }\n } @else {\n <div class=\"info-container\">\n <div class=\"d-flex gap-12 align-center\">\n <div class=\"b2-title no-wrap-text\">\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0434\u0430\u043D\u043D\u044B\u0445</div>\n <dd-lib-loader></dd-lib-loader>\n </div>\n </div>\n }\n </div>\n }\n</div>\n\n<ng-template #rowItem let-item=\"item\">\n <div ddSelectableItem [ddTooltip]=\"item.tooltip ? item.tooltip : ''\" [position]=\"tooltipPosition\"\n (click)=\"selectItem(item)\"\n (itemSelected)=\"selectItem(item)\"\n [class.s-item-active]=\"checkSelected(item) && !item.disabled\"\n [class.s-item-disabled]=\"item.disabled\"\n class=\"select-data\">\n @if (stringArray()) {\n <div [innerHTML]=\"item | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n class=\"select-data__title\"></div>\n }\n @if (keyTitle && !stringArray()) {\n <div\n [innerHTML]=\"item[keyTitle!] | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n class=\"select-data__title\"></div>\n }\n @if (keyDesc && !stringArray()) {\n <div\n [innerHTML]=\"item[keyDesc!] | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n [title]=\"item[keyDesc]\"\n class=\"select-data__desc\"></div>\n }\n @if (checkSelected(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</ng-template>\n\n<ng-template #itemsList let-items=\"items\">\n @for (item of items | filterByKey: filterList.bind(this); track item) {\n @if (isGroup(item)) {\n <div class=\"group-header\" [class.select-all-enabled]=\"selectAllInGroup\"\n (click)=\"selectAllInGroup ? handleGroupClick(item) : null\">\n <div class=\"group-title\">{{ getGroupTitle(item) }}</div>\n @if (isGroupSelected(item)) {\n <dd-lib-svg-icon\n [class.checked]=\"isGroupSelected(item)\"\n icon=\"check_green\"></dd-lib-svg-icon>\n }\n </div>\n <div class=\"group-items\">\n @for (child of item[keyGroupChildren] | filterByKey: filterList.bind(this); track child) {\n <ng-container [ngTemplateOutlet]=\"rowItem\" [ngTemplateOutletContext]=\"{item: child}\"></ng-container>\n }\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"rowItem\" [ngTemplateOutletContext]=\"{item}\"></ng-container>\n }\n }\n</ng-template>\n", styles: [".lib-select{position:relative}.lib-select .select-block{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 .select-block:hover{border-color:var(--input-active-border-colort)}.lib-select .select-block:hover~.selected-items-container .selected-items__item{background:var(--light-green-color);color:var(--font-light-black-color)}.lib-select .select-block:focus{border-color:var(--input-active-border-colort);box-shadow:var(--input-active-border-shadow)}.lib-select .select-block:focus~.selected-items-container .selected-items__item{background:var(--light-green-color);color:var(--font-light-black-color)}.lib-select .select-block:disabled{border:none;background-color:var(--input-disable-input);color:var(--input-disable-text);pointer-events:none}.lib-select .select-block:disabled::placeholder{color:var(--input-placeholder)}.lib-select .select-block:disabled~.selected-items-container .selected-items__item{background:var(--gray-blue-300);color:var(--second-gray-color)}.lib-select .select-block.invalid,.lib-select .select-block.invalid:hover{border-color:var(--input-error-border-color)}.lib-select .select-block.invalid:focus{border-color:var(--input-error-border-color);box-shadow:var(--input-error-border-shadow)}.lib-select .select-block:invalid~.selected-items-container .selected-items__item{background:var(--red-light-color);color:var(--font-light-black-color)}.lib-select .multi-count{position:absolute;top:10px;right:42px;white-space:nowrap}.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;color:var(--light-black-color)}.lib-select__error{color:var(--primary-red-color);font-size:12px;font-weight:400;line-height:10px;margin-top:2px;position:absolute}.lib-select .select-list-wrapper{position:absolute;display:block;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 cdk-virtual-scroll-viewport{max-height:300px}.lib-select .select-list-wrapper.top{bottom:50px;top:unset}.lib-select .select-list-wrapper .select-data{padding:12px 42px 12px 16px;cursor:pointer;position:relative;min-height:40px}.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.key-down-active,.lib-select .select-list-wrapper .select-data:hover,.lib-select .select-list-wrapper .select-data.s-item-active{background:var(--select-act-hov-bgc)}.lib-select .select-list-wrapper .select-data.s-item-active .checked{position:absolute;right:16px;top:10px}.lib-select .select-list-wrapper .select-data.s-item-disabled{cursor:auto;background:var(--disabled-bgc);color:var(--disabled-color)}.lib-select .select-list-wrapper .group-items{padding-left:16px}.lib-select .select-list-wrapper .group-items .select-data{margin-left:-16px;padding-left:32px}.lib-select .select-list-wrapper .select-no-data{padding:12px 42px 12px 16px;cursor:auto;position:relative;color:var(--disabled-color)}.lib-select .select-list-wrapper .info-container{padding:36px;display:flex;align-items:center;justify-content:center}.search-block{position:relative;padding:12px;z-index:1;display:flex;gap:4px;align-items:center;border-bottom:1px solid var(--gray-bgc)}.search-block__input{border:none;background:transparent;width:100%;padding-left:40px}.search-block .search-icon{position:absolute;left:20px;top:0;bottom:0}.data-loader{position:absolute;right:0;left:0;bottom:12px}.selected-items-container{overflow:hidden;border-radius:8px;top:0;bottom:0;position:absolute;max-width:calc(100% - 60px);left:6px;margin:8px;align-items:center}.selected-items-container .selected-items__item{background:var(--blue-card);color:var(--font-light-black-color);padding:4px;border-radius:8px;display:flex;gap:4px;align-items:center}.selected-items-container .selected-items__item:hover{background:var(--light-green-color);color:var(--font-light-black-color)}.selected-items-container .selected-items__item-title{white-space:nowrap}.group-header{height:48px;padding:8px 16px;font-weight:600;color:var(--font-light-black-color);border-bottom:1px solid var(--gray-bgc);display:flex;justify-content:space-between;align-items:center}.group-header.select-all-enabled{cursor:pointer}.group-header.select-all-enabled:hover{background-color:var(--gray-color-300)}.group-title{flex-grow:1}\n"] }]
|
|
3920
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"lib-select\" id=\"lib-select-{{ selectId }}\" [destroyedItem]=\"isShownList\" ddFixedPosition>\n @if (label) {\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\n <div class=\"pos-relative\" data-child=\"input\">\n <input\n #select\n (change)=\"handleChange()\"\n (click)=\"notifyFocusEvent()\"\n (input)=\"handleInput($event)\"\n (blur)=\"handleBlur()\"\n (focus)=\"handleFocus()\"\n [attr.id]=\"selectId\"\n [attr.placeholder]=\"(multiCountValue || searchValue) ? '' : placeholder\"\n [attr.tabIndex]=\"tabIndex\"\n [attr.type]=\"'text'\"\n [class.focused]=\"focused\"\n [class.invalid]=\"showError\"\n [disabled]=\"disabled\"\n [readOnly]=\"true\"\n [(ngModel)]=\"inputValue\"\n [title]=\"inputValue || ''\"\n class=\"text-select select-block\" />\n\n @if (multiCountValue) {\n <div class=\"selected-items-container\" id=\"selected-{{selectId}}\">\n <dd-lib-horizontal-scroll>\n @for (item of checkedItems; track item) {\n <div class=\"selected-items__item\" >\n @if (stringArray()) {\n <div [title]=\"item\" [innerHTML]=\"item | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n class=\"selected-items__item-title\"></div>\n }\n @if (keyTitle && !stringArray()) {\n <div [title]=\"item[keyTitle!]\"\n [innerHTML]=\"item[keyTitle!] | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n class=\"selected-items__item-title\"></div>\n }\n @if (keyDesc && !stringArray()) {\n <div\n [innerHTML]=\"item[keyDesc!] | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n [title]=\"item[keyDesc]\"\n class=\"selected-items__item-desc\"></div>\n }\n <dd-lib-svg-icon id=\"selected-clear-{{selectId}}\" icon=\"clear\" class=\"cup\"\n (click)=\"selectItem(item);deleteMultiItem.emit(item)\"></dd-lib-svg-icon>\n </div>\n }\n </dd-lib-horizontal-scroll>\n </div>\n }\n\n @if (!checkedItem) {\n <dd-lib-svg-icon\n (click)=\"notifyFocusEvent()\"\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 } @else if (clearable && !searchValue) {\n <dd-lib-svg-icon\n (click)=\"onClear(checkedItem)\"\n class=\"clear\"\n id=\"chevron-{{ selectId }}\" icon=\"clear\"></dd-lib-svg-icon>\n }\n </div>\n\n @if (errorTexts.length && showError) {\n @for (error of errorTexts; track error) {\n <div class=\"lib-select__error\">{{ error }}</div>\n }\n }\n @if (errorText && showSelfError && showError) {\n <div class=\"lib-select__error\">{{ errorText }}</div>\n }\n\n @if (isShownList) {\n <div\n id=\"dropdown\"\n [style.max-height]=\"searchOn ? '342px' : '300px'\"\n data-child=\"list\"\n (ddClickOutside)=\"notifyFocusEvent();fullBlur.emit($event)\"\n [elements]=\"['lib-select-' + selectId, 'chevron-' + selectId, 'selected-' + selectId, 'selected-clear-' + selectId]\"\n ddListKeyboardNavigation\n class=\"select-list-wrapper\">\n @if (initialized) {\n @if (!_data()?.length && noDataError) {\n <div class=\"info-container\">\n <div class=\"b2-title no-wrap-text\">\n {{ noDataError }}\n </div>\n </div>\n }\n\n @if (_data()?.length && _data()!.length > 5 && searchOn) {\n <div class=\"search-block\">\n <dd-lib-svg-icon class=\"search-icon\" id=\"chevron-{{ selectId }}\" icon=\"search\"></dd-lib-svg-icon>\n <input class=\"search-block__input\" #searchInputEl [attr.name]=\"name\"\n [readOnly]=\"readOnly\"\n (input)=\"searchInput()\"\n [placeholder]=\"searchPlaceholder\"\n (blur)=\"handleBlur()\"\n (focus)=\"handleFocus()\"\n [(ngModel)]=\"searchValue\" type=\"text\">\n <dd-lib-svg-icon\n [style.display]=\"searchValue ? 'block' : 'none'\"\n class=\"cup\"\n (click)=\"searchValue=''\"\n id=\"chevron-{{ selectId }}\" icon=\"clear\"></dd-lib-svg-icon>\n </div>\n }\n\n @if (_data()?.length && (_data() | filterByKey: filterList.bind(this))?.length === 0) {\n <div class=\"info-container\">\n <div class=\"b2-title no-wrap-text\">\n \u0420\u0435\u0437\u0443\u043B\u044C\u0442\u0430\u0442\u043E\u0432 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E\n </div>\n </div>\n }\n\n @if (virtualScroll) {\n <cdk-virtual-scroll-viewport [itemSize]=\"itemSize\" [style.height]=\"(_data()?.length || 0) * itemSize + 'px'\">\n <div *cdkVirtualFor=\"let item of _data() | filterByKey: filterList.bind(this)\">\n <ng-container [ngTemplateOutlet]=\"itemsList\" [ngTemplateOutletContext]=\"{items: [item]}\"></ng-container>\n </div>\n </cdk-virtual-scroll-viewport>\n } @else {\n <ng-container [ngTemplateOutlet]=\"itemsList\" [ngTemplateOutletContext]=\"{items: _data() | filterByKey: filterList.bind(this)}\"></ng-container>\n }\n } @else {\n <div class=\"info-container\">\n <div class=\"d-flex gap-12 align-center\">\n <div class=\"b2-title no-wrap-text\">\u0417\u0430\u0433\u0440\u0443\u0437\u043A\u0430 \u0434\u0430\u043D\u043D\u044B\u0445</div>\n <dd-lib-loader></dd-lib-loader>\n </div>\n </div>\n }\n </div>\n }\n</div>\n\n<ng-template #rowItem let-item=\"item\">\n <div ddSelectableItem [ddTooltip]=\"item.tooltip ? item.tooltip : ''\" [position]=\"tooltipPosition\"\n (click)=\"selectItem(item)\"\n (itemSelected)=\"selectItem(item)\"\n [class.s-item-active]=\"checkSelected(item) && !item.disabled\"\n [class.s-item-disabled]=\"item.disabled\"\n class=\"select-data\">\n @if (stringArray()) {\n <div [innerHTML]=\"item | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n class=\"select-data__title\"></div>\n }\n @if (keyTitle && !stringArray()) {\n <div\n [innerHTML]=\"item[keyTitle!] | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n class=\"select-data__title\"></div>\n }\n @if (keyDesc && !stringArray()) {\n <div\n [innerHTML]=\"item[keyDesc!] | highlight: (highlight ? searchValue : '') | safe: 'html'\"\n [title]=\"item[keyDesc]\"\n class=\"select-data__desc\"></div>\n }\n @if (checkSelected(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</ng-template>\n\n<ng-template #itemsList let-items=\"items\">\n @for (item of items | filterByKey: filterList.bind(this); track item) {\n @if (isGroup(item)) {\n <div class=\"group-header\" [class.select-all-enabled]=\"selectAllInGroup\"\n (click)=\"selectAllInGroup ? handleGroupClick(item) : null\">\n <div class=\"group-title\">{{ getGroupTitle(item) }}</div>\n @if (isGroupSelected(item)) {\n <dd-lib-svg-icon\n [class.checked]=\"isGroupSelected(item)\"\n icon=\"check_green\"></dd-lib-svg-icon>\n }\n </div>\n <div class=\"group-items\">\n @for (child of item[keyGroupChildren] | filterByKey: filterList.bind(this); track child) {\n <ng-container [ngTemplateOutlet]=\"rowItem\" [ngTemplateOutletContext]=\"{item: child}\"></ng-container>\n }\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"rowItem\" [ngTemplateOutletContext]=\"{item}\"></ng-container>\n }\n }\n</ng-template>\n", styles: [".lib-select{position:relative}.lib-select .select-block{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 .select-block:hover{border-color:var(--input-active-border-colort)}.lib-select .select-block:hover~.selected-items-container .selected-items__item{background:var(--light-green-color);color:var(--font-light-black-color)}.lib-select .select-block:focus{border-color:var(--input-active-border-colort);box-shadow:var(--input-active-border-shadow)}.lib-select .select-block:focus~.selected-items-container .selected-items__item{background:var(--light-green-color);color:var(--font-light-black-color)}.lib-select .select-block:disabled{border:none;background-color:var(--input-disable-input);color:var(--input-disable-text);pointer-events:none}.lib-select .select-block:disabled::placeholder{color:var(--input-placeholder)}.lib-select .select-block:disabled~.selected-items-container .selected-items__item{background:var(--gray-blue-300);color:var(--second-gray-color)}.lib-select .select-block.invalid,.lib-select .select-block.invalid:hover{border-color:var(--input-error-border-color)}.lib-select .select-block.invalid:focus{border-color:var(--input-error-border-color);box-shadow:var(--input-error-border-shadow)}.lib-select .select-block:invalid~.selected-items-container .selected-items__item{background:var(--red-light-color);color:var(--font-light-black-color)}.lib-select .multi-count{position:absolute;top:10px;right:42px;white-space:nowrap}.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;color:var(--light-black-color)}.lib-select__error{color:var(--primary-red-color);font-size:12px;font-weight:400;line-height:10px;margin-top:2px;position:absolute}.lib-select .select-list-wrapper{position:absolute;display:block;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 cdk-virtual-scroll-viewport{max-height:300px}.lib-select .select-list-wrapper.top{bottom:50px;top:unset}.lib-select .select-list-wrapper .select-data{padding:12px 42px 12px 16px;cursor:pointer;position:relative;min-height:40px}.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.key-down-active,.lib-select .select-list-wrapper .select-data:hover,.lib-select .select-list-wrapper .select-data.s-item-active{background:var(--select-act-hov-bgc)}.lib-select .select-list-wrapper .select-data.s-item-active .checked{position:absolute;right:16px;top:10px}.lib-select .select-list-wrapper .select-data.s-item-disabled{cursor:auto;background:var(--disabled-bgc);color:var(--disabled-color)}.lib-select .select-list-wrapper .group-items{padding-left:16px}.lib-select .select-list-wrapper .group-items .select-data{margin-left:-16px;padding-left:32px}.lib-select .select-list-wrapper .select-no-data{padding:12px 42px 12px 16px;cursor:auto;position:relative;color:var(--disabled-color)}.lib-select .select-list-wrapper .info-container{padding:36px;display:flex;align-items:center;justify-content:center}.search-block{position:relative;padding:12px;z-index:1;display:flex;gap:4px;align-items:center;border-bottom:1px solid var(--gray-bgc)}.search-block__input{border:none;background:transparent;width:100%;padding-left:40px}.search-block .search-icon{position:absolute;left:20px;top:0;bottom:0}.data-loader{position:absolute;right:0;left:0;bottom:12px}.selected-items-container{overflow:hidden;border-radius:8px;top:0;bottom:0;position:absolute;max-width:calc(100% - 60px);left:6px;margin:8px;align-items:center}.selected-items-container .selected-items__item{background:var(--blue-card);color:var(--font-light-black-color);padding:4px;border-radius:8px;display:flex;gap:4px;align-items:center;max-width:170px;overflow:hidden}.selected-items-container .selected-items__item:hover{background:var(--light-green-color);color:var(--font-light-black-color)}.selected-items-container .selected-items__item-title{overflow:hidden;white-space:nowrap;max-width:150px;text-overflow:ellipsis}.group-header{height:48px;padding:8px 16px;font-weight:600;color:var(--font-light-black-color);border-bottom:1px solid var(--gray-bgc);display:flex;justify-content:space-between;align-items:center}.group-header.select-all-enabled{cursor:pointer}.group-header.select-all-enabled:hover{background-color:var(--gray-color-300)}.group-title{flex-grow:1}\n"] }]
|
|
3820
3921
|
}], ctorParameters: () => [{ type: i0.DestroyRef }, { type: i0.ChangeDetectorRef }, { type: i1$4.ControlContainer, decorators: [{
|
|
3821
3922
|
type: Optional
|
|
3822
3923
|
}, {
|
|
@@ -3843,6 +3944,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
|
|
|
3843
3944
|
type: Input
|
|
3844
3945
|
}], selectId: [{
|
|
3845
3946
|
type: Input
|
|
3947
|
+
}], canSortByChecked: [{
|
|
3948
|
+
type: Input
|
|
3846
3949
|
}], itemSize: [{
|
|
3847
3950
|
type: Input
|
|
3848
3951
|
}], keyTitle: [{
|
|
@@ -4268,15 +4371,60 @@ class LibDateRangeComponent {
|
|
|
4268
4371
|
static { this.idCounter = 1; }
|
|
4269
4372
|
constructor(cdr) {
|
|
4270
4373
|
this.cdr = cdr;
|
|
4374
|
+
this.placeholderStart = 'Дата начала';
|
|
4375
|
+
this.placeholderEnd = 'Дата окончания';
|
|
4271
4376
|
this.isShownPeriod = false;
|
|
4272
4377
|
this.disabled = false;
|
|
4273
|
-
this.selectedPeriod = {
|
|
4378
|
+
this.selectedPeriod = {
|
|
4379
|
+
start: undefined,
|
|
4380
|
+
end: undefined
|
|
4381
|
+
};
|
|
4382
|
+
this.endIsFocused = false;
|
|
4383
|
+
this.startIsFocused = false;
|
|
4384
|
+
}
|
|
4385
|
+
pressTab(e) {
|
|
4386
|
+
if (this.isShownPeriod) {
|
|
4387
|
+
e.preventDefault();
|
|
4388
|
+
e.stopPropagation();
|
|
4389
|
+
if (this.startIsFocused) {
|
|
4390
|
+
this.endInput?.nativeElement.focus();
|
|
4391
|
+
}
|
|
4392
|
+
else if (this.endIsFocused) {
|
|
4393
|
+
this.startInput?.nativeElement.focus();
|
|
4394
|
+
}
|
|
4395
|
+
}
|
|
4274
4396
|
}
|
|
4275
4397
|
ngOnInit() {
|
|
4276
4398
|
if (!this.rangeId) {
|
|
4277
4399
|
this.rangeId = 'dd-range-' + LibDateRangeComponent.idCounter++;
|
|
4278
4400
|
}
|
|
4279
4401
|
}
|
|
4402
|
+
get startDateStr() {
|
|
4403
|
+
return this.formatDate(this.selectedPeriod.start);
|
|
4404
|
+
}
|
|
4405
|
+
set startDateStr(value) {
|
|
4406
|
+
this.selectedPeriod.start = this.parseDate(value);
|
|
4407
|
+
}
|
|
4408
|
+
get endDateStr() {
|
|
4409
|
+
return this.formatDate(this.selectedPeriod.end);
|
|
4410
|
+
}
|
|
4411
|
+
set endDateStr(value) {
|
|
4412
|
+
this.selectedPeriod.end = this.parseDate(value);
|
|
4413
|
+
}
|
|
4414
|
+
formatDate(date) {
|
|
4415
|
+
if (!date)
|
|
4416
|
+
return '';
|
|
4417
|
+
const day = date.getDate().toString().padStart(2, '0');
|
|
4418
|
+
const month = (date.getMonth() + 1).toString().padStart(2, '0');
|
|
4419
|
+
const year = date.getFullYear();
|
|
4420
|
+
return `${day}.${month}.${year}`;
|
|
4421
|
+
}
|
|
4422
|
+
parseDate(dateStr) {
|
|
4423
|
+
if (!dateStr)
|
|
4424
|
+
return new Date();
|
|
4425
|
+
const parts = dateStr.split('.');
|
|
4426
|
+
return new Date(+parts[2], +parts[1] - 1, +parts[0]);
|
|
4427
|
+
}
|
|
4280
4428
|
openCalendar() {
|
|
4281
4429
|
if (!this.disabled) {
|
|
4282
4430
|
this.isShownPeriod = true;
|
|
@@ -4294,7 +4442,7 @@ class LibDateRangeComponent {
|
|
|
4294
4442
|
this.selectedPeriodStr = `${format($event?.start, 'dd.MM.yyyy')} - ${format($event?.end, 'dd.MM.yyyy')}`;
|
|
4295
4443
|
}
|
|
4296
4444
|
else {
|
|
4297
|
-
this.selectedPeriod =
|
|
4445
|
+
this.selectedPeriod = new IDatePeriod();
|
|
4298
4446
|
this.selectedPeriodStr = undefined;
|
|
4299
4447
|
}
|
|
4300
4448
|
this.propagateChange(this.selectedPeriod);
|
|
@@ -4306,7 +4454,7 @@ class LibDateRangeComponent {
|
|
|
4306
4454
|
this.selectedPeriod = { start, end };
|
|
4307
4455
|
}
|
|
4308
4456
|
else {
|
|
4309
|
-
this.selectedPeriod =
|
|
4457
|
+
this.selectedPeriod = new IDatePeriod();
|
|
4310
4458
|
}
|
|
4311
4459
|
this.propagateChange(this.selectedPeriod);
|
|
4312
4460
|
}
|
|
@@ -4325,15 +4473,44 @@ class LibDateRangeComponent {
|
|
|
4325
4473
|
}
|
|
4326
4474
|
this.cdr.detectChanges();
|
|
4327
4475
|
}
|
|
4476
|
+
setDate($event) {
|
|
4477
|
+
console.log(this.startIsFocused);
|
|
4478
|
+
if (this.startIsFocused) {
|
|
4479
|
+
this.selectedPeriod.start = $event;
|
|
4480
|
+
if (this.selectedPeriod.end) {
|
|
4481
|
+
if (this.selectedPeriod.start > this.selectedPeriod.end) {
|
|
4482
|
+
this.selectedPeriod.end = undefined;
|
|
4483
|
+
}
|
|
4484
|
+
}
|
|
4485
|
+
}
|
|
4486
|
+
if (this.endIsFocused) {
|
|
4487
|
+
this.selectedPeriod.end = $event;
|
|
4488
|
+
if (this.selectedPeriod?.start) {
|
|
4489
|
+
if (this.selectedPeriod.start > this.selectedPeriod.end) {
|
|
4490
|
+
this.selectedPeriod.start = undefined;
|
|
4491
|
+
}
|
|
4492
|
+
}
|
|
4493
|
+
}
|
|
4494
|
+
}
|
|
4495
|
+
changeActiveInput(position, val) {
|
|
4496
|
+
if (position === 'start' && !this.startIsFocused) {
|
|
4497
|
+
this.startIsFocused = val;
|
|
4498
|
+
this.endIsFocused = false;
|
|
4499
|
+
}
|
|
4500
|
+
if (position === 'end' && !this.endIsFocused) {
|
|
4501
|
+
this.endIsFocused = val;
|
|
4502
|
+
this.startIsFocused = false;
|
|
4503
|
+
}
|
|
4504
|
+
}
|
|
4328
4505
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: LibDateRangeComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4329
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: LibDateRangeComponent, isStandalone: true, selector: "dd-lib-date-range", inputs: { rangeId: "rangeId",
|
|
4506
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: LibDateRangeComponent, isStandalone: true, selector: "dd-lib-date-range", inputs: { rangeId: "rangeId", placeholderStart: "placeholderStart", placeholderEnd: "placeholderEnd", label: "label", required: "required" }, host: { listeners: { "document:keydown.tab": "pressTab($event)" } }, providers: [
|
|
4330
4507
|
provideNgxMask(),
|
|
4331
4508
|
{
|
|
4332
4509
|
provide: NG_VALUE_ACCESSOR,
|
|
4333
4510
|
useExisting: forwardRef(() => LibDateRangeComponent),
|
|
4334
4511
|
multi: true,
|
|
4335
4512
|
},
|
|
4336
|
-
], ngImport: i0, template: "<div class=\"lib-range\" id=\"lib-range-{{ rangeId }}\" [destroyedItem]=\"isShownPeriod\" ddFixedPosition>\
|
|
4513
|
+
], viewQueries: [{ propertyName: "startInput", first: true, predicate: ["startInput"], descendants: true, static: true }, { propertyName: "endInput", first: true, predicate: ["endInput"], descendants: true, static: true }], ngImport: i0, template: "<div class=\"lib-range\" id=\"lib-range-{{ rangeId }}\" [destroyedItem]=\"isShownPeriod\" ddFixedPosition>\n @if (label) {\n <label [for]=\"rangeId\" class=\"lib-range__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 lib-range-wrapper\"\n [class.start-active]=\"startIsFocused\"\n [class.end-active]=\"endIsFocused\"\n data-child=\"input\">\n <input\n #startInput\n [attr.id]=\"rangeId\"\n tabindex=\"1\"\n [attr.placeholder]=\"placeholderStart\"\n (click)=\"openCalendar()\"\n [(ngModel)]=\"startDateStr\"\n [mask]=\"'d0.M0.0000'\"\n (ngModelChange)=\"changeStrDate($event)\"\n (focus)=\"changeActiveInput('start', true)\"\n (blur)=\"changeActiveInput('start', false)\"\n [leadZeroDateTime]=\"true\"\n class=\"text-select\"/>\n \u2013\n <input\n #endInput\n [attr.id]=\"rangeId\"\n tabindex=\"2\"\n [attr.placeholder]=\"placeholderEnd\"\n (click)=\"openCalendar()\"\n [(ngModel)]=\"endDateStr\"\n [mask]=\"'d0.M0.0000'\"\n (focus)=\"changeActiveInput('end', true)\"\n (blur)=\"changeActiveInput('end', false)\"\n (ngModelChange)=\"changeStrDate($event)\"\n [leadZeroDateTime]=\"true\"\n class=\"text-select\"/>\n @if (!selectedPeriodStr) {\n <dd-lib-svg-icon [class.gray-svg]=\"!isShownPeriod\"\n (click)=\"openCalendar()\"\n id=\"calendar-{{ rangeId }}\"\n class=\"calendar\" icon=\"calendar\"></dd-lib-svg-icon>\n\n\n } @else {\n <dd-lib-svg-icon\n (click)=\"setPeriod(undefined)\"\n class=\"clear\"\n icon=\"clear\"></dd-lib-svg-icon>\n\n }\n </div>\n @if (isShownPeriod) {\n <div data-child=\"list\"\n (ddClickOutside)=\"closeCalendar()\"\n [elements]=\"['lib-range-' + rangeId, 'calendar' + rangeId]\"\n class=\"calendar-wrapper\">\n <dd-lib-calendar [(ngModel)]=\"selectedPeriod\"\n (immediatelyEmitDate)=\"setDate($event)\"\n [dateStart]=\"selectedPeriod.start\"\n [dateEnd]=\"selectedPeriod.end\"\n [rangeMode]=\"true\"\n (emitPeriod)=\"setPeriod($event)\"></dd-lib-calendar>\n </div>\n }\n</div>\n", styles: [".lib-range{min-width:311px;position:relative}.lib-range .lib-range-wrapper{display:flex;align-items:center;border-radius:8px;border:1px solid var(--input-border-color);background-color:transparent;position:relative;overflow:hidden}.lib-range .lib-range-wrapper.start-active:before{content:\"\";position:absolute;top:0;left:0;width:50%;height:100%;border-radius:8px 0 0 8px;border:1px solid var(--input-active-border-colort);box-sizing:border-box;pointer-events:none;border-right:none}.lib-range .lib-range-wrapper.end-active:before{content:\"\";position:absolute;top:0;right:0;width:50%;height:100%;border-radius:0 8px 8px 0;border:1px solid var(--input-active-border-colort);border-left:none;box-sizing:border-box;pointer-events:none}.lib-range .lib-range-wrapper:hover{border-color:var(--input-active-border-colort)}.lib-range .lib-range-wrapper:hover:before{opacity:0}.lib-range .lib-range-wrapper:focus{border-color:var(--input-active-border-colort);box-shadow:var(--input-active-border-shadow)}.lib-range input{width:100%;height:48px;padding:15px 28px 15px 16px;overflow:hidden;text-overflow:ellipsis;border:none;text-align:center}.lib-range input:disabled{border:none;background-color:var(--input-disable-input);color:var(--input-disable-text);pointer-events:none}.lib-range input:disabled::placeholder{color:var(--input-placeholder)}.lib-range input.invalid,.lib-range input.invalid:hover{border-color:var(--input-error-border-color)}.lib-range input.invalid:focus{border-color:var(--input-error-border-color);box-shadow:var(--input-error-border-shadow)}.lib-range .clear{cursor:pointer;position:absolute;right:8px;top:12px}.lib-range .calendar{cursor:pointer;position:absolute;right:16px;top:10px}.lib-range .calendar.up{transform:rotate(180deg)}.lib-range__title{margin-bottom:4px;font-size:14px;line-height:24px;display:flex;align-items:flex-start}.lib-range__error{color:var(--primary-red-color);font-size:12px;font-weight:400;line-height:10px;margin-top:2px;position:absolute}.lib-range .calendar-wrapper{position:absolute;display:block;z-index:100;width:100%;overflow:auto;border-radius:8px;box-shadow:var(--main-card-shadow);background-color:var(--main-card-color)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.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$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.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"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[ddClickOutside]", inputs: ["elements"], outputs: ["ddClickOutside"] }, { kind: "component", type: LibCalendarComponent, selector: "dd-lib-calendar", inputs: ["type", "formatDate", "formatTime", "rangeMode", "maxHours", "maxMinutes", "needTime", "mode", "dateStart", "dateEnd", "maxDate", "minDate"], outputs: ["emitDate", "immediatelyEmitDate", "emitPeriod"] }, { kind: "directive", type: NgxMaskDirective, selector: "input[mask], textarea[mask]", inputs: ["mask", "specialCharacters", "patterns", "prefix", "suffix", "thousandSeparator", "decimalMarker", "dropSpecialCharacters", "hiddenInput", "showMaskTyped", "placeHolderCharacter", "shownMaskExpression", "showTemplate", "clearIfNotMatch", "validation", "separatorLimit", "allowNegativeNumbers", "leadZeroDateTime", "leadZero", "triggerOnMaskChange", "apm", "inputTransformFn", "outputTransformFn", "keepCharacterPositions"], outputs: ["maskFilled"], exportAs: ["mask", "ngxMask"] }, { kind: "directive", type: FixedPositionDirective, selector: "[ddFixedPosition]", inputs: ["childName1", "childName2", "destroyedItem"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4337
4514
|
}
|
|
4338
4515
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: LibDateRangeComponent, decorators: [{
|
|
4339
4516
|
type: Component,
|
|
@@ -4351,15 +4528,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImpor
|
|
|
4351
4528
|
useExisting: forwardRef(() => LibDateRangeComponent),
|
|
4352
4529
|
multi: true,
|
|
4353
4530
|
},
|
|
4354
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"lib-range\" id=\"lib-range-{{ rangeId }}\" [destroyedItem]=\"isShownPeriod\" ddFixedPosition>\
|
|
4355
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: {
|
|
4531
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"lib-range\" id=\"lib-range-{{ rangeId }}\" [destroyedItem]=\"isShownPeriod\" ddFixedPosition>\n @if (label) {\n <label [for]=\"rangeId\" class=\"lib-range__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 lib-range-wrapper\"\n [class.start-active]=\"startIsFocused\"\n [class.end-active]=\"endIsFocused\"\n data-child=\"input\">\n <input\n #startInput\n [attr.id]=\"rangeId\"\n tabindex=\"1\"\n [attr.placeholder]=\"placeholderStart\"\n (click)=\"openCalendar()\"\n [(ngModel)]=\"startDateStr\"\n [mask]=\"'d0.M0.0000'\"\n (ngModelChange)=\"changeStrDate($event)\"\n (focus)=\"changeActiveInput('start', true)\"\n (blur)=\"changeActiveInput('start', false)\"\n [leadZeroDateTime]=\"true\"\n class=\"text-select\"/>\n \u2013\n <input\n #endInput\n [attr.id]=\"rangeId\"\n tabindex=\"2\"\n [attr.placeholder]=\"placeholderEnd\"\n (click)=\"openCalendar()\"\n [(ngModel)]=\"endDateStr\"\n [mask]=\"'d0.M0.0000'\"\n (focus)=\"changeActiveInput('end', true)\"\n (blur)=\"changeActiveInput('end', false)\"\n (ngModelChange)=\"changeStrDate($event)\"\n [leadZeroDateTime]=\"true\"\n class=\"text-select\"/>\n @if (!selectedPeriodStr) {\n <dd-lib-svg-icon [class.gray-svg]=\"!isShownPeriod\"\n (click)=\"openCalendar()\"\n id=\"calendar-{{ rangeId }}\"\n class=\"calendar\" icon=\"calendar\"></dd-lib-svg-icon>\n\n\n } @else {\n <dd-lib-svg-icon\n (click)=\"setPeriod(undefined)\"\n class=\"clear\"\n icon=\"clear\"></dd-lib-svg-icon>\n\n }\n </div>\n @if (isShownPeriod) {\n <div data-child=\"list\"\n (ddClickOutside)=\"closeCalendar()\"\n [elements]=\"['lib-range-' + rangeId, 'calendar' + rangeId]\"\n class=\"calendar-wrapper\">\n <dd-lib-calendar [(ngModel)]=\"selectedPeriod\"\n (immediatelyEmitDate)=\"setDate($event)\"\n [dateStart]=\"selectedPeriod.start\"\n [dateEnd]=\"selectedPeriod.end\"\n [rangeMode]=\"true\"\n (emitPeriod)=\"setPeriod($event)\"></dd-lib-calendar>\n </div>\n }\n</div>\n", styles: [".lib-range{min-width:311px;position:relative}.lib-range .lib-range-wrapper{display:flex;align-items:center;border-radius:8px;border:1px solid var(--input-border-color);background-color:transparent;position:relative;overflow:hidden}.lib-range .lib-range-wrapper.start-active:before{content:\"\";position:absolute;top:0;left:0;width:50%;height:100%;border-radius:8px 0 0 8px;border:1px solid var(--input-active-border-colort);box-sizing:border-box;pointer-events:none;border-right:none}.lib-range .lib-range-wrapper.end-active:before{content:\"\";position:absolute;top:0;right:0;width:50%;height:100%;border-radius:0 8px 8px 0;border:1px solid var(--input-active-border-colort);border-left:none;box-sizing:border-box;pointer-events:none}.lib-range .lib-range-wrapper:hover{border-color:var(--input-active-border-colort)}.lib-range .lib-range-wrapper:hover:before{opacity:0}.lib-range .lib-range-wrapper:focus{border-color:var(--input-active-border-colort);box-shadow:var(--input-active-border-shadow)}.lib-range input{width:100%;height:48px;padding:15px 28px 15px 16px;overflow:hidden;text-overflow:ellipsis;border:none;text-align:center}.lib-range input:disabled{border:none;background-color:var(--input-disable-input);color:var(--input-disable-text);pointer-events:none}.lib-range input:disabled::placeholder{color:var(--input-placeholder)}.lib-range input.invalid,.lib-range input.invalid:hover{border-color:var(--input-error-border-color)}.lib-range input.invalid:focus{border-color:var(--input-error-border-color);box-shadow:var(--input-error-border-shadow)}.lib-range .clear{cursor:pointer;position:absolute;right:8px;top:12px}.lib-range .calendar{cursor:pointer;position:absolute;right:16px;top:10px}.lib-range .calendar.up{transform:rotate(180deg)}.lib-range__title{margin-bottom:4px;font-size:14px;line-height:24px;display:flex;align-items:flex-start}.lib-range__error{color:var(--primary-red-color);font-size:12px;font-weight:400;line-height:10px;margin-top:2px;position:absolute}.lib-range .calendar-wrapper{position:absolute;display:block;z-index:100;width:100%;overflow:auto;border-radius:8px;box-shadow:var(--main-card-shadow);background-color:var(--main-card-color)}\n"] }]
|
|
4532
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { startInput: [{
|
|
4533
|
+
type: ViewChild,
|
|
4534
|
+
args: ['startInput', { static: true }]
|
|
4535
|
+
}], endInput: [{
|
|
4536
|
+
type: ViewChild,
|
|
4537
|
+
args: ['endInput', { static: true }]
|
|
4538
|
+
}], rangeId: [{
|
|
4356
4539
|
type: Input
|
|
4357
|
-
}],
|
|
4540
|
+
}], placeholderStart: [{
|
|
4541
|
+
type: Input
|
|
4542
|
+
}], placeholderEnd: [{
|
|
4358
4543
|
type: Input
|
|
4359
4544
|
}], label: [{
|
|
4360
4545
|
type: Input
|
|
4361
4546
|
}], required: [{
|
|
4362
4547
|
type: Input
|
|
4548
|
+
}], pressTab: [{
|
|
4549
|
+
type: HostListener,
|
|
4550
|
+
args: ['document:keydown.tab', ['$event']]
|
|
4363
4551
|
}] } });
|
|
4364
4552
|
|
|
4365
4553
|
class LibDateInputComponent {
|
|
@@ -4430,7 +4618,7 @@ class LibDateInputComponent {
|
|
|
4430
4618
|
useExisting: forwardRef(() => LibDateInputComponent),
|
|
4431
4619
|
multi: true,
|
|
4432
4620
|
},
|
|
4433
|
-
], ngImport: i0, template: "<div class=\"lib-date\" id=\"lib-date-{{ dateId }}\">\r\n @if (label) {\r\n <label [for]=\"dateId\" class=\"lib-date__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 }\r\n <div class=\"pos-relative\">\r\n <input\r\n [attr.id]=\"dateId\"\r\n [attr.placeholder]=\"placeholder\"\r\n (click)=\"openCalendar()\"\r\n [(ngModel)]=\"selectedDateStr\"\r\n [mask]=\"'d0.M0.0000'\"\r\n (ngModelChange)=\"changeStrDate($event)\"\r\n [leadZeroDateTime]=\"true\"\r\n class=\"text-select\"/>\r\n @if (!selectedDateStr) {\r\n <dd-lib-svg-icon [class.gray-svg]=\"!isShownCalendar\"\r\n (click)=\"openCalendar()\"\r\n id=\"calendar-{{ dateId }}\"\r\n class=\"calendar\" icon=\"calendar\"></dd-lib-svg-icon>\r\n\r\n\r\n } @else {\r\n <dd-lib-svg-icon\r\n (click)=\"setPeriod(undefined)\"\r\n class=\"clear\"\r\n icon=\"clear\"></dd-lib-svg-icon>\r\n\r\n }\r\n </div>\r\n @if (isShownCalendar) {\r\n <div\r\n (ddClickOutside)=\"closeCalendar()\"\r\n [elements]=\"['lib-date-' + dateId, 'calendar' + dateId]\"\r\n class=\"calendar-wrapper\" [ngClass]=\"{top: topSide}\">\r\n <dd-lib-calendar [(ngModel)]=\"selectedDate\" (emitDate)=\"setPeriod($event)\"></dd-lib-calendar>\r\n </div>\r\n }\r\n</div>\r\n", styles: [".lib-date{min-width:340px;position:relative}.lib-date 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-date input:hover{border-color:var(--input-active-border-colort)}.lib-date input:focus{border-color:var(--input-active-border-colort);box-shadow:var(--input-active-border-shadow)}.lib-date input:disabled{border:none;background-color:var(--input-disable-input);color:var(--input-disable-text);pointer-events:none}.lib-date input:disabled::placeholder{color:var(--input-placeholder)}.lib-date input.invalid,.lib-date input.invalid:hover{border-color:var(--input-error-border-color)}.lib-date input.invalid:focus{border-color:var(--input-error-border-color);box-shadow:var(--input-error-border-shadow)}.lib-date .clear{cursor:pointer;position:absolute;right:8px;top:12px}.lib-date .calendar{cursor:pointer;position:absolute;right:16px;top:10px}.lib-date .calendar.up{transform:rotate(180deg)}.lib-date__title{margin-bottom:4px;font-size:14px;line-height:24px;display:flex;align-items:flex-start}.lib-date__error{color:var(--primary-red-color);font-size:12px;font-weight:400;line-height:10px;margin-top:2px;position:absolute}.lib-date .calendar-wrapper{max-width:350px;position:absolute;display:block;z-index:100;width:100%;overflow:auto;border-radius:8px;box-shadow:var(--main-card-shadow);background-color:var(--main-card-color)}.lib-date .calendar-wrapper.top{bottom:48px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.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$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.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"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[ddClickOutside]", inputs: ["elements"], outputs: ["ddClickOutside"] }, { kind: "component", type: LibCalendarComponent, selector: "dd-lib-calendar", inputs: ["type", "formatDate", "formatTime", "rangeMode", "maxHours", "maxMinutes", "needTime", "mode", "maxDate", "minDate"], outputs: ["emitDate", "emitPeriod"] }, { kind: "directive", type: NgxMaskDirective, selector: "input[mask], textarea[mask]", inputs: ["mask", "specialCharacters", "patterns", "prefix", "suffix", "thousandSeparator", "decimalMarker", "dropSpecialCharacters", "hiddenInput", "showMaskTyped", "placeHolderCharacter", "shownMaskExpression", "showTemplate", "clearIfNotMatch", "validation", "separatorLimit", "allowNegativeNumbers", "leadZeroDateTime", "leadZero", "triggerOnMaskChange", "apm", "inputTransformFn", "outputTransformFn", "keepCharacterPositions"], outputs: ["maskFilled"], exportAs: ["mask", "ngxMask"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4621
|
+
], ngImport: i0, template: "<div class=\"lib-date\" id=\"lib-date-{{ dateId }}\">\r\n @if (label) {\r\n <label [for]=\"dateId\" class=\"lib-date__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 }\r\n <div class=\"pos-relative\">\r\n <input\r\n [attr.id]=\"dateId\"\r\n [attr.placeholder]=\"placeholder\"\r\n (click)=\"openCalendar()\"\r\n [(ngModel)]=\"selectedDateStr\"\r\n [mask]=\"'d0.M0.0000'\"\r\n (ngModelChange)=\"changeStrDate($event)\"\r\n [leadZeroDateTime]=\"true\"\r\n class=\"text-select\"/>\r\n @if (!selectedDateStr) {\r\n <dd-lib-svg-icon [class.gray-svg]=\"!isShownCalendar\"\r\n (click)=\"openCalendar()\"\r\n id=\"calendar-{{ dateId }}\"\r\n class=\"calendar\" icon=\"calendar\"></dd-lib-svg-icon>\r\n\r\n\r\n } @else {\r\n <dd-lib-svg-icon\r\n (click)=\"setPeriod(undefined)\"\r\n class=\"clear\"\r\n icon=\"clear\"></dd-lib-svg-icon>\r\n\r\n }\r\n </div>\r\n @if (isShownCalendar) {\r\n <div\r\n (ddClickOutside)=\"closeCalendar()\"\r\n [elements]=\"['lib-date-' + dateId, 'calendar' + dateId]\"\r\n class=\"calendar-wrapper\" [ngClass]=\"{top: topSide}\">\r\n <dd-lib-calendar [(ngModel)]=\"selectedDate\" (emitDate)=\"setPeriod($event)\"></dd-lib-calendar>\r\n </div>\r\n }\r\n</div>\r\n", styles: [".lib-date{min-width:340px;position:relative}.lib-date 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-date input:hover{border-color:var(--input-active-border-colort)}.lib-date input:focus{border-color:var(--input-active-border-colort);box-shadow:var(--input-active-border-shadow)}.lib-date input:disabled{border:none;background-color:var(--input-disable-input);color:var(--input-disable-text);pointer-events:none}.lib-date input:disabled::placeholder{color:var(--input-placeholder)}.lib-date input.invalid,.lib-date input.invalid:hover{border-color:var(--input-error-border-color)}.lib-date input.invalid:focus{border-color:var(--input-error-border-color);box-shadow:var(--input-error-border-shadow)}.lib-date .clear{cursor:pointer;position:absolute;right:8px;top:12px}.lib-date .calendar{cursor:pointer;position:absolute;right:16px;top:10px}.lib-date .calendar.up{transform:rotate(180deg)}.lib-date__title{margin-bottom:4px;font-size:14px;line-height:24px;display:flex;align-items:flex-start}.lib-date__error{color:var(--primary-red-color);font-size:12px;font-weight:400;line-height:10px;margin-top:2px;position:absolute}.lib-date .calendar-wrapper{max-width:350px;position:absolute;display:block;z-index:100;width:100%;overflow:auto;border-radius:8px;box-shadow:var(--main-card-shadow);background-color:var(--main-card-color)}.lib-date .calendar-wrapper.top{bottom:48px}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.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$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.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"] }, { kind: "directive", type: ClickOutsideDirective, selector: "[ddClickOutside]", inputs: ["elements"], outputs: ["ddClickOutside"] }, { kind: "component", type: LibCalendarComponent, selector: "dd-lib-calendar", inputs: ["type", "formatDate", "formatTime", "rangeMode", "maxHours", "maxMinutes", "needTime", "mode", "dateStart", "dateEnd", "maxDate", "minDate"], outputs: ["emitDate", "immediatelyEmitDate", "emitPeriod"] }, { kind: "directive", type: NgxMaskDirective, selector: "input[mask], textarea[mask]", inputs: ["mask", "specialCharacters", "patterns", "prefix", "suffix", "thousandSeparator", "decimalMarker", "dropSpecialCharacters", "hiddenInput", "showMaskTyped", "placeHolderCharacter", "shownMaskExpression", "showTemplate", "clearIfNotMatch", "validation", "separatorLimit", "allowNegativeNumbers", "leadZeroDateTime", "leadZero", "triggerOnMaskChange", "apm", "inputTransformFn", "outputTransformFn", "keepCharacterPositions"], outputs: ["maskFilled"], exportAs: ["mask", "ngxMask"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4434
4622
|
}
|
|
4435
4623
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: LibDateInputComponent, decorators: [{
|
|
4436
4624
|
type: Component,
|
|
@@ -5349,5 +5537,5 @@ const t = true;
|
|
|
5349
5537
|
* Generated bundle index. Do not edit.
|
|
5350
5538
|
*/
|
|
5351
5539
|
|
|
5352
|
-
export { API_URL, AutoHeightDirective, ClickOutsideDirective, CounterDirective, DDDialogRef, DEFAULT_FORMAT, DIALOG_CONFIG, DataEmptyComponent, DateService, Debounce, DeclensionDirective, DestroyService, DialogConfig, DialogService, DisableAfterNCall, Disabled, DropDownPositionDirective, ErrorPageComponent, FetcherService, FilterByKeyPipe, FilterPipe, FixedPositionDirective, FooterComponent, FooterLinkComponent, FooterLinksBlockComponent, HighlightPipe, ITab, InterceptorsService, LibAccordionComponent, LibBackButtonComponent, LibButtonComponent, LibCalendarComponent, LibCardComponent, LibCheckboxComponent, LibCommentInputComponent, LibCommonButtonComponent, LibCommonInputTextComponent, LibDateInputComponent, LibDateRangeComponent, LibDisclaimerComponent, LibFileLoaderComponent, LibFileUploadComponent, LibFilterButtonComponent, LibFilterComponent, LibHorizontalScrollComponent, LibImageLoaderComponent, LibInfoCardComponent, LibInputComponent, LibLoaderComponent, LibPeriodComponent, LibRadioComponent, LibSearchInputComponent, LibSelectComponent, LibSkeletonComponent, LibSortComponent, LibStepComponent, LibSvgComponent, LibSvgIconComponent, LibSvgViewerComponent, LibTabsFragmentComponent, LibTextareaComponent, ListKeyboardNavigationDirective, MainSharedComponent, ModalBaseComponent, ModalCommonComponent, NotFoundComponent, PhoneMaskDirective, ResizeTextareaDirective, ReversePipe, SafePipe, SelectableItemDirective, SvgIconsService, TOAST_CONFIG_TOKEN, TOOLTIP_DATA, TechWorksComponent, ThemeConfigurator, ThemeConstructorService, Throttle, ToastComponent, ToastConfig, ToastData, ToastRef, ToastService, ToastTypeData, TooltipComponent, TooltipDirective, TriangleDirective, ValidatorsService, completeIconSet, defaultToastConfig, provideToast, svgIconActogoneAccept, svgIconAll, svgIconAppgalery, svgIconAppstore, svgIconArrowDownRed, svgIconArrowUpGreen, svgIconBackArrow, svgIconBurger, svgIconCalendar, svgIconCheckGreen, svgIconCheckWhite, svgIconCircleNo, svgIconClear, svgIconClose, svgIconDangerT, svgIconDd, svgIconDdM, svgIconDobrodel, svgIconDownChevron, svgIconDownload, svgIconEds, svgIconEds2, svgIconEds2M, svgIconEdsM, svgIconEntry, svgIconErrorHint, svgIconEsia, svgIconEye, svgIconEyeOff, svgIconFile, svgIconFilter, svgIconGoogleapp, svgIconGrid, svgIconHealth, svgIconHealthM, svgIconInfoCircle, svgIconInfoT, svgIconLeftChevron, svgIconListSearch, svgIconLogout, svgIconMailExclamation, svgIconMaxFilter, svgIconMoon, svgIconMy, svgIconMyM, svgIconNews, svgIconNext, svgIconPaperclip, svgIconPenEdit, svgIconPguMo, svgIconPguMoM, svgIconPlug, svgIconPlugD, svgIconPlus, svgIconPreset, svgIconPrev, svgIconPrint, svgIconPrinter, svgIconQuestion, svgIconQuestionWhiteG, svgIconRedClose, svgIconReload, svgIconRightChevron, svgIconRustore, svgIconSearch, svgIconSend, svgIconSetAvatar, svgIconSharedLogo, svgIconSmallRoundLoader, svgIconSort, svgIconStar, svgIconSuccessT, svgIconSun, svgIconTg, svgIconToggleArrowLeft, svgIconToggleArrowRight, svgIconTrash, svgIconTrophy, svgIconUser, svgIconUserEmpty, svgIconUserEmptyD, svgIconVk, svgIconWarningT, t };
|
|
5540
|
+
export { API_URL, AutoHeightDirective, ClickOutsideDirective, CounterDirective, DDDialogRef, DEFAULT_FORMAT, DIALOG_CONFIG, DataEmptyComponent, DateService, Debounce, DeclensionDirective, DestroyService, DialogConfig, DialogService, DisableAfterNCall, Disabled, DropDownPositionDirective, ErrorPageComponent, FetcherService, FilterByKeyPipe, FilterPipe, FixedPositionDirective, FooterComponent, FooterLinkComponent, FooterLinksBlockComponent, HighlightPipe, IDatePeriod, ITab, InterceptorsService, LibAccordionComponent, LibBackButtonComponent, LibButtonComponent, LibCalendarComponent, LibCardComponent, LibCheckboxComponent, LibCommentInputComponent, LibCommonButtonComponent, LibCommonInputTextComponent, LibDateInputComponent, LibDateRangeComponent, LibDisclaimerComponent, LibFileLoaderComponent, LibFileUploadComponent, LibFilterButtonComponent, LibFilterComponent, LibHorizontalScrollComponent, LibImageLoaderComponent, LibInfoCardComponent, LibInputComponent, LibLoaderComponent, LibPeriodComponent, LibRadioComponent, LibSearchInputComponent, LibSelectComponent, LibSkeletonComponent, LibSortComponent, LibStepComponent, LibSvgComponent, LibSvgIconComponent, LibSvgViewerComponent, LibTabsFragmentComponent, LibTextareaComponent, ListKeyboardNavigationDirective, MainSharedComponent, ModalBaseComponent, ModalCommonComponent, NotFoundComponent, PhoneMaskDirective, ResizeTextareaDirective, ReversePipe, SafePipe, SelectableItemDirective, SortByValPipe, SvgIconsService, TOAST_CONFIG_TOKEN, TOOLTIP_DATA, TechWorksComponent, ThemeConfigurator, ThemeConstructorService, Throttle, ToastComponent, ToastConfig, ToastData, ToastRef, ToastService, ToastTypeData, TooltipComponent, TooltipDirective, TriangleDirective, ValidatorsService, completeIconSet, defaultToastConfig, provideToast, svgIconActogoneAccept, svgIconAll, svgIconAppgalery, svgIconAppstore, svgIconArrowDownRed, svgIconArrowUpGreen, svgIconBackArrow, svgIconBurger, svgIconCalendar, svgIconCheckGreen, svgIconCheckWhite, svgIconCircleNo, svgIconClear, svgIconClose, svgIconDangerT, svgIconDd, svgIconDdM, svgIconDobrodel, svgIconDownChevron, svgIconDownload, svgIconEds, svgIconEds2, svgIconEds2M, svgIconEdsM, svgIconEntry, svgIconErrorHint, svgIconEsia, svgIconEye, svgIconEyeOff, svgIconFile, svgIconFilter, svgIconGoogleapp, svgIconGrid, svgIconHealth, svgIconHealthM, svgIconInfoCircle, svgIconInfoT, svgIconLeftChevron, svgIconListSearch, svgIconLogout, svgIconMailExclamation, svgIconMaxFilter, svgIconMoon, svgIconMy, svgIconMyM, svgIconNews, svgIconNext, svgIconPaperclip, svgIconPenEdit, svgIconPguMo, svgIconPguMoM, svgIconPlug, svgIconPlugD, svgIconPlus, svgIconPreset, svgIconPrev, svgIconPrint, svgIconPrinter, svgIconQuestion, svgIconQuestionWhiteG, svgIconRedClose, svgIconReload, svgIconRightChevron, svgIconRustore, svgIconSearch, svgIconSend, svgIconSetAvatar, svgIconSharedLogo, svgIconSmallRoundLoader, svgIconSort, svgIconStar, svgIconSuccessT, svgIconSun, svgIconTg, svgIconToggleArrowLeft, svgIconToggleArrowRight, svgIconTrash, svgIconTrophy, svgIconUser, svgIconUserEmpty, svgIconUserEmptyD, svgIconVk, svgIconWarningT, t };
|
|
5353
5541
|
//# sourceMappingURL=morozeckiy-dd-lib.mjs.map
|