@genesislcap/grid-pro 14.64.3 → 14.64.4-alpha-732a0c5.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,14 +3838,6 @@
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'"
3849
3841
  }
3850
3842
  ],
3851
3843
  "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[], arr1Field?: string, arr2Field?: string): ColDef[];
8
+ export declare function mergeAndDedupColDefWithColumnState(colDefs: ColDef[], columnStates: ColumnState[]): 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,EAC3B,SAAS,SAAU,EACnB,SAAS,SAAU,GAClB,MAAM,EAAE,CAuBV"}
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"}
@@ -4,22 +4,24 @@
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, arr1Field = 'field', arr2Field = 'colId') {
7
+ export function mergeAndDedupColDefWithColumnState(colDefs, columnStates) {
8
8
  const merged = {};
9
9
  const deduplicated = [];
10
+ const fieldProp = 'field';
11
+ const colIdProp = 'colId';
10
12
  columnStates.forEach((state) => {
11
- const matchingColDef = colDefs.find((item) => item[arr1Field] === state[arr2Field]);
13
+ const matchingColDef = colDefs.find((item) => item[fieldProp] === state[colIdProp] ||
14
+ (item[colIdProp] && item[colIdProp] === state[colIdProp]));
12
15
  if (matchingColDef) {
13
16
  const colDefStateMerge = Object.assign(Object.assign({}, matchingColDef), state);
14
- delete colDefStateMerge[arr2Field];
15
- merged[matchingColDef[arr1Field]] = colDefStateMerge;
17
+ merged[matchingColDef[fieldProp]] = colDefStateMerge;
16
18
  deduplicated.push(colDefStateMerge);
17
19
  }
18
20
  });
19
21
  colDefs.forEach((def) => {
20
- if (!merged.hasOwnProperty(def[arr1Field])) {
22
+ if (!merged.hasOwnProperty(def[fieldProp])) {
21
23
  const newObj = Object.assign({}, def);
22
- merged[def[arr1Field]] = newObj;
24
+ merged[def[fieldProp]] = newObj;
23
25
  deduplicated.push(newObj);
24
26
  }
25
27
  });
@@ -7778,22 +7778,6 @@
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
- },
7797
7781
  {
7798
7782
  "kind": "Content",
7799
7783
  "text": "): "
@@ -7814,8 +7798,8 @@
7814
7798
  ],
7815
7799
  "fileUrlPath": "src/utils/array.ts",
7816
7800
  "returnTypeTokenRange": {
7817
- "startIndex": 11,
7818
- "endIndex": 13
7801
+ "startIndex": 7,
7802
+ "endIndex": 9
7819
7803
  },
7820
7804
  "releaseTag": "Public",
7821
7805
  "overloadIndex": 1,
@@ -7835,22 +7819,6 @@
7835
7819
  "endIndex": 6
7836
7820
  },
7837
7821
  "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
7854
7822
  }
7855
7823
  ],
7856
7824
  "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[], arr1Field?: string, arr2Field?: string): ColDef[];
2060
+ export declare function mergeAndDedupColDefWithColumnState(colDefs: ColDef[], columnStates: ColumnState[]): 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, arr1Field, arr2Field)](./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)](./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[], arr1Field?: string, arr2Field?: string): ColDef[];
12
+ export declare function mergeAndDedupColDefWithColumnState(colDefs: ColDef[], columnStates: ColumnState[]): ColDef[];
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -18,8 +18,6 @@ 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)_ |
23
21
 
24
22
  **Returns:**
25
23
 
@@ -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[], arr1Field?: string, arr2Field?: string): ColDef[];
755
+ export function mergeAndDedupColDefWithColumnState(colDefs: ColDef[], columnStates: ColumnState[]): 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.3",
4
+ "version": "14.64.4-alpha-732a0c5.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.3",
32
- "@genesislcap/genx": "14.64.3",
31
+ "@genesislcap/foundation-testing": "14.64.4-alpha-732a0c5.0",
32
+ "@genesislcap/genx": "14.64.4-alpha-732a0c5.0",
33
33
  "rimraf": "^3.0.2"
34
34
  },
35
35
  "dependencies": {
36
- "@genesislcap/foundation-comms": "14.64.3",
37
- "@genesislcap/foundation-ui": "14.64.3",
38
- "@genesislcap/foundation-utils": "14.64.3",
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",
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": "7de5fa539938ec53549485836dc16288c78607a8"
61
+ "gitHead": "200e750a61c62012f0dd942ffce072929549a263"
62
62
  }