@bnsights/bbsf-controls 1.0.149 → 1.0.151

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.
@@ -52,7 +52,7 @@ import { TranslateService } from '@ngx-translate/core';
52
52
  import { SweetAlert2Module } from '@sweetalert2/ngx-sweetalert2';
53
53
  import * as i3 from '@bnsights/bbsf-utilities';
54
54
  import { RequestOptionsModel, environment as environment$1, BBSFUtilitiesModule, UtilityService, ConfigurationService, EnvironmentService, AuthService } from '@bnsights/bbsf-utilities';
55
- import { Subject, noop as noop$1, of, Observable, EMPTY, Subscription } from 'rxjs';
55
+ import { Subject, noop as noop$1, of, Observable, EMPTY, Subscription, switchMap as switchMap$1 } from 'rxjs';
56
56
  import { map, tap, switchMap } from 'rxjs/operators';
57
57
  import * as i6 from '@angular/cdk/bidi';
58
58
  import dayGridPlugin from '@fullcalendar/daygrid';
@@ -68,6 +68,8 @@ import { ScriptLoaderModule } from 'ngx-script-loader';
68
68
  import * as i8$2 from '@angular/google-maps';
69
69
  import { GoogleMapsModule } from '@angular/google-maps';
70
70
  import { plainToClass } from 'class-transformer';
71
+ import * as i8$4 from 'ngx-markdown-editor';
72
+ import { LMarkdownEditorModule } from 'ngx-markdown-editor';
71
73
  import { Title } from '@angular/platform-browser';
72
74
  import { saveAs } from 'file-saver';
73
75
 
@@ -7023,7 +7025,6 @@ class TextAreaComponent {
7023
7025
  this.minCharsLimit = -1; //To disable chars limit feature by default
7024
7026
  this.maxLimitWarningMsg = "";
7025
7027
  this.isMicOn = false;
7026
- this.isSpeechLanguageOpened = false;
7027
7028
  this.resetError = () => {
7028
7029
  this.controlValidationService.removeGlobalError();
7029
7030
  };
@@ -7207,6 +7208,7 @@ class TextAreaComponent {
7207
7208
  this.loadSelectedSpeechLanguage();
7208
7209
  }
7209
7210
  this.group.get(languageControlName).setValue(this.options.selectedSpeechLanguage);
7211
+ this.selectedSpeechLanguageDisplayText = this.options.speechLanguages.find(l => l.dialect == this.options.selectedSpeechLanguage).prefix;
7210
7212
  }
