datastake-daf 0.6.831 → 0.6.833

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 (44) hide show
  1. package/dist/components/index.js +726 -582
  2. package/dist/hooks/index.js +8 -0
  3. package/dist/pages/index.js +1850 -176
  4. package/dist/services/index.js +8 -0
  5. package/dist/utils/index.js +4 -3
  6. package/package.json +1 -1
  7. package/src/@daf/core/components/Screens/Admin/AdminScreens/Documents.jsx +4 -0
  8. package/src/@daf/core/components/Screens/Admin/AdminScreens/Events.jsx +4 -0
  9. package/src/@daf/core/components/Screens/Admin/AdminScreens/Location.jsx +4 -0
  10. package/src/@daf/core/components/Screens/Admin/AdminScreens/Subjects.jsx +4 -0
  11. package/src/@daf/core/components/Screens/Admin/AdminTables/DocumentsTable/helper.js +19 -29
  12. package/src/@daf/core/components/Screens/Admin/AdminTables/DocumentsTable/index.jsx +16 -3
  13. package/src/@daf/core/components/Screens/Admin/AdminTables/EventsTable/helper.js +15 -20
  14. package/src/@daf/core/components/Screens/Admin/AdminTables/EventsTable/index.jsx +13 -4
  15. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/helper.js +114 -29
  16. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/index.jsx +16 -3
  17. package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/helper.js +29 -29
  18. package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/index.jsx +16 -3
  19. package/src/@daf/core/components/Screens/Admin/AdminTables/hook.js +1 -0
  20. package/src/@daf/core/components/Screens/ConflictManagement/components/KeyIndicators/config.js +106 -0
  21. package/src/@daf/core/components/Screens/ConflictManagement/components/KeyIndicators/index.js +47 -0
  22. package/src/@daf/core/components/Screens/ConflictManagement/components/MineSite/helper.js +3 -0
  23. package/src/@daf/core/components/Screens/ConflictManagement/components/MineSite/index.js +218 -0
  24. package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/IncidentsTime/hook.js +32 -0
  25. package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/IncidentsTime/index.js +73 -0
  26. package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/ProblemSolver/hook.js +86 -0
  27. package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/ProblemSolver/index.js +102 -0
  28. package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/TerritorialDistribution/config.js +34 -0
  29. package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/components/TerritorialDistribution/index.js +107 -0
  30. package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/config.js +5 -0
  31. package/src/@daf/core/components/Screens/ConflictManagement/components/RisksWidget/index.js +77 -0
  32. package/src/@daf/core/components/Screens/ConflictManagement/index.js +136 -0
  33. package/src/@daf/core/components/UI/SingleTruncatedLine/index.jsx +25 -0
  34. package/src/@daf/pages/Edit/index.jsx +7 -1
  35. package/src/@daf/pages/Events/Activities/columns.js +1 -1
  36. package/src/@daf/pages/Events/Testimonials/columns.js +1 -1
  37. package/src/@daf/pages/Events/columns.js +2 -3
  38. package/src/@daf/pages/Locations/columns.js +1 -1
  39. package/src/@daf/pages/Summary/Minesite/components/MineSiteDetails/config.js +4 -35
  40. package/src/@daf/services/DashboardService.js +9 -0
  41. package/src/constants/locales/en/translation.js +1 -0
  42. package/src/helpers/dataFetch.js +3 -3
  43. package/src/index.js +1 -0
  44. package/src/pages.js +4 -1
@@ -30797,7 +30797,6 @@ function Repeatable({
30797
30797
  });
30798
30798
  }
30799
30799
 
