datastake-daf 0.6.826 → 0.6.827

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.
@@ -4827,7 +4827,7 @@ const config$2 = {
4827
4827
  AddDocument: config$3
4828
4828
  };
4829
4829
 
4830
- const _excluded$D = ["width", "height", "size", "name", "fill"];
4830
+ const _excluded$E = ["width", "height", "size", "name", "fill"];
4831
4831
  const CustomIcon = _ref => {
4832
4832
  let {
4833
4833
  width = 14,
@@ -4836,7 +4836,7 @@ const CustomIcon = _ref => {
4836
4836
  name = "",
4837
4837
  fill = "none"
4838
4838
  } = _ref,
4839
- props = _objectWithoutProperties(_ref, _excluded$D);
4839
+ props = _objectWithoutProperties(_ref, _excluded$E);
4840
4840
  const conf = config$2[name];
4841
4841
  if (conf) {
4842
4842
  return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread2(_objectSpread2({}, props), {}, {
@@ -5125,7 +5125,7 @@ createCommonjsModule(function (module, exports) {
5125
5125
  !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])+"]"}}}));
5126
5126
  });
5127
5127
 
5128
- const _excluded$C = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
5128
+ const _excluded$D = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
5129
5129
  dayjs__default["default"].extend(customParseFormat);
5130
5130
  dayjs__default["default"].extend(utc);
5131
5131
  dayjs__default["default"].extend(utc);
@@ -5501,7 +5501,7 @@ const filterCreateData = data => {
5501
5501
  createdAt,
5502
5502
  updatedAt
5503
5503
  } = data,
5504
- rest = _objectWithoutProperties(data, _excluded$C);
5504
+ rest = _objectWithoutProperties(data, _excluded$D);
5505
5505
  const _meta = isObjectEmpty(meta) ? undefined : meta;
