@genesislcap/grid-pro 14.318.0 → 14.320.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/README.md CHANGED
@@ -105,32 +105,149 @@ The `<grid-pro>` element supports the following attributes and properties:
105
105
 
106
106
  |Name|Type|Default|Description|
107
107
  |----|----|-------|-----------|
108
- | `:rowData` | `any[]` | - | **Manual data**: Array of row data for scenarios where you set data manually without using datasource components. |
109
- | `:gridComponents` | `{[componentName: string]: any}` | - | **Custom components**: Object containing custom AG Grid components (cell renderers, editors, filters). |
110
- | `:eventsAndCallbacks` | `GridProEventsAndCallbacks` | - | **AG Grid events**: Object containing AG Grid event handlers and callbacks. |
111
- | `:gridFontFace` | `string` | `defaultAgGridFontFace` | **Font configuration**: Font face configuration for AG Grid themes. |
112
- | `auto-cell-renderer-by-type` | `boolean` | `false` | **Genesis-specific**: Enable automatic cell renderer selection by data type. |
113
- | `only-template-col-defs` | `boolean` | `false` | **Genesis-specific**: Use only template-defined column definitions, ignore metadata. |
114
- | `grid-autosizing` | `boolean` | `false` | **Important**: Controls automatic column sizing on interaction. Disables manual column widths and local storage persistence of widths. |
115
108
  | `add-index` | `number` | `0` | Index position for new rows when using `applyTransaction` or `applyTransactionAsync`. |
116
109
  | `async-add` | `boolean` | `false` | Use `applyTransactionAsync` for add transactions (better performance for large datasets). |
117
110
  | `async-remove` | `boolean` | `false` | Use `applyTransactionAsync` for remove transactions (better performance for large datasets). |
118
111
  | `async-update` | `boolean` | `true` | Use `applyTransactionAsync` for update transactions (enabled by default for performance). |
112
+ | `auto-cell-renderer-by-type` | `boolean` | `false` | **Genesis-specific**: Enable automatic cell renderer selection by data type. |
113
+ | `column-component-name` | `string` | `grid-pro-column` | **Internal**: Name of the column component to use. |
119
114
  | `enable-cell-flashing` | `boolean` | `false` | Enable cell flashing animations when cell values change. |
120
115
  | `enable-row-flashing` | `boolean` | `false` | Enable row flashing animations for add transactions. |
121
116
  | `enabled-row-flashing` | `boolean` | `false` | **@deprecated** - Use `enable-row-flashing` instead. |
122
- | `persist-column-state-key` | `string` | - | **Key for persisting column state** in local browser or KV storage. Essential for maintaining user preferences. |
123
- | `persist-filter-model-key` | `string` | - | **Key for persisting filter model** in local browser or KV storage. Maintains filter state across sessions. |
117
+ | `grid-autosizing` | `boolean` | `false` | **Important**: Controls automatic column sizing on interaction. Disables manual column widths and local storage persistence of widths. |
124
118
  | `header-case-type` | `GridProCaseType` | `CONSTANT_CASE` | Transform header names: `camelCase`, `capitalCase`, `dotCase`, `headerCase`, `noCase`, `paramCase`, `pascalCase`, `pathCase`, `sentenceCase`, `snakeCase`. |
125
- | `column-component-name` | `string` | `grid-pro-column` | **Internal**: Name of the column component to use. |
126
119
  | `header-height` | `number` | - | Custom header height in pixels. Overrides theme defaults. |
127
- | `row-height` | `number` | - | Custom row height in pixels. Overrides theme defaults. |
128
- | `theme` | `string` | `alpine` | AG Grid theme name. Available: `alpine`, `alpine-dark`, `balham`, `balham-dark`, `material`. |
120
+ | `only-template-col-defs` | `boolean` | `false` | **Genesis-specific**: Use only template-defined column definitions, ignore metadata. |
129
121
  | `pagination` | `boolean` | `false` | **Enables pagination**. Basic pagination works with AG Grid Community edition. **Enterprise features** like custom pagination components require AG Grid Enterprise. Works with both client-side and server-side datasources. |
130
122
  | `pagination-page-size` | `number` | `25` | Number of rows per page when pagination is enabled. |
123
+ | `persist-column-state-key` | `string` | - | **Key for persisting column state** in local browser or KV storage. Essential for maintaining user preferences. |
124
+ | `persist-filter-model-key` | `string` | - | **Key for persisting filter model** in local browser or KV storage. Maintains filter state across sessions. |
125
+ | `row-height` | `number` | - | Custom row height in pixels. Overrides theme defaults. |
126
+ | `theme` | `string` | `alpine` | AG Grid theme name. Available: `alpine`, `alpine-dark`, `balham`, `balham-dark`, `material`. |
131
127
  | `with-status-bar` | `boolean` | `false` | **Enterprise Feature**: Enables status bar at bottom of grid. **Requires AG Grid Enterprise module**. |
128
+ | `:customErrorHandlerTemplate` | `(prefix: string, gridErrorItems: GridProErrorItem<any>[]) => ViewTemplate` | - | **Custom error handling**: Function that returns a custom template for displaying datasource errors. If not provided, uses the default error dialog. |
129
+ | `:eventsAndCallbacks` | `GridProEventsAndCallbacks` | - | **AG Grid events**: Object containing AG Grid event handlers and callbacks. |
130
+ | `:gridComponents` | `{[componentName: string]: any}` | - | **Custom components**: Object containing custom AG Grid components (cell renderers, editors, filters). |
131
+ | `:gridFontFace` | `string` | `defaultAgGridFontFace` | **Font configuration**: Font face configuration for AG Grid themes. |
132
+ | `:rowData` | `any[]` | - | **Manual data**: Array of row data for scenarios where you set data manually without using datasource components. |
132
133
  | `:statusBarConfig` | `GridProStatusBarConfig` | `DEFAULT_STATUS_BAR_CONFIG` | **Enterprise Feature**: Configuration for status bar components. Must use binding syntax with observable property. |
133
134
 
