stream-chat-angular 6.4.0 → 6.4.1

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.
@@ -22,7 +22,7 @@ import { MentionModule } from 'angular-mentions';
22
22
  import * as i1$1 from '@angular/forms';
23
23
  import { FormGroup, FormControl, Validators, FormArray, ReactiveFormsModule } from '@angular/forms';
24
24
 
25
- const version = '6.4.0';
25
+ const version = '6.4.1';
26
26
 
27
27
  /**
28
28
  * The `NotificationService` can be used to add or remove notifications. By default the [`NotificationList`](/chat/docs/sdk/angular/components/NotificationListComponent/) component displays the currently active notifications.
@@ -9347,7 +9347,7 @@ class PollComposerComponent {
9347
9347
  optionChanged(index) {
9348
9348
  const control = this.options.at(index);
9349
9349
  const penultimateIndex = this.options.length - 2;
9350
- if (index === this.options.length - 1 && control.value?.length === 1) {
9350
+ if (index === this.options.length - 1) {
9351
9351
  this.addOption();
9352
9352
  }
9353
9353
  else if (index === penultimateIndex &&
@@ -9406,10 +9406,10 @@ class PollComposerComponent {
9406
9406
  }
9407
9407
  }
9408
9408
  PollComposerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollComposerComponent, deps: [{ token: CustomTemplatesService }, { token: ChatClientService }, { token: NotificationService }], target: i0.ɵɵFactoryTarget.Component });
9409
- PollComposerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: PollComposerComponent, selector: "stream-poll-composer", outputs: { pollCompose: "pollCompose", cancel: "cancel" }, viewQueries: [{ propertyName: "formContent", first: true, predicate: ["formContent"], descendants: true }], ngImport: i0, template: "<ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: getModalContext()\n \"\n ></ng-container>\n</ng-container>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n class=\"str-chat-angular__create-poll-modal str-chat__create-poll-modal\"\n [isOpen]=\"isOpen\"\n [content]=\"content\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #formContent>\n <div\n class=\"str-chat__dialog str-chat__poll-creation-dialog\"\n data-testid=\"poll-creation-dialog\"\n >\n <div class=\"str-chat__modal-header\">\n <div class=\"str-chat__modal-header__title\">\n {{ \"streamChat.Create poll\" | translate }}\n </div>\n </div>\n <div class=\"str-chat__dialog__body\">\n <form [formGroup]=\"formGroup\" autocomplete=\"off\">\n <div\n class=\"str-chat__form__field str-chat__form__input-field str-chat__form__input-field--with-label\"\n [class.str-chat__form__input-field--has-error]=\"\n formGroup.get('name')?.errors && formGroup.get('name')?.touched\n \"\n >\n <label class=\"str-chat__form__field-label\" htmlFor=\"name\">\n {{ \"streamChat.Question\" | translate }}\n </label>\n <div class=\"str-chat__form__input-field__value\">\n <div\n class=\"str-chat__form-field-error str-chat__form__input-field__error\"\n >\n {{\n (formGroup.get(\"name\")?.errors?.required &&\n formGroup.get(\"name\")?.touched\n ? \"streamChat.Question is required\"\n : \"\"\n ) | translate\n }}\n </div>\n <input\n id=\"name\"\n type=\"text\"\n formControlName=\"name\"\n placeholder=\"{{ 'streamChat.Ask a question' | translate }}\"\n />\n </div>\n </div>\n <fieldset class=\"str-chat__form__field str-chat__form__input-fieldset\">\n <legend class=\"str-chat__form__field-label\">\n {{ \"streamChat.Options\" | translate }}\n </legend>\n <div\n class=\"str-chat__form-field-error str-chat__form__input-field__error\"\n >\n {{\n (formGroup.get(\"options\")?.errors?.atLeastOne &&\n formGroup.get(\"options\")?.touched\n ? \"streamChat.Provide at least one option\"\n : \"\"\n ) | translate\n }}\n </div>\n <ng-container formArrayName=\"options\">\n <div class=\"str-chat__form__input-fieldset__values\">\n <!-- eslint-disable @angular-eslint/template/use-track-by-function -->\n <ng-container\n *ngFor=\"let option of options.controls; let i = index\"\n >\n <!-- eslint-enable @angular-eslint/template/use-track-by-function -->\n <div class=\"str-chat__drag-and-drop-container__item\">\n <div class=\"str-chat__form__input-field\">\n <input\n id=\"option{{ i }}\"\n name=\"option{{ i }}\"\n type=\"text\"\n [formControl]=\"option\"\n (input)=\"optionChanged(i)\"\n placeholder=\"{{ 'streamChat.Add an option' | translate }}\"\n />\n </div>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </fieldset>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'multiple_answers',\n control: formGroup.get('multiple_answers'),\n label: 'streamChat.Multiple answers' | translate\n }\n \"\n ></ng-container>\n <div\n *ngIf=\"formGroup.get('multiple_answers')?.value\"\n class=\"str-chat__form__field str-chat__form__input-field str-chat__form__input-field--with-label\"\n [class.str-chat__form__input-field--has-error]=\"\n formGroup.get('maximum_number_of_votes')?.errors &&\n formGroup.get('maximum_number_of_votes')?.touched\n \"\n >\n <label class=\"str-chat__form__field-label\" htmlFor=\"name\">\n {{ \"streamChat.Maximum number of votes\" | translate }}\n </label>\n <div class=\"str-chat__form__input-field__value\">\n <div\n class=\"str-chat__form-field-error str-chat__form__input-field__error\"\n >\n {{\n (formGroup.get(\"maximum_number_of_votes\")?.errors &&\n formGroup.get(\"maximum_number_of_votes\")?.touched\n ? \"streamChat.Provide a value between {{ min }}\n and {{ max }}\" : \"\" ) | translate: { min: 2, max: 10 } }}\n </div>\n <input\n id=\"maximum_number_of_votes\"\n type=\"text\"\n formControlName=\"maximum_number_of_votes\"\n placeholder=\"{{ 'streamChat.Provide a value between ' \n + '{{ min }} and {{ max }}' | translate: { min: 2, max: 10 } }}\"\n />\n </div>\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'is_anonymous',\n control: formGroup.get('is_anonymous'),\n label: 'streamChat.Anonymous poll' | translate\n }\n \"\n ></ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'allow_user_suggested_options',\n control: formGroup.get('allow_user_suggested_options'),\n label: 'streamChat.Allow option suggestions' | translate\n }\n \"\n ></ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'allow_answers',\n control: formGroup.get('allow_answers'),\n label: 'streamChat.Allow comments' | translate\n }\n \"\n ></ng-container>\n </form>\n </div>\n <stream-notification-list></stream-notification-list>\n <div class=\"str-chat__dialog__controls\">\n <button\n class=\"str-chat__dialog__controls-button str-chat__dialog__controls-button--cancel\"\n (click)=\"cancel.emit()\"\n type=\"button\"\n >\n {{ \"streamChat.Cancel\" | translate }}\n </button>\n <button\n class=\"str-chat__dialog__controls-button str-chat__dialog__controls-button--submit\"\n (click)=\"createPoll()\"\n [disabled]=\"formGroup.invalid\"\n type=\"submit\"\n >\n {{ \"streamChat.Create\" | translate }}\n </button>\n </div>\n </div>\n</ng-template>\n\n<ng-template #switch let-control=\"control\" let-label=\"label\" let-name=\"name\">\n <div class=\"str-chat__form__field str-chat__form__switch-field\">\n <label>\n <div class=\"str-chat__form__field str-chat__form__switch-field-content\">\n <div class=\"str-chat__form__field str-chat__form__switch-field__text\">\n {{ label | translate }}\n </div>\n </div>\n <input\n type=\"checkbox\"\n [checked]=\"control.value\"\n id=\"{{ name }}\"\n name=\"{{ name }}\"\n />\n <div\n class=\"str-chat__form__switch-field__switch\"\n [class.str-chat__form__switch-field__switch--on]=\"control.value\"\n (click)=\"control.setValue(!control.value, { emitEvent: true })\"\n (keyup.enter)=\"control.setValue(!control.value, { emitEvent: true })\"\n >\n <div class=\"str-chat__form__switch-field__switch-handle\"></div>\n </div>\n </label>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ModalComponent, selector: "stream-modal", inputs: ["isOpen", "content"], outputs: ["isOpenChange"] }, { kind: "component", type: NotificationListComponent, selector: "stream-notification-list" }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] });
9409
+ PollComposerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.4", type: PollComposerComponent, selector: "stream-poll-composer", outputs: { pollCompose: "pollCompose", cancel: "cancel" }, viewQueries: [{ propertyName: "formContent", first: true, predicate: ["formContent"], descendants: true }], ngImport: i0, template: "<ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: getModalContext()\n \"\n ></ng-container>\n</ng-container>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n class=\"str-chat-angular__create-poll-modal str-chat__create-poll-modal\"\n [isOpen]=\"isOpen\"\n [content]=\"content\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #formContent>\n <div\n class=\"str-chat__dialog str-chat__poll-creation-dialog\"\n data-testid=\"poll-creation-dialog\"\n >\n <div class=\"str-chat__modal-header\">\n <div class=\"str-chat__modal-header__title\">\n {{ \"streamChat.Create poll\" | translate }}\n </div>\n </div>\n <div class=\"str-chat__dialog__body\">\n <form [formGroup]=\"formGroup\" autocomplete=\"off\">\n <div\n class=\"str-chat__form__field str-chat__form__input-field str-chat__form__input-field--with-label\"\n [class.str-chat__form__input-field--has-error]=\"\n formGroup.get('name')?.errors && formGroup.get('name')?.touched\n \"\n >\n <label class=\"str-chat__form__field-label\" htmlFor=\"name\">\n {{ \"streamChat.Question\" | translate }}\n </label>\n <div class=\"str-chat__form__input-field__value\">\n <div\n class=\"str-chat__form-field-error str-chat__form__input-field__error\"\n >\n {{\n (formGroup.get(\"name\")?.errors?.required &&\n formGroup.get(\"name\")?.touched\n ? \"streamChat.Question is required\"\n : \"\"\n ) | translate\n }}\n </div>\n <input\n id=\"name\"\n type=\"text\"\n formControlName=\"name\"\n placeholder=\"{{ 'streamChat.Ask a question' | translate }}\"\n />\n </div>\n </div>\n <fieldset class=\"str-chat__form__field str-chat__form__input-fieldset\">\n <legend class=\"str-chat__form__field-label\">\n {{ \"streamChat.Options\" | translate }}\n </legend>\n <div\n class=\"str-chat__form-field-error str-chat__form__input-field__error\"\n >\n {{\n (formGroup.get(\"options\")?.errors?.atLeastOne &&\n formGroup.get(\"options\")?.touched\n ? \"streamChat.Provide at least one option\"\n : \"\"\n ) | translate\n }}\n </div>\n <ng-container formArrayName=\"options\">\n <div class=\"str-chat__form__input-fieldset__values\">\n <!-- eslint-disable @angular-eslint/template/use-track-by-function -->\n <ng-container\n *ngFor=\"let option of options.controls; let i = index\"\n >\n <!-- eslint-enable @angular-eslint/template/use-track-by-function -->\n <div class=\"str-chat__drag-and-drop-container__item\">\n <div class=\"str-chat__form__input-field\">\n <div class=\"str-chat__form__input-field__value\">\n <input\n id=\"option{{ i }}\"\n name=\"option{{ i }}\"\n type=\"text\"\n [formControl]=\"option\"\n (input)=\"optionChanged(i)\"\n placeholder=\"{{\n 'streamChat.Add an option' | translate\n }}\"\n />\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </fieldset>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'multiple_answers',\n control: formGroup.get('multiple_answers'),\n label: 'streamChat.Multiple answers' | translate\n }\n \"\n ></ng-container>\n <div\n *ngIf=\"formGroup.get('multiple_answers')?.value\"\n class=\"str-chat__form__field str-chat__form__input-field str-chat__form__input-field--with-label\"\n [class.str-chat__form__input-field--has-error]=\"\n formGroup.get('maximum_number_of_votes')?.errors &&\n formGroup.get('maximum_number_of_votes')?.touched\n \"\n >\n <label class=\"str-chat__form__field-label\" htmlFor=\"name\">\n {{ \"streamChat.Maximum number of votes\" | translate }}\n </label>\n <div class=\"str-chat__form__input-field__value\">\n <div\n class=\"str-chat__form-field-error str-chat__form__input-field__error\"\n >\n {{\n (formGroup.get(\"maximum_number_of_votes\")?.errors &&\n formGroup.get(\"maximum_number_of_votes\")?.touched\n ? \"streamChat.Provide a value between {{ min }}\n and {{ max }}\" : \"\" ) | translate: { min: 2, max: 10 } }}\n </div>\n <input\n id=\"maximum_number_of_votes\"\n type=\"text\"\n formControlName=\"maximum_number_of_votes\"\n placeholder=\"{{ 'streamChat.Provide a value between ' \n + '{{ min }} and {{ max }}' | translate: { min: 2, max: 10 } }}\"\n />\n </div>\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'is_anonymous',\n control: formGroup.get('is_anonymous'),\n label: 'streamChat.Anonymous poll' | translate\n }\n \"\n ></ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'allow_user_suggested_options',\n control: formGroup.get('allow_user_suggested_options'),\n label: 'streamChat.Allow option suggestions' | translate\n }\n \"\n ></ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'allow_answers',\n control: formGroup.get('allow_answers'),\n label: 'streamChat.Allow comments' | translate\n }\n \"\n ></ng-container>\n </form>\n </div>\n <stream-notification-list></stream-notification-list>\n <div class=\"str-chat__dialog__controls\">\n <button\n class=\"str-chat__dialog__controls-button str-chat__dialog__controls-button--cancel\"\n (click)=\"cancel.emit()\"\n type=\"button\"\n >\n {{ \"streamChat.Cancel\" | translate }}\n </button>\n <button\n class=\"str-chat__dialog__controls-button str-chat__dialog__controls-button--submit\"\n (click)=\"createPoll()\"\n [disabled]=\"formGroup.invalid\"\n type=\"submit\"\n >\n {{ \"streamChat.Create\" | translate }}\n </button>\n </div>\n </div>\n</ng-template>\n\n<ng-template #switch let-control=\"control\" let-label=\"label\" let-name=\"name\">\n <div class=\"str-chat__form__field str-chat__form__switch-field\">\n <label>\n <div class=\"str-chat__form__field str-chat__form__switch-field-content\">\n <div class=\"str-chat__form__field str-chat__form__switch-field__text\">\n {{ label | translate }}\n </div>\n </div>\n <input\n type=\"checkbox\"\n [checked]=\"control.value\"\n id=\"{{ name }}\"\n name=\"{{ name }}\"\n />\n <div\n class=\"str-chat__form__switch-field__switch\"\n [class.str-chat__form__switch-field__switch--on]=\"control.value\"\n (click)=\"control.setValue(!control.value, { emitEvent: true })\"\n (keyup.enter)=\"control.setValue(!control.value, { emitEvent: true })\"\n >\n <div class=\"str-chat__form__switch-field__switch-handle\"></div>\n </div>\n </label>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ModalComponent, selector: "stream-modal", inputs: ["isOpen", "content"], outputs: ["isOpenChange"] }, { kind: "component", type: NotificationListComponent, selector: "stream-notification-list" }, { kind: "directive", type: i1$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i1$1.FormArrayName, selector: "[formArrayName]", inputs: ["formArrayName"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }] });
9410
9410
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: PollComposerComponent, decorators: [{
9411
9411
  type: Component,
9412
- args: [{ selector: 'stream-poll-composer', template: "<ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: getModalContext()\n \"\n ></ng-container>\n</ng-container>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n class=\"str-chat-angular__create-poll-modal str-chat__create-poll-modal\"\n [isOpen]=\"isOpen\"\n [content]=\"content\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #formContent>\n <div\n class=\"str-chat__dialog str-chat__poll-creation-dialog\"\n data-testid=\"poll-creation-dialog\"\n >\n <div class=\"str-chat__modal-header\">\n <div class=\"str-chat__modal-header__title\">\n {{ \"streamChat.Create poll\" | translate }}\n </div>\n </div>\n <div class=\"str-chat__dialog__body\">\n <form [formGroup]=\"formGroup\" autocomplete=\"off\">\n <div\n class=\"str-chat__form__field str-chat__form__input-field str-chat__form__input-field--with-label\"\n [class.str-chat__form__input-field--has-error]=\"\n formGroup.get('name')?.errors && formGroup.get('name')?.touched\n \"\n >\n <label class=\"str-chat__form__field-label\" htmlFor=\"name\">\n {{ \"streamChat.Question\" | translate }}\n </label>\n <div class=\"str-chat__form__input-field__value\">\n <div\n class=\"str-chat__form-field-error str-chat__form__input-field__error\"\n >\n {{\n (formGroup.get(\"name\")?.errors?.required &&\n formGroup.get(\"name\")?.touched\n ? \"streamChat.Question is required\"\n : \"\"\n ) | translate\n }}\n </div>\n <input\n id=\"name\"\n type=\"text\"\n formControlName=\"name\"\n placeholder=\"{{ 'streamChat.Ask a question' | translate }}\"\n />\n </div>\n </div>\n <fieldset class=\"str-chat__form__field str-chat__form__input-fieldset\">\n <legend class=\"str-chat__form__field-label\">\n {{ \"streamChat.Options\" | translate }}\n </legend>\n <div\n class=\"str-chat__form-field-error str-chat__form__input-field__error\"\n >\n {{\n (formGroup.get(\"options\")?.errors?.atLeastOne &&\n formGroup.get(\"options\")?.touched\n ? \"streamChat.Provide at least one option\"\n : \"\"\n ) | translate\n }}\n </div>\n <ng-container formArrayName=\"options\">\n <div class=\"str-chat__form__input-fieldset__values\">\n <!-- eslint-disable @angular-eslint/template/use-track-by-function -->\n <ng-container\n *ngFor=\"let option of options.controls; let i = index\"\n >\n <!-- eslint-enable @angular-eslint/template/use-track-by-function -->\n <div class=\"str-chat__drag-and-drop-container__item\">\n <div class=\"str-chat__form__input-field\">\n <input\n id=\"option{{ i }}\"\n name=\"option{{ i }}\"\n type=\"text\"\n [formControl]=\"option\"\n (input)=\"optionChanged(i)\"\n placeholder=\"{{ 'streamChat.Add an option' | translate }}\"\n />\n </div>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </fieldset>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'multiple_answers',\n control: formGroup.get('multiple_answers'),\n label: 'streamChat.Multiple answers' | translate\n }\n \"\n ></ng-container>\n <div\n *ngIf=\"formGroup.get('multiple_answers')?.value\"\n class=\"str-chat__form__field str-chat__form__input-field str-chat__form__input-field--with-label\"\n [class.str-chat__form__input-field--has-error]=\"\n formGroup.get('maximum_number_of_votes')?.errors &&\n formGroup.get('maximum_number_of_votes')?.touched\n \"\n >\n <label class=\"str-chat__form__field-label\" htmlFor=\"name\">\n {{ \"streamChat.Maximum number of votes\" | translate }}\n </label>\n <div class=\"str-chat__form__input-field__value\">\n <div\n class=\"str-chat__form-field-error str-chat__form__input-field__error\"\n >\n {{\n (formGroup.get(\"maximum_number_of_votes\")?.errors &&\n formGroup.get(\"maximum_number_of_votes\")?.touched\n ? \"streamChat.Provide a value between {{ min }}\n and {{ max }}\" : \"\" ) | translate: { min: 2, max: 10 } }}\n </div>\n <input\n id=\"maximum_number_of_votes\"\n type=\"text\"\n formControlName=\"maximum_number_of_votes\"\n placeholder=\"{{ 'streamChat.Provide a value between ' \n + '{{ min }} and {{ max }}' | translate: { min: 2, max: 10 } }}\"\n />\n </div>\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'is_anonymous',\n control: formGroup.get('is_anonymous'),\n label: 'streamChat.Anonymous poll' | translate\n }\n \"\n ></ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'allow_user_suggested_options',\n control: formGroup.get('allow_user_suggested_options'),\n label: 'streamChat.Allow option suggestions' | translate\n }\n \"\n ></ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'allow_answers',\n control: formGroup.get('allow_answers'),\n label: 'streamChat.Allow comments' | translate\n }\n \"\n ></ng-container>\n </form>\n </div>\n <stream-notification-list></stream-notification-list>\n <div class=\"str-chat__dialog__controls\">\n <button\n class=\"str-chat__dialog__controls-button str-chat__dialog__controls-button--cancel\"\n (click)=\"cancel.emit()\"\n type=\"button\"\n >\n {{ \"streamChat.Cancel\" | translate }}\n </button>\n <button\n class=\"str-chat__dialog__controls-button str-chat__dialog__controls-button--submit\"\n (click)=\"createPoll()\"\n [disabled]=\"formGroup.invalid\"\n type=\"submit\"\n >\n {{ \"streamChat.Create\" | translate }}\n </button>\n </div>\n </div>\n</ng-template>\n\n<ng-template #switch let-control=\"control\" let-label=\"label\" let-name=\"name\">\n <div class=\"str-chat__form__field str-chat__form__switch-field\">\n <label>\n <div class=\"str-chat__form__field str-chat__form__switch-field-content\">\n <div class=\"str-chat__form__field str-chat__form__switch-field__text\">\n {{ label | translate }}\n </div>\n </div>\n <input\n type=\"checkbox\"\n [checked]=\"control.value\"\n id=\"{{ name }}\"\n name=\"{{ name }}\"\n />\n <div\n class=\"str-chat__form__switch-field__switch\"\n [class.str-chat__form__switch-field__switch--on]=\"control.value\"\n (click)=\"control.setValue(!control.value, { emitEvent: true })\"\n (keyup.enter)=\"control.setValue(!control.value, { emitEvent: true })\"\n >\n <div class=\"str-chat__form__switch-field__switch-handle\"></div>\n </div>\n </label>\n </div>\n</ng-template>\n" }]
9412
+ args: [{ selector: 'stream-poll-composer', template: "<ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n (customTemplatesService.modalTemplate$ | async) || defaultModal;\n context: getModalContext()\n \"\n ></ng-container>\n</ng-container>\n\n<ng-template\n #defaultModal\n let-isOpen=\"isOpen\"\n let-isOpenChangeHandler=\"isOpenChangeHandler\"\n let-content=\"content\"\n>\n <stream-modal\n class=\"str-chat-angular__create-poll-modal str-chat__create-poll-modal\"\n [isOpen]=\"isOpen\"\n [content]=\"content\"\n (isOpenChange)=\"isOpenChangeHandler($event)\"\n >\n </stream-modal>\n</ng-template>\n\n<ng-template #formContent>\n <div\n class=\"str-chat__dialog str-chat__poll-creation-dialog\"\n data-testid=\"poll-creation-dialog\"\n >\n <div class=\"str-chat__modal-header\">\n <div class=\"str-chat__modal-header__title\">\n {{ \"streamChat.Create poll\" | translate }}\n </div>\n </div>\n <div class=\"str-chat__dialog__body\">\n <form [formGroup]=\"formGroup\" autocomplete=\"off\">\n <div\n class=\"str-chat__form__field str-chat__form__input-field str-chat__form__input-field--with-label\"\n [class.str-chat__form__input-field--has-error]=\"\n formGroup.get('name')?.errors && formGroup.get('name')?.touched\n \"\n >\n <label class=\"str-chat__form__field-label\" htmlFor=\"name\">\n {{ \"streamChat.Question\" | translate }}\n </label>\n <div class=\"str-chat__form__input-field__value\">\n <div\n class=\"str-chat__form-field-error str-chat__form__input-field__error\"\n >\n {{\n (formGroup.get(\"name\")?.errors?.required &&\n formGroup.get(\"name\")?.touched\n ? \"streamChat.Question is required\"\n : \"\"\n ) | translate\n }}\n </div>\n <input\n id=\"name\"\n type=\"text\"\n formControlName=\"name\"\n placeholder=\"{{ 'streamChat.Ask a question' | translate }}\"\n />\n </div>\n </div>\n <fieldset class=\"str-chat__form__field str-chat__form__input-fieldset\">\n <legend class=\"str-chat__form__field-label\">\n {{ \"streamChat.Options\" | translate }}\n </legend>\n <div\n class=\"str-chat__form-field-error str-chat__form__input-field__error\"\n >\n {{\n (formGroup.get(\"options\")?.errors?.atLeastOne &&\n formGroup.get(\"options\")?.touched\n ? \"streamChat.Provide at least one option\"\n : \"\"\n ) | translate\n }}\n </div>\n <ng-container formArrayName=\"options\">\n <div class=\"str-chat__form__input-fieldset__values\">\n <!-- eslint-disable @angular-eslint/template/use-track-by-function -->\n <ng-container\n *ngFor=\"let option of options.controls; let i = index\"\n >\n <!-- eslint-enable @angular-eslint/template/use-track-by-function -->\n <div class=\"str-chat__drag-and-drop-container__item\">\n <div class=\"str-chat__form__input-field\">\n <div class=\"str-chat__form__input-field__value\">\n <input\n id=\"option{{ i }}\"\n name=\"option{{ i }}\"\n type=\"text\"\n [formControl]=\"option\"\n (input)=\"optionChanged(i)\"\n placeholder=\"{{\n 'streamChat.Add an option' | translate\n }}\"\n />\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n </ng-container>\n </fieldset>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'multiple_answers',\n control: formGroup.get('multiple_answers'),\n label: 'streamChat.Multiple answers' | translate\n }\n \"\n ></ng-container>\n <div\n *ngIf=\"formGroup.get('multiple_answers')?.value\"\n class=\"str-chat__form__field str-chat__form__input-field str-chat__form__input-field--with-label\"\n [class.str-chat__form__input-field--has-error]=\"\n formGroup.get('maximum_number_of_votes')?.errors &&\n formGroup.get('maximum_number_of_votes')?.touched\n \"\n >\n <label class=\"str-chat__form__field-label\" htmlFor=\"name\">\n {{ \"streamChat.Maximum number of votes\" | translate }}\n </label>\n <div class=\"str-chat__form__input-field__value\">\n <div\n class=\"str-chat__form-field-error str-chat__form__input-field__error\"\n >\n {{\n (formGroup.get(\"maximum_number_of_votes\")?.errors &&\n formGroup.get(\"maximum_number_of_votes\")?.touched\n ? \"streamChat.Provide a value between {{ min }}\n and {{ max }}\" : \"\" ) | translate: { min: 2, max: 10 } }}\n </div>\n <input\n id=\"maximum_number_of_votes\"\n type=\"text\"\n formControlName=\"maximum_number_of_votes\"\n placeholder=\"{{ 'streamChat.Provide a value between ' \n + '{{ min }} and {{ max }}' | translate: { min: 2, max: 10 } }}\"\n />\n </div>\n </div>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'is_anonymous',\n control: formGroup.get('is_anonymous'),\n label: 'streamChat.Anonymous poll' | translate\n }\n \"\n ></ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'allow_user_suggested_options',\n control: formGroup.get('allow_user_suggested_options'),\n label: 'streamChat.Allow option suggestions' | translate\n }\n \"\n ></ng-container>\n <ng-container\n *ngTemplateOutlet=\"\n switch;\n context: {\n name: 'allow_answers',\n control: formGroup.get('allow_answers'),\n label: 'streamChat.Allow comments' | translate\n }\n \"\n ></ng-container>\n </form>\n </div>\n <stream-notification-list></stream-notification-list>\n <div class=\"str-chat__dialog__controls\">\n <button\n class=\"str-chat__dialog__controls-button str-chat__dialog__controls-button--cancel\"\n (click)=\"cancel.emit()\"\n type=\"button\"\n >\n {{ \"streamChat.Cancel\" | translate }}\n </button>\n <button\n class=\"str-chat__dialog__controls-button str-chat__dialog__controls-button--submit\"\n (click)=\"createPoll()\"\n [disabled]=\"formGroup.invalid\"\n type=\"submit\"\n >\n {{ \"streamChat.Create\" | translate }}\n </button>\n </div>\n </div>\n</ng-template>\n\n<ng-template #switch let-control=\"control\" let-label=\"label\" let-name=\"name\">\n <div class=\"str-chat__form__field str-chat__form__switch-field\">\n <label>\n <div class=\"str-chat__form__field str-chat__form__switch-field-content\">\n <div class=\"str-chat__form__field str-chat__form__switch-field__text\">\n {{ label | translate }}\n </div>\n </div>\n <input\n type=\"checkbox\"\n [checked]=\"control.value\"\n id=\"{{ name }}\"\n name=\"{{ name }}\"\n />\n <div\n class=\"str-chat__form__switch-field__switch\"\n [class.str-chat__form__switch-field__switch--on]=\"control.value\"\n (click)=\"control.setValue(!control.value, { emitEvent: true })\"\n (keyup.enter)=\"control.setValue(!control.value, { emitEvent: true })\"\n >\n <div class=\"str-chat__form__switch-field__switch-handle\"></div>\n </div>\n </label>\n </div>\n</ng-template>\n" }]
9413
9413
  }], ctorParameters: function () { return [{ type: CustomTemplatesService }, { type: ChatClientService }, { type: NotificationService }]; }, propDecorators: { pollCompose: [{
9414
9414
  type: Output
9415
9415
  }], cancel: [{