datastake-daf 0.6.817 → 0.6.819
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.
- package/dist/components/index.js +1215 -1074
- package/dist/pages/index.js +264 -89
- package/dist/services/index.js +0 -5
- package/package.json +1 -1
- package/public/Vegetation/damage-from-insects-default.svg +1 -0
- package/public/Vegetation/dry-or-dead-default.svg +1 -0
- package/public/Vegetation/healthy-default.svg +1 -0
- package/public/Vegetation/yellowing.svg +1 -0
- package/src/@daf/core/components/Charts/RadarChart/index.jsx +53 -2
- package/src/@daf/core/components/Charts/style.js +1 -1
- package/src/@daf/core/components/Dashboard/Widget/VegetationWidget/index.jsx +0 -4
- package/src/@daf/core/components/ViewForm/components/Records/config.js +1 -0
- package/src/@daf/core/components/ViewForm/components/Records/index.jsx +0 -1
- package/src/@daf/pages/Dashboards/SupplyChain/components/KeyIndicators/config.js +2 -2
- package/src/@daf/pages/Dashboards/SupplyChain/components/KeyIndicators/index.js +3 -2
- package/src/@daf/pages/Dashboards/SupplyChain/index.jsx +4 -1
- package/src/@daf/pages/Dashboards/UserDashboard/components/KeyIndicators/config.js +3 -3
- package/src/@daf/pages/Dashboards/UserDashboard/components/KeyIndicators/index.jsx +4 -2
- package/src/@daf/pages/Dashboards/UserDashboard/components/MineSites/config.js +2 -2
- package/src/@daf/pages/Dashboards/UserDashboard/config.js +2 -2
- package/src/@daf/pages/Dashboards/UserDashboard/index.jsx +1 -0
- package/src/@daf/pages/Dashboards/helper.js +2 -2
- package/src/@daf/pages/Events/config.js +1 -1
- package/src/@daf/pages/Locations/MineSite/columns.js +1 -1
- package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/BiodiversityHabitat/ObservedFauna.jsx +6 -11
- package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/BiodiversityHabitat/index.jsx +4 -2
- package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/MangroveGrowth/PlantedSpecies.jsx +25 -10
- package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/MangroveGrowth/SeedlingsHeight.jsx +10 -13
- package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/MangroveGrowth/VegetationHealth.jsx +19 -4
- package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/SoilWaterProfile/SoilType.jsx +22 -10
- package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/SoilWaterProfile/WaterQuality.jsx +26 -10
- package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/chartHelpers.js +74 -0
- package/src/@daf/pages/TablePage/create.jsx +3 -1
- package/src/@daf/pages/TablePage/hook.js +2 -0
- package/src/@daf/services/LinkedSubjects.js +1 -1
package/dist/components/index.js
CHANGED
|
@@ -4817,7 +4817,7 @@ const config$2 = {
|
|
|
4817
4817
|
AddDocument: config$3
|
|
4818
4818
|
};
|
|
4819
4819
|
|
|
4820
|
-
const _excluded$
|
|
4820
|
+
const _excluded$G = ["width", "height", "size", "name", "fill"];
|
|
4821
4821
|
const CustomIcon = _ref => {
|
|
4822
4822
|
let {
|
|
4823
4823
|
width = 14,
|
|
@@ -4826,7 +4826,7 @@ const CustomIcon = _ref => {
|
|
|
4826
4826
|
name = "",
|
|
4827
4827
|
fill = "none"
|
|
4828
4828
|
} = _ref,
|
|
4829
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
4829
|
+
props = _objectWithoutProperties(_ref, _excluded$G);
|
|
4830
4830
|
const conf = config$2[name];
|
|
4831
4831
|
if (conf) {
|
|
4832
4832
|
return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -5115,7 +5115,7 @@ createCommonjsModule(function (module, exports) {
|
|
|
5115
5115
|
!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])+"]"}}}));
|
|
5116
5116
|
});
|
|
5117
5117
|
|
|
5118
|
-
const _excluded$
|
|
5118
|
+
const _excluded$F = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
|
|
5119
5119
|
dayjs__default["default"].extend(customParseFormat);
|
|
5120
5120
|
dayjs__default["default"].extend(utc);
|
|
5121
5121
|
dayjs__default["default"].extend(utc);
|
|
@@ -5491,7 +5491,7 @@ const filterCreateData = data => {
|
|
|
5491
5491
|
createdAt,
|
|
5492
5492
|
updatedAt
|
|
5493
5493
|
} = data,
|
|
5494
|
-
rest = _objectWithoutProperties(data, _excluded$
|
|
5494
|
+
rest = _objectWithoutProperties(data, _excluded$F);
|
|
5495
5495
|
const _meta = isObjectEmpty(meta) ? undefined : meta;
|
|
5496
5496
|
return _objectSpread2(_objectSpread2({}, rest), {}, {
|
|
5497
5497
|
meta: _meta
|
|
@@ -6023,7 +6023,7 @@ SelectFilters.propTypes = {
|
|
|
6023
6023
|
apiUrl: PropTypes__default["default"].string
|
|
6024
6024
|
};
|
|
6025
6025
|
|
|
6026
|
-
const _excluded$
|
|
6026
|
+
const _excluded$E = ["columns", "data", "defaultFilters", "style", "pagination", "loading", "onChange", "onFilterChange", "selectOptions", "filtersConfig", "rowSelection", "setShowFilters", "rowKey", "showFilters", "hideOnLoading", "sourcesKey", "className", "projects", "t", "selectedProject", "sourceId", "projectSources", "language", "scrollX", "apiUrl", "app", "doEmptyRows"];
|
|
6027
6027
|
function DAFTable(_ref) {
|
|
6028
6028
|
let {
|
|
6029
6029
|
columns = [],
|
|
@@ -6054,7 +6054,7 @@ function DAFTable(_ref) {
|
|
|
6054
6054
|
app,
|
|
6055
6055
|
doEmptyRows
|
|
6056
6056
|
} = _ref,
|
|
6057
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
6057
|
+
rest = _objectWithoutProperties(_ref, _excluded$E);
|
|
6058
6058
|
const source = React.useMemo(() => {
|
|
6059
6059
|
if (data && Array.isArray(data)) {
|
|
6060
6060
|
return data;
|
|
@@ -6879,7 +6879,7 @@ function ComponentWithFocus(_ref) {
|
|
|
6879
6879
|
}
|
|
6880
6880
|
|
|
6881
6881
|
var _templateObject$h;
|
|
6882
|
-
const _excluded$
|
|
6882
|
+
const _excluded$D = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
|
|
6883
6883
|
function StickyTable(_ref) {
|
|
6884
6884
|
let {
|
|
6885
6885
|
size = "small",
|
|
@@ -6890,7 +6890,7 @@ function StickyTable(_ref) {
|
|
|
6890
6890
|
pagination = false,
|
|
6891
6891
|
doEmptyRows = true
|
|
6892
6892
|
} = _ref,
|
|
6893
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
6893
|
+
props = _objectWithoutProperties(_ref, _excluded$D);
|
|
6894
6894
|
const data = React__default["default"].useMemo(() => {
|
|
6895
6895
|
if (!doEmptyRows) {
|
|
6896
6896
|
return dataSource;
|
|
@@ -7418,7 +7418,7 @@ const BTN_SIZE = {
|
|
|
7418
7418
|
LG: 'large'
|
|
7419
7419
|
};
|
|
7420
7420
|
|
|
7421
|
-
const _excluded$
|
|
7421
|
+
const _excluded$C = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
|
|
7422
7422
|
function DafButton(_ref) {
|
|
7423
7423
|
let {
|
|
7424
7424
|
content = '',
|
|
@@ -7432,7 +7432,7 @@ function DafButton(_ref) {
|
|
|
7432
7432
|
style = {},
|
|
7433
7433
|
className = ''
|
|
7434
7434
|
} = _ref,
|
|
7435
|
-
restProps = _objectWithoutProperties(_ref, _excluded$
|
|
7435
|
+
restProps = _objectWithoutProperties(_ref, _excluded$C);
|
|
7436
7436
|
return /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
|
|
7437
7437
|
icon: icon,
|
|
7438
7438
|
type: type,
|
|
@@ -7551,12 +7551,12 @@ const Style$R = styled__default["default"].div`
|
|
|
7551
7551
|
}
|
|
7552
7552
|
`;
|
|
7553
7553
|
|
|
7554
|
-
const _excluded$
|
|
7554
|
+
const _excluded$B = ["children"];
|
|
7555
7555
|
const BorderedButton = _ref => {
|
|
7556
7556
|
let {
|
|
7557
7557
|
children
|
|
7558
7558
|
} = _ref,
|
|
7559
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
7559
|
+
props = _objectWithoutProperties(_ref, _excluded$B);
|
|
7560
7560
|
return /*#__PURE__*/jsxRuntime.jsx(Style$R, {
|
|
7561
7561
|
className: "d-btn-cont",
|
|
7562
7562
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -7696,12 +7696,12 @@ Badge.propTypes = {
|
|
|
7696
7696
|
props: PropTypes__default["default"].object
|
|
7697
7697
|
};
|
|
7698
7698
|
|
|
7699
|
-
const _excluded$
|
|
7699
|
+
const _excluded$A = ["icon"];
|
|
7700
7700
|
function GetIcon(_ref) {
|
|
7701
7701
|
let {
|
|
7702
7702
|
icon
|
|
7703
7703
|
} = _ref,
|
|
7704
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
7704
|
+
props = _objectWithoutProperties(_ref, _excluded$A);
|
|
7705
7705
|
let Icon = Icons__namespace.CloseOutlined;
|
|
7706
7706
|
if (Icons__namespace[icon]) {
|
|
7707
7707
|
Icon = Icons__namespace[icon];
|
|
@@ -8031,7 +8031,7 @@ const MultiSelectStyled = styled__default["default"](antd.Select)`
|
|
|
8031
8031
|
}
|
|
8032
8032
|
`;
|
|
8033
8033
|
|
|
8034
|
-
const _excluded$
|
|
8034
|
+
const _excluded$z = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
|
|
8035
8035
|
const {
|
|
8036
8036
|
useToken: useToken$n
|
|
8037
8037
|
} = antd.theme;
|
|
@@ -8124,7 +8124,7 @@ function Multiselect(_ref) {
|
|
|
8124
8124
|
isSingle = false,
|
|
8125
8125
|
selectionType = SELECTION_TYPES.DEFAULT
|
|
8126
8126
|
} = _ref,
|
|
8127
|
-
restProps = _objectWithoutProperties(_ref, _excluded$
|
|
8127
|
+
restProps = _objectWithoutProperties(_ref, _excluded$z);
|
|
8128
8128
|
const {
|
|
8129
8129
|
token
|
|
8130
8130
|
} = useToken$n();
|
|
@@ -8844,7 +8844,7 @@ DAFHeader.propTypes = {
|
|
|
8844
8844
|
filtersConfig: PropTypes__default["default"].any
|
|
8845
8845
|
};
|
|
8846
8846
|
|
|
8847
|
-
const _excluded$
|
|
8847
|
+
const _excluded$y = ["tabs", "onChange", "value", "className"];
|
|
8848
8848
|
function TabsHeader(_ref) {
|
|
8849
8849
|
let {
|
|
8850
8850
|
tabs = [],
|
|
@@ -8852,7 +8852,7 @@ function TabsHeader(_ref) {
|
|
|
8852
8852
|
value = '',
|
|
8853
8853
|
className = 'mt-2'
|
|
8854
8854
|
} = _ref,
|
|
8855
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
8855
|
+
rest = _objectWithoutProperties(_ref, _excluded$y);
|
|
8856
8856
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8857
8857
|
className: formatClassname(['daf-tabs-header pl-6 pr-6', className]),
|
|
8858
8858
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Tabs, _objectSpread2({
|
|
@@ -8949,7 +8949,7 @@ DrawerHeader.propTypes = {
|
|
|
8949
8949
|
tabsConfig: PropTypes__default["default"].any
|
|
8950
8950
|
};
|
|
8951
8951
|
|
|
8952
|
-
const _excluded$
|
|
8952
|
+
const _excluded$x = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
|
|
8953
8953
|
const useFooter = _ref => {
|
|
8954
8954
|
let {
|
|
8955
8955
|
leftContent,
|
|
@@ -8984,7 +8984,7 @@ const useFooter = _ref => {
|
|
|
8984
8984
|
style = {},
|
|
8985
8985
|
className = ""
|
|
8986
8986
|
} = button,
|
|
8987
|
-
restProps = _objectWithoutProperties(button, _excluded$
|
|
8987
|
+
restProps = _objectWithoutProperties(button, _excluded$x);
|
|
8988
8988
|
return /*#__PURE__*/jsxRuntime.jsx(DafButton, _objectSpread2({
|
|
8989
8989
|
content: label,
|
|
8990
8990
|
type: type,
|
|
@@ -11865,7 +11865,7 @@ Widget.propTypes = {
|
|
|
11865
11865
|
};
|
|
11866
11866
|
Widget.displayName = 'Widget';
|
|
11867
11867
|
|
|
11868
|
-
const _excluded$
|
|
11868
|
+
const _excluded$w = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
|
|
11869
11869
|
function ImageWidget(_ref) {
|
|
11870
11870
|
let {
|
|
11871
11871
|
loading = false,
|
|
@@ -11876,7 +11876,7 @@ function ImageWidget(_ref) {
|
|
|
11876
11876
|
noDescriptionText,
|
|
11877
11877
|
isPdf = false
|
|
11878
11878
|
} = _ref,
|
|
11879
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
11879
|
+
props = _objectWithoutProperties(_ref, _excluded$w);
|
|
11880
11880
|
const expandable = isPdf ? false : props.expandable;
|
|
11881
11881
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
11882
11882
|
loading: loading,
|
|
@@ -11936,7 +11936,7 @@ function ImageWidget(_ref) {
|
|
|
11936
11936
|
ImageWidget.displayName = 'ImageWidget';
|
|
11937
11937
|
|
|
11938
11938
|
var _templateObject$e;
|
|
11939
|
-
const _excluded$
|
|
11939
|
+
const _excluded$v = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
|
|
11940
11940
|
function FlowWidget(_ref) {
|
|
11941
11941
|
let {
|
|
11942
11942
|
title,
|
|
@@ -11948,7 +11948,7 @@ function FlowWidget(_ref) {
|
|
|
11948
11948
|
className,
|
|
11949
11949
|
direction = "horizontal"
|
|
11950
11950
|
} = _ref,
|
|
11951
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11951
|
+
rest = _objectWithoutProperties(_ref, _excluded$v);
|
|
11952
11952
|
const [activeTab, setActiveTab] = React.useState();
|
|
11953
11953
|
React.useEffect(() => {
|
|
11954
11954
|
if (defaultActiveTab) {
|
|
@@ -15679,7 +15679,7 @@ Map$3.propTypes = {
|
|
|
15679
15679
|
link: PropTypes__default["default"].any
|
|
15680
15680
|
};
|
|
15681
15681
|
|
|
15682
|
-
const _excluded$
|
|
15682
|
+
const _excluded$u = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
|
|
15683
15683
|
function InExpandableWidgetMap(_ref) {
|
|
15684
15684
|
let {
|
|
15685
15685
|
isExpanded,
|
|
@@ -15693,7 +15693,7 @@ function InExpandableWidgetMap(_ref) {
|
|
|
15693
15693
|
height,
|
|
15694
15694
|
widgetConfig
|
|
15695
15695
|
} = _ref,
|
|
15696
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
15696
|
+
rest = _objectWithoutProperties(_ref, _excluded$u);
|
|
15697
15697
|
const [mapKey, setMapKey] = React.useState(0);
|
|
15698
15698
|
const [isMapReady, setIsMapReady] = React.useState(false);
|
|
15699
15699
|
React.useEffect(() => {
|
|
@@ -17893,14 +17893,14 @@ const MapConfig = ({
|
|
|
17893
17893
|
});
|
|
17894
17894
|
};
|
|
17895
17895
|
|
|
17896
|
-
const _excluded$
|
|
17896
|
+
const _excluded$t = ["config", "title", "loading"];
|
|
17897
17897
|
const Details = _ref => {
|
|
17898
17898
|
let {
|
|
17899
17899
|
config = [],
|
|
17900
17900
|
title,
|
|
17901
17901
|
loading = false
|
|
17902
17902
|
} = _ref,
|
|
17903
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17903
|
+
rest = _objectWithoutProperties(_ref, _excluded$t);
|
|
17904
17904
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
17905
17905
|
className: "with-border-header h-w-btn-header card",
|
|
17906
17906
|
loading: loading,
|
|
@@ -17916,14 +17916,14 @@ const Details = _ref => {
|
|
|
17916
17916
|
}));
|
|
17917
17917
|
};
|
|
17918
17918
|
|
|
17919
|
-
const _excluded$
|
|
17919
|
+
const _excluded$s = ["config", "title", "loading"];
|
|
17920
17920
|
const KeyIndicatorsDetails = _ref => {
|
|
17921
17921
|
let {
|
|
17922
17922
|
config,
|
|
17923
17923
|
title,
|
|
17924
17924
|
loading = false
|
|
17925
17925
|
} = _ref,
|
|
17926
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17926
|
+
rest = _objectWithoutProperties(_ref, _excluded$s);
|
|
17927
17927
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
17928
17928
|
className: "with-border-header h-w-btn-header",
|
|
17929
17929
|
title: title,
|
|
@@ -17953,7 +17953,7 @@ const Style$G = styled__default["default"].div`
|
|
|
17953
17953
|
}
|
|
17954
17954
|
`;
|
|
17955
17955
|
|
|
17956
|
-
const _excluded$
|
|
17956
|
+
const _excluded$r = ["children", "config", "detailsTitle", "firstColumnWidth"];
|
|
17957
17957
|
const DetailsSection = _ref => {
|
|
17958
17958
|
let {
|
|
17959
17959
|
children,
|
|
@@ -17961,7 +17961,7 @@ const DetailsSection = _ref => {
|
|
|
17961
17961
|
detailsTitle,
|
|
17962
17962
|
firstColumnWidth = "250px"
|
|
17963
17963
|
} = _ref,
|
|
17964
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17964
|
+
rest = _objectWithoutProperties(_ref, _excluded$r);
|
|
17965
17965
|
return /*#__PURE__*/jsxRuntime.jsx(Style$G, {
|
|
17966
17966
|
firstColumnWidth: firstColumnWidth,
|
|
17967
17967
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -18137,14 +18137,14 @@ const getGoalConfig = () => {
|
|
|
18137
18137
|
};
|
|
18138
18138
|
|
|
18139
18139
|
var _templateObject$c;
|
|
18140
|
-
const _excluded$
|
|
18140
|
+
const _excluded$q = ["title", "activeSdgGoals", "t"];
|
|
18141
18141
|
function SDGWidget(_ref) {
|
|
18142
18142
|
let {
|
|
18143
18143
|
title = "Sustainable Development Goals",
|
|
18144
18144
|
activeSdgGoals = [],
|
|
18145
18145
|
t = key => key
|
|
18146
18146
|
} = _ref,
|
|
18147
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18147
|
+
props = _objectWithoutProperties(_ref, _excluded$q);
|
|
18148
18148
|
const sdgConfig = getGoalConfig();
|
|
18149
18149
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
18150
18150
|
title: title,
|
|
@@ -18442,7 +18442,7 @@ function SdgList({
|
|
|
18442
18442
|
});
|
|
18443
18443
|
}
|
|
18444
18444
|
|
|
18445
|
-
const _excluded$
|
|
18445
|
+
const _excluded$p = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
|
|
18446
18446
|
const {
|
|
18447
18447
|
Meta
|
|
18448
18448
|
} = antd.Card;
|
|
@@ -18462,7 +18462,7 @@ function ProjectWidget(_ref) {
|
|
|
18462
18462
|
hideSDGList = false,
|
|
18463
18463
|
t = x => x
|
|
18464
18464
|
} = _ref,
|
|
18465
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18465
|
+
props = _objectWithoutProperties(_ref, _excluded$p);
|
|
18466
18466
|
const [isHovered, setIsHovered] = React__default["default"].useState(false);
|
|
18467
18467
|
const {
|
|
18468
18468
|
token
|
|
@@ -18734,13 +18734,13 @@ const WidgetCard = _ref => {
|
|
|
18734
18734
|
});
|
|
18735
18735
|
};
|
|
18736
18736
|
|
|
18737
|
-
const _excluded$
|
|
18737
|
+
const _excluded$o = ["title", "children"];
|
|
18738
18738
|
const CarouselWidget = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
18739
18739
|
let {
|
|
18740
18740
|
title,
|
|
18741
18741
|
children
|
|
18742
18742
|
} = _ref,
|
|
18743
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
18743
|
+
rest = _objectWithoutProperties(_ref, _excluded$o);
|
|
18744
18744
|
/**
|
|
18745
18745
|
* Handles carousel slide change events
|
|
18746
18746
|
* @param {number} currentSlide - The index of the current slide after change
|
|
@@ -18904,7 +18904,7 @@ const EmptyStateContainer = styled__default["default"].div`
|
|
|
18904
18904
|
}
|
|
18905
18905
|
`;
|
|
18906
18906
|
|
|
18907
|
-
const _excluded$
|
|
18907
|
+
const _excluded$n = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
|
|
18908
18908
|
function ImageCarousel(_ref) {
|
|
18909
18909
|
let {
|
|
18910
18910
|
title,
|
|
@@ -18919,7 +18919,7 @@ function ImageCarousel(_ref) {
|
|
|
18919
18919
|
emptyLogo = antd.Empty.PRESENTED_IMAGE_SIMPLE,
|
|
18920
18920
|
emptyText = "No Image"
|
|
18921
18921
|
} = _ref,
|
|
18922
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
18922
|
+
rest = _objectWithoutProperties(_ref, _excluded$n);
|
|
18923
18923
|
const [previewVisible, setPreviewVisible] = React.useState(false);
|
|
18924
18924
|
const [current, setCurrent] = React.useState(0);
|
|
18925
18925
|
const carouselRef = React.useRef(null);
|
|
@@ -19288,7 +19288,7 @@ const getVegetationConfig = () => {
|
|
|
19288
19288
|
};
|
|
19289
19289
|
|
|
19290
19290
|
var _templateObject$a, _templateObject2$3;
|
|
19291
|
-
const _excluded$
|
|
19291
|
+
const _excluded$m = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
|
|
19292
19292
|
function VegetationWidget(_ref) {
|
|
19293
19293
|
let {
|
|
19294
19294
|
title = "Vegetation Health",
|
|
@@ -19300,19 +19300,12 @@ function VegetationWidget(_ref) {
|
|
|
19300
19300
|
growthObservations = [],
|
|
19301
19301
|
t = key => key
|
|
19302
19302
|
} = _ref,
|
|
19303
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19303
|
+
props = _objectWithoutProperties(_ref, _excluded$m);
|
|
19304
19304
|
let vegetationConfig = getVegetationConfig();
|
|
19305
|
-
|
|
19306
|
-
// Get all VEGETATION_KEYS values before filtering (needed for mapping check)
|
|
19307
19305
|
const allVegetationKeys = vegetationConfig.map(item => item.key);
|
|
19308
|
-
|
|
19309
|
-
// Filter to show only specific keys if filterKeys is provided
|
|
19310
19306
|
if (filterKeys && Array.isArray(filterKeys)) {
|
|
19311
19307
|
vegetationConfig = vegetationConfig.filter(item => filterKeys.includes(item.key));
|
|
19312
19308
|
}
|
|
19313
|
-
|
|
19314
|
-
// Map growthObservations to VEGETATION_KEYS
|
|
19315
|
-
// Handle both formats: growthObservations keys (e.g., "yellowing_leaves") and VEGETATION_KEYS (e.g., "yellowing")
|
|
19316
19309
|
const mappedGrowthObservations = Array.isArray(growthObservations) ? growthObservations.map(obs => {
|
|
19317
19310
|
// First try to map from growthObservations format
|
|
19318
19311
|
const mapped = GROWTH_OBSERVATIONS_TO_VEGETATION_KEYS[obs];
|
|
@@ -19423,7 +19416,7 @@ const getFaunaConfig = () => {
|
|
|
19423
19416
|
};
|
|
19424
19417
|
|
|
19425
19418
|
var _templateObject$9, _templateObject2$2;
|
|
19426
|
-
const _excluded$
|
|
19419
|
+
const _excluded$l = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
|
|
19427
19420
|
function FaunaWidget(_ref) {
|
|
19428
19421
|
let {
|
|
19429
19422
|
title = "Observed Fauna",
|
|
@@ -19434,7 +19427,7 @@ function FaunaWidget(_ref) {
|
|
|
19434
19427
|
itemHeight = 100,
|
|
19435
19428
|
t = key => key
|
|
19436
19429
|
} = _ref,
|
|
19437
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19430
|
+
props = _objectWithoutProperties(_ref, _excluded$l);
|
|
19438
19431
|
let faunaConfig = getFaunaConfig();
|
|
19439
19432
|
|
|
19440
19433
|
// Filter to show only specific keys if filterKeys is provided
|
|
@@ -19499,7 +19492,7 @@ const getInvasiveSpeciesConfig = () => {
|
|
|
19499
19492
|
};
|
|
19500
19493
|
|
|
19501
19494
|
var _templateObject$8, _templateObject2$1;
|
|
19502
|
-
const _excluded$
|
|
19495
|
+
const _excluded$k = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
|
|
19503
19496
|
function InvasiveSpeciesWidget(_ref) {
|
|
19504
19497
|
let {
|
|
19505
19498
|
title = "Invasive Species",
|
|
@@ -19511,7 +19504,7 @@ function InvasiveSpeciesWidget(_ref) {
|
|
|
19511
19504
|
itemHeight = 100,
|
|
19512
19505
|
t = key => key
|
|
19513
19506
|
} = _ref,
|
|
19514
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19507
|
+
props = _objectWithoutProperties(_ref, _excluded$k);
|
|
19515
19508
|
let invasiveSpeciesConfig = getInvasiveSpeciesConfig();
|
|
19516
19509
|
|
|
19517
19510
|
// Filter to show only specific keys if filterKeys is provided
|
|
@@ -24934,8 +24927,8 @@ const RepeatableModals = ({
|
|
|
24934
24927
|
}) : null;
|
|
24935
24928
|
};
|
|
24936
24929
|
|
|
24937
|
-
const _excluded$
|
|
24938
|
-
_excluded2$
|
|
24930
|
+
const _excluded$j = ["viewGroup"],
|
|
24931
|
+
_excluded2$1 = ["label", "icon", "position"];
|
|
24939
24932
|
const Content$1 = _ref => {
|
|
24940
24933
|
let {
|
|
24941
24934
|
style = {},
|
|
@@ -25006,7 +24999,7 @@ const Content$1 = _ref => {
|
|
|
25006
24999
|
if (groups[gKey].viewGroup === key) {
|
|
25007
25000
|
// eslint-disable-next-line no-unused-vars
|
|
25008
25001
|
const _groups$gKey = groups[gKey],
|
|
25009
|
-
gCfg = _objectWithoutProperties(_groups$gKey, _excluded$
|
|
25002
|
+
gCfg = _objectWithoutProperties(_groups$gKey, _excluded$j);
|
|
25010
25003
|
items[gKey] = gCfg;
|
|
25011
25004
|
}
|
|
25012
25005
|
return items;
|
|
@@ -25234,7 +25227,7 @@ const Content$1 = _ref => {
|
|
|
25234
25227
|
showIcon: true
|
|
25235
25228
|
});
|
|
25236
25229
|
}
|
|
25237
|
-
let groups = _objectWithoutProperties(f, _excluded2$
|
|
25230
|
+
let groups = _objectWithoutProperties(f, _excluded2$1);
|
|
25238
25231
|
groups = Object.keys(groups).reduce((items, key) => {
|
|
25239
25232
|
var _groups$key2;
|
|
25240
25233
|
if (!((_groups$key2 = groups[key]) !== null && _groups$key2 !== void 0 && (_groups$key2 = _groups$key2.meta) !== null && _groups$key2 !== void 0 && _groups$key2.excludeFromView)) {
|
|
@@ -25286,7 +25279,7 @@ const Content$1 = _ref => {
|
|
|
25286
25279
|
});
|
|
25287
25280
|
};
|
|
25288
25281
|
|
|
25289
|
-
const _excluded$
|
|
25282
|
+
const _excluded$i = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
|
|
25290
25283
|
function Modal(_ref) {
|
|
25291
25284
|
let {
|
|
25292
25285
|
t = text => text,
|
|
@@ -25302,7 +25295,7 @@ function Modal(_ref) {
|
|
|
25302
25295
|
disabled = false,
|
|
25303
25296
|
withModalFormWrapper = true
|
|
25304
25297
|
} = _ref,
|
|
25305
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
25298
|
+
props = _objectWithoutProperties(_ref, _excluded$i);
|
|
25306
25299
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Modal, _objectSpread2(_objectSpread2({
|
|
25307
25300
|
width: 650,
|
|
25308
25301
|
footer: null,
|
|
@@ -25876,6 +25869,7 @@ const getSourcesType = subject => {
|
|
|
25876
25869
|
locations: "location",
|
|
25877
25870
|
location: "location",
|
|
25878
25871
|
"production-sites": "location",
|
|
25872
|
+
scl: "location",
|
|
25879
25873
|
stakeholders: "stakeholder",
|
|
25880
25874
|
stakeholder: "stakeholder",
|
|
25881
25875
|
workers: "stakeholder",
|
|
@@ -25934,9 +25928,6 @@ const Records = _ref => {
|
|
|
25934
25928
|
source: selectedSource
|
|
25935
25929
|
}
|
|
25936
25930
|
});
|
|
25937
|
-
console.log({
|
|
25938
|
-
data
|
|
25939
|
-
});
|
|
25940
25931
|
setVersions(data);
|
|
25941
25932
|
} catch (error) {
|
|
25942
25933
|
console.error('Error fetching versions:', error);
|
|
@@ -35951,13 +35942,11 @@ const beforeUpload = allowedExtensions => file => {
|
|
|
35951
35942
|
};
|
|
35952
35943
|
const allowedImageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.avif', '.bmp', '.tiff', '.tif', '.heif', '.heic', '.svg', '.ico'];
|
|
35953
35944
|
|
|
35954
|
-
|
|
35955
|
-
_excluded2$1 = ["label", "description", "excludeFromEdit", "showFormIf", "icon", "position", "template", "formClass"];
|
|
35945
|
+
/* eslint-disable no-case-declarations */
|
|
35956
35946
|
dayjs__default["default"].extend(utc);
|
|
35957
35947
|
dayjs__default["default"].extend(timezone);
|
|
35958
35948
|
dayjs__default["default"].tz.setDefault("UTC");
|
|
35959
|
-
const getDefaultInputValue =
|
|
35960
|
-
let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
35949
|
+
const getDefaultInputValue = (input = {}) => {
|
|
35961
35950
|
let value = undefined;
|
|
35962
35951
|
if (input.type === "multiselect") {
|
|
35963
35952
|
value = [];
|
|
@@ -35975,30 +35964,33 @@ const checkCondition$1 = (condition, repeatValues, formsValue) => {
|
|
|
35975
35964
|
const isShown = _checkValue(isNotEmpty ? field : wantedValue, match, isNotEmpty ? formValue : value);
|
|
35976
35965
|
return isShown;
|
|
35977
35966
|
};
|
|
35978
|
-
const renderDataLinkGroup =
|
|
35979
|
-
|
|
35980
|
-
|
|
35981
|
-
|
|
35982
|
-
|
|
35983
|
-
|
|
35984
|
-
|
|
35985
|
-
|
|
35986
|
-
|
|
35987
|
-
|
|
35988
|
-
|
|
35989
|
-
|
|
35990
|
-
|
|
35991
|
-
const
|
|
35992
|
-
|
|
35993
|
-
return (input === null || input === void 0 || (_input$inputs$k = input.inputs[k]) === null || _input$inputs$k === void 0 ? void 0 : _input$inputs$k.type) === "dataLink";
|
|
35994
|
-
});
|
|
35995
|
-
const dataLinkInput = ((input === null || input === void 0 ? void 0 : input.inputs) || {})[dataLinkKey];
|
|
35996
|
-
const otherInputs = Object.keys((input === null || input === void 0 ? void 0 : input.inputs) || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
|
|
35997
|
-
all[key] = input === null || input === void 0 ? void 0 : input.inputs[key];
|
|
35967
|
+
const renderDataLinkGroup = ({
|
|
35968
|
+
input,
|
|
35969
|
+
groupFormId,
|
|
35970
|
+
name,
|
|
35971
|
+
formsValue,
|
|
35972
|
+
form,
|
|
35973
|
+
onValuesChange,
|
|
35974
|
+
setValues,
|
|
35975
|
+
changeLinking,
|
|
35976
|
+
isHighlighted
|
|
35977
|
+
}) => {
|
|
35978
|
+
const dataLinkKey = Object.keys(input?.inputs || {}).find(k => input?.inputs[k]?.type === "dataLink");
|
|
35979
|
+
const dataLinkInput = (input?.inputs || {})[dataLinkKey];
|
|
35980
|
+
const otherInputs = Object.keys(input?.inputs || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
|
|
35981
|
+
all[key] = input?.inputs[key];
|
|
35998
35982
|
return all;
|
|
35999
35983
|
}, {});
|
|
36000
|
-
const isSingle =
|
|
36001
|
-
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [
|
|
35984
|
+
const isSingle = input?.meta?.maxRepeat === 1;
|
|
35985
|
+
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
|
|
35986
|
+
...(formsValue[groupFormId] || {})[name]
|
|
35987
|
+
}] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
|
|
35988
|
+
...v
|
|
35989
|
+
})) : isSingle ? formsValue[name] ? [{
|
|
35990
|
+
...formsValue[name]
|
|
35991
|
+
}] : [] : getArray(formsValue[name] || []).map(v => ({
|
|
35992
|
+
...v
|
|
35993
|
+
}));
|
|
36002
35994
|
const onUpdate = (val, i) => {
|
|
36003
35995
|
const _val = isSingle ? {
|
|
36004
35996
|
[name]: val
|
|
@@ -36006,20 +35998,31 @@ const renderDataLinkGroup = _ref2 => {
|
|
|
36006
35998
|
[name]: formData.map((d, j) => i === j ? val : d)
|
|
36007
35999
|
};
|
|
36008
36000
|
if (groupFormId) {
|
|
36009
|
-
const _defaultData =
|
|
36010
|
-
const _newData =
|
|
36011
|
-
|
|
36001
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36002
|
+
const _newData = {
|
|
36003
|
+
..._defaultData,
|
|
36004
|
+
..._val
|
|
36005
|
+
};
|
|
36006
|
+
onValuesChange(_newData, {
|
|
36007
|
+
...formsValue,
|
|
36012
36008
|
[groupFormId]: _newData
|
|
36013
|
-
})
|
|
36014
|
-
form
|
|
36015
|
-
setValues(
|
|
36009
|
+
});
|
|
36010
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36011
|
+
setValues({
|
|
36012
|
+
...formsValue,
|
|
36016
36013
|
[groupFormId]: _newData
|
|
36017
|
-
})
|
|
36014
|
+
});
|
|
36018
36015
|
return;
|
|
36019
36016
|
}
|
|
36020
|
-
onValuesChange(_val,
|
|
36021
|
-
|
|
36022
|
-
|
|
36017
|
+
onValuesChange(_val, {
|
|
36018
|
+
...formsValue,
|
|
36019
|
+
..._val
|
|
36020
|
+
});
|
|
36021
|
+
form?.setFieldValue(name, _val[name]);
|
|
36022
|
+
setValues({
|
|
36023
|
+
...formsValue,
|
|
36024
|
+
..._val
|
|
36025
|
+
});
|
|
36023
36026
|
};
|
|
36024
36027
|
return /*#__PURE__*/jsxRuntime.jsx(DataLinkGroup, {
|
|
36025
36028
|
form: input,
|
|
@@ -36030,79 +36033,102 @@ const renderDataLinkGroup = _ref2 => {
|
|
|
36030
36033
|
isHighlighted: isHighlighted,
|
|
36031
36034
|
dataLinkInput: dataLinkInput,
|
|
36032
36035
|
formsValue: formsValue,
|
|
36033
|
-
values: groupFormId ?
|
|
36036
|
+
values: groupFormId ? {
|
|
36037
|
+
...(formsValue[groupFormId] || {}),
|
|
36034
36038
|
meta: {
|
|
36035
|
-
inputs: (
|
|
36039
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
36036
36040
|
}
|
|
36037
|
-
}
|
|
36041
|
+
} : formsValue,
|
|
36038
36042
|
name: name,
|
|
36039
36043
|
groupFormId: groupFormId,
|
|
36040
|
-
maxRepeat: input
|
|
36041
|
-
remove:
|
|
36042
|
-
|
|
36043
|
-
|
|
36044
|
-
} = _ref3;
|
|
36044
|
+
maxRepeat: input?.meta?.maxRepeat,
|
|
36045
|
+
remove: ({
|
|
36046
|
+
key
|
|
36047
|
+
}) => {
|
|
36045
36048
|
const _val = isSingle ? {
|
|
36046
36049
|
[name]: null
|
|
36047
36050
|
} : {
|
|
36048
36051
|
[name]: formData.filter((v, j) => j !== key)
|
|
36049
36052
|
};
|
|
36050
36053
|
if (groupFormId) {
|
|
36051
|
-
const _defaultData =
|
|
36052
|
-
const _newData =
|
|
36053
|
-
|
|
36054
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36055
|
+
const _newData = {
|
|
36056
|
+
..._defaultData,
|
|
36057
|
+
..._val
|
|
36058
|
+
};
|
|
36059
|
+
onValuesChange(_newData, {
|
|
36060
|
+
...formsValue,
|
|
36054
36061
|
[groupFormId]: _newData
|
|
36055
|
-
})
|
|
36056
|
-
form
|
|
36057
|
-
setValues(
|
|
36062
|
+
});
|
|
36063
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36064
|
+
setValues({
|
|
36065
|
+
...formsValue,
|
|
36058
36066
|
[groupFormId]: _newData
|
|
36059
|
-
})
|
|
36067
|
+
});
|
|
36060
36068
|
return;
|
|
36061
36069
|
}
|
|
36062
|
-
onValuesChange(_val,
|
|
36063
|
-
|
|
36064
|
-
|
|
36070
|
+
onValuesChange(_val, {
|
|
36071
|
+
...formsValue,
|
|
36072
|
+
..._val
|
|
36073
|
+
});
|
|
36074
|
+
form?.setFieldValue(name, _val[name]);
|
|
36075
|
+
setValues({
|
|
36076
|
+
...formsValue,
|
|
36077
|
+
..._val
|
|
36078
|
+
});
|
|
36065
36079
|
},
|
|
36066
36080
|
add: val => {
|
|
36067
36081
|
const _val = isSingle ? {
|
|
36068
36082
|
[name]: val
|
|
36069
36083
|
} : {
|
|
36070
|
-
[name]: [...formData,
|
|
36084
|
+
[name]: [...formData, {
|
|
36085
|
+
...val
|
|
36086
|
+
}]
|
|
36071
36087
|
};
|
|
36072
36088
|
if (groupFormId) {
|
|
36073
|
-
const _defaultData =
|
|
36074
|
-
const _newData =
|
|
36075
|
-
|
|
36076
|
-
|
|
36089
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36090
|
+
const _newData = {
|
|
36091
|
+
..._defaultData,
|
|
36092
|
+
..._val
|
|
36093
|
+
};
|
|
36094
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36095
|
+
onValuesChange(_newData, {
|
|
36096
|
+
...formsValue,
|
|
36077
36097
|
[groupFormId]: _newData
|
|
36078
|
-
})
|
|
36079
|
-
setValues(
|
|
36098
|
+
});
|
|
36099
|
+
setValues({
|
|
36100
|
+
...formsValue,
|
|
36080
36101
|
[groupFormId]: _newData
|
|
36081
|
-
})
|
|
36102
|
+
});
|
|
36082
36103
|
return;
|
|
36083
36104
|
}
|
|
36084
|
-
form
|
|
36085
|
-
onValuesChange(_val,
|
|
36086
|
-
|
|
36105
|
+
form?.setFieldValue(name, _val[name]);
|
|
36106
|
+
onValuesChange(_val, {
|
|
36107
|
+
...formsValue,
|
|
36108
|
+
..._val
|
|
36109
|
+
});
|
|
36110
|
+
setValues({
|
|
36111
|
+
...formsValue,
|
|
36112
|
+
..._val
|
|
36113
|
+
});
|
|
36087
36114
|
},
|
|
36088
36115
|
k: name,
|
|
36089
36116
|
formData: formData
|
|
36090
36117
|
});
|
|
36091
36118
|
};
|
|
36092
36119
|
function showHideInput$1(input, data, repeatIndex, repeatValues, inputMeta) {
|
|
36093
|
-
|
|
36094
|
-
if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
|
|
36120
|
+
if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
|
|
36095
36121
|
return false;
|
|
36096
36122
|
}
|
|
36097
|
-
if (typeof
|
|
36098
|
-
|
|
36099
|
-
return !(input !== null && input !== void 0 && (_input$meta4 = input.meta) !== null && _input$meta4 !== void 0 && _input$meta4.excludeFromEdit);
|
|
36123
|
+
if (typeof input?.meta?.excludeFromEdit === "boolean") {
|
|
36124
|
+
return !input?.meta?.excludeFromEdit;
|
|
36100
36125
|
}
|
|
36101
|
-
const formsValue =
|
|
36102
|
-
|
|
36103
|
-
|
|
36104
|
-
|
|
36105
|
-
|
|
36126
|
+
const formsValue = {
|
|
36127
|
+
...data
|
|
36128
|
+
};
|
|
36129
|
+
Object.keys(data?.meta?.inputs || {}).forEach(key => {
|
|
36130
|
+
const input = data?.meta?.inputs[key];
|
|
36131
|
+
if (input?.notApplicable || input?.notAvailable) {
|
|
36106
36132
|
formsValue[key] = undefined;
|
|
36107
36133
|
delete formsValue[key];
|
|
36108
36134
|
}
|
|
@@ -36161,35 +36187,35 @@ function getInputHeadLines$1(type, i, input, values) {
|
|
|
36161
36187
|
switch (type) {
|
|
36162
36188
|
case "h2":
|
|
36163
36189
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36164
|
-
className:
|
|
36190
|
+
className: `title-semibold-2 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36165
36191
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36166
36192
|
children: getInputLabel$1(input, values)
|
|
36167
36193
|
})
|
|
36168
36194
|
});
|
|
36169
36195
|
case "h3":
|
|
36170
36196
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36171
|
-
className:
|
|
36197
|
+
className: `title-semibold-3 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36172
36198
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36173
36199
|
children: getInputLabel$1(input, values)
|
|
36174
36200
|
})
|
|
36175
36201
|
});
|
|
36176
36202
|
case "h4":
|
|
36177
36203
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36178
|
-
className:
|
|
36204
|
+
className: `title-semibold-4 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36179
36205
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36180
36206
|
children: getInputLabel$1(input, values)
|
|
36181
36207
|
})
|
|
36182
36208
|
});
|
|
36183
36209
|
case "h5":
|
|
36184
36210
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36185
|
-
className:
|
|
36211
|
+
className: `title-semibold-5 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36186
36212
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36187
36213
|
children: getInputLabel$1(input, values)
|
|
36188
36214
|
})
|
|
36189
36215
|
});
|
|
36190
36216
|
case "h6":
|
|
36191
36217
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36192
|
-
className:
|
|
36218
|
+
className: `title-semibold-6 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36193
36219
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36194
36220
|
children: getInputLabel$1(input, values)
|
|
36195
36221
|
})
|
|
@@ -36198,16 +36224,15 @@ function getInputHeadLines$1(type, i, input, values) {
|
|
|
36198
36224
|
return null;
|
|
36199
36225
|
}
|
|
36200
36226
|
}
|
|
36201
|
-
function getInputProp(prop) {
|
|
36202
|
-
let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
36203
|
-
let scope = arguments.length > 2 ? arguments[2] : undefined;
|
|
36227
|
+
function getInputProp(prop, formsValue = {}, scope) {
|
|
36204
36228
|
if (prop && typeof prop === "object") {
|
|
36205
36229
|
const validations = Object.keys(prop);
|
|
36206
36230
|
const key = validations.find(v => {
|
|
36207
36231
|
let [path, match, wantedValue] = v.split(/( is | includes | not | notEmpty )/gim);
|
|
36208
|
-
const value = dot__default["default"].pick(path,
|
|
36232
|
+
const value = dot__default["default"].pick(path, {
|
|
36233
|
+
...formsValue,
|
|
36209
36234
|
scope
|
|
36210
|
-
})
|
|
36235
|
+
});
|
|
36211
36236
|
return _checkValue(wantedValue, match, value);
|
|
36212
36237
|
});
|
|
36213
36238
|
const label = key ? prop[key] : prop[validations[0]];
|
|
@@ -36216,33 +36241,29 @@ function getInputProp(prop) {
|
|
|
36216
36241
|
return prop;
|
|
36217
36242
|
}
|
|
36218
36243
|
}
|
|
36219
|
-
function getInputLabel$1(input) {
|
|
36220
|
-
let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
36221
|
-
let asText = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
36244
|
+
function getInputLabel$1(input, formsValue = {}, asText = false) {
|
|
36222
36245
|
return /*#__PURE__*/jsxRuntime.jsx(InputLabel, {
|
|
36223
36246
|
input: input,
|
|
36224
36247
|
formsValue: formsValue,
|
|
36225
36248
|
asText: asText
|
|
36226
36249
|
});
|
|
36227
36250
|
}
|
|
36228
|
-
const InputLabel =
|
|
36229
|
-
|
|
36230
|
-
|
|
36231
|
-
|
|
36232
|
-
|
|
36233
|
-
asText
|
|
36234
|
-
} = _ref4;
|
|
36251
|
+
const InputLabel = ({
|
|
36252
|
+
input,
|
|
36253
|
+
formsValue,
|
|
36254
|
+
asText
|
|
36255
|
+
}) => {
|
|
36235
36256
|
const {
|
|
36236
36257
|
t,
|
|
36237
36258
|
evaluationConfig,
|
|
36238
36259
|
scope
|
|
36239
36260
|
} = useEditContext();
|
|
36240
36261
|
const label = getInputProp(input.label, formsValue, scope);
|
|
36241
|
-
return input
|
|
36262
|
+
return input?.meta?.isEvaluation || input.description && typeof input.description === "string" && !asText ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
36242
36263
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
36243
36264
|
className: "flex",
|
|
36244
36265
|
children: [ReactHtmlParser__default["default"](label), /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
|
|
36245
|
-
content: input
|
|
36266
|
+
content: input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(EvaluationPopover, {
|
|
36246
36267
|
t: t,
|
|
36247
36268
|
evaluationConfig: evaluationConfig
|
|
36248
36269
|
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -36250,7 +36271,7 @@ const InputLabel = _ref4 => {
|
|
|
36250
36271
|
children: ReactHtmlParser__default["default"](input.description)
|
|
36251
36272
|
}),
|
|
36252
36273
|
placement: "top",
|
|
36253
|
-
children: !
|
|
36274
|
+
children: !input?.meta?.isEvaluation || evaluationConfig.length > 0 ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36254
36275
|
className: "flex flex-column justify-content-center ml-1",
|
|
36255
36276
|
children: /*#__PURE__*/jsxRuntime.jsx(TooltipIcon, {
|
|
36256
36277
|
fontSize: 13
|
|
@@ -36272,9 +36293,7 @@ function getSectionLabel$1(labels, values) {
|
|
|
36272
36293
|
}
|
|
36273
36294
|
return labels;
|
|
36274
36295
|
}
|
|
36275
|
-
function getSubtitles$1(subtitles, position) {
|
|
36276
|
-
let formsValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
36277
|
-
let repeatValues = arguments.length > 4 ? arguments[4] : undefined;
|
|
36296
|
+
function getSubtitles$1(subtitles, position, formsValue = {}, repeatIndex, repeatValues) {
|
|
36278
36297
|
let subtitle = subtitles && subtitles[position];
|
|
36279
36298
|
if (subtitle && typeof subtitle === "object") {
|
|
36280
36299
|
let newSubtitle = subtitle.default || "";
|
|
@@ -36318,12 +36337,14 @@ function getSubtitles$1(subtitles, position) {
|
|
|
36318
36337
|
function getFormTitles$1(titles, key, position) {
|
|
36319
36338
|
let tilte = titles && titles[key];
|
|
36320
36339
|
return tilte ? /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
36321
|
-
className:
|
|
36340
|
+
className: `title-semibold-3 mb0 ${position ? "mt-3" : ""}`,
|
|
36322
36341
|
children: tilte
|
|
36323
36342
|
}) : null;
|
|
36324
36343
|
}
|
|
36325
36344
|
const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsValue, name, mainForm) => {
|
|
36326
|
-
formsValue = Object.assign(formsValue,
|
|
36345
|
+
formsValue = Object.assign(formsValue, {
|
|
36346
|
+
...mainForm.getFieldsValue(true)
|
|
36347
|
+
});
|
|
36327
36348
|
if (typeof repeatIndex === "number" && repeatValues) {
|
|
36328
36349
|
if (!repeatValues[inputName] || !___default["default"].isEqual(repeatValues[inputName], value)) {
|
|
36329
36350
|
repeatValues[inputName] = value;
|
|
@@ -36358,16 +36379,14 @@ const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsVa
|
|
|
36358
36379
|
};
|
|
36359
36380
|
const inputOnBlur = [];
|
|
36360
36381
|
const inputTypeComponent$1 = {
|
|
36361
|
-
text: (
|
|
36362
|
-
|
|
36363
|
-
|
|
36364
|
-
|
|
36365
|
-
|
|
36366
|
-
|
|
36367
|
-
|
|
36368
|
-
|
|
36369
|
-
isHighlighted
|
|
36370
|
-
} = _ref6;
|
|
36382
|
+
text: ({
|
|
36383
|
+
props,
|
|
36384
|
+
rules
|
|
36385
|
+
}, {
|
|
36386
|
+
inputMeta = {},
|
|
36387
|
+
t,
|
|
36388
|
+
isHighlighted
|
|
36389
|
+
}) => {
|
|
36371
36390
|
const maxRule = rules.find(r => r.max);
|
|
36372
36391
|
const maxProps = {
|
|
36373
36392
|
maxLength: MAX_TEXT_AREA_LENGTH
|
|
@@ -36375,28 +36394,26 @@ const inputTypeComponent$1 = {
|
|
|
36375
36394
|
if (maxRule) {
|
|
36376
36395
|
maxProps.maxLength = maxRule.max;
|
|
36377
36396
|
}
|
|
36378
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input,
|
|
36379
|
-
size: "large"
|
|
36380
|
-
|
|
36397
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
36398
|
+
size: "large",
|
|
36399
|
+
...maxProps,
|
|
36381
36400
|
allowClear: true,
|
|
36382
36401
|
autoComplete: "new-password",
|
|
36383
|
-
type: "text"
|
|
36384
|
-
|
|
36402
|
+
type: "text",
|
|
36403
|
+
...props,
|
|
36385
36404
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36386
36405
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36387
36406
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
36388
|
-
})
|
|
36407
|
+
});
|
|
36389
36408
|
},
|
|
36390
|
-
link: (
|
|
36391
|
-
|
|
36392
|
-
|
|
36393
|
-
|
|
36394
|
-
|
|
36395
|
-
|
|
36396
|
-
|
|
36397
|
-
|
|
36398
|
-
isHighlighted
|
|
36399
|
-
} = _ref8;
|
|
36409
|
+
link: ({
|
|
36410
|
+
props,
|
|
36411
|
+
rules
|
|
36412
|
+
}, {
|
|
36413
|
+
inputMeta = {},
|
|
36414
|
+
t,
|
|
36415
|
+
isHighlighted
|
|
36416
|
+
}) => {
|
|
36400
36417
|
const maxRule = rules.find(r => r.max);
|
|
36401
36418
|
const maxProps = {
|
|
36402
36419
|
maxLength: MAX_TEXT_AREA_LENGTH
|
|
@@ -36404,32 +36421,29 @@ const inputTypeComponent$1 = {
|
|
|
36404
36421
|
if (maxRule) {
|
|
36405
36422
|
maxProps.maxLength = maxRule.max;
|
|
36406
36423
|
}
|
|
36407
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input,
|
|
36408
|
-
size: "large"
|
|
36409
|
-
|
|
36424
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
36425
|
+
size: "large",
|
|
36426
|
+
...maxProps,
|
|
36410
36427
|
allowClear: true,
|
|
36411
36428
|
autoComplete: "new-password",
|
|
36412
|
-
type: "text"
|
|
36413
|
-
|
|
36429
|
+
type: "text",
|
|
36430
|
+
...props,
|
|
36414
36431
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36415
36432
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36416
36433
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
36417
|
-
})
|
|
36434
|
+
});
|
|
36418
36435
|
},
|
|
36419
|
-
number: (
|
|
36420
|
-
|
|
36421
|
-
|
|
36422
|
-
|
|
36423
|
-
|
|
36424
|
-
|
|
36425
|
-
|
|
36426
|
-
|
|
36427
|
-
|
|
36428
|
-
t,
|
|
36429
|
-
isHighlighted
|
|
36430
|
-
} = _ref10;
|
|
36436
|
+
number: ({
|
|
36437
|
+
props,
|
|
36438
|
+
rules,
|
|
36439
|
+
input
|
|
36440
|
+
}, {
|
|
36441
|
+
inputMeta = {},
|
|
36442
|
+
t,
|
|
36443
|
+
isHighlighted
|
|
36444
|
+
}) => {
|
|
36431
36445
|
const maxRule = rules.find(r => r.max);
|
|
36432
|
-
const integerRule = !
|
|
36446
|
+
const integerRule = !input?.meta?.isDecimal;
|
|
36433
36447
|
const parser = value => {
|
|
36434
36448
|
if (!value) {
|
|
36435
36449
|
return "";
|
|
@@ -36440,63 +36454,60 @@ const inputTypeComponent$1 = {
|
|
|
36440
36454
|
return value.replace(/\$\s?|(,*)/g, "");
|
|
36441
36455
|
};
|
|
36442
36456
|
if (maxRule) {
|
|
36443
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber,
|
|
36457
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
36444
36458
|
size: "large",
|
|
36445
36459
|
allowClear: true,
|
|
36446
|
-
autoComplete: "new-password"
|
|
36447
|
-
|
|
36460
|
+
autoComplete: "new-password",
|
|
36461
|
+
...props,
|
|
36448
36462
|
type: "number",
|
|
36449
36463
|
parser: parser,
|
|
36450
36464
|
min: 0,
|
|
36451
36465
|
max: maxRule.max,
|
|
36452
36466
|
className: formatClassname([isHighlighted && "highlighted-input"])
|
|
36453
|
-
})
|
|
36467
|
+
});
|
|
36454
36468
|
}
|
|
36455
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber,
|
|
36469
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
36456
36470
|
size: "large",
|
|
36457
36471
|
allowClear: true,
|
|
36458
36472
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36459
|
-
autoComplete: "new-password"
|
|
36460
|
-
|
|
36473
|
+
autoComplete: "new-password",
|
|
36474
|
+
...props,
|
|
36461
36475
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36462
36476
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
|
|
36463
36477
|
min: 0,
|
|
36464
36478
|
formatter: value => numberWithCommas$1(value),
|
|
36465
36479
|
parser: parser
|
|
36466
|
-
})
|
|
36480
|
+
});
|
|
36467
36481
|
},
|
|
36468
36482
|
// eslint-disable-next-line no-unused-vars
|
|
36469
|
-
select: (
|
|
36470
|
-
|
|
36471
|
-
|
|
36472
|
-
|
|
36473
|
-
|
|
36474
|
-
|
|
36475
|
-
|
|
36476
|
-
|
|
36477
|
-
|
|
36478
|
-
|
|
36479
|
-
|
|
36480
|
-
|
|
36481
|
-
|
|
36482
|
-
|
|
36483
|
-
|
|
36484
|
-
|
|
36485
|
-
|
|
36486
|
-
|
|
36487
|
-
|
|
36488
|
-
|
|
36489
|
-
|
|
36490
|
-
|
|
36491
|
-
|
|
36492
|
-
|
|
36493
|
-
|
|
36494
|
-
|
|
36495
|
-
changeInputMeta,
|
|
36496
|
-
groupFormId
|
|
36497
|
-
} = _ref12;
|
|
36483
|
+
select: ({
|
|
36484
|
+
value,
|
|
36485
|
+
options,
|
|
36486
|
+
optionGroup,
|
|
36487
|
+
props,
|
|
36488
|
+
formsValue,
|
|
36489
|
+
optionsFilter,
|
|
36490
|
+
filterCond,
|
|
36491
|
+
repeatValues,
|
|
36492
|
+
repeatIndex,
|
|
36493
|
+
name,
|
|
36494
|
+
inputName,
|
|
36495
|
+
address,
|
|
36496
|
+
addressData,
|
|
36497
|
+
input,
|
|
36498
|
+
scope
|
|
36499
|
+
}, {
|
|
36500
|
+
forms,
|
|
36501
|
+
form,
|
|
36502
|
+
setAddress,
|
|
36503
|
+
inputMeta = {},
|
|
36504
|
+
t,
|
|
36505
|
+
isHighlighted,
|
|
36506
|
+
changeInputMeta,
|
|
36507
|
+
groupFormId
|
|
36508
|
+
}) => {
|
|
36498
36509
|
let opts;
|
|
36499
|
-
const isEvaluation = input
|
|
36510
|
+
const isEvaluation = input?.meta?.isEvaluation;
|
|
36500
36511
|
let defaultValue = value;
|
|
36501
36512
|
if (typeof options === "string") {
|
|
36502
36513
|
const [formName, key] = options.split(".");
|
|
@@ -36521,7 +36532,7 @@ const inputTypeComponent$1 = {
|
|
|
36521
36532
|
opts = [];
|
|
36522
36533
|
}
|
|
36523
36534
|
} else {
|
|
36524
|
-
opts = options
|
|
36535
|
+
opts = options?.filter(o => !o.onlyView);
|
|
36525
36536
|
}
|
|
36526
36537
|
opts = JSON.parse(JSON.stringify(opts || []));
|
|
36527
36538
|
opts = opts.map(o => getSelectOptions$2(o, formsValue));
|
|
@@ -36531,7 +36542,7 @@ const inputTypeComponent$1 = {
|
|
|
36531
36542
|
const uniqueDefaultKeys = getUniqueDefaultKeys(options);
|
|
36532
36543
|
|
|
36533
36544
|
// Handle default value logic
|
|
36534
|
-
if (!propHasValue$1(value) && propHasValue$1(input
|
|
36545
|
+
if (!propHasValue$1(value) && propHasValue$1(input?.meta?.defaultValue)) {
|
|
36535
36546
|
// If no current value but there's a default value, use the default
|
|
36536
36547
|
value = input.meta.defaultValue;
|
|
36537
36548
|
defaultValue = value;
|
|
@@ -36564,7 +36575,7 @@ const inputTypeComponent$1 = {
|
|
|
36564
36575
|
}
|
|
36565
36576
|
opts = groupOptions;
|
|
36566
36577
|
}
|
|
36567
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select,
|
|
36578
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
36568
36579
|
size: "large",
|
|
36569
36580
|
autoComplete: "new-password",
|
|
36570
36581
|
allowClear: true,
|
|
@@ -36573,32 +36584,35 @@ const inputTypeComponent$1 = {
|
|
|
36573
36584
|
value: value // Use value instead of defaultValue for controlled behavior
|
|
36574
36585
|
,
|
|
36575
36586
|
filterOption: filterSelectOptions,
|
|
36576
|
-
optionFilterProp: "children"
|
|
36577
|
-
|
|
36587
|
+
optionFilterProp: "children",
|
|
36588
|
+
...props,
|
|
36578
36589
|
className: formatClassname([isHighlighted && "highlighted-select"]),
|
|
36579
36590
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36580
36591
|
placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select one option"),
|
|
36581
36592
|
onChange: (val, selectedValue) => {
|
|
36582
36593
|
// ONLY FOR SBG EVALUATON !!
|
|
36583
36594
|
if (isEvaluation && val === "na" && groupFormId) {
|
|
36584
|
-
var _formsValue$meta2;
|
|
36585
36595
|
changeInputMeta({
|
|
36586
36596
|
key: groupFormId,
|
|
36587
|
-
value:
|
|
36597
|
+
value: {
|
|
36598
|
+
...(formsValue?.meta?.inputs?.[groupFormId] || {}),
|
|
36588
36599
|
documentation: {
|
|
36589
36600
|
notApplicable: true
|
|
36590
36601
|
}
|
|
36591
|
-
}
|
|
36602
|
+
},
|
|
36592
36603
|
otherValues: {
|
|
36593
|
-
[groupFormId]:
|
|
36604
|
+
[groupFormId]: {
|
|
36605
|
+
...(formsValue?.[groupFormId] || {}),
|
|
36594
36606
|
[name]: val
|
|
36595
|
-
}
|
|
36607
|
+
}
|
|
36596
36608
|
}
|
|
36597
36609
|
});
|
|
36598
36610
|
}
|
|
36599
36611
|
if (address && selectedValue) {
|
|
36600
36612
|
dot__default["default"].str(address, selectedValue.children, addressData);
|
|
36601
|
-
setAddress(
|
|
36613
|
+
setAddress({
|
|
36614
|
+
...addressData
|
|
36615
|
+
});
|
|
36602
36616
|
}
|
|
36603
36617
|
if (props.onChange) {
|
|
36604
36618
|
props.onChange(val);
|
|
@@ -36629,15 +36643,15 @@ const inputTypeComponent$1 = {
|
|
|
36629
36643
|
if (og.disabled !== undefined) {
|
|
36630
36644
|
groupOtherProps.disabled = og.disabled;
|
|
36631
36645
|
}
|
|
36632
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36633
|
-
value: og.value
|
|
36634
|
-
|
|
36646
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36647
|
+
value: og.value,
|
|
36648
|
+
...groupOtherProps,
|
|
36635
36649
|
children: og.label
|
|
36636
|
-
}
|
|
36650
|
+
}, `${i}${j}`);
|
|
36637
36651
|
})
|
|
36638
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36639
|
-
value: option.value
|
|
36640
|
-
|
|
36652
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36653
|
+
value: option.value,
|
|
36654
|
+
...otherProps,
|
|
36641
36655
|
children: isEvaluation ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
36642
36656
|
className: "flex",
|
|
36643
36657
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -36645,35 +36659,33 @@ const inputTypeComponent$1 = {
|
|
|
36645
36659
|
children: sgbEvaluationIcons[option.value]
|
|
36646
36660
|
}), option.label]
|
|
36647
36661
|
}) : option.label
|
|
36648
|
-
}
|
|
36662
|
+
}, option.value);
|
|
36649
36663
|
})
|
|
36650
|
-
})
|
|
36664
|
+
});
|
|
36651
36665
|
},
|
|
36652
|
-
multiselect: (
|
|
36653
|
-
|
|
36654
|
-
|
|
36655
|
-
|
|
36656
|
-
|
|
36657
|
-
|
|
36658
|
-
|
|
36659
|
-
|
|
36660
|
-
|
|
36661
|
-
|
|
36662
|
-
|
|
36663
|
-
|
|
36664
|
-
|
|
36665
|
-
|
|
36666
|
-
|
|
36667
|
-
|
|
36668
|
-
|
|
36669
|
-
|
|
36670
|
-
|
|
36671
|
-
|
|
36672
|
-
|
|
36673
|
-
|
|
36674
|
-
|
|
36675
|
-
isHighlighted
|
|
36676
|
-
} = _ref14;
|
|
36666
|
+
multiselect: ({
|
|
36667
|
+
value,
|
|
36668
|
+
options,
|
|
36669
|
+
optionGroup,
|
|
36670
|
+
optionsFilter,
|
|
36671
|
+
filterCond,
|
|
36672
|
+
props,
|
|
36673
|
+
formsValue,
|
|
36674
|
+
repeatValues,
|
|
36675
|
+
repeatIndex,
|
|
36676
|
+
inputName,
|
|
36677
|
+
name,
|
|
36678
|
+
tags,
|
|
36679
|
+
maxWidth,
|
|
36680
|
+
staticWidth,
|
|
36681
|
+
fullWidth
|
|
36682
|
+
}, {
|
|
36683
|
+
forms,
|
|
36684
|
+
form,
|
|
36685
|
+
inputMeta = {},
|
|
36686
|
+
t,
|
|
36687
|
+
isHighlighted
|
|
36688
|
+
}) => {
|
|
36677
36689
|
let opts;
|
|
36678
36690
|
if (typeof options === "string") {
|
|
36679
36691
|
const [formName, key] = options.split(".");
|
|
@@ -36735,17 +36747,17 @@ const inputTypeComponent$1 = {
|
|
|
36735
36747
|
staticWidth,
|
|
36736
36748
|
fullWidth
|
|
36737
36749
|
});
|
|
36738
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select,
|
|
36750
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
36739
36751
|
size: "medium",
|
|
36740
36752
|
allowClear: true,
|
|
36741
36753
|
autoComplete: "new-password",
|
|
36742
36754
|
mode: tags ? "tags" : "multiple",
|
|
36743
|
-
optionFilterProp: "children"
|
|
36744
|
-
|
|
36745
|
-
|
|
36746
|
-
|
|
36747
|
-
filterOption: filterSelectOptions
|
|
36748
|
-
|
|
36755
|
+
optionFilterProp: "children",
|
|
36756
|
+
...(tags ? {
|
|
36757
|
+
tokenSeparators: [","]
|
|
36758
|
+
} : {}),
|
|
36759
|
+
filterOption: filterSelectOptions,
|
|
36760
|
+
...props,
|
|
36749
36761
|
className: formatClassname([isHighlighted && "highlighted-select"]),
|
|
36750
36762
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36751
36763
|
placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select all relevant options"),
|
|
@@ -36784,52 +36796,51 @@ const inputTypeComponent$1 = {
|
|
|
36784
36796
|
if (og.disabled !== undefined) {
|
|
36785
36797
|
groupOtherProps.disabled = og.disabled;
|
|
36786
36798
|
}
|
|
36787
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36788
|
-
value: og.value
|
|
36789
|
-
|
|
36799
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36800
|
+
value: og.value,
|
|
36801
|
+
...groupOtherProps,
|
|
36790
36802
|
children: og.label
|
|
36791
|
-
}
|
|
36803
|
+
}, `${i}${j}`);
|
|
36792
36804
|
})
|
|
36793
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36794
|
-
value: option.value
|
|
36795
|
-
|
|
36805
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36806
|
+
value: option.value,
|
|
36807
|
+
...otherProps,
|
|
36796
36808
|
children: option.label
|
|
36797
|
-
}
|
|
36809
|
+
}, i);
|
|
36798
36810
|
})
|
|
36799
|
-
})
|
|
36811
|
+
});
|
|
36800
36812
|
},
|
|
36801
|
-
date: (
|
|
36802
|
-
|
|
36803
|
-
|
|
36804
|
-
|
|
36805
|
-
|
|
36806
|
-
|
|
36807
|
-
|
|
36808
|
-
|
|
36809
|
-
|
|
36810
|
-
|
|
36811
|
-
|
|
36812
|
-
|
|
36813
|
-
|
|
36814
|
-
|
|
36815
|
-
isHighlighted,
|
|
36816
|
-
groupFormId
|
|
36817
|
-
} = _ref16;
|
|
36813
|
+
date: ({
|
|
36814
|
+
props,
|
|
36815
|
+
rules,
|
|
36816
|
+
repeatValues,
|
|
36817
|
+
formsValue,
|
|
36818
|
+
name
|
|
36819
|
+
}, {
|
|
36820
|
+
setFormValues,
|
|
36821
|
+
inputMeta,
|
|
36822
|
+
form,
|
|
36823
|
+
t,
|
|
36824
|
+
isHighlighted,
|
|
36825
|
+
groupFormId
|
|
36826
|
+
}) => {
|
|
36818
36827
|
const lng = localStorage.getItem("datastakeLng") || "en";
|
|
36819
36828
|
const maxRule = rules.find(r => r.max);
|
|
36820
|
-
let value = groupFormId ? formsValue
|
|
36829
|
+
let value = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue[name];
|
|
36821
36830
|
const handleDateChange = date => {
|
|
36822
36831
|
if (date) {
|
|
36823
36832
|
// const localDate = dayjs.utc(date).add(dayjs(date).utcOffset(), 'minutes');
|
|
36824
36833
|
const localDate = dayjs__default["default"].utc(date);
|
|
36825
36834
|
if (groupFormId) {
|
|
36826
|
-
const _new =
|
|
36835
|
+
const _new = {
|
|
36836
|
+
...(formsValue[groupFormId] || {}),
|
|
36827
36837
|
[name]: localDate
|
|
36828
|
-
}
|
|
36838
|
+
};
|
|
36829
36839
|
form.setFieldValue(groupFormId, _new);
|
|
36830
|
-
setFormValues(
|
|
36840
|
+
setFormValues({
|
|
36841
|
+
...formsValue,
|
|
36831
36842
|
[groupFormId]: _new
|
|
36832
|
-
})
|
|
36843
|
+
});
|
|
36833
36844
|
} else {
|
|
36834
36845
|
form.setFieldValue(name, localDate);
|
|
36835
36846
|
}
|
|
@@ -36838,13 +36849,15 @@ const inputTypeComponent$1 = {
|
|
|
36838
36849
|
if (groupFormId) {
|
|
36839
36850
|
if (typeof value === "string" || typeof value === "undefined") {
|
|
36840
36851
|
value = typeof value === "string" ? dayjs__default["default"].utc(value) : null;
|
|
36841
|
-
const _new =
|
|
36852
|
+
const _new = {
|
|
36853
|
+
...(formsValue[groupFormId] || {}),
|
|
36842
36854
|
[name]: value
|
|
36843
|
-
}
|
|
36855
|
+
};
|
|
36844
36856
|
form.setFieldValue(groupFormId, _new);
|
|
36845
|
-
setFormValues(
|
|
36857
|
+
setFormValues({
|
|
36858
|
+
...formsValue,
|
|
36846
36859
|
[groupFormId]: _new
|
|
36847
|
-
})
|
|
36860
|
+
});
|
|
36848
36861
|
}
|
|
36849
36862
|
} else {
|
|
36850
36863
|
if (typeof value === "string") {
|
|
@@ -36860,13 +36873,12 @@ const inputTypeComponent$1 = {
|
|
|
36860
36873
|
checkForMax = checkCondition$1(maxRule.condition, repeatValues, formsValue);
|
|
36861
36874
|
}
|
|
36862
36875
|
if (checkForMax) {
|
|
36863
|
-
|
|
36864
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
|
|
36876
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
36865
36877
|
size: "large",
|
|
36866
36878
|
allowClear: true,
|
|
36867
|
-
autoComplete: "new-password"
|
|
36868
|
-
|
|
36869
|
-
value: value ? dayjs__default["default"](
|
|
36879
|
+
autoComplete: "new-password",
|
|
36880
|
+
...props,
|
|
36881
|
+
value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
|
|
36870
36882
|
onChange: handleDateChange,
|
|
36871
36883
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36872
36884
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
@@ -36876,54 +36888,49 @@ const inputTypeComponent$1 = {
|
|
|
36876
36888
|
disabledDate: current => {
|
|
36877
36889
|
return current && current >= dayjs__default["default"]().endOf("day");
|
|
36878
36890
|
}
|
|
36879
|
-
})
|
|
36891
|
+
});
|
|
36880
36892
|
}
|
|
36881
36893
|
}
|
|
36882
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker,
|
|
36894
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
36883
36895
|
size: "large",
|
|
36884
36896
|
allowClear: true,
|
|
36885
|
-
autoComplete: "new-password"
|
|
36886
|
-
|
|
36887
|
-
value: value ? dayjs__default["default"](
|
|
36897
|
+
autoComplete: "new-password",
|
|
36898
|
+
...props,
|
|
36899
|
+
value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
|
|
36888
36900
|
onChange: handleDateChange,
|
|
36889
36901
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36890
36902
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36891
36903
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder,
|
|
36892
36904
|
format: DATE_FORMATS,
|
|
36893
36905
|
locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"]
|
|
36894
|
-
})
|
|
36906
|
+
});
|
|
36895
36907
|
},
|
|
36896
|
-
groupExpandable: (
|
|
36897
|
-
|
|
36898
|
-
|
|
36899
|
-
|
|
36900
|
-
|
|
36901
|
-
|
|
36902
|
-
|
|
36903
|
-
|
|
36904
|
-
groupFormId
|
|
36905
|
-
} = _ref18;
|
|
36906
|
-
const data = groupFormId ? formsValue === null || formsValue === void 0 || (_formsValue$groupForm2 = formsValue[groupFormId]) === null || _formsValue$groupForm2 === void 0 ? void 0 : _formsValue$groupForm2[name] : formsValue === null || formsValue === void 0 ? void 0 : formsValue[name];
|
|
36908
|
+
groupExpandable: ({
|
|
36909
|
+
formsValue,
|
|
36910
|
+
name,
|
|
36911
|
+
input
|
|
36912
|
+
}, {
|
|
36913
|
+
groupFormId
|
|
36914
|
+
}) => {
|
|
36915
|
+
const data = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue?.[name];
|
|
36907
36916
|
return /*#__PURE__*/jsxRuntime.jsx(GroupExpandable, {
|
|
36908
36917
|
input: input,
|
|
36909
36918
|
formsValue: formsValue,
|
|
36910
36919
|
data: data
|
|
36911
36920
|
});
|
|
36912
36921
|
},
|
|
36913
|
-
comment: (
|
|
36914
|
-
|
|
36915
|
-
|
|
36916
|
-
|
|
36917
|
-
|
|
36918
|
-
|
|
36919
|
-
|
|
36920
|
-
|
|
36921
|
-
|
|
36922
|
-
|
|
36923
|
-
|
|
36924
|
-
|
|
36925
|
-
} = _ref20;
|
|
36926
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
|
|
36922
|
+
comment: ({
|
|
36923
|
+
props: {
|
|
36924
|
+
placeholder,
|
|
36925
|
+
...props
|
|
36926
|
+
},
|
|
36927
|
+
commentHint
|
|
36928
|
+
}, {
|
|
36929
|
+
onChange,
|
|
36930
|
+
value,
|
|
36931
|
+
isHighlighted
|
|
36932
|
+
}) => {
|
|
36933
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
|
|
36927
36934
|
allowClear: true,
|
|
36928
36935
|
value: value,
|
|
36929
36936
|
onChange: e => onChange(e.target.value),
|
|
@@ -36934,27 +36941,26 @@ const inputTypeComponent$1 = {
|
|
|
36934
36941
|
autoSize: {
|
|
36935
36942
|
minRows: 5,
|
|
36936
36943
|
maxRows: 5
|
|
36937
|
-
}
|
|
36938
|
-
|
|
36944
|
+
},
|
|
36945
|
+
...props,
|
|
36939
36946
|
disabled: false
|
|
36940
|
-
})
|
|
36947
|
+
});
|
|
36941
36948
|
},
|
|
36942
|
-
tableComment: (
|
|
36943
|
-
|
|
36944
|
-
|
|
36945
|
-
|
|
36946
|
-
|
|
36947
|
-
|
|
36948
|
-
|
|
36949
|
-
|
|
36950
|
-
|
|
36951
|
-
|
|
36952
|
-
|
|
36953
|
-
|
|
36954
|
-
} = _ref22;
|
|
36955
|
-
const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => _objectSpread2(_objectSpread2({}, v), {}, {
|
|
36949
|
+
tableComment: ({
|
|
36950
|
+
setValues,
|
|
36951
|
+
name,
|
|
36952
|
+
onValuesChange,
|
|
36953
|
+
formsValue
|
|
36954
|
+
}, {
|
|
36955
|
+
form,
|
|
36956
|
+
groupFormId,
|
|
36957
|
+
isHighlighted
|
|
36958
|
+
}) => {
|
|
36959
|
+
const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => ({
|
|
36960
|
+
...v,
|
|
36956
36961
|
key: i
|
|
36957
|
-
})) : (formsValue[name] || []).map((v, i) =>
|
|
36962
|
+
})) : (formsValue[name] || []).map((v, i) => ({
|
|
36963
|
+
...v,
|
|
36958
36964
|
key: i
|
|
36959
36965
|
}));
|
|
36960
36966
|
const onUpdate = (val, i) => {
|
|
@@ -36962,89 +36968,121 @@ const inputTypeComponent$1 = {
|
|
|
36962
36968
|
[name]: formData.map((d, j) => i === j ? val : d)
|
|
36963
36969
|
};
|
|
36964
36970
|
if (groupFormId) {
|
|
36965
|
-
const _defaultData =
|
|
36966
|
-
const _newData =
|
|
36967
|
-
|
|
36971
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36972
|
+
const _newData = {
|
|
36973
|
+
..._defaultData,
|
|
36974
|
+
..._val
|
|
36975
|
+
};
|
|
36976
|
+
onValuesChange(_newData, {
|
|
36977
|
+
...formsValue,
|
|
36968
36978
|
[groupFormId]: _newData
|
|
36969
|
-
})
|
|
36970
|
-
form
|
|
36971
|
-
setValues(
|
|
36979
|
+
});
|
|
36980
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36981
|
+
setValues({
|
|
36982
|
+
...formsValue,
|
|
36972
36983
|
[groupFormId]: _newData
|
|
36973
|
-
})
|
|
36984
|
+
});
|
|
36974
36985
|
return;
|
|
36975
36986
|
}
|
|
36976
|
-
onValuesChange(_val,
|
|
36977
|
-
|
|
36978
|
-
|
|
36987
|
+
onValuesChange(_val, {
|
|
36988
|
+
...formsValue,
|
|
36989
|
+
..._val
|
|
36990
|
+
});
|
|
36991
|
+
form?.setFieldValue(name, _val[name]);
|
|
36992
|
+
setValues({
|
|
36993
|
+
...formsValue,
|
|
36994
|
+
..._val
|
|
36995
|
+
});
|
|
36979
36996
|
};
|
|
36980
36997
|
return /*#__PURE__*/jsxRuntime.jsx(Comment, {
|
|
36981
36998
|
onUpdate: onUpdate,
|
|
36982
36999
|
isHighlighted: isHighlighted,
|
|
36983
37000
|
form: form,
|
|
36984
|
-
values: groupFormId ?
|
|
37001
|
+
values: groupFormId ? {
|
|
37002
|
+
...(formsValue[groupFormId] || {}),
|
|
36985
37003
|
meta: {
|
|
36986
|
-
inputs: (
|
|
37004
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
36987
37005
|
}
|
|
36988
|
-
}
|
|
37006
|
+
} : formsValue,
|
|
36989
37007
|
name: name,
|
|
36990
|
-
remove:
|
|
36991
|
-
|
|
36992
|
-
|
|
36993
|
-
} = _ref23;
|
|
37008
|
+
remove: ({
|
|
37009
|
+
key
|
|
37010
|
+
}) => {
|
|
36994
37011
|
const _val = {
|
|
36995
37012
|
[name]: formData.filter(v => v.key !== key)
|
|
36996
37013
|
};
|
|
36997
37014
|
if (groupFormId) {
|
|
36998
|
-
const _defaultData =
|
|
36999
|
-
const _newData =
|
|
37000
|
-
|
|
37015
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
37016
|
+
const _newData = {
|
|
37017
|
+
..._defaultData,
|
|
37018
|
+
..._val
|
|
37019
|
+
};
|
|
37020
|
+
onValuesChange(_newData, {
|
|
37021
|
+
...formsValue,
|
|
37001
37022
|
[groupFormId]: _newData
|
|
37002
|
-
})
|
|
37003
|
-
form
|
|
37004
|
-
setValues(
|
|
37023
|
+
});
|
|
37024
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
37025
|
+
setValues({
|
|
37026
|
+
...formsValue,
|
|
37005
37027
|
[groupFormId]: _newData
|
|
37006
|
-
})
|
|
37028
|
+
});
|
|
37007
37029
|
return;
|
|
37008
37030
|
}
|
|
37009
|
-
onValuesChange(_val,
|
|
37010
|
-
|
|
37011
|
-
|
|
37031
|
+
onValuesChange(_val, {
|
|
37032
|
+
...formsValue,
|
|
37033
|
+
..._val
|
|
37034
|
+
});
|
|
37035
|
+
form?.setFieldValue(name, _val[name]);
|
|
37036
|
+
setValues({
|
|
37037
|
+
...formsValue,
|
|
37038
|
+
..._val
|
|
37039
|
+
});
|
|
37012
37040
|
},
|
|
37013
37041
|
add: val => {
|
|
37014
37042
|
const _val = {
|
|
37015
|
-
[name]: [...formData,
|
|
37043
|
+
[name]: [...formData, {
|
|
37044
|
+
...val,
|
|
37016
37045
|
key: formData.length
|
|
37017
|
-
}
|
|
37046
|
+
}]
|
|
37018
37047
|
};
|
|
37019
37048
|
if (groupFormId) {
|
|
37020
|
-
const _defaultData =
|
|
37021
|
-
const _newData =
|
|
37022
|
-
|
|
37023
|
-
|
|
37049
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
37050
|
+
const _newData = {
|
|
37051
|
+
..._defaultData,
|
|
37052
|
+
..._val
|
|
37053
|
+
};
|
|
37054
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
37055
|
+
onValuesChange(_newData, {
|
|
37056
|
+
...formsValue,
|
|
37024
37057
|
[groupFormId]: _newData
|
|
37025
|
-
})
|
|
37026
|
-
setValues(
|
|
37058
|
+
});
|
|
37059
|
+
setValues({
|
|
37060
|
+
...formsValue,
|
|
37027
37061
|
[groupFormId]: _newData
|
|
37028
|
-
})
|
|
37062
|
+
});
|
|
37029
37063
|
return;
|
|
37030
37064
|
}
|
|
37031
|
-
form
|
|
37032
|
-
onValuesChange(_val,
|
|
37033
|
-
|
|
37065
|
+
form?.setFieldValue(name, _val[name]);
|
|
37066
|
+
onValuesChange(_val, {
|
|
37067
|
+
...formsValue,
|
|
37068
|
+
..._val
|
|
37069
|
+
});
|
|
37070
|
+
setValues({
|
|
37071
|
+
...formsValue,
|
|
37072
|
+
..._val
|
|
37073
|
+
});
|
|
37034
37074
|
},
|
|
37035
37075
|
k: name
|
|
37036
37076
|
});
|
|
37037
37077
|
},
|
|
37038
|
-
textarea: (
|
|
37039
|
-
|
|
37040
|
-
|
|
37041
|
-
|
|
37042
|
-
|
|
37043
|
-
|
|
37044
|
-
|
|
37045
|
-
|
|
37046
|
-
isHighlighted
|
|
37047
|
-
} = _ref25;
|
|
37078
|
+
textarea: ({
|
|
37079
|
+
props,
|
|
37080
|
+
rules
|
|
37081
|
+
}, {
|
|
37082
|
+
inputMeta,
|
|
37083
|
+
t,
|
|
37084
|
+
isHighlighted
|
|
37085
|
+
}) => {
|
|
37048
37086
|
const maxRule = rules.find(r => r.max);
|
|
37049
37087
|
let maxLength = MAX_TEXT_AREA_LENGTH;
|
|
37050
37088
|
let rows = 5;
|
|
@@ -37071,7 +37109,7 @@ const inputTypeComponent$1 = {
|
|
|
37071
37109
|
// rows = 14;
|
|
37072
37110
|
// }
|
|
37073
37111
|
}
|
|
37074
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea,
|
|
37112
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
|
|
37075
37113
|
allowClear: true,
|
|
37076
37114
|
autoComplete: "new-password",
|
|
37077
37115
|
maxLength: maxLength,
|
|
@@ -37079,37 +37117,35 @@ const inputTypeComponent$1 = {
|
|
|
37079
37117
|
autoSize: {
|
|
37080
37118
|
minRows: rows,
|
|
37081
37119
|
maxRows: rows
|
|
37082
|
-
}
|
|
37083
|
-
|
|
37120
|
+
},
|
|
37121
|
+
...props,
|
|
37084
37122
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
37085
37123
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
37086
|
-
})
|
|
37124
|
+
});
|
|
37087
37125
|
},
|
|
37088
|
-
phoneNumber: (
|
|
37089
|
-
|
|
37090
|
-
|
|
37091
|
-
|
|
37092
|
-
|
|
37093
|
-
|
|
37094
|
-
|
|
37095
|
-
|
|
37096
|
-
|
|
37097
|
-
|
|
37098
|
-
|
|
37099
|
-
|
|
37100
|
-
|
|
37101
|
-
|
|
37102
|
-
|
|
37103
|
-
} = _ref27;
|
|
37104
|
-
return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, _objectSpread2(_objectSpread2({
|
|
37126
|
+
phoneNumber: ({
|
|
37127
|
+
name,
|
|
37128
|
+
inputName,
|
|
37129
|
+
props,
|
|
37130
|
+
value,
|
|
37131
|
+
repeatIndex,
|
|
37132
|
+
repeatValues,
|
|
37133
|
+
formsValue
|
|
37134
|
+
}, {
|
|
37135
|
+
setFormValues,
|
|
37136
|
+
inputMeta,
|
|
37137
|
+
t,
|
|
37138
|
+
isHighlighted
|
|
37139
|
+
}) => {
|
|
37140
|
+
return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, {
|
|
37105
37141
|
customSelectWidthPercentage: "20%",
|
|
37106
37142
|
t: t,
|
|
37107
37143
|
size: "large",
|
|
37108
37144
|
allowClear: true,
|
|
37109
|
-
country: formsValue
|
|
37145
|
+
country: formsValue?.country,
|
|
37110
37146
|
initialValue: value,
|
|
37111
|
-
name: name
|
|
37112
|
-
|
|
37147
|
+
name: name,
|
|
37148
|
+
...props,
|
|
37113
37149
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37114
37150
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
37115
37151
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type Number"),
|
|
@@ -37130,27 +37166,26 @@ const inputTypeComponent$1 = {
|
|
|
37130
37166
|
}
|
|
37131
37167
|
return val;
|
|
37132
37168
|
}
|
|
37133
|
-
})
|
|
37169
|
+
});
|
|
37134
37170
|
},
|
|
37135
|
-
switch: (
|
|
37136
|
-
|
|
37137
|
-
|
|
37138
|
-
|
|
37139
|
-
|
|
37140
|
-
|
|
37141
|
-
|
|
37142
|
-
|
|
37143
|
-
|
|
37144
|
-
|
|
37145
|
-
|
|
37146
|
-
|
|
37147
|
-
|
|
37148
|
-
|
|
37149
|
-
|
|
37150
|
-
|
|
37151
|
-
|
|
37152
|
-
|
|
37153
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
37171
|
+
switch: ({
|
|
37172
|
+
props,
|
|
37173
|
+
value,
|
|
37174
|
+
restricted,
|
|
37175
|
+
autocomplete,
|
|
37176
|
+
formsValue,
|
|
37177
|
+
repeatValues,
|
|
37178
|
+
repeatIndex,
|
|
37179
|
+
name,
|
|
37180
|
+
inputName,
|
|
37181
|
+
replace: replaceInput,
|
|
37182
|
+
unique
|
|
37183
|
+
}, {
|
|
37184
|
+
form,
|
|
37185
|
+
isHighlighted
|
|
37186
|
+
}) => {
|
|
37187
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, {
|
|
37188
|
+
...props,
|
|
37154
37189
|
size: "default",
|
|
37155
37190
|
defaultChecked: value || false,
|
|
37156
37191
|
checked: value || false,
|
|
@@ -37178,7 +37213,9 @@ const inputTypeComponent$1 = {
|
|
|
37178
37213
|
const [formName, replaceInputName] = replaceTo.split(".");
|
|
37179
37214
|
const replaceRepeatValues = replaceInputName ? dot__default["default"].pick(formName, formsValue) : undefined;
|
|
37180
37215
|
updateFormValues$1(undefined, replaceRepeatValues, replaceInputName, isChecked ? newId : undefined, formsValue, formName, form);
|
|
37181
|
-
formsValue = Object.assign(formsValue,
|
|
37216
|
+
formsValue = Object.assign(formsValue, {
|
|
37217
|
+
...form.getFieldsValue(true)
|
|
37218
|
+
});
|
|
37182
37219
|
if (oldId) {
|
|
37183
37220
|
const allRepeatValues = dot__default["default"].pick(name, formsValue);
|
|
37184
37221
|
if (allRepeatValues && Array.isArray(allRepeatValues)) {
|
|
@@ -37219,22 +37256,20 @@ const inputTypeComponent$1 = {
|
|
|
37219
37256
|
}
|
|
37220
37257
|
}
|
|
37221
37258
|
}
|
|
37222
|
-
})
|
|
37259
|
+
});
|
|
37223
37260
|
},
|
|
37224
|
-
radioGroup: (
|
|
37225
|
-
|
|
37226
|
-
|
|
37227
|
-
|
|
37228
|
-
|
|
37229
|
-
|
|
37230
|
-
|
|
37231
|
-
|
|
37232
|
-
isHighlighted
|
|
37233
|
-
} = _ref31;
|
|
37261
|
+
radioGroup: ({
|
|
37262
|
+
props,
|
|
37263
|
+
value,
|
|
37264
|
+
options,
|
|
37265
|
+
isRisk
|
|
37266
|
+
}, {
|
|
37267
|
+
isHighlighted
|
|
37268
|
+
}) => {
|
|
37234
37269
|
if (isRisk) {
|
|
37235
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group,
|
|
37236
|
-
value: value
|
|
37237
|
-
|
|
37270
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
|
|
37271
|
+
value: value,
|
|
37272
|
+
...props,
|
|
37238
37273
|
className: "is-risk-radio",
|
|
37239
37274
|
children: (options || []).map(o => {
|
|
37240
37275
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
|
|
@@ -37248,11 +37283,11 @@ const inputTypeComponent$1 = {
|
|
|
37248
37283
|
}) : null]
|
|
37249
37284
|
}, o.value);
|
|
37250
37285
|
})
|
|
37251
|
-
})
|
|
37286
|
+
});
|
|
37252
37287
|
}
|
|
37253
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group,
|
|
37254
|
-
value: value
|
|
37255
|
-
|
|
37288
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
|
|
37289
|
+
value: value,
|
|
37290
|
+
...props,
|
|
37256
37291
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37257
37292
|
children: (options || []).map(o => {
|
|
37258
37293
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
|
|
@@ -37266,20 +37301,18 @@ const inputTypeComponent$1 = {
|
|
|
37266
37301
|
}) : null]
|
|
37267
37302
|
}, o.value);
|
|
37268
37303
|
})
|
|
37269
|
-
})
|
|
37304
|
+
});
|
|
37270
37305
|
},
|
|
37271
|
-
checkboxGroup: (
|
|
37272
|
-
|
|
37273
|
-
|
|
37274
|
-
|
|
37275
|
-
|
|
37276
|
-
|
|
37277
|
-
|
|
37278
|
-
|
|
37279
|
-
|
|
37280
|
-
|
|
37281
|
-
value: value
|
|
37282
|
-
}, props), {}, {
|
|
37306
|
+
checkboxGroup: ({
|
|
37307
|
+
props,
|
|
37308
|
+
value,
|
|
37309
|
+
options
|
|
37310
|
+
}, {
|
|
37311
|
+
isHighlighted
|
|
37312
|
+
}) => {
|
|
37313
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, {
|
|
37314
|
+
value: value,
|
|
37315
|
+
...props,
|
|
37283
37316
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37284
37317
|
style: {
|
|
37285
37318
|
display: "grid",
|
|
@@ -37303,18 +37336,16 @@ const inputTypeComponent$1 = {
|
|
|
37303
37336
|
}) : null]
|
|
37304
37337
|
}, o.value);
|
|
37305
37338
|
})
|
|
37306
|
-
})
|
|
37339
|
+
});
|
|
37307
37340
|
},
|
|
37308
|
-
total100: (
|
|
37309
|
-
|
|
37310
|
-
|
|
37311
|
-
|
|
37312
|
-
|
|
37313
|
-
|
|
37314
|
-
|
|
37315
|
-
|
|
37316
|
-
isHighlighted
|
|
37317
|
-
} = _ref35;
|
|
37341
|
+
total100: ({
|
|
37342
|
+
props,
|
|
37343
|
+
name,
|
|
37344
|
+
options,
|
|
37345
|
+
value
|
|
37346
|
+
}, {
|
|
37347
|
+
isHighlighted
|
|
37348
|
+
}) => {
|
|
37318
37349
|
value = value ? Array.isArray(value) ? value : [value] : [];
|
|
37319
37350
|
function totalValue() {
|
|
37320
37351
|
let total = 0;
|
|
@@ -37338,11 +37369,10 @@ const inputTypeComponent$1 = {
|
|
|
37338
37369
|
className: formatClassname(["total100", isHighlighted && "highlighted-input"]),
|
|
37339
37370
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
|
|
37340
37371
|
name: name,
|
|
37341
|
-
children: (fields,
|
|
37342
|
-
|
|
37343
|
-
|
|
37344
|
-
|
|
37345
|
-
} = _ref36;
|
|
37372
|
+
children: (fields, {
|
|
37373
|
+
add,
|
|
37374
|
+
remove
|
|
37375
|
+
}) => {
|
|
37346
37376
|
if (fields.length === 0) {
|
|
37347
37377
|
const formData = value || [];
|
|
37348
37378
|
if (formData.length) {
|
|
@@ -37361,27 +37391,27 @@ const inputTypeComponent$1 = {
|
|
|
37361
37391
|
const v = value[field.name] || {};
|
|
37362
37392
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Space, {
|
|
37363
37393
|
className: "total",
|
|
37364
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item,
|
|
37365
|
-
noStyle: true
|
|
37366
|
-
|
|
37394
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
37395
|
+
noStyle: true,
|
|
37396
|
+
...field,
|
|
37367
37397
|
name: [field.name, "type"],
|
|
37368
37398
|
fieldKey: [field.fieldKey, "type"],
|
|
37369
37399
|
initialValue: v.type || null,
|
|
37370
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select,
|
|
37400
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
37371
37401
|
size: "large",
|
|
37372
37402
|
allowClear: true,
|
|
37373
37403
|
showSearch: true,
|
|
37374
37404
|
filterOption: filterSelectOptions,
|
|
37375
|
-
optionFilterProp: "children"
|
|
37376
|
-
|
|
37405
|
+
optionFilterProp: "children",
|
|
37406
|
+
...props,
|
|
37377
37407
|
children: options.map((option, i) => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
37378
37408
|
value: option.value,
|
|
37379
37409
|
children: option.label
|
|
37380
37410
|
}, i))
|
|
37381
|
-
})
|
|
37382
|
-
})
|
|
37383
|
-
noStyle: true
|
|
37384
|
-
|
|
37411
|
+
})
|
|
37412
|
+
}), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
37413
|
+
noStyle: true,
|
|
37414
|
+
...field,
|
|
37385
37415
|
name: [field.name, "value"],
|
|
37386
37416
|
fieldKey: [field.fieldKey, "value"],
|
|
37387
37417
|
initialValue: v.value,
|
|
@@ -37390,14 +37420,14 @@ const inputTypeComponent$1 = {
|
|
|
37390
37420
|
allowClear: true,
|
|
37391
37421
|
name: "value",
|
|
37392
37422
|
formatter: value => {
|
|
37393
|
-
return value ?
|
|
37423
|
+
return value ? `${value}%` : "";
|
|
37394
37424
|
},
|
|
37395
37425
|
disabled: !v.type || null,
|
|
37396
37426
|
placeholder: props.valueplaceholder ? props.valueplaceholder : "Value",
|
|
37397
37427
|
min: 1,
|
|
37398
37428
|
max: 100 - siblingTotal(v.type || 0)
|
|
37399
37429
|
})
|
|
37400
|
-
})
|
|
37430
|
+
}), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
37401
37431
|
disabled: !v.value || !v.type || totalValue() >= 100,
|
|
37402
37432
|
type: "primary",
|
|
37403
37433
|
icon: /*#__PURE__*/jsxRuntime.jsx(Icons.PlusOutlined, {}),
|
|
@@ -37429,22 +37459,19 @@ const inputTypeComponent$1 = {
|
|
|
37429
37459
|
}) : null]
|
|
37430
37460
|
});
|
|
37431
37461
|
},
|
|
37432
|
-
percentage: (
|
|
37433
|
-
|
|
37434
|
-
|
|
37435
|
-
|
|
37436
|
-
|
|
37437
|
-
|
|
37438
|
-
|
|
37439
|
-
|
|
37440
|
-
|
|
37441
|
-
|
|
37442
|
-
|
|
37443
|
-
|
|
37444
|
-
|
|
37445
|
-
t,
|
|
37446
|
-
isHighlighted
|
|
37447
|
-
} = _ref38;
|
|
37462
|
+
percentage: ({
|
|
37463
|
+
name,
|
|
37464
|
+
inputName,
|
|
37465
|
+
totalMax,
|
|
37466
|
+
repeatIndex,
|
|
37467
|
+
props,
|
|
37468
|
+
formsValue,
|
|
37469
|
+
input
|
|
37470
|
+
}, {
|
|
37471
|
+
inputMeta,
|
|
37472
|
+
t,
|
|
37473
|
+
isHighlighted
|
|
37474
|
+
}) => {
|
|
37448
37475
|
const isRepeatable = Array.isArray(formsValue[name]);
|
|
37449
37476
|
let totalSiblings = 0;
|
|
37450
37477
|
if (isRepeatable && totalMax) {
|
|
@@ -37452,47 +37479,45 @@ const inputTypeComponent$1 = {
|
|
|
37452
37479
|
totl = totl + (grp[inputName] || 0);
|
|
37453
37480
|
return totl;
|
|
37454
37481
|
}, 0);
|
|
37455
|
-
} else if (Array.isArray(input
|
|
37482
|
+
} else if (Array.isArray(input?.meta?.siblings)) {
|
|
37456
37483
|
totalSiblings = input.meta.siblings.reduce((totl, key) => {
|
|
37457
37484
|
totl = totl + (formsValue[key] || 0);
|
|
37458
37485
|
return totl;
|
|
37459
37486
|
}, 0);
|
|
37460
37487
|
}
|
|
37461
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber,
|
|
37488
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
37462
37489
|
size: "large",
|
|
37463
|
-
allowClear: true
|
|
37464
|
-
|
|
37490
|
+
allowClear: true,
|
|
37491
|
+
...props,
|
|
37465
37492
|
className: formatClassname([isHighlighted && "highlighted-cont"]),
|
|
37466
37493
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
37467
37494
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
|
|
37468
37495
|
min: 0,
|
|
37469
37496
|
max: 100 - totalSiblings,
|
|
37470
37497
|
formatter: value => {
|
|
37471
|
-
return value ?
|
|
37498
|
+
return value ? `${value}` : "";
|
|
37472
37499
|
},
|
|
37473
37500
|
parser: value => value.replace("%", ""),
|
|
37474
37501
|
addonAfter: "%"
|
|
37475
|
-
})
|
|
37502
|
+
});
|
|
37476
37503
|
},
|
|
37477
|
-
drawTerritory: (
|
|
37478
|
-
|
|
37479
|
-
|
|
37480
|
-
|
|
37481
|
-
|
|
37482
|
-
|
|
37483
|
-
|
|
37484
|
-
setFormValues
|
|
37485
|
-
} = _ref40;
|
|
37504
|
+
drawTerritory: ({
|
|
37505
|
+
formsValue,
|
|
37506
|
+
name,
|
|
37507
|
+
addressData
|
|
37508
|
+
}, {
|
|
37509
|
+
setFormValues
|
|
37510
|
+
}) => {
|
|
37486
37511
|
let search = formsValue.country;
|
|
37487
37512
|
if (addressData && addressData.address && Object.keys(addressData.address).length > 0) {
|
|
37488
37513
|
if (addressData.address.country) {
|
|
37489
37514
|
search = addressData.address.country;
|
|
37490
37515
|
}
|
|
37491
37516
|
if (addressData.address.level1) {
|
|
37492
|
-
search =
|
|
37517
|
+
search = `${addressData.address.level1}, ${addressData.address.country}`;
|
|
37493
37518
|
}
|
|
37494
37519
|
if (addressData.address.level2) {
|
|
37495
|
-
search =
|
|
37520
|
+
search = `${addressData.address.level2}, ${addressData.address.level1}, ${addressData.address.country}`;
|
|
37496
37521
|
}
|
|
37497
37522
|
} else {
|
|
37498
37523
|
const country = countriesList.countries[formsValue.country] || {};
|
|
@@ -37500,10 +37525,10 @@ const inputTypeComponent$1 = {
|
|
|
37500
37525
|
search = country.name;
|
|
37501
37526
|
}
|
|
37502
37527
|
if (formsValue.administrativeLevel1Name) {
|
|
37503
|
-
search =
|
|
37528
|
+
search = `${search} ${formsValue.administrativeLevel1Name}`;
|
|
37504
37529
|
}
|
|
37505
37530
|
if (formsValue.administrativeLevel2Name) {
|
|
37506
|
-
search =
|
|
37531
|
+
search = `${search} ${formsValue.administrativeLevel2Name}`;
|
|
37507
37532
|
}
|
|
37508
37533
|
}
|
|
37509
37534
|
return /*#__PURE__*/jsxRuntime.jsx(PolygonSelector, {
|
|
@@ -37515,36 +37540,32 @@ const inputTypeComponent$1 = {
|
|
|
37515
37540
|
searchValue: search
|
|
37516
37541
|
});
|
|
37517
37542
|
},
|
|
37518
|
-
year: (
|
|
37519
|
-
|
|
37520
|
-
|
|
37521
|
-
|
|
37522
|
-
|
|
37523
|
-
isHighlighted
|
|
37524
|
-
} = _ref42;
|
|
37543
|
+
year: ({
|
|
37544
|
+
props
|
|
37545
|
+
}, {
|
|
37546
|
+
isHighlighted
|
|
37547
|
+
}) => {
|
|
37525
37548
|
const lng = localStorage.getItem("datastakeLng") || "en";
|
|
37526
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker,
|
|
37549
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
37527
37550
|
size: "large",
|
|
37528
37551
|
allowClear: true,
|
|
37529
37552
|
locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
|
|
37530
|
-
picker: "year"
|
|
37531
|
-
|
|
37553
|
+
picker: "year",
|
|
37554
|
+
...props,
|
|
37532
37555
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37533
37556
|
format: "YYYY"
|
|
37534
|
-
})
|
|
37557
|
+
});
|
|
37535
37558
|
},
|
|
37536
|
-
upload: (
|
|
37537
|
-
|
|
37538
|
-
|
|
37539
|
-
|
|
37540
|
-
|
|
37541
|
-
|
|
37542
|
-
|
|
37543
|
-
|
|
37544
|
-
|
|
37545
|
-
|
|
37546
|
-
isHighlighted
|
|
37547
|
-
} = _ref44;
|
|
37559
|
+
upload: ({
|
|
37560
|
+
rules,
|
|
37561
|
+
value
|
|
37562
|
+
}, {
|
|
37563
|
+
setLoading = () => {},
|
|
37564
|
+
getApiBaseUrl,
|
|
37565
|
+
getAppHeader,
|
|
37566
|
+
t,
|
|
37567
|
+
isHighlighted
|
|
37568
|
+
}) => {
|
|
37548
37569
|
const apiURL = getApiBaseUrl();
|
|
37549
37570
|
const accept = rules.length ? rules.find(rule => Object.keys(rule).includes("accept")).accept || "*" : null;
|
|
37550
37571
|
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) : []) || [];
|
|
@@ -37557,12 +37578,13 @@ const inputTypeComponent$1 = {
|
|
|
37557
37578
|
maxProps.multiple = true;
|
|
37558
37579
|
}
|
|
37559
37580
|
}
|
|
37560
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload,
|
|
37581
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37582
|
+
...maxProps,
|
|
37561
37583
|
accept: accept,
|
|
37562
|
-
action:
|
|
37584
|
+
action: `${apiURL}/upload`,
|
|
37563
37585
|
beforeUpload: beforeUpload(allowedExtensions),
|
|
37564
37586
|
onChange: val => {
|
|
37565
|
-
if (val
|
|
37587
|
+
if (val?.file && typeof setLoading === "function") {
|
|
37566
37588
|
if (val.file.percent !== 100) {
|
|
37567
37589
|
setLoading(true);
|
|
37568
37590
|
} else {
|
|
@@ -37570,9 +37592,10 @@ const inputTypeComponent$1 = {
|
|
|
37570
37592
|
}
|
|
37571
37593
|
}
|
|
37572
37594
|
},
|
|
37573
|
-
headers:
|
|
37574
|
-
Authorization:
|
|
37575
|
-
|
|
37595
|
+
headers: {
|
|
37596
|
+
Authorization: `Bearer ${getToken()}`,
|
|
37597
|
+
...getAppHeader()
|
|
37598
|
+
},
|
|
37576
37599
|
defaultFileList: values,
|
|
37577
37600
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
37578
37601
|
style: {
|
|
@@ -37583,20 +37606,18 @@ const inputTypeComponent$1 = {
|
|
|
37583
37606
|
children: t("Upload")
|
|
37584
37607
|
})]
|
|
37585
37608
|
})
|
|
37586
|
-
})
|
|
37609
|
+
});
|
|
37587
37610
|
},
|
|
37588
|
-
imageUpload: (
|
|
37589
|
-
|
|
37590
|
-
|
|
37591
|
-
|
|
37592
|
-
|
|
37593
|
-
|
|
37594
|
-
|
|
37595
|
-
|
|
37596
|
-
|
|
37597
|
-
|
|
37598
|
-
isHighlighted
|
|
37599
|
-
} = _ref46;
|
|
37611
|
+
imageUpload: ({
|
|
37612
|
+
rules,
|
|
37613
|
+
value
|
|
37614
|
+
}, {
|
|
37615
|
+
setLoading = () => {},
|
|
37616
|
+
getApiBaseUrl,
|
|
37617
|
+
getAppHeader,
|
|
37618
|
+
t,
|
|
37619
|
+
isHighlighted
|
|
37620
|
+
}) => {
|
|
37600
37621
|
const apiURL = getApiBaseUrl();
|
|
37601
37622
|
const values = getImageUploadEditValue(value);
|
|
37602
37623
|
const maxRule = rules.find(r => r.max);
|
|
@@ -37607,18 +37628,17 @@ const inputTypeComponent$1 = {
|
|
|
37607
37628
|
maxProps.multiple = true;
|
|
37608
37629
|
}
|
|
37609
37630
|
}
|
|
37610
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload,
|
|
37611
|
-
beforeUpload: beforeUpload(allowedImageExtensions)
|
|
37612
|
-
|
|
37631
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37632
|
+
beforeUpload: beforeUpload(allowedImageExtensions),
|
|
37633
|
+
...maxProps,
|
|
37613
37634
|
accept: "image/*",
|
|
37614
37635
|
classList: !values || !values.length ? "empty" : "",
|
|
37615
37636
|
listType: "picture",
|
|
37616
|
-
action:
|
|
37637
|
+
action: `${apiURL}/upload`,
|
|
37617
37638
|
onChange: val => {
|
|
37618
37639
|
if (typeof setLoading === "function") {
|
|
37619
|
-
if (val
|
|
37620
|
-
|
|
37621
|
-
if ((val === null || val === void 0 || (_val$file = val.file) === null || _val$file === void 0 ? void 0 : _val$file.status) === "removed") {
|
|
37640
|
+
if (val?.file) {
|
|
37641
|
+
if (val?.file?.status === "removed") {
|
|
37622
37642
|
setLoading(false);
|
|
37623
37643
|
return;
|
|
37624
37644
|
}
|
|
@@ -37630,9 +37650,10 @@ const inputTypeComponent$1 = {
|
|
|
37630
37650
|
setLoading(false);
|
|
37631
37651
|
}
|
|
37632
37652
|
},
|
|
37633
|
-
headers:
|
|
37634
|
-
Authorization:
|
|
37635
|
-
|
|
37653
|
+
headers: {
|
|
37654
|
+
Authorization: `Bearer ${getToken()}`,
|
|
37655
|
+
...getAppHeader()
|
|
37656
|
+
},
|
|
37636
37657
|
defaultFileList: values,
|
|
37637
37658
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
37638
37659
|
style: {
|
|
@@ -37643,20 +37664,18 @@ const inputTypeComponent$1 = {
|
|
|
37643
37664
|
children: t("Upload")
|
|
37644
37665
|
})]
|
|
37645
37666
|
})
|
|
37646
|
-
})
|
|
37667
|
+
});
|
|
37647
37668
|
},
|
|
37648
|
-
videoUpload: (
|
|
37649
|
-
|
|
37650
|
-
|
|
37651
|
-
|
|
37652
|
-
|
|
37653
|
-
|
|
37654
|
-
|
|
37655
|
-
|
|
37656
|
-
|
|
37657
|
-
|
|
37658
|
-
isHighlighted
|
|
37659
|
-
} = _ref48;
|
|
37669
|
+
videoUpload: ({
|
|
37670
|
+
rules,
|
|
37671
|
+
value
|
|
37672
|
+
}, {
|
|
37673
|
+
setLoading = () => {},
|
|
37674
|
+
getApiBaseUrl,
|
|
37675
|
+
getAppHeader,
|
|
37676
|
+
t,
|
|
37677
|
+
isHighlighted
|
|
37678
|
+
}) => {
|
|
37660
37679
|
const apiURL = getApiBaseUrl();
|
|
37661
37680
|
const values = getImageUploadEditValue(value);
|
|
37662
37681
|
const maxRule = rules.find(r => r.max);
|
|
@@ -37667,25 +37686,21 @@ const inputTypeComponent$1 = {
|
|
|
37667
37686
|
maxProps.multiple = true;
|
|
37668
37687
|
}
|
|
37669
37688
|
}
|
|
37670
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload,
|
|
37671
|
-
itemRender: (item, fileList) => {
|
|
37672
|
-
|
|
37673
|
-
|
|
37674
|
-
|
|
37675
|
-
|
|
37676
|
-
|
|
37677
|
-
});
|
|
37678
|
-
}
|
|
37679
|
-
}, maxProps), {}, {
|
|
37689
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37690
|
+
itemRender: (item, fileList) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
37691
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
|
|
37692
|
+
url: fileList?.response?.url || fileList?.url
|
|
37693
|
+
}), item]
|
|
37694
|
+
}),
|
|
37695
|
+
...maxProps,
|
|
37680
37696
|
accept: "video/*",
|
|
37681
37697
|
classList: !values || !values.length ? "empty" : "",
|
|
37682
37698
|
listType: "picture",
|
|
37683
|
-
action:
|
|
37699
|
+
action: `${apiURL}/upload`,
|
|
37684
37700
|
onChange: val => {
|
|
37685
37701
|
if (typeof setLoading === "function") {
|
|
37686
|
-
if (val
|
|
37687
|
-
|
|
37688
|
-
if ((val === null || val === void 0 || (_val$file2 = val.file) === null || _val$file2 === void 0 ? void 0 : _val$file2.status) === "removed") {
|
|
37702
|
+
if (val?.file) {
|
|
37703
|
+
if (val?.file?.status === "removed") {
|
|
37689
37704
|
setLoading(false);
|
|
37690
37705
|
return;
|
|
37691
37706
|
}
|
|
@@ -37697,9 +37712,10 @@ const inputTypeComponent$1 = {
|
|
|
37697
37712
|
setLoading(false);
|
|
37698
37713
|
}
|
|
37699
37714
|
},
|
|
37700
|
-
headers:
|
|
37701
|
-
Authorization:
|
|
37702
|
-
|
|
37715
|
+
headers: {
|
|
37716
|
+
Authorization: `Bearer ${getToken()}`,
|
|
37717
|
+
...getAppHeader()
|
|
37718
|
+
},
|
|
37703
37719
|
fileList: values,
|
|
37704
37720
|
defaultFileList: values,
|
|
37705
37721
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
@@ -37711,30 +37727,28 @@ const inputTypeComponent$1 = {
|
|
|
37711
37727
|
children: t("Upload")
|
|
37712
37728
|
})]
|
|
37713
37729
|
})
|
|
37714
|
-
})
|
|
37730
|
+
});
|
|
37715
37731
|
},
|
|
37716
|
-
geolocation: (
|
|
37717
|
-
|
|
37718
|
-
|
|
37719
|
-
|
|
37720
|
-
|
|
37721
|
-
|
|
37722
|
-
|
|
37723
|
-
|
|
37724
|
-
|
|
37725
|
-
|
|
37726
|
-
isHighlighted
|
|
37727
|
-
} = _ref50;
|
|
37732
|
+
geolocation: ({
|
|
37733
|
+
value,
|
|
37734
|
+
name,
|
|
37735
|
+
props,
|
|
37736
|
+
formsValue,
|
|
37737
|
+
addressData
|
|
37738
|
+
}, {
|
|
37739
|
+
inputMeta,
|
|
37740
|
+
isHighlighted
|
|
37741
|
+
}) => {
|
|
37728
37742
|
let search = formsValue.country;
|
|
37729
37743
|
if (addressData && Object.keys(addressData).length > 0) {
|
|
37730
37744
|
if (addressData.country) {
|
|
37731
37745
|
search = addressData.country;
|
|
37732
37746
|
}
|
|
37733
37747
|
if (addressData.level1) {
|
|
37734
|
-
search =
|
|
37748
|
+
search = `${addressData.level1}, ${addressData.country}`;
|
|
37735
37749
|
}
|
|
37736
37750
|
if (addressData.level2) {
|
|
37737
|
-
search =
|
|
37751
|
+
search = `${addressData.level2}, ${addressData.level1}, ${addressData.country}`;
|
|
37738
37752
|
}
|
|
37739
37753
|
} else {
|
|
37740
37754
|
const country = countriesList.countries[formsValue.country] || {};
|
|
@@ -37742,10 +37756,10 @@ const inputTypeComponent$1 = {
|
|
|
37742
37756
|
search = country.name;
|
|
37743
37757
|
}
|
|
37744
37758
|
if (formsValue.administrativeLevel1Name) {
|
|
37745
|
-
search =
|
|
37759
|
+
search = `${search} ${formsValue.administrativeLevel1Name}`;
|
|
37746
37760
|
}
|
|
37747
37761
|
if (formsValue.administrativeLevel2Name) {
|
|
37748
|
-
search =
|
|
37762
|
+
search = `${search} ${formsValue.administrativeLevel2Name}`;
|
|
37749
37763
|
}
|
|
37750
37764
|
}
|
|
37751
37765
|
return /*#__PURE__*/jsxRuntime.jsx(Geolocation, {
|
|
@@ -37759,36 +37773,34 @@ const inputTypeComponent$1 = {
|
|
|
37759
37773
|
searchValue: search
|
|
37760
37774
|
});
|
|
37761
37775
|
},
|
|
37762
|
-
ajaxSelect: (
|
|
37763
|
-
|
|
37764
|
-
|
|
37765
|
-
|
|
37766
|
-
|
|
37767
|
-
|
|
37768
|
-
|
|
37769
|
-
|
|
37770
|
-
|
|
37771
|
-
|
|
37772
|
-
|
|
37773
|
-
|
|
37774
|
-
|
|
37775
|
-
|
|
37776
|
-
|
|
37777
|
-
|
|
37778
|
-
|
|
37779
|
-
|
|
37780
|
-
|
|
37781
|
-
|
|
37782
|
-
|
|
37783
|
-
|
|
37784
|
-
|
|
37785
|
-
|
|
37786
|
-
|
|
37787
|
-
|
|
37788
|
-
|
|
37789
|
-
|
|
37790
|
-
groupFormId
|
|
37791
|
-
} = _ref52;
|
|
37776
|
+
ajaxSelect: ({
|
|
37777
|
+
call,
|
|
37778
|
+
automaticallyLink,
|
|
37779
|
+
name,
|
|
37780
|
+
inputName,
|
|
37781
|
+
props,
|
|
37782
|
+
formsValue,
|
|
37783
|
+
onNewSetValue,
|
|
37784
|
+
multiple,
|
|
37785
|
+
updateOptions,
|
|
37786
|
+
repeatValues,
|
|
37787
|
+
repeatIndex,
|
|
37788
|
+
value,
|
|
37789
|
+
unique,
|
|
37790
|
+
address,
|
|
37791
|
+
addressData = {},
|
|
37792
|
+
getFromLinking,
|
|
37793
|
+
input
|
|
37794
|
+
}, {
|
|
37795
|
+
form,
|
|
37796
|
+
forms,
|
|
37797
|
+
setAddress,
|
|
37798
|
+
changeInputMeta,
|
|
37799
|
+
inputMeta,
|
|
37800
|
+
meta,
|
|
37801
|
+
isHighlighted,
|
|
37802
|
+
groupFormId
|
|
37803
|
+
}) => {
|
|
37792
37804
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect, {
|
|
37793
37805
|
size: "medium",
|
|
37794
37806
|
input: input,
|
|
@@ -37825,7 +37837,9 @@ const inputTypeComponent$1 = {
|
|
|
37825
37837
|
const selectedValue = data.find(v => v.value === ev);
|
|
37826
37838
|
if (address && selectedValue) {
|
|
37827
37839
|
dot__default["default"].str(address, selectedValue.label, addressData);
|
|
37828
|
-
setAddress(
|
|
37840
|
+
setAddress({
|
|
37841
|
+
...addressData
|
|
37842
|
+
});
|
|
37829
37843
|
}
|
|
37830
37844
|
}
|
|
37831
37845
|
},
|
|
@@ -37834,11 +37848,10 @@ const inputTypeComponent$1 = {
|
|
|
37834
37848
|
address: true
|
|
37835
37849
|
});
|
|
37836
37850
|
},
|
|
37837
|
-
tag:
|
|
37838
|
-
|
|
37839
|
-
|
|
37840
|
-
|
|
37841
|
-
} = _ref53;
|
|
37851
|
+
tag: ({
|
|
37852
|
+
value,
|
|
37853
|
+
repeatLabel
|
|
37854
|
+
}) => {
|
|
37842
37855
|
return /*#__PURE__*/jsxRuntime.jsx(TagInput, {
|
|
37843
37856
|
size: "large",
|
|
37844
37857
|
allowClear: true,
|
|
@@ -37846,28 +37859,26 @@ const inputTypeComponent$1 = {
|
|
|
37846
37859
|
newPlaceholder: repeatLabel
|
|
37847
37860
|
});
|
|
37848
37861
|
},
|
|
37849
|
-
modal: (
|
|
37850
|
-
|
|
37851
|
-
|
|
37852
|
-
|
|
37853
|
-
|
|
37854
|
-
|
|
37855
|
-
|
|
37856
|
-
|
|
37857
|
-
|
|
37858
|
-
|
|
37859
|
-
|
|
37860
|
-
|
|
37861
|
-
|
|
37862
|
-
|
|
37863
|
-
|
|
37864
|
-
|
|
37865
|
-
|
|
37866
|
-
|
|
37867
|
-
|
|
37868
|
-
|
|
37869
|
-
add
|
|
37870
|
-
} = _ref55;
|
|
37862
|
+
modal: ({
|
|
37863
|
+
call,
|
|
37864
|
+
automaticallyLink,
|
|
37865
|
+
name,
|
|
37866
|
+
inputName,
|
|
37867
|
+
props,
|
|
37868
|
+
formsValue,
|
|
37869
|
+
allFormsValue,
|
|
37870
|
+
onNewSetValue,
|
|
37871
|
+
repeatValues,
|
|
37872
|
+
repeatIndex,
|
|
37873
|
+
value,
|
|
37874
|
+
modalTitle,
|
|
37875
|
+
totalInputs,
|
|
37876
|
+
shownInputs,
|
|
37877
|
+
allowDupplicates
|
|
37878
|
+
}, {
|
|
37879
|
+
form,
|
|
37880
|
+
add
|
|
37881
|
+
}) => {
|
|
37871
37882
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxModal, {
|
|
37872
37883
|
allowClear: true,
|
|
37873
37884
|
call: call,
|
|
@@ -37890,44 +37901,40 @@ const inputTypeComponent$1 = {
|
|
|
37890
37901
|
allowDupplicates: allowDupplicates
|
|
37891
37902
|
});
|
|
37892
37903
|
},
|
|
37893
|
-
dataLink: (
|
|
37894
|
-
|
|
37895
|
-
|
|
37896
|
-
|
|
37897
|
-
|
|
37898
|
-
|
|
37899
|
-
|
|
37900
|
-
|
|
37901
|
-
|
|
37902
|
-
|
|
37903
|
-
|
|
37904
|
-
|
|
37905
|
-
|
|
37906
|
-
|
|
37907
|
-
|
|
37908
|
-
|
|
37909
|
-
|
|
37910
|
-
|
|
37911
|
-
|
|
37912
|
-
|
|
37913
|
-
|
|
37914
|
-
|
|
37915
|
-
|
|
37916
|
-
|
|
37917
|
-
|
|
37918
|
-
|
|
37919
|
-
|
|
37920
|
-
|
|
37921
|
-
|
|
37922
|
-
|
|
37923
|
-
|
|
37924
|
-
|
|
37925
|
-
groupFormId
|
|
37926
|
-
|
|
37927
|
-
if ((input === null || input === void 0 || (_input$meta12 = input.meta) === null || _input$meta12 === void 0 || (_input$meta12 = _input$meta12.optionsView) === null || _input$meta12 === void 0 ? void 0 : _input$meta12.editInputType) === "ajaxSelect") {
|
|
37928
|
-
var _formsValue$groupForm3, _input$meta13, _input$meta14;
|
|
37929
|
-
const currentValue = groupFormId ? (_formsValue$groupForm3 = formsValue[groupFormId]) === null || _formsValue$groupForm3 === void 0 ? void 0 : _formsValue$groupForm3[name] : formsValue[name];
|
|
37930
|
-
(input === null || input === void 0 || (_input$meta13 = input.meta) === null || _input$meta13 === void 0 || (_input$meta13 = _input$meta13.optionsView) === null || _input$meta13 === void 0 ? void 0 : _input$meta13.call) || (input === null || input === void 0 || (_input$meta14 = input.meta) === null || _input$meta14 === void 0 ? void 0 : _input$meta14.call) || "default::list()::::";
|
|
37904
|
+
dataLink: ({
|
|
37905
|
+
setValues,
|
|
37906
|
+
name,
|
|
37907
|
+
onValuesChange,
|
|
37908
|
+
changeLinking,
|
|
37909
|
+
formsValue,
|
|
37910
|
+
input,
|
|
37911
|
+
call,
|
|
37912
|
+
automaticallyLink,
|
|
37913
|
+
inputName,
|
|
37914
|
+
props,
|
|
37915
|
+
onNewSetValue,
|
|
37916
|
+
multiple,
|
|
37917
|
+
updateOptions,
|
|
37918
|
+
repeatValues,
|
|
37919
|
+
repeatIndex,
|
|
37920
|
+
value,
|
|
37921
|
+
unique,
|
|
37922
|
+
address,
|
|
37923
|
+
addressData = {},
|
|
37924
|
+
getFromLinking
|
|
37925
|
+
}, {
|
|
37926
|
+
form,
|
|
37927
|
+
forms,
|
|
37928
|
+
setAddress,
|
|
37929
|
+
changeInputMeta,
|
|
37930
|
+
inputMeta,
|
|
37931
|
+
meta,
|
|
37932
|
+
isHighlighted,
|
|
37933
|
+
groupFormId
|
|
37934
|
+
}) => {
|
|
37935
|
+
if (input?.meta?.optionsView?.editInputType === "ajaxSelect") {
|
|
37936
|
+
const currentValue = groupFormId ? formsValue[groupFormId]?.[name] : formsValue[name];
|
|
37937
|
+
input?.meta?.optionsView?.call || input?.meta?.call || "default::list()::::";
|
|
37931
37938
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect$1, {
|
|
37932
37939
|
size: "medium",
|
|
37933
37940
|
input: input,
|
|
@@ -37964,7 +37971,9 @@ const inputTypeComponent$1 = {
|
|
|
37964
37971
|
const selectedValue = data.find(v => v.value === ev);
|
|
37965
37972
|
if (address && selectedValue) {
|
|
37966
37973
|
dot__default["default"].str(address, selectedValue.label, addressData);
|
|
37967
|
-
setAddress(
|
|
37974
|
+
setAddress({
|
|
37975
|
+
...addressData
|
|
37976
|
+
});
|
|
37968
37977
|
}
|
|
37969
37978
|
}
|
|
37970
37979
|
},
|
|
@@ -37974,93 +37983,138 @@ const inputTypeComponent$1 = {
|
|
|
37974
37983
|
isDataLink: true
|
|
37975
37984
|
});
|
|
37976
37985
|
}
|
|
37977
|
-
const isSingle =
|
|
37978
|
-
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [
|
|
37986
|
+
const isSingle = input?.meta?.maxRepeat === 1;
|
|
37987
|
+
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
|
|
37988
|
+
...(formsValue[groupFormId] || {})[name]
|
|
37989
|
+
}] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
|
|
37990
|
+
...v
|
|
37991
|
+
})) : isSingle ? formsValue[name] ? [{
|
|
37992
|
+
...formsValue[name]
|
|
37993
|
+
}] : [] : (formsValue[name] || []).map(v => ({
|
|
37994
|
+
...v
|
|
37995
|
+
}));
|
|
37979
37996
|
const onUpdate = (editData, i) => {
|
|
37980
|
-
const val =
|
|
37997
|
+
const val = {
|
|
37998
|
+
...formData[i],
|
|
37999
|
+
...editData
|
|
38000
|
+
};
|
|
37981
38001
|
const _val = isSingle ? {
|
|
37982
38002
|
[name]: val
|
|
37983
38003
|
} : {
|
|
37984
|
-
[name]: formData
|
|
38004
|
+
[name]: formData?.map((d, j) => i === j ? val : d)
|
|
37985
38005
|
};
|
|
37986
38006
|
if (groupFormId) {
|
|
37987
|
-
const _defaultData =
|
|
37988
|
-
const _newData =
|
|
37989
|
-
|
|
38007
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38008
|
+
const _newData = {
|
|
38009
|
+
..._defaultData,
|
|
38010
|
+
..._val
|
|
38011
|
+
};
|
|
38012
|
+
onValuesChange(_newData, {
|
|
38013
|
+
...formsValue,
|
|
37990
38014
|
[groupFormId]: _newData
|
|
37991
|
-
})
|
|
37992
|
-
form
|
|
37993
|
-
setValues(
|
|
38015
|
+
});
|
|
38016
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38017
|
+
setValues({
|
|
38018
|
+
...formsValue,
|
|
37994
38019
|
[groupFormId]: _newData
|
|
37995
|
-
})
|
|
38020
|
+
});
|
|
37996
38021
|
return;
|
|
37997
38022
|
}
|
|
37998
|
-
onValuesChange(_val,
|
|
37999
|
-
|
|
38000
|
-
|
|
38023
|
+
onValuesChange(_val, {
|
|
38024
|
+
...formsValue,
|
|
38025
|
+
..._val
|
|
38026
|
+
});
|
|
38027
|
+
form?.setFieldValue(name, _val[name]);
|
|
38028
|
+
setValues({
|
|
38029
|
+
...formsValue,
|
|
38030
|
+
..._val
|
|
38031
|
+
});
|
|
38001
38032
|
};
|
|
38002
|
-
if (input
|
|
38003
|
-
var _formsValue$meta4, _input$meta17;
|
|
38033
|
+
if (input?.meta?.flat) {
|
|
38004
38034
|
return /*#__PURE__*/jsxRuntime.jsx(DataLinkFlat, {
|
|
38005
38035
|
form: input,
|
|
38006
38036
|
changeLinking: changeLinking,
|
|
38007
38037
|
onUpdate: onUpdate,
|
|
38008
38038
|
isHighlighted: isHighlighted,
|
|
38009
38039
|
formsValue: formsValue,
|
|
38010
|
-
values: groupFormId ?
|
|
38040
|
+
values: groupFormId ? {
|
|
38041
|
+
...(formsValue[groupFormId] || {}),
|
|
38011
38042
|
meta: {
|
|
38012
|
-
inputs: (
|
|
38043
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
38013
38044
|
}
|
|
38014
|
-
}
|
|
38045
|
+
} : formsValue,
|
|
38015
38046
|
name: name,
|
|
38016
38047
|
groupFormId: groupFormId,
|
|
38017
|
-
maxRepeat: input
|
|
38018
|
-
remove:
|
|
38019
|
-
|
|
38020
|
-
|
|
38021
|
-
} = _ref58;
|
|
38048
|
+
maxRepeat: input?.meta?.maxRepeat,
|
|
38049
|
+
remove: ({
|
|
38050
|
+
key
|
|
38051
|
+
}) => {
|
|
38022
38052
|
const _val = isSingle ? {
|
|
38023
38053
|
[name]: null
|
|
38024
38054
|
} : {
|
|
38025
38055
|
[name]: formData.filter((v, i) => i !== key)
|
|
38026
38056
|
};
|
|
38027
38057
|
if (groupFormId) {
|
|
38028
|
-
const _defaultData =
|
|
38029
|
-
const _newData =
|
|
38030
|
-
|
|
38058
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38059
|
+
const _newData = {
|
|
38060
|
+
..._defaultData,
|
|
38061
|
+
..._val
|
|
38062
|
+
};
|
|
38063
|
+
onValuesChange(_newData, {
|
|
38064
|
+
...formsValue,
|
|
38031
38065
|
[groupFormId]: _newData
|
|
38032
|
-
})
|
|
38033
|
-
form
|
|
38034
|
-
setValues(
|
|
38066
|
+
});
|
|
38067
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38068
|
+
setValues({
|
|
38069
|
+
...formsValue,
|
|
38035
38070
|
[groupFormId]: _newData
|
|
38036
|
-
})
|
|
38071
|
+
});
|
|
38037
38072
|
return;
|
|
38038
38073
|
}
|
|
38039
|
-
onValuesChange(_val,
|
|
38040
|
-
|
|
38041
|
-
|
|
38074
|
+
onValuesChange(_val, {
|
|
38075
|
+
...formsValue,
|
|
38076
|
+
..._val
|
|
38077
|
+
});
|
|
38078
|
+
form?.setFieldValue(name, _val[name]);
|
|
38079
|
+
setValues({
|
|
38080
|
+
...formsValue,
|
|
38081
|
+
..._val
|
|
38082
|
+
});
|
|
38042
38083
|
},
|
|
38043
38084
|
add: val => {
|
|
38044
38085
|
const _val = isSingle ? {
|
|
38045
38086
|
[name]: val
|
|
38046
38087
|
} : {
|
|
38047
|
-
[name]: [...formData,
|
|
38088
|
+
[name]: [...formData, {
|
|
38089
|
+
...val
|
|
38090
|
+
}]
|
|
38048
38091
|
};
|
|
38049
38092
|
if (groupFormId) {
|
|
38050
|
-
const _defaultData =
|
|
38051
|
-
const _newData =
|
|
38052
|
-
|
|
38053
|
-
|
|
38093
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38094
|
+
const _newData = {
|
|
38095
|
+
..._defaultData,
|
|
38096
|
+
..._val
|
|
38097
|
+
};
|
|
38098
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38099
|
+
onValuesChange(_newData, {
|
|
38100
|
+
...formsValue,
|
|
38054
38101
|
[groupFormId]: _newData
|
|
38055
|
-
})
|
|
38056
|
-
setValues(
|
|
38102
|
+
});
|
|
38103
|
+
setValues({
|
|
38104
|
+
...formsValue,
|
|
38057
38105
|
[groupFormId]: _newData
|
|
38058
|
-
})
|
|
38106
|
+
});
|
|
38059
38107
|
return;
|
|
38060
38108
|
}
|
|
38061
|
-
form
|
|
38062
|
-
onValuesChange(_val,
|
|
38063
|
-
|
|
38109
|
+
form?.setFieldValue(name, _val[name]);
|
|
38110
|
+
onValuesChange(_val, {
|
|
38111
|
+
...formsValue,
|
|
38112
|
+
..._val
|
|
38113
|
+
});
|
|
38114
|
+
setValues({
|
|
38115
|
+
...formsValue,
|
|
38116
|
+
..._val
|
|
38117
|
+
});
|
|
38064
38118
|
},
|
|
38065
38119
|
k: name,
|
|
38066
38120
|
formData: formData
|
|
@@ -38072,79 +38126,101 @@ const inputTypeComponent$1 = {
|
|
|
38072
38126
|
onUpdate: onUpdate,
|
|
38073
38127
|
isHighlighted: isHighlighted,
|
|
38074
38128
|
formsValue: formsValue,
|
|
38075
|
-
values: groupFormId ?
|
|
38129
|
+
values: groupFormId ? {
|
|
38130
|
+
...(formsValue[groupFormId] || {}),
|
|
38076
38131
|
meta: {
|
|
38077
|
-
inputs: (
|
|
38132
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
38078
38133
|
}
|
|
38079
|
-
}
|
|
38134
|
+
} : formsValue,
|
|
38080
38135
|
name: name,
|
|
38081
38136
|
groupFormId: groupFormId,
|
|
38082
|
-
maxRepeat: input
|
|
38083
|
-
remove:
|
|
38084
|
-
|
|
38085
|
-
|
|
38086
|
-
} = _ref59;
|
|
38137
|
+
maxRepeat: input?.meta?.maxRepeat,
|
|
38138
|
+
remove: ({
|
|
38139
|
+
key
|
|
38140
|
+
}) => {
|
|
38087
38141
|
const _val = isSingle ? {
|
|
38088
38142
|
[name]: null
|
|
38089
38143
|
} : {
|
|
38090
38144
|
[name]: formData.filter((v, i) => i !== key)
|
|
38091
38145
|
};
|
|
38092
38146
|
if (groupFormId) {
|
|
38093
|
-
const _defaultData =
|
|
38094
|
-
const _newData =
|
|
38095
|
-
|
|
38147
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38148
|
+
const _newData = {
|
|
38149
|
+
..._defaultData,
|
|
38150
|
+
..._val
|
|
38151
|
+
};
|
|
38152
|
+
onValuesChange(_newData, {
|
|
38153
|
+
...formsValue,
|
|
38096
38154
|
[groupFormId]: _newData
|
|
38097
|
-
})
|
|
38098
|
-
form
|
|
38099
|
-
setValues(
|
|
38155
|
+
});
|
|
38156
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38157
|
+
setValues({
|
|
38158
|
+
...formsValue,
|
|
38100
38159
|
[groupFormId]: _newData
|
|
38101
|
-
})
|
|
38160
|
+
});
|
|
38102
38161
|
return;
|
|
38103
38162
|
}
|
|
38104
|
-
onValuesChange(_val,
|
|
38105
|
-
|
|
38106
|
-
|
|
38163
|
+
onValuesChange(_val, {
|
|
38164
|
+
...formsValue,
|
|
38165
|
+
..._val
|
|
38166
|
+
});
|
|
38167
|
+
form?.setFieldValue(name, _val[name]);
|
|
38168
|
+
setValues({
|
|
38169
|
+
...formsValue,
|
|
38170
|
+
..._val
|
|
38171
|
+
});
|
|
38107
38172
|
},
|
|
38108
38173
|
add: val => {
|
|
38109
38174
|
const _val = isSingle ? {
|
|
38110
38175
|
[name]: val
|
|
38111
38176
|
} : {
|
|
38112
|
-
[name]: [...formData,
|
|
38177
|
+
[name]: [...formData, {
|
|
38178
|
+
...val
|
|
38179
|
+
}]
|
|
38113
38180
|
};
|
|
38114
38181
|
if (groupFormId) {
|
|
38115
|
-
const _defaultData =
|
|
38116
|
-
const _newData =
|
|
38117
|
-
|
|
38118
|
-
|
|
38182
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38183
|
+
const _newData = {
|
|
38184
|
+
..._defaultData,
|
|
38185
|
+
..._val
|
|
38186
|
+
};
|
|
38187
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38188
|
+
onValuesChange(_newData, {
|
|
38189
|
+
...formsValue,
|
|
38119
38190
|
[groupFormId]: _newData
|
|
38120
|
-
})
|
|
38121
|
-
setValues(
|
|
38191
|
+
});
|
|
38192
|
+
setValues({
|
|
38193
|
+
...formsValue,
|
|
38122
38194
|
[groupFormId]: _newData
|
|
38123
|
-
})
|
|
38195
|
+
});
|
|
38124
38196
|
return;
|
|
38125
38197
|
}
|
|
38126
|
-
form
|
|
38127
|
-
onValuesChange(_val,
|
|
38128
|
-
|
|
38198
|
+
form?.setFieldValue(name, _val[name]);
|
|
38199
|
+
onValuesChange(_val, {
|
|
38200
|
+
...formsValue,
|
|
38201
|
+
..._val
|
|
38202
|
+
});
|
|
38203
|
+
setValues({
|
|
38204
|
+
...formsValue,
|
|
38205
|
+
..._val
|
|
38206
|
+
});
|
|
38129
38207
|
},
|
|
38130
38208
|
k: name,
|
|
38131
38209
|
formData: formData
|
|
38132
38210
|
});
|
|
38133
38211
|
},
|
|
38134
|
-
dataLinkGroup: (
|
|
38135
|
-
|
|
38136
|
-
|
|
38137
|
-
|
|
38138
|
-
|
|
38139
|
-
|
|
38140
|
-
|
|
38141
|
-
|
|
38142
|
-
|
|
38143
|
-
|
|
38144
|
-
|
|
38145
|
-
|
|
38146
|
-
isHighlighted
|
|
38147
|
-
} = _ref61;
|
|
38212
|
+
dataLinkGroup: ({
|
|
38213
|
+
setValues,
|
|
38214
|
+
name,
|
|
38215
|
+
onValuesChange,
|
|
38216
|
+
changeLinking,
|
|
38217
|
+
formsValue,
|
|
38218
|
+
input
|
|
38219
|
+
}, {
|
|
38220
|
+
form,
|
|
38221
|
+
groupFormId,
|
|
38222
|
+
isHighlighted
|
|
38223
|
+
}) => {
|
|
38148
38224
|
return renderDataLinkGroup({
|
|
38149
38225
|
input,
|
|
38150
38226
|
name,
|
|
@@ -38157,41 +38233,51 @@ const inputTypeComponent$1 = {
|
|
|
38157
38233
|
isHighlighted
|
|
38158
38234
|
});
|
|
38159
38235
|
},
|
|
38160
|
-
groupCheckbox: (
|
|
38161
|
-
|
|
38162
|
-
|
|
38163
|
-
|
|
38164
|
-
|
|
38165
|
-
|
|
38166
|
-
|
|
38167
|
-
|
|
38168
|
-
|
|
38169
|
-
|
|
38170
|
-
|
|
38171
|
-
isHighlighted
|
|
38172
|
-
} = _ref63;
|
|
38236
|
+
groupCheckbox: ({
|
|
38237
|
+
setValues,
|
|
38238
|
+
name,
|
|
38239
|
+
onValuesChange,
|
|
38240
|
+
formsValue,
|
|
38241
|
+
input
|
|
38242
|
+
}, {
|
|
38243
|
+
form,
|
|
38244
|
+
groupFormId,
|
|
38245
|
+
isHighlighted
|
|
38246
|
+
}) => {
|
|
38173
38247
|
const formData = groupFormId ? (formsValue[groupFormId] || {})[name] || [] : formsValue[name] || [];
|
|
38174
38248
|
const onUpdate = (val, key) => {
|
|
38175
38249
|
const _val = {
|
|
38176
|
-
[name]:
|
|
38250
|
+
[name]: {
|
|
38251
|
+
...formData,
|
|
38177
38252
|
[key]: val
|
|
38178
|
-
}
|
|
38253
|
+
}
|
|
38179
38254
|
};
|
|
38180
38255
|
if (groupFormId) {
|
|
38181
|
-
const _defaultData =
|
|
38182
|
-
const _newData =
|
|
38183
|
-
|
|
38256
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38257
|
+
const _newData = {
|
|
38258
|
+
..._defaultData,
|
|
38259
|
+
..._val
|
|
38260
|
+
};
|
|
38261
|
+
onValuesChange(_newData, {
|
|
38262
|
+
...formsValue,
|
|
38184
38263
|
[groupFormId]: _newData
|
|
38185
|
-
})
|
|
38186
|
-
form
|
|
38187
|
-
setValues(
|
|
38264
|
+
});
|
|
38265
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38266
|
+
setValues({
|
|
38267
|
+
...formsValue,
|
|
38188
38268
|
[groupFormId]: _newData
|
|
38189
|
-
})
|
|
38269
|
+
});
|
|
38190
38270
|
return;
|
|
38191
38271
|
}
|
|
38192
|
-
onValuesChange(_val,
|
|
38193
|
-
|
|
38194
|
-
|
|
38272
|
+
onValuesChange(_val, {
|
|
38273
|
+
...formsValue,
|
|
38274
|
+
..._val
|
|
38275
|
+
});
|
|
38276
|
+
form?.setFieldValue(name, _val[name]);
|
|
38277
|
+
setValues({
|
|
38278
|
+
...formsValue,
|
|
38279
|
+
..._val
|
|
38280
|
+
});
|
|
38195
38281
|
};
|
|
38196
38282
|
return /*#__PURE__*/jsxRuntime.jsx(GroupCheckbox, {
|
|
38197
38283
|
form: input,
|
|
@@ -38200,91 +38286,96 @@ const inputTypeComponent$1 = {
|
|
|
38200
38286
|
isHighlighted: isHighlighted
|
|
38201
38287
|
});
|
|
38202
38288
|
},
|
|
38203
|
-
website: (
|
|
38204
|
-
|
|
38205
|
-
|
|
38206
|
-
|
|
38207
|
-
|
|
38208
|
-
|
|
38209
|
-
|
|
38210
|
-
|
|
38211
|
-
|
|
38212
|
-
|
|
38213
|
-
|
|
38214
|
-
|
|
38215
|
-
|
|
38216
|
-
|
|
38217
|
-
|
|
38218
|
-
} = _ref65;
|
|
38219
|
-
return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
|
|
38289
|
+
website: ({
|
|
38290
|
+
name,
|
|
38291
|
+
inputName,
|
|
38292
|
+
props,
|
|
38293
|
+
value,
|
|
38294
|
+
repeatIndex,
|
|
38295
|
+
repeatValues,
|
|
38296
|
+
formsValue
|
|
38297
|
+
}, {
|
|
38298
|
+
form,
|
|
38299
|
+
isHighlighted,
|
|
38300
|
+
inputMeta = {},
|
|
38301
|
+
t
|
|
38302
|
+
}) => {
|
|
38303
|
+
return /*#__PURE__*/jsxRuntime.jsx(Website, {
|
|
38220
38304
|
size: "large",
|
|
38221
38305
|
allowClear: true,
|
|
38222
|
-
initialValue: value
|
|
38223
|
-
|
|
38306
|
+
initialValue: value,
|
|
38307
|
+
...props,
|
|
38224
38308
|
onChange: val => updateFormValues$1(repeatIndex, repeatValues, inputName, val, formsValue, name, form),
|
|
38225
38309
|
className: formatClassname([isHighlighted && "highlighted-cont"]),
|
|
38226
38310
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
38227
38311
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com"
|
|
38228
|
-
})
|
|
38312
|
+
});
|
|
38229
38313
|
},
|
|
38230
|
-
group: (
|
|
38231
|
-
|
|
38232
|
-
|
|
38233
|
-
|
|
38234
|
-
|
|
38235
|
-
|
|
38236
|
-
|
|
38237
|
-
|
|
38238
|
-
|
|
38239
|
-
} = _ref67;
|
|
38240
|
-
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
|
|
38314
|
+
group: ({
|
|
38315
|
+
props,
|
|
38316
|
+
groupInputs,
|
|
38317
|
+
formsValue
|
|
38318
|
+
}, {
|
|
38319
|
+
inputMeta,
|
|
38320
|
+
isHighlighted
|
|
38321
|
+
}) => {
|
|
38322
|
+
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
|
|
38241
38323
|
formsValue: formsValue,
|
|
38242
38324
|
isHighlighted: isHighlighted,
|
|
38243
38325
|
groupInputs: groupInputs,
|
|
38244
|
-
inputMeta: inputMeta
|
|
38245
|
-
|
|
38326
|
+
inputMeta: inputMeta,
|
|
38327
|
+
...props
|
|
38328
|
+
});
|
|
38246
38329
|
},
|
|
38247
|
-
groupInputs: (
|
|
38248
|
-
|
|
38249
|
-
|
|
38250
|
-
|
|
38251
|
-
|
|
38252
|
-
|
|
38253
|
-
|
|
38254
|
-
|
|
38255
|
-
|
|
38256
|
-
} = _ref69;
|
|
38257
|
-
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
|
|
38330
|
+
groupInputs: ({
|
|
38331
|
+
props,
|
|
38332
|
+
groupInputs,
|
|
38333
|
+
formsValue
|
|
38334
|
+
}, {
|
|
38335
|
+
inputMeta,
|
|
38336
|
+
isHighlighted
|
|
38337
|
+
}) => {
|
|
38338
|
+
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
|
|
38258
38339
|
formsValue: formsValue,
|
|
38259
38340
|
isHighlighted: isHighlighted,
|
|
38260
38341
|
groupInputs: groupInputs,
|
|
38261
|
-
inputMeta: inputMeta
|
|
38262
|
-
|
|
38342
|
+
inputMeta: inputMeta,
|
|
38343
|
+
...props
|
|
38344
|
+
});
|
|
38263
38345
|
},
|
|
38264
|
-
smartHelp: (
|
|
38346
|
+
smartHelp: ({
|
|
38347
|
+
name,
|
|
38348
|
+
inputName,
|
|
38349
|
+
props,
|
|
38350
|
+
value,
|
|
38351
|
+
repeatIndex,
|
|
38352
|
+
repeatValues,
|
|
38353
|
+
formsValue
|
|
38354
|
+
}, {
|
|
38355
|
+
form,
|
|
38356
|
+
isHighlighted,
|
|
38357
|
+
inputMeta = {},
|
|
38358
|
+
t
|
|
38359
|
+
}) => {
|
|
38265
38360
|
return /*#__PURE__*/jsxRuntime.jsx(Smart, {});
|
|
38266
38361
|
}
|
|
38267
38362
|
};
|
|
38268
38363
|
const filterForm = (f, d) => {
|
|
38269
38364
|
return f && (f.showFormIf ? showHideForm(f, d) : true);
|
|
38270
38365
|
};
|
|
38271
|
-
const checkFormHasSubsections =
|
|
38272
|
-
let f = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
38273
|
-
return Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
|
|
38274
|
-
};
|
|
38366
|
+
const checkFormHasSubsections = (f = {}) => Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
|
|
38275
38367
|
const mapFormGroup = (f, d) => Object.keys(f).map(key => {
|
|
38276
|
-
const
|
|
38277
|
-
|
|
38278
|
-
|
|
38279
|
-
|
|
38280
|
-
|
|
38281
|
-
|
|
38282
|
-
|
|
38283
|
-
|
|
38284
|
-
|
|
38285
|
-
|
|
38286
|
-
|
|
38287
|
-
fc = _objectWithoutProperties(_ref72, _excluded2$1);
|
|
38368
|
+
const {
|
|
38369
|
+
label,
|
|
38370
|
+
description = "",
|
|
38371
|
+
excludeFromEdit,
|
|
38372
|
+
showFormIf,
|
|
38373
|
+
icon = "",
|
|
38374
|
+
position = 0,
|
|
38375
|
+
template,
|
|
38376
|
+
formClass,
|
|
38377
|
+
...fc
|
|
38378
|
+
} = f[key] || {};
|
|
38288
38379
|
const fConf = {
|
|
38289
38380
|
id: key,
|
|
38290
38381
|
label,
|
|
@@ -38343,14 +38434,11 @@ const groupSubForms = (fConf, d) => {
|
|
|
38343
38434
|
return f;
|
|
38344
38435
|
}, {});
|
|
38345
38436
|
};
|
|
38346
|
-
const inputIsEmpty =
|
|
38347
|
-
|
|
38348
|
-
let values = arguments.length > 1 ? arguments[1] : undefined;
|
|
38349
|
-
let inputMeta = arguments.length > 2 ? arguments[2] : undefined;
|
|
38350
|
-
if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
|
|
38437
|
+
const inputIsEmpty = (input = {}, values, inputMeta) => {
|
|
38438
|
+
if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
|
|
38351
38439
|
return false;
|
|
38352
38440
|
}
|
|
38353
|
-
if (
|
|
38441
|
+
if (input?.type === "groupInputs") {
|
|
38354
38442
|
return true;
|
|
38355
38443
|
}
|
|
38356
38444
|
const value = values[input.dataId];
|
|
@@ -38362,28 +38450,26 @@ const inputIsEmpty = function () {
|
|
|
38362
38450
|
}
|
|
38363
38451
|
return !value;
|
|
38364
38452
|
};
|
|
38365
|
-
const GetFormItem$1 =
|
|
38366
|
-
|
|
38367
|
-
|
|
38368
|
-
|
|
38369
|
-
|
|
38370
|
-
|
|
38371
|
-
|
|
38372
|
-
|
|
38373
|
-
|
|
38374
|
-
|
|
38375
|
-
|
|
38376
|
-
|
|
38377
|
-
|
|
38378
|
-
|
|
38379
|
-
|
|
38380
|
-
|
|
38381
|
-
|
|
38382
|
-
|
|
38383
|
-
|
|
38384
|
-
|
|
38385
|
-
namespace
|
|
38386
|
-
} = _ref73;
|
|
38453
|
+
const GetFormItem$1 = ({
|
|
38454
|
+
highlightMandatory,
|
|
38455
|
+
inputData,
|
|
38456
|
+
inputId,
|
|
38457
|
+
input,
|
|
38458
|
+
values,
|
|
38459
|
+
MainForm,
|
|
38460
|
+
options,
|
|
38461
|
+
plainForms,
|
|
38462
|
+
setValues,
|
|
38463
|
+
setAddress,
|
|
38464
|
+
i,
|
|
38465
|
+
inputKey,
|
|
38466
|
+
onValuesChange = () => {},
|
|
38467
|
+
setLoading = () => {},
|
|
38468
|
+
inputMeta = {},
|
|
38469
|
+
changeInputMeta = () => {},
|
|
38470
|
+
changeLinking = () => {},
|
|
38471
|
+
namespace
|
|
38472
|
+
}) => {
|
|
38387
38473
|
const {
|
|
38388
38474
|
t,
|
|
38389
38475
|
user,
|
|
@@ -38398,42 +38484,44 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38398
38484
|
staticWidth,
|
|
38399
38485
|
fullWidth
|
|
38400
38486
|
} = useEditContext();
|
|
38401
|
-
const lastReview = (
|
|
38487
|
+
const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
|
|
38402
38488
|
const [isShown, setIsShown] = React.useState(!!inputData.commentValue);
|
|
38403
38489
|
const inputLabel = getInputLabel$1(input, values);
|
|
38404
38490
|
const onClickReviewSuccess = () => {
|
|
38405
38491
|
if (!isReview) {
|
|
38406
38492
|
return;
|
|
38407
38493
|
}
|
|
38408
|
-
const reviewSuccess = lastReview
|
|
38494
|
+
const reviewSuccess = lastReview?.reviewSuccess;
|
|
38409
38495
|
changeInputMeta({
|
|
38410
38496
|
key: inputId,
|
|
38411
38497
|
type: input.type,
|
|
38412
|
-
value:
|
|
38498
|
+
value: {
|
|
38499
|
+
...inputMeta,
|
|
38413
38500
|
reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
|
|
38414
38501
|
reviewer: user,
|
|
38415
38502
|
createdAt: new Date().toISOString(),
|
|
38416
38503
|
reviewSuccess: true
|
|
38417
38504
|
}]
|
|
38418
|
-
}
|
|
38505
|
+
}
|
|
38419
38506
|
});
|
|
38420
38507
|
};
|
|
38421
38508
|
const onClickReviewError = () => {
|
|
38422
38509
|
if (!isReview) {
|
|
38423
38510
|
return;
|
|
38424
38511
|
}
|
|
38425
|
-
const reviewError = lastReview
|
|
38512
|
+
const reviewError = lastReview?.reviewError;
|
|
38426
38513
|
changeInputMeta({
|
|
38427
38514
|
key: inputId,
|
|
38428
38515
|
type: input.type,
|
|
38429
|
-
value:
|
|
38516
|
+
value: {
|
|
38517
|
+
...inputMeta,
|
|
38430
38518
|
reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
|
|
38431
38519
|
reviewer: user,
|
|
38432
38520
|
createdAt: new Date().toISOString(),
|
|
38433
38521
|
reviewError: true,
|
|
38434
38522
|
comment: ""
|
|
38435
38523
|
}]
|
|
38436
|
-
}
|
|
38524
|
+
}
|
|
38437
38525
|
});
|
|
38438
38526
|
};
|
|
38439
38527
|
switch (input.type) {
|
|
@@ -38447,12 +38535,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38447
38535
|
case "header":
|
|
38448
38536
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38449
38537
|
className: "daf-title with-subtitle",
|
|
38450
|
-
style: input
|
|
38538
|
+
style: input?.meta?.style,
|
|
38451
38539
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38452
38540
|
className: "flex",
|
|
38453
38541
|
children: [/*#__PURE__*/jsxRuntime.jsx("h1", {
|
|
38454
38542
|
children: ReactHtmlParser__default["default"](getLabel$1(input.label, values))
|
|
38455
|
-
}), !!input.description || input
|
|
38543
|
+
}), !!input.description || input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
|
|
38456
38544
|
content: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38457
38545
|
className: "tooltip-popover-cont",
|
|
38458
38546
|
children: ReactHtmlParser__default["default"](input.description)
|
|
@@ -38479,7 +38567,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38479
38567
|
const specialCharsRule = rules.find(r => r.type === "specialCharacters");
|
|
38480
38568
|
|
|
38481
38569
|
// eslint-disable-next-line no-case-declarations
|
|
38482
|
-
let maxRule =
|
|
38570
|
+
let maxRule = rules.find(rule => rule.max)?.max;
|
|
38483
38571
|
if (!maxRule && input.type === "textarea") {
|
|
38484
38572
|
maxRule = MAX_TEXT_AREA_LENGTH;
|
|
38485
38573
|
}
|
|
@@ -38492,30 +38580,27 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38492
38580
|
message: requiredRule.message || ""
|
|
38493
38581
|
});
|
|
38494
38582
|
}
|
|
38495
|
-
const isHighlighted = highlightMandatory &&
|
|
38583
|
+
const isHighlighted = highlightMandatory && input?.meta?.mandatory && inputIsEmpty(input, values, inputMeta);
|
|
38496
38584
|
if (requiredRule || specialCharsRule) {
|
|
38497
38585
|
if (input.type === "groupInputs") {
|
|
38498
38586
|
rules = rules.map(r => {
|
|
38499
38587
|
if (r.required) {
|
|
38500
|
-
return
|
|
38501
|
-
|
|
38502
|
-
|
|
38503
|
-
|
|
38504
|
-
|
|
38505
|
-
validator() {
|
|
38506
|
-
if (inputMeta.notAvailable || inputMeta.notApplicable) {
|
|
38507
|
-
return Promise.resolve();
|
|
38508
|
-
}
|
|
38509
|
-
const keys = Object.keys(input.inputs);
|
|
38510
|
-
for (let i = 0; i < keys.length; i++) {
|
|
38511
|
-
if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
|
|
38512
|
-
return Promise.reject(r.message);
|
|
38513
|
-
}
|
|
38514
|
-
}
|
|
38588
|
+
return ({
|
|
38589
|
+
getFieldValue
|
|
38590
|
+
}) => ({
|
|
38591
|
+
validator() {
|
|
38592
|
+
if (inputMeta.notAvailable || inputMeta.notApplicable) {
|
|
38515
38593
|
return Promise.resolve();
|
|
38516
38594
|
}
|
|
38517
|
-
|
|
38518
|
-
|
|
38595
|
+
const keys = Object.keys(input.inputs);
|
|
38596
|
+
for (let i = 0; i < keys.length; i++) {
|
|
38597
|
+
if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
|
|
38598
|
+
return Promise.reject(r.message);
|
|
38599
|
+
}
|
|
38600
|
+
}
|
|
38601
|
+
return Promise.resolve();
|
|
38602
|
+
}
|
|
38603
|
+
});
|
|
38519
38604
|
}
|
|
38520
38605
|
return r;
|
|
38521
38606
|
});
|
|
@@ -38553,13 +38638,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38553
38638
|
}
|
|
38554
38639
|
}
|
|
38555
38640
|
if (input && typeof input === "object") {
|
|
38556
|
-
var _input$meta22, _input$meta23, _input$meta24, _input$meta25, _values$parent, _input$meta26, _input$meta27, _inputData$value, _input$meta28, _input$meta29, _inputData$commentVal, _lastReview$comment, _lastReview$reviewer, _lastReview$reviewer2;
|
|
38557
38641
|
// check if input is valid
|
|
38558
38642
|
const hideComment = namespace === "project-readiness";
|
|
38559
38643
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
38560
38644
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38561
38645
|
className: "flex-row input-cont",
|
|
38562
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item,
|
|
38646
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38563
38647
|
extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
38564
38648
|
children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38565
38649
|
className: formatClassname(["ml-4 input-actions"]),
|
|
@@ -38569,7 +38653,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38569
38653
|
title: t("Add review note"),
|
|
38570
38654
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38571
38655
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38572
|
-
className: formatClassname(["review-btn review-error-btn",
|
|
38656
|
+
className: formatClassname(["review-btn review-error-btn", lastReview?.reviewError && "primary"]),
|
|
38573
38657
|
type: "link",
|
|
38574
38658
|
onClick: onClickReviewError,
|
|
38575
38659
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
@@ -38585,7 +38669,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38585
38669
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38586
38670
|
type: "link",
|
|
38587
38671
|
onClick: onClickReviewSuccess,
|
|
38588
|
-
className: formatClassname(["review-btn review-success-btn",
|
|
38672
|
+
className: formatClassname(["review-btn review-success-btn", lastReview?.reviewSuccess && "primary"]),
|
|
38589
38673
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
38590
38674
|
name: "CheckSquare",
|
|
38591
38675
|
width: 16,
|
|
@@ -38622,7 +38706,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38622
38706
|
}
|
|
38623
38707
|
});
|
|
38624
38708
|
},
|
|
38625
|
-
disabled: !
|
|
38709
|
+
disabled: !input.meta?.notApplicable,
|
|
38626
38710
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
38627
38711
|
name: "NotApplicable",
|
|
38628
38712
|
width: 16,
|
|
@@ -38636,7 +38720,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38636
38720
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38637
38721
|
className: formatClassname(["default p-0", inputMeta.notAvailable && "primary"]),
|
|
38638
38722
|
type: "link",
|
|
38639
|
-
disabled: !
|
|
38723
|
+
disabled: !input.meta?.notAvailable,
|
|
38640
38724
|
onClick: () => {
|
|
38641
38725
|
const value = getDefaultInputValue(input);
|
|
38642
38726
|
MainForm.setFields([{
|
|
@@ -38668,14 +38752,14 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38668
38752
|
}), !hideComment ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
38669
38753
|
title: t("Add comment"),
|
|
38670
38754
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38671
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button,
|
|
38755
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38672
38756
|
type: "link",
|
|
38673
|
-
disabled: !
|
|
38674
|
-
|
|
38675
|
-
|
|
38676
|
-
|
|
38677
|
-
|
|
38678
|
-
|
|
38757
|
+
disabled: !input.meta?.comment,
|
|
38758
|
+
...(!isShown ? {
|
|
38759
|
+
className: "default p-0"
|
|
38760
|
+
} : {
|
|
38761
|
+
className: "p-0 primary"
|
|
38762
|
+
}),
|
|
38679
38763
|
onClick: () => {
|
|
38680
38764
|
if (inputMeta.comment !== undefined && inputMeta.comment !== null) {
|
|
38681
38765
|
return;
|
|
@@ -38694,7 +38778,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38694
38778
|
width: 16,
|
|
38695
38779
|
height: 16
|
|
38696
38780
|
})
|
|
38697
|
-
})
|
|
38781
|
+
})
|
|
38698
38782
|
})
|
|
38699
38783
|
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
38700
38784
|
title: t("Project Readiness"),
|
|
@@ -38713,34 +38797,36 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38713
38797
|
}) : null]
|
|
38714
38798
|
}) : null
|
|
38715
38799
|
}),
|
|
38716
|
-
initialValue: inputMeta
|
|
38717
|
-
|
|
38718
|
-
|
|
38719
|
-
|
|
38720
|
-
|
|
38721
|
-
|
|
38722
|
-
|
|
38723
|
-
|
|
38724
|
-
|
|
38725
|
-
|
|
38726
|
-
|
|
38727
|
-
|
|
38728
|
-
|
|
38729
|
-
|
|
38730
|
-
if (f.response) {
|
|
38731
|
-
return f.response;
|
|
38800
|
+
initialValue: inputMeta?.defaultValue,
|
|
38801
|
+
...(inputOnBlur.includes(input.type) ? {
|
|
38802
|
+
trigger: "onBlur"
|
|
38803
|
+
} : {}),
|
|
38804
|
+
...(["total100", "group"].includes(input.type) ? {} : {
|
|
38805
|
+
name: inputId,
|
|
38806
|
+
fieldKey: inputId,
|
|
38807
|
+
initialValue: inputData.value
|
|
38808
|
+
}),
|
|
38809
|
+
...(["upload"].includes(input.type) ? {
|
|
38810
|
+
valuePropName: "fileList",
|
|
38811
|
+
getValueFromEvent: e => {
|
|
38812
|
+
if (Array.isArray(e)) {
|
|
38813
|
+
return e;
|
|
38732
38814
|
}
|
|
38733
|
-
return f
|
|
38734
|
-
|
|
38735
|
-
|
|
38736
|
-
|
|
38737
|
-
|
|
38815
|
+
return e && e.fileList && e.fileList.map(f => {
|
|
38816
|
+
if (f.response) {
|
|
38817
|
+
return f.response;
|
|
38818
|
+
}
|
|
38819
|
+
return f;
|
|
38820
|
+
});
|
|
38821
|
+
}
|
|
38822
|
+
} : {}),
|
|
38823
|
+
className: formatClassname([`i-${input.type} flex-1`, input.comment && "with-comment", maxRule && "with-max-rule"]),
|
|
38738
38824
|
"data-id": inputData.name,
|
|
38739
38825
|
rules: rules,
|
|
38740
38826
|
required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
|
|
38741
38827
|
labelCol: 12,
|
|
38742
38828
|
label: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38743
|
-
className: formatClassname(["flex",
|
|
38829
|
+
className: formatClassname(["flex", input?.meta?.code && "mr-10"]),
|
|
38744
38830
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38745
38831
|
className: "mr-1",
|
|
38746
38832
|
children: getInputLabel$1(input, values)
|
|
@@ -38753,7 +38839,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38753
38839
|
config: input,
|
|
38754
38840
|
t: t,
|
|
38755
38841
|
ajaxForms: ajaxForms,
|
|
38756
|
-
linkingData:
|
|
38842
|
+
linkingData: values?.linking || values?.parent?.linking,
|
|
38757
38843
|
changeAjaxForms: changeAjaxForms,
|
|
38758
38844
|
getApiBaseUrl: getApiBaseUrl,
|
|
38759
38845
|
getAppHeader: getAppHeader,
|
|
@@ -38761,11 +38847,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38761
38847
|
getToken: getToken,
|
|
38762
38848
|
app: app,
|
|
38763
38849
|
valueOnlyString: true
|
|
38764
|
-
}) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](
|
|
38850
|
+
}) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
|
|
38851
|
+
...inputData,
|
|
38765
38852
|
maxWidth,
|
|
38766
38853
|
staticWidth,
|
|
38767
38854
|
fullWidth
|
|
38768
|
-
}
|
|
38855
|
+
}, {
|
|
38769
38856
|
form: MainForm,
|
|
38770
38857
|
forms: options,
|
|
38771
38858
|
allForms: plainForms,
|
|
@@ -38786,10 +38873,10 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38786
38873
|
staticWidth,
|
|
38787
38874
|
fullWidth
|
|
38788
38875
|
}) : console.log(input)
|
|
38789
|
-
})
|
|
38876
|
+
}), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38790
38877
|
className: "code",
|
|
38791
38878
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
38792
|
-
children:
|
|
38879
|
+
children: input.meta?.code
|
|
38793
38880
|
})
|
|
38794
38881
|
}) : null]
|
|
38795
38882
|
}), maxRule ? ["imageUpload", "upload", "videoUpload"].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -38809,10 +38896,10 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38809
38896
|
className: "max-char-span",
|
|
38810
38897
|
children: t("max-char", {
|
|
38811
38898
|
chars: maxRule,
|
|
38812
|
-
filled:
|
|
38899
|
+
filled: inputData?.value?.length || 0
|
|
38813
38900
|
})
|
|
38814
38901
|
})
|
|
38815
|
-
}) : null,
|
|
38902
|
+
}) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38816
38903
|
className: "input-content",
|
|
38817
38904
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38818
38905
|
className: "comment-textarea",
|
|
@@ -38838,7 +38925,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38838
38925
|
},
|
|
38839
38926
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38840
38927
|
type: "link",
|
|
38841
|
-
disabled: !
|
|
38928
|
+
disabled: !input.meta?.comment,
|
|
38842
38929
|
className: "p-0",
|
|
38843
38930
|
children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
|
|
38844
38931
|
width: 16,
|
|
@@ -38847,11 +38934,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38847
38934
|
})
|
|
38848
38935
|
})]
|
|
38849
38936
|
}),
|
|
38850
|
-
children: inputTypeComponent$1.comment(
|
|
38937
|
+
children: inputTypeComponent$1.comment({
|
|
38938
|
+
...inputData,
|
|
38851
38939
|
maxWidth,
|
|
38852
38940
|
staticWidth,
|
|
38853
38941
|
fullWidth
|
|
38854
|
-
}
|
|
38942
|
+
}, {
|
|
38855
38943
|
form: MainForm,
|
|
38856
38944
|
forms: options,
|
|
38857
38945
|
setFormValues: setValues,
|
|
@@ -38876,16 +38964,16 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38876
38964
|
className: "max-char-span",
|
|
38877
38965
|
children: t("max-char", {
|
|
38878
38966
|
chars: MAX_COMMENTS_LENGTH,
|
|
38879
|
-
filled:
|
|
38967
|
+
filled: inputData?.commentValue?.length || 0
|
|
38880
38968
|
})
|
|
38881
38969
|
})]
|
|
38882
|
-
}) : null, lastReview
|
|
38970
|
+
}) : null, lastReview?.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38883
38971
|
className: "input-content",
|
|
38884
38972
|
children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
38885
38973
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38886
38974
|
className: "comment-textarea",
|
|
38887
|
-
initialValue:
|
|
38888
|
-
name:
|
|
38975
|
+
initialValue: lastReview?.comment || "",
|
|
38976
|
+
name: `${inputId}-reviewErrorComment`,
|
|
38889
38977
|
label: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38890
38978
|
className: "flex w-100",
|
|
38891
38979
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -38893,28 +38981,31 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38893
38981
|
children: t("Review note")
|
|
38894
38982
|
})
|
|
38895
38983
|
}),
|
|
38896
|
-
children: inputTypeComponent$1.comment(
|
|
38984
|
+
children: inputTypeComponent$1.comment({
|
|
38985
|
+
...inputData,
|
|
38897
38986
|
maxWidth,
|
|
38898
38987
|
staticWidth,
|
|
38899
38988
|
fullWidth
|
|
38900
|
-
}
|
|
38989
|
+
}, {
|
|
38901
38990
|
form: MainForm,
|
|
38902
38991
|
forms: options,
|
|
38903
|
-
value:
|
|
38992
|
+
value: lastReview?.comment || "",
|
|
38904
38993
|
onChange: val => {
|
|
38905
38994
|
changeInputMeta({
|
|
38906
38995
|
key: inputId,
|
|
38907
38996
|
type: input.type,
|
|
38908
|
-
value:
|
|
38909
|
-
|
|
38997
|
+
value: {
|
|
38998
|
+
...inputMeta,
|
|
38999
|
+
reviews: (inputMeta?.reviews || []).map(v => {
|
|
38910
39000
|
if (v.createdAt === lastReview.createdAt) {
|
|
38911
|
-
return
|
|
39001
|
+
return {
|
|
39002
|
+
...v,
|
|
38912
39003
|
comment: val
|
|
38913
|
-
}
|
|
39004
|
+
};
|
|
38914
39005
|
}
|
|
38915
39006
|
return v;
|
|
38916
39007
|
})
|
|
38917
|
-
}
|
|
39008
|
+
}
|
|
38918
39009
|
});
|
|
38919
39010
|
},
|
|
38920
39011
|
t,
|
|
@@ -38928,7 +39019,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38928
39019
|
className: "max-char-span",
|
|
38929
39020
|
children: t("max-char", {
|
|
38930
39021
|
chars: MAX_COMMENTS_LENGTH,
|
|
38931
|
-
filled:
|
|
39022
|
+
filled: lastReview.comment?.length || 0
|
|
38932
39023
|
})
|
|
38933
39024
|
})]
|
|
38934
39025
|
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -38949,7 +39040,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38949
39040
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38950
39041
|
className: "flex flex-column justify-center mr-1",
|
|
38951
39042
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
38952
|
-
children:
|
|
39043
|
+
children: lastReview?.reviewer?.firstName + " " + lastReview?.reviewer?.lastName + " - " + moment__default["default"](lastReview.createdAt).format("DD MMM YYYY")
|
|
38953
39044
|
})
|
|
38954
39045
|
})]
|
|
38955
39046
|
})]
|
|
@@ -38960,14 +39051,13 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38960
39051
|
return null;
|
|
38961
39052
|
}
|
|
38962
39053
|
};
|
|
38963
|
-
const editErrorHandler =
|
|
38964
|
-
|
|
38965
|
-
|
|
38966
|
-
|
|
38967
|
-
} = _ref76;
|
|
39054
|
+
const editErrorHandler = ({
|
|
39055
|
+
errorFields,
|
|
39056
|
+
t = s => s
|
|
39057
|
+
}) => {
|
|
38968
39058
|
if (Array.isArray(errorFields) && errorFields.length) {
|
|
38969
39059
|
const name = errorFields[0].name.join(".");
|
|
38970
|
-
const element = document.querySelector(
|
|
39060
|
+
const element = document.querySelector(`[data-id="${name}"]`);
|
|
38971
39061
|
if (element) {
|
|
38972
39062
|
element.scrollIntoView();
|
|
38973
39063
|
antd.message.error(t("errors::please-correct-invalid-inputs"));
|
|
@@ -47901,7 +47991,7 @@ function AvatarGroup(_ref) {
|
|
|
47901
47991
|
|
|
47902
47992
|
const Container$1 = styled__default["default"].div`
|
|
47903
47993
|
height: ${props => props.height || '300px'};
|
|
47904
|
-
width: ${props => props.isPdf ? props.width ? props.width : '1000px' : 'calc(100% - 48px)'};
|
|
47994
|
+
width: ${props => props.isPdf ? props.width ? props.width : '1000px' : 'calc(100% - 48px)'};
|
|
47905
47995
|
`;
|
|
47906
47996
|
|
|
47907
47997
|
const _excluded$9 = ["data", "xFieldKey", "yFieldKey", "renderTooltipContent", "tooltipConfig", "animated", "isStack", "isGroup", "isPercentage", "seriesField", "formattedYAxis", "formattedXAxis", "color", "height", "t", "isPdf", "legendConfig", "width", "xAxisConfig"];
|
|
@@ -49444,6 +49534,45 @@ const RadarChart = _ref => {
|
|
|
49444
49534
|
legendConfig,
|
|
49445
49535
|
isPdf
|
|
49446
49536
|
});
|
|
49537
|
+
|
|
49538
|
+
// Helper function to wrap long text labels to multiple lines
|
|
49539
|
+
// Ensures text is never hidden - wraps to multiple lines if needed
|
|
49540
|
+
const wrapLabel = React.useCallback(function (text) {
|
|
49541
|
+
let maxLength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
|
|
49542
|
+
if (!text) {
|
|
49543
|
+
return '';
|
|
49544
|
+
}
|
|
49545
|
+
const formattedText = formattedXAxis(text);
|
|
49546
|
+
|
|
49547
|
+
// If text is short enough, return as is
|
|
49548
|
+
if (formattedText.length <= maxLength) {
|
|
49549
|
+
return formattedText;
|
|
49550
|
+
}
|
|
49551
|
+
|
|
49552
|
+
// Split by spaces to find word boundaries
|
|
49553
|
+
const words = formattedText.split(' ');
|
|
49554
|
+
const lines = [];
|
|
49555
|
+
let currentLine = '';
|
|
49556
|
+
words.forEach((word, index) => {
|
|
49557
|
+
// If adding this word would exceed maxLength, start a new line
|
|
49558
|
+
if (currentLine && (currentLine + ' ' + word).length > maxLength) {
|
|
49559
|
+
if (currentLine) {
|
|
49560
|
+
lines.push(currentLine);
|
|
49561
|
+
}
|
|
49562
|
+
currentLine = word;
|
|
49563
|
+
} else {
|
|
49564
|
+
currentLine = currentLine ? currentLine + ' ' + word : word;
|
|
49565
|
+
}
|
|
49566
|
+
|
|
49567
|
+
// If it's the last word, add it to lines
|
|
49568
|
+
if (index === words.length - 1 && currentLine) {
|
|
49569
|
+
lines.push(currentLine);
|
|
49570
|
+
}
|
|
49571
|
+
});
|
|
49572
|
+
|
|
49573
|
+
// Ensure we always return something - never empty
|
|
49574
|
+
return lines.length > 0 ? lines.join('\n') : formattedText;
|
|
49575
|
+
}, [formattedXAxis]);
|
|
49447
49576
|
React.useEffect(() => {
|
|
49448
49577
|
if (!containerRef.current) {
|
|
49449
49578
|
return;
|
|
@@ -49462,9 +49591,21 @@ const RadarChart = _ref => {
|
|
|
49462
49591
|
showMarkers: true
|
|
49463
49592
|
}, tooltipConfig),
|
|
49464
49593
|
color: color || token.colorPrimary7,
|
|
49594
|
+
// Increased padding to ensure labels are never clipped
|
|
49595
|
+
padding: [50, 50, 50, 50],
|
|
49465
49596
|
xAxis: {
|
|
49466
49597
|
label: {
|
|
49467
|
-
formatter:
|
|
49598
|
+
formatter: text => wrapLabel(text, 10),
|
|
49599
|
+
offset: 15,
|
|
49600
|
+
autoRotate: false,
|
|
49601
|
+
autoHide: false,
|
|
49602
|
+
// Never hide labels
|
|
49603
|
+
autoEllipsis: false,
|
|
49604
|
+
// Never truncate with ellipsis
|
|
49605
|
+
style: {
|
|
49606
|
+
fontSize: 12,
|
|
49607
|
+
fill: '#666'
|
|
49608
|
+
}
|
|
49468
49609
|
},
|
|
49469
49610
|
line: null,
|
|
49470
49611
|
tickLine: null,
|
|
@@ -49519,7 +49660,7 @@ const RadarChart = _ref => {
|
|
|
49519
49660
|
} else {
|
|
49520
49661
|
chartRef.current.update(chartConfig);
|
|
49521
49662
|
}
|
|
49522
|
-
}, [data, xFieldKey, yFieldKey, seriesField, renderTooltipContent, tooltipConfig, animated, color, formattedYAxis, formattedXAxis, score, token.colorPrimary7, rest]);
|
|
49663
|
+
}, [data, xFieldKey, yFieldKey, seriesField, renderTooltipContent, tooltipConfig, animated, color, formattedYAxis, formattedXAxis, score, token.colorPrimary7, wrapLabel, rest]);
|
|
49523
49664
|
React.useEffect(() => {
|
|
49524
49665
|
return () => {
|
|
49525
49666
|
if (chartRef.current) {
|