135
+ ## Custom Error Handling
136
+
137
+ **Custom Error Handler Template**: Grid Pro allows you to provide a custom template for displaying datasource errors using the `customErrorHandlerTemplate` attribute. This gives you full control over the error display UI.
138
+
139
+ ### Custom Error Handler Configuration
140
+
141
+ The `customErrorHandlerTemplate` property accepts a function that receives:
142
+ - `prefix`: Design system prefix (e.g., 'rapid', 'foundation')
143
+ - `gridErrorItems`: Array of error items with `detail` and `type` properties
144
+
145
+ ```typescript
146
+ interface GridProErrorItem<T = any> {
147
+ detail: T; // Error details (message, object, etc.)
148
+ type: string; // Error type ('datasource', etc.)
149
+ }
150
+ ```
151
+
152
+ **Available Utility Functions:**
153
+
154
+ Grid Pro exports an `extractErrorMessage` utility function that can help extract user-friendly error messages from error details:
155
+
156
+ ```typescript
157
+ import { extractErrorMessage } from '@genesislcap/grid-pro';
158
+
159
+ // Usage in custom error templates
160
+ const message = extractErrorMessage(error.detail);
161
+ ```
162
+
163
+ This utility handles various error detail formats and provides consistent message extraction.
164
+
165
+ ### Usage Examples
166
+
167
+ **1. Simple Custom Error Dialog:**
168
+
169
+ ```html
170
+ <grid-pro
171
+ :customErrorHandlerTemplate="${() => myCustomErrorTemplate}">
172
+ <grid-pro-client-side-datasource
173
+ resource-name="ALL_TRADES">
174
+ </grid-pro-client-side-datasource>
175
+ </grid-pro>
176
+ ```
177
+
178
+ **Custom Error Template Implementation:**
179
+
180
+ ```typescript
181
+ import { html, when } from '@microsoft/fast-element';
182
+ import { GridProErrorItem } from '@genesislcap/grid-pro';
183
+
184
+ const customErrorTemplate = (prefix: string, errors: GridProErrorItem<any>[]) => html`
185
+ ${when(() => errors.length > 0, html`
186
+ <div class="custom-error-overlay">
187
+ <${prefix}-card class="error-card">
188
+ <h3>⚠️ Connection Error</h3>
189
+ <p>Unable to load data. Please check your connection.</p>
190
+ <${prefix}-button @click=${(x) => x.querySelector('grid-pro').hideDatasourceError()}>
191
+ Dismiss
192
+ </${prefix}-button>
193
+ </${prefix}-card>
194
+ </div>
195
+ `)}
196
+ `;
197
+ ```
198
+
199
+ **2. Advanced Custom Error Handler with Details:**
200
+
201
+ ```html
202
+ <grid-pro
203
+ :customErrorHandlerTemplate="${() => advancedErrorHandlerTemplate}">
204
+ <grid-pro-server-side-datasource
205
+ resource-name="ALL_POSITIONS">
206
+ </grid-pro-server-side-datasource>
207
+ </grid-pro>
208
+ ```
209
+
210
+ **Advanced Error Template Implementation:**
211
+
212
+ ```typescript
213
+ import { html, when, repeat } from '@microsoft/fast-element';
214
+ import { extractErrorMessage } from '@genesislcap/grid-pro';
215
+
216
+ const advancedErrorHandlerTemplate = (prefix: string, errors: GridProErrorItem<any>[]) => html`
217
+ ${when(() => errors.length > 0, html`
218
+ <div class="error-overlay">
219
+ <${prefix}-dialog class="custom-error-dialog" open>
220
+ <h2 slot="header">Data Loading Failed</h2>
221
+ <div class="error-content">
222
+ <p>Failed to load grid data:</p>
223
+ <ul class="error-list">
224
+ ${repeat(errors, html`
225
+ <li>${(error) => extractErrorMessage(error.detail)}</li>
226
+ `)}
227
+ </ul>
228
+ </div>
229
+ <div slot="footer">
230
+ <${prefix}-button
231
+ appearance="accent"
232
+ @click=${(x) => {
233
+ const grid = x.querySelector('grid-pro');
234
+ grid.hideDatasourceError();
235
+ grid.querySelector('grid-pro-server-side-datasource')?.restart();
236
+ }}>
237
+ Reload Data
238
+ </${prefix}-button>
239
+ <${prefix}-button
240
+ appearance="lightweight"
241
+ @click=${(x) => x.querySelector('grid-pro').hideDatasourceError()}>
242
+ Dismiss
243
+ </${prefix}-button>
244
+ </div>
245
+ </${prefix}-dialog>
246
+ </div>
247
+ `)}
248
+ `;
249
+ ```
250
+
134
251
  #### Status Bar Configuration
135
252
 