5506
5506
  return _objectSpread2(_objectSpread2({}, rest), {}, {
5507
5507
  meta: _meta
@@ -6033,7 +6033,7 @@ SelectFilters.propTypes = {
6033
6033
  apiUrl: PropTypes__default["default"].string
6034
6034
  };
6035
6035
 
6036
- const _excluded$B = ["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"];
6036
+ const _excluded$C = ["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"];
6037
6037
  function DAFTable(_ref) {
6038
6038
  let {
6039
6039
  columns = [],
@@ -6064,7 +6064,7 @@ function DAFTable(_ref) {
6064
6064
  app,
6065
6065
  doEmptyRows
6066
6066
  } = _ref,
6067
- rest = _objectWithoutProperties(_ref, _excluded$B);
6067
+ rest = _objectWithoutProperties(_ref, _excluded$C);
6068
6068
  const source = React.useMemo(() => {
6069
6069
  if (data && Array.isArray(data)) {
6070
6070
  return data;
@@ -6889,7 +6889,7 @@ function ComponentWithFocus(_ref) {
6889
6889
  }
6890
6890
 
6891
6891
  var _templateObject$h;
6892
- const _excluded$A = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
6892
+ const _excluded$B = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
6893
6893
  function StickyTable(_ref) {
6894
6894
  let {
6895
6895
  size = "small",
@@ -6900,7 +6900,7 @@ function StickyTable(_ref) {
6900
6900
  pagination = false,
6901
6901
  doEmptyRows = true
6902
6902
  } = _ref,
6903
- props = _objectWithoutProperties(_ref, _excluded$A);
6903
+ props = _objectWithoutProperties(_ref, _excluded$B);
6904
6904
  const data = React__default["default"].useMemo(() => {
6905
6905
  if (!doEmptyRows) {
6906
6906
  return dataSource;
@@ -7428,7 +7428,7 @@ const BTN_SIZE = {
7428
7428
  LG: 'large'
7429
7429
  };
7430
7430
 
7431
- const _excluded$z = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
7431
+ const _excluded$A = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
7432
7432
  function DafButton(_ref) {
7433
7433
  let {
7434
7434
  content = '',
@@ -7442,7 +7442,7 @@ function DafButton(_ref) {
7442
7442
  style = {},
7443
7443
  className = ''
7444
7444
  } = _ref,
7445
- restProps = _objectWithoutProperties(_ref, _excluded$z);
7445
+ restProps = _objectWithoutProperties(_ref, _excluded$A);
7446
7446
  return /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
7447
7447
  icon: icon,
7448
7448
  type: type,
@@ -7561,12 +7561,12 @@ const Style$R = styled__default["default"].div`
7561
7561
  }
7562
7562
  `;
7563
7563
 
7564
- const _excluded$y = ["children"];
7564
+ const _excluded$z = ["children"];
7565
7565
  const BorderedButton = _ref => {
7566
7566
  let {
7567
7567
  children
7568
7568
  } = _ref,
7569
- props = _objectWithoutProperties(_ref, _excluded$y);
7569
+ props = _objectWithoutProperties(_ref, _excluded$z);
7570
7570
  return /*#__PURE__*/jsxRuntime.jsx(Style$R, {
7571
7571
  className: "d-btn-cont",
7572
7572
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({}, props), {}, {
@@ -7706,12 +7706,12 @@ Badge.propTypes = {
7706
7706
  props: PropTypes__default["default"].object
7707
7707
  };
7708
7708
 
7709
- const _excluded$x = ["icon"];
7709
+ const _excluded$y = ["icon"];
7710
7710
  function GetIcon(_ref) {
7711
7711
  let {
7712
7712
  icon
7713
7713
  } = _ref,
7714
- props = _objectWithoutProperties(_ref, _excluded$x);
7714
+ props = _objectWithoutProperties(_ref, _excluded$y);
7715
7715
  let Icon = Icons__namespace.CloseOutlined;
7716
7716
  if (Icons__namespace[icon]) {
7717
7717
  Icon = Icons__namespace[icon];
@@ -8041,7 +8041,7 @@ const MultiSelectStyled = styled__default["default"](antd.Select)`
8041
8041
  }
8042
8042
  `;
8043
8043
 
8044
- const _excluded$w = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
8044
+ const _excluded$x = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
8045
8045
  const {
8046
8046
  useToken: useToken$p
8047
8047
  } = antd.theme;
@@ -8134,7 +8134,7 @@ function Multiselect(_ref) {
8134
8134
  isSingle = false,
8135
8135
  selectionType = SELECTION_TYPES.DEFAULT
8136
8136
  } = _ref,
8137
- restProps = _objectWithoutProperties(_ref, _excluded$w);
8137
+ restProps = _objectWithoutProperties(_ref, _excluded$x);
8138
8138
  const {
8139
8139
  token
8140
8140
  } = useToken$p();
@@ -8854,7 +8854,7 @@ DAFHeader.propTypes = {
8854
8854
  filtersConfig: PropTypes__default["default"].any
8855
8855
  };
8856
8856
 
8857
- const _excluded$v = ["tabs", "onChange", "value", "className"];
8857
+ const _excluded$w = ["tabs", "onChange", "value", "className"];
8858
8858
  function TabsHeader(_ref) {
8859
8859
  let {
8860
8860
  tabs = [],
@@ -8862,7 +8862,7 @@ function TabsHeader(_ref) {
8862
8862
  value = '',
8863
8863
  className = 'mt-2'
8864
8864
  } = _ref,
8865
- rest = _objectWithoutProperties(_ref, _excluded$v);
8865
+ rest = _objectWithoutProperties(_ref, _excluded$w);
8866
8866
  return /*#__PURE__*/jsxRuntime.jsx("div", {
8867
8867
  className: formatClassname(['daf-tabs-header pl-6 pr-6', className]),
8868
8868
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Tabs, _objectSpread2({
@@ -8959,7 +8959,7 @@ DrawerHeader.propTypes = {
8959
8959
  tabsConfig: PropTypes__default["default"].any
8960
8960
  };
8961
8961
 
8962
- const _excluded$u = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
8962
+ const _excluded$v = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
8963
8963
  const useFooter = _ref => {
8964
8964
  let {
8965
8965
  leftContent,
@@ -8994,7 +8994,7 @@ const useFooter = _ref => {
8994
8994
  style = {},
8995
8995
  className = ""
8996
8996
  } = button,
8997
- restProps = _objectWithoutProperties(button, _excluded$u);
8997
+ restProps = _objectWithoutProperties(button, _excluded$v);
8998
8998
  return /*#__PURE__*/jsxRuntime.jsx(DafButton, _objectSpread2({
8999
8999
  content: label,
9000
9000
  type: type,
@@ -11875,7 +11875,7 @@ Widget.propTypes = {
11875
11875
  };
11876
11876
  Widget.displayName = 'Widget';
11877
11877
 
11878
- const _excluded$t = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
11878
+ const _excluded$u = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
11879
11879
  function ImageWidget(_ref) {
11880
11880
  let {
11881
11881
  loading = false,
@@ -11886,7 +11886,7 @@ function ImageWidget(_ref) {
11886
11886
  noDescriptionText,
11887
11887
  isPdf = false
11888
11888
  } = _ref,
11889
- props = _objectWithoutProperties(_ref, _excluded$t);
11889
+ props = _objectWithoutProperties(_ref, _excluded$u);
11890
11890
  const expandable = isPdf ? false : props.expandable;
11891
11891
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
11892
11892
  loading: loading,
@@ -11946,7 +11946,7 @@ function ImageWidget(_ref) {
11946
11946
  ImageWidget.displayName = 'ImageWidget';
11947
11947
 
11948
11948
  var _templateObject$e;
11949
- const _excluded$s = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
11949
+ const _excluded$t = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
11950
11950
  function FlowWidget(_ref) {
11951
11951
  let {
11952
11952
  title,
@@ -11958,7 +11958,7 @@ function FlowWidget(_ref) {
11958
11958
  className,
11959
11959
  direction = "horizontal"
11960
11960
  } = _ref,
11961
- rest = _objectWithoutProperties(_ref, _excluded$s);
11961
+ rest = _objectWithoutProperties(_ref, _excluded$t);
11962
11962
  const [activeTab, setActiveTab] = React.useState();
11963
11963
  React.useEffect(() => {
11964
11964
  if (defaultActiveTab) {
@@ -15689,7 +15689,7 @@ Map$3.propTypes = {
15689
15689
  link: PropTypes__default["default"].any
15690
15690
  };
15691
15691
 
15692
- const _excluded$r = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
15692
+ const _excluded$s = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
15693
15693
  function InExpandableWidgetMap(_ref) {
15694
15694
  let {
15695
15695
  isExpanded,
@@ -15703,7 +15703,7 @@ function InExpandableWidgetMap(_ref) {
15703
15703
  height,
15704
15704
  widgetConfig
15705
15705
  } = _ref,
15706
- rest = _objectWithoutProperties(_ref, _excluded$r);
15706
+ rest = _objectWithoutProperties(_ref, _excluded$s);
15707
15707
  const [mapKey, setMapKey] = React.useState(0);
15708
15708
  const [isMapReady, setIsMapReady] = React.useState(false);
15709
15709
  React.useEffect(() => {
@@ -17903,14 +17903,14 @@ const MapConfig = ({
17903
17903
  });
17904
17904
  };
17905
17905
 
17906
- const _excluded$q = ["config", "title", "loading"];
17906
+ const _excluded$r = ["config", "title", "loading"];
17907
17907
  const Details = _ref => {
17908
17908
  let {
17909
17909
  config = [],
17910
17910
  title,
17911
17911
  loading = false
17912
17912
  } = _ref,
17913
- rest = _objectWithoutProperties(_ref, _excluded$q);
17913
+ rest = _objectWithoutProperties(_ref, _excluded$r);
17914
17914
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
17915
17915
  className: "with-border-header h-w-btn-header card",
17916
17916
  loading: loading,
@@ -17926,14 +17926,14 @@ const Details = _ref => {
17926
17926
  }));
17927
17927
  };
17928
17928
 
17929
- const _excluded$p = ["config", "title", "loading"];
17929
+ const _excluded$q = ["config", "title", "loading"];
17930
17930
  const KeyIndicatorsDetails = _ref => {
17931
17931
  let {
17932
17932
  config,
17933
17933
  title,
17934
17934
  loading = false
17935
17935
  } = _ref,
17936
- rest = _objectWithoutProperties(_ref, _excluded$p);
17936
+ rest = _objectWithoutProperties(_ref, _excluded$q);
17937
17937
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
17938
17938
  className: "with-border-header h-w-btn-header",
17939
17939
  title: title,
@@ -17963,7 +17963,7 @@ const Style$G = styled__default["default"].div`
17963
17963
  }
17964
17964
  `;
17965
17965
 
17966
- const _excluded$o = ["children", "config", "detailsTitle", "firstColumnWidth"];
17966
+ const _excluded$p = ["children", "config", "detailsTitle", "firstColumnWidth"];
17967
17967
  const DetailsSection = _ref => {
17968
17968
  let {
17969
17969
  children,
@@ -17971,7 +17971,7 @@ const DetailsSection = _ref => {
17971
17971
  detailsTitle,
17972
17972
  firstColumnWidth = "250px"
17973
17973
  } = _ref,
17974
- rest = _objectWithoutProperties(_ref, _excluded$o);
17974
+ rest = _objectWithoutProperties(_ref, _excluded$p);
17975
17975
  return /*#__PURE__*/jsxRuntime.jsx(Style$G, {
17976
17976
  firstColumnWidth: firstColumnWidth,
17977
17977
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -18147,14 +18147,14 @@ const getGoalConfig = () => {
18147
18147
  };
18148
18148
 
18149
18149
  var _templateObject$c;
18150
- const _excluded$n = ["title", "activeSdgGoals", "t"];
18150
+ const _excluded$o = ["title", "activeSdgGoals", "t"];
18151
18151
  function SDGWidget(_ref) {
18152
18152
  let {
18153
18153
  title = "Sustainable Development Goals",
18154
18154
  activeSdgGoals = [],
18155
18155
  t = key => key
18156
18156
  } = _ref,
18157
- props = _objectWithoutProperties(_ref, _excluded$n);
18157
+ props = _objectWithoutProperties(_ref, _excluded$o);
18158
18158
  const sdgConfig = getGoalConfig();
18159
18159
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
18160
18160
  title: title,
@@ -18452,7 +18452,7 @@ function SdgList({
18452
18452
  });
18453
18453
  }
18454
18454
 
18455
- const _excluded$m = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
18455
+ const _excluded$n = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
18456
18456
  const {
18457
18457
  Meta
18458
18458
  } = antd.Card;
@@ -18472,7 +18472,7 @@ function ProjectWidget(_ref) {
18472
18472
  hideSDGList = false,
18473
18473
  t = x => x
18474
18474
  } = _ref,
18475
- props = _objectWithoutProperties(_ref, _excluded$m);
18475
+ props = _objectWithoutProperties(_ref, _excluded$n);
18476
18476
  const [isHovered, setIsHovered] = React__default["default"].useState(false);
18477
18477
  const {
18478
18478
  token
@@ -18744,13 +18744,13 @@ const WidgetCard = _ref => {
18744
18744
  });
18745
18745
  };
18746
18746
 
18747
- const _excluded$l = ["title", "children"];
18747
+ const _excluded$m = ["title", "children"];
18748
18748
  const CarouselWidget = /*#__PURE__*/React.forwardRef((_ref, ref) => {
18749
18749
  let {
18750
18750
  title,
18751
18751
  children
18752
18752
  } = _ref,
18753
- rest = _objectWithoutProperties(_ref, _excluded$l);
18753
+ rest = _objectWithoutProperties(_ref, _excluded$m);
18754
18754
  /**
18755
18755
  * Handles carousel slide change events
18756
18756
  * @param {number} currentSlide - The index of the current slide after change
@@ -18914,7 +18914,7 @@ const EmptyStateContainer = styled__default["default"].div`
18914
18914
  }
18915
18915
  `;
18916
18916
 
18917
- const _excluded$k = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
18917
+ const _excluded$l = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
18918
18918
  function ImageCarousel(_ref) {
18919
18919
  let {
18920
18920
  title,
@@ -18929,7 +18929,7 @@ function ImageCarousel(_ref) {
18929
18929
  emptyLogo = antd.Empty.PRESENTED_IMAGE_SIMPLE,
18930
18930
  emptyText = "No Image"
18931
18931
  } = _ref,
18932
- rest = _objectWithoutProperties(_ref, _excluded$k);
18932
+ rest = _objectWithoutProperties(_ref, _excluded$l);
18933
18933
  const [previewVisible, setPreviewVisible] = React.useState(false);
18934
18934
  const [current, setCurrent] = React.useState(0);
18935
18935
  const carouselRef = React.useRef(null);
@@ -19298,7 +19298,7 @@ const getVegetationConfig = () => {
19298
19298
  };
19299
19299
 
19300
19300
  var _templateObject$a, _templateObject2$3;
19301
- const _excluded$j = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
19301
+ const _excluded$k = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
19302
19302
  function VegetationWidget(_ref) {
19303
19303
  let {
19304
19304
  title = "Vegetation Health",
@@ -19310,7 +19310,7 @@ function VegetationWidget(_ref) {
19310
19310
  growthObservations = [],
19311
19311
  t = key => key
19312
19312
  } = _ref,
19313
- props = _objectWithoutProperties(_ref, _excluded$j);
19313
+ props = _objectWithoutProperties(_ref, _excluded$k);
19314
19314
  let vegetationConfig = getVegetationConfig();
19315
19315
  const allVegetationKeys = vegetationConfig.map(item => item.key);
19316
19316
  if (filterKeys && Array.isArray(filterKeys)) {
@@ -19426,7 +19426,7 @@ const getFaunaConfig = () => {
19426
19426
  };
19427
19427
 
19428
19428
  var _templateObject$9, _templateObject2$2;
19429
- const _excluded$i = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19429
+ const _excluded$j = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19430
19430
  function FaunaWidget(_ref) {
19431
19431
  let {
19432
19432
  title = "Observed Fauna",
@@ -19437,7 +19437,7 @@ function FaunaWidget(_ref) {
19437
19437
  itemHeight = 100,
19438
19438
  t = key => key
19439
19439
  } = _ref,
19440
- props = _objectWithoutProperties(_ref, _excluded$i);
19440
+ props = _objectWithoutProperties(_ref, _excluded$j);
19441
19441
  let faunaConfig = getFaunaConfig();
19442
19442
 
19443
19443
  // Filter to show only specific keys if filterKeys is provided
@@ -19502,7 +19502,7 @@ const getInvasiveSpeciesConfig = () => {
19502
19502
  };
19503
19503
 
19504
19504
  var _templateObject$8, _templateObject2$1;
19505
- const _excluded$h = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19505
+ const _excluded$i = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19506
19506
  function InvasiveSpeciesWidget(_ref) {
19507
19507
  let {
19508
19508
  title = "Invasive Species",
@@ -19514,7 +19514,7 @@ function InvasiveSpeciesWidget(_ref) {
19514
19514
  itemHeight = 100,
19515
19515
  t = key => key
19516
19516
  } = _ref,
19517
- props = _objectWithoutProperties(_ref, _excluded$h);
19517
+ props = _objectWithoutProperties(_ref, _excluded$i);
19518
19518
  let invasiveSpeciesConfig = getInvasiveSpeciesConfig();
19519
19519
 
19520
19520
  // Filter to show only specific keys if filterKeys is provided
@@ -24937,7 +24937,7 @@ const RepeatableModals = ({
24937
24937
  }) : null;
24938
24938
  };
24939
24939
 
24940
- const _excluded$g = ["viewGroup"],
24940
+ const _excluded$h = ["viewGroup"],
24941
24941
  _excluded2$1 = ["label", "icon", "position"];
24942
24942
  const Content$1 = _ref => {
24943
24943
  let {
@@ -25009,7 +25009,7 @@ const Content$1 = _ref => {
25009
25009
  if (groups[gKey].viewGroup === key) {
25010
25010
  // eslint-disable-next-line no-unused-vars
25011
25011
  const _groups$gKey = groups[gKey],
25012
- gCfg = _objectWithoutProperties(_groups$gKey, _excluded$g);
25012
+ gCfg = _objectWithoutProperties(_groups$gKey, _excluded$h);
25013
25013
  items[gKey] = gCfg;
25014
25014
  }
25015
25015
  return items;
@@ -25296,7 +25296,7 @@ const Content$1 = _ref => {
25296
25296
  });
25297
25297
  };
25298
25298
 
25299
- const _excluded$f = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
25299
+ const _excluded$g = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
25300
25300
  function Modal(_ref) {
25301
25301
  let {
25302
25302
  t = text => text,
@@ -25312,7 +25312,7 @@ function Modal(_ref) {
25312
25312
  disabled = false,
25313
25313
  withModalFormWrapper = true
25314
25314
  } = _ref,
25315
- props = _objectWithoutProperties(_ref, _excluded$f);
25315
+ props = _objectWithoutProperties(_ref, _excluded$g);
25316
25316
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Modal, _objectSpread2(_objectSpread2({
25317
25317
  width: 650,
25318
25318
  footer: null,
@@ -30804,6 +30804,7 @@ function Repeatable({
30804
30804
  });
30805
30805
  }
30806
30806
 
30807
+ /* eslint-disable no-eval */
30807
30808
  const isRiskComment = inputData => {
30808
30809
  if (inputData) {
30809
30810
  if (inputData.name === 'assessment') {
@@ -30816,10 +30817,7 @@ const isRiskComment = inputData => {
30816
30817
  };
30817
30818
 
30818
30819
  // options, k, setValues, values, excludedKeys, i, formTitles, getData, MainForm, plainForms, setAddress, onValuesChange, data, allData, changeLinking, changeInputMeta, t, highlightMandatory
30819
- function renderNestedInputs$1(options, k) {
30820
- for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
30821
- args[_key - 2] = arguments[_key];
30822
- }
30820
+ function renderNestedInputs$1(options, k, ...args) {
30823
30821
  if (options[k].repeatable) {
30824
30822
  return renderRepeatable$1(options, k, ...args);
30825
30823
  } else {
@@ -30847,11 +30845,10 @@ function renderRepeatable$1(options, k, setValues, values, excludedKeys, i, form
30847
30845
  children: [getFormTitles$1(formTitles, formId, i), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(form.type) ? getInputHeadLines$1(form.type, i, form, values) : /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
30848
30846
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
30849
30847
  name: formId,
30850
- children: (fields, _ref) => {
30851
- let {
30852
- add,
30853
- remove
30854
- } = _ref;
30848
+ children: (fields, {
30849
+ add,
30850
+ remove
30851
+ }) => {
30855
30852
  const formData = form.repeatable ? values[formId] || [] : values[formId] ? [values[formId]] : [];
30856
30853
  if (fields.length === 0) {
30857
30854
  const formInputs = form.inputs;
@@ -30901,10 +30898,14 @@ function renderRepeatable$1(options, k, setValues, values, excludedKeys, i, form
30901
30898
  const _val = {
30902
30899
  [formId]: formData.map((d, j) => i === j ? val : d)
30903
30900
  };
30904
- onValuesChange(_val, _objectSpread2(_objectSpread2({}, values), _val));
30905
- setValues(_objectSpread2(_objectSpread2({}, values), {}, {
30901
+ onValuesChange(_val, {
30902
+ ...values,
30903
+ ..._val
30904
+ });
30905
+ setValues({
30906
+ ...values,
30906
30907
  [formId]: formData.map((d, j) => i === j ? val : d)
30907
- }));
30908
+ });
30908
30909
  };
30909
30910
  return /*#__PURE__*/jsxRuntime.jsx(Repeatable, {
30910
30911
  form: form,
@@ -30960,156 +30961,154 @@ const getGroupContent = (form, values, i, formId, excludedKeys, getData, setValu
30960
30961
  highlightMandatory
30961
30962
  });
30962
30963
  };
30963
- const GroupContent = _ref2 => {
30964
- var _form$meta;
30965
- let {
30966
- form,
30967
- values = {},
30968
- i,
30969
- formId,
30970
- excludedKeys,
30971
- getData,
30972
- setValues,
30973
- MainForm,
30974
- options,
30975
- plainForms,
30976
- setAddress,
30977
- onValuesChange,
30978
- allData,
30979
- changeInputMeta,
30980
- highlightMandatory
30981
- } = _ref2;
30964
+ const GroupContent = ({
30965
+ form,
30966
+ values = {},
30967
+ i,
30968
+ formId,
30969
+ excludedKeys,
30970
+ getData,
30971
+ setValues,
30972
+ MainForm,
30973
+ options,
30974
+ plainForms,
30975
+ setAddress,
30976
+ onValuesChange,
30977
+ allData,
30978
+ changeInputMeta,
30979
+ highlightMandatory
30980
+ }) => {
30982
30981
  const {
30983
30982
  user,
30984
30983
  t
30985
30984
  } = useEditContext();
30986
30985
  const label = getInputLabel$1(form, values);
30987
- const notPartOfTheForm = (form === null || form === void 0 ? void 0 : form.type) === 'ajaxSubGroup' ? true : !!(form !== null && form !== void 0 && (_form$meta = form.meta) !== null && _form$meta !== void 0 && _form$meta.isSubGroup);
30986
+ const notPartOfTheForm = form?.type === 'ajaxSubGroup' ? true : !!form?.meta?.isSubGroup;
30988
30987
  const hasLabel = label && (typeof label === 'string' && (label || '').trim() !== '' || typeof label === 'object') ? true : false;
30989
30988
  const formValues = values[form.dataId];
30990
- const renderInputs = () => {
30991
- var _form$meta2;
30992
- return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
30993
- children: [form !== null && form !== void 0 && (_form$meta2 = form.meta) !== null && _form$meta2 !== void 0 && _form$meta2.groupInfo ? /*#__PURE__*/jsxRuntime.jsx(GroupInfos, {
30994
- config: form.meta.groupInfo,
30995
- user: user,
30996
- t: t
30997
- }) : null, Object.keys(form.inputs || {}).filter(i => !excludedKeys.includes(i)).map((inp, ii) => {
30998
- var _ref3, _values$meta, _values$meta2, _input$meta, _inputData$rules, _input$meta2;
30999
- const isAjaxSubGroup = (form === null || form === void 0 ? void 0 : form.type) === "ajaxSubGroup";
31000
- const input = form.inputs[inp];
31001
- const inputId = input.dataId || inp;
31002
- const inputValues = notPartOfTheForm ? Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {} : values;
31003
- const value = inputValues[inputId];
31004
- const commentValue = inputValues["".concat(inputId, "Comment")];
31005
- const inputData = getData(formId, input, value, commentValue, "".concat(formId, ".").concat(inputId), "".concat(formId, ".").concat(inputId));
31006
- const subtitles = form.subtitles || null;
31007
- const inputMeta = notPartOfTheForm ? isAjaxSubGroup ? ((_ref3 = values[formId] || {}) === null || _ref3 === void 0 || (_ref3 = _ref3.meta) === null || _ref3 === void 0 || (_ref3 = _ref3.inputs) === null || _ref3 === void 0 ? void 0 : _ref3[inputId]) || {} : (((values === null || values === void 0 || (_values$meta = values.meta) === null || _values$meta === void 0 ? void 0 : _values$meta.inputs) || {})[formId] || {})[inputId] || {} : ((values === null || values === void 0 || (_values$meta2 = values.meta) === null || _values$meta2 === void 0 ? void 0 : _values$meta2.inputs) || {})[inputId] || {};
31008
- inputData.repeatIndex = undefined;
31009
- inputData.inputName = inputId;
31010
- inputData.repeatValues = inputValues;
31011
- if (inputData.groupInputs && Array.isArray(inputData.groupInputs)) {
31012
- inputData.groupInputs = inputData.groupInputs.map(gpI => {
31013
- gpI.data.inputName = gpI.data.name;
31014
- gpI.data.repeatIndex = undefined;
31015
- gpI.data.name = formId;
31016
- return gpI;
30989
+ const renderInputs = () => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
30990
+ children: [form?.meta?.groupInfo ? /*#__PURE__*/jsxRuntime.jsx(GroupInfos, {
30991
+ config: form.meta.groupInfo,
30992
+ user: user,
30993
+ t: t
30994
+ }) : null, Object.keys(form.inputs || {}).filter(i => !excludedKeys.includes(i)).map((inp, ii) => {
30995
+ const isAjaxSubGroup = form?.type === "ajaxSubGroup";
30996
+ const input = form.inputs[inp];
30997
+ const inputId = input.dataId || inp;
30998
+ const inputValues = notPartOfTheForm ? Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {} : values;
30999
+ const value = inputValues[inputId];
31000
+ const commentValue = inputValues[`${inputId}Comment`];
31001
+ const inputData = getData(formId, input, value, commentValue, `${formId}.${inputId}`, `${formId}.${inputId}`);
31002
+ const subtitles = form.subtitles || null;
31003
+ const inputMeta = notPartOfTheForm ? isAjaxSubGroup ? (values[formId] || {})?.meta?.inputs?.[inputId] || {} : ((values?.meta?.inputs || {})[formId] || {})[inputId] || {} : (values?.meta?.inputs || {})[inputId] || {};
31004
+ inputData.repeatIndex = undefined;
31005
+ inputData.inputName = inputId;
31006
+ inputData.repeatValues = inputValues;
31007
+ if (inputData.groupInputs && Array.isArray(inputData.groupInputs)) {
31008
+ inputData.groupInputs = inputData.groupInputs.map(gpI => {
31009
+ gpI.data.inputName = gpI.data.name;
31010
+ gpI.data.repeatIndex = undefined;
31011
+ gpI.data.name = formId;
31012
+ return gpI;
31013
+ });
31014
+ }
31015
+ const isRisk = isRiskComment(inputData);
31016
+ const isHighlighted = highlightMandatory && input?.meta?.mandatory && inputIsEmpty(input, inputValues, inputMeta);
31017
+ const btnOnClick = () => {
31018
+ if (typeof inputData.commentValue === 'string') {
31019
+ onValuesChange({}, {
31020
+ ...values,
31021
+ [`${inputData.inputName}`]: null
31017
31022
  });
31018
31023
  }
31019
- const isRisk = isRiskComment(inputData);
31020
- const isHighlighted = highlightMandatory && (input === null || input === void 0 || (_input$meta = input.meta) === null || _input$meta === void 0 ? void 0 : _input$meta.mandatory) && inputIsEmpty(input, inputValues, inputMeta);
31021
- const btnOnClick = () => {
31022
- if (typeof inputData.commentValue === 'string') {
31023
- onValuesChange({}, _objectSpread2(_objectSpread2({}, values), {}, {
31024
- ["".concat(inputData.inputName)]: null
31025
- }));
31026
- }
31024
+ const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
31025
+ inputValues[`${inputData.inputName}Comment`] = typeof inputData.commentValue !== 'string' ? '' : null;
31026
+ if (Array.isArray(values[formId])) {
31027
+ values[formId] = inputValues;
31028
+ } else {
31029
+ values[formId] = inputValues;
31030
+ }
31031
+ setValues({
31032
+ ...values
31033
+ });
31034
+ };
31035
+ const btnOnClick2 = () => {
31036
+ if (typeof inputData.commentValue !== 'string') {
31027
31037
  const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
31028
- inputValues["".concat(inputData.inputName, "Comment")] = typeof inputData.commentValue !== 'string' ? '' : null;
31038
+ inputValues[`${inputData.inputName}Comment`] = typeof inputData.commentValue !== 'string' ? '' : null;
31029
31039
  if (Array.isArray(values[formId])) {
31030
31040
  values[formId] = inputValues;
31031
31041
  } else {
31032
31042
  values[formId] = inputValues;
31033
31043
  }
31034
- setValues(_objectSpread2({}, values));
31035
- };
31036
- const btnOnClick2 = () => {
31037
- if (typeof inputData.commentValue !== 'string') {
31038
- const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
31039
- inputValues["".concat(inputData.inputName, "Comment")] = typeof inputData.commentValue !== 'string' ? '' : null;
31040
- if (Array.isArray(values[formId])) {
31041
- values[formId] = inputValues;
31042
- } else {
31043
- values[formId] = inputValues;
31044
- }
31045
- setValues(_objectSpread2({}, values));
31046
- }
31047
- };
31048
- const rules = inputData !== null && inputData !== void 0 && (_inputData$rules = inputData.rules) !== null && _inputData$rules !== void 0 && _inputData$rules.length ? inputData.rules.filter(rule => !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max')) : ((input === null || input === void 0 || (_input$meta2 = input.meta) === null || _input$meta2 === void 0 ? void 0 : _input$meta2.rules) || []).filter(rule => {
31049
- if (rule.metaIf && typeof rule.metaIf === 'string') {
31050
- var _values$meta3, _values$meta4;
31051
- const [name, cond, value] = rule.metaIf.split(' ');
31052
- const val = name.includes('./') ? values === null || values === void 0 || (_values$meta3 = values.meta) === null || _values$meta3 === void 0 || (_values$meta3 = _values$meta3.inputs) === null || _values$meta3 === void 0 || (_values$meta3 = _values$meta3[formId]) === null || _values$meta3 === void 0 ? void 0 : _values$meta3[name.split('./')[1]] : values === null || values === void 0 || (_values$meta4 = values.meta) === null || _values$meta4 === void 0 || (_values$meta4 = _values$meta4.inputs) === null || _values$meta4 === void 0 ? void 0 : _values$meta4[name.split('./')[1]];
31053
- if (cond === 'is') {
31054
- return !!(val !== null && val !== void 0 && val[value]);
31055
- }
31056
- }
31057
- return !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max');
31058
- });
31059
- const requiredRule = rules.find(r => r.required);
31060
- if (requiredRule && input.type === 'text') {
31061
- rules.push({
31062
- whitespace: true,
31063
- message: requiredRule.message || ''
31044
+ setValues({
31045
+ ...values
31064
31046
  });
31065
31047
  }
31066
- return showHideInput$1(input, values, undefined, inputValues, setValues) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
31067
- children: /*#__PURE__*/jsxRuntime.jsxs("div", {
31068
- style: {
31069
- position: 'relative'
31070
- },
31071
- children: [getSubtitles$1(subtitles, input.position, values, undefined, inputValues), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(input.type) ? getInputHeadLines$1(input.type, i, input, values) : isRisk ? /*#__PURE__*/jsxRuntime.jsx(RiskGroup, {
31072
- input: input,
31073
- inputTypeComponent: inputTypeComponent$1,
31074
- inputData: inputData,
31075
- MainForm: MainForm,
31076
- options: options,
31077
- setValues: setValues,
31078
- formId: formId,
31079
- inputId: inputId,
31080
- inputOnBlur: inputOnBlur,
31081
- values: values,
31082
- getInputLabel: getInputLabel$1,
31083
- plainForms: plainForms,
31084
- setAddress: setAddress,
31085
- btnOnClick: btnOnClick,
31086
- btnOnClick2: btnOnClick2,
31087
- locationName: (allData || {}).locationName,
31088
- subGroupTitle: (allData || {}).subGroupTitle
31089
- }) : /*#__PURE__*/jsxRuntime.jsx(GroupContentFormItem, {
31090
- values,
31091
- formId,
31092
- setValues,
31093
- MainForm,
31094
- options,
31095
- plainForms,
31096
- setAddress,
31097
- inputData,
31098
- inputId,
31099
- input,
31100
- rules,
31101
- inputMeta,
31102
- changeInputMeta,
31103
- notPartOfTheForm,
31104
- isAjaxSubGroup,
31105
- isHighlighted
31106
- })]
31107
- }, ii)
31108
- }, "".concat(i).concat(ii)) : null;
31109
- })]
31110
- });
31111
- };
31112
- const isNa = (formValues === null || formValues === void 0 ? void 0 : formValues.valuation) === 'na';
31048
+ };
31049
+ const rules = inputData?.rules?.length ? inputData.rules.filter(rule => !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max')) : (input?.meta?.rules || []).filter(rule => {
31050
+ if (rule.metaIf && typeof rule.metaIf === 'string') {
31051
+ const [name, cond, value] = rule.metaIf.split(' ');
31052
+ const val = name.includes('./') ? values?.meta?.inputs?.[formId]?.[name.split('./')[1]] : values?.meta?.inputs?.[name.split('./')[1]];
31053
+ if (cond === 'is') {
31054
+ return !!val?.[value];
31055
+ }
31056
+ }
31057
+ return !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max');
31058
+ });
31059
+ const requiredRule = rules.find(r => r.required);
31060
+ if (requiredRule && input.type === 'text') {
31061
+ rules.push({
31062
+ whitespace: true,
31063
+ message: requiredRule.message || ''
31064
+ });
31065
+ }
31066
+ return showHideInput$1(input, values, undefined, inputValues, setValues) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
31067
+ children: /*#__PURE__*/jsxRuntime.jsxs("div", {
31068
+ style: {
31069
+ position: 'relative'
31070
+ },
31071
+ children: [getSubtitles$1(subtitles, input.position, values, undefined, inputValues), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(input.type) ? getInputHeadLines$1(input.type, i, input, values) : isRisk ? /*#__PURE__*/jsxRuntime.jsx(RiskGroup, {
31072
+ input: input,
31073
+ inputTypeComponent: inputTypeComponent$1,
31074
+ inputData: inputData,
31075
+ MainForm: MainForm,
31076
+ options: options,
31077
+ setValues: setValues,
31078
+ formId: formId,
31079
+ inputId: inputId,
31080
+ inputOnBlur: inputOnBlur,
31081
+ values: values,
31082
+ getInputLabel: getInputLabel$1,
31083
+ plainForms: plainForms,
31084
+ setAddress: setAddress,
31085
+ btnOnClick: btnOnClick,
31086
+ btnOnClick2: btnOnClick2,
31087
+ locationName: (allData || {}).locationName,
31088
+ subGroupTitle: (allData || {}).subGroupTitle
31089
+ }) : /*#__PURE__*/jsxRuntime.jsx(GroupContentFormItem, {
31090
+ values,
31091
+ formId,
31092
+ setValues,
31093
+ MainForm,
31094
+ options,
31095
+ plainForms,
31096
+ setAddress,
31097
+ inputData,
31098
+ inputId,
31099
+ input,
31100
+ rules,
31101
+ inputMeta,
31102
+ changeInputMeta,
31103
+ notPartOfTheForm,
31104
+ isAjaxSubGroup,
31105
+ isHighlighted
31106
+ })]
31107
+ }, ii)
31108
+ }, `${i}${ii}`) : null;
31109
+ })]
31110
+ });
31111
+ const isNa = formValues?.valuation === 'na';
31113
31112
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
31114
31113
  children: [hasLabel ? options.isRisk && options.dontShowTitle ? /*#__PURE__*/jsxRuntime.jsx("div", {
31115
31114
  className: "risk-header",
@@ -31117,46 +31116,44 @@ const GroupContent = _ref2 => {
31117
31116
  children: label
31118
31117
  })
31119
31118
  }) : /*#__PURE__*/jsxRuntime.jsx("h3", {
31120
- className: "".concat(form.titleClass ? form.titleClass : 'title-semibold-4', " ").concat(i ? 'mt-3 mb-1' : ''),
31119
+ className: `${form.titleClass ? form.titleClass : 'title-semibold-4'} ${i ? 'mt-3 mb-1' : ''}`,
31121
31120
  children: label
31122
31121
  }) : null, /*#__PURE__*/jsxRuntime.jsxs("div", {
31123
- className: "repeatable ".concat(hasLabel ? "mb-4" : ""),
31122
+ className: `repeatable ${hasLabel ? "mb-4" : ""}`,
31124
31123
  children: [form.titleLabel ? /*#__PURE__*/jsxRuntime.jsx("label", {
31125
31124
  children: getInputProp(form.titleLabel, values)
31126
- }) : null, formValues !== null && formValues !== void 0 && formValues.noPlanningRequired ? /*#__PURE__*/jsxRuntime.jsx(GroupInfoHOC, {
31125
+ }) : null, formValues?.noPlanningRequired ? /*#__PURE__*/jsxRuntime.jsx(GroupInfoHOC, {
31127
31126
  t: t,
31128
31127
  isNa: isNa,
31129
31128
  isSuccess: !isNa
31130
31129
  // TODO: translate
31131
31130
  ,
31132
31131
  config: {
31133
- title: t("No ".concat((formValues === null || formValues === void 0 ? void 0 : formValues.stage) || 'planning', " required"))
31132
+ title: t(`No ${formValues?.stage || 'planning'} required`)
31134
31133
  },
31135
31134
  children: renderInputs()
31136
31135
  }) : renderInputs()]
31137
31136
  })]
31138
31137
  });
31139
31138
  };
31140
- const GroupContentFormItem = _ref4 => {
31141
- var _rules$find, _inputMeta$reviews, _input$meta3, _values$formId, _input$meta4, _input$meta7, _input$meta8, _input$meta9, _values$meta10, _values$meta11, _values$parent, _input$meta10, _input$meta11, _inputData$value, _input$meta12, _input$meta13, _inputMeta$comment, _lastReview$comment, _lastReview$reviewer, _lastReview$reviewer2;
31142
- let {
31143
- values,
31144
- formId,
31145
- setValues,
31146
- MainForm,
31147
- options,
31148
- plainForms,
31149
- setAddress,
31150
- inputData,
31151
- inputId,
31152
- input,
31153
- rules,
31154
- inputMeta,
31155
- changeInputMeta,
31156
- notPartOfTheForm = true,
31157
- isAjaxSubGroup,
31158
- isHighlighted
31159
- } = _ref4;
31139
+ const GroupContentFormItem = ({
31140
+ values,
31141
+ formId,
31142
+ setValues,
31143
+ MainForm,
31144
+ options,
31145
+ plainForms,
31146
+ setAddress,
31147
+ inputData,
31148
+ inputId,
31149
+ input,
31150
+ rules,
31151
+ inputMeta,
31152
+ changeInputMeta,
31153
+ notPartOfTheForm = true,
31154
+ isAjaxSubGroup,
31155
+ isHighlighted
31156
+ }) => {
31160
31157
  const {
31161
31158
  t,
31162
31159
  user,
@@ -31170,10 +31167,10 @@ const GroupContentFormItem = _ref4 => {
31170
31167
  staticWidth,
31171
31168
  fullWidth
31172
31169
  } = useEditContext();
31173
- const [isShown, setIsShown] = React.useState(!!(inputMeta !== null && inputMeta !== void 0 && inputMeta.comment));
31174
- let maxRule = (_rules$find = rules.find(rule => rule.max)) === null || _rules$find === void 0 ? void 0 : _rules$find.max;
31170
+ const [isShown, setIsShown] = React.useState(!!inputMeta?.comment);
31171
+ let maxRule = rules.find(rule => rule.max)?.max;
31175
31172
  const requiredRule = rules.find(r => r.required);
31176
- 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];
31173
+ const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
31177
31174
  if (!maxRule && input.type === 'textarea') {
31178
31175
  maxRule = MAX_TEXT_AREA_LENGTH;
31179
31176
  }
@@ -31192,35 +31189,38 @@ const GroupContentFormItem = _ref4 => {
31192
31189
  }
31193
31190
  setIsShown(true);
31194
31191
  if (notPartOfTheForm || isAjaxSubGroup) {
31195
- var _values$meta5;
31196
- const _defaultMeta = ((values === null || values === void 0 || (_values$meta5 = values.meta) === null || _values$meta5 === void 0 ? void 0 : _values$meta5.inputs) || {})[formId] || {};
31192
+ const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31197
31193
  const _defaultData = MainForm.getFieldValue(formId);
31198
31194
  if (isAjaxSubGroup) {
31199
- var _defaultData$meta, _defaultData$meta2;
31200
31195
  changeInputMeta({
31201
31196
  key: formId,
31202
31197
  type: input.type,
31203
31198
  otherValues: {
31204
- [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31199
+ [formId]: {
31200
+ ..._defaultData,
31205
31201
  meta: {
31206
- inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta = _defaultData.meta) === null || _defaultData$meta === void 0 ? void 0 : _defaultData$meta.inputs) || {}), {}, {
31207
- [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta2 = _defaultData.meta) === null || _defaultData$meta2 === void 0 ? void 0 : _defaultData$meta2.inputs) || {})[inputId] || {}), {}, {
31202
+ inputs: {
31203
+ ...(_defaultData?.meta?.inputs || {}),
31204
+ [inputId]: {
31205
+ ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31208
31206
  comment: ''
31209
- })
31210
- })
31207
+ }
31208
+ }
31211
31209
  }
31212
- })
31210
+ }
31213
31211
  }
31214
31212
  });
31215
31213
  } else {
31216
31214
  changeInputMeta({
31217
31215
  key: formId,
31218
31216
  type: input.type,
31219
- value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31220
- [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31217
+ value: {
31218
+ ..._defaultMeta,
31219
+ [inputId]: {
31220
+ ...(_defaultMeta[inputId] || {}),
31221
31221
  comment: ''
31222
- })
31223
- })
31222
+ }
31223
+ }
31224
31224
  });
31225
31225
  }
31226
31226
  } else {
@@ -31237,58 +31237,62 @@ const GroupContentFormItem = _ref4 => {
31237
31237
  if (!isReview) {
31238
31238
  return;
31239
31239
  }
31240
- const reviewSuccess = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess;
31240
+ const reviewSuccess = lastReview?.reviewSuccess;
31241
31241
  if (notPartOfTheForm || isAjaxSubGroup) {
31242
- var _values$meta6;
31243
- const _defaultMeta = ((values === null || values === void 0 || (_values$meta6 = values.meta) === null || _values$meta6 === void 0 ? void 0 : _values$meta6.inputs) || {})[formId] || {};
31242
+ const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31244
31243
  const _defaultData = MainForm.getFieldValue(formId);
31245
31244
  if (isAjaxSubGroup) {
31246
- var _defaultData$meta3, _defaultData$meta4, _defaultData$meta5, _defaultData$meta6;
31247
31245
  changeInputMeta({
31248
31246
  key: formId,
31249
31247
  type: input.type,
31250
31248
  otherValues: {
31251
- [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31249
+ [formId]: {
31250
+ ..._defaultData,
31252
31251
  meta: {
31253
- inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta3 = _defaultData.meta) === null || _defaultData$meta3 === void 0 ? void 0 : _defaultData$meta3.inputs) || {}), {}, {
31254
- [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta4 = _defaultData.meta) === null || _defaultData$meta4 === void 0 ? void 0 : _defaultData$meta4.inputs) || {})[inputId] || {}), {}, {
31255
- reviews: reviewSuccess ? ((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta5 = _defaultData.meta) === null || _defaultData$meta5 === void 0 ? void 0 : _defaultData$meta5.inputs) || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta6 = _defaultData.meta) === null || _defaultData$meta6 === void 0 ? void 0 : _defaultData$meta6.inputs) || {})[inputId] || {}).reviews || []), {
31252
+ inputs: {
31253
+ ...(_defaultData?.meta?.inputs || {}),
31254
+ [inputId]: {
31255
+ ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31256
+ reviews: reviewSuccess ? (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []), {
31256
31257
  reviewer: user,
31257
31258
  createdAt: new Date().toISOString(),
31258
31259
  reviewSuccess: true
31259
31260
  }]
31260
- })
31261
- })
31261
+ }
31262
+ }
31262
31263
  }
31263
- })
31264
+ }
31264
31265
  }
31265
31266
  });
31266
31267
  } else {
31267
31268
  changeInputMeta({
31268
31269
  key: formId,
31269
31270
  type: input.type,
31270
- value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31271
- [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31271
+ value: {
31272
+ ..._defaultMeta,
31273
+ [inputId]: {
31274
+ ...(_defaultMeta[inputId] || {}),
31272
31275
  reviews: reviewSuccess ? ((_defaultMeta[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((_defaultMeta[inputId] || {}).reviews || []), {
31273
31276
  reviewer: user,
31274
31277
  createdAt: new Date().toISOString(),
31275
31278
  reviewSuccess: true
31276
31279
  }]
31277
- })
31278
- })
31280
+ }
31281
+ }
31279
31282
  });
31280
31283
  }
31281
31284
  } else {
31282
31285
  changeInputMeta({
31283
31286
  key: inputId,
31284
31287
  type: input.type,
31285
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
31288
+ value: {
31289
+ ...inputMeta,
31286
31290
  reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
31287
31291
  reviewer: user,
31288
31292
  createdAt: new Date().toISOString(),
31289
31293
  reviewSuccess: true
31290
31294
  }]
31291
- })
31295
+ }
31292
31296
  });
31293
31297
  }
31294
31298
  };
@@ -31296,111 +31300,118 @@ const GroupContentFormItem = _ref4 => {
31296
31300
  if (!isReview) {
31297
31301
  return;
31298
31302
  }
31299
- const reviewError = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError;
31303
+ const reviewError = lastReview?.reviewError;
31300
31304
  if (notPartOfTheForm || isAjaxSubGroup) {
31301
- var _values$meta7;
31302
- const _defaultMeta = ((values === null || values === void 0 || (_values$meta7 = values.meta) === null || _values$meta7 === void 0 ? void 0 : _values$meta7.inputs) || {})[formId] || {};
31305
+ const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31303
31306
  const _defaultData = MainForm.getFieldValue(formId);
31304
31307
  if (isAjaxSubGroup) {
31305
- var _defaultData$meta7, _defaultData$meta8, _defaultData$meta9, _defaultData$meta10;
31306
31308
  changeInputMeta({
31307
31309
  key: formId,
31308
31310
  type: input.type,
31309
31311
  otherValues: {
31310
- [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31312
+ [formId]: {
31313
+ ..._defaultData,
31311
31314
  meta: {
31312
- inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta7 = _defaultData.meta) === null || _defaultData$meta7 === void 0 ? void 0 : _defaultData$meta7.inputs) || {}), {}, {
31313
- [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta8 = _defaultData.meta) === null || _defaultData$meta8 === void 0 ? void 0 : _defaultData$meta8.inputs) || {})[inputId] || {}), {}, {
31314
- reviews: reviewError ? ((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta9 = _defaultData.meta) === null || _defaultData$meta9 === void 0 ? void 0 : _defaultData$meta9.inputs) || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta10 = _defaultData.meta) === null || _defaultData$meta10 === void 0 ? void 0 : _defaultData$meta10.inputs) || {})[inputId] || {}).reviews || []), {
31315
+ inputs: {
31316
+ ...(_defaultData?.meta?.inputs || {}),
31317
+ [inputId]: {
31318
+ ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31319
+ reviews: reviewError ? (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []), {
31315
31320
  reviewer: user,
31316
31321
  createdAt: new Date().toISOString(),
31317
31322
  reviewError: true,
31318
31323
  comment: ''
31319
31324
  }]
31320
- })
31321
- })
31325
+ }
31326
+ }
31322
31327
  }
31323
- })
31328
+ }
31324
31329
  }
31325
31330
  });
31326
31331
  } else {
31327
31332
  changeInputMeta({
31328
31333
  key: formId,
31329
31334
  type: input.type,
31330
- value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31331
- [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31335
+ value: {
31336
+ ..._defaultMeta,
31337
+ [inputId]: {
31338
+ ...(_defaultMeta[inputId] || {}),
31332
31339
  reviews: reviewError ? ((_defaultMeta[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((_defaultMeta[inputId] || {}).reviews || []), {
31333
31340
  reviewer: user,
31334
31341
  createdAt: new Date().toISOString(),
31335
31342
  reviewError: true,
31336
31343
  comment: ''
31337
31344
  }]
31338
- })
31339
- })
31345
+ }
31346
+ }
31340
31347
  });
31341
31348
  }
31342
31349
  } else {
31343
31350
  changeInputMeta({
31344
31351
  key: inputId,
31345
31352
  type: input.type,
31346
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
31353
+ value: {
31354
+ ...inputMeta,
31347
31355
  reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
31348
31356
  reviewer: user,
31349
31357
  createdAt: new Date().toISOString(),
31350
31358
  reviewError: true,
31351
31359
  comment: ''
31352
31360
  }]
31353
- })
31361
+ }
31354
31362
  });
31355
31363
  }
31356
31364
  };
31357
- const requiredComment = (inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.notApplicable) && (input === null || input === void 0 || (_input$meta3 = input.meta) === null || _input$meta3 === void 0 ? void 0 : _input$meta3.requiredCommentOnNotApplicable) && (values === null || values === void 0 || (_values$formId = values[formId]) === null || _values$formId === void 0 ? void 0 : _values$formId.valuation) !== 'na';
31365
+ const requiredComment = inputMeta?.notApplicable && input?.meta?.requiredCommentOnNotApplicable && values?.[formId]?.valuation !== 'na';
31358
31366
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
31359
31367
  children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
31360
31368
  className: "flex input-cont",
31361
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
31362
- required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
31363
- }, ['total100', 'group'].includes(input.type) ? {} : {
31364
- name: notPartOfTheForm ? [formId, inputId] : inputId,
31365
- fieldKey: notPartOfTheForm ? [formId, inputId] : inputId,
31366
- initialValue: notPartOfTheForm ? (values[formId] || {})[inputId] : values[inputId]
31367
- }), ['upload', 'imageUpload', 'videoUpload'].includes(input.type) ? {
31368
- valuePropName: "fileList",
31369
- getValueFromEvent: e => {
31370
- if (Array.isArray(e)) {
31371
- return e;
31372
- }
31373
- return e && e.fileList && e.fileList.map(f => {
31374
- if (f.response) {
31375
- return f.response;
31369
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
31370
+ required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
31371
+ ...(['total100', 'group'].includes(input.type) ? {} : {
31372
+ name: notPartOfTheForm ? [formId, inputId] : inputId,
31373
+ fieldKey: notPartOfTheForm ? [formId, inputId] : inputId,
31374
+ initialValue: notPartOfTheForm ? (values[formId] || {})[inputId] : values[inputId]
31375
+ }),
31376
+ ...(['upload', 'imageUpload', 'videoUpload'].includes(input.type) ? {
31377
+ valuePropName: "fileList",
31378
+ getValueFromEvent: e => {
31379
+ if (Array.isArray(e)) {
31380
+ return e;
31376
31381
  }
31377
- return f;
31378
- });
31379
- }
31380
- } : {}), inputOnBlur.includes(input.type) ? {
31381
- trigger: "onBlur"
31382
- } : {}), {}, {
31382
+ return e && e.fileList && e.fileList.map(f => {
31383
+ if (f.response) {
31384
+ return f.response;
31385
+ }
31386
+ return f;
31387
+ });
31388
+ }
31389
+ } : {}),
31390
+ ...(inputOnBlur.includes(input.type) ? {
31391
+ trigger: "onBlur"
31392
+ } : {}),
31383
31393
  style: input.showOnView === false ? {
31384
31394
  display: 'none'
31385
- } : {}
31386
- }, ['switch'].includes(input.type) ? {
31387
- labelCol: {
31388
- span: 20
31389
- },
31390
- style: _objectSpread2(_objectSpread2({}, input.showOnView === false ? {
31391
- display: 'none'
31392
- } : {}), {}, {
31393
- flexDirection: 'row',
31394
- justifyContent: 'space-between'
31395
- })
31396
- } : {}), {}, {
31395
+ } : {},
31396
+ ...(['switch'].includes(input.type) ? {
31397
+ labelCol: {
31398
+ span: 20
31399
+ },
31400
+ style: {
31401
+ ...(input.showOnView === false ? {
31402
+ display: 'none'
31403
+ } : {}),
31404
+ flexDirection: 'row',
31405
+ justifyContent: 'space-between'
31406
+ }
31407
+ } : {}),
31397
31408
  label: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
