@genesislcap/foundation-forms 14.468.1-alpha-cc9e439.0 → 14.470.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.
@@ -1,14 +1,17 @@
1
1
  import { FASTElement } from '@microsoft/fast-element';
2
2
  import { UiSchemaElement } from '../../types';
3
3
  /**
4
- * Resolves the `activeCategory` option (the zero-based index of the category
5
- * tab that should open on first render) to a valid tab index. Out-of-bounds or
6
- * non-numeric values fall back to `0` (the first tab), preserving the default
7
- * behaviour.
4
+ * Resolves the `className` option declared on a categorization category element
5
+ * to the class name(s) that should be applied to its tab header. Mirrors the
6
+ * control-level `className` option: either a static string, or a function that
7
+ * receives the entire form data and returns the class name(s).
8
+ *
9
+ * Tab headers render eagerly (unlike the lazily-mounted panels), so a class
10
+ * applied here is in the DOM for every category on first paint — even before
11
+ * its panel is opened.
8
12
  *
9
13
  * @internal
10
14
  */
11
- export declare function resolveActiveCategoryIndex(activeCategory: number | undefined, elements: UiSchemaElement[]): number;
12
15
  export declare function computeCategoryClassName(category: UiSchemaElement, data: any): string;
13
16
  export declare const tabControlIconStyles: import("@microsoft/fast-element").ElementStyles;
14
17
  export declare const CategorizationWrapperRendererTemplate: (prefix?: string) => import("@microsoft/fast-element").ViewTemplate<CategorizationWrapper, any>;
@@ -16,8 +19,6 @@ export declare class CategorizationWrapper extends FASTElement {
16
19
  form: any;
17
20
  control: any;
18
21
  mountedTabs: Set<number>;
19
- activeTabIndex: number;
20
- controlChanged(): void;
21
22
  isMounted(index: number): boolean;
22
23
  handleTabChange(event: Event): void;
23
24
  hasCategoryError(categoryIndex: number): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"CategorizationWrapperRenderer.d.ts","sourceRoot":"","sources":["../../../../src/jsonforms/renderers/CategorizationWrapperRenderer.ts"],"names":[],"mappings":"AACA,OAAO,EAKL,WAAW,EAIZ,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAA2C,eAAe,EAAE,MAAM,aAAa,CAAC;AAEvF;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,CACxC,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,QAAQ,EAAE,eAAe,EAAE,GAC1B,MAAM,CAKR;AAED,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,eAAe,EAAE,IAAI,EAAE,GAAG,GAAG,MAAM,CAMrF;AAED,eAAO,MAAM,oBAAoB,iDAKhC,CAAC;AAEF,eAAO,MAAM,qCAAqC,GAChD,eAAe,+EA6DhB,CAAC;AAkBF,qBAQa,qBAAsB,SAAQ,WAAW;IACxC,IAAI,MAAC;IACL,OAAO,MAAC;IACR,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAgB;IACxC,cAAc,EAAE,MAAM,CAAK;IAEvC,cAAc;IASd,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAIjC,eAAe,CAAC,KAAK,EAAE,KAAK;IAQ5B,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;AAGjC,OAAO,EAA2C,eAAe,EAAE,MAAM,aAAa,CAAC;AAEvF;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,eAAe,EAAE,IAAI,EAAE,GAAG,GAAG,MAAM,CAMrF;AAED,eAAO,MAAM,oBAAoB,iDAKhC,CAAC;AAEF,eAAO,MAAM,qCAAqC,GAChD,eAAe,+EA4DhB,CAAC;AAkBF,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,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":"AAUA,OAAO,EAAE,qBAAqB,EAA4B,MAAM,iCAAiC,CAAC;AAElG,eAAO,MAAM,6CAA6C,GACxD,eAAe,uFA0EhB,CAAC;AAmEF,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":"AAUA,OAAO,EAAE,qBAAqB,EAA4B,MAAM,iCAAiC,CAAC;AAElG,eAAO,MAAM,6CAA6C,GACxD,eAAe,uFAwEhB,CAAC;AAmEF,qBAQa,6BAA8B,SAAQ,qBAAqB;IAChE,MAAM,EAAE,MAAM,CAAM;IAE1B,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;IAMjD,iBAAiB;CAIlB"}
