@datarailsshared/datarailsshared 1.3.20 → 1.3.23

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.
Files changed (34) hide show
  1. package/assets/styles/img/default_avatar.svg +4 -0
  2. package/bundles/datarailsshared-datarailsshared.umd.js +283 -45
  3. package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
  4. package/datarailsshared-datarailsshared-1.3.23.tgz +0 -0
  5. package/datarailsshared-datarailsshared.metadata.json +1 -1
  6. package/esm2015/lib/dr-avatar/dr-avatar.component.js +13 -18
  7. package/esm2015/lib/dr-avatar/dr-avatar.module.js +10 -7
  8. package/esm2015/lib/dr-avatar/dr-avatar.pipe.js +15 -0
  9. package/esm2015/lib/dr-dropdown/dr-dropdown-position.directive.js +11 -5
  10. package/esm2015/lib/dr-dropdown/dr-dropdown.component.js +5 -3
  11. package/esm2015/lib/dr-dropdown/dr-dropdown.directive.js +3 -1
  12. package/esm2015/lib/dr-inputs/checkbox/checkbox.component.js +21 -9
  13. package/esm2015/lib/dr-inputs/dr-input/dr-input.component.js +4 -2
  14. package/esm2015/lib/dr-inputs/dr-inputs.module.js +4 -4
  15. package/esm2015/lib/dr-inputs/dr-toggle/dr-toggle.component.js +12 -4
  16. package/esm2015/lib/dr-inputs/radio-button/radio-button.component.js +14 -5
  17. package/esm2015/lib/dr-inputs/radio-button/radio-group.component.js +164 -0
  18. package/esm2015/lib/models/dropdown.js +1 -1
  19. package/esm2015/public-api.js +3 -1
  20. package/fesm2015/datarailsshared-datarailsshared.js +253 -45
  21. package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
  22. package/lib/dr-avatar/dr-avatar.component.d.ts +4 -6
  23. package/lib/dr-avatar/dr-avatar.pipe.d.ts +4 -0
  24. package/lib/dr-dropdown/dr-dropdown.component.d.ts +1 -0
  25. package/lib/dr-dropdown/dr-dropdown.directive.d.ts +1 -0
  26. package/lib/dr-inputs/checkbox/checkbox.component.d.ts +7 -3
  27. package/lib/dr-inputs/dr-input/dr-input.component.d.ts +2 -0
  28. package/lib/dr-inputs/dr-toggle/dr-toggle.component.d.ts +5 -2
  29. package/lib/dr-inputs/radio-button/radio-button.component.d.ts +4 -1
  30. package/lib/dr-inputs/radio-button/radio-group.component.d.ts +39 -0
  31. package/lib/models/dropdown.d.ts +1 -0
  32. package/package.json +1 -1
  33. package/public-api.d.ts +2 -0
  34. package/datarailsshared-datarailsshared-1.3.20.tgz +0 -0
@@ -1,16 +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, Injector, Injectable, Pipe, ContentChildren, NgModule } from '@angular/core';
2
+ import { EventEmitter, Component, ViewEncapsulation, Input, Output, ChangeDetectionStrategy, ChangeDetectorRef, forwardRef, ElementRef, Inject, PLATFORM_ID, ContentChildren, Renderer2, HostBinding, ContentChild, Pipe, TemplateRef, Directive, HostListener, ComponentFactoryResolver, ViewContainerRef, ViewChild, Optional, Injector, Injectable, 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
+ import { isPlatformBrowser, DOCUMENT, CommonModule } from '@angular/common';
8
+ import { Subject, from, merge, fromEvent, noop as noop$1 } from 'rxjs';
9
+ import { startWith, switchMap, takeUntil, filter, first } from 'rxjs/operators';
8
10
  import { transition, style, animate, trigger } from '@angular/animations';
9
11
  import * as i1 from '@angular/cdk/overlay';
10
12
  import { Overlay, OverlayPositionBuilder, OverlayConfig } from '@angular/cdk/overlay';
11
13
  import { ComponentPortal } from '@angular/cdk/portal';
12
- import { DOCUMENT, CommonModule } from '@angular/common';
13
- import { first } from 'rxjs/operators';
14
14
  import { MatDatepickerModule } from '@angular/material/datepicker';
15
15
  import { MatFormFieldModule } from '@angular/material/form-field';
16
16
  import { MatInputModule } from '@angular/material/input';
@@ -785,6 +785,7 @@ DayTagComponent.propDecorators = {
785
785
  class RadioButtonComponent {
786
786
  constructor(cdr) {
787
787
  this.cdr = cdr;
788
+ this.valueChange = new EventEmitter();
788
789
  this.onChange = (onchanges => { });
789
790
  this.onTouched = () => { };
790
791
  }
@@ -808,6 +809,14 @@ class RadioButtonComponent {
808
809
  }
809
810
  valueChanged(event) {
810
811
  this.onChange(this.modelValue);
812
+ this.valueChange.emit(this.value);
813
+ }
814
+ _setName(name) {
815
+ this.name = name;
816
+ this.cdr.markForCheck();
817
+ }
818
+ _markForCheck() {
819
+ this.cdr.markForCheck();
811
820
  }
812
821
  }
813
822
  RadioButtonComponent.decorators = [
@@ -822,8 +831,7 @@ RadioButtonComponent.decorators = [
822
831
  }
823
832
  ],
824
833
  changeDetection: ChangeDetectionStrategy.OnPush,
825
- encapsulation: ViewEncapsulation.ShadowDom,
826
- 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"]
834
+ styles: [":host{display:flex;line-height:22px}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"]
827
835
  },] }
