datastake-daf 0.6.804 → 0.6.805

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 +1481 -1167
  2. package/dist/layouts/index.js +2 -2
  3. package/dist/pages/index.js +316 -66
  4. package/dist/utils/index.js +6 -0
  5. package/package.json +1 -1
  6. package/src/@daf/core/components/EditForm/RenderForm.js +13 -1
  7. package/src/@daf/core/components/EditForm/_index.scss +4 -3
  8. package/src/@daf/core/components/EditForm/components/DataLink/flat.js +9 -2
  9. package/src/@daf/core/components/EditForm/components/DataLink/index.js +8 -1
  10. package/src/@daf/core/components/EditForm/components/DataLinkGroup/index.js +8 -1
  11. package/src/@daf/core/components/EditForm/components/Repeatable/index.js +11 -1
  12. package/src/@daf/core/components/EditForm/context/index.js +9 -0
  13. package/src/@daf/core/components/EditForm/form.jsx +5 -1
  14. package/src/@daf/core/components/EditForm/helper.js +25 -3
  15. package/src/@daf/core/components/Header/hook.js +4 -4
  16. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/columns.js +3 -3
  17. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/helper.js +3 -3
  18. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineLocation/index.jsx +3 -3
  19. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/columns.js +3 -3
  20. package/src/@daf/core/components/Screens/Admin/AdminModals/CombineSubjects/index.jsx +3 -3
  21. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/column.js +3 -3
  22. package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/helper.js +1 -8
  23. package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/columns.js +3 -3
  24. package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/helper.js +1 -8
  25. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/helpers.js +3 -6
  26. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewLocation/index.jsx +2 -2
  27. package/src/@daf/core/components/Screens/Admin/AdminViews/ViewStakeholder/index.jsx +2 -1
  28. package/src/@daf/core/components/ViewForm/components/DataLink/flat.js +11 -1
  29. package/src/@daf/core/components/ViewForm/components/DataLink/index.js +11 -1
  30. package/src/@daf/core/components/ViewForm/components/DataLinkGroup/index.js +11 -1
  31. package/src/@daf/core/components/ViewForm/content.jsx +51 -28
  32. package/src/@daf/core/components/ViewForm/context/index.js +80 -0
  33. package/src/@daf/pages/Dashboards/SelfAssesment/components/AssociatedInformation/columns.js +9 -5
  34. package/src/@daf/pages/Dashboards/SelfAssesment/components/AssociatedInformation/index.jsx +15 -3
  35. package/src/@daf/pages/Dashboards/SelfAssesment/components/OrganisationInformation/columns.js +2 -2
  36. package/src/@daf/pages/Dashboards/SelfAssesment/components/OrganisationInformation/index.jsx +9 -5
  37. package/src/@daf/pages/Dashboards/SelfAssesment/index.jsx +1 -1
  38. package/src/@daf/pages/Edit/index.jsx +1 -0
  39. package/src/@daf/pages/Locations/MineSite/columns.js +5 -5
  40. package/src/@daf/pages/Stakeholders/Operators/columns.js +6 -8
  41. package/src/@daf/pages/View/index.jsx +1 -0
  42. package/src/helpers/adminLevels.js +4 -0
  43. package/src/utils.js +3 -1
  44. package/dist/style/datastake/mapbox-gl.css +0 -330
@@ -4778,7 +4778,7 @@ const config$2 = {
4778
4778
  Down: config$3
4779
4779
  };
4780
4780
 