136
253
  **Enterprise License Required**: Status bar functionality requires the AG Grid Enterprise license and the `StatusBarModule` to be registered (see [Enterprise Module Registration](#enterprise-module-registration) above). Status bar components will only be displayed if the Enterprise module is properly licensed and configured.
@@ -586,6 +586,14 @@
586
586
  "default": "false",
587
587
  "description": "Enables or disables the grid status bar."
588
588
  },
589
+ {
590
+ "kind": "field",
591
+ "name": "customErrorHandlerTemplate",
592
+ "type": {
593
+ "text": "(\n prefix: string,\n gridErrorItems: GridProErrorItem<any>[],\n ) => ViewTemplate | undefined"
594
+ },
595
+ "description": "Custom error handler dialog template function."
596
+ },
589
597
  {
590
598
  "kind": "field",
591
599
  "name": "columnState",
@@ -4198,7 +4206,7 @@
4198
4206
  "type": {
4199
4207
  "text": "ActionMenuItem[]"
4200
4208
  },
4201
- "description": "Array of {@link @genesislcap/foundation-ui#ActionMenuItem}to be displayed in the menu.\n * "
4209
+ "description": "Array of `ActionMenuItem` to be displayed in the menu."
4202
4210
  },
4203
4211
  {
4204
4212
  "name": "overrideDef",
@@ -9667,7 +9675,7 @@
9667
9675
  {
9668
9676
  "kind": "variable",
9669
9677
  "name": "errorHandlerDialogStyles",
9670
- "default": "css`\n .overlay {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n background-color: var(--datasource-error-background-color, var(--neutral-layer-4));\n opacity: var(--datasource-error-background-opacity, 0.5);\n z-index: 1000;\n pointer-events: auto;\n border-radius: 2px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .dialog-container {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n max-width: 90vw;\n max-height: 90vh;\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n opacity: 1 !important;\n filter: none !important;\n box-sizing: border-box;\n }\n .grid-datasource-error-dialog {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n margin: 0 auto;\n max-width: 400px;\n width: 100%;\n box-sizing: border-box;\n background: var(--dialog-background, #2d2533);\n box-shadow: 0 4px 32px 0 rgba(0, 0, 0, 0.45);\n overflow: visible;\n min-height: 120px;\n }\n .error-details {\n max-height: 120px;\n overflow: auto;\n width: 100%;\n margin-top: 8px;\n }\n`"
9678
+ "default": "css`\n .overlay {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n background-color: var(--datasource-error-background-color, var(--neutral-layer-4));\n opacity: var(--datasource-error-background-opacity, 0.5);\n z-index: 1000;\n pointer-events: auto;\n border-radius: 2px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n .dialog-container {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n z-index: 1001;\n max-width: 90vw;\n max-height: 90vh;\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n opacity: 1 !important;\n filter: none !important;\n box-sizing: border-box;\n }\n .grid-datasource-error-dialog {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n margin: 0 auto;\n max-width: 600px;\n width: 100%;\n box-sizing: border-box;\n background: var(--dialog-background, #2d2533);\n box-shadow: 0 4px 32px 0 rgba(0, 0, 0, 0.45);\n overflow: visible;\n min-height: 120px;\n }\n\n .grid-datasource-error-dialog div {\n width: 600px;\n }\n\n .grid-datasource-error-dialog [slot='top'] {\n margin-bottom: 0;\n }\n\n .grid-datasource-error-dialog [slot='bottom'] {\n display: flex;\n justify-content: flex-end;\n width: 100%;\n }\n\n .error-details {\n max-height: 120px;\n overflow: auto;\n width: 100%;\n margin-top: 8px;\n }\n`"
9671
9679
  },
9672
9680
  {
9673
9681
  "kind": "function",
@@ -9682,7 +9690,7 @@
9682
9690
  {
9683
9691
  "name": "gridErrorItems",
9684
9692
  "type": {
9685
- "text": "any[]"
9693
+ "text": "GridProErrorItem<any>[]"
9686
9694
  }
9687
9695
  }
9688
9696
  ]
@@ -15716,6 +15724,42 @@
15716
15724
  }
15717
15725
  ]
15718
15726
  },
15727
+ {
15728
+ "kind": "javascript-module",
15729
+ "path": "src/utils/error.ts",
15730
+ "declarations": [
15731
+ {
15732
+ "kind": "function",
15733
+ "name": "extractErrorMessage",
15734
+ "return": {
15735
+ "type": {
15736
+ "text": ""
15737
+ }
15738
+ },
15739
+ "parameters": [
15740
+ {
15741
+ "name": "detail",
15742
+ "type": {
15743
+ "text": "any"
15744
+ },
15745
+ "description": "The error detail, which can be a string, array, or object."
15746
+ }
15747
+ ],
15748
+ "description": "Extracts a user-friendly error message from a given error detail.",
15749
+ "privacy": "public"
15750
+ }
15751
+ ],
15752
+ "exports": [
15753
+ {
15754
+ "kind": "js",
15755
+ "name": "extractErrorMessage",
15756
+ "declaration": {
15757
+ "name": "extractErrorMessage",
15758
+ "module": "src/utils/error.ts"
15759
+ }
15760
+ }
15761
+ ]
15762
+ },
15719
15763
  {
15720
15764
  "kind": "javascript-module",
15721
15765
  "path": "src/utils/index.ts",
@@ -15729,6 +15773,14 @@
15729
15773
  "package": "./array"
15730
15774
  }
15731
15775
  },
