datastake-daf 0.6.838 → 0.6.840
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 +1578 -1443
- package/dist/pages/index.js +80 -33
- package/dist/utils/index.js +4 -0
- package/package.json +1 -1
- package/src/@daf/hooks/useTimeFilter.js +1 -1
- package/src/@daf/pages/Dashboards/ConflictManagement/components/RisksWidget/components/ProblemSolver/index.js +1 -1
- package/src/@daf/pages/Dashboards/SelfAssesment/components/ProductionSites/index.jsx +2 -1
- package/src/@daf/pages/Dashboards/SelfAssesment/index.jsx +3 -2
- package/src/@daf/pages/ResetPassword/index.jsx +228 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CommunityParticipation/JobsTimeline/index.jsx +7 -15
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CycleOutcomes/PlantingActivitiesTimeline.jsx +6 -0
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CycleOutcomes/RestoredArea.jsx +1 -0
- package/src/@daf/pages/Summary/Operator/components/Governance/config.js +1 -1
- package/src/@daf/pages/Summary/Operator/components/TradeRelationships/helper.js +1 -0
- package/src/@daf/pages/Summary/Operator/components/TradeRelationships/index.js +10 -6
- package/src/@daf/utils/timeFilterUtils.js +43 -14
- package/src/constants/locales/en/translation.js +2 -0
- package/src/constants/locales/fr/translation.js +1 -0
- package/src/constants/locales/sp/translation.js +1 -0
- package/src/index.js +6 -1
- package/build/favicon.ico +0 -0
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +0 -25
- package/build/robots.txt +0 -3
- package/dist/style/datastake/mapbox-gl.css +0 -330
package/dist/components/index.js
CHANGED
|
@@ -4827,7 +4827,7 @@ const config$2 = {
|
|
|
4827
4827
|
AddDocument: config$3
|
|
4828
4828
|
};
|
|
4829
4829
|
|
|
4830
|
-
const _excluded$
|
|
4830
|
+
const _excluded$E = ["width", "height", "size", "name", "fill"];
|
|
4831
4831
|
const CustomIcon = _ref => {
|
|
4832
4832
|
let {
|
|
4833
4833
|
width = 14,
|
|
@@ -4836,7 +4836,7 @@ const CustomIcon = _ref => {
|
|
|
4836
4836
|
name = "",
|
|
4837
4837
|
fill = "none"
|
|
4838
4838
|
} = _ref,
|
|
4839
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
4839
|
+
props = _objectWithoutProperties(_ref, _excluded$E);
|
|
4840
4840
|
const conf = config$2[name];
|
|
4841
4841
|
if (conf) {
|
|
4842
4842
|
return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -5125,7 +5125,7 @@ createCommonjsModule(function (module, exports) {
|
|
|
5125
5125
|
!function(e,n){module.exports=n();}(commonjsGlobal,(function(){return {name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var n=["th","st","nd","rd"],t=e%100;return "["+e+(n[(t-20)%10]||n[t]||n[0])+"]"}}}));
|
|
5126
5126
|
});
|
|
5127
5127
|
|
|
5128
|
-
const _excluded$
|
|
5128
|
+
const _excluded$D = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
|
|
5129
5129
|
dayjs__default["default"].extend(customParseFormat);
|
|
5130
5130
|
dayjs__default["default"].extend(utc);
|
|
5131
5131
|
dayjs__default["default"].extend(utc);
|
|
@@ -5501,7 +5501,7 @@ const filterCreateData = data => {
|
|
|
5501
5501
|
createdAt,
|
|
5502
5502
|
updatedAt
|
|
5503
5503
|
} = data,
|
|
5504
|
-
rest = _objectWithoutProperties(data, _excluded$
|
|
5504
|
+
rest = _objectWithoutProperties(data, _excluded$D);
|
|
5505
5505
|
const _meta = isObjectEmpty(meta) ? undefined : meta;
|
|
5506
5506
|
return _objectSpread2(_objectSpread2({}, rest), {}, {
|
|
5507
5507
|
meta: _meta
|
|
@@ -6033,7 +6033,7 @@ SelectFilters.propTypes = {
|
|
|
6033
6033
|
apiUrl: PropTypes__default["default"].string
|
|
6034
6034
|
};
|
|
6035
6035
|
|
|
6036
|
-
const _excluded$
|
|
6036
|
+
const _excluded$C = ["columns", "data", "defaultFilters", "style", "pagination", "loading", "onChange", "onFilterChange", "selectOptions", "filtersConfig", "rowSelection", "setShowFilters", "rowKey", "showFilters", "hideOnLoading", "sourcesKey", "className", "projects", "t", "selectedProject", "sourceId", "projectSources", "language", "scrollX", "apiUrl", "app", "doEmptyRows"];
|
|
6037
6037
|
function DAFTable(_ref) {
|
|
6038
6038
|
let {
|
|
6039
6039
|
columns = [],
|
|
@@ -6064,7 +6064,7 @@ function DAFTable(_ref) {
|
|
|
6064
6064
|
app,
|
|
6065
6065
|
doEmptyRows
|
|
6066
6066
|
} = _ref,
|
|
6067
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
6067
|
+
rest = _objectWithoutProperties(_ref, _excluded$C);
|
|
6068
6068
|
const source = React.useMemo(() => {
|
|
6069
6069
|
if (data && Array.isArray(data)) {
|
|
6070
6070
|
return data;
|
|
@@ -6889,7 +6889,7 @@ function ComponentWithFocus(_ref) {
|
|
|
6889
6889
|
}
|
|
6890
6890
|
|
|
6891
6891
|
var _templateObject$h;
|
|
6892
|
-
const _excluded$
|
|
6892
|
+
const _excluded$B = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
|
|
6893
6893
|
function StickyTable(_ref) {
|
|
6894
6894
|
let {
|
|
6895
6895
|
size = "small",
|
|
@@ -6900,7 +6900,7 @@ function StickyTable(_ref) {
|
|
|
6900
6900
|
pagination = false,
|
|
6901
6901
|
doEmptyRows = true
|
|
6902
6902
|
} = _ref,
|
|
6903
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
6903
|
+
props = _objectWithoutProperties(_ref, _excluded$B);
|
|
6904
6904
|
const data = React__default["default"].useMemo(() => {
|
|
6905
6905
|
if (!doEmptyRows) {
|
|
6906
6906
|
return dataSource;
|
|
@@ -7428,7 +7428,7 @@ const BTN_SIZE = {
|
|
|
7428
7428
|
LG: 'large'
|
|
7429
7429
|
};
|
|
7430
7430
|
|
|
7431
|
-
const _excluded$
|
|
7431
|
+
const _excluded$A = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
|
|
7432
7432
|
function DafButton(_ref) {
|
|
7433
7433
|
let {
|
|
7434
7434
|
content = '',
|
|
@@ -7442,7 +7442,7 @@ function DafButton(_ref) {
|
|
|
7442
7442
|
style = {},
|
|
7443
7443
|
className = ''
|
|
7444
7444
|
} = _ref,
|
|
7445
|
-
restProps = _objectWithoutProperties(_ref, _excluded$
|
|
7445
|
+
restProps = _objectWithoutProperties(_ref, _excluded$A);
|
|
7446
7446
|
return /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
|
|
7447
7447
|
icon: icon,
|
|
7448
7448
|
type: type,
|
|
@@ -7561,12 +7561,12 @@ const Style$R = styled__default["default"].div`
|
|
|
7561
7561
|
}
|
|
7562
7562
|
`;
|
|
7563
7563
|
|
|
7564
|
-
const _excluded$
|
|
7564
|
+
const _excluded$z = ["children"];
|
|
7565
7565
|
const BorderedButton = _ref => {
|
|
7566
7566
|
let {
|
|
7567
7567
|
children
|
|
7568
7568
|
} = _ref,
|
|
7569
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
7569
|
+
props = _objectWithoutProperties(_ref, _excluded$z);
|
|
7570
7570
|
return /*#__PURE__*/jsxRuntime.jsx(Style$R, {
|
|
7571
7571
|
className: "d-btn-cont",
|
|
7572
7572
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -7706,12 +7706,12 @@ Badge.propTypes = {
|
|
|
7706
7706
|
props: PropTypes__default["default"].object
|
|
7707
7707
|
};
|
|
7708
7708
|
|
|
7709
|
-
const _excluded$
|
|
7709
|
+
const _excluded$y = ["icon"];
|
|
7710
7710
|
function GetIcon(_ref) {
|
|
7711
7711
|
let {
|
|
7712
7712
|
icon
|
|
7713
7713
|
} = _ref,
|
|
7714
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
7714
|
+
props = _objectWithoutProperties(_ref, _excluded$y);
|
|
7715
7715
|
let Icon = Icons__namespace.CloseOutlined;
|
|
7716
7716
|
if (Icons__namespace[icon]) {
|
|
7717
7717
|
Icon = Icons__namespace[icon];
|
|
@@ -8041,7 +8041,7 @@ const MultiSelectStyled = styled__default["default"](antd.Select)`
|
|
|
8041
8041
|
}
|
|
8042
8042
|
`;
|
|
8043
8043
|
|
|
8044
|
-
const _excluded$
|
|
8044
|
+
const _excluded$x = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
|
|
8045
8045
|
const {
|
|
8046
8046
|
useToken: useToken$p
|
|
8047
8047
|
} = antd.theme;
|
|
@@ -8134,7 +8134,7 @@ function Multiselect(_ref) {
|
|
|
8134
8134
|
isSingle = false,
|
|
8135
8135
|
selectionType = SELECTION_TYPES.DEFAULT
|
|
8136
8136
|
} = _ref,
|
|
8137
|
-
restProps = _objectWithoutProperties(_ref, _excluded$
|
|
8137
|
+
restProps = _objectWithoutProperties(_ref, _excluded$x);
|
|
8138
8138
|
const {
|
|
8139
8139
|
token
|
|
8140
8140
|
} = useToken$p();
|
|
@@ -8854,7 +8854,7 @@ DAFHeader.propTypes = {
|
|
|
8854
8854
|
filtersConfig: PropTypes__default["default"].any
|
|
8855
8855
|
};
|
|
8856
8856
|
|
|
8857
|
-
const _excluded$
|
|
8857
|
+
const _excluded$w = ["tabs", "onChange", "value", "className"];
|
|
8858
8858
|
function TabsHeader(_ref) {
|
|
8859
8859
|
let {
|
|
8860
8860
|
tabs = [],
|
|
@@ -8862,7 +8862,7 @@ function TabsHeader(_ref) {
|
|
|
8862
8862
|
value = '',
|
|
8863
8863
|
className = 'mt-2'
|
|
8864
8864
|
} = _ref,
|
|
8865
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
8865
|
+
rest = _objectWithoutProperties(_ref, _excluded$w);
|
|
8866
8866
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8867
8867
|
className: formatClassname(['daf-tabs-header pl-6 pr-6', className]),
|
|
8868
8868
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Tabs, _objectSpread2({
|
|
@@ -8959,7 +8959,7 @@ DrawerHeader.propTypes = {
|
|
|
8959
8959
|
tabsConfig: PropTypes__default["default"].any
|
|
8960
8960
|
};
|
|
8961
8961
|
|
|
8962
|
-
const _excluded$
|
|
8962
|
+
const _excluded$v = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
|
|
8963
8963
|
const useFooter = _ref => {
|
|
8964
8964
|
let {
|
|
8965
8965
|
leftContent,
|
|
@@ -8994,7 +8994,7 @@ const useFooter = _ref => {
|
|
|
8994
8994
|
style = {},
|
|
8995
8995
|
className = ""
|
|
8996
8996
|
} = button,
|
|
8997
|
-
restProps = _objectWithoutProperties(button, _excluded$
|
|
8997
|
+
restProps = _objectWithoutProperties(button, _excluded$v);
|
|
8998
8998
|
return /*#__PURE__*/jsxRuntime.jsx(DafButton, _objectSpread2({
|
|
8999
8999
|
content: label,
|
|
9000
9000
|
type: type,
|
|
@@ -11875,7 +11875,7 @@ Widget.propTypes = {
|
|
|
11875
11875
|
};
|
|
11876
11876
|
Widget.displayName = 'Widget';
|
|
11877
11877
|
|
|
11878
|
-
const _excluded$
|
|
11878
|
+
const _excluded$u = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
|
|
11879
11879
|
function ImageWidget(_ref) {
|
|
11880
11880
|
let {
|
|
11881
11881
|
loading = false,
|
|
@@ -11886,7 +11886,7 @@ function ImageWidget(_ref) {
|
|
|
11886
11886
|
noDescriptionText,
|
|
11887
11887
|
isPdf = false
|
|
11888
11888
|
} = _ref,
|
|
11889
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
11889
|
+
props = _objectWithoutProperties(_ref, _excluded$u);
|
|
11890
11890
|
const expandable = isPdf ? false : props.expandable;
|
|
11891
11891
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
11892
11892
|
loading: loading,
|
|
@@ -11946,7 +11946,7 @@ function ImageWidget(_ref) {
|
|
|
11946
11946
|
ImageWidget.displayName = 'ImageWidget';
|
|
11947
11947
|
|
|
11948
11948
|
var _templateObject$e;
|
|
11949
|
-
const _excluded$
|
|
11949
|
+
const _excluded$t = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
|
|
11950
11950
|
function FlowWidget(_ref) {
|
|
11951
11951
|
let {
|
|
11952
11952
|
title,
|
|
@@ -11958,7 +11958,7 @@ function FlowWidget(_ref) {
|
|
|
11958
11958
|
className,
|
|
11959
11959
|
direction = "horizontal"
|
|
11960
11960
|
} = _ref,
|
|
11961
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11961
|
+
rest = _objectWithoutProperties(_ref, _excluded$t);
|
|
11962
11962
|
const [activeTab, setActiveTab] = React.useState();
|
|
11963
11963
|
React.useEffect(() => {
|
|
11964
11964
|
if (defaultActiveTab) {
|
|
@@ -15689,7 +15689,7 @@ Map$3.propTypes = {
|
|
|
15689
15689
|
link: PropTypes__default["default"].any
|
|
15690
15690
|
};
|
|
15691
15691
|
|
|
15692
|
-
const _excluded$
|
|
15692
|
+
const _excluded$s = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
|
|
15693
15693
|
function InExpandableWidgetMap(_ref) {
|
|
15694
15694
|
let {
|
|
15695
15695
|
isExpanded,
|
|
@@ -15703,7 +15703,7 @@ function InExpandableWidgetMap(_ref) {
|
|
|
15703
15703
|
height,
|
|
15704
15704
|
widgetConfig
|
|
15705
15705
|
} = _ref,
|
|
15706
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
15706
|
+
rest = _objectWithoutProperties(_ref, _excluded$s);
|
|
15707
15707
|
const [mapKey, setMapKey] = React.useState(0);
|
|
15708
15708
|
const [isMapReady, setIsMapReady] = React.useState(false);
|
|
15709
15709
|
React.useEffect(() => {
|
|
@@ -17903,14 +17903,14 @@ const MapConfig = ({
|
|
|
17903
17903
|
});
|
|
17904
17904
|
};
|
|
17905
17905
|
|
|
17906
|
-
const _excluded$
|
|
17906
|
+
const _excluded$r = ["config", "title", "loading"];
|
|
17907
17907
|
const Details = _ref => {
|
|
17908
17908
|
let {
|
|
17909
17909
|
config = [],
|
|
17910
17910
|
title,
|
|
17911
17911
|
loading = false
|
|
17912
17912
|
} = _ref,
|
|
17913
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17913
|
+
rest = _objectWithoutProperties(_ref, _excluded$r);
|
|
17914
17914
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
17915
17915
|
className: "with-border-header h-w-btn-header card",
|
|
17916
17916
|
loading: loading,
|
|
@@ -17926,14 +17926,14 @@ const Details = _ref => {
|
|
|
17926
17926
|
}));
|
|
17927
17927
|
};
|
|
17928
17928
|
|
|
17929
|
-
const _excluded$
|
|
17929
|
+
const _excluded$q = ["config", "title", "loading"];
|
|
17930
17930
|
const KeyIndicatorsDetails = _ref => {
|
|
17931
17931
|
let {
|
|
17932
17932
|
config,
|
|
17933
17933
|
title,
|
|
17934
17934
|
loading = false
|
|
17935
17935
|
} = _ref,
|
|
17936
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17936
|
+
rest = _objectWithoutProperties(_ref, _excluded$q);
|
|
17937
17937
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
17938
17938
|
className: "with-border-header h-w-btn-header",
|
|
17939
17939
|
title: title,
|
|
@@ -17963,7 +17963,7 @@ const Style$G = styled__default["default"].div`
|
|
|
17963
17963
|
}
|
|
17964
17964
|
`;
|
|
17965
17965
|
|
|
17966
|
-
const _excluded$
|
|
17966
|
+
const _excluded$p = ["children", "config", "detailsTitle", "firstColumnWidth"];
|
|
17967
17967
|
const DetailsSection = _ref => {
|
|
17968
17968
|
let {
|
|
17969
17969
|
children,
|
|
@@ -17971,7 +17971,7 @@ const DetailsSection = _ref => {
|
|
|
17971
17971
|
detailsTitle,
|
|
17972
17972
|
firstColumnWidth = "250px"
|
|
17973
17973
|
} = _ref,
|
|
17974
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17974
|
+
rest = _objectWithoutProperties(_ref, _excluded$p);
|
|
17975
17975
|
return /*#__PURE__*/jsxRuntime.jsx(Style$G, {
|
|
17976
17976
|
firstColumnWidth: firstColumnWidth,
|
|
17977
17977
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -18147,14 +18147,14 @@ const getGoalConfig = () => {
|
|
|
18147
18147
|
};
|
|
18148
18148
|
|
|
18149
18149
|
var _templateObject$c;
|
|
18150
|
-
const _excluded$
|
|
18150
|
+
const _excluded$o = ["title", "activeSdgGoals", "t"];
|
|
18151
18151
|
function SDGWidget(_ref) {
|
|
18152
18152
|
let {
|
|
18153
18153
|
title = "Sustainable Development Goals",
|
|
18154
18154
|
activeSdgGoals = [],
|
|
18155
18155
|
t = key => key
|
|
18156
18156
|
} = _ref,
|
|
18157
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18157
|
+
props = _objectWithoutProperties(_ref, _excluded$o);
|
|
18158
18158
|
const sdgConfig = getGoalConfig();
|
|
18159
18159
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
18160
18160
|
title: title,
|
|
@@ -18452,7 +18452,7 @@ function SdgList({
|
|
|
18452
18452
|
});
|
|
18453
18453
|
}
|
|
18454
18454
|
|
|
18455
|
-
const _excluded$
|
|
18455
|
+
const _excluded$n = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
|
|
18456
18456
|
const {
|
|
18457
18457
|
Meta
|
|
18458
18458
|
} = antd.Card;
|
|
@@ -18472,7 +18472,7 @@ function ProjectWidget(_ref) {
|
|
|
18472
18472
|
hideSDGList = false,
|
|
18473
18473
|
t = x => x
|
|
18474
18474
|
} = _ref,
|
|
18475
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18475
|
+
props = _objectWithoutProperties(_ref, _excluded$n);
|
|
18476
18476
|
const [isHovered, setIsHovered] = React__default["default"].useState(false);
|
|
18477
18477
|
const {
|
|
18478
18478
|
token
|
|
@@ -18744,13 +18744,13 @@ const WidgetCard = _ref => {
|
|
|
18744
18744
|
});
|
|
18745
18745
|
};
|
|
18746
18746
|
|
|
18747
|
-
const _excluded$
|
|
18747
|
+
const _excluded$m = ["title", "children"];
|
|
18748
18748
|
const CarouselWidget = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
18749
18749
|
let {
|
|
18750
18750
|
title,
|
|
18751
18751
|
children
|
|
18752
18752
|
} = _ref,
|
|
18753
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
18753
|
+
rest = _objectWithoutProperties(_ref, _excluded$m);
|
|
18754
18754
|
/**
|
|
18755
18755
|
* Handles carousel slide change events
|
|
18756
18756
|
* @param {number} currentSlide - The index of the current slide after change
|
|
@@ -18914,7 +18914,7 @@ const EmptyStateContainer = styled__default["default"].div`
|
|
|
18914
18914
|
}
|
|
18915
18915
|
`;
|
|
18916
18916
|
|
|
18917
|
-
const _excluded$
|
|
18917
|
+
const _excluded$l = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
|
|
18918
18918
|
function ImageCarousel(_ref) {
|
|
18919
18919
|
let {
|
|
18920
18920
|
title,
|
|
@@ -18929,7 +18929,7 @@ function ImageCarousel(_ref) {
|
|
|
18929
18929
|
emptyLogo = antd.Empty.PRESENTED_IMAGE_SIMPLE,
|
|
18930
18930
|
emptyText = "No Image"
|
|
18931
18931
|
} = _ref,
|
|
18932
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
18932
|
+
rest = _objectWithoutProperties(_ref, _excluded$l);
|
|
18933
18933
|
const [previewVisible, setPreviewVisible] = React.useState(false);
|
|
18934
18934
|
const [current, setCurrent] = React.useState(0);
|
|
18935
18935
|
const carouselRef = React.useRef(null);
|
|
@@ -19298,7 +19298,7 @@ const getVegetationConfig = () => {
|
|
|
19298
19298
|
};
|
|
19299
19299
|
|
|
19300
19300
|
var _templateObject$a, _templateObject2$3;
|
|
19301
|
-
const _excluded$
|
|
19301
|
+
const _excluded$k = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
|
|
19302
19302
|
function VegetationWidget(_ref) {
|
|
19303
19303
|
let {
|
|
19304
19304
|
title = "Vegetation Health",
|
|
@@ -19310,7 +19310,7 @@ function VegetationWidget(_ref) {
|
|
|
19310
19310
|
growthObservations = [],
|
|
19311
19311
|
t = key => key
|
|
19312
19312
|
} = _ref,
|
|
19313
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19313
|
+
props = _objectWithoutProperties(_ref, _excluded$k);
|
|
19314
19314
|
let vegetationConfig = getVegetationConfig();
|
|
19315
19315
|
const allVegetationKeys = vegetationConfig.map(item => item.key);
|
|
19316
19316
|
if (filterKeys && Array.isArray(filterKeys)) {
|
|
@@ -19426,7 +19426,7 @@ const getFaunaConfig = () => {
|
|
|
19426
19426
|
};
|
|
19427
19427
|
|
|
19428
19428
|
var _templateObject$9, _templateObject2$2;
|
|
19429
|
-
const _excluded$
|
|
19429
|
+
const _excluded$j = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
|
|
19430
19430
|
function FaunaWidget(_ref) {
|
|
19431
19431
|
let {
|
|
19432
19432
|
title = "Observed Fauna",
|
|
@@ -19437,7 +19437,7 @@ function FaunaWidget(_ref) {
|
|
|
19437
19437
|
itemHeight = 100,
|
|
19438
19438
|
t = key => key
|
|
19439
19439
|
} = _ref,
|
|
19440
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19440
|
+
props = _objectWithoutProperties(_ref, _excluded$j);
|
|
19441
19441
|
let faunaConfig = getFaunaConfig();
|
|
19442
19442
|
|
|
19443
19443
|
// Filter to show only specific keys if filterKeys is provided
|
|
@@ -19502,7 +19502,7 @@ const getInvasiveSpeciesConfig = () => {
|
|
|
19502
19502
|
};
|
|
19503
19503
|
|
|
19504
19504
|
var _templateObject$8, _templateObject2$1;
|
|
19505
|
-
const _excluded$
|
|
19505
|
+
const _excluded$i = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
|
|
19506
19506
|
function InvasiveSpeciesWidget(_ref) {
|
|
19507
19507
|
let {
|
|
19508
19508
|
title = "Invasive Species",
|
|
@@ -19514,7 +19514,7 @@ function InvasiveSpeciesWidget(_ref) {
|
|
|
19514
19514
|
itemHeight = 100,
|
|
19515
19515
|
t = key => key
|
|
19516
19516
|
} = _ref,
|
|
19517
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19517
|
+
props = _objectWithoutProperties(_ref, _excluded$i);
|
|
19518
19518
|
let invasiveSpeciesConfig = getInvasiveSpeciesConfig();
|
|
19519
19519
|
|
|
19520
19520
|
// Filter to show only specific keys if filterKeys is provided
|
|
@@ -24937,8 +24937,8 @@ const RepeatableModals = ({
|
|
|
24937
24937
|
}) : null;
|
|
24938
24938
|
};
|
|
24939
24939
|
|
|
24940
|
-
const _excluded$
|
|
24941
|
-
_excluded2$
|
|
24940
|
+
const _excluded$h = ["viewGroup"],
|
|
24941
|
+
_excluded2$1 = ["label", "icon", "position"];
|
|
24942
24942
|
const Content$1 = _ref => {
|
|
24943
24943
|
let {
|
|
24944
24944
|
style = {},
|
|
@@ -25009,7 +25009,7 @@ const Content$1 = _ref => {
|
|
|
25009
25009
|
if (groups[gKey].viewGroup === key) {
|
|
25010
25010
|
// eslint-disable-next-line no-unused-vars
|
|
25011
25011
|
const _groups$gKey = groups[gKey],
|
|
25012
|
-
gCfg = _objectWithoutProperties(_groups$gKey, _excluded$
|
|
25012
|
+
gCfg = _objectWithoutProperties(_groups$gKey, _excluded$h);
|
|
25013
25013
|
items[gKey] = gCfg;
|
|
25014
25014
|
}
|
|
25015
25015
|
return items;
|
|
@@ -25237,7 +25237,7 @@ const Content$1 = _ref => {
|
|
|
25237
25237
|
showIcon: true
|
|
25238
25238
|
});
|
|
25239
25239
|
}
|
|
25240
|
-
let groups = _objectWithoutProperties(f, _excluded2$
|
|
25240
|
+
let groups = _objectWithoutProperties(f, _excluded2$1);
|
|
25241
25241
|
groups = Object.keys(groups).reduce((items, key) => {
|
|
25242
25242
|
var _groups$key2;
|
|
25243
25243
|
if (!((_groups$key2 = groups[key]) !== null && _groups$key2 !== void 0 && (_groups$key2 = _groups$key2.meta) !== null && _groups$key2 !== void 0 && _groups$key2.excludeFromView)) {
|
|
@@ -25289,7 +25289,7 @@ const Content$1 = _ref => {
|
|
|
25289
25289
|
});
|
|
25290
25290
|
};
|
|
25291
25291
|
|
|
25292
|
-
const _excluded$
|
|
25292
|
+
const _excluded$g = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
|
|
25293
25293
|
function Modal(_ref) {
|
|
25294
25294
|
let {
|
|
25295
25295
|
t = text => text,
|
|
@@ -25305,7 +25305,7 @@ function Modal(_ref) {
|
|
|
25305
25305
|
disabled = false,
|
|
25306
25306
|
withModalFormWrapper = true
|
|
25307
25307
|
} = _ref,
|
|
25308
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
25308
|
+
props = _objectWithoutProperties(_ref, _excluded$g);
|
|
25309
25309
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Modal, _objectSpread2(_objectSpread2({
|
|
25310
25310
|
width: 650,
|
|
25311
25311
|
footer: null,
|
|
@@ -30797,6 +30797,7 @@ function Repeatable({
|
|
|
30797
30797
|
});
|
|
30798
30798
|
}
|
|
30799
30799
|
|
|
30800
|
+
/* eslint-disable no-eval */
|
|
30800
30801
|
const isRiskComment = inputData => {
|
|
30801
30802
|
if (inputData) {
|
|
30802
30803
|
if (inputData.name === 'assessment') {
|
|
@@ -30809,10 +30810,7 @@ const isRiskComment = inputData => {
|
|
|
30809
30810
|
};
|
|
30810
30811
|
|
|
30811
30812
|
// options, k, setValues, values, excludedKeys, i, formTitles, getData, MainForm, plainForms, setAddress, onValuesChange, data, allData, changeLinking, changeInputMeta, t, highlightMandatory
|
|
30812
|
-
function renderNestedInputs$1(options, k) {
|
|
30813
|
-
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
30814
|
-
args[_key - 2] = arguments[_key];
|
|
30815
|
-
}
|
|
30813
|
+
function renderNestedInputs$1(options, k, ...args) {
|
|
30816
30814
|
if (options[k].repeatable) {
|
|
30817
30815
|
return renderRepeatable$1(options, k, ...args);
|
|
30818
30816
|
} else {
|
|
@@ -30840,11 +30838,10 @@ function renderRepeatable$1(options, k, setValues, values, excludedKeys, i, form
|
|
|
30840
30838
|
children: [getFormTitles$1(formTitles, formId, i), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(form.type) ? getInputHeadLines$1(form.type, i, form, values) : /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
30841
30839
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
|
|
30842
30840
|
name: formId,
|
|
30843
|
-
children: (fields,
|
|
30844
|
-
|
|
30845
|
-
|
|
30846
|
-
|
|
30847
|
-
} = _ref;
|
|
30841
|
+
children: (fields, {
|
|
30842
|
+
add,
|
|
30843
|
+
remove
|
|
30844
|
+
}) => {
|
|
30848
30845
|
const formData = form.repeatable ? values[formId] || [] : values[formId] ? [values[formId]] : [];
|
|
30849
30846
|
if (fields.length === 0) {
|
|
30850
30847
|
const formInputs = form.inputs;
|
|
@@ -30894,10 +30891,14 @@ function renderRepeatable$1(options, k, setValues, values, excludedKeys, i, form
|
|
|
30894
30891
|
const _val = {
|
|
30895
30892
|
[formId]: formData.map((d, j) => i === j ? val : d)
|
|
30896
30893
|
};
|
|
30897
|
-
onValuesChange(_val,
|
|
30898
|
-
|
|
30894
|
+
onValuesChange(_val, {
|
|
30895
|
+
...values,
|
|
30896
|
+
..._val
|
|
30897
|
+
});
|
|
30898
|
+
setValues({
|
|
30899
|
+
...values,
|
|
30899
30900
|
[formId]: formData.map((d, j) => i === j ? val : d)
|
|
30900
|
-
})
|
|
30901
|
+
});
|
|
30901
30902
|
};
|
|
30902
30903
|
return /*#__PURE__*/jsxRuntime.jsx(Repeatable, {
|
|
30903
30904
|
form: form,
|
|
@@ -30953,156 +30954,154 @@ const getGroupContent = (form, values, i, formId, excludedKeys, getData, setValu
|
|
|
30953
30954
|
highlightMandatory
|
|
30954
30955
|
});
|
|
30955
30956
|
};
|
|
30956
|
-
const GroupContent =
|
|
30957
|
-
|
|
30958
|
-
|
|
30959
|
-
|
|
30960
|
-
|
|
30961
|
-
|
|
30962
|
-
|
|
30963
|
-
|
|
30964
|
-
|
|
30965
|
-
|
|
30966
|
-
|
|
30967
|
-
|
|
30968
|
-
|
|
30969
|
-
|
|
30970
|
-
|
|
30971
|
-
|
|
30972
|
-
|
|
30973
|
-
highlightMandatory
|
|
30974
|
-
} = _ref2;
|
|
30957
|
+
const GroupContent = ({
|
|
30958
|
+
form,
|
|
30959
|
+
values = {},
|
|
30960
|
+
i,
|
|
30961
|
+
formId,
|
|
30962
|
+
excludedKeys,
|
|
30963
|
+
getData,
|
|
30964
|
+
setValues,
|
|
30965
|
+
MainForm,
|
|
30966
|
+
options,
|
|
30967
|
+
plainForms,
|
|
30968
|
+
setAddress,
|
|
30969
|
+
onValuesChange,
|
|
30970
|
+
allData,
|
|
30971
|
+
changeInputMeta,
|
|
30972
|
+
highlightMandatory
|
|
30973
|
+
}) => {
|
|
30975
30974
|
const {
|
|
30976
30975
|
user,
|
|
30977
30976
|
t
|
|
30978
30977
|
} = useEditContext();
|
|
30979
30978
|
const label = getInputLabel$1(form, values);
|
|
30980
|
-
const notPartOfTheForm =
|
|
30979
|
+
const notPartOfTheForm = form?.type === 'ajaxSubGroup' ? true : !!form?.meta?.isSubGroup;
|
|
30981
30980
|
const hasLabel = label && (typeof label === 'string' && (label || '').trim() !== '' || typeof label === 'object') ? true : false;
|
|
30982
30981
|
const formValues = values[form.dataId];
|
|
30983
|
-
const renderInputs = () => {
|
|
30984
|
-
|
|
30985
|
-
|
|
30986
|
-
|
|
30987
|
-
|
|
30988
|
-
|
|
30989
|
-
|
|
30990
|
-
|
|
30991
|
-
|
|
30992
|
-
|
|
30993
|
-
|
|
30994
|
-
|
|
30995
|
-
|
|
30996
|
-
|
|
30997
|
-
|
|
30998
|
-
|
|
30999
|
-
|
|
31000
|
-
|
|
31001
|
-
|
|
31002
|
-
inputData.
|
|
31003
|
-
|
|
31004
|
-
|
|
31005
|
-
|
|
31006
|
-
|
|
31007
|
-
|
|
31008
|
-
|
|
31009
|
-
|
|
30982
|
+
const renderInputs = () => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
30983
|
+
children: [form?.meta?.groupInfo ? /*#__PURE__*/jsxRuntime.jsx(GroupInfos, {
|
|
30984
|
+
config: form.meta.groupInfo,
|
|
30985
|
+
user: user,
|
|
30986
|
+
t: t
|
|
30987
|
+
}) : null, Object.keys(form.inputs || {}).filter(i => !excludedKeys.includes(i)).map((inp, ii) => {
|
|
30988
|
+
const isAjaxSubGroup = form?.type === "ajaxSubGroup";
|
|
30989
|
+
const input = form.inputs[inp];
|
|
30990
|
+
const inputId = input.dataId || inp;
|
|
30991
|
+
const inputValues = notPartOfTheForm ? Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {} : values;
|
|
30992
|
+
const value = inputValues[inputId];
|
|
30993
|
+
const commentValue = inputValues[`${inputId}Comment`];
|
|
30994
|
+
const inputData = getData(formId, input, value, commentValue, `${formId}.${inputId}`, `${formId}.${inputId}`);
|
|
30995
|
+
const subtitles = form.subtitles || null;
|
|
30996
|
+
const inputMeta = notPartOfTheForm ? isAjaxSubGroup ? (values[formId] || {})?.meta?.inputs?.[inputId] || {} : ((values?.meta?.inputs || {})[formId] || {})[inputId] || {} : (values?.meta?.inputs || {})[inputId] || {};
|
|
30997
|
+
inputData.repeatIndex = undefined;
|
|
30998
|
+
inputData.inputName = inputId;
|
|
30999
|
+
inputData.repeatValues = inputValues;
|
|
31000
|
+
if (inputData.groupInputs && Array.isArray(inputData.groupInputs)) {
|
|
31001
|
+
inputData.groupInputs = inputData.groupInputs.map(gpI => {
|
|
31002
|
+
gpI.data.inputName = gpI.data.name;
|
|
31003
|
+
gpI.data.repeatIndex = undefined;
|
|
31004
|
+
gpI.data.name = formId;
|
|
31005
|
+
return gpI;
|
|
31006
|
+
});
|
|
31007
|
+
}
|
|
31008
|
+
const isRisk = isRiskComment(inputData);
|
|
31009
|
+
const isHighlighted = highlightMandatory && input?.meta?.mandatory && inputIsEmpty(input, inputValues, inputMeta);
|
|
31010
|
+
const btnOnClick = () => {
|
|
31011
|
+
if (typeof inputData.commentValue === 'string') {
|
|
31012
|
+
onValuesChange({}, {
|
|
31013
|
+
...values,
|
|
31014
|
+
[`${inputData.inputName}`]: null
|
|
31010
31015
|
});
|
|
31011
31016
|
}
|
|
31012
|
-
const
|
|
31013
|
-
|
|
31014
|
-
|
|
31015
|
-
|
|
31016
|
-
|
|
31017
|
-
|
|
31018
|
-
|
|
31019
|
-
|
|
31017
|
+
const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
|
|
31018
|
+
inputValues[`${inputData.inputName}Comment`] = typeof inputData.commentValue !== 'string' ? '' : null;
|
|
31019
|
+
if (Array.isArray(values[formId])) {
|
|
31020
|
+
values[formId] = inputValues;
|
|
31021
|
+
} else {
|
|
31022
|
+
values[formId] = inputValues;
|
|
31023
|
+
}
|
|
31024
|
+
setValues({
|
|
31025
|
+
...values
|
|
31026
|
+
});
|
|
31027
|
+
};
|
|
31028
|
+
const btnOnClick2 = () => {
|
|
31029
|
+
if (typeof inputData.commentValue !== 'string') {
|
|
31020
31030
|
const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
|
|
31021
|
-
inputValues[
|
|
31031
|
+
inputValues[`${inputData.inputName}Comment`] = typeof inputData.commentValue !== 'string' ? '' : null;
|
|
31022
31032
|
if (Array.isArray(values[formId])) {
|
|
31023
31033
|
values[formId] = inputValues;
|
|
31024
31034
|
} else {
|
|
31025
31035
|
values[formId] = inputValues;
|
|
31026
31036
|
}
|
|
31027
|
-
setValues(
|
|
31028
|
-
|
|
31029
|
-
const btnOnClick2 = () => {
|
|
31030
|
-
if (typeof inputData.commentValue !== 'string') {
|
|
31031
|
-
const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
|
|
31032
|
-
inputValues["".concat(inputData.inputName, "Comment")] = typeof inputData.commentValue !== 'string' ? '' : null;
|
|
31033
|
-
if (Array.isArray(values[formId])) {
|
|
31034
|
-
values[formId] = inputValues;
|
|
31035
|
-
} else {
|
|
31036
|
-
values[formId] = inputValues;
|
|
31037
|
-
}
|
|
31038
|
-
setValues(_objectSpread2({}, values));
|
|
31039
|
-
}
|
|
31040
|
-
};
|
|
31041
|
-
const rules = inputData !== null && inputData !== void 0 && (_inputData$rules = inputData.rules) !== null && _inputData$rules !== void 0 && _inputData$rules.length ? inputData.rules.filter(rule => !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max')) : ((input === null || input === void 0 || (_input$meta2 = input.meta) === null || _input$meta2 === void 0 ? void 0 : _input$meta2.rules) || []).filter(rule => {
|
|
31042
|
-
if (rule.metaIf && typeof rule.metaIf === 'string') {
|
|
31043
|
-
var _values$meta3, _values$meta4;
|
|
31044
|
-
const [name, cond, value] = rule.metaIf.split(' ');
|
|
31045
|
-
const val = name.includes('./') ? values === null || values === void 0 || (_values$meta3 = values.meta) === null || _values$meta3 === void 0 || (_values$meta3 = _values$meta3.inputs) === null || _values$meta3 === void 0 || (_values$meta3 = _values$meta3[formId]) === null || _values$meta3 === void 0 ? void 0 : _values$meta3[name.split('./')[1]] : values === null || values === void 0 || (_values$meta4 = values.meta) === null || _values$meta4 === void 0 || (_values$meta4 = _values$meta4.inputs) === null || _values$meta4 === void 0 ? void 0 : _values$meta4[name.split('./')[1]];
|
|
31046
|
-
if (cond === 'is') {
|
|
31047
|
-
return !!(val !== null && val !== void 0 && val[value]);
|
|
31048
|
-
}
|
|
31049
|
-
}
|
|
31050
|
-
return !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max');
|
|
31051
|
-
});
|
|
31052
|
-
const requiredRule = rules.find(r => r.required);
|
|
31053
|
-
if (requiredRule && input.type === 'text') {
|
|
31054
|
-
rules.push({
|
|
31055
|
-
whitespace: true,
|
|
31056
|
-
message: requiredRule.message || ''
|
|
31037
|
+
setValues({
|
|
31038
|
+
...values
|
|
31057
31039
|
});
|
|
31058
31040
|
}
|
|
31059
|
-
|
|
31060
|
-
|
|
31061
|
-
|
|
31062
|
-
|
|
31063
|
-
|
|
31064
|
-
|
|
31065
|
-
|
|
31066
|
-
|
|
31067
|
-
|
|
31068
|
-
|
|
31069
|
-
|
|
31070
|
-
|
|
31071
|
-
|
|
31072
|
-
|
|
31073
|
-
|
|
31074
|
-
|
|
31075
|
-
|
|
31076
|
-
|
|
31077
|
-
|
|
31078
|
-
|
|
31079
|
-
|
|
31080
|
-
|
|
31081
|
-
|
|
31082
|
-
|
|
31083
|
-
|
|
31084
|
-
|
|
31085
|
-
|
|
31086
|
-
|
|
31087
|
-
|
|
31088
|
-
|
|
31089
|
-
|
|
31090
|
-
|
|
31091
|
-
|
|
31092
|
-
|
|
31093
|
-
|
|
31094
|
-
|
|
31095
|
-
|
|
31096
|
-
|
|
31097
|
-
|
|
31098
|
-
|
|
31099
|
-
})
|
|
31100
|
-
},
|
|
31101
|
-
|
|
31102
|
-
|
|
31103
|
-
|
|
31104
|
-
|
|
31105
|
-
|
|
31041
|
+
};
|
|
31042
|
+
const rules = inputData?.rules?.length ? inputData.rules.filter(rule => !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max')) : (input?.meta?.rules || []).filter(rule => {
|
|
31043
|
+
if (rule.metaIf && typeof rule.metaIf === 'string') {
|
|
31044
|
+
const [name, cond, value] = rule.metaIf.split(' ');
|
|
31045
|
+
const val = name.includes('./') ? values?.meta?.inputs?.[formId]?.[name.split('./')[1]] : values?.meta?.inputs?.[name.split('./')[1]];
|
|
31046
|
+
if (cond === 'is') {
|
|
31047
|
+
return !!val?.[value];
|
|
31048
|
+
}
|
|
31049
|
+
}
|
|
31050
|
+
return !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max');
|
|
31051
|
+
});
|
|
31052
|
+
const requiredRule = rules.find(r => r.required);
|
|
31053
|
+
if (requiredRule && input.type === 'text') {
|
|
31054
|
+
rules.push({
|
|
31055
|
+
whitespace: true,
|
|
31056
|
+
message: requiredRule.message || ''
|
|
31057
|
+
});
|
|
31058
|
+
}
|
|
31059
|
+
return showHideInput$1(input, values, undefined, inputValues, setValues) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
|
|
31060
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
31061
|
+
style: {
|
|
31062
|
+
position: 'relative'
|
|
31063
|
+
},
|
|
31064
|
+
children: [getSubtitles$1(subtitles, input.position, values, undefined, inputValues), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(input.type) ? getInputHeadLines$1(input.type, i, input, values) : isRisk ? /*#__PURE__*/jsxRuntime.jsx(RiskGroup, {
|
|
31065
|
+
input: input,
|
|
31066
|
+
inputTypeComponent: inputTypeComponent$1,
|
|
31067
|
+
inputData: inputData,
|
|
31068
|
+
MainForm: MainForm,
|
|
31069
|
+
options: options,
|
|
31070
|
+
setValues: setValues,
|
|
31071
|
+
formId: formId,
|
|
31072
|
+
inputId: inputId,
|
|
31073
|
+
inputOnBlur: inputOnBlur,
|
|
31074
|
+
values: values,
|
|
31075
|
+
getInputLabel: getInputLabel$1,
|
|
31076
|
+
plainForms: plainForms,
|
|
31077
|
+
setAddress: setAddress,
|
|
31078
|
+
btnOnClick: btnOnClick,
|
|
31079
|
+
btnOnClick2: btnOnClick2,
|
|
31080
|
+
locationName: (allData || {}).locationName,
|
|
31081
|
+
subGroupTitle: (allData || {}).subGroupTitle
|
|
31082
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(GroupContentFormItem, {
|
|
31083
|
+
values,
|
|
31084
|
+
formId,
|
|
31085
|
+
setValues,
|
|
31086
|
+
MainForm,
|
|
31087
|
+
options,
|
|
31088
|
+
plainForms,
|
|
31089
|
+
setAddress,
|
|
31090
|
+
inputData,
|
|
31091
|
+
inputId,
|
|
31092
|
+
input,
|
|
31093
|
+
rules,
|
|
31094
|
+
inputMeta,
|
|
31095
|
+
changeInputMeta,
|
|
31096
|
+
notPartOfTheForm,
|
|
31097
|
+
isAjaxSubGroup,
|
|
31098
|
+
isHighlighted
|
|
31099
|
+
})]
|
|
31100
|
+
}, ii)
|
|
31101
|
+
}, `${i}${ii}`) : null;
|
|
31102
|
+
})]
|
|
31103
|
+
});
|
|
31104
|
+
const isNa = formValues?.valuation === 'na';
|
|
31106
31105
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
31107
31106
|
children: [hasLabel ? options.isRisk && options.dontShowTitle ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31108
31107
|
className: "risk-header",
|
|
@@ -31110,46 +31109,44 @@ const GroupContent = _ref2 => {
|
|
|
31110
31109
|
children: label
|
|
31111
31110
|
})
|
|
31112
31111
|
}) : /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
31113
|
-
className:
|
|
31112
|
+
className: `${form.titleClass ? form.titleClass : 'title-semibold-4'} ${i ? 'mt-3 mb-1' : ''}`,
|
|
31114
31113
|
children: label
|
|
31115
31114
|
}) : null, /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
31116
|
-
className:
|
|
31115
|
+
className: `repeatable ${hasLabel ? "mb-4" : ""}`,
|
|
31117
31116
|
children: [form.titleLabel ? /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
31118
31117
|
children: getInputProp(form.titleLabel, values)
|
|
31119
|
-
}) : null, formValues
|
|
31118
|
+
}) : null, formValues?.noPlanningRequired ? /*#__PURE__*/jsxRuntime.jsx(GroupInfoHOC, {
|
|
31120
31119
|
t: t,
|
|
31121
31120
|
isNa: isNa,
|
|
31122
31121
|
isSuccess: !isNa
|
|
31123
31122
|
// TODO: translate
|
|
31124
31123
|
,
|
|
31125
31124
|
config: {
|
|
31126
|
-
title: t(
|
|
31125
|
+
title: t(`No ${formValues?.stage || 'planning'} required`)
|
|
31127
31126
|
},
|
|
31128
31127
|
children: renderInputs()
|
|
31129
31128
|
}) : renderInputs()]
|
|
31130
31129
|
})]
|
|
31131
31130
|
});
|
|
31132
31131
|
};
|
|
31133
|
-
const GroupContentFormItem =
|
|
31134
|
-
|
|
31135
|
-
|
|
31136
|
-
|
|
31137
|
-
|
|
31138
|
-
|
|
31139
|
-
|
|
31140
|
-
|
|
31141
|
-
|
|
31142
|
-
|
|
31143
|
-
|
|
31144
|
-
|
|
31145
|
-
|
|
31146
|
-
|
|
31147
|
-
|
|
31148
|
-
|
|
31149
|
-
|
|
31150
|
-
|
|
31151
|
-
isHighlighted
|
|
31152
|
-
} = _ref4;
|
|
31132
|
+
const GroupContentFormItem = ({
|
|
31133
|
+
values,
|
|
31134
|
+
formId,
|
|
31135
|
+
setValues,
|
|
31136
|
+
MainForm,
|
|
31137
|
+
options,
|
|
31138
|
+
plainForms,
|
|
31139
|
+
setAddress,
|
|
31140
|
+
inputData,
|
|
31141
|
+
inputId,
|
|
31142
|
+
input,
|
|
31143
|
+
rules,
|
|
31144
|
+
inputMeta,
|
|
31145
|
+
changeInputMeta,
|
|
31146
|
+
notPartOfTheForm = true,
|
|
31147
|
+
isAjaxSubGroup,
|
|
31148
|
+
isHighlighted
|
|
31149
|
+
}) => {
|
|
31153
31150
|
const {
|
|
31154
31151
|
t,
|
|
31155
31152
|
user,
|
|
@@ -31163,10 +31160,10 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31163
31160
|
staticWidth,
|
|
31164
31161
|
fullWidth
|
|
31165
31162
|
} = useEditContext();
|
|
31166
|
-
const [isShown, setIsShown] = React.useState(!!
|
|
31167
|
-
let maxRule =
|
|
31163
|
+
const [isShown, setIsShown] = React.useState(!!inputMeta?.comment);
|
|
31164
|
+
let maxRule = rules.find(rule => rule.max)?.max;
|
|
31168
31165
|
const requiredRule = rules.find(r => r.required);
|
|
31169
|
-
const lastReview = (
|
|
31166
|
+
const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
|
|
31170
31167
|
if (!maxRule && input.type === 'textarea') {
|
|
31171
31168
|
maxRule = MAX_TEXT_AREA_LENGTH;
|
|
31172
31169
|
}
|
|
@@ -31185,35 +31182,38 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31185
31182
|
}
|
|
31186
31183
|
setIsShown(true);
|
|
31187
31184
|
if (notPartOfTheForm || isAjaxSubGroup) {
|
|
31188
|
-
|
|
31189
|
-
const _defaultMeta = ((values === null || values === void 0 || (_values$meta5 = values.meta) === null || _values$meta5 === void 0 ? void 0 : _values$meta5.inputs) || {})[formId] || {};
|
|
31185
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31190
31186
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31191
31187
|
if (isAjaxSubGroup) {
|
|
31192
|
-
var _defaultData$meta, _defaultData$meta2;
|
|
31193
31188
|
changeInputMeta({
|
|
31194
31189
|
key: formId,
|
|
31195
31190
|
type: input.type,
|
|
31196
31191
|
otherValues: {
|
|
31197
|
-
[formId]:
|
|
31192
|
+
[formId]: {
|
|
31193
|
+
..._defaultData,
|
|
31198
31194
|
meta: {
|
|
31199
|
-
inputs:
|
|
31200
|
-
|
|
31195
|
+
inputs: {
|
|
31196
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31197
|
+
[inputId]: {
|
|
31198
|
+
...((_defaultData?.meta?.inputs || {})[inputId] || {}),
|
|
31201
31199
|
comment: ''
|
|
31202
|
-
}
|
|
31203
|
-
}
|
|
31200
|
+
}
|
|
31201
|
+
}
|
|
31204
31202
|
}
|
|
31205
|
-
}
|
|
31203
|
+
}
|
|
31206
31204
|
}
|
|
31207
31205
|
});
|
|
31208
31206
|
} else {
|
|
31209
31207
|
changeInputMeta({
|
|
31210
31208
|
key: formId,
|
|
31211
31209
|
type: input.type,
|
|
31212
|
-
value:
|
|
31213
|
-
|
|
31210
|
+
value: {
|
|
31211
|
+
..._defaultMeta,
|
|
31212
|
+
[inputId]: {
|
|
31213
|
+
...(_defaultMeta[inputId] || {}),
|
|
31214
31214
|
comment: ''
|
|
31215
|
-
}
|
|
31216
|
-
}
|
|
31215
|
+
}
|
|
31216
|
+
}
|
|
31217
31217
|
});
|
|
31218
31218
|
}
|
|
31219
31219
|
} else {
|
|
@@ -31230,58 +31230,62 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31230
31230
|
if (!isReview) {
|
|
31231
31231
|
return;
|
|
31232
31232
|
}
|
|
31233
|
-
const reviewSuccess = lastReview
|
|
31233
|
+
const reviewSuccess = lastReview?.reviewSuccess;
|
|
31234
31234
|
if (notPartOfTheForm || isAjaxSubGroup) {
|
|
31235
|
-
|
|
31236
|
-
const _defaultMeta = ((values === null || values === void 0 || (_values$meta6 = values.meta) === null || _values$meta6 === void 0 ? void 0 : _values$meta6.inputs) || {})[formId] || {};
|
|
31235
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31237
31236
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31238
31237
|
if (isAjaxSubGroup) {
|
|
31239
|
-
var _defaultData$meta3, _defaultData$meta4, _defaultData$meta5, _defaultData$meta6;
|
|
31240
31238
|
changeInputMeta({
|
|
31241
31239
|
key: formId,
|
|
31242
31240
|
type: input.type,
|
|
31243
31241
|
otherValues: {
|
|
31244
|
-
[formId]:
|
|
31242
|
+
[formId]: {
|
|
31243
|
+
..._defaultData,
|
|
31245
31244
|
meta: {
|
|
31246
|
-
inputs:
|
|
31247
|
-
|
|
31248
|
-
|
|
31245
|
+
inputs: {
|
|
31246
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31247
|
+
[inputId]: {
|
|
31248
|
+
...((_defaultData?.meta?.inputs || {})[inputId] || {}),
|
|
31249
|
+
reviews: reviewSuccess ? (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []), {
|
|
31249
31250
|
reviewer: user,
|
|
31250
31251
|
createdAt: new Date().toISOString(),
|
|
31251
31252
|
reviewSuccess: true
|
|
31252
31253
|
}]
|
|
31253
|
-
}
|
|
31254
|
-
}
|
|
31254
|
+
}
|
|
31255
|
+
}
|
|
31255
31256
|
}
|
|
31256
|
-
}
|
|
31257
|
+
}
|
|
31257
31258
|
}
|
|
31258
31259
|
});
|
|
31259
31260
|
} else {
|
|
31260
31261
|
changeInputMeta({
|
|
31261
31262
|
key: formId,
|
|
31262
31263
|
type: input.type,
|
|
31263
|
-
value:
|
|
31264
|
-
|
|
31264
|
+
value: {
|
|
31265
|
+
..._defaultMeta,
|
|
31266
|
+
[inputId]: {
|
|
31267
|
+
...(_defaultMeta[inputId] || {}),
|
|
31265
31268
|
reviews: reviewSuccess ? ((_defaultMeta[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((_defaultMeta[inputId] || {}).reviews || []), {
|
|
31266
31269
|
reviewer: user,
|
|
31267
31270
|
createdAt: new Date().toISOString(),
|
|
31268
31271
|
reviewSuccess: true
|
|
31269
31272
|
}]
|
|
31270
|
-
}
|
|
31271
|
-
}
|
|
31273
|
+
}
|
|
31274
|
+
}
|
|
31272
31275
|
});
|
|
31273
31276
|
}
|
|
31274
31277
|
} else {
|
|
31275
31278
|
changeInputMeta({
|
|
31276
31279
|
key: inputId,
|
|
31277
31280
|
type: input.type,
|
|
31278
|
-
value:
|
|
31281
|
+
value: {
|
|
31282
|
+
...inputMeta,
|
|
31279
31283
|
reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
|
|
31280
31284
|
reviewer: user,
|
|
31281
31285
|
createdAt: new Date().toISOString(),
|
|
31282
31286
|
reviewSuccess: true
|
|
31283
31287
|
}]
|
|
31284
|
-
}
|
|
31288
|
+
}
|
|
31285
31289
|
});
|
|
31286
31290
|
}
|
|
31287
31291
|
};
|
|
@@ -31289,111 +31293,118 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31289
31293
|
if (!isReview) {
|
|
31290
31294
|
return;
|
|
31291
31295
|
}
|
|
31292
|
-
const reviewError = lastReview
|
|
31296
|
+
const reviewError = lastReview?.reviewError;
|
|
31293
31297
|
if (notPartOfTheForm || isAjaxSubGroup) {
|
|
31294
|
-
|
|
31295
|
-
const _defaultMeta = ((values === null || values === void 0 || (_values$meta7 = values.meta) === null || _values$meta7 === void 0 ? void 0 : _values$meta7.inputs) || {})[formId] || {};
|
|
31298
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31296
31299
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31297
31300
|
if (isAjaxSubGroup) {
|
|
31298
|
-
var _defaultData$meta7, _defaultData$meta8, _defaultData$meta9, _defaultData$meta10;
|
|
31299
31301
|
changeInputMeta({
|
|
31300
31302
|
key: formId,
|
|
31301
31303
|
type: input.type,
|
|
31302
31304
|
otherValues: {
|
|
31303
|
-
[formId]:
|
|
31305
|
+
[formId]: {
|
|
31306
|
+
..._defaultData,
|
|
31304
31307
|
meta: {
|
|
31305
|
-
inputs:
|
|
31306
|
-
|
|
31307
|
-
|
|
31308
|
+
inputs: {
|
|
31309
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31310
|
+
[inputId]: {
|
|
31311
|
+
...((_defaultData?.meta?.inputs || {})[inputId] || {}),
|
|
31312
|
+
reviews: reviewError ? (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []), {
|
|
31308
31313
|
reviewer: user,
|
|
31309
31314
|
createdAt: new Date().toISOString(),
|
|
31310
31315
|
reviewError: true,
|
|
31311
31316
|
comment: ''
|
|
31312
31317
|
}]
|
|
31313
|
-
}
|
|
31314
|
-
}
|
|
31318
|
+
}
|
|
31319
|
+
}
|
|
31315
31320
|
}
|
|
31316
|
-
}
|
|
31321
|
+
}
|
|
31317
31322
|
}
|
|
31318
31323
|
});
|
|
31319
31324
|
} else {
|
|
31320
31325
|
changeInputMeta({
|
|
31321
31326
|
key: formId,
|
|
31322
31327
|
type: input.type,
|
|
31323
|
-
value:
|
|
31324
|
-
|
|
31328
|
+
value: {
|
|
31329
|
+
..._defaultMeta,
|
|
31330
|
+
[inputId]: {
|
|
31331
|
+
...(_defaultMeta[inputId] || {}),
|
|
31325
31332
|
reviews: reviewError ? ((_defaultMeta[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((_defaultMeta[inputId] || {}).reviews || []), {
|
|
31326
31333
|
reviewer: user,
|
|
31327
31334
|
createdAt: new Date().toISOString(),
|
|
31328
31335
|
reviewError: true,
|
|
31329
31336
|
comment: ''
|
|
31330
31337
|
}]
|
|
31331
|
-
}
|
|
31332
|
-
}
|
|
31338
|
+
}
|
|
31339
|
+
}
|
|
31333
31340
|
});
|
|
31334
31341
|
}
|
|
31335
31342
|
} else {
|
|
31336
31343
|
changeInputMeta({
|
|
31337
31344
|
key: inputId,
|
|
31338
31345
|
type: input.type,
|
|
31339
|
-
value:
|
|
31346
|
+
value: {
|
|
31347
|
+
...inputMeta,
|
|
31340
31348
|
reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
|
|
31341
31349
|
reviewer: user,
|
|
31342
31350
|
createdAt: new Date().toISOString(),
|
|
31343
31351
|
reviewError: true,
|
|
31344
31352
|
comment: ''
|
|
31345
31353
|
}]
|
|
31346
|
-
}
|
|
31354
|
+
}
|
|
31347
31355
|
});
|
|
31348
31356
|
}
|
|
31349
31357
|
};
|
|
31350
|
-
const requiredComment =
|
|
31358
|
+
const requiredComment = inputMeta?.notApplicable && input?.meta?.requiredCommentOnNotApplicable && values?.[formId]?.valuation !== 'na';
|
|
31351
31359
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
31352
31360
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
31353
31361
|
className: "flex input-cont",
|
|
31354
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item,
|
|
31355
|
-
required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
|
|
31356
|
-
|
|
31357
|
-
|
|
31358
|
-
|
|
31359
|
-
|
|
31360
|
-
|
|
31361
|
-
|
|
31362
|
-
|
|
31363
|
-
|
|
31364
|
-
|
|
31365
|
-
|
|
31366
|
-
return e && e.fileList && e.fileList.map(f => {
|
|
31367
|
-
if (f.response) {
|
|
31368
|
-
return f.response;
|
|
31362
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
31363
|
+
required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
|
|
31364
|
+
...(['total100', 'group'].includes(input.type) ? {} : {
|
|
31365
|
+
name: notPartOfTheForm ? [formId, inputId] : inputId,
|
|
31366
|
+
fieldKey: notPartOfTheForm ? [formId, inputId] : inputId,
|
|
31367
|
+
initialValue: notPartOfTheForm ? (values[formId] || {})[inputId] : values[inputId]
|
|
31368
|
+
}),
|
|
31369
|
+
...(['upload', 'imageUpload', 'videoUpload'].includes(input.type) ? {
|
|
31370
|
+
valuePropName: "fileList",
|
|
31371
|
+
getValueFromEvent: e => {
|
|
31372
|
+
if (Array.isArray(e)) {
|
|
31373
|
+
return e;
|
|
31369
31374
|
}
|
|
31370
|
-
return f
|
|
31371
|
-
|
|
31372
|
-
|
|
31373
|
-
|
|
31374
|
-
|
|
31375
|
-
|
|
31375
|
+
return e && e.fileList && e.fileList.map(f => {
|
|
31376
|
+
if (f.response) {
|
|
31377
|
+
return f.response;
|
|
31378
|
+
}
|
|
31379
|
+
return f;
|
|
31380
|
+
});
|
|
31381
|
+
}
|
|
31382
|
+
} : {}),
|
|
31383
|
+
...(inputOnBlur.includes(input.type) ? {
|
|
31384
|
+
trigger: "onBlur"
|
|
31385
|
+
} : {}),
|
|
31376
31386
|
style: input.showOnView === false ? {
|
|
31377
31387
|
display: 'none'
|
|
31378
|
-
} : {}
|
|
31379
|
-
|
|
31380
|
-
|
|
31381
|
-
|
|
31382
|
-
|
|
31383
|
-
|
|
31384
|
-
|
|
31385
|
-
|
|
31386
|
-
|
|
31387
|
-
|
|
31388
|
-
|
|
31389
|
-
|
|
31388
|
+
} : {},
|
|
31389
|
+
...(['switch'].includes(input.type) ? {
|
|
31390
|
+
labelCol: {
|
|
31391
|
+
span: 20
|
|
31392
|
+
},
|
|
31393
|
+
style: {
|
|
31394
|
+
...(input.showOnView === false ? {
|
|
31395
|
+
display: 'none'
|
|
31396
|
+
} : {}),
|
|
31397
|
+
flexDirection: 'row',
|
|
31398
|
+
justifyContent: 'space-between'
|
|
31399
|
+
}
|
|
31400
|
+
} : {}),
|
|
31390
31401
|
label: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31391
|
-
className:
|
|
31402
|
+
className: input?.meta?.code && "mr-10",
|
|
31392
31403
|
children: getInputLabel$1(input, values)
|
|
31393
31404
|
}) : null,
|
|
31394
31405
|
rules: rules,
|
|
31395
|
-
className: formatClassname([input.comment ?
|
|
31396
|
-
"data-id":
|
|
31406
|
+
className: formatClassname([input.comment ? `flex-1 with-comment i-${input.type}` : `i-${input.type} flex-1 `, noActionsInputs.includes(input.type) && 'no-actions-input']),
|
|
31407
|
+
"data-id": `${formId}.${inputId}`,
|
|
31397
31408
|
extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
31398
31409
|
children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
31399
31410
|
className: formatClassname(["ml-4 input-actions"]),
|
|
@@ -31403,7 +31414,7 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31403
31414
|
title: t('Add review note'),
|
|
31404
31415
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31405
31416
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31406
|
-
className: formatClassname(["review-btn review-error-btn",
|
|
31417
|
+
className: formatClassname(["review-btn review-error-btn", lastReview?.reviewError && 'primary']),
|
|
31407
31418
|
type: "link",
|
|
31408
31419
|
onClick: onClickReviewError,
|
|
31409
31420
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
@@ -31419,7 +31430,7 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31419
31430
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31420
31431
|
type: "link",
|
|
31421
31432
|
onClick: onClickReviewSuccess,
|
|
31422
|
-
className: formatClassname(["review-btn review-success-btn",
|
|
31433
|
+
className: formatClassname(["review-btn review-success-btn", lastReview?.reviewSuccess && 'primary']),
|
|
31423
31434
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
31424
31435
|
name: "CheckSquare",
|
|
31425
31436
|
width: 16,
|
|
@@ -31436,59 +31447,65 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31436
31447
|
className: formatClassname(["default p-0", inputMeta.notApplicable && 'primary']),
|
|
31437
31448
|
type: "link",
|
|
31438
31449
|
onClick: () => {
|
|
31439
|
-
var _input$meta5, _input$meta6;
|
|
31440
31450
|
const value = getDefaultInputValue(input);
|
|
31441
|
-
const commentMeta = input
|
|
31451
|
+
const commentMeta = input?.meta?.requiredCommentOnNotApplicable ? {
|
|
31442
31452
|
comment: ''
|
|
31443
31453
|
} : {};
|
|
31444
|
-
if (input
|
|
31454
|
+
if (input?.meta?.requiredCommentOnNotApplicable) {
|
|
31445
31455
|
setIsShown(true);
|
|
31446
31456
|
}
|
|
31447
31457
|
if (notPartOfTheForm || isAjaxSubGroup) {
|
|
31448
|
-
var _values$meta8;
|
|
31449
31458
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31450
|
-
const _defaultMeta = (
|
|
31459
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31451
31460
|
if (isAjaxSubGroup) {
|
|
31452
|
-
var _defaultData$meta11;
|
|
31453
31461
|
changeInputMeta({
|
|
31454
31462
|
key: formId,
|
|
31455
31463
|
type: input.type,
|
|
31456
31464
|
otherValues: {
|
|
31457
|
-
[formId]:
|
|
31465
|
+
[formId]: {
|
|
31466
|
+
..._defaultData,
|
|
31458
31467
|
[inputId]: value,
|
|
31459
31468
|
meta: {
|
|
31460
|
-
inputs:
|
|
31461
|
-
|
|
31469
|
+
inputs: {
|
|
31470
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31471
|
+
[inputId]: inputMeta.notApplicable ? {
|
|
31462
31472
|
notApplicable: false,
|
|
31463
|
-
notAvailable: false
|
|
31464
|
-
|
|
31473
|
+
notAvailable: false,
|
|
31474
|
+
...commentMeta
|
|
31475
|
+
} : {
|
|
31465
31476
|
notApplicable: true,
|
|
31466
|
-
notAvailable: false
|
|
31467
|
-
|
|
31468
|
-
|
|
31477
|
+
notAvailable: false,
|
|
31478
|
+
...commentMeta
|
|
31479
|
+
}
|
|
31480
|
+
}
|
|
31469
31481
|
}
|
|
31470
|
-
}
|
|
31482
|
+
}
|
|
31471
31483
|
}
|
|
31472
31484
|
});
|
|
31473
31485
|
} else {
|
|
31474
31486
|
changeInputMeta({
|
|
31475
31487
|
key: formId,
|
|
31476
31488
|
type: input.type,
|
|
31477
|
-
value: inputMeta.notApplicable ?
|
|
31478
|
-
|
|
31489
|
+
value: inputMeta.notApplicable ? {
|
|
31490
|
+
..._defaultMeta,
|
|
31491
|
+
[inputId]: {
|
|
31479
31492
|
notApplicable: false,
|
|
31480
|
-
notAvailable: false
|
|
31481
|
-
|
|
31482
|
-
|
|
31483
|
-
|
|
31493
|
+
notAvailable: false,
|
|
31494
|
+
...commentMeta
|
|
31495
|
+
}
|
|
31496
|
+
} : {
|
|
31497
|
+
..._defaultMeta,
|
|
31498
|
+
[inputId]: {
|
|
31484
31499
|
notApplicable: true,
|
|
31485
|
-
notAvailable: false
|
|
31486
|
-
|
|
31487
|
-
|
|
31500
|
+
notAvailable: false,
|
|
31501
|
+
...commentMeta
|
|
31502
|
+
}
|
|
31503
|
+
},
|
|
31488
31504
|
otherValues: {
|
|
31489
|
-
[formId]:
|
|
31505
|
+
[formId]: {
|
|
31506
|
+
..._defaultData,
|
|
31490
31507
|
[inputId]: value
|
|
31491
|
-
}
|
|
31508
|
+
}
|
|
31492
31509
|
}
|
|
31493
31510
|
});
|
|
31494
31511
|
}
|
|
@@ -31509,7 +31526,7 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31509
31526
|
});
|
|
31510
31527
|
}
|
|
31511
31528
|
},
|
|
31512
|
-
disabled: !
|
|
31529
|
+
disabled: !input.meta?.notApplicable,
|
|
31513
31530
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
31514
31531
|
name: "NotApplicable",
|
|
31515
31532
|
width: 16,
|
|
@@ -31523,24 +31540,24 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31523
31540
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
31524
31541
|
className: formatClassname(["default p-0", inputMeta.notAvailable && 'primary']),
|
|
31525
31542
|
type: "link",
|
|
31526
|
-
disabled: !
|
|
31543
|
+
disabled: !input.meta?.notAvailable,
|
|
31527
31544
|
onClick: () => {
|
|
31528
31545
|
const value = getDefaultInputValue(input);
|
|
31529
31546
|
if (notPartOfTheForm || isAjaxSubGroup) {
|
|
31530
|
-
var _values$meta9;
|
|
31531
31547
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31532
|
-
const _defaultMeta = (
|
|
31548
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31533
31549
|
if (isAjaxSubGroup) {
|
|
31534
31550
|
if (isAjaxSubGroup) {
|
|
31535
|
-
var _defaultData$meta12;
|
|
31536
31551
|
changeInputMeta({
|
|
31537
31552
|
key: formId,
|
|
31538
31553
|
type: input.type,
|
|
31539
31554
|
otherValues: {
|
|
31540
|
-
[formId]:
|
|
31555
|
+
[formId]: {
|
|
31556
|
+
..._defaultData,
|
|
31541
31557
|
[inputId]: value,
|
|
31542
31558
|
meta: {
|
|
31543
|
-
inputs:
|
|
31559
|
+
inputs: {
|
|
31560
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31544
31561
|
[inputId]: inputMeta.notAvailable ? {
|
|
31545
31562
|
notApplicable: false,
|
|
31546
31563
|
notAvailable: false
|
|
@@ -31548,9 +31565,9 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31548
31565
|
notApplicable: false,
|
|
31549
31566
|
notAvailable: true
|
|
31550
31567
|
}
|
|
31551
|
-
}
|
|
31568
|
+
}
|
|
31552
31569
|
}
|
|
31553
|
-
}
|
|
31570
|
+
}
|
|
31554
31571
|
}
|
|
31555
31572
|
});
|
|
31556
31573
|
}
|
|
@@ -31558,21 +31575,24 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31558
31575
|
changeInputMeta({
|
|
31559
31576
|
key: formId,
|
|
31560
31577
|
type: input.type,
|
|
31561
|
-
value: inputMeta.notAvailable ?
|
|
31578
|
+
value: inputMeta.notAvailable ? {
|
|
31579
|
+
..._defaultMeta,
|
|
31562
31580
|
[inputId]: {
|
|
31563
31581
|
notApplicable: false,
|
|
31564
31582
|
notAvailable: false
|
|
31565
31583
|
}
|
|
31566
|
-
}
|
|
31584
|
+
} : {
|
|
31585
|
+
..._defaultMeta,
|
|
31567
31586
|
[inputId]: {
|
|
31568
31587
|
notApplicable: false,
|
|
31569
31588
|
notAvailable: true
|
|
31570
31589
|
}
|
|
31571
|
-
}
|
|
31590
|
+
},
|
|
31572
31591
|
otherValues: {
|
|
31573
|
-
[formId]:
|
|
31592
|
+
[formId]: {
|
|
31593
|
+
..._defaultData,
|
|
31574
31594
|
[inputId]: value
|
|
31575
|
-
}
|
|
31595
|
+
}
|
|
31576
31596
|
}
|
|
31577
31597
|
});
|
|
31578
31598
|
}
|
|
@@ -31603,33 +31623,38 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31603
31623
|
}), /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
31604
31624
|
title: t('Add comment'),
|
|
31605
31625
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31606
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button,
|
|
31626
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
31607
31627
|
type: "link",
|
|
31608
|
-
disabled: !
|
|
31609
|
-
|
|
31610
|
-
|
|
31611
|
-
|
|
31612
|
-
|
|
31613
|
-
|
|
31628
|
+
disabled: !input.meta?.comment,
|
|
31629
|
+
...(!isShown ? {
|
|
31630
|
+
className: 'default p-0'
|
|
31631
|
+
} : {
|
|
31632
|
+
className: 'p-0 primary'
|
|
31633
|
+
}),
|
|
31614
31634
|
onClick: onClickComment,
|
|
31615
31635
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
31616
31636
|
name: "AddComment",
|
|
31617
31637
|
width: 16,
|
|
31618
31638
|
height: 16
|
|
31619
31639
|
})
|
|
31620
|
-
})
|
|
31640
|
+
})
|
|
31621
31641
|
})
|
|
31622
31642
|
})]
|
|
31623
31643
|
}) : null]
|
|
31624
31644
|
}) : null
|
|
31625
31645
|
}),
|
|
31626
31646
|
children: isReview ? /*#__PURE__*/jsxRuntime.jsx(BasicInput, {
|
|
31627
|
-
data:
|
|
31628
|
-
|
|
31629
|
-
|
|
31630
|
-
|
|
31631
|
-
|
|
31632
|
-
|
|
31647
|
+
data: {
|
|
31648
|
+
...(values[formId] || {}),
|
|
31649
|
+
meta: {
|
|
31650
|
+
...(values?.meta || {}),
|
|
31651
|
+
inputs: {
|
|
31652
|
+
...(values?.meta?.inputs || {}),
|
|
31653
|
+
...((values?.meta?.inputs || {})[formId] || {})
|
|
31654
|
+
}
|
|
31655
|
+
}
|
|
31656
|
+
},
|
|
31657
|
+
linkingData: values?.linking || values?.parent?.linking,
|
|
31633
31658
|
name: input.dataId,
|
|
31634
31659
|
config: input,
|
|
31635
31660
|
t: t,
|
|
@@ -31641,12 +31666,13 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31641
31666
|
getToken: getToken,
|
|
31642
31667
|
app: app,
|
|
31643
31668
|
valueOnlyString: true
|
|
31644
|
-
}) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](
|
|
31669
|
+
}) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
|
|
31670
|
+
...inputData,
|
|
31645
31671
|
name: inputId,
|
|
31646
31672
|
maxWidth,
|
|
31647
31673
|
staticWidth,
|
|
31648
31674
|
fullWidth
|
|
31649
|
-
}
|
|
31675
|
+
}, {
|
|
31650
31676
|
form: MainForm,
|
|
31651
31677
|
forms: options,
|
|
31652
31678
|
allForms: plainForms,
|
|
@@ -31664,10 +31690,10 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31664
31690
|
staticWidth,
|
|
31665
31691
|
fullWidth
|
|
31666
31692
|
}) : console.log(input)
|
|
31667
|
-
})
|
|
31693
|
+
}), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31668
31694
|
className: "code",
|
|
31669
31695
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
31670
|
-
children:
|
|
31696
|
+
children: input.meta?.code
|
|
31671
31697
|
})
|
|
31672
31698
|
}) : null]
|
|
31673
31699
|
}), maxRule ? ['imageUpload', 'videoUpload', 'upload'].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -31687,16 +31713,16 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31687
31713
|
className: "max-char-span",
|
|
31688
31714
|
children: t('max-char', {
|
|
31689
31715
|
chars: maxRule,
|
|
31690
|
-
filled:
|
|
31716
|
+
filled: inputData?.value?.length || 0
|
|
31691
31717
|
})
|
|
31692
31718
|
})
|
|
31693
|
-
}) : null,
|
|
31719
|
+
}) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
31694
31720
|
className: "input-content",
|
|
31695
31721
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
31696
31722
|
className: "comment-textarea",
|
|
31697
|
-
initialValue:
|
|
31723
|
+
initialValue: inputMeta?.comment || '',
|
|
31698
31724
|
hidden: !isShown,
|
|
31699
|
-
name:
|
|
31725
|
+
name: `${formId}-${inputId}-comment`,
|
|
31700
31726
|
required: requiredComment,
|
|
31701
31727
|
rules: requiredComment ? [{
|
|
31702
31728
|
required: true,
|
|
@@ -31713,35 +31739,38 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31713
31739
|
onConfirm: () => {
|
|
31714
31740
|
setIsShown(false);
|
|
31715
31741
|
if (notPartOfTheForm) {
|
|
31716
|
-
|
|
31717
|
-
const _defaultMeta = ((values === null || values === void 0 || (_values$meta12 = values.meta) === null || _values$meta12 === void 0 ? void 0 : _values$meta12.inputs) || {})[formId] || {};
|
|
31742
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31718
31743
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31719
31744
|
if (isAjaxSubGroup) {
|
|
31720
|
-
var _defaultData$meta13, _defaultData$meta14;
|
|
31721
31745
|
changeInputMeta({
|
|
31722
31746
|
key: formId,
|
|
31723
31747
|
type: input.type,
|
|
31724
31748
|
otherValues: {
|
|
31725
|
-
[formId]:
|
|
31749
|
+
[formId]: {
|
|
31750
|
+
..._defaultData,
|
|
31726
31751
|
meta: {
|
|
31727
|
-
inputs:
|
|
31728
|
-
|
|
31752
|
+
inputs: {
|
|
31753
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31754
|
+
[inputId]: {
|
|
31755
|
+
...((_defaultData?.meta?.inputs || {})[inputId] || {}),
|
|
31729
31756
|
comment: null
|
|
31730
|
-
}
|
|
31731
|
-
}
|
|
31757
|
+
}
|
|
31758
|
+
}
|
|
31732
31759
|
}
|
|
31733
|
-
}
|
|
31760
|
+
}
|
|
31734
31761
|
}
|
|
31735
31762
|
});
|
|
31736
31763
|
} else {
|
|
31737
31764
|
changeInputMeta({
|
|
31738
31765
|
key: formId,
|
|
31739
31766
|
type: input.type,
|
|
31740
|
-
value:
|
|
31741
|
-
|
|
31767
|
+
value: {
|
|
31768
|
+
..._defaultMeta,
|
|
31769
|
+
[inputId]: {
|
|
31770
|
+
...(_defaultMeta[inputId] || {}),
|
|
31742
31771
|
comment: null
|
|
31743
|
-
}
|
|
31744
|
-
}
|
|
31772
|
+
}
|
|
31773
|
+
}
|
|
31745
31774
|
});
|
|
31746
31775
|
}
|
|
31747
31776
|
} else {
|
|
@@ -31756,7 +31785,7 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31756
31785
|
},
|
|
31757
31786
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
31758
31787
|
type: "link",
|
|
31759
|
-
disabled: !
|
|
31788
|
+
disabled: !input.meta?.comment,
|
|
31760
31789
|
className: "p-0",
|
|
31761
31790
|
children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
|
|
31762
31791
|
width: 16,
|
|
@@ -31768,41 +31797,44 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31768
31797
|
children: inputTypeComponent$1.comment(inputData, {
|
|
31769
31798
|
form: MainForm,
|
|
31770
31799
|
forms: options,
|
|
31771
|
-
value:
|
|
31800
|
+
value: inputMeta?.comment || '',
|
|
31772
31801
|
maxWidth,
|
|
31773
31802
|
staticWidth,
|
|
31774
31803
|
fullWidth,
|
|
31775
31804
|
onChange: val => {
|
|
31776
31805
|
if (notPartOfTheForm) {
|
|
31777
|
-
|
|
31778
|
-
const _defaultMeta = ((values === null || values === void 0 || (_values$meta13 = values.meta) === null || _values$meta13 === void 0 ? void 0 : _values$meta13.inputs) || {})[formId] || {};
|
|
31806
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31779
31807
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31780
31808
|
if (isAjaxSubGroup) {
|
|
31781
|
-
var _defaultData$meta15, _defaultData$meta16;
|
|
31782
31809
|
changeInputMeta({
|
|
31783
31810
|
key: formId,
|
|
31784
31811
|
type: input.type,
|
|
31785
31812
|
otherValues: {
|
|
31786
|
-
[formId]:
|
|
31813
|
+
[formId]: {
|
|
31814
|
+
..._defaultData,
|
|
31787
31815
|
meta: {
|
|
31788
|
-
inputs:
|
|
31789
|
-
|
|
31816
|
+
inputs: {
|
|
31817
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31818
|
+
[inputId]: {
|
|
31819
|
+
...((_defaultData?.meta?.inputs || {})[inputId] || {}),
|
|
31790
31820
|
comment: val
|
|
31791
|
-
}
|
|
31792
|
-
}
|
|
31821
|
+
}
|
|
31822
|
+
}
|
|
31793
31823
|
}
|
|
31794
|
-
}
|
|
31824
|
+
}
|
|
31795
31825
|
}
|
|
31796
31826
|
});
|
|
31797
31827
|
} else {
|
|
31798
31828
|
changeInputMeta({
|
|
31799
31829
|
key: formId,
|
|
31800
31830
|
type: input.type,
|
|
31801
|
-
value:
|
|
31802
|
-
|
|
31831
|
+
value: {
|
|
31832
|
+
..._defaultMeta,
|
|
31833
|
+
[inputId]: {
|
|
31834
|
+
...(_defaultMeta[inputId] || {}),
|
|
31803
31835
|
comment: val
|
|
31804
|
-
}
|
|
31805
|
-
}
|
|
31836
|
+
}
|
|
31837
|
+
}
|
|
31806
31838
|
});
|
|
31807
31839
|
}
|
|
31808
31840
|
} else {
|
|
@@ -31823,16 +31855,16 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31823
31855
|
className: "max-char-span",
|
|
31824
31856
|
children: t('max-char', {
|
|
31825
31857
|
chars: MAX_COMMENTS_LENGTH,
|
|
31826
|
-
filled:
|
|
31858
|
+
filled: inputMeta?.comment?.length || 0
|
|
31827
31859
|
})
|
|
31828
31860
|
})]
|
|
31829
|
-
}) : null, lastReview
|
|
31861
|
+
}) : null, lastReview?.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31830
31862
|
className: "input-content",
|
|
31831
31863
|
children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
31832
31864
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
31833
31865
|
className: "comment-textarea",
|
|
31834
|
-
initialValue:
|
|
31835
|
-
name:
|
|
31866
|
+
initialValue: lastReview?.comment || '',
|
|
31867
|
+
name: `${formId}-${inputId}-reviewErrorComment`,
|
|
31836
31868
|
label: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31837
31869
|
className: "flex w-100",
|
|
31838
31870
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -31843,71 +31875,78 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31843
31875
|
children: inputTypeComponent$1.comment(inputData, {
|
|
31844
31876
|
form: MainForm,
|
|
31845
31877
|
forms: options,
|
|
31846
|
-
value:
|
|
31878
|
+
value: lastReview?.comment || '',
|
|
31847
31879
|
maxWidth,
|
|
31848
31880
|
staticWidth,
|
|
31849
31881
|
fullWidth,
|
|
31850
31882
|
onChange: val => {
|
|
31851
31883
|
if (notPartOfTheForm) {
|
|
31852
|
-
|
|
31853
|
-
const _defaultMeta = ((values === null || values === void 0 || (_values$meta14 = values.meta) === null || _values$meta14 === void 0 ? void 0 : _values$meta14.inputs) || {})[formId] || {};
|
|
31884
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31854
31885
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31855
31886
|
if (isAjaxSubGroup) {
|
|
31856
|
-
var _defaultData$meta17, _defaultData$meta18, _defaultData$meta19;
|
|
31857
31887
|
changeInputMeta({
|
|
31858
31888
|
key: formId,
|
|
31859
31889
|
type: input.type,
|
|
31860
31890
|
otherValues: {
|
|
31861
|
-
[formId]:
|
|
31891
|
+
[formId]: {
|
|
31892
|
+
..._defaultData,
|
|
31862
31893
|
meta: {
|
|
31863
|
-
inputs:
|
|
31864
|
-
|
|
31865
|
-
|
|
31894
|
+
inputs: {
|
|
31895
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31896
|
+
[inputId]: {
|
|
31897
|
+
...((_defaultData?.meta?.inputs || {})[inputId] || {}),
|
|
31898
|
+
reviews: (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).map(v => {
|
|
31866
31899
|
if (v.createdAt === lastReview.createdAt) {
|
|
31867
|
-
return
|
|
31900
|
+
return {
|
|
31901
|
+
...v,
|
|
31868
31902
|
comment: val
|
|
31869
|
-
}
|
|
31903
|
+
};
|
|
31870
31904
|
}
|
|
31871
31905
|
return v;
|
|
31872
31906
|
})
|
|
31873
|
-
}
|
|
31874
|
-
}
|
|
31907
|
+
}
|
|
31908
|
+
}
|
|
31875
31909
|
}
|
|
31876
|
-
}
|
|
31910
|
+
}
|
|
31877
31911
|
}
|
|
31878
31912
|
});
|
|
31879
31913
|
} else {
|
|
31880
31914
|
changeInputMeta({
|
|
31881
31915
|
key: formId,
|
|
31882
31916
|
type: input.type,
|
|
31883
|
-
value:
|
|
31884
|
-
|
|
31917
|
+
value: {
|
|
31918
|
+
..._defaultMeta,
|
|
31919
|
+
[inputId]: {
|
|
31920
|
+
...(_defaultMeta[inputId] || {}),
|
|
31885
31921
|
reviews: ((_defaultMeta[inputId] || {}).reviews || []).map(v => {
|
|
31886
31922
|
if (v.createdAt === lastReview.createdAt) {
|
|
31887
|
-
return
|
|
31923
|
+
return {
|
|
31924
|
+
...v,
|
|
31888
31925
|
comment: val
|
|
31889
|
-
}
|
|
31926
|
+
};
|
|
31890
31927
|
}
|
|
31891
31928
|
return v;
|
|
31892
31929
|
})
|
|
31893
|
-
}
|
|
31894
|
-
}
|
|
31930
|
+
}
|
|
31931
|
+
}
|
|
31895
31932
|
});
|
|
31896
31933
|
}
|
|
31897
31934
|
} else {
|
|
31898
31935
|
changeInputMeta({
|
|
31899
31936
|
key: inputId,
|
|
31900
31937
|
type: input.type,
|
|
31901
|
-
value:
|
|
31902
|
-
|
|
31938
|
+
value: {
|
|
31939
|
+
...inputMeta,
|
|
31940
|
+
reviews: (inputMeta?.reviews || []).map(v => {
|
|
31903
31941
|
if (v.createdAt === lastReview.createdAt) {
|
|
31904
|
-
return
|
|
31942
|
+
return {
|
|
31943
|
+
...v,
|
|
31905
31944
|
comment: val
|
|
31906
|
-
}
|
|
31945
|
+
};
|
|
31907
31946
|
}
|
|
31908
31947
|
return v;
|
|
31909
31948
|
})
|
|
31910
|
-
}
|
|
31949
|
+
}
|
|
31911
31950
|
});
|
|
31912
31951
|
}
|
|
31913
31952
|
},
|
|
@@ -31919,7 +31958,7 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31919
31958
|
className: "max-char-span",
|
|
31920
31959
|
children: t('max-char', {
|
|
31921
31960
|
chars: MAX_COMMENTS_LENGTH,
|
|
31922
|
-
filled:
|
|
31961
|
+
filled: lastReview.comment?.length || 0
|
|
31923
31962
|
})
|
|
31924
31963
|
})]
|
|
31925
31964
|
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -31940,7 +31979,7 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31940
31979
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31941
31980
|
className: "flex flex-column justify-center mr-1",
|
|
31942
31981
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
31943
|
-
children:
|
|
31982
|
+
children: lastReview?.reviewer?.firstName + ' ' + lastReview?.reviewer?.lastName + ' - ' + moment__default["default"](lastReview.createdAt).format('DD MMM YYYY')
|
|
31944
31983
|
})
|
|
31945
31984
|
})]
|
|
31946
31985
|
})]
|
|
@@ -35913,13 +35952,11 @@ const beforeUpload = allowedExtensions => file => {
|
|
|
35913
35952
|
};
|
|
35914
35953
|
const allowedImageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.avif', '.bmp', '.tiff', '.tif', '.heif', '.heic', '.svg', '.ico'];
|
|
35915
35954
|
|
|
35916
|
-
|
|
35917
|
-
_excluded2$1 = ["label", "description", "excludeFromEdit", "showFormIf", "icon", "position", "template", "formClass"];
|
|
35955
|
+
/* eslint-disable no-case-declarations */
|
|
35918
35956
|
dayjs__default["default"].extend(utc);
|
|
35919
35957
|
dayjs__default["default"].extend(timezone);
|
|
35920
35958
|
dayjs__default["default"].tz.setDefault("UTC");
|
|
35921
|
-
const getDefaultInputValue =
|
|
35922
|
-
let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
35959
|
+
const getDefaultInputValue = (input = {}) => {
|
|
35923
35960
|
let value = undefined;
|
|
35924
35961
|
if (input.type === "multiselect") {
|
|
35925
35962
|
value = [];
|
|
@@ -35937,30 +35974,33 @@ const checkCondition$1 = (condition, repeatValues, formsValue) => {
|
|
|
35937
35974
|
const isShown = _checkValue(isNotEmpty ? field : wantedValue, match, isNotEmpty ? formValue : value);
|
|
35938
35975
|
return isShown;
|
|
35939
35976
|
};
|
|
35940
|
-
const renderDataLinkGroup =
|
|
35941
|
-
|
|
35942
|
-
|
|
35943
|
-
|
|
35944
|
-
|
|
35945
|
-
|
|
35946
|
-
|
|
35947
|
-
|
|
35948
|
-
|
|
35949
|
-
|
|
35950
|
-
|
|
35951
|
-
|
|
35952
|
-
|
|
35953
|
-
const
|
|
35954
|
-
|
|
35955
|
-
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";
|
|
35956
|
-
});
|
|
35957
|
-
const dataLinkInput = ((input === null || input === void 0 ? void 0 : input.inputs) || {})[dataLinkKey];
|
|
35958
|
-
const otherInputs = Object.keys((input === null || input === void 0 ? void 0 : input.inputs) || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
|
|
35959
|
-
all[key] = input === null || input === void 0 ? void 0 : input.inputs[key];
|
|
35977
|
+
const renderDataLinkGroup = ({
|
|
35978
|
+
input,
|
|
35979
|
+
groupFormId,
|
|
35980
|
+
name,
|
|
35981
|
+
formsValue,
|
|
35982
|
+
form,
|
|
35983
|
+
onValuesChange,
|
|
35984
|
+
setValues,
|
|
35985
|
+
changeLinking,
|
|
35986
|
+
isHighlighted
|
|
35987
|
+
}) => {
|
|
35988
|
+
const dataLinkKey = Object.keys(input?.inputs || {}).find(k => input?.inputs[k]?.type === "dataLink");
|
|
35989
|
+
const dataLinkInput = (input?.inputs || {})[dataLinkKey];
|
|
35990
|
+
const otherInputs = Object.keys(input?.inputs || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
|
|
35991
|
+
all[key] = input?.inputs[key];
|
|
35960
35992
|
return all;
|
|
35961
35993
|
}, {});
|
|
35962
|
-
const isSingle =
|
|
35963
|
-
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [
|
|
35994
|
+
const isSingle = input?.meta?.maxRepeat === 1;
|
|
35995
|
+
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
|
|
35996
|
+
...(formsValue[groupFormId] || {})[name]
|
|
35997
|
+
}] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
|
|
35998
|
+
...v
|
|
35999
|
+
})) : isSingle ? formsValue[name] ? [{
|
|
36000
|
+
...formsValue[name]
|
|
36001
|
+
}] : [] : getArray(formsValue[name] || []).map(v => ({
|
|
36002
|
+
...v
|
|
36003
|
+
}));
|
|
35964
36004
|
const onUpdate = (val, i) => {
|
|
35965
36005
|
const _val = isSingle ? {
|
|
35966
36006
|
[name]: val
|
|
@@ -35968,20 +36008,31 @@ const renderDataLinkGroup = _ref2 => {
|
|
|
35968
36008
|
[name]: formData.map((d, j) => i === j ? val : d)
|
|
35969
36009
|
};
|
|
35970
36010
|
if (groupFormId) {
|
|
35971
|
-
const _defaultData =
|
|
35972
|
-
const _newData =
|
|
35973
|
-
|
|
36011
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36012
|
+
const _newData = {
|
|
36013
|
+
..._defaultData,
|
|
36014
|
+
..._val
|
|
36015
|
+
};
|
|
36016
|
+
onValuesChange(_newData, {
|
|
36017
|
+
...formsValue,
|
|
35974
36018
|
[groupFormId]: _newData
|
|
35975
|
-
})
|
|
35976
|
-
form
|
|
35977
|
-
setValues(
|
|
36019
|
+
});
|
|
36020
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36021
|
+
setValues({
|
|
36022
|
+
...formsValue,
|
|
35978
36023
|
[groupFormId]: _newData
|
|
35979
|
-
})
|
|
36024
|
+
});
|
|
35980
36025
|
return;
|
|
35981
36026
|
}
|
|
35982
|
-
onValuesChange(_val,
|
|
35983
|
-
|
|
35984
|
-
|
|
36027
|
+
onValuesChange(_val, {
|
|
36028
|
+
...formsValue,
|
|
36029
|
+
..._val
|
|
36030
|
+
});
|
|
36031
|
+
form?.setFieldValue(name, _val[name]);
|
|
36032
|
+
setValues({
|
|
36033
|
+
...formsValue,
|
|
36034
|
+
..._val
|
|
36035
|
+
});
|
|
35985
36036
|
};
|
|
35986
36037
|
return /*#__PURE__*/jsxRuntime.jsx(DataLinkGroup, {
|
|
35987
36038
|
form: input,
|
|
@@ -35992,79 +36043,102 @@ const renderDataLinkGroup = _ref2 => {
|
|
|
35992
36043
|
isHighlighted: isHighlighted,
|
|
35993
36044
|
dataLinkInput: dataLinkInput,
|
|
35994
36045
|
formsValue: formsValue,
|
|
35995
|
-
values: groupFormId ?
|
|
36046
|
+
values: groupFormId ? {
|
|
36047
|
+
...(formsValue[groupFormId] || {}),
|
|
35996
36048
|
meta: {
|
|
35997
|
-
inputs: (
|
|
36049
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
35998
36050
|
}
|
|
35999
|
-
}
|
|
36051
|
+
} : formsValue,
|
|
36000
36052
|
name: name,
|
|
36001
36053
|
groupFormId: groupFormId,
|
|
36002
|
-
maxRepeat: input
|
|
36003
|
-
remove:
|
|
36004
|
-
|
|
36005
|
-
|
|
36006
|
-
} = _ref3;
|
|
36054
|
+
maxRepeat: input?.meta?.maxRepeat,
|
|
36055
|
+
remove: ({
|
|
36056
|
+
key
|
|
36057
|
+
}) => {
|
|
36007
36058
|
const _val = isSingle ? {
|
|
36008
36059
|
[name]: null
|
|
36009
36060
|
} : {
|
|
36010
36061
|
[name]: formData.filter((v, j) => j !== key)
|
|
36011
36062
|
};
|
|
36012
36063
|
if (groupFormId) {
|
|
36013
|
-
const _defaultData =
|
|
36014
|
-
const _newData =
|
|
36015
|
-
|
|
36064
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36065
|
+
const _newData = {
|
|
36066
|
+
..._defaultData,
|
|
36067
|
+
..._val
|
|
36068
|
+
};
|
|
36069
|
+
onValuesChange(_newData, {
|
|
36070
|
+
...formsValue,
|
|
36016
36071
|
[groupFormId]: _newData
|
|
36017
|
-
})
|
|
36018
|
-
form
|
|
36019
|
-
setValues(
|
|
36072
|
+
});
|
|
36073
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36074
|
+
setValues({
|
|
36075
|
+
...formsValue,
|
|
36020
36076
|
[groupFormId]: _newData
|
|
36021
|
-
})
|
|
36077
|
+
});
|
|
36022
36078
|
return;
|
|
36023
36079
|
}
|
|
36024
|
-
onValuesChange(_val,
|
|
36025
|
-
|
|
36026
|
-
|
|
36080
|
+
onValuesChange(_val, {
|
|
36081
|
+
...formsValue,
|
|
36082
|
+
..._val
|
|
36083
|
+
});
|
|
36084
|
+
form?.setFieldValue(name, _val[name]);
|
|
36085
|
+
setValues({
|
|
36086
|
+
...formsValue,
|
|
36087
|
+
..._val
|
|
36088
|
+
});
|
|
36027
36089
|
},
|
|
36028
36090
|
add: val => {
|
|
36029
36091
|
const _val = isSingle ? {
|
|
36030
36092
|
[name]: val
|
|
36031
36093
|
} : {
|
|
36032
|
-
[name]: [...formData,
|
|
36094
|
+
[name]: [...formData, {
|
|
36095
|
+
...val
|
|
36096
|
+
}]
|
|
36033
36097
|
};
|
|
36034
36098
|
if (groupFormId) {
|
|
36035
|
-
const _defaultData =
|
|
36036
|
-
const _newData =
|
|
36037
|
-
|
|
36038
|
-
|
|
36099
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36100
|
+
const _newData = {
|
|
36101
|
+
..._defaultData,
|
|
36102
|
+
..._val
|
|
36103
|
+
};
|
|
36104
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36105
|
+
onValuesChange(_newData, {
|
|
36106
|
+
...formsValue,
|
|
36039
36107
|
[groupFormId]: _newData
|
|
36040
|
-
})
|
|
36041
|
-
setValues(
|
|
36108
|
+
});
|
|
36109
|
+
setValues({
|
|
36110
|
+
...formsValue,
|
|
36042
36111
|
[groupFormId]: _newData
|
|
36043
|
-
})
|
|
36112
|
+
});
|
|
36044
36113
|
return;
|
|
36045
36114
|
}
|
|
36046
|
-
form
|
|
36047
|
-
onValuesChange(_val,
|
|
36048
|
-
|
|
36115
|
+
form?.setFieldValue(name, _val[name]);
|
|
36116
|
+
onValuesChange(_val, {
|
|
36117
|
+
...formsValue,
|
|
36118
|
+
..._val
|
|
36119
|
+
});
|
|
36120
|
+
setValues({
|
|
36121
|
+
...formsValue,
|
|
36122
|
+
..._val
|
|
36123
|
+
});
|
|
36049
36124
|
},
|
|
36050
36125
|
k: name,
|
|
36051
36126
|
formData: formData
|
|
36052
36127
|
});
|
|
36053
36128
|
};
|
|
36054
36129
|
function showHideInput$1(input, data, repeatIndex, repeatValues, inputMeta) {
|
|
36055
|
-
|
|
36056
|
-
if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
|
|
36130
|
+
if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
|
|
36057
36131
|
return false;
|
|
36058
36132
|
}
|
|
36059
|
-
if (typeof
|
|
36060
|
-
|
|
36061
|
-
return !(input !== null && input !== void 0 && (_input$meta4 = input.meta) !== null && _input$meta4 !== void 0 && _input$meta4.excludeFromEdit);
|
|
36133
|
+
if (typeof input?.meta?.excludeFromEdit === "boolean") {
|
|
36134
|
+
return !input?.meta?.excludeFromEdit;
|
|
36062
36135
|
}
|
|
36063
|
-
const formsValue =
|
|
36064
|
-
|
|
36065
|
-
|
|
36066
|
-
|
|
36067
|
-
|
|
36136
|
+
const formsValue = {
|
|
36137
|
+
...data
|
|
36138
|
+
};
|
|
36139
|
+
Object.keys(data?.meta?.inputs || {}).forEach(key => {
|
|
36140
|
+
const input = data?.meta?.inputs[key];
|
|
36141
|
+
if (input?.notApplicable || input?.notAvailable) {
|
|
36068
36142
|
formsValue[key] = undefined;
|
|
36069
36143
|
delete formsValue[key];
|
|
36070
36144
|
}
|
|
@@ -36123,35 +36197,35 @@ function getInputHeadLines$1(type, i, input, values) {
|
|
|
36123
36197
|
switch (type) {
|
|
36124
36198
|
case "h2":
|
|
36125
36199
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36126
|
-
className:
|
|
36200
|
+
className: `title-semibold-2 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36127
36201
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36128
36202
|
children: getInputLabel$1(input, values)
|
|
36129
36203
|
})
|
|
36130
36204
|
});
|
|
36131
36205
|
case "h3":
|
|
36132
36206
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36133
|
-
className:
|
|
36207
|
+
className: `title-semibold-3 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36134
36208
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36135
36209
|
children: getInputLabel$1(input, values)
|
|
36136
36210
|
})
|
|
36137
36211
|
});
|
|
36138
36212
|
case "h4":
|
|
36139
36213
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36140
|
-
className:
|
|
36214
|
+
className: `title-semibold-4 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36141
36215
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36142
36216
|
children: getInputLabel$1(input, values)
|
|
36143
36217
|
})
|
|
36144
36218
|
});
|
|
36145
36219
|
case "h5":
|
|
36146
36220
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36147
|
-
className:
|
|
36221
|
+
className: `title-semibold-5 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36148
36222
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36149
36223
|
children: getInputLabel$1(input, values)
|
|
36150
36224
|
})
|
|
36151
36225
|
});
|
|
36152
36226
|
case "h6":
|
|
36153
36227
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36154
|
-
className:
|
|
36228
|
+
className: `title-semibold-6 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36155
36229
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36156
36230
|
children: getInputLabel$1(input, values)
|
|
36157
36231
|
})
|
|
@@ -36160,16 +36234,15 @@ function getInputHeadLines$1(type, i, input, values) {
|
|
|
36160
36234
|
return null;
|
|
36161
36235
|
}
|
|
36162
36236
|
}
|
|
36163
|
-
function getInputProp(prop) {
|
|
36164
|
-
let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
36165
|
-
let scope = arguments.length > 2 ? arguments[2] : undefined;
|
|
36237
|
+
function getInputProp(prop, formsValue = {}, scope) {
|
|
36166
36238
|
if (prop && typeof prop === "object") {
|
|
36167
36239
|
const validations = Object.keys(prop);
|
|
36168
36240
|
const key = validations.find(v => {
|
|
36169
36241
|
let [path, match, wantedValue] = v.split(/( is | includes | not | notEmpty )/gim);
|
|
36170
|
-
const value = dot__default["default"].pick(path,
|
|
36242
|
+
const value = dot__default["default"].pick(path, {
|
|
36243
|
+
...formsValue,
|
|
36171
36244
|
scope
|
|
36172
|
-
})
|
|
36245
|
+
});
|
|
36173
36246
|
return _checkValue(wantedValue, match, value);
|
|
36174
36247
|
});
|
|
36175
36248
|
const label = key ? prop[key] : prop[validations[0]];
|
|
@@ -36178,33 +36251,29 @@ function getInputProp(prop) {
|
|
|
36178
36251
|
return prop;
|
|
36179
36252
|
}
|
|
36180
36253
|
}
|
|
36181
|
-
function getInputLabel$1(input) {
|
|
36182
|
-
let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
36183
|
-
let asText = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
36254
|
+
function getInputLabel$1(input, formsValue = {}, asText = false) {
|
|
36184
36255
|
return /*#__PURE__*/jsxRuntime.jsx(InputLabel, {
|
|
36185
36256
|
input: input,
|
|
36186
36257
|
formsValue: formsValue,
|
|
36187
36258
|
asText: asText
|
|
36188
36259
|
});
|
|
36189
36260
|
}
|
|
36190
|
-
const InputLabel =
|
|
36191
|
-
|
|
36192
|
-
|
|
36193
|
-
|
|
36194
|
-
|
|
36195
|
-
asText
|
|
36196
|
-
} = _ref4;
|
|
36261
|
+
const InputLabel = ({
|
|
36262
|
+
input,
|
|
36263
|
+
formsValue,
|
|
36264
|
+
asText
|
|
36265
|
+
}) => {
|
|
36197
36266
|
const {
|
|
36198
36267
|
t,
|
|
36199
36268
|
evaluationConfig,
|
|
36200
36269
|
scope
|
|
36201
36270
|
} = useEditContext();
|
|
36202
36271
|
const label = getInputProp(input.label, formsValue, scope);
|
|
36203
|
-
return input
|
|
36272
|
+
return input?.meta?.isEvaluation || input.description && typeof input.description === "string" && !asText ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
36204
36273
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
36205
36274
|
className: "flex",
|
|
36206
36275
|
children: [ReactHtmlParser__default["default"](label), /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
|
|
36207
|
-
content: input
|
|
36276
|
+
content: input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(EvaluationPopover, {
|
|
36208
36277
|
t: t,
|
|
36209
36278
|
evaluationConfig: evaluationConfig
|
|
36210
36279
|
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -36212,7 +36281,7 @@ const InputLabel = _ref4 => {
|
|
|
36212
36281
|
children: ReactHtmlParser__default["default"](input.description)
|
|
36213
36282
|
}),
|
|
36214
36283
|
placement: "top",
|
|
36215
|
-
children: !
|
|
36284
|
+
children: !input?.meta?.isEvaluation || evaluationConfig.length > 0 ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36216
36285
|
className: "flex flex-column justify-content-center ml-1",
|
|
36217
36286
|
children: /*#__PURE__*/jsxRuntime.jsx(TooltipIcon, {
|
|
36218
36287
|
fontSize: 13
|
|
@@ -36234,9 +36303,7 @@ function getSectionLabel$1(labels, values) {
|
|
|
36234
36303
|
}
|
|
36235
36304
|
return labels;
|
|
36236
36305
|
}
|
|
36237
|
-
function getSubtitles$1(subtitles, position) {
|
|
36238
|
-
let formsValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
36239
|
-
let repeatValues = arguments.length > 4 ? arguments[4] : undefined;
|
|
36306
|
+
function getSubtitles$1(subtitles, position, formsValue = {}, repeatIndex, repeatValues) {
|
|
36240
36307
|
let subtitle = subtitles && subtitles[position];
|
|
36241
36308
|
if (subtitle && typeof subtitle === "object") {
|
|
36242
36309
|
let newSubtitle = subtitle.default || "";
|
|
@@ -36280,12 +36347,14 @@ function getSubtitles$1(subtitles, position) {
|
|
|
36280
36347
|
function getFormTitles$1(titles, key, position) {
|
|
36281
36348
|
let tilte = titles && titles[key];
|
|
36282
36349
|
return tilte ? /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
36283
|
-
className:
|
|
36350
|
+
className: `title-semibold-3 mb0 ${position ? "mt-3" : ""}`,
|
|
36284
36351
|
children: tilte
|
|
36285
36352
|
}) : null;
|
|
36286
36353
|
}
|
|
36287
36354
|
const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsValue, name, mainForm) => {
|
|
36288
|
-
formsValue = Object.assign(formsValue,
|
|
36355
|
+
formsValue = Object.assign(formsValue, {
|
|
36356
|
+
...mainForm.getFieldsValue(true)
|
|
36357
|
+
});
|
|
36289
36358
|
if (typeof repeatIndex === "number" && repeatValues) {
|
|
36290
36359
|
if (!repeatValues[inputName] || !___default["default"].isEqual(repeatValues[inputName], value)) {
|
|
36291
36360
|
repeatValues[inputName] = value;
|
|
@@ -36320,16 +36389,14 @@ const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsVa
|
|
|
36320
36389
|
};
|
|
36321
36390
|
const inputOnBlur = [];
|
|
36322
36391
|
const inputTypeComponent$1 = {
|
|
36323
|
-
text: (
|
|
36324
|
-
|
|
36325
|
-
|
|
36326
|
-
|
|
36327
|
-
|
|
36328
|
-
|
|
36329
|
-
|
|
36330
|
-
|
|
36331
|
-
isHighlighted
|
|
36332
|
-
} = _ref6;
|
|
36392
|
+
text: ({
|
|
36393
|
+
props,
|
|
36394
|
+
rules
|
|
36395
|
+
}, {
|
|
36396
|
+
inputMeta = {},
|
|
36397
|
+
t,
|
|
36398
|
+
isHighlighted
|
|
36399
|
+
}) => {
|
|
36333
36400
|
const maxRule = rules.find(r => r.max);
|
|
36334
36401
|
const maxProps = {
|
|
36335
36402
|
maxLength: MAX_TEXT_AREA_LENGTH
|
|
@@ -36337,28 +36404,26 @@ const inputTypeComponent$1 = {
|
|
|
36337
36404
|
if (maxRule) {
|
|
36338
36405
|
maxProps.maxLength = maxRule.max;
|
|
36339
36406
|
}
|
|
36340
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input,
|
|
36341
|
-
size: "large"
|
|
36342
|
-
|
|
36407
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
36408
|
+
size: "large",
|
|
36409
|
+
...maxProps,
|
|
36343
36410
|
allowClear: true,
|
|
36344
36411
|
autoComplete: "new-password",
|
|
36345
|
-
type: "text"
|
|
36346
|
-
|
|
36412
|
+
type: "text",
|
|
36413
|
+
...props,
|
|
36347
36414
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36348
36415
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36349
36416
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
36350
|
-
})
|
|
36417
|
+
});
|
|
36351
36418
|
},
|
|
36352
|
-
link: (
|
|
36353
|
-
|
|
36354
|
-
|
|
36355
|
-
|
|
36356
|
-
|
|
36357
|
-
|
|
36358
|
-
|
|
36359
|
-
|
|
36360
|
-
isHighlighted
|
|
36361
|
-
} = _ref8;
|
|
36419
|
+
link: ({
|
|
36420
|
+
props,
|
|
36421
|
+
rules
|
|
36422
|
+
}, {
|
|
36423
|
+
inputMeta = {},
|
|
36424
|
+
t,
|
|
36425
|
+
isHighlighted
|
|
36426
|
+
}) => {
|
|
36362
36427
|
const maxRule = rules.find(r => r.max);
|
|
36363
36428
|
const maxProps = {
|
|
36364
36429
|
maxLength: MAX_TEXT_AREA_LENGTH
|
|
@@ -36366,32 +36431,29 @@ const inputTypeComponent$1 = {
|
|
|
36366
36431
|
if (maxRule) {
|
|
36367
36432
|
maxProps.maxLength = maxRule.max;
|
|
36368
36433
|
}
|
|
36369
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input,
|
|
36370
|
-
size: "large"
|
|
36371
|
-
|
|
36434
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
36435
|
+
size: "large",
|
|
36436
|
+
...maxProps,
|
|
36372
36437
|
allowClear: true,
|
|
36373
36438
|
autoComplete: "new-password",
|
|
36374
|
-
type: "text"
|
|
36375
|
-
|
|
36439
|
+
type: "text",
|
|
36440
|
+
...props,
|
|
36376
36441
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36377
36442
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36378
36443
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
36379
|
-
})
|
|
36444
|
+
});
|
|
36380
36445
|
},
|
|
36381
|
-
number: (
|
|
36382
|
-
|
|
36383
|
-
|
|
36384
|
-
|
|
36385
|
-
|
|
36386
|
-
|
|
36387
|
-
|
|
36388
|
-
|
|
36389
|
-
|
|
36390
|
-
t,
|
|
36391
|
-
isHighlighted
|
|
36392
|
-
} = _ref10;
|
|
36446
|
+
number: ({
|
|
36447
|
+
props,
|
|
36448
|
+
rules,
|
|
36449
|
+
input
|
|
36450
|
+
}, {
|
|
36451
|
+
inputMeta = {},
|
|
36452
|
+
t,
|
|
36453
|
+
isHighlighted
|
|
36454
|
+
}) => {
|
|
36393
36455
|
const maxRule = rules.find(r => r.max);
|
|
36394
|
-
const integerRule = !
|
|
36456
|
+
const integerRule = !input?.meta?.isDecimal;
|
|
36395
36457
|
const parser = value => {
|
|
36396
36458
|
if (!value) {
|
|
36397
36459
|
return "";
|
|
@@ -36402,63 +36464,60 @@ const inputTypeComponent$1 = {
|
|
|
36402
36464
|
return value.replace(/\$\s?|(,*)/g, "");
|
|
36403
36465
|
};
|
|
36404
36466
|
if (maxRule) {
|
|
36405
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber,
|
|
36467
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
36406
36468
|
size: "large",
|
|
36407
36469
|
allowClear: true,
|
|
36408
|
-
autoComplete: "new-password"
|
|
36409
|
-
|
|
36470
|
+
autoComplete: "new-password",
|
|
36471
|
+
...props,
|
|
36410
36472
|
type: "number",
|
|
36411
36473
|
parser: parser,
|
|
36412
36474
|
min: 0,
|
|
36413
36475
|
max: maxRule.max,
|
|
36414
36476
|
className: formatClassname([isHighlighted && "highlighted-input"])
|
|
36415
|
-
})
|
|
36477
|
+
});
|
|
36416
36478
|
}
|
|
36417
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber,
|
|
36479
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
36418
36480
|
size: "large",
|
|
36419
36481
|
allowClear: true,
|
|
36420
36482
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36421
|
-
autoComplete: "new-password"
|
|
36422
|
-
|
|
36483
|
+
autoComplete: "new-password",
|
|
36484
|
+
...props,
|
|
36423
36485
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36424
36486
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
|
|
36425
36487
|
min: 0,
|
|
36426
36488
|
formatter: value => numberWithCommas$1(value),
|
|
36427
36489
|
parser: parser
|
|
36428
|
-
})
|
|
36490
|
+
});
|
|
36429
36491
|
},
|
|
36430
36492
|
// eslint-disable-next-line no-unused-vars
|
|
36431
|
-
select: (
|
|
36432
|
-
|
|
36433
|
-
|
|
36434
|
-
|
|
36435
|
-
|
|
36436
|
-
|
|
36437
|
-
|
|
36438
|
-
|
|
36439
|
-
|
|
36440
|
-
|
|
36441
|
-
|
|
36442
|
-
|
|
36443
|
-
|
|
36444
|
-
|
|
36445
|
-
|
|
36446
|
-
|
|
36447
|
-
|
|
36448
|
-
|
|
36449
|
-
|
|
36450
|
-
|
|
36451
|
-
|
|
36452
|
-
|
|
36453
|
-
|
|
36454
|
-
|
|
36455
|
-
|
|
36456
|
-
|
|
36457
|
-
changeInputMeta,
|
|
36458
|
-
groupFormId
|
|
36459
|
-
} = _ref12;
|
|
36493
|
+
select: ({
|
|
36494
|
+
value,
|
|
36495
|
+
options,
|
|
36496
|
+
optionGroup,
|
|
36497
|
+
props,
|
|
36498
|
+
formsValue,
|
|
36499
|
+
optionsFilter,
|
|
36500
|
+
filterCond,
|
|
36501
|
+
repeatValues,
|
|
36502
|
+
repeatIndex,
|
|
36503
|
+
name,
|
|
36504
|
+
inputName,
|
|
36505
|
+
address,
|
|
36506
|
+
addressData,
|
|
36507
|
+
input,
|
|
36508
|
+
scope
|
|
36509
|
+
}, {
|
|
36510
|
+
forms,
|
|
36511
|
+
form,
|
|
36512
|
+
setAddress,
|
|
36513
|
+
inputMeta = {},
|
|
36514
|
+
t,
|
|
36515
|
+
isHighlighted,
|
|
36516
|
+
changeInputMeta,
|
|
36517
|
+
groupFormId
|
|
36518
|
+
}) => {
|
|
36460
36519
|
let opts;
|
|
36461
|
-
const isEvaluation = input
|
|
36520
|
+
const isEvaluation = input?.meta?.isEvaluation;
|
|
36462
36521
|
let defaultValue = value;
|
|
36463
36522
|
if (typeof options === "string") {
|
|
36464
36523
|
const [formName, key] = options.split(".");
|
|
@@ -36483,7 +36542,7 @@ const inputTypeComponent$1 = {
|
|
|
36483
36542
|
opts = [];
|
|
36484
36543
|
}
|
|
36485
36544
|
} else {
|
|
36486
|
-
opts = options
|
|
36545
|
+
opts = options?.filter(o => !o.onlyView);
|
|
36487
36546
|
}
|
|
36488
36547
|
opts = JSON.parse(JSON.stringify(opts || []));
|
|
36489
36548
|
opts = opts.map(o => getSelectOptions$2(o, formsValue));
|
|
@@ -36493,7 +36552,7 @@ const inputTypeComponent$1 = {
|
|
|
36493
36552
|
const uniqueDefaultKeys = getUniqueDefaultKeys(options);
|
|
36494
36553
|
|
|
36495
36554
|
// Handle default value logic
|
|
36496
|
-
if (!propHasValue$1(value) && propHasValue$1(input
|
|
36555
|
+
if (!propHasValue$1(value) && propHasValue$1(input?.meta?.defaultValue)) {
|
|
36497
36556
|
// If no current value but there's a default value, use the default
|
|
36498
36557
|
value = input.meta.defaultValue;
|
|
36499
36558
|
defaultValue = value;
|
|
@@ -36526,7 +36585,7 @@ const inputTypeComponent$1 = {
|
|
|
36526
36585
|
}
|
|
36527
36586
|
opts = groupOptions;
|
|
36528
36587
|
}
|
|
36529
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select,
|
|
36588
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
36530
36589
|
size: "large",
|
|
36531
36590
|
autoComplete: "new-password",
|
|
36532
36591
|
allowClear: true,
|
|
@@ -36535,32 +36594,35 @@ const inputTypeComponent$1 = {
|
|
|
36535
36594
|
value: value // Use value instead of defaultValue for controlled behavior
|
|
36536
36595
|
,
|
|
36537
36596
|
filterOption: filterSelectOptions,
|
|
36538
|
-
optionFilterProp: "children"
|
|
36539
|
-
|
|
36597
|
+
optionFilterProp: "children",
|
|
36598
|
+
...props,
|
|
36540
36599
|
className: formatClassname([isHighlighted && "highlighted-select"]),
|
|
36541
36600
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36542
36601
|
placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select one option"),
|
|
36543
36602
|
onChange: (val, selectedValue) => {
|
|
36544
36603
|
// ONLY FOR SBG EVALUATON !!
|
|
36545
36604
|
if (isEvaluation && val === "na" && groupFormId) {
|
|
36546
|
-
var _formsValue$meta2;
|
|
36547
36605
|
changeInputMeta({
|
|
36548
36606
|
key: groupFormId,
|
|
36549
|
-
value:
|
|
36607
|
+
value: {
|
|
36608
|
+
...(formsValue?.meta?.inputs?.[groupFormId] || {}),
|
|
36550
36609
|
documentation: {
|
|
36551
36610
|
notApplicable: true
|
|
36552
36611
|
}
|
|
36553
|
-
}
|
|
36612
|
+
},
|
|
36554
36613
|
otherValues: {
|
|
36555
|
-
[groupFormId]:
|
|
36614
|
+
[groupFormId]: {
|
|
36615
|
+
...(formsValue?.[groupFormId] || {}),
|
|
36556
36616
|
[name]: val
|
|
36557
|
-
}
|
|
36617
|
+
}
|
|
36558
36618
|
}
|
|
36559
36619
|
});
|
|
36560
36620
|
}
|
|
36561
36621
|
if (address && selectedValue) {
|
|
36562
36622
|
dot__default["default"].str(address, selectedValue.children, addressData);
|
|
36563
|
-
setAddress(
|
|
36623
|
+
setAddress({
|
|
36624
|
+
...addressData
|
|
36625
|
+
});
|
|
36564
36626
|
}
|
|
36565
36627
|
if (props.onChange) {
|
|
36566
36628
|
props.onChange(val);
|
|
@@ -36591,15 +36653,15 @@ const inputTypeComponent$1 = {
|
|
|
36591
36653
|
if (og.disabled !== undefined) {
|
|
36592
36654
|
groupOtherProps.disabled = og.disabled;
|
|
36593
36655
|
}
|
|
36594
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36595
|
-
value: og.value
|
|
36596
|
-
|
|
36656
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36657
|
+
value: og.value,
|
|
36658
|
+
...groupOtherProps,
|
|
36597
36659
|
children: og.label
|
|
36598
|
-
}
|
|
36660
|
+
}, `${i}${j}`);
|
|
36599
36661
|
})
|
|
36600
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36601
|
-
value: option.value
|
|
36602
|
-
|
|
36662
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36663
|
+
value: option.value,
|
|
36664
|
+
...otherProps,
|
|
36603
36665
|
children: isEvaluation ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
36604
36666
|
className: "flex",
|
|
36605
36667
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -36607,35 +36669,33 @@ const inputTypeComponent$1 = {
|
|
|
36607
36669
|
children: sgbEvaluationIcons[option.value]
|
|
36608
36670
|
}), option.label]
|
|
36609
36671
|
}) : option.label
|
|
36610
|
-
}
|
|
36672
|
+
}, option.value);
|
|
36611
36673
|
})
|
|
36612
|
-
})
|
|
36674
|
+
});
|
|
36613
36675
|
},
|
|
36614
|
-
multiselect: (
|
|
36615
|
-
|
|
36616
|
-
|
|
36617
|
-
|
|
36618
|
-
|
|
36619
|
-
|
|
36620
|
-
|
|
36621
|
-
|
|
36622
|
-
|
|
36623
|
-
|
|
36624
|
-
|
|
36625
|
-
|
|
36626
|
-
|
|
36627
|
-
|
|
36628
|
-
|
|
36629
|
-
|
|
36630
|
-
|
|
36631
|
-
|
|
36632
|
-
|
|
36633
|
-
|
|
36634
|
-
|
|
36635
|
-
|
|
36636
|
-
|
|
36637
|
-
isHighlighted
|
|
36638
|
-
} = _ref14;
|
|
36676
|
+
multiselect: ({
|
|
36677
|
+
value,
|
|
36678
|
+
options,
|
|
36679
|
+
optionGroup,
|
|
36680
|
+
optionsFilter,
|
|
36681
|
+
filterCond,
|
|
36682
|
+
props,
|
|
36683
|
+
formsValue,
|
|
36684
|
+
repeatValues,
|
|
36685
|
+
repeatIndex,
|
|
36686
|
+
inputName,
|
|
36687
|
+
name,
|
|
36688
|
+
tags,
|
|
36689
|
+
maxWidth,
|
|
36690
|
+
staticWidth,
|
|
36691
|
+
fullWidth
|
|
36692
|
+
}, {
|
|
36693
|
+
forms,
|
|
36694
|
+
form,
|
|
36695
|
+
inputMeta = {},
|
|
36696
|
+
t,
|
|
36697
|
+
isHighlighted
|
|
36698
|
+
}) => {
|
|
36639
36699
|
let opts;
|
|
36640
36700
|
if (typeof options === "string") {
|
|
36641
36701
|
const [formName, key] = options.split(".");
|
|
@@ -36697,17 +36757,17 @@ const inputTypeComponent$1 = {
|
|
|
36697
36757
|
staticWidth,
|
|
36698
36758
|
fullWidth
|
|
36699
36759
|
});
|
|
36700
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select,
|
|
36760
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
36701
36761
|
size: "medium",
|
|
36702
36762
|
allowClear: true,
|
|
36703
36763
|
autoComplete: "new-password",
|
|
36704
36764
|
mode: tags ? "tags" : "multiple",
|
|
36705
|
-
optionFilterProp: "children"
|
|
36706
|
-
|
|
36707
|
-
|
|
36708
|
-
|
|
36709
|
-
filterOption: filterSelectOptions
|
|
36710
|
-
|
|
36765
|
+
optionFilterProp: "children",
|
|
36766
|
+
...(tags ? {
|
|
36767
|
+
tokenSeparators: [","]
|
|
36768
|
+
} : {}),
|
|
36769
|
+
filterOption: filterSelectOptions,
|
|
36770
|
+
...props,
|
|
36711
36771
|
className: formatClassname([isHighlighted && "highlighted-select"]),
|
|
36712
36772
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36713
36773
|
placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select all relevant options"),
|
|
@@ -36746,52 +36806,51 @@ const inputTypeComponent$1 = {
|
|
|
36746
36806
|
if (og.disabled !== undefined) {
|
|
36747
36807
|
groupOtherProps.disabled = og.disabled;
|
|
36748
36808
|
}
|
|
36749
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36750
|
-
value: og.value
|
|
36751
|
-
|
|
36809
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36810
|
+
value: og.value,
|
|
36811
|
+
...groupOtherProps,
|
|
36752
36812
|
children: og.label
|
|
36753
|
-
}
|
|
36813
|
+
}, `${i}${j}`);
|
|
36754
36814
|
})
|
|
36755
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36756
|
-
value: option.value
|
|
36757
|
-
|
|
36815
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36816
|
+
value: option.value,
|
|
36817
|
+
...otherProps,
|
|
36758
36818
|
children: option.label
|
|
36759
|
-
}
|
|
36819
|
+
}, i);
|
|
36760
36820
|
})
|
|
36761
|
-
})
|
|
36821
|
+
});
|
|
36762
36822
|
},
|
|
36763
|
-
date: (
|
|
36764
|
-
|
|
36765
|
-
|
|
36766
|
-
|
|
36767
|
-
|
|
36768
|
-
|
|
36769
|
-
|
|
36770
|
-
|
|
36771
|
-
|
|
36772
|
-
|
|
36773
|
-
|
|
36774
|
-
|
|
36775
|
-
|
|
36776
|
-
|
|
36777
|
-
isHighlighted,
|
|
36778
|
-
groupFormId
|
|
36779
|
-
} = _ref16;
|
|
36823
|
+
date: ({
|
|
36824
|
+
props,
|
|
36825
|
+
rules,
|
|
36826
|
+
repeatValues,
|
|
36827
|
+
formsValue,
|
|
36828
|
+
name
|
|
36829
|
+
}, {
|
|
36830
|
+
setFormValues,
|
|
36831
|
+
inputMeta,
|
|
36832
|
+
form,
|
|
36833
|
+
t,
|
|
36834
|
+
isHighlighted,
|
|
36835
|
+
groupFormId
|
|
36836
|
+
}) => {
|
|
36780
36837
|
const lng = localStorage.getItem("datastakeLng") || "en";
|
|
36781
36838
|
const maxRule = rules.find(r => r.max);
|
|
36782
|
-
let value = groupFormId ? formsValue
|
|
36839
|
+
let value = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue[name];
|
|
36783
36840
|
const handleDateChange = date => {
|
|
36784
36841
|
if (date) {
|
|
36785
36842
|
// const localDate = dayjs.utc(date).add(dayjs(date).utcOffset(), 'minutes');
|
|
36786
36843
|
const localDate = dayjs__default["default"].utc(date);
|
|
36787
36844
|
if (groupFormId) {
|
|
36788
|
-
const _new =
|
|
36845
|
+
const _new = {
|
|
36846
|
+
...(formsValue[groupFormId] || {}),
|
|
36789
36847
|
[name]: localDate
|
|
36790
|
-
}
|
|
36848
|
+
};
|
|
36791
36849
|
form.setFieldValue(groupFormId, _new);
|
|
36792
|
-
setFormValues(
|
|
36850
|
+
setFormValues({
|
|
36851
|
+
...formsValue,
|
|
36793
36852
|
[groupFormId]: _new
|
|
36794
|
-
})
|
|
36853
|
+
});
|
|
36795
36854
|
} else {
|
|
36796
36855
|
form.setFieldValue(name, localDate);
|
|
36797
36856
|
}
|
|
@@ -36800,13 +36859,15 @@ const inputTypeComponent$1 = {
|
|
|
36800
36859
|
if (groupFormId) {
|
|
36801
36860
|
if (typeof value === "string" || typeof value === "undefined") {
|
|
36802
36861
|
value = typeof value === "string" ? dayjs__default["default"].utc(value) : null;
|
|
36803
|
-
const _new =
|
|
36862
|
+
const _new = {
|
|
36863
|
+
...(formsValue[groupFormId] || {}),
|
|
36804
36864
|
[name]: value
|
|
36805
|
-
}
|
|
36865
|
+
};
|
|
36806
36866
|
form.setFieldValue(groupFormId, _new);
|
|
36807
|
-
setFormValues(
|
|
36867
|
+
setFormValues({
|
|
36868
|
+
...formsValue,
|
|
36808
36869
|
[groupFormId]: _new
|
|
36809
|
-
})
|
|
36870
|
+
});
|
|
36810
36871
|
}
|
|
36811
36872
|
} else {
|
|
36812
36873
|
if (typeof value === "string") {
|
|
@@ -36822,13 +36883,12 @@ const inputTypeComponent$1 = {
|
|
|
36822
36883
|
checkForMax = checkCondition$1(maxRule.condition, repeatValues, formsValue);
|
|
36823
36884
|
}
|
|
36824
36885
|
if (checkForMax) {
|
|
36825
|
-
|
|
36826
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
|
|
36886
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
36827
36887
|
size: "large",
|
|
36828
36888
|
allowClear: true,
|
|
36829
|
-
autoComplete: "new-password"
|
|
36830
|
-
|
|
36831
|
-
value: value ? dayjs__default["default"](
|
|
36889
|
+
autoComplete: "new-password",
|
|
36890
|
+
...props,
|
|
36891
|
+
value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
|
|
36832
36892
|
onChange: handleDateChange,
|
|
36833
36893
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36834
36894
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
@@ -36838,54 +36898,49 @@ const inputTypeComponent$1 = {
|
|
|
36838
36898
|
disabledDate: current => {
|
|
36839
36899
|
return current && current >= dayjs__default["default"]().endOf("day");
|
|
36840
36900
|
}
|
|
36841
|
-
})
|
|
36901
|
+
});
|
|
36842
36902
|
}
|
|
36843
36903
|
}
|
|
36844
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker,
|
|
36904
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
36845
36905
|
size: "large",
|
|
36846
36906
|
allowClear: true,
|
|
36847
|
-
autoComplete: "new-password"
|
|
36848
|
-
|
|
36849
|
-
value: value ? dayjs__default["default"](
|
|
36907
|
+
autoComplete: "new-password",
|
|
36908
|
+
...props,
|
|
36909
|
+
value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
|
|
36850
36910
|
onChange: handleDateChange,
|
|
36851
36911
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36852
36912
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36853
36913
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder,
|
|
36854
36914
|
format: DATE_FORMATS,
|
|
36855
36915
|
locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"]
|
|
36856
|
-
})
|
|
36916
|
+
});
|
|
36857
36917
|
},
|
|
36858
|
-
groupExpandable: (
|
|
36859
|
-
|
|
36860
|
-
|
|
36861
|
-
|
|
36862
|
-
|
|
36863
|
-
|
|
36864
|
-
|
|
36865
|
-
|
|
36866
|
-
groupFormId
|
|
36867
|
-
} = _ref18;
|
|
36868
|
-
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];
|
|
36918
|
+
groupExpandable: ({
|
|
36919
|
+
formsValue,
|
|
36920
|
+
name,
|
|
36921
|
+
input
|
|
36922
|
+
}, {
|
|
36923
|
+
groupFormId
|
|
36924
|
+
}) => {
|
|
36925
|
+
const data = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue?.[name];
|
|
36869
36926
|
return /*#__PURE__*/jsxRuntime.jsx(GroupExpandable, {
|
|
36870
36927
|
input: input,
|
|
36871
36928
|
formsValue: formsValue,
|
|
36872
36929
|
data: data
|
|
36873
36930
|
});
|
|
36874
36931
|
},
|
|
36875
|
-
comment: (
|
|
36876
|
-
|
|
36877
|
-
|
|
36878
|
-
|
|
36879
|
-
|
|
36880
|
-
|
|
36881
|
-
|
|
36882
|
-
|
|
36883
|
-
|
|
36884
|
-
|
|
36885
|
-
|
|
36886
|
-
|
|
36887
|
-
} = _ref20;
|
|
36888
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
|
|
36932
|
+
comment: ({
|
|
36933
|
+
props: {
|
|
36934
|
+
placeholder,
|
|
36935
|
+
...props
|
|
36936
|
+
},
|
|
36937
|
+
commentHint
|
|
36938
|
+
}, {
|
|
36939
|
+
onChange,
|
|
36940
|
+
value,
|
|
36941
|
+
isHighlighted
|
|
36942
|
+
}) => {
|
|
36943
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
|
|
36889
36944
|
allowClear: true,
|
|
36890
36945
|
value: value,
|
|
36891
36946
|
onChange: e => onChange(e.target.value),
|
|
@@ -36896,27 +36951,26 @@ const inputTypeComponent$1 = {
|
|
|
36896
36951
|
autoSize: {
|
|
36897
36952
|
minRows: 5,
|
|
36898
36953
|
maxRows: 5
|
|
36899
|
-
}
|
|
36900
|
-
|
|
36954
|
+
},
|
|
36955
|
+
...props,
|
|
36901
36956
|
disabled: false
|
|
36902
|
-
})
|
|
36957
|
+
});
|
|
36903
36958
|
},
|
|
36904
|
-
tableComment: (
|
|
36905
|
-
|
|
36906
|
-
|
|
36907
|
-
|
|
36908
|
-
|
|
36909
|
-
|
|
36910
|
-
|
|
36911
|
-
|
|
36912
|
-
|
|
36913
|
-
|
|
36914
|
-
|
|
36915
|
-
|
|
36916
|
-
} = _ref22;
|
|
36917
|
-
const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => _objectSpread2(_objectSpread2({}, v), {}, {
|
|
36959
|
+
tableComment: ({
|
|
36960
|
+
setValues,
|
|
36961
|
+
name,
|
|
36962
|
+
onValuesChange,
|
|
36963
|
+
formsValue
|
|
36964
|
+
}, {
|
|
36965
|
+
form,
|
|
36966
|
+
groupFormId,
|
|
36967
|
+
isHighlighted
|
|
36968
|
+
}) => {
|
|
36969
|
+
const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => ({
|
|
36970
|
+
...v,
|
|
36918
36971
|
key: i
|
|
36919
|
-
})) : (formsValue[name] || []).map((v, i) =>
|
|
36972
|
+
})) : (formsValue[name] || []).map((v, i) => ({
|
|
36973
|
+
...v,
|
|
36920
36974
|
key: i
|
|
36921
36975
|
}));
|
|
36922
36976
|
const onUpdate = (val, i) => {
|
|
@@ -36924,89 +36978,121 @@ const inputTypeComponent$1 = {
|
|
|
36924
36978
|
[name]: formData.map((d, j) => i === j ? val : d)
|
|
36925
36979
|
};
|
|
36926
36980
|
if (groupFormId) {
|
|
36927
|
-
const _defaultData =
|
|
36928
|
-
const _newData =
|
|
36929
|
-
|
|
36981
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36982
|
+
const _newData = {
|
|
36983
|
+
..._defaultData,
|
|
36984
|
+
..._val
|
|
36985
|
+
};
|
|
36986
|
+
onValuesChange(_newData, {
|
|
36987
|
+
...formsValue,
|
|
36930
36988
|
[groupFormId]: _newData
|
|
36931
|
-
})
|
|
36932
|
-
form
|
|
36933
|
-
setValues(
|
|
36989
|
+
});
|
|
36990
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36991
|
+
setValues({
|
|
36992
|
+
...formsValue,
|
|
36934
36993
|
[groupFormId]: _newData
|
|
36935
|
-
})
|
|
36994
|
+
});
|
|
36936
36995
|
return;
|
|
36937
36996
|
}
|
|
36938
|
-
onValuesChange(_val,
|
|
36939
|
-
|
|
36940
|
-
|
|
36997
|
+
onValuesChange(_val, {
|
|
36998
|
+
...formsValue,
|
|
36999
|
+
..._val
|
|
37000
|
+
});
|
|
37001
|
+
form?.setFieldValue(name, _val[name]);
|
|
37002
|
+
setValues({
|
|
37003
|
+
...formsValue,
|
|
37004
|
+
..._val
|
|
37005
|
+
});
|
|
36941
37006
|
};
|
|
36942
37007
|
return /*#__PURE__*/jsxRuntime.jsx(Comment, {
|
|
36943
37008
|
onUpdate: onUpdate,
|
|
36944
37009
|
isHighlighted: isHighlighted,
|
|
36945
37010
|
form: form,
|
|
36946
|
-
values: groupFormId ?
|
|
37011
|
+
values: groupFormId ? {
|
|
37012
|
+
...(formsValue[groupFormId] || {}),
|
|
36947
37013
|
meta: {
|
|
36948
|
-
inputs: (
|
|
37014
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
36949
37015
|
}
|
|
36950
|
-
}
|
|
37016
|
+
} : formsValue,
|
|
36951
37017
|
name: name,
|
|
36952
|
-
remove:
|
|
36953
|
-
|
|
36954
|
-
|
|
36955
|
-
} = _ref23;
|
|
37018
|
+
remove: ({
|
|
37019
|
+
key
|
|
37020
|
+
}) => {
|
|
36956
37021
|
const _val = {
|
|
36957
37022
|
[name]: formData.filter(v => v.key !== key)
|
|
36958
37023
|
};
|
|
36959
37024
|
if (groupFormId) {
|
|
36960
|
-
const _defaultData =
|
|
36961
|
-
const _newData =
|
|
36962
|
-
|
|
37025
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
37026
|
+
const _newData = {
|
|
37027
|
+
..._defaultData,
|
|
37028
|
+
..._val
|
|
37029
|
+
};
|
|
37030
|
+
onValuesChange(_newData, {
|
|
37031
|
+
...formsValue,
|
|
36963
37032
|
[groupFormId]: _newData
|
|
36964
|
-
})
|
|
36965
|
-
form
|
|
36966
|
-
setValues(
|
|
37033
|
+
});
|
|
37034
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
37035
|
+
setValues({
|
|
37036
|
+
...formsValue,
|
|
36967
37037
|
[groupFormId]: _newData
|
|
36968
|
-
})
|
|
37038
|
+
});
|
|
36969
37039
|
return;
|
|
36970
37040
|
}
|
|
36971
|
-
onValuesChange(_val,
|
|
36972
|
-
|
|
36973
|
-
|
|
37041
|
+
onValuesChange(_val, {
|
|
37042
|
+
...formsValue,
|
|
37043
|
+
..._val
|
|
37044
|
+
});
|
|
37045
|
+
form?.setFieldValue(name, _val[name]);
|
|
37046
|
+
setValues({
|
|
37047
|
+
...formsValue,
|
|
37048
|
+
..._val
|
|
37049
|
+
});
|
|
36974
37050
|
},
|
|
36975
37051
|
add: val => {
|
|
36976
37052
|
const _val = {
|
|
36977
|
-
[name]: [...formData,
|
|
37053
|
+
[name]: [...formData, {
|
|
37054
|
+
...val,
|
|
36978
37055
|
key: formData.length
|
|
36979
|
-
}
|
|
37056
|
+
}]
|
|
36980
37057
|
};
|
|
36981
37058
|
if (groupFormId) {
|
|
36982
|
-
const _defaultData =
|
|
36983
|
-
const _newData =
|
|
36984
|
-
|
|
36985
|
-
|
|
37059
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
37060
|
+
const _newData = {
|
|
37061
|
+
..._defaultData,
|
|
37062
|
+
..._val
|
|
37063
|
+
};
|
|
37064
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
37065
|
+
onValuesChange(_newData, {
|
|
37066
|
+
...formsValue,
|
|
36986
37067
|
[groupFormId]: _newData
|
|
36987
|
-
})
|
|
36988
|
-
setValues(
|
|
37068
|
+
});
|
|
37069
|
+
setValues({
|
|
37070
|
+
...formsValue,
|
|
36989
37071
|
[groupFormId]: _newData
|
|
36990
|
-
})
|
|
37072
|
+
});
|
|
36991
37073
|
return;
|
|
36992
37074
|
}
|
|
36993
|
-
form
|
|
36994
|
-
onValuesChange(_val,
|
|
36995
|
-
|
|
37075
|
+
form?.setFieldValue(name, _val[name]);
|
|
37076
|
+
onValuesChange(_val, {
|
|
37077
|
+
...formsValue,
|
|
37078
|
+
..._val
|
|
37079
|
+
});
|
|
37080
|
+
setValues({
|
|
37081
|
+
...formsValue,
|
|
37082
|
+
..._val
|
|
37083
|
+
});
|
|
36996
37084
|
},
|
|
36997
37085
|
k: name
|
|
36998
37086
|
});
|
|
36999
37087
|
},
|
|
37000
|
-
textarea: (
|
|
37001
|
-
|
|
37002
|
-
|
|
37003
|
-
|
|
37004
|
-
|
|
37005
|
-
|
|
37006
|
-
|
|
37007
|
-
|
|
37008
|
-
isHighlighted
|
|
37009
|
-
} = _ref25;
|
|
37088
|
+
textarea: ({
|
|
37089
|
+
props,
|
|
37090
|
+
rules
|
|
37091
|
+
}, {
|
|
37092
|
+
inputMeta,
|
|
37093
|
+
t,
|
|
37094
|
+
isHighlighted
|
|
37095
|
+
}) => {
|
|
37010
37096
|
const maxRule = rules.find(r => r.max);
|
|
37011
37097
|
let maxLength = MAX_TEXT_AREA_LENGTH;
|
|
37012
37098
|
let rows = 5;
|
|
@@ -37033,7 +37119,7 @@ const inputTypeComponent$1 = {
|
|
|
37033
37119
|
// rows = 14;
|
|
37034
37120
|
// }
|
|
37035
37121
|
}
|
|
37036
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea,
|
|
37122
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
|
|
37037
37123
|
allowClear: true,
|
|
37038
37124
|
autoComplete: "new-password",
|
|
37039
37125
|
maxLength: maxLength,
|
|
@@ -37041,37 +37127,35 @@ const inputTypeComponent$1 = {
|
|
|
37041
37127
|
autoSize: {
|
|
37042
37128
|
minRows: rows,
|
|
37043
37129
|
maxRows: rows
|
|
37044
|
-
}
|
|
37045
|
-
|
|
37130
|
+
},
|
|
37131
|
+
...props,
|
|
37046
37132
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
37047
37133
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
37048
|
-
})
|
|
37134
|
+
});
|
|
37049
37135
|
},
|
|
37050
|
-
phoneNumber: (
|
|
37051
|
-
|
|
37052
|
-
|
|
37053
|
-
|
|
37054
|
-
|
|
37055
|
-
|
|
37056
|
-
|
|
37057
|
-
|
|
37058
|
-
|
|
37059
|
-
|
|
37060
|
-
|
|
37061
|
-
|
|
37062
|
-
|
|
37063
|
-
|
|
37064
|
-
|
|
37065
|
-
} = _ref27;
|
|
37066
|
-
return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, _objectSpread2(_objectSpread2({
|
|
37136
|
+
phoneNumber: ({
|
|
37137
|
+
name,
|
|
37138
|
+
inputName,
|
|
37139
|
+
props,
|
|
37140
|
+
value,
|
|
37141
|
+
repeatIndex,
|
|
37142
|
+
repeatValues,
|
|
37143
|
+
formsValue
|
|
37144
|
+
}, {
|
|
37145
|
+
setFormValues,
|
|
37146
|
+
inputMeta,
|
|
37147
|
+
t,
|
|
37148
|
+
isHighlighted
|
|
37149
|
+
}) => {
|
|
37150
|
+
return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, {
|
|
37067
37151
|
customSelectWidthPercentage: "20%",
|
|
37068
37152
|
t: t,
|
|
37069
37153
|
size: "large",
|
|
37070
37154
|
allowClear: true,
|
|
37071
|
-
country: formsValue
|
|
37155
|
+
country: formsValue?.country,
|
|
37072
37156
|
initialValue: value,
|
|
37073
|
-
name: name
|
|
37074
|
-
|
|
37157
|
+
name: name,
|
|
37158
|
+
...props,
|
|
37075
37159
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37076
37160
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
37077
37161
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type Number"),
|
|
@@ -37092,27 +37176,26 @@ const inputTypeComponent$1 = {
|
|
|
37092
37176
|
}
|
|
37093
37177
|
return val;
|
|
37094
37178
|
}
|
|
37095
|
-
})
|
|
37179
|
+
});
|
|
37096
37180
|
},
|
|
37097
|
-
switch: (
|
|
37098
|
-
|
|
37099
|
-
|
|
37100
|
-
|
|
37101
|
-
|
|
37102
|
-
|
|
37103
|
-
|
|
37104
|
-
|
|
37105
|
-
|
|
37106
|
-
|
|
37107
|
-
|
|
37108
|
-
|
|
37109
|
-
|
|
37110
|
-
|
|
37111
|
-
|
|
37112
|
-
|
|
37113
|
-
|
|
37114
|
-
|
|
37115
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
37181
|
+
switch: ({
|
|
37182
|
+
props,
|
|
37183
|
+
value,
|
|
37184
|
+
restricted,
|
|
37185
|
+
autocomplete,
|
|
37186
|
+
formsValue,
|
|
37187
|
+
repeatValues,
|
|
37188
|
+
repeatIndex,
|
|
37189
|
+
name,
|
|
37190
|
+
inputName,
|
|
37191
|
+
replace: replaceInput,
|
|
37192
|
+
unique
|
|
37193
|
+
}, {
|
|
37194
|
+
form,
|
|
37195
|
+
isHighlighted
|
|
37196
|
+
}) => {
|
|
37197
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, {
|
|
37198
|
+
...props,
|
|
37116
37199
|
size: "default",
|
|
37117
37200
|
defaultChecked: value || false,
|
|
37118
37201
|
checked: value || false,
|
|
@@ -37140,7 +37223,9 @@ const inputTypeComponent$1 = {
|
|
|
37140
37223
|
const [formName, replaceInputName] = replaceTo.split(".");
|
|
37141
37224
|
const replaceRepeatValues = replaceInputName ? dot__default["default"].pick(formName, formsValue) : undefined;
|
|
37142
37225
|
updateFormValues$1(undefined, replaceRepeatValues, replaceInputName, isChecked ? newId : undefined, formsValue, formName, form);
|
|
37143
|
-
formsValue = Object.assign(formsValue,
|
|
37226
|
+
formsValue = Object.assign(formsValue, {
|
|
37227
|
+
...form.getFieldsValue(true)
|
|
37228
|
+
});
|
|
37144
37229
|
if (oldId) {
|
|
37145
37230
|
const allRepeatValues = dot__default["default"].pick(name, formsValue);
|
|
37146
37231
|
if (allRepeatValues && Array.isArray(allRepeatValues)) {
|
|
@@ -37181,22 +37266,20 @@ const inputTypeComponent$1 = {
|
|
|
37181
37266
|
}
|
|
37182
37267
|
}
|
|
37183
37268
|
}
|
|
37184
|
-
})
|
|
37269
|
+
});
|
|
37185
37270
|
},
|
|
37186
|
-
radioGroup: (
|
|
37187
|
-
|
|
37188
|
-
|
|
37189
|
-
|
|
37190
|
-
|
|
37191
|
-
|
|
37192
|
-
|
|
37193
|
-
|
|
37194
|
-
isHighlighted
|
|
37195
|
-
} = _ref31;
|
|
37271
|
+
radioGroup: ({
|
|
37272
|
+
props,
|
|
37273
|
+
value,
|
|
37274
|
+
options,
|
|
37275
|
+
isRisk
|
|
37276
|
+
}, {
|
|
37277
|
+
isHighlighted
|
|
37278
|
+
}) => {
|
|
37196
37279
|
if (isRisk) {
|
|
37197
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group,
|
|
37198
|
-
value: value
|
|
37199
|
-
|
|
37280
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
|
|
37281
|
+
value: value,
|
|
37282
|
+
...props,
|
|
37200
37283
|
className: "is-risk-radio",
|
|
37201
37284
|
children: (options || []).map(o => {
|
|
37202
37285
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
|
|
@@ -37210,11 +37293,11 @@ const inputTypeComponent$1 = {
|
|
|
37210
37293
|
}) : null]
|
|
37211
37294
|
}, o.value);
|
|
37212
37295
|
})
|
|
37213
|
-
})
|
|
37296
|
+
});
|
|
37214
37297
|
}
|
|
37215
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group,
|
|
37216
|
-
value: value
|
|
37217
|
-
|
|
37298
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
|
|
37299
|
+
value: value,
|
|
37300
|
+
...props,
|
|
37218
37301
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37219
37302
|
children: (options || []).map(o => {
|
|
37220
37303
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
|
|
@@ -37228,20 +37311,18 @@ const inputTypeComponent$1 = {
|
|
|
37228
37311
|
}) : null]
|
|
37229
37312
|
}, o.value);
|
|
37230
37313
|
})
|
|
37231
|
-
})
|
|
37314
|
+
});
|
|
37232
37315
|
},
|
|
37233
|
-
checkboxGroup: (
|
|
37234
|
-
|
|
37235
|
-
|
|
37236
|
-
|
|
37237
|
-
|
|
37238
|
-
|
|
37239
|
-
|
|
37240
|
-
|
|
37241
|
-
|
|
37242
|
-
|
|
37243
|
-
value: value
|
|
37244
|
-
}, props), {}, {
|
|
37316
|
+
checkboxGroup: ({
|
|
37317
|
+
props,
|
|
37318
|
+
value,
|
|
37319
|
+
options
|
|
37320
|
+
}, {
|
|
37321
|
+
isHighlighted
|
|
37322
|
+
}) => {
|
|
37323
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, {
|
|
37324
|
+
value: value,
|
|
37325
|
+
...props,
|
|
37245
37326
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37246
37327
|
style: {
|
|
37247
37328
|
display: "grid",
|
|
@@ -37265,18 +37346,16 @@ const inputTypeComponent$1 = {
|
|
|
37265
37346
|
}) : null]
|
|
37266
37347
|
}, o.value);
|
|
37267
37348
|
})
|
|
37268
|
-
})
|
|
37349
|
+
});
|
|
37269
37350
|
},
|
|
37270
|
-
total100: (
|
|
37271
|
-
|
|
37272
|
-
|
|
37273
|
-
|
|
37274
|
-
|
|
37275
|
-
|
|
37276
|
-
|
|
37277
|
-
|
|
37278
|
-
isHighlighted
|
|
37279
|
-
} = _ref35;
|
|
37351
|
+
total100: ({
|
|
37352
|
+
props,
|
|
37353
|
+
name,
|
|
37354
|
+
options,
|
|
37355
|
+
value
|
|
37356
|
+
}, {
|
|
37357
|
+
isHighlighted
|
|
37358
|
+
}) => {
|
|
37280
37359
|
value = value ? Array.isArray(value) ? value : [value] : [];
|
|
37281
37360
|
function totalValue() {
|
|
37282
37361
|
let total = 0;
|
|
@@ -37300,11 +37379,10 @@ const inputTypeComponent$1 = {
|
|
|
37300
37379
|
className: formatClassname(["total100", isHighlighted && "highlighted-input"]),
|
|
37301
37380
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
|
|
37302
37381
|
name: name,
|
|
37303
|
-
children: (fields,
|
|
37304
|
-
|
|
37305
|
-
|
|
37306
|
-
|
|
37307
|
-
} = _ref36;
|
|
37382
|
+
children: (fields, {
|
|
37383
|
+
add,
|
|
37384
|
+
remove
|
|
37385
|
+
}) => {
|
|
37308
37386
|
if (fields.length === 0) {
|
|
37309
37387
|
const formData = value || [];
|
|
37310
37388
|
if (formData.length) {
|
|
@@ -37323,27 +37401,27 @@ const inputTypeComponent$1 = {
|
|
|
37323
37401
|
const v = value[field.name] || {};
|
|
37324
37402
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Space, {
|
|
37325
37403
|
className: "total",
|
|
37326
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item,
|
|
37327
|
-
noStyle: true
|
|
37328
|
-
|
|
37404
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
37405
|
+
noStyle: true,
|
|
37406
|
+
...field,
|
|
37329
37407
|
name: [field.name, "type"],
|
|
37330
37408
|
fieldKey: [field.fieldKey, "type"],
|
|
37331
37409
|
initialValue: v.type || null,
|
|
37332
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select,
|
|
37410
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
37333
37411
|
size: "large",
|
|
37334
37412
|
allowClear: true,
|
|
37335
37413
|
showSearch: true,
|
|
37336
37414
|
filterOption: filterSelectOptions,
|
|
37337
|
-
optionFilterProp: "children"
|
|
37338
|
-
|
|
37415
|
+
optionFilterProp: "children",
|
|
37416
|
+
...props,
|
|
37339
37417
|
children: options.map((option, i) => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
37340
37418
|
value: option.value,
|
|
37341
37419
|
children: option.label
|
|
37342
37420
|
}, i))
|
|
37343
|
-
})
|
|
37344
|
-
})
|
|
37345
|
-
noStyle: true
|
|
37346
|
-
|
|
37421
|
+
})
|
|
37422
|
+
}), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
37423
|
+
noStyle: true,
|
|
37424
|
+
...field,
|
|
37347
37425
|
name: [field.name, "value"],
|
|
37348
37426
|
fieldKey: [field.fieldKey, "value"],
|
|
37349
37427
|
initialValue: v.value,
|
|
@@ -37352,14 +37430,14 @@ const inputTypeComponent$1 = {
|
|
|
37352
37430
|
allowClear: true,
|
|
37353
37431
|
name: "value",
|
|
37354
37432
|
formatter: value => {
|
|
37355
|
-
return value ?
|
|
37433
|
+
return value ? `${value}%` : "";
|
|
37356
37434
|
},
|
|
37357
37435
|
disabled: !v.type || null,
|
|
37358
37436
|
placeholder: props.valueplaceholder ? props.valueplaceholder : "Value",
|
|
37359
37437
|
min: 1,
|
|
37360
37438
|
max: 100 - siblingTotal(v.type || 0)
|
|
37361
37439
|
})
|
|
37362
|
-
})
|
|
37440
|
+
}), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
37363
37441
|
disabled: !v.value || !v.type || totalValue() >= 100,
|
|
37364
37442
|
type: "primary",
|
|
37365
37443
|
icon: /*#__PURE__*/jsxRuntime.jsx(Icons.PlusOutlined, {}),
|
|
@@ -37391,22 +37469,19 @@ const inputTypeComponent$1 = {
|
|
|
37391
37469
|
}) : null]
|
|
37392
37470
|
});
|
|
37393
37471
|
},
|
|
37394
|
-
percentage: (
|
|
37395
|
-
|
|
37396
|
-
|
|
37397
|
-
|
|
37398
|
-
|
|
37399
|
-
|
|
37400
|
-
|
|
37401
|
-
|
|
37402
|
-
|
|
37403
|
-
|
|
37404
|
-
|
|
37405
|
-
|
|
37406
|
-
|
|
37407
|
-
t,
|
|
37408
|
-
isHighlighted
|
|
37409
|
-
} = _ref38;
|
|
37472
|
+
percentage: ({
|
|
37473
|
+
name,
|
|
37474
|
+
inputName,
|
|
37475
|
+
totalMax,
|
|
37476
|
+
repeatIndex,
|
|
37477
|
+
props,
|
|
37478
|
+
formsValue,
|
|
37479
|
+
input
|
|
37480
|
+
}, {
|
|
37481
|
+
inputMeta,
|
|
37482
|
+
t,
|
|
37483
|
+
isHighlighted
|
|
37484
|
+
}) => {
|
|
37410
37485
|
const isRepeatable = Array.isArray(formsValue[name]);
|
|
37411
37486
|
let totalSiblings = 0;
|
|
37412
37487
|
if (isRepeatable && totalMax) {
|
|
@@ -37414,47 +37489,45 @@ const inputTypeComponent$1 = {
|
|
|
37414
37489
|
totl = totl + (grp[inputName] || 0);
|
|
37415
37490
|
return totl;
|
|
37416
37491
|
}, 0);
|
|
37417
|
-
} else if (Array.isArray(input
|
|
37492
|
+
} else if (Array.isArray(input?.meta?.siblings)) {
|
|
37418
37493
|
totalSiblings = input.meta.siblings.reduce((totl, key) => {
|
|
37419
37494
|
totl = totl + (formsValue[key] || 0);
|
|
37420
37495
|
return totl;
|
|
37421
37496
|
}, 0);
|
|
37422
37497
|
}
|
|
37423
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber,
|
|
37498
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
37424
37499
|
size: "large",
|
|
37425
|
-
allowClear: true
|
|
37426
|
-
|
|
37500
|
+
allowClear: true,
|
|
37501
|
+
...props,
|
|
37427
37502
|
className: formatClassname([isHighlighted && "highlighted-cont"]),
|
|
37428
37503
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
37429
37504
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
|
|
37430
37505
|
min: 0,
|
|
37431
37506
|
max: 100 - totalSiblings,
|
|
37432
37507
|
formatter: value => {
|
|
37433
|
-
return value ?
|
|
37508
|
+
return value ? `${value}` : "";
|
|
37434
37509
|
},
|
|
37435
37510
|
parser: value => value.replace("%", ""),
|
|
37436
37511
|
addonAfter: "%"
|
|
37437
|
-
})
|
|
37512
|
+
});
|
|
37438
37513
|
},
|
|
37439
|
-
drawTerritory: (
|
|
37440
|
-
|
|
37441
|
-
|
|
37442
|
-
|
|
37443
|
-
|
|
37444
|
-
|
|
37445
|
-
|
|
37446
|
-
setFormValues
|
|
37447
|
-
} = _ref40;
|
|
37514
|
+
drawTerritory: ({
|
|
37515
|
+
formsValue,
|
|
37516
|
+
name,
|
|
37517
|
+
addressData
|
|
37518
|
+
}, {
|
|
37519
|
+
setFormValues
|
|
37520
|
+
}) => {
|
|
37448
37521
|
let search = formsValue.country;
|
|
37449
37522
|
if (addressData && addressData.address && Object.keys(addressData.address).length > 0) {
|
|
37450
37523
|
if (addressData.address.country) {
|
|
37451
37524
|
search = addressData.address.country;
|
|
37452
37525
|
}
|
|
37453
37526
|
if (addressData.address.level1) {
|
|
37454
|
-
search =
|
|
37527
|
+
search = `${addressData.address.level1}, ${addressData.address.country}`;
|
|
37455
37528
|
}
|
|
37456
37529
|
if (addressData.address.level2) {
|
|
37457
|
-
search =
|
|
37530
|
+
search = `${addressData.address.level2}, ${addressData.address.level1}, ${addressData.address.country}`;
|
|
37458
37531
|
}
|
|
37459
37532
|
} else {
|
|
37460
37533
|
const country = countriesList.countries[formsValue.country] || {};
|
|
@@ -37462,10 +37535,10 @@ const inputTypeComponent$1 = {
|
|
|
37462
37535
|
search = country.name;
|
|
37463
37536
|
}
|
|
37464
37537
|
if (formsValue.administrativeLevel1Name) {
|
|
37465
|
-
search =
|
|
37538
|
+
search = `${search} ${formsValue.administrativeLevel1Name}`;
|
|
37466
37539
|
}
|
|
37467
37540
|
if (formsValue.administrativeLevel2Name) {
|
|
37468
|
-
search =
|
|
37541
|
+
search = `${search} ${formsValue.administrativeLevel2Name}`;
|
|
37469
37542
|
}
|
|
37470
37543
|
}
|
|
37471
37544
|
return /*#__PURE__*/jsxRuntime.jsx(PolygonSelector, {
|
|
@@ -37477,36 +37550,32 @@ const inputTypeComponent$1 = {
|
|
|
37477
37550
|
searchValue: search
|
|
37478
37551
|
});
|
|
37479
37552
|
},
|
|
37480
|
-
year: (
|
|
37481
|
-
|
|
37482
|
-
|
|
37483
|
-
|
|
37484
|
-
|
|
37485
|
-
isHighlighted
|
|
37486
|
-
} = _ref42;
|
|
37553
|
+
year: ({
|
|
37554
|
+
props
|
|
37555
|
+
}, {
|
|
37556
|
+
isHighlighted
|
|
37557
|
+
}) => {
|
|
37487
37558
|
const lng = localStorage.getItem("datastakeLng") || "en";
|
|
37488
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker,
|
|
37559
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
37489
37560
|
size: "large",
|
|
37490
37561
|
allowClear: true,
|
|
37491
37562
|
locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
|
|
37492
|
-
picker: "year"
|
|
37493
|
-
|
|
37563
|
+
picker: "year",
|
|
37564
|
+
...props,
|
|
37494
37565
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37495
37566
|
format: "YYYY"
|
|
37496
|
-
})
|
|
37567
|
+
});
|
|
37497
37568
|
},
|
|
37498
|
-
upload: (
|
|
37499
|
-
|
|
37500
|
-
|
|
37501
|
-
|
|
37502
|
-
|
|
37503
|
-
|
|
37504
|
-
|
|
37505
|
-
|
|
37506
|
-
|
|
37507
|
-
|
|
37508
|
-
isHighlighted
|
|
37509
|
-
} = _ref44;
|
|
37569
|
+
upload: ({
|
|
37570
|
+
rules,
|
|
37571
|
+
value
|
|
37572
|
+
}, {
|
|
37573
|
+
setLoading = () => {},
|
|
37574
|
+
getApiBaseUrl,
|
|
37575
|
+
getAppHeader,
|
|
37576
|
+
t,
|
|
37577
|
+
isHighlighted
|
|
37578
|
+
}) => {
|
|
37510
37579
|
const apiURL = getApiBaseUrl();
|
|
37511
37580
|
const accept = rules.length ? rules.find(rule => Object.keys(rule).includes("accept")).accept || "*" : null;
|
|
37512
37581
|
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) : []) || [];
|
|
@@ -37519,12 +37588,13 @@ const inputTypeComponent$1 = {
|
|
|
37519
37588
|
maxProps.multiple = true;
|
|
37520
37589
|
}
|
|
37521
37590
|
}
|
|
37522
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload,
|
|
37591
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37592
|
+
...maxProps,
|
|
37523
37593
|
accept: accept,
|
|
37524
|
-
action:
|
|
37594
|
+
action: `${apiURL}/upload`,
|
|
37525
37595
|
beforeUpload: beforeUpload(allowedExtensions),
|
|
37526
37596
|
onChange: val => {
|
|
37527
|
-
if (val
|
|
37597
|
+
if (val?.file && typeof setLoading === "function") {
|
|
37528
37598
|
if (val.file.percent !== 100) {
|
|
37529
37599
|
setLoading(true);
|
|
37530
37600
|
} else {
|
|
@@ -37532,9 +37602,10 @@ const inputTypeComponent$1 = {
|
|
|
37532
37602
|
}
|
|
37533
37603
|
}
|
|
37534
37604
|
},
|
|
37535
|
-
headers:
|
|
37536
|
-
Authorization:
|
|
37537
|
-
|
|
37605
|
+
headers: {
|
|
37606
|
+
Authorization: `Bearer ${getToken()}`,
|
|
37607
|
+
...getAppHeader()
|
|
37608
|
+
},
|
|
37538
37609
|
defaultFileList: values,
|
|
37539
37610
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
37540
37611
|
style: {
|
|
@@ -37545,20 +37616,18 @@ const inputTypeComponent$1 = {
|
|
|
37545
37616
|
children: t("Upload")
|
|
37546
37617
|
})]
|
|
37547
37618
|
})
|
|
37548
|
-
})
|
|
37619
|
+
});
|
|
37549
37620
|
},
|
|
37550
|
-
imageUpload: (
|
|
37551
|
-
|
|
37552
|
-
|
|
37553
|
-
|
|
37554
|
-
|
|
37555
|
-
|
|
37556
|
-
|
|
37557
|
-
|
|
37558
|
-
|
|
37559
|
-
|
|
37560
|
-
isHighlighted
|
|
37561
|
-
} = _ref46;
|
|
37621
|
+
imageUpload: ({
|
|
37622
|
+
rules,
|
|
37623
|
+
value
|
|
37624
|
+
}, {
|
|
37625
|
+
setLoading = () => {},
|
|
37626
|
+
getApiBaseUrl,
|
|
37627
|
+
getAppHeader,
|
|
37628
|
+
t,
|
|
37629
|
+
isHighlighted
|
|
37630
|
+
}) => {
|
|
37562
37631
|
const apiURL = getApiBaseUrl();
|
|
37563
37632
|
const values = getImageUploadEditValue(value);
|
|
37564
37633
|
const maxRule = rules.find(r => r.max);
|
|
@@ -37569,18 +37638,17 @@ const inputTypeComponent$1 = {
|
|
|
37569
37638
|
maxProps.multiple = true;
|
|
37570
37639
|
}
|
|
37571
37640
|
}
|
|
37572
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload,
|
|
37573
|
-
beforeUpload: beforeUpload(allowedImageExtensions)
|
|
37574
|
-
|
|
37641
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37642
|
+
beforeUpload: beforeUpload(allowedImageExtensions),
|
|
37643
|
+
...maxProps,
|
|
37575
37644
|
accept: "image/*",
|
|
37576
37645
|
classList: !values || !values.length ? "empty" : "",
|
|
37577
37646
|
listType: "picture",
|
|
37578
|
-
action:
|
|
37647
|
+
action: `${apiURL}/upload`,
|
|
37579
37648
|
onChange: val => {
|
|
37580
37649
|
if (typeof setLoading === "function") {
|
|
37581
|
-
if (val
|
|
37582
|
-
|
|
37583
|
-
if ((val === null || val === void 0 || (_val$file = val.file) === null || _val$file === void 0 ? void 0 : _val$file.status) === "removed") {
|
|
37650
|
+
if (val?.file) {
|
|
37651
|
+
if (val?.file?.status === "removed") {
|
|
37584
37652
|
setLoading(false);
|
|
37585
37653
|
return;
|
|
37586
37654
|
}
|
|
@@ -37592,9 +37660,10 @@ const inputTypeComponent$1 = {
|
|
|
37592
37660
|
setLoading(false);
|
|
37593
37661
|
}
|
|
37594
37662
|
},
|
|
37595
|
-
headers:
|
|
37596
|
-
Authorization:
|
|
37597
|
-
|
|
37663
|
+
headers: {
|
|
37664
|
+
Authorization: `Bearer ${getToken()}`,
|
|
37665
|
+
...getAppHeader()
|
|
37666
|
+
},
|
|
37598
37667
|
defaultFileList: values,
|
|
37599
37668
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
37600
37669
|
style: {
|
|
@@ -37605,20 +37674,18 @@ const inputTypeComponent$1 = {
|
|
|
37605
37674
|
children: t("Upload")
|
|
37606
37675
|
})]
|
|
37607
37676
|
})
|
|
37608
|
-
})
|
|
37677
|
+
});
|
|
37609
37678
|
},
|
|
37610
|
-
videoUpload: (
|
|
37611
|
-
|
|
37612
|
-
|
|
37613
|
-
|
|
37614
|
-
|
|
37615
|
-
|
|
37616
|
-
|
|
37617
|
-
|
|
37618
|
-
|
|
37619
|
-
|
|
37620
|
-
isHighlighted
|
|
37621
|
-
} = _ref48;
|
|
37679
|
+
videoUpload: ({
|
|
37680
|
+
rules,
|
|
37681
|
+
value
|
|
37682
|
+
}, {
|
|
37683
|
+
setLoading = () => {},
|
|
37684
|
+
getApiBaseUrl,
|
|
37685
|
+
getAppHeader,
|
|
37686
|
+
t,
|
|
37687
|
+
isHighlighted
|
|
37688
|
+
}) => {
|
|
37622
37689
|
const apiURL = getApiBaseUrl();
|
|
37623
37690
|
const values = getImageUploadEditValue(value);
|
|
37624
37691
|
const maxRule = rules.find(r => r.max);
|
|
@@ -37629,25 +37696,21 @@ const inputTypeComponent$1 = {
|
|
|
37629
37696
|
maxProps.multiple = true;
|
|
37630
37697
|
}
|
|
37631
37698
|
}
|
|
37632
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload,
|
|
37633
|
-
itemRender: (item, fileList) => {
|
|
37634
|
-
|
|
37635
|
-
|
|
37636
|
-
|
|
37637
|
-
|
|
37638
|
-
|
|
37639
|
-
});
|
|
37640
|
-
}
|
|
37641
|
-
}, maxProps), {}, {
|
|
37699
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37700
|
+
itemRender: (item, fileList) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
37701
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
|
|
37702
|
+
url: fileList?.response?.url || fileList?.url
|
|
37703
|
+
}), item]
|
|
37704
|
+
}),
|
|
37705
|
+
...maxProps,
|
|
37642
37706
|
accept: "video/*",
|
|
37643
37707
|
classList: !values || !values.length ? "empty" : "",
|
|
37644
37708
|
listType: "picture",
|
|
37645
|
-
action:
|
|
37709
|
+
action: `${apiURL}/upload`,
|
|
37646
37710
|
onChange: val => {
|
|
37647
37711
|
if (typeof setLoading === "function") {
|
|
37648
|
-
if (val
|
|
37649
|
-
|
|
37650
|
-
if ((val === null || val === void 0 || (_val$file2 = val.file) === null || _val$file2 === void 0 ? void 0 : _val$file2.status) === "removed") {
|
|
37712
|
+
if (val?.file) {
|
|
37713
|
+
if (val?.file?.status === "removed") {
|
|
37651
37714
|
setLoading(false);
|
|
37652
37715
|
return;
|
|
37653
37716
|
}
|
|
@@ -37659,9 +37722,10 @@ const inputTypeComponent$1 = {
|
|
|
37659
37722
|
setLoading(false);
|
|
37660
37723
|
}
|
|
37661
37724
|
},
|
|
37662
|
-
headers:
|
|
37663
|
-
Authorization:
|
|
37664
|
-
|
|
37725
|
+
headers: {
|
|
37726
|
+
Authorization: `Bearer ${getToken()}`,
|
|
37727
|
+
...getAppHeader()
|
|
37728
|
+
},
|
|
37665
37729
|
fileList: values,
|
|
37666
37730
|
defaultFileList: values,
|
|
37667
37731
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
@@ -37673,30 +37737,28 @@ const inputTypeComponent$1 = {
|
|
|
37673
37737
|
children: t("Upload")
|
|
37674
37738
|
})]
|
|
37675
37739
|
})
|
|
37676
|
-
})
|
|
37740
|
+
});
|
|
37677
37741
|
},
|
|
37678
|
-
geolocation: (
|
|
37679
|
-
|
|
37680
|
-
|
|
37681
|
-
|
|
37682
|
-
|
|
37683
|
-
|
|
37684
|
-
|
|
37685
|
-
|
|
37686
|
-
|
|
37687
|
-
|
|
37688
|
-
isHighlighted
|
|
37689
|
-
} = _ref50;
|
|
37742
|
+
geolocation: ({
|
|
37743
|
+
value,
|
|
37744
|
+
name,
|
|
37745
|
+
props,
|
|
37746
|
+
formsValue,
|
|
37747
|
+
addressData
|
|
37748
|
+
}, {
|
|
37749
|
+
inputMeta,
|
|
37750
|
+
isHighlighted
|
|
37751
|
+
}) => {
|
|
37690
37752
|
let search = formsValue.country;
|
|
37691
37753
|
if (addressData && Object.keys(addressData).length > 0) {
|
|
37692
37754
|
if (addressData.country) {
|
|
37693
37755
|
search = addressData.country;
|
|
37694
37756
|
}
|
|
37695
37757
|
if (addressData.level1) {
|
|
37696
|
-
search =
|
|
37758
|
+
search = `${addressData.level1}, ${addressData.country}`;
|
|
37697
37759
|
}
|
|
37698
37760
|
if (addressData.level2) {
|
|
37699
|
-
search =
|
|
37761
|
+
search = `${addressData.level2}, ${addressData.level1}, ${addressData.country}`;
|
|
37700
37762
|
}
|
|
37701
37763
|
} else {
|
|
37702
37764
|
const country = countriesList.countries[formsValue.country] || {};
|
|
@@ -37704,10 +37766,10 @@ const inputTypeComponent$1 = {
|
|
|
37704
37766
|
search = country.name;
|
|
37705
37767
|
}
|
|
37706
37768
|
if (formsValue.administrativeLevel1Name) {
|
|
37707
|
-
search =
|
|
37769
|
+
search = `${search} ${formsValue.administrativeLevel1Name}`;
|
|
37708
37770
|
}
|
|
37709
37771
|
if (formsValue.administrativeLevel2Name) {
|
|
37710
|
-
search =
|
|
37772
|
+
search = `${search} ${formsValue.administrativeLevel2Name}`;
|
|
37711
37773
|
}
|
|
37712
37774
|
}
|
|
37713
37775
|
return /*#__PURE__*/jsxRuntime.jsx(Geolocation, {
|
|
@@ -37721,36 +37783,34 @@ const inputTypeComponent$1 = {
|
|
|
37721
37783
|
searchValue: search
|
|
37722
37784
|
});
|
|
37723
37785
|
},
|
|
37724
|
-
ajaxSelect: (
|
|
37725
|
-
|
|
37726
|
-
|
|
37727
|
-
|
|
37728
|
-
|
|
37729
|
-
|
|
37730
|
-
|
|
37731
|
-
|
|
37732
|
-
|
|
37733
|
-
|
|
37734
|
-
|
|
37735
|
-
|
|
37736
|
-
|
|
37737
|
-
|
|
37738
|
-
|
|
37739
|
-
|
|
37740
|
-
|
|
37741
|
-
|
|
37742
|
-
|
|
37743
|
-
|
|
37744
|
-
|
|
37745
|
-
|
|
37746
|
-
|
|
37747
|
-
|
|
37748
|
-
|
|
37749
|
-
|
|
37750
|
-
|
|
37751
|
-
|
|
37752
|
-
groupFormId
|
|
37753
|
-
} = _ref52;
|
|
37786
|
+
ajaxSelect: ({
|
|
37787
|
+
call,
|
|
37788
|
+
automaticallyLink,
|
|
37789
|
+
name,
|
|
37790
|
+
inputName,
|
|
37791
|
+
props,
|
|
37792
|
+
formsValue,
|
|
37793
|
+
onNewSetValue,
|
|
37794
|
+
multiple,
|
|
37795
|
+
updateOptions,
|
|
37796
|
+
repeatValues,
|
|
37797
|
+
repeatIndex,
|
|
37798
|
+
value,
|
|
37799
|
+
unique,
|
|
37800
|
+
address,
|
|
37801
|
+
addressData = {},
|
|
37802
|
+
getFromLinking,
|
|
37803
|
+
input
|
|
37804
|
+
}, {
|
|
37805
|
+
form,
|
|
37806
|
+
forms,
|
|
37807
|
+
setAddress,
|
|
37808
|
+
changeInputMeta,
|
|
37809
|
+
inputMeta,
|
|
37810
|
+
meta,
|
|
37811
|
+
isHighlighted,
|
|
37812
|
+
groupFormId
|
|
37813
|
+
}) => {
|
|
37754
37814
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect, {
|
|
37755
37815
|
size: "medium",
|
|
37756
37816
|
input: input,
|
|
@@ -37787,7 +37847,9 @@ const inputTypeComponent$1 = {
|
|
|
37787
37847
|
const selectedValue = data.find(v => v.value === ev);
|
|
37788
37848
|
if (address && selectedValue) {
|
|
37789
37849
|
dot__default["default"].str(address, selectedValue.label, addressData);
|
|
37790
|
-
setAddress(
|
|
37850
|
+
setAddress({
|
|
37851
|
+
...addressData
|
|
37852
|
+
});
|
|
37791
37853
|
}
|
|
37792
37854
|
}
|
|
37793
37855
|
},
|
|
@@ -37796,11 +37858,10 @@ const inputTypeComponent$1 = {
|
|
|
37796
37858
|
address: true
|
|
37797
37859
|
});
|
|
37798
37860
|
},
|
|
37799
|
-
tag:
|
|
37800
|
-
|
|
37801
|
-
|
|
37802
|
-
|
|
37803
|
-
} = _ref53;
|
|
37861
|
+
tag: ({
|
|
37862
|
+
value,
|
|
37863
|
+
repeatLabel
|
|
37864
|
+
}) => {
|
|
37804
37865
|
return /*#__PURE__*/jsxRuntime.jsx(TagInput, {
|
|
37805
37866
|
size: "large",
|
|
37806
37867
|
allowClear: true,
|
|
@@ -37808,28 +37869,26 @@ const inputTypeComponent$1 = {
|
|
|
37808
37869
|
newPlaceholder: repeatLabel
|
|
37809
37870
|
});
|
|
37810
37871
|
},
|
|
37811
|
-
modal: (
|
|
37812
|
-
|
|
37813
|
-
|
|
37814
|
-
|
|
37815
|
-
|
|
37816
|
-
|
|
37817
|
-
|
|
37818
|
-
|
|
37819
|
-
|
|
37820
|
-
|
|
37821
|
-
|
|
37822
|
-
|
|
37823
|
-
|
|
37824
|
-
|
|
37825
|
-
|
|
37826
|
-
|
|
37827
|
-
|
|
37828
|
-
|
|
37829
|
-
|
|
37830
|
-
|
|
37831
|
-
add
|
|
37832
|
-
} = _ref55;
|
|
37872
|
+
modal: ({
|
|
37873
|
+
call,
|
|
37874
|
+
automaticallyLink,
|
|
37875
|
+
name,
|
|
37876
|
+
inputName,
|
|
37877
|
+
props,
|
|
37878
|
+
formsValue,
|
|
37879
|
+
allFormsValue,
|
|
37880
|
+
onNewSetValue,
|
|
37881
|
+
repeatValues,
|
|
37882
|
+
repeatIndex,
|
|
37883
|
+
value,
|
|
37884
|
+
modalTitle,
|
|
37885
|
+
totalInputs,
|
|
37886
|
+
shownInputs,
|
|
37887
|
+
allowDupplicates
|
|
37888
|
+
}, {
|
|
37889
|
+
form,
|
|
37890
|
+
add
|
|
37891
|
+
}) => {
|
|
37833
37892
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxModal, {
|
|
37834
37893
|
allowClear: true,
|
|
37835
37894
|
call: call,
|
|
@@ -37852,44 +37911,40 @@ const inputTypeComponent$1 = {
|
|
|
37852
37911
|
allowDupplicates: allowDupplicates
|
|
37853
37912
|
});
|
|
37854
37913
|
},
|
|
37855
|
-
dataLink: (
|
|
37856
|
-
|
|
37857
|
-
|
|
37858
|
-
|
|
37859
|
-
|
|
37860
|
-
|
|
37861
|
-
|
|
37862
|
-
|
|
37863
|
-
|
|
37864
|
-
|
|
37865
|
-
|
|
37866
|
-
|
|
37867
|
-
|
|
37868
|
-
|
|
37869
|
-
|
|
37870
|
-
|
|
37871
|
-
|
|
37872
|
-
|
|
37873
|
-
|
|
37874
|
-
|
|
37875
|
-
|
|
37876
|
-
|
|
37877
|
-
|
|
37878
|
-
|
|
37879
|
-
|
|
37880
|
-
|
|
37881
|
-
|
|
37882
|
-
|
|
37883
|
-
|
|
37884
|
-
|
|
37885
|
-
|
|
37886
|
-
|
|
37887
|
-
groupFormId
|
|
37888
|
-
|
|
37889
|
-
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") {
|
|
37890
|
-
var _formsValue$groupForm3, _input$meta13, _input$meta14;
|
|
37891
|
-
const currentValue = groupFormId ? (_formsValue$groupForm3 = formsValue[groupFormId]) === null || _formsValue$groupForm3 === void 0 ? void 0 : _formsValue$groupForm3[name] : formsValue[name];
|
|
37892
|
-
(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()::::";
|
|
37914
|
+
dataLink: ({
|
|
37915
|
+
setValues,
|
|
37916
|
+
name,
|
|
37917
|
+
onValuesChange,
|
|
37918
|
+
changeLinking,
|
|
37919
|
+
formsValue,
|
|
37920
|
+
input,
|
|
37921
|
+
call,
|
|
37922
|
+
automaticallyLink,
|
|
37923
|
+
inputName,
|
|
37924
|
+
props,
|
|
37925
|
+
onNewSetValue,
|
|
37926
|
+
multiple,
|
|
37927
|
+
updateOptions,
|
|
37928
|
+
repeatValues,
|
|
37929
|
+
repeatIndex,
|
|
37930
|
+
value,
|
|
37931
|
+
unique,
|
|
37932
|
+
address,
|
|
37933
|
+
addressData = {},
|
|
37934
|
+
getFromLinking
|
|
37935
|
+
}, {
|
|
37936
|
+
form,
|
|
37937
|
+
forms,
|
|
37938
|
+
setAddress,
|
|
37939
|
+
changeInputMeta,
|
|
37940
|
+
inputMeta,
|
|
37941
|
+
meta,
|
|
37942
|
+
isHighlighted,
|
|
37943
|
+
groupFormId
|
|
37944
|
+
}) => {
|
|
37945
|
+
if (input?.meta?.optionsView?.editInputType === "ajaxSelect") {
|
|
37946
|
+
const currentValue = groupFormId ? formsValue[groupFormId]?.[name] : formsValue[name];
|
|
37947
|
+
input?.meta?.optionsView?.call || input?.meta?.call || "default::list()::::";
|
|
37893
37948
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect$1, {
|
|
37894
37949
|
size: "medium",
|
|
37895
37950
|
input: input,
|
|
@@ -37926,7 +37981,9 @@ const inputTypeComponent$1 = {
|
|
|
37926
37981
|
const selectedValue = data.find(v => v.value === ev);
|
|
37927
37982
|
if (address && selectedValue) {
|
|
37928
37983
|
dot__default["default"].str(address, selectedValue.label, addressData);
|
|
37929
|
-
setAddress(
|
|
37984
|
+
setAddress({
|
|
37985
|
+
...addressData
|
|
37986
|
+
});
|
|
37930
37987
|
}
|
|
37931
37988
|
}
|
|
37932
37989
|
},
|
|
@@ -37936,93 +37993,138 @@ const inputTypeComponent$1 = {
|
|
|
37936
37993
|
isDataLink: true
|
|
37937
37994
|
});
|
|
37938
37995
|
}
|
|
37939
|
-
const isSingle =
|
|
37940
|
-
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [
|
|
37996
|
+
const isSingle = input?.meta?.maxRepeat === 1;
|
|
37997
|
+
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
|
|
37998
|
+
...(formsValue[groupFormId] || {})[name]
|
|
37999
|
+
}] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
|
|
38000
|
+
...v
|
|
38001
|
+
})) : isSingle ? formsValue[name] ? [{
|
|
38002
|
+
...formsValue[name]
|
|
38003
|
+
}] : [] : (formsValue[name] || []).map(v => ({
|
|
38004
|
+
...v
|
|
38005
|
+
}));
|
|
37941
38006
|
const onUpdate = (editData, i) => {
|
|
37942
|
-
const val =
|
|
38007
|
+
const val = {
|
|
38008
|
+
...formData[i],
|
|
38009
|
+
...editData
|
|
38010
|
+
};
|
|
37943
38011
|
const _val = isSingle ? {
|
|
37944
38012
|
[name]: val
|
|
37945
38013
|
} : {
|
|
37946
|
-
[name]: formData
|
|
38014
|
+
[name]: formData?.map((d, j) => i === j ? val : d)
|
|
37947
38015
|
};
|
|
37948
38016
|
if (groupFormId) {
|
|
37949
|
-
const _defaultData =
|
|
37950
|
-
const _newData =
|
|
37951
|
-
|
|
38017
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38018
|
+
const _newData = {
|
|
38019
|
+
..._defaultData,
|
|
38020
|
+
..._val
|
|
38021
|
+
};
|
|
38022
|
+
onValuesChange(_newData, {
|
|
38023
|
+
...formsValue,
|
|
37952
38024
|
[groupFormId]: _newData
|
|
37953
|
-
})
|
|
37954
|
-
form
|
|
37955
|
-
setValues(
|
|
38025
|
+
});
|
|
38026
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38027
|
+
setValues({
|
|
38028
|
+
...formsValue,
|
|
37956
38029
|
[groupFormId]: _newData
|
|
37957
|
-
})
|
|
38030
|
+
});
|
|
37958
38031
|
return;
|
|
37959
38032
|
}
|
|
37960
|
-
onValuesChange(_val,
|
|
37961
|
-
|
|
37962
|
-
|
|
38033
|
+
onValuesChange(_val, {
|
|
38034
|
+
...formsValue,
|
|
38035
|
+
..._val
|
|
38036
|
+
});
|
|
38037
|
+
form?.setFieldValue(name, _val[name]);
|
|
38038
|
+
setValues({
|
|
38039
|
+
...formsValue,
|
|
38040
|
+
..._val
|
|
38041
|
+
});
|
|
37963
38042
|
};
|
|
37964
|
-
if (input
|
|
37965
|
-
var _formsValue$meta4, _input$meta17;
|
|
38043
|
+
if (input?.meta?.flat) {
|
|
37966
38044
|
return /*#__PURE__*/jsxRuntime.jsx(DataLinkFlat, {
|
|
37967
38045
|
form: input,
|
|
37968
38046
|
changeLinking: changeLinking,
|
|
37969
38047
|
onUpdate: onUpdate,
|
|
37970
38048
|
isHighlighted: isHighlighted,
|
|
37971
38049
|
formsValue: formsValue,
|
|
37972
|
-
values: groupFormId ?
|
|
38050
|
+
values: groupFormId ? {
|
|
38051
|
+
...(formsValue[groupFormId] || {}),
|
|
37973
38052
|
meta: {
|
|
37974
|
-
inputs: (
|
|
38053
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
37975
38054
|
}
|
|
37976
|
-
}
|
|
38055
|
+
} : formsValue,
|
|
37977
38056
|
name: name,
|
|
37978
38057
|
groupFormId: groupFormId,
|
|
37979
|
-
maxRepeat: input
|
|
37980
|
-
remove:
|
|
37981
|
-
|
|
37982
|
-
|
|
37983
|
-
} = _ref58;
|
|
38058
|
+
maxRepeat: input?.meta?.maxRepeat,
|
|
38059
|
+
remove: ({
|
|
38060
|
+
key
|
|
38061
|
+
}) => {
|
|
37984
38062
|
const _val = isSingle ? {
|
|
37985
38063
|
[name]: null
|
|
37986
38064
|
} : {
|
|
37987
38065
|
[name]: formData.filter((v, i) => i !== key)
|
|
37988
38066
|
};
|
|
37989
38067
|
if (groupFormId) {
|
|
37990
|
-
const _defaultData =
|
|
37991
|
-
const _newData =
|
|
37992
|
-
|
|
38068
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38069
|
+
const _newData = {
|
|
38070
|
+
..._defaultData,
|
|
38071
|
+
..._val
|
|
38072
|
+
};
|
|
38073
|
+
onValuesChange(_newData, {
|
|
38074
|
+
...formsValue,
|
|
37993
38075
|
[groupFormId]: _newData
|
|
37994
|
-
})
|
|
37995
|
-
form
|
|
37996
|
-
setValues(
|
|
38076
|
+
});
|
|
38077
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38078
|
+
setValues({
|
|
38079
|
+
...formsValue,
|
|
37997
38080
|
[groupFormId]: _newData
|
|
37998
|
-
})
|
|
38081
|
+
});
|
|
37999
38082
|
return;
|
|
38000
38083
|
}
|
|
38001
|
-
onValuesChange(_val,
|
|
38002
|
-
|
|
38003
|
-
|
|
38084
|
+
onValuesChange(_val, {
|
|
38085
|
+
...formsValue,
|
|
38086
|
+
..._val
|
|
38087
|
+
});
|
|
38088
|
+
form?.setFieldValue(name, _val[name]);
|
|
38089
|
+
setValues({
|
|
38090
|
+
...formsValue,
|
|
38091
|
+
..._val
|
|
38092
|
+
});
|
|
38004
38093
|
},
|
|
38005
38094
|
add: val => {
|
|
38006
38095
|
const _val = isSingle ? {
|
|
38007
38096
|
[name]: val
|
|
38008
38097
|
} : {
|
|
38009
|
-
[name]: [...formData,
|
|
38098
|
+
[name]: [...formData, {
|
|
38099
|
+
...val
|
|
38100
|
+
}]
|
|
38010
38101
|
};
|
|
38011
38102
|
if (groupFormId) {
|
|
38012
|
-
const _defaultData =
|
|
38013
|
-
const _newData =
|
|
38014
|
-
|
|
38015
|
-
|
|
38103
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38104
|
+
const _newData = {
|
|
38105
|
+
..._defaultData,
|
|
38106
|
+
..._val
|
|
38107
|
+
};
|
|
38108
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38109
|
+
onValuesChange(_newData, {
|
|
38110
|
+
...formsValue,
|
|
38016
38111
|
[groupFormId]: _newData
|
|
38017
|
-
})
|
|
38018
|
-
setValues(
|
|
38112
|
+
});
|
|
38113
|
+
setValues({
|
|
38114
|
+
...formsValue,
|
|
38019
38115
|
[groupFormId]: _newData
|
|
38020
|
-
})
|
|
38116
|
+
});
|
|
38021
38117
|
return;
|
|
38022
38118
|
}
|
|
38023
|
-
form
|
|
38024
|
-
onValuesChange(_val,
|
|
38025
|
-
|
|
38119
|
+
form?.setFieldValue(name, _val[name]);
|
|
38120
|
+
onValuesChange(_val, {
|
|
38121
|
+
...formsValue,
|
|
38122
|
+
..._val
|
|
38123
|
+
});
|
|
38124
|
+
setValues({
|
|
38125
|
+
...formsValue,
|
|
38126
|
+
..._val
|
|
38127
|
+
});
|
|
38026
38128
|
},
|
|
38027
38129
|
k: name,
|
|
38028
38130
|
formData: formData
|
|
@@ -38034,79 +38136,101 @@ const inputTypeComponent$1 = {
|
|
|
38034
38136
|
onUpdate: onUpdate,
|
|
38035
38137
|
isHighlighted: isHighlighted,
|
|
38036
38138
|
formsValue: formsValue,
|
|
38037
|
-
values: groupFormId ?
|
|
38139
|
+
values: groupFormId ? {
|
|
38140
|
+
...(formsValue[groupFormId] || {}),
|
|
38038
38141
|
meta: {
|
|
38039
|
-
inputs: (
|
|
38142
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
38040
38143
|
}
|
|
38041
|
-
}
|
|
38144
|
+
} : formsValue,
|
|
38042
38145
|
name: name,
|
|
38043
38146
|
groupFormId: groupFormId,
|
|
38044
|
-
maxRepeat: input
|
|
38045
|
-
remove:
|
|
38046
|
-
|
|
38047
|
-
|
|
38048
|
-
} = _ref59;
|
|
38147
|
+
maxRepeat: input?.meta?.maxRepeat,
|
|
38148
|
+
remove: ({
|
|
38149
|
+
key
|
|
38150
|
+
}) => {
|
|
38049
38151
|
const _val = isSingle ? {
|
|
38050
38152
|
[name]: null
|
|
38051
38153
|
} : {
|
|
38052
38154
|
[name]: formData.filter((v, i) => i !== key)
|
|
38053
38155
|
};
|
|
38054
38156
|
if (groupFormId) {
|
|
38055
|
-
const _defaultData =
|
|
38056
|
-
const _newData =
|
|
38057
|
-
|
|
38157
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38158
|
+
const _newData = {
|
|
38159
|
+
..._defaultData,
|
|
38160
|
+
..._val
|
|
38161
|
+
};
|
|
38162
|
+
onValuesChange(_newData, {
|
|
38163
|
+
...formsValue,
|
|
38058
38164
|
[groupFormId]: _newData
|
|
38059
|
-
})
|
|
38060
|
-
form
|
|
38061
|
-
setValues(
|
|
38165
|
+
});
|
|
38166
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38167
|
+
setValues({
|
|
38168
|
+
...formsValue,
|
|
38062
38169
|
[groupFormId]: _newData
|
|
38063
|
-
})
|
|
38170
|
+
});
|
|
38064
38171
|
return;
|
|
38065
38172
|
}
|
|
38066
|
-
onValuesChange(_val,
|
|
38067
|
-
|
|
38068
|
-
|
|
38173
|
+
onValuesChange(_val, {
|
|
38174
|
+
...formsValue,
|
|
38175
|
+
..._val
|
|
38176
|
+
});
|
|
38177
|
+
form?.setFieldValue(name, _val[name]);
|
|
38178
|
+
setValues({
|
|
38179
|
+
...formsValue,
|
|
38180
|
+
..._val
|
|
38181
|
+
});
|
|
38069
38182
|
},
|
|
38070
38183
|
add: val => {
|
|
38071
38184
|
const _val = isSingle ? {
|
|
38072
38185
|
[name]: val
|
|
38073
38186
|
} : {
|
|
38074
|
-
[name]: [...formData,
|
|
38187
|
+
[name]: [...formData, {
|
|
38188
|
+
...val
|
|
38189
|
+
}]
|
|
38075
38190
|
};
|
|
38076
38191
|
if (groupFormId) {
|
|
38077
|
-
const _defaultData =
|
|
38078
|
-
const _newData =
|
|
38079
|
-
|
|
38080
|
-
|
|
38192
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38193
|
+
const _newData = {
|
|
38194
|
+
..._defaultData,
|
|
38195
|
+
..._val
|
|
38196
|
+
};
|
|
38197
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38198
|
+
onValuesChange(_newData, {
|
|
38199
|
+
...formsValue,
|
|
38081
38200
|
[groupFormId]: _newData
|
|
38082
|
-
})
|
|
38083
|
-
setValues(
|
|
38201
|
+
});
|
|
38202
|
+
setValues({
|
|
38203
|
+
...formsValue,
|
|
38084
38204
|
[groupFormId]: _newData
|
|
38085
|
-
})
|
|
38205
|
+
});
|
|
38086
38206
|
return;
|
|
38087
38207
|
}
|
|
38088
|
-
form
|
|
38089
|
-
onValuesChange(_val,
|
|
38090
|
-
|
|
38208
|
+
form?.setFieldValue(name, _val[name]);
|
|
38209
|
+
onValuesChange(_val, {
|
|
38210
|
+
...formsValue,
|
|
38211
|
+
..._val
|
|
38212
|
+
});
|
|
38213
|
+
setValues({
|
|
38214
|
+
...formsValue,
|
|
38215
|
+
..._val
|
|
38216
|
+
});
|
|
38091
38217
|
},
|
|
38092
38218
|
k: name,
|
|
38093
38219
|
formData: formData
|
|
38094
38220
|
});
|
|
38095
38221
|
},
|
|
38096
|
-
dataLinkGroup: (
|
|
38097
|
-
|
|
38098
|
-
|
|
38099
|
-
|
|
38100
|
-
|
|
38101
|
-
|
|
38102
|
-
|
|
38103
|
-
|
|
38104
|
-
|
|
38105
|
-
|
|
38106
|
-
|
|
38107
|
-
|
|
38108
|
-
isHighlighted
|
|
38109
|
-
} = _ref61;
|
|
38222
|
+
dataLinkGroup: ({
|
|
38223
|
+
setValues,
|
|
38224
|
+
name,
|
|
38225
|
+
onValuesChange,
|
|
38226
|
+
changeLinking,
|
|
38227
|
+
formsValue,
|
|
38228
|
+
input
|
|
38229
|
+
}, {
|
|
38230
|
+
form,
|
|
38231
|
+
groupFormId,
|
|
38232
|
+
isHighlighted
|
|
38233
|
+
}) => {
|
|
38110
38234
|
return renderDataLinkGroup({
|
|
38111
38235
|
input,
|
|
38112
38236
|
name,
|
|
@@ -38119,41 +38243,51 @@ const inputTypeComponent$1 = {
|
|
|
38119
38243
|
isHighlighted
|
|
38120
38244
|
});
|
|
38121
38245
|
},
|
|
38122
|
-
groupCheckbox: (
|
|
38123
|
-
|
|
38124
|
-
|
|
38125
|
-
|
|
38126
|
-
|
|
38127
|
-
|
|
38128
|
-
|
|
38129
|
-
|
|
38130
|
-
|
|
38131
|
-
|
|
38132
|
-
|
|
38133
|
-
isHighlighted
|
|
38134
|
-
} = _ref63;
|
|
38246
|
+
groupCheckbox: ({
|
|
38247
|
+
setValues,
|
|
38248
|
+
name,
|
|
38249
|
+
onValuesChange,
|
|
38250
|
+
formsValue,
|
|
38251
|
+
input
|
|
38252
|
+
}, {
|
|
38253
|
+
form,
|
|
38254
|
+
groupFormId,
|
|
38255
|
+
isHighlighted
|
|
38256
|
+
}) => {
|
|
38135
38257
|
const formData = groupFormId ? (formsValue[groupFormId] || {})[name] || [] : formsValue[name] || [];
|
|
38136
38258
|
const onUpdate = (val, key) => {
|
|
38137
38259
|
const _val = {
|
|
38138
|
-
[name]:
|
|
38260
|
+
[name]: {
|
|
38261
|
+
...formData,
|
|
38139
38262
|
[key]: val
|
|
38140
|
-
}
|
|
38263
|
+
}
|
|
38141
38264
|
};
|
|
38142
38265
|
if (groupFormId) {
|
|
38143
|
-
const _defaultData =
|
|
38144
|
-
const _newData =
|
|
38145
|
-
|
|
38266
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38267
|
+
const _newData = {
|
|
38268
|
+
..._defaultData,
|
|
38269
|
+
..._val
|
|
38270
|
+
};
|
|
38271
|
+
onValuesChange(_newData, {
|
|
38272
|
+
...formsValue,
|
|
38146
38273
|
[groupFormId]: _newData
|
|
38147
|
-
})
|
|
38148
|
-
form
|
|
38149
|
-
setValues(
|
|
38274
|
+
});
|
|
38275
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38276
|
+
setValues({
|
|
38277
|
+
...formsValue,
|
|
38150
38278
|
[groupFormId]: _newData
|
|
38151
|
-
})
|
|
38279
|
+
});
|
|
38152
38280
|
return;
|
|
38153
38281
|
}
|
|
38154
|
-
onValuesChange(_val,
|
|
38155
|
-
|
|
38156
|
-
|
|
38282
|
+
onValuesChange(_val, {
|
|
38283
|
+
...formsValue,
|
|
38284
|
+
..._val
|
|
38285
|
+
});
|
|
38286
|
+
form?.setFieldValue(name, _val[name]);
|
|
38287
|
+
setValues({
|
|
38288
|
+
...formsValue,
|
|
38289
|
+
..._val
|
|
38290
|
+
});
|
|
38157
38291
|
};
|
|
38158
38292
|
return /*#__PURE__*/jsxRuntime.jsx(GroupCheckbox, {
|
|
38159
38293
|
form: input,
|
|
@@ -38162,91 +38296,96 @@ const inputTypeComponent$1 = {
|
|
|
38162
38296
|
isHighlighted: isHighlighted
|
|
38163
38297
|
});
|
|
38164
38298
|
},
|
|
38165
|
-
website: (
|
|
38166
|
-
|
|
38167
|
-
|
|
38168
|
-
|
|
38169
|
-
|
|
38170
|
-
|
|
38171
|
-
|
|
38172
|
-
|
|
38173
|
-
|
|
38174
|
-
|
|
38175
|
-
|
|
38176
|
-
|
|
38177
|
-
|
|
38178
|
-
|
|
38179
|
-
|
|
38180
|
-
} = _ref65;
|
|
38181
|
-
return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
|
|
38299
|
+
website: ({
|
|
38300
|
+
name,
|
|
38301
|
+
inputName,
|
|
38302
|
+
props,
|
|
38303
|
+
value,
|
|
38304
|
+
repeatIndex,
|
|
38305
|
+
repeatValues,
|
|
38306
|
+
formsValue
|
|
38307
|
+
}, {
|
|
38308
|
+
form,
|
|
38309
|
+
isHighlighted,
|
|
38310
|
+
inputMeta = {},
|
|
38311
|
+
t
|
|
38312
|
+
}) => {
|
|
38313
|
+
return /*#__PURE__*/jsxRuntime.jsx(Website, {
|
|
38182
38314
|
size: "large",
|
|
38183
38315
|
allowClear: true,
|
|
38184
|
-
initialValue: value
|
|
38185
|
-
|
|
38316
|
+
initialValue: value,
|
|
38317
|
+
...props,
|
|
38186
38318
|
onChange: val => updateFormValues$1(repeatIndex, repeatValues, inputName, val, formsValue, name, form),
|
|
38187
38319
|
className: formatClassname([isHighlighted && "highlighted-cont"]),
|
|
38188
38320
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
38189
38321
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com"
|
|
38190
|
-
})
|
|
38322
|
+
});
|
|
38191
38323
|
},
|
|
38192
|
-
group: (
|
|
38193
|
-
|
|
38194
|
-
|
|
38195
|
-
|
|
38196
|
-
|
|
38197
|
-
|
|
38198
|
-
|
|
38199
|
-
|
|
38200
|
-
|
|
38201
|
-
} = _ref67;
|
|
38202
|
-
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
|
|
38324
|
+
group: ({
|
|
38325
|
+
props,
|
|
38326
|
+
groupInputs,
|
|
38327
|
+
formsValue
|
|
38328
|
+
}, {
|
|
38329
|
+
inputMeta,
|
|
38330
|
+
isHighlighted
|
|
38331
|
+
}) => {
|
|
38332
|
+
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
|
|
38203
38333
|
formsValue: formsValue,
|
|
38204
38334
|
isHighlighted: isHighlighted,
|
|
38205
38335
|
groupInputs: groupInputs,
|
|
38206
|
-
inputMeta: inputMeta
|
|
38207
|
-
|
|
38336
|
+
inputMeta: inputMeta,
|
|
38337
|
+
...props
|
|
38338
|
+
});
|
|
38208
38339
|
},
|
|
38209
|
-
groupInputs: (
|
|
38210
|
-
|
|
38211
|
-
|
|
38212
|
-
|
|
38213
|
-
|
|
38214
|
-
|
|
38215
|
-
|
|
38216
|
-
|
|
38217
|
-
|
|
38218
|
-
} = _ref69;
|
|
38219
|
-
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
|
|
38340
|
+
groupInputs: ({
|
|
38341
|
+
props,
|
|
38342
|
+
groupInputs,
|
|
38343
|
+
formsValue
|
|
38344
|
+
}, {
|
|
38345
|
+
inputMeta,
|
|
38346
|
+
isHighlighted
|
|
38347
|
+
}) => {
|
|
38348
|
+
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
|
|
38220
38349
|
formsValue: formsValue,
|
|
38221
38350
|
isHighlighted: isHighlighted,
|
|
38222
38351
|
groupInputs: groupInputs,
|
|
38223
|
-
inputMeta: inputMeta
|
|
38224
|
-
|
|
38352
|
+
inputMeta: inputMeta,
|
|
38353
|
+
...props
|
|
38354
|
+
});
|
|
38225
38355
|
},
|
|
38226
|
-
smartHelp: (
|
|
38356
|
+
smartHelp: ({
|
|
38357
|
+
name,
|
|
38358
|
+
inputName,
|
|
38359
|
+
props,
|
|
38360
|
+
value,
|
|
38361
|
+
repeatIndex,
|
|
38362
|
+
repeatValues,
|
|
38363
|
+
formsValue
|
|
38364
|
+
}, {
|
|
38365
|
+
form,
|
|
38366
|
+
isHighlighted,
|
|
38367
|
+
inputMeta = {},
|
|
38368
|
+
t
|
|
38369
|
+
}) => {
|
|
38227
38370
|
return /*#__PURE__*/jsxRuntime.jsx(Smart, {});
|
|
38228
38371
|
}
|
|
38229
38372
|
};
|
|
38230
38373
|
const filterForm = (f, d) => {
|
|
38231
38374
|
return f && (f.showFormIf ? showHideForm(f, d) : true);
|
|
38232
38375
|
};
|
|
38233
|
-
const checkFormHasSubsections =
|
|
38234
|
-
let f = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
38235
|
-
return Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
|
|
38236
|
-
};
|
|
38376
|
+
const checkFormHasSubsections = (f = {}) => Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
|
|
38237
38377
|
const mapFormGroup = (f, d) => Object.keys(f).map(key => {
|
|
38238
|
-
const
|
|
38239
|
-
|
|
38240
|
-
|
|
38241
|
-
|
|
38242
|
-
|
|
38243
|
-
|
|
38244
|
-
|
|
38245
|
-
|
|
38246
|
-
|
|
38247
|
-
|
|
38248
|
-
|
|
38249
|
-
fc = _objectWithoutProperties(_ref72, _excluded2$1);
|
|
38378
|
+
const {
|
|
38379
|
+
label,
|
|
38380
|
+
description = "",
|
|
38381
|
+
excludeFromEdit,
|
|
38382
|
+
showFormIf,
|
|
38383
|
+
icon = "",
|
|
38384
|
+
position = 0,
|
|
38385
|
+
template,
|
|
38386
|
+
formClass,
|
|
38387
|
+
...fc
|
|
38388
|
+
} = f[key] || {};
|
|
38250
38389
|
const fConf = {
|
|
38251
38390
|
id: key,
|
|
38252
38391
|
label,
|
|
@@ -38305,14 +38444,11 @@ const groupSubForms = (fConf, d) => {
|
|
|
38305
38444
|
return f;
|
|
38306
38445
|
}, {});
|
|
38307
38446
|
};
|
|
38308
|
-
const inputIsEmpty =
|
|
38309
|
-
|
|
38310
|
-
let values = arguments.length > 1 ? arguments[1] : undefined;
|
|
38311
|
-
let inputMeta = arguments.length > 2 ? arguments[2] : undefined;
|
|
38312
|
-
if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
|
|
38447
|
+
const inputIsEmpty = (input = {}, values, inputMeta) => {
|
|
38448
|
+
if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
|
|
38313
38449
|
return false;
|
|
38314
38450
|
}
|
|
38315
|
-
if (
|
|
38451
|
+
if (input?.type === "groupInputs") {
|
|
38316
38452
|
return true;
|
|
38317
38453
|
}
|
|
38318
38454
|
const value = values[input.dataId];
|
|
@@ -38324,28 +38460,26 @@ const inputIsEmpty = function () {
|
|
|
38324
38460
|
}
|
|
38325
38461
|
return !value;
|
|
38326
38462
|
};
|
|
38327
|
-
const GetFormItem$1 =
|
|
38328
|
-
|
|
38329
|
-
|
|
38330
|
-
|
|
38331
|
-
|
|
38332
|
-
|
|
38333
|
-
|
|
38334
|
-
|
|
38335
|
-
|
|
38336
|
-
|
|
38337
|
-
|
|
38338
|
-
|
|
38339
|
-
|
|
38340
|
-
|
|
38341
|
-
|
|
38342
|
-
|
|
38343
|
-
|
|
38344
|
-
|
|
38345
|
-
|
|
38346
|
-
|
|
38347
|
-
namespace
|
|
38348
|
-
} = _ref73;
|
|
38463
|
+
const GetFormItem$1 = ({
|
|
38464
|
+
highlightMandatory,
|
|
38465
|
+
inputData,
|
|
38466
|
+
inputId,
|
|
38467
|
+
input,
|
|
38468
|
+
values,
|
|
38469
|
+
MainForm,
|
|
38470
|
+
options,
|
|
38471
|
+
plainForms,
|
|
38472
|
+
setValues,
|
|
38473
|
+
setAddress,
|
|
38474
|
+
i,
|
|
38475
|
+
inputKey,
|
|
38476
|
+
onValuesChange = () => {},
|
|
38477
|
+
setLoading = () => {},
|
|
38478
|
+
inputMeta = {},
|
|
38479
|
+
changeInputMeta = () => {},
|
|
38480
|
+
changeLinking = () => {},
|
|
38481
|
+
namespace
|
|
38482
|
+
}) => {
|
|
38349
38483
|
const {
|
|
38350
38484
|
t,
|
|
38351
38485
|
user,
|
|
@@ -38360,42 +38494,44 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38360
38494
|
staticWidth,
|
|
38361
38495
|
fullWidth
|
|
38362
38496
|
} = useEditContext();
|
|
38363
|
-
const lastReview = (
|
|
38497
|
+
const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
|
|
38364
38498
|
const [isShown, setIsShown] = React.useState(!!inputData.commentValue);
|
|
38365
38499
|
const inputLabel = getInputLabel$1(input, values);
|
|
38366
38500
|
const onClickReviewSuccess = () => {
|
|
38367
38501
|
if (!isReview) {
|
|
38368
38502
|
return;
|
|
38369
38503
|
}
|
|
38370
|
-
const reviewSuccess = lastReview
|
|
38504
|
+
const reviewSuccess = lastReview?.reviewSuccess;
|
|
38371
38505
|
changeInputMeta({
|
|
38372
38506
|
key: inputId,
|
|
38373
38507
|
type: input.type,
|
|
38374
|
-
value:
|
|
38508
|
+
value: {
|
|
38509
|
+
...inputMeta,
|
|
38375
38510
|
reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
|
|
38376
38511
|
reviewer: user,
|
|
38377
38512
|
createdAt: new Date().toISOString(),
|
|
38378
38513
|
reviewSuccess: true
|
|
38379
38514
|
}]
|
|
38380
|
-
}
|
|
38515
|
+
}
|
|
38381
38516
|
});
|
|
38382
38517
|
};
|
|
38383
38518
|
const onClickReviewError = () => {
|
|
38384
38519
|
if (!isReview) {
|
|
38385
38520
|
return;
|
|
38386
38521
|
}
|
|
38387
|
-
const reviewError = lastReview
|
|
38522
|
+
const reviewError = lastReview?.reviewError;
|
|
38388
38523
|
changeInputMeta({
|
|
38389
38524
|
key: inputId,
|
|
38390
38525
|
type: input.type,
|
|
38391
|
-
value:
|
|
38526
|
+
value: {
|
|
38527
|
+
...inputMeta,
|
|
38392
38528
|
reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
|
|
38393
38529
|
reviewer: user,
|
|
38394
38530
|
createdAt: new Date().toISOString(),
|
|
38395
38531
|
reviewError: true,
|
|
38396
38532
|
comment: ""
|
|
38397
38533
|
}]
|
|
38398
|
-
}
|
|
38534
|
+
}
|
|
38399
38535
|
});
|
|
38400
38536
|
};
|
|
38401
38537
|
switch (input.type) {
|
|
@@ -38409,12 +38545,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38409
38545
|
case "header":
|
|
38410
38546
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38411
38547
|
className: "daf-title with-subtitle",
|
|
38412
|
-
style: input
|
|
38548
|
+
style: input?.meta?.style,
|
|
38413
38549
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38414
38550
|
className: "flex",
|
|
38415
38551
|
children: [/*#__PURE__*/jsxRuntime.jsx("h1", {
|
|
38416
38552
|
children: ReactHtmlParser__default["default"](getLabel$1(input.label, values))
|
|
38417
|
-
}), !!input.description || input
|
|
38553
|
+
}), !!input.description || input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
|
|
38418
38554
|
content: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38419
38555
|
className: "tooltip-popover-cont",
|
|
38420
38556
|
children: ReactHtmlParser__default["default"](input.description)
|
|
@@ -38441,7 +38577,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38441
38577
|
const specialCharsRule = rules.find(r => r.type === "specialCharacters");
|
|
38442
38578
|
|
|
38443
38579
|
// eslint-disable-next-line no-case-declarations
|
|
38444
|
-
let maxRule =
|
|
38580
|
+
let maxRule = rules.find(rule => rule.max)?.max;
|
|
38445
38581
|
if (!maxRule && input.type === "textarea") {
|
|
38446
38582
|
maxRule = MAX_TEXT_AREA_LENGTH;
|
|
38447
38583
|
}
|
|
@@ -38454,30 +38590,27 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38454
38590
|
message: requiredRule.message || ""
|
|
38455
38591
|
});
|
|
38456
38592
|
}
|
|
38457
|
-
const isHighlighted = highlightMandatory &&
|
|
38593
|
+
const isHighlighted = highlightMandatory && input?.meta?.mandatory && inputIsEmpty(input, values, inputMeta);
|
|
38458
38594
|
if (requiredRule || specialCharsRule) {
|
|
38459
38595
|
if (input.type === "groupInputs") {
|
|
38460
38596
|
rules = rules.map(r => {
|
|
38461
38597
|
if (r.required) {
|
|
38462
|
-
return
|
|
38463
|
-
|
|
38464
|
-
|
|
38465
|
-
|
|
38466
|
-
|
|
38467
|
-
validator() {
|
|
38468
|
-
if (inputMeta.notAvailable || inputMeta.notApplicable) {
|
|
38469
|
-
return Promise.resolve();
|
|
38470
|
-
}
|
|
38471
|
-
const keys = Object.keys(input.inputs);
|
|
38472
|
-
for (let i = 0; i < keys.length; i++) {
|
|
38473
|
-
if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
|
|
38474
|
-
return Promise.reject(r.message);
|
|
38475
|
-
}
|
|
38476
|
-
}
|
|
38598
|
+
return ({
|
|
38599
|
+
getFieldValue
|
|
38600
|
+
}) => ({
|
|
38601
|
+
validator() {
|
|
38602
|
+
if (inputMeta.notAvailable || inputMeta.notApplicable) {
|
|
38477
38603
|
return Promise.resolve();
|
|
38478
38604
|
}
|
|
38479
|
-
|
|
38480
|
-
|
|
38605
|
+
const keys = Object.keys(input.inputs);
|
|
38606
|
+
for (let i = 0; i < keys.length; i++) {
|
|
38607
|
+
if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
|
|
38608
|
+
return Promise.reject(r.message);
|
|
38609
|
+
}
|
|
38610
|
+
}
|
|
38611
|
+
return Promise.resolve();
|
|
38612
|
+
}
|
|
38613
|
+
});
|
|
38481
38614
|
}
|
|
38482
38615
|
return r;
|
|
38483
38616
|
});
|
|
@@ -38515,13 +38648,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38515
38648
|
}
|
|
38516
38649
|
}
|
|
38517
38650
|
if (input && typeof input === "object") {
|
|
38518
|
-
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;
|
|
38519
38651
|
// check if input is valid
|
|
38520
38652
|
const hideComment = namespace === "project-readiness";
|
|
38521
38653
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
38522
38654
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38523
38655
|
className: "flex-row input-cont",
|
|
38524
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item,
|
|
38656
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38525
38657
|
extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
38526
38658
|
children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38527
38659
|
className: formatClassname(["ml-4 input-actions"]),
|
|
@@ -38531,7 +38663,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38531
38663
|
title: t("Add review note"),
|
|
38532
38664
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38533
38665
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38534
|
-
className: formatClassname(["review-btn review-error-btn",
|
|
38666
|
+
className: formatClassname(["review-btn review-error-btn", lastReview?.reviewError && "primary"]),
|
|
38535
38667
|
type: "link",
|
|
38536
38668
|
onClick: onClickReviewError,
|
|
38537
38669
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
@@ -38547,7 +38679,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38547
38679
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38548
38680
|
type: "link",
|
|
38549
38681
|
onClick: onClickReviewSuccess,
|
|
38550
|
-
className: formatClassname(["review-btn review-success-btn",
|
|
38682
|
+
className: formatClassname(["review-btn review-success-btn", lastReview?.reviewSuccess && "primary"]),
|
|
38551
38683
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
38552
38684
|
name: "CheckSquare",
|
|
38553
38685
|
width: 16,
|
|
@@ -38584,7 +38716,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38584
38716
|
}
|
|
38585
38717
|
});
|
|
38586
38718
|
},
|
|
38587
|
-
disabled: !
|
|
38719
|
+
disabled: !input.meta?.notApplicable,
|
|
38588
38720
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
38589
38721
|
name: "NotApplicable",
|
|
38590
38722
|
width: 16,
|
|
@@ -38598,7 +38730,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38598
38730
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38599
38731
|
className: formatClassname(["default p-0", inputMeta.notAvailable && "primary"]),
|
|
38600
38732
|
type: "link",
|
|
38601
|
-
disabled: !
|
|
38733
|
+
disabled: !input.meta?.notAvailable,
|
|
38602
38734
|
onClick: () => {
|
|
38603
38735
|
const value = getDefaultInputValue(input);
|
|
38604
38736
|
MainForm.setFields([{
|
|
@@ -38630,14 +38762,14 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38630
38762
|
}), !hideComment ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
38631
38763
|
title: t("Add comment"),
|
|
38632
38764
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38633
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button,
|
|
38765
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38634
38766
|
type: "link",
|
|
38635
|
-
disabled: !
|
|
38636
|
-
|
|
38637
|
-
|
|
38638
|
-
|
|
38639
|
-
|
|
38640
|
-
|
|
38767
|
+
disabled: !input.meta?.comment,
|
|
38768
|
+
...(!isShown ? {
|
|
38769
|
+
className: "default p-0"
|
|
38770
|
+
} : {
|
|
38771
|
+
className: "p-0 primary"
|
|
38772
|
+
}),
|
|
38641
38773
|
onClick: () => {
|
|
38642
38774
|
if (inputMeta.comment !== undefined && inputMeta.comment !== null) {
|
|
38643
38775
|
return;
|
|
@@ -38656,7 +38788,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38656
38788
|
width: 16,
|
|
38657
38789
|
height: 16
|
|
38658
38790
|
})
|
|
38659
|
-
})
|
|
38791
|
+
})
|
|
38660
38792
|
})
|
|
38661
38793
|
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
38662
38794
|
title: t("Project Readiness"),
|
|
@@ -38675,34 +38807,36 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38675
38807
|
}) : null]
|
|
38676
38808
|
}) : null
|
|
38677
38809
|
}),
|
|
38678
|
-
initialValue: inputMeta
|
|
38679
|
-
|
|
38680
|
-
|
|
38681
|
-
|
|
38682
|
-
|
|
38683
|
-
|
|
38684
|
-
|
|
38685
|
-
|
|
38686
|
-
|
|
38687
|
-
|
|
38688
|
-
|
|
38689
|
-
|
|
38690
|
-
|
|
38691
|
-
|
|
38692
|
-
if (f.response) {
|
|
38693
|
-
return f.response;
|
|
38810
|
+
initialValue: inputMeta?.defaultValue,
|
|
38811
|
+
...(inputOnBlur.includes(input.type) ? {
|
|
38812
|
+
trigger: "onBlur"
|
|
38813
|
+
} : {}),
|
|
38814
|
+
...(["total100", "group"].includes(input.type) ? {} : {
|
|
38815
|
+
name: inputId,
|
|
38816
|
+
fieldKey: inputId,
|
|
38817
|
+
initialValue: inputData.value
|
|
38818
|
+
}),
|
|
38819
|
+
...(["upload"].includes(input.type) ? {
|
|
38820
|
+
valuePropName: "fileList",
|
|
38821
|
+
getValueFromEvent: e => {
|
|
38822
|
+
if (Array.isArray(e)) {
|
|
38823
|
+
return e;
|
|
38694
38824
|
}
|
|
38695
|
-
return f
|
|
38696
|
-
|
|
38697
|
-
|
|
38698
|
-
|
|
38699
|
-
|
|
38825
|
+
return e && e.fileList && e.fileList.map(f => {
|
|
38826
|
+
if (f.response) {
|
|
38827
|
+
return f.response;
|
|
38828
|
+
}
|
|
38829
|
+
return f;
|
|
38830
|
+
});
|
|
38831
|
+
}
|
|
38832
|
+
} : {}),
|
|
38833
|
+
className: formatClassname([`i-${input.type} flex-1`, input.comment && "with-comment", maxRule && "with-max-rule"]),
|
|
38700
38834
|
"data-id": inputData.name,
|
|
38701
38835
|
rules: rules,
|
|
38702
38836
|
required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
|
|
38703
38837
|
labelCol: 12,
|
|
38704
38838
|
label: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38705
|
-
className: formatClassname(["flex",
|
|
38839
|
+
className: formatClassname(["flex", input?.meta?.code && "mr-10"]),
|
|
38706
38840
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38707
38841
|
className: "mr-1",
|
|
38708
38842
|
children: getInputLabel$1(input, values)
|
|
@@ -38715,7 +38849,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38715
38849
|
config: input,
|
|
38716
38850
|
t: t,
|
|
38717
38851
|
ajaxForms: ajaxForms,
|
|
38718
|
-
linkingData:
|
|
38852
|
+
linkingData: values?.linking || values?.parent?.linking,
|
|
38719
38853
|
changeAjaxForms: changeAjaxForms,
|
|
38720
38854
|
getApiBaseUrl: getApiBaseUrl,
|
|
38721
38855
|
getAppHeader: getAppHeader,
|
|
@@ -38723,11 +38857,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38723
38857
|
getToken: getToken,
|
|
38724
38858
|
app: app,
|
|
38725
38859
|
valueOnlyString: true
|
|
38726
|
-
}) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](
|
|
38860
|
+
}) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
|
|
38861
|
+
...inputData,
|
|
38727
38862
|
maxWidth,
|
|
38728
38863
|
staticWidth,
|
|
38729
38864
|
fullWidth
|
|
38730
|
-
}
|
|
38865
|
+
}, {
|
|
38731
38866
|
form: MainForm,
|
|
38732
38867
|
forms: options,
|
|
38733
38868
|
allForms: plainForms,
|
|
@@ -38748,10 +38883,10 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38748
38883
|
staticWidth,
|
|
38749
38884
|
fullWidth
|
|
38750
38885
|
}) : console.log(input)
|
|
38751
|
-
})
|
|
38886
|
+
}), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38752
38887
|
className: "code",
|
|
38753
38888
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
38754
|
-
children:
|
|
38889
|
+
children: input.meta?.code
|
|
38755
38890
|
})
|
|
38756
38891
|
}) : null]
|
|
38757
38892
|
}), maxRule ? ["imageUpload", "upload", "videoUpload"].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -38771,10 +38906,10 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38771
38906
|
className: "max-char-span",
|
|
38772
38907
|
children: t("max-char", {
|
|
38773
38908
|
chars: maxRule,
|
|
38774
|
-
filled:
|
|
38909
|
+
filled: inputData?.value?.length || 0
|
|
38775
38910
|
})
|
|
38776
38911
|
})
|
|
38777
|
-
}) : null,
|
|
38912
|
+
}) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38778
38913
|
className: "input-content",
|
|
38779
38914
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38780
38915
|
className: "comment-textarea",
|
|
@@ -38800,7 +38935,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38800
38935
|
},
|
|
38801
38936
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38802
38937
|
type: "link",
|
|
38803
|
-
disabled: !
|
|
38938
|
+
disabled: !input.meta?.comment,
|
|
38804
38939
|
className: "p-0",
|
|
38805
38940
|
children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
|
|
38806
38941
|
width: 16,
|
|
@@ -38809,11 +38944,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38809
38944
|
})
|
|
38810
38945
|
})]
|
|
38811
38946
|
}),
|
|
38812
|
-
children: inputTypeComponent$1.comment(
|
|
38947
|
+
children: inputTypeComponent$1.comment({
|
|
38948
|
+
...inputData,
|
|
38813
38949
|
maxWidth,
|
|
38814
38950
|
staticWidth,
|
|
38815
38951
|
fullWidth
|
|
38816
|
-
}
|
|
38952
|
+
}, {
|
|
38817
38953
|
form: MainForm,
|
|
38818
38954
|
forms: options,
|
|
38819
38955
|
setFormValues: setValues,
|
|
@@ -38838,16 +38974,16 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38838
38974
|
className: "max-char-span",
|
|
38839
38975
|
children: t("max-char", {
|
|
38840
38976
|
chars: MAX_COMMENTS_LENGTH,
|
|
38841
|
-
filled:
|
|
38977
|
+
filled: inputData?.commentValue?.length || 0
|
|
38842
38978
|
})
|
|
38843
38979
|
})]
|
|
38844
|
-
}) : null, lastReview
|
|
38980
|
+
}) : null, lastReview?.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38845
38981
|
className: "input-content",
|
|
38846
38982
|
children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
38847
38983
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38848
38984
|
className: "comment-textarea",
|
|
38849
|
-
initialValue:
|
|
38850
|
-
name:
|
|
38985
|
+
initialValue: lastReview?.comment || "",
|
|
38986
|
+
name: `${inputId}-reviewErrorComment`,
|
|
38851
38987
|
label: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38852
38988
|
className: "flex w-100",
|
|
38853
38989
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -38855,28 +38991,31 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38855
38991
|
children: t("Review note")
|
|
38856
38992
|
})
|
|
38857
38993
|
}),
|
|
38858
|
-
children: inputTypeComponent$1.comment(
|
|
38994
|
+
children: inputTypeComponent$1.comment({
|
|
38995
|
+
...inputData,
|
|
38859
38996
|
maxWidth,
|
|
38860
38997
|
staticWidth,
|
|
38861
38998
|
fullWidth
|
|
38862
|
-
}
|
|
38999
|
+
}, {
|
|
38863
39000
|
form: MainForm,
|
|
38864
39001
|
forms: options,
|
|
38865
|
-
value:
|
|
39002
|
+
value: lastReview?.comment || "",
|
|
38866
39003
|
onChange: val => {
|
|
38867
39004
|
changeInputMeta({
|
|
38868
39005
|
key: inputId,
|
|
38869
39006
|
type: input.type,
|
|
38870
|
-
value:
|
|
38871
|
-
|
|
39007
|
+
value: {
|
|
39008
|
+
...inputMeta,
|
|
39009
|
+
reviews: (inputMeta?.reviews || []).map(v => {
|
|
38872
39010
|
if (v.createdAt === lastReview.createdAt) {
|
|
38873
|
-
return
|
|
39011
|
+
return {
|
|
39012
|
+
...v,
|
|
38874
39013
|
comment: val
|
|
38875
|
-
}
|
|
39014
|
+
};
|
|
38876
39015
|
}
|
|
38877
39016
|
return v;
|
|
38878
39017
|
})
|
|
38879
|
-
}
|
|
39018
|
+
}
|
|
38880
39019
|
});
|
|
38881
39020
|
},
|
|
38882
39021
|
t,
|
|
@@ -38890,7 +39029,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38890
39029
|
className: "max-char-span",
|
|
38891
39030
|
children: t("max-char", {
|
|
38892
39031
|
chars: MAX_COMMENTS_LENGTH,
|
|
38893
|
-
filled:
|
|
39032
|
+
filled: lastReview.comment?.length || 0
|
|
38894
39033
|
})
|
|
38895
39034
|
})]
|
|
38896
39035
|
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -38911,7 +39050,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38911
39050
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38912
39051
|
className: "flex flex-column justify-center mr-1",
|
|
38913
39052
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
38914
|
-
children:
|
|
39053
|
+
children: lastReview?.reviewer?.firstName + " " + lastReview?.reviewer?.lastName + " - " + moment__default["default"](lastReview.createdAt).format("DD MMM YYYY")
|
|
38915
39054
|
})
|
|
38916
39055
|
})]
|
|
38917
39056
|
})]
|
|
@@ -38922,14 +39061,13 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38922
39061
|
return null;
|
|
38923
39062
|
}
|
|
38924
39063
|
};
|
|
38925
|
-
const editErrorHandler =
|
|
38926
|
-
|
|
38927
|
-
|
|
38928
|
-
|
|
38929
|
-
} = _ref76;
|
|
39064
|
+
const editErrorHandler = ({
|
|
39065
|
+
errorFields,
|
|
39066
|
+
t = s => s
|
|
39067
|
+
}) => {
|
|
38930
39068
|
if (Array.isArray(errorFields) && errorFields.length) {
|
|
38931
39069
|
const name = errorFields[0].name.join(".");
|
|
38932
|
-
const element = document.querySelector(
|
|
39070
|
+
const element = document.querySelector(`[data-id="${name}"]`);
|
|
38933
39071
|
if (element) {
|
|
38934
39072
|
element.scrollIntoView();
|
|
38935
39073
|
antd.message.error(t("errors::please-correct-invalid-inputs"));
|
|
@@ -42019,10 +42157,7 @@ const useCombinedPrefilledValues = (combinedPrefilledValues, values, parentValue
|
|
|
42019
42157
|
}
|
|
42020
42158
|
});
|
|
42021
42159
|
if (hasChanges) {
|
|
42022
|
-
setValues(prevValues => ({
|
|
42023
|
-
...prevValues,
|
|
42024
|
-
...resolvedValues
|
|
42025
|
-
}));
|
|
42160
|
+
setValues(prevValues => _objectSpread2(_objectSpread2({}, prevValues), resolvedValues));
|
|
42026
42161
|
MainForm.setFieldsValue(resolvedValues);
|
|
42027
42162
|
}
|
|
42028
42163
|
}, [values, parentValues, combinedPrefilledValues, setValues, MainForm]);
|