special-forms 18.0.1 → 20.0.0-SNAPSHOT
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 +147 -147
- package/fesm2022/special-forms.mjs +143 -147
- package/fesm2022/special-forms.mjs.map +1 -1
- package/index.d.ts +586 -5
- package/lib/styles/final.scss +2 -2
- package/lib/styles/styles-config.scss +36 -36
- package/lib/styles/tailwind-final.scss +7 -7
- package/package.json +7 -9
- package/esm2022/lib/components/index.mjs +0 -14
- package/esm2022/lib/components/special-autocomplete/special-autocomplete.component.mjs +0 -75
- package/esm2022/lib/components/special-autocomplete/special-autocomplete.interface.mjs +0 -2
- package/esm2022/lib/components/special-checkbox/special-checkbox.component.mjs +0 -38
- package/esm2022/lib/components/special-checkbox/special-checkbox.interface.mjs +0 -3
- package/esm2022/lib/components/special-datepicker/special-datepicker.component.mjs +0 -42
- package/esm2022/lib/components/special-datepicker/special-datepicker.interface.mjs +0 -3
- package/esm2022/lib/components/special-dropdown/special-dropdown.component.mjs +0 -47
- package/esm2022/lib/components/special-dropdown/special-dropdown.interface.mjs +0 -3
- package/esm2022/lib/components/special-form/special-form.component.mjs +0 -99
- package/esm2022/lib/components/special-form/special-form.module.mjs +0 -79
- package/esm2022/lib/components/special-input/special-input.component.mjs +0 -55
- package/esm2022/lib/components/special-input/special-input.interface.mjs +0 -2
- package/esm2022/lib/components/special-label/special-label.component.mjs +0 -27
- package/esm2022/lib/components/special-label/special-label.interface.mjs +0 -2
- package/esm2022/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.component.mjs +0 -97
- package/esm2022/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.interface.mjs +0 -2
- package/esm2022/lib/components/special-richtext/special-richtext.component.mjs +0 -53
- package/esm2022/lib/components/special-richtext/special-richtext.interface.mjs +0 -3
- package/esm2022/lib/components/special-text-area/special-text-area.component.mjs +0 -43
- package/esm2022/lib/components/special-text-area/special-text-area.interface.mjs +0 -2
- package/esm2022/lib/components/special-upload/filename.pipe.mjs +0 -18
- package/esm2022/lib/components/special-upload/preview-image-pipe.mjs +0 -104
- package/esm2022/lib/components/special-upload/special-upload.component.mjs +0 -146
- package/esm2022/lib/components/special-upload/special-upload.interface.mjs +0 -2
- package/esm2022/lib/components/special-upload/truncate.pipe.mjs +0 -14
- package/esm2022/lib/core/aux-data/control-types.enum.mjs +0 -18
- package/esm2022/lib/core/aux-data/input-types.mjs +0 -16
- package/esm2022/lib/core/forms/special-forms.mjs +0 -240
- package/esm2022/lib/core/interfaces/field-basics.interfaces.mjs +0 -2
- package/esm2022/lib/core/interfaces/form.interfaces.mjs +0 -2
- package/esm2022/lib/core/interfaces/special-control.interface.mjs +0 -3
- package/esm2022/lib/core/masks/currency.mask.mjs +0 -11
- package/esm2022/lib/core/masks/index.mjs +0 -3
- package/esm2022/lib/core/masks/number.mask.mjs +0 -3
- package/esm2022/lib/core/pipes/controls-list-pipe/controls-list.pipe.mjs +0 -18
- package/esm2022/lib/core/pipes/error-message-pipe/error.pipe.mjs +0 -23
- package/esm2022/lib/core/pipes/index.mjs +0 -4
- package/esm2022/lib/core/pipes/text-by-function/text-by-function.pipe.mjs +0 -22
- package/esm2022/lib/core/services/error-state-matcher/error-matcher.mjs +0 -13
- package/esm2022/lib/core/services/index.mjs +0 -4
- package/esm2022/lib/core/services/special-form-builder/special-form-builder.service.mjs +0 -156
- package/esm2022/public-api.mjs +0 -13
- package/esm2022/special-forms.mjs +0 -5
- package/lib/components/index.d.ts +0 -23
- package/lib/components/special-autocomplete/special-autocomplete.component.d.ts +0 -19
- package/lib/components/special-autocomplete/special-autocomplete.interface.d.ts +0 -19
- package/lib/components/special-checkbox/special-checkbox.component.d.ts +0 -12
- package/lib/components/special-checkbox/special-checkbox.interface.d.ts +0 -13
- package/lib/components/special-datepicker/special-datepicker.component.d.ts +0 -13
- package/lib/components/special-datepicker/special-datepicker.interface.d.ts +0 -12
- package/lib/components/special-dropdown/special-dropdown.component.d.ts +0 -11
- package/lib/components/special-dropdown/special-dropdown.interface.d.ts +0 -17
- package/lib/components/special-form/special-form.component.d.ts +0 -31
- package/lib/components/special-form/special-form.module.d.ts +0 -20
- package/lib/components/special-input/special-input.component.d.ts +0 -15
- package/lib/components/special-input/special-input.interface.d.ts +0 -17
- package/lib/components/special-label/special-label.component.d.ts +0 -13
- package/lib/components/special-label/special-label.interface.d.ts +0 -13
- package/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.component.d.ts +0 -22
- package/lib/components/special-multiple-autocomplete/special-multiple-autocomplete.interface.d.ts +0 -19
- package/lib/components/special-richtext/special-richtext.component.d.ts +0 -15
- package/lib/components/special-richtext/special-richtext.interface.d.ts +0 -11
- package/lib/components/special-text-area/special-text-area.component.d.ts +0 -13
- package/lib/components/special-text-area/special-text-area.interface.d.ts +0 -8
- package/lib/components/special-upload/filename.pipe.d.ts +0 -7
- package/lib/components/special-upload/preview-image-pipe.d.ts +0 -23
- package/lib/components/special-upload/special-upload.component.d.ts +0 -31
- package/lib/components/special-upload/special-upload.interface.d.ts +0 -15
- package/lib/components/special-upload/truncate.pipe.d.ts +0 -7
- package/lib/core/aux-data/control-types.enum.d.ts +0 -16
- package/lib/core/aux-data/input-types.d.ts +0 -2
- package/lib/core/forms/special-forms.d.ts +0 -108
- package/lib/core/interfaces/field-basics.interfaces.d.ts +0 -22
- package/lib/core/interfaces/form.interfaces.d.ts +0 -64
- package/lib/core/interfaces/special-control.interface.d.ts +0 -4
- package/lib/core/masks/currency.mask.d.ts +0 -1
- package/lib/core/masks/index.d.ts +0 -2
- package/lib/core/masks/number.mask.d.ts +0 -1
- package/lib/core/pipes/controls-list-pipe/controls-list.pipe.d.ts +0 -11
- package/lib/core/pipes/error-message-pipe/error.pipe.d.ts +0 -12
- package/lib/core/pipes/index.d.ts +0 -3
- package/lib/core/pipes/text-by-function/text-by-function.pipe.d.ts +0 -7
- package/lib/core/services/error-state-matcher/error-matcher.d.ts +0 -8
- package/lib/core/services/index.d.ts +0 -3
- package/lib/core/services/special-form-builder/special-form-builder.service.d.ts +0 -25
- package/public-api.d.ts +0 -9
package/README.md
CHANGED
|
@@ -1,147 +1,147 @@
|
|
|
1
|
-
<h1 align="center">Welcome to special-forms 👋</h1>
|
|
2
|
-
<p>
|
|
3
|
-
<a href="https://www.npmjs.com/package/special-forms" target="_blank">
|
|
4
|
-
<img alt="Version" src="https://img.shields.io/npm/v/special-forms.svg">
|
|
5
|
-
</a>
|
|
6
|
-
</p>
|
|
7
|
-
|
|
8
|
-
> Angular library to create complex forms with a simple config object.
|
|
9
|
-
|
|
10
|
-
### 🏠 [Homepage](https://gitlab.com/lopezsantiago/special-forms)
|
|
11
|
-
|
|
12
|
-
## Install
|
|
13
|
-
|
|
14
|
-
```sh
|
|
15
|
-
yarn add special-forms
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Author
|
|
19
|
-
|
|
20
|
-
👤 **Santiago López**
|
|
21
|
-
|
|
22
|
-
- Github: [@LopezSantiago](https://github.com/LopezSantiago)
|
|
23
|
-
- LinkedIn: [@https:\/\/www.linkedin.com\/in\/lopezsantiagowebui\/](https://linkedin.com/in/https://www.linkedin.com/in/lopezsantiagowebui/)
|
|
24
|
-
|
|
25
|
-
## Instructions
|
|
26
|
-
|
|
27
|
-
```typeScript
|
|
28
|
-
import { SpecialFormModule } from 'special-forms';
|
|
29
|
-
|
|
30
|
-
@NgModule({
|
|
31
|
-
...
|
|
32
|
-
imports: [
|
|
33
|
-
SpecialFormModule
|
|
34
|
-
],
|
|
35
|
-
...
|
|
36
|
-
})
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
In the component
|
|
40
|
-
|
|
41
|
-
```typeScript
|
|
42
|
-
import { SpecialFormBuilderService } from 'special-forms';
|
|
43
|
-
@Component({
|
|
44
|
-
...
|
|
45
|
-
})
|
|
46
|
-
export class SomeComponent implements OnInit {
|
|
47
|
-
|
|
48
|
-
constructor(private specialBuilder: SpecialFormBuilderService) {}
|
|
49
|
-
|
|
50
|
-
form = this.specialBuilder.group({
|
|
51
|
-
test: {
|
|
52
|
-
type: EControlTypes.input,
|
|
53
|
-
label: 'Esto es una prueba',
|
|
54
|
-
placeholder: 'Un placeholder',
|
|
55
|
-
},
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
To create a new Form only pass the config Object
|
|
62
|
-
|
|
63
|
-
```typeScript
|
|
64
|
-
interface {
|
|
65
|
-
placeholder?: string;
|
|
66
|
-
label?: string;
|
|
67
|
-
tooltip?: string;
|
|
68
|
-
icon?: string;
|
|
69
|
-
elementId?: string;
|
|
70
|
-
styleClasses?: string;
|
|
71
|
-
length?: number;
|
|
72
|
-
required?: boolean;
|
|
73
|
-
hidden?: boolean;
|
|
74
|
-
readOnly?: boolean;
|
|
75
|
-
disabled?:boolean;
|
|
76
|
-
errorMessages?: { [key: string]: string };
|
|
77
|
-
validators?: ValidatorFn | ValidatorFn[] | null;
|
|
78
|
-
asyncValidators?: AsyncValidatorFn | AsyncValidatorFn[] | null;
|
|
79
|
-
defaultValue?: any;
|
|
80
|
-
settings: //depends of the type of control selected;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
enum EControlTypes {
|
|
84
|
-
pkey = 'PRIMARY-KEY',
|
|
85
|
-
input = 'INPUT',
|
|
86
|
-
richText = 'RICH-TEXT',
|
|
87
|
-
textArea = 'TEXT-AREA',
|
|
88
|
-
dropdown = 'DROPDOWN',
|
|
89
|
-
date = 'DATE',
|
|
90
|
-
time = 'TIME',
|
|
91
|
-
checkbox = 'CHECKBOX',
|
|
92
|
-
upload = 'UPLOAD',
|
|
93
|
-
autocomplete = 'AUTOCOMPLETE',
|
|
94
|
-
multiple = 'MULTIPLE-AUTOCOMPLETE',
|
|
95
|
-
array = 'ARRAY',
|
|
96
|
-
form = 'FORM',
|
|
97
|
-
label = 'LABEL',
|
|
98
|
-
default = 'DEFAULT',
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
```
|
|
102
|
-
Example
|
|
103
|
-
|
|
104
|
-
```typeScript
|
|
105
|
-
form = this.specialBuilder.group({
|
|
106
|
-
name: {
|
|
107
|
-
type: EControlTypes.input,
|
|
108
|
-
label: 'Name',
|
|
109
|
-
placeholder: 'Write your first name',
|
|
110
|
-
validators:[Validators.maxLength(20)],
|
|
111
|
-
defaultValue:'Jhon Doe',
|
|
112
|
-
disabled:false,
|
|
113
|
-
elementId:'name-input',
|
|
114
|
-
errorMessages:{
|
|
115
|
-
maxLength:'The maximum length is 20'
|
|
116
|
-
},
|
|
117
|
-
required:true,
|
|
118
|
-
type: EControlTypes.input,
|
|
119
|
-
},
|
|
120
|
-
});
|
|
121
|
-
```
|
|
122
|
-
Finally you can pass the form object to the component.
|
|
123
|
-
|
|
124
|
-
```HTML
|
|
125
|
-
<sp-form [control]="form"></sp-form>
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
To the correct functionality of the library, need to install the next libraries
|
|
129
|
-
|
|
130
|
-
```JSON
|
|
131
|
-
"tailwindcss": "^3.2.7",
|
|
132
|
-
"autoprefixer": "^10.4.13",
|
|
133
|
-
"postcss": "^8.4.21",
|
|
134
|
-
"@ngneat/input-mask": "6.1.0",
|
|
135
|
-
"inputmask": "^5.0.7",
|
|
136
|
-
"ngx-dropzone": "^3.1.0",
|
|
137
|
-
"ngx-editor": "^15.2.0",
|
|
138
|
-
"@angular/material": "15.1.5"
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
## Show your support
|
|
142
|
-
|
|
143
|
-
Give a ⭐️ if this project helped you!
|
|
144
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_
|
|
1
|
+
<h1 align="center">Welcome to special-forms 👋</h1>
|
|
2
|
+
<p>
|
|
3
|
+
<a href="https://www.npmjs.com/package/special-forms" target="_blank">
|
|
4
|
+
<img alt="Version" src="https://img.shields.io/npm/v/special-forms.svg">
|
|
5
|
+
</a>
|
|
6
|
+
</p>
|
|
7
|
+
|
|
8
|
+
> Angular library to create complex forms with a simple config object.
|
|
9
|
+
|
|
10
|
+
### 🏠 [Homepage](https://gitlab.com/lopezsantiago/special-forms)
|
|
11
|
+
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
yarn add special-forms
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Author
|
|
19
|
+
|
|
20
|
+
👤 **Santiago López**
|
|
21
|
+
|
|
22
|
+
- Github: [@LopezSantiago](https://github.com/LopezSantiago)
|
|
23
|
+
- LinkedIn: [@https:\/\/www.linkedin.com\/in\/lopezsantiagowebui\/](https://linkedin.com/in/https://www.linkedin.com/in/lopezsantiagowebui/)
|
|
24
|
+
|
|
25
|
+
## Instructions
|
|
26
|
+
|
|
27
|
+
```typeScript
|
|
28
|
+
import { SpecialFormModule } from 'special-forms';
|
|
29
|
+
|
|
30
|
+
@NgModule({
|
|
31
|
+
...
|
|
32
|
+
imports: [
|
|
33
|
+
SpecialFormModule
|
|
34
|
+
],
|
|
35
|
+
...
|
|
36
|
+
})
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
In the component
|
|
40
|
+
|
|
41
|
+
```typeScript
|
|
42
|
+
import { SpecialFormBuilderService } from 'special-forms';
|
|
43
|
+
@Component({
|
|
44
|
+
...
|
|
45
|
+
})
|
|
46
|
+
export class SomeComponent implements OnInit {
|
|
47
|
+
|
|
48
|
+
constructor(private specialBuilder: SpecialFormBuilderService) {}
|
|
49
|
+
|
|
50
|
+
form = this.specialBuilder.group({
|
|
51
|
+
test: {
|
|
52
|
+
type: EControlTypes.input,
|
|
53
|
+
label: 'Esto es una prueba',
|
|
54
|
+
placeholder: 'Un placeholder',
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
To create a new Form only pass the config Object
|
|
62
|
+
|
|
63
|
+
```typeScript
|
|
64
|
+
interface {
|
|
65
|
+
placeholder?: string;
|
|
66
|
+
label?: string;
|
|
67
|
+
tooltip?: string;
|
|
68
|
+
icon?: string;
|
|
69
|
+
elementId?: string;
|
|
70
|
+
styleClasses?: string;
|
|
71
|
+
length?: number;
|
|
72
|
+
required?: boolean;
|
|
73
|
+
hidden?: boolean;
|
|
74
|
+
readOnly?: boolean;
|
|
75
|
+
disabled?:boolean;
|
|
76
|
+
errorMessages?: { [key: string]: string };
|
|
77
|
+
validators?: ValidatorFn | ValidatorFn[] | null;
|
|
78
|
+
asyncValidators?: AsyncValidatorFn | AsyncValidatorFn[] | null;
|
|
79
|
+
defaultValue?: any;
|
|
80
|
+
settings: //depends of the type of control selected;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
enum EControlTypes {
|
|
84
|
+
pkey = 'PRIMARY-KEY',
|
|
85
|
+
input = 'INPUT',
|
|
86
|
+
richText = 'RICH-TEXT',
|
|
87
|
+
textArea = 'TEXT-AREA',
|
|
88
|
+
dropdown = 'DROPDOWN',
|
|
89
|
+
date = 'DATE',
|
|
90
|
+
time = 'TIME',
|
|
91
|
+
checkbox = 'CHECKBOX',
|
|
92
|
+
upload = 'UPLOAD',
|
|
93
|
+
autocomplete = 'AUTOCOMPLETE',
|
|
94
|
+
multiple = 'MULTIPLE-AUTOCOMPLETE',
|
|
95
|
+
array = 'ARRAY',
|
|
96
|
+
form = 'FORM',
|
|
97
|
+
label = 'LABEL',
|
|
98
|
+
default = 'DEFAULT',
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
```
|
|
102
|
+
Example
|
|
103
|
+
|
|
104
|
+
```typeScript
|
|
105
|
+
form = this.specialBuilder.group({
|
|
106
|
+
name: {
|
|
107
|
+
type: EControlTypes.input,
|
|
108
|
+
label: 'Name',
|
|
109
|
+
placeholder: 'Write your first name',
|
|
110
|
+
validators:[Validators.maxLength(20)],
|
|
111
|
+
defaultValue:'Jhon Doe',
|
|
112
|
+
disabled:false,
|
|
113
|
+
elementId:'name-input',
|
|
114
|
+
errorMessages:{
|
|
115
|
+
maxLength:'The maximum length is 20'
|
|
116
|
+
},
|
|
117
|
+
required:true,
|
|
118
|
+
type: EControlTypes.input,
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
```
|
|
122
|
+
Finally you can pass the form object to the component.
|
|
123
|
+
|
|
124
|
+
```HTML
|
|
125
|
+
<sp-form [control]="form"></sp-form>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
To the correct functionality of the library, need to install the next libraries
|
|
129
|
+
|
|
130
|
+
```JSON
|
|
131
|
+
"tailwindcss": "^3.2.7",
|
|
132
|
+
"autoprefixer": "^10.4.13",
|
|
133
|
+
"postcss": "^8.4.21",
|
|
134
|
+
"@ngneat/input-mask": "6.1.0",
|
|
135
|
+
"inputmask": "^5.0.7",
|
|
136
|
+
"ngx-dropzone": "^3.1.0",
|
|
137
|
+
"ngx-editor": "^15.2.0",
|
|
138
|
+
"@angular/material": "15.1.5"
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Show your support
|
|
142
|
+
|
|
143
|
+
Give a ⭐️ if this project helped you!
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_
|