@builttocreate/engine-utils 2.6.0-beta.12 → 2.6.0-beta.14

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.
@@ -7,7 +7,6 @@ exports["default"] = void 0;
7
7
  // Display Fields
8
8
  var uniqueId = 'uniqueId';
9
9
  var image = 'image';
10
- var file = 'file';
11
10
  var richText = 'richText';
12
11
  var block = 'block'; // Data Fields
13
12
 
@@ -27,7 +26,6 @@ var chart = 'chart';
27
26
  var types = {
28
27
  uniqueId: uniqueId,
29
28
  image: image,
30
- file: file,
31
29
  block: block,
32
30
  richText: richText,
33
31
  text: text,
@@ -48,7 +46,6 @@ types.all = Object.keys(types);
48
46
  types.titles = {
49
47
  uniqueId: 'Auto Number',
50
48
  image: 'Image',
51
- file: 'File',
52
49
  block: 'Display Text',
53
50
  richText: 'Rich Text',
54
51
  text: 'Short Text',
@@ -310,8 +310,6 @@ var isFieldEmpty = function isFieldEmpty(fieldType, fieldValue, fieldOptions) {
310
310
  isEmpty = true;
311
311
  } else if (fieldType === _FieldTypes["default"].image && (!fieldValue || fieldValue && fieldValue.length === 0)) {
312
312
  isEmpty = true;
313
- } else if (fieldType === _FieldTypes["default"].file && (!fieldValue || fieldValue && fieldValue.length === 0)) {
314
- isEmpty = true;
315
313
  } else if (fieldType === _FieldTypes["default"].chart && (!fieldValue || fieldValue && fieldValue.length === 0)) {
316
314
  isEmpty = true;
317
315
  } else if (fieldType === _FieldTypes["default"].table && (!fieldValue || fieldValue && fieldValue.filter(function (item) {
@@ -465,6 +465,20 @@ var duplicateDocumentPage = function duplicateDocumentPage(doc, fileId, pageId)
465
465
  _id: (0, _generateObjectId["default"])()
466
466
  });
467
467
 
468
+ if ((duplicateField.type === _FieldTypes["default"].table || duplicateField.type === _FieldTypes["default"].inputGroup) && duplicateField.tableColumns.length > 0) {
469
+ var columnsWithClearColumnData = duplicateField.tableColumns.filter(function (column) {
470
+ return column.clearColumnData;
471
+ });
472
+ console.log('columnsWithClearColumnData, BEFORE', columnsWithClearColumnData, JSON.parse(JSON.stringify(duplicateField.value)));
473
+ columnsWithClearColumnData.forEach(function (columnId) {
474
+ var nextFieldValue = duplicateField.value.map(function (row) {
475
+ row.cells[columnId] = '';
476
+ });
477
+ duplicateField.value = nextFieldValue;
478
+ });
479
+ console.log('After', JSON.parse(JSON.stringify(duplicateField.value)));
480
+ }
481
+
468
482
  duplicatedFields.push(duplicateField);
469
483
  /**
470
484
  * Add to lookup so it can be used with other associated field positions
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@builttocreate/engine-utils",
3
- "version": "2.6.0-beta.12",
3
+ "version": "2.6.0-beta.14",
4
4
  "description": "Utility library for common logic shared across web and mobile",
5
5
  "main": "dist/index.js",
6
6
  "files": [