@bnsights/bbsf-controls 1.0.98 → 1.0.99
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 +5 -2
- package/bnsights-bbsf-controls-1.0.99.tgz +0 -0
- package/bnsights-bbsf-controls.metadata.json +1 -1
- package/bundles/bnsights-bbsf-controls.umd.js +25 -19
- package/bundles/bnsights-bbsf-controls.umd.js.map +1 -1
- package/esm2015/lib/controls/AutocompleteTextBox/AutocompleteTextBox.component.js +13 -2
- package/esm2015/lib/controls/FileUplaod/FileUplaod.component.js +11 -17
- package/esm2015/lib/controls/Form/Form.component.js +2 -2
- package/esm2015/lib/controls/TextBox/TextBox.component.js +2 -2
- package/fesm2015/bnsights-bbsf-controls.js +24 -19
- package/fesm2015/bnsights-bbsf-controls.js.map +1 -1
- package/lib/controls/AutocompleteTextBox/AutocompleteTextBox.component.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1208,12 +1208,12 @@
|
|
|
1208
1208
|
if (this.options.FileMaxSizeInMB > 0) {
|
|
1209
1209
|
this.ValidationMessage =
|
|
1210
1210
|
this.ValidationMessage +
|
|
1211
|
-
("<br />
|
|
1211
|
+
("<br /> " + (this.UtilityService.getResourceValue('FileMaxSizeInMB') + this.options.FileMaxSizeInMB) + " ");
|
|
1212
1212
|
}
|
|
1213
1213
|
if (this.options.MinNoOfFiles > 0) {
|
|
1214
1214
|
this.ValidationMessage =
|
|
1215
1215
|
this.ValidationMessage +
|
|
1216
|
-
("<br />
|
|
1216
|
+
("<br /> " + (this.UtilityService.getResourceValue("MinFileCountValidationKey") + this.options.MinNoOfFiles));
|
|
1217
1217
|
}
|
|
1218
1218
|
if (this.options.FileUploadAcceptsTypes != null &&
|
|
1219
1219
|
this.options.FileUploadAcceptsTypes.length > 0) {
|
|
@@ -1295,18 +1295,6 @@
|
|
|
1295
1295
|
this.uploader.queue = [];
|
|
1296
1296
|
return;
|
|
1297
1297
|
}
|
|
1298
|
-
if (this.options.IsMultipleFile &&
|
|
1299
|
-
this.options.MaxNoOfFiles != null &&
|
|
1300
|
-
this.options.MaxNoOfFiles > 0 &&
|
|
1301
|
-
this.options.MaxNoOfFiles < this.uploader.queue.length) {
|
|
1302
|
-
var formControl = this.fileUploadFormControl;
|
|
1303
|
-
formControl.setErrors({
|
|
1304
|
-
MaxFileCountValidationKey: this.options.MaxNoOfFiles,
|
|
1305
|
-
});
|
|
1306
|
-
formControl.markAsTouched();
|
|
1307
|
-
this.uploader.queue = [];
|
|
1308
|
-
return;
|
|
1309
|
-
}
|
|
1310
1298
|
if (this.options.IsMultipleFile &&
|
|
1311
1299
|
this.options.MaxSizeForAllFilesInMB != null &&
|
|
1312
1300
|
this.options.MaxSizeForAllFilesInMB > 0) {
|
|
@@ -1357,6 +1345,7 @@
|
|
|
1357
1345
|
var fileObject = file.rawFile;
|
|
1358
1346
|
reader_1.readAsDataURL(fileObject);
|
|
1359
1347
|
reader_1.onload = function () {
|
|
1348
|
+
var _a;
|
|
1360
1349
|
var existingID_GUID = null;
|
|
1361
1350
|
if (!_this.options.IsMultipleFile && _this.file)
|
|
1362
1351
|
existingID_GUID =
|
|
@@ -1387,7 +1376,7 @@
|
|
|
1387
1376
|
_this.multipleFileUploadModel.RemovedFiles = [];
|
|
1388
1377
|
}
|
|
1389
1378
|
}
|
|
1390
|
-
_this.multipleFileUploadModel.CorrelationID_GUID = _this.options.Value.CorrelationID_GUID;
|
|
1379
|
+
_this.multipleFileUploadModel.CorrelationID_GUID = (_a = _this.options.Value) === null || _a === void 0 ? void 0 : _a.CorrelationID_GUID;
|
|
1391
1380
|
_this.fileUploadFormControl.setValue(_this.multipleFileUploadModel);
|
|
1392
1381
|
_this.group
|
|
1393
1382
|
.get(_this.options.Name)
|
|
@@ -1413,6 +1402,7 @@
|
|
|
1413
1402
|
}
|
|
1414
1403
|
};
|
|
1415
1404
|
FileUploadComponent.prototype.removeFromControlValue = function (item) {
|
|
1405
|
+
var _a;
|
|
1416
1406
|
if (this.options.IsMultipleFile == false) {
|
|
1417
1407
|
this.fileUploadModel = null;
|
|
1418
1408
|
if (this.options.IsRequired == true) {
|
|
@@ -1459,10 +1449,14 @@
|
|
|
1459
1449
|
if ((this.multipleFileUploadModel.UploadedFiles == null ||
|
|
1460
1450
|
this.multipleFileUploadModel.UploadedFiles.length == 0) &&
|
|
1461
1451
|
this.options.IsRequired) {
|
|
1452
|
+
var formControl = this.fileUploadFormControl;
|
|
1453
|
+
formControl.setErrors({
|
|
1454
|
+
MinFileCountValidationKey: this.options.MinNoOfFiles,
|
|
1455
|
+
});
|
|
1462
1456
|
this.fileUploadFormControl.markAsTouched();
|
|
1463
1457
|
this.fileUploadFormControl.invalid;
|
|
1464
1458
|
}
|
|
1465
|
-
this.multipleFileUploadModel.CorrelationID_GUID = this.options.Value.CorrelationID_GUID;
|
|
1459
|
+
this.multipleFileUploadModel.CorrelationID_GUID = (_a = this.options.Value) === null || _a === void 0 ? void 0 : _a.CorrelationID_GUID;
|
|
1466
1460
|
this.fileUploadFormControl.setValue(this.multipleFileUploadModel);
|
|
1467
1461
|
this.group.get(this.options.Name).setValue(this.multipleFileUploadModel);
|
|
1468
1462
|
//Use this line to enable two way binding.
|
|
@@ -4610,10 +4604,17 @@
|
|
|
4610
4604
|
};
|
|
4611
4605
|
AutocompleteTextBoxComponent.prototype.onChangeSearch = function (search) {
|
|
4612
4606
|
return __awaiter(this, void 0, void 0, function () {
|
|
4607
|
+
var formControl;
|
|
4613
4608
|
var _this = this;
|
|
4614
4609
|
return __generator(this, function (_a) {
|
|
4615
4610
|
switch (_a.label) {
|
|
4616
4611
|
case 0:
|
|
4612
|
+
if (this.options.MaxLength && search.length > this.options.MaxLength) {
|
|
4613
|
+
formControl = this.AutocompleteTextBoxControl;
|
|
4614
|
+
formControl.setErrors({ errorMassage: this.UtilityService.getResourceValue("MaxLenghtValidationKey") + " " + this.options.MaxLength });
|
|
4615
|
+
formControl.markAsTouched();
|
|
4616
|
+
return [2 /*return*/];
|
|
4617
|
+
}
|
|
4617
4618
|
this.Search = search;
|
|
4618
4619
|
this.SelectedValue = "";
|
|
4619
4620
|
return [4 /*yield*/, this.suggestions$.subscribe(function (result) {
|
|
@@ -4636,6 +4637,11 @@
|
|
|
4636
4637
|
});
|
|
4637
4638
|
});
|
|
4638
4639
|
};
|
|
4640
|
+
AutocompleteTextBoxComponent.prototype.onInputCleared = function () {
|
|
4641
|
+
this.AutocompleteTextBoxControl.setValue(null);
|
|
4642
|
+
this.OnChange.emit(null);
|
|
4643
|
+
this.AutocompleteTextBoxControl.updateValueAndValidity();
|
|
4644
|
+
};
|
|
4639
4645
|
return AutocompleteTextBoxComponent;
|
|
4640
4646
|
}());
|
|
4641
4647
|
AutocompleteTextBoxComponent.controlContainerstatic = null;
|
|
@@ -4643,7 +4649,7 @@
|
|
|
4643
4649
|
{ type: i0.Component, args: [{
|
|
4644
4650
|
// tslint:disable-next-line: component-selector
|
|
4645
4651
|
selector: 'BBSF-AutocompleteTextBox',
|
|
4646
|
-
template: "\r\n<div class=\"form-group bbsf-control bbsf-autocomplete-textbox\" [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\" class=\"text-danger\">*</span>\r\n </label>\r\n <!--Input container-->\r\n <div class=\"bbsf-input-container\" *ngIf=\"!options.IsReadonly\">\r\n <!--input-->\r\n <ng-autocomplete class=\"form-control {{options.ExtraClasses}}\" *ngIf=\"!options.AllowNewSelection\" [data]=\"dataList\" [initialValue]=\"SelectedValue\"\r\n [searchKeyword]=\"keyword\" placeholder=\"{{options.Placeholder}}\" (selected)='selectEvent($event)'\r\n (inputChanged)='onChangeSearch($event)' historyIdentifier=\"dataList\" [itemTemplate]=\"itemTemplate\"\r\n [dir]=\"textDir\"\r\n formControlName=\"{{options.Name}}\"\r\n aria-describedby=\"email-error\"\r\n aria-invalid=\"true\"\r\n [class.is-invalid]=\"AutocompleteTextBoxControl.invalid && AutocompleteTextBoxControl.touched\">\r\n </ng-autocomplete>\r\n\r\n <ng-autocomplete class=\"form-control {{options.ExtraClasses}}\" *ngIf=\"options.AllowNewSelection\" [data]=\"dataList\" [initialValue]=\"SelectedValue\"\r\n [searchKeyword]=\"keyword\" placeholder=\"{{options.Placeholder}}\" (selected)='selectEvent($event)'\r\n (inputChanged)='onChangeSearch($event)' historyIdentifier=\"dataList\" [itemTemplate]=\"itemTemplate\"\r\n [dir]=\"textDir\"\r\n formControlName=\"{{options.Name}}\" aria-describedby=\"email-error\" aria-invalid=\"true\"\r\n [class.is-invalid]=\"AutocompleteTextBoxControl.invalid && AutocompleteTextBoxControl.touched\">\r\n </ng-autocomplete>\r\n\r\n <ng-template #itemTemplate let-item>\r\n <img *ngIf=\"options.ItemWithImage\" src=\"{{(item.image?item.image:avatarImage)}}\" />\r\n <a [innerHTML]=\"item.value\"></a>\r\n </ng-template>\r\n </div>\r\n <!-- readonly -->\r\n <div *ngIf=\"options.IsReadonly\"><span class=\"readonly-view\">{{AutocompleteTextBoxControl.value.value}}</span>\r\n </div>\r\n </div>\r\n <div class=\"subtext-container\" *ngIf=\"!options.IsReadonly\">\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\" *ngIf=\"(AutocompleteTextBoxControl.invalid && AutocompleteTextBoxControl.touched)\">\r\n {{getErrorValidation(AutocompleteTextBoxControl.errors|keyvalue)}}\r\n </div>\r\n </div>\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"
|
|
4652
|
+
template: "\r\n<div class=\"form-group bbsf-control bbsf-autocomplete-textbox\" [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\" class=\"text-danger\">*</span>\r\n </label>\r\n <!--Input container-->\r\n <div class=\"bbsf-input-container\" *ngIf=\"!options.IsReadonly\">\r\n <!--input-->\r\n <ng-autocomplete class=\"form-control {{options.ExtraClasses}}\" *ngIf=\"!options.AllowNewSelection\" [data]=\"dataList\" [initialValue]=\"SelectedValue\"\r\n [searchKeyword]=\"keyword\" placeholder=\"{{options.Placeholder}}\" (selected)='selectEvent($event)'\r\n (inputChanged)='onChangeSearch($event)' historyIdentifier=\"dataList\" [itemTemplate]=\"itemTemplate\"\r\n [dir]=\"textDir\"\r\n formControlName=\"{{options.Name}}\"\r\n aria-describedby=\"email-error\"\r\n aria-invalid=\"true\"\r\n [class.is-invalid]=\"AutocompleteTextBoxControl.invalid && AutocompleteTextBoxControl.touched\"\r\n (inputCleared)=\"onInputCleared()\"\r\n >\r\n </ng-autocomplete>\r\n\r\n <ng-autocomplete class=\"form-control {{options.ExtraClasses}}\" *ngIf=\"options.AllowNewSelection\" [data]=\"dataList\" [initialValue]=\"SelectedValue\"\r\n [searchKeyword]=\"keyword\" placeholder=\"{{options.Placeholder}}\" (selected)='selectEvent($event)'\r\n (inputChanged)='onChangeSearch($event)' historyIdentifier=\"dataList\" [itemTemplate]=\"itemTemplate\"\r\n [dir]=\"textDir\" (inputCleared)=\"onInputCleared()\"\r\n formControlName=\"{{options.Name}}\" aria-describedby=\"email-error\" aria-invalid=\"true\"\r\n [class.is-invalid]=\"AutocompleteTextBoxControl.invalid && AutocompleteTextBoxControl.touched\">\r\n </ng-autocomplete>\r\n\r\n <ng-template #itemTemplate let-item>\r\n <img *ngIf=\"options.ItemWithImage\" src=\"{{(item.image?item.image:avatarImage)}}\" />\r\n <a [innerHTML]=\"item.value\"></a>\r\n </ng-template>\r\n </div>\r\n <!-- readonly -->\r\n <div *ngIf=\"options.IsReadonly\"><span class=\"readonly-view\">{{AutocompleteTextBoxControl.value.value}}</span>\r\n </div>\r\n </div>\r\n <div class=\"subtext-container\" *ngIf=\"!options.IsReadonly\">\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\" *ngIf=\"(AutocompleteTextBoxControl.invalid && AutocompleteTextBoxControl.touched)\">\r\n {{getErrorValidation(AutocompleteTextBoxControl.errors|keyvalue)}}\r\n </div>\r\n </div>\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"
|
|
4647
4653
|
},] }
|
|
4648
4654
|
];
|
|
4649
4655
|
AutocompleteTextBoxComponent.ctorParameters = function () { return [
|
|
@@ -5592,7 +5598,7 @@
|
|
|
5592
5598
|
]));
|
|
5593
5599
|
break;
|
|
5594
5600
|
case exports.InputType.URL:
|
|
5595
|
-
var pattern =
|
|
5601
|
+
var pattern = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]!\$&'\(\)\*\+,;=.]+$/;
|
|
5596
5602
|
this.validationRules.push(forms.Validators.compose([
|
|
5597
5603
|
this.controlUtility.patternValidator(pattern, { URLValidationKey: this.URLValidationKey }),
|
|
5598
5604
|
]));
|
|
@@ -6416,7 +6422,7 @@
|
|
|
6416
6422
|
{ type: i0.Component, args: [{
|
|
6417
6423
|
// tslint:disable-next-line: component-selector
|
|
6418
6424
|
selector: 'BBSF-Form',
|
|
6419
|
-
template: "<form id=\"{{fromName}}\" [FormGroup]=\"options.FormGroup\" (
|
|
6425
|
+
template: "<form id=\"{{fromName}}\" [FormGroup]=\"options.FormGroup\" (ngSubmit)=\"submit()\">\r\n\r\n <ng-template #content><ng-content></ng-content></ng-template>\r\n\r\n <ng-container *ngTemplateOutlet=\"content\"></ng-container>\r\n</form>\r\n"
|
|
6420
6426
|
},] }
|
|
6421
6427
|
];
|
|
6422
6428
|
FormComponent.ctorParameters = function () { return [
|