@genesislcap/foundation-forms 14.439.1 → 14.439.3

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.
@@ -2182,6 +2182,47 @@
2182
2182
  "kind": "field",
2183
2183
  "name": "control"
2184
2184
  },
2185
+ {
2186
+ "kind": "field",
2187
+ "name": "mountedTabs",
2188
+ "type": {
2189
+ "text": "Set<number>"
2190
+ },
2191
+ "default": "new Set([0])"
2192
+ },
2193
+ {
2194
+ "kind": "method",
2195
+ "name": "isMounted",
2196
+ "return": {
2197
+ "type": {
2198
+ "text": "boolean"
2199
+ }
2200
+ },
2201
+ "parameters": [
2202
+ {
2203
+ "name": "index",
2204
+ "type": {
2205
+ "text": "number"
2206
+ }
2207
+ }
2208
+ ]
2209
+ },
2210
+ {
2211
+ "kind": "method",
2212
+ "name": "controlChanged"
2213
+ },
2214
+ {
2215
+ "kind": "method",
2216
+ "name": "handleTabChange",
2217
+ "parameters": [
2218
+ {
2219
+ "name": "event",
2220
+ "type": {
2221
+ "text": "Event"
2222
+ }
2223
+ }
2224
+ ]
2225
+ },
2185
2226
  {
2186
2227
  "kind": "method",
2187
2228
  "name": "hasCategoryError",
@@ -4001,6 +4042,63 @@
4001
4042
  "module": "src/jsonforms/renderers/CategorizationWrapperRenderer.ts"
4002
4043
  }
4003
4044
  },
