datastake-daf 0.6.828 → 0.6.830
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 +1230 -1207
- package/dist/pages/index.js +12 -18
- package/dist/utils/index.js +25 -0
- package/package.json +1 -1
- package/src/@daf/core/components/Screens/Admin/adminRoutes.js +0 -2
- package/src/@daf/core/components/ViewForm/content.jsx +0 -1
- package/src/@daf/pages/Dashboards/UserDashboard/components/MineSites/index.jsx +0 -1
- package/src/@daf/pages/TablePage/hook.js +16 -9
- package/src/@daf/pages/View/index.jsx +1 -1
- package/src/helpers/dataFetch.js +19 -0
- package/src/utils.js +3 -1
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$F = ["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$F);
|
|
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$E = ["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$E);
|
|
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$D = ["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$D);
|
|
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$C = ["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$C);
|
|
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$B = ["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$B);
|
|
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$A = ["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$A);
|
|
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$z = ["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$z);
|
|
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$y = ["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$y);
|
|
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$x = ["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$x);
|
|
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$w = ["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$w);
|
|
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$v = ["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$v);
|
|
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$u = ["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$u);
|
|
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$t = ["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$t);
|
|
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$s = ["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$s);
|
|
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$r = ["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$r);
|
|
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$q = ["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$q);
|
|
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$p = ["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$p);
|
|
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$o = ["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$o);
|
|
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$n = ["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$n);
|
|
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$m = ["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$m);
|
|
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$l = ["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$l);
|
|
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$k = ["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$k);
|
|
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$j = ["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$j);
|
|
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$i = ["viewGroup"],
|
|
24941
24941
|
_excluded2$2 = ["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$i);
|
|
25013
25013
|
items[gKey] = gCfg;
|
|
25014
25014
|
}
|
|
25015
25015
|
return items;
|
|
@@ -25059,13 +25059,6 @@ const Content$1 = _ref => {
|
|
|
25059
25059
|
}
|
|
25060
25060
|
return all;
|
|
25061
25061
|
}, {});
|
|
25062
|
-
console.log({
|
|
25063
|
-
groups,
|
|
25064
|
-
singleGroupsKeys,
|
|
25065
|
-
addedContent,
|
|
25066
|
-
_length,
|
|
25067
|
-
groupped
|
|
25068
|
-
});
|
|
25069
25062
|
return Object.keys(groupped).map(key => {
|
|
25070
25063
|
const groups = groupped[key];
|
|
25071
25064
|
return /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
|
|
@@ -25296,7 +25289,7 @@ const Content$1 = _ref => {
|
|
|
25296
25289
|
});
|
|
25297
25290
|
};
|
|
25298
25291
|
|
|
25299
|
-
const _excluded$
|
|
25292
|
+
const _excluded$h = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
|
|
25300
25293
|
function Modal(_ref) {
|
|
25301
25294
|
let {
|
|
25302
25295
|
t = text => text,
|
|
@@ -25312,7 +25305,7 @@ function Modal(_ref) {
|
|
|
25312
25305
|
disabled = false,
|
|
25313
25306
|
withModalFormWrapper = true
|
|
25314
25307
|
} = _ref,
|
|
25315
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
25308
|
+
props = _objectWithoutProperties(_ref, _excluded$h);
|
|
25316
25309
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Modal, _objectSpread2(_objectSpread2({
|
|
25317
25310
|
width: 650,
|
|
25318
25311
|
footer: null,
|
|
@@ -30804,6 +30797,7 @@ function Repeatable({
|
|
|
30804
30797
|
});
|
|
30805
30798
|
}
|
|
30806
30799
|
|
|
30800
|
+
/* eslint-disable no-eval */
|
|
30807
30801
|
const isRiskComment = inputData => {
|
|
30808
30802
|
if (inputData) {
|
|
30809
30803
|
if (inputData.name === 'assessment') {
|
|
@@ -30816,10 +30810,7 @@ const isRiskComment = inputData => {
|
|
|
30816
30810
|
};
|
|
30817
30811
|
|
|
30818
30812
|
// 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
|
-
}
|
|
30813
|
+
function renderNestedInputs$1(options, k, ...args) {
|
|
30823
30814
|
if (options[k].repeatable) {
|
|
30824
30815
|
return renderRepeatable$1(options, k, ...args);
|
|
30825
30816
|
} else {
|
|
@@ -30847,11 +30838,10 @@ function renderRepeatable$1(options, k, setValues, values, excludedKeys, i, form
|
|
|
30847
30838
|
children: [getFormTitles$1(formTitles, formId, i), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(form.type) ? getInputHeadLines$1(form.type, i, form, values) : /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
30848
30839
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
|
|
30849
30840
|
name: formId,
|
|
30850
|
-
children: (fields,
|
|
30851
|
-
|
|
30852
|
-
|
|
30853
|
-
|
|
30854
|
-
} = _ref;
|
|
30841
|
+
children: (fields, {
|
|
30842
|
+
add,
|
|
30843
|
+
remove
|
|
30844
|
+
}) => {
|
|
30855
30845
|
const formData = form.repeatable ? values[formId] || [] : values[formId] ? [values[formId]] : [];
|
|
30856
30846
|
if (fields.length === 0) {
|
|
30857
30847
|
const formInputs = form.inputs;
|
|
@@ -30901,10 +30891,14 @@ function renderRepeatable$1(options, k, setValues, values, excludedKeys, i, form
|
|
|
30901
30891
|
const _val = {
|
|
30902
30892
|
[formId]: formData.map((d, j) => i === j ? val : d)
|
|
30903
30893
|
};
|
|
30904
|
-
onValuesChange(_val,
|
|
30905
|
-
|
|
30894
|
+
onValuesChange(_val, {
|
|
30895
|
+
...values,
|
|
30896
|
+
..._val
|
|
30897
|
+
});
|
|
30898
|
+
setValues({
|
|
30899
|
+
...values,
|
|
30906
30900
|
[formId]: formData.map((d, j) => i === j ? val : d)
|
|
30907
|
-
})
|
|
30901
|
+
});
|
|
30908
30902
|
};
|
|
30909
30903
|
return /*#__PURE__*/jsxRuntime.jsx(Repeatable, {
|
|
30910
30904
|
form: form,
|
|
@@ -30960,156 +30954,154 @@ const getGroupContent = (form, values, i, formId, excludedKeys, getData, setValu
|
|
|
30960
30954
|
highlightMandatory
|
|
30961
30955
|
});
|
|
30962
30956
|
};
|
|
30963
|
-
const GroupContent =
|
|
30964
|
-
|
|
30965
|
-
|
|
30966
|
-
|
|
30967
|
-
|
|
30968
|
-
|
|
30969
|
-
|
|
30970
|
-
|
|
30971
|
-
|
|
30972
|
-
|
|
30973
|
-
|
|
30974
|
-
|
|
30975
|
-
|
|
30976
|
-
|
|
30977
|
-
|
|
30978
|
-
|
|
30979
|
-
|
|
30980
|
-
highlightMandatory
|
|
30981
|
-
} = _ref2;
|
|
30957
|
+
const GroupContent = ({
|
|
30958
|
+
form,
|
|
30959
|
+
values = {},
|
|
30960
|
+
i,
|
|
30961
|
+
formId,
|
|
30962
|
+
excludedKeys,
|
|
30963
|
+
getData,
|
|
30964
|
+
setValues,
|
|
30965
|
+
MainForm,
|
|
30966
|
+
options,
|
|
30967
|
+
plainForms,
|
|
30968
|
+
setAddress,
|
|
30969
|
+
onValuesChange,
|
|
30970
|
+
allData,
|
|
30971
|
+
changeInputMeta,
|
|
30972
|
+
highlightMandatory
|
|
30973
|
+
}) => {
|
|
30982
30974
|
const {
|
|
30983
30975
|
user,
|
|
30984
30976
|
t
|
|
30985
30977
|
} = useEditContext();
|
|
30986
30978
|
const label = getInputLabel$1(form, values);
|
|
30987
|
-
const notPartOfTheForm =
|
|
30979
|
+
const notPartOfTheForm = form?.type === 'ajaxSubGroup' ? true : !!form?.meta?.isSubGroup;
|
|
30988
30980
|
const hasLabel = label && (typeof label === 'string' && (label || '').trim() !== '' || typeof label === 'object') ? true : false;
|
|
30989
30981
|
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
|
-
|
|
30982
|
+
const renderInputs = () => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
30983
|
+
children: [form?.meta?.groupInfo ? /*#__PURE__*/jsxRuntime.jsx(GroupInfos, {
|
|
30984
|
+
config: form.meta.groupInfo,
|
|
30985
|
+
user: user,
|
|
30986
|
+
t: t
|
|
30987
|
+
}) : null, Object.keys(form.inputs || {}).filter(i => !excludedKeys.includes(i)).map((inp, ii) => {
|
|
30988
|
+
const isAjaxSubGroup = form?.type === "ajaxSubGroup";
|
|
30989
|
+
const input = form.inputs[inp];
|
|
30990
|
+
const inputId = input.dataId || inp;
|
|
30991
|
+
const inputValues = notPartOfTheForm ? Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {} : values;
|
|
30992
|
+
const value = inputValues[inputId];
|
|
30993
|
+
const commentValue = inputValues[`${inputId}Comment`];
|
|
30994
|
+
const inputData = getData(formId, input, value, commentValue, `${formId}.${inputId}`, `${formId}.${inputId}`);
|
|
30995
|
+
const subtitles = form.subtitles || null;
|
|
30996
|
+
const inputMeta = notPartOfTheForm ? isAjaxSubGroup ? (values[formId] || {})?.meta?.inputs?.[inputId] || {} : ((values?.meta?.inputs || {})[formId] || {})[inputId] || {} : (values?.meta?.inputs || {})[inputId] || {};
|
|
30997
|
+
inputData.repeatIndex = undefined;
|
|
30998
|
+
inputData.inputName = inputId;
|
|
30999
|
+
inputData.repeatValues = inputValues;
|
|
31000
|
+
if (inputData.groupInputs && Array.isArray(inputData.groupInputs)) {
|
|
31001
|
+
inputData.groupInputs = inputData.groupInputs.map(gpI => {
|
|
31002
|
+
gpI.data.inputName = gpI.data.name;
|
|
31003
|
+
gpI.data.repeatIndex = undefined;
|
|
31004
|
+
gpI.data.name = formId;
|
|
31005
|
+
return gpI;
|
|
31006
|
+
});
|
|
31007
|
+
}
|
|
31008
|
+
const isRisk = isRiskComment(inputData);
|
|
31009
|
+
const isHighlighted = highlightMandatory && input?.meta?.mandatory && inputIsEmpty(input, inputValues, inputMeta);
|
|
31010
|
+
const btnOnClick = () => {
|
|
31011
|
+
if (typeof inputData.commentValue === 'string') {
|
|
31012
|
+
onValuesChange({}, {
|
|
31013
|
+
...values,
|
|
31014
|
+
[`${inputData.inputName}`]: null
|
|
31017
31015
|
});
|
|
31018
31016
|
}
|
|
31019
|
-
const
|
|
31020
|
-
|
|
31021
|
-
|
|
31022
|
-
|
|
31023
|
-
|
|
31024
|
-
|
|
31025
|
-
|
|
31026
|
-
|
|
31017
|
+
const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
|
|
31018
|
+
inputValues[`${inputData.inputName}Comment`] = typeof inputData.commentValue !== 'string' ? '' : null;
|
|
31019
|
+
if (Array.isArray(values[formId])) {
|
|
31020
|
+
values[formId] = inputValues;
|
|
31021
|
+
} else {
|
|
31022
|
+
values[formId] = inputValues;
|
|
31023
|
+
}
|
|
31024
|
+
setValues({
|
|
31025
|
+
...values
|
|
31026
|
+
});
|
|
31027
|
+
};
|
|
31028
|
+
const btnOnClick2 = () => {
|
|
31029
|
+
if (typeof inputData.commentValue !== 'string') {
|
|
31027
31030
|
const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
|
|
31028
|
-
inputValues[
|
|
31031
|
+
inputValues[`${inputData.inputName}Comment`] = typeof inputData.commentValue !== 'string' ? '' : null;
|
|
31029
31032
|
if (Array.isArray(values[formId])) {
|
|
31030
31033
|
values[formId] = inputValues;
|
|
31031
31034
|
} else {
|
|
31032
31035
|
values[formId] = inputValues;
|
|
31033
31036
|
}
|
|
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 || ''
|
|
31037
|
+
setValues({
|
|
31038
|
+
...values
|
|
31064
31039
|
});
|
|
31065
31040
|
}
|
|
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
|
-
|
|
31041
|
+
};
|
|
31042
|
+
const rules = inputData?.rules?.length ? inputData.rules.filter(rule => !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max')) : (input?.meta?.rules || []).filter(rule => {
|
|
31043
|
+
if (rule.metaIf && typeof rule.metaIf === 'string') {
|
|
31044
|
+
const [name, cond, value] = rule.metaIf.split(' ');
|
|
31045
|
+
const val = name.includes('./') ? values?.meta?.inputs?.[formId]?.[name.split('./')[1]] : values?.meta?.inputs?.[name.split('./')[1]];
|
|
31046
|
+
if (cond === 'is') {
|
|
31047
|
+
return !!val?.[value];
|
|
31048
|
+
}
|
|
31049
|
+
}
|
|
31050
|
+
return !Object.keys(rule || {}).includes('accept') && !Object.keys(rule || {}).includes('max');
|
|
31051
|
+
});
|
|
31052
|
+
const requiredRule = rules.find(r => r.required);
|
|
31053
|
+
if (requiredRule && input.type === 'text') {
|
|
31054
|
+
rules.push({
|
|
31055
|
+
whitespace: true,
|
|
31056
|
+
message: requiredRule.message || ''
|
|
31057
|
+
});
|
|
31058
|
+
}
|
|
31059
|
+
return showHideInput$1(input, values, undefined, inputValues, setValues) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
|
|
31060
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
31061
|
+
style: {
|
|
31062
|
+
position: 'relative'
|
|
31063
|
+
},
|
|
31064
|
+
children: [getSubtitles$1(subtitles, input.position, values, undefined, inputValues), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(input.type) ? getInputHeadLines$1(input.type, i, input, values) : isRisk ? /*#__PURE__*/jsxRuntime.jsx(RiskGroup, {
|
|
31065
|
+
input: input,
|
|
31066
|
+
inputTypeComponent: inputTypeComponent$1,
|
|
31067
|
+
inputData: inputData,
|
|
31068
|
+
MainForm: MainForm,
|
|
31069
|
+
options: options,
|
|
31070
|
+
setValues: setValues,
|
|
31071
|
+
formId: formId,
|
|
31072
|
+
inputId: inputId,
|
|
31073
|
+
inputOnBlur: inputOnBlur,
|
|
31074
|
+
values: values,
|
|
31075
|
+
getInputLabel: getInputLabel$1,
|
|
31076
|
+
plainForms: plainForms,
|
|
31077
|
+
setAddress: setAddress,
|
|
31078
|
+
btnOnClick: btnOnClick,
|
|
31079
|
+
btnOnClick2: btnOnClick2,
|
|
31080
|
+
locationName: (allData || {}).locationName,
|
|
31081
|
+
subGroupTitle: (allData || {}).subGroupTitle
|
|
31082
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(GroupContentFormItem, {
|
|
31083
|
+
values,
|
|
31084
|
+
formId,
|
|
31085
|
+
setValues,
|
|
31086
|
+
MainForm,
|
|
31087
|
+
options,
|
|
31088
|
+
plainForms,
|
|
31089
|
+
setAddress,
|
|
31090
|
+
inputData,
|
|
31091
|
+
inputId,
|
|
31092
|
+
input,
|
|
31093
|
+
rules,
|
|
31094
|
+
inputMeta,
|
|
31095
|
+
changeInputMeta,
|
|
31096
|
+
notPartOfTheForm,
|
|
31097
|
+
isAjaxSubGroup,
|
|
31098
|
+
isHighlighted
|
|
31099
|
+
})]
|
|
31100
|
+
}, ii)
|
|
31101
|
+
}, `${i}${ii}`) : null;
|
|
31102
|
+
})]
|
|
31103
|
+
});
|
|
31104
|
+
const isNa = formValues?.valuation === 'na';
|
|
31113
31105
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
31114
31106
|
children: [hasLabel ? options.isRisk && options.dontShowTitle ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31115
31107
|
className: "risk-header",
|
|
@@ -31117,46 +31109,44 @@ const GroupContent = _ref2 => {
|
|
|
31117
31109
|
children: label
|
|
31118
31110
|
})
|
|
31119
31111
|
}) : /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
31120
|
-
className:
|
|
31112
|
+
className: `${form.titleClass ? form.titleClass : 'title-semibold-4'} ${i ? 'mt-3 mb-1' : ''}`,
|
|
31121
31113
|
children: label
|
|
31122
31114
|
}) : null, /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
31123
|
-
className:
|
|
31115
|
+
className: `repeatable ${hasLabel ? "mb-4" : ""}`,
|
|
31124
31116
|
children: [form.titleLabel ? /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
31125
31117
|
children: getInputProp(form.titleLabel, values)
|
|
31126
|
-
}) : null, formValues
|
|
31118
|
+
}) : null, formValues?.noPlanningRequired ? /*#__PURE__*/jsxRuntime.jsx(GroupInfoHOC, {
|
|
31127
31119
|
t: t,
|
|
31128
31120
|
isNa: isNa,
|
|
31129
31121
|
isSuccess: !isNa
|
|
31130
31122
|
// TODO: translate
|
|
31131
31123
|
,
|
|
31132
31124
|
config: {
|
|
31133
|
-
title: t(
|
|
31125
|
+
title: t(`No ${formValues?.stage || 'planning'} required`)
|
|
31134
31126
|
},
|
|
31135
31127
|
children: renderInputs()
|
|
31136
31128
|
}) : renderInputs()]
|
|
31137
31129
|
})]
|
|
31138
31130
|
});
|
|
31139
31131
|
};
|
|
31140
|
-
const GroupContentFormItem =
|
|
31141
|
-
|
|
31142
|
-
|
|
31143
|
-
|
|
31144
|
-
|
|
31145
|
-
|
|
31146
|
-
|
|
31147
|
-
|
|
31148
|
-
|
|
31149
|
-
|
|
31150
|
-
|
|
31151
|
-
|
|
31152
|
-
|
|
31153
|
-
|
|
31154
|
-
|
|
31155
|
-
|
|
31156
|
-
|
|
31157
|
-
|
|
31158
|
-
isHighlighted
|
|
31159
|
-
} = _ref4;
|
|
31132
|
+
const GroupContentFormItem = ({
|
|
31133
|
+
values,
|
|
31134
|
+
formId,
|
|
31135
|
+
setValues,
|
|
31136
|
+
MainForm,
|
|
31137
|
+
options,
|
|
31138
|
+
plainForms,
|
|
31139
|
+
setAddress,
|
|
31140
|
+
inputData,
|
|
31141
|
+
inputId,
|
|
31142
|
+
input,
|
|
31143
|
+
rules,
|
|
31144
|
+
inputMeta,
|
|
31145
|
+
changeInputMeta,
|
|
31146
|
+
notPartOfTheForm = true,
|
|
31147
|
+
isAjaxSubGroup,
|
|
31148
|
+
isHighlighted
|
|
31149
|
+
}) => {
|
|
31160
31150
|
const {
|
|
31161
31151
|
t,
|
|
31162
31152
|
user,
|
|
@@ -31170,10 +31160,10 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31170
31160
|
staticWidth,
|
|
31171
31161
|
fullWidth
|
|
31172
31162
|
} = useEditContext();
|
|
31173
|
-
const [isShown, setIsShown] = React.useState(!!
|
|
31174
|
-
let maxRule =
|
|
31163
|
+
const [isShown, setIsShown] = React.useState(!!inputMeta?.comment);
|
|
31164
|
+
let maxRule = rules.find(rule => rule.max)?.max;
|
|
31175
31165
|
const requiredRule = rules.find(r => r.required);
|
|
31176
|
-
const lastReview = (
|
|
31166
|
+
const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
|
|
31177
31167
|
if (!maxRule && input.type === 'textarea') {
|
|
31178
31168
|
maxRule = MAX_TEXT_AREA_LENGTH;
|
|
31179
31169
|
}
|
|
@@ -31192,35 +31182,38 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31192
31182
|
}
|
|
31193
31183
|
setIsShown(true);
|
|
31194
31184
|
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] || {};
|
|
31185
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31197
31186
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31198
31187
|
if (isAjaxSubGroup) {
|
|
31199
|
-
var _defaultData$meta, _defaultData$meta2;
|
|
31200
31188
|
changeInputMeta({
|
|
31201
31189
|
key: formId,
|
|
31202
31190
|
type: input.type,
|
|
31203
31191
|
otherValues: {
|
|
31204
|
-
[formId]:
|
|
31192
|
+
[formId]: {
|
|
31193
|
+
..._defaultData,
|
|
31205
31194
|
meta: {
|
|
31206
|
-
inputs:
|
|
31207
|
-
|
|
31195
|
+
inputs: {
|
|
31196
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31197
|
+
[inputId]: {
|
|
31198
|
+
...((_defaultData?.meta?.inputs || {})[inputId] || {}),
|
|
31208
31199
|
comment: ''
|
|
31209
|
-
}
|
|
31210
|
-
}
|
|
31200
|
+
}
|
|
31201
|
+
}
|
|
31211
31202
|
}
|
|
31212
|
-
}
|
|
31203
|
+
}
|
|
31213
31204
|
}
|
|
31214
31205
|
});
|
|
31215
31206
|
} else {
|
|
31216
31207
|
changeInputMeta({
|
|
31217
31208
|
key: formId,
|
|
31218
31209
|
type: input.type,
|
|
31219
|
-
value:
|
|
31220
|
-
|
|
31210
|
+
value: {
|
|
31211
|
+
..._defaultMeta,
|
|
31212
|
+
[inputId]: {
|
|
31213
|
+
...(_defaultMeta[inputId] || {}),
|
|
31221
31214
|
comment: ''
|
|
31222
|
-
}
|
|
31223
|
-
}
|
|
31215
|
+
}
|
|
31216
|
+
}
|
|
31224
31217
|
});
|
|
31225
31218
|
}
|
|
31226
31219
|
} else {
|
|
@@ -31237,58 +31230,62 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31237
31230
|
if (!isReview) {
|
|
31238
31231
|
return;
|
|
31239
31232
|
}
|
|
31240
|
-
const reviewSuccess = lastReview
|
|
31233
|
+
const reviewSuccess = lastReview?.reviewSuccess;
|
|
31241
31234
|
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] || {};
|
|
31235
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31244
31236
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31245
31237
|
if (isAjaxSubGroup) {
|
|
31246
|
-
var _defaultData$meta3, _defaultData$meta4, _defaultData$meta5, _defaultData$meta6;
|
|
31247
31238
|
changeInputMeta({
|
|
31248
31239
|
key: formId,
|
|
31249
31240
|
type: input.type,
|
|
31250
31241
|
otherValues: {
|
|
31251
|
-
[formId]:
|
|
31242
|
+
[formId]: {
|
|
31243
|
+
..._defaultData,
|
|
31252
31244
|
meta: {
|
|
31253
|
-
inputs:
|
|
31254
|
-
|
|
31255
|
-
|
|
31245
|
+
inputs: {
|
|
31246
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31247
|
+
[inputId]: {
|
|
31248
|
+
...((_defaultData?.meta?.inputs || {})[inputId] || {}),
|
|
31249
|
+
reviews: reviewSuccess ? (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []), {
|
|
31256
31250
|
reviewer: user,
|
|
31257
31251
|
createdAt: new Date().toISOString(),
|
|
31258
31252
|
reviewSuccess: true
|
|
31259
31253
|
}]
|
|
31260
|
-
}
|
|
31261
|
-
}
|
|
31254
|
+
}
|
|
31255
|
+
}
|
|
31262
31256
|
}
|
|
31263
|
-
}
|
|
31257
|
+
}
|
|
31264
31258
|
}
|
|
31265
31259
|
});
|
|
31266
31260
|
} else {
|
|
31267
31261
|
changeInputMeta({
|
|
31268
31262
|
key: formId,
|
|
31269
31263
|
type: input.type,
|
|
31270
|
-
value:
|
|
31271
|
-
|
|
31264
|
+
value: {
|
|
31265
|
+
..._defaultMeta,
|
|
31266
|
+
[inputId]: {
|
|
31267
|
+
...(_defaultMeta[inputId] || {}),
|
|
31272
31268
|
reviews: reviewSuccess ? ((_defaultMeta[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((_defaultMeta[inputId] || {}).reviews || []), {
|
|
31273
31269
|
reviewer: user,
|
|
31274
31270
|
createdAt: new Date().toISOString(),
|
|
31275
31271
|
reviewSuccess: true
|
|
31276
31272
|
}]
|
|
31277
|
-
}
|
|
31278
|
-
}
|
|
31273
|
+
}
|
|
31274
|
+
}
|
|
31279
31275
|
});
|
|
31280
31276
|
}
|
|
31281
31277
|
} else {
|
|
31282
31278
|
changeInputMeta({
|
|
31283
31279
|
key: inputId,
|
|
31284
31280
|
type: input.type,
|
|
31285
|
-
value:
|
|
31281
|
+
value: {
|
|
31282
|
+
...inputMeta,
|
|
31286
31283
|
reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
|
|
31287
31284
|
reviewer: user,
|
|
31288
31285
|
createdAt: new Date().toISOString(),
|
|
31289
31286
|
reviewSuccess: true
|
|
31290
31287
|
}]
|
|
31291
|
-
}
|
|
31288
|
+
}
|
|
31292
31289
|
});
|
|
31293
31290
|
}
|
|
31294
31291
|
};
|
|
@@ -31296,111 +31293,118 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31296
31293
|
if (!isReview) {
|
|
31297
31294
|
return;
|
|
31298
31295
|
}
|
|
31299
|
-
const reviewError = lastReview
|
|
31296
|
+
const reviewError = lastReview?.reviewError;
|
|
31300
31297
|
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] || {};
|
|
31298
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31303
31299
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31304
31300
|
if (isAjaxSubGroup) {
|
|
31305
|
-
var _defaultData$meta7, _defaultData$meta8, _defaultData$meta9, _defaultData$meta10;
|
|
31306
31301
|
changeInputMeta({
|
|
31307
31302
|
key: formId,
|
|
31308
31303
|
type: input.type,
|
|
31309
31304
|
otherValues: {
|
|
31310
|
-
[formId]:
|
|
31305
|
+
[formId]: {
|
|
31306
|
+
..._defaultData,
|
|
31311
31307
|
meta: {
|
|
31312
|
-
inputs:
|
|
31313
|
-
|
|
31314
|
-
|
|
31308
|
+
inputs: {
|
|
31309
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31310
|
+
[inputId]: {
|
|
31311
|
+
...((_defaultData?.meta?.inputs || {})[inputId] || {}),
|
|
31312
|
+
reviews: reviewError ? (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []), {
|
|
31315
31313
|
reviewer: user,
|
|
31316
31314
|
createdAt: new Date().toISOString(),
|
|
31317
31315
|
reviewError: true,
|
|
31318
31316
|
comment: ''
|
|
31319
31317
|
}]
|
|
31320
|
-
}
|
|
31321
|
-
}
|
|
31318
|
+
}
|
|
31319
|
+
}
|
|
31322
31320
|
}
|
|
31323
|
-
}
|
|
31321
|
+
}
|
|
31324
31322
|
}
|
|
31325
31323
|
});
|
|
31326
31324
|
} else {
|
|
31327
31325
|
changeInputMeta({
|
|
31328
31326
|
key: formId,
|
|
31329
31327
|
type: input.type,
|
|
31330
|
-
value:
|
|
31331
|
-
|
|
31328
|
+
value: {
|
|
31329
|
+
..._defaultMeta,
|
|
31330
|
+
[inputId]: {
|
|
31331
|
+
...(_defaultMeta[inputId] || {}),
|
|
31332
31332
|
reviews: reviewError ? ((_defaultMeta[inputId] || {}).reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...((_defaultMeta[inputId] || {}).reviews || []), {
|
|
31333
31333
|
reviewer: user,
|
|
31334
31334
|
createdAt: new Date().toISOString(),
|
|
31335
31335
|
reviewError: true,
|
|
31336
31336
|
comment: ''
|
|
31337
31337
|
}]
|
|
31338
|
-
}
|
|
31339
|
-
}
|
|
31338
|
+
}
|
|
31339
|
+
}
|
|
31340
31340
|
});
|
|
31341
31341
|
}
|
|
31342
31342
|
} else {
|
|
31343
31343
|
changeInputMeta({
|
|
31344
31344
|
key: inputId,
|
|
31345
31345
|
type: input.type,
|
|
31346
|
-
value:
|
|
31346
|
+
value: {
|
|
31347
|
+
...inputMeta,
|
|
31347
31348
|
reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
|
|
31348
31349
|
reviewer: user,
|
|
31349
31350
|
createdAt: new Date().toISOString(),
|
|
31350
31351
|
reviewError: true,
|
|
31351
31352
|
comment: ''
|
|
31352
31353
|
}]
|
|
31353
|
-
}
|
|
31354
|
+
}
|
|
31354
31355
|
});
|
|
31355
31356
|
}
|
|
31356
31357
|
};
|
|
31357
|
-
const requiredComment =
|
|
31358
|
+
const requiredComment = inputMeta?.notApplicable && input?.meta?.requiredCommentOnNotApplicable && values?.[formId]?.valuation !== 'na';
|
|
31358
31359
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
31359
31360
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
31360
31361
|
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;
|
|
31362
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
31363
|
+
required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
|
|
31364
|
+
...(['total100', 'group'].includes(input.type) ? {} : {
|
|
31365
|
+
name: notPartOfTheForm ? [formId, inputId] : inputId,
|
|
31366
|
+
fieldKey: notPartOfTheForm ? [formId, inputId] : inputId,
|
|
31367
|
+
initialValue: notPartOfTheForm ? (values[formId] || {})[inputId] : values[inputId]
|
|
31368
|
+
}),
|
|
31369
|
+
...(['upload', 'imageUpload', 'videoUpload'].includes(input.type) ? {
|
|
31370
|
+
valuePropName: "fileList",
|
|
31371
|
+
getValueFromEvent: e => {
|
|
31372
|
+
if (Array.isArray(e)) {
|
|
31373
|
+
return e;
|
|
31376
31374
|
}
|
|
31377
|
-
return f
|
|
31378
|
-
|
|
31379
|
-
|
|
31380
|
-
|
|
31381
|
-
|
|
31382
|
-
|
|
31375
|
+
return e && e.fileList && e.fileList.map(f => {
|
|
31376
|
+
if (f.response) {
|
|
31377
|
+
return f.response;
|
|
31378
|
+
}
|
|
31379
|
+
return f;
|
|
31380
|
+
});
|
|
31381
|
+
}
|
|
31382
|
+
} : {}),
|
|
31383
|
+
...(inputOnBlur.includes(input.type) ? {
|
|
31384
|
+
trigger: "onBlur"
|
|
31385
|
+
} : {}),
|
|
31383
31386
|
style: input.showOnView === false ? {
|
|
31384
31387
|
display: 'none'
|
|
31385
|
-
} : {}
|
|
31386
|
-
|
|
31387
|
-
|
|
31388
|
-
|
|
31389
|
-
|
|
31390
|
-
|
|
31391
|
-
|
|
31392
|
-
|
|
31393
|
-
|
|
31394
|
-
|
|
31395
|
-
|
|
31396
|
-
|
|
31388
|
+
} : {},
|
|
31389
|
+
...(['switch'].includes(input.type) ? {
|
|
31390
|
+
labelCol: {
|
|
31391
|
+
span: 20
|
|
31392
|
+
},
|
|
31393
|
+
style: {
|
|
31394
|
+
...(input.showOnView === false ? {
|
|
31395
|
+
display: 'none'
|
|
31396
|
+
} : {}),
|
|
31397
|
+
flexDirection: 'row',
|
|
31398
|
+
justifyContent: 'space-between'
|
|
31399
|
+
}
|
|
31400
|
+
} : {}),
|
|
31397
31401
|
label: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31398
|
-
className:
|
|
31402
|
+
className: input?.meta?.code && "mr-10",
|
|
31399
31403
|
children: getInputLabel$1(input, values)
|
|
31400
31404
|
}) : null,
|
|
31401
31405
|
rules: rules,
|
|
31402
|
-
className: formatClassname([input.comment ?
|
|
31403
|
-
"data-id":
|
|
31406
|
+
className: formatClassname([input.comment ? `flex-1 with-comment i-${input.type}` : `i-${input.type} flex-1 `, noActionsInputs.includes(input.type) && 'no-actions-input']),
|
|
31407
|
+
"data-id": `${formId}.${inputId}`,
|
|
31404
31408
|
extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
31405
31409
|
children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
31406
31410
|
className: formatClassname(["ml-4 input-actions"]),
|
|
@@ -31410,7 +31414,7 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31410
31414
|
title: t('Add review note'),
|
|
31411
31415
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31412
31416
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31413
|
-
className: formatClassname(["review-btn review-error-btn",
|
|
31417
|
+
className: formatClassname(["review-btn review-error-btn", lastReview?.reviewError && 'primary']),
|
|
31414
31418
|
type: "link",
|
|
31415
31419
|
onClick: onClickReviewError,
|
|
31416
31420
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
@@ -31426,7 +31430,7 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31426
31430
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31427
31431
|
type: "link",
|
|
31428
31432
|
onClick: onClickReviewSuccess,
|
|
31429
|
-
className: formatClassname(["review-btn review-success-btn",
|
|
31433
|
+
className: formatClassname(["review-btn review-success-btn", lastReview?.reviewSuccess && 'primary']),
|
|
31430
31434
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
31431
31435
|
name: "CheckSquare",
|
|
31432
31436
|
width: 16,
|
|
@@ -31443,59 +31447,65 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31443
31447
|
className: formatClassname(["default p-0", inputMeta.notApplicable && 'primary']),
|
|
31444
31448
|
type: "link",
|
|
31445
31449
|
onClick: () => {
|
|
31446
|
-
var _input$meta5, _input$meta6;
|
|
31447
31450
|
const value = getDefaultInputValue(input);
|
|
31448
|
-
const commentMeta = input
|
|
31451
|
+
const commentMeta = input?.meta?.requiredCommentOnNotApplicable ? {
|
|
31449
31452
|
comment: ''
|
|
31450
31453
|
} : {};
|
|
31451
|
-
if (input
|
|
31454
|
+
if (input?.meta?.requiredCommentOnNotApplicable) {
|
|
31452
31455
|
setIsShown(true);
|
|
31453
31456
|
}
|
|
31454
31457
|
if (notPartOfTheForm || isAjaxSubGroup) {
|
|
31455
|
-
var _values$meta8;
|
|
31456
31458
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31457
|
-
const _defaultMeta = (
|
|
31459
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31458
31460
|
if (isAjaxSubGroup) {
|
|
31459
|
-
var _defaultData$meta11;
|
|
31460
31461
|
changeInputMeta({
|
|
31461
31462
|
key: formId,
|
|
31462
31463
|
type: input.type,
|
|
31463
31464
|
otherValues: {
|
|
31464
|
-
[formId]:
|
|
31465
|
+
[formId]: {
|
|
31466
|
+
..._defaultData,
|
|
31465
31467
|
[inputId]: value,
|
|
31466
31468
|
meta: {
|
|
31467
|
-
inputs:
|
|
31468
|
-
|
|
31469
|
+
inputs: {
|
|
31470
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31471
|
+
[inputId]: inputMeta.notApplicable ? {
|
|
31469
31472
|
notApplicable: false,
|
|
31470
|
-
notAvailable: false
|
|
31471
|
-
|
|
31473
|
+
notAvailable: false,
|
|
31474
|
+
...commentMeta
|
|
31475
|
+
} : {
|
|
31472
31476
|
notApplicable: true,
|
|
31473
|
-
notAvailable: false
|
|
31474
|
-
|
|
31475
|
-
|
|
31477
|
+
notAvailable: false,
|
|
31478
|
+
...commentMeta
|
|
31479
|
+
}
|
|
31480
|
+
}
|
|
31476
31481
|
}
|
|
31477
|
-
}
|
|
31482
|
+
}
|
|
31478
31483
|
}
|
|
31479
31484
|
});
|
|
31480
31485
|
} else {
|
|
31481
31486
|
changeInputMeta({
|
|
31482
31487
|
key: formId,
|
|
31483
31488
|
type: input.type,
|
|
31484
|
-
value: inputMeta.notApplicable ?
|
|
31485
|
-
|
|
31489
|
+
value: inputMeta.notApplicable ? {
|
|
31490
|
+
..._defaultMeta,
|
|
31491
|
+
[inputId]: {
|
|
31486
31492
|
notApplicable: false,
|
|
31487
|
-
notAvailable: false
|
|
31488
|
-
|
|
31489
|
-
|
|
31490
|
-
|
|
31493
|
+
notAvailable: false,
|
|
31494
|
+
...commentMeta
|
|
31495
|
+
}
|
|
31496
|
+
} : {
|
|
31497
|
+
..._defaultMeta,
|
|
31498
|
+
[inputId]: {
|
|
31491
31499
|
notApplicable: true,
|
|
31492
|
-
notAvailable: false
|
|
31493
|
-
|
|
31494
|
-
|
|
31500
|
+
notAvailable: false,
|
|
31501
|
+
...commentMeta
|
|
31502
|
+
}
|
|
31503
|
+
},
|
|
31495
31504
|
otherValues: {
|
|
31496
|
-
[formId]:
|
|
31505
|
+
[formId]: {
|
|
31506
|
+
..._defaultData,
|
|
31497
31507
|
[inputId]: value
|
|
31498
|
-
}
|
|
31508
|
+
}
|
|
31499
31509
|
}
|
|
31500
31510
|
});
|
|
31501
31511
|
}
|
|
@@ -31516,7 +31526,7 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31516
31526
|
});
|
|
31517
31527
|
}
|
|
31518
31528
|
},
|
|
31519
|
-
disabled: !
|
|
31529
|
+
disabled: !input.meta?.notApplicable,
|
|
31520
31530
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
31521
31531
|
name: "NotApplicable",
|
|
31522
31532
|
width: 16,
|
|
@@ -31530,24 +31540,24 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31530
31540
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
31531
31541
|
className: formatClassname(["default p-0", inputMeta.notAvailable && 'primary']),
|
|
31532
31542
|
type: "link",
|
|
31533
|
-
disabled: !
|
|
31543
|
+
disabled: !input.meta?.notAvailable,
|
|
31534
31544
|
onClick: () => {
|
|
31535
31545
|
const value = getDefaultInputValue(input);
|
|
31536
31546
|
if (notPartOfTheForm || isAjaxSubGroup) {
|
|
31537
|
-
var _values$meta9;
|
|
31538
31547
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31539
|
-
const _defaultMeta = (
|
|
31548
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31540
31549
|
if (isAjaxSubGroup) {
|
|
31541
31550
|
if (isAjaxSubGroup) {
|
|
31542
|
-
var _defaultData$meta12;
|
|
31543
31551
|
changeInputMeta({
|
|
31544
31552
|
key: formId,
|
|
31545
31553
|
type: input.type,
|
|
31546
31554
|
otherValues: {
|
|
31547
|
-
[formId]:
|
|
31555
|
+
[formId]: {
|
|
31556
|
+
..._defaultData,
|
|
31548
31557
|
[inputId]: value,
|
|
31549
31558
|
meta: {
|
|
31550
|
-
inputs:
|
|
31559
|
+
inputs: {
|
|
31560
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31551
31561
|
[inputId]: inputMeta.notAvailable ? {
|
|
31552
31562
|
notApplicable: false,
|
|
31553
31563
|
notAvailable: false
|
|
@@ -31555,9 +31565,9 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31555
31565
|
notApplicable: false,
|
|
31556
31566
|
notAvailable: true
|
|
31557
31567
|
}
|
|
31558
|
-
}
|
|
31568
|
+
}
|
|
31559
31569
|
}
|
|
31560
|
-
}
|
|
31570
|
+
}
|
|
31561
31571
|
}
|
|
31562
31572
|
});
|
|
31563
31573
|
}
|
|
@@ -31565,21 +31575,24 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31565
31575
|
changeInputMeta({
|
|
31566
31576
|
key: formId,
|
|
31567
31577
|
type: input.type,
|
|
31568
|
-
value: inputMeta.notAvailable ?
|
|
31578
|
+
value: inputMeta.notAvailable ? {
|
|
31579
|
+
..._defaultMeta,
|
|
31569
31580
|
[inputId]: {
|
|
31570
31581
|
notApplicable: false,
|
|
31571
31582
|
notAvailable: false
|
|
31572
31583
|
}
|
|
31573
|
-
}
|
|
31584
|
+
} : {
|
|
31585
|
+
..._defaultMeta,
|
|
31574
31586
|
[inputId]: {
|
|
31575
31587
|
notApplicable: false,
|
|
31576
31588
|
notAvailable: true
|
|
31577
31589
|
}
|
|
31578
|
-
}
|
|
31590
|
+
},
|
|
31579
31591
|
otherValues: {
|
|
31580
|
-
[formId]:
|
|
31592
|
+
[formId]: {
|
|
31593
|
+
..._defaultData,
|
|
31581
31594
|
[inputId]: value
|
|
31582
|
-
}
|
|
31595
|
+
}
|
|
31583
31596
|
}
|
|
31584
31597
|
});
|
|
31585
31598
|
}
|
|
@@ -31610,33 +31623,38 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31610
31623
|
}), /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
31611
31624
|
title: t('Add comment'),
|
|
31612
31625
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31613
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button,
|
|
31626
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
31614
31627
|
type: "link",
|
|
31615
|
-
disabled: !
|
|
31616
|
-
|
|
31617
|
-
|
|
31618
|
-
|
|
31619
|
-
|
|
31620
|
-
|
|
31628
|
+
disabled: !input.meta?.comment,
|
|
31629
|
+
...(!isShown ? {
|
|
31630
|
+
className: 'default p-0'
|
|
31631
|
+
} : {
|
|
31632
|
+
className: 'p-0 primary'
|
|
31633
|
+
}),
|
|
31621
31634
|
onClick: onClickComment,
|
|
31622
31635
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
31623
31636
|
name: "AddComment",
|
|
31624
31637
|
width: 16,
|
|
31625
31638
|
height: 16
|
|
31626
31639
|
})
|
|
31627
|
-
})
|
|
31640
|
+
})
|
|
31628
31641
|
})
|
|
31629
31642
|
})]
|
|
31630
31643
|
}) : null]
|
|
31631
31644
|
}) : null
|
|
31632
31645
|
}),
|
|
31633
31646
|
children: isReview ? /*#__PURE__*/jsxRuntime.jsx(BasicInput, {
|
|
31634
|
-
data:
|
|
31635
|
-
|
|
31636
|
-
|
|
31637
|
-
|
|
31638
|
-
|
|
31639
|
-
|
|
31647
|
+
data: {
|
|
31648
|
+
...(values[formId] || {}),
|
|
31649
|
+
meta: {
|
|
31650
|
+
...(values?.meta || {}),
|
|
31651
|
+
inputs: {
|
|
31652
|
+
...(values?.meta?.inputs || {}),
|
|
31653
|
+
...((values?.meta?.inputs || {})[formId] || {})
|
|
31654
|
+
}
|
|
31655
|
+
}
|
|
31656
|
+
},
|
|
31657
|
+
linkingData: values?.linking || values?.parent?.linking,
|
|
31640
31658
|
name: input.dataId,
|
|
31641
31659
|
config: input,
|
|
31642
31660
|
t: t,
|
|
@@ -31648,12 +31666,13 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31648
31666
|
getToken: getToken,
|
|
31649
31667
|
app: app,
|
|
31650
31668
|
valueOnlyString: true
|
|
31651
|
-
}) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](
|
|
31669
|
+
}) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
|
|
31670
|
+
...inputData,
|
|
31652
31671
|
name: inputId,
|
|
31653
31672
|
maxWidth,
|
|
31654
31673
|
staticWidth,
|
|
31655
31674
|
fullWidth
|
|
31656
|
-
}
|
|
31675
|
+
}, {
|
|
31657
31676
|
form: MainForm,
|
|
31658
31677
|
forms: options,
|
|
31659
31678
|
allForms: plainForms,
|
|
@@ -31671,10 +31690,10 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31671
31690
|
staticWidth,
|
|
31672
31691
|
fullWidth
|
|
31673
31692
|
}) : console.log(input)
|
|
31674
|
-
})
|
|
31693
|
+
}), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31675
31694
|
className: "code",
|
|
31676
31695
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
31677
|
-
children:
|
|
31696
|
+
children: input.meta?.code
|
|
31678
31697
|
})
|
|
31679
31698
|
}) : null]
|
|
31680
31699
|
}), maxRule ? ['imageUpload', 'videoUpload', 'upload'].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -31694,16 +31713,16 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31694
31713
|
className: "max-char-span",
|
|
31695
31714
|
children: t('max-char', {
|
|
31696
31715
|
chars: maxRule,
|
|
31697
|
-
filled:
|
|
31716
|
+
filled: inputData?.value?.length || 0
|
|
31698
31717
|
})
|
|
31699
31718
|
})
|
|
31700
|
-
}) : null,
|
|
31719
|
+
}) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
31701
31720
|
className: "input-content",
|
|
31702
31721
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
31703
31722
|
className: "comment-textarea",
|
|
31704
|
-
initialValue:
|
|
31723
|
+
initialValue: inputMeta?.comment || '',
|
|
31705
31724
|
hidden: !isShown,
|
|
31706
|
-
name:
|
|
31725
|
+
name: `${formId}-${inputId}-comment`,
|
|
31707
31726
|
required: requiredComment,
|
|
31708
31727
|
rules: requiredComment ? [{
|
|
31709
31728
|
required: true,
|
|
@@ -31720,35 +31739,38 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31720
31739
|
onConfirm: () => {
|
|
31721
31740
|
setIsShown(false);
|
|
31722
31741
|
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] || {};
|
|
31742
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31725
31743
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31726
31744
|
if (isAjaxSubGroup) {
|
|
31727
|
-
var _defaultData$meta13, _defaultData$meta14;
|
|
31728
31745
|
changeInputMeta({
|
|
31729
31746
|
key: formId,
|
|
31730
31747
|
type: input.type,
|
|
31731
31748
|
otherValues: {
|
|
31732
|
-
[formId]:
|
|
31749
|
+
[formId]: {
|
|
31750
|
+
..._defaultData,
|
|
31733
31751
|
meta: {
|
|
31734
|
-
inputs:
|
|
31735
|
-
|
|
31752
|
+
inputs: {
|
|
31753
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31754
|
+
[inputId]: {
|
|
31755
|
+
...((_defaultData?.meta?.inputs || {})[inputId] || {}),
|
|
31736
31756
|
comment: null
|
|
31737
|
-
}
|
|
31738
|
-
}
|
|
31757
|
+
}
|
|
31758
|
+
}
|
|
31739
31759
|
}
|
|
31740
|
-
}
|
|
31760
|
+
}
|
|
31741
31761
|
}
|
|
31742
31762
|
});
|
|
31743
31763
|
} else {
|
|
31744
31764
|
changeInputMeta({
|
|
31745
31765
|
key: formId,
|
|
31746
31766
|
type: input.type,
|
|
31747
|
-
value:
|
|
31748
|
-
|
|
31767
|
+
value: {
|
|
31768
|
+
..._defaultMeta,
|
|
31769
|
+
[inputId]: {
|
|
31770
|
+
...(_defaultMeta[inputId] || {}),
|
|
31749
31771
|
comment: null
|
|
31750
|
-
}
|
|
31751
|
-
}
|
|
31772
|
+
}
|
|
31773
|
+
}
|
|
31752
31774
|
});
|
|
31753
31775
|
}
|
|
31754
31776
|
} else {
|
|
@@ -31763,7 +31785,7 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31763
31785
|
},
|
|
31764
31786
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
31765
31787
|
type: "link",
|
|
31766
|
-
disabled: !
|
|
31788
|
+
disabled: !input.meta?.comment,
|
|
31767
31789
|
className: "p-0",
|
|
31768
31790
|
children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
|
|
31769
31791
|
width: 16,
|
|
@@ -31775,41 +31797,44 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31775
31797
|
children: inputTypeComponent$1.comment(inputData, {
|
|
31776
31798
|
form: MainForm,
|
|
31777
31799
|
forms: options,
|
|
31778
|
-
value:
|
|
31800
|
+
value: inputMeta?.comment || '',
|
|
31779
31801
|
maxWidth,
|
|
31780
31802
|
staticWidth,
|
|
31781
31803
|
fullWidth,
|
|
31782
31804
|
onChange: val => {
|
|
31783
31805
|
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] || {};
|
|
31806
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31786
31807
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31787
31808
|
if (isAjaxSubGroup) {
|
|
31788
|
-
var _defaultData$meta15, _defaultData$meta16;
|
|
31789
31809
|
changeInputMeta({
|
|
31790
31810
|
key: formId,
|
|
31791
31811
|
type: input.type,
|
|
31792
31812
|
otherValues: {
|
|
31793
|
-
[formId]:
|
|
31813
|
+
[formId]: {
|
|
31814
|
+
..._defaultData,
|
|
31794
31815
|
meta: {
|
|
31795
|
-
inputs:
|
|
31796
|
-
|
|
31816
|
+
inputs: {
|
|
31817
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31818
|
+
[inputId]: {
|
|
31819
|
+
...((_defaultData?.meta?.inputs || {})[inputId] || {}),
|
|
31797
31820
|
comment: val
|
|
31798
|
-
}
|
|
31799
|
-
}
|
|
31821
|
+
}
|
|
31822
|
+
}
|
|
31800
31823
|
}
|
|
31801
|
-
}
|
|
31824
|
+
}
|
|
31802
31825
|
}
|
|
31803
31826
|
});
|
|
31804
31827
|
} else {
|
|
31805
31828
|
changeInputMeta({
|
|
31806
31829
|
key: formId,
|
|
31807
31830
|
type: input.type,
|
|
31808
|
-
value:
|
|
31809
|
-
|
|
31831
|
+
value: {
|
|
31832
|
+
..._defaultMeta,
|
|
31833
|
+
[inputId]: {
|
|
31834
|
+
...(_defaultMeta[inputId] || {}),
|
|
31810
31835
|
comment: val
|
|
31811
|
-
}
|
|
31812
|
-
}
|
|
31836
|
+
}
|
|
31837
|
+
}
|
|
31813
31838
|
});
|
|
31814
31839
|
}
|
|
31815
31840
|
} else {
|
|
@@ -31830,16 +31855,16 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31830
31855
|
className: "max-char-span",
|
|
31831
31856
|
children: t('max-char', {
|
|
31832
31857
|
chars: MAX_COMMENTS_LENGTH,
|
|
31833
|
-
filled:
|
|
31858
|
+
filled: inputMeta?.comment?.length || 0
|
|
31834
31859
|
})
|
|
31835
31860
|
})]
|
|
31836
|
-
}) : null, lastReview
|
|
31861
|
+
}) : null, lastReview?.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31837
31862
|
className: "input-content",
|
|
31838
31863
|
children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
31839
31864
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
31840
31865
|
className: "comment-textarea",
|
|
31841
|
-
initialValue:
|
|
31842
|
-
name:
|
|
31866
|
+
initialValue: lastReview?.comment || '',
|
|
31867
|
+
name: `${formId}-${inputId}-reviewErrorComment`,
|
|
31843
31868
|
label: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31844
31869
|
className: "flex w-100",
|
|
31845
31870
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -31850,71 +31875,78 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31850
31875
|
children: inputTypeComponent$1.comment(inputData, {
|
|
31851
31876
|
form: MainForm,
|
|
31852
31877
|
forms: options,
|
|
31853
|
-
value:
|
|
31878
|
+
value: lastReview?.comment || '',
|
|
31854
31879
|
maxWidth,
|
|
31855
31880
|
staticWidth,
|
|
31856
31881
|
fullWidth,
|
|
31857
31882
|
onChange: val => {
|
|
31858
31883
|
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] || {};
|
|
31884
|
+
const _defaultMeta = (values?.meta?.inputs || {})[formId] || {};
|
|
31861
31885
|
const _defaultData = MainForm.getFieldValue(formId);
|
|
31862
31886
|
if (isAjaxSubGroup) {
|
|
31863
|
-
var _defaultData$meta17, _defaultData$meta18, _defaultData$meta19;
|
|
31864
31887
|
changeInputMeta({
|
|
31865
31888
|
key: formId,
|
|
31866
31889
|
type: input.type,
|
|
31867
31890
|
otherValues: {
|
|
31868
|
-
[formId]:
|
|
31891
|
+
[formId]: {
|
|
31892
|
+
..._defaultData,
|
|
31869
31893
|
meta: {
|
|
31870
|
-
inputs:
|
|
31871
|
-
|
|
31872
|
-
|
|
31894
|
+
inputs: {
|
|
31895
|
+
...(_defaultData?.meta?.inputs || {}),
|
|
31896
|
+
[inputId]: {
|
|
31897
|
+
...((_defaultData?.meta?.inputs || {})[inputId] || {}),
|
|
31898
|
+
reviews: (((_defaultData?.meta?.inputs || {})[inputId] || {}).reviews || []).map(v => {
|
|
31873
31899
|
if (v.createdAt === lastReview.createdAt) {
|
|
31874
|
-
return
|
|
31900
|
+
return {
|
|
31901
|
+
...v,
|
|
31875
31902
|
comment: val
|
|
31876
|
-
}
|
|
31903
|
+
};
|
|
31877
31904
|
}
|
|
31878
31905
|
return v;
|
|
31879
31906
|
})
|
|
31880
|
-
}
|
|
31881
|
-
}
|
|
31907
|
+
}
|
|
31908
|
+
}
|
|
31882
31909
|
}
|
|
31883
|
-
}
|
|
31910
|
+
}
|
|
31884
31911
|
}
|
|
31885
31912
|
});
|
|
31886
31913
|
} else {
|
|
31887
31914
|
changeInputMeta({
|
|
31888
31915
|
key: formId,
|
|
31889
31916
|
type: input.type,
|
|
31890
|
-
value:
|
|
31891
|
-
|
|
31917
|
+
value: {
|
|
31918
|
+
..._defaultMeta,
|
|
31919
|
+
[inputId]: {
|
|
31920
|
+
...(_defaultMeta[inputId] || {}),
|
|
31892
31921
|
reviews: ((_defaultMeta[inputId] || {}).reviews || []).map(v => {
|
|
31893
31922
|
if (v.createdAt === lastReview.createdAt) {
|
|
31894
|
-
return
|
|
31923
|
+
return {
|
|
31924
|
+
...v,
|
|
31895
31925
|
comment: val
|
|
31896
|
-
}
|
|
31926
|
+
};
|
|
31897
31927
|
}
|
|
31898
31928
|
return v;
|
|
31899
31929
|
})
|
|
31900
|
-
}
|
|
31901
|
-
}
|
|
31930
|
+
}
|
|
31931
|
+
}
|
|
31902
31932
|
});
|
|
31903
31933
|
}
|
|
31904
31934
|
} else {
|
|
31905
31935
|
changeInputMeta({
|
|
31906
31936
|
key: inputId,
|
|
31907
31937
|
type: input.type,
|
|
31908
|
-
value:
|
|
31909
|
-
|
|
31938
|
+
value: {
|
|
31939
|
+
...inputMeta,
|
|
31940
|
+
reviews: (inputMeta?.reviews || []).map(v => {
|
|
31910
31941
|
if (v.createdAt === lastReview.createdAt) {
|
|
31911
|
-
return
|
|
31942
|
+
return {
|
|
31943
|
+
...v,
|
|
31912
31944
|
comment: val
|
|
31913
|
-
}
|
|
31945
|
+
};
|
|
31914
31946
|
}
|
|
31915
31947
|
return v;
|
|
31916
31948
|
})
|
|
31917
|
-
}
|
|
31949
|
+
}
|
|
31918
31950
|
});
|
|
31919
31951
|
}
|
|
31920
31952
|
},
|
|
@@ -31926,7 +31958,7 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31926
31958
|
className: "max-char-span",
|
|
31927
31959
|
children: t('max-char', {
|
|
31928
31960
|
chars: MAX_COMMENTS_LENGTH,
|
|
31929
|
-
filled:
|
|
31961
|
+
filled: lastReview.comment?.length || 0
|
|
31930
31962
|
})
|
|
31931
31963
|
})]
|
|
31932
31964
|
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -31947,7 +31979,7 @@ const GroupContentFormItem = _ref4 => {
|
|
|
31947
31979
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31948
31980
|
className: "flex flex-column justify-center mr-1",
|
|
31949
31981
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
31950
|
-
children:
|
|
31982
|
+
children: lastReview?.reviewer?.firstName + ' ' + lastReview?.reviewer?.lastName + ' - ' + moment__default["default"](lastReview.createdAt).format('DD MMM YYYY')
|
|
31951
31983
|
})
|
|
31952
31984
|
})]
|
|
31953
31985
|
})]
|
|
@@ -35920,7 +35952,7 @@ const beforeUpload = allowedExtensions => file => {
|
|
|
35920
35952
|
};
|
|
35921
35953
|
const allowedImageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.avif', '.bmp', '.tiff', '.tif', '.heif', '.heic', '.svg', '.ico'];
|
|
35922
35954
|
|
|
35923
|
-
const _excluded$
|
|
35955
|
+
const _excluded$g = ["placeholder"],
|
|
35924
35956
|
_excluded2$1 = ["label", "description", "excludeFromEdit", "showFormIf", "icon", "position", "template", "formClass"];
|
|
35925
35957
|
dayjs__default["default"].extend(utc);
|
|
35926
35958
|
dayjs__default["default"].extend(timezone);
|
|
@@ -36886,7 +36918,7 @@ const inputTypeComponent$1 = {
|
|
|
36886
36918
|
},
|
|
36887
36919
|
commentHint
|
|
36888
36920
|
} = _ref19,
|
|
36889
|
-
props = _objectWithoutProperties(_ref19.props, _excluded$
|
|
36921
|
+
props = _objectWithoutProperties(_ref19.props, _excluded$g);
|
|
36890
36922
|
let {
|
|
36891
36923
|
onChange,
|
|
36892
36924
|
value,
|
|
@@ -39592,7 +39624,7 @@ function AjaxSelect(props) {
|
|
|
39592
39624
|
}, props));
|
|
39593
39625
|
}
|
|
39594
39626
|
|
|
39595
|
-
|
|
39627
|
+
const _excluded$f = ["placeholder"];
|
|
39596
39628
|
const propHasValue = val => {
|
|
39597
39629
|
if (Array.isArray(val)) {
|
|
39598
39630
|
return val.length > 0 ? true : false;
|
|
@@ -39610,14 +39642,14 @@ const checkCondition = (condition, repeatValues, formsValue) => {
|
|
|
39610
39642
|
return isShown;
|
|
39611
39643
|
};
|
|
39612
39644
|
function showHideInput(input, formsValue, repeatIndex, repeatValues, setValues, ref) {
|
|
39613
|
-
|
|
39645
|
+
var _input$meta;
|
|
39646
|
+
if ((input === null || input === void 0 || (_input$meta = input.meta) === null || _input$meta === void 0 ? void 0 : _input$meta.hidden) === true) {
|
|
39647
|
+
var _input$meta2;
|
|
39614
39648
|
// Set default value for hidden fields
|
|
39615
|
-
if (input
|
|
39649
|
+
if ((input === null || input === void 0 || (_input$meta2 = input.meta) === null || _input$meta2 === void 0 ? void 0 : _input$meta2.defaultValue) !== undefined && !propHasValue(formsValue[ref])) {
|
|
39616
39650
|
formsValue[ref] = input.meta.defaultValue;
|
|
39617
39651
|
if (setValues && typeof setValues === 'function') {
|
|
39618
|
-
setValues({
|
|
39619
|
-
...formsValue
|
|
39620
|
-
});
|
|
39652
|
+
setValues(_objectSpread2({}, formsValue));
|
|
39621
39653
|
}
|
|
39622
39654
|
}
|
|
39623
39655
|
return false;
|
|
@@ -39676,35 +39708,35 @@ function getInputHeadLines(type, i, input, values) {
|
|
|
39676
39708
|
switch (type) {
|
|
39677
39709
|
case "h2":
|
|
39678
39710
|
return /*#__PURE__*/jsxRuntime.jsx("h2", {
|
|
39679
|
-
className:
|
|
39711
|
+
className: "title-semibold-2 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
|
|
39680
39712
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
39681
39713
|
children: getInputLabel(input, values)
|
|
39682
39714
|
})
|
|
39683
39715
|
});
|
|
39684
39716
|
case "h3":
|
|
39685
39717
|
return /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
39686
|
-
className:
|
|
39718
|
+
className: "title-semibold-3 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
|
|
39687
39719
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
39688
39720
|
children: getInputLabel(input, values)
|
|
39689
39721
|
})
|
|
39690
39722
|
});
|
|
39691
39723
|
case "h4":
|
|
39692
39724
|
return /*#__PURE__*/jsxRuntime.jsx("h4", {
|
|
39693
|
-
className:
|
|
39725
|
+
className: "title-semibold-4 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
|
|
39694
39726
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
39695
39727
|
children: getInputLabel(input, values)
|
|
39696
39728
|
})
|
|
39697
39729
|
});
|
|
39698
39730
|
case "h5":
|
|
39699
39731
|
return /*#__PURE__*/jsxRuntime.jsx("h5", {
|
|
39700
|
-
className:
|
|
39732
|
+
className: "title-semibold-5 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
|
|
39701
39733
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
39702
39734
|
children: getInputLabel(input, values)
|
|
39703
39735
|
})
|
|
39704
39736
|
});
|
|
39705
39737
|
case "h6":
|
|
39706
39738
|
return /*#__PURE__*/jsxRuntime.jsx("h6", {
|
|
39707
|
-
className:
|
|
39739
|
+
className: "title-semibold-6 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
|
|
39708
39740
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
39709
39741
|
children: getInputLabel(input, values)
|
|
39710
39742
|
})
|
|
@@ -39713,7 +39745,9 @@ function getInputHeadLines(type, i, input, values) {
|
|
|
39713
39745
|
return null;
|
|
39714
39746
|
}
|
|
39715
39747
|
}
|
|
39716
|
-
function getInputLabel(input
|
|
39748
|
+
function getInputLabel(input) {
|
|
39749
|
+
let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
39750
|
+
let asText = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
39717
39751
|
if (typeof input.label === "object") {
|
|
39718
39752
|
const validations = Object.keys(input.label);
|
|
39719
39753
|
const key = validations.find(v => {
|
|
@@ -39771,7 +39805,8 @@ function getInputLabel(input, formsValue = {}, asText = false) {
|
|
|
39771
39805
|
}) : ReactHtmlParser__default["default"](input.label);
|
|
39772
39806
|
}
|
|
39773
39807
|
}
|
|
39774
|
-
function getSelectOptions$1(option
|
|
39808
|
+
function getSelectOptions$1(option) {
|
|
39809
|
+
let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
39775
39810
|
if (typeof option.label === "object") {
|
|
39776
39811
|
const validations = Object.keys(option.label);
|
|
39777
39812
|
const key = validations.find(v => {
|
|
@@ -39795,7 +39830,9 @@ function getSectionLabel(labels, values) {
|
|
|
39795
39830
|
}
|
|
39796
39831
|
return labels;
|
|
39797
39832
|
}
|
|
39798
|
-
function getSubtitles(subtitles, position
|
|
39833
|
+
function getSubtitles(subtitles, position) {
|
|
39834
|
+
let formsValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
39835
|
+
let repeatValues = arguments.length > 4 ? arguments[4] : undefined;
|
|
39799
39836
|
let subtitle = subtitles && subtitles[position];
|
|
39800
39837
|
if (subtitle && typeof subtitle === "object") {
|
|
39801
39838
|
let newSubtitle = subtitle.default || "";
|
|
@@ -39839,14 +39876,12 @@ function getSubtitles(subtitles, position, formsValue = {}, repeatIndex, repeatV
|
|
|
39839
39876
|
function getFormTitles(titles, key, position) {
|
|
39840
39877
|
let tilte = titles && titles[key];
|
|
39841
39878
|
return tilte ? /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
39842
|
-
className:
|
|
39879
|
+
className: "title-semibold-3 mb0 ".concat(position ? "mt-3" : ""),
|
|
39843
39880
|
children: tilte
|
|
39844
39881
|
}) : null;
|
|
39845
39882
|
}
|
|
39846
39883
|
const updateFormValues = (repeatIndex, repeatValues, inputName, value, formsValue, name, mainForm) => {
|
|
39847
|
-
formsValue = Object.assign(formsValue, {
|
|
39848
|
-
...mainForm.getFieldsValue(true)
|
|
39849
|
-
});
|
|
39884
|
+
formsValue = Object.assign(formsValue, _objectSpread2({}, mainForm.getFieldsValue(true)));
|
|
39850
39885
|
if (typeof repeatIndex === "number" && repeatValues) {
|
|
39851
39886
|
if (!repeatValues[inputName] || !___default["default"].isEqual(repeatValues[inputName], value)) {
|
|
39852
39887
|
repeatValues[inputName] = value;
|
|
@@ -39880,48 +39915,52 @@ const updateFormValues = (repeatIndex, repeatValues, inputName, value, formsValu
|
|
|
39880
39915
|
}
|
|
39881
39916
|
};
|
|
39882
39917
|
const inputTypeComponent = {
|
|
39883
|
-
text: ({
|
|
39884
|
-
|
|
39885
|
-
|
|
39886
|
-
|
|
39887
|
-
|
|
39888
|
-
|
|
39889
|
-
|
|
39918
|
+
text: (_ref, _ref2) => {
|
|
39919
|
+
let {
|
|
39920
|
+
props,
|
|
39921
|
+
rules
|
|
39922
|
+
} = _ref;
|
|
39923
|
+
let {
|
|
39924
|
+
inputMeta = {},
|
|
39925
|
+
t
|
|
39926
|
+
} = _ref2;
|
|
39890
39927
|
const maxRule = rules.find(r => r.max);
|
|
39891
39928
|
const maxProps = {};
|
|
39892
39929
|
if (maxRule) {
|
|
39893
39930
|
maxProps.maxLength = maxRule.max;
|
|
39894
39931
|
}
|
|
39895
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
39896
|
-
size: "medium"
|
|
39897
|
-
|
|
39932
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
|
|
39933
|
+
size: "medium"
|
|
39934
|
+
}, maxProps), {}, {
|
|
39898
39935
|
allowClear: true,
|
|
39899
39936
|
autoComplete: "new-password",
|
|
39900
|
-
type: "text"
|
|
39901
|
-
|
|
39937
|
+
type: "text"
|
|
39938
|
+
}, props), {}, {
|
|
39902
39939
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
39903
39940
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
39904
|
-
});
|
|
39941
|
+
}));
|
|
39905
39942
|
},
|
|
39906
|
-
drawTerritory: ({
|
|
39907
|
-
|
|
39908
|
-
|
|
39909
|
-
|
|
39910
|
-
|
|
39911
|
-
|
|
39912
|
-
|
|
39913
|
-
|
|
39914
|
-
|
|
39943
|
+
drawTerritory: (_ref3, _ref4) => {
|
|
39944
|
+
let {
|
|
39945
|
+
formsValue,
|
|
39946
|
+
name,
|
|
39947
|
+
addressData,
|
|
39948
|
+
onValuesChange
|
|
39949
|
+
} = _ref3;
|
|
39950
|
+
let {
|
|
39951
|
+
setFormValues,
|
|
39952
|
+
form
|
|
39953
|
+
} = _ref4;
|
|
39915
39954
|
let search = formsValue.country;
|
|
39916
39955
|
if (addressData && addressData.address && Object.keys(addressData.address).length > 0) {
|
|
39917
39956
|
if (addressData.address.country) {
|
|
39918
39957
|
search = addressData.address.country;
|
|
39919
39958
|
}
|
|
39920
39959
|
if (addressData.address.level1) {
|
|
39921
|
-
search =
|
|
39960
|
+
search = "".concat(addressData.address.level1, ", ").concat(addressData.address.country);
|
|
39922
39961
|
}
|
|
39923
39962
|
if (addressData.address.level2) {
|
|
39924
|
-
search =
|
|
39963
|
+
search = "".concat(addressData.address.level2, ", ").concat(addressData.address.level1, ", ").concat(addressData.address.country);
|
|
39925
39964
|
}
|
|
39926
39965
|
} else {
|
|
39927
39966
|
const country = countriesList.countries[formsValue.country] || {};
|
|
@@ -39929,10 +39968,10 @@ const inputTypeComponent = {
|
|
|
39929
39968
|
search = country.name;
|
|
39930
39969
|
}
|
|
39931
39970
|
if (formsValue.administrativeLevel1Name) {
|
|
39932
|
-
search =
|
|
39971
|
+
search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
|
|
39933
39972
|
}
|
|
39934
39973
|
if (formsValue.administrativeLevel2Name) {
|
|
39935
|
-
search =
|
|
39974
|
+
search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
|
|
39936
39975
|
}
|
|
39937
39976
|
}
|
|
39938
39977
|
console.log("search", {
|
|
@@ -39952,10 +39991,9 @@ const inputTypeComponent = {
|
|
|
39952
39991
|
const allFormValues = form && typeof form.getFieldsValue === 'function' ? form.getFieldsValue(true) : formsValue;
|
|
39953
39992
|
|
|
39954
39993
|
// Create the updated values
|
|
39955
|
-
const updatedValues = {
|
|
39956
|
-
...allFormValues,
|
|
39994
|
+
const updatedValues = _objectSpread2(_objectSpread2({}, allFormValues), {}, {
|
|
39957
39995
|
[name]: val
|
|
39958
|
-
};
|
|
39996
|
+
});
|
|
39959
39997
|
|
|
39960
39998
|
// Call onValuesChange with the change and all values
|
|
39961
39999
|
if (typeof onValuesChange === 'function') {
|
|
@@ -39970,39 +40008,44 @@ const inputTypeComponent = {
|
|
|
39970
40008
|
searchValue: search
|
|
39971
40009
|
});
|
|
39972
40010
|
},
|
|
39973
|
-
link: ({
|
|
39974
|
-
|
|
39975
|
-
|
|
39976
|
-
|
|
39977
|
-
|
|
39978
|
-
|
|
39979
|
-
|
|
40011
|
+
link: (_ref5, _ref6) => {
|
|
40012
|
+
let {
|
|
40013
|
+
props,
|
|
40014
|
+
rules
|
|
40015
|
+
} = _ref5;
|
|
40016
|
+
let {
|
|
40017
|
+
inputMeta = {},
|
|
40018
|
+
t
|
|
40019
|
+
} = _ref6;
|
|
39980
40020
|
const maxRule = rules.find(r => r.max);
|
|
39981
40021
|
const maxProps = {};
|
|
39982
40022
|
if (maxRule) {
|
|
39983
40023
|
maxProps.maxLength = maxRule.max;
|
|
39984
40024
|
}
|
|
39985
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
39986
|
-
size: "medium"
|
|
39987
|
-
|
|
40025
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
|
|
40026
|
+
size: "medium"
|
|
40027
|
+
}, maxProps), {}, {
|
|
39988
40028
|
allowClear: true,
|
|
39989
40029
|
autoComplete: "new-password",
|
|
39990
|
-
type: "text"
|
|
39991
|
-
|
|
40030
|
+
type: "text"
|
|
40031
|
+
}, props), {}, {
|
|
39992
40032
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
39993
40033
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
39994
|
-
});
|
|
40034
|
+
}));
|
|
39995
40035
|
},
|
|
39996
|
-
number: ({
|
|
39997
|
-
|
|
39998
|
-
|
|
39999
|
-
|
|
40000
|
-
|
|
40001
|
-
|
|
40002
|
-
|
|
40003
|
-
|
|
40036
|
+
number: (_ref7, _ref8) => {
|
|
40037
|
+
var _input$meta3;
|
|
40038
|
+
let {
|
|
40039
|
+
props,
|
|
40040
|
+
rules,
|
|
40041
|
+
input
|
|
40042
|
+
} = _ref7;
|
|
40043
|
+
let {
|
|
40044
|
+
inputMeta = {},
|
|
40045
|
+
t
|
|
40046
|
+
} = _ref8;
|
|
40004
40047
|
const maxRule = rules.find(r => r.max);
|
|
40005
|
-
const integerRule = !input
|
|
40048
|
+
const integerRule = !(input !== null && input !== void 0 && (_input$meta3 = input.meta) !== null && _input$meta3 !== void 0 && _input$meta3.isDecimal);
|
|
40006
40049
|
const parser = value => {
|
|
40007
40050
|
if (!value) {
|
|
40008
40051
|
return "";
|
|
@@ -40013,50 +40056,53 @@ const inputTypeComponent = {
|
|
|
40013
40056
|
return value.replace(/\$\s?|(,*)/g, "");
|
|
40014
40057
|
};
|
|
40015
40058
|
if (maxRule) {
|
|
40016
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
40059
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
|
|
40017
40060
|
allowClear: true,
|
|
40018
|
-
autoComplete: "new-password"
|
|
40019
|
-
|
|
40061
|
+
autoComplete: "new-password"
|
|
40062
|
+
}, props), {}, {
|
|
40020
40063
|
type: "number",
|
|
40021
40064
|
min: 0,
|
|
40022
40065
|
max: maxRule.max,
|
|
40023
40066
|
parser: parser
|
|
40024
|
-
});
|
|
40067
|
+
}));
|
|
40025
40068
|
}
|
|
40026
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
40069
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
|
|
40027
40070
|
allowClear: true,
|
|
40028
|
-
autoComplete: "new-password"
|
|
40029
|
-
|
|
40071
|
+
autoComplete: "new-password"
|
|
40072
|
+
}, props), {}, {
|
|
40030
40073
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
40031
40074
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
|
|
40032
40075
|
min: 0,
|
|
40033
40076
|
formatter: value => numberWithCommas$1(value),
|
|
40034
40077
|
parser: parser
|
|
40035
|
-
});
|
|
40078
|
+
}));
|
|
40036
40079
|
},
|
|
40037
|
-
select: ({
|
|
40038
|
-
|
|
40039
|
-
|
|
40040
|
-
|
|
40041
|
-
|
|
40042
|
-
|
|
40043
|
-
|
|
40044
|
-
|
|
40045
|
-
|
|
40046
|
-
|
|
40047
|
-
|
|
40048
|
-
|
|
40049
|
-
|
|
40050
|
-
|
|
40051
|
-
|
|
40052
|
-
|
|
40053
|
-
|
|
40054
|
-
|
|
40055
|
-
|
|
40056
|
-
|
|
40057
|
-
|
|
40058
|
-
|
|
40059
|
-
|
|
40080
|
+
select: (_ref9, _ref10) => {
|
|
40081
|
+
var _input$meta4;
|
|
40082
|
+
let {
|
|
40083
|
+
value,
|
|
40084
|
+
options,
|
|
40085
|
+
optionGroup,
|
|
40086
|
+
props,
|
|
40087
|
+
formsValue,
|
|
40088
|
+
optionsFilter,
|
|
40089
|
+
filterCond,
|
|
40090
|
+
repeatValues,
|
|
40091
|
+
repeatIndex,
|
|
40092
|
+
name,
|
|
40093
|
+
inputName,
|
|
40094
|
+
address,
|
|
40095
|
+
addressData,
|
|
40096
|
+
input
|
|
40097
|
+
} = _ref9;
|
|
40098
|
+
let {
|
|
40099
|
+
forms,
|
|
40100
|
+
form,
|
|
40101
|
+
setAddress,
|
|
40102
|
+
inputMeta = {},
|
|
40103
|
+
t,
|
|
40104
|
+
changeInputMeta
|
|
40105
|
+
} = _ref10;
|
|
40060
40106
|
let opts;
|
|
40061
40107
|
if (typeof options === "string") {
|
|
40062
40108
|
const [formName, key] = options.split(".");
|
|
@@ -40112,18 +40158,19 @@ const inputTypeComponent = {
|
|
|
40112
40158
|
}
|
|
40113
40159
|
opts = groupOptions;
|
|
40114
40160
|
}
|
|
40115
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
40161
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
|
|
40116
40162
|
autoComplete: "new-password",
|
|
40117
40163
|
allowClear: true,
|
|
40118
40164
|
showSearch: true,
|
|
40119
|
-
defaultValue: input
|
|
40165
|
+
defaultValue: input === null || input === void 0 || (_input$meta4 = input.meta) === null || _input$meta4 === void 0 ? void 0 : _input$meta4.defaultValue,
|
|
40120
40166
|
filterOption: filterSelectOptions,
|
|
40121
|
-
optionFilterProp: "children"
|
|
40122
|
-
|
|
40167
|
+
optionFilterProp: "children"
|
|
40168
|
+
}, props), {}, {
|
|
40123
40169
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
40124
40170
|
placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp$1(props.placeholder, formsValue) || t("Select one option"),
|
|
40125
40171
|
onChange: (val, selectedValue) => {
|
|
40126
|
-
|
|
40172
|
+
var _input$meta5;
|
|
40173
|
+
if (typeof (input === null || input === void 0 || (_input$meta5 = input.meta) === null || _input$meta5 === void 0 ? void 0 : _input$meta5.onChange) === "string") {
|
|
40127
40174
|
const [value, otherKey, otherVal] = input.meta.onChange.split(".");
|
|
40128
40175
|
if (val === value) {
|
|
40129
40176
|
changeInputMeta({
|
|
@@ -40137,9 +40184,7 @@ const inputTypeComponent = {
|
|
|
40137
40184
|
}
|
|
40138
40185
|
if (address && selectedValue) {
|
|
40139
40186
|
dot__default["default"].str(address, selectedValue.children, addressData);
|
|
40140
|
-
setAddress({
|
|
40141
|
-
...addressData
|
|
40142
|
-
});
|
|
40187
|
+
setAddress(_objectSpread2({}, addressData));
|
|
40143
40188
|
}
|
|
40144
40189
|
if (props.onChange) {
|
|
40145
40190
|
props.onChange(val);
|
|
@@ -40151,33 +40196,35 @@ const inputTypeComponent = {
|
|
|
40151
40196
|
value: og.value,
|
|
40152
40197
|
disabled: og.disabled,
|
|
40153
40198
|
children: og.label
|
|
40154
|
-
},
|
|
40199
|
+
}, "".concat(i).concat(j)))
|
|
40155
40200
|
}, i) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
40156
40201
|
value: option.value,
|
|
40157
40202
|
disabled: option.disabled,
|
|
40158
40203
|
children: option.label
|
|
40159
40204
|
}, i))
|
|
40160
|
-
});
|
|
40205
|
+
}));
|
|
40161
40206
|
},
|
|
40162
|
-
multiselect: ({
|
|
40163
|
-
|
|
40164
|
-
|
|
40165
|
-
|
|
40166
|
-
|
|
40167
|
-
|
|
40168
|
-
|
|
40169
|
-
|
|
40170
|
-
|
|
40171
|
-
|
|
40172
|
-
|
|
40173
|
-
|
|
40174
|
-
|
|
40175
|
-
|
|
40176
|
-
|
|
40177
|
-
|
|
40178
|
-
|
|
40179
|
-
|
|
40180
|
-
|
|
40207
|
+
multiselect: (_ref11, _ref12) => {
|
|
40208
|
+
let {
|
|
40209
|
+
value,
|
|
40210
|
+
options,
|
|
40211
|
+
optionGroup,
|
|
40212
|
+
optionsFilter,
|
|
40213
|
+
filterCond,
|
|
40214
|
+
props,
|
|
40215
|
+
formsValue,
|
|
40216
|
+
repeatValues,
|
|
40217
|
+
repeatIndex,
|
|
40218
|
+
inputName,
|
|
40219
|
+
name,
|
|
40220
|
+
tags
|
|
40221
|
+
} = _ref11;
|
|
40222
|
+
let {
|
|
40223
|
+
forms,
|
|
40224
|
+
form,
|
|
40225
|
+
inputMeta = {},
|
|
40226
|
+
t
|
|
40227
|
+
} = _ref12;
|
|
40181
40228
|
let opts;
|
|
40182
40229
|
if (typeof options === "string") {
|
|
40183
40230
|
const [formName, key] = options.split(".");
|
|
@@ -40234,16 +40281,16 @@ const inputTypeComponent = {
|
|
|
40234
40281
|
}
|
|
40235
40282
|
opts = groupOptions;
|
|
40236
40283
|
}
|
|
40237
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
40284
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2(_objectSpread2({
|
|
40238
40285
|
allowClear: true,
|
|
40239
40286
|
autoComplete: "new-password",
|
|
40240
40287
|
mode: tags ? "tags" : "multiple",
|
|
40241
|
-
optionFilterProp: "children"
|
|
40242
|
-
|
|
40243
|
-
|
|
40244
|
-
|
|
40245
|
-
filterOption: filterSelectOptions
|
|
40246
|
-
|
|
40288
|
+
optionFilterProp: "children"
|
|
40289
|
+
}, tags ? {
|
|
40290
|
+
tokenSeparators: [",", "\n", "\t"]
|
|
40291
|
+
} : {}), {}, {
|
|
40292
|
+
filterOption: filterSelectOptions
|
|
40293
|
+
}, props), {}, {
|
|
40247
40294
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
40248
40295
|
placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp$1(props.placeholder, formsValue) || t("Select all relevant options"),
|
|
40249
40296
|
children: (opts || []).map((option, i) => option.items ? /*#__PURE__*/jsxRuntime.jsx(antd.Select.OptGroup, {
|
|
@@ -40252,42 +40299,42 @@ const inputTypeComponent = {
|
|
|
40252
40299
|
value: og.value,
|
|
40253
40300
|
disabled: og.disabled,
|
|
40254
40301
|
children: og.label
|
|
40255
|
-
},
|
|
40302
|
+
}, "".concat(i).concat(j)))
|
|
40256
40303
|
}, i) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
40257
40304
|
value: option.value,
|
|
40258
40305
|
disabled: option.disabled,
|
|
40259
40306
|
children: option.label
|
|
40260
40307
|
}, i))
|
|
40261
|
-
});
|
|
40308
|
+
}));
|
|
40262
40309
|
},
|
|
40263
|
-
date: ({
|
|
40264
|
-
|
|
40265
|
-
|
|
40266
|
-
|
|
40267
|
-
|
|
40268
|
-
|
|
40269
|
-
|
|
40270
|
-
|
|
40271
|
-
|
|
40272
|
-
|
|
40273
|
-
|
|
40274
|
-
|
|
40275
|
-
|
|
40310
|
+
date: (_ref13, _ref14) => {
|
|
40311
|
+
let {
|
|
40312
|
+
props,
|
|
40313
|
+
rules,
|
|
40314
|
+
repeatValues,
|
|
40315
|
+
formsValue,
|
|
40316
|
+
name
|
|
40317
|
+
} = _ref13;
|
|
40318
|
+
let {
|
|
40319
|
+
inputMeta,
|
|
40320
|
+
t,
|
|
40321
|
+
groupFormId,
|
|
40322
|
+
form,
|
|
40323
|
+
setFormValues
|
|
40324
|
+
} = _ref14;
|
|
40276
40325
|
const lng = localStorage.getItem("datastakeLng") || "en";
|
|
40277
40326
|
const maxRule = rules.find(r => r.max);
|
|
40278
40327
|
const handleDateChange = date => {
|
|
40279
40328
|
if (date) {
|
|
40280
40329
|
const localDate = dayjs__default["default"].utc(date);
|
|
40281
40330
|
if (groupFormId) {
|
|
40282
|
-
const _new = {
|
|
40283
|
-
...(formsValue[groupFormId] || {}),
|
|
40331
|
+
const _new = _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
|
|
40284
40332
|
[name]: localDate
|
|
40285
|
-
};
|
|
40333
|
+
});
|
|
40286
40334
|
form.setFieldValue(groupFormId, _new);
|
|
40287
|
-
setFormValues({
|
|
40288
|
-
...formsValue,
|
|
40335
|
+
setFormValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
40289
40336
|
[groupFormId]: _new
|
|
40290
|
-
});
|
|
40337
|
+
}));
|
|
40291
40338
|
} else {
|
|
40292
40339
|
form.setFieldValue(name, localDate);
|
|
40293
40340
|
}
|
|
@@ -40299,10 +40346,10 @@ const inputTypeComponent = {
|
|
|
40299
40346
|
checkForMax = checkCondition(maxRule.condition, repeatValues, formsValue);
|
|
40300
40347
|
}
|
|
40301
40348
|
if (checkForMax) {
|
|
40302
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
40349
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
|
|
40303
40350
|
allowClear: true,
|
|
40304
|
-
autoComplete: "new-password"
|
|
40305
|
-
|
|
40351
|
+
autoComplete: "new-password"
|
|
40352
|
+
}, props), {}, {
|
|
40306
40353
|
onChange: handleDateChange,
|
|
40307
40354
|
format: DATE_FORMATS,
|
|
40308
40355
|
locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
|
|
@@ -40311,31 +40358,33 @@ const inputTypeComponent = {
|
|
|
40311
40358
|
disabledDate: current => {
|
|
40312
40359
|
return current && current >= dayjs__default["default"]().endOf("day");
|
|
40313
40360
|
}
|
|
40314
|
-
});
|
|
40361
|
+
}));
|
|
40315
40362
|
}
|
|
40316
40363
|
}
|
|
40317
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
40364
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
|
|
40318
40365
|
allowClear: true,
|
|
40319
|
-
autoComplete: "new-password"
|
|
40320
|
-
|
|
40366
|
+
autoComplete: "new-password"
|
|
40367
|
+
}, props), {}, {
|
|
40321
40368
|
onChange: handleDateChange,
|
|
40322
40369
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Select date"),
|
|
40323
40370
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
40324
40371
|
format: DATE_FORMATS,
|
|
40325
40372
|
locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"]
|
|
40326
|
-
});
|
|
40373
|
+
}));
|
|
40327
40374
|
},
|
|
40328
|
-
comment: ({
|
|
40329
|
-
|
|
40330
|
-
|
|
40331
|
-
|
|
40332
|
-
|
|
40333
|
-
|
|
40334
|
-
|
|
40335
|
-
|
|
40336
|
-
|
|
40337
|
-
|
|
40338
|
-
|
|
40375
|
+
comment: (_ref15, _ref16) => {
|
|
40376
|
+
let {
|
|
40377
|
+
props: {
|
|
40378
|
+
placeholder
|
|
40379
|
+
},
|
|
40380
|
+
commentHint
|
|
40381
|
+
} = _ref15,
|
|
40382
|
+
props = _objectWithoutProperties(_ref15.props, _excluded$f);
|
|
40383
|
+
let {
|
|
40384
|
+
onChange,
|
|
40385
|
+
value
|
|
40386
|
+
} = _ref16;
|
|
40387
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
|
|
40339
40388
|
allowClear: true,
|
|
40340
40389
|
value: value,
|
|
40341
40390
|
onChange: e => onChange(e.target.value),
|
|
@@ -40345,56 +40394,60 @@ const inputTypeComponent = {
|
|
|
40345
40394
|
autoSize: {
|
|
40346
40395
|
minRows: 5,
|
|
40347
40396
|
maxRows: 5
|
|
40348
|
-
}
|
|
40349
|
-
|
|
40397
|
+
}
|
|
40398
|
+
}, props), {}, {
|
|
40350
40399
|
disabled: false
|
|
40351
|
-
});
|
|
40400
|
+
}));
|
|
40352
40401
|
},
|
|
40353
|
-
textarea: ({
|
|
40354
|
-
|
|
40355
|
-
|
|
40356
|
-
|
|
40357
|
-
|
|
40358
|
-
|
|
40359
|
-
|
|
40402
|
+
textarea: (_ref17, _ref18) => {
|
|
40403
|
+
let {
|
|
40404
|
+
props,
|
|
40405
|
+
rules
|
|
40406
|
+
} = _ref17;
|
|
40407
|
+
let {
|
|
40408
|
+
inputMeta,
|
|
40409
|
+
t
|
|
40410
|
+
} = _ref18;
|
|
40360
40411
|
const maxRule = rules.find(r => r.max);
|
|
40361
40412
|
let maxLength = MAX_TEXT_AREA_LENGTH;
|
|
40362
40413
|
if (maxRule) {
|
|
40363
40414
|
maxLength = maxRule.max;
|
|
40364
40415
|
}
|
|
40365
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
|
|
40416
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
|
|
40366
40417
|
allowClear: true,
|
|
40367
40418
|
autoComplete: "new-password",
|
|
40368
40419
|
maxLength: maxLength,
|
|
40369
40420
|
autoSize: {
|
|
40370
40421
|
minRows: 5,
|
|
40371
40422
|
maxRows: 5
|
|
40372
|
-
}
|
|
40373
|
-
|
|
40423
|
+
}
|
|
40424
|
+
}, props), {}, {
|
|
40374
40425
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
40375
40426
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
40376
|
-
});
|
|
40427
|
+
}));
|
|
40377
40428
|
},
|
|
40378
|
-
phoneNumber: ({
|
|
40379
|
-
|
|
40380
|
-
|
|
40381
|
-
|
|
40382
|
-
|
|
40383
|
-
|
|
40384
|
-
|
|
40385
|
-
|
|
40386
|
-
|
|
40387
|
-
|
|
40388
|
-
|
|
40389
|
-
|
|
40390
|
-
|
|
40429
|
+
phoneNumber: (_ref19, _ref20) => {
|
|
40430
|
+
let {
|
|
40431
|
+
name,
|
|
40432
|
+
inputName,
|
|
40433
|
+
props,
|
|
40434
|
+
value,
|
|
40435
|
+
repeatIndex,
|
|
40436
|
+
repeatValues,
|
|
40437
|
+
formsValue
|
|
40438
|
+
} = _ref19;
|
|
40439
|
+
let {
|
|
40440
|
+
setFormValues,
|
|
40441
|
+
t
|
|
40442
|
+
} = _ref20;
|
|
40443
|
+
return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, _objectSpread2(_objectSpread2({
|
|
40391
40444
|
t: t,
|
|
40392
40445
|
doChangeErrors: false,
|
|
40393
40446
|
allowClear: true,
|
|
40394
|
-
country: formsValue
|
|
40447
|
+
country: formsValue === null || formsValue === void 0 ? void 0 : formsValue.country,
|
|
40395
40448
|
formsValue: formsValue,
|
|
40396
|
-
initialValue: value
|
|
40397
|
-
|
|
40449
|
+
initialValue: value
|
|
40450
|
+
}, props), {}, {
|
|
40398
40451
|
onChange: val => {
|
|
40399
40452
|
if (repeatValues) {
|
|
40400
40453
|
const inputValues = Array.isArray(formsValue[name]) ? formsValue[name] || [] : [];
|
|
@@ -40410,24 +40463,25 @@ const inputTypeComponent = {
|
|
|
40410
40463
|
setFormValues(formsValue);
|
|
40411
40464
|
}
|
|
40412
40465
|
}
|
|
40413
|
-
});
|
|
40466
|
+
}));
|
|
40414
40467
|
},
|
|
40415
|
-
switch: ({
|
|
40416
|
-
|
|
40417
|
-
|
|
40418
|
-
|
|
40419
|
-
|
|
40420
|
-
|
|
40421
|
-
|
|
40422
|
-
|
|
40423
|
-
|
|
40424
|
-
|
|
40425
|
-
|
|
40426
|
-
|
|
40427
|
-
|
|
40428
|
-
|
|
40429
|
-
|
|
40430
|
-
|
|
40468
|
+
switch: (_ref21, _ref22) => {
|
|
40469
|
+
let {
|
|
40470
|
+
props,
|
|
40471
|
+
value,
|
|
40472
|
+
restricted,
|
|
40473
|
+
autocomplete,
|
|
40474
|
+
formsValue,
|
|
40475
|
+
repeatIndex,
|
|
40476
|
+
name,
|
|
40477
|
+
inputName,
|
|
40478
|
+
replace
|
|
40479
|
+
} = _ref21;
|
|
40480
|
+
let {
|
|
40481
|
+
form,
|
|
40482
|
+
setFormValues
|
|
40483
|
+
} = _ref22;
|
|
40484
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
40431
40485
|
defaultChecked: value || false,
|
|
40432
40486
|
checked: value || false,
|
|
40433
40487
|
onChange: isChecked => {
|
|
@@ -40469,14 +40523,15 @@ const inputTypeComponent = {
|
|
|
40469
40523
|
setFormValues(formsValue);
|
|
40470
40524
|
}
|
|
40471
40525
|
}
|
|
40472
|
-
});
|
|
40526
|
+
}));
|
|
40473
40527
|
},
|
|
40474
|
-
total100:
|
|
40475
|
-
|
|
40476
|
-
|
|
40477
|
-
|
|
40478
|
-
|
|
40479
|
-
|
|
40528
|
+
total100: _ref23 => {
|
|
40529
|
+
let {
|
|
40530
|
+
props,
|
|
40531
|
+
name,
|
|
40532
|
+
options,
|
|
40533
|
+
value
|
|
40534
|
+
} = _ref23;
|
|
40480
40535
|
value = value ? Array.isArray(value) ? value : [value] : [];
|
|
40481
40536
|
function totalValue() {
|
|
40482
40537
|
let total = 0;
|
|
@@ -40500,10 +40555,11 @@ const inputTypeComponent = {
|
|
|
40500
40555
|
className: "total100",
|
|
40501
40556
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
|
|
40502
40557
|
name: name,
|
|
40503
|
-
children: (fields, {
|
|
40504
|
-
|
|
40505
|
-
|
|
40506
|
-
|
|
40558
|
+
children: (fields, _ref24) => {
|
|
40559
|
+
let {
|
|
40560
|
+
add,
|
|
40561
|
+
remove
|
|
40562
|
+
} = _ref24;
|
|
40507
40563
|
if (fields.length === 0) {
|
|
40508
40564
|
const formData = value || [];
|
|
40509
40565
|
if (formData.length) {
|
|
@@ -40522,26 +40578,26 @@ const inputTypeComponent = {
|
|
|
40522
40578
|
const v = value[field.name];
|
|
40523
40579
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Space, {
|
|
40524
40580
|
className: "total",
|
|
40525
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
40526
|
-
noStyle: true
|
|
40527
|
-
|
|
40581
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
|
|
40582
|
+
noStyle: true
|
|
40583
|
+
}, field), {}, {
|
|
40528
40584
|
name: [field.name, "type"],
|
|
40529
40585
|
fieldKey: [field.fieldKey, "type"],
|
|
40530
40586
|
initialValue: v.type,
|
|
40531
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
40587
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
|
|
40532
40588
|
allowClear: true,
|
|
40533
40589
|
showSearch: true,
|
|
40534
40590
|
filterOption: filterSelectOptions,
|
|
40535
|
-
optionFilterProp: "children"
|
|
40536
|
-
|
|
40591
|
+
optionFilterProp: "children"
|
|
40592
|
+
}, props), {}, {
|
|
40537
40593
|
children: options.map((option, i) => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
40538
40594
|
value: option.value,
|
|
40539
40595
|
children: option.label
|
|
40540
40596
|
}, i))
|
|
40541
|
-
})
|
|
40542
|
-
}), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
40543
|
-
noStyle: true
|
|
40544
|
-
|
|
40597
|
+
}))
|
|
40598
|
+
})), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
|
|
40599
|
+
noStyle: true
|
|
40600
|
+
}, field), {}, {
|
|
40545
40601
|
name: [field.name, "value"],
|
|
40546
40602
|
fieldKey: [field.fieldKey, "value"],
|
|
40547
40603
|
initialValue: v.value,
|
|
@@ -40549,14 +40605,14 @@ const inputTypeComponent = {
|
|
|
40549
40605
|
allowClear: true,
|
|
40550
40606
|
name: "value",
|
|
40551
40607
|
formatter: value => {
|
|
40552
|
-
return value ?
|
|
40608
|
+
return value ? "".concat(value, "%") : "";
|
|
40553
40609
|
},
|
|
40554
40610
|
disabled: !v.type,
|
|
40555
40611
|
placeholder: props.valueplaceholder ? props.valueplaceholder : "Value",
|
|
40556
40612
|
min: 1,
|
|
40557
40613
|
max: 100 - siblingTotal(v.type)
|
|
40558
40614
|
})
|
|
40559
|
-
}), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
40615
|
+
})), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
40560
40616
|
disabled: !v.value || !v.type || totalValue() >= 100,
|
|
40561
40617
|
type: "primary",
|
|
40562
40618
|
icon: /*#__PURE__*/jsxRuntime.jsx(Icons.PlusOutlined, {}),
|
|
@@ -40588,18 +40644,21 @@ const inputTypeComponent = {
|
|
|
40588
40644
|
}) : null]
|
|
40589
40645
|
});
|
|
40590
40646
|
},
|
|
40591
|
-
percentage: ({
|
|
40592
|
-
|
|
40593
|
-
|
|
40594
|
-
|
|
40595
|
-
|
|
40596
|
-
|
|
40597
|
-
|
|
40598
|
-
|
|
40599
|
-
|
|
40600
|
-
|
|
40601
|
-
|
|
40602
|
-
|
|
40647
|
+
percentage: (_ref25, _ref26) => {
|
|
40648
|
+
var _input$meta6;
|
|
40649
|
+
let {
|
|
40650
|
+
name,
|
|
40651
|
+
inputName,
|
|
40652
|
+
totalMax,
|
|
40653
|
+
repeatIndex,
|
|
40654
|
+
props,
|
|
40655
|
+
formsValue,
|
|
40656
|
+
input
|
|
40657
|
+
} = _ref25;
|
|
40658
|
+
let {
|
|
40659
|
+
inputMeta,
|
|
40660
|
+
t
|
|
40661
|
+
} = _ref26;
|
|
40603
40662
|
const isRepeatable = Array.isArray(formsValue[name]);
|
|
40604
40663
|
let totalSiblings = 0;
|
|
40605
40664
|
if (isRepeatable && totalMax) {
|
|
@@ -40607,15 +40666,15 @@ const inputTypeComponent = {
|
|
|
40607
40666
|
totl = totl + (grp[inputName] || 0);
|
|
40608
40667
|
return totl;
|
|
40609
40668
|
}, 0);
|
|
40610
|
-
} else if (Array.isArray(input
|
|
40669
|
+
} else if (Array.isArray(input === null || input === void 0 || (_input$meta6 = input.meta) === null || _input$meta6 === void 0 ? void 0 : _input$meta6.siblings)) {
|
|
40611
40670
|
totalSiblings = input.meta.siblings.reduce((totl, key) => {
|
|
40612
40671
|
totl = totl + (formsValue[key] || 0);
|
|
40613
40672
|
return totl;
|
|
40614
40673
|
}, 0);
|
|
40615
40674
|
}
|
|
40616
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
40617
|
-
allowClear: true
|
|
40618
|
-
|
|
40675
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
|
|
40676
|
+
allowClear: true
|
|
40677
|
+
}, props), {}, {
|
|
40619
40678
|
style: {
|
|
40620
40679
|
width: "100%"
|
|
40621
40680
|
},
|
|
@@ -40624,33 +40683,36 @@ const inputTypeComponent = {
|
|
|
40624
40683
|
min: 0,
|
|
40625
40684
|
max: 100 - totalSiblings,
|
|
40626
40685
|
formatter: value => {
|
|
40627
|
-
return value ?
|
|
40686
|
+
return value ? "".concat(value) : "";
|
|
40628
40687
|
},
|
|
40629
40688
|
parser: value => value.replace("%", ""),
|
|
40630
40689
|
addonAfter: "%"
|
|
40631
|
-
});
|
|
40690
|
+
}));
|
|
40632
40691
|
},
|
|
40633
|
-
year:
|
|
40634
|
-
|
|
40635
|
-
|
|
40692
|
+
year: _ref27 => {
|
|
40693
|
+
let {
|
|
40694
|
+
props
|
|
40695
|
+
} = _ref27;
|
|
40636
40696
|
const lng = localStorage.getItem("datastakeLng") || "en";
|
|
40637
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
40697
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
|
|
40638
40698
|
allowClear: true,
|
|
40639
40699
|
locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
|
|
40640
|
-
picker: "year"
|
|
40641
|
-
|
|
40700
|
+
picker: "year"
|
|
40701
|
+
}, props), {}, {
|
|
40642
40702
|
format: "YYYY"
|
|
40643
|
-
});
|
|
40703
|
+
}));
|
|
40644
40704
|
},
|
|
40645
|
-
upload: ({
|
|
40646
|
-
|
|
40647
|
-
|
|
40648
|
-
|
|
40649
|
-
|
|
40650
|
-
|
|
40651
|
-
|
|
40652
|
-
|
|
40653
|
-
|
|
40705
|
+
upload: (_ref28, _ref29) => {
|
|
40706
|
+
let {
|
|
40707
|
+
rules,
|
|
40708
|
+
value
|
|
40709
|
+
} = _ref28;
|
|
40710
|
+
let {
|
|
40711
|
+
setLoading,
|
|
40712
|
+
t,
|
|
40713
|
+
getApiBaseUrl,
|
|
40714
|
+
getAppHeader
|
|
40715
|
+
} = _ref29;
|
|
40654
40716
|
const apiURL = getApiBaseUrl();
|
|
40655
40717
|
const accept = rules.length ? rules.find(rule => Object.keys(rule).includes("accept")).accept || "*" : null;
|
|
40656
40718
|
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) : []) || [];
|
|
@@ -40663,13 +40725,12 @@ const inputTypeComponent = {
|
|
|
40663
40725
|
}
|
|
40664
40726
|
}
|
|
40665
40727
|
const allowedExtensions = accept && accept !== "*" ? accept.split(",").map(ext => ext.trim().toLowerCase()) : [];
|
|
40666
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
40667
|
-
...maxProps,
|
|
40728
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({}, maxProps), {}, {
|
|
40668
40729
|
accept: accept,
|
|
40669
|
-
action:
|
|
40730
|
+
action: "".concat(apiURL, "/upload"),
|
|
40670
40731
|
beforeUpload: beforeUpload(allowedExtensions),
|
|
40671
40732
|
onChange: val => {
|
|
40672
|
-
if (val
|
|
40733
|
+
if (val !== null && val !== void 0 && val.file && typeof setLoading === "function") {
|
|
40673
40734
|
if (val.file.percent !== 100) {
|
|
40674
40735
|
setLoading(true);
|
|
40675
40736
|
} else {
|
|
@@ -40677,10 +40738,9 @@ const inputTypeComponent = {
|
|
|
40677
40738
|
}
|
|
40678
40739
|
}
|
|
40679
40740
|
},
|
|
40680
|
-
headers: {
|
|
40681
|
-
Authorization:
|
|
40682
|
-
|
|
40683
|
-
},
|
|
40741
|
+
headers: _objectSpread2({
|
|
40742
|
+
Authorization: "Bearer ".concat(getToken())
|
|
40743
|
+
}, getAppHeader()),
|
|
40684
40744
|
defaultFileList: values,
|
|
40685
40745
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
40686
40746
|
style: {
|
|
@@ -40690,17 +40750,19 @@ const inputTypeComponent = {
|
|
|
40690
40750
|
children: t("Upload")
|
|
40691
40751
|
})]
|
|
40692
40752
|
})
|
|
40693
|
-
});
|
|
40753
|
+
}));
|
|
40694
40754
|
},
|
|
40695
|
-
imageUpload: ({
|
|
40696
|
-
|
|
40697
|
-
|
|
40698
|
-
|
|
40699
|
-
|
|
40700
|
-
|
|
40701
|
-
|
|
40702
|
-
|
|
40703
|
-
|
|
40755
|
+
imageUpload: (_ref30, _ref31) => {
|
|
40756
|
+
let {
|
|
40757
|
+
rules,
|
|
40758
|
+
value
|
|
40759
|
+
} = _ref30;
|
|
40760
|
+
let {
|
|
40761
|
+
setLoading,
|
|
40762
|
+
getApiBaseUrl,
|
|
40763
|
+
getAppHeader,
|
|
40764
|
+
t
|
|
40765
|
+
} = _ref31;
|
|
40704
40766
|
const apiURL = getApiBaseUrl();
|
|
40705
40767
|
const values = getImageUploadEditValue(value);
|
|
40706
40768
|
const maxRule = rules.find(r => r.max);
|
|
@@ -40711,17 +40773,17 @@ const inputTypeComponent = {
|
|
|
40711
40773
|
maxProps.multiple = true;
|
|
40712
40774
|
}
|
|
40713
40775
|
}
|
|
40714
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
40715
|
-
...maxProps,
|
|
40776
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({}, maxProps), {}, {
|
|
40716
40777
|
beforeUpload: beforeUpload(allowedImageExtensions),
|
|
40717
40778
|
accept: "image/*",
|
|
40718
40779
|
classList: !values || !values.length ? "empty" : "",
|
|
40719
40780
|
listType: "picture",
|
|
40720
|
-
action:
|
|
40781
|
+
action: "".concat(apiURL, "/upload"),
|
|
40721
40782
|
onChange: val => {
|
|
40722
40783
|
if (typeof setLoading === "function") {
|
|
40723
|
-
if (val
|
|
40724
|
-
|
|
40784
|
+
if (val !== null && val !== void 0 && val.file) {
|
|
40785
|
+
var _val$file;
|
|
40786
|
+
if ((val === null || val === void 0 || (_val$file = val.file) === null || _val$file === void 0 ? void 0 : _val$file.status) === "removed") {
|
|
40725
40787
|
setLoading(false);
|
|
40726
40788
|
return;
|
|
40727
40789
|
}
|
|
@@ -40733,10 +40795,9 @@ const inputTypeComponent = {
|
|
|
40733
40795
|
setLoading(false);
|
|
40734
40796
|
}
|
|
40735
40797
|
},
|
|
40736
|
-
headers: {
|
|
40737
|
-
Authorization:
|
|
40738
|
-
|
|
40739
|
-
},
|
|
40798
|
+
headers: _objectSpread2({
|
|
40799
|
+
Authorization: "Bearer ".concat(getToken())
|
|
40800
|
+
}, getAppHeader()),
|
|
40740
40801
|
defaultFileList: values,
|
|
40741
40802
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
40742
40803
|
style: {
|
|
@@ -40746,17 +40807,19 @@ const inputTypeComponent = {
|
|
|
40746
40807
|
children: t("Upload")
|
|
40747
40808
|
})]
|
|
40748
40809
|
})
|
|
40749
|
-
});
|
|
40810
|
+
}));
|
|
40750
40811
|
},
|
|
40751
|
-
videoUpload: ({
|
|
40752
|
-
|
|
40753
|
-
|
|
40754
|
-
|
|
40755
|
-
|
|
40756
|
-
|
|
40757
|
-
|
|
40758
|
-
|
|
40759
|
-
|
|
40812
|
+
videoUpload: (_ref32, _ref33) => {
|
|
40813
|
+
let {
|
|
40814
|
+
rules,
|
|
40815
|
+
value
|
|
40816
|
+
} = _ref32;
|
|
40817
|
+
let {
|
|
40818
|
+
setLoading = () => {},
|
|
40819
|
+
getApiBaseUrl,
|
|
40820
|
+
getAppHeader,
|
|
40821
|
+
t
|
|
40822
|
+
} = _ref33;
|
|
40760
40823
|
const apiURL = getApiBaseUrl();
|
|
40761
40824
|
const values = getImageUploadEditValue(value);
|
|
40762
40825
|
const maxRule = rules.find(r => r.max);
|
|
@@ -40767,21 +40830,25 @@ const inputTypeComponent = {
|
|
|
40767
40830
|
maxProps.multiple = true;
|
|
40768
40831
|
}
|
|
40769
40832
|
}
|
|
40770
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
40771
|
-
itemRender: (item, fileList) =>
|
|
40772
|
-
|
|
40773
|
-
|
|
40774
|
-
|
|
40775
|
-
|
|
40776
|
-
|
|
40833
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({
|
|
40834
|
+
itemRender: (item, fileList) => {
|
|
40835
|
+
var _fileList$response;
|
|
40836
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
40837
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
|
|
40838
|
+
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)
|
|
40839
|
+
}), item]
|
|
40840
|
+
});
|
|
40841
|
+
}
|
|
40842
|
+
}, maxProps), {}, {
|
|
40777
40843
|
accept: "video/*",
|
|
40778
40844
|
classList: !values || !values.length ? "empty" : "",
|
|
40779
40845
|
listType: "picture",
|
|
40780
|
-
action:
|
|
40846
|
+
action: "".concat(apiURL, "/upload"),
|
|
40781
40847
|
onChange: val => {
|
|
40782
40848
|
if (typeof setLoading === "function") {
|
|
40783
|
-
if (val
|
|
40784
|
-
|
|
40849
|
+
if (val !== null && val !== void 0 && val.file) {
|
|
40850
|
+
var _val$file2;
|
|
40851
|
+
if ((val === null || val === void 0 || (_val$file2 = val.file) === null || _val$file2 === void 0 ? void 0 : _val$file2.status) === "removed") {
|
|
40785
40852
|
setLoading(false);
|
|
40786
40853
|
return;
|
|
40787
40854
|
}
|
|
@@ -40793,10 +40860,9 @@ const inputTypeComponent = {
|
|
|
40793
40860
|
setLoading(false);
|
|
40794
40861
|
}
|
|
40795
40862
|
},
|
|
40796
|
-
headers: {
|
|
40797
|
-
Authorization:
|
|
40798
|
-
|
|
40799
|
-
},
|
|
40863
|
+
headers: _objectSpread2({
|
|
40864
|
+
Authorization: "Bearer ".concat(getToken())
|
|
40865
|
+
}, getAppHeader()),
|
|
40800
40866
|
defaultFileList: values,
|
|
40801
40867
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
40802
40868
|
style: {
|
|
@@ -40806,17 +40872,19 @@ const inputTypeComponent = {
|
|
|
40806
40872
|
children: t("Upload")
|
|
40807
40873
|
})]
|
|
40808
40874
|
})
|
|
40809
|
-
});
|
|
40875
|
+
}));
|
|
40810
40876
|
},
|
|
40811
|
-
geolocation: ({
|
|
40812
|
-
|
|
40813
|
-
|
|
40814
|
-
|
|
40815
|
-
|
|
40816
|
-
|
|
40817
|
-
|
|
40818
|
-
|
|
40819
|
-
|
|
40877
|
+
geolocation: (_ref34, _ref35) => {
|
|
40878
|
+
let {
|
|
40879
|
+
value,
|
|
40880
|
+
name,
|
|
40881
|
+
formsValue,
|
|
40882
|
+
addressData,
|
|
40883
|
+
props
|
|
40884
|
+
} = _ref34;
|
|
40885
|
+
let {
|
|
40886
|
+
inputMeta
|
|
40887
|
+
} = _ref35;
|
|
40820
40888
|
let search = formsValue.country;
|
|
40821
40889
|
if (addressData && Object.keys(addressData).length > 0) {
|
|
40822
40890
|
const country = countriesList.countries[formsValue.country] || {};
|
|
@@ -40824,10 +40892,10 @@ const inputTypeComponent = {
|
|
|
40824
40892
|
search = addressData.country;
|
|
40825
40893
|
}
|
|
40826
40894
|
if (addressData.level1) {
|
|
40827
|
-
search =
|
|
40895
|
+
search = "".concat(addressData.level1, ", ").concat(addressData.country || country.name);
|
|
40828
40896
|
}
|
|
40829
40897
|
if (addressData.level2) {
|
|
40830
|
-
search =
|
|
40898
|
+
search = "".concat(addressData.level2, ", ").concat(addressData.level1, ", ").concat(addressData.country || country.name);
|
|
40831
40899
|
}
|
|
40832
40900
|
} else {
|
|
40833
40901
|
const country = countriesList.countries[formsValue.country] || {};
|
|
@@ -40835,10 +40903,10 @@ const inputTypeComponent = {
|
|
|
40835
40903
|
search = country.name;
|
|
40836
40904
|
}
|
|
40837
40905
|
if (formsValue.administrativeLevel1Name) {
|
|
40838
|
-
search =
|
|
40906
|
+
search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
|
|
40839
40907
|
}
|
|
40840
40908
|
if (formsValue.administrativeLevel2Name) {
|
|
40841
|
-
search =
|
|
40909
|
+
search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
|
|
40842
40910
|
}
|
|
40843
40911
|
}
|
|
40844
40912
|
return /*#__PURE__*/jsxRuntime.jsx(Geolocation, {
|
|
@@ -40851,33 +40919,35 @@ const inputTypeComponent = {
|
|
|
40851
40919
|
searchValue: search
|
|
40852
40920
|
});
|
|
40853
40921
|
},
|
|
40854
|
-
ajaxSelect: ({
|
|
40855
|
-
|
|
40856
|
-
|
|
40857
|
-
|
|
40858
|
-
|
|
40859
|
-
|
|
40860
|
-
|
|
40861
|
-
|
|
40862
|
-
|
|
40863
|
-
|
|
40864
|
-
|
|
40865
|
-
|
|
40866
|
-
|
|
40867
|
-
|
|
40868
|
-
|
|
40869
|
-
|
|
40870
|
-
|
|
40871
|
-
|
|
40872
|
-
|
|
40873
|
-
|
|
40874
|
-
|
|
40875
|
-
|
|
40876
|
-
|
|
40877
|
-
|
|
40878
|
-
|
|
40879
|
-
|
|
40880
|
-
|
|
40922
|
+
ajaxSelect: (_ref36, _ref37) => {
|
|
40923
|
+
let {
|
|
40924
|
+
call,
|
|
40925
|
+
automaticallyLink,
|
|
40926
|
+
name,
|
|
40927
|
+
preSelected,
|
|
40928
|
+
inputName,
|
|
40929
|
+
props,
|
|
40930
|
+
formsValue,
|
|
40931
|
+
onNewSetValue,
|
|
40932
|
+
multiple,
|
|
40933
|
+
updateOptions,
|
|
40934
|
+
repeatValues,
|
|
40935
|
+
repeatIndex,
|
|
40936
|
+
value,
|
|
40937
|
+
unique,
|
|
40938
|
+
address,
|
|
40939
|
+
addressData = {},
|
|
40940
|
+
input
|
|
40941
|
+
} = _ref36;
|
|
40942
|
+
let {
|
|
40943
|
+
form,
|
|
40944
|
+
forms,
|
|
40945
|
+
setAddress,
|
|
40946
|
+
changeInputMeta,
|
|
40947
|
+
inputMeta = {},
|
|
40948
|
+
meta,
|
|
40949
|
+
setFormValues
|
|
40950
|
+
} = _ref37;
|
|
40881
40951
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect, {
|
|
40882
40952
|
preSelected: preSelected,
|
|
40883
40953
|
input: input,
|
|
@@ -40913,40 +40983,41 @@ const inputTypeComponent = {
|
|
|
40913
40983
|
const selectedValue = data.find(v => v.value === ev);
|
|
40914
40984
|
if (address && selectedValue) {
|
|
40915
40985
|
dot__default["default"].str(address, selectedValue.label, addressData);
|
|
40916
|
-
setAddress({
|
|
40917
|
-
...addressData
|
|
40918
|
-
});
|
|
40986
|
+
setAddress(_objectSpread2({}, addressData));
|
|
40919
40987
|
}
|
|
40920
40988
|
}
|
|
40921
40989
|
},
|
|
40922
40990
|
setAddress: setAddress
|
|
40923
40991
|
});
|
|
40924
40992
|
},
|
|
40925
|
-
tag:
|
|
40926
|
-
|
|
40927
|
-
|
|
40928
|
-
|
|
40993
|
+
tag: _ref38 => {
|
|
40994
|
+
let {
|
|
40995
|
+
value,
|
|
40996
|
+
repeatLabel
|
|
40997
|
+
} = _ref38;
|
|
40929
40998
|
return /*#__PURE__*/jsxRuntime.jsx(TagInput$1, {
|
|
40930
40999
|
allowClear: true,
|
|
40931
41000
|
value: value || [],
|
|
40932
41001
|
newPlaceholder: repeatLabel
|
|
40933
41002
|
});
|
|
40934
41003
|
},
|
|
40935
|
-
modal: ({
|
|
40936
|
-
|
|
40937
|
-
|
|
40938
|
-
|
|
40939
|
-
|
|
40940
|
-
|
|
40941
|
-
|
|
40942
|
-
|
|
40943
|
-
|
|
40944
|
-
|
|
40945
|
-
|
|
40946
|
-
|
|
40947
|
-
|
|
40948
|
-
|
|
40949
|
-
|
|
41004
|
+
modal: (_ref39, _ref40) => {
|
|
41005
|
+
let {
|
|
41006
|
+
call,
|
|
41007
|
+
automaticallyLink,
|
|
41008
|
+
name,
|
|
41009
|
+
inputName,
|
|
41010
|
+
props,
|
|
41011
|
+
formsValue,
|
|
41012
|
+
onNewSetValue,
|
|
41013
|
+
repeatValues,
|
|
41014
|
+
repeatIndex,
|
|
41015
|
+
value,
|
|
41016
|
+
modalTitle
|
|
41017
|
+
} = _ref39;
|
|
41018
|
+
let {
|
|
41019
|
+
form
|
|
41020
|
+
} = _ref40;
|
|
40950
41021
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxModal$2, {
|
|
40951
41022
|
allowClear: true,
|
|
40952
41023
|
call: call,
|
|
@@ -40964,63 +41035,69 @@ const inputTypeComponent = {
|
|
|
40964
41035
|
buttonText: modalTitle
|
|
40965
41036
|
});
|
|
40966
41037
|
},
|
|
40967
|
-
website: ({
|
|
40968
|
-
|
|
40969
|
-
|
|
40970
|
-
|
|
40971
|
-
|
|
40972
|
-
|
|
40973
|
-
|
|
40974
|
-
|
|
40975
|
-
|
|
40976
|
-
|
|
40977
|
-
|
|
40978
|
-
|
|
40979
|
-
|
|
40980
|
-
|
|
41038
|
+
website: (_ref41, _ref42) => {
|
|
41039
|
+
let {
|
|
41040
|
+
name,
|
|
41041
|
+
inputName,
|
|
41042
|
+
props,
|
|
41043
|
+
value,
|
|
41044
|
+
repeatIndex,
|
|
41045
|
+
repeatValues,
|
|
41046
|
+
formsValue
|
|
41047
|
+
} = _ref41;
|
|
41048
|
+
let {
|
|
41049
|
+
form,
|
|
41050
|
+
inputMeta = {},
|
|
41051
|
+
t
|
|
41052
|
+
} = _ref42;
|
|
41053
|
+
return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
|
|
40981
41054
|
allowClear: true,
|
|
40982
41055
|
initialValue: value,
|
|
40983
|
-
t: t
|
|
40984
|
-
|
|
41056
|
+
t: t
|
|
41057
|
+
}, props), {}, {
|
|
40985
41058
|
onChange: val => updateFormValues(repeatIndex, repeatValues, inputName, val, formsValue, name, form),
|
|
40986
41059
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
40987
41060
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com"
|
|
40988
|
-
});
|
|
41061
|
+
}));
|
|
40989
41062
|
},
|
|
40990
|
-
dataLink: ({
|
|
40991
|
-
|
|
40992
|
-
|
|
40993
|
-
|
|
40994
|
-
|
|
40995
|
-
|
|
40996
|
-
|
|
40997
|
-
|
|
40998
|
-
|
|
40999
|
-
|
|
41000
|
-
|
|
41001
|
-
|
|
41002
|
-
|
|
41003
|
-
|
|
41004
|
-
|
|
41005
|
-
|
|
41006
|
-
|
|
41007
|
-
|
|
41008
|
-
|
|
41009
|
-
|
|
41010
|
-
|
|
41011
|
-
|
|
41012
|
-
|
|
41013
|
-
|
|
41014
|
-
|
|
41015
|
-
|
|
41016
|
-
|
|
41017
|
-
|
|
41018
|
-
|
|
41019
|
-
|
|
41020
|
-
|
|
41021
|
-
|
|
41022
|
-
|
|
41023
|
-
|
|
41063
|
+
dataLink: (_ref43, _ref44) => {
|
|
41064
|
+
var _input$meta7, _input$meta10, _formsValue$meta, _input$meta11;
|
|
41065
|
+
let {
|
|
41066
|
+
setValues,
|
|
41067
|
+
name,
|
|
41068
|
+
onValuesChange,
|
|
41069
|
+
formsValue,
|
|
41070
|
+
input,
|
|
41071
|
+
changeLinking,
|
|
41072
|
+
call,
|
|
41073
|
+
automaticallyLink,
|
|
41074
|
+
inputName,
|
|
41075
|
+
props,
|
|
41076
|
+
onNewSetValue,
|
|
41077
|
+
multiple,
|
|
41078
|
+
updateOptions,
|
|
41079
|
+
repeatValues,
|
|
41080
|
+
repeatIndex,
|
|
41081
|
+
value,
|
|
41082
|
+
unique,
|
|
41083
|
+
address,
|
|
41084
|
+
addressData = {},
|
|
41085
|
+
getFromLinking
|
|
41086
|
+
} = _ref43;
|
|
41087
|
+
let {
|
|
41088
|
+
form,
|
|
41089
|
+
groupFormId,
|
|
41090
|
+
setAddress,
|
|
41091
|
+
isHighlighted,
|
|
41092
|
+
changeInputMeta,
|
|
41093
|
+
meta,
|
|
41094
|
+
inputMeta,
|
|
41095
|
+
forms
|
|
41096
|
+
} = _ref44;
|
|
41097
|
+
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") {
|
|
41098
|
+
var _formsValue$groupForm, _input$meta8, _input$meta9;
|
|
41099
|
+
const currentValue = groupFormId ? (_formsValue$groupForm = formsValue[groupFormId]) === null || _formsValue$groupForm === void 0 ? void 0 : _formsValue$groupForm[name] : formsValue[name];
|
|
41100
|
+
(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()::::";
|
|
41024
41101
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect$1, {
|
|
41025
41102
|
size: "medium",
|
|
41026
41103
|
input: input,
|
|
@@ -41057,9 +41134,7 @@ const inputTypeComponent = {
|
|
|
41057
41134
|
const selectedValue = data.find(v => v.value === ev);
|
|
41058
41135
|
if (address && selectedValue) {
|
|
41059
41136
|
dot__default["default"].str(address, selectedValue.label, addressData);
|
|
41060
|
-
setAddress({
|
|
41061
|
-
...addressData
|
|
41062
|
-
});
|
|
41137
|
+
setAddress(_objectSpread2({}, addressData));
|
|
41063
41138
|
}
|
|
41064
41139
|
}
|
|
41065
41140
|
},
|
|
@@ -41069,188 +41144,149 @@ const inputTypeComponent = {
|
|
|
41069
41144
|
isDataLink: true
|
|
41070
41145
|
});
|
|
41071
41146
|
}
|
|
41072
|
-
const isSingle = input
|
|
41073
|
-
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
|
|
41074
|
-
...(formsValue[groupFormId] || {})[name]
|
|
41075
|
-
}] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
|
|
41076
|
-
...v
|
|
41077
|
-
})) : isSingle ? formsValue[name] ? [{
|
|
41078
|
-
...formsValue[name]
|
|
41079
|
-
}] : [] : (formsValue[name] || []).map(v => ({
|
|
41080
|
-
...v
|
|
41081
|
-
}));
|
|
41147
|
+
const isSingle = (input === null || input === void 0 || (_input$meta10 = input.meta) === null || _input$meta10 === void 0 ? void 0 : _input$meta10.maxRepeat) === 1;
|
|
41148
|
+
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));
|
|
41082
41149
|
const onUpdate = (val, i) => {
|
|
41083
41150
|
const _val = isSingle ? {
|
|
41084
41151
|
[name]: val
|
|
41085
41152
|
} : {
|
|
41086
|
-
[name]: formData
|
|
41153
|
+
[name]: formData === null || formData === void 0 ? void 0 : formData.map((d, j) => i === j ? val : d)
|
|
41087
41154
|
};
|
|
41088
41155
|
if (groupFormId) {
|
|
41089
|
-
const _defaultData = form
|
|
41090
|
-
const _newData = {
|
|
41091
|
-
|
|
41092
|
-
..._val
|
|
41093
|
-
};
|
|
41094
|
-
onValuesChange(_newData, {
|
|
41095
|
-
...formsValue,
|
|
41156
|
+
const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
|
|
41157
|
+
const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
|
|
41158
|
+
onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
41096
41159
|
[groupFormId]: _newData
|
|
41097
|
-
});
|
|
41098
|
-
form
|
|
41099
|
-
setValues({
|
|
41100
|
-
...formsValue,
|
|
41160
|
+
}));
|
|
41161
|
+
form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
|
|
41162
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
41101
41163
|
[groupFormId]: _newData
|
|
41102
|
-
});
|
|
41164
|
+
}));
|
|
41103
41165
|
return;
|
|
41104
41166
|
}
|
|
41105
|
-
onValuesChange(_val, {
|
|
41106
|
-
|
|
41107
|
-
|
|
41108
|
-
});
|
|
41109
|
-
form?.setFieldValue(name, _val[name]);
|
|
41110
|
-
setValues({
|
|
41111
|
-
...formsValue,
|
|
41112
|
-
..._val
|
|
41113
|
-
});
|
|
41167
|
+
onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
41168
|
+
form === null || form === void 0 || form.setFieldValue(name, _val[name]);
|
|
41169
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
41114
41170
|
};
|
|
41115
41171
|
return /*#__PURE__*/jsxRuntime.jsx(DataLink, {
|
|
41116
41172
|
form: input,
|
|
41117
41173
|
formsValue: formsValue,
|
|
41118
41174
|
onUpdate: onUpdate,
|
|
41119
41175
|
isHighlighted: isHighlighted,
|
|
41120
|
-
values: groupFormId ? {
|
|
41121
|
-
...(formsValue[groupFormId] || {}),
|
|
41176
|
+
values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
|
|
41122
41177
|
meta: {
|
|
41123
|
-
inputs: (formsValue
|
|
41178
|
+
inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta = formsValue.meta) === null || _formsValue$meta === void 0 ? void 0 : _formsValue$meta.inputs) || {})[groupFormId]
|
|
41124
41179
|
}
|
|
41125
|
-
} : formsValue,
|
|
41180
|
+
}) : formsValue,
|
|
41126
41181
|
name: name,
|
|
41127
41182
|
groupFormId: groupFormId,
|
|
41128
|
-
maxRepeat: input
|
|
41129
|
-
remove:
|
|
41130
|
-
|
|
41131
|
-
|
|
41183
|
+
maxRepeat: input === null || input === void 0 || (_input$meta11 = input.meta) === null || _input$meta11 === void 0 ? void 0 : _input$meta11.maxRepeat,
|
|
41184
|
+
remove: _ref45 => {
|
|
41185
|
+
let {
|
|
41186
|
+
key
|
|
41187
|
+
} = _ref45;
|
|
41132
41188
|
const _val = isSingle ? {
|
|
41133
41189
|
[name]: null
|
|
41134
41190
|
} : {
|
|
41135
41191
|
[name]: formData.filter((v, i) => i !== key)
|
|
41136
41192
|
};
|
|
41137
41193
|
if (groupFormId) {
|
|
41138
|
-
const _defaultData = form
|
|
41139
|
-
const _newData = {
|
|
41140
|
-
|
|
41141
|
-
..._val
|
|
41142
|
-
};
|
|
41143
|
-
onValuesChange(_newData, {
|
|
41144
|
-
...formsValue,
|
|
41194
|
+
const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
|
|
41195
|
+
const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
|
|
41196
|
+
onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
41145
41197
|
[groupFormId]: _newData
|
|
41146
|
-
});
|
|
41147
|
-
form
|
|
41148
|
-
setValues({
|
|
41149
|
-
...formsValue,
|
|
41198
|
+
}));
|
|
41199
|
+
form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
|
|
41200
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
41150
41201
|
[groupFormId]: _newData
|
|
41151
|
-
});
|
|
41202
|
+
}));
|
|
41152
41203
|
return;
|
|
41153
41204
|
}
|
|
41154
|
-
onValuesChange(_val, {
|
|
41155
|
-
|
|
41156
|
-
|
|
41157
|
-
});
|
|
41158
|
-
form?.setFieldValue(name, _val[name]);
|
|
41159
|
-
setValues({
|
|
41160
|
-
...formsValue,
|
|
41161
|
-
..._val
|
|
41162
|
-
});
|
|
41205
|
+
onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
41206
|
+
form === null || form === void 0 || form.setFieldValue(name, _val[name]);
|
|
41207
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
41163
41208
|
},
|
|
41164
41209
|
add: val => {
|
|
41165
41210
|
const _val = isSingle ? {
|
|
41166
41211
|
[name]: val
|
|
41167
41212
|
} : {
|
|
41168
|
-
[name]: [...formData, {
|
|
41169
|
-
...val
|
|
41170
|
-
}]
|
|
41213
|
+
[name]: [...formData, _objectSpread2({}, val)]
|
|
41171
41214
|
};
|
|
41172
41215
|
if (groupFormId) {
|
|
41173
|
-
const _defaultData = form
|
|
41174
|
-
const _newData = {
|
|
41175
|
-
|
|
41176
|
-
|
|
41177
|
-
};
|
|
41178
|
-
form?.setFieldValue(groupFormId, _newData);
|
|
41179
|
-
onValuesChange(_newData, {
|
|
41180
|
-
...formsValue,
|
|
41216
|
+
const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
|
|
41217
|
+
const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
|
|
41218
|
+
form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
|
|
41219
|
+
onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
41181
41220
|
[groupFormId]: _newData
|
|
41182
|
-
});
|
|
41183
|
-
setValues({
|
|
41184
|
-
...formsValue,
|
|
41221
|
+
}));
|
|
41222
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
41185
41223
|
[groupFormId]: _newData
|
|
41186
|
-
});
|
|
41224
|
+
}));
|
|
41187
41225
|
return;
|
|
41188
41226
|
}
|
|
41189
|
-
form
|
|
41190
|
-
onValuesChange(_val, {
|
|
41191
|
-
|
|
41192
|
-
..._val
|
|
41193
|
-
});
|
|
41194
|
-
setValues({
|
|
41195
|
-
...formsValue,
|
|
41196
|
-
..._val
|
|
41197
|
-
});
|
|
41227
|
+
form === null || form === void 0 || form.setFieldValue(name, _val[name]);
|
|
41228
|
+
onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
41229
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
41198
41230
|
},
|
|
41199
41231
|
k: name,
|
|
41200
41232
|
formData: formData
|
|
41201
41233
|
});
|
|
41202
41234
|
},
|
|
41203
|
-
internallink: ({
|
|
41204
|
-
|
|
41205
|
-
|
|
41206
|
-
|
|
41207
|
-
|
|
41208
|
-
|
|
41209
|
-
|
|
41210
|
-
|
|
41211
|
-
|
|
41212
|
-
|
|
41213
|
-
|
|
41214
|
-
|
|
41215
|
-
|
|
41216
|
-
|
|
41235
|
+
internallink: (_ref46, _ref47) => {
|
|
41236
|
+
let {
|
|
41237
|
+
name,
|
|
41238
|
+
inputName,
|
|
41239
|
+
props,
|
|
41240
|
+
value,
|
|
41241
|
+
repeatIndex,
|
|
41242
|
+
repeatValues,
|
|
41243
|
+
formsValue
|
|
41244
|
+
} = _ref46;
|
|
41245
|
+
let {
|
|
41246
|
+
form,
|
|
41247
|
+
inputMeta = {},
|
|
41248
|
+
t
|
|
41249
|
+
} = _ref47;
|
|
41250
|
+
return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
|
|
41217
41251
|
allowClear: true,
|
|
41218
41252
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
41219
41253
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com",
|
|
41220
|
-
initialValue: value
|
|
41221
|
-
|
|
41254
|
+
initialValue: value
|
|
41255
|
+
}, props), {}, {
|
|
41222
41256
|
onChange: val => updateFormValues(repeatIndex, repeatValues, inputName, val, formsValue, name, form)
|
|
41223
|
-
});
|
|
41257
|
+
}));
|
|
41224
41258
|
},
|
|
41225
|
-
group:
|
|
41226
|
-
|
|
41227
|
-
|
|
41228
|
-
|
|
41229
|
-
|
|
41230
|
-
|
|
41231
|
-
|
|
41232
|
-
});
|
|
41259
|
+
group: _ref48 => {
|
|
41260
|
+
let {
|
|
41261
|
+
props,
|
|
41262
|
+
groupInputs
|
|
41263
|
+
} = _ref48;
|
|
41264
|
+
return /*#__PURE__*/jsxRuntime.jsx(GroupInput$1, _objectSpread2({
|
|
41265
|
+
groupInputs: groupInputs
|
|
41266
|
+
}, props));
|
|
41233
41267
|
},
|
|
41234
|
-
groupInputs: ({
|
|
41235
|
-
|
|
41236
|
-
|
|
41237
|
-
|
|
41238
|
-
|
|
41239
|
-
|
|
41240
|
-
|
|
41268
|
+
groupInputs: (_ref49, _ref50) => {
|
|
41269
|
+
let {
|
|
41270
|
+
props,
|
|
41271
|
+
groupInputs
|
|
41272
|
+
} = _ref49;
|
|
41273
|
+
let {
|
|
41274
|
+
inputMeta
|
|
41275
|
+
} = _ref50;
|
|
41276
|
+
return /*#__PURE__*/jsxRuntime.jsx(GroupInput$1, _objectSpread2({
|
|
41241
41277
|
groupInputs: groupInputs,
|
|
41242
|
-
inputMeta: inputMeta
|
|
41243
|
-
|
|
41244
|
-
});
|
|
41278
|
+
inputMeta: inputMeta
|
|
41279
|
+
}, props));
|
|
41245
41280
|
},
|
|
41246
|
-
radioGroup:
|
|
41247
|
-
|
|
41248
|
-
|
|
41249
|
-
|
|
41250
|
-
|
|
41251
|
-
|
|
41252
|
-
|
|
41253
|
-
|
|
41281
|
+
radioGroup: _ref51 => {
|
|
41282
|
+
let {
|
|
41283
|
+
props,
|
|
41284
|
+
value,
|
|
41285
|
+
options
|
|
41286
|
+
} = _ref51;
|
|
41287
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, _objectSpread2(_objectSpread2({
|
|
41288
|
+
value: value
|
|
41289
|
+
}, props), {}, {
|
|
41254
41290
|
children: (options || []).map(o => {
|
|
41255
41291
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
|
|
41256
41292
|
value: o.value,
|
|
@@ -41263,16 +41299,17 @@ const inputTypeComponent = {
|
|
|
41263
41299
|
}) : null]
|
|
41264
41300
|
}, o.value);
|
|
41265
41301
|
})
|
|
41266
|
-
});
|
|
41302
|
+
}));
|
|
41267
41303
|
},
|
|
41268
|
-
checkboxGroup:
|
|
41269
|
-
|
|
41270
|
-
|
|
41271
|
-
|
|
41272
|
-
|
|
41273
|
-
|
|
41274
|
-
|
|
41275
|
-
|
|
41304
|
+
checkboxGroup: _ref52 => {
|
|
41305
|
+
let {
|
|
41306
|
+
props,
|
|
41307
|
+
value,
|
|
41308
|
+
options
|
|
41309
|
+
} = _ref52;
|
|
41310
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, _objectSpread2(_objectSpread2({
|
|
41311
|
+
value: value
|
|
41312
|
+
}, props), {}, {
|
|
41276
41313
|
children: (options || []).map(o => {
|
|
41277
41314
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Checkbox, {
|
|
41278
41315
|
value: o.value,
|
|
@@ -41285,28 +41322,30 @@ const inputTypeComponent = {
|
|
|
41285
41322
|
}) : null]
|
|
41286
41323
|
}, o.value);
|
|
41287
41324
|
})
|
|
41288
|
-
});
|
|
41325
|
+
}));
|
|
41289
41326
|
}
|
|
41290
41327
|
};
|
|
41291
|
-
const GetFormItem =
|
|
41292
|
-
|
|
41293
|
-
|
|
41294
|
-
|
|
41295
|
-
|
|
41296
|
-
|
|
41297
|
-
|
|
41298
|
-
|
|
41299
|
-
|
|
41300
|
-
|
|
41301
|
-
|
|
41302
|
-
|
|
41303
|
-
|
|
41304
|
-
|
|
41305
|
-
|
|
41306
|
-
|
|
41307
|
-
|
|
41308
|
-
|
|
41309
|
-
|
|
41328
|
+
const GetFormItem = _ref53 => {
|
|
41329
|
+
var _find, _input$meta12, _input$meta13, _input$meta14, _input$meta15, _input$meta16, _input$meta17, _input$meta18, _inputData$value, _input$meta19, _input$meta20, _inputData$commentVal;
|
|
41330
|
+
let {
|
|
41331
|
+
code,
|
|
41332
|
+
inputData,
|
|
41333
|
+
inputId,
|
|
41334
|
+
input,
|
|
41335
|
+
setLoading,
|
|
41336
|
+
values,
|
|
41337
|
+
MainForm,
|
|
41338
|
+
options,
|
|
41339
|
+
plainForms,
|
|
41340
|
+
setValues,
|
|
41341
|
+
alertError,
|
|
41342
|
+
setAddress,
|
|
41343
|
+
inputMeta = {},
|
|
41344
|
+
inputKey,
|
|
41345
|
+
changeInputMeta = () => {},
|
|
41346
|
+
i,
|
|
41347
|
+
isCreate = false
|
|
41348
|
+
} = _ref53;
|
|
41310
41349
|
const {
|
|
41311
41350
|
t,
|
|
41312
41351
|
getAppHeader,
|
|
@@ -41322,7 +41361,7 @@ const GetFormItem = ({
|
|
|
41322
41361
|
case "h6":
|
|
41323
41362
|
return getInputHeadLines(input.type, i, input, values);
|
|
41324
41363
|
default:
|
|
41325
|
-
const rules = inputMeta
|
|
41364
|
+
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")) : [];
|
|
41326
41365
|
const requiredRule = rules.find(r => r.required);
|
|
41327
41366
|
if (requiredRule && input.type === "text") {
|
|
41328
41367
|
rules.push({
|
|
@@ -41331,47 +41370,45 @@ const GetFormItem = ({
|
|
|
41331
41370
|
});
|
|
41332
41371
|
}
|
|
41333
41372
|
const noLabel = ["message"].includes(input.type);
|
|
41334
|
-
let maxRule = (inputData
|
|
41373
|
+
let maxRule = (_find = ((inputData === null || inputData === void 0 ? void 0 : inputData.rules) || []).find(rule => rule.max)) === null || _find === void 0 ? void 0 : _find.max;
|
|
41335
41374
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
41336
41375
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41337
41376
|
className: "flex input-cont",
|
|
41338
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
41339
|
-
initialValue: inputMeta
|
|
41340
|
-
|
|
41341
|
-
|
|
41342
|
-
|
|
41343
|
-
|
|
41344
|
-
|
|
41345
|
-
|
|
41346
|
-
|
|
41347
|
-
|
|
41348
|
-
|
|
41349
|
-
return e;
|
|
41350
|
-
}
|
|
41351
|
-
return e && e.fileList && e.fileList.map(f => {
|
|
41352
|
-
if (f.response) {
|
|
41353
|
-
return f.response;
|
|
41354
|
-
}
|
|
41355
|
-
return f;
|
|
41356
|
-
});
|
|
41377
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
41378
|
+
initialValue: inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.defaultValue
|
|
41379
|
+
}, ["total100", "group"].includes(input.type) ? {} : {
|
|
41380
|
+
name: inputId,
|
|
41381
|
+
fieldKey: inputId,
|
|
41382
|
+
initialValue: inputData.value
|
|
41383
|
+
}), ["upload", "imageUpload", "videoUpload"].includes(input.type) ? {
|
|
41384
|
+
valuePropName: "fileList",
|
|
41385
|
+
getValueFromEvent: e => {
|
|
41386
|
+
if (Array.isArray(e)) {
|
|
41387
|
+
return e;
|
|
41357
41388
|
}
|
|
41358
|
-
|
|
41389
|
+
return e && e.fileList && e.fileList.map(f => {
|
|
41390
|
+
if (f.response) {
|
|
41391
|
+
return f.response;
|
|
41392
|
+
}
|
|
41393
|
+
return f;
|
|
41394
|
+
});
|
|
41395
|
+
}
|
|
41396
|
+
} : {}), {}, {
|
|
41359
41397
|
style: input.showOnView === false ? {
|
|
41360
41398
|
display: "none"
|
|
41361
|
-
} : {}
|
|
41362
|
-
|
|
41363
|
-
|
|
41364
|
-
|
|
41365
|
-
|
|
41366
|
-
|
|
41367
|
-
|
|
41368
|
-
|
|
41369
|
-
|
|
41370
|
-
|
|
41371
|
-
|
|
41372
|
-
|
|
41373
|
-
|
|
41374
|
-
className: input.comment ? `flex-1 with-comment i-${input.type}` : `i-${input.type} flex-1`,
|
|
41399
|
+
} : {}
|
|
41400
|
+
}, ["switch"].includes(input.type) ? {
|
|
41401
|
+
labelCol: {
|
|
41402
|
+
span: 20
|
|
41403
|
+
},
|
|
41404
|
+
style: _objectSpread2(_objectSpread2({}, input.showOnView === false ? {
|
|
41405
|
+
display: "none"
|
|
41406
|
+
} : {}), {}, {
|
|
41407
|
+
flexDirection: "row",
|
|
41408
|
+
justifyContent: "space-between"
|
|
41409
|
+
})
|
|
41410
|
+
} : {}), {}, {
|
|
41411
|
+
className: input.comment ? "flex-1 with-comment i-".concat(input.type) : "i-".concat(input.type, " flex-1"),
|
|
41375
41412
|
"data-id": inputData.name,
|
|
41376
41413
|
rules: rules,
|
|
41377
41414
|
required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
|
|
@@ -41382,8 +41419,8 @@ const GetFormItem = ({
|
|
|
41382
41419
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41383
41420
|
className: "mr-1",
|
|
41384
41421
|
children: getInputLabel(input, values)
|
|
41385
|
-
}), !!input
|
|
41386
|
-
title: input
|
|
41422
|
+
}), !!(input !== null && input !== void 0 && (_input$meta12 = input.meta) !== null && _input$meta12 !== void 0 && _input$meta12.tooltip) && /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
41423
|
+
title: input === null || input === void 0 || (_input$meta13 = input.meta) === null || _input$meta13 === void 0 ? void 0 : _input$meta13.tooltip,
|
|
41387
41424
|
trigger: "hover",
|
|
41388
41425
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41389
41426
|
className: "flex flex-column justify-content-center",
|
|
@@ -41401,7 +41438,7 @@ const GetFormItem = ({
|
|
|
41401
41438
|
title: t("Not applicable"),
|
|
41402
41439
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41403
41440
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
41404
|
-
disabled: !input
|
|
41441
|
+
disabled: !(input !== null && input !== void 0 && (_input$meta14 = input.meta) !== null && _input$meta14 !== void 0 && _input$meta14.notApplicable),
|
|
41405
41442
|
className: formatClassname(["default p-0", inputMeta.notApplicable && "primary"]),
|
|
41406
41443
|
type: "link",
|
|
41407
41444
|
onClick: () => {
|
|
@@ -41436,7 +41473,7 @@ const GetFormItem = ({
|
|
|
41436
41473
|
title: t("No available information"),
|
|
41437
41474
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41438
41475
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
41439
|
-
disabled: !input
|
|
41476
|
+
disabled: !(input !== null && input !== void 0 && (_input$meta15 = input.meta) !== null && _input$meta15 !== void 0 && _input$meta15.notAvailable),
|
|
41440
41477
|
className: formatClassname(["default p-0", inputMeta.notAvailable && "primary"]),
|
|
41441
41478
|
type: "link",
|
|
41442
41479
|
onClick: () => {
|
|
@@ -41470,14 +41507,14 @@ const GetFormItem = ({
|
|
|
41470
41507
|
}), /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
41471
41508
|
title: t("Add comment"),
|
|
41472
41509
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41473
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
41510
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
|
|
41474
41511
|
type: "link",
|
|
41475
|
-
disabled: !input
|
|
41476
|
-
|
|
41477
|
-
|
|
41478
|
-
|
|
41479
|
-
|
|
41480
|
-
|
|
41512
|
+
disabled: !(input !== null && input !== void 0 && (_input$meta16 = input.meta) !== null && _input$meta16 !== void 0 && _input$meta16.comment)
|
|
41513
|
+
}, !isShown ? {
|
|
41514
|
+
className: "default p-0"
|
|
41515
|
+
} : {
|
|
41516
|
+
className: "p-0 primary"
|
|
41517
|
+
}), {}, {
|
|
41481
41518
|
onClick: () => {
|
|
41482
41519
|
setIsShown(true);
|
|
41483
41520
|
changeInputMeta({
|
|
@@ -41493,18 +41530,18 @@ const GetFormItem = ({
|
|
|
41493
41530
|
width: 16,
|
|
41494
41531
|
height: 16
|
|
41495
41532
|
})
|
|
41496
|
-
})
|
|
41533
|
+
}))
|
|
41497
41534
|
})
|
|
41498
41535
|
})]
|
|
41499
|
-
}), input.meta
|
|
41536
|
+
}), (_input$meta17 = input.meta) !== null && _input$meta17 !== void 0 && _input$meta17.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41500
41537
|
className: "code",
|
|
41501
41538
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
41502
|
-
children: input.meta
|
|
41539
|
+
children: (_input$meta18 = input.meta) === null || _input$meta18 === void 0 ? void 0 : _input$meta18.code
|
|
41503
41540
|
})
|
|
41504
41541
|
}) : code ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41505
41542
|
className: "code",
|
|
41506
41543
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
41507
|
-
children:
|
|
41544
|
+
children: "".concat(code, ".").concat(i + 1)
|
|
41508
41545
|
})
|
|
41509
41546
|
}) : null]
|
|
41510
41547
|
})
|
|
@@ -41524,7 +41561,7 @@ const GetFormItem = ({
|
|
|
41524
41561
|
getAppHeader,
|
|
41525
41562
|
getApiBaseUrl
|
|
41526
41563
|
}) : console.log(input)
|
|
41527
|
-
})
|
|
41564
|
+
}))
|
|
41528
41565
|
}), alertError ? /*#__PURE__*/jsxRuntime.jsx(antd.Alert, {
|
|
41529
41566
|
message: alertError.message,
|
|
41530
41567
|
type: "error",
|
|
@@ -41553,10 +41590,10 @@ const GetFormItem = ({
|
|
|
41553
41590
|
className: "max-char-span",
|
|
41554
41591
|
children: t("max-char", {
|
|
41555
41592
|
chars: maxRule,
|
|
41556
|
-
filled: inputData
|
|
41593
|
+
filled: (inputData === null || inputData === void 0 || (_inputData$value = inputData.value) === null || _inputData$value === void 0 ? void 0 : _inputData$value.length) || 0
|
|
41557
41594
|
})
|
|
41558
41595
|
})
|
|
41559
|
-
}) : null, input.meta
|
|
41596
|
+
}) : null, (_input$meta19 = input.meta) !== null && _input$meta19 !== void 0 && _input$meta19.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
41560
41597
|
className: "input-content dynamic-form-comment",
|
|
41561
41598
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
41562
41599
|
className: "comment-textarea",
|
|
@@ -41582,7 +41619,7 @@ const GetFormItem = ({
|
|
|
41582
41619
|
},
|
|
41583
41620
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
41584
41621
|
type: "link",
|
|
41585
|
-
disabled: !input.meta
|
|
41622
|
+
disabled: !((_input$meta20 = input.meta) !== null && _input$meta20 !== void 0 && _input$meta20.comment),
|
|
41586
41623
|
className: "p-0",
|
|
41587
41624
|
children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
|
|
41588
41625
|
width: 16,
|
|
@@ -41613,7 +41650,7 @@ const GetFormItem = ({
|
|
|
41613
41650
|
className: "max-char-span",
|
|
41614
41651
|
children: t("max-char", {
|
|
41615
41652
|
chars: MAX_COMMENTS_LENGTH,
|
|
41616
|
-
filled: inputData
|
|
41653
|
+
filled: (inputData === null || inputData === void 0 || (_inputData$commentVal = inputData.commentValue) === null || _inputData$commentVal === void 0 ? void 0 : _inputData$commentVal.length) || 0
|
|
41617
41654
|
})
|
|
41618
41655
|
})]
|
|
41619
41656
|
}) : null]
|
|
@@ -41633,22 +41670,23 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
|
|
|
41633
41670
|
const formId = form.dataId || k;
|
|
41634
41671
|
const allInputs = Object.keys(form.inputs).filter(i => {
|
|
41635
41672
|
const input = form.inputs[i];
|
|
41636
|
-
return !excludedKeys.includes(i) && !input.excludeFromEdit && showHideInput(input, values, undefined, undefined, setValues,
|
|
41673
|
+
return !excludedKeys.includes(i) && !input.excludeFromEdit && showHideInput(input, values, undefined, undefined, setValues, "".concat(formId, ".").concat(i));
|
|
41637
41674
|
});
|
|
41638
41675
|
return allInputs.length ? /*#__PURE__*/jsxRuntime.jsxs(React__default["default"].Fragment, {
|
|
41639
41676
|
children: [getFormTitles(formTitles, formId, i), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(form.type) ? getInputHeadLines(form.type, i, form, values) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
41640
41677
|
children: [!form.repeatable ? /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
41641
|
-
className:
|
|
41678
|
+
className: "".concat(form.titleClass ? form.titleClass : 'title-semibold-4', " mb0 ").concat(i ? 'mt-3' : ''),
|
|
41642
41679
|
children: getInputLabel(form, values)
|
|
41643
41680
|
}) : !form.hideSectionLabel ? /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
41644
|
-
className:
|
|
41681
|
+
className: "".concat(form.titleClass ? form.titleClass : 'title-semibold-4', " mb0 ").concat(i ? 'mt-3' : ''),
|
|
41645
41682
|
children: form.sectionLabel ? getSectionLabel(form.sectionLabel, values) : form.label ? getInputLabel(form, values) : camelCaseToTitle(k)
|
|
41646
41683
|
}) : null, /*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
|
|
41647
41684
|
name: formId,
|
|
41648
|
-
children: (fields, {
|
|
41649
|
-
|
|
41650
|
-
|
|
41651
|
-
|
|
41685
|
+
children: (fields, _ref) => {
|
|
41686
|
+
let {
|
|
41687
|
+
add,
|
|
41688
|
+
remove
|
|
41689
|
+
} = _ref;
|
|
41652
41690
|
const formData = form.repeatable ? values[formId] || [] : values[formId] ? [values[formId]] : [];
|
|
41653
41691
|
if (fields.length === 0) {
|
|
41654
41692
|
const formInputs = form.inputs;
|
|
@@ -41699,7 +41737,7 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
|
|
|
41699
41737
|
padding: '0px 5px',
|
|
41700
41738
|
color: '#2E90FA'
|
|
41701
41739
|
},
|
|
41702
|
-
children:
|
|
41740
|
+
children: "#".concat(field.name + 1)
|
|
41703
41741
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41704
41742
|
className: "remove-button-for-repeatable",
|
|
41705
41743
|
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, {
|
|
@@ -41721,8 +41759,8 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
|
|
|
41721
41759
|
const inputId = input.dataId || inp;
|
|
41722
41760
|
const inputValues = Array.isArray(values[formId]) ? values[formId][field.name] || {} : values[formId] || {};
|
|
41723
41761
|
const value = inputValues[inputId];
|
|
41724
|
-
const commentValue = inputValues[
|
|
41725
|
-
const inputData = getData(formId, input, value, commentValue,
|
|
41762
|
+
const commentValue = inputValues["".concat(inputId, "Comment")];
|
|
41763
|
+
const inputData = getData(formId, input, value, commentValue, "".concat(formId, "[").concat(field.name, "].").concat(inputId), "".concat(formId, ".").concat(inputId));
|
|
41726
41764
|
const subtitles = form.subtitles || null;
|
|
41727
41765
|
inputData.repeatIndex = field.name;
|
|
41728
41766
|
inputData.inputName = inputId;
|
|
@@ -41743,64 +41781,59 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
|
|
|
41743
41781
|
message: requiredRule.message || ''
|
|
41744
41782
|
});
|
|
41745
41783
|
}
|
|
41746
|
-
return showHideInput(input, values, field.name, inputValues, setValues,
|
|
41784
|
+
return showHideInput(input, values, field.name, inputValues, setValues, "".concat(formId, "[").concat(field.name, "].").concat(inputId)) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
|
|
41747
41785
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
41748
|
-
className: form.repeatable ?
|
|
41786
|
+
className: form.repeatable ? "inputs" : "",
|
|
41749
41787
|
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, {
|
|
41750
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
41751
|
-
|
|
41752
|
-
|
|
41753
|
-
|
|
41754
|
-
|
|
41755
|
-
|
|
41756
|
-
|
|
41757
|
-
|
|
41758
|
-
|
|
41759
|
-
|
|
41760
|
-
|
|
41761
|
-
if (Array.isArray(e)) {
|
|
41762
|
-
return e;
|
|
41763
|
-
}
|
|
41764
|
-
return e && e.fileList && e.fileList.map(f => {
|
|
41765
|
-
if (f.response) {
|
|
41766
|
-
return f.response;
|
|
41767
|
-
}
|
|
41768
|
-
return f;
|
|
41769
|
-
});
|
|
41788
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, field), {}, {
|
|
41789
|
+
required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
|
|
41790
|
+
}, ['total100', 'group'].includes(input.type) ? {} : {
|
|
41791
|
+
name: [field.name, inputId],
|
|
41792
|
+
fieldKey: [field.fieldKey, inputId],
|
|
41793
|
+
initialValue: inputData.value
|
|
41794
|
+
}), ['upload'].includes(input.type) ? {
|
|
41795
|
+
valuePropName: "fileList",
|
|
41796
|
+
getValueFromEvent: e => {
|
|
41797
|
+
if (Array.isArray(e)) {
|
|
41798
|
+
return e;
|
|
41770
41799
|
}
|
|
41771
|
-
|
|
41800
|
+
return e && e.fileList && e.fileList.map(f => {
|
|
41801
|
+
if (f.response) {
|
|
41802
|
+
return f.response;
|
|
41803
|
+
}
|
|
41804
|
+
return f;
|
|
41805
|
+
});
|
|
41806
|
+
}
|
|
41807
|
+
} : {}), {}, {
|
|
41772
41808
|
style: input.showOnView === false ? {
|
|
41773
41809
|
display: 'none'
|
|
41774
|
-
} : {}
|
|
41775
|
-
|
|
41776
|
-
|
|
41777
|
-
|
|
41778
|
-
|
|
41779
|
-
|
|
41780
|
-
|
|
41781
|
-
|
|
41782
|
-
|
|
41783
|
-
|
|
41784
|
-
|
|
41785
|
-
|
|
41786
|
-
} : {}),
|
|
41810
|
+
} : {}
|
|
41811
|
+
}, ['switch'].includes(input.type) ? {
|
|
41812
|
+
labelCol: {
|
|
41813
|
+
span: 20
|
|
41814
|
+
},
|
|
41815
|
+
style: _objectSpread2(_objectSpread2({}, input.showOnView === false ? {
|
|
41816
|
+
display: 'none'
|
|
41817
|
+
} : {}), {}, {
|
|
41818
|
+
flexDirection: 'row',
|
|
41819
|
+
justifyContent: 'space-between'
|
|
41820
|
+
})
|
|
41821
|
+
} : {}), {}, {
|
|
41787
41822
|
label: getInputLabel(input, values),
|
|
41788
41823
|
rules: rules,
|
|
41789
|
-
className: input.comment ?
|
|
41824
|
+
className: input.comment ? "with-comment i-".concat(input.type) : "i-".concat(input.type),
|
|
41790
41825
|
extra: input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
41791
41826
|
disabled: inputData.props.disabled,
|
|
41792
41827
|
type: "link",
|
|
41793
41828
|
onClick: () => {
|
|
41794
41829
|
const inputValues = Array.isArray(values[formId]) ? values[formId][field.name] || {} : values[formId] || {};
|
|
41795
|
-
inputValues[
|
|
41830
|
+
inputValues["".concat(inputData.inputName, "Comment")] = !inputData.commentValue ? '' : undefined;
|
|
41796
41831
|
if (Array.isArray(values[formId])) {
|
|
41797
41832
|
values[formId][field.name] = inputValues;
|
|
41798
41833
|
} else {
|
|
41799
41834
|
values[formId] = inputValues;
|
|
41800
41835
|
}
|
|
41801
|
-
setValues({
|
|
41802
|
-
...values
|
|
41803
|
-
});
|
|
41836
|
+
setValues(_objectSpread2({}, values));
|
|
41804
41837
|
},
|
|
41805
41838
|
children: t(!inputData.commentValue ? 'Add Comment' : 'Remove Comment')
|
|
41806
41839
|
}) : null,
|
|
@@ -41817,9 +41850,9 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
|
|
|
41817
41850
|
getAppHeader,
|
|
41818
41851
|
getApiBaseUrl
|
|
41819
41852
|
}) : console.log(input)
|
|
41820
|
-
}), input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
41821
|
-
name: [field.name,
|
|
41822
|
-
fieldKey: [field.fieldKey,
|
|
41853
|
+
})), input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
41854
|
+
name: [field.name, "".concat(inputData.inputName, "Comment")],
|
|
41855
|
+
fieldKey: [field.fieldKey, "".concat(inputData.inputName, "Comment")],
|
|
41823
41856
|
initialValue: inputData.commentValue,
|
|
41824
41857
|
hidden: !inputData.commentValue,
|
|
41825
41858
|
children: inputTypeComponent.comment(inputData, {
|
|
@@ -41833,10 +41866,10 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
|
|
|
41833
41866
|
}) : null]
|
|
41834
41867
|
})]
|
|
41835
41868
|
}, ii)
|
|
41836
|
-
},
|
|
41869
|
+
}, "".concat(i).concat(ii)) : null;
|
|
41837
41870
|
})
|
|
41838
41871
|
})]
|
|
41839
|
-
},
|
|
41872
|
+
}, "".concat(formId, "-").concat(field.name))), form.repeatable ? /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
41840
41873
|
type: "dashed",
|
|
41841
41874
|
style: {
|
|
41842
41875
|
margin: '10px 0px 30px',
|
|
@@ -41865,7 +41898,7 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
|
|
|
41865
41898
|
const hasLabel = label && (typeof label === 'string' && (label || '').trim() !== '' || typeof label === 'object') ? true : false;
|
|
41866
41899
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
41867
41900
|
children: [hasLabel ? /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
41868
|
-
className:
|
|
41901
|
+
className: "".concat(form.titleClass ? form.titleClass : 'title-semibold-4', " ").concat(i ? 'mt-3 mb-1' : ''),
|
|
41869
41902
|
children: label
|
|
41870
41903
|
}) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41871
41904
|
className: hasLabel ? "mb-4" : "",
|
|
@@ -41874,8 +41907,8 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
|
|
|
41874
41907
|
const inputId = input.dataId || inp;
|
|
41875
41908
|
const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
|
|
41876
41909
|
const value = inputValues[inputId];
|
|
41877
|
-
const commentValue = inputValues[
|
|
41878
|
-
const inputData = getData(formId, input, value, commentValue,
|
|
41910
|
+
const commentValue = inputValues["".concat(inputId, "Comment")];
|
|
41911
|
+
const inputData = getData(formId, input, value, commentValue, "".concat(formId, ".").concat(inputId), "".concat(formId, ".").concat(inputId));
|
|
41879
41912
|
const subtitles = form.subtitles || null;
|
|
41880
41913
|
inputData.repeatIndex = undefined;
|
|
41881
41914
|
inputData.inputName = inputId;
|
|
@@ -41896,62 +41929,58 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
|
|
|
41896
41929
|
message: requiredRule.message || ''
|
|
41897
41930
|
});
|
|
41898
41931
|
}
|
|
41899
|
-
return showHideInput(input, values, undefined, inputValues, setValues,
|
|
41932
|
+
return showHideInput(input, values, undefined, inputValues, setValues, "".concat(formId, ".").concat(inputId)) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
|
|
41900
41933
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
41901
41934
|
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, {
|
|
41902
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
41903
|
-
required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
|
|
41904
|
-
|
|
41905
|
-
|
|
41906
|
-
|
|
41907
|
-
|
|
41908
|
-
|
|
41909
|
-
|
|
41910
|
-
|
|
41911
|
-
|
|
41912
|
-
|
|
41913
|
-
return e;
|
|
41914
|
-
}
|
|
41915
|
-
return e && e.fileList && e.fileList.map(f => {
|
|
41916
|
-
if (f.response) {
|
|
41917
|
-
return f.response;
|
|
41918
|
-
}
|
|
41919
|
-
return f;
|
|
41920
|
-
});
|
|
41935
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
41936
|
+
required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
|
|
41937
|
+
}, ['total100', 'group'].includes(input.type) ? {} : {
|
|
41938
|
+
name: [formId, inputId],
|
|
41939
|
+
fieldKey: [formId, inputId],
|
|
41940
|
+
initialValue: inputData.value
|
|
41941
|
+
}), ['upload'].includes(input.type) ? {
|
|
41942
|
+
valuePropName: "fileList",
|
|
41943
|
+
getValueFromEvent: e => {
|
|
41944
|
+
if (Array.isArray(e)) {
|
|
41945
|
+
return e;
|
|
41921
41946
|
}
|
|
41922
|
-
|
|
41947
|
+
return e && e.fileList && e.fileList.map(f => {
|
|
41948
|
+
if (f.response) {
|
|
41949
|
+
return f.response;
|
|
41950
|
+
}
|
|
41951
|
+
return f;
|
|
41952
|
+
});
|
|
41953
|
+
}
|
|
41954
|
+
} : {}), {}, {
|
|
41923
41955
|
style: input.showOnView === false ? {
|
|
41924
41956
|
display: 'none'
|
|
41925
|
-
} : {}
|
|
41926
|
-
|
|
41927
|
-
|
|
41928
|
-
|
|
41929
|
-
|
|
41930
|
-
|
|
41931
|
-
|
|
41932
|
-
|
|
41933
|
-
|
|
41934
|
-
|
|
41935
|
-
|
|
41936
|
-
|
|
41937
|
-
} : {}),
|
|
41957
|
+
} : {}
|
|
41958
|
+
}, ['switch'].includes(input.type) ? {
|
|
41959
|
+
labelCol: {
|
|
41960
|
+
span: 20
|
|
41961
|
+
},
|
|
41962
|
+
style: _objectSpread2(_objectSpread2({}, input.showOnView === false ? {
|
|
41963
|
+
display: 'none'
|
|
41964
|
+
} : {}), {}, {
|
|
41965
|
+
flexDirection: 'row',
|
|
41966
|
+
justifyContent: 'space-between'
|
|
41967
|
+
})
|
|
41968
|
+
} : {}), {}, {
|
|
41938
41969
|
label: getInputLabel(input, values),
|
|
41939
41970
|
rules: rules,
|
|
41940
|
-
className: input.comment ?
|
|
41971
|
+
className: input.comment ? "with-comment i-".concat(input.type) : "i-".concat(input.type),
|
|
41941
41972
|
extra: input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
41942
41973
|
disabled: inputData.props.disabled,
|
|
41943
41974
|
type: "link",
|
|
41944
41975
|
onClick: () => {
|
|
41945
41976
|
const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
|
|
41946
|
-
inputValues[
|
|
41977
|
+
inputValues["".concat(inputData.inputName, "Comment")] = !inputData.commentValue ? '' : undefined;
|
|
41947
41978
|
if (Array.isArray(values[formId])) {
|
|
41948
41979
|
values[formId] = inputValues;
|
|
41949
41980
|
} else {
|
|
41950
41981
|
values[formId] = inputValues;
|
|
41951
41982
|
}
|
|
41952
|
-
setValues({
|
|
41953
|
-
...values
|
|
41954
|
-
});
|
|
41983
|
+
setValues(_objectSpread2({}, values));
|
|
41955
41984
|
},
|
|
41956
41985
|
children: t(!inputData.commentValue ? 'Add Comment' : 'Remove Comment')
|
|
41957
41986
|
}) : null,
|
|
@@ -41966,9 +41995,9 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
|
|
|
41966
41995
|
getAppHeader,
|
|
41967
41996
|
getApiBaseUrl
|
|
41968
41997
|
}) : console.log(input)
|
|
41969
|
-
}), input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
41970
|
-
name: [formId,
|
|
41971
|
-
fieldKey: [formId,
|
|
41998
|
+
})), input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
41999
|
+
name: [formId, "".concat(inputData.inputName, "Comment")],
|
|
42000
|
+
fieldKey: [formId, "".concat(inputData.inputName, "Comment")],
|
|
41972
42001
|
initialValue: inputData.commentValue,
|
|
41973
42002
|
hidden: !inputData.commentValue,
|
|
41974
42003
|
children: inputTypeComponent.comment(inputData, {
|
|
@@ -41982,7 +42011,7 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
|
|
|
41982
42011
|
}) : null]
|
|
41983
42012
|
})]
|
|
41984
42013
|
}, ii)
|
|
41985
|
-
},
|
|
42014
|
+
}, "".concat(i).concat(ii)) : null;
|
|
41986
42015
|
})
|
|
41987
42016
|
})]
|
|
41988
42017
|
});
|
|
@@ -42021,10 +42050,7 @@ const useCombinedPrefilledValues = (combinedPrefilledValues, values, parentValue
|
|
|
42021
42050
|
}
|
|
42022
42051
|
});
|
|
42023
42052
|
if (hasChanges) {
|
|
42024
|
-
setValues(prevValues => ({
|
|
42025
|
-
...prevValues,
|
|
42026
|
-
...resolvedValues
|
|
42027
|
-
}));
|
|
42053
|
+
setValues(prevValues => _objectSpread2(_objectSpread2({}, prevValues), resolvedValues));
|
|
42028
42054
|
MainForm.setFieldsValue(resolvedValues);
|
|
42029
42055
|
}
|
|
42030
42056
|
}, [values, parentValues, combinedPrefilledValues, setValues, MainForm]);
|
|
@@ -59196,9 +59222,6 @@ function getAdminRoutes(config) {
|
|
|
59196
59222
|
userIsAdmin
|
|
59197
59223
|
} = config;
|
|
59198
59224
|
const APP_PREFIX = "APP_".concat(appName.toUpperCase());
|
|
59199
|
-
console.log({
|
|
59200
|
-
useAdminEventsConfig
|
|
59201
|
-
});
|
|
59202
59225
|
function DashboardWrapper() {
|
|
59203
59226
|
const dashboardConfig = useAdminDashboardConfig();
|
|
59204
59227
|
return /*#__PURE__*/jsxRuntime.jsx(AdminDashboardScreen, {
|