30800
- /* eslint-disable no-eval */
30801
30800
  const isRiskComment = inputData => {
30802
30801
  if (inputData) {
30803
30802
  if (inputData.name === 'assessment') {
@@ -30810,7 +30809,10 @@ const isRiskComment = inputData => {
30810
30809
  };
30811
30810
 
30812
30811
  // options, k, setValues, values, excludedKeys, i, formTitles, getData, MainForm, plainForms, setAddress, onValuesChange, data, allData, changeLinking, changeInputMeta, t, highlightMandatory
30813
- function renderNestedInputs$1(options, k, ...args) {
30812
+ function renderNestedInputs$1(options, k) {
30813
+ for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
30814
+ args[_key - 2] = arguments[_key];
30815
+ }
30814
30816
  if (options[k].repeatable) {
30815
30817
  return renderRepeatable$1(options, k, ...args);
30816
30818
  } else {
@@ -30838,10 +30840,11 @@ function renderRepeatable$1(options, k, setValues, values, excludedKeys, i, form
30838
30840
  children: [getFormTitles$1(formTitles, formId, i), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(form.type) ? getInputHeadLines$1(form.type, i, form, values) : /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
30839
30841
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
30840
30842
  name: formId,
30841
- children: (fields, {
30842
- add,
30843
- remove
30844
- }) => {
30843
+ children: (fields, _ref) => {
30844
+ let {
30845
+ add,
30846
+ remove
30847
+ } = _ref;
30845
30848
  const formData = form.repeatable ? values[formId] || [] : values[formId] ? [values[formId]] : [];
30846
30849
  if (fields.length === 0) {
30847
30850
  const formInputs = form.inputs;
@@ -30891,14 +30894,10 @@ function renderRepeatable$1(options, k, setValues, values, excludedKeys, i, form
30891
30894
  const _val = {
30892
30895
  [formId]: formData.map((d, j) => i === j ? val : d)
30893
30896
  };
30894
- onValuesChange(_val, {
30895
- ...values,
30896
- ..._val
30897
- });
30898
- setValues({
30899
- ...values,
30897
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, values), _val));
30898
+ setValues(_objectSpread2(_objectSpread2({}, values), {}, {
30900
30899
  [formId]: formData.map((d, j) => i === j ? val : d)
30901
- });
30900
+ }));
30902
30901
  };
30903
30902
  return /*#__PURE__*/jsxRuntime.jsx(Repeatable, {
30904
30903
  form: form,
@@ -30954,154 +30953,156 @@ const getGroupContent = (form, values, i, formId, excludedKeys, getData, setValu
30954
30953
  highlightMandatory
30955
30954
  });
30956
30955
  };
30957
- const GroupContent = ({
30958
- form,
30959
- values = {},
30960
- i,
30961
- formId,
30962
- excludedKeys,
30963
- getData,
30964
- setValues,
30965
- MainForm,
30966
- options,
30967
- plainForms,
30968
- setAddress,
30969
- onValuesChange,
30970
- allData,
30971
- changeInputMeta,
30972
- highlightMandatory
30973
- }) => {
30956
+ const GroupContent = _ref2 => {
30957
+ var _form$meta;
30958
+ let {
30959
+ form,
30960
+ values = {},
30961
+ i,
30962
+ formId,
30963
+ excludedKeys,
30964
+ getData,
30965
+ setValues,
30966
+ MainForm,
30967
+ options,
30968
+ plainForms,
30969
+ setAddress,
30970
+ onValuesChange,
30971
+ allData,
30972
+ changeInputMeta,
30973
+ highlightMandatory
30974
+ } = _ref2;
30974
30975
  const {
30975
30976
  user,
30976
30977
  t
30977
30978
  } = useEditContext();
30978
30979
  const label = getInputLabel$1(form, values);
30979
- const notPartOfTheForm = form?.type === 'ajaxSubGroup' ? true : !!form?.meta?.isSubGroup;
30980
+ const notPartOfTheForm = (form === null || form === void 0 ? void 0 : form.type) === 'ajaxSubGroup' ? true : !!(form !== null && form !== void 0 && (_form$meta = form.meta) !== null && _form$meta !== void 0 && _form$meta.isSubGroup);
30980
30981
  const hasLabel = label && (typeof label === 'string' && (label || '').trim() !== '' || typeof label === 'object') ? true : false;
30981
30982
  const formValues = values[form.dataId];
30982
- const renderInputs = () => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
30983
- children: [form?.meta?.groupInfo ? /*#__PURE__*/jsxRuntime.jsx(GroupInfos, {
30984
- config: form.meta.groupInfo,
30985
- user: user,
30986
- t: t
30987
- }) : null, Object.keys(form.inputs || {}).filter(i => !excludedKeys.includes(i)).map((inp, ii) => {
30988
- const isAjaxSubGroup = form?.type === "ajaxSubGroup";
30989
- const input = form.inputs[inp];
30990
- const inputId = input.dataId || inp;
30991
- const inputValues = notPartOfTheForm ? Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {} : values;
30992
- const value = inputValues[inputId];
30993
- const commentValue = inputValues[`${inputId}Comment`];
30994
- const inputData = getData(formId, input, value, commentValue, `${formId}.${inputId}`, `${formId}.${inputId}`);
30995
- const subtitles = form.subtitles || null;
30996
- const inputMeta = notPartOfTheForm ? isAjaxSubGroup ? (values[formId] || {})?.meta?.inputs?.[inputId] || {} : ((values?.meta?.inputs || {})[formId] || {})[inputId] || {} : (values?.meta?.inputs || {})[inputId] || {};
30997
- inputData.repeatIndex = undefined;
30998
- inputData.inputName = inputId;
30999
- inputData.repeatValues = inputValues;
31000
- if (inputData.groupInputs && Array.isArray(inputData.groupInputs)) {
31001
- inputData.groupInputs = inputData.groupInputs.map(gpI => {
31002
- gpI.data.inputName = gpI.data.name;
31003
- gpI.data.repeatIndex = undefined;
31004
- gpI.data.name = formId;
31005
- return gpI;
31006
- });
31007
- }
31008
- const isRisk = isRiskComment(inputData);
31009
- const isHighlighted = highlightMandatory && input?.meta?.mandatory && inputIsEmpty(input, inputValues, inputMeta);
31010
- const btnOnClick = () => {
31011
- if (typeof inputData.commentValue === 'string') {
31012
- onValuesChange({}, {
31013
- ...values,
31014
- [`${inputData.inputName}`]: null
30983
+ const renderInputs = () => {
30984
+ var _form$meta2;
30985
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
30986
+ children: [form !== null && form !== void 0 && (_form$meta2 = form.meta) !== null && _form$meta2 !== void 0 && _form$meta2.groupInfo ? /*#__PURE__*/jsxRuntime.jsx(GroupInfos, {
30987
+ config: form.meta.groupInfo,
30988
+ user: user,
30989
+ t: t
30990
+ }) : null, Object.keys(form.inputs || {}).filter(i => !excludedKeys.includes(i)).map((inp, ii) => {
30991
+ var _ref3, _values$meta, _values$meta2, _input$meta, _inputData$rules, _input$meta2;
30992
+ const isAjaxSubGroup = (form === null || form === void 0 ? void 0 : form.type) === "ajaxSubGroup";
30993
+ const input = form.inputs[inp];
30994
+ const inputId = input.dataId || inp;
30995
+ const inputValues = notPartOfTheForm ? Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {} : values;
30996
+ const value = inputValues[inputId];
30997
+ const commentValue = inputValues["".concat(inputId, "Comment")];
30998
+ const inputData = getData(formId, input, value, commentValue, "".concat(formId, ".").concat(inputId), "".concat(formId, ".").concat(inputId));
30999
+ const subtitles = form.subtitles || null;
31000
+ const inputMeta = notPartOfTheForm ? isAjaxSubGroup ? ((_ref3 = values[formId] || {}) === null || _ref3 === void 0 || (_ref3 = _ref3.meta) === null || _ref3 === void 0 || (_ref3 = _ref3.inputs) === null || _ref3 === void 0 ? void 0 : _ref3[inputId]) || {} : (((values === null || values === void 0 || (_values$meta = values.meta) === null || _values$meta === void 0 ? void 0 : _values$meta.inputs) || {})[formId] || {})[inputId] || {} : ((values === null || values === void 0 || (_values$meta2 = values.meta) === null || _values$meta2 === void 0 ? void 0 : _values$meta2.inputs) || {})[inputId] || {};
31001
+ inputData.repeatIndex = undefined;
31002
+ inputData.inputName = inputId;
31003
+ inputData.repeatValues = inputValues;
31004
+ if (inputData.groupInputs && Array.isArray(inputData.groupInputs)) {
31005
+ inputData.groupInputs = inputData.groupInputs.map(gpI => {
31006
+ gpI.data.inputName = gpI.data.name;
31007
+ gpI.data.repeatIndex = undefined;
31008
+ gpI.data.name = formId;
31009
+ return gpI;
31015
31010
  });
31016
31011
  }
31017
- const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
31018
- inputValues[`${inputData.inputName}Comment`] = typeof inputData.commentValue !== 'string' ? '' : null;
31019
- if (Array.isArray(values[formId])) {
31020
- values[formId] = inputValues;
31021
- } else {
31022
- values[formId] = inputValues;
31023
- }
31024
- setValues({
31025
- ...values
31026
- });
31027
- };
31028
- const btnOnClick2 = () => {
31029
- if (typeof inputData.commentValue !== 'string') {
31012
+ const isRisk = isRiskComment(inputData);
31013
+ const isHighlighted = highlightMandatory && (input === null || input === void 0 || (_input$meta = input.meta) === null || _input$meta === void 0 ? void 0 : _input$meta.mandatory) && inputIsEmpty(input, inputValues, inputMeta);
31014
+ const btnOnClick = () => {
31015
+ if (typeof inputData.commentValue === 'string') {
31016
+ onValuesChange({}, _objectSpread2(_objectSpread2({}, values), {}, {
31017
+ ["".concat(inputData.inputName)]: null
31018
+ }));
31019
+ }
31030
31020
  const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
31031
- inputValues[`${inputData.inputName}Comment`] = typeof inputData.commentValue !== 'string' ? '' : null;
31021
+ inputValues["".concat(inputData.inputName, "Comment")] = typeof inputData.commentValue !== 'string' ? '' : null;
31032
31022
  if (Array.isArray(values[formId])) {
31033
31023
  values[formId] = inputValues;
31034
31024
  } else {
31035
31025
  values[formId] = inputValues;
31036
31026
  }
31037
- setValues({
31038
- ...values
31039
- });
31040
- }
31041
- };
31042
- const rules = inputData?.rules?.length ? inputData.rules.filter(rule => !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max')) : (input?.meta?.rules || []).filter(rule => {
31043
- if (rule.metaIf && typeof rule.metaIf === 'string') {
31044
- const [name, cond, value] = rule.metaIf.split(' ');
31045
- const val = name.includes('./') ? values?.meta?.inputs?.[formId]?.[name.split('./')[1]] : values?.meta?.inputs?.[name.split('./')[1]];
31046
- if (cond === 'is') {
31047
- return !!val?.[value];
31027
+ setValues(_objectSpread2({}, values));
31028
+ };
31029
+ const btnOnClick2 = () => {
31030
+ if (typeof inputData.commentValue !== 'string') {
31031
+ const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
31032
+ inputValues["".concat(inputData.inputName, "Comment")] = typeof inputData.commentValue !== 'string' ? '' : null;
31033
+ if (Array.isArray(values[formId])) {
31034
+ values[formId] = inputValues;
31035
+ } else {
31036
+ values[formId] = inputValues;
31037
+ }
31038
+ setValues(_objectSpread2({}, values));
31048
31039
  }
31049
- }
31050
- return !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max');
31051
- });
31052
- const requiredRule = rules.find(r => r.required);
31053
- if (requiredRule && input.type === 'text') {
31054
- rules.push({
31055
- whitespace: true,
31056
- message: requiredRule.message || ''
31040
+ };
31041
+ const rules = inputData !== null && inputData !== void 0 && (_inputData$rules = inputData.rules) !== null && _inputData$rules !== void 0 && _inputData$rules.length ? inputData.rules.filter(rule => !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max')) : ((input === null || input === void 0 || (_input$meta2 = input.meta) === null || _input$meta2 === void 0 ? void 0 : _input$meta2.rules) || []).filter(rule => {
31042
+ if (rule.metaIf && typeof rule.metaIf === 'string') {
31043
+ var _values$meta3, _values$meta4;
31044
+ const [name, cond, value] = rule.metaIf.split(' ');
31045
+ const val = name.includes('./') ? values === null || values === void 0 || (_values$meta3 = values.meta) === null || _values$meta3 === void 0 || (_values$meta3 = _values$meta3.inputs) === null || _values$meta3 === void 0 || (_values$meta3 = _values$meta3[formId]) === null || _values$meta3 === void 0 ? void 0 : _values$meta3[name.split('./')[1]] : values === null || values === void 0 || (_values$meta4 = values.meta) === null || _values$meta4 === void 0 || (_values$meta4 = _values$meta4.inputs) === null || _values$meta4 === void 0 ? void 0 : _values$meta4[name.split('./')[1]];
31046
+ if (cond === 'is') {
31047
+ return !!(val !== null && val !== void 0 && val[value]);
31048
+ }
31049
+ }
31050
+ return !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max');
31057
31051
  });
31058
- }
31059
- return showHideInput$1(input, values, undefined, inputValues, setValues) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
31060
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
31061
- style: {
31062
- position: 'relative'
31063
- },
31064
- children: [getSubtitles$1(subtitles, input.position, values, undefined, inputValues), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(input.type) ? getInputHeadLines$1(input.type, i, input, values) : isRisk ? /*#__PURE__*/jsxRuntime.jsx(RiskGroup, {
31065
- input: input,
31066
- inputTypeComponent: inputTypeComponent$1,
31067
- inputData: inputData,
31068
- MainForm: MainForm,
31069
- options: options,
31070
- setValues: setValues,
31071
- formId: formId,
31072
- inputId: inputId,
31073
- inputOnBlur: inputOnBlur,
31074
- values: values,
31075
- getInputLabel: getInputLabel$1,
31076
- plainForms: plainForms,
31077
- setAddress: setAddress,
31078
- btnOnClick: btnOnClick,
31079
- btnOnClick2: btnOnClick2,
31080
- locationName: (allData || {}).locationName,
31081
- subGroupTitle: (allData || {}).subGroupTitle
31082
- }) : /*#__PURE__*/jsxRuntime.jsx(GroupContentFormItem, {
31083
- values,
31084
- formId,
31085
- setValues,
31086
- MainForm,
31087
- options,
31088
- plainForms,
31089
- setAddress,
31090
- inputData,
31091
- inputId,
31092
- input,
31093
- rules,
31094
- inputMeta,
31095
- changeInputMeta,
31096
- notPartOfTheForm,
31097
- isAjaxSubGroup,
31098
- isHighlighted
31099
- })]
31100
- }, ii)
31101
- }, `${i}${ii}`) : null;
31102
- })]
31103
- });
31104
- const isNa = formValues?.valuation === 'na';
31052
+ const requiredRule = rules.find(r => r.required);
31053
+ if (requiredRule && input.type === 'text') {
31054
+ rules.push({
31055
+ whitespace: true,
31056
+ message: requiredRule.message || ''
31057
+ });
31058
+ }
31059
+ return showHideInput$1(input, values, undefined, inputValues, setValues) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
31060
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
31061
+ style: {
31062
+ position: 'relative'
31063
+ },
31064
+ children: [getSubtitles$1(subtitles, input.position, values, undefined, inputValues), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(input.type) ? getInputHeadLines$1(input.type, i, input, values) : isRisk ? /*#__PURE__*/jsxRuntime.jsx(RiskGroup, {
31065
+ input: input,
31066
+ inputTypeComponent: inputTypeComponent$1,
31067
+ inputData: inputData,
31068
+ MainForm: MainForm,
31069
+ options: options,
31070
+ setValues: setValues,
31071
+ formId: formId,
31072
+ inputId: inputId,
31073
+ inputOnBlur: inputOnBlur,
31074
+ values: values,
31075
+ getInputLabel: getInputLabel$1,
31076
+ plainForms: plainForms,
31077
+ setAddress: setAddress,
31078
+ btnOnClick: btnOnClick,
31079
+ btnOnClick2: btnOnClick2,
31080
+ locationName: (allData || {}).locationName,
31081
+ subGroupTitle: (allData || {}).subGroupTitle
31082
+ }) : /*#__PURE__*/jsxRuntime.jsx(GroupContentFormItem, {
31083
+ values,
31084
+ formId,
31085
+ setValues,
31086
+ MainForm,
31087
+ options,
31088
+ plainForms,
31089
+ setAddress,
31090
+ inputData,
31091
+ inputId,
31092
+ input,
31093
+ rules,
31094
+ inputMeta,
31095
+ changeInputMeta,
31096
+ notPartOfTheForm,
31097
+ isAjaxSubGroup,
31098
+ isHighlighted
31099
+ })]
31100
+ }, ii)
31101
+ }, "".concat(i).concat(ii)) : null;
31102
+ })]
31103
+ });
31104
+ };
31105
+ const isNa = (formValues === null || formValues === void 0 ? void 0 : formValues.valuation) === 'na';
31105
31106
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
31106
31107
  children: [hasLabel ? options.isRisk && options.dontShowTitle ? /*#__PURE__*/jsxRuntime.jsx("div", {
31107
31108
  className: "risk-header",
@@ -31109,44 +31110,46 @@ const GroupContent = ({
31109
31110
  children: label
31110
31111
  })
31111
31112
  }) : /*#__PURE__*/jsxRuntime.jsx("h3", {
31112
- className: `${form.titleClass ? form.titleClass : 'title-semibold-4'} ${i ? 'mt-3 mb-1' : ''}`,
31113
+ className: "".concat(form.titleClass ? form.titleClass : 'title-semibold-4', " ").concat(i ? 'mt-3 mb-1' : ''),
31113
31114
  children: label
31114
31115
  }) : null, /*#__PURE__*/jsxRuntime.jsxs("div", {
31115
- className: `repeatable ${hasLabel ? "mb-4" : ""}`,
31116
+ className: "repeatable ".concat(hasLabel ? "mb-4" : ""),
31116
31117
  children: [form.titleLabel ? /*#__PURE__*/jsxRuntime.jsx("label", {
31117
31118
  children: getInputProp(form.titleLabel, values)
31118
- }) : null, formValues?.noPlanningRequired ? /*#__PURE__*/jsxRuntime.jsx(GroupInfoHOC, {
31119
+ }) : null, formValues !== null && formValues !== void 0 && formValues.noPlanningRequired ? /*#__PURE__*/jsxRuntime.jsx(GroupInfoHOC, {
31119
31120
  t: t,
31120
31121
  isNa: isNa,
31121
31122
  isSuccess: !isNa
31122
31123
  // TODO: translate
31123
31124
  ,
31124
31125
  config: {
31125
- title: t(`No ${formValues?.stage || 'planning'} required`)
31126
+ title: t("No ".concat((formValues === null || formValues === void 0 ? void 0 : formValues.stage) || 'planning', " required"))
31126
31127
  },
31127
31128
  children: renderInputs()
31128
31129
  }) : renderInputs()]
31129
31130
  })]
31130
31131
  });
31131
31132
  };
