@genesislcap/grid-pro 14.23.0 → 14.23.1-alpha-bf28a25.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.
@@ -263,6 +263,26 @@
263
263
  "kind": "javascript-module",
264
264
  "path": "src/grid-pro.ts",
265
265
  "declarations": [
266
+ {
267
+ "kind": "function",
268
+ "name": "convertToKebabCase",
269
+ "parameters": [
270
+ {
271
+ "name": "value",
272
+ "type": {
273
+ "text": "string"
274
+ },
275
+ "description": "The value to convert to Kebab case."
276
+ }
277
+ ],
278
+ "description": "Convert string values from 'camelCase' to 'kebab-case'",
279
+ "return": {
280
+ "type": {
281
+ "text": ""
282
+ }
283
+ },
284
+ "privacy": "public"
285
+ },
266
286
  {
267
287
  "kind": "class",
268
288
  "description": "The Grid Pro element.",
@@ -429,15 +449,18 @@
429
449
  {
430
450
  "kind": "field",
431
451
  "name": "agAttributes",
432
- "privacy": "protected",
433
452
  "type": {
434
- "text": "object"
453
+ "text": "Record<string, string>"
435
454
  },
455
+ "privacy": "protected",
436
456
  "default": "{}"
437
457
  },
438
458
  {
439
459
  "kind": "field",
440
460
  "name": "agPropertiesMap",
461
+ "type": {
462
+ "text": "Record<string, string>"
463
+ },
441
464
  "privacy": "protected"
442
465
  },
443
466
  {
@@ -493,7 +516,7 @@
493
516
  },
494
517
  {
495
518
  "kind": "method",
496
- "name": "serialiseStoreTableConfig",
519
+ "name": "saveColumnState",
497
520
  "privacy": "private",
498
521
  "return": {
499
522
  "type": {
@@ -501,9 +524,19 @@
501
524
  }
502
525
  }
503
526
  },
527
+ {
528
+ "kind": "field",
529
+ "name": "savedColumnState",
530
+ "type": {
531
+ "text": "ColDef[]"
532
+ },
533
+ "description": "Gets the saved grid ColDefs from local storage",
534
+ "privacy": "public",
535
+ "readonly": true
536
+ },
504
537
  {
505
538
  "kind": "method",
506
- "name": "rehydrateTableConfig",
539
+ "name": "restoreColumnState",
507
540
  "privacy": "private",
508
541
  "return": {
509
542
  "type": {
@@ -885,6 +918,14 @@
885
918
  }
886
919
  ],
887
920
  "exports": [
921
+ {
922
+ "kind": "js",
923
+ "name": "convertToKebabCase",
924
+ "declaration": {
925
+ "name": "convertToKebabCase",
926
+ "module": "src/grid-pro.ts"
927
+ }
928
+ },
888
929
  {
889
930
  "kind": "js",
890
931
  "name": "GridPro",
@@ -1,6 +1,13 @@
1
1
  import { Grid, ColumnApi, GridApi, GridOptions, ColDef } from '@ag-grid-community/core';
2
2
  import { FoundationElement } from '@microsoft/fast-foundation';
3
3
  import { GridComponents } from './grid-pro.types';
4
+ /**
5
+ * Convert string values from 'camelCase' to 'kebab-case'
6
+ * @param value - The value to convert to Kebab case.
7
+ * @returns The Kebab case result.
8
+ * @public
9
+ */
10
+ export declare const convertToKebabCase: (value: string) => string;
4
11
  declare const GridPro_base: (new (...args: any[]) => {
5
12
  "__#1@#_container": import("@genesislcap/foundation-utils").FoundationLayoutContainer | import("@genesislcap/foundation-utils").LayoutCacheContainer | import("@genesislcap/foundation-utils").DOMContainer;
6
13
  cloneNode(deep?: boolean): Node;
@@ -80,7 +87,12 @@ declare const GridPro_base: (new (...args: any[]) => {
80
87
  getElementsByTagNameNS(namespace: string, localName: string): HTMLCollectionOf<Element>;
81
88
  hasAttribute(qualifiedName: string): boolean;
82
89
  hasAttributeNS(namespace: string, localName: string): boolean;
83
- hasAttributes(): boolean;
90
+ hasAttributes(): boolean; /**
91
+ * Gets the saved grid ColDefs from local storage
92
+ * @remarks This is used to restore the grid state when the grid is rehydrated
93
+ * @privateRemarks Not using `columnApi.get|setColumnState()` for these flows as it doesn't work setting new columnDefs vs different ordering.
94
+ * @public
95
+ */
84
96
  hasPointerCapture(pointerId: number): boolean;
85
97
  insertAdjacentElement(where: InsertPosition, element: Element): Element;
86
98
  insertAdjacentHTML(position: InsertPosition, text: string): void;
@@ -363,8 +375,8 @@ export declare class GridPro extends GridPro_base {
363
375
  gridComponents: {
364
376
  [componentName: string]: any;
365
377
  };
366
- protected agAttributes: any;
367
- protected agPropertiesMap: any;
378
+ protected agAttributes: Record<string, string>;
379
+ protected agPropertiesMap: Record<string, string>;
368
380
  protected agGridOptions: GridOptions;
369
381
  protected initialised: boolean;
370
382
  private rehydrationAttempted;
@@ -384,8 +396,15 @@ export declare class GridPro extends GridPro_base {
384
396
  * @internal
385
397
  */
386
398
  private removeConfigWidthsToAutosize;
387
- private serialiseStoreTableConfig;
388
- private rehydrateTableConfig;
399
+ private saveColumnState;
400
+ /**
401
+ * Gets the saved grid ColDefs from local storage
402
+ * @remarks This is used to restore the grid state when the grid is rehydrated
403
+ * @privateRemarks Not using `columnApi.get|setColumnState()` for these flows as it doesn't work setting new columnDefs vs different ordering.
404
+ * @public
405
+ */
406
+ get savedColumnState(): ColDef[];
407
+ private restoreColumnState;
389
408
  /**
390
409
  * @public
391
410
  */
@@ -1 +1 @@
1
- {"version":3,"file":"grid-pro.d.ts","sourceRoot":"","sources":["../../src/grid-pro.ts"],"names":[],"mappings":"AACA,OAAO,EACL,IAAI,EACJ,SAAS,EACT,OAAO,EAEP,WAAW,EACX,MAAM,EAKP,MAAM,yBAAyB,CAAC;AASjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAc/D,OAAO,EAKL,cAAc,EACf,MAAM,kBAAkB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgB1B;;;;;GAKG;AACH,qBAAa,OAAQ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IAQ5B,wBAAwB,CAAC,qBAAqB,EAAE,cAAc,GAAG,cAAc;IAc/E,uBAAuB,IAAI,OAAO;IAOlC;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;IAW/B;;;OAGG;IACH,OAAO,CAAC,4BAA4B;IAIpC,OAAO,CAAC,eAAe;IAgBvB;;;;;OAKG;IACH,IAAI,gBAAgB,IAAI,MAAM,EAAE,CAW/B;IAED,OAAO,CAAC,kBAAkB;IAQ1B;;OAEG;IACH,IAAI,WAAW,IAAI,WAAW,CAE7B;IAED,IAAI,WAAW,CAAC,OAAO,EAAE,WAAW,EA0EnC;IAED,OAAO,CAAC,kBAAkB;IAiB1B,wBAAwB,CAAC,UAAU,GAAE,MAAM,EAAO;IAgClD,IAAI,kBAAkB,aAerB;IAED,0BAA0B,CAAC,OAAO,KAAA,EAAE,QAAQ,KAAA,EAAE,QAAQ,KAAA;IAqBtD,mBAAmB,CAAC,SAAS,KAAA,EAAE,KAAK,KAAA;IAiBpC,OAAO,CAAC,eAAe,CAAa;IAEpC,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,eAAe;CAMxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,EAAE,cAA0B,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,oBAAoB;;CAEhC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;kBAM5B,CAAC"}
@@ -21,7 +21,13 @@ GridProGenesisDatasourceNext;
21
21
  GridProCell;
22
22
  GridColumn;
23
23
  ModuleRegistry.registerModules([CsvExportModule, ClientSideRowModelModule]);
24
- const hypenateAndLowercase = (property) => property.replace('/([a-z])([A-Z])/g', '$1-$2').toLowerCase();
24
+ /**
25
+ * Convert string values from 'camelCase' to 'kebab-case'
26
+ * @param value - The value to convert to Kebab case.
27
+ * @returns The Kebab case result.
28
+ * @public
29
+ */
30
+ export const convertToKebabCase = (value) => value.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
25
31
  /**
26
32
  * The Grid Pro element.
27
33
  * @remarks Grid Pro is a Web Component wrapper around the AG Grid Community library.
@@ -62,7 +68,7 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
62
68
  this.agAttributes = {};
63
69
  this.agPropertiesMap = ComponentUtil.ALL_PROPERTIES.reduce((map, property) => {
64
70
  map[property.toLowerCase()] = property;
65
- map[hypenateAndLowercase(property)] = property;
71
+ map[convertToKebabCase(property)] = property;
66
72
  return map;
67
73
  }, {});
68
74
  }
@@ -134,10 +140,10 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
134
140
  removeConfigWidthsToAutosize(colState) {
135
141
  return colState.map((col) => (Object.assign(Object.assign({}, col), { width: null })));
136
142
  }
137
- serialiseStoreTableConfig() {
143
+ saveColumnState() {
138
144
  if (this.rehydrationAttempted && this.statePersistanceEnabled()) {
139
145
  const existingOptions = JSON.parse(this.session.getLocalStorageItem('gridOptions') || '{}');
140
- let colState = this.agGridOptions.columnApi.getColumnState();
146
+ let colState = this.gridApi.getColumnDefs();
141
147
  colState = this.gridAutosizingEnabled
142
148
  ? this.removeConfigWidthsToAutosize(colState)
143
149
  : colState;
@@ -145,17 +151,27 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
145
151
  this.session.setLocalStorageItem('gridOptions', JSON.stringify(existingOptions));
146
152
  }
147
153
  }
148
- rehydrateTableConfig() {
149
- this.rehydrationAttempted = true;
150
- if (this.statePersistanceEnabled() && this.session.getLocalStorageItem('gridOptions')) {
151
- const allGridOptions = JSON.parse(this.session.getLocalStorageItem('gridOptions'));
154
+ /**
155
+ * Gets the saved grid ColDefs from local storage
156
+ * @remarks This is used to restore the grid state when the grid is rehydrated
157
+ * @privateRemarks Not using `columnApi.get|setColumnState()` for these flows as it doesn't work setting new columnDefs vs different ordering.
158
+ * @public
159
+ */
160
+ get savedColumnState() {
161
+ const localStorageGridOptions = this.session.getLocalStorageItem('gridOptions');
162
+ if (this.statePersistanceEnabled() && localStorageGridOptions) {
163
+ const allGridOptions = JSON.parse(localStorageGridOptions);
152
164
  if (this.persistColumnStateKey in allGridOptions) {
153
- this.agGridOptions.columnApi.applyColumnState({
154
- state: JSON.parse(allGridOptions[this.persistColumnStateKey]),
155
- applyOrder: true,
156
- });
165
+ return JSON.parse(allGridOptions[this.persistColumnStateKey]);
157
166
  }
158
167
  }
168
+ return [];
169
+ }
170
+ restoreColumnState() {
171
+ this.rehydrationAttempted = true;
172
+ if (this.savedColumnState.length > 0) {
173
+ this.gridApi.setColumnDefs(this.savedColumnState);
174
+ }
159
175
  }
160
176
  /**
161
177
  * @public
@@ -166,10 +182,9 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
166
182
  set gridOptions(options) {
167
183
  const globalEventListener = this.globalEventListener.bind(this);
168
184
  const gridOnChangeCallback = () => {
169
- this.serialiseStoreTableConfig.bind(this)();
185
+ this.saveColumnState.bind(this)();
170
186
  this.debouncedColumnAutosize.bind(this)();
171
187
  };
172
- const rehydrateTableConfig = this.rehydrateTableConfig.bind(this);
173
188
  Array.from(this.attributes).forEach((attribute) => {
174
189
  const attrName = this.agPropertiesMap[attribute.name];
175
190
  if (!attrName)
@@ -192,10 +207,10 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
192
207
  params,
193
208
  gridId: this.id,
194
209
  });
195
- rehydrateTableConfig();
210
+ this.restoreColumnState.bind(this)();
196
211
  this.debouncedColumnAutosize.bind(this)();
197
212
  }, onFirstDataRendered: () => {
198
- this.enableFlashingRows.bind(this);
213
+ this.enableFlashingRows.bind(this)();
199
214
  }, onColumnPinned: gridOnChangeCallback, onColumnResized: gridOnChangeCallback, onColumnMoved: gridOnChangeCallback, onDisplayedColumnsChanged: gridOnChangeCallback, onFilterChanged: gridOnChangeCallback, onGridSizeChanged: gridOnChangeCallback, onSortChanged: gridOnChangeCallback }), rest);
200
215
  this.agGridOptions = Object.assign(Object.assign({}, this.agGridOptions), ComponentUtil.copyAttributesToGridOptions(derivedOptions, this.agAttributes));
201
216
  const gridParams = {
@@ -253,13 +268,13 @@ export class GridPro extends LifecycleMixin(FoundationElement) {
253
268
  return mergedColumnDefs;
254
269
  }
255
270
  get observedAttributes() {
256
- // allow properties to be supplied either lowercased or hyphenated
271
+ // allow properties to be supplied either lowercased or kebab-cased
257
272
  // this allows the user to either supply (for example) enableSorting or enabled-sorting
258
273
  // properties lowercased
259
274
  const lowerCasedPropertyNames = ComponentUtil.ALL_PROPERTIES.map((property) => property.toLowerCase());
260
- // properties hyphenated
261
- const hyphenatedPropertyNames = ComponentUtil.ALL_PROPERTIES.map((property) => hypenateAndLowercase(property));
262
- return lowerCasedPropertyNames.concat(hyphenatedPropertyNames);
275
+ // properties kebab-cased
276
+ const kebabCasePropertyNames = ComponentUtil.ALL_PROPERTIES.map((property) => convertToKebabCase(property));
277
+ return lowerCasedPropertyNames.concat(kebabCasePropertyNames);
263
278
  }
264
279
  agAttributeChangedCallback(attName, oldValue, newValue) {
265
280
  if (oldValue === newValue) {
@@ -3035,6 +3035,29 @@
3035
3035
  "endIndex": 6
3036
3036
  }
3037
3037
  },
3038
+ {
3039
+ "kind": "Variable",
3040
+ "canonicalReference": "@genesislcap/grid-pro!convertToKebabCase:var",
3041
+ "docComment": "/**\n * Convert string values from 'camelCase' to 'kebab-case'\n *\n * @param value - The value to convert to Kebab case.\n *\n * @returns The Kebab case result.\n *\n * @public\n */\n",
3042
+ "excerptTokens": [
3043
+ {
3044
+ "kind": "Content",
3045
+ "text": "convertToKebabCase: "
3046
+ },
3047
+ {
3048
+ "kind": "Content",
3049
+ "text": "(value: string) => string"
3050
+ }
3051
+ ],
3052
+ "fileUrlPath": "src/grid-pro.ts",
3053
+ "isReadonly": true,
3054
+ "releaseTag": "Public",
3055
+ "name": "convertToKebabCase",
3056
+ "variableTypeTokenRange": {
3057
+ "startIndex": 1,
3058
+ "endIndex": 2
3059
+ }
3060
+ },
3038
3061
  {
3039
3062
  "kind": "Function",
3040
3063
  "canonicalReference": "@genesislcap/grid-pro!dateTimeValueFormatter:function(1)",
@@ -4848,9 +4871,14 @@
4848
4871
  "kind": "Content",
4849
4872
  "text": "protected agAttributes: "
4850
4873
  },
4874
+ {
4875
+ "kind": "Reference",
4876
+ "text": "Record",
4877
+ "canonicalReference": "!Record:type"
4878
+ },
4851
4879
  {
4852
4880
  "kind": "Content",
4853
- "text": "any"
4881
+ "text": "<string, string>"
4854
4882
  },
4855
4883
  {
4856
4884
  "kind": "Content",
@@ -4863,7 +4891,7 @@
4863
4891
  "name": "agAttributes",
4864
4892
  "propertyTypeTokenRange": {
4865
4893
  "startIndex": 1,
4866
- "endIndex": 2
4894
+ "endIndex": 3
4867
4895
  },
4868
4896
  "isStatic": false,
4869
4897
  "isProtected": true,
@@ -4940,9 +4968,14 @@
4940
4968
  "kind": "Content",
4941
4969
  "text": "protected agPropertiesMap: "
4942
4970
  },
4971
+ {
4972
+ "kind": "Reference",
4973
+ "text": "Record",
4974
+ "canonicalReference": "!Record:type"
4975
+ },
4943
4976
  {
4944
4977
  "kind": "Content",
4945
- "text": "any"
4978
+ "text": "<string, string>"
4946
4979
  },
4947
4980
  {
4948
4981
  "kind": "Content",
@@ -4955,7 +4988,7 @@
4955
4988
  "name": "agPropertiesMap",
4956
4989
  "propertyTypeTokenRange": {
4957
4990
  "startIndex": 1,
4958
- "endIndex": 2
4991
+ "endIndex": 3
4959
4992
  },
4960
4993
  "isStatic": false,
4961
4994
  "isProtected": true,
@@ -5778,6 +5811,41 @@
5778
5811
  "isProtected": false,
5779
5812
  "isAbstract": false
5780
5813
  },
5814
+ {
5815
+ "kind": "Property",
5816
+ "canonicalReference": "@genesislcap/grid-pro!GridPro#savedColumnState:member",
5817
+ "docComment": "/**\n * Gets the saved grid ColDefs from local storage\n *\n * @remarks\n *\n * This is used to restore the grid state when the grid is rehydrated\n *\n * @public\n */\n",
5818
+ "excerptTokens": [
5819
+ {
5820
+ "kind": "Content",
5821
+ "text": "get savedColumnState(): "
5822
+ },
5823
+ {
5824
+ "kind": "Reference",
5825
+ "text": "ColDef",
5826
+ "canonicalReference": "@ag-grid-community/core!ColDef:interface"
5827
+ },
5828
+ {
5829
+ "kind": "Content",
5830
+ "text": "[]"
5831
+ },
5832
+ {
5833
+ "kind": "Content",
5834
+ "text": ";"
5835
+ }
5836
+ ],
5837
+ "isReadonly": true,
5838
+ "isOptional": false,
5839
+ "releaseTag": "Public",
5840
+ "name": "savedColumnState",
5841
+ "propertyTypeTokenRange": {
5842
+ "startIndex": 1,
5843
+ "endIndex": 3
5844
+ },
5845
+ "isStatic": false,
5846
+ "isProtected": false,
5847
+ "isAbstract": false
5848
+ },
5781
5849
  {
5782
5850
  "kind": "Method",
5783
5851
  "canonicalReference": "@genesislcap/grid-pro!GridPro#statePersistanceEnabled:member(1)",
@@ -397,6 +397,14 @@ export declare const CellTemplate: ViewTemplate<GridProCell, any>;
397
397
  */
398
398
  export declare const ColumnTemplate: ViewTemplate<GridColumn, any>;
399
399
 
400
+ /**
401
+ * Convert string values from 'camelCase' to 'kebab-case'
402
+ * @param value - The value to convert to Kebab case.
403
+ * @returns The Kebab case result.
404
+ * @public
405
+ */
406
+ export declare const convertToKebabCase: (value: string) => string;
407
+
400
408
  /**
401
409
  * Returns a formatted date time value from the Grid Pro cell value.
402
410
  * @param param - A ValueFormatterParams object.
@@ -819,8 +827,8 @@ export declare class GridPro extends GridPro_base {
819
827
  gridComponents: {
820
828
  [componentName: string]: any;
821
829
  };
822
- protected agAttributes: any;
823
- protected agPropertiesMap: any;
830
+ protected agAttributes: Record<string, string>;
831
+ protected agPropertiesMap: Record<string, string>;
824
832
  protected agGridOptions: GridOptions;
825
833
  protected initialised: boolean;
826
834
  private rehydrationAttempted;
@@ -840,8 +848,15 @@ export declare class GridPro extends GridPro_base {
840
848
  * @internal
841
849
  */
842
850
  private removeConfigWidthsToAutosize;
843
- private serialiseStoreTableConfig;
844
- private rehydrateTableConfig;
851
+ private saveColumnState;
852
+ /**
853
+ * Gets the saved grid ColDefs from local storage
854
+ * @remarks This is used to restore the grid state when the grid is rehydrated
855
+ * @privateRemarks Not using `columnApi.get|setColumnState()` for these flows as it doesn't work setting new columnDefs vs different ordering.
856
+ * @public
857
+ */
858
+ get savedColumnState(): ColDef[];
859
+ private restoreColumnState;
845
860
  /**
846
861
  * @public
847
862
  */
@@ -936,7 +951,12 @@ declare const GridPro_base: (new (...args: any[]) => {
936
951
  getElementsByTagNameNS(namespace: string, localName: string): HTMLCollectionOf<Element>;
937
952
  hasAttribute(qualifiedName: string): boolean;
938
953
  hasAttributeNS(namespace: string, localName: string): boolean;
939
- hasAttributes(): boolean;
954
+ hasAttributes(): boolean; /**
955
+ * Gets the saved grid ColDefs from local storage
956
+ * @remarks This is used to restore the grid state when the grid is rehydrated
957
+ * @privateRemarks Not using `columnApi.get|setColumnState()` for these flows as it doesn't work setting new columnDefs vs different ordering.
958
+ * @public
959
+ */
940
960
  hasPointerCapture(pointerId: number): boolean;
941
961
  insertAdjacentElement(where: InsertPosition, element: Element): Element;
942
962
  insertAdjacentHTML(position: InsertPosition, text: string): void;
@@ -0,0 +1,13 @@
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; [convertToKebabCase](./grid-pro.converttokebabcase.md)
4
+
5
+ ## convertToKebabCase variable
6
+
7
+ Convert string values from 'camelCase' to 'kebab-case'
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ convertToKebabCase: (value: string) => string
13
+ ```
@@ -7,5 +7,5 @@
7
7
  **Signature:**
8
8
 
9
9
  ```typescript
10
- protected agAttributes: any;
10
+ protected agAttributes: Record<string, string>;
11
11
  ```
@@ -7,5 +7,5 @@
7
7
  **Signature:**
8
8
 
9
9
  ```typescript
10
- protected agPropertiesMap: any;
10
+ protected agPropertiesMap: Record<string, string>;
11
11
  ```
@@ -27,10 +27,10 @@ Grid Pro is a Web Component wrapper around the AG Grid Community library.
27
27
 
28
28
  | Property | Modifiers | Type | Description |
29
29
  | --- | --- | --- | --- |
30
- | [agAttributes](./grid-pro.gridpro.agattributes.md) | <code>protected</code> | any | |
30
+ | [agAttributes](./grid-pro.gridpro.agattributes.md) | <code>protected</code> | Record&lt;string, string&gt; | |
31
31
  | [agGrid](./grid-pro.gridpro.aggrid.md) | | Grid | |
32
32
  | [agGridOptions](./grid-pro.gridpro.aggridoptions.md) | <code>protected</code> | GridOptions | |
33
- | [agPropertiesMap](./grid-pro.gridpro.agpropertiesmap.md) | <code>protected</code> | any | |
33
+ | [agPropertiesMap](./grid-pro.gridpro.agpropertiesmap.md) | <code>protected</code> | Record&lt;string, string&gt; | |
34
34
  | [autoCellRendererByType](./grid-pro.gridpro.autocellrendererbytype.md) | | boolean | |
35
35
  | [classNames](./grid-pro.gridpro.classnames.md) | | string | |
36
36
  | [columnApi](./grid-pro.gridpro.columnapi.md) | | ColumnApi | |
@@ -50,6 +50,7 @@ Grid Pro is a Web Component wrapper around the AG Grid Community library.
50
50
  | [onlyTemplateColDefs](./grid-pro.gridpro.onlytemplatecoldefs.md) | | boolean | |
51
51
  | [persistColumnStateKey](./grid-pro.gridpro.persistcolumnstatekey.md) | | string | |
52
52
  | [rowHeight](./grid-pro.gridpro.rowheight.md) | | number | |
53
+ | [savedColumnState](./grid-pro.gridpro.savedcolumnstate.md) | <code>readonly</code> | ColDef\[\] | Gets the saved grid ColDefs from local storage |
53
54
  | [theme](./grid-pro.gridpro.theme.md) | | string | |
54
55
 
55
56
  ## Methods
@@ -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; [savedColumnState](./grid-pro.gridpro.savedcolumnstate.md)
4
+
5
+ ## GridPro.savedColumnState property
6
+
7
+ Gets the saved grid ColDefs from local storage
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ get savedColumnState(): ColDef[];
13
+ ```
14
+
15
+ ## Remarks
16
+
17
+ This is used to restore the grid state when the grid is rehydrated
18
+
@@ -58,6 +58,7 @@
58
58
  | [agThemeTokenMapCSS](./grid-pro.agthemetokenmapcss.md) | Generates the CSS for a given GridPro theme name and token map |
59
59
  | [CellTemplate](./grid-pro.celltemplate.md) | The Grid Pro Cell Template. |
60
60
  | [ColumnTemplate](./grid-pro.columntemplate.md) | The Grid Pro Column Template. |
61
+ | [convertToKebabCase](./grid-pro.converttokebabcase.md) | Convert string values from 'camelCase' to 'kebab-case' |
61
62
  | [defaultAgGridFontFace](./grid-pro.defaultaggridfontface.md) | The default font face for Grid Pro (agGridAlpine). |
62
63
  | [defaultGridProConfig](./grid-pro.defaultgridproconfig.md) | Grid Pro default configuration. |
63
64
  | [foundationAgBooleanRenderer](./grid-pro.foundationagbooleanrenderer.md) | A function that returns a Foundation Boolean Renderer registration for configuring the component with a DesignSystem. |
@@ -320,6 +320,9 @@ export const CellTemplate: ViewTemplate<GridProCell, any>;
320
320
  // @public
321
321
  export const ColumnTemplate: ViewTemplate<GridColumn, any>;
322
322
 
323
+ // @public
324
+ export const convertToKebabCase: (value: string) => string;
325
+
323
326
  // @public
324
327
  export function dateTimeValueFormatter({ value }: ValueFormatterParams): any;
325
328
 
@@ -545,13 +548,13 @@ export class GridPro extends GridPro_base {
545
548
  // (undocumented)
546
549
  agAttributeChangedCallback(attName: any, oldValue: any, newValue: any): void;
547
550
  // (undocumented)
548
- protected agAttributes: any;
551
+ protected agAttributes: Record<string, string>;
549
552
  // (undocumented)
550
553
  agGrid: Grid;
551
554
  // (undocumented)
552
555
  protected agGridOptions: GridOptions;
553
556
  // (undocumented)
554
- protected agPropertiesMap: any;
557
+ protected agPropertiesMap: Record<string, string>;
555
558
  // (undocumented)
556
559
  applyTemplateDefinitions(columnDefs?: ColDef[]): ColDef<any>[];
557
560
  // (undocumented)
@@ -601,6 +604,7 @@ export class GridPro extends GridPro_base {
601
604
  persistColumnStateKey: string;
602
605
  // (undocumented)
603
606
  rowHeight: number;
607
+ get savedColumnState(): ColDef[];
604
608
  // (undocumented)
605
609
  statePersistanceEnabled(): boolean;
606
610
  // (undocumented)
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.23.0",
4
+ "version": "14.23.1-alpha-bf28a25.0",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "devDependencies": {
26
26
  "@custom-elements-manifest/analyzer": "^0.8.2",
27
- "@genesislcap/foundation-testing": "^14.23.0",
28
- "@genesislcap/genx": "^14.23.0",
27
+ "@genesislcap/foundation-testing": "14.23.1-alpha-bf28a25.0",
28
+ "@genesislcap/genx": "14.23.1-alpha-bf28a25.0",
29
29
  "@playwright/test": "^1.18.1",
30
30
  "@rollup/plugin-commonjs": "^21.0.1",
31
31
  "@rollup/plugin-node-resolve": "^13.1.3",
@@ -75,9 +75,9 @@
75
75
  "webpack-merge": "^5.7.3"
76
76
  },
77
77
  "dependencies": {
78
- "@genesislcap/foundation-comms": "^14.23.0",
79
- "@genesislcap/foundation-ui": "^14.23.0",
80
- "@genesislcap/foundation-utils": "^14.23.0",
78
+ "@genesislcap/foundation-comms": "14.23.1-alpha-bf28a25.0",
79
+ "@genesislcap/foundation-ui": "14.23.1-alpha-bf28a25.0",
80
+ "@genesislcap/foundation-utils": "14.23.1-alpha-bf28a25.0",
81
81
  "@microsoft/fast-colors": "^5.1.4",
82
82
  "@microsoft/fast-components": "^2.21.3",
83
83
  "@microsoft/fast-element": "^1.7.0",
@@ -99,5 +99,5 @@
99
99
  "access": "public"
100
100
  },
101
101
  "customElements": "dist/custom-elements.json",
102
- "gitHead": "e32f041c0d827b1731f2de5ba5aeef20bb4ae7a9"
102
+ "gitHead": "549ee6b1bd5ad5ba19da94c04a41c58543a71bd2"
103
103
  }