31398
- className: (input === null || input === void 0 || (_input$meta4 = input.meta) === null || _input$meta4 === void 0 ? void 0 : _input$meta4.code) && "mr-10",
31409
+ className: input?.meta?.code && "mr-10",
31399
31410
  children: getInputLabel$1(input, values)
31400
31411
  }) : null,
31401
31412
  rules: rules,
31402
- className: formatClassname([input.comment ? "flex-1 with-comment i-".concat(input.type) : "i-".concat(input.type, " flex-1 "), noActionsInputs.includes(input.type) && 'no-actions-input']),
31403
- "data-id": "".concat(formId, ".").concat(inputId),
31413
+ className: formatClassname([input.comment ? `flex-1 with-comment i-${input.type}` : `i-${input.type} flex-1 `, noActionsInputs.includes(input.type) && 'no-actions-input']),
31414
+ "data-id": `${formId}.${inputId}`,
31404
31415
  extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
31405
31416
  children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
31406
31417
  className: formatClassname(["ml-4 input-actions"]),
@@ -31410,7 +31421,7 @@ const GroupContentFormItem = _ref4 => {
31410
31421
  title: t('Add review note'),
31411
31422
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
31412
31423
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
31413
- className: formatClassname(["review-btn review-error-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError) && 'primary']),
31424
+ className: formatClassname(["review-btn review-error-btn", lastReview?.reviewError && 'primary']),
31414
31425
  type: "link",
31415
31426
  onClick: onClickReviewError,
31416
31427
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
@@ -31426,7 +31437,7 @@ const GroupContentFormItem = _ref4 => {
31426
31437
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
31427
31438
  type: "link",
31428
31439
  onClick: onClickReviewSuccess,
31429
- className: formatClassname(["review-btn review-success-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess) && 'primary']),
31440
+ className: formatClassname(["review-btn review-success-btn", lastReview?.reviewSuccess && 'primary']),
31430
31441
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
31431
31442
  name: "CheckSquare",
31432
31443
  width: 16,
@@ -31443,59 +31454,65 @@ const GroupContentFormItem = _ref4 => {
31443
31454
  className: formatClassname(["default p-0", inputMeta.notApplicable && 'primary']),
31444
31455
  type: "link",
31445
31456
  onClick: () => {
31446
- var _input$meta5, _input$meta6;
31447
31457
  const value = getDefaultInputValue(input);
31448
- const commentMeta = input !== null && input !== void 0 && (_input$meta5 = input.meta) !== null && _input$meta5 !== void 0 && _input$meta5.requiredCommentOnNotApplicable ? {
31458
+ const commentMeta = input?.meta?.requiredCommentOnNotApplicable ? {
31449
31459
  comment: ''
31450
31460
  } : {};
31451
- if (input !== null && input !== void 0 && (_input$meta6 = input.meta) !== null && _input$meta6 !== void 0 && _input$meta6.requiredCommentOnNotApplicable) {
31461
+ if (input?.meta?.requiredCommentOnNotApplicable) {
31452
31462
  setIsShown(true);
31453
31463
  }
31454
31464
  if (notPartOfTheForm || isAjaxSubGroup) {
31455
- var _values$meta8;
31456
31465
  const _defaultData = MainForm.getFieldValue(formId);
31457
- const _defaultMeta = ((values === null || values === void 0 || (_values$meta8 = values.meta) === null || _values$meta8 === void 0 ? void 0 : _values$meta8.inputs) || {})[formId] || {};
31466
+ const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31458
31467
  if (isAjaxSubGroup) {
31459
- var _defaultData$meta11;
31460
31468
  changeInputMeta({
31461
31469
  key: formId,
31462
31470
  type: input.type,
31463
31471
  otherValues: {
31464
- [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31472
+ [formId]: {
31473
+ ..._defaultData,
31465
31474
  [inputId]: value,
31466
31475
  meta: {
31467
- inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta11 = _defaultData.meta) === null || _defaultData$meta11 === void 0 ? void 0 : _defaultData$meta11.inputs) || {}), {}, {
31468
- [inputId]: inputMeta.notApplicable ? _objectSpread2({
31476
+ inputs: {
31477
+ ...(_defaultData?.meta?.inputs || {}),
31478
+ [inputId]: inputMeta.notApplicable ? {
31469
31479
  notApplicable: false,
31470
- notAvailable: false
31471
- }, commentMeta) : _objectSpread2({
31480
+ notAvailable: false,
31481
+ ...commentMeta
31482
+ } : {
31472
31483
  notApplicable: true,
31473
- notAvailable: false
31474
- }, commentMeta)
31475
- })
31484
+ notAvailable: false,
31485
+ ...commentMeta
31486
+ }
31487
+ }
31476
31488
  }
31477
- })
31489
+ }
31478
31490
  }
31479
31491
  });
31480
31492
  } else {
31481
31493
  changeInputMeta({
31482
31494
  key: formId,
31483
31495
  type: input.type,
31484
- value: inputMeta.notApplicable ? _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31485
- [inputId]: _objectSpread2({
31496
+ value: inputMeta.notApplicable ? {
31497
+ ..._defaultMeta,
31498
+ [inputId]: {
31486
31499
  notApplicable: false,
31487
- notAvailable: false
31488
- }, commentMeta)
31489
- }) : _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31490
- [inputId]: _objectSpread2({
31500
+ notAvailable: false,
31501
+ ...commentMeta
31502
+ }
31503
+ } : {
31504
+ ..._defaultMeta,
31505
+ [inputId]: {
31491
31506
  notApplicable: true,
31492
- notAvailable: false
31493
- }, commentMeta)
31494
- }),
31507
+ notAvailable: false,
31508
+ ...commentMeta
31509
+ }
31510
+ },
31495
31511
  otherValues: {
31496
- [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31512
+ [formId]: {
31513
+ ..._defaultData,
31497
31514
  [inputId]: value
31498
- })
31515
+ }
31499
31516
  }
31500
31517
  });
31501
31518
  }
@@ -31516,7 +31533,7 @@ const GroupContentFormItem = _ref4 => {
31516
31533
  });
31517
31534
  }
31518
31535
  },
31519
- disabled: !((_input$meta7 = input.meta) !== null && _input$meta7 !== void 0 && _input$meta7.notApplicable),
31536
+ disabled: !input.meta?.notApplicable,
31520
31537
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
31521
31538
  name: "NotApplicable",
31522
31539
  width: 16,
@@ -31530,24 +31547,24 @@ const GroupContentFormItem = _ref4 => {
31530
31547
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
31531
31548
  className: formatClassname(["default p-0", inputMeta.notAvailable && 'primary']),
31532
31549
  type: "link",
31533
- disabled: !((_input$meta8 = input.meta) !== null && _input$meta8 !== void 0 && _input$meta8.notAvailable),
31550
+ disabled: !input.meta?.notAvailable,
31534
31551
  onClick: () => {
31535
31552
  const value = getDefaultInputValue(input);
31536
31553
  if (notPartOfTheForm || isAjaxSubGroup) {
31537
- var _values$meta9;
31538
31554
  const _defaultData = MainForm.getFieldValue(formId);
31539
- const _defaultMeta = ((values === null || values === void 0 || (_values$meta9 = values.meta) === null || _values$meta9 === void 0 ? void 0 : _values$meta9.inputs) || {})[formId] || {};
31555
+ const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31540
31556
  if (isAjaxSubGroup) {
31541
31557
  if (isAjaxSubGroup) {
31542
- var _defaultData$meta12;
31543
31558
  changeInputMeta({
31544
31559
  key: formId,
31545
31560
  type: input.type,
31546
31561
  otherValues: {
31547
- [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31562
+ [formId]: {
31563
+ ..._defaultData,
31548
31564
  [inputId]: value,
31549
31565
  meta: {
31550
- inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta12 = _defaultData.meta) === null || _defaultData$meta12 === void 0 ? void 0 : _defaultData$meta12.inputs) || {}), {}, {
31566
+ inputs: {
31567
+ ...(_defaultData?.meta?.inputs || {}),
31551
31568
  [inputId]: inputMeta.notAvailable ? {
31552
31569
  notApplicable: false,
31553
31570
  notAvailable: false
@@ -31555,9 +31572,9 @@ const GroupContentFormItem = _ref4 => {
31555
31572
  notApplicable: false,
31556
31573
  notAvailable: true
31557
31574
  }
31558
- })
31575
+ }
31559
31576
  }
31560
- })
31577
+ }
31561
31578
  }
31562
31579
  });
31563
31580
  }