@@ -2,19 +2,17 @@ import { __decorate } from "tslib";
2
2
  import { html, css, observable, customElement, FASTElement, repeat, when, } from '@microsoft/fast-element';
3
3
  import { classNames } from '@microsoft/fast-web-utilities';
4
4
  /**
5
- * Resolves the `activeCategory` option (the zero-based index of the category
6
- * tab that should open on first render) to a valid tab index. Out-of-bounds or
7
- * non-numeric values fall back to `0` (the first tab), preserving the default
8
- * behaviour.
5
+ * Resolves the `className` option declared on a categorization category element
6
+ * to the class name(s) that should be applied to its tab header. Mirrors the
7
+ * control-level `className` option: either a static string, or a function that
8
+ * receives the entire form data and returns the class name(s).
9
+ *
10
+ * Tab headers render eagerly (unlike the lazily-mounted panels), so a class
11
+ * applied here is in the DOM for every category on first paint — even before
12
+ * its panel is opened.
9
13
  *
10
14
  * @internal
11
15
  */
12
- export function resolveActiveCategoryIndex(activeCategory, elements) {
13
- if (typeof activeCategory === 'number') {
14
- return activeCategory >= 0 && activeCategory < elements.length ? activeCategory : 0;
15
- }
16
- return 0;
17
- }
18
16
  export function computeCategoryClassName(category, data) {
19
17
  var _a, _b;
20
18
  const className = (_a = category === null || category === void 0 ? void 0 : category.options) === null || _a === void 0 ? void 0 : _a.className;
@@ -31,10 +29,9 @@ export const tabControlIconStyles = css `
31
29
  `;
32
30
  export const CategorizationWrapperRendererTemplate = (prefix = 'zero') => html `
33
31
  <template>
34
- <${prefix}-tabs appearance="secondary" class="tabs-container" :activeid="${(x) => 'tab-' + x.activeTabIndex}" @change=${(x, ctx) => x.handleTabChange(ctx.event)}>
32
+ <${prefix}-tabs appearance="secondary" class="tabs-container" @change=${(x, ctx) => x.handleTabChange(ctx.event)}>
35
33
  ${repeat((x) => x.control.uischema.elements, html `
36
34
  <${prefix}-tab
37
- id="${(x, ctx) => 'tab-' + ctx.index}"
38
35
  appearance="secondary"
39
36
  class="${(x, ctx) => {
40
37
  var _a, _b, _c;
@@ -92,18 +89,6 @@ let CategorizationWrapper = class CategorizationWrapper extends FASTElement {
92
89
  constructor() {
93
90
  super(...arguments);
94
91
  this.mountedTabs = new Set([0]);
95
- this.activeTabIndex = 0;
96
- }
97
- controlChanged() {
98
- var _a, _b, _c, _d;
99
- if (!this.control)
100
- return;
101
- const activeCategory = (_b = (_a = this.control.uischema) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.activeCategory;
102
- if (activeCategory === undefined)
103
- return;
104
- const index = resolveActiveCategoryIndex(activeCategory, (_d = (_c = this.control.uischema) === null || _c === void 0 ? void 0 : _c.elements) !== null && _d !== void 0 ? _d : []);
105
- this.activeTabIndex = index;
106
- this.mountedTabs = new Set([index]);
107
92
  }
108
93
  isMounted(index) {
109
94
  return this.mountedTabs.has(index);
@@ -112,7 +97,6 @@ let CategorizationWrapper = class CategorizationWrapper extends FASTElement {
112
97
  if (event.target !== event.currentTarget)
113
98
  return;
114
99
  const index = event.target.currentTabIndex;
115
- this.activeTabIndex = index;
116
100
  if (this.mountedTabs.has(index))
117
101
  return;
118
102
  this.mountedTabs = new Set(this.mountedTabs).add(index);
@@ -136,9 +120,6 @@ __decorate([
136
120
  __decorate([
137
121
  observable
138
122
  ], CategorizationWrapper.prototype, "mountedTabs", void 0);
139
- __decorate([
140
- observable
141
- ], CategorizationWrapper.prototype, "activeTabIndex", void 0);
142
123
  CategorizationWrapper = __decorate([
143
124
  customElement({
144
125
  name: 'categorization-wrapper',
@@ -7,12 +7,10 @@ export const VerticalCategorizationWrapperRendererTemplate = (prefix = 'zero') =
7
7
  <${prefix}-tabs
8
8
  class="tabs-container"
9
9
  orientation="vertical"
10
- :activeid="${(x) => 'tab-' + x.activeTabIndex}"
11
10
  @change=${(x, ctx) => x.handleTabChange(ctx.event)}
12
11
  >
13
12
  ${repeat((x) => x.control.uischema.elements, html `
14
13
  <${prefix}-tab
15
- id="${(x, ctx) => 'tab-' + ctx.index}"
16
14
  class="${(x, ctx) => {
17
15
  var _a, _b, _c;
18
16
  const custom = computeCategoryClassName(x, (_c = (_b = (_a = ctx.parent.form) === null || _a === void 0 ? void 0 : _a.jsonforms) === null || _b === void 0 ? void 0 : _b.core) === null || _c === void 0 ? void 0 : _c.data);
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.468.1-alpha-cc9e439.0",
4
+ "version": "14.470.0",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -59,13 +59,13 @@
59
59
  }
60
60
  },
61
61
  "devDependencies": {
62
- "@genesislcap/foundation-testing": "14.468.1-alpha-cc9e439.0",
63
- "@genesislcap/genx": "14.468.1-alpha-cc9e439.0",
64
- "@genesislcap/rollup-builder": "14.468.1-alpha-cc9e439.0",
65
- "@genesislcap/ts-builder": "14.468.1-alpha-cc9e439.0",
66
- "@genesislcap/uvu-playwright-builder": "14.468.1-alpha-cc9e439.0",
67
- "@genesislcap/vite-builder": "14.468.1-alpha-cc9e439.0",
68
- "@genesislcap/webpack-builder": "14.468.1-alpha-cc9e439.0",
62
+ "@genesislcap/foundation-testing": "14.470.0",
63
+ "@genesislcap/genx": "14.470.0",
64
+ "@genesislcap/rollup-builder": "14.470.0",
65
+ "@genesislcap/ts-builder": "14.470.0",
66
+ "@genesislcap/uvu-playwright-builder": "14.470.0",
67
+ "@genesislcap/vite-builder": "14.470.0",
68
+ "@genesislcap/webpack-builder": "14.470.0",
69
69
  "@types/json-schema": "^7.0.11",
70
70
  "@types/papaparse": "^5.3.14"
71
71
  },
@@ -82,12 +82,12 @@
82
82
  }
83
83
  },
84
84
  "dependencies": {
85
- "@genesislcap/foundation-comms": "14.468.1-alpha-cc9e439.0",
86
- "@genesislcap/foundation-criteria": "14.468.1-alpha-cc9e439.0",
87
- "@genesislcap/foundation-logger": "14.468.1-alpha-cc9e439.0",
88
- "@genesislcap/foundation-notifications": "14.468.1-alpha-cc9e439.0",
89
- "@genesislcap/foundation-ui": "14.468.1-alpha-cc9e439.0",
90
- "@genesislcap/foundation-utils": "14.468.1-alpha-cc9e439.0",
85
+ "@genesislcap/foundation-comms": "14.470.0",
86
+ "@genesislcap/foundation-criteria": "14.470.0",
87
+ "@genesislcap/foundation-logger": "14.470.0",
88
+ "@genesislcap/foundation-notifications": "14.470.0",
89
+ "@genesislcap/foundation-ui": "14.470.0",
90
+ "@genesislcap/foundation-utils": "14.470.0",
91
91
  "@json-schema-tools/dereferencer": "^1.6.1",
92
92
  "@jsonforms/core": "^3.2.1",
93
93
  "@microsoft/fast-components": "2.30.6",
@@ -109,5 +109,5 @@
109
109
  "access": "public"
110
110
  },
111
111
  "customElements": "dist/custom-elements.json",
112
- "gitHead": "0f506538109fece5091fa2d6b42cb84271d1bf67"
112
+ "gitHead": "c222968b05dd3bb5db608222696b1f59a1c65913"
113
113
  }