@dynamic-field-kit/angular 1.2.0 → 1.2.2
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 +21 -8
- package/package.json +49 -42
- package/dist/README.md +0 -123
- package/dist/package.json +0 -50
- /package/{dist/components → components}/BaseInput.d.ts +0 -0
- /package/{dist/components → components}/DynamicInput.d.ts +0 -0
- /package/{dist/components → components}/FieldInput.d.ts +0 -0
- /package/{dist/components → components}/MultiFieldInput.d.ts +0 -0
- /package/{dist/esm2020 → esm2020}/components/BaseInput.mjs +0 -0
- /package/{dist/esm2020 → esm2020}/components/DynamicInput.mjs +0 -0
- /package/{dist/esm2020 → esm2020}/components/FieldInput.mjs +0 -0
- /package/{dist/esm2020 → esm2020}/components/MultiFieldInput.mjs +0 -0
- /package/{dist/esm2020 → esm2020}/dynamic-field-kit-angular.mjs +0 -0
- /package/{dist/esm2020 → esm2020}/layout/defaultLayouts.mjs +0 -0
- /package/{dist/esm2020 → esm2020}/layout/index.mjs +0 -0
- /package/{dist/esm2020 → esm2020}/lib/dynamic-field-kit.module.mjs +0 -0
- /package/{dist/esm2020 → esm2020}/public-api.mjs +0 -0
- /package/{dist/esm2020 → esm2020}/types/layout.mjs +0 -0
- /package/{dist/fesm2015 → fesm2015}/dynamic-field-kit-angular.mjs +0 -0
- /package/{dist/fesm2015 → fesm2015}/dynamic-field-kit-angular.mjs.map +0 -0
- /package/{dist/fesm2020 → fesm2020}/dynamic-field-kit-angular.mjs +0 -0
- /package/{dist/fesm2020 → fesm2020}/dynamic-field-kit-angular.mjs.map +0 -0
- /package/{dist/index.d.ts → index.d.ts} +0 -0
- /package/{dist/layout → layout}/defaultLayouts.d.ts +0 -0
- /package/{dist/layout → layout}/index.d.ts +0 -0
- /package/{dist/lib → lib}/dynamic-field-kit.module.d.ts +0 -0
- /package/{dist/public-api.d.ts → public-api.d.ts} +0 -0
- /package/{dist/types → types}/layout.d.ts +0 -0
package/README.md
CHANGED
|
@@ -7,10 +7,12 @@ This package exposes Angular components and a convenience NgModule that integrat
|
|
|
7
7
|
Quick overview
|
|
8
8
|
- Exports `DynamicInput`, `FieldInput`, `MultiFieldInput`, layout components, and `DynamicFieldKitModule`.
|
|
9
9
|
- Uses the shared `fieldRegistry` from `@dynamic-field-kit/core` to resolve Angular field renderers at runtime.
|
|
10
|
-
- Can be consumed
|
|
10
|
+
- Can be consumed in two modes: npm package mode for external apps, or local development mode from `packages/angular/dist`.
|
|
11
11
|
- `MultiFieldInput` currently supports `column`, `row`, and `grid` layout values.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Mode 1: npm package mode
|
|
14
|
+
|
|
15
|
+
Use this mode for normal Angular apps outside this monorepo.
|
|
14
16
|
|
|
15
17
|
1. Install the packages:
|
|
16
18
|
|
|
@@ -82,8 +84,11 @@ export class AppComponent {
|
|
|
82
84
|
}
|
|
83
85
|
```
|
|
84
86
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
Mode 2: local development mode
|
|
88
|
+
|
|
89
|
+
Use this mode only when developing inside this monorepo or when intentionally linking a local build.
|
|
90
|
+
|
|
91
|
+
1. Point your Angular app at the built package output instead of importing from `src/`:
|
|
87
92
|
|
|
88
93
|
```json
|
|
89
94
|
{
|
|
@@ -94,7 +99,14 @@ Local development
|
|
|
94
99
|
}
|
|
95
100
|
```
|
|
96
101
|
|
|
97
|
-
|
|
102
|
+
2. Build the local Angular package before running the app:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
cd packages/angular
|
|
106
|
+
npm run build
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
3. When using a local `file:` dependency on Windows or via symlinked installs, set `preserveSymlinks: true` in the Angular builder options to avoid runtime issues with linked packages.
|
|
98
110
|
|
|
99
111
|
Build & publish
|
|
100
112
|
- Build locally with `ng-packagr`:
|
|
@@ -108,8 +120,9 @@ npm run build
|
|
|
108
120
|
|
|
109
121
|
```bash
|
|
110
122
|
cd packages/angular
|
|
111
|
-
npm
|
|
112
|
-
|
|
123
|
+
npm run build
|
|
124
|
+
npm run publish:dist
|
|
125
|
+
```
|
|
113
126
|
|
|
114
127
|
Notes & caveats
|
|
115
128
|
- Register Angular component classes in `fieldRegistry`. Do not register React or Vue renderers when using the Angular adapter.
|
|
@@ -119,5 +132,5 @@ Notes & caveats
|
|
|
119
132
|
- Supported `layout` values are `column`, `row`, and `grid`.
|
|
120
133
|
|
|
121
134
|
Examples & docs
|
|
122
|
-
- See `example/angular-instructions.md` for detailed wiring steps.
|
|
135
|
+
- See `example/angular-app/angular-instructions.md` for detailed wiring steps.
|
|
123
136
|
- Try the local scaffold at `example/angular-app/` for a hands-on demo.
|
package/package.json
CHANGED
|
@@ -1,42 +1,49 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@dynamic-field-kit/angular",
|
|
3
|
-
"version": "1.2.
|
|
4
|
-
"description": "Angular renderer for dynamic-field-kit",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"private": false,
|
|
7
|
-
"sideEffects": false,
|
|
8
|
-
"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"@angular/
|
|
13
|
-
"@
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@dynamic-field-kit/angular",
|
|
3
|
+
"version": "1.2.2",
|
|
4
|
+
"description": "Angular renderer for dynamic-field-kit",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"private": false,
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"main": "fesm2015/dynamic-field-kit-angular.mjs",
|
|
9
|
+
"types": "index.d.ts",
|
|
10
|
+
"peerDependencies": {
|
|
11
|
+
"@angular/common": ">=13 <22",
|
|
12
|
+
"@angular/core": ">=13 <22",
|
|
13
|
+
"@dynamic-field-kit/core": "^1.0.7"
|
|
14
|
+
},
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/vannt-dev/dynamic-field-kit.git"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [
|
|
23
|
+
"dynamic-field",
|
|
24
|
+
"dynamic-field-kit",
|
|
25
|
+
"dynamic-field-kit/angular"
|
|
26
|
+
],
|
|
27
|
+
"module": "fesm2015/dynamic-field-kit-angular.mjs",
|
|
28
|
+
"es2020": "fesm2020/dynamic-field-kit-angular.mjs",
|
|
29
|
+
"esm2020": "esm2020/dynamic-field-kit-angular.mjs",
|
|
30
|
+
"fesm2020": "fesm2020/dynamic-field-kit-angular.mjs",
|
|
31
|
+
"fesm2015": "fesm2015/dynamic-field-kit-angular.mjs",
|
|
32
|
+
"typings": "index.d.ts",
|
|
33
|
+
"exports": {
|
|
34
|
+
"./package.json": {
|
|
35
|
+
"default": "./package.json"
|
|
36
|
+
},
|
|
37
|
+
".": {
|
|
38
|
+
"types": "./index.d.ts",
|
|
39
|
+
"esm2020": "./esm2020/dynamic-field-kit-angular.mjs",
|
|
40
|
+
"es2020": "./fesm2020/dynamic-field-kit-angular.mjs",
|
|
41
|
+
"es2015": "./fesm2015/dynamic-field-kit-angular.mjs",
|
|
42
|
+
"node": "./fesm2015/dynamic-field-kit-angular.mjs",
|
|
43
|
+
"default": "./fesm2020/dynamic-field-kit-angular.mjs"
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"tslib": "^2.3.0"
|
|
48
|
+
}
|
|
49
|
+
}
|
package/dist/README.md
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
# @dynamic-field-kit/angular
|
|
2
|
-
|
|
3
|
-
Lightweight Angular adapters for `@dynamic-field-kit/core`.
|
|
4
|
-
|
|
5
|
-
This package exposes Angular components and a convenience NgModule that integrate with the shared `fieldRegistry` from `@dynamic-field-kit/core`.
|
|
6
|
-
|
|
7
|
-
Quick overview
|
|
8
|
-
- Exports `DynamicInput`, `FieldInput`, `MultiFieldInput`, layout components, and `DynamicFieldKitModule`.
|
|
9
|
-
- Uses the shared `fieldRegistry` from `@dynamic-field-kit/core` to resolve Angular field renderers at runtime.
|
|
10
|
-
- Can be consumed as a packaged library, or linked locally from `packages/angular/dist` during development.
|
|
11
|
-
- `MultiFieldInput` currently supports `column`, `row`, and `grid` layout values.
|
|
12
|
-
|
|
13
|
-
Usage (consumer Angular app)
|
|
14
|
-
|
|
15
|
-
1. Install the packages:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm install @dynamic-field-kit/core @dynamic-field-kit/angular
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
2. Import `DynamicFieldKitModule` in your Angular module:
|
|
22
|
-
|
|
23
|
-
```ts
|
|
24
|
-
import { DynamicFieldKitModule } from '@dynamic-field-kit/angular'
|
|
25
|
-
|
|
26
|
-
@NgModule({
|
|
27
|
-
imports: [BrowserModule, DynamicFieldKitModule],
|
|
28
|
-
})
|
|
29
|
-
export class AppModule {}
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
3. Register your Angular field components in the shared registry before bootstrap:
|
|
33
|
-
|
|
34
|
-
```ts
|
|
35
|
-
// src/main.ts
|
|
36
|
-
import 'zone.js'
|
|
37
|
-
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'
|
|
38
|
-
import { fieldRegistry } from '@dynamic-field-kit/angular'
|
|
39
|
-
import { AppModule } from './app/app.module'
|
|
40
|
-
import { TextFieldComponent } from './app/components/text-field.component'
|
|
41
|
-
import { NumberFieldComponent } from './app/components/number-field.component'
|
|
42
|
-
|
|
43
|
-
fieldRegistry.register('text', TextFieldComponent as any)
|
|
44
|
-
fieldRegistry.register('number', NumberFieldComponent as any)
|
|
45
|
-
|
|
46
|
-
platformBrowserDynamic()
|
|
47
|
-
.bootstrapModule(AppModule)
|
|
48
|
-
.catch((err) => console.error(err))
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
4. Render fields in a template:
|
|
52
|
-
|
|
53
|
-
```html
|
|
54
|
-
<dfk-multi-field-input
|
|
55
|
-
[fieldDescriptions]="fields"
|
|
56
|
-
[properties]="data"
|
|
57
|
-
(onChange)="onChange($event)"
|
|
58
|
-
></dfk-multi-field-input>
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
5. Example component state:
|
|
62
|
-
|
|
63
|
-
```ts
|
|
64
|
-
import { Component } from '@angular/core'
|
|
65
|
-
import { FieldDescription } from '@dynamic-field-kit/core'
|
|
66
|
-
|
|
67
|
-
@Component({
|
|
68
|
-
selector: 'app-root',
|
|
69
|
-
templateUrl: './app.component.html',
|
|
70
|
-
})
|
|
71
|
-
export class AppComponent {
|
|
72
|
-
fields: FieldDescription[] = [
|
|
73
|
-
{ name: 'name', type: 'text', label: 'Name' },
|
|
74
|
-
{ name: 'age', type: 'number', label: 'Age' },
|
|
75
|
-
]
|
|
76
|
-
|
|
77
|
-
data: any = {}
|
|
78
|
-
|
|
79
|
-
onChange(data: any) {
|
|
80
|
-
this.data = data
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
Local development
|
|
86
|
-
- During local development, point your Angular app at the built package output instead of importing from `src/`:
|
|
87
|
-
|
|
88
|
-
```json
|
|
89
|
-
{
|
|
90
|
-
"dependencies": {
|
|
91
|
-
"@dynamic-field-kit/core": "file:../../packages/core",
|
|
92
|
-
"@dynamic-field-kit/angular": "file:../../packages/angular/dist"
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
- When using a local `file:` dependency on Windows or via symlinked installs, set `preserveSymlinks: true` in the Angular builder options to avoid runtime issues with linked packages.
|
|
98
|
-
|
|
99
|
-
Build & publish
|
|
100
|
-
- Build locally with `ng-packagr`:
|
|
101
|
-
|
|
102
|
-
```bash
|
|
103
|
-
cd packages/angular
|
|
104
|
-
npm run build
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
- Publish to npm:
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
cd packages/angular
|
|
111
|
-
npm publish --access public
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
Notes & caveats
|
|
115
|
-
- Register Angular component classes in `fieldRegistry`. Do not register React or Vue renderers when using the Angular adapter.
|
|
116
|
-
- `DynamicFieldKitModule` is the recommended integration path for consumer apps.
|
|
117
|
-
- Standalone exports are still available for advanced composition, but most apps should start with the module.
|
|
118
|
-
- Text fields default to an empty string when no value is present, so empty controls render as blank instead of `undefined`.
|
|
119
|
-
- Supported `layout` values are `column`, `row`, and `grid`.
|
|
120
|
-
|
|
121
|
-
Examples & docs
|
|
122
|
-
- See `example/angular-instructions.md` for detailed wiring steps.
|
|
123
|
-
- Try the local scaffold at `example/angular-app/` for a hands-on demo.
|
package/dist/package.json
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@dynamic-field-kit/angular",
|
|
3
|
-
"version": "1.2.0",
|
|
4
|
-
"description": "Angular renderer for dynamic-field-kit",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"private": false,
|
|
7
|
-
"sideEffects": false,
|
|
8
|
-
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
],
|
|
11
|
-
"peerDependencies": {
|
|
12
|
-
"@angular/common": ">=13 <22",
|
|
13
|
-
"@angular/core": ">=13 <22",
|
|
14
|
-
"@dynamic-field-kit/core": "^1.0.7"
|
|
15
|
-
},
|
|
16
|
-
"publishConfig": {
|
|
17
|
-
"access": "public"
|
|
18
|
-
},
|
|
19
|
-
"repository": {
|
|
20
|
-
"type": "git",
|
|
21
|
-
"url": "git+https://github.com/vannt-dev/dynamic-field-kit.git"
|
|
22
|
-
},
|
|
23
|
-
"keywords": [
|
|
24
|
-
"dynamic-field",
|
|
25
|
-
"dynamic-field-kit",
|
|
26
|
-
"dynamic-field-kit/angular"
|
|
27
|
-
],
|
|
28
|
-
"module": "fesm2015/dynamic-field-kit-angular.mjs",
|
|
29
|
-
"es2020": "fesm2020/dynamic-field-kit-angular.mjs",
|
|
30
|
-
"esm2020": "esm2020/dynamic-field-kit-angular.mjs",
|
|
31
|
-
"fesm2020": "fesm2020/dynamic-field-kit-angular.mjs",
|
|
32
|
-
"fesm2015": "fesm2015/dynamic-field-kit-angular.mjs",
|
|
33
|
-
"typings": "index.d.ts",
|
|
34
|
-
"exports": {
|
|
35
|
-
"./package.json": {
|
|
36
|
-
"default": "./package.json"
|
|
37
|
-
},
|
|
38
|
-
".": {
|
|
39
|
-
"types": "./index.d.ts",
|
|
40
|
-
"esm2020": "./esm2020/dynamic-field-kit-angular.mjs",
|
|
41
|
-
"es2020": "./fesm2020/dynamic-field-kit-angular.mjs",
|
|
42
|
-
"es2015": "./fesm2015/dynamic-field-kit-angular.mjs",
|
|
43
|
-
"node": "./fesm2015/dynamic-field-kit-angular.mjs",
|
|
44
|
-
"default": "./fesm2020/dynamic-field-kit-angular.mjs"
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
"dependencies": {
|
|
48
|
-
"tslib": "^2.3.0"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|