@genesislcap/foundation-forms 14.15.2 → 14.16.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.
Files changed (28) hide show
  1. package/custom-elements-manifest.config.js +14 -0
  2. package/dist/custom-elements.json +2214 -0
  3. package/dist/dts/form.d.ts.map +1 -1
  4. package/dist/dts/form.template.d.ts.map +1 -1
  5. package/dist/dts/jsonforms/renderers/ArrayListWrapperRenderer.d.ts +13 -0
  6. package/dist/dts/jsonforms/renderers/ArrayListWrapperRenderer.d.ts.map +1 -0
  7. package/dist/dts/jsonforms/renderers/LayoutArrayRenderer.d.ts +3 -0
  8. package/dist/dts/jsonforms/renderers/LayoutArrayRenderer.d.ts.map +1 -0
  9. package/dist/dts/jsonforms/renderers/LayoutHorizontalRenderer.d.ts +3 -0
  10. package/dist/dts/jsonforms/renderers/LayoutHorizontalRenderer.d.ts.map +1 -0
  11. package/dist/dts/jsonforms/renderers/RenderersRanks.d.ts +2 -0
  12. package/dist/dts/jsonforms/renderers/RenderersRanks.d.ts.map +1 -1
  13. package/dist/dts/jsonforms/testers/isLayoutArray.d.ts +2 -0
  14. package/dist/dts/jsonforms/testers/isLayoutArray.d.ts.map +1 -0
  15. package/dist/dts/types.d.ts +1 -0
  16. package/dist/dts/types.d.ts.map +1 -1
  17. package/dist/esm/form.js +4 -0
  18. package/dist/esm/form.template.js +2 -0
  19. package/dist/esm/jsonforms/renderers/ArrayListWrapperRenderer.js +108 -0
  20. package/dist/esm/jsonforms/renderers/LayoutArrayRenderer.js +14 -0
  21. package/dist/esm/jsonforms/renderers/LayoutHorizontalRenderer.js +33 -0
  22. package/dist/esm/jsonforms/renderers/RenderersRanks.js +2 -0
  23. package/dist/esm/jsonforms/testers/isLayoutArray.js +2 -0
  24. package/dist/foundation-forms.api.json +11 -2
  25. package/dist/foundation-forms.d.ts +1 -0
  26. package/docs/api/foundation-forms.uischemaelementoptions.md +3 -0
  27. package/docs/api-report.md +2 -1
  28. package/package.json +12 -9
