@bnsights/bbsf-controls 1.0.10 → 1.0.11
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/bnsights-bbsf-controls-1.0.11.tgz +0 -0
- package/bnsights-bbsf-controls.metadata.json +1 -1
- package/bundles/bnsights-bbsf-controls.umd.js +72 -39
- package/bundles/bnsights-bbsf-controls.umd.js.map +1 -1
- package/esm2015/lib/Shared/Models/ConfirmationModalOptions.js +1 -1
- package/esm2015/lib/Shared/Models/FormOptions.js +1 -1
- package/esm2015/lib/Shared/Models/TextBoxOptions.js +5 -1
- package/esm2015/lib/Shared/services/ControlUtility.js +11 -1
- package/esm2015/lib/controls/Form/Form.component.js +3 -2
- package/esm2015/lib/controls/MultiLingualHtmlEditor/MultiLingualHtmlEditor.component.js +14 -14
- package/esm2015/lib/controls/MultiLingualTextArea/MultiLingualTextArea.component.js +12 -12
- package/esm2015/lib/controls/MultiLingualTextBox/MultiLingualTextBox.component.js +12 -12
- package/esm2015/lib/controls/Paging/Paging.component.js +22 -4
- package/esm2015/lib/controls/TextBox/TextBox.component.js +2 -1
- package/fesm2015/bnsights-bbsf-controls.js +72 -39
- package/fesm2015/bnsights-bbsf-controls.js.map +1 -1
- package/lib/Shared/Models/ConfirmationModalOptions.d.ts +1 -1
- package/lib/Shared/Models/FormOptions.d.ts +1 -1
- package/lib/Shared/Models/TextBoxOptions.d.ts +1 -0
- package/lib/Shared/services/ControlUtility.d.ts +2 -0
- package/lib/controls/Paging/Paging.component.d.ts +4 -3
- package/package.json +2 -2
- package/bnsights-bbsf-controls-1.0.10.tgz +0 -0
|
@@ -249,6 +249,16 @@
|
|
|
249
249
|
FormControl.setValidators(ValidationRole);
|
|
250
250
|
FormControl.updateValueAndValidity();
|
|
251
251
|
};
|
|
252
|
+
ControlUtility.prototype.addRequiredToControl = function (FormControl, Options) {
|
|
253
|
+
Options.IsRequired = true;
|
|
254
|
+
FormControl.addValidators(forms.Validators.required);
|
|
255
|
+
FormControl.updateValueAndValidity();
|
|
256
|
+
};
|
|
257
|
+
ControlUtility.prototype.removeRequiredFromControl = function (FormControl, Options) {
|
|
258
|
+
Options.IsRequired = false;
|
|
259
|
+
FormControl.removeValidators(forms.Validators.required);
|
|
260
|
+
FormControl.updateValueAndValidity();
|
|
261
|
+
};
|
|
252
262
|
ControlUtility.prototype.RemoveCustomValidation = function (FormControl, ValidationRole, CustomValidation) {
|
|
253
263
|
ValidationRole = ValidationRole.filter(function (e) { return e != CustomValidation.functionBody; });
|
|
254
264
|
FormControl.setValidators(ValidationRole);
|
|
@@ -1227,10 +1237,10 @@
|
|
|
1227
1237
|
// });
|
|
1228
1238
|
this.MultiLanguagegroup = new forms.FormGroup({});
|
|
1229
1239
|
;
|
|
1230
|
-
this.MultiLanguagegroup.addControl("
|
|
1231
|
-
this.MultiLanguagegroup.addControl("
|
|
1232
|
-
this.ArabicFormControl = this.MultiLanguagegroup.controls["
|
|
1233
|
-
this.EnglishFormControl = this.MultiLanguagegroup.controls["
|
|
1240
|
+
this.MultiLanguagegroup.addControl("Arabic", new forms.FormControl(''));
|
|
1241
|
+
this.MultiLanguagegroup.addControl("English", new forms.FormControl(''));
|
|
1242
|
+
this.ArabicFormControl = this.MultiLanguagegroup.controls["Arabic"]; // new FormControl('',validationRules);
|
|
1243
|
+
this.EnglishFormControl = this.MultiLanguagegroup.controls["English"]; // new FormControl('',validationRules);
|
|
1234
1244
|
this.group.addControl(this.options.Name, new forms.FormGroup(this.MultiLanguagegroup.controls));
|
|
1235
1245
|
this.getCustomErrorsMassages();
|
|
1236
1246
|
if (!this.options.ViewType)
|
|
@@ -1308,9 +1318,9 @@
|
|
|
1308
1318
|
if (this.EnglishWordCountArray > 0) {
|
|
1309
1319
|
if (this.EnglishWordCountArray > this.options.MaxWordCount) {
|
|
1310
1320
|
this.EnglishWordCount = this.options.MaxWordCount;
|
|
1311
|
-
this.MultiLanguagegroup.controls["
|
|
1312
|
-
this.MultiLanguagegroup.controls["
|
|
1313
|
-
this.MultiLanguagegroup.controls["
|
|
1321
|
+
this.MultiLanguagegroup.controls["English"].setErrors({ MaxWordCountValidationKey: this.options.MaxWordCount });
|
|
1322
|
+
this.MultiLanguagegroup.controls["English"].markAsTouched();
|
|
1323
|
+
this.MultiLanguagegroup.controls["English"].invalid;
|
|
1314
1324
|
}
|
|
1315
1325
|
else {
|
|
1316
1326
|
this.EnglishWordCount = this.EnglishWordCountArray;
|
|
@@ -1329,9 +1339,9 @@
|
|
|
1329
1339
|
if (this.ArabicWordCountArray > 0) {
|
|
1330
1340
|
if (this.ArabicWordCountArray > this.options.MaxWordCount) {
|
|
1331
1341
|
this.ArabicWordCount = this.options.MaxWordCount;
|
|
1332
|
-
this.MultiLanguagegroup.controls["
|
|
1333
|
-
this.MultiLanguagegroup.controls["
|
|
1334
|
-
this.MultiLanguagegroup.controls["
|
|
1342
|
+
this.MultiLanguagegroup.controls["Arabic"].setErrors({ MaxWordCountValidationKey: this.options.MaxWordCount });
|
|
1343
|
+
this.MultiLanguagegroup.controls["Arabic"].markAsTouched();
|
|
1344
|
+
this.MultiLanguagegroup.controls["Arabic"].invalid;
|
|
1335
1345
|
}
|
|
1336
1346
|
else {
|
|
1337
1347
|
this.ArabicWordCount = this.ArabicWordCountArray;
|
|
@@ -1470,7 +1480,7 @@
|
|
|
1470
1480
|
MultiLingualTextBoxComponent.decorators = [
|
|
1471
1481
|
{ type: i0.Component, args: [{
|
|
1472
1482
|
selector: 'BBSF-MultiLingualTextBox',
|
|
1473
|
-
template: "<div class=\"b-control b-multilangual-textbox\">\r\n <div class=\"form-group validate is-invalid\" [formGroup]=\"group\">\r\n\r\n <div class=\"form-group row\" [formGroup]=\"MultiLanguagegroup\">\r\n <div [ngClass]=\"(options.MultiControlPlacementType==1)?'col-md-12':'col-md-6'\">\r\n <div class=\"row\" *ngIf=\"ShowEnglishTextBox\">\r\n <label class=\"b-label col-form-label col-sm-12\"\r\n [ngClass]=\"(options.ViewType==1)?'col-md-9':'col-md-3'\" [hidden]=\"options.IsHideEnglishLabel\">\r\n {{(options.EnglishLabelValue!=null&&options.EnglishLabelValue!=\"\")?options.EnglishLabelValue:options.LabelValue}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\"\r\n class=\"text-danger Required-text\" aria-required=\"true\">*</span>\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n <div class=\"input-group align-items-center\">\r\n <div class=\"svg svg-icon-grey\" [ngClass]=\"(options.IconPositionEN==1)?'left':'right'\" *ngIf=\"options.Icon!=null\">\r\n <span [inlineSVG]=\"options.Icon\"></span>\r\n </div>\r\n <input class=\"form-control bnsights-control\"\r\n (focus)=\"showEnglishWordCount(true)\" (focusout)=\"showEnglishWordCount(false)\"\r\n maxlength=\"{{options.MaxLength}}\" minlength=\"{{options.MinLength}}\"\r\n aria-describedby=\"email-error\" aria-invalid=\"true\" formControlName=\"
|
|
1483
|
+
template: "<div class=\"b-control b-multilangual-textbox\">\r\n <div class=\"form-group validate is-invalid\" [formGroup]=\"group\">\r\n\r\n <div class=\"form-group row\" [formGroup]=\"MultiLanguagegroup\">\r\n <div [ngClass]=\"(options.MultiControlPlacementType==1)?'col-md-12':'col-md-6'\">\r\n <div class=\"row\" *ngIf=\"ShowEnglishTextBox\">\r\n <label class=\"b-label col-form-label col-sm-12\"\r\n [ngClass]=\"(options.ViewType==1)?'col-md-9':'col-md-3'\" [hidden]=\"options.IsHideEnglishLabel\">\r\n {{(options.EnglishLabelValue!=null&&options.EnglishLabelValue!=\"\")?options.EnglishLabelValue:options.LabelValue}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\"\r\n class=\"text-danger Required-text\" aria-required=\"true\">*</span>\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n <div class=\"input-group align-items-center\">\r\n <div class=\"svg svg-icon-grey\" [ngClass]=\"(options.IconPositionEN==1)?'left':'right'\" *ngIf=\"options.Icon!=null\">\r\n <span [inlineSVG]=\"options.Icon\"></span>\r\n </div>\r\n <input class=\"form-control bnsights-control\"\r\n (focus)=\"showEnglishWordCount(true)\" (focusout)=\"showEnglishWordCount(false)\"\r\n maxlength=\"{{options.MaxLength}}\" minlength=\"{{options.MinLength}}\"\r\n aria-describedby=\"email-error\" aria-invalid=\"true\" formControlName=\"English\"\r\n [hidden]=\"options.IsHideEnglishFields\"\r\n [class.is-invalid]=\"EnglishFormControl.invalid && EnglishFormControl.touched\"\r\n placeholder=\"{{options.EnglishPlaceholder}}\" (change)=\"trimControlValue('En')\"\r\n (keyup)=\"onTextChange()\"\r\n (keydown)=\"EnglishWordCountArray>options.MaxWordCount&&$event.keyCode !=8?$event.preventDefault():null\"\r\n #userinputEnglish>\r\n\r\n <div class=\"input-group-append\" [hidden]=\"options.IsHideEnglishFields\" *ngIf=\"options.EnableCopyToClipboard\">\r\n <span class=\"input-group-text\" (click)=\"copyInputMessage(userinputEnglish)\">\r\n <i class=\"fas fa-copy\"></i>\r\n </span>\r\n </div>\r\n <div class=\"text-muted font-weight-500 word-count\" *ngIf=\"options.MaxWordCount>0&&IsShowEnglishWordCount\">{{EnglishWordCount}}/{{options.MaxWordCount}} words</div>\r\n </div>\r\n\r\n <div class=\"text-danger Required-text\"\r\n *ngIf=\"(EnglishFormControl.invalid && EnglishFormControl.touched)\">\r\n {{getErrorValidation(EnglishFormControl.errors|keyvalue)}}\r\n </div>\r\n\r\n <div class=\"control-desc\" *ngIf=\"(options.LabelDescription!=null&&options.LabelDescription!='') ||(options.EnglishLabelDescription!=null&&options.EnglishLabelDescription!='')\">\r\n {{(options.EnglishLabelDescription!=null&&options.EnglishLabelDescription!=\"\")?options.EnglishLabelDescription:options.LabelDescription}}\r\n </div>\r\n \r\n\r\n <!-- <div *ngIf=\"EnglishFormControl.valid\">{{resetError()}}</div> -->\r\n <div *ngIf=\"group.valid\">{{resetError()}}</div>\r\n\r\n </div>\r\n </div>\r\n\r\n </div>\r\n\r\n <div [ngClass]=\"(options.MultiControlPlacementType==1)?'col-md-12':'col-md-6'\">\r\n\r\n <div class=\"row\" *ngIf=\"ShowArabicTextBox\">\r\n\r\n <label class=\"b-label col-form-label col-sm-12\"\r\n [ngClass]=\"(options.ViewType==1)?'col-md-12':'col-md-3'\" [hidden]=\"options.IsHideArabicLabel\">\r\n {{(options.ArabicLabelValue!=null&&options.ArabicLabelValue!=\"\")?options.ArabicLabelValue:options.LabelValue}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\"\r\n class=\"text-danger Required-text\" aria-required=\"true\">*</span>\r\n\r\n </label>\r\n\r\n <div class=\" col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n <div class=\"input-group align-items-center\">\r\n <div class=\"svg svg-icon-grey\" [ngClass]=\"(options.IconPositionEN==1)?'right':'left'\" *ngIf=\"options.Icon!=null\">\r\n <span [inlineSVG]=\"options.Icon\"></span>\r\n </div>\r\n <input class=\"form-control bnsights-control\" dir=\"rtl\"\r\n (focus)=\"showArabicWordCount(true)\" (focusout)=\"showArabicWordCount(false)\"\r\n [hidden]=\"options.IsHideArabicFields\" aria-describedby=\"email-error\" aria-invalid=\"true\"\r\n formControlName=\"Arabic\"\r\n maxlength=\"{{options.MaxLength}}\" minlength=\"{{options.MinLength}}\"\r\n [class.is-invalid]=\"ArabicFormControl.invalid && ArabicFormControl.touched\"\r\n placeholder=\"{{options.ArabicPlaceholder}}\" (keyup)=\"onTextChange()\"\r\n (keydown)=\"ArabicWordCountArray>options.MaxWordCount&&$event.keyCode !=8?$event.preventDefault():null\"\r\n (change)=\"trimControlValue('Ar')\" #userinputArabic>\r\n\r\n <div class=\"input-group-append\" [hidden]=\"options.IsHideArabicFields\" *ngIf=\"options.EnableCopyToClipboard\">\r\n <span class=\"input-group-text\" (click)=\"copyInputMessage(userinputArabic)\">\r\n <i class=\"fas fa-copy\"></i>\r\n </span>\r\n </div>\r\n <div class=\"text-muted font-weight-500 word-count\" *ngIf=\"options.MaxWordCount>0&&IsShowArabicWordCount\">{{ArabicWordCount}}/{{options.MaxWordCount}} Words</div>\r\n\r\n </div>\r\n\r\n <div class=\"text-danger Required-text\"\r\n *ngIf=\"(ArabicFormControl.invalid && ArabicFormControl.touched)\">\r\n {{getErrorValidation(ArabicFormControl.errors|keyvalue)}}\r\n </div>\r\n\r\n <div class=\"control-desc\" *ngIf=\"(options.LabelDescription!=null&&options.LabelDescription!='')||(options.ArabicLabelDescription!=null&&options.ArabicLabelDescription!='')\">\r\n {{(options.ArabicLabelDescription!=null&&options.ArabicLabelDescription!=\"\")?options.ArabicLabelDescription:options.LabelDescription}}\r\n </div>\r\n \r\n \r\n\r\n <!-- <div *ngIf=\"ArabicFormControl.valid\">{{resetError()}}</div> -->\r\n \r\n <div *ngIf=\"group.valid\">{{resetError()}}</div>\r\n\r\n </div>\r\n \r\n\r\n </div>\r\n\r\n </div>\r\n </div>\r\n\r\n </div>\r\n</div>\r\n",
|
|
1474
1484
|
styles: [".example-form{min-width:150px;max-width:500px;width:100%}.example-full-width{width:100%}\n"]
|
|
1475
1485
|
},] }
|
|
1476
1486
|
];
|
|
@@ -1724,10 +1734,10 @@
|
|
|
1724
1734
|
if (this.options.EnglishLabelKey != null && this.options.EnglishLabelKey != "")
|
|
1725
1735
|
this.options.EnglishLabelValue = this.UtilityService.getResourceValue(this.options.EnglishLabelKey);
|
|
1726
1736
|
this.MultiLanguageTextAreagroup = new forms.FormGroup({});
|
|
1727
|
-
this.MultiLanguageTextAreagroup.addControl("
|
|
1728
|
-
this.MultiLanguageTextAreagroup.addControl("
|
|
1729
|
-
this.ArabicTextAreaFormControl = this.MultiLanguageTextAreagroup.controls["
|
|
1730
|
-
this.EnglishTextAreaFormControl = this.MultiLanguageTextAreagroup.controls["
|
|
1737
|
+
this.MultiLanguageTextAreagroup.addControl("Arabic", new forms.FormControl(''));
|
|
1738
|
+
this.MultiLanguageTextAreagroup.addControl("English", new forms.FormControl(''));
|
|
1739
|
+
this.ArabicTextAreaFormControl = this.MultiLanguageTextAreagroup.controls["Arabic"]; // new FormControl('',validationRules);
|
|
1740
|
+
this.EnglishTextAreaFormControl = this.MultiLanguageTextAreagroup.controls["English"]; // new FormControl('',validationRules);
|
|
1731
1741
|
this.group.addControl(this.options.Name, new forms.FormGroup(this.MultiLanguageTextAreagroup.controls));
|
|
1732
1742
|
this.getCustomErrorsMassages();
|
|
1733
1743
|
switch (this.options.Type) {
|
|
@@ -1799,9 +1809,9 @@
|
|
|
1799
1809
|
if (this.EnglishWordCountArray > 0) {
|
|
1800
1810
|
if (this.EnglishWordCountArray > this.options.MaxWordCount) {
|
|
1801
1811
|
this.EnglishWordCount = this.options.MaxWordCount;
|
|
1802
|
-
this.MultiLanguageTextAreagroup.controls["
|
|
1803
|
-
this.MultiLanguageTextAreagroup.controls["
|
|
1804
|
-
this.MultiLanguageTextAreagroup.controls["
|
|
1812
|
+
this.MultiLanguageTextAreagroup.controls["English"].setErrors({ MaxWordCountValidationKey: this.options.MaxWordCount });
|
|
1813
|
+
this.MultiLanguageTextAreagroup.controls["English"].markAsTouched();
|
|
1814
|
+
this.MultiLanguageTextAreagroup.controls["English"].invalid;
|
|
1805
1815
|
}
|
|
1806
1816
|
else {
|
|
1807
1817
|
this.EnglishWordCount = this.EnglishWordCountArray;
|
|
@@ -1820,9 +1830,9 @@
|
|
|
1820
1830
|
if (this.ArabicWordCountArray > 0) {
|
|
1821
1831
|
if (this.ArabicWordCountArray > this.options.MaxWordCount) {
|
|
1822
1832
|
this.ArabicWordCount = this.options.MaxWordCount;
|
|
1823
|
-
this.MultiLanguageTextAreagroup.controls["
|
|
1824
|
-
this.MultiLanguageTextAreagroup.controls["
|
|
1825
|
-
this.MultiLanguageTextAreagroup.controls["
|
|
1833
|
+
this.MultiLanguageTextAreagroup.controls["Arabic"].setErrors({ MaxWordCountValidationKey: this.options.MaxWordCount });
|
|
1834
|
+
this.MultiLanguageTextAreagroup.controls["Arabic"].markAsTouched();
|
|
1835
|
+
this.MultiLanguageTextAreagroup.controls["Arabic"].invalid;
|
|
1826
1836
|
}
|
|
1827
1837
|
else {
|
|
1828
1838
|
this.ArabicWordCount = this.ArabicWordCountArray;
|
|
@@ -1952,7 +1962,7 @@
|
|
|
1952
1962
|
MultiLingualTextAreaComponent.decorators = [
|
|
1953
1963
|
{ type: i0.Component, args: [{
|
|
1954
1964
|
selector: 'BBSF-MultiLingualTextArea',
|
|
1955
|
-
template: "<div class=\"b-control b-multilangual-textarea\">\r\n <div class=\"form-group validate is-invalid\" [formGroup]=\"group\">\r\n\r\n <div class=\"form-group row\" [formGroup]=\"MultiLanguageTextAreagroup\">\r\n <div [ngClass]=\"(options.MultiControlPlacementType==1)?'col-md-12':'col-md-6'\">\r\n <div class=\"row\" *ngIf=\"ShowEngishTextArea\">\r\n <label class=\"b-label col-form-label col-sm-12 \" \r\n [ngClass]=\"(options.ViewType==1)?'col-md-9':'col-md-3'\" [hidden]=\"options.IsHideEnglishLabel\">\r\n {{(options.EnglishLabelValue!=null&&options.EnglishLabelValue!=\"\")?options.EnglishLabelValue:options.LabelValue+\"in English\"}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\"\r\n class=\"text-danger Required-text\" aria-required=\"true\">*</span>\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n <div class=\"input-group\">\r\n <textarea class=\"form-control bnsights-control\" rows=\"{{options.Rows}}\" cols=\"{{options.Cols}}\"\r\n (focus)=\"showEnglishWordCount(true)\" (focusout)=\"showEnglishWordCount(false)\"\r\n maxlength=\"{{options.MaxLength}}\" minlength=\"{{options.MinLength}}\"\r\n aria-describedby=\"email-error\" aria-invalid=\"true\"\r\n formControlName=\"
|
|
1965
|
+
template: "<div class=\"b-control b-multilangual-textarea\">\r\n <div class=\"form-group validate is-invalid\" [formGroup]=\"group\">\r\n\r\n <div class=\"form-group row\" [formGroup]=\"MultiLanguageTextAreagroup\">\r\n <div [ngClass]=\"(options.MultiControlPlacementType==1)?'col-md-12':'col-md-6'\">\r\n <div class=\"row\" *ngIf=\"ShowEngishTextArea\">\r\n <label class=\"b-label col-form-label col-sm-12 \" \r\n [ngClass]=\"(options.ViewType==1)?'col-md-9':'col-md-3'\" [hidden]=\"options.IsHideEnglishLabel\">\r\n {{(options.EnglishLabelValue!=null&&options.EnglishLabelValue!=\"\")?options.EnglishLabelValue:options.LabelValue+\"in English\"}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\"\r\n class=\"text-danger Required-text\" aria-required=\"true\">*</span>\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n <div class=\"input-group\">\r\n <textarea class=\"form-control bnsights-control\" rows=\"{{options.Rows}}\" cols=\"{{options.Cols}}\"\r\n (focus)=\"showEnglishWordCount(true)\" (focusout)=\"showEnglishWordCount(false)\"\r\n maxlength=\"{{options.MaxLength}}\" minlength=\"{{options.MinLength}}\"\r\n aria-describedby=\"email-error\" aria-invalid=\"true\"\r\n formControlName=\"English\" [hidden]=\"options.IsHideEnglishFields\"\r\n [class.is-invalid]=\"EnglishTextAreaFormControl.invalid && EnglishTextAreaFormControl.touched\"\r\n placeholder=\"{{options.EnglishPlaceholder}}\" (change)=\"trimControlValue('En')\"\r\n (keyup)=\"onTextChange()\"\r\n (keydown)=\"EnglishWordCountArray>options.MaxWordCount&&$event.keyCode !=8?$event.preventDefault():null\"\r\n #userinputTextAreaEnglish>\r\n </textarea>\r\n <div class=\"input-group-append\" [hidden]=\"options.IsHideEnglishFields\" *ngIf=\"options.EnableCopyToClipboard\">\r\n <span class=\"input-group-text\" (click)=\"copyInputMessage(userinputTextAreaEnglish)\">\r\n <i class=\"fas fa-copy\"></i>\r\n </span>\r\n </div>\r\n <div class=\"text-muted font-weight-500 word-count\" *ngIf=\"options.MaxWordCount>0&&IsShowEnglishWordCount\">{{EnglishWordCount}}/{{options.MaxWordCount}} Words</div>\r\n\r\n </div>\r\n <div class=\"text-danger Required-text\"\r\n *ngIf=\"(EnglishTextAreaFormControl.invalid && EnglishTextAreaFormControl.touched)\">\r\n {{getErrorValidation(EnglishTextAreaFormControl.errors|keyvalue)}}\r\n </div>\r\n <div class=\"control-desc\" *ngIf=\"(options.LabelDescription!=null&&options.LabelDescription!='') ||(options.EnglishLabelDescription!=null&&options.EnglishLabelDescription!='')\">\r\n {{(options.EnglishLabelDescription!=null&&options.EnglishLabelDescription!=\"\")?options.EnglishLabelDescription:options.LabelDescription}}\r\n </div>\r\n\r\n <!-- <div *ngIf=\"EnglishTextAreaFormControl.valid\">{{resetError()}}</div> -->\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">{{resetError()}}</div>\r\n\r\n\r\n </div>\r\n </div>\r\n </div>\r\n <div [ngClass]=\"(options.MultiControlPlacementType==1)?'col-md-12':'col-md-6'\">\r\n <div class=\"row\" *ngIf=\"ShowArabicTextArea\">\r\n\r\n <label class=\"b-label col-form-label col-sm-12 \"\r\n [ngClass]=\"(options.ViewType==1)?'col-md-12':'col-md-3'\" [hidden]=\"options.IsHideArabicLable\">\r\n {{(options.ArabicLabelValue!=null&&options.ArabicLabelValue!=\"\")?options.ArabicLabelValue:options.LabelValue+\"in Arabic\"}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\"\r\n class=\"text-danger Required-text\" aria-required=\"true\">*</span>\r\n </label>\r\n <div class=\" col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n <div class=\"input-group\">\r\n <textarea class=\"form-control bnsights-control\" dir=\"rtl\" rows=\"{{options.Rows}}\" cols=\"{{options.Cols}}\"\r\n (focus)=\"showArabicWordCount(true)\" (focusout)=\"showArabicWordCount(false)\"\r\n [hidden]=\"options.IsHideArabicFields\" maxlength=\"{{options.MaxLength}}\"\r\n minlength=\"{{options.MinLength}}\" aria-describedby=\"email-error\" aria-invalid=\"true\"\r\n formControlName=\"Arabic\" rows=\"{{options.Rows}}\"\r\n [class.is-invalid]=\"ArabicTextAreaFormControl.invalid && ArabicTextAreaFormControl.touched\"\r\n placeholder=\"{{options.ArabicPlaceholder}}\" (change)=\"trimControlValue('Ar')\"\r\n (keyup)=\"onTextChange()\"\r\n (keydown)=\"ArabicWordCountArray>options.MaxWordCount&&$event.keyCode !=8?$event.preventDefault():null\"\r\n #userinputTextAreaArabic>\r\n </textarea>\r\n <div class=\"input-group-append\" [hidden]=\"options.IsHideArabicFields\" *ngIf=\"options.EnableCopyToClipboard\">\r\n <span class=\"input-group-text\" (click)=\"copyInputMessage(userinputTextAreaArabic)\">\r\n <i class=\"fas fa-copy\"></i>\r\n </span>\r\n </div>\r\n <div class=\"text-muted font-weight-500 word-count\" *ngIf=\"options.MaxWordCount>0&&IsShowArabicWordCount\">{{ArabicWordCount}}/{{options.MaxWordCount}}Words</div>\r\n\r\n </div>\r\n <div class=\"text-danger Required-text\"\r\n *ngIf=\"(ArabicTextAreaFormControl.invalid && ArabicTextAreaFormControl.touched)\">\r\n {{getErrorValidation(ArabicTextAreaFormControl.errors|keyvalue)}}\r\n </div>\r\n <div class=\"control-desc\" *ngIf=\"(options.LabelDescription!=null&&options.LabelDescription!='')||(options.ArabicLabelDescription!=null&&options.ArabicLabelDescription!='')\">\r\n {{(options.ArabicLabelDescription!=null&&options.ArabicLabelDescription!=\"\")?options.ArabicLabelDescription:options.LabelDescription}}\r\n </div>\r\n\r\n <!-- <div *ngIf=\"ArabicTextAreaFormControl.valid\">{{resetError()}}</div> -->\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">{{resetError()}}</div>\r\n\r\n </div>\r\n\r\n\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n</div>\r\n",
|
|
1956
1966
|
styles: [".example-form{min-width:150px;max-width:500px;width:100%}.example-full-width{width:100%}\n"]
|
|
1957
1967
|
},] }
|
|
1958
1968
|
];
|
|
@@ -2828,10 +2838,10 @@
|
|
|
2828
2838
|
// }
|
|
2829
2839
|
this.MultilingualHtmlEditorgroup = new forms.FormGroup({});
|
|
2830
2840
|
;
|
|
2831
|
-
this.MultilingualHtmlEditorgroup.addControl("
|
|
2832
|
-
this.MultilingualHtmlEditorgroup.addControl("
|
|
2833
|
-
this.ArabicHtmlEditorFormControl = this.MultilingualHtmlEditorgroup.controls["
|
|
2834
|
-
this.EnglishHtmlEditorFormControl = this.MultilingualHtmlEditorgroup.controls["
|
|
2841
|
+
this.MultilingualHtmlEditorgroup.addControl("Arabic", new forms.FormControl(''));
|
|
2842
|
+
this.MultilingualHtmlEditorgroup.addControl("English", new forms.FormControl(''));
|
|
2843
|
+
this.ArabicHtmlEditorFormControl = this.MultilingualHtmlEditorgroup.controls["Arabic"]; // new FormControl('',validationRules);
|
|
2844
|
+
this.EnglishHtmlEditorFormControl = this.MultilingualHtmlEditorgroup.controls["English"]; // new FormControl('',validationRules);
|
|
2835
2845
|
this.group.addControl(this.options.Name, new forms.FormGroup(this.MultilingualHtmlEditorgroup.controls));
|
|
2836
2846
|
this.getCustomErrorsMassages();
|
|
2837
2847
|
switch (this.options.Type) {
|
|
@@ -2896,27 +2906,27 @@
|
|
|
2896
2906
|
};
|
|
2897
2907
|
MultiLingualHtmlEditorComponent.prototype.onTextChange = function (type) {
|
|
2898
2908
|
if (type == "en") {
|
|
2899
|
-
this.englishValue = this.MultilingualHtmlEditorgroup.controls["
|
|
2909
|
+
this.englishValue = this.MultilingualHtmlEditorgroup.controls["English"].value == null ? "" : this.MultilingualHtmlEditorgroup.controls["English"].value;
|
|
2900
2910
|
if (this.englishValue)
|
|
2901
2911
|
this.EnglishHtmlEditorFormControl.setValue(this.englishValue);
|
|
2902
2912
|
var EngliswordCountArray = this.EnglishHtmlEditorFormControl.value.split(" ").length;
|
|
2903
2913
|
if (EngliswordCountArray > 0) {
|
|
2904
2914
|
if (EngliswordCountArray > this.options.MaxWordCount)
|
|
2905
|
-
this.MultilingualHtmlEditorgroup.controls["
|
|
2906
|
-
this.MultilingualHtmlEditorgroup.controls["
|
|
2907
|
-
this.MultilingualHtmlEditorgroup.controls["
|
|
2915
|
+
this.MultilingualHtmlEditorgroup.controls["English"].setErrors({ MaxWordCountValidationKey: this.options.MaxWordCount });
|
|
2916
|
+
this.MultilingualHtmlEditorgroup.controls["English"].markAsTouched();
|
|
2917
|
+
this.MultilingualHtmlEditorgroup.controls["English"].invalid;
|
|
2908
2918
|
}
|
|
2909
2919
|
}
|
|
2910
2920
|
if (type == "ar") {
|
|
2911
|
-
this.arabicValue = this.MultilingualHtmlEditorgroup.controls["
|
|
2921
|
+
this.arabicValue = this.MultilingualHtmlEditorgroup.controls["Arabic"].value == null ? "" : this.MultilingualHtmlEditorgroup.controls["Arabic"].value;
|
|
2912
2922
|
if (this.arabicValue)
|
|
2913
2923
|
this.ArabicHtmlEditorFormControl.setValue(this.arabicValue);
|
|
2914
2924
|
var ArabicwordCountArray = this.ArabicHtmlEditorFormControl.value.split(" ").length;
|
|
2915
2925
|
if (ArabicwordCountArray > 0) {
|
|
2916
2926
|
if (ArabicwordCountArray > this.options.MaxWordCount)
|
|
2917
|
-
this.MultilingualHtmlEditorgroup.controls["
|
|
2918
|
-
this.MultilingualHtmlEditorgroup.controls["
|
|
2919
|
-
this.MultilingualHtmlEditorgroup.controls["
|
|
2927
|
+
this.MultilingualHtmlEditorgroup.controls["Arabic"].setErrors({ MaxWordCountValidationKey: this.options.MaxWordCount });
|
|
2928
|
+
this.MultilingualHtmlEditorgroup.controls["Arabic"].markAsTouched();
|
|
2929
|
+
this.MultilingualHtmlEditorgroup.controls["Arabic"].invalid;
|
|
2920
2930
|
}
|
|
2921
2931
|
}
|
|
2922
2932
|
var mulitLangModel = new EnglishArabicDTO();
|
|
@@ -3016,7 +3026,7 @@
|
|
|
3016
3026
|
MultiLingualHtmlEditorComponent.decorators = [
|
|
3017
3027
|
{ type: i0.Component, args: [{
|
|
3018
3028
|
selector: 'BBSF-MultiLingualHtmlEditor',
|
|
3019
|
-
template: "<div class=\"b-control b-multilangual-html-editor\">\r\n <div class=\"form-group validate is-invalid\" [formGroup]=\"group\">\r\n\r\n <div class=\"form-group row\" [formGroup]=\"MultilingualHtmlEditorgroup\">\r\n <div class=\"col-lg-6\">\r\n <div class=\"row\" *ngIf=\"ShowEnglishHtmlEditor\">\r\n <label class=\"b-label col-form-label col-sm-12 \" \r\n [ngClass]=\"(options.ViewType==1)?'col-md-9':'col-md-3'\"\r\n [hidden]=\"options.IsHideEnglishLabel\">\r\n {{(options.EnglishLabelValue!=null&&options.EnglishLabelValue!=\"\")?options.EnglishLabelValue:options.LabelValue+\"in English\"}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\"\r\n class=\"text-danger Required-text\" aria-required=\"true\">*</span>\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n \r\n <angular-editor class=\"form-control bnsights-control {{options.ExtraClasses_EN}} \" (change)=\"onTextChange('en')\" [class.is-invalid]=\"EnglishHtmlEditorFormControl.invalid && EnglishHtmlEditorFormControl.touched\"\r\n formControlName=\"
|
|
3029
|
+
template: "<div class=\"b-control b-multilangual-html-editor\">\r\n <div class=\"form-group validate is-invalid\" [formGroup]=\"group\">\r\n\r\n <div class=\"form-group row\" [formGroup]=\"MultilingualHtmlEditorgroup\">\r\n <div class=\"col-lg-6\">\r\n <div class=\"row\" *ngIf=\"ShowEnglishHtmlEditor\">\r\n <label class=\"b-label col-form-label col-sm-12 \" \r\n [ngClass]=\"(options.ViewType==1)?'col-md-9':'col-md-3'\"\r\n [hidden]=\"options.IsHideEnglishLabel\">\r\n {{(options.EnglishLabelValue!=null&&options.EnglishLabelValue!=\"\")?options.EnglishLabelValue:options.LabelValue+\"in English\"}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\"\r\n class=\"text-danger Required-text\" aria-required=\"true\">*</span>\r\n </label>\r\n\r\n <div class=\"col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n \r\n <angular-editor class=\"form-control bnsights-control {{options.ExtraClasses_EN}} \" (change)=\"onTextChange('en')\" [class.is-invalid]=\"EnglishHtmlEditorFormControl.invalid && EnglishHtmlEditorFormControl.touched\"\r\n formControlName=\"English\" [config]=\"editorEnglishConfig\"></angular-editor>\r\n\r\n <div class=\"text-danger Required-text\"\r\n *ngIf=\"(EnglishHtmlEditorFormControl.invalid && EnglishHtmlEditorFormControl.touched)\">\r\n {{getErrorValidation(EnglishHtmlEditorFormControl.errors|keyvalue)}}\r\n </div>\r\n\r\n <div class=\"d-flex justify-content-between align-items-center\">\r\n <div class=\"control-desc text-dark\">\r\n {{(options.EnglishLabelDescription!=null&&options.EnglishLabelDescription!=\"\")?options.EnglishLabelDescription:options.LabelDescription}}\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">{{resetError()}}</div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"col-lg-6\">\r\n <div class=\"row\" *ngIf=\"ShowArabicHtmlEditor\">\r\n\r\n <label class=\"b-label col-form-label col-sm-12 \"\r\n [ngClass]=\"(options.ViewType==1)?'col-md-12':'col-md-3'\"\r\n [hidden]=\"options.IsHideArabicLable\">\r\n {{(options.ArabicLabelValue!=null&&options.ArabicLabelValue!=\"\")?options.ArabicLabelValue:options.LabelValue+\"in Arabic\"}}\r\n <span *ngIf=\"(options.ShowAsterisk&&options.IsRequired)||(options.IsRequired)\"\r\n class=\"text-danger Required-text\" aria-required=\"true\">*</span>\r\n </label>\r\n <div class=\" col-sm-12\" [ngClass]=\"(options.ViewType==1)?'':'col-md-9'\">\r\n \r\n\r\n <angular-editor dir=\"rtl\" class=\"form-control bnsights-control {{options.ExtraClasses_AR}} \" (change)=\"onTextChange('ar')\" [class.is-invalid]=\"ArabicHtmlEditorFormControl.invalid && ArabicHtmlEditorFormControl.touched\"\r\n formControlName=\"Arabic\" [config]=\"editorArabicConfig\"></angular-editor>\r\n\r\n <div class=\"text-danger Required-text\"\r\n *ngIf=\"(ArabicHtmlEditorFormControl.invalid && ArabicHtmlEditorFormControl.touched)\">\r\n {{getErrorValidation(ArabicHtmlEditorFormControl.errors|keyvalue)}}\r\n </div>\r\n\r\n \r\n\r\n <div class=\"d-flex justify-content-between align-items-center\">\r\n <div class=\"control-desc text-dark\">\r\n {{(options.ArabicLabelDescription!=null&&options.ArabicLabelDescription!=\"\")?options.ArabicLabelDescription:options.LabelDescription}}\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"(group.valid&&group.dirty&&group.touched )||(group.untouched&&group.invalid&&group.dirty) \">{{resetError()}}</div>\r\n </div>\r\n\r\n\r\n\r\n </div>\r\n </div>\r\n </div>\r\n\r\n\r\n\r\n </div>\r\n\r\n</div>\r\n",
|
|
3020
3030
|
styles: [".example-form{min-width:150px;max-width:500px;width:100%}.example-full-width{width:100%}\n"]
|
|
3021
3031
|
},] }
|
|
3022
3032
|
];
|
|
@@ -4315,7 +4325,6 @@
|
|
|
4315
4325
|
PagingComponent.prototype.getItemList = function (page, IsFilterUpdated) {
|
|
4316
4326
|
var _this = this;
|
|
4317
4327
|
if (IsFilterUpdated === void 0) { IsFilterUpdated = false; }
|
|
4318
|
-
;
|
|
4319
4328
|
var pagingDTO = new PagingDTO();
|
|
4320
4329
|
var size = Number.parseInt(this.options.PageSize.toString());
|
|
4321
4330
|
if (this.options.IsLoadMoreControl)
|
|
@@ -4360,16 +4369,35 @@
|
|
|
4360
4369
|
}
|
|
4361
4370
|
this.requestHandlerService.post(this.options.ActionPostURL, pagingDTO, params)
|
|
4362
4371
|
.subscribe(function (responseData) {
|
|
4363
|
-
|
|
4372
|
+
debugger;
|
|
4373
|
+
_this.result = responseData.items; //this.castItems(responseData.items);
|
|
4364
4374
|
_this.Items.emit(_this.result);
|
|
4375
|
+
_this.totalRow = responseData.totalCount;
|
|
4365
4376
|
if (IsFilterUpdated) {
|
|
4366
4377
|
_this.items = [];
|
|
4367
|
-
_this.totalRow = responseData.totalCount;
|
|
4368
4378
|
_this.Pages = Math.ceil((_this.totalRow / _this.options.PageSize));
|
|
4369
4379
|
_this.items = Array(_this.totalRow);
|
|
4370
4380
|
}
|
|
4371
4381
|
});
|
|
4372
4382
|
};
|
|
4383
|
+
PagingComponent.prototype.castItems = function (objectArr) {
|
|
4384
|
+
debugger;
|
|
4385
|
+
var originalArray = [];
|
|
4386
|
+
for (var index = 0; index < objectArr.length; index++) {
|
|
4387
|
+
var element = objectArr[index];
|
|
4388
|
+
var key = void 0, keys = Object.keys(element);
|
|
4389
|
+
var n = keys.length;
|
|
4390
|
+
var newObject = {};
|
|
4391
|
+
while (n--) {
|
|
4392
|
+
key = keys[n];
|
|
4393
|
+
var Okey = key;
|
|
4394
|
+
newObject[key.charAt(0).toUpperCase() + Okey.slice(1)] = element[key];
|
|
4395
|
+
}
|
|
4396
|
+
var finalObject = newObject;
|
|
4397
|
+
originalArray.push(finalObject);
|
|
4398
|
+
}
|
|
4399
|
+
return originalArray;
|
|
4400
|
+
};
|
|
4373
4401
|
return PagingComponent;
|
|
4374
4402
|
}());
|
|
4375
4403
|
PagingComponent.decorators = [
|
|
@@ -4739,6 +4767,7 @@
|
|
|
4739
4767
|
_this.group.markAllAsTouched();
|
|
4740
4768
|
_this.markAllAsTouched = true;
|
|
4741
4769
|
});
|
|
4770
|
+
this.options.ValidationRules = this.validationRules;
|
|
4742
4771
|
};
|
|
4743
4772
|
TextboxComponent.prototype.ngAfterViewInit = function () {
|
|
4744
4773
|
this.controlUtility.setAttributeForControl(this.options);
|
|
@@ -5351,8 +5380,9 @@
|
|
|
5351
5380
|
this.utilityService.notifyErrorMessage();
|
|
5352
5381
|
}
|
|
5353
5382
|
else {
|
|
5383
|
+
debugger;
|
|
5354
5384
|
if (err.status == 400) {
|
|
5355
|
-
this.controlValidationService.renderServerErrors(this.options.FormGroup, err, new bbsfUtilities.RequestOptionsModel());
|
|
5385
|
+
this.controlValidationService.renderServerErrors(this.options.FormGroup, err, new bbsfUtilities.RequestOptionsModel(), this.fromName);
|
|
5356
5386
|
}
|
|
5357
5387
|
else {
|
|
5358
5388
|
errorMessage = "Server returned code: " + err.status + ", error message is: " + err.message;
|
|
@@ -5739,8 +5769,11 @@
|
|
|
5739
5769
|
this.CustomValidation = [];
|
|
5740
5770
|
/** to set Direction of textbox if textbox is Arabic or English */
|
|
5741
5771
|
this.ForceDirection = null;
|
|
5772
|
+
/** Set Type of TextBox ("text","password","email","number") */
|
|
5773
|
+
this.Type = exports.InputType.Text;
|
|
5742
5774
|
this.IconPosition = exports.IconPosition.left;
|
|
5743
5775
|
this.NoMargin = false;
|
|
5776
|
+
this.ValidationRules = [];
|
|
5744
5777
|
}
|
|
5745
5778
|
return TextBoxOptions;
|
|
5746
5779
|
}());
|