special-forms 0.0.1

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.
Files changed (96) hide show
  1. package/README.md +24 -0
  2. package/esm2020/lib/components/index.mjs +22 -0
  3. package/esm2020/lib/components/special-autocomplete/special-autocomplete.component.mjs +61 -0
  4. package/esm2020/lib/components/special-autocomplete/special-autocomplete.interface.mjs +2 -0
  5. package/esm2020/lib/components/special-autocomplete/special-autocomplete.module.mjs +47 -0
  6. package/esm2020/lib/components/special-checkbox/special-checkbox.component.mjs +20 -0
  7. package/esm2020/lib/components/special-checkbox/special-checkbox.interface.mjs +2 -0
  8. package/esm2020/lib/components/special-checkbox/special-checkbox.module.mjs +47 -0
  9. package/esm2020/lib/components/special-datepicker/special-datepicker.component.mjs +24 -0
  10. package/esm2020/lib/components/special-datepicker/special-datepicker.interface.mjs +2 -0
  11. package/esm2020/lib/components/special-datepicker/special-datepicker.module.mjs +48 -0
  12. package/esm2020/lib/components/special-dropdown/special-dropdown.component.mjs +35 -0
  13. package/esm2020/lib/components/special-dropdown/special-dropdown.interface.mjs +2 -0
  14. package/esm2020/lib/components/special-dropdown/special-dropdown.module.mjs +43 -0
  15. package/esm2020/lib/components/special-form/special-form.component.mjs +97 -0
  16. package/esm2020/lib/components/special-form/special-form.module.mjs +68 -0
  17. package/esm2020/lib/components/special-input/special-input.component.mjs +42 -0
  18. package/esm2020/lib/components/special-input/special-input.interface.mjs +2 -0
  19. package/esm2020/lib/components/special-input/special-input.module.mjs +44 -0
  20. package/esm2020/lib/components/special-label/special-label.component.mjs +25 -0
  21. package/esm2020/lib/components/special-label/special-label.interface.mjs +2 -0
  22. package/esm2020/lib/components/special-label/special-label.module.mjs +47 -0
  23. package/esm2020/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.component.mjs +82 -0
  24. package/esm2020/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.interface.mjs +2 -0
  25. package/esm2020/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.module.mjs +51 -0
  26. package/esm2020/lib/components/special-text-area/special-text-area.component.mjs +30 -0
  27. package/esm2020/lib/components/special-text-area/special-text-area.interface.mjs +2 -0
  28. package/esm2020/lib/components/special-text-area/special-text-area.module.mjs +44 -0
  29. package/esm2020/lib/components/special-upload/special-upload.component.mjs +69 -0
  30. package/esm2020/lib/components/special-upload/special-upload.interface.mjs +2 -0
  31. package/esm2020/lib/components/special-upload/special-upload.module.mjs +43 -0
  32. package/esm2020/lib/core/aux-data/control-types.enum.mjs +18 -0
  33. package/esm2020/lib/core/forms/special-forms.mjs +238 -0
  34. package/esm2020/lib/core/interfaces/field-basics.interfaces.mjs +2 -0
  35. package/esm2020/lib/core/interfaces/form.interfaces.mjs +2 -0
  36. package/esm2020/lib/core/services/index.mjs +3 -0
  37. package/esm2020/lib/core/services/special-form-builder/special-form-builder.service.mjs +156 -0
  38. package/esm2020/lib/pipes/controls-list-pipe/controls-list.pipe.mjs +18 -0
  39. package/esm2020/lib/pipes/controls-list-pipe/controls-list.pipe.module.mjs +18 -0
  40. package/esm2020/lib/pipes/error-message-pipe/error.pipe.mjs +22 -0
  41. package/esm2020/lib/pipes/error-message-pipe/error.pipe.module.mjs +20 -0
  42. package/esm2020/lib/pipes/index.mjs +3 -0
  43. package/esm2020/lib/pipes/text-by-function/text-by-function.pipe.mjs +22 -0
  44. package/esm2020/lib/pipes/text-by-function/text-by-function.pipe.module.mjs +20 -0
  45. package/esm2020/public-api.mjs +6 -0
  46. package/esm2020/special-forms.mjs +5 -0
  47. package/fesm2015/special-forms.mjs +1292 -0
  48. package/fesm2015/special-forms.mjs.map +1 -0
  49. package/fesm2020/special-forms.mjs +1319 -0
  50. package/fesm2020/special-forms.mjs.map +1 -0
  51. package/index.d.ts +5 -0
  52. package/lib/components/index.d.ts +21 -0
  53. package/lib/components/special-autocomplete/special-autocomplete.component.d.ts +19 -0
  54. package/lib/components/special-autocomplete/special-autocomplete.interface.d.ts +18 -0
  55. package/lib/components/special-autocomplete/special-autocomplete.module.d.ts +15 -0
  56. package/lib/components/special-checkbox/special-checkbox.component.d.ts +11 -0
  57. package/lib/components/special-checkbox/special-checkbox.interface.d.ts +10 -0
  58. package/lib/components/special-checkbox/special-checkbox.module.d.ts +14 -0
  59. package/lib/components/special-datepicker/special-datepicker.component.d.ts +12 -0
  60. package/lib/components/special-datepicker/special-datepicker.interface.d.ts +11 -0
  61. package/lib/components/special-datepicker/special-datepicker.module.d.ts +15 -0
  62. package/lib/components/special-dropdown/special-dropdown.component.d.ts +11 -0
  63. package/lib/components/special-dropdown/special-dropdown.interface.d.ts +16 -0
  64. package/lib/components/special-dropdown/special-dropdown.module.d.ts +14 -0
  65. package/lib/components/special-form/special-form.component.d.ts +31 -0
  66. package/lib/components/special-form/special-form.module.d.ts +19 -0
  67. package/lib/components/special-input/special-input.component.d.ts +15 -0
  68. package/lib/components/special-input/special-input.interface.d.ts +15 -0
  69. package/lib/components/special-input/special-input.module.d.ts +14 -0
  70. package/lib/components/special-label/special-label.component.d.ts +13 -0
  71. package/lib/components/special-label/special-label.interface.d.ts +12 -0
  72. package/lib/components/special-label/special-label.module.d.ts +15 -0
  73. package/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.component.d.ts +22 -0
  74. package/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.interface.d.ts +18 -0
  75. package/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.module.d.ts +16 -0
  76. package/lib/components/special-text-area/special-text-area.component.d.ts +13 -0
  77. package/lib/components/special-text-area/special-text-area.interface.d.ts +7 -0
  78. package/lib/components/special-text-area/special-text-area.module.d.ts +14 -0
  79. package/lib/components/special-upload/special-upload.component.d.ts +21 -0
  80. package/lib/components/special-upload/special-upload.interface.d.ts +10 -0
  81. package/lib/components/special-upload/special-upload.module.d.ts +13 -0
  82. package/lib/core/aux-data/control-types.enum.d.ts +16 -0
  83. package/lib/core/forms/special-forms.d.ts +110 -0
  84. package/lib/core/interfaces/field-basics.interfaces.d.ts +22 -0
  85. package/lib/core/interfaces/form.interfaces.d.ts +51 -0
  86. package/lib/core/services/index.d.ts +2 -0
  87. package/lib/core/services/special-form-builder/special-form-builder.service.d.ts +25 -0
  88. package/lib/pipes/controls-list-pipe/controls-list.pipe.d.ts +11 -0
  89. package/lib/pipes/controls-list-pipe/controls-list.pipe.module.d.ts +8 -0
  90. package/lib/pipes/error-message-pipe/error.pipe.d.ts +12 -0
  91. package/lib/pipes/error-message-pipe/error.pipe.module.d.ts +8 -0
  92. package/lib/pipes/index.d.ts +2 -0
  93. package/lib/pipes/text-by-function/text-by-function.pipe.d.ts +7 -0
  94. package/lib/pipes/text-by-function/text-by-function.pipe.module.d.ts +8 -0
  95. package/package.json +31 -0
  96. package/public-api.d.ts +2 -0
