@dynamic-field-kit/angular 1.2.4 → 1.2.10

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.
Files changed (55) hide show
  1. package/README.md +54 -46
  2. package/dist/README.md +126 -0
  3. package/dist/components/BaseInput.d.ts +22 -0
  4. package/{components → dist/components}/DynamicInput.d.ts +24 -28
  5. package/dist/components/FieldInput.d.ts +14 -0
  6. package/{components → dist/components}/MultiFieldInput.d.ts +23 -23
  7. package/dist/esm2022/components/BaseInput.mjs +60 -0
  8. package/dist/esm2022/components/DynamicInput.mjs +162 -0
  9. package/dist/esm2022/components/FieldInput.mjs +71 -0
  10. package/dist/esm2022/components/MultiFieldInput.mjs +85 -0
  11. package/{esm2020 → dist/esm2022}/dynamic-field-kit-angular.mjs +4 -4
  12. package/dist/esm2022/layout/defaultLayouts.mjs +67 -0
  13. package/{esm2020 → dist/esm2022}/layout/index.mjs +2 -2
  14. package/dist/esm2022/lib/dynamic-field-kit.module.mjs +52 -0
  15. package/{esm2020 → dist/esm2022}/public-api.mjs +14 -14
  16. package/{esm2020 → dist/esm2022}/types/layout.mjs +2 -2
  17. package/{fesm2020 → dist/fesm2022}/dynamic-field-kit-angular.mjs +434 -337
  18. package/dist/fesm2022/dynamic-field-kit-angular.mjs.map +1 -0
  19. package/{index.d.ts → dist/index.d.ts} +5 -5
  20. package/{layout → dist/layout}/defaultLayouts.d.ts +13 -13
  21. package/dist/layout/index.d.ts +1 -0
  22. package/{lib → dist/lib}/dynamic-field-kit.module.d.ts +11 -11
  23. package/{public-api.d.ts → dist/public-api.d.ts} +9 -9
  24. package/dist/types/layout.d.ts +1 -0
  25. package/ng-package.json +7 -0
  26. package/package.json +31 -28
  27. package/src/adapters/tailwind.ts +13 -0
  28. package/src/components/BaseInput.ts +31 -0
  29. package/src/components/DynamicInput.ts +188 -0
  30. package/src/components/FieldInput.ts +49 -0
  31. package/src/components/MultiFieldInput.ts +75 -0
  32. package/src/components/imports.ts +3 -0
  33. package/src/examples/index.ts +4 -0
  34. package/src/examples/registerExample.ts +7 -0
  35. package/src/examples/text-field.component.ts +18 -0
  36. package/src/layout/defaultLayouts.ts +38 -0
  37. package/src/layout/index.ts +1 -0
  38. package/src/lib/dynamic-field-kit.module.ts +29 -0
  39. package/src/public-api.ts +24 -0
  40. package/src/types/layout.ts +1 -0
  41. package/src/types.ts +1 -0
  42. package/tsconfig.json +13 -0
  43. package/components/BaseInput.d.ts +0 -22
  44. package/components/FieldInput.d.ts +0 -14
  45. package/esm2020/components/BaseInput.mjs +0 -46
  46. package/esm2020/components/DynamicInput.mjs +0 -146
  47. package/esm2020/components/FieldInput.mjs +0 -66
  48. package/esm2020/components/MultiFieldInput.mjs +0 -79
  49. package/esm2020/layout/defaultLayouts.mjs +0 -43
  50. package/esm2020/lib/dynamic-field-kit.module.mjs +0 -20
  51. package/fesm2015/dynamic-field-kit-angular.mjs +0 -393
  52. package/fesm2015/dynamic-field-kit-angular.mjs.map +0 -1
  53. package/fesm2020/dynamic-field-kit-angular.mjs.map +0 -1
  54. package/layout/index.d.ts +0 -1
  55. package/types/layout.d.ts +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-field-kit-angular.mjs","sources":["../../src/components/BaseInput.ts","../../src/components/DynamicInput.ts","../../src/components/FieldInput.ts","../../src/components/MultiFieldInput.ts","../../src/layout/defaultLayouts.ts","../../src/lib/dynamic-field-kit.module.ts","../../src/public-api.ts","../../src/dynamic-field-kit-angular.ts"],"sourcesContent":["import {\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n Output,\n} from '@angular/core';\n\n@Component({\n template: '',\n})\nexport abstract class BaseInputComponent {\n @Input() value?: any;\n @Input() label?: string;\n @Input() placeholder?: string;\n @Input() required?: boolean;\n @Input() disabled?: boolean;\n @Input() options?: any[];\n @Input() className?: string;\n @Input() description?: string;\n @Input() errorMessage?: string;\n @Input() acceptFile?: string;\n @Input() maxLength?: number;\n @Input() minNumber?: number;\n @Input() maxNumber?: number;\n // Add more from mplis as needed\n\n @Output() valueChange = new EventEmitter<any>();\n\n constructor(protected cdr: ChangeDetectorRef) {}\n}\n","import { CommonModule } from '@angular/common';\nimport {\n Component,\n ComponentRef,\n Input,\n Output,\n EventEmitter,\n ViewChild,\n ViewContainerRef,\n OnChanges,\n AfterViewInit,\n OnDestroy,\n SimpleChanges,\n Type,\n SimpleChange,\n} from '@angular/core';\nimport { fieldRegistry, FieldTypeKey } from '@dynamic-field-kit/core';\nimport { Subscription } from 'rxjs';\nimport { BaseInputComponent } from './BaseInput';\n\n@Component({\n selector: 'dfk-dynamic-input',\n standalone: true,\n imports: [CommonModule],\n template: `<div #host style=\"display: contents;\"></div>`,\n})\nexport class DynamicInput\n extends BaseInputComponent\n implements OnChanges, AfterViewInit, OnDestroy\n{\n @Input() type!: FieldTypeKey;\n @Output() override valueChange = new EventEmitter<any>();\n @Output() onChange = new EventEmitter<any>(); // backward compat\n\n @ViewChild('host', { read: ViewContainerRef, static: false })\n host!: ViewContainerRef;\n private compRef?: ComponentRef<any>;\n private inputInstance?: any;\n private subscriptions: Subscription[] = [];\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes['type'] && !changes['type'].firstChange && this.host) {\n this.render();\n return;\n }\n\n if (this.inputInstance) {\n this.applyKnownProps(this.inputInstance);\n\n const childChanges: SimpleChanges = {};\n for (const prop in changes) {\n childChanges[prop] = new SimpleChange(\n changes[prop].previousValue,\n changes[prop].currentValue,\n changes[prop].firstChange\n );\n }\n\n this.inputInstance.ngOnChanges?.(childChanges);\n this.compRef?.changeDetectorRef.detectChanges();\n } else if (this.host) {\n this.render();\n }\n }\n\n ngAfterViewInit() {\n this.render();\n }\n\n ngOnDestroy() {\n this.cleanupSubscriptions();\n this.cleanupRenderedComponent();\n }\n\n private cleanupSubscriptions() {\n this.subscriptions.forEach((s) => s.unsubscribe());\n this.subscriptions = [];\n }\n\n private render() {\n const Renderer = fieldRegistry.get(this.type as FieldTypeKey);\n this.cleanupRenderedComponent();\n this.cleanupSubscriptions();\n this.host.clear();\n if (!Renderer) {\n const el = document.createElement('div');\n el.textContent = `Unknown field type: ${this.type}`;\n this.host.element.nativeElement.appendChild(el);\n return;\n }\n\n try {\n const compType = Renderer as unknown as Type<any>;\n const compRef = this.host.createComponent(compType);\n const instance = compRef.instance;\n if (!instance) {\n throw new Error(`Failed to create instance for ${this.type}`);\n }\n\n this.applyKnownProps(instance);\n\n const subA = this.bindOutput(instance, 'valueChange');\n if (subA) {\n this.subscriptions.push(subA);\n }\n const subB = this.bindOutput(instance, 'onValueChange');\n if (subB) {\n this.subscriptions.push(subB);\n }\n\n instance.changeDetectorRef?.detectChanges();\n this.compRef = compRef;\n this.inputInstance = instance;\n compRef.changeDetectorRef.detectChanges();\n } catch (err) {\n // Fallback to function renderer\n try {\n const props: any = {\n value: this.value,\n onValueChange: (v: any) => this.emitValue(v),\n label: this.label,\n placeholder: this.placeholder,\n required: this.required,\n options: this.options,\n className: this.className,\n description: this.description,\n disabled: this.disabled,\n errorMessage: this.errorMessage,\n };\n const out = (Renderer as (props: unknown) => unknown)(props);\n if (typeof out === 'string') {\n const el = document.createElement('div');\n el.innerHTML = out;\n this.host.element.nativeElement.appendChild(el);\n }\n } catch (e) {\n const el = document.createElement('div');\n el.textContent = `Failed to render field: ${this.type}`;\n this.host.element.nativeElement.appendChild(el);\n }\n }\n }\n\n private applyKnownProps(instance: any) {\n const knownProps = [\n 'value',\n 'label',\n 'placeholder',\n 'required',\n 'disabled',\n 'options',\n 'className',\n 'description',\n 'errorMessage',\n ];\n for (const prop of knownProps) {\n if (prop in this && prop in instance) {\n instance[prop] = (this as any)[prop];\n }\n }\n }\n\n private bindOutput(\n instance: any,\n outputName: 'valueChange' | 'onValueChange'\n ): Subscription | undefined {\n const output = instance?.[outputName];\n if (!output || typeof output.subscribe !== 'function') {\n return;\n }\n\n const sub = (output as EventEmitter<any>).subscribe((value) => {\n this.emitValue(value);\n });\n return sub;\n }\n\n private emitValue(value: any) {\n this.valueChange.emit(value);\n this.onChange.emit(value);\n }\n\n private cleanupRenderedComponent() {\n this.compRef?.destroy();\n this.compRef = undefined;\n this.inputInstance = undefined;\n }\n}\n","import { NgIf } from '@angular/common';\nimport { Component, Input, Output, EventEmitter } from '@angular/core';\nimport { FieldDescription, Properties } from '@dynamic-field-kit/core';\nimport { DynamicInput } from './DynamicInput';\n\n@Component({\n selector: 'dfk-field-input',\n standalone: true,\n imports: [NgIf, DynamicInput],\n template: `\n <dfk-dynamic-input\n *ngIf=\"fieldDescription && renderInfos\"\n [type]=\"fieldDescription!.type\"\n [value]=\"getFieldValue()\"\n [label]=\"fieldDescription!.label\"\n [placeholder]=\"fieldDescription!.placeholder\"\n [required]=\"fieldDescription!.required\"\n [description]=\"fieldDescription!.description\"\n [options]=\"fieldDescription!.options\"\n [className]=\"fieldDescription!.className\"\n (valueChange)=\"\n onValueChangeField.emit({ value: $event, key: fieldDescription!.name })\n \"\n [disabled]=\"false\"\n [errorMessage]=\"''\"\n ></dfk-dynamic-input>\n `,\n})\nexport class FieldInput {\n @Input() fieldDescription?: FieldDescription;\n @Input() renderInfos?: Properties;\n @Output() onValueChangeField = new EventEmitter<{\n value: any;\n key: string;\n }>();\n\n getFieldValue() {\n if (!this.fieldDescription || !this.renderInfos) {\n return undefined;\n }\n\n const value = this.renderInfos[this.fieldDescription.name];\n if (value === undefined && this.fieldDescription.type === 'text') {\n return '';\n }\n\n return value;\n }\n}\n","import { NgClass, NgFor } from '@angular/common';\nimport {\n Component,\n Input,\n Output,\n EventEmitter,\n OnChanges,\n OnInit,\n SimpleChanges,\n} from '@angular/core';\nimport { FieldDescription, Properties } from '@dynamic-field-kit/core';\nimport { LayoutConfig } from '../types/layout';\nimport { FieldInput } from './FieldInput';\n\n@Component({\n selector: 'dfk-multi-field-input',\n standalone: true,\n imports: [NgClass, NgFor, FieldInput],\n template: `\n <div\n class=\"flex flex-col gap-3 p-4 border rounded-lg bg-gray-50\"\n [ngClass]=\"{\n 'flex-row gap-3': layout === 'row',\n 'grid grid-cols-2 gap-3': layout === 'grid'\n }\"\n >\n <dfk-field-input\n *ngFor=\"let field of visibleFields; trackBy: trackByFn\"\n [fieldDescription]=\"field\"\n [renderInfos]=\"data\"\n (onValueChangeField)=\"onFieldChange($event)\"\n ></dfk-field-input>\n </div>\n `,\n})\nexport class MultiFieldInput implements OnInit, OnChanges {\n @Input() fieldDescriptions: FieldDescription[] = [];\n @Input() properties?: Properties;\n @Output() onChange = new EventEmitter<Properties>();\n @Input() layout: LayoutConfig = 'column';\n\n data: Properties = {};\n visibleFields: FieldDescription[] = [];\n\n trackByFn(index: number, field: FieldDescription): string | number {\n return field.name || index;\n }\n\n ngOnInit() {\n this.init();\n }\n\n ngOnChanges(_changes: SimpleChanges) {\n this.init();\n }\n\n private init() {\n if (this.properties) {\n this.data = { ...this.properties };\n }\n this.updateVisibleFields();\n }\n\n private updateVisibleFields() {\n this.visibleFields = this.fieldDescriptions.filter(\n (f) => !f.appearCondition || f.appearCondition(this.data)\n );\n }\n\n onFieldChange(event: { value: any; key: string }) {\n this.data = { ...this.data, [event.key]: event.value };\n this.updateVisibleFields();\n this.onChange.emit(this.data);\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { Component } from '@angular/core';\n\n@Component({\n selector: 'dfk-column-layout',\n standalone: true,\n imports: [CommonModule],\n template: `<div\n style=\"display:flex;flex-direction:column;gap:var(--dfk-gap,12px)\"\n >\n <ng-content></ng-content>\n </div>`,\n})\nexport class ColumnLayout {}\n\n@Component({\n selector: 'dfk-row-layout',\n standalone: true,\n imports: [CommonModule],\n template: `<div\n style=\"display:flex;flex-direction:row;gap:var(--dfk-gap,12px)\"\n >\n <ng-content></ng-content>\n </div>`,\n})\nexport class RowLayout {}\n\n@Component({\n selector: 'dfk-grid-layout',\n standalone: true,\n imports: [CommonModule],\n template: `<div\n style=\"display:grid;grid-template-columns:repeat(var(--dfk-columns,2),1fr);gap:var(--dfk-gap,12px)\"\n >\n <ng-content></ng-content>\n </div>`,\n})\nexport class GridLayout {}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { DynamicInput } from '../components/DynamicInput';\nimport { FieldInput } from '../components/FieldInput';\nimport { MultiFieldInput } from '../components/MultiFieldInput';\n\nimport { ColumnLayout, RowLayout, GridLayout } from '../layout/defaultLayouts';\n\n@NgModule({\n imports: [\n CommonModule,\n DynamicInput,\n FieldInput,\n MultiFieldInput,\n ColumnLayout,\n RowLayout,\n GridLayout,\n ],\n exports: [\n DynamicInput,\n FieldInput,\n MultiFieldInput,\n ColumnLayout,\n RowLayout,\n GridLayout,\n ],\n})\nexport class DynamicFieldKitModule {}\n","// public-api.ts\r\n\r\n// Components\r\nexport * from './components/BaseInput';\r\nexport * from './components/DynamicInput';\r\nexport * from './components/FieldInput';\r\nexport * from './components/MultiFieldInput';\r\n\r\n// Layout\r\nexport * from './layout';\r\nexport * from './types/layout';\r\n\r\n// Module\r\nexport * from './lib/dynamic-field-kit.module';\r\n\r\n// Re-export types from core (only type, not export * )\r\nexport type {\r\n FieldTypeKey,\r\n FieldDescription,\r\n FieldRendererProps,\r\n} from '@dynamic-field-kit/core';\r\n\r\n// Optional: expose registry for advanced use cases, but not required for basic usage\r\nexport { fieldRegistry } from '@dynamic-field-kit/core';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAWsB,kBAAkB,CAAA;AAkBhB,IAAA,GAAA;AAjBb,IAAA,KAAK;AACL,IAAA,KAAK;AACL,IAAA,WAAW;AACX,IAAA,QAAQ;AACR,IAAA,QAAQ;AACR,IAAA,OAAO;AACP,IAAA,SAAS;AACT,IAAA,WAAW;AACX,IAAA,YAAY;AACZ,IAAA,UAAU;AACV,IAAA,SAAS;AACT,IAAA,SAAS;AACT,IAAA,SAAS;;AAGR,IAAA,WAAW,GAAG,IAAI,YAAY,EAAO;AAE/C,IAAA,WAAA,CAAsB,GAAsB,EAAA;QAAtB,IAAA,CAAA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,SAAS;AACT,YAAA,UAAU,aAGV,YAAY;YACZ,UAAU;YACV,eAAe;YACf,YAAY;YACZ,SAAS;YACT,UAAU,CAAA,EAAA,CAAA;AAGD,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,qBAAqB,YAjB9B,YAAY;YACZ,YAAY;YACZ,UAAU;YACV,eAAe;YACf,YAAY;YACZ,SAAS;YACT,UAAU,CAAA,EAAA,CAAA;;4FAWD,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAnBjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,YAAY;wBACZ,UAAU;wBACV,eAAe;wBACf,YAAY;wBACZ,SAAS;wBACT,UAAU;AACX,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,UAAU;wBACV,eAAe;wBACf,YAAY;wBACZ,SAAS;wBACT,UAAU;AACX,qBAAA;AACF,iBAAA;;;AC3BD;AAEA;;ACFA;;AAEG;;;;"}
@@ -1,5 +1,5 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- /// <amd-module name="@dynamic-field-kit/angular" />
5
- export * from './public-api';
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@dynamic-field-kit/angular" />
5
+ export * from './public-api';
@@ -1,13 +1,13 @@
1
- import * as i0 from "@angular/core";
2
- export declare class ColumnLayout {
3
- static ɵfac: i0.ɵɵFactoryDeclaration<ColumnLayout, never>;
4
- static ɵcmp: i0.ɵɵComponentDeclaration<ColumnLayout, "dfk-column-layout", never, {}, {}, never, ["*"], true, never>;
5
- }
6
- export declare class RowLayout {
7
- static ɵfac: i0.ɵɵFactoryDeclaration<RowLayout, never>;
8
- static ɵcmp: i0.ɵɵComponentDeclaration<RowLayout, "dfk-row-layout", never, {}, {}, never, ["*"], true, never>;
9
- }
10
- export declare class GridLayout {
11
- static ɵfac: i0.ɵɵFactoryDeclaration<GridLayout, never>;
12
- static ɵcmp: i0.ɵɵComponentDeclaration<GridLayout, "dfk-grid-layout", never, {}, {}, never, ["*"], true, never>;
13
- }
1
+ import * as i0 from "@angular/core";
2
+ export declare class ColumnLayout {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<ColumnLayout, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<ColumnLayout, "dfk-column-layout", never, {}, {}, never, ["*"], true, never>;
5
+ }
6
+ export declare class RowLayout {
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<RowLayout, never>;
8
+ static ɵcmp: i0.ɵɵComponentDeclaration<RowLayout, "dfk-row-layout", never, {}, {}, never, ["*"], true, never>;
9
+ }
10
+ export declare class GridLayout {
11
+ static ɵfac: i0.ɵɵFactoryDeclaration<GridLayout, never>;
12
+ static ɵcmp: i0.ɵɵComponentDeclaration<GridLayout, "dfk-grid-layout", never, {}, {}, never, ["*"], true, never>;
13
+ }
@@ -0,0 +1 @@
1
+ export * from './defaultLayouts';
@@ -1,11 +1,11 @@
1
- import * as i0 from "@angular/core";
2
- import * as i1 from "@angular/common";
3
- import * as i2 from "../components/DynamicInput";
4
- import * as i3 from "../components/FieldInput";
5
- import * as i4 from "../components/MultiFieldInput";
6
- import * as i5 from "../layout/defaultLayouts";
7
- export declare class DynamicFieldKitModule {
8
- static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFieldKitModule, never>;
9
- static ɵmod: i0.ɵɵNgModuleDeclaration<DynamicFieldKitModule, never, [typeof i1.CommonModule, typeof i2.DynamicInput, typeof i3.FieldInput, typeof i4.MultiFieldInput, typeof i5.ColumnLayout, typeof i5.RowLayout, typeof i5.GridLayout], [typeof i2.DynamicInput, typeof i3.FieldInput, typeof i4.MultiFieldInput, typeof i5.ColumnLayout, typeof i5.RowLayout, typeof i5.GridLayout]>;
10
- static ɵinj: i0.ɵɵInjectorDeclaration<DynamicFieldKitModule>;
11
- }
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@angular/common";
3
+ import * as i2 from "../components/DynamicInput";
4
+ import * as i3 from "../components/FieldInput";
5
+ import * as i4 from "../components/MultiFieldInput";
6
+ import * as i5 from "../layout/defaultLayouts";
7
+ export declare class DynamicFieldKitModule {
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<DynamicFieldKitModule, never>;
9
+ static ɵmod: i0.ɵɵNgModuleDeclaration<DynamicFieldKitModule, never, [typeof i1.CommonModule, typeof i2.DynamicInput, typeof i3.FieldInput, typeof i4.MultiFieldInput, typeof i5.ColumnLayout, typeof i5.RowLayout, typeof i5.GridLayout], [typeof i2.DynamicInput, typeof i3.FieldInput, typeof i4.MultiFieldInput, typeof i5.ColumnLayout, typeof i5.RowLayout, typeof i5.GridLayout]>;
10
+ static ɵinj: i0.ɵɵInjectorDeclaration<DynamicFieldKitModule>;
11
+ }
@@ -1,9 +1,9 @@
1
- export * from './components/BaseInput';
2
- export * from './components/DynamicInput';
3
- export * from './components/FieldInput';
4
- export * from './components/MultiFieldInput';
5
- export * from './layout';
6
- export * from './types/layout';
7
- export * from './lib/dynamic-field-kit.module';
8
- export type { FieldTypeKey, FieldDescription, FieldRendererProps } from '@dynamic-field-kit/core';
9
- export { fieldRegistry } from '@dynamic-field-kit/core';
1
+ export * from './components/BaseInput';
2
+ export * from './components/DynamicInput';
3
+ export * from './components/FieldInput';
4
+ export * from './components/MultiFieldInput';
5
+ export * from './layout';
6
+ export * from './types/layout';
7
+ export * from './lib/dynamic-field-kit.module';
8
+ export type { FieldTypeKey, FieldDescription, FieldRendererProps, } from '@dynamic-field-kit/core';
9
+ export { fieldRegistry } from '@dynamic-field-kit/core';
@@ -0,0 +1 @@
1
+ export type LayoutConfig = 'column' | 'row' | 'grid';
@@ -0,0 +1,7 @@
1
+ {
2
+ "dest": "dist",
3
+ "lib": {
4
+ "entryFile": "src/public-api.ts"
5
+ },
6
+ "allowedNonPeerDependencies": ["@dynamic-field-kit/core"]
7
+ }
package/package.json CHANGED
@@ -1,20 +1,45 @@
1
1
  {
2
2
  "name": "@dynamic-field-kit/angular",
3
- "version": "1.2.4",
3
+ "version": "1.2.10",
4
4
  "description": "Angular renderer for dynamic-field-kit",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "sideEffects": false,
8
- "main": "fesm2015/dynamic-field-kit-angular.mjs",
9
- "types": "index.d.ts",
8
+ "main": "dist/fesm2022/dynamic-field-kit-angular.mjs",
9
+ "module": "dist/fesm2022/dynamic-field-kit-angular.mjs",
10
+ "types": "dist/index.d.ts",
10
11
  "peerDependencies": {
11
12
  "@angular/common": ">=13 <22",
12
13
  "@angular/core": ">=13 <22",
13
- "@dynamic-field-kit/core": "^1.0.13"
14
+ "@dynamic-field-kit/core": "^1.1.0"
15
+ },
16
+ "dependencies": {
17
+ "@dynamic-field-kit/core": "^1.1.0"
14
18
  },
15
19
  "publishConfig": {
16
20
  "access": "public"
17
21
  },
22
+ "scripts": {
23
+ "build": "ng-packagr -p ng-package.json",
24
+ "clean": "rimraf dist",
25
+ "prepublishOnly": "npm run clean && npm run build",
26
+ "publish:dist": "npm publish ./dist --access public",
27
+ "release:patch": "npm version patch && npm run build && npm run publish:dist",
28
+ "release:minor": "npm version minor && npm run build && npm run publish:dist",
29
+ "release:major": "npm version major && npm run build && npm run publish:dist",
30
+ "lint": "echo \"skip lint for Angular\""
31
+ },
32
+ "devDependencies": {
33
+ "@angular/common": "^19.0.0",
34
+ "@angular/compiler": "^19.0.0",
35
+ "@angular/compiler-cli": "^19.0.0",
36
+ "@angular/core": "^19.0.0",
37
+ "ng-packagr": "^17.3.0",
38
+ "rimraf": "^6.1.3",
39
+ "rxjs": "^7.8.0",
40
+ "typescript": "~5.6.0",
41
+ "zone.js": "^0.14.0"
42
+ },
18
43
  "repository": {
19
44
  "type": "git",
20
45
  "url": "git+https://github.com/vannt-dev/dynamic-field-kit.git"
@@ -23,27 +48,5 @@
23
48
  "dynamic-field",
24
49
  "dynamic-field-kit",
25
50
  "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
- }
51
+ ]
52
+ }
@@ -0,0 +1,13 @@
1
+ // Minimal Tailwind adapter placeholder for Angular package.
2
+ // Mirrors the React adapter shape: expose helper class names.
3
+
4
+ export const tailwind = {
5
+ input: 'px-2 py-1 border rounded',
6
+ label: 'text-sm font-medium mb-1',
7
+ };
8
+
9
+ export default tailwind;
10
+ // Minimal Tailwind adapter placeholder for Angular package
11
+ export function cx(...parts: Array<string | false | null | undefined>) {
12
+ return parts.filter(Boolean).join(' ');
13
+ }
@@ -0,0 +1,31 @@
1
+ import {
2
+ ChangeDetectorRef,
3
+ Component,
4
+ EventEmitter,
5
+ Input,
6
+ Output,
7
+ } from '@angular/core';
8
+
9
+ @Component({
10
+ template: '',
11
+ })
12
+ export abstract class BaseInputComponent {
13
+ @Input() value?: any;
14
+ @Input() label?: string;
15
+ @Input() placeholder?: string;
16
+ @Input() required?: boolean;
17
+ @Input() disabled?: boolean;
18
+ @Input() options?: any[];
19
+ @Input() className?: string;
20
+ @Input() description?: string;
21
+ @Input() errorMessage?: string;
22
+ @Input() acceptFile?: string;
23
+ @Input() maxLength?: number;
24
+ @Input() minNumber?: number;
25
+ @Input() maxNumber?: number;
26
+ // Add more from mplis as needed
27
+
28
+ @Output() valueChange = new EventEmitter<any>();
29
+
30
+ constructor(protected cdr: ChangeDetectorRef) {}
31
+ }
@@ -0,0 +1,188 @@
1
+ import { CommonModule } from '@angular/common';
2
+ import {
3
+ Component,
4
+ ComponentRef,
5
+ Input,
6
+ Output,
7
+ EventEmitter,
8
+ ViewChild,
9
+ ViewContainerRef,
10
+ OnChanges,
11
+ AfterViewInit,
12
+ OnDestroy,
13
+ SimpleChanges,
14
+ Type,
15
+ SimpleChange,
16
+ } from '@angular/core';
17
+ import { fieldRegistry, FieldTypeKey } from '@dynamic-field-kit/core';
18
+ import { Subscription } from 'rxjs';
19
+ import { BaseInputComponent } from './BaseInput';
20
+
21
+ @Component({
22
+ selector: 'dfk-dynamic-input',
23
+ standalone: true,
24
+ imports: [CommonModule],
25
+ template: `<div #host style="display: contents;"></div>`,
26
+ })
27
+ export class DynamicInput
28
+ extends BaseInputComponent
29
+ implements OnChanges, AfterViewInit, OnDestroy
30
+ {
31
+ @Input() type!: FieldTypeKey;
32
+ @Output() override valueChange = new EventEmitter<any>();
33
+ @Output() onChange = new EventEmitter<any>(); // backward compat
34
+
35
+ @ViewChild('host', { read: ViewContainerRef, static: false })
36
+ host!: ViewContainerRef;
37
+ private compRef?: ComponentRef<any>;
38
+ private inputInstance?: any;
39
+ private subscriptions: Subscription[] = [];
40
+
41
+ ngOnChanges(changes: SimpleChanges) {
42
+ if (changes['type'] && !changes['type'].firstChange && this.host) {
43
+ this.render();
44
+ return;
45
+ }
46
+
47
+ if (this.inputInstance) {
48
+ this.applyKnownProps(this.inputInstance);
49
+
50
+ const childChanges: SimpleChanges = {};
51
+ for (const prop in changes) {
52
+ childChanges[prop] = new SimpleChange(
53
+ changes[prop].previousValue,
54
+ changes[prop].currentValue,
55
+ changes[prop].firstChange
56
+ );
57
+ }
58
+
59
+ this.inputInstance.ngOnChanges?.(childChanges);
60
+ this.compRef?.changeDetectorRef.detectChanges();
61
+ } else if (this.host) {
62
+ this.render();
63
+ }
64
+ }
65
+
66
+ ngAfterViewInit() {
67
+ this.render();
68
+ }
69
+
70
+ ngOnDestroy() {
71
+ this.cleanupSubscriptions();
72
+ this.cleanupRenderedComponent();
73
+ }
74
+
75
+ private cleanupSubscriptions() {
76
+ this.subscriptions.forEach((s) => s.unsubscribe());
77
+ this.subscriptions = [];
78
+ }
79
+
80
+ private render() {
81
+ const Renderer = fieldRegistry.get(this.type as FieldTypeKey);
82
+ this.cleanupRenderedComponent();
83
+ this.cleanupSubscriptions();
84
+ this.host.clear();
85
+ if (!Renderer) {
86
+ const el = document.createElement('div');
87
+ el.textContent = `Unknown field type: ${this.type}`;
88
+ this.host.element.nativeElement.appendChild(el);
89
+ return;
90
+ }
91
+
92
+ try {
93
+ const compType = Renderer as unknown as Type<any>;
94
+ const compRef = this.host.createComponent(compType);
95
+ const instance = compRef.instance;
96
+ if (!instance) {
97
+ throw new Error(`Failed to create instance for ${this.type}`);
98
+ }
99
+
100
+ this.applyKnownProps(instance);
101
+
102
+ const subA = this.bindOutput(instance, 'valueChange');
103
+ if (subA) {
104
+ this.subscriptions.push(subA);
105
+ }
106
+ const subB = this.bindOutput(instance, 'onValueChange');
107
+ if (subB) {
108
+ this.subscriptions.push(subB);
109
+ }
110
+
111
+ instance.changeDetectorRef?.detectChanges();
112
+ this.compRef = compRef;
113
+ this.inputInstance = instance;
114
+ compRef.changeDetectorRef.detectChanges();
115
+ } catch (err) {
116
+ // Fallback to function renderer
117
+ try {
118
+ const props: any = {
119
+ value: this.value,
120
+ onValueChange: (v: any) => this.emitValue(v),
121
+ label: this.label,
122
+ placeholder: this.placeholder,
123
+ required: this.required,
124
+ options: this.options,
125
+ className: this.className,
126
+ description: this.description,
127
+ disabled: this.disabled,
128
+ errorMessage: this.errorMessage,
129
+ };
130
+ const out = (Renderer as (props: unknown) => unknown)(props);
131
+ if (typeof out === 'string') {
132
+ const el = document.createElement('div');
133
+ el.innerHTML = out;
134
+ this.host.element.nativeElement.appendChild(el);
135
+ }
136
+ } catch (e) {
137
+ const el = document.createElement('div');
138
+ el.textContent = `Failed to render field: ${this.type}`;
139
+ this.host.element.nativeElement.appendChild(el);
140
+ }
141
+ }
142
+ }
143
+
144
+ private applyKnownProps(instance: any) {
145
+ const knownProps = [
146
+ 'value',
147
+ 'label',
148
+ 'placeholder',
149
+ 'required',
150
+ 'disabled',
151
+ 'options',
152
+ 'className',
153
+ 'description',
154
+ 'errorMessage',
155
+ ];
156
+ for (const prop of knownProps) {
157
+ if (prop in this && prop in instance) {
158
+ instance[prop] = (this as any)[prop];
159
+ }
160
+ }
161
+ }
162
+
163
+ private bindOutput(
164
+ instance: any,
165
+ outputName: 'valueChange' | 'onValueChange'
166
+ ): Subscription | undefined {
167
+ const output = instance?.[outputName];
168
+ if (!output || typeof output.subscribe !== 'function') {
169
+ return;
170
+ }
171
+
172
+ const sub = (output as EventEmitter<any>).subscribe((value) => {
173
+ this.emitValue(value);
174
+ });
175
+ return sub;
176
+ }
177
+
178
+ private emitValue(value: any) {
179
+ this.valueChange.emit(value);
180
+ this.onChange.emit(value);
181
+ }
182
+
183
+ private cleanupRenderedComponent() {
184
+ this.compRef?.destroy();
185
+ this.compRef = undefined;
186
+ this.inputInstance = undefined;
187
+ }
188
+ }
@@ -0,0 +1,49 @@
1
+ import { NgIf } from '@angular/common';
2
+ import { Component, Input, Output, EventEmitter } from '@angular/core';
3
+ import { FieldDescription, Properties } from '@dynamic-field-kit/core';
4
+ import { DynamicInput } from './DynamicInput';
5
+
6
+ @Component({
7
+ selector: 'dfk-field-input',
8
+ standalone: true,
9
+ imports: [NgIf, DynamicInput],
10
+ template: `
11
+ <dfk-dynamic-input
12
+ *ngIf="fieldDescription && renderInfos"
13
+ [type]="fieldDescription!.type"
14
+ [value]="getFieldValue()"
15
+ [label]="fieldDescription!.label"
16
+ [placeholder]="fieldDescription!.placeholder"
17
+ [required]="fieldDescription!.required"
18
+ [description]="fieldDescription!.description"
19
+ [options]="fieldDescription!.options"
20
+ [className]="fieldDescription!.className"
21
+ (valueChange)="
22
+ onValueChangeField.emit({ value: $event, key: fieldDescription!.name })
23
+ "
24
+ [disabled]="false"
25
+ [errorMessage]="''"
26
+ ></dfk-dynamic-input>
27
+ `,
28
+ })
29
+ export class FieldInput {
30
+ @Input() fieldDescription?: FieldDescription;
31
+ @Input() renderInfos?: Properties;
32
+ @Output() onValueChangeField = new EventEmitter<{
33
+ value: any;
34
+ key: string;
35
+ }>();
36
+
37
+ getFieldValue() {
38
+ if (!this.fieldDescription || !this.renderInfos) {
39
+ return undefined;
40
+ }
41
+
42
+ const value = this.renderInfos[this.fieldDescription.name];
43
+ if (value === undefined && this.fieldDescription.type === 'text') {
44
+ return '';
45
+ }
46
+
47
+ return value;
48
+ }
49
+ }
@@ -0,0 +1,75 @@
1
+ import { NgClass, NgFor } from '@angular/common';
2
+ import {
3
+ Component,
4
+ Input,
5
+ Output,
6
+ EventEmitter,
7
+ OnChanges,
8
+ OnInit,
9
+ SimpleChanges,
10
+ } from '@angular/core';
11
+ import { FieldDescription, Properties } from '@dynamic-field-kit/core';
12
+ import { LayoutConfig } from '../types/layout';
13
+ import { FieldInput } from './FieldInput';
14
+
15
+ @Component({
16
+ selector: 'dfk-multi-field-input',
17
+ standalone: true,
18
+ imports: [NgClass, NgFor, FieldInput],
19
+ template: `
20
+ <div
21
+ class="flex flex-col gap-3 p-4 border rounded-lg bg-gray-50"
22
+ [ngClass]="{
23
+ 'flex-row gap-3': layout === 'row',
24
+ 'grid grid-cols-2 gap-3': layout === 'grid'
25
+ }"
26
+ >
27
+ <dfk-field-input
28
+ *ngFor="let field of visibleFields; trackBy: trackByFn"
29
+ [fieldDescription]="field"
30
+ [renderInfos]="data"
31
+ (onValueChangeField)="onFieldChange($event)"
32
+ ></dfk-field-input>
33
+ </div>
34
+ `,
35
+ })
36
+ export class MultiFieldInput implements OnInit, OnChanges {
37
+ @Input() fieldDescriptions: FieldDescription[] = [];
38
+ @Input() properties?: Properties;
39
+ @Output() onChange = new EventEmitter<Properties>();
40
+ @Input() layout: LayoutConfig = 'column';
41
+
42
+ data: Properties = {};
43
+ visibleFields: FieldDescription[] = [];
44
+
45
+ trackByFn(index: number, field: FieldDescription): string | number {
46
+ return field.name || index;
47
+ }
48
+
49
+ ngOnInit() {
50
+ this.init();
51
+ }
52
+
53
+ ngOnChanges(_changes: SimpleChanges) {
54
+ this.init();
55
+ }
56
+
57
+ private init() {
58
+ if (this.properties) {
59
+ this.data = { ...this.properties };
60
+ }
61
+ this.updateVisibleFields();
62
+ }
63
+
64
+ private updateVisibleFields() {
65
+ this.visibleFields = this.fieldDescriptions.filter(
66
+ (f) => !f.appearCondition || f.appearCondition(this.data)
67
+ );
68
+ }
69
+
70
+ onFieldChange(event: { value: any; key: string }) {
71
+ this.data = { ...this.data, [event.key]: event.value };
72
+ this.updateVisibleFields();
73
+ this.onChange.emit(this.data);
74
+ }
75
+ }
@@ -0,0 +1,3 @@
1
+ import { CommonModule } from '@angular/common';
2
+
3
+ export const BaseImports = [CommonModule];
@@ -0,0 +1,4 @@
1
+ export { TextFieldComponent } from './text-field.component';
2
+ import './registerExample';
3
+
4
+ export {};
@@ -0,0 +1,7 @@
1
+ import { fieldRegistry } from '@dynamic-field-kit/core';
2
+ import { TextFieldComponent } from './text-field.component';
3
+
4
+ // Example: register Angular component class into shared registry
5
+ fieldRegistry.register('text', TextFieldComponent as any);
6
+
7
+ export {};
@@ -0,0 +1,18 @@
1
+ import { Component, Input, Output, EventEmitter } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'dfk-text-field',
5
+ standalone: true,
6
+ template: ` <input [value]="value ?? ''" (input)="onInput($event)" /> `,
7
+ })
8
+ export class TextFieldComponent {
9
+ @Input() value?: any;
10
+ @Output() valueChange = new EventEmitter<any>();
11
+ @Output() onValueChange = new EventEmitter<any>();
12
+
13
+ onInput(e: any) {
14
+ const value = e.target.value;
15
+ this.valueChange.emit(value);
16
+ this.onValueChange.emit(value);
17
+ }
18
+ }