datastake-daf 0.6.761 → 0.6.762
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
|
@@ -9511,29 +9511,24 @@ const processConditionalTableKeys = (tableKeys, item) => {
|
|
|
9511
9511
|
});
|
|
9512
9512
|
return processedKeys;
|
|
9513
9513
|
};
|
|
9514
|
-
const renderFieldData =
|
|
9515
|
-
let getApiBaseUrl = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : () => {};
|
|
9516
|
-
let getAppHeader = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : () => {};
|
|
9517
|
-
let app = arguments.length > 6 ? arguments[6] : undefined;
|
|
9518
|
-
let allValues = arguments.length > 7 ? arguments[7] : undefined;
|
|
9519
|
-
let formValues = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : {};
|
|
9514
|
+
const renderFieldData = (type, value, user, config, getApiBaseUrl = () => {}, getAppHeader = () => {}, app, allValues, formValues = {}) => {
|
|
9520
9515
|
switch (type) {
|
|
9521
9516
|
case 'year':
|
|
9522
9517
|
return value !== '-' ? renderDateFormatted(value, 'YYYY', 'en') : '-';
|
|
9523
9518
|
case 'date':
|
|
9524
9519
|
{
|
|
9525
|
-
const language = user
|
|
9520
|
+
const language = user?.language && user?.language === 'sp' ? 'es' : user?.language;
|
|
9526
9521
|
return value !== '-' ? renderDateFormatted(value, 'DD MMM YYYY', language || 'en') : '-';
|
|
9527
9522
|
}
|
|
9528
9523
|
case 'select':
|
|
9529
9524
|
{
|
|
9530
|
-
const options =
|
|
9525
|
+
const options = config?.options || [];
|
|
9531
9526
|
const option = findOptions(value, options);
|
|
9532
9527
|
return option;
|
|
9533
9528
|
}
|
|
9534
9529
|
case 'multiselect':
|
|
9535
9530
|
{
|
|
9536
|
-
const options =
|
|
9531
|
+
const options = config?.options || [];
|
|
9537
9532
|
const _val = typeof value === 'string' ? value.split(',').map(v => v.trim()) : value;
|
|
9538
9533
|
const option = findOptions(_val, options);
|
|
9539
9534
|
return option.join(', ');
|
|
@@ -9548,7 +9543,7 @@ const renderFieldData = function (type, value, user, config) {
|
|
|
9548
9543
|
formValues: formValues
|
|
9549
9544
|
});
|
|
9550
9545
|
case 'percentage':
|
|
9551
|
-
return value === '-' || value === null || value === undefined ? '-' :
|
|
9546
|
+
return value === '-' || value === null || value === undefined ? '-' : `${value} %`;
|
|
9552
9547
|
case 'geolocation':
|
|
9553
9548
|
{
|
|
9554
9549
|
const val = JSON.parse(value) || {};
|
|
@@ -9562,7 +9557,7 @@ const renderFieldData = function (type, value, user, config) {
|
|
|
9562
9557
|
case 'upload':
|
|
9563
9558
|
case 'videoUpload':
|
|
9564
9559
|
{
|
|
9565
|
-
const documentName = allValues
|
|
9560
|
+
const documentName = allValues?.map(item => item?.name).join(', ');
|
|
9566
9561
|
return documentName;
|
|
9567
9562
|
}
|
|
9568
9563
|
default:
|
|
@@ -9570,27 +9565,25 @@ const renderFieldData = function (type, value, user, config) {
|
|
|
9570
9565
|
}
|
|
9571
9566
|
};
|
|
9572
9567
|
|
|
9573
|
-
const renderValue =
|
|
9574
|
-
|
|
9575
|
-
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
|
|
9579
|
-
|
|
9580
|
-
|
|
9581
|
-
|
|
9582
|
-
|
|
9583
|
-
|
|
9584
|
-
|
|
9585
|
-
if (!(config !== null && config !== void 0 && config.inputs)) return null;
|
|
9568
|
+
const renderValue = ({
|
|
9569
|
+
value,
|
|
9570
|
+
hasChildren,
|
|
9571
|
+
config,
|
|
9572
|
+
user,
|
|
9573
|
+
getApiBaseUrl = () => {},
|
|
9574
|
+
getAppHeader = () => {},
|
|
9575
|
+
app,
|
|
9576
|
+
allData = {}
|
|
9577
|
+
}) => {
|
|
9578
|
+
if (config?.type === 'groupInputs') {
|
|
9579
|
+
if (!config?.inputs) return null;
|
|
9586
9580
|
const inputKeys = Object.keys(config.inputs).sort((a, b) => {
|
|
9587
|
-
|
|
9588
|
-
const
|
|
9589
|
-
const positionB = ((_config$inputs$b = config.inputs[b]) === null || _config$inputs$b === void 0 ? void 0 : _config$inputs$b.position) || 0;
|
|
9581
|
+
const positionA = config.inputs[a]?.position || 0;
|
|
9582
|
+
const positionB = config.inputs[b]?.position || 0;
|
|
9590
9583
|
return positionA - positionB;
|
|
9591
9584
|
});
|
|
9592
9585
|
const values = inputKeys.map(inputKey => {
|
|
9593
|
-
let inputValue = value
|
|
9586
|
+
let inputValue = value?.[inputKey];
|
|
9594
9587
|
if (inputValue === null || inputValue === undefined || inputValue === '') {
|
|
9595
9588
|
return '';
|
|
9596
9589
|
} else if (typeof inputValue === 'object' && inputValue !== null) {
|
|
@@ -9631,8 +9624,8 @@ const renderValue = _ref => {
|
|
|
9631
9624
|
} else {
|
|
9632
9625
|
displayValue = String(value);
|
|
9633
9626
|
}
|
|
9634
|
-
const fieldType =
|
|
9635
|
-
let cssClass =
|
|
9627
|
+
const fieldType = config?.type || 'text';
|
|
9628
|
+
let cssClass = `tree-value ${fieldType}-type`;
|
|
9636
9629
|
if (displayValue === '-') {
|
|
9637
9630
|
cssClass += ' empty';
|
|
9638
9631
|
}
|
|
@@ -9642,21 +9635,19 @@ const renderValue = _ref => {
|
|
|
9642
9635
|
children: displayValue
|
|
9643
9636
|
});
|
|
9644
9637
|
};
|
|
9645
|
-
const determineHasChildren =
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
|
|
9649
|
-
|
|
9650
|
-
} = _ref2;
|
|
9651
|
-
if ((config === null || config === void 0 ? void 0 : config.type) === 'groupInputs') {
|
|
9638
|
+
const determineHasChildren = ({
|
|
9639
|
+
config,
|
|
9640
|
+
level
|
|
9641
|
+
}) => {
|
|
9642
|
+
if (config?.type === 'groupInputs') {
|
|
9652
9643
|
return false;
|
|
9653
9644
|
}
|
|
9654
|
-
if (
|
|
9645
|
+
if (config?.type === 'header' && config?.inputs && Object.keys(config.inputs).length > 0) {
|
|
9655
9646
|
return true;
|
|
9656
9647
|
}
|
|
9657
|
-
return
|
|
9648
|
+
return config?.inputs || config?.type === 'group' || config?.type === 'dataLinkGroup' || config?.type === 'section' || config?.type === 'ajaxSubGroup' ||
|
|
9658
9649
|
// Add this line
|
|
9659
|
-
|
|
9650
|
+
config?.type === 'dataLink' && config?.meta?.tableKeys || level === 0 && config && typeof config === 'object' && Object.keys(config).some(key => key !== 'id' && key !== 'label' && key !== 'position' && key !== 'subTitle' && typeof config[key] === 'object' && config[key] !== null);
|
|
9660
9651
|
};
|
|
9661
9652
|
|
|
9662
9653
|
const sortByPosition = (items, getConfig) => {
|
|
@@ -10322,20 +10313,21 @@ const handleDataLinkWithTableKeys = ({
|
|
|
10322
10313
|
}
|
|
10323
10314
|
};
|
|
10324
10315
|
|
|
10325
|
-
const handleGroupChildren =
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
|
|
10338
|
-
|
|
10316
|
+
const handleGroupChildren = _ref => {
|
|
10317
|
+
let {
|
|
10318
|
+
config,
|
|
10319
|
+
value,
|
|
10320
|
+
allData,
|
|
10321
|
+
level,
|
|
10322
|
+
t,
|
|
10323
|
+
rootForm,
|
|
10324
|
+
user,
|
|
10325
|
+
getApiBaseUrl = () => {},
|
|
10326
|
+
getAppHeader = () => {},
|
|
10327
|
+
app,
|
|
10328
|
+
TreeNodeComponent
|
|
10329
|
+
} = _ref;
|
|
10330
|
+
if (!(config !== null && config !== void 0 && config.inputs)) {
|
|
10339
10331
|
return null;
|
|
10340
10332
|
}
|
|
10341
10333
|
const inputKeys = Object.keys(config.inputs);
|
|
@@ -10348,7 +10340,7 @@ const handleGroupChildren = ({
|
|
|
10348
10340
|
if (value && typeof value === 'object' && value[inputKey]) {
|
|
10349
10341
|
inputValue = value[inputKey];
|
|
10350
10342
|
} else {
|
|
10351
|
-
inputValue = allData
|
|
10343
|
+
inputValue = allData === null || allData === void 0 ? void 0 : allData[inputKey];
|
|
10352
10344
|
}
|
|
10353
10345
|
return /*#__PURE__*/jsxRuntime.jsx(TreeNodeComponent, {
|
|
10354
10346
|
nodeKey: inputKey,
|
|
@@ -10498,12 +10490,11 @@ const AjaxSubGroup$2 = ({
|
|
|
10498
10490
|
};
|
|
10499
10491
|
|
|
10500
10492
|
const handleAjaxSubGroupChildren = props => {
|
|
10501
|
-
|
|
10493
|
+
var _props$config;
|
|
10494
|
+
if (((_props$config = props.config) === null || _props$config === void 0 ? void 0 : _props$config.type) !== 'ajaxSubGroup' || !Array.isArray(props.value)) {
|
|
10502
10495
|
return null;
|
|
10503
10496
|
}
|
|
10504
|
-
return [/*#__PURE__*/jsxRuntime.jsx(AjaxSubGroup$2, {
|
|
10505
|
-
...props
|
|
10506
|
-
}, "ajax-subgroup")];
|
|
10497
|
+
return [/*#__PURE__*/jsxRuntime.jsx(AjaxSubGroup$2, _objectSpread2({}, props), "ajax-subgroup")];
|
|
10507
10498
|
};
|
|
10508
10499
|
|
|
10509
10500
|
const TreeNode = _ref => {
|
package/dist/pages/index.js
CHANGED
|
@@ -13244,7 +13244,7 @@ const getActionWidgetsConfig = ({
|
|
|
13244
13244
|
t
|
|
13245
13245
|
}) => [{
|
|
13246
13246
|
icon: "MineSite",
|
|
13247
|
-
title: t("
|
|
13247
|
+
title: t("Create Mine Site"),
|
|
13248
13248
|
onClick: () => goTo(getRedirectLink("/app/production-sites?create=true"))
|
|
13249
13249
|
}, {
|
|
13250
13250
|
icon: "FileEdit",
|
package/package.json
CHANGED