@datarailsshared/datarailsshared 1.6.214 → 1.6.218

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.
@@ -1745,6 +1745,10 @@ class DrSelectComponent {
1745
1745
  }
1746
1746
  this.onChange(selectedItem);
1747
1747
  this.change.emit(selectedItem);
1748
+ this.ngSelect.blur();
1749
+ if (this.searchable) {
1750
+ this.ngSelect.searchInput.nativeElement.blur();
1751
+ }
1748
1752
  }
1749
1753
  onTabKeypress(e) {
1750
1754
  if (this.selectOnTabKeyPress && this.ngSelect) {
@@ -4086,7 +4090,7 @@ const _c0$H = ["dynamicInputRef"];
4086
4090
  function DrSelectAddItemComponent_div_1_Template(rf, ctx) { if (rf & 1) {
4087
4091
  const _r3 = i0.ɵɵgetCurrentView();
4088
4092
  i0.ɵɵelementStart(0, "div", 3);
4089
- i0.ɵɵlistener("click", function DrSelectAddItemComponent_div_1_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.onDynamicAdding()); });
4093
+ i0.ɵɵlistener("click", function DrSelectAddItemComponent_div_1_Template_div_click_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r2 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r2.instantAddValue ? ctx_r2.onDynamicAdd(ctx_r2.instantAddValue) : ctx_r2.onDynamicAdding()); });
4090
4094
  i0.ɵɵelement(1, "i", 4);
4091
4095
  i0.ɵɵelementStart(2, "p", 5);
4092
4096
  i0.ɵɵtext(3);
@@ -4145,6 +4149,7 @@ class DrSelectAddItemComponent {
4145
4149
  this.dynamicAddLabel = 'Add new';
4146
4150
  this.values = [];
4147
4151
  this.showOnlyInput = false;
4152
+ this.instantAddValue = '';
4148
4153
  this.dynamicValueAdded = new EventEmitter();
4149
4154
  }