@@ -31565,21 +31582,24 @@ const GroupContentFormItem = _ref4 => {
31565
31582
  changeInputMeta({
31566
31583
  key: formId,
31567
31584
  type: input.type,
31568
- value: inputMeta.notAvailable ? _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31585
+ value: inputMeta.notAvailable ? {
31586
+ ..._defaultMeta,
31569
31587
  [inputId]: {
31570
31588
  notApplicable: false,
31571
31589
  notAvailable: false
31572
31590
  }
31573
- }) : _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31591
+ } : {
31592
+ ..._defaultMeta,
31574
31593
  [inputId]: {
31575
31594
  notApplicable: false,
31576
31595
  notAvailable: true
31577
31596
  }
31578
- }),
31597
+ },
31579
31598
  otherValues: {
31580
- [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31599
+ [formId]: {
31600
+ ..._defaultData,
31581
31601
  [inputId]: value
31582
- })
31602
+ }
31583
31603
  }
31584
31604
  });
31585
31605
  }
@@ -31610,33 +31630,38 @@ const GroupContentFormItem = _ref4 => {
31610
31630
  }), /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
31611
31631
  title: t('Add comment'),
31612
31632
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
31613
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
31633
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
31614
31634
  type: "link",
31615
- disabled: !((_input$meta9 = input.meta) !== null && _input$meta9 !== void 0 && _input$meta9.comment)
31616
- }, !isShown ? {
31617
- className: 'default p-0'
31618
- } : {
31619
- className: 'p-0 primary'
31620
- }), {}, {
31635
+ disabled: !input.meta?.comment,
31636
+ ...(!isShown ? {
31637
+ className: 'default p-0'
31638
+ } : {
31639
+ className: 'p-0 primary'
31640
+ }),
31621
31641
  onClick: onClickComment,
31622
31642
  children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
31623
31643
  name: "AddComment",
31624
31644
  width: 16,
31625
31645
  height: 16
31626
31646
  })
31627
- }))
31647
+ })
31628
31648
  })
31629
31649
  })]
31630
31650
  }) : null]
31631
31651
  }) : null
31632
31652
  }),
31633
31653
  children: isReview ? /*#__PURE__*/jsxRuntime.jsx(BasicInput, {
31634
- data: _objectSpread2(_objectSpread2({}, values[formId] || {}), {}, {
31635
- meta: _objectSpread2(_objectSpread2({}, (values === null || values === void 0 ? void 0 : values.meta) || {}), {}, {
31636
- inputs: _objectSpread2(_objectSpread2({}, (values === null || values === void 0 || (_values$meta10 = values.meta) === null || _values$meta10 === void 0 ? void 0 : _values$meta10.inputs) || {}), ((values === null || values === void 0 || (_values$meta11 = values.meta) === null || _values$meta11 === void 0 ? void 0 : _values$meta11.inputs) || {})[formId] || {})
31637
- })
31638
- }),
31639
- 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),
31654
+ data: {
31655
+ ...(values[formId] || {}),
31656
+ meta: {
31657
+ ...(values?.meta || {}),
31658
+ inputs: {
31659
+ ...(values?.meta?.inputs || {}),
31660
+ ...((values?.meta?.inputs || {})[formId] || {})
31661
+ }
31662
+ }
31663
+ },
31664
+ linkingData: values?.linking || values?.parent?.linking,
31640
31665
  name: input.dataId,
31641
31666
  config: input,
31642
31667
  t: t,
@@ -31648,12 +31673,13 @@ const GroupContentFormItem = _ref4 => {
31648
31673
  getToken: getToken,
31649
31674
  app: app,
31650
31675
  valueOnlyString: true
31651
- }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](_objectSpread2(_objectSpread2({}, inputData), {}, {
31676
+ }) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
31677
+ ...inputData,
31652
31678
  name: inputId,
31653
31679
  maxWidth,
31654
31680
  staticWidth,
31655
31681
  fullWidth
31656
- }), {
31682
+ }, {
31657
31683
  form: MainForm,
31658
31684
  forms: options,
31659
31685
  allForms: plainForms,
@@ -31671,10 +31697,10 @@ const GroupContentFormItem = _ref4 => {
31671
31697
  staticWidth,
31672
31698
  fullWidth
31673
31699
  }) : console.log(input)
31674
- })), (_input$meta10 = input.meta) !== null && _input$meta10 !== void 0 && _input$meta10.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
31700
+ }), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
31675
31701
  className: "code",
31676
31702
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
31677
- children: (_input$meta11 = input.meta) === null || _input$meta11 === void 0 ? void 0 : _input$meta11.code
31703
+ children: input.meta?.code
31678
31704
  })
31679
31705
  }) : null]
31680
31706
  }), maxRule ? ['imageUpload', 'videoUpload', 'upload'].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -31694,16 +31720,16 @@ const GroupContentFormItem = _ref4 => {
31694
31720
  className: "max-char-span",
31695
31721
  children: t('max-char', {
31696
31722
  chars: maxRule,
31697
- filled: (inputData === null || inputData === void 0 || (_inputData$value = inputData.value) === null || _inputData$value === void 0 ? void 0 : _inputData$value.length) || 0
31723
+ filled: inputData?.value?.length || 0
31698
31724
  })
31699
31725
  })
31700
- }) : null, (_input$meta12 = input.meta) !== null && _input$meta12 !== void 0 && _input$meta12.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
31726
+ }) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
31701
31727
  className: "input-content",
31702
31728
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
31703
31729
  className: "comment-textarea",
31704
- initialValue: (inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.comment) || '',
31730
+ initialValue: inputMeta?.comment || '',
31705
31731
  hidden: !isShown,
31706
- name: "".concat(formId, "-").concat(inputId, "-comment"),
31732
+ name: `${formId}-${inputId}-comment`,
31707
31733
  required: requiredComment,
31708
31734
  rules: requiredComment ? [{
31709
31735
  required: true,
@@ -31720,35 +31746,38 @@ const GroupContentFormItem = _ref4 => {
31720
31746
  onConfirm: () => {
31721
31747
  setIsShown(false);
31722
31748
  if (notPartOfTheForm) {
31723
- var _values$meta12;
31724
- const _defaultMeta = ((values === null || values === void 0 || (_values$meta12 = values.meta) === null || _values$meta12 === void 0 ? void 0 : _values$meta12.inputs) || {})[formId] || {};
31749
+ const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31725
31750
  const _defaultData = MainForm.getFieldValue(formId);
31726
31751
  if (isAjaxSubGroup) {
31727
- var _defaultData$meta13, _defaultData$meta14;
31728
31752
  changeInputMeta({
31729
31753
  key: formId,
31730
31754
  type: input.type,
31731
31755
  otherValues: {
31732
- [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31756
+ [formId]: {
31757
+ ..._defaultData,
31733
31758
  meta: {
31734
- inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta13 = _defaultData.meta) === null || _defaultData$meta13 === void 0 ? void 0 : _defaultData$meta13.inputs) || {}), {}, {
31735
- [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta14 = _defaultData.meta) === null || _defaultData$meta14 === void 0 ? void 0 : _defaultData$meta14.inputs) || {})[inputId] || {}), {}, {
31759
+ inputs: {
31760
+ ...(_defaultData?.meta?.inputs || {}),
31761
+ [inputId]: {
31762
+ ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31736
31763
  comment: null
31737
- })
31738
- })
31764
+ }
31765
+ }
31739
31766
  }
31740
- })
31767
+ }
31741
31768
  }
31742
31769
  });
31743
31770
  } else {
31744
31771
  changeInputMeta({
31745
31772
  key: formId,
31746
31773
  type: input.type,
31747
- value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31748
- [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31774
+ value: {
31775
+ ..._defaultMeta,
31776
+ [inputId]: {
31777
+ ...(_defaultMeta[inputId] || {}),
31749
31778
  comment: null
31750
- })
31751
- })
31779
+ }
31780
+ }
31752
31781
  });
31753
31782
  }
31754
31783
  } else {
@@ -31763,7 +31792,7 @@ const GroupContentFormItem = _ref4 => {
31763
31792
  },
31764
31793
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
31765
31794
  type: "link",
31766
- disabled: !((_input$meta13 = input.meta) !== null && _input$meta13 !== void 0 && _input$meta13.comment),
31795
+ disabled: !input.meta?.comment,
31767
31796
  className: "p-0",
31768
31797
  children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
31769
31798
  width: 16,
@@ -31775,41 +31804,44 @@ const GroupContentFormItem = _ref4 => {
31775
31804
  children: inputTypeComponent$1.comment(inputData, {
31776
31805
  form: MainForm,
31777
31806
  forms: options,
31778
- value: (inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.comment) || '',
31807
+ value: inputMeta?.comment || '',
31779
31808
  maxWidth,
31780
31809
  staticWidth,
31781
31810
  fullWidth,
31782
31811
  onChange: val => {
31783
31812
  if (notPartOfTheForm) {
31784
- var _values$meta13;
31785
- const _defaultMeta = ((values === null || values === void 0 || (_values$meta13 = values.meta) === null || _values$meta13 === void 0 ? void 0 : _values$meta13.inputs) || {})[formId] || {};
31813
+ const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31786
31814
  const _defaultData = MainForm.getFieldValue(formId);
31787
31815
  if (isAjaxSubGroup) {
31788
- var _defaultData$meta15, _defaultData$meta16;
31789
31816
  changeInputMeta({
31790
31817
  key: formId,
31791
31818
  type: input.type,
31792
31819
  otherValues: {
31793
- [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31820
+ [formId]: {
31821
+ ..._defaultData,
31794
31822
  meta: {
31795
- inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta15 = _defaultData.meta) === null || _defaultData$meta15 === void 0 ? void 0 : _defaultData$meta15.inputs) || {}), {}, {
31796
- [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta16 = _defaultData.meta) === null || _defaultData$meta16 === void 0 ? void 0 : _defaultData$meta16.inputs) || {})[inputId] || {}), {}, {
31823
+ inputs: {
31824
+ ...(_defaultData?.meta?.inputs || {}),
31825
+ [inputId]: {
31826
+ ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31797
31827
  comment: val
31798
- })
31799
- })
31828
+ }
31829
+ }
31800
31830
  }
31801
- })
31831
+ }
31802
31832
  }
31803
31833
  });
31804
31834
  } else {
31805
31835
  changeInputMeta({
31806
31836
  key: formId,
31807
31837
  type: input.type,
31808
- value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31809
- [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31838
+ value: {
31839
+ ..._defaultMeta,
31840
+ [inputId]: {
31841
+ ...(_defaultMeta[inputId] || {}),
31810
31842
  comment: val
31811
- })
31812
- })
31843
+ }
31844
+ }
31813
31845
  });
31814
31846
  }
31815
31847
  } else {
@@ -31830,16 +31862,16 @@ const GroupContentFormItem = _ref4 => {
31830
31862
  className: "max-char-span",
31831
31863
  children: t('max-char', {
31832
31864
  chars: MAX_COMMENTS_LENGTH,
31833
- filled: (inputMeta === null || inputMeta === void 0 || (_inputMeta$comment = inputMeta.comment) === null || _inputMeta$comment === void 0 ? void 0 : _inputMeta$comment.length) || 0
31865
+ filled: inputMeta?.comment?.length || 0
31834
31866
  })
31835
31867
  })]
31836
- }) : null, lastReview !== null && lastReview !== void 0 && lastReview.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
31868
+ }) : null, lastReview?.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
31837
31869
  className: "input-content",
31838
31870
  children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
31839
31871
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
31840
31872
  className: "comment-textarea",
31841
- initialValue: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || '',
31842
- name: "".concat(formId, "-").concat(inputId, "-reviewErrorComment"),
31873
+ initialValue: lastReview?.comment || '',
31874
+ name: `${formId}-${inputId}-reviewErrorComment`,
31843
31875
  label: /*#__PURE__*/jsxRuntime.jsx("div", {
31844
31876
  className: "flex w-100",
31845
31877
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -31850,71 +31882,78 @@ const GroupContentFormItem = _ref4 => {
31850
31882
  children: inputTypeComponent$1.comment(inputData, {
31851
31883
  form: MainForm,
31852
31884
  forms: options,
31853
- value: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || '',
31885
+ value: lastReview?.comment || '',
31854
31886
  maxWidth,
31855
31887
  staticWidth,
31856
31888
  fullWidth,
31857
31889
  onChange: val => {
31858
31890
  if (notPartOfTheForm) {
31859
- var _values$meta14;
31860
- const _defaultMeta = ((values === null || values === void 0 || (_values$meta14 = values.meta) === null || _values$meta14 === void 0 ? void 0 : _values$meta14.inputs) || {})[formId] || {};
31891
+ const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
31861
31892
  const _defaultData = MainForm.getFieldValue(formId);
31862
31893
  if (isAjaxSubGroup) {
31863
- var _defaultData$meta17, _defaultData$meta18, _defaultData$meta19;
31864
31894
  changeInputMeta({
31865
31895
  key: formId,
31866
31896
  type: input.type,
31867
31897
  otherValues: {
31868
- [formId]: _objectSpread2(_objectSpread2({}, _defaultData), {}, {
31898
+ [formId]: {
31899
+ ..._defaultData,
31869
31900
  meta: {
31870
- inputs: _objectSpread2(_objectSpread2({}, (_defaultData === null || _defaultData === void 0 || (_defaultData$meta17 = _defaultData.meta) === null || _defaultData$meta17 === void 0 ? void 0 : _defaultData$meta17.inputs) || {}), {}, {
31871
- [inputId]: _objectSpread2(_objectSpread2({}, ((_defaultData === null || _defaultData === void 0 || (_defaultData$meta18 = _defaultData.meta) === null || _defaultData$meta18 === void 0 ? void 0 : _defaultData$meta18.inputs) || {})[inputId] || {}), {}, {
31872
- reviews: ((((_defaultData === null || _defaultData === void 0 || (_defaultData$meta19 = _defaultData.meta) === null || _defaultData$meta19 === void 0 ? void 0 : _defaultData$meta19.inputs) || {})[inputId] || {}).reviews || []).map(v => {
31901
+ inputs: {
31902
+ ...(_defaultData?.meta?.inputs || {}),
31903
+ [inputId]: {
31904
+ ...((_defaultData?.meta?.inputs || {})[inputId] || {}),
31905
+ reviews: (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).map(v => {
31873
31906
  if (v.createdAt === lastReview.createdAt) {
31874
- return _objectSpread2(_objectSpread2({}, v), {}, {
31907
+ return {
31908
+ ...v,
31875
31909
  comment: val
31876
- });
31910
+ };
31877
31911
  }
31878
31912
  return v;
31879
31913
  })
31880
- })
31881
- })
31914
+ }
31915
+ }
31882
31916
  }
31883
- })
31917
+ }
31884
31918
  }
31885
31919
  });
31886
31920
  } else {
31887
31921
  changeInputMeta({
31888
31922
  key: formId,
31889
31923
  type: input.type,
31890
- value: _objectSpread2(_objectSpread2({}, _defaultMeta), {}, {
31891
- [inputId]: _objectSpread2(_objectSpread2({}, _defaultMeta[inputId] || {}), {}, {
31924
+ value: {
31925
+ ..._defaultMeta,
31926
+ [inputId]: {
31927
+ ...(_defaultMeta[inputId] || {}),
31892
31928
  reviews: ((_defaultMeta[inputId] || {}).reviews || []).map(v => {
31893
31929
  if (v.createdAt === lastReview.createdAt) {
31894
- return _objectSpread2(_objectSpread2({}, v), {}, {
31930
+ return {
31931
+ ...v,
31895
31932
  comment: val
31896
- });
31933
+ };
31897
31934
  }
31898
31935
  return v;
31899
31936
  })
31900
- })
31901
- })
31937
+ }
31938
+ }
31902
31939
  });
31903
31940
  }
31904
31941
  } else {
31905
31942
  changeInputMeta({
31906
31943
  key: inputId,
31907
31944
  type: input.type,
31908
- value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
31909
- reviews: ((inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.reviews) || []).map(v => {
31945
+ value: {
31946
+ ...inputMeta,
31947
+ reviews: (inputMeta?.reviews || []).map(v => {
31910
31948
  if (v.createdAt === lastReview.createdAt) {
31911
- return _objectSpread2(_objectSpread2({}, v), {}, {
31949
+ return {
31950
+ ...v,
31912
31951
  comment: val
31913
- });
31952
+ };
31914
31953
  }
31915
31954
  return v;
31916
31955
  })
31917
- })
31956
+ }
31918
31957
  });
31919
31958
  }
31920
31959
  },
@@ -31926,7 +31965,7 @@ const GroupContentFormItem = _ref4 => {
31926
31965
  className: "max-char-span",
31927
31966
  children: t('max-char', {
31928
31967
  chars: MAX_COMMENTS_LENGTH,
31929
- filled: ((_lastReview$comment = lastReview.comment) === null || _lastReview$comment === void 0 ? void 0 : _lastReview$comment.length) || 0
31968
+ filled: lastReview.comment?.length || 0
31930
31969
  })
31931
31970
  })]
31932
31971
  }) : /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -31947,7 +31986,7 @@ const GroupContentFormItem = _ref4 => {
31947
31986
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
31948
31987
  className: "flex flex-column justify-center mr-1",
31949
31988
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
31950
- 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')
31989
+ children: lastReview?.reviewer?.firstName + ' ' + lastReview?.reviewer?.lastName + ' - ' + moment__default["default"](lastReview.createdAt).format('DD MMM YYYY')
31951
31990
  })
31952
31991
  })]
31953
31992
  })]
@@ -39691,7 +39730,7 @@ function AjaxSelect(props) {
39691
39730
  }, props));
39692
39731
  }
39693
39732
 