@@ -0,0 +1,15 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { SpecialFormControl } from '../../core/forms/special-forms';
3
+ import { IInputSettings } from './special-input.interface';
4
+ import * as i0 from "@angular/core";
5
+ export declare class SpecialInputComponent implements OnInit {
6
+ control: SpecialFormControl<IInputSettings>;
7
+ constructor();
8
+ ngOnInit(): void;
9
+ onEnterClick(): void;
10
+ onBlurAction(): void;
11
+ get settings(): IInputSettings;
12
+ iconClick(event: any): void;
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<SpecialInputComponent, never>;
14
+ static ɵcmp: i0.ɵɵComponentDeclaration<SpecialInputComponent, "sp-input", never, { "control": "control"; }, {}, never, never, false>;
15
+ }
@@ -0,0 +1,15 @@
1
+ import { InputmaskOptions } from '@ngneat/input-mask';
2
+ import { EControlTypes } from '../../core/aux-data/control-types.enum';
3
+ import { IFieldData } from '../../core/interfaces/field-basics.interfaces';
4
+ export declare type IInputSettings = {
5
+ type?: string;
6
+ mask?: InputmaskOptions<any>;
7
+ icon?: string;
8
+ iconAction?: (data: any) => void;
9
+ onEnter?: (data: any) => void;
10
+ onBlur?: (data: any) => void;
11
+ };
12
+ export interface IInputField extends IFieldData {
13
+ settings: IInputSettings;
14
+ type: EControlTypes.input;
15
+ }
@@ -0,0 +1,14 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./special-input.component";
3
+ import * as i2 from "@ngneat/input-mask";
4
+ import * as i3 from "@angular/common";
5
+ import * as i4 from "@angular/material/input";
6
+ import * as i5 from "@angular/material/icon";
7
+ import * as i6 from "@angular/forms";
8
+ import * as i7 from "@angular/material/button";
9
+ import * as i8 from "../../pipes/error-message-pipe/error.pipe.module";
10
+ export declare class SpecialInputModule {
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<SpecialInputModule, never>;
12
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SpecialInputModule, [typeof i1.SpecialInputComponent], [typeof i2.InputMaskModule, typeof i3.CommonModule, typeof i4.MatInputModule, typeof i5.MatIconModule, typeof i6.ReactiveFormsModule, typeof i7.MatButtonModule, typeof i8.ErrorMessagePipeModule], [typeof i1.SpecialInputComponent]>;
13
+ static ɵinj: i0.ɵɵInjectorDeclaration<SpecialInputModule>;
14
+ }
@@ -0,0 +1,13 @@
1
+ import { OnInit } from '@angular/core';
2
+ import { SpecialFormControl } from '../../core/forms/special-forms';
3
+ import { ILabelSettings } from './special-label.interface';
4
+ import * as i0 from "@angular/core";
5
+ export declare class SpecialLabelComponent implements OnInit {
6
+ control: SpecialFormControl<ILabelSettings>;
7
+ constructor();
8
+ ngOnInit(): void;
9
+ get settings(): ILabelSettings;
10
+ onLink(): void;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<SpecialLabelComponent, never>;
12
+ static ɵcmp: i0.ɵɵComponentDeclaration<SpecialLabelComponent, "sp-label", never, { "control": "control"; }, {}, never, never, false>;
13
+ }
@@ -0,0 +1,12 @@
1
+ import { EControlTypes } from '../../core/aux-data/control-types.enum';
2
+ import { IFieldData } from '../../core/interfaces/field-basics.interfaces';
3
+ export declare type ILabelSettings = {
4
+ pipe?: (value: any) => string;
5
+ stylesPipe?: (value: any) => string;
6
+ isLink: boolean;
7
+ onClickLink?: (value: any) => void;
8
+ };
9
+ export interface ILabelField extends IFieldData {
10
+ settings: ILabelSettings;
11
+ type: EControlTypes.label;
12
+ }
@@ -0,0 +1,15 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./special-label.component";
3
+ import * as i2 from "@ngneat/input-mask";
4
+ import * as i3 from "@angular/common";
5
+ import * as i4 from "@angular/material/input";
6
+ import * as i5 from "@angular/material/icon";
7
+ import * as i6 from "@angular/forms";
8
+ import * as i7 from "@angular/material/button";
9
+ import * as i8 from "../../pipes/text-by-function/text-by-function.pipe.module";
10
+ import * as i9 from "../../pipes/error-message-pipe/error.pipe.module";
11
+ export declare class SpecialLabelModule {
12
+ static ɵfac: i0.ɵɵFactoryDeclaration<SpecialLabelModule, never>;
13
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SpecialLabelModule, [typeof i1.SpecialLabelComponent], [typeof i2.InputMaskModule, typeof i3.CommonModule, typeof i4.MatInputModule, typeof i5.MatIconModule, typeof i6.ReactiveFormsModule, typeof i7.MatButtonModule, typeof i8.TextByFunctionPipeModule, typeof i9.ErrorMessagePipeModule], [typeof i1.SpecialLabelComponent]>;
14
+ static ɵinj: i0.ɵɵInjectorDeclaration<SpecialLabelModule>;
15
+ }
@@ -0,0 +1,22 @@
1
+ import { MatAutocompleteSelectedEvent } from '@angular/material/autocomplete';
2
+ import { Subscription } from 'rxjs';
3
+ import { SpecialFormControl } from '../../core/forms/special-forms';
4
+ import { IMultipleAutocompleteSettings } from './special-multiple-autocomplete.interface';
5
+ import { FormControl } from '@angular/forms';
6
+ import * as i0 from "@angular/core";
7
+ export declare class SpecialMultipleAutocompleteComponent {
8
+ control: SpecialFormControl<IMultipleAutocompleteSettings>;
9
+ subs: Subscription;
10
+ internalControl: FormControl<any>;
11
+ constructor();
12
+ ngOnInit(): void;
13
+ get settings(): IMultipleAutocompleteSettings;
14
+ init(): void;
15
+ optionSelected(data: MatAutocompleteSelectedEvent): void;
16
+ iconClick(event: any): void;
17
+ remove(value: any[]): void;
18
+ configValue: (item: any) => any;
19
+ ngOnDestroy(): void;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<SpecialMultipleAutocompleteComponent, never>;
21
+ static ɵcmp: i0.ɵɵComponentDeclaration<SpecialMultipleAutocompleteComponent, "sp-multiple-autocomplete", never, { "control": "control"; }, {}, never, never, false>;
22
+ }
@@ -0,0 +1,18 @@
1
+ import { AbstractControl } from '@angular/forms';
2
+ import { Observable } from 'rxjs';
3
+ import { EControlTypes } from '../../core/aux-data/control-types.enum';
4
+ import { IFieldData } from '../../core/interfaces/field-basics.interfaces';
5
+ export declare type IMultipleAutocompleteSettings = {
6
+ getData: (query: string, control?: AbstractControl) => void;
7
+ source: Observable<any[]>;
8
+ fieldId: string;
9
+ icon?: string;
10
+ iconAction?: (data: any) => void;
11
+ onSelect?: (data: any) => void;
12
+ fieldName: string | ((a?: any) => string);
13
+ fieldImage?: string | ((a?: any) => string);
14
+ };
15
+ export interface IMultipleAutocompleteField extends IFieldData {
16
+ settings: IMultipleAutocompleteSettings;
17
+ type: EControlTypes.multiple;
18
+ }
@@ -0,0 +1,16 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./special-multiple-autocomplete.component";
3
+ import * as i2 from "@angular/material/input";
4
+ import * as i3 from "@angular/common";
5
+ import * as i4 from "@angular/material/autocomplete";
6
+ import * as i5 from "@angular/material/icon";
7
+ import * as i6 from "@angular/forms";
8
+ import * as i7 from "@angular/material/button";
9
+ import * as i8 from "../../pipes/error-message-pipe/error.pipe.module";
10
+ import * as i9 from "../../pipes/text-by-function/text-by-function.pipe.module";
11
+ import * as i10 from "@angular/material/chips";
12
+ export declare class SpecialMultipleAutocompleteModule {
13
+ static ɵfac: i0.ɵɵFactoryDeclaration<SpecialMultipleAutocompleteModule, never>;
14
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SpecialMultipleAutocompleteModule, [typeof i1.SpecialMultipleAutocompleteComponent], [typeof i2.MatInputModule, typeof i3.CommonModule, typeof i4.MatAutocompleteModule, typeof i5.MatIconModule, typeof i6.ReactiveFormsModule, typeof i7.MatButtonModule, typeof i8.ErrorMessagePipeModule, typeof i9.TextByFunctionPipeModule, typeof i10.MatChipsModule], [typeof i1.SpecialMultipleAutocompleteComponent]>;
15
+ static ɵinj: i0.ɵɵInjectorDeclaration<SpecialMultipleAutocompleteModule>;
16
+ }
@@ -0,0 +1,13 @@
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
+ import { SpecialFormControl } from '../../core/forms/special-forms';
3
+ import { ITextAreaField } from './special-text-area.interface';
4
+ import * as i0 from "@angular/core";
5
+ export declare class SpecialTextAreaComponent implements OnInit {
6
+ control: SpecialFormControl<ITextAreaField>;
7
+ onBlur: EventEmitter<any>;
8
+ onEnter: EventEmitter<any>;
9
+ constructor();
10
+ ngOnInit(): void;
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<SpecialTextAreaComponent, never>;
12
+ static ɵcmp: i0.ɵɵComponentDeclaration<SpecialTextAreaComponent, "sp-text-area", never, { "control": "control"; }, { "onBlur": "onBlur"; "onEnter": "onEnter"; }, never, never, false>;
13
+ }
@@ -0,0 +1,7 @@
1
+ import { EControlTypes } from '../../core/aux-data/control-types.enum';
2
+ import { IFieldData } from '../../core/interfaces/field-basics.interfaces';
3
+ export declare type ITextAreaSettings = {};
4
+ export interface ITextAreaField extends IFieldData {
5
+ settings: ITextAreaSettings;
6
+ type: EControlTypes.textArea;
7
+ }
@@ -0,0 +1,14 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./special-text-area.component";
3
+ import * as i2 from "@ngneat/input-mask";
4
+ import * as i3 from "@angular/common";
5
+ import * as i4 from "@angular/material/input";
6
+ import * as i5 from "@angular/material/icon";
7
+ import * as i6 from "@angular/forms";
8
+ import * as i7 from "@angular/material/button";
9
+ import * as i8 from "../../pipes/error-message-pipe/error.pipe.module";
10
+ export declare class SpecialTextAreaModule {
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<SpecialTextAreaModule, never>;
12
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SpecialTextAreaModule, [typeof i1.SpecialTextAreaComponent], [typeof i2.InputMaskModule, typeof i3.CommonModule, typeof i4.MatInputModule, typeof i5.MatIconModule, typeof i6.ReactiveFormsModule, typeof i7.MatButtonModule, typeof i8.ErrorMessagePipeModule], [typeof i1.SpecialTextAreaComponent]>;
13
+ static ɵinj: i0.ɵɵInjectorDeclaration<SpecialTextAreaModule>;
14
+ }
@@ -0,0 +1,21 @@
1
+ import { EventEmitter, OnInit } from '@angular/core';
2
+ import { SpecialFormControl } from '../../core/forms/special-forms';
3
+ import { IUploadSettings } from './special-upload.interface';
4
+ import { DomSanitizer } from '@angular/platform-browser';
5
+ import * as i0 from "@angular/core";
6
+ export declare class SpecialUploadComponent implements OnInit {
7
+ private sanitizer;
8
+ control: SpecialFormControl<IUploadSettings>;
9
+ set controlSetter(control: any);
10
+ onSelect: EventEmitter<any>;
11
+ previewImages: any[];
12
+ constructor(sanitizer: DomSanitizer);
13
+ ngOnInit(): void;
14
+ onSelectMultiple(event: any): void;
15
+ onSelectOne(event: any): void;
16
+ fixFileName(file: File): File;
17
+ clean(): void;
18
+ onRemove(file: any): void;
19
+ static ɵfac: i0.ɵɵFactoryDeclaration<SpecialUploadComponent, never>;
20
+ static ɵcmp: i0.ɵɵComponentDeclaration<SpecialUploadComponent, "sp-upload", never, { "controlSetter": "control"; }, { "onSelect": "onSelect"; }, never, never, false>;
21
+ }
@@ -0,0 +1,10 @@
1
+ import { EControlTypes } from '../../core/aux-data/control-types.enum';
2
+ import { IFieldData } from '../../core/interfaces/field-basics.interfaces';
3
+ export declare type IUploadSettings = {
4
+ accept?: string;
5
+ multiple?: boolean;
6
+ };
7
+ export interface IUploadField extends IFieldData {
8
+ settings: IUploadSettings;
9
+ type: EControlTypes.upload;
10
+ }
@@ -0,0 +1,13 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./special-upload.component";
3
+ import * as i2 from "@angular/forms";
4
+ import * as i3 from "ngx-dropzone";
5
+ import * as i4 from "@angular/common";
6
+ import * as i5 from "@angular/material/icon";
7
+ import * as i6 from "@angular/material/button";
8
+ import * as i7 from "../../pipes/error-message-pipe/error.pipe.module";
9
+ export declare class SpecialUploadModule {
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<SpecialUploadModule, never>;
11
+ static ɵmod: i0.ɵɵNgModuleDeclaration<SpecialUploadModule, [typeof i1.SpecialUploadComponent], [typeof i2.FormsModule, typeof i3.NgxDropzoneModule, typeof i4.CommonModule, typeof i5.MatIconModule, typeof i2.ReactiveFormsModule, typeof i6.MatButtonModule, typeof i7.ErrorMessagePipeModule], [typeof i1.SpecialUploadComponent]>;
12
+ static ɵinj: i0.ɵɵInjectorDeclaration<SpecialUploadModule>;
13
+ }
@@ -0,0 +1,16 @@
1
+ export declare enum EControlTypes {
2
+ pkey = "PRIMARY-KEY",
3
+ input = "INPUT",
4
+ textArea = "TEXT-AREA",
5
+ dropdown = "DROPDOWN",
6
+ date = "DATE",
7
+ time = "TIME",
8
+ checkbox = "CHECKBOX",
9
+ upload = "UPLOAD",
10
+ autocomplete = "AUTOCOMPLETE",
11
+ multiple = "MULTIPLE-AUTOCOMPLETE",
12
+ array = "ARRAY",
13
+ form = "FORM",
14
+ label = "LABEL",
15
+ default = "DEFAULT"
16
+ }
@@ -0,0 +1,110 @@
1
+ import { AbstractControl, FormArray, FormControl, FormGroup } from '@angular/forms';
2
+ import { EControlTypes } from '../aux-data/control-types.enum';
3
+ import { IFieldBasicData } from '../interfaces/field-basics.interfaces';
4
+ import { IArraySettings, IFormSettings, TSpecialFields, TSpecialForm, TSpecialArray } from '../interfaces/form.interfaces';
5
+ export declare class SpecialFormControl<T> extends FormControl implements IFieldBasicData {
6
+ name: string;
7
+ placeholder: string;
8
+ label: string;
9
+ tooltip: string;
10
+ icon: string;
11
+ elementId: string;
12
+ styleClasses: string;
13
+ length: number;
14
+ required: boolean;
15
+ hidden: boolean;
16
+ readOnly: boolean;
17
+ settings: T;
18
+ type: EControlTypes;
19
+ errorMessages: {
20
+ [key: string]: string;
21
+ };
22
+ constructor({ name, settings, type, validators, asyncValidators, elementId, styleClasses, defaultValue, hidden, icon, label, length, placeholder, readOnly, required, tooltip, errorMessages, disabled, }: TSpecialFields);
23
+ setReadOnly(status?: boolean): void;
24
+ setDisabled(status?: boolean): void;
25
+ setHidden(status?: boolean): void;
26
+ }
27
+ export declare class SpecialFormGroup extends FormGroup implements IFieldBasicData {
28
+ name: string;
29
+ placeholder: string;
30
+ label: string;
31
+ tooltip: string;
32
+ icon: string;
33
+ elementId: string;
34
+ styleClasses: string;
35
+ length: number;
36
+ required: boolean;
37
+ hidden: boolean;
38
+ readOnly: boolean;
39
+ settings: IFormSettings;
40
+ type: EControlTypes.form;
41
+ defaultValue: any;
42
+ errorMessages: {
43
+ [key: string]: string;
44
+ };
45
+ constructor({ name, settings, type, validators, asyncValidators, elementId, styleClasses, defaultValue, hidden, icon, label, length, placeholder, readOnly, required, tooltip, disabled, }: TSpecialForm, controls: {
46
+ [key: string]: SpecialFormControl<any>;
47
+ });
48
+ unpristineRequired(): void;
49
+ specialReset(value?: {}): void;
50
+ setReadOnly(status?: boolean): void;
51
+ setReadOnlyByFields(fieldsObject: {
52
+ [key: string]: boolean;
53
+ }): void;
54
+ setHiddenByFields(fields: {
55
+ [key: string]: boolean;
56
+ }): void;
57
+ setDisabled(status: boolean): void;
58
+ setDisabledByFields(fieldsObject: any): void;
59
+ /**
60
+ * donde value es el objeto semilla y detailForm es un arreglo de form key para dar un marco al formarray
61
+ */
62
+ setFormValue(value: any): void;
63
+ /**
64
+ * Método que retorna
65
+ */
66
+ getIdPkey(): SpecialFormControl<any> | undefined;
67
+ }
68
+ export declare class SpecialFormArray extends FormArray implements IFieldBasicData {
69
+ name: string;
70
+ placeholder: string;
71
+ label: string;
72
+ tooltip: string;
73
+ icon: string;
74
+ elementId: string;
75
+ styleClasses: string;
76
+ required: boolean;
77
+ hidden: boolean;
78
+ readOnly: boolean;
79
+ settings: IArraySettings;
80
+ type: EControlTypes;
81
+ defaultValue: any;
82
+ form: SpecialFormGroup;
83
+ private formCreation;
84
+ errorMessages: {
85
+ [key: string]: string;
86
+ };
87
+ constructor({ name, settings, type, validators, asyncValidators, elementId, styleClasses, defaultValue, hidden, icon, label, placeholder, readOnly, required, tooltip, errorMessages, disabled, }: TSpecialArray, formCreation: () => SpecialFormGroup, controls: AbstractControl[]);
88
+ fillFormArray(data: any[]): void;
89
+ addItem(): void;
90
+ specialPush(index?: number): void;
91
+ specialInsert(index?: number): void;
92
+ specialEdit(index: number, newValue: Object): void;
93
+ /**
94
+ * Vuelve todos los controles del formArray de lectura o de sololectura
95
+ * @param status
96
+ */
97
+ setReadOnly(status: boolean): void;
98
+ /**
99
+ * Vuelve todos los controles del formArray habilitados o deshabilitados
100
+ * @param status
101
+ */
102
+ setDisabled(status: boolean): void;
103
+ /**
104
+ * Permite editar un control especifico.
105
+ * @param index
106
+ */
107
+ editControl(index: number): void;
108
+ unpristineRequired(): void;
109
+ recursiveFillForm(form: FormGroup, data: any): FormGroup;
110
+ }
@@ -0,0 +1,22 @@
1
+ import { AsyncValidatorFn, ValidatorFn } from '@angular/forms';
2
+ export interface IFieldBasicData {
3
+ placeholder: string;
4
+ label: string;
5
+ tooltip: string;
6
+ icon: string;
7
+ elementId: string;
8
+ styleClasses: string;
9
+ length: number;
10
+ required: boolean;
11
+ hidden: boolean;
12
+ readOnly: boolean;
13
+ disabled: boolean;
14
+ errorMessages: {
15
+ [key: string]: string;
16
+ };
17
+ }
18
+ export interface IFieldData extends IFieldBasicData {
19
+ validators: ValidatorFn | ValidatorFn[] | null;
20
+ asyncValidators: AsyncValidatorFn | AsyncValidatorFn[] | null;
21
+ defaultValue: any;
22
+ }
@@ -0,0 +1,51 @@
1
+ import { IAutocompleteField } from '../../components/special-autocomplete/special-autocomplete.interface';
2
+ import { IDatePickerField } from '../../components/special-datepicker/special-datepicker.interface';
3
+ import { IDropdownField } from '../../components/special-dropdown/special-dropdown.interface';
4
+ import { IInputField } from '../../components/special-input/special-input.interface';
5
+ import { ICheckboxField } from '../../components/special-checkbox/special-checkbox.interface';
6
+ import { IMultipleAutocompleteField } from '../../components/special-multiple-autocomplete/special-multiple-autocomplete.interface';
7
+ import { EControlTypes } from '../aux-data/control-types.enum';
8
+ import { IFieldData } from './field-basics.interfaces';
9
+ import { ITextAreaField } from '../../components/special-text-area/special-text-area.interface';
10
+ import { IUploadField } from '../../components/special-upload/special-upload.interface';
11
+ import { ILabelField } from '../../components/special-label/special-label.interface';
12
+ interface IcontrolName {
13
+ name: string;
14
+ }
15
+ export declare type IFormSettings = {
16
+ formFields: IFormStructure;
17
+ };
18
+ export interface IFormField extends IFieldData {
19
+ settings: IFormSettings;
20
+ type: EControlTypes.form;
21
+ }
22
+ export declare type IArraySettings = {
23
+ formFields: IFormStructure;
24
+ withFormHeader?: boolean;
25
+ withActionButtons?: boolean;
26
+ };
27
+ export interface IArrayField extends IFieldData {
28
+ settings: IArraySettings;
29
+ type: EControlTypes.array;
30
+ }
31
+ export interface IDefaultField extends IFieldData {
32
+ settings: any;
33
+ type: EControlTypes.default;
34
+ }
35
+ export declare type TRawFields = IDefaultField | IInputField | IDropdownField | IArrayField | IFormField | IAutocompleteField | IMultipleAutocompleteField | IDatePickerField | ITextAreaField | IUploadField | ILabelField | ICheckboxField;
36
+ export declare type TSpecialInput = IInputField & IcontrolName;
37
+ export declare type TSpecialDefault = IDefaultField & IcontrolName;
38
+ export declare type TSpecialDropdown = IDropdownField & IcontrolName;
39
+ export declare type TSpecialArray = IArrayField & IcontrolName;
40
+ export declare type TSpecialForm = IFormField & IcontrolName;
41
+ export declare type TSpecialAutocomplete = IAutocompleteField & IcontrolName;
42
+ export declare type TSpecialDatepicker = IDatePickerField & IcontrolName;
43
+ export declare type ISpecialCheckbox = ICheckboxField & IcontrolName;
44
+ export declare type ISpecialTextArea = ITextAreaField & IcontrolName;
45
+ export declare type ISpecialLabel = ILabelField & IcontrolName;
46
+ export declare type ISpecialUpload = IUploadField & IcontrolName;
47
+ export declare type TSpecialFields = TSpecialDefault | TSpecialInput | TSpecialDropdown | TSpecialArray | TSpecialForm | TSpecialAutocomplete | ISpecialCheckbox | ISpecialTextArea | ISpecialUpload | ISpecialLabel | TSpecialDatepicker;
48
+ export interface IFormStructure {
49
+ [name: string]: Partial<TRawFields>;
50
+ }
51
+ export {};
@@ -0,0 +1,2 @@
1
+ import { SpecialFormBuilderService } from './special-form-builder/special-form-builder.service';
2
+ export { SpecialFormBuilderService };
@@ -0,0 +1,25 @@
1
+ import { SpecialFormControl, SpecialFormGroup } from '../../forms/special-forms';
2
+ import { IFormStructure, TSpecialFields, TSpecialForm } from '../../interfaces/form.interfaces';
3
+ import * as i0 from "@angular/core";
4
+ export declare class SpecialFormBuilderService {
5
+ private readonly defectField;
6
+ private readonly inputDefectField;
7
+ private readonly formDefectField;
8
+ private readonly arrayDefectField;
9
+ constructor();
10
+ control(field: Partial<TSpecialFields>): SpecialFormControl<any>;
11
+ group(fields: IFormStructure, parentField?: Partial<TSpecialForm>): SpecialFormGroup;
12
+ array(): void;
13
+ fieldDataToArray(fields: IFormStructure): TSpecialFields[];
14
+ private setDefectFieldOptions;
15
+ private formGenerator;
16
+ private getControlAndNameByType;
17
+ private setFormGroup;
18
+ private setFormArray;
19
+ private setFormControl;
20
+ private setRequiredValidator;
21
+ private setValidatorsArray;
22
+ private arrayLengthRequired;
23
+ static ɵfac: i0.ɵɵFactoryDeclaration<SpecialFormBuilderService, never>;
24
+ static ɵprov: i0.ɵɵInjectableDeclaration<SpecialFormBuilderService>;
25
+ }
@@ -0,0 +1,11 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { AbstractControl } from '@angular/forms';
3
+ import { SpecialFormControl } from '../../core/forms/special-forms';
4
+ import * as i0 from "@angular/core";
5
+ export declare class FormControlsListPipe implements PipeTransform {
6
+ transform(controls: {
7
+ [key: string]: AbstractControl;
8
+ }): SpecialFormControl<any>[];
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormControlsListPipe, never>;
10
+ static ɵpipe: i0.ɵɵPipeDeclaration<FormControlsListPipe, "controlsList", false>;
11
+ }
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./controls-list.pipe";
3
+ import * as i2 from "@angular/common";
4
+ export declare class FormControlsListPipeModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<FormControlsListPipeModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<FormControlsListPipeModule, [typeof i1.FormControlsListPipe], [typeof i2.CommonModule], [typeof i1.FormControlsListPipe]>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<FormControlsListPipeModule>;
8
+ }
@@ -0,0 +1,12 @@
1
+ import { PipeTransform } from "@angular/core";
2
+ import { FormControl } from "@angular/forms";
3
+ import * as i0 from "@angular/core";
4
+ export declare class ErrorMessagePipe implements PipeTransform {
5
+ transform(errorsObj: {
6
+ [key: string]: any;
7
+ }, errorMessages: {
8
+ [key: string]: any;
9
+ }, control?: FormControl): any;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<ErrorMessagePipe, never>;
11
+ static ɵpipe: i0.ɵɵPipeDeclaration<ErrorMessagePipe, "errorMessage", false>;
12
+ }
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./error.pipe";
3
+ import * as i2 from "@angular/common";
4
+ export declare class ErrorMessagePipeModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<ErrorMessagePipeModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<ErrorMessagePipeModule, [typeof i1.ErrorMessagePipe], [typeof i2.CommonModule], [typeof i1.ErrorMessagePipe]>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<ErrorMessagePipeModule>;
8
+ }
@@ -0,0 +1,2 @@
1
+ export { ErrorMessagePipeModule } from './error-message-pipe/error.pipe.module';
2
+ export { TextByFunctionPipeModule } from './text-by-function/text-by-function.pipe.module';
@@ -0,0 +1,7 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class TextByFunctionPipe implements PipeTransform {
4
+ transform(value: any, field: string | ((value: any) => string)): any;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<TextByFunctionPipe, never>;
6
+ static ɵpipe: i0.ɵɵPipeDeclaration<TextByFunctionPipe, "textByFunction", false>;
7
+ }
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "./text-by-function.pipe";
3
+ import * as i2 from "@angular/common";
4
+ export declare class TextByFunctionPipeModule {
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<TextByFunctionPipeModule, never>;
6
+ static ɵmod: i0.ɵɵNgModuleDeclaration<TextByFunctionPipeModule, [typeof i1.TextByFunctionPipe], [typeof i2.CommonModule], [typeof i1.TextByFunctionPipe]>;
7
+ static ɵinj: i0.ɵɵInjectorDeclaration<TextByFunctionPipeModule>;
8
+ }
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "special-forms",
3
+ "version": "0.0.1",
4
+ "peerDependencies": {
5
+ "@angular/common": "^14.1.0",
6
+ "@angular/core": "^14.1.0"
7
+ },
8
+ "dependencies": {
9
+ "tslib": "^2.3.0"
10
+ },
11
+ "module": "fesm2015/special-forms.mjs",
12
+ "es2020": "fesm2020/special-forms.mjs",
13
+ "esm2020": "esm2020/special-forms.mjs",
14
+ "fesm2020": "fesm2020/special-forms.mjs",
15
+ "fesm2015": "fesm2015/special-forms.mjs",
16
+ "typings": "index.d.ts",
17
+ "exports": {
18
+ "./package.json": {
19
+ "default": "./package.json"
20
+ },
21
+ ".": {
22
+ "types": "./index.d.ts",
23
+ "esm2020": "./esm2020/special-forms.mjs",
24
+ "es2020": "./fesm2020/special-forms.mjs",
25
+ "es2015": "./fesm2015/special-forms.mjs",
26
+ "node": "./fesm2015/special-forms.mjs",
27
+ "default": "./fesm2020/special-forms.mjs"
28
+ }
29
+ },
30
+ "sideEffects": false
31
+ }
@@ -0,0 +1,2 @@
1
+ export * from './lib/components';
2
+ export * from './lib/core/services/index';