npm package: @qbs-origin/origin-form
Description: Angular library for dynamic form generation with formly integration.
Latest version: 0.8.12

# @qbs-origin/origin-form

Angular library for dynamic form generation with formly integration.

## Installation

### Using Angular CLI (Recommended)

```bash
ng add @qbs-origin/origin-form
```

This will automatically install the package and all required peer dependencies.

### Using npm

```bash
npm install @qbs-origin/origin-form
```

## Dependencies

The following packages are installed automatically with this library:
- `@qbs-origin/sign-lib` - Digital signature functionality
- `@ekyc_qoobiss/qbs-ect-cmp` - eKYC components

## Peer Dependencies

This library requires the following peer dependencies (you need to install them in your project):

```bash
npm install @angular/cdk @angular/material @ngx-formly/core @ngx-formly/material @ngx-translate/core @ngx-translate/http-loader @microsoft/signalr file-saver lodash ng2-pdf-viewer ngx-markdown ngx-scrollbar ts-md5 uuid
```

## Usage

Import the `OriginFormModule` in your Angular module:

```typescript
import { OriginFormModule } from '@qbs-origin/origin-form';

@NgModule({
  imports: [
    OriginFormModule
  ]
})
export class AppModule { }
```

## Component Usage

Use the `OriginFormComponent` in your template:

```html
<app-origin-form
  [configComponent]="config"
  [configUuid]="uuid"
  [currentLanguageIso]="'en'"
  [showLanguageSelector]="true"
  (event)="onFormEvent($event)">
</app-origin-form>
```

## Configuration

### InputConfig Interface

The `configComponent` input accepts an `InputConfig` object:

```typescript
import { InputConfig } from '@qbs-origin/origin-form';

const config: InputConfig = {
  Token: 'your-auth-token',
  RefreshToken: 'your-refresh-token',
  BaseUrlGateway: 'https://api.example.com/gateway',
  BaseUrlAuthenticator: 'https://api.example.com/auth',
  BaseUrlInfrastructure: 'https://api.example.com/infrastructure',
  BaseUrlPublicInfrastructure: 'https://api.example.com/public',
  BaseUrlDocuments: 'https://api.example.com/documents',
  BaseUrlBusiness: 'https://api.example.com/business',
  BaseUrlSmartAccounts: 'https://api.example.com/smart-accounts',
  ClientId: 'your-client-id'
};
```

### Component Inputs

| Input | Type | Description |
|-------|------|-------------|
| `configComponent` | `InputConfig` | Configuration object with API URLs and authentication |
| `configUuid` | `string` | Unique identifier for the form configuration |
| `currentStepId` | `string` | Current step identifier (optional) |
| `appModel` | `FormModel` | Form model data (optional) |
| `currentLanguageIso` | `string` | Language ISO code (e.g., 'en', 'ro') |
| `showLanguageSelector` | `boolean` | Show/hide language selector (default: true) |
| `showDisplayMode` | `boolean` | Enable display mode (default: false) |
| `isDemoMode` | `boolean` | Enable demo mode (default: false) |
| `fillData` | `any` | Pre-fill form data (optional) |
| `env` | `string` | Environment type (optional) |

### Component Outputs

| Output | Type | Description |
|--------|------|-------------|
| `event` | `EventEmitter` | Emits form events (success, error, step changes, etc.) |

## Exported Services

The library exports the following services that can be injected:

- `ConfigService` - Manage application configuration
- `OriginFormAuthService` - Handle authentication
- `ApplicationDataService` - Manage application data
- `FormsService` - Form operations
- `LanguageService` - Language management
- `DictionaryService` - Dictionary/lookup data
- `TranslationService` - Translations
- `DialogService` - Dialog/modal management

## License

Proprietary - Qoobiss