39694
- /* eslint-disable no-case-declarations */
39733
+ const _excluded$f = ["placeholder"];
39695
39734
  const propHasValue = val => {
39696
39735
  if (Array.isArray(val)) {
39697
39736
  return val.length > 0 ? true : false;
@@ -39709,14 +39748,14 @@ const checkCondition = (condition, repeatValues, formsValue) => {
39709
39748
  return isShown;
39710
39749
  };
39711
39750
  function showHideInput(input, formsValue, repeatIndex, repeatValues, setValues, ref) {
39712
- if (input?.meta?.hidden === true) {
39751
+ var _input$meta;
39752
+ if ((input === null || input === void 0 || (_input$meta = input.meta) === null || _input$meta === void 0 ? void 0 : _input$meta.hidden) === true) {
39753
+ var _input$meta2;
39713
39754
  // Set default value for hidden fields
39714
- if (input?.meta?.defaultValue !== undefined && !propHasValue(formsValue[ref])) {
39755
+ if ((input === null || input === void 0 || (_input$meta2 = input.meta) === null || _input$meta2 === void 0 ? void 0 : _input$meta2.defaultValue) !== undefined && !propHasValue(formsValue[ref])) {
39715
39756
  formsValue[ref] = input.meta.defaultValue;
39716
39757
  if (setValues && typeof setValues === 'function') {
39717
- setValues({
39718
- ...formsValue
39719
- });
39758
+ setValues(_objectSpread2({}, formsValue));
39720
39759
  }
39721
39760
  }
39722
39761
  return false;
@@ -39775,35 +39814,35 @@ function getInputHeadLines(type, i, input, values) {
39775
39814
  switch (type) {
39776
39815
  case "h2":
39777
39816
  return /*#__PURE__*/jsxRuntime.jsx("h2", {
39778
- className: `title-semibold-2 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
39817
+ className: "title-semibold-2 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
39779
39818
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
39780
39819
  children: getInputLabel(input, values)
39781
39820
  })
39782
39821
  });
39783
39822
  case "h3":
39784
39823
  return /*#__PURE__*/jsxRuntime.jsx("h3", {
39785
- className: `title-semibold-3 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
39824
+ className: "title-semibold-3 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
39786
39825
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
39787
39826
  children: getInputLabel(input, values)
39788
39827
  })
39789
39828
  });
39790
39829
  case "h4":
39791
39830
  return /*#__PURE__*/jsxRuntime.jsx("h4", {
39792
- className: `title-semibold-4 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
39831
+ className: "title-semibold-4 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
39793
39832
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
39794
39833
  children: getInputLabel(input, values)
39795
39834
  })
39796
39835
  });
39797
39836
  case "h5":
39798
39837
  return /*#__PURE__*/jsxRuntime.jsx("h5", {
39799
- className: `title-semibold-5 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
39838
+ className: "title-semibold-5 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
39800
39839
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
39801
39840
  children: getInputLabel(input, values)
39802
39841
  })
39803
39842
  });
39804
39843
  case "h6":
39805
39844
  return /*#__PURE__*/jsxRuntime.jsx("h6", {
39806
- className: `title-semibold-6 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
39845
+ className: "title-semibold-6 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
39807
39846
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
39808
39847
  children: getInputLabel(input, values)
39809
39848
  })
@@ -39812,7 +39851,9 @@ function getInputHeadLines(type, i, input, values) {
39812
39851
  return null;
39813
39852
  }
39814
39853
  }
39815
- function getInputLabel(input, formsValue = {}, asText = false) {
39854
+ function getInputLabel(input) {
39855
+ let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
39856
+ let asText = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
39816
39857
  if (typeof input.label === "object") {
39817
39858
  const validations = Object.keys(input.label);
39818
39859
  const key = validations.find(v => {
@@ -39870,7 +39911,8 @@ function getInputLabel(input, formsValue = {}, asText = false) {
39870
39911
  }) : ReactHtmlParser__default["default"](input.label);
39871
39912
  }
39872
39913
  }
39873
- function getSelectOptions$1(option, formsValue = {}) {
39914
+ function getSelectOptions$1(option) {
39915
+ let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
39874
39916
  if (typeof option.label === "object") {
39875
39917
  const validations = Object.keys(option.label);
39876
39918
  const key = validations.find(v => {
@@ -39894,7 +39936,9 @@ function getSectionLabel(labels, values) {
39894
39936
  }
39895
39937
  return labels;
39896
39938
  }
39897
- function getSubtitles(subtitles, position, formsValue = {}, repeatIndex, repeatValues) {
39939
+ function getSubtitles(subtitles, position) {
39940
+ let formsValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
39941
+ let repeatValues = arguments.length > 4 ? arguments[4] : undefined;
39898
39942
  let subtitle = subtitles && subtitles[position];
39899
39943
  if (subtitle && typeof subtitle === "object") {
39900
39944
  let newSubtitle = subtitle.default || "";
@@ -39938,14 +39982,12 @@ function getSubtitles(subtitles, position, formsValue = {}, repeatIndex, repeatV
39938
39982
  function getFormTitles(titles, key, position) {
39939
39983
  let tilte = titles && titles[key];
39940
39984
  return tilte ? /*#__PURE__*/jsxRuntime.jsx("h3", {
39941
- className: `title-semibold-3 mb0 ${position ? "mt-3" : ""}`,
39985
+ className: "title-semibold-3 mb0 ".concat(position ? "mt-3" : ""),
39942
39986
  children: tilte
39943
39987
  }) : null;
39944
39988
  }
39945
39989
  const updateFormValues = (repeatIndex, repeatValues, inputName, value, formsValue, name, mainForm) => {
39946
- formsValue = Object.assign(formsValue, {
39947
- ...mainForm.getFieldsValue(true)
39948
- });
39990
+ formsValue = Object.assign(formsValue, _objectSpread2({}, mainForm.getFieldsValue(true)));
39949
39991
  if (typeof repeatIndex === "number" && repeatValues) {
39950
39992
  if (!repeatValues[inputName] || !___default["default"].isEqual(repeatValues[inputName], value)) {
39951
39993
  repeatValues[inputName] = value;
@@ -39979,48 +40021,52 @@ const updateFormValues = (repeatIndex, repeatValues, inputName, value, formsValu
39979
40021
  }
39980
40022
  };
39981
40023
  const inputTypeComponent = {
39982
- text: ({
39983
- props,
39984
- rules
39985
- }, {
39986
- inputMeta = {},
39987
- t
39988
- }) => {
40024
+ text: (_ref, _ref2) => {
40025
+ let {
40026
+ props,
40027
+ rules
40028
+ } = _ref;
40029
+ let {
40030
+ inputMeta = {},
40031
+ t
40032
+ } = _ref2;
39989
40033
  const maxRule = rules.find(r => r.max);
39990
40034
  const maxProps = {};
39991
40035
  if (maxRule) {
39992
40036
  maxProps.maxLength = maxRule.max;
39993
40037
  }
39994
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
39995
- size: "medium",
39996
- ...maxProps,
40038
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
40039
+ size: "medium"
40040
+ }, maxProps), {}, {
39997
40041
  allowClear: true,
39998
40042
  autoComplete: "new-password",
39999
- type: "text",
40000
- ...props,
40043
+ type: "text"
40044
+ }, props), {}, {
40001
40045
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
40002
40046
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
40003
- });
40047
+ }));
40004
40048
  },
40005
- drawTerritory: ({
40006
- formsValue,
40007
- name,
40008
- addressData,
40009
- onValuesChange
40010
- }, {
40011
- setFormValues,
40012
- form
40013
- }) => {
40049
+ drawTerritory: (_ref3, _ref4) => {
40050
+ let {
40051
+ formsValue,
40052
+ name,
40053
+ addressData,
40054
+ onValuesChange
40055
+ } = _ref3;
40056
+ let {
40057
+ setFormValues,
40058
+ form
40059
+ } = _ref4;
40014
40060
  let search = formsValue.country;
40015
40061
  if (addressData && addressData.address && Object.keys(addressData.address).length > 0) {
40016
40062
  if (addressData.address.country) {
40017
40063
  search = addressData.address.country;
40018
40064
  }
40019
40065
  if (addressData.address.level1) {
40020
- search = `${addressData.address.level1}, ${addressData.address.country}`;
40066
+ search = "".concat(addressData.address.level1, ", ").concat(addressData.address.country);
40021
40067
  }
40022
40068
  if (addressData.address.level2) {
40023
- search = `${addressData.address.level2}, ${addressData.address.level1}, ${addressData.address.country}`;
40069
+ search = "".concat(addressData.address.level2, ", ").concat(addressData.address.level1, ", ").concat(addressData.address.country);
40024
40070
  }
40025
40071
  } else {
40026
40072
  const country = countriesList.countries[formsValue.country] || {};
@@ -40028,10 +40074,10 @@ const inputTypeComponent = {
40028
40074
  search = country.name;
40029
40075
  }
40030
40076
  if (formsValue.administrativeLevel1Name) {
40031
- search = `${search} ${formsValue.administrativeLevel1Name}`;
40077
+ search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
40032
40078
  }
40033
40079
  if (formsValue.administrativeLevel2Name) {
40034
- search = `${search} ${formsValue.administrativeLevel2Name}`;
40080
+ search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
40035
40081
  }
40036
40082
  }
40037
40083
  console.log("search", {
@@ -40051,10 +40097,9 @@ const inputTypeComponent = {
40051
40097
  const allFormValues = form && typeof form.getFieldsValue === 'function' ? form.getFieldsValue(true) : formsValue;
40052
40098
 
40053
40099
  // Create the updated values
40054
- const updatedValues = {
40055
- ...allFormValues,
40100
+ const updatedValues = _objectSpread2(_objectSpread2({}, allFormValues), {}, {
40056
40101
  [name]: val
40057
- };
40102
+ });
40058
40103
 
40059
40104
  // Call onValuesChange with the change and all values
40060
40105
  if (typeof onValuesChange === 'function') {
@@ -40069,39 +40114,44 @@ const inputTypeComponent = {
40069
40114
  searchValue: search
40070
40115
  });
40071
40116
  },
40072
- link: ({
40073
- props,
40074
- rules
40075
- }, {
40076
- inputMeta = {},
40077
- t
40078
- }) => {
40117
+ link: (_ref5, _ref6) => {
40118
+ let {
40119
+ props,
40120
+ rules
40121
+ } = _ref5;
40122
+ let {
40123
+ inputMeta = {},
40124
+ t
40125
+ } = _ref6;
40079
40126
  const maxRule = rules.find(r => r.max);
40080
40127
  const maxProps = {};
40081
40128
  if (maxRule) {
40082
40129
  maxProps.maxLength = maxRule.max;
40083
40130
  }
40084
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
40085
- size: "medium",
40086
- ...maxProps,
40131
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
40132
+ size: "medium"
40133
+ }, maxProps), {}, {
40087
40134
  allowClear: true,
40088
40135
  autoComplete: "new-password",
40089
- type: "text",
40090
- ...props,
40136
+ type: "text"
40137
+ }, props), {}, {
40091
40138
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
40092
40139
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
40093
- });
40140
+ }));
40094
40141
  },
40095
- number: ({
40096
- props,
40097
- rules,
40098
- input
40099
- }, {
40100
- inputMeta = {},
40101
- t
40102
- }) => {
40142
+ number: (_ref7, _ref8) => {
40143
+ var _input$meta3;
40144
+ let {
40145
+ props,
40146
+ rules,
40147
+ input
40148
+ } = _ref7;
40149
+ let {
40150
+ inputMeta = {},
40151
+ t
40152
+ } = _ref8;
40103
40153
  const maxRule = rules.find(r => r.max);
40104
- const integerRule = !input?.meta?.isDecimal;
40154
+ const integerRule = !(input !== null && input !== void 0 && (_input$meta3 = input.meta) !== null && _input$meta3 !== void 0 && _input$meta3.isDecimal);
40105
40155
  const parser = value => {
40106
40156
  if (!value) {
40107
40157
  return "";
@@ -40112,50 +40162,53 @@ const inputTypeComponent = {
40112
40162
  return value.replace(/\$\s?|(,*)/g, "");
40113
40163
  };
40114
40164
  if (maxRule) {
40115
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
40165
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
40116
40166
  allowClear: true,
40117
- autoComplete: "new-password",
40118
- ...props,
40167
+ autoComplete: "new-password"
40168
+ }, props), {}, {
40119
40169
  type: "number",
40120
40170
  min: 0,
40121
40171
  max: maxRule.max,
40122
40172
  parser: parser
40123
- });
40173
+ }));
40124
40174
  }
40125
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
40175
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
40126
40176
  allowClear: true,
40127
- autoComplete: "new-password",
40128
- ...props,
40177
+ autoComplete: "new-password"
40178
+ }, props), {}, {
40129
40179
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
40130
40180
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
40131
40181
  min: 0,
40132
40182
  formatter: value => numberWithCommas$1(value),
40133
40183
  parser: parser
40134
- });
40184
+ }));
40135
40185
  },
40136
- select: ({
40137
- value,
40138
- options,
40139
- optionGroup,
40140
- props,
40141
- formsValue,
40142
- optionsFilter,
40143
- filterCond,
40144
- repeatValues,
40145
- repeatIndex,
40146
- name,
40147
- inputName,
40148
- address,
40149
- addressData,
40150
- input
40151
- }, {
40152
- forms,
40153
- form,
40154
- setAddress,
40155
- inputMeta = {},
40156
- t,
40157
- changeInputMeta
40158
- }) => {
40186
+ select: (_ref9, _ref10) => {
40187
+ var _input$meta4;
40188
+ let {
40189
+ value,
40190
+ options,
40191
+ optionGroup,
40192
+ props,
40193
+ formsValue,
40194
+ optionsFilter,
40195
+ filterCond,
40196
+ repeatValues,
40197
+ repeatIndex,
40198
+ name,
40199
+ inputName,
40200
+ address,
40201
+ addressData,
40202
+ input
40203
+ } = _ref9;
40204
+ let {
40205
+ forms,
40206
+ form,
40207
+ setAddress,
40208
+ inputMeta = {},
40209
+ t,
40210
+ changeInputMeta
40211
+ } = _ref10;
40159
40212
  let opts;
40160
40213
  if (typeof options === "string") {
40161
40214
  const [formName, key] = options.split(".");
@@ -40211,18 +40264,19 @@ const inputTypeComponent = {
40211
40264
  }
40212
40265
  opts = groupOptions;
40213
40266
  }
40214
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
40267
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
40215
40268
  autoComplete: "new-password",
40216
40269
  allowClear: true,
40217
40270
  showSearch: true,
40218
- defaultValue: input?.meta?.defaultValue,
40271
+ defaultValue: input === null || input === void 0 || (_input$meta4 = input.meta) === null || _input$meta4 === void 0 ? void 0 : _input$meta4.defaultValue,
40219
40272
  filterOption: filterSelectOptions,
40220
- optionFilterProp: "children",
40221
- ...props,
40273
+ optionFilterProp: "children"
40274
+ }, props), {}, {
40222
40275
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
40223
40276
  placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp$1(props.placeholder, formsValue) || t("Select one option"),
40224
40277
  onChange: (val, selectedValue) => {
40225
- if (typeof input?.meta?.onChange === "string") {
40278
+ var _input$meta5;
40279
+ if (typeof (input === null || input === void 0 || (_input$meta5 = input.meta) === null || _input$meta5 === void 0 ? void 0 : _input$meta5.onChange) === "string") {
40226
40280
  const [value, otherKey, otherVal] = input.meta.onChange.split(".");
40227
40281
  if (val === value) {
40228
40282
  changeInputMeta({
@@ -40236,9 +40290,7 @@ const inputTypeComponent = {
40236
40290
  }
40237
40291
  if (address && selectedValue) {
40238
40292
  dot__default["default"].str(address, selectedValue.children, addressData);
40239
- setAddress({
40240
- ...addressData
40241
- });
40293
+ setAddress(_objectSpread2({}, addressData));
40242
40294
  }
40243
40295
  if (props.onChange) {
40244
40296
  props.onChange(val);
@@ -40250,33 +40302,35 @@ const inputTypeComponent = {
40250
40302
  value: og.value,
40251
40303
  disabled: og.disabled,
40252
40304
  children: og.label
40253
- }, `${i}${j}`))
40305
+ }, "".concat(i).concat(j)))
40254
40306
  }, i) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
40255
40307
  value: option.value,
40256
40308
  disabled: option.disabled,
40257
40309
  children: option.label
40258
40310
  }, i))
40259
- });
40311
+ }));
40260
40312
  },
40261
- multiselect: ({
40262
- value,
40263
- options,
40264
- optionGroup,
40265
- optionsFilter,
40266
- filterCond,
40267
- props,
40268
- formsValue,
40269
- repeatValues,
40270
- repeatIndex,
40271
- inputName,
40272
- name,
40273
- tags
40274
- }, {
40275
- forms,
40276
- form,
40277
- inputMeta = {},
40278
- t
40279
- }) => {
40313
+ multiselect: (_ref11, _ref12) => {
40314
+ let {
40315
+ value,
40316
+ options,
40317
+ optionGroup,
40318
+ optionsFilter,
40319
+ filterCond,
40320
+ props,
40321
+ formsValue,
40322
+ repeatValues,
40323
+ repeatIndex,
40324
+ inputName,
40325
+ name,
40326
+ tags
40327
+ } = _ref11;
40328
+ let {
40329
+ forms,
40330
+ form,
40331
+ inputMeta = {},
40332
+ t
40333
+ } = _ref12;
40280
40334
  let opts;
40281
40335
  if (typeof options === "string") {
40282
40336
  const [formName, key] = options.split(".");
@@ -40333,16 +40387,16 @@ const inputTypeComponent = {
40333
40387
  }
40334
40388
  opts = groupOptions;
40335
40389
  }
40336
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
40390
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2(_objectSpread2({
40337
40391
  allowClear: true,
40338
40392
  autoComplete: "new-password",
40339
40393
  mode: tags ? "tags" : "multiple",
40340
- optionFilterProp: "children",
40341
- ...(tags ? {
40342
- tokenSeparators: [",", "\n", "\t"]
40343
- } : {}),
40344
- filterOption: filterSelectOptions,
40345
- ...props,
40394
+ optionFilterProp: "children"
40395
+ }, tags ? {
40396
+ tokenSeparators: [",", "\n", "\t"]
40397
+ } : {}), {}, {
40398
+ filterOption: filterSelectOptions
40399
+ }, props), {}, {
40346
40400
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
40347
40401
  placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp$1(props.placeholder, formsValue) || t("Select all relevant options"),
40348
40402
  children: (opts || []).map((option, i) => option.items ? /*#__PURE__*/jsxRuntime.jsx(antd.Select.OptGroup, {
@@ -40351,42 +40405,42 @@ const inputTypeComponent = {
40351
40405
  value: og.value,
40352
40406
  disabled: og.disabled,
40353
40407
  children: og.label
40354
- }, `${i}${j}`))
40408
+ }, "".concat(i).concat(j)))
40355
40409
  }, i) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
40356
40410
  value: option.value,
40357
40411
  disabled: option.disabled,
40358
40412
  children: option.label
40359
40413
  }, i))
40360
- });
40414
+ }));
40361
40415
  },
40362
- date: ({
40363
- props,
40364
- rules,
40365
- repeatValues,
40366
- formsValue,
40367
- name
40368
- }, {
40369
- inputMeta,
40370
- t,
40371
- groupFormId,
40372
- form,
40373
- setFormValues
40374
- }) => {
40416
+ date: (_ref13, _ref14) => {
40417
+ let {
40418
+ props,
40419
+ rules,
40420
+ repeatValues,
40421
+ formsValue,
40422
+ name
40423
+ } = _ref13;
40424
+ let {
40425
+ inputMeta,
40426
+ t,
40427
+ groupFormId,
40428
+ form,
40429
+ setFormValues
40430
+ } = _ref14;
40375
40431
  const lng = localStorage.getItem("datastakeLng") || "en";
40376
40432
  const maxRule = rules.find(r => r.max);
40377
40433
  const handleDateChange = date => {
40378
40434
  if (date) {
40379
40435
  const localDate = dayjs__default["default"].utc(date);
40380
40436
  if (groupFormId) {
40381
- const _new = {
40382
- ...(formsValue[groupFormId] || {}),
40437
+ const _new = _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
40383
40438
  [name]: localDate
40384
- };
40439
+ });
40385
40440
  form.setFieldValue(groupFormId, _new);
40386
- setFormValues({
40387
- ...formsValue,
40441
+ setFormValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
40388
40442
  [groupFormId]: _new
40389
- });
40443
+ }));
40390
40444
  } else {
40391
40445
  form.setFieldValue(name, localDate);
40392
40446
  }
@@ -40398,10 +40452,10 @@ const inputTypeComponent = {
40398
40452
  checkForMax = checkCondition(maxRule.condition, repeatValues, formsValue);
40399
40453
  }
40400
40454
  if (checkForMax) {
40401
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
40455
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
40402
40456
  allowClear: true,
40403
- autoComplete: "new-password",
40404
- ...props,
40457
+ autoComplete: "new-password"
40458
+ }, props), {}, {
40405
40459
  onChange: handleDateChange,
40406
40460
  format: DATE_FORMATS,
40407
40461
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
@@ -40410,31 +40464,33 @@ const inputTypeComponent = {
40410
40464
  disabledDate: current => {
40411
40465
  return current && current >= dayjs__default["default"]().endOf("day");
40412
40466
  }
40413
- });
40467
+ }));
40414
40468
  }
40415
40469
  }
40416
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
40470
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
40417
40471
  allowClear: true,
40418
- autoComplete: "new-password",
40419
- ...props,
40472
+ autoComplete: "new-password"
40473
+ }, props), {}, {
40420
40474
  onChange: handleDateChange,
40421
40475
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Select date"),
40422
40476
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
40423
40477
  format: DATE_FORMATS,
40424
40478
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"]
40425
- });
40479
+ }));
40426
40480
  },
40427
- comment: ({
40428
- props: {
40429
- placeholder,
40430
- ...props
40431
- },
40432
- commentHint
40433
- }, {
40434
- onChange,
40435
- value
40436
- }) => {
40437
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
40481
+ comment: (_ref15, _ref16) => {
40482
+ let {
40483
+ props: {
40484
+ placeholder
40485
+ },
40486
+ commentHint
40487
+ } = _ref15,
40488
+ props = _objectWithoutProperties(_ref15.props, _excluded$f);
40489
+ let {
40490
+ onChange,
40491
+ value
40492
+ } = _ref16;
40493
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
40438
40494
  allowClear: true,
40439
40495
  value: value,
40440
40496
  onChange: e => onChange(e.target.value),
@@ -40444,56 +40500,60 @@ const inputTypeComponent = {
40444
40500
  autoSize: {
40445
40501
  minRows: 5,
40446
40502
  maxRows: 5
40447
- },
40448
- ...props,
40503
+ }
40504
+ }, props), {}, {
40449
40505
  disabled: false
40450
- });
40506
+ }));
40451
40507
  },
40452
- textarea: ({
40453
- props,
40454
- rules
40455
- }, {
40456
- inputMeta,
40457
- t
40458
- }) => {
40508
+ textarea: (_ref17, _ref18) => {
40509
+ let {
40510
+ props,
40511
+ rules
40512
+ } = _ref17;
40513
+ let {
40514
+ inputMeta,
40515
+ t
40516
+ } = _ref18;
40459
40517
  const maxRule = rules.find(r => r.max);
40460
40518
  let maxLength = MAX_TEXT_AREA_LENGTH;
40461
40519
  if (maxRule) {
40462
40520
  maxLength = maxRule.max;
40463
40521
  }
40464
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
40522
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
40465
40523
  allowClear: true,
40466
40524
  autoComplete: "new-password",
40467
40525
  maxLength: maxLength,
40468
40526
  autoSize: {
40469
40527
  minRows: 5,
40470
40528
  maxRows: 5
40471
- },
40472
- ...props,
40529
+ }
40530
+ }, props), {}, {
40473
40531
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
40474
40532
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
40475
- });
40533
+ }));
40476
40534
  },
40477
- phoneNumber: ({
40478
- name,
40479
- inputName,
40480
- props,
40481
- value,
40482
- repeatIndex,
40483
- repeatValues,
40484
- formsValue
40485
- }, {
40486
- setFormValues,
40487
- t
40488
- }) => {
40489
- return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, {
40535
+ phoneNumber: (_ref19, _ref20) => {
40536
+ let {
40537
+ name,
40538
+ inputName,
40539
+ props,
40540
+ value,
40541
+ repeatIndex,
40542
+ repeatValues,
40543
+ formsValue
40544
+ } = _ref19;
40545
+ let {
40546
+ setFormValues,
40547
+ t
40548
+ } = _ref20;
40549
+ return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, _objectSpread2(_objectSpread2({
40490
40550
  t: t,
40491
40551
  doChangeErrors: false,
40492
40552
  allowClear: true,
40493
- country: formsValue?.country,
40553
+ country: formsValue === null || formsValue === void 0 ? void 0 : formsValue.country,
40494
40554
  formsValue: formsValue,
40495
- initialValue: value,
40496
- ...props,
40555
+ initialValue: value
40556
+ }, props), {}, {
40497
40557
  onChange: val => {
40498
40558
  if (repeatValues) {
40499
40559
  const inputValues = Array.isArray(formsValue[name]) ? formsValue[name] || [] : [];
@@ -40509,24 +40569,25 @@ const inputTypeComponent = {
40509
40569
  setFormValues(formsValue);
40510
40570
  }
40511
40571
  }
40512
- });
40572
+ }));
40513
40573
  },
40514
- switch: ({
40515
- props,
40516
- value,
40517
- restricted,
40518
- autocomplete,
40519
- formsValue,
40520
- repeatIndex,
40521
- name,
40522
- inputName,
40523
- replace
40524
- }, {
40525
- form,
40526
- setFormValues
40527
- }) => {
40528
- return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, {
40529
- ...props,
40574
+ switch: (_ref21, _ref22) => {
40575
+ let {
40576
+ props,
40577
+ value,
40578
+ restricted,
40579
+ autocomplete,
40580
+ formsValue,
40581
+ repeatIndex,
40582
+ name,
40583
+ inputName,
40584
+ replace
40585
+ } = _ref21;
40586
+ let {
40587
+ form,
40588
+ setFormValues
40589
+ } = _ref22;
40590
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, _objectSpread2(_objectSpread2({}, props), {}, {
40530
40591
  defaultChecked: value || false,
40531
40592
  checked: value || false,
40532
40593
  onChange: isChecked => {
@@ -40568,14 +40629,15 @@ const inputTypeComponent = {
40568
40629
  setFormValues(formsValue);
40569
40630
  }
40570
40631
  }
40571
- });
40632
+ }));
40572
40633
  },
40573
- total100: ({
40574
- props,
40575
- name,
40576
- options,
40577
- value
40578
- }) => {
40634
+ total100: _ref23 => {
40635
+ let {
40636
+ props,
40637
+ name,
40638
+ options,
40639
+ value
40640
+ } = _ref23;
40579
40641
  value = value ? Array.isArray(value) ? value : [value] : [];
40580
40642
  function totalValue() {
40581
40643
  let total = 0;
@@ -40599,10 +40661,11 @@ const inputTypeComponent = {
40599
40661
  className: "total100",
40600
40662
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
40601
40663
  name: name,
40602
- children: (fields, {
40603
- add,
40604
- remove
40605
- }) => {
40664
+ children: (fields, _ref24) => {
40665
+ let {
40666
+ add,
40667
+ remove
40668
+ } = _ref24;
40606
40669
  if (fields.length === 0) {
40607
40670
  const formData = value || [];
40608
40671
  if (formData.length) {
@@ -40621,26 +40684,26 @@ const inputTypeComponent = {
40621
40684
  const v = value[field.name];
40622
40685
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Space, {
40623
40686
  className: "total",
40624
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
40625
- noStyle: true,
40626
- ...field,
40687
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
40688
+ noStyle: true
40689
+ }, field), {}, {
40627
40690
  name: [field.name, "type"],
40628
40691
  fieldKey: [field.fieldKey, "type"],
40629
40692
  initialValue: v.type,
40630
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
40693
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
40631
40694
  allowClear: true,
40632
40695
  showSearch: true,
40633
40696
  filterOption: filterSelectOptions,
40634
- optionFilterProp: "children",
40635
- ...props,
40697
+ optionFilterProp: "children"
40698
+ }, props), {}, {
40636
40699
  children: options.map((option, i) => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
40637
40700
  value: option.value,
40638
40701
  children: option.label
40639
40702
  }, i))
40640
- })
40641
- }), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
40642
- noStyle: true,
40643
- ...field,
40703
+ }))
40704
+ })), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
40705
+ noStyle: true
40706
+ }, field), {}, {
40644
40707
  name: [field.name, "value"],
40645
40708
  fieldKey: [field.fieldKey, "value"],
40646
40709
  initialValue: v.value,
@@ -40648,14 +40711,14 @@ const inputTypeComponent = {
40648
40711
  allowClear: true,
40649
40712
  name: "value",
40650
40713
  formatter: value => {
40651
- return value ? `${value}%` : "";
40714
+ return value ? "".concat(value, "%") : "";
40652
40715
  },
40653
40716
  disabled: !v.type,
40654
40717
  placeholder: props.valueplaceholder ? props.valueplaceholder : "Value",
40655
40718
  min: 1,
40656
40719
  max: 100 - siblingTotal(v.type)
40657
40720
  })
40658
- }), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
40721
+ })), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
40659
40722
  disabled: !v.value || !v.type || totalValue() >= 100,
40660
40723
  type: "primary",
40661
40724
  icon: /*#__PURE__*/jsxRuntime.jsx(Icons.PlusOutlined, {}),
@@ -40687,18 +40750,21 @@ const inputTypeComponent = {
40687
40750
  }) : null]
40688
40751
  });
40689
40752
  },
40690
- percentage: ({
40691
- name,
40692
- inputName,
40693
- totalMax,
40694
- repeatIndex,
40695
- props,
40696
- formsValue,
40697
- input
40698
- }, {
40699
- inputMeta,
40700
- t
40701
- }) => {
40753
+ percentage: (_ref25, _ref26) => {
40754
+ var _input$meta6;
40755
+ let {
40756
+ name,
40757
+ inputName,
40758
+ totalMax,
40759
+ repeatIndex,
40760
+ props,
40761
+ formsValue,
40762
+ input
40763
+ } = _ref25;
40764
+ let {
40765
+ inputMeta,
40766
+ t
40767
+ } = _ref26;
40702
40768
  const isRepeatable = Array.isArray(formsValue[name]);
40703
40769
  let totalSiblings = 0;
40704
40770
  if (isRepeatable && totalMax) {
@@ -40706,15 +40772,15 @@ const inputTypeComponent = {
40706
40772
  totl = totl + (grp[inputName] || 0);
40707
40773
  return totl;
40708
40774
  }, 0);
40709
- } else if (Array.isArray(input?.meta?.siblings)) {
40775
+ } else if (Array.isArray(input === null || input === void 0 || (_input$meta6 = input.meta) === null || _input$meta6 === void 0 ? void 0 : _input$meta6.siblings)) {
40710
40776
  totalSiblings = input.meta.siblings.reduce((totl, key) => {
40711
40777
  totl = totl + (formsValue[key] || 0);
40712
40778
  return totl;
40713
40779
  }, 0);
40714
40780
  }
40715
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
40716
- allowClear: true,
40717
- ...props,
40781
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
40782
+ allowClear: true
40783
+ }, props), {}, {
40718
40784
  style: {
40719
40785
  width: "100%"
40720
40786
  },
@@ -40723,33 +40789,36 @@ const inputTypeComponent = {
40723
40789
  min: 0,
40724
40790
  max: 100 - totalSiblings,
40725
40791
  formatter: value => {
40726
- return value ? `${value}` : "";
40792
+ return value ? "".concat(value) : "";
40727
40793
  },
40728
40794
  parser: value => value.replace("%", ""),
40729
40795
  addonAfter: "%"
40730
- });
40796
+ }));
40731
40797
  },
40732
- year: ({
40733
- props
40734
- }) => {
40798
+ year: _ref27 => {
40799
+ let {
40800
+ props
40801
+ } = _ref27;
40735
40802
  const lng = localStorage.getItem("datastakeLng") || "en";
40736
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
40803
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
40737
40804
  allowClear: true,
40738
40805
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
40739
- picker: "year",
40740
- ...props,
40806
+ picker: "year"
40807
+ }, props), {}, {
40741
40808
  format: "YYYY"
40742
- });
40809
+ }));
40743
40810
  },
40744
- upload: ({
40745
- rules,
40746
- value
40747
- }, {
40748
- setLoading,
40749
- t,
40750
- getApiBaseUrl,
40751
- getAppHeader
40752
- }) => {
40811
+ upload: (_ref28, _ref29) => {
40812
+ let {
40813
+ rules,
40814
+ value
40815
+ } = _ref28;
40816
+ let {
40817
+ setLoading,
40818
+ t,
40819
+ getApiBaseUrl,
40820
+ getAppHeader
40821
+ } = _ref29;
40753
40822
  const apiURL = getApiBaseUrl();
40754
40823
  const accept = rules.length ? rules.find(rule => Object.keys(rule).includes("accept")).accept || "*" : null;
40755
40824
  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) : []) || [];
@@ -40762,13 +40831,12 @@ const inputTypeComponent = {
40762
40831
  }
40763
40832
  }
40764
40833
  const allowedExtensions = accept && accept !== "*" ? accept.split(",").map(ext => ext.trim().toLowerCase()) : [];
40765
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
40766
- ...maxProps,
40834
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({}, maxProps), {}, {
40767
40835
  accept: accept,
40768
- action: `${apiURL}/upload`,
40836
+ action: "".concat(apiURL, "/upload"),
40769
40837
  beforeUpload: beforeUpload(allowedExtensions),
40770
40838
  onChange: val => {
40771
- if (val?.file && typeof setLoading === "function") {
40839
+ if (val !== null && val !== void 0 && val.file && typeof setLoading === "function") {
40772
40840
  if (val.file.percent !== 100) {
40773
40841
  setLoading(true);
40774
40842
  } else {
@@ -40776,10 +40844,9 @@ const inputTypeComponent = {
40776
40844
  }
40777
40845
  }
40778
40846
  },
40779
- headers: {
40780
- Authorization: `Bearer ${getToken()}`,
40781
- ...getAppHeader()
40782
- },
40847
+ headers: _objectSpread2({
40848
+ Authorization: "Bearer ".concat(getToken())
40849
+ }, getAppHeader()),
40783
40850
  defaultFileList: values,
40784
40851
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
40785
40852
  style: {
@@ -40789,17 +40856,19 @@ const inputTypeComponent = {
40789
40856
  children: t("Upload")
40790
40857
  })]
40791
40858
  })
40792
- });
40859
+ }));
40793
40860
  },
40794
- imageUpload: ({
40795
- rules,
40796
- value
40797
- }, {
40798
- setLoading,
40799
- getApiBaseUrl,
40800
- getAppHeader,
40801
- t
40802
- }) => {
40861
+ imageUpload: (_ref30, _ref31) => {
40862
+ let {
40863
+ rules,
40864
+ value
40865
+ } = _ref30;
40866
+ let {
40867
+ setLoading,
40868
+ getApiBaseUrl,
40869
+ getAppHeader,
40870
+ t
40871
+ } = _ref31;
40803
40872
  const apiURL = getApiBaseUrl();
40804
40873
  const values = getImageUploadEditValue(value);
40805
40874
  const maxRule = rules.find(r => r.max);
@@ -40810,17 +40879,17 @@ const inputTypeComponent = {
40810
40879
  maxProps.multiple = true;
40811
40880
  }
40812
40881
  }
40813
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
40814
- ...maxProps,
40882
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({}, maxProps), {}, {
40815
40883
  beforeUpload: beforeUpload(allowedImageExtensions),
40816
40884
  accept: "image/*",
40817
40885
  classList: !values || !values.length ? "empty" : "",
40818
40886
  listType: "picture",
40819
- action: `${apiURL}/upload`,
40887
+ action: "".concat(apiURL, "/upload"),
40820
40888
  onChange: val => {
40821
40889
  if (typeof setLoading === "function") {
40822
- if (val?.file) {
40823
- if (val?.file?.status === "removed") {
40890
+ if (val !== null && val !== void 0 && val.file) {
40891
+ var _val$file;
40892
+ if ((val === null || val === void 0 || (_val$file = val.file) === null || _val$file === void 0 ? void 0 : _val$file.status) === "removed") {
40824
40893
  setLoading(false);
40825
40894
  return;
40826
40895
  }
@@ -40832,10 +40901,9 @@ const inputTypeComponent = {
40832
40901
  setLoading(false);
40833
40902
  }
40834
40903
  },
40835
- headers: {
40836
- Authorization: `Bearer ${getToken()}`,
40837
- ...getAppHeader()
40838
- },
40904
+ headers: _objectSpread2({
40905
+ Authorization: "Bearer ".concat(getToken())
40906
+ }, getAppHeader()),
40839
40907
  defaultFileList: values,
40840
40908
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
40841
40909
  style: {
@@ -40845,17 +40913,19 @@ const inputTypeComponent = {
40845
40913
  children: t("Upload")
40846
40914
  })]
40847
40915
  })
40848
- });
40916
+ }));
40849
40917
  },
40850
- videoUpload: ({
40851
- rules,
40852
- value
40853
- }, {
40854
- setLoading = () => {},
40855
- getApiBaseUrl,
40856
- getAppHeader,
40857
- t
40858
- }) => {
40918
+ videoUpload: (_ref32, _ref33) => {
40919
+ let {
40920
+ rules,
40921
+ value
40922
+ } = _ref32;
40923
+ let {
40924
+ setLoading = () => {},
40925
+ getApiBaseUrl,
40926
+ getAppHeader,
40927
+ t
40928
+ } = _ref33;
40859
40929
  const apiURL = getApiBaseUrl();
40860
40930
  const values = getImageUploadEditValue(value);
40861
40931
  const maxRule = rules.find(r => r.max);
@@ -40866,21 +40936,25 @@ const inputTypeComponent = {
40866
40936
  maxProps.multiple = true;
40867
40937
  }
40868
40938
  }
40869
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
40870
- itemRender: (item, fileList) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
40871
- children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
40872
- url: fileList?.response?.url || fileList?.url
40873
- }), item]
40874
- }),
40875
- ...maxProps,
40939
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({
40940
+ itemRender: (item, fileList) => {
40941
+ var _fileList$response;
40942
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
40943
+ children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
40944
+ 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)
40945
+ }), item]
40946
+ });
40947
+ }
40948
+ }, maxProps), {}, {
40876
40949
  accept: "video/*",
40877
40950
  classList: !values || !values.length ? "empty" : "",
40878
40951
  listType: "picture",
40879
- action: `${apiURL}/upload`,
40952
+ action: "".concat(apiURL, "/upload"),
40880
40953
  onChange: val => {
40881
40954
  if (typeof setLoading === "function") {
40882
- if (val?.file) {
40883
- if (val?.file?.status === "removed") {
40955
+ if (val !== null && val !== void 0 && val.file) {
40956
+ var _val$file2;
40957
+ if ((val === null || val === void 0 || (_val$file2 = val.file) === null || _val$file2 === void 0 ? void 0 : _val$file2.status) === "removed") {
40884
40958
  setLoading(false);
40885
40959
  return;
40886
40960
  }
@@ -40892,10 +40966,9 @@ const inputTypeComponent = {
40892
40966
  setLoading(false);
40893
40967
  }
40894
40968
  },
40895
- headers: {
40896
- Authorization: `Bearer ${getToken()}`,
40897
- ...getAppHeader()
40898
- },
40969
+ headers: _objectSpread2({
40970
+ Authorization: "Bearer ".concat(getToken())
40971
+ }, getAppHeader()),
40899
40972
  defaultFileList: values,
40900
40973
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
40901
40974
  style: {
@@ -40905,17 +40978,19 @@ const inputTypeComponent = {
40905
40978
  children: t("Upload")
40906
40979
  })]
40907
40980
  })
40908
- });
40981
+ }));
40909
40982
  },
40910
- geolocation: ({
40911
- value,
40912
- name,
40913
- formsValue,
40914
- addressData,
40915
- props
40916
- }, {
40917
- inputMeta
40918
- }) => {
40983
+ geolocation: (_ref34, _ref35) => {
40984
+ let {
40985
+ value,
40986
+ name,
40987
+ formsValue,
40988
+ addressData,
40989
+ props
40990
+ } = _ref34;
40991
+ let {
40992
+ inputMeta
40993
+ } = _ref35;
40919
40994
  let search = formsValue.country;
40920
40995
  if (addressData && Object.keys(addressData).length > 0) {
40921
40996
  const country = countriesList.countries[formsValue.country] || {};
@@ -40923,10 +40998,10 @@ const inputTypeComponent = {
40923
40998
  search = addressData.country;
40924
40999
  }
40925
41000
  if (addressData.level1) {
40926
- search = `${addressData.level1}, ${addressData.country || country.name}`;
41001
+ search = "".concat(addressData.level1, ", ").concat(addressData.country || country.name);
40927
41002
  }
40928
41003
  if (addressData.level2) {
40929
- search = `${addressData.level2}, ${addressData.level1}, ${addressData.country || country.name}`;
41004
+ search = "".concat(addressData.level2, ", ").concat(addressData.level1, ", ").concat(addressData.country || country.name);
40930
41005
  }
40931
41006
  } else {
40932
41007
  const country = countriesList.countries[formsValue.country] || {};
@@ -40934,10 +41009,10 @@ const inputTypeComponent = {
40934
41009
  search = country.name;
40935
41010
  }
40936
41011
  if (formsValue.administrativeLevel1Name) {
40937
- search = `${search} ${formsValue.administrativeLevel1Name}`;
41012
+ search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
40938
41013
  }
40939
41014
  if (formsValue.administrativeLevel2Name) {
40940
- search = `${search} ${formsValue.administrativeLevel2Name}`;
41015
+ search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
40941
41016
  }
40942
41017
  }
40943
41018
  return /*#__PURE__*/jsxRuntime.jsx(Geolocation, {
@@ -40950,33 +41025,35 @@ const inputTypeComponent = {
40950
41025
  searchValue: search
40951
41026
  });
40952
41027
  },
40953
- ajaxSelect: ({
40954
- call,
40955
- automaticallyLink,
40956
- name,
40957
- preSelected,
40958
- inputName,
40959
- props,
40960
- formsValue,
40961
- onNewSetValue,
40962
- multiple,
40963
- updateOptions,
40964
- repeatValues,
40965
- repeatIndex,
40966
- value,
40967
- unique,
40968
- address,
40969
- addressData = {},
40970
- input
40971
- }, {
40972
- form,
40973
- forms,
40974
- setAddress,
40975
- changeInputMeta,
40976
- inputMeta = {},
40977
- meta,
40978
- setFormValues
40979
- }) => {
41028
+ ajaxSelect: (_ref36, _ref37) => {
41029
+ let {
41030
+ call,
41031
+ automaticallyLink,
41032
+ name,
41033
+ preSelected,
41034
+ inputName,
41035
+ props,
41036
+ formsValue,
41037
+ onNewSetValue,
41038
+ multiple,
41039
+ updateOptions,
41040
+ repeatValues,
41041
+ repeatIndex,
41042
+ value,
41043
+ unique,
41044
+ address,
41045
+ addressData = {},
41046
+ input
41047
+ } = _ref36;
41048
+ let {
41049
+ form,
41050
+ forms,
41051
+ setAddress,
41052
+ changeInputMeta,
41053
+ inputMeta = {},
41054
+ meta,
41055
+ setFormValues
41056
+ } = _ref37;
40980
41057
  return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect, {
40981
41058
  preSelected: preSelected,
40982
41059
  input: input,
@@ -41012,40 +41089,41 @@ const inputTypeComponent = {
41012
41089
  const selectedValue = data.find(v => v.value === ev);
41013
41090
  if (address && selectedValue) {
41014
41091
  dot__default["default"].str(address, selectedValue.label, addressData);
41015
- setAddress({
41016
- ...addressData
41017
- });
41092
+ setAddress(_objectSpread2({}, addressData));
41018
41093
  }
41019
41094
  }
41020
41095
  },
41021
41096
  setAddress: setAddress
41022
41097
  });
41023
41098
  },
41024
- tag: ({
41025
- value,
41026
- repeatLabel
41027
- }) => {
41099
+ tag: _ref38 => {
41100
+ let {
41101
+ value,
41102
+ repeatLabel
41103
+ } = _ref38;
41028
41104
  return /*#__PURE__*/jsxRuntime.jsx(TagInput$1, {
41029
41105
  allowClear: true,
41030
41106
  value: value || [],
41031
41107
  newPlaceholder: repeatLabel
41032
41108
  });
41033
41109
  },
41034
- modal: ({
41035
- call,
41036
- automaticallyLink,
41037
- name,
41038
- inputName,
41039
- props,
41040
- formsValue,
41041
- onNewSetValue,
41042
- repeatValues,
41043
- repeatIndex,
41044
- value,
41045
- modalTitle
41046
- }, {
41047
- form
41048
- }) => {
41110
+ modal: (_ref39, _ref40) => {
41111
+ let {
41112
+ call,
41113
+ automaticallyLink,
41114
+ name,
41115
+ inputName,
41116
+ props,
41117
+ formsValue,
41118
+ onNewSetValue,
41119
+ repeatValues,
41120
+ repeatIndex,
41121
+ value,
41122
+ modalTitle
41123
+ } = _ref39;
41124
+ let {
41125
+ form
41126
+ } = _ref40;
41049
41127
  return /*#__PURE__*/jsxRuntime.jsx(AjaxModal$2, {
41050
41128
  allowClear: true,
41051
41129
  call: call,
@@ -41063,63 +41141,69 @@ const inputTypeComponent = {
41063
41141
  buttonText: modalTitle
41064
41142
  });
41065
41143
  },
41066
- website: ({
41067
- name,
41068
- inputName,
41069
- props,
41070
- value,
41071
- repeatIndex,
41072
- repeatValues,
41073
- formsValue
41074
- }, {
41075
- form,
41076
- inputMeta = {},
41077
- t
41078
- }) => {
41079
- return /*#__PURE__*/jsxRuntime.jsx(Website, {
41144
+ website: (_ref41, _ref42) => {
41145
+ let {
41146
+ name,
41147
+ inputName,
41148
+ props,
41149
+ value,
41150
+ repeatIndex,
41151
+ repeatValues,
41152
+ formsValue
41153
+ } = _ref41;
41154
+ let {
41155
+ form,
41156
+ inputMeta = {},
41157
+ t
41158
+ } = _ref42;
41159
+ return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
41080
41160
  allowClear: true,
41081
41161
  initialValue: value,
41082
- t: t,
41083
- ...props,
41162
+ t: t
41163
+ }, props), {}, {
41084
41164
  onChange: val => updateFormValues(repeatIndex, repeatValues, inputName, val, formsValue, name, form),
41085
41165
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
41086
41166
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com"
41087
- });
41167
+ }));
41088
41168
  },
41089
- dataLink: ({
41090
- setValues,
41091
- name,
41092
- onValuesChange,
41093
- formsValue,
41094
- input,
41095
- changeLinking,
41096
- call,
41097
- automaticallyLink,
41098
- inputName,
41099
- props,
41100
- onNewSetValue,
41101
- multiple,
41102
- updateOptions,
41103
- repeatValues,
41104
- repeatIndex,
41105
- value,
41106
- unique,
41107
- address,
41108
- addressData = {},
41109
- getFromLinking
41110
- }, {
41111
- form,
41112
- groupFormId,
41113
- setAddress,
41114
- isHighlighted,
41115
- changeInputMeta,
41116
- meta,
41117
- inputMeta,
41118
- forms
41119
- }) => {
41120
- if (input?.meta?.optionsView?.editInputType === "ajaxSelect") {
41121
- const currentValue = groupFormId ? formsValue[groupFormId]?.[name] : formsValue[name];
41122
- input?.meta?.optionsView?.call || input?.meta?.call || "default::list()::::";
41169
+ dataLink: (_ref43, _ref44) => {
41170
+ var _input$meta7, _input$meta10, _formsValue$meta, _input$meta11;
41171
+ let {
41172
+ setValues,
41173
+ name,
41174
+ onValuesChange,
41175
+ formsValue,
41176
+ input,
41177
+ changeLinking,
41178
+ call,
41179
+ automaticallyLink,
41180
+ inputName,
41181
+ props,
41182
+ onNewSetValue,
41183
+ multiple,
41184
+ updateOptions,
41185
+ repeatValues,
41186
+ repeatIndex,
41187
+ value,
41188
+ unique,
41189
+ address,
41190
+ addressData = {},
41191
+ getFromLinking
41192
+ } = _ref43;
41193
+ let {
41194
+ form,
41195
+ groupFormId,
41196
+ setAddress,
41197
+ isHighlighted,
41198
+ changeInputMeta,
41199
+ meta,
41200
+ inputMeta,
41201
+ forms
41202
+ } = _ref44;
41203
+ if ((input === null || input === void 0 || (_input$meta7 = input.meta) === null || _input$meta7 === void 0 || (_input$meta7 = _input$meta7.optionsView) === null || _input$meta7 === void 0 ? void 0 : _input$meta7.editInputType) === "ajaxSelect") {
41204
+ var _formsValue$groupForm, _input$meta8, _input$meta9;
41205
+ const currentValue = groupFormId ? (_formsValue$groupForm = formsValue[groupFormId]) === null || _formsValue$groupForm === void 0 ? void 0 : _formsValue$groupForm[name] : formsValue[name];
41206
+ (input === null || input === void 0 || (_input$meta8 = input.meta) === null || _input$meta8 === void 0 || (_input$meta8 = _input$meta8.optionsView) === null || _input$meta8 === void 0 ? void 0 : _input$meta8.call) || (input === null || input === void 0 || (_input$meta9 = input.meta) === null || _input$meta9 === void 0 ? void 0 : _input$meta9.call) || "default::list()::::";
41123
41207
  return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect$1, {
41124
41208
  size: "medium",
41125
41209
  input: input,
@@ -41156,9 +41240,7 @@ const inputTypeComponent = {
41156
41240
  const selectedValue = data.find(v => v.value === ev);
41157
41241
  if (address && selectedValue) {
41158
41242
  dot__default["default"].str(address, selectedValue.label, addressData);
41159
- setAddress({
41160
- ...addressData
41161
- });
41243
+ setAddress(_objectSpread2({}, addressData));
41162
41244
  }
41163
41245
  }
41164
41246
  },
@@ -41168,188 +41250,149 @@ const inputTypeComponent = {
41168
41250
  isDataLink: true
41169
41251
  });
41170
41252
  }
41171
- const isSingle = input?.meta?.maxRepeat === 1;
41172
- const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
41173
- ...(formsValue[groupFormId] || {})[name]
41174
- }] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
41175
- ...v
41176
- })) : isSingle ? formsValue[name] ? [{
41177
- ...formsValue[name]
41178
- }] : [] : (formsValue[name] || []).map(v => ({
41179
- ...v
41180
- }));
41253
+ const isSingle = (input === null || input === void 0 || (_input$meta10 = input.meta) === null || _input$meta10 === void 0 ? void 0 : _input$meta10.maxRepeat) === 1;
41254
+ 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));
41181
41255
  const onUpdate = (val, i) => {
41182
41256
  const _val = isSingle ? {
41183
41257
  [name]: val
41184
41258
  } : {
41185
- [name]: formData?.map((d, j) => i === j ? val : d)
41259
+ [name]: formData === null || formData === void 0 ? void 0 : formData.map((d, j) => i === j ? val : d)
41186
41260
  };
41187
41261
  if (groupFormId) {
41188
- const _defaultData = form?.getFieldValue(groupFormId) || {};
41189
- const _newData = {
41190
- ..._defaultData,
41191
- ..._val
41192
- };
41193
- onValuesChange(_newData, {
41194
- ...formsValue,
41262
+ const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
41263
+ const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
41264
+ onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
41195
41265
  [groupFormId]: _newData
41196
- });
41197
- form?.setFieldValue(groupFormId, _newData);
41198
- setValues({
41199
- ...formsValue,
41266
+ }));
41267
+ form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
41268
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
41200
41269
  [groupFormId]: _newData
41201
- });
41270
+ }));
41202
41271
  return;
41203
41272
  }
41204
- onValuesChange(_val, {
41205
- ...formsValue,
41206
- ..._val
41207
- });
41208
- form?.setFieldValue(name, _val[name]);
41209
- setValues({
41210
- ...formsValue,
41211
- ..._val
41212
- });
41273
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
41274
+ form === null || form === void 0 || form.setFieldValue(name, _val[name]);
41275
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
41213
41276
  };
41214
41277
  return /*#__PURE__*/jsxRuntime.jsx(DataLink, {
41215
41278
  form: input,
41216
41279
  formsValue: formsValue,
41217
41280
  onUpdate: onUpdate,
41218
41281
  isHighlighted: isHighlighted,
41219
- values: groupFormId ? {
41220
- ...(formsValue[groupFormId] || {}),
41282
+ values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
41221
41283
  meta: {
41222
- inputs: (formsValue?.meta?.inputs || {})[groupFormId]
41284
+ inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta = formsValue.meta) === null || _formsValue$meta === void 0 ? void 0 : _formsValue$meta.inputs) || {})[groupFormId]
41223
41285
  }
41224
- } : formsValue,
41286
+ }) : formsValue,
41225
41287
  name: name,
41226
41288
  groupFormId: groupFormId,
41227
- maxRepeat: input?.meta?.maxRepeat,
41228
- remove: ({
41229
- key
41230
- }) => {
41289
+ maxRepeat: input === null || input === void 0 || (_input$meta11 = input.meta) === null || _input$meta11 === void 0 ? void 0 : _input$meta11.maxRepeat,
41290
+ remove: _ref45 => {
41291
+ let {
41292
+ key
41293
+ } = _ref45;
41231
41294
  const _val = isSingle ? {
41232
41295
  [name]: null
41233
41296
  } : {
41234
41297
  [name]: formData.filter((v, i) => i !== key)
41235
41298
  };
41236
41299
  if (groupFormId) {
41237
- const _defaultData = form?.getFieldValue(groupFormId) || {};
41238
- const _newData = {
41239
- ..._defaultData,
41240
- ..._val
41241
- };
41242
- onValuesChange(_newData, {
41243
- ...formsValue,
41300
+ const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
41301
+ const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
41302
+ onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
41244
41303
  [groupFormId]: _newData
41245
- });
41246
- form?.setFieldValue(groupFormId, _newData);
41247
- setValues({
41248
- ...formsValue,
41304
+ }));
41305
+ form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
41306
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
41249
41307
  [groupFormId]: _newData
41250
- });
41308
+ }));
41251
41309
  return;
41252
41310
  }
41253
- onValuesChange(_val, {
41254
- ...formsValue,
41255
- ..._val
41256
- });
41257
- form?.setFieldValue(name, _val[name]);
41258
- setValues({
41259
- ...formsValue,
41260
- ..._val
41261
- });
41311
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
41312
+ form === null || form === void 0 || form.setFieldValue(name, _val[name]);
41313
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
41262
41314
  },
41263
41315
  add: val => {
41264
41316
  const _val = isSingle ? {
41265
41317
  [name]: val
41266
41318
  } : {
41267
- [name]: [...formData, {
41268
- ...val
41269
- }]
41319
+ [name]: [...formData, _objectSpread2({}, val)]
41270
41320
  };
41271
41321
  if (groupFormId) {
41272
- const _defaultData = form?.getFieldValue(groupFormId) || {};
41273
- const _newData = {
41274
- ..._defaultData,
41275
- ..._val
41276
- };
41277
- form?.setFieldValue(groupFormId, _newData);
41278
- onValuesChange(_newData, {
41279
- ...formsValue,
41322
+ const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
41323
+ const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
41324
+ form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
41325
+ onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
41280
41326
  [groupFormId]: _newData
41281
- });
41282
- setValues({
41283
- ...formsValue,
41327
+ }));
41328
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
41284
41329
  [groupFormId]: _newData
41285
- });
41330
+ }));
41286
41331
  return;
41287
41332
  }
41288
- form?.setFieldValue(name, _val[name]);
41289
- onValuesChange(_val, {
41290
- ...formsValue,
41291
- ..._val
41292
- });
41293
- setValues({
41294
- ...formsValue,
41295
- ..._val
41296
- });
41333
+ form === null || form === void 0 || form.setFieldValue(name, _val[name]);
41334
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
41335
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
41297
41336
  },
41298
41337
  k: name,
41299
41338
  formData: formData
41300
41339
  });
41301
41340
  },
41302
- internallink: ({
41303
- name,
41304
- inputName,
41305
- props,
41306
- value,
41307
- repeatIndex,
41308
- repeatValues,
41309
- formsValue
41310
- }, {
41311
- form,
41312
- inputMeta = {},
41313
- t
41314
- }) => {
41315
- return /*#__PURE__*/jsxRuntime.jsx(Website, {
41341
+ internallink: (_ref46, _ref47) => {
41342
+ let {
41343
+ name,
41344
+ inputName,
41345
+ props,
41346
+ value,
41347
+ repeatIndex,
41348
+ repeatValues,
41349
+ formsValue
41350
+ } = _ref46;
41351
+ let {
41352
+ form,
41353
+ inputMeta = {},
41354
+ t
41355
+ } = _ref47;
41356
+ return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
41316
41357
  allowClear: true,
41317
41358
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
41318
41359
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com",
41319
- initialValue: value,
41320
- ...props,
41360
+ initialValue: value
41361
+ }, props), {}, {
41321
41362
  onChange: val => updateFormValues(repeatIndex, repeatValues, inputName, val, formsValue, name, form)
41322
- });
41363
+ }));
41323
41364
  },
41324
- group: ({
41325
- props,
41326
- groupInputs
41327
- }) => {
41328
- return /*#__PURE__*/jsxRuntime.jsx(GroupInput$1, {
41329
- groupInputs: groupInputs,
41330
- ...props
41331
- });
41365
+ group: _ref48 => {
41366
+ let {
41367
+ props,
41368
+ groupInputs
41369
+ } = _ref48;
41370
+ return /*#__PURE__*/jsxRuntime.jsx(GroupInput$1, _objectSpread2({
41371
+ groupInputs: groupInputs
41372
+ }, props));
41332
41373
  },
41333
- groupInputs: ({
41334
- props,
41335
- groupInputs
41336
- }, {
41337
- inputMeta
41338
- }) => {
41339
- return /*#__PURE__*/jsxRuntime.jsx(GroupInput$1, {
41374
+ groupInputs: (_ref49, _ref50) => {
41375
+ let {
41376
+ props,
41377
+ groupInputs
41378
+ } = _ref49;
41379
+ let {
41380
+ inputMeta
41381
+ } = _ref50;
41382
+ return /*#__PURE__*/jsxRuntime.jsx(GroupInput$1, _objectSpread2({
41340
41383
  groupInputs: groupInputs,
41341
- inputMeta: inputMeta,
41342
- ...props
41343
- });
41384
+ inputMeta: inputMeta
41385
+ }, props));
41344
41386
  },
41345
- radioGroup: ({
41346
- props,
41347
- value,
41348
- options
41349
- }) => {
41350
- return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
41351
- value: value,
41352
- ...props,
41387
+ radioGroup: _ref51 => {
41388
+ let {
41389
+ props,
41390
+ value,
41391
+ options
41392
+ } = _ref51;
41393
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, _objectSpread2(_objectSpread2({
41394
+ value: value
41395
+ }, props), {}, {
41353
41396
  children: (options || []).map(o => {
41354
41397
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
41355
41398
  value: o.value,
@@ -41362,16 +41405,17 @@ const inputTypeComponent = {
41362
41405
  }) : null]
41363
41406
  }, o.value);
41364
41407
  })
41365
- });
41408
+ }));
41366
41409
  },
41367
- checkboxGroup: ({
41368
- props,
41369
- value,
41370
- options
41371
- }) => {
41372
- return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, {
41373
- value: value,
41374
- ...props,
41410
+ checkboxGroup: _ref52 => {
41411
+ let {
41412
+ props,
41413
+ value,
41414
+ options
41415
+ } = _ref52;
41416
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, _objectSpread2(_objectSpread2({
41417
+ value: value
41418
+ }, props), {}, {
41375
41419
  children: (options || []).map(o => {
41376
41420
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Checkbox, {
41377
41421
  value: o.value,
@@ -41384,28 +41428,30 @@ const inputTypeComponent = {
41384
41428
  }) : null]
41385
41429
  }, o.value);
41386
41430
  })
41387
- });
41431
+ }));
41388
41432
  }
41389
41433
  };
41390
- const GetFormItem = ({
41391
- code,
41392
- inputData,
41393
- inputId,
41394
- input,
41395
- setLoading,
41396
- values,
41397
- MainForm,
41398
- options,
41399
- plainForms,
41400
- setValues,
41401
- alertError,
41402
- setAddress,
41403
- inputMeta = {},
41404
- inputKey,
41405
- changeInputMeta = () => {},
41406
- i,
41407
- isCreate = false
41408
- }) => {
41434
+ const GetFormItem = _ref53 => {
41435
+ var _find, _input$meta12, _input$meta13, _input$meta14, _input$meta15, _input$meta16, _input$meta17, _input$meta18, _inputData$value, _input$meta19, _input$meta20, _inputData$commentVal;
41436
+ let {
41437
+ code,
41438
+ inputData,
41439
+ inputId,
41440
+ input,
41441
+ setLoading,
41442
+ values,
41443
+ MainForm,
41444
+ options,
41445
+ plainForms,
41446
+ setValues,
41447
+ alertError,
41448
+ setAddress,
41449
+ inputMeta = {},
41450
+ inputKey,
41451
+ changeInputMeta = () => {},
41452
+ i,
41453
+ isCreate = false
41454
+ } = _ref53;
41409
41455
  const {
41410
41456
  t,
41411
41457
  getAppHeader,
@@ -41421,7 +41467,7 @@ const GetFormItem = ({
41421
41467
  case "h6":
41422
41468
  return getInputHeadLines(input.type, i, input, values);
41423
41469
  default:
41424
- const rules = inputMeta?.notApplicable || inputMeta?.notAvailable ? [] : inputData.rules ? inputData.rules.filter(rule => !Object.keys(rule).includes("accept") && !Object.keys(rule).includes("max")) : [];
41470
+ const rules = inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable ? [] : inputData.rules ? inputData.rules.filter(rule => !Object.keys(rule).includes("accept") && !Object.keys(rule).includes("max")) : [];
41425
41471
  const requiredRule = rules.find(r => r.required);
41426
41472
  if (requiredRule && input.type === "text") {
41427
41473
  rules.push({
@@ -41430,47 +41476,45 @@ const GetFormItem = ({
41430
41476
  });
41431
41477
  }
41432
41478
  const noLabel = ["message"].includes(input.type);
41433
- let maxRule = (inputData?.rules || []).find(rule => rule.max)?.max;
41479
+ let maxRule = (_find = ((inputData === null || inputData === void 0 ? void 0 : inputData.rules) || []).find(rule => rule.max)) === null || _find === void 0 ? void 0 : _find.max;
41434
41480
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
41435
41481
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
41436
41482
  className: "flex input-cont",
41437
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
41438
- initialValue: inputMeta?.defaultValue,
41439
- ...(["total100", "group"].includes(input.type) ? {} : {
41440
- name: inputId,
41441
- fieldKey: inputId,
41442
- initialValue: inputData.value
41443
- }),
41444
- ...(["upload", "imageUpload", "videoUpload"].includes(input.type) ? {
41445
- valuePropName: "fileList",
41446
- getValueFromEvent: e => {
41447
- if (Array.isArray(e)) {
41448
- return e;
41449
- }
41450
- return e && e.fileList && e.fileList.map(f => {
41451
- if (f.response) {
41452
- return f.response;
41453
- }
41454
- return f;
41455
- });
41483
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
41484
+ initialValue: inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.defaultValue
41485
+ }, ["total100", "group"].includes(input.type) ? {} : {
41486
+ name: inputId,
41487
+ fieldKey: inputId,
41488
+ initialValue: inputData.value
41489
+ }), ["upload", "imageUpload", "videoUpload"].includes(input.type) ? {
41490
+ valuePropName: "fileList",
41491
+ getValueFromEvent: e => {
41492
+ if (Array.isArray(e)) {
41493
+ return e;
41456
41494
  }
41457
- } : {}),
41495
+ return e && e.fileList && e.fileList.map(f => {
41496
+ if (f.response) {
41497
+ return f.response;
41498
+ }
41499
+ return f;
41500
+ });
41501
+ }
41502
+ } : {}), {}, {
41458
41503
  style: input.showOnView === false ? {
41459
41504
  display: "none"
41460
- } : {},
41461
- ...(["switch"].includes(input.type) ? {
41462
- labelCol: {
41463
- span: 20
41464
- },
41465
- style: {
41466
- ...(input.showOnView === false ? {
41467
- display: "none"
41468
- } : {}),
41469
- flexDirection: "row",
41470
- justifyContent: "space-between"
41471
- }
41472
- } : {}),
41473
- className: input.comment ? `flex-1 with-comment i-${input.type}` : `i-${input.type} flex-1`,
41505
+ } : {}
41506
+ }, ["switch"].includes(input.type) ? {
41507
+ labelCol: {
41508
+ span: 20
41509
+ },
41510
+ style: _objectSpread2(_objectSpread2({}, input.showOnView === false ? {
41511
+ display: "none"
41512
+ } : {}), {}, {
41513
+ flexDirection: "row",
41514
+ justifyContent: "space-between"
41515
+ })
41516
+ } : {}), {}, {
41517
+ className: input.comment ? "flex-1 with-comment i-".concat(input.type) : "i-".concat(input.type, " flex-1"),
41474
41518
  "data-id": inputData.name,
41475
41519
  rules: rules,
41476
41520
  required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
@@ -41481,8 +41525,8 @@ const GetFormItem = ({
41481
41525
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
41482
41526
  className: "mr-1",
41483
41527
  children: getInputLabel(input, values)
41484
- }), !!input?.meta?.tooltip && /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
41485
- title: input?.meta?.tooltip,
41528
+ }), !!(input !== null && input !== void 0 && (_input$meta12 = input.meta) !== null && _input$meta12 !== void 0 && _input$meta12.tooltip) && /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
41529
+ title: input === null || input === void 0 || (_input$meta13 = input.meta) === null || _input$meta13 === void 0 ? void 0 : _input$meta13.tooltip,
41486
41530
  trigger: "hover",
41487
41531
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
41488
41532
  className: "flex flex-column justify-content-center",
@@ -41500,7 +41544,7 @@ const GetFormItem = ({
41500
41544
  title: t("Not applicable"),
41501
41545
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
41502
41546
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
41503
- disabled: !input?.meta?.notApplicable,
41547
+ disabled: !(input !== null && input !== void 0 && (_input$meta14 = input.meta) !== null && _input$meta14 !== void 0 && _input$meta14.notApplicable),
41504
41548
  className: formatClassname(["default p-0", inputMeta.notApplicable && "primary"]),
41505
41549
  type: "link",
41506
41550
  onClick: () => {
@@ -41535,7 +41579,7 @@ const GetFormItem = ({
41535
41579
  title: t("No available information"),
41536
41580
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
41537
41581
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
41538
- disabled: !input?.meta?.notAvailable,
41582
+ disabled: !(input !== null && input !== void 0 && (_input$meta15 = input.meta) !== null && _input$meta15 !== void 0 && _input$meta15.notAvailable),
41539
41583
  className: formatClassname(["default p-0", inputMeta.notAvailable && "primary"]),
41540
41584
  type: "link",
41541
41585
  onClick: () => {
@@ -41569,14 +41613,14 @@ const GetFormItem = ({
41569
41613
  }), /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
41570
41614
  title: t("Add comment"),
41571
41615
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
41572
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
41616
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
41573
41617
  type: "link",
41574
- disabled: !input?.meta?.comment,
41575
- ...(!isShown ? {
41576
- className: "default p-0"
41577
- } : {
41578
- className: "p-0 primary"
41579
- }),
41618
+ disabled: !(input !== null && input !== void 0 && (_input$meta16 = input.meta) !== null && _input$meta16 !== void 0 && _input$meta16.comment)
41619
+ }, !isShown ? {
41620
+ className: "default p-0"
41621
+ } : {
41622
+ className: "p-0 primary"
41623
+ }), {}, {
41580
41624
  onClick: () => {
41581
41625
  setIsShown(true);
41582
41626
  changeInputMeta({
@@ -41592,18 +41636,18 @@ const GetFormItem = ({
41592
41636
  width: 16,
41593
41637
  height: 16
41594
41638
  })
41595
- })
41639
+ }))
41596
41640
  })
41597
41641
  })]
41598
- }), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
41642
+ }), (_input$meta17 = input.meta) !== null && _input$meta17 !== void 0 && _input$meta17.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
41599
41643
  className: "code",
41600
41644
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
41601
- children: input.meta?.code
41645
+ children: (_input$meta18 = input.meta) === null || _input$meta18 === void 0 ? void 0 : _input$meta18.code
41602
41646
  })
41603
41647
  }) : code ? /*#__PURE__*/jsxRuntime.jsx("div", {
41604
41648
  className: "code",
41605
41649
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
41606
- children: `${code}.${i + 1}`
41650
+ children: "".concat(code, ".").concat(i + 1)
41607
41651
  })
41608
41652
  }) : null]
41609
41653
  })
@@ -41623,7 +41667,7 @@ const GetFormItem = ({
41623
41667
  getAppHeader,
41624
41668
  getApiBaseUrl
41625
41669
  }) : console.log(input)
41626
- })
41670
+ }))
41627
41671
  }), alertError ? /*#__PURE__*/jsxRuntime.jsx(antd.Alert, {
41628
41672
  message: alertError.message,
41629
41673
  type: "error",
@@ -41652,10 +41696,10 @@ const GetFormItem = ({
41652
41696
  className: "max-char-span",
41653
41697
  children: t("max-char", {
41654
41698
  chars: maxRule,
41655
- filled: inputData?.value?.length || 0
41699
+ filled: (inputData === null || inputData === void 0 || (_inputData$value = inputData.value) === null || _inputData$value === void 0 ? void 0 : _inputData$value.length) || 0
41656
41700
  })
41657
41701
  })
41658
- }) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
41702
+ }) : null, (_input$meta19 = input.meta) !== null && _input$meta19 !== void 0 && _input$meta19.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
41659
41703
  className: "input-content dynamic-form-comment",
41660
41704
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
41661
41705
  className: "comment-textarea",
@@ -41681,7 +41725,7 @@ const GetFormItem = ({
41681
41725
  },
41682
41726
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
41683
41727
  type: "link",
41684
- disabled: !input.meta?.comment,
41728
+ disabled: !((_input$meta20 = input.meta) !== null && _input$meta20 !== void 0 && _input$meta20.comment),
41685
41729
  className: "p-0",
41686
41730
  children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
41687
41731
  width: 16,
@@ -41712,7 +41756,7 @@ const GetFormItem = ({
41712
41756
  className: "max-char-span",
41713
41757
  children: t("max-char", {
41714
41758
  chars: MAX_COMMENTS_LENGTH,
41715
- filled: inputData?.commentValue?.length || 0
41759
+ filled: (inputData === null || inputData === void 0 || (_inputData$commentVal = inputData.commentValue) === null || _inputData$commentVal === void 0 ? void 0 : _inputData$commentVal.length) || 0
41716
41760
  })
41717
41761
  })]
41718
41762
  }) : null]
@@ -41732,22 +41776,23 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
41732
41776
  const formId = form.dataId || k;
41733
41777
  const allInputs = Object.keys(form.inputs).filter(i => {
41734
41778
  const input = form.inputs[i];
41735
- return !excludedKeys.includes(i) && !input.excludeFromEdit && showHideInput(input, values, undefined, undefined, setValues, `${formId}.${i}`);
41779
+ return !excludedKeys.includes(i) && !input.excludeFromEdit && showHideInput(input, values, undefined, undefined, setValues, "".concat(formId, ".").concat(i));
41736
41780
  });
41737
41781
  return allInputs.length ? /*#__PURE__*/jsxRuntime.jsxs(React__default["default"].Fragment, {
41738
41782
  children: [getFormTitles(formTitles, formId, i), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(form.type) ? getInputHeadLines(form.type, i, form, values) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
41739
41783
  children: [!form.repeatable ? /*#__PURE__*/jsxRuntime.jsx("h3", {
41740
- className: `${form.titleClass ? form.titleClass : 'title-semibold-4'} mb0 ${i ? 'mt-3' : ''}`,
41784
+ className: "".concat(form.titleClass ? form.titleClass : 'title-semibold-4', " mb0 ").concat(i ? 'mt-3' : ''),
41741
41785
  children: getInputLabel(form, values)
41742
41786
  }) : !form.hideSectionLabel ? /*#__PURE__*/jsxRuntime.jsx("h3", {
41743
- className: `${form.titleClass ? form.titleClass : 'title-semibold-4'} mb0 ${i ? 'mt-3' : ''}`,
41787
+ className: "".concat(form.titleClass ? form.titleClass : 'title-semibold-4', " mb0 ").concat(i ? 'mt-3' : ''),
41744
41788
  children: form.sectionLabel ? getSectionLabel(form.sectionLabel, values) : form.label ? getInputLabel(form, values) : camelCaseToTitle(k)
41745
41789
  }) : null, /*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
41746
41790
  name: formId,
41747
- children: (fields, {
41748
- add,
41749
- remove
41750
- }) => {
41791
+ children: (fields, _ref) => {
41792
+ let {
41793
+ add,
41794
+ remove
41795
+ } = _ref;
41751
41796
  const formData = form.repeatable ? values[formId] || [] : values[formId] ? [values[formId]] : [];
41752
41797
  if (fields.length === 0) {
41753
41798
  const formInputs = form.inputs;
@@ -41798,7 +41843,7 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
41798
41843
  padding: '0px 5px',
41799
41844
  color: '#2E90FA'
41800
41845
  },
41801
- children: `#${field.name + 1}`
41846
+ children: "#".concat(field.name + 1)
41802
41847
  }), /*#__PURE__*/jsxRuntime.jsx("div", {
41803
41848
  className: "remove-button-for-repeatable",
41804
41849
  children: (formData.filter(k => Object.keys(k).length > 0).length >= 1 || fields.length > 1) && (typeof form.canDelete !== 'function' || form.canDelete(Array.isArray(values[formId]) ? values[formId][field.name] || {} : values[formId] || {})) ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
@@ -41820,8 +41865,8 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
41820
41865
  const inputId = input.dataId || inp;
41821
41866
  const inputValues = Array.isArray(values[formId]) ? values[formId][field.name] || {} : values[formId] || {};
41822
41867
  const value = inputValues[inputId];
41823
- const commentValue = inputValues[`${inputId}Comment`];
41824
- const inputData = getData(formId, input, value, commentValue, `${formId}[${field.name}].${inputId}`, `${formId}.${inputId}`);
41868
+ const commentValue = inputValues["".concat(inputId, "Comment")];
41869
+ const inputData = getData(formId, input, value, commentValue, "".concat(formId, "[").concat(field.name, "].").concat(inputId), "".concat(formId, ".").concat(inputId));
41825
41870
  const subtitles = form.subtitles || null;
41826
41871
  inputData.repeatIndex = field.name;
41827
41872
  inputData.inputName = inputId;
@@ -41842,64 +41887,59 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
41842
41887
  message: requiredRule.message || ''
41843
41888
  });
41844
41889
  }
41845
- return showHideInput(input, values, field.name, inputValues, setValues, `${formId}[${field.name}].${inputId}`) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
41890
+ return showHideInput(input, values, field.name, inputValues, setValues, "".concat(formId, "[").concat(field.name, "].").concat(inputId)) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
41846
41891
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
41847
- className: form.repeatable ? `inputs` : "",
41892
+ className: form.repeatable ? "inputs" : "",
41848
41893
  children: [getSubtitles(subtitles, input.position, values, field.name, inputValues), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(input.type) ? getInputHeadLines(input.type, i, input, values) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
41849
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
41850
- ...field,
41851
- required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
41852
- ...(['total100', 'group'].includes(input.type) ? {} : {
41853
- name: [field.name, inputId],
41854
- fieldKey: [field.fieldKey, inputId],
41855
- initialValue: inputData.value
41856
- }),
41857
- ...(['upload'].includes(input.type) ? {
41858
- valuePropName: "fileList",
41859
- getValueFromEvent: e => {
41860
- if (Array.isArray(e)) {
41861
- return e;
41862
- }
41863
- return e && e.fileList && e.fileList.map(f => {
41864
- if (f.response) {
41865
- return f.response;
41866
- }
41867
- return f;
41868
- });
41894
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, field), {}, {
41895
+ required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
41896
+ }, ['total100', 'group'].includes(input.type) ? {} : {
41897
+ name: [field.name, inputId],
41898
+ fieldKey: [field.fieldKey, inputId],
41899
+ initialValue: inputData.value
41900
+ }), ['upload'].includes(input.type) ? {
41901
+ valuePropName: "fileList",
41902
+ getValueFromEvent: e => {
41903
+ if (Array.isArray(e)) {
41904
+ return e;
41869
41905
  }
41870
- } : {}),
41906
+ return e && e.fileList && e.fileList.map(f => {
41907
+ if (f.response) {
41908
+ return f.response;
41909
+ }
41910
+ return f;
41911
+ });
41912
+ }
41913
+ } : {}), {}, {
41871
41914
  style: input.showOnView === false ? {
41872
41915
  display: 'none'
41873
- } : {},
41874
- ...(['switch'].includes(input.type) ? {
41875
- labelCol: {
41876
- span: 20
41877
- },
41878
- style: {
41879
- ...(input.showOnView === false ? {
41880
- display: 'none'
41881
- } : {}),
41882
- flexDirection: 'row',
41883
- justifyContent: 'space-between'
41884
- }
41885
- } : {}),
41916
+ } : {}
41917
+ }, ['switch'].includes(input.type) ? {
41918
+ labelCol: {
41919
+ span: 20
41920
+ },
41921
+ style: _objectSpread2(_objectSpread2({}, input.showOnView === false ? {
41922
+ display: 'none'
41923
+ } : {}), {}, {
41924
+ flexDirection: 'row',
41925
+ justifyContent: 'space-between'
41926
+ })
41927
+ } : {}), {}, {
41886
41928
  label: getInputLabel(input, values),
41887
41929
  rules: rules,
41888
- className: input.comment ? `with-comment i-${input.type}` : `i-${input.type}`,
41930
+ className: input.comment ? "with-comment i-".concat(input.type) : "i-".concat(input.type),
41889
41931
  extra: input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
41890
41932
  disabled: inputData.props.disabled,
41891
41933
  type: "link",
41892
41934
  onClick: () => {
41893
41935
  const inputValues = Array.isArray(values[formId]) ? values[formId][field.name] || {} : values[formId] || {};
41894
- inputValues[`${inputData.inputName}Comment`] = !inputData.commentValue ? '' : undefined;
41936
+ inputValues["".concat(inputData.inputName, "Comment")] = !inputData.commentValue ? '' : undefined;
41895
41937
  if (Array.isArray(values[formId])) {
41896
41938
  values[formId][field.name] = inputValues;
41897
41939
  } else {
41898
41940
  values[formId] = inputValues;
41899
41941
  }
41900
- setValues({
41901
- ...values
41902
- });
41942
+ setValues(_objectSpread2({}, values));
41903
41943
  },
41904
41944
  children: t(!inputData.commentValue ? 'Add Comment' : 'Remove Comment')
41905
41945
  }) : null,
