@webilix/ngx-form-m3 0.0.31 → 0.0.38

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/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import { Router } from '@angular/router';
5
5
  import { MatFormFieldAppearance } from '@angular/material/form-field';
6
6
  import { ComponentType } from '@angular/cdk/portal';
7
7
 
8
- type NgxFormInputs = IInputAutoComplete | IInputBankCard | IInputBankSheba | IInputCheckbox | IInputColor | IInputComponent | IInputCoordinates | IInputDate | IInputEmail | IInputFile | IInputIcon | IInputIp | IInputMobile | IInputMoment | IInputMultiSelect | IInputName | IInputNumber | IInputPassword | IInputPrice | IInputSelect | IInputText | IInputTextarea | IInputUrl;
8
+ type NgxFormInputs = IInputAutoComplete | IInputBankCard | IInputBankSheba | IInputCheckbox | IInputColor | IInputComponent | IInputCoordinates | IInputDate | IInputEmail | IInputFile | IInputIcon | IInputIp | IInputItemList | IInputMobile | IInputMoment | IInputMultiSelect | IInputName | IInputNumber | IInputOptionList | IInputPassword | IInputPrice | IInputRoute | IInputSelect | IInputText | IInputTextarea | IInputUrl;
9
9
  type Inputs = NgxFormInputs | {
10
10
  readonly header: string;
11
11
  readonly input: NgxFormInputs;
@@ -97,24 +97,43 @@ interface IInputColor extends Omit<IInput, 'english' | 'autoFocus'> {
97
97
  readonly type: 'COLOR';
98
98
  }
99
99
 
100
+ type NgxFormComponentInputs = {
101
+ [key: string]: any;
102
+ };
103
+ interface INgxFormCoordinates {
104
+ readonly latitude: number;
105
+ readonly longitude: number;
106
+ }
107
+ interface INgxFormOption {
108
+ readonly id: string;
109
+ readonly title: string;
110
+ }
111
+ interface INgxFormOptionGroup {
112
+ readonly title: string;
113
+ readonly ids: string[];
114
+ }
115
+ interface INgxFormName {
116
+ readonly first: string;
117
+ readonly last: string;
118
+ }
119
+ interface INgxFormOptionList {
120
+ readonly id: string | null;
121
+ readonly title: string;
122
+ }
123
+ type NgxFormRoute = INgxFormCoordinates[];
124
+
100
125
  interface IInputComponent extends Omit<IInput, 'value' | 'english' | 'autoFocus'> {
101
126
  readonly type: 'COMPONENT';
102
127
  readonly value?: any;
103
128
  readonly component: ComponentType<any>;
104
- readonly componentInputs?: {
105
- [key: string]: any;
106
- };
129
+ readonly componentInputs?: NgxFormComponentInputs;
107
130
  readonly zeroPadding?: boolean;
108
131
  }
109
132
 
110
- interface ICoordinates {
111
- latitude: number;
112
- longitude: number;
113
- }
114
133
  interface IInputCoordinates extends Omit<IInput, 'value' | 'english' | 'autoFocus'> {
115
134
  readonly type: 'COORDINATES';
116
- readonly value?: ICoordinates | null;
117
- readonly center?: ICoordinates;
135
+ readonly value?: INgxFormCoordinates | null;
136
+ readonly center?: INgxFormCoordinates;
118
137
  readonly zoom?: number;
119
138
  }
120
139
 
@@ -144,6 +163,16 @@ interface IInputIp extends Omit<IInput, 'english'> {
144
163
  readonly showIcon?: boolean;
145
164
  }
146
165
 
166
+ interface IInputItemList extends Omit<IInput, 'value' | 'optional'> {
167
+ readonly type: 'ITEM-LIST';
168
+ readonly title: string;
169
+ readonly value?: string[];
170
+ readonly minCount?: number;
171
+ readonly maxCount?: number;
172
+ readonly disableSort?: boolean;
173
+ readonly allowDuplicates?: boolean;
174
+ }
175
+
147
176
  interface IInputMobile extends Omit<IInput, 'english'> {
148
177
  readonly type: 'MOBILE';
149
178
  readonly showIcon?: boolean;
@@ -160,14 +189,8 @@ interface IInputMultiSelect extends Omit<IInput, 'value' | 'optional' | 'autoFoc
160
189
  readonly type: 'MULTI-SELECT';
161
190
  readonly title: string;
162
191
  readonly value?: string[] | null;
163
- readonly options: {
164
- readonly id: string;
165
- readonly title: string;
166
- }[];
167
- readonly groups?: {
168
- readonly title: string;
169
- readonly ids: string[];
170
- }[];
192
+ readonly options: INgxFormOption[];
193
+ readonly groups?: INgxFormOptionGroup[];
171
194
  readonly minCount?: number;
172
195
  readonly maxCount?: number;
173
196
  readonly listMaxHeight?: number;
@@ -175,13 +198,9 @@ interface IInputMultiSelect extends Omit<IInput, 'value' | 'optional' | 'autoFoc
175
198
  readonly view?: 'SELECT';
176
199
  }
177
200
 
178
- interface IName {
179
- readonly first: string;
180
- readonly last: string;
181
- }
182
201
  interface IInputName extends Omit<IInput, 'value' | 'hint' | 'english' | 'description' | 'button'> {
183
202
  readonly type: 'NAME';
184
- readonly value?: IName | null;
203
+ readonly value?: INgxFormName | null;
185
204
  }
186
205
 
187
206
  interface IInputNumber extends Omit<IInput, 'value' | 'english'> {
@@ -198,6 +217,16 @@ interface IInputNumber extends Omit<IInput, 'value' | 'english'> {
198
217
  readonly showText?: boolean;
199
218
  }
200
219
 
220
+ interface IInputOptionList extends Omit<IInput, 'value' | 'optional'> {
221
+ readonly type: 'OPTION-LIST';
222
+ readonly title: string;
223
+ readonly value?: INgxFormOptionList[];
224
+ readonly minCount?: number;
225
+ readonly maxCount?: number;
226
+ readonly disableSort?: boolean;
227
+ readonly allowDuplicates?: boolean;
228
+ }
229
+
201
230
  interface IInputPassword extends Omit<IInput, 'english' | 'value'> {
202
231
  readonly type: 'PASSWORD';
203
232
  readonly verify?: {
@@ -219,13 +248,17 @@ interface IInputPrice extends Omit<IInput, 'value' | 'english'> {
219
248
  readonly hideText?: boolean;
220
249
  }
221
250
 
251
+ interface IInputRoute extends Omit<IInput, 'value' | 'english' | 'autoFocus'> {
252
+ readonly type: 'ROUTE';
253
+ readonly value?: NgxFormRoute | null;
254
+ readonly center?: INgxFormCoordinates;
255
+ readonly zoom?: number;
256
+ }
257
+
222
258
  interface IInputSelect extends IInput {
223
259
  readonly type: 'SELECT';
224
260
  readonly title: string;
225
- readonly options: {
226
- readonly id: string;
227
- readonly title: string;
228
- }[];
261
+ readonly options: INgxFormOption[];
229
262
  readonly hideSearch?: boolean;
230
263
  }
231
264
 
@@ -297,6 +330,7 @@ declare class NgxFormComponent implements OnInit, OnChanges, AfterViewInit {
297
330
  ngAfterViewInit(): void;
298
331
  getInputs(): NgxFormInputs[];
299
332
  getValues(): INgxFormValues;
333
+ updateValues(changedInputs: string[]): void;
300
334
  setInput(input: NgxFormInputs): void;
301
335
  checkInputs(): void;
302
336
  checkSubmit(): void;
@@ -311,4 +345,4 @@ declare class NgxFormComponent implements OnInit, OnChanges, AfterViewInit {
311
345
  }
312
346
 
313
347
  export { NGX_FORM_CONFIG, NGX_FORM_CONTROL, NGX_FORM_INPUT, NgxFormComponent, provideNgxFormConfig };
314
- export type { IInputComponent, INgxForm, INgxFormButton, INgxFormConfig, INgxFormInit, INgxFormValues, NgxFormInputs };
348
+ export type { IInputComponent, INgxForm, INgxFormButton, INgxFormConfig, INgxFormCoordinates, INgxFormInit, INgxFormName, INgxFormOption, INgxFormOptionGroup, INgxFormOptionList, INgxFormValues, NgxFormComponentInputs, NgxFormInputs, NgxFormRoute };
package/ngx-form-m3.css CHANGED
@@ -224,6 +224,23 @@
224
224
  }
225
225
  }
226
226
 
227
+ /* INPUTS: ROUTE */
228
+ .ngx-helper-form-m3-route-input {
229
+ display: flex;
230
+ align-items: center;
231
+ column-gap: 1rem;
232
+
233
+ cursor: pointer;
234
+
235
+ div.distance {
236
+ flex: 1;
237
+ }
238
+
239
+ div.point {
240
+ font-size: 90%;
241
+ }
242
+ }
243
+
227
244
  /* INPUTS: NAME */
228
245
  .ngx-helper-form-m3-name-input {
229
246
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webilix/ngx-form-m3",
3
- "version": "0.0.31",
3
+ "version": "0.0.38",
4
4
  "author": "Ali Amirnezhad",
5
5
  "description": "Persian form library for Angular and Material 3",
6
6
  "repository": {
@@ -24,10 +24,10 @@
24
24
  "@angular/core": ">=20.0.0",
25
25
  "@angular/forms": ">=20.0.0",
26
26
  "@angular/material": ">=20.0.1",
27
- "@webilix/helper-library": ">=6.1.3",
27
+ "@webilix/helper-library": ">=6.1.5",
28
28
  "@webilix/jalali-date-time": ">=2.0.7",
29
29
  "@webilix/ngx-calendar-m3": ">=0.0.15",
30
- "@webilix/ngx-helper-m3": ">=0.0.29",
30
+ "@webilix/ngx-helper-m3": ">=0.0.32",
31
31
  "ngx-mask": ">=19.0.7"
32
32
  },
33
33
  "dependencies": {