4.1.11 • Published 3 days ago

@webilix/ngx-form v4.1.11

Weekly downloads
-
License
MIT
Repository
github
Last release
3 days ago

@webilix/ngx-form

Persian form / report library for Angular

This library uses Angular 15.0.2+


Installation

# Create new Angular Application
ng new my-application

# Go to application directory
cd my-application

# Add Material support to your application
# Choose YES when you asked for setting up "browser animations for Angular Material"
ng add @angular/material

# Install @webilix/ngx-form, using NPM
npm install --save @webilix/ngx-form

Table of contents


Versions

NgxFormAngular
<=2.7.315
<=3.5.1316
Current17

NgxFormModule Usage

  • Import NgxFormModule
/* TypeScript */
import { NgxFormModule } from '@webilix/ngx-form';

@NgModule({
   ...
   imports: [
       ...
       NgxFormModule.forRoot()
   ],
   ...
})
  • Create ngxForm in component
/* TypeScript */
import { INgxForm, NgxFormComponent } from '@webilix/ngx-form';

public ngxForm: INgxForm = {
    submit: 'نمایش مقادیر ثبت شده در فرم',
    inputs: [
        { name: 'username', type: 'USERNAME', ... }
        { name: 'password', type: 'PASSWORD', ... }
        ...
    ]
}
  • Add ngxForm code to component template
<!-- HTML -->
<ngx-form [ngxForm]="ngxForm" (ngxSubmit)="showValues($event)"></ngx-form>
  • Process form values
/* TypeScript */
import { INgxFormValues } from '@webilix/ngx-form';

showValues(values: INgxFormValues): void {
    // values['username']
    // values['password']
    ...
}

NgxFormModule Configuration

/**
 * NgxForm config
 */
export interface INgxFormStyle {
    /**
     * Farsi (Persian) font name
     * @type { string }
     * @optional 'Yekan'
     */
    faFont: string;

    /**
     * English font name
     * @type { string }
     * @optional 'Roboto, "Helvetica Neue", sans-serif'
     */
    enFont: string;

    /**
     * Material icon font name
     * @type { string }
     * @optional 'Material Icons Outlined'
     */
    iconFont: string;

    /**
     * Material icon font size
     * @type { string }
     * @optional '16px'
     */
    iconSize: string;

    /**
     * Form inputs primary color
     * @type { string }
     * @optional 'rgb(29, 91, 116)'
     */
    primaryColor: string;

    /**
     * Form inputs warn color
     * @type { string }
     * @optional 'rgb(255, 49, 27)'
     */
    warnColor: string;

    /**
     * Form inputs border color
     * @type { string }
     * @optional 'rgb(187, 206, 213)'
     */
    borderColor: string;

    /**
     * Form inputs background color
     * @type { string }
     * @optional 'rgb(232, 239, 241)'
     */
    backgroundColor: string;

    /**
     * Form inputs label color
     * @type { string }
     * @optional 'rgba(0, 0, 0, 0.6)'
     */
    labelColor: string;
}

NgxFormModule Input Types

  • AUTO-COMPLETE
  • BANK-CARD
  • CHECKBOX
  • COLOR
  • COMMENT
  • COORDINATES
  • DATE
  • DOMAIN
  • EMAIL
  • FILE
  • ICON
  • IP
  • LIST
  • MASK
  • MOBILE
  • MULTI-FILE
  • MULTI-SELECT
  • NAME
  • NATIONAL-CODE
  • NUMBER
  • NUMERIC
  • OPTION-LIST
  • PASSWORD
  • PERIOD
  • PLATE
  • PRICE
  • RANGE
  • SELECT
  • TAG
  • TEXT
  • TEXTAREA
  • TIME
  • URL
  • USERNAME

NgxFormModule Preview

alt text


NgxReportModule Usage

  • Import NgxReportModule
/* TypeScript */
import { NgxReportModule } from '@webilix/ngx-form';

@NgModule({
   ...
   imports: [
       ...
       NgxReportModule.forRoot()
   ],
   ...
})
  • Create ngxInputs && ngxReport in component
/* TypeScript */
import { INgxReport, NgxReportInputs } from '@webilix/ngx-form';

 public ngxInputs: NgxReportInputs[] = [
        { name: 'bank-card', type: 'BANK-CARD', title: 'شماره کارت بانکی' },
        { name: 'checkbox', type: 'CHECKBOX', title: 'یک انتخابی' },
        ...
 ]

 public ngxReport: INgxReport | null = null;
  • Add ngxReport code to component template
