@builttocreate/engine-utils 2.6.0-beta.11 → 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.
- package/dist/constants/FieldTypes.js +0 -3
- package/dist/fieldHelper.js +0 -3
- package/dist/joyDocHelper.js +14 -0
- package/package.json +1 -1
|
@@ -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',
|
package/dist/fieldHelper.js
CHANGED
|
@@ -292,7 +292,6 @@ var getTemplateWithLookups = function getTemplateWithLookups(template) {
|
|
|
292
292
|
exports.getTemplateWithLookups = getTemplateWithLookups;
|
|
293
293
|
|
|
294
294
|
var isFieldEmpty = function isFieldEmpty(fieldType, fieldValue, fieldOptions) {
|
|
295
|
-
console.log(' field helper logs fieldType, fieldValue', fieldType, fieldValue);
|
|
296
295
|
var isEmpty = false;
|
|
297
296
|
|
|
298
297
|
if (fieldType === _FieldTypes["default"].text && (!fieldValue || fieldValue && fieldValue.replace(/\s+/g, '').length === 0)) {
|
|
@@ -311,8 +310,6 @@ var isFieldEmpty = function isFieldEmpty(fieldType, fieldValue, fieldOptions) {
|
|
|
311
310
|
isEmpty = true;
|
|
312
311
|
} else if (fieldType === _FieldTypes["default"].image && (!fieldValue || fieldValue && fieldValue.length === 0)) {
|
|
313
312
|
isEmpty = true;
|
|
314
|
-
} else if (fieldType === _FieldTypes["default"].file && (!fieldValue || fieldValue && fieldValue.length === 0)) {
|
|
315
|
-
isEmpty = true;
|
|
316
313
|
} else if (fieldType === _FieldTypes["default"].chart && (!fieldValue || fieldValue && fieldValue.length === 0)) {
|
|
317
314
|
isEmpty = true;
|
|
318
315
|
} else if (fieldType === _FieldTypes["default"].table && (!fieldValue || fieldValue && fieldValue.filter(function (item) {
|
package/dist/joyDocHelper.js
CHANGED
|
@@ -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
|