7211
7213
  loadSelectedSpeechLanguage() {
7212
7214
  if (!this.options.selectedSpeechLanguage) {
@@ -7226,6 +7228,8 @@ class TextAreaComponent {
7226
7228
  this.utilityService.notifyErrorMessage(this.utilityService.getResourceValue("BrowserNotSupportSpeechRecognition"));
7227
7229
  return;
7228
7230
  }
7231
+ //Disable Select Language
7232
+ this.enableOrDisableLanguageSelect(false);
7229
7233
  this.isMicOn = true;
7230
7234
  this.subscription = this.speechRecognitionService.startListening(this.options.selectedSpeechLanguage).subscribe({
7231
7235
  next: (transcript) => {
@@ -7248,11 +7252,14 @@ class TextAreaComponent {
7248
7252
  this.stopSpeechRecognition();
7249
7253
  },
7250
7254
  complete: () => {
7255
+ //Enable Select Language
7256
+ this.enableOrDisableLanguageSelect();
7251
7257
  this.isMicOn = false;
7252
7258
  }
7253
7259
  });
7254
7260
  }
7255
7261
  stopSpeechRecognition() {
7262
+ this.enableOrDisableLanguageSelect();
7256
7263
  if (!this.speechRecognitionService.isSupported) {
7257
7264
  return;
7258
7265
  }
@@ -7266,28 +7273,32 @@ class TextAreaComponent {
7266
7273
  this.stopSpeechRecognition();
7267
7274
  }
7268
7275
  onSpeechLanguageChange(event) {
7269
- this.isSpeechLanguageOpened = false;
7270
- let selectedLang = event.target.value;
7271
- this.options.selectedSpeechLanguage = selectedLang;
7276
+ let selectedLang_Dialect = event.target.value;
7277
+ this.selectedSpeechLanguageDisplayText = this.options.speechLanguages.find(l => l.dialect == selectedLang_Dialect).prefix;
7278
+ this.options.selectedSpeechLanguage = selectedLang_Dialect;
7272
7279
  const languageControlName = this.options.name + 'Language';
7273
- this.group.get(languageControlName).setValue(selectedLang);
7280
+ let select = this.group.get(languageControlName);
7281
+ select.setValue(selectedLang_Dialect);
7274
7282
  if (this.options.autoSaveSpeechLanguagetoLocalStorage) {
7275
- localStorage.setItem("speechLanguage", selectedLang);
7283
+ localStorage.setItem("speechLanguage", selectedLang_Dialect);
7276
7284
  }
7277
7285
  }
7278
- onSpeechLanguageBlur() {
7279
- setTimeout(() => this.isSpeechLanguageOpened = false, 200);
7280
- }
7281
- // Handle on click (on open)
7282
- onSpeechLanguageMouseDown() {
7283
- this.isSpeechLanguageOpened = true;
7286
+ enableOrDisableLanguageSelect(isEnabled = true) {
7287
+ const languageControlName = this.options.name + 'Language';
7288
+ let select = this.group.get(languageControlName);
7289
+ if (isEnabled) {
7290
+ select.enable();
7291
+ }
7292
+ else {
7293
+ select.disable();
7294
+ }
7284
7295
  }
7285
7296
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: TextAreaComponent, deps: [{ token: ControlUtility }, { token: i2.ControlContainer, optional: true }, { token: i2.FormGroupDirective }, { token: i3.UtilityService }, { token: i3.ControlValidationService }, { token: GlobalSettings }, { token: i3.SpeechRecognitionService }, { token: i3.LanguageService }], target: i0.ɵɵFactoryTarget.Component }); }
7286
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.6", type: TextAreaComponent, selector: "BBSF-TextArea", inputs: { group: "group", options: "options" }, outputs: { onChange: "onChange" }, ngImport: i0, template: "<div class=\"form-group bbsf-control bbsf-textarea\" [formGroup]=\"group\">\r\n <div [ngClass]=\"(options.viewType==1)?'bbsf-vertical':'bbsf-horizontal'\">\r\n <!--label-->\r\n <label *ngIf=\"!options.hideLabel\" class=\"bbsf-label {{options.labelExtraClasses}}\">\r\n {{options.labelValue}}\r\n <!--Asterisk-->\r\n <span *ngIf=\"((options.showAsterisk&&options.isRequired)||(options.isRequired))&&!options.isReadonly\"\r\n class=\"text-danger\">*</span>\r\n </label>\r\n <div *ngIf=\"!options.isReadonly\" class=\"bbsf-input-container\" [ngClass]=\"{\r\n 'p-120px': options.enableSpeechRecognition && options.enableCopyToClipboard,\r\n 'p-80px': options.enableSpeechRecognition && !options.enableCopyToClipboard,\r\n 'p-40px': !options.enableSpeechRecognition && options.enableCopyToClipboard\r\n }\">\r\n <!--input-->\r\n <textarea class=\"form-control {{options.extraClasses}}\" (focus)=\"onFocus(true)\" (focusout)=\"onFocus(false)\"\r\n [dir]=\"textDir\" aria-describedby=\"email-error\" aria-invalid=\"true\" formControlName=\"{{options.name}}\"\r\n [class.is-invalid]=\"textAreaFormControl.invalid && textAreaFormControl.touched\"\r\n placeholder=\"{{options.placeholder}}\" id=\"{{options.name}}\" autocomplete=\"{{options.autoComplete}}\"\r\n (change)=\"trimControlValue()\" rows=\"{{options.rows}}\" (keyup)=\"onTextChange()\" cols=\"{{options.cols}}\"\r\n maxlength=\"{{options.maxLength}}\" minlength=\"{{options.minLength}}\" [(ngModel)]=\"options.value\"\r\n (keydown)=\"wordCountArray>options.maxWordCount&&$event.keyCode !=8?$event.preventDefault():null\"\r\n #TextAreainput></textarea>\r\n <!--CopyToClipboard-->\r\n <div class=\"copy-clipboard\" *ngIf=\"options.enableCopyToClipboard\" (click)=\"copyInputMessage(TextAreainput)\">\r\n <i class=\"fas fa-copy\"></i>\r\n </div>\r\n <div [ngClass]=\"{'expanded': isFocused}\" class=\"language-container {{options.extraClassMicLanguage}}\" *ngIf=\"options.enableSpeechRecognition\">\r\n <span class=\"svg-icon svg-icon-5\" [inlineSVG]=\"options.iconMic? options.iconMic : './src/assets/images/mic.svg'\" (click)=\"startSpeechRecognition()\"\r\n *ngIf=\"!isMicOn\">\r\n </span>\r\n <span class=\"svg-icon svg-icon-5\" [inlineSVG]=\"options.iconMicOff? options.iconMicOff : './src/assets/images/mic-off.svg'\" (click)=\"stopSpeechRecognition()\"\r\n *ngIf=\"isMicOn\">\r\n </span>\r\n <select (blur)=\"onSpeechLanguageBlur()\" (mousedown)=\"onSpeechLanguageMouseDown()\"\r\n [ngClass]=\"{'speechlanguage-open': isSpeechLanguageOpened}\" class=\"language-select\" [formControlName]=\"options.name + 'Language'\" (change)=\"onSpeechLanguageChange($event)\">\r\n <option *ngFor=\"let language of options.speechLanguages\" [value]=\"language.dialect\">\r\n {{ isSpeechLanguageOpened ? language.name : language.prefix }}\r\n </option>\r\n </select>\r\n\r\n </div>\r\n </div>\r\n <!-- readonly -->\r\n <div *ngIf=\"options.isReadonly\"><span class=\"readonly-view\">{{options.value}}</span>\r\n </div>\r\n <div class=\"subtext-container\">\r\n <!--wordCount-->\r\n <div class=\"bbsf-word-count\" *ngIf=\"options.maxWordCount>0&&isShowWordCount\">\r\n {{wordCount}}/{{options.maxWordCount}} Words</div>\r\n <!-- CharsLimitMsg-->\r\n <div class=\"bbsf-character-count\" *ngIf=\"showCharsLimitMsg\"\r\n [ngClass]=\"{'badge-light-warning': charsLimitMsgClass === 'warning', 'badge-light-danger' : charsLimitMsgClass === 'danger' }\">\r\n {{maxLimitWarningMsg}}\r\n </div>\r\n <!-- LabelDescription-->\r\n <div class=\"bbsf-control-desc\" *ngIf=\"options.labelDescription!=null\">{{options.labelDescription}}</div>\r\n <!-- requiredText-->\r\n <div class=\"bbsf-validation\" [dir]=\"textDir\" *ngIf=\"(textAreaFormControl.invalid && textAreaFormControl.touched)\">\r\n {{getErrorValidation(textAreaFormControl.errors|keyvalue)}}\r\n </div>\r\n </div>\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">\r\n {{resetError()}}</div>\r\n </div>\r\n", dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.Dir, selector: "[dir]", inputs: ["dir"], outputs: ["dirChange"], exportAs: ["dir"] }, { kind: "directive", type: i7.NativeElementInjectorDirective, selector: "[ngModel], [formControl], [formControlName]" }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.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: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i8$3.InlineSVGDirective, selector: "[inlineSVG]", inputs: ["inlineSVG", "resolveSVGUrl", "replaceContents", "prepend", "injectComponent", "cacheSVG", "setSVGAttributes", "removeSVGAttributes", "forceEvalStyles", "evalScripts", "fallbackImgUrl", "fallbackSVG", "onSVGLoaded"], outputs: ["onSVGInserted", "onSVGFailed"] }, { kind: "pipe", type: i5.KeyValuePipe, name: "keyvalue" }] }); }
7297
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.6", type: TextAreaComponent, selector: "BBSF-TextArea", inputs: { group: "group", options: "options" }, outputs: { onChange: "onChange" }, ngImport: i0, template: "<div class=\"form-group bbsf-control bbsf-textarea\" [formGroup]=\"group\">\r\n <div [ngClass]=\"(options.viewType==1)?'bbsf-vertical':'bbsf-horizontal'\">\r\n <!--label-->\r\n <label *ngIf=\"!options.hideLabel\" class=\"bbsf-label {{options.labelExtraClasses}}\">\r\n {{options.labelValue}}\r\n <!--Asterisk-->\r\n <span *ngIf=\"((options.showAsterisk&&options.isRequired)||(options.isRequired))&&!options.isReadonly\"\r\n class=\"text-danger\">*</span>\r\n </label>\r\n <div *ngIf=\"!options.isReadonly\" class=\"bbsf-input-container\" [ngClass]=\"{\r\n 'p-120px': options.enableSpeechRecognition && options.enableCopyToClipboard,\r\n 'p-80px': options.enableSpeechRecognition && !options.enableCopyToClipboard,\r\n 'p-40px': !options.enableSpeechRecognition && options.enableCopyToClipboard\r\n }\">\r\n <!--input-->\r\n <textarea class=\"form-control {{options.extraClasses}}\" (focus)=\"onFocus(true)\" (focusout)=\"onFocus(false)\"\r\n [dir]=\"textDir\" aria-describedby=\"email-error\" aria-invalid=\"true\" formControlName=\"{{options.name}}\"\r\n [class.is-invalid]=\"textAreaFormControl.invalid && textAreaFormControl.touched\"\r\n placeholder=\"{{options.placeholder}}\" id=\"{{options.name}}\" autocomplete=\"{{options.autoComplete}}\"\r\n (change)=\"trimControlValue()\" rows=\"{{options.rows}}\" (keyup)=\"onTextChange()\" cols=\"{{options.cols}}\"\r\n maxlength=\"{{options.maxLength}}\" minlength=\"{{options.minLength}}\" [(ngModel)]=\"options.value\"\r\n (keydown)=\"wordCountArray>options.maxWordCount&&$event.keyCode !=8?$event.preventDefault():null\"\r\n #TextAreainput></textarea>\r\n <!--CopyToClipboard-->\r\n <div class=\"copy-clipboard\" *ngIf=\"options.enableCopyToClipboard\" (click)=\"copyInputMessage(TextAreainput)\">\r\n <i class=\"fas fa-copy\"></i>\r\n </div>\r\n <div [ngClass]=\"{'expanded': isFocused}\" class=\"language-container {{options.extraClassMicLanguage}}\" *ngIf=\"options.enableSpeechRecognition\">\r\n <span class=\"svg-icon svg-icon-5\" [inlineSVG]=\"options.iconMic? options.iconMic : './src/assets/images/mic.svg'\" (click)=\"startSpeechRecognition()\"\r\n *ngIf=\"!isMicOn\">\r\n </span>\r\n <span class=\"svg-icon svg-icon-5\" [inlineSVG]=\"options.iconMicOff? options.iconMicOff : './src/assets/images/mic-off.svg'\" (click)=\"stopSpeechRecognition()\"\r\n *ngIf=\"isMicOn\">\r\n </span>\r\n <div>\r\n <span class=\"language-text\">{{ selectedSpeechLanguageDisplayText }}</span>\r\n <select class=\"language-select\" [formControlName]=\"options.name + 'Language'\" (change)=\"onSpeechLanguageChange($event)\">\r\n <option *ngFor=\"let language of options.speechLanguages\" [value]=\"language.dialect\">\r\n {{language.name}}\r\n </option>\r\n </select>\r\n\r\n </div>\r\n\r\n\r\n </div>\r\n </div>\r\n <!-- readonly -->\r\n <div *ngIf=\"options.isReadonly\"><span class=\"readonly-view\">{{options.value}}</span>\r\n </div>\r\n <div class=\"subtext-container\">\r\n <!--wordCount-->\r\n <div class=\"bbsf-word-count\" *ngIf=\"options.maxWordCount>0&&isShowWordCount\">\r\n {{wordCount}}/{{options.maxWordCount}} Words</div>\r\n <!-- CharsLimitMsg-->\r\n <div class=\"bbsf-character-count\" *ngIf=\"showCharsLimitMsg\"\r\n [ngClass]=\"{'badge-light-warning': charsLimitMsgClass === 'warning', 'badge-light-danger' : charsLimitMsgClass === 'danger' }\">\r\n {{maxLimitWarningMsg}}\r\n </div>\r\n <!-- LabelDescription-->\r\n <div class=\"bbsf-control-desc\" *ngIf=\"options.labelDescription!=null\">{{options.labelDescription}}</div>\r\n <!-- requiredText-->\r\n <div class=\"bbsf-validation\" [dir]=\"textDir\" *ngIf=\"(textAreaFormControl.invalid && textAreaFormControl.touched)\">\r\n {{getErrorValidation(textAreaFormControl.errors|keyvalue)}}\r\n </div>\r\n </div>\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">\r\n {{resetError()}}</div>\r\n </div>\r\n", dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i6.Dir, selector: "[dir]", inputs: ["dir"], outputs: ["dirChange"], exportAs: ["dir"] }, { kind: "directive", type: i7.NativeElementInjectorDirective, selector: "[ngModel], [formControl], [formControlName]" }, { kind: "directive", type: i2.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i2.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: i2.SelectControlValueAccessor, selector: "select:not([multiple])[formControlName],select:not([multiple])[formControl],select:not([multiple])[ngModel]", inputs: ["compareWith"] }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.MinLengthValidator, selector: "[minlength][formControlName],[minlength][formControl],[minlength][ngModel]", inputs: ["minlength"] }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: i8$3.InlineSVGDirective, selector: "[inlineSVG]", inputs: ["inlineSVG", "resolveSVGUrl", "replaceContents", "prepend", "injectComponent", "cacheSVG", "setSVGAttributes", "removeSVGAttributes", "forceEvalStyles", "evalScripts", "fallbackImgUrl", "fallbackSVG", "onSVGLoaded"], outputs: ["onSVGInserted", "onSVGFailed"] }, { kind: "pipe", type: i5.KeyValuePipe, name: "keyvalue" }] }); }
7287
7298
  }
