@genesislcap/grid-pro 14.64.4-alpha-732a0c5.0 → 14.65.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.
@@ -3838,6 +3838,14 @@
3838
3838
  "type": {
3839
3839
  "text": "ColumnState[]"
3840
3840
  }
3841
+ },
3842
+ {
3843
+ "name": "arr1Field",
3844
+ "default": "'field'"
3845
+ },
3846
+ {
3847
+ "name": "arr2Field",
3848
+ "default": "'colId'"
3841
3849
  }
3842
3850
  ],
3843
3851
  "description": "Merges two arrays, one of `ColDef` and one of `ColumnState`, and deduplicates them.",
@@ -5,5 +5,5 @@ import { ColDef, ColumnState } from '@ag-grid-community/core';
5
5
  * @privateRemarks For restoring saved `ColumnState` but also keep custom renderers and other `ColDef` properties.
6
6
  * @public
7
7
  */
8
- export declare function mergeAndDedupColDefWithColumnState(colDefs: ColDef[], columnStates: ColumnState[]): ColDef[];
8
+ export declare function mergeAndDedupColDefWithColumnState(colDefs: ColDef[], columnStates: ColumnState[], arr1Field?: string, arr2Field?: string): ColDef[];
9
9
  //# sourceMappingURL=array.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src/utils/array.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE9D;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,MAAM,EAAE,EACjB,YAAY,EAAE,WAAW,EAAE,GAC1B,MAAM,EAAE,CA8BV"}
1
+ {"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../src/utils/array.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE9D;;;;;GAKG;AACH,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,MAAM,EAAE,EACjB,YAAY,EAAE,WAAW,EAAE,EAC3B,SAAS,SAAU,EACnB,SAAS,SAAU,GAClB,MAAM,EAAE,CAuBV"}
@@ -4,24 +4,22 @@
4
4
  * @privateRemarks For restoring saved `ColumnState` but also keep custom renderers and other `ColDef` properties.
5
5
  * @public
6
6
  */
7
- export function mergeAndDedupColDefWithColumnState(colDefs, columnStates) {
7
+ export function mergeAndDedupColDefWithColumnState(colDefs, columnStates, arr1Field = 'field', arr2Field = 'colId') {
8
8
  const merged = {};
9
9
  const deduplicated = [];
10
- const fieldProp = 'field';
11
- const colIdProp = 'colId';
12
10
  columnStates.forEach((state) => {
13
- const matchingColDef = colDefs.find((item) => item[fieldProp] === state[colIdProp] ||
14
- (item[colIdProp] && item[colIdProp] === state[colIdProp]));
11
+ const matchingColDef = colDefs.find((item) => item[arr1Field] === state[arr2Field]);
15
12
  if (matchingColDef) {
16
13
  const colDefStateMerge = Object.assign(Object.assign({}, matchingColDef), state);
17
- merged[matchingColDef[fieldProp]] = colDefStateMerge;
14
+ delete colDefStateMerge[arr2Field];
15
+ merged[matchingColDef[arr1Field]] = colDefStateMerge;
18
16
  deduplicated.push(colDefStateMerge);
19
17
  }
20
18
  });
21
19
  colDefs.forEach((def) => {
22
- if (!merged.hasOwnProperty(def[fieldProp])) {
20
+ if (!merged.hasOwnProperty(def[arr1Field])) {
23
21
  const newObj = Object.assign({}, def);
24
- merged[def[fieldProp]] = newObj;
22
+ merged[def[arr1Field]] = newObj;
25
23
  deduplicated.push(newObj);
26
24
  }
27
25
  });
@@ -7778,6 +7778,22 @@
7778
7778
  "kind": "Content",
7779
7779
  "text": "[]"
7780
7780
  },
7781
+ {
7782
+ "kind": "Content",
7783
+ "text": ", arr1Field?: "
7784
+ },
7785
+ {
7786
+ "kind": "Content",
7787
+ "text": "string"
7788
+ },
7789
+ {
7790
+ "kind": "Content",
7791
+ "text": ", arr2Field?: "
7792
+ },
7793
+ {
7794
+ "kind": "Content",
7795
+ "text": "string"
7796
+ },
7781
7797
  {
7782
7798
  "kind": "Content",
7783
7799
  "text": "): "
@@ -7798,8 +7814,8 @@
7798
7814
  ],
7799
7815
  "fileUrlPath": "src/utils/array.ts",
7800
7816
  "returnTypeTokenRange": {
7801
- "startIndex": 7,
7802
- "endIndex": 9
7817
+ "startIndex": 11,
7818
+ "endIndex": 13
7803
7819
  },
7804
7820
  "releaseTag": "Public",
7805
7821
  "overloadIndex": 1,
@@ -7819,6 +7835,22 @@
7819
7835
  "endIndex": 6
7820
7836
  },
7821
7837
  "isOptional": false
7838
+ },
7839
+ {
7840
+ "parameterName": "arr1Field",
7841
+ "parameterTypeTokenRange": {
7842
+ "startIndex": 7,
7843
+ "endIndex": 8
7844
+ },
7845
+ "isOptional": true
7846
+ },
7847
+ {
7848
+ "parameterName": "arr2Field",
7849
+ "parameterTypeTokenRange": {
7850
+ "startIndex": 9,
7851
+ "endIndex": 10
7852
+ },
7853
+ "isOptional": true
7822
7854
  }
