@datarailsshared/datarailsshared 1.4.95 → 1.4.98
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 +541 -19
- package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
- package/datarailsshared-datarailsshared-1.4.98.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/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 +465 -16
- 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/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
|
},] }
|
|
@@ -4239,7 +4273,7 @@
|
|
|
4239
4273
|
var moment = require('moment');
|
|
4240
4274
|
var noop = function () {
|
|
4241
4275
|
};
|
|
4242
|
-
var ɵ0$
|
|
4276
|
+
var ɵ0$2 = noop;
|
|
4243
4277
|
var DrDatePickerComponent = /** @class */ (function () {
|
|
4244
4278
|
function DrDatePickerComponent(cdr, dateAdapter, datePickerService) {
|
|
4245
4279
|
var _this = this;
|
|
@@ -4959,7 +4993,7 @@
|
|
|
4959
4993
|
},] }
|
|
4960
4994
|
];
|
|
4961
4995
|
|
|
4962
|
-
var ɵ0 = {}, ɵ1 = {};
|
|
4996
|
+
var ɵ0$1 = {}, ɵ1 = {};
|
|
4963
4997
|
var DrDialogModule = /** @class */ (function () {
|
|
4964
4998
|
function DrDialogModule() {
|
|
4965
4999
|
}
|
|
@@ -4977,13 +5011,490 @@
|
|
|
4977
5011
|
],
|
|
4978
5012
|
exports: [DialogWrapperComponent, DialogModalWrapperComponent],
|
|
4979
5013
|
providers: [
|
|
4980
|
-
{ provide: i1$1.MatDialogRef, useValue: ɵ0 },
|
|
5014
|
+
{ provide: i1$1.MatDialogRef, useValue: ɵ0$1 },
|
|
4981
5015
|
{ provide: i1$1.MAT_DIALOG_DATA, useValue: ɵ1 },
|
|
4982
5016
|
DialogService
|
|
4983
5017
|
]
|
|
4984
5018
|
},] }
|
|
4985
5019
|
];
|
|
4986
5020
|
|
|
5021
|
+
var DrChatFormComponent = /** @class */ (function () {
|
|
5022
|
+
function DrChatFormComponent(cdr, domSanitizer) {
|
|
5023
|
+
this.cdr = cdr;
|
|
5024
|
+
this.domSanitizer = domSanitizer;
|
|
5025
|
+
this.inputFocus = false;
|
|
5026
|
+
this.inputHover = false;
|
|
5027
|
+
this.droppedFiles = [];
|
|
5028
|
+
/**
|
|
5029
|
+
* Predefined message text
|
|
5030
|
+
*
|
|
5031
|
+
* @type {string}
|
|
5032
|
+
*/
|
|
5033
|
+
this.message = '';
|
|
5034
|
+
/**
|
|
5035
|
+
* Message placeholder text
|
|
5036
|
+
*
|
|
5037
|
+
* @type {string}
|
|
5038
|
+
*/
|
|
5039
|
+
this.messagePlaceholder = 'Type a message';
|
|
5040
|
+
/**
|
|
5041
|
+
* Show send button
|
|
5042
|
+
*
|
|
5043
|
+
* @type {boolean}
|
|
5044
|
+
*/
|
|
5045
|
+
this.dropFiles = false;
|
|
5046
|
+
/**
|
|
5047
|
+
* File drop placeholder text
|
|
5048
|
+
*
|
|
5049
|
+
* @type {string}
|
|
5050
|
+
*/
|
|
5051
|
+
this.dropFilePlaceholder = 'Drop file to send';
|
|
5052
|
+
/**
|
|
5053
|
+
*
|
|
5054
|
+
* @type {EventEmitter<{ message: string, files: File[] }>}
|
|
5055
|
+
*/
|
|
5056
|
+
this.send = new i0.EventEmitter();
|
|
5057
|
+
/**
|
|
5058
|
+
* Emits when message input value has been changed
|
|
5059
|
+
*
|
|
5060
|
+
* @type {EventEmitter<string>}
|
|
5061
|
+
*/
|
|
5062
|
+
this.inputChange = new i0.EventEmitter();
|
|
5063
|
+
this.fileOver = false;
|
|
5064
|
+
}
|
|
5065
|
+
DrChatFormComponent.prototype.onDrop = function (event) {
|
|
5066
|
+
var e_1, _b;
|
|
5067
|
+
var _this = this;
|
|
5068
|
+
var _a;
|
|
5069
|
+
if (this.dropFiles) {
|
|
5070
|
+
event.preventDefault();
|
|
5071
|
+
event.stopPropagation();
|
|
5072
|
+
this.fileOver = false;
|
|
5073
|
+
if ((_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) {
|
|
5074
|
+
var _loop_1 = function (file) {
|
|
5075
|
+
var res = file;
|
|
5076
|
+
if (IMAGE_TYPES.includes(file.type)) {
|
|
5077
|
+
var fr = new FileReader();
|
|
5078
|
+
fr.onload = function (e) {
|
|
5079
|
+
res.src = e.target.result;
|
|
5080
|
+
res.urlStyle = _this.domSanitizer.bypassSecurityTrustStyle("url(" + res.src + ")");
|
|
5081
|
+
_this.cdr.detectChanges();
|
|
5082
|
+
};
|
|
5083
|
+
fr.readAsDataURL(file);
|
|
5084
|
+
}
|
|
5085
|
+
this_1.droppedFiles.push(res);
|
|
5086
|
+
};
|
|
5087
|
+
var this_1 = this;
|
|
5088
|
+
try {
|
|
5089
|
+
for (var _c = __values(event.dataTransfer.files), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
5090
|
+
var file = _d.value;
|
|
5091
|
+
_loop_1(file);
|
|
5092
|
+
}
|
|
5093
|
+
}
|
|
5094
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
5095
|
+
finally {
|
|
5096
|
+
try {
|
|
5097
|
+
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
5098
|
+
}
|
|
5099
|
+
finally { if (e_1) throw e_1.error; }
|
|
5100
|
+
}
|
|
5101
|
+
}
|
|
5102
|
+
}
|
|
5103
|
+
};
|
|
5104
|
+
DrChatFormComponent.prototype.removeFile = function (file) {
|
|
5105
|
+
var index = this.droppedFiles.indexOf(file);
|
|
5106
|
+
if (index >= 0) {
|
|
5107
|
+
this.droppedFiles.splice(index, 1);
|
|
5108
|
+
}
|
|
5109
|
+
};
|
|
5110
|
+
DrChatFormComponent.prototype.onDragOver = function (event) {
|
|
5111
|
+
event.preventDefault();
|
|
5112
|
+
event.stopPropagation();
|
|
5113
|
+
if (this.dropFiles) {
|
|
5114
|
+
this.fileOver = true;
|
|
5115
|
+
}
|
|
5116
|
+
};
|
|
5117
|
+
DrChatFormComponent.prototype.onDragLeave = function (event) {
|
|
5118
|
+
event.preventDefault();
|
|
5119
|
+
event.stopPropagation();
|
|
5120
|
+
if (this.dropFiles) {
|
|
5121
|
+
this.fileOver = false;
|
|
5122
|
+
}
|
|
5123
|
+
};
|
|
5124
|
+
DrChatFormComponent.prototype.sendMessage = function () {
|
|
5125
|
+
if (this.droppedFiles.length || String(this.message).trim().length) {
|
|
5126
|
+
this.send.emit({ message: this.message, files: this.droppedFiles });
|
|
5127
|
+
this.message = '';
|
|
5128
|
+
this.droppedFiles = [];
|
|
5129
|
+
this.cdr.markForCheck();
|
|
5130
|
+
}
|
|
5131
|
+
};
|
|
5132
|
+
DrChatFormComponent.prototype.onModelChange = function (value) {
|
|
5133
|
+
this.inputChange.emit(value);
|
|
5134
|
+
};
|
|
5135
|
+
return DrChatFormComponent;
|
|
5136
|
+
}());
|
|
5137
|
+
DrChatFormComponent.decorators = [
|
|
5138
|
+
{ type: i0.Component, args: [{
|
|
5139
|
+
selector: 'dr-chat-form',
|
|
5140
|
+
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",
|
|
5141
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
5142
|
+
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"]
|
|
5143
|
+
},] }
|
|
5144
|
+
];
|
|
5145
|
+
DrChatFormComponent.ctorParameters = function () { return [
|
|
5146
|
+
{ type: i0.ChangeDetectorRef },
|
|
5147
|
+
{ type: platformBrowser.DomSanitizer }
|
|
5148
|
+
]; };
|
|
5149
|
+
DrChatFormComponent.propDecorators = {
|
|
5150
|
+
message: [{ type: i0.Input }],
|
|
5151
|
+
messagePlaceholder: [{ type: i0.Input }],
|
|
5152
|
+
dropFiles: [{ type: i0.Input }],
|
|
5153
|
+
dropFilePlaceholder: [{ type: i0.Input }],
|
|
5154
|
+
send: [{ type: i0.Output }],
|
|
5155
|
+
inputChange: [{ type: i0.Output }],
|
|
5156
|
+
fileOver: [{ type: i0.HostBinding, args: ['class.file-over',] }],
|
|
5157
|
+
onDrop: [{ type: i0.HostListener, args: ['drop', ['$event'],] }],
|
|
5158
|
+
onDragOver: [{ type: i0.HostListener, args: ['dragover', ['$event'],] }],
|
|
5159
|
+
onDragLeave: [{ type: i0.HostListener, args: ['dragleave', ['$event'],] }]
|
|
5160
|
+
};
|
|
5161
|
+
|
|
5162
|
+
/**
|
|
5163
|
+
* `DrCustomMessageService` is used to store instances of `DrChatCustomMessageDirective`s which
|
|
5164
|
+
* were provided in the chat component.
|
|
5165
|
+
*/
|
|
5166
|
+
var DrChatCustomMessageService = /** @class */ (function () {
|
|
5167
|
+
function DrChatCustomMessageService() {
|
|
5168
|
+
this.customMessages = new Map();
|
|
5169
|
+
}
|
|
5170
|
+
DrChatCustomMessageService.prototype.register = function (type, instance) {
|
|
5171
|
+
this.customMessages.set(type, instance);
|
|
5172
|
+
};
|
|
5173
|
+
DrChatCustomMessageService.prototype.unregister = function (type) {
|
|
5174
|
+
return this.customMessages.delete(type);
|
|
5175
|
+
};
|
|
5176
|
+
DrChatCustomMessageService.prototype.getInstance = function (type) {
|
|
5177
|
+
return this.customMessages.get(type);
|
|
5178
|
+
};
|
|
5179
|
+
return DrChatCustomMessageService;
|
|
5180
|
+
}());
|
|
5181
|
+
DrChatCustomMessageService.decorators = [
|
|
5182
|
+
{ type: i0.Injectable }
|
|
5183
|
+
];
|
|
5184
|
+
|
|
5185
|
+
var DrChatMessageComponent = /** @class */ (function () {
|
|
5186
|
+
function DrChatMessageComponent(customMessageService) {
|
|
5187
|
+
this.customMessageService = customMessageService;
|
|
5188
|
+
this.MESSAGE_TYPE = exports.CHAT_MESSAGE_TYPE;
|
|
5189
|
+
this.MESSAGE_TYPE_CUSTOM = exports.CHAT_MESSAGE_TYPE.EMBED;
|
|
5190
|
+
this._reply = false;
|
|
5191
|
+
}
|
|
5192
|
+
Object.defineProperty(DrChatMessageComponent.prototype, "flyInOut", {
|
|
5193
|
+
get: function () {
|
|
5194
|
+
return true;
|
|
5195
|
+
},
|
|
5196
|
+
enumerable: false,
|
|
5197
|
+
configurable: true
|
|
5198
|
+
});
|
|
5199
|
+
Object.defineProperty(DrChatMessageComponent.prototype, "notReply", {
|
|
5200
|
+
get: function () {
|
|
5201
|
+
return !this.reply;
|
|
5202
|
+
},
|
|
5203
|
+
enumerable: false,
|
|
5204
|
+
configurable: true
|
|
5205
|
+
});
|
|
5206
|
+
Object.defineProperty(DrChatMessageComponent.prototype, "reply", {
|
|
5207
|
+
/**
|
|
5208
|
+
* Determines if a message is a reply
|
|
5209
|
+
*/
|
|
5210
|
+
get: function () {
|
|
5211
|
+
return this._reply;
|
|
5212
|
+
},
|
|
5213
|
+
set: function (value) {
|
|
5214
|
+
this._reply = !!value;
|
|
5215
|
+
},
|
|
5216
|
+
enumerable: false,
|
|
5217
|
+
configurable: true
|
|
5218
|
+
});
|
|
5219
|
+
DrChatMessageComponent.prototype.getTemplate = function () {
|
|
5220
|
+
this.customMessage = true;
|
|
5221
|
+
var customMessage = this.getCustomMessage(this.type);
|
|
5222
|
+
return customMessage.templateRef;
|
|
5223
|
+
};
|
|
5224
|
+
DrChatMessageComponent.prototype.getTemplateContext = function () {
|
|
5225
|
+
return { $implicit: this.customMessageData, isReply: this.reply };
|
|
5226
|
+
};
|
|
5227
|
+
DrChatMessageComponent.prototype.getCustomMessage = function (type) {
|
|
5228
|
+
var customMessageDirective = this.customMessageService.getInstance(type);
|
|
5229
|
+
if (!customMessageDirective) {
|
|
5230
|
+
throw new Error("dr-chat: Can't find template for custom type '" + type + "'. " +
|
|
5231
|
+
("Make sure you provide it in the chat component with *drCustomMessage='" + type + "'."));
|
|
5232
|
+
}
|
|
5233
|
+
return customMessageDirective;
|
|
5234
|
+
};
|
|
5235
|
+
return DrChatMessageComponent;
|
|
5236
|
+
}());
|
|
5237
|
+
DrChatMessageComponent.decorators = [
|
|
5238
|
+
{ type: i0.Component, args: [{
|
|
5239
|
+
selector: 'dr-chat-message',
|
|
5240
|
+
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",
|
|
5241
|
+
animations: [
|
|
5242
|
+
animations.trigger('flyInOut', [
|
|
5243
|
+
animations.state('in', animations.style({ transform: 'translateX(0)' })),
|
|
5244
|
+
animations.transition('void => *', [animations.style({ transform: 'translateX(-100%)' }), animations.animate(80)]),
|
|
5245
|
+
animations.transition('* => void', [animations.animate(80, animations.style({ transform: 'translateX(100%)' }))]),
|
|
5246
|
+
]),
|
|
5247
|
+
],
|
|
5248
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
5249
|
+
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"]
|
|
5250
|
+
},] }
|
|
5251
|
+
];
|
|
5252
|
+
DrChatMessageComponent.ctorParameters = function () { return [
|
|
5253
|
+
{ type: DrChatCustomMessageService }
|
|
5254
|
+
]; };
|
|
5255
|
+
DrChatMessageComponent.propDecorators = {
|
|
5256
|
+
flyInOut: [{ type: i0.HostBinding, args: ['@flyInOut',] }],
|
|
5257
|
+
notReply: [{ type: i0.HostBinding, args: ['class.not-reply',] }],
|
|
5258
|
+
reply: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.reply',] }],
|
|
5259
|
+
type: [{ type: i0.Input }],
|
|
5260
|
+
message: [{ type: i0.Input }],
|
|
5261
|
+
customMessageData: [{ type: i0.Input }]
|
|
5262
|
+
};
|
|
5263
|
+
|
|
5264
|
+
var DrChatComponent = /** @class */ (function () {
|
|
5265
|
+
function DrChatComponent(cdr) {
|
|
5266
|
+
this.cdr = cdr;
|
|
5267
|
+
this.noMessagesPlaceholder = 'No messages yet.';
|
|
5268
|
+
this._scrollBottom = true;
|
|
5269
|
+
}
|
|
5270
|
+
Object.defineProperty(DrChatComponent.prototype, "scrollBottom", {
|
|
5271
|
+
/**
|
|
5272
|
+
* Scroll chat to the bottom of the list when a new message arrives
|
|
5273
|
+
*/
|
|
5274
|
+
get: function () {
|
|
5275
|
+
return this._scrollBottom;
|
|
5276
|
+
},
|
|
5277
|
+
set: function (value) {
|
|
5278
|
+
this._scrollBottom = !!value;
|
|
5279
|
+
},
|
|
5280
|
+
enumerable: false,
|
|
5281
|
+
configurable: true
|
|
5282
|
+
});
|
|
5283
|
+
DrChatComponent.prototype.ngAfterViewInit = function () {
|
|
5284
|
+
var _this = this;
|
|
5285
|
+
this.messages.changes.subscribe(function (messages) {
|
|
5286
|
+
_this.messages = messages;
|
|
5287
|
+
_this.updateView();
|
|
5288
|
+
});
|
|
5289
|
+
this.updateView();
|
|
5290
|
+
};
|
|
5291
|
+
DrChatComponent.prototype.updateView = function () {
|
|
5292
|
+
if (this.scrollBottom) {
|
|
5293
|
+
this.scrollListBottom();
|
|
5294
|
+
}
|
|
5295
|
+
};
|
|
5296
|
+
DrChatComponent.prototype.scrollListBottom = function () {
|
|
5297
|
+
var _this = this;
|
|
5298
|
+
setTimeout(function () {
|
|
5299
|
+
_this.messagesContainer.nativeElement.scrollTo({ top: _this.messagesContainer.nativeElement.scrollHeight, behavior: 'smooth' });
|
|
5300
|
+
_this.cdr.markForCheck();
|
|
5301
|
+
});
|
|
5302
|
+
};
|
|
5303
|
+
return DrChatComponent;
|
|
5304
|
+
}());
|
|
5305
|
+
DrChatComponent.decorators = [
|
|
5306
|
+
{ type: i0.Component, args: [{
|
|
5307
|
+
selector: 'dr-chat',
|
|
5308
|
+
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",
|
|
5309
|
+
providers: [DrChatCustomMessageService],
|
|
5310
|
+
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"]
|
|
5311
|
+
},] }
|
|
5312
|
+
];
|
|
5313
|
+
DrChatComponent.ctorParameters = function () { return [
|
|
5314
|
+
{ type: i0.ChangeDetectorRef }
|
|
5315
|
+
]; };
|
|
5316
|
+
DrChatComponent.propDecorators = {
|
|
5317
|
+
title: [{ type: i0.Input }],
|
|
5318
|
+
noMessagesPlaceholder: [{ type: i0.Input }],
|
|
5319
|
+
scrollBottom: [{ type: i0.Input }],
|
|
5320
|
+
messagesContainer: [{ type: i0.ViewChild, args: ['messagesContainer',] }],
|
|
5321
|
+
messages: [{ type: i0.ContentChildren, args: [DrChatMessageComponent,] }],
|
|
5322
|
+
chatForm: [{ type: i0.ContentChild, args: [DrChatFormComponent,] }]
|
|
5323
|
+
};
|
|
5324
|
+
|
|
5325
|
+
/**
|
|
5326
|
+
* Chat text message component.
|
|
5327
|
+
*/
|
|
5328
|
+
var DrChatMessageTextComponent = /** @class */ (function () {
|
|
5329
|
+
function DrChatMessageTextComponent() {
|
|
5330
|
+
}
|
|
5331
|
+
return DrChatMessageTextComponent;
|
|
5332
|
+
}());
|
|
5333
|
+
DrChatMessageTextComponent.decorators = [
|
|
5334
|
+
{ type: i0.Component, args: [{
|
|
5335
|
+
selector: 'dr-chat-message-text',
|
|
5336
|
+
template: "<div class=\"text\" *ngIf=\"message\">{{ message.text }}</div>\n",
|
|
5337
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
5338
|
+
styles: [":host{display:flex}:host .text{display:flex;word-break:break-word}\n"]
|
|
5339
|
+
},] }
|
|
5340
|
+
];
|
|
5341
|
+
DrChatMessageTextComponent.propDecorators = {
|
|
5342
|
+
message: [{ type: i0.Input }]
|
|
5343
|
+
};
|
|
5344
|
+
|
|
5345
|
+
/**
|
|
5346
|
+
* Chat rich-text message component.
|
|
5347
|
+
*/
|
|
5348
|
+
var DrChatMessageRichTextComponent = /** @class */ (function () {
|
|
5349
|
+
function DrChatMessageRichTextComponent() {
|
|
5350
|
+
}
|
|
5351
|
+
return DrChatMessageRichTextComponent;
|
|
5352
|
+
}());
|
|
5353
|
+
DrChatMessageRichTextComponent.decorators = [
|
|
5354
|
+
{ type: i0.Component, args: [{
|
|
5355
|
+
selector: 'dr-chat-message-rich-text',
|
|
5356
|
+
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",
|
|
5357
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
5358
|
+
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"]
|
|
5359
|
+
},] }
|
|
5360
|
+
];
|
|
5361
|
+
DrChatMessageRichTextComponent.propDecorators = {
|
|
5362
|
+
message: [{ type: i0.Input }]
|
|
5363
|
+
};
|
|
5364
|
+
|
|
5365
|
+
/**
|
|
5366
|
+
* Chat message component.
|
|
5367
|
+
*/
|
|
5368
|
+
var DrChatMessageFileComponent = /** @class */ (function () {
|
|
5369
|
+
function DrChatMessageFileComponent(cd, domSanitizer) {
|
|
5370
|
+
this.cd = cd;
|
|
5371
|
+
this.domSanitizer = domSanitizer;
|
|
5372
|
+
}
|
|
5373
|
+
Object.defineProperty(DrChatMessageFileComponent.prototype, "files", {
|
|
5374
|
+
/**
|
|
5375
|
+
* Message file path
|
|
5376
|
+
*
|
|
5377
|
+
* @type {Date}
|
|
5378
|
+
*/
|
|
5379
|
+
set: function (files) {
|
|
5380
|
+
var _this = this;
|
|
5381
|
+
this.readyFiles = (files || []).map(function (file) {
|
|
5382
|
+
var isImage = _this.isImage(file);
|
|
5383
|
+
return Object.assign(Object.assign({}, file), { urlStyle: isImage && _this.domSanitizer.bypassSecurityTrustStyle("url(" + file.url + ")"), isImage: isImage });
|
|
5384
|
+
});
|
|
5385
|
+
this.cd.detectChanges();
|
|
5386
|
+
},
|
|
5387
|
+
enumerable: false,
|
|
5388
|
+
configurable: true
|
|
5389
|
+
});
|
|
5390
|
+
DrChatMessageFileComponent.prototype.isImage = function (file) {
|
|
5391
|
+
var type = file.type;
|
|
5392
|
+
if (type) {
|
|
5393
|
+
return IMAGE_TYPES.includes(type);
|
|
5394
|
+
}
|
|
5395
|
+
return false;
|
|
5396
|
+
};
|
|
5397
|
+
return DrChatMessageFileComponent;
|
|
5398
|
+
}());
|
|
5399
|
+
DrChatMessageFileComponent.decorators = [
|
|
5400
|
+
{ type: i0.Component, args: [{
|
|
5401
|
+
selector: 'dr-chat-message-file',
|
|
5402
|
+
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",
|
|
5403
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
5404
|
+
},] }
|
|
5405
|
+
];
|
|
5406
|
+
DrChatMessageFileComponent.ctorParameters = function () { return [
|
|
5407
|
+
{ type: i0.ChangeDetectorRef },
|
|
5408
|
+
{ type: platformBrowser.DomSanitizer }
|
|
5409
|
+
]; };
|
|
5410
|
+
DrChatMessageFileComponent.propDecorators = {
|
|
5411
|
+
message: [{ type: i0.Input }],
|
|
5412
|
+
files: [{ type: i0.Input }]
|
|
5413
|
+
};
|
|
5414
|
+
|
|
5415
|
+
var throwCustomMessageTypeIsRequired = function () {
|
|
5416
|
+
throw new Error('[drCustomMessage]: custom message type is required.');
|
|
5417
|
+
};
|
|
5418
|
+
var ɵ0 = throwCustomMessageTypeIsRequired;
|
|
5419
|
+
var DrChatCustomMessageDirective = /** @class */ (function () {
|
|
5420
|
+
function DrChatCustomMessageDirective(templateRef, customMessageService) {
|
|
5421
|
+
this.templateRef = templateRef;
|
|
5422
|
+
this.customMessageService = customMessageService;
|
|
5423
|
+
}
|
|
5424
|
+
Object.defineProperty(DrChatCustomMessageDirective.prototype, "drCustomMessage", {
|
|
5425
|
+
/**
|
|
5426
|
+
* Defines a message type which should rendered with the custom message template.
|
|
5427
|
+
*
|
|
5428
|
+
* @type {string}
|
|
5429
|
+
*/
|
|
5430
|
+
get: function () {
|
|
5431
|
+
return this._type;
|
|
5432
|
+
},
|
|
5433
|
+
set: function (value) {
|
|
5434
|
+
this._type = value;
|
|
5435
|
+
},
|
|
5436
|
+
enumerable: false,
|
|
5437
|
+
configurable: true
|
|
5438
|
+
});
|
|
5439
|
+
Object.defineProperty(DrChatCustomMessageDirective.prototype, "type", {
|
|
5440
|
+
get: function () {
|
|
5441
|
+
return this._type;
|
|
5442
|
+
},
|
|
5443
|
+
enumerable: false,
|
|
5444
|
+
configurable: true
|
|
5445
|
+
});
|
|
5446
|
+
DrChatCustomMessageDirective.prototype.ngOnInit = function () {
|
|
5447
|
+
if (!this._type) {
|
|
5448
|
+
throwCustomMessageTypeIsRequired();
|
|
5449
|
+
}
|
|
5450
|
+
this.customMessageService.register(this.type, this);
|
|
5451
|
+
};
|
|
5452
|
+
DrChatCustomMessageDirective.prototype.ngOnDestroy = function () {
|
|
5453
|
+
this.customMessageService.unregister(this.type);
|
|
5454
|
+
};
|
|
5455
|
+
return DrChatCustomMessageDirective;
|
|
5456
|
+
}());
|
|
5457
|
+
DrChatCustomMessageDirective.decorators = [
|
|
5458
|
+
{ type: i0.Directive, args: [{
|
|
5459
|
+
selector: "[drCustomMessage]",
|
|
5460
|
+
},] }
|
|
5461
|
+
];
|
|
5462
|
+
DrChatCustomMessageDirective.ctorParameters = function () { return [
|
|
5463
|
+
{ type: i0.TemplateRef },
|
|
5464
|
+
{ type: DrChatCustomMessageService }
|
|
5465
|
+
]; };
|
|
5466
|
+
DrChatCustomMessageDirective.propDecorators = {
|
|
5467
|
+
drCustomMessage: [{ type: i0.Input }]
|
|
5468
|
+
};
|
|
5469
|
+
|
|
5470
|
+
var DR_CHAT_COMPONENTS = [
|
|
5471
|
+
DrChatComponent,
|
|
5472
|
+
DrChatMessageComponent,
|
|
5473
|
+
DrChatFormComponent,
|
|
5474
|
+
DrChatMessageTextComponent,
|
|
5475
|
+
DrChatMessageFileComponent,
|
|
5476
|
+
DrChatMessageRichTextComponent,
|
|
5477
|
+
];
|
|
5478
|
+
var DR_CHAT_DIRECTIVES = [DrChatCustomMessageDirective];
|
|
5479
|
+
var DrChatModule = /** @class */ (function () {
|
|
5480
|
+
function DrChatModule() {
|
|
5481
|
+
}
|
|
5482
|
+
return DrChatModule;
|
|
5483
|
+
}());
|
|
5484
|
+
DrChatModule.decorators = [
|
|
5485
|
+
{ type: i0.NgModule, args: [{
|
|
5486
|
+
imports: [
|
|
5487
|
+
forms.FormsModule,
|
|
5488
|
+
forms.ReactiveFormsModule,
|
|
5489
|
+
common.CommonModule,
|
|
5490
|
+
DrAvatarModule,
|
|
5491
|
+
DrInputsModule
|
|
5492
|
+
],
|
|
5493
|
+
declarations: __spreadArray(__spreadArray([], __read(DR_CHAT_COMPONENTS)), __read(DR_CHAT_DIRECTIVES)),
|
|
5494
|
+
exports: __spreadArray(__spreadArray([], __read(DR_CHAT_COMPONENTS)), __read(DR_CHAT_DIRECTIVES)),
|
|
5495
|
+
},] }
|
|
5496
|
+
];
|
|
5497
|
+
|
|
4987
5498
|
/* components */
|
|
4988
5499
|
|
|
4989
5500
|
/**
|
|
@@ -4991,6 +5502,7 @@
|
|
|
4991
5502
|
*/
|
|
4992
5503
|
|
|
4993
5504
|
exports.AnyTagComponent = AnyTagComponent;
|
|
5505
|
+
exports.ChatMessage = ChatMessage;
|
|
4994
5506
|
exports.CheckboxComponent = CheckboxComponent;
|
|
4995
5507
|
exports.CustomDateFormat = CustomDateFormat;
|
|
4996
5508
|
exports.DateTagComponent = DateTagComponent;
|
|
@@ -5006,6 +5518,7 @@
|
|
|
5006
5518
|
exports.DrAvatarModule = DrAvatarModule;
|
|
5007
5519
|
exports.DrAvatarPipe = DrAvatarPipe;
|
|
5008
5520
|
exports.DrButtonComponent = DrButtonComponent;
|
|
5521
|
+
exports.DrChatModule = DrChatModule;
|
|
5009
5522
|
exports.DrDialogModule = DrDialogModule;
|
|
5010
5523
|
exports.DrDropdownComponent = DrDropdownComponent;
|
|
5011
5524
|
exports.DrDropdownDirective = DrDropdownDirective;
|
|
@@ -5043,6 +5556,7 @@
|
|
|
5043
5556
|
exports.DrTooltipDirective = DrTooltipDirective;
|
|
5044
5557
|
exports.DrTooltipModule = DrTooltipModule;
|
|
5045
5558
|
exports.ForecastTagComponent = ForecastTagComponent;
|
|
5559
|
+
exports.IMAGE_TYPES = IMAGE_TYPES;
|
|
5046
5560
|
exports.ListTagComponent = ListTagComponent;
|
|
5047
5561
|
exports.ListTagModule = ListTagModule;
|
|
5048
5562
|
exports.MonthTagComponent = MonthTagComponent;
|
|
@@ -5067,6 +5581,14 @@
|
|
|
5067
5581
|
exports["ɵm"] = StepperComponent;
|
|
5068
5582
|
exports["ɵn"] = DialogWrapperComponent;
|
|
5069
5583
|
exports["ɵo"] = DialogModalWrapperComponent;
|
|
5584
|
+
exports["ɵp"] = DrChatComponent;
|
|
5585
|
+
exports["ɵq"] = DrChatCustomMessageService;
|
|
5586
|
+
exports["ɵr"] = DrChatMessageComponent;
|
|
5587
|
+
exports["ɵs"] = DrChatFormComponent;
|
|
5588
|
+
exports["ɵt"] = DrChatMessageTextComponent;
|
|
5589
|
+
exports["ɵu"] = DrChatMessageFileComponent;
|
|
5590
|
+
exports["ɵv"] = DrChatMessageRichTextComponent;
|
|
5591
|
+
exports["ɵw"] = DrChatCustomMessageDirective;
|
|
5070
5592
|
|
|
5071
5593
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5072
5594
|
|