7288
7299
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: TextAreaComponent, decorators: [{
7289
7300
  type: Component,
7290
- args: [{ selector: 'BBSF-TextArea', template: "<div class=\"form-group bbsf-control bbsf-textarea\" [formGroup]=\"group\">\r\n <div [ngClass]=\"(options.viewType==1)?'bbsf-vertical':'bbsf-horizontal'\">\r\n <!--label-->\r\n <label *ngIf=\"!options.hideLabel\" class=\"bbsf-label {{options.labelExtraClasses}}\">\r\n {{options.labelValue}}\r\n <!--Asterisk-->\r\n <span *ngIf=\"((options.showAsterisk&&options.isRequired)||(options.isRequired))&&!options.isReadonly\"\r\n class=\"text-danger\">*</span>\r\n </label>\r\n <div *ngIf=\"!options.isReadonly\" class=\"bbsf-input-container\" [ngClass]=\"{\r\n 'p-120px': options.enableSpeechRecognition && options.enableCopyToClipboard,\r\n 'p-80px': options.enableSpeechRecognition && !options.enableCopyToClipboard,\r\n 'p-40px': !options.enableSpeechRecognition && options.enableCopyToClipboard\r\n }\">\r\n <!--input-->\r\n <textarea class=\"form-control {{options.extraClasses}}\" (focus)=\"onFocus(true)\" (focusout)=\"onFocus(false)\"\r\n [dir]=\"textDir\" aria-describedby=\"email-error\" aria-invalid=\"true\" formControlName=\"{{options.name}}\"\r\n [class.is-invalid]=\"textAreaFormControl.invalid && textAreaFormControl.touched\"\r\n placeholder=\"{{options.placeholder}}\" id=\"{{options.name}}\" autocomplete=\"{{options.autoComplete}}\"\r\n (change)=\"trimControlValue()\" rows=\"{{options.rows}}\" (keyup)=\"onTextChange()\" cols=\"{{options.cols}}\"\r\n maxlength=\"{{options.maxLength}}\" minlength=\"{{options.minLength}}\" [(ngModel)]=\"options.value\"\r\n (keydown)=\"wordCountArray>options.maxWordCount&&$event.keyCode !=8?$event.preventDefault():null\"\r\n #TextAreainput></textarea>\r\n <!--CopyToClipboard-->\r\n <div class=\"copy-clipboard\" *ngIf=\"options.enableCopyToClipboard\" (click)=\"copyInputMessage(TextAreainput)\">\r\n <i class=\"fas fa-copy\"></i>\r\n </div>\r\n <div [ngClass]=\"{'expanded': isFocused}\" class=\"language-container {{options.extraClassMicLanguage}}\" *ngIf=\"options.enableSpeechRecognition\">\r\n <span class=\"svg-icon svg-icon-5\" [inlineSVG]=\"options.iconMic? options.iconMic : './src/assets/images/mic.svg'\" (click)=\"startSpeechRecognition()\"\r\n *ngIf=\"!isMicOn\">\r\n </span>\r\n <span class=\"svg-icon svg-icon-5\" [inlineSVG]=\"options.iconMicOff? options.iconMicOff : './src/assets/images/mic-off.svg'\" (click)=\"stopSpeechRecognition()\"\r\n *ngIf=\"isMicOn\">\r\n </span>\r\n <select (blur)=\"onSpeechLanguageBlur()\" (mousedown)=\"onSpeechLanguageMouseDown()\"\r\n [ngClass]=\"{'speechlanguage-open': isSpeechLanguageOpened}\" class=\"language-select\" [formControlName]=\"options.name + 'Language'\" (change)=\"onSpeechLanguageChange($event)\">\r\n <option *ngFor=\"let language of options.speechLanguages\" [value]=\"language.dialect\">\r\n {{ isSpeechLanguageOpened ? language.name : language.prefix }}\r\n </option>\r\n </select>\r\n\r\n </div>\r\n </div>\r\n <!-- readonly -->\r\n <div *ngIf=\"options.isReadonly\"><span class=\"readonly-view\">{{options.value}}</span>\r\n </div>\r\n <div class=\"subtext-container\">\r\n <!--wordCount-->\r\n <div class=\"bbsf-word-count\" *ngIf=\"options.maxWordCount>0&&isShowWordCount\">\r\n {{wordCount}}/{{options.maxWordCount}} Words</div>\r\n <!-- CharsLimitMsg-->\r\n <div class=\"bbsf-character-count\" *ngIf=\"showCharsLimitMsg\"\r\n [ngClass]=\"{'badge-light-warning': charsLimitMsgClass === 'warning', 'badge-light-danger' : charsLimitMsgClass === 'danger' }\">\r\n {{maxLimitWarningMsg}}\r\n </div>\r\n <!-- LabelDescription-->\r\n <div class=\"bbsf-control-desc\" *ngIf=\"options.labelDescription!=null\">{{options.labelDescription}}</div>\r\n <!-- requiredText-->\r\n <div class=\"bbsf-validation\" [dir]=\"textDir\" *ngIf=\"(textAreaFormControl.invalid && textAreaFormControl.touched)\">\r\n {{getErrorValidation(textAreaFormControl.errors|keyvalue)}}\r\n </div>\r\n </div>\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">\r\n {{resetError()}}</div>\r\n </div>\r\n" }]
7301
+ args: [{ selector: 'BBSF-TextArea', template: "<div class=\"form-group bbsf-control bbsf-textarea\" [formGroup]=\"group\">\r\n <div [ngClass]=\"(options.viewType==1)?'bbsf-vertical':'bbsf-horizontal'\">\r\n <!--label-->\r\n <label *ngIf=\"!options.hideLabel\" class=\"bbsf-label {{options.labelExtraClasses}}\">\r\n {{options.labelValue}}\r\n <!--Asterisk-->\r\n <span *ngIf=\"((options.showAsterisk&&options.isRequired)||(options.isRequired))&&!options.isReadonly\"\r\n class=\"text-danger\">*</span>\r\n </label>\r\n <div *ngIf=\"!options.isReadonly\" class=\"bbsf-input-container\" [ngClass]=\"{\r\n 'p-120px': options.enableSpeechRecognition && options.enableCopyToClipboard,\r\n 'p-80px': options.enableSpeechRecognition && !options.enableCopyToClipboard,\r\n 'p-40px': !options.enableSpeechRecognition && options.enableCopyToClipboard\r\n }\">\r\n <!--input-->\r\n <textarea class=\"form-control {{options.extraClasses}}\" (focus)=\"onFocus(true)\" (focusout)=\"onFocus(false)\"\r\n [dir]=\"textDir\" aria-describedby=\"email-error\" aria-invalid=\"true\" formControlName=\"{{options.name}}\"\r\n [class.is-invalid]=\"textAreaFormControl.invalid && textAreaFormControl.touched\"\r\n placeholder=\"{{options.placeholder}}\" id=\"{{options.name}}\" autocomplete=\"{{options.autoComplete}}\"\r\n (change)=\"trimControlValue()\" rows=\"{{options.rows}}\" (keyup)=\"onTextChange()\" cols=\"{{options.cols}}\"\r\n maxlength=\"{{options.maxLength}}\" minlength=\"{{options.minLength}}\" [(ngModel)]=\"options.value\"\r\n (keydown)=\"wordCountArray>options.maxWordCount&&$event.keyCode !=8?$event.preventDefault():null\"\r\n #TextAreainput></textarea>\r\n <!--CopyToClipboard-->\r\n <div class=\"copy-clipboard\" *ngIf=\"options.enableCopyToClipboard\" (click)=\"copyInputMessage(TextAreainput)\">\r\n <i class=\"fas fa-copy\"></i>\r\n </div>\r\n <div [ngClass]=\"{'expanded': isFocused}\" class=\"language-container {{options.extraClassMicLanguage}}\" *ngIf=\"options.enableSpeechRecognition\">\r\n <span class=\"svg-icon svg-icon-5\" [inlineSVG]=\"options.iconMic? options.iconMic : './src/assets/images/mic.svg'\" (click)=\"startSpeechRecognition()\"\r\n *ngIf=\"!isMicOn\">\r\n </span>\r\n <span class=\"svg-icon svg-icon-5\" [inlineSVG]=\"options.iconMicOff? options.iconMicOff : './src/assets/images/mic-off.svg'\" (click)=\"stopSpeechRecognition()\"\r\n *ngIf=\"isMicOn\">\r\n </span>\r\n <div>\r\n <span class=\"language-text\">{{ selectedSpeechLanguageDisplayText }}</span>\r\n <select class=\"language-select\" [formControlName]=\"options.name + 'Language'\" (change)=\"onSpeechLanguageChange($event)\">\r\n <option *ngFor=\"let language of options.speechLanguages\" [value]=\"language.dialect\">\r\n {{language.name}}\r\n </option>\r\n </select>\r\n\r\n </div>\r\n\r\n\r\n </div>\r\n </div>\r\n <!-- readonly -->\r\n <div *ngIf=\"options.isReadonly\"><span class=\"readonly-view\">{{options.value}}</span>\r\n </div>\r\n <div class=\"subtext-container\">\r\n <!--wordCount-->\r\n <div class=\"bbsf-word-count\" *ngIf=\"options.maxWordCount>0&&isShowWordCount\">\r\n {{wordCount}}/{{options.maxWordCount}} Words</div>\r\n <!-- CharsLimitMsg-->\r\n <div class=\"bbsf-character-count\" *ngIf=\"showCharsLimitMsg\"\r\n [ngClass]=\"{'badge-light-warning': charsLimitMsgClass === 'warning', 'badge-light-danger' : charsLimitMsgClass === 'danger' }\">\r\n {{maxLimitWarningMsg}}\r\n </div>\r\n <!-- LabelDescription-->\r\n <div class=\"bbsf-control-desc\" *ngIf=\"options.labelDescription!=null\">{{options.labelDescription}}</div>\r\n <!-- requiredText-->\r\n <div class=\"bbsf-validation\" [dir]=\"textDir\" *ngIf=\"(textAreaFormControl.invalid && textAreaFormControl.touched)\">\r\n {{getErrorValidation(textAreaFormControl.errors|keyvalue)}}\r\n </div>\r\n </div>\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">\r\n {{resetError()}}</div>\r\n </div>\r\n" }]
7291
7302
  }], ctorParameters: () => [{ type: ControlUtility }, { type: i2.ControlContainer, decorators: [{
7292
7303
  type: Optional
7293
7304
  }] }, { type: i2.FormGroupDirective }, { type: i3.UtilityService }, { type: i3.ControlValidationService }, { type: GlobalSettings }, { type: i3.SpeechRecognitionService }, { type: i3.LanguageService }], propDecorators: { group: [{
@@ -8317,6 +8328,248 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImpor
8317
8328
  args: ['delete', { static: false }]
8318
8329
  }] } });
8319
8330
 
8331
+ var MarkdownMode;
8332
+ (function (MarkdownMode) {
8333
+ MarkdownMode["editor"] = "editor";
8334
+ MarkdownMode["preview"] = "preview";
8335
+ })(MarkdownMode || (MarkdownMode = {}));
8336
+ var MarkDownIcons;
8337
+ (function (MarkDownIcons) {
8338
+ MarkDownIcons["Bold"] = "Bold";
8339
+ MarkDownIcons["Italic"] = "Italic";
8340
+ MarkDownIcons["Heading"] = "Heading";
8341
+ MarkDownIcons["Reference"] = "Reference";
8342
+ MarkDownIcons["Link"] = "Link";
8343
+ MarkDownIcons["Image"] = "Image";
8344
+ MarkDownIcons["Ul"] = "Ul";
8345
+ MarkDownIcons["Ol"] = "Ol";
8346
+ MarkDownIcons["Code"] = "Code";
8347
+ MarkDownIcons["TogglePreview"] = "TogglePreview";
8348
+ MarkDownIcons["FullScreen"] = "FullScreen";
8349
+ })(MarkDownIcons || (MarkDownIcons = {}));
8350
+
8351
+ class MarkdownEditorComponent {
8352
+ static { this.controlContainerstatic = null; }
8353
+ constructor(utilityService, globalSettings, controlValidationService, controlUtility, markdownEditorControlHost, scriptService, controlContainer) {
8354
+ this.utilityService = utilityService;
8355
+ this.globalSettings = globalSettings;
8356
+ this.controlValidationService = controlValidationService;
8357
+ this.controlUtility = controlUtility;
8358
+ this.markdownEditorControlHost = markdownEditorControlHost;
8359
+ this.scriptService = scriptService;
8360
+ this.controlContainer = controlContainer;
8361
+ this.OnChange = new EventEmitter();
8362
+ this.hideToolbar = false;
8363
+ this.validationRules = [];
8364
+ this.validationRulesasync = [];
8365
+ this.markAllAsTouched = false;
8366
+ this.showMarkdown = false;
8367
+ this.btnsText = {
8368
+ Buttons: {
8369
+ Bold: { title: this.utilityService.getResourceValue('Bold') },
8370
+ Italic: { title: this.utilityService.getResourceValue('Italic') },
8371
+ Heading: { title: this.utilityService.getResourceValue('Heading') },
8372
+ Reference: { title: this.utilityService.getResourceValue('Reference') },
8373
+ Link: { title: this.utilityService.getResourceValue('Link') },
8374
+ Image: { title: this.utilityService.getResourceValue('Image') },
8375
+ UnorderedList: { title: this.utilityService.getResourceValue('UnorderedList') },
8376
+ OrderedList: { title: this.utilityService.getResourceValue('OrderedList') },
8377
+ CodeBlock: { title: this.utilityService.getResourceValue('CodeBlock') },
8378
+ ShowPreview: { title: this.utilityService.getResourceValue('ShowPreview') },
8379
+ HidePreview: { title: this.utilityService.getResourceValue('HidePreview') },
8380
+ Fullscreen: { title: this.utilityService.getResourceValue('Fullscreen') }
8381
+ },
8382
+ Upload: {
8383
+ Drag: this.utilityService.getResourceValue('DragHere'),
8384
+ Uploading: this.utilityService.getResourceValue('Uploading')
8385
+ }
8386
+ };
8387
+ this.locales = {
8388
+ en: this.btnsText,
8389
+ ar: this.btnsText
8390
+ };
8391
+ this.resetError = () => {
8392
+ this.controlValidationService.removeGlobalError();
8393
+ };
8394
+ //External Method
8395
+ this.removeRequiredValidation = () => {
8396
+ this.controlUtility.removeRequiredValidation(this.markdownEditorFormControl, this.validationRules, this.options);
8397
+ };
8398
+ //External Method
8399
+ this.addRequiredValidation = () => {
8400
+ this.controlUtility.addRequiredValidation(this.markdownEditorFormControl, this.validationRules, this.options);
8401
+ };
8402
+ //External Method
8403
+ this.removeCustomValidation = (customValidation) => {
8404
+ this.controlUtility.removeCustomValidation(this.markdownEditorFormControl, this.validationRules, customValidation);
8405
+ };
8406
+ //External Method
8407
+ this.addCustomValidation = (customValidation) => {
8408
+ this.controlUtility.addCustomValidation(this.markdownEditorFormControl, this.validationRules, customValidation);
8409
+ };
8410
+ //External Method
8411
+ this.isValid = () => {
8412
+ this.controlUtility.isValid(this.markdownEditorFormControl);
8413
+ };
8414
+ MarkdownEditorComponent.controlContainerstatic = this.controlContainer;
8415
+ this.currentLocale = this.utilityService.getCurrentLanguage();
8416
+ }
8417
+ loadAllScripts() {
8418
+ return this.scriptService.loadScript('assets/ace-builds/ace.js').pipe(switchMap$1(() => this.scriptService.loadScript('assets/ace-builds/mode-markdown.js')), switchMap$1(() => this.scriptService.loadScript('assets/ngx-markdown-editor/marked.min.js')), switchMap$1(() => this.scriptService.loadScript('assets/ngx-markdown-editor/highlight.js/highlight.min.js')));
8419
+ }
8420
+ ngOnInit() {
8421
+ this.loadAllScripts()
8422
+ .subscribe({
8423
+ next: () => this.showMarkdown = true,
8424
+ error: (err) => console.error('Error loading scripts', err)
8425
+ });
8426
+ this.mode = this.options.isReadonly ? MarkdownMode.preview : MarkdownMode.editor;
8427
+ this.editorOptions = {
8428
+ hideIcons: this.options.hideIcons,
8429
+ showPreviewPanel: this.options.showPreviewPanelOnLoad,
8430
+ resizable: false,
8431
+ enablePreviewContentClick: this.options.isReadonly,
8432
+ markedjsOpt: {
8433
+ breaks: true,
8434
+ sanitize: true,
8435
+ smartypants: true,
8436
+ xhtml: true,
8437
+ },
8438
+ customRender: this.options.customRender,
8439
+ placeholder: this.options.placeholder,
8440
+ locales: this.locales,
8441
+ customIcons: {
8442
+ CodeBlock: {
8443
+ fontClass: 'fa fa-file-code'
8444
+ }
8445
+ }
8446
+ };
8447
+ this.controlValidationService.isCreatedBefor = false;
8448
+ this.group.addControl(this.options.name, new FormControl(''));
8449
+ this.markdownEditorFormControl = this.group.controls[this.options.name]; // new FormControl('',validationRules);
8450
+ this.markdownEditorFormControl.setValue(this.options.value);
8451
+ if (!this.options.viewType)
8452
+ this.options.viewType = this.globalSettings.viewType;
8453
+ if (this.options.customValidation.length > 0) {
8454
+ let validations = this.options.customValidation;
8455
+ for (let index = 0; index < validations.length; index++) {
8456
+ const Validation = validations[index];
8457
+ this.validationRules.push(Validation.functionBody);
8458
+ }
8459
+ }
8460
+ if (this.options.labelKey != null && this.options.labelKey != "")
8461
+ this.options.labelValue = this.utilityService.getResourceValue(this.options.labelKey);
8462
+ if (this.options.minLength > 0) {
8463
+ this.validationRules.push(Validators.minLength(this.options.minLength));
8464
+ }
8465
+ if (this.options.maxLength > 0) {
8466
+ this.validationRules.push(Validators.maxLength(this.options.maxLength));
8467
+ }
8468
+ if (this.options.isRequired) {
8469
+ this.validationRules.push(Validators.required);
8470
+ }
8471
+ this.markdownEditorFormControl.setValidators(this.validationRules);
8472
+ this.markdownEditorFormControl.setAsyncValidators(this.validationRulesasync);
8473
+ if (this.options.isDisabled) {
8474
+ this.markdownEditorFormControl.disable();
8475
+ }
8476
+ this.markdownEditorControlHost.ngSubmit.subscribe((value) => {
8477
+ this.group.markAllAsTouched();
8478
+ this.markAllAsTouched = true;
8479
+ });
8480
+ }
8481
+ uploadImg(evt) {
8482
+ if (!evt)
8483
+ return;
8484
+ const file = evt.target.files[0];
8485
+ const reader = new FileReader();
8486
+ reader.addEventListener('load', () => {
8487
+ this.options.value += `![](${reader.result})`;
8488
+ }, false);
8489
+ if (file)
8490
+ reader.readAsDataURL(file);
8491
+ }
8492
+ onPreviewDomChanged(dom) {
8493
+ this.OnChange.emit(dom);
8494
+ }
8495
+ showGlobalError() {
8496
+ this.controlUtility.showGlobalError();
8497
+ }
8498
+ getErrorValidation(ErrorList) {
8499
+ if (this.markAllAsTouched && this.group.invalid) {
8500
+ this.showGlobalError();
8501
+ this.markAllAsTouched = false;
8502
+ }
8503
+ return this.controlUtility.getErrorValidationMassage(ErrorList, this.group, this.options);
8504
+ }
8505
+ //Fires on markdown editor has been loaded
8506
+ onEditorLoaded(editor) {
8507
+ if (this.options.isDisabled) {
8508
+ const textarea = editor.renderer.textarea;
8509
+ if (textarea && this.options.isDisabled) {
8510
+ textarea.setAttribute('disabled', 'true');
8511
+ }
8512
+ this.hideToolbar = true;
8513
+ }
8514
+ }
8515
+ //The doUpload method handles file uploads when users add images or other files to the editor.
8516
+ //This method should be implemented to manage file uploads to a server or cloud storage and return the result to the editor.
8517
+ //fires on drag and drop or copy paste
8518
+ //if not set will can't add files or images using this way
8519
+ onDragFile(files) {
8520
+ const results = [];
8521
+ // Function to handle a single file
8522
+ const processFile = (file) => {
8523
+ return new Promise((resolve, reject) => {
8524
+ const reader = new FileReader();
8525
+ reader.onload = () => {
8526
+ const fileUrl = reader.result;
8527
+ const result = {
8528
+ name: file.name,
8529
+ url: fileUrl,
8530
+ isImg: file.type.startsWith('image/')
8531
+ };
8532
+ resolve(result);
8533
+ };
8534
+ reader.onerror = (error) => {
8535
+ reject(error);
8536
+ };
8537
+ // Read the file as a data URL
8538
+ reader.readAsDataURL(file);
8539
+ });
8540
+ };
8541
+ // // Iterate over files and process each one
8542
+ const processAllFiles = async () => {
8543
+ for (const file of files) {
8544
+ try {
8545
+ const result = await processFile(file);
8546
+ results.push(result);
8547
+ }
8548
+ catch (error) {
8549
+ console.error('Error processing file:', error);
8550
+ }
8551
+ }
8552
+ return results;
8553
+ };
8554
+ //Return the promise that resolves when all files are processed
8555
+ return processAllFiles();
8556
+ }
8557
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: MarkdownEditorComponent, deps: [{ token: i3.UtilityService }, { token: GlobalSettings }, { token: i3.ControlValidationService }, { token: ControlUtility }, { token: i2.FormGroupDirective }, { token: i5$2.ScriptService }, { token: i2.ControlContainer, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
8558
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.0.6", type: MarkdownEditorComponent, selector: "BBSF-MarkdownEditor", inputs: { group: "group", options: "options" }, outputs: { OnChange: "OnChange" }, ngImport: i0, template: "<ng-container *ngIf=\"showMarkdown\">\r\n <div class=\"form-group bbsf-control bbsf-htmleditor\" [formGroup]=\"group\">\r\n <div [ngClass]=\"(options.viewType==1)?'bbsf-vertical':'bbsf-horizontal'\">\r\n <!--label-->\r\n <label *ngIf=\"!options.hideLabel\" class=\"bbsf-label {{options.labelExtraClasses}}\">\r\n {{options.labelValue}}\r\n <!--Asterisk-->\r\n <span *ngIf=\"((options.showAsterisk&&options.isRequired)||(options.isRequired))&&!options.isReadonly\"\r\n class=\"text-danger\">*</span>\r\n </label>\r\n <div class=\"bbsf-input-container {{options.extraClasses}}\">\r\n <md-editor id=\"{{options.name}}\" formControlName=\"{{options.name}}\"\r\n (onPreviewDomChanged)=\"onPreviewDomChanged($event)\"\r\n [(ngModel)]=\"options.value\" [mode]=\"mode\" [options]=\"editorOptions\" [attr.required]=\"options.isRequired ? true : null\" [upload]=\"onDragFile\" \r\n [maxlength]=\"options.maxLength\" [height]=\"options.height\" [locale]=\"currentLocale\" (onEditorLoaded)=\"onEditorLoaded($event)\" [hideToolbar]=\"hideToolbar\">\r\n <!-- [ngStyle]=\"{ 'direction': textDirection, 'text-align': textDirection === 'rtl' ? 'right' : 'left' }\" -->\r\n <div custom-btns>\r\n <input #imgInput type=\"file\" style=\"display: none\" (change)=\"uploadImg($event)\" />\r\n <button type=\"button\" class=\"btn btn-sm btn-default\" (click)=\"imgInput.click()\">\r\n {{utilityService.getResourceValue(\"UploadImg\")}}\r\n </button>\r\n </div>\r\n </md-editor>\r\n </div>\r\n\r\n <div class=\"subtext-container\">\r\n <div class=\"bbsf-control-desc\" *ngIf=\"options.labelDescription!=null\">{{options.labelDescription}}</div>\r\n <div class=\"bbsf-validation\" *ngIf=\"(markdownEditorFormControl.invalid && markdownEditorFormControl.touched)\">\r\n {{getErrorValidation(markdownEditorFormControl.errors|keyvalue)}}\r\n </div>\r\n </div>\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">\r\n {{resetError()}}</div>\r\n </div>\r\n </div>\r\n</ng-container>\r\n", dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i7.NativeElementInjectorDirective, selector: "[ngModel], [formControl], [formControlName]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i8$4.MarkdownEditorComponent, selector: "md-editor", inputs: ["hideToolbar", "height", "preRender", "postRender", "upload", "locale", "maxlength", "mode", "options"], outputs: ["onEditorLoaded", "onPreviewDomChanged"] }, { kind: "pipe", type: i5.KeyValuePipe, name: "keyvalue" }] }); }
8559
+ }
8560
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: MarkdownEditorComponent, decorators: [{
8561
+ type: Component,
8562
+ args: [{ selector: 'BBSF-MarkdownEditor', template: "<ng-container *ngIf=\"showMarkdown\">\r\n <div class=\"form-group bbsf-control bbsf-htmleditor\" [formGroup]=\"group\">\r\n <div [ngClass]=\"(options.viewType==1)?'bbsf-vertical':'bbsf-horizontal'\">\r\n <!--label-->\r\n <label *ngIf=\"!options.hideLabel\" class=\"bbsf-label {{options.labelExtraClasses}}\">\r\n {{options.labelValue}}\r\n <!--Asterisk-->\r\n <span *ngIf=\"((options.showAsterisk&&options.isRequired)||(options.isRequired))&&!options.isReadonly\"\r\n class=\"text-danger\">*</span>\r\n </label>\r\n <div class=\"bbsf-input-container {{options.extraClasses}}\">\r\n <md-editor id=\"{{options.name}}\" formControlName=\"{{options.name}}\"\r\n (onPreviewDomChanged)=\"onPreviewDomChanged($event)\"\r\n [(ngModel)]=\"options.value\" [mode]=\"mode\" [options]=\"editorOptions\" [attr.required]=\"options.isRequired ? true : null\" [upload]=\"onDragFile\" \r\n [maxlength]=\"options.maxLength\" [height]=\"options.height\" [locale]=\"currentLocale\" (onEditorLoaded)=\"onEditorLoaded($event)\" [hideToolbar]=\"hideToolbar\">\r\n <!-- [ngStyle]=\"{ 'direction': textDirection, 'text-align': textDirection === 'rtl' ? 'right' : 'left' }\" -->\r\n <div custom-btns>\r\n <input #imgInput type=\"file\" style=\"display: none\" (change)=\"uploadImg($event)\" />\r\n <button type=\"button\" class=\"btn btn-sm btn-default\" (click)=\"imgInput.click()\">\r\n {{utilityService.getResourceValue(\"UploadImg\")}}\r\n </button>\r\n </div>\r\n </md-editor>\r\n </div>\r\n\r\n <div class=\"subtext-container\">\r\n <div class=\"bbsf-control-desc\" *ngIf=\"options.labelDescription!=null\">{{options.labelDescription}}</div>\r\n <div class=\"bbsf-validation\" *ngIf=\"(markdownEditorFormControl.invalid && markdownEditorFormControl.touched)\">\r\n {{getErrorValidation(markdownEditorFormControl.errors|keyvalue)}}\r\n </div>\r\n </div>\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">\r\n {{resetError()}}</div>\r\n </div>\r\n </div>\r\n</ng-container>\r\n" }]
8563
+ }], ctorParameters: () => [{ type: i3.UtilityService }, { type: GlobalSettings }, { type: i3.ControlValidationService }, { type: ControlUtility }, { type: i2.FormGroupDirective }, { type: i5$2.ScriptService }, { type: i2.ControlContainer, decorators: [{
8564
+ type: Optional
8565
+ }] }], propDecorators: { group: [{
8566
+ type: Input
8567
+ }], options: [{
8568
+ type: Input
8569
+ }], OnChange: [{
8570
+ type: Output
8571
+ }] } });
8572
+
8320
8573
  let options;
