@pega/lists-core 9.0.0-build.23.4 → 9.0.0-build.24.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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareRows.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/prepareRows.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"prepareRows.d.ts","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/prepareRows.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAC;AAsBlD;;GAEG;yBACa,YAAY,UAAU;AAAtC,wBAKE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { v4 as uuidV4 } from 'uuid';
|
|
2
|
-
import { withMemoization, hasDuplicates, deepEqual } from '../../../utils/util';
|
|
2
|
+
import { withMemoization, hasDuplicates, deepEqual, isEmpty } from '../../../utils/util';
|
|
3
3
|
import { AFTER_FETCH } from '../../../pubSub/events';
|
|
4
4
|
import Row from '../../../generators/RowGenerator';
|
|
5
5
|
function prepareRows([rsInternal]) {
|
|
@@ -7,13 +7,14 @@ function prepareRows([rsInternal]) {
|
|
|
7
7
|
const itemKeys = getView().data?.map((d, index) => d[getView().meta.itemKey] ?? index);
|
|
8
8
|
const hasDuplicateKeys = hasDuplicates(itemKeys);
|
|
9
9
|
const rows = getView().data?.map((d, index) => {
|
|
10
|
-
const
|
|
10
|
+
const itemKey = d[getView().meta.itemKey];
|
|
11
|
+
const key = String(itemKey ?? index);
|
|
11
12
|
// If the row already existed in the previous data and we have a row object for that, don't create new row.
|
|
12
13
|
// This will help in memoization and thus improving performance.
|
|
13
14
|
const existingRow = getView().rows?.find(r => r.reactKey === key && deepEqual(r.data, d));
|
|
14
15
|
if (existingRow)
|
|
15
16
|
return existingRow;
|
|
16
|
-
const uniqueId = hasDuplicateKeys ? uuidV4() : null;
|
|
17
|
+
const uniqueId = hasDuplicateKeys || isEmpty(itemKey) ? uuidV4() : null;
|
|
17
18
|
return new Row({ key, rowData: d, uniqueId }, rsInternal);
|
|
18
19
|
});
|
|
19
20
|
getView().rows = rows;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepareRows.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/prepareRows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"prepareRows.js","sourceRoot":"","sources":["../../../../../../src/core/features/uIFeatures/beforeRender/prepareRows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,GAAG,MAAM,kCAAkC,CAAC;AAKnD,SAAS,WAAW,CAAC,CAAC,UAAU,CAA2B;IACzD,MAAM,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC;IAC/B,MAAM,QAAQ,GAAG,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,CAAC;IACvF,MAAM,gBAAgB,GAAG,aAAa,CAAC,QAAQ,CAAC,CAAC;IACjD,MAAM,IAAI,GAAG,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;QAC5C,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC1C,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,IAAI,KAAK,CAAC,CAAC;QACrC,2GAA2G;QAC3G,gEAAgE;QAChE,MAAM,WAAW,GAAG,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,GAAG,IAAI,SAAS,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC1F,IAAI,WAAW;YAAE,OAAO,WAAW,CAAC;QAEpC,MAAM,QAAQ,GAAG,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QACxE,OAAO,IAAI,GAAG,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,EAAE,UAAU,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IACH,OAAO,EAAE,CAAC,IAAI,GAAG,IAAI,CAAC;AACxB,CAAC;AAED;;GAEG;AACH,eAAe,CAAC,UAAsB,EAAE,EAAE;IACxC,MAAM,mBAAmB,GAAG,eAAe,CAAC,WAAW,CAAC,CAAC;IACzD,UAAU,CAAC,cAAc,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE,GAAG,EAAE;QACtD,mBAAmB,CAAC,CAAC,UAAU,CAAC,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["import { v4 as uuidV4 } from 'uuid';\n\nimport { withMemoization, hasDuplicates, deepEqual, isEmpty } from '../../../utils/util';\nimport { AFTER_FETCH } from '../../../pubSub/events';\nimport Row from '../../../generators/RowGenerator';\nimport type RsInternal from '../../../RsInternal';\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nimport type View from '../../../generators/ViewGenerator';\n\nfunction prepareRows([rsInternal]: [rsInternal: RsInternal]) {\n const { getView } = rsInternal;\n const itemKeys = getView().data?.map((d, index) => d[getView().meta.itemKey] ?? index);\n const hasDuplicateKeys = hasDuplicates(itemKeys);\n const rows = getView().data?.map((d, index) => {\n const itemKey = d[getView().meta.itemKey];\n const key = String(itemKey ?? index);\n // If the row already existed in the previous data and we have a row object for that, don't create new row.\n // This will help in memoization and thus improving performance.\n const existingRow = getView().rows?.find(r => r.reactKey === key && deepEqual(r.data, d));\n if (existingRow) return existingRow;\n\n const uniqueId = hasDuplicateKeys || isEmpty(itemKey) ? uuidV4() : null;\n return new Row({ key, rowData: d, uniqueId }, rsInternal);\n });\n getView().rows = rows;\n}\n\n/**\n * Prepare {@link View.rows rows} for the view from view {@link View.data data}. This is triggered on publish of `AFTER_FETCH` event.\n */\nexport default (rsInternal: RsInternal) => {\n const memoizedPrepareRows = withMemoization(prepareRows);\n rsInternal.getPubSubUtils().subscribe(AFTER_FETCH, () => {\n memoizedPrepareRows([rsInternal], [rsInternal, rsInternal.getView().data]);\n });\n};\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/lists-core",
|
|
3
|
-
"version": "9.0.0-build.
|
|
3
|
+
"version": "9.0.0-build.24.0",
|
|
4
4
|
"description": "Core headless UI library that the users can use to write their own UI and create repeating structures like table, gallery, timeline etc.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"author": "Pegasystems",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"build": "tsc -b tsconfig.build.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pega/cosmos-react-condition-builder": "9.0.0-build.
|
|
18
|
-
"@pega/cosmos-react-core": "9.0.0-build.
|
|
17
|
+
"@pega/cosmos-react-condition-builder": "9.0.0-build.24.0",
|
|
18
|
+
"@pega/cosmos-react-core": "9.0.0-build.24.0",
|
|
19
19
|
"@types/lodash-es": "^4.17.12",
|
|
20
20
|
"@types/uuid": "^9.0.0",
|
|
21
21
|
"dayjs": "^1.11.13",
|