<!-- HTML -->
<ngx-report [ngxInputs]="ngxInputs" [(ngxReport)]="ngxReport" (changed)="showValues($event)"></ngx-report>
  • Process report
/* TypeScript */
import { INgxReport } from '@webilix/ngx-form';

showValues(report: INgxReport): void {
    // report = {
    //     join: 'AND',
    //     conditions: [
    //         {input: 'bank-card', operator: 'EQ', value: '1234567812349995'},
    //         ...
    //     ],
    // }
}

NgxReportModule Configuration

/**
 * NgxReport config
 */
export interface INgxReportStyle {
    /**
     * Farsi (Persian) font name
     * @type { string }
     * @optional 'Yekan'
     */
    faFont: string;

    /**
     * English font name
     * @type { string }
     * @optional 'Roboto, "Helvetica Neue", sans-serif'
     */
    enFont: string;

    /**
     * Font size
     * @type { string }
     * @optional '12px'
     */
    faSize: string;

    /**
     * Material icon font name
     * @type { string }
     * @optional 'Material Icons Outlined'
     */
    iconFont: string;

    /**
     * Material icon font size
     * @type { string }
     * @optional '16px'
     */
    iconSize: string;

    /**
     * Report inputs primary color
     * @type { string }
     * @optional 'rgb(29, 91, 116)'
     */
    primaryColor: string;

    /**
     * Report inputs warn color
     * @type { string }
     * @optional 'rgb(255, 49, 27)'
     */
    warnColor: string;

    /**
     * Report inputs border color
     * @type { string }
     * @optional 'rgb(187, 206, 213)'
     */
    borderColor: string;

    /**
     * Report inputs background color
     * @type { string }
     * @optional 'rgb(232, 239, 241)'
     */
    backgroundColor: string;
}

NgxReportModule Input Types

  • BANK-CARD
  • CHECKBOX
  • DATE
  • DOMAIN
  • EMAIL
  • IP
  • MOBILE
  • MULTI-SELECT
  • NATIONAL-CODE
  • NUMBER
  • SELECT
  • TEXT
  • TEXTAREA
  • URL

NgxReportModule Preview

alt text

4.1.11

3 days ago

4.1.7

19 days ago

4.1.4

25 days ago

4.1.5

24 days ago

4.1.3

28 days ago

4.0.2

1 month ago

4.0.0

1 month ago

3.8.16

1 month ago

3.8.12

2 months ago

3.8.11

2 months ago

3.8.10

2 months ago

3.8.7

3 months ago

3.8.4

4 months ago

3.5.13

6 months ago

3.5.12

6 months ago

3.5.10

7 months ago

3.5.6

7 months ago

3.5.4

7 months ago

3.5.8

7 months ago

3.2.1

10 months ago

3.2.0

10 months ago

3.4.2

8 months ago

3.2.4

9 months ago

3.4.1

8 months ago

3.4.11

7 months ago

3.4.7

8 months ago

3.8.2

6 months ago

3.4.5

8 months ago

3.2.7

8 months ago

3.4.9

8 months ago

3.3.3

8 months ago

3.1.3

11 months ago

3.1.2

11 months ago

3.1.1

11 months ago

3.1.0

11 months ago

3.0.2

11 months ago

3.0.1

12 months ago

3.0.0

12 months ago

2.7.3

1 year ago

2.7.2

1 year ago

2.7.1

1 year ago

2.7.0

1 year ago

2.6.1

1 year ago

2.6.0

1 year ago

2.5.1

1 year ago

2.5.0

1 year ago

2.4.0

1 year ago

2.3.14

1 year ago

2.3.13

1 year ago

2.3.12

1 year ago

2.3.11

1 year ago

2.3.10

1 year ago

2.3.9

1 year ago

2.3.8

1 year ago

2.3.7

1 year ago

2.3.6

1 year ago

2.3.5

1 year ago

2.3.4

1 year ago

2.3.3

1 year ago

2.3.2

1 year ago

2.3.1

1 year ago

2.3.0

1 year ago

2.2.6

1 year ago

2.2.5

1 year ago

2.2.4

1 year ago

2.2.3

1 year ago

2.2.2

1 year ago

2.2.1

1 year ago

2.2.0

1 year ago

2.1.0

1 year ago

2.0.0

1 year ago

1.6.2

1 year ago

1.6.1

1 year ago

1.6.0

1 year ago

1.5.0

1 year ago

1.4.1

1 year ago

1.4.0

1 year ago

1.3.0

1 year ago

1.2.0

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.0

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago