@dynamic-field-kit/angular 1.2.0 → 1.2.1
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 +3 -2
- package/package.json +47 -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
|
@@ -108,8 +108,9 @@ npm run build
|
|
|
108
108
|
|
|
109
109
|
```bash
|
|
110
110
|
cd packages/angular
|
|
111
|
-
npm
|
|
112
|
-
|
|
111
|
+
npm run build
|
|
112
|
+
npm run publish:dist
|
|
113
|
+
```
|
|
113
114
|
|
|
114
115
|
Notes & caveats
|
|
115
116
|
- Register Angular component classes in `fieldRegistry`. Do not register React or Vue renderers when using the Angular adapter.
|
package/package.json
CHANGED
|
@@ -1,42 +1,47 @@
|
|
|
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
|
-
|
|
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.1",
|
|
4
|
+
"description": "Angular renderer for dynamic-field-kit",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"private": false,
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"peerDependencies": {
|
|
9
|
+
"@angular/common": ">=13 <22",
|
|
10
|
+
"@angular/core": ">=13 <22",
|
|
11
|
+
"@dynamic-field-kit/core": "^1.0.7"
|
|
12
|
+
},
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/vannt-dev/dynamic-field-kit.git"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"dynamic-field",
|
|
22
|
+
"dynamic-field-kit",
|
|
23
|
+
"dynamic-field-kit/angular"
|
|
24
|
+
],
|
|
25
|
+
"module": "fesm2015/dynamic-field-kit-angular.mjs",
|
|
26
|
+
"es2020": "fesm2020/dynamic-field-kit-angular.mjs",
|
|
27
|
+
"esm2020": "esm2020/dynamic-field-kit-angular.mjs",
|
|
28
|
+
"fesm2020": "fesm2020/dynamic-field-kit-angular.mjs",
|
|
29
|
+
"fesm2015": "fesm2015/dynamic-field-kit-angular.mjs",
|
|
30
|
+
"typings": "index.d.ts",
|
|
31
|
+
"exports": {
|
|
32
|
+
"./package.json": {
|
|
33
|
+
"default": "./package.json"
|
|
34
|
+
},
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./index.d.ts",
|
|
37
|
+
"esm2020": "./esm2020/dynamic-field-kit-angular.mjs",
|
|
38
|
+
"es2020": "./fesm2020/dynamic-field-kit-angular.mjs",
|
|
39
|
+
"es2015": "./fesm2015/dynamic-field-kit-angular.mjs",
|
|
40
|
+
"node": "./fesm2015/dynamic-field-kit-angular.mjs",
|
|
41
|
+
"default": "./fesm2020/dynamic-field-kit-angular.mjs"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"tslib": "^2.3.0"
|
|
46
|
+
}
|
|
47
|
+
}
|
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
|