31132
- const GroupContentFormItem = ({
31133
- values,
31134
- formId,
31135
- setValues,
31136
- MainForm,
31137
- options,
31138
- plainForms,
31139
- setAddress,
31140
- inputData,
31141
- inputId,
31142
- input,
31143
- rules,
31144
- inputMeta,
31145
- changeInputMeta,
31146
- notPartOfTheForm = true,
31147
- isAjaxSubGroup,
31148
- isHighlighted
31149
- }) => {
31133
+ const GroupContentFormItem = _ref4 => {
31134
+ var _rules$find, _inputMeta$reviews, _input$meta3, _values$formId, _input$meta4, _input$meta7, _input$meta8, _input$meta9, _values$meta10, _values$meta11, _values$parent, _input$meta10, _input$meta11, _inputData$value, _input$meta12, _input$meta13, _inputMeta$comment, _lastReview$comment, _lastReview$reviewer, _lastReview$reviewer2;
31135
+ let {
31136
+ values,
31137
+ formId,
31138
+ setValues,
31139
+ MainForm,
31140
+ options,
31141
+ plainForms,
31142
+ setAddress,
31143
+ inputData,
31144
+ inputId,
31145
+ input,
31146
+ rules,
31147
+ inputMeta,
31148
+ changeInputMeta,
31149
+ notPartOfTheForm = true,
31150
+ isAjaxSubGroup,
31151
+ isHighlighted
31152
+ } = _ref4;
31150
31153
  const {
31151
31154
  t,
31152
31155
  user,
@@ -31160,10 +31163,10 @@ const GroupContentFormItem = ({
31160
31163
  staticWidth,
31161
31164
  fullWidth
31162
31165
  } = useEditContext();
31163
- const [isShown, setIsShown] = React.useState(!!inputMeta?.comment);
31164
- let maxRule = rules.find(rule => rule.max)?.max;
31166
+ const [isShown, setIsShown] = React.useState(!!(inputMeta !== null && inputMeta !== void 0 && inputMeta.comment));
31167
+ let maxRule = (_rules$find = rules.find(rule => rule.max)) === null || _rules$find === void 0 ? void 0 : _rules$find.max;
31165
31168
  const requiredRule = rules.find(r => r.required);
31166
- const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
31169
+ const lastReview = ((inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.reviews) || [])[((inputMeta === null || inputMeta === void 0 || (_inputMeta$reviews = inputMeta.reviews) === null || _inputMeta$reviews === void 0 ? void 0 : _inputMeta$reviews.length) || 0) - 1];
31167
31170
  if (!maxRule && input.type === 'textarea') {
31168
31171
  maxRule = MAX_TEXT_AREA_LENGTH;
31169
31172
  }
@@ -31182,38 +31185,35 @@ const GroupContentFormItem = ({
31182
31185
  }
31183
31186
  setIsShown(true);
31184
31187
  if (notPartOfTheForm || isAjaxSubGroup) {
31185
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31188
+ var _values$meta5;
31189
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta5 = values.meta) === null || _values$meta5 === void 0 ? void 0 : _values$meta5.inputs) || {})[formId] || {};
31186
31190
  const _defaultData = MainForm.getFieldValue(formId);
31187
31191
  if (isAjaxSubGroup) {
31192
+ var _defaultData$meta, _defaultData$meta2;
31188
31193
  changeInputMeta({
31189
31194
  key: formId,
31190
31195
  type: input.type,
31191
31196
  otherValues: {
31192
- [formId]: {
31193
- ..._defaultData,
31197
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31194
31198
  meta: {
31195
- inputs: {
31196
- ...(_defaultData?.meta?.inputs || {}),
31197
- [inputId]: {
31198
- ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31199
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta = _defaultData.meta) === null || _defaultData$meta === void 0 ? void 0 : _defaultData$meta.inputs) || {}), {}, {
31200
+ [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta2 = _defaultData.meta) === null || _defaultData$meta2 === void 0 ? void 0 : _defaultData$meta2.inputs) || {})[inputId] || {}), {}, {
31199
31201
  comment: ''
31200
- }
31201
- }
31202
+ })
31203
+ })
31202
31204
  }
31203
- }
31205
+ })
31204
31206
  }
31205
31207
  });
31206
31208
  } else {
31207
31209
  changeInputMeta({
31208
31210
  key: formId,
31209
31211
  type: input.type,
31210
- value: {
31211
- ..._defaultMeta,
31212
- [inputId]: {
31213
- ...(_defaultMeta[inputId] || {}),
31212
+ value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31213
+ [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31214
31214
  comment: ''
31215
- }
31216
- }
31215
+ })
31216
+ })
31217
31217
  });
31218
31218
  }
31219
31219
  } else {
@@ -31230,62 +31230,58 @@ const GroupContentFormItem = ({
31230
31230
  if (!isReview) {
31231
31231
  return;
31232
31232
  }
31233
- const reviewSuccess = lastReview?.reviewSuccess;
31233
+ const reviewSuccess = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess;
31234
31234
  if (notPartOfTheForm || isAjaxSubGroup) {
31235
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31235
+ var _values$meta6;
31236
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta6 = values.meta) === null || _values$meta6 === void 0 ? void 0 : _values$meta6.inputs) || {})[formId] || {};
31236
31237
  const _defaultData = MainForm.getFieldValue(formId);
31237
31238
  if (isAjaxSubGroup) {
31239
+ var _defaultData$meta3, _defaultData$meta4, _defaultData$meta5, _defaultData$meta6;
31238
31240
  changeInputMeta({
31239
31241
  key: formId,
31240
31242
  type: input.type,
31241
31243
  otherValues: {
31242
- [formId]: {
31243
- ..._defaultData,
31244
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31244
31245
  meta: {
31245
- inputs: {
31246
- ...(_defaultData?.meta?.inputs || {}),
31247
- [inputId]: {
31248
- ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31249
- reviews: reviewSuccess ? (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []), {
31246
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta3 = _defaultData.meta) === null || _defaultData$meta3 === void 0 ? void 0 : _defaultData$meta3.inputs) || {}), {}, {
31247
+ [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta4 = _defaultData.meta) === null || _defaultData$meta4 === void 0 ? void 0 : _defaultData$meta4.inputs) || {})[inputId] || {}), {}, {
31248
+ reviews: reviewSuccess ? ((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta5 = _defaultData.meta) === null || _defaultData$meta5 === void 0 ? void 0 : _defaultData$meta5.inputs) || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta6 = _defaultData.meta) === null || _defaultData$meta6 === void 0 ? void 0 : _defaultData$meta6.inputs) || {})[inputId] || {}).reviews || []), {
31250
31249
  reviewer: user,
31251
31250
  createdAt: new Date().toISOString(),
31252
31251
  reviewSuccess: true
31253
31252
  }]
31254
- }
31255
- }
31253
+ })
31254
+ })
31256
31255
  }
31257
- }
31256
+ })
31258
31257
  }
31259
31258
  });
31260
31259
  } else {
31261
31260
  changeInputMeta({
31262
31261
  key: formId,
31263
31262
  type: input.type,
31264
- value: {
31265
- ..._defaultMeta,
31266
- [inputId]: {
31267
- ...(_defaultMeta[inputId] || {}),
31263
+ value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31264
+ [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31268
31265
  reviews: reviewSuccess ? ((_defaultMeta[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((_defaultMeta[inputId] || {}).reviews || []), {
31269
31266
  reviewer: user,
31270
31267
  createdAt: new Date().toISOString(),
31271
31268
  reviewSuccess: true
31272
31269
  }]
31273
- }
31274
- }
31270
+ })
31271
+ })
31275
31272
  });
31276
31273
  }
31277
31274
  } else {
31278
31275
  changeInputMeta({
31279
31276
  key: inputId,
31280
31277
  type: input.type,
31281
- value: {
31282
- ...inputMeta,
31278
+ value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
31283
31279
  reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
31284
31280
  reviewer: user,
31285
31281
  createdAt: new Date().toISOString(),
31286
31282
  reviewSuccess: true
31287
31283
  }]
31288
- }
31284
+ })
31289
31285
  });
31290
31286
  }
31291
31287
  };
@@ -31293,118 +31289,111 @@ const GroupContentFormItem = ({
31293
31289
  if (!isReview) {
31294
31290
  return;
31295
31291
  }
31296
- const reviewError = lastReview?.reviewError;
31292
+ const reviewError = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError;
31297
31293
  if (notPartOfTheForm || isAjaxSubGroup) {
31298
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31294
+ var _values$meta7;
31295
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta7 = values.meta) === null || _values$meta7 === void 0 ? void 0 : _values$meta7.inputs) || {})[formId] || {};
31299
31296
  const _defaultData = MainForm.getFieldValue(formId);
31300
31297
  if (isAjaxSubGroup) {
31298
+ var _defaultData$meta7, _defaultData$meta8, _defaultData$meta9, _defaultData$meta10;
31301
31299
  changeInputMeta({
31302
31300
  key: formId,
31303
31301
  type: input.type,
31304
31302
  otherValues: {
31305
- [formId]: {
31306
- ..._defaultData,
31303
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31307
31304
  meta: {
31308
- inputs: {
31309
- ...(_defaultData?.meta?.inputs || {}),
31310
- [inputId]: {
31311
- ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31312
- reviews: reviewError ? (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []), {
31305
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta7 = _defaultData.meta) === null || _defaultData$meta7 === void 0 ? void 0 : _defaultData$meta7.inputs) || {}), {}, {
31306
+ [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta8 = _defaultData.meta) === null || _defaultData$meta8 === void 0 ? void 0 : _defaultData$meta8.inputs) || {})[inputId] || {}), {}, {
31307
+ reviews: reviewError ? ((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta9 = _defaultData.meta) === null || _defaultData$meta9 === void 0 ? void 0 : _defaultData$meta9.inputs) || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta10 = _defaultData.meta) === null || _defaultData$meta10 === void 0 ? void 0 : _defaultData$meta10.inputs) || {})[inputId] || {}).reviews || []), {
31313
31308
  reviewer: user,
31314
31309
  createdAt: new Date().toISOString(),
31315
31310
  reviewError: true,
31316
31311
  comment: ''
31317
31312
  }]
31318
- }
31319
- }
31313
+ })
31314
+ })
31320
31315
  }
31321
- }
31316
+ })
31322
31317
  }
31323
31318
  });
31324
31319
  } else {
31325
31320
  changeInputMeta({
31326
31321
  key: formId,
31327
31322
  type: input.type,
31328
- value: {
31329
- ..._defaultMeta,
31330
- [inputId]: {
31331
- ...(_defaultMeta[inputId] || {}),
31323
+ value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31324
+ [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31332
31325
  reviews: reviewError ? ((_defaultMeta[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((_defaultMeta[inputId] || {}).reviews || []), {
31333
31326
  reviewer: user,
31334
31327
  createdAt: new Date().toISOString(),
31335
31328
  reviewError: true,
31336
31329
  comment: ''
31337
31330
  }]
31338
- }
31339
- }
31331
+ })
31332
+ })
31340
31333
  });
31341
31334
  }
31342
31335
  } else {
31343
31336
  changeInputMeta({
31344
31337
  key: inputId,
31345
31338
  type: input.type,
31346
- value: {
31347
- ...inputMeta,
31339
+ value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
31348
31340
  reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
31349
31341
  reviewer: user,
31350
31342
  createdAt: new Date().toISOString(),
31351
31343
  reviewError: true,
31352
31344
  comment: ''
31353
31345
  }]
31354
- }
31346
+ })
31355
31347
  });
31356
31348
  }
31357
31349
  };
31358
- const requiredComment = inputMeta?.notApplicable && input?.meta?.requiredCommentOnNotApplicable && values?.[formId]?.valuation !== 'na';
31350
+ const requiredComment = (inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.notApplicable) && (input === null || input === void 0 || (_input$meta3 = input.meta) === null || _input$meta3 === void 0 ? void 0 : _input$meta3.requiredCommentOnNotApplicable) && (values === null || values === void 0 || (_values$formId = values[formId]) === null || _values$formId === void 0 ? void 0 : _values$formId.valuation) !== 'na';
31359
31351
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
31360
31352
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
31361
31353
  className: "flex input-cont",