8321
8574
  class BBSFControlsModule {
8322
8575
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: BBSFControlsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
@@ -8352,7 +8605,8 @@ class BBSFControlsModule {
8352
8605
  BBSFDatePipe,
8353
8606
  BTagsInputComponent,
8354
8607
  RecaptchaComponent,
8355
- PageHeaderComponentComponent], imports: [CommonModule,
8608
+ PageHeaderComponentComponent,
8609
+ MarkdownEditorComponent], imports: [CommonModule,
8356
8610
  InfiniteScrollModule,
8357
8611
  NgSelectModule,
8358
8612
  FullCalendarModule,
@@ -8373,7 +8627,8 @@ class BBSFControlsModule {
8373
8627
  AutocompleteLibModule,
8374
8628
  BBSFUtilitiesModule, i8$3.InlineSVGModule, SweetAlert2Module,
8375
8629
  ScriptLoaderModule,
8376
- GoogleMapsModule], exports: [DateInputComponent,
8630
+ GoogleMapsModule,
8631
+ LMarkdownEditorModule], exports: [DateInputComponent,
8377
8632
  FileUploadComponent,
8378
8633
  MultiLingualTextBoxComponent,
8379
8634
  TextboxComponent,
@@ -8405,7 +8660,8 @@ class BBSFControlsModule {
8405
8660
  BBSFDateTimePipe,
8406
8661
  BBSFDatePipe,
8407
8662
  RecaptchaComponent,
8408
- PageHeaderComponentComponent] }); }
8663
+ PageHeaderComponentComponent,
8664
+ MarkdownEditorComponent] }); }
8409
8665
  static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: BBSFControlsModule, providers: [
8410
8666
  ErrorMassageValidation,
8411
8667
  ControlUtility,
@@ -8450,7 +8706,8 @@ class BBSFControlsModule {
8450
8706
  InlineSVGModule.forRoot(),
8451
8707
  SweetAlert2Module,
8452
8708
  ScriptLoaderModule,
8453
- GoogleMapsModule] }); }
8709
+ GoogleMapsModule,
8710
+ LMarkdownEditorModule] }); }
8454
8711
  }
