@webilix/ngx-form-m3 0.0.13 → 0.0.15
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/webilix-ngx-form-m3.mjs +120 -10
- package/fesm2022/webilix-ngx-form-m3.mjs.map +1 -1
- package/lib/directives/form-error.directive.d.ts +1 -0
- package/lib/inputs/checkbox/input-checkbox.interface.d.ts +1 -1
- package/lib/inputs/icon/input-icon.component.d.ts +14 -0
- package/lib/inputs/icon/input-icon.interface.d.ts +9 -0
- package/lib/inputs/index.d.ts +4 -0
- package/lib/inputs/input.component.d.ts +10 -0
- package/lib/inputs/multi-select/input-multi-select.component.d.ts +19 -0
- package/lib/inputs/multi-select/input-multi-select.interface.d.ts +18 -0
- package/lib/ngx-form.interface.d.ts +3 -3
- package/lib/validators/count/max-count.validator.d.ts +2 -0
- package/lib/validators/count/min-count.validator.d.ts +2 -0
- package/lib/validators/index.d.ts +2 -0
- package/ngx-form-m3.css +45 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -6,6 +6,7 @@ export declare class FormErrorDirective {
|
|
|
6
6
|
private formGroupDirective;
|
|
7
7
|
onSubmit(): void;
|
|
8
8
|
constructor(elementRef: ElementRef, formGroupDirective: FormGroupDirective);
|
|
9
|
+
private getElementTop;
|
|
9
10
|
private scrollToElement;
|
|
10
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormErrorDirective, [null, { optional: true; }]>;
|
|
11
12
|
static ɵdir: i0.ɵɵDirectiveDeclaration<FormErrorDirective, "form.ngx-form", never, {}, {}, never, never, true, never>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ValidatorFn, FormControl } from '@angular/forms';
|
|
2
2
|
import { InputMethods, IInput } from '../input.interface';
|
|
3
|
-
export interface IInputCheckbox extends Omit<IInput, 'title' | 'value' | 'autoFocus'> {
|
|
3
|
+
export interface IInputCheckbox extends Omit<IInput, 'title' | 'value' | 'optional' | 'autoFocus'> {
|
|
4
4
|
readonly type: 'CHECKBOX';
|
|
5
5
|
readonly message: string;
|
|
6
6
|
readonly value?: boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FormControl } from '@angular/forms';
|
|
2
|
+
import { INgxFormValues } from '../../ngx-form.interface';
|
|
3
|
+
import { IInputConfig } from '../input.interface';
|
|
4
|
+
import { IInputIcon } from './input-icon.interface';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class InputIconComponent {
|
|
7
|
+
formControl: FormControl;
|
|
8
|
+
input: IInputIcon;
|
|
9
|
+
config: IInputConfig;
|
|
10
|
+
values: INgxFormValues;
|
|
11
|
+
isButtonDisabled: boolean;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InputIconComponent, never>;
|
|
13
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InputIconComponent, "ng-component", never, { "values": { "alias": "values"; "required": true; }; "isButtonDisabled": { "alias": "isButtonDisabled"; "required": true; }; }, {}, never, never, true, never>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ValidatorFn, FormControl } from '@angular/forms';
|
|
2
|
+
import { InputMethods, IInput } from '../input.interface';
|
|
3
|
+
export interface IInputIcon extends Omit<IInput, 'english'> {
|
|
4
|
+
readonly type: 'ICON';
|
|
5
|
+
}
|
|
6
|
+
export declare class InputIconMethods extends InputMethods<IInputIcon, string | null> {
|
|
7
|
+
control(input: IInputIcon, validators: ValidatorFn[]): FormControl<string | null>;
|
|
8
|
+
value(value: any, input: IInputIcon): string | null;
|
|
9
|
+
}
|
package/lib/inputs/index.d.ts
CHANGED
|
@@ -12,12 +12,16 @@ export * from './email/input-email.component';
|
|
|
12
12
|
export * from './email/input-email.interface';
|
|
13
13
|
export * from './file/input-file.component';
|
|
14
14
|
export * from './file/input-file.interface';
|
|
15
|
+
export * from './icon/input-icon.component';
|
|
16
|
+
export * from './icon/input-icon.interface';
|
|
15
17
|
export * from './ip/input-ip.component';
|
|
16
18
|
export * from './ip/input-ip.interface';
|
|
17
19
|
export * from './mobile/input-mobile.component';
|
|
18
20
|
export * from './mobile/input-mobile.interface';
|
|
19
21
|
export * from './moment/input-moment.component';
|
|
20
22
|
export * from './moment/input-moment.interface';
|
|
23
|
+
export * from './multi-select/input-multi-select.component';
|
|
24
|
+
export * from './multi-select/input-multi-select.interface';
|
|
21
25
|
export * from './name/input-name.component';
|
|
22
26
|
export * from './name/input-name.interface';
|
|
23
27
|
export * from './number/input-number.component';
|
|
@@ -59,6 +59,11 @@ export declare class InputComponent implements OnInit, OnChanges {
|
|
|
59
59
|
readonly methods: import("./input.interface").InputMethods<any, any>;
|
|
60
60
|
readonly component: import("@angular/cdk/portal").ComponentType<any>;
|
|
61
61
|
};
|
|
62
|
+
ICON: {
|
|
63
|
+
readonly title: string;
|
|
64
|
+
readonly methods: import("./input.interface").InputMethods<any, any>;
|
|
65
|
+
readonly component: import("@angular/cdk/portal").ComponentType<any>;
|
|
66
|
+
};
|
|
62
67
|
IP: {
|
|
63
68
|
readonly title: string;
|
|
64
69
|
readonly methods: import("./input.interface").InputMethods<any, any>;
|
|
@@ -69,6 +74,11 @@ export declare class InputComponent implements OnInit, OnChanges {
|
|
|
69
74
|
readonly methods: import("./input.interface").InputMethods<any, any>;
|
|
70
75
|
readonly component: import("@angular/cdk/portal").ComponentType<any>;
|
|
71
76
|
};
|
|
77
|
+
"MULTI-SELECT": {
|
|
78
|
+
readonly title: string;
|
|
79
|
+
readonly methods: import("./input.interface").InputMethods<any, any>;
|
|
80
|
+
readonly component: import("@angular/cdk/portal").ComponentType<any>;
|
|
81
|
+
};
|
|
72
82
|
NAME: {
|
|
73
83
|
readonly title: string;
|
|
74
84
|
readonly methods: import("./input.interface").InputMethods<any, any>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OnInit } from '@angular/core';
|
|
2
|
+
import { FormControl } from '@angular/forms';
|
|
3
|
+
import { INgxFormValues } from '../../ngx-form.interface';
|
|
4
|
+
import { IInputConfig } from '../input.interface';
|
|
5
|
+
import { IInputMultiSelect } from './input-multi-select.interface';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class InputMultiSelectComponent implements OnInit {
|
|
8
|
+
listHeight: string;
|
|
9
|
+
formControl: FormControl;
|
|
10
|
+
input: IInputMultiSelect;
|
|
11
|
+
config: IInputConfig;
|
|
12
|
+
values: INgxFormValues;
|
|
13
|
+
isButtonDisabled: boolean;
|
|
14
|
+
ids: string[];
|
|
15
|
+
ngOnInit(): void;
|
|
16
|
+
toggleValue(id: string): void;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<InputMultiSelectComponent, never>;
|
|
18
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InputMultiSelectComponent, "ng-component", never, { "values": { "alias": "values"; "required": true; }; "isButtonDisabled": { "alias": "isButtonDisabled"; "required": true; }; }, {}, never, never, true, never>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ValidatorFn, FormControl } from '@angular/forms';
|
|
2
|
+
import { InputMethods, IInput } from '../input.interface';
|
|
3
|
+
export interface IInputMultiSelect extends Omit<IInput, 'value' | 'optional' | 'autoFocus'> {
|
|
4
|
+
readonly type: 'MULTI-SELECT';
|
|
5
|
+
readonly title: string;
|
|
6
|
+
readonly value?: string[];
|
|
7
|
+
readonly options: {
|
|
8
|
+
readonly id: string;
|
|
9
|
+
readonly title: string;
|
|
10
|
+
}[];
|
|
11
|
+
readonly minCount?: number;
|
|
12
|
+
readonly maxCount?: number;
|
|
13
|
+
readonly listMaxHeight?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare class InputMultiSelectMethods extends InputMethods<IInputMultiSelect, string[] | null> {
|
|
16
|
+
control(input: IInputMultiSelect, validators: ValidatorFn[]): FormControl<string[] | null>;
|
|
17
|
+
value(value: any, input: IInputMultiSelect): string[] | null;
|
|
18
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { InjectionToken } from '@angular/core';
|
|
2
2
|
import { FormControl, FormGroup, NgForm } from '@angular/forms';
|
|
3
3
|
import { MatFormFieldAppearance } from '@angular/material/form-field';
|
|
4
|
-
import { IInputAutoComplete, IInputCheckbox, IInputColor, IInputComponent, IInputDate, IInputEmail, IInputFile, IInputIp, IInputMobile, IInputMoment, IInputName, IInputNumber, IInputPassword, IInputSelect, IInputText, IInputTextarea, IInputUrl } from './inputs';
|
|
5
|
-
export type NgxFormInputs = IInputAutoComplete | IInputCheckbox | IInputColor | IInputComponent | IInputDate | IInputEmail | IInputFile | IInputIp | IInputMobile | IInputMoment | IInputName | IInputNumber | IInputPassword | IInputSelect | IInputText | IInputTextarea | IInputUrl;
|
|
4
|
+
import { IInputAutoComplete, IInputCheckbox, IInputColor, IInputComponent, IInputDate, IInputEmail, IInputFile, IInputIcon, IInputIp, IInputMobile, IInputMoment, IInputMultiSelect, IInputName, IInputNumber, IInputPassword, IInputSelect, IInputText, IInputTextarea, IInputUrl } from './inputs';
|
|
5
|
+
export type NgxFormInputs = IInputAutoComplete | IInputCheckbox | IInputColor | IInputComponent | IInputDate | IInputEmail | IInputFile | IInputIcon | IInputIp | IInputMobile | IInputMoment | IInputMultiSelect | IInputName | IInputNumber | IInputPassword | IInputSelect | IInputText | IInputTextarea | IInputUrl;
|
|
6
6
|
type Inputs = NgxFormInputs | {
|
|
7
7
|
readonly header: string;
|
|
8
8
|
readonly input: NgxFormInputs;
|
|
@@ -41,5 +41,5 @@ export interface INgxFormValues {
|
|
|
41
41
|
[key: string]: any;
|
|
42
42
|
}
|
|
43
43
|
export declare const NGX_FORM_CONTROL: InjectionToken<FormControl>;
|
|
44
|
-
export declare const NGX_FORM_INPUT: InjectionToken<
|
|
44
|
+
export declare const NGX_FORM_INPUT: InjectionToken<IInputComponent>;
|
|
45
45
|
export {};
|
package/ngx-form-m3.css
CHANGED
|
@@ -107,6 +107,26 @@
|
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
/* INPUTS: ICON */
|
|
111
|
+
.ngx-helper-form-m3-icon-input {
|
|
112
|
+
display: flex;
|
|
113
|
+
align-items: center;
|
|
114
|
+
|
|
115
|
+
mat-icon {
|
|
116
|
+
display: flex;
|
|
117
|
+
align-items: center;
|
|
118
|
+
justify-content: center;
|
|
119
|
+
|
|
120
|
+
width: 24px !important;
|
|
121
|
+
height: 24px !important;
|
|
122
|
+
color: var(--primary);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
input {
|
|
126
|
+
flex: 1;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
110
130
|
/* INPUTS: FILE */
|
|
111
131
|
.ngx-helper-form-m3-file-input {
|
|
112
132
|
display: flex;
|
|
@@ -134,6 +154,31 @@
|
|
|
134
154
|
}
|
|
135
155
|
}
|
|
136
156
|
|
|
157
|
+
/* INPUTS: MULTI-SELECT */
|
|
158
|
+
.ngx-helper-form-m3-multi-select-input {
|
|
159
|
+
.title {
|
|
160
|
+
padding-bottom: 0.5rem;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.options {
|
|
164
|
+
overflow: auto;
|
|
165
|
+
max-height: var(--listHeight);
|
|
166
|
+
|
|
167
|
+
.option {
|
|
168
|
+
display: inline-flex;
|
|
169
|
+
align-items: flex-start;
|
|
170
|
+
column-gap: 0.5rem;
|
|
171
|
+
|
|
172
|
+
cursor: pointer;
|
|
173
|
+
|
|
174
|
+
.message {
|
|
175
|
+
flex: 1;
|
|
176
|
+
text-align: right;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
137
182
|
/* INPUTS: NAME */
|
|
138
183
|
.ngx-helper-form-m3-name-input {
|
|
139
184
|
display: flex;
|
package/package.json
CHANGED
package/public-api.d.ts
CHANGED