31362
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
31363
- required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
31364
- ...(['total100', 'group'].includes(input.type) ? {} : {
31365
- name: notPartOfTheForm ? [formId, inputId] : inputId,
31366
- fieldKey: notPartOfTheForm ? [formId, inputId] : inputId,
31367
- initialValue: notPartOfTheForm ? (values[formId] || {})[inputId] : values[inputId]
31368
- }),
31369
- ...(['upload', 'imageUpload', 'videoUpload'].includes(input.type) ? {
31370
- valuePropName: "fileList",
31371
- getValueFromEvent: e => {
31372
- if (Array.isArray(e)) {
31373
- return e;
31374
- }
31375
- return e && e.fileList && e.fileList.map(f => {
31376
- if (f.response) {
31377
- return f.response;
31378
- }
31379
- return f;
31380
- });
31354
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
31355
+ required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
31356
+ }, ['total100', 'group'].includes(input.type) ? {} : {
31357
+ name: notPartOfTheForm ? [formId, inputId] : inputId,
31358
+ fieldKey: notPartOfTheForm ? [formId, inputId] : inputId,
31359
+ initialValue: notPartOfTheForm ? (values[formId] || {})[inputId] : values[inputId]
31360
+ }), ['upload', 'imageUpload', 'videoUpload'].includes(input.type) ? {
31361
+ valuePropName: "fileList",
31362
+ getValueFromEvent: e => {
31363
+ if (Array.isArray(e)) {
31364
+ return e;
31381
31365
  }
31382
- } : {}),
31383
- ...(inputOnBlur.includes(input.type) ? {
31384
- trigger: "onBlur"
31385
- } : {}),
31366
+ return e && e.fileList && e.fileList.map(f => {
31367
+ if (f.response) {
31368
+ return f.response;
31369
+ }
31370
+ return f;
31371
+ });
31372
+ }
31373
+ } : {}), inputOnBlur.includes(input.type) ? {
31374
+ trigger: "onBlur"
31375
+ } : {}), {}, {
31386
31376
  style: input.showOnView === false ? {
31387
31377
  display: 'none'
31388
- } : {},
31389
- ...(['switch'].includes(input.type) ? {
31390
- labelCol: {
31391
- span: 20
31392
- },
31393
- style: {
31394
- ...(input.showOnView === false ? {
31395
- display: 'none'
31396
- } : {}),
31397
- flexDirection: 'row',
31398
- justifyContent: 'space-between'
31399
- }
31400
- } : {}),
31378
+ } : {}
31379
+ }, ['switch'].includes(input.type) ? {
31380
+ labelCol: {
31381
+ span: 20
31382
+ },
31383
+ style: _objectSpread2(_objectSpread2({}, input.showOnView === false ? {
31384
+ display: 'none'
31385
+ } : {}), {}, {
31386
+ flexDirection: 'row',
31387
+ justifyContent: 'space-between'
31388
+ })
31389
+ } : {}), {}, {
31401
31390
  label: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
31402
- className: input?.meta?.code && "mr-10",
31391
+ className: (input === null || input === void 0 || (_input$meta4 = input.meta) === null || _input$meta4 === void 0 ? void 0 : _input$meta4.code) && "mr-10",
31403
31392
  children: getInputLabel$1(input, values)
31404
31393
  }) : null,
31405
31394
  rules: rules,
31406
- className: formatClassname([input.comment ? `flex-1 with-comment i-${input.type}` : `i-${input.type} flex-1 `, noActionsInputs.includes(input.type) && 'no-actions-input']),
31407
- "data-id": `${formId}.${inputId}`,
31395
+ className: formatClassname([input.comment ? "flex-1 with-comment i-".concat(input.type) : "i-".concat(input.type, " flex-1 "), noActionsInputs.includes(input.type) && 'no-actions-input']),
31396
+ "data-id": "".concat(formId, ".").concat(inputId),
31408
31397
  extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
31409
31398
  children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
31410
31399
  className: formatClassname(["ml-4 input-actions"]),
@@ -31414,7 +31403,7 @@ const GroupContentFormItem = ({
31414
31403
  title: t('Add review note'),
31415
31404
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
31416
31405
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
31417
- className: formatClassname(["review-btn review-error-btn", lastReview?.reviewError && 'primary']),
31406
+ className: formatClassname(["review-btn review-error-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError) && 'primary']),
31418
31407
  type: "link",
31419
31408
  onClick: onClickReviewError,
31420
31409
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
@@ -31430,7 +31419,7 @@ const GroupContentFormItem = ({
31430
31419
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
31431
31420
  type: "link",
31432
31421
  onClick: onClickReviewSuccess,
31433
- className: formatClassname(["review-btn review-success-btn", lastReview?.reviewSuccess && 'primary']),
31422
+ className: formatClassname(["review-btn review-success-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess) && 'primary']),
31434
31423
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
31435
31424
  name: "CheckSquare",
31436
31425
  width: 16,
@@ -31447,65 +31436,59 @@ const GroupContentFormItem = ({
31447
31436
  className: formatClassname(["default p-0", inputMeta.notApplicable && 'primary']),
31448
31437
  type: "link",
31449
31438
  onClick: () => {
31439
+ var _input$meta5, _input$meta6;
31450
31440
  const value = getDefaultInputValue(input);
31451
- const commentMeta = input?.meta?.requiredCommentOnNotApplicable ? {
31441
+ const commentMeta = input !== null && input !== void 0 && (_input$meta5 = input.meta) !== null && _input$meta5 !== void 0 && _input$meta5.requiredCommentOnNotApplicable ? {
31452
31442
  comment: ''
31453
31443
  } : {};
31454
- if (input?.meta?.requiredCommentOnNotApplicable) {
31444
+ if (input !== null && input !== void 0 && (_input$meta6 = input.meta) !== null && _input$meta6 !== void 0 && _input$meta6.requiredCommentOnNotApplicable) {
31455
31445
  setIsShown(true);
31456
31446
  }
31457
31447
  if (notPartOfTheForm || isAjaxSubGroup) {
31448
+ var _values$meta8;
31458
31449
  const _defaultData = MainForm.getFieldValue(formId);
31459
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31450
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta8 = values.meta) === null || _values$meta8 === void 0 ? void 0 : _values$meta8.inputs) || {})[formId] || {};
31460
31451
  if (isAjaxSubGroup) {
31452
+ var _defaultData$meta11;
31461
31453
  changeInputMeta({
31462
31454
  key: formId,
31463
31455
  type: input.type,
31464
31456
  otherValues: {
31465
- [formId]: {
31466
- ..._defaultData,
31457
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31467
31458
  [inputId]: value,
31468
31459
  meta: {
31469
- inputs: {
31470
- ...(_defaultData?.meta?.inputs || {}),
31471
- [inputId]: inputMeta.notApplicable ? {
31460
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta11 = _defaultData.meta) === null || _defaultData$meta11 === void 0 ? void 0 : _defaultData$meta11.inputs) || {}), {}, {
31461
+ [inputId]: inputMeta.notApplicable ? _objectSpread2({
31472
31462
  notApplicable: false,
31473
- notAvailable: false,
31474
- ...commentMeta
31475
- } : {
31463
+ notAvailable: false
31464
+ }, commentMeta) : _objectSpread2({
31476
31465
  notApplicable: true,
31477
- notAvailable: false,
31478
- ...commentMeta
31479
- }
31480
- }
31466
+ notAvailable: false
31467
+ }, commentMeta)
31468
+ })
31481
31469
  }
31482
- }
31470
+ })
31483
31471
  }
31484
31472
  });
31485
31473
  } else {
31486
31474
  changeInputMeta({
31487
31475
  key: formId,
31488
31476
  type: input.type,
31489
- value: inputMeta.notApplicable ? {
31490
- ..._defaultMeta,
31491
- [inputId]: {
31477
+ value: inputMeta.notApplicable ? _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31478
+ [inputId]: _objectSpread2({
31492
31479
  notApplicable: false,
31493
- notAvailable: false,
31494
- ...commentMeta
31495
- }
31496
- } : {
31497
- ..._defaultMeta,
31498
- [inputId]: {
31480
+ notAvailable: false
31481
+ }, commentMeta)
31482
+ }) : _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31483
+ [inputId]: _objectSpread2({
31499
31484
  notApplicable: true,
31500
- notAvailable: false,
31501
- ...commentMeta
31502
- }
31503
- },
31485
+ notAvailable: false
31486
+ }, commentMeta)
31487
+ }),
31504
31488
  otherValues: {
31505
- [formId]: {
31506
- ..._defaultData,
31489
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31507
31490
  [inputId]: value
31508
- }
31491
+ })
31509
31492
  }
31510
31493
  });
31511
31494
  }
@@ -31526,7 +31509,7 @@ const GroupContentFormItem = ({
31526
31509
  });
31527
31510
  }
31528
31511
  },
31529
- disabled: !input.meta?.notApplicable,
31512
+ disabled: !((_input$meta7 = input.meta) !== null && _input$meta7 !== void 0 && _input$meta7.notApplicable),
31530
31513
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
31531
31514
  name: "NotApplicable",
31532
31515
  width: 16,
@@ -31540,24 +31523,24 @@ const GroupContentFormItem = ({
31540
31523
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
31541
31524
  className: formatClassname(["default p-0", inputMeta.notAvailable && 'primary']),
31542
31525
  type: "link",
31543
- disabled: !input.meta?.notAvailable,
31526
+ disabled: !((_input$meta8 = input.meta) !== null && _input$meta8 !== void 0 && _input$meta8.notAvailable),
31544
31527
  onClick: () => {
31545
31528
  const value = getDefaultInputValue(input);
31546
31529
  if (notPartOfTheForm || isAjaxSubGroup) {
31530
+ var _values$meta9;
31547
31531
  const _defaultData = MainForm.getFieldValue(formId);
31548
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31532
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta9 = values.meta) === null || _values$meta9 === void 0 ? void 0 : _values$meta9.inputs) || {})[formId] || {};
31549
31533
  if (isAjaxSubGroup) {
31550
31534
  if (isAjaxSubGroup) {
31535
+ var _defaultData$meta12;
31551
31536
  changeInputMeta({
31552
31537
  key: formId,
31553
31538
  type: input.type,
31554
31539
  otherValues: {
31555
- [formId]: {
31556
- ..._defaultData,
31540
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31557
31541
  [inputId]: value,
31558
31542
  meta: {
31559
- inputs: {
31560
- ...(_defaultData?.meta?.inputs || {}),
31543
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta12 = _defaultData.meta) === null || _defaultData$meta12 === void 0 ? void 0 : _defaultData$meta12.inputs) || {}), {}, {
31561
31544
  [inputId]: inputMeta.notAvailable ? {
31562
31545
  notApplicable: false,
31563
31546
  notAvailable: false
@@ -31565,9 +31548,9 @@ const GroupContentFormItem = ({
31565
31548
  notApplicable: false,
31566
31549
  notAvailable: true
31567
31550
  }
31568
- }
31551
+ })
31569
31552
  }
31570
- }
31553
+ })
31571
31554
  }
31572
31555
  });
31573
31556
  }
@@ -31575,24 +31558,21 @@ const GroupContentFormItem = ({
31575
31558
  changeInputMeta({
31576
31559
  key: formId,
31577
31560
  type: input.type,
31578
- value: inputMeta.notAvailable ? {
31579
- ..._defaultMeta,
31561
+ value: inputMeta.notAvailable ? _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31580
31562
  [inputId]: {
31581
31563
  notApplicable: false,
31582
31564
  notAvailable: false
31583
31565
  }
31584
- } : {
31585
- ..._defaultMeta,
31566
+ }) : _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31586
31567
  [inputId]: {
31587
31568
  notApplicable: false,
31588
31569
  notAvailable: true
31589
31570
  }
31590
- },
31571
+ }),
31591
31572
  otherValues: {
31592
- [formId]: {
31593
- ..._defaultData,
31573
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31594
31574
  [inputId]: value
31595
- }
31575
+ })
31596
31576
  }
31597
31577
  });
31598
31578
  }
@@ -31623,38 +31603,33 @@ const GroupContentFormItem = ({
31623
31603
  }), /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
31624
31604
  title: t('Add comment'),
31625
31605
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
31626
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
31606
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
31627
31607
  type: "link",
31628
- disabled: !input.meta?.comment,
31629
- ...(!isShown ? {
31630
- className: 'default p-0'
31631
- } : {
31632
- className: 'p-0 primary'
31633
- }),
31608
+ disabled: !((_input$meta9 = input.meta) !== null && _input$meta9 !== void 0 && _input$meta9.comment)
31609
+ }, !isShown ? {
31610
+ className: 'default p-0'
31611
+ } : {
31612
+ className: 'p-0 primary'
31613
+ }), {}, {
31634
31614
  onClick: onClickComment,
31635
31615
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
31636
31616
  name: "AddComment",
31637
31617
  width: 16,
31638
31618
  height: 16
31639
31619
  })