15776
+ {
15777
+ "kind": "js",
15778
+ "name": "*",
15779
+ "declaration": {
15780
+ "name": "*",
15781
+ "package": "./error"
15782
+ }
15783
+ },
15732
15784
  {
15733
15785
  "kind": "js",
15734
15786
  "name": "*",
@@ -30,7 +30,7 @@ export declare const foundationGridProActionsMenuRenderer: (overrideDefinition?:
30
30
  /**
31
31
  * Helper function to get ColDef {@link https://www.ag-grid.com/javascript-data-grid/column-properties/} for Actions Menu Renderer.
32
32
  * Will take the parameter values for a base ColDef and merge them with the overrideDef (if specified).
33
- * @param actions - Array of {@link @genesislcap/foundation-ui#ActionMenuItem} to be displayed in the menu.
33
+ * @param actions - Array of `ActionMenuItem` to be displayed in the menu.
34
34
  * @param overrideDef - Optional override for the ColDef. Will override any of the default values. Default is an empty object.
35
35
  * @param customActionsOpenerName - Optional custom name for the button that opens the menu. Default is '⋮'.
36
36
  * @param isVertical - Optional flag to display the menu vertically. Default is false (displays the menu horizontally, follow the rowHeight).
@@ -1,3 +1,4 @@
1
+ import type { GridProErrorItem } from '../grid-pro.types';
1
2
  export declare const errorHandlerDialogStyles: import("@microsoft/fast-element").ElementStyles;
2
- export declare function getErrorHandlerDialogTemplate(prefix: string, gridErrorItems: any[]): import("@microsoft/fast-element").ViewTemplate<any, any>;
3
+ export declare function getErrorHandlerDialogTemplate(prefix: string, gridErrorItems: GridProErrorItem<any>[]): import("@microsoft/fast-element").ViewTemplate<any, any>;
3
4
  //# sourceMappingURL=error-handler.dialog.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-handler.dialog.d.ts","sourceRoot":"","sources":["../../../src/datasource/error-handler.dialog.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,wBAAwB,iDAoDpC,CAAC;AAEF,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,GAAG,EAAE,4DAiDlF"}
1
+ {"version":3,"file":"error-handler.dialog.d.ts","sourceRoot":"","sources":["../../../src/datasource/error-handler.dialog.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAG1D,eAAO,MAAM,wBAAwB,iDAmEpC,CAAC;AAEF,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,MAAM,EACd,cAAc,EAAE,gBAAgB,CAAC,GAAG,CAAC,EAAE,4DAgDxC"}
@@ -1,5 +1,6 @@
1
1
  import type { ColDef, ColumnApi, GridApi, GridOptions, GridParams } from '@ag-grid-community/core';
2
2
  import { ColumnState, Grid } from '@ag-grid-community/core';
3
+ import { ViewTemplate } from '@microsoft/fast-element';
3
4
  import { FoundationElement } from '@microsoft/fast-foundation';
4
5
  import { GridProBaseDatasource } from './datasource/base.datasource';
5
6
  import type { GridComponents, GridProCaseType, GridProErrorEvent, GridProErrorItem, GridProEventsAndCallbacks } from './grid-pro.types';
@@ -504,6 +505,14 @@ export declare class GridPro extends GridPro_base {
504
505
  * This requires AG Grid Enterprise module to be available for the status bar to be displayed when enabled.
505
506
  */
506
507
  withStatusBar: boolean;
508
+ /**
509
+ * Custom error handler dialog template function.
510
+ * @remarks
511
+ * When provided, this function will be used to render custom error dialogs instead of the default error handler.
512
+ * The function should accept a prefix string and an array of grid error items and return a ViewTemplate.
513
+ * If not provided, the default error handler dialog template will be used.
514
+ */
515
+ customErrorHandlerTemplate?: (prefix: string, gridErrorItems: GridProErrorItem<any>[]) => ViewTemplate;
507
516
  private columnState;
508
517
  protected agAttributes: Record<string, string>;
509
518
  protected agPropertiesMap: Record<string, string>;
@@ -676,12 +685,12 @@ export declare const foundationGridPro: (overrideDefinition?: import("@microsoft
676
685
  shadowOptions: any;
677
686
  baseName: string;
678
687
  styles: import("@microsoft/fast-element").ElementStyles;
679
- template: import("@microsoft/fast-element").ViewTemplate<any, any>;
688
+ template: ViewTemplate<any, any>;
680
689
  }>) => import("@microsoft/fast-foundation").FoundationElementRegistry<{
681
690
  shadowOptions: any;
682
691
  baseName: string;
683
692
  styles: import("@microsoft/fast-element").ElementStyles;
684
- template: import("@microsoft/fast-element").ViewTemplate<any, any>;
693
+ template: ViewTemplate<any, any>;
685
694
  }, typeof GridPro>;
686
695
  export {};
687
696
  //# sourceMappingURL=grid-pro.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"grid-pro.d.ts","sourceRoot":"","sources":["../../src/grid-pro.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,MAAM,EACN,SAAS,EAET,OAAO,EACP,WAAW,EACX,UAAU,EAEX,MAAM,yBAAy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"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,eAAqB,+BAYvD,CAAC;AACF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,YAAmC,CAAC"}
1
+ {"version":3,"file":"grid-pro.template.d.ts","sourceRoot":"","sources":["../../src/grid-pro.template.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,GAAI,eAAqB,+BAiBvD,CAAC;AACF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,YAAmC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Extracts a user-friendly error message from a given error detail.
3
+ * @param detail - The error detail, which can be a string, array, or object.
4
+ * @returns A user-friendly error message.
5
+ * @public
6
+ */
7
+ export declare const extractErrorMessage: (detail: any) => string;
8
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../src/utils/error.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,GAAI,QAAQ,GAAG,KAAG,MAYjD,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from './array';
2
+ export * from './error';
2
3
  export * from './logger';
3
4
  export * from './map';
4
5
  export * from './sanitasations';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,OAAO,CAAC;AACtB,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC"}
@@ -44,7 +44,7 @@ export const foundationGridProActionsMenuRenderer = ActionsMenuRenderer.compose(
44
44
  /**
45
45
  * Helper function to get ColDef {@link https://www.ag-grid.com/javascript-data-grid/column-properties/} for Actions Menu Renderer.
46
46
  * Will take the parameter values for a base ColDef and merge them with the overrideDef (if specified).
47
- * @param actions - Array of {@link @genesislcap/foundation-ui#ActionMenuItem} to be displayed in the menu.
47
+ * @param actions - Array of `ActionMenuItem` to be displayed in the menu.
48
48
  * @param overrideDef - Optional override for the ColDef. Will override any of the default values. Default is an empty object.
49
49
  * @param customActionsOpenerName - Optional custom name for the button that opens the menu. Default is '⋮'.
50
50
  * @param isVertical - Optional flag to display the menu vertically. Default is false (displays the menu horizontally, follow the rowHeight).
@@ -1,21 +1,5 @@
1
1
  import { css, html, when, repeat } from '@microsoft/fast-element';
2
- const extractMessage = (detail) => {
3
- if (!detail)
4
- return '';
5
- if (typeof detail === 'string')
6
- return detail;
7
- if (Array.isArray(detail)) {
8
- return detail.map(extractMessage).join(', ');
9
- }
10
- if (typeof detail === 'object') {
11
- if ('message' in detail && typeof detail.message === 'string')
12
- return detail.message;
13
- if ('TEXT' in detail && typeof detail.TEXT === 'string')
14
- return detail.TEXT;
15
- return JSON.stringify(detail);
16
- }
17
- return String(detail);
18
- };
2
+ import { extractErrorMessage } from '../utils';
19
3
  export const errorHandlerDialogStyles = css `
20
4
  .overlay {
21
5
  position: absolute;
@@ -54,7 +38,7 @@ export const errorHandlerDialogStyles = css `
54
38
  align-items: center;
55
39
  justify-content: center;
56
40
  margin: 0 auto;
57
- max-width: 400px;
41
+ max-width: 600px;
58
42
  width: 100%;
59
43
  box-sizing: border-box;
60
44
  background: var(--dialog-background, #2d2533);
@@ -62,6 +46,21 @@ export const errorHandlerDialogStyles = css `
62
46
  overflow: visible;
63
47
  min-height: 120px;
64
48
  }
49
+
50
+ .grid-datasource-error-dialog div {
51
+ width: 600px;
52
+ }
53
+
54
+ .grid-datasource-error-dialog [slot='top'] {
55
+ margin-bottom: 0;
56
+ }
57
+
58
+ .grid-datasource-error-dialog [slot='bottom'] {
59
+ display: flex;
60
+ justify-content: flex-end;
61
+ width: 100%;
62
+ }
63
+
65
64
  .error-details {
66
65
  max-height: 120px;
67
66
  overflow: auto;
@@ -82,22 +81,20 @@ export function getErrorHandlerDialogTemplate(prefix, gridErrorItems) {
82
81
  show-close-icon="false"
83
82
  open
84
83
  >
85
- <h2 slot="top" class="title">Datasource Error</h2>
84
+ <h2 slot="top" class="title">Grid unavailable</h2>
86
85
  <div>
87
86
  <p>
88
- The Datasource is currently unavailable due to an error.
89
- </p>
90
- <p>
91
- This may be due to a network issue, server maintenance or a Datasource configuration error.
87
+ This may be due to a network, server, or configuration issue.
92
88
  </p>
93
89
  <details class="error-details">
94
- <summary>Show error details</summary>
95
- ${repeat(() => gridErrorItems, html `
96
- <p>
97
- <strong>Error:</strong>
98
- ${(x) => extractMessage(x.detail) || 'Unknown error occurred'}
99
- </p>
100
- `)}
90
+ <summary>Show details</summary>
91
+ <ul>
92
+ ${repeat(() => gridErrorItems, html `
93
+ <li>
94
+ ${(x) => extractErrorMessage(x.detail) || 'Unknown error occurred'}
95
+ </li>
96
+ `)}
97
+ </ul>
101
98
  </details>
102
99
  </div>
103
100
  <div slot="bottom">
@@ -904,6 +904,9 @@ __decorate([
904
904
  __decorate([
905
905
  attr({ mode: 'boolean', attribute: 'with-status-bar' })
906
906
  ], GridPro.prototype, "withStatusBar", void 0);
907
+ __decorate([
908
+ observable
909
+ ], GridPro.prototype, "customErrorHandlerTemplate", void 0);
907
910
  __decorate([
908
911
  GridOptionsConfig
909
912
  ], GridPro.prototype, "gridOptionsConfig", void 0);
@@ -12,7 +12,9 @@ export const getGridProTemplate = (prefix = 'foundation') => html `
12
12
  <slot name="grid" ${ref('gridSlot')}></slot>
13
13
  <slot></slot>
14
14
  </span>
15
- ${(x) => getErrorHandlerDialogTemplate(prefix, x.gridErrorItems.filter(({ type }) => type === 'datasource'))}
15
+ ${(x) => x.customErrorHandlerTemplate
16
+ ? x.customErrorHandlerTemplate(prefix, x.gridErrorItems.filter(({ type }) => type === 'datasource'))
17
+ : getErrorHandlerDialogTemplate(prefix, x.gridErrorItems.filter(({ type }) => type === 'datasource'))}
16
18
  </template>
17
19
  `;
18
20
  /**
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Extracts a user-friendly error message from a given error detail.
3
+ * @param detail - The error detail, which can be a string, array, or object.
4
+ * @returns A user-friendly error message.
5
+ * @public
6
+ */
7
+ export const extractErrorMessage = (detail) => {
8
+ if (!detail)
9
+ return '';
10
+ if (typeof detail === 'string')
11
+ return detail;
12
+ if (Array.isArray(detail)) {
13
+ return detail.map(extractErrorMessage).join(', ');
14
+ }
15
+ if (typeof detail === 'object') {
16
+ if ('message' in detail && typeof detail.message === 'string')
17
+ return detail.message;
18
+ if ('TEXT' in detail && typeof detail.TEXT === 'string')
19
+ return detail.TEXT;
20
+ return JSON.stringify(detail);
21
+ }
22
+ return String(detail);
23
+ };
@@ -1,4 +1,5 @@
1
1
  export * from './array';
2
+ export * from './error';
2
3
  export * from './logger';
3
4
  export * from './map';
4
5
  export * from './sanitasations';
@@ -4709,6 +4709,47 @@
4709
4709
  "endIndex": 0
4710
4710
  }
4711
4711
  },
4712
+ {
4713
+ "kind": "Function",
4714
+ "canonicalReference": "@genesislcap/grid-pro!extractErrorMessage:function(1)",
4715
+ "docComment": "/**\n * Extracts a user-friendly error message from a given error detail.\n *\n * @param detail - The error detail, which can be a string, array, or object.\n *\n * @returns A user-friendly error message.\n *\n * @public\n */\n",
4716
+ "excerptTokens": [
4717
+ {
4718
+ "kind": "Content",
4719
+ "text": "extractErrorMessage: (detail: "
4720
+ },
4721
+ {
4722
+ "kind": "Content",
4723
+ "text": "any"
4724
+ },
4725
+ {
4726
+ "kind": "Content",
4727
+ "text": ") => "
4728
+ },
4729
+ {
4730
+ "kind": "Content",
4731
+ "text": "string"
4732
+ }
4733
+ ],
4734
+ "fileUrlPath": "src/utils/error.ts",
4735
+ "returnTypeTokenRange": {
4736
+ "startIndex": 3,
4737
+ "endIndex": 4
4738
+ },
4739
+ "releaseTag": "Public",
4740
+ "overloadIndex": 1,
4741
+ "parameters": [
4742
+ {
4743
+ "parameterName": "detail",
4744
+ "parameterTypeTokenRange": {
4745
+ "startIndex": 1,
4746
+ "endIndex": 2
4747
+ },
4748
+ "isOptional": false
4749
+ }
4750
+ ],
4751
+ "name": "extractErrorMessage"
4752
+ },
4712
4753
  {
4713
4754
  "kind": "Function",
4714
4755
  "canonicalReference": "@genesislcap/grid-pro!formatDateExtra:function(1)",
@@ -6582,7 +6623,7 @@
6582
6623
  },
6583
6624
  {
6584
6625
  "kind": "Content",
6585
- "text": ";\n template: import(\"@microsoft/fast-element\")."
6626
+ "text": ";\n template: "
6586
6627
  },
6587
6628
  {
6588
6629
  "kind": "Reference",
@@ -6617,7 +6658,7 @@
6617
6658
  },
6618
6659
  {
6619
6660
  "kind": "Content",
6620
- "text": ";\n template: import(\"@microsoft/fast-element\")."
6661
+ "text": ";\n template: "
6621
6662
  },
6622
6663
  {
6623
6664
  "kind": "Reference",
@@ -8693,7 +8734,7 @@
8693
8734
  {
8694
8735
  "kind": "Function",
8695
8736
  "canonicalReference": "@genesislcap/grid-pro!getActionsMenuDef:function(1)",
8696
- "docComment": "/**\n * Helper function to get ColDef {@link https://www.ag-grid.com/javascript-data-grid/column-properties/} for Actions Menu Renderer. Will take the parameter values for a base ColDef and merge them with the overrideDef (if specified).\n *\n * @param actions - Array of {@link @genesislcap/foundation-ui#ActionMenuItem} to be displayed in the menu.\n *\n * @param overrideDef - Optional override for the ColDef. Will override any of the default values. Default is an empty object.\n *\n * @param customActionsOpenerName - Optional custom name for the button that opens the menu. Default is '⋮'.\n *\n * @param isVertical - Optional flag to display the menu vertically. Default is false (displays the menu horizontally, follow the rowHeight).\n *\n * @param buttonAppearance - Optional appearance for the button that opens the menu. Default is 'outline'.\n *\n * @returns Merged ColDef (base ColDef created from the parameters + overrideDef) for Actions Menu Renderer.\n *\n * @example\n * ```ts\n * public exampleActionsMenuDef: ColDef = getActionsMenuDef(\n * [\n * {\n * name: 'View',\n * callback: (rowData) => logger.debug('VIEWW!!!', rowData),\n * },\n * {\n * name: 'Delete',\n * callback: (rowData) => logger.debug('DELETE!!!', rowData),\n * },\n * ],\n * {\n * headerName: 'Instrument Actions',\n * width: 180,\n * },\n * '+',\n * true,\n * 'primary-gradient'\n * );\n * ```\n *\n * @public\n */\n",
8737
+ "docComment": "/**\n * Helper function to get ColDef {@link https://www.ag-grid.com/javascript-data-grid/column-properties/} for Actions Menu Renderer. Will take the parameter values for a base ColDef and merge them with the overrideDef (if specified).\n *\n * @param actions - Array of `ActionMenuItem` to be displayed in the menu.\n *\n * @param overrideDef - Optional override for the ColDef. Will override any of the default values. Default is an empty object.\n *\n * @param customActionsOpenerName - Optional custom name for the button that opens the menu. Default is '⋮'.\n *\n * @param isVertical - Optional flag to display the menu vertically. Default is false (displays the menu horizontally, follow the rowHeight).\n *\n * @param buttonAppearance - Optional appearance for the button that opens the menu. Default is 'outline'.\n *\n * @returns Merged ColDef (base ColDef created from the parameters + overrideDef) for Actions Menu Renderer.\n *\n * @example\n * ```ts\n * public exampleActionsMenuDef: ColDef = getActionsMenuDef(\n * [\n * {\n * name: 'View',\n * callback: (rowData) => logger.debug('VIEWW!!!', rowData),\n * },\n * {\n * name: 'Delete',\n * callback: (rowData) => logger.debug('DELETE!!!', rowData),\n * },\n * ],\n * {\n * headerName: 'Instrument Actions',\n * width: 180,\n * },\n * '+',\n * true,\n * 'primary-gradient'\n * );\n * ```\n *\n * @public\n */\n",
8697
8738
  "excerptTokens": [
8698
8739
  {
8699
8740
  "kind": "Content",
@@ -10566,6 +10607,50 @@
10566
10607
  "isAbstract": false,
10567
10608
  "name": "connectedCallback"
10568
10609
  },
10610
+ {
10611
+ "kind": "Property",
10612
+ "canonicalReference": "@genesislcap/grid-pro!GridPro#customErrorHandlerTemplate:member",
10613
+ "docComment": "/**\n * Custom error handler dialog template function.\n *\n * @remarks\n *\n * When provided, this function will be used to render custom error dialogs instead of the default error handler. The function should accept a prefix string and an array of grid error items and return a ViewTemplate. If not provided, the default error handler dialog template will be used.\n */\n",
10614
+ "excerptTokens": [
10615
+ {
10616
+ "kind": "Content",
10617
+ "text": "customErrorHandlerTemplate?: "
10618
+ },
10619
+ {
10620
+ "kind": "Content",
10621
+ "text": "(prefix: string, gridErrorItems: "
10622
+ },
10623
+ {
10624
+ "kind": "Reference",
10625
+ "text": "GridProErrorItem",
10626
+ "canonicalReference": "@genesislcap/grid-pro!GridProErrorItem:interface"
10627
+ },
10628
+ {
10629
+ "kind": "Content",
10630
+ "text": "<any>[]) => "
10631
+ },
10632
+ {
10633
+ "kind": "Reference",
10634
+ "text": "ViewTemplate",
10635
+ "canonicalReference": "@microsoft/fast-element!ViewTemplate:class"
10636
+ },
10637
+ {
10638
+ "kind": "Content",
10639
+ "text": ";"
10640
+ }
10641
+ ],
10642
+ "isReadonly": false,
10643
+ "isOptional": true,
10644
+ "releaseTag": "Public",
10645
+ "name": "customErrorHandlerTemplate",
10646
+ "propertyTypeTokenRange": {
10647
+ "startIndex": 1,
10648
+ "endIndex": 5
10649
+ },
10650
+ "isStatic": false,
10651
+ "isProtected": false,
10652
+ "isAbstract": false
10653
+ },
10569
10654
  {
10570
10655
  "kind": "Method",
10571
10656
  "canonicalReference": "@genesislcap/grid-pro!GridPro#disconnectedCallback:member(1)",
@@ -636,6 +636,14 @@ export declare class ErrorTooltip implements ITooltipComp {
636
636
  getGui(): HTMLElement;
637
637
  }
638
638
 
639
+ /**
640
+ * Extracts a user-friendly error message from a given error detail.
641
+ * @param detail - The error detail, which can be a string, array, or object.
642
+ * @returns A user-friendly error message.
643
+ * @public
644
+ */
645
+ export declare const extractErrorMessage: (detail: any) => string;
646
+
639
647
  /**
640
648
  * The foreground color swatch.
641
649
  * @internal
@@ -1494,7 +1502,7 @@ declare const GenesisGridDatasourceElement_base: new () => {
1494
1502
  /**
1495
1503
  * Helper function to get ColDef {@link https://www.ag-grid.com/javascript-data-grid/column-properties/} for Actions Menu Renderer.
1496
1504
  * Will take the parameter values for a base ColDef and merge them with the overrideDef (if specified).
1497
- * @param actions - Array of {@link @genesislcap/foundation-ui#ActionMenuItem} to be displayed in the menu.
1505
+ * @param actions - Array of `ActionMenuItem` to be displayed in the menu.
1498
1506
  * @param overrideDef - Optional override for the ColDef. Will override any of the default values. Default is an empty object.
1499
1507
  * @param customActionsOpenerName - Optional custom name for the button that opens the menu. Default is '⋮'.
1500
1508
  * @param isVertical - Optional flag to display the menu vertically. Default is false (displays the menu horizontally, follow the rowHeight).
@@ -1813,6 +1821,14 @@ export declare class GridPro extends GridPro_base {
1813
1821
  * This requires AG Grid Enterprise module to be available for the status bar to be displayed when enabled.
1814
1822
  */
1815
1823
  withStatusBar: boolean;
1824
+ /**
1825
+ * Custom error handler dialog template function.
1826
+ * @remarks
1827
+ * When provided, this function will be used to render custom error dialogs instead of the default error handler.
1828
+ * The function should accept a prefix string and an array of grid error items and return a ViewTemplate.
1829
+ * If not provided, the default error handler dialog template will be used.
1830
+ */
1831
+ customErrorHandlerTemplate?: (prefix: string, gridErrorItems: GridProErrorItem<any>[]) => ViewTemplate;
1816
1832
  private columnState;
1817
1833
  protected agAttributes: Record<string, string>;
1818
1834
  protected agPropertiesMap: Record<string, string>;
@@ -0,0 +1,56 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/grid-pro](./grid-pro.md) &gt; [extractErrorMessage](./grid-pro.extracterrormessage.md)
4
+
5
+ ## extractErrorMessage() function
6
+
7
+ Extracts a user-friendly error message from a given error detail.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ extractErrorMessage: (detail: any) => string
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ <table><thead><tr><th>
18
+
19
+ Parameter
20
+
21
+
22
+ </th><th>
23
+
24
+ Type
25
+
26
+
27
+ </th><th>
28
+
29
+ Description
30
+
31
+
32
+ </th></tr></thead>
33
+ <tbody><tr><td>
34
+
35
+ detail
36
+
37
+
38
+ </td><td>
39
+
40
+ any
41
+
42
+
43
+ </td><td>
44
+
45
+ The error detail, which can be a string, array, or object.
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+
51
+ **Returns:**
52
+
53
+ string
54
+
55
+ A user-friendly error message.
56
+
@@ -13,12 +13,12 @@ foundationGridPro: (overrideDefinition?: import("@microsoft/fast-foundation").Ov
13
13
  shadowOptions: any;
14
14
  baseName: string;
15
15
  styles: import("@microsoft/fast-element").ElementStyles;
16
- template: import("@microsoft/fast-element").ViewTemplate<any, any>;
16
+ template: ViewTemplate<any, any>;
17
17
  }>) => import("@microsoft/fast-foundation").FoundationElementRegistry<{
18
18
  shadowOptions: any;
19
19
  baseName: string;
20
20
  styles: import("@microsoft/fast-element").ElementStyles;
21
- template: import("@microsoft/fast-element").ViewTemplate<any, any>;
21
+ template: ViewTemplate<any, any>;
22
22
  }, typeof GridPro>
23
23
  ```
24
24
 
@@ -47,7 +47,7 @@ overrideDefinition
47
47
 
48
48
  </td><td>
49
49
 
50
- import("@microsoft/fast-foundation").OverrideFoundationElementDefinition&lt;{ shadowOptions: any; baseName: string; styles: import("@microsoft/fast-element").ElementStyles; template: import("@microsoft/fast-element").ViewTemplate&lt;any, any&gt;; }&gt;
50
+ import("@microsoft/fast-foundation").OverrideFoundationElementDefinition&lt;{ shadowOptions: any; baseName: string; styles: import("@microsoft/fast-element").ElementStyles; template: ViewTemplate&lt;any, any&gt;; }&gt;
51
51
 
52
52
 
53
53
  </td><td>
@@ -60,7 +60,7 @@ _(Optional)_
60
60
 
61
61
  **Returns:**
62
62
 
63
- import("@microsoft/fast-foundation").FoundationElementRegistry&lt;{ shadowOptions: any; baseName: string; styles: import("@microsoft/fast-element").ElementStyles; template: import("@microsoft/fast-element").ViewTemplate&lt;any, any&gt;; }, typeof [GridPro](./grid-pro.gridpro.md)<!-- -->&gt;
63
+ import("@microsoft/fast-foundation").FoundationElementRegistry&lt;{ shadowOptions: any; baseName: string; styles: import("@microsoft/fast-element").ElementStyles; template: ViewTemplate&lt;any, any&gt;; }, typeof [GridPro](./grid-pro.gridpro.md)<!-- -->&gt;
64
64
 
65
65
  ## Remarks
66
66
 
@@ -42,7 +42,7 @@ ActionMenuItem\[\]
42
42
 
43
43
  </td><td>
44
44
 
45
- Array of to be displayed in the menu.
45
+ Array of `ActionMenuItem` to be displayed in the menu.
46
46
 
47
47
 
48
48
  </td></tr>
@@ -0,0 +1,18 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@genesislcap/grid-pro](./grid-pro.md) &gt; [GridPro](./grid-pro.gridpro.md) &gt; [customErrorHandlerTemplate](./grid-pro.gridpro.customerrorhandlertemplate.md)
4
+
5
+ ## GridPro.customErrorHandlerTemplate property
6
+
7
+ Custom error handler dialog template function.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ customErrorHandlerTemplate?: (prefix: string, gridErrorItems: GridProErrorItem<any>[]) => ViewTemplate;
13
+ ```
14
+
15
+ ## Remarks
16
+
17
+ When provided, this function will be used to render custom error dialogs instead of the default error handler. The function should accept a prefix string and an array of grid error items and return a ViewTemplate. If not provided, the default error handler dialog template will be used.
18
+
@@ -291,6 +291,25 @@ string
291
291
  </td><td>
292
292
 
293
293
 
294
+ </td></tr>
295
+ <tr><td>
296
+
297
+ [customErrorHandlerTemplate?](./grid-pro.gridpro.customerrorhandlertemplate.md)
298
+
299
+
300
+ </td><td>
301
+
302
+
303
+ </td><td>
304
+
305
+ (prefix: string, gridErrorItems: [GridProErrorItem](./grid-pro.gridproerroritem.md)<!-- -->&lt;any&gt;\[\]) =&gt; ViewTemplate
306
+
307
+
308
+ </td><td>
309
+
310
+ _(Optional)_ Custom error handler dialog template function.
311
+
312
+
294
313
  </td></tr>
295
314
  <tr><td>
296
315
 
@@ -461,6 +461,17 @@ Returns a formatted date time value from the Grid Pro cell value.
461
461
  Returns a formatted date value from the Grid Pro cell value.
462
462
 
463
463
 
464
+ </td></tr>
465
+ <tr><td>
466
+
467
+ [extractErrorMessage(detail)](./grid-pro.extracterrormessage.md)
468
+
469
+
470
+ </td><td>
471
+
472
+ Extracts a user-friendly error message from a given error detail.
473
+
474
+
464
475
  </td></tr>
465
476
  <tr><td>
466
477
 
@@ -475,6 +475,9 @@ export class ErrorTooltip implements ITooltipComp {
475
475
  init(params: ITooltipParams): void;
476
476
  }
477
477
 
478
+ // @public
479
+ export const extractErrorMessage: (detail: any) => string;
480
+
478
481
  // Warning: (ae-internal-missing-underscore) The name "foregroundSwatch" should be prefixed with an underscore because the declaration is marked as @internal
479
482
  //
480
483
  // @internal @deprecated
@@ -953,6 +956,7 @@ export class GridPro extends GridPro_base {
953
956
  combineAllGridComponents(gridOptionsComponents: GridComponents): GridComponents;
954
957
  // (undocumented)
955
958
  connectedCallback(): void;
959
+ customErrorHandlerTemplate?: (prefix: string, gridErrorItems: GridProErrorItem<any>[]) => ViewTemplate;
956
960
  // (undocumented)
957
961
  disconnectedCallback(): void;
958
962
  enableCellFlashing: boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@genesislcap/grid-pro",
3
3
  "description": "Genesis Foundation AG Grid",
4
- "version": "14.318.0",
4
+ "version": "14.320.0",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -38,19 +38,19 @@
38
38
  }
39
39
  },
40
40
  "devDependencies": {
41
- "@genesislcap/foundation-testing": "14.318.0",
42
- "@genesislcap/genx": "14.318.0",
43
- "@genesislcap/rollup-builder": "14.318.0",
44
- "@genesislcap/ts-builder": "14.318.0",
45
- "@genesislcap/uvu-playwright-builder": "14.318.0",
46
- "@genesislcap/vite-builder": "14.318.0",
47
- "@genesislcap/webpack-builder": "14.318.0"
41
+ "@genesislcap/foundation-testing": "14.320.0",
42
+ "@genesislcap/genx": "14.320.0",
43
+ "@genesislcap/rollup-builder": "14.320.0",
44
+ "@genesislcap/ts-builder": "14.320.0",
45
+ "@genesislcap/uvu-playwright-builder": "14.320.0",
46
+ "@genesislcap/vite-builder": "14.320.0",
47
+ "@genesislcap/webpack-builder": "14.320.0"
48
48
  },
49
49
  "dependencies": {
50
- "@genesislcap/foundation-comms": "14.318.0",
51
- "@genesislcap/foundation-logger": "14.318.0",
52
- "@genesislcap/foundation-ui": "14.318.0",
53
- "@genesislcap/foundation-utils": "14.318.0",
50
+ "@genesislcap/foundation-comms": "14.320.0",
51
+ "@genesislcap/foundation-logger": "14.320.0",
52
+ "@genesislcap/foundation-ui": "14.320.0",
53
+ "@genesislcap/foundation-utils": "14.320.0",
54
54
  "@microsoft/fast-colors": "5.3.1",
55
55
  "@microsoft/fast-components": "2.30.6",
56
56
  "@microsoft/fast-element": "1.14.0",
@@ -75,5 +75,5 @@
75
75
  "access": "public"
76
76
  },
77
77
  "customElements": "dist/custom-elements.json",
78
- "gitHead": "1904c1e9cb31ff0011555e5337cba101ced5f721"
78
+ "gitHead": "957aa7b2e81fa3c2915d5154be42c0500790127f"
79
79
  }