@bnsights/bbsf-controls 1.0.150 → 1.0.152
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/bnsights-bbsf-controls-1.0.152.tgz +0 -0
- package/esm2022/lib/Shared/Components/app-base-component.mjs +1 -1
- package/esm2022/lib/Shared/Enums/Markdown.mjs +20 -0
- package/esm2022/lib/Shared/Models/MarkdownEditorOptions.mjs +24 -0
- package/esm2022/lib/Shared/Models/TextAreaOptions.mjs +1 -1
- package/esm2022/lib/Shared/services/file-upload.service.mjs +1 -1
- package/esm2022/lib/controls/AutocompleteTextBox/AutocompleteTextBox.component.mjs +1 -1
- package/esm2022/lib/controls/ConfirmationModal/ConfirmationModal.component.mjs +25 -21
- package/esm2022/lib/controls/DateTimePicker/DateTimePicker.component.mjs +1 -1
- package/esm2022/lib/controls/DropdownList/DropdownList.component.mjs +1 -1
- package/esm2022/lib/controls/FileUplaod/FileUplaod.component.mjs +1 -1
- package/esm2022/lib/controls/Form/Form.component.mjs +1 -1
- package/esm2022/lib/controls/HtmlEditor/HtmlEditor.component.mjs +1 -1
- package/esm2022/lib/controls/ImageUpload/ImageUpload.component.mjs +1 -1
- package/esm2022/lib/controls/MapAutoComplete/MapAutoComplete.component.mjs +1 -1
- package/esm2022/lib/controls/MarkdownEditor/markdown-editor.component.mjs +235 -0
- package/esm2022/lib/controls/MultiLingualHtmlEditor/MultiLingualHtmlEditor.component.mjs +1 -1
- package/esm2022/lib/controls/MultiLingualTextArea/MultiLingualTextArea.component.mjs +1 -1
- package/esm2022/lib/controls/MultiLingualTextBox/MultiLingualTextBox.component.mjs +1 -1
- package/esm2022/lib/controls/Paging/Paging.component.mjs +1 -1
- package/esm2022/lib/controls/Phone/Phone.component.mjs +1 -1
- package/esm2022/lib/controls/ProfileImageUploader/ProfileImageUploader.component.mjs +1 -1
- package/esm2022/lib/controls/Recaptcha/Recaptcha.component.mjs +1 -1
- package/esm2022/lib/controls/TagsInput/TagsInput.component.mjs +1 -1
- package/esm2022/lib/controls/TextArea/TextArea.component.mjs +1 -1
- package/esm2022/lib/controls/TextBox/TextBox.component.mjs +1 -1
- package/esm2022/lib/controls/Toggleslide/Toggleslide.component.mjs +1 -1
- package/esm2022/lib/controls/bbsf-controls.module.mjs +17 -8
- package/esm2022/public-api.mjs +4 -1
- package/fesm2022/bnsights-bbsf-controls.mjs +307 -29
- package/fesm2022/bnsights-bbsf-controls.mjs.map +1 -1
- package/lib/Shared/Enums/Markdown.d.ts +17 -0
- package/lib/Shared/Models/MarkdownEditorOptions.d.ts +29 -0
- package/lib/controls/MarkdownEditor/markdown-editor.component.d.ts +94 -0
- package/lib/controls/bbsf-controls.module.d.ts +32 -30
- package/package.json +19 -17
- package/public-api.d.ts +3 -0
- package/src/lib/assets/Style-rtl.scss +18 -2
- package/src/lib/assets/Style.scss +4 -1
- package/src/lib/assets/ace-builds/ace.js +23 -0
- package/src/lib/assets/ace-builds/mode-markdown.js +8 -0
- package/src/lib/assets/ngx-markdown-editor/highlight.js/agate.min.css +17 -0
- package/src/lib/assets/ngx-markdown-editor/highlight.js/highlight.min.js +2 -0
- package/src/lib/assets/ngx-markdown-editor/marked.min.js +6 -0
- package/src/lib/assets/sass/markdown.scss +98 -0
- package/bnsights-bbsf-controls-1.0.150.tgz +0 -0
|
@@ -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
|
|
|
@@ -1468,7 +1470,7 @@ class ConfirmationModalComponent {
|
|
|
1468
1470
|
this.utilityService.startBlockUI();
|
|
1469
1471
|
//check for options text values
|
|
1470
1472
|
this.setTextValues();
|
|
1471
|
-
|
|
1473
|
+
//#region sweetalert styles
|
|
1472
1474
|
switch (this.options.styleConfirmationMode) {
|
|
1473
1475
|
case this.styleSuccess: {
|
|
1474
1476
|
this.icon = 'success';
|
|
@@ -1489,6 +1491,7 @@ class ConfirmationModalComponent {
|
|
|
1489
1491
|
break;
|
|
1490
1492
|
}
|
|
1491
1493
|
}
|
|
1494
|
+
//#endregion
|
|
1492
1495
|
Swal.fire({
|
|
1493
1496
|
title: this.utilityService.getResourceValue(this.options.confirmationHeader),
|
|
1494
1497
|
text: this.options.confirmationBody,
|
|
@@ -1522,26 +1525,29 @@ class ConfirmationModalComponent {
|
|
|
1522
1525
|
submit() {
|
|
1523
1526
|
let submitModel = this.options.serviceSubmitModel;
|
|
1524
1527
|
let submittedService = this.options.serviceSubmitFunction.apply(null, submitModel);
|
|
1525
|
-
submittedService.subscribe(
|
|
1526
|
-
|
|
1527
|
-
this.
|
|
1528
|
-
|
|
1529
|
-
if (!this.options.
|
|
1530
|
-
this.options.successNotificationMessage
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
this.options.onSuccessHandler
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1528
|
+
submittedService.subscribe({
|
|
1529
|
+
next: (result) => {
|
|
1530
|
+
if (!this.options.disableModalDismiss)
|
|
1531
|
+
this.modalService.dismissAll();
|
|
1532
|
+
if (!this.options.disableSuccessNotification) {
|
|
1533
|
+
if (!this.options.successNotificationMessage)
|
|
1534
|
+
this.options.successNotificationMessage = this.utilityService.getResourceValue("DeletedSuccessfully");
|
|
1535
|
+
this.utilityService.notifySuccessMessage(this.options.successNotificationMessage);
|
|
1536
|
+
}
|
|
1537
|
+
if (this.options.onSuccessHandler)
|
|
1538
|
+
this.options.onSuccessHandler(result);
|
|
1539
|
+
if (this.options.pagingReference) {
|
|
1540
|
+
let paging = this.options.pagingReference;
|
|
1541
|
+
this.options.pagingActionMode == PagingActionMode.Reinitialize ? paging.reinitializePaging() : paging.updatePaging();
|
|
1542
|
+
}
|
|
1543
|
+
this.utilityService.stopBlockUI();
|
|
1544
|
+
},
|
|
1545
|
+
error: (error) => {
|
|
1546
|
+
if (this.options.onErrorHandler)
|
|
1547
|
+
this.options.onErrorHandler(error);
|
|
1548
|
+
else
|
|
1549
|
+
this.handleError(error);
|
|
1538
1550
|
}
|
|
1539
|
-
this.utilityService.stopBlockUI();
|
|
1540
|
-
}, (error) => {
|
|
1541
|
-
if (this.options.onErrorHandler)
|
|
1542
|
-
this.options.onErrorHandler(error);
|
|
1543
|
-
else
|
|
1544
|
-
this.handleError(error);
|
|
1545
1551
|
});
|
|
1546
1552
|
}
|
|
1547
1553
|
handleError(err) {
|
|
@@ -8326,6 +8332,248 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImpor
|
|
|
8326
8332
|
args: ['delete', { static: false }]
|
|
8327
8333
|
}] } });
|
|
8328
8334
|
|
|
8335
|
+
var MarkdownMode;
|
|
8336
|
+
(function (MarkdownMode) {
|
|
8337
|
+
MarkdownMode["editor"] = "editor";
|
|
8338
|
+
MarkdownMode["preview"] = "preview";
|
|
8339
|
+
})(MarkdownMode || (MarkdownMode = {}));
|
|
8340
|
+
var MarkDownIcons;
|
|
8341
|
+
(function (MarkDownIcons) {
|
|
8342
|
+
MarkDownIcons["Bold"] = "Bold";
|
|
8343
|
+
MarkDownIcons["Italic"] = "Italic";
|
|
8344
|
+
MarkDownIcons["Heading"] = "Heading";
|
|
8345
|
+
MarkDownIcons["Reference"] = "Reference";
|
|
8346
|
+
MarkDownIcons["Link"] = "Link";
|
|
8347
|
+
MarkDownIcons["Image"] = "Image";
|
|
8348
|
+
MarkDownIcons["Ul"] = "Ul";
|
|
8349
|
+
MarkDownIcons["Ol"] = "Ol";
|
|
8350
|
+
MarkDownIcons["Code"] = "Code";
|
|
8351
|
+
MarkDownIcons["TogglePreview"] = "TogglePreview";
|
|
8352
|
+
MarkDownIcons["FullScreen"] = "FullScreen";
|
|
8353
|
+
})(MarkDownIcons || (MarkDownIcons = {}));
|
|
8354
|
+
|
|
8355
|
+
class MarkdownEditorComponent {
|
|
8356
|
+
static { this.controlContainerstatic = null; }
|
|
8357
|
+
constructor(utilityService, globalSettings, controlValidationService, controlUtility, markdownEditorControlHost, scriptService, controlContainer) {
|
|
8358
|
+
this.utilityService = utilityService;
|
|
8359
|
+
this.globalSettings = globalSettings;
|
|
8360
|
+
this.controlValidationService = controlValidationService;
|
|
8361
|
+
this.controlUtility = controlUtility;
|
|
8362
|
+
this.markdownEditorControlHost = markdownEditorControlHost;
|
|
8363
|
+
this.scriptService = scriptService;
|
|
8364
|
+
this.controlContainer = controlContainer;
|
|
8365
|
+
this.OnChange = new EventEmitter();
|
|
8366
|
+
this.hideToolbar = false;
|
|
8367
|
+
this.validationRules = [];
|
|
8368
|
+
this.validationRulesasync = [];
|
|
8369
|
+
this.markAllAsTouched = false;
|
|
8370
|
+
this.showMarkdown = false;
|
|
8371
|
+
this.btnsText = {
|
|
8372
|
+
Buttons: {
|
|
8373
|
+
Bold: { title: this.utilityService.getResourceValue('Bold') },
|
|
8374
|
+
Italic: { title: this.utilityService.getResourceValue('Italic') },
|
|
8375
|
+
Heading: { title: this.utilityService.getResourceValue('Heading') },
|
|
8376
|
+
Reference: { title: this.utilityService.getResourceValue('Reference') },
|
|
8377
|
+
Link: { title: this.utilityService.getResourceValue('Link') },
|
|
8378
|
+
Image: { title: this.utilityService.getResourceValue('Image') },
|
|
8379
|
+
UnorderedList: { title: this.utilityService.getResourceValue('UnorderedList') },
|
|
8380
|
+
OrderedList: { title: this.utilityService.getResourceValue('OrderedList') },
|
|
8381
|
+
CodeBlock: { title: this.utilityService.getResourceValue('CodeBlock') },
|
|
8382
|
+
ShowPreview: { title: this.utilityService.getResourceValue('ShowPreview') },
|
|
8383
|
+
HidePreview: { title: this.utilityService.getResourceValue('HidePreview') },
|
|
8384
|
+
Fullscreen: { title: this.utilityService.getResourceValue('Fullscreen') }
|
|
8385
|
+
},
|
|
8386
|
+
Upload: {
|
|
8387
|
+
Drag: this.utilityService.getResourceValue('DragHere'),
|
|
8388
|
+
Uploading: this.utilityService.getResourceValue('Uploading')
|
|
8389
|
+
}
|
|
8390
|
+
};
|
|
8391
|
+
this.locales = {
|
|
8392
|
+
en: this.btnsText,
|
|
8393
|
+
ar: this.btnsText
|
|
8394
|
+
};
|
|
8395
|
+
this.resetError = () => {
|
|
8396
|
+
this.controlValidationService.removeGlobalError();
|
|
8397
|
+
};
|
|
8398
|
+
//External Method
|
|
8399
|
+
this.removeRequiredValidation = () => {
|
|
8400
|
+
this.controlUtility.removeRequiredValidation(this.markdownEditorFormControl, this.validationRules, this.options);
|
|
8401
|
+
};
|
|
8402
|
+
//External Method
|
|
8403
|
+
this.addRequiredValidation = () => {
|
|
8404
|
+
this.controlUtility.addRequiredValidation(this.markdownEditorFormControl, this.validationRules, this.options);
|
|
8405
|
+
};
|
|
8406
|
+
//External Method
|
|
8407
|
+
this.removeCustomValidation = (customValidation) => {
|
|
8408
|
+
this.controlUtility.removeCustomValidation(this.markdownEditorFormControl, this.validationRules, customValidation);
|
|
8409
|
+
};
|
|
8410
|
+
//External Method
|
|
8411
|
+
this.addCustomValidation = (customValidation) => {
|
|
8412
|
+
this.controlUtility.addCustomValidation(this.markdownEditorFormControl, this.validationRules, customValidation);
|
|
8413
|
+
};
|
|
8414
|
+
//External Method
|
|
8415
|
+
this.isValid = () => {
|
|
8416
|
+
this.controlUtility.isValid(this.markdownEditorFormControl);
|
|
8417
|
+
};
|
|
8418
|
+
MarkdownEditorComponent.controlContainerstatic = this.controlContainer;
|
|
8419
|
+
this.currentLocale = this.utilityService.getCurrentLanguage();
|
|
8420
|
+
}
|
|
8421
|
+
loadAllScripts() {
|
|
8422
|
+
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')));
|
|
8423
|
+
}
|
|
8424
|
+
ngOnInit() {
|
|
8425
|
+
this.loadAllScripts()
|
|
8426
|
+
.subscribe({
|
|
8427
|
+
next: () => this.showMarkdown = true,
|
|
8428
|
+
error: (err) => console.error('Error loading scripts', err)
|
|
8429
|
+
});
|
|
8430
|
+
this.mode = this.options.isReadonly ? MarkdownMode.preview : MarkdownMode.editor;
|
|
8431
|
+
this.editorOptions = {
|
|
8432
|
+
hideIcons: this.options.hideIcons,
|
|
8433
|
+
showPreviewPanel: this.options.showPreviewPanelOnLoad,
|
|
8434
|
+
resizable: false,
|
|
8435
|
+
enablePreviewContentClick: this.options.isReadonly,
|
|
8436
|
+
markedjsOpt: {
|
|
8437
|
+
breaks: true,
|
|
8438
|
+
sanitize: true,
|
|
8439
|
+
smartypants: true,
|
|
8440
|
+
xhtml: true,
|
|
8441
|
+
},
|
|
8442
|
+
customRender: this.options.customRender,
|
|
8443
|
+
placeholder: this.options.placeholder,
|
|
8444
|
+
locales: this.locales,
|
|
8445
|
+
customIcons: {
|
|
8446
|
+
CodeBlock: {
|
|
8447
|
+
fontClass: 'fa fa-file-code'
|
|
8448
|
+
}
|
|
8449
|
+
}
|
|
8450
|
+
};
|
|
8451
|
+
this.controlValidationService.isCreatedBefor = false;
|
|
8452
|
+
this.group.addControl(this.options.name, new FormControl(''));
|
|
8453
|
+
this.markdownEditorFormControl = this.group.controls[this.options.name]; // new FormControl('',validationRules);
|
|
8454
|
+
this.markdownEditorFormControl.setValue(this.options.value);
|
|
8455
|
+
if (!this.options.viewType)
|
|
8456
|
+
this.options.viewType = this.globalSettings.viewType;
|
|
8457
|
+
if (this.options.customValidation.length > 0) {
|
|
8458
|
+
let validations = this.options.customValidation;
|
|
8459
|
+
for (let index = 0; index < validations.length; index++) {
|
|
8460
|
+
const Validation = validations[index];
|
|
8461
|
+
this.validationRules.push(Validation.functionBody);
|
|
8462
|
+
}
|
|
8463
|
+
}
|
|
8464
|
+
if (this.options.labelKey != null && this.options.labelKey != "")
|
|
8465
|
+
this.options.labelValue = this.utilityService.getResourceValue(this.options.labelKey);
|
|
8466
|
+
if (this.options.minLength > 0) {
|
|
8467
|
+
this.validationRules.push(Validators.minLength(this.options.minLength));
|
|
8468
|
+
}
|
|
8469
|
+
if (this.options.maxLength > 0) {
|
|
8470
|
+
this.validationRules.push(Validators.maxLength(this.options.maxLength));
|
|
8471
|
+
}
|
|
8472
|
+
if (this.options.isRequired) {
|
|
8473
|
+
this.validationRules.push(Validators.required);
|
|
8474
|
+
}
|
|
8475
|
+
this.markdownEditorFormControl.setValidators(this.validationRules);
|
|
8476
|
+
this.markdownEditorFormControl.setAsyncValidators(this.validationRulesasync);
|
|
8477
|
+
if (this.options.isDisabled) {
|
|
8478
|
+
this.markdownEditorFormControl.disable();
|
|
8479
|
+
}
|
|
8480
|
+
this.markdownEditorControlHost.ngSubmit.subscribe((value) => {
|
|
8481
|
+
this.group.markAllAsTouched();
|
|
8482
|
+
this.markAllAsTouched = true;
|
|
8483
|
+
});
|
|
8484
|
+
}
|
|
8485
|
+
uploadImg(evt) {
|
|
8486
|
+
if (!evt)
|
|
8487
|
+
return;
|
|
8488
|
+
const file = evt.target.files[0];
|
|
8489
|
+
const reader = new FileReader();
|
|
8490
|
+
reader.addEventListener('load', () => {
|
|
8491
|
+
this.options.value += ``;
|
|
8492
|
+
}, false);
|
|
8493
|
+
if (file)
|
|
8494
|
+
reader.readAsDataURL(file);
|
|
8495
|
+
}
|
|
8496
|
+
onPreviewDomChanged(dom) {
|
|
8497
|
+
this.OnChange.emit(dom);
|
|
8498
|
+
}
|
|
8499
|
+
showGlobalError() {
|
|
8500
|
+
this.controlUtility.showGlobalError();
|
|
8501
|
+
}
|
|
8502
|
+
getErrorValidation(ErrorList) {
|
|
8503
|
+
if (this.markAllAsTouched && this.group.invalid) {
|
|
8504
|
+
this.showGlobalError();
|
|
8505
|
+
this.markAllAsTouched = false;
|
|
8506
|
+
}
|
|
8507
|
+
return this.controlUtility.getErrorValidationMassage(ErrorList, this.group, this.options);
|
|
8508
|
+
}
|
|
8509
|
+
//Fires on markdown editor has been loaded
|
|
8510
|
+
onEditorLoaded(editor) {
|
|
8511
|
+
if (this.options.isDisabled) {
|
|
8512
|
+
const textarea = editor.renderer.textarea;
|
|
8513
|
+
if (textarea && this.options.isDisabled) {
|
|
8514
|
+
textarea.setAttribute('disabled', 'true');
|
|
8515
|
+
}
|
|
8516
|
+
this.hideToolbar = true;
|
|
8517
|
+
}
|
|
8518
|
+
}
|
|
8519
|
+
//The doUpload method handles file uploads when users add images or other files to the editor.
|
|
8520
|
+
//This method should be implemented to manage file uploads to a server or cloud storage and return the result to the editor.
|
|
8521
|
+
//fires on drag and drop or copy paste
|
|
8522
|
+
//if not set will can't add files or images using this way
|
|
8523
|
+
onDragFile(files) {
|
|
8524
|
+
const results = [];
|
|
8525
|
+
// Function to handle a single file
|
|
8526
|
+
const processFile = (file) => {
|
|
8527
|
+
return new Promise((resolve, reject) => {
|
|
8528
|
+
const reader = new FileReader();
|
|
8529
|
+
reader.onload = () => {
|
|
8530
|
+
const fileUrl = reader.result;
|
|
8531
|
+
const result = {
|
|
8532
|
+
name: file.name,
|
|
8533
|
+
url: fileUrl,
|
|
8534
|
+
isImg: file.type.startsWith('image/')
|
|
8535
|
+
};
|
|
8536
|
+
resolve(result);
|
|
8537
|
+
};
|
|
8538
|
+
reader.onerror = (error) => {
|
|
8539
|
+
reject(error);
|
|
8540
|
+
};
|
|
8541
|
+
// Read the file as a data URL
|
|
8542
|
+
reader.readAsDataURL(file);
|
|
8543
|
+
});
|
|
8544
|
+
};
|
|
8545
|
+
// // Iterate over files and process each one
|
|
8546
|
+
const processAllFiles = async () => {
|
|
8547
|
+
for (const file of files) {
|
|
8548
|
+
try {
|
|
8549
|
+
const result = await processFile(file);
|
|
8550
|
+
results.push(result);
|
|
8551
|
+
}
|
|
8552
|
+
catch (error) {
|
|
8553
|
+
console.error('Error processing file:', error);
|
|
8554
|
+
}
|
|
8555
|
+
}
|
|
8556
|
+
return results;
|
|
8557
|
+
};
|
|
8558
|
+
//Return the promise that resolves when all files are processed
|
|
8559
|
+
return processAllFiles();
|
|
8560
|
+
}
|
|
8561
|
+
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 }); }
|
|
8562
|
+
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" }] }); }
|
|
8563
|
+
}
|
|
8564
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: MarkdownEditorComponent, decorators: [{
|
|
8565
|
+
type: Component,
|
|
8566
|
+
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" }]
|
|
8567
|
+
}], ctorParameters: () => [{ type: i3.UtilityService }, { type: GlobalSettings }, { type: i3.ControlValidationService }, { type: ControlUtility }, { type: i2.FormGroupDirective }, { type: i5$2.ScriptService }, { type: i2.ControlContainer, decorators: [{
|
|
8568
|
+
type: Optional
|
|
8569
|
+
}] }], propDecorators: { group: [{
|
|
8570
|
+
type: Input
|
|
8571
|
+
}], options: [{
|
|
8572
|
+
type: Input
|
|
8573
|
+
}], OnChange: [{
|
|
8574
|
+
type: Output
|
|
8575
|
+
}] } });
|
|
8576
|
+
|
|
8329
8577
|
let options;
|
|
8330
8578
|
class BBSFControlsModule {
|
|
8331
8579
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: BBSFControlsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
@@ -8361,7 +8609,8 @@ class BBSFControlsModule {
|
|
|
8361
8609
|
BBSFDatePipe,
|
|
8362
8610
|
BTagsInputComponent,
|
|
8363
8611
|
RecaptchaComponent,
|
|
8364
|
-
PageHeaderComponentComponent
|
|
8612
|
+
PageHeaderComponentComponent,
|
|
8613
|
+
MarkdownEditorComponent], imports: [CommonModule,
|
|
8365
8614
|
InfiniteScrollModule,
|
|
8366
8615
|
NgSelectModule,
|
|
8367
8616
|
FullCalendarModule,
|
|
@@ -8382,7 +8631,8 @@ class BBSFControlsModule {
|
|
|
8382
8631
|
AutocompleteLibModule,
|
|
8383
8632
|
BBSFUtilitiesModule, i8$3.InlineSVGModule, SweetAlert2Module,
|
|
8384
8633
|
ScriptLoaderModule,
|
|
8385
|
-
GoogleMapsModule
|
|
8634
|
+
GoogleMapsModule,
|
|
8635
|
+
LMarkdownEditorModule], exports: [DateInputComponent,
|
|
8386
8636
|
FileUploadComponent,
|
|
8387
8637
|
MultiLingualTextBoxComponent,
|
|
8388
8638
|
TextboxComponent,
|
|
@@ -8414,7 +8664,8 @@ class BBSFControlsModule {
|
|
|
8414
8664
|
BBSFDateTimePipe,
|
|
8415
8665
|
BBSFDatePipe,
|
|
8416
8666
|
RecaptchaComponent,
|
|
8417
|
-
PageHeaderComponentComponent
|
|
8667
|
+
PageHeaderComponentComponent,
|
|
8668
|
+
MarkdownEditorComponent] }); }
|
|
8418
8669
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: BBSFControlsModule, providers: [
|
|
8419
8670
|
ErrorMassageValidation,
|
|
8420
8671
|
ControlUtility,
|
|
@@ -8459,7 +8710,8 @@ class BBSFControlsModule {
|
|
|
8459
8710
|
InlineSVGModule.forRoot(),
|
|
8460
8711
|
SweetAlert2Module,
|
|
8461
8712
|
ScriptLoaderModule,
|
|
8462
|
-
GoogleMapsModule
|
|
8713
|
+
GoogleMapsModule,
|
|
8714
|
+
LMarkdownEditorModule] }); }
|
|
8463
8715
|
}
|
|
8464
8716
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImport: i0, type: BBSFControlsModule, decorators: [{
|
|
8465
8717
|
type: NgModule,
|
|
@@ -8497,7 +8749,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImpor
|
|
|
8497
8749
|
BBSFDatePipe,
|
|
8498
8750
|
BTagsInputComponent,
|
|
8499
8751
|
RecaptchaComponent,
|
|
8500
|
-
PageHeaderComponentComponent
|
|
8752
|
+
PageHeaderComponentComponent,
|
|
8753
|
+
MarkdownEditorComponent
|
|
8501
8754
|
],
|
|
8502
8755
|
imports: [
|
|
8503
8756
|
CommonModule,
|
|
@@ -8532,7 +8785,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImpor
|
|
|
8532
8785
|
InlineSVGModule.forRoot(),
|
|
8533
8786
|
SweetAlert2Module,
|
|
8534
8787
|
ScriptLoaderModule,
|
|
8535
|
-
GoogleMapsModule
|
|
8788
|
+
GoogleMapsModule,
|
|
8789
|
+
LMarkdownEditorModule
|
|
8536
8790
|
],
|
|
8537
8791
|
providers: [
|
|
8538
8792
|
ErrorMassageValidation,
|
|
@@ -8585,7 +8839,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.6", ngImpor
|
|
|
8585
8839
|
BBSFDateTimePipe,
|
|
8586
8840
|
BBSFDatePipe,
|
|
8587
8841
|
RecaptchaComponent,
|
|
8588
|
-
PageHeaderComponentComponent
|
|
8842
|
+
PageHeaderComponentComponent,
|
|
8843
|
+
MarkdownEditorComponent
|
|
8589
8844
|
]
|
|
8590
8845
|
}]
|
|
8591
8846
|
}] });
|
|
@@ -9273,6 +9528,29 @@ class BreadCrumb {
|
|
|
9273
9528
|
}
|
|
9274
9529
|
}
|
|
9275
9530
|
|
|
9531
|
+
class MarkdownEditorOptions extends ControlOptionsBase {
|
|
9532
|
+
constructor() {
|
|
9533
|
+
super(...arguments);
|
|
9534
|
+
/**To set value to MarkdownEditor */
|
|
9535
|
+
this.value = '';
|
|
9536
|
+
//Enable viewing preview panel
|
|
9537
|
+
this.showPreviewPanelOnLoad = true;
|
|
9538
|
+
/**
|
|
9539
|
+
* Array of icons to be hidden from the toolbar.
|
|
9540
|
+
*
|
|
9541
|
+
* You can populate this array with icon names from the `MarkDownIcons` enum.
|
|
9542
|
+
* This allows you to customize the toolbar by hiding specific icons based on your requirements.
|
|
9543
|
+
*
|
|
9544
|
+
* @example
|
|
9545
|
+
* // Hide the Bold and Italic icons
|
|
9546
|
+
* hideIcons: [MarkDownIcons.Bold, MarkDownIcons.Italic];
|
|
9547
|
+
*/
|
|
9548
|
+
this.hideIcons = [];
|
|
9549
|
+
/** Set Height For MarkdownEditor ,default=400px */
|
|
9550
|
+
this.height = '400px';
|
|
9551
|
+
}
|
|
9552
|
+
}
|
|
9553
|
+
|
|
9276
9554
|
var MenuListType;
|
|
9277
9555
|
(function (MenuListType) {
|
|
9278
9556
|
MenuListType[MenuListType["AdminType"] = 1] = "AdminType";
|
|
@@ -9604,5 +9882,5 @@ var FileType;
|
|
|
9604
9882
|
* Generated bundle index. Do not edit.
|
|
9605
9883
|
*/
|
|
9606
9884
|
|
|
9607
|
-
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 };
|
|
9885
|
+
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 };
|
|
9608
9886
|
//# sourceMappingURL=bnsights-bbsf-controls.mjs.map
|