datastake-daf 0.6.842 → 0.6.844

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/components/index.js +800 -774
  2. package/dist/hooks/index.js +4 -6
  3. package/dist/layouts/index.js +6 -0
  4. package/dist/pages/index.js +172 -115
  5. package/package.json +1 -1
  6. package/src/@daf/core/components/DynamicForm/hook.js +2 -2
  7. package/src/@daf/core/components/DynamicForm/index.jsx +1 -1
  8. package/src/@daf/core/components/Filters/selectFilters/index.jsx +7 -1
  9. package/src/@daf/core/components/Graphs/TradeRelationship/index.jsx +1 -27
  10. package/src/@daf/core/components/Graphs/components/BaseGraph.jsx +22 -18
  11. package/src/@daf/core/components/Screens/Admin/AdminModals/NewAccount/index.jsx +19 -6
  12. package/src/@daf/core/components/Screens/Admin/AdminScreens/Accounts.jsx +4 -1
  13. package/src/@daf/core/components/Screens/Admin/AdminTables/AccountTable/index.jsx +2 -0
  14. package/src/@daf/core/components/Select/MultiSelect/style.js +1 -1
  15. package/src/@daf/core/components/ViewForm/components/DataLink/flat.js +7 -3
  16. package/src/@daf/core/components/ViewForm/components/DataLink/index.js +6 -2
  17. package/src/@daf/core/components/ViewForm/components/input.js +7 -7
  18. package/src/@daf/hooks/useWidgetFetch.js +26 -35
  19. package/src/@daf/pages/Dashboards/ConflictManagement/components/RisksWidget/components/IncidentsTime/index.js +1 -0
  20. package/src/@daf/pages/ResetPassword/index.jsx +228 -228
  21. package/src/@daf/pages/Summary/Operator/components/KeyInformation/config.js +0 -1
  22. package/src/@daf/pages/Summary/Operator/components/TradeRelationships/helper.js +7 -5
  23. package/src/@daf/pages/Summary/Operator/components/TradeRelationships/hook.js +29 -14
  24. package/src/@daf/pages/Summary/Operator/components/TradeRelationships/index.js +69 -20
  25. package/src/@daf/pages/Summary/Operator/index.jsx +1 -0
  26. package/src/@daf/pages/Template/components/LinkingTemplate/config.js +1 -0
  27. package/src/@daf/pages/Template/components/LinkingTemplate/index.jsx +3 -1
  28. package/src/@daf/pages/View/index.jsx +1 -1
  29. package/src/@daf/services/LinkedSubjects.js +1 -0
  30. package/src/helpers/Forms.js +7 -5