4781
- const _excluded$H = ["width", "height", "size", "name", "fill"];
4781
+ const _excluded$G = ["width", "height", "size", "name", "fill"];
4782
4782
  const CustomIcon = _ref => {
4783
4783
  let {
4784
4784
  width = 14,
@@ -4787,7 +4787,7 @@ const CustomIcon = _ref => {
4787
4787
  name = "",
4788
4788
  fill = "none"
4789
4789
  } = _ref,
4790
- props = _objectWithoutProperties(_ref, _excluded$H);
4790
+ props = _objectWithoutProperties(_ref, _excluded$G);
4791
4791
  const conf = config$2[name];
4792
4792
  if (conf) {
4793
4793
  return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread2(_objectSpread2({}, props), {}, {
@@ -5076,7 +5076,7 @@ createCommonjsModule(function (module, exports) {
5076
5076
  !function(e,n){module.exports=n();}(commonjsGlobal,(function(){return {name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var n=["th","st","nd","rd"],t=e%100;return "["+e+(n[(t-20)%10]||n[t]||n[0])+"]"}}}));
5077
5077
  });
5078
5078
 
5079
- const _excluded$G = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
5079
+ const _excluded$F = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
5080
5080
  dayjs__default["default"].extend(customParseFormat);
5081
5081
  dayjs__default["default"].extend(utc);
5082
5082
  dayjs__default["default"].extend(utc);
@@ -5452,7 +5452,7 @@ const filterCreateData = data => {
5452
5452
  createdAt,
5453
5453
  updatedAt
5454
5454
  } = data,
5455
- rest = _objectWithoutProperties(data, _excluded$G);
5455
+ rest = _objectWithoutProperties(data, _excluded$F);
5456
5456
  const _meta = isObjectEmpty(meta) ? undefined : meta;
5457
5457
  return _objectSpread2(_objectSpread2({}, rest), {}, {
5458
5458
  meta: _meta
@@ -5848,7 +5848,7 @@ SelectFilters.propTypes = {
5848
5848
  apiUrl: PropTypes__default["default"].string
5849
5849
  };
5850
5850
 
5851
- const _excluded$F = ["columns", "data", "defaultFilters", "style", "pagination", "loading", "onChange", "onFilterChange", "selectOptions", "filtersConfig", "rowSelection", "setShowFilters", "rowKey", "showFilters", "hideOnLoading", "sourcesKey", "className", "projects", "t", "selectedProject", "sourceId", "projectSources", "language", "scrollX", "apiUrl", "app", "doEmptyRows"];
5851
+ const _excluded$E = ["columns", "data", "defaultFilters", "style", "pagination", "loading", "onChange", "onFilterChange", "selectOptions", "filtersConfig", "rowSelection", "setShowFilters", "rowKey", "showFilters", "hideOnLoading", "sourcesKey", "className", "projects", "t", "selectedProject", "sourceId", "projectSources", "language", "scrollX", "apiUrl", "app", "doEmptyRows"];
5852
5852
  function DAFTable(_ref) {
5853
5853
  let {
5854
5854
  columns = [],
@@ -5879,7 +5879,7 @@ function DAFTable(_ref) {
5879
5879
  app,
5880
5880
  doEmptyRows
5881
5881
  } = _ref,
5882
- rest = _objectWithoutProperties(_ref, _excluded$F);
5882
+ rest = _objectWithoutProperties(_ref, _excluded$E);
5883
5883
  const [source, setSource] = React.useState([]);
5884
5884
  const projectData = (projects || []).find(p => p.id === selectedProject);
5885
5885
  const [filtersInit, setFiltersInit] = React.useState(!loading);
@@ -6697,7 +6697,7 @@ function ComponentWithFocus(_ref) {
6697
6697
  }
6698
6698
 
6699
6699
  var _templateObject$h;
6700
- const _excluded$E = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
6700
+ const _excluded$D = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
6701
6701
  function StickyTable(_ref) {
6702
6702
  let {
6703
6703
  size = "small",
@@ -6708,7 +6708,7 @@ function StickyTable(_ref) {
6708
6708
  pagination = false,
6709
6709
  doEmptyRows = true
6710
6710
  } = _ref,
6711
- props = _objectWithoutProperties(_ref, _excluded$E);
6711
+ props = _objectWithoutProperties(_ref, _excluded$D);
6712
6712
  const data = React__default["default"].useMemo(() => {
6713
6713
  if (!doEmptyRows) {
6714
6714
  return dataSource;
@@ -7236,7 +7236,7 @@ const BTN_SIZE = {
7236
7236
  LG: 'large'
7237
7237
  };
7238
7238
 
7239
- const _excluded$D = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
7239
+ const _excluded$C = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
7240
7240
  function DafButton(_ref) {
7241
7241
  let {
7242
7242
  content = '',
@@ -7250,7 +7250,7 @@ function DafButton(_ref) {
7250
7250
  style = {},
7251
7251
  className = ''
7252
7252
  } = _ref,
7253
- restProps = _objectWithoutProperties(_ref, _excluded$D);
7253
+ restProps = _objectWithoutProperties(_ref, _excluded$C);
7254
7254
  return /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
7255
7255
  icon: icon,
7256
7256
  type: type,
@@ -7369,12 +7369,12 @@ const Style$R = styled__default["default"].div`
7369
7369
  }
7370
7370
  `;
7371
7371
 
7372
- const _excluded$C = ["children"];
7372
+ const _excluded$B = ["children"];
7373
7373
  const BorderedButton = _ref => {
7374
7374
  let {
7375
7375
  children
7376
7376
  } = _ref,
7377
- props = _objectWithoutProperties(_ref, _excluded$C);
7377
+ props = _objectWithoutProperties(_ref, _excluded$B);
7378
7378
  return /*#__PURE__*/jsxRuntime.jsx(Style$R, {
7379
7379
  className: "d-btn-cont",
7380
7380
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({}, props), {}, {
@@ -7514,12 +7514,12 @@ Badge.propTypes = {
7514
7514
  props: PropTypes__default["default"].object
7515
7515
  };
7516
7516
 
7517
- const _excluded$B = ["icon"];
7517
+ const _excluded$A = ["icon"];
7518
7518
  function GetIcon(_ref) {
7519
7519
  let {
7520
7520
  icon
7521
7521
  } = _ref,
7522
- props = _objectWithoutProperties(_ref, _excluded$B);
7522
+ props = _objectWithoutProperties(_ref, _excluded$A);
7523
7523
  let Icon = Icons__namespace.CloseOutlined;
7524
7524
  if (Icons__namespace[icon]) {
7525
7525
  Icon = Icons__namespace[icon];
@@ -7849,7 +7849,7 @@ const MultiSelectStyled = styled__default["default"](antd.Select)`
7849
7849
  }
7850
7850
  `;
7851
7851
 
7852
- const _excluded$A = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
7852
+ const _excluded$z = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
7853
7853
  const {
7854
7854
  useToken: useToken$n
7855
7855
  } = antd.theme;
@@ -7942,7 +7942,7 @@ function Multiselect(_ref) {
7942
7942
  isSingle = false,
7943
7943
  selectionType = SELECTION_TYPES.DEFAULT
7944
7944
  } = _ref,
7945
- restProps = _objectWithoutProperties(_ref, _excluded$A);
7945
+ restProps = _objectWithoutProperties(_ref, _excluded$z);
7946
7946
  const {
7947
7947
  token
7948
7948
  } = useToken$n();
@@ -8333,8 +8333,8 @@ const useHeader = _ref => {
8333
8333
  setShowFilters(p => !p);
8334
8334
  }
8335
8335
  }];
8336
- const actionButtons = onDownload && _actionButtons.length < 3 ? [..._actionButtons, ...(hasFilters ? filterButton : []), downloadButton] : [..._actionButtons, ...(hasFilters ? filterButton : [])];
8337
- const extraButtons = onDownload && _actionButtons.length >= 3 ? [..._extraButtons, downloadButtonAction] : [..._extraButtons];
8336
+ const actionButtons = onDownload && (_actionButtons === null || _actionButtons === void 0 ? void 0 : _actionButtons.length) < 3 ? [...(_actionButtons !== null && _actionButtons !== void 0 && _actionButtons.length ? _actionButtons : []), ...(hasFilters ? filterButton : []), downloadButton] : [...(_actionButtons !== null && _actionButtons !== void 0 && _actionButtons.length ? _actionButtons : []), ...(hasFilters ? filterButton : [])];
8337
+ const extraButtons = onDownload && (_actionButtons === null || _actionButtons === void 0 ? void 0 : _actionButtons.length) >= 3 ? [..._extraButtons, downloadButtonAction] : [..._extraButtons];
8338
8338
  const mainCont = React.useRef();
8339
8339
  const buttonCont = React.useRef();
8340
8340
  const [mainContWidth, setMainContWidth] = React.useState(600);
@@ -8662,7 +8662,7 @@ DAFHeader.propTypes = {
8662
8662
  filtersConfig: PropTypes__default["default"].any
8663
8663
  };
8664
8664
 
8665
- const _excluded$z = ["tabs", "onChange", "value", "className"];
8665
+ const _excluded$y = ["tabs", "onChange", "value", "className"];
8666
8666
  function TabsHeader(_ref) {
8667
8667
  let {
8668
8668
  tabs = [],
@@ -8670,7 +8670,7 @@ function TabsHeader(_ref) {
8670
8670
  value = '',
8671
8671
  className = 'mt-2'
8672
8672
  } = _ref,
8673
- rest = _objectWithoutProperties(_ref, _excluded$z);
8673
+ rest = _objectWithoutProperties(_ref, _excluded$y);
8674
8674
  return /*#__PURE__*/jsxRuntime.jsx("div", {
8675
8675
  className: formatClassname(['daf-tabs-header pl-6 pr-6', className]),
8676
8676
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Tabs, _objectSpread2({
@@ -8767,7 +8767,7 @@ DrawerHeader.propTypes = {
8767
8767
  tabsConfig: PropTypes__default["default"].any
8768
8768
  };
8769
8769
 
8770
- const _excluded$y = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
8770
+ const _excluded$x = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
8771
8771
  const useFooter = _ref => {
8772
8772
  let {
8773
8773
  leftContent,
@@ -8802,7 +8802,7 @@ const useFooter = _ref => {
8802
8802
  style = {},
8803
8803
  className = ""
8804
8804
  } = button,
8805
- restProps = _objectWithoutProperties(button, _excluded$y);
8805
+ restProps = _objectWithoutProperties(button, _excluded$x);
8806
8806
  return /*#__PURE__*/jsxRuntime.jsx(DafButton, _objectSpread2({
8807
8807
  content: label,
8808
8808
  type: type,
@@ -11683,7 +11683,7 @@ Widget.propTypes = {
11683
11683
  };
11684
11684
  Widget.displayName = 'Widget';
11685
11685
 
11686
- const _excluded$x = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
11686
+ const _excluded$w = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
11687
11687
  function ImageWidget(_ref) {
11688
11688
  let {
11689
11689
  loading = false,
@@ -11694,7 +11694,7 @@ function ImageWidget(_ref) {
11694
11694
  noDescriptionText,
11695
11695
  isPdf = false
11696
11696
  } = _ref,
11697
- props = _objectWithoutProperties(_ref, _excluded$x);
11697
+ props = _objectWithoutProperties(_ref, _excluded$w);
11698
11698
  const expandable = isPdf ? false : props.expandable;
11699
11699
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
11700
11700
  loading: loading,
@@ -11754,7 +11754,7 @@ function ImageWidget(_ref) {
11754
11754
  ImageWidget.displayName = 'ImageWidget';
11755
11755
 
11756
11756
  var _templateObject$e;
11757
- const _excluded$w = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
11757
+ const _excluded$v = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
11758
11758
  function FlowWidget(_ref) {
11759
11759
  let {
11760
11760
  title,
@@ -11766,7 +11766,7 @@ function FlowWidget(_ref) {
11766
11766
  className,
11767
11767
  direction = "horizontal"
11768
11768
  } = _ref,
11769
- rest = _objectWithoutProperties(_ref, _excluded$w);
11769
+ rest = _objectWithoutProperties(_ref, _excluded$v);
11770
11770
  const [activeTab, setActiveTab] = React.useState();
11771
11771
  React.useEffect(() => {
11772
11772
  if (defaultActiveTab) {
@@ -15482,7 +15482,7 @@ Map$3.propTypes = {
15482
15482
  link: PropTypes__default["default"].any
15483
15483
  };
15484
15484
 
15485
- const _excluded$v = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
15485
+ const _excluded$u = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
15486
15486
  function InExpandableWidgetMap(_ref) {
15487
15487
  let {
15488
15488
  isExpanded,
@@ -15496,7 +15496,7 @@ function InExpandableWidgetMap(_ref) {
15496
15496
  height,
15497
15497
  widgetConfig
15498
15498
  } = _ref,
15499
- rest = _objectWithoutProperties(_ref, _excluded$v);
15499
+ rest = _objectWithoutProperties(_ref, _excluded$u);
15500
15500
  const [mapKey, setMapKey] = React.useState(0);
15501
15501
  const [isMapReady, setIsMapReady] = React.useState(false);
15502
15502
  React.useEffect(() => {
@@ -17696,14 +17696,14 @@ const MapConfig = ({
17696
17696
  });
17697
17697
  };
17698
17698
 
17699
- const _excluded$u = ["config", "title", "loading"];
17699
+ const _excluded$t = ["config", "title", "loading"];
17700
17700
  const Details = _ref => {
17701
17701
  let {
17702
17702
  config = [],
17703
17703
  title,
17704
17704
  loading = false
17705
17705
  } = _ref,
17706
- rest = _objectWithoutProperties(_ref, _excluded$u);
17706
+ rest = _objectWithoutProperties(_ref, _excluded$t);
17707
17707
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
17708
17708
  className: "with-border-header h-w-btn-header card",
17709
17709
  loading: loading,
@@ -17719,14 +17719,14 @@ const Details = _ref => {
17719
17719
  }));
17720
17720
  };
17721
17721
 
17722
- const _excluded$t = ["config", "title", "loading"];
17722
+ const _excluded$s = ["config", "title", "loading"];
17723
17723
  const KeyIndicatorsDetails = _ref => {
17724
17724
  let {
17725
17725
  config,
17726
17726
  title,
17727
17727
  loading = false
17728
17728
  } = _ref,
17729
- rest = _objectWithoutProperties(_ref, _excluded$t);
17729
+ rest = _objectWithoutProperties(_ref, _excluded$s);
17730
17730
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
17731
17731
  className: "with-border-header h-w-btn-header",
17732
17732
  title: title,
@@ -17756,7 +17756,7 @@ const Style$G = styled__default["default"].div`
17756
17756
  }
17757
17757
  `;
17758
17758
 
17759
- const _excluded$s = ["children", "config", "detailsTitle", "firstColumnWidth"];
17759
+ const _excluded$r = ["children", "config", "detailsTitle", "firstColumnWidth"];
17760
17760
  const DetailsSection = _ref => {
17761
17761
  let {
17762
17762
  children,
@@ -17764,7 +17764,7 @@ const DetailsSection = _ref => {
17764
17764
  detailsTitle,
17765
17765
  firstColumnWidth = "250px"
17766
17766
  } = _ref,
17767
- rest = _objectWithoutProperties(_ref, _excluded$s);
17767
+ rest = _objectWithoutProperties(_ref, _excluded$r);
17768
17768
  return /*#__PURE__*/jsxRuntime.jsx(Style$G, {
17769
17769
  firstColumnWidth: firstColumnWidth,
17770
17770
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -17940,14 +17940,14 @@ const getGoalConfig = () => {
17940
17940
  };
17941
17941
 
17942
17942
  var _templateObject$c;
17943
- const _excluded$r = ["title", "activeSdgGoals", "t"];
17943
+ const _excluded$q = ["title", "activeSdgGoals", "t"];
17944
17944
  function SDGWidget(_ref) {
17945
17945
  let {
17946
17946
  title = "Sustainable Development Goals",
17947
17947
  activeSdgGoals = [],
17948
17948
  t = key => key
17949
17949
  } = _ref,
17950
- props = _objectWithoutProperties(_ref, _excluded$r);
17950
+ props = _objectWithoutProperties(_ref, _excluded$q);
17951
17951
  const sdgConfig = getGoalConfig();
17952
17952
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
17953
17953
  title: title,
@@ -18245,7 +18245,7 @@ function SdgList({
18245
18245
  });
18246
18246
  }
18247
18247
 
18248
- const _excluded$q = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
18248
+ const _excluded$p = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
18249
18249
  const {
18250
18250
  Meta
18251
18251
  } = antd.Card;
@@ -18265,7 +18265,7 @@ function ProjectWidget(_ref) {
18265
18265
  hideSDGList = false,
18266
18266
  t = x => x
18267
18267
  } = _ref,
18268
- props = _objectWithoutProperties(_ref, _excluded$q);
18268
+ props = _objectWithoutProperties(_ref, _excluded$p);
18269
18269
  const [isHovered, setIsHovered] = React__default["default"].useState(false);
18270
18270
  const {
18271
18271
  token
@@ -18537,13 +18537,13 @@ const WidgetCard = _ref => {
18537
18537
  });
18538
18538
  };
18539
18539
 
18540
- const _excluded$p = ["title", "children"];
18540
+ const _excluded$o = ["title", "children"];
18541
18541
  const CarouselWidget = /*#__PURE__*/React.forwardRef((_ref, ref) => {
18542
18542
  let {
18543
18543
  title,
18544
18544
  children
18545
18545
  } = _ref,
18546
- rest = _objectWithoutProperties(_ref, _excluded$p);
18546
+ rest = _objectWithoutProperties(_ref, _excluded$o);
18547
18547
  /**
18548
18548
  * Handles carousel slide change events
18549
18549
  * @param {number} currentSlide - The index of the current slide after change
@@ -18707,7 +18707,7 @@ const EmptyStateContainer = styled__default["default"].div`
18707
18707
  }
18708
18708
  `;
18709
18709
 
18710
- const _excluded$o = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
18710
+ const _excluded$n = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
18711
18711
  function ImageCarousel(_ref) {
18712
18712
  let {
18713
18713
  title,
@@ -18722,7 +18722,7 @@ function ImageCarousel(_ref) {
18722
18722
  emptyLogo = antd.Empty.PRESENTED_IMAGE_SIMPLE,
18723
18723
  emptyText = "No Image"
18724
18724
  } = _ref,
18725
- rest = _objectWithoutProperties(_ref, _excluded$o);
18725
+ rest = _objectWithoutProperties(_ref, _excluded$n);
18726
18726
  const [previewVisible, setPreviewVisible] = React.useState(false);
18727
18727
  const [current, setCurrent] = React.useState(0);
18728
18728
  const carouselRef = React.useRef(null);
@@ -19091,7 +19091,7 @@ const getVegetationConfig = () => {
19091
19091
  };
19092
19092
 
19093
19093
  var _templateObject$a, _templateObject2$3;
19094
- const _excluded$n = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
19094
+ const _excluded$m = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
19095
19095
  function VegetationWidget(_ref) {
19096
19096
  let {
19097
19097
  title = "Vegetation Health",
@@ -19103,7 +19103,7 @@ function VegetationWidget(_ref) {
19103
19103
  growthObservations = [],
19104
19104
  t = key => key
19105
19105
  } = _ref,
19106
- props = _objectWithoutProperties(_ref, _excluded$n);
19106
+ props = _objectWithoutProperties(_ref, _excluded$m);
19107
19107
  let vegetationConfig = getVegetationConfig();
19108
19108
 
19109
19109
  // Get all VEGETATION_KEYS values before filtering (needed for mapping check)
@@ -19226,7 +19226,7 @@ const getFaunaConfig = () => {
19226
19226
  };
19227
19227
 
19228
19228
  var _templateObject$9, _templateObject2$2;
19229
- const _excluded$m = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19229
+ const _excluded$l = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19230
19230
  function FaunaWidget(_ref) {
19231
19231
  let {
19232
19232
  title = "Observed Fauna",
@@ -19237,7 +19237,7 @@ function FaunaWidget(_ref) {
19237
19237
  itemHeight = 100,
19238
19238
  t = key => key
19239
19239
  } = _ref,
19240
- props = _objectWithoutProperties(_ref, _excluded$m);
19240
+ props = _objectWithoutProperties(_ref, _excluded$l);
19241
19241
  let faunaConfig = getFaunaConfig();
19242
19242
 
19243
19243
  // Filter to show only specific keys if filterKeys is provided
@@ -19304,7 +19304,7 @@ const getInvasiveSpeciesConfig = () => {
19304
19304
  };
19305
19305
 
19306
19306
  var _templateObject$8, _templateObject2$1;
19307
- const _excluded$l = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19307
+ const _excluded$k = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19308
19308
  function InvasiveSpeciesWidget(_ref) {
19309
19309
  let {
19310
19310
  title = "Invasive Species",
@@ -19316,7 +19316,7 @@ function InvasiveSpeciesWidget(_ref) {
19316
19316
  itemHeight = 100,
19317
19317
  t = key => key
19318
19318
  } = _ref,
19319
- props = _objectWithoutProperties(_ref, _excluded$l);
19319
+ props = _objectWithoutProperties(_ref, _excluded$k);
19320
19320
  let invasiveSpeciesConfig = getInvasiveSpeciesConfig();
19321
19321
 
19322
19322
  // Filter to show only specific keys if filterKeys is provided
@@ -20334,6 +20334,81 @@ const renderDate = _ref2 => {
20334
20334
  return date.format('DD MMM YYYY').toString();
20335
20335
  };
20336
20336
 
20337
+ const ViewContext = /*#__PURE__*/React.createContext({
20338
+ user: null,
20339
+ isReview: false,
20340
+ t: s => s,
20341
+ errors: {},
20342
+ changeErrors: () => {},
20343
+ ajaxOptions: {},
20344
+ getAppHeader: () => {},
20345
+ getApiBaseUrl: () => {},
20346
+ changeAjaxOptions: () => {},
20347
+ changeAjaxForms: () => {},
20348
+ getMainApiUrl: () => {},
20349
+ app: null,
20350
+ ajaxForms: {},
20351
+ query: null,
20352
+ goTo: () => {},
20353
+ maxWidth: "75%",
20354
+ staticWidth: "614px",
20355
+ fullWidth: false
20356
+ });
20357
+ const ViewProvider = ({
20358
+ t,
20359
+ user,
20360
+ ajaxForms,
20361
+ isReview,
20362
+ children,
20363
+ ajaxOptions,
20364
+ highlightMandatory,
20365
+ getAppHeader,
20366
+ getApiBaseUrl,
20367
+ changeAjaxOptions,
20368
+ getMainApiUrl,
20369
+ app,
20370
+ query,
20371
+ goTo,
20372
+ errors,
20373
+ changeErrors,
20374
+ changeAjaxForms,
20375
+ evaluationConfig,
20376
+ maxWidth,
20377
+ staticWidth,
20378
+ fullWidth
20379
+ }) => {
20380
+ const values = {
20381
+ t,
20382
+ errors,
20383
+ changeErrors,
20384
+ user,
20385
+ ajaxForms,
20386
+ isReview,
20387
+ changeAjaxOptions,
20388
+ getMainApiUrl,
20389
+ ajaxOptions,
20390
+ highlightMandatory,
20391
+ app,
20392
+ changeAjaxForms,
20393
+ getAppHeader,
20394
+ getApiBaseUrl,
20395
+ query,
20396
+ evaluationConfig,
20397
+ goTo,
20398
+ maxWidth,
20399
+ staticWidth,
20400
+ fullWidth
20401
+ };
20402
+ return /*#__PURE__*/jsxRuntime.jsx(ViewContext.Provider, {
20403
+ value: values,
20404
+ children: children
20405
+ });
20406
+ };
20407
+ const useViewContext = () => {
20408
+ const values = React.useContext(ViewContext);
20409
+ return values;
20410
+ };
20411
+
20337
20412
  function DataLink$1({
20338
20413
  form = {},
20339
20414
  values,
@@ -20349,6 +20424,11 @@ function DataLink$1({
20349
20424
  getToken,
20350
20425
  app
20351
20426
  }) {
20427
+ const {
20428
+ maxWidth,
20429
+ staticWidth,
20430
+ fullWidth
20431
+ } = useViewContext();
20352
20432
  const isSingle = React.useMemo(() => form?.meta?.maxRepeat === 1, [form]);
20353
20433
  const [modalRow, setModalRow] = React.useState(null);
20354
20434
  const [linkingData, setLinkingData] = React.useState({});
@@ -20669,7 +20749,11 @@ function DataLink$1({
20669
20749
  }], [mapKey, inputs, tableKeys, ajaxModalValues]);
20670
20750
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
20671
20751
  className: formatClassname(['data-link-cont mt-2', noBody && 'no-body']),
20672
- style: form?.meta?.style,
20752
+ style: {
20753
+ ...form?.meta?.style,
20754
+ maxWidth: fullWidth ? "unset" : maxWidth,
20755
+ width: fullWidth ? "100%" : maxWidth
20756
+ },
20673
20757
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
20674
20758
  className: "daf-table-wrapper no-padding repeatable-form-table no-pagination",
20675
20759
  children: /*#__PURE__*/jsxRuntime.jsx(antd.ConfigProvider, {
@@ -21619,6 +21703,11 @@ function DataLinkGroup$1({
21619
21703
  getToken,
21620
21704
  app
21621
21705
  }) {
21706
+ const {
21707
+ maxWidth,
21708
+ staticWidth,
21709
+ fullWidth
21710
+ } = useViewContext();
21622
21711
  const dataLinkKey = React.useMemo(() => Object.keys(form?.inputs || {}).find(k => form?.inputs[k]?.type === "dataLink"), [form]);
21623
21712
  const dataLinkInput = React.useMemo(() => (form?.inputs || {})[dataLinkKey], [form, dataLinkKey]);
21624
21713
  const otherInputs = React.useMemo(() => Object.keys(form?.inputs || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
@@ -21935,7 +22024,11 @@ function DataLinkGroup$1({
21935
22024
  }], [mapKey, inputs, tableKeys, ajaxModalValues]);
21936
22025
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
21937
22026
  className: formatClassname(['data-link-cont mt-2', noBody && 'no-body']),
21938
- style: dataLinkInput?.meta?.style,
22027
+ style: {
22028
+ ...dataLinkInput?.meta?.style,
22029
+ maxWidth: fullWidth ? "unset" : maxWidth,
22030
+ width: fullWidth ? "100%" : maxWidth
22031
+ },
21939
22032
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
21940
22033
  className: "daf-table-wrapper no-padding repeatable-form-table no-pagination",
21941
22034
  children: /*#__PURE__*/jsxRuntime.jsx(antd.ConfigProvider, {
@@ -22026,6 +22119,11 @@ function DataLinkFlat$1({
22026
22119
  getToken,
22027
22120
  app
22028
22121
  }) {
22122
+ const {
22123
+ maxWidth,
22124
+ staticWidth,
22125
+ fullWidth
22126
+ } = useViewContext();
22029
22127
  const isSingle = React.useMemo(() => form?.meta?.maxRepeat === 1, [form]);
22030
22128
  const [modalRow, setModalRow] = React.useState(null);
22031
22129
  const [linkingData, setLinkingData] = React.useState({});
@@ -22379,7 +22477,11 @@ function DataLinkFlat$1({
22379
22477
  }], [mapKey, inputs, tableKeys, ajaxModalValues]);
22380
22478
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
22381
22479
  className: formatClassname(['data-link-cont mt-2', noBody && 'no-body']),
22382
- style: form?.meta?.style,
22480
+ style: {
22481
+ ...form?.meta?.style,
22482
+ maxWidth: fullWidth ? "unset" : maxWidth,
22483
+ width: fullWidth ? "100%" : maxWidth
22484
+ },
22383
22485
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
22384
22486
  className: "daf-table-wrapper no-padding repeatable-form-table no-pagination",
22385
22487
  children: /*#__PURE__*/jsxRuntime.jsx(antd.ConfigProvider, {
@@ -22695,7 +22797,10 @@ const EditContext = /*#__PURE__*/React.createContext({
22695
22797
  app: null,
22696
22798
  ajaxForms: {},
22697
22799
  query: null,
22698
- goTo: () => {}
22800
+ goTo: () => {},
22801
+ maxWidth: "75%",
22802
+ staticWidth: "614px",
22803
+ fullWidth: false
22699
22804
  });
22700
22805
  const EditProvider = ({
22701
22806
  t,
@@ -22715,7 +22820,10 @@ const EditProvider = ({
22715
22820
  errors,
22716
22821
  changeErrors,
22717
22822
  changeAjaxForms,
22718
- evaluationConfig
22823
+ evaluationConfig,
22824
+ maxWidth,
22825
+ staticWidth,
22826
+ fullWidth
22719
22827
  }) => {
22720
22828
  const values = {
22721
22829
  t,
@@ -22734,7 +22842,10 @@ const EditProvider = ({
22734
22842
  getApiBaseUrl,
22735
22843
  query,
22736
22844
  evaluationConfig,
22737
- goTo
22845
+ goTo,
22846
+ maxWidth,
22847
+ staticWidth,
22848
+ fullWidth
22738
22849
  };
22739
22850
  return /*#__PURE__*/jsxRuntime.jsx(EditContext.Provider, {
22740
22851
  value: values,
@@ -24613,8 +24724,8 @@ const RepeatableModals = ({
24613
24724
  }) : null;
24614
24725
  };
24615
24726
 
24616
- const _excluded$k = ["viewGroup"],
24617
- _excluded2$2 = ["label", "icon", "position"];
24727
+ const _excluded$j = ["viewGroup"],
24728
+ _excluded2$1 = ["label", "icon", "position"];
24618
24729
  const Content$1 = _ref => {
24619
24730
  let {
24620
24731
  style = {},
@@ -24635,7 +24746,9 @@ const Content$1 = _ref => {
24635
24746
  getAppHeader,
24636
24747
  user,
24637
24748
  evaluationConfig = [],
24638
- fullWidth = false
24749
+ fullWidth = false,
24750
+ maxWidth = "75%",
24751
+ staticWidth = "614px"
24639
24752
  } = _ref;
24640
24753
  const groupSingle = grps => {
24641
24754
  const form = Object.keys(grps).reduce((f, gKey) => {
@@ -24682,7 +24795,7 @@ const Content$1 = _ref => {
24682
24795
  if (groups[gKey].viewGroup === key) {
24683
24796
  // eslint-disable-next-line no-unused-vars
24684
24797
  const _groups$gKey = groups[gKey],
24685
- gCfg = _objectWithoutProperties(_groups$gKey, _excluded$k);
24798
+ gCfg = _objectWithoutProperties(_groups$gKey, _excluded$j);
24686
24799
  items[gKey] = gCfg;
24687
24800
  }
24688
24801
  return items;
@@ -24808,6 +24921,9 @@ const Content$1 = _ref => {
24808
24921
  data: data,
24809
24922
  allData: data,
24810
24923
  linkingData: linkingData,
24924
+ maxWidth: maxWidth,
24925
+ staticWidth: staticWidth,
24926
+ fullWidth: fullWidth,
24811
24927
  className: isEven ? ind === _length - 1 || ind === _length - 2 ? "last" : undefined : ind === _length - 1 ? "last" : undefined,
24812
24928
  linkingForms: linkingForms,
24813
24929
  ajaxOptions: ajaxOptions,
@@ -24855,7 +24971,10 @@ const Content$1 = _ref => {
24855
24971
  linkingForms: linkingForms,
24856
24972
  ajaxOptions: ajaxOptions,
24857
24973
  evaluationConfig: evaluationConfig,
24858
- cols: 2
24974
+ cols: 2,
24975
+ maxWidth: maxWidth,
24976
+ staticWidth: staticWidth,
24977
+ fullWidth: fullWidth
24859
24978
  }, key)]
24860
24979
  }, key) : null;
24861
24980
  })
@@ -24904,7 +25023,7 @@ const Content$1 = _ref => {
24904
25023
  showIcon: true
24905
25024
  });
24906
25025
  }
24907
- let groups = _objectWithoutProperties(f, _excluded2$2);
25026
+ let groups = _objectWithoutProperties(f, _excluded2$1);
24908
25027
  groups = Object.keys(groups).reduce((items, key) => {
24909
25028
  var _groups$key2;
24910
25029
  if (!((_groups$key2 = groups[key]) !== null && _groups$key2 !== void 0 && (_groups$key2 = _groups$key2.meta) !== null && _groups$key2 !== void 0 && _groups$key2.excludeFromView)) {
@@ -24918,7 +25037,9 @@ const Content$1 = _ref => {
24918
25037
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
24919
25038
  className: "wrapper",
24920
25039
  style: {
24921
- width: fullWidth ? "100%" : 700
25040
+ width: "75%",
25041
+ display: "flex",
25042
+ justifyContent: "center"
24922
25043
  },
24923
25044
  children: [f.alertConf ? /*#__PURE__*/jsxRuntime.jsx(antd.Alert, {
24924
25045
  className: "w-100",
@@ -24933,14 +25054,27 @@ const Content$1 = _ref => {
24933
25054
  });
24934
25055
  }
24935
25056
  };
24936
- return /*#__PURE__*/jsxRuntime.jsx("div", {
24937
- className: "content",
24938
- style: style,
24939
- children: renderContent(form)
25057
+ return /*#__PURE__*/jsxRuntime.jsx(ViewProvider, {
25058
+ t: t,
25059
+ app: app,
25060
+ ajaxForms: ajaxForms,
25061
+ changeAjaxForms: changeAjaxForms,
25062
+ getApiBaseUrl: getApiBaseUrl,
25063
+ getAppHeader: getAppHeader,
25064
+ user: user,
25065
+ evaluationConfig: evaluationConfig,
25066
+ fullWidth: fullWidth,
25067
+ maxWidth: maxWidth,
25068
+ staticWidth: staticWidth,
25069
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
25070
+ className: "content",
25071
+ style: style,
25072
+ children: renderContent(form)
25073
+ })
24940
25074
  });
24941
25075
  };
24942
25076
 
24943
- const _excluded$j = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
25077
+ const _excluded$i = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
24944
25078
  function Modal(_ref) {
24945
25079
  let {
24946
25080
  t = text => text,
@@ -24956,7 +25090,7 @@ function Modal(_ref) {
24956
25090
  disabled = false,
24957
25091
  withModalFormWrapper = true
24958
25092
  } = _ref,
24959
- props = _objectWithoutProperties(_ref, _excluded$j);
25093
+ props = _objectWithoutProperties(_ref, _excluded$i);
24960
25094
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Modal, _objectSpread2(_objectSpread2({
24961
25095
  width: 650,
24962
25096
  footer: null,
@@ -29792,6 +29926,9 @@ function Repeatable({
29792
29926
  getAppHeader,
29793
29927
  app,
29794
29928
  highlightMandatory,
29929
+ maxWidth,
29930
+ staticWidth,
29931
+ fullWidth,
29795
29932
  ...rest
29796
29933
  } = useEditContext();
29797
29934
  const inputId = form?.dataId;
@@ -30057,7 +30194,11 @@ function Repeatable({
30057
30194
  };
30058
30195
  const preSelected = data.map(d => d.id).filter(d => !!d);
30059
30196
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
30060
- style: form?.meta?.style,
30197
+ style: {
30198
+ ...form?.meta?.style,
30199
+ maxWidth: fullWidth ? "unset" : maxWidth,
30200
+ width: fullWidth ? "100%" : staticWidth
30201
+ },
30061
30202
  className: formatClassname([form.repeatable ? "repeatable-section data-link-cont mb-6 pb-3" : '', noBody && 'no-body', isHighlighted && !noBody && 'highlighted']),
30062
30203
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
30063
30204
  className: "mb-4",
@@ -30258,6 +30399,9 @@ function Repeatable({
30258
30399
  // form: MainForm,
30259
30400
  // forms: options,
30260
30401
  // setFormValues: setValues,
30402
+ maxWidth,
30403
+ staticWidth,
30404
+ fullWidth,
30261
30405
  value: inputMeta.comment || '',
30262
30406
  onChange: val => {
30263
30407
  changeInputMeta({
@@ -30801,7 +30945,10 @@ const GroupContentFormItem = _ref4 => {
30801
30945
  app,
30802
30946
  getApiBaseUrl,
30803
30947
  getAppHeader,
30804
- isReview
30948
+ isReview,
30949
+ maxWidth,
30950
+ staticWidth,
30951
+ fullWidth
30805
30952
  } = useEditContext();
30806
30953
  const [isShown, setIsShown] = React.useState(!!(inputMeta !== null && inputMeta !== void 0 && inputMeta.comment));
30807
30954
  let maxRule = (_rules$find = rules.find(rule => rule.max)) === null || _rules$find === void 0 ? void 0 : _rules$find.max;
@@ -31282,7 +31429,10 @@ const GroupContentFormItem = _ref4 => {
31282
31429
  app: app,
31283
31430
  valueOnlyString: true
31284
31431
  }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](_objectSpread2(_objectSpread2({}, inputData), {}, {
31285
- name: inputId
31432
+ name: inputId,
31433
+ maxWidth,
31434
+ staticWidth,
31435
+ fullWidth
31286
31436
  }), {
31287
31437
  form: MainForm,
31288
31438
  forms: options,
@@ -31296,7 +31446,10 @@ const GroupContentFormItem = _ref4 => {
31296
31446
  t,
31297
31447
  getApiBaseUrl,
31298
31448
  getAppHeader,
31299
- isHighlighted
31449
+ isHighlighted,
31450
+ maxWidth,
31451
+ staticWidth,
31452
+ fullWidth
31300
31453
  }) : console.log(input)
31301
31454
  })), (_input$meta10 = input.meta) !== null && _input$meta10 !== void 0 && _input$meta10.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
31302
31455
  className: "code",
@@ -31403,6 +31556,9 @@ const GroupContentFormItem = _ref4 => {
31403
31556
  form: MainForm,
31404
31557
  forms: options,
31405
31558
  value: (inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.comment) || '',
31559
+ maxWidth,
31560
+ staticWidth,
31561
+ fullWidth,
31406
31562
  onChange: val => {
31407
31563
  if (notPartOfTheForm) {
31408
31564
  var _values$meta13;
@@ -31475,6 +31631,9 @@ const GroupContentFormItem = _ref4 => {
31475
31631
  form: MainForm,
31476
31632
  forms: options,
31477
31633
  value: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || '',
31634
+ maxWidth,
31635
+ staticWidth,
31636
+ fullWidth,
31478
31637
  onChange: val => {
31479
31638
  if (notPartOfTheForm) {
31480
31639
  var _values$meta14;
@@ -31848,7 +32007,8 @@ const EditForm$1 = _ref => {
31848
32007
  evaluationConfig = [],
31849
32008
  staticWidth = "614px",
31850
32009
  fullWidth = false,
31851
- noConvert = false
32010
+ noConvert = false,
32011
+ maxWidth = "75%"
31852
32012
  } = _ref;
31853
32013
  const [isSubmitting] = React.useState(false);
31854
32014
  const formData = JSON.parse(JSON.stringify(convertUndefinedToNull(data) || {}));
@@ -32066,7 +32226,7 @@ const EditForm$1 = _ref => {
32066
32226
  name: id,
32067
32227
  layout: "vertical",
32068
32228
  style: {
32069
- maxWidth: fullWidth ? "unset" : 700
32229
+ maxWidth: maxWidth || (fullWidth ? "unset" : 700) || 700
32070
32230
  },
32071
32231
  className: "main-form".concat(formClass ? " ".concat(formClass) : "", " "),
32072
32232
  onValuesChange: (_changedValue, _allValues) => {
@@ -32190,6 +32350,9 @@ const EditForm$1 = _ref => {
32190
32350
  }
32191
32351
  };
32192
32352
  return /*#__PURE__*/jsxRuntime.jsxs(EditProvider, {
32353
+ maxWidth: maxWidth,
32354
+ staticWidth: staticWidth,
32355
+ fullWidth: fullWidth,
32193
32356
  t: t,
32194
32357
  isReview: isReview,
32195
32358
  user: user,
@@ -32697,6 +32860,9 @@ function DataLink({
32697
32860
  getApiBaseUrl,
32698
32861
  getAppHeader,
32699
32862
  app,
32863
+ maxWidth,
32864
+ staticWidth,
32865
+ fullWidth,
32700
32866
  ...rest
32701
32867
  } = useEditContext();
32702
32868
  const [rowToEdit, setRowToEdit] = React.useState();
@@ -33139,7 +33305,11 @@ function DataLink({
33139
33305
  }, {});
33140
33306
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
33141
33307
  className: formatClassname(['data-link-cont mt-2', noBody && 'no-body', isHighlighted && 'highlighted']),
33142
- style: form?.meta?.style,
33308
+ style: {
33309
+ ...form?.meta?.style,
33310
+ maxWidth: fullWidth ? "unset" : maxWidth,
33311
+ width: fullWidth ? "100%" : maxWidth
33312
+ },
33143
33313
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
33144
33314
  className: "daf-table-wrapper no-padding repeatable-form-table no-pagination",
33145
33315
  children: /*#__PURE__*/jsxRuntime.jsx(antd.ConfigProvider, {
@@ -33743,6 +33913,9 @@ function DataLinkGroup({
33743
33913
  getApiBaseUrl,
33744
33914
  getAppHeader,
33745
33915
  app,
33916
+ maxWidth,
33917
+ staticWidth,
33918
+ fullWidth,
33746
33919
  ...rest
33747
33920
  } = useEditContext();
33748
33921
  const [rowToEdit, setRowToEdit] = React.useState();
@@ -34183,7 +34356,11 @@ function DataLinkGroup({
34183
34356
  }, {});
34184
34357
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
34185
34358
  className: formatClassname(['data-link-cont mt-2', noBody && 'no-body', isHighlighted && 'highlighted']),
34186
- style: form?.meta?.style,
34359
+ style: {
34360
+ ...form?.meta?.style,
34361
+ maxWidth: fullWidth ? "unset" : maxWidth,
34362
+ width: fullWidth ? "100%" : staticWidth
34363
+ },
34187
34364
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
34188
34365
  className: "daf-table-wrapper no-padding repeatable-form-table no-pagination",
34189
34366
  children: /*#__PURE__*/jsxRuntime.jsx(antd.ConfigProvider, {
@@ -34290,6 +34467,9 @@ function DataLinkFlat({
34290
34467
  getApiBaseUrl,
34291
34468
  getAppHeader,
34292
34469
  app,
34470
+ maxWidth,
34471
+ staticWidth,
34472
+ fullWidth,
34293
34473
  ...rest
34294
34474
  } = useEditContext();
34295
34475
  const [rowToEdit, setRowToEdit] = React.useState();
@@ -34735,7 +34915,11 @@ function DataLinkFlat({
34735
34915
  const disabledInputs = rowToEdit ? [...(form?.meta?.disabledKeysEdit || []), ...(form?.meta?.disabledKeys || [])] : [...(form?.meta?.disabledKeysCreate || []), ...(form?.meta?.disabledKeys || [])];
34736
34916
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
34737
34917
  className: formatClassname(['data-link-cont mt-2', noBody && 'no-body', isHighlighted && 'highlighted']),
34738
- style: form?.meta?.style,
34918
+ style: {
34919
+ ...form?.meta?.style,
34920
+ maxWidth: fullWidth ? "unset" : maxWidth,
34921
+ width: fullWidth ? "100%" : staticWidth
34922
+ },
34739
34923
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
34740
34924
  className: "daf-table-wrapper no-padding repeatable-form-table no-pagination",
34741
34925
  children: /*#__PURE__*/jsxRuntime.jsx(antd.ConfigProvider, {
@@ -34747,9 +34931,7 @@ function DataLinkFlat({
34747
34931
  columns: columns,
34748
34932
  dataSource: dataSource,
34749
34933
  rowKey: "key",
34750
- scroll: noBody ? undefined : {
34751
- y: 170
34752
- }
34934
+ scroll: noBody
34753
34935
  })
34754
34936
  })
34755
34937
  }), /*#__PURE__*/jsxRuntime.jsx(antd.Modal, {
@@ -35509,13 +35691,11 @@ const beforeUpload = allowedExtensions => file => {
35509
35691
  };
35510
35692
  const allowedImageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.avif', '.bmp', '.tiff', '.tif', '.heif', '.heic', '.svg', '.ico'];
35511
35693
 
35512
- const _excluded$i = ["placeholder"],
35513
- _excluded2$1 = ["label", "description", "excludeFromEdit", "showFormIf", "icon", "position", "template", "formClass"];
35694
+ /* eslint-disable no-case-declarations */
35514
35695
  dayjs__default["default"].extend(utc);
35515
35696
  dayjs__default["default"].extend(timezone);
35516
35697
  dayjs__default["default"].tz.setDefault("UTC");
35517
- const getDefaultInputValue = function () {
35518
- let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
35698
+ const getDefaultInputValue = (input = {}) => {
35519
35699
  let value = undefined;
35520
35700
  if (input.type === "multiselect") {
35521
35701
  value = [];
@@ -35533,30 +35713,33 @@ const checkCondition$1 = (condition, repeatValues, formsValue) => {
35533
35713
  const isShown = _checkValue(isNotEmpty ? field : wantedValue, match, isNotEmpty ? formValue : value);
35534
35714
  return isShown;
35535
35715
  };
35536
- const renderDataLinkGroup = _ref2 => {
35537
- var _input$meta, _formsValue$meta, _input$meta2;
35538
- let {
35539
- input,
35540
- groupFormId,
35541
- name,
35542
- formsValue,
35543
- form,
35544
- onValuesChange,
35545
- setValues,
35546
- changeLinking,
35547
- isHighlighted
35548
- } = _ref2;
35549
- const dataLinkKey = Object.keys((input === null || input === void 0 ? void 0 : input.inputs) || {}).find(k => {
35550
- var _input$inputs$k;
35551
- return (input === null || input === void 0 || (_input$inputs$k = input.inputs[k]) === null || _input$inputs$k === void 0 ? void 0 : _input$inputs$k.type) === "dataLink";
35552
- });
35553
- const dataLinkInput = ((input === null || input === void 0 ? void 0 : input.inputs) || {})[dataLinkKey];
35554
- const otherInputs = Object.keys((input === null || input === void 0 ? void 0 : input.inputs) || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
35555
- all[key] = input === null || input === void 0 ? void 0 : input.inputs[key];
35716
+ const renderDataLinkGroup = ({
35717
+ input,
35718
+ groupFormId,
35719
+ name,
35720
+ formsValue,
35721
+ form,
35722
+ onValuesChange,
35723
+ setValues,
35724
+ changeLinking,
35725
+ isHighlighted
35726
+ }) => {
35727
+ const dataLinkKey = Object.keys(input?.inputs || {}).find(k => input?.inputs[k]?.type === "dataLink");
35728
+ const dataLinkInput = (input?.inputs || {})[dataLinkKey];
35729
+ const otherInputs = Object.keys(input?.inputs || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
35730
+ all[key] = input?.inputs[key];
35556
35731
  return all;
35557
35732
  }, {});
35558
- const isSingle = (input === null || input === void 0 || (_input$meta = input.meta) === null || _input$meta === void 0 ? void 0 : _input$meta.maxRepeat) === 1;
35559
- const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [_objectSpread2({}, (formsValue[groupFormId] || {})[name])] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => _objectSpread2({}, v)) : isSingle ? formsValue[name] ? [_objectSpread2({}, formsValue[name])] : [] : getArray(formsValue[name] || []).map(v => _objectSpread2({}, v));
35733
+ const isSingle = input?.meta?.maxRepeat === 1;
35734
+ const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
35735
+ ...(formsValue[groupFormId] || {})[name]
35736
+ }] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
35737
+ ...v
35738
+ })) : isSingle ? formsValue[name] ? [{
35739
+ ...formsValue[name]
35740
+ }] : [] : getArray(formsValue[name] || []).map(v => ({
35741
+ ...v
35742
+ }));
35560
35743
  const onUpdate = (val, i) => {
35561
35744
  const _val = isSingle ? {
35562
35745
  [name]: val
@@ -35564,20 +35747,31 @@ const renderDataLinkGroup = _ref2 => {
35564
35747
  [name]: formData.map((d, j) => i === j ? val : d)
35565
35748
  };
35566
35749
  if (groupFormId) {
35567
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
35568
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
35569
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
35750
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
35751
+ const _newData = {
35752
+ ..._defaultData,
35753
+ ..._val
35754
+ };
35755
+ onValuesChange(_newData, {
35756
+ ...formsValue,
35570
35757
  [groupFormId]: _newData
35571
- }));
35572
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
35573
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
35758
+ });
35759
+ form?.setFieldValue(groupFormId, _newData);
35760
+ setValues({
35761
+ ...formsValue,
35574
35762
  [groupFormId]: _newData
35575
- }));
35763
+ });
35576
35764
  return;
35577
35765
  }
35578
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
35579
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
35580
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
35766
+ onValuesChange(_val, {
35767
+ ...formsValue,
35768
+ ..._val
35769
+ });
35770
+ form?.setFieldValue(name, _val[name]);
35771
+ setValues({
35772
+ ...formsValue,
35773
+ ..._val
35774
+ });
35581
35775
  };
35582
35776
  return /*#__PURE__*/jsxRuntime.jsx(DataLinkGroup, {
35583
35777
  form: input,
@@ -35588,79 +35782,102 @@ const renderDataLinkGroup = _ref2 => {
35588
35782
  isHighlighted: isHighlighted,
35589
35783
  dataLinkInput: dataLinkInput,
35590
35784
  formsValue: formsValue,
35591
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
35785
+ values: groupFormId ? {
35786
+ ...(formsValue[groupFormId] || {}),
35592
35787
  meta: {
35593
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta = formsValue.meta) === null || _formsValue$meta === void 0 ? void 0 : _formsValue$meta.inputs) || {})[groupFormId]
35788
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
35594
35789
  }
35595
- }) : formsValue,
35790
+ } : formsValue,
35596
35791
  name: name,
35597
35792
  groupFormId: groupFormId,
35598
- maxRepeat: input === null || input === void 0 || (_input$meta2 = input.meta) === null || _input$meta2 === void 0 ? void 0 : _input$meta2.maxRepeat,
35599
- remove: _ref3 => {
35600
- let {
35601
- key
35602
- } = _ref3;
35793
+ maxRepeat: input?.meta?.maxRepeat,
35794
+ remove: ({
35795
+ key
35796
+ }) => {
35603
35797
  const _val = isSingle ? {
35604
35798
  [name]: null
35605
35799
  } : {
35606
35800
  [name]: formData.filter((v, j) => j !== key)
35607
35801
  };
35608
35802
  if (groupFormId) {
35609
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
35610
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
35611
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
35803
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
35804
+ const _newData = {
35805
+ ..._defaultData,
35806
+ ..._val
35807
+ };
35808
+ onValuesChange(_newData, {
35809
+ ...formsValue,
35612
35810
  [groupFormId]: _newData
35613
- }));
35614
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
35615
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
35811
+ });
35812
+ form?.setFieldValue(groupFormId, _newData);
35813
+ setValues({
35814
+ ...formsValue,
35616
35815
  [groupFormId]: _newData
35617
- }));
35816
+ });
35618
35817
  return;
35619
35818
  }
35620
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
35621
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
35622
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
35819
+ onValuesChange(_val, {
35820
+ ...formsValue,
35821
+ ..._val
35822
+ });
35823
+ form?.setFieldValue(name, _val[name]);
35824
+ setValues({
35825
+ ...formsValue,
35826
+ ..._val
35827
+ });
35623
35828
  },
35624
35829
  add: val => {
35625
35830
  const _val = isSingle ? {
35626
35831
  [name]: val
35627
35832
  } : {
35628
- [name]: [...formData, _objectSpread2({}, val)]
35833
+ [name]: [...formData, {
35834
+ ...val
35835
+ }]
35629
35836
  };
35630
35837
  if (groupFormId) {
35631
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
35632
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
35633
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
35634
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
35838
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
35839
+ const _newData = {
35840
+ ..._defaultData,
35841
+ ..._val
35842
+ };
35843
+ form?.setFieldValue(groupFormId, _newData);
35844
+ onValuesChange(_newData, {
35845
+ ...formsValue,
35635
35846
  [groupFormId]: _newData
35636
- }));
35637
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
35847
+ });
35848
+ setValues({
35849
+ ...formsValue,
35638
35850
  [groupFormId]: _newData
35639
- }));
35851
+ });
35640
35852
  return;
35641
35853
  }
35642
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
35643
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
35644
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
35854
+ form?.setFieldValue(name, _val[name]);
35855
+ onValuesChange(_val, {
35856
+ ...formsValue,
35857
+ ..._val
35858
+ });
35859
+ setValues({
35860
+ ...formsValue,
35861
+ ..._val
35862
+ });
35645
35863
  },
35646
35864
  k: name,
35647
35865
  formData: formData
35648
35866
  });
35649
35867
  };
35650
35868
  function showHideInput$1(input, data, repeatIndex, repeatValues, inputMeta) {
35651
- var _input$meta3, _data$meta;
35652
- if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
35869
+ if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
35653
35870
  return false;
35654
35871
  }
35655
- if (typeof (input === null || input === void 0 || (_input$meta3 = input.meta) === null || _input$meta3 === void 0 ? void 0 : _input$meta3.excludeFromEdit) === "boolean") {
35656
- var _input$meta4;
35657
- return !(input !== null && input !== void 0 && (_input$meta4 = input.meta) !== null && _input$meta4 !== void 0 && _input$meta4.excludeFromEdit);
35872
+ if (typeof input?.meta?.excludeFromEdit === "boolean") {
35873
+ return !input?.meta?.excludeFromEdit;
35658
35874
  }
35659
- const formsValue = _objectSpread2({}, data);
35660
- Object.keys((data === null || data === void 0 || (_data$meta = data.meta) === null || _data$meta === void 0 ? void 0 : _data$meta.inputs) || {}).forEach(key => {
35661
- var _data$meta2;
35662
- const input = data === null || data === void 0 || (_data$meta2 = data.meta) === null || _data$meta2 === void 0 ? void 0 : _data$meta2.inputs[key];
35663
- if (input !== null && input !== void 0 && input.notApplicable || input !== null && input !== void 0 && input.notAvailable) {
35875
+ const formsValue = {
35876
+ ...data
35877
+ };
35878
+ Object.keys(data?.meta?.inputs || {}).forEach(key => {
35879
+ const input = data?.meta?.inputs[key];
35880
+ if (input?.notApplicable || input?.notAvailable) {
35664
35881
  formsValue[key] = undefined;
35665
35882
  delete formsValue[key];
35666
35883
  }
@@ -35719,35 +35936,35 @@ function getInputHeadLines$1(type, i, input, values) {
35719
35936
  switch (type) {
35720
35937
  case "h2":
35721
35938
  return /*#__PURE__*/jsxRuntime.jsx("div", {
35722
- className: "title-semibold-2 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
35939
+ className: `title-semibold-2 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
35723
35940
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
35724
35941
  children: getInputLabel$1(input, values)
35725
35942
  })
35726
35943
  });
35727
35944
  case "h3":
35728
35945
  return /*#__PURE__*/jsxRuntime.jsx("div", {
35729
- className: "title-semibold-3 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
35946
+ className: `title-semibold-3 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
35730
35947
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
35731
35948
  children: getInputLabel$1(input, values)
35732
35949
  })
35733
35950
  });
35734
35951
  case "h4":
35735
35952
  return /*#__PURE__*/jsxRuntime.jsx("div", {
35736
- className: "title-semibold-4 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
35953
+ className: `title-semibold-4 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
35737
35954
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
35738
35955
  children: getInputLabel$1(input, values)
35739
35956
  })
35740
35957
  });
35741
35958
  case "h5":
35742
35959
  return /*#__PURE__*/jsxRuntime.jsx("div", {
35743
- className: "title-semibold-5 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
35960
+ className: `title-semibold-5 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
35744
35961
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
35745
35962
  children: getInputLabel$1(input, values)
35746
35963
  })
35747
35964
  });
35748
35965
  case "h6":
35749
35966
  return /*#__PURE__*/jsxRuntime.jsx("div", {
35750
- className: "title-semibold-6 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
35967
+ className: `title-semibold-6 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
35751
35968
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
35752
35969
  children: getInputLabel$1(input, values)
35753
35970
  })
@@ -35756,8 +35973,7 @@ function getInputHeadLines$1(type, i, input, values) {
35756
35973
  return null;
35757
35974
  }
35758
35975
  }
35759
- function getInputProp(prop) {
35760
- let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
35976
+ function getInputProp(prop, formsValue = {}) {
35761
35977
  if (prop && typeof prop === "object") {
35762
35978
  const validations = Object.keys(prop);
35763
35979
  const key = validations.find(v => {
@@ -35771,32 +35987,28 @@ function getInputProp(prop) {
35771
35987
  return prop;
35772
35988
  }
35773
35989
  }
35774
- function getInputLabel$1(input) {
35775
- let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
35776
- let asText = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
35990
+ function getInputLabel$1(input, formsValue = {}, asText = false) {
35777
35991
  return /*#__PURE__*/jsxRuntime.jsx(InputLabel, {
35778
35992
  input: input,
35779
35993
  formsValue: formsValue,
35780
35994
  asText: asText
35781
35995
  });
35782
35996
  }
35783
- const InputLabel = _ref4 => {
35784
- var _input$meta5, _input$meta6, _input$meta7;
35785
- let {
35786
- input,
35787
- formsValue,
35788
- asText
35789
- } = _ref4;
35997
+ const InputLabel = ({
35998
+ input,
35999
+ formsValue,
36000
+ asText
36001
+ }) => {
35790
36002
  const {
35791
36003
  t,
35792
36004
  evaluationConfig
35793
36005
  } = useEditContext();
35794
36006
  const label = getInputProp(input.label, formsValue);
35795
- return input !== null && input !== void 0 && (_input$meta5 = input.meta) !== null && _input$meta5 !== void 0 && _input$meta5.isEvaluation || input.description && typeof input.description === "string" && !asText ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
36007
+ return input?.meta?.isEvaluation || input.description && typeof input.description === "string" && !asText ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
35796
36008
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
35797
36009
  className: "flex",
35798
36010
  children: [ReactHtmlParser__default["default"](label), /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
35799
- content: input !== null && input !== void 0 && (_input$meta6 = input.meta) !== null && _input$meta6 !== void 0 && _input$meta6.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(EvaluationPopover, {
36011
+ content: input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(EvaluationPopover, {
35800
36012
  t: t,
35801
36013
  evaluationConfig: evaluationConfig
35802
36014
  }) : /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -35804,7 +36016,7 @@ const InputLabel = _ref4 => {
35804
36016
  children: ReactHtmlParser__default["default"](input.description)
35805
36017
  }),
35806
36018
  placement: "top",
35807
- children: !(input !== null && input !== void 0 && (_input$meta7 = input.meta) !== null && _input$meta7 !== void 0 && _input$meta7.isEvaluation) || evaluationConfig.length > 0 ? /*#__PURE__*/jsxRuntime.jsx("div", {
36019
+ children: !input?.meta?.isEvaluation || evaluationConfig.length > 0 ? /*#__PURE__*/jsxRuntime.jsx("div", {
35808
36020
  className: "flex flex-column justify-content-center ml-1",
35809
36021
  children: /*#__PURE__*/jsxRuntime.jsx(TooltipIcon, {
35810
36022
  fontSize: 13
@@ -35826,9 +36038,7 @@ function getSectionLabel$1(labels, values) {
35826
36038
  }
35827
36039
  return labels;
35828
36040
  }
35829
- function getSubtitles$1(subtitles, position) {
35830
- let formsValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
35831
- let repeatValues = arguments.length > 4 ? arguments[4] : undefined;
36041
+ function getSubtitles$1(subtitles, position, formsValue = {}, repeatIndex, repeatValues) {
35832
36042
  let subtitle = subtitles && subtitles[position];
35833
36043
  if (subtitle && typeof subtitle === "object") {
35834
36044
  let newSubtitle = subtitle.default || "";
@@ -35872,12 +36082,14 @@ function getSubtitles$1(subtitles, position) {
35872
36082
  function getFormTitles$1(titles, key, position) {
35873
36083
  let tilte = titles && titles[key];
35874
36084
  return tilte ? /*#__PURE__*/jsxRuntime.jsx("h3", {
35875
- className: "title-semibold-3 mb0 ".concat(position ? "mt-3" : ""),
36085
+ className: `title-semibold-3 mb0 ${position ? "mt-3" : ""}`,
35876
36086
  children: tilte
35877
36087
  }) : null;
35878
36088
  }
35879
36089
  const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsValue, name, mainForm) => {
35880
- formsValue = Object.assign(formsValue, _objectSpread2({}, mainForm.getFieldsValue(true)));
36090
+ formsValue = Object.assign(formsValue, {
36091
+ ...mainForm.getFieldsValue(true)
36092
+ });
35881
36093
  if (typeof repeatIndex === "number" && repeatValues) {
35882
36094
  if (!repeatValues[inputName] || !___default["default"].isEqual(repeatValues[inputName], value)) {
35883
36095
  repeatValues[inputName] = value;
@@ -35912,16 +36124,14 @@ const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsVa
35912
36124
  };
35913
36125
  const inputOnBlur = [];
35914
36126
  const inputTypeComponent$1 = {
35915
- text: (_ref5, _ref6) => {
35916
- let {
35917
- props,
35918
- rules
35919
- } = _ref5;
35920
- let {
35921
- inputMeta = {},
35922
- t,
35923
- isHighlighted
35924
- } = _ref6;
36127
+ text: ({
36128
+ props,
36129
+ rules
36130
+ }, {
36131
+ inputMeta = {},
36132
+ t,
36133
+ isHighlighted
36134
+ }) => {
35925
36135
  const maxRule = rules.find(r => r.max);
35926
36136
  const maxProps = {
35927
36137
  maxLength: MAX_TEXT_AREA_LENGTH
@@ -35929,28 +36139,26 @@ const inputTypeComponent$1 = {
35929
36139
  if (maxRule) {
35930
36140
  maxProps.maxLength = maxRule.max;
35931
36141
  }
35932
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
35933
- size: "large"
35934
- }, maxProps), {}, {
36142
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
36143
+ size: "large",
36144
+ ...maxProps,
35935
36145
  allowClear: true,
35936
36146
  autoComplete: "new-password",
35937
- type: "text"
35938
- }, props), {}, {
36147
+ type: "text",
36148
+ ...props,
35939
36149
  className: formatClassname([isHighlighted && "highlighted-input"]),
35940
36150
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
35941
36151
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
35942
- }));
36152
+ });
35943
36153
  },
35944
- link: (_ref7, _ref8) => {
35945
- let {
35946
- props,
35947
- rules
35948
- } = _ref7;
35949
- let {
35950
- inputMeta = {},
35951
- t,
35952
- isHighlighted
35953
- } = _ref8;
36154
+ link: ({
36155
+ props,
36156
+ rules
36157
+ }, {
36158
+ inputMeta = {},
36159
+ t,
36160
+ isHighlighted
36161
+ }) => {
35954
36162
  const maxRule = rules.find(r => r.max);
35955
36163
  const maxProps = {
35956
36164
  maxLength: MAX_TEXT_AREA_LENGTH
@@ -35958,32 +36166,29 @@ const inputTypeComponent$1 = {
35958
36166
  if (maxRule) {
35959
36167
  maxProps.maxLength = maxRule.max;
35960
36168
  }
35961
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
35962
- size: "large"
35963
- }, maxProps), {}, {
36169
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
36170
+ size: "large",
36171
+ ...maxProps,
35964
36172
  allowClear: true,
35965
36173
  autoComplete: "new-password",
35966
- type: "text"
35967
- }, props), {}, {
36174
+ type: "text",
36175
+ ...props,
35968
36176
  className: formatClassname([isHighlighted && "highlighted-input"]),
35969
36177
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
35970
36178
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
35971
- }));
36179
+ });
35972
36180
  },
35973
- number: (_ref9, _ref10) => {
35974
- var _input$meta8;
35975
- let {
35976
- props,
35977
- rules,
35978
- input
35979
- } = _ref9;
35980
- let {
35981
- inputMeta = {},
35982
- t,
35983
- isHighlighted
35984
- } = _ref10;
36181
+ number: ({
36182
+ props,
36183
+ rules,
36184
+ input
36185
+ }, {
36186
+ inputMeta = {},
36187
+ t,
36188
+ isHighlighted
36189
+ }) => {
35985
36190
  const maxRule = rules.find(r => r.max);
35986
- const integerRule = !(input !== null && input !== void 0 && (_input$meta8 = input.meta) !== null && _input$meta8 !== void 0 && _input$meta8.isDecimal);
36191
+ const integerRule = !input?.meta?.isDecimal;
35987
36192
  const parser = value => {
35988
36193
  if (!value) {
35989
36194
  return "";
@@ -35994,63 +36199,60 @@ const inputTypeComponent$1 = {
35994
36199
  return value.replace(/\$\s?|(,*)/g, "");
35995
36200
  };
35996
36201
  if (maxRule) {
35997
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
36202
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
35998
36203
  size: "large",
35999
36204
  allowClear: true,
36000
- autoComplete: "new-password"
36001
- }, props), {}, {
36205
+ autoComplete: "new-password",
36206
+ ...props,
36002
36207
  type: "number",
36003
36208
  parser: parser,
36004
36209
  min: 0,
36005
36210
  max: maxRule.max,
36006
36211
  className: formatClassname([isHighlighted && "highlighted-input"])
36007
- }));
36212
+ });
36008
36213
  }
36009
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
36214
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
36010
36215
  size: "large",
36011
36216
  allowClear: true,
36012
36217
  className: formatClassname([isHighlighted && "highlighted-input"]),
36013
- autoComplete: "new-password"
36014
- }, props), {}, {
36218
+ autoComplete: "new-password",
36219
+ ...props,
36015
36220
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36016
36221
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
36017
36222
  min: 0,
36018
36223
  formatter: value => numberWithCommas$1(value),
36019
36224
  parser: parser
36020
- }));
36225
+ });
36021
36226
  },
36022
36227
  // eslint-disable-next-line no-unused-vars
36023
- select: (_ref11, _ref12) => {
36024
- var _input$meta9, _input$meta10;
36025
- let {
36026
- value,
36027
- options,
36028
- optionGroup,
36029
- props,
36030
- formsValue,
36031
- optionsFilter,
36032
- filterCond,
36033
- repeatValues,
36034
- repeatIndex,
36035
- name,
36036
- inputName,
36037
- address,
36038
- addressData,
36039
- input,
36040
- scope
36041
- } = _ref11;
36042
- let {
36043
- forms,
36044
- form,
36045
- setAddress,
36046
- inputMeta = {},
36047
- t,
36048
- isHighlighted,
36049
- changeInputMeta,
36050
- groupFormId
36051
- } = _ref12;
36228
+ select: ({
36229
+ value,
36230
+ options,
36231
+ optionGroup,
36232
+ props,
36233
+ formsValue,
36234
+ optionsFilter,
36235
+ filterCond,
36236
+ repeatValues,
36237
+ repeatIndex,
36238
+ name,
36239
+ inputName,
36240
+ address,
36241
+ addressData,
36242
+ input,
36243
+ scope
36244
+ }, {
36245
+ forms,
36246
+ form,
36247
+ setAddress,
36248
+ inputMeta = {},
36249
+ t,
36250
+ isHighlighted,
36251
+ changeInputMeta,
36252
+ groupFormId
36253
+ }) => {
36052
36254
  let opts;
36053
- const isEvaluation = input === null || input === void 0 || (_input$meta9 = input.meta) === null || _input$meta9 === void 0 ? void 0 : _input$meta9.isEvaluation;
36255
+ const isEvaluation = input?.meta?.isEvaluation;
36054
36256
  let defaultValue = value;
36055
36257
  if (typeof options === "string") {
36056
36258
  const [formName, key] = options.split(".");
@@ -36075,7 +36277,7 @@ const inputTypeComponent$1 = {
36075
36277
  opts = [];
36076
36278
  }
36077
36279
  } else {
36078
- opts = options === null || options === void 0 ? void 0 : options.filter(o => !o.onlyView);
36280
+ opts = options?.filter(o => !o.onlyView);
36079
36281
  }
36080
36282
  opts = JSON.parse(JSON.stringify(opts || []));
36081
36283
  opts = opts.map(o => getSelectOptions$2(o, formsValue));
@@ -36085,7 +36287,7 @@ const inputTypeComponent$1 = {
36085
36287
  const uniqueDefaultKeys = getUniqueDefaultKeys(options);
36086
36288
 
36087
36289
  // Handle default value logic
36088
- if (!propHasValue$1(value) && propHasValue$1(input === null || input === void 0 || (_input$meta10 = input.meta) === null || _input$meta10 === void 0 ? void 0 : _input$meta10.defaultValue)) {
36290
+ if (!propHasValue$1(value) && propHasValue$1(input?.meta?.defaultValue)) {
36089
36291
  // If no current value but there's a default value, use the default
36090
36292
  value = input.meta.defaultValue;
36091
36293
  defaultValue = value;
@@ -36118,7 +36320,7 @@ const inputTypeComponent$1 = {
36118
36320
  }
36119
36321
  opts = groupOptions;
36120
36322
  }
36121
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
36323
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
36122
36324
  size: "large",
36123
36325
  autoComplete: "new-password",
36124
36326
  allowClear: true,
@@ -36127,32 +36329,35 @@ const inputTypeComponent$1 = {
36127
36329
  value: value // Use value instead of defaultValue for controlled behavior
36128
36330
  ,
36129
36331
  filterOption: filterSelectOptions,
36130
- optionFilterProp: "children"
36131
- }, props), {}, {
36332
+ optionFilterProp: "children",
36333
+ ...props,
36132
36334
  className: formatClassname([isHighlighted && "highlighted-select"]),
36133
36335
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36134
36336
  placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select one option"),
36135
36337
  onChange: (val, selectedValue) => {
36136
36338
  // ONLY FOR SBG EVALUATON !!
36137
36339
  if (isEvaluation && val === "na" && groupFormId) {
36138
- var _formsValue$meta2;
36139
36340
  changeInputMeta({
36140
36341
  key: groupFormId,
36141
- value: _objectSpread2(_objectSpread2({}, (formsValue === null || formsValue === void 0 || (_formsValue$meta2 = formsValue.meta) === null || _formsValue$meta2 === void 0 || (_formsValue$meta2 = _formsValue$meta2.inputs) === null || _formsValue$meta2 === void 0 ? void 0 : _formsValue$meta2[groupFormId]) || {}), {}, {
36342
+ value: {
36343
+ ...(formsValue?.meta?.inputs?.[groupFormId] || {}),
36142
36344
  documentation: {
36143
36345
  notApplicable: true
36144
36346
  }
36145
- }),
36347
+ },
36146
36348
  otherValues: {
36147
- [groupFormId]: _objectSpread2(_objectSpread2({}, (formsValue === null || formsValue === void 0 ? void 0 : formsValue[groupFormId]) || {}), {}, {
36349
+ [groupFormId]: {
36350
+ ...(formsValue?.[groupFormId] || {}),
36148
36351
  [name]: val
36149
- })
36352
+ }
36150
36353
  }
36151
36354
  });
36152
36355
  }
36153
36356
  if (address && selectedValue) {
36154
36357
  dot__default["default"].str(address, selectedValue.children, addressData);
36155
- setAddress(_objectSpread2({}, addressData));
36358
+ setAddress({
36359
+ ...addressData
36360
+ });
36156
36361
  }
36157
36362
  if (props.onChange) {
36158
36363
  props.onChange(val);
@@ -36183,15 +36388,15 @@ const inputTypeComponent$1 = {
36183
36388
  if (og.disabled !== undefined) {
36184
36389
  groupOtherProps.disabled = og.disabled;
36185
36390
  }
36186
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36187
- value: og.value
36188
- }, groupOtherProps), {}, {
36391
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36392
+ value: og.value,
36393
+ ...groupOtherProps,
36189
36394
  children: og.label
36190
- }), "".concat(i).concat(j));
36395
+ }, `${i}${j}`);
36191
36396
  })
36192
- }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36193
- value: option.value
36194
- }, otherProps), {}, {
36397
+ }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36398
+ value: option.value,
36399
+ ...otherProps,
36195
36400
  children: isEvaluation ? /*#__PURE__*/jsxRuntime.jsxs("div", {
36196
36401
  className: "flex",
36197
36402
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
@@ -36199,32 +36404,33 @@ const inputTypeComponent$1 = {
36199
36404
  children: sgbEvaluationIcons[option.value]
36200
36405
  }), option.label]
36201
36406
  }) : option.label
36202
- }), option.value);
36407
+ }, option.value);
36203
36408
  })
36204
- }));
36409
+ });
36205
36410
  },
36206
- multiselect: (_ref13, _ref14) => {
36207
- let {
36208
- value,
36209
- options,
36210
- optionGroup,
36211
- optionsFilter,
36212
- filterCond,
36213
- props,
36214
- formsValue,
36215
- repeatValues,
36216
- repeatIndex,
36217
- inputName,
36218
- name,
36219
- tags
36220
- } = _ref13;
36221
- let {
36222
- forms,
36223
- form,
36224
- inputMeta = {},
36225
- t,
36226
- isHighlighted
36227
- } = _ref14;
36411
+ multiselect: ({
36412
+ value,
36413
+ options,
36414
+ optionGroup,
36415
+ optionsFilter,
36416
+ filterCond,
36417
+ props,
36418
+ formsValue,
36419
+ repeatValues,
36420
+ repeatIndex,
36421
+ inputName,
36422
+ name,
36423
+ tags,
36424
+ maxWidth,
36425
+ staticWidth,
36426
+ fullWidth
36427
+ }, {
36428
+ forms,
36429
+ form,
36430
+ inputMeta = {},
36431
+ t,
36432
+ isHighlighted
36433
+ }) => {
36228
36434
  let opts;
36229
36435
  if (typeof options === "string") {
36230
36436
  const [formName, key] = options.split(".");
@@ -36281,20 +36487,30 @@ const inputTypeComponent$1 = {
36281
36487
  }
36282
36488
  opts = groupOptions;
36283
36489
  }
36284
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2(_objectSpread2({
36490
+ console.log({
36491
+ maxWidth,
36492
+ staticWidth,
36493
+ fullWidth
36494
+ });
36495
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
36285
36496
  size: "medium",
36286
36497
  allowClear: true,
36287
36498
  autoComplete: "new-password",
36288
36499
  mode: tags ? "tags" : "multiple",
36289
- optionFilterProp: "children"
36290
- }, tags ? {
36291
- tokenSeparators: [","]
36292
- } : {}), {}, {
36293
- filterOption: filterSelectOptions
36294
- }, props), {}, {
36500
+ optionFilterProp: "children",
36501
+ ...(tags ? {
36502
+ tokenSeparators: [","]
36503
+ } : {}),
36504
+ filterOption: filterSelectOptions,
36505
+ ...props,
36295
36506
  className: formatClassname([isHighlighted && "highlighted-select"]),
36296
36507
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36297
36508
  placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select all relevant options"),
36509
+ styles: {
36510
+ selector: {
36511
+ width: "100%"
36512
+ }
36513
+ },
36298
36514
  children: (opts || []).map((option, i) => {
36299
36515
  const otherProps = {};
36300
36516
 
@@ -36325,52 +36541,51 @@ const inputTypeComponent$1 = {
36325
36541
  if (og.disabled !== undefined) {
36326
36542
  groupOtherProps.disabled = og.disabled;
36327
36543
  }
36328
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36329
- value: og.value
36330
- }, groupOtherProps), {}, {
36544
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36545
+ value: og.value,
36546
+ ...groupOtherProps,
36331
36547
  children: og.label
36332
- }), "".concat(i).concat(j));
36548
+ }, `${i}${j}`);
36333
36549
  })
36334
- }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
36335
- value: option.value
36336
- }, otherProps), {}, {
36550
+ }) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36551
+ value: option.value,
36552
+ ...otherProps,
36337
36553
  children: option.label
36338
- }), i);
36554
+ }, i);
36339
36555
  })
36340
- }));
36556
+ });
36341
36557
  },
36342
- date: (_ref15, _ref16) => {
36343
- var _formsValue$groupForm, _value2;
36344
- let {
36345
- props,
36346
- rules,
36347
- repeatValues,
36348
- formsValue,
36349
- name
36350
- } = _ref15;
36351
- let {
36352
- setFormValues,
36353
- inputMeta,
36354
- form,
36355
- t,
36356
- isHighlighted,
36357
- groupFormId
36358
- } = _ref16;
36558
+ date: ({
36559
+ props,
36560
+ rules,
36561
+ repeatValues,
36562
+ formsValue,
36563
+ name
36564
+ }, {
36565
+ setFormValues,
36566
+ inputMeta,
36567
+ form,
36568
+ t,
36569
+ isHighlighted,
36570
+ groupFormId
36571
+ }) => {
36359
36572
  const lng = localStorage.getItem("datastakeLng") || "en";
36360
36573
  const maxRule = rules.find(r => r.max);
36361
- let value = groupFormId ? formsValue === null || formsValue === void 0 || (_formsValue$groupForm = formsValue[groupFormId]) === null || _formsValue$groupForm === void 0 ? void 0 : _formsValue$groupForm[name] : formsValue[name];
36574
+ let value = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue[name];
36362
36575
  const handleDateChange = date => {
36363
36576
  if (date) {
36364
36577
  // const localDate = dayjs.utc(date).add(dayjs(date).utcOffset(), 'minutes');
36365
36578
  const localDate = dayjs__default["default"].utc(date);
36366
36579
  if (groupFormId) {
36367
- const _new = _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
36580
+ const _new = {
36581
+ ...(formsValue[groupFormId] || {}),
36368
36582
  [name]: localDate
36369
- });
36583
+ };
36370
36584
  form.setFieldValue(groupFormId, _new);
36371
- setFormValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36585
+ setFormValues({
36586
+ ...formsValue,
36372
36587
  [groupFormId]: _new
36373
- }));
36588
+ });
36374
36589
  } else {
36375
36590
  form.setFieldValue(name, localDate);
36376
36591
  }
@@ -36379,13 +36594,15 @@ const inputTypeComponent$1 = {
36379
36594
  if (groupFormId) {
36380
36595
  if (typeof value === "string" || typeof value === "undefined") {
36381
36596
  value = typeof value === "string" ? dayjs__default["default"].utc(value) : null;
36382
- const _new = _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
36597
+ const _new = {
36598
+ ...(formsValue[groupFormId] || {}),
36383
36599
  [name]: value
36384
- });
36600
+ };
36385
36601
  form.setFieldValue(groupFormId, _new);
36386
- setFormValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36602
+ setFormValues({
36603
+ ...formsValue,
36387
36604
  [groupFormId]: _new
36388
- }));
36605
+ });
36389
36606
  }
36390
36607
  } else {
36391
36608
  if (typeof value === "string") {
@@ -36401,13 +36618,12 @@ const inputTypeComponent$1 = {
36401
36618
  checkForMax = checkCondition$1(maxRule.condition, repeatValues, formsValue);
36402
36619
  }
36403
36620
  if (checkForMax) {
36404
- var _value;
36405
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
36621
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
36406
36622
  size: "large",
36407
36623
  allowClear: true,
36408
- autoComplete: "new-password"
36409
- }, props), {}, {
36410
- value: value ? dayjs__default["default"]((_value = value) === null || _value === void 0 ? void 0 : _value.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36624
+ autoComplete: "new-password",
36625
+ ...props,
36626
+ value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36411
36627
  onChange: handleDateChange,
36412
36628
  className: formatClassname([isHighlighted && "highlighted-input"]),
36413
36629
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
@@ -36417,54 +36633,49 @@ const inputTypeComponent$1 = {
36417
36633
  disabledDate: current => {
36418
36634
  return current && current >= dayjs__default["default"]().endOf("day");
36419
36635
  }
36420
- }));
36636
+ });
36421
36637
  }
36422
36638
  }
36423
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
36639
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
36424
36640
  size: "large",
36425
36641
  allowClear: true,
36426
- autoComplete: "new-password"
36427
- }, props), {}, {
36428
- value: value ? dayjs__default["default"]((_value2 = value) === null || _value2 === void 0 ? void 0 : _value2.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36642
+ autoComplete: "new-password",
36643
+ ...props,
36644
+ value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
36429
36645
  onChange: handleDateChange,
36430
36646
  className: formatClassname([isHighlighted && "highlighted-input"]),
36431
36647
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36432
36648
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder,
36433
36649
  format: DATE_FORMATS,
36434
36650
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"]
36435
- }));
36651
+ });
36436
36652
  },
36437
- groupExpandable: (_ref17, _ref18) => {
36438
- var _formsValue$groupForm2;
36439
- let {
36440
- formsValue,
36441
- name,
36442
- input
36443
- } = _ref17;
36444
- let {
36445
- groupFormId
36446
- } = _ref18;
36447
- const data = groupFormId ? formsValue === null || formsValue === void 0 || (_formsValue$groupForm2 = formsValue[groupFormId]) === null || _formsValue$groupForm2 === void 0 ? void 0 : _formsValue$groupForm2[name] : formsValue === null || formsValue === void 0 ? void 0 : formsValue[name];
36653
+ groupExpandable: ({
36654
+ formsValue,
36655
+ name,
36656
+ input
36657
+ }, {
36658
+ groupFormId
36659
+ }) => {
36660
+ const data = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue?.[name];
36448
36661
  return /*#__PURE__*/jsxRuntime.jsx(GroupExpandable, {
36449
36662
  input: input,
36450
36663
  formsValue: formsValue,
36451
36664
  data: data
36452
36665
  });
36453
36666
  },
36454
- comment: (_ref19, _ref20) => {
36455
- let {
36456
- props: {
36457
- placeholder
36458
- },
36459
- commentHint
36460
- } = _ref19,
36461
- props = _objectWithoutProperties(_ref19.props, _excluded$i);
36462
- let {
36463
- onChange,
36464
- value,
36465
- isHighlighted
36466
- } = _ref20;
36467
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
36667
+ comment: ({
36668
+ props: {
36669
+ placeholder,
36670
+ ...props
36671
+ },
36672
+ commentHint
36673
+ }, {
36674
+ onChange,
36675
+ value,
36676
+ isHighlighted
36677
+ }) => {
36678
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
36468
36679
  allowClear: true,
36469
36680
  value: value,
36470
36681
  onChange: e => onChange(e.target.value),
@@ -36475,27 +36686,26 @@ const inputTypeComponent$1 = {
36475
36686
  autoSize: {
36476
36687
  minRows: 5,
36477
36688
  maxRows: 5
36478
- }
36479
- }, props), {}, {
36689
+ },
36690
+ ...props,
36480
36691
  disabled: false
36481
- }));
36692
+ });
36482
36693
  },
36483
- tableComment: (_ref21, _ref22) => {
36484
- var _formsValue$meta3;
36485
- let {
36486
- setValues,
36487
- name,
36488
- onValuesChange,
36489
- formsValue
36490
- } = _ref21;
36491
- let {
36492
- form,
36493
- groupFormId,
36494
- isHighlighted
36495
- } = _ref22;
36496
- const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => _objectSpread2(_objectSpread2({}, v), {}, {
36694
+ tableComment: ({
36695
+ setValues,
36696
+ name,
36697
+ onValuesChange,
36698
+ formsValue
36699
+ }, {
36700
+ form,
36701
+ groupFormId,
36702
+ isHighlighted
36703
+ }) => {
36704
+ const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => ({
36705
+ ...v,
36497
36706
  key: i
36498
- })) : (formsValue[name] || []).map((v, i) => _objectSpread2(_objectSpread2({}, v), {}, {
36707
+ })) : (formsValue[name] || []).map((v, i) => ({
36708
+ ...v,
36499
36709
  key: i
36500
36710
  }));
36501
36711
  const onUpdate = (val, i) => {
@@ -36503,89 +36713,121 @@ const inputTypeComponent$1 = {
36503
36713
  [name]: formData.map((d, j) => i === j ? val : d)
36504
36714
  };
36505
36715
  if (groupFormId) {
36506
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36507
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36508
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36716
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
36717
+ const _newData = {
36718
+ ..._defaultData,
36719
+ ..._val
36720
+ };
36721
+ onValuesChange(_newData, {
36722
+ ...formsValue,
36509
36723
  [groupFormId]: _newData
36510
- }));
36511
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36512
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36724
+ });
36725
+ form?.setFieldValue(groupFormId, _newData);
36726
+ setValues({
36727
+ ...formsValue,
36513
36728
  [groupFormId]: _newData
36514
- }));
36729
+ });
36515
36730
  return;
36516
36731
  }
36517
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36518
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36519
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36732
+ onValuesChange(_val, {
36733
+ ...formsValue,
36734
+ ..._val
36735
+ });
36736
+ form?.setFieldValue(name, _val[name]);
36737
+ setValues({
36738
+ ...formsValue,
36739
+ ..._val
36740
+ });
36520
36741
  };
36521
36742
  return /*#__PURE__*/jsxRuntime.jsx(Comment, {
36522
36743
  onUpdate: onUpdate,
36523
36744
  isHighlighted: isHighlighted,
36524
36745
  form: form,
36525
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
36746
+ values: groupFormId ? {
36747
+ ...(formsValue[groupFormId] || {}),
36526
36748
  meta: {
36527
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta3 = formsValue.meta) === null || _formsValue$meta3 === void 0 ? void 0 : _formsValue$meta3.inputs) || {})[groupFormId]
36749
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
36528
36750
  }
36529
- }) : formsValue,
36751
+ } : formsValue,
36530
36752
  name: name,
36531
- remove: _ref23 => {
36532
- let {
36533
- key
36534
- } = _ref23;
36753
+ remove: ({
36754
+ key
36755
+ }) => {
36535
36756
  const _val = {
36536
36757
  [name]: formData.filter(v => v.key !== key)
36537
36758
  };
36538
36759
  if (groupFormId) {
36539
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36540
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36541
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36760
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
36761
+ const _newData = {
36762
+ ..._defaultData,
36763
+ ..._val
36764
+ };
36765
+ onValuesChange(_newData, {
36766
+ ...formsValue,
36542
36767
  [groupFormId]: _newData
36543
- }));
36544
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36545
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36768
+ });
36769
+ form?.setFieldValue(groupFormId, _newData);
36770
+ setValues({
36771
+ ...formsValue,
36546
36772
  [groupFormId]: _newData
36547
- }));
36773
+ });
36548
36774
  return;
36549
36775
  }
36550
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36551
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36552
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36776
+ onValuesChange(_val, {
36777
+ ...formsValue,
36778
+ ..._val
36779
+ });
36780
+ form?.setFieldValue(name, _val[name]);
36781
+ setValues({
36782
+ ...formsValue,
36783
+ ..._val
36784
+ });
36553
36785
  },
36554
36786
  add: val => {
36555
36787
  const _val = {
36556
- [name]: [...formData, _objectSpread2(_objectSpread2({}, val), {}, {
36788
+ [name]: [...formData, {
36789
+ ...val,
36557
36790
  key: formData.length
36558
- })]
36791
+ }]
36559
36792
  };
36560
36793
  if (groupFormId) {
36561
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
36562
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
36563
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
36564
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
36794
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
36795
+ const _newData = {
36796
+ ..._defaultData,
36797
+ ..._val
36798
+ };
36799
+ form?.setFieldValue(groupFormId, _newData);
36800
+ onValuesChange(_newData, {
36801
+ ...formsValue,
36565
36802
  [groupFormId]: _newData
36566
- }));
36567
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
36803
+ });
36804
+ setValues({
36805
+ ...formsValue,
36568
36806
  [groupFormId]: _newData
36569
- }));
36807
+ });
36570
36808
  return;
36571
36809
  }
36572
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
36573
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
36574
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
36810
+ form?.setFieldValue(name, _val[name]);
36811
+ onValuesChange(_val, {
36812
+ ...formsValue,
36813
+ ..._val
36814
+ });
36815
+ setValues({
36816
+ ...formsValue,
36817
+ ..._val
36818
+ });
36575
36819
  },
36576
36820
  k: name
36577
36821
  });
36578
36822
  },
36579
- textarea: (_ref24, _ref25) => {
36580
- let {
36581
- props,
36582
- rules
36583
- } = _ref24;
36584
- let {
36585
- inputMeta,
36586
- t,
36587
- isHighlighted
36588
- } = _ref25;
36823
+ textarea: ({
36824
+ props,
36825
+ rules
36826
+ }, {
36827
+ inputMeta,
36828
+ t,
36829
+ isHighlighted
36830
+ }) => {
36589
36831
  const maxRule = rules.find(r => r.max);
36590
36832
  let maxLength = MAX_TEXT_AREA_LENGTH;
36591
36833
  let rows = 5;
@@ -36612,7 +36854,7 @@ const inputTypeComponent$1 = {
36612
36854
  // rows = 14;
36613
36855
  // }
36614
36856
  }
36615
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
36857
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
36616
36858
  allowClear: true,
36617
36859
  autoComplete: "new-password",
36618
36860
  maxLength: maxLength,
@@ -36620,37 +36862,35 @@ const inputTypeComponent$1 = {
36620
36862
  autoSize: {
36621
36863
  minRows: rows,
36622
36864
  maxRows: rows
36623
- }
36624
- }, props), {}, {
36865
+ },
36866
+ ...props,
36625
36867
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36626
36868
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
36627
- }));
36869
+ });
36628
36870
  },
36629
- phoneNumber: (_ref26, _ref27) => {
36630
- let {
36631
- name,
36632
- inputName,
36633
- props,
36634
- value,
36635
- repeatIndex,
36636
- repeatValues,
36637
- formsValue
36638
- } = _ref26;
36639
- let {
36640
- setFormValues,
36641
- inputMeta,
36642
- t,
36643
- isHighlighted
36644
- } = _ref27;
36645
- return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, _objectSpread2(_objectSpread2({
36871
+ phoneNumber: ({
36872
+ name,
36873
+ inputName,
36874
+ props,
36875
+ value,
36876
+ repeatIndex,
36877
+ repeatValues,
36878
+ formsValue
36879
+ }, {
36880
+ setFormValues,
36881
+ inputMeta,
36882
+ t,
36883
+ isHighlighted
36884
+ }) => {
36885
+ return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, {
36646
36886
  customSelectWidthPercentage: "20%",
36647
36887
  t: t,
36648
36888
  size: "large",
36649
36889
  allowClear: true,
36650
- country: formsValue === null || formsValue === void 0 ? void 0 : formsValue.country,
36890
+ country: formsValue?.country,
36651
36891
  initialValue: value,
36652
- name: name
36653
- }, props), {}, {
36892
+ name: name,
36893
+ ...props,
36654
36894
  className: formatClassname([isHighlighted && "highlighted-input"]),
36655
36895
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
36656
36896
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type Number"),
@@ -36671,27 +36911,26 @@ const inputTypeComponent$1 = {
36671
36911
  }
36672
36912
  return val;
36673
36913
  }
36674
- }));
36914
+ });
36675
36915
  },
36676
- switch: (_ref28, _ref29) => {
36677
- let {
36678
- props,
36679
- value,
36680
- restricted,
36681
- autocomplete,
36682
- formsValue,
36683
- repeatValues,
36684
- repeatIndex,
36685
- name,
36686
- inputName,
36687
- replace: replaceInput,
36688
- unique
36689
- } = _ref28;
36690
- let {
36691
- form,
36692
- isHighlighted
36693
- } = _ref29;
36694
- return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, _objectSpread2(_objectSpread2({}, props), {}, {
36916
+ switch: ({
36917
+ props,
36918
+ value,
36919
+ restricted,
36920
+ autocomplete,
36921
+ formsValue,
36922
+ repeatValues,
36923
+ repeatIndex,
36924
+ name,
36925
+ inputName,
36926
+ replace: replaceInput,
36927
+ unique
36928
+ }, {
36929
+ form,
36930
+ isHighlighted
36931
+ }) => {
36932
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, {
36933
+ ...props,
36695
36934
  size: "default",
36696
36935
  defaultChecked: value || false,
36697
36936
  checked: value || false,
@@ -36719,7 +36958,9 @@ const inputTypeComponent$1 = {
36719
36958
  const [formName, replaceInputName] = replaceTo.split(".");
36720
36959
  const replaceRepeatValues = replaceInputName ? dot__default["default"].pick(formName, formsValue) : undefined;
36721
36960
  updateFormValues$1(undefined, replaceRepeatValues, replaceInputName, isChecked ? newId : undefined, formsValue, formName, form);
36722
- formsValue = Object.assign(formsValue, _objectSpread2({}, form.getFieldsValue(true)));
36961
+ formsValue = Object.assign(formsValue, {
36962
+ ...form.getFieldsValue(true)
36963
+ });
36723
36964
  if (oldId) {
36724
36965
  const allRepeatValues = dot__default["default"].pick(name, formsValue);
36725
36966
  if (allRepeatValues && Array.isArray(allRepeatValues)) {
@@ -36760,22 +37001,20 @@ const inputTypeComponent$1 = {
36760
37001
  }
36761
37002
  }
36762
37003
  }
36763
- }));
37004
+ });
36764
37005
  },
36765
- radioGroup: (_ref30, _ref31) => {
36766
- let {
36767
- props,
36768
- value,
36769
- options,
36770
- isRisk
36771
- } = _ref30;
36772
- let {
36773
- isHighlighted
36774
- } = _ref31;
37006
+ radioGroup: ({
37007
+ props,
37008
+ value,
37009
+ options,
37010
+ isRisk
37011
+ }, {
37012
+ isHighlighted
37013
+ }) => {
36775
37014
  if (isRisk) {
36776
- return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, _objectSpread2(_objectSpread2({
36777
- value: value
36778
- }, props), {}, {
37015
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
37016
+ value: value,
37017
+ ...props,
36779
37018
  className: "is-risk-radio",
36780
37019
  children: (options || []).map(o => {
36781
37020
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
@@ -36789,11 +37028,11 @@ const inputTypeComponent$1 = {
36789
37028
  }) : null]
36790
37029
  }, o.value);
36791
37030
  })
36792
- }));
37031
+ });
36793
37032
  }
36794
- return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, _objectSpread2(_objectSpread2({
36795
- value: value
36796
- }, props), {}, {
37033
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
37034
+ value: value,
37035
+ ...props,
36797
37036
  className: formatClassname([isHighlighted && "highlighted-input"]),
36798
37037
  children: (options || []).map(o => {
36799
37038
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
@@ -36807,20 +37046,18 @@ const inputTypeComponent$1 = {
36807
37046
  }) : null]
36808
37047
  }, o.value);
36809
37048
  })
36810
- }));
37049
+ });
36811
37050
  },
36812
- checkboxGroup: (_ref32, _ref33) => {
36813
- let {
36814
- props,
36815
- value,
36816
- options
36817
- } = _ref32;
36818
- let {
36819
- isHighlighted
36820
- } = _ref33;
36821
- return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, _objectSpread2(_objectSpread2({
36822
- value: value
36823
- }, props), {}, {
37051
+ checkboxGroup: ({
37052
+ props,
37053
+ value,
37054
+ options
37055
+ }, {
37056
+ isHighlighted
37057
+ }) => {
37058
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, {
37059
+ value: value,
37060
+ ...props,
36824
37061
  className: formatClassname([isHighlighted && "highlighted-input"]),
36825
37062
  style: {
36826
37063
  display: "grid",
@@ -36844,18 +37081,16 @@ const inputTypeComponent$1 = {
36844
37081
  }) : null]
36845
37082
  }, o.value);
36846
37083
  })
36847
- }));
37084
+ });
36848
37085
  },
36849
- total100: (_ref34, _ref35) => {
36850
- let {
36851
- props,
36852
- name,
36853
- options,
36854
- value
36855
- } = _ref34;
36856
- let {
36857
- isHighlighted
36858
- } = _ref35;
37086
+ total100: ({
37087
+ props,
37088
+ name,
37089
+ options,
37090
+ value
37091
+ }, {
37092
+ isHighlighted
37093
+ }) => {
36859
37094
  value = value ? Array.isArray(value) ? value : [value] : [];
36860
37095
  function totalValue() {
36861
37096
  let total = 0;
@@ -36879,11 +37114,10 @@ const inputTypeComponent$1 = {
36879
37114
  className: formatClassname(["total100", isHighlighted && "highlighted-input"]),
36880
37115
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
36881
37116
  name: name,
36882
- children: (fields, _ref36) => {
36883
- let {
36884
- add,
36885
- remove
36886
- } = _ref36;
37117
+ children: (fields, {
37118
+ add,
37119
+ remove
37120
+ }) => {
36887
37121
  if (fields.length === 0) {
36888
37122
  const formData = value || [];
36889
37123
  if (formData.length) {
@@ -36902,27 +37136,27 @@ const inputTypeComponent$1 = {
36902
37136
  const v = value[field.name] || {};
36903
37137
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Space, {
36904
37138
  className: "total",
36905
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
36906
- noStyle: true
36907
- }, field), {}, {
37139
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
37140
+ noStyle: true,
37141
+ ...field,
36908
37142
  name: [field.name, "type"],
36909
37143
  fieldKey: [field.fieldKey, "type"],
36910
37144
  initialValue: v.type || null,
36911
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
37145
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
36912
37146
  size: "large",
36913
37147
  allowClear: true,
36914
37148
  showSearch: true,
36915
37149
  filterOption: filterSelectOptions,
36916
- optionFilterProp: "children"
36917
- }, props), {}, {
37150
+ optionFilterProp: "children",
37151
+ ...props,
36918
37152
  children: options.map((option, i) => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
36919
37153
  value: option.value,
36920
37154
  children: option.label
36921
37155
  }, i))
36922
- }))
36923
- })), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
36924
- noStyle: true
36925
- }, field), {}, {
37156
+ })
37157
+ }), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
37158
+ noStyle: true,
37159
+ ...field,
36926
37160
  name: [field.name, "value"],
36927
37161
  fieldKey: [field.fieldKey, "value"],
36928
37162
  initialValue: v.value,
@@ -36931,14 +37165,14 @@ const inputTypeComponent$1 = {
36931
37165
  allowClear: true,
36932
37166
  name: "value",
36933
37167
  formatter: value => {
36934
- return value ? "".concat(value, "%") : "";
37168
+ return value ? `${value}%` : "";
36935
37169
  },
36936
37170
  disabled: !v.type || null,
36937
37171
  placeholder: props.valueplaceholder ? props.valueplaceholder : "Value",
36938
37172
  min: 1,
36939
37173
  max: 100 - siblingTotal(v.type || 0)
36940
37174
  })
36941
- })), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
37175
+ }), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
36942
37176
  disabled: !v.value || !v.type || totalValue() >= 100,
36943
37177
  type: "primary",
36944
37178
  icon: /*#__PURE__*/jsxRuntime.jsx(Icons.PlusOutlined, {}),
@@ -36970,22 +37204,19 @@ const inputTypeComponent$1 = {
36970
37204
  }) : null]
36971
37205
  });
36972
37206
  },
36973
- percentage: (_ref37, _ref38) => {
36974
- var _input$meta11;
36975
- let {
36976
- name,
36977
- inputName,
36978
- totalMax,
36979
- repeatIndex,
36980
- props,
36981
- formsValue,
36982
- input
36983
- } = _ref37;
36984
- let {
36985
- inputMeta,
36986
- t,
36987
- isHighlighted
36988
- } = _ref38;
37207
+ percentage: ({
37208
+ name,
37209
+ inputName,
37210
+ totalMax,
37211
+ repeatIndex,
37212
+ props,
37213
+ formsValue,
37214
+ input
37215
+ }, {
37216
+ inputMeta,
37217
+ t,
37218
+ isHighlighted
37219
+ }) => {
36989
37220
  const isRepeatable = Array.isArray(formsValue[name]);
36990
37221
  let totalSiblings = 0;
36991
37222
  if (isRepeatable && totalMax) {
@@ -36993,47 +37224,45 @@ const inputTypeComponent$1 = {
36993
37224
  totl = totl + (grp[inputName] || 0);
36994
37225
  return totl;
36995
37226
  }, 0);
36996
- } else if (Array.isArray(input === null || input === void 0 || (_input$meta11 = input.meta) === null || _input$meta11 === void 0 ? void 0 : _input$meta11.siblings)) {
37227
+ } else if (Array.isArray(input?.meta?.siblings)) {
36997
37228
  totalSiblings = input.meta.siblings.reduce((totl, key) => {
36998
37229
  totl = totl + (formsValue[key] || 0);
36999
37230
  return totl;
37000
37231
  }, 0);
37001
37232
  }
37002
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
37233
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
37003
37234
  size: "large",
37004
- allowClear: true
37005
- }, props), {}, {
37235
+ allowClear: true,
37236
+ ...props,
37006
37237
  className: formatClassname([isHighlighted && "highlighted-cont"]),
37007
37238
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
37008
37239
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
37009
37240
  min: 0,
37010
37241
  max: 100 - totalSiblings,
37011
37242
  formatter: value => {
37012
- return value ? "".concat(value) : "";
37243
+ return value ? `${value}` : "";
37013
37244
  },
37014
37245
  parser: value => value.replace("%", ""),
37015
37246
  addonAfter: "%"
37016
- }));
37247
+ });
37017
37248
  },
37018
- drawTerritory: (_ref39, _ref40) => {
37019
- let {
37020
- formsValue,
37021
- name,
37022
- addressData
37023
- } = _ref39;
37024
- let {
37025
- setFormValues
37026
- } = _ref40;
37249
+ drawTerritory: ({
37250
+ formsValue,
37251
+ name,
37252
+ addressData
37253
+ }, {
37254
+ setFormValues
37255
+ }) => {
37027
37256
  let search = formsValue.country;
37028
37257
  if (addressData && addressData.address && Object.keys(addressData.address).length > 0) {
37029
37258
  if (addressData.address.country) {
37030
37259
  search = addressData.address.country;
37031
37260
  }
37032
37261
  if (addressData.address.level1) {
37033
- search = "".concat(addressData.address.level1, ", ").concat(addressData.address.country);
37262
+ search = `${addressData.address.level1}, ${addressData.address.country}`;
37034
37263
  }
37035
37264
  if (addressData.address.level2) {
37036
- search = "".concat(addressData.address.level2, ", ").concat(addressData.address.level1, ", ").concat(addressData.address.country);
37265
+ search = `${addressData.address.level2}, ${addressData.address.level1}, ${addressData.address.country}`;
37037
37266
  }
37038
37267
  } else {
37039
37268
  const country = countriesList.countries[formsValue.country] || {};
@@ -37041,10 +37270,10 @@ const inputTypeComponent$1 = {
37041
37270
  search = country.name;
37042
37271
  }
37043
37272
  if (formsValue.administrativeLevel1Name) {
37044
- search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
37273
+ search = `${search} ${formsValue.administrativeLevel1Name}`;
37045
37274
  }
37046
37275
  if (formsValue.administrativeLevel2Name) {
37047
- search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
37276
+ search = `${search} ${formsValue.administrativeLevel2Name}`;
37048
37277
  }
37049
37278
  }
37050
37279
  return /*#__PURE__*/jsxRuntime.jsx(PolygonSelector, {
@@ -37056,36 +37285,32 @@ const inputTypeComponent$1 = {
37056
37285
  searchValue: search
37057
37286
  });
37058
37287
  },
37059
- year: (_ref41, _ref42) => {
37060
- let {
37061
- props
37062
- } = _ref41;
37063
- let {
37064
- isHighlighted
37065
- } = _ref42;
37288
+ year: ({
37289
+ props
37290
+ }, {
37291
+ isHighlighted
37292
+ }) => {
37066
37293
  const lng = localStorage.getItem("datastakeLng") || "en";
37067
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
37294
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
37068
37295
  size: "large",
37069
37296
  allowClear: true,
37070
37297
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
37071
- picker: "year"
37072
- }, props), {}, {
37298
+ picker: "year",
37299
+ ...props,
37073
37300
  className: formatClassname([isHighlighted && "highlighted-input"]),
37074
37301
  format: "YYYY"
37075
- }));
37302
+ });
37076
37303
  },
37077
- upload: (_ref43, _ref44) => {
37078
- let {
37079
- rules,
37080
- value
37081
- } = _ref43;
37082
- let {
37083
- setLoading = () => {},
37084
- getApiBaseUrl,
37085
- getAppHeader,
37086
- t,
37087
- isHighlighted
37088
- } = _ref44;
37304
+ upload: ({
37305
+ rules,
37306
+ value
37307
+ }, {
37308
+ setLoading = () => {},
37309
+ getApiBaseUrl,
37310
+ getAppHeader,
37311
+ t,
37312
+ isHighlighted
37313
+ }) => {
37089
37314
  const apiURL = getApiBaseUrl();
37090
37315
  const accept = rules.length ? rules.find(rule => Object.keys(rule).includes("accept")).accept || "*" : null;
37091
37316
  const values = (Array.isArray(value) ? value : value && typeof value === "object" && value.fileList && Array.isArray(value.fileList) ? value.fileList.map(f => f.response).filter(f => f) : []) || [];
@@ -37098,12 +37323,13 @@ const inputTypeComponent$1 = {
37098
37323
  maxProps.multiple = true;
37099
37324
  }
37100
37325
  }
37101
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({}, maxProps), {}, {
37326
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
37327
+ ...maxProps,
37102
37328
  accept: accept,
37103
- action: "".concat(apiURL, "/upload"),
37329
+ action: `${apiURL}/upload`,
37104
37330
  beforeUpload: beforeUpload(allowedExtensions),
37105
37331
  onChange: val => {
37106
- if (val !== null && val !== void 0 && val.file && typeof setLoading === "function") {
37332
+ if (val?.file && typeof setLoading === "function") {
37107
37333
  if (val.file.percent !== 100) {
37108
37334
  setLoading(true);
37109
37335
  } else {
@@ -37111,9 +37337,10 @@ const inputTypeComponent$1 = {
37111
37337
  }
37112
37338
  }
37113
37339
  },
37114
- headers: _objectSpread2({
37115
- Authorization: "Bearer ".concat(getToken())
37116
- }, getAppHeader()),
37340
+ headers: {
37341
+ Authorization: `Bearer ${getToken()}`,
37342
+ ...getAppHeader()
37343
+ },
37117
37344
  defaultFileList: values,
37118
37345
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
37119
37346
  style: {
@@ -37124,20 +37351,18 @@ const inputTypeComponent$1 = {
37124
37351
  children: t("Upload")
37125
37352
  })]
37126
37353
  })
37127
- }));
37354
+ });
37128
37355
  },
37129
- imageUpload: (_ref45, _ref46) => {
37130
- let {
37131
- rules,
37132
- value
37133
- } = _ref45;
37134
- let {
37135
- setLoading = () => {},
37136
- getApiBaseUrl,
37137
- getAppHeader,
37138
- t,
37139
- isHighlighted
37140
- } = _ref46;
37356
+ imageUpload: ({
37357
+ rules,
37358
+ value
37359
+ }, {
37360
+ setLoading = () => {},
37361
+ getApiBaseUrl,
37362
+ getAppHeader,
37363
+ t,
37364
+ isHighlighted
37365
+ }) => {
37141
37366
  const apiURL = getApiBaseUrl();
37142
37367
  const values = getImageUploadEditValue(value);
37143
37368
  const maxRule = rules.find(r => r.max);
@@ -37148,18 +37373,17 @@ const inputTypeComponent$1 = {
37148
37373
  maxProps.multiple = true;
37149
37374
  }
37150
37375
  }
37151
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({
37152
- beforeUpload: beforeUpload(allowedImageExtensions)
37153
- }, maxProps), {}, {
37376
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
37377
+ beforeUpload: beforeUpload(allowedImageExtensions),
37378
+ ...maxProps,
37154
37379
  accept: "image/*",
37155
37380
  classList: !values || !values.length ? "empty" : "",
37156
37381
  listType: "picture",
37157
- action: "".concat(apiURL, "/upload"),
37382
+ action: `${apiURL}/upload`,
37158
37383
  onChange: val => {
37159
37384
  if (typeof setLoading === "function") {
37160
- if (val !== null && val !== void 0 && val.file) {
37161
- var _val$file;
37162
- if ((val === null || val === void 0 || (_val$file = val.file) === null || _val$file === void 0 ? void 0 : _val$file.status) === "removed") {
37385
+ if (val?.file) {
37386
+ if (val?.file?.status === "removed") {
37163
37387
  setLoading(false);
37164
37388
  return;
37165
37389
  }
@@ -37171,9 +37395,10 @@ const inputTypeComponent$1 = {
37171
37395
  setLoading(false);
37172
37396
  }
37173
37397
  },
37174
- headers: _objectSpread2({
37175
- Authorization: "Bearer ".concat(getToken())
37176
- }, getAppHeader()),
37398
+ headers: {
37399
+ Authorization: `Bearer ${getToken()}`,
37400
+ ...getAppHeader()
37401
+ },
37177
37402
  defaultFileList: values,
37178
37403
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
37179
37404
  style: {
@@ -37184,20 +37409,18 @@ const inputTypeComponent$1 = {
37184
37409
  children: t("Upload")
37185
37410
  })]
37186
37411
  })
37187
- }));
37412
+ });
37188
37413
  },
37189
- videoUpload: (_ref47, _ref48) => {
37190
- let {
37191
- rules,
37192
- value
37193
- } = _ref47;
37194
- let {
37195
- setLoading = () => {},
37196
- getApiBaseUrl,
37197
- getAppHeader,
37198
- t,
37199
- isHighlighted
37200
- } = _ref48;
37414
+ videoUpload: ({
37415
+ rules,
37416
+ value
37417
+ }, {
37418
+ setLoading = () => {},
37419
+ getApiBaseUrl,
37420
+ getAppHeader,
37421
+ t,
37422
+ isHighlighted
37423
+ }) => {
37201
37424
  const apiURL = getApiBaseUrl();
37202
37425
  const values = getImageUploadEditValue(value);
37203
37426
  const maxRule = rules.find(r => r.max);
@@ -37208,25 +37431,21 @@ const inputTypeComponent$1 = {
37208
37431
  maxProps.multiple = true;
37209
37432
  }
37210
37433
  }
37211
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({
37212
- itemRender: (item, fileList) => {
37213
- var _fileList$response;
37214
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
37215
- children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
37216
- url: (fileList === null || fileList === void 0 || (_fileList$response = fileList.response) === null || _fileList$response === void 0 ? void 0 : _fileList$response.url) || (fileList === null || fileList === void 0 ? void 0 : fileList.url)
37217
- }), item]
37218
- });
37219
- }
37220
- }, maxProps), {}, {
37434
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
37435
+ itemRender: (item, fileList) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
37436
+ children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
37437
+ url: fileList?.response?.url || fileList?.url
37438
+ }), item]
37439
+ }),
37440
+ ...maxProps,
37221
37441
  accept: "video/*",
37222
37442
  classList: !values || !values.length ? "empty" : "",
37223
37443
  listType: "picture",
37224
- action: "".concat(apiURL, "/upload"),
37444
+ action: `${apiURL}/upload`,
37225
37445
  onChange: val => {
37226
37446
  if (typeof setLoading === "function") {
37227
- if (val !== null && val !== void 0 && val.file) {
37228
- var _val$file2;
37229
- if ((val === null || val === void 0 || (_val$file2 = val.file) === null || _val$file2 === void 0 ? void 0 : _val$file2.status) === "removed") {
37447
+ if (val?.file) {
37448
+ if (val?.file?.status === "removed") {
37230
37449
  setLoading(false);
37231
37450
  return;
37232
37451
  }
@@ -37238,9 +37457,10 @@ const inputTypeComponent$1 = {
37238
37457
  setLoading(false);
37239
37458
  }
37240
37459
  },
37241
- headers: _objectSpread2({
37242
- Authorization: "Bearer ".concat(getToken())
37243
- }, getAppHeader()),
37460
+ headers: {
37461
+ Authorization: `Bearer ${getToken()}`,
37462
+ ...getAppHeader()
37463
+ },
37244
37464
  fileList: values,
37245
37465
  defaultFileList: values,
37246
37466
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
@@ -37252,30 +37472,28 @@ const inputTypeComponent$1 = {
37252
37472
  children: t("Upload")
37253
37473
  })]
37254
37474
  })
37255
- }));
37475
+ });
37256
37476
  },
37257
- geolocation: (_ref49, _ref50) => {
37258
- let {
37259
- value,
37260
- name,
37261
- props,
37262
- formsValue,
37263
- addressData
37264
- } = _ref49;
37265
- let {
37266
- inputMeta,
37267
- isHighlighted
37268
- } = _ref50;
37477
+ geolocation: ({
37478
+ value,
37479
+ name,
37480
+ props,
37481
+ formsValue,
37482
+ addressData
37483
+ }, {
37484
+ inputMeta,
37485
+ isHighlighted
37486
+ }) => {
37269
37487
  let search = formsValue.country;
37270
37488
  if (addressData && Object.keys(addressData).length > 0) {
37271
37489
  if (addressData.country) {
37272
37490
  search = addressData.country;
37273
37491
  }
37274
37492
  if (addressData.level1) {
37275
- search = "".concat(addressData.level1, ", ").concat(addressData.country);
37493
+ search = `${addressData.level1}, ${addressData.country}`;
37276
37494
  }
37277
37495
  if (addressData.level2) {
37278
- search = "".concat(addressData.level2, ", ").concat(addressData.level1, ", ").concat(addressData.country);
37496
+ search = `${addressData.level2}, ${addressData.level1}, ${addressData.country}`;
37279
37497
  }
37280
37498
  } else {
37281
37499
  const country = countriesList.countries[formsValue.country] || {};
@@ -37283,10 +37501,10 @@ const inputTypeComponent$1 = {
37283
37501
  search = country.name;
37284
37502
  }
37285
37503
  if (formsValue.administrativeLevel1Name) {
37286
- search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
37504
+ search = `${search} ${formsValue.administrativeLevel1Name}`;
37287
37505
  }
37288
37506
  if (formsValue.administrativeLevel2Name) {
37289
- search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
37507
+ search = `${search} ${formsValue.administrativeLevel2Name}`;
37290
37508
  }
37291
37509
  }
37292
37510
  return /*#__PURE__*/jsxRuntime.jsx(Geolocation, {
@@ -37300,36 +37518,34 @@ const inputTypeComponent$1 = {
37300
37518
  searchValue: search
37301
37519
  });
37302
37520
  },
37303
- ajaxSelect: (_ref51, _ref52) => {
37304
- let {
37305
- call,
37306
- automaticallyLink,
37307
- name,
37308
- inputName,
37309
- props,
37310
- formsValue,
37311
- onNewSetValue,
37312
- multiple,
37313
- updateOptions,
37314
- repeatValues,
37315
- repeatIndex,
37316
- value,
37317
- unique,
37318
- address,
37319
- addressData = {},
37320
- getFromLinking,
37321
- input
37322
- } = _ref51;
37323
- let {
37324
- form,
37325
- forms,
37326
- setAddress,
37327
- changeInputMeta,
37328
- inputMeta,
37329
- meta,
37330
- isHighlighted,
37331
- groupFormId
37332
- } = _ref52;
37521
+ ajaxSelect: ({
37522
+ call,
37523
+ automaticallyLink,
37524
+ name,
37525
+ inputName,
37526
+ props,
37527
+ formsValue,
37528
+ onNewSetValue,
37529
+ multiple,
37530
+ updateOptions,
37531
+ repeatValues,
37532
+ repeatIndex,
37533
+ value,
37534
+ unique,
37535
+ address,
37536
+ addressData = {},
37537
+ getFromLinking,
37538
+ input
37539
+ }, {
37540
+ form,
37541
+ forms,
37542
+ setAddress,
37543
+ changeInputMeta,
37544
+ inputMeta,
37545
+ meta,
37546
+ isHighlighted,
37547
+ groupFormId
37548
+ }) => {
37333
37549
  return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect, {
37334
37550
  size: "medium",
37335
37551
  input: input,
@@ -37366,7 +37582,9 @@ const inputTypeComponent$1 = {
37366
37582
  const selectedValue = data.find(v => v.value === ev);
37367
37583
  if (address && selectedValue) {
37368
37584
  dot__default["default"].str(address, selectedValue.label, addressData);
37369
- setAddress(_objectSpread2({}, addressData));
37585
+ setAddress({
37586
+ ...addressData
37587
+ });
37370
37588
  }
37371
37589
  }
37372
37590
  },
@@ -37375,11 +37593,10 @@ const inputTypeComponent$1 = {
37375
37593
  address: true
37376
37594
  });
37377
37595
  },
37378
- tag: _ref53 => {
37379
- let {
37380
- value,
37381
- repeatLabel
37382
- } = _ref53;
37596
+ tag: ({
37597
+ value,
37598
+ repeatLabel
37599
+ }) => {
37383
37600
  return /*#__PURE__*/jsxRuntime.jsx(TagInput, {
37384
37601
  size: "large",
37385
37602
  allowClear: true,
@@ -37387,28 +37604,26 @@ const inputTypeComponent$1 = {
37387
37604
  newPlaceholder: repeatLabel
37388
37605
  });
37389
37606
  },
37390
- modal: (_ref54, _ref55) => {
37391
- let {
37392
- call,
37393
- automaticallyLink,
37394
- name,
37395
- inputName,
37396
- props,
37397
- formsValue,
37398
- allFormsValue,
37399
- onNewSetValue,
37400
- repeatValues,
37401
- repeatIndex,
37402
- value,
37403
- modalTitle,
37404
- totalInputs,
37405
- shownInputs,
37406
- allowDupplicates
37407
- } = _ref54;
37408
- let {
37409
- form,
37410
- add
37411
- } = _ref55;
37607
+ modal: ({
37608
+ call,
37609
+ automaticallyLink,
37610
+ name,
37611
+ inputName,
37612
+ props,
37613
+ formsValue,
37614
+ allFormsValue,
37615
+ onNewSetValue,
37616
+ repeatValues,
37617
+ repeatIndex,
37618
+ value,
37619
+ modalTitle,
37620
+ totalInputs,
37621
+ shownInputs,
37622
+ allowDupplicates
37623
+ }, {
37624
+ form,
37625
+ add
37626
+ }) => {
37412
37627
  return /*#__PURE__*/jsxRuntime.jsx(AjaxModal, {
37413
37628
  allowClear: true,
37414
37629
  call: call,
@@ -37431,44 +37646,40 @@ const inputTypeComponent$1 = {
37431
37646
  allowDupplicates: allowDupplicates
37432
37647
  });
37433
37648
  },
37434
- dataLink: (_ref56, _ref57) => {
37435
- var _input$meta12, _input$meta15, _input$meta16, _formsValue$meta5, _input$meta18;
37436
- let {
37437
- setValues,
37438
- name,
37439
- onValuesChange,
37440
- changeLinking,
37441
- formsValue,
37442
- input,
37443
- call,
37444
- automaticallyLink,
37445
- inputName,
37446
- props,
37447
- onNewSetValue,
37448
- multiple,
37449
- updateOptions,
37450
- repeatValues,
37451
- repeatIndex,
37452
- value,
37453
- unique,
37454
- address,
37455
- addressData = {},
37456
- getFromLinking
37457
- } = _ref56;
37458
- let {
37459
- form,
37460
- forms,
37461
- setAddress,
37462
- changeInputMeta,
37463
- inputMeta,
37464
- meta,
37465
- isHighlighted,
37466
- groupFormId
37467
- } = _ref57;
37468
- if ((input === null || input === void 0 || (_input$meta12 = input.meta) === null || _input$meta12 === void 0 || (_input$meta12 = _input$meta12.optionsView) === null || _input$meta12 === void 0 ? void 0 : _input$meta12.editInputType) === "ajaxSelect") {
37469
- var _formsValue$groupForm3, _input$meta13, _input$meta14;
37470
- const currentValue = groupFormId ? (_formsValue$groupForm3 = formsValue[groupFormId]) === null || _formsValue$groupForm3 === void 0 ? void 0 : _formsValue$groupForm3[name] : formsValue[name];
37471
- (input === null || input === void 0 || (_input$meta13 = input.meta) === null || _input$meta13 === void 0 || (_input$meta13 = _input$meta13.optionsView) === null || _input$meta13 === void 0 ? void 0 : _input$meta13.call) || (input === null || input === void 0 || (_input$meta14 = input.meta) === null || _input$meta14 === void 0 ? void 0 : _input$meta14.call) || "default::list()::::";
37649
+ dataLink: ({
37650
+ setValues,
37651
+ name,
37652
+ onValuesChange,
37653
+ changeLinking,
37654
+ formsValue,
37655
+ input,
37656
+ call,
37657
+ automaticallyLink,
37658
+ inputName,
37659
+ props,
37660
+ onNewSetValue,
37661
+ multiple,
37662
+ updateOptions,
37663
+ repeatValues,
37664
+ repeatIndex,
37665
+ value,
37666
+ unique,
37667
+ address,
37668
+ addressData = {},
37669
+ getFromLinking
37670
+ }, {
37671
+ form,
37672
+ forms,
37673
+ setAddress,
37674
+ changeInputMeta,
37675
+ inputMeta,
37676
+ meta,
37677
+ isHighlighted,
37678
+ groupFormId
37679
+ }) => {
37680
+ if (input?.meta?.optionsView?.editInputType === "ajaxSelect") {
37681
+ const currentValue = groupFormId ? formsValue[groupFormId]?.[name] : formsValue[name];
37682
+ input?.meta?.optionsView?.call || input?.meta?.call || "default::list()::::";
37472
37683
  return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect$1, {
37473
37684
  size: "medium",
37474
37685
  input: input,
@@ -37505,7 +37716,9 @@ const inputTypeComponent$1 = {
37505
37716
  const selectedValue = data.find(v => v.value === ev);
37506
37717
  if (address && selectedValue) {
37507
37718
  dot__default["default"].str(address, selectedValue.label, addressData);
37508
- setAddress(_objectSpread2({}, addressData));
37719
+ setAddress({
37720
+ ...addressData
37721
+ });
37509
37722
  }
37510
37723
  }
37511
37724
  },
@@ -37515,93 +37728,138 @@ const inputTypeComponent$1 = {
37515
37728
  isDataLink: true
37516
37729
  });
37517
37730
  }
37518
- const isSingle = (input === null || input === void 0 || (_input$meta15 = input.meta) === null || _input$meta15 === void 0 ? void 0 : _input$meta15.maxRepeat) === 1;
37519
- const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [_objectSpread2({}, (formsValue[groupFormId] || {})[name])] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => _objectSpread2({}, v)) : isSingle ? formsValue[name] ? [_objectSpread2({}, formsValue[name])] : [] : (formsValue[name] || []).map(v => _objectSpread2({}, v));
37731
+ const isSingle = input?.meta?.maxRepeat === 1;
37732
+ const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
37733
+ ...(formsValue[groupFormId] || {})[name]
37734
+ }] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
37735
+ ...v
37736
+ })) : isSingle ? formsValue[name] ? [{
37737
+ ...formsValue[name]
37738
+ }] : [] : (formsValue[name] || []).map(v => ({
37739
+ ...v
37740
+ }));
37520
37741
  const onUpdate = (editData, i) => {
37521
- const val = _objectSpread2(_objectSpread2({}, formData[i]), editData);
37742
+ const val = {
37743
+ ...formData[i],
37744
+ ...editData
37745
+ };
37522
37746
  const _val = isSingle ? {
37523
37747
  [name]: val
37524
37748
  } : {
37525
- [name]: formData === null || formData === void 0 ? void 0 : formData.map((d, j) => i === j ? val : d)
37749
+ [name]: formData?.map((d, j) => i === j ? val : d)
37526
37750
  };
37527
37751
  if (groupFormId) {
37528
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
37529
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37530
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
37752
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
37753
+ const _newData = {
37754
+ ..._defaultData,
37755
+ ..._val
37756
+ };
37757
+ onValuesChange(_newData, {
37758
+ ...formsValue,
37531
37759
  [groupFormId]: _newData
37532
- }));
37533
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
37534
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
37760
+ });
37761
+ form?.setFieldValue(groupFormId, _newData);
37762
+ setValues({
37763
+ ...formsValue,
37535
37764
  [groupFormId]: _newData
37536
- }));
37765
+ });
37537
37766
  return;
37538
37767
  }
37539
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
37540
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
37541
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
37768
+ onValuesChange(_val, {
37769
+ ...formsValue,
37770
+ ..._val
37771
+ });
37772
+ form?.setFieldValue(name, _val[name]);
37773
+ setValues({
37774
+ ...formsValue,
37775
+ ..._val
37776
+ });
37542
37777
  };
37543
- if (input !== null && input !== void 0 && (_input$meta16 = input.meta) !== null && _input$meta16 !== void 0 && _input$meta16.flat) {
37544
- var _formsValue$meta4, _input$meta17;
37778
+ if (input?.meta?.flat) {
37545
37779
  return /*#__PURE__*/jsxRuntime.jsx(DataLinkFlat, {
37546
37780
  form: input,
37547
37781
  changeLinking: changeLinking,
37548
37782
  onUpdate: onUpdate,
37549
37783
  isHighlighted: isHighlighted,
37550
37784
  formsValue: formsValue,
37551
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
37785
+ values: groupFormId ? {
37786
+ ...(formsValue[groupFormId] || {}),
37552
37787
  meta: {
37553
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta4 = formsValue.meta) === null || _formsValue$meta4 === void 0 ? void 0 : _formsValue$meta4.inputs) || {})[groupFormId]
37788
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
37554
37789
  }
37555
- }) : formsValue,
37790
+ } : formsValue,
37556
37791
  name: name,
37557
37792
  groupFormId: groupFormId,
37558
- maxRepeat: input === null || input === void 0 || (_input$meta17 = input.meta) === null || _input$meta17 === void 0 ? void 0 : _input$meta17.maxRepeat,
37559
- remove: _ref58 => {
37560
- let {
37561
- key
37562
- } = _ref58;
37793
+ maxRepeat: input?.meta?.maxRepeat,
37794
+ remove: ({
37795
+ key
37796
+ }) => {
37563
37797
  const _val = isSingle ? {
37564
37798
  [name]: null
37565
37799
  } : {
37566
37800
  [name]: formData.filter((v, i) => i !== key)
37567
37801
  };
37568
37802
  if (groupFormId) {
37569
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
37570
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37571
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
37803
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
37804
+ const _newData = {
37805
+ ..._defaultData,
37806
+ ..._val
37807
+ };
37808
+ onValuesChange(_newData, {
37809
+ ...formsValue,
37572
37810
  [groupFormId]: _newData
37573
- }));
37574
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
37575
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
37811
+ });
37812
+ form?.setFieldValue(groupFormId, _newData);
37813
+ setValues({
37814
+ ...formsValue,
37576
37815
  [groupFormId]: _newData
37577
- }));
37816
+ });
37578
37817
  return;
37579
37818
  }
37580
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
37581
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
37582
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
37819
+ onValuesChange(_val, {
37820
+ ...formsValue,
37821
+ ..._val
37822
+ });
37823
+ form?.setFieldValue(name, _val[name]);
37824
+ setValues({
37825
+ ...formsValue,
37826
+ ..._val
37827
+ });
37583
37828
  },
37584
37829
  add: val => {
37585
37830
  const _val = isSingle ? {
37586
37831
  [name]: val
37587
37832
  } : {
37588
- [name]: [...formData, _objectSpread2({}, val)]
37833
+ [name]: [...formData, {
37834
+ ...val
37835
+ }]
37589
37836
  };
37590
37837
  if (groupFormId) {
37591
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
37592
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37593
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
37594
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
37838
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
37839
+ const _newData = {
37840
+ ..._defaultData,
37841
+ ..._val
37842
+ };
37843
+ form?.setFieldValue(groupFormId, _newData);
37844
+ onValuesChange(_newData, {
37845
+ ...formsValue,
37595
37846
  [groupFormId]: _newData
37596
- }));
37597
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
37847
+ });
37848
+ setValues({
37849
+ ...formsValue,
37598
37850
  [groupFormId]: _newData
37599
- }));
37851
+ });
37600
37852
  return;
37601
37853
  }
37602
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
37603
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
37604
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
37854
+ form?.setFieldValue(name, _val[name]);
37855
+ onValuesChange(_val, {
37856
+ ...formsValue,
37857
+ ..._val
37858
+ });
37859
+ setValues({
37860
+ ...formsValue,
37861
+ ..._val
37862
+ });
37605
37863
  },
37606
37864
  k: name,
37607
37865
  formData: formData
@@ -37613,79 +37871,101 @@ const inputTypeComponent$1 = {
37613
37871
  onUpdate: onUpdate,
37614
37872
  isHighlighted: isHighlighted,
37615
37873
  formsValue: formsValue,
37616
- values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
37874
+ values: groupFormId ? {
37875
+ ...(formsValue[groupFormId] || {}),
37617
37876
  meta: {
37618
- inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta5 = formsValue.meta) === null || _formsValue$meta5 === void 0 ? void 0 : _formsValue$meta5.inputs) || {})[groupFormId]
37877
+ inputs: (formsValue?.meta?.inputs || {})[groupFormId]
37619
37878
  }
37620
- }) : formsValue,
37879
+ } : formsValue,
37621
37880
  name: name,
37622
37881
  groupFormId: groupFormId,
37623
- maxRepeat: input === null || input === void 0 || (_input$meta18 = input.meta) === null || _input$meta18 === void 0 ? void 0 : _input$meta18.maxRepeat,
37624
- remove: _ref59 => {
37625
- let {
37626
- key
37627
- } = _ref59;
37882
+ maxRepeat: input?.meta?.maxRepeat,
37883
+ remove: ({
37884
+ key
37885
+ }) => {
37628
37886
  const _val = isSingle ? {
37629
37887
  [name]: null
37630
37888
  } : {
37631
37889
  [name]: formData.filter((v, i) => i !== key)
37632
37890
  };
37633
37891
  if (groupFormId) {
37634
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
37635
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37636
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
37892
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
37893
+ const _newData = {
37894
+ ..._defaultData,
37895
+ ..._val
37896
+ };
37897
+ onValuesChange(_newData, {
37898
+ ...formsValue,
37637
37899
  [groupFormId]: _newData
37638
- }));
37639
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
37640
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
37900
+ });
37901
+ form?.setFieldValue(groupFormId, _newData);
37902
+ setValues({
37903
+ ...formsValue,
37641
37904
  [groupFormId]: _newData
37642
- }));
37905
+ });
37643
37906
  return;
37644
37907
  }
37645
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
37646
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
37647
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
37908
+ onValuesChange(_val, {
37909
+ ...formsValue,
37910
+ ..._val
37911
+ });
37912
+ form?.setFieldValue(name, _val[name]);
37913
+ setValues({
37914
+ ...formsValue,
37915
+ ..._val
37916
+ });
37648
37917
  },
37649
37918
  add: val => {
37650
37919
  const _val = isSingle ? {
37651
37920
  [name]: val
37652
37921
  } : {
37653
- [name]: [...formData, _objectSpread2({}, val)]
37922
+ [name]: [...formData, {
37923
+ ...val
37924
+ }]
37654
37925
  };
37655
37926
  if (groupFormId) {
37656
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
37657
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37658
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
37659
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
37927
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
37928
+ const _newData = {
37929
+ ..._defaultData,
37930
+ ..._val
37931
+ };
37932
+ form?.setFieldValue(groupFormId, _newData);
37933
+ onValuesChange(_newData, {
37934
+ ...formsValue,
37660
37935
  [groupFormId]: _newData
37661
- }));
37662
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
37936
+ });
37937
+ setValues({
37938
+ ...formsValue,
37663
37939
  [groupFormId]: _newData
37664
- }));
37940
+ });
37665
37941
  return;
37666
37942
  }
37667
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
37668
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
37669
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
37943
+ form?.setFieldValue(name, _val[name]);
37944
+ onValuesChange(_val, {
37945
+ ...formsValue,
37946
+ ..._val
37947
+ });
37948
+ setValues({
37949
+ ...formsValue,
37950
+ ..._val
37951
+ });
37670
37952
  },
37671
37953
  k: name,
37672
37954
  formData: formData
37673
37955
  });
37674
37956
  },
37675
- dataLinkGroup: (_ref60, _ref61) => {
37676
- let {
37677
- setValues,
37678
- name,
37679
- onValuesChange,
37680
- changeLinking,
37681
- formsValue,
37682
- input
37683
- } = _ref60;
37684
- let {
37685
- form,
37686
- groupFormId,
37687
- isHighlighted
37688
- } = _ref61;
37957
+ dataLinkGroup: ({
37958
+ setValues,
37959
+ name,
37960
+ onValuesChange,
37961
+ changeLinking,
37962
+ formsValue,
37963
+ input
37964
+ }, {
37965
+ form,
37966
+ groupFormId,
37967
+ isHighlighted
37968
+ }) => {
37689
37969
  return renderDataLinkGroup({
37690
37970
  input,
37691
37971
  name,
@@ -37698,41 +37978,51 @@ const inputTypeComponent$1 = {
37698
37978
  isHighlighted
37699
37979
  });
37700
37980
  },
37701
- groupCheckbox: (_ref62, _ref63) => {
37702
- let {
37703
- setValues,
37704
- name,
37705
- onValuesChange,
37706
- formsValue,
37707
- input
37708
- } = _ref62;
37709
- let {
37710
- form,
37711
- groupFormId,
37712
- isHighlighted
37713
- } = _ref63;
37981
+ groupCheckbox: ({
37982
+ setValues,
37983
+ name,
37984
+ onValuesChange,
37985
+ formsValue,
37986
+ input
37987
+ }, {
37988
+ form,
37989
+ groupFormId,
37990
+ isHighlighted
37991
+ }) => {
37714
37992
  const formData = groupFormId ? (formsValue[groupFormId] || {})[name] || [] : formsValue[name] || [];
37715
37993
  const onUpdate = (val, key) => {
37716
37994
  const _val = {
37717
- [name]: _objectSpread2(_objectSpread2({}, formData), {}, {
37995
+ [name]: {
37996
+ ...formData,
37718
37997
  [key]: val
37719
- })
37998
+ }
37720
37999
  };
37721
38000
  if (groupFormId) {
37722
- const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
37723
- const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
37724
- onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
38001
+ const _defaultData = form?.getFieldValue(groupFormId) || {};
38002
+ const _newData = {
38003
+ ..._defaultData,
38004
+ ..._val
38005
+ };
38006
+ onValuesChange(_newData, {
38007
+ ...formsValue,
37725
38008
  [groupFormId]: _newData
37726
- }));
37727
- form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
37728
- setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
38009
+ });
38010
+ form?.setFieldValue(groupFormId, _newData);
38011
+ setValues({
38012
+ ...formsValue,
37729
38013
  [groupFormId]: _newData
37730
- }));
38014
+ });
37731
38015
  return;
37732
38016
  }
37733
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
37734
- form === null || form === void 0 || form.setFieldValue(name, _val[name]);
37735
- setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
38017
+ onValuesChange(_val, {
38018
+ ...formsValue,
38019
+ ..._val
38020
+ });
38021
+ form?.setFieldValue(name, _val[name]);
38022
+ setValues({
38023
+ ...formsValue,
38024
+ ..._val
38025
+ });
37736
38026
  };
37737
38027
  return /*#__PURE__*/jsxRuntime.jsx(GroupCheckbox, {
37738
38028
  form: input,
@@ -37741,91 +38031,96 @@ const inputTypeComponent$1 = {
37741
38031
  isHighlighted: isHighlighted
37742
38032
  });
37743
38033
  },
37744
- website: (_ref64, _ref65) => {
37745
- let {
37746
- name,
37747
- inputName,
37748
- props,
37749
- value,
37750
- repeatIndex,
37751
- repeatValues,
37752
- formsValue
37753
- } = _ref64;
37754
- let {
37755
- form,
37756
- isHighlighted,
37757
- inputMeta = {},
37758
- t
37759
- } = _ref65;
37760
- return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
38034
+ website: ({
38035
+ name,
38036
+ inputName,
38037
+ props,
38038
+ value,
38039
+ repeatIndex,
38040
+ repeatValues,
38041
+ formsValue
38042
+ }, {
38043
+ form,
38044
+ isHighlighted,
38045
+ inputMeta = {},
38046
+ t
38047
+ }) => {
38048
+ return /*#__PURE__*/jsxRuntime.jsx(Website, {
37761
38049
  size: "large",
37762
38050
  allowClear: true,
37763
- initialValue: value
37764
- }, props), {}, {
38051
+ initialValue: value,
38052
+ ...props,
37765
38053
  onChange: val => updateFormValues$1(repeatIndex, repeatValues, inputName, val, formsValue, name, form),
37766
38054
  className: formatClassname([isHighlighted && "highlighted-cont"]),
37767
38055
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
37768
38056
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com"
37769
- }));
38057
+ });
37770
38058
  },
37771
- group: (_ref66, _ref67) => {
37772
- let {
37773
- props,
37774
- groupInputs,
37775
- formsValue
37776
- } = _ref66;
37777
- let {
37778
- inputMeta,
37779
- isHighlighted
37780
- } = _ref67;
37781
- return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
38059
+ group: ({
38060
+ props,
38061
+ groupInputs,
38062
+ formsValue
38063
+ }, {
38064
+ inputMeta,
38065
+ isHighlighted
38066
+ }) => {
38067
+ return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
37782
38068
  formsValue: formsValue,
37783
38069
  isHighlighted: isHighlighted,
37784
38070
  groupInputs: groupInputs,
37785
- inputMeta: inputMeta
37786
- }, props));
38071
+ inputMeta: inputMeta,
38072
+ ...props
38073
+ });
37787
38074
  },
37788
- groupInputs: (_ref68, _ref69) => {
37789
- let {
37790
- props,
37791
- groupInputs,
37792
- formsValue
37793
- } = _ref68;
37794
- let {
37795
- inputMeta,
37796
- isHighlighted
37797
- } = _ref69;
37798
- return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
38075
+ groupInputs: ({
38076
+ props,
38077
+ groupInputs,
38078
+ formsValue
38079
+ }, {
38080
+ inputMeta,
38081
+ isHighlighted
38082
+ }) => {
38083
+ return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
37799
38084
  formsValue: formsValue,
37800
38085
  isHighlighted: isHighlighted,
37801
38086
  groupInputs: groupInputs,
37802
- inputMeta: inputMeta
37803
- }, props));
38087
+ inputMeta: inputMeta,
38088
+ ...props
38089
+ });
37804
38090
  },
37805
- smartHelp: (_ref70, _ref71) => {
38091
+ smartHelp: ({
38092
+ name,
38093
+ inputName,
38094
+ props,
38095
+ value,
38096
+ repeatIndex,
38097
+ repeatValues,
38098
+ formsValue
38099
+ }, {
38100
+ form,
38101
+ isHighlighted,
38102
+ inputMeta = {},
38103
+ t
38104
+ }) => {
37806
38105
  return /*#__PURE__*/jsxRuntime.jsx(Smart, {});
37807
38106
  }
37808
38107
  };
37809
38108
  const filterForm = (f, d) => {
37810
38109
  return f && (f.showFormIf ? showHideForm(f, d) : true);
37811
38110
  };
37812
- const checkFormHasSubsections = function () {
37813
- let f = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
37814
- return Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
37815
- };
38111
+ const checkFormHasSubsections = (f = {}) => Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
37816
38112
  const mapFormGroup = (f, d) => Object.keys(f).map(key => {
37817
- const _ref72 = f[key] || {},
37818
- {
37819
- label,
37820
- description = "",
37821
- excludeFromEdit,
37822
- showFormIf,
37823
- icon = "",
37824
- position = 0,
37825
- template,
37826
- formClass
37827
- } = _ref72,
37828
- fc = _objectWithoutProperties(_ref72, _excluded2$1);
38113
+ const {
38114
+ label,
38115
+ description = "",
38116
+ excludeFromEdit,
38117
+ showFormIf,
38118
+ icon = "",
38119
+ position = 0,
38120
+ template,
38121
+ formClass,
38122
+ ...fc
38123
+ } = f[key] || {};
37829
38124
  const fConf = {
37830
38125
  id: key,
37831
38126
  label,
@@ -37884,14 +38179,11 @@ const groupSubForms = (fConf, d) => {
37884
38179
  return f;
37885
38180
  }, {});
37886
38181
  };
37887
- const inputIsEmpty = function () {
37888
- let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
37889
- let values = arguments.length > 1 ? arguments[1] : undefined;
37890
- let inputMeta = arguments.length > 2 ? arguments[2] : undefined;
37891
- if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
38182
+ const inputIsEmpty = (input = {}, values, inputMeta) => {
38183
+ if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
37892
38184
  return false;
37893
38185
  }
37894
- if ((input === null || input === void 0 ? void 0 : input.type) === "groupInputs") {
38186
+ if (input?.type === "groupInputs") {
37895
38187
  return true;
37896
38188
  }
37897
38189
  const value = values[input.dataId];
@@ -37903,28 +38195,26 @@ const inputIsEmpty = function () {
37903
38195
  }
37904
38196
  return !value;
37905
38197
  };
37906
- const GetFormItem$1 = _ref73 => {
37907
- var _inputMeta$reviews, _input$meta19, _input$meta20, _rules$find, _input$meta21;
37908
- let {
37909
- highlightMandatory,
37910
- inputData,
37911
- inputId,
37912
- input,
37913
- values,
37914
- MainForm,
37915
- options,
37916
- plainForms,
37917
- setValues,
37918
- setAddress,
37919
- i,
37920
- inputKey,
37921
- onValuesChange = () => {},
37922
- setLoading = () => {},
37923
- inputMeta = {},
37924
- changeInputMeta = () => {},
37925
- changeLinking = () => {},
37926
- namespace
37927
- } = _ref73;
38198
+ const GetFormItem$1 = ({
38199
+ highlightMandatory,
38200
+ inputData,
38201
+ inputId,
38202
+ input,
38203
+ values,
38204
+ MainForm,
38205
+ options,
38206
+ plainForms,
38207
+ setValues,
38208
+ setAddress,
38209
+ i,
38210
+ inputKey,
38211
+ onValuesChange = () => {},
38212
+ setLoading = () => {},
38213
+ inputMeta = {},
38214
+ changeInputMeta = () => {},
38215
+ changeLinking = () => {},
38216
+ namespace
38217
+ }) => {
37928
38218
  const {
37929
38219
  t,
37930
38220
  user,
@@ -37934,44 +38224,49 @@ const GetFormItem$1 = _ref73 => {
37934
38224
  ajaxOptions,
37935
38225
  changeAjaxForms,
37936
38226
  app,
37937
- isReview
38227
+ isReview,
38228
+ maxWidth,
38229
+ staticWidth,
38230
+ fullWidth
37938
38231
  } = useEditContext();
37939
- 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];
38232
+ const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
37940
38233
  const [isShown, setIsShown] = React.useState(!!inputData.commentValue);
37941
38234
  const inputLabel = getInputLabel$1(input, values);
37942
38235
  const onClickReviewSuccess = () => {
37943
38236
  if (!isReview) {
37944
38237
  return;
37945
38238
  }
37946
- const reviewSuccess = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess;
38239
+ const reviewSuccess = lastReview?.reviewSuccess;
37947
38240
  changeInputMeta({
37948
38241
  key: inputId,
37949
38242
  type: input.type,
37950
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
38243
+ value: {
38244
+ ...inputMeta,
37951
38245
  reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
37952
38246
  reviewer: user,
37953
38247
  createdAt: new Date().toISOString(),
37954
38248
  reviewSuccess: true
37955
38249
  }]
37956
- })
38250
+ }
37957
38251
  });
37958
38252
  };
37959
38253
  const onClickReviewError = () => {
37960
38254
  if (!isReview) {
37961
38255
  return;
37962
38256
  }
37963
- const reviewError = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError;
38257
+ const reviewError = lastReview?.reviewError;
37964
38258
  changeInputMeta({
37965
38259
  key: inputId,
37966
38260
  type: input.type,
37967
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
38261
+ value: {
38262
+ ...inputMeta,
37968
38263
  reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
37969
38264
  reviewer: user,
37970
38265
  createdAt: new Date().toISOString(),
37971
38266
  reviewError: true,
37972
38267
  comment: ""
37973
38268
  }]
37974
- })
38269
+ }
37975
38270
  });
37976
38271
  };
37977
38272
  switch (input.type) {
@@ -37985,12 +38280,12 @@ const GetFormItem$1 = _ref73 => {
37985
38280
  case "header":
37986
38281
  return /*#__PURE__*/jsxRuntime.jsxs("div", {
37987
38282
  className: "daf-title with-subtitle",
37988
- style: input === null || input === void 0 || (_input$meta19 = input.meta) === null || _input$meta19 === void 0 ? void 0 : _input$meta19.style,
38283
+ style: input?.meta?.style,
37989
38284
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
37990
38285
  className: "flex",
37991
38286
  children: [/*#__PURE__*/jsxRuntime.jsx("h1", {
37992
38287
  children: ReactHtmlParser__default["default"](getLabel$1(input.label, values))
37993
- }), !!input.description || input !== null && input !== void 0 && (_input$meta20 = input.meta) !== null && _input$meta20 !== void 0 && _input$meta20.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
38288
+ }), !!input.description || input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
37994
38289
  content: /*#__PURE__*/jsxRuntime.jsx("div", {
37995
38290
  className: "tooltip-popover-cont",
37996
38291
  children: ReactHtmlParser__default["default"](input.description)
@@ -38017,7 +38312,7 @@ const GetFormItem$1 = _ref73 => {
38017
38312
  const specialCharsRule = rules.find(r => r.type === "specialCharacters");
38018
38313
 
38019
38314
  // eslint-disable-next-line no-case-declarations
38020
- let maxRule = (_rules$find = rules.find(rule => rule.max)) === null || _rules$find === void 0 ? void 0 : _rules$find.max;
38315
+ let maxRule = rules.find(rule => rule.max)?.max;
38021
38316
  if (!maxRule && input.type === "textarea") {
38022
38317
  maxRule = MAX_TEXT_AREA_LENGTH;
38023
38318
  }
@@ -38030,30 +38325,27 @@ const GetFormItem$1 = _ref73 => {
38030
38325
  message: requiredRule.message || ""
38031
38326
  });
38032
38327
  }
38033
- const isHighlighted = highlightMandatory && (input === null || input === void 0 || (_input$meta21 = input.meta) === null || _input$meta21 === void 0 ? void 0 : _input$meta21.mandatory) && inputIsEmpty(input, values, inputMeta);
38328
+ const isHighlighted = highlightMandatory && input?.meta?.mandatory && inputIsEmpty(input, values, inputMeta);
38034
38329
  if (requiredRule || specialCharsRule) {
38035
38330
  if (input.type === "groupInputs") {
38036
38331
  rules = rules.map(r => {
38037
38332
  if (r.required) {
38038
- return _ref74 => {
38039
- let {
38040
- getFieldValue
38041
- } = _ref74;
38042
- return {
38043
- validator() {
38044
- if (inputMeta.notAvailable || inputMeta.notApplicable) {
38045
- return Promise.resolve();
38046
- }
38047
- const keys = Object.keys(input.inputs);
38048
- for (let i = 0; i < keys.length; i++) {
38049
- if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
38050
- return Promise.reject(r.message);
38051
- }
38052
- }
38333
+ return ({
38334
+ getFieldValue
38335
+ }) => ({
38336
+ validator() {
38337
+ if (inputMeta.notAvailable || inputMeta.notApplicable) {
38053
38338
  return Promise.resolve();
38054
38339
  }
38055
- };
38056
- };
38340
+ const keys = Object.keys(input.inputs);
38341
+ for (let i = 0; i < keys.length; i++) {
38342
+ if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
38343
+ return Promise.reject(r.message);
38344
+ }
38345
+ }
38346
+ return Promise.resolve();
38347
+ }
38348
+ });
38057
38349
  }
38058
38350
  return r;
38059
38351
  });
@@ -38091,13 +38383,12 @@ const GetFormItem$1 = _ref73 => {
38091
38383
  }
38092
38384
  }
38093
38385
  if (input && typeof input === "object") {
38094
- var _input$meta22, _input$meta23, _input$meta24, _input$meta25, _values$parent, _input$meta26, _input$meta27, _inputData$value, _input$meta28, _input$meta29, _inputData$commentVal, _lastReview$comment, _lastReview$reviewer, _lastReview$reviewer2;
38095
38386
  // check if input is valid
38096
38387
  const hideComment = namespace === "project-readiness";
38097
38388
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
38098
38389
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
38099
38390
  className: "flex-row input-cont",
38100
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
38391
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
38101
38392
  extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
38102
38393
  children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
38103
38394
  className: formatClassname(["ml-4 input-actions"]),
@@ -38107,7 +38398,7 @@ const GetFormItem$1 = _ref73 => {
38107
38398
  title: t("Add review note"),
38108
38399
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38109
38400
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38110
- className: formatClassname(["review-btn review-error-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError) && "primary"]),
38401
+ className: formatClassname(["review-btn review-error-btn", lastReview?.reviewError && "primary"]),
38111
38402
  type: "link",
38112
38403
  onClick: onClickReviewError,
38113
38404
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
@@ -38123,7 +38414,7 @@ const GetFormItem$1 = _ref73 => {
38123
38414
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38124
38415
  type: "link",
38125
38416
  onClick: onClickReviewSuccess,
38126
- className: formatClassname(["review-btn review-success-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess) && "primary"]),
38417
+ className: formatClassname(["review-btn review-success-btn", lastReview?.reviewSuccess && "primary"]),
38127
38418
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
38128
38419
  name: "CheckSquare",
38129
38420
  width: 16,
@@ -38160,7 +38451,7 @@ const GetFormItem$1 = _ref73 => {
38160
38451
  }
38161
38452
  });
38162
38453
  },
38163
- disabled: !((_input$meta22 = input.meta) !== null && _input$meta22 !== void 0 && _input$meta22.notApplicable),
38454
+ disabled: !input.meta?.notApplicable,
38164
38455
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
38165
38456
  name: "NotApplicable",
38166
38457
  width: 16,
@@ -38174,7 +38465,7 @@ const GetFormItem$1 = _ref73 => {
38174
38465
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
38175
38466
  className: formatClassname(["default p-0", inputMeta.notAvailable && "primary"]),
38176
38467
  type: "link",
38177
- disabled: !((_input$meta23 = input.meta) !== null && _input$meta23 !== void 0 && _input$meta23.notAvailable),
38468
+ disabled: !input.meta?.notAvailable,
38178
38469
  onClick: () => {
38179
38470
  const value = getDefaultInputValue(input);
38180
38471
  MainForm.setFields([{
@@ -38206,14 +38497,14 @@ const GetFormItem$1 = _ref73 => {
38206
38497
  }), !hideComment ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
38207
38498
  title: t("Add comment"),
38208
38499
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38209
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
38500
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
38210
38501
  type: "link",
38211
- disabled: !((_input$meta24 = input.meta) !== null && _input$meta24 !== void 0 && _input$meta24.comment)
38212
- }, !isShown ? {
38213
- className: "default p-0"
38214
- } : {
38215
- className: "p-0 primary"
38216
- }), {}, {
38502
+ disabled: !input.meta?.comment,
38503
+ ...(!isShown ? {
38504
+ className: "default p-0"
38505
+ } : {
38506
+ className: "p-0 primary"
38507
+ }),
38217
38508
  onClick: () => {
38218
38509
  if (inputMeta.comment !== undefined && inputMeta.comment !== null) {
38219
38510
  return;
@@ -38232,7 +38523,7 @@ const GetFormItem$1 = _ref73 => {
38232
38523
  width: 16,
38233
38524
  height: 16
38234
38525
  })
38235
- }))
38526
+ })
38236
38527
  })
38237
38528
  }) : /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
38238
38529
  title: t("Project Readiness"),
@@ -38251,34 +38542,36 @@ const GetFormItem$1 = _ref73 => {
38251
38542
  }) : null]
38252
38543
  }) : null
38253
38544
  }),
38254
- initialValue: inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.defaultValue
38255
- }, inputOnBlur.includes(input.type) ? {
38256
- trigger: "onBlur"
38257
- } : {}), ["total100", "group"].includes(input.type) ? {} : {
38258
- name: inputId,
38259
- fieldKey: inputId,
38260
- initialValue: inputData.value
38261
- }), ["upload"].includes(input.type) ? {
38262
- valuePropName: "fileList",
38263
- getValueFromEvent: e => {
38264
- if (Array.isArray(e)) {
38265
- return e;
38266
- }
38267
- return e && e.fileList && e.fileList.map(f => {
38268
- if (f.response) {
38269
- return f.response;
38545
+ initialValue: inputMeta?.defaultValue,
38546
+ ...(inputOnBlur.includes(input.type) ? {
38547
+ trigger: "onBlur"
38548
+ } : {}),
38549
+ ...(["total100", "group"].includes(input.type) ? {} : {
38550
+ name: inputId,
38551
+ fieldKey: inputId,
38552
+ initialValue: inputData.value
38553
+ }),
38554
+ ...(["upload"].includes(input.type) ? {
38555
+ valuePropName: "fileList",
38556
+ getValueFromEvent: e => {
38557
+ if (Array.isArray(e)) {
38558
+ return e;
38270
38559
  }
38271
- return f;
38272
- });
38273
- }
38274
- } : {}), {}, {
38275
- className: formatClassname(["i-".concat(input.type, " flex-1"), input.comment && "with-comment", maxRule && "with-max-rule"]),
38560
+ return e && e.fileList && e.fileList.map(f => {
38561
+ if (f.response) {
38562
+ return f.response;
38563
+ }
38564
+ return f;
38565
+ });
38566
+ }
38567
+ } : {}),
38568
+ className: formatClassname([`i-${input.type} flex-1`, input.comment && "with-comment", maxRule && "with-max-rule"]),
38276
38569
  "data-id": inputData.name,
38277
38570
  rules: rules,
38278
38571
  required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
38279
38572
  labelCol: 12,
38280
38573
  label: /*#__PURE__*/jsxRuntime.jsx("div", {
38281
- className: formatClassname(["flex", (input === null || input === void 0 || (_input$meta25 = input.meta) === null || _input$meta25 === void 0 ? void 0 : _input$meta25.code) && "mr-10"]),
38574
+ className: formatClassname(["flex", input?.meta?.code && "mr-10"]),
38282
38575
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
38283
38576
  className: "mr-1",
38284
38577
  children: getInputLabel$1(input, values)
@@ -38291,7 +38584,7 @@ const GetFormItem$1 = _ref73 => {
38291
38584
  config: input,
38292
38585
  t: t,
38293
38586
  ajaxForms: ajaxForms,
38294
- 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),
38587
+ linkingData: values?.linking || values?.parent?.linking,
38295
38588
  changeAjaxForms: changeAjaxForms,
38296
38589
  getApiBaseUrl: getApiBaseUrl,
38297
38590
  getAppHeader: getAppHeader,
@@ -38299,7 +38592,12 @@ const GetFormItem$1 = _ref73 => {
38299
38592
  getToken: getToken,
38300
38593
  app: app,
38301
38594
  valueOnlyString: true
38302
- }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](inputData, {
38595
+ }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
38596
+ ...inputData,
38597
+ maxWidth,
38598
+ staticWidth,
38599
+ fullWidth
38600
+ }, {
38303
38601
  form: MainForm,
38304
38602
  forms: options,
38305
38603
  allForms: plainForms,
@@ -38315,12 +38613,15 @@ const GetFormItem$1 = _ref73 => {
38315
38613
  t,
38316
38614
  getApiBaseUrl,
38317
38615
  getAppHeader,
38318
- isHighlighted
38616
+ isHighlighted,
38617
+ maxWidth,
38618
+ staticWidth,
38619
+ fullWidth
38319
38620
  }) : console.log(input)
38320
- })), (_input$meta26 = input.meta) !== null && _input$meta26 !== void 0 && _input$meta26.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
38621
+ }), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
38321
38622
  className: "code",
38322
38623
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
38323
- children: (_input$meta27 = input.meta) === null || _input$meta27 === void 0 ? void 0 : _input$meta27.code
38624
+ children: input.meta?.code
38324
38625
  })
38325
38626
  }) : null]
38326
38627
  }), maxRule ? ["imageUpload", "upload", "videoUpload"].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -38340,10 +38641,10 @@ const GetFormItem$1 = _ref73 => {
38340
38641
  className: "max-char-span",
38341
38642
  children: t("max-char", {
38342
38643
  chars: maxRule,
38343
- filled: (inputData === null || inputData === void 0 || (_inputData$value = inputData.value) === null || _inputData$value === void 0 ? void 0 : _inputData$value.length) || 0
38644
+ filled: inputData?.value?.length || 0
38344
38645
  })
38345
38646
  })
38346
- }) : null, (_input$meta28 = input.meta) !== null && _input$meta28 !== void 0 && _input$meta28.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
38647
+ }) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
38347
38648
  className: "input-content",
38348
38649
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
38349
38650
  className: "comment-textarea",
@@ -38369,7 +38670,7 @@ const GetFormItem$1 = _ref73 => {
38369
38670
  },
38370
38671
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
38371
38672
  type: "link",
38372
- disabled: !((_input$meta29 = input.meta) !== null && _input$meta29 !== void 0 && _input$meta29.comment),
38673
+ disabled: !input.meta?.comment,
38373
38674
  className: "p-0",
38374
38675
  children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
38375
38676
  width: 16,
@@ -38378,7 +38679,12 @@ const GetFormItem$1 = _ref73 => {
38378
38679
  })
38379
38680
  })]
38380
38681
  }),
38381
- children: inputTypeComponent$1.comment(inputData, {
38682
+ children: inputTypeComponent$1.comment({
38683
+ ...inputData,
38684
+ maxWidth,
38685
+ staticWidth,
38686
+ fullWidth
38687
+ }, {
38382
38688
  form: MainForm,
38383
38689
  forms: options,
38384
38690
  setFormValues: setValues,
@@ -38394,22 +38700,25 @@ const GetFormItem$1 = _ref73 => {
38394
38700
  },
38395
38701
  t,
38396
38702
  getApiBaseUrl,
38397
- getAppHeader
38703
+ getAppHeader,
38704
+ maxWidth,
38705
+ staticWidth,
38706
+ fullWidth
38398
38707
  })
38399
38708
  }), /*#__PURE__*/jsxRuntime.jsx("span", {
38400
38709
  className: "max-char-span",
38401
38710
  children: t("max-char", {
38402
38711
  chars: MAX_COMMENTS_LENGTH,
38403
- filled: (inputData === null || inputData === void 0 || (_inputData$commentVal = inputData.commentValue) === null || _inputData$commentVal === void 0 ? void 0 : _inputData$commentVal.length) || 0
38712
+ filled: inputData?.commentValue?.length || 0
38404
38713
  })
38405
38714
  })]
38406
- }) : null, lastReview !== null && lastReview !== void 0 && lastReview.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
38715
+ }) : null, lastReview?.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
38407
38716
  className: "input-content",
38408
38717
  children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
38409
38718
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
38410
38719
  className: "comment-textarea",
38411
- initialValue: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || "",
38412
- name: "".concat(inputId, "-reviewErrorComment"),
38720
+ initialValue: lastReview?.comment || "",
38721
+ name: `${inputId}-reviewErrorComment`,
38413
38722
  label: /*#__PURE__*/jsxRuntime.jsx("div", {
38414
38723
  className: "flex w-100",
38415
38724
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -38417,35 +38726,45 @@ const GetFormItem$1 = _ref73 => {
38417
38726
  children: t("Review note")
38418
38727
  })
38419
38728
  }),
38420
- children: inputTypeComponent$1.comment(inputData, {
38729
+ children: inputTypeComponent$1.comment({
38730
+ ...inputData,
38731
+ maxWidth,
38732
+ staticWidth,
38733
+ fullWidth
38734
+ }, {
38421
38735
  form: MainForm,
38422
38736
  forms: options,
38423
- value: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || "",
38737
+ value: lastReview?.comment || "",
38424
38738
  onChange: val => {
38425
38739
  changeInputMeta({
38426
38740
  key: inputId,
38427
38741
  type: input.type,
38428
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
38429
- reviews: ((inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.reviews) || []).map(v => {
38742
+ value: {
38743
+ ...inputMeta,
38744
+ reviews: (inputMeta?.reviews || []).map(v => {
38430
38745
  if (v.createdAt === lastReview.createdAt) {
38431
- return _objectSpread2(_objectSpread2({}, v), {}, {
38746
+ return {
38747
+ ...v,
38432
38748
  comment: val
38433
- });
38749
+ };
38434
38750
  }
38435
38751
  return v;
38436
38752
  })
38437
- })
38753
+ }
38438
38754
  });
38439
38755
  },
38440
38756
  t,
38441
38757
  getApiBaseUrl,
38442
- getAppHeader
38758
+ getAppHeader,
38759
+ maxWidth,
38760
+ staticWidth,
38761
+ fullWidth
38443
38762
  })
38444
38763
  }), /*#__PURE__*/jsxRuntime.jsx("span", {
38445
38764
  className: "max-char-span",
38446
38765
  children: t("max-char", {
38447
38766
  chars: MAX_COMMENTS_LENGTH,
38448
- filled: ((_lastReview$comment = lastReview.comment) === null || _lastReview$comment === void 0 ? void 0 : _lastReview$comment.length) || 0
38767
+ filled: lastReview.comment?.length || 0
38449
38768
  })
38450
38769
  })]
38451
38770
  }) : /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -38466,7 +38785,7 @@ const GetFormItem$1 = _ref73 => {
38466
38785
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
38467
38786
  className: "flex flex-column justify-center mr-1",
38468
38787
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
38469
- 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")
38788
+ children: lastReview?.reviewer?.firstName + " " + lastReview?.reviewer?.lastName + " - " + moment__default["default"](lastReview.createdAt).format("DD MMM YYYY")
38470
38789
  })
38471
38790
  })]
38472
38791
  })]
@@ -38477,14 +38796,13 @@ const GetFormItem$1 = _ref73 => {
38477
38796
  return null;
38478
38797
  }
38479
38798
  };
38480
- const editErrorHandler = _ref76 => {
38481
- let {
38482
- errorFields,
38483
- t = s => s
38484
- } = _ref76;
38799
+ const editErrorHandler = ({
38800
+ errorFields,
38801
+ t = s => s
38802
+ }) => {
38485
38803
  if (Array.isArray(errorFields) && errorFields.length) {
38486
38804
  const name = errorFields[0].name.join(".");
38487
- const element = document.querySelector("[data-id=\"".concat(name, "\"]"));
38805
+ const element = document.querySelector(`[data-id="${name}"]`);
38488
38806
  if (element) {
38489
38807
  element.scrollIntoView();
38490
38808
  antd.message.error(t("errors::please-correct-invalid-inputs"));
@@ -54107,7 +54425,7 @@ const checkboxConfig$9 = {
54107
54425
  datastakeId: "ID"
54108
54426
  };
54109
54427
 
54110
- const getNameByLevel$1 = (data, level) => {
54428
+ const getAdminLevelName = (data, level) => {
54111
54429
  const entry = Object.values(data || {}).find(item => item.level === level);
54112
54430
  return entry?.name || "-";
54113
54431
  };
@@ -54235,7 +54553,7 @@ const getColumns$4 = ({
54235
54553
  if (all?.administrativeLevel1 && value === all?.administrativeLevel1) {
54236
54554
  label = all?.linking?.SCL?.[value]?.name;
54237
54555
  } else {
54238
- label = getNameByLevel$1(all?.linking?.SCL, "level_1")?.name;
54556
+ label = getAdminLevelName(all?.linking?.SCL, "level_1");
54239
54557
  }
54240
54558
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
54241
54559
  title: label || '-',
@@ -54258,7 +54576,7 @@ const getColumns$4 = ({
54258
54576
  if (all?.administrativeLevel2 && value === all?.administrativeLevel2) {
54259
54577
  label = all?.linking?.SCL?.[value]?.name;
54260
54578
  } else {
54261
- label = getNameByLevel$1(all?.linking?.SCL, "level_2")?.name;
54579
+ label = getAdminLevelName(all?.linking?.SCL, "level_2");
54262
54580
  }
54263
54581
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
54264
54582
  title: label || '-',
@@ -54335,77 +54653,6 @@ const getColumns$4 = ({
54335
54653
  return cols.filter(c => c[show]);
54336
54654
  };
54337
54655
 
54338
- const getTabs = ({
54339
- t
54340
- }) => {
54341
- return [{
54342
- key: "active",
54343
- label: t("Active")
54344
- }, {
54345
- key: "pending",
54346
- label: t("Pending")
54347
- }, {
54348
- key: 'suspended',
54349
- label: t("Suspended")
54350
- }];
54351
- };
54352
- const selectFiltersConfig$8 = {
54353
- category: {
54354
- type: "select",
54355
- label: "Category",
54356
- placeholder: t => t("Category"),
54357
- style: {
54358
- flex: 1
54359
- },
54360
- labelStyle: {
54361
- flex: 1
54362
- },
54363
- getLabel: option => option.label,
54364
- getValue: option => option.value
54365
- },
54366
- country: {
54367
- type: "select",
54368
- label: "Country",
54369
- placeholder: t => t("Country"),
54370
- style: {
54371
- flex: 1
54372
- },
54373
- labelStyle: {
54374
- flex: 1
54375
- },
54376
- getLabel: option => option.label,
54377
- getValue: option => option.value
54378
- },
54379
- sources: {
54380
- type: "select",
54381
- label: "Sources",
54382
- placeholder: t => t("Sources"),
54383
- style: {
54384
- flex: 1
54385
- },
54386
- labelStyle: {
54387
- flex: 1
54388
- },
54389
- getLabel: option => option.label,
54390
- getValue: option => option.value
54391
- }
54392
- };
54393
- const filtersConfig$8 = {
54394
- name: "",
54395
- datastakeId: ""
54396
- };
54397
- const defaultUrlParams$1 = {
54398
- activeTab: "active"
54399
- };
54400
- const checkboxConfig$8 = {
54401
- name: "Name",
54402
- datastakeId: "ID"
54403
- };
54404
- const getNameByLevel = (data, level) => {
54405
- const entry = Object.values(data || {}).find(item => item.level === level);
54406
- return entry;
54407
- };
54408
-
54409
54656
  const getColumns$3 = ({
54410
54657
  t,
54411
54658
  selectOptions,
@@ -54469,7 +54716,7 @@ const getColumns$3 = ({
54469
54716
  if (all?.administrativeLevel1 && value === all?.administrativeLevel1) {
54470
54717
  label = all?.linking?.SCL?.[value]?.name;
54471
54718
  } else {
54472
- label = getNameByLevel(all?.linking?.SCL, "level_1")?.name;
54719
+ label = getAdminLevelName(all?.linking?.SCL, "level_1");
54473
54720
  }
54474
54721
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
54475
54722
  title: label || '-',
@@ -54486,7 +54733,7 @@ const getColumns$3 = ({
54486
54733
  if (all?.administrativeLevel2 && value === all?.administrativeLevel2) {
54487
54734
  label = all?.linking?.SCL?.[value]?.name;
54488
54735
  } else {
54489
- label = getNameByLevel(all?.linking?.SCL, "level_2")?.name;
54736
+ label = getAdminLevelName(all?.linking?.SCL, "level_2");
54490
54737
  }
54491
54738
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
54492
54739
  title: label || '-',
@@ -54635,7 +54882,7 @@ function CombineLocationModal({
54635
54882
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
54636
54883
  placeholder: t("Province"),
54637
54884
  options: selectedLocations.map(location => {
54638
- const _data = getNameByLevel(location?.linking?.SCL, "level_1");
54885
+ const _data = getAdminLevelName(location?.linking?.SCL, "level_1");
54639
54886
  return {
54640
54887
  label: _data?.name || "-",
54641
54888
  value: _data?.id || "-"
@@ -54648,7 +54895,7 @@ function CombineLocationModal({
54648
54895
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
54649
54896
  placeholder: t("Territory"),
54650
54897
  options: selectedLocations.map(location => {
54651
- const _data = getNameByLevel(location?.linking?.SCL, "level_2");
54898
+ const _data = getAdminLevelName(location?.linking?.SCL, "level_2");
54652
54899
  return {
54653
54900
  label: _data?.name || "-",
54654
54901
  value: _data?.id || "-"
@@ -54870,6 +55117,73 @@ function LocationTable(_ref) {
54870
55117
  });
54871
55118
  }
54872
55119
 
55120
+ const getTabs = ({
55121
+ t
55122
+ }) => {
55123
+ return [{
55124
+ key: "active",
55125
+ label: t("Active")
55126
+ }, {
55127
+ key: "pending",
55128
+ label: t("Pending")
55129
+ }, {
55130
+ key: 'suspended',
55131
+ label: t("Suspended")
55132
+ }];
55133
+ };
55134
+ const selectFiltersConfig$8 = {
55135
+ category: {
55136
+ type: "select",
55137
+ label: "Category",
55138
+ placeholder: t => t("Category"),
55139
+ style: {
55140
+ flex: 1
55141
+ },
55142
+ labelStyle: {
55143
+ flex: 1
55144
+ },
55145
+ getLabel: option => option.label,
55146
+ getValue: option => option.value
55147
+ },
55148
+ country: {
55149
+ type: "select",
55150
+ label: "Country",
55151
+ placeholder: t => t("Country"),
55152
+ style: {
55153
+ flex: 1
55154
+ },
55155
+ labelStyle: {
55156
+ flex: 1
55157
+ },
55158
+ getLabel: option => option.label,
55159
+ getValue: option => option.value
55160
+ },
55161
+ sources: {
55162
+ type: "select",
55163
+ label: "Sources",
55164
+ placeholder: t => t("Sources"),
55165
+ style: {
55166
+ flex: 1
55167
+ },
55168
+ labelStyle: {
55169
+ flex: 1
55170
+ },
55171
+ getLabel: option => option.label,
55172
+ getValue: option => option.value
55173
+ }
55174
+ };
55175
+ const filtersConfig$8 = {
55176
+ name: "",
55177
+ datastakeId: ""
55178
+ };
55179
+ const defaultUrlParams$1 = {
55180
+ activeTab: "active"
55181
+ };
55182
+ const checkboxConfig$8 = {
55183
+ name: "Name",
55184
+ datastakeId: "ID"
55185
+ };
55186
+
54873
55187
  const getColumns$2 = ({
54874
55188
  t,
54875
55189
  goTo = () => {},
@@ -54996,7 +55310,7 @@ const getColumns$2 = ({
54996
55310
  if (all?.administrativeLevel1 && value === all?.administrativeLevel1) {
54997
55311
  label = all?.linking?.SCL?.[value]?.name;
54998
55312
  } else {
54999
- label = getNameByLevel(all?.linking?.SCL, "level_1")?.name;
55313
+ label = getAdminLevelName(all?.linking?.SCL, "level_1");
55000
55314
  }
55001
55315
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
55002
55316
  title: label || '-',
@@ -55019,7 +55333,7 @@ const getColumns$2 = ({
55019
55333
  if (all?.administrativeLevel2 && value === all?.administrativeLevel2) {
55020
55334
  label = all?.linking?.SCL?.[value]?.name;
55021
55335
  } else {
55022
- label = getNameByLevel(all?.linking?.SCL, "level_2")?.name;
55336
+ label = getAdminLevelName(all?.linking?.SCL, "level_2");
55023
55337
  }
55024
55338
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
55025
55339
  title: label || '-',
@@ -55174,7 +55488,7 @@ const getColumns$1 = ({
55174
55488
  if (all?.administrativeLevel1 && value === all?.administrativeLevel1) {
55175
55489
  label = all?.linking?.SCL?.[value]?.name;
55176
55490
  } else {
55177
- label = getNameByLevel(all?.linking?.SCL, "level_1")?.name;
55491
+ label = getAdminLevelName(all?.linking?.SCL, "level_1");
55178
55492
  }
55179
55493
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
55180
55494
  title: label || '-',
@@ -55191,7 +55505,7 @@ const getColumns$1 = ({
55191
55505
  if (all?.administrativeLevel2 && value === all?.administrativeLevel2) {
55192
55506
  label = all?.linking?.SCL?.[value]?.name;
55193
55507
  } else {
55194
- label = getNameByLevel(all?.linking?.SCL, "level_2")?.name;
55508
+ label = getAdminLevelName(all?.linking?.SCL, "level_2");
55195
55509
  }
55196
55510
  return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
55197
55511
  title: label || '-',
@@ -55323,7 +55637,7 @@ function CombineSubjectsModal({
55323
55637
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
55324
55638
  placeholder: t("Province"),
55325
55639
  options: mapToSelectOptions(selectedSubjects, null, selectOptions, null, subject => {
55326
- const _data = getNameByLevel(subject?.linking?.SCL, "level_1");
55640
+ const _data = getAdminLevelName(subject?.linking?.SCL, "level_1");
55327
55641
  return {
55328
55642
  label: _data?.name || "-",
55329
55643
  value: _data?.id || "-"
@@ -55336,7 +55650,7 @@ function CombineSubjectsModal({
55336
55650
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
55337
55651
  placeholder: t("Territory"),
55338
55652
  options: mapToSelectOptions(selectedSubjects, null, selectOptions, null, subject => {
55339
- const _data = getNameByLevel(subject?.linking?.SCL, "level_2");
55653
+ const _data = getAdminLevelName(subject?.linking?.SCL, "level_2");
55340
55654
  return {
55341
55655
  label: _data?.name || "-",
55342
55656
  value: _data?.id || "-"