@@ -1 +1 @@
1
- {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/form.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAe1C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,gBAAgB;AAChB,eAAO,MAAM,MAAM,gDAAkC,CAAC;AActD,cAAc;AACd,eAAO,MAAM,SAAS,OAarB,CAAC;AACF;;;;;GAKG;AAEH,qBAKa,IAAK,SAAQ,iBAAiB;IACzC;;;;OAIG;IACG,YAAY,EAAE,MAAM,CAAC;YACb,mBAAmB;IAQjC,OAAO,CAAC,oBAAoB;IA0B5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACS,QAAQ,EAAE,eAAe,CAAC;IACtC;;;OAGG;IACS,SAAS,EAAE,aAAa,EAAE,CAAa;IACnD;;;;;;OAMG;IACS,UAAU,EAAE,WAAW,CAAC;IAEpC,OAAO,CAAC,MAAM,CAAqB;IAC1B,OAAO,CAAC,OAAO,CAAW;IACnC;;;OAGG;IACS,IAAI,EAAE,GAAG,CAAM;IAE3B;;OAEG;IACS,UAAU,EAAE,OAAO,CAAC;IAChC;;OAEG;IACS,SAAS,EAAE,OAAO,CAAC;IAEJ,QAAQ,EAAE,OAAO,CAAC;IAE7C;;OAEG;IACG,OAAO;IAwBb;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,WAAW;IAQ3B,oBAAoB;CAMrB"}
1
+ {"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/form.ts"],"names":[],"mappings":"AAEA,OAAO,EAKL,eAAe,EAChB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAiB1C,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,gBAAgB;AAChB,eAAO,MAAM,MAAM,gDAAkC,CAAC;AActD,cAAc;AACd,eAAO,MAAM,SAAS,OAerB,CAAC;AACF;;;;;GAKG;AAEH,qBAKa,IAAK,SAAQ,iBAAiB;IACzC;;;;OAIG;IACG,YAAY,EAAE,MAAM,CAAC;YACb,mBAAmB;IAQjC,OAAO,CAAC,oBAAoB;IA0B5B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAqCG;IACS,QAAQ,EAAE,eAAe,CAAC;IACtC;;;OAGG;IACS,SAAS,EAAE,aAAa,EAAE,CAAa;IACnD;;;;;;OAMG;IACS,UAAU,EAAE,WAAW,CAAC;IAEpC,OAAO,CAAC,MAAM,CAAqB;IAC1B,OAAO,CAAC,OAAO,CAAW;IACnC;;;OAGG;IACS,IAAI,EAAE,GAAG,CAAM;IAE3B;;OAEG;IACS,UAAU,EAAE,OAAO,CAAC;IAChC;;OAEG;IACS,SAAS,EAAE,OAAO,CAAC;IAEJ,QAAQ,EAAE,OAAO,CAAC;IAE7C;;OAEG;IACG,OAAO;IAwBb;;OAEG;IACH,QAAQ,CAAC,KAAK,EAAE,WAAW;IAQ3B,oBAAoB;CAMrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"form.template.d.ts","sourceRoot":"","sources":["../../src/form.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AASnC,eAAO,MAAM,sBAAsB,2DA2BlC,CAAC"}
1
+ {"version":3,"file":"form.template.d.ts","sourceRoot":"","sources":["../../src/form.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAWnC,eAAO,MAAM,sBAAsB,2DA2BlC,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { FASTElement } from '@microsoft/fast-element';
2
+ export declare const ArrayListWrapperRendererTemplate: import("@microsoft/fast-element").ViewTemplate<any, any>;
3
+ export declare class ArrayListWrapper extends FASTElement {
4
+ form: any;
5
+ control: any;
6
+ pathName: any;
7
+ schema: any;
8
+ uiSchema: any;
9
+ controlChanged(): void;
10
+ addItem(): void;
11
+ deleteItem(index: number): void;
12
+ }
13
+ //# sourceMappingURL=ArrayListWrapperRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ArrayListWrapperRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/ArrayListWrapperRenderer.ts"],"names":[],"mappings":"AACA,OAAO,EAAwC,WAAW,EAAU,MAAM,yBAAyB,CAAC;AAEpG,eAAO,MAAM,gCAAgC,0DAwC5C,CAAC;AAiBF,qBAKa,gBAAiB,SAAQ,WAAW;IACnC,IAAI,MAAC;IACL,OAAO,MAAC;IACR,QAAQ,MAAC;IACT,MAAM,MAAC;IACP,QAAQ,MAAC;IAErB,cAAc;IAed,OAAO;IAaP,UAAU,CAAC,KAAK,EAAE,MAAM;CAWzB"}
@@ -0,0 +1,3 @@
1
+ export declare const LayoutArrayRendererTemplate: import("@microsoft/fast-element").ViewTemplate<any, any>;
2
+ export declare const LayoutArrayRendererEntry: any;
3
+ //# sourceMappingURL=LayoutArrayRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutArrayRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/LayoutArrayRenderer.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,2BAA2B,0DAIvC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,GAItC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const LayoutHorizontalRendererTemplate: import("@microsoft/fast-element").ViewTemplate<any, any>;
2
+ export declare const LayoutHorizontalEntry: any;
3
+ //# sourceMappingURL=LayoutHorizontalRenderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutHorizontalRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/LayoutHorizontalRenderer.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gCAAgC,0DA2B5C,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,GAInC,CAAC"}
@@ -5,7 +5,9 @@ export declare const ENUM_CONTROL_RANK = 3;
5
5
  export declare const SELECT_CONTROL_RANK = 4;
6
6
  export declare const DATE_CONTROL_RANK = 4;
7
7
  export declare const LAYOUT_RANK = 2;
8
+ export declare const LAYOUT_ARRAY_RANK = 2;
8
9
  export declare const LAYOUT_GROUP_RANK = 2;
10
+ export declare const LAYOUT_HORIZONTAL_RANK = 2;
9
11
  export declare const LAYOUT2COLUMNS_RANK = 2;
10
12
  export declare const INVISIBLE_CONTROL_RANK = 5;
11
13
  //# sourceMappingURL=RenderersRanks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RenderersRanks.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/RenderersRanks.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,sBAAsB,IAAI,CAAC"}
1
+ {"version":3,"file":"RenderersRanks.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/RenderersRanks.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AACtC,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAC1C,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,WAAW,IAAI,CAAC;AAC7B,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,iBAAiB,IAAI,CAAC;AACnC,eAAO,MAAM,sBAAsB,IAAI,CAAC;AACxC,eAAO,MAAM,mBAAmB,IAAI,CAAC;AACrC,eAAO,MAAM,sBAAsB,IAAI,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const isLayoutArray: import("@jsonforms/core").Tester;
2
+ //# sourceMappingURL=isLayoutArray.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isLayoutArray.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/testers/isLayoutArray.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,kCAGzB,CAAC"}
@@ -16,6 +16,7 @@ export type UiSchemaElementOptions = {
16
16
  labelField?: string;
17
17
  textarea?: boolean;
18
18
  data?: any[];
19
+ childUiSchema?: UiSchema;
19
20
  i18n?: {
20
21
  [key: string]: any;
21
22
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,mBAAmB,EACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAClC,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAE3E,cAAc;AACd,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,gBAAgB,GAAG,GAAG,CAAC;AAErE,cAAc;AACd,MAAM,M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d,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,YAAY,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAAC;IAC9C,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,CAAC,KAAK,EAAE,cAAc,EAAE,QAAQ,EAAE,iBAAiB,KAAK,mBAAmB,CAAC;CACrF,CAAC"}
package/dist/esm/form.js CHANGED
@@ -12,7 +12,9 @@ import { ConnectedSelectControlRendererEntry } from './jsonforms/renderers/Conne
12
12
  import { DateControlRendererEntry } from './jsonforms/renderers/DateControlRenderer';
13
13
  import { EnumControlRendererEntry } from './jsonforms/renderers/EnumControlRenderer';
14
14
  import { InvisibleControlEntry } from './jsonforms/renderers/InvisibleControlRenderer';
15
+ import { LayoutArrayRendererEntry } from './jsonforms/renderers/LayoutArrayRenderer';
15
16
  import { LayoutGroupRendererEntry } from './jsonforms/renderers/LayoutGroupRenderer';
17
+ import { LayoutHorizontalEntry } from './jsonforms/renderers/LayoutHorizontalRenderer';
16
18
  import { LayoutRendererEntry } from './jsonforms/renderers/LayoutRenderer';
17
19
  import { LayoutVertical2ColumnsEntry } from './jsonforms/renderers/LayoutVertical2ColumnsRenderer';
18
20
  import { NumberControlRendererEntry } from './jsonforms/renderers/NumberControlRenderer';
@@ -34,7 +36,9 @@ export const renderers = [
34
36
  fallbackEntry,
35
37
  stringEntry,
36
38
  BooleanControlEntry,
39
+ LayoutArrayRendererEntry,
37
40
  LayoutGroupRendererEntry,
41
+ LayoutHorizontalEntry,
38
42
  LayoutVertical2ColumnsEntry,
39
43
  LayoutRendererEntry,
40
44
  NumberControlRendererEntry,
@@ -1,8 +1,10 @@
1
1
  import { html, when } from '@microsoft/fast-element';
2
2
  import { JSONForms } from './jsonforms/json-forms';
3
+ import { ArrayListWrapper } from './jsonforms/renderers/ArrayListWrapperRenderer';
3
4
  import { ControlWrapper } from './jsonforms/renderers/ControlWrapperRenderer';
4
5
  import { DispatchRenderer } from './jsonforms/renderers/dispatch-renderer';
5
6
  JSONForms;
7
+ ArrayListWrapper;
6
8
  ControlWrapper;
7
9
  DispatchRenderer;
8
10
  export const foundationFormTemplate = html `
@@ -0,0 +1,108 @@
1
+ import { __decorate } from "tslib";
2
+ import { Generate, composePaths } from '@jsonforms/core';
3
+ import { html, css, observable, customElement, FASTElement, repeat } from '@microsoft/fast-element';
4
+ export const ArrayListWrapperRendererTemplate = html `
5
+ <template>
6
+ ${repeat((x) => x.control.data[x.pathName], html `
7
+ <div class="array-list">
8
+ <dispatch-renderer
9
+ ?submitted=${(x, ctx) => ctx.parent.form.submitted}
10
+ :dispatch=${(x, ctx) => ctx.parent.form.dispatch}
11
+ :jsonforms=${(x, ctx) => ctx.parent.form.jsonforms}
12
+ :props=${(x, ctx) => ({
13
+ uischema: ctx.parent.uiSchema,
14
+ schema: ctx.parent.schema,
15
+ renderers: ctx.parent.control.renderers,
16
+ path: composePaths(ctx.parent.pathName, `${ctx.index}`),
17
+ enabled: ctx.parent.control.enabled,
18
+ })}
19
+ ></dispatch-renderer>
20
+ <zero-button
21
+ appearance="lightweight"
22
+ class="item-control-btn"
23
+ data-test-id=${(x, ctx) => `${ctx.parent.pathName}-${ctx.index}-delete-item`}
24
+ @click=${(x, ctx) => ctx.parent.deleteItem(ctx.index)}
25
+ >
26
+ <zero-icon name="trash"></zero-icon>
27
+ </zero-button>
28
+ </div>
29
+ `, { positioning: true })}
30
+ <zero-button
31
+ appearance="lightweight"
32
+ class="item-control-btn"
33
+ data-test-id=${(x) => `${x.pathName}-add-item`}
34
+ @click=${(x) => x.addItem()}
35
+ >
36
+ <zero-icon name="plus"></zero-icon>
37
+ Add another
38
+ </zero-button>
39
+ </template>
40
+ `;
41
+ const styles = css `
42
+ .array-list {
43
+ display: flex;
44
+ align-items: center;
45
+ }
46
+
47
+ .item-control-btn {
48
+ color: rgb(135, 155, 166);
49
+ }
50
+
51
+ .item-control-btn:hover {
52
+ color: var(--accent-foreground-hover);
53
+ }
54
+ `;
55
+ let ArrayListWrapper = class ArrayListWrapper extends FASTElement {
56
+ controlChanged() {
57
+ this.pathName = Object.keys(this.control.schema.properties)[0];
58
+ if (this.control.uischema.options) {
59
+ this.uiSchema = this.control.uischema.options.childUiSchema;
60
+ return;
61
+ }
62
+ this.schema = this.control.schema.properties[this.pathName].items;
63
+ const arrayUiSchema = Generate.uiSchema(this.schema);
64
+ this.uiSchema = Object.assign(Object.assign({}, arrayUiSchema), { type: 'HorizontalLayout' });
65
+ console.log('Auto generated uiSchema for layout array:', this.uiSchema);
66
+ }
67
+ addItem() {
68
+ const items = this.control.data[this.pathName] && Object.keys(this.control.data[this.pathName]).length !== 0
69
+ ? [...this.control.data[this.pathName], {}]
70
+ : [{}];
71
+ const data = Object.assign(Object.assign({}, this.control.data), { [this.pathName]: items });
72
+ this.$emit('data-change', {
73
+ data,
74
+ });
75
+ }
76
+ deleteItem(index) {
77
+ const allItems = this.control.data[this.pathName];
78
+ const valueToRemove = [allItems[index]];
79
+ const items = allItems.filter((element) => !valueToRemove.includes(element));
80
+ const data = Object.assign(Object.assign({}, this.control.data), { [this.pathName]: items });
81
+ this.$emit('data-change', {
82
+ data,
83
+ });
84
+ }
85
+ };
86
+ __decorate([
87
+ observable
88
+ ], ArrayListWrapper.prototype, "form", void 0);
89
+ __decorate([
90
+ observable
91
+ ], ArrayListWrapper.prototype, "control", void 0);
92
+ __decorate([
93
+ observable
94
+ ], ArrayListWrapper.prototype, "pathName", void 0);
95
+ __decorate([
96
+ observable
97
+ ], ArrayListWrapper.prototype, "schema", void 0);
98
+ __decorate([
99
+ observable
100
+ ], ArrayListWrapper.prototype, "uiSchema", void 0);
101
+ ArrayListWrapper = __decorate([
102
+ customElement({
103
+ name: 'array-list-wrapper',
104
+ styles,
105
+ template: ArrayListWrapperRendererTemplate,
106
+ })
107
+ ], ArrayListWrapper);
108
+ export { ArrayListWrapper };
@@ -0,0 +1,14 @@
1
+ import { mapStateToLayoutProps, rankWith } from '@jsonforms/core';
2
+ import { html } from '@microsoft/fast-element';
3
+ import { isLayoutArray } from '../testers/isLayoutArray';
4
+ import { LAYOUT_ARRAY_RANK } from './RenderersRanks';
5
+ export const LayoutArrayRendererTemplate = html `
6
+ <template>
7
+ <array-list-wrapper :form=${(x) => x} :control=${(x) => x.control}></array-list-wrapper>
8
+ </template>
9
+ `;
10
+ export const LayoutArrayRendererEntry = {
11
+ renderer: LayoutArrayRendererTemplate,
12
+ tester: rankWith(LAYOUT_ARRAY_RANK, isLayoutArray),
13
+ mapper: mapStateToLayoutProps,
14
+ };
@@ -0,0 +1,33 @@
1
+ import { mapStateToLayoutProps, rankWith } from '@jsonforms/core';
2
+ import { html, repeat } from '@microsoft/fast-element';
3
+ import { LAYOUT_HORIZONTAL_RANK } from './RenderersRanks';
4
+ export const LayoutHorizontalRendererTemplate = html `
5
+ <template>
6
+ <div
7
+ style="
8
+ display: flex;
9
+ flex-direction: row;
10
+ gap: 10px"
11
+ >
12
+ ${repeat((x) => x.control.uischema.elements, html `
13
+ <dispatch-renderer
14
+ ?submitted=${(x, ctx) => ctx.parent.submitted}
15
+ :dispatch=${(x, ctx) => ctx.parent.dispatch}
16
+ :jsonforms=${(x, ctx) => ctx.parent.jsonforms}
17
+ :props=${(x, ctx) => ({
18
+ uischema: x,
19
+ schema: ctx.parent.control.schema,
20
+ renderers: ctx.parent.control.renderers,
21
+ path: ctx.parent.control.path,
22
+ enabled: ctx.parent.control.enabled,
23
+ })}
24
+ ></dispatch-renderer>
25
+ `)}
26
+ </div>
27
+ </template>
28
+ `;
29
+ export const LayoutHorizontalEntry = {
30
+ renderer: LayoutHorizontalRendererTemplate,
31
+ tester: rankWith(LAYOUT_HORIZONTAL_RANK, (uiSchema) => uiSchema.type === 'HorizontalLayout'),
32
+ mapper: mapStateToLayoutProps,
33
+ };
@@ -5,6 +5,8 @@ export const ENUM_CONTROL_RANK = 3;
5
5
  export const SELECT_CONTROL_RANK = 4;
6
6
  export const DATE_CONTROL_RANK = 4;
7
7
  export const LAYOUT_RANK = 2;
8
+ export const LAYOUT_ARRAY_RANK = 2;
8
9
  export const LAYOUT_GROUP_RANK = 2;
10
+ export const LAYOUT_HORIZONTAL_RANK = 2;
9
11
  export const LAYOUT2COLUMNS_RANK = 2;
10
12
  export const INVISIBLE_CONTROL_RANK = 5;
@@ -0,0 +1,2 @@
1
+ import { hasType, schemaMatches } from '@jsonforms/core';
2
+ export const isLayoutArray = schemaMatches((schema) => hasType(schema, 'array') && schema.hasOwnProperty('items') && schema.items['type'] == 'object');
@@ -1052,7 +1052,16 @@
1052
1052
  },
1053
1053
  {
1054
1054
  "kind": "Content",
1055
- "text": "[];\n valueField?: string;\n labelField?: string;\n textarea?: boolean;\n data?: any[];\n i18n?: {\n [key: string]: any;\n };\n}"
1055
+ "text": "[];\n valueField?: string;\n labelField?: string;\n textarea?: boolean;\n data?: any[];\n childUiSchema?: "
1056
+ },
1057
+ {
1058
+ "kind": "Reference",
1059
+ "text": "UiSchema",
1060
+ "canonicalReference": "@genesislcap/foundation-forms!UiSchema:type"
1061
+ },
1062
+ {
1063
+ "kind": "Content",
1064
+ "text": ";\n i18n?: {\n [key: string]: any;\n };\n}"
1056
1065
  },
1057
1066
  {
1058
1067
  "kind": "Content",
@@ -1064,7 +1073,7 @@
1064
1073
  "name": "UiSchemaElementOptions",
1065
1074
  "typeTokenRange": {
1066
1075
  "startIndex": 1,
1067
- "endIndex": 6
1076
+ "endIndex": 8
1068
1077
  }
1069
1078
  },
1070
1079
  {
@@ -287,6 +287,7 @@ export declare type UiSchemaElementOptions = {
287
287
  labelField?: string;
288
288
  textarea?: boolean;
289
289
  data?: any[];
290
+ childUiSchema?: UiSchema;
290
291
  i18n?: {
291
292
  [key: string]: any;
292
293
  };
@@ -18,8 +18,11 @@ export type UiSchemaElementOptions = {
18
18
  labelField?: string;
19
19
  textarea?: boolean;
20
20
  data?: any[];
21
+ childUiSchema?: UiSchema;
21
22
  i18n?: {
22
23
  [key: string]: any;
23
24
  };
24
25
  };
25
26
  ```
27
+ **References:** [UiSchema](./foundation-forms.uischema.md)
28
+
@@ -136,6 +136,7 @@ export type UiSchemaElementOptions = {
136
136
  labelField?: string;
137
137
  textarea?: boolean;
138
138
  data?: any[];
139
+ childUiSchema?: UiSchema;
139
140
  i18n?: {
140
141
  [key: string]: any;
141
142
  };
@@ -146,7 +147,7 @@ export type UiSchemaElementType = 'Control' | 'VerticalLayout' | any;
146
147
 
147
148
  // Warnings were encountered during analysis:
148
149
  //
149
- // src/types.ts:47:3 - (ae-forgotten-export) The symbol "DispatchRenderer" needs to be exported by the entry point index.d.ts
150
+ // src/types.ts:48:3 - (ae-forgotten-export) The symbol "DispatchRenderer" needs to be exported by the entry point index.d.ts
150
151
 
151
152
  // (No @packageDocumentation comment for this package)
152
153
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/foundation-forms",
3
3
  "description": "Genesis Foundation Forms",
4
- "version": "14.15.2",
4
+ "version": "14.16.0",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -20,15 +20,16 @@
20
20
  "PORT": 3090
21
21
  },
22
22
  "scripts": {
23
- "api": "npm run api:extract && npm run api:document",
24
- "api:extract": "api-extractor run",
23
+ "api": "npm run api:extract && npm run api:document && npm run cem:analyze",
25
24
  "api:document": "api-documenter markdown -i dist -o docs/api",
25
+ "api:extract": "api-extractor run",
26
26
  "build": "npm run clean && npm run build:tsc && npm run api",
27
27
  "build:rollup": "rollup -c",
28
28
  "build:rollup:stats": "cross-env ANALYZE=1 npm run build:rollup",
29
29
  "build:tsc": "tsc -b ./tsconfig.json",
30
30
  "build:webpack": "cross-env NODE_ENV=production webpack",
31
31
  "build:webpack:stats": "cross-env ANALYZE=1 npm run build:webpack",
32
+ "cem:analyze": "cem analyze --config custom-elements-manifest.config.js",
32
33
  "clean": "genx clean dist tsconfig.tsbuildinfo .rollup.cache",
33
34
  "dev": "npm run dev:tsc",
34
35
  "dev:rollup": "rollup -c -w --configDev",
@@ -47,8 +48,9 @@
47
48
  "test:unit:watch": "watchlist src test -- npm run test:unit"
48
49
  },
49
50
  "devDependencies": {
50
- "@genesislcap/foundation-testing": "^14.15.2",
51
- "@genesislcap/genx": "^14.15.2",
51
+ "@custom-elements-manifest/analyzer": "^0.8.2",
52
+ "@genesislcap/foundation-testing": "^14.16.0",
53
+ "@genesislcap/genx": "^14.16.0",
52
54
  "@microsoft/api-documenter": "^7.19.13",
53
55
  "@microsoft/api-extractor": "^7.31.1",
54
56
  "@module-federation/dashboard-plugin": "2.3.0",
@@ -99,9 +101,9 @@
99
101
  "webpack-merge": "^5.7.3"
100
102
  },
101
103
  "dependencies": {
102
- "@genesislcap/foundation-comms": "^14.15.2",
103
- "@genesislcap/foundation-criteria": "^14.15.2",
104
- "@genesislcap/foundation-utils": "^14.15.2",
104
+ "@genesislcap/foundation-comms": "^14.16.0",
105
+ "@genesislcap/foundation-criteria": "^14.16.0",
106
+ "@genesislcap/foundation-utils": "^14.16.0",
105
107
  "@jsonforms/core": "^3.0.0",
106
108
  "@microsoft/fast-components": "^2.21.3",
107
109
  "@microsoft/fast-element": "^1.7.0",
@@ -121,5 +123,6 @@
121
123
  "publishConfig": {
122
124
  "access": "public"
123
125
  },
124
- "gitHead": "479a5f8e1a47230bf3a218f22430a96cddb27f8c"
126
+ "customElements": "dist/custom-elements.json",
127
+ "gitHead": "9c10e949c79b418e33593b5ba8048124f4fc699f"
125
128
  }