@@ -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
@@ -5593,7 +5593,8 @@ const getValueOnSelectFromDefaultKeys = (val, options, uniqueDefaultKeys) => {
5593
5593
  * @param {object} obj - Object to traverse
5594
5594
  * @returns {any} - Resolved value or undefined
5595
5595
  */
5596
- const resolveValuePath = (path, obj) => {
5596
+ const resolveValuePath = (path, obj, form) => {
5597
+ var _Object$keys;
5597
5598
  if (!path || !obj) return undefined;
5598
5599
 
5599
5600
  // Split by / and traverse the object
@@ -5612,7 +5613,8 @@ const resolveValuePath = (path, obj) => {
5612
5613
  current = current[part];
5613
5614
  }
5614
5615
  }
5615
- return current;
5616
+ const value = ((_Object$keys = Object.keys(form || {})) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0 ? findOptions(current, (form === null || form === void 0 ? void 0 : form.options) || []) : current;
5617
+ return value;
5616
5618
  };
5617
5619
 
5618
5620
  /**
@@ -5684,6 +5686,7 @@ const getCombinedPrefilledValues = form => {
5684
5686
  const resolveCombinedPrefilledValue = function (template) {
5685
5687
  let values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
5686
5688
  let parentValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
5689
+ let form = arguments.length > 3 ? arguments[3] : undefined;
5687
5690
  if (!template || typeof template !== 'string') return '';
5688
5691
 
5689
5692
  // Regular expression to match placeholders like {path} or {path^subpath}
@@ -5696,7 +5699,8 @@ const resolveCombinedPrefilledValue = function (template) {
5696
5699
  if (nonParentPaths.length > 0) {
5697
5700
  // Check if at least one non-parent value has actual data
5698
5701
  hasNonParentValue = nonParentPaths.some(path => {
5699
- const value = resolveValuePath(path, values);
5702
+ var _form$inputs;
5703
+ const value = resolveValuePath(path, values, form === null || form === void 0 || (_form$inputs = form.inputs) === null || _form$inputs === void 0 ? void 0 : _form$inputs[path]);
5700
5704
  return value !== undefined && value !== null && value !== '';
5701
5705
  });
5702
5706
 
@@ -5715,8 +5719,9 @@ const resolveCombinedPrefilledValue = function (template) {
5715
5719
  const resolved = resolveValuePath(actualPath, parentValues);
5716
5720
  return formatValue(resolved);
5717
5721
  } else {
5722
+ var _form$inputs2;
5718
5723
  // Regular path in current values
5719
- const resolved = resolveValuePath(path, values);
5724
+ const resolved = resolveValuePath(path, values, form === null || form === void 0 || (_form$inputs2 = form.inputs) === null || _form$inputs2 === void 0 ? void 0 : _form$inputs2[path]);
5720
5725
  return formatValue(resolved);
5721
5726
  }
5722
5727
  });
@@ -5868,6 +5873,12 @@ const SelectFilters = _ref => {
5868
5873
  } = _ref;
5869
5874
  const [filters, setFilters] = React.useState(selectedFilters || {});
5870
5875
  const [initFilters, setInitFilters] = React.useState(selectedFilters || {});
5876
+
5877
+ // Sync internal state with selectedFilters prop when it changes
5878
+ React.useEffect(() => {
5879
+ setFilters(selectedFilters || {});
5880
+ setInitFilters(selectedFilters || {});
5881
+ }, [selectedFilters]);
5871
5882
  const getClearLabel = () => {
5872
5883
  switch (type) {
5873
5884
  case 'small':
@@ -6033,7 +6044,7 @@ SelectFilters.propTypes = {
6033
6044
  apiUrl: PropTypes__default["default"].string
6034
6045
  };
6035
6046
 
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"];
6047
+ 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
6048
  function DAFTable(_ref) {
6038
6049
  let {
6039
6050
  columns = [],
@@ -6064,7 +6075,7 @@ function DAFTable(_ref) {
6064
6075
  app,
6065
6076
  doEmptyRows
6066
6077
  } = _ref,
6067
- rest = _objectWithoutProperties(_ref, _excluded$B);
6078
+ rest = _objectWithoutProperties(_ref, _excluded$C);
6068
6079
  const source = React.useMemo(() => {
6069
6080
  if (data && Array.isArray(data)) {
6070
6081
  return data;
@@ -6889,7 +6900,7 @@ function ComponentWithFocus(_ref) {
6889
6900
  }
6890
6901
 
6891
6902
  var _templateObject$h;
6892
- const _excluded$A = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
6903
+ const _excluded$B = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
6893
6904
  function StickyTable(_ref) {
6894
6905
  let {
6895
6906
  size = "small",
@@ -6900,7 +6911,7 @@ function StickyTable(_ref) {
6900
6911
  pagination = false,
6901
6912
  doEmptyRows = true
6902
6913
  } = _ref,
6903
- props = _objectWithoutProperties(_ref, _excluded$A);
6914
+ props = _objectWithoutProperties(_ref, _excluded$B);
6904
6915
  const data = React__default["default"].useMemo(() => {
6905
6916
  if (!doEmptyRows) {
6906
6917
  return dataSource;
@@ -7428,7 +7439,7 @@ const BTN_SIZE = {
7428
7439
  LG: 'large'
7429
7440
  };
7430
7441
 
7431
- const _excluded$z = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
7442
+ const _excluded$A = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
7432
7443
  function DafButton(_ref) {
7433
7444
  let {
7434
7445
  content = '',
@@ -7442,7 +7453,7 @@ function DafButton(_ref) {
7442
7453
  style = {},
7443
7454
  className = ''
7444
7455
  } = _ref,
7445
- restProps = _objectWithoutProperties(_ref, _excluded$z);
7456
+ restProps = _objectWithoutProperties(_ref, _excluded$A);
7446
7457
  return /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
7447
7458
  icon: icon,
7448
7459
  type: type,
@@ -7561,12 +7572,12 @@ const Style$R = styled__default["default"].div`
7561
7572
  }
7562
7573
  `;
7563
7574
 
7564
- const _excluded$y = ["children"];
7575
+ const _excluded$z = ["children"];
7565
7576
  const BorderedButton = _ref => {
7566
7577
  let {
7567
7578
  children
7568
7579
  } = _ref,
7569
- props = _objectWithoutProperties(_ref, _excluded$y);
7580
+ props = _objectWithoutProperties(_ref, _excluded$z);
7570
7581
  return /*#__PURE__*/jsxRuntime.jsx(Style$R, {
7571
7582
  className: "d-btn-cont",
7572
7583
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({}, props), {}, {
@@ -7706,12 +7717,12 @@ Badge.propTypes = {
7706
7717
  props: PropTypes__default["default"].object
7707
7718
  };
7708
7719
 
7709
- const _excluded$x = ["icon"];
7720
+ const _excluded$y = ["icon"];
7710
7721
  function GetIcon(_ref) {
7711
7722
  let {
7712
7723
  icon
7713
7724
  } = _ref,
7714
- props = _objectWithoutProperties(_ref, _excluded$x);
7725
+ props = _objectWithoutProperties(_ref, _excluded$y);
7715
7726
  let Icon = Icons__namespace.CloseOutlined;
7716
7727
  if (Icons__namespace[icon]) {
7717
7728
  Icon = Icons__namespace[icon];
@@ -8034,14 +8045,14 @@ const MultiSelectStyled = styled__default["default"](antd.Select)`
8034
8045
  &.ant-select-single {
8035
8046
  .ant-select-selector {
8036
8047
  padding-inline-end: 24px !important;
8037
- padding: 0 !important;
8048
+ padding: 3px !important;
8038
8049
  max-width: 56px !important;
8039
8050
  width: 56px !important;
8040
8051
  }
8041
8052
  }
8042
8053
  `;
8043
8054
 
8044
- const _excluded$w = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
8055
+ const _excluded$x = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
8045
8056
  const {
8046
8057
  useToken: useToken$p
8047
8058
  } = antd.theme;
@@ -8134,7 +8145,7 @@ function Multiselect(_ref) {
8134
8145
  isSingle = false,
8135
8146
  selectionType = SELECTION_TYPES.DEFAULT
8136
8147
  } = _ref,
8137
- restProps = _objectWithoutProperties(_ref, _excluded$w);
8148
+ restProps = _objectWithoutProperties(_ref, _excluded$x);
8138
8149
  const {
8139
8150
  token
8140
8151
  } = useToken$p();
@@ -8854,7 +8865,7 @@ DAFHeader.propTypes = {
8854
8865
  filtersConfig: PropTypes__default["default"].any
8855
8866
  };
8856
8867
 
8857
- const _excluded$v = ["tabs", "onChange", "value", "className"];
8868
+ const _excluded$w = ["tabs", "onChange", "value", "className"];
8858
8869
  function TabsHeader(_ref) {
8859
8870
  let {
8860
8871
  tabs = [],
@@ -8862,7 +8873,7 @@ function TabsHeader(_ref) {
8862
8873
  value = '',
8863
8874
  className = 'mt-2'
8864
8875
  } = _ref,
8865
- rest = _objectWithoutProperties(_ref, _excluded$v);
8876
+ rest = _objectWithoutProperties(_ref, _excluded$w);
8866
8877
  return /*#__PURE__*/jsxRuntime.jsx("div", {
8867
8878
  className: formatClassname(['daf-tabs-header pl-6 pr-6', className]),
8868
8879
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Tabs, _objectSpread2({
@@ -8959,7 +8970,7 @@ DrawerHeader.propTypes = {
8959
8970
  tabsConfig: PropTypes__default["default"].any
8960
8971
  };
8961
8972
 
8962
- const _excluded$u = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
8973
+ const _excluded$v = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
8963
8974
  const useFooter = _ref => {
8964
8975
  let {
8965
8976
  leftContent,
@@ -8994,7 +9005,7 @@ const useFooter = _ref => {
8994
9005
  style = {},
8995
9006
  className = ""
8996
9007
  } = button,
8997
- restProps = _objectWithoutProperties(button, _excluded$u);
9008
+ restProps = _objectWithoutProperties(button, _excluded$v);
8998
9009
  return /*#__PURE__*/jsxRuntime.jsx(DafButton, _objectSpread2({
8999
9010
  content: label,
9000
9011
  type: type,
@@ -11875,7 +11886,7 @@ Widget.propTypes = {
11875
11886
  };
11876
11887
  Widget.displayName = 'Widget';
11877
11888
 
11878
- const _excluded$t = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
11889
+ const _excluded$u = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
11879
11890
  function ImageWidget(_ref) {
11880
11891
  let {
11881
11892
  loading = false,
@@ -11886,7 +11897,7 @@ function ImageWidget(_ref) {
11886
11897
  noDescriptionText,
11887
11898
  isPdf = false
11888
11899
  } = _ref,
11889
- props = _objectWithoutProperties(_ref, _excluded$t);
11900
+ props = _objectWithoutProperties(_ref, _excluded$u);
11890
11901
  const expandable = isPdf ? false : props.expandable;
11891
11902
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
11892
11903
  loading: loading,
@@ -11946,7 +11957,7 @@ function ImageWidget(_ref) {
11946
11957
  ImageWidget.displayName = 'ImageWidget';
11947
11958
 
11948
11959
  var _templateObject$e;
11949
- const _excluded$s = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
11960
+ const _excluded$t = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
11950
11961
  function FlowWidget(_ref) {
11951
11962
  let {
11952
11963
  title,
@@ -11958,7 +11969,7 @@ function FlowWidget(_ref) {
11958
11969
  className,
11959
11970
  direction = "horizontal"
11960
11971
  } = _ref,
11961
- rest = _objectWithoutProperties(_ref, _excluded$s);
11972
+ rest = _objectWithoutProperties(_ref, _excluded$t);
11962
11973
  const [activeTab, setActiveTab] = React.useState();
11963
11974
  React.useEffect(() => {
11964
11975
  if (defaultActiveTab) {
@@ -15689,7 +15700,7 @@ Map$3.propTypes = {
15689
15700
  link: PropTypes__default["default"].any
15690
15701
  };
15691
15702
 
15692
- const _excluded$r = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
15703
+ const _excluded$s = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
15693
15704
  function InExpandableWidgetMap(_ref) {
15694
15705
  let {
15695
15706
  isExpanded,
@@ -15703,7 +15714,7 @@ function InExpandableWidgetMap(_ref) {
15703
15714
  height,
15704
15715
  widgetConfig
15705
15716
  } = _ref,
15706
- rest = _objectWithoutProperties(_ref, _excluded$r);
15717
+ rest = _objectWithoutProperties(_ref, _excluded$s);
15707
15718
  const [mapKey, setMapKey] = React.useState(0);
15708
15719
  const [isMapReady, setIsMapReady] = React.useState(false);
15709
15720
  React.useEffect(() => {
@@ -17903,14 +17914,14 @@ const MapConfig = ({
17903
17914
  });
17904
17915
  };
17905
17916
 
17906
- const _excluded$q = ["config", "title", "loading"];
17917
+ const _excluded$r = ["config", "title", "loading"];
17907
17918
  const Details = _ref => {
17908
17919
  let {
17909
17920
  config = [],
17910
17921
  title,
17911
17922
  loading = false
17912
17923
  } = _ref,
17913
- rest = _objectWithoutProperties(_ref, _excluded$q);
17924
+ rest = _objectWithoutProperties(_ref, _excluded$r);
17914
17925
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
17915
17926
  className: "with-border-header h-w-btn-header card",
17916
17927
  loading: loading,
@@ -17926,14 +17937,14 @@ const Details = _ref => {
17926
17937
  }));
17927
17938
  };
17928
17939
 
17929
- const _excluded$p = ["config", "title", "loading"];
17940
+ const _excluded$q = ["config", "title", "loading"];
17930
17941
  const KeyIndicatorsDetails = _ref => {
17931
17942
  let {
17932
17943
  config,
17933
17944
  title,
17934
17945
  loading = false
17935
17946
  } = _ref,
17936
- rest = _objectWithoutProperties(_ref, _excluded$p);
17947
+ rest = _objectWithoutProperties(_ref, _excluded$q);
17937
17948
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
17938
17949
  className: "with-border-header h-w-btn-header",
17939
17950
  title: title,
@@ -17963,7 +17974,7 @@ const Style$G = styled__default["default"].div`
17963
17974
  }
17964
17975
  `;
17965
17976
 
17966
- const _excluded$o = ["children", "config", "detailsTitle", "firstColumnWidth"];
17977
+ const _excluded$p = ["children", "config", "detailsTitle", "firstColumnWidth"];
17967
17978
  const DetailsSection = _ref => {
17968
17979
  let {
17969
17980
  children,
@@ -17971,7 +17982,7 @@ const DetailsSection = _ref => {
17971
17982
  detailsTitle,
17972
17983
  firstColumnWidth = "250px"
17973
17984
  } = _ref,
17974
- rest = _objectWithoutProperties(_ref, _excluded$o);
17985
+ rest = _objectWithoutProperties(_ref, _excluded$p);
17975
17986
  return /*#__PURE__*/jsxRuntime.jsx(Style$G, {
17976
17987
  firstColumnWidth: firstColumnWidth,
17977
17988
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
@@ -18147,14 +18158,14 @@ const getGoalConfig = () => {
18147
18158
  };
18148
18159
 
18149
18160
  var _templateObject$c;
18150
- const _excluded$n = ["title", "activeSdgGoals", "t"];
18161
+ const _excluded$o = ["title", "activeSdgGoals", "t"];
18151
18162
  function SDGWidget(_ref) {
18152
18163
  let {
18153
18164
  title = "Sustainable Development Goals",
18154
18165
  activeSdgGoals = [],
18155
18166
  t = key => key
18156
18167
  } = _ref,
18157
- props = _objectWithoutProperties(_ref, _excluded$n);
18168
+ props = _objectWithoutProperties(_ref, _excluded$o);
18158
18169
  const sdgConfig = getGoalConfig();
18159
18170
  return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
18160
18171
  title: title,
@@ -18452,7 +18463,7 @@ function SdgList({
18452
18463
  });
18453
18464
  }
18454
18465
 
18455
- const _excluded$m = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
18466
+ const _excluded$n = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
18456
18467
  const {
18457
18468
  Meta
18458
18469
  } = antd.Card;
@@ -18472,7 +18483,7 @@ function ProjectWidget(_ref) {
18472
18483
  hideSDGList = false,
18473
18484
  t = x => x
18474
18485
  } = _ref,
18475
- props = _objectWithoutProperties(_ref, _excluded$m);
18486
+ props = _objectWithoutProperties(_ref, _excluded$n);
18476
18487
  const [isHovered, setIsHovered] = React__default["default"].useState(false);
18477
18488
  const {
18478
18489
  token
@@ -18744,13 +18755,13 @@ const WidgetCard = _ref => {
18744
18755
  });
18745
18756
  };
18746
18757
 
18747
- const _excluded$l = ["title", "children"];
18758
+ const _excluded$m = ["title", "children"];
18748
18759
  const CarouselWidget = /*#__PURE__*/React.forwardRef((_ref, ref) => {
18749
18760
  let {
18750
18761
  title,
18751
18762
  children
18752
18763
  } = _ref,
18753
- rest = _objectWithoutProperties(_ref, _excluded$l);
18764
+ rest = _objectWithoutProperties(_ref, _excluded$m);
18754
18765
  /**
18755
18766
  * Handles carousel slide change events
18756
18767
  * @param {number} currentSlide - The index of the current slide after change
@@ -18914,7 +18925,7 @@ const EmptyStateContainer = styled__default["default"].div`
18914
18925
  }
18915
18926
  `;
18916
18927
 
18917
- const _excluded$k = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
18928
+ const _excluded$l = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
18918
18929
  function ImageCarousel(_ref) {
18919
18930
  let {
18920
18931
  title,
@@ -18929,7 +18940,7 @@ function ImageCarousel(_ref) {
18929
18940
  emptyLogo = antd.Empty.PRESENTED_IMAGE_SIMPLE,
18930
18941
  emptyText = "No Image"
18931
18942
  } = _ref,
18932
- rest = _objectWithoutProperties(_ref, _excluded$k);
18943
+ rest = _objectWithoutProperties(_ref, _excluded$l);
18933
18944
  const [previewVisible, setPreviewVisible] = React.useState(false);
18934
18945
  const [current, setCurrent] = React.useState(0);
18935
18946
  const carouselRef = React.useRef(null);
@@ -19298,7 +19309,7 @@ const getVegetationConfig = () => {
19298
19309
  };
19299
19310
 
19300
19311
  var _templateObject$a, _templateObject2$3;
19301
- const _excluded$j = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
19312
+ const _excluded$k = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
19302
19313
  function VegetationWidget(_ref) {
19303
19314
  let {
19304
19315
  title = "Vegetation Health",
@@ -19310,7 +19321,7 @@ function VegetationWidget(_ref) {
19310
19321
  growthObservations = [],
19311
19322
  t = key => key
19312
19323
  } = _ref,
19313
- props = _objectWithoutProperties(_ref, _excluded$j);
19324
+ props = _objectWithoutProperties(_ref, _excluded$k);
19314
19325
  let vegetationConfig = getVegetationConfig();
19315
19326
  const allVegetationKeys = vegetationConfig.map(item => item.key);
19316
19327
  if (filterKeys && Array.isArray(filterKeys)) {
@@ -19426,7 +19437,7 @@ const getFaunaConfig = () => {
19426
19437
  };
19427
19438
 
19428
19439
  var _templateObject$9, _templateObject2$2;
19429
- const _excluded$i = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19440
+ const _excluded$j = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19430
19441
  function FaunaWidget(_ref) {
19431
19442
  let {
19432
19443
  title = "Observed Fauna",
@@ -19437,7 +19448,7 @@ function FaunaWidget(_ref) {
19437
19448
  itemHeight = 100,
19438
19449
  t = key => key
19439
19450
  } = _ref,
19440
- props = _objectWithoutProperties(_ref, _excluded$i);
19451
+ props = _objectWithoutProperties(_ref, _excluded$j);
19441
19452
  let faunaConfig = getFaunaConfig();
19442
19453
 
19443
19454
  // Filter to show only specific keys if filterKeys is provided
@@ -19502,7 +19513,7 @@ const getInvasiveSpeciesConfig = () => {
19502
19513
  };
19503
19514
 
19504
19515
  var _templateObject$8, _templateObject2$1;
19505
- const _excluded$h = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19516
+ const _excluded$i = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
19506
19517
  function InvasiveSpeciesWidget(_ref) {
19507
19518
  let {
19508
19519
  title = "Invasive Species",
@@ -19514,7 +19525,7 @@ function InvasiveSpeciesWidget(_ref) {
19514
19525
  itemHeight = 100,
19515
19526
  t = key => key
19516
19527
  } = _ref,
19517
- props = _objectWithoutProperties(_ref, _excluded$h);
19528
+ props = _objectWithoutProperties(_ref, _excluded$i);
19518
19529
  let invasiveSpeciesConfig = getInvasiveSpeciesConfig();
19519
19530
 
19520
19531
  // Filter to show only specific keys if filterKeys is provided
@@ -20697,11 +20708,15 @@ function DataLink$1({
20697
20708
  getToken
20698
20709
  });
20699
20710
  const data = React.useMemo(() => {
20711
+ const filteredPrefilledValues = Object.entries(form?.meta?.prefilledValues || {}).filter(([_, value]) => !(value && typeof value === 'object' && 'combine' in value)).reduce((acc, [key, value]) => ({
20712
+ ...acc,
20713
+ [key]: value
20714
+ }), {});
20700
20715
  const _formData = isSingle ? formData && !Array.isArray(formData) ? [{
20701
- ...form?.meta?.prefilledValues,
20716
+ ...filteredPrefilledValues,
20702
20717
  ...formData
20703
20718
  }] : [] : (Array.isArray(formData) ? formData : []).map(f => ({
20704
- ...form?.meta?.prefilledValues,
20719
+ ...filteredPrefilledValues,
20705
20720
  ...f
20706
20721
  }));
20707
20722
  return (_formData || []).map((f, i) => {
@@ -22440,11 +22455,15 @@ function DataLinkFlat$1({
22440
22455
  }
22441
22456
  }, [entity, values.linking]);
22442
22457
  const dataLinkFormData = React.useMemo(() => {
22458
+ const filteredPrefilledValues = Object.entries(form?.meta?.prefilledValues || {}).filter(([_, value]) => !(value && typeof value === 'object' && 'combine' in value)).reduce((acc, [key, value]) => ({
22459
+ ...acc,
22460
+ [key]: value
22461
+ }), {});
22443
22462
  const _formData = isSingle ? formData && !Array.isArray(formData) ? [{
22444
- ...form?.meta?.prefilledValues,
22463
+ ...filteredPrefilledValues,
22445
22464
  ...formData
22446
22465
  }] : [] : (Array.isArray(formData) ? formData : []).map(f => ({
22447
- ...form?.meta?.prefilledValues,
22466
+ ...filteredPrefilledValues,
22448
22467
  ...f
22449
22468
  }));
22450
22469
  return (_formData || []).map((f, i) => {
@@ -23449,10 +23468,10 @@ const BasicInput = _ref => {
23449
23468
  case 'text':
23450
23469
  case 'phoneNumber':
23451
23470
  case 'textarea':
23452
- return item ? propHasValue$1(item[inputName]) ? item[inputName] : placeholder(item, inputName, withPlaceholder) : propHasValue$1(data[inputName]) ? data[inputName] : placeholder(data, inputName, withPlaceholder);
23471
+ return item ? propHasValue$1(item[inputName]) && item[inputName] !== '' ? item[inputName] : placeholder(item, inputName, withPlaceholder) : propHasValue$1(data[inputName]) && data[inputName] !== '' ? data[inputName] : placeholder(data, inputName, withPlaceholder);
23453
23472
  case 'website':
23454
23473
  case 'link':
23455
- const v = item ? propHasValue$1(item[inputName]) ? item[inputName] : placeholder(item, inputName, withPlaceholder) : propHasValue$1(data[inputName]) ? data[inputName] : placeholder(data, inputName, withPlaceholder);
23474
+ const v = item ? propHasValue$1(item[inputName]) && item[inputName] !== '' ? item[inputName] : placeholder(item, inputName, withPlaceholder) : propHasValue$1(data[inputName]) && data[inputName] !== '' ? data[inputName] : placeholder(data, inputName, withPlaceholder);
23456
23475
  if (isModal) {
23457
23476
  return /*#__PURE__*/jsxRuntime.jsx("div", {
23458
23477
  className: "flex flex-column ant-upload-list",
@@ -24081,7 +24100,7 @@ const Input = _ref2 => {
24081
24100
  ajaxOptions: ajaxOptions,
24082
24101
  evaluationConfig: evaluationConfig
24083
24102
  }, key);
24084
- }), isRepeatable && Array.isArray(modalData) && !modalData.length ? /*#__PURE__*/jsxRuntime.jsx("span", {
24103
+ }), isRepeatable && Array.isArray(modalData) && !modalData.length || modalData === "" ? /*#__PURE__*/jsxRuntime.jsx("span", {
24085
24104
  className: "text-muted",
24086
24105
  children: t('Not answered')
24087
24106
  }) : null]
@@ -24116,7 +24135,7 @@ const Input = _ref2 => {
24116
24135
  linkingData: linkingData,
24117
24136
  evaluationConfig: evaluationConfig
24118
24137
  }, key);
24119
- }), !modalData || Array.isArray(modalData) && !modalData.length ? /*#__PURE__*/jsxRuntime.jsx("span", {
24138
+ }), !modalData || Array.isArray(modalData) && !modalData.length || modalData === "" ? /*#__PURE__*/jsxRuntime.jsx("span", {
24120
24139
  className: "text-muted",
24121
24140
  children: t('Not answered')
24122
24141
  }) : (Array.isArray(modalData) ? modalData : [modalData]).map((item, itemId) => /*#__PURE__*/jsxRuntime.jsx("div", {
@@ -24203,7 +24222,7 @@ const Input = _ref2 => {
24203
24222
  linkingData: linkingData,
24204
24223
  evaluationConfig: evaluationConfig
24205
24224
  }, key);
24206
- }), !formData || Array.isArray(formData) && !formData.length ? /*#__PURE__*/jsxRuntime.jsx("span", {
24225
+ }), !formData || Array.isArray(formData) && !formData.length || formData === "" ? /*#__PURE__*/jsxRuntime.jsx("span", {
24207
24226
  className: "text-muted",
24208
24227
  children: t('Not answered')
24209
24228
  }) : (_ref3 = Array.isArray(formData) ? formData : [formData]) === null || _ref3 === void 0 ? void 0 : _ref3.map((item, itemId) => /*#__PURE__*/jsxRuntime.jsxs(React__default["default"].Fragment, {
@@ -24937,7 +24956,7 @@ const RepeatableModals = ({
24937
24956
  }) : null;
24938
24957
  };
24939
24958
 
24940
- const _excluded$g = ["viewGroup"],
24959
+ const _excluded$h = ["viewGroup"],
24941
24960
  _excluded2$1 = ["label", "icon", "position"];
24942
24961
  const Content$1 = _ref => {
24943
24962
  let {
@@ -25009,7 +25028,7 @@ const Content$1 = _ref => {
25009
25028
  if (groups[gKey].viewGroup === key) {
25010
25029
  // eslint-disable-next-line no-unused-vars
25011
25030
  const _groups$gKey = groups[gKey],
25012
- gCfg = _objectWithoutProperties(_groups$gKey, _excluded$g);
25031
+ gCfg = _objectWithoutProperties(_groups$gKey, _excluded$h);
25013
25032
  items[gKey] = gCfg;
25014
25033
  }
25015
25034
  return items;
@@ -25289,7 +25308,7 @@ const Content$1 = _ref => {
25289
25308
  });
25290
25309
  };
25291
25310
 
25292
- const _excluded$f = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
25311
+ const _excluded$g = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
25293
25312
  function Modal(_ref) {
25294
25313
  let {
25295
25314
  t = text => text,
@@ -25305,7 +25324,7 @@ function Modal(_ref) {
25305
25324
  disabled = false,
25306
25325
  withModalFormWrapper = true
25307
25326
  } = _ref,
25308
- props = _objectWithoutProperties(_ref, _excluded$f);
25327
+ props = _objectWithoutProperties(_ref, _excluded$g);
25309
25328
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Modal, _objectSpread2(_objectSpread2({
25310
25329
  width: 650,
25311
25330
  footer: null,
@@ -39723,7 +39742,7 @@ function AjaxSelect(props) {
39723
39742
  }, props));
39724
39743
  }
39725
39744
 
39726
- /* eslint-disable no-case-declarations */
39745
+ const _excluded$f = ["placeholder"];
39727
39746
  const propHasValue = val => {
39728
39747
  if (Array.isArray(val)) {
39729
39748
  return val.length > 0 ? true : false;
@@ -39741,14 +39760,14 @@ const checkCondition = (condition, repeatValues, formsValue) => {
39741
39760
  return isShown;
39742
39761
  };
39743
39762
  function showHideInput(input, formsValue, repeatIndex, repeatValues, setValues, ref) {
39744
- if (input?.meta?.hidden === true) {
39763
+ var _input$meta;
39764
+ if ((input === null || input === void 0 || (_input$meta = input.meta) === null || _input$meta === void 0 ? void 0 : _input$meta.hidden) === true) {
39765
+ var _input$meta2;
39745
39766
  // Set default value for hidden fields
39746
- if (input?.meta?.defaultValue !== undefined && !propHasValue(formsValue[ref])) {
39767
+ if ((input === null || input === void 0 || (_input$meta2 = input.meta) === null || _input$meta2 === void 0 ? void 0 : _input$meta2.defaultValue) !== undefined && !propHasValue(formsValue[ref])) {
39747
39768
  formsValue[ref] = input.meta.defaultValue;
39748
39769
  if (setValues && typeof setValues === 'function') {
39749
- setValues({
39750
- ...formsValue
39751
- });
39770
+ setValues(_objectSpread2({}, formsValue));
39752
39771
  }
39753
39772
  }
39754
39773
  return false;
@@ -39807,35 +39826,35 @@ function getInputHeadLines(type, i, input, values) {
39807
39826
  switch (type) {
39808
39827
  case "h2":
39809
39828
  return /*#__PURE__*/jsxRuntime.jsx("h2", {
39810
- className: `title-semibold-2 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
39829
+ className: "title-semibold-2 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
39811
39830
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
39812
39831
  children: getInputLabel(input, values)
39813
39832
  })
39814
39833
  });
39815
39834
  case "h3":
39816
39835
  return /*#__PURE__*/jsxRuntime.jsx("h3", {
39817
- className: `title-semibold-3 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
39836
+ className: "title-semibold-3 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
39818
39837
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
39819
39838
  children: getInputLabel(input, values)
39820
39839
  })
39821
39840
  });
39822
39841
  case "h4":
39823
39842
  return /*#__PURE__*/jsxRuntime.jsx("h4", {
39824
- className: `title-semibold-4 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
39843
+ className: "title-semibold-4 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
39825
39844
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
39826
39845
  children: getInputLabel(input, values)
39827
39846
  })
39828
39847
  });
39829
39848
  case "h5":
39830
39849
  return /*#__PURE__*/jsxRuntime.jsx("h5", {
39831
- className: `title-semibold-5 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
39850
+ className: "title-semibold-5 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
39832
39851
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
39833
39852
  children: getInputLabel(input, values)
39834
39853
  })
39835
39854
  });
39836
39855
  case "h6":
39837
39856
  return /*#__PURE__*/jsxRuntime.jsx("h6", {
39838
- className: `title-semibold-6 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
39857
+ className: "title-semibold-6 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
39839
39858
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
39840
39859
  children: getInputLabel(input, values)
39841
39860
  })
@@ -39844,7 +39863,9 @@ function getInputHeadLines(type, i, input, values) {
39844
39863
  return null;
39845
39864
  }
39846
39865
  }
39847
- function getInputLabel(input, formsValue = {}, asText = false) {
39866
+ function getInputLabel(input) {
39867
+ let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
39868
+ let asText = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
39848
39869
  if (typeof input.label === "object") {
39849
39870
  const validations = Object.keys(input.label);
39850
39871
  const key = validations.find(v => {
@@ -39902,7 +39923,8 @@ function getInputLabel(input, formsValue = {}, asText = false) {
39902
39923
  }) : ReactHtmlParser__default["default"](input.label);
39903
39924
  }
39904
39925
  }
39905
- function getSelectOptions$1(option, formsValue = {}) {
39926
+ function getSelectOptions$1(option) {
39927
+ let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
39906
39928
  if (typeof option.label === "object") {
39907
39929
  const validations = Object.keys(option.label);
39908
39930
  const key = validations.find(v => {
@@ -39926,7 +39948,9 @@ function getSectionLabel(labels, values) {
39926
39948
  }
39927
39949
  return labels;
39928
39950
  }
39929
- function getSubtitles(subtitles, position, formsValue = {}, repeatIndex, repeatValues) {
39951
+ function getSubtitles(subtitles, position) {
39952
+ let formsValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
39953
+ let repeatValues = arguments.length > 4 ? arguments[4] : undefined;
39930
39954
  let subtitle = subtitles && subtitles[position];
39931
39955
  if (subtitle && typeof subtitle === "object") {
39932
39956
  let newSubtitle = subtitle.default || "";
@@ -39970,14 +39994,12 @@ function getSubtitles(subtitles, position, formsValue = {}, repeatIndex, repeatV
39970
39994
  function getFormTitles(titles, key, position) {
39971
39995
  let tilte = titles && titles[key];
39972
39996
  return tilte ? /*#__PURE__*/jsxRuntime.jsx("h3", {
39973
- className: `title-semibold-3 mb0 ${position ? "mt-3" : ""}`,
39997
+ className: "title-semibold-3 mb0 ".concat(position ? "mt-3" : ""),
39974
39998
  children: tilte
39975
39999
  }) : null;
39976
40000
  }
39977
40001
  const updateFormValues = (repeatIndex, repeatValues, inputName, value, formsValue, name, mainForm) => {
39978
- formsValue = Object.assign(formsValue, {
39979
- ...mainForm.getFieldsValue(true)
39980
- });
40002
+ formsValue = Object.assign(formsValue, _objectSpread2({}, mainForm.getFieldsValue(true)));
39981
40003
  if (typeof repeatIndex === "number" && repeatValues) {
39982
40004
  if (!repeatValues[inputName] || !___default["default"].isEqual(repeatValues[inputName], value)) {
39983
40005
  repeatValues[inputName] = value;
@@ -40011,48 +40033,52 @@ const updateFormValues = (repeatIndex, repeatValues, inputName, value, formsValu
40011
40033
  }
40012
40034
  };
40013
40035
  const inputTypeComponent = {
40014
- text: ({
40015
- props,
40016
- rules
40017
- }, {
40018
- inputMeta = {},
40019
- t
40020
- }) => {
40036
+ text: (_ref, _ref2) => {
40037
+ let {
40038
+ props,
40039
+ rules
40040
+ } = _ref;
40041
+ let {
40042
+ inputMeta = {},
40043
+ t
40044
+ } = _ref2;
40021
40045
  const maxRule = rules.find(r => r.max);
40022
40046
  const maxProps = {};
40023
40047
  if (maxRule) {
40024
40048
  maxProps.maxLength = maxRule.max;
40025
40049
  }
40026
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
40027
- size: "medium",
40028
- ...maxProps,
40050
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
40051
+ size: "medium"
40052
+ }, maxProps), {}, {
40029
40053
  allowClear: true,
40030
40054
  autoComplete: "new-password",
40031
- type: "text",
40032
- ...props,
40055
+ type: "text"
40056
+ }, props), {}, {
40033
40057
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
40034
40058
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
40035
- });
40059
+ }));
40036
40060
  },
40037
- drawTerritory: ({
40038
- formsValue,
40039
- name,
40040
- addressData,
40041
- onValuesChange
40042
- }, {
40043
- setFormValues,
40044
- form
40045
- }) => {
40061
+ drawTerritory: (_ref3, _ref4) => {
40062
+ let {
40063
+ formsValue,
40064
+ name,
40065
+ addressData,
40066
+ onValuesChange
40067
+ } = _ref3;
40068
+ let {
40069
+ setFormValues,
40070
+ form
40071
+ } = _ref4;
40046
40072
  let search = formsValue.country;
40047
40073
  if (addressData && addressData.address && Object.keys(addressData.address).length > 0) {
40048
40074
  if (addressData.address.country) {
40049
40075
  search = addressData.address.country;
40050
40076
  }
40051
40077
  if (addressData.address.level1) {
40052
- search = `${addressData.address.level1}, ${addressData.address.country}`;
40078
+ search = "".concat(addressData.address.level1, ", ").concat(addressData.address.country);
40053
40079
  }
40054
40080
  if (addressData.address.level2) {
40055
- search = `${addressData.address.level2}, ${addressData.address.level1}, ${addressData.address.country}`;
40081
+ search = "".concat(addressData.address.level2, ", ").concat(addressData.address.level1, ", ").concat(addressData.address.country);
40056
40082
  }
40057
40083
  } else {
40058
40084
  const country = countriesList.countries[formsValue.country] || {};
@@ -40060,10 +40086,10 @@ const inputTypeComponent = {
40060
40086
  search = country.name;
40061
40087
  }
40062
40088
  if (formsValue.administrativeLevel1Name) {
40063
- search = `${search} ${formsValue.administrativeLevel1Name}`;
40089
+ search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
40064
40090
  }
40065
40091
  if (formsValue.administrativeLevel2Name) {
40066
- search = `${search} ${formsValue.administrativeLevel2Name}`;
40092
+ search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
40067
40093
  }
40068
40094
  }
40069
40095
  console.log("search", {
@@ -40083,10 +40109,9 @@ const inputTypeComponent = {
40083
40109
  const allFormValues = form && typeof form.getFieldsValue === 'function' ? form.getFieldsValue(true) : formsValue;
40084
40110
 
40085
40111
  // Create the updated values
40086
- const updatedValues = {
40087
- ...allFormValues,
40112
+ const updatedValues = _objectSpread2(_objectSpread2({}, allFormValues), {}, {
40088
40113
  [name]: val
40089
- };
40114
+ });
40090
40115
 
40091
40116
  // Call onValuesChange with the change and all values
40092
40117
  if (typeof onValuesChange === 'function') {
@@ -40101,39 +40126,44 @@ const inputTypeComponent = {
40101
40126
  searchValue: search
40102
40127
  });
40103
40128
  },
40104
- link: ({
40105
- props,
40106
- rules
40107
- }, {
40108
- inputMeta = {},
40109
- t
40110
- }) => {
40129
+ link: (_ref5, _ref6) => {
40130
+ let {
40131
+ props,
40132
+ rules
40133
+ } = _ref5;
40134
+ let {
40135
+ inputMeta = {},
40136
+ t
40137
+ } = _ref6;
40111
40138
  const maxRule = rules.find(r => r.max);
40112
40139
  const maxProps = {};
40113
40140
  if (maxRule) {
40114
40141
  maxProps.maxLength = maxRule.max;
40115
40142
  }
40116
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
40117
- size: "medium",
40118
- ...maxProps,
40143
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
40144
+ size: "medium"
40145
+ }, maxProps), {}, {
40119
40146
  allowClear: true,
40120
40147
  autoComplete: "new-password",
40121
- type: "text",
40122
- ...props,
40148
+ type: "text"
40149
+ }, props), {}, {
40123
40150
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
40124
40151
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
40125
- });
40152
+ }));
40126
40153
  },
40127
- number: ({
40128
- props,
40129
- rules,
40130
- input
40131
- }, {
40132
- inputMeta = {},
40133
- t
40134
- }) => {
40154
+ number: (_ref7, _ref8) => {
40155
+ var _input$meta3;
40156
+ let {
40157
+ props,
40158
+ rules,
40159
+ input
40160
+ } = _ref7;
40161
+ let {
40162
+ inputMeta = {},
40163
+ t
40164
+ } = _ref8;
40135
40165
  const maxRule = rules.find(r => r.max);
40136
- const integerRule = !input?.meta?.isDecimal;
40166
+ const integerRule = !(input !== null && input !== void 0 && (_input$meta3 = input.meta) !== null && _input$meta3 !== void 0 && _input$meta3.isDecimal);
40137
40167
  const parser = value => {
40138
40168
  if (!value) {
40139
40169
  return "";
@@ -40144,50 +40174,53 @@ const inputTypeComponent = {
40144
40174
  return value.replace(/\$\s?|(,*)/g, "");
40145
40175
  };
40146
40176
  if (maxRule) {
40147
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
40177
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
40148
40178
  allowClear: true,
40149
- autoComplete: "new-password",
40150
- ...props,
40179
+ autoComplete: "new-password"
40180
+ }, props), {}, {
40151
40181
  type: "number",
40152
40182
  min: 0,
40153
40183
  max: maxRule.max,
40154
40184
  parser: parser
40155
- });
40185
+ }));
40156
40186
  }
40157
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
40187
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
40158
40188
  allowClear: true,
40159
- autoComplete: "new-password",
40160
- ...props,
40189
+ autoComplete: "new-password"
40190
+ }, props), {}, {
40161
40191
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
40162
40192
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
40163
40193
  min: 0,
40164
40194
  formatter: value => numberWithCommas$1(value),
40165
40195
  parser: parser
40166
- });
40196
+ }));
40167
40197
  },
40168
- select: ({
40169
- value,
40170
- options,
40171
- optionGroup,
40172
- props,
40173
- formsValue,
40174
- optionsFilter,
40175
- filterCond,
40176
- repeatValues,
40177
- repeatIndex,
40178
- name,
40179
- inputName,
40180
- address,
40181
- addressData,
40182
- input
40183
- }, {
40184
- forms,
40185
- form,
40186
- setAddress,
40187
- inputMeta = {},
40188
- t,
40189
- changeInputMeta
40190
- }) => {
40198
+ select: (_ref9, _ref10) => {
40199
+ var _input$meta4;
40200
+ let {
40201
+ value,
40202
+ options,
40203
+ optionGroup,
40204
+ props,
40205
+ formsValue,
40206
+ optionsFilter,
40207
+ filterCond,
40208
+ repeatValues,
40209
+ repeatIndex,
40210
+ name,
40211
+ inputName,
40212
+ address,
40213
+ addressData,
40214
+ input
40215
+ } = _ref9;
40216
+ let {
40217
+ forms,
40218
+ form,
40219
+ setAddress,
40220
+ inputMeta = {},
40221
+ t,
40222
+ changeInputMeta
40223
+ } = _ref10;
40191
40224
  let opts;
40192
40225
  if (typeof options === "string") {
40193
40226
  const [formName, key] = options.split(".");
@@ -40243,18 +40276,19 @@ const inputTypeComponent = {
40243
40276
  }
40244
40277
  opts = groupOptions;
40245
40278
  }
40246
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
40279
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
40247
40280
  autoComplete: "new-password",
40248
40281
  allowClear: true,
40249
40282
  showSearch: true,
40250
- defaultValue: input?.meta?.defaultValue,
40283
+ defaultValue: input === null || input === void 0 || (_input$meta4 = input.meta) === null || _input$meta4 === void 0 ? void 0 : _input$meta4.defaultValue,
40251
40284
  filterOption: filterSelectOptions,
40252
- optionFilterProp: "children",
40253
- ...props,
40285
+ optionFilterProp: "children"
40286
+ }, props), {}, {
40254
40287
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
40255
40288
  placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp$1(props.placeholder, formsValue) || t("Select one option"),
40256
40289
  onChange: (val, selectedValue) => {
40257
- if (typeof input?.meta?.onChange === "string") {
40290
+ var _input$meta5;
40291
+ if (typeof (input === null || input === void 0 || (_input$meta5 = input.meta) === null || _input$meta5 === void 0 ? void 0 : _input$meta5.onChange) === "string") {
40258
40292
  const [value, otherKey, otherVal] = input.meta.onChange.split(".");
40259
40293
  if (val === value) {
40260
40294
  changeInputMeta({
@@ -40268,9 +40302,7 @@ const inputTypeComponent = {
40268
40302
  }
40269
40303
  if (address && selectedValue) {
40270
40304
  dot__default["default"].str(address, selectedValue.children, addressData);
40271
- setAddress({
40272
- ...addressData
40273
- });
40305
+ setAddress(_objectSpread2({}, addressData));
40274
40306
  }
40275
40307
  if (props.onChange) {
40276
40308
  props.onChange(val);
@@ -40282,33 +40314,35 @@ const inputTypeComponent = {
40282
40314
  value: og.value,
40283
40315
  disabled: og.disabled,
40284
40316
  children: og.label
40285
- }, `${i}${j}`))
40317
+ }, "".concat(i).concat(j)))
40286
40318
  }, i) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
40287
40319
  value: option.value,
40288
40320
  disabled: option.disabled,
40289
40321
  children: option.label
40290
40322
  }, i))
40291
- });
40323
+ }));
40292
40324
  },
40293
- multiselect: ({
40294
- value,
40295
- options,
40296
- optionGroup,
40297
- optionsFilter,
40298
- filterCond,
40299
- props,
40300
- formsValue,
40301
- repeatValues,
40302
- repeatIndex,
40303
- inputName,
40304
- name,
40305
- tags
40306
- }, {
40307
- forms,
40308
- form,
40309
- inputMeta = {},
40310
- t
40311
- }) => {
40325
+ multiselect: (_ref11, _ref12) => {
40326
+ let {
40327
+ value,
40328
+ options,
40329
+ optionGroup,
40330
+ optionsFilter,
40331
+ filterCond,
40332
+ props,
40333
+ formsValue,
40334
+ repeatValues,
40335
+ repeatIndex,
40336
+ inputName,
40337
+ name,
40338
+ tags
40339
+ } = _ref11;
40340
+ let {
40341
+ forms,
40342
+ form,
40343
+ inputMeta = {},
40344
+ t
40345
+ } = _ref12;
40312
40346
  let opts;
40313
40347
  if (typeof options === "string") {
40314
40348
  const [formName, key] = options.split(".");
@@ -40365,16 +40399,16 @@ const inputTypeComponent = {
40365
40399
  }
40366
40400
  opts = groupOptions;
40367
40401
  }
40368
- return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
40402
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2(_objectSpread2({
40369
40403
  allowClear: true,
40370
40404
  autoComplete: "new-password",
40371
40405
  mode: tags ? "tags" : "multiple",
40372
- optionFilterProp: "children",
40373
- ...(tags ? {
40374
- tokenSeparators: [",", "\n", "\t"]
40375
- } : {}),
40376
- filterOption: filterSelectOptions,
40377
- ...props,
40406
+ optionFilterProp: "children"
40407
+ }, tags ? {
40408
+ tokenSeparators: [",", "\n", "\t"]
40409
+ } : {}), {}, {
40410
+ filterOption: filterSelectOptions
40411
+ }, props), {}, {
40378
40412
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
40379
40413
  placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp$1(props.placeholder, formsValue) || t("Select all relevant options"),
40380
40414
  children: (opts || []).map((option, i) => option.items ? /*#__PURE__*/jsxRuntime.jsx(antd.Select.OptGroup, {
@@ -40383,42 +40417,42 @@ const inputTypeComponent = {
40383
40417
  value: og.value,
40384
40418
  disabled: og.disabled,
40385
40419
  children: og.label
40386
- }, `${i}${j}`))
40420
+ }, "".concat(i).concat(j)))
40387
40421
  }, i) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
40388
40422
  value: option.value,
40389
40423
  disabled: option.disabled,
40390
40424
  children: option.label
40391
40425
  }, i))
40392
- });
40426
+ }));
40393
40427
  },
40394
- date: ({
40395
- props,
40396
- rules,
40397
- repeatValues,
40398
- formsValue,
40399
- name
40400
- }, {
40401
- inputMeta,
40402
- t,
40403
- groupFormId,
40404
- form,
40405
- setFormValues
40406
- }) => {
40428
+ date: (_ref13, _ref14) => {
40429
+ let {
40430
+ props,
40431
+ rules,
40432
+ repeatValues,
40433
+ formsValue,
40434
+ name
40435
+ } = _ref13;
40436
+ let {
40437
+ inputMeta,
40438
+ t,
40439
+ groupFormId,
40440
+ form,
40441
+ setFormValues
40442
+ } = _ref14;
40407
40443
  const lng = localStorage.getItem("datastakeLng") || "en";
40408
40444
  const maxRule = rules.find(r => r.max);
40409
40445
  const handleDateChange = date => {
40410
40446
  if (date) {
40411
40447
  const localDate = dayjs__default["default"].utc(date);
40412
40448
  if (groupFormId) {
40413
- const _new = {
40414
- ...(formsValue[groupFormId] || {}),
40449
+ const _new = _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
40415
40450
  [name]: localDate
40416
- };
40451
+ });
40417
40452
  form.setFieldValue(groupFormId, _new);
40418
- setFormValues({
40419
- ...formsValue,
40453
+ setFormValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
40420
40454
  [groupFormId]: _new
40421
- });
40455
+ }));
40422
40456
  } else {
40423
40457
  form.setFieldValue(name, localDate);
40424
40458
  }
@@ -40430,10 +40464,10 @@ const inputTypeComponent = {
40430
40464
  checkForMax = checkCondition(maxRule.condition, repeatValues, formsValue);
40431
40465
  }
40432
40466
  if (checkForMax) {
40433
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
40467
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
40434
40468
  allowClear: true,
40435
- autoComplete: "new-password",
40436
- ...props,
40469
+ autoComplete: "new-password"
40470
+ }, props), {}, {
40437
40471
  onChange: handleDateChange,
40438
40472
  format: DATE_FORMATS,
40439
40473
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
@@ -40442,31 +40476,33 @@ const inputTypeComponent = {
40442
40476
  disabledDate: current => {
40443
40477
  return current && current >= dayjs__default["default"]().endOf("day");
40444
40478
  }
40445
- });
40479
+ }));
40446
40480
  }
40447
40481
  }
40448
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
40482
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
40449
40483
  allowClear: true,
40450
- autoComplete: "new-password",
40451
- ...props,
40484
+ autoComplete: "new-password"
40485
+ }, props), {}, {
40452
40486
  onChange: handleDateChange,
40453
40487
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Select date"),
40454
40488
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
40455
40489
  format: DATE_FORMATS,
40456
40490
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"]
40457
- });
40491
+ }));
40458
40492
  },
40459
- comment: ({
40460
- props: {
40461
- placeholder,
40462
- ...props
40463
- },
40464
- commentHint
40465
- }, {
40466
- onChange,
40467
- value
40468
- }) => {
40469
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
40493
+ comment: (_ref15, _ref16) => {
40494
+ let {
40495
+ props: {
40496
+ placeholder
40497
+ },
40498
+ commentHint
40499
+ } = _ref15,
40500
+ props = _objectWithoutProperties(_ref15.props, _excluded$f);
40501
+ let {
40502
+ onChange,
40503
+ value
40504
+ } = _ref16;
40505
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
40470
40506
  allowClear: true,
40471
40507
  value: value,
40472
40508
  onChange: e => onChange(e.target.value),
@@ -40476,56 +40512,60 @@ const inputTypeComponent = {
40476
40512
  autoSize: {
40477
40513
  minRows: 5,
40478
40514
  maxRows: 5
40479
- },
40480
- ...props,
40515
+ }
40516
+ }, props), {}, {
40481
40517
  disabled: false
40482
- });
40518
+ }));
40483
40519
  },
40484
- textarea: ({
40485
- props,
40486
- rules
40487
- }, {
40488
- inputMeta,
40489
- t
40490
- }) => {
40520
+ textarea: (_ref17, _ref18) => {
40521
+ let {
40522
+ props,
40523
+ rules
40524
+ } = _ref17;
40525
+ let {
40526
+ inputMeta,
40527
+ t
40528
+ } = _ref18;
40491
40529
  const maxRule = rules.find(r => r.max);
40492
40530
  let maxLength = MAX_TEXT_AREA_LENGTH;
40493
40531
  if (maxRule) {
40494
40532
  maxLength = maxRule.max;
40495
40533
  }
40496
- return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
40534
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
40497
40535
  allowClear: true,
40498
40536
  autoComplete: "new-password",
40499
40537
  maxLength: maxLength,
40500
40538
  autoSize: {
40501
40539
  minRows: 5,
40502
40540
  maxRows: 5
40503
- },
40504
- ...props,
40541
+ }
40542
+ }, props), {}, {
40505
40543
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
40506
40544
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
40507
- });
40545
+ }));
40508
40546
  },
40509
- phoneNumber: ({
40510
- name,
40511
- inputName,
40512
- props,
40513
- value,
40514
- repeatIndex,
40515
- repeatValues,
40516
- formsValue
40517
- }, {
40518
- setFormValues,
40519
- t
40520
- }) => {
40521
- return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, {
40547
+ phoneNumber: (_ref19, _ref20) => {
40548
+ let {
40549
+ name,
40550
+ inputName,
40551
+ props,
40552
+ value,
40553
+ repeatIndex,
40554
+ repeatValues,
40555
+ formsValue
40556
+ } = _ref19;
40557
+ let {
40558
+ setFormValues,
40559
+ t
40560
+ } = _ref20;
40561
+ return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, _objectSpread2(_objectSpread2({
40522
40562
  t: t,
40523
40563
  doChangeErrors: false,
40524
40564
  allowClear: true,
40525
- country: formsValue?.country,
40565
+ country: formsValue === null || formsValue === void 0 ? void 0 : formsValue.country,
40526
40566
  formsValue: formsValue,
40527
- initialValue: value,
40528
- ...props,
40567
+ initialValue: value
40568
+ }, props), {}, {
40529
40569
  onChange: val => {
40530
40570
  if (repeatValues) {
40531
40571
  const inputValues = Array.isArray(formsValue[name]) ? formsValue[name] || [] : [];
@@ -40541,24 +40581,25 @@ const inputTypeComponent = {
40541
40581
  setFormValues(formsValue);
40542
40582
  }
40543
40583
  }
40544
- });
40584
+ }));
40545
40585
  },
40546
- switch: ({
40547
- props,
40548
- value,
40549
- restricted,
40550
- autocomplete,
40551
- formsValue,
40552
- repeatIndex,
40553
- name,
40554
- inputName,
40555
- replace
40556
- }, {
40557
- form,
40558
- setFormValues
40559
- }) => {
40560
- return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, {
40561
- ...props,
40586
+ switch: (_ref21, _ref22) => {
40587
+ let {
40588
+ props,
40589
+ value,
40590
+ restricted,
40591
+ autocomplete,
40592
+ formsValue,
40593
+ repeatIndex,
40594
+ name,
40595
+ inputName,
40596
+ replace
40597
+ } = _ref21;
40598
+ let {
40599
+ form,
40600
+ setFormValues
40601
+ } = _ref22;
40602
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, _objectSpread2(_objectSpread2({}, props), {}, {
40562
40603
  defaultChecked: value || false,
40563
40604
  checked: value || false,
40564
40605
  onChange: isChecked => {
@@ -40600,14 +40641,15 @@ const inputTypeComponent = {
40600
40641
  setFormValues(formsValue);
40601
40642
  }
40602
40643
  }
40603
- });
40644
+ }));
40604
40645
  },
40605
- total100: ({
40606
- props,
40607
- name,
40608
- options,
40609
- value
40610
- }) => {
40646
+ total100: _ref23 => {
40647
+ let {
40648
+ props,
40649
+ name,
40650
+ options,
40651
+ value
40652
+ } = _ref23;
40611
40653
  value = value ? Array.isArray(value) ? value : [value] : [];
40612
40654
  function totalValue() {
40613
40655
  let total = 0;
@@ -40631,10 +40673,11 @@ const inputTypeComponent = {
40631
40673
  className: "total100",
40632
40674
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
40633
40675
  name: name,
40634
- children: (fields, {
40635
- add,
40636
- remove
40637
- }) => {
40676
+ children: (fields, _ref24) => {
40677
+ let {
40678
+ add,
40679
+ remove
40680
+ } = _ref24;
40638
40681
  if (fields.length === 0) {
40639
40682
  const formData = value || [];
40640
40683
  if (formData.length) {
@@ -40653,26 +40696,26 @@ const inputTypeComponent = {
40653
40696
  const v = value[field.name];
40654
40697
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Space, {
40655
40698
  className: "total",
40656
- children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
40657
- noStyle: true,
40658
- ...field,
40699
+ children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
40700
+ noStyle: true
40701
+ }, field), {}, {
40659
40702
  name: [field.name, "type"],
40660
40703
  fieldKey: [field.fieldKey, "type"],
40661
40704
  initialValue: v.type,
40662
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
40705
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
40663
40706
  allowClear: true,
40664
40707
  showSearch: true,
40665
40708
  filterOption: filterSelectOptions,
40666
- optionFilterProp: "children",
40667
- ...props,
40709
+ optionFilterProp: "children"
40710
+ }, props), {}, {
40668
40711
  children: options.map((option, i) => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
40669
40712
  value: option.value,
40670
40713
  children: option.label
40671
40714
  }, i))
40672
- })
40673
- }), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
40674
- noStyle: true,
40675
- ...field,
40715
+ }))
40716
+ })), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
40717
+ noStyle: true
40718
+ }, field), {}, {
40676
40719
  name: [field.name, "value"],
40677
40720
  fieldKey: [field.fieldKey, "value"],
40678
40721
  initialValue: v.value,
@@ -40680,14 +40723,14 @@ const inputTypeComponent = {
40680
40723
  allowClear: true,
40681
40724
  name: "value",
40682
40725
  formatter: value => {
40683
- return value ? `${value}%` : "";
40726
+ return value ? "".concat(value, "%") : "";
40684
40727
  },
40685
40728
  disabled: !v.type,
40686
40729
  placeholder: props.valueplaceholder ? props.valueplaceholder : "Value",
40687
40730
  min: 1,
40688
40731
  max: 100 - siblingTotal(v.type)
40689
40732
  })
40690
- }), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
40733
+ })), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
40691
40734
  disabled: !v.value || !v.type || totalValue() >= 100,
40692
40735
  type: "primary",
40693
40736
  icon: /*#__PURE__*/jsxRuntime.jsx(Icons.PlusOutlined, {}),
@@ -40719,18 +40762,21 @@ const inputTypeComponent = {
40719
40762
  }) : null]
40720
40763
  });
40721
40764
  },
40722
- percentage: ({
40723
- name,
40724
- inputName,
40725
- totalMax,
40726
- repeatIndex,
40727
- props,
40728
- formsValue,
40729
- input
40730
- }, {
40731
- inputMeta,
40732
- t
40733
- }) => {
40765
+ percentage: (_ref25, _ref26) => {
40766
+ var _input$meta6;
40767
+ let {
40768
+ name,
40769
+ inputName,
40770
+ totalMax,
40771
+ repeatIndex,
40772
+ props,
40773
+ formsValue,
40774
+ input
40775
+ } = _ref25;
40776
+ let {
40777
+ inputMeta,
40778
+ t
40779
+ } = _ref26;
40734
40780
  const isRepeatable = Array.isArray(formsValue[name]);
40735
40781
  let totalSiblings = 0;
40736
40782
  if (isRepeatable && totalMax) {
@@ -40738,15 +40784,15 @@ const inputTypeComponent = {
40738
40784
  totl = totl + (grp[inputName] || 0);
40739
40785
  return totl;
40740
40786
  }, 0);
40741
- } else if (Array.isArray(input?.meta?.siblings)) {
40787
+ } else if (Array.isArray(input === null || input === void 0 || (_input$meta6 = input.meta) === null || _input$meta6 === void 0 ? void 0 : _input$meta6.siblings)) {
40742
40788
  totalSiblings = input.meta.siblings.reduce((totl, key) => {
40743
40789
  totl = totl + (formsValue[key] || 0);
40744
40790
  return totl;
40745
40791
  }, 0);
40746
40792
  }
40747
- return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
40748
- allowClear: true,
40749
- ...props,
40793
+ return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
40794
+ allowClear: true
40795
+ }, props), {}, {
40750
40796
  style: {
40751
40797
  width: "100%"
40752
40798
  },
@@ -40755,33 +40801,36 @@ const inputTypeComponent = {
40755
40801
  min: 0,
40756
40802
  max: 100 - totalSiblings,
40757
40803
  formatter: value => {
40758
- return value ? `${value}` : "";
40804
+ return value ? "".concat(value) : "";
40759
40805
  },
40760
40806
  parser: value => value.replace("%", ""),
40761
40807
  addonAfter: "%"
40762
- });
40808
+ }));
40763
40809
  },
40764
- year: ({
40765
- props
40766
- }) => {
40810
+ year: _ref27 => {
40811
+ let {
40812
+ props
40813
+ } = _ref27;
40767
40814
  const lng = localStorage.getItem("datastakeLng") || "en";
40768
- return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
40815
+ return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
40769
40816
  allowClear: true,
40770
40817
  locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
40771
- picker: "year",
40772
- ...props,
40818
+ picker: "year"
40819
+ }, props), {}, {
40773
40820
  format: "YYYY"
40774
- });
40821
+ }));
40775
40822
  },
40776
- upload: ({
40777
- rules,
40778
- value
40779
- }, {
40780
- setLoading,
40781
- t,
40782
- getApiBaseUrl,
40783
- getAppHeader
40784
- }) => {
40823
+ upload: (_ref28, _ref29) => {
40824
+ let {
40825
+ rules,
40826
+ value
40827
+ } = _ref28;
40828
+ let {
40829
+ setLoading,
40830
+ t,
40831
+ getApiBaseUrl,
40832
+ getAppHeader
40833
+ } = _ref29;
40785
40834
  const apiURL = getApiBaseUrl();
40786
40835
  const accept = rules.length ? rules.find(rule => Object.keys(rule).includes("accept")).accept || "*" : null;
40787
40836
  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) : []) || [];
@@ -40794,13 +40843,12 @@ const inputTypeComponent = {
40794
40843
  }
40795
40844
  }
40796
40845
  const allowedExtensions = accept && accept !== "*" ? accept.split(",").map(ext => ext.trim().toLowerCase()) : [];
40797
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
40798
- ...maxProps,
40846
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({}, maxProps), {}, {
40799
40847
  accept: accept,
40800
- action: `${apiURL}/upload`,
40848
+ action: "".concat(apiURL, "/upload"),
40801
40849
  beforeUpload: beforeUpload(allowedExtensions),
40802
40850
  onChange: val => {
40803
- if (val?.file && typeof setLoading === "function") {
40851
+ if (val !== null && val !== void 0 && val.file && typeof setLoading === "function") {
40804
40852
  if (val.file.percent !== 100) {
40805
40853
  setLoading(true);
40806
40854
  } else {
@@ -40808,10 +40856,9 @@ const inputTypeComponent = {
40808
40856
  }
40809
40857
  }
40810
40858
  },
40811
- headers: {
40812
- Authorization: `Bearer ${getToken()}`,
40813
- ...getAppHeader()
40814
- },
40859
+ headers: _objectSpread2({
40860
+ Authorization: "Bearer ".concat(getToken())
40861
+ }, getAppHeader()),
40815
40862
  defaultFileList: values,
40816
40863
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
40817
40864
  style: {
@@ -40821,17 +40868,19 @@ const inputTypeComponent = {
40821
40868
  children: t("Upload")
40822
40869
  })]
40823
40870
  })
40824
- });
40871
+ }));
40825
40872
  },
40826
- imageUpload: ({
40827
- rules,
40828
- value
40829
- }, {
40830
- setLoading,
40831
- getApiBaseUrl,
40832
- getAppHeader,
40833
- t
40834
- }) => {
40873
+ imageUpload: (_ref30, _ref31) => {
40874
+ let {
40875
+ rules,
40876
+ value
40877
+ } = _ref30;
40878
+ let {
40879
+ setLoading,
40880
+ getApiBaseUrl,
40881
+ getAppHeader,
40882
+ t
40883
+ } = _ref31;
40835
40884
  const apiURL = getApiBaseUrl();
40836
40885
  const values = getImageUploadEditValue(value);
40837
40886
  const maxRule = rules.find(r => r.max);
@@ -40842,17 +40891,17 @@ const inputTypeComponent = {
40842
40891
  maxProps.multiple = true;
40843
40892
  }
40844
40893
  }
40845
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
40846
- ...maxProps,
40894
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({}, maxProps), {}, {
40847
40895
  beforeUpload: beforeUpload(allowedImageExtensions),
40848
40896
  accept: "image/*",
40849
40897
  classList: !values || !values.length ? "empty" : "",
40850
40898
  listType: "picture",
40851
- action: `${apiURL}/upload`,
40899
+ action: "".concat(apiURL, "/upload"),
40852
40900
  onChange: val => {
40853
40901
  if (typeof setLoading === "function") {
40854
- if (val?.file) {
40855
- if (val?.file?.status === "removed") {
40902
+ if (val !== null && val !== void 0 && val.file) {
40903
+ var _val$file;
40904
+ if ((val === null || val === void 0 || (_val$file = val.file) === null || _val$file === void 0 ? void 0 : _val$file.status) === "removed") {
40856
40905
  setLoading(false);
40857
40906
  return;
40858
40907
  }
@@ -40864,10 +40913,9 @@ const inputTypeComponent = {
40864
40913
  setLoading(false);
40865
40914
  }
40866
40915
  },
40867
- headers: {
40868
- Authorization: `Bearer ${getToken()}`,
40869
- ...getAppHeader()
40870
- },
40916
+ headers: _objectSpread2({
40917
+ Authorization: "Bearer ".concat(getToken())
40918
+ }, getAppHeader()),
40871
40919
  defaultFileList: values,
40872
40920
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
40873
40921
  style: {
@@ -40877,17 +40925,19 @@ const inputTypeComponent = {
40877
40925
  children: t("Upload")
40878
40926
  })]
40879
40927
  })
40880
- });
40928
+ }));
40881
40929
  },
40882
- videoUpload: ({
40883
- rules,
40884
- value
40885
- }, {
40886
- setLoading = () => {},
40887
- getApiBaseUrl,
40888
- getAppHeader,
40889
- t
40890
- }) => {
40930
+ videoUpload: (_ref32, _ref33) => {
40931
+ let {
40932
+ rules,
40933
+ value
40934
+ } = _ref32;
40935
+ let {
40936
+ setLoading = () => {},
40937
+ getApiBaseUrl,
40938
+ getAppHeader,
40939
+ t
40940
+ } = _ref33;
40891
40941
  const apiURL = getApiBaseUrl();
40892
40942
  const values = getImageUploadEditValue(value);
40893
40943
  const maxRule = rules.find(r => r.max);
@@ -40898,21 +40948,25 @@ const inputTypeComponent = {
40898
40948
  maxProps.multiple = true;
40899
40949
  }
40900
40950
  }
40901
- return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
40902
- itemRender: (item, fileList) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
40903
- children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
40904
- url: fileList?.response?.url || fileList?.url
40905
- }), item]
40906
- }),
40907
- ...maxProps,
40951
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({
40952
+ itemRender: (item, fileList) => {
40953
+ var _fileList$response;
40954
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
40955
+ children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
40956
+ 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)
40957
+ }), item]
40958
+ });
40959
+ }
40960
+ }, maxProps), {}, {
40908
40961
  accept: "video/*",
40909
40962
  classList: !values || !values.length ? "empty" : "",
40910
40963
  listType: "picture",
40911
- action: `${apiURL}/upload`,
40964
+ action: "".concat(apiURL, "/upload"),
40912
40965
  onChange: val => {
40913
40966
  if (typeof setLoading === "function") {
40914
- if (val?.file) {
40915
- if (val?.file?.status === "removed") {
40967
+ if (val !== null && val !== void 0 && val.file) {
40968
+ var _val$file2;
40969
+ if ((val === null || val === void 0 || (_val$file2 = val.file) === null || _val$file2 === void 0 ? void 0 : _val$file2.status) === "removed") {
40916
40970
  setLoading(false);
40917
40971
  return;
40918
40972
  }
@@ -40924,10 +40978,9 @@ const inputTypeComponent = {
40924
40978
  setLoading(false);
40925
40979
  }
40926
40980
  },
40927
- headers: {
40928
- Authorization: `Bearer ${getToken()}`,
40929
- ...getAppHeader()
40930
- },
40981
+ headers: _objectSpread2({
40982
+ Authorization: "Bearer ".concat(getToken())
40983
+ }, getAppHeader()),
40931
40984
  defaultFileList: values,
40932
40985
  children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
40933
40986
  style: {
@@ -40937,17 +40990,19 @@ const inputTypeComponent = {
40937
40990
  children: t("Upload")
40938
40991
  })]
40939
40992
  })
40940
- });
40993
+ }));
40941
40994
  },
40942
- geolocation: ({
40943
- value,
40944
- name,
40945
- formsValue,
40946
- addressData,
40947
- props
40948
- }, {
40949
- inputMeta
40950
- }) => {
40995
+ geolocation: (_ref34, _ref35) => {
40996
+ let {
40997
+ value,
40998
+ name,
40999
+ formsValue,
41000
+ addressData,
41001
+ props
41002
+ } = _ref34;
41003
+ let {
41004
+ inputMeta
41005
+ } = _ref35;
40951
41006
  let search = formsValue.country;
40952
41007
  if (addressData && Object.keys(addressData).length > 0) {
40953
41008
  const country = countriesList.countries[formsValue.country] || {};
@@ -40955,10 +41010,10 @@ const inputTypeComponent = {
40955
41010
  search = addressData.country;
40956
41011
  }
40957
41012
  if (addressData.level1) {
40958
- search = `${addressData.level1}, ${addressData.country || country.name}`;
41013
+ search = "".concat(addressData.level1, ", ").concat(addressData.country || country.name);
40959
41014
  }
40960
41015
  if (addressData.level2) {
40961
- search = `${addressData.level2}, ${addressData.level1}, ${addressData.country || country.name}`;
41016
+ search = "".concat(addressData.level2, ", ").concat(addressData.level1, ", ").concat(addressData.country || country.name);
40962
41017
  }
40963
41018
  } else {
40964
41019
  const country = countriesList.countries[formsValue.country] || {};
@@ -40966,10 +41021,10 @@ const inputTypeComponent = {
40966
41021
  search = country.name;
40967
41022
  }
40968
41023
  if (formsValue.administrativeLevel1Name) {
40969
- search = `${search} ${formsValue.administrativeLevel1Name}`;
41024
+ search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
40970
41025
  }
40971
41026
  if (formsValue.administrativeLevel2Name) {
40972
- search = `${search} ${formsValue.administrativeLevel2Name}`;
41027
+ search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
40973
41028
  }
40974
41029
  }
40975
41030
  return /*#__PURE__*/jsxRuntime.jsx(Geolocation, {
@@ -40982,33 +41037,35 @@ const inputTypeComponent = {
40982
41037
  searchValue: search
40983
41038
  });
40984
41039
  },
40985
- ajaxSelect: ({
40986
- call,
40987
- automaticallyLink,
40988
- name,
40989
- preSelected,
40990
- inputName,
40991
- props,
40992
- formsValue,
40993
- onNewSetValue,
40994
- multiple,
40995
- updateOptions,
40996
- repeatValues,
40997
- repeatIndex,
40998
- value,
40999
- unique,
41000
- address,
41001
- addressData = {},
41002
- input
41003
- }, {
41004
- form,
41005
- forms,
41006
- setAddress,
41007
- changeInputMeta,
41008
- inputMeta = {},
41009
- meta,
41010
- setFormValues
41011
- }) => {
41040
+ ajaxSelect: (_ref36, _ref37) => {
41041
+ let {
41042
+ call,
41043
+ automaticallyLink,
41044
+ name,
41045
+ preSelected,
41046
+ inputName,
41047
+ props,
41048
+ formsValue,
41049
+ onNewSetValue,
41050
+ multiple,
41051
+ updateOptions,
41052
+ repeatValues,
41053
+ repeatIndex,
41054
+ value,
41055
+ unique,
41056
+ address,
41057
+ addressData = {},
41058
+ input
41059
+ } = _ref36;
41060
+ let {
41061
+ form,
41062
+ forms,
41063
+ setAddress,
41064
+ changeInputMeta,
41065
+ inputMeta = {},
41066
+ meta,
41067
+ setFormValues
41068
+ } = _ref37;
41012
41069
  return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect, {
41013
41070
  preSelected: preSelected,
41014
41071
  input: input,
@@ -41044,40 +41101,41 @@ const inputTypeComponent = {
41044
41101
  const selectedValue = data.find(v => v.value === ev);
41045
41102
  if (address && selectedValue) {
41046
41103
  dot__default["default"].str(address, selectedValue.label, addressData);
41047
- setAddress({
41048
- ...addressData
41049
- });
41104
+ setAddress(_objectSpread2({}, addressData));
41050
41105
  }
41051
41106
  }
41052
41107
  },
41053
41108
  setAddress: setAddress
41054
41109
  });
41055
41110
  },
41056
- tag: ({
41057
- value,
41058
- repeatLabel
41059
- }) => {
41111
+ tag: _ref38 => {
41112
+ let {
41113
+ value,
41114
+ repeatLabel
41115
+ } = _ref38;
41060
41116
  return /*#__PURE__*/jsxRuntime.jsx(TagInput$1, {
41061
41117
  allowClear: true,
41062
41118
  value: value || [],
41063
41119
  newPlaceholder: repeatLabel
41064
41120
  });
41065
41121
  },
41066
- modal: ({
41067
- call,
41068
- automaticallyLink,
41069
- name,
41070
- inputName,
41071
- props,
41072
- formsValue,
41073
- onNewSetValue,
41074
- repeatValues,
41075
- repeatIndex,
41076
- value,
41077
- modalTitle
41078
- }, {
41079
- form
41080
- }) => {
41122
+ modal: (_ref39, _ref40) => {
41123
+ let {
41124
+ call,
41125
+ automaticallyLink,
41126
+ name,
41127
+ inputName,
41128
+ props,
41129
+ formsValue,
41130
+ onNewSetValue,
41131
+ repeatValues,
41132
+ repeatIndex,
41133
+ value,
41134
+ modalTitle
41135
+ } = _ref39;
41136
+ let {
41137
+ form
41138
+ } = _ref40;
41081
41139
  return /*#__PURE__*/jsxRuntime.jsx(AjaxModal$2, {
41082
41140
  allowClear: true,
41083
41141
  call: call,
@@ -41095,63 +41153,69 @@ const inputTypeComponent = {
41095
41153
  buttonText: modalTitle
41096
41154
  });
41097
41155
  },
41098
- website: ({
41099
- name,
41100
- inputName,
41101
- props,
41102
- value,
41103
- repeatIndex,
41104
- repeatValues,
41105
- formsValue
41106
- }, {
41107
- form,
41108
- inputMeta = {},
41109
- t
41110
- }) => {
41111
- return /*#__PURE__*/jsxRuntime.jsx(Website, {
41156
+ website: (_ref41, _ref42) => {
41157
+ let {
41158
+ name,
41159
+ inputName,
41160
+ props,
41161
+ value,
41162
+ repeatIndex,
41163
+ repeatValues,
41164
+ formsValue
41165
+ } = _ref41;
41166
+ let {
41167
+ form,
41168
+ inputMeta = {},
41169
+ t
41170
+ } = _ref42;
41171
+ return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
41112
41172
  allowClear: true,
41113
41173
  initialValue: value,
41114
- t: t,
41115
- ...props,
41174
+ t: t
41175
+ }, props), {}, {
41116
41176
  onChange: val => updateFormValues(repeatIndex, repeatValues, inputName, val, formsValue, name, form),
41117
41177
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
41118
41178
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com"
41119
- });
41179
+ }));
41120
41180
  },
41121
- dataLink: ({
41122
- setValues,
41123
- name,
41124
- onValuesChange,
41125
- formsValue,
41126
- input,
41127
- changeLinking,
41128
- call,
41129
- automaticallyLink,
41130
- inputName,
41131
- props,
41132
- onNewSetValue,
41133
- multiple,
41134
- updateOptions,
41135
- repeatValues,
41136
- repeatIndex,
41137
- value,
41138
- unique,
41139
- address,
41140
- addressData = {},
41141
- getFromLinking
41142
- }, {
41143
- form,
41144
- groupFormId,
41145
- setAddress,
41146
- isHighlighted,
41147
- changeInputMeta,
41148
- meta,
41149
- inputMeta,
41150
- forms
41151
- }) => {
41152
- if (input?.meta?.optionsView?.editInputType === "ajaxSelect") {
41153
- const currentValue = groupFormId ? formsValue[groupFormId]?.[name] : formsValue[name];
41154
- input?.meta?.optionsView?.call || input?.meta?.call || "default::list()::::";
41181
+ dataLink: (_ref43, _ref44) => {
41182
+ var _input$meta7, _input$meta10, _formsValue$meta, _input$meta11;
41183
+ let {
41184
+ setValues,
41185
+ name,
41186
+ onValuesChange,
41187
+ formsValue,
41188
+ input,
41189
+ changeLinking,
41190
+ call,
41191
+ automaticallyLink,
41192
+ inputName,
41193
+ props,
41194
+ onNewSetValue,
41195
+ multiple,
41196
+ updateOptions,
41197
+ repeatValues,
41198
+ repeatIndex,
41199
+ value,
41200
+ unique,
41201
+ address,
41202
+ addressData = {},
41203
+ getFromLinking
41204
+ } = _ref43;
41205
+ let {
41206
+ form,
41207
+ groupFormId,
41208
+ setAddress,
41209
+ isHighlighted,
41210
+ changeInputMeta,
41211
+ meta,
41212
+ inputMeta,
41213
+ forms
41214
+ } = _ref44;
41215
+ 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") {
41216
+ var _formsValue$groupForm, _input$meta8, _input$meta9;
41217
+ const currentValue = groupFormId ? (_formsValue$groupForm = formsValue[groupFormId]) === null || _formsValue$groupForm === void 0 ? void 0 : _formsValue$groupForm[name] : formsValue[name];
41218
+ (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()::::";
41155
41219
  return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect$1, {
41156
41220
  size: "medium",
41157
41221
  input: input,
@@ -41188,9 +41252,7 @@ const inputTypeComponent = {
41188
41252
  const selectedValue = data.find(v => v.value === ev);
41189
41253
  if (address && selectedValue) {
41190
41254
  dot__default["default"].str(address, selectedValue.label, addressData);
41191
- setAddress({
41192
- ...addressData
41193
- });
41255
+ setAddress(_objectSpread2({}, addressData));
41194
41256
  }
41195
41257
  }
41196
41258
  },
@@ -41200,188 +41262,149 @@ const inputTypeComponent = {
41200
41262
  isDataLink: true
41201
41263
  });
41202
41264
  }
41203
- const isSingle = input?.meta?.maxRepeat === 1;
41204
- const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
41205
- ...(formsValue[groupFormId] || {})[name]
41206
- }] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
41207
- ...v
41208
- })) : isSingle ? formsValue[name] ? [{
41209
- ...formsValue[name]
41210
- }] : [] : (formsValue[name] || []).map(v => ({
41211
- ...v
41212
- }));
41265
+ const isSingle = (input === null || input === void 0 || (_input$meta10 = input.meta) === null || _input$meta10 === void 0 ? void 0 : _input$meta10.maxRepeat) === 1;
41266
+ 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));
41213
41267
  const onUpdate = (val, i) => {
41214
41268
  const _val = isSingle ? {
41215
41269
  [name]: val
41216
41270
  } : {
41217
- [name]: formData?.map((d, j) => i === j ? val : d)
41271
+ [name]: formData === null || formData === void 0 ? void 0 : formData.map((d, j) => i === j ? val : d)
41218
41272
  };
41219
41273
  if (groupFormId) {
41220
- const _defaultData = form?.getFieldValue(groupFormId) || {};
41221
- const _newData = {
41222
- ..._defaultData,
41223
- ..._val
41224
- };
41225
- onValuesChange(_newData, {
41226
- ...formsValue,
41274
+ const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
41275
+ const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
41276
+ onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
41227
41277
  [groupFormId]: _newData
41228
- });
41229
- form?.setFieldValue(groupFormId, _newData);
41230
- setValues({
41231
- ...formsValue,
41278
+ }));
41279
+ form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
41280
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
41232
41281
  [groupFormId]: _newData
41233
- });
41282
+ }));
41234
41283
  return;
41235
41284
  }
41236
- onValuesChange(_val, {
41237
- ...formsValue,
41238
- ..._val
41239
- });
41240
- form?.setFieldValue(name, _val[name]);
41241
- setValues({
41242
- ...formsValue,
41243
- ..._val
41244
- });
41285
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
41286
+ form === null || form === void 0 || form.setFieldValue(name, _val[name]);
41287
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
41245
41288
  };
41246
41289
  return /*#__PURE__*/jsxRuntime.jsx(DataLink, {
41247
41290
  form: input,
41248
41291
  formsValue: formsValue,
41249
41292
  onUpdate: onUpdate,
41250
41293
  isHighlighted: isHighlighted,
41251
- values: groupFormId ? {
41252
- ...(formsValue[groupFormId] || {}),
41294
+ values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
41253
41295
  meta: {
41254
- inputs: (formsValue?.meta?.inputs || {})[groupFormId]
41296
+ inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta = formsValue.meta) === null || _formsValue$meta === void 0 ? void 0 : _formsValue$meta.inputs) || {})[groupFormId]
41255
41297
  }
41256
- } : formsValue,
41298
+ }) : formsValue,
41257
41299
  name: name,
41258
41300
  groupFormId: groupFormId,
41259
- maxRepeat: input?.meta?.maxRepeat,
41260
- remove: ({
41261
- key
41262
- }) => {
41301
+ maxRepeat: input === null || input === void 0 || (_input$meta11 = input.meta) === null || _input$meta11 === void 0 ? void 0 : _input$meta11.maxRepeat,
41302
+ remove: _ref45 => {
41303
+ let {
41304
+ key
41305
+ } = _ref45;
41263
41306
  const _val = isSingle ? {
41264
41307
  [name]: null
41265
41308
  } : {
41266
41309
  [name]: formData.filter((v, i) => i !== key)
41267
41310
  };
41268
41311
  if (groupFormId) {
41269
- const _defaultData = form?.getFieldValue(groupFormId) || {};
41270
- const _newData = {
41271
- ..._defaultData,
41272
- ..._val
41273
- };
41274
- onValuesChange(_newData, {
41275
- ...formsValue,
41312
+ const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
41313
+ const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
41314
+ onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
41276
41315
  [groupFormId]: _newData
41277
- });
41278
- form?.setFieldValue(groupFormId, _newData);
41279
- setValues({
41280
- ...formsValue,
41316
+ }));
41317
+ form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
41318
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
41281
41319
  [groupFormId]: _newData
41282
- });
41320
+ }));
41283
41321
  return;
41284
41322
  }
41285
- onValuesChange(_val, {
41286
- ...formsValue,
41287
- ..._val
41288
- });
41289
- form?.setFieldValue(name, _val[name]);
41290
- setValues({
41291
- ...formsValue,
41292
- ..._val
41293
- });
41323
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
41324
+ form === null || form === void 0 || form.setFieldValue(name, _val[name]);
41325
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
41294
41326
  },
41295
41327
  add: val => {
41296
41328
  const _val = isSingle ? {
41297
41329
  [name]: val
41298
41330
  } : {
41299
- [name]: [...formData, {
41300
- ...val
41301
- }]
41331
+ [name]: [...formData, _objectSpread2({}, val)]
41302
41332
  };
41303
41333
  if (groupFormId) {
41304
- const _defaultData = form?.getFieldValue(groupFormId) || {};
41305
- const _newData = {
41306
- ..._defaultData,
41307
- ..._val
41308
- };
41309
- form?.setFieldValue(groupFormId, _newData);
41310
- onValuesChange(_newData, {
41311
- ...formsValue,
41334
+ const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
41335
+ const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
41336
+ form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
41337
+ onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
41312
41338
  [groupFormId]: _newData
41313
- });
41314
- setValues({
41315
- ...formsValue,
41339
+ }));
41340
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
41316
41341
  [groupFormId]: _newData
41317
- });
41342
+ }));
41318
41343
  return;
41319
41344
  }
41320
- form?.setFieldValue(name, _val[name]);
41321
- onValuesChange(_val, {
41322
- ...formsValue,
41323
- ..._val
41324
- });
41325
- setValues({
41326
- ...formsValue,
41327
- ..._val
41328
- });
41345
+ form === null || form === void 0 || form.setFieldValue(name, _val[name]);
41346
+ onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
41347
+ setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
41329
41348
  },
41330
41349
  k: name,
41331
41350
  formData: formData
41332
41351
  });
41333
41352
  },
41334
- internallink: ({
41335
- name,
41336
- inputName,
41337
- props,
41338
- value,
41339
- repeatIndex,
41340
- repeatValues,
41341
- formsValue
41342
- }, {
41343
- form,
41344
- inputMeta = {},
41345
- t
41346
- }) => {
41347
- return /*#__PURE__*/jsxRuntime.jsx(Website, {
41353
+ internallink: (_ref46, _ref47) => {
41354
+ let {
41355
+ name,
41356
+ inputName,
41357
+ props,
41358
+ value,
41359
+ repeatIndex,
41360
+ repeatValues,
41361
+ formsValue
41362
+ } = _ref46;
41363
+ let {
41364
+ form,
41365
+ inputMeta = {},
41366
+ t
41367
+ } = _ref47;
41368
+ return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
41348
41369
  allowClear: true,
41349
41370
  disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
41350
41371
  placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com",
41351
- initialValue: value,
41352
- ...props,
41372
+ initialValue: value
41373
+ }, props), {}, {
41353
41374
  onChange: val => updateFormValues(repeatIndex, repeatValues, inputName, val, formsValue, name, form)
41354
- });
41375
+ }));
41355
41376
  },
41356
- group: ({
41357
- props,
41358
- groupInputs
41359
- }) => {
41360
- return /*#__PURE__*/jsxRuntime.jsx(GroupInput$1, {
41361
- groupInputs: groupInputs,
41362
- ...props
41363
- });
41377
+ group: _ref48 => {
41378
+ let {
41379
+ props,
41380
+ groupInputs
41381
+ } = _ref48;
41382
+ return /*#__PURE__*/jsxRuntime.jsx(GroupInput$1, _objectSpread2({
41383
+ groupInputs: groupInputs
41384
+ }, props));
41364
41385
  },
41365
- groupInputs: ({
41366
- props,
41367
- groupInputs
41368
- }, {
41369
- inputMeta
41370
- }) => {
41371
- return /*#__PURE__*/jsxRuntime.jsx(GroupInput$1, {
41386
+ groupInputs: (_ref49, _ref50) => {
41387
+ let {
41388
+ props,
41389
+ groupInputs
41390
+ } = _ref49;
41391
+ let {
41392
+ inputMeta
41393
+ } = _ref50;
41394
+ return /*#__PURE__*/jsxRuntime.jsx(GroupInput$1, _objectSpread2({
41372
41395
  groupInputs: groupInputs,
41373
- inputMeta: inputMeta,
41374
- ...props
41375
- });
41396
+ inputMeta: inputMeta
41397
+ }, props));
41376
41398
  },
41377
- radioGroup: ({
41378
- props,
41379
- value,
41380
- options
41381
- }) => {
41382
- return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
41383
- value: value,
41384
- ...props,
41399
+ radioGroup: _ref51 => {
41400
+ let {
41401
+ props,
41402
+ value,
41403
+ options
41404
+ } = _ref51;
41405
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, _objectSpread2(_objectSpread2({
41406
+ value: value
41407
+ }, props), {}, {
41385
41408
  children: (options || []).map(o => {
41386
41409
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
41387
41410
  value: o.value,
@@ -41394,16 +41417,17 @@ const inputTypeComponent = {
41394
41417
  }) : null]
41395
41418
  }, o.value);
41396
41419
  })
41397
- });
41420
+ }));
41398
41421
  },
41399
- checkboxGroup: ({
41400
- props,
41401
- value,
41402
- options
41403
- }) => {
41404
- return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, {
41405
- value: value,
41406
- ...props,
41422
+ checkboxGroup: _ref52 => {
41423
+ let {
41424
+ props,
41425
+ value,
41426
+ options
41427
+ } = _ref52;
41428
+ return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, _objectSpread2(_objectSpread2({
41429
+ value: value
41430
+ }, props), {}, {
41407
41431
  children: (options || []).map(o => {
41408
41432
  return /*#__PURE__*/jsxRuntime.jsxs(antd.Checkbox, {
41409
41433
  value: o.value,
@@ -41416,28 +41440,30 @@ const inputTypeComponent = {
41416
41440
  }) : null]
41417
41441
  }, o.value);
41418
41442
  })
41419
- });
41443
+ }));
41420
41444
  }
41421
41445
  };
41422
- const GetFormItem = ({
41423
- code,
41424
- inputData,
41425
- inputId,
41426
- input,
41427
- setLoading,
41428
- values,
41429
- MainForm,
41430
- options,
41431
- plainForms,
41432
- setValues,
41433
- alertError,
41434
- setAddress,
41435
- inputMeta = {},
41436
- inputKey,
41437
- changeInputMeta = () => {},
41438
- i,
41439
- isCreate = false
41440
- }) => {
41446
+ const GetFormItem = _ref53 => {
41447
+ var _find, _input$meta12, _input$meta13, _input$meta14, _input$meta15, _input$meta16, _input$meta17, _input$meta18, _inputData$value, _input$meta19, _input$meta20, _inputData$commentVal;
41448
+ let {
41449
+ code,
41450
+ inputData,
41451
+ inputId,
41452
+ input,
41453
+ setLoading,
41454
+ values,
41455
+ MainForm,
41456
+ options,
41457
+ plainForms,
41458
+ setValues,
41459
+ alertError,
41460
+ setAddress,
41461
+ inputMeta = {},
41462
+ inputKey,
41463
+ changeInputMeta = () => {},
41464
+ i,
41465
+ isCreate = false
41466
+ } = _ref53;
41441
41467
  const {
41442
41468
  t,
41443
41469
  getAppHeader,
@@ -41453,7 +41479,7 @@ const GetFormItem = ({
41453
41479
  case "h6":
41454
41480
  return getInputHeadLines(input.type, i, input, values);
41455
41481
  default:
41456
- const rules = inputMeta?.notApplicable || inputMeta?.notAvailable ? [] : inputData.rules ? inputData.rules.filter(rule => !Object.keys(rule).includes("accept") && !Object.keys(rule).includes("max")) : [];
41482
+ 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")) : [];
41457
41483
  const requiredRule = rules.find(r => r.required);
41458
41484
  if (requiredRule && input.type === "text") {
41459
41485
  rules.push({
@@ -41462,47 +41488,45 @@ const GetFormItem = ({
41462
41488
  });
41463
41489
  }
41464
41490
  const noLabel = ["message"].includes(input.type);
41465
- let maxRule = (inputData?.rules || []).find(rule => rule.max)?.max;
41491
+ let maxRule = (_find = ((inputData === null || inputData === void 0 ? void 0 : inputData.rules) || []).find(rule => rule.max)) === null || _find === void 0 ? void 0 : _find.max;
41466
41492
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
41467
41493
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
41468
41494
  className: "flex input-cont",
41469
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
41470
- initialValue: inputMeta?.defaultValue,
41471
- ...(["total100", "group"].includes(input.type) ? {} : {
41472
- name: inputId,
41473
- fieldKey: inputId,
41474
- initialValue: inputData.value
41475
- }),
41476
- ...(["upload", "imageUpload", "videoUpload"].includes(input.type) ? {
41477
- valuePropName: "fileList",
41478
- getValueFromEvent: e => {
41479
- if (Array.isArray(e)) {
41480
- return e;
41481
- }
41482
- return e && e.fileList && e.fileList.map(f => {
41483
- if (f.response) {
41484
- return f.response;
41485
- }
41486
- return f;
41487
- });
41495
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
41496
+ initialValue: inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.defaultValue
41497
+ }, ["total100", "group"].includes(input.type) ? {} : {
41498
+ name: inputId,
41499
+ fieldKey: inputId,
41500
+ initialValue: inputData.value
41501
+ }), ["upload", "imageUpload", "videoUpload"].includes(input.type) ? {
41502
+ valuePropName: "fileList",
41503
+ getValueFromEvent: e => {
41504
+ if (Array.isArray(e)) {
41505
+ return e;
41488
41506
  }
41489
- } : {}),
41507
+ return e && e.fileList && e.fileList.map(f => {
41508
+ if (f.response) {
41509
+ return f.response;
41510
+ }
41511
+ return f;
41512
+ });
41513
+ }
41514
+ } : {}), {}, {
41490
41515
  style: input.showOnView === false ? {
41491
41516
  display: "none"
41492
- } : {},
41493
- ...(["switch"].includes(input.type) ? {
41494
- labelCol: {
41495
- span: 20
41496
- },
41497
- style: {
41498
- ...(input.showOnView === false ? {
41499
- display: "none"
41500
- } : {}),
41501
- flexDirection: "row",
41502
- justifyContent: "space-between"
41503
- }
41504
- } : {}),
41505
- className: input.comment ? `flex-1 with-comment i-${input.type}` : `i-${input.type} flex-1`,
41517
+ } : {}
41518
+ }, ["switch"].includes(input.type) ? {
41519
+ labelCol: {
41520
+ span: 20
41521
+ },
41522
+ style: _objectSpread2(_objectSpread2({}, input.showOnView === false ? {
41523
+ display: "none"
41524
+ } : {}), {}, {
41525
+ flexDirection: "row",
41526
+ justifyContent: "space-between"
41527
+ })
41528
+ } : {}), {}, {
41529
+ className: input.comment ? "flex-1 with-comment i-".concat(input.type) : "i-".concat(input.type, " flex-1"),
41506
41530
  "data-id": inputData.name,
41507
41531
  rules: rules,
41508
41532
  required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
@@ -41513,8 +41537,8 @@ const GetFormItem = ({
41513
41537
  children: [/*#__PURE__*/jsxRuntime.jsx("div", {
41514
41538
  className: "mr-1",
41515
41539
  children: getInputLabel(input, values)
41516
- }), !!input?.meta?.tooltip && /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
41517
- title: input?.meta?.tooltip,
41540
+ }), !!(input !== null && input !== void 0 && (_input$meta12 = input.meta) !== null && _input$meta12 !== void 0 && _input$meta12.tooltip) && /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
41541
+ title: input === null || input === void 0 || (_input$meta13 = input.meta) === null || _input$meta13 === void 0 ? void 0 : _input$meta13.tooltip,
41518
41542
  trigger: "hover",
41519
41543
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
41520
41544
  className: "flex flex-column justify-content-center",
@@ -41532,7 +41556,7 @@ const GetFormItem = ({
41532
41556
  title: t("Not applicable"),
41533
41557
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
41534
41558
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
41535
- disabled: !input?.meta?.notApplicable,
41559
+ disabled: !(input !== null && input !== void 0 && (_input$meta14 = input.meta) !== null && _input$meta14 !== void 0 && _input$meta14.notApplicable),
41536
41560
  className: formatClassname(["default p-0", inputMeta.notApplicable && "primary"]),
41537
41561
  type: "link",
41538
41562
  onClick: () => {
@@ -41567,7 +41591,7 @@ const GetFormItem = ({
41567
41591
  title: t("No available information"),
41568
41592
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
41569
41593
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
41570
- disabled: !input?.meta?.notAvailable,
41594
+ disabled: !(input !== null && input !== void 0 && (_input$meta15 = input.meta) !== null && _input$meta15 !== void 0 && _input$meta15.notAvailable),
41571
41595
  className: formatClassname(["default p-0", inputMeta.notAvailable && "primary"]),
41572
41596
  type: "link",
41573
41597
  onClick: () => {
@@ -41601,14 +41625,14 @@ const GetFormItem = ({
41601
41625
  }), /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
41602
41626
  title: t("Add comment"),
41603
41627
  children: /*#__PURE__*/jsxRuntime.jsx("div", {
41604
- children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
41628
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
41605
41629
  type: "link",
41606
- disabled: !input?.meta?.comment,
41607
- ...(!isShown ? {
41608
- className: "default p-0"
41609
- } : {
41610
- className: "p-0 primary"
41611
- }),
41630
+ disabled: !(input !== null && input !== void 0 && (_input$meta16 = input.meta) !== null && _input$meta16 !== void 0 && _input$meta16.comment)
41631
+ }, !isShown ? {
41632
+ className: "default p-0"
41633
+ } : {
41634
+ className: "p-0 primary"
41635
+ }), {}, {
41612
41636
  onClick: () => {
41613
41637
  setIsShown(true);
41614
41638
  changeInputMeta({
@@ -41624,18 +41648,18 @@ const GetFormItem = ({
41624
41648
  width: 16,
41625
41649
  height: 16
41626
41650
  })
41627
- })
41651
+ }))
41628
41652
  })
41629
41653
  })]
41630
- }), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
41654
+ }), (_input$meta17 = input.meta) !== null && _input$meta17 !== void 0 && _input$meta17.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
41631
41655
  className: "code",
41632
41656
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
41633
- children: input.meta?.code
41657
+ children: (_input$meta18 = input.meta) === null || _input$meta18 === void 0 ? void 0 : _input$meta18.code
41634
41658
  })
41635
41659
  }) : code ? /*#__PURE__*/jsxRuntime.jsx("div", {
41636
41660
  className: "code",
41637
41661
  children: /*#__PURE__*/jsxRuntime.jsx("span", {
41638
- children: `${code}.${i + 1}`
41662
+ children: "".concat(code, ".").concat(i + 1)
41639
41663
  })
41640
41664
  }) : null]
41641
41665
  })
@@ -41655,7 +41679,7 @@ const GetFormItem = ({
41655
41679
  getAppHeader,
41656
41680
  getApiBaseUrl
41657
41681
  }) : console.log(input)
41658
- })
41682
+ }))
41659
41683
  }), alertError ? /*#__PURE__*/jsxRuntime.jsx(antd.Alert, {
41660
41684
  message: alertError.message,
41661
41685
  type: "error",
@@ -41684,10 +41708,10 @@ const GetFormItem = ({
41684
41708
  className: "max-char-span",
41685
41709
  children: t("max-char", {
41686
41710
  chars: maxRule,
41687
- filled: inputData?.value?.length || 0
41711
+ filled: (inputData === null || inputData === void 0 || (_inputData$value = inputData.value) === null || _inputData$value === void 0 ? void 0 : _inputData$value.length) || 0
41688
41712
  })
41689
41713
  })
41690
- }) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
41714
+ }) : null, (_input$meta19 = input.meta) !== null && _input$meta19 !== void 0 && _input$meta19.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
41691
41715
  className: "input-content dynamic-form-comment",
41692
41716
  children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
41693
41717
  className: "comment-textarea",
@@ -41713,7 +41737,7 @@ const GetFormItem = ({
41713
41737
  },
41714
41738
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
41715
41739
  type: "link",
41716
- disabled: !input.meta?.comment,
41740
+ disabled: !((_input$meta20 = input.meta) !== null && _input$meta20 !== void 0 && _input$meta20.comment),
41717
41741
  className: "p-0",
41718
41742
  children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
41719
41743
  width: 16,
@@ -41744,7 +41768,7 @@ const GetFormItem = ({
41744
41768
  className: "max-char-span",
41745
41769
  children: t("max-char", {
41746
41770
  chars: MAX_COMMENTS_LENGTH,
41747
- filled: inputData?.commentValue?.length || 0
41771
+ filled: (inputData === null || inputData === void 0 || (_inputData$commentVal = inputData.commentValue) === null || _inputData$commentVal === void 0 ? void 0 : _inputData$commentVal.length) || 0
41748
41772
  })
41749
41773
  })]
41750
41774
  }) : null]
@@ -42111,7 +42135,7 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
42111
42135
  });
42112
42136
  };
42113
42137
 
42114
- const useCombinedPrefilledValues = (combinedPrefilledValues, values, parentValues, setValues, MainForm) => {
42138
+ const useCombinedPrefilledValues = (combinedPrefilledValues, values, parentValues, setValues, MainForm, form) => {
42115
42139
  const combinedValuesRef = React.useRef({});
42116
42140
  React.useEffect(() => {
42117
42141
  if (!combinedPrefilledValues || Object.keys(combinedPrefilledValues).length === 0) {
@@ -42121,7 +42145,7 @@ const useCombinedPrefilledValues = (combinedPrefilledValues, values, parentValue
42121
42145
  let hasChanges = false;
42122
42146
  Object.keys(combinedPrefilledValues).forEach(fieldKey => {
42123
42147
  const template = combinedPrefilledValues[fieldKey];
42124
- const resolvedValue = resolveCombinedPrefilledValue(template, values, parentValues);
42148
+ const resolvedValue = resolveCombinedPrefilledValue(template, values, parentValues, form);
42125
42149
  if (resolvedValue === null) {
42126
42150
  return;
42127
42151
  }
@@ -42300,7 +42324,7 @@ function DynamicForm(_ref) {
42300
42324
  }, [data, isCreate]);
42301
42325
 
42302
42326
  // Handle combined prefilled values (auto-fill based on templates)
42303
- useCombinedPrefilledValues(combinedPrefilledValues, values, parentValues, setValues, MainForm);
42327
+ useCombinedPrefilledValues(combinedPrefilledValues, values, parentValues, setValues, MainForm, form);
42304
42328
 
42305
42329
  // Initialize default values for hidden and disabled fields
42306
42330
  React.useEffect(() => {
@@ -50984,6 +51008,7 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
50984
51008
  getViewport,
50985
51009
  fitView
50986
51010
  } = react.useReactFlow();
51011
+ const hasInitialFitRef = React.useRef(false);
50987
51012
  const nodesToFit = React.useMemo(() => {
50988
51013
  let result;
50989
51014
  if (mandatoryNodesToFit) {
@@ -50994,27 +51019,29 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
50994
51019
  return result;
50995
51020
  }, [nodes.length, mandatoryNodesToFit?.length, mandatoryNodesToFit]);
50996
51021
 
50997
- // In BaseGraph.jsx, replace the useEffect with:
51022
+ // Only auto-fit on initial render or when node count changes, not on property changes
50998
51023
  React.useEffect(() => {
50999
51024
  if (nodesToFit.length === 0) return;
51000
51025
 
51001
- // Use setTimeout instead of requestAnimationFrame to ensure nodes are rendered
51002
- const timer = setTimeout(() => {
51003
- fitView({
51004
- padding: 0.4,
51005
- nodes: [...nodesToFit],
51006
- // duration: withDuration ? 300 : undefined,
51007
- maxZoom: 0.9
51008
- });
51009
- }, 100); // Small delay to ensure nodes are rendered
51010
-
51011
- return () => clearTimeout(timer);
51012
- }, [nodesToFit.length, nodesToFit.map(n => `${n.id}-${n.width}-${n.height}`).join(','), withDuration]);
51026
+ // Only auto-fit on initial render or when node count changes
51027
+ if (!hasInitialFitRef.current) {
51028
+ hasInitialFitRef.current = true;
51029
+ const timer = setTimeout(() => {
51030
+ fitView({
51031
+ padding: 0.4,
51032
+ nodes: [...nodesToFit],
51033
+ maxZoom: 0.9
51034
+ });
51035
+ }, 100);
51036
+ return () => clearTimeout(timer);
51037
+ }
51038
+ }, [nodesToFit.length, withDuration]);
51013
51039
  return /*#__PURE__*/jsxRuntime.jsx(ComponentWithFocus, {
51014
51040
  children: /*#__PURE__*/jsxRuntime.jsxs("div", {
51015
51041
  style: {
51016
51042
  height: "100%",
51017
- width: "100%"
51043
+ width: "100%",
51044
+ position: "relative"
51018
51045
  },
51019
51046
  ref: ref,
51020
51047
  children: [filtersConfig ? /*#__PURE__*/jsxRuntime.jsx(Filters, {
@@ -51243,8 +51270,7 @@ function TradeRelationship(_ref) {
51243
51270
  filtersConfig,
51244
51271
  onFilterChange = () => {},
51245
51272
  renderTooltipItems = () => [],
51246
- getTotal = () => 0,
51247
- onRenderComplete = () => {}
51273
+ getTotal = () => 0
51248
51274
  } = _ref;
51249
51275
  const reactFlowWrapper = React.useRef(null);
51250
51276
  const [nodes, setNodes] = react.useNodesState([]);
@@ -51257,27 +51283,6 @@ function TradeRelationship(_ref) {
51257
51283
  const [activeNode, setActiveNode] = React.useState(null);
51258
51284
  // const [initCenter, setInitCenter] = useState(true);
51259
51285
  const [associatedNodes, setAssociatedNodes] = React.useState(null);
51260
- const isFullyRenderedRef = React.useRef(false);
51261
- const [isFullyRendered, setIsFullyRendered] = React.useState(false);
51262
- React.useEffect(() => {
51263
- isFullyRenderedRef.current = false;
51264
- setIsFullyRendered(false);
51265
- setActiveNode(null);
51266
- }, [data]);
51267
- React.useEffect(() => {
51268
- if (nodes.length > 0 && edges.length > 0 && !isFullyRenderedRef.current) {
51269
- const timeoutId = setTimeout(() => {
51270
- isFullyRenderedRef.current = true;
51271
- setIsFullyRendered(true);
51272
- onRenderComplete(true);
51273
- }, 200);
51274
- return () => clearTimeout(timeoutId);
51275
- }
51276
- if (nodes.length === 0 || edges.length === 0) {
51277
- setIsFullyRendered(true);
51278
- onRenderComplete(true);
51279
- }
51280
- }, [nodes.length, edges.length, associatedNodes]);
51281
51286
  React.useEffect(() => {
51282
51287
  setActiveNode(null);
51283
51288
  }, [data]);
@@ -51464,7 +51469,7 @@ function TradeRelationship(_ref) {
51464
51469
 
51465
51470
  // Cleanup to prevent memory leaks if component unmounts quickly
51466
51471
  return () => clearTimeout(timeoutId);
51467
- }, [data, activeNode]);
51472
+ }, [data]);
51468
51473
  React.useEffect(() => {
51469
51474
  if (activeNode) {
51470
51475
  let _associatedNodesRight = [activeNode];
@@ -55023,7 +55028,8 @@ function AccountTable(_ref) {
55023
55028
  module,
55024
55029
  defaultPageSize = 20,
55025
55030
  actionButton,
55026
- inviteAccount
55031
+ inviteAccount,
55032
+ refetchTrigger
55027
55033
  } = _ref;
55028
55034
  const accountTypes = config === null || config === void 0 ? void 0 : config.accountTypes;
55029
55035
  const [showFilters, setShowFilters] = React.useState(false);
@@ -55051,7 +55057,8 @@ function AccountTable(_ref) {
55051
55057
  filtersConfig: filtersConfig$c,
55052
55058
  getRedirectLink,
55053
55059
  getData,
55054
- fetchPendingOnMount: true
55060
+ fetchPendingOnMount: true,
55061
+ refetchTrigger
55055
55062
  });
55056
55063
  const selectOptions = React.useMemo(() => {
55057
55064
  var _config$options;
@@ -58305,23 +58312,27 @@ function NewAccount({
58305
58312
  updateAccount,
58306
58313
  inviteAccount,
58307
58314
  isPending = false,
58308
- accountToEdit
58315
+ accountToEdit,
58316
+ countries
58309
58317
  }) {
58310
58318
  const [MainForm] = antd.Form.useForm();
58311
58319
  const [loading, setLoading] = React.useState(false);
58312
58320
  const [accountUsed, setAccountUsed] = React.useState(false);
58313
58321
  const isEdit = React.useMemo(() => accountToEdit && typeof accountToEdit === "object", [accountToEdit]);
58322
+ const selectedCountry = React.useMemo(() => findOptions(accountToEdit?.otherData?.country, countries), [accountToEdit?.otherData?.country, countries]);
58323
+ console.log(selectedCountry, "selectedCountry");
58314
58324
  React.useEffect(() => {
58315
58325
  if (accountToEdit && typeof accountToEdit === "object") {
58316
58326
  MainForm.setFieldsValue({
58317
58327
  name: accountToEdit.name,
58318
58328
  email: accountToEdit.email,
58319
- type: accountToEdit?.otherData?.interface
58329
+ type: accountToEdit?.otherData?.interface,
58330
+ country: selectedCountry
58320
58331
  });
58321
58332
  } else {
58322
58333
  MainForm.resetFields();
58323
58334
  }
58324
- }, [accountToEdit, MainForm]);
58335
+ }, [accountToEdit, MainForm, selectedCountry]);
58325
58336
  const onSubmit = async () => {
58326
58337
  try {
58327
58338
  const val = await MainForm.validateFields();
@@ -58333,6 +58344,7 @@ function NewAccount({
58333
58344
  data: val,
58334
58345
  isPending: accountToEdit.status === 'pending' || isPending
58335
58346
  });
58347
+ antd.message.success(t("Account successfully updated"));
58336
58348
  } else {
58337
58349
  if (!inviteAccount) {
58338
58350
  throw new Error("inviteAccount function is required for creating new accounts");
@@ -58372,7 +58384,7 @@ function NewAccount({
58372
58384
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
58373
58385
  placeholder: t("Type")
58374
58386
  })
58375
- }), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
58387
+ }), !isEdit && /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
58376
58388
  name: "email",
58377
58389
  label: t("Email"),
58378
58390
  rules: [{
@@ -58382,6 +58394,16 @@ function NewAccount({
58382
58394
  children: /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
58383
58395
  placeholder: t("Type")
58384
58396
  })
58397
+ }), isEdit && /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
58398
+ name: "country",
58399
+ label: t("Country"),
58400
+ rules: [{
58401
+ required: true
58402
+ }],
58403
+ children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
58404
+ placeholder: t("Select"),
58405
+ options: countries
58406
+ })
58385
58407
  }), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
58386
58408
  name: "type",
58387
58409
  label: t("Type"),
@@ -58505,6 +58527,7 @@ function AdminAccountsScreen({
58505
58527
  };
58506
58528
  const [addAccountVisible, setAddAccountVisible] = React.useState(!!query.get("create"));
58507
58529
  const [accountToEdit, setAccountToEdit] = React.useState(null);
58530
+ const [refetchTrigger, setRefetchTrigger] = React.useState(0);
58508
58531
  const actionButtons = React.useMemo(() => [{
58509
58532
  type: "primary",
58510
58533
  onClick: () => setAddAccountVisible(true),
@@ -58545,6 +58568,7 @@ function AdminAccountsScreen({
58545
58568
  headerTitle: "accounts",
58546
58569
  actionButton: actionButtons,
58547
58570
  getData: handleGetData,
58571
+ refetchTrigger: refetchTrigger,
58548
58572
  config: {
58549
58573
  accountTypes,
58550
58574
  addAccountVisible,
@@ -58566,8 +58590,10 @@ function AdminAccountsScreen({
58566
58590
  setAccountToEdit(null);
58567
58591
  },
58568
58592
  accountTypes: accountTypes,
58569
- countriesOptions: options?.countries,
58570
- fetchData: () => {},
58593
+ countries: options?.countries,
58594
+ fetchData: () => {
58595
+ setRefetchTrigger(prev => prev + 1);
58596
+ },
58571
58597
  inviteAccount: data => AdminService.inviteAccount(data),
58572
58598
  updateAccount: ({
58573
58599
  data,