@builttocreate/engine-utils 2.6.1-beta.0 → 2.7.0-beta.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.
- package/dist/joyDocHelper.js +19 -0
- package/package.json +2 -2
package/dist/joyDocHelper.js
CHANGED
|
@@ -464,6 +464,25 @@ var duplicateDocumentPage = function duplicateDocumentPage(doc, fileId, pageId)
|
|
|
464
464
|
var duplicateField = _objectSpread(_objectSpread({}, field), {}, {
|
|
465
465
|
_id: (0, _generateObjectId["default"])()
|
|
466
466
|
});
|
|
467
|
+
/**
|
|
468
|
+
* Logic to make the table field blank if clearColumnData is true for the column
|
|
469
|
+
*/
|
|
470
|
+
|
|
471
|
+
|
|
472
|
+
if ((duplicateField.type === _FieldTypes["default"].table || duplicateField.type === _FieldTypes["default"].inputGroup) && duplicateField.tableColumns.length > 0 && duplicateField.tableColumns.filter(function (column) {
|
|
473
|
+
return column.clearData;
|
|
474
|
+
}).length > 0) {
|
|
475
|
+
var columnsWithClearData = duplicateField.tableColumns.filter(function (column) {
|
|
476
|
+
return column.clearColumnData;
|
|
477
|
+
});
|
|
478
|
+
var nextFieldValue = JSON.parse(JSON.stringify(duplicateField.value));
|
|
479
|
+
columnsWithClearData.forEach(function (column) {
|
|
480
|
+
nextFieldValue.forEach(function (row) {
|
|
481
|
+
row.cells[column._id] = '';
|
|
482
|
+
});
|
|
483
|
+
});
|
|
484
|
+
duplicateField.value = nextFieldValue;
|
|
485
|
+
}
|
|
467
486
|
|
|
468
487
|
duplicatedFields.push(duplicateField);
|
|
469
488
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@builttocreate/engine-utils",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0-beta.0",
|
|
4
4
|
"description": "Utility library for common logic shared across web and mobile",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"clean": "rm -rf dist",
|
|
12
12
|
"build-src": "NODE_ENV=production babel src --out-dir dist --extensions '.js,.jsx' --ignore 'src/testUtils/*','src/**/*.stories.js','src/**/*.test.js','src/lib/**/*.test.js','src/**/__snapshots__','src/**/__mocks__'",
|
|
13
13
|
"build": "npm run clean && npm run build-src",
|
|
14
|
-
"
|
|
14
|
+
"prepare": "npm run build",
|
|
15
15
|
"publish-beta": "npm publish --tag beta",
|
|
16
16
|
"test": "jest",
|
|
17
17
|
"test-watch": "jest --watch",
|