bpm-core 0.0.111 → 0.0.113
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/fesm2022/bpm-core.mjs +272 -204
- package/fesm2022/bpm-core.mjs.map +1 -1
- package/lib/components/shared-components/action-buttons/action-buttons.component.d.ts +1 -1
- package/lib/components/shared-components/form-field/control-value-accessor.directive.d.ts +5 -3
- package/lib/components/shared-components/form-field/doc-uploader/docs-uploader.component.d.ts +1 -0
- package/lib/components/shared-components/form-field/index.d.ts +0 -1
- package/lib/components/shared-components/form-field/textarea/textarea.component.d.ts +2 -1
- package/lib/components/shared-components/form-field/validation-errors/validation-errors.component.d.ts +1 -1
- package/lib/functions/index.d.ts +1 -1
- package/lib/functions/validators.d.ts +59 -0
- package/lib/testComponent/request-details-section/request-details-section.component.d.ts +2 -0
- package/package.json +1 -1
- package/public-api.d.ts +0 -1
- package/lib/classes/form-validation.d.ts +0 -19
- package/lib/classes/index.d.ts +0 -1
- package/lib/components/shared-components/form-field/textarea/special-chars.directive.d.ts +0 -10
- package/lib/functions/is-valid-data.d.ts +0 -1
|
@@ -36,7 +36,7 @@ export declare class ActionButtonsComponent implements AfterViewInit {
|
|
|
36
36
|
onSubmit(action: string): void;
|
|
37
37
|
submitForm(action: string, section: Section): void;
|
|
38
38
|
success(response: any): void;
|
|
39
|
-
buttonShape(item: any): "
|
|
39
|
+
buttonShape(item: any): "" | "outline";
|
|
40
40
|
buttonColor(item: any): "" | "red";
|
|
41
41
|
static ɵfac: i0.ɵɵFactoryDeclaration<ActionButtonsComponent, never>;
|
|
42
42
|
static ɵcmp: i0.ɵɵComponentDeclaration<ActionButtonsComponent, "lib-action-buttons", never, { "lovOptions": { "alias": "lovOptions"; "required": false; }; "lovType": { "alias": "lovType"; "required": false; }; "fieldsForm": { "alias": "fieldsForm"; "required": false; }; "form": { "alias": "form"; "required": false; }; "section": { "alias": "section"; "required": false; }; "sections": { "alias": "sections"; "required": false; }; "showApprovalCycle": { "alias": "showApprovalCycle"; "required": false; }; "customCall": { "alias": "customCall"; "required": false; }; }, { "resetFormEmit": "resetFormEmit"; "customCallEmit": "customCallEmit"; }, never, never, true, never>;
|
|
@@ -50,16 +50,18 @@ export declare class ControlValueAccessorDirective<Type> implements ControlValue
|
|
|
50
50
|
control: FormControl | undefined;
|
|
51
51
|
required: boolean;
|
|
52
52
|
mandatory: boolean;
|
|
53
|
-
maxLength: any;
|
|
54
53
|
isDisabled: boolean;
|
|
54
|
+
onChangeFn: (val: Type | null) => void;
|
|
55
|
+
onTouchedFn: () => void;
|
|
55
56
|
constructor(injector: Injector, i18n: CoreI18nService, toasterService: ToastrService, coreService: CoreService, sanitizer: DomSanitizer, fb: FormBuilder, actionStateService: ActionStateService);
|
|
56
57
|
ngOnInit(): void;
|
|
57
58
|
setFormControl(): void;
|
|
58
59
|
setFormValidators(): void;
|
|
59
60
|
writeValue(value: Type): void;
|
|
60
|
-
registerOnChange(fn: (val: Type | null) =>
|
|
61
|
-
registerOnTouched(fn: () =>
|
|
61
|
+
registerOnChange(fn: (val: Type | null) => void): void;
|
|
62
|
+
registerOnTouched(fn: () => void): void;
|
|
62
63
|
setDisabledState?(isDisabled: boolean): void;
|
|
64
|
+
setValue(value: any): void;
|
|
63
65
|
static ɵfac: i0.ɵɵFactoryDeclaration<ControlValueAccessorDirective<any>, never>;
|
|
64
66
|
static ɵdir: i0.ɵɵDirectiveDeclaration<ControlValueAccessorDirective<any>, "[appControlValueAccessor]", never, { "tooltip": { "alias": "tooltip"; "required": false; }; "isReadOnly": { "alias": "isReadOnly"; "required": false; }; "hint": { "alias": "hint"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "type": { "alias": "type"; "required": false; }; "showErrorMessage": { "alias": "showErrorMessage"; "required": false; }; "showHint": { "alias": "showHint"; "required": false; }; "showIfEmpty": { "alias": "showIfEmpty"; "required": false; }; "insideTable": { "alias": "insideTable"; "required": false; }; "mask": { "alias": "mask"; "required": false; }; "label": { "alias": "label"; "required": false; }; "matSuffix": { "alias": "matSuffix"; "required": false; }; "hasTooltip": { "alias": "hasTooltip"; "required": false; }; "name": { "alias": "name"; "required": false; }; "randomID": { "alias": "randomID"; "required": false; }; "multiple": { "alias": "multiple"; "required": false; }; "customErrorMessages": { "alias": "customErrorMessages"; "required": false; }; "maxDate": { "alias": "maxDate"; "required": false; }; "minDate": { "alias": "minDate"; "required": false; }; "customMaxDate": { "alias": "customMaxDate"; "required": false; }; "customMinDate": { "alias": "customMinDate"; "required": false; }; "required": { "alias": "required"; "required": false; }; "mandatory": { "alias": "mandatory"; "required": false; }; }, {}, never, never, true, never>;
|
|
65
67
|
}
|
package/lib/components/shared-components/form-field/doc-uploader/docs-uploader.component.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ export declare class DocsUploaderComponent<Type> extends ControlValueAccessorDir
|
|
|
55
55
|
inputFile: ElementRef;
|
|
56
56
|
dialog: MatDialog;
|
|
57
57
|
destroyRef: DestroyRef;
|
|
58
|
+
maxLength: number | string;
|
|
58
59
|
private readonly validImageTypes;
|
|
59
60
|
validImgPdfTypes: {
|
|
60
61
|
pdf: string[];
|
|
@@ -15,7 +15,6 @@ export * from './input-telephone/input-telephone.component';
|
|
|
15
15
|
export * from './search-employee/search-employee.component';
|
|
16
16
|
export * from './select/select.component';
|
|
17
17
|
export * from './textarea/textarea.component';
|
|
18
|
-
export * from './textarea/special-chars.directive';
|
|
19
18
|
export * from './toggle-button/toggle-button.component';
|
|
20
19
|
export * from './table-list/table-list.component';
|
|
21
20
|
export * from './repeated-list/repeated-list.component';
|
|
@@ -4,8 +4,9 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
export declare class TextareaComponent<Type> extends ControlValueAccessorDirective<Type> {
|
|
5
5
|
className: string;
|
|
6
6
|
preventSpecailChar: boolean;
|
|
7
|
+
maxLength: number | string;
|
|
7
8
|
destroyRef: DestroyRef;
|
|
8
9
|
ngOnInit(): void;
|
|
9
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<TextareaComponent<any>, never>;
|
|
10
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TextareaComponent<any>, "app-textarea", never, { "className": { "alias": "className"; "required": false; }; "preventSpecailChar": { "alias": "preventSpecailChar"; "required": false; }; }, {}, never, never, true, never>;
|
|
11
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<TextareaComponent<any>, "app-textarea", never, { "className": { "alias": "className"; "required": false; }; "preventSpecailChar": { "alias": "preventSpecailChar"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; }, {}, never, never, true, never>;
|
|
11
12
|
}
|
|
@@ -2,10 +2,10 @@ import { SimpleChanges } from '@angular/core';
|
|
|
2
2
|
import { ErrorMsg, ValidationErrorMessages } from './validation-error-messages';
|
|
3
3
|
import * as i0 from "@angular/core";
|
|
4
4
|
export declare class ValidationErrorsComponent {
|
|
5
|
-
display: string;
|
|
6
5
|
errors: {};
|
|
7
6
|
customErrorMessages: Record<string, ErrorMsg>;
|
|
8
7
|
validationErrorMsgs: ValidationErrorMessages;
|
|
8
|
+
isErrorMsgVisible: boolean;
|
|
9
9
|
ngOnChanges(changes: SimpleChanges): void;
|
|
10
10
|
private getDefaultErrorMsgs;
|
|
11
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<ValidationErrorsComponent, never>;
|
package/lib/functions/index.d.ts
CHANGED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { AbstractControl, FormArray, FormGroup, ValidationErrors, ValidatorFn } from "@angular/forms";
|
|
2
|
+
/**
|
|
3
|
+
* Checks if the form group is valid for a specific action.
|
|
4
|
+
* You should use this function to check form validity if you use `validateIfAction` function.
|
|
5
|
+
* @param action The action to check against.
|
|
6
|
+
* @param formGroup The form group or form array to validate.
|
|
7
|
+
* @returns {boolean} True if all controls are valid for the action, false otherwise.
|
|
8
|
+
*/
|
|
9
|
+
export declare function isValidForAction(action: string, formGroup: FormGroup | FormArray): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Updates the value and validity of all controls.
|
|
12
|
+
* Use this function when your validators depend on the values of other controls.
|
|
13
|
+
* @param formGroup The FormGroup or FormArray to update.
|
|
14
|
+
* @returns {void}
|
|
15
|
+
*/
|
|
16
|
+
export declare function updateValueAndValidity(formGroup: FormGroup | FormArray): void;
|
|
17
|
+
/**
|
|
18
|
+
* Validates a control only when a certain condition is met.
|
|
19
|
+
* @param condition A function that returns a boolean indicating whether to apply the validator.
|
|
20
|
+
* @param validator A single ValidatorFn or an array of ValidatorFns to apply if the condition is true.
|
|
21
|
+
* @returns {ValidatorFn} A ValidatorFn that applies the given validator only when the condition is true.
|
|
22
|
+
*/
|
|
23
|
+
export declare function validateOnlyWhen(condition: () => boolean, validator: ValidatorFn | ValidatorFn[]): ValidatorFn;
|
|
24
|
+
/**
|
|
25
|
+
* Validates a control if the current action is one of the specified actions.
|
|
26
|
+
* @param actions An array of action names to check against.
|
|
27
|
+
* @param validator A single ValidatorFn or an array of ValidatorFns to apply if the current action matches one of the actions.
|
|
28
|
+
* @returns {ValidatorFn} A ValidatorFn that applies the given validator only if the current action is one of the specified actions.
|
|
29
|
+
* */
|
|
30
|
+
export declare function validateIfAction(actions: string[], validator: ValidatorFn | ValidatorFn[]): ValidatorFn;
|
|
31
|
+
/**
|
|
32
|
+
* Logs the status of all controls in a FormGroup.
|
|
33
|
+
* It traverses the form structure and logs whether each control is valid or invalid.
|
|
34
|
+
* @param formGroup The FormGroup to log the status of.
|
|
35
|
+
* @returns {void} This function does not return anything, it logs the status to the console.
|
|
36
|
+
*/
|
|
37
|
+
export declare function logFormStatus(formGroup: FormGroup): void;
|
|
38
|
+
/**
|
|
39
|
+
* A collection of custom validators for various data types.
|
|
40
|
+
*/
|
|
41
|
+
export declare class DataValidators {
|
|
42
|
+
/**
|
|
43
|
+
* Validates that the control's value is a valid employee object.
|
|
44
|
+
*/
|
|
45
|
+
static employeeRequired(control: AbstractControl): ValidationErrors | null;
|
|
46
|
+
/**
|
|
47
|
+
* Validates that the control's value is a valid attachment object.
|
|
48
|
+
*/
|
|
49
|
+
static fileUploaderRequired(control: AbstractControl): ValidationErrors | null;
|
|
50
|
+
/**
|
|
51
|
+
* Validates that the control's value is a valid attachments list.
|
|
52
|
+
*/
|
|
53
|
+
static multiFileUploaderRequired(control: AbstractControl): ValidationErrors | null;
|
|
54
|
+
/**
|
|
55
|
+
* Validates that the control's value is a valid select object.
|
|
56
|
+
* The select object should have a 'key' property.
|
|
57
|
+
*/
|
|
58
|
+
static selectRequired(control: AbstractControl): ValidationErrors | null;
|
|
59
|
+
}
|
|
@@ -57,9 +57,11 @@ export declare class RequestDetailsSectionComponent implements OnInit {
|
|
|
57
57
|
initializeColumns(): void;
|
|
58
58
|
initializeColumnConfig(): void;
|
|
59
59
|
createForm(): void;
|
|
60
|
+
textArea: string;
|
|
60
61
|
editAsset(asset: any): void;
|
|
61
62
|
startsWithDMOEOrCR(): ValidatorFn;
|
|
62
63
|
deleteAsset(asset: any): void;
|
|
64
|
+
log(d: any): void;
|
|
63
65
|
formValue(form: any): void;
|
|
64
66
|
checkValidity(action: string): boolean;
|
|
65
67
|
customCallSubmit(action: string): void;
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ export * from './lib/pipes';
|
|
|
7
7
|
export * from './lib/i18n';
|
|
8
8
|
export * from './lib/constants';
|
|
9
9
|
export * from './lib/interfaces';
|
|
10
|
-
export * from './lib/classes';
|
|
11
10
|
export * from './lib/hooks';
|
|
12
11
|
export * from './lib/functions';
|
|
13
12
|
export * from './lib/validators';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ValidationErrors } from "@angular/forms";
|
|
2
|
-
import { Section } from "../interfaces";
|
|
3
|
-
export type FormAction = 'SUBMIT' | 'APPROVE' | 'REJECT' | 'SENDBACK' | 'SAVE_CHANGES' | 'CANCEL' | 'SENDTODO' | string & {};
|
|
4
|
-
export type CustomValidatorFn = (fieldName: string, section: Section, action: FormAction) => ValidationErrors | null;
|
|
5
|
-
export declare class FormValidation {
|
|
6
|
-
private validators;
|
|
7
|
-
constructor(validators: Record<string, CustomValidatorFn[]>);
|
|
8
|
-
isFormValidForAction(section: Section, action: FormAction): boolean;
|
|
9
|
-
logFormControlsValidationStatus(section: Section, action?: FormAction): void;
|
|
10
|
-
}
|
|
11
|
-
export declare class BuiltInCustomValidators {
|
|
12
|
-
static required(fieldName: string, section: Section, action: FormAction): ValidationErrors | null;
|
|
13
|
-
static requiredIfAction(action: FormAction[]): CustomValidatorFn;
|
|
14
|
-
static requiredOnlyWhen(conditionFn: () => boolean): CustomValidatorFn;
|
|
15
|
-
static maxLength(max: number): CustomValidatorFn;
|
|
16
|
-
static minLength(min: number): CustomValidatorFn;
|
|
17
|
-
static ifAction(actions: FormAction[], validators: CustomValidatorFn[]): CustomValidatorFn[];
|
|
18
|
-
static validateOnlyWhen(conditionFn: () => boolean, validators: CustomValidatorFn[]): CustomValidatorFn[];
|
|
19
|
-
}
|
package/lib/classes/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './form-validation';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
export declare class SpecialCharacterDirective {
|
|
3
|
-
regexStr: string;
|
|
4
|
-
constructor();
|
|
5
|
-
onInputChange(event: any): void;
|
|
6
|
-
blockPaste(event: ClipboardEvent): void;
|
|
7
|
-
onDrop(event: any): void;
|
|
8
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SpecialCharacterDirective, never>;
|
|
9
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<SpecialCharacterDirective, "[specialIsAlphaNumeric]", never, {}, {}, never, never, true, never>;
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isValidData(data: any): boolean;
|