@datarailsshared/datarailsshared 1.3.20 → 1.3.21
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/assets/styles/img/default_avatar.svg +4 -0
- package/bundles/datarailsshared-datarailsshared.umd.js +73 -35
- package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
- package/datarailsshared-datarailsshared-1.3.21.tgz +0 -0
- package/datarailsshared-datarailsshared.metadata.json +1 -1
- package/esm2015/lib/dr-avatar/dr-avatar.component.js +13 -18
- package/esm2015/lib/dr-avatar/dr-avatar.module.js +10 -7
- package/esm2015/lib/dr-avatar/dr-avatar.pipe.js +15 -0
- package/esm2015/lib/dr-dropdown/dr-dropdown-position.directive.js +11 -5
- package/esm2015/lib/dr-dropdown/dr-dropdown.component.js +4 -3
- package/esm2015/lib/dr-dropdown/dr-dropdown.directive.js +3 -1
- package/esm2015/lib/dr-inputs/checkbox/checkbox.component.js +21 -9
- package/esm2015/lib/dr-inputs/dr-inputs.module.js +2 -4
- package/esm2015/lib/models/dropdown.js +1 -1
- package/esm2015/public-api.js +2 -1
- package/fesm2015/datarailsshared-datarailsshared.js +66 -36
- package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
- package/lib/dr-avatar/dr-avatar.component.d.ts +4 -6
- package/lib/dr-avatar/dr-avatar.pipe.d.ts +4 -0
- package/lib/dr-dropdown/dr-dropdown.component.d.ts +1 -0
- package/lib/dr-dropdown/dr-dropdown.directive.d.ts +1 -0
- package/lib/dr-inputs/checkbox/checkbox.component.d.ts +7 -3
- package/lib/models/dropdown.d.ts +1 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/datarailsshared-datarailsshared-1.3.20.tgz +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
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,
|
|
2
|
+
import { EventEmitter, Component, ViewEncapsulation, Input, Output, ChangeDetectionStrategy, ChangeDetectorRef, forwardRef, ElementRef, Renderer2, HostBinding, ContentChild, Pipe, TemplateRef, Directive, HostListener, ComponentFactoryResolver, ViewContainerRef, Inject, ViewChild, Optional, Injector, Injectable, 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';
|
|
@@ -839,10 +839,19 @@ class CheckboxComponent {
|
|
|
839
839
|
constructor(cdr) {
|
|
840
840
|
this.cdr = cdr;
|
|
841
841
|
this.disabled = false;
|
|
842
|
+
this.icon = '';
|
|
843
|
+
this._indeterminate = false;
|
|
842
844
|
this.checkedChange = new EventEmitter();
|
|
843
845
|
this.onChange = () => { };
|
|
844
846
|
this.onTouched = () => { };
|
|
845
847
|
}
|
|
848
|
+
get indeterminate() {
|
|
849
|
+
return this._indeterminate;
|
|
850
|
+
}
|
|
851
|
+
set indeterminate(value) {
|
|
852
|
+
this._indeterminate = !!value;
|
|
853
|
+
this.cdr.markForCheck();
|
|
854
|
+
}
|
|
846
855
|
writeValue(value) {
|
|
847
856
|
this.checkedStatus = value;
|
|
848
857
|
this.cdr.markForCheck();
|
|
@@ -856,23 +865,24 @@ class CheckboxComponent {
|
|
|
856
865
|
setDisabledState(isDisabled) {
|
|
857
866
|
this.disabled = isDisabled;
|
|
858
867
|
}
|
|
859
|
-
setValue() {
|
|
860
|
-
|
|
861
|
-
this.
|
|
868
|
+
setValue(event) {
|
|
869
|
+
const input = event.target;
|
|
870
|
+
this.checkedStatus = input.checked;
|
|
862
871
|
this.checkedChange.emit(this.checkedStatus);
|
|
872
|
+
this.onChange(this.checkedStatus);
|
|
873
|
+
this.indeterminate = input.indeterminate;
|
|
863
874
|
this.onTouched();
|
|
864
875
|
}
|
|
865
876
|
}
|
|
866
877
|
CheckboxComponent.decorators = [
|
|
867
878
|
{ type: Component, args: [{
|
|
868
879
|
selector: 'dr-checkbox',
|
|
869
|
-
template: "<label>\r\n <input
|
|
880
|
+
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
881
|
providers: [
|
|
871
882
|
{ provide: NG_VALUE_ACCESSOR, useExisting: CheckboxComponent, multi: true }
|
|
872
883
|
],
|
|
873
884
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
874
|
-
|
|
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"]
|
|
885
|
+
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
886
|
},] }
|
|
877
887
|
];
|
|
878
888
|
CheckboxComponent.ctorParameters = () => [
|
|
@@ -881,6 +891,8 @@ CheckboxComponent.ctorParameters = () => [
|
|
|
881
891
|
CheckboxComponent.propDecorators = {
|
|
882
892
|
checkedStatus: [{ type: Input }],
|
|
883
893
|
disabled: [{ type: Input }],
|
|
894
|
+
icon: [{ type: Input }],
|
|
895
|
+
indeterminate: [{ type: Input }],
|
|
884
896
|
checkedChange: [{ type: Output }]
|
|
885
897
|
};
|
|
886
898
|
|
|
@@ -1110,23 +1122,20 @@ DrSelectComponent.propDecorators = {
|
|
|
1110
1122
|
|
|
1111
1123
|
class DrAvatarComponent {
|
|
1112
1124
|
constructor() {
|
|
1125
|
+
this.warning = false;
|
|
1113
1126
|
this.userClicked = new EventEmitter();
|
|
1114
1127
|
this.parsedUsers = [];
|
|
1115
1128
|
}
|
|
1116
|
-
set users(
|
|
1117
|
-
if (
|
|
1118
|
-
this.parsedUsers =
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
this.getLastUsers().forEach((user) => user.class = `icon-${this.getRandomValue(5)}`);
|
|
1129
|
+
set users(users) {
|
|
1130
|
+
if (users) {
|
|
1131
|
+
this.parsedUsers = Array.isArray(users) ? users : [users];
|
|
1132
|
+
this.parsedUsers.forEach((user, index) => {
|
|
1133
|
+
if (!user.colorNumber) {
|
|
1134
|
+
user.colorNumber = index % 5;
|
|
1135
|
+
}
|
|
1136
|
+
});
|
|
1125
1137
|
}
|
|
1126
1138
|
}
|
|
1127
|
-
parseUsers(value) {
|
|
1128
|
-
return Array.isArray(value) ? value : Array.of(value);
|
|
1129
|
-
}
|
|
1130
1139
|
getFirstUsers() {
|
|
1131
1140
|
return this.parsedUsers.slice(0, 2);
|
|
1132
1141
|
}
|
|
@@ -1136,24 +1145,36 @@ class DrAvatarComponent {
|
|
|
1136
1145
|
}
|
|
1137
1146
|
return [];
|
|
1138
1147
|
}
|
|
1139
|
-
getRandomValue(limit) {
|
|
1140
|
-
return ~~(limit * Math.random());
|
|
1141
|
-
}
|
|
1142
1148
|
}
|
|
1143
1149
|
DrAvatarComponent.decorators = [
|
|
1144
1150
|
{ type: Component, args: [{
|
|
1145
1151
|
selector: 'dr-avatar',
|
|
1146
|
-
template: "<div class=\"users-section\">\r\n <div class=\"users-
|
|
1152
|
+
template: "<div class=\"users-section\">\r\n <div *ngIf=\"!parsedUsers.length\"\r\n class=\"users-section__default\"\r\n [drTooltip]=\"usersTemplate\"\r\n [drTooltipPosition]=\"'bottom'\">\r\n {{getLastUsers().length}}\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\"\r\n [class.warning]=\"warning && warning[user.email]\"\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
1153
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1148
|
-
styles: [":host{width:auto}.users-section{display:flex;
|
|
1154
|
+
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.warning:after{content:\"\";display:flex;width:8px;height:8px;position:absolute;background:#FDA014;border-radius:4px;top:-2px;right:0}\n"]
|
|
1149
1155
|
},] }
|
|
1150
1156
|
];
|
|
1151
1157
|
DrAvatarComponent.ctorParameters = () => [];
|
|
1152
1158
|
DrAvatarComponent.propDecorators = {
|
|
1153
1159
|
users: [{ type: Input }],
|
|
1160
|
+
warning: [{ type: Input }],
|
|
1154
1161
|
userClicked: [{ type: Output }]
|
|
1155
1162
|
};
|
|
1156
1163
|
|
|
1164
|
+
class DrAvatarPipe {
|
|
1165
|
+
transform(item, type = 'full') {
|
|
1166
|
+
if (type === 'initials') {
|
|
1167
|
+
return (item.first_name && item.last_name ? (item.first_name[0] + item.last_name[0]) : item.email[0]).toUpperCase();
|
|
1168
|
+
}
|
|
1169
|
+
return item.first_name && item.last_name ? (item.first_name + ' ' + item.last_name) : item.email;
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
1172
|
+
DrAvatarPipe.decorators = [
|
|
1173
|
+
{ type: Pipe, args: [{
|
|
1174
|
+
name: 'drAvatar'
|
|
1175
|
+
},] }
|
|
1176
|
+
];
|
|
1177
|
+
|
|
1157
1178
|
const POPUP_POSITIONS = {
|
|
1158
1179
|
top: {
|
|
1159
1180
|
originX: 'center',
|
|
@@ -2109,6 +2130,7 @@ class DrDropdownComponent {
|
|
|
2109
2130
|
if (data) {
|
|
2110
2131
|
this.option = data.option;
|
|
2111
2132
|
this.position = data.position;
|
|
2133
|
+
this.containerClass = data.class;
|
|
2112
2134
|
this.list = data.list || [];
|
|
2113
2135
|
this.list.forEach(item => {
|
|
2114
2136
|
var _a;
|
|
@@ -2183,9 +2205,9 @@ class DrDropdownComponent {
|
|
|
2183
2205
|
DrDropdownComponent.decorators = [
|
|
2184
2206
|
{ type: Component, args: [{
|
|
2185
2207
|
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",
|
|
2208
|
+
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
2209
|
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"]
|
|
2210
|
+
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
2211
|
},] }
|
|
2190
2212
|
];
|
|
2191
2213
|
DrDropdownComponent.ctorParameters = () => [
|
|
@@ -2220,6 +2242,7 @@ class DrDropdownDirective {
|
|
|
2220
2242
|
option,
|
|
2221
2243
|
position: this.position,
|
|
2222
2244
|
list: this.drDropdown,
|
|
2245
|
+
class: this.drDropdownClass
|
|
2223
2246
|
});
|
|
2224
2247
|
}
|
|
2225
2248
|
}
|
|
@@ -2262,6 +2285,7 @@ DrDropdownDirective.ctorParameters = () => [
|
|
|
2262
2285
|
DrDropdownDirective.propDecorators = {
|
|
2263
2286
|
position: [{ type: Input }],
|
|
2264
2287
|
drDropdown: [{ type: Input }],
|
|
2288
|
+
drDropdownClass: [{ type: Input }],
|
|
2265
2289
|
contentCmpRef: [{ type: ViewChild, args: [DrDropdownComponent, { static: true, read: ViewContainerRef },] }],
|
|
2266
2290
|
elementClick: [{ type: HostListener, args: ['click',] }],
|
|
2267
2291
|
documentClick: [{ type: HostListener, args: ['document:mouseup', ['$event'],] }]
|
|
@@ -2277,14 +2301,16 @@ class DrDropdownPositionDirective {
|
|
|
2277
2301
|
setTimeout(this.calculatePosition.bind(this), 1);
|
|
2278
2302
|
}
|
|
2279
2303
|
calculatePosition() {
|
|
2304
|
+
let xDifference = 0;
|
|
2280
2305
|
let defaultDelta = 10;
|
|
2281
2306
|
let defaultPadding = 0;
|
|
2282
2307
|
if (this.position === 'child') {
|
|
2283
2308
|
defaultDelta = 0;
|
|
2284
2309
|
defaultPadding = 10;
|
|
2310
|
+
xDifference = this.el.nativeElement.parentElement.parentElement.offsetWidth - this.el.nativeElement.offsetWidth;
|
|
2285
2311
|
const parentRect = this.el.nativeElement.parentElement.parentElement.getBoundingClientRect();
|
|
2286
2312
|
this.position = {
|
|
2287
|
-
x: this.el.nativeElement.
|
|
2313
|
+
x: this.el.nativeElement.offsetWidth,
|
|
2288
2314
|
y: this.el.nativeElement.parentElement.parentElement.offsetTop - 9,
|
|
2289
2315
|
clientX: parentRect.x + this.el.nativeElement.parentElement.parentElement.offsetWidth,
|
|
2290
2316
|
clientY: parentRect.y
|
|
@@ -2320,17 +2346,21 @@ class DrDropdownPositionDirective {
|
|
|
2320
2346
|
: this.position === 'bottom-left' ? 'content-bottom-left'
|
|
2321
2347
|
: this.position === 'left' ? 'content-left'
|
|
2322
2348
|
: this.position === 'left-center' ? 'content-left-center'
|
|
2323
|
-
: this.position === 'right' ? 'content-right'
|
|
2349
|
+
: this.position === 'right' ? 'content-right'
|
|
2350
|
+
: this.position === 'bottom-right' ? 'content-bottom-right' : '';
|
|
2324
2351
|
this.renderer.addClass(this.el.nativeElement, className);
|
|
2325
2352
|
this.renderer.setStyle(this.el.nativeElement, 'z-index', '10010');
|
|
2326
2353
|
}
|
|
2327
2354
|
else {
|
|
2355
|
+
const defaultChildPadding = 5;
|
|
2328
2356
|
const widthMoreWindowRight = window.innerWidth - this.position.clientX - this.el.nativeElement.offsetWidth - defaultPadding;
|
|
2329
|
-
const deltaWidth = widthMoreWindowRight < 0 ? widthMoreWindowRight : defaultDelta;
|
|
2330
2357
|
const widthMoreWindowBottom = window.innerHeight - this.position.clientY - this.el.nativeElement.offsetHeight - defaultPadding;
|
|
2358
|
+
const calculatedHorizantallyPos = widthMoreWindowRight < 0
|
|
2359
|
+
? -this.position.x + -defaultChildPadding
|
|
2360
|
+
: this.position.x + defaultChildPadding + xDifference;
|
|
2331
2361
|
const deltaHeight = widthMoreWindowBottom < 0 ? widthMoreWindowBottom : defaultDelta;
|
|
2332
2362
|
this.renderer.setStyle(this.el.nativeElement, 'top', (this.position.y + deltaHeight) + 'px');
|
|
2333
|
-
this.renderer.setStyle(this.el.nativeElement, 'left', (
|
|
2363
|
+
this.renderer.setStyle(this.el.nativeElement, 'left', (calculatedHorizantallyPos) + 'px');
|
|
2334
2364
|
this.renderer.setStyle(this.el.nativeElement, 'z-index', '10010');
|
|
2335
2365
|
}
|
|
2336
2366
|
}
|
|
@@ -2493,9 +2523,7 @@ class DrInputsModule {
|
|
|
2493
2523
|
}
|
|
2494
2524
|
DrInputsModule.decorators = [
|
|
2495
2525
|
{ type: NgModule, args: [{
|
|
2496
|
-
declarations:
|
|
2497
|
-
components$1,
|
|
2498
|
-
],
|
|
2526
|
+
declarations: components$1,
|
|
2499
2527
|
exports: components$1,
|
|
2500
2528
|
imports: [
|
|
2501
2529
|
FormsModule,
|
|
@@ -2531,10 +2559,12 @@ class DrAvatarModule {
|
|
|
2531
2559
|
DrAvatarModule.decorators = [
|
|
2532
2560
|
{ type: NgModule, args: [{
|
|
2533
2561
|
declarations: [
|
|
2534
|
-
DrAvatarComponent
|
|
2562
|
+
DrAvatarComponent,
|
|
2563
|
+
DrAvatarPipe
|
|
2535
2564
|
],
|
|
2536
2565
|
exports: [
|
|
2537
|
-
DrAvatarComponent
|
|
2566
|
+
DrAvatarComponent,
|
|
2567
|
+
DrAvatarPipe
|
|
2538
2568
|
],
|
|
2539
2569
|
imports: [
|
|
2540
2570
|
MatTooltipModule,
|
|
@@ -2632,5 +2662,5 @@ DrTabsModule.decorators = [
|
|
|
2632
2662
|
* Generated bundle index. Do not edit.
|
|
2633
2663
|
*/
|
|
2634
2664
|
|
|
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 };
|
|
2665
|
+
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, TooltipComponent, WeekTagComponent, YearTagComponent, components$2 as ɵa, POPUP_ANIMATION as ɵb, CustomDateFormat as ɵc };
|
|
2636
2666
|
//# sourceMappingURL=datarailsshared-datarailsshared.js.map
|