datastake-daf 0.6.808 → 0.6.810
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
CHANGED
|
@@ -4778,7 +4778,7 @@ const config$2 = {
|
|
|
4778
4778
|
Down: config$3
|
|
4779
4779
|
};
|
|
4780
4780
|
|
|
4781
|
-
const _excluded$
|
|
4781
|
+
const _excluded$G = ["width", "height", "size", "name", "fill"];
|
|
4782
4782
|
const CustomIcon = _ref => {
|
|
4783
4783
|
let {
|
|
4784
4784
|
width = 14,
|
|
@@ -4787,7 +4787,7 @@ const CustomIcon = _ref => {
|
|
|
4787
4787
|
name = "",
|
|
4788
4788
|
fill = "none"
|
|
4789
4789
|
} = _ref,
|
|
4790
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
4790
|
+
props = _objectWithoutProperties(_ref, _excluded$G);
|
|
4791
4791
|
const conf = config$2[name];
|
|
4792
4792
|
if (conf) {
|
|
4793
4793
|
return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -5076,7 +5076,7 @@ createCommonjsModule(function (module, exports) {
|
|
|
5076
5076
|
!function(e,n){module.exports=n();}(commonjsGlobal,(function(){return {name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var n=["th","st","nd","rd"],t=e%100;return "["+e+(n[(t-20)%10]||n[t]||n[0])+"]"}}}));
|
|
5077
5077
|
});
|
|
5078
5078
|
|
|
5079
|
-
const _excluded$
|
|
5079
|
+
const _excluded$F = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
|
|
5080
5080
|
dayjs__default["default"].extend(customParseFormat);
|
|
5081
5081
|
dayjs__default["default"].extend(utc);
|
|
5082
5082
|
dayjs__default["default"].extend(utc);
|
|
@@ -5452,7 +5452,7 @@ const filterCreateData = data => {
|
|
|
5452
5452
|
createdAt,
|
|
5453
5453
|
updatedAt
|
|
5454
5454
|
} = data,
|
|
5455
|
-
rest = _objectWithoutProperties(data, _excluded$
|
|
5455
|
+
rest = _objectWithoutProperties(data, _excluded$F);
|
|
5456
5456
|
const _meta = isObjectEmpty(meta) ? undefined : meta;
|
|
5457
5457
|
return _objectSpread2(_objectSpread2({}, rest), {}, {
|
|
5458
5458
|
meta: _meta
|
|
@@ -5984,7 +5984,7 @@ SelectFilters.propTypes = {
|
|
|
5984
5984
|
apiUrl: PropTypes__default["default"].string
|
|
5985
5985
|
};
|
|
5986
5986
|
|
|
5987
|
-
const _excluded$
|
|
5987
|
+
const _excluded$E = ["columns", "data", "defaultFilters", "style", "pagination", "loading", "onChange", "onFilterChange", "selectOptions", "filtersConfig", "rowSelection", "setShowFilters", "rowKey", "showFilters", "hideOnLoading", "sourcesKey", "className", "projects", "t", "selectedProject", "sourceId", "projectSources", "language", "scrollX", "apiUrl", "app", "doEmptyRows"];
|
|
5988
5988
|
function DAFTable(_ref) {
|
|
5989
5989
|
let {
|
|
5990
5990
|
columns = [],
|
|
@@ -6015,7 +6015,7 @@ function DAFTable(_ref) {
|
|
|
6015
6015
|
app,
|
|
6016
6016
|
doEmptyRows
|
|
6017
6017
|
} = _ref,
|
|
6018
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
6018
|
+
rest = _objectWithoutProperties(_ref, _excluded$E);
|
|
6019
6019
|
const [source, setSource] = React.useState([]);
|
|
6020
6020
|
const projectData = (projects || []).find(p => p.id === selectedProject);
|
|
6021
6021
|
const [filtersInit, setFiltersInit] = React.useState(!loading);
|
|
@@ -6833,7 +6833,7 @@ function ComponentWithFocus(_ref) {
|
|
|
6833
6833
|
}
|
|
6834
6834
|
|
|
6835
6835
|
var _templateObject$h;
|
|
6836
|
-
const _excluded$
|
|
6836
|
+
const _excluded$D = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
|
|
6837
6837
|
function StickyTable(_ref) {
|
|
6838
6838
|
let {
|
|
6839
6839
|
size = "small",
|
|
@@ -6844,7 +6844,7 @@ function StickyTable(_ref) {
|
|
|
6844
6844
|
pagination = false,
|
|
6845
6845
|
doEmptyRows = true
|
|
6846
6846
|
} = _ref,
|
|
6847
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
6847
|
+
props = _objectWithoutProperties(_ref, _excluded$D);
|
|
6848
6848
|
const data = React__default["default"].useMemo(() => {
|
|
6849
6849
|
if (!doEmptyRows) {
|
|
6850
6850
|
return dataSource;
|
|
@@ -7372,7 +7372,7 @@ const BTN_SIZE = {
|
|
|
7372
7372
|
LG: 'large'
|
|
7373
7373
|
};
|
|
7374
7374
|
|
|
7375
|
-
const _excluded$
|
|
7375
|
+
const _excluded$C = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
|
|
7376
7376
|
function DafButton(_ref) {
|
|
7377
7377
|
let {
|
|
7378
7378
|
content = '',
|
|
@@ -7386,7 +7386,7 @@ function DafButton(_ref) {
|
|
|
7386
7386
|
style = {},
|
|
7387
7387
|
className = ''
|
|
7388
7388
|
} = _ref,
|
|
7389
|
-
restProps = _objectWithoutProperties(_ref, _excluded$
|
|
7389
|
+
restProps = _objectWithoutProperties(_ref, _excluded$C);
|
|
7390
7390
|
return /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
|
|
7391
7391
|
icon: icon,
|
|
7392
7392
|
type: type,
|
|
@@ -7505,12 +7505,12 @@ const Style$R = styled__default["default"].div`
|
|
|
7505
7505
|
}
|
|
7506
7506
|
`;
|
|
7507
7507
|
|
|
7508
|
-
const _excluded$
|
|
7508
|
+
const _excluded$B = ["children"];
|
|
7509
7509
|
const BorderedButton = _ref => {
|
|
7510
7510
|
let {
|
|
7511
7511
|
children
|
|
7512
7512
|
} = _ref,
|
|
7513
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
7513
|
+
props = _objectWithoutProperties(_ref, _excluded$B);
|
|
7514
7514
|
return /*#__PURE__*/jsxRuntime.jsx(Style$R, {
|
|
7515
7515
|
className: "d-btn-cont",
|
|
7516
7516
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -7650,12 +7650,12 @@ Badge.propTypes = {
|
|
|
7650
7650
|
props: PropTypes__default["default"].object
|
|
7651
7651
|
};
|
|
7652
7652
|
|
|
7653
|
-
const _excluded$
|
|
7653
|
+
const _excluded$A = ["icon"];
|
|
7654
7654
|
function GetIcon(_ref) {
|
|
7655
7655
|
let {
|
|
7656
7656
|
icon
|
|
7657
7657
|
} = _ref,
|
|
7658
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
7658
|
+
props = _objectWithoutProperties(_ref, _excluded$A);
|
|
7659
7659
|
let Icon = Icons__namespace.CloseOutlined;
|
|
7660
7660
|
if (Icons__namespace[icon]) {
|
|
7661
7661
|
Icon = Icons__namespace[icon];
|
|
@@ -7985,7 +7985,7 @@ const MultiSelectStyled = styled__default["default"](antd.Select)`
|
|
|
7985
7985
|
}
|
|
7986
7986
|
`;
|
|
7987
7987
|
|
|
7988
|
-
const _excluded$
|
|
7988
|
+
const _excluded$z = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
|
|
7989
7989
|
const {
|
|
7990
7990
|
useToken: useToken$n
|
|
7991
7991
|
} = antd.theme;
|
|
@@ -8078,7 +8078,7 @@ function Multiselect(_ref) {
|
|
|
8078
8078
|
isSingle = false,
|
|
8079
8079
|
selectionType = SELECTION_TYPES.DEFAULT
|
|
8080
8080
|
} = _ref,
|
|
8081
|
-
restProps = _objectWithoutProperties(_ref, _excluded$
|
|
8081
|
+
restProps = _objectWithoutProperties(_ref, _excluded$z);
|
|
8082
8082
|
const {
|
|
8083
8083
|
token
|
|
8084
8084
|
} = useToken$n();
|
|
@@ -8798,7 +8798,7 @@ DAFHeader.propTypes = {
|
|
|
8798
8798
|
filtersConfig: PropTypes__default["default"].any
|
|
8799
8799
|
};
|
|
8800
8800
|
|
|
8801
|
-
const _excluded$
|
|
8801
|
+
const _excluded$y = ["tabs", "onChange", "value", "className"];
|
|
8802
8802
|
function TabsHeader(_ref) {
|
|
8803
8803
|
let {
|
|
8804
8804
|
tabs = [],
|
|
@@ -8806,7 +8806,7 @@ function TabsHeader(_ref) {
|
|
|
8806
8806
|
value = '',
|
|
8807
8807
|
className = 'mt-2'
|
|
8808
8808
|
} = _ref,
|
|
8809
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
8809
|
+
rest = _objectWithoutProperties(_ref, _excluded$y);
|
|
8810
8810
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8811
8811
|
className: formatClassname(['daf-tabs-header pl-6 pr-6', className]),
|
|
8812
8812
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Tabs, _objectSpread2({
|
|
@@ -8903,7 +8903,7 @@ DrawerHeader.propTypes = {
|
|
|
8903
8903
|
tabsConfig: PropTypes__default["default"].any
|
|
8904
8904
|
};
|
|
8905
8905
|
|
|
8906
|
-
const _excluded$
|
|
8906
|
+
const _excluded$x = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
|
|
8907
8907
|
const useFooter = _ref => {
|
|
8908
8908
|
let {
|
|
8909
8909
|
leftContent,
|
|
@@ -8938,7 +8938,7 @@ const useFooter = _ref => {
|
|
|
8938
8938
|
style = {},
|
|
8939
8939
|
className = ""
|
|
8940
8940
|
} = button,
|
|
8941
|
-
restProps = _objectWithoutProperties(button, _excluded$
|
|
8941
|
+
restProps = _objectWithoutProperties(button, _excluded$x);
|
|
8942
8942
|
return /*#__PURE__*/jsxRuntime.jsx(DafButton, _objectSpread2({
|
|
8943
8943
|
content: label,
|
|
8944
8944
|
type: type,
|
|
@@ -11819,7 +11819,7 @@ Widget.propTypes = {
|
|
|
11819
11819
|
};
|
|
11820
11820
|
Widget.displayName = 'Widget';
|
|
11821
11821
|
|
|
11822
|
-
const _excluded$
|
|
11822
|
+
const _excluded$w = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
|
|
11823
11823
|
function ImageWidget(_ref) {
|
|
11824
11824
|
let {
|
|
11825
11825
|
loading = false,
|
|
@@ -11830,7 +11830,7 @@ function ImageWidget(_ref) {
|
|
|
11830
11830
|
noDescriptionText,
|
|
11831
11831
|
isPdf = false
|
|
11832
11832
|
} = _ref,
|
|
11833
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
11833
|
+
props = _objectWithoutProperties(_ref, _excluded$w);
|
|
11834
11834
|
const expandable = isPdf ? false : props.expandable;
|
|
11835
11835
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
11836
11836
|
loading: loading,
|
|
@@ -11890,7 +11890,7 @@ function ImageWidget(_ref) {
|
|
|
11890
11890
|
ImageWidget.displayName = 'ImageWidget';
|
|
11891
11891
|
|
|
11892
11892
|
var _templateObject$e;
|
|
11893
|
-
const _excluded$
|
|
11893
|
+
const _excluded$v = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
|
|
11894
11894
|
function FlowWidget(_ref) {
|
|
11895
11895
|
let {
|
|
11896
11896
|
title,
|
|
@@ -11902,7 +11902,7 @@ function FlowWidget(_ref) {
|
|
|
11902
11902
|
className,
|
|
11903
11903
|
direction = "horizontal"
|
|
11904
11904
|
} = _ref,
|
|
11905
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11905
|
+
rest = _objectWithoutProperties(_ref, _excluded$v);
|
|
11906
11906
|
const [activeTab, setActiveTab] = React.useState();
|
|
11907
11907
|
React.useEffect(() => {
|
|
11908
11908
|
if (defaultActiveTab) {
|
|
@@ -15618,7 +15618,7 @@ Map$3.propTypes = {
|
|
|
15618
15618
|
link: PropTypes__default["default"].any
|
|
15619
15619
|
};
|
|
15620
15620
|
|
|
15621
|
-
const _excluded$
|
|
15621
|
+
const _excluded$u = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
|
|
15622
15622
|
function InExpandableWidgetMap(_ref) {
|
|
15623
15623
|
let {
|
|
15624
15624
|
isExpanded,
|
|
@@ -15632,7 +15632,7 @@ function InExpandableWidgetMap(_ref) {
|
|
|
15632
15632
|
height,
|
|
15633
15633
|
widgetConfig
|
|
15634
15634
|
} = _ref,
|
|
15635
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
15635
|
+
rest = _objectWithoutProperties(_ref, _excluded$u);
|
|
15636
15636
|
const [mapKey, setMapKey] = React.useState(0);
|
|
15637
15637
|
const [isMapReady, setIsMapReady] = React.useState(false);
|
|
15638
15638
|
React.useEffect(() => {
|
|
@@ -17832,14 +17832,14 @@ const MapConfig = ({
|
|
|
17832
17832
|
});
|
|
17833
17833
|
};
|
|
17834
17834
|
|
|
17835
|
-
const _excluded$
|
|
17835
|
+
const _excluded$t = ["config", "title", "loading"];
|
|
17836
17836
|
const Details = _ref => {
|
|
17837
17837
|
let {
|
|
17838
17838
|
config = [],
|
|
17839
17839
|
title,
|
|
17840
17840
|
loading = false
|
|
17841
17841
|
} = _ref,
|
|
17842
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17842
|
+
rest = _objectWithoutProperties(_ref, _excluded$t);
|
|
17843
17843
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
17844
17844
|
className: "with-border-header h-w-btn-header card",
|
|
17845
17845
|
loading: loading,
|
|
@@ -17855,14 +17855,14 @@ const Details = _ref => {
|
|
|
17855
17855
|
}));
|
|
17856
17856
|
};
|
|
17857
17857
|
|
|
17858
|
-
const _excluded$
|
|
17858
|
+
const _excluded$s = ["config", "title", "loading"];
|
|
17859
17859
|
const KeyIndicatorsDetails = _ref => {
|
|
17860
17860
|
let {
|
|
17861
17861
|
config,
|
|
17862
17862
|
title,
|
|
17863
17863
|
loading = false
|
|
17864
17864
|
} = _ref,
|
|
17865
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17865
|
+
rest = _objectWithoutProperties(_ref, _excluded$s);
|
|
17866
17866
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
17867
17867
|
className: "with-border-header h-w-btn-header",
|
|
17868
17868
|
title: title,
|
|
@@ -17892,7 +17892,7 @@ const Style$G = styled__default["default"].div`
|
|
|
17892
17892
|
}
|
|
17893
17893
|
`;
|
|
17894
17894
|
|
|
17895
|
-
const _excluded$
|
|
17895
|
+
const _excluded$r = ["children", "config", "detailsTitle", "firstColumnWidth"];
|
|
17896
17896
|
const DetailsSection = _ref => {
|
|
17897
17897
|
let {
|
|
17898
17898
|
children,
|
|
@@ -17900,7 +17900,7 @@ const DetailsSection = _ref => {
|
|
|
17900
17900
|
detailsTitle,
|
|
17901
17901
|
firstColumnWidth = "250px"
|
|
17902
17902
|
} = _ref,
|
|
17903
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17903
|
+
rest = _objectWithoutProperties(_ref, _excluded$r);
|
|
17904
17904
|
return /*#__PURE__*/jsxRuntime.jsx(Style$G, {
|
|
17905
17905
|
firstColumnWidth: firstColumnWidth,
|
|
17906
17906
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -18076,14 +18076,14 @@ const getGoalConfig = () => {
|
|
|
18076
18076
|
};
|
|
18077
18077
|
|
|
18078
18078
|
var _templateObject$c;
|
|
18079
|
-
const _excluded$
|
|
18079
|
+
const _excluded$q = ["title", "activeSdgGoals", "t"];
|
|
18080
18080
|
function SDGWidget(_ref) {
|
|
18081
18081
|
let {
|
|
18082
18082
|
title = "Sustainable Development Goals",
|
|
18083
18083
|
activeSdgGoals = [],
|
|
18084
18084
|
t = key => key
|
|
18085
18085
|
} = _ref,
|
|
18086
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18086
|
+
props = _objectWithoutProperties(_ref, _excluded$q);
|
|
18087
18087
|
const sdgConfig = getGoalConfig();
|
|
18088
18088
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
18089
18089
|
title: title,
|
|
@@ -18381,7 +18381,7 @@ function SdgList({
|
|
|
18381
18381
|
});
|
|
18382
18382
|
}
|
|
18383
18383
|
|
|
18384
|
-
const _excluded$
|
|
18384
|
+
const _excluded$p = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
|
|
18385
18385
|
const {
|
|
18386
18386
|
Meta
|
|
18387
18387
|
} = antd.Card;
|
|
@@ -18401,7 +18401,7 @@ function ProjectWidget(_ref) {
|
|
|
18401
18401
|
hideSDGList = false,
|
|
18402
18402
|
t = x => x
|
|
18403
18403
|
} = _ref,
|
|
18404
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18404
|
+
props = _objectWithoutProperties(_ref, _excluded$p);
|
|
18405
18405
|
const [isHovered, setIsHovered] = React__default["default"].useState(false);
|
|
18406
18406
|
const {
|
|
18407
18407
|
token
|
|
@@ -18673,13 +18673,13 @@ const WidgetCard = _ref => {
|
|
|
18673
18673
|
});
|
|
18674
18674
|
};
|
|
18675
18675
|
|
|
18676
|
-
const _excluded$
|
|
18676
|
+
const _excluded$o = ["title", "children"];
|
|
18677
18677
|
const CarouselWidget = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
18678
18678
|
let {
|
|
18679
18679
|
title,
|
|
18680
18680
|
children
|
|
18681
18681
|
} = _ref,
|
|
18682
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
18682
|
+
rest = _objectWithoutProperties(_ref, _excluded$o);
|
|
18683
18683
|
/**
|
|
18684
18684
|
* Handles carousel slide change events
|
|
18685
18685
|
* @param {number} currentSlide - The index of the current slide after change
|
|
@@ -18843,7 +18843,7 @@ const EmptyStateContainer = styled__default["default"].div`
|
|
|
18843
18843
|
}
|
|
18844
18844
|
`;
|
|
18845
18845
|
|
|
18846
|
-
const _excluded$
|
|
18846
|
+
const _excluded$n = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
|
|
18847
18847
|
function ImageCarousel(_ref) {
|
|
18848
18848
|
let {
|
|
18849
18849
|
title,
|
|
@@ -18858,7 +18858,7 @@ function ImageCarousel(_ref) {
|
|
|
18858
18858
|
emptyLogo = antd.Empty.PRESENTED_IMAGE_SIMPLE,
|
|
18859
18859
|
emptyText = "No Image"
|
|
18860
18860
|
} = _ref,
|
|
18861
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
18861
|
+
rest = _objectWithoutProperties(_ref, _excluded$n);
|
|
18862
18862
|
const [previewVisible, setPreviewVisible] = React.useState(false);
|
|
18863
18863
|
const [current, setCurrent] = React.useState(0);
|
|
18864
18864
|
const carouselRef = React.useRef(null);
|
|
@@ -19227,7 +19227,7 @@ const getVegetationConfig = () => {
|
|
|
19227
19227
|
};
|
|
19228
19228
|
|
|
19229
19229
|
var _templateObject$a, _templateObject2$3;
|
|
19230
|
-
const _excluded$
|
|
19230
|
+
const _excluded$m = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
|
|
19231
19231
|
function VegetationWidget(_ref) {
|
|
19232
19232
|
let {
|
|
19233
19233
|
title = "Vegetation Health",
|
|
@@ -19239,7 +19239,7 @@ function VegetationWidget(_ref) {
|
|
|
19239
19239
|
growthObservations = [],
|
|
19240
19240
|
t = key => key
|
|
19241
19241
|
} = _ref,
|
|
19242
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19242
|
+
props = _objectWithoutProperties(_ref, _excluded$m);
|
|
19243
19243
|
let vegetationConfig = getVegetationConfig();
|
|
19244
19244
|
|
|
19245
19245
|
// Get all VEGETATION_KEYS values before filtering (needed for mapping check)
|
|
@@ -19362,7 +19362,7 @@ const getFaunaConfig = () => {
|
|
|
19362
19362
|
};
|
|
19363
19363
|
|
|
19364
19364
|
var _templateObject$9, _templateObject2$2;
|
|
19365
|
-
const _excluded$
|
|
19365
|
+
const _excluded$l = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
|
|
19366
19366
|
function FaunaWidget(_ref) {
|
|
19367
19367
|
let {
|
|
19368
19368
|
title = "Observed Fauna",
|
|
@@ -19373,7 +19373,7 @@ function FaunaWidget(_ref) {
|
|
|
19373
19373
|
itemHeight = 100,
|
|
19374
19374
|
t = key => key
|
|
19375
19375
|
} = _ref,
|
|
19376
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19376
|
+
props = _objectWithoutProperties(_ref, _excluded$l);
|
|
19377
19377
|
let faunaConfig = getFaunaConfig();
|
|
19378
19378
|
|
|
19379
19379
|
// Filter to show only specific keys if filterKeys is provided
|
|
@@ -19440,7 +19440,7 @@ const getInvasiveSpeciesConfig = () => {
|
|
|
19440
19440
|
};
|
|
19441
19441
|
|
|
19442
19442
|
var _templateObject$8, _templateObject2$1;
|
|
19443
|
-
const _excluded$
|
|
19443
|
+
const _excluded$k = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
|
|
19444
19444
|
function InvasiveSpeciesWidget(_ref) {
|
|
19445
19445
|
let {
|
|
19446
19446
|
title = "Invasive Species",
|
|
@@ -19452,7 +19452,7 @@ function InvasiveSpeciesWidget(_ref) {
|
|
|
19452
19452
|
itemHeight = 100,
|
|
19453
19453
|
t = key => key
|
|
19454
19454
|
} = _ref,
|
|
19455
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19455
|
+
props = _objectWithoutProperties(_ref, _excluded$k);
|
|
19456
19456
|
let invasiveSpeciesConfig = getInvasiveSpeciesConfig();
|
|
19457
19457
|
|
|
19458
19458
|
// Filter to show only specific keys if filterKeys is provided
|
|
@@ -24875,8 +24875,8 @@ const RepeatableModals = ({
|
|
|
24875
24875
|
}) : null;
|
|
24876
24876
|
};
|
|
24877
24877
|
|
|
24878
|
-
const _excluded$
|
|
24879
|
-
_excluded2$
|
|
24878
|
+
const _excluded$j = ["viewGroup"],
|
|
24879
|
+
_excluded2$1 = ["label", "icon", "position"];
|
|
24880
24880
|
const Content$1 = _ref => {
|
|
24881
24881
|
let {
|
|
24882
24882
|
style = {},
|
|
@@ -24947,7 +24947,7 @@ const Content$1 = _ref => {
|
|
|
24947
24947
|
if (groups[gKey].viewGroup === key) {
|
|
24948
24948
|
// eslint-disable-next-line no-unused-vars
|
|
24949
24949
|
const _groups$gKey = groups[gKey],
|
|
24950
|
-
gCfg = _objectWithoutProperties(_groups$gKey, _excluded$
|
|
24950
|
+
gCfg = _objectWithoutProperties(_groups$gKey, _excluded$j);
|
|
24951
24951
|
items[gKey] = gCfg;
|
|
24952
24952
|
}
|
|
24953
24953
|
return items;
|
|
@@ -25175,7 +25175,7 @@ const Content$1 = _ref => {
|
|
|
25175
25175
|
showIcon: true
|
|
25176
25176
|
});
|
|
25177
25177
|
}
|
|
25178
|
-
let groups = _objectWithoutProperties(f, _excluded2$
|
|
25178
|
+
let groups = _objectWithoutProperties(f, _excluded2$1);
|
|
25179
25179
|
groups = Object.keys(groups).reduce((items, key) => {
|
|
25180
25180
|
var _groups$key2;
|
|
25181
25181
|
if (!((_groups$key2 = groups[key]) !== null && _groups$key2 !== void 0 && (_groups$key2 = _groups$key2.meta) !== null && _groups$key2 !== void 0 && _groups$key2.excludeFromView)) {
|
|
@@ -25227,7 +25227,7 @@ const Content$1 = _ref => {
|
|
|
25227
25227
|
});
|
|
25228
25228
|
};
|
|
25229
25229
|
|
|
25230
|
-
const _excluded$
|
|
25230
|
+
const _excluded$i = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
|
|
25231
25231
|
function Modal(_ref) {
|
|
25232
25232
|
let {
|
|
25233
25233
|
t = text => text,
|
|
@@ -25243,7 +25243,7 @@ function Modal(_ref) {
|
|
|
25243
25243
|
disabled = false,
|
|
25244
25244
|
withModalFormWrapper = true
|
|
25245
25245
|
} = _ref,
|
|
25246
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
25246
|
+
props = _objectWithoutProperties(_ref, _excluded$i);
|
|
25247
25247
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Modal, _objectSpread2(_objectSpread2({
|
|
25248
25248
|
width: 650,
|
|
25249
25249
|
footer: null,
|
|
@@ -30737,6 +30737,7 @@ function Repeatable({
|
|
|
30737
30737
|
});
|
|
30738
30738
|
}
|
|
30739
30739
|
|
|
30740
|
+
/* eslint-disable no-eval */
|
|
30740
30741
|
const isRiskComment = inputData => {
|
|
30741
30742
|
if (inputData) {
|
|
30742
30743
|
if (inputData.name === 'assessment') {
|
|
@@ -30749,10 +30750,7 @@ const isRiskComment = inputData => {
|
|
|
30749
30750
|
};
|
|
30750
30751
|
|
|
30751
30752
|
// options, k, setValues, values, excludedKeys, i, formTitles, getData, MainForm, plainForms, setAddress, onValuesChange, data, allData, changeLinking, changeInputMeta, t, highlightMandatory
|
|
30752
|
-
function renderNestedInputs$1(options, k) {
|
|
30753
|
-
for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
30754
|
-
args[_key - 2] = arguments[_key];
|
|
30755
|
-
}
|
|
30753
|
+
function renderNestedInputs$1(options, k, ...args) {
|
|
30756
30754
|
if (options[k].repeatable) {
|
|
30757
30755
|
return renderRepeatable$1(options, k, ...args);
|
|
30758
30756
|
} else {
|
|
@@ -30780,11 +30778,10 @@ function renderRepeatable$1(options, k, setValues, values, excludedKeys, i, form
|
|
|
30780
30778
|
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, {
|
|
30781
30779
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
|
|
30782
30780
|
name: formId,
|
|
30783
|
-
children: (fields,
|
|
30784
|
-
|
|
30785
|
-
|
|
30786
|
-
|
|
30787
|
-
} = _ref;
|
|
30781
|
+
children: (fields, {
|
|
30782
|
+
add,
|
|
30783
|
+
remove
|
|
30784
|
+
}) => {
|
|
30788
30785
|
const formData = form.repeatable ? values[formId] || [] : values[formId] ? [values[formId]] : [];
|
|
30789
30786
|
if (fields.length === 0) {
|
|
30790
30787
|
const formInputs = form.inputs;
|
|
@@ -30834,10 +30831,14 @@ function renderRepeatable$1(options, k, setValues, values, excludedKeys, i, form
|
|
|
30834
30831
|
const _val = {
|
|
30835
30832
|
[formId]: formData.map((d, j) => i === j ? val : d)
|
|
30836
30833
|
};
|
|
30837
|
-
onValuesChange(_val,
|
|
30838
|
-
|
|
30834
|
+
onValuesChange(_val, {
|
|
30835
|
+
...values,
|
|
30836
|
+
..._val
|
|
30837
|
+
});
|
|
30838
|
+
setValues({
|
|
30839
|
+
...values,
|
|
30839
30840
|
[formId]: formData.map((d, j) => i === j ? val : d)
|
|
30840
|
-
})
|
|
30841
|
+
});
|
|
30841
30842
|
};
|
|
30842
30843
|
return /*#__PURE__*/jsxRuntime.jsx(Repeatable, {
|
|
30843
30844
|
form: form,
|
|
@@ -30893,156 +30894,154 @@ const getGroupContent = (form, values, i, formId, excludedKeys, getData, setValu
|
|
|
30893
30894
|
highlightMandatory
|
|
30894
30895
|
});
|
|
30895
30896
|
};
|
|
30896
|
-
const GroupContent =
|
|
30897
|
-
|
|
30898
|
-
|
|
30899
|
-
|
|
30900
|
-
|
|
30901
|
-
|
|
30902
|
-
|
|
30903
|
-
|
|
30904
|
-
|
|
30905
|
-
|
|
30906
|
-
|
|
30907
|
-
|
|
30908
|
-
|
|
30909
|
-
|
|
30910
|
-
|
|
30911
|
-
|
|
30912
|
-
|
|
30913
|
-
highlightMandatory
|
|
30914
|
-
} = _ref2;
|
|
30897
|
+
const GroupContent = ({
|
|
30898
|
+
form,
|
|
30899
|
+
values = {},
|
|
30900
|
+
i,
|
|
30901
|
+
formId,
|
|
30902
|
+
excludedKeys,
|
|
30903
|
+
getData,
|
|
30904
|
+
setValues,
|
|
30905
|
+
MainForm,
|
|
30906
|
+
options,
|
|
30907
|
+
plainForms,
|
|
30908
|
+
setAddress,
|
|
30909
|
+
onValuesChange,
|
|
30910
|
+
allData,
|
|
30911
|
+
changeInputMeta,
|
|
30912
|
+
highlightMandatory
|
|
30913
|
+
}) => {
|
|
30915
30914
|
const {
|
|
30916
30915
|
user,
|
|
30917
30916
|
t
|
|
30918
30917
|
} = useEditContext();
|
|
30919
30918
|
const label = getInputLabel$1(form, values);
|
|
30920
|
-
const notPartOfTheForm =
|
|
30919
|
+
const notPartOfTheForm = form?.type === 'ajaxSubGroup' ? true : !!form?.meta?.isSubGroup;
|
|
30921
30920
|
const hasLabel = label && (typeof label === 'string' && (label || '').trim() !== '' || typeof label === 'object') ? true : false;
|
|
30922
30921
|
const formValues = values[form.dataId];
|
|
30923
|
-
const renderInputs = () => {
|
|
30924
|
-
|
|
30925
|
-
|
|
30926
|
-
|
|
30927
|
-
|
|
30928
|
-
|
|
30929
|
-
|
|
30930
|
-
|
|
30931
|
-
|
|
30932
|
-
|
|
30933
|
-
|
|
30934
|
-
|
|
30935
|
-
|
|
30936
|
-
|
|
30937
|
-
|
|
30938
|
-
|
|
30939
|
-
|
|
30940
|
-
|
|
30941
|
-
|
|
30942
|
-
inputData.
|
|
30943
|
-
|
|
30944
|
-
|
|
30945
|
-
|
|
30946
|
-
|
|
30947
|
-
|
|
30948
|
-
|
|
30949
|
-
|
|
30922
|
+
const renderInputs = () => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
30923
|
+
children: [form?.meta?.groupInfo ? /*#__PURE__*/jsxRuntime.jsx(GroupInfos, {
|
|
30924
|
+
config: form.meta.groupInfo,
|
|
30925
|
+
user: user,
|
|
30926
|
+
t: t
|
|
30927
|
+
}) : null, Object.keys(form.inputs || {}).filter(i => !excludedKeys.includes(i)).map((inp, ii) => {
|
|
30928
|
+
const isAjaxSubGroup = form?.type === "ajaxSubGroup";
|
|
30929
|
+
const input = form.inputs[inp];
|
|
30930
|
+
const inputId = input.dataId || inp;
|
|
30931
|
+
const inputValues = notPartOfTheForm ? Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {} : values;
|
|
30932
|
+
const value = inputValues[inputId];
|
|
30933
|
+
const commentValue = inputValues[`${inputId}Comment`];
|
|
30934
|
+
const inputData = getData(formId, input, value, commentValue, `${formId}.${inputId}`, `${formId}.${inputId}`);
|
|
30935
|
+
const subtitles = form.subtitles || null;
|
|
30936
|
+
const inputMeta = notPartOfTheForm ? isAjaxSubGroup ? (values[formId] || {})?.meta?.inputs?.[inputId] || {} : ((values?.meta?.inputs || {})[formId] || {})[inputId] || {} : (values?.meta?.inputs || {})[inputId] || {};
|
|
30937
|
+
inputData.repeatIndex = undefined;
|
|
30938
|
+
inputData.inputName = inputId;
|
|
30939
|
+
inputData.repeatValues = inputValues;
|
|
30940
|
+
if (inputData.groupInputs && Array.isArray(inputData.groupInputs)) {
|
|
30941
|
+
inputData.groupInputs = inputData.groupInputs.map(gpI => {
|
|
30942
|
+
gpI.data.inputName = gpI.data.name;
|
|
30943
|
+
gpI.data.repeatIndex = undefined;
|
|
30944
|
+
gpI.data.name = formId;
|
|
30945
|
+
return gpI;
|
|
30946
|
+
});
|
|
30947
|
+
}
|
|
30948
|
+
const isRisk = isRiskComment(inputData);
|
|
30949
|
+
const isHighlighted = highlightMandatory && input?.meta?.mandatory && inputIsEmpty(input, inputValues, inputMeta);
|
|
30950
|
+
const btnOnClick = () => {
|
|
30951
|
+
if (typeof inputData.commentValue === 'string') {
|
|
30952
|
+
onValuesChange({}, {
|
|
30953
|
+
...values,
|
|
30954
|
+
[`${inputData.inputName}`]: null
|
|
30950
30955
|
});
|
|
30951
30956
|
}
|
|
30952
|
-
const
|
|
30953
|
-
|
|
30954
|
-
|
|
30955
|
-
|
|
30956
|
-
|
|
30957
|
-
|
|
30958
|
-
|
|
30959
|
-
|
|
30957
|
+
const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
|
|
30958
|
+
inputValues[`${inputData.inputName}Comment`] = typeof inputData.commentValue !== 'string' ? '' : null;
|
|
30959
|
+
if (Array.isArray(values[formId])) {
|
|
30960
|
+
values[formId] = inputValues;
|
|
30961
|
+
} else {
|
|
30962
|
+
values[formId] = inputValues;
|
|
30963
|
+
}
|
|
30964
|
+
setValues({
|
|
30965
|
+
...values
|
|
30966
|
+
});
|
|
30967
|
+
};
|
|
30968
|
+
const btnOnClick2 = () => {
|
|
30969
|
+
if (typeof inputData.commentValue !== 'string') {
|
|
30960
30970
|
const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
|
|
30961
|
-
inputValues[
|
|
30971
|
+
inputValues[`${inputData.inputName}Comment`] = typeof inputData.commentValue !== 'string' ? '' : null;
|
|
30962
30972
|
if (Array.isArray(values[formId])) {
|
|
30963
30973
|
values[formId] = inputValues;
|
|
30964
30974
|
} else {
|
|
30965
30975
|
values[formId] = inputValues;
|
|
30966
30976
|
}
|
|
30967
|
-
setValues(
|
|
30968
|
-
|
|
30969
|
-
const btnOnClick2 = () => {
|
|
30970
|
-
if (typeof inputData.commentValue !== 'string') {
|
|
30971
|
-
const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
|
|
30972
|
-
inputValues["".concat(inputData.inputName, "Comment")] = typeof inputData.commentValue !== 'string' ? '' : null;
|
|
30973
|
-
if (Array.isArray(values[formId])) {
|
|
30974
|
-
values[formId] = inputValues;
|
|
30975
|
-
} else {
|
|
30976
|
-
values[formId] = inputValues;
|
|
30977
|
-
}
|
|
30978
|
-
setValues(_objectSpread2({}, values));
|
|
30979
|
-
}
|
|
30980
|
-
};
|
|
30981
|
-
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 => {
|
|
30982
|
-
if (rule.metaIf && typeof rule.metaIf === 'string') {
|
|
30983
|
-
var _values$meta3, _values$meta4;
|
|
30984
|
-
const [name, cond, value] = rule.metaIf.split(' ');
|
|
30985
|
-
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]];
|
|
30986
|
-
if (cond === 'is') {
|
|
30987
|
-
return !!(val !== null && val !== void 0 && val[value]);
|
|
30988
|
-
}
|
|
30989
|
-
}
|
|
30990
|
-
return !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max');
|
|
30991
|
-
});
|
|
30992
|
-
const requiredRule = rules.find(r => r.required);
|
|
30993
|
-
if (requiredRule && input.type === 'text') {
|
|
30994
|
-
rules.push({
|
|
30995
|
-
whitespace: true,
|
|
30996
|
-
message: requiredRule.message || ''
|
|
30977
|
+
setValues({
|
|
30978
|
+
...values
|
|
30997
30979
|
});
|
|
30998
30980
|
}
|
|
30999
|
-
|
|
31000
|
-
|
|
31001
|
-
|
|
31002
|
-
|
|
31003
|
-
|
|
31004
|
-
|
|
31005
|
-
|
|
31006
|
-
|
|
31007
|
-
|
|
31008
|
-
|
|
31009
|
-
|
|
31010
|
-
|
|
31011
|
-
|
|
31012
|
-
|
|
31013
|
-
|
|
31014
|
-
|
|
31015
|
-
|
|
31016
|
-
|
|
31017
|
-
|
|
31018
|
-
|
|
31019
|
-
|
|
31020
|
-
|
|
31021
|
-
|
|
31022
|
-
|
|
31023
|
-
|
|
31024
|
-
|
|
31025
|
-
|
|
31026
|
-
|
|
31027
|
-
|
|
31028
|
-
|
|
31029
|
-
|
|
31030
|
-
|
|
31031
|
-
|
|
31032
|
-
|
|
31033
|
-
|
|
31034
|
-
|
|
31035
|
-
|
|
31036
|
-
|
|
31037
|
-
|
|
31038
|
-
|
|
31039
|
-
})
|
|
31040
|
-
},
|
|
31041
|
-
|
|
31042
|
-
|
|
31043
|
-
|
|
31044
|
-
|
|
31045
|
-
|
|
30981
|
+
};
|
|
30982
|
+
const rules = inputData?.rules?.length ? inputData.rules.filter(rule => !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max')) : (input?.meta?.rules || []).filter(rule => {
|
|
30983
|
+
if (rule.metaIf && typeof rule.metaIf === 'string') {
|
|
30984
|
+
const [name, cond, value] = rule.metaIf.split(' ');
|
|
30985
|
+
const val = name.includes('./') ? values?.meta?.inputs?.[formId]?.[name.split('./')[1]] : values?.meta?.inputs?.[name.split('./')[1]];
|
|
30986
|
+
if (cond === 'is') {
|
|
30987
|
+
return !!val?.[value];
|
|
30988
|
+
}
|
|
30989
|
+
}
|
|
30990
|
+
return !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max');
|
|
30991
|
+
});
|
|
30992
|
+
const requiredRule = rules.find(r => r.required);
|
|
30993
|
+
if (requiredRule && input.type === 'text') {
|
|
30994
|
+
rules.push({
|
|
30995
|
+
whitespace: true,
|
|
30996
|
+
message: requiredRule.message || ''
|
|
30997
|
+
});
|
|
30998
|
+
}
|
|
30999
|
+
return showHideInput$1(input, values, undefined, inputValues, setValues) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
|
|
31000
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
31001
|
+
style: {
|
|
31002
|
+
position: 'relative'
|
|
31003
|
+
},
|
|
31004
|
+
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, {
|
|
31005
|
+
input: input,
|
|
31006
|
+
inputTypeComponent: inputTypeComponent$1,
|
|
31007
|
+
inputData: inputData,
|
|
31008
|
+
MainForm: MainForm,
|
|
31009
|
+
options: options,
|
|
31010
|
+
setValues: setValues,
|
|
31011
|
+
formId: formId,
|
|
31012
|
+
inputId: inputId,
|
|
31013
|
+
inputOnBlur: inputOnBlur,
|
|
31014
|
+
values: values,
|
|
31015
|
+
getInputLabel: getInputLabel$1,
|
|
31016
|
+
plainForms: plainForms,
|
|
31017
|
+
setAddress: setAddress,
|
|
31018
|
+
btnOnClick: btnOnClick,
|
|
31019
|
+
btnOnClick2: btnOnClick2,
|
|
31020
|
+
locationName: (allData || {}).locationName,
|
|
31021
|
+
subGroupTitle: (allData || {}).subGroupTitle
|
|
31022
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(GroupContentFormItem, {
|
|
31023
|
+
values,
|
|
31024
|
+
formId,
|
|
31025
|
+
setValues,
|
|
31026
|
+
MainForm,
|
|
31027
|
+
options,
|
|
31028
|
+
plainForms,
|
|
31029
|
+
setAddress,
|
|
31030
|
+
inputData,
|
|
31031
|
+
inputId,
|
|
31032
|
+
input,
|
|
31033
|
+
rules,
|
|
31034
|
+
inputMeta,
|
|
31035
|
+
changeInputMeta,
|
|
31036
|
+
notPartOfTheForm,
|
|
31037
|
+
isAjaxSubGroup,
|
|
31038
|
+
isHighlighted
|
|
31039
|
+
})]
|
|
31040
|
+
}, ii)
|
|
31041
|
+
}, `${i}${ii}`) : null;
|
|
31042
|
+
})]
|
|
31043
|
+
});
|
|
31044
|
+
const isNa = formValues?.valuation === 'na';
|
|
31046
31045
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
31047
31046
|
children: [hasLabel ? options.isRisk && options.dontShowTitle ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31048
31047
|
className: "risk-header",
|
|
@@ -31050,46 +31049,44 @@ const GroupContent = _ref2 => {
|
|
|
31050
31049
|
children: label
|
|
31051
31050
|
})
|
|
31052
31051
|
}) : /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
31053
|
-
className:
|
|
31052
|
+
className: `${form.titleClass ? form.titleClass : 'title-semibold-4'} ${i ? 'mt-3 mb-1' : ''}`,
|
|
31054
31053
|
children: label
|
|
31055
31054
|
}) : null, /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
31056
|
-
className:
|
|
31055
|
+
className: `repeatable ${hasLabel ? "mb-4" : ""}`,
|
|
31057
31056
|
children: [form.titleLabel ? /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
31058
31057
|
children: getInputProp(form.titleLabel, values)
|
|
31059
|
-
}) : null, formValues
|
|
31058
|
+
}) : null, formValues?.noPlanningRequired ? /*#__PURE__*/jsxRuntime.jsx(GroupInfoHOC, {
|
|
31060
31059
|
t: t,
|
|
31061
31060
|
isNa: isNa,
|
|
31062
31061
|
isSuccess: !isNa
|
|
31063
31062
|
// TODO: translate
|
|
31064
31063
|
,
|
|
31065
31064
|
config: {
|
|
31066
|
-
title: t(
|
|
31065
|
+
title: t(`No ${formValues?.stage || 'planning'} required`)
|
|
31067
31066
|
},
|
|
31068
31067
|
children: renderInputs()
|
|
31069
31068
|
}) : renderInputs()]
|
|
31070
31069
|
})]
|
|
31071
31070
|
});
|
|
31072
31071
|
};
|
|
31073
|
-
const GroupContentFormItem =
|
|
31074
|
-
|
|
31075
|
-
|
|
31076
|
-
|
|
31077
|
-
|
|
31078
|
-
|
|
31079
|
-
|
|
31080
|
-
|
|
31081
|
-
|
|
31082
|
-
|
|
31083
|
-
|
|
31084
|
-
|
|
31085
|
-
|
|
31086
|
-
|
|
31087
|
-
|
|
31088
|
-
|
|
31089
|
-
|
|
31090
|
-
|
|
31091
|
-
isHighlighted
|
|
31092
|
-
} = _ref4;
|
|
31072
|
+
const GroupContentFormItem = ({
|
|
31073
|
+
values,
|
|
31074
|
+
formId,
|
|
31075
|
+
setValues,
|
|
31076
|
+
MainForm,
|
|
31077
|
+
options,
|
|
31078
|
+
plainForms,
|
|
31079
|
+
setAddress,
|
|
31080
|
+
inputData,
|
|
31081
|
+
inputId,
|
|
31082
|
+
input,
|
|
31083
|
+
rules,
|
|
31084
|
+
inputMeta,
|
|
31085
|
+
changeInputMeta,
|
|
31086
|
+
notPartOfTheForm = true,
|
|
31087
|
+
isAjaxSubGroup,
|
|
31088
|
+
isHighlighted
|
|
31089
|
+
}) => {
|
|
31093
31090
|
const {
|
|
31094
31091
|
t,
|
|
31095
31092
|
user,
|
|
@@ -31103,10 +31100,10 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31103
31100
|
staticWidth,
|
|
31104
31101
|
fullWidth
|
|
31105
31102
|
} = useEditContext();
|
|
31106
|
-
const [isShown, setIsShown] = React.useState(!!
|
|
31107
|
-
let maxRule =
|
|
31103
|
+
const [isShown, setIsShown] = React.useState(!!inputMeta?.comment);
|
|
31104
|
+
let maxRule = rules.find(rule => rule.max)?.max;
|
|
31108
31105
|
const requiredRule = rules.find(r => r.required);
|
|
31109
|
-
const lastReview = (
|
|
31106
|
+
const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
|
|
31110
31107
|
if (!maxRule && input.type === 'textarea') {
|
|
31111
31108
|
maxRule = MAX_TEXT_AREA_LENGTH;
|
|
31112
31109
|
}
|
|
@@ -31125,35 +31122,38 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31125
31122
|
}
|
|
31126
31123
|
setIsShown(true);
|
|
31127
31124
|
if (notPartOfTheForm || isAjaxSubGroup) {
|
|
31128
|
-
|
|
31129
|
-
const _defaultMeta = ((values === null || values === void 0 || (_values$meta5 = values.meta) === null || _values$meta5 === void 0 ? void 0 : _values$meta5.inputs) || {})[formId] || {};
|
|
31125
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31130
31126
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31131
31127
|
if (isAjaxSubGroup) {
|
|
31132
|
-
var _defaultData$meta, _defaultData$meta2;
|
|
31133
31128
|
changeInputMeta({
|
|
31134
31129
|
key: formId,
|
|
31135
31130
|
type: input.type,
|
|
31136
31131
|
otherValues: {
|
|
31137
|
-
[formId]:
|
|
31132
|
+
[formId]: {
|
|
31133
|
+
..._defaultData,
|
|
31138
31134
|
meta: {
|
|
31139
|
-
inputs:
|
|
31140
|
-
|
|
31135
|
+
inputs: {
|
|
31136
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31137
|
+
[inputId]: {
|
|
31138
|
+
...((_defaultData?.meta?.inputs || {})[inputId] || {}),
|
|
31141
31139
|
comment: ''
|
|
31142
|
-
}
|
|
31143
|
-
}
|
|
31140
|
+
}
|
|
31141
|
+
}
|
|
31144
31142
|
}
|
|
31145
|
-
}
|
|
31143
|
+
}
|
|
31146
31144
|
}
|
|
31147
31145
|
});
|
|
31148
31146
|
} else {
|
|
31149
31147
|
changeInputMeta({
|
|
31150
31148
|
key: formId,
|
|
31151
31149
|
type: input.type,
|
|
31152
|
-
value:
|
|
31153
|
-
|
|
31150
|
+
value: {
|
|
31151
|
+
..._defaultMeta,
|
|
31152
|
+
[inputId]: {
|
|
31153
|
+
...(_defaultMeta[inputId] || {}),
|
|
31154
31154
|
comment: ''
|
|
31155
|
-
}
|
|
31156
|
-
}
|
|
31155
|
+
}
|
|
31156
|
+
}
|
|
31157
31157
|
});
|
|
31158
31158
|
}
|
|
31159
31159
|
} else {
|
|
@@ -31170,58 +31170,62 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31170
31170
|
if (!isReview) {
|
|
31171
31171
|
return;
|
|
31172
31172
|
}
|
|
31173
|
-
const reviewSuccess = lastReview
|
|
31173
|
+
const reviewSuccess = lastReview?.reviewSuccess;
|
|
31174
31174
|
if (notPartOfTheForm || isAjaxSubGroup) {
|
|
31175
|
-
|
|
31176
|
-
const _defaultMeta = ((values === null || values === void 0 || (_values$meta6 = values.meta) === null || _values$meta6 === void 0 ? void 0 : _values$meta6.inputs) || {})[formId] || {};
|
|
31175
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31177
31176
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31178
31177
|
if (isAjaxSubGroup) {
|
|
31179
|
-
var _defaultData$meta3, _defaultData$meta4, _defaultData$meta5, _defaultData$meta6;
|
|
31180
31178
|
changeInputMeta({
|
|
31181
31179
|
key: formId,
|
|
31182
31180
|
type: input.type,
|
|
31183
31181
|
otherValues: {
|
|
31184
|
-
[formId]:
|
|
31182
|
+
[formId]: {
|
|
31183
|
+
..._defaultData,
|
|
31185
31184
|
meta: {
|
|
31186
|
-
inputs:
|
|
31187
|
-
|
|
31188
|
-
|
|
31185
|
+
inputs: {
|
|
31186
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31187
|
+
[inputId]: {
|
|
31188
|
+
...((_defaultData?.meta?.inputs || {})[inputId] || {}),
|
|
31189
|
+
reviews: reviewSuccess ? (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []), {
|
|
31189
31190
|
reviewer: user,
|
|
31190
31191
|
createdAt: new Date().toISOString(),
|
|
31191
31192
|
reviewSuccess: true
|
|
31192
31193
|
}]
|
|
31193
|
-
}
|
|
31194
|
-
}
|
|
31194
|
+
}
|
|
31195
|
+
}
|
|
31195
31196
|
}
|
|
31196
|
-
}
|
|
31197
|
+
}
|
|
31197
31198
|
}
|
|
31198
31199
|
});
|
|
31199
31200
|
} else {
|
|
31200
31201
|
changeInputMeta({
|
|
31201
31202
|
key: formId,
|
|
31202
31203
|
type: input.type,
|
|
31203
|
-
value:
|
|
31204
|
-
|
|
31204
|
+
value: {
|
|
31205
|
+
..._defaultMeta,
|
|
31206
|
+
[inputId]: {
|
|
31207
|
+
...(_defaultMeta[inputId] || {}),
|
|
31205
31208
|
reviews: reviewSuccess ? ((_defaultMeta[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((_defaultMeta[inputId] || {}).reviews || []), {
|
|
31206
31209
|
reviewer: user,
|
|
31207
31210
|
createdAt: new Date().toISOString(),
|
|
31208
31211
|
reviewSuccess: true
|
|
31209
31212
|
}]
|
|
31210
|
-
}
|
|
31211
|
-
}
|
|
31213
|
+
}
|
|
31214
|
+
}
|
|
31212
31215
|
});
|
|
31213
31216
|
}
|
|
31214
31217
|
} else {
|
|
31215
31218
|
changeInputMeta({
|
|
31216
31219
|
key: inputId,
|
|
31217
31220
|
type: input.type,
|
|
31218
|
-
value:
|
|
31221
|
+
value: {
|
|
31222
|
+
...inputMeta,
|
|
31219
31223
|
reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
|
|
31220
31224
|
reviewer: user,
|
|
31221
31225
|
createdAt: new Date().toISOString(),
|
|
31222
31226
|
reviewSuccess: true
|
|
31223
31227
|
}]
|
|
31224
|
-
}
|
|
31228
|
+
}
|
|
31225
31229
|
});
|
|
31226
31230
|
}
|
|
31227
31231
|
};
|
|
@@ -31229,111 +31233,118 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31229
31233
|
if (!isReview) {
|
|
31230
31234
|
return;
|
|
31231
31235
|
}
|
|
31232
|
-
const reviewError = lastReview
|
|
31236
|
+
const reviewError = lastReview?.reviewError;
|
|
31233
31237
|
if (notPartOfTheForm || isAjaxSubGroup) {
|
|
31234
|
-
|
|
31235
|
-
const _defaultMeta = ((values === null || values === void 0 || (_values$meta7 = values.meta) === null || _values$meta7 === void 0 ? void 0 : _values$meta7.inputs) || {})[formId] || {};
|
|
31238
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31236
31239
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31237
31240
|
if (isAjaxSubGroup) {
|
|
31238
|
-
var _defaultData$meta7, _defaultData$meta8, _defaultData$meta9, _defaultData$meta10;
|
|
31239
31241
|
changeInputMeta({
|
|
31240
31242
|
key: formId,
|
|
31241
31243
|
type: input.type,
|
|
31242
31244
|
otherValues: {
|
|
31243
|
-
[formId]:
|
|
31245
|
+
[formId]: {
|
|
31246
|
+
..._defaultData,
|
|
31244
31247
|
meta: {
|
|
31245
|
-
inputs:
|
|
31246
|
-
|
|
31247
|
-
|
|
31248
|
+
inputs: {
|
|
31249
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31250
|
+
[inputId]: {
|
|
31251
|
+
...((_defaultData?.meta?.inputs || {})[inputId] || {}),
|
|
31252
|
+
reviews: reviewError ? (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []), {
|
|
31248
31253
|
reviewer: user,
|
|
31249
31254
|
createdAt: new Date().toISOString(),
|
|
31250
31255
|
reviewError: true,
|
|
31251
31256
|
comment: ''
|
|
31252
31257
|
}]
|
|
31253
|
-
}
|
|
31254
|
-
}
|
|
31258
|
+
}
|
|
31259
|
+
}
|
|
31255
31260
|
}
|
|
31256
|
-
}
|
|
31261
|
+
}
|
|
31257
31262
|
}
|
|
31258
31263
|
});
|
|
31259
31264
|
} else {
|
|
31260
31265
|
changeInputMeta({
|
|
31261
31266
|
key: formId,
|
|
31262
31267
|
type: input.type,
|
|
31263
|
-
value:
|
|
31264
|
-
|
|
31268
|
+
value: {
|
|
31269
|
+
..._defaultMeta,
|
|
31270
|
+
[inputId]: {
|
|
31271
|
+
...(_defaultMeta[inputId] || {}),
|
|
31265
31272
|
reviews: reviewError ? ((_defaultMeta[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((_defaultMeta[inputId] || {}).reviews || []), {
|
|
31266
31273
|
reviewer: user,
|
|
31267
31274
|
createdAt: new Date().toISOString(),
|
|
31268
31275
|
reviewError: true,
|
|
31269
31276
|
comment: ''
|
|
31270
31277
|
}]
|
|
31271
|
-
}
|
|
31272
|
-
}
|
|
31278
|
+
}
|
|
31279
|
+
}
|
|
31273
31280
|
});
|
|
31274
31281
|
}
|
|
31275
31282
|
} else {
|
|
31276
31283
|
changeInputMeta({
|
|
31277
31284
|
key: inputId,
|
|
31278
31285
|
type: input.type,
|
|
31279
|
-
value:
|
|
31286
|
+
value: {
|
|
31287
|
+
...inputMeta,
|
|
31280
31288
|
reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
|
|
31281
31289
|
reviewer: user,
|
|
31282
31290
|
createdAt: new Date().toISOString(),
|
|
31283
31291
|
reviewError: true,
|
|
31284
31292
|
comment: ''
|
|
31285
31293
|
}]
|
|
31286
|
-
}
|
|
31294
|
+
}
|
|
31287
31295
|
});
|
|
31288
31296
|
}
|
|
31289
31297
|
};
|
|
31290
|
-
const requiredComment =
|
|
31298
|
+
const requiredComment = inputMeta?.notApplicable && input?.meta?.requiredCommentOnNotApplicable && values?.[formId]?.valuation !== 'na';
|
|
31291
31299
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
31292
31300
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
31293
31301
|
className: "flex input-cont",
|
|
31294
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item,
|
|
31295
|
-
required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
|
|
31296
|
-
|
|
31297
|
-
|
|
31298
|
-
|
|
31299
|
-
|
|
31300
|
-
|
|
31301
|
-
|
|
31302
|
-
|
|
31303
|
-
|
|
31304
|
-
|
|
31305
|
-
|
|
31306
|
-
return e && e.fileList && e.fileList.map(f => {
|
|
31307
|
-
if (f.response) {
|
|
31308
|
-
return f.response;
|
|
31302
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
31303
|
+
required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
|
|
31304
|
+
...(['total100', 'group'].includes(input.type) ? {} : {
|
|
31305
|
+
name: notPartOfTheForm ? [formId, inputId] : inputId,
|
|
31306
|
+
fieldKey: notPartOfTheForm ? [formId, inputId] : inputId,
|
|
31307
|
+
initialValue: notPartOfTheForm ? (values[formId] || {})[inputId] : values[inputId]
|
|
31308
|
+
}),
|
|
31309
|
+
...(['upload', 'imageUpload', 'videoUpload'].includes(input.type) ? {
|
|
31310
|
+
valuePropName: "fileList",
|
|
31311
|
+
getValueFromEvent: e => {
|
|
31312
|
+
if (Array.isArray(e)) {
|
|
31313
|
+
return e;
|
|
31309
31314
|
}
|
|
31310
|
-
return f
|
|
31311
|
-
|
|
31312
|
-
|
|
31313
|
-
|
|
31314
|
-
|
|
31315
|
-
|
|
31315
|
+
return e && e.fileList && e.fileList.map(f => {
|
|
31316
|
+
if (f.response) {
|
|
31317
|
+
return f.response;
|
|
31318
|
+
}
|
|
31319
|
+
return f;
|
|
31320
|
+
});
|
|
31321
|
+
}
|
|
31322
|
+
} : {}),
|
|
31323
|
+
...(inputOnBlur.includes(input.type) ? {
|
|
31324
|
+
trigger: "onBlur"
|
|
31325
|
+
} : {}),
|
|
31316
31326
|
style: input.showOnView === false ? {
|
|
31317
31327
|
display: 'none'
|
|
31318
|
-
} : {}
|
|
31319
|
-
|
|
31320
|
-
|
|
31321
|
-
|
|
31322
|
-
|
|
31323
|
-
|
|
31324
|
-
|
|
31325
|
-
|
|
31326
|
-
|
|
31327
|
-
|
|
31328
|
-
|
|
31329
|
-
|
|
31328
|
+
} : {},
|
|
31329
|
+
...(['switch'].includes(input.type) ? {
|
|
31330
|
+
labelCol: {
|
|
31331
|
+
span: 20
|
|
31332
|
+
},
|
|
31333
|
+
style: {
|
|
31334
|
+
...(input.showOnView === false ? {
|
|
31335
|
+
display: 'none'
|
|
31336
|
+
} : {}),
|
|
31337
|
+
flexDirection: 'row',
|
|
31338
|
+
justifyContent: 'space-between'
|
|
31339
|
+
}
|
|
31340
|
+
} : {}),
|
|
31330
31341
|
label: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31331
|
-
className:
|
|
31342
|
+
className: input?.meta?.code && "mr-10",
|
|
31332
31343
|
children: getInputLabel$1(input, values)
|
|
31333
31344
|
}) : null,
|
|
31334
31345
|
rules: rules,
|
|
31335
|
-
className: formatClassname([input.comment ?
|
|
31336
|
-
"data-id":
|
|
31346
|
+
className: formatClassname([input.comment ? `flex-1 with-comment i-${input.type}` : `i-${input.type} flex-1 `, noActionsInputs.includes(input.type) && 'no-actions-input']),
|
|
31347
|
+
"data-id": `${formId}.${inputId}`,
|
|
31337
31348
|
extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
31338
31349
|
children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
31339
31350
|
className: formatClassname(["ml-4 input-actions"]),
|
|
@@ -31343,7 +31354,7 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31343
31354
|
title: t('Add review note'),
|
|
31344
31355
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31345
31356
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31346
|
-
className: formatClassname(["review-btn review-error-btn",
|
|
31357
|
+
className: formatClassname(["review-btn review-error-btn", lastReview?.reviewError && 'primary']),
|
|
31347
31358
|
type: "link",
|
|
31348
31359
|
onClick: onClickReviewError,
|
|
31349
31360
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
@@ -31359,7 +31370,7 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31359
31370
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31360
31371
|
type: "link",
|
|
31361
31372
|
onClick: onClickReviewSuccess,
|
|
31362
|
-
className: formatClassname(["review-btn review-success-btn",
|
|
31373
|
+
className: formatClassname(["review-btn review-success-btn", lastReview?.reviewSuccess && 'primary']),
|
|
31363
31374
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
31364
31375
|
name: "CheckSquare",
|
|
31365
31376
|
width: 16,
|
|
@@ -31376,59 +31387,65 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31376
31387
|
className: formatClassname(["default p-0", inputMeta.notApplicable && 'primary']),
|
|
31377
31388
|
type: "link",
|
|
31378
31389
|
onClick: () => {
|
|
31379
|
-
var _input$meta5, _input$meta6;
|
|
31380
31390
|
const value = getDefaultInputValue(input);
|
|
31381
|
-
const commentMeta = input
|
|
31391
|
+
const commentMeta = input?.meta?.requiredCommentOnNotApplicable ? {
|
|
31382
31392
|
comment: ''
|
|
31383
31393
|
} : {};
|
|
31384
|
-
if (input
|
|
31394
|
+
if (input?.meta?.requiredCommentOnNotApplicable) {
|
|
31385
31395
|
setIsShown(true);
|
|
31386
31396
|
}
|
|
31387
31397
|
if (notPartOfTheForm || isAjaxSubGroup) {
|
|
31388
|
-
var _values$meta8;
|
|
31389
31398
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31390
|
-
const _defaultMeta = (
|
|
31399
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31391
31400
|
if (isAjaxSubGroup) {
|
|
31392
|
-
var _defaultData$meta11;
|
|
31393
31401
|
changeInputMeta({
|
|
31394
31402
|
key: formId,
|
|
31395
31403
|
type: input.type,
|
|
31396
31404
|
otherValues: {
|
|
31397
|
-
[formId]:
|
|
31405
|
+
[formId]: {
|
|
31406
|
+
..._defaultData,
|
|
31398
31407
|
[inputId]: value,
|
|
31399
31408
|
meta: {
|
|
31400
|
-
inputs:
|
|
31401
|
-
|
|
31409
|
+
inputs: {
|
|
31410
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31411
|
+
[inputId]: inputMeta.notApplicable ? {
|
|
31402
31412
|
notApplicable: false,
|
|
31403
|
-
notAvailable: false
|
|
31404
|
-
|
|
31413
|
+
notAvailable: false,
|
|
31414
|
+
...commentMeta
|
|
31415
|
+
} : {
|
|
31405
31416
|
notApplicable: true,
|
|
31406
|
-
notAvailable: false
|
|
31407
|
-
|
|
31408
|
-
|
|
31417
|
+
notAvailable: false,
|
|
31418
|
+
...commentMeta
|
|
31419
|
+
}
|
|
31420
|
+
}
|
|
31409
31421
|
}
|
|
31410
|
-
}
|
|
31422
|
+
}
|
|
31411
31423
|
}
|
|
31412
31424
|
});
|
|
31413
31425
|
} else {
|
|
31414
31426
|
changeInputMeta({
|
|
31415
31427
|
key: formId,
|
|
31416
31428
|
type: input.type,
|
|
31417
|
-
value: inputMeta.notApplicable ?
|
|
31418
|
-
|
|
31429
|
+
value: inputMeta.notApplicable ? {
|
|
31430
|
+
..._defaultMeta,
|
|
31431
|
+
[inputId]: {
|
|
31419
31432
|
notApplicable: false,
|
|
31420
|
-
notAvailable: false
|
|
31421
|
-
|
|
31422
|
-
|
|
31423
|
-
|
|
31433
|
+
notAvailable: false,
|
|
31434
|
+
...commentMeta
|
|
31435
|
+
}
|
|
31436
|
+
} : {
|
|
31437
|
+
..._defaultMeta,
|
|
31438
|
+
[inputId]: {
|
|
31424
31439
|
notApplicable: true,
|
|
31425
|
-
notAvailable: false
|
|
31426
|
-
|
|
31427
|
-
|
|
31440
|
+
notAvailable: false,
|
|
31441
|
+
...commentMeta
|
|
31442
|
+
}
|
|
31443
|
+
},
|
|
31428
31444
|
otherValues: {
|
|
31429
|
-
[formId]:
|
|
31445
|
+
[formId]: {
|
|
31446
|
+
..._defaultData,
|
|
31430
31447
|
[inputId]: value
|
|
31431
|
-
}
|
|
31448
|
+
}
|
|
31432
31449
|
}
|
|
31433
31450
|
});
|
|
31434
31451
|
}
|
|
@@ -31449,7 +31466,7 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31449
31466
|
});
|
|
31450
31467
|
}
|
|
31451
31468
|
},
|
|
31452
|
-
disabled: !
|
|
31469
|
+
disabled: !input.meta?.notApplicable,
|
|
31453
31470
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
31454
31471
|
name: "NotApplicable",
|
|
31455
31472
|
width: 16,
|
|
@@ -31463,24 +31480,24 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31463
31480
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
31464
31481
|
className: formatClassname(["default p-0", inputMeta.notAvailable && 'primary']),
|
|
31465
31482
|
type: "link",
|
|
31466
|
-
disabled: !
|
|
31483
|
+
disabled: !input.meta?.notAvailable,
|
|
31467
31484
|
onClick: () => {
|
|
31468
31485
|
const value = getDefaultInputValue(input);
|
|
31469
31486
|
if (notPartOfTheForm || isAjaxSubGroup) {
|
|
31470
|
-
var _values$meta9;
|
|
31471
31487
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31472
|
-
const _defaultMeta = (
|
|
31488
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31473
31489
|
if (isAjaxSubGroup) {
|
|
31474
31490
|
if (isAjaxSubGroup) {
|
|
31475
|
-
var _defaultData$meta12;
|
|
31476
31491
|
changeInputMeta({
|
|
31477
31492
|
key: formId,
|
|
31478
31493
|
type: input.type,
|
|
31479
31494
|
otherValues: {
|
|
31480
|
-
[formId]:
|
|
31495
|
+
[formId]: {
|
|
31496
|
+
..._defaultData,
|
|
31481
31497
|
[inputId]: value,
|
|
31482
31498
|
meta: {
|
|
31483
|
-
inputs:
|
|
31499
|
+
inputs: {
|
|
31500
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31484
31501
|
[inputId]: inputMeta.notAvailable ? {
|
|
31485
31502
|
notApplicable: false,
|
|
31486
31503
|
notAvailable: false
|
|
@@ -31488,9 +31505,9 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31488
31505
|
notApplicable: false,
|
|
31489
31506
|
notAvailable: true
|
|
31490
31507
|
}
|
|
31491
|
-
}
|
|
31508
|
+
}
|
|
31492
31509
|
}
|
|
31493
|
-
}
|
|
31510
|
+
}
|
|
31494
31511
|
}
|
|
31495
31512
|
});
|
|
31496
31513
|
}
|
|
@@ -31498,21 +31515,24 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31498
31515
|
changeInputMeta({
|
|
31499
31516
|
key: formId,
|
|
31500
31517
|
type: input.type,
|
|
31501
|
-
value: inputMeta.notAvailable ?
|
|
31518
|
+
value: inputMeta.notAvailable ? {
|
|
31519
|
+
..._defaultMeta,
|
|
31502
31520
|
[inputId]: {
|
|
31503
31521
|
notApplicable: false,
|
|
31504
31522
|
notAvailable: false
|
|
31505
31523
|
}
|
|
31506
|
-
}
|
|
31524
|
+
} : {
|
|
31525
|
+
..._defaultMeta,
|
|
31507
31526
|
[inputId]: {
|
|
31508
31527
|
notApplicable: false,
|
|
31509
31528
|
notAvailable: true
|
|
31510
31529
|
}
|
|
31511
|
-
}
|
|
31530
|
+
},
|
|
31512
31531
|
otherValues: {
|
|
31513
|
-
[formId]:
|
|
31532
|
+
[formId]: {
|
|
31533
|
+
..._defaultData,
|
|
31514
31534
|
[inputId]: value
|
|
31515
|
-
}
|
|
31535
|
+
}
|
|
31516
31536
|
}
|
|
31517
31537
|
});
|
|
31518
31538
|
}
|
|
@@ -31543,33 +31563,38 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31543
31563
|
}), /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
31544
31564
|
title: t('Add comment'),
|
|
31545
31565
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31546
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button,
|
|
31566
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
31547
31567
|
type: "link",
|
|
31548
|
-
disabled: !
|
|
31549
|
-
|
|
31550
|
-
|
|
31551
|
-
|
|
31552
|
-
|
|
31553
|
-
|
|
31568
|
+
disabled: !input.meta?.comment,
|
|
31569
|
+
...(!isShown ? {
|
|
31570
|
+
className: 'default p-0'
|
|
31571
|
+
} : {
|
|
31572
|
+
className: 'p-0 primary'
|
|
31573
|
+
}),
|
|
31554
31574
|
onClick: onClickComment,
|
|
31555
31575
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
31556
31576
|
name: "AddComment",
|
|
31557
31577
|
width: 16,
|
|
31558
31578
|
height: 16
|
|
31559
31579
|
})
|
|
31560
|
-
})
|
|
31580
|
+
})
|
|
31561
31581
|
})
|
|
31562
31582
|
})]
|
|
31563
31583
|
}) : null]
|
|
31564
31584
|
}) : null
|
|
31565
31585
|
}),
|
|
31566
31586
|
children: isReview ? /*#__PURE__*/jsxRuntime.jsx(BasicInput, {
|
|
31567
|
-
data:
|
|
31568
|
-
|
|
31569
|
-
|
|
31570
|
-
|
|
31571
|
-
|
|
31572
|
-
|
|
31587
|
+
data: {
|
|
31588
|
+
...(values[formId] || {}),
|
|
31589
|
+
meta: {
|
|
31590
|
+
...(values?.meta || {}),
|
|
31591
|
+
inputs: {
|
|
31592
|
+
...(values?.meta?.inputs || {}),
|
|
31593
|
+
...((values?.meta?.inputs || {})[formId] || {})
|
|
31594
|
+
}
|
|
31595
|
+
}
|
|
31596
|
+
},
|
|
31597
|
+
linkingData: values?.linking || values?.parent?.linking,
|
|
31573
31598
|
name: input.dataId,
|
|
31574
31599
|
config: input,
|
|
31575
31600
|
t: t,
|
|
@@ -31581,12 +31606,13 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31581
31606
|
getToken: getToken,
|
|
31582
31607
|
app: app,
|
|
31583
31608
|
valueOnlyString: true
|
|
31584
|
-
}) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](
|
|
31609
|
+
}) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
|
|
31610
|
+
...inputData,
|
|
31585
31611
|
name: inputId,
|
|
31586
31612
|
maxWidth,
|
|
31587
31613
|
staticWidth,
|
|
31588
31614
|
fullWidth
|
|
31589
|
-
}
|
|
31615
|
+
}, {
|
|
31590
31616
|
form: MainForm,
|
|
31591
31617
|
forms: options,
|
|
31592
31618
|
allForms: plainForms,
|
|
@@ -31604,10 +31630,10 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31604
31630
|
staticWidth,
|
|
31605
31631
|
fullWidth
|
|
31606
31632
|
}) : console.log(input)
|
|
31607
|
-
})
|
|
31633
|
+
}), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31608
31634
|
className: "code",
|
|
31609
31635
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
31610
|
-
children:
|
|
31636
|
+
children: input.meta?.code
|
|
31611
31637
|
})
|
|
31612
31638
|
}) : null]
|
|
31613
31639
|
}), maxRule ? ['imageUpload', 'videoUpload', 'upload'].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -31627,16 +31653,16 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31627
31653
|
className: "max-char-span",
|
|
31628
31654
|
children: t('max-char', {
|
|
31629
31655
|
chars: maxRule,
|
|
31630
|
-
filled:
|
|
31656
|
+
filled: inputData?.value?.length || 0
|
|
31631
31657
|
})
|
|
31632
31658
|
})
|
|
31633
|
-
}) : null,
|
|
31659
|
+
}) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
31634
31660
|
className: "input-content",
|
|
31635
31661
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
31636
31662
|
className: "comment-textarea",
|
|
31637
|
-
initialValue:
|
|
31663
|
+
initialValue: inputMeta?.comment || '',
|
|
31638
31664
|
hidden: !isShown,
|
|
31639
|
-
name:
|
|
31665
|
+
name: `${formId}-${inputId}-comment`,
|
|
31640
31666
|
required: requiredComment,
|
|
31641
31667
|
rules: requiredComment ? [{
|
|
31642
31668
|
required: true,
|
|
@@ -31653,35 +31679,38 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31653
31679
|
onConfirm: () => {
|
|
31654
31680
|
setIsShown(false);
|
|
31655
31681
|
if (notPartOfTheForm) {
|
|
31656
|
-
|
|
31657
|
-
const _defaultMeta = ((values === null || values === void 0 || (_values$meta12 = values.meta) === null || _values$meta12 === void 0 ? void 0 : _values$meta12.inputs) || {})[formId] || {};
|
|
31682
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31658
31683
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31659
31684
|
if (isAjaxSubGroup) {
|
|
31660
|
-
var _defaultData$meta13, _defaultData$meta14;
|
|
31661
31685
|
changeInputMeta({
|
|
31662
31686
|
key: formId,
|
|
31663
31687
|
type: input.type,
|
|
31664
31688
|
otherValues: {
|
|
31665
|
-
[formId]:
|
|
31689
|
+
[formId]: {
|
|
31690
|
+
..._defaultData,
|
|
31666
31691
|
meta: {
|
|
31667
|
-
inputs:
|
|
31668
|
-
|
|
31692
|
+
inputs: {
|
|
31693
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31694
|
+
[inputId]: {
|
|
31695
|
+
...((_defaultData?.meta?.inputs || {})[inputId] || {}),
|
|
31669
31696
|
comment: null
|
|
31670
|
-
}
|
|
31671
|
-
}
|
|
31697
|
+
}
|
|
31698
|
+
}
|
|
31672
31699
|
}
|
|
31673
|
-
}
|
|
31700
|
+
}
|
|
31674
31701
|
}
|
|
31675
31702
|
});
|
|
31676
31703
|
} else {
|
|
31677
31704
|
changeInputMeta({
|
|
31678
31705
|
key: formId,
|
|
31679
31706
|
type: input.type,
|
|
31680
|
-
value:
|
|
31681
|
-
|
|
31707
|
+
value: {
|
|
31708
|
+
..._defaultMeta,
|
|
31709
|
+
[inputId]: {
|
|
31710
|
+
...(_defaultMeta[inputId] || {}),
|
|
31682
31711
|
comment: null
|
|
31683
|
-
}
|
|
31684
|
-
}
|
|
31712
|
+
}
|
|
31713
|
+
}
|
|
31685
31714
|
});
|
|
31686
31715
|
}
|
|
31687
31716
|
} else {
|
|
@@ -31696,7 +31725,7 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31696
31725
|
},
|
|
31697
31726
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
31698
31727
|
type: "link",
|
|
31699
|
-
disabled: !
|
|
31728
|
+
disabled: !input.meta?.comment,
|
|
31700
31729
|
className: "p-0",
|
|
31701
31730
|
children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
|
|
31702
31731
|
width: 16,
|
|
@@ -31708,41 +31737,44 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31708
31737
|
children: inputTypeComponent$1.comment(inputData, {
|
|
31709
31738
|
form: MainForm,
|
|
31710
31739
|
forms: options,
|
|
31711
|
-
value:
|
|
31740
|
+
value: inputMeta?.comment || '',
|
|
31712
31741
|
maxWidth,
|
|
31713
31742
|
staticWidth,
|
|
31714
31743
|
fullWidth,
|
|
31715
31744
|
onChange: val => {
|
|
31716
31745
|
if (notPartOfTheForm) {
|
|
31717
|
-
|
|
31718
|
-
const _defaultMeta = ((values === null || values === void 0 || (_values$meta13 = values.meta) === null || _values$meta13 === void 0 ? void 0 : _values$meta13.inputs) || {})[formId] || {};
|
|
31746
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31719
31747
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31720
31748
|
if (isAjaxSubGroup) {
|
|
31721
|
-
var _defaultData$meta15, _defaultData$meta16;
|
|
31722
31749
|
changeInputMeta({
|
|
31723
31750
|
key: formId,
|
|
31724
31751
|
type: input.type,
|
|
31725
31752
|
otherValues: {
|
|
31726
|
-
[formId]:
|
|
31753
|
+
[formId]: {
|
|
31754
|
+
..._defaultData,
|
|
31727
31755
|
meta: {
|
|
31728
|
-
inputs:
|
|
31729
|
-
|
|
31756
|
+
inputs: {
|
|
31757
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31758
|
+
[inputId]: {
|
|
31759
|
+
...((_defaultData?.meta?.inputs || {})[inputId] || {}),
|
|
31730
31760
|
comment: val
|
|
31731
|
-
}
|
|
31732
|
-
}
|
|
31761
|
+
}
|
|
31762
|
+
}
|
|
31733
31763
|
}
|
|
31734
|
-
}
|
|
31764
|
+
}
|
|
31735
31765
|
}
|
|
31736
31766
|
});
|
|
31737
31767
|
} else {
|
|
31738
31768
|
changeInputMeta({
|
|
31739
31769
|
key: formId,
|
|
31740
31770
|
type: input.type,
|
|
31741
|
-
value:
|
|
31742
|
-
|
|
31771
|
+
value: {
|
|
31772
|
+
..._defaultMeta,
|
|
31773
|
+
[inputId]: {
|
|
31774
|
+
...(_defaultMeta[inputId] || {}),
|
|
31743
31775
|
comment: val
|
|
31744
|
-
}
|
|
31745
|
-
}
|
|
31776
|
+
}
|
|
31777
|
+
}
|
|
31746
31778
|
});
|
|
31747
31779
|
}
|
|
31748
31780
|
} else {
|
|
@@ -31763,16 +31795,16 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31763
31795
|
className: "max-char-span",
|
|
31764
31796
|
children: t('max-char', {
|
|
31765
31797
|
chars: MAX_COMMENTS_LENGTH,
|
|
31766
|
-
filled:
|
|
31798
|
+
filled: inputMeta?.comment?.length || 0
|
|
31767
31799
|
})
|
|
31768
31800
|
})]
|
|
31769
|
-
}) : null, lastReview
|
|
31801
|
+
}) : null, lastReview?.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31770
31802
|
className: "input-content",
|
|
31771
31803
|
children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
31772
31804
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
31773
31805
|
className: "comment-textarea",
|
|
31774
|
-
initialValue:
|
|
31775
|
-
name:
|
|
31806
|
+
initialValue: lastReview?.comment || '',
|
|
31807
|
+
name: `${formId}-${inputId}-reviewErrorComment`,
|
|
31776
31808
|
label: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31777
31809
|
className: "flex w-100",
|
|
31778
31810
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -31783,71 +31815,78 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31783
31815
|
children: inputTypeComponent$1.comment(inputData, {
|
|
31784
31816
|
form: MainForm,
|
|
31785
31817
|
forms: options,
|
|
31786
|
-
value:
|
|
31818
|
+
value: lastReview?.comment || '',
|
|
31787
31819
|
maxWidth,
|
|
31788
31820
|
staticWidth,
|
|
31789
31821
|
fullWidth,
|
|
31790
31822
|
onChange: val => {
|
|
31791
31823
|
if (notPartOfTheForm) {
|
|
31792
|
-
|
|
31793
|
-
const _defaultMeta = ((values === null || values === void 0 || (_values$meta14 = values.meta) === null || _values$meta14 === void 0 ? void 0 : _values$meta14.inputs) || {})[formId] || {};
|
|
31824
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31794
31825
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31795
31826
|
if (isAjaxSubGroup) {
|
|
31796
|
-
var _defaultData$meta17, _defaultData$meta18, _defaultData$meta19;
|
|
31797
31827
|
changeInputMeta({
|
|
31798
31828
|
key: formId,
|
|
31799
31829
|
type: input.type,
|
|
31800
31830
|
otherValues: {
|
|
31801
|
-
[formId]:
|
|
31831
|
+
[formId]: {
|
|
31832
|
+
..._defaultData,
|
|
31802
31833
|
meta: {
|
|
31803
|
-
inputs:
|
|
31804
|
-
|
|
31805
|
-
|
|
31834
|
+
inputs: {
|
|
31835
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31836
|
+
[inputId]: {
|
|
31837
|
+
...((_defaultData?.meta?.inputs || {})[inputId] || {}),
|
|
31838
|
+
reviews: (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).map(v => {
|
|
31806
31839
|
if (v.createdAt === lastReview.createdAt) {
|
|
31807
|
-
return
|
|
31840
|
+
return {
|
|
31841
|
+
...v,
|
|
31808
31842
|
comment: val
|
|
31809
|
-
}
|
|
31843
|
+
};
|
|
31810
31844
|
}
|
|
31811
31845
|
return v;
|
|
31812
31846
|
})
|
|
31813
|
-
}
|
|
31814
|
-
}
|
|
31847
|
+
}
|
|
31848
|
+
}
|
|
31815
31849
|
}
|
|
31816
|
-
}
|
|
31850
|
+
}
|
|
31817
31851
|
}
|
|
31818
31852
|
});
|
|
31819
31853
|
} else {
|
|
31820
31854
|
changeInputMeta({
|
|
31821
31855
|
key: formId,
|
|
31822
31856
|
type: input.type,
|
|
31823
|
-
value:
|
|
31824
|
-
|
|
31857
|
+
value: {
|
|
31858
|
+
..._defaultMeta,
|
|
31859
|
+
[inputId]: {
|
|
31860
|
+
...(_defaultMeta[inputId] || {}),
|
|
31825
31861
|
reviews: ((_defaultMeta[inputId] || {}).reviews || []).map(v => {
|
|
31826
31862
|
if (v.createdAt === lastReview.createdAt) {
|
|
31827
|
-
return
|
|
31863
|
+
return {
|
|
31864
|
+
...v,
|
|
31828
31865
|
comment: val
|
|
31829
|
-
}
|
|
31866
|
+
};
|
|
31830
31867
|
}
|
|
31831
31868
|
return v;
|
|
31832
31869
|
})
|
|
31833
|
-
}
|
|
31834
|
-
}
|
|
31870
|
+
}
|
|
31871
|
+
}
|
|
31835
31872
|
});
|
|
31836
31873
|
}
|
|
31837
31874
|
} else {
|
|
31838
31875
|
changeInputMeta({
|
|
31839
31876
|
key: inputId,
|
|
31840
31877
|
type: input.type,
|
|
31841
|
-
value:
|
|
31842
|
-
|
|
31878
|
+
value: {
|
|
31879
|
+
...inputMeta,
|
|
31880
|
+
reviews: (inputMeta?.reviews || []).map(v => {
|
|
31843
31881
|
if (v.createdAt === lastReview.createdAt) {
|
|
31844
|
-
return
|
|
31882
|
+
return {
|
|
31883
|
+
...v,
|
|
31845
31884
|
comment: val
|
|
31846
|
-
}
|
|
31885
|
+
};
|
|
31847
31886
|
}
|
|
31848
31887
|
return v;
|
|
31849
31888
|
})
|
|
31850
|
-
}
|
|
31889
|
+
}
|
|
31851
31890
|
});
|
|
31852
31891
|
}
|
|
31853
31892
|
},
|
|
@@ -31859,7 +31898,7 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31859
31898
|
className: "max-char-span",
|
|
31860
31899
|
children: t('max-char', {
|
|
31861
31900
|
chars: MAX_COMMENTS_LENGTH,
|
|
31862
|
-
filled:
|
|
31901
|
+
filled: lastReview.comment?.length || 0
|
|
31863
31902
|
})
|
|
31864
31903
|
})]
|
|
31865
31904
|
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -31880,7 +31919,7 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31880
31919
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31881
31920
|
className: "flex flex-column justify-center mr-1",
|
|
31882
31921
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
31883
|
-
children:
|
|
31922
|
+
children: lastReview?.reviewer?.firstName + ' ' + lastReview?.reviewer?.lastName + ' - ' + moment__default["default"](lastReview.createdAt).format('DD MMM YYYY')
|
|
31884
31923
|
})
|
|
31885
31924
|
})]
|
|
31886
31925
|
})]
|
|
@@ -35853,13 +35892,11 @@ const beforeUpload = allowedExtensions => file => {
|
|
|
35853
35892
|
};
|
|
35854
35893
|
const allowedImageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.avif', '.bmp', '.tiff', '.tif', '.heif', '.heic', '.svg', '.ico'];
|
|
35855
35894
|
|
|
35856
|
-
|
|
35857
|
-
_excluded2$1 = ["label", "description", "excludeFromEdit", "showFormIf", "icon", "position", "template", "formClass"];
|
|
35895
|
+
/* eslint-disable no-case-declarations */
|
|
35858
35896
|
dayjs__default["default"].extend(utc);
|
|
35859
35897
|
dayjs__default["default"].extend(timezone);
|
|
35860
35898
|
dayjs__default["default"].tz.setDefault("UTC");
|
|
35861
|
-
const getDefaultInputValue =
|
|
35862
|
-
let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
35899
|
+
const getDefaultInputValue = (input = {}) => {
|
|
35863
35900
|
let value = undefined;
|
|
35864
35901
|
if (input.type === "multiselect") {
|
|
35865
35902
|
value = [];
|
|
@@ -35877,30 +35914,33 @@ const checkCondition$1 = (condition, repeatValues, formsValue) => {
|
|
|
35877
35914
|
const isShown = _checkValue(isNotEmpty ? field : wantedValue, match, isNotEmpty ? formValue : value);
|
|
35878
35915
|
return isShown;
|
|
35879
35916
|
};
|
|
35880
|
-
const renderDataLinkGroup =
|
|
35881
|
-
|
|
35882
|
-
|
|
35883
|
-
|
|
35884
|
-
|
|
35885
|
-
|
|
35886
|
-
|
|
35887
|
-
|
|
35888
|
-
|
|
35889
|
-
|
|
35890
|
-
|
|
35891
|
-
|
|
35892
|
-
|
|
35893
|
-
const
|
|
35894
|
-
|
|
35895
|
-
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";
|
|
35896
|
-
});
|
|
35897
|
-
const dataLinkInput = ((input === null || input === void 0 ? void 0 : input.inputs) || {})[dataLinkKey];
|
|
35898
|
-
const otherInputs = Object.keys((input === null || input === void 0 ? void 0 : input.inputs) || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
|
|
35899
|
-
all[key] = input === null || input === void 0 ? void 0 : input.inputs[key];
|
|
35917
|
+
const renderDataLinkGroup = ({
|
|
35918
|
+
input,
|
|
35919
|
+
groupFormId,
|
|
35920
|
+
name,
|
|
35921
|
+
formsValue,
|
|
35922
|
+
form,
|
|
35923
|
+
onValuesChange,
|
|
35924
|
+
setValues,
|
|
35925
|
+
changeLinking,
|
|
35926
|
+
isHighlighted
|
|
35927
|
+
}) => {
|
|
35928
|
+
const dataLinkKey = Object.keys(input?.inputs || {}).find(k => input?.inputs[k]?.type === "dataLink");
|
|
35929
|
+
const dataLinkInput = (input?.inputs || {})[dataLinkKey];
|
|
35930
|
+
const otherInputs = Object.keys(input?.inputs || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
|
|
35931
|
+
all[key] = input?.inputs[key];
|
|
35900
35932
|
return all;
|
|
35901
35933
|
}, {});
|
|
35902
|
-
const isSingle =
|
|
35903
|
-
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [
|
|
35934
|
+
const isSingle = input?.meta?.maxRepeat === 1;
|
|
35935
|
+
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
|
|
35936
|
+
...(formsValue[groupFormId] || {})[name]
|
|
35937
|
+
}] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
|
|
35938
|
+
...v
|
|
35939
|
+
})) : isSingle ? formsValue[name] ? [{
|
|
35940
|
+
...formsValue[name]
|
|
35941
|
+
}] : [] : getArray(formsValue[name] || []).map(v => ({
|
|
35942
|
+
...v
|
|
35943
|
+
}));
|
|
35904
35944
|
const onUpdate = (val, i) => {
|
|
35905
35945
|
const _val = isSingle ? {
|
|
35906
35946
|
[name]: val
|
|
@@ -35908,20 +35948,31 @@ const renderDataLinkGroup = _ref2 => {
|
|
|
35908
35948
|
[name]: formData.map((d, j) => i === j ? val : d)
|
|
35909
35949
|
};
|
|
35910
35950
|
if (groupFormId) {
|
|
35911
|
-
const _defaultData =
|
|
35912
|
-
const _newData =
|
|
35913
|
-
|
|
35951
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
35952
|
+
const _newData = {
|
|
35953
|
+
..._defaultData,
|
|
35954
|
+
..._val
|
|
35955
|
+
};
|
|
35956
|
+
onValuesChange(_newData, {
|
|
35957
|
+
...formsValue,
|
|
35914
35958
|
[groupFormId]: _newData
|
|
35915
|
-
})
|
|
35916
|
-
form
|
|
35917
|
-
setValues(
|
|
35959
|
+
});
|
|
35960
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
35961
|
+
setValues({
|
|
35962
|
+
...formsValue,
|
|
35918
35963
|
[groupFormId]: _newData
|
|
35919
|
-
})
|
|
35964
|
+
});
|
|
35920
35965
|
return;
|
|
35921
35966
|
}
|
|
35922
|
-
onValuesChange(_val,
|
|
35923
|
-
|
|
35924
|
-
|
|
35967
|
+
onValuesChange(_val, {
|
|
35968
|
+
...formsValue,
|
|
35969
|
+
..._val
|
|
35970
|
+
});
|
|
35971
|
+
form?.setFieldValue(name, _val[name]);
|
|
35972
|
+
setValues({
|
|
35973
|
+
...formsValue,
|
|
35974
|
+
..._val
|
|
35975
|
+
});
|
|
35925
35976
|
};
|
|
35926
35977
|
return /*#__PURE__*/jsxRuntime.jsx(DataLinkGroup, {
|
|
35927
35978
|
form: input,
|
|
@@ -35932,79 +35983,102 @@ const renderDataLinkGroup = _ref2 => {
|
|
|
35932
35983
|
isHighlighted: isHighlighted,
|
|
35933
35984
|
dataLinkInput: dataLinkInput,
|
|
35934
35985
|
formsValue: formsValue,
|
|
35935
|
-
values: groupFormId ?
|
|
35986
|
+
values: groupFormId ? {
|
|
35987
|
+
...(formsValue[groupFormId] || {}),
|
|
35936
35988
|
meta: {
|
|
35937
|
-
inputs: (
|
|
35989
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
35938
35990
|
}
|
|
35939
|
-
}
|
|
35991
|
+
} : formsValue,
|
|
35940
35992
|
name: name,
|
|
35941
35993
|
groupFormId: groupFormId,
|
|
35942
|
-
maxRepeat: input
|
|
35943
|
-
remove:
|
|
35944
|
-
|
|
35945
|
-
|
|
35946
|
-
} = _ref3;
|
|
35994
|
+
maxRepeat: input?.meta?.maxRepeat,
|
|
35995
|
+
remove: ({
|
|
35996
|
+
key
|
|
35997
|
+
}) => {
|
|
35947
35998
|
const _val = isSingle ? {
|
|
35948
35999
|
[name]: null
|
|
35949
36000
|
} : {
|
|
35950
36001
|
[name]: formData.filter((v, j) => j !== key)
|
|
35951
36002
|
};
|
|
35952
36003
|
if (groupFormId) {
|
|
35953
|
-
const _defaultData =
|
|
35954
|
-
const _newData =
|
|
35955
|
-
|
|
36004
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36005
|
+
const _newData = {
|
|
36006
|
+
..._defaultData,
|
|
36007
|
+
..._val
|
|
36008
|
+
};
|
|
36009
|
+
onValuesChange(_newData, {
|
|
36010
|
+
...formsValue,
|
|
35956
36011
|
[groupFormId]: _newData
|
|
35957
|
-
})
|
|
35958
|
-
form
|
|
35959
|
-
setValues(
|
|
36012
|
+
});
|
|
36013
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36014
|
+
setValues({
|
|
36015
|
+
...formsValue,
|
|
35960
36016
|
[groupFormId]: _newData
|
|
35961
|
-
})
|
|
36017
|
+
});
|
|
35962
36018
|
return;
|
|
35963
36019
|
}
|
|
35964
|
-
onValuesChange(_val,
|
|
35965
|
-
|
|
35966
|
-
|
|
36020
|
+
onValuesChange(_val, {
|
|
36021
|
+
...formsValue,
|
|
36022
|
+
..._val
|
|
36023
|
+
});
|
|
36024
|
+
form?.setFieldValue(name, _val[name]);
|
|
36025
|
+
setValues({
|
|
36026
|
+
...formsValue,
|
|
36027
|
+
..._val
|
|
36028
|
+
});
|
|
35967
36029
|
},
|
|
35968
36030
|
add: val => {
|
|
35969
36031
|
const _val = isSingle ? {
|
|
35970
36032
|
[name]: val
|
|
35971
36033
|
} : {
|
|
35972
|
-
[name]: [...formData,
|
|
36034
|
+
[name]: [...formData, {
|
|
36035
|
+
...val
|
|
36036
|
+
}]
|
|
35973
36037
|
};
|
|
35974
36038
|
if (groupFormId) {
|
|
35975
|
-
const _defaultData =
|
|
35976
|
-
const _newData =
|
|
35977
|
-
|
|
35978
|
-
|
|
36039
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36040
|
+
const _newData = {
|
|
36041
|
+
..._defaultData,
|
|
36042
|
+
..._val
|
|
36043
|
+
};
|
|
36044
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36045
|
+
onValuesChange(_newData, {
|
|
36046
|
+
...formsValue,
|
|
35979
36047
|
[groupFormId]: _newData
|
|
35980
|
-
})
|
|
35981
|
-
setValues(
|
|
36048
|
+
});
|
|
36049
|
+
setValues({
|
|
36050
|
+
...formsValue,
|
|
35982
36051
|
[groupFormId]: _newData
|
|
35983
|
-
})
|
|
36052
|
+
});
|
|
35984
36053
|
return;
|
|
35985
36054
|
}
|
|
35986
|
-
form
|
|
35987
|
-
onValuesChange(_val,
|
|
35988
|
-
|
|
36055
|
+
form?.setFieldValue(name, _val[name]);
|
|
36056
|
+
onValuesChange(_val, {
|
|
36057
|
+
...formsValue,
|
|
36058
|
+
..._val
|
|
36059
|
+
});
|
|
36060
|
+
setValues({
|
|
36061
|
+
...formsValue,
|
|
36062
|
+
..._val
|
|
36063
|
+
});
|
|
35989
36064
|
},
|
|
35990
36065
|
k: name,
|
|
35991
36066
|
formData: formData
|
|
35992
36067
|
});
|
|
35993
36068
|
};
|
|
35994
36069
|
function showHideInput$1(input, data, repeatIndex, repeatValues, inputMeta) {
|
|
35995
|
-
|
|
35996
|
-
if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
|
|
36070
|
+
if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
|
|
35997
36071
|
return false;
|
|
35998
36072
|
}
|
|
35999
|
-
if (typeof
|
|
36000
|
-
|
|
36001
|
-
return !(input !== null && input !== void 0 && (_input$meta4 = input.meta) !== null && _input$meta4 !== void 0 && _input$meta4.excludeFromEdit);
|
|
36073
|
+
if (typeof input?.meta?.excludeFromEdit === "boolean") {
|
|
36074
|
+
return !input?.meta?.excludeFromEdit;
|
|
36002
36075
|
}
|
|
36003
|
-
const formsValue =
|
|
36004
|
-
|
|
36005
|
-
|
|
36006
|
-
|
|
36007
|
-
|
|
36076
|
+
const formsValue = {
|
|
36077
|
+
...data
|
|
36078
|
+
};
|
|
36079
|
+
Object.keys(data?.meta?.inputs || {}).forEach(key => {
|
|
36080
|
+
const input = data?.meta?.inputs[key];
|
|
36081
|
+
if (input?.notApplicable || input?.notAvailable) {
|
|
36008
36082
|
formsValue[key] = undefined;
|
|
36009
36083
|
delete formsValue[key];
|
|
36010
36084
|
}
|
|
@@ -36063,35 +36137,35 @@ function getInputHeadLines$1(type, i, input, values) {
|
|
|
36063
36137
|
switch (type) {
|
|
36064
36138
|
case "h2":
|
|
36065
36139
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36066
|
-
className:
|
|
36140
|
+
className: `title-semibold-2 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36067
36141
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36068
36142
|
children: getInputLabel$1(input, values)
|
|
36069
36143
|
})
|
|
36070
36144
|
});
|
|
36071
36145
|
case "h3":
|
|
36072
36146
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36073
|
-
className:
|
|
36147
|
+
className: `title-semibold-3 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36074
36148
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36075
36149
|
children: getInputLabel$1(input, values)
|
|
36076
36150
|
})
|
|
36077
36151
|
});
|
|
36078
36152
|
case "h4":
|
|
36079
36153
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36080
|
-
className:
|
|
36154
|
+
className: `title-semibold-4 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36081
36155
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36082
36156
|
children: getInputLabel$1(input, values)
|
|
36083
36157
|
})
|
|
36084
36158
|
});
|
|
36085
36159
|
case "h5":
|
|
36086
36160
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36087
|
-
className:
|
|
36161
|
+
className: `title-semibold-5 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36088
36162
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36089
36163
|
children: getInputLabel$1(input, values)
|
|
36090
36164
|
})
|
|
36091
36165
|
});
|
|
36092
36166
|
case "h6":
|
|
36093
36167
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36094
|
-
className:
|
|
36168
|
+
className: `title-semibold-6 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36095
36169
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36096
36170
|
children: getInputLabel$1(input, values)
|
|
36097
36171
|
})
|
|
@@ -36100,16 +36174,15 @@ function getInputHeadLines$1(type, i, input, values) {
|
|
|
36100
36174
|
return null;
|
|
36101
36175
|
}
|
|
36102
36176
|
}
|
|
36103
|
-
function getInputProp(prop) {
|
|
36104
|
-
let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
36105
|
-
let scope = arguments.length > 2 ? arguments[2] : undefined;
|
|
36177
|
+
function getInputProp(prop, formsValue = {}, scope) {
|
|
36106
36178
|
if (prop && typeof prop === "object") {
|
|
36107
36179
|
const validations = Object.keys(prop);
|
|
36108
36180
|
const key = validations.find(v => {
|
|
36109
36181
|
let [path, match, wantedValue] = v.split(/( is | includes | not | notEmpty )/gim);
|
|
36110
|
-
const value = dot__default["default"].pick(path,
|
|
36182
|
+
const value = dot__default["default"].pick(path, {
|
|
36183
|
+
...formsValue,
|
|
36111
36184
|
scope
|
|
36112
|
-
})
|
|
36185
|
+
});
|
|
36113
36186
|
return _checkValue(wantedValue, match, value);
|
|
36114
36187
|
});
|
|
36115
36188
|
const label = key ? prop[key] : prop[validations[0]];
|
|
@@ -36118,33 +36191,29 @@ function getInputProp(prop) {
|
|
|
36118
36191
|
return prop;
|
|
36119
36192
|
}
|
|
36120
36193
|
}
|
|
36121
|
-
function getInputLabel$1(input) {
|
|
36122
|
-
let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
36123
|
-
let asText = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
36194
|
+
function getInputLabel$1(input, formsValue = {}, asText = false) {
|
|
36124
36195
|
return /*#__PURE__*/jsxRuntime.jsx(InputLabel, {
|
|
36125
36196
|
input: input,
|
|
36126
36197
|
formsValue: formsValue,
|
|
36127
36198
|
asText: asText
|
|
36128
36199
|
});
|
|
36129
36200
|
}
|
|
36130
|
-
const InputLabel =
|
|
36131
|
-
|
|
36132
|
-
|
|
36133
|
-
|
|
36134
|
-
|
|
36135
|
-
asText
|
|
36136
|
-
} = _ref4;
|
|
36201
|
+
const InputLabel = ({
|
|
36202
|
+
input,
|
|
36203
|
+
formsValue,
|
|
36204
|
+
asText
|
|
36205
|
+
}) => {
|
|
36137
36206
|
const {
|
|
36138
36207
|
t,
|
|
36139
36208
|
evaluationConfig,
|
|
36140
36209
|
scope
|
|
36141
36210
|
} = useEditContext();
|
|
36142
36211
|
const label = getInputProp(input.label, formsValue, scope);
|
|
36143
|
-
return input
|
|
36212
|
+
return input?.meta?.isEvaluation || input.description && typeof input.description === "string" && !asText ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
36144
36213
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
36145
36214
|
className: "flex",
|
|
36146
36215
|
children: [ReactHtmlParser__default["default"](label), /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
|
|
36147
|
-
content: input
|
|
36216
|
+
content: input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(EvaluationPopover, {
|
|
36148
36217
|
t: t,
|
|
36149
36218
|
evaluationConfig: evaluationConfig
|
|
36150
36219
|
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -36152,7 +36221,7 @@ const InputLabel = _ref4 => {
|
|
|
36152
36221
|
children: ReactHtmlParser__default["default"](input.description)
|
|
36153
36222
|
}),
|
|
36154
36223
|
placement: "top",
|
|
36155
|
-
children: !
|
|
36224
|
+
children: !input?.meta?.isEvaluation || evaluationConfig.length > 0 ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36156
36225
|
className: "flex flex-column justify-content-center ml-1",
|
|
36157
36226
|
children: /*#__PURE__*/jsxRuntime.jsx(TooltipIcon, {
|
|
36158
36227
|
fontSize: 13
|
|
@@ -36174,9 +36243,7 @@ function getSectionLabel$1(labels, values) {
|
|
|
36174
36243
|
}
|
|
36175
36244
|
return labels;
|
|
36176
36245
|
}
|
|
36177
|
-
function getSubtitles$1(subtitles, position) {
|
|
36178
|
-
let formsValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
36179
|
-
let repeatValues = arguments.length > 4 ? arguments[4] : undefined;
|
|
36246
|
+
function getSubtitles$1(subtitles, position, formsValue = {}, repeatIndex, repeatValues) {
|
|
36180
36247
|
let subtitle = subtitles && subtitles[position];
|
|
36181
36248
|
if (subtitle && typeof subtitle === "object") {
|
|
36182
36249
|
let newSubtitle = subtitle.default || "";
|
|
@@ -36220,12 +36287,14 @@ function getSubtitles$1(subtitles, position) {
|
|
|
36220
36287
|
function getFormTitles$1(titles, key, position) {
|
|
36221
36288
|
let tilte = titles && titles[key];
|
|
36222
36289
|
return tilte ? /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
36223
|
-
className:
|
|
36290
|
+
className: `title-semibold-3 mb0 ${position ? "mt-3" : ""}`,
|
|
36224
36291
|
children: tilte
|
|
36225
36292
|
}) : null;
|
|
36226
36293
|
}
|
|
36227
36294
|
const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsValue, name, mainForm) => {
|
|
36228
|
-
formsValue = Object.assign(formsValue,
|
|
36295
|
+
formsValue = Object.assign(formsValue, {
|
|
36296
|
+
...mainForm.getFieldsValue(true)
|
|
36297
|
+
});
|
|
36229
36298
|
if (typeof repeatIndex === "number" && repeatValues) {
|
|
36230
36299
|
if (!repeatValues[inputName] || !___default["default"].isEqual(repeatValues[inputName], value)) {
|
|
36231
36300
|
repeatValues[inputName] = value;
|
|
@@ -36260,16 +36329,14 @@ const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsVa
|
|
|
36260
36329
|
};
|
|
36261
36330
|
const inputOnBlur = [];
|
|
36262
36331
|
const inputTypeComponent$1 = {
|
|
36263
|
-
text: (
|
|
36264
|
-
|
|
36265
|
-
|
|
36266
|
-
|
|
36267
|
-
|
|
36268
|
-
|
|
36269
|
-
|
|
36270
|
-
|
|
36271
|
-
isHighlighted
|
|
36272
|
-
} = _ref6;
|
|
36332
|
+
text: ({
|
|
36333
|
+
props,
|
|
36334
|
+
rules
|
|
36335
|
+
}, {
|
|
36336
|
+
inputMeta = {},
|
|
36337
|
+
t,
|
|
36338
|
+
isHighlighted
|
|
36339
|
+
}) => {
|
|
36273
36340
|
const maxRule = rules.find(r => r.max);
|
|
36274
36341
|
const maxProps = {
|
|
36275
36342
|
maxLength: MAX_TEXT_AREA_LENGTH
|
|
@@ -36277,28 +36344,26 @@ const inputTypeComponent$1 = {
|
|
|
36277
36344
|
if (maxRule) {
|
|
36278
36345
|
maxProps.maxLength = maxRule.max;
|
|
36279
36346
|
}
|
|
36280
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input,
|
|
36281
|
-
size: "large"
|
|
36282
|
-
|
|
36347
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
36348
|
+
size: "large",
|
|
36349
|
+
...maxProps,
|
|
36283
36350
|
allowClear: true,
|
|
36284
36351
|
autoComplete: "new-password",
|
|
36285
|
-
type: "text"
|
|
36286
|
-
|
|
36352
|
+
type: "text",
|
|
36353
|
+
...props,
|
|
36287
36354
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36288
36355
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36289
36356
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
36290
|
-
})
|
|
36357
|
+
});
|
|
36291
36358
|
},
|
|
36292
|
-
link: (
|
|
36293
|
-
|
|
36294
|
-
|
|
36295
|
-
|
|
36296
|
-
|
|
36297
|
-
|
|
36298
|
-
|
|
36299
|
-
|
|
36300
|
-
isHighlighted
|
|
36301
|
-
} = _ref8;
|
|
36359
|
+
link: ({
|
|
36360
|
+
props,
|
|
36361
|
+
rules
|
|
36362
|
+
}, {
|
|
36363
|
+
inputMeta = {},
|
|
36364
|
+
t,
|
|
36365
|
+
isHighlighted
|
|
36366
|
+
}) => {
|
|
36302
36367
|
const maxRule = rules.find(r => r.max);
|
|
36303
36368
|
const maxProps = {
|
|
36304
36369
|
maxLength: MAX_TEXT_AREA_LENGTH
|
|
@@ -36306,32 +36371,29 @@ const inputTypeComponent$1 = {
|
|
|
36306
36371
|
if (maxRule) {
|
|
36307
36372
|
maxProps.maxLength = maxRule.max;
|
|
36308
36373
|
}
|
|
36309
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input,
|
|
36310
|
-
size: "large"
|
|
36311
|
-
|
|
36374
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
36375
|
+
size: "large",
|
|
36376
|
+
...maxProps,
|
|
36312
36377
|
allowClear: true,
|
|
36313
36378
|
autoComplete: "new-password",
|
|
36314
|
-
type: "text"
|
|
36315
|
-
|
|
36379
|
+
type: "text",
|
|
36380
|
+
...props,
|
|
36316
36381
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36317
36382
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36318
36383
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
36319
|
-
})
|
|
36384
|
+
});
|
|
36320
36385
|
},
|
|
36321
|
-
number: (
|
|
36322
|
-
|
|
36323
|
-
|
|
36324
|
-
|
|
36325
|
-
|
|
36326
|
-
|
|
36327
|
-
|
|
36328
|
-
|
|
36329
|
-
|
|
36330
|
-
t,
|
|
36331
|
-
isHighlighted
|
|
36332
|
-
} = _ref10;
|
|
36386
|
+
number: ({
|
|
36387
|
+
props,
|
|
36388
|
+
rules,
|
|
36389
|
+
input
|
|
36390
|
+
}, {
|
|
36391
|
+
inputMeta = {},
|
|
36392
|
+
t,
|
|
36393
|
+
isHighlighted
|
|
36394
|
+
}) => {
|
|
36333
36395
|
const maxRule = rules.find(r => r.max);
|
|
36334
|
-
const integerRule = !
|
|
36396
|
+
const integerRule = !input?.meta?.isDecimal;
|
|
36335
36397
|
const parser = value => {
|
|
36336
36398
|
if (!value) {
|
|
36337
36399
|
return "";
|
|
@@ -36342,63 +36404,60 @@ const inputTypeComponent$1 = {
|
|
|
36342
36404
|
return value.replace(/\$\s?|(,*)/g, "");
|
|
36343
36405
|
};
|
|
36344
36406
|
if (maxRule) {
|
|
36345
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber,
|
|
36407
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
36346
36408
|
size: "large",
|
|
36347
36409
|
allowClear: true,
|
|
36348
|
-
autoComplete: "new-password"
|
|
36349
|
-
|
|
36410
|
+
autoComplete: "new-password",
|
|
36411
|
+
...props,
|
|
36350
36412
|
type: "number",
|
|
36351
36413
|
parser: parser,
|
|
36352
36414
|
min: 0,
|
|
36353
36415
|
max: maxRule.max,
|
|
36354
36416
|
className: formatClassname([isHighlighted && "highlighted-input"])
|
|
36355
|
-
})
|
|
36417
|
+
});
|
|
36356
36418
|
}
|
|
36357
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber,
|
|
36419
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
36358
36420
|
size: "large",
|
|
36359
36421
|
allowClear: true,
|
|
36360
36422
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36361
|
-
autoComplete: "new-password"
|
|
36362
|
-
|
|
36423
|
+
autoComplete: "new-password",
|
|
36424
|
+
...props,
|
|
36363
36425
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36364
36426
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
|
|
36365
36427
|
min: 0,
|
|
36366
36428
|
formatter: value => numberWithCommas$1(value),
|
|
36367
36429
|
parser: parser
|
|
36368
|
-
})
|
|
36430
|
+
});
|
|
36369
36431
|
},
|
|
36370
36432
|
// eslint-disable-next-line no-unused-vars
|
|
36371
|
-
select: (
|
|
36372
|
-
|
|
36373
|
-
|
|
36374
|
-
|
|
36375
|
-
|
|
36376
|
-
|
|
36377
|
-
|
|
36378
|
-
|
|
36379
|
-
|
|
36380
|
-
|
|
36381
|
-
|
|
36382
|
-
|
|
36383
|
-
|
|
36384
|
-
|
|
36385
|
-
|
|
36386
|
-
|
|
36387
|
-
|
|
36388
|
-
|
|
36389
|
-
|
|
36390
|
-
|
|
36391
|
-
|
|
36392
|
-
|
|
36393
|
-
|
|
36394
|
-
|
|
36395
|
-
|
|
36396
|
-
|
|
36397
|
-
changeInputMeta,
|
|
36398
|
-
groupFormId
|
|
36399
|
-
} = _ref12;
|
|
36433
|
+
select: ({
|
|
36434
|
+
value,
|
|
36435
|
+
options,
|
|
36436
|
+
optionGroup,
|
|
36437
|
+
props,
|
|
36438
|
+
formsValue,
|
|
36439
|
+
optionsFilter,
|
|
36440
|
+
filterCond,
|
|
36441
|
+
repeatValues,
|
|
36442
|
+
repeatIndex,
|
|
36443
|
+
name,
|
|
36444
|
+
inputName,
|
|
36445
|
+
address,
|
|
36446
|
+
addressData,
|
|
36447
|
+
input,
|
|
36448
|
+
scope
|
|
36449
|
+
}, {
|
|
36450
|
+
forms,
|
|
36451
|
+
form,
|
|
36452
|
+
setAddress,
|
|
36453
|
+
inputMeta = {},
|
|
36454
|
+
t,
|
|
36455
|
+
isHighlighted,
|
|
36456
|
+
changeInputMeta,
|
|
36457
|
+
groupFormId
|
|
36458
|
+
}) => {
|
|
36400
36459
|
let opts;
|
|
36401
|
-
const isEvaluation = input
|
|
36460
|
+
const isEvaluation = input?.meta?.isEvaluation;
|
|
36402
36461
|
let defaultValue = value;
|
|
36403
36462
|
if (typeof options === "string") {
|
|
36404
36463
|
const [formName, key] = options.split(".");
|
|
@@ -36423,7 +36482,7 @@ const inputTypeComponent$1 = {
|
|
|
36423
36482
|
opts = [];
|
|
36424
36483
|
}
|
|
36425
36484
|
} else {
|
|
36426
|
-
opts = options
|
|
36485
|
+
opts = options?.filter(o => !o.onlyView);
|
|
36427
36486
|
}
|
|
36428
36487
|
opts = JSON.parse(JSON.stringify(opts || []));
|
|
36429
36488
|
opts = opts.map(o => getSelectOptions$2(o, formsValue));
|
|
@@ -36433,7 +36492,7 @@ const inputTypeComponent$1 = {
|
|
|
36433
36492
|
const uniqueDefaultKeys = getUniqueDefaultKeys(options);
|
|
36434
36493
|
|
|
36435
36494
|
// Handle default value logic
|
|
36436
|
-
if (!propHasValue$1(value) && propHasValue$1(input
|
|
36495
|
+
if (!propHasValue$1(value) && propHasValue$1(input?.meta?.defaultValue)) {
|
|
36437
36496
|
// If no current value but there's a default value, use the default
|
|
36438
36497
|
value = input.meta.defaultValue;
|
|
36439
36498
|
defaultValue = value;
|
|
@@ -36466,7 +36525,7 @@ const inputTypeComponent$1 = {
|
|
|
36466
36525
|
}
|
|
36467
36526
|
opts = groupOptions;
|
|
36468
36527
|
}
|
|
36469
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select,
|
|
36528
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
36470
36529
|
size: "large",
|
|
36471
36530
|
autoComplete: "new-password",
|
|
36472
36531
|
allowClear: true,
|
|
@@ -36475,32 +36534,35 @@ const inputTypeComponent$1 = {
|
|
|
36475
36534
|
value: value // Use value instead of defaultValue for controlled behavior
|
|
36476
36535
|
,
|
|
36477
36536
|
filterOption: filterSelectOptions,
|
|
36478
|
-
optionFilterProp: "children"
|
|
36479
|
-
|
|
36537
|
+
optionFilterProp: "children",
|
|
36538
|
+
...props,
|
|
36480
36539
|
className: formatClassname([isHighlighted && "highlighted-select"]),
|
|
36481
36540
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36482
36541
|
placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select one option"),
|
|
36483
36542
|
onChange: (val, selectedValue) => {
|
|
36484
36543
|
// ONLY FOR SBG EVALUATON !!
|
|
36485
36544
|
if (isEvaluation && val === "na" && groupFormId) {
|
|
36486
|
-
var _formsValue$meta2;
|
|
36487
36545
|
changeInputMeta({
|
|
36488
36546
|
key: groupFormId,
|
|
36489
|
-
value:
|
|
36547
|
+
value: {
|
|
36548
|
+
...(formsValue?.meta?.inputs?.[groupFormId] || {}),
|
|
36490
36549
|
documentation: {
|
|
36491
36550
|
notApplicable: true
|
|
36492
36551
|
}
|
|
36493
|
-
}
|
|
36552
|
+
},
|
|
36494
36553
|
otherValues: {
|
|
36495
|
-
[groupFormId]:
|
|
36554
|
+
[groupFormId]: {
|
|
36555
|
+
...(formsValue?.[groupFormId] || {}),
|
|
36496
36556
|
[name]: val
|
|
36497
|
-
}
|
|
36557
|
+
}
|
|
36498
36558
|
}
|
|
36499
36559
|
});
|
|
36500
36560
|
}
|
|
36501
36561
|
if (address && selectedValue) {
|
|
36502
36562
|
dot__default["default"].str(address, selectedValue.children, addressData);
|
|
36503
|
-
setAddress(
|
|
36563
|
+
setAddress({
|
|
36564
|
+
...addressData
|
|
36565
|
+
});
|
|
36504
36566
|
}
|
|
36505
36567
|
if (props.onChange) {
|
|
36506
36568
|
props.onChange(val);
|
|
@@ -36531,15 +36593,15 @@ const inputTypeComponent$1 = {
|
|
|
36531
36593
|
if (og.disabled !== undefined) {
|
|
36532
36594
|
groupOtherProps.disabled = og.disabled;
|
|
36533
36595
|
}
|
|
36534
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36535
|
-
value: og.value
|
|
36536
|
-
|
|
36596
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36597
|
+
value: og.value,
|
|
36598
|
+
...groupOtherProps,
|
|
36537
36599
|
children: og.label
|
|
36538
|
-
}
|
|
36600
|
+
}, `${i}${j}`);
|
|
36539
36601
|
})
|
|
36540
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36541
|
-
value: option.value
|
|
36542
|
-
|
|
36602
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36603
|
+
value: option.value,
|
|
36604
|
+
...otherProps,
|
|
36543
36605
|
children: isEvaluation ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
36544
36606
|
className: "flex",
|
|
36545
36607
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -36547,35 +36609,33 @@ const inputTypeComponent$1 = {
|
|
|
36547
36609
|
children: sgbEvaluationIcons[option.value]
|
|
36548
36610
|
}), option.label]
|
|
36549
36611
|
}) : option.label
|
|
36550
|
-
}
|
|
36612
|
+
}, option.value);
|
|
36551
36613
|
})
|
|
36552
|
-
})
|
|
36614
|
+
});
|
|
36553
36615
|
},
|
|
36554
|
-
multiselect: (
|
|
36555
|
-
|
|
36556
|
-
|
|
36557
|
-
|
|
36558
|
-
|
|
36559
|
-
|
|
36560
|
-
|
|
36561
|
-
|
|
36562
|
-
|
|
36563
|
-
|
|
36564
|
-
|
|
36565
|
-
|
|
36566
|
-
|
|
36567
|
-
|
|
36568
|
-
|
|
36569
|
-
|
|
36570
|
-
|
|
36571
|
-
|
|
36572
|
-
|
|
36573
|
-
|
|
36574
|
-
|
|
36575
|
-
|
|
36576
|
-
|
|
36577
|
-
isHighlighted
|
|
36578
|
-
} = _ref14;
|
|
36616
|
+
multiselect: ({
|
|
36617
|
+
value,
|
|
36618
|
+
options,
|
|
36619
|
+
optionGroup,
|
|
36620
|
+
optionsFilter,
|
|
36621
|
+
filterCond,
|
|
36622
|
+
props,
|
|
36623
|
+
formsValue,
|
|
36624
|
+
repeatValues,
|
|
36625
|
+
repeatIndex,
|
|
36626
|
+
inputName,
|
|
36627
|
+
name,
|
|
36628
|
+
tags,
|
|
36629
|
+
maxWidth,
|
|
36630
|
+
staticWidth,
|
|
36631
|
+
fullWidth
|
|
36632
|
+
}, {
|
|
36633
|
+
forms,
|
|
36634
|
+
form,
|
|
36635
|
+
inputMeta = {},
|
|
36636
|
+
t,
|
|
36637
|
+
isHighlighted
|
|
36638
|
+
}) => {
|
|
36579
36639
|
let opts;
|
|
36580
36640
|
if (typeof options === "string") {
|
|
36581
36641
|
const [formName, key] = options.split(".");
|
|
@@ -36637,17 +36697,17 @@ const inputTypeComponent$1 = {
|
|
|
36637
36697
|
staticWidth,
|
|
36638
36698
|
fullWidth
|
|
36639
36699
|
});
|
|
36640
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select,
|
|
36700
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
36641
36701
|
size: "medium",
|
|
36642
36702
|
allowClear: true,
|
|
36643
36703
|
autoComplete: "new-password",
|
|
36644
36704
|
mode: tags ? "tags" : "multiple",
|
|
36645
|
-
optionFilterProp: "children"
|
|
36646
|
-
|
|
36647
|
-
|
|
36648
|
-
|
|
36649
|
-
filterOption: filterSelectOptions
|
|
36650
|
-
|
|
36705
|
+
optionFilterProp: "children",
|
|
36706
|
+
...(tags ? {
|
|
36707
|
+
tokenSeparators: [","]
|
|
36708
|
+
} : {}),
|
|
36709
|
+
filterOption: filterSelectOptions,
|
|
36710
|
+
...props,
|
|
36651
36711
|
className: formatClassname([isHighlighted && "highlighted-select"]),
|
|
36652
36712
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36653
36713
|
placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select all relevant options"),
|
|
@@ -36686,52 +36746,51 @@ const inputTypeComponent$1 = {
|
|
|
36686
36746
|
if (og.disabled !== undefined) {
|
|
36687
36747
|
groupOtherProps.disabled = og.disabled;
|
|
36688
36748
|
}
|
|
36689
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36690
|
-
value: og.value
|
|
36691
|
-
|
|
36749
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36750
|
+
value: og.value,
|
|
36751
|
+
...groupOtherProps,
|
|
36692
36752
|
children: og.label
|
|
36693
|
-
}
|
|
36753
|
+
}, `${i}${j}`);
|
|
36694
36754
|
})
|
|
36695
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36696
|
-
value: option.value
|
|
36697
|
-
|
|
36755
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36756
|
+
value: option.value,
|
|
36757
|
+
...otherProps,
|
|
36698
36758
|
children: option.label
|
|
36699
|
-
}
|
|
36759
|
+
}, i);
|
|
36700
36760
|
})
|
|
36701
|
-
})
|
|
36761
|
+
});
|
|
36702
36762
|
},
|
|
36703
|
-
date: (
|
|
36704
|
-
|
|
36705
|
-
|
|
36706
|
-
|
|
36707
|
-
|
|
36708
|
-
|
|
36709
|
-
|
|
36710
|
-
|
|
36711
|
-
|
|
36712
|
-
|
|
36713
|
-
|
|
36714
|
-
|
|
36715
|
-
|
|
36716
|
-
|
|
36717
|
-
isHighlighted,
|
|
36718
|
-
groupFormId
|
|
36719
|
-
} = _ref16;
|
|
36763
|
+
date: ({
|
|
36764
|
+
props,
|
|
36765
|
+
rules,
|
|
36766
|
+
repeatValues,
|
|
36767
|
+
formsValue,
|
|
36768
|
+
name
|
|
36769
|
+
}, {
|
|
36770
|
+
setFormValues,
|
|
36771
|
+
inputMeta,
|
|
36772
|
+
form,
|
|
36773
|
+
t,
|
|
36774
|
+
isHighlighted,
|
|
36775
|
+
groupFormId
|
|
36776
|
+
}) => {
|
|
36720
36777
|
const lng = localStorage.getItem("datastakeLng") || "en";
|
|
36721
36778
|
const maxRule = rules.find(r => r.max);
|
|
36722
|
-
let value = groupFormId ? formsValue
|
|
36779
|
+
let value = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue[name];
|
|
36723
36780
|
const handleDateChange = date => {
|
|
36724
36781
|
if (date) {
|
|
36725
36782
|
// const localDate = dayjs.utc(date).add(dayjs(date).utcOffset(), 'minutes');
|
|
36726
36783
|
const localDate = dayjs__default["default"].utc(date);
|
|
36727
36784
|
if (groupFormId) {
|
|
36728
|
-
const _new =
|
|
36785
|
+
const _new = {
|
|
36786
|
+
...(formsValue[groupFormId] || {}),
|
|
36729
36787
|
[name]: localDate
|
|
36730
|
-
}
|
|
36788
|
+
};
|
|
36731
36789
|
form.setFieldValue(groupFormId, _new);
|
|
36732
|
-
setFormValues(
|
|
36790
|
+
setFormValues({
|
|
36791
|
+
...formsValue,
|
|
36733
36792
|
[groupFormId]: _new
|
|
36734
|
-
})
|
|
36793
|
+
});
|
|
36735
36794
|
} else {
|
|
36736
36795
|
form.setFieldValue(name, localDate);
|
|
36737
36796
|
}
|
|
@@ -36740,13 +36799,15 @@ const inputTypeComponent$1 = {
|
|
|
36740
36799
|
if (groupFormId) {
|
|
36741
36800
|
if (typeof value === "string" || typeof value === "undefined") {
|
|
36742
36801
|
value = typeof value === "string" ? dayjs__default["default"].utc(value) : null;
|
|
36743
|
-
const _new =
|
|
36802
|
+
const _new = {
|
|
36803
|
+
...(formsValue[groupFormId] || {}),
|
|
36744
36804
|
[name]: value
|
|
36745
|
-
}
|
|
36805
|
+
};
|
|
36746
36806
|
form.setFieldValue(groupFormId, _new);
|
|
36747
|
-
setFormValues(
|
|
36807
|
+
setFormValues({
|
|
36808
|
+
...formsValue,
|
|
36748
36809
|
[groupFormId]: _new
|
|
36749
|
-
})
|
|
36810
|
+
});
|
|
36750
36811
|
}
|
|
36751
36812
|
} else {
|
|
36752
36813
|
if (typeof value === "string") {
|
|
@@ -36762,13 +36823,12 @@ const inputTypeComponent$1 = {
|
|
|
36762
36823
|
checkForMax = checkCondition$1(maxRule.condition, repeatValues, formsValue);
|
|
36763
36824
|
}
|
|
36764
36825
|
if (checkForMax) {
|
|
36765
|
-
|
|
36766
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
|
|
36826
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
36767
36827
|
size: "large",
|
|
36768
36828
|
allowClear: true,
|
|
36769
|
-
autoComplete: "new-password"
|
|
36770
|
-
|
|
36771
|
-
value: value ? dayjs__default["default"](
|
|
36829
|
+
autoComplete: "new-password",
|
|
36830
|
+
...props,
|
|
36831
|
+
value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
|
|
36772
36832
|
onChange: handleDateChange,
|
|
36773
36833
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36774
36834
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
@@ -36778,54 +36838,49 @@ const inputTypeComponent$1 = {
|
|
|
36778
36838
|
disabledDate: current => {
|
|
36779
36839
|
return current && current >= dayjs__default["default"]().endOf("day");
|
|
36780
36840
|
}
|
|
36781
|
-
})
|
|
36841
|
+
});
|
|
36782
36842
|
}
|
|
36783
36843
|
}
|
|
36784
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker,
|
|
36844
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
36785
36845
|
size: "large",
|
|
36786
36846
|
allowClear: true,
|
|
36787
|
-
autoComplete: "new-password"
|
|
36788
|
-
|
|
36789
|
-
value: value ? dayjs__default["default"](
|
|
36847
|
+
autoComplete: "new-password",
|
|
36848
|
+
...props,
|
|
36849
|
+
value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
|
|
36790
36850
|
onChange: handleDateChange,
|
|
36791
36851
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36792
36852
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36793
36853
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder,
|
|
36794
36854
|
format: DATE_FORMATS,
|
|
36795
36855
|
locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"]
|
|
36796
|
-
})
|
|
36856
|
+
});
|
|
36797
36857
|
},
|
|
36798
|
-
groupExpandable: (
|
|
36799
|
-
|
|
36800
|
-
|
|
36801
|
-
|
|
36802
|
-
|
|
36803
|
-
|
|
36804
|
-
|
|
36805
|
-
|
|
36806
|
-
groupFormId
|
|
36807
|
-
} = _ref18;
|
|
36808
|
-
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];
|
|
36858
|
+
groupExpandable: ({
|
|
36859
|
+
formsValue,
|
|
36860
|
+
name,
|
|
36861
|
+
input
|
|
36862
|
+
}, {
|
|
36863
|
+
groupFormId
|
|
36864
|
+
}) => {
|
|
36865
|
+
const data = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue?.[name];
|
|
36809
36866
|
return /*#__PURE__*/jsxRuntime.jsx(GroupExpandable, {
|
|
36810
36867
|
input: input,
|
|
36811
36868
|
formsValue: formsValue,
|
|
36812
36869
|
data: data
|
|
36813
36870
|
});
|
|
36814
36871
|
},
|
|
36815
|
-
comment: (
|
|
36816
|
-
|
|
36817
|
-
|
|
36818
|
-
|
|
36819
|
-
|
|
36820
|
-
|
|
36821
|
-
|
|
36822
|
-
|
|
36823
|
-
|
|
36824
|
-
|
|
36825
|
-
|
|
36826
|
-
|
|
36827
|
-
} = _ref20;
|
|
36828
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
|
|
36872
|
+
comment: ({
|
|
36873
|
+
props: {
|
|
36874
|
+
placeholder,
|
|
36875
|
+
...props
|
|
36876
|
+
},
|
|
36877
|
+
commentHint
|
|
36878
|
+
}, {
|
|
36879
|
+
onChange,
|
|
36880
|
+
value,
|
|
36881
|
+
isHighlighted
|
|
36882
|
+
}) => {
|
|
36883
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
|
|
36829
36884
|
allowClear: true,
|
|
36830
36885
|
value: value,
|
|
36831
36886
|
onChange: e => onChange(e.target.value),
|
|
@@ -36836,27 +36891,26 @@ const inputTypeComponent$1 = {
|
|
|
36836
36891
|
autoSize: {
|
|
36837
36892
|
minRows: 5,
|
|
36838
36893
|
maxRows: 5
|
|
36839
|
-
}
|
|
36840
|
-
|
|
36894
|
+
},
|
|
36895
|
+
...props,
|
|
36841
36896
|
disabled: false
|
|
36842
|
-
})
|
|
36897
|
+
});
|
|
36843
36898
|
},
|
|
36844
|
-
tableComment: (
|
|
36845
|
-
|
|
36846
|
-
|
|
36847
|
-
|
|
36848
|
-
|
|
36849
|
-
|
|
36850
|
-
|
|
36851
|
-
|
|
36852
|
-
|
|
36853
|
-
|
|
36854
|
-
|
|
36855
|
-
|
|
36856
|
-
} = _ref22;
|
|
36857
|
-
const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => _objectSpread2(_objectSpread2({}, v), {}, {
|
|
36899
|
+
tableComment: ({
|
|
36900
|
+
setValues,
|
|
36901
|
+
name,
|
|
36902
|
+
onValuesChange,
|
|
36903
|
+
formsValue
|
|
36904
|
+
}, {
|
|
36905
|
+
form,
|
|
36906
|
+
groupFormId,
|
|
36907
|
+
isHighlighted
|
|
36908
|
+
}) => {
|
|
36909
|
+
const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => ({
|
|
36910
|
+
...v,
|
|
36858
36911
|
key: i
|
|
36859
|
-
})) : (formsValue[name] || []).map((v, i) =>
|
|
36912
|
+
})) : (formsValue[name] || []).map((v, i) => ({
|
|
36913
|
+
...v,
|
|
36860
36914
|
key: i
|
|
36861
36915
|
}));
|
|
36862
36916
|
const onUpdate = (val, i) => {
|
|
@@ -36864,89 +36918,121 @@ const inputTypeComponent$1 = {
|
|
|
36864
36918
|
[name]: formData.map((d, j) => i === j ? val : d)
|
|
36865
36919
|
};
|
|
36866
36920
|
if (groupFormId) {
|
|
36867
|
-
const _defaultData =
|
|
36868
|
-
const _newData =
|
|
36869
|
-
|
|
36921
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36922
|
+
const _newData = {
|
|
36923
|
+
..._defaultData,
|
|
36924
|
+
..._val
|
|
36925
|
+
};
|
|
36926
|
+
onValuesChange(_newData, {
|
|
36927
|
+
...formsValue,
|
|
36870
36928
|
[groupFormId]: _newData
|
|
36871
|
-
})
|
|
36872
|
-
form
|
|
36873
|
-
setValues(
|
|
36929
|
+
});
|
|
36930
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36931
|
+
setValues({
|
|
36932
|
+
...formsValue,
|
|
36874
36933
|
[groupFormId]: _newData
|
|
36875
|
-
})
|
|
36934
|
+
});
|
|
36876
36935
|
return;
|
|
36877
36936
|
}
|
|
36878
|
-
onValuesChange(_val,
|
|
36879
|
-
|
|
36880
|
-
|
|
36937
|
+
onValuesChange(_val, {
|
|
36938
|
+
...formsValue,
|
|
36939
|
+
..._val
|
|
36940
|
+
});
|
|
36941
|
+
form?.setFieldValue(name, _val[name]);
|
|
36942
|
+
setValues({
|
|
36943
|
+
...formsValue,
|
|
36944
|
+
..._val
|
|
36945
|
+
});
|
|
36881
36946
|
};
|
|
36882
36947
|
return /*#__PURE__*/jsxRuntime.jsx(Comment, {
|
|
36883
36948
|
onUpdate: onUpdate,
|
|
36884
36949
|
isHighlighted: isHighlighted,
|
|
36885
36950
|
form: form,
|
|
36886
|
-
values: groupFormId ?
|
|
36951
|
+
values: groupFormId ? {
|
|
36952
|
+
...(formsValue[groupFormId] || {}),
|
|
36887
36953
|
meta: {
|
|
36888
|
-
inputs: (
|
|
36954
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
36889
36955
|
}
|
|
36890
|
-
}
|
|
36956
|
+
} : formsValue,
|
|
36891
36957
|
name: name,
|
|
36892
|
-
remove:
|
|
36893
|
-
|
|
36894
|
-
|
|
36895
|
-
} = _ref23;
|
|
36958
|
+
remove: ({
|
|
36959
|
+
key
|
|
36960
|
+
}) => {
|
|
36896
36961
|
const _val = {
|
|
36897
36962
|
[name]: formData.filter(v => v.key !== key)
|
|
36898
36963
|
};
|
|
36899
36964
|
if (groupFormId) {
|
|
36900
|
-
const _defaultData =
|
|
36901
|
-
const _newData =
|
|
36902
|
-
|
|
36965
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36966
|
+
const _newData = {
|
|
36967
|
+
..._defaultData,
|
|
36968
|
+
..._val
|
|
36969
|
+
};
|
|
36970
|
+
onValuesChange(_newData, {
|
|
36971
|
+
...formsValue,
|
|
36903
36972
|
[groupFormId]: _newData
|
|
36904
|
-
})
|
|
36905
|
-
form
|
|
36906
|
-
setValues(
|
|
36973
|
+
});
|
|
36974
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36975
|
+
setValues({
|
|
36976
|
+
...formsValue,
|
|
36907
36977
|
[groupFormId]: _newData
|
|
36908
|
-
})
|
|
36978
|
+
});
|
|
36909
36979
|
return;
|
|
36910
36980
|
}
|
|
36911
|
-
onValuesChange(_val,
|
|
36912
|
-
|
|
36913
|
-
|
|
36981
|
+
onValuesChange(_val, {
|
|
36982
|
+
...formsValue,
|
|
36983
|
+
..._val
|
|
36984
|
+
});
|
|
36985
|
+
form?.setFieldValue(name, _val[name]);
|
|
36986
|
+
setValues({
|
|
36987
|
+
...formsValue,
|
|
36988
|
+
..._val
|
|
36989
|
+
});
|
|
36914
36990
|
},
|
|
36915
36991
|
add: val => {
|
|
36916
36992
|
const _val = {
|
|
36917
|
-
[name]: [...formData,
|
|
36993
|
+
[name]: [...formData, {
|
|
36994
|
+
...val,
|
|
36918
36995
|
key: formData.length
|
|
36919
|
-
}
|
|
36996
|
+
}]
|
|
36920
36997
|
};
|
|
36921
36998
|
if (groupFormId) {
|
|
36922
|
-
const _defaultData =
|
|
36923
|
-
const _newData =
|
|
36924
|
-
|
|
36925
|
-
|
|
36999
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
37000
|
+
const _newData = {
|
|
37001
|
+
..._defaultData,
|
|
37002
|
+
..._val
|
|
37003
|
+
};
|
|
37004
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
37005
|
+
onValuesChange(_newData, {
|
|
37006
|
+
...formsValue,
|
|
36926
37007
|
[groupFormId]: _newData
|
|
36927
|
-
})
|
|
36928
|
-
setValues(
|
|
37008
|
+
});
|
|
37009
|
+
setValues({
|
|
37010
|
+
...formsValue,
|
|
36929
37011
|
[groupFormId]: _newData
|
|
36930
|
-
})
|
|
37012
|
+
});
|
|
36931
37013
|
return;
|
|
36932
37014
|
}
|
|
36933
|
-
form
|
|
36934
|
-
onValuesChange(_val,
|
|
36935
|
-
|
|
37015
|
+
form?.setFieldValue(name, _val[name]);
|
|
37016
|
+
onValuesChange(_val, {
|
|
37017
|
+
...formsValue,
|
|
37018
|
+
..._val
|
|
37019
|
+
});
|
|
37020
|
+
setValues({
|
|
37021
|
+
...formsValue,
|
|
37022
|
+
..._val
|
|
37023
|
+
});
|
|
36936
37024
|
},
|
|
36937
37025
|
k: name
|
|
36938
37026
|
});
|
|
36939
37027
|
},
|
|
36940
|
-
textarea: (
|
|
36941
|
-
|
|
36942
|
-
|
|
36943
|
-
|
|
36944
|
-
|
|
36945
|
-
|
|
36946
|
-
|
|
36947
|
-
|
|
36948
|
-
isHighlighted
|
|
36949
|
-
} = _ref25;
|
|
37028
|
+
textarea: ({
|
|
37029
|
+
props,
|
|
37030
|
+
rules
|
|
37031
|
+
}, {
|
|
37032
|
+
inputMeta,
|
|
37033
|
+
t,
|
|
37034
|
+
isHighlighted
|
|
37035
|
+
}) => {
|
|
36950
37036
|
const maxRule = rules.find(r => r.max);
|
|
36951
37037
|
let maxLength = MAX_TEXT_AREA_LENGTH;
|
|
36952
37038
|
let rows = 5;
|
|
@@ -36973,7 +37059,7 @@ const inputTypeComponent$1 = {
|
|
|
36973
37059
|
// rows = 14;
|
|
36974
37060
|
// }
|
|
36975
37061
|
}
|
|
36976
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea,
|
|
37062
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
|
|
36977
37063
|
allowClear: true,
|
|
36978
37064
|
autoComplete: "new-password",
|
|
36979
37065
|
maxLength: maxLength,
|
|
@@ -36981,37 +37067,35 @@ const inputTypeComponent$1 = {
|
|
|
36981
37067
|
autoSize: {
|
|
36982
37068
|
minRows: rows,
|
|
36983
37069
|
maxRows: rows
|
|
36984
|
-
}
|
|
36985
|
-
|
|
37070
|
+
},
|
|
37071
|
+
...props,
|
|
36986
37072
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36987
37073
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
36988
|
-
})
|
|
37074
|
+
});
|
|
36989
37075
|
},
|
|
36990
|
-
phoneNumber: (
|
|
36991
|
-
|
|
36992
|
-
|
|
36993
|
-
|
|
36994
|
-
|
|
36995
|
-
|
|
36996
|
-
|
|
36997
|
-
|
|
36998
|
-
|
|
36999
|
-
|
|
37000
|
-
|
|
37001
|
-
|
|
37002
|
-
|
|
37003
|
-
|
|
37004
|
-
|
|
37005
|
-
} = _ref27;
|
|
37006
|
-
return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, _objectSpread2(_objectSpread2({
|
|
37076
|
+
phoneNumber: ({
|
|
37077
|
+
name,
|
|
37078
|
+
inputName,
|
|
37079
|
+
props,
|
|
37080
|
+
value,
|
|
37081
|
+
repeatIndex,
|
|
37082
|
+
repeatValues,
|
|
37083
|
+
formsValue
|
|
37084
|
+
}, {
|
|
37085
|
+
setFormValues,
|
|
37086
|
+
inputMeta,
|
|
37087
|
+
t,
|
|
37088
|
+
isHighlighted
|
|
37089
|
+
}) => {
|
|
37090
|
+
return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, {
|
|
37007
37091
|
customSelectWidthPercentage: "20%",
|
|
37008
37092
|
t: t,
|
|
37009
37093
|
size: "large",
|
|
37010
37094
|
allowClear: true,
|
|
37011
|
-
country: formsValue
|
|
37095
|
+
country: formsValue?.country,
|
|
37012
37096
|
initialValue: value,
|
|
37013
|
-
name: name
|
|
37014
|
-
|
|
37097
|
+
name: name,
|
|
37098
|
+
...props,
|
|
37015
37099
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37016
37100
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
37017
37101
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type Number"),
|
|
@@ -37032,27 +37116,26 @@ const inputTypeComponent$1 = {
|
|
|
37032
37116
|
}
|
|
37033
37117
|
return val;
|
|
37034
37118
|
}
|
|
37035
|
-
})
|
|
37119
|
+
});
|
|
37036
37120
|
},
|
|
37037
|
-
switch: (
|
|
37038
|
-
|
|
37039
|
-
|
|
37040
|
-
|
|
37041
|
-
|
|
37042
|
-
|
|
37043
|
-
|
|
37044
|
-
|
|
37045
|
-
|
|
37046
|
-
|
|
37047
|
-
|
|
37048
|
-
|
|
37049
|
-
|
|
37050
|
-
|
|
37051
|
-
|
|
37052
|
-
|
|
37053
|
-
|
|
37054
|
-
|
|
37055
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
37121
|
+
switch: ({
|
|
37122
|
+
props,
|
|
37123
|
+
value,
|
|
37124
|
+
restricted,
|
|
37125
|
+
autocomplete,
|
|
37126
|
+
formsValue,
|
|
37127
|
+
repeatValues,
|
|
37128
|
+
repeatIndex,
|
|
37129
|
+
name,
|
|
37130
|
+
inputName,
|
|
37131
|
+
replace: replaceInput,
|
|
37132
|
+
unique
|
|
37133
|
+
}, {
|
|
37134
|
+
form,
|
|
37135
|
+
isHighlighted
|
|
37136
|
+
}) => {
|
|
37137
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, {
|
|
37138
|
+
...props,
|
|
37056
37139
|
size: "default",
|
|
37057
37140
|
defaultChecked: value || false,
|
|
37058
37141
|
checked: value || false,
|
|
@@ -37080,7 +37163,9 @@ const inputTypeComponent$1 = {
|
|
|
37080
37163
|
const [formName, replaceInputName] = replaceTo.split(".");
|
|
37081
37164
|
const replaceRepeatValues = replaceInputName ? dot__default["default"].pick(formName, formsValue) : undefined;
|
|
37082
37165
|
updateFormValues$1(undefined, replaceRepeatValues, replaceInputName, isChecked ? newId : undefined, formsValue, formName, form);
|
|
37083
|
-
formsValue = Object.assign(formsValue,
|
|
37166
|
+
formsValue = Object.assign(formsValue, {
|
|
37167
|
+
...form.getFieldsValue(true)
|
|
37168
|
+
});
|
|
37084
37169
|
if (oldId) {
|
|
37085
37170
|
const allRepeatValues = dot__default["default"].pick(name, formsValue);
|
|
37086
37171
|
if (allRepeatValues && Array.isArray(allRepeatValues)) {
|
|
@@ -37121,22 +37206,20 @@ const inputTypeComponent$1 = {
|
|
|
37121
37206
|
}
|
|
37122
37207
|
}
|
|
37123
37208
|
}
|
|
37124
|
-
})
|
|
37209
|
+
});
|
|
37125
37210
|
},
|
|
37126
|
-
radioGroup: (
|
|
37127
|
-
|
|
37128
|
-
|
|
37129
|
-
|
|
37130
|
-
|
|
37131
|
-
|
|
37132
|
-
|
|
37133
|
-
|
|
37134
|
-
isHighlighted
|
|
37135
|
-
} = _ref31;
|
|
37211
|
+
radioGroup: ({
|
|
37212
|
+
props,
|
|
37213
|
+
value,
|
|
37214
|
+
options,
|
|
37215
|
+
isRisk
|
|
37216
|
+
}, {
|
|
37217
|
+
isHighlighted
|
|
37218
|
+
}) => {
|
|
37136
37219
|
if (isRisk) {
|
|
37137
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group,
|
|
37138
|
-
value: value
|
|
37139
|
-
|
|
37220
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
|
|
37221
|
+
value: value,
|
|
37222
|
+
...props,
|
|
37140
37223
|
className: "is-risk-radio",
|
|
37141
37224
|
children: (options || []).map(o => {
|
|
37142
37225
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
|
|
@@ -37150,11 +37233,11 @@ const inputTypeComponent$1 = {
|
|
|
37150
37233
|
}) : null]
|
|
37151
37234
|
}, o.value);
|
|
37152
37235
|
})
|
|
37153
|
-
})
|
|
37236
|
+
});
|
|
37154
37237
|
}
|
|
37155
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group,
|
|
37156
|
-
value: value
|
|
37157
|
-
|
|
37238
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
|
|
37239
|
+
value: value,
|
|
37240
|
+
...props,
|
|
37158
37241
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37159
37242
|
children: (options || []).map(o => {
|
|
37160
37243
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
|
|
@@ -37168,20 +37251,18 @@ const inputTypeComponent$1 = {
|
|
|
37168
37251
|
}) : null]
|
|
37169
37252
|
}, o.value);
|
|
37170
37253
|
})
|
|
37171
|
-
})
|
|
37254
|
+
});
|
|
37172
37255
|
},
|
|
37173
|
-
checkboxGroup: (
|
|
37174
|
-
|
|
37175
|
-
|
|
37176
|
-
|
|
37177
|
-
|
|
37178
|
-
|
|
37179
|
-
|
|
37180
|
-
|
|
37181
|
-
|
|
37182
|
-
|
|
37183
|
-
value: value
|
|
37184
|
-
}, props), {}, {
|
|
37256
|
+
checkboxGroup: ({
|
|
37257
|
+
props,
|
|
37258
|
+
value,
|
|
37259
|
+
options
|
|
37260
|
+
}, {
|
|
37261
|
+
isHighlighted
|
|
37262
|
+
}) => {
|
|
37263
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, {
|
|
37264
|
+
value: value,
|
|
37265
|
+
...props,
|
|
37185
37266
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37186
37267
|
style: {
|
|
37187
37268
|
display: "grid",
|
|
@@ -37205,18 +37286,16 @@ const inputTypeComponent$1 = {
|
|
|
37205
37286
|
}) : null]
|
|
37206
37287
|
}, o.value);
|
|
37207
37288
|
})
|
|
37208
|
-
})
|
|
37289
|
+
});
|
|
37209
37290
|
},
|
|
37210
|
-
total100: (
|
|
37211
|
-
|
|
37212
|
-
|
|
37213
|
-
|
|
37214
|
-
|
|
37215
|
-
|
|
37216
|
-
|
|
37217
|
-
|
|
37218
|
-
isHighlighted
|
|
37219
|
-
} = _ref35;
|
|
37291
|
+
total100: ({
|
|
37292
|
+
props,
|
|
37293
|
+
name,
|
|
37294
|
+
options,
|
|
37295
|
+
value
|
|
37296
|
+
}, {
|
|
37297
|
+
isHighlighted
|
|
37298
|
+
}) => {
|
|
37220
37299
|
value = value ? Array.isArray(value) ? value : [value] : [];
|
|
37221
37300
|
function totalValue() {
|
|
37222
37301
|
let total = 0;
|
|
@@ -37240,11 +37319,10 @@ const inputTypeComponent$1 = {
|
|
|
37240
37319
|
className: formatClassname(["total100", isHighlighted && "highlighted-input"]),
|
|
37241
37320
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
|
|
37242
37321
|
name: name,
|
|
37243
|
-
children: (fields,
|
|
37244
|
-
|
|
37245
|
-
|
|
37246
|
-
|
|
37247
|
-
} = _ref36;
|
|
37322
|
+
children: (fields, {
|
|
37323
|
+
add,
|
|
37324
|
+
remove
|
|
37325
|
+
}) => {
|
|
37248
37326
|
if (fields.length === 0) {
|
|
37249
37327
|
const formData = value || [];
|
|
37250
37328
|
if (formData.length) {
|
|
@@ -37263,27 +37341,27 @@ const inputTypeComponent$1 = {
|
|
|
37263
37341
|
const v = value[field.name] || {};
|
|
37264
37342
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Space, {
|
|
37265
37343
|
className: "total",
|
|
37266
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item,
|
|
37267
|
-
noStyle: true
|
|
37268
|
-
|
|
37344
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
37345
|
+
noStyle: true,
|
|
37346
|
+
...field,
|
|
37269
37347
|
name: [field.name, "type"],
|
|
37270
37348
|
fieldKey: [field.fieldKey, "type"],
|
|
37271
37349
|
initialValue: v.type || null,
|
|
37272
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select,
|
|
37350
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
37273
37351
|
size: "large",
|
|
37274
37352
|
allowClear: true,
|
|
37275
37353
|
showSearch: true,
|
|
37276
37354
|
filterOption: filterSelectOptions,
|
|
37277
|
-
optionFilterProp: "children"
|
|
37278
|
-
|
|
37355
|
+
optionFilterProp: "children",
|
|
37356
|
+
...props,
|
|
37279
37357
|
children: options.map((option, i) => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
37280
37358
|
value: option.value,
|
|
37281
37359
|
children: option.label
|
|
37282
37360
|
}, i))
|
|
37283
|
-
})
|
|
37284
|
-
})
|
|
37285
|
-
noStyle: true
|
|
37286
|
-
|
|
37361
|
+
})
|
|
37362
|
+
}), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
37363
|
+
noStyle: true,
|
|
37364
|
+
...field,
|
|
37287
37365
|
name: [field.name, "value"],
|
|
37288
37366
|
fieldKey: [field.fieldKey, "value"],
|
|
37289
37367
|
initialValue: v.value,
|
|
@@ -37292,14 +37370,14 @@ const inputTypeComponent$1 = {
|
|
|
37292
37370
|
allowClear: true,
|
|
37293
37371
|
name: "value",
|
|
37294
37372
|
formatter: value => {
|
|
37295
|
-
return value ?
|
|
37373
|
+
return value ? `${value}%` : "";
|
|
37296
37374
|
},
|
|
37297
37375
|
disabled: !v.type || null,
|
|
37298
37376
|
placeholder: props.valueplaceholder ? props.valueplaceholder : "Value",
|
|
37299
37377
|
min: 1,
|
|
37300
37378
|
max: 100 - siblingTotal(v.type || 0)
|
|
37301
37379
|
})
|
|
37302
|
-
})
|
|
37380
|
+
}), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
37303
37381
|
disabled: !v.value || !v.type || totalValue() >= 100,
|
|
37304
37382
|
type: "primary",
|
|
37305
37383
|
icon: /*#__PURE__*/jsxRuntime.jsx(Icons.PlusOutlined, {}),
|
|
@@ -37331,22 +37409,19 @@ const inputTypeComponent$1 = {
|
|
|
37331
37409
|
}) : null]
|
|
37332
37410
|
});
|
|
37333
37411
|
},
|
|
37334
|
-
percentage: (
|
|
37335
|
-
|
|
37336
|
-
|
|
37337
|
-
|
|
37338
|
-
|
|
37339
|
-
|
|
37340
|
-
|
|
37341
|
-
|
|
37342
|
-
|
|
37343
|
-
|
|
37344
|
-
|
|
37345
|
-
|
|
37346
|
-
|
|
37347
|
-
t,
|
|
37348
|
-
isHighlighted
|
|
37349
|
-
} = _ref38;
|
|
37412
|
+
percentage: ({
|
|
37413
|
+
name,
|
|
37414
|
+
inputName,
|
|
37415
|
+
totalMax,
|
|
37416
|
+
repeatIndex,
|
|
37417
|
+
props,
|
|
37418
|
+
formsValue,
|
|
37419
|
+
input
|
|
37420
|
+
}, {
|
|
37421
|
+
inputMeta,
|
|
37422
|
+
t,
|
|
37423
|
+
isHighlighted
|
|
37424
|
+
}) => {
|
|
37350
37425
|
const isRepeatable = Array.isArray(formsValue[name]);
|
|
37351
37426
|
let totalSiblings = 0;
|
|
37352
37427
|
if (isRepeatable && totalMax) {
|
|
@@ -37354,47 +37429,45 @@ const inputTypeComponent$1 = {
|
|
|
37354
37429
|
totl = totl + (grp[inputName] || 0);
|
|
37355
37430
|
return totl;
|
|
37356
37431
|
}, 0);
|
|
37357
|
-
} else if (Array.isArray(input
|
|
37432
|
+
} else if (Array.isArray(input?.meta?.siblings)) {
|
|
37358
37433
|
totalSiblings = input.meta.siblings.reduce((totl, key) => {
|
|
37359
37434
|
totl = totl + (formsValue[key] || 0);
|
|
37360
37435
|
return totl;
|
|
37361
37436
|
}, 0);
|
|
37362
37437
|
}
|
|
37363
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber,
|
|
37438
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
37364
37439
|
size: "large",
|
|
37365
|
-
allowClear: true
|
|
37366
|
-
|
|
37440
|
+
allowClear: true,
|
|
37441
|
+
...props,
|
|
37367
37442
|
className: formatClassname([isHighlighted && "highlighted-cont"]),
|
|
37368
37443
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
37369
37444
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
|
|
37370
37445
|
min: 0,
|
|
37371
37446
|
max: 100 - totalSiblings,
|
|
37372
37447
|
formatter: value => {
|
|
37373
|
-
return value ?
|
|
37448
|
+
return value ? `${value}` : "";
|
|
37374
37449
|
},
|
|
37375
37450
|
parser: value => value.replace("%", ""),
|
|
37376
37451
|
addonAfter: "%"
|
|
37377
|
-
})
|
|
37452
|
+
});
|
|
37378
37453
|
},
|
|
37379
|
-
drawTerritory: (
|
|
37380
|
-
|
|
37381
|
-
|
|
37382
|
-
|
|
37383
|
-
|
|
37384
|
-
|
|
37385
|
-
|
|
37386
|
-
setFormValues
|
|
37387
|
-
} = _ref40;
|
|
37454
|
+
drawTerritory: ({
|
|
37455
|
+
formsValue,
|
|
37456
|
+
name,
|
|
37457
|
+
addressData
|
|
37458
|
+
}, {
|
|
37459
|
+
setFormValues
|
|
37460
|
+
}) => {
|
|
37388
37461
|
let search = formsValue.country;
|
|
37389
37462
|
if (addressData && addressData.address && Object.keys(addressData.address).length > 0) {
|
|
37390
37463
|
if (addressData.address.country) {
|
|
37391
37464
|
search = addressData.address.country;
|
|
37392
37465
|
}
|
|
37393
37466
|
if (addressData.address.level1) {
|
|
37394
|
-
search =
|
|
37467
|
+
search = `${addressData.address.level1}, ${addressData.address.country}`;
|
|
37395
37468
|
}
|
|
37396
37469
|
if (addressData.address.level2) {
|
|
37397
|
-
search =
|
|
37470
|
+
search = `${addressData.address.level2}, ${addressData.address.level1}, ${addressData.address.country}`;
|
|
37398
37471
|
}
|
|
37399
37472
|
} else {
|
|
37400
37473
|
const country = countriesList.countries[formsValue.country] || {};
|
|
@@ -37402,10 +37475,10 @@ const inputTypeComponent$1 = {
|
|
|
37402
37475
|
search = country.name;
|
|
37403
37476
|
}
|
|
37404
37477
|
if (formsValue.administrativeLevel1Name) {
|
|
37405
|
-
search =
|
|
37478
|
+
search = `${search} ${formsValue.administrativeLevel1Name}`;
|
|
37406
37479
|
}
|
|
37407
37480
|
if (formsValue.administrativeLevel2Name) {
|
|
37408
|
-
search =
|
|
37481
|
+
search = `${search} ${formsValue.administrativeLevel2Name}`;
|
|
37409
37482
|
}
|
|
37410
37483
|
}
|
|
37411
37484
|
return /*#__PURE__*/jsxRuntime.jsx(PolygonSelector, {
|
|
@@ -37417,36 +37490,32 @@ const inputTypeComponent$1 = {
|
|
|
37417
37490
|
searchValue: search
|
|
37418
37491
|
});
|
|
37419
37492
|
},
|
|
37420
|
-
year: (
|
|
37421
|
-
|
|
37422
|
-
|
|
37423
|
-
|
|
37424
|
-
|
|
37425
|
-
isHighlighted
|
|
37426
|
-
} = _ref42;
|
|
37493
|
+
year: ({
|
|
37494
|
+
props
|
|
37495
|
+
}, {
|
|
37496
|
+
isHighlighted
|
|
37497
|
+
}) => {
|
|
37427
37498
|
const lng = localStorage.getItem("datastakeLng") || "en";
|
|
37428
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker,
|
|
37499
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
37429
37500
|
size: "large",
|
|
37430
37501
|
allowClear: true,
|
|
37431
37502
|
locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
|
|
37432
|
-
picker: "year"
|
|
37433
|
-
|
|
37503
|
+
picker: "year",
|
|
37504
|
+
...props,
|
|
37434
37505
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37435
37506
|
format: "YYYY"
|
|
37436
|
-
})
|
|
37507
|
+
});
|
|
37437
37508
|
},
|
|
37438
|
-
upload: (
|
|
37439
|
-
|
|
37440
|
-
|
|
37441
|
-
|
|
37442
|
-
|
|
37443
|
-
|
|
37444
|
-
|
|
37445
|
-
|
|
37446
|
-
|
|
37447
|
-
|
|
37448
|
-
isHighlighted
|
|
37449
|
-
} = _ref44;
|
|
37509
|
+
upload: ({
|
|
37510
|
+
rules,
|
|
37511
|
+
value
|
|
37512
|
+
}, {
|
|
37513
|
+
setLoading = () => {},
|
|
37514
|
+
getApiBaseUrl,
|
|
37515
|
+
getAppHeader,
|
|
37516
|
+
t,
|
|
37517
|
+
isHighlighted
|
|
37518
|
+
}) => {
|
|
37450
37519
|
const apiURL = getApiBaseUrl();
|
|
37451
37520
|
const accept = rules.length ? rules.find(rule => Object.keys(rule).includes("accept")).accept || "*" : null;
|
|
37452
37521
|
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) : []) || [];
|
|
@@ -37459,12 +37528,13 @@ const inputTypeComponent$1 = {
|
|
|
37459
37528
|
maxProps.multiple = true;
|
|
37460
37529
|
}
|
|
37461
37530
|
}
|
|
37462
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload,
|
|
37531
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37532
|
+
...maxProps,
|
|
37463
37533
|
accept: accept,
|
|
37464
|
-
action:
|
|
37534
|
+
action: `${apiURL}/upload`,
|
|
37465
37535
|
beforeUpload: beforeUpload(allowedExtensions),
|
|
37466
37536
|
onChange: val => {
|
|
37467
|
-
if (val
|
|
37537
|
+
if (val?.file && typeof setLoading === "function") {
|
|
37468
37538
|
if (val.file.percent !== 100) {
|
|
37469
37539
|
setLoading(true);
|
|
37470
37540
|
} else {
|
|
@@ -37472,9 +37542,10 @@ const inputTypeComponent$1 = {
|
|
|
37472
37542
|
}
|
|
37473
37543
|
}
|
|
37474
37544
|
},
|
|
37475
|
-
headers:
|
|
37476
|
-
Authorization:
|
|
37477
|
-
|
|
37545
|
+
headers: {
|
|
37546
|
+
Authorization: `Bearer ${getToken()}`,
|
|
37547
|
+
...getAppHeader()
|
|
37548
|
+
},
|
|
37478
37549
|
defaultFileList: values,
|
|
37479
37550
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
37480
37551
|
style: {
|
|
@@ -37485,20 +37556,18 @@ const inputTypeComponent$1 = {
|
|
|
37485
37556
|
children: t("Upload")
|
|
37486
37557
|
})]
|
|
37487
37558
|
})
|
|
37488
|
-
})
|
|
37559
|
+
});
|
|
37489
37560
|
},
|
|
37490
|
-
imageUpload: (
|
|
37491
|
-
|
|
37492
|
-
|
|
37493
|
-
|
|
37494
|
-
|
|
37495
|
-
|
|
37496
|
-
|
|
37497
|
-
|
|
37498
|
-
|
|
37499
|
-
|
|
37500
|
-
isHighlighted
|
|
37501
|
-
} = _ref46;
|
|
37561
|
+
imageUpload: ({
|
|
37562
|
+
rules,
|
|
37563
|
+
value
|
|
37564
|
+
}, {
|
|
37565
|
+
setLoading = () => {},
|
|
37566
|
+
getApiBaseUrl,
|
|
37567
|
+
getAppHeader,
|
|
37568
|
+
t,
|
|
37569
|
+
isHighlighted
|
|
37570
|
+
}) => {
|
|
37502
37571
|
const apiURL = getApiBaseUrl();
|
|
37503
37572
|
const values = getImageUploadEditValue(value);
|
|
37504
37573
|
const maxRule = rules.find(r => r.max);
|
|
@@ -37509,18 +37578,17 @@ const inputTypeComponent$1 = {
|
|
|
37509
37578
|
maxProps.multiple = true;
|
|
37510
37579
|
}
|
|
37511
37580
|
}
|
|
37512
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload,
|
|
37513
|
-
beforeUpload: beforeUpload(allowedImageExtensions)
|
|
37514
|
-
|
|
37581
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37582
|
+
beforeUpload: beforeUpload(allowedImageExtensions),
|
|
37583
|
+
...maxProps,
|
|
37515
37584
|
accept: "image/*",
|
|
37516
37585
|
classList: !values || !values.length ? "empty" : "",
|
|
37517
37586
|
listType: "picture",
|
|
37518
|
-
action:
|
|
37587
|
+
action: `${apiURL}/upload`,
|
|
37519
37588
|
onChange: val => {
|
|
37520
37589
|
if (typeof setLoading === "function") {
|
|
37521
|
-
if (val
|
|
37522
|
-
|
|
37523
|
-
if ((val === null || val === void 0 || (_val$file = val.file) === null || _val$file === void 0 ? void 0 : _val$file.status) === "removed") {
|
|
37590
|
+
if (val?.file) {
|
|
37591
|
+
if (val?.file?.status === "removed") {
|
|
37524
37592
|
setLoading(false);
|
|
37525
37593
|
return;
|
|
37526
37594
|
}
|
|
@@ -37532,9 +37600,10 @@ const inputTypeComponent$1 = {
|
|
|
37532
37600
|
setLoading(false);
|
|
37533
37601
|
}
|
|
37534
37602
|
},
|
|
37535
|
-
headers:
|
|
37536
|
-
Authorization:
|
|
37537
|
-
|
|
37603
|
+
headers: {
|
|
37604
|
+
Authorization: `Bearer ${getToken()}`,
|
|
37605
|
+
...getAppHeader()
|
|
37606
|
+
},
|
|
37538
37607
|
defaultFileList: values,
|
|
37539
37608
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
37540
37609
|
style: {
|
|
@@ -37545,20 +37614,18 @@ const inputTypeComponent$1 = {
|
|
|
37545
37614
|
children: t("Upload")
|
|
37546
37615
|
})]
|
|
37547
37616
|
})
|
|
37548
|
-
})
|
|
37617
|
+
});
|
|
37549
37618
|
},
|
|
37550
|
-
videoUpload: (
|
|
37551
|
-
|
|
37552
|
-
|
|
37553
|
-
|
|
37554
|
-
|
|
37555
|
-
|
|
37556
|
-
|
|
37557
|
-
|
|
37558
|
-
|
|
37559
|
-
|
|
37560
|
-
isHighlighted
|
|
37561
|
-
} = _ref48;
|
|
37619
|
+
videoUpload: ({
|
|
37620
|
+
rules,
|
|
37621
|
+
value
|
|
37622
|
+
}, {
|
|
37623
|
+
setLoading = () => {},
|
|
37624
|
+
getApiBaseUrl,
|
|
37625
|
+
getAppHeader,
|
|
37626
|
+
t,
|
|
37627
|
+
isHighlighted
|
|
37628
|
+
}) => {
|
|
37562
37629
|
const apiURL = getApiBaseUrl();
|
|
37563
37630
|
const values = getImageUploadEditValue(value);
|
|
37564
37631
|
const maxRule = rules.find(r => r.max);
|
|
@@ -37569,25 +37636,21 @@ const inputTypeComponent$1 = {
|
|
|
37569
37636
|
maxProps.multiple = true;
|
|
37570
37637
|
}
|
|
37571
37638
|
}
|
|
37572
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload,
|
|
37573
|
-
itemRender: (item, fileList) => {
|
|
37574
|
-
|
|
37575
|
-
|
|
37576
|
-
|
|
37577
|
-
|
|
37578
|
-
|
|
37579
|
-
});
|
|
37580
|
-
}
|
|
37581
|
-
}, maxProps), {}, {
|
|
37639
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37640
|
+
itemRender: (item, fileList) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
37641
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
|
|
37642
|
+
url: fileList?.response?.url || fileList?.url
|
|
37643
|
+
}), item]
|
|
37644
|
+
}),
|
|
37645
|
+
...maxProps,
|
|
37582
37646
|
accept: "video/*",
|
|
37583
37647
|
classList: !values || !values.length ? "empty" : "",
|
|
37584
37648
|
listType: "picture",
|
|
37585
|
-
action:
|
|
37649
|
+
action: `${apiURL}/upload`,
|
|
37586
37650
|
onChange: val => {
|
|
37587
37651
|
if (typeof setLoading === "function") {
|
|
37588
|
-
if (val
|
|
37589
|
-
|
|
37590
|
-
if ((val === null || val === void 0 || (_val$file2 = val.file) === null || _val$file2 === void 0 ? void 0 : _val$file2.status) === "removed") {
|
|
37652
|
+
if (val?.file) {
|
|
37653
|
+
if (val?.file?.status === "removed") {
|
|
37591
37654
|
setLoading(false);
|
|
37592
37655
|
return;
|
|
37593
37656
|
}
|
|
@@ -37599,9 +37662,10 @@ const inputTypeComponent$1 = {
|
|
|
37599
37662
|
setLoading(false);
|
|
37600
37663
|
}
|
|
37601
37664
|
},
|
|
37602
|
-
headers:
|
|
37603
|
-
Authorization:
|
|
37604
|
-
|
|
37665
|
+
headers: {
|
|
37666
|
+
Authorization: `Bearer ${getToken()}`,
|
|
37667
|
+
...getAppHeader()
|
|
37668
|
+
},
|
|
37605
37669
|
fileList: values,
|
|
37606
37670
|
defaultFileList: values,
|
|
37607
37671
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
@@ -37613,30 +37677,28 @@ const inputTypeComponent$1 = {
|
|
|
37613
37677
|
children: t("Upload")
|
|
37614
37678
|
})]
|
|
37615
37679
|
})
|
|
37616
|
-
})
|
|
37680
|
+
});
|
|
37617
37681
|
},
|
|
37618
|
-
geolocation: (
|
|
37619
|
-
|
|
37620
|
-
|
|
37621
|
-
|
|
37622
|
-
|
|
37623
|
-
|
|
37624
|
-
|
|
37625
|
-
|
|
37626
|
-
|
|
37627
|
-
|
|
37628
|
-
isHighlighted
|
|
37629
|
-
} = _ref50;
|
|
37682
|
+
geolocation: ({
|
|
37683
|
+
value,
|
|
37684
|
+
name,
|
|
37685
|
+
props,
|
|
37686
|
+
formsValue,
|
|
37687
|
+
addressData
|
|
37688
|
+
}, {
|
|
37689
|
+
inputMeta,
|
|
37690
|
+
isHighlighted
|
|
37691
|
+
}) => {
|
|
37630
37692
|
let search = formsValue.country;
|
|
37631
37693
|
if (addressData && Object.keys(addressData).length > 0) {
|
|
37632
37694
|
if (addressData.country) {
|
|
37633
37695
|
search = addressData.country;
|
|
37634
37696
|
}
|
|
37635
37697
|
if (addressData.level1) {
|
|
37636
|
-
search =
|
|
37698
|
+
search = `${addressData.level1}, ${addressData.country}`;
|
|
37637
37699
|
}
|
|
37638
37700
|
if (addressData.level2) {
|
|
37639
|
-
search =
|
|
37701
|
+
search = `${addressData.level2}, ${addressData.level1}, ${addressData.country}`;
|
|
37640
37702
|
}
|
|
37641
37703
|
} else {
|
|
37642
37704
|
const country = countriesList.countries[formsValue.country] || {};
|
|
@@ -37644,10 +37706,10 @@ const inputTypeComponent$1 = {
|
|
|
37644
37706
|
search = country.name;
|
|
37645
37707
|
}
|
|
37646
37708
|
if (formsValue.administrativeLevel1Name) {
|
|
37647
|
-
search =
|
|
37709
|
+
search = `${search} ${formsValue.administrativeLevel1Name}`;
|
|
37648
37710
|
}
|
|
37649
37711
|
if (formsValue.administrativeLevel2Name) {
|
|
37650
|
-
search =
|
|
37712
|
+
search = `${search} ${formsValue.administrativeLevel2Name}`;
|
|
37651
37713
|
}
|
|
37652
37714
|
}
|
|
37653
37715
|
return /*#__PURE__*/jsxRuntime.jsx(Geolocation, {
|
|
@@ -37661,36 +37723,34 @@ const inputTypeComponent$1 = {
|
|
|
37661
37723
|
searchValue: search
|
|
37662
37724
|
});
|
|
37663
37725
|
},
|
|
37664
|
-
ajaxSelect: (
|
|
37665
|
-
|
|
37666
|
-
|
|
37667
|
-
|
|
37668
|
-
|
|
37669
|
-
|
|
37670
|
-
|
|
37671
|
-
|
|
37672
|
-
|
|
37673
|
-
|
|
37674
|
-
|
|
37675
|
-
|
|
37676
|
-
|
|
37677
|
-
|
|
37678
|
-
|
|
37679
|
-
|
|
37680
|
-
|
|
37681
|
-
|
|
37682
|
-
|
|
37683
|
-
|
|
37684
|
-
|
|
37685
|
-
|
|
37686
|
-
|
|
37687
|
-
|
|
37688
|
-
|
|
37689
|
-
|
|
37690
|
-
|
|
37691
|
-
|
|
37692
|
-
groupFormId
|
|
37693
|
-
} = _ref52;
|
|
37726
|
+
ajaxSelect: ({
|
|
37727
|
+
call,
|
|
37728
|
+
automaticallyLink,
|
|
37729
|
+
name,
|
|
37730
|
+
inputName,
|
|
37731
|
+
props,
|
|
37732
|
+
formsValue,
|
|
37733
|
+
onNewSetValue,
|
|
37734
|
+
multiple,
|
|
37735
|
+
updateOptions,
|
|
37736
|
+
repeatValues,
|
|
37737
|
+
repeatIndex,
|
|
37738
|
+
value,
|
|
37739
|
+
unique,
|
|
37740
|
+
address,
|
|
37741
|
+
addressData = {},
|
|
37742
|
+
getFromLinking,
|
|
37743
|
+
input
|
|
37744
|
+
}, {
|
|
37745
|
+
form,
|
|
37746
|
+
forms,
|
|
37747
|
+
setAddress,
|
|
37748
|
+
changeInputMeta,
|
|
37749
|
+
inputMeta,
|
|
37750
|
+
meta,
|
|
37751
|
+
isHighlighted,
|
|
37752
|
+
groupFormId
|
|
37753
|
+
}) => {
|
|
37694
37754
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect, {
|
|
37695
37755
|
size: "medium",
|
|
37696
37756
|
input: input,
|
|
@@ -37727,7 +37787,9 @@ const inputTypeComponent$1 = {
|
|
|
37727
37787
|
const selectedValue = data.find(v => v.value === ev);
|
|
37728
37788
|
if (address && selectedValue) {
|
|
37729
37789
|
dot__default["default"].str(address, selectedValue.label, addressData);
|
|
37730
|
-
setAddress(
|
|
37790
|
+
setAddress({
|
|
37791
|
+
...addressData
|
|
37792
|
+
});
|
|
37731
37793
|
}
|
|
37732
37794
|
}
|
|
37733
37795
|
},
|
|
@@ -37736,11 +37798,10 @@ const inputTypeComponent$1 = {
|
|
|
37736
37798
|
address: true
|
|
37737
37799
|
});
|
|
37738
37800
|
},
|
|
37739
|
-
tag:
|
|
37740
|
-
|
|
37741
|
-
|
|
37742
|
-
|
|
37743
|
-
} = _ref53;
|
|
37801
|
+
tag: ({
|
|
37802
|
+
value,
|
|
37803
|
+
repeatLabel
|
|
37804
|
+
}) => {
|
|
37744
37805
|
return /*#__PURE__*/jsxRuntime.jsx(TagInput, {
|
|
37745
37806
|
size: "large",
|
|
37746
37807
|
allowClear: true,
|
|
@@ -37748,28 +37809,26 @@ const inputTypeComponent$1 = {
|
|
|
37748
37809
|
newPlaceholder: repeatLabel
|
|
37749
37810
|
});
|
|
37750
37811
|
},
|
|
37751
|
-
modal: (
|
|
37752
|
-
|
|
37753
|
-
|
|
37754
|
-
|
|
37755
|
-
|
|
37756
|
-
|
|
37757
|
-
|
|
37758
|
-
|
|
37759
|
-
|
|
37760
|
-
|
|
37761
|
-
|
|
37762
|
-
|
|
37763
|
-
|
|
37764
|
-
|
|
37765
|
-
|
|
37766
|
-
|
|
37767
|
-
|
|
37768
|
-
|
|
37769
|
-
|
|
37770
|
-
|
|
37771
|
-
add
|
|
37772
|
-
} = _ref55;
|
|
37812
|
+
modal: ({
|
|
37813
|
+
call,
|
|
37814
|
+
automaticallyLink,
|
|
37815
|
+
name,
|
|
37816
|
+
inputName,
|
|
37817
|
+
props,
|
|
37818
|
+
formsValue,
|
|
37819
|
+
allFormsValue,
|
|
37820
|
+
onNewSetValue,
|
|
37821
|
+
repeatValues,
|
|
37822
|
+
repeatIndex,
|
|
37823
|
+
value,
|
|
37824
|
+
modalTitle,
|
|
37825
|
+
totalInputs,
|
|
37826
|
+
shownInputs,
|
|
37827
|
+
allowDupplicates
|
|
37828
|
+
}, {
|
|
37829
|
+
form,
|
|
37830
|
+
add
|
|
37831
|
+
}) => {
|
|
37773
37832
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxModal, {
|
|
37774
37833
|
allowClear: true,
|
|
37775
37834
|
call: call,
|
|
@@ -37792,44 +37851,40 @@ const inputTypeComponent$1 = {
|
|
|
37792
37851
|
allowDupplicates: allowDupplicates
|
|
37793
37852
|
});
|
|
37794
37853
|
},
|
|
37795
|
-
dataLink: (
|
|
37796
|
-
|
|
37797
|
-
|
|
37798
|
-
|
|
37799
|
-
|
|
37800
|
-
|
|
37801
|
-
|
|
37802
|
-
|
|
37803
|
-
|
|
37804
|
-
|
|
37805
|
-
|
|
37806
|
-
|
|
37807
|
-
|
|
37808
|
-
|
|
37809
|
-
|
|
37810
|
-
|
|
37811
|
-
|
|
37812
|
-
|
|
37813
|
-
|
|
37814
|
-
|
|
37815
|
-
|
|
37816
|
-
|
|
37817
|
-
|
|
37818
|
-
|
|
37819
|
-
|
|
37820
|
-
|
|
37821
|
-
|
|
37822
|
-
|
|
37823
|
-
|
|
37824
|
-
|
|
37825
|
-
|
|
37826
|
-
|
|
37827
|
-
groupFormId
|
|
37828
|
-
|
|
37829
|
-
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") {
|
|
37830
|
-
var _formsValue$groupForm3, _input$meta13, _input$meta14;
|
|
37831
|
-
const currentValue = groupFormId ? (_formsValue$groupForm3 = formsValue[groupFormId]) === null || _formsValue$groupForm3 === void 0 ? void 0 : _formsValue$groupForm3[name] : formsValue[name];
|
|
37832
|
-
(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()::::";
|
|
37854
|
+
dataLink: ({
|
|
37855
|
+
setValues,
|
|
37856
|
+
name,
|
|
37857
|
+
onValuesChange,
|
|
37858
|
+
changeLinking,
|
|
37859
|
+
formsValue,
|
|
37860
|
+
input,
|
|
37861
|
+
call,
|
|
37862
|
+
automaticallyLink,
|
|
37863
|
+
inputName,
|
|
37864
|
+
props,
|
|
37865
|
+
onNewSetValue,
|
|
37866
|
+
multiple,
|
|
37867
|
+
updateOptions,
|
|
37868
|
+
repeatValues,
|
|
37869
|
+
repeatIndex,
|
|
37870
|
+
value,
|
|
37871
|
+
unique,
|
|
37872
|
+
address,
|
|
37873
|
+
addressData = {},
|
|
37874
|
+
getFromLinking
|
|
37875
|
+
}, {
|
|
37876
|
+
form,
|
|
37877
|
+
forms,
|
|
37878
|
+
setAddress,
|
|
37879
|
+
changeInputMeta,
|
|
37880
|
+
inputMeta,
|
|
37881
|
+
meta,
|
|
37882
|
+
isHighlighted,
|
|
37883
|
+
groupFormId
|
|
37884
|
+
}) => {
|
|
37885
|
+
if (input?.meta?.optionsView?.editInputType === "ajaxSelect") {
|
|
37886
|
+
const currentValue = groupFormId ? formsValue[groupFormId]?.[name] : formsValue[name];
|
|
37887
|
+
input?.meta?.optionsView?.call || input?.meta?.call || "default::list()::::";
|
|
37833
37888
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect$1, {
|
|
37834
37889
|
size: "medium",
|
|
37835
37890
|
input: input,
|
|
@@ -37866,7 +37921,9 @@ const inputTypeComponent$1 = {
|
|
|
37866
37921
|
const selectedValue = data.find(v => v.value === ev);
|
|
37867
37922
|
if (address && selectedValue) {
|
|
37868
37923
|
dot__default["default"].str(address, selectedValue.label, addressData);
|
|
37869
|
-
setAddress(
|
|
37924
|
+
setAddress({
|
|
37925
|
+
...addressData
|
|
37926
|
+
});
|
|
37870
37927
|
}
|
|
37871
37928
|
}
|
|
37872
37929
|
},
|
|
@@ -37876,93 +37933,138 @@ const inputTypeComponent$1 = {
|
|
|
37876
37933
|
isDataLink: true
|
|
37877
37934
|
});
|
|
37878
37935
|
}
|
|
37879
|
-
const isSingle =
|
|
37880
|
-
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [
|
|
37936
|
+
const isSingle = input?.meta?.maxRepeat === 1;
|
|
37937
|
+
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
|
|
37938
|
+
...(formsValue[groupFormId] || {})[name]
|
|
37939
|
+
}] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
|
|
37940
|
+
...v
|
|
37941
|
+
})) : isSingle ? formsValue[name] ? [{
|
|
37942
|
+
...formsValue[name]
|
|
37943
|
+
}] : [] : (formsValue[name] || []).map(v => ({
|
|
37944
|
+
...v
|
|
37945
|
+
}));
|
|
37881
37946
|
const onUpdate = (editData, i) => {
|
|
37882
|
-
const val =
|
|
37947
|
+
const val = {
|
|
37948
|
+
...formData[i],
|
|
37949
|
+
...editData
|
|
37950
|
+
};
|
|
37883
37951
|
const _val = isSingle ? {
|
|
37884
37952
|
[name]: val
|
|
37885
37953
|
} : {
|
|
37886
|
-
[name]: formData
|
|
37954
|
+
[name]: formData?.map((d, j) => i === j ? val : d)
|
|
37887
37955
|
};
|
|
37888
37956
|
if (groupFormId) {
|
|
37889
|
-
const _defaultData =
|
|
37890
|
-
const _newData =
|
|
37891
|
-
|
|
37957
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
37958
|
+
const _newData = {
|
|
37959
|
+
..._defaultData,
|
|
37960
|
+
..._val
|
|
37961
|
+
};
|
|
37962
|
+
onValuesChange(_newData, {
|
|
37963
|
+
...formsValue,
|
|
37892
37964
|
[groupFormId]: _newData
|
|
37893
|
-
})
|
|
37894
|
-
form
|
|
37895
|
-
setValues(
|
|
37965
|
+
});
|
|
37966
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
37967
|
+
setValues({
|
|
37968
|
+
...formsValue,
|
|
37896
37969
|
[groupFormId]: _newData
|
|
37897
|
-
})
|
|
37970
|
+
});
|
|
37898
37971
|
return;
|
|
37899
37972
|
}
|
|
37900
|
-
onValuesChange(_val,
|
|
37901
|
-
|
|
37902
|
-
|
|
37973
|
+
onValuesChange(_val, {
|
|
37974
|
+
...formsValue,
|
|
37975
|
+
..._val
|
|
37976
|
+
});
|
|
37977
|
+
form?.setFieldValue(name, _val[name]);
|
|
37978
|
+
setValues({
|
|
37979
|
+
...formsValue,
|
|
37980
|
+
..._val
|
|
37981
|
+
});
|
|
37903
37982
|
};
|
|
37904
|
-
if (input
|
|
37905
|
-
var _formsValue$meta4, _input$meta17;
|
|
37983
|
+
if (input?.meta?.flat) {
|
|
37906
37984
|
return /*#__PURE__*/jsxRuntime.jsx(DataLinkFlat, {
|
|
37907
37985
|
form: input,
|
|
37908
37986
|
changeLinking: changeLinking,
|
|
37909
37987
|
onUpdate: onUpdate,
|
|
37910
37988
|
isHighlighted: isHighlighted,
|
|
37911
37989
|
formsValue: formsValue,
|
|
37912
|
-
values: groupFormId ?
|
|
37990
|
+
values: groupFormId ? {
|
|
37991
|
+
...(formsValue[groupFormId] || {}),
|
|
37913
37992
|
meta: {
|
|
37914
|
-
inputs: (
|
|
37993
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
37915
37994
|
}
|
|
37916
|
-
}
|
|
37995
|
+
} : formsValue,
|
|
37917
37996
|
name: name,
|
|
37918
37997
|
groupFormId: groupFormId,
|
|
37919
|
-
maxRepeat: input
|
|
37920
|
-
remove:
|
|
37921
|
-
|
|
37922
|
-
|
|
37923
|
-
} = _ref58;
|
|
37998
|
+
maxRepeat: input?.meta?.maxRepeat,
|
|
37999
|
+
remove: ({
|
|
38000
|
+
key
|
|
38001
|
+
}) => {
|
|
37924
38002
|
const _val = isSingle ? {
|
|
37925
38003
|
[name]: null
|
|
37926
38004
|
} : {
|
|
37927
38005
|
[name]: formData.filter((v, i) => i !== key)
|
|
37928
38006
|
};
|
|
37929
38007
|
if (groupFormId) {
|
|
37930
|
-
const _defaultData =
|
|
37931
|
-
const _newData =
|
|
37932
|
-
|
|
38008
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38009
|
+
const _newData = {
|
|
38010
|
+
..._defaultData,
|
|
38011
|
+
..._val
|
|
38012
|
+
};
|
|
38013
|
+
onValuesChange(_newData, {
|
|
38014
|
+
...formsValue,
|
|
37933
38015
|
[groupFormId]: _newData
|
|
37934
|
-
})
|
|
37935
|
-
form
|
|
37936
|
-
setValues(
|
|
38016
|
+
});
|
|
38017
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38018
|
+
setValues({
|
|
38019
|
+
...formsValue,
|
|
37937
38020
|
[groupFormId]: _newData
|
|
37938
|
-
})
|
|
38021
|
+
});
|
|
37939
38022
|
return;
|
|
37940
38023
|
}
|
|
37941
|
-
onValuesChange(_val,
|
|
37942
|
-
|
|
37943
|
-
|
|
38024
|
+
onValuesChange(_val, {
|
|
38025
|
+
...formsValue,
|
|
38026
|
+
..._val
|
|
38027
|
+
});
|
|
38028
|
+
form?.setFieldValue(name, _val[name]);
|
|
38029
|
+
setValues({
|
|
38030
|
+
...formsValue,
|
|
38031
|
+
..._val
|
|
38032
|
+
});
|
|
37944
38033
|
},
|
|
37945
38034
|
add: val => {
|
|
37946
38035
|
const _val = isSingle ? {
|
|
37947
38036
|
[name]: val
|
|
37948
38037
|
} : {
|
|
37949
|
-
[name]: [...formData,
|
|
38038
|
+
[name]: [...formData, {
|
|
38039
|
+
...val
|
|
38040
|
+
}]
|
|
37950
38041
|
};
|
|
37951
38042
|
if (groupFormId) {
|
|
37952
|
-
const _defaultData =
|
|
37953
|
-
const _newData =
|
|
37954
|
-
|
|
37955
|
-
|
|
38043
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38044
|
+
const _newData = {
|
|
38045
|
+
..._defaultData,
|
|
38046
|
+
..._val
|
|
38047
|
+
};
|
|
38048
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38049
|
+
onValuesChange(_newData, {
|
|
38050
|
+
...formsValue,
|
|
37956
38051
|
[groupFormId]: _newData
|
|
37957
|
-
})
|
|
37958
|
-
setValues(
|
|
38052
|
+
});
|
|
38053
|
+
setValues({
|
|
38054
|
+
...formsValue,
|
|
37959
38055
|
[groupFormId]: _newData
|
|
37960
|
-
})
|
|
38056
|
+
});
|
|
37961
38057
|
return;
|
|
37962
38058
|
}
|
|
37963
|
-
form
|
|
37964
|
-
onValuesChange(_val,
|
|
37965
|
-
|
|
38059
|
+
form?.setFieldValue(name, _val[name]);
|
|
38060
|
+
onValuesChange(_val, {
|
|
38061
|
+
...formsValue,
|
|
38062
|
+
..._val
|
|
38063
|
+
});
|
|
38064
|
+
setValues({
|
|
38065
|
+
...formsValue,
|
|
38066
|
+
..._val
|
|
38067
|
+
});
|
|
37966
38068
|
},
|
|
37967
38069
|
k: name,
|
|
37968
38070
|
formData: formData
|
|
@@ -37974,79 +38076,101 @@ const inputTypeComponent$1 = {
|
|
|
37974
38076
|
onUpdate: onUpdate,
|
|
37975
38077
|
isHighlighted: isHighlighted,
|
|
37976
38078
|
formsValue: formsValue,
|
|
37977
|
-
values: groupFormId ?
|
|
38079
|
+
values: groupFormId ? {
|
|
38080
|
+
...(formsValue[groupFormId] || {}),
|
|
37978
38081
|
meta: {
|
|
37979
|
-
inputs: (
|
|
38082
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
37980
38083
|
}
|
|
37981
|
-
}
|
|
38084
|
+
} : formsValue,
|
|
37982
38085
|
name: name,
|
|
37983
38086
|
groupFormId: groupFormId,
|
|
37984
|
-
maxRepeat: input
|
|
37985
|
-
remove:
|
|
37986
|
-
|
|
37987
|
-
|
|
37988
|
-
} = _ref59;
|
|
38087
|
+
maxRepeat: input?.meta?.maxRepeat,
|
|
38088
|
+
remove: ({
|
|
38089
|
+
key
|
|
38090
|
+
}) => {
|
|
37989
38091
|
const _val = isSingle ? {
|
|
37990
38092
|
[name]: null
|
|
37991
38093
|
} : {
|
|
37992
38094
|
[name]: formData.filter((v, i) => i !== key)
|
|
37993
38095
|
};
|
|
37994
38096
|
if (groupFormId) {
|
|
37995
|
-
const _defaultData =
|
|
37996
|
-
const _newData =
|
|
37997
|
-
|
|
38097
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38098
|
+
const _newData = {
|
|
38099
|
+
..._defaultData,
|
|
38100
|
+
..._val
|
|
38101
|
+
};
|
|
38102
|
+
onValuesChange(_newData, {
|
|
38103
|
+
...formsValue,
|
|
37998
38104
|
[groupFormId]: _newData
|
|
37999
|
-
})
|
|
38000
|
-
form
|
|
38001
|
-
setValues(
|
|
38105
|
+
});
|
|
38106
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38107
|
+
setValues({
|
|
38108
|
+
...formsValue,
|
|
38002
38109
|
[groupFormId]: _newData
|
|
38003
|
-
})
|
|
38110
|
+
});
|
|
38004
38111
|
return;
|
|
38005
38112
|
}
|
|
38006
|
-
onValuesChange(_val,
|
|
38007
|
-
|
|
38008
|
-
|
|
38113
|
+
onValuesChange(_val, {
|
|
38114
|
+
...formsValue,
|
|
38115
|
+
..._val
|
|
38116
|
+
});
|
|
38117
|
+
form?.setFieldValue(name, _val[name]);
|
|
38118
|
+
setValues({
|
|
38119
|
+
...formsValue,
|
|
38120
|
+
..._val
|
|
38121
|
+
});
|
|
38009
38122
|
},
|
|
38010
38123
|
add: val => {
|
|
38011
38124
|
const _val = isSingle ? {
|
|
38012
38125
|
[name]: val
|
|
38013
38126
|
} : {
|
|
38014
|
-
[name]: [...formData,
|
|
38127
|
+
[name]: [...formData, {
|
|
38128
|
+
...val
|
|
38129
|
+
}]
|
|
38015
38130
|
};
|
|
38016
38131
|
if (groupFormId) {
|
|
38017
|
-
const _defaultData =
|
|
38018
|
-
const _newData =
|
|
38019
|
-
|
|
38020
|
-
|
|
38132
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38133
|
+
const _newData = {
|
|
38134
|
+
..._defaultData,
|
|
38135
|
+
..._val
|
|
38136
|
+
};
|
|
38137
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38138
|
+
onValuesChange(_newData, {
|
|
38139
|
+
...formsValue,
|
|
38021
38140
|
[groupFormId]: _newData
|
|
38022
|
-
})
|
|
38023
|
-
setValues(
|
|
38141
|
+
});
|
|
38142
|
+
setValues({
|
|
38143
|
+
...formsValue,
|
|
38024
38144
|
[groupFormId]: _newData
|
|
38025
|
-
})
|
|
38145
|
+
});
|
|
38026
38146
|
return;
|
|
38027
38147
|
}
|
|
38028
|
-
form
|
|
38029
|
-
onValuesChange(_val,
|
|
38030
|
-
|
|
38148
|
+
form?.setFieldValue(name, _val[name]);
|
|
38149
|
+
onValuesChange(_val, {
|
|
38150
|
+
...formsValue,
|
|
38151
|
+
..._val
|
|
38152
|
+
});
|
|
38153
|
+
setValues({
|
|
38154
|
+
...formsValue,
|
|
38155
|
+
..._val
|
|
38156
|
+
});
|
|
38031
38157
|
},
|
|
38032
38158
|
k: name,
|
|
38033
38159
|
formData: formData
|
|
38034
38160
|
});
|
|
38035
38161
|
},
|
|
38036
|
-
dataLinkGroup: (
|
|
38037
|
-
|
|
38038
|
-
|
|
38039
|
-
|
|
38040
|
-
|
|
38041
|
-
|
|
38042
|
-
|
|
38043
|
-
|
|
38044
|
-
|
|
38045
|
-
|
|
38046
|
-
|
|
38047
|
-
|
|
38048
|
-
isHighlighted
|
|
38049
|
-
} = _ref61;
|
|
38162
|
+
dataLinkGroup: ({
|
|
38163
|
+
setValues,
|
|
38164
|
+
name,
|
|
38165
|
+
onValuesChange,
|
|
38166
|
+
changeLinking,
|
|
38167
|
+
formsValue,
|
|
38168
|
+
input
|
|
38169
|
+
}, {
|
|
38170
|
+
form,
|
|
38171
|
+
groupFormId,
|
|
38172
|
+
isHighlighted
|
|
38173
|
+
}) => {
|
|
38050
38174
|
return renderDataLinkGroup({
|
|
38051
38175
|
input,
|
|
38052
38176
|
name,
|
|
@@ -38059,41 +38183,51 @@ const inputTypeComponent$1 = {
|
|
|
38059
38183
|
isHighlighted
|
|
38060
38184
|
});
|
|
38061
38185
|
},
|
|
38062
|
-
groupCheckbox: (
|
|
38063
|
-
|
|
38064
|
-
|
|
38065
|
-
|
|
38066
|
-
|
|
38067
|
-
|
|
38068
|
-
|
|
38069
|
-
|
|
38070
|
-
|
|
38071
|
-
|
|
38072
|
-
|
|
38073
|
-
isHighlighted
|
|
38074
|
-
} = _ref63;
|
|
38186
|
+
groupCheckbox: ({
|
|
38187
|
+
setValues,
|
|
38188
|
+
name,
|
|
38189
|
+
onValuesChange,
|
|
38190
|
+
formsValue,
|
|
38191
|
+
input
|
|
38192
|
+
}, {
|
|
38193
|
+
form,
|
|
38194
|
+
groupFormId,
|
|
38195
|
+
isHighlighted
|
|
38196
|
+
}) => {
|
|
38075
38197
|
const formData = groupFormId ? (formsValue[groupFormId] || {})[name] || [] : formsValue[name] || [];
|
|
38076
38198
|
const onUpdate = (val, key) => {
|
|
38077
38199
|
const _val = {
|
|
38078
|
-
[name]:
|
|
38200
|
+
[name]: {
|
|
38201
|
+
...formData,
|
|
38079
38202
|
[key]: val
|
|
38080
|
-
}
|
|
38203
|
+
}
|
|
38081
38204
|
};
|
|
38082
38205
|
if (groupFormId) {
|
|
38083
|
-
const _defaultData =
|
|
38084
|
-
const _newData =
|
|
38085
|
-
|
|
38206
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38207
|
+
const _newData = {
|
|
38208
|
+
..._defaultData,
|
|
38209
|
+
..._val
|
|
38210
|
+
};
|
|
38211
|
+
onValuesChange(_newData, {
|
|
38212
|
+
...formsValue,
|
|
38086
38213
|
[groupFormId]: _newData
|
|
38087
|
-
})
|
|
38088
|
-
form
|
|
38089
|
-
setValues(
|
|
38214
|
+
});
|
|
38215
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38216
|
+
setValues({
|
|
38217
|
+
...formsValue,
|
|
38090
38218
|
[groupFormId]: _newData
|
|
38091
|
-
})
|
|
38219
|
+
});
|
|
38092
38220
|
return;
|
|
38093
38221
|
}
|
|
38094
|
-
onValuesChange(_val,
|
|
38095
|
-
|
|
38096
|
-
|
|
38222
|
+
onValuesChange(_val, {
|
|
38223
|
+
...formsValue,
|
|
38224
|
+
..._val
|
|
38225
|
+
});
|
|
38226
|
+
form?.setFieldValue(name, _val[name]);
|
|
38227
|
+
setValues({
|
|
38228
|
+
...formsValue,
|
|
38229
|
+
..._val
|
|
38230
|
+
});
|
|
38097
38231
|
};
|
|
38098
38232
|
return /*#__PURE__*/jsxRuntime.jsx(GroupCheckbox, {
|
|
38099
38233
|
form: input,
|
|
@@ -38102,91 +38236,96 @@ const inputTypeComponent$1 = {
|
|
|
38102
38236
|
isHighlighted: isHighlighted
|
|
38103
38237
|
});
|
|
38104
38238
|
},
|
|
38105
|
-
website: (
|
|
38106
|
-
|
|
38107
|
-
|
|
38108
|
-
|
|
38109
|
-
|
|
38110
|
-
|
|
38111
|
-
|
|
38112
|
-
|
|
38113
|
-
|
|
38114
|
-
|
|
38115
|
-
|
|
38116
|
-
|
|
38117
|
-
|
|
38118
|
-
|
|
38119
|
-
|
|
38120
|
-
} = _ref65;
|
|
38121
|
-
return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
|
|
38239
|
+
website: ({
|
|
38240
|
+
name,
|
|
38241
|
+
inputName,
|
|
38242
|
+
props,
|
|
38243
|
+
value,
|
|
38244
|
+
repeatIndex,
|
|
38245
|
+
repeatValues,
|
|
38246
|
+
formsValue
|
|
38247
|
+
}, {
|
|
38248
|
+
form,
|
|
38249
|
+
isHighlighted,
|
|
38250
|
+
inputMeta = {},
|
|
38251
|
+
t
|
|
38252
|
+
}) => {
|
|
38253
|
+
return /*#__PURE__*/jsxRuntime.jsx(Website, {
|
|
38122
38254
|
size: "large",
|
|
38123
38255
|
allowClear: true,
|
|
38124
|
-
initialValue: value
|
|
38125
|
-
|
|
38256
|
+
initialValue: value,
|
|
38257
|
+
...props,
|
|
38126
38258
|
onChange: val => updateFormValues$1(repeatIndex, repeatValues, inputName, val, formsValue, name, form),
|
|
38127
38259
|
className: formatClassname([isHighlighted && "highlighted-cont"]),
|
|
38128
38260
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
38129
38261
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com"
|
|
38130
|
-
})
|
|
38262
|
+
});
|
|
38131
38263
|
},
|
|
38132
|
-
group: (
|
|
38133
|
-
|
|
38134
|
-
|
|
38135
|
-
|
|
38136
|
-
|
|
38137
|
-
|
|
38138
|
-
|
|
38139
|
-
|
|
38140
|
-
|
|
38141
|
-
} = _ref67;
|
|
38142
|
-
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
|
|
38264
|
+
group: ({
|
|
38265
|
+
props,
|
|
38266
|
+
groupInputs,
|
|
38267
|
+
formsValue
|
|
38268
|
+
}, {
|
|
38269
|
+
inputMeta,
|
|
38270
|
+
isHighlighted
|
|
38271
|
+
}) => {
|
|
38272
|
+
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
|
|
38143
38273
|
formsValue: formsValue,
|
|
38144
38274
|
isHighlighted: isHighlighted,
|
|
38145
38275
|
groupInputs: groupInputs,
|
|
38146
|
-
inputMeta: inputMeta
|
|
38147
|
-
|
|
38276
|
+
inputMeta: inputMeta,
|
|
38277
|
+
...props
|
|
38278
|
+
});
|
|
38148
38279
|
},
|
|
38149
|
-
groupInputs: (
|
|
38150
|
-
|
|
38151
|
-
|
|
38152
|
-
|
|
38153
|
-
|
|
38154
|
-
|
|
38155
|
-
|
|
38156
|
-
|
|
38157
|
-
|
|
38158
|
-
} = _ref69;
|
|
38159
|
-
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
|
|
38280
|
+
groupInputs: ({
|
|
38281
|
+
props,
|
|
38282
|
+
groupInputs,
|
|
38283
|
+
formsValue
|
|
38284
|
+
}, {
|
|
38285
|
+
inputMeta,
|
|
38286
|
+
isHighlighted
|
|
38287
|
+
}) => {
|
|
38288
|
+
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
|
|
38160
38289
|
formsValue: formsValue,
|
|
38161
38290
|
isHighlighted: isHighlighted,
|
|
38162
38291
|
groupInputs: groupInputs,
|
|
38163
|
-
inputMeta: inputMeta
|
|
38164
|
-
|
|
38292
|
+
inputMeta: inputMeta,
|
|
38293
|
+
...props
|
|
38294
|
+
});
|
|
38165
38295
|
},
|
|
38166
|
-
smartHelp: (
|
|
38296
|
+
smartHelp: ({
|
|
38297
|
+
name,
|
|
38298
|
+
inputName,
|
|
38299
|
+
props,
|
|
38300
|
+
value,
|
|
38301
|
+
repeatIndex,
|
|
38302
|
+
repeatValues,
|
|
38303
|
+
formsValue
|
|
38304
|
+
}, {
|
|
38305
|
+
form,
|
|
38306
|
+
isHighlighted,
|
|
38307
|
+
inputMeta = {},
|
|
38308
|
+
t
|
|
38309
|
+
}) => {
|
|
38167
38310
|
return /*#__PURE__*/jsxRuntime.jsx(Smart, {});
|
|
38168
38311
|
}
|
|
38169
38312
|
};
|
|
38170
38313
|
const filterForm = (f, d) => {
|
|
38171
38314
|
return f && (f.showFormIf ? showHideForm(f, d) : true);
|
|
38172
38315
|
};
|
|
38173
|
-
const checkFormHasSubsections =
|
|
38174
|
-
let f = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
38175
|
-
return Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
|
|
38176
|
-
};
|
|
38316
|
+
const checkFormHasSubsections = (f = {}) => Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
|
|
38177
38317
|
const mapFormGroup = (f, d) => Object.keys(f).map(key => {
|
|
38178
|
-
const
|
|
38179
|
-
|
|
38180
|
-
|
|
38181
|
-
|
|
38182
|
-
|
|
38183
|
-
|
|
38184
|
-
|
|
38185
|
-
|
|
38186
|
-
|
|
38187
|
-
|
|
38188
|
-
|
|
38189
|
-
fc = _objectWithoutProperties(_ref72, _excluded2$1);
|
|
38318
|
+
const {
|
|
38319
|
+
label,
|
|
38320
|
+
description = "",
|
|
38321
|
+
excludeFromEdit,
|
|
38322
|
+
showFormIf,
|
|
38323
|
+
icon = "",
|
|
38324
|
+
position = 0,
|
|
38325
|
+
template,
|
|
38326
|
+
formClass,
|
|
38327
|
+
...fc
|
|
38328
|
+
} = f[key] || {};
|
|
38190
38329
|
const fConf = {
|
|
38191
38330
|
id: key,
|
|
38192
38331
|
label,
|
|
@@ -38245,14 +38384,11 @@ const groupSubForms = (fConf, d) => {
|
|
|
38245
38384
|
return f;
|
|
38246
38385
|
}, {});
|
|
38247
38386
|
};
|
|
38248
|
-
const inputIsEmpty =
|
|
38249
|
-
|
|
38250
|
-
let values = arguments.length > 1 ? arguments[1] : undefined;
|
|
38251
|
-
let inputMeta = arguments.length > 2 ? arguments[2] : undefined;
|
|
38252
|
-
if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
|
|
38387
|
+
const inputIsEmpty = (input = {}, values, inputMeta) => {
|
|
38388
|
+
if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
|
|
38253
38389
|
return false;
|
|
38254
38390
|
}
|
|
38255
|
-
if (
|
|
38391
|
+
if (input?.type === "groupInputs") {
|
|
38256
38392
|
return true;
|
|
38257
38393
|
}
|
|
38258
38394
|
const value = values[input.dataId];
|
|
@@ -38264,28 +38400,26 @@ const inputIsEmpty = function () {
|
|
|
38264
38400
|
}
|
|
38265
38401
|
return !value;
|
|
38266
38402
|
};
|
|
38267
|
-
const GetFormItem$1 =
|
|
38268
|
-
|
|
38269
|
-
|
|
38270
|
-
|
|
38271
|
-
|
|
38272
|
-
|
|
38273
|
-
|
|
38274
|
-
|
|
38275
|
-
|
|
38276
|
-
|
|
38277
|
-
|
|
38278
|
-
|
|
38279
|
-
|
|
38280
|
-
|
|
38281
|
-
|
|
38282
|
-
|
|
38283
|
-
|
|
38284
|
-
|
|
38285
|
-
|
|
38286
|
-
|
|
38287
|
-
namespace
|
|
38288
|
-
} = _ref73;
|
|
38403
|
+
const GetFormItem$1 = ({
|
|
38404
|
+
highlightMandatory,
|
|
38405
|
+
inputData,
|
|
38406
|
+
inputId,
|
|
38407
|
+
input,
|
|
38408
|
+
values,
|
|
38409
|
+
MainForm,
|
|
38410
|
+
options,
|
|
38411
|
+
plainForms,
|
|
38412
|
+
setValues,
|
|
38413
|
+
setAddress,
|
|
38414
|
+
i,
|
|
38415
|
+
inputKey,
|
|
38416
|
+
onValuesChange = () => {},
|
|
38417
|
+
setLoading = () => {},
|
|
38418
|
+
inputMeta = {},
|
|
38419
|
+
changeInputMeta = () => {},
|
|
38420
|
+
changeLinking = () => {},
|
|
38421
|
+
namespace
|
|
38422
|
+
}) => {
|
|
38289
38423
|
const {
|
|
38290
38424
|
t,
|
|
38291
38425
|
user,
|
|
@@ -38300,42 +38434,44 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38300
38434
|
staticWidth,
|
|
38301
38435
|
fullWidth
|
|
38302
38436
|
} = useEditContext();
|
|
38303
|
-
const lastReview = (
|
|
38437
|
+
const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
|
|
38304
38438
|
const [isShown, setIsShown] = React.useState(!!inputData.commentValue);
|
|
38305
38439
|
const inputLabel = getInputLabel$1(input, values);
|
|
38306
38440
|
const onClickReviewSuccess = () => {
|
|
38307
38441
|
if (!isReview) {
|
|
38308
38442
|
return;
|
|
38309
38443
|
}
|
|
38310
|
-
const reviewSuccess = lastReview
|
|
38444
|
+
const reviewSuccess = lastReview?.reviewSuccess;
|
|
38311
38445
|
changeInputMeta({
|
|
38312
38446
|
key: inputId,
|
|
38313
38447
|
type: input.type,
|
|
38314
|
-
value:
|
|
38448
|
+
value: {
|
|
38449
|
+
...inputMeta,
|
|
38315
38450
|
reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
|
|
38316
38451
|
reviewer: user,
|
|
38317
38452
|
createdAt: new Date().toISOString(),
|
|
38318
38453
|
reviewSuccess: true
|
|
38319
38454
|
}]
|
|
38320
|
-
}
|
|
38455
|
+
}
|
|
38321
38456
|
});
|
|
38322
38457
|
};
|
|
38323
38458
|
const onClickReviewError = () => {
|
|
38324
38459
|
if (!isReview) {
|
|
38325
38460
|
return;
|
|
38326
38461
|
}
|
|
38327
|
-
const reviewError = lastReview
|
|
38462
|
+
const reviewError = lastReview?.reviewError;
|
|
38328
38463
|
changeInputMeta({
|
|
38329
38464
|
key: inputId,
|
|
38330
38465
|
type: input.type,
|
|
38331
|
-
value:
|
|
38466
|
+
value: {
|
|
38467
|
+
...inputMeta,
|
|
38332
38468
|
reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
|
|
38333
38469
|
reviewer: user,
|
|
38334
38470
|
createdAt: new Date().toISOString(),
|
|
38335
38471
|
reviewError: true,
|
|
38336
38472
|
comment: ""
|
|
38337
38473
|
}]
|
|
38338
|
-
}
|
|
38474
|
+
}
|
|
38339
38475
|
});
|
|
38340
38476
|
};
|
|
38341
38477
|
switch (input.type) {
|
|
@@ -38349,12 +38485,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38349
38485
|
case "header":
|
|
38350
38486
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38351
38487
|
className: "daf-title with-subtitle",
|
|
38352
|
-
style: input
|
|
38488
|
+
style: input?.meta?.style,
|
|
38353
38489
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38354
38490
|
className: "flex",
|
|
38355
38491
|
children: [/*#__PURE__*/jsxRuntime.jsx("h1", {
|
|
38356
38492
|
children: ReactHtmlParser__default["default"](getLabel$1(input.label, values))
|
|
38357
|
-
}), !!input.description || input
|
|
38493
|
+
}), !!input.description || input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
|
|
38358
38494
|
content: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38359
38495
|
className: "tooltip-popover-cont",
|
|
38360
38496
|
children: ReactHtmlParser__default["default"](input.description)
|
|
@@ -38381,7 +38517,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38381
38517
|
const specialCharsRule = rules.find(r => r.type === "specialCharacters");
|
|
38382
38518
|
|
|
38383
38519
|
// eslint-disable-next-line no-case-declarations
|
|
38384
|
-
let maxRule =
|
|
38520
|
+
let maxRule = rules.find(rule => rule.max)?.max;
|
|
38385
38521
|
if (!maxRule && input.type === "textarea") {
|
|
38386
38522
|
maxRule = MAX_TEXT_AREA_LENGTH;
|
|
38387
38523
|
}
|
|
@@ -38394,30 +38530,27 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38394
38530
|
message: requiredRule.message || ""
|
|
38395
38531
|
});
|
|
38396
38532
|
}
|
|
38397
|
-
const isHighlighted = highlightMandatory &&
|
|
38533
|
+
const isHighlighted = highlightMandatory && input?.meta?.mandatory && inputIsEmpty(input, values, inputMeta);
|
|
38398
38534
|
if (requiredRule || specialCharsRule) {
|
|
38399
38535
|
if (input.type === "groupInputs") {
|
|
38400
38536
|
rules = rules.map(r => {
|
|
38401
38537
|
if (r.required) {
|
|
38402
|
-
return
|
|
38403
|
-
|
|
38404
|
-
|
|
38405
|
-
|
|
38406
|
-
|
|
38407
|
-
validator() {
|
|
38408
|
-
if (inputMeta.notAvailable || inputMeta.notApplicable) {
|
|
38409
|
-
return Promise.resolve();
|
|
38410
|
-
}
|
|
38411
|
-
const keys = Object.keys(input.inputs);
|
|
38412
|
-
for (let i = 0; i < keys.length; i++) {
|
|
38413
|
-
if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
|
|
38414
|
-
return Promise.reject(r.message);
|
|
38415
|
-
}
|
|
38416
|
-
}
|
|
38538
|
+
return ({
|
|
38539
|
+
getFieldValue
|
|
38540
|
+
}) => ({
|
|
38541
|
+
validator() {
|
|
38542
|
+
if (inputMeta.notAvailable || inputMeta.notApplicable) {
|
|
38417
38543
|
return Promise.resolve();
|
|
38418
38544
|
}
|
|
38419
|
-
|
|
38420
|
-
|
|
38545
|
+
const keys = Object.keys(input.inputs);
|
|
38546
|
+
for (let i = 0; i < keys.length; i++) {
|
|
38547
|
+
if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
|
|
38548
|
+
return Promise.reject(r.message);
|
|
38549
|
+
}
|
|
38550
|
+
}
|
|
38551
|
+
return Promise.resolve();
|
|
38552
|
+
}
|
|
38553
|
+
});
|
|
38421
38554
|
}
|
|
38422
38555
|
return r;
|
|
38423
38556
|
});
|
|
@@ -38455,13 +38588,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38455
38588
|
}
|
|
38456
38589
|
}
|
|
38457
38590
|
if (input && typeof input === "object") {
|
|
38458
|
-
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;
|
|
38459
38591
|
// check if input is valid
|
|
38460
38592
|
const hideComment = namespace === "project-readiness";
|
|
38461
38593
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
38462
38594
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38463
38595
|
className: "flex-row input-cont",
|
|
38464
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item,
|
|
38596
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38465
38597
|
extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
38466
38598
|
children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38467
38599
|
className: formatClassname(["ml-4 input-actions"]),
|
|
@@ -38471,7 +38603,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38471
38603
|
title: t("Add review note"),
|
|
38472
38604
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38473
38605
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38474
|
-
className: formatClassname(["review-btn review-error-btn",
|
|
38606
|
+
className: formatClassname(["review-btn review-error-btn", lastReview?.reviewError && "primary"]),
|
|
38475
38607
|
type: "link",
|
|
38476
38608
|
onClick: onClickReviewError,
|
|
38477
38609
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
@@ -38487,7 +38619,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38487
38619
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38488
38620
|
type: "link",
|
|
38489
38621
|
onClick: onClickReviewSuccess,
|
|
38490
|
-
className: formatClassname(["review-btn review-success-btn",
|
|
38622
|
+
className: formatClassname(["review-btn review-success-btn", lastReview?.reviewSuccess && "primary"]),
|
|
38491
38623
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
38492
38624
|
name: "CheckSquare",
|
|
38493
38625
|
width: 16,
|
|
@@ -38524,7 +38656,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38524
38656
|
}
|
|
38525
38657
|
});
|
|
38526
38658
|
},
|
|
38527
|
-
disabled: !
|
|
38659
|
+
disabled: !input.meta?.notApplicable,
|
|
38528
38660
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
38529
38661
|
name: "NotApplicable",
|
|
38530
38662
|
width: 16,
|
|
@@ -38538,7 +38670,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38538
38670
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38539
38671
|
className: formatClassname(["default p-0", inputMeta.notAvailable && "primary"]),
|
|
38540
38672
|
type: "link",
|
|
38541
|
-
disabled: !
|
|
38673
|
+
disabled: !input.meta?.notAvailable,
|
|
38542
38674
|
onClick: () => {
|
|
38543
38675
|
const value = getDefaultInputValue(input);
|
|
38544
38676
|
MainForm.setFields([{
|
|
@@ -38570,14 +38702,14 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38570
38702
|
}), !hideComment ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
38571
38703
|
title: t("Add comment"),
|
|
38572
38704
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38573
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button,
|
|
38705
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38574
38706
|
type: "link",
|
|
38575
|
-
disabled: !
|
|
38576
|
-
|
|
38577
|
-
|
|
38578
|
-
|
|
38579
|
-
|
|
38580
|
-
|
|
38707
|
+
disabled: !input.meta?.comment,
|
|
38708
|
+
...(!isShown ? {
|
|
38709
|
+
className: "default p-0"
|
|
38710
|
+
} : {
|
|
38711
|
+
className: "p-0 primary"
|
|
38712
|
+
}),
|
|
38581
38713
|
onClick: () => {
|
|
38582
38714
|
if (inputMeta.comment !== undefined && inputMeta.comment !== null) {
|
|
38583
38715
|
return;
|
|
@@ -38596,7 +38728,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38596
38728
|
width: 16,
|
|
38597
38729
|
height: 16
|
|
38598
38730
|
})
|
|
38599
|
-
})
|
|
38731
|
+
})
|
|
38600
38732
|
})
|
|
38601
38733
|
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
38602
38734
|
title: t("Project Readiness"),
|
|
@@ -38615,34 +38747,36 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38615
38747
|
}) : null]
|
|
38616
38748
|
}) : null
|
|
38617
38749
|
}),
|
|
38618
|
-
initialValue: inputMeta
|
|
38619
|
-
|
|
38620
|
-
|
|
38621
|
-
|
|
38622
|
-
|
|
38623
|
-
|
|
38624
|
-
|
|
38625
|
-
|
|
38626
|
-
|
|
38627
|
-
|
|
38628
|
-
|
|
38629
|
-
|
|
38630
|
-
|
|
38631
|
-
|
|
38632
|
-
if (f.response) {
|
|
38633
|
-
return f.response;
|
|
38750
|
+
initialValue: inputMeta?.defaultValue,
|
|
38751
|
+
...(inputOnBlur.includes(input.type) ? {
|
|
38752
|
+
trigger: "onBlur"
|
|
38753
|
+
} : {}),
|
|
38754
|
+
...(["total100", "group"].includes(input.type) ? {} : {
|
|
38755
|
+
name: inputId,
|
|
38756
|
+
fieldKey: inputId,
|
|
38757
|
+
initialValue: inputData.value
|
|
38758
|
+
}),
|
|
38759
|
+
...(["upload"].includes(input.type) ? {
|
|
38760
|
+
valuePropName: "fileList",
|
|
38761
|
+
getValueFromEvent: e => {
|
|
38762
|
+
if (Array.isArray(e)) {
|
|
38763
|
+
return e;
|
|
38634
38764
|
}
|
|
38635
|
-
return f
|
|
38636
|
-
|
|
38637
|
-
|
|
38638
|
-
|
|
38639
|
-
|
|
38765
|
+
return e && e.fileList && e.fileList.map(f => {
|
|
38766
|
+
if (f.response) {
|
|
38767
|
+
return f.response;
|
|
38768
|
+
}
|
|
38769
|
+
return f;
|
|
38770
|
+
});
|
|
38771
|
+
}
|
|
38772
|
+
} : {}),
|
|
38773
|
+
className: formatClassname([`i-${input.type} flex-1`, input.comment && "with-comment", maxRule && "with-max-rule"]),
|
|
38640
38774
|
"data-id": inputData.name,
|
|
38641
38775
|
rules: rules,
|
|
38642
38776
|
required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
|
|
38643
38777
|
labelCol: 12,
|
|
38644
38778
|
label: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38645
|
-
className: formatClassname(["flex",
|
|
38779
|
+
className: formatClassname(["flex", input?.meta?.code && "mr-10"]),
|
|
38646
38780
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38647
38781
|
className: "mr-1",
|
|
38648
38782
|
children: getInputLabel$1(input, values)
|
|
@@ -38655,7 +38789,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38655
38789
|
config: input,
|
|
38656
38790
|
t: t,
|
|
38657
38791
|
ajaxForms: ajaxForms,
|
|
38658
|
-
linkingData:
|
|
38792
|
+
linkingData: values?.linking || values?.parent?.linking,
|
|
38659
38793
|
changeAjaxForms: changeAjaxForms,
|
|
38660
38794
|
getApiBaseUrl: getApiBaseUrl,
|
|
38661
38795
|
getAppHeader: getAppHeader,
|
|
@@ -38663,11 +38797,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38663
38797
|
getToken: getToken,
|
|
38664
38798
|
app: app,
|
|
38665
38799
|
valueOnlyString: true
|
|
38666
|
-
}) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](
|
|
38800
|
+
}) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
|
|
38801
|
+
...inputData,
|
|
38667
38802
|
maxWidth,
|
|
38668
38803
|
staticWidth,
|
|
38669
38804
|
fullWidth
|
|
38670
|
-
}
|
|
38805
|
+
}, {
|
|
38671
38806
|
form: MainForm,
|
|
38672
38807
|
forms: options,
|
|
38673
38808
|
allForms: plainForms,
|
|
@@ -38688,10 +38823,10 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38688
38823
|
staticWidth,
|
|
38689
38824
|
fullWidth
|
|
38690
38825
|
}) : console.log(input)
|
|
38691
|
-
})
|
|
38826
|
+
}), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38692
38827
|
className: "code",
|
|
38693
38828
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
38694
|
-
children:
|
|
38829
|
+
children: input.meta?.code
|
|
38695
38830
|
})
|
|
38696
38831
|
}) : null]
|
|
38697
38832
|
}), maxRule ? ["imageUpload", "upload", "videoUpload"].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -38711,10 +38846,10 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38711
38846
|
className: "max-char-span",
|
|
38712
38847
|
children: t("max-char", {
|
|
38713
38848
|
chars: maxRule,
|
|
38714
|
-
filled:
|
|
38849
|
+
filled: inputData?.value?.length || 0
|
|
38715
38850
|
})
|
|
38716
38851
|
})
|
|
38717
|
-
}) : null,
|
|
38852
|
+
}) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38718
38853
|
className: "input-content",
|
|
38719
38854
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38720
38855
|
className: "comment-textarea",
|
|
@@ -38740,7 +38875,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38740
38875
|
},
|
|
38741
38876
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38742
38877
|
type: "link",
|
|
38743
|
-
disabled: !
|
|
38878
|
+
disabled: !input.meta?.comment,
|
|
38744
38879
|
className: "p-0",
|
|
38745
38880
|
children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
|
|
38746
38881
|
width: 16,
|
|
@@ -38749,11 +38884,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38749
38884
|
})
|
|
38750
38885
|
})]
|
|
38751
38886
|
}),
|
|
38752
|
-
children: inputTypeComponent$1.comment(
|
|
38887
|
+
children: inputTypeComponent$1.comment({
|
|
38888
|
+
...inputData,
|
|
38753
38889
|
maxWidth,
|
|
38754
38890
|
staticWidth,
|
|
38755
38891
|
fullWidth
|
|
38756
|
-
}
|
|
38892
|
+
}, {
|
|
38757
38893
|
form: MainForm,
|
|
38758
38894
|
forms: options,
|
|
38759
38895
|
setFormValues: setValues,
|
|
@@ -38778,16 +38914,16 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38778
38914
|
className: "max-char-span",
|
|
38779
38915
|
children: t("max-char", {
|
|
38780
38916
|
chars: MAX_COMMENTS_LENGTH,
|
|
38781
|
-
filled:
|
|
38917
|
+
filled: inputData?.commentValue?.length || 0
|
|
38782
38918
|
})
|
|
38783
38919
|
})]
|
|
38784
|
-
}) : null, lastReview
|
|
38920
|
+
}) : null, lastReview?.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38785
38921
|
className: "input-content",
|
|
38786
38922
|
children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
38787
38923
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38788
38924
|
className: "comment-textarea",
|
|
38789
|
-
initialValue:
|
|
38790
|
-
name:
|
|
38925
|
+
initialValue: lastReview?.comment || "",
|
|
38926
|
+
name: `${inputId}-reviewErrorComment`,
|
|
38791
38927
|
label: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38792
38928
|
className: "flex w-100",
|
|
38793
38929
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -38795,28 +38931,31 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38795
38931
|
children: t("Review note")
|
|
38796
38932
|
})
|
|
38797
38933
|
}),
|
|
38798
|
-
children: inputTypeComponent$1.comment(
|
|
38934
|
+
children: inputTypeComponent$1.comment({
|
|
38935
|
+
...inputData,
|
|
38799
38936
|
maxWidth,
|
|
38800
38937
|
staticWidth,
|
|
38801
38938
|
fullWidth
|
|
38802
|
-
}
|
|
38939
|
+
}, {
|
|
38803
38940
|
form: MainForm,
|
|
38804
38941
|
forms: options,
|
|
38805
|
-
value:
|
|
38942
|
+
value: lastReview?.comment || "",
|
|
38806
38943
|
onChange: val => {
|
|
38807
38944
|
changeInputMeta({
|
|
38808
38945
|
key: inputId,
|
|
38809
38946
|
type: input.type,
|
|
38810
|
-
value:
|
|
38811
|
-
|
|
38947
|
+
value: {
|
|
38948
|
+
...inputMeta,
|
|
38949
|
+
reviews: (inputMeta?.reviews || []).map(v => {
|
|
38812
38950
|
if (v.createdAt === lastReview.createdAt) {
|
|
38813
|
-
return
|
|
38951
|
+
return {
|
|
38952
|
+
...v,
|
|
38814
38953
|
comment: val
|
|
38815
|
-
}
|
|
38954
|
+
};
|
|
38816
38955
|
}
|
|
38817
38956
|
return v;
|
|
38818
38957
|
})
|
|
38819
|
-
}
|
|
38958
|
+
}
|
|
38820
38959
|
});
|
|
38821
38960
|
},
|
|
38822
38961
|
t,
|
|
@@ -38830,7 +38969,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38830
38969
|
className: "max-char-span",
|
|
38831
38970
|
children: t("max-char", {
|
|
38832
38971
|
chars: MAX_COMMENTS_LENGTH,
|
|
38833
|
-
filled:
|
|
38972
|
+
filled: lastReview.comment?.length || 0
|
|
38834
38973
|
})
|
|
38835
38974
|
})]
|
|
38836
38975
|
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -38851,7 +38990,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38851
38990
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38852
38991
|
className: "flex flex-column justify-center mr-1",
|
|
38853
38992
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
38854
|
-
children:
|
|
38993
|
+
children: lastReview?.reviewer?.firstName + " " + lastReview?.reviewer?.lastName + " - " + moment__default["default"](lastReview.createdAt).format("DD MMM YYYY")
|
|
38855
38994
|
})
|
|
38856
38995
|
})]
|
|
38857
38996
|
})]
|
|
@@ -38862,14 +39001,13 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38862
39001
|
return null;
|
|
38863
39002
|
}
|
|
38864
39003
|
};
|
|
38865
|
-
const editErrorHandler =
|
|
38866
|
-
|
|
38867
|
-
|
|
38868
|
-
|
|
38869
|
-
} = _ref76;
|
|
39004
|
+
const editErrorHandler = ({
|
|
39005
|
+
errorFields,
|
|
39006
|
+
t = s => s
|
|
39007
|
+
}) => {
|
|
38870
39008
|
if (Array.isArray(errorFields) && errorFields.length) {
|
|
38871
39009
|
const name = errorFields[0].name.join(".");
|
|
38872
|
-
const element = document.querySelector(
|
|
39010
|
+
const element = document.querySelector(`[data-id="${name}"]`);
|
|
38873
39011
|
if (element) {
|
|
38874
39012
|
element.scrollIntoView();
|
|
38875
39013
|
antd.message.error(t("errors::please-correct-invalid-inputs"));
|