@@ -41916,9 +41956,9 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
41916
41956
  getAppHeader,
41917
41957
  getApiBaseUrl
41918
41958
  }) : console.log(input)
41919
- }), input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
41920
- name: [field.name, `${inputData.inputName}Comment`],
41921
- fieldKey: [field.fieldKey, `${inputData.inputName}Comment`],
41959
+ })), input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
41960
+ name: [field.name, "".concat(inputData.inputName, "Comment")],
41961
+ fieldKey: [field.fieldKey, "".concat(inputData.inputName, "Comment")],
41922
41962
  initialValue: inputData.commentValue,
41923
41963
  hidden: !inputData.commentValue,
41924
41964
  children: inputTypeComponent.comment(inputData, {
@@ -41932,10 +41972,10 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
41932
41972
  }) : null]
41933
41973
  })]
41934
41974
  }, ii)
41935
- }, `${i}${ii}`) : null;
41975
+ }, "".concat(i).concat(ii)) : null;
41936
41976
  })
41937
41977
  })]
41938
- }, `${formId}-${field.name}`)), form.repeatable ? /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
41978
+ }, "".concat(formId, "-").concat(field.name))), form.repeatable ? /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
41939
41979
  type: "dashed",
41940
41980
  style: {
41941
41981
  margin: '10px 0px 30px',
@@ -41964,7 +42004,7 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
41964
42004
  const hasLabel = label && (typeof label === 'string' && (label || '').trim() !== '' || typeof label === 'object') ? true : false;
41965
42005
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
41966
42006
  children: [hasLabel ? /*#__PURE__*/jsxRuntime.jsx("h3", {
41967
- className: `${form.titleClass ? form.titleClass : 'title-semibold-4'} ${i ? 'mt-3 mb-1' : ''}`,
42007
+ className: "".concat(form.titleClass ? form.titleClass : 'title-semibold-4', " ").concat(i ? 'mt-3 mb-1' : ''),
41968
42008
  children: label
41969
42009
  }) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
41970
42010
  className: hasLabel ? "mb-4" : "",
@@ -41973,8 +42013,8 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
41973
42013
  const inputId = input.dataId || inp;
41974
42014
  const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
41975
42015
  const value = inputValues[inputId];
41976
- const commentValue = inputValues[`${inputId}Comment`];
41977
- const inputData = getData(formId, input, value, commentValue, `${formId}.${inputId}`, `${formId}.${inputId}`);
42016
+ const commentValue = inputValues["".concat(inputId, "Comment")];
42017
+ const inputData = getData(formId, input, value, commentValue, "".concat(formId, ".").concat(inputId), "".concat(formId, ".").concat(inputId));
41978
42018
  const subtitles = form.subtitles || null;
41979
42019
  inputData.repeatIndex = undefined;
41980
42020
  inputData.inputName = inputId;
@@ -41995,62 +42035,58 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
41995
42035
  message: requiredRule.message || ''
41996
42036
  });