828
836
  ];
829
837
  RadioButtonComponent.ctorParameters = () => [
@@ -832,17 +840,184 @@ RadioButtonComponent.ctorParameters = () => [
832
840
  RadioButtonComponent.propDecorators = {
833
841
  disabled: [{ type: Input }],
834
842
  name: [{ type: Input }],
835
- _value: [{ type: Input, args: ['value',] }]
843
+ _value: [{ type: Input, args: ['value',] }],
844
+ valueChange: [{ type: Output }]
845
+ };
846
+
847
+ class RadioGroupComponent {
848
+ constructor(hostElement, platformId, document) {
849
+ this.hostElement = hostElement;
850
+ this.platformId = platformId;
851
+ this.document = document;
852
+ this.destroy$ = new Subject();
853
+ this.valueChange = new EventEmitter();
854
+ this.onChange = (value) => { };
855
+ this.onTouched = () => { };
856
+ }
857
+ get value() {
858
+ return this._value;
859
+ }
860
+ set value(value) {
861
+ this._value = value;
862
+ this.updateValues();
863
+ }
864
+ get name() {
865
+ return this._name;
866
+ }
867
+ set name(name) {
868
+ this._name = name;
869
+ this.updateNames();
870
+ }
871
+ get disabled() {
872
+ return this._disabled;
873
+ }
874
+ set disabled(disabled) {
875
+ this._disabled = !!disabled;
876
+ this.updateDisabled();
877
+ }
878
+ ngAfterContentInit() {
879
+ // In case option 'name' isn't set on nb-radio component,
880
+ // we need to set it's name right away, so it won't overlap with options
881
+ // without names from other radio groups. Otherwise they all would have
882
+ // same name and will be considered as options from one group so only the
883
+ // last option will stay selected.
884
+ this.updateNames();
885
+ this.radios.changes
886
+ .pipe(startWith(this.radios),
887
+ // 'changes' emit during change detection run and we can't update
888
+ // option properties right of since they already was initialized.
889
+ // Instead we schedule microtask to update radios after change detection
890
+ // run is finished and trigger one more change detection run.
891
+ switchMap((radios) => from(Promise.resolve(radios))), takeUntil(this.destroy$))
892
+ .subscribe(() => this.updateAndSubscribeToRadios());
893
+ }
894
+ ngOnDestroy() {
895
+ this.destroy$.next();
896
+ this.destroy$.complete();
897
+ }
898
+ registerOnChange(fn) {
899
+ this.onChange = fn;
900
+ }
901
+ registerOnTouched(fn) {
902
+ this.onTouched = fn;
903
+ }
904
+ writeValue(value) {
905
+ this.value = value;
906
+ }
907
+ setDisabledState(isDisabled) {
908
+ this.disabled = isDisabled;
909
+ }
910
+ updateAndSubscribeToRadios() {
911
+ this.updateValueFromCheckedOption();
912
+ this.updateNames();
913
+ this.updateValues();
914
+ this.updateDisabled();
915
+ this.subscribeOnRadiosValueChange();
916
+ this.subscribeOnRadiosBlur();
917
+ }
918
+ updateNames() {
919
+ if (this.radios) {
920
+ this.radios.forEach((radio) => radio._setName(this.name));
921
+ }
922
+ }
923
+ updateValues() {
924
+ this.updateAndMarkForCheckRadios((radio) => {
925
+ if (radio.value === this.value) {
926
+ radio.modelValue = radio.value;
927
+ }
928
+ });
929
+ }
930
+ updateDisabled() {
931
+ if (typeof this.disabled !== 'undefined') {
932
+ this.updateAndMarkForCheckRadios((radio) => radio.disabled = this.disabled);
933
+ }
934
+ }
935
+ subscribeOnRadiosValueChange() {
936
+ if (!this.radios || !this.radios.length) {
937
+ return;
938
+ }
939
+ merge(...this.radios.map((radio) => radio.valueChange))
940
+ .pipe(takeUntil(merge(this.radios.changes, this.destroy$)))
941
+ .subscribe((value) => {
942
+ this.writeValue(value);
943
+ this.propagateValue(value);
944
+ });
945
+ }
946
+ propagateValue(value) {
947
+ this.valueChange.emit(value);
948
+ this.onChange(value);
949
+ }
950
+ subscribeOnRadiosBlur() {
951
+ const hasNoRadios = !this.radios || !this.radios.length;
952
+ if (!isPlatformBrowser(this.platformId) || hasNoRadios) {
953
+ return;
954
+ }
955
+ const hostElement = this.hostElement.nativeElement;
956
+ fromEvent(hostElement, 'focusin')
957
+ .pipe(filter(event => hostElement.contains(event.target)), switchMap(() => merge(fromEvent(this.document, 'focusin'), fromEvent(this.document, 'click'))), filter(event => !hostElement.contains(event.target)), takeUntil(merge(this.radios.changes, this.destroy$)))
958
+ .subscribe(() => this.onTouched());
959
+ }
960
+ updateAndMarkForCheckRadios(updateFn) {
961
+ if (this.radios) {
962
+ this.radios.forEach((radio) => {
963
+ updateFn(radio);
964
+ radio._markForCheck();
965
+ });
966
+ }
967
+ }
968
+ updateValueFromCheckedOption() {
969
+ const checkedRadio = this.radios.find((radio) => radio.modelValue);
970
+ const isValueMissing = this.value === undefined || this.value === null;
971
+ if (checkedRadio && isValueMissing && checkedRadio.value !== this.value) {
972
+ this.value = checkedRadio.value;
973
+ }
974
+ }
975
+ }
976
+ RadioGroupComponent.decorators = [
977
+ { type: Component, args: [{
978
+ selector: 'dr-radio-group',
979
+ template: `
980
+ <ng-content select="dr-radio-button"></ng-content>`,
981
+ providers: [
982
+ {
983
+ provide: NG_VALUE_ACCESSOR,
984
+ useExisting: forwardRef(() => RadioGroupComponent),
985
+ multi: true,
986
+ },
987
+ ],
988
+ changeDetection: ChangeDetectionStrategy.OnPush
989
+ },] }
990
+ ];
991
+ RadioGroupComponent.ctorParameters = () => [
992
+ { type: ElementRef },
993
+ { type: undefined, decorators: [{ type: Inject, args: [PLATFORM_ID,] }] },
994
+ { type: undefined, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
995
+ ];
996
+ RadioGroupComponent.propDecorators = {
997
+ value: [{ type: Input }],
998
+ name: [{ type: Input }],
999
+ disabled: [{ type: Input }],
1000
+ radios: [{ type: ContentChildren, args: [RadioButtonComponent, { descendants: true },] }],
1001
+ valueChange: [{ type: Output }]
836
1002
  };
837
1003
 
838
1004
  class CheckboxComponent {
839
1005
  constructor(cdr) {
840
1006
  this.cdr = cdr;
841
1007
  this.disabled = false;
1008
+ this.icon = '';
1009
+ this._indeterminate = false;
842
1010
  this.checkedChange = new EventEmitter();
843
1011
  this.onChange = () => { };
844
1012
  this.onTouched = () => { };
845
1013
  }
1014
+ get indeterminate() {
1015
+ return this._indeterminate;
1016
+ }
1017
+ set indeterminate(value) {
1018
+ this._indeterminate = !!value;
1019
+ this.cdr.markForCheck();
1020
+ }
846
1021
  writeValue(value) {
847
1022
  this.checkedStatus = value;
848
1023
  this.cdr.markForCheck();
@@ -856,23 +1031,24 @@ class CheckboxComponent {
856
1031
  setDisabledState(isDisabled) {
857
1032
  this.disabled = isDisabled;
858
1033
  }
859
- setValue() {
860
- this.checkedStatus = !this.checkedStatus;
861
- this.onChange(this.checkedStatus);
1034
+ setValue(event) {
1035
+ const input = event.target;
1036
+ this.checkedStatus = input.checked;
862
1037
  this.checkedChange.emit(this.checkedStatus);
1038
+ this.onChange(this.checkedStatus);
1039
+ this.indeterminate = input.indeterminate;
863
1040
  this.onTouched();
864
1041
  }
865
1042
  }
866
1043
  CheckboxComponent.decorators = [
867
1044
  { type: Component, args: [{
868
1045
  selector: 'dr-checkbox',
869
- template: "<label>\r\n <input\r\n type=\"checkbox\"\r\n [checked]=\"checkedStatus\"\r\n [disabled]=\"disabled\"\r\n (click)=\"setValue()\">\r\n <span>\r\n <ng-content></ng-content>\r\n </span>\r\n</label>\r\n",
1046
+ template: "<label>\r\n <input type=\"checkbox\"\r\n [checked]=\"checkedStatus\"\r\n [disabled]=\"disabled\"\r\n (change)=\"setValue($event)\"\r\n (click)=\"$event.stopPropagation()\">\r\n <span [class]=\"icon\" [class.indeterminate]=\"indeterminate\">\r\n <ng-content></ng-content>\r\n </span>\r\n</label>\r\n",
870
1047
  providers: [
871
1048
  { provide: NG_VALUE_ACCESSOR, useExisting: CheckboxComponent, multi: true }
872
1049
  ],
873
1050
  changeDetection: ChangeDetectionStrategy.OnPush,
874
- encapsulation: ViewEncapsulation.ShadowDom,
875
- 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"]
1051
+ 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;width:0}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:checked+span.cross:before,label:hover input:checked+span.cross: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\"><path d=\"M5.91786 4.99992L9.03356 1.88386C9.11927 1.79808 9.16654 1.68365 9.16668 1.56162C9.16668 1.43952 9.1194 1.32495 9.03356 1.23931L8.7605 0.966323C8.67466 0.880342 8.56026 0.833252 8.43811 0.833252C8.31615 0.833252 8.20169 0.880342 8.11585 0.966323L5.00016 4.08218L1.88431 0.966323C1.79861 0.880342 1.68407 0.833252 1.56199 0.833252C1.44004 0.833252 1.32559 0.880342 1.23988 0.966323L0.966677 1.23931C0.788899 1.4171 0.788899 1.70628 0.966677 1.88386L4.08245 4.99992L0.966677 8.11584C0.880904 8.20175 0.833707 8.31619 0.833707 8.43822C0.833707 8.56025 0.880904 8.67468 0.966677 8.76053L1.23981 9.03351C1.32551 9.11943 1.44003 9.16658 1.56191 9.16658C1.684 9.16658 1.79853 9.11943 1.88424 9.03351L5.00008 5.91759L8.11578 9.03351C8.20162 9.11943 8.31608 9.16658 8.43803 9.16658C8.56005 9.16658 8.67459 9.11943 8.76043 9.03351L9.03349 8.76053C9.11919 8.67475 9.16646 8.56025 9.16646 8.43822C9.16646 8.31619 9.11919 8.20175 9.03349 8.11591L5.91786 4.99992Z\" fill=\"white\"/></svg>')}label input+span.indeterminate:before,label:hover input+span.indeterminate:before{content:url('data:image/svg+xml; utf8, <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"> <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M6.25 12C6.25 11.5858 6.58579 11.25 7 11.25L17 11.25C17.4142 11.25 17.75 11.5858 17.75 12C17.75 12.4142 17.4142 12.75 17 12.75L7 12.75C6.58579 12.75 6.25 12.4142 6.25 12Z\" fill=\"white\"/></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"]
876
1052
  },] }
877
1053
  ];
878
1054
  CheckboxComponent.ctorParameters = () => [
@@ -881,6 +1057,8 @@ CheckboxComponent.ctorParameters = () => [
881
1057
  CheckboxComponent.propDecorators = {
882
1058
  checkedStatus: [{ type: Input }],
883
1059
  disabled: [{ type: Input }],
1060
+ icon: [{ type: Input }],
1061
+ indeterminate: [{ type: Input }],
884
1062
  checkedChange: [{ type: Output }]
885
1063
  };
886
1064
 
@@ -1012,7 +1190,7 @@ class DrInputComponent {
1012
1190
  DrInputComponent.decorators = [
1013
1191
  { type: Component, args: [{
1014
1192
  selector: 'dr-input',
1015
- 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",
1193
+ 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 [min]=\"min\"\r\n [step]=\"step\"\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",
1016
1194
  providers: [{
1017
1195
  provide: NG_VALUE_ACCESSOR,
1018
1196
  useExisting: forwardRef(() => DrInputComponent),
@@ -1035,6 +1213,8 @@ DrInputComponent.propDecorators = {
1035
1213
  placeholder: [{ type: Input }],
1036
1214
  readonly: [{ type: Input }],
1037
1215
  clearable: [{ type: Input }],
1216
+ min: [{ type: Input }],
1217
+ step: [{ type: Input }],
1038
1218
  blur: [{ type: Output }],
1039
1219
  elementClass: [{ type: HostBinding, args: ['class',] }],
1040
1220
  searchHandler: [{ type: Output }],
@@ -1110,23 +1290,20 @@ DrSelectComponent.propDecorators = {
1110
1290
 
1111
1291
  class DrAvatarComponent {
1112
1292
  constructor() {
1293
+ this.warning = false;
1113
1294
  this.userClicked = new EventEmitter();
1114
1295
  this.parsedUsers = [];
1115
1296
  }
1116
- set users(user) {
1117
- if (user) {
1118
- this.parsedUsers = this.parseUsers(user);
1119
- }
1120
- }
1121
- ngOnChanges(changes) {
1122
- if (changes.users) {
1123
- this.getFirstUsers().forEach((user) => user.class = `icon-${this.getRandomValue(5)}`);
1124
- this.getLastUsers().forEach((user) => user.class = `icon-${this.getRandomValue(5)}`);
1297
+ set users(users) {
1298
+ if (users) {
1299
+ this.parsedUsers = Array.isArray(users) ? users : [users];
1300
+ this.parsedUsers.forEach((user, index) => {
1301
+ if (!user.colorNumber) {
1302
+ user.colorNumber = index % 5;
1303
+ }
1304
+ });
1125
1305
  }
1126
1306
  }
1127
- parseUsers(value) {
1128
- return Array.isArray(value) ? value : Array.of(value);
1129
- }
1130
1307
  getFirstUsers() {
1131
1308
  return this.parsedUsers.slice(0, 2);
1132
1309
  }
@@ -1136,24 +1313,36 @@ class DrAvatarComponent {
1136
1313
  }
1137
1314
  return [];
1138
1315
  }
1139
- getRandomValue(limit) {
1140
- return ~~(limit * Math.random());
1141
- }
1142
1316
  }
1143
1317
  DrAvatarComponent.decorators = [
1144
1318
  { type: Component, args: [{
1145
1319
  selector: 'dr-avatar',
1146
- 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",
1320
+ template: "<div class=\"users-section\">\r\n <div *ngIf=\"!parsedUsers.length\"\r\n class=\"users-section__default\">\r\n </div>\r\n\r\n <div *ngFor=\"let user of getFirstUsers()\"\r\n class=\"users-section__user\"\r\n [class]=\"'icon-' + user.colorNumber + ' ' + user.status\"\r\n (click)=\"userClicked.emit()\"\r\n [matTooltip]=\"user | drAvatar\"\r\n [matTooltipPosition]=\"'below'\">\r\n {{user | drAvatar: 'initials'}}\r\n </div>\r\n\r\n <div *ngIf=\"parsedUsers.length > 2\"\r\n class=\"users-section__user icon-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 | drAvatar: 'initials'}}\r\n </div>\r\n <span class=\"username\">\r\n {{user | drAvatar}}\r\n </span>\r\n </div>\r\n</ng-template>\r\n",
1147
1321
  changeDetection: ChangeDetectionStrategy.OnPush,
1148
- 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"]
1322
+ styles: [":host{width:auto}.users-section{display:flex;height:28px}.users-section__default{display:flex;height:28px;width:28px;border-radius:14px;background:url(\"data:image/svg+xml,%3Csvg width%3D%2224%22 height%3D%2224%22 viewBox%3D%220 0 24 24%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0D%3Crect width%3D%2224%22 height%3D%2224%22 rx%3D%2212%22 fill%3D%22%23BCBCBC%22%2F%3E%0D%3Cpath d%3D%22M11.9993 11.9998C13.6108 11.9998 14.916 10.691 14.916 9.08317C14.916 7.47171 13.6108 6.1665 11.9993 6.1665C10.3879 6.1665 9.08268 7.47171 9.08268 9.08317C9.08268 10.691 10.3879 11.9998 11.9993 11.9998ZM11.9993 13.4582C10.0561 13.4582 6.16602 14.4316 6.16602 16.3748V17.8332H17.8327V16.3748C17.8327 14.4316 13.9426 13.4582 11.9993 13.4582Z%22 fill%3D%22white%22%2F%3E%0D%3C%2Fsvg%3E%0D\") no-repeat}.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{position:relative;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}.users-section__user.online:after,.users-section__user.offline:after,.users-section__user.warning:after{content:\"\";display:flex;width:8px;height:8px;position:absolute;border-radius:4px;top:-2px;right:0}.users-section__user.online:after{background:#03A678}.users-section__user.offline:after{background:#DE2833}.users-section__user.warning:after{background:#FDA014}\n"]
1149
1323
  },] }
1150
1324
  ];
1151
1325
  DrAvatarComponent.ctorParameters = () => [];
1152
1326
  DrAvatarComponent.propDecorators = {
1153
1327
  users: [{ type: Input }],
1328
+ warning: [{ type: Input }],
1154
1329
  userClicked: [{ type: Output }]
1155
1330
  };
1156
1331
 
1332
+ class DrAvatarPipe {
1333
+ transform(item, type = 'full') {
1334
+ if (type === 'initials') {
1335
+ return (item.first_name && item.last_name ? (item.first_name[0] + item.last_name[0]) : item.email[0]).toUpperCase();
1336
+ }
1337
+ return item.first_name && item.last_name ? (item.first_name + ' ' + item.last_name) : item.email;
1338
+ }
1339
+ }
1340
+ DrAvatarPipe.decorators = [
1341
+ { type: Pipe, args: [{
1342
+ name: 'drAvatar'
1343
+ },] }
1344
+ ];
1345
+
1157
1346
  const POPUP_POSITIONS = {
1158
1347
  top: {
1159
1348
  originX: 'center',
@@ -1378,6 +1567,7 @@ class DrToggleComponent {
1378
1567
  constructor(cdr) {
1379
1568
  this.cdr = cdr;
1380
1569
  this._disabled = false;
1570
+ this._elementClass = [];
1381
1571
  this.checkedChange = new EventEmitter();
1382
1572
  this.onChange = () => { };
1383
1573
  this.onTouched = () => { };
@@ -1385,6 +1575,12 @@ class DrToggleComponent {
1385
1575
  set disabled(value) {
1386
1576
  this.setDisabledState(value);
1387
1577
  }
1578
+ get elementClass() { return this._elementClass.join(' '); }
1579
+ ngAfterViewInit() {
1580
+ if (this.toggleTitleRight) {
1581
+ this._elementClass.push('toggle-label-alignment');
1582
+ }
1583
+ }
1388
1584
  writeValue(value) {
1389
1585
  this.checkedStatus = value;
1390
1586
  this.cdr.markForCheck();
@@ -1413,7 +1609,7 @@ DrToggleComponent.decorators = [
1413
1609
  { provide: NG_VALUE_ACCESSOR, useExisting: DrToggleComponent, multi: true }
1414
1610
  ],
1415
1611
  changeDetection: ChangeDetectionStrategy.OnPush,
1416
- styles: [":host{display:flex;justify-content:space-between;align-items:center}:host .toggle-container.disabled{pointer-events:none}:host .toggle-container.disabled .toggle-body{background-color:#8f9bb329!important}:host .toggle-container.disabled .toggle-body i{background:rgba(143,155,179,.24)!important}:host .toggle-container.success input:checked+span.toggle-body{background-color:#03a678}:host .toggle-container input{display:none}:host .toggle-container input:checked+span.toggle-body>i,:host .toggle-container input:checked+span.toggle-body:active>i{margin-left:16px}:host .toggle-container input:checked+span.toggle-body{background-color:#579bf2}:host .toggle-container .toggle-body{cursor:pointer;display:block;width:30px;height:16px;margin:7px auto;border-radius:15px;transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;background-color:#aeb5bb;line-height:1}:host .toggle-container .toggle-body:active{background-color:#a6b9cb}:host .toggle-container .toggle-body-wrapper{display:flex;flex-direction:column}:host .toggle-container .toggle-body i{height:12px;width:12px;background:#fff;display:inline-block;border-radius:100px;margin-top:2px;margin-left:1.5px;transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;pointer-events:none}\n"]
1612
+ styles: [":host{display:flex;justify-content:space-between;align-items:center}:host.toggle-label-alignment{justify-content:start}:host .toggle-container.disabled{pointer-events:none}:host .toggle-container.disabled .toggle-body{background-color:#8f9bb329!important}:host .toggle-container.disabled .toggle-body i{background:rgba(143,155,179,.24)!important}:host .toggle-container.success input:checked+span.toggle-body{background-color:#03a678}:host .toggle-container input{display:none}:host .toggle-container input:checked+span.toggle-body>i,:host .toggle-container input:checked+span.toggle-body:active>i{margin-left:16px}:host .toggle-container input:checked+span.toggle-body{background-color:#579bf2}:host .toggle-container .toggle-body{cursor:pointer;display:block;width:30px;height:16px;margin:7px auto;border-radius:15px;transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;background-color:#aeb5bb;line-height:1}:host .toggle-container .toggle-body:active{background-color:#a6b9cb}:host .toggle-container .toggle-body-wrapper{display:flex;flex-direction:column}:host .toggle-container .toggle-body i{height:12px;width:12px;background:#fff;display:inline-block;border-radius:100px;margin-top:2px;margin-left:1.5px;transition:all .2s ease-in-out;-webkit-transition:all .2s ease-in-out;pointer-events:none}\n"]
1417
1613
  },] }
1418
1614
  ];
1419
1615
  DrToggleComponent.ctorParameters = () => [
@@ -1425,7 +1621,8 @@ DrToggleComponent.propDecorators = {
1425
1621
  successType: [{ type: Input }],
1426
1622
  checkedStatus: [{ type: Input }],
1427
1623
  disabled: [{ type: Input }],
1428
- checkedChange: [{ type: Output }]
1624
+ checkedChange: [{ type: Output }],
1625
+ elementClass: [{ type: HostBinding, args: ['class',] }]
1429
1626
  };
1430
1627
 
1431
1628
  class DrToggleButtonComponent {
@@ -2109,12 +2306,14 @@ class DrDropdownComponent {
2109
2306
  if (data) {
2110
2307
  this.option = data.option;
2111
2308
  this.position = data.position;
2309
+ this.containerClass = data.class;
2112
2310
  this.list = data.list || [];
2113
2311
  this.list.forEach(item => {
2114
2312
  var _a;
2115
2313
  if ((_a = item.children) === null || _a === void 0 ? void 0 : _a.length) {
2116
2314
  item.childOptions = {
2117
2315
  list: item.children,
2316
+ class: item.childOptions.class,
2118
2317
  position: 'child'
2119
2318
  };
2120
2319
  }
@@ -2183,9 +2382,9 @@ class DrDropdownComponent {
2183
2382
  DrDropdownComponent.decorators = [
2184
2383
  { type: Component, args: [{
2185
2384
  selector: 'dr-dropdown',
2186
- 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 [class.item-selected]=\"selected(act)\">\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 [class.showOnHover]=\"actionIcon.showOnHover\"\r\n (click)=\"onActionIconClick($event, 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",
2385
+ template: "<div #menuContainer\r\n (clickOutside)=\"onClickedOutside()\"\r\n [drDropdownPosition]=\"option\"\r\n [position]=\"position\"\r\n [class]=\"containerClass\"\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 [class.item-selected]=\"selected(act)\">\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 [class.showOnHover]=\"actionIcon.showOnHover\"\r\n (click)=\"onActionIconClick($event, 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",
2187
2386
  changeDetection: ChangeDetectionStrategy.OnPush,
2188
- 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:hover .showOnHover{visibility:visible}.dr-dropdown__container__item.item-selected{background:#F3F7FF}.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;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dr-dropdown__container__item i,.dr-dropdown__container__item__text{color:#151b3f}.dr-dropdown__container__item .showOnHover{visibility:hidden}.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"]
2387
+ 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:hover .showOnHover{visibility:visible}.dr-dropdown__container__item.item-selected{background:#F3F7FF}.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;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.dr-dropdown__container__item i,.dr-dropdown__container__item__text{color:#151b3f}.dr-dropdown__container__item .showOnHover{visibility:hidden}.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-bottom-right{transform:translateY(45%)}.dr-dropdown.content-left{transform:translate(-100%)}.dr-dropdown.content-left-center{transform:translate(-100%,-50%)}.dr-dropdown.content-right{transform:translate(5%)}\n"]
2189
2388
  },] }
2190
2389
  ];
2191
2390
  DrDropdownComponent.ctorParameters = () => [
@@ -2220,6 +2419,7 @@ class DrDropdownDirective {
2220
2419
  option,
2221
2420
  position: this.position,
2222
2421
  list: this.drDropdown,
2422
+ class: this.drDropdownClass
2223
2423
  });
2224
2424
  }
2225
2425
  }
@@ -2262,6 +2462,7 @@ DrDropdownDirective.ctorParameters = () => [
2262
2462
  DrDropdownDirective.propDecorators = {
2263
2463
  position: [{ type: Input }],
2264
2464
  drDropdown: [{ type: Input }],
2465
+ drDropdownClass: [{ type: Input }],
2265
2466
  contentCmpRef: [{ type: ViewChild, args: [DrDropdownComponent, { static: true, read: ViewContainerRef },] }],
2266
2467
  elementClick: [{ type: HostListener, args: ['click',] }],
2267
2468
  documentClick: [{ type: HostListener, args: ['document:mouseup', ['$event'],] }]
@@ -2277,14 +2478,16 @@ class DrDropdownPositionDirective {
2277
2478
  setTimeout(this.calculatePosition.bind(this), 1);
2278
2479
  }
2279
2480
  calculatePosition() {
2481
+ let xDifference = 0;
2280
2482
  let defaultDelta = 10;
2281
2483
  let defaultPadding = 0;
2282
2484
  if (this.position === 'child') {
2283
2485
  defaultDelta = 0;
2284
2486
  defaultPadding = 10;
2487
+ xDifference = this.el.nativeElement.parentElement.parentElement.offsetWidth - this.el.nativeElement.offsetWidth;
2285
2488
  const parentRect = this.el.nativeElement.parentElement.parentElement.getBoundingClientRect();
2286
2489
  this.position = {
2287
- x: this.el.nativeElement.parentElement.parentElement.offsetWidth + 2,
2490
+ x: this.el.nativeElement.offsetWidth,
2288
2491
  y: this.el.nativeElement.parentElement.parentElement.offsetTop - 9,
2289
2492
  clientX: parentRect.x + this.el.nativeElement.parentElement.parentElement.offsetWidth,
2290
2493
  clientY: parentRect.y
@@ -2320,17 +2523,21 @@ class DrDropdownPositionDirective {
2320
2523
  : this.position === 'bottom-left' ? 'content-bottom-left'
2321
2524
  : this.position === 'left' ? 'content-left'
2322
2525
  : this.position === 'left-center' ? 'content-left-center'
2323
- : this.position === 'right' ? 'content-right' : '';
2526
+ : this.position === 'right' ? 'content-right'
2527
+ : this.position === 'bottom-right' ? 'content-bottom-right' : '';
2324
2528
  this.renderer.addClass(this.el.nativeElement, className);
2325
2529
  this.renderer.setStyle(this.el.nativeElement, 'z-index', '10010');
2326
2530
  }
2327
2531
  else {
2532
+ const defaultChildPadding = 3;
2328
2533
  const widthMoreWindowRight = window.innerWidth - this.position.clientX - this.el.nativeElement.offsetWidth - defaultPadding;
2329
- const deltaWidth = widthMoreWindowRight < 0 ? widthMoreWindowRight : defaultDelta;
2330
2534
  const widthMoreWindowBottom = window.innerHeight - this.position.clientY - this.el.nativeElement.offsetHeight - defaultPadding;
2535
+ const calculatedHorizantallyPos = widthMoreWindowRight < 0
2536
+ ? -this.position.x + -defaultChildPadding
2537
+ : this.position.x + defaultChildPadding + xDifference;
2331
2538
  const deltaHeight = widthMoreWindowBottom < 0 ? widthMoreWindowBottom : defaultDelta;
2332
2539
  this.renderer.setStyle(this.el.nativeElement, 'top', (this.position.y + deltaHeight) + 'px');
2333
- this.renderer.setStyle(this.el.nativeElement, 'left', (this.position.x + deltaWidth) + 'px');
2540
+ this.renderer.setStyle(this.el.nativeElement, 'left', (calculatedHorizantallyPos) + 'px');
2334
2541
  this.renderer.setStyle(this.el.nativeElement, 'z-index', '10010');
2335
2542
  }
2336
2543
  }
@@ -2481,6 +2688,7 @@ DrTagModule.decorators = [
2481
2688
  const components$1 = [
2482
2689
  DrButtonComponent,
2483
2690
  RadioButtonComponent,
2691
+ RadioGroupComponent,
2484
2692
  CheckboxComponent,
2485
2693
  DrInputComponent,
2486
2694
  DrSelectComponent,
@@ -2493,9 +2701,7 @@ class DrInputsModule {
2493
2701
  }
2494
2702
  DrInputsModule.decorators = [
2495
2703
  { type: NgModule, args: [{
2496
- declarations: [
2497
- components$1,
2498
- ],
2704
+ declarations: components$1,
2499
2705
  exports: components$1,
2500
2706
  imports: [
2501
2707
  FormsModule,
@@ -2531,10 +2737,12 @@ class DrAvatarModule {
2531
2737
  DrAvatarModule.decorators = [
2532
2738
  { type: NgModule, args: [{
2533
2739
  declarations: [
2534
- DrAvatarComponent
2740
+ DrAvatarComponent,
2741
+ DrAvatarPipe
2535
2742
  ],
2536
2743
  exports: [
2537
- DrAvatarComponent
2744
+ DrAvatarComponent,
2745
+ DrAvatarPipe
2538
2746
  ],
2539
2747
  imports: [
2540
2748
  MatTooltipModule,
@@ -2632,5 +2840,5 @@ DrTabsModule.decorators = [
2632
2840
  * Generated bundle index. Do not edit.
2633
2841
  */
2634
2842
 
2635
- export { AnyTagComponent, CheckboxComponent, DateTagComponent, DateTagModule, DayTagComponent, DrAvatarComponent, DrAvatarModule, DrButtonComponent, DrDatePickerComponent, DrDatePickerFormatDirective, DrDropdownComponent, DrDropdownDirective, DrDropdownItemShowPipe, DrDropdownModule, DrDropdownPositionDirective, DrDropdownService, DrInputComponent, DrInputsModule, DrPopoverAlignmentDimension, DrPopoverComponent, DrPopoverDirective, DrPopoverModule, DrPopoverRef, DrPopoverService, DrSelectComponent, DrSpinnerComponent, DrSpinnerDirective, DrSpinnerModule, DrTabComponent, DrTabsComponent, DrTabsModule, DrTagComponent, DrTagModule, DrToggleButtonComponent, DrToggleComponent, DrTooltipDirective, DrTooltipModule, ForecastTagComponent, ISpinnerOptions, ListTagComponent, ListTagModule, MonthTagComponent, QuarterTagComponent, RadioButtonComponent, TooltipComponent, WeekTagComponent, YearTagComponent, components$2 as ɵa, POPUP_ANIMATION as ɵb, CustomDateFormat as ɵc };
2843
+ export { AnyTagComponent, CheckboxComponent, DateTagComponent, DateTagModule, DayTagComponent, DrAvatarComponent, DrAvatarModule, DrAvatarPipe, DrButtonComponent, DrDatePickerComponent, DrDatePickerFormatDirective, DrDropdownComponent, DrDropdownDirective, DrDropdownItemShowPipe, DrDropdownModule, DrDropdownPositionDirective, DrDropdownService, DrInputComponent, DrInputsModule, DrPopoverAlignmentDimension, DrPopoverComponent, DrPopoverDirective, DrPopoverModule, DrPopoverRef, DrPopoverService, DrSelectComponent, DrSpinnerComponent, DrSpinnerDirective, DrSpinnerModule, DrTabComponent, DrTabsComponent, DrTabsModule, DrTagComponent, DrTagModule, DrToggleButtonComponent, DrToggleComponent, DrTooltipDirective, DrTooltipModule, ForecastTagComponent, ISpinnerOptions, ListTagComponent, ListTagModule, MonthTagComponent, QuarterTagComponent, RadioButtonComponent, RadioGroupComponent, TooltipComponent, WeekTagComponent, YearTagComponent, components$2 as ɵa, POPUP_ANIMATION as ɵb, CustomDateFormat as ɵc };
2636
2844
  //# sourceMappingURL=datarailsshared-datarailsshared.js.map