datastake-daf 0.6.800 → 0.6.801
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/index.js
CHANGED
|
@@ -8501,22 +8501,20 @@ const useHeader = _ref => {
|
|
|
8501
8501
|
const {
|
|
8502
8502
|
useToken: useToken$m
|
|
8503
8503
|
} = antd.theme;
|
|
8504
|
-
function BreadCrumbs(
|
|
8505
|
-
|
|
8506
|
-
|
|
8507
|
-
|
|
8508
|
-
} = _ref;
|
|
8504
|
+
function BreadCrumbs({
|
|
8505
|
+
breadcrumbs = [],
|
|
8506
|
+
mainContWidth = 0
|
|
8507
|
+
}) {
|
|
8509
8508
|
const [splitIndex, setSplitIndex] = React.useState(0);
|
|
8510
8509
|
const {
|
|
8511
8510
|
token
|
|
8512
8511
|
} = useToken$m();
|
|
8513
|
-
const _renderBreadcrumb =
|
|
8514
|
-
let noOnClickLast = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
8512
|
+
const _renderBreadcrumb = (b, i, isLast, noOnClickLast = false) => {
|
|
8515
8513
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8516
8514
|
className: "flex breadcrumb-item",
|
|
8517
|
-
onClick: noOnClickLast && isLast ? undefined : b
|
|
8515
|
+
onClick: noOnClickLast && isLast ? undefined : b?.onClick,
|
|
8518
8516
|
children: [/*#__PURE__*/jsxRuntime.jsx("span", {
|
|
8519
|
-
children: b
|
|
8517
|
+
children: b?.label
|
|
8520
8518
|
}), !isLast && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8521
8519
|
className: "flex flex-column justify-content-center",
|
|
8522
8520
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
@@ -8526,7 +8524,7 @@ function BreadCrumbs(_ref) {
|
|
|
8526
8524
|
color: token.baseGray50
|
|
8527
8525
|
})
|
|
8528
8526
|
})]
|
|
8529
|
-
},
|
|
8527
|
+
}, `breadcrumb-item-${i}`);
|
|
8530
8528
|
};
|
|
8531
8529
|
React.useEffect(() => {
|
|
8532
8530
|
const _placeholderCont = document.getElementById("header-breadcrumbs");
|
|
@@ -8569,7 +8567,7 @@ function BreadCrumbs(_ref) {
|
|
|
8569
8567
|
placement: "bottomRight",
|
|
8570
8568
|
menu: {
|
|
8571
8569
|
items: groupedBreadCrumbs[2].map((it, i) => ({
|
|
8572
|
-
key:
|
|
8570
|
+
key: `items-${i}`,
|
|
8573
8571
|
label: it.label,
|
|
8574
8572
|
onClick: it.onClick
|
|
8575
8573
|
}))
|
|
@@ -9561,24 +9559,29 @@ const processConditionalTableKeys = (tableKeys, item) => {
|
|
|
9561
9559
|
});
|
|
9562
9560
|
return processedKeys;
|
|
9563
9561
|
};
|
|
9564
|
-
const renderFieldData = (type, value, user, config
|
|
9562
|
+
const renderFieldData = function (type, value, user, config) {
|
|
9563
|
+
let getApiBaseUrl = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : () => {};
|
|
9564
|
+
let getAppHeader = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : () => {};
|
|
9565
|
+
let app = arguments.length > 6 ? arguments[6] : undefined;
|
|
9566
|
+
let allValues = arguments.length > 7 ? arguments[7] : undefined;
|
|
9567
|
+
let formValues = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : {};
|
|
9565
9568
|
switch (type) {
|
|
9566
9569
|
case 'year':
|
|
9567
9570
|
return value !== '-' ? renderDateFormatted(value, 'YYYY', 'en') : '-';
|
|
9568
9571
|
case 'date':
|
|
9569
9572
|
{
|
|
9570
|
-
const language = user
|
|
9573
|
+
const language = user !== null && user !== void 0 && user.language && (user === null || user === void 0 ? void 0 : user.language) === 'sp' ? 'es' : user === null || user === void 0 ? void 0 : user.language;
|
|
9571
9574
|
return value !== '-' ? renderDateFormatted(value, 'DD MMM YYYY', language || 'en') : '-';
|
|
9572
9575
|
}
|
|
9573
9576
|
case 'select':
|
|
9574
9577
|
{
|
|
9575
|
-
const options = config
|
|
9578
|
+
const options = (config === null || config === void 0 ? void 0 : config.options) || [];
|
|
9576
9579
|
const option = findOptions(value, options);
|
|
9577
9580
|
return option;
|
|
9578
9581
|
}
|
|
9579
9582
|
case 'multiselect':
|
|
9580
9583
|
{
|
|
9581
|
-
const options = config
|
|
9584
|
+
const options = (config === null || config === void 0 ? void 0 : config.options) || [];
|
|
9582
9585
|
const _val = typeof value === 'string' ? value.split(',').map(v => v.trim()) : value;
|
|
9583
9586
|
const option = findOptions(_val, options);
|
|
9584
9587
|
return option.join(', ');
|
|
@@ -9593,7 +9596,7 @@ const renderFieldData = (type, value, user, config, getApiBaseUrl = () => {}, ge
|
|
|
9593
9596
|
formValues: formValues
|
|
9594
9597
|
});
|
|
9595
9598
|
case 'percentage':
|
|
9596
|
-
return value === '-' || value === null || value === undefined ? '-' :
|
|
9599
|
+
return value === '-' || value === null || value === undefined ? '-' : "".concat(value, " %");
|
|
9597
9600
|
case 'geolocation':
|
|
9598
9601
|
{
|
|
9599
9602
|
const val = JSON.parse(value) || {};
|
|
@@ -9607,7 +9610,7 @@ const renderFieldData = (type, value, user, config, getApiBaseUrl = () => {}, ge
|
|
|
9607
9610
|
case 'upload':
|
|
9608
9611
|
case 'videoUpload':
|
|
9609
9612
|
{
|
|
9610
|
-
const documentName = allValues
|
|
9613
|
+
const documentName = allValues === null || allValues === void 0 ? void 0 : allValues.map(item => item === null || item === void 0 ? void 0 : item.name).join(', ');
|
|
9611
9614
|
return documentName;
|
|
9612
9615
|
}
|
|
9613
9616
|
default:
|
package/dist/pages/index.js
CHANGED
|
@@ -57749,20 +57749,19 @@ const usePrepareForm$1 = ({
|
|
|
57749
57749
|
} = JSON.parse(JSON.stringify(allData[dKey][nKey] || {}));
|
|
57750
57750
|
console.log("here", dKey, nKey);
|
|
57751
57751
|
if (data.datastakeId === id || id === "user" || data.id === id) {
|
|
57752
|
-
|
|
57753
|
-
|
|
57754
|
-
|
|
57755
|
-
|
|
57756
|
-
|
|
57757
|
-
|
|
57758
|
-
|
|
57759
|
-
|
|
57760
|
-
|
|
57761
|
-
|
|
57762
|
-
|
|
57763
|
-
|
|
57764
|
-
|
|
57765
|
-
// }
|
|
57752
|
+
if (viewConfig.adminNamespaces.includes(namespace)) {
|
|
57753
|
+
setForm(form);
|
|
57754
|
+
} else {
|
|
57755
|
+
setForm({
|
|
57756
|
+
...form,
|
|
57757
|
+
linking: {
|
|
57758
|
+
position: 100,
|
|
57759
|
+
excludeFromEdit: true,
|
|
57760
|
+
label: t("Linked Subjects"),
|
|
57761
|
+
template: "linkingSubjects"
|
|
57762
|
+
}
|
|
57763
|
+
});
|
|
57764
|
+
}
|
|
57766
57765
|
setData(data);
|
|
57767
57766
|
setGroups(config.groups || {});
|
|
57768
57767
|
setLinkingForms(linkingForms);
|
package/package.json
CHANGED
|
@@ -38,10 +38,11 @@ export const usePrepareForm = ({
|
|
|
38
38
|
console.log("here", dKey, nKey)
|
|
39
39
|
|
|
40
40
|
if (data.datastakeId === id || id === "user" || data.id === id) {
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
if (viewConfig.adminNamespaces.includes(namespace)) {
|
|
42
|
+
setForm(form);
|
|
43
|
+
} else {
|
|
43
44
|
setForm({
|
|
44
|
-
|
|
45
|
+
...form,
|
|
45
46
|
linking: {
|
|
46
47
|
position: 100,
|
|
47
48
|
excludeFromEdit: true,
|
|
@@ -49,9 +50,7 @@ export const usePrepareForm = ({
|
|
|
49
50
|
template: "linkingSubjects",
|
|
50
51
|
},
|
|
51
52
|
});
|
|
52
|
-
|
|
53
|
-
// setForm(form);
|
|
54
|
-
// }
|
|
53
|
+
}
|
|
55
54
|
setData(data);
|
|
56
55
|
setGroups(config.groups || {});
|
|
57
56
|
setLinkingForms(linkingForms);
|