@webilix/ngx-form-m3 0.0.14 → 0.0.16

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.
@@ -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;
@@ -20,6 +20,8 @@ export * from './mobile/input-mobile.component';
20
20
  export * from './mobile/input-mobile.interface';
21
21
  export * from './moment/input-moment.component';
22
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';
23
25
  export * from './name/input-name.component';
24
26
  export * from './name/input-name.interface';
25
27
  export * from './number/input-number.component';
@@ -74,6 +74,11 @@ export declare class InputComponent implements OnInit, OnChanges {
74
74
  readonly methods: import("./input.interface").InputMethods<any, any>;
75
75
  readonly component: import("@angular/cdk/portal").ComponentType<any>;
76
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
+ };
77
82
  NAME: {
78
83
  readonly title: string;
79
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, IInputIcon, IInputIp, IInputMobile, IInputMoment, IInputName, IInputNumber, IInputPassword, IInputSelect, IInputText, IInputTextarea, IInputUrl } from './inputs';
5
- export type NgxFormInputs = IInputAutoComplete | IInputCheckbox | IInputColor | IInputComponent | IInputDate | IInputEmail | IInputFile | IInputIcon | 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<any>;
44
+ export declare const NGX_FORM_INPUT: InjectionToken<IInputComponent>;
45
45
  export {};
@@ -0,0 +1,2 @@
1
+ import { ValidatorFn } from '@angular/forms';
2
+ export declare const MaxCountValidator: (max: number) => ValidatorFn;
@@ -0,0 +1,2 @@
1
+ import { ValidatorFn } from '@angular/forms';
2
+ export declare const MinCountValidator: (min: number) => ValidatorFn;
@@ -1,3 +1,5 @@
1
+ export * from './count/max-count.validator';
2
+ export * from './count/min-count.validator';
1
3
  export * from './date/max-date.validator';
2
4
  export * from './date/min-date.validator';
3
5
  export * from './moment/max-moment.validator';
package/ngx-form-m3.css CHANGED
@@ -154,6 +154,31 @@
154
154
  }
155
155
  }
156
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
+
157
182
  /* INPUTS: NAME */
158
183
  .ngx-helper-form-m3-name-input {
159
184
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webilix/ngx-form-m3",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "author": "Ali Amirnezhad",
5
5
  "description": "Persian form library for Angular and Material 3",
6
6
  "repository": {
package/public-api.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './lib/ngx-form.component';
2
2
  export * from './lib/ngx-form.config';
3
3
  export * from './lib/ngx-form.interface';
4
+ export type { IInputComponent } from './lib/inputs/component/input-component.interface';