31640
- })
31620
+ }))
31641
31621
  })
31642
31622
  })]
31643
31623
  }) : null]
31644
31624
  }) : null
31645
31625
  }),
31646
31626
  children: isReview ? /*#__PURE__*/jsxRuntime.jsx(BasicInput, {
31647
- data: {
31648
- ...(values[formId] || {}),
31649
- meta: {
31650
- ...(values?.meta || {}),
31651
- inputs: {
31652
- ...(values?.meta?.inputs || {}),
31653
- ...((values?.meta?.inputs || {})[formId] || {})
31654
- }
31655
- }
31656
- },
31657
- linkingData: values?.linking || values?.parent?.linking,
31627
+ data: _objectSpread2(_objectSpread2({}, values[formId] || {}), {}, {
31628
+ meta: _objectSpread2(_objectSpread2({}, (values === null || values === void 0 ? void 0 : values.meta) || {}), {}, {
31629
+ inputs: _objectSpread2(_objectSpread2({}, (values === null || values === void 0 || (_values$meta10 = values.meta) === null || _values$meta10 === void 0 ? void 0 : _values$meta10.inputs) || {}), ((values === null || values === void 0 || (_values$meta11 = values.meta) === null || _values$meta11 === void 0 ? void 0 : _values$meta11.inputs) || {})[formId] || {})
31630
+ })
31631
+ }),
31632
+ linkingData: (values === null || values === void 0 ? void 0 : values.linking) || (values === null || values === void 0 || (_values$parent = values.parent) === null || _values$parent === void 0 ? void 0 : _values$parent.linking),
31658
31633
  name: input.dataId,
31659
31634
  config: input,
31660
31635
  t: t,
@@ -31666,13 +31641,12 @@ const GroupContentFormItem = ({
31666
31641
  getToken: getToken,
31667
31642
  app: app,
31668
31643
  valueOnlyString: true
31669
- }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
31670
- ...inputData,
31644
+ }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](_objectSpread2(_objectSpread2({}, inputData), {}, {
31671
31645
  name: inputId,
31672
31646
  maxWidth,
31673
31647
  staticWidth,
31674
31648
  fullWidth
31675
- }, {
31649
+ }), {
31676
31650
  form: MainForm,
31677
31651
  forms: options,
31678
31652
  allForms: plainForms,
@@ -31690,10 +31664,10 @@ const GroupContentFormItem = ({
31690
31664
  staticWidth,
31691
31665
  fullWidth
31692
31666
  }) : console.log(input)
31693
- }), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
31667
+ })), (_input$meta10 = input.meta) !== null && _input$meta10 !== void 0 && _input$meta10.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
31694
31668
  className: "code",
31695
31669
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
31696
- children: input.meta?.code
31670
+ children: (_input$meta11 = input.meta) === null || _input$meta11 === void 0 ? void 0 : _input$meta11.code
31697
31671
  })
31698
31672
  }) : null]
31699
31673
  }), maxRule ? ['imageUpload', 'videoUpload', 'upload'].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -31713,16 +31687,16 @@ const GroupContentFormItem = ({
31713
31687
  className: "max-char-span",
31714
31688
  children: t('max-char', {
31715
31689
  chars: maxRule,
31716
- filled: inputData?.value?.length || 0
31690
+ filled: (inputData === null || inputData === void 0 || (_inputData$value = inputData.value) === null || _inputData$value === void 0 ? void 0 : _inputData$value.length) || 0
31717
31691
  })
31718
31692
  })
31719
- }) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
31693
+ }) : null, (_input$meta12 = input.meta) !== null && _input$meta12 !== void 0 && _input$meta12.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
31720
31694
  className: "input-content",
31721
31695
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
31722
31696
  className: "comment-textarea",
31723
- initialValue: inputMeta?.comment || '',
31697
+ initialValue: (inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.comment) || '',
31724
31698
  hidden: !isShown,
31725
- name: `${formId}-${inputId}-comment`,
31699
+ name: "".concat(formId, "-").concat(inputId, "-comment"),
31726
31700
  required: requiredComment,
31727
31701
  rules: requiredComment ? [{
31728
31702
  required: true,
@@ -31739,38 +31713,35 @@ const GroupContentFormItem = ({
31739
31713
  onConfirm: () => {
31740
31714
  setIsShown(false);
31741
31715
  if (notPartOfTheForm) {
31742
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31716
+ var _values$meta12;
31717
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta12 = values.meta) === null || _values$meta12 === void 0 ? void 0 : _values$meta12.inputs) || {})[formId] || {};
31743
31718
  const _defaultData = MainForm.getFieldValue(formId);
31744
31719
  if (isAjaxSubGroup) {
31720
+ var _defaultData$meta13, _defaultData$meta14;
31745
31721
  changeInputMeta({
31746
31722
  key: formId,
31747
31723
  type: input.type,
31748
31724
  otherValues: {
31749
- [formId]: {
31750
- ..._defaultData,
31725
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31751
31726
  meta: {
31752
- inputs: {
31753
- ...(_defaultData?.meta?.inputs || {}),
31754
- [inputId]: {
31755
- ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31727
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta13 = _defaultData.meta) === null || _defaultData$meta13 === void 0 ? void 0 : _defaultData$meta13.inputs) || {}), {}, {
31728
+ [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta14 = _defaultData.meta) === null || _defaultData$meta14 === void 0 ? void 0 : _defaultData$meta14.inputs) || {})[inputId] || {}), {}, {
31756
31729
  comment: null
31757
- }
31758
- }
31730
+ })
31731
+ })
31759
31732
  }
31760
- }
31733
+ })
31761
31734
  }
31762
31735
  });
31763
31736
  } else {
31764
31737
  changeInputMeta({
31765
31738
  key: formId,
31766
31739
  type: input.type,
31767
- value: {
31768
- ..._defaultMeta,
31769
- [inputId]: {
31770
- ...(_defaultMeta[inputId] || {}),
31740
+ value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31741
+ [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31771
31742
  comment: null
31772
- }
31773
- }
31743
+ })
31744
+ })
31774
31745
  });
31775
31746
  }
31776
31747
  } else {
@@ -31785,7 +31756,7 @@ const GroupContentFormItem = ({
31785
31756
  },
31786
31757
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
31787
31758
  type: "link",
31788
- disabled: !input.meta?.comment,
31759
+ disabled: !((_input$meta13 = input.meta) !== null && _input$meta13 !== void 0 && _input$meta13.comment),
31789
31760
  className: "p-0",
31790
31761
  children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
31791
31762
  width: 16,
@@ -31797,44 +31768,41 @@ const GroupContentFormItem = ({
31797
31768
  children: inputTypeComponent$1.comment(inputData, {
31798
31769
  form: MainForm,
31799
31770
  forms: options,
31800
- value: inputMeta?.comment || '',
31771
+ value: (inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.comment) || '',
31801
31772
  maxWidth,
31802
31773
  staticWidth,
31803
31774
  fullWidth,
31804
31775
  onChange: val => {
31805
31776
  if (notPartOfTheForm) {
31806
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31777
+ var _values$meta13;
31778
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta13 = values.meta) === null || _values$meta13 === void 0 ? void 0 : _values$meta13.inputs) || {})[formId] || {};
31807
31779
  const _defaultData = MainForm.getFieldValue(formId);
31808
31780
  if (isAjaxSubGroup) {
31781
+ var _defaultData$meta15, _defaultData$meta16;
31809
31782
  changeInputMeta({
31810
31783
  key: formId,
31811
31784
  type: input.type,
31812
31785
  otherValues: {
31813
- [formId]: {
31814
- ..._defaultData,
31786
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31815
31787
  meta: {
31816
- inputs: {
31817
- ...(_defaultData?.meta?.inputs || {}),
31818
- [inputId]: {
31819
- ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31788
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta15 = _defaultData.meta) === null || _defaultData$meta15 === void 0 ? void 0 : _defaultData$meta15.inputs) || {}), {}, {
31789
+ [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta16 = _defaultData.meta) === null || _defaultData$meta16 === void 0 ? void 0 : _defaultData$meta16.inputs) || {})[inputId] || {}), {}, {
31820
31790
  comment: val
31821
- }
31822
- }
31791
+ })
31792
+ })
31823
31793
  }
31824
- }
31794
+ })
31825
31795
  }
31826
31796
  });
31827
31797
  } else {
31828
31798
  changeInputMeta({
31829
31799
  key: formId,
31830
31800
  type: input.type,
31831
- value: {
31832
- ..._defaultMeta,
31833
- [inputId]: {
31834
- ...(_defaultMeta[inputId] || {}),
31801
+ value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31802
+ [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31835
31803
  comment: val
31836
- }
31837
- }
31804
+ })
31805
+ })
31838
31806
  });
31839
31807
  }
31840
31808
  } else {
@@ -31855,16 +31823,16 @@ const GroupContentFormItem = ({
31855
31823
  className: "max-char-span",
31856
31824
  children: t('max-char', {
31857
31825
  chars: MAX_COMMENTS_LENGTH,
31858
- filled: inputMeta?.comment?.length || 0
31826
+ filled: (inputMeta === null || inputMeta === void 0 || (_inputMeta$comment = inputMeta.comment) === null || _inputMeta$comment === void 0 ? void 0 : _inputMeta$comment.length) || 0
31859
31827
  })
31860
31828
  })]
31861
- }) : null, lastReview?.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
31829
+ }) : null, lastReview !== null && lastReview !== void 0 && lastReview.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
31862
31830
  className: "input-content",
31863
31831
  children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
31864
31832
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
31865
31833
  className: "comment-textarea",
31866
- initialValue: lastReview?.comment || '',
31867
- name: `${formId}-${inputId}-reviewErrorComment`,
31834
+ initialValue: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || '',
31835
+ name: "".concat(formId, "-").concat(inputId, "-reviewErrorComment"),
31868
31836
  label: /*#__PURE__*/jsxRuntime.jsx("div", {
31869
31837
  className: "flex w-100",
31870
31838
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -31875,78 +31843,71 @@ const GroupContentFormItem = ({
31875
31843
  children: inputTypeComponent$1.comment(inputData, {
31876
31844
  form: MainForm,
31877
31845
  forms: options,
31878
- value: lastReview?.comment || '',
31846
+ value: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || '',
31879
31847
  maxWidth,
31880
31848
  staticWidth,
31881
31849
  fullWidth,
31882
31850
  onChange: val => {
31883
31851
  if (notPartOfTheForm) {
31884
- const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31852
+ var _values$meta14;
31853
+ const _defaultMeta = ((values === null || values === void 0 || (_values$meta14 = values.meta) === null || _values$meta14 === void 0 ? void 0 : _values$meta14.inputs) || {})[formId] || {};
31885
31854
  const _defaultData = MainForm.getFieldValue(formId);
31886
31855
  if (isAjaxSubGroup) {
31856
+ var _defaultData$meta17, _defaultData$meta18, _defaultData$meta19;
31887
31857
  changeInputMeta({
31888
31858
  key: formId,
31889
31859
  type: input.type,
31890
31860
  otherValues: {
31891
- [formId]: {
31892
- ..._defaultData,
31861
+ [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31893
31862
  meta: {
31894
- inputs: {
31895
- ...(_defaultData?.meta?.inputs || {}),
31896
- [inputId]: {
31897
- ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31898
- reviews: (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).map(v => {
31863
+ inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta17 = _defaultData.meta) === null || _defaultData$meta17 === void 0 ? void 0 : _defaultData$meta17.inputs) || {}), {}, {
31864
+ [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta18 = _defaultData.meta) === null || _defaultData$meta18 === void 0 ? void 0 : _defaultData$meta18.inputs) || {})[inputId] || {}), {}, {
31865
+ reviews: ((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta19 = _defaultData.meta) === null || _defaultData$meta19 === void 0 ? void 0 : _defaultData$meta19.inputs) || {})[inputId] || {}).reviews || []).map(v => {
31899
31866
  if (v.createdAt === lastReview.createdAt) {
31900
- return {
31901
- ...v,
31867
+ return _objectSpread2(_objectSpread2({}, v), {}, {
31902
31868
  comment: val
31903
- };
31869
+ });
31904
31870
  }
31905
31871
  return v;
31906
31872
  })
31907
- }
31908
- }
31873
+ })
31874
+ })
31909
31875
  }
31910
- }
31876
+ })
31911
31877
  }
31912
31878
  });
