@datarailsshared/datarailsshared 1.4.112 → 1.4.114
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/bundles/datarailsshared-datarailsshared.umd.js +87 -34
- package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
- package/datarailsshared-datarailsshared-1.4.114.tgz +0 -0
- package/datarailsshared-datarailsshared.metadata.json +1 -1
- package/esm2015/lib/dr-dialog/components/dialog-modal-wrapper/dialog-modal-wrapper.component.js +3 -3
- package/esm2015/lib/dr-dialog/components/dialog-wrapper/dialog-wrapper.component.js +1 -1
- package/esm2015/lib/dr-error/dr-error.component.js +21 -7
- package/esm2015/lib/dr-inputs/button/button.component.js +3 -2
- package/esm2015/lib/dr-inputs/date-pickers/dr-date-picker-with-timeframe/dr-date-picker-with-timeframe.component.js +30 -10
- package/esm2015/lib/dr-tooltip/dr-tooltip.directive.js +18 -6
- package/fesm2015/datarailsshared-datarailsshared.js +78 -33
- package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
- package/lib/dr-error/dr-error.component.d.ts +5 -2
- package/lib/dr-inputs/button/button.component.d.ts +1 -0
- package/lib/dr-inputs/date-pickers/dr-date-picker-with-timeframe/dr-date-picker-with-timeframe.component.d.ts +8 -8
- package/lib/dr-tooltip/dr-tooltip.directive.d.ts +4 -1
- package/package.json +1 -1
- package/datarailsshared-datarailsshared-1.4.112.tgz +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Component, ViewEncapsulation, Input, Output, ChangeDetectionStrategy, ChangeDetectorRef, forwardRef, ElementRef, Inject, PLATFORM_ID, ContentChildren, Renderer2, HostBinding, ContentChild, Pipe, TemplateRef, HostListener, Directive, ComponentFactoryResolver, ViewContainerRef, ViewChild, Injector, Injectable, Host,
|
|
3
|
-
import { FormControl, NG_VALUE_ACCESSOR, FormGroup, NgModel, FormsModule, ReactiveFormsModule, NgControl } from '@angular/forms';
|
|
2
|
+
import { EventEmitter, Component, ViewEncapsulation, Input, Output, ChangeDetectionStrategy, ChangeDetectorRef, forwardRef, ElementRef, Inject, PLATFORM_ID, ContentChildren, Renderer2, HostBinding, ContentChild, Pipe, TemplateRef, HostListener, Directive, ComponentFactoryResolver, ViewContainerRef, ViewChild, Injector, Injectable, Host, Optional, NgModule } from '@angular/core';
|
|
3
|
+
import { FormControl, NG_VALUE_ACCESSOR, FormGroupDirective, FormGroup, NgModel, FormsModule, ReactiveFormsModule, NgControl } from '@angular/forms';
|
|
4
4
|
import { DateAdapter, MAT_DATE_LOCALE, MAT_DATE_FORMATS, MatNativeDateModule } from '@angular/material/core';
|
|
5
5
|
import { MomentDateAdapter, MAT_MOMENT_DATE_ADAPTER_OPTIONS, MatMomentDateModule } from '@angular/material-moment-adapter';
|
|
6
6
|
import * as momentImported from 'moment';
|
|
@@ -251,7 +251,7 @@ const MONTH_FORMATS = {
|
|
|
251
251
|
monthYearA11yLabel: 'MMMM YYYY'
|
|
252
252
|
},
|
|
253
253
|
};
|
|
254
|
-
const ɵ0$
|
|
254
|
+
const ɵ0$8 = MONTH_FORMATS;
|
|
255
255
|
class MonthTagComponent extends AnyTagComponent {
|
|
256
256
|
constructor() {
|
|
257
257
|
super();
|
|
@@ -310,7 +310,7 @@ MonthTagComponent.decorators = [
|
|
|
310
310
|
useClass: MomentDateAdapter,
|
|
311
311
|
deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
312
312
|
},
|
|
313
|
-
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$
|
|
313
|
+
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$8 },
|
|
314
314
|
]
|
|
315
315
|
},] }
|
|
316
316
|
];
|
|
@@ -432,7 +432,7 @@ const WEEK_FORMATS = {
|
|
|
432
432
|
monthYearA11yLabel: 'MMMM YYYY'
|
|
433
433
|
},
|
|
434
434
|
};
|
|
435
|
-
const ɵ0$
|
|
435
|
+
const ɵ0$7 = WEEK_FORMATS;
|
|
436
436
|
class WeekTagComponent extends AnyTagComponent {
|
|
437
437
|
constructor() {
|
|
438
438
|
super();
|
|
@@ -528,7 +528,7 @@ WeekTagComponent.decorators = [
|
|
|
528
528
|
useClass: MomentDateAdapter,
|
|
529
529
|
deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
530
530
|
},
|
|
531
|
-
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$
|
|
531
|
+
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$7 },
|
|
532
532
|
]
|
|
533
533
|
},] }
|
|
534
534
|
];
|
|
@@ -550,7 +550,7 @@ const YEAR_FORMATS = {
|
|
|
550
550
|
monthYearA11yLabel: 'MMMM YYYY'
|
|
551
551
|
},
|
|
552
552
|
};
|
|
553
|
-
const ɵ0$
|
|
553
|
+
const ɵ0$6 = YEAR_FORMATS;
|
|
554
554
|
class YearTagComponent extends AnyTagComponent {
|
|
555
555
|
constructor() {
|
|
556
556
|
super();
|
|
@@ -615,7 +615,7 @@ YearTagComponent.decorators = [
|
|
|
615
615
|
useClass: MomentDateAdapter,
|
|
616
616
|
deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
617
617
|
},
|
|
618
|
-
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$
|
|
618
|
+
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$6 },
|
|
619
619
|
]
|
|
620
620
|
},] }
|
|
621
621
|
];
|
|
@@ -729,7 +729,7 @@ const DAY_FORMATS = {
|
|
|
729
729
|
monthYearA11yLabel: 'MMMM YYYY'
|
|
730
730
|
},
|
|
731
731
|
};
|
|
732
|
-
const ɵ0$
|
|
732
|
+
const ɵ0$5 = DAY_FORMATS;
|
|
733
733
|
class DayTagComponent extends AnyTagComponent {
|
|
734
734
|
constructor() {
|
|
735
735
|
super();
|
|
@@ -780,7 +780,7 @@ DayTagComponent.decorators = [
|
|
|
780
780
|
useClass: MomentDateAdapter,
|
|
781
781
|
deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
782
782
|
},
|
|
783
|
-
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$
|
|
783
|
+
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$5 },
|
|
784
784
|
]
|
|
785
785
|
},] }
|
|
786
786
|
];
|
|
@@ -1553,26 +1553,37 @@ TooltipComponent.propDecorators = {
|
|
|
1553
1553
|
unsetMouseOn: [{ type: HostListener, args: ['mouseleave',] }]
|
|
1554
1554
|
};
|
|
1555
1555
|
|
|
1556
|
+
const getOverlayPosition = (position) => (Object.assign({}, POPUP_POSITIONS[position]));
|
|
1557
|
+
const ɵ0$4 = getOverlayPosition;
|
|
1556
1558
|
class DrTooltipDirective {
|
|
1557
1559
|
constructor(overlay, overlayPositionBuilder, elementRef) {
|
|
1558
1560
|
this.overlay = overlay;
|
|
1559
1561
|
this.overlayPositionBuilder = overlayPositionBuilder;
|
|
1560
1562
|
this.elementRef = elementRef;
|
|
1561
1563
|
this.contentContext = {};
|
|
1562
|
-
this.
|
|
1564
|
+
this._position = 'top';
|
|
1563
1565
|
this.class = '';
|
|
1564
1566
|
// is used for preserve tooltip from being hidden for N milliseconds
|
|
1565
1567
|
this.drTooltipMousleaveTimeout = 0;
|
|
1568
|
+
this.overlayPosition = getOverlayPosition(this.position);
|
|
1569
|
+
}
|
|
1570
|
+
get position() {
|
|
1571
|
+
return this._position;
|
|
1572
|
+
}
|
|
1573
|
+
set position(value) {
|
|
1574
|
+
this._position = value;
|
|
1575
|
+
this.overlayPosition = getOverlayPosition(value);
|
|
1566
1576
|
}
|
|
1567
1577
|
set drTooltipOptions(options) {
|
|
1568
1578
|
if (options === null || options === void 0 ? void 0 : options.indent) {
|
|
1569
|
-
const position =
|
|
1570
|
-
if (position.offsetY) {
|
|
1579
|
+
const position = getOverlayPosition(this.position);
|
|
1580
|
+
if (position === null || position === void 0 ? void 0 : position.offsetY) {
|
|
1571
1581
|
position.offsetY = position.offsetY < 0 ? -options.indent : options.indent;
|
|
1572
1582
|
}
|
|
1573
|
-
if (position.offsetX) {
|
|
1583
|
+
if (position === null || position === void 0 ? void 0 : position.offsetX) {
|
|
1574
1584
|
position.offsetX = position.offsetX < 0 ? -options.indent : options.indent;
|
|
1575
1585
|
}
|
|
1586
|
+
this.overlayPosition = position;
|
|
1576
1587
|
}
|
|
1577
1588
|
this.options = options;
|
|
1578
1589
|
}
|
|
@@ -1627,7 +1638,7 @@ class DrTooltipDirective {
|
|
|
1627
1638
|
}
|
|
1628
1639
|
}
|
|
1629
1640
|
createOverlay() {
|
|
1630
|
-
const positionStrategy = this.overlayPositionBuilder.flexibleConnectedTo(this.elementRef).withPositions([
|
|
1641
|
+
const positionStrategy = this.overlayPositionBuilder.flexibleConnectedTo(this.elementRef).withPositions([this.overlayPosition]);
|
|
1631
1642
|
this.overlayRef = this.overlay.create({ positionStrategy });
|
|
1632
1643
|
}
|
|
1633
1644
|
renderTooltip() {
|
|
@@ -1926,7 +1937,7 @@ class DrButtonComponent {
|
|
|
1926
1937
|
DrButtonComponent.decorators = [
|
|
1927
1938
|
{ type: Component, args: [{
|
|
1928
1939
|
selector: 'dr-button',
|
|
1929
|
-
template: "<button (click)=\"onClick($event)\" [disabled]=\"_disabled\" [attr.is-loading]=\"_isLoading\" [attr.bold]=\"isBold\"\n [attr.icon]=\"!!icon\" [attr.iconAfterLabel]=\"!!iconAfterLabel\" [attr.theme]=\"theme\">\n <ng-container *ngIf=\"!_isLoading\">\n <i *ngIf=\"icon\" class=\"dr\" [class]=\"icon\" [style.color]=\"iconColor || 'inherit'\"></i>\n <ng-content></ng-content>\n <i *ngIf=\"theme === 'dropdown'\" class=\"dr-icon-arrow-down\"></i>\n <i *ngIf=\"iconAfterLabel\" class=\"dr dr-last\" [class]=\"iconAfterLabel\"\n [style.color]=\"iconColor || 'inherit'\"></i>\n </ng-container>\n <i *ngIf=\"_isLoading\" class=\"dr dr-spinner dr-icon-load\"></i>\n</button>\n",
|
|
1940
|
+
template: "<button (click)=\"onClick($event)\" [disabled]=\"_disabled\" [attr.is-loading]=\"_isLoading\" [attr.bold]=\"isBold\"\n [attr.icon]=\"!!icon\" [attr.iconAfterLabel]=\"!!iconAfterLabel\" [attr.theme]=\"theme\">\n <ng-container *ngIf=\"!_isLoading\">\n <i *ngIf=\"icon\" class=\"dr\" [class]=\"icon\" [style.font-size]=\"iconSize || '24px'\" [style.color]=\"iconColor || 'inherit'\"></i>\n <ng-content></ng-content>\n <i *ngIf=\"theme === 'dropdown'\" class=\"dr-icon-arrow-down\"></i>\n <i *ngIf=\"iconAfterLabel\" class=\"dr dr-last\" [class]=\"iconAfterLabel\"\n [style.color]=\"iconColor || 'inherit'\"></i>\n </ng-container>\n <i *ngIf=\"_isLoading\" class=\"dr dr-spinner dr-icon-load\"></i>\n</button>\n",
|
|
1930
1941
|
styles: [":host{display:inline-block}:host.disabled,:host.loading{pointer-events:none}:host button[theme]{cursor:pointer;border-radius:16px;padding:5px 16px;font-family:\"Poppins\";font-style:normal;font-weight:400;font-size:14px;line-height:22px;color:#4e566c;border:1px solid #7f7fdd;display:flex;justify-content:space-between;align-items:center;height:32px}:host button[theme] .dr{padding:0;margin-left:5.35px;margin-right:8.64px}:host button[theme] .dr-spinner{animation-name:rotate;animation-iteration-count:infinite;animation-duration:1s}@keyframes rotate{0%{transform:rotate()}to{transform:rotate(360deg)}}:host button[theme][theme~=split-secondary-first],:host button[theme][theme~=split-secondary-last],:host button[theme][theme~=secondary]{padding:5px 16px;background:#ffffff;border-radius:16px;min-width:90px}:host button[theme][theme~=split-secondary-first]:hover:not([disabled]),:host button[theme][theme~=split-secondary-last]:hover:not([disabled]),:host button[theme][theme~=secondary]:hover:not([disabled]){color:#4e566c;transition:.2ms ease-in all;background:#f2f2fb;box-shadow:0 4px 14px #0000001a;border:1px solid #4646ce}:host button[theme][theme~=split-secondary-first]:active,:host button[theme][theme~=split-secondary-last]:active,:host button[theme][theme~=secondary]:active{box-shadow:none;background:#f2f2fb}:host button[theme][theme~=split-secondary-first][disabled],:host button[theme][theme~=split-secondary-last][disabled],:host button[theme][theme~=secondary][disabled]{background:#f0f1f4;color:#727583;border:none;cursor:default;pointer-events:none}:host button[theme][theme~=split-secondary-first][is-loading=true],:host button[theme][theme~=split-secondary-last][is-loading=true],:host button[theme][theme~=secondary][is-loading=true]{justify-content:center;padding:5px 16px;pointer-events:none}:host button[theme][theme~=split-primary-first],:host button[theme][theme~=split-primary-last],:host button[theme][theme~=primary]{background:#4646ce;color:#fff;border:none;min-width:90px}:host button[theme][theme~=split-primary-first]:hover:not([disabled]),:host button[theme][theme~=split-primary-last]:hover:not([disabled]),:host button[theme][theme~=primary]:hover:not([disabled]){transition:.2ms ease-in all;background:linear-gradient(96.89deg,#25258c 0%,#4646ce 100%);box-shadow:0 4px 14px #0000001a;border:none}:host button[theme][theme~=split-primary-first]:active,:host button[theme][theme~=split-primary-last]:active,:host button[theme][theme~=primary]:active{background:#25258c}:host button[theme][theme~=split-primary-first][disabled],:host button[theme][theme~=split-primary-last][disabled],:host button[theme][theme~=primary][disabled]{background:#f0f1f4;color:#727583;border:none;cursor:default;pointer-events:none}:host button[theme][theme~=split-primary-first][is-loading=true],:host button[theme][theme~=split-primary-last][is-loading=true],:host button[theme][theme~=primary][is-loading=true]{justify-content:center;padding:5px 16px;pointer-events:none}:host button[theme][theme~=split-primary-first] .dr,:host button[theme][theme~=split-primary-last] .dr,:host button[theme][theme~=primary] .dr{margin:0}:host button[theme][theme~=split-secondary-first],:host button[theme][theme~=split-secondary-first]:hover,:host button[theme][theme~=split-primary-first],:host button[theme][theme~=split-primary-first]:hover{min-width:unset;border-bottom-right-radius:0;border-top-right-radius:0}:host button[theme][theme~=split-secondary-first][icon=true],:host button[theme][theme~=split-secondary-first]:hover[icon=true],:host button[theme][theme~=split-primary-first][icon=true],:host button[theme][theme~=split-primary-first]:hover[icon=true]{padding-left:6px;padding-right:2px}:host button[theme][theme~=split-secondary-first],:host button[theme][theme~=split-secondary-first]:hover{padding-left:10px;padding-right:8px}:host button[theme][theme~=split-secondary-first][icon=true]{padding-left:6px;padding-right:2px}:host button[theme][theme~=split-primary-first],:host button[theme][theme~=split-primary-first]:hover{padding-left:12px;padding-right:9px}:host button[theme][theme~=split-primary-first],:host button[theme][theme~=split-primary-first]:hover{border-right:1px solid #fff!important}:host button[theme][theme~=split-secondary-first],:host button[theme][theme~=split-secondary-first]:hover{border-right:none!important}:host button[theme][theme~=split-secondary-last],:host button[theme][theme~=split-secondary-last]:hover,:host button[theme][theme~=split-primary-last],:host button[theme][theme~=split-primary-last]:hover{min-width:unset;border-bottom-left-radius:0;border-top-left-radius:0}:host button[theme][theme~=split-secondary-last] .dr,:host button[theme][theme~=split-secondary-last]:hover .dr,:host button[theme][theme~=split-primary-last] .dr,:host button[theme][theme~=split-primary-last]:hover .dr{margin:0}:host button[theme][theme~=split-secondary-last],:host button[theme][theme~=split-secondary-last]:hover{padding-left:8px;padding-right:10px}:host button[theme][theme~=split-secondary-last][icon=true],:host button[theme][theme~=split-secondary-last]:hover[icon=true]{padding-left:2px;padding-right:6px}:host button[theme][theme~=split-primary-last]{padding-left:9px;padding-right:12px}:host button[theme][theme~=split-primary-last][icon=true]{padding-left:1px!important;padding-right:6px}:host button[theme][theme~=split-primary-last]:hover{padding-left:9px;padding-right:12px}:host button[theme][theme~=split-primary-last]:hover[icon=true]{padding-left:1px!important;padding-right:6px}:host button[theme][theme~=split-secondary-last],:host button[theme][theme~=split-secondary-last]:hover{margin-left:-1px}:host button[theme][theme~=danger]{background:#bf1d30;color:#fff;border:none;min-width:90px}:host button[theme][theme~=danger]:hover:not([disabled]){transition:.2ms ease-in all;background:linear-gradient(96.89deg,#740e1a 0%,#bf1d30 100%);box-shadow:0 4px 14px #0000001a;border-radius:16px;border:none}:host button[theme][theme~=danger]:active{background:#740e1a}:host button[theme][theme~=danger][disabled]{background:#f0f1f4;color:#727583;border:none;cursor:default;pointer-events:none}:host button[theme][theme~=danger][is-loading=true]{justify-content:center;padding:5px 16px;pointer-events:none}:host button[theme][theme~=ghost]{background:none;border:none;color:#151b3f;padding:4px 8px}:host button[theme][theme~=ghost] .dr{margin-left:4.5px;margin-right:12.5px}:host button[theme][theme~=ghost]:hover:not([disabled]){color:#4646ce;background:#f2f2fb;border-radius:4px}:host button[theme][theme~=ghost][disabled]{color:#727583;cursor:default;pointer-events:none}:host button[theme][theme~=text-link]{background:none;border:none;color:#0b5af9}:host button[theme][theme~=text-link][disabled]{color:#727583;pointer-events:none}:host button[theme][theme~=primary-icon]{padding:8px;width:28px;height:28px;justify-content:center;color:#fff;background:#4646ce;border:none}:host button[theme][theme~=primary-icon]:hover,:host button[theme][theme~=primary-icon]:active{background:linear-gradient(96.89deg,#131318 0%,#4646ce 100%)}:host button[theme][theme~=primary-icon][disabled]{color:#bcbcbc;background:#e5e6ea;cursor:default;pointer-events:none}:host button[theme][theme~=primary-icon] .dr{margin:0}:host button[theme][theme~=secondary-icon]{background:white;padding:8px;width:28px;height:28px;justify-content:center;color:#4e566c;border:1px solid #7f7fdd}:host button[theme][theme~=secondary-icon]:hover,:host button[theme][theme~=secondary-icon]:active{color:#4646ce;background:#f2f2fb}:host button[theme][theme~=secondary-icon][disabled]{color:#bcbcbc;background:#e5e6ea;border:none;cursor:default;pointer-events:none}:host button[theme][theme~=secondary-icon] .dr{margin:0}:host button[theme][theme~=simple-text]{color:#0c142b;border:none;background:none}:host button[theme][theme~=simple-text] .dr{margin:0 8px 0 0}:host button[theme][theme~=icon]{background:none;padding:8px;width:28px;height:28px;justify-content:center;color:#4e566c;border:none}:host button[theme][theme~=icon]:hover,:host button[theme][theme~=icon]:active{background:#f0f3fc;color:#4646ce}:host button[theme][theme~=icon][disabled]{color:#bcbcbc;border:none;cursor:default;pointer-events:none}:host button[theme][theme~=icon][disabled]:hover,:host button[theme][theme~=icon][disabled]:active{background:none}:host button[theme][theme~=icon] .dr{margin:0}:host button[theme][theme~=dropdown],:host button[theme][theme~=primary-square]{background:#ffffff;border-radius:6px;border:1px solid #c3c4ce;box-shadow:none;min-width:unset}:host button[theme][theme~=dropdown]:hover,:host button[theme][theme~=primary-square]:hover{border-color:#85889c}:host button[theme][theme~=dropdown]:active,:host button[theme][theme~=primary-square]:active{border-color:#4646ce}:host button[theme][theme~=dropdown] i:first-child,:host button[theme][theme~=primary-square] i:first-child{margin-right:3px}:host button[theme][theme~=dropdown] i:last-child,:host button[theme][theme~=primary-square] i:last-child{margin-left:3px}:host button[theme][theme~=dropdown]{padding:0 8px}:host button[theme][theme~=primary-square]{padding:0;-webkit-user-select:none;user-select:none}:host button[theme][theme~=primary-square]:hover{background-color:#f9f7ff;border:1px solid #7e828e}:host button[theme][theme~=primary-square]:active{background-color:#f2f2fb;border:1px solid #4646ce}:host button[theme][theme~=primary-square][disabled]{opacity:.6;pointer-events:none}:host button[theme][theme~=link-btn]{padding:5px 8px;border:none;background:none;border-radius:5px;color:#0c142b}:host button[theme][theme~=link-btn] .dr{margin:0 4px 0 0}:host button[theme][theme~=link-btn] .dr-last{margin-right:0;margin-left:4px}:host button[theme][theme~=link-btn]:hover{background:#f2f2fb;color:#4646ce}:host button[theme][theme~=link-btn]:active{background:#f2f2fb;color:#25258c}:host button[theme][theme~=link-btn]:disabled{background:none;color:#727583}:host button[theme][theme~=link-btn]:disabled .dr{color:#bcbcbc}:host button[theme][bold=true]{font-weight:600}:host button[theme][icon=true]:not([theme~=\"primary-square\"]){padding-left:8px}:host button[theme][icon=false]{justify-content:center}:host.dr-button-selected button[theme][theme~=primary-square],:host.dr-button-selected button[theme][theme~=secondary-icon]{background-color:#f2f2fb;border:1px solid #4646ce}\n"]
|
|
1931
1942
|
},] }
|
|
1932
1943
|
];
|
|
@@ -1938,6 +1949,7 @@ DrButtonComponent.propDecorators = {
|
|
|
1938
1949
|
iconAfterLabel: [{ type: Input }],
|
|
1939
1950
|
isBold: [{ type: Input }],
|
|
1940
1951
|
iconColor: [{ type: Input }],
|
|
1952
|
+
iconSize: [{ type: Input }],
|
|
1941
1953
|
disabled: [{ type: Input }],
|
|
1942
1954
|
isLoading: [{ type: Input }],
|
|
1943
1955
|
click: [{ type: Output }],
|
|
@@ -2972,10 +2984,12 @@ DrLayoutBodyComponent.decorators = [
|
|
|
2972
2984
|
DrLayoutBodyComponent.ctorParameters = () => [];
|
|
2973
2985
|
|
|
2974
2986
|
class DrErrorComponent {
|
|
2975
|
-
constructor(cdr) {
|
|
2987
|
+
constructor(cdr, formGroupDirective) {
|
|
2976
2988
|
this.cdr = cdr;
|
|
2989
|
+
this.formGroupDirective = formGroupDirective;
|
|
2977
2990
|
this.destroyed$ = new Subject();
|
|
2978
2991
|
this.label = 'Field error';
|
|
2992
|
+
this.noIcon = false;
|
|
2979
2993
|
}
|
|
2980
2994
|
set control(value) {
|
|
2981
2995
|
if (value) {
|
|
@@ -2986,6 +3000,14 @@ class DrErrorComponent {
|
|
|
2986
3000
|
});
|
|
2987
3001
|
}
|
|
2988
3002
|
}
|
|
3003
|
+
set controlName(value) {
|
|
3004
|
+
if (!value || typeof value !== 'string')
|
|
3005
|
+
return;
|
|
3006
|
+
if (!this.formGroupDirective) {
|
|
3007
|
+
throw new Error('You must provide a formGroupDirective to use this input');
|
|
3008
|
+
}
|
|
3009
|
+
this.control = this.formGroupDirective.control.get(value);
|
|
3010
|
+
}
|
|
2989
3011
|
get errorString() {
|
|
2990
3012
|
var _a;
|
|
2991
3013
|
if (this._control.hasError('required')) {
|
|
@@ -3004,18 +3026,21 @@ class DrErrorComponent {
|
|
|
3004
3026
|
}
|
|
3005
3027
|
DrErrorComponent.decorators = [
|
|
3006
3028
|
{ type: Component, args: [{
|
|
3007
|
-
template: "<div *ngIf=\"_control.status === 'INVALID' && !_control.pristine\"\n [drTooltip]=\"errorString\"\n class=\"error-container\"\n [class.warning]=\"isWarning\">\n <i class=\"dr-icon-status-error\"></i>\n <span>{{label}}</span>\n</div>\n",
|
|
3029
|
+
template: "<div *ngIf=\"_control.status === 'INVALID' && !_control.pristine\"\n [drTooltip]=\"errorString\"\n class=\"error-container\"\n [class.warning]=\"isWarning\">\n <i *ngIf=\"!noIcon\" class=\"dr-icon-status-error\"></i>\n <span>{{label}}</span>\n</div>\n",
|
|
3008
3030
|
selector: 'dr-error',
|
|
3009
3031
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3010
|
-
styles: [":host{display:flex;margin-top:8px}:host:empty{display:none}:host .error-container{display:flex;align-items:center;cursor:pointer;width:auto;color:#bf1d30}:host .error-container i{font-size:16px;margin-right:2px}:host .error-container span{font-family:\"Poppins\",sans-serif;font-style:normal;font-weight:400;font-size:11px;line-height:20px}:host .error-container.warning{color:#ffb800}:host .error-container.warning span{color:#9e5f00}\n"]
|
|
3032
|
+
styles: [":host{display:flex;margin-top:8px}:host:empty{display:none}:host .error-container{display:flex;align-items:center;cursor:pointer;width:auto;color:#bf1d30}:host .error-container i{font-size:16px;margin-right:2px}:host .error-container span{font-family:\"Poppins\",sans-serif;font-style:normal;font-weight:400;font-size:11px;line-height:20px}:host .error-container.warning{color:#ffb800}:host .error-container.warning span{color:#9e5f00}:host.no-icon{margin-top:2px}:host.no-icon .error-container span{font-size:12px}\n"]
|
|
3011
3033
|
},] }
|
|
3012
3034
|
];
|
|
3013
3035
|
DrErrorComponent.ctorParameters = () => [
|
|
3014
|
-
{ type: ChangeDetectorRef }
|
|
3036
|
+
{ type: ChangeDetectorRef },
|
|
3037
|
+
{ type: FormGroupDirective, decorators: [{ type: Optional }] }
|
|
3015
3038
|
];
|
|
3016
3039
|
DrErrorComponent.propDecorators = {
|
|
3017
3040
|
control: [{ type: Input }],
|
|
3018
|
-
|
|
3041
|
+
controlName: [{ type: Input }],
|
|
3042
|
+
label: [{ type: Input }],
|
|
3043
|
+
noIcon: [{ type: Input }, { type: HostBinding, args: ['class.no-icon',] }]
|
|
3019
3044
|
};
|
|
3020
3045
|
|
|
3021
3046
|
class DialogWrapperComponent {
|
|
@@ -3086,7 +3111,7 @@ DialogWrapperComponent.decorators = [
|
|
|
3086
3111
|
{ type: Component, args: [{
|
|
3087
3112
|
selector: 'dr-dialog-wrapper',
|
|
3088
3113
|
template: "<div class=\"dialog-wrapper\"\n [class.dialog-wrapper--confirmation-no-title]=\"dialogData.theme?.isConfirmation && !dialogData.title\">\n <i class=\"dr-icon-exit\" data-test=\"close_btn\" (click)=\"closeDialog()\" *ngIf=\"!dialogData?.hideCloseBtn\"></i>\n\n <div header class=\"dialog-wrapper__header\" *ngIf=\"dialogData.title\">\n <h1 class=\"dialog-wrapper__header__title\" data-test=\"dialogTitle\">{{ dialogData.title }}</h1>\n <h1 class=\"dialog-wrapper__header__subtitle\" data-test=\"dialogSubtitle\"\n *ngIf=\"dialogData.subtitle\">{{ dialogData.subtitle }}</h1>\n </div>\n <div class=\"dialog-wrapper__content\"\n [class.dialog-wrapper__content--no-padding]=\"dialogData.theme?.contentNoPadding\"\n [ngClass]=\"{ 'flex-position': dialogData.contentIcon?.class && !childComponent }\">\n <span *ngIf=\"dialogData.contentIcon?.class\" class=\"dialog-wrapper__content__icon\">\n <i [ngClass]=\"dialogData.contentIcon.class\" [style.color]=\"dialogData.contentIcon?.color || 'inherit'\"></i>\n </span>\n <span [innerHTML]=\"dialogData.content\"></span>\n <span #content class=\"dialog-wrapper__content__anchor\"> </span>\n </div>\n <div footer class=\"dialog-wrapper__footer\" *ngIf=\"dialogData.cancelButton || dialogData.acceptButton\">\n <div class=\"dialog-wrapper__footer__buttons\">\n <span *ngIf=\"dialogData.customButton\"\n class=\"dialog-wrapper__footer__button-wrapper\"\n [drTooltip]=\"dialogData.customButton.isDisabled && dialogData.tooltips?.customDisabled\">\n <dr-button (click)=\"onDecline()\"\n [theme]=\"'secondary'\"\n [isLoading]=\"isLoading\"\n data-test=\"declineBtn\"\n [disabled]=\"dialogData.customButton.isDisabled\"\n [drTooltip]=\"dialogData.tooltips?.custom\">{{ dialogData.customButton.label }}</dr-button>\n </span>\n <span *ngIf=\"dialogData.cancelButton\"\n class=\"dialog-wrapper__footer__button-wrapper\"\n [drTooltip]=\"dialogData.cancelButton.isDisabled && dialogData.tooltips?.cancelDisabled\">\n <dr-button (click)=\"closeDialog()\"\n [theme]=\"'secondary'\"\n data-test=\"closeBtn\"\n [disabled]=\"dialogData.cancelButton.isDisabled\"\n [drTooltip]=\"dialogData.tooltips?.cancel\">{{ dialogData.cancelButton.label }}</dr-button>\n </span>\n <span *ngIf=\"dialogData.acceptButton\"\n class=\"dialog-wrapper__footer__button-wrapper\"\n [drTooltip]=\"dialogData.acceptButton.isDisabled && dialogData.tooltips?.acceptDisabled\">\n <dr-button (click)=\"onAcceptDialog()\"\n [theme]=\"dialogData.acceptButton?.theme || 'primary'\"\n [isLoading]=\"isLoading\"\n data-test=\"acceptBtn\"\n [disabled]=\"dialogData.acceptButton.isDisabled\"\n [drTooltip]=\"dialogData.tooltips?.accept\">{{ dialogData.acceptButton.label }}</dr-button>\n </span>\n </div>\n </div>\n</div>\n",
|
|
3089
|
-
styles: [":host.small-modal{min-height:188px;max-height:467px;min-width:400px;max-width:400px}:host.medium-modal{min-height:188px;max-height:467px;min-width:632px;max-width:632px}:host.large-modal{min-width:750px;max-width:750px}:host.medium-large-modal{min-width:669px;max-width:669px}:host.xl-modal{min-height:188px;max-height:800px;min-width:1100px;max-width:1100px}:host.xl-custom-modal{min-height:188px;max-height:800px;min-width:1100px;max-width:100%}::ng-deep .dialog-wrapper{display:flex;justify-content:space-between;flex-direction:column;position:relative}::ng-deep .dialog-wrapper>.dr-icon-exit{z-index:1;position:absolute;right:32px;top:20px;color:#51566f;cursor:pointer}::ng-deep .dialog-wrapper__header{display:flex;flex-direction:column;padding:8px 52px 8px 32px;border-bottom:1px solid #e5e6ea}::ng-deep .dialog-wrapper__header__title{color:#151b3f;position:static;font-weight:600;font-size:18px;line-height:24px}::ng-deep .dialog-wrapper__header__subtitle{font-size:14px;line-height:20px;margin:0}::ng-deep .dialog-wrapper--confirmation-no-title{padding-top:16px;height:100%}::ng-deep .dialog-wrapper__content{overflow-y:inherit;font-size:14px;font-weight:400;line-height:22px;padding:24px 32px 32px}::ng-deep .dialog-wrapper__content__anchor{display:none}::ng-deep .dialog-wrapper__content--no-padding{padding:0}::ng-deep .dialog-wrapper__content__icon{margin-right:10px;top:5px;position:relative}::ng-deep .dialog-wrapper__content.flex-position{display:flex}::ng-deep .dialog-wrapper__footer{border-top:1px solid #e5e6ea}::ng-deep .dialog-wrapper__footer__buttons{display:flex;justify-content:flex-end;padding
|
|
3114
|
+
styles: [":host.small-modal{min-height:188px;max-height:467px;min-width:400px;max-width:400px}:host.medium-modal{min-height:188px;max-height:467px;min-width:632px;max-width:632px}:host.large-modal{min-width:750px;max-width:750px}:host.medium-large-modal{min-width:669px;max-width:669px}:host.xl-modal{min-height:188px;max-height:800px;min-width:1100px;max-width:1100px}:host.xl-custom-modal{min-height:188px;max-height:800px;min-width:1100px;max-width:100%}::ng-deep .dialog-wrapper{display:flex;justify-content:space-between;flex-direction:column;position:relative}::ng-deep .dialog-wrapper>.dr-icon-exit{z-index:1;position:absolute;right:32px;top:20px;color:#51566f;cursor:pointer}::ng-deep .dialog-wrapper__header{display:flex;flex-direction:column;padding:8px 52px 8px 32px;border-bottom:1px solid #e5e6ea}::ng-deep .dialog-wrapper__header__title{color:#151b3f;position:static;font-weight:600;font-size:18px;line-height:24px}::ng-deep .dialog-wrapper__header__subtitle{font-size:14px;line-height:20px;margin:0}::ng-deep .dialog-wrapper--confirmation-no-title{padding-top:16px;height:100%}::ng-deep .dialog-wrapper__content{overflow-y:inherit;font-size:14px;font-weight:400;line-height:22px;padding:24px 32px 32px}::ng-deep .dialog-wrapper__content__anchor{display:none}::ng-deep .dialog-wrapper__content--no-padding{padding:0}::ng-deep .dialog-wrapper__content__icon{margin-right:10px;top:5px;position:relative}::ng-deep .dialog-wrapper__content.flex-position{display:flex}::ng-deep .dialog-wrapper__footer{border-top:1px solid #e5e6ea}::ng-deep .dialog-wrapper__footer__buttons{display:flex;justify-content:flex-end;padding:11px 32px}::ng-deep .dialog-wrapper__footer__buttons>dr-button:nth-child(n+2){margin-left:12px}::ng-deep .dialog-wrapper__footer__button-wrapper:nth-child(n+2){margin-left:12px}\n"]
|
|
3090
3115
|
},] }
|
|
3091
3116
|
];
|
|
3092
3117
|
DialogWrapperComponent.ctorParameters = () => [
|
|
@@ -3174,8 +3199,8 @@ class DialogModalWrapperComponent {
|
|
|
3174
3199
|
DialogModalWrapperComponent.decorators = [
|
|
3175
3200
|
{ type: Component, args: [{
|
|
3176
3201
|
selector: 'dr-dialog-modal-wrapper',
|
|
3177
|
-
template: "<div header class=\"header-dialog\">\n <h1 class=\"title-dialog\" data-test=\"modalTitle\">{{ dialogData.title }}</h1>\n <i mat-icon-button *ngIf=\"!dialogData.hideCloseBtn\" (click)=\"closeDialog()\" class=\"dr-icon-exit icon-close\"\n data-test=\"xBtn\"></i>\n</div>\n<div *ngIf=\"dialogData.content\" class=\"content-dialog\">\n <ng-container>{{ dialogData.content }}</ng-container>\n <span #content class=\"content-anchor\"></span>\n</div>\n<form *ngIf=\"dialogData.fields\" [formGroup]=\"form\" class=\"dr-smart-from\">\n <div class=\"dr-smart-form_wrapper\">\n <div *ngFor=\"let field of dialogData.fields\" class=\"dr-smart-form_group\"\n [ngStyle]=\"{ display: field.isLabelFullWidth ? 'block' : 'flex' }\">\n <label *ngIf=\"field.label && field.type !== dialogFieldType.CHECKBOX\"\n [ngClass]=\"field.isLabelFullWidth ? 'col-md-12 mb-2' : 'col-md-2'\"\n class=\"label p-0 d-flex align-items-center\">{{ field.label }}</label>\n <div class=\"input-group p-0\"\n [ngClass]=\"{ 'col-md-10': field.label && !field.isLabelFullWidth, 'col-md-12': !field.label || field.isLabelFullWidth }\">\n <dr-select *ngIf=\"field.type === dialogFieldType.SELECT\"\n [searchable]=\"dialogData.searchable\"\n [clearable]=\"dialogData.clearable\"\n [formControlName]=\"field.name\"\n [bindLabel]=\"field.bindLabel || null\"\n [bindValue]=\"field.bindValue || null\"\n [selectedItem]=\"field.default\"\n [items]=\"field.items || (field.items$ | async)\"\n [required]=\"true\"\n [placeholder]=\"field.placeholder\">\n <ng-template *ngIf=\"dialogData?.footerTemplateData\" #optionFooterTemplate let-item=\"item\" let-close=\"close\">\n <button (click)=\"footerAction(); close();\" class=\"dr-select-footer__btn\">\n <i *ngIf=\"dialogData.footerTemplateData.icon\"\n class=\"{{ dialogData.footerTemplateData.icon }}\"></i>\n {{ dialogData.footerTemplateData.label }}</button>\n </ng-template>\n </dr-select>\n <dr-input *ngIf=\"field.type === dialogFieldType.INPUT\" data-test=\"modalInput\" class=\"form-control\"\n [formControlName]=\"field.name\" [placeholder]=\"field.placeholder\"></dr-input>\n <dr-date-picker *ngIf=\"field.type === dialogFieldType.DATE_PICKER\"\n [formControlName]=\"field.name\"\n [format]=\"field.datePickerFormat\"\n [placeholder]=\"field.placeholder\"></dr-date-picker>\n <dr-checkbox *ngIf=\"field.type === dialogFieldType.CHECKBOX\" [formControlName]=\"field.name\">\n {{ field.label }}\n </dr-checkbox>\n <label class=\"form-error-alert\" *ngIf=\"dialogData.errorMessage && !form.pristine && form.invalid\">\n {{ dialogData.errorMessage }}\n </label>\n <label class=\"form-error-alert\"\n *ngIf=\"form.valid && showServerErrorMessage && dialogData.serverErrorMessage\">\n {{ dialogData.serverErrorMessage }}\n </label>\n </div>\n </div>\n </div>\n</form>\n\n<div footer class=\"footer-dialog\">\n <div class=\"buttons-wrapper\" *ngIf=\"dialogData.cancelButton || dialogData.acceptButton\">\n <dr-button *ngIf=\"dialogData.cancelButton\" data-test=\"modalCloseBtn\" (click)=\"closeDialog()\"\n [theme]=\"'secondary'\">{{ dialogData.cancelButton.label }}</dr-button>\n <dr-button *ngIf=\"dialogData.acceptButton\" data-test=\"modalAddBtn\" (click)=\"onAccept()\" [theme]=\"'primary'\"\n [isLoading]=\"isLoading\" [disabled]=\"form.invalid\">{{ dialogData.acceptButton.label }}</dr-button>\n </div>\n</div>\n",
|
|
3178
|
-
styles: [":host{display:flex;justify-content:space-between;flex-direction:column}:host.small-modal{min-height:188px;max-height:467px;min-width:400px;max-width:400px}:host.medium-modal{min-height:188px;max-height:467px;min-width:632px;max-width:632px}.header-dialog{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:8px 39px 8px 32px;border-bottom:1px solid #e5e6ea}.title-dialog{color:#151b3f;position:static;font-weight:bold;font-size:18px;line-height:24px}.content-dialog{font-weight:400;font-size:14px;padding:16px 32px 5px}.icon-close{color:#51566f;cursor:pointer}.dr-smart-from{font-size:14px;font-weight:500;line-height:22px;padding:16px 32px 22px}.dr-smart-from dr-checkbox{font-weight:400}.content-dialog{padding:16px 32px 0;font-weight:400;font-size:14px;line-height:22px}.content-anchor{display:none}.footer-dialog{border-top:1px solid #e5e6ea}.buttons-wrapper{display:flex;justify-content:flex-end;padding-top:10px;padding-right:32px;padding-bottom:11px}.buttons-wrapper dr-button:nth-of-type(2){margin-left:12px}.form-error-alert{position:absolute;margin-top:5px;font-size:12px;color:red}.dr-select-footer__btn{background-color:transparent;display:flex;align-items:center;justify-content:flex-start;cursor:pointer;min-width:15rem;font-style:normal;font-weight:400;font-size:14px;line-height:24px;clear:both;width:100%;white-space:nowrap;padding:0 12px;height:36px;flex-shrink:0}\n"]
|
|
3202
|
+
template: "<div header class=\"header-dialog\">\n <h1 class=\"title-dialog\" data-test=\"modalTitle\">{{ dialogData.title }}</h1>\n <i mat-icon-button *ngIf=\"!dialogData.hideCloseBtn\" (click)=\"closeDialog()\" class=\"dr-icon-exit icon-close\"\n data-test=\"xBtn\"></i>\n</div>\n<div *ngIf=\"dialogData.content\" class=\"content-dialog\">\n <ng-container>{{ dialogData.content }}</ng-container>\n <span #content class=\"content-anchor\"></span>\n</div>\n<form *ngIf=\"dialogData.fields\" [formGroup]=\"form\" class=\"dr-smart-from\">\n <div class=\"dr-smart-form_wrapper\">\n <div *ngFor=\"let field of dialogData.fields\" class=\"dr-smart-form_group\"\n [ngStyle]=\"{ display: field.isLabelFullWidth ? 'block' : 'flex' }\">\n <label *ngIf=\"field.label && field.type !== dialogFieldType.CHECKBOX\"\n [ngClass]=\"field.isLabelFullWidth ? 'col-md-12 mb-2' : 'col-md-2'\"\n class=\"label p-0 d-flex align-items-center\">{{ field.label }}</label>\n <div class=\"input-group p-0\"\n [ngClass]=\"{ 'col-md-10': field.label && !field.isLabelFullWidth, 'col-md-12': !field.label || field.isLabelFullWidth }\">\n <dr-select *ngIf=\"field.type === dialogFieldType.SELECT\"\n [searchable]=\"dialogData.searchable\"\n [clearable]=\"dialogData.clearable\"\n [formControlName]=\"field.name\"\n [bindLabel]=\"field.bindLabel || null\"\n [bindValue]=\"field.bindValue || null\"\n [selectedItem]=\"field.default\"\n [items]=\"field.items || (field.items$ | async)\"\n [required]=\"true\"\n [placeholder]=\"field.placeholder\">\n <ng-template *ngIf=\"dialogData?.footerTemplateData\" #optionFooterTemplate let-item=\"item\" let-close=\"close\">\n <button (click)=\"footerAction(); close();\" class=\"dr-select-footer__btn\">\n <i *ngIf=\"dialogData.footerTemplateData.icon\"\n class=\"{{ dialogData.footerTemplateData.icon }}\"></i>\n {{ dialogData.footerTemplateData.label }}</button>\n </ng-template>\n </dr-select>\n <dr-input *ngIf=\"field.type === dialogFieldType.INPUT\" data-test=\"modalInput\" class=\"form-control\"\n [formControlName]=\"field.name\" [placeholder]=\"field.placeholder\"></dr-input>\n <dr-date-picker *ngIf=\"field.type === dialogFieldType.DATE_PICKER\"\n [formControlName]=\"field.name\"\n [format]=\"field.datePickerFormat\"\n [placeholder]=\"field.placeholder\"></dr-date-picker>\n <dr-checkbox *ngIf=\"field.type === dialogFieldType.CHECKBOX\" [formControlName]=\"field.name\">\n {{ field.label }}\n </dr-checkbox>\n <label class=\"form-field-error-alert\" *ngIf=\"form.invalid && form.controls[field.name]?.dirty && form.controls[field.name]?.errors\">\n {{ form.controls[field.name].errors.errorString }}\n </label>\n <label class=\"form-error-alert\" *ngIf=\"dialogData.errorMessage && !form.pristine && form.invalid\">\n {{ dialogData.errorMessage }}\n </label>\n <label class=\"form-error-alert\"\n *ngIf=\"form.valid && showServerErrorMessage && dialogData.serverErrorMessage\">\n {{ dialogData.serverErrorMessage }}\n </label>\n </div>\n </div>\n </div>\n</form>\n\n<div footer class=\"footer-dialog\">\n <div class=\"buttons-wrapper\" *ngIf=\"dialogData.cancelButton || dialogData.acceptButton\">\n <dr-button *ngIf=\"dialogData.cancelButton\" data-test=\"modalCloseBtn\" (click)=\"closeDialog()\"\n [theme]=\"'secondary'\">{{ dialogData.cancelButton.label }}</dr-button>\n <dr-button *ngIf=\"dialogData.acceptButton\" data-test=\"modalAddBtn\" (click)=\"onAccept()\" [theme]=\"'primary'\"\n [isLoading]=\"isLoading\" [disabled]=\"form.invalid\">{{ dialogData.acceptButton.label }}</dr-button>\n </div>\n</div>\n",
|
|
3203
|
+
styles: [":host{display:flex;justify-content:space-between;flex-direction:column}:host.small-modal{min-height:188px;max-height:467px;min-width:400px;max-width:400px}:host.medium-modal{min-height:188px;max-height:467px;min-width:632px;max-width:632px}.header-dialog{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:8px 39px 8px 32px;border-bottom:1px solid #e5e6ea}.title-dialog{color:#151b3f;position:static;font-weight:bold;font-size:18px;line-height:24px}.content-dialog{font-weight:400;font-size:14px;padding:16px 32px 5px}.icon-close{color:#51566f;cursor:pointer}.dr-smart-from{font-size:14px;font-weight:500;line-height:22px;padding:16px 32px 22px}.dr-smart-from dr-checkbox{font-weight:400}.content-dialog{padding:16px 32px 0;font-weight:400;font-size:14px;line-height:22px}.content-anchor{display:none}.footer-dialog{border-top:1px solid #e5e6ea}.buttons-wrapper{display:flex;justify-content:flex-end;padding-top:10px;padding-right:32px;padding-bottom:11px}.buttons-wrapper dr-button:nth-of-type(2){margin-left:12px}.form-field-error-alert{font-size:12px;color:#bf1d30;line-height:20px}.form-error-alert{position:absolute;margin-top:5px;font-size:12px;color:red}.dr-select-footer__btn{background-color:transparent;display:flex;align-items:center;justify-content:flex-start;cursor:pointer;min-width:15rem;font-style:normal;font-weight:400;font-size:14px;line-height:24px;clear:both;width:100%;white-space:nowrap;padding:0 12px;height:36px;flex-shrink:0}\n"]
|
|
3179
3204
|
},] }
|
|
3180
3205
|
];
|
|
3181
3206
|
DialogModalWrapperComponent.ctorParameters = () => [
|
|
@@ -3983,12 +4008,14 @@ class DrDatePickerWithTimeframeComponent extends DrDatePickerComponent {
|
|
|
3983
4008
|
// eslint-disable-next-line
|
|
3984
4009
|
this.onChangeFormat = new EventEmitter();
|
|
3985
4010
|
this.pagingSetup = {
|
|
3986
|
-
[TimeframeOption.YEAR]: (forward) => this.
|
|
3987
|
-
[TimeframeOption.QUARTER]: (forward) => this.
|
|
3988
|
-
[TimeframeOption.MONTH]: (forward) => this.
|
|
3989
|
-
[TimeframeOption.DAY]: (forward) => this.
|
|
3990
|
-
[TimeframeOption.WEEK]: (forward) => this.
|
|
4011
|
+
[TimeframeOption.YEAR]: (forward) => this.getNextDate('addCalendarYears', 1, forward),
|
|
4012
|
+
[TimeframeOption.QUARTER]: (forward) => this.getNextDate('addCalendarMonths', 3, forward),
|
|
4013
|
+
[TimeframeOption.MONTH]: (forward) => this.getNextDate('addCalendarMonths', 1, forward),
|
|
4014
|
+
[TimeframeOption.DAY]: (forward) => this.getNextDate('addCalendarDays', 1, forward),
|
|
4015
|
+
[TimeframeOption.WEEK]: (forward) => this.getNextDate('addCalendarDays', 7, forward)
|
|
3991
4016
|
};
|
|
4017
|
+
this.isNextDateDisabled = false;
|
|
4018
|
+
this.isPrevDateDisabled = false;
|
|
3992
4019
|
this.onChangeDebounced$ = new Subject();
|
|
3993
4020
|
datePickerService.isTimeframeSelectionEnabled = true;
|
|
3994
4021
|
datePickerService.format$.pipe(takeUntil(this.destroyed$)).subscribe((value) => {
|
|
@@ -4032,12 +4059,12 @@ class DrDatePickerWithTimeframeComponent extends DrDatePickerComponent {
|
|
|
4032
4059
|
}
|
|
4033
4060
|
pagingClicked(forward) {
|
|
4034
4061
|
if (this.pagingSetup[this.datePickerService.timeframe]) {
|
|
4035
|
-
this.pagingSetup[this.datePickerService.timeframe](forward);
|
|
4062
|
+
const nextValue = this.pagingSetup[this.datePickerService.timeframe](forward);
|
|
4063
|
+
this.pagingDateChange(nextValue);
|
|
4036
4064
|
}
|
|
4037
4065
|
this.datePicker.close();
|
|
4038
4066
|
}
|
|
4039
|
-
pagingDateChange(
|
|
4040
|
-
const newValue = this.dateAdapter[actionCall](this.innerValue, forward ? amount : -amount);
|
|
4067
|
+
pagingDateChange(newValue) {
|
|
4041
4068
|
if (this.paginationDebounce) {
|
|
4042
4069
|
// this is required for not sending extra requests when user quickly clicking on pagination
|
|
4043
4070
|
// here we do the same as in setValueFromMoment(newValue) with difference
|
|
@@ -4050,11 +4077,29 @@ class DrDatePickerWithTimeframeComponent extends DrDatePickerComponent {
|
|
|
4050
4077
|
this.setValueFromMoment(newValue);
|
|
4051
4078
|
}
|
|
4052
4079
|
}
|
|
4080
|
+
writeValue(value) {
|
|
4081
|
+
super.writeValue(value);
|
|
4082
|
+
if (!value)
|
|
4083
|
+
return;
|
|
4084
|
+
this.restrictPagination();
|
|
4085
|
+
}
|
|
4086
|
+
getNextDate(actionCall, amount, forward) {
|
|
4087
|
+
var _a, _b;
|
|
4088
|
+
return (_b = (_a = this.dateAdapter)[actionCall]) === null || _b === void 0 ? void 0 : _b.call(_a, this.innerValue, forward ? amount : -amount);
|
|
4089
|
+
}
|
|
4090
|
+
restrictPagination() {
|
|
4091
|
+
if (!this._min && !this._max)
|
|
4092
|
+
return;
|
|
4093
|
+
const nextValue = this.pagingSetup[this.datePickerService.timeframe](true);
|
|
4094
|
+
const prevValue = this.pagingSetup[this.datePickerService.timeframe](false);
|
|
4095
|
+
this.isNextDateDisabled = this._max && nextValue && nextValue.unix() > this._max.unix();
|
|
4096
|
+
this.isPrevDateDisabled = this._min && prevValue && prevValue.unix() < this._min.unix();
|
|
4097
|
+
}
|
|
4053
4098
|
}
|
|
4054
4099
|
DrDatePickerWithTimeframeComponent.decorators = [
|
|
4055
4100
|
{ type: Component, args: [{
|
|
4056
4101
|
selector: 'dr-date-picker-with-timeframe',
|
|
4057
|
-
template: "<dr-button theme=\"icon\" icon=\"dr-icon-arrow-left\" (click)=\"pagingClicked(false)\"></dr-button>\n<div class=\"dr-datepicker-input-container\">\n <i *ngIf=\"isDashboardDatepicker\" class=\"dr-icon-date\"></i>\n <div\n class=\"dr-datepicker-input-container__formatted-value-display\"\n (click)=\"datepickerInput.click()\"\n >\n {{ displayedFormattedValue }}\n </div>\n <input\n #datepickerInput\n [(ngModel)]=\"value\"\n (click)=\"datePicker.open()\"\n [matDatepicker]=\"datePicker\"\n [readonly]=\"readonly\"\n [min]=\"_min\"\n [max]=\"_max\"\n />\n</div>\n<dr-button theme=\"icon\" icon=\"dr-icon-arrow-right\" (click)=\"pagingClicked(true)\"></dr-button>\n<mat-datepicker #datePicker\n class=\"dr-timeframe-datepicker\"\n [calendarHeaderComponent]=\"customHeader\"\n (yearSelected)=\"chosenPeriodHandler($event, timeframeOption.YEAR)\"\n (monthSelected)=\"chosenPeriodHandler($event, timeframeOption.MONTH)\">\n</mat-datepicker>\n",
|
|
4102
|
+
template: "<dr-button [disabled]=\"isPrevDateDisabled\" theme=\"icon\" icon=\"dr-icon-arrow-left\" (click)=\"pagingClicked(false)\"></dr-button>\n<div class=\"dr-datepicker-input-container\">\n <i *ngIf=\"isDashboardDatepicker\" class=\"dr-icon-date\"></i>\n <div\n class=\"dr-datepicker-input-container__formatted-value-display\"\n (click)=\"datepickerInput.click()\"\n >\n {{ displayedFormattedValue }}\n </div>\n <input\n #datepickerInput\n [(ngModel)]=\"value\"\n (click)=\"datePicker.open()\"\n [matDatepicker]=\"datePicker\"\n [readonly]=\"readonly\"\n [min]=\"_min\"\n [max]=\"_max\"\n />\n</div>\n<dr-button [disabled]=\"isNextDateDisabled\" theme=\"icon\" icon=\"dr-icon-arrow-right\" (click)=\"pagingClicked(true)\"></dr-button>\n<mat-datepicker #datePicker\n class=\"dr-timeframe-datepicker\"\n [calendarHeaderComponent]=\"customHeader\"\n (yearSelected)=\"chosenPeriodHandler($event, timeframeOption.YEAR)\"\n (monthSelected)=\"chosenPeriodHandler($event, timeframeOption.MONTH)\">\n</mat-datepicker>\n",
|
|
4058
4103
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4059
4104
|
providers: [
|
|
4060
4105
|
{ provide: NG_VALUE_ACCESSOR, useExisting: DrDatePickerWithTimeframeComponent, multi: true },
|