datastake-daf 0.6.750 → 0.6.751

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.
Files changed (28) hide show
  1. package/dist/components/index.js +70 -70
  2. package/dist/pages/index.js +286 -211
  3. package/dist/utils/index.js +24 -0
  4. package/package.json +1 -1
  5. package/src/@daf/pages/Dashboards/SupplyChain/components/ChartsContainer/components/GenderDistribution/index.js +2 -2
  6. package/src/@daf/pages/Dashboards/SupplyChain/components/ChartsContainer/components/Identification/hook.js +1 -1
  7. package/src/@daf/pages/Dashboards/SupplyChain/components/SupplyChainMap/index.js +6 -1
  8. package/src/@daf/pages/Dashboards/UserDashboard/components/MineSites/helper.js +3 -3
  9. package/src/@daf/pages/Locations/MineSite/index.jsx +1 -1
  10. package/src/@daf/pages/Summary/Minesite/components/MineDetailsSection/index.js +51 -0
  11. package/src/@daf/pages/Summary/Minesite/components/MineSiteDetails/config.js +31 -37
  12. package/src/@daf/pages/Summary/Minesite/components/MineSiteDetails/index.js +4 -16
  13. package/src/@daf/pages/Summary/Minesite/components/StakeholderMapping/config.js +6 -6
  14. package/src/@daf/pages/Summary/Minesite/components/StakeholderMapping/helper.js +13 -16
  15. package/src/@daf/pages/Summary/Minesite/components/StakeholderMapping/index.js +3 -3
  16. package/src/@daf/pages/Summary/Minesite/index.jsx +15 -19
  17. package/src/@daf/pages/Summary/Operator/components/Governance/config.js +4 -4
  18. package/src/@daf/pages/Summary/Operator/components/Governance/helper.js +8 -11
  19. package/src/@daf/pages/Summary/Operator/components/Governance/index.js +9 -3
  20. package/src/@daf/pages/Summary/Operator/index.jsx +6 -4
  21. package/src/@daf/pages/Summary/components/InformationAvailability/components/Contributions/index.js +16 -5
  22. package/src/@daf/pages/Summary/components/InformationAvailability/components/InformationCompleteness/index.js +2 -3
  23. package/src/@daf/pages/Summary/components/InformationAvailability/index.js +7 -4
  24. package/src/@daf/pages/Summary/hook.js +3 -3
  25. package/src/constants/locales/en/translation.js +8 -0
  26. package/src/constants/locales/fr/translation.js +8 -0
  27. package/src/constants/locales/sp/translation.js +8 -0
  28. package/dist/style/datastake/mapbox-gl.css +0 -330
@@ -8143,7 +8143,7 @@ const {
8143
8143
  Paragraph: Paragraph$1
8144
8144
  } = antd.Typography;