7823
7855
  ],
7824
7856
  "name": "mergeAndDedupColDefWithColumnState"
@@ -2057,7 +2057,7 @@ export declare const logger: Logger;
2057
2057
  * @privateRemarks For restoring saved `ColumnState` but also keep custom renderers and other `ColDef` properties.
2058
2058
  * @public
2059
2059
  */
2060
- export declare function mergeAndDedupColDefWithColumnState(colDefs: ColDef[], columnStates: ColumnState[]): ColDef[];
2060
+ export declare function mergeAndDedupColDefWithColumnState(colDefs: ColDef[], columnStates: ColumnState[], arr1Field?: string, arr2Field?: string): ColDef[];
2061
2061
 
2062
2062
  declare interface SelectCellRendererParams extends ICellRendererParams {
2063
2063
  accessor: string;
@@ -34,7 +34,7 @@
34
34
  | [dateTimeValueFormatter({ value })](./grid-pro.datetimevalueformatter.md) | Returns a formatted date time value from the Grid Pro cell value. |
35
35
  | [dateValueFormatter({ value })](./grid-pro.datevalueformatter.md) | Returns a formatted date value from the Grid Pro cell value. |
36
36
  | [gridProColumns(itemsBinding, includeRenderers)](./grid-pro.gridprocolumns.md) | A directive that renders a set of grid-pro-column elements from a given input binding |
37
- | [mergeAndDedupColDefWithColumnState(colDefs, columnStates)](./grid-pro.mergeanddedupcoldefwithcolumnstate.md) | Merges two arrays, one of <code>ColDef</code> and one of <code>ColumnState</code>, and deduplicates them. |
37
+ | [mergeAndDedupColDefWithColumnState(colDefs, columnStates, arr1Field, arr2Field)](./grid-pro.mergeanddedupcoldefwithcolumnstate.md) | Merges two arrays, one of <code>ColDef</code> and one of <code>ColumnState</code>, and deduplicates them. |
38
38
 
39
39
  ## Variables
40
40
 
@@ -9,7 +9,7 @@ Merges two arrays, one of `ColDef` and one of `ColumnState`<!-- -->, and dedupli
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- export declare function mergeAndDedupColDefWithColumnState(colDefs: ColDef[], columnStates: ColumnState[]): ColDef[];
12
+ export declare function mergeAndDedupColDefWithColumnState(colDefs: ColDef[], columnStates: ColumnState[], arr1Field?: string, arr2Field?: string): ColDef[];
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -18,6 +18,8 @@ export declare function mergeAndDedupColDefWithColumnState(colDefs: ColDef[], co
18
18
  | --- | --- | --- |
19
19
  | colDefs | ColDef\[\] | |
20
20
  | columnStates | ColumnState\[\] | |
21
+ | arr1Field | string | _(Optional)_ |
22
+ | arr2Field | string | _(Optional)_ |
21
23
 
22
24
  **Returns:**
23
25
 
@@ -752,7 +752,7 @@ export const gridProTemplate: ViewTemplate;
752
752
  export const logger: Logger;
753
753
 
754
754
  // @public
755
- export function mergeAndDedupColDefWithColumnState(colDefs: ColDef[], columnStates: ColumnState[]): ColDef[];
755
+ export function mergeAndDedupColDefWithColumnState(colDefs: ColDef[], columnStates: ColumnState[], arr1Field?: string, arr2Field?: string): ColDef[];
756
756
 
757
757
  // @public
758
758
  export class SelectRenderer extends FoundationElement implements ICellRendererComp {
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.64.4-alpha-732a0c5.0",
4
+ "version": "14.65.0",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -28,14 +28,14 @@
28
28
  "test:debug": "genx test --debug"
29
29
  },
30
30
  "devDependencies": {
31
- "@genesislcap/foundation-testing": "14.64.4-alpha-732a0c5.0",
32
- "@genesislcap/genx": "14.64.4-alpha-732a0c5.0",
31
+ "@genesislcap/foundation-testing": "14.65.0",
32
+ "@genesislcap/genx": "14.65.0",
33
33
  "rimraf": "^3.0.2"
34
34
  },
35
35
  "dependencies": {
36
- "@genesislcap/foundation-comms": "14.64.4-alpha-732a0c5.0",
37
- "@genesislcap/foundation-ui": "14.64.4-alpha-732a0c5.0",
38
- "@genesislcap/foundation-utils": "14.64.4-alpha-732a0c5.0",
36
+ "@genesislcap/foundation-comms": "14.65.0",
37
+ "@genesislcap/foundation-ui": "14.65.0",
38
+ "@genesislcap/foundation-utils": "14.65.0",
39
39
  "@microsoft/fast-colors": "^5.1.4",
40
40
  "@microsoft/fast-components": "^2.21.3",
41
41
  "@microsoft/fast-element": "^1.7.0",
@@ -58,5 +58,5 @@
58
58
  "access": "public"
59
59
  },
60
60
  "customElements": "dist/custom-elements.json",
61
- "gitHead": "200e750a61c62012f0dd942ffce072929549a263"
61
+ "gitHead": "127bc648c049b8ed12d259fd8f6cf861b309e575"
62
62
  }