@openg2p/registry-widgets 1.1.6-dev.5 → 1.1.6-dev.6
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/dist/components/SectionRenderer/utils/diffSectionChangeRecords.d.ts.map +1 -1
- package/dist/components/SectionRenderer/utils/sectionSnapshot.d.ts.map +1 -1
- package/dist/index.esm.js +19 -17
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +19 -17
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diffSectionChangeRecords.d.ts","sourceRoot":"","sources":["../../../../src/components/SectionRenderer/utils/diffSectionChangeRecords.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"diffSectionChangeRecords.d.ts","sourceRoot":"","sources":["../../../../src/components/SectionRenderer/utils/diffSectionChangeRecords.ts"],"names":[],"mappings":"AAqIA,wBAAgB,wBAAwB,CACtC,eAAe,EAAE,OAAO,EAAE,EAC1B,cAAc,EAAE,OAAO,EAAE,EACzB,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,GAChC,OAAO,EAAE,CAIX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sectionSnapshot.d.ts","sourceRoot":"","sources":["../../../../src/components/SectionRenderer/utils/sectionSnapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEjE,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAKhE,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,MAAM,MAAM,wBAAwB,GAAG,QAAQ,GAAG,kBAAkB,CAAC;AACrE,MAAM,MAAM,uBAAuB,GAAG,aAAa,GAAG,eAAe,GAAG,cAAc,CAAC;AAEvF,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,CAAC,EA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KN,CAAC;AAEL,iEAAiE;AACjE,eAAO,MAAM,oBAAoB,GAC/B,SAAS,aAAa,EACtB,YAAY,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACnC,wBAAwB,OAAO,EAC/B,oBAAoB,MAAM,KACzB;IAAE,OAAO,EAAE,OAAO,EAAE,CAAC;IAAC,KAAK,EAAE,OAAO,EAAE,CAAA;CAmBxC,CAAC;AAEF,wEAAwE;AACxE,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,aAAa,EACtB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACpC,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,GAC7D,cAAc,CAkBhB"}
|
package/dist/index.esm.js
CHANGED
|
@@ -2855,14 +2855,10 @@ const buildSectionRecords = (widgets, sourceData, { sectionRegisterId, editActio
|
|
|
2855
2855
|
: fullPath;
|
|
2856
2856
|
cleanedSnapshot[fieldPath] = value;
|
|
2857
2857
|
});
|
|
2858
|
-
const sectionData = sectionRegisterId
|
|
2859
|
-
? sourceData[sectionRegisterId] ?? {}
|
|
2860
|
-
: {};
|
|
2861
2858
|
const includeEditAction = editAction === 'always' ||
|
|
2862
2859
|
(editAction === 'when-register-id' && sectionRegisterId);
|
|
2863
2860
|
return [
|
|
2864
2861
|
{
|
|
2865
|
-
...sectionData,
|
|
2866
2862
|
...cleanedSnapshot,
|
|
2867
2863
|
...(includeEditAction ? { edit_action: 'UPDATE' } : {}),
|
|
2868
2864
|
},
|
|
@@ -2992,32 +2988,38 @@ const diffTableRows = (baselineRecords, currentRecords) => {
|
|
|
2992
2988
|
const baselineById = new Map();
|
|
2993
2989
|
for (const row of baselineRows) {
|
|
2994
2990
|
const id = getRowId(row);
|
|
2995
|
-
if (id)
|
|
2991
|
+
if (id) {
|
|
2996
2992
|
baselineById.set(id, row);
|
|
2993
|
+
}
|
|
2997
2994
|
}
|
|
2998
2995
|
const result = [];
|
|
2999
|
-
currentRows.forEach((row
|
|
2996
|
+
currentRows.forEach((row) => {
|
|
3000
2997
|
const editAction = typeof row.edit_action === 'string' ? row.edit_action : undefined;
|
|
3001
2998
|
const rowId = getRowId(row);
|
|
2999
|
+
// Deleted row
|
|
3002
3000
|
if (editAction === 'DELETE') {
|
|
3003
3001
|
if (!rowId)
|
|
3004
3002
|
return;
|
|
3005
|
-
result.push({
|
|
3003
|
+
result.push({
|
|
3004
|
+
...row,
|
|
3005
|
+
internal_record_id: rowId,
|
|
3006
|
+
edit_action: 'DELETE',
|
|
3007
|
+
});
|
|
3006
3008
|
return;
|
|
3007
3009
|
}
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
+
// New row
|
|
3011
|
+
if (editAction === 'ADD' || !rowId) {
|
|
3012
|
+
result.push({
|
|
3013
|
+
...row,
|
|
3014
|
+
edit_action: 'ADD',
|
|
3015
|
+
});
|
|
3010
3016
|
return;
|
|
3011
3017
|
}
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
const changedFields = pickChangedFields(baseline, row);
|
|
3016
|
-
if (Object.keys(changedFields).length === 0)
|
|
3017
|
-
return;
|
|
3018
|
+
// Existing row:
|
|
3019
|
+
// Always include the complete row with UPDATE action,
|
|
3020
|
+
// whether it was actually modified or not.
|
|
3018
3021
|
result.push({
|
|
3019
|
-
...
|
|
3020
|
-
...(rowId ? { internal_record_id: rowId } : {}),
|
|
3022
|
+
...row,
|
|
3021
3023
|
edit_action: 'UPDATE',
|
|
3022
3024
|
});
|
|
3023
3025
|
});
|