@bnsights/bbsf-controls 1.2.9 → 1.2.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/README.md +20 -2
- package/fesm2022/bnsights-bbsf-controls.mjs +405 -1165
- package/fesm2022/bnsights-bbsf-controls.mjs.map +1 -1
- package/lib/controls/Repeater/builders/field-option-builders.d.ts +39 -0
- package/lib/controls/Repeater/repeater-field-builder/repeater-field-builder.component.d.ts +17 -3
- package/lib/controls/Repeater/services/field-config-factory.service.d.ts +42 -0
- package/package.json +2 -2
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { InputType } from '../../../Shared/Enums/InputType';
|
|
2
|
+
import { PickerType } from '../../../Shared/Enums/PickerType';
|
|
3
|
+
import { DatePickerOptions } from '../../../Shared/Models/DatePickerOptions';
|
|
4
|
+
import { DropdownOptions } from '../../../Shared/Models/DropdownOptions';
|
|
5
|
+
import { FileUploadOptions } from '../../../Shared/Models/FileUploadOptions';
|
|
6
|
+
import { HtmlEditorOptions } from '../../../Shared/Models/HtmlEditorOptions';
|
|
7
|
+
import { ImageUploadOptions } from '../../../Shared/Models/ImageUploadOptions';
|
|
8
|
+
import { MapAutoCompleteOptions } from '../../../Shared/Models/MapAutoCompleteOptions';
|
|
9
|
+
import { PhoneOptions } from '../../../Shared/Models/PhoneOptions';
|
|
10
|
+
import { TextAreaOptions } from '../../../Shared/Models/TextAreaOptions';
|
|
11
|
+
import { TextBoxOptions } from '../../../Shared/Models/TextBoxOptions';
|
|
12
|
+
import { ToggleSlideOptions } from '../../../Shared/Models/ToggleSlideOptions';
|
|
13
|
+
import { CheckBoxOptions } from '../../../Shared/Models/CheckBoxOptions';
|
|
14
|
+
/**
|
|
15
|
+
* Builder functions for creating field options objects
|
|
16
|
+
* Each function takes common parameters and returns a configured options object
|
|
17
|
+
*/
|
|
18
|
+
export interface BaseFieldConfig {
|
|
19
|
+
name: string;
|
|
20
|
+
hideLabel: boolean;
|
|
21
|
+
labelKey: string;
|
|
22
|
+
isRequired?: boolean;
|
|
23
|
+
viewType: any;
|
|
24
|
+
labelDescription: string;
|
|
25
|
+
customValidation?: any[];
|
|
26
|
+
value: any;
|
|
27
|
+
}
|
|
28
|
+
export declare function buildTextBoxOptions(config: BaseFieldConfig, type: InputType, maxLength?: number, minLength?: number, languageValidation?: any, isReadonly?: boolean): TextBoxOptions;
|
|
29
|
+
export declare function buildNumberTextBoxOptions(config: BaseFieldConfig, maxValue?: number, minValue?: number, languageValidation?: any, isReadonly?: boolean): TextBoxOptions;
|
|
30
|
+
export declare function buildDatePickerOptions(config: BaseFieldConfig, pickerType: PickerType, startDate?: Date, endDate?: Date): DatePickerOptions;
|
|
31
|
+
export declare function buildDropdownOptions(config: BaseFieldConfig, dataSource: any[], singleSelection: boolean, hasSearch: boolean): DropdownOptions;
|
|
32
|
+
export declare function buildFileUploadOptions(config: BaseFieldConfig, fileMaxSizeInMB?: number, isMultiple?: boolean, maxNoOfFiles?: number, maxSizeForAllFilesInMB?: number): FileUploadOptions;
|
|
33
|
+
export declare function buildImageUploadOptions(config: BaseFieldConfig, fileMaxSizeInMB?: number): ImageUploadOptions;
|
|
34
|
+
export declare function buildPhoneOptions(config: BaseFieldConfig): PhoneOptions;
|
|
35
|
+
export declare function buildTextAreaOptions(config: BaseFieldConfig, maxLength?: number, minLength?: number, rows?: number, forceDirection?: any): TextAreaOptions;
|
|
36
|
+
export declare function buildHtmlEditorOptions(config: BaseFieldConfig, maxLength?: number, minLength?: number, height?: number, forceDirection?: any): HtmlEditorOptions;
|
|
37
|
+
export declare function buildToggleSlideOptions(config: BaseFieldConfig): ToggleSlideOptions;
|
|
38
|
+
export declare function buildMapAutoCompleteOptions(config: BaseFieldConfig): MapAutoCompleteOptions;
|
|
39
|
+
export declare function buildCheckBoxOptions(config: BaseFieldConfig, outputFunction?: any): CheckBoxOptions;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { AfterViewInit, OnInit, SimpleChanges, ViewContainerRef } from '@angular/core';
|
|
1
|
+
import { AfterViewInit, OnInit, OnChanges, SimpleChanges, ViewContainerRef } from '@angular/core';
|
|
2
2
|
import { FormGroup, FormGroupDirective } from '@angular/forms';
|
|
3
3
|
import { RepeaterField } from '../../../Shared/Models/RepeaterField';
|
|
4
4
|
import { RenderComponentService } from '../../../Shared/services/render-component-service.service';
|
|
5
|
+
import { FieldConfigFactoryService } from '../services/field-config-factory.service';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class RepeaterFieldBuilderComponent implements OnInit, AfterViewInit {
|
|
7
|
+
export declare class RepeaterFieldBuilderComponent implements OnInit, AfterViewInit, OnChanges {
|
|
7
8
|
private renderComponentService;
|
|
9
|
+
private fieldConfigFactory;
|
|
8
10
|
textControlHost: FormGroupDirective;
|
|
9
11
|
item: ViewContainerRef;
|
|
10
12
|
group: FormGroup;
|
|
@@ -14,10 +16,22 @@ export declare class RepeaterFieldBuilderComponent implements OnInit, AfterViewI
|
|
|
14
16
|
itemsValue: any[];
|
|
15
17
|
itemValue: any;
|
|
16
18
|
value: any;
|
|
17
|
-
constructor(renderComponentService: RenderComponentService, textControlHost: FormGroupDirective);
|
|
19
|
+
constructor(renderComponentService: RenderComponentService, fieldConfigFactory: FieldConfigFactoryService, textControlHost: FormGroupDirective);
|
|
18
20
|
ngOnInit(): void;
|
|
19
21
|
ngAfterViewInit(): void;
|
|
20
22
|
ngOnChanges(changes: SimpleChanges): void;
|
|
23
|
+
/**
|
|
24
|
+
* Extracts the value for the current item from itemsValue array
|
|
25
|
+
*/
|
|
26
|
+
private extractValueFromItemsValue;
|
|
27
|
+
/**
|
|
28
|
+
* Builds the control name based on item number
|
|
29
|
+
*/
|
|
30
|
+
private buildControlName;
|
|
31
|
+
/**
|
|
32
|
+
* Renders the field using the factory service
|
|
33
|
+
*/
|
|
34
|
+
private renderField;
|
|
21
35
|
static ɵfac: i0.ɵɵFactoryDeclaration<RepeaterFieldBuilderComponent, never>;
|
|
22
36
|
static ɵcmp: i0.ɵɵComponentDeclaration<RepeaterFieldBuilderComponent, "repeater-field-builder", never, { "group": { "alias": "group"; "required": false; }; "itemNumber": { "alias": "itemNumber"; "required": false; }; "controlNumber": { "alias": "controlNumber"; "required": false; }; "repeaterField": { "alias": "repeaterField"; "required": false; }; "itemsValue": { "alias": "itemsValue"; "required": false; }; }, {}, never, never, true, never>;
|
|
23
37
|
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Type } from '@angular/core';
|
|
2
|
+
import { DataType } from '../../../Shared/Enums/Enums';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export interface FieldControlOptions {
|
|
5
|
+
name: string;
|
|
6
|
+
hideLabel: boolean;
|
|
7
|
+
labelKey: string;
|
|
8
|
+
isRequired?: boolean;
|
|
9
|
+
viewType: any;
|
|
10
|
+
labelDescription?: string;
|
|
11
|
+
customValidation?: any[];
|
|
12
|
+
maxLength?: number;
|
|
13
|
+
minLength?: number;
|
|
14
|
+
languageValidation?: any;
|
|
15
|
+
isReadonly?: boolean;
|
|
16
|
+
numberRange?: {
|
|
17
|
+
to?: number;
|
|
18
|
+
from?: number;
|
|
19
|
+
};
|
|
20
|
+
startDate?: Date;
|
|
21
|
+
endDate?: Date;
|
|
22
|
+
dataSource?: any[];
|
|
23
|
+
hasSearch?: boolean;
|
|
24
|
+
isMultiple?: boolean;
|
|
25
|
+
maxFileSizeInMB?: number;
|
|
26
|
+
maxFileCount?: number;
|
|
27
|
+
rows?: number;
|
|
28
|
+
forceDirection?: any;
|
|
29
|
+
outputFunction?: any;
|
|
30
|
+
}
|
|
31
|
+
export declare class FieldConfigFactoryService {
|
|
32
|
+
/**
|
|
33
|
+
* Creates field options based on the data type and control configuration
|
|
34
|
+
*/
|
|
35
|
+
createFieldOptions(dataType: DataType, controlOptions: FieldControlOptions, controlName: string, value: any): any;
|
|
36
|
+
/**
|
|
37
|
+
* Returns the component type for a given data type
|
|
38
|
+
*/
|
|
39
|
+
getComponentType(dataType: DataType): Type<any>;
|
|
40
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FieldConfigFactoryService, never>;
|
|
41
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FieldConfigFactoryService>;
|
|
42
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bnsights/bbsf-controls",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.11",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/animations": "^19.2.14",
|
|
6
6
|
"@angular/cdk": "^19.2.19",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
},
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@angular/google-maps": "18.2.14",
|
|
16
|
-
"@bnsights/bbsf-utilities": "1.2.
|
|
16
|
+
"@bnsights/bbsf-utilities": "1.2.5",
|
|
17
17
|
"@danielmoncada/angular-datetime-picker": "20.0.0",
|
|
18
18
|
"@fullcalendar/angular": "6.1.19",
|
|
19
19
|
"@fullcalendar/core": "6.1.19",
|