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