blixify-ui-web 1.2.51 → 1.2.53
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/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +194 -188
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/model.d.ts +2 -0
- package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
- package/lib/components/data/testSchema.d.ts +2 -1
- package/lib/components/data/testSchema.d.ts.map +1 -1
- package/lib/components/data/testSchema.js +486 -66
- package/lib/components/data/testSchema.js.map +1 -1
- package/lib/components/data/updateModule.d.ts.map +1 -1
- package/lib/components/data/updateModule.js +152 -81
- package/lib/components/data/updateModule.js.map +1 -1
- package/lib/components/data/utils.d.ts.map +1 -1
- package/lib/components/data/utils.js +2 -0
- package/lib/components/data/utils.js.map +1 -1
- package/lib/tail.css +2 -2
- package/package.json +1 -1
|
@@ -100,6 +100,7 @@ var textInput_1 = require("../input/textInput");
|
|
|
100
100
|
var uploadInput_1 = require("../input/uploadInput");
|
|
101
101
|
var blobModule_1 = require("./blobModule");
|
|
102
102
|
var indexedDb_1 = require("./dataTemplate/indexedDb");
|
|
103
|
+
var detailList_1 = require("../display/detailList");
|
|
103
104
|
var readQuery_1 = require("./readQuery");
|
|
104
105
|
var utils_1 = require("./utils");
|
|
105
106
|
var loadingSelect = (react_1.default.createElement("div", { className: "flex flex-row" },
|
|
@@ -1299,6 +1300,7 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1299
1300
|
var _a, _b, _c, _d;
|
|
1300
1301
|
var inputList = {};
|
|
1301
1302
|
var formInputRefList = {};
|
|
1303
|
+
var staticList = {};
|
|
1302
1304
|
var filteredModel = [];
|
|
1303
1305
|
var isRemainId = (_a = props === null || props === void 0 ? void 0 : props.showId) !== null && _a !== void 0 ? _a : false;
|
|
1304
1306
|
if ((props === null || props === void 0 ? void 0 : props.isObjectList) || (props === null || props === void 0 ? void 0 : props.isObject))
|
|
@@ -1312,7 +1314,7 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1312
1314
|
});
|
|
1313
1315
|
var clonedSelectedData = (0, exports.handleClonedDataAttribute)(data, model, (_d = (_c = referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.devSettings) === null || _c === void 0 ? void 0 : _c.server) !== null && _d !== void 0 ? _d : "mongoServer", false, isRemainId);
|
|
1314
1316
|
filteredModel.forEach(function (eachAttribute, index) {
|
|
1315
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44;
|
|
1317
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45;
|
|
1316
1318
|
var shouldShow = (0, exports.renderShowCondition)(eachAttribute, clonedSelectedData, isForm);
|
|
1317
1319
|
if (!shouldShow)
|
|
1318
1320
|
return;
|
|
@@ -1353,8 +1355,29 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1353
1355
|
inputList[groupId] = [];
|
|
1354
1356
|
if (!formInputRefList[groupId])
|
|
1355
1357
|
formInputRefList[groupId] = [];
|
|
1358
|
+
// INFO: static displayMode fields render as DetailList items instead of inputs.
|
|
1359
|
+
// INFO: Follows the same condition as disabled — on "new" forms, required fields without a defaultValue must remain editable.
|
|
1360
|
+
if (eachAttribute.displayMode === "static") {
|
|
1361
|
+
var shouldBeStatic = true;
|
|
1362
|
+
if ((props === null || props === void 0 ? void 0 : props.id) === "new") {
|
|
1363
|
+
if (!eachAttribute.optional && !eachAttribute.defaultValue) {
|
|
1364
|
+
shouldBeStatic = false;
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
if (shouldBeStatic) {
|
|
1368
|
+
if (!staticList[groupId])
|
|
1369
|
+
staticList[groupId] = [];
|
|
1370
|
+
var staticValue = (_b = clonedSelectedData[eachAttribute.id]) !== null && _b !== void 0 ? _b : "-";
|
|
1371
|
+
staticList[groupId].push({
|
|
1372
|
+
id: eachAttribute.id,
|
|
1373
|
+
title: eachAttribute.name,
|
|
1374
|
+
text: staticValue,
|
|
1375
|
+
});
|
|
1376
|
+
return;
|
|
1377
|
+
}
|
|
1378
|
+
}
|
|
1356
1379
|
if (!isOptional) {
|
|
1357
|
-
formInputRefList[groupId].push(formInputRef[(
|
|
1380
|
+
formInputRefList[groupId].push(formInputRef[(_c = eachAttribute.refIndex) !== null && _c !== void 0 ? _c : index]);
|
|
1358
1381
|
}
|
|
1359
1382
|
var selectInputCustomElement = eachAttribute.customElement;
|
|
1360
1383
|
var ref = formInputRef[index] || null;
|
|
@@ -1368,7 +1391,7 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1368
1391
|
var referenceSelectionOptionList_1 = [];
|
|
1369
1392
|
if (eachAttribute.targetFields &&
|
|
1370
1393
|
Array.isArray(eachAttribute.targetFields)) {
|
|
1371
|
-
(
|
|
1394
|
+
(_d = eachAttribute.targetFields) === null || _d === void 0 ? void 0 : _d.map(function (eachFields) {
|
|
1372
1395
|
var _a, _b;
|
|
1373
1396
|
if (clonedSelectedData[eachFields !== null && eachFields !== void 0 ? eachFields : ""]) {
|
|
1374
1397
|
var selectedReference = (_a = referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.referencesDetails[eachFields !== null && eachFields !== void 0 ? eachFields : ""]) === null || _a === void 0 ? void 0 : _a.find(function (eachReference) {
|
|
@@ -1392,8 +1415,8 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1392
1415
|
}
|
|
1393
1416
|
inputList[groupId].push(react_1.default.createElement(select_1.Select, { ref: isOptional
|
|
1394
1417
|
? null
|
|
1395
|
-
: formInputRef[(
|
|
1396
|
-
? (
|
|
1418
|
+
: formInputRef[(_e = eachAttribute.refIndex) !== null && _e !== void 0 ? _e : index], id: eachAttribute.id, optional: isOptional, value: clonedSelectedData[eachAttribute.id]
|
|
1419
|
+
? (_f = clonedSelectedData[eachAttribute.id]) === null || _f === void 0 ? void 0 : _f[(_g = eachAttribute.targetFieldsAttributeOption) !== null && _g !== void 0 ? _g : ""]
|
|
1397
1420
|
: "", placeholder: placeholder !== eachAttribute.name
|
|
1398
1421
|
? placeholder
|
|
1399
1422
|
: "Select An Option", label: label, subLabel: subLabel, labelExtra: labelExtra, infoElement: (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? undefined : infoElement, newValue: eachAttribute.listNewValue, disableKeyboard: eachAttribute.disabledKeyboardSearch, options: referenceSelectionOptionList_1, onChange: function (value) {
|
|
@@ -1426,7 +1449,7 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1426
1449
|
var id = eachAttribute.id;
|
|
1427
1450
|
if ((cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) && (props === null || props === void 0 ? void 0 : props.id))
|
|
1428
1451
|
id = props === null || props === void 0 ? void 0 : props.id;
|
|
1429
|
-
inputList[groupId].push(react_1.default.createElement(address_1.Address, { id: id, optional: isOptional, label: label, labelExtra: labelExtra, infoElement: (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? undefined : infoElement, placeholder: placeholder, hideMetadata: cellInput === null || cellInput === void 0 ? void 0 : cellInput.active, value: (
|
|
1452
|
+
inputList[groupId].push(react_1.default.createElement(address_1.Address, { id: id, optional: isOptional, label: label, labelExtra: labelExtra, infoElement: (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? undefined : infoElement, placeholder: placeholder, hideMetadata: cellInput === null || cellInput === void 0 ? void 0 : cellInput.active, value: (_h = clonedSelectedData[eachAttribute.id]) !== null && _h !== void 0 ? _h : {
|
|
1430
1453
|
lat: 0,
|
|
1431
1454
|
lng: 0,
|
|
1432
1455
|
name: "",
|
|
@@ -1434,13 +1457,13 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1434
1457
|
updateMethod.handleOnChangeAddress(eachAttribute.id, address);
|
|
1435
1458
|
}, ref: isOptional
|
|
1436
1459
|
? null
|
|
1437
|
-
: formInputRef[(
|
|
1460
|
+
: formInputRef[(_j = eachAttribute.refIndex) !== null && _j !== void 0 ? _j : index], disabled: disabled, enableDragMarker: eachAttribute.enableDragMarker, latLngEditModal: true, cellInput: {
|
|
1438
1461
|
active: cellInput === null || cellInput === void 0 ? void 0 : cellInput.active,
|
|
1439
1462
|
onBlur: cellInput === null || cellInput === void 0 ? void 0 : cellInput.onBlur,
|
|
1440
1463
|
}, mobileView: mobileView }));
|
|
1441
1464
|
break;
|
|
1442
1465
|
case "object":
|
|
1443
|
-
var objectValue = Object.values((
|
|
1466
|
+
var objectValue = Object.values((_k = clonedSelectedData[eachAttribute.id]) !== null && _k !== void 0 ? _k : {});
|
|
1444
1467
|
inputList[groupId].push(react_1.default.createElement(react_1.default.Fragment, null,
|
|
1445
1468
|
react_1.default.createElement("label", { className: "block text-sm font-medium text-gray-700" },
|
|
1446
1469
|
label,
|
|
@@ -1451,12 +1474,12 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1451
1474
|
objectProps === null || objectProps === void 0 ? void 0 : objectProps.setSelectedObjectStructureId(eachAttribute.id);
|
|
1452
1475
|
objectProps === null || objectProps === void 0 ? void 0 : objectProps.setSelectedObjectData((_a = clonedSelectedData[eachAttribute.id]) !== null && _a !== void 0 ? _a : {});
|
|
1453
1476
|
objectProps === null || objectProps === void 0 ? void 0 : objectProps.handlePopUpModal(true);
|
|
1454
|
-
} }, objectValue.length > 0 ? (react_1.default.createElement("div", { className: "flex flex-row overflow-hidden" }, (
|
|
1477
|
+
} }, objectValue.length > 0 ? (react_1.default.createElement("div", { className: "flex flex-row overflow-hidden" }, (_l = objectProps === null || objectProps === void 0 ? void 0 : objectProps.renderObjectTags(eachAttribute.id)) !== null && _l !== void 0 ? _l : null)) : ("Fill details"))));
|
|
1455
1478
|
break;
|
|
1456
1479
|
case "list":
|
|
1457
1480
|
case "multipleList":
|
|
1458
1481
|
var optionList_2 = eachAttribute.listSelection
|
|
1459
|
-
? (
|
|
1482
|
+
? (_m = eachAttribute.listSelection) === null || _m === void 0 ? void 0 : _m.map(function (eachListKey, index) {
|
|
1460
1483
|
var _a, _b;
|
|
1461
1484
|
var listLabel = eachListKey;
|
|
1462
1485
|
var color = "";
|
|
@@ -1486,9 +1509,9 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1486
1509
|
}
|
|
1487
1510
|
inputList[groupId].push(react_1.default.createElement(select_1.Select, { ref: isOptional
|
|
1488
1511
|
? null
|
|
1489
|
-
: formInputRef[(
|
|
1512
|
+
: formInputRef[(_o = eachAttribute.refIndex) !== null && _o !== void 0 ? _o : index], id: eachAttribute.id, optional: isOptional, value: (_p = clonedSelectedData[eachAttribute.id]) !== null && _p !== void 0 ? _p : (eachAttribute.type === "list" ? "" : []), placeholder: placeholder !== eachAttribute.name
|
|
1490
1513
|
? placeholder
|
|
1491
|
-
: "Select An Option", label: label, labelExtra: labelExtra, subLabel: subLabel, infoElement: (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? undefined : infoElement, newValue: eachAttribute.listNewValue, newValueLabel: eachAttribute.listNewValueLabel, showTag: eachAttribute.showTagSelections, disableKeyboard: eachAttribute.disabledKeyboardSearch, type: (
|
|
1514
|
+
: "Select An Option", label: label, labelExtra: labelExtra, subLabel: subLabel, infoElement: (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? undefined : infoElement, newValue: eachAttribute.listNewValue, newValueLabel: eachAttribute.listNewValueLabel, showTag: eachAttribute.showTagSelections, disableKeyboard: eachAttribute.disabledKeyboardSearch, type: (_q = eachAttribute.listView) !== null && _q !== void 0 ? _q : undefined, options: optionList_2, onChange: function (value) {
|
|
1492
1515
|
updateMethod.handleOnChangeSelect(eachAttribute.id, value);
|
|
1493
1516
|
}, disabled: disabled, cellInput: {
|
|
1494
1517
|
active: cellInput === null || cellInput === void 0 ? void 0 : cellInput.active,
|
|
@@ -1504,10 +1527,10 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1504
1527
|
personValue = eachAttribute.type === "person" ? "" : [];
|
|
1505
1528
|
var organisationMembers = [];
|
|
1506
1529
|
if (personDevSettings)
|
|
1507
|
-
organisationMembers = (
|
|
1530
|
+
organisationMembers = (_r = personDevSettings.organisationMembers) !== null && _r !== void 0 ? _r : [];
|
|
1508
1531
|
inputList[groupId].push(react_1.default.createElement(select_1.Select, { ref: isOptional
|
|
1509
1532
|
? null
|
|
1510
|
-
: formInputRef[(
|
|
1533
|
+
: formInputRef[(_s = eachAttribute.refIndex) !== null && _s !== void 0 ? _s : index], id: eachAttribute.id, optional: isOptional, value: personValue, placeholder: placeholder !== eachAttribute.name
|
|
1511
1534
|
? placeholder
|
|
1512
1535
|
: "Select An Option", label: label, labelExtra: labelExtra, subLabel: subLabel, infoElement: (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? undefined : infoElement, newValue: eachAttribute.listNewValue, disableKeyboard: eachAttribute.disabledKeyboardSearch, options: organisationMembers, onChange: function (value) {
|
|
1513
1536
|
updateMethod.handleOnChangeSelect(eachAttribute.id, value);
|
|
@@ -1523,10 +1546,10 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1523
1546
|
rolesValue = [];
|
|
1524
1547
|
var roleOptions = [];
|
|
1525
1548
|
if (rolesDevSettings)
|
|
1526
|
-
roleOptions = (
|
|
1549
|
+
roleOptions = (_t = rolesDevSettings.roleOptions) !== null && _t !== void 0 ? _t : [];
|
|
1527
1550
|
inputList[groupId].push(react_1.default.createElement(select_1.Select, { ref: isOptional
|
|
1528
1551
|
? null
|
|
1529
|
-
: formInputRef[(
|
|
1552
|
+
: formInputRef[(_u = eachAttribute.refIndex) !== null && _u !== void 0 ? _u : index], id: eachAttribute.id, optional: isOptional, value: rolesValue, placeholder: placeholder !== eachAttribute.name
|
|
1530
1553
|
? placeholder
|
|
1531
1554
|
: "Select An Option", label: label, labelExtra: labelExtra, subLabel: subLabel, infoElement: (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? undefined : infoElement, newValue: eachAttribute.listNewValue, disableKeyboard: eachAttribute.disabledKeyboardSearch, options: roleOptions, onChange: function (value) {
|
|
1532
1555
|
updateMethod.handleOnChangeSelect(eachAttribute.id, value);
|
|
@@ -1537,12 +1560,12 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1537
1560
|
break;
|
|
1538
1561
|
case "boolean":
|
|
1539
1562
|
if (eachAttribute === null || eachAttribute === void 0 ? void 0 : eachAttribute.enableCheckbox) {
|
|
1540
|
-
var value = (
|
|
1563
|
+
var value = (_v = clonedSelectedData[eachAttribute.id]) !== null && _v !== void 0 ? _v : false;
|
|
1541
1564
|
// Use shared Checkbox component so validation can run via handleSubmit
|
|
1542
1565
|
inputList[groupId].push(react_1.default.createElement("div", { className: "flex flex-row h-full space-x-5 mx-auto items-center" },
|
|
1543
1566
|
react_1.default.createElement(checkbox_1.Checkbox, { ref: isOptional
|
|
1544
1567
|
? null
|
|
1545
|
-
: formInputRef[(
|
|
1568
|
+
: formInputRef[(_w = eachAttribute.refIndex) !== null && _w !== void 0 ? _w : index], id: eachAttribute.id, itemList: [
|
|
1546
1569
|
{
|
|
1547
1570
|
key: "checked",
|
|
1548
1571
|
label: label,
|
|
@@ -1558,7 +1581,7 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1558
1581
|
selectInputCustomElement && (react_1.default.createElement("div", { className: "self-center" }, selectInputCustomElement))));
|
|
1559
1582
|
}
|
|
1560
1583
|
else if (eachAttribute.enableRadioButtons) {
|
|
1561
|
-
var value = (
|
|
1584
|
+
var value = (_x = clonedSelectedData[eachAttribute.id]) === null || _x === void 0 ? void 0 : _x.toString();
|
|
1562
1585
|
inputList[groupId].push(react_1.default.createElement(react_1.default.Fragment, null,
|
|
1563
1586
|
react_1.default.createElement("div", { className: "flex justify-between items-center" },
|
|
1564
1587
|
react_1.default.createElement("label", { className: "block text-sm font-medium" },
|
|
@@ -1580,10 +1603,10 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1580
1603
|
}, horizontal: true })));
|
|
1581
1604
|
}
|
|
1582
1605
|
else {
|
|
1583
|
-
var value = (
|
|
1606
|
+
var value = (_y = clonedSelectedData[eachAttribute.id]) === null || _y === void 0 ? void 0 : _y.toString();
|
|
1584
1607
|
inputList[groupId].push(react_1.default.createElement(select_1.Select, { ref: isOptional
|
|
1585
1608
|
? null
|
|
1586
|
-
: formInputRef[(
|
|
1609
|
+
: formInputRef[(_z = eachAttribute.refIndex) !== null && _z !== void 0 ? _z : index], id: eachAttribute.id, value: value, label: label, subLabel: subLabel, infoElement: (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? undefined : infoElement, labelExtra: labelExtra, placeholder: placeholder !== eachAttribute.name
|
|
1587
1610
|
? placeholder
|
|
1588
1611
|
: "Select An Option", optional: isOptional, disableKeyboard: eachAttribute.disabledKeyboardSearch, options: [
|
|
1589
1612
|
{
|
|
@@ -1616,13 +1639,13 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1616
1639
|
: (0, blobModule_1.renderImageUrlFromPath)(fileProps === null || fileProps === void 0 ? void 0 : fileProps.imageEndpoint, eachAttribute.imageCollectionName + "%2F" + props.id, objectProps === null || objectProps === void 0 ? void 0 : objectProps.selectedObjectStructureId, eachAttribute.imageFileName, clonedSelectedData[eachAttribute.id], fileProps === null || fileProps === void 0 ? void 0 : fileProps.imageBucketName)
|
|
1617
1640
|
: (0, blobModule_1.renderImageUrlFromPath)(fileProps === null || fileProps === void 0 ? void 0 : fileProps.imageEndpoint, eachAttribute.imageCollectionName, props === null || props === void 0 ? void 0 : props.id, eachAttribute.imageFileName, clonedSelectedData[eachAttribute.id], fileProps === null || fileProps === void 0 ? void 0 : fileProps.imageBucketName);
|
|
1618
1641
|
}
|
|
1619
|
-
var accept = (
|
|
1642
|
+
var accept = (_0 = eachAttribute.fileExtension) !== null && _0 !== void 0 ? _0 : (eachAttribute.type === "image"
|
|
1620
1643
|
? ".png,.jpg,.jpeg,.heic,.heif,.tiff"
|
|
1621
1644
|
: ".pdf");
|
|
1622
|
-
var fileDescription = (
|
|
1623
|
-
inputList[groupId].push(react_1.default.createElement(uploadInput_1.UploadInput, { lib: { axios: (
|
|
1645
|
+
var fileDescription = (_1 = eachAttribute.fileDescription) !== null && _1 !== void 0 ? _1 : (eachAttribute.type === "image" ? undefined : "PDF up to 30MB");
|
|
1646
|
+
inputList[groupId].push(react_1.default.createElement(uploadInput_1.UploadInput, { lib: { axios: (_2 = props === null || props === void 0 ? void 0 : props.lib) === null || _2 === void 0 ? void 0 : _2.axios }, ref: isOptional
|
|
1624
1647
|
? null
|
|
1625
|
-
: formInputRef[(
|
|
1648
|
+
: formInputRef[(_3 = eachAttribute.refIndex) !== null && _3 !== void 0 ? _3 : index], id: eachAttribute.id, label: label, labelExtra: labelExtra, infoElement: (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? undefined : infoElement, optional: isOptional, file: (_4 = url !== null && url !== void 0 ? url : clonedSelectedData[eachAttribute.id]) !== null && _4 !== void 0 ? _4 : "", accept: accept, capture: eachAttribute.imageInputCapture, fileDescription: fileDescription, maxFileSize: fileProps === null || fileProps === void 0 ? void 0 : fileProps.maxFileSize, onChange: updateMethod.handleOnChangeFile, showModal: eachAttribute.showCameraGalleryOptionModal, disabled: disabled, handleCustomDownloadFile: fileProps === null || fileProps === void 0 ? void 0 : fileProps.handleCustomDownloadFile, compress: eachAttribute.maxFileSize && eachAttribute.compressfileQuality
|
|
1626
1649
|
? {
|
|
1627
1650
|
maxFileSize: eachAttribute.maxFileSize,
|
|
1628
1651
|
fileQuality: eachAttribute.compressfileQuality,
|
|
@@ -1632,7 +1655,7 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1632
1655
|
case "multipleImage":
|
|
1633
1656
|
case "multipleFile":
|
|
1634
1657
|
var multipleDataUrl = clonedSelectedData[eachAttribute.id]["data"]
|
|
1635
|
-
? (
|
|
1658
|
+
? (_5 = clonedSelectedData[eachAttribute.id]["data"]) === null || _5 === void 0 ? void 0 : _5.map(function (eachImage) {
|
|
1636
1659
|
return __assign(__assign(__assign(__assign({ token: eachImage.token }, (eachImage.tags ? { tags: eachImage.tags } : {})), (eachImage.description
|
|
1637
1660
|
? { description: eachImage.description }
|
|
1638
1661
|
: {})), (eachImage.hidden ? { hidden: eachImage.hidden } : {})), { fileName: (props === null || props === void 0 ? void 0 : props.isObjectList)
|
|
@@ -1648,20 +1671,20 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1648
1671
|
: (0, blobModule_1.renderImageUrlFromPath)(fileProps === null || fileProps === void 0 ? void 0 : fileProps.imageEndpoint, eachAttribute.imageCollectionName, props === null || props === void 0 ? void 0 : props.id, eachImage.fileName, eachImage.token) });
|
|
1649
1672
|
})
|
|
1650
1673
|
: [];
|
|
1651
|
-
var multiAccept = (
|
|
1674
|
+
var multiAccept = (_6 = eachAttribute.fileExtension) !== null && _6 !== void 0 ? _6 : (eachAttribute.type === "multipleImage"
|
|
1652
1675
|
? ".png,.jpg,.jpeg,.heic,.heif,.tiff"
|
|
1653
1676
|
: ".pdf");
|
|
1654
|
-
var multiFileDescription = (
|
|
1677
|
+
var multiFileDescription = (_7 = eachAttribute.fileDescription) !== null && _7 !== void 0 ? _7 : (eachAttribute.type === "multipleImage"
|
|
1655
1678
|
? undefined
|
|
1656
1679
|
: "PDF up to 30MB");
|
|
1657
1680
|
inputList[groupId].push(react_1.default.createElement(uploadInput_1.UploadInput, { type: "multi", files: __assign(__assign({}, (!react_1.default.isValidElement(clonedSelectedData[eachAttribute.id])
|
|
1658
1681
|
? clonedSelectedData[eachAttribute.id]
|
|
1659
1682
|
: { upload: [], remove: [] })), { data: multipleDataUrl }), optional: isOptional, ref: isOptional
|
|
1660
1683
|
? null
|
|
1661
|
-
: formInputRef[(
|
|
1684
|
+
: formInputRef[(_8 = eachAttribute.refIndex) !== null && _8 !== void 0 ? _8 : index], id: eachAttribute.id, label: label, labelExtra: labelExtra, infoElement: (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? undefined : infoElement, showModal: eachAttribute.showCameraGalleryOptionModal, accept: multiAccept, capture: eachAttribute.imageInputCapture, fileDescription: multiFileDescription, maxFileSize: fileProps === null || fileProps === void 0 ? void 0 : fileProps.maxFileSize, onChange: function (_a) {
|
|
1662
1685
|
var value = _a.value, action = _a.action;
|
|
1663
1686
|
updateMethod.handleOnChangeFiles(eachAttribute.id, value, action);
|
|
1664
|
-
}, lib: { axios: (
|
|
1687
|
+
}, lib: { axios: (_9 = props === null || props === void 0 ? void 0 : props.lib) === null || _9 === void 0 ? void 0 : _9.axios }, disabled: disabled, confirmOnRemove: eachAttribute.confirmOnRemove, noDuplicateFileName: eachAttribute.noDuplicateFileName, handleCustomDownloadFile: fileProps === null || fileProps === void 0 ? void 0 : fileProps.handleCustomDownloadFile, minFiles: eachAttribute.minNumberOfFiles, compress: eachAttribute.maxFileSize && eachAttribute.compressfileQuality
|
|
1665
1688
|
? {
|
|
1666
1689
|
maxFileSize: eachAttribute.maxFileSize,
|
|
1667
1690
|
fileQuality: eachAttribute.compressfileQuality,
|
|
@@ -1671,7 +1694,7 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1671
1694
|
case "number":
|
|
1672
1695
|
inputList[groupId].push(react_1.default.createElement(textInput_1.TextInput, { id: eachAttribute.id, ref: isOptional
|
|
1673
1696
|
? null
|
|
1674
|
-
: formInputRef[(
|
|
1697
|
+
: formInputRef[(_10 = eachAttribute.refIndex) !== null && _10 !== void 0 ? _10 : index], type: "number", value: (_11 = clonedSelectedData[eachAttribute.id]) !== null && _11 !== void 0 ? _11 : "", placeholder: placeholder, label: label, labelExtra: labelExtra, subLabel: subLabel, infoElement: (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? undefined : infoElement, optional: isOptional, onChange: updateMethod.handleOnChangeText, disabled: disabled, minNumber: eachAttribute.minNumber, maxNumber: eachAttribute.maxNumber, cellInput: {
|
|
1675
1698
|
active: cellInput === null || cellInput === void 0 ? void 0 : cellInput.active,
|
|
1676
1699
|
onBlur: cellInput === null || cellInput === void 0 ? void 0 : cellInput.onBlur,
|
|
1677
1700
|
}, customElement: selectInputCustomElement, mobileView: mobileView }));
|
|
@@ -1679,13 +1702,13 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1679
1702
|
case "reference":
|
|
1680
1703
|
case "listReference": {
|
|
1681
1704
|
var selectedReferenceOptions = (props === null || props === void 0 ? void 0 : props.isObject)
|
|
1682
|
-
? ((
|
|
1683
|
-
: ((
|
|
1705
|
+
? ((_12 = referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.referencesOptions[(objectProps === null || objectProps === void 0 ? void 0 : objectProps.selectedObjectStructureId) + "." + eachAttribute.id]) !== null && _12 !== void 0 ? _12 : [])
|
|
1706
|
+
: ((_13 = referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.referencesOptions[eachAttribute.id]) !== null && _13 !== void 0 ? _13 : []);
|
|
1684
1707
|
if (eachAttribute.referenceMapColumnId) {
|
|
1685
1708
|
var referenceKey = (props === null || props === void 0 ? void 0 : props.isObject)
|
|
1686
1709
|
? "".concat(objectProps === null || objectProps === void 0 ? void 0 : objectProps.selectedObjectStructureId, ".").concat(eachAttribute.id)
|
|
1687
1710
|
: eachAttribute.id;
|
|
1688
|
-
var referenceDocs = (
|
|
1711
|
+
var referenceDocs = (_15 = (_14 = referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.referencesDetails) === null || _14 === void 0 ? void 0 : _14[referenceKey]) !== null && _15 !== void 0 ? _15 : [];
|
|
1689
1712
|
var polygonList_1 = [];
|
|
1690
1713
|
if (referenceDocs.length > 0) {
|
|
1691
1714
|
referenceDocs.forEach(function (doc) {
|
|
@@ -1751,9 +1774,9 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1751
1774
|
: null;
|
|
1752
1775
|
var displayValue = "";
|
|
1753
1776
|
if (selectedOption) {
|
|
1754
|
-
displayValue = "".concat(selectedOption[(
|
|
1777
|
+
displayValue = "".concat(selectedOption[(_16 = eachAttribute.referenceLabel) !== null && _16 !== void 0 ? _16 : ""], " ");
|
|
1755
1778
|
if (eachAttribute.referenceMapLabelColumnId) {
|
|
1756
|
-
displayValue += "(".concat(selectedOption[(
|
|
1779
|
+
displayValue += "(".concat(selectedOption[(_17 = eachAttribute.referenceMapLabelColumnId) !== null && _17 !== void 0 ? _17 : ""], ")");
|
|
1757
1780
|
}
|
|
1758
1781
|
}
|
|
1759
1782
|
inputList[groupId].push(react_1.default.createElement("div", { id: eachAttribute.id, className: "flex flex-col gap-y-2" },
|
|
@@ -1769,7 +1792,7 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1769
1792
|
inputList[groupId].push(react_1.default.createElement(react_1.default.Fragment, null,
|
|
1770
1793
|
react_1.default.createElement(select_1.Select, { ref: isOptional
|
|
1771
1794
|
? null
|
|
1772
|
-
: formInputRef[(
|
|
1795
|
+
: formInputRef[(_18 = eachAttribute.refIndex) !== null && _18 !== void 0 ? _18 : index], id: eachAttribute.id, value: (_19 = clonedSelectedData[eachAttribute.id]) !== null && _19 !== void 0 ? _19 : (eachAttribute.type === "reference" ? "" : []), label: label, labelExtra: labelExtra, subLabel: subLabel, infoElement: (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? undefined : infoElement, optional: isOptional, placeholder: placeholder !== eachAttribute.name
|
|
1773
1796
|
? placeholder
|
|
1774
1797
|
: "Select An Option", showTag: eachAttribute.showTagSelections, disableKeyboard: eachAttribute.disabledKeyboardSearch, options: selectedReferenceOptions, onChange: function (value) {
|
|
1775
1798
|
updateMethod.handleOnChangeSelect(eachAttribute.id, value);
|
|
@@ -1859,14 +1882,14 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1859
1882
|
}
|
|
1860
1883
|
inputList[groupId].push(react_1.default.createElement(textInput_1.TextInput, { id: eachAttribute.id, ref: isOptional
|
|
1861
1884
|
? null
|
|
1862
|
-
: formInputRef[(
|
|
1885
|
+
: formInputRef[(_20 = eachAttribute.refIndex) !== null && _20 !== void 0 ? _20 : index], type: textType, value: (_21 = clonedSelectedData[eachAttribute.id]) !== null && _21 !== void 0 ? _21 : "", placeholder: placeholder, label: label, labelExtra: labelExtra, subLabel: subLabel, infoElement: (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? undefined : infoElement, optional: isOptional, onChange: updateMethod.handleOnChangeText, disabled: disabled, cellInput: {
|
|
1863
1886
|
active: cellInput === null || cellInput === void 0 ? void 0 : cellInput.active,
|
|
1864
1887
|
onBlur: cellInput === null || cellInput === void 0 ? void 0 : cellInput.onBlur,
|
|
1865
1888
|
}, mobilePicker: true, mobileCountryEditable: eachAttribute.mobileCountryEditable, capitalize: eachAttribute.type === "string"
|
|
1866
1889
|
? eachAttribute.capitalize
|
|
1867
1890
|
: undefined, strSuggestions: eachAttribute.type === "string" &&
|
|
1868
1891
|
eachAttribute.stringSuggestions &&
|
|
1869
|
-
((
|
|
1892
|
+
((_22 = eachAttribute.stringSuggestions) === null || _22 === void 0 ? void 0 : _22.length) > 0
|
|
1870
1893
|
? eachAttribute.stringSuggestions
|
|
1871
1894
|
: undefined, customElement: selectInputCustomElement, mobileView: mobileView }));
|
|
1872
1895
|
break;
|
|
@@ -1878,8 +1901,8 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1878
1901
|
clonedSelectedData[eachAttribute.id] instanceof Date)
|
|
1879
1902
|
dateValue = clonedSelectedData[eachAttribute.id];
|
|
1880
1903
|
else if (typeof clonedSelectedData[eachAttribute.id] === "object")
|
|
1881
|
-
dateValue = ((
|
|
1882
|
-
? (0, dayjs_1.default)((
|
|
1904
|
+
dateValue = ((_23 = clonedSelectedData === null || clonedSelectedData === void 0 ? void 0 : clonedSelectedData[eachAttribute.id]) === null || _23 === void 0 ? void 0 : _23["_seconds"])
|
|
1905
|
+
? (0, dayjs_1.default)((_24 = clonedSelectedData === null || clonedSelectedData === void 0 ? void 0 : clonedSelectedData[eachAttribute.id]) === null || _24 === void 0 ? void 0 : _24["_seconds"]).toDate()
|
|
1883
1906
|
: (0, dayjs_1.default)().toDate();
|
|
1884
1907
|
else if (clonedSelectedData[eachAttribute.id] === undefined)
|
|
1885
1908
|
dateValue = undefined;
|
|
@@ -1887,7 +1910,7 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1887
1910
|
var hideDate = eachAttribute.hideShowDate ? true : false;
|
|
1888
1911
|
inputList[groupId].push(react_1.default.createElement(datePicker_1.InputDatePicker, { title: label, labelExtra: labelExtra, subLabel: subLabel, id: eachAttribute.id, optional: isOptional, ref: isOptional
|
|
1889
1912
|
? null
|
|
1890
|
-
: formInputRef[(
|
|
1913
|
+
: formInputRef[(_25 = eachAttribute.refIndex) !== null && _25 !== void 0 ? _25 : index], onChange: updateMethod.handleOnChangeDate, value: dateValue, disabled: disabled, cellInput: {
|
|
1891
1914
|
active: cellInput === null || cellInput === void 0 ? void 0 : cellInput.active,
|
|
1892
1915
|
onBlur: cellInput === null || cellInput === void 0 ? void 0 : cellInput.onBlur,
|
|
1893
1916
|
}, minDate: eachAttribute.minDate, maxDate: eachAttribute.maxDate, staticDropdown: modalInput, showTime: showTime, hideDate: hideDate, infoElement: (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? undefined : infoElement, customElement: selectInputCustomElement, mobileView: mobileView }));
|
|
@@ -1897,11 +1920,11 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1897
1920
|
// editor per field (even read-only) freezes text-heavy records.
|
|
1898
1921
|
// MarkdownStatic reproduces the editor's exact output with no editor.
|
|
1899
1922
|
if ((props === null || props === void 0 ? void 0 : props.type) === "read") {
|
|
1900
|
-
inputList[groupId].push(react_1.default.createElement(markdown_1.MarkdownStatic, { key: eachAttribute.id, id: eachAttribute.id, label: label, labelExtra: labelExtra, subLabel: subLabel, value: (
|
|
1923
|
+
inputList[groupId].push(react_1.default.createElement(markdown_1.MarkdownStatic, { key: eachAttribute.id, id: eachAttribute.id, label: label, labelExtra: labelExtra, subLabel: subLabel, value: (_26 = clonedSelectedData[eachAttribute.id]) !== null && _26 !== void 0 ? _26 : "" }));
|
|
1901
1924
|
break;
|
|
1902
1925
|
}
|
|
1903
|
-
var markdownRef = formInputRef[(
|
|
1904
|
-
inputList[groupId].push(react_1.default.createElement(markdown_1.MarkdownInput, { id: eachAttribute.id, ref: markdownRef, label: label, labelExtra: labelExtra, subLabel: subLabel, value: (
|
|
1926
|
+
var markdownRef = formInputRef[(_27 = eachAttribute.refIndex) !== null && _27 !== void 0 ? _27 : index];
|
|
1927
|
+
inputList[groupId].push(react_1.default.createElement(markdown_1.MarkdownInput, { id: eachAttribute.id, ref: markdownRef, label: label, labelExtra: labelExtra, subLabel: subLabel, value: (_28 = clonedSelectedData[eachAttribute.id]) !== null && _28 !== void 0 ? _28 : "", placeholder: placeholder, optional: isOptional, onChange: updateMethod.handleOnChangeMarkdown, disabled: disabled, infoElement: (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? undefined : infoElement, lib: ((_29 = props === null || props === void 0 ? void 0 : props.lib) === null || _29 === void 0 ? void 0 : _29.axios) ? { axios: props.lib.axios } : undefined, uploadEndpoint: ((_30 = referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.devSettings) === null || _30 === void 0 ? void 0 : _30.uploadEndpoint) ||
|
|
1905
1928
|
eachAttribute.uploadEndpoint, enableImageUpload: eachAttribute.enableImageUpload, enableVideoUpload: eachAttribute.enableVideoUpload, compress: eachAttribute.maxFileSize && eachAttribute.compressfileQuality
|
|
1906
1929
|
? {
|
|
1907
1930
|
maxFileSize: eachAttribute.maxFileSize,
|
|
@@ -1912,7 +1935,7 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1912
1935
|
case "textArea":
|
|
1913
1936
|
inputList[groupId].push(react_1.default.createElement(textArea_1.TextArea, { id: eachAttribute.id, ref: isOptional
|
|
1914
1937
|
? null
|
|
1915
|
-
: formInputRef[(
|
|
1938
|
+
: formInputRef[(_31 = eachAttribute.refIndex) !== null && _31 !== void 0 ? _31 : index], label: label, labelExtra: labelExtra, subLabel: subLabel, placeholder: placeholder, value: (_32 = clonedSelectedData[eachAttribute.id]) !== null && _32 !== void 0 ? _32 : "", rows: 4, optional: isOptional, onChange: updateMethod.handleOnChangeText, infoElement: (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? undefined : infoElement, disabled: disabled, customElement: selectInputCustomElement }));
|
|
1916
1939
|
break;
|
|
1917
1940
|
case "signature":
|
|
1918
1941
|
var hasSigImageToken = typeof clonedSelectedData[eachAttribute.id] === "string" &&
|
|
@@ -1922,7 +1945,7 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1922
1945
|
signatureUrl = (0, blobModule_1.renderImageUrlFromPath)(fileProps === null || fileProps === void 0 ? void 0 : fileProps.imageEndpoint, eachAttribute.imageCollectionName, props === null || props === void 0 ? void 0 : props.id, eachAttribute.imageFileName, clonedSelectedData[eachAttribute.id], fileProps === null || fileProps === void 0 ? void 0 : fileProps.imageBucketName);
|
|
1923
1946
|
}
|
|
1924
1947
|
inputList[groupId].push(react_1.default.createElement("div", { className: eachAttribute.description ? "w-full min-h-72" : "w-full h-72" },
|
|
1925
|
-
react_1.default.createElement(signature_1.Signature, { id: eachAttribute.id, ref: formInputRef[(
|
|
1948
|
+
react_1.default.createElement(signature_1.Signature, { id: eachAttribute.id, ref: formInputRef[(_33 = eachAttribute.refIndex) !== null && _33 !== void 0 ? _33 : index], label: label, labelExtra: labelExtra, description: eachAttribute.description, subLabel: undefined, dataURL: signatureUrl, optional: isOptional, signing: signatureProps === null || signatureProps === void 0 ? void 0 : signatureProps.signing, onChange: signatureProps === null || signatureProps === void 0 ? void 0 : signatureProps.setSigning, onSubmit: function (_, dataURL) {
|
|
1926
1949
|
return updateMethod.handleSignatureComplete(dataURL, eachAttribute.id);
|
|
1927
1950
|
}, signatureClear: true, canvasContainerClassName: "shadow-none", infoElement: (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? undefined : infoElement, customElement: selectInputCustomElement })));
|
|
1928
1951
|
break;
|
|
@@ -1937,7 +1960,7 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1937
1960
|
flexTableRef = objectProps.flexTableRefs[flexTableRefIndex];
|
|
1938
1961
|
}
|
|
1939
1962
|
}
|
|
1940
|
-
inputList[groupId].push((0, exports.renderEachListObject)((
|
|
1963
|
+
inputList[groupId].push((0, exports.renderEachListObject)((_34 = props === null || props === void 0 ? void 0 : props.type) !== null && _34 !== void 0 ? _34 : "read", eachAttribute.id, model, data, (_35 = props === null || props === void 0 ? void 0 : props.id) !== null && _35 !== void 0 ? _35 : "", (props === null || props === void 0 ? void 0 : props.remainId) ? false : true, isForm ? false : true, (objectProps === null || objectProps === void 0 ? void 0 : objectProps.organiseListObjTableView) ? true : false, referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.devSettings, objectProps === null || objectProps === void 0 ? void 0 : objectProps.handleSelectListObjectData, referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.referencesOptions, objectProps === null || objectProps === void 0 ? void 0 : objectProps.setSelectedObjectStructureId, objectProps === null || objectProps === void 0 ? void 0 : objectProps.handlePopUpModal, objectProps === null || objectProps === void 0 ? void 0 : objectProps.setSelectedData, flexTableRef, undefined));
|
|
1941
1964
|
}
|
|
1942
1965
|
break;
|
|
1943
1966
|
case "canvas":
|
|
@@ -1953,20 +1976,20 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1953
1976
|
normalizedDrawings = [];
|
|
1954
1977
|
}
|
|
1955
1978
|
else {
|
|
1956
|
-
normalizedTexts = (
|
|
1957
|
-
normalizedDrawings = (
|
|
1979
|
+
normalizedTexts = (_36 = canvasData.texts) !== null && _36 !== void 0 ? _36 : [];
|
|
1980
|
+
normalizedDrawings = (_37 = canvasData.drawings) !== null && _37 !== void 0 ? _37 : [];
|
|
1958
1981
|
}
|
|
1959
1982
|
}
|
|
1960
1983
|
else {
|
|
1961
1984
|
// Old format: expect texts[] array
|
|
1962
1985
|
normalizedTexts = Array.isArray(canvasData)
|
|
1963
1986
|
? canvasData
|
|
1964
|
-
: ((
|
|
1987
|
+
: ((_38 = canvasData === null || canvasData === void 0 ? void 0 : canvasData.texts) !== null && _38 !== void 0 ? _38 : []);
|
|
1965
1988
|
normalizedDrawings = [];
|
|
1966
1989
|
}
|
|
1967
1990
|
inputList[groupId].push(react_1.default.createElement(canvas_1.Canvas, { ref: isOptional
|
|
1968
1991
|
? null
|
|
1969
|
-
: formInputRef[(
|
|
1992
|
+
: formInputRef[(_39 = eachAttribute.refIndex) !== null && _39 !== void 0 ? _39 : index], id: eachAttribute.id, label: label, labelExtra: labelExtra, infoElement: (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? undefined : infoElement, customElement: selectInputCustomElement, optional: isOptional, enableDraw: (props === null || props === void 0 ? void 0 : props.type) === "update" ? eachAttribute.enableDraw : false, enableImageUpload: (props === null || props === void 0 ? void 0 : props.type) === "update" ? eachAttribute.enableImageUpload : false, readOnly: (props === null || props === void 0 ? void 0 : props.type) !== "update", texts: normalizedTexts, drawings: normalizedDrawings, backgroundImageUrl: eachAttribute.enableImageUpload &&
|
|
1970
1993
|
canvasData &&
|
|
1971
1994
|
!Array.isArray(canvasData) &&
|
|
1972
1995
|
canvasData.backgroundImage
|
|
@@ -1974,17 +1997,17 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
1974
1997
|
// If it has file but no token, create blob URL from File object
|
|
1975
1998
|
canvasData.backgroundImage.token
|
|
1976
1999
|
? (props === null || props === void 0 ? void 0 : props.isObjectList)
|
|
1977
|
-
? (0, blobModule_1.renderImageUrlFromPath)((
|
|
2000
|
+
? (0, blobModule_1.renderImageUrlFromPath)((_40 = fileProps === null || fileProps === void 0 ? void 0 : fileProps.imageEndpoint) !== null && _40 !== void 0 ? _40 : "", eachAttribute.imageCollectionName + "%2F" + props.id, (objectProps === null || objectProps === void 0 ? void 0 : objectProps.selectedObjectStructureId) +
|
|
1978
2001
|
"%2F" +
|
|
1979
2002
|
(objectProps === null || objectProps === void 0 ? void 0 : objectProps.selectedObjectId) +
|
|
1980
2003
|
"%2F" +
|
|
1981
2004
|
eachAttribute.id, canvasData.backgroundImage.fileName, canvasData.backgroundImage.token, fileProps === null || fileProps === void 0 ? void 0 : fileProps.imageBucketName)
|
|
1982
2005
|
: (props === null || props === void 0 ? void 0 : props.isObject)
|
|
1983
|
-
? (0, blobModule_1.renderImageUrlFromPath)((
|
|
2006
|
+
? (0, blobModule_1.renderImageUrlFromPath)((_41 = fileProps === null || fileProps === void 0 ? void 0 : fileProps.imageEndpoint) !== null && _41 !== void 0 ? _41 : "", eachAttribute.imageCollectionName + "%2F" + props.id, (objectProps === null || objectProps === void 0 ? void 0 : objectProps.selectedObjectStructureId) +
|
|
1984
2007
|
"%2F" +
|
|
1985
2008
|
eachAttribute.id +
|
|
1986
2009
|
"%2FbaseCanvas", canvasData.backgroundImage.fileName, canvasData.backgroundImage.token, fileProps === null || fileProps === void 0 ? void 0 : fileProps.imageBucketName)
|
|
1987
|
-
: (0, blobModule_1.renderImageUrlFromPath)((
|
|
2010
|
+
: (0, blobModule_1.renderImageUrlFromPath)((_42 = fileProps === null || fileProps === void 0 ? void 0 : fileProps.imageEndpoint) !== null && _42 !== void 0 ? _42 : "", (_43 = eachAttribute.imageCollectionName) !== null && _43 !== void 0 ? _43 : "", ((_44 = props === null || props === void 0 ? void 0 : props.id) !== null && _44 !== void 0 ? _44 : "") + "%2FbaseCanvas", canvasData.backgroundImage.fileName, canvasData.backgroundImage.token, fileProps === null || fileProps === void 0 ? void 0 : fileProps.imageBucketName)
|
|
1988
2011
|
: canvasData.backgroundImage.file &&
|
|
1989
2012
|
canvasData.backgroundImage.file instanceof File
|
|
1990
2013
|
? // Image hasn't been uploaded yet - use cached blob URL from File object
|
|
@@ -2101,7 +2124,7 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
2101
2124
|
} }));
|
|
2102
2125
|
break;
|
|
2103
2126
|
case "ganttchart":
|
|
2104
|
-
inputList[groupId].push(react_1.default.createElement(ganttChart_1.GanttChart, { id: eachAttribute.id, title: label, label: label, labelExtra: labelExtra, infoElement: (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? undefined : infoElement, tasks: (
|
|
2127
|
+
inputList[groupId].push(react_1.default.createElement(ganttChart_1.GanttChart, { id: eachAttribute.id, title: label, label: label, labelExtra: labelExtra, infoElement: (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? undefined : infoElement, tasks: (_45 = clonedSelectedData[eachAttribute.id]) !== null && _45 !== void 0 ? _45 : [], onTaskChange: function (tasks) {
|
|
2105
2128
|
updateMethod.handleOnChangeSelect(eachAttribute.id, tasks);
|
|
2106
2129
|
}, mode: "write", chartOnly: true }));
|
|
2107
2130
|
break;
|
|
@@ -2115,31 +2138,68 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
2115
2138
|
"textArea",
|
|
2116
2139
|
"referenceMap",
|
|
2117
2140
|
];
|
|
2118
|
-
|
|
2141
|
+
// INFO: rowColumns → responsive col-span classes (full strings for Tailwind JIT)
|
|
2142
|
+
var rowColumnsClassMap = {
|
|
2143
|
+
1: {
|
|
2144
|
+
mobile: "col-span-12",
|
|
2145
|
+
default: "col-span-12",
|
|
2146
|
+
},
|
|
2147
|
+
2: {
|
|
2148
|
+
mobile: "col-span-12 md:col-span-6",
|
|
2149
|
+
default: "col-span-12 sm:col-span-6",
|
|
2150
|
+
},
|
|
2151
|
+
3: {
|
|
2152
|
+
mobile: "col-span-12 md:col-span-4",
|
|
2153
|
+
default: "col-span-12 sm:col-span-6 md:col-span-4",
|
|
2154
|
+
},
|
|
2155
|
+
4: {
|
|
2156
|
+
mobile: "col-span-12 md:col-span-3",
|
|
2157
|
+
default: "col-span-12 sm:col-span-6 md:col-span-3",
|
|
2158
|
+
},
|
|
2159
|
+
6: {
|
|
2160
|
+
mobile: "col-span-12 md:col-span-2",
|
|
2161
|
+
default: "col-span-12 sm:col-span-6 md:col-span-2",
|
|
2162
|
+
},
|
|
2163
|
+
};
|
|
2164
|
+
var defaultClassName = function (inputType, fieldRowColumns) {
|
|
2119
2165
|
var className = "content-start ";
|
|
2120
2166
|
var isOneColType = oneColDataType.includes(inputType);
|
|
2121
2167
|
var currentColumnType = columnType !== null && columnType !== void 0 ? columnType : "two";
|
|
2168
|
+
// INFO: Full-width types always span the entire row regardless of settings
|
|
2169
|
+
if (isOneColType) {
|
|
2170
|
+
className += "col-span-12";
|
|
2171
|
+
return className;
|
|
2172
|
+
}
|
|
2173
|
+
// INFO: If field has a custom rowColumns override, use it with responsive fallback
|
|
2174
|
+
if (fieldRowColumns) {
|
|
2175
|
+
var classes = rowColumnsClassMap[fieldRowColumns];
|
|
2176
|
+
if (mobileView)
|
|
2177
|
+
className += classes.mobile;
|
|
2178
|
+
else
|
|
2179
|
+
className += classes.default;
|
|
2180
|
+
return className;
|
|
2181
|
+
}
|
|
2182
|
+
// INFO: Default behaviour based on bareUpdateColumnType
|
|
2122
2183
|
if (currentColumnType === "one") {
|
|
2123
|
-
|
|
2184
|
+
// "one" = 2 inputs per row → col-span-6
|
|
2185
|
+
if (mobileView)
|
|
2186
|
+
className += "col-span-12 md:col-span-6";
|
|
2187
|
+
else
|
|
2188
|
+
className += "col-span-12 sm:col-span-6";
|
|
2124
2189
|
}
|
|
2125
2190
|
else if (currentColumnType === "four") {
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
else
|
|
2132
|
-
className += "col-span-4 sm:col-span-2 md:col-span-1";
|
|
2133
|
-
}
|
|
2191
|
+
// "four" = 4 inputs per row → col-span-3
|
|
2192
|
+
if (mobileView)
|
|
2193
|
+
className += "col-span-12 md:col-span-3";
|
|
2194
|
+
else
|
|
2195
|
+
className += "col-span-12 sm:col-span-6 md:col-span-3";
|
|
2134
2196
|
}
|
|
2135
2197
|
else {
|
|
2136
|
-
|
|
2137
|
-
if (
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
className += " sm:col-span-2";
|
|
2142
|
-
}
|
|
2198
|
+
// "two" = 2 inputs per row → col-span-6
|
|
2199
|
+
if (mobileView)
|
|
2200
|
+
className += "col-span-12 md:col-span-6";
|
|
2201
|
+
else
|
|
2202
|
+
className += "col-span-12 sm:col-span-6";
|
|
2143
2203
|
}
|
|
2144
2204
|
return className;
|
|
2145
2205
|
};
|
|
@@ -2148,7 +2208,7 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
2148
2208
|
var _a;
|
|
2149
2209
|
var selectedModel = model.find(function (eachAttribute) { return eachAttribute.id === eachInput.props.id; });
|
|
2150
2210
|
var isReferenceMap = selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.referenceMapColumnId;
|
|
2151
|
-
return (react_1.default.createElement("div", { key: key + index, className: defaultClassName(isReferenceMap ? "referenceMap" : ((_a = selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) !== null && _a !== void 0 ? _a : "")) }, eachInput));
|
|
2211
|
+
return (react_1.default.createElement("div", { key: key + index, className: defaultClassName(isReferenceMap ? "referenceMap" : ((_a = selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) !== null && _a !== void 0 ? _a : ""), selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.rowColumns) }, eachInput));
|
|
2152
2212
|
});
|
|
2153
2213
|
};
|
|
2154
2214
|
var renderDefaultInputs = function () {
|
|
@@ -2157,11 +2217,10 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
2157
2217
|
var _a;
|
|
2158
2218
|
var selectedModel = model.find(function (eachAttribute) { return eachAttribute.id === eachInput.props.id; });
|
|
2159
2219
|
var isReferenceMap = selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.referenceMapColumnId;
|
|
2160
|
-
return (react_1.default.createElement("div", { key: index, className: defaultClassName(isReferenceMap ? "referenceMap" : ((_a = selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) !== null && _a !== void 0 ? _a : "")) }, eachInput));
|
|
2220
|
+
return (react_1.default.createElement("div", { key: index, className: defaultClassName(isReferenceMap ? "referenceMap" : ((_a = selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) !== null && _a !== void 0 ? _a : ""), selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.rowColumns) }, eachInput));
|
|
2161
2221
|
});
|
|
2162
2222
|
};
|
|
2163
|
-
var
|
|
2164
|
-
var sectionClassName = "text-md text-neutral-600 ".concat(currentColumnType === "one" ? "col-span-2" : "col-span-4");
|
|
2223
|
+
var sectionClassName = "text-md text-neutral-600 col-span-12";
|
|
2165
2224
|
// Sort groups alphabetically (except "default" which goes last)
|
|
2166
2225
|
var sortedInputListEntries = Object.entries(inputList).sort(function (_a, _b) {
|
|
2167
2226
|
var keyA = _a[0];
|
|
@@ -2172,6 +2231,14 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
2172
2231
|
return -1;
|
|
2173
2232
|
return keyA.localeCompare(keyB);
|
|
2174
2233
|
});
|
|
2234
|
+
// INFO: renders static fields as a DetailList within each group section
|
|
2235
|
+
var renderStaticDetailList = function (groupKey) {
|
|
2236
|
+
var items = staticList[groupKey];
|
|
2237
|
+
if (!items || items.length === 0)
|
|
2238
|
+
return null;
|
|
2239
|
+
return (react_1.default.createElement("div", { className: "col-span-12 mt-4" },
|
|
2240
|
+
react_1.default.createElement(detailList_1.DetailList, { title: "", list: items, size: "compact", className: "border rounded-lg" })));
|
|
2241
|
+
};
|
|
2175
2242
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
2176
2243
|
sortedInputListEntries.map(function (_a, index) {
|
|
2177
2244
|
var _b, _c, _d;
|
|
@@ -2180,12 +2247,16 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
2180
2247
|
return null;
|
|
2181
2248
|
return Object.keys((_b = props === null || props === void 0 ? void 0 : props.groupIdCollapsible) !== null && _b !== void 0 ? _b : {}).length > 0 ? (react_1.default.createElement(collapse_1.Collapse, { key: key, defaultValue: ((_c = props === null || props === void 0 ? void 0 : props.groupIdCollapsible) === null || _c === void 0 ? void 0 : _c[key])
|
|
2182
2249
|
? !((_d = props === null || props === void 0 ? void 0 : props.groupIdCollapsible) === null || _d === void 0 ? void 0 : _d[key])
|
|
2183
|
-
: true, titleClassName: "!font-bold", containerClassName: "".concat(sectionClassName), notCollapseContainerCss: "bg-primary-50 rounded-md", collapseContainerCss: "bg-white rounded-md", title: key, icon: react_1.default.createElement(react_1.default.Fragment, null), content: react_1.default.createElement("div", { className: "grid grid-cols-4 ".concat(mobileView ? "gap-x-6 gap-y-2 md:gap-6" : "gap-6", " mt-6") },
|
|
2250
|
+
: true, titleClassName: "!font-bold", containerClassName: "".concat(sectionClassName), notCollapseContainerCss: "bg-primary-50 rounded-md", collapseContainerCss: "bg-white rounded-md", title: key, icon: react_1.default.createElement(react_1.default.Fragment, null), content: react_1.default.createElement("div", { className: "grid grid-cols-4 ".concat(mobileView ? "gap-x-6 gap-y-2 md:gap-6" : "gap-6", " mt-6") },
|
|
2251
|
+
renderInputs(key, inputs),
|
|
2252
|
+
renderStaticDetailList(key)), formInputRefList: formInputRefList === null || formInputRefList === void 0 ? void 0 : formInputRefList[key] })) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
2184
2253
|
react_1.default.createElement("div", { className: "".concat(index !== 0 ? "border-t pt-4 mt-5" : "", " ").concat(sectionClassName, " font-bold ") }, key),
|
|
2185
|
-
renderInputs(key, inputs)
|
|
2254
|
+
renderInputs(key, inputs),
|
|
2255
|
+
renderStaticDetailList(key)));
|
|
2186
2256
|
}),
|
|
2187
|
-
sortedInputListEntries.length > 1 && !(props === null || props === void 0 ? void 0 : props.groupIdCollapsible) && (react_1.default.createElement("div", { className: "mt-5 border-t text-md text-neutral-600
|
|
2188
|
-
renderDefaultInputs()
|
|
2257
|
+
sortedInputListEntries.length > 1 && !(props === null || props === void 0 ? void 0 : props.groupIdCollapsible) && (react_1.default.createElement("div", { className: "mt-5 border-t text-md text-neutral-600 col-span-12" })),
|
|
2258
|
+
renderDefaultInputs(),
|
|
2259
|
+
renderStaticDetailList("default")));
|
|
2189
2260
|
};
|
|
2190
2261
|
exports.renderDataTemplateForm = renderDataTemplateForm;
|
|
2191
2262
|
var compareUpdatedFields = function (prevData, currentData) {
|