@ng-forge/dynamic-forms-ionic 0.1.0

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/README.md ADDED
@@ -0,0 +1,96 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/ng-forge/ng-forge/main/logo-light.svg" alt="ng-forge logo" width="400"/>
3
+ </p>
4
+
5
+ # @ng-forge/dynamic-forms-ionic
6
+
7
+ Ionic field components for ng-forge dynamic forms.
8
+
9
+ [![npm version](https://img.shields.io/npm/v/@ng-forge/dynamic-forms-ionic.svg)](https://www.npmjs.com/package/@ng-forge/dynamic-forms-ionic)
10
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
11
+
12
+ ## Installation
13
+
14
+ ```bash
15
+ npm install @ng-forge/dynamic-forms @ng-forge/dynamic-forms-ionic @ionic/angular
16
+ ```
17
+
18
+ ## Setup
19
+
20
+ ```scss
21
+ // styles.scss
22
+ @import '@ionic/angular/css/core.css';
23
+ @import '@ionic/angular/css/normalize.css';
24
+ @import '@ionic/angular/css/structure.css';
25
+ @import '@ionic/angular/css/typography.css';
26
+ ```
27
+
28
+ ```typescript
29
+ // app.config.ts
30
+ import { provideDynamicForm } from '@ng-forge/dynamic-forms';
31
+ import { withIonicFields } from '@ng-forge/dynamic-forms-ionic';
32
+ import { provideIonicAngular } from '@ionic/angular/standalone';
33
+
34
+ export const appConfig: ApplicationConfig = {
35
+ providers: [provideIonicAngular({ mode: 'md' }), provideDynamicForm(...withIonicFields())],
36
+ };
37
+ ```
38
+
39
+ ## Usage
40
+
41
+ ```typescript
42
+ import { DynamicForm, type FormConfig, type InferFormValue } from '@ng-forge/dynamic-forms';
43
+
44
+ @Component({
45
+ imports: [DynamicForm],
46
+ template: `<form [dynamic-form]="config" (submitted)="onSubmit($event)"></form>`,
47
+ })
48
+ export class ContactFormComponent {
49
+ config = {
50
+ fields: [
51
+ { key: 'name', type: 'input', value: '', label: 'Name', required: true, props: { fill: 'outline', labelPlacement: 'stacked' } },
52
+ {
53
+ key: 'email',
54
+ type: 'input',
55
+ value: '',
56
+ label: 'Email',
57
+ required: true,
58
+ email: true,
59
+ props: { fill: 'outline', labelPlacement: 'stacked' },
60
+ },
61
+ { type: 'submit', key: 'submit', label: 'Send', props: { color: 'primary', expand: 'block' } },
62
+ ],
63
+ } as const satisfies FormConfig;
64
+
65
+ onSubmit(value: InferFormValue<typeof this.config.fields>) {
66
+ console.log('Form submitted:', value);
67
+ }
68
+ }
69
+ ```
70
+
71
+ ## Global Configuration
72
+
73
+ ```typescript
74
+ provideDynamicForm(
75
+ ...withIonicFields({
76
+ fill: 'outline',
77
+ labelPlacement: 'floating',
78
+ color: 'primary',
79
+ }),
80
+ );
81
+ ```
82
+
83
+ ## Field Types
84
+
85
+ Input, Textarea, Select, Checkbox, Radio, Toggle, Datepicker, Slider, Multi-Checkbox, Button, Submit, Next, Previous
86
+
87
+ ## Documentation
88
+
89
+ - [Ionic Integration](https://ng-forge.com/dynamic-forms/ui-libs-integrations/ionic)
90
+ - [Field Types](https://ng-forge.com/dynamic-forms/core/field-types)
91
+ - [Validation](https://ng-forge.com/dynamic-forms/core/validation)
92
+ - [Conditional Logic](https://ng-forge.com/dynamic-forms/core/conditional-logic)
93
+
94
+ ## License
95
+
96
+ MIT © ng-forge