@datarailsshared/datarailsshared 1.3.4 → 1.3.7
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 +1248 -155
- package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
- package/datarailsshared-datarailsshared-1.3.7.tgz +0 -0
- package/datarailsshared-datarailsshared.d.ts +2 -0
- package/datarailsshared-datarailsshared.metadata.json +1 -1
- package/esm2015/datarailsshared-datarailsshared.js +3 -1
- package/esm2015/lib/date-tags/month-tag/month-tag.component.js +3 -2
- package/esm2015/lib/dr-avatar/dr-avatar.component.js +40 -0
- package/esm2015/lib/dr-avatar/dr-avatar.module.js +23 -0
- package/esm2015/lib/dr-dropdown/dr-dropdown-item-show.pipe.js +12 -0
- package/esm2015/lib/dr-dropdown/dr-dropdown-position.directive.js +83 -0
- package/esm2015/lib/dr-dropdown/dr-dropdown.component.js +87 -0
- package/esm2015/lib/dr-dropdown/dr-dropdown.directive.js +73 -0
- package/esm2015/lib/dr-dropdown/dr-dropdown.module.js +34 -0
- package/esm2015/lib/dr-dropdown/dr-dropdown.service.js +24 -0
- package/esm2015/lib/dr-inputs/button/button.component.js +48 -0
- package/esm2015/lib/dr-inputs/checkbox/checkbox.component.js +8 -3
- package/esm2015/lib/dr-inputs/dr-date-picker/dr-date-picker-format.directive.js +47 -0
- package/esm2015/lib/dr-inputs/dr-date-picker/dr-date-picker.component.js +119 -0
- package/esm2015/lib/dr-inputs/dr-input/dr-input.component.js +8 -3
- package/esm2015/lib/dr-inputs/dr-inputs.module.js +12 -5
- package/esm2015/lib/dr-inputs/dr-select/dr-select.component.js +9 -4
- package/esm2015/lib/dr-inputs/radio-button/radio-button.component.js +9 -4
- package/esm2015/lib/dr-popover/dr-popover.component.js +61 -0
- package/esm2015/lib/dr-popover/dr-popover.directive.js +72 -0
- package/esm2015/lib/dr-popover/dr-popover.module.js +23 -0
- package/esm2015/lib/dr-tooltip/dr-tooltip.component.js +30 -0
- package/esm2015/lib/dr-tooltip/dr-tooltip.directive.js +102 -0
- package/esm2015/lib/dr-tooltip/dr-tooltip.module.js +23 -0
- package/esm2015/lib/models/constants.js +97 -0
- package/esm2015/lib/models/datePicker.js +37 -0
- package/esm2015/lib/models/dropdown.js +2 -0
- package/esm2015/public-api.js +41 -23
- package/fesm2015/datarailsshared-datarailsshared.js +1027 -22
- package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
- package/lib/dr-avatar/dr-avatar.component.d.ts +10 -0
- package/lib/dr-avatar/dr-avatar.module.d.ts +2 -0
- package/lib/dr-dropdown/dr-dropdown-item-show.pipe.d.ts +5 -0
- package/lib/dr-dropdown/dr-dropdown-position.directive.d.ts +11 -0
- package/lib/dr-dropdown/dr-dropdown.component.d.ts +21 -0
- package/lib/dr-dropdown/dr-dropdown.directive.d.ts +18 -0
- package/lib/dr-dropdown/dr-dropdown.module.d.ts +2 -0
- package/lib/dr-dropdown/dr-dropdown.service.d.ts +11 -0
- package/lib/dr-inputs/button/button.component.d.ts +14 -0
- package/lib/dr-inputs/checkbox/checkbox.component.d.ts +3 -1
- package/lib/dr-inputs/dr-date-picker/dr-date-picker-format.directive.d.ts +10 -0
- package/lib/dr-inputs/dr-date-picker/dr-date-picker.component.d.ts +28 -0
- package/lib/dr-inputs/dr-input/dr-input.component.d.ts +4 -0
- package/lib/dr-inputs/dr-select/dr-select.component.d.ts +1 -0
- package/lib/dr-inputs/radio-button/radio-button.component.d.ts +3 -0
- package/lib/dr-popover/dr-popover.component.d.ts +16 -0
- package/lib/dr-popover/dr-popover.directive.d.ts +20 -0
- package/lib/dr-popover/dr-popover.module.d.ts +2 -0
- package/lib/dr-tooltip/dr-tooltip.component.d.ts +16 -0
- package/lib/dr-tooltip/dr-tooltip.directive.d.ts +23 -0
- package/lib/dr-tooltip/dr-tooltip.module.d.ts +2 -0
- package/lib/models/constants.d.ts +87 -0
- package/lib/models/datePicker.d.ts +21 -0
- package/lib/models/dropdown.d.ts +43 -0
- package/package.json +1 -1
- package/public-api.d.ts +41 -23
- package/datarailsshared-datarailsshared-1.3.4.tgz +0 -0
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter, Component, ViewEncapsulation, Input, Output, ChangeDetectionStrategy, ChangeDetectorRef, forwardRef, ElementRef, Renderer2, ContentChild, HostBinding, TemplateRef, Directive, HostListener, ComponentFactoryResolver, ViewContainerRef, Inject, ViewChild, Optional, Injectable, Pipe, NgModule } from '@angular/core';
|
|
3
|
+
import { FormControl, NG_VALUE_ACCESSOR, NgControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
3
4
|
import { DateAdapter, MAT_DATE_LOCALE, MAT_DATE_FORMATS, MatNativeDateModule } from '@angular/material/core';
|
|
4
5
|
import { MomentDateAdapter, MAT_MOMENT_DATE_ADAPTER_OPTIONS, MatMomentDateModule } from '@angular/material-moment-adapter';
|
|
5
6
|
import * as momentImported from 'moment';
|
|
7
|
+
import { transition, style, animate, trigger } from '@angular/animations';
|
|
8
|
+
import { Overlay, OverlayPositionBuilder } from '@angular/cdk/overlay';
|
|
9
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
|
6
10
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
11
|
+
import { Subject } from 'rxjs';
|
|
7
12
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
8
13
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
9
14
|
import { MatInputModule } from '@angular/material/input';
|
|
10
15
|
import { MatSelectModule } from '@angular/material/select';
|
|
11
16
|
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
12
17
|
import { NgSelectModule } from '@ng-select/ng-select';
|
|
18
|
+
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
13
19
|
|
|
14
20
|
// import {*} from ""
|
|
15
21
|
class DateTagComponent {
|
|
@@ -234,7 +240,7 @@ const MONTH_FORMATS = {
|
|
|
234
240
|
monthYearA11yLabel: "MMMM YYYY"
|
|
235
241
|
},
|
|
236
242
|
};
|
|
237
|
-
const ɵ0$
|
|
243
|
+
const ɵ0$5 = MONTH_FORMATS;
|
|
238
244
|
class MonthTagComponent extends AnyTagComponent {
|
|
239
245
|
constructor() {
|
|
240
246
|
super();
|
|
@@ -252,7 +258,8 @@ class MonthTagComponent extends AnyTagComponent {
|
|
|
252
258
|
}
|
|
253
259
|
initDate() {
|
|
254
260
|
if (this.defaultValue) {
|
|
255
|
-
this.dateObj.date = moment$5(
|
|
261
|
+
this.dateObj.date = moment$5(this.defaultValue * 1000).utc().format("YYYY-MM");
|
|
262
|
+
this.date = new FormControl(moment$5(this.defaultValue * 1000));
|
|
256
263
|
}
|
|
257
264
|
else {
|
|
258
265
|
this.dateObj.date = moment$5(new Date()).format("YYYY-MM");
|
|
@@ -292,7 +299,7 @@ MonthTagComponent.decorators = [
|
|
|
292
299
|
useClass: MomentDateAdapter,
|
|
293
300
|
deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
294
301
|
},
|
|
295
|
-
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$
|
|
302
|
+
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$5 },
|
|
296
303
|
]
|
|
297
304
|
},] }
|
|
298
305
|
];
|
|
@@ -413,7 +420,7 @@ const WEEK_FORMATS = {
|
|
|
413
420
|
monthYearA11yLabel: "MMMM YYYY"
|
|
414
421
|
},
|
|
415
422
|
};
|
|
416
|
-
const ɵ0$
|
|
423
|
+
const ɵ0$4 = WEEK_FORMATS;
|
|
417
424
|
class WeekTagComponent extends AnyTagComponent {
|
|
418
425
|
constructor() {
|
|
419
426
|
super();
|
|
@@ -509,7 +516,7 @@ WeekTagComponent.decorators = [
|
|
|
509
516
|
useClass: MomentDateAdapter,
|
|
510
517
|
deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
511
518
|
},
|
|
512
|
-
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$
|
|
519
|
+
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$4 },
|
|
513
520
|
]
|
|
514
521
|
},] }
|
|
515
522
|
];
|
|
@@ -531,7 +538,7 @@ const YEAR_FORMATS = {
|
|
|
531
538
|
monthYearA11yLabel: "MMMM YYYY"
|
|
532
539
|
},
|
|
533
540
|
};
|
|
534
|
-
const ɵ0$
|
|
541
|
+
const ɵ0$3 = YEAR_FORMATS;
|
|
535
542
|
class YearTagComponent extends AnyTagComponent {
|
|
536
543
|
constructor() {
|
|
537
544
|
super();
|
|
@@ -595,7 +602,7 @@ YearTagComponent.decorators = [
|
|
|
595
602
|
useClass: MomentDateAdapter,
|
|
596
603
|
deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
597
604
|
},
|
|
598
|
-
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$
|
|
605
|
+
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$3 },
|
|
599
606
|
]
|
|
600
607
|
},] }
|
|
601
608
|
];
|
|
@@ -709,7 +716,7 @@ const DAY_FORMATS = {
|
|
|
709
716
|
monthYearA11yLabel: "MMMM YYYY"
|
|
710
717
|
},
|
|
711
718
|
};
|
|
712
|
-
const ɵ0$
|
|
719
|
+
const ɵ0$2 = DAY_FORMATS;
|
|
713
720
|
class DayTagComponent extends AnyTagComponent {
|
|
714
721
|
constructor() {
|
|
715
722
|
super();
|
|
@@ -761,7 +768,7 @@ DayTagComponent.decorators = [
|
|
|
761
768
|
useClass: MomentDateAdapter,
|
|
762
769
|
deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
763
770
|
},
|
|
764
|
-
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$
|
|
771
|
+
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$2 },
|
|
765
772
|
]
|
|
766
773
|
},] }
|
|
767
774
|
];
|
|
@@ -771,7 +778,8 @@ DayTagComponent.propDecorators = {
|
|
|
771
778
|
};
|
|
772
779
|
|
|
773
780
|
class RadioButtonComponent {
|
|
774
|
-
constructor() {
|
|
781
|
+
constructor(cdr) {
|
|
782
|
+
this.cdr = cdr;
|
|
775
783
|
this.onChange = (onchanges => { });
|
|
776
784
|
this.onTouched = () => { };
|
|
777
785
|
}
|
|
@@ -786,6 +794,7 @@ class RadioButtonComponent {
|
|
|
786
794
|
}
|
|
787
795
|
writeValue(value) {
|
|
788
796
|
this.modelValue = value;
|
|
797
|
+
this.cdr.markForCheck();
|
|
789
798
|
}
|
|
790
799
|
toggleChange(event) {
|
|
791
800
|
if (event.target.checked) {
|
|
@@ -809,9 +818,12 @@ RadioButtonComponent.decorators = [
|
|
|
809
818
|
],
|
|
810
819
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
811
820
|
encapsulation: ViewEncapsulation.ShadowDom,
|
|
812
|
-
styles: ["label input[type=radio].radiobox+span{vertical-align:middle;line-height:20px}input+span,input+span:after,input+span:before{box-sizing:content-box!important;-webkit-box-sizing:content-box!important;-moz-box-sizing:content-box!important}input{visibility:hidden;position:absolute;width:18px;height:18px}label input+span{position:relative;z-index:19;display:inline-block;margin:0 5px 0 0;line-height:17px;min-height:14px;min-width:14px}label input+span:hover{cursor:pointer}label input+span:before{content:\"\";font-size:
|
|
821
|
+
styles: ["label input[type=radio].radiobox+span{vertical-align:middle;line-height:20px}input+span,input+span:after,input+span:before{box-sizing:content-box!important;-webkit-box-sizing:content-box!important;-moz-box-sizing:content-box!important}input{visibility:hidden;position:absolute;width:18px;height:18px}label input+span{position:relative;z-index:19;display:inline-block;margin:0 5px 0 0;line-height:17px;min-height:14px;min-width:14px}label input+span:hover{cursor:pointer}label input+span:before{content:\"\";font-size:14px;border-radius:0;display:inline-block;text-align:center;vertical-align:middle;padding:1px;height:12px;line-height:13px;min-width:12px;margin-right:5px;border:1px solid #C3C4CE;background-color:#fff;font-weight:normal;margin-top:-1px}label input+span:before{border-radius:50%;-moz-border-radius:50%;-webkit-border-radius:50%}label input:checked+span:before,label:hover input:checked+span:before{background:white;border-color:#579bf2;color:#579bf2}label input:checked+span:before,label:hover input:checked+span:before{font-family:\"DataRails\"!important;content:url('data:image/svg+xml; utf8, <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"5\" cy=\"5\" r=\"4.5\" fill=\"%23579BF2\"/></svg> ');color:#579bf2}label input:disabled+span:before{border-color:#bcbcbc}label input[disabled]:checked+span:before{content:url('data:image/svg+xml; utf8, <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><circle cx=\"5\" cy=\"5\" r=\"4.5\" fill=\"%23BCBCBC\"/></svg> ');border-color:#bcbcbc}label span:hover:before{border-color:#85889c}\n"]
|
|
813
822
|
},] }
|
|
814
823
|
];
|
|
824
|
+
RadioButtonComponent.ctorParameters = () => [
|
|
825
|
+
{ type: ChangeDetectorRef }
|
|
826
|
+
];
|
|
815
827
|
RadioButtonComponent.propDecorators = {
|
|
816
828
|
disabled: [{ type: Input }],
|
|
817
829
|
name: [{ type: Input }],
|
|
@@ -819,7 +831,8 @@ RadioButtonComponent.propDecorators = {
|
|
|
819
831
|
};
|
|
820
832
|
|
|
821
833
|
class CheckboxComponent {
|
|
822
|
-
constructor() {
|
|
834
|
+
constructor(cdr) {
|
|
835
|
+
this.cdr = cdr;
|
|
823
836
|
this.disabled = false;
|
|
824
837
|
this.checkedChange = new EventEmitter();
|
|
825
838
|
this.onChange = () => { };
|
|
@@ -827,6 +840,7 @@ class CheckboxComponent {
|
|
|
827
840
|
}
|
|
828
841
|
writeValue(value) {
|
|
829
842
|
this.checkedStatus = value;
|
|
843
|
+
this.cdr.markForCheck();
|
|
830
844
|
}
|
|
831
845
|
registerOnChange(fn) {
|
|
832
846
|
this.onChange = fn;
|
|
@@ -856,6 +870,9 @@ CheckboxComponent.decorators = [
|
|
|
856
870
|
styles: ["input+span{vertical-align:middle;line-height:30px}input+span,input+span:before{box-sizing:content-box!important;-webkit-box-sizing:content-box!important;-moz-box-sizing:content-box!important}input{visibility:hidden;position:absolute}label input+span{position:relative;z-index:19;display:inline-block;margin:0 5px 0 0;line-height:17px;min-height:14px;min-width:14px}label input+span:hover{cursor:pointer}label input+span:before{content:\"\";font-size:14px;border-radius:0;display:inline-block;text-align:center;vertical-align:middle;padding:1px;min-height:12px;line-height:12px;min-width:12px;margin-right:5px;border:1.5px solid #85889C;background-color:#f4f4f4;font-weight:normal;margin-top:-1px}label input+span:before,label:hover input+span:before{background-color:#fff;border-color:#85889c;color:#579bf2;border-radius:2px}label input:checked+span:before,label:hover input:checked+span:before{content:url('data:image/svg+xml; utf8, <svg width=\"12\" height=\"10\" viewBox=\"0 0 12 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"> <path d=\"M1 5L4.5 8.5L11 1.5\" stroke=\"white\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/> </svg>');background:#579BF2;border-color:#579bf2;color:#fff}label input:disabled+span:before{border-color:#bcbcbc;pointer-events:none}label input[disabled]:checked+span:before{background:#BCBCBC;border-color:#bcbcbc;pointer-events:none}label input:not([disabled])+span:hover:after{content:\"\";width:28px;height:28px;background:#F6F7F8;border-radius:50%;position:absolute;left:-6px;top:-5px;z-index:-1}\n"]
|
|
857
871
|
},] }
|
|
858
872
|
];
|
|
873
|
+
CheckboxComponent.ctorParameters = () => [
|
|
874
|
+
{ type: ChangeDetectorRef }
|
|
875
|
+
];
|
|
859
876
|
CheckboxComponent.propDecorators = {
|
|
860
877
|
checkedStatus: [{ type: Input }],
|
|
861
878
|
disabled: [{ type: Input }],
|
|
@@ -883,6 +900,8 @@ class DrInputComponent {
|
|
|
883
900
|
this.placeholder = '';
|
|
884
901
|
this.readonly = false;
|
|
885
902
|
this.clearable = false;
|
|
903
|
+
this.min = null;
|
|
904
|
+
this.max = null;
|
|
886
905
|
this.searchHandler = new EventEmitter();
|
|
887
906
|
this.buttonHandler = new EventEmitter();
|
|
888
907
|
this.tabindex = -1;
|
|
@@ -977,14 +996,14 @@ class DrInputComponent {
|
|
|
977
996
|
DrInputComponent.decorators = [
|
|
978
997
|
{ type: Component, args: [{
|
|
979
998
|
selector: 'dr-input',
|
|
980
|
-
template: "<ng-content select=\"[prefixIcon]\"></ng-content>\r\n<input [(ngModel)]=\"value\"\r\n (ngModelChange)=\"updateChanges()\"\r\n (blur)=\"onTouched()\"\r\n [disabled]=\"_disabled\"\r\n [readonly]=\"readonly\"\r\n [type]=\"type\"\r\n [placeholder]=\"placeholder\">\r\n<span class=\"clear-icon\" (click)=\"writeValue(null)\"></span>\r\n<span *ngIf=\"type === 'search'\" class=\"search-icon\" (click)=\"onSearchClicked($event)\"></span>\r\n<ng-content select=\"[suffixIcon]\"></ng-content>\r\n<button *ngIf=\"_buttonOptions.show || (_buttonOptions.showOnFocus && _buttonOptions.focusSet)\"\r\n (click)=\"onButtonClicked($event)\">\r\n {{_buttonOptions.text}}\r\n</button>\r\n",
|
|
999
|
+
template: "<ng-content select=\"[prefixIcon]\"></ng-content>\r\n<input [(ngModel)]=\"value\"\r\n (ngModelChange)=\"updateChanges()\"\r\n (blur)=\"onTouched()\"\r\n [disabled]=\"_disabled\"\r\n [readonly]=\"readonly\"\r\n [type]=\"type\"\r\n [placeholder]=\"placeholder\"\r\n [matDatepicker]=\"matDatePicker\"\r\n [min]=\"min\"\r\n [max]=\"max\"\r\n>\r\n<span class=\"clear-icon\" (click)=\"writeValue(null)\"></span>\r\n<span *ngIf=\"type === 'search'\" class=\"search-icon\" (click)=\"onSearchClicked($event)\"></span>\r\n<ng-content select=\"[suffixIcon]\"></ng-content>\r\n<button *ngIf=\"_buttonOptions.show || (_buttonOptions.showOnFocus && _buttonOptions.focusSet)\"\r\n (click)=\"onButtonClicked($event)\">\r\n {{_buttonOptions.text}}\r\n</button>\r\n",
|
|
981
1000
|
providers: [{
|
|
982
1001
|
provide: NG_VALUE_ACCESSOR,
|
|
983
1002
|
useExisting: forwardRef(() => DrInputComponent),
|
|
984
1003
|
multi: true
|
|
985
1004
|
}],
|
|
986
1005
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
987
|
-
styles: [":host{position:relative;width:100%;display:flex;flex-direction:row;min-height:32px;height:32px;font-size:14px;font-family:\"Nunito Sans\",sans-serif;border:1px solid #C3C4CE;border-radius:6px;color:#85889c;padding:0 8px;overflow:hidden}:host:hover{border-color:#85889c}:host:focus-within{border-color:#21b8f1!important;color:#151b3f}:host.disabled{pointer-events:none;border:none;color:#85889c;background:#E5E6EA}:host.ng-valid.ng-dirty{border-color:#03a678}:host.ng-invalid.ng-dirty:not(:focus-within){border-color:#de2833!important}:host input{display:flex;flex-grow:1;height:100%;border:none;padding:4px 0;text-align:left}:host input:disabled{border:none;color:#85889c;background:transparent}:host input::-webkit-search-decoration,:host input::-webkit-search-cancel-button,:host input::-webkit-search-results-button,:host input::-webkit-search-results-decoration{-webkit-appearance:none}:host .clear-icon{visibility:hidden}:host.clearable .clear-icon,:host.ng-touched.ng-invalid .clear-icon{visibility:visible;content:url('data:image/svg+xml; utf8, <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M5.91783 5.00001L9.03353 1.88395C9.11924 1.79818 9.16651 1.68374 9.16665 1.56171C9.16665 1.43962 9.11937 1.32504 9.03353 1.2394L8.76047 0.966415C8.67463 0.880433 8.56023 0.833344 8.43808 0.833344C8.31612 0.833344 8.20166 0.880433 8.11582 0.966415L5.00013 4.08227L1.88428 0.966415C1.79858 0.880433 1.68404 0.833344 1.56196 0.833344C1.44001 0.833344 1.32556 0.880433 1.23985 0.966415L0.966646 1.2394C0.788869 1.41719 0.788869 1.70637 0.966646 1.88395L4.08242 5.00001L0.966646 8.11593C0.880873 8.20184 0.833677 8.31628 0.833677 8.43831C0.833677 8.56034 0.880873 8.67478 0.966646 8.76062L1.23978 9.03361C1.32548 9.11952 1.44 9.16668 1.56188 9.16668C1.68397 9.16668 1.7985 9.11952 1.88421 9.03361L5.00005 5.91769L8.11575 9.03361C8.20159 9.11952 8.31605 9.16668 8.438 9.16668H8.43815C8.56017 9.16668 8.67456 9.11952 8.7604 9.03361L9.03346 8.76062C9.11916 8.67484 9.16643 8.56034 9.16643 8.43831C9.16643 8.31628 9.11916 8.20184 9.03346 8.116L5.91783 5.00001Z\" fill=\"%2351566F\"/></svg> ');margin:auto 8px;cursor:pointer}:host span+span,:host span+img{margin-left:0}:host.search-type{padding:0 16px;border-radius:16px}:host.search-type.ng-valid{border-color:#c3c4ce}:host.search-type .search-icon{content:url('data:image/svg+xml; utf8, <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.5816 10.2097C11.4878 10.1157 11.3605 10.0629 11.2277 10.0629H10.8175C10.7473 10.0629 10.6799 10.035 10.6303 9.98534C10.5322 9.88724 10.527 9.73044 10.6132 9.62178C11.4154 8.6112 11.8925 7.33534 11.8925 5.94625C11.8925 2.66209 9.23042 0 5.94625 0C2.66209 0 0 2.66209 0 5.94625C0 9.23042 2.66209 11.8925 5.94625 11.8925C7.33523 11.8925 8.611 11.4155 9.62155 10.6172C9.7304 10.5312 9.88711 10.5366 9.9852 10.6347C10.0349 10.6845 10.0629 10.7519 10.0629 10.8223V11.2277C10.0629 11.3605 10.1157 11.4878 10.2097 11.5816L14.2834 15.6472C14.4787 15.8421 14.795 15.8419 14.9901 15.6468L15.6468 14.9901C15.8419 14.795 15.8421 14.4787 15.6472 14.2834L11.5816 10.2097ZM5.94625 10.0629C3.67296 10.0629 1.82962 8.21955 1.82962 5.94625C1.82962 3.67296 3.67296 1.82962 5.94625 1.82962C8.21955 1.82962 10.0629 3.67296 10.0629 5.94625C10.0629 8.21955 8.21955 10.0629 5.94625 10.0629Z\" fill=\"%23BCBCBC\"/></svg> ');margin:auto 0 auto 8px;cursor:pointer}:host.with-button{padding-right:0}:host.with-button button{color:#0061ff;background:#F6F7F8;height:100%;width:auto;padding:0 8px;display:flex;align-items:center;border:none;border-left:1px solid #C3C4CE}:host ::ng-deep img[prefixIcon],:host ::ng-deep img[suffixIcon],:host ::ng-deep i[prefixIcon],:host ::ng-deep i[suffixIcon]{position:relative;margin:auto 8px}:host ::ng-deep img[prefixIcon],:host ::ng-deep i[prefixIcon]{margin-left:0}:host ::ng-deep img[suffixIcon],:host ::ng-deep i[suffixIcon]{margin-right:0}\n"]
|
|
1006
|
+
styles: [":host{position:relative;width:100%;display:flex;flex-direction:row;min-height:32px;height:32px;font-size:14px;font-family:\"Nunito Sans\",sans-serif;border:1px solid #C3C4CE;border-radius:6px;color:#85889c;padding:0 8px;overflow:hidden}:host:hover{border-color:#85889c}:host:focus-within{border-color:#21b8f1!important;color:#151b3f}:host.disabled{pointer-events:none;border:none;color:#85889c;background:#E5E6EA}:host.ng-valid.ng-dirty{border-color:#03a678}:host.ng-invalid.ng-dirty:not(:focus-within){border-color:#de2833!important}:host.ng-untouched.ng-valid{border-color:#c3c4ce}:host input{display:flex;flex-grow:1;height:100%;border:none;padding:4px 0;text-align:left}:host input:disabled{border:none;color:#85889c;background:transparent}:host input::-webkit-search-decoration,:host input::-webkit-search-cancel-button,:host input::-webkit-search-results-button,:host input::-webkit-search-results-decoration{-webkit-appearance:none}:host .clear-icon{visibility:hidden}:host.clearable .clear-icon,:host.ng-touched.ng-invalid .clear-icon{visibility:visible;content:url('data:image/svg+xml; utf8, <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M5.91783 5.00001L9.03353 1.88395C9.11924 1.79818 9.16651 1.68374 9.16665 1.56171C9.16665 1.43962 9.11937 1.32504 9.03353 1.2394L8.76047 0.966415C8.67463 0.880433 8.56023 0.833344 8.43808 0.833344C8.31612 0.833344 8.20166 0.880433 8.11582 0.966415L5.00013 4.08227L1.88428 0.966415C1.79858 0.880433 1.68404 0.833344 1.56196 0.833344C1.44001 0.833344 1.32556 0.880433 1.23985 0.966415L0.966646 1.2394C0.788869 1.41719 0.788869 1.70637 0.966646 1.88395L4.08242 5.00001L0.966646 8.11593C0.880873 8.20184 0.833677 8.31628 0.833677 8.43831C0.833677 8.56034 0.880873 8.67478 0.966646 8.76062L1.23978 9.03361C1.32548 9.11952 1.44 9.16668 1.56188 9.16668C1.68397 9.16668 1.7985 9.11952 1.88421 9.03361L5.00005 5.91769L8.11575 9.03361C8.20159 9.11952 8.31605 9.16668 8.438 9.16668H8.43815C8.56017 9.16668 8.67456 9.11952 8.7604 9.03361L9.03346 8.76062C9.11916 8.67484 9.16643 8.56034 9.16643 8.43831C9.16643 8.31628 9.11916 8.20184 9.03346 8.116L5.91783 5.00001Z\" fill=\"%2351566F\"/></svg> ');margin:auto 8px;cursor:pointer}:host span+span,:host span+img{margin-left:0}:host.search-type{padding:0 16px;border-radius:16px}:host.search-type.ng-valid{border-color:#c3c4ce}:host.search-type .search-icon{content:url('data:image/svg+xml; utf8, <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M11.5816 10.2097C11.4878 10.1157 11.3605 10.0629 11.2277 10.0629H10.8175C10.7473 10.0629 10.6799 10.035 10.6303 9.98534C10.5322 9.88724 10.527 9.73044 10.6132 9.62178C11.4154 8.6112 11.8925 7.33534 11.8925 5.94625C11.8925 2.66209 9.23042 0 5.94625 0C2.66209 0 0 2.66209 0 5.94625C0 9.23042 2.66209 11.8925 5.94625 11.8925C7.33523 11.8925 8.611 11.4155 9.62155 10.6172C9.7304 10.5312 9.88711 10.5366 9.9852 10.6347C10.0349 10.6845 10.0629 10.7519 10.0629 10.8223V11.2277C10.0629 11.3605 10.1157 11.4878 10.2097 11.5816L14.2834 15.6472C14.4787 15.8421 14.795 15.8419 14.9901 15.6468L15.6468 14.9901C15.8419 14.795 15.8421 14.4787 15.6472 14.2834L11.5816 10.2097ZM5.94625 10.0629C3.67296 10.0629 1.82962 8.21955 1.82962 5.94625C1.82962 3.67296 3.67296 1.82962 5.94625 1.82962C8.21955 1.82962 10.0629 3.67296 10.0629 5.94625C10.0629 8.21955 8.21955 10.0629 5.94625 10.0629Z\" fill=\"%23BCBCBC\"/></svg> ');margin:auto 0 auto 8px;cursor:pointer}:host.with-button{padding-right:0}:host.with-button button{color:#0061ff;background:#F6F7F8;height:100%;width:auto;padding:0 8px;display:flex;align-items:center;border:none;border-left:1px solid #C3C4CE}:host ::ng-deep img[prefixIcon],:host ::ng-deep img[suffixIcon],:host ::ng-deep i[prefixIcon],:host ::ng-deep i[suffixIcon]{position:relative;margin:auto 8px}:host ::ng-deep img[prefixIcon],:host ::ng-deep i[prefixIcon]{margin-left:0}:host ::ng-deep img[suffixIcon],:host ::ng-deep i[suffixIcon]{margin-right:0}\n"]
|
|
988
1007
|
},] }
|
|
989
1008
|
];
|
|
990
1009
|
DrInputComponent.ctorParameters = () => [
|
|
@@ -997,6 +1016,9 @@ DrInputComponent.propDecorators = {
|
|
|
997
1016
|
placeholder: [{ type: Input }],
|
|
998
1017
|
readonly: [{ type: Input }],
|
|
999
1018
|
clearable: [{ type: Input }],
|
|
1019
|
+
min: [{ type: Input }],
|
|
1020
|
+
max: [{ type: Input }],
|
|
1021
|
+
matDatePicker: [{ type: Input }],
|
|
1000
1022
|
disabled: [{ type: Input }],
|
|
1001
1023
|
buttonOptions: [{ type: Input }],
|
|
1002
1024
|
searchHandler: [{ type: Output }],
|
|
@@ -1012,6 +1034,7 @@ class DrSelectComponent {
|
|
|
1012
1034
|
this.items = [];
|
|
1013
1035
|
this.appendTo = 'body';
|
|
1014
1036
|
this.disabled = false;
|
|
1037
|
+
this.keyDownFn = () => true;
|
|
1015
1038
|
this.onChange = () => { };
|
|
1016
1039
|
this.onTouched = () => { };
|
|
1017
1040
|
}
|
|
@@ -1021,6 +1044,9 @@ class DrSelectComponent {
|
|
|
1021
1044
|
}
|
|
1022
1045
|
registerOnChange(fn) {
|
|
1023
1046
|
this.onChange = fn;
|
|
1047
|
+
if (fn && this.selectedItem) {
|
|
1048
|
+
this.onChange(this.selectedItem);
|
|
1049
|
+
}
|
|
1024
1050
|
}
|
|
1025
1051
|
registerOnTouched(fn) {
|
|
1026
1052
|
this.onTouched = fn;
|
|
@@ -1032,13 +1058,13 @@ class DrSelectComponent {
|
|
|
1032
1058
|
DrSelectComponent.decorators = [
|
|
1033
1059
|
{ type: Component, args: [{
|
|
1034
1060
|
selector: 'dr-select',
|
|
1035
|
-
template: " <ng-select [(ngModel)]=\"selectedItem\"\r\n [items]=\"items\"\r\n [bindLabel]=\"bindLabel\"\r\n [bindValue]=\"bindValue\"\r\n [multiple]=\"multiple\"\r\n [addTag]=\"addTag\"\r\n [appendTo]=\"appendTo\"\r\n [clearable]=\"clearable\"\r\n [searchable]=\"searchable\"\r\n [hideSelected]=\"hideSelected\"\r\n [placeholder]=\"placeholder\"\r\n [loading]=\"loading\"\r\n [readonly]=\"readonly\"\r\n [disabled]=\"disabled\"\r\n [id]=\"id\"\r\n [keyDownFn]=\"keyDownFn\"\r\n [searchFn]=\"searchFn\"\r\n (change)=\"onChange(
|
|
1061
|
+
template: " <ng-select [(ngModel)]=\"selectedItem\"\r\n [items]=\"items\"\r\n [bindLabel]=\"bindLabel\"\r\n [bindValue]=\"bindValue\"\r\n [multiple]=\"multiple\"\r\n [addTag]=\"addTag\"\r\n [appendTo]=\"appendTo\"\r\n [clearable]=\"clearable\"\r\n [searchable]=\"searchable\"\r\n [hideSelected]=\"hideSelected\"\r\n [placeholder]=\"placeholder\"\r\n [loading]=\"loading\"\r\n [readonly]=\"readonly\"\r\n [disabled]=\"disabled\"\r\n [id]=\"id\"\r\n [keyDownFn]=\"keyDownFn\"\r\n [searchFn]=\"searchFn\"\r\n (change)=\"onChange(selectedItem)\"\r\n class=\"dr-select\">\r\n <ng-template *ngIf=\"optionHeaderTemplate\" ng-header-tmp let-item=\"item\">\r\n <ng-container [ngTemplateOutlet]=\"optionHeaderTemplate\" [ngTemplateOutletContext]=\"{item: item}\"></ng-container>\r\n </ng-template>\r\n <ng-template *ngIf=\"labelTemplate\" ng-label-tmp let-item=\"item\">\r\n <ng-container [ngTemplateOutlet]=\"labelTemplate\" [ngTemplateOutletContext]=\"{item: item}\"></ng-container>\r\n </ng-template>\r\n <ng-template *ngIf=\"optionTemplate\" ng-option-tmp let-item=\"item\">\r\n <ng-container [ngTemplateOutlet]=\"optionTemplate\" [ngTemplateOutletContext]=\"{item: item}\"></ng-container>\r\n </ng-template>\r\n </ng-select>\r\n",
|
|
1036
1062
|
providers: [{
|
|
1037
1063
|
provide: NG_VALUE_ACCESSOR,
|
|
1038
1064
|
useExisting: DrSelectComponent,
|
|
1039
1065
|
multi: true
|
|
1040
1066
|
}],
|
|
1041
|
-
styles: [":host{width:100%;height:32px}:host ::ng-deep ng-select.ng-select .ng-select-container{min-height:32px;height:32px;width:100%;border-radius:6px!important;border:1px solid #C3C4CE;box-shadow:none!important}:host ::ng-deep ng-select.ng-select .ng-select-container:hover{border-color:#85889c}:host ::ng-deep ng-select.ng-select .ng-select-container:focus-within{border-color:#21b8f1}:host ::ng-deep ng-select.ng-select .ng-select-container .ng-input{top:0!important;line-height:30px;padding:0 50px 0 8px!important;color:#151b3f;font-size:14px;font-weight:400}:host ::ng-deep ng-select.ng-select .ng-select-container .ng-value-container{padding:0 0 0 8px;height:100%;overflow:auto}:host ::ng-deep ng-select.ng-select .ng-select-container .ng-value-container .ng-value{line-height:1}:host ::ng-deep ng-select.ng-select .ng-select-container .ng-value-container .ng-input{padding:0 0 0 3px!important}:host ::ng-deep ng-select.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{color:#151a41;height:24px;padding:2px 8px;font-size:12px;margin:2px 2px 2px 0;background:#E5E6EA;display:flex;flex-direction:row-reverse;align-items:center;border-radius:12px}:host ::ng-deep ng-select.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value-label{line-height:20px;padding:0!important}:host ::ng-deep ng-select.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value-icon{border:none!important;padding:0 0 0 9px!important;color:#51566f;font-size:16px;font-weight:bold}:host ::ng-deep ng-select.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value-icon,:host ::ng-deep ng-select.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value-icon:hover{background:transparent!important}:host ::ng-deep ng-select.ng-select.ng-select-disabled .ng-select-container,:host ::ng-deep ng-select.ng-select.ng-select-disabled .ng-select-container:hover,:host ::ng-deep ng-select.ng-select.ng-select-disabled .ng-select-container:focus-within{background:#E5E6EA!important;border:1px solid #E5E6EA!important}:host ::ng-deep ng-select.ng-select.ng-select-disabled .ng-select-container .ng-value,:host ::ng-deep ng-select.ng-select.ng-select-disabled .ng-select-container:hover .ng-value,:host ::ng-deep ng-select.ng-select.ng-select-disabled .ng-select-container:focus-within .ng-value{color:#bcbcbc!important}:host ::ng-deep ng-select.ng-select.ng-select-single.ng-invalid.ng-touched .ng-select-container,:host ::ng-deep ng-select.ng-select.ng-select-multiple.ng-invalid.ng-touched .ng-select-container{border-color:#de2833}::ng-deep ng-dropdown-panel.ng-dropdown-panel.dr-select{border:1px solid #DBDEE3;border-radius:6px!important;margin-top:8px!important;overflow:hidden}::ng-deep ng-dropdown-panel.ng-dropdown-panel.dr-select .ng-dropdown-panel-items .ng-option{display:flex;align-items:center;height:36px;padding:
|
|
1067
|
+
styles: [":host{width:100%;height:32px}:host ::ng-deep ng-select.ng-select .ng-select-container{min-height:32px;height:32px;width:100%;border-radius:6px!important;border:1px solid #C3C4CE;box-shadow:none!important}:host ::ng-deep ng-select.ng-select .ng-select-container:hover{border-color:#85889c}:host ::ng-deep ng-select.ng-select .ng-select-container:focus-within{border-color:#21b8f1}:host ::ng-deep ng-select.ng-select .ng-select-container .ng-input{top:0!important;line-height:30px;padding:0 50px 0 8px!important;color:#151b3f;font-size:14px;font-weight:400}:host ::ng-deep ng-select.ng-select .ng-select-container .ng-value-container{padding:0 0 0 8px;height:100%;overflow:auto}:host ::ng-deep ng-select.ng-select .ng-select-container .ng-value-container .ng-value{line-height:1}:host ::ng-deep ng-select.ng-select .ng-select-container .ng-value-container .ng-input{padding:0 0 0 3px!important}:host ::ng-deep ng-select.ng-select.ng-select-multiple .ng-select-container{max-height:58px;height:100%}:host ::ng-deep ng-select.ng-select.ng-select-multiple .ng-select-container .ng-value-container{max-height:58px}:host ::ng-deep ng-select.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{color:#151a41;height:24px;padding:2px 8px;font-size:12px;margin:2px 2px 2px 0;background:#E5E6EA;display:flex;flex-direction:row-reverse;align-items:center;border-radius:12px}:host ::ng-deep ng-select.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value-label{line-height:20px;padding:0!important}:host ::ng-deep ng-select.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value-icon{border:none!important;padding:0 0 0 9px!important;color:#51566f;font-size:16px;font-weight:bold}:host ::ng-deep ng-select.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value-icon,:host ::ng-deep ng-select.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value-icon:hover{background:transparent!important}:host ::ng-deep ng-select.ng-select.ng-select-disabled .ng-select-container,:host ::ng-deep ng-select.ng-select.ng-select-disabled .ng-select-container:hover,:host ::ng-deep ng-select.ng-select.ng-select-disabled .ng-select-container:focus-within{background:#E5E6EA!important;border:1px solid #E5E6EA!important}:host ::ng-deep ng-select.ng-select.ng-select-disabled .ng-select-container .ng-value,:host ::ng-deep ng-select.ng-select.ng-select-disabled .ng-select-container:hover .ng-value,:host ::ng-deep ng-select.ng-select.ng-select-disabled .ng-select-container:focus-within .ng-value{color:#bcbcbc!important}:host ::ng-deep ng-select.ng-select.ng-select-single.ng-invalid.ng-touched .ng-select-container,:host ::ng-deep ng-select.ng-select.ng-select-multiple.ng-invalid.ng-touched .ng-select-container{border-color:#de2833}::ng-deep ng-dropdown-panel.ng-dropdown-panel.dr-select{border:1px solid #DBDEE3;border-radius:6px!important;margin-top:8px!important;overflow:hidden}::ng-deep ng-dropdown-panel.ng-dropdown-panel.dr-select .ng-dropdown-panel-items .ng-option:empty{display:none}::ng-deep ng-dropdown-panel.ng-dropdown-panel.dr-select .ng-dropdown-panel-items .ng-option{display:flex;align-items:center;min-height:36px;padding:10px 12px}::ng-deep ng-dropdown-panel.ng-dropdown-panel.dr-select .ng-dropdown-panel-items .ng-option,::ng-deep ng-dropdown-panel.ng-dropdown-panel.dr-select .ng-dropdown-panel-items .ng-option.ng-option-marked{background:#fff}::ng-deep ng-dropdown-panel.ng-dropdown-panel.dr-select .ng-dropdown-panel-items .ng-option.ng-option-selected,::ng-deep ng-dropdown-panel.ng-dropdown-panel.dr-select .ng-dropdown-panel-items .ng-option.ng-option-selected.ng-option-marked{background:#F3F7FF;color:#151b3f}::ng-deep ng-dropdown-panel.ng-dropdown-panel.dr-select .ng-dropdown-panel-items .ng-option.ng-option-selected span,::ng-deep ng-dropdown-panel.ng-dropdown-panel.dr-select .ng-dropdown-panel-items .ng-option.ng-option-selected.ng-option-marked span{font-weight:normal!important}::ng-deep ng-dropdown-panel.ng-dropdown-panel.dr-select .ng-dropdown-panel-items .ng-option:hover,::ng-deep ng-dropdown-panel.ng-dropdown-panel.dr-select .ng-dropdown-panel-items .ng-option.ng-option-selected:hover,::ng-deep ng-dropdown-panel.ng-dropdown-panel.dr-select .ng-dropdown-panel-items .ng-option.ng-option-selected.ng-option-marked:hover{background:#F6F7F8}\n"]
|
|
1042
1068
|
},] }
|
|
1043
1069
|
];
|
|
1044
1070
|
DrSelectComponent.propDecorators = {
|
|
@@ -1061,7 +1087,267 @@ DrSelectComponent.propDecorators = {
|
|
|
1061
1087
|
keyDownFn: [{ type: Input }],
|
|
1062
1088
|
selectedItem: [{ type: Input }],
|
|
1063
1089
|
labelTemplate: [{ type: ContentChild, args: ['labelTemplate',] }],
|
|
1064
|
-
optionTemplate: [{ type: ContentChild, args: ['optionTemplate',] }]
|
|
1090
|
+
optionTemplate: [{ type: ContentChild, args: ['optionTemplate',] }],
|
|
1091
|
+
optionHeaderTemplate: [{ type: ContentChild, args: ['optionHeaderTemplate',] }]
|
|
1092
|
+
};
|
|
1093
|
+
|
|
1094
|
+
class DrAvatarComponent {
|
|
1095
|
+
constructor() {
|
|
1096
|
+
this.users = [];
|
|
1097
|
+
this.userClicked = new EventEmitter();
|
|
1098
|
+
}
|
|
1099
|
+
ngOnChanges(changes) {
|
|
1100
|
+
var _a;
|
|
1101
|
+
if (changes.users && ((_a = changes.users.currentValue) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
1102
|
+
this.getFirstUsers().forEach((user, index) => user.class = `icon-${index}`);
|
|
1103
|
+
this.getLastUsers().forEach((user) => user.class = `icon-${this.getRandomValue(5)}`);
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
getFirstUsers() {
|
|
1107
|
+
return this.users.slice(0, 2);
|
|
1108
|
+
}
|
|
1109
|
+
getLastUsers() {
|
|
1110
|
+
if (this.users.length > 2) {
|
|
1111
|
+
return this.users.slice(2, this.users.length - 1);
|
|
1112
|
+
}
|
|
1113
|
+
return [];
|
|
1114
|
+
}
|
|
1115
|
+
getRandomValue(limit) {
|
|
1116
|
+
return ~~(limit * Math.random());
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
DrAvatarComponent.decorators = [
|
|
1120
|
+
{ type: Component, args: [{
|
|
1121
|
+
selector: 'dr-avatar',
|
|
1122
|
+
template: "<div class=\"users-section\">\r\n <div class=\"users-section__user\"\r\n [class]=\"user.class\"\r\n *ngFor=\"let user of getFirstUsers()\"\r\n (click)=\"userClicked.emit()\"\r\n [matTooltip]=\"user.first_name + ' ' + user.last_name\"\r\n [matTooltipPosition]=\"'below'\">\r\n {{user.first_name[0] + user.last_name[0]}}\r\n </div>\r\n\r\n <div class=\"users-section__user icon-2\" *ngIf=\"users.length > 2\"\r\n [drTooltip]=\"usersTemplate\"\r\n [drTooltipPosition]=\"'bottom'\">\r\n {{getLastUsers().length}}\r\n </div>\r\n</div>\r\n\r\n<ng-template #usersTemplate>\r\n <div *ngFor=\"let user of getLastUsers()\" class=\"users-popover-item\">\r\n <div class=\"users-section__user\"\r\n (click)=\"userClicked.emit()\"\r\n [class]=\"user.class\">\r\n {{user.first_name[0] + user.last_name[0]}}\r\n </div>\r\n <span class=\"username\">\r\n {{user.first_name + ' ' + user.last_name}}\r\n </span>\r\n </div>\r\n</ng-template>\r\n",
|
|
1123
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1124
|
+
styles: [":host{width:auto}.users-section{display:flex;position:absolute;height:28px;top:5px}.users-popover-item{display:flex;align-items:center;margin:12px}.users-popover-item .username{color:#51566f;font-size:14px}.users-popover-item .users-section__user{margin-right:8px}.users-section__user{display:flex;justify-content:center;align-items:center;height:28px;width:28px;border-radius:14px;background:red;color:#fff;font-size:12px}.users-section__user.icon-0{background-color:#7b61ff}.users-section__user.icon-1{background-color:#21b8f1}.users-section__user.icon-2{background-color:#2969b0}.users-section__user.icon-3{background-color:#51566f}.users-section__user.icon-4{background-color:#0061ff}.users-section__user:hover{cursor:pointer}.users-section__user:not(:first-child){margin-left:4px}\n"]
|
|
1125
|
+
},] }
|
|
1126
|
+
];
|
|
1127
|
+
DrAvatarComponent.ctorParameters = () => [];
|
|
1128
|
+
DrAvatarComponent.propDecorators = {
|
|
1129
|
+
users: [{ type: Input }],
|
|
1130
|
+
userClicked: [{ type: Output }]
|
|
1131
|
+
};
|
|
1132
|
+
|
|
1133
|
+
const POPUP_POSITIONS = {
|
|
1134
|
+
top: {
|
|
1135
|
+
originX: 'center',
|
|
1136
|
+
originY: 'top',
|
|
1137
|
+
overlayX: 'center',
|
|
1138
|
+
overlayY: 'bottom',
|
|
1139
|
+
offsetY: -8
|
|
1140
|
+
},
|
|
1141
|
+
'top-left': {
|
|
1142
|
+
originX: 'start',
|
|
1143
|
+
originY: 'top',
|
|
1144
|
+
overlayX: 'start',
|
|
1145
|
+
overlayY: 'bottom',
|
|
1146
|
+
offsetY: -8
|
|
1147
|
+
},
|
|
1148
|
+
'top-right': {
|
|
1149
|
+
originX: 'end',
|
|
1150
|
+
originY: 'top',
|
|
1151
|
+
overlayX: 'end',
|
|
1152
|
+
overlayY: 'bottom',
|
|
1153
|
+
offsetY: -8
|
|
1154
|
+
},
|
|
1155
|
+
bottom: {
|
|
1156
|
+
originX: 'center',
|
|
1157
|
+
originY: 'bottom',
|
|
1158
|
+
overlayX: 'center',
|
|
1159
|
+
overlayY: 'top',
|
|
1160
|
+
offsetY: 7
|
|
1161
|
+
},
|
|
1162
|
+
'bottom-left': {
|
|
1163
|
+
originX: 'start',
|
|
1164
|
+
originY: 'bottom',
|
|
1165
|
+
overlayX: 'start',
|
|
1166
|
+
overlayY: 'top',
|
|
1167
|
+
offsetY: 7
|
|
1168
|
+
},
|
|
1169
|
+
'bottom-right': {
|
|
1170
|
+
originX: 'end',
|
|
1171
|
+
originY: 'bottom',
|
|
1172
|
+
overlayX: 'end',
|
|
1173
|
+
overlayY: 'top',
|
|
1174
|
+
offsetY: 7
|
|
1175
|
+
},
|
|
1176
|
+
left: {
|
|
1177
|
+
originX: 'start',
|
|
1178
|
+
originY: 'center',
|
|
1179
|
+
overlayX: 'end',
|
|
1180
|
+
overlayY: 'center',
|
|
1181
|
+
offsetX: -8
|
|
1182
|
+
},
|
|
1183
|
+
'left-top': {
|
|
1184
|
+
originX: 'start',
|
|
1185
|
+
originY: 'top',
|
|
1186
|
+
overlayX: 'end',
|
|
1187
|
+
overlayY: 'top',
|
|
1188
|
+
offsetX: -8
|
|
1189
|
+
},
|
|
1190
|
+
'left-bottom': {
|
|
1191
|
+
originX: 'start',
|
|
1192
|
+
originY: 'bottom',
|
|
1193
|
+
overlayX: 'end',
|
|
1194
|
+
overlayY: 'bottom',
|
|
1195
|
+
offsetX: -8
|
|
1196
|
+
},
|
|
1197
|
+
right: {
|
|
1198
|
+
originX: 'end',
|
|
1199
|
+
originY: 'center',
|
|
1200
|
+
overlayX: 'start',
|
|
1201
|
+
overlayY: 'center',
|
|
1202
|
+
offsetX: 8
|
|
1203
|
+
},
|
|
1204
|
+
'right-top': {
|
|
1205
|
+
originX: 'end',
|
|
1206
|
+
originY: 'top',
|
|
1207
|
+
overlayX: 'start',
|
|
1208
|
+
overlayY: 'top',
|
|
1209
|
+
offsetX: 8
|
|
1210
|
+
},
|
|
1211
|
+
'right-bottom': {
|
|
1212
|
+
originX: 'end',
|
|
1213
|
+
originY: 'bottom',
|
|
1214
|
+
overlayX: 'start',
|
|
1215
|
+
overlayY: 'bottom',
|
|
1216
|
+
offsetX: 8
|
|
1217
|
+
}
|
|
1218
|
+
};
|
|
1219
|
+
const POPUP_ANIMATION = [
|
|
1220
|
+
transition(':enter', [
|
|
1221
|
+
style({ opacity: 0 }),
|
|
1222
|
+
animate(300, style({ opacity: 1 })),
|
|
1223
|
+
]),
|
|
1224
|
+
transition(':leave', [
|
|
1225
|
+
animate(300, style({ opacity: 0 })),
|
|
1226
|
+
]),
|
|
1227
|
+
];
|
|
1228
|
+
|
|
1229
|
+
class TooltipComponent {
|
|
1230
|
+
constructor() {
|
|
1231
|
+
this.isContentTemplate = false;
|
|
1232
|
+
}
|
|
1233
|
+
ngOnInit() {
|
|
1234
|
+
this.isContentTemplate = this.content instanceof TemplateRef;
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
TooltipComponent.decorators = [
|
|
1238
|
+
{ type: Component, args: [{
|
|
1239
|
+
selector: 'dr-tooltip',
|
|
1240
|
+
template: "<div [class]=\"position + ' ' + class\" [ngClass]=\"{'dr-tooltip': !options?.withoutContainerStyles}\">\r\n <div *ngIf=\"!options?.withoutArrow\" class=\"dr-tooltip-arrow\"></div>\r\n <ng-container *ngIf=\"isContentTemplate; else defaultContent\">\r\n <ng-container *ngTemplateOutlet=\"content; context: contentContext\"></ng-container>\r\n </ng-container>\r\n <ng-template #defaultContent>\r\n <div class=\"default-content\">{{ content }}</div>\r\n </ng-template>\r\n</div>\r\n",
|
|
1241
|
+
animations: [
|
|
1242
|
+
trigger('tooltip', POPUP_ANIMATION),
|
|
1243
|
+
],
|
|
1244
|
+
styles: [":host{display:block}.top,.top-left,.top-right.dr-tooltip{transform:translateY(-8px)}.bottom,.bottom-left,.bottom-right.dr-tooltip{transform:translateY(8px)}.left,.left-top,.left-bottom.dr-tooltip{transform:translate(-8px)}.right,.right-top,.right-bottom.dr-tooltip{transform:translate(8px)}.dr-tooltip{background:#fff;border:1px solid #cfd7dd;box-sizing:border-box;border-radius:8px;font-size:12px;color:#545a6b;max-width:80vh!important;box-shadow:0 2px 4px #9199b4}.dr-tooltip .default-content{padding:.5rem;font-size:12px;line-height:22px;white-space:pre;text-overflow:ellipsis;overflow:hidden}.dr-tooltip-arrow{border-width:8px}.dr-tooltip-arrow,.dr-tooltip-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.dr-tooltip-arrow:after{content:\"\";border-width:8px}.top .dr-tooltip-arrow,.top-left .dr-tooltip-arrow,.top-right .dr-tooltip-arrow{bottom:-16px;border-top-color:#cfd7dd!important}.top .dr-tooltip-arrow:after,.top-left .dr-tooltip-arrow:after,.top-right .dr-tooltip-arrow:after{bottom:-6px;left:-8px;border-top-color:#fff}.bottom .dr-tooltip-arrow,.bottom-left .dr-tooltip-arrow,.bottom-right .dr-tooltip-arrow{top:-7px;border-top:none;border-bottom-color:#cfd7dd!important}.bottom .dr-tooltip-arrow:after,.bottom-left .dr-tooltip-arrow:after,.bottom-right .dr-tooltip-arrow:after{border-top:none;top:1px;left:-8px;border-bottom-color:#fff}.left .dr-tooltip-arrow,.left-top .dr-tooltip-arrow,.left-bottom .dr-tooltip-arrow{right:-16px;border-left-color:#cfd7dd!important}.left .dr-tooltip-arrow:after,.left-top .dr-tooltip-arrow:after,.left-bottom .dr-tooltip-arrow:after{bottom:-8px;left:-9px;border-left-color:#fff}.right .dr-tooltip-arrow,.right-top .dr-tooltip-arrow,.right-bottom .dr-tooltip-arrow{left:-16px;border-right-color:#cfd7dd!important}.right .dr-tooltip-arrow:after,.right-top .dr-tooltip-arrow:after,.right-bottom .dr-tooltip-arrow:after{bottom:-8px;left:-7px;border-right-color:#fff}.top .dr-tooltip-arrow,.bottom .dr-tooltip-arrow{left:calc(50% - 8px)}.bottom-left .dr-tooltip-arrow,.top-left .dr-tooltip-arrow{left:8px}.bottom-right .dr-tooltip-arrow,.top-right .dr-tooltip-arrow{right:8px}.left .dr-tooltip-arrow,.right .dr-tooltip-arrow{top:calc(50% - 8px)}.left-top .dr-tooltip-arrow,.dr-tooltip-arrow .right-top{top:8px}.right-bottom .dr-tooltip-arrow,.left-bottom .dr-tooltip-arrow{bottom:8px}\n"]
|
|
1245
|
+
},] }
|
|
1246
|
+
];
|
|
1247
|
+
TooltipComponent.ctorParameters = () => [];
|
|
1248
|
+
TooltipComponent.propDecorators = {
|
|
1249
|
+
content: [{ type: Input }],
|
|
1250
|
+
contentContext: [{ type: Input }],
|
|
1251
|
+
position: [{ type: Input }],
|
|
1252
|
+
options: [{ type: Input }],
|
|
1253
|
+
class: [{ type: Input }]
|
|
1254
|
+
};
|
|
1255
|
+
|
|
1256
|
+
class DrTooltipDirective {
|
|
1257
|
+
constructor(overlay, overlayPositionBuilder, elementRef) {
|
|
1258
|
+
this.overlay = overlay;
|
|
1259
|
+
this.overlayPositionBuilder = overlayPositionBuilder;
|
|
1260
|
+
this.elementRef = elementRef;
|
|
1261
|
+
this.contentContext = {};
|
|
1262
|
+
this.position = 'top';
|
|
1263
|
+
this.class = '';
|
|
1264
|
+
}
|
|
1265
|
+
set drTooltipOptions(options) {
|
|
1266
|
+
if (options === null || options === void 0 ? void 0 : options.indent) {
|
|
1267
|
+
const position = POPUP_POSITIONS[this.position];
|
|
1268
|
+
if (position.offsetY) {
|
|
1269
|
+
position.offsetY = position.offsetY < 0 ? -options.indent : options.indent;
|
|
1270
|
+
}
|
|
1271
|
+
if (position.offsetX) {
|
|
1272
|
+
position.offsetX = position.offsetX < 0 ? -options.indent : options.indent;
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
this.options = options;
|
|
1276
|
+
}
|
|
1277
|
+
set showTooltip(value) {
|
|
1278
|
+
this.manualHandling = true;
|
|
1279
|
+
if (value) {
|
|
1280
|
+
this.renderTooltip();
|
|
1281
|
+
}
|
|
1282
|
+
else {
|
|
1283
|
+
this.destroyTooltip();
|
|
1284
|
+
}
|
|
1285
|
+
}
|
|
1286
|
+
ngOnDestroy() {
|
|
1287
|
+
if (!this.overlayRef)
|
|
1288
|
+
return null;
|
|
1289
|
+
if (this.overlayRef.hasAttached()) {
|
|
1290
|
+
this.hide();
|
|
1291
|
+
}
|
|
1292
|
+
// TODO: Temporary solution. line 162 doesn't stop function execution
|
|
1293
|
+
if (this.overlayRef) {
|
|
1294
|
+
this.overlayRef.dispose();
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
show() {
|
|
1298
|
+
if (this.manualHandling)
|
|
1299
|
+
return;
|
|
1300
|
+
this.renderTooltip();
|
|
1301
|
+
}
|
|
1302
|
+
hide() {
|
|
1303
|
+
if (this.manualHandling)
|
|
1304
|
+
return;
|
|
1305
|
+
this.destroyTooltip();
|
|
1306
|
+
}
|
|
1307
|
+
createOverlay() {
|
|
1308
|
+
const positionStrategy = this.overlayPositionBuilder
|
|
1309
|
+
.flexibleConnectedTo(this.elementRef)
|
|
1310
|
+
.withPositions([POPUP_POSITIONS[this.position]]);
|
|
1311
|
+
this.overlayRef = this.overlay.create({ positionStrategy });
|
|
1312
|
+
}
|
|
1313
|
+
renderTooltip() {
|
|
1314
|
+
var _a;
|
|
1315
|
+
this.createOverlay();
|
|
1316
|
+
if (!((_a = this.overlayRef) === null || _a === void 0 ? void 0 : _a.hasAttached()) && this.content) {
|
|
1317
|
+
const tooltipRef = this.overlayRef.attach(new ComponentPortal(TooltipComponent));
|
|
1318
|
+
tooltipRef.instance.content = this.content;
|
|
1319
|
+
tooltipRef.instance.contentContext = this.contentContext;
|
|
1320
|
+
tooltipRef.instance.position = this.position;
|
|
1321
|
+
tooltipRef.instance.options = this.options;
|
|
1322
|
+
tooltipRef.instance.class = this.class + ' ' + this.position;
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
1325
|
+
destroyTooltip() {
|
|
1326
|
+
if (this.overlayRef) {
|
|
1327
|
+
this.overlayRef.dispose();
|
|
1328
|
+
}
|
|
1329
|
+
this.overlayRef = null;
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
DrTooltipDirective.decorators = [
|
|
1333
|
+
{ type: Directive, args: [{
|
|
1334
|
+
selector: '[drTooltip]'
|
|
1335
|
+
},] }
|
|
1336
|
+
];
|
|
1337
|
+
DrTooltipDirective.ctorParameters = () => [
|
|
1338
|
+
{ type: Overlay },
|
|
1339
|
+
{ type: OverlayPositionBuilder },
|
|
1340
|
+
{ type: ElementRef }
|
|
1341
|
+
];
|
|
1342
|
+
DrTooltipDirective.propDecorators = {
|
|
1343
|
+
content: [{ type: Input, args: ['drTooltip',] }],
|
|
1344
|
+
contentContext: [{ type: Input, args: ['drTooltipContext',] }],
|
|
1345
|
+
position: [{ type: Input, args: ['drTooltipPosition',] }],
|
|
1346
|
+
class: [{ type: Input, args: ['drTooltipClass',] }],
|
|
1347
|
+
drTooltipOptions: [{ type: Input }],
|
|
1348
|
+
showTooltip: [{ type: Input, args: ['drTooltipShow',] }],
|
|
1349
|
+
show: [{ type: HostListener, args: ['mouseenter',] }],
|
|
1350
|
+
hide: [{ type: HostListener, args: ['mouseleave',] }]
|
|
1065
1351
|
};
|
|
1066
1352
|
|
|
1067
1353
|
class DrToggleComponent {
|
|
@@ -1195,6 +1481,640 @@ DrSpinnerDirective.propDecorators = {
|
|
|
1195
1481
|
drSpinnerSize: [{ type: Input }]
|
|
1196
1482
|
};
|
|
1197
1483
|
|
|
1484
|
+
class DrButtonComponent {
|
|
1485
|
+
constructor() {
|
|
1486
|
+
this.theme = 'primary';
|
|
1487
|
+
this.isBold = false;
|
|
1488
|
+
this.isLoading = false;
|
|
1489
|
+
this.click = new EventEmitter();
|
|
1490
|
+
}
|
|
1491
|
+
onClick($event) {
|
|
1492
|
+
this.click.emit($event);
|
|
1493
|
+
}
|
|
1494
|
+
}
|
|
1495
|
+
DrButtonComponent.decorators = [
|
|
1496
|
+
{ type: Component, args: [{
|
|
1497
|
+
selector: 'dr-button',
|
|
1498
|
+
template: "<button (click)=\"onClick($event)\" [attr.disabled]=\"disabled\" [attr.is-loading]=\"isLoading\" [attr.bold]=\"isBold\"\r\n [attr.icon]=\"icon ? true : false\" [attr.theme]=\"theme\">\r\n <ng-container *ngIf=\"!isLoading\">\r\n <i *ngIf=\"icon\" class=\"dr\" [ngClass]=\"icon\"></i>\r\n <ng-content></ng-content>\r\n </ng-container>\r\n <i *ngIf=\"isLoading\" class=\"dr dr-spinner\"></i>\r\n</button>",
|
|
1499
|
+
styles: [":host{display:inline-block}: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~=secondary]{padding:5px 16px;background:#FFFFFF;border-radius:16px;min-width:90px}:host button[theme][theme~=secondary]:hover:not([disabled=\"true\"]){color:#4e566c;transition:.2ms ease-in all;background:#F2F2FB;box-shadow:0 4px 14px #0000001a;border:1px solid #4646CE;border-radius:16px}:host button[theme][theme~=secondary]:active{box-shadow:none;background:#F2F2FB}:host button[theme][theme~=secondary][disabled=true]{background:#F0F1F4;color:#727583;border:none}:host button[theme][theme~=secondary][is-loading=true]{justify-content:center;padding:5px 16px}:host button[theme][theme~=primary]{background:#4646CE;color:#fff;border:none;min-width:90px}:host button[theme][theme~=primary]:hover:not([disabled=\"true\"]){transition:.2ms ease-in all;background:linear-gradient(96.89deg,#25258C 0%,#4646CE 100%);box-shadow:0 4px 14px #0000001a;border-radius:16px;border:none}:host button[theme][theme~=primary]:hover[disabled=false]{border:none}:host button[theme][theme~=primary]:active{background:#25258C}:host button[theme][theme~=primary][disabled=true]{background:#F0F1F4;color:#727583;border:none}:host button[theme][theme~=primary][is-loading=true]{justify-content:center;padding:5px 16px}: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=\"true\"]){color:#4646ce;background:#F2F2FB;border-radius:4px}:host button[theme][theme~=ghost][disabled=true]{color:#727583}:host button[theme][theme~=text-link]{background:none;border:none;color:#0b5af9;text-decoration:underline}:host button[theme][theme~=text-link][disabled=true]{color:#727583}: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=true]{color:#bcbcbc;background:#E5E6EA}: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=true]{color:#bcbcbc;background:#E5E6EA;border:none}:host button[theme][theme~=secondary-icon] .dr{margin: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=true]{color:#bcbcbc;border:none}:host button[theme][theme~=icon][disabled=true]:hover,:host button[theme][theme~=icon][disabled=true]:active{background:none}:host button[theme][theme~=icon] .dr{margin:0}:host button[theme][bold=true]{font-weight:600}:host button[theme][icon=true]{padding-left:8px}:host button[theme][icon=false]{justify-content:center}\n"]
|
|
1500
|
+
},] }
|
|
1501
|
+
];
|
|
1502
|
+
DrButtonComponent.ctorParameters = () => [];
|
|
1503
|
+
DrButtonComponent.propDecorators = {
|
|
1504
|
+
title: [{ type: Input }],
|
|
1505
|
+
theme: [{ type: Input }],
|
|
1506
|
+
disabled: [{ type: Input }],
|
|
1507
|
+
icon: [{ type: Input }],
|
|
1508
|
+
isBold: [{ type: Input }],
|
|
1509
|
+
isLoading: [{ type: Input }],
|
|
1510
|
+
click: [{ type: Output }]
|
|
1511
|
+
};
|
|
1512
|
+
// Examples:
|
|
1513
|
+
/*
|
|
1514
|
+
<dr-button [icon]="'dr-icon-arrow-down'">hello</dr-button>
|
|
1515
|
+
<dr-button [icon]="'dr-icon-refresh'" [theme]="'primary-icon'"></dr-button>
|
|
1516
|
+
<dr-button [icon]="'dr-icon-refresh'" [isDisabled]="true" [theme]="'primary-icon'"></dr-button>
|
|
1517
|
+
|
|
1518
|
+
<dr-button [icon]="'dr-icon-refresh'" [theme]="'secondary-icon'"></dr-button>
|
|
1519
|
+
<dr-button [icon]="'dr-icon-share'" [isDisabled]="true" [theme]="'secondary-icon'"></dr-button>
|
|
1520
|
+
|
|
1521
|
+
<dr-button [icon]="'dr-icon-share'" [theme]="'icon'"></dr-button>
|
|
1522
|
+
<dr-button [icon]="'dr-icon-share'" [isDisabled]="true" [theme]="'icon'"></dr-button>
|
|
1523
|
+
|
|
1524
|
+
<dr-button [isDisabled]="false" [icon]="'dr-icon-refresh'">Primary</dr-button>
|
|
1525
|
+
<dr-button [isDisabled]="false" >Primary</dr-button>
|
|
1526
|
+
<dr-button [isDisabled]="false" [icon]="'dr-icon-refresh'" [theme]="'secondary'">Secondary</dr-button>
|
|
1527
|
+
<dr-button [isDisabled]="false" [icon]="'dr-icon-refresh'" [theme]="'ghost'">Ghost</dr-button>
|
|
1528
|
+
<dr-button [isDisabled]="false" [theme]="'text-link'">Text Link</dr-button>
|
|
1529
|
+
*/
|
|
1530
|
+
|
|
1531
|
+
const MAT_DEFAULT_DATE_FORMAT = 'MM/DD/yyyy';
|
|
1532
|
+
const DATE_INPUT_FORMAT = 'YYYY/MM/DD';
|
|
1533
|
+
const YEAR_FORMAT = 'yyyy';
|
|
1534
|
+
const MONTH_YEAR_FORMAT = 'MM/yyyy';
|
|
1535
|
+
class CustomDateFormat {
|
|
1536
|
+
constructor() {
|
|
1537
|
+
this._parse = {
|
|
1538
|
+
dateInput: DATE_INPUT_FORMAT
|
|
1539
|
+
};
|
|
1540
|
+
this._display = {
|
|
1541
|
+
dateInput: DATE_INPUT_FORMAT,
|
|
1542
|
+
monthYearLabel: 'MMM YYYY',
|
|
1543
|
+
dateA11yLabel: 'LL',
|
|
1544
|
+
monthYearA11yLabel: 'MMM YYYY'
|
|
1545
|
+
};
|
|
1546
|
+
}
|
|
1547
|
+
set parse(parse) {
|
|
1548
|
+
this._parse = Object.assign({}, this._parse, parse);
|
|
1549
|
+
}
|
|
1550
|
+
get parse() {
|
|
1551
|
+
return this._parse;
|
|
1552
|
+
}
|
|
1553
|
+
set display(display) {
|
|
1554
|
+
this._display = Object.assign({}, this._display, display);
|
|
1555
|
+
}
|
|
1556
|
+
get display() {
|
|
1557
|
+
return this._display;
|
|
1558
|
+
}
|
|
1559
|
+
updateDateFormat(parse, display) {
|
|
1560
|
+
this.parse = parse;
|
|
1561
|
+
if (!display) {
|
|
1562
|
+
display = parse;
|
|
1563
|
+
}
|
|
1564
|
+
this.display = display;
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
const noop = () => { };
|
|
1569
|
+
const ɵ0$1 = noop;
|
|
1570
|
+
class DrDatePickerComponent {
|
|
1571
|
+
constructor(cdr) {
|
|
1572
|
+
this.cdr = cdr;
|
|
1573
|
+
this.readonly = true;
|
|
1574
|
+
this._lastView = 'month';
|
|
1575
|
+
this._format = MAT_DEFAULT_DATE_FORMAT;
|
|
1576
|
+
this.placeholder = 'Select';
|
|
1577
|
+
this.min = null;
|
|
1578
|
+
this.max = null;
|
|
1579
|
+
this.innerValue = null;
|
|
1580
|
+
this.onTouchedCallback = noop;
|
|
1581
|
+
this.onChangeCallback = noop;
|
|
1582
|
+
}
|
|
1583
|
+
set lastView(view) {
|
|
1584
|
+
switch (view) {
|
|
1585
|
+
case 'year':
|
|
1586
|
+
this._lastView = 'multi-year';
|
|
1587
|
+
this._format = YEAR_FORMAT;
|
|
1588
|
+
break;
|
|
1589
|
+
case 'month':
|
|
1590
|
+
this._lastView = 'year';
|
|
1591
|
+
this._format = MONTH_YEAR_FORMAT;
|
|
1592
|
+
break;
|
|
1593
|
+
default:
|
|
1594
|
+
this._lastView = 'month';
|
|
1595
|
+
this._format = MAT_DEFAULT_DATE_FORMAT;
|
|
1596
|
+
}
|
|
1597
|
+
this.cdr.markForCheck();
|
|
1598
|
+
}
|
|
1599
|
+
set format(value) {
|
|
1600
|
+
if (value) {
|
|
1601
|
+
this._format = value;
|
|
1602
|
+
this.cdr.markForCheck();
|
|
1603
|
+
}
|
|
1604
|
+
}
|
|
1605
|
+
ngAfterViewInit() {
|
|
1606
|
+
if (this._lastView === 'month') {
|
|
1607
|
+
return;
|
|
1608
|
+
}
|
|
1609
|
+
const lastView = this._lastView;
|
|
1610
|
+
setTimeout(() => {
|
|
1611
|
+
const popupInstance = this.dp._popupComponentRef.instance;
|
|
1612
|
+
const calenderInstance = popupInstance._calendar._calendarHeaderPortal._attachedHost._attachedRef.instance;
|
|
1613
|
+
calenderInstance.currentPeriodClicked = function () {
|
|
1614
|
+
if (lastView === 'multi-year') {
|
|
1615
|
+
this.calendar.currentView = 'multi-year';
|
|
1616
|
+
}
|
|
1617
|
+
else if (lastView === 'year') {
|
|
1618
|
+
this.calendar.currentView = this.calendar.currentView == 'year' ? 'multi-year' : 'year';
|
|
1619
|
+
}
|
|
1620
|
+
};
|
|
1621
|
+
}, 1000);
|
|
1622
|
+
}
|
|
1623
|
+
get value() {
|
|
1624
|
+
return this.innerValue;
|
|
1625
|
+
}
|
|
1626
|
+
set value(v) {
|
|
1627
|
+
if (v !== this.innerValue) {
|
|
1628
|
+
this.innerValue = v;
|
|
1629
|
+
this.onChangeCallback(v);
|
|
1630
|
+
}
|
|
1631
|
+
this.cdr.markForCheck();
|
|
1632
|
+
}
|
|
1633
|
+
registerOnChange(fn) {
|
|
1634
|
+
this.onChangeCallback = fn;
|
|
1635
|
+
}
|
|
1636
|
+
registerOnTouched(fn) {
|
|
1637
|
+
this.onTouchedCallback = fn;
|
|
1638
|
+
}
|
|
1639
|
+
writeValue(value) {
|
|
1640
|
+
if (value !== this.innerValue) {
|
|
1641
|
+
this.innerValue = value;
|
|
1642
|
+
this.cdr.markForCheck();
|
|
1643
|
+
}
|
|
1644
|
+
}
|
|
1645
|
+
chosenMonthHandler(normalizedMonth, datepicker) {
|
|
1646
|
+
if (this._lastView === 'year') {
|
|
1647
|
+
this.writeValue(normalizedMonth);
|
|
1648
|
+
this.onChangeCallback(normalizedMonth);
|
|
1649
|
+
datepicker.close();
|
|
1650
|
+
}
|
|
1651
|
+
}
|
|
1652
|
+
chosenYearHandler(normalizedYear, datepicker) {
|
|
1653
|
+
if (this._lastView === 'multi-year') {
|
|
1654
|
+
this.writeValue(normalizedYear);
|
|
1655
|
+
this.onChangeCallback(normalizedYear);
|
|
1656
|
+
datepicker.close();
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
DrDatePickerComponent.decorators = [
|
|
1661
|
+
{ type: Component, args: [{
|
|
1662
|
+
selector: 'new-dr-date-picker',
|
|
1663
|
+
template: " <dr-input\r\n (click)=\"datePicker.open()\"\r\n [(ngModel)]=\"value\"\r\n [min]=\"min\"\r\n [max]=\"max\"\r\n [placeholder]=\"placeholder\"\r\n [matDatePicker]=\"datePicker\"\r\n [drDatePickerFormat]=\"_format\"\r\n [readonly]=\"readonly\"\r\n ></dr-input>\r\n <mat-datepicker\r\n #datePicker startView=\"{{_lastView}}\"\r\n (yearSelected)=\"chosenYearHandler($event, datePicker)\"\r\n (monthSelected)=\"chosenMonthHandler($event, datePicker)\">\r\n </mat-datepicker>\r\n\r\n",
|
|
1664
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1665
|
+
providers: [
|
|
1666
|
+
{ provide: NG_VALUE_ACCESSOR, useExisting: DrDatePickerComponent, multi: true }
|
|
1667
|
+
],
|
|
1668
|
+
styles: ["dr-input.ng-valid{border-color:#85889c!important}.mat-datepicker-content{margin:7px 0;box-shadow:0 4px 8px 1px #00000040;border-radius:12px!important}.mat-datepicker-content button[disabled]{border:inherit;color:inherit;background-color:inherit}.mat-datepicker-content button[disabled]:hover{border:inherit}.mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){background:#F3F7FF}.mat-calendar-body-selected{background-color:#579bf2}.mat-calendar-body-today.mat-calendar-body-selected{box-shadow:none}.mat-button-focus-overlay{background:#F3F7FF}.mat-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:1!important;background:#F3F7FF;transition:opacity .2s cubic-bezier(.35,0,.25,1)}.mat-calendar-controls .mat-calendar-period-button:hover{background:#F3F7FF;transition:background .2s cubic-bezier(.35,0,.25,1)}:host::ng-deep dr-input input{cursor:pointer}\n"]
|
|
1669
|
+
},] }
|
|
1670
|
+
];
|
|
1671
|
+
DrDatePickerComponent.ctorParameters = () => [
|
|
1672
|
+
{ type: ChangeDetectorRef }
|
|
1673
|
+
];
|
|
1674
|
+
DrDatePickerComponent.propDecorators = {
|
|
1675
|
+
lastView: [{ type: Input }],
|
|
1676
|
+
format: [{ type: Input }],
|
|
1677
|
+
placeholder: [{ type: Input }],
|
|
1678
|
+
min: [{ type: Input }],
|
|
1679
|
+
max: [{ type: Input }],
|
|
1680
|
+
dp: [{ type: ViewChild, args: ['datePicker',] }]
|
|
1681
|
+
};
|
|
1682
|
+
|
|
1683
|
+
class DrDatePickerFormatDirective {
|
|
1684
|
+
constructor(matDateFormat, ngControl) {
|
|
1685
|
+
this.matDateFormat = matDateFormat;
|
|
1686
|
+
this.ngControl = ngControl;
|
|
1687
|
+
}
|
|
1688
|
+
set datePickerFormat(format) {
|
|
1689
|
+
var _a;
|
|
1690
|
+
if (this.configDateParse) {
|
|
1691
|
+
this.matDateFormat.updateDateFormat(this.configDateParse, this.configDateDisplay);
|
|
1692
|
+
}
|
|
1693
|
+
else {
|
|
1694
|
+
this.matDateFormat.updateDateFormat({ dateInput: format });
|
|
1695
|
+
}
|
|
1696
|
+
const value = this.ngControl.value;
|
|
1697
|
+
(_a = this.ngControl.valueAccessor) === null || _a === void 0 ? void 0 : _a.writeValue(value);
|
|
1698
|
+
}
|
|
1699
|
+
}
|
|
1700
|
+
DrDatePickerFormatDirective.decorators = [
|
|
1701
|
+
{ type: Directive, args: [{
|
|
1702
|
+
selector: '[drDatePickerFormat]',
|
|
1703
|
+
providers: [
|
|
1704
|
+
{
|
|
1705
|
+
provide: DateAdapter,
|
|
1706
|
+
useClass: MomentDateAdapter
|
|
1707
|
+
},
|
|
1708
|
+
{
|
|
1709
|
+
provide: MAT_DATE_FORMATS,
|
|
1710
|
+
useClass: CustomDateFormat
|
|
1711
|
+
}
|
|
1712
|
+
]
|
|
1713
|
+
},] }
|
|
1714
|
+
];
|
|
1715
|
+
DrDatePickerFormatDirective.ctorParameters = () => [
|
|
1716
|
+
{ type: CustomDateFormat, decorators: [{ type: Inject, args: [MAT_DATE_FORMATS,] }] },
|
|
1717
|
+
{ type: NgControl, decorators: [{ type: Optional }] }
|
|
1718
|
+
];
|
|
1719
|
+
DrDatePickerFormatDirective.propDecorators = {
|
|
1720
|
+
configDateParse: [{ type: Input }],
|
|
1721
|
+
configDateDisplay: [{ type: Input }],
|
|
1722
|
+
datePickerFormat: [{ type: Input, args: ['drDatePickerFormat',] }]
|
|
1723
|
+
};
|
|
1724
|
+
|
|
1725
|
+
class DrPopoverComponent {
|
|
1726
|
+
constructor(cdr, componentFactoryResolver, elementRef) {
|
|
1727
|
+
this.cdr = cdr;
|
|
1728
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
1729
|
+
this.elementRef = elementRef;
|
|
1730
|
+
this.class = '';
|
|
1731
|
+
this.isContentTemplate = false;
|
|
1732
|
+
}
|
|
1733
|
+
set popoverContainer(template) {
|
|
1734
|
+
this.isContentTemplate = this.content instanceof TemplateRef;
|
|
1735
|
+
if (!this.isContentTemplate) {
|
|
1736
|
+
this.componentRef = template.createComponent(this.componentFactoryResolver.resolveComponentFactory(this.content));
|
|
1737
|
+
this.componentRef.instance['closePopover'] = this.closePopover;
|
|
1738
|
+
for (let key in this.contentContext) {
|
|
1739
|
+
this.componentRef.instance[key] = this.contentContext[key];
|
|
1740
|
+
}
|
|
1741
|
+
}
|
|
1742
|
+
else {
|
|
1743
|
+
this.contentContext.closePopover = this.closePopover;
|
|
1744
|
+
}
|
|
1745
|
+
this.cdr.detectChanges();
|
|
1746
|
+
}
|
|
1747
|
+
;
|
|
1748
|
+
removeOutside(e) {
|
|
1749
|
+
const isTargetHost = this.hostRef.nativeElement === e.target;
|
|
1750
|
+
const isTargetInPopover = this.elementRef.nativeElement.contains(e.target);
|
|
1751
|
+
const isTargetInDatepicker = e.target.closest('mat-datepicker-popup');
|
|
1752
|
+
const isTargetInSelect = e.target.closest('ng-dropdown-panel');
|
|
1753
|
+
if (!isTargetHost && !isTargetInPopover && !isTargetInDatepicker && !isTargetInSelect) {
|
|
1754
|
+
this.closePopover();
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
}
|
|
1758
|
+
DrPopoverComponent.decorators = [
|
|
1759
|
+
{ type: Component, args: [{
|
|
1760
|
+
selector: 'dr-popover',
|
|
1761
|
+
template: "<div class=\"dr-popover\" [class]=\"class\" #popoverContainer>\r\n <ng-container *ngIf=\"isContentTemplate\">\r\n <ng-container *ngTemplateOutlet=\"content; context: contentContext\"></ng-container>\r\n </ng-container>\r\n</div>\r\n",
|
|
1762
|
+
animations: [
|
|
1763
|
+
trigger('popover', POPUP_ANIMATION),
|
|
1764
|
+
],
|
|
1765
|
+
styles: [".dr-popover{display:flex;background:#fff;border:1px solid #E5E5E5;border-radius:5px;box-sizing:border-box;box-shadow:0 4px 14px #0003;font-size:12px;color:#545a6b;max-height:100vh;max-width:100vw}\n"]
|
|
1766
|
+
},] }
|
|
1767
|
+
];
|
|
1768
|
+
DrPopoverComponent.ctorParameters = () => [
|
|
1769
|
+
{ type: ChangeDetectorRef },
|
|
1770
|
+
{ type: ComponentFactoryResolver },
|
|
1771
|
+
{ type: ElementRef }
|
|
1772
|
+
];
|
|
1773
|
+
DrPopoverComponent.propDecorators = {
|
|
1774
|
+
content: [{ type: Input }],
|
|
1775
|
+
contentContext: [{ type: Input }],
|
|
1776
|
+
class: [{ type: Input }],
|
|
1777
|
+
hostRef: [{ type: Input }],
|
|
1778
|
+
closePopover: [{ type: Input }],
|
|
1779
|
+
popoverContainer: [{ type: ViewChild, args: ['popoverContainer', { read: ViewContainerRef },] }],
|
|
1780
|
+
removeOutside: [{ type: HostListener, args: ['document:mouseup', ['$event'],] }]
|
|
1781
|
+
};
|
|
1782
|
+
|
|
1783
|
+
class DrPopoverDirective {
|
|
1784
|
+
constructor(overlay, vcRef, resolver, overlayPositionBuilder, elementRef) {
|
|
1785
|
+
this.overlay = overlay;
|
|
1786
|
+
this.vcRef = vcRef;
|
|
1787
|
+
this.resolver = resolver;
|
|
1788
|
+
this.overlayPositionBuilder = overlayPositionBuilder;
|
|
1789
|
+
this.elementRef = elementRef;
|
|
1790
|
+
this.contentContext = {};
|
|
1791
|
+
this.position = 'bottom';
|
|
1792
|
+
this.class = '';
|
|
1793
|
+
}
|
|
1794
|
+
show() {
|
|
1795
|
+
if (this.overlayRef) {
|
|
1796
|
+
this.destroyPopover();
|
|
1797
|
+
}
|
|
1798
|
+
else {
|
|
1799
|
+
this.renderPopover();
|
|
1800
|
+
}
|
|
1801
|
+
}
|
|
1802
|
+
renderPopover() {
|
|
1803
|
+
var _a;
|
|
1804
|
+
const positionStrategy = this.overlayPositionBuilder.flexibleConnectedTo(this.elementRef)
|
|
1805
|
+
.withPositions([POPUP_POSITIONS[this.position]]);
|
|
1806
|
+
this.overlayRef = this.overlay.create({ positionStrategy });
|
|
1807
|
+
if (!((_a = this.overlayRef) === null || _a === void 0 ? void 0 : _a.hasAttached()) && this.content) {
|
|
1808
|
+
this.contentRef = this.overlayRef.attach(new ComponentPortal(DrPopoverComponent));
|
|
1809
|
+
this.contentRef.instance.content = this.content;
|
|
1810
|
+
this.contentRef.instance.contentContext = this.contentContext;
|
|
1811
|
+
this.contentRef.instance.class = this.class + ' ' + this.position;
|
|
1812
|
+
this.contentRef.instance.hostRef = this.elementRef;
|
|
1813
|
+
this.contentRef.instance.closePopover = this.destroyPopover.bind(this);
|
|
1814
|
+
}
|
|
1815
|
+
}
|
|
1816
|
+
destroyPopover() {
|
|
1817
|
+
if (this.overlayRef) {
|
|
1818
|
+
this.overlayRef.dispose();
|
|
1819
|
+
this.overlayRef = null;
|
|
1820
|
+
}
|
|
1821
|
+
if (this.contentRef) {
|
|
1822
|
+
this.contentRef.destroy();
|
|
1823
|
+
this.contentRef = null;
|
|
1824
|
+
}
|
|
1825
|
+
}
|
|
1826
|
+
ngOnDestroy() {
|
|
1827
|
+
this.destroyPopover();
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
DrPopoverDirective.decorators = [
|
|
1831
|
+
{ type: Directive, args: [{
|
|
1832
|
+
selector: '[drPopover]'
|
|
1833
|
+
},] }
|
|
1834
|
+
];
|
|
1835
|
+
DrPopoverDirective.ctorParameters = () => [
|
|
1836
|
+
{ type: Overlay },
|
|
1837
|
+
{ type: ViewContainerRef },
|
|
1838
|
+
{ type: ComponentFactoryResolver },
|
|
1839
|
+
{ type: OverlayPositionBuilder },
|
|
1840
|
+
{ type: ElementRef }
|
|
1841
|
+
];
|
|
1842
|
+
DrPopoverDirective.propDecorators = {
|
|
1843
|
+
content: [{ type: Input, args: ['drPopover',] }],
|
|
1844
|
+
contentContext: [{ type: Input, args: ['drPopoverContext',] }],
|
|
1845
|
+
position: [{ type: Input, args: ['drPopoverPosition',] }],
|
|
1846
|
+
class: [{ type: Input, args: ['drPopoverClass',] }],
|
|
1847
|
+
show: [{ type: HostListener, args: ['click',] }]
|
|
1848
|
+
};
|
|
1849
|
+
|
|
1850
|
+
class DrDropdownService {
|
|
1851
|
+
constructor() {
|
|
1852
|
+
this.actionItem = new Subject();
|
|
1853
|
+
}
|
|
1854
|
+
set addMenu(item) {
|
|
1855
|
+
this.menuInView = item;
|
|
1856
|
+
}
|
|
1857
|
+
destroy() {
|
|
1858
|
+
if (this.menuInView) {
|
|
1859
|
+
this.menuInView.destroy();
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
}
|
|
1863
|
+
DrDropdownService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DrDropdownService_Factory() { return new DrDropdownService(); }, token: DrDropdownService, providedIn: "root" });
|
|
1864
|
+
DrDropdownService.decorators = [
|
|
1865
|
+
{ type: Injectable, args: [{
|
|
1866
|
+
providedIn: 'root'
|
|
1867
|
+
},] }
|
|
1868
|
+
];
|
|
1869
|
+
DrDropdownService.ctorParameters = () => [];
|
|
1870
|
+
|
|
1871
|
+
class DrDropdownComponent {
|
|
1872
|
+
constructor(menuService, cdr) {
|
|
1873
|
+
this.menuService = menuService;
|
|
1874
|
+
this.cdr = cdr;
|
|
1875
|
+
this.position = 'left';
|
|
1876
|
+
}
|
|
1877
|
+
set options(data) {
|
|
1878
|
+
if (data) {
|
|
1879
|
+
this.option = data.option;
|
|
1880
|
+
this.position = data.position;
|
|
1881
|
+
this.list = data.list || [];
|
|
1882
|
+
this.list.forEach(item => {
|
|
1883
|
+
var _a;
|
|
1884
|
+
if ((_a = item.children) === null || _a === void 0 ? void 0 : _a.length) {
|
|
1885
|
+
item.childOptions = {
|
|
1886
|
+
list: item.children,
|
|
1887
|
+
position: 'child'
|
|
1888
|
+
};
|
|
1889
|
+
}
|
|
1890
|
+
});
|
|
1891
|
+
this.cdr.markForCheck();
|
|
1892
|
+
}
|
|
1893
|
+
}
|
|
1894
|
+
onClickedOutside() {
|
|
1895
|
+
if (this.firstInit) {
|
|
1896
|
+
this.menuService.destroy();
|
|
1897
|
+
}
|
|
1898
|
+
else {
|
|
1899
|
+
this.firstInit = true;
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
hide() {
|
|
1903
|
+
this.menuService.destroy();
|
|
1904
|
+
}
|
|
1905
|
+
disabled(act) {
|
|
1906
|
+
if (!act.disabled) {
|
|
1907
|
+
return false;
|
|
1908
|
+
}
|
|
1909
|
+
if (typeof act.disabled === 'boolean') {
|
|
1910
|
+
return act.disabled;
|
|
1911
|
+
}
|
|
1912
|
+
else {
|
|
1913
|
+
return act.disabled(act.data);
|
|
1914
|
+
}
|
|
1915
|
+
}
|
|
1916
|
+
tooltipToShow(act) {
|
|
1917
|
+
return act.toolTipIfDisabled && this.disabled(act) && act.toolTip
|
|
1918
|
+
|| act.toolTip && !act.toolTipIfDisabled ? act.toolTip : act.title;
|
|
1919
|
+
}
|
|
1920
|
+
action(act) {
|
|
1921
|
+
if (!this.disabled(act)) {
|
|
1922
|
+
if (act.action) {
|
|
1923
|
+
act.action(act.data);
|
|
1924
|
+
}
|
|
1925
|
+
else {
|
|
1926
|
+
this.menuService.actionItem.next({ event: act.event || act.title || 'default', data: act.data });
|
|
1927
|
+
}
|
|
1928
|
+
this.hide();
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
onActionIconClick(actionIcon, data) {
|
|
1932
|
+
if (!this.disabled(actionIcon)) {
|
|
1933
|
+
actionIcon.action(data);
|
|
1934
|
+
this.hide();
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
DrDropdownComponent.decorators = [
|
|
1939
|
+
{ type: Component, args: [{
|
|
1940
|
+
selector: 'dr-dropdown',
|
|
1941
|
+
template: "<div #menuContainer\r\n (clickOutside)=\"onClickedOutside()\"\r\n [drDropdownPosition]=\"option\"\r\n [position]=\"position\"\r\n class=\"dr-dropdown\">\r\n <div class=\"dr-dropdown__container\">\r\n <div *ngFor=\"let act of list | drDropdownItemShowPipe\"\r\n (click)=\"action(act)\"\r\n [drTooltip]=\"tooltipToShow(act)\"\r\n [drTooltipPosition]=\"'top'\"\r\n [drTooltipOptions]=\"{ withoutArrow: true }\"\r\n class=\"dr-dropdown__container__item\"\r\n [class.item-disabled]=\"disabled(act)\">\r\n\r\n <i *ngIf=\"act.icon\" [class]=\"act.icon\"></i>\r\n <span class=\"dr-dropdown__container__item__text\">{{act.title}}</span>\r\n <i *ngFor=\"let actionIcon of act.actionIcons\"\r\n [class]=\"actionIcon.icon\"\r\n (click)=\"onActionIconClick(actionIcon, act.data)\"></i>\r\n <i *ngIf=\"act.children?.length\" class=\"dr-icon-arrow-right\"></i>\r\n <dr-dropdown *ngIf=\"act.children?.length\" [options]=\"act.childOptions\"></dr-dropdown>\r\n </div>\r\n </div>\r\n</div>\r\n",
|
|
1942
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1943
|
+
styles: ["::ng-deep .dr-dropdown__container__item .dr-dropdown{visibility:hidden}::ng-deep .dr-dropdown__container__item:hover .dr-dropdown{visibility:visible}.dr-dropdown{position:absolute;z-index:-1;top:0;left:0;width:auto}.dr-dropdown__container{display:flex;flex-direction:column;background:#fff;border-radius:4px;box-shadow:0 4px 8px 1px #00000040;padding:8px 0;overflow-y:auto;max-height:60vh}.dr-dropdown__container__item{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}.dr-dropdown__container__item:hover{background-color:#f6f7f8}.dr-dropdown__container__item.item-disabled{color:#bcbcbc;pointer-events:none}.dr-dropdown__container__item i:first-child{margin-right:8px}.dr-dropdown__container__item__text{margin-right:auto}.dr-dropdown__container__item i,.dr-dropdown__container__item__text{color:#151b3f}.dr-dropdown.content-top{transform:translate(-50%,-100%)}.dr-dropdown.content-top-left{transform:translate(-100%,-100%)}.dr-dropdown.content-bottom{transform:translate(-50%,50%)}.dr-dropdown.content-bottom-left{transform:translate(-90%,35%)}.dr-dropdown.content-left{transform:translate(-100%)}.dr-dropdown.content-left-center{transform:translate(-100%,-50%)}.dr-dropdown.content-right{transform:translate(5%)}\n"]
|
|
1944
|
+
},] }
|
|
1945
|
+
];
|
|
1946
|
+
DrDropdownComponent.ctorParameters = () => [
|
|
1947
|
+
{ type: DrDropdownService },
|
|
1948
|
+
{ type: ChangeDetectorRef }
|
|
1949
|
+
];
|
|
1950
|
+
DrDropdownComponent.propDecorators = {
|
|
1951
|
+
viewMenu: [{ type: ViewChild, args: ['listMenu',] }],
|
|
1952
|
+
menuContainer: [{ type: ViewChild, args: ['menuContainer',] }],
|
|
1953
|
+
options: [{ type: Input }]
|
|
1954
|
+
};
|
|
1955
|
+
|
|
1956
|
+
class DrDropdownDirective {
|
|
1957
|
+
constructor(componentFactoryResolver, viewContainerRef, service, el, _document) {
|
|
1958
|
+
this.componentFactoryResolver = componentFactoryResolver;
|
|
1959
|
+
this.viewContainerRef = viewContainerRef;
|
|
1960
|
+
this.service = service;
|
|
1961
|
+
this.el = el;
|
|
1962
|
+
this._document = _document;
|
|
1963
|
+
this.position = 'left';
|
|
1964
|
+
}
|
|
1965
|
+
elementClick() {
|
|
1966
|
+
const option = this.el.nativeElement.getBoundingClientRect();
|
|
1967
|
+
this._document.querySelectorAll('dr-dropdown').forEach(item => item.remove());
|
|
1968
|
+
if (this.contentCmpRef && this.contentCmpRef.destroyCbs) {
|
|
1969
|
+
this.contentCmpRef.destroy();
|
|
1970
|
+
this.contentCmpRef = null;
|
|
1971
|
+
}
|
|
1972
|
+
else {
|
|
1973
|
+
this.service.destroy();
|
|
1974
|
+
this.showMenu({
|
|
1975
|
+
option,
|
|
1976
|
+
position: this.position,
|
|
1977
|
+
list: this.drDropdown,
|
|
1978
|
+
});
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
documentClick(e) {
|
|
1982
|
+
const menuItem = e.target.classList;
|
|
1983
|
+
if (menuItem.contains('dr-dropdown__container__item') || menuItem.contains('dr-dropdown__container__item__text')) {
|
|
1984
|
+
return;
|
|
1985
|
+
}
|
|
1986
|
+
const elems = this._document.querySelectorAll('dr-dropdown');
|
|
1987
|
+
if (!e.target.contains(this.el.nativeElement) && this.contentCmpRef || elems.length && !e.target.contains(this.el.nativeElement)) {
|
|
1988
|
+
setTimeout(() => elems.forEach(item => item.remove()), 100);
|
|
1989
|
+
}
|
|
1990
|
+
}
|
|
1991
|
+
showMenu(options) {
|
|
1992
|
+
let componentFactory;
|
|
1993
|
+
componentFactory = this.componentFactoryResolver.resolveComponentFactory(DrDropdownComponent);
|
|
1994
|
+
this.contentCmpRef = this.viewContainerRef.createComponent(componentFactory);
|
|
1995
|
+
this.service.addMenu = this.contentCmpRef;
|
|
1996
|
+
this._document.querySelector('nb-layout').appendChild(this.contentCmpRef.location.nativeElement);
|
|
1997
|
+
this.contentCmpRef.instance.options = options;
|
|
1998
|
+
}
|
|
1999
|
+
ngOnDestroy() {
|
|
2000
|
+
if (this.contentCmpRef) {
|
|
2001
|
+
this.contentCmpRef.destroy();
|
|
2002
|
+
}
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
DrDropdownDirective.decorators = [
|
|
2006
|
+
{ type: Directive, args: [{
|
|
2007
|
+
selector: '[drDropdown]'
|
|
2008
|
+
},] }
|
|
2009
|
+
];
|
|
2010
|
+
DrDropdownDirective.ctorParameters = () => [
|
|
2011
|
+
{ type: ComponentFactoryResolver },
|
|
2012
|
+
{ type: ViewContainerRef },
|
|
2013
|
+
{ type: DrDropdownService },
|
|
2014
|
+
{ type: ElementRef },
|
|
2015
|
+
{ type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
|
|
2016
|
+
];
|
|
2017
|
+
DrDropdownDirective.propDecorators = {
|
|
2018
|
+
position: [{ type: Input }],
|
|
2019
|
+
drDropdown: [{ type: Input }],
|
|
2020
|
+
contentCmpRef: [{ type: ViewChild, args: [DrDropdownComponent, { static: true, read: ViewContainerRef },] }],
|
|
2021
|
+
elementClick: [{ type: HostListener, args: ['click',] }],
|
|
2022
|
+
documentClick: [{ type: HostListener, args: ['document:mouseup', ['$event'],] }]
|
|
2023
|
+
};
|
|
2024
|
+
|
|
2025
|
+
class DrDropdownPositionDirective {
|
|
2026
|
+
constructor(el, renderer) {
|
|
2027
|
+
this.el = el;
|
|
2028
|
+
this.renderer = renderer;
|
|
2029
|
+
this.position = 'left';
|
|
2030
|
+
}
|
|
2031
|
+
ngOnInit() {
|
|
2032
|
+
setTimeout(this.calculatePosition.bind(this), 1);
|
|
2033
|
+
}
|
|
2034
|
+
calculatePosition() {
|
|
2035
|
+
let defaultDelta = 10;
|
|
2036
|
+
let defaultPadding = 0;
|
|
2037
|
+
if (this.position === 'child') {
|
|
2038
|
+
defaultDelta = 0;
|
|
2039
|
+
defaultPadding = 10;
|
|
2040
|
+
const parentRect = this.el.nativeElement.parentElement.parentElement.getBoundingClientRect();
|
|
2041
|
+
this.position = {
|
|
2042
|
+
x: this.el.nativeElement.parentElement.parentElement.offsetWidth + 2,
|
|
2043
|
+
y: this.el.nativeElement.parentElement.parentElement.offsetTop - 9,
|
|
2044
|
+
clientX: parentRect.x + this.el.nativeElement.parentElement.parentElement.offsetWidth,
|
|
2045
|
+
clientY: parentRect.y
|
|
2046
|
+
};
|
|
2047
|
+
}
|
|
2048
|
+
if (typeof this.position === 'string') {
|
|
2049
|
+
this.renderer.setStyle(this.el.nativeElement, 'top', this.position === 'bottom' ?
|
|
2050
|
+
this.drDropdownPosition.y - this.drDropdownPosition.height + 'px' :
|
|
2051
|
+
this.drDropdownPosition.y + 'px');
|
|
2052
|
+
this.renderer.setStyle(this.el.nativeElement, 'left', this.position === 'right' ?
|
|
2053
|
+
this.drDropdownPosition.x + this.drDropdownPosition.width + 'px' :
|
|
2054
|
+
this.drDropdownPosition.x + 'px');
|
|
2055
|
+
const menuHeight = this.el.nativeElement.offsetHeight;
|
|
2056
|
+
const heightMoreWindowBottom = menuHeight + this.drDropdownPosition.y > window.innerHeight;
|
|
2057
|
+
const heightMoreWindowTop = menuHeight - this.drDropdownPosition.y + this.drDropdownPosition.height / 2 > 48; // header height;
|
|
2058
|
+
const widthMoreWindowRight = this.drDropdownPosition.x + 250 > window.innerWidth;
|
|
2059
|
+
if (heightMoreWindowBottom) {
|
|
2060
|
+
this.position = 'top';
|
|
2061
|
+
}
|
|
2062
|
+
if (heightMoreWindowBottom && widthMoreWindowRight && !heightMoreWindowTop || this.position === 'top-left') {
|
|
2063
|
+
this.position = 'top-left';
|
|
2064
|
+
this.renderer.setStyle(this.el.nativeElement, 'transform', 'translate(-100%, calc(-100% + ' + this.drDropdownPosition.height + 'px))');
|
|
2065
|
+
}
|
|
2066
|
+
if (heightMoreWindowTop && heightMoreWindowBottom) {
|
|
2067
|
+
this.position = 'left-center';
|
|
2068
|
+
}
|
|
2069
|
+
if (this.position === 'bottom-left') {
|
|
2070
|
+
this.renderer.setStyle(this.el.nativeElement, 'transform', `translate(-90%, ${this.drDropdownPosition.height + this.drDropdownPosition.height / 2}px)`);
|
|
2071
|
+
}
|
|
2072
|
+
const className = this.position === 'top' ? 'content-top'
|
|
2073
|
+
: this.position === 'top-left' ? 'content-top-left'
|
|
2074
|
+
: this.position === 'bottom' ? 'content-bottom'
|
|
2075
|
+
: this.position === 'bottom-left' ? 'content-bottom-left'
|
|
2076
|
+
: this.position === 'left' ? 'content-left'
|
|
2077
|
+
: this.position === 'left-center' ? 'content-left-center'
|
|
2078
|
+
: this.position === 'right' ? 'content-right' : '';
|
|
2079
|
+
this.renderer.addClass(this.el.nativeElement, className);
|
|
2080
|
+
this.renderer.setStyle(this.el.nativeElement, 'z-index', '10010');
|
|
2081
|
+
}
|
|
2082
|
+
else {
|
|
2083
|
+
const widthMoreWindowRight = window.innerWidth - this.position.clientX - this.el.nativeElement.offsetWidth - defaultPadding;
|
|
2084
|
+
const deltaWidth = widthMoreWindowRight < 0 ? widthMoreWindowRight : defaultDelta;
|
|
2085
|
+
const widthMoreWindowBottom = window.innerHeight - this.position.clientY - this.el.nativeElement.offsetHeight - defaultPadding;
|
|
2086
|
+
const deltaHeight = widthMoreWindowBottom < 0 ? widthMoreWindowBottom : defaultDelta;
|
|
2087
|
+
this.renderer.setStyle(this.el.nativeElement, 'top', (this.position.y + deltaHeight) + 'px');
|
|
2088
|
+
this.renderer.setStyle(this.el.nativeElement, 'left', (this.position.x + deltaWidth) + 'px');
|
|
2089
|
+
this.renderer.setStyle(this.el.nativeElement, 'z-index', '10010');
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
DrDropdownPositionDirective.decorators = [
|
|
2094
|
+
{ type: Directive, args: [{
|
|
2095
|
+
selector: '[drDropdownPosition]'
|
|
2096
|
+
},] }
|
|
2097
|
+
];
|
|
2098
|
+
DrDropdownPositionDirective.ctorParameters = () => [
|
|
2099
|
+
{ type: ElementRef },
|
|
2100
|
+
{ type: Renderer2 }
|
|
2101
|
+
];
|
|
2102
|
+
DrDropdownPositionDirective.propDecorators = {
|
|
2103
|
+
drDropdownPosition: [{ type: Input }],
|
|
2104
|
+
position: [{ type: Input }]
|
|
2105
|
+
};
|
|
2106
|
+
|
|
2107
|
+
class DrDropdownItemShowPipe {
|
|
2108
|
+
transform(arr) {
|
|
2109
|
+
return arr.filter(item => item.show ? item.show(item.data) : true);
|
|
2110
|
+
}
|
|
2111
|
+
}
|
|
2112
|
+
DrDropdownItemShowPipe.decorators = [
|
|
2113
|
+
{ type: Pipe, args: [{
|
|
2114
|
+
name: 'drDropdownItemShowPipe'
|
|
2115
|
+
},] }
|
|
2116
|
+
];
|
|
2117
|
+
|
|
1198
2118
|
const components$2 = [DateTagComponent,
|
|
1199
2119
|
DayTagComponent,
|
|
1200
2120
|
WeekTagComponent,
|
|
@@ -1266,18 +2186,58 @@ DrTagModule.decorators = [
|
|
|
1266
2186
|
},] }
|
|
1267
2187
|
];
|
|
1268
2188
|
|
|
1269
|
-
const components$1 = [RadioButtonComponent, CheckboxComponent, DrInputComponent, DrSelectComponent, DrToggleComponent];
|
|
2189
|
+
const components$1 = [DrButtonComponent, RadioButtonComponent, CheckboxComponent, DrInputComponent, DrSelectComponent, DrToggleComponent, DrDatePickerComponent, DrDatePickerFormatDirective];
|
|
1270
2190
|
class DrInputsModule {
|
|
1271
2191
|
}
|
|
1272
2192
|
DrInputsModule.decorators = [
|
|
1273
2193
|
{ type: NgModule, args: [{
|
|
1274
|
-
declarations:
|
|
2194
|
+
declarations: [
|
|
2195
|
+
components$1,
|
|
2196
|
+
],
|
|
1275
2197
|
exports: components$1,
|
|
1276
2198
|
imports: [
|
|
1277
2199
|
FormsModule,
|
|
1278
2200
|
ReactiveFormsModule,
|
|
1279
2201
|
CommonModule,
|
|
1280
2202
|
NgSelectModule,
|
|
2203
|
+
MatDatepickerModule,
|
|
2204
|
+
]
|
|
2205
|
+
},] }
|
|
2206
|
+
];
|
|
2207
|
+
|
|
2208
|
+
class DrTooltipModule {
|
|
2209
|
+
}
|
|
2210
|
+
DrTooltipModule.decorators = [
|
|
2211
|
+
{ type: NgModule, args: [{
|
|
2212
|
+
imports: [
|
|
2213
|
+
CommonModule
|
|
2214
|
+
],
|
|
2215
|
+
exports: [
|
|
2216
|
+
TooltipComponent,
|
|
2217
|
+
DrTooltipDirective,
|
|
2218
|
+
],
|
|
2219
|
+
providers: [],
|
|
2220
|
+
declarations: [
|
|
2221
|
+
TooltipComponent,
|
|
2222
|
+
DrTooltipDirective,
|
|
2223
|
+
],
|
|
2224
|
+
},] }
|
|
2225
|
+
];
|
|
2226
|
+
|
|
2227
|
+
class DrAvatarModule {
|
|
2228
|
+
}
|
|
2229
|
+
DrAvatarModule.decorators = [
|
|
2230
|
+
{ type: NgModule, args: [{
|
|
2231
|
+
declarations: [
|
|
2232
|
+
DrAvatarComponent
|
|
2233
|
+
],
|
|
2234
|
+
exports: [
|
|
2235
|
+
DrAvatarComponent
|
|
2236
|
+
],
|
|
2237
|
+
imports: [
|
|
2238
|
+
MatTooltipModule,
|
|
2239
|
+
DrTooltipModule,
|
|
2240
|
+
CommonModule
|
|
1281
2241
|
]
|
|
1282
2242
|
},] }
|
|
1283
2243
|
];
|
|
@@ -1296,11 +2256,56 @@ DrSpinnerModule.decorators = [
|
|
|
1296
2256
|
},] }
|
|
1297
2257
|
];
|
|
1298
2258
|
|
|
2259
|
+
class DrPopoverModule {
|
|
2260
|
+
}
|
|
2261
|
+
DrPopoverModule.decorators = [
|
|
2262
|
+
{ type: NgModule, args: [{
|
|
2263
|
+
imports: [
|
|
2264
|
+
CommonModule,
|
|
2265
|
+
],
|
|
2266
|
+
exports: [
|
|
2267
|
+
DrPopoverDirective,
|
|
2268
|
+
DrPopoverComponent,
|
|
2269
|
+
],
|
|
2270
|
+
providers: [],
|
|
2271
|
+
declarations: [
|
|
2272
|
+
DrPopoverDirective,
|
|
2273
|
+
DrPopoverComponent,
|
|
2274
|
+
],
|
|
2275
|
+
},] }
|
|
2276
|
+
];
|
|
2277
|
+
|
|
2278
|
+
class DrDropdownModule {
|
|
2279
|
+
}
|
|
2280
|
+
DrDropdownModule.decorators = [
|
|
2281
|
+
{ type: NgModule, args: [{
|
|
2282
|
+
imports: [
|
|
2283
|
+
CommonModule,
|
|
2284
|
+
DrTooltipModule,
|
|
2285
|
+
],
|
|
2286
|
+
declarations: [
|
|
2287
|
+
DrDropdownDirective,
|
|
2288
|
+
DrDropdownPositionDirective,
|
|
2289
|
+
DrDropdownComponent,
|
|
2290
|
+
DrDropdownItemShowPipe,
|
|
2291
|
+
],
|
|
2292
|
+
exports: [
|
|
2293
|
+
DrDropdownDirective,
|
|
2294
|
+
DrDropdownPositionDirective,
|
|
2295
|
+
DrDropdownComponent,
|
|
2296
|
+
DrDropdownItemShowPipe,
|
|
2297
|
+
],
|
|
2298
|
+
providers: [
|
|
2299
|
+
DrDropdownService,
|
|
2300
|
+
],
|
|
2301
|
+
},] }
|
|
2302
|
+
];
|
|
2303
|
+
|
|
1299
2304
|
/* components */
|
|
1300
2305
|
|
|
1301
2306
|
/**
|
|
1302
2307
|
* Generated bundle index. Do not edit.
|
|
1303
2308
|
*/
|
|
1304
2309
|
|
|
1305
|
-
export { AnyTagComponent, CheckboxComponent, DateTagComponent, DateTagModule, DayTagComponent, DrInputComponent, DrInputsModule, DrSelectComponent, DrSpinnerComponent, DrSpinnerDirective, DrSpinnerModule, DrTagComponent, DrTagModule, DrToggleComponent, ForecastTagComponent, ISpinnerOptions, ListTagComponent, ListTagModule, MonthTagComponent, QuarterTagComponent, RadioButtonComponent, WeekTagComponent, YearTagComponent, components$2 as ɵa };
|
|
2310
|
+
export { AnyTagComponent, CheckboxComponent, DateTagComponent, DateTagModule, DayTagComponent, DrAvatarComponent, DrAvatarModule, DrButtonComponent, DrDatePickerComponent, DrDatePickerFormatDirective, DrDropdownComponent, DrDropdownDirective, DrDropdownItemShowPipe, DrDropdownModule, DrDropdownPositionDirective, DrDropdownService, DrInputComponent, DrInputsModule, DrPopoverComponent, DrPopoverDirective, DrPopoverModule, DrSelectComponent, DrSpinnerComponent, DrSpinnerDirective, DrSpinnerModule, DrTagComponent, DrTagModule, DrToggleComponent, DrTooltipDirective, DrTooltipModule, ForecastTagComponent, ISpinnerOptions, ListTagComponent, ListTagModule, MonthTagComponent, QuarterTagComponent, RadioButtonComponent, TooltipComponent, WeekTagComponent, YearTagComponent, components$2 as ɵa, POPUP_ANIMATION as ɵb, CustomDateFormat as ɵc };
|
|
1306
2311
|
//# sourceMappingURL=datarailsshared-datarailsshared.js.map
|