41997
42037
  }
41998
- return showHideInput(input, values, undefined, inputValues, setValues, `${formId}.${inputId}`) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
42038
+ return showHideInput(input, values, undefined, inputValues, setValues, "".concat(formId, ".").concat(inputId)) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
41999
42039
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
42000
42040
  children: [getSubtitles(subtitles, input.position, values, undefined, inputValues), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(input.type) ? getInputHeadLines(input.type, i, input, values) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
42001
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
42002
- required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
42003
- ...(['total100', 'group'].includes(input.type) ? {} : {
42004
- name: [formId, inputId],
42005
- fieldKey: [formId, inputId],
42006
- initialValue: inputData.value
42007
- }),
42008
- ...(['upload'].includes(input.type) ? {
42009
- valuePropName: "fileList",
42010
- getValueFromEvent: e => {
42011
- if (Array.isArray(e)) {
42012
- return e;
42013
- }
42014
- return e && e.fileList && e.fileList.map(f => {
42015
- if (f.response) {
42016
- return f.response;
42017
- }
42018
- return f;
42019
- });
42041
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
42042
+ required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
42043
+ }, ['total100', 'group'].includes(input.type) ? {} : {
42044
+ name: [formId, inputId],
42045
+ fieldKey: [formId, inputId],
42046
+ initialValue: inputData.value
42047
+ }), ['upload'].includes(input.type) ? {
42048
+ valuePropName: "fileList",
42049
+ getValueFromEvent: e => {
42050
+ if (Array.isArray(e)) {
42051
+ return e;
42020
42052
  }
42021
- } : {}),
42053
+ return e && e.fileList && e.fileList.map(f => {
42054
+ if (f.response) {
42055
+ return f.response;
42056
+ }
42057
+ return f;
42058
+ });
42059
+ }
42060
+ } : {}), {}, {
42022
42061
  style: input.showOnView === false ? {
42023
42062
  display: 'none'
42024
- } : {},
42025
- ...(['switch'].includes(input.type) ? {
42026
- labelCol: {
42027
- span: 20
42028
- },
42029
- style: {
42030
- ...(input.showOnView === false ? {
42031
- display: 'none'
42032
- } : {}),
42033
- flexDirection: 'row',
42034
- justifyContent: 'space-between'
42035
- }
42036
- } : {}),
42063
+ } : {}
42064
+ }, ['switch'].includes(input.type) ? {
42065
+ labelCol: {
42066
+ span: 20
42067
+ },
42068
+ style: _objectSpread2(_objectSpread2({}, input.showOnView === false ? {
42069
+ display: 'none'
42070
+ } : {}), {}, {
42071
+ flexDirection: 'row',
42072
+ justifyContent: 'space-between'
42073
+ })
42074
+ } : {}), {}, {
42037
42075
  label: getInputLabel(input, values),
42038
42076
  rules: rules,
42039
- className: input.comment ? `with-comment i-${input.type}` : `i-${input.type}`,
42077
+ className: input.comment ? "with-comment i-".concat(input.type) : "i-".concat(input.type),
42040
42078
  extra: input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
42041
42079
  disabled: inputData.props.disabled,
42042
42080
  type: "link",
42043
42081
  onClick: () => {
42044
42082
  const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
42045
- inputValues[`${inputData.inputName}Comment`] = !inputData.commentValue ? '' : undefined;
42083
+ inputValues["".concat(inputData.inputName, "Comment")] = !inputData.commentValue ? '' : undefined;
42046
42084
  if (Array.isArray(values[formId])) {
42047
42085
  values[formId] = inputValues;
42048
42086
  } else {
42049
42087
  values[formId] = inputValues;
42050
42088
  }
42051
- setValues({
42052
- ...values
42053
- });
42089
+ setValues(_objectSpread2({}, values));
42054
42090
  },
42055
42091
  children: t(!inputData.commentValue ? 'Add Comment' : 'Remove Comment')
42056
42092
  }) : null,