31913
31879
  } else {
31914
31880
  changeInputMeta({
31915
31881
  key: formId,
31916
31882
  type: input.type,
31917
- value: {
31918
- ..._defaultMeta,
31919
- [inputId]: {
31920
- ...(_defaultMeta[inputId] || {}),
31883
+ value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31884
+ [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31921
31885
  reviews: ((_defaultMeta[inputId] || {}).reviews || []).map(v => {
31922
31886
  if (v.createdAt === lastReview.createdAt) {
31923
- return {
31924
- ...v,
31887
+ return _objectSpread2(_objectSpread2({}, v), {}, {
31925
31888
  comment: val
31926
- };
31889
+ });
31927
31890
  }
31928
31891
  return v;
31929
31892
  })
31930
- }
31931
- }
31893
+ })
31894
+ })
31932
31895
  });
31933
31896
  }
31934
31897
  } else {
31935
31898
  changeInputMeta({
31936
31899
  key: inputId,
31937
31900
  type: input.type,
31938
- value: {
31939
- ...inputMeta,
31940
- reviews: (inputMeta?.reviews || []).map(v => {
31901
+ value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
31902
+ reviews: ((inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.reviews) || []).map(v => {
31941
31903
  if (v.createdAt === lastReview.createdAt) {
31942
- return {
31943
- ...v,
31904
+ return _objectSpread2(_objectSpread2({}, v), {}, {
31944
31905
  comment: val
31945
- };
31906
+ });
31946
31907
  }
31947
31908
  return v;
31948
31909
  })
31949
- }
31910
+ })
31950
31911
  });
31951
31912
  }
31952
31913
  },
@@ -31958,7 +31919,7 @@ const GroupContentFormItem = ({
31958
31919
  className: "max-char-span",
31959
31920
  children: t('max-char', {
31960
31921
  chars: MAX_COMMENTS_LENGTH,
31961
- filled: lastReview.comment?.length || 0
31922
+ filled: ((_lastReview$comment = lastReview.comment) === null || _lastReview$comment === void 0 ? void 0 : _lastReview$comment.length) || 0
31962
31923
  })
31963
31924
  })]
31964
31925
  }) : /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -31979,7 +31940,7 @@ const GroupContentFormItem = ({
31979
31940
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
31980
31941
  className: "flex flex-column justify-center mr-1",
31981
31942
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
31982
- children: lastReview?.reviewer?.firstName + ' ' + lastReview?.reviewer?.lastName + ' - ' + moment__default["default"](lastReview.createdAt).format('DD MMM YYYY')
31943
+ children: (lastReview === null || lastReview === void 0 || (_lastReview$reviewer = lastReview.reviewer) === null || _lastReview$reviewer === void 0 ? void 0 : _lastReview$reviewer.firstName) + ' ' + (lastReview === null || lastReview === void 0 || (_lastReview$reviewer2 = lastReview.reviewer) === null || _lastReview$reviewer2 === void 0 ? void 0 : _lastReview$reviewer2.lastName) + ' - ' + moment__default["default"](lastReview.createdAt).format('DD MMM YYYY')
31983
31944
  })
31984
31945
  })]
31985
31946
  })]
@@ -45178,7 +45139,7 @@ const filtersConfig$e = {
45178
45139
  datastakeId: '',
45179
45140
  name: ''
45180
45141
  };