4150
4155
  ngOnChanges(changes) {
@@ -4168,6 +4173,9 @@ class DrSelectAddItemComponent {
4168
4173
  }
4169
4174
  onDynamicAdd(value, keydownEvent) {
4170
4175
  this.isDirty = true;
4176
+ if (this.instantAddValue) {
4177
+ this.dynamicValue = this.instantAddValue;
4178
+ }
4171
4179
  if (!this.isDynamicValueValid())
4172
4180
  return;
4173
4181
  if (keydownEvent && keydownEvent.key !== 'Enter')
@@ -4190,7 +4198,7 @@ class DrSelectAddItemComponent {
4190
4198
  } if (rf & 2) {
4191
4199
  let _t;
4192
4200
  i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.inputRef = _t.first);
4193
- } }, inputs: { dynamicAddLabel: "dynamicAddLabel", bindValue: "bindValue", values: "values", alertMsg: "alertMsg", showOnlyInput: "showOnlyInput" }, outputs: { dynamicValueAdded: "dynamicValueAdded" }, features: [i0.ɵɵNgOnChangesFeature], decls: 3, vars: 2, consts: [[1, "dr-select__dynamic-add", "dynamic-add"], ["class", "dynamic-add__add-item", 3, "click", 4, "ngIf"], ["class", "dynamic-add__field", 4, "ngIf"], [1, "dynamic-add__add-item", 3, "click"], [1, "dr-icon-add"], [1, "dynamic-add__add-item__text"], [1, "dynamic-add__field"], ["class", "dynamic-add__field__alert", 4, "ngIf"], ["placeholder", "Type...", 1, "dynamic-add__field__input", 3, "ngModel", "ngModelChange", "keydown"], ["dynamicInputRef", ""], [1, "dynamic-add__field__buttons"], ["theme", "icon", "icon", "dr-icon-approve", "iconSize", "18px", 3, "click", 4, "ngIf"], ["theme", "icon", "icon", "dr-icon-exit", "iconSize", "18px", 3, "click"], [1, "dynamic-add__field__alert"], ["theme", "icon", "icon", "dr-icon-approve", "iconSize", "18px", 3, "click"]], template: function DrSelectAddItemComponent_Template(rf, ctx) { if (rf & 1) {
4201
+ } }, inputs: { dynamicAddLabel: "dynamicAddLabel", bindValue: "bindValue", values: "values", alertMsg: "alertMsg", showOnlyInput: "showOnlyInput", instantAddValue: "instantAddValue" }, outputs: { dynamicValueAdded: "dynamicValueAdded" }, features: [i0.ɵɵNgOnChangesFeature], decls: 3, vars: 2, consts: [[1, "dr-select__dynamic-add", "dynamic-add"], ["class", "dynamic-add__add-item", 3, "click", 4, "ngIf"], ["class", "dynamic-add__field", 4, "ngIf"], [1, "dynamic-add__add-item", 3, "click"], [1, "dr-icon-add"], [1, "dynamic-add__add-item__text"], [1, "dynamic-add__field"], ["class", "dynamic-add__field__alert", 4, "ngIf"], ["placeholder", "Type...", 1, "dynamic-add__field__input", 3, "ngModel", "ngModelChange", "keydown"], ["dynamicInputRef", ""], [1, "dynamic-add__field__buttons"], ["theme", "icon", "icon", "dr-icon-approve", "iconSize", "18px", 3, "click", 4, "ngIf"], ["theme", "icon", "icon", "dr-icon-exit", "iconSize", "18px", 3, "click"], [1, "dynamic-add__field__alert"], ["theme", "icon", "icon", "dr-icon-approve", "iconSize", "18px", 3, "click"]], template: function DrSelectAddItemComponent_Template(rf, ctx) { if (rf & 1) {
4194
4202
  i0.ɵɵelementStart(0, "div", 0);
4195
4203
  i0.ɵɵtemplate(1, DrSelectAddItemComponent_div_1_Template, 4, 1, "div", 1);
4196
4204
  i0.ɵɵtemplate(2, DrSelectAddItemComponent_div_2_Template, 7, 5, "div", 2);
@@ -4204,7 +4212,7 @@ class DrSelectAddItemComponent {
4204
4212
  }
4205
4213
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DrSelectAddItemComponent, [{
4206
4214
  type: Component,
4207
- args: [{ selector: 'dr-select-add-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"dr-select__dynamic-add dynamic-add\">\n <div *ngIf=\"!(showOnlyInput && isDynamicAdding)\" class=\"dynamic-add__add-item\" (click)=\"onDynamicAdding()\">\n <i class=\"dr-icon-add\"></i>\n <p class=\"dynamic-add__add-item__text\">{{ dynamicAddLabel }}</p>\n </div>\n <div *ngIf=\"isDynamicAdding\" class=\"dynamic-add__field\">\n <p *ngIf=\"alertMsg && !isDynamicValueValid() && isDirty\" class=\"dynamic-add__field__alert\">{{ alertMsg }}</p>\n <dr-input\n #dynamicInputRef\n class=\"dynamic-add__field__input\"\n [class.dynamic-add__field__input--error]=\"!isDynamicValueValid() && isDirty\"\n [(ngModel)]=\"dynamicValue\"\n (keydown)=\"onDynamicAdd(dynamicValue, $event)\"\n placeholder=\"Type...\"></dr-input>\n <div class=\"dynamic-add__field__buttons\">\n <dr-button\n *ngIf=\"dynamicValue && isDynamicValueValid()\"\n theme=\"icon\"\n icon=\"dr-icon-approve\"\n iconSize=\"18px\"\n (click)=\"onDynamicAdd(dynamicValue)\"></dr-button>\n <dr-button theme=\"icon\" icon=\"dr-icon-exit\" iconSize=\"18px\" (click)=\"onDynamicAddingClose()\"></dr-button>\n </div>\n </div>\n</div>\n", styles: [".dynamic-add__add-item{cursor:pointer;display:flex;align-items:center;border-bottom:1px solid #dfe0e3;padding:6px}.dynamic-add__add-item:hover{background:#f9f7ff}.dynamic-add__add-item__text{font-size:14px;line-height:22px;margin:0;color:#6d6e6f}.dynamic-add__add-item .dr-icon-add{color:#6d6e6f}.dynamic-add__field{position:relative}.dynamic-add__field__buttons{position:absolute;top:0;right:0;bottom:0;display:flex;align-items:center}.dynamic-add__field__alert{font-size:12px;position:absolute;color:#bf1d30;z-index:100;right:30px}::ng-deep .ng-dropdown-panel .ng-dropdown-footer:has(.dynamic-add),::ng-deep .ng-dropdown-panel .ng-dropdown-header:has(.dynamic-add){padding:0;border:none}::ng-deep .ng-dropdown-panel .ng-dropdown-footer .dynamic-add__add-item{border-bottom:none}::ng-deep .dynamic-add__field__input{padding-left:12px!important;height:36px!important;border:none!important;background:#f9f7ff!important;border-radius:0!important}::ng-deep .dynamic-add__field__input>input{background:#f9f7ff}::ng-deep .dynamic-add__field__input>input::placeholder{line-height:22px;font-size:14px;font-weight:400;color:#9ea1aa}::ng-deep .dynamic-add__field__input--error{background:#ffdfe4!important}::ng-deep .dynamic-add__field__input--error>input{background:#ffdfe4}\n"] }]
4215
+ args: [{ selector: 'dr-select-add-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"dr-select__dynamic-add dynamic-add\">\n <div\n *ngIf=\"!(showOnlyInput && isDynamicAdding)\"\n class=\"dynamic-add__add-item\"\n (click)=\"instantAddValue ? onDynamicAdd(instantAddValue) : onDynamicAdding()\">\n <i class=\"dr-icon-add\"></i>\n <p class=\"dynamic-add__add-item__text\">{{ dynamicAddLabel }}</p>\n </div>\n <div *ngIf=\"isDynamicAdding\" class=\"dynamic-add__field\">\n <p *ngIf=\"alertMsg && !isDynamicValueValid() && isDirty\" class=\"dynamic-add__field__alert\">{{ alertMsg }}</p>\n <dr-input\n #dynamicInputRef\n class=\"dynamic-add__field__input\"\n [class.dynamic-add__field__input--error]=\"!isDynamicValueValid() && isDirty\"\n [(ngModel)]=\"dynamicValue\"\n (keydown)=\"onDynamicAdd(dynamicValue, $event)\"\n placeholder=\"Type...\"></dr-input>\n <div class=\"dynamic-add__field__buttons\">\n <dr-button\n *ngIf=\"dynamicValue && isDynamicValueValid()\"\n theme=\"icon\"\n icon=\"dr-icon-approve\"\n iconSize=\"18px\"\n (click)=\"onDynamicAdd(dynamicValue)\"></dr-button>\n <dr-button theme=\"icon\" icon=\"dr-icon-exit\" iconSize=\"18px\" (click)=\"onDynamicAddingClose()\"></dr-button>\n </div>\n </div>\n</div>\n", styles: [".dynamic-add__add-item{cursor:pointer;display:flex;align-items:center;border-bottom:1px solid #dfe0e3;padding:6px}.dynamic-add__add-item:hover{background:#f9f7ff}.dynamic-add__add-item__text{font-size:14px;line-height:22px;margin:0;color:#6d6e6f}.dynamic-add__add-item .dr-icon-add{color:#6d6e6f}.dynamic-add__field{position:relative}.dynamic-add__field__buttons{position:absolute;top:0;right:0;bottom:0;display:flex;align-items:center}.dynamic-add__field__alert{font-size:12px;position:absolute;color:#bf1d30;z-index:100;right:30px}::ng-deep .ng-dropdown-panel .ng-dropdown-footer:has(.dynamic-add),::ng-deep .ng-dropdown-panel .ng-dropdown-header:has(.dynamic-add){padding:0;border:none}::ng-deep .ng-dropdown-panel .ng-dropdown-footer .dynamic-add__add-item{border-bottom:none}::ng-deep .dynamic-add__field__input{padding-left:12px!important;height:36px!important;border:none!important;background:#f9f7ff!important;border-radius:0!important}::ng-deep .dynamic-add__field__input>input{background:#f9f7ff}::ng-deep .dynamic-add__field__input>input::placeholder{line-height:22px;font-size:14px;font-weight:400;color:#9ea1aa}::ng-deep .dynamic-add__field__input--error{background:#ffdfe4!important}::ng-deep .dynamic-add__field__input--error>input{background:#ffdfe4}\n"] }]
4208
4216
  }], function () { return [{ type: DrSelectComponent }]; }, { dynamicAddLabel: [{
4209
4217
  type: Input
4210
4218
  }], bindValue: [{
@@ -4215,6 +4223,8 @@ class DrSelectAddItemComponent {
4215
4223
  type: Input
4216
4224
  }], showOnlyInput: [{
4217
4225
  type: Input
4226
+ }], instantAddValue: [{
4227
+ type: Input
4218
4228
  }], dynamicValueAdded: [{
4219
4229
  type: Output
4220
4230
  }], inputRef: [{
@@ -8115,6 +8125,7 @@ class DrChatFormDropdownComponent {
8115
8125
  this.send = new EventEmitter();
8116
8126
  this.uploadFiles = new EventEmitter();
8117
8127
  this.abort = new EventEmitter();
8128
+ this.filesRejected = new EventEmitter();
8118
8129
  /**
8119
8130
  * Emits when message input value has been changed
8120
8131
  *
@@ -8130,7 +8141,7 @@ class DrChatFormDropdownComponent {
8130
8141
  this.fileOver = false;
8131
8142
  const files = event.dataTransfer?.files;
8132
8143
  if (files) {
8133
- this.saveFiles(files);
8144
+ this.saveFiles(Array.from(files));
8134
8145
  }
8135
8146
  }
8136
8147
  }
@@ -8200,15 +8211,59 @@ class DrChatFormDropdownComponent {
8200
8211
  }
8201
8212
  async saveFiles(files) {
8202
8213
  const uploadedFiles = [];
8214
+ const tooLargeFiles = [];
8215
+ const unsupportedFiles = [];
8216
+ const allowedExtensions = this.getAllowedExtensions();
8217
+ let maxExceeded = false;
8218
+ const remainingSlotsInit = Math.max(0, this.maxFilesCount - this.droppedFiles$.value.length);
8219
+ if (files.length > remainingSlotsInit) {
8220
+ this.filesRejected.emit({ oversize: [], unsupported: [], maxExceeded: true });
8221
+ return;
8222
+ }
8223
+ let remainingSlots = remainingSlotsInit;
8203
8224
  for (const file of files) {
8204
- let res = file;
8225
+ if (remainingSlots <= 0) {
8226
+ maxExceeded = true;
8227
+ continue;
8228
+ }
8229
+ const fileExtension = this.getFileExtension(file.name);
8230
+ const isAllowedByType = !allowedExtensions || allowedExtensions.has(fileExtension);
8231
+ if (!isAllowedByType) {
8232
+ unsupportedFiles.push(file.name);
8233
+ continue;
8234
+ }
8235
+ if (file.size > this.maxFileSizeBytes) {
8236
+ tooLargeFiles.push(file.name);
8237
+ continue;
8238
+ }
8239
+ const res = file;
8205
8240
  res.data = (await this.base64Convert(res));
8206
8241
  this.droppedFiles$.next([...this.droppedFiles$.value, res]);
8207
8242
  uploadedFiles.push(res);
8243
+ remainingSlots--;
8208
8244
  this.cdr.markForCheck();
8209
8245
  this.cdr.detectChanges();
8210
8246
  }
8211
- this.uploadFiles.emit(uploadedFiles.map((item) => ({ data: item.data, name: item.name })));
8247
+ if (tooLargeFiles.length || unsupportedFiles.length || maxExceeded) {
8248
+ this.filesRejected.emit({ oversize: tooLargeFiles, unsupported: unsupportedFiles, maxExceeded });
8249
+ }
8250
+ if (uploadedFiles.length) {
8251
+ this.uploadFiles.emit(uploadedFiles.map((item) => ({ data: item.data, name: item.name })));
8252
+ }
8253
+ }
8254
+ getAllowedExtensions() {
8255
+ if (!this.acceptFormatFiles || !this.acceptFormatFiles.trim())
8256
+ return null;
8257
+ const parts = this.acceptFormatFiles
8258
+ .split(',')
8259
+ .map((p) => p.trim().toLowerCase())
8260
+ .filter(Boolean)
8261
+ .map((p) => (p.startsWith('.') ? p.slice(1) : p));
8262
+ return parts.length ? new Set(parts) : null;
8263
+ }
8264
+ getFileExtension(fileName) {
8265
+ const idx = fileName.lastIndexOf('.');
8266
+ return idx >= 0 ? fileName.slice(idx + 1).toLowerCase() : '';
8212
8267
  }
8213
8268
  base64Convert(file) {
8214
8269
  return new Promise((resolve, reject) => {
@@ -8230,7 +8285,7 @@ class DrChatFormDropdownComponent {
8230
8285
  i0.ɵɵlistener("drop", function DrChatFormDropdownComponent_drop_HostBindingHandler($event) { return ctx.onDrop($event); })("dragover", function DrChatFormDropdownComponent_dragover_HostBindingHandler($event) { return ctx.onDragOver($event); })("dragleave", function DrChatFormDropdownComponent_dragleave_HostBindingHandler($event) { return ctx.onDragLeave($event); });
8231
8286
  } if (rf & 2) {
8232
8287
  i0.ɵɵclassProp("file-over", ctx.fileOver);
8233
- } }, inputs: { isUploadingFiles: "isUploadingFiles", message: "message", messagePlaceholder: "messagePlaceholder", dropFiles: "dropFiles", dropFilePlaceholder: "dropFilePlaceholder", waitForReply: "waitForReply", showDotFlashing: "showDotFlashing" }, outputs: { send: "send", uploadFiles: "uploadFiles", abort: "abort", inputChange: "inputChange" }, ngContentSelectors: _c5, decls: 17, vars: 20, consts: [[1, "message-row", 3, "ngClass"], [1, "message-row__input", 3, "ngClass"], [3, "files", "isRemovable", "maxLengthText", "removeFileEvent", 4, "ngIf"], [1, "message-row__input-textarea-wrap"], ["type", "text", 3, "ngModel", "rows", "placeholder", "focus", "blur", "mouseenter", "mouseleave", "ngModelChange", "keydown.enter"], ["textAreaElement", ""], [1, "message-row__btns"], ["type", "file", "hidden", "", "multiple", "", 3, "change"], ["fileInput", ""], ["class", "dr-icon-send-arrow-up send-button", 3, "click", 4, "ngIf"], ["class", "dr-icon-stop abort-button", 3, "click", 4, "ngIf"], ["class", "wait-reply-dot-flashing", 4, "ngIf"], [3, "files", "isRemovable", "maxLengthText", "removeFileEvent"], [1, "dr-icon-send-arrow-up", "send-button", 3, "click"], [1, "dr-icon-stop", "abort-button", 3, "click"], [1, "wait-reply-dot-flashing"]], template: function DrChatFormDropdownComponent_Template(rf, ctx) { if (rf & 1) {
8288
+ } }, inputs: { acceptFormatFiles: "acceptFormatFiles", maxFileSizeBytes: "maxFileSizeBytes", maxFilesCount: "maxFilesCount", isUploadingFiles: "isUploadingFiles", message: "message", messagePlaceholder: "messagePlaceholder", dropFiles: "dropFiles", dropFilePlaceholder: "dropFilePlaceholder", waitForReply: "waitForReply", showDotFlashing: "showDotFlashing" }, outputs: { send: "send", uploadFiles: "uploadFiles", abort: "abort", filesRejected: "filesRejected", inputChange: "inputChange" }, ngContentSelectors: _c5, decls: 17, vars: 21, consts: [[1, "message-row", 3, "ngClass"], [1, "message-row__input", 3, "ngClass"], [3, "files", "isRemovable", "maxLengthText", "removeFileEvent", 4, "ngIf"], [1, "message-row__input-textarea-wrap"], ["type", "text", 3, "ngModel", "rows", "placeholder", "focus", "blur", "mouseenter", "mouseleave", "ngModelChange", "keydown.enter"], ["textAreaElement", ""], [1, "message-row__btns"], ["type", "file", "hidden", "", "multiple", "", 3, "accept", "change"], ["fileInput", ""], ["class", "dr-icon-send-arrow-up send-button", 3, "click", 4, "ngIf"], ["class", "dr-icon-stop abort-button", 3, "click", 4, "ngIf"], ["class", "wait-reply-dot-flashing", 4, "ngIf"], [3, "files", "isRemovable", "maxLengthText", "removeFileEvent"], [1, "dr-icon-send-arrow-up", "send-button", 3, "click"], [1, "dr-icon-stop", "abort-button", 3, "click"], [1, "wait-reply-dot-flashing"]], template: function DrChatFormDropdownComponent_Template(rf, ctx) { if (rf & 1) {
8234
8289
  i0.ɵɵprojectionDef(_c2$5);
8235
8290
  i0.ɵɵelementStart(0, "div", 0)(1, "div", 1);
8236
8291
  i0.ɵɵpipe(2, "async");
@@ -8254,16 +8309,18 @@ class DrChatFormDropdownComponent {
8254
8309
  } if (rf & 2) {
8255
8310
  const _r1 = i0.ɵɵreference(7);
8256
8311
  let tmp_1_0;
8257
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(15, _c3$3, ctx.isUploadingFiles));
8312
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(16, _c3$3, ctx.isUploadingFiles));
8258
8313
  i0.ɵɵadvance(1);
8259
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(17, _c4, ctx.inputFocus, !!(ctx.message == null ? null : (tmp_1_0 = ctx.message.trim()) == null ? null : tmp_1_0.length) || !!i0.ɵɵpipeBind1(2, 11, ctx.droppedFiles$).length));
8314
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(18, _c4, ctx.inputFocus, !!(ctx.message == null ? null : (tmp_1_0 = ctx.message.trim()) == null ? null : tmp_1_0.length) || !!i0.ɵɵpipeBind1(2, 12, ctx.droppedFiles$).length));
8260
8315
  i0.ɵɵadvance(2);
8261
- i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(4, 13, ctx.droppedFiles$).length);
8316
+ i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(4, 14, ctx.droppedFiles$).length);
8262
8317
  i0.ɵɵadvance(3);
8263
8318
  i0.ɵɵstyleMap(ctx.getTextAreaHeight(_r1));
8264
8319
  i0.ɵɵpropertyInterpolate("placeholder", ctx.fileOver ? ctx.dropFilePlaceholder : ctx.messagePlaceholder);
8265
8320
  i0.ɵɵproperty("ngModel", ctx.message)("rows", 1);
8266
- i0.ɵɵadvance(7);
8321
+ i0.ɵɵadvance(5);
8322
+ i0.ɵɵproperty("accept", ctx.acceptFormatFiles);
8323
+ i0.ɵɵadvance(2);
8267
8324
  i0.ɵɵproperty("ngIf", !ctx.waitForReply);
8268
8325
  i0.ɵɵadvance(1);
8269
8326
  i0.ɵɵproperty("ngIf", ctx.waitForReply && !ctx.showDotFlashing);
@@ -8273,13 +8330,19 @@ class DrChatFormDropdownComponent {
8273
8330
  }
8274
8331
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(DrChatFormDropdownComponent, [{
8275
8332
  type: Component,
8276
- args: [{ selector: 'dr-chat-form-dropdown', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"message-row\" [ngClass]=\"{ 'message-row_loading': isUploadingFiles }\">\n <div\n class=\"message-row__input\"\n [ngClass]=\"{\n 'message-row__input--focused': inputFocus,\n 'message-row__input--filled': !!message?.trim()?.length || !!(droppedFiles$ | async).length,\n }\">\n <dr-chat-dropped-files\n *ngIf=\"(droppedFiles$ | async).length\"\n [files]=\"droppedFiles$ | async\"\n [isRemovable]=\"true\"\n [maxLengthText]=\"15\"\n (removeFileEvent)=\"removeFile($event)\"></dr-chat-dropped-files>\n\n <div class=\"message-row__input-textarea-wrap\">\n <textarea\n #textAreaElement\n (focus)=\"inputFocus = true\"\n (blur)=\"inputFocus = false\"\n (mouseenter)=\"inputHover = true\"\n (mouseleave)=\"inputHover = false\"\n [(ngModel)]=\"message\"\n [rows]=\"1\"\n [style]=\"getTextAreaHeight(textAreaElement)\"\n (ngModelChange)=\"onModelChange($event)\"\n type=\"text\"\n placeholder=\"{{ fileOver ? dropFilePlaceholder : messagePlaceholder }}\"\n (keydown.enter)=\"sendMessage($event)\">\n </textarea>\n </div>\n <div class=\"message-row__btns\">\n <ng-content></ng-content>\n <input #fileInput type=\"file\" hidden multiple (change)=\"onFileSelected($event)\" />\n <i *ngIf=\"!waitForReply\" (click)=\"sendMessage($event)\" class=\"dr-icon-send-arrow-up send-button\"></i>\n\n <i *ngIf=\"waitForReply && !showDotFlashing\" class=\"dr-icon-stop abort-button\" (click)=\"abortMessage()\"></i>\n <dr-dot-flashing *ngIf=\"waitForReply && showDotFlashing\" class=\"wait-reply-dot-flashing\"></dr-dot-flashing>\n </div>\n <ng-content select=\"[dropItem]\"></ng-content>\n </div>\n</div>\n", styles: [":host::ng-deep{--disabled-bg: linear-gradient(270.95deg, rgba(130, 210, 240, .2) 10.98%, rgba(146, 146, 255, .2) 93.38%);display:flex;flex-direction:column;align-items:center;padding:0}:host::ng-deep .message-row{display:flex;justify-content:center;width:100%;padding:0 0 21px;max-width:956px}:host::ng-deep .message-row__input{flex-direction:column;background-color:#fff;position:relative;display:flex;align-items:center;flex-grow:1;padding:14px 8px 8px 15px;height:auto;overflow:visible;min-width:265px;border-radius:24px;border:1.5px solid transparent;box-shadow:0 2px 16px -10px #603cff29;transition:.35s ease;will-change:box-shadow}:host::ng-deep .message-row__input .abort-button,:host::ng-deep .message-row__input .send-button{width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:24px;border-radius:100px;color:#fff;transition:.15s ease-in-out;background:linear-gradient(266deg,#6969ff 25.2%,#4eb7df 90.24%) border-box}:host::ng-deep .message-row__input .send-button{background:var(--disabled-bg);pointer-events:none}:host::ng-deep .message-row__input--focused{box-shadow:8px 8px 16px #6969ff40,-4px -4px 8px #40b6e340,8px 8px 60px #00000040;height:auto!important;background:#fff}:host::ng-deep .message-row__input--filled{box-shadow:8px 8px 16px #6969ff40,-4px -4px 8px #40b6e340,8px 8px 60px #00000040;background:#fff}:host::ng-deep .message-row__input--filled .send-button{background:linear-gradient(266deg,#6969ff 25.2%,#4eb7df 90.24%) border-box;pointer-events:all}:host::ng-deep .message-row__input .wait-reply-dot-flashing{display:flex;align-items:center;width:32px;height:32px}:host::ng-deep .message-row__input:before{content:\"\";position:absolute;inset:-3px;background:linear-gradient(266.3deg,#6969ff 25.2%,#4eb7df 90.24%);border-radius:25px;z-index:-1}:host::ng-deep .message-row__input textarea{color:#333;width:100%;outline:none;min-height:30px;flex-grow:1;resize:none;padding:4px 48px 4px 4px;margin:auto;border:none;border-radius:22.5px;font-size:14px;line-height:24px;font-weight:400}:host::ng-deep .message-row__input textarea:focus{border:none}:host::ng-deep .message-row__input textarea::placeholder{color:#9ea1aa}:host::ng-deep .message-row__btns{display:flex;justify-content:space-between;width:100%;align-items:center}:host::ng-deep .message-row__input-textarea-wrap{display:flex;width:100%;position:relative}:host::ng-deep dr-chat-dropped-files{margin-right:auto}:host::ng-deep dr-chat-dropped-files .dropped-files{padding:0}:host::ng-deep dr-chat-dropped-files .dropped-files__item{margin:0}:host::ng-deep .message-row_loading .send-button{background:var(--disabled-bg);pointer-events:none}:host::ng-deep .message-row_loading .dropped-files__item{opacity:.5;pointer-events:none}\n"] }]
8333
+ args: [{ selector: 'dr-chat-form-dropdown', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"message-row\" [ngClass]=\"{ 'message-row_loading': isUploadingFiles }\">\n <div\n class=\"message-row__input\"\n [ngClass]=\"{\n 'message-row__input--focused': inputFocus,\n 'message-row__input--filled': !!message?.trim()?.length || !!(droppedFiles$ | async).length,\n }\">\n <dr-chat-dropped-files\n *ngIf=\"(droppedFiles$ | async).length\"\n [files]=\"droppedFiles$ | async\"\n [isRemovable]=\"true\"\n [maxLengthText]=\"15\"\n (removeFileEvent)=\"removeFile($event)\"></dr-chat-dropped-files>\n\n <div class=\"message-row__input-textarea-wrap\">\n <textarea\n #textAreaElement\n (focus)=\"inputFocus = true\"\n (blur)=\"inputFocus = false\"\n (mouseenter)=\"inputHover = true\"\n (mouseleave)=\"inputHover = false\"\n [(ngModel)]=\"message\"\n [rows]=\"1\"\n [style]=\"getTextAreaHeight(textAreaElement)\"\n (ngModelChange)=\"onModelChange($event)\"\n type=\"text\"\n placeholder=\"{{ fileOver ? dropFilePlaceholder : messagePlaceholder }}\"\n (keydown.enter)=\"sendMessage($event)\">\n </textarea>\n </div>\n <div class=\"message-row__btns\">\n <ng-content></ng-content>\n <input #fileInput type=\"file\" [accept]=\"acceptFormatFiles\" hidden multiple (change)=\"onFileSelected($event)\" />\n <i *ngIf=\"!waitForReply\" (click)=\"sendMessage($event)\" class=\"dr-icon-send-arrow-up send-button\"></i>\n\n <i *ngIf=\"waitForReply && !showDotFlashing\" class=\"dr-icon-stop abort-button\" (click)=\"abortMessage()\"></i>\n <dr-dot-flashing *ngIf=\"waitForReply && showDotFlashing\" class=\"wait-reply-dot-flashing\"></dr-dot-flashing>\n </div>\n <ng-content select=\"[dropItem]\"></ng-content>\n </div>\n</div>\n", styles: [":host::ng-deep{--disabled-bg: linear-gradient(270.95deg, rgba(130, 210, 240, .2) 10.98%, rgba(146, 146, 255, .2) 93.38%);display:flex;flex-direction:column;align-items:center;padding:0}:host::ng-deep .message-row{display:flex;justify-content:center;width:100%;padding:0 0 21px;max-width:956px}:host::ng-deep .message-row__input{flex-direction:column;background-color:#fff;position:relative;display:flex;align-items:center;flex-grow:1;padding:14px 8px 8px 15px;height:auto;overflow:visible;min-width:265px;border-radius:24px;border:1.5px solid transparent;box-shadow:0 2px 16px -10px #603cff29;transition:.35s ease;will-change:box-shadow}:host::ng-deep .message-row__input .abort-button,:host::ng-deep .message-row__input .send-button{width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;font-size:24px;border-radius:100px;color:#fff;transition:.15s ease-in-out;background:linear-gradient(266deg,#6969ff 25.2%,#4eb7df 90.24%) border-box}:host::ng-deep .message-row__input .send-button{background:var(--disabled-bg);pointer-events:none}:host::ng-deep .message-row__input--focused{box-shadow:8px 8px 16px #6969ff40,-4px -4px 8px #40b6e340,8px 8px 60px #00000040;height:auto!important;background:#fff}:host::ng-deep .message-row__input--filled{box-shadow:8px 8px 16px #6969ff40,-4px -4px 8px #40b6e340,8px 8px 60px #00000040;background:#fff}:host::ng-deep .message-row__input--filled .send-button{background:linear-gradient(266deg,#6969ff 25.2%,#4eb7df 90.24%) border-box;pointer-events:all}:host::ng-deep .message-row__input .wait-reply-dot-flashing{display:flex;align-items:center;width:32px;height:32px}:host::ng-deep .message-row__input:before{content:\"\";position:absolute;inset:-3px;background:linear-gradient(266.3deg,#6969ff 25.2%,#4eb7df 90.24%);border-radius:25px;z-index:-1}:host::ng-deep .message-row__input textarea{color:#333;width:100%;outline:none;min-height:30px;flex-grow:1;resize:none;padding:4px 48px 4px 4px;margin:auto;border:none;border-radius:22.5px;font-size:14px;line-height:24px;font-weight:400}:host::ng-deep .message-row__input textarea:focus{border:none}:host::ng-deep .message-row__input textarea::placeholder{color:#9ea1aa}:host::ng-deep .message-row__btns{display:flex;justify-content:space-between;width:100%;align-items:center}:host::ng-deep .message-row__input-textarea-wrap{display:flex;width:100%;position:relative}:host::ng-deep dr-chat-dropped-files{margin-right:auto}:host::ng-deep dr-chat-dropped-files .dropped-files{padding:0}:host::ng-deep dr-chat-dropped-files .dropped-files__item{margin:0}:host::ng-deep .message-row_loading .send-button{background:var(--disabled-bg);pointer-events:none}:host::ng-deep .message-row_loading .dropped-files__item{opacity:.5;pointer-events:none}\n"] }]
8277
8334
  }], function () { return [{ type: i0.ChangeDetectorRef }, { type: i1$5.DomSanitizer }]; }, { textAreaElementRef: [{
8278
8335
  type: ViewChild,
8279
8336
  args: ['textAreaElement']
8280
8337
  }], fileInput: [{
8281
8338
  type: ViewChild,
8282
8339
  args: ['fileInput']
8340
+ }], acceptFormatFiles: [{
8341
+ type: Input
8342
+ }], maxFileSizeBytes: [{
8343
+ type: Input
8344
+ }], maxFilesCount: [{
8345
+ type: Input
8283
8346
  }], isUploadingFiles: [{
8284
8347
  type: Input
8285
8348
  }], message: [{
@@ -8300,6 +8363,8 @@ class DrChatFormDropdownComponent {
8300
8363
  type: Output
8301
8364
  }], abort: [{
8302
8365
  type: Output
8366
+ }], filesRejected: [{
8367
+ type: Output
8303
8368
  }], inputChange: [{
8304
8369
  type: Output
8305
8370
  }], fileOver: [{