8455
8712
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: BBSFControlsModule, decorators: [{
8456
8713
  type: NgModule,
@@ -8488,7 +8745,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImpor
8488
8745
  BBSFDatePipe,
8489
8746
  BTagsInputComponent,
8490
8747
  RecaptchaComponent,
8491
- PageHeaderComponentComponent
8748
+ PageHeaderComponentComponent,
8749
+ MarkdownEditorComponent
8492
8750
  ],
8493
8751
  imports: [
8494
8752
  CommonModule,
@@ -8523,7 +8781,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImpor
8523
8781
  InlineSVGModule.forRoot(),
8524
8782
  SweetAlert2Module,
8525
8783
  ScriptLoaderModule,
8526
- GoogleMapsModule
8784
+ GoogleMapsModule,
8785
+ LMarkdownEditorModule
8527
8786
  ],
8528
8787
  providers: [
8529
8788
  ErrorMassageValidation,
@@ -8576,7 +8835,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImpor
8576
8835
  BBSFDateTimePipe,
8577
8836
  BBSFDatePipe,
8578
8837
  RecaptchaComponent,
8579
- PageHeaderComponentComponent
8838
+ PageHeaderComponentComponent,
8839
+ MarkdownEditorComponent
8580
8840
  ]
8581
8841
  }]