4045
+ {
4046
+ "kind": "field",
4047
+ "name": "mountedTabs",
4048
+ "type": {
4049
+ "text": "Set<number>"
4050
+ },
4051
+ "default": "new Set([0])",
4052
+ "inheritedFrom": {
4053
+ "name": "CategorizationWrapper",
4054
+ "module": "src/jsonforms/renderers/CategorizationWrapperRenderer.ts"
4055
+ }
4056
+ },
4057
+ {
4058
+ "kind": "method",
4059
+ "name": "isMounted",
4060
+ "return": {
4061
+ "type": {
4062
+ "text": "boolean"
4063
+ }
4064
+ },
4065
+ "parameters": [
4066
+ {
4067
+ "name": "index",
4068
+ "type": {
4069
+ "text": "number"
4070
+ }
4071
+ }
4072
+ ],
4073
+ "inheritedFrom": {
4074
+ "name": "CategorizationWrapper",
4075
+ "module": "src/jsonforms/renderers/CategorizationWrapperRenderer.ts"
4076
+ }
4077
+ },
4078
+ {
4079
+ "kind": "method",
4080
+ "name": "controlChanged",
4081
+ "inheritedFrom": {
4082
+ "name": "CategorizationWrapper",
4083
+ "module": "src/jsonforms/renderers/CategorizationWrapperRenderer.ts"
4084
+ }
4085
+ },
4086
+ {
4087
+ "kind": "method",
4088
+ "name": "handleTabChange",
4089
+ "parameters": [
4090
+ {
4091
+ "name": "event",
4092
+ "type": {
4093
+ "text": "Event"
4094
+ }
4095
+ }
4096
+ ],
4097
+ "inheritedFrom": {
4098
+ "name": "CategorizationWrapper",
4099
+ "module": "src/jsonforms/renderers/CategorizationWrapperRenderer.ts"
4100
+ }
4101
+ },
4004
4102
  {
4005
4103
  "kind": "method",
4006
4104
  "name": "hasCategoryError",
@@ -1,9 +1,13 @@
1
1
  import { FASTElement } from '@microsoft/fast-element';
2
2
  export declare const tabControlIconStyles: import("@microsoft/fast-element").ElementStyles;
3
- export declare const CategorizationWrapperRendererTemplate: (prefix?: string) => import("@microsoft/fast-element").ViewTemplate<any, any>;
3
+ export declare const CategorizationWrapperRendererTemplate: (prefix?: string) => import("@microsoft/fast-element").ViewTemplate<CategorizationWrapper, any>;
4
4
  export declare class CategorizationWrapper extends FASTElement {
5
5
  form: any;
6
6
  control: any;
7
+ mountedTabs: Set<number>;
8
+ isMounted(index: number): boolean;
9
+ controlChanged(): void;
10
+ handleTabChange(event: Event): void;
7
11
  hasCategoryError(categoryIndex: number): boolean;
8
12
  }
9
13
  //# sourceMappingURL=CategorizationWrapperRenderer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CategorizationWrapperRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/CategorizationWrapperRenderer.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,WAAW,EAIZ,MAAM,yBAAyB,CAAC;AAIjC,eAAO,MAAM,oBAAoB,iDAKhC,CAAC;AAEF,eAAO,MAAM,qCAAqC,GAAI,eAAe,6DA8CpE,CAAC;AAsBF,qBAQa,qBAAsB,SAAQ,WAAW;IACxC,IAAI,MAAC;IACL,OAAO,MAAC;IAEpB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO;CAQjD"}
1
+ {"version":3,"file":"CategorizationWrapperRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/CategorizationWrapperRenderer.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,WAAW,EAIZ,MAAM,yBAAyB,CAAC;AAIjC,eAAO,MAAM,oBAAoB,iDAKhC,CAAC;AAEF,eAAO,MAAM,qCAAqC,GAChD,eAAe,+EAqDhB,CAAC;AAsBF,qBAQa,qBAAsB,SAAQ,WAAW;IACxC,IAAI,MAAC;IACL,OAAO,MAAC;IACR,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAgB;IAEpD,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAIjC,cAAc;IAId,eAAe,CAAC,KAAK,EAAE,KAAK;IAO5B,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO;CAQjD"}
@@ -1 +1 @@
1
- {"version":3,"file":"VerticalCategorizationWrapperRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/VerticalCategorizationWrapperRenderer.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,eAAO,MAAM,6CAA6C,GACxD,eAAe,uFAiDhB,CAAC;AAgEF,qBAQa,6BAA8B,SAAQ,qBAAqB;IAChE,MAAM,EAAE,MAAM,CAAM;IAE1B,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAMjD,iBAAiB;CAIlB"}
1
+ {"version":3,"file":"VerticalCategorizationWrapperRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/VerticalCategorizationWrapperRenderer.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,eAAO,MAAM,6CAA6C,GACxD,eAAe,uFA4DhB,CAAC;AAgEF,qBAQa,6BAA8B,SAAQ,qBAAqB;IAChE,MAAM,EAAE,MAAM,CAAM;IAE1B,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAMjD,iBAAiB;CAIlB"}
@@ -8,7 +8,7 @@ export const tabControlIconStyles = css `
8
8
  `;
9
9
  export const CategorizationWrapperRendererTemplate = (prefix = 'zero') => html `
10
10
  <template>
11
- <${prefix}-tabs class="tabs-container">
11
+ <${prefix}-tabs class="tabs-container" @change=${(x, ctx) => x.handleTabChange(ctx.event)}>
12
12
  ${repeat((x) => x.control.uischema.elements, html `
13
13
  <${prefix}-tab class="tab-control">
14
14
  ${(x, ctx) => { var _a; return (_a = x.label) !== null && _a !== void 0 ? _a : `Category ${ctx.index + 1}`; }}
@@ -19,23 +19,25 @@ export const CategorizationWrapperRendererTemplate = (prefix = 'zero') => html `
19
19
  `, { positioning: true })}
