@dynamic-field-kit/angular 1.3.3 → 1.5.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/CHANGELOG.md +185 -0
- package/LICENSE +21 -0
- package/README.md +193 -7
- package/dist/components/BaseInput.d.ts +5 -11
- package/dist/components/DynamicFormDevTools.d.ts +16 -0
- package/dist/components/DynamicInput.d.ts +8 -3
- package/dist/components/FieldInput.d.ts +12 -2
- package/dist/components/MultiFieldInput.d.ts +22 -2
- package/dist/fesm2022/dynamic-field-kit-angular.mjs +778 -87
- package/dist/fieldRegistryToken.d.ts +3 -0
- package/dist/index.d.ts +1 -1
- package/dist/layout/index.d.ts +2 -2
- package/dist/lib/dynamic-field-kit.module.d.ts +4 -4
- package/dist/lib/dynamic-form.store.d.ts +23 -0
- package/dist/public-api.d.ts +13 -8
- package/dist/types/layout.d.ts +4 -25
- package/package.json +46 -29
- package/angular.json +0 -27
- package/dist/README.md +0 -188
- package/dist/esm2022/components/BaseInput.mjs +0 -68
- package/dist/esm2022/components/DynamicInput.mjs +0 -191
- package/dist/esm2022/components/FieldInput.mjs +0 -80
- package/dist/esm2022/components/MultiFieldInput.mjs +0 -264
- package/dist/esm2022/dynamic-field-kit-angular.mjs +0 -5
- package/dist/esm2022/layout/defaultLayouts.mjs +0 -114
- package/dist/esm2022/layout/index.mjs +0 -3
- package/dist/esm2022/layout/layoutRegistry.mjs +0 -14
- package/dist/esm2022/lib/dynamic-field-kit.module.mjs +0 -52
- package/dist/esm2022/public-api.mjs +0 -14
- package/dist/esm2022/types/layout.mjs +0 -2
- package/dist/fesm2022/dynamic-field-kit-angular.mjs.map +0 -1
- package/karma.conf.js +0 -37
- package/ng-package.json +0 -7
- package/src/components/BaseInput.ts +0 -60
- package/src/components/DynamicInput.ts +0 -224
- package/src/components/FieldInput.ts +0 -67
- package/src/components/MultiFieldInput.ts +0 -238
- package/src/layout/defaultLayouts.ts +0 -70
- package/src/layout/index.ts +0 -2
- package/src/layout/layoutRegistry.ts +0 -25
- package/src/lib/dynamic-field-kit.module.ts +0 -29
- package/src/public-api.ts +0 -24
- package/src/types/layout.ts +0 -36
- package/test/DynamicInput.spec.ts +0 -30
- package/test/FieldInput.spec.ts +0 -44
- package/test/angular.spec.ts +0 -102
- package/test/integration.spec.ts +0 -57
- package/test/layouts.spec.ts +0 -26
- package/test.ts +0 -12
- package/tsconfig.json +0 -13
- package/tsconfig.spec.json +0 -21
package/test/integration.spec.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
describe('Integration: Form with multiple fields', () => {
|
|
2
|
-
it('should create field descriptions', () => {
|
|
3
|
-
const fields = [
|
|
4
|
-
{ name: 'name', type: 'text', label: 'Full Name' },
|
|
5
|
-
{ name: 'email', type: 'text', label: 'Email' },
|
|
6
|
-
];
|
|
7
|
-
expect(fields.length).toBe(2);
|
|
8
|
-
expect(fields[0].label).toBe('Full Name');
|
|
9
|
-
});
|
|
10
|
-
|
|
11
|
-
it('should handle form data', () => {
|
|
12
|
-
const formData = { name: 'John', email: 'john@example.com' };
|
|
13
|
-
expect(formData.name).toBe('John');
|
|
14
|
-
expect(formData.email).toBe('john@example.com');
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it('should evaluate appearCondition', () => {
|
|
18
|
-
const condition = (data: any) => data.accountType === 'business';
|
|
19
|
-
expect(condition({ accountType: 'personal' })).toBe(false);
|
|
20
|
-
expect(condition({ accountType: 'business' })).toBe(true);
|
|
21
|
-
});
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
describe('FieldDescription', () => {
|
|
25
|
-
it('should have name and type', () => {
|
|
26
|
-
const field = { name: 'username', type: 'text' };
|
|
27
|
-
expect(field.name).toBe('username');
|
|
28
|
-
expect(field.type).toBe('text');
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('should support optional properties', () => {
|
|
32
|
-
const field = {
|
|
33
|
-
name: 'username',
|
|
34
|
-
type: 'text',
|
|
35
|
-
label: 'Username',
|
|
36
|
-
placeholder: 'Enter name',
|
|
37
|
-
required: true,
|
|
38
|
-
options: [{ label: 'Option 1' }],
|
|
39
|
-
};
|
|
40
|
-
expect(field.label).toBe('Username');
|
|
41
|
-
expect(field.required).toBe(true);
|
|
42
|
-
expect(field.options?.length).toBe(1);
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
describe('Properties', () => {
|
|
47
|
-
it('should be a record of key-value pairs', () => {
|
|
48
|
-
const props: Record<string, any> = {
|
|
49
|
-
username: 'john',
|
|
50
|
-
age: 25,
|
|
51
|
-
active: true,
|
|
52
|
-
};
|
|
53
|
-
expect(props.username).toBe('john');
|
|
54
|
-
expect(props.age).toBe(25);
|
|
55
|
-
expect(props.active).toBe(true);
|
|
56
|
-
});
|
|
57
|
-
});
|
package/test/layouts.spec.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
describe('Layout: Row', () => {
|
|
2
|
-
it('should render fields in row layout', () => {
|
|
3
|
-
const layout = 'row';
|
|
4
|
-
expect(layout).toBe('row');
|
|
5
|
-
});
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
describe('Layout: Grid', () => {
|
|
9
|
-
it('should render fields in default grid layout', () => {
|
|
10
|
-
const layout = 'grid';
|
|
11
|
-
expect(layout).toBe('grid');
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('should support grid with columns option', () => {
|
|
15
|
-
const layout = { type: 'grid', columns: 3 };
|
|
16
|
-
expect(layout.type).toBe('grid');
|
|
17
|
-
expect(layout.columns).toBe(3);
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
describe('Layout: Column', () => {
|
|
22
|
-
it('should render fields in column layout', () => {
|
|
23
|
-
const layout = 'column';
|
|
24
|
-
expect(layout).toBe('column');
|
|
25
|
-
});
|
|
26
|
-
});
|
package/test.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import 'zone.js';
|
|
2
|
-
import 'zone.js/testing';
|
|
3
|
-
import { getTestBed } from '@angular/core/testing';
|
|
4
|
-
import {
|
|
5
|
-
BrowserDynamicTestingModule,
|
|
6
|
-
platformBrowserDynamicTesting,
|
|
7
|
-
} from '@angular/platform-browser-dynamic/testing';
|
|
8
|
-
|
|
9
|
-
getTestBed().initTestEnvironment(
|
|
10
|
-
BrowserDynamicTestingModule,
|
|
11
|
-
platformBrowserDynamicTesting()
|
|
12
|
-
);
|
package/tsconfig.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../tsconfig.base.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"composite": false,
|
|
5
|
-
"declaration": true,
|
|
6
|
-
"outDir": "dist",
|
|
7
|
-
"target": "ES2019",
|
|
8
|
-
"module": "ES2020",
|
|
9
|
-
"experimentalDecorators": true,
|
|
10
|
-
"emitDecoratorMetadata": true
|
|
11
|
-
},
|
|
12
|
-
"include": ["src/**/*"]
|
|
13
|
-
}
|
package/tsconfig.spec.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"outDir": "./dist-spec",
|
|
5
|
-
"module": "commonjs",
|
|
6
|
-
"moduleResolution": "node",
|
|
7
|
-
"target": "ES2020",
|
|
8
|
-
"emitDecoratorMetadata": true,
|
|
9
|
-
"experimentalDecorators": true,
|
|
10
|
-
"allowSyntheticDefaultImports": true,
|
|
11
|
-
"esModuleInterop": true,
|
|
12
|
-
"declaration": false,
|
|
13
|
-
"sourceMap": true,
|
|
14
|
-
"baseUrl": ".",
|
|
15
|
-
"skipLibCheck": true,
|
|
16
|
-
"noImplicitAny": false,
|
|
17
|
-
"strict": false
|
|
18
|
-
},
|
|
19
|
-
"include": ["test/**/*.ts"],
|
|
20
|
-
"exclude": ["node_modules", "dist", "dist-spec", "examples", "src"]
|
|
21
|
-
}
|