8582
8842
  }] });
@@ -9264,6 +9524,29 @@ class BreadCrumb {
9264
9524
  }
9265
9525
  }
9266
9526
 
9527
+ class MarkdownEditorOptions extends ControlOptionsBase {
9528
+ constructor() {
9529
+ super(...arguments);
9530
+ /**To set value to MarkdownEditor */
9531
+ this.value = '';
9532
+ //Enable viewing preview panel
9533
+ this.showPreviewPanelOnLoad = true;
9534
+ /**
9535
+ * Array of icons to be hidden from the toolbar.
9536
+ *
9537
+ * You can populate this array with icon names from the `MarkDownIcons` enum.
9538
+ * This allows you to customize the toolbar by hiding specific icons based on your requirements.
9539
+ *
9540
+ * @example
9541
+ * // Hide the Bold and Italic icons
9542
+ * hideIcons: [MarkDownIcons.Bold, MarkDownIcons.Italic];
9543
+ */
9544
+ this.hideIcons = [];
9545
+ /** Set Height For MarkdownEditor ,default=400px */
9546
+ this.height = '400px';
9547
+ }
9548
+ }
9549
+
9267
9550
  var MenuListType;
9268
9551
  (function (MenuListType) {
9269
9552
  MenuListType[MenuListType["AdminType"] = 1] = "AdminType";
@@ -9595,5 +9878,5 @@ var FileType;
9595
9878
  * Generated bundle index. Do not edit.
9596
9879
  */
9597
9880
 
9598
- export { AddButton, AppBaseComponent, Attribute, AutocompleteDTO, AutocompleteOptions, AutocompleteTextBoxComponent, BBSFControlsModule, BBSFDatePipe, BBSFDateTimePipe, BreadCrumb, BreadCrumbModel, CalendarComponent, CalendarEventDTO, CalendarOptions, CalendarView, CancelDTO, CheckBoxComponent, CheckBoxOptions, ConfirmationModalComponent, ConfirmationModalOptions, ControlFilterItem, ControlLayout, ControlOptionsBase, ControlUtility, Country, CustomValidation, CustomValidator, DataType, DateInputComponent, DatePickerOptions, DefaultIntl, DeleteButton, DropdownActionItem, DropdownActions, DropdownListComponent, DropdownListItem, DropdownOptions, EditButton, EditPersonalImage, EnglishArabicDTO, ErrorMassageValidation, ExportButton, FileDTO, FileType, FileUploadComponent, FileUploadModel, FileUploadOptions, FilterItem, FilterOptions, FilterType, FiltersButton, FontSize, ForceDirection, FormComponent, FormOptions, GlobalSettings, GridViewModel, HtmlEditorComponent, HtmlEditorOptions, IconPosition, ImageType, ImageUploadOptions, ImageUploaderComponent, InputType, Insert, JwPaginationComponent, LanguageMode, LanguageValidation, MapAutoCompleteComponent, MapAutoCompleteOptions, MapAutocompleteDTO, MapSearchTypes, MenuListType, Misc, MultiLingualHtmlEditorComponent, MultiLingualHtmlEditorOptions, MultiLingualTextAreaComponent, MultiLingualTextAreaOptions, MultiLingualTextBoxComponent, MultiLingualTextBoxOptions, MultilingualControlOptionsBase, MultipleFileUploadModel, NgTemplateNameDirective, OnPagingFiltersChangeService, PageHeaderComponentComponent, PageHeaderOptions, PagingActionMode, PagingComponent, PagingDTO, PagingOptions, Para, PermissionSets, PhoneComponent, PhoneOptions, PickerType, ProfileImageUploadOptions, ProfileImageUploaderComponent, ProfilePictureDTO, RadioButtonComponent, RadioButtonItem, RadioButtonOptions, RangeNumber, RecaptchaComponent, RecaptchaModel, RecaptchaOptions, RenderComponentService, RepeaterComponent, RepeaterField, RepeaterFieldBuilderComponent, RepeaterItemFieldComponent, RepeaterOptions, RepeaterTableComponent, SaveDTO, SelectMode, StartView, Style, StyleConfirmationMode, TagInputView, TagsInputComponent, TagsInputDTO, TagsInputOptions, TextAreaComponent, TextAreaOptions, TextBoxModel, TextBoxOptions, TextboxComponent, ToggleSlideOptions, ToggleslideComponent, UploadPersonalImage, environment, options };
9881
+ export { AddButton, AppBaseComponent, Attribute, AutocompleteDTO, AutocompleteOptions, AutocompleteTextBoxComponent, BBSFControlsModule, BBSFDatePipe, BBSFDateTimePipe, BreadCrumb, BreadCrumbModel, CalendarComponent, CalendarEventDTO, CalendarOptions, CalendarView, CancelDTO, CheckBoxComponent, CheckBoxOptions, ConfirmationModalComponent, ConfirmationModalOptions, ControlFilterItem, ControlLayout, ControlOptionsBase, ControlUtility, Country, CustomValidation, CustomValidator, DataType, DateInputComponent, DatePickerOptions, DefaultIntl, DeleteButton, DropdownActionItem, DropdownActions, DropdownListComponent, DropdownListItem, DropdownOptions, EditButton, EditPersonalImage, EnglishArabicDTO, ErrorMassageValidation, ExportButton, FileDTO, FileType, FileUploadComponent, FileUploadModel, FileUploadOptions, FilterItem, FilterOptions, FilterType, FiltersButton, FontSize, ForceDirection, FormComponent, FormOptions, GlobalSettings, GridViewModel, HtmlEditorComponent, HtmlEditorOptions, IconPosition, ImageType, ImageUploadOptions, ImageUploaderComponent, InputType, Insert, JwPaginationComponent, LanguageMode, LanguageValidation, MapAutoCompleteComponent, MapAutoCompleteOptions, MapAutocompleteDTO, MapSearchTypes, MarkDownIcons, MarkdownEditorComponent, MarkdownEditorOptions, MarkdownMode, MenuListType, Misc, MultiLingualHtmlEditorComponent, MultiLingualHtmlEditorOptions, MultiLingualTextAreaComponent, MultiLingualTextAreaOptions, MultiLingualTextBoxComponent, MultiLingualTextBoxOptions, MultilingualControlOptionsBase, MultipleFileUploadModel, NgTemplateNameDirective, OnPagingFiltersChangeService, PageHeaderComponentComponent, PageHeaderOptions, PagingActionMode, PagingComponent, PagingDTO, PagingOptions, Para, PermissionSets, PhoneComponent, PhoneOptions, PickerType, ProfileImageUploadOptions, ProfileImageUploaderComponent, ProfilePictureDTO, RadioButtonComponent, RadioButtonItem, RadioButtonOptions, RangeNumber, RecaptchaComponent, RecaptchaModel, RecaptchaOptions, RenderComponentService, RepeaterComponent, RepeaterField, RepeaterFieldBuilderComponent, RepeaterItemFieldComponent, RepeaterOptions, RepeaterTableComponent, SaveDTO, SelectMode, StartView, Style, StyleConfirmationMode, TagInputView, TagsInputComponent, TagsInputDTO, TagsInputOptions, TextAreaComponent, TextAreaOptions, TextBoxModel, TextBoxOptions, TextboxComponent, ToggleSlideOptions, ToggleslideComponent, UploadPersonalImage, environment, options };
9599
9882
  //# sourceMappingURL=bnsights-bbsf-controls.mjs.map