20
20
  ${repeat((x) => x.control.uischema.elements, html `
21
21
  <${prefix}-tab-panel class="tab-panel-control">
22
- ${repeat((x) => x.options.childElements, html `
23
- <dispatch-renderer
24
- :submitted=${(x, ctx) => ctx.parentContext.parent.form.submitted}
25
- :dispatch=${(x, ctx) => ctx.parentContext.parent.form.dispatch}
26
- :jsonforms=${(x, ctx) => ctx.parentContext.parent.form.jsonforms}
27
- :prefix=${(x, ctx) => ctx.parentContext.parent.form.prefix}
28
- :props=${(x, ctx) => ({
22
+ ${when((x, ctx) => ctx.parent.isMounted(ctx.index), html `
23
+ ${repeat((x) => x.options.childElements, html `
24
+ <dispatch-renderer
25
+ :submitted=${(x, ctx) => ctx.parentContext.parent.form.submitted}
26
+ :dispatch=${(x, ctx) => ctx.parentContext.parent.form.dispatch}
27
+ :jsonforms=${(x, ctx) => ctx.parentContext.parent.form.jsonforms}
28
+ :prefix=${(x, ctx) => ctx.parentContext.parent.form.prefix}
29
+ :props=${(x, ctx) => ({
29
30
  uischema: x,
30
31
  schema: ctx.parentContext.parent.control.schema,
31
32
  renderers: ctx.parentContext.parent.control.renderers,
32
33
  path: ctx.parentContext.parent.control.path,
33
34
  enabled: ctx.parentContext.parent.control.enabled,
34
35
  })}
35
- ></dispatch-renderer>
36
+ ></dispatch-renderer>
37
+ `)}
36
38
  `)}
37
39
  </${prefix}-tab-panel>
38
- `)}
40
+ `, { positioning: true })}
39
41
  </${prefix}-tabs>
40
42
  </template>
41
43
  `;
@@ -59,6 +61,24 @@ const styles = css `
59
61
  }
60
62
  `;
61
63
  let CategorizationWrapper = class CategorizationWrapper extends FASTElement {
64
+ constructor() {
65
+ super(...arguments);
66
+ this.mountedTabs = new Set([0]);
67
+ }
68
+ isMounted(index) {
69
+ return this.mountedTabs.has(index);
70
+ }
71
+ controlChanged() {
72
+ this.mountedTabs = new Set([0]);
73
+ }
74
+ handleTabChange(event) {
75
+ if (event.target !== event.currentTarget)
76
+ return;
77
+ const index = event.target.currentTabIndex;
78
+ if (this.mountedTabs.has(index))
79
+ return;
80
+ this.mountedTabs = new Set(this.mountedTabs).add(index);
81
+ }
62
82
  hasCategoryError(categoryIndex) {
63
83
  var _a, _b, _c, _d, _e;
64
84
  if (!((_c = (_b = (_a = this.form) === null || _a === void 0 ? void 0 : _a.jsonforms) === null || _b === void 0 ? void 0 : _b.core) === null || _c === void 0 ? void 0 : _c.errors) || !((_e = (_d = this.control) === null || _d === void 0 ? void 0 : _d.uischema) === null || _e === void 0 ? void 0 : _e.elements)) {
@@ -75,6 +95,9 @@ __decorate([
75
95
  __decorate([
76
96
  observable
77
97
  ], CategorizationWrapper.prototype, "control", void 0);
98
+ __decorate([
99
+ observable
100
+ ], CategorizationWrapper.prototype, "mountedTabs", void 0);
78
101
  CategorizationWrapper = __decorate([
79
102
  customElement({
80
103
  name: 'categorization-wrapper',
@@ -3,7 +3,11 @@ import { attr, css, customElement, html, repeat, when, } from '@microsoft/fast-e
3
3
  import { CategorizationWrapper } from './CategorizationWrapperRenderer';
4
4
  export const VerticalCategorizationWrapperRendererTemplate = (prefix = 'zero') => html `
5
5
  <template>
6
- <${prefix}-tabs class="tabs-container" orientation="vertical">
6
+ <${prefix}-tabs
7
+ class="tabs-container"
8
+ orientation="vertical"
9
+ @change=${(x, ctx) => x.handleTabChange(ctx.event)}
10
+ >
7
11
  ${repeat((x) => x.control.uischema.elements, html `
8
12
  <${prefix}-tab class="tab-control" appearance="secondary">
9
13
  <span class="tab-label">
@@ -16,23 +20,25 @@ export const VerticalCategorizationWrapperRendererTemplate = (prefix = 'zero') =
16
20
  `, { positioning: true })}
17
21
  ${repeat((x) => x.control.uischema.elements, html `
18
22
  <${prefix}-tab-panel class="tab-panel-control">
19
- ${repeat((x) => x.options.childElements, html `
20
- <dispatch-renderer
21
- :submitted=${(x, ctx) => ctx.parentContext.parent.form.submitted}
22
- :dispatch=${(x, ctx) => ctx.parentContext.parent.form.dispatch}
23
- :jsonforms=${(x, ctx) => ctx.parentContext.parent.form.jsonforms}
24
- :prefix=${(x, ctx) => ctx.parentContext.parent.form.prefix}
25
- :props=${(x, ctx) => ({
23
+ ${when((x, ctx) => ctx.parent.isMounted(ctx.index), html `
24
+ ${repeat((x) => x.options.childElements, html `
25
+ <dispatch-renderer
26
+ :submitted=${(x, ctx) => ctx.parentContext.parent.form.submitted}
27
+ :dispatch=${(x, ctx) => ctx.parentContext.parent.form.dispatch}
28
+ :jsonforms=${(x, ctx) => ctx.parentContext.parent.form.jsonforms}
29
+ :prefix=${(x, ctx) => ctx.parentContext.parent.form.prefix}
30
+ :props=${(x, ctx) => ({
26
31
  uischema: x,
27
32
  schema: ctx.parentContext.parent.control.schema,
28
33
  renderers: ctx.parentContext.parent.control.renderers,
29
34
  path: ctx.parentContext.parent.control.path,
30
35
  enabled: ctx.parentContext.parent.control.enabled,
31
36
  })}
32
- ></dispatch-renderer>
37
+ ></dispatch-renderer>
38
+ `)}
33
39
  `)}
34
40
  </${prefix}-tab-panel>
35
- `)}
41
+ `, { positioning: true })}
36
42
  </${prefix}-tabs>
37
43
  </template>
38
44
  `;
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.439.1",
4
+ "version": "14.439.3",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -55,23 +55,23 @@
55
55
  }
56
56
  },
57
57
  "devDependencies": {
58
- "@genesislcap/foundation-testing": "14.439.1",
59
- "@genesislcap/genx": "14.439.1",
60
- "@genesislcap/rollup-builder": "14.439.1",
61
- "@genesislcap/ts-builder": "14.439.1",
62
- "@genesislcap/uvu-playwright-builder": "14.439.1",
63
- "@genesislcap/vite-builder": "14.439.1",
64
- "@genesislcap/webpack-builder": "14.439.1",
58
+ "@genesislcap/foundation-testing": "14.439.3",
59
+ "@genesislcap/genx": "14.439.3",
60
+ "@genesislcap/rollup-builder": "14.439.3",
61
+ "@genesislcap/ts-builder": "14.439.3",
62
+ "@genesislcap/uvu-playwright-builder": "14.439.3",
63
+ "@genesislcap/vite-builder": "14.439.3",
64
+ "@genesislcap/webpack-builder": "14.439.3",
65
65
  "@types/json-schema": "^7.0.11",
66
66
  "@types/papaparse": "^5.3.14"
67
67
  },
68
68
  "dependencies": {
69
- "@genesislcap/foundation-comms": "14.439.1",
70
- "@genesislcap/foundation-criteria": "14.439.1",
71
- "@genesislcap/foundation-logger": "14.439.1",
72
- "@genesislcap/foundation-notifications": "14.439.1",
73
- "@genesislcap/foundation-ui": "14.439.1",
74
- "@genesislcap/foundation-utils": "14.439.1",
69
+ "@genesislcap/foundation-comms": "14.439.3",
70
+ "@genesislcap/foundation-criteria": "14.439.3",
71
+ "@genesislcap/foundation-logger": "14.439.3",
72
+ "@genesislcap/foundation-notifications": "14.439.3",
73
+ "@genesislcap/foundation-ui": "14.439.3",
74
+ "@genesislcap/foundation-utils": "14.439.3",
75
75
  "@json-schema-tools/dereferencer": "^1.6.1",
76
76
  "@jsonforms/core": "^3.2.1",
77
77
  "@microsoft/fast-components": "2.30.6",
@@ -93,5 +93,5 @@
93
93
  "access": "public"
94
94
  },
95
95
  "customElements": "dist/custom-elements.json",
96
- "gitHead": "6fe08a1373139e13089e2b5c8f875c81fe59a0df"
96
+ "gitHead": "75d483c70f8d48c49eca72c6da18cb42e1076dd2"
97
97
  }