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