45181
- const selectFiltersConfig$d = {
45142
+ const selectFiltersConfig$a = {
45182
45143
  country: {
45183
45144
  type: 'select',
45184
45145
  label: 'Country',
@@ -45955,7 +45916,7 @@ function DataStoreTable$1(_ref) {
45955
45916
  goNext,
45956
45917
  setPagination
45957
45918
  } = useFilters({
45958
- selectFiltersConfig: selectFiltersConfig$d,
45919
+ selectFiltersConfig: selectFiltersConfig$a,
45959
45920
  view,
45960
45921
  goTo,
45961
45922
  location,
@@ -46049,7 +46010,7 @@ function DataStoreTable$1(_ref) {
46049
46010
  rowKey: "key",
46050
46011
  doEmptyRows: true,
46051
46012
  selectOptions,
46052
- filtersConfig: selectFiltersConfig$d,
46013
+ filtersConfig: selectFiltersConfig$a,
46053
46014
  onFilterChange: onFiltersChange,
46054
46015
  showFilters,
46055
46016
  defaultFilters,
@@ -53835,7 +53796,7 @@ const checkboxConfig$d = {
53835
53796
  name: "Name",
53836
53797
  datastakeId: "ID"
53837
53798
  };
53838
- const selectFiltersConfig$c = {
53799
+ const selectFiltersConfig$9 = {
53839
53800
  account: {
53840
53801
  type: "select",
53841
53802
  label: "Account",
@@ -54073,7 +54034,10 @@ const useGetParams = ({
54073
54034
  ...(Object.keys(cleanSearchParams)?.length > 0 && {
54074
54035
  search: cleanSearchParams
54075
54036
  }),
54076
- tab: activeTab
54037
+ tab: activeTab,
54038
+ ...(activeTab === "deleted" && {
54039
+ status: 'deleted'
54040
+ })
54077
54041
  };
54078
54042
  }, [location.search]);
54079
54043
  return params;
@@ -54179,7 +54143,7 @@ function UserTable(_ref) {
54179
54143
  } = useAdminTable({
54180
54144
  goTo,
54181
54145
  location,
54182
- selectFiltersConfig: selectFiltersConfig$c,
54146
+ selectFiltersConfig: selectFiltersConfig$9,
54183
54147
  view: view$2,
54184
54148
  defaultUrlParams: defaultUrlParams$6,
54185
54149
  module,
@@ -54261,7 +54225,7 @@ function UserTable(_ref) {
54261
54225
  pagination: filter.pagination,
54262
54226
  selectOptions: selectOptions,
54263
54227
  setShowFilters: setShowFilters,
54264
- filtersConfig: selectFiltersConfig$c,
54228
+ filtersConfig: selectFiltersConfig$9,
54265
54229
  onFilterChange: filter.onFiltersChange,
54266
54230
  showFilters: showFilters,
54267
54231
  defaultFilters: filter.defaultFilters,
@@ -54589,7 +54553,7 @@ const checkboxConfig$c = {
54589
54553
  name: "Name",
54590
54554
  datastakeId: "ID"
54591
54555
  };
54592
- const selectFiltersConfig$b = {
54556
+ const selectFiltersConfig$8 = {
54593
54557
  type: {
54594
54558
  type: "select",
54595
54559
  label: "Type",
@@ -54928,7 +54892,7 @@ function AccountTable(_ref) {
54928
54892
  } = useAdminTable({
54929
54893
  goTo,
54930
54894
  location,
54931
- selectFiltersConfig: selectFiltersConfig$b,
54895
+ selectFiltersConfig: selectFiltersConfig$8,
54932
54896
  view: view$1,
54933
54897
  defaultUrlParams: defaultUrlParams$5,
54934
54898
  module,
@@ -55056,7 +55020,7 @@ function AccountTable(_ref) {
55056
55020
  doEmptyRows: true,
55057
55021
  selectOptions: selectOptions,
55058
55022
  setShowFilters: setShowFilters,
55059
- filtersConfig: selectFiltersConfig$b,
55023
+ filtersConfig: selectFiltersConfig$8,
55060
55024
  onFilterChange: filter.onFiltersChange,
55061
55025
  showFilters: showFilters,
55062
55026
  defaultFilters: filter.defaultFilters,
@@ -55092,46 +55056,150 @@ function AccountTable(_ref) {
55092
55056
  });
55093
55057
  }
55094
55058
 
55095
- const selectFiltersConfig$a = {
55096
- category: {
55097
- type: "select",
55098
- label: "Category",
55099
- placeholder: t => t("Category"),
55100
- style: {
55101
- flex: 1
55102
- },
55103
- labelStyle: {
55104
- flex: 1
55105
- },
55106
- getLabel: option => option.label,
55107
- getValue: option => option.value
55108
- },
55109
- country: {
55110
- type: "select",
55111
- label: "Country",
55112
- placeholder: t => t("Country"),
55113
- style: {
55114
- flex: 1
55115
- },
55116
- labelStyle: {
55117
- flex: 1
55059
+ const getFiltersConfig$3 = ({
55060
+ t
55061
+ }) => {
55062
+ return {
55063
+ category: {
55064
+ type: 'select',
55065
+ label: 'Category',
55066
+ placeholder: t => `${t('Filter by')} ${t('Category').toLowerCase()}`,
55067
+ style: {
55068
+ flex: 1
55069
+ },
55070
+ labelStyle: {
55071
+ flex: 1
55072
+ },
55073
+ getLabel: option => option.label,
55074
+ getValue: option => option.value
55118
55075
  },
55119
- getLabel: option => option.label,
55120
- getValue: option => option.value
55121
- },
55122
- sources: {
55123
- type: "select",
55124
- label: "Sources",
55125
- placeholder: t => t("Sources"),
55126
- style: {
55127
- flex: 1
55076
+ country: {
55077
+ type: 'select',
55078
+ label: 'Country',
55079
+ placeholder: () => `${t('Filter by')} ${t('Country').toLowerCase()}`,
55080
+ style: {
55081
+ flex: 1
55082
+ },
55083
+ labelStyle: {
55084
+ flex: 1
55085
+ },
55086
+ getLabel: option => option.label,
55087
+ getValue: option => option.value
55128
55088
  },
55129
- labelStyle: {
55130
- flex: 1
55089
+ administrativeLevel1: {
55090
+ type: 'ajaxSelect',
55091
+ label: ({
55092
+ t = s => s,
55093
+ options = {},
55094
+ filters = {},
55095
+ language = 'en'
55096
+ }) => {
55097
+ const {
55098
+ administrativeLevel1
55099
+ } = options;
55100
+ if (administrativeLevel1) {
55101
+ if (options.country) {
55102
+ const _item = administrativeLevel1[filters.country];
55103
+ if (_item) {
55104
+ if (_item[language]) {
55105
+ return _item[language];
55106
+ }
55107
+ }
55108
+ }
55109
+ }
55110
+ return t('Province');
55111
+ },
55112
+ placeholder: () => `${t('Filter by')} ${t('Province').toLowerCase()}`,
55113
+ filters: data => ({
55114
+ country: data.country,
55115
+ level: 'level_1'
55116
+ }),
55117
+ show: data => !data.country,
55118
+ disabled: data => !data.country,
55119
+ mapper: {
55120
+ label: "name",
55121
+ value: "id"
55122
+ },
55123
+ method: 'getOptions',
55124
+ entity: 'AdministrativeLevel',
55125
+ style: {
55126
+ flex: 1
55127
+ },
55128
+ labelStyle: {
55129
+ flex: 1
55130
+ }
55131
55131
  },
55132
- getLabel: option => option.label,
55133
- getValue: option => option.value
55134
- }
55132
+ administrativeLevel2: {
55133
+ type: 'ajaxSelect',
55134
+ label: ({
55135
+ t = s => s,
55136
+ options = {},
55137
+ filters = {},
55138
+ language = 'en'
55139
+ }) => {
55140
+ const {
55141
+ administrativeLevel2
55142
+ } = options;
55143
+ if (administrativeLevel2) {
55144
+ if (options.country) {
55145
+ const _item = administrativeLevel2[filters.country];
55146
+ if (_item) {
55147
+ if (_item[language]) {
55148
+ return _item[language];
55149
+ }
55150
+ }
55151
+ }
55152
+ }
55153
+ return t('Province');
55154
+ },
55155
+ show: data => !(data.country && data.administrativeLevel1),
55156
+ placeholder: () => `${t('Filter by')} ${t('Territory').toLowerCase()}`,
55157
+ filters: data => ({
55158
+ country: data.country,
55159
+ level: 'level_2',
55160
+ administrativeLevel1: data.administrativeLevel1
55161
+ }),
55162
+ disabled: data => !(data.country && data.administrativeLevel1),
55163
+ mapper: {
55164
+ label: "name",
55165
+ value: "id"
55166
+ },
55167
+ method: 'getOptions',
55168
+ entity: 'AdministrativeLevel',
55169
+ style: {
55170
+ flex: 1
55171
+ },
55172
+ labelStyle: {
55173
+ flex: 1
55174
+ }
55175
+ }
55176
+ };
55177
+ };
55178
+ const getFilterOptions$3 = (options, t) => {
55179
+ const {
55180
+ statusOptions = [],
55181
+ categoryOptions = [],
55182
+ countries = [],
55183
+ product = [],
55184
+ subCategory = [],
55185
+ subCategoriesOptions,
55186
+ stakeholderCategoryOptions,
55187
+ stakeholderSubCategoriesOptions,
55188
+ administrativeLevel1,
55189
+ administrativeLevel2,
55190
+ mineralOptions,
55191
+ minerals,
55192
+ productionSiteCategories,
55193
+ locationCategories = []
55194
+ } = options || {};
55195
+ const _default = {
55196
+ // category: stakeholderCategoryOptions || categoryOptions,
55197
+ country: countries || [],
55198
+ administrativeLevel1,
55199
+ administrativeLevel2,
55200
+ category: locationCategories || []
55201
+ };
55202
+ return _default;
55135
55203
  };
55136
55204
  const filtersConfig$b = {
55137
55205
  name: "",
@@ -55735,7 +55803,9 @@ function LocationTable(_ref) {
55735
55803
  mergeLocationsFunction,
55736
55804
  refetchTrigger,
55737
55805
  user,
55738
- options
55806
+ options,
55807
+ APP,
55808
+ apiUrl
55739
55809
  } = _ref;
55740
55810
  const [showFilters, setShowFilters] = React.useState(false);
55741
55811
  const [hasError, setHasError] = React.useState(false);
@@ -55744,6 +55814,14 @@ function LocationTable(_ref) {
55744
55814
  token
55745
55815
  } = useToken$4();
55746
55816
  const [isCombineModalOpen, setIsModalOpen] = React.useState(false);
55817
+ const selectFiltersConfig = React.useMemo(() => {
55818
+ return getFiltersConfig$3({
55819
+ t
55820
+ });
55821
+ }, [t]);
55822
+ const filterOptions = React.useMemo(() => {
55823
+ return getFilterOptions$3(options);
55824
+ }, [options, t]);
55747
55825
  const {
55748
55826
  filter,
55749
55827
  activeTab,
@@ -55756,7 +55834,7 @@ function LocationTable(_ref) {
55756
55834
  } = useSubjectsAdminTable({
55757
55835
  goTo,
55758
55836
  location,
55759
- selectFiltersConfig: selectFiltersConfig$a,
55837
+ selectFiltersConfig,
55760
55838
  view,
55761
55839
  defaultUrlParams: defaultUrlParams$4,
55762
55840
  module,
@@ -55805,7 +55883,7 @@ function LocationTable(_ref) {
55805
55883
  hasError: hasError,
55806
55884
  setHasError: setHasError,
55807
55885
  canClearSearch: canClearSearch,
55808
- selectOptions: selectOptions,
55886
+ selectOptions: filterOptions,
55809
55887
  checkboxConfig: checkboxConfig$b,
55810
55888
  defaultTableFilters: {},
55811
55889
  breadcrumbs: breadcrumbs,
@@ -55835,14 +55913,16 @@ function LocationTable(_ref) {
55835
55913
  hideOnLoading: false,
55836
55914
  pagination: filter.pagination,
55837
55915
  rowKey: "id",
55838
- selectOptions: selectOptions,
55916
+ selectOptions: filterOptions,
55839
55917
  doEmptyRows: true,
55840
55918
  setShowFilters: setShowFilters,
55841
- filtersConfig: selectFiltersConfig$a,
55919
+ filtersConfig: selectFiltersConfig,
55842
55920
  onFilterChange: filter.onFiltersChange,
55843
55921
  showFilters: showFilters,
55844
55922
  defaultFilters: filter.defaultFilters,
55845
- onChange: filter.onTableChange
55923
+ onChange: filter.onTableChange,
55924
+ app: APP,
55925
+ apiUrl: apiUrl
55846
55926
  })]
55847
55927
  }), /*#__PURE__*/jsxRuntime.jsx(CombineLocationModal, {
55848
55928
  isOpen: isCombineModalOpen,
@@ -55868,46 +55948,47 @@ function LocationTable(_ref) {
55868
55948
  });
55869
55949
  }
55870
55950
 
55871
- const selectFiltersConfig$9 = {
55872
- category: {
55873
- type: "select",
55874
- label: "Category",
55875
- placeholder: t => t("Category"),
55876
- style: {
55877
- flex: 1
55878
- },
55879
- labelStyle: {
55880
- flex: 1
55881
- },
55882
- getLabel: option => option.label,
55883
- getValue: option => option.value
55884
- },
55885
- country: {
55886
- type: "select",
55887
- label: "Country",
55888
- placeholder: t => t("Country"),
55889
- style: {
55890
- flex: 1
55891
- },
55892
- labelStyle: {
55893
- flex: 1
55894
- },
55895
- getLabel: option => option.label,
55896
- getValue: option => option.value
55897
- },
55898
- sources: {
55899
- type: "select",
55900
- label: "Sources",
55901
- placeholder: t => t("Sources"),
55902
- style: {
55903
- flex: 1
55904
- },
55905
- labelStyle: {
55906
- flex: 1
55951
+ const getFiltersConfig$2 = ({
55952
+ t
55953
+ }) => {
55954
+ return {
55955
+ country: {
55956
+ type: 'select',
55957
+ placeholder: t('Country'),
55958
+ style: {
55959
+ flex: 1
55960
+ },
55961
+ labelStyle: {
55962
+ flex: 1
55963
+ },
55964
+ getLabel: option => option.label,
55965
+ getValue: option => option.value
55907
55966
  },
55908
- getLabel: option => option.label,
55909
- getValue: option => option.value
55910
- }
55967
+ category: {
55968
+ type: 'select',
55969
+ label: 'Category',
55970
+ placeholder: t => `${t('Filter by')} ${t('Category').toLowerCase()}`,
55971
+ style: {
55972
+ flex: 1
55973
+ },
55974
+ labelStyle: {
55975
+ flex: 1
55976
+ },
55977
+ getLabel: option => option.label,
55978
+ getValue: option => option.value
55979
+ }
55980
+ };
55981
+ };
55982
+ const getFilterOptions$2 = (options, t) => {
55983
+ const {
55984
+ countries,
55985
+ category,
55986
+ categoriesOptions
55987
+ } = options || {};
55988
+ return {
55989
+ country: countries || [],
55990
+ category: categoriesOptions || category || []
55991
+ };
55911
55992
  };
55912
55993
  const filtersConfig$a = {
55913
55994
  name: "",
@@ -56412,7 +56493,9 @@ function SubjectsTable(_ref) {
56412
56493
  mergeSubjectsFunction,
56413
56494
  refetchTrigger,
56414
56495
  user,
56415
- options
56496
+ options,
56497
+ APP,
56498
+ apiUrl
56416
56499
  } = _ref;
56417
56500
  const [showFilters, setShowFilters] = React.useState(false);
56418
56501
  const [hasError, setHasError] = React.useState(false);
@@ -56421,6 +56504,14 @@ function SubjectsTable(_ref) {
56421
56504
  token
56422
56505
  } = useToken$2();
56423
56506
  const [isCombineModalOpen, setIsModalOpen] = React.useState(false);
56507
+ const selectFiltersConfig = React.useMemo(() => {
56508
+ return getFiltersConfig$2({
56509
+ t
56510
+ });
56511
+ }, [t]);
56512
+ const filterOptions = React.useMemo(() => {
56513
+ return getFilterOptions$2(options);
56514
+ }, [options, t]);
56424
56515
  const {
56425
56516
  filter,
56426
56517
  activeTab,
@@ -56433,7 +56524,7 @@ function SubjectsTable(_ref) {
56433
56524
  } = useSubjectsAdminTable({
56434
56525
  goTo,
56435
56526
  location,
56436
- selectFiltersConfig: selectFiltersConfig$9,
56527
+ selectFiltersConfig,
56437
56528
  view,
56438
56529
  defaultUrlParams: defaultUrlParams$3,
56439
56530
  module,
@@ -56481,7 +56572,7 @@ function SubjectsTable(_ref) {
56481
56572
  hasError: hasError,
56482
56573
  setHasError: setHasError,
56483
56574
  canClearSearch: canClearSearch,
56484
- selectOptions: selectOptions,
56575
+ selectOptions: filterOptions,
56485
56576
  checkboxConfig: checkboxConfig$a,
56486
56577
  defaultTableFilters: {},
56487
56578
  breadcrumbs: breadcrumbs,
@@ -56511,14 +56602,16 @@ function SubjectsTable(_ref) {
56511
56602
  hideOnLoading: false,
56512
56603
  pagination: filter.pagination,
56513
56604
  rowKey: "id",
56514
- selectOptions: selectOptions,
56605
+ selectOptions: filterOptions,
56515
56606
  doEmptyRows: true,
56516
56607
  setShowFilters: setShowFilters,
56517
- filtersConfig: selectFiltersConfig$9,
56608
+ filtersConfig: selectFiltersConfig,
56518
56609
  onFilterChange: filter.onFiltersChange,
56519
56610
  showFilters: showFilters,
56520
56611
  defaultFilters: filter.defaultFilters,
56521
- onChange: filter.onTableChange
56612
+ onChange: filter.onTableChange,
56613
+ app: APP,
56614
+ apiUrl: apiUrl
56522
56615
  })]
56523
56616
  }), /*#__PURE__*/jsxRuntime.jsx(CombineSubjectsModal, {
56524
56617
  isOpen: isCombineModalOpen,
@@ -57041,7 +57134,7 @@ const getColumns$2 = ({
57041
57134
  return cols.filter(v => v.show);
57042
57135
  };
57043
57136
  const checkboxConfig$9 = {};
57044
- const selectFiltersConfig$8 = {
57137
+ const selectFiltersConfig$7 = {
57045
57138
  userRole: {
57046
57139
  type: "select",
57047
57140
  label: "Role",
@@ -57117,7 +57210,7 @@ function Users({
57117
57210
  } = useFilters({
57118
57211
  goTo,
57119
57212
  location,
57120
- selectFiltersConfig: selectFiltersConfig$8,
57213
+ selectFiltersConfig: selectFiltersConfig$7,
57121
57214
  defaultUrlParams: defaultUrlParams$2,
57122
57215
  module,
57123
57216
  filtersConfig: filtersConfig$9,
@@ -57215,7 +57308,7 @@ function Users({
57215
57308
  selectOptions: selectOptions,
57216
57309
  setShowFilters: setShowFilters,
57217
57310
  sourcesKey: "authorId",
57218
- filtersConfig: selectFiltersConfig$8,
57311
+ filtersConfig: selectFiltersConfig$7,
57219
57312
  onFilterChange: onFiltersChange,
57220
57313
  showFilters: showFilters,
57221
57314
  defaultFilters: defaultFilters,
@@ -58406,7 +58499,9 @@ function AdminSubjectsScreen({
58406
58499
  breadcrumbs,
58407
58500
  refetchTrigger,
58408
58501
  getData,
58409
- user
58502
+ user,
58503
+ APP,
58504
+ apiUrl
58410
58505
  } = config;
58411
58506
  const handleMergeSubjects = React.useCallback(async mergeData => {
58412
58507
  try {
@@ -58454,7 +58549,9 @@ function AdminSubjectsScreen({
58454
58549
  }
58455
58550
  },
58456
58551
  user: user,
58457
- options: options
58552
+ options: options,
58553
+ APP: APP,
58554
+ apiUrl: apiUrl
58458
58555
  });
58459
58556
  }
58460
58557
 
@@ -58478,7 +58575,9 @@ function AdminLocationScreen$1({
58478
58575
  breadcrumbs,
58479
58576
  refetchTrigger,
58480
58577
  getData,
58481
- user
58578
+ user,
58579
+ APP,
58580
+ apiUrl
58482
58581
  } = config;
58483
58582
  const handleMergeLocations = React.useCallback(async mergeData => {
58484
58583
  try {
@@ -58526,50 +58625,33 @@ function AdminLocationScreen$1({
58526
58625
  }
58527
58626
  },
58528
58627
  user: user,
58529
- options: options
58628
+ options: options,
58629
+ APP: APP,
58630
+ apiUrl: apiUrl
58530
58631
  });
58531
58632
  }
58532
58633
 
58533
- const selectFiltersConfig$7 = {
58534
- category: {
58535
- type: "select",
58536
- label: "Category",
58537
- placeholder: t => t("Category"),
58538
- style: {
58539
- flex: 1
58540
- },
58541
- labelStyle: {
58542
- flex: 1
58543
- },
58544
- getLabel: option => option.label,
58545
- getValue: option => option.value
58546
- },
58547
- country: {
58548
- type: "select",
58549
- label: "Country",
58550
- placeholder: t => t("Country"),
58551
- style: {
58552
- flex: 1
58553
- },
58554
- labelStyle: {
58555
- flex: 1
58556
- },
58557
- getLabel: option => option.label,
58558
- getValue: option => option.value
58559
- },
58560
- sources: {
58561
- type: "select",
58562
- label: "Sources",
58563
- placeholder: t => t("Sources"),
58564
- style: {
58565
- flex: 1
58566
- },
58567
- labelStyle: {
58568
- flex: 1
58569
- },
58570
- getLabel: option => option.label,
58571
- getValue: option => option.value
58572
- }
58634
+ const getFiltersConfig$1 = ({
58635
+ t
58636
+ }) => {
58637
+ return {
58638
+ timeframe: {
58639
+ type: "timeframe",
58640
+ label: "Timeframe",
58641
+ style: {
58642
+ flex: 1
58643
+ }
58644
+ }
58645
+ };
58646
+ };
58647
+ const getFilterOptions$1 = (options, t) => {
58648
+ const {
58649
+ timeframe = []
58650
+ } = options || {};
58651
+ const _default = {
58652
+ timeframe: timeframe
58653
+ };
58654
+ return _default;
58573
58655
  };
58574
58656
  const filtersConfig$8 = {
58575
58657
  name: "",
@@ -58701,7 +58783,9 @@ function DocumentsTable({
58701
58783
  breadcrumbs,
58702
58784
  refetchTrigger,
58703
58785
  user,
58704
- options
58786
+ options,
58787
+ APP,
58788
+ apiUrl
58705
58789
  }) {
58706
58790
  const [showFilters, setShowFilters] = React.useState(false);
58707
58791
  const [hasError, setHasError] = React.useState(false);
@@ -58709,6 +58793,14 @@ function DocumentsTable({
58709
58793
  const {
58710
58794
  token
58711
58795
  } = useToken$1();
58796
+ const selectFiltersConfig = React.useMemo(() => {
58797
+ return getFiltersConfig$1({
58798
+ t
58799
+ });
58800
+ }, [t]);
58801
+ const filterOptions = React.useMemo(() => {
58802
+ return getFilterOptions$1(options);
58803
+ }, [options, t]);
58712
58804
  const {
58713
58805
  filter,
58714
58806
  activeTab,
@@ -58721,7 +58813,7 @@ function DocumentsTable({
58721
58813
  } = useSubjectsAdminTable({
58722
58814
  goTo,
58723
58815
  location,
58724
- selectFiltersConfig: selectFiltersConfig$7,
58816
+ selectFiltersConfig,
58725
58817
  view,
58726
58818
  defaultUrlParams: defaultUrlParams$1,
58727
58819
  module,
@@ -58775,7 +58867,7 @@ function DocumentsTable({
58775
58867
  hasError: hasError,
58776
58868
  setHasError: setHasError,
58777
58869
  canClearSearch: canClearSearch,
58778
- selectOptions: selectOptions,
58870
+ selectOptions: filterOptions,
58779
58871
  checkboxConfig: checkboxConfig$8,
58780
58872
  defaultTableFilters: {},
58781
58873
  breadcrumbs: breadcrumbs,
@@ -58805,14 +58897,16 @@ function DocumentsTable({
58805
58897
  hideOnLoading: false,
58806
58898
  pagination: filter.pagination,
58807
58899
  rowKey: "id",
58808
- selectOptions: selectOptions,
58900
+ selectOptions: filterOptions,
58809
58901
  doEmptyRows: true,
58810
58902
  setShowFilters: setShowFilters,
58811
- filtersConfig: selectFiltersConfig$7,
58903
+ filtersConfig: selectFiltersConfig,
58812
58904
  onFilterChange: filter.onFiltersChange,
58813
58905
  showFilters: showFilters,
58814
58906
  defaultFilters: filter.defaultFilters,
58815
- onChange: filter.onTableChange
58907
+ onChange: filter.onTableChange,
58908
+ app: APP,
58909
+ apiUrl: apiUrl
58816
58910
  })]
58817
58911
  })
58818
58912
  });
@@ -58838,7 +58932,9 @@ function AdminLocationScreen({
58838
58932
  breadcrumbs,
58839
58933
  refetchTrigger,
58840
58934
  getData,
58841
- user
58935
+ user,
58936
+ APP,
58937
+ apiUrl
58842
58938
  } = config;
58843
58939
  const getSubjects = React.useCallback(params => {
58844
58940
  if (getData) {
@@ -58869,18 +58965,20 @@ function AdminLocationScreen({
58869
58965
  }
58870
58966
  },
58871
58967
  user: user,
58872
- options: options
58968
+ options: options,
58969
+ APP: APP,
58970
+ apiUrl: apiUrl
58873
58971
  });
58874
58972
  }
58875
58973
 
58876
- const getSelectFiltersConfig = ({
58974
+ const getFiltersConfig = ({
58877
58975
  t
58878
58976
  }) => {
58879
58977
  return {
58880
- eventsType: {
58881
- type: "select",
58882
- label: "type",
58883
- placeholder: t("type"),
58978
+ typeOfEvent: {
58979
+ type: 'select',
58980
+ label: 'type',
58981
+ placeholder: t => `${t('Filter by')} ${t('type').toLowerCase()}`,
58884
58982
  style: {
58885
58983
  flex: 1
58886
58984
  },
@@ -58892,6 +58990,14 @@ const getSelectFiltersConfig = ({
58892
58990
  }
58893
58991
  };
58894
58992
  };
58993
+ const getFilterOptions = (options, t) => {
58994
+ const {
58995
+ eventsType
58996
+ } = options || {};
58997
+ return {
58998
+ typeOfEvent: eventsType || []
58999
+ };
59000
+ };
58895
59001
  const filtersConfig$7 = {
58896
59002
  name: "",
58897
59003
  datastakeId: ""
@@ -59043,7 +59149,9 @@ function EventsTable({
59043
59149
  breadcrumbs,
59044
59150
  refetchTrigger,
59045
59151
  user,
59046
- options
59152
+ options,
59153
+ APP,
59154
+ apiUrl
59047
59155
  }) {
59048
59156
  const [showFilters, setShowFilters] = React.useState(false);
59049
59157
  const [hasError, setHasError] = React.useState(false);
@@ -59052,10 +59160,13 @@ function EventsTable({
59052
59160
  token
59053
59161
  } = useToken();
59054
59162
  const selectFiltersConfig = React.useMemo(() => {
59055
- return getSelectFiltersConfig({
59163
+ return getFiltersConfig({
59056
59164
  t
59057
59165
  });
59058
59166
  }, [t]);
59167
+ const filterOptions = React.useMemo(() => {
59168
+ return getFilterOptions(options);
59169
+ }, [options, t]);
59059
59170
  const {
59060
59171
  filter,
59061
59172
  activeTab,
@@ -59119,7 +59230,7 @@ function EventsTable({
59119
59230
  hasError: hasError,
59120
59231
  setHasError: setHasError,
59121
59232
  canClearSearch: canClearSearch,
59122
- selectOptions: selectOptions,
59233
+ selectOptions: filterOptions,
59123
59234
  checkboxConfig: checkboxConfig$7,
59124
59235
  defaultTableFilters: {},
59125
59236
  breadcrumbs: breadcrumbs,
@@ -59149,14 +59260,16 @@ function EventsTable({
59149
59260
  hideOnLoading: false,
59150
59261
  pagination: filter.pagination,
59151
59262
  rowKey: "id",
59152
- selectOptions: selectOptions,
59263
+ selectOptions: filterOptions,
59153
59264
  doEmptyRows: true,
59154
59265
  setShowFilters: setShowFilters,
59155
59266
  filtersConfig: selectFiltersConfig,
59156
59267
  onFilterChange: filter.onFiltersChange,
59157
59268
  showFilters: showFilters,
59158
59269
  defaultFilters: filter.defaultFilters,
59159
- onChange: filter.onTableChange
59270
+ onChange: filter.onTableChange,
59271
+ app: APP,
59272
+ apiUrl: apiUrl
59160
59273
  })]
59161
59274
  })
59162
59275
  });
@@ -59182,7 +59295,9 @@ function AdminEventsScreen({
59182
59295
  breadcrumbs,
59183
59296
  refetchTrigger,
59184
59297
  getData,
59185
- user
59298
+ user,
59299
+ APP,
59300
+ apiUrl
59186
59301
  } = config;
59187
59302
  const getSubjects = React.useCallback(params => {
59188
59303
  if (getData) {
@@ -59210,7 +59325,9 @@ function AdminEventsScreen({
59210
59325
  options: options
59211
59326
  },
59212
59327
  user: user,
59213
- options: options
59328
+ options: options,
59329
+ APP: APP,
59330
+ apiUrl: apiUrl
59214
59331
  });
59215
59332
  }
59216
59333
 
@@ -64302,6 +64419,32 @@ function MissingTagButton(_ref) {
64302
64419
  });
64303
64420
  }
64304
64421
 
64422
+ const SingleTruncatedLine = _ref => {
64423
+ let {
64424
+ data = []
64425
+ } = _ref;
64426
+ const displayText = data === null || data === void 0 ? void 0 : data.join(", ");
64427
+ const tooltipText = data === null || data === void 0 ? void 0 : data.join("\n");
64428
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
64429
+ title: /*#__PURE__*/jsxRuntime.jsx("div", {
64430
+ style: {
64431
+ whiteSpace: "pre-line"
64432
+ },
64433
+ children: tooltipText
64434
+ }),
64435
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
64436
+ style: {
64437
+ fontWeight: "normal",
64438
+ overflow: "hidden",
64439
+ textOverflow: "ellipsis",
64440
+ whiteSpace: "nowrap",
64441
+ maxWidth: "100%"
64442
+ },
64443
+ children: displayText
64444
+ })
64445
+ });
64446
+ };
64447
+
64305
64448
  var Style$5 = styled__default["default"].div`
64306
64449
  display: flex;
64307
64450
  flex-direction: column;
@@ -65702,6 +65845,7 @@ exports.SettingsView = SettingsView;
65702
65845
  exports.Sidenav = Sidenav;
65703
65846
  exports.SidenavMenu = SidenavMenu;
65704
65847
  exports.SimpleGlobe = SimpleGlobe;
65848
+ exports.SingleTruncatedLine = SingleTruncatedLine;
65705
65849
  exports.StackChart = StackChart;
65706
65850
  exports.StakeholderMappings = index;
65707
65851
  exports.StatCard = StatCard;