@webilix/ngx-form-m3 0.0.5 → 0.0.7

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.
@@ -2,7 +2,7 @@ import { ValidatorFn, FormControl } from '@angular/forms';
2
2
  import { InputMethods, IInput } from '../input.interface';
3
3
  export interface IInputDate extends Omit<IInput, 'english' | 'value' | 'autoFocus'> {
4
4
  readonly type: 'DATE';
5
- readonly value?: Date;
5
+ readonly value?: Date | null;
6
6
  readonly minDate?: Date | 'NOW';
7
7
  readonly maxDate?: Date | 'NOW';
8
8
  }
@@ -0,0 +1,12 @@
1
+ import { FormControl } from '@angular/forms';
2
+ import { IInputConfig } from '../input.interface';
3
+ import { IInputFile } from './input-file.interface';
4
+ import * as i0 from "@angular/core";
5
+ export declare class InputFileComponent {
6
+ formControl: FormControl;
7
+ input: IInputFile;
8
+ config: IInputConfig;
9
+ setFile(event: Event | null): void;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<InputFileComponent, never>;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<InputFileComponent, "ng-component", never, {}, {}, never, never, true, never>;
12
+ }
@@ -0,0 +1,10 @@
1
+ import { ValidatorFn, FormControl } from '@angular/forms';
2
+ import { InputMethods, IInput } from '../input.interface';
3
+ export interface IInputFile extends Omit<IInput, 'value' | 'english' | 'autoFocus'> {
4
+ readonly type: 'FILE';
5
+ readonly mimes?: 'IMAGE' | string[];
6
+ }
7
+ export declare class InputFileMethods extends InputMethods<IInputFile, File | null> {
8
+ control(input: IInputFile, validators: ValidatorFn[]): FormControl<File | null>;
9
+ value(value: any, input: IInputFile): File | null;
10
+ }
@@ -4,6 +4,8 @@ export * from './date/input-date.component';
4
4
  export * from './date/input-date.interface';
5
5
  export * from './email/input-email.component';
6
6
  export * from './email/input-email.interface';
7
+ export * from './file/input-file.component';
8
+ export * from './file/input-file.interface';
7
9
  export * from './mobile/input-mobile.component';
8
10
  export * from './mobile/input-mobile.interface';
9
11
  export * from './name/input-name.component';
@@ -16,6 +18,8 @@ export * from './text/input-text.component';
16
18
  export * from './text/input-text.interface';
17
19
  export * from './textarea/input-textarea.component';
18
20
  export * from './textarea/input-textarea.interface';
21
+ export * from './url/input-url.component';
22
+ export * from './url/input-url.interface';
19
23
  export * from './input.component';
20
24
  export * from './input.info';
21
25
  export * from './input.interface';
@@ -18,6 +18,11 @@ export declare class InputComponent implements OnInit {
18
18
  readonly methods: import("./input.interface").InputMethods<any, any>;
19
19
  readonly component: import("@angular/cdk/portal").ComponentType<any>;
20
20
  };
