@datarailsshared/datarailsshared 1.4.94-dragons → 1.4.95
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 +19 -541
- package/bundles/datarailsshared-datarailsshared.umd.js.map +1 -1
- package/datarailsshared-datarailsshared-1.4.95.tgz +0 -0
- package/datarailsshared-datarailsshared.d.ts +0 -8
- package/datarailsshared-datarailsshared.metadata.json +1 -1
- package/esm2015/datarailsshared-datarailsshared.js +1 -9
- 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/public-api.js +1 -3
- package/fesm2015/datarailsshared-datarailsshared.js +16 -466
- package/fesm2015/datarailsshared-datarailsshared.js.map +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +0 -2
- package/datarailsshared-datarailsshared-1.4.94-dragons.tgz +0 -0
- package/esm2015/lib/dr-chat/chat.component.js +0 -58
- package/esm2015/lib/dr-chat/chat.module.js +0 -37
- package/esm2015/lib/dr-chat/dr-chat-form/chat-form.component.js +0 -128
- package/esm2015/lib/dr-chat/dr-chat-message/chat-message.component.js +0 -70
- package/esm2015/lib/dr-chat/dr-chat-message/dr-chat-message-custom/chat-custom-message.directive.js +0 -49
- package/esm2015/lib/dr-chat/dr-chat-message/dr-chat-message-custom/chat-custom-message.service.js +0 -23
- package/esm2015/lib/dr-chat/dr-chat-message/dr-chat-message-file/chat-message-file.component.js +0 -46
- package/esm2015/lib/dr-chat/dr-chat-message/dr-chat-message-rich-text/chat-message-rich-text.component.js +0 -18
- package/esm2015/lib/dr-chat/dr-chat-message/dr-chat-message-text/chat-message-text.component.js +0 -18
- package/esm2015/lib/models/chat.js +0 -32
- package/lib/dr-chat/chat.component.d.ts +0 -21
- package/lib/dr-chat/chat.module.d.ts +0 -2
- package/lib/dr-chat/dr-chat-form/chat-form.component.d.ts +0 -56
- package/lib/dr-chat/dr-chat-message/chat-message.component.d.ts +0 -38
- package/lib/dr-chat/dr-chat-message/dr-chat-message-custom/chat-custom-message.directive.d.ts +0 -18
- package/lib/dr-chat/dr-chat-message/dr-chat-message-custom/chat-custom-message.service.d.ts +0 -11
- package/lib/dr-chat/dr-chat-message/dr-chat-message-file/chat-message-file.component.d.ts +0 -25
- package/lib/dr-chat/dr-chat-message/dr-chat-message-rich-text/chat-message-rich-text.component.d.ts +0 -12
- package/lib/dr-chat/dr-chat-message/dr-chat-message-text/chat-message-text.component.d.ts +0 -12
- package/lib/models/chat.d.ts +0 -105
|
@@ -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'
|
|
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
|
|
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';
|
|
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$6 = 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$6 },
|
|
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$5 = 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$5 },
|
|
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$4 = 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$4 },
|
|
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$3 = 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$3 },
|
|
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\"
|
|
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",
|
|
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
|
|
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()\" 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,39 +3929,6 @@
|
|
|
3929
3929
|
CalendarView["FOR_YEARS"] = "multi-year";
|
|
3930
3930
|
})(exports.CalendarView || (exports.CalendarView = {}));
|
|
3931
3931
|
|
|
3932
|
-
exports.CHAT_MESSAGE_TYPE = void 0;
|
|
3933
|
-
(function (CHAT_MESSAGE_TYPE) {
|
|
3934
|
-
CHAT_MESSAGE_TYPE["TEXT"] = "text";
|
|
3935
|
-
CHAT_MESSAGE_TYPE["RICH_TEXT"] = "rich-text";
|
|
3936
|
-
CHAT_MESSAGE_TYPE["IMAGE"] = "image";
|
|
3937
|
-
CHAT_MESSAGE_TYPE["DOWNLOAD_FILE"] = "download-file";
|
|
3938
|
-
CHAT_MESSAGE_TYPE["MAILTO"] = "mailto";
|
|
3939
|
-
CHAT_MESSAGE_TYPE["EMBED"] = "embed";
|
|
3940
|
-
CHAT_MESSAGE_TYPE["WIDGET"] = "widget";
|
|
3941
|
-
CHAT_MESSAGE_TYPE["INPUT"] = "input";
|
|
3942
|
-
CHAT_MESSAGE_TYPE["CODE"] = "code";
|
|
3943
|
-
})(exports.CHAT_MESSAGE_TYPE || (exports.CHAT_MESSAGE_TYPE = {}));
|
|
3944
|
-
var ChatMessage = /** @class */ (function () {
|
|
3945
|
-
function ChatMessage(obj, user) {
|
|
3946
|
-
this.id = obj === null || obj === void 0 ? void 0 : obj.id;
|
|
3947
|
-
this.kind = obj === null || obj === void 0 ? void 0 : obj.kind;
|
|
3948
|
-
this.seq = obj === null || obj === void 0 ? void 0 : obj.seq;
|
|
3949
|
-
this.conversationId = obj === null || obj === void 0 ? void 0 : obj.conversationId;
|
|
3950
|
-
this.reply = (obj === null || obj === void 0 ? void 0 : obj.senderId) !== user.id;
|
|
3951
|
-
this.senderId = obj === null || obj === void 0 ? void 0 : obj.senderId;
|
|
3952
|
-
this.parentId = obj === null || obj === void 0 ? void 0 : obj.parentId;
|
|
3953
|
-
this.text = (obj === null || obj === void 0 ? void 0 : obj.text) || obj.body;
|
|
3954
|
-
this.paragraphs = obj === null || obj === void 0 ? void 0 : obj.paragraphs;
|
|
3955
|
-
this.url = obj === null || obj === void 0 ? void 0 : obj.url;
|
|
3956
|
-
this.label = obj === null || obj === void 0 ? void 0 : obj.label;
|
|
3957
|
-
this.subject = obj === null || obj === void 0 ? void 0 : obj.subject;
|
|
3958
|
-
this.body = obj === null || obj === void 0 ? void 0 : obj.body;
|
|
3959
|
-
this.form = obj === null || obj === void 0 ? void 0 : obj.form;
|
|
3960
|
-
this.parameters = obj === null || obj === void 0 ? void 0 : obj.parameters;
|
|
3961
|
-
}
|
|
3962
|
-
return ChatMessage;
|
|
3963
|
-
}());
|
|
3964
|
-
|
|
3965
3932
|
var components$3 = [DateTagComponent,
|
|
3966
3933
|
DayTagComponent,
|
|
3967
3934
|
WeekTagComponent,
|
|
@@ -3970,7 +3937,7 @@
|
|
|
3970
3937
|
AnyTagComponent,
|
|
3971
3938
|
YearTagComponent,
|
|
3972
3939
|
ForecastTagComponent];
|
|
3973
|
-
var ɵ0$
|
|
3940
|
+
var ɵ0$2 = { useUtc: true };
|
|
3974
3941
|
var DateTagModule = /** @class */ (function () {
|
|
3975
3942
|
function DateTagModule() {
|
|
3976
3943
|
}
|
|
@@ -3991,7 +3958,7 @@
|
|
|
3991
3958
|
],
|
|
3992
3959
|
exports: components$3,
|
|
3993
3960
|
providers: [
|
|
3994
|
-
{ provide: materialMomentAdapter.MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: ɵ0$
|
|
3961
|
+
{ provide: materialMomentAdapter.MAT_MOMENT_DATE_ADAPTER_OPTIONS, useValue: ɵ0$2 }
|
|
3995
3962
|
],
|
|
3996
3963
|
declarations: components$3,
|
|
3997
3964
|
},] }
|
|
@@ -4272,7 +4239,7 @@
|
|
|
4272
4239
|
var moment = require('moment');
|
|
4273
4240
|
var noop = function () {
|
|
4274
4241
|
};
|
|
4275
|
-
var ɵ0$
|
|
4242
|
+
var ɵ0$1 = noop;
|
|
4276
4243
|
var DrDatePickerComponent = /** @class */ (function () {
|
|
4277
4244
|
function DrDatePickerComponent(cdr, dateAdapter, datePickerService) {
|
|
4278
4245
|
var _this = this;
|
|
@@ -4992,7 +4959,7 @@
|
|
|
4992
4959
|
},] }
|
|
4993
4960
|
];
|
|
4994
4961
|
|
|
4995
|
-
var ɵ0
|
|
4962
|
+
var ɵ0 = {}, ɵ1 = {};
|
|
4996
4963
|
var DrDialogModule = /** @class */ (function () {
|
|
4997
4964
|
function DrDialogModule() {
|
|
4998
4965
|
}
|
|
@@ -5010,492 +4977,13 @@
|
|
|
5010
4977
|
],
|
|
5011
4978
|
exports: [DialogWrapperComponent, DialogModalWrapperComponent],
|
|
5012
4979
|
providers: [
|
|
5013
|
-
{ provide: i1$1.MatDialogRef, useValue: ɵ0
|
|
4980
|
+
{ provide: i1$1.MatDialogRef, useValue: ɵ0 },
|
|
5014
4981
|
{ provide: i1$1.MAT_DIALOG_DATA, useValue: ɵ1 },
|
|
5015
4982
|
DialogService
|
|
5016
4983
|
]
|
|
5017
4984
|
},] }
|
|
5018
4985
|
];
|
|
5019
4986
|
|
|
5020
|
-
var DrChatFormComponent = /** @class */ (function () {
|
|
5021
|
-
function DrChatFormComponent(cdr, domSanitizer) {
|
|
5022
|
-
this.cdr = cdr;
|
|
5023
|
-
this.domSanitizer = domSanitizer;
|
|
5024
|
-
this.inputFocus = false;
|
|
5025
|
-
this.inputHover = false;
|
|
5026
|
-
this.droppedFiles = [];
|
|
5027
|
-
this.imgDropTypes = ['image/png', 'image/jpeg', 'image/gif'];
|
|
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
|
-
// eslint-disable-next-line @angular-eslint/no-output-on-prefix
|
|
5063
|
-
this.onInputChange = new i0.EventEmitter();
|
|
5064
|
-
this.fileOver = false;
|
|
5065
|
-
}
|
|
5066
|
-
DrChatFormComponent.prototype.onDrop = function (event) {
|
|
5067
|
-
var e_1, _b;
|
|
5068
|
-
var _this = this;
|
|
5069
|
-
var _a;
|
|
5070
|
-
if (this.dropFiles) {
|
|
5071
|
-
event.preventDefault();
|
|
5072
|
-
event.stopPropagation();
|
|
5073
|
-
this.fileOver = false;
|
|
5074
|
-
if ((_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) {
|
|
5075
|
-
var _loop_1 = function (file) {
|
|
5076
|
-
var res = file;
|
|
5077
|
-
if (this_1.imgDropTypes.includes(file.type)) {
|
|
5078
|
-
var fr = new FileReader();
|
|
5079
|
-
fr.onload = function (e) {
|
|
5080
|
-
res.src = e.target.result;
|
|
5081
|
-
res.urlStyle = _this.domSanitizer.bypassSecurityTrustStyle("url(" + res.src + ")");
|
|
5082
|
-
_this.cdr.detectChanges();
|
|
5083
|
-
};
|
|
5084
|
-
fr.readAsDataURL(file);
|
|
5085
|
-
}
|
|
5086
|
-
this_1.droppedFiles.push(res);
|
|
5087
|
-
};
|
|
5088
|
-
var this_1 = this;
|
|
5089
|
-
try {
|
|
5090
|
-
for (var _c = __values(event.dataTransfer.files), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
5091
|
-
var file = _d.value;
|
|
5092
|
-
_loop_1(file);
|
|
5093
|
-
}
|
|
5094
|
-
}
|
|
5095
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
5096
|
-
finally {
|
|
5097
|
-
try {
|
|
5098
|
-
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
5099
|
-
}
|
|
5100
|
-
finally { if (e_1) throw e_1.error; }
|
|
5101
|
-
}
|
|
5102
|
-
}
|
|
5103
|
-
}
|
|
5104
|
-
};
|
|
5105
|
-
DrChatFormComponent.prototype.removeFile = function (file) {
|
|
5106
|
-
var index = this.droppedFiles.indexOf(file);
|
|
5107
|
-
if (index >= 0) {
|
|
5108
|
-
this.droppedFiles.splice(index, 1);
|
|
5109
|
-
}
|
|
5110
|
-
};
|
|
5111
|
-
DrChatFormComponent.prototype.onDragOver = function (event) {
|
|
5112
|
-
event.preventDefault();
|
|
5113
|
-
event.stopPropagation();
|
|
5114
|
-
if (this.dropFiles) {
|
|
5115
|
-
this.fileOver = true;
|
|
5116
|
-
}
|
|
5117
|
-
};
|
|
5118
|
-
DrChatFormComponent.prototype.onDragLeave = function (event) {
|
|
5119
|
-
event.preventDefault();
|
|
5120
|
-
event.stopPropagation();
|
|
5121
|
-
if (this.dropFiles) {
|
|
5122
|
-
this.fileOver = false;
|
|
5123
|
-
}
|
|
5124
|
-
};
|
|
5125
|
-
DrChatFormComponent.prototype.sendMessage = function () {
|
|
5126
|
-
if (this.droppedFiles.length || String(this.message).trim().length) {
|
|
5127
|
-
this.send.emit({ message: this.message, files: this.droppedFiles });
|
|
5128
|
-
this.message = '';
|
|
5129
|
-
this.droppedFiles = [];
|
|
5130
|
-
this.cdr.markForCheck();
|
|
5131
|
-
}
|
|
5132
|
-
};
|
|
5133
|
-
DrChatFormComponent.prototype.onModelChange = function (value) {
|
|
5134
|
-
this.onInputChange.emit(value);
|
|
5135
|
-
};
|
|
5136
|
-
return DrChatFormComponent;
|
|
5137
|
-
}());
|
|
5138
|
-
DrChatFormComponent.decorators = [
|
|
5139
|
-
{ type: i0.Component, args: [{
|
|
5140
|
-
selector: 'dr-chat-form',
|
|
5141
|
-
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",
|
|
5142
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
5143
|
-
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"]
|
|
5144
|
-
},] }
|
|
5145
|
-
];
|
|
5146
|
-
DrChatFormComponent.ctorParameters = function () { return [
|
|
5147
|
-
{ type: i0.ChangeDetectorRef },
|
|
5148
|
-
{ type: platformBrowser.DomSanitizer }
|
|
5149
|
-
]; };
|
|
5150
|
-
DrChatFormComponent.propDecorators = {
|
|
5151
|
-
message: [{ type: i0.Input }],
|
|
5152
|
-
messagePlaceholder: [{ type: i0.Input }],
|
|
5153
|
-
dropFiles: [{ type: i0.Input }],
|
|
5154
|
-
dropFilePlaceholder: [{ type: i0.Input }],
|
|
5155
|
-
send: [{ type: i0.Output }],
|
|
5156
|
-
onInputChange: [{ type: i0.Output }],
|
|
5157
|
-
fileOver: [{ type: i0.HostBinding, args: ['class.file-over',] }],
|
|
5158
|
-
onDrop: [{ type: i0.HostListener, args: ['drop', ['$event'],] }],
|
|
5159
|
-
onDragOver: [{ type: i0.HostListener, args: ['dragover', ['$event'],] }],
|
|
5160
|
-
onDragLeave: [{ type: i0.HostListener, args: ['dragleave', ['$event'],] }]
|
|
5161
|
-
};
|
|
5162
|
-
|
|
5163
|
-
/**
|
|
5164
|
-
* `DrCustomMessageService` is used to store instances of `DrChatCustomMessageDirective`s which
|
|
5165
|
-
* were provided in the chat component.
|
|
5166
|
-
*/
|
|
5167
|
-
var DrChatCustomMessageService = /** @class */ (function () {
|
|
5168
|
-
function DrChatCustomMessageService() {
|
|
5169
|
-
this.customMessages = new Map();
|
|
5170
|
-
}
|
|
5171
|
-
DrChatCustomMessageService.prototype.register = function (type, instance) {
|
|
5172
|
-
this.customMessages.set(type, instance);
|
|
5173
|
-
};
|
|
5174
|
-
DrChatCustomMessageService.prototype.unregister = function (type) {
|
|
5175
|
-
return this.customMessages.delete(type);
|
|
5176
|
-
};
|
|
5177
|
-
DrChatCustomMessageService.prototype.getInstance = function (type) {
|
|
5178
|
-
return this.customMessages.get(type);
|
|
5179
|
-
};
|
|
5180
|
-
return DrChatCustomMessageService;
|
|
5181
|
-
}());
|
|
5182
|
-
DrChatCustomMessageService.decorators = [
|
|
5183
|
-
{ type: i0.Injectable }
|
|
5184
|
-
];
|
|
5185
|
-
|
|
5186
|
-
var DrChatMessageComponent = /** @class */ (function () {
|
|
5187
|
-
function DrChatMessageComponent(customMessageService) {
|
|
5188
|
-
this.customMessageService = customMessageService;
|
|
5189
|
-
this.MESSAGE_TYPE = exports.CHAT_MESSAGE_TYPE;
|
|
5190
|
-
this.MESSAGE_TYPE_CUSTOM = exports.CHAT_MESSAGE_TYPE.EMBED;
|
|
5191
|
-
this._reply = false;
|
|
5192
|
-
}
|
|
5193
|
-
Object.defineProperty(DrChatMessageComponent.prototype, "flyInOut", {
|
|
5194
|
-
get: function () {
|
|
5195
|
-
return true;
|
|
5196
|
-
},
|
|
5197
|
-
enumerable: false,
|
|
5198
|
-
configurable: true
|
|
5199
|
-
});
|
|
5200
|
-
Object.defineProperty(DrChatMessageComponent.prototype, "notReply", {
|
|
5201
|
-
get: function () {
|
|
5202
|
-
return !this.reply;
|
|
5203
|
-
},
|
|
5204
|
-
enumerable: false,
|
|
5205
|
-
configurable: true
|
|
5206
|
-
});
|
|
5207
|
-
Object.defineProperty(DrChatMessageComponent.prototype, "reply", {
|
|
5208
|
-
/**
|
|
5209
|
-
* Determines if a message is a reply
|
|
5210
|
-
*/
|
|
5211
|
-
get: function () {
|
|
5212
|
-
return this._reply;
|
|
5213
|
-
},
|
|
5214
|
-
set: function (value) {
|
|
5215
|
-
this._reply = !!value;
|
|
5216
|
-
},
|
|
5217
|
-
enumerable: false,
|
|
5218
|
-
configurable: true
|
|
5219
|
-
});
|
|
5220
|
-
DrChatMessageComponent.prototype._getTemplate = function () {
|
|
5221
|
-
this.customMessage = true;
|
|
5222
|
-
var customMessage = this.getCustomMessage(this.type);
|
|
5223
|
-
return customMessage.templateRef;
|
|
5224
|
-
};
|
|
5225
|
-
DrChatMessageComponent.prototype._getTemplateContext = function () {
|
|
5226
|
-
return { $implicit: this.customMessageData, isReply: this.reply };
|
|
5227
|
-
};
|
|
5228
|
-
DrChatMessageComponent.prototype.getCustomMessage = function (type) {
|
|
5229
|
-
var customMessageDirective = this.customMessageService.getInstance(type);
|
|
5230
|
-
if (!customMessageDirective) {
|
|
5231
|
-
throw new Error("dr-chat: Can't find template for custom type '" + type + "'. " +
|
|
5232
|
-
("Make sure you provide it in the chat component with *drCustomMessage='" + type + "'."));
|
|
5233
|
-
}
|
|
5234
|
-
return customMessageDirective;
|
|
5235
|
-
};
|
|
5236
|
-
return DrChatMessageComponent;
|
|
5237
|
-
}());
|
|
5238
|
-
DrChatMessageComponent.decorators = [
|
|
5239
|
-
{ type: i0.Component, args: [{
|
|
5240
|
-
selector: 'dr-chat-message',
|
|
5241
|
-
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",
|
|
5242
|
-
animations: [
|
|
5243
|
-
animations.trigger('flyInOut', [
|
|
5244
|
-
animations.state('in', animations.style({ transform: 'translateX(0)' })),
|
|
5245
|
-
animations.transition('void => *', [animations.style({ transform: 'translateX(-100%)' }), animations.animate(80)]),
|
|
5246
|
-
animations.transition('* => void', [animations.animate(80, animations.style({ transform: 'translateX(100%)' }))]),
|
|
5247
|
-
]),
|
|
5248
|
-
],
|
|
5249
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
5250
|
-
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"]
|
|
5251
|
-
},] }
|
|
5252
|
-
];
|
|
5253
|
-
DrChatMessageComponent.ctorParameters = function () { return [
|
|
5254
|
-
{ type: DrChatCustomMessageService }
|
|
5255
|
-
]; };
|
|
5256
|
-
DrChatMessageComponent.propDecorators = {
|
|
5257
|
-
flyInOut: [{ type: i0.HostBinding, args: ['@flyInOut',] }],
|
|
5258
|
-
notReply: [{ type: i0.HostBinding, args: ['class.not-reply',] }],
|
|
5259
|
-
reply: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.reply',] }],
|
|
5260
|
-
type: [{ type: i0.Input }],
|
|
5261
|
-
message: [{ type: i0.Input }],
|
|
5262
|
-
customMessageData: [{ type: i0.Input }]
|
|
5263
|
-
};
|
|
5264
|
-
|
|
5265
|
-
var DrChatComponent = /** @class */ (function () {
|
|
5266
|
-
function DrChatComponent(cdr) {
|
|
5267
|
-
this.cdr = cdr;
|
|
5268
|
-
this.noMessagesPlaceholder = 'No messages yet.';
|
|
5269
|
-
this._scrollBottom = true;
|
|
5270
|
-
}
|
|
5271
|
-
Object.defineProperty(DrChatComponent.prototype, "scrollBottom", {
|
|
5272
|
-
/**
|
|
5273
|
-
* Scroll chat to the bottom of the list when a new message arrives
|
|
5274
|
-
*/
|
|
5275
|
-
get: function () {
|
|
5276
|
-
return this._scrollBottom;
|
|
5277
|
-
},
|
|
5278
|
-
set: function (value) {
|
|
5279
|
-
this._scrollBottom = !!value;
|
|
5280
|
-
},
|
|
5281
|
-
enumerable: false,
|
|
5282
|
-
configurable: true
|
|
5283
|
-
});
|
|
5284
|
-
DrChatComponent.prototype.ngAfterViewInit = function () {
|
|
5285
|
-
var _this = this;
|
|
5286
|
-
this.messages.changes.subscribe(function (messages) {
|
|
5287
|
-
_this.messages = messages;
|
|
5288
|
-
_this.updateView();
|
|
5289
|
-
});
|
|
5290
|
-
this.updateView();
|
|
5291
|
-
};
|
|
5292
|
-
DrChatComponent.prototype.updateView = function () {
|
|
5293
|
-
if (this.scrollBottom) {
|
|
5294
|
-
this.scrollListBottom();
|
|
5295
|
-
}
|
|
5296
|
-
};
|
|
5297
|
-
DrChatComponent.prototype.scrollListBottom = function () {
|
|
5298
|
-
var _this = this;
|
|
5299
|
-
setTimeout(function () {
|
|
5300
|
-
_this.messagesContainer.nativeElement.scrollTo({ top: _this.messagesContainer.nativeElement.scrollHeight, behavior: 'smooth' });
|
|
5301
|
-
_this.cdr.markForCheck();
|
|
5302
|
-
});
|
|
5303
|
-
};
|
|
5304
|
-
return DrChatComponent;
|
|
5305
|
-
}());
|
|
5306
|
-
DrChatComponent.decorators = [
|
|
5307
|
-
{ type: i0.Component, args: [{
|
|
5308
|
-
selector: 'dr-chat',
|
|
5309
|
-
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",
|
|
5310
|
-
providers: [DrChatCustomMessageService],
|
|
5311
|
-
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"]
|
|
5312
|
-
},] }
|
|
5313
|
-
];
|
|
5314
|
-
DrChatComponent.ctorParameters = function () { return [
|
|
5315
|
-
{ type: i0.ChangeDetectorRef }
|
|
5316
|
-
]; };
|
|
5317
|
-
DrChatComponent.propDecorators = {
|
|
5318
|
-
title: [{ type: i0.Input }],
|
|
5319
|
-
noMessagesPlaceholder: [{ type: i0.Input }],
|
|
5320
|
-
scrollBottom: [{ type: i0.Input }],
|
|
5321
|
-
messagesContainer: [{ type: i0.ViewChild, args: ['messagesContainer',] }],
|
|
5322
|
-
messages: [{ type: i0.ContentChildren, args: [DrChatMessageComponent,] }],
|
|
5323
|
-
chatForm: [{ type: i0.ContentChild, args: [DrChatFormComponent,] }]
|
|
5324
|
-
};
|
|
5325
|
-
|
|
5326
|
-
/**
|
|
5327
|
-
* Chat text message component.
|
|
5328
|
-
*/
|
|
5329
|
-
var DrChatMessageTextComponent = /** @class */ (function () {
|
|
5330
|
-
function DrChatMessageTextComponent() {
|
|
5331
|
-
}
|
|
5332
|
-
return DrChatMessageTextComponent;
|
|
5333
|
-
}());
|
|
5334
|
-
DrChatMessageTextComponent.decorators = [
|
|
5335
|
-
{ type: i0.Component, args: [{
|
|
5336
|
-
selector: 'dr-chat-message-text',
|
|
5337
|
-
template: "<div class=\"text\" *ngIf=\"message\">{{ message.text }}</div>\n",
|
|
5338
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
5339
|
-
styles: [":host{display:flex}:host .text{display:flex;word-break:break-word}\n"]
|
|
5340
|
-
},] }
|
|
5341
|
-
];
|
|
5342
|
-
DrChatMessageTextComponent.propDecorators = {
|
|
5343
|
-
message: [{ type: i0.Input }]
|
|
5344
|
-
};
|
|
5345
|
-
|
|
5346
|
-
/**
|
|
5347
|
-
* Chat rich-text message component.
|
|
5348
|
-
*/
|
|
5349
|
-
var DrChatMessageRichTextComponent = /** @class */ (function () {
|
|
5350
|
-
function DrChatMessageRichTextComponent() {
|
|
5351
|
-
}
|
|
5352
|
-
return DrChatMessageRichTextComponent;
|
|
5353
|
-
}());
|
|
5354
|
-
DrChatMessageRichTextComponent.decorators = [
|
|
5355
|
-
{ type: i0.Component, args: [{
|
|
5356
|
-
selector: 'dr-chat-message-rich-text',
|
|
5357
|
-
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",
|
|
5358
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
5359
|
-
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"]
|
|
5360
|
-
},] }
|
|
5361
|
-
];
|
|
5362
|
-
DrChatMessageRichTextComponent.propDecorators = {
|
|
5363
|
-
message: [{ type: i0.Input }]
|
|
5364
|
-
};
|
|
5365
|
-
|
|
5366
|
-
/**
|
|
5367
|
-
* Chat message component.
|
|
5368
|
-
*/
|
|
5369
|
-
var DrChatMessageFileComponent = /** @class */ (function () {
|
|
5370
|
-
function DrChatMessageFileComponent(cd, domSanitizer) {
|
|
5371
|
-
this.cd = cd;
|
|
5372
|
-
this.domSanitizer = domSanitizer;
|
|
5373
|
-
}
|
|
5374
|
-
Object.defineProperty(DrChatMessageFileComponent.prototype, "files", {
|
|
5375
|
-
/**
|
|
5376
|
-
* Message file path
|
|
5377
|
-
*
|
|
5378
|
-
* @type {Date}
|
|
5379
|
-
*/
|
|
5380
|
-
set: function (files) {
|
|
5381
|
-
var _this = this;
|
|
5382
|
-
this.readyFiles = (files || []).map(function (file) {
|
|
5383
|
-
var isImage = _this.isImage(file);
|
|
5384
|
-
return Object.assign(Object.assign({}, file), { urlStyle: isImage && _this.domSanitizer.bypassSecurityTrustStyle("url(" + file.url + ")"), isImage: isImage });
|
|
5385
|
-
});
|
|
5386
|
-
this.cd.detectChanges();
|
|
5387
|
-
},
|
|
5388
|
-
enumerable: false,
|
|
5389
|
-
configurable: true
|
|
5390
|
-
});
|
|
5391
|
-
DrChatMessageFileComponent.prototype.isImage = function (file) {
|
|
5392
|
-
var type = file.type;
|
|
5393
|
-
if (type) {
|
|
5394
|
-
return ['image/png', 'image/jpeg', 'image/gif'].includes(type);
|
|
5395
|
-
}
|
|
5396
|
-
return false;
|
|
5397
|
-
};
|
|
5398
|
-
return DrChatMessageFileComponent;
|
|
5399
|
-
}());
|
|
5400
|
-
DrChatMessageFileComponent.decorators = [
|
|
5401
|
-
{ type: i0.Component, args: [{
|
|
5402
|
-
selector: 'dr-chat-message-file',
|
|
5403
|
-
template: "<ng-container *ngIf=\"readyFiles?.length > 1\">\n <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</ng-container>\n\n<ng-container *ngIf=\"readyFiles?.length === 1\">\n <a [href]=\"readyFiles[0].url\" target=\"_blank\">\n <i class=\"dr-icon-file\" *ngIf=\"!readyFiles[0].urlStyle && readyFiles[0].icon\"></i>\n <div *ngIf=\"readyFiles[0].urlStyle\" [style.background-image]=\"readyFiles[0].urlStyle\"></div>\n </a>\n</ng-container>\n",
|
|
5404
|
-
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
5405
|
-
},] }
|
|
5406
|
-
];
|
|
5407
|
-
DrChatMessageFileComponent.ctorParameters = function () { return [
|
|
5408
|
-
{ type: i0.ChangeDetectorRef },
|
|
5409
|
-
{ type: platformBrowser.DomSanitizer }
|
|
5410
|
-
]; };
|
|
5411
|
-
DrChatMessageFileComponent.propDecorators = {
|
|
5412
|
-
message: [{ type: i0.Input }],
|
|
5413
|
-
files: [{ type: i0.Input }]
|
|
5414
|
-
};
|
|
5415
|
-
|
|
5416
|
-
var throwCustomMessageTypeIsRequired = function () {
|
|
5417
|
-
throw new Error('[drCustomMessage]: custom message type is required.');
|
|
5418
|
-
};
|
|
5419
|
-
var ɵ0 = throwCustomMessageTypeIsRequired;
|
|
5420
|
-
var DrChatCustomMessageDirective = /** @class */ (function () {
|
|
5421
|
-
function DrChatCustomMessageDirective(templateRef, customMessageService) {
|
|
5422
|
-
this.templateRef = templateRef;
|
|
5423
|
-
this.customMessageService = customMessageService;
|
|
5424
|
-
}
|
|
5425
|
-
Object.defineProperty(DrChatCustomMessageDirective.prototype, "drCustomMessage", {
|
|
5426
|
-
/**
|
|
5427
|
-
* Defines a message type which should rendered with the custom message template.
|
|
5428
|
-
*
|
|
5429
|
-
* @type {string}
|
|
5430
|
-
*/
|
|
5431
|
-
get: function () {
|
|
5432
|
-
return this._type;
|
|
5433
|
-
},
|
|
5434
|
-
set: function (value) {
|
|
5435
|
-
this._type = value;
|
|
5436
|
-
},
|
|
5437
|
-
enumerable: false,
|
|
5438
|
-
configurable: true
|
|
5439
|
-
});
|
|
5440
|
-
Object.defineProperty(DrChatCustomMessageDirective.prototype, "type", {
|
|
5441
|
-
get: function () {
|
|
5442
|
-
return this._type;
|
|
5443
|
-
},
|
|
5444
|
-
enumerable: false,
|
|
5445
|
-
configurable: true
|
|
5446
|
-
});
|
|
5447
|
-
DrChatCustomMessageDirective.prototype.ngOnInit = function () {
|
|
5448
|
-
if (!this._type) {
|
|
5449
|
-
throwCustomMessageTypeIsRequired();
|
|
5450
|
-
}
|
|
5451
|
-
this.customMessageService.register(this.type, this);
|
|
5452
|
-
};
|
|
5453
|
-
DrChatCustomMessageDirective.prototype.ngOnDestroy = function () {
|
|
5454
|
-
this.customMessageService.unregister(this.type);
|
|
5455
|
-
};
|
|
5456
|
-
return DrChatCustomMessageDirective;
|
|
5457
|
-
}());
|
|
5458
|
-
DrChatCustomMessageDirective.decorators = [
|
|
5459
|
-
{ type: i0.Directive, args: [{
|
|
5460
|
-
selector: "[drCustomMessage]",
|
|
5461
|
-
},] }
|
|
5462
|
-
];
|
|
5463
|
-
DrChatCustomMessageDirective.ctorParameters = function () { return [
|
|
5464
|
-
{ type: i0.TemplateRef },
|
|
5465
|
-
{ type: DrChatCustomMessageService }
|
|
5466
|
-
]; };
|
|
5467
|
-
DrChatCustomMessageDirective.propDecorators = {
|
|
5468
|
-
drCustomMessage: [{ type: i0.Input }]
|
|
5469
|
-
};
|
|
5470
|
-
|
|
5471
|
-
var DR_CHAT_COMPONENTS = [
|
|
5472
|
-
DrChatComponent,
|
|
5473
|
-
DrChatMessageComponent,
|
|
5474
|
-
DrChatFormComponent,
|
|
5475
|
-
DrChatMessageTextComponent,
|
|
5476
|
-
DrChatMessageFileComponent,
|
|
5477
|
-
DrChatMessageRichTextComponent,
|
|
5478
|
-
];
|
|
5479
|
-
var DR_CHAT_DIRECTIVES = [DrChatCustomMessageDirective];
|
|
5480
|
-
var DrChatModule = /** @class */ (function () {
|
|
5481
|
-
function DrChatModule() {
|
|
5482
|
-
}
|
|
5483
|
-
return DrChatModule;
|
|
5484
|
-
}());
|
|
5485
|
-
DrChatModule.decorators = [
|
|
5486
|
-
{ type: i0.NgModule, args: [{
|
|
5487
|
-
imports: [
|
|
5488
|
-
forms.FormsModule,
|
|
5489
|
-
forms.ReactiveFormsModule,
|
|
5490
|
-
common.CommonModule,
|
|
5491
|
-
DrAvatarModule,
|
|
5492
|
-
DrInputsModule
|
|
5493
|
-
],
|
|
5494
|
-
declarations: __spreadArray(__spreadArray([], __read(DR_CHAT_COMPONENTS)), __read(DR_CHAT_DIRECTIVES)),
|
|
5495
|
-
exports: __spreadArray(__spreadArray([], __read(DR_CHAT_COMPONENTS)), __read(DR_CHAT_DIRECTIVES)),
|
|
5496
|
-
},] }
|
|
5497
|
-
];
|
|
5498
|
-
|
|
5499
4987
|
/* components */
|
|
5500
4988
|
|
|
5501
4989
|
/**
|
|
@@ -5503,7 +4991,6 @@
|
|
|
5503
4991
|
*/
|
|
5504
4992
|
|
|
5505
4993
|
exports.AnyTagComponent = AnyTagComponent;
|
|
5506
|
-
exports.ChatMessage = ChatMessage;
|
|
5507
4994
|
exports.CheckboxComponent = CheckboxComponent;
|
|
5508
4995
|
exports.CustomDateFormat = CustomDateFormat;
|
|
5509
4996
|
exports.DateTagComponent = DateTagComponent;
|
|
@@ -5519,7 +5006,6 @@
|
|
|
5519
5006
|
exports.DrAvatarModule = DrAvatarModule;
|
|
5520
5007
|
exports.DrAvatarPipe = DrAvatarPipe;
|
|
5521
5008
|
exports.DrButtonComponent = DrButtonComponent;
|
|
5522
|
-
exports.DrChatModule = DrChatModule;
|
|
5523
5009
|
exports.DrDialogModule = DrDialogModule;
|
|
5524
5010
|
exports.DrDropdownComponent = DrDropdownComponent;
|
|
5525
5011
|
exports.DrDropdownDirective = DrDropdownDirective;
|
|
@@ -5581,14 +5067,6 @@
|
|
|
5581
5067
|
exports["ɵm"] = StepperComponent;
|
|
5582
5068
|
exports["ɵn"] = DialogWrapperComponent;
|
|
5583
5069
|
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;
|
|
5592
5070
|
|
|
5593
5071
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
5594
5072
|
|