@datarailsshared/datarailsshared 1.4.95 → 1.4.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/datarailsshared-datarailsshared.umd.js +703 -36
- package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
- package/datarailsshared-datarailsshared-1.4.100.tgz +0 -0
- package/datarailsshared-datarailsshared.d.ts +8 -0
- package/datarailsshared-datarailsshared.metadata.json +1 -1
- package/esm2015/datarailsshared-datarailsshared.js +9 -1
- package/esm2015/lib/dr-chat/chat.component.js +58 -0
- package/esm2015/lib/dr-chat/chat.module.js +37 -0
- package/esm2015/lib/dr-chat/dr-chat-form/chat-form.component.js +127 -0
- package/esm2015/lib/dr-chat/dr-chat-message/chat-message.component.js +70 -0
- package/esm2015/lib/dr-chat/dr-chat-message/dr-chat-message-custom/chat-custom-message.directive.js +49 -0
- package/esm2015/lib/dr-chat/dr-chat-message/dr-chat-message-custom/chat-custom-message.service.js +23 -0
- package/esm2015/lib/dr-chat/dr-chat-message/dr-chat-message-file/chat-message-file.component.js +47 -0
- package/esm2015/lib/dr-chat/dr-chat-message/dr-chat-message-rich-text/chat-message-rich-text.component.js +18 -0
- package/esm2015/lib/dr-chat/dr-chat-message/dr-chat-message-text/chat-message-text.component.js +18 -0
- package/esm2015/lib/dr-dialog/components/dialog-modal-wrapper/dialog-modal-wrapper.component.js +2 -2
- package/esm2015/lib/dr-inputs/date-pickers/dr-date-picker/dr-date-picker.component.js +40 -5
- package/esm2015/lib/dr-inputs/date-pickers/dr-date-picker-with-timeframe/dr-date-picker-with-timeframe.component.js +7 -2
- package/esm2015/lib/dr-inputs/date-pickers/dr-date-picker_custom-header/dr-date-picker_custom-header.component.js +30 -14
- package/esm2015/lib/dr-inputs/date-pickers/services/dr-date-picker.service.js +90 -1
- package/esm2015/lib/dr-inputs/dr-select/dr-select.component.js +2 -2
- package/esm2015/lib/models/chat.js +33 -0
- package/esm2015/public-api.js +3 -1
- package/fesm2015/datarailsshared-datarailsshared.js +625 -33
- package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
- package/lib/dr-chat/chat.component.d.ts +21 -0
- package/lib/dr-chat/chat.module.d.ts +2 -0
- package/lib/dr-chat/dr-chat-form/chat-form.component.d.ts +55 -0
- package/lib/dr-chat/dr-chat-message/chat-message.component.d.ts +38 -0
- package/lib/dr-chat/dr-chat-message/dr-chat-message-custom/chat-custom-message.directive.d.ts +18 -0
- package/lib/dr-chat/dr-chat-message/dr-chat-message-custom/chat-custom-message.service.d.ts +11 -0
- package/lib/dr-chat/dr-chat-message/dr-chat-message-file/chat-message-file.component.d.ts +25 -0
- package/lib/dr-chat/dr-chat-message/dr-chat-message-rich-text/chat-message-rich-text.component.d.ts +12 -0
- package/lib/dr-chat/dr-chat-message/dr-chat-message-text/chat-message-text.component.d.ts +12 -0
- package/lib/dr-inputs/date-pickers/dr-date-picker/dr-date-picker.component.d.ts +1 -0
- package/lib/dr-inputs/date-pickers/dr-date-picker_custom-header/dr-date-picker_custom-header.component.d.ts +5 -3
- package/lib/dr-inputs/date-pickers/services/dr-date-picker.service.d.ts +58 -0
- package/lib/models/chat.d.ts +106 -0
- package/package.json +1 -1
- package/public-api.d.ts +2 -0
- package/datarailsshared-datarailsshared-1.4.95.tgz +0 -0
|
@@ -22,6 +22,7 @@ import { MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
|
22
22
|
import { NgSelectModule } from '@ng-select/ng-select';
|
|
23
23
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
24
24
|
import { MatTabsModule } from '@angular/material/tabs';
|
|
25
|
+
import { DomSanitizer } from '@angular/platform-browser';
|
|
25
26
|
|
|
26
27
|
// import {*} from ""
|
|
27
28
|
class DateTagComponent {
|
|
@@ -250,7 +251,7 @@ const MONTH_FORMATS = {
|
|
|
250
251
|
monthYearA11yLabel: 'MMMM YYYY'
|
|
251
252
|
},
|
|
252
253
|
};
|
|
253
|
-
const ɵ0$
|
|
254
|
+
const ɵ0$7 = MONTH_FORMATS;
|
|
254
255
|
class MonthTagComponent extends AnyTagComponent {
|
|
255
256
|
constructor() {
|
|
256
257
|
super();
|
|
@@ -309,7 +310,7 @@ MonthTagComponent.decorators = [
|
|
|
309
310
|
useClass: MomentDateAdapter,
|
|
310
311
|
deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
311
312
|
},
|
|
312
|
-
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$
|
|
313
|
+
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$7 },
|
|
313
314
|
]
|
|
314
315
|
},] }
|
|
315
316
|
];
|
|
@@ -431,7 +432,7 @@ const WEEK_FORMATS = {
|
|
|
431
432
|
monthYearA11yLabel: 'MMMM YYYY'
|
|
432
433
|
},
|
|
433
434
|
};
|
|
434
|
-
const ɵ0$
|
|
435
|
+
const ɵ0$6 = WEEK_FORMATS;
|
|
435
436
|
class WeekTagComponent extends AnyTagComponent {
|
|
436
437
|
constructor() {
|
|
437
438
|
super();
|
|
@@ -527,7 +528,7 @@ WeekTagComponent.decorators = [
|
|
|
527
528
|
useClass: MomentDateAdapter,
|
|
528
529
|
deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
529
530
|
},
|
|
530
|
-
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$
|
|
531
|
+
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$6 },
|
|
531
532
|
]
|
|
532
533
|
},] }
|
|
533
534
|
];
|
|
@@ -549,7 +550,7 @@ const YEAR_FORMATS = {
|
|
|
549
550
|
monthYearA11yLabel: 'MMMM YYYY'
|
|
550
551
|
},
|
|
551
552
|
};
|
|
552
|
-
const ɵ0$
|
|
553
|
+
const ɵ0$5 = YEAR_FORMATS;
|
|
553
554
|
class YearTagComponent extends AnyTagComponent {
|
|
554
555
|
constructor() {
|
|
555
556
|
super();
|
|
@@ -614,7 +615,7 @@ YearTagComponent.decorators = [
|
|
|
614
615
|
useClass: MomentDateAdapter,
|
|
615
616
|
deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
616
617
|
},
|
|
617
|
-
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$
|
|
618
|
+
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$5 },
|
|
618
619
|
]
|
|
619
620
|
},] }
|
|
620
621
|
];
|
|
@@ -728,7 +729,7 @@ const DAY_FORMATS = {
|
|
|
728
729
|
monthYearA11yLabel: 'MMMM YYYY'
|
|
729
730
|
},
|
|
730
731
|
};
|
|
731
|
-
const ɵ0$
|
|
732
|
+
const ɵ0$4 = DAY_FORMATS;
|
|
732
733
|
class DayTagComponent extends AnyTagComponent {
|
|
733
734
|
constructor() {
|
|
734
735
|
super();
|
|
@@ -779,7 +780,7 @@ DayTagComponent.decorators = [
|
|
|
779
780
|
useClass: MomentDateAdapter,
|
|
780
781
|
deps: [MAT_DATE_LOCALE, MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
781
782
|
},
|
|
782
|
-
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$
|
|
783
|
+
{ provide: MAT_DATE_FORMATS, useValue: ɵ0$4 },
|
|
783
784
|
]
|
|
784
785
|
},] }
|
|
785
786
|
];
|
|
@@ -1314,7 +1315,7 @@ class DrSelectComponent {
|
|
|
1314
1315
|
DrSelectComponent.decorators = [
|
|
1315
1316
|
{ type: Component, args: [{
|
|
1316
1317
|
selector: 'dr-select',
|
|
1317
|
-
template: "<ng-select [(ngModel)]=\"selectedItem\"\n [items]=\"items\"\n [bindLabel]=\"bindLabel\"\n [bindValue]=\"bindValue\"\n [multiple]=\"multiple\"\n [addTag]=\"addTag\"\n [appendTo]=\"appendTo\"\n [clearable]=\"clearable\"\n [searchable]=\"searchable\"\n [hideSelected]=\"hideSelected\"\n [placeholder]=\"placeholder\"\n [loading]=\"loading\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [id]=\"id\"\n [keyDownFn]=\"keyDownFn\"\n [searchFn]=\"searchFn\"\n [isOpen]=\"isOpen\"\n [groupBy]=\"groupBy\"\n [attr.autofocus]=\"autofocus\"\n (change)=\"onChange(selectedItem); change.emit(selectedItem)\"\n (open)=\"open.emit($event)\"\n class=\"dr-select\">\n <ng-template *ngIf=\"optionHeaderTemplate\" ng-header-tmp let-item=\"item\">\n <ng-container [ngTemplateOutlet]=\"optionHeaderTemplate\" [ngTemplateOutletContext]=\"{item: item}\"></ng-container>\n </ng-template>\n <ng-template *ngIf=\"labelTemplate\" ng-label-tmp let-item=\"item\">\n <ng-container [ngTemplateOutlet]=\"labelTemplate\" [ngTemplateOutletContext]=\"{item: item}\"></ng-container>\n </ng-template>\n <ng-template *ngIf=\"optionTemplate\" ng-option-tmp let-item=\"item\">\n <ng-container [ngTemplateOutlet]=\"optionTemplate\" [ngTemplateOutletContext]=\"{item: item}\"></ng-container>\n </ng-template>\n <ng-template *ngIf=\"optionWithDescription\" ng-option-tmp let-item=\"item\">\n <div class=\"dr-select__option-with-desc__wrapper\">\n <div>{{ item.name }}</div>\n <div class=\"dr-select__option-with-desc__description\"\n >{{ item?.description }}</div>\n </div>\n </ng-template>\n <ng-template *ngIf=\"optionFooterTemplate\" ng-footer-tmp let-item=\"item\">\n <ng-container [ngTemplateOutlet]=\"optionFooterTemplate\" [ngTemplateOutletContext]=\"{item: item}\"></ng-container>\n </ng-template>\n <ng-template *ngIf=\"groupBy\" ng-optgroup-tmp let-item=\"item\">\n {{ item[groupBy] }}\n </ng-template>\n</ng-select>\n",
|
|
1318
|
+
template: "<ng-select [(ngModel)]=\"selectedItem\"\n [items]=\"items\"\n [bindLabel]=\"bindLabel\"\n [bindValue]=\"bindValue\"\n [multiple]=\"multiple\"\n [addTag]=\"addTag\"\n [appendTo]=\"appendTo\"\n [clearable]=\"clearable\"\n [searchable]=\"searchable\"\n [hideSelected]=\"hideSelected\"\n [placeholder]=\"placeholder\"\n [loading]=\"loading\"\n [readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [id]=\"id\"\n [keyDownFn]=\"keyDownFn\"\n [searchFn]=\"searchFn\"\n [isOpen]=\"isOpen\"\n [groupBy]=\"groupBy\"\n [attr.autofocus]=\"autofocus\"\n (change)=\"onChange(selectedItem); change.emit(selectedItem)\"\n (open)=\"open.emit($event)\"\n class=\"dr-select\"\n #selectComponent>\n <ng-template *ngIf=\"optionHeaderTemplate\" ng-header-tmp let-item=\"item\">\n <ng-container [ngTemplateOutlet]=\"optionHeaderTemplate\" [ngTemplateOutletContext]=\"{item: item}\"></ng-container>\n </ng-template>\n <ng-template *ngIf=\"labelTemplate\" ng-label-tmp let-item=\"item\">\n <ng-container [ngTemplateOutlet]=\"labelTemplate\" [ngTemplateOutletContext]=\"{item: item}\"></ng-container>\n </ng-template>\n <ng-template *ngIf=\"optionTemplate\" ng-option-tmp let-item=\"item\">\n <ng-container [ngTemplateOutlet]=\"optionTemplate\" [ngTemplateOutletContext]=\"{item: item}\"></ng-container>\n </ng-template>\n <ng-template *ngIf=\"optionWithDescription\" ng-option-tmp let-item=\"item\">\n <div class=\"dr-select__option-with-desc__wrapper\">\n <div>{{ item.name }}</div>\n <div class=\"dr-select__option-with-desc__description\"\n >{{ item?.description }}</div>\n </div>\n </ng-template>\n <ng-template *ngIf=\"optionFooterTemplate\" ng-footer-tmp let-item=\"item\">\n <ng-container [ngTemplateOutlet]=\"optionFooterTemplate\" [ngTemplateOutletContext]=\"{ item: item, close: selectComponent.close.bind(selectComponent) }\"></ng-container>\n </ng-template>\n <ng-template *ngIf=\"groupBy\" ng-optgroup-tmp let-item=\"item\">\n {{ item[groupBy] }}\n </ng-template>\n</ng-select>\n",
|
|
1318
1319
|
providers: [{
|
|
1319
1320
|
provide: NG_VALUE_ACCESSOR,
|
|
1320
1321
|
useExisting: DrSelectComponent,
|
|
@@ -3137,7 +3138,7 @@ class DialogModalWrapperComponent {
|
|
|
3137
3138
|
DialogModalWrapperComponent.decorators = [
|
|
3138
3139
|
{ type: Component, args: [{
|
|
3139
3140
|
selector: 'dr-dialog-modal-wrapper',
|
|
3140
|
-
template: "<div header class=\"header-dialog\">\n <h1 class=\"title-dialog\" data-test=\"modalTitle\">{{dialogData.title}}</h1>\n <i mat-icon-button *ngIf=\"!dialogData.hideCloseBtn\" (click)=\"closeDialog()\" class=\"dr-icon-exit icon-close\"\n data-test=\"xBtn\"></i>\n</div>\n<div *ngIf=\"dialogData.content\" class=\"content-dialog\">\n <ng-container>{{dialogData.content}}</ng-container>\n <span #content class=\"content-anchor\"></span>\n</div>\n<form *ngIf=\"dialogData.fields\" [formGroup]=\"form\" class=\"dr-smart-from\">\n <div class=\"dr-smart-form_wrapper\">\n <div *ngFor=\"let field of dialogData.fields\" class=\"dr-smart-form_group\"\n [ngStyle]=\"{'display': field.isLabelFullWidth ? 'block' : 'flex'}\">\n <label *ngIf=\"field.label\" [ngClass]=\"field.isLabelFullWidth ? 'col-md-12 mb-2' : 'col-md-2'\"\n class=\"label p-0 d-flex align-items-center\">{{field.label}}</label>\n <div class=\"input-group p-0\"\n [ngClass]=\"{'col-md-10': field.label && !field.isLabelFullWidth, 'col-md-12': !field.label || field.isLabelFullWidth}\">\n <dr-select *ngIf=\"field.type === 'select'\"\n [searchable]=\"dialogData.searchable\"\n [clearable]=\"dialogData.clearable\"\n [formControlName]=\"field.name\"\n [bindLabel]=\"field.bindLabel || null\"\n [bindValue]=\"field.bindValue || null\"\n [selectedItem]=\"field.default\"\n [items]=\"field.items || (field.items$ | async)\"\n [required]=\"true\"\n [placeholder]=\"field.placeholder\">\n <ng-template *ngIf=\"dialogData?.footerTemplateData\" #optionFooterTemplate>\n <button (click)=\"footerAction()
|
|
3141
|
+
template: "<div header class=\"header-dialog\">\n <h1 class=\"title-dialog\" data-test=\"modalTitle\">{{dialogData.title}}</h1>\n <i mat-icon-button *ngIf=\"!dialogData.hideCloseBtn\" (click)=\"closeDialog()\" class=\"dr-icon-exit icon-close\"\n data-test=\"xBtn\"></i>\n</div>\n<div *ngIf=\"dialogData.content\" class=\"content-dialog\">\n <ng-container>{{dialogData.content}}</ng-container>\n <span #content class=\"content-anchor\"></span>\n</div>\n<form *ngIf=\"dialogData.fields\" [formGroup]=\"form\" class=\"dr-smart-from\">\n <div class=\"dr-smart-form_wrapper\">\n <div *ngFor=\"let field of dialogData.fields\" class=\"dr-smart-form_group\"\n [ngStyle]=\"{'display': field.isLabelFullWidth ? 'block' : 'flex'}\">\n <label *ngIf=\"field.label\" [ngClass]=\"field.isLabelFullWidth ? 'col-md-12 mb-2' : 'col-md-2'\"\n class=\"label p-0 d-flex align-items-center\">{{field.label}}</label>\n <div class=\"input-group p-0\"\n [ngClass]=\"{'col-md-10': field.label && !field.isLabelFullWidth, 'col-md-12': !field.label || field.isLabelFullWidth}\">\n <dr-select *ngIf=\"field.type === 'select'\"\n [searchable]=\"dialogData.searchable\"\n [clearable]=\"dialogData.clearable\"\n [formControlName]=\"field.name\"\n [bindLabel]=\"field.bindLabel || null\"\n [bindValue]=\"field.bindValue || null\"\n [selectedItem]=\"field.default\"\n [items]=\"field.items || (field.items$ | async)\"\n [required]=\"true\"\n [placeholder]=\"field.placeholder\">\n <ng-template *ngIf=\"dialogData?.footerTemplateData\" #optionFooterTemplate let-item=\"item\" let-close=\"close\">\n <button (click)=\"footerAction(); close();\" class=\"dr-select-footer__btn\">\n <i *ngIf=\"dialogData.footerTemplateData.icon\"\n class=\"{{dialogData.footerTemplateData.icon}}\"></i>\n {{dialogData.footerTemplateData.label}}</button>\n </ng-template>\n </dr-select>\n <dr-input *ngIf=\"field.type === 'input'\" data-test=\"modalInput\" class=\"form-control\"\n [formControlName]=\"field.name\" [placeholder]=\"field.placeholder\"></dr-input>\n <label class=\"form-error-alert\" *ngIf=\"dialogData.errorMessage && !form.pristine && form.invalid\">\n {{dialogData.errorMessage}}\n </label>\n <label class=\"form-error-alert\"\n *ngIf=\"form.valid && showServerErrorMessage && dialogData.serverErrorMessage\">\n {{dialogData.serverErrorMessage}}\n </label>\n </div>\n </div>\n </div>\n</form>\n\n<div footer class=\"footer-dialog\">\n <div class=\"buttons-wrapper\" *ngIf=\"dialogData.cancelButton || dialogData.acceptButton\">\n <dr-button *ngIf=\"dialogData.cancelButton\" data-test=\"modalCloseBtn\" (click)=\"closeDialog()\"\n [theme]=\"'secondary'\"> {{dialogData.cancelButton.label}}</dr-button>\n <dr-button *ngIf=\"dialogData.acceptButton\" data-test=\"modalAddBtn\" (click)=\"onAccept()\" [theme]=\"'primary'\"\n [isLoading]=\"isLoading\" [disabled]=\"form.invalid\"> {{dialogData.acceptButton.label}}</dr-button>\n </div>\n</div>\n",
|
|
3141
3142
|
styles: [":host{display:flex;justify-content:space-between;flex-direction:column}:host.small-modal{min-height:188px;max-height:467px;min-width:400px;max-width:400px}:host.medium-modal{min-height:188px;max-height:467px;min-width:632px;max-width:632px}.header-dialog{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:8px 39px 8px 32px;border-bottom:1px solid #e5e6ea}.title-dialog{color:#151b3f;position:static;font-weight:bold;font-size:18px;line-height:24px}.content-dialog{font-weight:400;font-size:14px;padding:16px 32px 5px}.icon-close{color:#51566f;cursor:pointer}.dr-smart-from{font-size:14px;font-weight:500;line-height:22px;padding:16px 32px 22px}.content-dialog{padding:16px 32px 0;font-weight:400;font-size:14px;line-height:22px}.content-anchor{display:none}.footer-dialog{border-top:1px solid #e5e6ea}.buttons-wrapper{display:flex;justify-content:flex-end;padding-top:10px;padding-right:32px;padding-bottom:11px}.buttons-wrapper dr-button:nth-of-type(2){margin-left:12px}.form-error-alert{position:absolute;margin-top:5px;font-size:12px;color:red}.dr-select-footer__btn{background-color:transparent;display:flex;align-items:center;justify-content:flex-start;cursor:pointer;min-width:15rem;font-style:normal;font-weight:400;font-size:14px;line-height:24px;clear:both;width:100%;white-space:nowrap;padding:0 12px;height:36px;flex-shrink:0}\n"]
|
|
3142
3143
|
},] }
|
|
3143
3144
|
];
|
|
@@ -3348,6 +3349,39 @@ var CalendarView;
|
|
|
3348
3349
|
CalendarView["FOR_YEARS"] = "multi-year";
|
|
3349
3350
|
})(CalendarView || (CalendarView = {}));
|
|
3350
3351
|
|
|
3352
|
+
const IMAGE_TYPES = ['image/png', 'image/jpeg', 'image/gif'];
|
|
3353
|
+
var CHAT_MESSAGE_TYPE;
|
|
3354
|
+
(function (CHAT_MESSAGE_TYPE) {
|
|
3355
|
+
CHAT_MESSAGE_TYPE["TEXT"] = "text";
|
|
3356
|
+
CHAT_MESSAGE_TYPE["RICH_TEXT"] = "rich-text";
|
|
3357
|
+
CHAT_MESSAGE_TYPE["IMAGE"] = "image";
|
|
3358
|
+
CHAT_MESSAGE_TYPE["DOWNLOAD_FILE"] = "download-file";
|
|
3359
|
+
CHAT_MESSAGE_TYPE["MAILTO"] = "mailto";
|
|
3360
|
+
CHAT_MESSAGE_TYPE["EMBED"] = "embed";
|
|
3361
|
+
CHAT_MESSAGE_TYPE["WIDGET"] = "widget";
|
|
3362
|
+
CHAT_MESSAGE_TYPE["INPUT"] = "input";
|
|
3363
|
+
CHAT_MESSAGE_TYPE["CODE"] = "code";
|
|
3364
|
+
})(CHAT_MESSAGE_TYPE || (CHAT_MESSAGE_TYPE = {}));
|
|
3365
|
+
class ChatMessage {
|
|
3366
|
+
constructor(obj, user) {
|
|
3367
|
+
this.id = obj === null || obj === void 0 ? void 0 : obj.id;
|
|
3368
|
+
this.kind = obj === null || obj === void 0 ? void 0 : obj.kind;
|
|
3369
|
+
this.seq = obj === null || obj === void 0 ? void 0 : obj.seq;
|
|
3370
|
+
this.conversationId = obj === null || obj === void 0 ? void 0 : obj.conversationId;
|
|
3371
|
+
this.reply = (obj === null || obj === void 0 ? void 0 : obj.senderId) !== user.id;
|
|
3372
|
+
this.senderId = obj === null || obj === void 0 ? void 0 : obj.senderId;
|
|
3373
|
+
this.parentId = obj === null || obj === void 0 ? void 0 : obj.parentId;
|
|
3374
|
+
this.text = (obj === null || obj === void 0 ? void 0 : obj.text) || obj.body;
|
|
3375
|
+
this.paragraphs = obj === null || obj === void 0 ? void 0 : obj.paragraphs;
|
|
3376
|
+
this.url = obj === null || obj === void 0 ? void 0 : obj.url;
|
|
3377
|
+
this.label = obj === null || obj === void 0 ? void 0 : obj.label;
|
|
3378
|
+
this.subject = obj === null || obj === void 0 ? void 0 : obj.subject;
|
|
3379
|
+
this.body = obj === null || obj === void 0 ? void 0 : obj.body;
|
|
3380
|
+
this.form = obj === null || obj === void 0 ? void 0 : obj.form;
|
|
3381
|
+
this.parameters = obj === null || obj === void 0 ? void 0 : obj.parameters;
|
|
3382
|
+
}
|
|
3383
|
+
}
|
|
3384
|
+
|
|
3351
3385
|
const components$3 = [DateTagComponent,
|
|
3352
3386
|
DayTagComponent,
|
|
3353
3387
|
WeekTagComponent,
|
|
@@ -3356,7 +3390,7 @@ const components$3 = [DateTagComponent,
|
|
|
3356
3390
|
AnyTagComponent,
|
|
3357
3391
|
YearTagComponent,
|
|
3358
3392
|
ForecastTagComponent];
|
|
3359
|
-
const ɵ0$
|
|
3393
|
+
const ɵ0$3 = { useUtc: true };
|
|
3360
3394
|
class DateTagModule {
|
|
3361
3395
|
}
|
|
3362
3396
|
DateTagModule.decorators = [
|
|
@@ -3374,7 +3408,7 @@ DateTagModule.decorators = [
|
|
|
3374
3408
|
],
|
|
3375
3409
|
exports: components$3,
|
|
3376
3410
|
providers: [
|
|
3377
|
-
{ provide: MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: ɵ0$
|
|
3411
|
+
{ provide: MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: ɵ0$3 }
|
|
3378
3412
|
],
|
|
3379
3413
|
declarations: components$3,
|
|
3380
3414
|
},] }
|
|
@@ -3467,6 +3501,7 @@ class DrDatePickerService {
|
|
|
3467
3501
|
quarter: DateFromats.QUARTER_FORMAT,
|
|
3468
3502
|
week: DateFromats.WEEK_FORMAT
|
|
3469
3503
|
};
|
|
3504
|
+
this.fiscalYearMonthsModifier = 0;
|
|
3470
3505
|
}
|
|
3471
3506
|
getDisplayPrefix() {
|
|
3472
3507
|
const formatCached = this.format$.getValue();
|
|
@@ -3493,6 +3528,93 @@ class DrDatePickerService {
|
|
|
3493
3528
|
normalizeValue(value) {
|
|
3494
3529
|
return value.replace(/d/g, 'D');
|
|
3495
3530
|
}
|
|
3531
|
+
/**
|
|
3532
|
+
* Get quarter number for date according to fiscal year
|
|
3533
|
+
*
|
|
3534
|
+
* @param date
|
|
3535
|
+
*/
|
|
3536
|
+
getQuarterAccordingToFiscalYear(date) {
|
|
3537
|
+
let fiscalMonth = this.fiscalYearMonthsModifier;
|
|
3538
|
+
const dateMonth = date.month();
|
|
3539
|
+
if (dateMonth < fiscalMonth) {
|
|
3540
|
+
fiscalMonth -= 12;
|
|
3541
|
+
}
|
|
3542
|
+
return Math.trunc((date.month() - fiscalMonth) / 3) + 1;
|
|
3543
|
+
}
|
|
3544
|
+
/**
|
|
3545
|
+
* Sets date to end of quarter in FY by passed quarter number
|
|
3546
|
+
*
|
|
3547
|
+
* @param date
|
|
3548
|
+
* @param quarterNumber
|
|
3549
|
+
*/
|
|
3550
|
+
setEndOfQuarter(date, quarterNumber) {
|
|
3551
|
+
date
|
|
3552
|
+
.subtract(this.fiscalYearMonthsModifier, 'M')
|
|
3553
|
+
.startOf('year')
|
|
3554
|
+
.add(this.fiscalYearMonthsModifier + quarterNumber * 3 - 1, 'M')
|
|
3555
|
+
.endOf('month');
|
|
3556
|
+
}
|
|
3557
|
+
/**
|
|
3558
|
+
* Sets date to start of quarter in FY by passed quarter number
|
|
3559
|
+
*
|
|
3560
|
+
* @param date
|
|
3561
|
+
* @param quarterNumber
|
|
3562
|
+
*/
|
|
3563
|
+
setStartOfQuarter(date, quarterNumber) {
|
|
3564
|
+
date
|
|
3565
|
+
.subtract(this.fiscalYearMonthsModifier, 'M')
|
|
3566
|
+
.startOf('year')
|
|
3567
|
+
.add(this.fiscalYearMonthsModifier + (quarterNumber - 1) * 3, 'M');
|
|
3568
|
+
}
|
|
3569
|
+
/**
|
|
3570
|
+
* Sets date to end of current quarter (in which date is located) according to FY
|
|
3571
|
+
*
|
|
3572
|
+
* @param date
|
|
3573
|
+
*/
|
|
3574
|
+
setEndOfCurrentQuarter(date) {
|
|
3575
|
+
this.setEndOfQuarter(date, this.getQuarterAccordingToFiscalYear(date));
|
|
3576
|
+
}
|
|
3577
|
+
/**
|
|
3578
|
+
* Sets date to start of current quarter (in which date is located) according to FY
|
|
3579
|
+
*
|
|
3580
|
+
* @param date
|
|
3581
|
+
*/
|
|
3582
|
+
setStartOfCurrentQuarter(date) {
|
|
3583
|
+
this.setStartOfQuarter(date, this.getQuarterAccordingToFiscalYear(date));
|
|
3584
|
+
}
|
|
3585
|
+
/**
|
|
3586
|
+
* If date selection on this timeframe depends on Fiscal Year
|
|
3587
|
+
*
|
|
3588
|
+
* @param timeframe
|
|
3589
|
+
*/
|
|
3590
|
+
isTimeframeDependingOnFY(timeframe) {
|
|
3591
|
+
return _.includes([TimeframeOption.QUARTER, TimeframeOption.YEAR], timeframe);
|
|
3592
|
+
}
|
|
3593
|
+
/**
|
|
3594
|
+
* Subtract from date fiscal year shift months count
|
|
3595
|
+
*
|
|
3596
|
+
* @param date
|
|
3597
|
+
*/
|
|
3598
|
+
subtractFiscalYearMonthsFromDate(date) {
|
|
3599
|
+
return this.getDateModifiedByFiscalMonths(date, true);
|
|
3600
|
+
}
|
|
3601
|
+
/**
|
|
3602
|
+
* Add to date fiscal year shift months count
|
|
3603
|
+
*
|
|
3604
|
+
* @param date
|
|
3605
|
+
*/
|
|
3606
|
+
addFiscalYearMonthsToDate(date) {
|
|
3607
|
+
return this.getDateModifiedByFiscalMonths(date);
|
|
3608
|
+
}
|
|
3609
|
+
/**
|
|
3610
|
+
* Add or subtract depending on isRevert paremeter Fiscal year month shift
|
|
3611
|
+
*
|
|
3612
|
+
* @param date
|
|
3613
|
+
* @param isSubtract
|
|
3614
|
+
*/
|
|
3615
|
+
getDateModifiedByFiscalMonths(date, isSubtract = false) {
|
|
3616
|
+
return date ? _.cloneDeep(date)[isSubtract ? 'subtract' : 'add'](this.fiscalYearMonthsModifier, 'month') : date;
|
|
3617
|
+
}
|
|
3496
3618
|
}
|
|
3497
3619
|
DrDatePickerService.decorators = [
|
|
3498
3620
|
{ type: Injectable }
|
|
@@ -3526,20 +3648,20 @@ class DrDatePickerCustomHeaderComponent {
|
|
|
3526
3648
|
title: 'Month',
|
|
3527
3649
|
value: CalendarView.FOR_MONTHS,
|
|
3528
3650
|
format: this.datePickerService.formatConfig.month,
|
|
3529
|
-
periodLabel: () => String(moment$1(this._calendar.activeDate).year())
|
|
3651
|
+
periodLabel: () => String(moment$1(this._calendar.activeDate).utc().year())
|
|
3530
3652
|
}, {
|
|
3531
3653
|
timeframe: TimeframeOption.QUARTER,
|
|
3532
3654
|
title: 'Quarter',
|
|
3533
3655
|
value: CalendarView.FOR_QUARTERS,
|
|
3534
3656
|
format: this.datePickerService.formatConfig.quarter,
|
|
3535
|
-
periodLabel: () => String(moment$1(this._calendar.activeDate).year())
|
|
3657
|
+
periodLabel: () => String(moment$1(this.datePickerService.subtractFiscalYearMonthsFromDate(this._calendar.activeDate)).utc().year())
|
|
3536
3658
|
}, {
|
|
3537
3659
|
timeframe: TimeframeOption.YEAR,
|
|
3538
3660
|
title: 'Year',
|
|
3539
3661
|
value: CalendarView.FOR_YEARS,
|
|
3540
3662
|
format: this.datePickerService.formatConfig.year,
|
|
3541
3663
|
periodLabel: () => {
|
|
3542
|
-
const currentYear = moment$1(this._calendar.activeDate).year();
|
|
3664
|
+
const currentYear = moment$1(this.datePickerService.subtractFiscalYearMonthsFromDate(this._calendar.activeDate)).utc().year();
|
|
3543
3665
|
const startPeriod = Math.floor(currentYear / 24) * 24;
|
|
3544
3666
|
return startPeriod + '-' + (startPeriod + 23);
|
|
3545
3667
|
}
|
|
@@ -3561,12 +3683,24 @@ class DrDatePickerCustomHeaderComponent {
|
|
|
3561
3683
|
_calendar.currentView = this.selectedTimeframe;
|
|
3562
3684
|
this.setPeriodLabels();
|
|
3563
3685
|
if (this.selectedTimeframe === CalendarView.FOR_QUARTERS) {
|
|
3564
|
-
this.selectedQuarter =
|
|
3686
|
+
this.selectedQuarter = this.datePickerService.getQuarterAccordingToFiscalYear(this._calendar.activeDate);
|
|
3687
|
+
}
|
|
3688
|
+
});
|
|
3689
|
+
_calendar.viewChanged.pipe(takeUntil(this._destroyed)).subscribe(() => {
|
|
3690
|
+
this.setPeriodLabels();
|
|
3691
|
+
if (_calendar.multiYearView) {
|
|
3692
|
+
this.transformDateInMultiyearViewAccordingToFY();
|
|
3565
3693
|
}
|
|
3566
3694
|
});
|
|
3567
|
-
_calendar.viewChanged.pipe(takeUntil(this._destroyed)).subscribe(() => this.setPeriodLabels());
|
|
3568
3695
|
this.datePickerService.calendarInstance = _calendar;
|
|
3569
3696
|
}
|
|
3697
|
+
ngOnInit() {
|
|
3698
|
+
setTimeout(() => {
|
|
3699
|
+
if (this._calendar.multiYearView) {
|
|
3700
|
+
this.transformDateInMultiyearViewAccordingToFY();
|
|
3701
|
+
}
|
|
3702
|
+
});
|
|
3703
|
+
}
|
|
3570
3704
|
ngOnDestroy() {
|
|
3571
3705
|
this._destroyed.next();
|
|
3572
3706
|
this._destroyed.complete();
|
|
@@ -3590,7 +3724,7 @@ class DrDatePickerCustomHeaderComponent {
|
|
|
3590
3724
|
const chosenTimeframeOption = this.timeframeOptions.filter(option => option.value === this.selectedTimeframe)[0];
|
|
3591
3725
|
this.datePickerService.updateTimeframeAndFormat(chosenTimeframeOption.format);
|
|
3592
3726
|
if (this.selectedTimeframe === CalendarView.FOR_QUARTERS) {
|
|
3593
|
-
this.selectedQuarter =
|
|
3727
|
+
this.selectedQuarter = this.datePickerService.getQuarterAccordingToFiscalYear(this._calendar.activeDate);
|
|
3594
3728
|
}
|
|
3595
3729
|
}
|
|
3596
3730
|
get currentViewIsQuarter() {
|
|
@@ -3600,11 +3734,9 @@ class DrDatePickerCustomHeaderComponent {
|
|
|
3600
3734
|
this._calendar.currentView = view;
|
|
3601
3735
|
}
|
|
3602
3736
|
onSelectQuarter(quarterNumber) {
|
|
3603
|
-
|
|
3604
|
-
this.
|
|
3605
|
-
|
|
3606
|
-
this._calendar.activeDate = unadaptedDate;
|
|
3607
|
-
this.datePickerService.updatedQuarter$.next(moment$1(unadaptedDate));
|
|
3737
|
+
this.selectedQuarter = quarterNumber;
|
|
3738
|
+
this.datePickerService.setEndOfQuarter(this._calendar.activeDate, quarterNumber);
|
|
3739
|
+
this.datePickerService.updatedQuarter$.next(this._calendar.activeDate);
|
|
3608
3740
|
this.datePickerService.datePickerInstance.close();
|
|
3609
3741
|
}
|
|
3610
3742
|
pagingClicked(forward) {
|
|
@@ -3616,11 +3748,17 @@ class DrDatePickerCustomHeaderComponent {
|
|
|
3616
3748
|
this._calendar.activeDate = this._dateAdapter[actionCall](this._calendar.activeDate, forward ? amount : -amount);
|
|
3617
3749
|
this.setPeriodLabels();
|
|
3618
3750
|
}
|
|
3751
|
+
transformDateInMultiyearViewAccordingToFY() {
|
|
3752
|
+
const multuYearView = this._calendar.multiYearView;
|
|
3753
|
+
multuYearView._activeDate = this.datePickerService.subtractFiscalYearMonthsFromDate(multuYearView._activeDate);
|
|
3754
|
+
multuYearView._selectedYear = multuYearView._activeDate.year();
|
|
3755
|
+
multuYearView._init();
|
|
3756
|
+
}
|
|
3619
3757
|
}
|
|
3620
3758
|
DrDatePickerCustomHeaderComponent.decorators = [
|
|
3621
3759
|
{ type: Component, args: [{
|
|
3622
3760
|
selector: 'dr-date-picker_custom-header.component',
|
|
3623
|
-
template: "<div *ngIf=\"datePickerService.isTimeframeSelectionEnabled\" class=\"dr-datepicker__timeframe-select__wrapper\">\n <dr-select\n class=\"dr-datepicker__timeframe-select\"\n [(ngModel)]=\"selectedTimeframe\"\n [items]=\"timeframeOptions | drShowTimeframePipe: datePickerService.availableTimeframes\"\n bindLabel=\"title\"\n bindValue=\"value\"\n (ngModelChange)=\"setTimeframe()\">\n </dr-select>\n</div>\n\n<div class=\"dr-date-paging\">\n <div class=\"dr-date-paging flip-page-button\"\n (click)=\"pagingClicked(false)\">\n <i class=\"dr-icon-arrow-left presentation_buttons-navigate_input\"></i>\n </div>\n <span class=\"example-header-label\">\n <span (click)=\"switchViewOnClickOnPeriodLabel(calendarView.FOR_MONTHS)\">{{periodMonthLabel + ' '}}</span>\n <span (click)=\"switchViewOnClickOnPeriodLabel(calendarView.FOR_YEARS)\">{{periodYearLabel}}</span>\n </span>\n <div class=\"dr-date-paging flip-page-button\"\n (click)=\"pagingClicked(true)\">\n <i class=\"dr-icon-arrow-right presentation_buttons-navigate_input\"></i>\n </div>\n</div>\n<div #quarterlyDatePicker class=\"dr-quarterly-datepicker\" *ngIf=\"currentViewIsQuarter\">\n <div *ngFor=\"let quarter of quarters\"\n class=\"quarter-selector\" (click)=\"onSelectQuarter(quarter)\"\n [class]=\"quarter === selectedQuarter ? 'selected' : ''\"\n >Q{{quarter}}</div>\n</div>\n\n",
|
|
3761
|
+
template: "<div *ngIf=\"datePickerService.isTimeframeSelectionEnabled\" class=\"dr-datepicker__timeframe-select__wrapper\">\n <dr-select\n class=\"dr-datepicker__timeframe-select\"\n [(ngModel)]=\"selectedTimeframe\"\n [items]=\"timeframeOptions | drShowTimeframePipe: datePickerService.availableTimeframes\"\n bindLabel=\"title\"\n bindValue=\"value\"\n (ngModelChange)=\"setTimeframe()\">\n </dr-select>\n</div>\n\n<div class=\"dr-date-paging\">\n <div class=\"dr-date-paging flip-page-button\"\n (click)=\"pagingClicked(false)\">\n <i class=\"dr-icon-arrow-left presentation_buttons-navigate_input\"></i>\n </div>\n <span class=\"example-header-label\">\n <span (click)=\"switchViewOnClickOnPeriodLabel(calendarView.FOR_MONTHS)\">{{ periodMonthLabel + ' ' }}</span>\n <span (click)=\"switchViewOnClickOnPeriodLabel(calendarView.FOR_YEARS)\">{{ periodYearLabel }}</span>\n </span>\n <div class=\"dr-date-paging flip-page-button\"\n (click)=\"pagingClicked(true)\">\n <i class=\"dr-icon-arrow-right presentation_buttons-navigate_input\"></i>\n </div>\n</div>\n<div #quarterlyDatePicker class=\"dr-quarterly-datepicker\" *ngIf=\"currentViewIsQuarter\">\n <div *ngFor=\"let quarter of quarters\"\n class=\"quarter-selector\" (click)=\"onSelectQuarter(quarter)\"\n [class]=\"quarter === selectedQuarter ? 'selected' : ''\"\n >Q{{quarter}}</div>\n</div>\n\n",
|
|
3624
3762
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
3625
3763
|
styles: [":host{height:54px;align-items:center;font-family:\"Poppins\";font-style:normal;font-weight:600;font-size:14px;line-height:22px}.dr-datepicker__timeframe-select__wrapper{background-color:#f9faff;padding:16px 32px;border-radius:18px 18px 0 0}.dr-date-paging{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:16px 8px;grid-gap:4px;gap:4px}.dr-date-paging.flip-page-button{width:20px;height:20px;padding:0;color:#4e566c}.dr-date-paging.flip-page-button:hover{border-radius:50%;background:#f2f2fb;color:#4646ce}.example-header-label{cursor:pointer}.dr-quarterly-datepicker{display:flex;justify-content:space-between;padding:10px}.dr-quarterly-datepicker .quarter-selector{display:block;width:74px;height:40px;text-align:center;border-radius:40px;font-weight:400;padding-top:9px}.dr-quarterly-datepicker .quarter-selector:hover{background:#f2f2fb;color:#4646ce;font-weight:600;cursor:pointer}.dr-quarterly-datepicker .quarter-selector.selected{background-color:#4646ce;color:#f3f7ff;font-weight:600}\n"]
|
|
3626
3764
|
},] }
|
|
@@ -3636,7 +3774,7 @@ DrDatePickerCustomHeaderComponent.ctorParameters = () => [
|
|
|
3636
3774
|
const moment = require('moment');
|
|
3637
3775
|
const noop = () => {
|
|
3638
3776
|
};
|
|
3639
|
-
const ɵ0$
|
|
3777
|
+
const ɵ0$2 = noop;
|
|
3640
3778
|
class DrDatePickerComponent {
|
|
3641
3779
|
constructor(cdr, dateAdapter, datePickerService) {
|
|
3642
3780
|
this.cdr = cdr;
|
|
@@ -3645,6 +3783,7 @@ class DrDatePickerComponent {
|
|
|
3645
3783
|
// Whether to transform date, taking end, start, middle of preiod (i.e. set middle of month if timeframe='month')
|
|
3646
3784
|
this.periodPosition = DatePickerPeriodPosition.DEFAULT;
|
|
3647
3785
|
this.placeholder = 'Select';
|
|
3786
|
+
this.fiscalYearMonthsModifier = 0;
|
|
3648
3787
|
this.calendarViewsTimeframeMapping = {
|
|
3649
3788
|
year: 'multi-year',
|
|
3650
3789
|
month: 'year',
|
|
@@ -3681,6 +3820,7 @@ class DrDatePickerComponent {
|
|
|
3681
3820
|
this.cdr.markForCheck();
|
|
3682
3821
|
}
|
|
3683
3822
|
ngAfterViewInit() {
|
|
3823
|
+
this.datePickerService.fiscalYearMonthsModifier = this.fiscalYearMonthsModifier;
|
|
3684
3824
|
this.datePickerService.datePickerInstance = this.datePicker;
|
|
3685
3825
|
this.datePicker.startView = this.calendarViewsTimeframeMapping[this.datePickerService.timeframe];
|
|
3686
3826
|
}
|
|
@@ -3696,14 +3836,43 @@ class DrDatePickerComponent {
|
|
|
3696
3836
|
const timeframe = this.datePickerService.timeframe;
|
|
3697
3837
|
switch (this.periodPosition) {
|
|
3698
3838
|
case DatePickerPeriodPosition.START_OF_PERIOD:
|
|
3699
|
-
this.
|
|
3839
|
+
if (this.datePickerService.timeframe === TimeframeOption.QUARTER) {
|
|
3840
|
+
this.datePickerService.setStartOfCurrentQuarter(this.innerValue);
|
|
3841
|
+
}
|
|
3842
|
+
else if (this.datePickerService.timeframe === TimeframeOption.YEAR) {
|
|
3843
|
+
this.datePickerService.setStartOfQuarter(this.innerValue, 1);
|
|
3844
|
+
}
|
|
3845
|
+
else {
|
|
3846
|
+
this.innerValue.startOf(timeframe);
|
|
3847
|
+
}
|
|
3700
3848
|
break;
|
|
3701
3849
|
case DatePickerPeriodPosition.END_OF_PERIOD:
|
|
3702
|
-
this.
|
|
3850
|
+
if (this.datePickerService.timeframe === TimeframeOption.QUARTER) {
|
|
3851
|
+
this.datePickerService.setEndOfCurrentQuarter(this.innerValue);
|
|
3852
|
+
}
|
|
3853
|
+
else if (this.datePickerService.timeframe === TimeframeOption.YEAR) {
|
|
3854
|
+
this.datePickerService.setEndOfQuarter(this.innerValue, 4);
|
|
3855
|
+
}
|
|
3856
|
+
else {
|
|
3857
|
+
this.innerValue.endOf(timeframe);
|
|
3858
|
+
}
|
|
3703
3859
|
break;
|
|
3704
3860
|
case DatePickerPeriodPosition.MIDDLE_OF_PERIOD:
|
|
3705
|
-
|
|
3706
|
-
|
|
3861
|
+
let endOfPeriod;
|
|
3862
|
+
if (this.datePickerService.timeframe === TimeframeOption.QUARTER) {
|
|
3863
|
+
endOfPeriod = this.innerValue.clone();
|
|
3864
|
+
this.datePickerService.setStartOfCurrentQuarter(this.innerValue);
|
|
3865
|
+
this.datePickerService.setEndOfCurrentQuarter(endOfPeriod);
|
|
3866
|
+
}
|
|
3867
|
+
else if (this.datePickerService.timeframe === TimeframeOption.YEAR) {
|
|
3868
|
+
endOfPeriod = this.innerValue.clone();
|
|
3869
|
+
this.datePickerService.setStartOfQuarter(this.innerValue, 1);
|
|
3870
|
+
this.datePickerService.setEndOfQuarter(endOfPeriod, 4);
|
|
3871
|
+
}
|
|
3872
|
+
else {
|
|
3873
|
+
this.innerValue.startOf(timeframe);
|
|
3874
|
+
endOfPeriod = this.innerValue.clone().endOf(timeframe);
|
|
3875
|
+
}
|
|
3707
3876
|
const diff = endOfPeriod.diff(this.innerValue, 'seconds');
|
|
3708
3877
|
this.innerValue.add(diff / 2 + 1, 'seconds');
|
|
3709
3878
|
break;
|
|
@@ -3713,6 +3882,9 @@ class DrDatePickerComponent {
|
|
|
3713
3882
|
}
|
|
3714
3883
|
}
|
|
3715
3884
|
chosenPeriodHandler(chosenDate, timeframe) {
|
|
3885
|
+
if (timeframe === TimeframeOption.YEAR) {
|
|
3886
|
+
chosenDate = this.datePickerService.addFiscalYearMonthsToDate(chosenDate);
|
|
3887
|
+
}
|
|
3716
3888
|
if (this.datePickerService.timeframe === TimeframeOption.QUARTER && timeframe === TimeframeOption.YEAR) {
|
|
3717
3889
|
this.datePickerService.calendarInstance.currentView = CalendarView.FOR_QUARTERS;
|
|
3718
3890
|
this.datePickerService.calendarInstance.activeDate = chosenDate;
|
|
@@ -3780,6 +3952,7 @@ DrDatePickerComponent.propDecorators = {
|
|
|
3780
3952
|
max: [{ type: Input }],
|
|
3781
3953
|
periodPosition: [{ type: Input }],
|
|
3782
3954
|
placeholder: [{ type: Input }],
|
|
3955
|
+
fiscalYearMonthsModifier: [{ type: Input }],
|
|
3783
3956
|
datePicker: [{ type: ViewChild, args: ['datePicker',] }]
|
|
3784
3957
|
};
|
|
3785
3958
|
|
|
@@ -3824,8 +3997,12 @@ class DrDatePickerWithTimeframeComponent extends DrDatePickerComponent {
|
|
|
3824
3997
|
if (!this.value) {
|
|
3825
3998
|
return this.placeholder;
|
|
3826
3999
|
}
|
|
4000
|
+
let displayValue = _.cloneDeep(this.value);
|
|
4001
|
+
if (this.datePickerService.isTimeframeDependingOnFY(this.datePickerService.timeframe)) {
|
|
4002
|
+
displayValue = this.datePickerService.subtractFiscalYearMonthsFromDate(displayValue);
|
|
4003
|
+
}
|
|
3827
4004
|
const formatCached = this.datePickerService.format$.getValue();
|
|
3828
|
-
return this.datePickerService.getDisplayPrefix() +
|
|
4005
|
+
return this.datePickerService.getDisplayPrefix() + displayValue.format(formatCached);
|
|
3829
4006
|
}
|
|
3830
4007
|
ngOnInit() {
|
|
3831
4008
|
this.datePickerService.isTimeframeSelectionEnabled = this.canSelectTimeframe;
|
|
@@ -4290,7 +4467,7 @@ DrStepperModule.decorators = [
|
|
|
4290
4467
|
},] }
|
|
4291
4468
|
];
|
|
4292
4469
|
|
|
4293
|
-
const ɵ0 = {}, ɵ1 = {};
|
|
4470
|
+
const ɵ0$1 = {}, ɵ1 = {};
|
|
4294
4471
|
class DrDialogModule {
|
|
4295
4472
|
}
|
|
4296
4473
|
DrDialogModule.decorators = [
|
|
@@ -4305,18 +4482,433 @@ DrDialogModule.decorators = [
|
|
|
4305
4482
|
],
|
|
4306
4483
|
exports: [DialogWrapperComponent, DialogModalWrapperComponent],
|
|
4307
4484
|
providers: [
|
|
4308
|
-
{ provide: MatDialogRef, useValue: ɵ0 },
|
|
4485
|
+
{ provide: MatDialogRef, useValue: ɵ0$1 },
|
|
4309
4486
|
{ provide: MAT_DIALOG_DATA, useValue: ɵ1 },
|
|
4310
4487
|
DialogService
|
|
4311
4488
|
]
|
|
4312
4489
|
},] }
|
|
4313
4490
|
];
|
|
4314
4491
|
|
|
4492
|
+
class DrChatFormComponent {
|
|
4493
|
+
constructor(cdr, domSanitizer) {
|
|
4494
|
+
this.cdr = cdr;
|
|
4495
|
+
this.domSanitizer = domSanitizer;
|
|
4496
|
+
this.inputFocus = false;
|
|
4497
|
+
this.inputHover = false;
|
|
4498
|
+
this.droppedFiles = [];
|
|
4499
|
+
/**
|
|
4500
|
+
* Predefined message text
|
|
4501
|
+
*
|
|
4502
|
+
* @type {string}
|
|
4503
|
+
*/
|
|
4504
|
+
this.message = '';
|
|
4505
|
+
/**
|
|
4506
|
+
* Message placeholder text
|
|
4507
|
+
*
|
|
4508
|
+
* @type {string}
|
|
4509
|
+
*/
|
|
4510
|
+
this.messagePlaceholder = 'Type a message';
|
|
4511
|
+
/**
|
|
4512
|
+
* Show send button
|
|
4513
|
+
*
|
|
4514
|
+
* @type {boolean}
|
|
4515
|
+
*/
|
|
4516
|
+
this.dropFiles = false;
|
|
4517
|
+
/**
|
|
4518
|
+
* File drop placeholder text
|
|
4519
|
+
*
|
|
4520
|
+
* @type {string}
|
|
4521
|
+
*/
|
|
4522
|
+
this.dropFilePlaceholder = 'Drop file to send';
|
|
4523
|
+
/**
|
|
4524
|
+
*
|
|
4525
|
+
* @type {EventEmitter<{ message: string, files: File[] }>}
|
|
4526
|
+
*/
|
|
4527
|
+
this.send = new EventEmitter();
|
|
4528
|
+
/**
|
|
4529
|
+
* Emits when message input value has been changed
|
|
4530
|
+
*
|
|
4531
|
+
* @type {EventEmitter<string>}
|
|
4532
|
+
*/
|
|
4533
|
+
this.inputChange = new EventEmitter();
|
|
4534
|
+
this.fileOver = false;
|
|
4535
|
+
}
|
|
4536
|
+
onDrop(event) {
|
|
4537
|
+
var _a;
|
|
4538
|
+
if (this.dropFiles) {
|
|
4539
|
+
event.preventDefault();
|
|
4540
|
+
event.stopPropagation();
|
|
4541
|
+
this.fileOver = false;
|
|
4542
|
+
if ((_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) {
|
|
4543
|
+
for (const file of event.dataTransfer.files) {
|
|
4544
|
+
const res = file;
|
|
4545
|
+
if (IMAGE_TYPES.includes(file.type)) {
|
|
4546
|
+
const fr = new FileReader();
|
|
4547
|
+
fr.onload = (e) => {
|
|
4548
|
+
res.src = e.target.result;
|
|
4549
|
+
res.urlStyle = this.domSanitizer.bypassSecurityTrustStyle(`url(${res.src})`);
|
|
4550
|
+
this.cdr.detectChanges();
|
|
4551
|
+
};
|
|
4552
|
+
fr.readAsDataURL(file);
|
|
4553
|
+
}
|
|
4554
|
+
this.droppedFiles.push(res);
|
|
4555
|
+
}
|
|
4556
|
+
}
|
|
4557
|
+
}
|
|
4558
|
+
}
|
|
4559
|
+
removeFile(file) {
|
|
4560
|
+
const index = this.droppedFiles.indexOf(file);
|
|
4561
|
+
if (index >= 0) {
|
|
4562
|
+
this.droppedFiles.splice(index, 1);
|
|
4563
|
+
}
|
|
4564
|
+
}
|
|
4565
|
+
onDragOver(event) {
|
|
4566
|
+
event.preventDefault();
|
|
4567
|
+
event.stopPropagation();
|
|
4568
|
+
if (this.dropFiles) {
|
|
4569
|
+
this.fileOver = true;
|
|
4570
|
+
}
|
|
4571
|
+
}
|
|
4572
|
+
onDragLeave(event) {
|
|
4573
|
+
event.preventDefault();
|
|
4574
|
+
event.stopPropagation();
|
|
4575
|
+
if (this.dropFiles) {
|
|
4576
|
+
this.fileOver = false;
|
|
4577
|
+
}
|
|
4578
|
+
}
|
|
4579
|
+
sendMessage() {
|
|
4580
|
+
if (this.droppedFiles.length || String(this.message).trim().length) {
|
|
4581
|
+
this.send.emit({ message: this.message, files: this.droppedFiles });
|
|
4582
|
+
this.message = '';
|
|
4583
|
+
this.droppedFiles = [];
|
|
4584
|
+
this.cdr.markForCheck();
|
|
4585
|
+
}
|
|
4586
|
+
}
|
|
4587
|
+
onModelChange(value) {
|
|
4588
|
+
this.inputChange.emit(value);
|
|
4589
|
+
}
|
|
4590
|
+
}
|
|
4591
|
+
DrChatFormComponent.decorators = [
|
|
4592
|
+
{ type: Component, args: [{
|
|
4593
|
+
selector: 'dr-chat-form',
|
|
4594
|
+
template: "<div class=\"dropped-files\" *ngIf=\"droppedFiles?.length\">\n <div class=\"dropped-files__item\" *ngFor=\"let file of droppedFiles\">\n <div class=\"dropped-files__item__preview\" [style.background-image]=\"file.urlStyle || 'none'\">\n <i class=\"dr-icon-file\" *ngIf=\"!file.urlStyle\"></i>\n </div>\n <div class=\"dropped-files__item__name\">{{ file.name }}</div>\n <i class=\"dropped-files__item__remove dr-icon-exit\" (click)=\"removeFile(file)\"></i>\n </div>\n</div>\n<div class=\"message-row\">\n <dr-input (focus)=\"inputFocus = true\"\n (blur)=\"inputFocus = false\"\n (mouseenter)=\"inputHover = true\"\n (mouseleave)=\"inputHover = false\"\n [(ngModel)]=\"message\"\n (ngModelChange)=\"onModelChange($event)\"\n type=\"text\"\n placeholder=\"{{ fileOver ? dropFilePlaceholder : messagePlaceholder }}\"\n (keyup.enter)=\"sendMessage()\">\n </dr-input>\n <dr-button (click)=\"sendMessage()\"\n theme=\"icon\"\n icon=\"dr-icon-notify\"\n class=\"send-button\">\n </dr-button>\n</div>\n",
|
|
4595
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4596
|
+
styles: [":host{display:flex;flex-direction:column;padding:16px;border-top:1px solid #ccc}:host .message-row{flex-direction:row;display:flex;align-items:center}:host input{flex:1}:host input.with-button{border-bottom-right-radius:0;border-top-right-radius:0}:host .send-button{margin-left:10px}:host .dropped-files{display:flex;flex-direction:row;margin-bottom:.5rem;flex-wrap:wrap}:host .dropped-files__item{display:flex;flex-direction:column;justify-content:center;margin:0 10px 10px 0;position:relative}:host .dropped-files__item__preview{background-size:cover;background-position:center;width:64px;height:64px;border-radius:8px;border:1px solid #ccc}:host .dropped-files__item__preview i{font-size:62px}:host .dropped-files__item__name{white-space:nowrap;font-size:12px;color:#8f929e;margin-top:4px;max-width:64px;overflow:hidden;text-overflow:ellipsis}:host .dropped-files__item__remove{position:absolute;right:-4px;top:-4px;cursor:pointer;background:white;border-radius:12px;color:#8f929e;border:1px solid #8f929e;font-size:14px}\n"]
|
|
4597
|
+
},] }
|
|
4598
|
+
];
|
|
4599
|
+
DrChatFormComponent.ctorParameters = () => [
|
|
4600
|
+
{ type: ChangeDetectorRef },
|
|
4601
|
+
{ type: DomSanitizer }
|
|
4602
|
+
];
|
|
4603
|
+
DrChatFormComponent.propDecorators = {
|
|
4604
|
+
message: [{ type: Input }],
|
|
4605
|
+
messagePlaceholder: [{ type: Input }],
|
|
4606
|
+
dropFiles: [{ type: Input }],
|
|
4607
|
+
dropFilePlaceholder: [{ type: Input }],
|
|
4608
|
+
send: [{ type: Output }],
|
|
4609
|
+
inputChange: [{ type: Output }],
|
|
4610
|
+
fileOver: [{ type: HostBinding, args: ['class.file-over',] }],
|
|
4611
|
+
onDrop: [{ type: HostListener, args: ['drop', ['$event'],] }],
|
|
4612
|
+
onDragOver: [{ type: HostListener, args: ['dragover', ['$event'],] }],
|
|
4613
|
+
onDragLeave: [{ type: HostListener, args: ['dragleave', ['$event'],] }]
|
|
4614
|
+
};
|
|
4615
|
+
|
|
4616
|
+
/**
|
|
4617
|
+
* `DrCustomMessageService` is used to store instances of `DrChatCustomMessageDirective`s which
|
|
4618
|
+
* were provided in the chat component.
|
|
4619
|
+
*/
|
|
4620
|
+
class DrChatCustomMessageService {
|
|
4621
|
+
constructor() {
|
|
4622
|
+
this.customMessages = new Map();
|
|
4623
|
+
}
|
|
4624
|
+
register(type, instance) {
|
|
4625
|
+
this.customMessages.set(type, instance);
|
|
4626
|
+
}
|
|
4627
|
+
unregister(type) {
|
|
4628
|
+
return this.customMessages.delete(type);
|
|
4629
|
+
}
|
|
4630
|
+
getInstance(type) {
|
|
4631
|
+
return this.customMessages.get(type);
|
|
4632
|
+
}
|
|
4633
|
+
}
|
|
4634
|
+
DrChatCustomMessageService.decorators = [
|
|
4635
|
+
{ type: Injectable }
|
|
4636
|
+
];
|
|
4637
|
+
|
|
4638
|
+
class DrChatMessageComponent {
|
|
4639
|
+
constructor(customMessageService) {
|
|
4640
|
+
this.customMessageService = customMessageService;
|
|
4641
|
+
this.MESSAGE_TYPE = CHAT_MESSAGE_TYPE;
|
|
4642
|
+
this.MESSAGE_TYPE_CUSTOM = CHAT_MESSAGE_TYPE.EMBED;
|
|
4643
|
+
this._reply = false;
|
|
4644
|
+
}
|
|
4645
|
+
get flyInOut() {
|
|
4646
|
+
return true;
|
|
4647
|
+
}
|
|
4648
|
+
get notReply() {
|
|
4649
|
+
return !this.reply;
|
|
4650
|
+
}
|
|
4651
|
+
/**
|
|
4652
|
+
* Determines if a message is a reply
|
|
4653
|
+
*/
|
|
4654
|
+
get reply() {
|
|
4655
|
+
return this._reply;
|
|
4656
|
+
}
|
|
4657
|
+
set reply(value) {
|
|
4658
|
+
this._reply = !!value;
|
|
4659
|
+
}
|
|
4660
|
+
getTemplate() {
|
|
4661
|
+
this.customMessage = true;
|
|
4662
|
+
const customMessage = this.getCustomMessage(this.type);
|
|
4663
|
+
return customMessage.templateRef;
|
|
4664
|
+
}
|
|
4665
|
+
getTemplateContext() {
|
|
4666
|
+
return { $implicit: this.customMessageData, isReply: this.reply };
|
|
4667
|
+
}
|
|
4668
|
+
getCustomMessage(type) {
|
|
4669
|
+
const customMessageDirective = this.customMessageService.getInstance(type);
|
|
4670
|
+
if (!customMessageDirective) {
|
|
4671
|
+
throw new Error(`dr-chat: Can't find template for custom type '${type}'. ` +
|
|
4672
|
+
`Make sure you provide it in the chat component with *drCustomMessage='${type}'.`);
|
|
4673
|
+
}
|
|
4674
|
+
return customMessageDirective;
|
|
4675
|
+
}
|
|
4676
|
+
}
|
|
4677
|
+
DrChatMessageComponent.decorators = [
|
|
4678
|
+
{ type: Component, args: [{
|
|
4679
|
+
selector: 'dr-chat-message',
|
|
4680
|
+
template: "<div class=\"message\" [class.message--custom]=\"customMessage\">\n <ng-container [ngSwitch]=\"message.kind\">\n <dr-chat-message-text *ngSwitchCase=\"MESSAGE_TYPE.TEXT\" [message]=\"message\"></dr-chat-message-text>\n <dr-chat-message-rich-text *ngSwitchCase=\"MESSAGE_TYPE.RICH_TEXT\" [message]=\"message\"></dr-chat-message-rich-text>\n <dr-chat-message-file *ngSwitchCase=\"MESSAGE_TYPE.DOWNLOAD_FILE\" [message]=\"message\"></dr-chat-message-file>\n <ng-container *ngSwitchDefault>\n <ng-container [ngTemplateOutlet]=\"getTemplate()\" [ngTemplateOutletContext]=\"getTemplateContext()\"></ng-container>\n </ng-container>\n </ng-container>\n</div>\n",
|
|
4681
|
+
animations: [
|
|
4682
|
+
trigger('flyInOut', [
|
|
4683
|
+
state('in', style({ transform: 'translateX(0)' })),
|
|
4684
|
+
transition('void => *', [style({ transform: 'translateX(-100%)' }), animate(80)]),
|
|
4685
|
+
transition('* => void', [animate(80, style({ transform: 'translateX(100%)' }))]),
|
|
4686
|
+
]),
|
|
4687
|
+
],
|
|
4688
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4689
|
+
styles: [":host{display:flex;flex-direction:row}:host:not(:first-child){margin-top:8px}.reply+:host.reply,.not-reply+:host.not-reply{margin-top:3px}:host.not-reply{justify-content:flex-end}:host.not-reply .message{color:#fff;background-color:#4646ce}:host .message{display:flex;background-color:#f3f7ff;border-radius:8px;padding:16px;max-width:60%;width:auto}:host .message--custom{max-width:unset;width:80%}\n"]
|
|
4690
|
+
},] }
|
|
4691
|
+
];
|
|
4692
|
+
DrChatMessageComponent.ctorParameters = () => [
|
|
4693
|
+
{ type: DrChatCustomMessageService }
|
|
4694
|
+
];
|
|
4695
|
+
DrChatMessageComponent.propDecorators = {
|
|
4696
|
+
flyInOut: [{ type: HostBinding, args: ['@flyInOut',] }],
|
|
4697
|
+
notReply: [{ type: HostBinding, args: ['class.not-reply',] }],
|
|
4698
|
+
reply: [{ type: Input }, { type: HostBinding, args: ['class.reply',] }],
|
|
4699
|
+
type: [{ type: Input }],
|
|
4700
|
+
message: [{ type: Input }],
|
|
4701
|
+
customMessageData: [{ type: Input }]
|
|
4702
|
+
};
|
|
4703
|
+
|
|
4704
|
+
class DrChatComponent {
|
|
4705
|
+
constructor(cdr) {
|
|
4706
|
+
this.cdr = cdr;
|
|
4707
|
+
this.noMessagesPlaceholder = 'No messages yet.';
|
|
4708
|
+
this._scrollBottom = true;
|
|
4709
|
+
}
|
|
4710
|
+
/**
|
|
4711
|
+
* Scroll chat to the bottom of the list when a new message arrives
|
|
4712
|
+
*/
|
|
4713
|
+
get scrollBottom() {
|
|
4714
|
+
return this._scrollBottom;
|
|
4715
|
+
}
|
|
4716
|
+
set scrollBottom(value) {
|
|
4717
|
+
this._scrollBottom = !!value;
|
|
4718
|
+
}
|
|
4719
|
+
ngAfterViewInit() {
|
|
4720
|
+
this.messages.changes.subscribe(messages => {
|
|
4721
|
+
this.messages = messages;
|
|
4722
|
+
this.updateView();
|
|
4723
|
+
});
|
|
4724
|
+
this.updateView();
|
|
4725
|
+
}
|
|
4726
|
+
updateView() {
|
|
4727
|
+
if (this.scrollBottom) {
|
|
4728
|
+
this.scrollListBottom();
|
|
4729
|
+
}
|
|
4730
|
+
}
|
|
4731
|
+
scrollListBottom() {
|
|
4732
|
+
setTimeout(() => {
|
|
4733
|
+
this.messagesContainer.nativeElement.scrollTo({ top: this.messagesContainer.nativeElement.scrollHeight, behavior: 'smooth' });
|
|
4734
|
+
this.cdr.markForCheck();
|
|
4735
|
+
});
|
|
4736
|
+
}
|
|
4737
|
+
}
|
|
4738
|
+
DrChatComponent.decorators = [
|
|
4739
|
+
{ type: Component, args: [{
|
|
4740
|
+
selector: 'dr-chat',
|
|
4741
|
+
template: "<div class=\"header\">\n {{ title }}\n</div>\n\n<div class=\"scrollable\">\n <div class=\"messages\" #messagesContainer>\n <ng-content select=\"dr-chat-message\"></ng-content>\n <p class=\"no-messages\" *ngIf=\"!messages?.length\">{{ noMessagesPlaceholder }}</p>\n </div>\n</div>\n\n<div class=\"form\">\n <ng-content select=\"dr-chat-form\"></ng-content>\n</div>\n",
|
|
4742
|
+
providers: [DrChatCustomMessageService],
|
|
4743
|
+
styles: [":host{display:flex;flex-grow:1;flex-direction:column;position:relative;height:100%;background-color:#fff;border:1px solid #e5e6ea;border-radius:8px;box-shadow:0 4px 8px 1px #00000040;color:#151b3f;font-family:\"Poppins\",sans-serif;font-size:14px;font-weight:400;line-height:22px}:host .header{border-bottom:1px solid #e5e6ea;padding:16px 32px;font-weight:bold}:host .scrollable{display:flex;flex-grow:1;overflow-x:hidden;overflow-y:auto;height:100%;width:100%}:host .scrollable .messages{padding:16px;overflow-y:auto;overflow-x:hidden;display:flex;flex-shrink:0;flex-direction:column;width:100%}:host .scrollable .no-messages{text-align:center}\n"]
|
|
4744
|
+
},] }
|
|
4745
|
+
];
|
|
4746
|
+
DrChatComponent.ctorParameters = () => [
|
|
4747
|
+
{ type: ChangeDetectorRef }
|
|
4748
|
+
];
|
|
4749
|
+
DrChatComponent.propDecorators = {
|
|
4750
|
+
title: [{ type: Input }],
|
|
4751
|
+
noMessagesPlaceholder: [{ type: Input }],
|
|
4752
|
+
scrollBottom: [{ type: Input }],
|
|
4753
|
+
messagesContainer: [{ type: ViewChild, args: ['messagesContainer',] }],
|
|
4754
|
+
messages: [{ type: ContentChildren, args: [DrChatMessageComponent,] }],
|
|
4755
|
+
chatForm: [{ type: ContentChild, args: [DrChatFormComponent,] }]
|
|
4756
|
+
};
|
|
4757
|
+
|
|
4758
|
+
/**
|
|
4759
|
+
* Chat text message component.
|
|
4760
|
+
*/
|
|
4761
|
+
class DrChatMessageTextComponent {
|
|
4762
|
+
}
|
|
4763
|
+
DrChatMessageTextComponent.decorators = [
|
|
4764
|
+
{ type: Component, args: [{
|
|
4765
|
+
selector: 'dr-chat-message-text',
|
|
4766
|
+
template: "<div class=\"text\" *ngIf=\"message\">{{ message.text }}</div>\n",
|
|
4767
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4768
|
+
styles: [":host{display:flex}:host .text{display:flex;word-break:break-word}\n"]
|
|
4769
|
+
},] }
|
|
4770
|
+
];
|
|
4771
|
+
DrChatMessageTextComponent.propDecorators = {
|
|
4772
|
+
message: [{ type: Input }]
|
|
4773
|
+
};
|
|
4774
|
+
|
|
4775
|
+
/**
|
|
4776
|
+
* Chat rich-text message component.
|
|
4777
|
+
*/
|
|
4778
|
+
class DrChatMessageRichTextComponent {
|
|
4779
|
+
}
|
|
4780
|
+
DrChatMessageRichTextComponent.decorators = [
|
|
4781
|
+
{ type: Component, args: [{
|
|
4782
|
+
selector: 'dr-chat-message-rich-text',
|
|
4783
|
+
template: "<div class=\"paragraphs\">\n <div *ngFor=\"let paragraph of message.paragraphs\"\n class=\"paragraphs__item\"\n [class]=\"paragraph.kind\"\n [innerText]=\"paragraph.value\">\n </div>\n</div>\n",
|
|
4784
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4785
|
+
styles: [".paragraphs{display:flex;flex-direction:column}.paragraphs__item:not(:first-child){margin-top:8px}.paragraphs__item.code{display:flex;padding:4px;border:1px solid #8f929e;background:#ccc}\n"]
|
|
4786
|
+
},] }
|
|
4787
|
+
];
|
|
4788
|
+
DrChatMessageRichTextComponent.propDecorators = {
|
|
4789
|
+
message: [{ type: Input }]
|
|
4790
|
+
};
|
|
4791
|
+
|
|
4792
|
+
/**
|
|
4793
|
+
* Chat message component.
|
|
4794
|
+
*/
|
|
4795
|
+
class DrChatMessageFileComponent {
|
|
4796
|
+
constructor(cd, domSanitizer) {
|
|
4797
|
+
this.cd = cd;
|
|
4798
|
+
this.domSanitizer = domSanitizer;
|
|
4799
|
+
}
|
|
4800
|
+
/**
|
|
4801
|
+
* Message file path
|
|
4802
|
+
*
|
|
4803
|
+
* @type {Date}
|
|
4804
|
+
*/
|
|
4805
|
+
set files(files) {
|
|
4806
|
+
this.readyFiles = (files || []).map((file) => {
|
|
4807
|
+
const isImage = this.isImage(file);
|
|
4808
|
+
return Object.assign(Object.assign({}, file), { urlStyle: isImage && this.domSanitizer.bypassSecurityTrustStyle(`url(${file.url})`), isImage });
|
|
4809
|
+
});
|
|
4810
|
+
this.cd.detectChanges();
|
|
4811
|
+
}
|
|
4812
|
+
isImage(file) {
|
|
4813
|
+
const type = file.type;
|
|
4814
|
+
if (type) {
|
|
4815
|
+
return IMAGE_TYPES.includes(type);
|
|
4816
|
+
}
|
|
4817
|
+
return false;
|
|
4818
|
+
}
|
|
4819
|
+
}
|
|
4820
|
+
DrChatMessageFileComponent.decorators = [
|
|
4821
|
+
{ type: Component, args: [{
|
|
4822
|
+
selector: 'dr-chat-message-file',
|
|
4823
|
+
template: "<div class=\"message-content-group\">\n <a *ngFor=\"let file of readyFiles\" [href]=\"file.url\" target=\"_blank\">\n <i class=\"dr-icon-file\" *ngIf=\"!file.urlStyle && file.icon\"></i>\n <div *ngIf=\"file.urlStyle\" [style.background-image]=\"file.urlStyle\"></div>\n </a>\n</div>\n",
|
|
4824
|
+
changeDetection: ChangeDetectionStrategy.OnPush
|
|
4825
|
+
},] }
|
|
4826
|
+
];
|
|
4827
|
+
DrChatMessageFileComponent.ctorParameters = () => [
|
|
4828
|
+
{ type: ChangeDetectorRef },
|
|
4829
|
+
{ type: DomSanitizer }
|
|
4830
|
+
];
|
|
4831
|
+
DrChatMessageFileComponent.propDecorators = {
|
|
4832
|
+
message: [{ type: Input }],
|
|
4833
|
+
files: [{ type: Input }]
|
|
4834
|
+
};
|
|
4835
|
+
|
|
4836
|
+
const throwCustomMessageTypeIsRequired = () => {
|
|
4837
|
+
throw new Error('[drCustomMessage]: custom message type is required.');
|
|
4838
|
+
};
|
|
4839
|
+
const ɵ0 = throwCustomMessageTypeIsRequired;
|
|
4840
|
+
class DrChatCustomMessageDirective {
|
|
4841
|
+
constructor(templateRef, customMessageService) {
|
|
4842
|
+
this.templateRef = templateRef;
|
|
4843
|
+
this.customMessageService = customMessageService;
|
|
4844
|
+
}
|
|
4845
|
+
/**
|
|
4846
|
+
* Defines a message type which should rendered with the custom message template.
|
|
4847
|
+
*
|
|
4848
|
+
* @type {string}
|
|
4849
|
+
*/
|
|
4850
|
+
get drCustomMessage() {
|
|
4851
|
+
return this._type;
|
|
4852
|
+
}
|
|
4853
|
+
set drCustomMessage(value) {
|
|
4854
|
+
this._type = value;
|
|
4855
|
+
}
|
|
4856
|
+
get type() {
|
|
4857
|
+
return this._type;
|
|
4858
|
+
}
|
|
4859
|
+
ngOnInit() {
|
|
4860
|
+
if (!this._type) {
|
|
4861
|
+
throwCustomMessageTypeIsRequired();
|
|
4862
|
+
}
|
|
4863
|
+
this.customMessageService.register(this.type, this);
|
|
4864
|
+
}
|
|
4865
|
+
ngOnDestroy() {
|
|
4866
|
+
this.customMessageService.unregister(this.type);
|
|
4867
|
+
}
|
|
4868
|
+
}
|
|
4869
|
+
DrChatCustomMessageDirective.decorators = [
|
|
4870
|
+
{ type: Directive, args: [{
|
|
4871
|
+
selector: `[drCustomMessage]`,
|
|
4872
|
+
},] }
|
|
4873
|
+
];
|
|
4874
|
+
DrChatCustomMessageDirective.ctorParameters = () => [
|
|
4875
|
+
{ type: TemplateRef },
|
|
4876
|
+
{ type: DrChatCustomMessageService }
|
|
4877
|
+
];
|
|
4878
|
+
DrChatCustomMessageDirective.propDecorators = {
|
|
4879
|
+
drCustomMessage: [{ type: Input }]
|
|
4880
|
+
};
|
|
4881
|
+
|
|
4882
|
+
const DR_CHAT_COMPONENTS = [
|
|
4883
|
+
DrChatComponent,
|
|
4884
|
+
DrChatMessageComponent,
|
|
4885
|
+
DrChatFormComponent,
|
|
4886
|
+
DrChatMessageTextComponent,
|
|
4887
|
+
DrChatMessageFileComponent,
|
|
4888
|
+
DrChatMessageRichTextComponent,
|
|
4889
|
+
];
|
|
4890
|
+
const DR_CHAT_DIRECTIVES = [DrChatCustomMessageDirective];
|
|
4891
|
+
class DrChatModule {
|
|
4892
|
+
}
|
|
4893
|
+
DrChatModule.decorators = [
|
|
4894
|
+
{ type: NgModule, args: [{
|
|
4895
|
+
imports: [
|
|
4896
|
+
FormsModule,
|
|
4897
|
+
ReactiveFormsModule,
|
|
4898
|
+
CommonModule,
|
|
4899
|
+
DrAvatarModule,
|
|
4900
|
+
DrInputsModule
|
|
4901
|
+
],
|
|
4902
|
+
declarations: [...DR_CHAT_COMPONENTS, ...DR_CHAT_DIRECTIVES],
|
|
4903
|
+
exports: [...DR_CHAT_COMPONENTS, ...DR_CHAT_DIRECTIVES],
|
|
4904
|
+
},] }
|
|
4905
|
+
];
|
|
4906
|
+
|
|
4315
4907
|
/* components */
|
|
4316
4908
|
|
|
4317
4909
|
/**
|
|
4318
4910
|
* Generated bundle index. Do not edit.
|
|
4319
4911
|
*/
|
|
4320
4912
|
|
|
4321
|
-
export { AnyTagComponent, CalendarView, CheckboxComponent, CustomDateFormat, DIALOG_BUTTON_LABEL, DIALOG_FIELD_TYPE, DIALOG_SIZE, DateFromats, DatePickerPeriodPosition, DateTagComponent, DateTagModule, DayTagComponent, DialogService, DrAccordionComponent, DrAccordionItemBodyComponent, DrAccordionItemComponent, DrAccordionItemHeaderComponent, DrAccordionModule, DrAvatarComponent, DrAvatarModule, DrAvatarPipe, DrButtonComponent, DrDialogModule, DrDropdownComponent, DrDropdownDirective, DrDropdownItemShowPipe, DrDropdownModule, DrDropdownPositionDirective, DrDropdownService, DrErrorComponent, DrErrorModule, DrInputComponent, DrInputsModule, DrLayoutBodyComponent, DrLayoutComponent, DrLayoutHeaderComponent, DrLayoutModule, DrModelDebounceChangeDirective, DrPopoverAlignmentDimension, DrPopoverComponent, DrPopoverDirective, DrPopoverModule, DrPopoverRef, DrPopoverService, DrSelectComponent, DrSharedUtils, DrSpinnerComponent, DrSpinnerDirective, DrSpinnerModule, DrStepperModule, DrTabComponent, DrTabsComponent, DrTabsModule, DrTagComponent, DrTagModule, DrToggleButtonComponent, DrToggleComponent, DrTooltipDirective, DrTooltipModule, ForecastTagComponent, ListTagComponent, ListTagModule, MonthTagComponent, QuarterTagComponent, RadioButtonComponent, RadioGroupComponent, SpinnerSize, SpinnerType, TimeframeOption, TooltipComponent, TooltipPosition, WeekTagComponent, YearTagComponent, components$3 as ɵa, POPUP_ANIMATION as ɵb, DrDatePickerComponent as ɵc, DrDatePickerService as ɵd, DrDatePickerWithTimeframeComponent as ɵe, DrDatePickerFormatDirective as ɵf, DrDatePickerCustomHeaderComponent as ɵg, DrShowTimeframePipe as ɵh, TooltipInfoComponent as ɵi, TooltipInfoSimpleComponent as ɵj, TooltipNoBodyComponent as ɵk, TooltipProcessDefaultComponent as ɵl, StepperComponent as ɵm, DialogWrapperComponent as ɵn, DialogModalWrapperComponent as ɵo };
|
|
4913
|
+
export { AnyTagComponent, CHAT_MESSAGE_TYPE, CalendarView, ChatMessage, CheckboxComponent, CustomDateFormat, DIALOG_BUTTON_LABEL, DIALOG_FIELD_TYPE, DIALOG_SIZE, DateFromats, DatePickerPeriodPosition, DateTagComponent, DateTagModule, DayTagComponent, DialogService, DrAccordionComponent, DrAccordionItemBodyComponent, DrAccordionItemComponent, DrAccordionItemHeaderComponent, DrAccordionModule, DrAvatarComponent, DrAvatarModule, DrAvatarPipe, DrButtonComponent, DrChatModule, DrDialogModule, DrDropdownComponent, DrDropdownDirective, DrDropdownItemShowPipe, DrDropdownModule, DrDropdownPositionDirective, DrDropdownService, DrErrorComponent, DrErrorModule, DrInputComponent, DrInputsModule, DrLayoutBodyComponent, DrLayoutComponent, DrLayoutHeaderComponent, DrLayoutModule, DrModelDebounceChangeDirective, DrPopoverAlignmentDimension, DrPopoverComponent, DrPopoverDirective, DrPopoverModule, DrPopoverRef, DrPopoverService, DrSelectComponent, DrSharedUtils, DrSpinnerComponent, DrSpinnerDirective, DrSpinnerModule, DrStepperModule, DrTabComponent, DrTabsComponent, DrTabsModule, DrTagComponent, DrTagModule, DrToggleButtonComponent, DrToggleComponent, DrTooltipDirective, DrTooltipModule, ForecastTagComponent, IMAGE_TYPES, ListTagComponent, ListTagModule, MonthTagComponent, QuarterTagComponent, RadioButtonComponent, RadioGroupComponent, SpinnerSize, SpinnerType, TimeframeOption, TooltipComponent, TooltipPosition, WeekTagComponent, YearTagComponent, components$3 as ɵa, POPUP_ANIMATION as ɵb, DrDatePickerComponent as ɵc, DrDatePickerService as ɵd, DrDatePickerWithTimeframeComponent as ɵe, DrDatePickerFormatDirective as ɵf, DrDatePickerCustomHeaderComponent as ɵg, DrShowTimeframePipe as ɵh, TooltipInfoComponent as ɵi, TooltipInfoSimpleComponent as ɵj, TooltipNoBodyComponent as ɵk, TooltipProcessDefaultComponent as ɵl, StepperComponent as ɵm, DialogWrapperComponent as ɵn, DialogModalWrapperComponent as ɵo, DrChatComponent as ɵp, DrChatCustomMessageService as ɵq, DrChatMessageComponent as ɵr, DrChatFormComponent as ɵs, DrChatMessageTextComponent as ɵt, DrChatMessageFileComponent as ɵu, DrChatMessageRichTextComponent as ɵv, DrChatCustomMessageDirective as ɵw };
|
|
4322
4914
|
//# sourceMappingURL=datarailsshared-datarailsshared.js.map
|