21
+ URL: {
22
+ readonly title: string;
23
+ readonly methods: import("./input.interface").InputMethods<any, any>;
24
+ readonly component: import("@angular/cdk/portal").ComponentType<any>;
25
+ };
21
26
  MOBILE: {
22
27
  readonly title: string;
23
28
  readonly methods: import("./input.interface").InputMethods<any, any>;
@@ -33,6 +38,11 @@ export declare class InputComponent implements OnInit {
33
38
  readonly methods: import("./input.interface").InputMethods<any, any>;
34
39
  readonly component: import("@angular/cdk/portal").ComponentType<any>;
35
40
  };
41
+ FILE: {
42
+ readonly title: string;
43
+ readonly methods: import("./input.interface").InputMethods<any, any>;
44
+ readonly component: import("@angular/cdk/portal").ComponentType<any>;
45
+ };
36
46
  NAME: {
37
47
  readonly title: string;
38
48
  readonly methods: import("./input.interface").InputMethods<any, any>;
@@ -5,7 +5,7 @@ import { INgxFormValues } from '../ngx-form.interface';
5
5
  export interface IInput {
6
6
  readonly name: string;
7
7
  readonly title?: string;
8
- readonly value?: string;
8
+ readonly value?: string | null;
9
9
  readonly hint?: string;
10
10
  readonly description?: string;
11
11
  readonly optional?: boolean;
@@ -6,7 +6,7 @@ interface IName {
6
6
  }
7
7
  export interface IInputName extends Omit<IInput, 'value' | 'hint' | 'english' | 'description'> {
8
8
  readonly type: 'NAME';
9
- readonly value?: IName;
9
+ readonly value?: IName | null;
10
10
  }
11
11
  export declare class InputNameMethods extends InputMethods<IInputName, IName | null> {
12
12
  control(input: IInputName, validators: ValidatorFn[]): FormControl<IName | null>;
@@ -5,6 +5,7 @@ export interface IInputText extends IInput {
5
5
  readonly title: string;
6
6
  readonly minLength?: number;
7
7
  readonly maxLength?: number;
8
+ readonly readonly?: boolean;
8
9
  }
9
10
  export declare class InputTextMethods extends InputMethods<IInputText, string | null> {
10
11
  control(input: IInputText, validators: ValidatorFn[]): FormControl<string | null>;
@@ -0,0 +1,11 @@
1
+ import { FormControl } from '@angular/forms';
2
+ import { IInputConfig } from '../input.interface';
3
+ import { IInputUrl } from './input-url.interface';
4
+ import * as i0 from "@angular/core";
5
+ export declare class InputUrlComponent {
6
+ formControl: FormControl;
7
+ input: IInputUrl;
8
+ config: IInputConfig;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<InputUrlComponent, never>;
10
+ static ɵcmp: i0.ɵɵComponentDeclaration<InputUrlComponent, "ng-component", never, {}, {}, never, never, true, never>;
11
+ }
@@ -0,0 +1,10 @@
1
+ import { ValidatorFn, FormControl } from '@angular/forms';
2
+ import { InputMethods, IInput } from '../input.interface';
3
+ export interface IInputUrl extends Omit<IInput, 'english'> {
4
+ readonly type: 'URL';
5
+ readonly showIcon?: boolean;
6
+ }
7
+ export declare class InputUrlMethods extends InputMethods<IInputUrl, string | null> {
8
+ control(input: IInputUrl, validators: ValidatorFn[]): FormControl<string | null>;
9
+ value(value: any, input: IInputUrl): string | null;
10
+ }
@@ -1,7 +1,7 @@
1
1
  import { FormGroup, NgForm } from '@angular/forms';
2
2
  import { MatFormFieldAppearance } from '@angular/material/form-field';
3
- import { IInputColor, IInputDate, IInputEmail, IInputMobile, IInputName, IInputPassword, IInputSelect, IInputText, IInputTextarea } from './inputs';
4
- export type NgxFormInputs = IInputColor | IInputDate | IInputEmail | IInputMobile | IInputName | IInputPassword | IInputSelect | IInputText | IInputTextarea;
3
+ import { IInputColor, IInputDate, IInputEmail, IInputFile, IInputMobile, IInputName, IInputPassword, IInputSelect, IInputText, IInputTextarea, IInputUrl } from './inputs';
4
+ export type NgxFormInputs = IInputColor | IInputDate | IInputEmail | IInputFile | IInputMobile | IInputName | IInputPassword | IInputSelect | IInputText | IInputTextarea | IInputUrl;
5
5
  type Inputs = NgxFormInputs | {
6
6
  readonly header: string;
7
7
  readonly input: NgxFormInputs;
package/ngx-form-m3.css CHANGED
@@ -58,3 +58,74 @@
58
58
  opacity: 0.4;
59
59
  cursor: default;
60
60
  }
61
+
62
+ /* INPUTS: COLOR */
63
+ .ngx-helper-form-m3-color-input {
64
+ display: flex;
65
+ align-items: center;
66
+
67
+ section {
68
+ flex: 1;
69
+
70
+ display: block;
71
+ position: relative;
72
+
73
+ .color {
74
+ cursor: pointer;
75
+ border-width: 0px;
76
+ }
77
+
78
+ input[type='color'] {
79
+ position: absolute;
80
+ bottom: 0;
81
+ left: 0;
82
+ width: 0 !important;
83
+ opacity: 0;
84
+ z-index: -1;
85
+ }
86
+ }
87
+
88
+ .value {
89
+ width: 90px;
90
+ text-align: left;
91
+ cursor: pointer;
92
+ text-transform: uppercase;
93
+ }
94
+ }
95
+
96
+ /* INPUTS: FILE */
97
+ .ngx-helper-form-m3-file-input {
98
+ display: flex;
99
+ align-items: center;
100
+ cursor: pointer;
101
+
102
+ .size {
103
+ font-size: 90%;
104
+ }
105
+
106
+ .name {
107
+ flex: 1;
108
+ width: 0;
109
+
110
+ direction: ltr;
111
+ text-align: left;
112
+
113
+ white-space: nowrap;
114
+ overflow: hidden;
115
+ text-overflow: ellipsis;
116
+ }
117
+
118
+ input {
119
+ width: 0.5rem;
120
+ }
121
+ }
122
+
123
+ /* INPUTS: NAME */
124
+ .ngx-helper-form-m3-name-input {
125
+ display: flex;
126
+ column-gap: 1rem;
127
+
128
+ mat-form-field {
129
+ flex: 1;
130
+ }
131
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webilix/ngx-form-m3",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "author": "Ali Amirnezhad",
5
5
  "description": "Persian form library for Angular and Material 3",
6
6
  "repository": {
@@ -26,8 +26,8 @@
26
26
  "@angular/material": ">=19.0.3",
27
27
  "@webilix/helper-library": ">=6.0.2",
28
28
  "@webilix/jalali-date-time": ">=2.0.5",
29
- "@webilix/ngx-calendar-m3": ">=0.0.4",
30
- "@webilix/ngx-helper-m3": ">=0.0.10",
29
+ "@webilix/ngx-calendar-m3": ">=0.0.6",
30
+ "@webilix/ngx-helper-m3": ">=0.0.12",
31
31
  "ngx-mask": ">=19.0.4"
32
32
  },
33
33
  "dependencies": {