@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms'), require('@angular/material/core'), require('@angular/material-moment-adapter'), require('moment'), require('@angular/common'), require('rxjs'), require('rxjs/operators'), require('@angular/animations'), require('@angular/cdk/overlay'), require('@angular/cdk/portal'), require('@angular/material/dialog'), require('lodash'), require('@angular/material/datepicker'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/material/select'), require('@angular/material/button-toggle'), require('@ng-select/ng-select'), require('@angular/material/tooltip'), require('@angular/material/tabs')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@datarailsshared/datarailsshared', ['exports', '@angular/core', '@angular/forms', '@angular/material/core', '@angular/material-moment-adapter', 'moment', '@angular/common', 'rxjs', 'rxjs/operators', '@angular/animations', '@angular/cdk/overlay', '@angular/cdk/portal', '@angular/material/dialog', 'lodash', '@angular/material/datepicker', '@angular/material/form-field', '@angular/material/input', '@angular/material/select', '@angular/material/button-toggle', '@ng-select/ng-select', '@angular/material/tooltip', '@angular/material/tabs'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.datarailsshared = global.datarailsshared || {}, global.datarailsshared.datarailsshared = {}), global.ng.core, global.ng.forms, global.ng.material.core, global.ng.materialMomentAdapter, global.momentImported, global.ng.common, global.rxjs, global.rxjs.operators, global.ng.animations, global.ng.cdk.overlay, global.ng.cdk.portal, global.ng.material.dialog, global._, global.ng.material.datepicker, global.ng.material.formField, global.ng.material.input, global.ng.material.select, global.ng.material.buttonToggle, global.ngSelect, global.ng.material.tooltip, global.ng.material.tabs));
|
|
5
|
-
})(this, (function (exports, i0, forms, core, materialMomentAdapter, momentImported, common, rxjs, operators, animations, i1, portal, i1$1, _, datepicker, formField, input, select, buttonToggle, ngSelect, tooltip, tabs) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/forms'), require('@angular/material/core'), require('@angular/material-moment-adapter'), require('moment'), require('@angular/common'), require('rxjs'), require('rxjs/operators'), require('@angular/animations'), require('@angular/cdk/overlay'), require('@angular/cdk/portal'), require('@angular/material/dialog'), require('lodash'), require('@angular/material/datepicker'), require('@angular/material/form-field'), require('@angular/material/input'), require('@angular/material/select'), require('@angular/material/button-toggle'), require('@ng-select/ng-select'), require('@angular/material/tooltip'), require('@angular/material/tabs'), require('@angular/platform-browser')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@datarailsshared/datarailsshared', ['exports', '@angular/core', '@angular/forms', '@angular/material/core', '@angular/material-moment-adapter', 'moment', '@angular/common', 'rxjs', 'rxjs/operators', '@angular/animations', '@angular/cdk/overlay', '@angular/cdk/portal', '@angular/material/dialog', 'lodash', '@angular/material/datepicker', '@angular/material/form-field', '@angular/material/input', '@angular/material/select', '@angular/material/button-toggle', '@ng-select/ng-select', '@angular/material/tooltip', '@angular/material/tabs', '@angular/platform-browser'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.datarailsshared = global.datarailsshared || {}, global.datarailsshared.datarailsshared = {}), global.ng.core, global.ng.forms, global.ng.material.core, global.ng.materialMomentAdapter, global.momentImported, global.ng.common, global.rxjs, global.rxjs.operators, global.ng.animations, global.ng.cdk.overlay, global.ng.cdk.portal, global.ng.material.dialog, global._, global.ng.material.datepicker, global.ng.material.formField, global.ng.material.input, global.ng.material.select, global.ng.material.buttonToggle, global.ngSelect, global.ng.material.tooltip, global.ng.material.tabs, global.ng.platformBrowser));
|
|
5
|
+
})(this, (function (exports, i0, forms, core, materialMomentAdapter, momentImported, common, rxjs, operators, animations, i1, portal, i1$1, _, datepicker, formField, input, select, buttonToggle, ngSelect, tooltip, tabs, platformBrowser) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopNamespace(e) {
|
|
8
8
|
if (e && e.__esModule) return e;
|
|
@@ -589,7 +589,7 @@
|
|
|
589
589
|
monthYearA11yLabel: 'MMMM YYYY'
|
|
590
590
|
},
|
|
591
591
|
};
|
|
592
|
-
var ɵ0$
|
|
592
|
+
var ɵ0$7 = MONTH_FORMATS;
|
|
593
593
|
var MonthTagComponent = /** @class */ (function (_super) {
|
|
594
594
|
__extends(MonthTagComponent, _super);
|
|
595
595
|
function MonthTagComponent() {
|
|
@@ -651,7 +651,7 @@
|
|
|
651
651
|
useClass: materialMomentAdapter.MomentDateAdapter,
|
|
652
652
|
deps: [core.MAT_DATE_LOCALE, materialMomentAdapter.MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
653
653
|
},
|
|
654
|
-
{ provide: core.MAT_DATE_FORMATS, useValue: ɵ0$
|
|
654
|
+
{ provide: core.MAT_DATE_FORMATS, useValue: ɵ0$7 },
|
|
655
655
|
]
|
|
656
656
|
},] }
|
|
657
657
|
];
|
|
@@ -787,7 +787,7 @@
|
|
|
787
787
|
monthYearA11yLabel: 'MMMM YYYY'
|
|
788
788
|
},
|
|
789
789
|
};
|
|
790
|
-
var ɵ0$
|
|
790
|
+
var ɵ0$6 = WEEK_FORMATS;
|
|
791
791
|
var WeekTagComponent = /** @class */ (function (_super) {
|
|
792
792
|
__extends(WeekTagComponent, _super);
|
|
793
793
|
function WeekTagComponent() {
|
|
@@ -887,7 +887,7 @@
|
|
|
887
887
|
useClass: materialMomentAdapter.MomentDateAdapter,
|
|
888
888
|
deps: [core.MAT_DATE_LOCALE, materialMomentAdapter.MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
889
889
|
},
|
|
890
|
-
{ provide: core.MAT_DATE_FORMATS, useValue: ɵ0$
|
|
890
|
+
{ provide: core.MAT_DATE_FORMATS, useValue: ɵ0$6 },
|
|
891
891
|
]
|
|
892
892
|
},] }
|
|
893
893
|
];
|
|
@@ -909,7 +909,7 @@
|
|
|
909
909
|
monthYearA11yLabel: 'MMMM YYYY'
|
|
910
910
|
},
|
|
911
911
|
};
|
|
912
|
-
var ɵ0$
|
|
912
|
+
var ɵ0$5 = YEAR_FORMATS;
|
|
913
913
|
var YearTagComponent = /** @class */ (function (_super) {
|
|
914
914
|
__extends(YearTagComponent, _super);
|
|
915
915
|
function YearTagComponent() {
|
|
@@ -977,7 +977,7 @@
|
|
|
977
977
|
useClass: materialMomentAdapter.MomentDateAdapter,
|
|
978
978
|
deps: [core.MAT_DATE_LOCALE, materialMomentAdapter.MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
979
979
|
},
|
|
980
|
-
{ provide: core.MAT_DATE_FORMATS, useValue: ɵ0$
|
|
980
|
+
{ provide: core.MAT_DATE_FORMATS, useValue: ɵ0$5 },
|
|
981
981
|
]
|
|
982
982
|
},] }
|
|
983
983
|
];
|
|
@@ -1093,7 +1093,7 @@
|
|
|
1093
1093
|
monthYearA11yLabel: 'MMMM YYYY'
|
|
1094
1094
|
},
|
|
1095
1095
|
};
|
|
1096
|
-
var ɵ0$
|
|
1096
|
+
var ɵ0$4 = DAY_FORMATS;
|
|
1097
1097
|
var DayTagComponent = /** @class */ (function (_super) {
|
|
1098
1098
|
__extends(DayTagComponent, _super);
|
|
1099
1099
|
function DayTagComponent() {
|
|
@@ -1147,7 +1147,7 @@
|
|
|
1147
1147
|
useClass: materialMomentAdapter.MomentDateAdapter,
|
|
1148
1148
|
deps: [core.MAT_DATE_LOCALE, materialMomentAdapter.MAT_MOMENT_DATE_ADAPTER_OPTIONS],
|
|
1149
1149
|
},
|
|
1150
|
-
{ provide: core.MAT_DATE_FORMATS, useValue: ɵ0$
|
|
1150
|
+
{ provide: core.MAT_DATE_FORMATS, useValue: ɵ0$4 },
|
|
1151
1151
|
]
|
|
1152
1152
|
},] }
|
|
1153
1153
|
];
|
|
@@ -1757,7 +1757,7 @@
|
|
|
1757
1757
|
DrSelectComponent.decorators = [
|
|
1758
1758
|
{ type: i0.Component, args: [{
|
|
1759
1759
|
selector: 'dr-select',
|
|
1760
|
-
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",
|
|
1760
|
+
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",
|
|
1761
1761
|
providers: [{
|
|
1762
1762
|
provide: forms.NG_VALUE_ACCESSOR,
|
|
1763
1763
|
useExisting: DrSelectComponent,
|
|
@@ -3706,7 +3706,7 @@
|
|
|
3706
3706
|
DialogModalWrapperComponent.decorators = [
|
|
3707
3707
|
{ type: i0.Component, args: [{
|
|
3708
3708
|
selector: 'dr-dialog-modal-wrapper',
|
|
3709
|
-
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()
|
|
3709
|
+
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",
|
|
3710
3710
|
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"]
|
|
3711
3711
|
},] }
|
|
3712
3712
|
];
|
|
@@ -3929,6 +3929,40 @@
|
|
|
3929
3929
|
CalendarView["FOR_YEARS"] = "multi-year";
|
|
3930
3930
|
})(exports.CalendarView || (exports.CalendarView = {}));
|
|
3931
3931
|
|
|
3932
|
+
var IMAGE_TYPES = ['image/png', 'image/jpeg', 'image/gif'];
|
|
3933
|
+
exports.CHAT_MESSAGE_TYPE = void 0;
|
|
3934
|
+
(function (CHAT_MESSAGE_TYPE) {
|
|
3935
|
+
CHAT_MESSAGE_TYPE["TEXT"] = "text";
|
|
3936
|
+
CHAT_MESSAGE_TYPE["RICH_TEXT"] = "rich-text";
|
|
3937
|
+
CHAT_MESSAGE_TYPE["IMAGE"] = "image";
|
|
3938
|
+
CHAT_MESSAGE_TYPE["DOWNLOAD_FILE"] = "download-file";
|
|
3939
|
+
CHAT_MESSAGE_TYPE["MAILTO"] = "mailto";
|
|
3940
|
+
CHAT_MESSAGE_TYPE["EMBED"] = "embed";
|
|
3941
|
+
CHAT_MESSAGE_TYPE["WIDGET"] = "widget";
|
|
3942
|
+
CHAT_MESSAGE_TYPE["INPUT"] = "input";
|
|
3943
|
+
CHAT_MESSAGE_TYPE["CODE"] = "code";
|
|
3944
|
+
})(exports.CHAT_MESSAGE_TYPE || (exports.CHAT_MESSAGE_TYPE = {}));
|
|
3945
|
+
var ChatMessage = /** @class */ (function () {
|
|
3946
|
+
function ChatMessage(obj, user) {
|
|
3947
|
+
this.id = obj === null || obj === void 0 ? void 0 : obj.id;
|
|
3948
|
+
this.kind = obj === null || obj === void 0 ? void 0 : obj.kind;
|
|
3949
|
+
this.seq = obj === null || obj === void 0 ? void 0 : obj.seq;
|
|
3950
|
+
this.conversationId = obj === null || obj === void 0 ? void 0 : obj.conversationId;
|
|
3951
|
+
this.reply = (obj === null || obj === void 0 ? void 0 : obj.senderId) !== user.id;
|
|
3952
|
+
this.senderId = obj === null || obj === void 0 ? void 0 : obj.senderId;
|
|
3953
|
+
this.parentId = obj === null || obj === void 0 ? void 0 : obj.parentId;
|
|
3954
|
+
this.text = (obj === null || obj === void 0 ? void 0 : obj.text) || obj.body;
|
|
3955
|
+
this.paragraphs = obj === null || obj === void 0 ? void 0 : obj.paragraphs;
|
|
3956
|
+
this.url = obj === null || obj === void 0 ? void 0 : obj.url;
|
|
3957
|
+
this.label = obj === null || obj === void 0 ? void 0 : obj.label;
|
|
3958
|
+
this.subject = obj === null || obj === void 0 ? void 0 : obj.subject;
|
|
3959
|
+
this.body = obj === null || obj === void 0 ? void 0 : obj.body;
|
|
3960
|
+
this.form = obj === null || obj === void 0 ? void 0 : obj.form;
|
|
3961
|
+
this.parameters = obj === null || obj === void 0 ? void 0 : obj.parameters;
|
|
3962
|
+
}
|
|
3963
|
+
return ChatMessage;
|
|
3964
|
+
}());
|
|
3965
|
+
|
|
3932
3966
|
var components$3 = [DateTagComponent,
|
|
3933
3967
|
DayTagComponent,
|
|
3934
3968
|
WeekTagComponent,
|
|
@@ -3937,7 +3971,7 @@
|
|
|
3937
3971
|
AnyTagComponent,
|
|
3938
3972
|
YearTagComponent,
|
|
3939
3973
|
ForecastTagComponent];
|
|
3940
|
-
var ɵ0$
|
|
3974
|
+
var ɵ0$3 = { useUtc: true };
|
|
3941
3975
|
var DateTagModule = /** @class */ (function () {
|
|
3942
3976
|
function DateTagModule() {
|
|
3943
3977
|
}
|
|
@@ -3958,7 +3992,7 @@
|
|
|
3958
3992
|
],
|
|
3959
3993
|
exports: components$3,
|
|
3960
3994
|
providers: [
|
|
3961
|
-
{ provide: materialMomentAdapter.MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: ɵ0$
|
|
3995
|
+
{ provide: materialMomentAdapter.MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: ɵ0$3 }
|
|
3962
3996
|
],
|
|
3963
3997
|
declarations: components$3,
|
|
3964
3998
|
},] }
|
|
@@ -4060,6 +4094,7 @@
|
|
|
4060
4094
|
quarter: exports.DateFromats.QUARTER_FORMAT,
|
|
4061
4095
|
week: exports.DateFromats.WEEK_FORMAT
|
|
4062
4096
|
};
|
|
4097
|
+
this.fiscalYearMonthsModifier = 0;
|
|
4063
4098
|
}
|
|
4064
4099
|
DrDatePickerService.prototype.getDisplayPrefix = function () {
|
|
4065
4100
|
var formatCached = this.format$.getValue();
|
|
@@ -4086,6 +4121,94 @@
|
|
|
4086
4121
|
DrDatePickerService.prototype.normalizeValue = function (value) {
|
|
4087
4122
|
return value.replace(/d/g, 'D');
|
|
4088
4123
|
};
|
|
4124
|
+
/**
|
|
4125
|
+
* Get quarter number for date according to fiscal year
|
|
4126
|
+
*
|
|
4127
|
+
* @param date
|
|
4128
|
+
*/
|
|
4129
|
+
DrDatePickerService.prototype.getQuarterAccordingToFiscalYear = function (date) {
|
|
4130
|
+
var fiscalMonth = this.fiscalYearMonthsModifier;
|
|
4131
|
+
var dateMonth = date.month();
|
|
4132
|
+
if (dateMonth < fiscalMonth) {
|
|
4133
|
+
fiscalMonth -= 12;
|
|
4134
|
+
}
|
|
4135
|
+
return Math.trunc((date.month() - fiscalMonth) / 3) + 1;
|
|
4136
|
+
};
|
|
4137
|
+
/**
|
|
4138
|
+
* Sets date to end of quarter in FY by passed quarter number
|
|
4139
|
+
*
|
|
4140
|
+
* @param date
|
|
4141
|
+
* @param quarterNumber
|
|
4142
|
+
*/
|
|
4143
|
+
DrDatePickerService.prototype.setEndOfQuarter = function (date, quarterNumber) {
|
|
4144
|
+
date
|
|
4145
|
+
.subtract(this.fiscalYearMonthsModifier, 'M')
|
|
4146
|
+
.startOf('year')
|
|
4147
|
+
.add(this.fiscalYearMonthsModifier + quarterNumber * 3 - 1, 'M')
|
|
4148
|
+
.endOf('month');
|
|
4149
|
+
};
|
|
4150
|
+
/**
|
|
4151
|
+
* Sets date to start of quarter in FY by passed quarter number
|
|
4152
|
+
*
|
|
4153
|
+
* @param date
|
|
4154
|
+
* @param quarterNumber
|
|
4155
|
+
*/
|
|
4156
|
+
DrDatePickerService.prototype.setStartOfQuarter = function (date, quarterNumber) {
|
|
4157
|
+
date
|
|
4158
|
+
.subtract(this.fiscalYearMonthsModifier, 'M')
|
|
4159
|
+
.startOf('year')
|
|
4160
|
+
.add(this.fiscalYearMonthsModifier + (quarterNumber - 1) * 3, 'M');
|
|
4161
|
+
};
|
|
4162
|
+
/**
|
|
4163
|
+
* Sets date to end of current quarter (in which date is located) according to FY
|
|
4164
|
+
*
|
|
4165
|
+
* @param date
|
|
4166
|
+
*/
|
|
4167
|
+
DrDatePickerService.prototype.setEndOfCurrentQuarter = function (date) {
|
|
4168
|
+
this.setEndOfQuarter(date, this.getQuarterAccordingToFiscalYear(date));
|
|
4169
|
+
};
|
|
4170
|
+
/**
|
|
4171
|
+
* Sets date to start of current quarter (in which date is located) according to FY
|
|
4172
|
+
*
|
|
4173
|
+
* @param date
|
|
4174
|
+
*/
|
|
4175
|
+
DrDatePickerService.prototype.setStartOfCurrentQuarter = function (date) {
|
|
4176
|
+
this.setStartOfQuarter(date, this.getQuarterAccordingToFiscalYear(date));
|
|
4177
|
+
};
|
|
4178
|
+
/**
|
|
4179
|
+
* If date selection on this timeframe depends on Fiscal Year
|
|
4180
|
+
*
|
|
4181
|
+
* @param timeframe
|
|
4182
|
+
*/
|
|
4183
|
+
DrDatePickerService.prototype.isTimeframeDependingOnFY = function (timeframe) {
|
|
4184
|
+
return ___namespace.includes([exports.TimeframeOption.QUARTER, exports.TimeframeOption.YEAR], timeframe);
|
|
4185
|
+
};
|
|
4186
|
+
/**
|
|
4187
|
+
* Subtract from date fiscal year shift months count
|
|
4188
|
+
*
|
|
4189
|
+
* @param date
|
|
4190
|
+
*/
|
|
4191
|
+
DrDatePickerService.prototype.subtractFiscalYearMonthsFromDate = function (date) {
|
|
4192
|
+
return this.getDateModifiedByFiscalMonths(date, true);
|
|
4193
|
+
};
|
|
4194
|
+
/**
|
|
4195
|
+
* Add to date fiscal year shift months count
|
|
4196
|
+
*
|
|
4197
|
+
* @param date
|
|
4198
|
+
*/
|
|
4199
|
+
DrDatePickerService.prototype.addFiscalYearMonthsToDate = function (date) {
|
|
4200
|
+
return this.getDateModifiedByFiscalMonths(date);
|
|
4201
|
+
};
|
|
4202
|
+
/**
|
|
4203
|
+
* Add or subtract depending on isRevert paremeter Fiscal year month shift
|
|
4204
|
+
*
|
|
4205
|
+
* @param date
|
|
4206
|
+
* @param isSubtract
|
|
4207
|
+
*/
|
|
4208
|
+
DrDatePickerService.prototype.getDateModifiedByFiscalMonths = function (date, isSubtract) {
|
|
4209
|
+
if (isSubtract === void 0) { isSubtract = false; }
|
|
4210
|
+
return date ? ___namespace.cloneDeep(date)[isSubtract ? 'subtract' : 'add'](this.fiscalYearMonthsModifier, 'month') : date;
|
|
4211
|
+
};
|
|
4089
4212
|
return DrDatePickerService;
|
|
4090
4213
|
}());
|
|
4091
4214
|
DrDatePickerService.decorators = [
|
|
@@ -4122,20 +4245,20 @@
|
|
|
4122
4245
|
title: 'Month',
|
|
4123
4246
|
value: exports.CalendarView.FOR_MONTHS,
|
|
4124
4247
|
format: this.datePickerService.formatConfig.month,
|
|
4125
|
-
periodLabel: function () { return String(moment$1(_this._calendar.activeDate).year()); }
|
|
4248
|
+
periodLabel: function () { return String(moment$1(_this._calendar.activeDate).utc().year()); }
|
|
4126
4249
|
}, {
|
|
4127
4250
|
timeframe: exports.TimeframeOption.QUARTER,
|
|
4128
4251
|
title: 'Quarter',
|
|
4129
4252
|
value: exports.CalendarView.FOR_QUARTERS,
|
|
4130
4253
|
format: this.datePickerService.formatConfig.quarter,
|
|
4131
|
-
periodLabel: function () { return String(moment$1(_this._calendar.activeDate).year()); }
|
|
4254
|
+
periodLabel: function () { return String(moment$1(_this.datePickerService.subtractFiscalYearMonthsFromDate(_this._calendar.activeDate)).utc().year()); }
|
|
4132
4255
|
}, {
|
|
4133
4256
|
timeframe: exports.TimeframeOption.YEAR,
|
|
4134
4257
|
title: 'Year',
|
|
4135
4258
|
value: exports.CalendarView.FOR_YEARS,
|
|
4136
4259
|
format: this.datePickerService.formatConfig.year,
|
|
4137
4260
|
periodLabel: function () {
|
|
4138
|
-
var currentYear = moment$1(_this._calendar.activeDate).year();
|
|
4261
|
+
var currentYear = moment$1(_this.datePickerService.subtractFiscalYearMonthsFromDate(_this._calendar.activeDate)).utc().year();
|
|
4139
4262
|
var startPeriod = Math.floor(currentYear / 24) * 24;
|
|
4140
4263
|
return startPeriod + '-' + (startPeriod + 23);
|
|
4141
4264
|
}
|
|
@@ -4157,12 +4280,25 @@
|
|
|
4157
4280
|
_calendar.currentView = _this.selectedTimeframe;
|
|
4158
4281
|
_this.setPeriodLabels();
|
|
4159
4282
|
if (_this.selectedTimeframe === exports.CalendarView.FOR_QUARTERS) {
|
|
4160
|
-
_this.selectedQuarter =
|
|
4283
|
+
_this.selectedQuarter = _this.datePickerService.getQuarterAccordingToFiscalYear(_this._calendar.activeDate);
|
|
4284
|
+
}
|
|
4285
|
+
});
|
|
4286
|
+
_calendar.viewChanged.pipe(operators.takeUntil(this._destroyed)).subscribe(function () {
|
|
4287
|
+
_this.setPeriodLabels();
|
|
4288
|
+
if (_calendar.multiYearView) {
|
|
4289
|
+
_this.transformDateInMultiyearViewAccordingToFY();
|
|
4161
4290
|
}
|
|
4162
4291
|
});
|
|
4163
|
-
_calendar.viewChanged.pipe(operators.takeUntil(this._destroyed)).subscribe(function () { return _this.setPeriodLabels(); });
|
|
4164
4292
|
this.datePickerService.calendarInstance = _calendar;
|
|
4165
4293
|
}
|
|
4294
|
+
DrDatePickerCustomHeaderComponent.prototype.ngOnInit = function () {
|
|
4295
|
+
var _this = this;
|
|
4296
|
+
setTimeout(function () {
|
|
4297
|
+
if (_this._calendar.multiYearView) {
|
|
4298
|
+
_this.transformDateInMultiyearViewAccordingToFY();
|
|
4299
|
+
}
|
|
4300
|
+
});
|
|
4301
|
+
};
|
|
4166
4302
|
DrDatePickerCustomHeaderComponent.prototype.ngOnDestroy = function () {
|
|
4167
4303
|
this._destroyed.next();
|
|
4168
4304
|
this._destroyed.complete();
|
|
@@ -4188,7 +4324,7 @@
|
|
|
4188
4324
|
var chosenTimeframeOption = this.timeframeOptions.filter(function (option) { return option.value === _this.selectedTimeframe; })[0];
|
|
4189
4325
|
this.datePickerService.updateTimeframeAndFormat(chosenTimeframeOption.format);
|
|
4190
4326
|
if (this.selectedTimeframe === exports.CalendarView.FOR_QUARTERS) {
|
|
4191
|
-
this.selectedQuarter =
|
|
4327
|
+
this.selectedQuarter = this.datePickerService.getQuarterAccordingToFiscalYear(this._calendar.activeDate);
|
|
4192
4328
|
}
|
|
4193
4329
|
};
|
|
4194
4330
|
Object.defineProperty(DrDatePickerCustomHeaderComponent.prototype, "currentViewIsQuarter", {
|
|
@@ -4202,11 +4338,9 @@
|
|
|
4202
4338
|
this._calendar.currentView = view;
|
|
4203
4339
|
};
|
|
4204
4340
|
DrDatePickerCustomHeaderComponent.prototype.onSelectQuarter = function (quarterNumber) {
|
|
4205
|
-
|
|
4206
|
-
this.
|
|
4207
|
-
|
|
4208
|
-
this._calendar.activeDate = unadaptedDate;
|
|
4209
|
-
this.datePickerService.updatedQuarter$.next(moment$1(unadaptedDate));
|
|
4341
|
+
this.selectedQuarter = quarterNumber;
|
|
4342
|
+
this.datePickerService.setEndOfQuarter(this._calendar.activeDate, quarterNumber);
|
|
4343
|
+
this.datePickerService.updatedQuarter$.next(this._calendar.activeDate);
|
|
4210
4344
|
this.datePickerService.datePickerInstance.close();
|
|
4211
4345
|
};
|
|
4212
4346
|
DrDatePickerCustomHeaderComponent.prototype.pagingClicked = function (forward) {
|
|
@@ -4218,12 +4352,18 @@
|
|
|
4218
4352
|
this._calendar.activeDate = this._dateAdapter[actionCall](this._calendar.activeDate, forward ? amount : -amount);
|
|
4219
4353
|
this.setPeriodLabels();
|
|
4220
4354
|
};
|
|
4355
|
+
DrDatePickerCustomHeaderComponent.prototype.transformDateInMultiyearViewAccordingToFY = function () {
|
|
4356
|
+
var multuYearView = this._calendar.multiYearView;
|
|
4357
|
+
multuYearView._activeDate = this.datePickerService.subtractFiscalYearMonthsFromDate(multuYearView._activeDate);
|
|
4358
|
+
multuYearView._selectedYear = multuYearView._activeDate.year();
|
|
4359
|
+
multuYearView._init();
|
|
4360
|
+
};
|
|
4221
4361
|
return DrDatePickerCustomHeaderComponent;
|
|
4222
4362
|
}());
|
|
4223
4363
|
DrDatePickerCustomHeaderComponent.decorators = [
|
|
4224
4364
|
{ type: i0.Component, args: [{
|
|
4225
4365
|
selector: 'dr-date-picker_custom-header.component',
|
|
4226
|
-
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",
|
|
4366
|
+
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",
|
|
4227
4367
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
4228
4368
|
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"]
|
|
4229
4369
|
},] }
|
|
@@ -4239,7 +4379,7 @@
|
|
|
4239
4379
|
var moment = require('moment');
|
|
4240
4380
|
var noop = function () {
|
|
4241
4381
|
};
|
|
4242
|
-
var ɵ0$
|
|
4382
|
+
var ɵ0$2 = noop;
|
|
4243
4383
|
var DrDatePickerComponent = /** @class */ (function () {
|
|
4244
4384
|
function DrDatePickerComponent(cdr, dateAdapter, datePickerService) {
|
|
4245
4385
|
var _this = this;
|
|
@@ -4249,6 +4389,7 @@
|
|
|
4249
4389
|
// Whether to transform date, taking end, start, middle of preiod (i.e. set middle of month if timeframe='month')
|
|
4250
4390
|
this.periodPosition = exports.DatePickerPeriodPosition.DEFAULT;
|
|
4251
4391
|
this.placeholder = 'Select';
|
|
4392
|
+
this.fiscalYearMonthsModifier = 0;
|
|
4252
4393
|
this.calendarViewsTimeframeMapping = {
|
|
4253
4394
|
year: 'multi-year',
|
|
4254
4395
|
month: 'year',
|
|
@@ -4301,6 +4442,7 @@
|
|
|
4301
4442
|
configurable: true
|
|
4302
4443
|
});
|
|
4303
4444
|
DrDatePickerComponent.prototype.ngAfterViewInit = function () {
|
|
4445
|
+
this.datePickerService.fiscalYearMonthsModifier = this.fiscalYearMonthsModifier;
|
|
4304
4446
|
this.datePickerService.datePickerInstance = this.datePicker;
|
|
4305
4447
|
this.datePicker.startView = this.calendarViewsTimeframeMapping[this.datePickerService.timeframe];
|
|
4306
4448
|
};
|
|
@@ -4316,14 +4458,43 @@
|
|
|
4316
4458
|
var timeframe = this.datePickerService.timeframe;
|
|
4317
4459
|
switch (this.periodPosition) {
|
|
4318
4460
|
case exports.DatePickerPeriodPosition.START_OF_PERIOD:
|
|
4319
|
-
this.
|
|
4461
|
+
if (this.datePickerService.timeframe === exports.TimeframeOption.QUARTER) {
|
|
4462
|
+
this.datePickerService.setStartOfCurrentQuarter(this.innerValue);
|
|
4463
|
+
}
|
|
4464
|
+
else if (this.datePickerService.timeframe === exports.TimeframeOption.YEAR) {
|
|
4465
|
+
this.datePickerService.setStartOfQuarter(this.innerValue, 1);
|
|
4466
|
+
}
|
|
4467
|
+
else {
|
|
4468
|
+
this.innerValue.startOf(timeframe);
|
|
4469
|
+
}
|
|
4320
4470
|
break;
|
|
4321
4471
|
case exports.DatePickerPeriodPosition.END_OF_PERIOD:
|
|
4322
|
-
this.
|
|
4472
|
+
if (this.datePickerService.timeframe === exports.TimeframeOption.QUARTER) {
|
|
4473
|
+
this.datePickerService.setEndOfCurrentQuarter(this.innerValue);
|
|
4474
|
+
}
|
|
4475
|
+
else if (this.datePickerService.timeframe === exports.TimeframeOption.YEAR) {
|
|
4476
|
+
this.datePickerService.setEndOfQuarter(this.innerValue, 4);
|
|
4477
|
+
}
|
|
4478
|
+
else {
|
|
4479
|
+
this.innerValue.endOf(timeframe);
|
|
4480
|
+
}
|
|
4323
4481
|
break;
|
|
4324
4482
|
case exports.DatePickerPeriodPosition.MIDDLE_OF_PERIOD:
|
|
4325
|
-
|
|
4326
|
-
|
|
4483
|
+
var endOfPeriod = void 0;
|
|
4484
|
+
if (this.datePickerService.timeframe === exports.TimeframeOption.QUARTER) {
|
|
4485
|
+
endOfPeriod = this.innerValue.clone();
|
|
4486
|
+
this.datePickerService.setStartOfCurrentQuarter(this.innerValue);
|
|
4487
|
+
this.datePickerService.setEndOfCurrentQuarter(endOfPeriod);
|
|
4488
|
+
}
|
|
4489
|
+
else if (this.datePickerService.timeframe === exports.TimeframeOption.YEAR) {
|
|
4490
|
+
endOfPeriod = this.innerValue.clone();
|
|
4491
|
+
this.datePickerService.setStartOfQuarter(this.innerValue, 1);
|
|
4492
|
+
this.datePickerService.setEndOfQuarter(endOfPeriod, 4);
|
|
4493
|
+
}
|
|
4494
|
+
else {
|
|
4495
|
+
this.innerValue.startOf(timeframe);
|
|
4496
|
+
endOfPeriod = this.innerValue.clone().endOf(timeframe);
|
|
4497
|
+
}
|
|
4327
4498
|
var diff = endOfPeriod.diff(this.innerValue, 'seconds');
|
|
4328
4499
|
this.innerValue.add(diff / 2 + 1, 'seconds');
|
|
4329
4500
|
break;
|
|
@@ -4333,6 +4504,9 @@
|
|
|
4333
4504
|
}
|
|
4334
4505
|
};
|
|
4335
4506
|
DrDatePickerComponent.prototype.chosenPeriodHandler = function (chosenDate, timeframe) {
|
|
4507
|
+
if (timeframe === exports.TimeframeOption.YEAR) {
|
|
4508
|
+
chosenDate = this.datePickerService.addFiscalYearMonthsToDate(chosenDate);
|
|
4509
|
+
}
|
|
4336
4510
|
if (this.datePickerService.timeframe === exports.TimeframeOption.QUARTER && timeframe === exports.TimeframeOption.YEAR) {
|
|
4337
4511
|
this.datePickerService.calendarInstance.currentView = exports.CalendarView.FOR_QUARTERS;
|
|
4338
4512
|
this.datePickerService.calendarInstance.activeDate = chosenDate;
|
|
@@ -4401,6 +4575,7 @@
|
|
|
4401
4575
|
max: [{ type: i0.Input }],
|
|
4402
4576
|
periodPosition: [{ type: i0.Input }],
|
|
4403
4577
|
placeholder: [{ type: i0.Input }],
|
|
4578
|
+
fiscalYearMonthsModifier: [{ type: i0.Input }],
|
|
4404
4579
|
datePicker: [{ type: i0.ViewChild, args: ['datePicker',] }]
|
|
4405
4580
|
};
|
|
4406
4581
|
|
|
@@ -4461,8 +4636,12 @@
|
|
|
4461
4636
|
if (!this.value) {
|
|
4462
4637
|
return this.placeholder;
|
|
4463
4638
|
}
|
|
4639
|
+
var displayValue = ___namespace.cloneDeep(this.value);
|
|
4640
|
+
if (this.datePickerService.isTimeframeDependingOnFY(this.datePickerService.timeframe)) {
|
|
4641
|
+
displayValue = this.datePickerService.subtractFiscalYearMonthsFromDate(displayValue);
|
|
4642
|
+
}
|
|
4464
4643
|
var formatCached = this.datePickerService.format$.getValue();
|
|
4465
|
-
return this.datePickerService.getDisplayPrefix() +
|
|
4644
|
+
return this.datePickerService.getDisplayPrefix() + displayValue.format(formatCached);
|
|
4466
4645
|
},
|
|
4467
4646
|
enumerable: false,
|
|
4468
4647
|
configurable: true
|
|
@@ -4959,7 +5138,7 @@
|
|
|
4959
5138
|
},] }
|
|
4960
5139
|
];
|
|
4961
5140
|
|
|
4962
|
-
var ɵ0 = {}, ɵ1 = {};
|
|
5141
|
+
var ɵ0$1 = {}, ɵ1 = {};
|
|
4963
5142
|
var DrDialogModule = /** @class */ (function () {
|
|
4964
5143
|
function DrDialogModule() {
|
|
4965
5144
|
}
|
|
@@ -4977,13 +5156,490 @@
|
|
|
4977
5156
|
],
|
|
4978
5157
|
exports: [DialogWrapperComponent, DialogModalWrapperComponent],
|
|
4979
5158
|
providers: [
|
|
4980
|
-
{ provide: i1$1.MatDialogRef, useValue: ɵ0 },
|
|
5159
|
+
{ provide: i1$1.MatDialogRef, useValue: ɵ0$1 },
|
|
4981
5160
|
{ provide: i1$1.MAT_DIALOG_DATA, useValue: ɵ1 },
|
|
4982
5161
|
DialogService
|
|
4983
5162
|
]
|
|
4984
5163
|
},] }
|
|
4985
5164
|
];
|
|
4986
5165
|
|
|
5166
|
+
var DrChatFormComponent = /** @class */ (function () {
|
|
5167
|
+
function DrChatFormComponent(cdr, domSanitizer) {
|
|
5168
|
+
this.cdr = cdr;
|
|
5169
|
+
this.domSanitizer = domSanitizer;
|
|
5170
|
+
this.inputFocus = false;
|
|
5171
|
+
this.inputHover = false;
|
|
5172
|
+
this.droppedFiles = [];
|
|
5173
|
+
/**
|
|
5174
|
+
* Predefined message text
|
|
5175
|
+
*
|
|
5176
|
+
* @type {string}
|
|
5177
|
+
*/
|
|
5178
|
+
this.message = '';
|
|
5179
|
+
/**
|
|
5180
|
+
* Message placeholder text
|
|
5181
|
+
*
|
|
5182
|
+
* @type {string}
|
|
5183
|
+
*/
|
|
5184
|
+
this.messagePlaceholder = 'Type a message';
|
|
5185
|
+
/**
|
|
5186
|
+
* Show send button
|
|
5187
|
+
*
|
|
5188
|
+
* @type {boolean}
|
|
5189
|
+
*/
|
|
5190
|
+
this.dropFiles = false;
|
|
5191
|
+
/**
|
|
5192
|
+
* File drop placeholder text
|
|
5193
|
+
*
|
|
5194
|
+
* @type {string}
|
|
5195
|
+
*/
|
|
5196
|
+
this.dropFilePlaceholder = 'Drop file to send';
|
|
5197
|
+
/**
|
|
5198
|
+
*
|
|
5199
|
+
* @type {EventEmitter<{ message: string, files: File[] }>}
|
|
5200
|
+
*/
|
|
5201
|
+
this.send = new i0.EventEmitter();
|
|
5202
|
+
/**
|
|
5203
|
+
* Emits when message input value has been changed
|
|
5204
|
+
*
|
|
5205
|
+
* @type {EventEmitter<string>}
|
|
5206
|
+
*/
|
|
5207
|
+
this.inputChange = new i0.EventEmitter();
|
|
5208
|
+
this.fileOver = false;
|
|
5209
|
+
}
|
|
5210
|
+
DrChatFormComponent.prototype.onDrop = function (event) {
|
|
5211
|
+
var e_1, _b;
|
|
5212
|
+
var _this = this;
|
|
5213
|
+
var _a;
|
|
5214
|
+
if (this.dropFiles) {
|
|
5215
|
+
event.preventDefault();
|
|
5216
|
+
event.stopPropagation();
|
|
5217
|
+
this.fileOver = false;
|
|
5218
|
+
if ((_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) {
|
|
5219
|
+
var _loop_1 = function (file) {
|
|
5220
|
+
var res = file;
|
|
5221
|
+
if (IMAGE_TYPES.includes(file.type)) {
|
|
5222
|
+
var fr = new FileReader();
|
|
5223
|
+
fr.onload = function (e) {
|
|
5224
|
+
res.src = e.target.result;
|
|
5225
|
+
res.urlStyle = _this.domSanitizer.bypassSecurityTrustStyle("url(" + res.src + ")");
|
|
5226
|
+
_this.cdr.detectChanges();
|
|
5227
|
+
};
|
|
5228
|
+
fr.readAsDataURL(file);
|
|
5229
|
+
}
|
|
5230
|
+
this_1.droppedFiles.push(res);
|
|
5231
|
+
};
|
|
5232
|
+
var this_1 = this;
|
|
5233
|
+
try {
|
|
5234
|
+
for (var _c = __values(event.dataTransfer.files), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
5235
|
+
var file = _d.value;
|
|
5236
|
+
_loop_1(file);
|
|
5237
|
+
}
|
|
5238
|
+
}
|
|
5239
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
5240
|
+
finally {
|
|
5241
|
+
try {
|
|
5242
|
+
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
5243
|
+
}
|
|
5244
|
+
finally { if (e_1) throw e_1.error; }
|
|
5245
|
+
}
|
|
5246
|
+
}
|
|
5247
|
+
}
|
|
5248
|
+
};
|
|
5249
|
+
DrChatFormComponent.prototype.removeFile = function (file) {
|
|
5250
|
+
var index = this.droppedFiles.indexOf(file);
|
|
5251
|
+
if (index >= 0) {
|
|
5252
|
+
this.droppedFiles.splice(index, 1);
|
|
5253
|
+
}
|
|
5254
|
+
};
|
|
5255
|
+
DrChatFormComponent.prototype.onDragOver = function (event) {
|
|
5256
|
+
event.preventDefault();
|
|
5257
|
+
event.stopPropagation();
|
|
5258
|
+
if (this.dropFiles) {
|
|
5259
|
+
this.fileOver = true;
|
|
5260
|
+
}
|
|
5261
|
+
};
|
|
5262
|
+
DrChatFormComponent.prototype.onDragLeave = function (event) {
|
|
5263
|
+
event.preventDefault();
|
|
5264
|
+
event.stopPropagation();
|
|
5265
|
+
if (this.dropFiles) {
|
|
5266
|
+
this.fileOver = false;
|
|
5267
|
+
}
|
|
5268
|
+
};
|
|
5269
|
+
DrChatFormComponent.prototype.sendMessage = function () {
|
|
5270
|
+
if (this.droppedFiles.length || String(this.message).trim().length) {
|
|
5271
|
+
this.send.emit({ message: this.message, files: this.droppedFiles });
|
|
5272
|
+
this.message = '';
|
|
5273
|
+
this.droppedFiles = [];
|
|
5274
|
+
this.cdr.markForCheck();
|
|
5275
|
+
}
|
|
5276
|
+
};
|
|
5277
|
+
DrChatFormComponent.prototype.onModelChange = function (value) {
|
|
5278
|
+
this.inputChange.emit(value);
|
|
5279
|
+
};
|
|
5280
|
+
return DrChatFormComponent;
|
|
5281
|
+
}());
|
|
5282
|
+
DrChatFormComponent.decorators = [
|
|
5283
|
+
{ type: i0.Component, args: [{
|
|
5284
|
+
selector: 'dr-chat-form',
|
|
5285
|
+
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",
|
|
5286
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
5287
|
+
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"]
|
|
5288
|
+
},] }
|
|
5289
|
+
];
|
|
5290
|
+
DrChatFormComponent.ctorParameters = function () { return [
|
|
5291
|
+
{ type: i0.ChangeDetectorRef },
|
|
5292
|
+
{ type: platformBrowser.DomSanitizer }
|
|
5293
|
+
]; };
|
|
5294
|
+
DrChatFormComponent.propDecorators = {
|
|
5295
|
+
message: [{ type: i0.Input }],
|
|
5296
|
+
messagePlaceholder: [{ type: i0.Input }],
|
|
5297
|
+
dropFiles: [{ type: i0.Input }],
|
|
5298
|
+
dropFilePlaceholder: [{ type: i0.Input }],
|
|
5299
|
+
send: [{ type: i0.Output }],
|
|
5300
|
+
inputChange: [{ type: i0.Output }],
|
|
5301
|
+
fileOver: [{ type: i0.HostBinding, args: ['class.file-over',] }],
|
|
5302
|
+
onDrop: [{ type: i0.HostListener, args: ['drop', ['$event'],] }],
|
|
5303
|
+
onDragOver: [{ type: i0.HostListener, args: ['dragover', ['$event'],] }],
|
|
5304
|
+
onDragLeave: [{ type: i0.HostListener, args: ['dragleave', ['$event'],] }]
|
|
5305
|
+
};
|
|
5306
|
+
|
|
5307
|
+
/**
|
|
5308
|
+
* `DrCustomMessageService` is used to store instances of `DrChatCustomMessageDirective`s which
|
|
5309
|
+
* were provided in the chat component.
|
|
5310
|
+
*/
|
|
5311
|
+
var DrChatCustomMessageService = /** @class */ (function () {
|
|
5312
|
+
function DrChatCustomMessageService() {
|
|
5313
|
+
this.customMessages = new Map();
|
|
5314
|
+
}
|
|
5315
|
+
DrChatCustomMessageService.prototype.register = function (type, instance) {
|
|
5316
|
+
this.customMessages.set(type, instance);
|
|
5317
|
+
};
|
|
5318
|
+
DrChatCustomMessageService.prototype.unregister = function (type) {
|
|
5319
|
+
return this.customMessages.delete(type);
|
|
5320
|
+
};
|
|
5321
|
+
DrChatCustomMessageService.prototype.getInstance = function (type) {
|
|
5322
|
+
return this.customMessages.get(type);
|
|
5323
|
+
};
|
|
5324
|
+
return DrChatCustomMessageService;
|
|
5325
|
+
}());
|
|
5326
|
+
DrChatCustomMessageService.decorators = [
|
|
5327
|
+
{ type: i0.Injectable }
|
|
5328
|
+
];
|
|
5329
|
+
|
|
5330
|
+
var DrChatMessageComponent = /** @class */ (function () {
|
|
5331
|
+
function DrChatMessageComponent(customMessageService) {
|
|
5332
|
+
this.customMessageService = customMessageService;
|
|
5333
|
+
this.MESSAGE_TYPE = exports.CHAT_MESSAGE_TYPE;
|
|
5334
|
+
this.MESSAGE_TYPE_CUSTOM = exports.CHAT_MESSAGE_TYPE.EMBED;
|
|
5335
|
+
this._reply = false;
|
|
5336
|
+
}
|
|
5337
|
+
Object.defineProperty(DrChatMessageComponent.prototype, "flyInOut", {
|
|
5338
|
+
get: function () {
|
|
5339
|
+
return true;
|
|
5340
|
+
},
|
|
5341
|
+
enumerable: false,
|
|
5342
|
+
configurable: true
|
|
5343
|
+
});
|
|
5344
|
+
Object.defineProperty(DrChatMessageComponent.prototype, "notReply", {
|
|
5345
|
+
get: function () {
|
|
5346
|
+
return !this.reply;
|
|
5347
|
+
},
|
|
5348
|
+
enumerable: false,
|
|
5349
|
+
configurable: true
|
|
5350
|
+
});
|
|
5351
|
+
Object.defineProperty(DrChatMessageComponent.prototype, "reply", {
|
|
5352
|
+
/**
|
|
5353
|
+
* Determines if a message is a reply
|
|
5354
|
+
*/
|
|
5355
|
+
get: function () {
|
|
5356
|
+
return this._reply;
|
|
5357
|
+
},
|
|
5358
|
+
set: function (value) {
|
|
5359
|
+
this._reply = !!value;
|
|
5360
|
+
},
|
|
5361
|
+
enumerable: false,
|
|
5362
|
+
configurable: true
|
|
5363
|
+
});
|
|
5364
|
+
DrChatMessageComponent.prototype.getTemplate = function () {
|
|
5365
|
+
this.customMessage = true;
|
|
5366
|
+
var customMessage = this.getCustomMessage(this.type);
|
|
5367
|
+
return customMessage.templateRef;
|
|
5368
|
+
};
|
|
5369
|
+
DrChatMessageComponent.prototype.getTemplateContext = function () {
|
|
5370
|
+
return { $implicit: this.customMessageData, isReply: this.reply };
|
|
5371
|
+
};
|
|
5372
|
+
DrChatMessageComponent.prototype.getCustomMessage = function (type) {
|
|
5373
|
+
var customMessageDirective = this.customMessageService.getInstance(type);
|
|
5374
|
+
if (!customMessageDirective) {
|
|
5375
|
+
throw new Error("dr-chat: Can't find template for custom type '" + type + "'. " +
|
|
5376
|
+
("Make sure you provide it in the chat component with *drCustomMessage='" + type + "'."));
|
|
5377
|
+
}
|
|
5378
|
+
return customMessageDirective;
|
|
5379
|
+
};
|
|
5380
|
+
return DrChatMessageComponent;
|
|
5381
|
+
}());
|
|
5382
|
+
DrChatMessageComponent.decorators = [
|
|
5383
|
+
{ type: i0.Component, args: [{
|
|
5384
|
+
selector: 'dr-chat-message',
|
|
5385
|
+
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",
|
|
5386
|
+
animations: [
|
|
5387
|
+
animations.trigger('flyInOut', [
|
|
5388
|
+
animations.state('in', animations.style({ transform: 'translateX(0)' })),
|
|
5389
|
+
animations.transition('void => *', [animations.style({ transform: 'translateX(-100%)' }), animations.animate(80)]),
|
|
5390
|
+
animations.transition('* => void', [animations.animate(80, animations.style({ transform: 'translateX(100%)' }))]),
|
|
5391
|
+
]),
|
|
5392
|
+
],
|
|
5393
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
5394
|
+
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"]
|
|
5395
|
+
},] }
|
|
5396
|
+
];
|
|
5397
|
+
DrChatMessageComponent.ctorParameters = function () { return [
|
|
5398
|
+
{ type: DrChatCustomMessageService }
|
|
5399
|
+
]; };
|
|
5400
|
+
DrChatMessageComponent.propDecorators = {
|
|
5401
|
+
flyInOut: [{ type: i0.HostBinding, args: ['@flyInOut',] }],
|
|
5402
|
+
notReply: [{ type: i0.HostBinding, args: ['class.not-reply',] }],
|
|
5403
|
+
reply: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.reply',] }],
|
|
5404
|
+
type: [{ type: i0.Input }],
|
|
5405
|
+
message: [{ type: i0.Input }],
|
|
5406
|
+
customMessageData: [{ type: i0.Input }]
|
|
5407
|
+
};
|
|
5408
|
+
|
|
5409
|
+
var DrChatComponent = /** @class */ (function () {
|
|
5410
|
+
function DrChatComponent(cdr) {
|
|
5411
|
+
this.cdr = cdr;
|
|
5412
|
+
this.noMessagesPlaceholder = 'No messages yet.';
|
|
5413
|
+
this._scrollBottom = true;
|
|
5414
|
+
}
|
|
5415
|
+
Object.defineProperty(DrChatComponent.prototype, "scrollBottom", {
|
|
5416
|
+
/**
|
|
5417
|
+
* Scroll chat to the bottom of the list when a new message arrives
|
|
5418
|
+
*/
|
|
5419
|
+
get: function () {
|
|
5420
|
+
return this._scrollBottom;
|
|
5421
|
+
},
|
|
5422
|
+
set: function (value) {
|
|
5423
|
+
this._scrollBottom = !!value;
|
|
5424
|
+
},
|
|
5425
|
+
enumerable: false,
|
|
5426
|
+
configurable: true
|
|
5427
|
+
});
|
|
5428
|
+
DrChatComponent.prototype.ngAfterViewInit = function () {
|
|
5429
|
+
var _this = this;
|
|
5430
|
+
this.messages.changes.subscribe(function (messages) {
|
|
5431
|
+
_this.messages = messages;
|
|
5432
|
+
_this.updateView();
|
|
5433
|
+
});
|
|
5434
|
+
this.updateView();
|
|
5435
|
+
};
|
|
5436
|
+
DrChatComponent.prototype.updateView = function () {
|
|
5437
|
+
if (this.scrollBottom) {
|
|
5438
|
+
this.scrollListBottom();
|
|
5439
|
+
}
|
|
5440
|
+
};
|
|
5441
|
+
DrChatComponent.prototype.scrollListBottom = function () {
|
|
5442
|
+
var _this = this;
|
|
5443
|
+
setTimeout(function () {
|
|
5444
|
+
_this.messagesContainer.nativeElement.scrollTo({ top: _this.messagesContainer.nativeElement.scrollHeight, behavior: 'smooth' });
|
|
5445
|
+
_this.cdr.markForCheck();
|
|
5446
|
+
});
|
|
5447
|
+
};
|
|
5448
|
+
return DrChatComponent;
|
|
5449
|
+
}());
|
|
5450
|
+
DrChatComponent.decorators = [
|
|
5451
|
+
{ type: i0.Component, args: [{
|
|
5452
|
+
selector: 'dr-chat',
|
|
5453
|
+
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",
|
|
5454
|
+
providers: [DrChatCustomMessageService],
|
|
5455
|
+
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"]
|
|
5456
|
+
},] }
|
|
5457
|
+
];
|
|
5458
|
+
DrChatComponent.ctorParameters = function () { return [
|
|
5459
|
+
{ type: i0.ChangeDetectorRef }
|
|
5460
|
+
]; };
|
|
5461
|
+
DrChatComponent.propDecorators = {
|
|
5462
|
+
title: [{ type: i0.Input }],
|
|
5463
|
+
noMessagesPlaceholder: [{ type: i0.Input }],
|
|
5464
|
+
scrollBottom: [{ type: i0.Input }],
|
|
5465
|
+
messagesContainer: [{ type: i0.ViewChild, args: ['messagesContainer',] }],
|
|
5466
|
+
messages: [{ type: i0.ContentChildren, args: [DrChatMessageComponent,] }],
|
|
5467
|
+
chatForm: [{ type: i0.ContentChild, args: [DrChatFormComponent,] }]
|
|
5468
|
+
};
|
|
5469
|
+
|
|
5470
|
+
/**
|
|
5471
|
+
* Chat text message component.
|
|
5472
|
+
*/
|
|
5473
|
+
var DrChatMessageTextComponent = /** @class */ (function () {
|
|
5474
|
+
function DrChatMessageTextComponent() {
|
|
5475
|
+
}
|
|
5476
|
+
return DrChatMessageTextComponent;
|
|
5477
|
+
}());
|
|
5478
|
+
DrChatMessageTextComponent.decorators = [
|
|
5479
|
+
{ type: i0.Component, args: [{
|
|
5480
|
+
selector: 'dr-chat-message-text',
|
|
5481
|
+
template: "<div class=\"text\" *ngIf=\"message\">{{ message.text }}</div>\n",
|
|
5482
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
5483
|
+
styles: [":host{display:flex}:host .text{display:flex;word-break:break-word}\n"]
|
|
5484
|
+
},] }
|
|
5485
|
+
];
|
|
5486
|
+
DrChatMessageTextComponent.propDecorators = {
|
|
5487
|
+
message: [{ type: i0.Input }]
|
|
5488
|
+
};
|
|
5489
|
+
|
|
5490
|
+
/**
|
|
5491
|
+
* Chat rich-text message component.
|
|
5492
|
+
*/
|
|
5493
|
+
var DrChatMessageRichTextComponent = /** @class */ (function () {
|
|
5494
|
+
function DrChatMessageRichTextComponent() {
|
|
5495
|
+
}
|
|
5496
|
+
return DrChatMessageRichTextComponent;
|
|
5497
|
+
}());
|
|
5498
|
+
DrChatMessageRichTextComponent.decorators = [
|
|
5499
|
+
{ type: i0.Component, args: [{
|
|
5500
|
+
selector: 'dr-chat-message-rich-text',
|
|
5501
|
+
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",
|
|
5502
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
5503
|
+
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"]
|
|
5504
|
+
},] }
|
|
5505
|
+
];
|
|
5506
|
+
DrChatMessageRichTextComponent.propDecorators = {
|
|
5507
|
+
message: [{ type: i0.Input }]
|
|
5508
|
+
};
|
|
5509
|
+
|
|
5510
|
+
/**
|
|
5511
|
+
* Chat message component.
|
|
5512
|
+
*/
|
|
5513
|
+
var DrChatMessageFileComponent = /** @class */ (function () {
|
|
5514
|
+
function DrChatMessageFileComponent(cd, domSanitizer) {
|
|
5515
|
+
this.cd = cd;
|
|
5516
|
+
this.domSanitizer = domSanitizer;
|
|
5517
|
+
}
|
|
5518
|
+
Object.defineProperty(DrChatMessageFileComponent.prototype, "files", {
|
|
5519
|
+
/**
|
|
5520
|
+
* Message file path
|
|
5521
|
+
*
|
|
5522
|
+
* @type {Date}
|
|
5523
|
+
*/
|
|
5524
|
+
set: function (files) {
|
|
5525
|
+
var _this = this;
|
|
5526
|
+
this.readyFiles = (files || []).map(function (file) {
|
|
5527
|
+
var isImage = _this.isImage(file);
|
|
5528
|
+
return Object.assign(Object.assign({}, file), { urlStyle: isImage && _this.domSanitizer.bypassSecurityTrustStyle("url(" + file.url + ")"), isImage: isImage });
|
|
5529
|
+
});
|
|
5530
|
+
this.cd.detectChanges();
|
|
5531
|
+
},
|
|
5532
|
+
enumerable: false,
|
|
5533
|
+
configurable: true
|
|
5534
|
+
});
|
|
5535
|
+
DrChatMessageFileComponent.prototype.isImage = function (file) {
|
|
5536
|
+
var type = file.type;
|
|
5537
|
+
if (type) {
|
|
5538
|
+
return IMAGE_TYPES.includes(type);
|
|
5539
|
+
}
|
|
5540
|
+
return false;
|
|
5541
|
+
};
|
|
5542
|
+
return DrChatMessageFileComponent;
|
|
5543
|
+
}());
|
|
5544
|
+
DrChatMessageFileComponent.decorators = [
|
|
5545
|
+
{ type: i0.Component, args: [{
|
|
5546
|
+
selector: 'dr-chat-message-file',
|
|
5547
|
+
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",
|
|
5548
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
5549
|
+
},] }
|
|
5550
|
+
];
|
|
5551
|
+
DrChatMessageFileComponent.ctorParameters = function () { return [
|
|
5552
|
+
{ type: i0.ChangeDetectorRef },
|
|
5553
|
+
{ type: platformBrowser.DomSanitizer }
|
|
5554
|
+
]; };
|
|
5555
|
+
DrChatMessageFileComponent.propDecorators = {
|
|
5556
|
+
message: [{ type: i0.Input }],
|
|
5557
|
+
files: [{ type: i0.Input }]
|
|
5558
|
+
};
|
|
5559
|
+
|
|
5560
|
+
var throwCustomMessageTypeIsRequired = function () {
|
|
5561
|
+
throw new Error('[drCustomMessage]: custom message type is required.');
|
|
5562
|
+
};
|
|
5563
|
+
var ɵ0 = throwCustomMessageTypeIsRequired;
|
|
5564
|
+
var DrChatCustomMessageDirective = /** @class */ (function () {
|
|
5565
|
+
function DrChatCustomMessageDirective(templateRef, customMessageService) {
|
|
5566
|
+
this.templateRef = templateRef;
|
|
5567
|
+
this.customMessageService = customMessageService;
|
|
5568
|
+
}
|
|
5569
|
+
Object.defineProperty(DrChatCustomMessageDirective.prototype, "drCustomMessage", {
|
|
5570
|
+
/**
|
|
5571
|
+
* Defines a message type which should rendered with the custom message template.
|
|
5572
|
+
*
|
|
5573
|
+
* @type {string}
|
|
5574
|
+
*/
|
|
5575
|
+
get: function () {
|
|
5576
|
+
return this._type;
|
|
5577
|
+
},
|
|
5578
|
+
set: function (value) {
|
|
5579
|
+
this._type = value;
|
|
5580
|
+
},
|
|
5581
|
+
enumerable: false,
|
|
5582
|
+
configurable: true
|
|
5583
|
+
});
|
|
5584
|
+
Object.defineProperty(DrChatCustomMessageDirective.prototype, "type", {
|
|
5585
|
+
get: function () {
|
|
5586
|
+
return this._type;
|
|
5587
|
+
},
|
|
5588
|
+
enumerable: false,
|
|
5589
|
+
configurable: true
|
|
5590
|
+
});
|
|
5591
|
+
DrChatCustomMessageDirective.prototype.ngOnInit = function () {
|
|
5592
|
+
if (!this._type) {
|
|
5593
|
+
throwCustomMessageTypeIsRequired();
|
|
5594
|
+
}
|
|
5595
|
+
this.customMessageService.register(this.type, this);
|
|
5596
|
+
};
|
|
5597
|
+
DrChatCustomMessageDirective.prototype.ngOnDestroy = function () {
|
|
5598
|
+
this.customMessageService.unregister(this.type);
|
|
5599
|
+
};
|
|
5600
|
+
return DrChatCustomMessageDirective;
|
|
5601
|
+
}());
|
|
5602
|
+
DrChatCustomMessageDirective.decorators = [
|
|
5603
|
+
{ type: i0.Directive, args: [{
|
|
5604
|
+
selector: "[drCustomMessage]",
|
|
5605
|
+
},] }
|
|
5606
|
+
];
|
|
5607
|
+
DrChatCustomMessageDirective.ctorParameters = function () { return [
|
|
5608
|
+
{ type: i0.TemplateRef },
|
|
5609
|
+
{ type: DrChatCustomMessageService }
|
|
5610
|
+
]; };
|
|
5611
|
+
DrChatCustomMessageDirective.propDecorators = {
|
|
5612
|
+
drCustomMessage: [{ type: i0.Input }]
|
|
5613
|
+
};
|
|
5614
|
+
|
|
5615
|
+
var DR_CHAT_COMPONENTS = [
|
|
5616
|
+
DrChatComponent,
|
|
5617
|
+
DrChatMessageComponent,
|
|
5618
|
+
DrChatFormComponent,
|
|
5619
|
+
DrChatMessageTextComponent,
|
|
5620
|
+
DrChatMessageFileComponent,
|
|
5621
|
+
DrChatMessageRichTextComponent,
|
|
5622
|
+
];
|
|
5623
|
+
var DR_CHAT_DIRECTIVES = [DrChatCustomMessageDirective];
|
|
5624
|
+
var DrChatModule = /** @class */ (function () {
|
|
5625
|
+
function DrChatModule() {
|
|
5626
|
+
}
|
|
5627
|
+
return DrChatModule;
|
|
5628
|
+
}());
|
|
5629
|
+
DrChatModule.decorators = [
|
|
5630
|
+
{ type: i0.NgModule, args: [{
|
|
5631
|
+
imports: [
|
|
5632
|
+
forms.FormsModule,
|
|
5633
|
+
forms.ReactiveFormsModule,
|
|
5634
|
+
common.CommonModule,
|
|
5635
|
+
DrAvatarModule,
|
|
5636
|
+
DrInputsModule
|
|
5637
|
+
],
|
|
5638
|
+
declarations: __spreadArray(__spreadArray([], __read(DR_CHAT_COMPONENTS)), __read(DR_CHAT_DIRECTIVES)),
|
|
5639
|
+
exports: __spreadArray(__spreadArray([], __read(DR_CHAT_COMPONENTS)), __read(DR_CHAT_DIRECTIVES)),
|
|
5640
|
+
},] }
|
|
5641
|
+
];
|
|
5642
|
+
|
|
4987
5643
|
/* components */
|
|
4988
5644
|
|
|
4989
5645
|
/**
|
|
@@ -4991,6 +5647,7 @@
|
|
|
4991
5647
|
*/
|
|
4992
5648
|
|
|
4993
5649
|
exports.AnyTagComponent = AnyTagComponent;
|
|
5650
|
+
exports.ChatMessage = ChatMessage;
|
|
4994
5651
|
exports.CheckboxComponent = CheckboxComponent;
|
|
4995
5652
|
exports.CustomDateFormat = CustomDateFormat;
|
|
4996
5653
|
exports.DateTagComponent = DateTagComponent;
|
|
@@ -5006,6 +5663,7 @@
|
|
|
5006
5663
|
exports.DrAvatarModule = DrAvatarModule;
|
|
5007
5664
|
exports.DrAvatarPipe = DrAvatarPipe;
|
|
5008
5665
|
exports.DrButtonComponent = DrButtonComponent;
|
|
5666
|
+
exports.DrChatModule = DrChatModule;
|
|
5009
5667
|
exports.DrDialogModule = DrDialogModule;
|
|
5010
5668
|
exports.DrDropdownComponent = DrDropdownComponent;
|
|
5011
5669
|
exports.DrDropdownDirective = DrDropdownDirective;
|
|
@@ -5043,6 +5701,7 @@
|
|
|
5043
5701
|
exports.DrTooltipDirective = DrTooltipDirective;
|
|
5044
5702
|
exports.DrTooltipModule = DrTooltipModule;
|
|
5045
5703
|
exports.ForecastTagComponent = ForecastTagComponent;
|
|
5704
|
+
exports.IMAGE_TYPES = IMAGE_TYPES;
|
|
5046
5705
|
exports.ListTagComponent = ListTagComponent;
|
|
5047
5706
|
exports.ListTagModule = ListTagModule;
|
|
5048
5707
|
exports.MonthTagComponent = MonthTagComponent;
|
|
@@ -5067,6 +5726,14 @@
|
|
|
5067
5726
|
exports["ɵm"] = StepperComponent;
|
|
5068
5727
|
exports["ɵn"] = DialogWrapperComponent;
|
|
5069
5728
|
exports["ɵo"] = DialogModalWrapperComponent;
|
|
5729
|
+
exports["ɵp"] = DrChatComponent;
|
|
5730
|
+
exports["ɵq"] = DrChatCustomMessageService;
|
|
5731
|
+
exports["ɵr"] = DrChatMessageComponent;
|
|
5732
|
+
exports["ɵs"] = DrChatFormComponent;
|
|
5733
|
+
exports["ɵt"] = DrChatMessageTextComponent;
|
|
5734
|
+
exports["ɵu"] = DrChatMessageFileComponent;
|
|
5735
|
+
exports["ɵv"] = DrChatMessageRichTextComponent;
|
|
5736
|
+
exports["ɵw"] = DrChatCustomMessageDirective;
|
|
5070
5737
|
|
|
5071
5738
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5072
5739
|
|