@bnsights/bbsf-controls 1.0.17 → 1.0.21
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.21.tgz +0 -0
- package/bnsights-bbsf-controls.metadata.json +1 -1
- package/bundles/bnsights-bbsf-controls.umd.js +38 -20
- package/bundles/bnsights-bbsf-controls.umd.js.map +1 -1
- package/esm2015/lib/Shared/Models/MultipleFileUploadModel.js +3 -3
- package/esm2015/lib/Shared/services/ControlUtility.js +5 -1
- package/esm2015/lib/controls/DateTimePicker/DateTimePicker.component.js +8 -4
- package/esm2015/lib/controls/FileUplaod/FileUplaod.component.js +12 -11
- package/esm2015/lib/controls/Form/Form.component.js +2 -2
- package/esm2015/lib/controls/Paging/Paging.component.js +4 -2
- package/esm2015/lib/controls/TextBox/TextBox.component.js +3 -2
- package/esm2015/lib/controls/Toggleslide/toggleslide.component.js +6 -3
- package/esm2015/lib/controls/bbsf-controls.module.js +8 -4
- package/fesm2015/bnsights-bbsf-controls.js +40 -23
- package/fesm2015/bnsights-bbsf-controls.js.map +1 -1
- package/lib/Shared/Models/MultipleFileUploadModel.d.ts +2 -2
- package/lib/Shared/services/ControlUtility.d.ts +1 -0
- package/lib/controls/DateTimePicker/DateTimePicker.component.d.ts +3 -1
- package/lib/controls/Paging/Paging.component.d.ts +1 -1
- package/lib/controls/Toggleslide/toggleslide.component.d.ts +2 -1
- package/package.json +3 -3
- package/bnsights-bbsf-controls-1.0.17.tgz +0 -0
|
@@ -13,7 +13,7 @@ import { ToastrModule } from 'ngx-toastr';
|
|
|
13
13
|
import { NgxPermissionsModule } from 'ngx-permissions';
|
|
14
14
|
import { OverlayModule } from '@angular/cdk/overlay';
|
|
15
15
|
import { StoreDevtoolsModule } from '@ngrx/store-devtools';
|
|
16
|
-
import { CommonModule } from '@angular/common';
|
|
16
|
+
import { DatePipe, CommonModule } from '@angular/common';
|
|
17
17
|
import { SearchCountryField, NgxIntlTelInputModule } from 'ngx-intl-tel-input';
|
|
18
18
|
import { UtilityService, ControlValidationService, BBSFTranslateService, RequestOptionsModel, RequestHandlerService, BBSFUtilitiesModule } from '@bnsights/bbsf-utilities';
|
|
19
19
|
import { BsDatepickerModule } from 'ngx-bootstrap/datepicker';
|
|
@@ -21,7 +21,7 @@ import { Subject, Observable, noop, of } from 'rxjs';
|
|
|
21
21
|
import { FileUploader, FileLikeObject, FileUploadModule } from 'ng2-file-upload';
|
|
22
22
|
import { __decorate, __awaiter } from 'tslib';
|
|
23
23
|
import { Expose, plainToClass } from 'class-transformer';
|
|
24
|
-
import { OwlDateTimeModule, OwlNativeDateTimeModule } from 'ng-pick-datetime';
|
|
24
|
+
import { OwlDateTimeModule, OwlNativeDateTimeModule, OWL_DATE_TIME_LOCALE } from 'ng-pick-datetime';
|
|
25
25
|
import { NgMultiSelectDropDownModule } from 'ng-multiselect-dropdown';
|
|
26
26
|
import { AngularMultiSelectModule } from 'angular2-multiselect-dropdown';
|
|
27
27
|
import { NgxSummernoteModule } from 'ngx-summernote';
|
|
@@ -284,6 +284,10 @@ class ControlUtility {
|
|
|
284
284
|
FormControl.setValidators(ValidationRole);
|
|
285
285
|
FormControl.updateValueAndValidity();
|
|
286
286
|
}
|
|
287
|
+
static getLocal() {
|
|
288
|
+
let lang = localStorage.getItem('language');
|
|
289
|
+
return lang == "ar" ? "ar" : "en-UK";
|
|
290
|
+
}
|
|
287
291
|
IsValid(FormControl) {
|
|
288
292
|
FormControl.markAsTouched();
|
|
289
293
|
}
|
|
@@ -337,7 +341,8 @@ OnPagingFiltersChangeService.decorators = [
|
|
|
337
341
|
|
|
338
342
|
class DateInputComponent {
|
|
339
343
|
// tslint:disable-next-line: max-line-length
|
|
340
|
-
constructor(onChangeService, ErrorHandler, controlUtility, controlContainer, DateInputControlHost, UtilityService, translate, controlValidationService) {
|
|
344
|
+
constructor(datepipe, onChangeService, ErrorHandler, controlUtility, controlContainer, DateInputControlHost, UtilityService, translate, controlValidationService) {
|
|
345
|
+
this.datepipe = datepipe;
|
|
341
346
|
this.onChangeService = onChangeService;
|
|
342
347
|
this.ErrorHandler = ErrorHandler;
|
|
343
348
|
this.controlUtility = controlUtility;
|
|
@@ -436,14 +441,15 @@ class DateInputComponent {
|
|
|
436
441
|
}
|
|
437
442
|
onDateSelect(item) {
|
|
438
443
|
let DateValue;
|
|
444
|
+
var tzoffset = (new Date()).getTimezoneOffset() * 60000; //offset in milliseconds
|
|
439
445
|
if (this.options.SelectMode == 2) {
|
|
440
446
|
for (let index = 0; index < item.value.length; index++) {
|
|
441
|
-
item.value[index] = new Date(item.value[index]).toISOString();
|
|
447
|
+
item.value[index] = new Date(item.value[index] - tzoffset).toISOString().slice(0, -1);
|
|
442
448
|
}
|
|
443
449
|
DateValue = item.value;
|
|
444
450
|
}
|
|
445
451
|
else {
|
|
446
|
-
DateValue = new Date(item.value).toISOString();
|
|
452
|
+
DateValue = new Date(item.value - tzoffset).toISOString().slice(0, -1);
|
|
447
453
|
}
|
|
448
454
|
this.DatePickerFormControl.setValue(DateValue);
|
|
449
455
|
this.onChangeService.ChangeValue(this.options.Name);
|
|
@@ -459,6 +465,7 @@ DateInputComponent.decorators = [
|
|
|
459
465
|
},] }
|
|
460
466
|
];
|
|
461
467
|
DateInputComponent.ctorParameters = () => [
|
|
468
|
+
{ type: DatePipe },
|
|
462
469
|
{ type: OnPagingFiltersChangeService },
|
|
463
470
|
{ type: ErrorMassageValidation },
|
|
464
471
|
{ type: ControlUtility },
|
|
@@ -480,9 +487,9 @@ class FileUploadModel {
|
|
|
480
487
|
class MultipleFileUploadModel {
|
|
481
488
|
constructor() {
|
|
482
489
|
this.CorrelationID_GUID = null;
|
|
483
|
-
this.
|
|
490
|
+
this.UploadedFiles = [];
|
|
484
491
|
this.ExistingFiles = [];
|
|
485
|
-
this.
|
|
492
|
+
this.RemovedFiles = [];
|
|
486
493
|
}
|
|
487
494
|
}
|
|
488
495
|
|
|
@@ -739,6 +746,7 @@ class FileUploadComponent {
|
|
|
739
746
|
FileType: file.type,
|
|
740
747
|
FileBase64: reader.result.toString().split(',')[1],
|
|
741
748
|
FileSizeInMB: ((file.size / 1000) / 1000),
|
|
749
|
+
NameWithExtension: file.name
|
|
742
750
|
};
|
|
743
751
|
if (this.options.IsMultipleFile == false) {
|
|
744
752
|
this.fileUploadModel = new FileUploadModel();
|
|
@@ -748,10 +756,10 @@ class FileUploadComponent {
|
|
|
748
756
|
}
|
|
749
757
|
else {
|
|
750
758
|
FilesArray.push(AddedFile);
|
|
751
|
-
this.multipleFileUploadModel.
|
|
759
|
+
this.multipleFileUploadModel.UploadedFiles = FilesArray;
|
|
752
760
|
if (this.options.Value != null && this.options.Value != undefined) {
|
|
753
761
|
if (this.options.Value.CorrelationID_GUID == null) {
|
|
754
|
-
this.multipleFileUploadModel.
|
|
762
|
+
this.multipleFileUploadModel.RemovedFiles = [];
|
|
755
763
|
}
|
|
756
764
|
}
|
|
757
765
|
this.fileUploadFormControl.setValue(this.multipleFileUploadModel);
|
|
@@ -775,32 +783,32 @@ class FileUploadComponent {
|
|
|
775
783
|
else {
|
|
776
784
|
if (this.options.Value != null && this.options.Value != undefined) {
|
|
777
785
|
if (this.options.Value.CorrelationID_GUID == null) {
|
|
778
|
-
this.multipleFileUploadModel.
|
|
786
|
+
this.multipleFileUploadModel.RemovedFiles = [];
|
|
779
787
|
}
|
|
780
788
|
else {
|
|
781
|
-
if (this.multipleFileUploadModel.
|
|
789
|
+
if (this.multipleFileUploadModel.RemovedFiles.length == 0) {
|
|
782
790
|
let FileObject = item.file.rawFile;
|
|
783
791
|
let DeletedItemId = this.options.Value.ExistingFiles.filter(Object => Object.FileName == FileObject.name)[0];
|
|
784
792
|
this.options.Value.ExistingFiles = this.options.Value.ExistingFiles.filter(Object => Object.FileName != FileObject.name);
|
|
785
|
-
this.multipleFileUploadModel.
|
|
793
|
+
this.multipleFileUploadModel.RemovedFiles.push(DeletedItemId);
|
|
786
794
|
}
|
|
787
795
|
else {
|
|
788
796
|
let FileObject = item.file.rawFile;
|
|
789
|
-
let deletedList = this.multipleFileUploadModel.
|
|
797
|
+
let deletedList = this.multipleFileUploadModel.RemovedFiles.filter(Object => Object.FileName == FileObject.name);
|
|
790
798
|
if (deletedList.length == 0 || deletedList == undefined) {
|
|
791
799
|
let DeletedItemId = this.options.Value.ExistingFiles.filter(Object => Object.FileName == FileObject.name)[0];
|
|
792
800
|
this.options.Value.ExistingFiles = this.options.Value.ExistingFiles.filter(Object => Object.FileName != FileObject.name);
|
|
793
|
-
this.multipleFileUploadModel.
|
|
801
|
+
this.multipleFileUploadModel.RemovedFiles.push(DeletedItemId);
|
|
794
802
|
}
|
|
795
803
|
}
|
|
796
804
|
}
|
|
797
805
|
}
|
|
798
806
|
else {
|
|
799
|
-
this.multipleFileUploadModel.
|
|
807
|
+
this.multipleFileUploadModel.RemovedFiles = [];
|
|
800
808
|
}
|
|
801
|
-
let ItemList = this.group.get(this.options.Name).value.
|
|
809
|
+
let ItemList = this.group.get(this.options.Name).value.UploadedFiles;
|
|
802
810
|
ItemList = ItemList.filter(Object => Object.FileName != item._file.name);
|
|
803
|
-
this.multipleFileUploadModel.
|
|
811
|
+
this.multipleFileUploadModel.UploadedFiles = ItemList;
|
|
804
812
|
if ((ItemList == null || ItemList == []) && this.options.IsRequired) {
|
|
805
813
|
this.fileUploadFormControl.markAsTouched();
|
|
806
814
|
this.fileUploadFormControl.invalid;
|
|
@@ -2026,6 +2034,7 @@ class ToggleslideComponent {
|
|
|
2026
2034
|
this.UtilityService = UtilityService;
|
|
2027
2035
|
this.controlValidationService = controlValidationService;
|
|
2028
2036
|
this.globalSettings = globalSettings;
|
|
2037
|
+
this.OnChange = new EventEmitter();
|
|
2029
2038
|
this.SlideValue = false;
|
|
2030
2039
|
ToggleslideComponent.controlContainerstatic = this.controlContainer;
|
|
2031
2040
|
}
|
|
@@ -2058,6 +2067,7 @@ class ToggleslideComponent {
|
|
|
2058
2067
|
return this.controlUtility.getErrorValidation(Errorsitem, this.options.CustomValidation);
|
|
2059
2068
|
}
|
|
2060
2069
|
changeValueToggle() {
|
|
2070
|
+
this.OnChange.emit(this.SlideValue);
|
|
2061
2071
|
this.ToggleslideFormControl.setValue(this.SlideValue);
|
|
2062
2072
|
}
|
|
2063
2073
|
}
|
|
@@ -2080,7 +2090,8 @@ ToggleslideComponent.ctorParameters = () => [
|
|
|
2080
2090
|
];
|
|
2081
2091
|
ToggleslideComponent.propDecorators = {
|
|
2082
2092
|
group: [{ type: Input }],
|
|
2083
|
-
options: [{ type: Input }]
|
|
2093
|
+
options: [{ type: Input }],
|
|
2094
|
+
OnChange: [{ type: Output }]
|
|
2084
2095
|
};
|
|
2085
2096
|
|
|
2086
2097
|
class HtmlEditorComponent {
|
|
@@ -3831,7 +3842,7 @@ class PagingComponent {
|
|
|
3831
3842
|
this.IsFirstCall = true;
|
|
3832
3843
|
this.getItemList(this.CurrentPage, true);
|
|
3833
3844
|
}
|
|
3834
|
-
|
|
3845
|
+
ngAfterViewChecked() {
|
|
3835
3846
|
if (this.options.OnClickFiltersControlNames != null && this.options.OnClickFiltersControlNames.length > 0) {
|
|
3836
3847
|
const OnClickFiltersControlNames = this.options.OnClickFiltersControlNames;
|
|
3837
3848
|
for (let index = 0; index < OnClickFiltersControlNames.length; index++) {
|
|
@@ -3933,6 +3944,8 @@ class PagingComponent {
|
|
|
3933
3944
|
else {
|
|
3934
3945
|
if (this.options.Filters[index].FilterType == FilterType.AutocompleteTextBox)
|
|
3935
3946
|
ControlValue = JSON.stringify(ControlValue);
|
|
3947
|
+
if (this.options.Filters[index].FilterType == FilterType.TagInput)
|
|
3948
|
+
ControlValue = JSON.stringify(ControlValue);
|
|
3936
3949
|
params = params.append(this.options.Filters[index].ActionParameterName, ControlValue);
|
|
3937
3950
|
}
|
|
3938
3951
|
}
|
|
@@ -4235,6 +4248,7 @@ class TextboxComponent {
|
|
|
4235
4248
|
this.controlValidationService = controlValidationService;
|
|
4236
4249
|
this.globalSettings = globalSettings;
|
|
4237
4250
|
this.OnChange = new EventEmitter();
|
|
4251
|
+
this.MaskPattern = '';
|
|
4238
4252
|
this.WordCount = 0;
|
|
4239
4253
|
this.WordCountArray = 0;
|
|
4240
4254
|
this.IsShowWordCount = false;
|
|
@@ -4297,7 +4311,7 @@ class TextboxComponent {
|
|
|
4297
4311
|
switch (this.options.Type) {
|
|
4298
4312
|
case InputType.Email:
|
|
4299
4313
|
this.validationRules.push(Validators.compose([
|
|
4300
|
-
this.controlUtility.patternValidator(/^[
|
|
4314
|
+
this.controlUtility.patternValidator(/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, { EmailValidationKey: this.EmailValidationKey }),
|
|
4301
4315
|
]));
|
|
4302
4316
|
break;
|
|
4303
4317
|
case InputType.EID:
|
|
@@ -4962,7 +4976,7 @@ class FormComponent {
|
|
|
4962
4976
|
this.utilityService.notifyErrorMessage(errorMessage);
|
|
4963
4977
|
}
|
|
4964
4978
|
else {
|
|
4965
|
-
errorMessage = `
|
|
4979
|
+
errorMessage = `error message is: ${err.error ? err.error.Message : err.message}`;
|
|
4966
4980
|
if (!this.options.DisableErrorNotification)
|
|
4967
4981
|
this.utilityService.notifyErrorMessage(errorMessage);
|
|
4968
4982
|
}
|
|
@@ -5141,6 +5155,7 @@ FullCalendarModule.registerPlugins([
|
|
|
5141
5155
|
listPlugin,
|
|
5142
5156
|
interactionPlugin
|
|
5143
5157
|
]);
|
|
5158
|
+
const ɵ0 = ControlUtility.getLocal();
|
|
5144
5159
|
class BBSFControlsModule {
|
|
5145
5160
|
constructor(injector, translate) {
|
|
5146
5161
|
this.injector = injector;
|
|
@@ -5238,7 +5253,9 @@ BBSFControlsModule.decorators = [
|
|
|
5238
5253
|
// ControlValidationService,
|
|
5239
5254
|
FormGroupDirective,
|
|
5240
5255
|
NgbModal,
|
|
5241
|
-
NgbActiveModal
|
|
5256
|
+
NgbActiveModal,
|
|
5257
|
+
DatePipe,
|
|
5258
|
+
{ provide: OWL_DATE_TIME_LOCALE, useValue: ɵ0 },
|
|
5242
5259
|
],
|
|
5243
5260
|
schemas: [
|
|
5244
5261
|
NO_ERRORS_SCHEMA
|
|
@@ -6121,5 +6138,5 @@ var FileType;
|
|
|
6121
6138
|
* Generated bundle index. Do not edit.
|
|
6122
6139
|
*/
|
|
6123
6140
|
|
|
6124
|
-
export { AppInjector, Attribute, AutocompleteDTO, AutocompleteOptions, BBSFControlsModule, CalendarEventDTO, CalendarOptions, CalendarView, CancelDTO, CheckBoxOptions, ConfirmationModalOptions, ControlLayout, ControlUtility, Country, CustomValidation, CustomValidator, DatePickerOptions, DropdownListItem, DropdownOptions, EditPersonalImage, EnglishArabicDTO, ErrorMassageValidation, FileType, FileUploadModel, FileUploadOptions, FilterItem, FilterType, FontSize, ForceDirection, FormOptions, GlobalSettings, HtmlEditorOptions, IconPosition, ImageType, ImageUploadOptions, InputType, Insert, LanguageMode, MapAutoCompleteOptions, MapAutocompleteDTO, MenuListType, Misc, MultiLingualHtmlEditorOptions, MultiLingualTextAreaOptions, MultiLingualTextBoxOptions, MultipleFileUploadModel, OnPagingFiltersChangeService, PagingActionMode, PagingDTO, PagingOptions, Para, PhoneOptions, PickerType, ProfileImageUploadOptions, ProfilePictureDTO, RadioButtonItem, RadioButtonOptions, RangeNumber, SaveDTO, SelectMode, StartView, Style, StyleConfirmationMode, TagsInputDTO, TagsInputOptions, TextAreaOptions, TextBoxOptions, ToggleSlideOptions, UploadPersonalImage, environment, options, DateInputComponent as ɵa, FileUploadComponent as ɵb, MultiLingualTextBoxComponent as ɵc, TextboxComponent as ɵd, TextAreaComponent as ɵe, MultiLingualTextAreaComponent as ɵf, CheckBoxComponent as ɵg, DropdownListComponent as ɵh, PhoneComponent as ɵi, ToggleslideComponent as ɵj, HtmlEditorComponent as ɵk, MultiLingualHtmlEditorComponent as ɵl, ImageUploaderComponent as ɵm, ProfileImageUploaderComponent as ɵn, CalendarComponent as ɵo, MapAutoCompleteComponent as ɵp, AutocompleteTextBoxComponent as ɵq, TagsInputComponent as ɵr, PagingComponent as ɵs, JwPaginationComponent as ɵt, RadioButtonComponent as ɵu, FormComponent as ɵv, ConfirmationModalComponent as ɵw };
|
|
6141
|
+
export { AppInjector, Attribute, AutocompleteDTO, AutocompleteOptions, BBSFControlsModule, CalendarEventDTO, CalendarOptions, CalendarView, CancelDTO, CheckBoxOptions, ConfirmationModalOptions, ControlLayout, ControlUtility, Country, CustomValidation, CustomValidator, DatePickerOptions, DropdownListItem, DropdownOptions, EditPersonalImage, EnglishArabicDTO, ErrorMassageValidation, FileType, FileUploadModel, FileUploadOptions, FilterItem, FilterType, FontSize, ForceDirection, FormOptions, GlobalSettings, HtmlEditorOptions, IconPosition, ImageType, ImageUploadOptions, InputType, Insert, LanguageMode, MapAutoCompleteOptions, MapAutocompleteDTO, MenuListType, Misc, MultiLingualHtmlEditorOptions, MultiLingualTextAreaOptions, MultiLingualTextBoxOptions, MultipleFileUploadModel, OnPagingFiltersChangeService, PagingActionMode, PagingDTO, PagingOptions, Para, PhoneOptions, PickerType, ProfileImageUploadOptions, ProfilePictureDTO, RadioButtonItem, RadioButtonOptions, RangeNumber, SaveDTO, SelectMode, StartView, Style, StyleConfirmationMode, TagsInputDTO, TagsInputOptions, TextAreaOptions, TextBoxOptions, ToggleSlideOptions, UploadPersonalImage, environment, options, ɵ0, DateInputComponent as ɵa, FileUploadComponent as ɵb, MultiLingualTextBoxComponent as ɵc, TextboxComponent as ɵd, TextAreaComponent as ɵe, MultiLingualTextAreaComponent as ɵf, CheckBoxComponent as ɵg, DropdownListComponent as ɵh, PhoneComponent as ɵi, ToggleslideComponent as ɵj, HtmlEditorComponent as ɵk, MultiLingualHtmlEditorComponent as ɵl, ImageUploaderComponent as ɵm, ProfileImageUploaderComponent as ɵn, CalendarComponent as ɵo, MapAutoCompleteComponent as ɵp, AutocompleteTextBoxComponent as ɵq, TagsInputComponent as ɵr, PagingComponent as ɵs, JwPaginationComponent as ɵt, RadioButtonComponent as ɵu, FormComponent as ɵv, ConfirmationModalComponent as ɵw };
|
|
6125
6142
|
//# sourceMappingURL=bnsights-bbsf-controls.js.map
|