8145
8145
  const checkHasActiveFilterValues = filtersConfig => {
8146
- if (!filtersConfig?.filtersConfig || !filtersConfig?.selectedFilters) return false;
8146
+ if (!(filtersConfig !== null && filtersConfig !== void 0 && filtersConfig.filtersConfig) || !(filtersConfig !== null && filtersConfig !== void 0 && filtersConfig.selectedFilters)) return false;
8147
8147
  const filterConfigKeys = Object.keys(filtersConfig.filtersConfig);
8148
8148
  const selectedFilters = filtersConfig.selectedFilters;
8149
8149
  return filterConfigKeys.some(key => {
@@ -8151,27 +8151,28 @@ const checkHasActiveFilterValues = filtersConfig => {
8151
8151
  return value !== undefined && value !== null && value !== "";
8152
8152
  });
8153
8153
  };
8154
- const useHeader = ({
8155
- title = "",
8156
- tooltip = "",
8157
- supportText = "",
8158
- tags = [],
8159
- actionButtons: _actionButtons = [],
8160
- titleTooltip,
8161
- className,
8162
- addedHeader = null,
8163
- addedHeaderFirst,
8164
- extraButtons: _extraButtons = [],
8165
- onDownload,
8166
- downloadDisabled,
8167
- goBackTo,
8168
- loading,
8169
- renderExtraComponents,
8170
- app = "",
8171
- isViewMode = false,
8172
- filtersConfig = {}
8173
- }) => {
8174
- const hasActiveFilterValues = React.useMemo(() => checkHasActiveFilterValues(filtersConfig), [filtersConfig?.filtersConfig, filtersConfig?.selectedFilters]);
8154
+ const useHeader = _ref => {
8155
+ let {
8156
+ title = "",
8157
+ tooltip = "",
8158
+ supportText = "",
8159
+ tags = [],
8160
+ actionButtons: _actionButtons = [],
8161
+ titleTooltip,
8162
+ className,
8163
+ addedHeader = null,
8164
+ addedHeaderFirst,
8165
+ extraButtons: _extraButtons = [],
8166
+ onDownload,
8167
+ downloadDisabled,
8168
+ goBackTo,
8169
+ loading,
8170
+ renderExtraComponents,
8171
+ app = "",
8172
+ isViewMode = false,
8173
+ filtersConfig = {}
8174
+ } = _ref;
8175
+ const hasActiveFilterValues = React.useMemo(() => checkHasActiveFilterValues(filtersConfig), [filtersConfig === null || filtersConfig === void 0 ? void 0 : filtersConfig.filtersConfig, filtersConfig === null || filtersConfig === void 0 ? void 0 : filtersConfig.selectedFilters]);
8175
8176
  const [showFilters, setShowFilters] = React.useState(() => checkHasActiveFilterValues(filtersConfig));
8176
8177
  const hasFilters = filtersConfig && Object.keys(filtersConfig).length > 0;
8177
8178
  React.useEffect(() => {
@@ -8213,9 +8214,9 @@ const useHeader = ({
8213
8214
  const buttonCont = React.useRef();
8214
8215
  const [mainContWidth, setMainContWidth] = React.useState(600);
8215
8216
  const [buttonContWidth, setButtonContWidth] = React.useState(0);
8216
- const hasSupportText = !!supportText?.length;
8217
- const hasTags = !!tags?.length;
8218
- const hasButtons = React.useMemo(() => !!(actionButtons?.length || extraButtons?.length), [actionButtons, extraButtons]);
8217
+ const hasSupportText = !!(supportText !== null && supportText !== void 0 && supportText.length);
8218
+ const hasTags = !!(tags !== null && tags !== void 0 && tags.length);
8219
+ const hasButtons = React.useMemo(() => !!(actionButtons !== null && actionButtons !== void 0 && actionButtons.length || extraButtons !== null && extraButtons !== void 0 && extraButtons.length), [actionButtons, extraButtons]);
8219
8220
  React.useEffect(() => {
8220
8221
  const mainContObserver = new ResizeObserver(entries => {
8221
8222
  const _mainEntry = entries[0];
@@ -8375,20 +8376,22 @@ const useHeader = ({
8375
8376
  const {
8376
8377
  useToken: useToken$m
8377
8378
  } = antd.theme;
8378
- function BreadCrumbs({
8379
- breadcrumbs = [],
8380
- mainContWidth = 0
8381
- }) {
8379
+ function BreadCrumbs(_ref) {
8380
+ let {
8381
+ breadcrumbs = [],
8382
+ mainContWidth = 0
8383
+ } = _ref;
8382
8384
  const [splitIndex, setSplitIndex] = React.useState(0);
8383
8385
  const {
8384
8386
  token
8385
8387
  } = useToken$m();
8386
- const _renderBreadcrumb = (b, i, isLast, noOnClickLast = false) => {
8388
+ const _renderBreadcrumb = function (b, i, isLast) {
8389
+ let noOnClickLast = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
8387
8390
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
8388
8391
  className: "flex breadcrumb-item",
8389
- onClick: noOnClickLast && isLast ? undefined : b?.onClick,
8392
+ onClick: noOnClickLast && isLast ? undefined : b === null || b === void 0 ? void 0 : b.onClick,
8390
8393
  children: [/*#__PURE__*/jsxRuntime.jsx("span", {
8391
- children: b?.label
8394
+ children: b === null || b === void 0 ? void 0 : b.label
8392
8395
  }), !isLast && /*#__PURE__*/jsxRuntime.jsx("div", {
8393
8396
  className: "flex flex-column justify-content-center",
8394
8397
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
@@ -8398,7 +8401,7 @@ function BreadCrumbs({
8398
8401
  color: token.baseGray50
8399
8402
  })
8400
8403
  })]
8401
- }, `breadcrumb-item-${i}`);
8404
+ }, "breadcrumb-item-".concat(i));
8402
8405
  };
8403
8406
  React.useEffect(() => {
8404
8407
  const _placeholderCont = document.getElementById("header-breadcrumbs");
@@ -8441,7 +8444,7 @@ function BreadCrumbs({
8441
8444
  placement: "bottomRight",
8442
8445
  menu: {
8443
8446
  items: groupedBreadCrumbs[2].map((it, i) => ({
8444
- key: `items-${i}`,
8447
+ key: "items-".concat(i),
8445
8448
  label: it.label,
8446
8449
  onClick: it.onClick
8447
8450
  }))
@@ -9664,30 +9667,28 @@ const handleSectionChildren = _ref => {
9664
9667
  });
9665
9668
  };
9666
9669
 
9667
- const handleArrayChildren = _ref => {
9668
- let {
9669
- value,
9670
- config,
9671
- label,
9672
- level,
9673
- t,
9674
- rootForm,
9675
- allData,
9676
- user,
9677
- getApiBaseUrl = () => {},
9678
- getAppHeader = () => {},
9679
- app,
9680
- TreeNodeComponent
9681
- } = _ref;
9670
+ const handleArrayChildren = ({
9671
+ value,
9672
+ config,
9673
+ label,
9674
+ level,
9675
+ t,
9676
+ rootForm,
9677
+ allData,
9678
+ user,
9679
+ getApiBaseUrl = () => {},
9680
+ getAppHeader = () => {},
9681
+ app,
9682
+ TreeNodeComponent
9683
+ }) => {
9682
9684
  if (!Array.isArray(value)) {
9683
9685
  return null;
9684
9686
  }
9685
9687
  return value.map((item, itemIndex) => /*#__PURE__*/jsxRuntime.jsx("div", {
9686
9688
  className: "array-item",
9687
9689
  children: Object.keys(config.inputs).sort((a, b) => {
9688
- var _config$inputs$a, _config$inputs$b;
9689
- const positionA = ((_config$inputs$a = config.inputs[a]) === null || _config$inputs$a === void 0 ? void 0 : _config$inputs$a.position) || 0;
9690
- const positionB = ((_config$inputs$b = config.inputs[b]) === null || _config$inputs$b === void 0 ? void 0 : _config$inputs$b.position) || 0;
9690
+ const positionA = config.inputs[a]?.position || 0;
9691
+ const positionB = config.inputs[b]?.position || 0;
9691
9692
  return positionA - positionB;
9692
9693
  }).map(subInputKey => {
9693
9694
  const subInputConfig = config.inputs[subInputKey];
@@ -9705,9 +9706,9 @@ const handleArrayChildren = _ref => {
9705
9706
  getApiBaseUrl: getApiBaseUrl,
9706
9707
  getAppHeader: getAppHeader,
9707
9708
  app: app
9708
- }, "".concat(itemIndex, "-").concat(subInputKey));
9709
+ }, `${itemIndex}-${subInputKey}`);
9709
9710
  })
9710
- }, "".concat(itemIndex)));
9711
+ }, `${itemIndex}`));
9711
9712
  };
9712
9713
 
9713
9714
  const noDafApps = ['tif', 'cukura']; //PACKAGE_CHANGE_LATER (remove sbg)
@@ -10251,21 +10252,20 @@ const handleDataLinkWithTableKeys = _ref => {
10251
10252
  }
10252
10253
  };
10253
10254
 
10254
- const handleGroupChildren = _ref => {
10255
- let {
10256
- config,
10257
- value,
10258
- allData,
10259
- level,
10260
- t,
10261
- rootForm,
10262
- user,
10263
- getApiBaseUrl = () => {},
10264
- getAppHeader = () => {},
10265
- app,
10266
- TreeNodeComponent
10267
- } = _ref;
10268
- if (!(config !== null && config !== void 0 && config.inputs)) {
10255
+ const handleGroupChildren = ({
10256
+ config,
10257
+ value,
10258
+ allData,
10259
+ level,
10260
+ t,
10261
+ rootForm,
10262
+ user,
10263
+ getApiBaseUrl = () => {},
10264
+ getAppHeader = () => {},
10265
+ app,
10266
+ TreeNodeComponent
10267
+ }) => {
10268
+ if (!config?.inputs) {
10269
10269
  return null;
10270
10270
  }
10271
10271
  const inputKeys = Object.keys(config.inputs);
@@ -10278,7 +10278,7 @@ const handleGroupChildren = _ref => {
10278
10278
  if (value && typeof value === 'object' && value[inputKey]) {
10279
10279
  inputValue = value[inputKey];
10280
10280
  } else {
10281
- inputValue = allData === null || allData === void 0 ? void 0 : allData[inputKey];
10281
+ inputValue = allData?.[inputKey];
10282
10282
  }
10283
10283
  return /*#__PURE__*/jsxRuntime.jsx(TreeNodeComponent, {
10284
10284
  nodeKey: inputKey,