@datarailsshared/datarailsshared 1.3.9 → 1.3.12
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/_datarailsshared.styles.css +4 -0
- package/assets/styles/_styles.scss +2 -0
- package/bundles/datarailsshared-datarailsshared.umd.js +307 -90
- package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
- package/datarailsshared-datarailsshared-1.3.12.tgz +0 -0
- package/datarailsshared-datarailsshared.metadata.json +1 -1
- package/esm2015/lib/dr-avatar/dr-avatar.component.js +17 -10
- package/esm2015/lib/dr-dropdown/dr-dropdown.component.js +5 -3
- package/esm2015/lib/dr-inputs/button/button.component.js +6 -2
- package/esm2015/lib/dr-inputs/dr-input/dr-input.component.js +26 -9
- package/esm2015/lib/dr-inputs/dr-toggle/dr-toggle.component.js +1 -1
- package/esm2015/lib/dr-inputs/radio-button/radio-button.component.js +1 -1
- package/esm2015/lib/dr-popover/dr-popover-ref.js +20 -0
- package/esm2015/lib/dr-popover/dr-popover.component.js +33 -27
- package/esm2015/lib/dr-popover/dr-popover.directive.js +39 -42
- package/esm2015/lib/dr-popover/dr-popover.module.js +4 -4
- package/esm2015/lib/dr-popover/dr-popover.service.js +76 -0
- package/esm2015/lib/dr-tabs/dr-tab.component.js +23 -0
- package/esm2015/lib/dr-tabs/dr-tabs.component.js +27 -0
- package/esm2015/lib/dr-tabs/dr-tabs.module.js +30 -0
- package/esm2015/lib/models/popover.js +13 -0
- package/esm2015/public-api.js +6 -1
- package/fesm2015/datarailsshared-datarailsshared.js +288 -84
- package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
- package/lib/dr-avatar/dr-avatar.component.d.ts +4 -2
- package/lib/dr-inputs/button/button.component.d.ts +1 -0
- package/lib/dr-inputs/dr-input/dr-input.component.d.ts +7 -2
- package/lib/dr-inputs/dr-toggle/dr-toggle.component.d.ts +1 -1
- package/lib/dr-popover/dr-popover-ref.d.ts +16 -0
- package/lib/dr-popover/dr-popover.component.d.ts +12 -7
- package/lib/dr-popover/dr-popover.directive.d.ts +19 -15
- package/lib/dr-popover/dr-popover.service.d.ts +16 -0
- package/lib/dr-tabs/dr-tab.component.d.ts +8 -0
- package/lib/dr-tabs/dr-tabs.component.d.ts +10 -0
- package/lib/dr-tabs/dr-tabs.module.d.ts +2 -0
- package/lib/models/popover.d.ts +22 -0
- package/package.json +1 -1
- package/public-api.d.ts +5 -0
- package/datarailsshared-datarailsshared-1.3.9.tgz +0 -0
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, Component, ViewEncapsulation, Input, Output, ChangeDetectionStrategy, ChangeDetectorRef, forwardRef, ElementRef, Renderer2, HostBinding, ContentChild, TemplateRef, Directive, HostListener, ComponentFactoryResolver, ViewContainerRef, Inject, ViewChild, Optional, Injectable, Pipe, NgModule } from '@angular/core';
|
|
2
|
+
import { EventEmitter, Component, ViewEncapsulation, Input, Output, ChangeDetectionStrategy, ChangeDetectorRef, forwardRef, ElementRef, Renderer2, HostBinding, ContentChild, TemplateRef, Directive, HostListener, ComponentFactoryResolver, ViewContainerRef, Inject, ViewChild, Optional, Injector, Injectable, Pipe, ContentChildren, NgModule } from '@angular/core';
|
|
3
3
|
import { FormControl, NG_VALUE_ACCESSOR, NgControl, FormsModule, ReactiveFormsModule } 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';
|
|
7
|
+
import { noop as noop$1, Subject } from 'rxjs';
|
|
7
8
|
import { transition, style, animate, trigger } from '@angular/animations';
|
|
8
|
-
import
|
|
9
|
+
import * as i1 from '@angular/cdk/overlay';
|
|
10
|
+
import { Overlay, OverlayPositionBuilder, OverlayConfig } from '@angular/cdk/overlay';
|
|
9
11
|
import { ComponentPortal } from '@angular/cdk/portal';
|
|
10
12
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
11
|
-
import {
|
|
13
|
+
import { first } from 'rxjs/operators';
|
|
12
14
|
import { MatDatepickerModule } from '@angular/material/datepicker';
|
|
13
15
|
import { MatFormFieldModule } from '@angular/material/form-field';
|
|
14
16
|
import { MatInputModule } from '@angular/material/input';
|
|
@@ -16,6 +18,7 @@ import { MatSelectModule } from '@angular/material/select';
|
|
|
16
18
|
import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
17
19
|
import { NgSelectModule } from '@ng-select/ng-select';
|
|
18
20
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
21
|
+
import { MatTabsModule } from '@angular/material/tabs';
|
|
19
22
|
|
|
20
23
|
// import {*} from ""
|
|
21
24
|
class DateTagComponent {
|
|
@@ -819,7 +822,7 @@ RadioButtonComponent.decorators = [
|
|
|
819
822
|
],
|
|
820
823
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
821
824
|
encapsulation: ViewEncapsulation.ShadowDom,
|
|
822
|
-
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;
|
|
825
|
+
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;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;background-image: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> ');background-repeat:no-repeat;background-position:center;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"]
|
|
823
826
|
},] }
|
|
824
827
|
];
|
|
825
828
|
RadioButtonComponent.ctorParameters = () => [
|
|
@@ -889,7 +892,8 @@ class DrInputComponent {
|
|
|
889
892
|
this.placeholder = '';
|
|
890
893
|
this.readonly = false;
|
|
891
894
|
this.clearable = false;
|
|
892
|
-
this.
|
|
895
|
+
this.blur = new EventEmitter();
|
|
896
|
+
this.innerValue = null;
|
|
893
897
|
this._disabled = null;
|
|
894
898
|
this._elementClass = [];
|
|
895
899
|
this._buttonOptions = {
|
|
@@ -902,6 +906,8 @@ class DrInputComponent {
|
|
|
902
906
|
this.searchHandler = new EventEmitter();
|
|
903
907
|
this.buttonHandler = new EventEmitter();
|
|
904
908
|
this.tabindex = -1;
|
|
909
|
+
this.onChangeCallback = noop$1;
|
|
910
|
+
this.onTouchedCallback = noop$1;
|
|
905
911
|
this.onChange = () => { };
|
|
906
912
|
this.onTouched = () => { };
|
|
907
913
|
}
|
|
@@ -937,6 +943,16 @@ class DrInputComponent {
|
|
|
937
943
|
set(val) {
|
|
938
944
|
this._elementClass = val.split(' ');
|
|
939
945
|
}
|
|
946
|
+
get value() {
|
|
947
|
+
return this.innerValue;
|
|
948
|
+
}
|
|
949
|
+
set value(v) {
|
|
950
|
+
if (v !== this.innerValue) {
|
|
951
|
+
this.innerValue = v;
|
|
952
|
+
this.onChangeCallback(v);
|
|
953
|
+
}
|
|
954
|
+
this.cdr.markForCheck();
|
|
955
|
+
}
|
|
940
956
|
ngAfterViewInit() {
|
|
941
957
|
if (this.clearable) {
|
|
942
958
|
this._elementClass.push('clearable');
|
|
@@ -952,15 +968,17 @@ class DrInputComponent {
|
|
|
952
968
|
}
|
|
953
969
|
}
|
|
954
970
|
registerOnChange(fn) {
|
|
955
|
-
this.
|
|
971
|
+
this.onChangeCallback = fn;
|
|
956
972
|
}
|
|
957
973
|
registerOnTouched(fn) {
|
|
958
|
-
this.
|
|
974
|
+
this.onTouchedCallback = fn;
|
|
959
975
|
}
|
|
960
976
|
writeValue(value) {
|
|
961
|
-
this.
|
|
962
|
-
|
|
963
|
-
|
|
977
|
+
if (value !== this.innerValue) {
|
|
978
|
+
this.innerValue = value;
|
|
979
|
+
this.updateChanges();
|
|
980
|
+
this.cdr.markForCheck();
|
|
981
|
+
}
|
|
964
982
|
}
|
|
965
983
|
updateChanges() {
|
|
966
984
|
this.onChange(this.value);
|
|
@@ -993,14 +1011,14 @@ class DrInputComponent {
|
|
|
993
1011
|
DrInputComponent.decorators = [
|
|
994
1012
|
{ type: Component, args: [{
|
|
995
1013
|
selector: 'dr-input',
|
|
996
|
-
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 [name]=\"name\"\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",
|
|
1014
|
+
template: "<ng-content select=\"[prefixIcon]\"></ng-content>\r\n<input [(ngModel)]=\"value\"\r\n (ngModelChange)=\"updateChanges()\"\r\n (blur)=\"blur.emit(value); onTouched()\"\r\n [disabled]=\"_disabled\"\r\n [readonly]=\"readonly\"\r\n [type]=\"type\"\r\n [placeholder]=\"placeholder\"\r\n [name]=\"name\"\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",
|
|
997
1015
|
providers: [{
|
|
998
1016
|
provide: NG_VALUE_ACCESSOR,
|
|
999
1017
|
useExisting: forwardRef(() => DrInputComponent),
|
|
1000
1018
|
multi: true
|
|
1001
1019
|
}],
|
|
1002
1020
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1003
|
-
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"]
|
|
1021
|
+
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;outline:none}: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"]
|
|
1004
1022
|
},] }
|
|
1005
1023
|
];
|
|
1006
1024
|
DrInputComponent.ctorParameters = () => [
|
|
@@ -1016,6 +1034,7 @@ DrInputComponent.propDecorators = {
|
|
|
1016
1034
|
placeholder: [{ type: Input }],
|
|
1017
1035
|
readonly: [{ type: Input }],
|
|
1018
1036
|
clearable: [{ type: Input }],
|
|
1037
|
+
blur: [{ type: Output }],
|
|
1019
1038
|
elementClass: [{ type: HostBinding, args: ['class',] }],
|
|
1020
1039
|
searchHandler: [{ type: Output }],
|
|
1021
1040
|
buttonHandler: [{ type: Output }],
|
|
@@ -1088,22 +1107,29 @@ DrSelectComponent.propDecorators = {
|
|
|
1088
1107
|
|
|
1089
1108
|
class DrAvatarComponent {
|
|
1090
1109
|
constructor() {
|
|
1091
|
-
this.users = [];
|
|
1092
1110
|
this.userClicked = new EventEmitter();
|
|
1111
|
+
this.parsedUsers = [];
|
|
1112
|
+
}
|
|
1113
|
+
set users(user) {
|
|
1114
|
+
if (user) {
|
|
1115
|
+
this.parsedUsers = this.parseUsers(user);
|
|
1116
|
+
}
|
|
1093
1117
|
}
|
|
1094
1118
|
ngOnChanges(changes) {
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
this.getFirstUsers().forEach((user, index) => user.class = `icon-${index}`);
|
|
1119
|
+
if (changes.users) {
|
|
1120
|
+
this.getFirstUsers().forEach((user) => user.class = `icon-${this.getRandomValue(5)}`);
|
|
1098
1121
|
this.getLastUsers().forEach((user) => user.class = `icon-${this.getRandomValue(5)}`);
|
|
1099
1122
|
}
|
|
1100
1123
|
}
|
|
1124
|
+
parseUsers(value) {
|
|
1125
|
+
return Array.isArray(value) ? value : Array.of(value);
|
|
1126
|
+
}
|
|
1101
1127
|
getFirstUsers() {
|
|
1102
|
-
return this.
|
|
1128
|
+
return this.parsedUsers.slice(0, 2);
|
|
1103
1129
|
}
|
|
1104
1130
|
getLastUsers() {
|
|
1105
|
-
if (this.
|
|
1106
|
-
return this.
|
|
1131
|
+
if (this.parsedUsers.length > 2) {
|
|
1132
|
+
return this.parsedUsers.slice(2, this.parsedUsers.length - 1);
|
|
1107
1133
|
}
|
|
1108
1134
|
return [];
|
|
1109
1135
|
}
|
|
@@ -1114,7 +1140,7 @@ class DrAvatarComponent {
|
|
|
1114
1140
|
DrAvatarComponent.decorators = [
|
|
1115
1141
|
{ type: Component, args: [{
|
|
1116
1142
|
selector: 'dr-avatar',
|
|
1117
|
-
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=\"
|
|
1143
|
+
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=\"parsedUsers.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",
|
|
1118
1144
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1119
1145
|
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"]
|
|
1120
1146
|
},] }
|
|
@@ -1484,13 +1510,15 @@ class DrButtonComponent {
|
|
|
1484
1510
|
this.click = new EventEmitter();
|
|
1485
1511
|
}
|
|
1486
1512
|
onClick($event) {
|
|
1513
|
+
$event.preventDefault();
|
|
1514
|
+
$event.stopPropagation();
|
|
1487
1515
|
this.click.emit($event);
|
|
1488
1516
|
}
|
|
1489
1517
|
}
|
|
1490
1518
|
DrButtonComponent.decorators = [
|
|
1491
1519
|
{ type: Component, args: [{
|
|
1492
1520
|
selector: 'dr-button',
|
|
1493
|
-
template: "<button (click)=\"onClick($event)\" [
|
|
1521
|
+
template: "<button (click)=\"onClick($event)\" [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\" [style.color]=\"iconColor || 'inherit'\"></i>\r\n <ng-content></ng-content>\r\n </ng-container>\r\n <i *ngIf=\"isLoading\" class=\"dr dr-spinner\"></i>\r\n</button>",
|
|
1494
1522
|
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"]
|
|
1495
1523
|
},] }
|
|
1496
1524
|
];
|
|
@@ -1502,6 +1530,7 @@ DrButtonComponent.propDecorators = {
|
|
|
1502
1530
|
icon: [{ type: Input }],
|
|
1503
1531
|
isBold: [{ type: Input }],
|
|
1504
1532
|
isLoading: [{ type: Input }],
|
|
1533
|
+
iconColor: [{ type: Input }],
|
|
1505
1534
|
click: [{ type: Output }]
|
|
1506
1535
|
};
|
|
1507
1536
|
// Examples:
|
|
@@ -1509,6 +1538,7 @@ DrButtonComponent.propDecorators = {
|
|
|
1509
1538
|
<dr-button [icon]="'dr-icon-arrow-down'">hello</dr-button>
|
|
1510
1539
|
<dr-button [icon]="'dr-icon-refresh'" [theme]="'primary-icon'"></dr-button>
|
|
1511
1540
|
<dr-button [icon]="'dr-icon-refresh'" [isDisabled]="true" [theme]="'primary-icon'"></dr-button>
|
|
1541
|
+
<dr-button [theme]="'secondary'" [icon]="'dr-icon-excel'" [iconColor]="'#03A678'"></dr-button>
|
|
1512
1542
|
|
|
1513
1543
|
<dr-button [icon]="'dr-icon-refresh'" [theme]="'secondary-icon'"></dr-button>
|
|
1514
1544
|
<dr-button [icon]="'dr-icon-share'" [isDisabled]="true" [theme]="'secondary-icon'"></dr-button>
|
|
@@ -1717,38 +1747,59 @@ DrDatePickerFormatDirective.propDecorators = {
|
|
|
1717
1747
|
datePickerFormat: [{ type: Input, args: ['drDatePickerFormat',] }]
|
|
1718
1748
|
};
|
|
1719
1749
|
|
|
1750
|
+
class DrPopoverRef {
|
|
1751
|
+
constructor(overlayRef) {
|
|
1752
|
+
this.overlayRef = overlayRef;
|
|
1753
|
+
this.onClose$ = new Subject();
|
|
1754
|
+
// FIXME: this decision was made because of the incompatible rxjs version
|
|
1755
|
+
/**
|
|
1756
|
+
* Correct type is @type {Observable<any>}
|
|
1757
|
+
*/
|
|
1758
|
+
this.onClose = this.onClose$.asObservable();
|
|
1759
|
+
this.onBackdropClick = this.overlayRef.backdropClick();
|
|
1760
|
+
}
|
|
1761
|
+
close(res) {
|
|
1762
|
+
this.overlayRef.detach();
|
|
1763
|
+
this.overlayRef.dispose();
|
|
1764
|
+
this.onClose$.next(res);
|
|
1765
|
+
this.onClose$.complete();
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1720
1769
|
class DrPopoverComponent {
|
|
1721
|
-
constructor(cdr, componentFactoryResolver, elementRef) {
|
|
1770
|
+
constructor(cdr, componentFactoryResolver, viewContainerRef, elementRef, popoverRef) {
|
|
1722
1771
|
this.cdr = cdr;
|
|
1723
1772
|
this.componentFactoryResolver = componentFactoryResolver;
|
|
1773
|
+
this.viewContainerRef = viewContainerRef;
|
|
1724
1774
|
this.elementRef = elementRef;
|
|
1775
|
+
this.popoverRef = popoverRef;
|
|
1725
1776
|
this.class = '';
|
|
1726
1777
|
this.isContentTemplate = false;
|
|
1727
1778
|
}
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
if (!this.isContentTemplate) {
|
|
1731
|
-
this.componentRef = template.createComponent(this.componentFactoryResolver.resolveComponentFactory(this.content));
|
|
1732
|
-
this.componentRef.instance['closePopover'] = this.closePopover;
|
|
1733
|
-
for (let key in this.contentContext) {
|
|
1734
|
-
this.componentRef.instance[key] = this.contentContext[key];
|
|
1735
|
-
}
|
|
1736
|
-
}
|
|
1737
|
-
else {
|
|
1738
|
-
this.contentContext.closePopover = this.closePopover;
|
|
1739
|
-
}
|
|
1740
|
-
this.cdr.detectChanges();
|
|
1741
|
-
}
|
|
1742
|
-
;
|
|
1743
|
-
removeOutside(e) {
|
|
1744
|
-
const isTargetHost = this.hostRef.nativeElement === e.target;
|
|
1779
|
+
clickOutside(e) {
|
|
1780
|
+
const isTargetHost = this.hostRef instanceof ElementRef && (this.hostRef.nativeElement === e.target || this.hostRef.nativeElement.contains(e.target));
|
|
1745
1781
|
const isTargetInPopover = this.elementRef.nativeElement.contains(e.target);
|
|
1746
1782
|
const isTargetInDatepicker = e.target.closest('mat-datepicker-popup');
|
|
1747
1783
|
const isTargetInSelect = e.target.closest('ng-dropdown-panel');
|
|
1748
|
-
|
|
1749
|
-
|
|
1784
|
+
const isTargetInDatepickerContent = e.target.closest('mat-datepicker-content');
|
|
1785
|
+
if (!isTargetHost
|
|
1786
|
+
&& !isTargetInPopover
|
|
1787
|
+
&& !isTargetInDatepicker
|
|
1788
|
+
&& !isTargetInSelect
|
|
1789
|
+
&& !isTargetInDatepickerContent
|
|
1790
|
+
&& !this.manualClosing) {
|
|
1791
|
+
this.popoverRef.close();
|
|
1750
1792
|
}
|
|
1751
1793
|
}
|
|
1794
|
+
ngOnInit() {
|
|
1795
|
+
this.isContentTemplate = this.content instanceof TemplateRef;
|
|
1796
|
+
if (!this.isContentTemplate) {
|
|
1797
|
+
this.componentRef = this.viewContainerRef.createComponent(this.componentFactoryResolver.resolveComponentFactory(this.content));
|
|
1798
|
+
Object.assign(this.componentRef.instance, this.contentContext);
|
|
1799
|
+
this.popoverContainer.nativeElement.appendChild(this.componentRef.location.nativeElement);
|
|
1800
|
+
}
|
|
1801
|
+
this.cdr.detectChanges();
|
|
1802
|
+
}
|
|
1752
1803
|
}
|
|
1753
1804
|
DrPopoverComponent.decorators = [
|
|
1754
1805
|
{ type: Component, args: [{
|
|
@@ -1757,69 +1808,149 @@ DrPopoverComponent.decorators = [
|
|
|
1757
1808
|
animations: [
|
|
1758
1809
|
trigger('popover', POPUP_ANIMATION),
|
|
1759
1810
|
],
|
|
1760
|
-
|
|
1811
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1812
|
+
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;overflow:auto}::ng-deep .dr-popover-transparent-backdrop{background-color:transparent}\n"]
|
|
1761
1813
|
},] }
|
|
1762
1814
|
];
|
|
1763
1815
|
DrPopoverComponent.ctorParameters = () => [
|
|
1764
1816
|
{ type: ChangeDetectorRef },
|
|
1765
1817
|
{ type: ComponentFactoryResolver },
|
|
1766
|
-
{ type:
|
|
1818
|
+
{ type: ViewContainerRef },
|
|
1819
|
+
{ type: ElementRef },
|
|
1820
|
+
{ type: DrPopoverRef }
|
|
1767
1821
|
];
|
|
1768
1822
|
DrPopoverComponent.propDecorators = {
|
|
1769
1823
|
content: [{ type: Input }],
|
|
1770
1824
|
contentContext: [{ type: Input }],
|
|
1771
1825
|
class: [{ type: Input }],
|
|
1772
1826
|
hostRef: [{ type: Input }],
|
|
1773
|
-
|
|
1774
|
-
popoverContainer: [{ type: ViewChild, args: ['popoverContainer', { read:
|
|
1775
|
-
|
|
1827
|
+
manualClosing: [{ type: Input }],
|
|
1828
|
+
popoverContainer: [{ type: ViewChild, args: ['popoverContainer', { read: ElementRef, static: true },] }],
|
|
1829
|
+
clickOutside: [{ type: HostListener, args: ['document:mouseup', ['$event'],] }]
|
|
1776
1830
|
};
|
|
1777
1831
|
|
|
1778
|
-
|
|
1779
|
-
|
|
1832
|
+
const DEFAULT_CONFIG = {
|
|
1833
|
+
hasBackdrop: false,
|
|
1834
|
+
closeOnBackdropClick: false,
|
|
1835
|
+
backdropClass: 'dr-popover-transparent-backdrop',
|
|
1836
|
+
};
|
|
1837
|
+
const DEFAULT_MODEL = {
|
|
1838
|
+
position: 'bottom',
|
|
1839
|
+
class: '',
|
|
1840
|
+
overlayConfig: {},
|
|
1841
|
+
manualClosing: false,
|
|
1842
|
+
};
|
|
1843
|
+
|
|
1844
|
+
class DrPopoverService {
|
|
1845
|
+
constructor(overlay, overlayPositionBuilder, injector) {
|
|
1780
1846
|
this.overlay = overlay;
|
|
1781
|
-
this.vcRef = vcRef;
|
|
1782
|
-
this.resolver = resolver;
|
|
1783
1847
|
this.overlayPositionBuilder = overlayPositionBuilder;
|
|
1848
|
+
this.injector = injector;
|
|
1849
|
+
}
|
|
1850
|
+
open(content, popoverModel) {
|
|
1851
|
+
if (!content)
|
|
1852
|
+
return;
|
|
1853
|
+
const model = Object.assign(Object.assign({}, DEFAULT_MODEL), popoverModel);
|
|
1854
|
+
const overlayRef = this.createOverlay(model);
|
|
1855
|
+
const popoverRef = new DrPopoverRef(overlayRef);
|
|
1856
|
+
this.attachOverlayContainer(content, model, overlayRef, popoverRef);
|
|
1857
|
+
this.registerCloseListeners(model, overlayRef, popoverRef);
|
|
1858
|
+
return popoverRef;
|
|
1859
|
+
}
|
|
1860
|
+
attachOverlayContainer(content, { contentContext, position, class: elementClass, manualClosing, hostRef }, overlayRef, popoverRef) {
|
|
1861
|
+
const componentPortal = new ComponentPortal(DrPopoverComponent, null, this.createInjector(popoverRef));
|
|
1862
|
+
const contentRef = overlayRef.attach(componentPortal);
|
|
1863
|
+
popoverRef.componentRef = contentRef;
|
|
1864
|
+
contentRef.instance.content = content;
|
|
1865
|
+
contentRef.instance.contentContext = Object.assign(Object.assign({}, contentContext), { closePopover: popoverRef.close.bind(popoverRef) });
|
|
1866
|
+
contentRef.instance.class = elementClass + ' ' + position;
|
|
1867
|
+
contentRef.instance.manualClosing = manualClosing;
|
|
1868
|
+
contentRef.instance.hostRef = hostRef;
|
|
1869
|
+
}
|
|
1870
|
+
createOverlay(popoverModel) {
|
|
1871
|
+
const overlayConfig = this.getOverlayConfig(popoverModel);
|
|
1872
|
+
return this.overlay.create(overlayConfig);
|
|
1873
|
+
}
|
|
1874
|
+
getOverlayConfig(popoverModel) {
|
|
1875
|
+
const config = Object.assign(Object.assign({}, DEFAULT_CONFIG), popoverModel.overlayConfig || {});
|
|
1876
|
+
const positionStrategy = this.overlayPositionBuilder
|
|
1877
|
+
.flexibleConnectedTo(popoverModel.hostRef)
|
|
1878
|
+
.withPositions([POPUP_POSITIONS[popoverModel.position]]);
|
|
1879
|
+
const overlayConfig = new OverlayConfig(Object.assign({ scrollStrategy: this.overlay.scrollStrategies.noop(), positionStrategy }, config));
|
|
1880
|
+
return overlayConfig;
|
|
1881
|
+
}
|
|
1882
|
+
createInjector(popoverRef) {
|
|
1883
|
+
const injectionTokens = [
|
|
1884
|
+
{ provide: DrPopoverRef, useValue: popoverRef },
|
|
1885
|
+
];
|
|
1886
|
+
return Injector.create({ providers: injectionTokens, parent: this.injector });
|
|
1887
|
+
}
|
|
1888
|
+
registerCloseListeners(popoverModel, overlayRef, popoverRef) {
|
|
1889
|
+
const config = popoverModel.overlayConfig || {};
|
|
1890
|
+
const targetElement = popoverModel.targetElement;
|
|
1891
|
+
if ((config === null || config === void 0 ? void 0 : config.closeOnBackdropClick) && (config === null || config === void 0 ? void 0 : config.hasBackdrop)) {
|
|
1892
|
+
overlayRef.backdropClick().subscribe(() => popoverRef.close());
|
|
1893
|
+
}
|
|
1894
|
+
if (targetElement) {
|
|
1895
|
+
targetElement.addEventListener('mouseup', () => popoverRef.close(), { once: true });
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
DrPopoverService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DrPopoverService_Factory() { return new DrPopoverService(i0.ɵɵinject(i1.Overlay), i0.ɵɵinject(i1.OverlayPositionBuilder), i0.ɵɵinject(i0.INJECTOR)); }, token: DrPopoverService, providedIn: "root" });
|
|
1900
|
+
DrPopoverService.decorators = [
|
|
1901
|
+
{ type: Injectable, args: [{
|
|
1902
|
+
providedIn: 'root',
|
|
1903
|
+
},] }
|
|
1904
|
+
];
|
|
1905
|
+
DrPopoverService.ctorParameters = () => [
|
|
1906
|
+
{ type: Overlay },
|
|
1907
|
+
{ type: OverlayPositionBuilder },
|
|
1908
|
+
{ type: Injector }
|
|
1909
|
+
];
|
|
1910
|
+
|
|
1911
|
+
class DrPopoverDirective {
|
|
1912
|
+
constructor(elementRef, drPopoverService) {
|
|
1784
1913
|
this.elementRef = elementRef;
|
|
1914
|
+
this.drPopoverService = drPopoverService;
|
|
1785
1915
|
this.contentContext = {};
|
|
1786
1916
|
this.position = 'bottom';
|
|
1787
1917
|
this.class = '';
|
|
1918
|
+
this.overlayConfig = {};
|
|
1919
|
+
this.popoverClose = new EventEmitter();
|
|
1920
|
+
this.showStateChange = new EventEmitter();
|
|
1788
1921
|
}
|
|
1789
|
-
|
|
1790
|
-
if (this.
|
|
1791
|
-
this.
|
|
1922
|
+
togglePopover() {
|
|
1923
|
+
if (this.popoverRef) {
|
|
1924
|
+
this.closePopover();
|
|
1792
1925
|
}
|
|
1793
1926
|
else {
|
|
1794
1927
|
this.renderPopover();
|
|
1928
|
+
this.showStateChange.emit({ isShown: !!this.popoverRef });
|
|
1795
1929
|
}
|
|
1796
1930
|
}
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
this.overlayRef = this.overlay.create({ positionStrategy });
|
|
1802
|
-
if (!((_a = this.overlayRef) === null || _a === void 0 ? void 0 : _a.hasAttached()) && this.content) {
|
|
1803
|
-
this.contentRef = this.overlayRef.attach(new ComponentPortal(DrPopoverComponent));
|
|
1804
|
-
this.contentRef.instance.content = this.content;
|
|
1805
|
-
this.contentRef.instance.contentContext = this.contentContext;
|
|
1806
|
-
this.contentRef.instance.class = this.class + ' ' + this.position;
|
|
1807
|
-
this.contentRef.instance.hostRef = this.elementRef;
|
|
1808
|
-
this.contentRef.instance.closePopover = this.destroyPopover.bind(this);
|
|
1931
|
+
closePopover(res) {
|
|
1932
|
+
if (this.popoverRef) {
|
|
1933
|
+
this.popoverRef.close(res);
|
|
1934
|
+
this.popoverRef = null;
|
|
1809
1935
|
}
|
|
1810
1936
|
}
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
this.
|
|
1814
|
-
this.
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
this.
|
|
1818
|
-
this.
|
|
1819
|
-
}
|
|
1937
|
+
renderPopover() {
|
|
1938
|
+
const popoverRef = this.popoverRef = this.drPopoverService.open(this.content, {
|
|
1939
|
+
hostRef: this.elementRef,
|
|
1940
|
+
overlayConfig: this.overlayConfig,
|
|
1941
|
+
class: this.class,
|
|
1942
|
+
manualClosing: this.manualClosing,
|
|
1943
|
+
position: this.position,
|
|
1944
|
+
contentContext: this.contentContext,
|
|
1945
|
+
});
|
|
1946
|
+
popoverRef.onClose.pipe(first()).subscribe((res) => {
|
|
1947
|
+
this.closePopover();
|
|
1948
|
+
this.popoverClose.emit(res);
|
|
1949
|
+
this.showStateChange.emit({ isShown: !!this.popoverRef });
|
|
1950
|
+
});
|
|
1820
1951
|
}
|
|
1821
1952
|
ngOnDestroy() {
|
|
1822
|
-
this.
|
|
1953
|
+
this.closePopover();
|
|
1823
1954
|
}
|
|
1824
1955
|
}
|
|
1825
1956
|
DrPopoverDirective.decorators = [
|
|
@@ -1828,18 +1959,19 @@ DrPopoverDirective.decorators = [
|
|
|
1828
1959
|
},] }
|
|
1829
1960
|
];
|
|
1830
1961
|
DrPopoverDirective.ctorParameters = () => [
|
|
1831
|
-
{ type:
|
|
1832
|
-
{ type:
|
|
1833
|
-
{ type: ComponentFactoryResolver },
|
|
1834
|
-
{ type: OverlayPositionBuilder },
|
|
1835
|
-
{ type: ElementRef }
|
|
1962
|
+
{ type: ElementRef },
|
|
1963
|
+
{ type: DrPopoverService }
|
|
1836
1964
|
];
|
|
1837
1965
|
DrPopoverDirective.propDecorators = {
|
|
1838
1966
|
content: [{ type: Input, args: ['drPopover',] }],
|
|
1839
1967
|
contentContext: [{ type: Input, args: ['drPopoverContext',] }],
|
|
1840
1968
|
position: [{ type: Input, args: ['drPopoverPosition',] }],
|
|
1841
1969
|
class: [{ type: Input, args: ['drPopoverClass',] }],
|
|
1842
|
-
|
|
1970
|
+
overlayConfig: [{ type: Input, args: ['drPopoverOverlayConfig',] }],
|
|
1971
|
+
manualClosing: [{ type: Input, args: ['drPopoverManualClosing',] }],
|
|
1972
|
+
popoverClose: [{ type: Output, args: ['drPopoverClose',] }],
|
|
1973
|
+
showStateChange: [{ type: Output, args: ['drPopoverShowStateChange',] }],
|
|
1974
|
+
togglePopover: [{ type: HostListener, args: ['click',] }]
|
|
1843
1975
|
};
|
|
1844
1976
|
|
|
1845
1977
|
class DrDropdownService {
|
|
@@ -1909,8 +2041,10 @@ class DrDropdownComponent {
|
|
|
1909
2041
|
}
|
|
1910
2042
|
}
|
|
1911
2043
|
tooltipToShow(act) {
|
|
1912
|
-
|
|
1913
|
-
|
|
2044
|
+
if (act.toolTipIfDisabled || this.disabled(act) || !act.toolTip) {
|
|
2045
|
+
return '';
|
|
2046
|
+
}
|
|
2047
|
+
return act.toolTip ? act.toolTip : act.title;
|
|
1914
2048
|
}
|
|
1915
2049
|
action(act) {
|
|
1916
2050
|
if (!this.disabled(act)) {
|
|
@@ -2110,6 +2244,53 @@ DrDropdownItemShowPipe.decorators = [
|
|
|
2110
2244
|
},] }
|
|
2111
2245
|
];
|
|
2112
2246
|
|
|
2247
|
+
class DrTabComponent {
|
|
2248
|
+
constructor() { }
|
|
2249
|
+
ngOnInit() {
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2252
|
+
DrTabComponent.decorators = [
|
|
2253
|
+
{ type: Component, args: [{
|
|
2254
|
+
selector: 'dr-tab',
|
|
2255
|
+
template: `
|
|
2256
|
+
<ng-template>
|
|
2257
|
+
<ng-content></ng-content>
|
|
2258
|
+
</ng-template>
|
|
2259
|
+
`
|
|
2260
|
+
},] }
|
|
2261
|
+
];
|
|
2262
|
+
DrTabComponent.ctorParameters = () => [];
|
|
2263
|
+
DrTabComponent.propDecorators = {
|
|
2264
|
+
label: [{ type: Input }],
|
|
2265
|
+
disabled: [{ type: Input }],
|
|
2266
|
+
contentTemplate: [{ type: ViewChild, args: [TemplateRef,] }]
|
|
2267
|
+
};
|
|
2268
|
+
|
|
2269
|
+
class DrTabsComponent {
|
|
2270
|
+
constructor() {
|
|
2271
|
+
this.selectedTab = 0;
|
|
2272
|
+
this.selectedTabChange = new EventEmitter();
|
|
2273
|
+
}
|
|
2274
|
+
selectedIndexChange($event) {
|
|
2275
|
+
this.selectedTab = $event;
|
|
2276
|
+
this.selectedTabChange.emit($event);
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2279
|
+
DrTabsComponent.decorators = [
|
|
2280
|
+
{ type: Component, args: [{
|
|
2281
|
+
selector: 'dr-tabs',
|
|
2282
|
+
template: "<mat-tab-group disableRipple [selectedIndex]=\"selectedTab\"\r\n (selectedIndexChange)=\"selectedIndexChange($event)\"\r\n [class.with-radio]=\"withRadio\">\r\n <mat-tab *ngFor=\"let tab of tabsContentList; let index = index\" label=\"{{tab.label}}\" [disabled]=\"tab.disabled\" >\r\n <ng-container *ngIf=\"withRadio\">\r\n <ng-template mat-tab-label>\r\n <dr-radio-button [value]=\"index\"\r\n [(ngModel)]=\"selectedTab\">\r\n </dr-radio-button>\r\n {{tab.label}}\r\n </ng-template>\r\n </ng-container>\r\n\r\n <ng-container *ngTemplateOutlet=\"tab.contentTemplate\" ></ng-container>\r\n </mat-tab>\r\n</mat-tab-group>\r\n",
|
|
2283
|
+
styles: [":host{width:100%}:host ::ng-deep .mat-tab-group,:host ::ng-deep .mat-tab-body-wrapper{height:100%}:host ::ng-deep .mat-tab-nav-bar,:host ::ng-deep .mat-tab-header{border-bottom:1px solid #D5DAE5}:host ::ng-deep .mat-tab-labels{padding:0 17px}:host ::ng-deep .mat-tab-label{padding:0 8px;min-width:0;height:38px;opacity:1}:host ::ng-deep .mat-tab-label:not(:last-child){margin-right:21px}:host ::ng-deep .mat-tab-label-active .mat-tab-label-content{color:#579bf2;font-weight:700}:host ::ng-deep .mat-tab-label-content{font-weight:400;font-size:14px;line-height:22px;color:#51566f;font-family:\"Nunito Sans\",sans-serif}:host ::ng-deep .mat-ink-bar{height:3px;border-radius:5px;background-color:#579bf2!important}:host ::ng-deep .with-radio .mat-tab-labels{padding:0;margin-bottom:8px}:host ::ng-deep .with-radio .mat-tab-label{padding:8px 16px;min-width:0;flex-grow:1;justify-content:start;height:38px;opacity:1}:host ::ng-deep .with-radio .mat-tab-label:not(:last-child){margin-right:8px}:host ::ng-deep .with-radio .mat-tab-label-active{background:#F6F7F8;border-radius:3px}:host ::ng-deep .with-radio .mat-tab-label-active .mat-tab-label-content{color:#0c142b;font-weight:600}:host ::ng-deep .with-radio .mat-ink-bar{display:none!important}\n"]
|
|
2284
|
+
},] }
|
|
2285
|
+
];
|
|
2286
|
+
DrTabsComponent.ctorParameters = () => [];
|
|
2287
|
+
DrTabsComponent.propDecorators = {
|
|
2288
|
+
selectedTab: [{ type: Input }],
|
|
2289
|
+
withRadio: [{ type: Input }],
|
|
2290
|
+
selectedTabChange: [{ type: Output }],
|
|
2291
|
+
tabsContentList: [{ type: ContentChildren, args: [DrTabComponent,] }]
|
|
2292
|
+
};
|
|
2293
|
+
|
|
2113
2294
|
const components$2 = [DateTagComponent,
|
|
2114
2295
|
DayTagComponent,
|
|
2115
2296
|
WeekTagComponent,
|
|
@@ -2296,11 +2477,34 @@ DrDropdownModule.decorators = [
|
|
|
2296
2477
|
},] }
|
|
2297
2478
|
];
|
|
2298
2479
|
|
|
2480
|
+
class DrTabsModule {
|
|
2481
|
+
}
|
|
2482
|
+
DrTabsModule.decorators = [
|
|
2483
|
+
{ type: NgModule, args: [{
|
|
2484
|
+
imports: [
|
|
2485
|
+
CommonModule,
|
|
2486
|
+
MatTabsModule,
|
|
2487
|
+
FormsModule,
|
|
2488
|
+
ReactiveFormsModule,
|
|
2489
|
+
DrInputsModule
|
|
2490
|
+
],
|
|
2491
|
+
exports: [
|
|
2492
|
+
DrTabsComponent,
|
|
2493
|
+
DrTabComponent
|
|
2494
|
+
],
|
|
2495
|
+
providers: [],
|
|
2496
|
+
declarations: [
|
|
2497
|
+
DrTabsComponent,
|
|
2498
|
+
DrTabComponent
|
|
2499
|
+
],
|
|
2500
|
+
},] }
|
|
2501
|
+
];
|
|
2502
|
+
|
|
2299
2503
|
/* components */
|
|
2300
2504
|
|
|
2301
2505
|
/**
|
|
2302
2506
|
* Generated bundle index. Do not edit.
|
|
2303
2507
|
*/
|
|
2304
2508
|
|
|
2305
|
-
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 };
|
|
2509
|
+
export { AnyTagComponent, CheckboxComponent, DateTagComponent, DateTagModule, DayTagComponent, DrAvatarComponent, DrAvatarModule, DrButtonComponent, DrDatePickerComponent, DrDatePickerFormatDirective, DrDropdownComponent, DrDropdownDirective, DrDropdownItemShowPipe, DrDropdownModule, DrDropdownPositionDirective, DrDropdownService, DrInputComponent, DrInputsModule, DrPopoverComponent, DrPopoverDirective, DrPopoverModule, DrPopoverRef, DrPopoverService, DrSelectComponent, DrSpinnerComponent, DrSpinnerDirective, DrSpinnerModule, DrTabComponent, DrTabsComponent, DrTabsModule, 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 };
|
|
2306
2510
|
//# sourceMappingURL=datarailsshared-datarailsshared.js.map
|