@@ -42065,9 +42101,9 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
42065
42101
  getAppHeader,
42066
42102
  getApiBaseUrl
42067
42103
  }) : console.log(input)
42068
- }), input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
42069
- name: [formId, `${inputData.inputName}Comment`],
42070
- fieldKey: [formId, `${inputData.inputName}Comment`],
42104
+ })), input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
42105
+ name: [formId, "".concat(inputData.inputName, "Comment")],
42106
+ fieldKey: [formId, "".concat(inputData.inputName, "Comment")],
42071
42107
  initialValue: inputData.commentValue,
42072
42108
  hidden: !inputData.commentValue,
42073
42109
  children: inputTypeComponent.comment(inputData, {
@@ -42081,7 +42117,7 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
42081
42117
  }) : null]
42082
42118
  })]
42083
42119
  }, ii)
42084
- }, `${i}${ii}`) : null;
42120
+ }, "".concat(i).concat(ii)) : null;
42085
42121
  })
42086
42122
  })]
42087
42123
  });
@@ -42120,10 +42156,7 @@ const useCombinedPrefilledValues = (combinedPrefilledValues, values, parentValue
42120
42156
  }
42121
42157
  });
42122
42158
  if (hasChanges) {
42123
- setValues(prevValues => ({
42124
- ...prevValues,
42125
- ...resolvedValues
42126
- }));
42159
+ setValues(prevValues => _objectSpread2(_objectSpread2({}, prevValues), resolvedValues));
42127
42160
  MainForm.setFieldsValue(resolvedValues);
42128
42161
  }
42129
42162
  }, [values, parentValues, combinedPrefilledValues, setValues, MainForm]);