datastake-daf 0.6.841 → 0.6.842
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 +1254 -1163
- package/dist/pages/index.js +21 -20
- package/package.json +1 -1
- package/src/@daf/pages/Dashboards/SupplyChain/components/ChartsContainer/components/Locations/index.js +20 -19
- package/src/@daf/pages/Dashboards/SupplyChain/components/ChartsContainer/index.js +5 -2
- package/src/@daf/pages/Events/Activities/columns.js +7 -3
- package/src/@daf/pages/Events/Incidents/columns.js +7 -3
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,8 +24937,8 @@ const RepeatableModals = ({
|
|
|
24937
24937
|
}) : null;
|
|
24938
24938
|
};
|
|
24939
24939
|
|
|
24940
|
-
const _excluded$
|
|
24941
|
-
_excluded2$
|
|
24940
|
+
const _excluded$g = ["viewGroup"],
|
|
24941
|
+
_excluded2$1 = ["label", "icon", "position"];
|
|
24942
24942
|
const Content$1 = _ref => {
|
|
24943
24943
|
let {
|
|
24944
24944
|
style = {},
|
|
@@ -25009,7 +25009,7 @@ const Content$1 = _ref => {
|
|
|
25009
25009
|
if (groups[gKey].viewGroup === key) {
|
|
25010
25010
|
// eslint-disable-next-line no-unused-vars
|
|
25011
25011
|
const _groups$gKey = groups[gKey],
|
|
25012
|
-
gCfg = _objectWithoutProperties(_groups$gKey, _excluded$
|
|
25012
|
+
gCfg = _objectWithoutProperties(_groups$gKey, _excluded$g);
|
|
25013
25013
|
items[gKey] = gCfg;
|
|
25014
25014
|
}
|
|
25015
25015
|
return items;
|
|
@@ -25237,7 +25237,7 @@ const Content$1 = _ref => {
|
|
|
25237
25237
|
showIcon: true
|
|
25238
25238
|
});
|
|
25239
25239
|
}
|
|
25240
|
-
let groups = _objectWithoutProperties(f, _excluded2$
|
|
25240
|
+
let groups = _objectWithoutProperties(f, _excluded2$1);
|
|
25241
25241
|
groups = Object.keys(groups).reduce((items, key) => {
|
|
25242
25242
|
var _groups$key2;
|
|
25243
25243
|
if (!((_groups$key2 = groups[key]) !== null && _groups$key2 !== void 0 && (_groups$key2 = _groups$key2.meta) !== null && _groups$key2 !== void 0 && _groups$key2.excludeFromView)) {
|
|
@@ -25289,7 +25289,7 @@ const Content$1 = _ref => {
|
|
|
25289
25289
|
});
|
|
25290
25290
|
};
|
|
25291
25291
|
|
|
25292
|
-
const _excluded$
|
|
25292
|
+
const _excluded$f = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
|
|
25293
25293
|
function Modal(_ref) {
|
|
25294
25294
|
let {
|
|
25295
25295
|
t = text => text,
|
|
@@ -25305,7 +25305,7 @@ function Modal(_ref) {
|
|
|
25305
25305
|
disabled = false,
|
|
25306
25306
|
withModalFormWrapper = true
|
|
25307
25307
|
} = _ref,
|
|
25308
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
25308
|
+
props = _objectWithoutProperties(_ref, _excluded$f);
|
|
25309
25309
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Modal, _objectSpread2(_objectSpread2({
|
|
25310
25310
|
width: 650,
|
|
25311
25311
|
footer: null,
|
|
@@ -35952,13 +35952,11 @@ const beforeUpload = allowedExtensions => file => {
|
|
|
35952
35952
|
};
|
|
35953
35953
|
const allowedImageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.avif', '.bmp', '.tiff', '.tif', '.heif', '.heic', '.svg', '.ico'];
|
|
35954
35954
|
|
|
35955
|
-
|
|
35956
|
-
_excluded2$1 = ["label", "description", "excludeFromEdit", "showFormIf", "icon", "position", "template", "formClass"];
|
|
35955
|
+
/* eslint-disable no-case-declarations */
|
|
35957
35956
|
dayjs__default["default"].extend(utc);
|
|
35958
35957
|
dayjs__default["default"].extend(timezone);
|
|
35959
35958
|
dayjs__default["default"].tz.setDefault("UTC");
|
|
35960
|
-
const getDefaultInputValue =
|
|
35961
|
-
let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
35959
|
+
const getDefaultInputValue = (input = {}) => {
|
|
35962
35960
|
let value = undefined;
|
|
35963
35961
|
if (input.type === "multiselect") {
|
|
35964
35962
|
value = [];
|
|
@@ -35976,30 +35974,33 @@ const checkCondition$1 = (condition, repeatValues, formsValue) => {
|
|
|
35976
35974
|
const isShown = _checkValue(isNotEmpty ? field : wantedValue, match, isNotEmpty ? formValue : value);
|
|
35977
35975
|
return isShown;
|
|
35978
35976
|
};
|
|
35979
|
-
const renderDataLinkGroup =
|
|
35980
|
-
|
|
35981
|
-
|
|
35982
|
-
|
|
35983
|
-
|
|
35984
|
-
|
|
35985
|
-
|
|
35986
|
-
|
|
35987
|
-
|
|
35988
|
-
|
|
35989
|
-
|
|
35990
|
-
|
|
35991
|
-
|
|
35992
|
-
const
|
|
35993
|
-
|
|
35994
|
-
return (input === null || input === void 0 || (_input$inputs$k = input.inputs[k]) === null || _input$inputs$k === void 0 ? void 0 : _input$inputs$k.type) === "dataLink";
|
|
35995
|
-
});
|
|
35996
|
-
const dataLinkInput = ((input === null || input === void 0 ? void 0 : input.inputs) || {})[dataLinkKey];
|
|
35997
|
-
const otherInputs = Object.keys((input === null || input === void 0 ? void 0 : input.inputs) || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
|
|
35998
|
-
all[key] = input === null || input === void 0 ? void 0 : input.inputs[key];
|
|
35977
|
+
const renderDataLinkGroup = ({
|
|
35978
|
+
input,
|
|
35979
|
+
groupFormId,
|
|
35980
|
+
name,
|
|
35981
|
+
formsValue,
|
|
35982
|
+
form,
|
|
35983
|
+
onValuesChange,
|
|
35984
|
+
setValues,
|
|
35985
|
+
changeLinking,
|
|
35986
|
+
isHighlighted
|
|
35987
|
+
}) => {
|
|
35988
|
+
const dataLinkKey = Object.keys(input?.inputs || {}).find(k => input?.inputs[k]?.type === "dataLink");
|
|
35989
|
+
const dataLinkInput = (input?.inputs || {})[dataLinkKey];
|
|
35990
|
+
const otherInputs = Object.keys(input?.inputs || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
|
|
35991
|
+
all[key] = input?.inputs[key];
|
|
35999
35992
|
return all;
|
|
36000
35993
|
}, {});
|
|
36001
|
-
const isSingle =
|
|
36002
|
-
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [
|
|
35994
|
+
const isSingle = input?.meta?.maxRepeat === 1;
|
|
35995
|
+
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
|
|
35996
|
+
...(formsValue[groupFormId] || {})[name]
|
|
35997
|
+
}] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
|
|
35998
|
+
...v
|
|
35999
|
+
})) : isSingle ? formsValue[name] ? [{
|
|
36000
|
+
...formsValue[name]
|
|
36001
|
+
}] : [] : getArray(formsValue[name] || []).map(v => ({
|
|
36002
|
+
...v
|
|
36003
|
+
}));
|
|
36003
36004
|
const onUpdate = (val, i) => {
|
|
36004
36005
|
const _val = isSingle ? {
|
|
36005
36006
|
[name]: val
|
|
@@ -36007,20 +36008,31 @@ const renderDataLinkGroup = _ref2 => {
|
|
|
36007
36008
|
[name]: formData.map((d, j) => i === j ? val : d)
|
|
36008
36009
|
};
|
|
36009
36010
|
if (groupFormId) {
|
|
36010
|
-
const _defaultData =
|
|
36011
|
-
const _newData =
|
|
36012
|
-
|
|
36011
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36012
|
+
const _newData = {
|
|
36013
|
+
..._defaultData,
|
|
36014
|
+
..._val
|
|
36015
|
+
};
|
|
36016
|
+
onValuesChange(_newData, {
|
|
36017
|
+
...formsValue,
|
|
36013
36018
|
[groupFormId]: _newData
|
|
36014
|
-
})
|
|
36015
|
-
form
|
|
36016
|
-
setValues(
|
|
36019
|
+
});
|
|
36020
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36021
|
+
setValues({
|
|
36022
|
+
...formsValue,
|
|
36017
36023
|
[groupFormId]: _newData
|
|
36018
|
-
})
|
|
36024
|
+
});
|
|
36019
36025
|
return;
|
|
36020
36026
|
}
|
|
36021
|
-
onValuesChange(_val,
|
|
36022
|
-
|
|
36023
|
-
|
|
36027
|
+
onValuesChange(_val, {
|
|
36028
|
+
...formsValue,
|
|
36029
|
+
..._val
|
|
36030
|
+
});
|
|
36031
|
+
form?.setFieldValue(name, _val[name]);
|
|
36032
|
+
setValues({
|
|
36033
|
+
...formsValue,
|
|
36034
|
+
..._val
|
|
36035
|
+
});
|
|
36024
36036
|
};
|
|
36025
36037
|
return /*#__PURE__*/jsxRuntime.jsx(DataLinkGroup, {
|
|
36026
36038
|
form: input,
|
|
@@ -36031,79 +36043,102 @@ const renderDataLinkGroup = _ref2 => {
|
|
|
36031
36043
|
isHighlighted: isHighlighted,
|
|
36032
36044
|
dataLinkInput: dataLinkInput,
|
|
36033
36045
|
formsValue: formsValue,
|
|
36034
|
-
values: groupFormId ?
|
|
36046
|
+
values: groupFormId ? {
|
|
36047
|
+
...(formsValue[groupFormId] || {}),
|
|
36035
36048
|
meta: {
|
|
36036
|
-
inputs: (
|
|
36049
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
36037
36050
|
}
|
|
36038
|
-
}
|
|
36051
|
+
} : formsValue,
|
|
36039
36052
|
name: name,
|
|
36040
36053
|
groupFormId: groupFormId,
|
|
36041
|
-
maxRepeat: input
|
|
36042
|
-
remove:
|
|
36043
|
-
|
|
36044
|
-
|
|
36045
|
-
} = _ref3;
|
|
36054
|
+
maxRepeat: input?.meta?.maxRepeat,
|
|
36055
|
+
remove: ({
|
|
36056
|
+
key
|
|
36057
|
+
}) => {
|
|
36046
36058
|
const _val = isSingle ? {
|
|
36047
36059
|
[name]: null
|
|
36048
36060
|
} : {
|
|
36049
36061
|
[name]: formData.filter((v, j) => j !== key)
|
|
36050
36062
|
};
|
|
36051
36063
|
if (groupFormId) {
|
|
36052
|
-
const _defaultData =
|
|
36053
|
-
const _newData =
|
|
36054
|
-
|
|
36064
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36065
|
+
const _newData = {
|
|
36066
|
+
..._defaultData,
|
|
36067
|
+
..._val
|
|
36068
|
+
};
|
|
36069
|
+
onValuesChange(_newData, {
|
|
36070
|
+
...formsValue,
|
|
36055
36071
|
[groupFormId]: _newData
|
|
36056
|
-
})
|
|
36057
|
-
form
|
|
36058
|
-
setValues(
|
|
36072
|
+
});
|
|
36073
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36074
|
+
setValues({
|
|
36075
|
+
...formsValue,
|
|
36059
36076
|
[groupFormId]: _newData
|
|
36060
|
-
})
|
|
36077
|
+
});
|
|
36061
36078
|
return;
|
|
36062
36079
|
}
|
|
36063
|
-
onValuesChange(_val,
|
|
36064
|
-
|
|
36065
|
-
|
|
36080
|
+
onValuesChange(_val, {
|
|
36081
|
+
...formsValue,
|
|
36082
|
+
..._val
|
|
36083
|
+
});
|
|
36084
|
+
form?.setFieldValue(name, _val[name]);
|
|
36085
|
+
setValues({
|
|
36086
|
+
...formsValue,
|
|
36087
|
+
..._val
|
|
36088
|
+
});
|
|
36066
36089
|
},
|
|
36067
36090
|
add: val => {
|
|
36068
36091
|
const _val = isSingle ? {
|
|
36069
36092
|
[name]: val
|
|
36070
36093
|
} : {
|
|
36071
|
-
[name]: [...formData,
|
|
36094
|
+
[name]: [...formData, {
|
|
36095
|
+
...val
|
|
36096
|
+
}]
|
|
36072
36097
|
};
|
|
36073
36098
|
if (groupFormId) {
|
|
36074
|
-
const _defaultData =
|
|
36075
|
-
const _newData =
|
|
36076
|
-
|
|
36077
|
-
|
|
36099
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36100
|
+
const _newData = {
|
|
36101
|
+
..._defaultData,
|
|
36102
|
+
..._val
|
|
36103
|
+
};
|
|
36104
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36105
|
+
onValuesChange(_newData, {
|
|
36106
|
+
...formsValue,
|
|
36078
36107
|
[groupFormId]: _newData
|
|
36079
|
-
})
|
|
36080
|
-
setValues(
|
|
36108
|
+
});
|
|
36109
|
+
setValues({
|
|
36110
|
+
...formsValue,
|
|
36081
36111
|
[groupFormId]: _newData
|
|
36082
|
-
})
|
|
36112
|
+
});
|
|
36083
36113
|
return;
|
|
36084
36114
|
}
|
|
36085
|
-
form
|
|
36086
|
-
onValuesChange(_val,
|
|
36087
|
-
|
|
36115
|
+
form?.setFieldValue(name, _val[name]);
|
|
36116
|
+
onValuesChange(_val, {
|
|
36117
|
+
...formsValue,
|
|
36118
|
+
..._val
|
|
36119
|
+
});
|
|
36120
|
+
setValues({
|
|
36121
|
+
...formsValue,
|
|
36122
|
+
..._val
|
|
36123
|
+
});
|
|
36088
36124
|
},
|
|
36089
36125
|
k: name,
|
|
36090
36126
|
formData: formData
|
|
36091
36127
|
});
|
|
36092
36128
|
};
|
|
36093
36129
|
function showHideInput$1(input, data, repeatIndex, repeatValues, inputMeta) {
|
|
36094
|
-
|
|
36095
|
-
if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
|
|
36130
|
+
if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
|
|
36096
36131
|
return false;
|
|
36097
36132
|
}
|
|
36098
|
-
if (typeof
|
|
36099
|
-
|
|
36100
|
-
return !(input !== null && input !== void 0 && (_input$meta4 = input.meta) !== null && _input$meta4 !== void 0 && _input$meta4.excludeFromEdit);
|
|
36133
|
+
if (typeof input?.meta?.excludeFromEdit === "boolean") {
|
|
36134
|
+
return !input?.meta?.excludeFromEdit;
|
|
36101
36135
|
}
|
|
36102
|
-
const formsValue =
|
|
36103
|
-
|
|
36104
|
-
|
|
36105
|
-
|
|
36106
|
-
|
|
36136
|
+
const formsValue = {
|
|
36137
|
+
...data
|
|
36138
|
+
};
|
|
36139
|
+
Object.keys(data?.meta?.inputs || {}).forEach(key => {
|
|
36140
|
+
const input = data?.meta?.inputs[key];
|
|
36141
|
+
if (input?.notApplicable || input?.notAvailable) {
|
|
36107
36142
|
formsValue[key] = undefined;
|
|
36108
36143
|
delete formsValue[key];
|
|
36109
36144
|
}
|
|
@@ -36162,35 +36197,35 @@ function getInputHeadLines$1(type, i, input, values) {
|
|
|
36162
36197
|
switch (type) {
|
|
36163
36198
|
case "h2":
|
|
36164
36199
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36165
|
-
className:
|
|
36200
|
+
className: `title-semibold-2 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36166
36201
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36167
36202
|
children: getInputLabel$1(input, values)
|
|
36168
36203
|
})
|
|
36169
36204
|
});
|
|
36170
36205
|
case "h3":
|
|
36171
36206
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36172
|
-
className:
|
|
36207
|
+
className: `title-semibold-3 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36173
36208
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36174
36209
|
children: getInputLabel$1(input, values)
|
|
36175
36210
|
})
|
|
36176
36211
|
});
|
|
36177
36212
|
case "h4":
|
|
36178
36213
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36179
|
-
className:
|
|
36214
|
+
className: `title-semibold-4 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36180
36215
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36181
36216
|
children: getInputLabel$1(input, values)
|
|
36182
36217
|
})
|
|
36183
36218
|
});
|
|
36184
36219
|
case "h5":
|
|
36185
36220
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36186
|
-
className:
|
|
36221
|
+
className: `title-semibold-5 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36187
36222
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36188
36223
|
children: getInputLabel$1(input, values)
|
|
36189
36224
|
})
|
|
36190
36225
|
});
|
|
36191
36226
|
case "h6":
|
|
36192
36227
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36193
|
-
className:
|
|
36228
|
+
className: `title-semibold-6 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36194
36229
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36195
36230
|
children: getInputLabel$1(input, values)
|
|
36196
36231
|
})
|
|
@@ -36199,16 +36234,15 @@ function getInputHeadLines$1(type, i, input, values) {
|
|
|
36199
36234
|
return null;
|
|
36200
36235
|
}
|
|
36201
36236
|
}
|
|
36202
|
-
function getInputProp(prop) {
|
|
36203
|
-
let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
36204
|
-
let scope = arguments.length > 2 ? arguments[2] : undefined;
|
|
36237
|
+
function getInputProp(prop, formsValue = {}, scope) {
|
|
36205
36238
|
if (prop && typeof prop === "object") {
|
|
36206
36239
|
const validations = Object.keys(prop);
|
|
36207
36240
|
const key = validations.find(v => {
|
|
36208
36241
|
let [path, match, wantedValue] = v.split(/( is | includes | not | notEmpty )/gim);
|
|
36209
|
-
const value = dot__default["default"].pick(path,
|
|
36242
|
+
const value = dot__default["default"].pick(path, {
|
|
36243
|
+
...formsValue,
|
|
36210
36244
|
scope
|
|
36211
|
-
})
|
|
36245
|
+
});
|
|
36212
36246
|
return _checkValue(wantedValue, match, value);
|
|
36213
36247
|
});
|
|
36214
36248
|
const label = key ? prop[key] : prop[validations[0]];
|
|
@@ -36217,33 +36251,29 @@ function getInputProp(prop) {
|
|
|
36217
36251
|
return prop;
|
|
36218
36252
|
}
|
|
36219
36253
|
}
|
|
36220
|
-
function getInputLabel$1(input) {
|
|
36221
|
-
let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
36222
|
-
let asText = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
36254
|
+
function getInputLabel$1(input, formsValue = {}, asText = false) {
|
|
36223
36255
|
return /*#__PURE__*/jsxRuntime.jsx(InputLabel, {
|
|
36224
36256
|
input: input,
|
|
36225
36257
|
formsValue: formsValue,
|
|
36226
36258
|
asText: asText
|
|
36227
36259
|
});
|
|
36228
36260
|
}
|
|
36229
|
-
const InputLabel =
|
|
36230
|
-
|
|
36231
|
-
|
|
36232
|
-
|
|
36233
|
-
|
|
36234
|
-
asText
|
|
36235
|
-
} = _ref4;
|
|
36261
|
+
const InputLabel = ({
|
|
36262
|
+
input,
|
|
36263
|
+
formsValue,
|
|
36264
|
+
asText
|
|
36265
|
+
}) => {
|
|
36236
36266
|
const {
|
|
36237
36267
|
t,
|
|
36238
36268
|
evaluationConfig,
|
|
36239
36269
|
scope
|
|
36240
36270
|
} = useEditContext();
|
|
36241
36271
|
const label = getInputProp(input.label, formsValue, scope);
|
|
36242
|
-
return input
|
|
36272
|
+
return input?.meta?.isEvaluation || input.description && typeof input.description === "string" && !asText ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
36243
36273
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
36244
36274
|
className: "flex",
|
|
36245
36275
|
children: [ReactHtmlParser__default["default"](label), /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
|
|
36246
|
-
content: input
|
|
36276
|
+
content: input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(EvaluationPopover, {
|
|
36247
36277
|
t: t,
|
|
36248
36278
|
evaluationConfig: evaluationConfig
|
|
36249
36279
|
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -36251,7 +36281,7 @@ const InputLabel = _ref4 => {
|
|
|
36251
36281
|
children: ReactHtmlParser__default["default"](input.description)
|
|
36252
36282
|
}),
|
|
36253
36283
|
placement: "top",
|
|
36254
|
-
children: !
|
|
36284
|
+
children: !input?.meta?.isEvaluation || evaluationConfig.length > 0 ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36255
36285
|
className: "flex flex-column justify-content-center ml-1",
|
|
36256
36286
|
children: /*#__PURE__*/jsxRuntime.jsx(TooltipIcon, {
|
|
36257
36287
|
fontSize: 13
|
|
@@ -36273,9 +36303,7 @@ function getSectionLabel$1(labels, values) {
|
|
|
36273
36303
|
}
|
|
36274
36304
|
return labels;
|
|
36275
36305
|
}
|
|
36276
|
-
function getSubtitles$1(subtitles, position) {
|
|
36277
|
-
let formsValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
36278
|
-
let repeatValues = arguments.length > 4 ? arguments[4] : undefined;
|
|
36306
|
+
function getSubtitles$1(subtitles, position, formsValue = {}, repeatIndex, repeatValues) {
|
|
36279
36307
|
let subtitle = subtitles && subtitles[position];
|
|
36280
36308
|
if (subtitle && typeof subtitle === "object") {
|
|
36281
36309
|
let newSubtitle = subtitle.default || "";
|
|
@@ -36319,12 +36347,14 @@ function getSubtitles$1(subtitles, position) {
|
|
|
36319
36347
|
function getFormTitles$1(titles, key, position) {
|
|
36320
36348
|
let tilte = titles && titles[key];
|
|
36321
36349
|
return tilte ? /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
36322
|
-
className:
|
|
36350
|
+
className: `title-semibold-3 mb0 ${position ? "mt-3" : ""}`,
|
|
36323
36351
|
children: tilte
|
|
36324
36352
|
}) : null;
|
|
36325
36353
|
}
|
|
36326
36354
|
const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsValue, name, mainForm) => {
|
|
36327
|
-
formsValue = Object.assign(formsValue,
|
|
36355
|
+
formsValue = Object.assign(formsValue, {
|
|
36356
|
+
...mainForm.getFieldsValue(true)
|
|
36357
|
+
});
|
|
36328
36358
|
if (typeof repeatIndex === "number" && repeatValues) {
|
|
36329
36359
|
if (!repeatValues[inputName] || !___default["default"].isEqual(repeatValues[inputName], value)) {
|
|
36330
36360
|
repeatValues[inputName] = value;
|
|
@@ -36359,16 +36389,14 @@ const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsVa
|
|
|
36359
36389
|
};
|
|
36360
36390
|
const inputOnBlur = [];
|
|
36361
36391
|
const inputTypeComponent$1 = {
|
|
36362
|
-
text: (
|
|
36363
|
-
|
|
36364
|
-
|
|
36365
|
-
|
|
36366
|
-
|
|
36367
|
-
|
|
36368
|
-
|
|
36369
|
-
|
|
36370
|
-
isHighlighted
|
|
36371
|
-
} = _ref6;
|
|
36392
|
+
text: ({
|
|
36393
|
+
props,
|
|
36394
|
+
rules
|
|
36395
|
+
}, {
|
|
36396
|
+
inputMeta = {},
|
|
36397
|
+
t,
|
|
36398
|
+
isHighlighted
|
|
36399
|
+
}) => {
|
|
36372
36400
|
const maxRule = rules.find(r => r.max);
|
|
36373
36401
|
const maxProps = {
|
|
36374
36402
|
maxLength: MAX_TEXT_AREA_LENGTH
|
|
@@ -36376,28 +36404,26 @@ const inputTypeComponent$1 = {
|
|
|
36376
36404
|
if (maxRule) {
|
|
36377
36405
|
maxProps.maxLength = maxRule.max;
|
|
36378
36406
|
}
|
|
36379
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input,
|
|
36380
|
-
size: "large"
|
|
36381
|
-
|
|
36407
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
36408
|
+
size: "large",
|
|
36409
|
+
...maxProps,
|
|
36382
36410
|
allowClear: true,
|
|
36383
36411
|
autoComplete: "new-password",
|
|
36384
|
-
type: "text"
|
|
36385
|
-
|
|
36412
|
+
type: "text",
|
|
36413
|
+
...props,
|
|
36386
36414
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36387
36415
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36388
36416
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
36389
|
-
})
|
|
36417
|
+
});
|
|
36390
36418
|
},
|
|
36391
|
-
link: (
|
|
36392
|
-
|
|
36393
|
-
|
|
36394
|
-
|
|
36395
|
-
|
|
36396
|
-
|
|
36397
|
-
|
|
36398
|
-
|
|
36399
|
-
isHighlighted
|
|
36400
|
-
} = _ref8;
|
|
36419
|
+
link: ({
|
|
36420
|
+
props,
|
|
36421
|
+
rules
|
|
36422
|
+
}, {
|
|
36423
|
+
inputMeta = {},
|
|
36424
|
+
t,
|
|
36425
|
+
isHighlighted
|
|
36426
|
+
}) => {
|
|
36401
36427
|
const maxRule = rules.find(r => r.max);
|
|
36402
36428
|
const maxProps = {
|
|
36403
36429
|
maxLength: MAX_TEXT_AREA_LENGTH
|
|
@@ -36405,32 +36431,29 @@ const inputTypeComponent$1 = {
|
|
|
36405
36431
|
if (maxRule) {
|
|
36406
36432
|
maxProps.maxLength = maxRule.max;
|
|
36407
36433
|
}
|
|
36408
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input,
|
|
36409
|
-
size: "large"
|
|
36410
|
-
|
|
36434
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
36435
|
+
size: "large",
|
|
36436
|
+
...maxProps,
|
|
36411
36437
|
allowClear: true,
|
|
36412
36438
|
autoComplete: "new-password",
|
|
36413
|
-
type: "text"
|
|
36414
|
-
|
|
36439
|
+
type: "text",
|
|
36440
|
+
...props,
|
|
36415
36441
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36416
36442
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36417
36443
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
36418
|
-
})
|
|
36444
|
+
});
|
|
36419
36445
|
},
|
|
36420
|
-
number: (
|
|
36421
|
-
|
|
36422
|
-
|
|
36423
|
-
|
|
36424
|
-
|
|
36425
|
-
|
|
36426
|
-
|
|
36427
|
-
|
|
36428
|
-
|
|
36429
|
-
t,
|
|
36430
|
-
isHighlighted
|
|
36431
|
-
} = _ref10;
|
|
36446
|
+
number: ({
|
|
36447
|
+
props,
|
|
36448
|
+
rules,
|
|
36449
|
+
input
|
|
36450
|
+
}, {
|
|
36451
|
+
inputMeta = {},
|
|
36452
|
+
t,
|
|
36453
|
+
isHighlighted
|
|
36454
|
+
}) => {
|
|
36432
36455
|
const maxRule = rules.find(r => r.max);
|
|
36433
|
-
const integerRule = !
|
|
36456
|
+
const integerRule = !input?.meta?.isDecimal;
|
|
36434
36457
|
const parser = value => {
|
|
36435
36458
|
if (!value) {
|
|
36436
36459
|
return "";
|
|
@@ -36441,63 +36464,60 @@ const inputTypeComponent$1 = {
|
|
|
36441
36464
|
return value.replace(/\$\s?|(,*)/g, "");
|
|
36442
36465
|
};
|
|
36443
36466
|
if (maxRule) {
|
|
36444
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber,
|
|
36467
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
36445
36468
|
size: "large",
|
|
36446
36469
|
allowClear: true,
|
|
36447
|
-
autoComplete: "new-password"
|
|
36448
|
-
|
|
36470
|
+
autoComplete: "new-password",
|
|
36471
|
+
...props,
|
|
36449
36472
|
type: "number",
|
|
36450
36473
|
parser: parser,
|
|
36451
36474
|
min: 0,
|
|
36452
36475
|
max: maxRule.max,
|
|
36453
36476
|
className: formatClassname([isHighlighted && "highlighted-input"])
|
|
36454
|
-
})
|
|
36477
|
+
});
|
|
36455
36478
|
}
|
|
36456
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber,
|
|
36479
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
36457
36480
|
size: "large",
|
|
36458
36481
|
allowClear: true,
|
|
36459
36482
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36460
|
-
autoComplete: "new-password"
|
|
36461
|
-
|
|
36483
|
+
autoComplete: "new-password",
|
|
36484
|
+
...props,
|
|
36462
36485
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36463
36486
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
|
|
36464
36487
|
min: 0,
|
|
36465
36488
|
formatter: value => numberWithCommas$1(value),
|
|
36466
36489
|
parser: parser
|
|
36467
|
-
})
|
|
36490
|
+
});
|
|
36468
36491
|
},
|
|
36469
36492
|
// eslint-disable-next-line no-unused-vars
|
|
36470
|
-
select: (
|
|
36471
|
-
|
|
36472
|
-
|
|
36473
|
-
|
|
36474
|
-
|
|
36475
|
-
|
|
36476
|
-
|
|
36477
|
-
|
|
36478
|
-
|
|
36479
|
-
|
|
36480
|
-
|
|
36481
|
-
|
|
36482
|
-
|
|
36483
|
-
|
|
36484
|
-
|
|
36485
|
-
|
|
36486
|
-
|
|
36487
|
-
|
|
36488
|
-
|
|
36489
|
-
|
|
36490
|
-
|
|
36491
|
-
|
|
36492
|
-
|
|
36493
|
-
|
|
36494
|
-
|
|
36495
|
-
|
|
36496
|
-
changeInputMeta,
|
|
36497
|
-
groupFormId
|
|
36498
|
-
} = _ref12;
|
|
36493
|
+
select: ({
|
|
36494
|
+
value,
|
|
36495
|
+
options,
|
|
36496
|
+
optionGroup,
|
|
36497
|
+
props,
|
|
36498
|
+
formsValue,
|
|
36499
|
+
optionsFilter,
|
|
36500
|
+
filterCond,
|
|
36501
|
+
repeatValues,
|
|
36502
|
+
repeatIndex,
|
|
36503
|
+
name,
|
|
36504
|
+
inputName,
|
|
36505
|
+
address,
|
|
36506
|
+
addressData,
|
|
36507
|
+
input,
|
|
36508
|
+
scope
|
|
36509
|
+
}, {
|
|
36510
|
+
forms,
|
|
36511
|
+
form,
|
|
36512
|
+
setAddress,
|
|
36513
|
+
inputMeta = {},
|
|
36514
|
+
t,
|
|
36515
|
+
isHighlighted,
|
|
36516
|
+
changeInputMeta,
|
|
36517
|
+
groupFormId
|
|
36518
|
+
}) => {
|
|
36499
36519
|
let opts;
|
|
36500
|
-
const isEvaluation = input
|
|
36520
|
+
const isEvaluation = input?.meta?.isEvaluation;
|
|
36501
36521
|
let defaultValue = value;
|
|
36502
36522
|
if (typeof options === "string") {
|
|
36503
36523
|
const [formName, key] = options.split(".");
|
|
@@ -36522,7 +36542,7 @@ const inputTypeComponent$1 = {
|
|
|
36522
36542
|
opts = [];
|
|
36523
36543
|
}
|
|
36524
36544
|
} else {
|
|
36525
|
-
opts = options
|
|
36545
|
+
opts = options?.filter(o => !o.onlyView);
|
|
36526
36546
|
}
|
|
36527
36547
|
opts = JSON.parse(JSON.stringify(opts || []));
|
|
36528
36548
|
opts = opts.map(o => getSelectOptions$2(o, formsValue));
|
|
@@ -36532,7 +36552,7 @@ const inputTypeComponent$1 = {
|
|
|
36532
36552
|
const uniqueDefaultKeys = getUniqueDefaultKeys(options);
|
|
36533
36553
|
|
|
36534
36554
|
// Handle default value logic
|
|
36535
|
-
if (!propHasValue$1(value) && propHasValue$1(input
|
|
36555
|
+
if (!propHasValue$1(value) && propHasValue$1(input?.meta?.defaultValue)) {
|
|
36536
36556
|
// If no current value but there's a default value, use the default
|
|
36537
36557
|
value = input.meta.defaultValue;
|
|
36538
36558
|
defaultValue = value;
|
|
@@ -36565,7 +36585,7 @@ const inputTypeComponent$1 = {
|
|
|
36565
36585
|
}
|
|
36566
36586
|
opts = groupOptions;
|
|
36567
36587
|
}
|
|
36568
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select,
|
|
36588
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
36569
36589
|
size: "large",
|
|
36570
36590
|
autoComplete: "new-password",
|
|
36571
36591
|
allowClear: true,
|
|
@@ -36574,32 +36594,35 @@ const inputTypeComponent$1 = {
|
|
|
36574
36594
|
value: value // Use value instead of defaultValue for controlled behavior
|
|
36575
36595
|
,
|
|
36576
36596
|
filterOption: filterSelectOptions,
|
|
36577
|
-
optionFilterProp: "children"
|
|
36578
|
-
|
|
36597
|
+
optionFilterProp: "children",
|
|
36598
|
+
...props,
|
|
36579
36599
|
className: formatClassname([isHighlighted && "highlighted-select"]),
|
|
36580
36600
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36581
36601
|
placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select one option"),
|
|
36582
36602
|
onChange: (val, selectedValue) => {
|
|
36583
36603
|
// ONLY FOR SBG EVALUATON !!
|
|
36584
36604
|
if (isEvaluation && val === "na" && groupFormId) {
|
|
36585
|
-
var _formsValue$meta2;
|
|
36586
36605
|
changeInputMeta({
|
|
36587
36606
|
key: groupFormId,
|
|
36588
|
-
value:
|
|
36607
|
+
value: {
|
|
36608
|
+
...(formsValue?.meta?.inputs?.[groupFormId] || {}),
|
|
36589
36609
|
documentation: {
|
|
36590
36610
|
notApplicable: true
|
|
36591
36611
|
}
|
|
36592
|
-
}
|
|
36612
|
+
},
|
|
36593
36613
|
otherValues: {
|
|
36594
|
-
[groupFormId]:
|
|
36614
|
+
[groupFormId]: {
|
|
36615
|
+
...(formsValue?.[groupFormId] || {}),
|
|
36595
36616
|
[name]: val
|
|
36596
|
-
}
|
|
36617
|
+
}
|
|
36597
36618
|
}
|
|
36598
36619
|
});
|
|
36599
36620
|
}
|
|
36600
36621
|
if (address && selectedValue) {
|
|
36601
36622
|
dot__default["default"].str(address, selectedValue.children, addressData);
|
|
36602
|
-
setAddress(
|
|
36623
|
+
setAddress({
|
|
36624
|
+
...addressData
|
|
36625
|
+
});
|
|
36603
36626
|
}
|
|
36604
36627
|
if (props.onChange) {
|
|
36605
36628
|
props.onChange(val);
|
|
@@ -36630,15 +36653,15 @@ const inputTypeComponent$1 = {
|
|
|
36630
36653
|
if (og.disabled !== undefined) {
|
|
36631
36654
|
groupOtherProps.disabled = og.disabled;
|
|
36632
36655
|
}
|
|
36633
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36634
|
-
value: og.value
|
|
36635
|
-
|
|
36656
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36657
|
+
value: og.value,
|
|
36658
|
+
...groupOtherProps,
|
|
36636
36659
|
children: og.label
|
|
36637
|
-
}
|
|
36660
|
+
}, `${i}${j}`);
|
|
36638
36661
|
})
|
|
36639
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36640
|
-
value: option.value
|
|
36641
|
-
|
|
36662
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36663
|
+
value: option.value,
|
|
36664
|
+
...otherProps,
|
|
36642
36665
|
children: isEvaluation ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
36643
36666
|
className: "flex",
|
|
36644
36667
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -36646,35 +36669,33 @@ const inputTypeComponent$1 = {
|
|
|
36646
36669
|
children: sgbEvaluationIcons[option.value]
|
|
36647
36670
|
}), option.label]
|
|
36648
36671
|
}) : option.label
|
|
36649
|
-
}
|
|
36672
|
+
}, option.value);
|
|
36650
36673
|
})
|
|
36651
|
-
})
|
|
36674
|
+
});
|
|
36652
36675
|
},
|
|
36653
|
-
multiselect: (
|
|
36654
|
-
|
|
36655
|
-
|
|
36656
|
-
|
|
36657
|
-
|
|
36658
|
-
|
|
36659
|
-
|
|
36660
|
-
|
|
36661
|
-
|
|
36662
|
-
|
|
36663
|
-
|
|
36664
|
-
|
|
36665
|
-
|
|
36666
|
-
|
|
36667
|
-
|
|
36668
|
-
|
|
36669
|
-
|
|
36670
|
-
|
|
36671
|
-
|
|
36672
|
-
|
|
36673
|
-
|
|
36674
|
-
|
|
36675
|
-
|
|
36676
|
-
isHighlighted
|
|
36677
|
-
} = _ref14;
|
|
36676
|
+
multiselect: ({
|
|
36677
|
+
value,
|
|
36678
|
+
options,
|
|
36679
|
+
optionGroup,
|
|
36680
|
+
optionsFilter,
|
|
36681
|
+
filterCond,
|
|
36682
|
+
props,
|
|
36683
|
+
formsValue,
|
|
36684
|
+
repeatValues,
|
|
36685
|
+
repeatIndex,
|
|
36686
|
+
inputName,
|
|
36687
|
+
name,
|
|
36688
|
+
tags,
|
|
36689
|
+
maxWidth,
|
|
36690
|
+
staticWidth,
|
|
36691
|
+
fullWidth
|
|
36692
|
+
}, {
|
|
36693
|
+
forms,
|
|
36694
|
+
form,
|
|
36695
|
+
inputMeta = {},
|
|
36696
|
+
t,
|
|
36697
|
+
isHighlighted
|
|
36698
|
+
}) => {
|
|
36678
36699
|
let opts;
|
|
36679
36700
|
if (typeof options === "string") {
|
|
36680
36701
|
const [formName, key] = options.split(".");
|
|
@@ -36736,17 +36757,17 @@ const inputTypeComponent$1 = {
|
|
|
36736
36757
|
staticWidth,
|
|
36737
36758
|
fullWidth
|
|
36738
36759
|
});
|
|
36739
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select,
|
|
36760
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
36740
36761
|
size: "medium",
|
|
36741
36762
|
allowClear: true,
|
|
36742
36763
|
autoComplete: "new-password",
|
|
36743
36764
|
mode: tags ? "tags" : "multiple",
|
|
36744
|
-
optionFilterProp: "children"
|
|
36745
|
-
|
|
36746
|
-
|
|
36747
|
-
|
|
36748
|
-
filterOption: filterSelectOptions
|
|
36749
|
-
|
|
36765
|
+
optionFilterProp: "children",
|
|
36766
|
+
...(tags ? {
|
|
36767
|
+
tokenSeparators: [","]
|
|
36768
|
+
} : {}),
|
|
36769
|
+
filterOption: filterSelectOptions,
|
|
36770
|
+
...props,
|
|
36750
36771
|
className: formatClassname([isHighlighted && "highlighted-select"]),
|
|
36751
36772
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36752
36773
|
placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select all relevant options"),
|
|
@@ -36785,52 +36806,51 @@ const inputTypeComponent$1 = {
|
|
|
36785
36806
|
if (og.disabled !== undefined) {
|
|
36786
36807
|
groupOtherProps.disabled = og.disabled;
|
|
36787
36808
|
}
|
|
36788
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36789
|
-
value: og.value
|
|
36790
|
-
|
|
36809
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36810
|
+
value: og.value,
|
|
36811
|
+
...groupOtherProps,
|
|
36791
36812
|
children: og.label
|
|
36792
|
-
}
|
|
36813
|
+
}, `${i}${j}`);
|
|
36793
36814
|
})
|
|
36794
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36795
|
-
value: option.value
|
|
36796
|
-
|
|
36815
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36816
|
+
value: option.value,
|
|
36817
|
+
...otherProps,
|
|
36797
36818
|
children: option.label
|
|
36798
|
-
}
|
|
36819
|
+
}, i);
|
|
36799
36820
|
})
|
|
36800
|
-
})
|
|
36821
|
+
});
|
|
36801
36822
|
},
|
|
36802
|
-
date: (
|
|
36803
|
-
|
|
36804
|
-
|
|
36805
|
-
|
|
36806
|
-
|
|
36807
|
-
|
|
36808
|
-
|
|
36809
|
-
|
|
36810
|
-
|
|
36811
|
-
|
|
36812
|
-
|
|
36813
|
-
|
|
36814
|
-
|
|
36815
|
-
|
|
36816
|
-
isHighlighted,
|
|
36817
|
-
groupFormId
|
|
36818
|
-
} = _ref16;
|
|
36823
|
+
date: ({
|
|
36824
|
+
props,
|
|
36825
|
+
rules,
|
|
36826
|
+
repeatValues,
|
|
36827
|
+
formsValue,
|
|
36828
|
+
name
|
|
36829
|
+
}, {
|
|
36830
|
+
setFormValues,
|
|
36831
|
+
inputMeta,
|
|
36832
|
+
form,
|
|
36833
|
+
t,
|
|
36834
|
+
isHighlighted,
|
|
36835
|
+
groupFormId
|
|
36836
|
+
}) => {
|
|
36819
36837
|
const lng = localStorage.getItem("datastakeLng") || "en";
|
|
36820
36838
|
const maxRule = rules.find(r => r.max);
|
|
36821
|
-
let value = groupFormId ? formsValue
|
|
36839
|
+
let value = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue[name];
|
|
36822
36840
|
const handleDateChange = date => {
|
|
36823
36841
|
if (date) {
|
|
36824
36842
|
// const localDate = dayjs.utc(date).add(dayjs(date).utcOffset(), 'minutes');
|
|
36825
36843
|
const localDate = dayjs__default["default"].utc(date);
|
|
36826
36844
|
if (groupFormId) {
|
|
36827
|
-
const _new =
|
|
36845
|
+
const _new = {
|
|
36846
|
+
...(formsValue[groupFormId] || {}),
|
|
36828
36847
|
[name]: localDate
|
|
36829
|
-
}
|
|
36848
|
+
};
|
|
36830
36849
|
form.setFieldValue(groupFormId, _new);
|
|
36831
|
-
setFormValues(
|
|
36850
|
+
setFormValues({
|
|
36851
|
+
...formsValue,
|
|
36832
36852
|
[groupFormId]: _new
|
|
36833
|
-
})
|
|
36853
|
+
});
|
|
36834
36854
|
} else {
|
|
36835
36855
|
form.setFieldValue(name, localDate);
|
|
36836
36856
|
}
|
|
@@ -36839,13 +36859,15 @@ const inputTypeComponent$1 = {
|
|
|
36839
36859
|
if (groupFormId) {
|
|
36840
36860
|
if (typeof value === "string" || typeof value === "undefined") {
|
|
36841
36861
|
value = typeof value === "string" ? dayjs__default["default"].utc(value) : null;
|
|
36842
|
-
const _new =
|
|
36862
|
+
const _new = {
|
|
36863
|
+
...(formsValue[groupFormId] || {}),
|
|
36843
36864
|
[name]: value
|
|
36844
|
-
}
|
|
36865
|
+
};
|
|
36845
36866
|
form.setFieldValue(groupFormId, _new);
|
|
36846
|
-
setFormValues(
|
|
36867
|
+
setFormValues({
|
|
36868
|
+
...formsValue,
|
|
36847
36869
|
[groupFormId]: _new
|
|
36848
|
-
})
|
|
36870
|
+
});
|
|
36849
36871
|
}
|
|
36850
36872
|
} else {
|
|
36851
36873
|
if (typeof value === "string") {
|
|
@@ -36861,13 +36883,12 @@ const inputTypeComponent$1 = {
|
|
|
36861
36883
|
checkForMax = checkCondition$1(maxRule.condition, repeatValues, formsValue);
|
|
36862
36884
|
}
|
|
36863
36885
|
if (checkForMax) {
|
|
36864
|
-
|
|
36865
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
|
|
36886
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
36866
36887
|
size: "large",
|
|
36867
36888
|
allowClear: true,
|
|
36868
|
-
autoComplete: "new-password"
|
|
36869
|
-
|
|
36870
|
-
value: value ? dayjs__default["default"](
|
|
36889
|
+
autoComplete: "new-password",
|
|
36890
|
+
...props,
|
|
36891
|
+
value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
|
|
36871
36892
|
onChange: handleDateChange,
|
|
36872
36893
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36873
36894
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
@@ -36877,54 +36898,49 @@ const inputTypeComponent$1 = {
|
|
|
36877
36898
|
disabledDate: current => {
|
|
36878
36899
|
return current && current >= dayjs__default["default"]().endOf("day");
|
|
36879
36900
|
}
|
|
36880
|
-
})
|
|
36901
|
+
});
|
|
36881
36902
|
}
|
|
36882
36903
|
}
|
|
36883
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker,
|
|
36904
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
36884
36905
|
size: "large",
|
|
36885
36906
|
allowClear: true,
|
|
36886
|
-
autoComplete: "new-password"
|
|
36887
|
-
|
|
36888
|
-
value: value ? dayjs__default["default"](
|
|
36907
|
+
autoComplete: "new-password",
|
|
36908
|
+
...props,
|
|
36909
|
+
value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
|
|
36889
36910
|
onChange: handleDateChange,
|
|
36890
36911
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36891
36912
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36892
36913
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder,
|
|
36893
36914
|
format: DATE_FORMATS,
|
|
36894
36915
|
locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"]
|
|
36895
|
-
})
|
|
36916
|
+
});
|
|
36896
36917
|
},
|
|
36897
|
-
groupExpandable: (
|
|
36898
|
-
|
|
36899
|
-
|
|
36900
|
-
|
|
36901
|
-
|
|
36902
|
-
|
|
36903
|
-
|
|
36904
|
-
|
|
36905
|
-
groupFormId
|
|
36906
|
-
} = _ref18;
|
|
36907
|
-
const data = groupFormId ? formsValue === null || formsValue === void 0 || (_formsValue$groupForm2 = formsValue[groupFormId]) === null || _formsValue$groupForm2 === void 0 ? void 0 : _formsValue$groupForm2[name] : formsValue === null || formsValue === void 0 ? void 0 : formsValue[name];
|
|
36918
|
+
groupExpandable: ({
|
|
36919
|
+
formsValue,
|
|
36920
|
+
name,
|
|
36921
|
+
input
|
|
36922
|
+
}, {
|
|
36923
|
+
groupFormId
|
|
36924
|
+
}) => {
|
|
36925
|
+
const data = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue?.[name];
|
|
36908
36926
|
return /*#__PURE__*/jsxRuntime.jsx(GroupExpandable, {
|
|
36909
36927
|
input: input,
|
|
36910
36928
|
formsValue: formsValue,
|
|
36911
36929
|
data: data
|
|
36912
36930
|
});
|
|
36913
36931
|
},
|
|
36914
|
-
comment: (
|
|
36915
|
-
|
|
36916
|
-
|
|
36917
|
-
|
|
36918
|
-
|
|
36919
|
-
|
|
36920
|
-
|
|
36921
|
-
|
|
36922
|
-
|
|
36923
|
-
|
|
36924
|
-
|
|
36925
|
-
|
|
36926
|
-
} = _ref20;
|
|
36927
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
|
|
36932
|
+
comment: ({
|
|
36933
|
+
props: {
|
|
36934
|
+
placeholder,
|
|
36935
|
+
...props
|
|
36936
|
+
},
|
|
36937
|
+
commentHint
|
|
36938
|
+
}, {
|
|
36939
|
+
onChange,
|
|
36940
|
+
value,
|
|
36941
|
+
isHighlighted
|
|
36942
|
+
}) => {
|
|
36943
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
|
|
36928
36944
|
allowClear: true,
|
|
36929
36945
|
value: value,
|
|
36930
36946
|
onChange: e => onChange(e.target.value),
|
|
@@ -36935,27 +36951,26 @@ const inputTypeComponent$1 = {
|
|
|
36935
36951
|
autoSize: {
|
|
36936
36952
|
minRows: 5,
|
|
36937
36953
|
maxRows: 5
|
|
36938
|
-
}
|
|
36939
|
-
|
|
36954
|
+
},
|
|
36955
|
+
...props,
|
|
36940
36956
|
disabled: false
|
|
36941
|
-
})
|
|
36957
|
+
});
|
|
36942
36958
|
},
|
|
36943
|
-
tableComment: (
|
|
36944
|
-
|
|
36945
|
-
|
|
36946
|
-
|
|
36947
|
-
|
|
36948
|
-
|
|
36949
|
-
|
|
36950
|
-
|
|
36951
|
-
|
|
36952
|
-
|
|
36953
|
-
|
|
36954
|
-
|
|
36955
|
-
} = _ref22;
|
|
36956
|
-
const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => _objectSpread2(_objectSpread2({}, v), {}, {
|
|
36959
|
+
tableComment: ({
|
|
36960
|
+
setValues,
|
|
36961
|
+
name,
|
|
36962
|
+
onValuesChange,
|
|
36963
|
+
formsValue
|
|
36964
|
+
}, {
|
|
36965
|
+
form,
|
|
36966
|
+
groupFormId,
|
|
36967
|
+
isHighlighted
|
|
36968
|
+
}) => {
|
|
36969
|
+
const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => ({
|
|
36970
|
+
...v,
|
|
36957
36971
|
key: i
|
|
36958
|
-
})) : (formsValue[name] || []).map((v, i) =>
|
|
36972
|
+
})) : (formsValue[name] || []).map((v, i) => ({
|
|
36973
|
+
...v,
|
|
36959
36974
|
key: i
|
|
36960
36975
|
}));
|
|
36961
36976
|
const onUpdate = (val, i) => {
|
|
@@ -36963,89 +36978,121 @@ const inputTypeComponent$1 = {
|
|
|
36963
36978
|
[name]: formData.map((d, j) => i === j ? val : d)
|
|
36964
36979
|
};
|
|
36965
36980
|
if (groupFormId) {
|
|
36966
|
-
const _defaultData =
|
|
36967
|
-
const _newData =
|
|
36968
|
-
|
|
36981
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36982
|
+
const _newData = {
|
|
36983
|
+
..._defaultData,
|
|
36984
|
+
..._val
|
|
36985
|
+
};
|
|
36986
|
+
onValuesChange(_newData, {
|
|
36987
|
+
...formsValue,
|
|
36969
36988
|
[groupFormId]: _newData
|
|
36970
|
-
})
|
|
36971
|
-
form
|
|
36972
|
-
setValues(
|
|
36989
|
+
});
|
|
36990
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36991
|
+
setValues({
|
|
36992
|
+
...formsValue,
|
|
36973
36993
|
[groupFormId]: _newData
|
|
36974
|
-
})
|
|
36994
|
+
});
|
|
36975
36995
|
return;
|
|
36976
36996
|
}
|
|
36977
|
-
onValuesChange(_val,
|
|
36978
|
-
|
|
36979
|
-
|
|
36997
|
+
onValuesChange(_val, {
|
|
36998
|
+
...formsValue,
|
|
36999
|
+
..._val
|
|
37000
|
+
});
|
|
37001
|
+
form?.setFieldValue(name, _val[name]);
|
|
37002
|
+
setValues({
|
|
37003
|
+
...formsValue,
|
|
37004
|
+
..._val
|
|
37005
|
+
});
|
|
36980
37006
|
};
|
|
36981
37007
|
return /*#__PURE__*/jsxRuntime.jsx(Comment, {
|
|
36982
37008
|
onUpdate: onUpdate,
|
|
36983
37009
|
isHighlighted: isHighlighted,
|
|
36984
37010
|
form: form,
|
|
36985
|
-
values: groupFormId ?
|
|
37011
|
+
values: groupFormId ? {
|
|
37012
|
+
...(formsValue[groupFormId] || {}),
|
|
36986
37013
|
meta: {
|
|
36987
|
-
inputs: (
|
|
37014
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
36988
37015
|
}
|
|
36989
|
-
}
|
|
37016
|
+
} : formsValue,
|
|
36990
37017
|
name: name,
|
|
36991
|
-
remove:
|
|
36992
|
-
|
|
36993
|
-
|
|
36994
|
-
} = _ref23;
|
|
37018
|
+
remove: ({
|
|
37019
|
+
key
|
|
37020
|
+
}) => {
|
|
36995
37021
|
const _val = {
|
|
36996
37022
|
[name]: formData.filter(v => v.key !== key)
|
|
36997
37023
|
};
|
|
36998
37024
|
if (groupFormId) {
|
|
36999
|
-
const _defaultData =
|
|
37000
|
-
const _newData =
|
|
37001
|
-
|
|
37025
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
37026
|
+
const _newData = {
|
|
37027
|
+
..._defaultData,
|
|
37028
|
+
..._val
|
|
37029
|
+
};
|
|
37030
|
+
onValuesChange(_newData, {
|
|
37031
|
+
...formsValue,
|
|
37002
37032
|
[groupFormId]: _newData
|
|
37003
|
-
})
|
|
37004
|
-
form
|
|
37005
|
-
setValues(
|
|
37033
|
+
});
|
|
37034
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
37035
|
+
setValues({
|
|
37036
|
+
...formsValue,
|
|
37006
37037
|
[groupFormId]: _newData
|
|
37007
|
-
})
|
|
37038
|
+
});
|
|
37008
37039
|
return;
|
|
37009
37040
|
}
|
|
37010
|
-
onValuesChange(_val,
|
|
37011
|
-
|
|
37012
|
-
|
|
37041
|
+
onValuesChange(_val, {
|
|
37042
|
+
...formsValue,
|
|
37043
|
+
..._val
|
|
37044
|
+
});
|
|
37045
|
+
form?.setFieldValue(name, _val[name]);
|
|
37046
|
+
setValues({
|
|
37047
|
+
...formsValue,
|
|
37048
|
+
..._val
|
|
37049
|
+
});
|
|
37013
37050
|
},
|
|
37014
37051
|
add: val => {
|
|
37015
37052
|
const _val = {
|
|
37016
|
-
[name]: [...formData,
|
|
37053
|
+
[name]: [...formData, {
|
|
37054
|
+
...val,
|
|
37017
37055
|
key: formData.length
|
|
37018
|
-
}
|
|
37056
|
+
}]
|
|
37019
37057
|
};
|
|
37020
37058
|
if (groupFormId) {
|
|
37021
|
-
const _defaultData =
|
|
37022
|
-
const _newData =
|
|
37023
|
-
|
|
37024
|
-
|
|
37059
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
37060
|
+
const _newData = {
|
|
37061
|
+
..._defaultData,
|
|
37062
|
+
..._val
|
|
37063
|
+
};
|
|
37064
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
37065
|
+
onValuesChange(_newData, {
|
|
37066
|
+
...formsValue,
|
|
37025
37067
|
[groupFormId]: _newData
|
|
37026
|
-
})
|
|
37027
|
-
setValues(
|
|
37068
|
+
});
|
|
37069
|
+
setValues({
|
|
37070
|
+
...formsValue,
|
|
37028
37071
|
[groupFormId]: _newData
|
|
37029
|
-
})
|
|
37072
|
+
});
|
|
37030
37073
|
return;
|
|
37031
37074
|
}
|
|
37032
|
-
form
|
|
37033
|
-
onValuesChange(_val,
|
|
37034
|
-
|
|
37075
|
+
form?.setFieldValue(name, _val[name]);
|
|
37076
|
+
onValuesChange(_val, {
|
|
37077
|
+
...formsValue,
|
|
37078
|
+
..._val
|
|
37079
|
+
});
|
|
37080
|
+
setValues({
|
|
37081
|
+
...formsValue,
|
|
37082
|
+
..._val
|
|
37083
|
+
});
|
|
37035
37084
|
},
|
|
37036
37085
|
k: name
|
|
37037
37086
|
});
|
|
37038
37087
|
},
|
|
37039
|
-
textarea: (
|
|
37040
|
-
|
|
37041
|
-
|
|
37042
|
-
|
|
37043
|
-
|
|
37044
|
-
|
|
37045
|
-
|
|
37046
|
-
|
|
37047
|
-
isHighlighted
|
|
37048
|
-
} = _ref25;
|
|
37088
|
+
textarea: ({
|
|
37089
|
+
props,
|
|
37090
|
+
rules
|
|
37091
|
+
}, {
|
|
37092
|
+
inputMeta,
|
|
37093
|
+
t,
|
|
37094
|
+
isHighlighted
|
|
37095
|
+
}) => {
|
|
37049
37096
|
const maxRule = rules.find(r => r.max);
|
|
37050
37097
|
let maxLength = MAX_TEXT_AREA_LENGTH;
|
|
37051
37098
|
let rows = 5;
|
|
@@ -37072,7 +37119,7 @@ const inputTypeComponent$1 = {
|
|
|
37072
37119
|
// rows = 14;
|
|
37073
37120
|
// }
|
|
37074
37121
|
}
|
|
37075
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea,
|
|
37122
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
|
|
37076
37123
|
allowClear: true,
|
|
37077
37124
|
autoComplete: "new-password",
|
|
37078
37125
|
maxLength: maxLength,
|
|
@@ -37080,37 +37127,35 @@ const inputTypeComponent$1 = {
|
|
|
37080
37127
|
autoSize: {
|
|
37081
37128
|
minRows: rows,
|
|
37082
37129
|
maxRows: rows
|
|
37083
|
-
}
|
|
37084
|
-
|
|
37130
|
+
},
|
|
37131
|
+
...props,
|
|
37085
37132
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
37086
37133
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
37087
|
-
})
|
|
37134
|
+
});
|
|
37088
37135
|
},
|
|
37089
|
-
phoneNumber: (
|
|
37090
|
-
|
|
37091
|
-
|
|
37092
|
-
|
|
37093
|
-
|
|
37094
|
-
|
|
37095
|
-
|
|
37096
|
-
|
|
37097
|
-
|
|
37098
|
-
|
|
37099
|
-
|
|
37100
|
-
|
|
37101
|
-
|
|
37102
|
-
|
|
37103
|
-
|
|
37104
|
-
} = _ref27;
|
|
37105
|
-
return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, _objectSpread2(_objectSpread2({
|
|
37136
|
+
phoneNumber: ({
|
|
37137
|
+
name,
|
|
37138
|
+
inputName,
|
|
37139
|
+
props,
|
|
37140
|
+
value,
|
|
37141
|
+
repeatIndex,
|
|
37142
|
+
repeatValues,
|
|
37143
|
+
formsValue
|
|
37144
|
+
}, {
|
|
37145
|
+
setFormValues,
|
|
37146
|
+
inputMeta,
|
|
37147
|
+
t,
|
|
37148
|
+
isHighlighted
|
|
37149
|
+
}) => {
|
|
37150
|
+
return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, {
|
|
37106
37151
|
customSelectWidthPercentage: "20%",
|
|
37107
37152
|
t: t,
|
|
37108
37153
|
size: "large",
|
|
37109
37154
|
allowClear: true,
|
|
37110
|
-
country: formsValue
|
|
37155
|
+
country: formsValue?.country,
|
|
37111
37156
|
initialValue: value,
|
|
37112
|
-
name: name
|
|
37113
|
-
|
|
37157
|
+
name: name,
|
|
37158
|
+
...props,
|
|
37114
37159
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37115
37160
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
37116
37161
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type Number"),
|
|
@@ -37131,27 +37176,26 @@ const inputTypeComponent$1 = {
|
|
|
37131
37176
|
}
|
|
37132
37177
|
return val;
|
|
37133
37178
|
}
|
|
37134
|
-
})
|
|
37179
|
+
});
|
|
37135
37180
|
},
|
|
37136
|
-
switch: (
|
|
37137
|
-
|
|
37138
|
-
|
|
37139
|
-
|
|
37140
|
-
|
|
37141
|
-
|
|
37142
|
-
|
|
37143
|
-
|
|
37144
|
-
|
|
37145
|
-
|
|
37146
|
-
|
|
37147
|
-
|
|
37148
|
-
|
|
37149
|
-
|
|
37150
|
-
|
|
37151
|
-
|
|
37152
|
-
|
|
37153
|
-
|
|
37154
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
37181
|
+
switch: ({
|
|
37182
|
+
props,
|
|
37183
|
+
value,
|
|
37184
|
+
restricted,
|
|
37185
|
+
autocomplete,
|
|
37186
|
+
formsValue,
|
|
37187
|
+
repeatValues,
|
|
37188
|
+
repeatIndex,
|
|
37189
|
+
name,
|
|
37190
|
+
inputName,
|
|
37191
|
+
replace: replaceInput,
|
|
37192
|
+
unique
|
|
37193
|
+
}, {
|
|
37194
|
+
form,
|
|
37195
|
+
isHighlighted
|
|
37196
|
+
}) => {
|
|
37197
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, {
|
|
37198
|
+
...props,
|
|
37155
37199
|
size: "default",
|
|
37156
37200
|
defaultChecked: value || false,
|
|
37157
37201
|
checked: value || false,
|
|
@@ -37179,7 +37223,9 @@ const inputTypeComponent$1 = {
|
|
|
37179
37223
|
const [formName, replaceInputName] = replaceTo.split(".");
|
|
37180
37224
|
const replaceRepeatValues = replaceInputName ? dot__default["default"].pick(formName, formsValue) : undefined;
|
|
37181
37225
|
updateFormValues$1(undefined, replaceRepeatValues, replaceInputName, isChecked ? newId : undefined, formsValue, formName, form);
|
|
37182
|
-
formsValue = Object.assign(formsValue,
|
|
37226
|
+
formsValue = Object.assign(formsValue, {
|
|
37227
|
+
...form.getFieldsValue(true)
|
|
37228
|
+
});
|
|
37183
37229
|
if (oldId) {
|
|
37184
37230
|
const allRepeatValues = dot__default["default"].pick(name, formsValue);
|
|
37185
37231
|
if (allRepeatValues && Array.isArray(allRepeatValues)) {
|
|
@@ -37220,22 +37266,20 @@ const inputTypeComponent$1 = {
|
|
|
37220
37266
|
}
|
|
37221
37267
|
}
|
|
37222
37268
|
}
|
|
37223
|
-
})
|
|
37269
|
+
});
|
|
37224
37270
|
},
|
|
37225
|
-
radioGroup: (
|
|
37226
|
-
|
|
37227
|
-
|
|
37228
|
-
|
|
37229
|
-
|
|
37230
|
-
|
|
37231
|
-
|
|
37232
|
-
|
|
37233
|
-
isHighlighted
|
|
37234
|
-
} = _ref31;
|
|
37271
|
+
radioGroup: ({
|
|
37272
|
+
props,
|
|
37273
|
+
value,
|
|
37274
|
+
options,
|
|
37275
|
+
isRisk
|
|
37276
|
+
}, {
|
|
37277
|
+
isHighlighted
|
|
37278
|
+
}) => {
|
|
37235
37279
|
if (isRisk) {
|
|
37236
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group,
|
|
37237
|
-
value: value
|
|
37238
|
-
|
|
37280
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
|
|
37281
|
+
value: value,
|
|
37282
|
+
...props,
|
|
37239
37283
|
className: "is-risk-radio",
|
|
37240
37284
|
children: (options || []).map(o => {
|
|
37241
37285
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
|
|
@@ -37249,11 +37293,11 @@ const inputTypeComponent$1 = {
|
|
|
37249
37293
|
}) : null]
|
|
37250
37294
|
}, o.value);
|
|
37251
37295
|
})
|
|
37252
|
-
})
|
|
37296
|
+
});
|
|
37253
37297
|
}
|
|
37254
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group,
|
|
37255
|
-
value: value
|
|
37256
|
-
|
|
37298
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
|
|
37299
|
+
value: value,
|
|
37300
|
+
...props,
|
|
37257
37301
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37258
37302
|
children: (options || []).map(o => {
|
|
37259
37303
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
|
|
@@ -37267,20 +37311,18 @@ const inputTypeComponent$1 = {
|
|
|
37267
37311
|
}) : null]
|
|
37268
37312
|
}, o.value);
|
|
37269
37313
|
})
|
|
37270
|
-
})
|
|
37314
|
+
});
|
|
37271
37315
|
},
|
|
37272
|
-
checkboxGroup: (
|
|
37273
|
-
|
|
37274
|
-
|
|
37275
|
-
|
|
37276
|
-
|
|
37277
|
-
|
|
37278
|
-
|
|
37279
|
-
|
|
37280
|
-
|
|
37281
|
-
|
|
37282
|
-
value: value
|
|
37283
|
-
}, props), {}, {
|
|
37316
|
+
checkboxGroup: ({
|
|
37317
|
+
props,
|
|
37318
|
+
value,
|
|
37319
|
+
options
|
|
37320
|
+
}, {
|
|
37321
|
+
isHighlighted
|
|
37322
|
+
}) => {
|
|
37323
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, {
|
|
37324
|
+
value: value,
|
|
37325
|
+
...props,
|
|
37284
37326
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37285
37327
|
style: {
|
|
37286
37328
|
display: "grid",
|
|
@@ -37304,18 +37346,16 @@ const inputTypeComponent$1 = {
|
|
|
37304
37346
|
}) : null]
|
|
37305
37347
|
}, o.value);
|
|
37306
37348
|
})
|
|
37307
|
-
})
|
|
37349
|
+
});
|
|
37308
37350
|
},
|
|
37309
|
-
total100: (
|
|
37310
|
-
|
|
37311
|
-
|
|
37312
|
-
|
|
37313
|
-
|
|
37314
|
-
|
|
37315
|
-
|
|
37316
|
-
|
|
37317
|
-
isHighlighted
|
|
37318
|
-
} = _ref35;
|
|
37351
|
+
total100: ({
|
|
37352
|
+
props,
|
|
37353
|
+
name,
|
|
37354
|
+
options,
|
|
37355
|
+
value
|
|
37356
|
+
}, {
|
|
37357
|
+
isHighlighted
|
|
37358
|
+
}) => {
|
|
37319
37359
|
value = value ? Array.isArray(value) ? value : [value] : [];
|
|
37320
37360
|
function totalValue() {
|
|
37321
37361
|
let total = 0;
|
|
@@ -37339,11 +37379,10 @@ const inputTypeComponent$1 = {
|
|
|
37339
37379
|
className: formatClassname(["total100", isHighlighted && "highlighted-input"]),
|
|
37340
37380
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
|
|
37341
37381
|
name: name,
|
|
37342
|
-
children: (fields,
|
|
37343
|
-
|
|
37344
|
-
|
|
37345
|
-
|
|
37346
|
-
} = _ref36;
|
|
37382
|
+
children: (fields, {
|
|
37383
|
+
add,
|
|
37384
|
+
remove
|
|
37385
|
+
}) => {
|
|
37347
37386
|
if (fields.length === 0) {
|
|
37348
37387
|
const formData = value || [];
|
|
37349
37388
|
if (formData.length) {
|
|
@@ -37362,27 +37401,27 @@ const inputTypeComponent$1 = {
|
|
|
37362
37401
|
const v = value[field.name] || {};
|
|
37363
37402
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Space, {
|
|
37364
37403
|
className: "total",
|
|
37365
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item,
|
|
37366
|
-
noStyle: true
|
|
37367
|
-
|
|
37404
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
37405
|
+
noStyle: true,
|
|
37406
|
+
...field,
|
|
37368
37407
|
name: [field.name, "type"],
|
|
37369
37408
|
fieldKey: [field.fieldKey, "type"],
|
|
37370
37409
|
initialValue: v.type || null,
|
|
37371
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select,
|
|
37410
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
37372
37411
|
size: "large",
|
|
37373
37412
|
allowClear: true,
|
|
37374
37413
|
showSearch: true,
|
|
37375
37414
|
filterOption: filterSelectOptions,
|
|
37376
|
-
optionFilterProp: "children"
|
|
37377
|
-
|
|
37415
|
+
optionFilterProp: "children",
|
|
37416
|
+
...props,
|
|
37378
37417
|
children: options.map((option, i) => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
37379
37418
|
value: option.value,
|
|
37380
37419
|
children: option.label
|
|
37381
37420
|
}, i))
|
|
37382
|
-
})
|
|
37383
|
-
})
|
|
37384
|
-
noStyle: true
|
|
37385
|
-
|
|
37421
|
+
})
|
|
37422
|
+
}), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
37423
|
+
noStyle: true,
|
|
37424
|
+
...field,
|
|
37386
37425
|
name: [field.name, "value"],
|
|
37387
37426
|
fieldKey: [field.fieldKey, "value"],
|
|
37388
37427
|
initialValue: v.value,
|
|
@@ -37391,14 +37430,14 @@ const inputTypeComponent$1 = {
|
|
|
37391
37430
|
allowClear: true,
|
|
37392
37431
|
name: "value",
|
|
37393
37432
|
formatter: value => {
|
|
37394
|
-
return value ?
|
|
37433
|
+
return value ? `${value}%` : "";
|
|
37395
37434
|
},
|
|
37396
37435
|
disabled: !v.type || null,
|
|
37397
37436
|
placeholder: props.valueplaceholder ? props.valueplaceholder : "Value",
|
|
37398
37437
|
min: 1,
|
|
37399
37438
|
max: 100 - siblingTotal(v.type || 0)
|
|
37400
37439
|
})
|
|
37401
|
-
})
|
|
37440
|
+
}), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
37402
37441
|
disabled: !v.value || !v.type || totalValue() >= 100,
|
|
37403
37442
|
type: "primary",
|
|
37404
37443
|
icon: /*#__PURE__*/jsxRuntime.jsx(Icons.PlusOutlined, {}),
|
|
@@ -37430,22 +37469,19 @@ const inputTypeComponent$1 = {
|
|
|
37430
37469
|
}) : null]
|
|
37431
37470
|
});
|
|
37432
37471
|
},
|
|
37433
|
-
percentage: (
|
|
37434
|
-
|
|
37435
|
-
|
|
37436
|
-
|
|
37437
|
-
|
|
37438
|
-
|
|
37439
|
-
|
|
37440
|
-
|
|
37441
|
-
|
|
37442
|
-
|
|
37443
|
-
|
|
37444
|
-
|
|
37445
|
-
|
|
37446
|
-
t,
|
|
37447
|
-
isHighlighted
|
|
37448
|
-
} = _ref38;
|
|
37472
|
+
percentage: ({
|
|
37473
|
+
name,
|
|
37474
|
+
inputName,
|
|
37475
|
+
totalMax,
|
|
37476
|
+
repeatIndex,
|
|
37477
|
+
props,
|
|
37478
|
+
formsValue,
|
|
37479
|
+
input
|
|
37480
|
+
}, {
|
|
37481
|
+
inputMeta,
|
|
37482
|
+
t,
|
|
37483
|
+
isHighlighted
|
|
37484
|
+
}) => {
|
|
37449
37485
|
const isRepeatable = Array.isArray(formsValue[name]);
|
|
37450
37486
|
let totalSiblings = 0;
|
|
37451
37487
|
if (isRepeatable && totalMax) {
|
|
@@ -37453,47 +37489,45 @@ const inputTypeComponent$1 = {
|
|
|
37453
37489
|
totl = totl + (grp[inputName] || 0);
|
|
37454
37490
|
return totl;
|
|
37455
37491
|
}, 0);
|
|
37456
|
-
} else if (Array.isArray(input
|
|
37492
|
+
} else if (Array.isArray(input?.meta?.siblings)) {
|
|
37457
37493
|
totalSiblings = input.meta.siblings.reduce((totl, key) => {
|
|
37458
37494
|
totl = totl + (formsValue[key] || 0);
|
|
37459
37495
|
return totl;
|
|
37460
37496
|
}, 0);
|
|
37461
37497
|
}
|
|
37462
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber,
|
|
37498
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
37463
37499
|
size: "large",
|
|
37464
|
-
allowClear: true
|
|
37465
|
-
|
|
37500
|
+
allowClear: true,
|
|
37501
|
+
...props,
|
|
37466
37502
|
className: formatClassname([isHighlighted && "highlighted-cont"]),
|
|
37467
37503
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
37468
37504
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
|
|
37469
37505
|
min: 0,
|
|
37470
37506
|
max: 100 - totalSiblings,
|
|
37471
37507
|
formatter: value => {
|
|
37472
|
-
return value ?
|
|
37508
|
+
return value ? `${value}` : "";
|
|
37473
37509
|
},
|
|
37474
37510
|
parser: value => value.replace("%", ""),
|
|
37475
37511
|
addonAfter: "%"
|
|
37476
|
-
})
|
|
37512
|
+
});
|
|
37477
37513
|
},
|
|
37478
|
-
drawTerritory: (
|
|
37479
|
-
|
|
37480
|
-
|
|
37481
|
-
|
|
37482
|
-
|
|
37483
|
-
|
|
37484
|
-
|
|
37485
|
-
setFormValues
|
|
37486
|
-
} = _ref40;
|
|
37514
|
+
drawTerritory: ({
|
|
37515
|
+
formsValue,
|
|
37516
|
+
name,
|
|
37517
|
+
addressData
|
|
37518
|
+
}, {
|
|
37519
|
+
setFormValues
|
|
37520
|
+
}) => {
|
|
37487
37521
|
let search = formsValue.country;
|
|
37488
37522
|
if (addressData && addressData.address && Object.keys(addressData.address).length > 0) {
|
|
37489
37523
|
if (addressData.address.country) {
|
|
37490
37524
|
search = addressData.address.country;
|
|
37491
37525
|
}
|
|
37492
37526
|
if (addressData.address.level1) {
|
|
37493
|
-
search =
|
|
37527
|
+
search = `${addressData.address.level1}, ${addressData.address.country}`;
|
|
37494
37528
|
}
|
|
37495
37529
|
if (addressData.address.level2) {
|
|
37496
|
-
search =
|
|
37530
|
+
search = `${addressData.address.level2}, ${addressData.address.level1}, ${addressData.address.country}`;
|
|
37497
37531
|
}
|
|
37498
37532
|
} else {
|
|
37499
37533
|
const country = countriesList.countries[formsValue.country] || {};
|
|
@@ -37501,10 +37535,10 @@ const inputTypeComponent$1 = {
|
|
|
37501
37535
|
search = country.name;
|
|
37502
37536
|
}
|
|
37503
37537
|
if (formsValue.administrativeLevel1Name) {
|
|
37504
|
-
search =
|
|
37538
|
+
search = `${search} ${formsValue.administrativeLevel1Name}`;
|
|
37505
37539
|
}
|
|
37506
37540
|
if (formsValue.administrativeLevel2Name) {
|
|
37507
|
-
search =
|
|
37541
|
+
search = `${search} ${formsValue.administrativeLevel2Name}`;
|
|
37508
37542
|
}
|
|
37509
37543
|
}
|
|
37510
37544
|
return /*#__PURE__*/jsxRuntime.jsx(PolygonSelector, {
|
|
@@ -37516,36 +37550,32 @@ const inputTypeComponent$1 = {
|
|
|
37516
37550
|
searchValue: search
|
|
37517
37551
|
});
|
|
37518
37552
|
},
|
|
37519
|
-
year: (
|
|
37520
|
-
|
|
37521
|
-
|
|
37522
|
-
|
|
37523
|
-
|
|
37524
|
-
isHighlighted
|
|
37525
|
-
} = _ref42;
|
|
37553
|
+
year: ({
|
|
37554
|
+
props
|
|
37555
|
+
}, {
|
|
37556
|
+
isHighlighted
|
|
37557
|
+
}) => {
|
|
37526
37558
|
const lng = localStorage.getItem("datastakeLng") || "en";
|
|
37527
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker,
|
|
37559
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
37528
37560
|
size: "large",
|
|
37529
37561
|
allowClear: true,
|
|
37530
37562
|
locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
|
|
37531
|
-
picker: "year"
|
|
37532
|
-
|
|
37563
|
+
picker: "year",
|
|
37564
|
+
...props,
|
|
37533
37565
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37534
37566
|
format: "YYYY"
|
|
37535
|
-
})
|
|
37567
|
+
});
|
|
37536
37568
|
},
|
|
37537
|
-
upload: (
|
|
37538
|
-
|
|
37539
|
-
|
|
37540
|
-
|
|
37541
|
-
|
|
37542
|
-
|
|
37543
|
-
|
|
37544
|
-
|
|
37545
|
-
|
|
37546
|
-
|
|
37547
|
-
isHighlighted
|
|
37548
|
-
} = _ref44;
|
|
37569
|
+
upload: ({
|
|
37570
|
+
rules,
|
|
37571
|
+
value
|
|
37572
|
+
}, {
|
|
37573
|
+
setLoading = () => {},
|
|
37574
|
+
getApiBaseUrl,
|
|
37575
|
+
getAppHeader,
|
|
37576
|
+
t,
|
|
37577
|
+
isHighlighted
|
|
37578
|
+
}) => {
|
|
37549
37579
|
const apiURL = getApiBaseUrl();
|
|
37550
37580
|
const accept = rules.length ? rules.find(rule => Object.keys(rule).includes("accept")).accept || "*" : null;
|
|
37551
37581
|
const values = (Array.isArray(value) ? value : value && typeof value === "object" && value.fileList && Array.isArray(value.fileList) ? value.fileList.map(f => f.response).filter(f => f) : []) || [];
|
|
@@ -37558,12 +37588,13 @@ const inputTypeComponent$1 = {
|
|
|
37558
37588
|
maxProps.multiple = true;
|
|
37559
37589
|
}
|
|
37560
37590
|
}
|
|
37561
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload,
|
|
37591
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37592
|
+
...maxProps,
|
|
37562
37593
|
accept: accept,
|
|
37563
|
-
action:
|
|
37594
|
+
action: `${apiURL}/upload`,
|
|
37564
37595
|
beforeUpload: beforeUpload(allowedExtensions),
|
|
37565
37596
|
onChange: val => {
|
|
37566
|
-
if (val
|
|
37597
|
+
if (val?.file && typeof setLoading === "function") {
|
|
37567
37598
|
if (val.file.percent !== 100) {
|
|
37568
37599
|
setLoading(true);
|
|
37569
37600
|
} else {
|
|
@@ -37571,9 +37602,10 @@ const inputTypeComponent$1 = {
|
|
|
37571
37602
|
}
|
|
37572
37603
|
}
|
|
37573
37604
|
},
|
|
37574
|
-
headers:
|
|
37575
|
-
Authorization:
|
|
37576
|
-
|
|
37605
|
+
headers: {
|
|
37606
|
+
Authorization: `Bearer ${getToken()}`,
|
|
37607
|
+
...getAppHeader()
|
|
37608
|
+
},
|
|
37577
37609
|
defaultFileList: values,
|
|
37578
37610
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
37579
37611
|
style: {
|
|
@@ -37584,20 +37616,18 @@ const inputTypeComponent$1 = {
|
|
|
37584
37616
|
children: t("Upload")
|
|
37585
37617
|
})]
|
|
37586
37618
|
})
|
|
37587
|
-
})
|
|
37619
|
+
});
|
|
37588
37620
|
},
|
|
37589
|
-
imageUpload: (
|
|
37590
|
-
|
|
37591
|
-
|
|
37592
|
-
|
|
37593
|
-
|
|
37594
|
-
|
|
37595
|
-
|
|
37596
|
-
|
|
37597
|
-
|
|
37598
|
-
|
|
37599
|
-
isHighlighted
|
|
37600
|
-
} = _ref46;
|
|
37621
|
+
imageUpload: ({
|
|
37622
|
+
rules,
|
|
37623
|
+
value
|
|
37624
|
+
}, {
|
|
37625
|
+
setLoading = () => {},
|
|
37626
|
+
getApiBaseUrl,
|
|
37627
|
+
getAppHeader,
|
|
37628
|
+
t,
|
|
37629
|
+
isHighlighted
|
|
37630
|
+
}) => {
|
|
37601
37631
|
const apiURL = getApiBaseUrl();
|
|
37602
37632
|
const values = getImageUploadEditValue(value);
|
|
37603
37633
|
const maxRule = rules.find(r => r.max);
|
|
@@ -37608,18 +37638,17 @@ const inputTypeComponent$1 = {
|
|
|
37608
37638
|
maxProps.multiple = true;
|
|
37609
37639
|
}
|
|
37610
37640
|
}
|
|
37611
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload,
|
|
37612
|
-
beforeUpload: beforeUpload(allowedImageExtensions)
|
|
37613
|
-
|
|
37641
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37642
|
+
beforeUpload: beforeUpload(allowedImageExtensions),
|
|
37643
|
+
...maxProps,
|
|
37614
37644
|
accept: "image/*",
|
|
37615
37645
|
classList: !values || !values.length ? "empty" : "",
|
|
37616
37646
|
listType: "picture",
|
|
37617
|
-
action:
|
|
37647
|
+
action: `${apiURL}/upload`,
|
|
37618
37648
|
onChange: val => {
|
|
37619
37649
|
if (typeof setLoading === "function") {
|
|
37620
|
-
if (val
|
|
37621
|
-
|
|
37622
|
-
if ((val === null || val === void 0 || (_val$file = val.file) === null || _val$file === void 0 ? void 0 : _val$file.status) === "removed") {
|
|
37650
|
+
if (val?.file) {
|
|
37651
|
+
if (val?.file?.status === "removed") {
|
|
37623
37652
|
setLoading(false);
|
|
37624
37653
|
return;
|
|
37625
37654
|
}
|
|
@@ -37631,9 +37660,10 @@ const inputTypeComponent$1 = {
|
|
|
37631
37660
|
setLoading(false);
|
|
37632
37661
|
}
|
|
37633
37662
|
},
|
|
37634
|
-
headers:
|
|
37635
|
-
Authorization:
|
|
37636
|
-
|
|
37663
|
+
headers: {
|
|
37664
|
+
Authorization: `Bearer ${getToken()}`,
|
|
37665
|
+
...getAppHeader()
|
|
37666
|
+
},
|
|
37637
37667
|
defaultFileList: values,
|
|
37638
37668
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
37639
37669
|
style: {
|
|
@@ -37644,20 +37674,18 @@ const inputTypeComponent$1 = {
|
|
|
37644
37674
|
children: t("Upload")
|
|
37645
37675
|
})]
|
|
37646
37676
|
})
|
|
37647
|
-
})
|
|
37677
|
+
});
|
|
37648
37678
|
},
|
|
37649
|
-
videoUpload: (
|
|
37650
|
-
|
|
37651
|
-
|
|
37652
|
-
|
|
37653
|
-
|
|
37654
|
-
|
|
37655
|
-
|
|
37656
|
-
|
|
37657
|
-
|
|
37658
|
-
|
|
37659
|
-
isHighlighted
|
|
37660
|
-
} = _ref48;
|
|
37679
|
+
videoUpload: ({
|
|
37680
|
+
rules,
|
|
37681
|
+
value
|
|
37682
|
+
}, {
|
|
37683
|
+
setLoading = () => {},
|
|
37684
|
+
getApiBaseUrl,
|
|
37685
|
+
getAppHeader,
|
|
37686
|
+
t,
|
|
37687
|
+
isHighlighted
|
|
37688
|
+
}) => {
|
|
37661
37689
|
const apiURL = getApiBaseUrl();
|
|
37662
37690
|
const values = getImageUploadEditValue(value);
|
|
37663
37691
|
const maxRule = rules.find(r => r.max);
|
|
@@ -37668,25 +37696,21 @@ const inputTypeComponent$1 = {
|
|
|
37668
37696
|
maxProps.multiple = true;
|
|
37669
37697
|
}
|
|
37670
37698
|
}
|
|
37671
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload,
|
|
37672
|
-
itemRender: (item, fileList) => {
|
|
37673
|
-
|
|
37674
|
-
|
|
37675
|
-
|
|
37676
|
-
|
|
37677
|
-
|
|
37678
|
-
});
|
|
37679
|
-
}
|
|
37680
|
-
}, maxProps), {}, {
|
|
37699
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37700
|
+
itemRender: (item, fileList) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
37701
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
|
|
37702
|
+
url: fileList?.response?.url || fileList?.url
|
|
37703
|
+
}), item]
|
|
37704
|
+
}),
|
|
37705
|
+
...maxProps,
|
|
37681
37706
|
accept: "video/*",
|
|
37682
37707
|
classList: !values || !values.length ? "empty" : "",
|
|
37683
37708
|
listType: "picture",
|
|
37684
|
-
action:
|
|
37709
|
+
action: `${apiURL}/upload`,
|
|
37685
37710
|
onChange: val => {
|
|
37686
37711
|
if (typeof setLoading === "function") {
|
|
37687
|
-
if (val
|
|
37688
|
-
|
|
37689
|
-
if ((val === null || val === void 0 || (_val$file2 = val.file) === null || _val$file2 === void 0 ? void 0 : _val$file2.status) === "removed") {
|
|
37712
|
+
if (val?.file) {
|
|
37713
|
+
if (val?.file?.status === "removed") {
|
|
37690
37714
|
setLoading(false);
|
|
37691
37715
|
return;
|
|
37692
37716
|
}
|
|
@@ -37698,9 +37722,10 @@ const inputTypeComponent$1 = {
|
|
|
37698
37722
|
setLoading(false);
|
|
37699
37723
|
}
|
|
37700
37724
|
},
|
|
37701
|
-
headers:
|
|
37702
|
-
Authorization:
|
|
37703
|
-
|
|
37725
|
+
headers: {
|
|
37726
|
+
Authorization: `Bearer ${getToken()}`,
|
|
37727
|
+
...getAppHeader()
|
|
37728
|
+
},
|
|
37704
37729
|
fileList: values,
|
|
37705
37730
|
defaultFileList: values,
|
|
37706
37731
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
@@ -37712,30 +37737,28 @@ const inputTypeComponent$1 = {
|
|
|
37712
37737
|
children: t("Upload")
|
|
37713
37738
|
})]
|
|
37714
37739
|
})
|
|
37715
|
-
})
|
|
37740
|
+
});
|
|
37716
37741
|
},
|
|
37717
|
-
geolocation: (
|
|
37718
|
-
|
|
37719
|
-
|
|
37720
|
-
|
|
37721
|
-
|
|
37722
|
-
|
|
37723
|
-
|
|
37724
|
-
|
|
37725
|
-
|
|
37726
|
-
|
|
37727
|
-
isHighlighted
|
|
37728
|
-
} = _ref50;
|
|
37742
|
+
geolocation: ({
|
|
37743
|
+
value,
|
|
37744
|
+
name,
|
|
37745
|
+
props,
|
|
37746
|
+
formsValue,
|
|
37747
|
+
addressData
|
|
37748
|
+
}, {
|
|
37749
|
+
inputMeta,
|
|
37750
|
+
isHighlighted
|
|
37751
|
+
}) => {
|
|
37729
37752
|
let search = formsValue.country;
|
|
37730
37753
|
if (addressData && Object.keys(addressData).length > 0) {
|
|
37731
37754
|
if (addressData.country) {
|
|
37732
37755
|
search = addressData.country;
|
|
37733
37756
|
}
|
|
37734
37757
|
if (addressData.level1) {
|
|
37735
|
-
search =
|
|
37758
|
+
search = `${addressData.level1}, ${addressData.country}`;
|
|
37736
37759
|
}
|
|
37737
37760
|
if (addressData.level2) {
|
|
37738
|
-
search =
|
|
37761
|
+
search = `${addressData.level2}, ${addressData.level1}, ${addressData.country}`;
|
|
37739
37762
|
}
|
|
37740
37763
|
} else {
|
|
37741
37764
|
const country = countriesList.countries[formsValue.country] || {};
|
|
@@ -37743,10 +37766,10 @@ const inputTypeComponent$1 = {
|
|
|
37743
37766
|
search = country.name;
|
|
37744
37767
|
}
|
|
37745
37768
|
if (formsValue.administrativeLevel1Name) {
|
|
37746
|
-
search =
|
|
37769
|
+
search = `${search} ${formsValue.administrativeLevel1Name}`;
|
|
37747
37770
|
}
|
|
37748
37771
|
if (formsValue.administrativeLevel2Name) {
|
|
37749
|
-
search =
|
|
37772
|
+
search = `${search} ${formsValue.administrativeLevel2Name}`;
|
|
37750
37773
|
}
|
|
37751
37774
|
}
|
|
37752
37775
|
return /*#__PURE__*/jsxRuntime.jsx(Geolocation, {
|
|
@@ -37760,36 +37783,34 @@ const inputTypeComponent$1 = {
|
|
|
37760
37783
|
searchValue: search
|
|
37761
37784
|
});
|
|
37762
37785
|
},
|
|
37763
|
-
ajaxSelect: (
|
|
37764
|
-
|
|
37765
|
-
|
|
37766
|
-
|
|
37767
|
-
|
|
37768
|
-
|
|
37769
|
-
|
|
37770
|
-
|
|
37771
|
-
|
|
37772
|
-
|
|
37773
|
-
|
|
37774
|
-
|
|
37775
|
-
|
|
37776
|
-
|
|
37777
|
-
|
|
37778
|
-
|
|
37779
|
-
|
|
37780
|
-
|
|
37781
|
-
|
|
37782
|
-
|
|
37783
|
-
|
|
37784
|
-
|
|
37785
|
-
|
|
37786
|
-
|
|
37787
|
-
|
|
37788
|
-
|
|
37789
|
-
|
|
37790
|
-
|
|
37791
|
-
groupFormId
|
|
37792
|
-
} = _ref52;
|
|
37786
|
+
ajaxSelect: ({
|
|
37787
|
+
call,
|
|
37788
|
+
automaticallyLink,
|
|
37789
|
+
name,
|
|
37790
|
+
inputName,
|
|
37791
|
+
props,
|
|
37792
|
+
formsValue,
|
|
37793
|
+
onNewSetValue,
|
|
37794
|
+
multiple,
|
|
37795
|
+
updateOptions,
|
|
37796
|
+
repeatValues,
|
|
37797
|
+
repeatIndex,
|
|
37798
|
+
value,
|
|
37799
|
+
unique,
|
|
37800
|
+
address,
|
|
37801
|
+
addressData = {},
|
|
37802
|
+
getFromLinking,
|
|
37803
|
+
input
|
|
37804
|
+
}, {
|
|
37805
|
+
form,
|
|
37806
|
+
forms,
|
|
37807
|
+
setAddress,
|
|
37808
|
+
changeInputMeta,
|
|
37809
|
+
inputMeta,
|
|
37810
|
+
meta,
|
|
37811
|
+
isHighlighted,
|
|
37812
|
+
groupFormId
|
|
37813
|
+
}) => {
|
|
37793
37814
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect, {
|
|
37794
37815
|
size: "medium",
|
|
37795
37816
|
input: input,
|
|
@@ -37826,7 +37847,9 @@ const inputTypeComponent$1 = {
|
|
|
37826
37847
|
const selectedValue = data.find(v => v.value === ev);
|
|
37827
37848
|
if (address && selectedValue) {
|
|
37828
37849
|
dot__default["default"].str(address, selectedValue.label, addressData);
|
|
37829
|
-
setAddress(
|
|
37850
|
+
setAddress({
|
|
37851
|
+
...addressData
|
|
37852
|
+
});
|
|
37830
37853
|
}
|
|
37831
37854
|
}
|
|
37832
37855
|
},
|
|
@@ -37835,11 +37858,10 @@ const inputTypeComponent$1 = {
|
|
|
37835
37858
|
address: true
|
|
37836
37859
|
});
|
|
37837
37860
|
},
|
|
37838
|
-
tag:
|
|
37839
|
-
|
|
37840
|
-
|
|
37841
|
-
|
|
37842
|
-
} = _ref53;
|
|
37861
|
+
tag: ({
|
|
37862
|
+
value,
|
|
37863
|
+
repeatLabel
|
|
37864
|
+
}) => {
|
|
37843
37865
|
return /*#__PURE__*/jsxRuntime.jsx(TagInput, {
|
|
37844
37866
|
size: "large",
|
|
37845
37867
|
allowClear: true,
|
|
@@ -37847,28 +37869,26 @@ const inputTypeComponent$1 = {
|
|
|
37847
37869
|
newPlaceholder: repeatLabel
|
|
37848
37870
|
});
|
|
37849
37871
|
},
|
|
37850
|
-
modal: (
|
|
37851
|
-
|
|
37852
|
-
|
|
37853
|
-
|
|
37854
|
-
|
|
37855
|
-
|
|
37856
|
-
|
|
37857
|
-
|
|
37858
|
-
|
|
37859
|
-
|
|
37860
|
-
|
|
37861
|
-
|
|
37862
|
-
|
|
37863
|
-
|
|
37864
|
-
|
|
37865
|
-
|
|
37866
|
-
|
|
37867
|
-
|
|
37868
|
-
|
|
37869
|
-
|
|
37870
|
-
add
|
|
37871
|
-
} = _ref55;
|
|
37872
|
+
modal: ({
|
|
37873
|
+
call,
|
|
37874
|
+
automaticallyLink,
|
|
37875
|
+
name,
|
|
37876
|
+
inputName,
|
|
37877
|
+
props,
|
|
37878
|
+
formsValue,
|
|
37879
|
+
allFormsValue,
|
|
37880
|
+
onNewSetValue,
|
|
37881
|
+
repeatValues,
|
|
37882
|
+
repeatIndex,
|
|
37883
|
+
value,
|
|
37884
|
+
modalTitle,
|
|
37885
|
+
totalInputs,
|
|
37886
|
+
shownInputs,
|
|
37887
|
+
allowDupplicates
|
|
37888
|
+
}, {
|
|
37889
|
+
form,
|
|
37890
|
+
add
|
|
37891
|
+
}) => {
|
|
37872
37892
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxModal, {
|
|
37873
37893
|
allowClear: true,
|
|
37874
37894
|
call: call,
|
|
@@ -37891,44 +37911,40 @@ const inputTypeComponent$1 = {
|
|
|
37891
37911
|
allowDupplicates: allowDupplicates
|
|
37892
37912
|
});
|
|
37893
37913
|
},
|
|
37894
|
-
dataLink: (
|
|
37895
|
-
|
|
37896
|
-
|
|
37897
|
-
|
|
37898
|
-
|
|
37899
|
-
|
|
37900
|
-
|
|
37901
|
-
|
|
37902
|
-
|
|
37903
|
-
|
|
37904
|
-
|
|
37905
|
-
|
|
37906
|
-
|
|
37907
|
-
|
|
37908
|
-
|
|
37909
|
-
|
|
37910
|
-
|
|
37911
|
-
|
|
37912
|
-
|
|
37913
|
-
|
|
37914
|
-
|
|
37915
|
-
|
|
37916
|
-
|
|
37917
|
-
|
|
37918
|
-
|
|
37919
|
-
|
|
37920
|
-
|
|
37921
|
-
|
|
37922
|
-
|
|
37923
|
-
|
|
37924
|
-
|
|
37925
|
-
|
|
37926
|
-
groupFormId
|
|
37927
|
-
|
|
37928
|
-
if ((input === null || input === void 0 || (_input$meta12 = input.meta) === null || _input$meta12 === void 0 || (_input$meta12 = _input$meta12.optionsView) === null || _input$meta12 === void 0 ? void 0 : _input$meta12.editInputType) === "ajaxSelect") {
|
|
37929
|
-
var _formsValue$groupForm3, _input$meta13, _input$meta14;
|
|
37930
|
-
const currentValue = groupFormId ? (_formsValue$groupForm3 = formsValue[groupFormId]) === null || _formsValue$groupForm3 === void 0 ? void 0 : _formsValue$groupForm3[name] : formsValue[name];
|
|
37931
|
-
(input === null || input === void 0 || (_input$meta13 = input.meta) === null || _input$meta13 === void 0 || (_input$meta13 = _input$meta13.optionsView) === null || _input$meta13 === void 0 ? void 0 : _input$meta13.call) || (input === null || input === void 0 || (_input$meta14 = input.meta) === null || _input$meta14 === void 0 ? void 0 : _input$meta14.call) || "default::list()::::";
|
|
37914
|
+
dataLink: ({
|
|
37915
|
+
setValues,
|
|
37916
|
+
name,
|
|
37917
|
+
onValuesChange,
|
|
37918
|
+
changeLinking,
|
|
37919
|
+
formsValue,
|
|
37920
|
+
input,
|
|
37921
|
+
call,
|
|
37922
|
+
automaticallyLink,
|
|
37923
|
+
inputName,
|
|
37924
|
+
props,
|
|
37925
|
+
onNewSetValue,
|
|
37926
|
+
multiple,
|
|
37927
|
+
updateOptions,
|
|
37928
|
+
repeatValues,
|
|
37929
|
+
repeatIndex,
|
|
37930
|
+
value,
|
|
37931
|
+
unique,
|
|
37932
|
+
address,
|
|
37933
|
+
addressData = {},
|
|
37934
|
+
getFromLinking
|
|
37935
|
+
}, {
|
|
37936
|
+
form,
|
|
37937
|
+
forms,
|
|
37938
|
+
setAddress,
|
|
37939
|
+
changeInputMeta,
|
|
37940
|
+
inputMeta,
|
|
37941
|
+
meta,
|
|
37942
|
+
isHighlighted,
|
|
37943
|
+
groupFormId
|
|
37944
|
+
}) => {
|
|
37945
|
+
if (input?.meta?.optionsView?.editInputType === "ajaxSelect") {
|
|
37946
|
+
const currentValue = groupFormId ? formsValue[groupFormId]?.[name] : formsValue[name];
|
|
37947
|
+
input?.meta?.optionsView?.call || input?.meta?.call || "default::list()::::";
|
|
37932
37948
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect$1, {
|
|
37933
37949
|
size: "medium",
|
|
37934
37950
|
input: input,
|
|
@@ -37965,7 +37981,9 @@ const inputTypeComponent$1 = {
|
|
|
37965
37981
|
const selectedValue = data.find(v => v.value === ev);
|
|
37966
37982
|
if (address && selectedValue) {
|
|
37967
37983
|
dot__default["default"].str(address, selectedValue.label, addressData);
|
|
37968
|
-
setAddress(
|
|
37984
|
+
setAddress({
|
|
37985
|
+
...addressData
|
|
37986
|
+
});
|
|
37969
37987
|
}
|
|
37970
37988
|
}
|
|
37971
37989
|
},
|
|
@@ -37975,93 +37993,138 @@ const inputTypeComponent$1 = {
|
|
|
37975
37993
|
isDataLink: true
|
|
37976
37994
|
});
|
|
37977
37995
|
}
|
|
37978
|
-
const isSingle =
|
|
37979
|
-
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [
|
|
37996
|
+
const isSingle = input?.meta?.maxRepeat === 1;
|
|
37997
|
+
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
|
|
37998
|
+
...(formsValue[groupFormId] || {})[name]
|
|
37999
|
+
}] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
|
|
38000
|
+
...v
|
|
38001
|
+
})) : isSingle ? formsValue[name] ? [{
|
|
38002
|
+
...formsValue[name]
|
|
38003
|
+
}] : [] : (formsValue[name] || []).map(v => ({
|
|
38004
|
+
...v
|
|
38005
|
+
}));
|
|
37980
38006
|
const onUpdate = (editData, i) => {
|
|
37981
|
-
const val =
|
|
38007
|
+
const val = {
|
|
38008
|
+
...formData[i],
|
|
38009
|
+
...editData
|
|
38010
|
+
};
|
|
37982
38011
|
const _val = isSingle ? {
|
|
37983
38012
|
[name]: val
|
|
37984
38013
|
} : {
|
|
37985
|
-
[name]: formData
|
|
38014
|
+
[name]: formData?.map((d, j) => i === j ? val : d)
|
|
37986
38015
|
};
|
|
37987
38016
|
if (groupFormId) {
|
|
37988
|
-
const _defaultData =
|
|
37989
|
-
const _newData =
|
|
37990
|
-
|
|
38017
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38018
|
+
const _newData = {
|
|
38019
|
+
..._defaultData,
|
|
38020
|
+
..._val
|
|
38021
|
+
};
|
|
38022
|
+
onValuesChange(_newData, {
|
|
38023
|
+
...formsValue,
|
|
37991
38024
|
[groupFormId]: _newData
|
|
37992
|
-
})
|
|
37993
|
-
form
|
|
37994
|
-
setValues(
|
|
38025
|
+
});
|
|
38026
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38027
|
+
setValues({
|
|
38028
|
+
...formsValue,
|
|
37995
38029
|
[groupFormId]: _newData
|
|
37996
|
-
})
|
|
38030
|
+
});
|
|
37997
38031
|
return;
|
|
37998
38032
|
}
|
|
37999
|
-
onValuesChange(_val,
|
|
38000
|
-
|
|
38001
|
-
|
|
38033
|
+
onValuesChange(_val, {
|
|
38034
|
+
...formsValue,
|
|
38035
|
+
..._val
|
|
38036
|
+
});
|
|
38037
|
+
form?.setFieldValue(name, _val[name]);
|
|
38038
|
+
setValues({
|
|
38039
|
+
...formsValue,
|
|
38040
|
+
..._val
|
|
38041
|
+
});
|
|
38002
38042
|
};
|
|
38003
|
-
if (input
|
|
38004
|
-
var _formsValue$meta4, _input$meta17;
|
|
38043
|
+
if (input?.meta?.flat) {
|
|
38005
38044
|
return /*#__PURE__*/jsxRuntime.jsx(DataLinkFlat, {
|
|
38006
38045
|
form: input,
|
|
38007
38046
|
changeLinking: changeLinking,
|
|
38008
38047
|
onUpdate: onUpdate,
|
|
38009
38048
|
isHighlighted: isHighlighted,
|
|
38010
38049
|
formsValue: formsValue,
|
|
38011
|
-
values: groupFormId ?
|
|
38050
|
+
values: groupFormId ? {
|
|
38051
|
+
...(formsValue[groupFormId] || {}),
|
|
38012
38052
|
meta: {
|
|
38013
|
-
inputs: (
|
|
38053
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
38014
38054
|
}
|
|
38015
|
-
}
|
|
38055
|
+
} : formsValue,
|
|
38016
38056
|
name: name,
|
|
38017
38057
|
groupFormId: groupFormId,
|
|
38018
|
-
maxRepeat: input
|
|
38019
|
-
remove:
|
|
38020
|
-
|
|
38021
|
-
|
|
38022
|
-
} = _ref58;
|
|
38058
|
+
maxRepeat: input?.meta?.maxRepeat,
|
|
38059
|
+
remove: ({
|
|
38060
|
+
key
|
|
38061
|
+
}) => {
|
|
38023
38062
|
const _val = isSingle ? {
|
|
38024
38063
|
[name]: null
|
|
38025
38064
|
} : {
|
|
38026
38065
|
[name]: formData.filter((v, i) => i !== key)
|
|
38027
38066
|
};
|
|
38028
38067
|
if (groupFormId) {
|
|
38029
|
-
const _defaultData =
|
|
38030
|
-
const _newData =
|
|
38031
|
-
|
|
38068
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38069
|
+
const _newData = {
|
|
38070
|
+
..._defaultData,
|
|
38071
|
+
..._val
|
|
38072
|
+
};
|
|
38073
|
+
onValuesChange(_newData, {
|
|
38074
|
+
...formsValue,
|
|
38032
38075
|
[groupFormId]: _newData
|
|
38033
|
-
})
|
|
38034
|
-
form
|
|
38035
|
-
setValues(
|
|
38076
|
+
});
|
|
38077
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38078
|
+
setValues({
|
|
38079
|
+
...formsValue,
|
|
38036
38080
|
[groupFormId]: _newData
|
|
38037
|
-
})
|
|
38081
|
+
});
|
|
38038
38082
|
return;
|
|
38039
38083
|
}
|
|
38040
|
-
onValuesChange(_val,
|
|
38041
|
-
|
|
38042
|
-
|
|
38084
|
+
onValuesChange(_val, {
|
|
38085
|
+
...formsValue,
|
|
38086
|
+
..._val
|
|
38087
|
+
});
|
|
38088
|
+
form?.setFieldValue(name, _val[name]);
|
|
38089
|
+
setValues({
|
|
38090
|
+
...formsValue,
|
|
38091
|
+
..._val
|
|
38092
|
+
});
|
|
38043
38093
|
},
|
|
38044
38094
|
add: val => {
|
|
38045
38095
|
const _val = isSingle ? {
|
|
38046
38096
|
[name]: val
|
|
38047
38097
|
} : {
|
|
38048
|
-
[name]: [...formData,
|
|
38098
|
+
[name]: [...formData, {
|
|
38099
|
+
...val
|
|
38100
|
+
}]
|
|
38049
38101
|
};
|
|
38050
38102
|
if (groupFormId) {
|
|
38051
|
-
const _defaultData =
|
|
38052
|
-
const _newData =
|
|
38053
|
-
|
|
38054
|
-
|
|
38103
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38104
|
+
const _newData = {
|
|
38105
|
+
..._defaultData,
|
|
38106
|
+
..._val
|
|
38107
|
+
};
|
|
38108
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38109
|
+
onValuesChange(_newData, {
|
|
38110
|
+
...formsValue,
|
|
38055
38111
|
[groupFormId]: _newData
|
|
38056
|
-
})
|
|
38057
|
-
setValues(
|
|
38112
|
+
});
|
|
38113
|
+
setValues({
|
|
38114
|
+
...formsValue,
|
|
38058
38115
|
[groupFormId]: _newData
|
|
38059
|
-
})
|
|
38116
|
+
});
|
|
38060
38117
|
return;
|
|
38061
38118
|
}
|
|
38062
|
-
form
|
|
38063
|
-
onValuesChange(_val,
|
|
38064
|
-
|
|
38119
|
+
form?.setFieldValue(name, _val[name]);
|
|
38120
|
+
onValuesChange(_val, {
|
|
38121
|
+
...formsValue,
|
|
38122
|
+
..._val
|
|
38123
|
+
});
|
|
38124
|
+
setValues({
|
|
38125
|
+
...formsValue,
|
|
38126
|
+
..._val
|
|
38127
|
+
});
|
|
38065
38128
|
},
|
|
38066
38129
|
k: name,
|
|
38067
38130
|
formData: formData
|
|
@@ -38073,79 +38136,101 @@ const inputTypeComponent$1 = {
|
|
|
38073
38136
|
onUpdate: onUpdate,
|
|
38074
38137
|
isHighlighted: isHighlighted,
|
|
38075
38138
|
formsValue: formsValue,
|
|
38076
|
-
values: groupFormId ?
|
|
38139
|
+
values: groupFormId ? {
|
|
38140
|
+
...(formsValue[groupFormId] || {}),
|
|
38077
38141
|
meta: {
|
|
38078
|
-
inputs: (
|
|
38142
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
38079
38143
|
}
|
|
38080
|
-
}
|
|
38144
|
+
} : formsValue,
|
|
38081
38145
|
name: name,
|
|
38082
38146
|
groupFormId: groupFormId,
|
|
38083
|
-
maxRepeat: input
|
|
38084
|
-
remove:
|
|
38085
|
-
|
|
38086
|
-
|
|
38087
|
-
} = _ref59;
|
|
38147
|
+
maxRepeat: input?.meta?.maxRepeat,
|
|
38148
|
+
remove: ({
|
|
38149
|
+
key
|
|
38150
|
+
}) => {
|
|
38088
38151
|
const _val = isSingle ? {
|
|
38089
38152
|
[name]: null
|
|
38090
38153
|
} : {
|
|
38091
38154
|
[name]: formData.filter((v, i) => i !== key)
|
|
38092
38155
|
};
|
|
38093
38156
|
if (groupFormId) {
|
|
38094
|
-
const _defaultData =
|
|
38095
|
-
const _newData =
|
|
38096
|
-
|
|
38157
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38158
|
+
const _newData = {
|
|
38159
|
+
..._defaultData,
|
|
38160
|
+
..._val
|
|
38161
|
+
};
|
|
38162
|
+
onValuesChange(_newData, {
|
|
38163
|
+
...formsValue,
|
|
38097
38164
|
[groupFormId]: _newData
|
|
38098
|
-
})
|
|
38099
|
-
form
|
|
38100
|
-
setValues(
|
|
38165
|
+
});
|
|
38166
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38167
|
+
setValues({
|
|
38168
|
+
...formsValue,
|
|
38101
38169
|
[groupFormId]: _newData
|
|
38102
|
-
})
|
|
38170
|
+
});
|
|
38103
38171
|
return;
|
|
38104
38172
|
}
|
|
38105
|
-
onValuesChange(_val,
|
|
38106
|
-
|
|
38107
|
-
|
|
38173
|
+
onValuesChange(_val, {
|
|
38174
|
+
...formsValue,
|
|
38175
|
+
..._val
|
|
38176
|
+
});
|
|
38177
|
+
form?.setFieldValue(name, _val[name]);
|
|
38178
|
+
setValues({
|
|
38179
|
+
...formsValue,
|
|
38180
|
+
..._val
|
|
38181
|
+
});
|
|
38108
38182
|
},
|
|
38109
38183
|
add: val => {
|
|
38110
38184
|
const _val = isSingle ? {
|
|
38111
38185
|
[name]: val
|
|
38112
38186
|
} : {
|
|
38113
|
-
[name]: [...formData,
|
|
38187
|
+
[name]: [...formData, {
|
|
38188
|
+
...val
|
|
38189
|
+
}]
|
|
38114
38190
|
};
|
|
38115
38191
|
if (groupFormId) {
|
|
38116
|
-
const _defaultData =
|
|
38117
|
-
const _newData =
|
|
38118
|
-
|
|
38119
|
-
|
|
38192
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38193
|
+
const _newData = {
|
|
38194
|
+
..._defaultData,
|
|
38195
|
+
..._val
|
|
38196
|
+
};
|
|
38197
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38198
|
+
onValuesChange(_newData, {
|
|
38199
|
+
...formsValue,
|
|
38120
38200
|
[groupFormId]: _newData
|
|
38121
|
-
})
|
|
38122
|
-
setValues(
|
|
38201
|
+
});
|
|
38202
|
+
setValues({
|
|
38203
|
+
...formsValue,
|
|
38123
38204
|
[groupFormId]: _newData
|
|
38124
|
-
})
|
|
38205
|
+
});
|
|
38125
38206
|
return;
|
|
38126
38207
|
}
|
|
38127
|
-
form
|
|
38128
|
-
onValuesChange(_val,
|
|
38129
|
-
|
|
38208
|
+
form?.setFieldValue(name, _val[name]);
|
|
38209
|
+
onValuesChange(_val, {
|
|
38210
|
+
...formsValue,
|
|
38211
|
+
..._val
|
|
38212
|
+
});
|
|
38213
|
+
setValues({
|
|
38214
|
+
...formsValue,
|
|
38215
|
+
..._val
|
|
38216
|
+
});
|
|
38130
38217
|
},
|
|
38131
38218
|
k: name,
|
|
38132
38219
|
formData: formData
|
|
38133
38220
|
});
|
|
38134
38221
|
},
|
|
38135
|
-
dataLinkGroup: (
|
|
38136
|
-
|
|
38137
|
-
|
|
38138
|
-
|
|
38139
|
-
|
|
38140
|
-
|
|
38141
|
-
|
|
38142
|
-
|
|
38143
|
-
|
|
38144
|
-
|
|
38145
|
-
|
|
38146
|
-
|
|
38147
|
-
isHighlighted
|
|
38148
|
-
} = _ref61;
|
|
38222
|
+
dataLinkGroup: ({
|
|
38223
|
+
setValues,
|
|
38224
|
+
name,
|
|
38225
|
+
onValuesChange,
|
|
38226
|
+
changeLinking,
|
|
38227
|
+
formsValue,
|
|
38228
|
+
input
|
|
38229
|
+
}, {
|
|
38230
|
+
form,
|
|
38231
|
+
groupFormId,
|
|
38232
|
+
isHighlighted
|
|
38233
|
+
}) => {
|
|
38149
38234
|
return renderDataLinkGroup({
|
|
38150
38235
|
input,
|
|
38151
38236
|
name,
|
|
@@ -38158,41 +38243,51 @@ const inputTypeComponent$1 = {
|
|
|
38158
38243
|
isHighlighted
|
|
38159
38244
|
});
|
|
38160
38245
|
},
|
|
38161
|
-
groupCheckbox: (
|
|
38162
|
-
|
|
38163
|
-
|
|
38164
|
-
|
|
38165
|
-
|
|
38166
|
-
|
|
38167
|
-
|
|
38168
|
-
|
|
38169
|
-
|
|
38170
|
-
|
|
38171
|
-
|
|
38172
|
-
isHighlighted
|
|
38173
|
-
} = _ref63;
|
|
38246
|
+
groupCheckbox: ({
|
|
38247
|
+
setValues,
|
|
38248
|
+
name,
|
|
38249
|
+
onValuesChange,
|
|
38250
|
+
formsValue,
|
|
38251
|
+
input
|
|
38252
|
+
}, {
|
|
38253
|
+
form,
|
|
38254
|
+
groupFormId,
|
|
38255
|
+
isHighlighted
|
|
38256
|
+
}) => {
|
|
38174
38257
|
const formData = groupFormId ? (formsValue[groupFormId] || {})[name] || [] : formsValue[name] || [];
|
|
38175
38258
|
const onUpdate = (val, key) => {
|
|
38176
38259
|
const _val = {
|
|
38177
|
-
[name]:
|
|
38260
|
+
[name]: {
|
|
38261
|
+
...formData,
|
|
38178
38262
|
[key]: val
|
|
38179
|
-
}
|
|
38263
|
+
}
|
|
38180
38264
|
};
|
|
38181
38265
|
if (groupFormId) {
|
|
38182
|
-
const _defaultData =
|
|
38183
|
-
const _newData =
|
|
38184
|
-
|
|
38266
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38267
|
+
const _newData = {
|
|
38268
|
+
..._defaultData,
|
|
38269
|
+
..._val
|
|
38270
|
+
};
|
|
38271
|
+
onValuesChange(_newData, {
|
|
38272
|
+
...formsValue,
|
|
38185
38273
|
[groupFormId]: _newData
|
|
38186
|
-
})
|
|
38187
|
-
form
|
|
38188
|
-
setValues(
|
|
38274
|
+
});
|
|
38275
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38276
|
+
setValues({
|
|
38277
|
+
...formsValue,
|
|
38189
38278
|
[groupFormId]: _newData
|
|
38190
|
-
})
|
|
38279
|
+
});
|
|
38191
38280
|
return;
|
|
38192
38281
|
}
|
|
38193
|
-
onValuesChange(_val,
|
|
38194
|
-
|
|
38195
|
-
|
|
38282
|
+
onValuesChange(_val, {
|
|
38283
|
+
...formsValue,
|
|
38284
|
+
..._val
|
|
38285
|
+
});
|
|
38286
|
+
form?.setFieldValue(name, _val[name]);
|
|
38287
|
+
setValues({
|
|
38288
|
+
...formsValue,
|
|
38289
|
+
..._val
|
|
38290
|
+
});
|
|
38196
38291
|
};
|
|
38197
38292
|
return /*#__PURE__*/jsxRuntime.jsx(GroupCheckbox, {
|
|
38198
38293
|
form: input,
|
|
@@ -38201,91 +38296,96 @@ const inputTypeComponent$1 = {
|
|
|
38201
38296
|
isHighlighted: isHighlighted
|
|
38202
38297
|
});
|
|
38203
38298
|
},
|
|
38204
|
-
website: (
|
|
38205
|
-
|
|
38206
|
-
|
|
38207
|
-
|
|
38208
|
-
|
|
38209
|
-
|
|
38210
|
-
|
|
38211
|
-
|
|
38212
|
-
|
|
38213
|
-
|
|
38214
|
-
|
|
38215
|
-
|
|
38216
|
-
|
|
38217
|
-
|
|
38218
|
-
|
|
38219
|
-
} = _ref65;
|
|
38220
|
-
return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
|
|
38299
|
+
website: ({
|
|
38300
|
+
name,
|
|
38301
|
+
inputName,
|
|
38302
|
+
props,
|
|
38303
|
+
value,
|
|
38304
|
+
repeatIndex,
|
|
38305
|
+
repeatValues,
|
|
38306
|
+
formsValue
|
|
38307
|
+
}, {
|
|
38308
|
+
form,
|
|
38309
|
+
isHighlighted,
|
|
38310
|
+
inputMeta = {},
|
|
38311
|
+
t
|
|
38312
|
+
}) => {
|
|
38313
|
+
return /*#__PURE__*/jsxRuntime.jsx(Website, {
|
|
38221
38314
|
size: "large",
|
|
38222
38315
|
allowClear: true,
|
|
38223
|
-
initialValue: value
|
|
38224
|
-
|
|
38316
|
+
initialValue: value,
|
|
38317
|
+
...props,
|
|
38225
38318
|
onChange: val => updateFormValues$1(repeatIndex, repeatValues, inputName, val, formsValue, name, form),
|
|
38226
38319
|
className: formatClassname([isHighlighted && "highlighted-cont"]),
|
|
38227
38320
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
38228
38321
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com"
|
|
38229
|
-
})
|
|
38322
|
+
});
|
|
38230
38323
|
},
|
|
38231
|
-
group: (
|
|
38232
|
-
|
|
38233
|
-
|
|
38234
|
-
|
|
38235
|
-
|
|
38236
|
-
|
|
38237
|
-
|
|
38238
|
-
|
|
38239
|
-
|
|
38240
|
-
} = _ref67;
|
|
38241
|
-
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
|
|
38324
|
+
group: ({
|
|
38325
|
+
props,
|
|
38326
|
+
groupInputs,
|
|
38327
|
+
formsValue
|
|
38328
|
+
}, {
|
|
38329
|
+
inputMeta,
|
|
38330
|
+
isHighlighted
|
|
38331
|
+
}) => {
|
|
38332
|
+
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
|
|
38242
38333
|
formsValue: formsValue,
|
|
38243
38334
|
isHighlighted: isHighlighted,
|
|
38244
38335
|
groupInputs: groupInputs,
|
|
38245
|
-
inputMeta: inputMeta
|
|
38246
|
-
|
|
38336
|
+
inputMeta: inputMeta,
|
|
38337
|
+
...props
|
|
38338
|
+
});
|
|
38247
38339
|
},
|
|
38248
|
-
groupInputs: (
|
|
38249
|
-
|
|
38250
|
-
|
|
38251
|
-
|
|
38252
|
-
|
|
38253
|
-
|
|
38254
|
-
|
|
38255
|
-
|
|
38256
|
-
|
|
38257
|
-
} = _ref69;
|
|
38258
|
-
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
|
|
38340
|
+
groupInputs: ({
|
|
38341
|
+
props,
|
|
38342
|
+
groupInputs,
|
|
38343
|
+
formsValue
|
|
38344
|
+
}, {
|
|
38345
|
+
inputMeta,
|
|
38346
|
+
isHighlighted
|
|
38347
|
+
}) => {
|
|
38348
|
+
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
|
|
38259
38349
|
formsValue: formsValue,
|
|
38260
38350
|
isHighlighted: isHighlighted,
|
|
38261
38351
|
groupInputs: groupInputs,
|
|
38262
|
-
inputMeta: inputMeta
|
|
38263
|
-
|
|
38352
|
+
inputMeta: inputMeta,
|
|
38353
|
+
...props
|
|
38354
|
+
});
|
|
38264
38355
|
},
|
|
38265
|
-
smartHelp: (
|
|
38356
|
+
smartHelp: ({
|
|
38357
|
+
name,
|
|
38358
|
+
inputName,
|
|
38359
|
+
props,
|
|
38360
|
+
value,
|
|
38361
|
+
repeatIndex,
|
|
38362
|
+
repeatValues,
|
|
38363
|
+
formsValue
|
|
38364
|
+
}, {
|
|
38365
|
+
form,
|
|
38366
|
+
isHighlighted,
|
|
38367
|
+
inputMeta = {},
|
|
38368
|
+
t
|
|
38369
|
+
}) => {
|
|
38266
38370
|
return /*#__PURE__*/jsxRuntime.jsx(Smart, {});
|
|
38267
38371
|
}
|
|
38268
38372
|
};
|
|
38269
38373
|
const filterForm = (f, d) => {
|
|
38270
38374
|
return f && (f.showFormIf ? showHideForm(f, d) : true);
|
|
38271
38375
|
};
|
|
38272
|
-
const checkFormHasSubsections =
|
|
38273
|
-
let f = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
38274
|
-
return Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
|
|
38275
|
-
};
|
|
38376
|
+
const checkFormHasSubsections = (f = {}) => Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
|
|
38276
38377
|
const mapFormGroup = (f, d) => Object.keys(f).map(key => {
|
|
38277
|
-
const
|
|
38278
|
-
|
|
38279
|
-
|
|
38280
|
-
|
|
38281
|
-
|
|
38282
|
-
|
|
38283
|
-
|
|
38284
|
-
|
|
38285
|
-
|
|
38286
|
-
|
|
38287
|
-
|
|
38288
|
-
fc = _objectWithoutProperties(_ref72, _excluded2$1);
|
|
38378
|
+
const {
|
|
38379
|
+
label,
|
|
38380
|
+
description = "",
|
|
38381
|
+
excludeFromEdit,
|
|
38382
|
+
showFormIf,
|
|
38383
|
+
icon = "",
|
|
38384
|
+
position = 0,
|
|
38385
|
+
template,
|
|
38386
|
+
formClass,
|
|
38387
|
+
...fc
|
|
38388
|
+
} = f[key] || {};
|
|
38289
38389
|
const fConf = {
|
|
38290
38390
|
id: key,
|
|
38291
38391
|
label,
|
|
@@ -38344,14 +38444,11 @@ const groupSubForms = (fConf, d) => {
|
|
|
38344
38444
|
return f;
|
|
38345
38445
|
}, {});
|
|
38346
38446
|
};
|
|
38347
|
-
const inputIsEmpty =
|
|
38348
|
-
|
|
38349
|
-
let values = arguments.length > 1 ? arguments[1] : undefined;
|
|
38350
|
-
let inputMeta = arguments.length > 2 ? arguments[2] : undefined;
|
|
38351
|
-
if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
|
|
38447
|
+
const inputIsEmpty = (input = {}, values, inputMeta) => {
|
|
38448
|
+
if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
|
|
38352
38449
|
return false;
|
|
38353
38450
|
}
|
|
38354
|
-
if (
|
|
38451
|
+
if (input?.type === "groupInputs") {
|
|
38355
38452
|
return true;
|
|
38356
38453
|
}
|
|
38357
38454
|
const value = values[input.dataId];
|
|
@@ -38363,28 +38460,26 @@ const inputIsEmpty = function () {
|
|
|
38363
38460
|
}
|
|
38364
38461
|
return !value;
|
|
38365
38462
|
};
|
|
38366
|
-
const GetFormItem$1 =
|
|
38367
|
-
|
|
38368
|
-
|
|
38369
|
-
|
|
38370
|
-
|
|
38371
|
-
|
|
38372
|
-
|
|
38373
|
-
|
|
38374
|
-
|
|
38375
|
-
|
|
38376
|
-
|
|
38377
|
-
|
|
38378
|
-
|
|
38379
|
-
|
|
38380
|
-
|
|
38381
|
-
|
|
38382
|
-
|
|
38383
|
-
|
|
38384
|
-
|
|
38385
|
-
|
|
38386
|
-
namespace
|
|
38387
|
-
} = _ref73;
|
|
38463
|
+
const GetFormItem$1 = ({
|
|
38464
|
+
highlightMandatory,
|
|
38465
|
+
inputData,
|
|
38466
|
+
inputId,
|
|
38467
|
+
input,
|
|
38468
|
+
values,
|
|
38469
|
+
MainForm,
|
|
38470
|
+
options,
|
|
38471
|
+
plainForms,
|
|
38472
|
+
setValues,
|
|
38473
|
+
setAddress,
|
|
38474
|
+
i,
|
|
38475
|
+
inputKey,
|
|
38476
|
+
onValuesChange = () => {},
|
|
38477
|
+
setLoading = () => {},
|
|
38478
|
+
inputMeta = {},
|
|
38479
|
+
changeInputMeta = () => {},
|
|
38480
|
+
changeLinking = () => {},
|
|
38481
|
+
namespace
|
|
38482
|
+
}) => {
|
|
38388
38483
|
const {
|
|
38389
38484
|
t,
|
|
38390
38485
|
user,
|
|
@@ -38399,42 +38494,44 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38399
38494
|
staticWidth,
|
|
38400
38495
|
fullWidth
|
|
38401
38496
|
} = useEditContext();
|
|
38402
|
-
const lastReview = (
|
|
38497
|
+
const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
|
|
38403
38498
|
const [isShown, setIsShown] = React.useState(!!inputData.commentValue);
|
|
38404
38499
|
const inputLabel = getInputLabel$1(input, values);
|
|
38405
38500
|
const onClickReviewSuccess = () => {
|
|
38406
38501
|
if (!isReview) {
|
|
38407
38502
|
return;
|
|
38408
38503
|
}
|
|
38409
|
-
const reviewSuccess = lastReview
|
|
38504
|
+
const reviewSuccess = lastReview?.reviewSuccess;
|
|
38410
38505
|
changeInputMeta({
|
|
38411
38506
|
key: inputId,
|
|
38412
38507
|
type: input.type,
|
|
38413
|
-
value:
|
|
38508
|
+
value: {
|
|
38509
|
+
...inputMeta,
|
|
38414
38510
|
reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
|
|
38415
38511
|
reviewer: user,
|
|
38416
38512
|
createdAt: new Date().toISOString(),
|
|
38417
38513
|
reviewSuccess: true
|
|
38418
38514
|
}]
|
|
38419
|
-
}
|
|
38515
|
+
}
|
|
38420
38516
|
});
|
|
38421
38517
|
};
|
|
38422
38518
|
const onClickReviewError = () => {
|
|
38423
38519
|
if (!isReview) {
|
|
38424
38520
|
return;
|
|
38425
38521
|
}
|
|
38426
|
-
const reviewError = lastReview
|
|
38522
|
+
const reviewError = lastReview?.reviewError;
|
|
38427
38523
|
changeInputMeta({
|
|
38428
38524
|
key: inputId,
|
|
38429
38525
|
type: input.type,
|
|
38430
|
-
value:
|
|
38526
|
+
value: {
|
|
38527
|
+
...inputMeta,
|
|
38431
38528
|
reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
|
|
38432
38529
|
reviewer: user,
|
|
38433
38530
|
createdAt: new Date().toISOString(),
|
|
38434
38531
|
reviewError: true,
|
|
38435
38532
|
comment: ""
|
|
38436
38533
|
}]
|
|
38437
|
-
}
|
|
38534
|
+
}
|
|
38438
38535
|
});
|
|
38439
38536
|
};
|
|
38440
38537
|
switch (input.type) {
|
|
@@ -38448,12 +38545,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38448
38545
|
case "header":
|
|
38449
38546
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38450
38547
|
className: "daf-title with-subtitle",
|
|
38451
|
-
style: input
|
|
38548
|
+
style: input?.meta?.style,
|
|
38452
38549
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38453
38550
|
className: "flex",
|
|
38454
38551
|
children: [/*#__PURE__*/jsxRuntime.jsx("h1", {
|
|
38455
38552
|
children: ReactHtmlParser__default["default"](getLabel$1(input.label, values))
|
|
38456
|
-
}), !!input.description || input
|
|
38553
|
+
}), !!input.description || input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
|
|
38457
38554
|
content: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38458
38555
|
className: "tooltip-popover-cont",
|
|
38459
38556
|
children: ReactHtmlParser__default["default"](input.description)
|
|
@@ -38480,7 +38577,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38480
38577
|
const specialCharsRule = rules.find(r => r.type === "specialCharacters");
|
|
38481
38578
|
|
|
38482
38579
|
// eslint-disable-next-line no-case-declarations
|
|
38483
|
-
let maxRule =
|
|
38580
|
+
let maxRule = rules.find(rule => rule.max)?.max;
|
|
38484
38581
|
if (!maxRule && input.type === "textarea") {
|
|
38485
38582
|
maxRule = MAX_TEXT_AREA_LENGTH;
|
|
38486
38583
|
}
|
|
@@ -38493,30 +38590,27 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38493
38590
|
message: requiredRule.message || ""
|
|
38494
38591
|
});
|
|
38495
38592
|
}
|
|
38496
|
-
const isHighlighted = highlightMandatory &&
|
|
38593
|
+
const isHighlighted = highlightMandatory && input?.meta?.mandatory && inputIsEmpty(input, values, inputMeta);
|
|
38497
38594
|
if (requiredRule || specialCharsRule) {
|
|
38498
38595
|
if (input.type === "groupInputs") {
|
|
38499
38596
|
rules = rules.map(r => {
|
|
38500
38597
|
if (r.required) {
|
|
38501
|
-
return
|
|
38502
|
-
|
|
38503
|
-
|
|
38504
|
-
|
|
38505
|
-
|
|
38506
|
-
validator() {
|
|
38507
|
-
if (inputMeta.notAvailable || inputMeta.notApplicable) {
|
|
38508
|
-
return Promise.resolve();
|
|
38509
|
-
}
|
|
38510
|
-
const keys = Object.keys(input.inputs);
|
|
38511
|
-
for (let i = 0; i < keys.length; i++) {
|
|
38512
|
-
if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
|
|
38513
|
-
return Promise.reject(r.message);
|
|
38514
|
-
}
|
|
38515
|
-
}
|
|
38598
|
+
return ({
|
|
38599
|
+
getFieldValue
|
|
38600
|
+
}) => ({
|
|
38601
|
+
validator() {
|
|
38602
|
+
if (inputMeta.notAvailable || inputMeta.notApplicable) {
|
|
38516
38603
|
return Promise.resolve();
|
|
38517
38604
|
}
|
|
38518
|
-
|
|
38519
|
-
|
|
38605
|
+
const keys = Object.keys(input.inputs);
|
|
38606
|
+
for (let i = 0; i < keys.length; i++) {
|
|
38607
|
+
if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
|
|
38608
|
+
return Promise.reject(r.message);
|
|
38609
|
+
}
|
|
38610
|
+
}
|
|
38611
|
+
return Promise.resolve();
|
|
38612
|
+
}
|
|
38613
|
+
});
|
|
38520
38614
|
}
|
|
38521
38615
|
return r;
|
|
38522
38616
|
});
|
|
@@ -38554,13 +38648,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38554
38648
|
}
|
|
38555
38649
|
}
|
|
38556
38650
|
if (input && typeof input === "object") {
|
|
38557
|
-
var _input$meta22, _input$meta23, _input$meta24, _input$meta25, _values$parent, _input$meta26, _input$meta27, _inputData$value, _input$meta28, _input$meta29, _inputData$commentVal, _lastReview$comment, _lastReview$reviewer, _lastReview$reviewer2;
|
|
38558
38651
|
// check if input is valid
|
|
38559
38652
|
const hideComment = namespace === "project-readiness";
|
|
38560
38653
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
38561
38654
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38562
38655
|
className: "flex-row input-cont",
|
|
38563
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item,
|
|
38656
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38564
38657
|
extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
38565
38658
|
children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38566
38659
|
className: formatClassname(["ml-4 input-actions"]),
|
|
@@ -38570,7 +38663,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38570
38663
|
title: t("Add review note"),
|
|
38571
38664
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38572
38665
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38573
|
-
className: formatClassname(["review-btn review-error-btn",
|
|
38666
|
+
className: formatClassname(["review-btn review-error-btn", lastReview?.reviewError && "primary"]),
|
|
38574
38667
|
type: "link",
|
|
38575
38668
|
onClick: onClickReviewError,
|
|
38576
38669
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
@@ -38586,7 +38679,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38586
38679
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38587
38680
|
type: "link",
|
|
38588
38681
|
onClick: onClickReviewSuccess,
|
|
38589
|
-
className: formatClassname(["review-btn review-success-btn",
|
|
38682
|
+
className: formatClassname(["review-btn review-success-btn", lastReview?.reviewSuccess && "primary"]),
|
|
38590
38683
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
38591
38684
|
name: "CheckSquare",
|
|
38592
38685
|
width: 16,
|
|
@@ -38623,7 +38716,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38623
38716
|
}
|
|
38624
38717
|
});
|
|
38625
38718
|
},
|
|
38626
|
-
disabled: !
|
|
38719
|
+
disabled: !input.meta?.notApplicable,
|
|
38627
38720
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
38628
38721
|
name: "NotApplicable",
|
|
38629
38722
|
width: 16,
|
|
@@ -38637,7 +38730,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38637
38730
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38638
38731
|
className: formatClassname(["default p-0", inputMeta.notAvailable && "primary"]),
|
|
38639
38732
|
type: "link",
|
|
38640
|
-
disabled: !
|
|
38733
|
+
disabled: !input.meta?.notAvailable,
|
|
38641
38734
|
onClick: () => {
|
|
38642
38735
|
const value = getDefaultInputValue(input);
|
|
38643
38736
|
MainForm.setFields([{
|
|
@@ -38669,14 +38762,14 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38669
38762
|
}), !hideComment ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
38670
38763
|
title: t("Add comment"),
|
|
38671
38764
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38672
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button,
|
|
38765
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38673
38766
|
type: "link",
|
|
38674
|
-
disabled: !
|
|
38675
|
-
|
|
38676
|
-
|
|
38677
|
-
|
|
38678
|
-
|
|
38679
|
-
|
|
38767
|
+
disabled: !input.meta?.comment,
|
|
38768
|
+
...(!isShown ? {
|
|
38769
|
+
className: "default p-0"
|
|
38770
|
+
} : {
|
|
38771
|
+
className: "p-0 primary"
|
|
38772
|
+
}),
|
|
38680
38773
|
onClick: () => {
|
|
38681
38774
|
if (inputMeta.comment !== undefined && inputMeta.comment !== null) {
|
|
38682
38775
|
return;
|
|
@@ -38695,7 +38788,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38695
38788
|
width: 16,
|
|
38696
38789
|
height: 16
|
|
38697
38790
|
})
|
|
38698
|
-
})
|
|
38791
|
+
})
|
|
38699
38792
|
})
|
|
38700
38793
|
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
38701
38794
|
title: t("Project Readiness"),
|
|
@@ -38714,34 +38807,36 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38714
38807
|
}) : null]
|
|
38715
38808
|
}) : null
|
|
38716
38809
|
}),
|
|
38717
|
-
initialValue: inputMeta
|
|
38718
|
-
|
|
38719
|
-
|
|
38720
|
-
|
|
38721
|
-
|
|
38722
|
-
|
|
38723
|
-
|
|
38724
|
-
|
|
38725
|
-
|
|
38726
|
-
|
|
38727
|
-
|
|
38728
|
-
|
|
38729
|
-
|
|
38730
|
-
|
|
38731
|
-
if (f.response) {
|
|
38732
|
-
return f.response;
|
|
38810
|
+
initialValue: inputMeta?.defaultValue,
|
|
38811
|
+
...(inputOnBlur.includes(input.type) ? {
|
|
38812
|
+
trigger: "onBlur"
|
|
38813
|
+
} : {}),
|
|
38814
|
+
...(["total100", "group"].includes(input.type) ? {} : {
|
|
38815
|
+
name: inputId,
|
|
38816
|
+
fieldKey: inputId,
|
|
38817
|
+
initialValue: inputData.value
|
|
38818
|
+
}),
|
|
38819
|
+
...(["upload"].includes(input.type) ? {
|
|
38820
|
+
valuePropName: "fileList",
|
|
38821
|
+
getValueFromEvent: e => {
|
|
38822
|
+
if (Array.isArray(e)) {
|
|
38823
|
+
return e;
|
|
38733
38824
|
}
|
|
38734
|
-
return f
|
|
38735
|
-
|
|
38736
|
-
|
|
38737
|
-
|
|
38738
|
-
|
|
38825
|
+
return e && e.fileList && e.fileList.map(f => {
|
|
38826
|
+
if (f.response) {
|
|
38827
|
+
return f.response;
|
|
38828
|
+
}
|
|
38829
|
+
return f;
|
|
38830
|
+
});
|
|
38831
|
+
}
|
|
38832
|
+
} : {}),
|
|
38833
|
+
className: formatClassname([`i-${input.type} flex-1`, input.comment && "with-comment", maxRule && "with-max-rule"]),
|
|
38739
38834
|
"data-id": inputData.name,
|
|
38740
38835
|
rules: rules,
|
|
38741
38836
|
required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
|
|
38742
38837
|
labelCol: 12,
|
|
38743
38838
|
label: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38744
|
-
className: formatClassname(["flex",
|
|
38839
|
+
className: formatClassname(["flex", input?.meta?.code && "mr-10"]),
|
|
38745
38840
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38746
38841
|
className: "mr-1",
|
|
38747
38842
|
children: getInputLabel$1(input, values)
|
|
@@ -38754,7 +38849,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38754
38849
|
config: input,
|
|
38755
38850
|
t: t,
|
|
38756
38851
|
ajaxForms: ajaxForms,
|
|
38757
|
-
linkingData:
|
|
38852
|
+
linkingData: values?.linking || values?.parent?.linking,
|
|
38758
38853
|
changeAjaxForms: changeAjaxForms,
|
|
38759
38854
|
getApiBaseUrl: getApiBaseUrl,
|
|
38760
38855
|
getAppHeader: getAppHeader,
|
|
@@ -38762,11 +38857,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38762
38857
|
getToken: getToken,
|
|
38763
38858
|
app: app,
|
|
38764
38859
|
valueOnlyString: true
|
|
38765
|
-
}) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](
|
|
38860
|
+
}) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
|
|
38861
|
+
...inputData,
|
|
38766
38862
|
maxWidth,
|
|
38767
38863
|
staticWidth,
|
|
38768
38864
|
fullWidth
|
|
38769
|
-
}
|
|
38865
|
+
}, {
|
|
38770
38866
|
form: MainForm,
|
|
38771
38867
|
forms: options,
|
|
38772
38868
|
allForms: plainForms,
|
|
@@ -38787,10 +38883,10 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38787
38883
|
staticWidth,
|
|
38788
38884
|
fullWidth
|
|
38789
38885
|
}) : console.log(input)
|
|
38790
|
-
})
|
|
38886
|
+
}), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38791
38887
|
className: "code",
|
|
38792
38888
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
38793
|
-
children:
|
|
38889
|
+
children: input.meta?.code
|
|
38794
38890
|
})
|
|
38795
38891
|
}) : null]
|
|
38796
38892
|
}), maxRule ? ["imageUpload", "upload", "videoUpload"].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -38810,10 +38906,10 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38810
38906
|
className: "max-char-span",
|
|
38811
38907
|
children: t("max-char", {
|
|
38812
38908
|
chars: maxRule,
|
|
38813
|
-
filled:
|
|
38909
|
+
filled: inputData?.value?.length || 0
|
|
38814
38910
|
})
|
|
38815
38911
|
})
|
|
38816
|
-
}) : null,
|
|
38912
|
+
}) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38817
38913
|
className: "input-content",
|
|
38818
38914
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38819
38915
|
className: "comment-textarea",
|
|
@@ -38839,7 +38935,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38839
38935
|
},
|
|
38840
38936
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38841
38937
|
type: "link",
|
|
38842
|
-
disabled: !
|
|
38938
|
+
disabled: !input.meta?.comment,
|
|
38843
38939
|
className: "p-0",
|
|
38844
38940
|
children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
|
|
38845
38941
|
width: 16,
|
|
@@ -38848,11 +38944,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38848
38944
|
})
|
|
38849
38945
|
})]
|
|
38850
38946
|
}),
|
|
38851
|
-
children: inputTypeComponent$1.comment(
|
|
38947
|
+
children: inputTypeComponent$1.comment({
|
|
38948
|
+
...inputData,
|
|
38852
38949
|
maxWidth,
|
|
38853
38950
|
staticWidth,
|
|
38854
38951
|
fullWidth
|
|
38855
|
-
}
|
|
38952
|
+
}, {
|
|
38856
38953
|
form: MainForm,
|
|
38857
38954
|
forms: options,
|
|
38858
38955
|
setFormValues: setValues,
|
|
@@ -38877,16 +38974,16 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38877
38974
|
className: "max-char-span",
|
|
38878
38975
|
children: t("max-char", {
|
|
38879
38976
|
chars: MAX_COMMENTS_LENGTH,
|
|
38880
|
-
filled:
|
|
38977
|
+
filled: inputData?.commentValue?.length || 0
|
|
38881
38978
|
})
|
|
38882
38979
|
})]
|
|
38883
|
-
}) : null, lastReview
|
|
38980
|
+
}) : null, lastReview?.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38884
38981
|
className: "input-content",
|
|
38885
38982
|
children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
38886
38983
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38887
38984
|
className: "comment-textarea",
|
|
38888
|
-
initialValue:
|
|
38889
|
-
name:
|
|
38985
|
+
initialValue: lastReview?.comment || "",
|
|
38986
|
+
name: `${inputId}-reviewErrorComment`,
|
|
38890
38987
|
label: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38891
38988
|
className: "flex w-100",
|
|
38892
38989
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -38894,28 +38991,31 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38894
38991
|
children: t("Review note")
|
|
38895
38992
|
})
|
|
38896
38993
|
}),
|
|
38897
|
-
children: inputTypeComponent$1.comment(
|
|
38994
|
+
children: inputTypeComponent$1.comment({
|
|
38995
|
+
...inputData,
|
|
38898
38996
|
maxWidth,
|
|
38899
38997
|
staticWidth,
|
|
38900
38998
|
fullWidth
|
|
38901
|
-
}
|
|
38999
|
+
}, {
|
|
38902
39000
|
form: MainForm,
|
|
38903
39001
|
forms: options,
|
|
38904
|
-
value:
|
|
39002
|
+
value: lastReview?.comment || "",
|
|
38905
39003
|
onChange: val => {
|
|
38906
39004
|
changeInputMeta({
|
|
38907
39005
|
key: inputId,
|
|
38908
39006
|
type: input.type,
|
|
38909
|
-
value:
|
|
38910
|
-
|
|
39007
|
+
value: {
|
|
39008
|
+
...inputMeta,
|
|
39009
|
+
reviews: (inputMeta?.reviews || []).map(v => {
|
|
38911
39010
|
if (v.createdAt === lastReview.createdAt) {
|
|
38912
|
-
return
|
|
39011
|
+
return {
|
|
39012
|
+
...v,
|
|
38913
39013
|
comment: val
|
|
38914
|
-
}
|
|
39014
|
+
};
|
|
38915
39015
|
}
|
|
38916
39016
|
return v;
|
|
38917
39017
|
})
|
|
38918
|
-
}
|
|
39018
|
+
}
|
|
38919
39019
|
});
|
|
38920
39020
|
},
|
|
38921
39021
|
t,
|
|
@@ -38929,7 +39029,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38929
39029
|
className: "max-char-span",
|
|
38930
39030
|
children: t("max-char", {
|
|
38931
39031
|
chars: MAX_COMMENTS_LENGTH,
|
|
38932
|
-
filled:
|
|
39032
|
+
filled: lastReview.comment?.length || 0
|
|
38933
39033
|
})
|
|
38934
39034
|
})]
|
|
38935
39035
|
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -38950,7 +39050,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38950
39050
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38951
39051
|
className: "flex flex-column justify-center mr-1",
|
|
38952
39052
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
38953
|
-
children:
|
|
39053
|
+
children: lastReview?.reviewer?.firstName + " " + lastReview?.reviewer?.lastName + " - " + moment__default["default"](lastReview.createdAt).format("DD MMM YYYY")
|
|
38954
39054
|
})
|
|
38955
39055
|
})]
|
|
38956
39056
|
})]
|
|
@@ -38961,14 +39061,13 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38961
39061
|
return null;
|
|
38962
39062
|
}
|
|
38963
39063
|
};
|
|
38964
|
-
const editErrorHandler =
|
|
38965
|
-
|
|
38966
|
-
|
|
38967
|
-
|
|
38968
|
-
} = _ref76;
|
|
39064
|
+
const editErrorHandler = ({
|
|
39065
|
+
errorFields,
|
|
39066
|
+
t = s => s
|
|
39067
|
+
}) => {
|
|
38969
39068
|
if (Array.isArray(errorFields) && errorFields.length) {
|
|
38970
39069
|
const name = errorFields[0].name.join(".");
|
|
38971
|
-
const element = document.querySelector(
|
|
39070
|
+
const element = document.querySelector(`[data-id="${name}"]`);
|
|
38972
39071
|
if (element) {
|
|
38973
39072
|
element.scrollIntoView();
|
|
38974
39073
|
antd.message.error(t("errors::please-correct-invalid-inputs"));
|
|
@@ -41665,22 +41764,23 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
|
|
|
41665
41764
|
const formId = form.dataId || k;
|
|
41666
41765
|
const allInputs = Object.keys(form.inputs).filter(i => {
|
|
41667
41766
|
const input = form.inputs[i];
|
|
41668
|
-
return !excludedKeys.includes(i) && !input.excludeFromEdit && showHideInput(input, values, undefined, undefined, setValues,
|
|
41767
|
+
return !excludedKeys.includes(i) && !input.excludeFromEdit && showHideInput(input, values, undefined, undefined, setValues, "".concat(formId, ".").concat(i));
|
|
41669
41768
|
});
|
|
41670
41769
|
return allInputs.length ? /*#__PURE__*/jsxRuntime.jsxs(React__default["default"].Fragment, {
|
|
41671
41770
|
children: [getFormTitles(formTitles, formId, i), ['h2', 'h3', 'h4', 'h5', 'h6'].includes(form.type) ? getInputHeadLines(form.type, i, form, values) : /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
41672
41771
|
children: [!form.repeatable ? /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
41673
|
-
className:
|
|
41772
|
+
className: "".concat(form.titleClass ? form.titleClass : 'title-semibold-4', " mb0 ").concat(i ? 'mt-3' : ''),
|
|
41674
41773
|
children: getInputLabel(form, values)
|
|
41675
41774
|
}) : !form.hideSectionLabel ? /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
41676
|
-
className:
|
|
41775
|
+
className: "".concat(form.titleClass ? form.titleClass : 'title-semibold-4', " mb0 ").concat(i ? 'mt-3' : ''),
|
|
41677
41776
|
children: form.sectionLabel ? getSectionLabel(form.sectionLabel, values) : form.label ? getInputLabel(form, values) : camelCaseToTitle(k)
|
|
41678
41777
|
}) : null, /*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
|
|
41679
41778
|
name: formId,
|
|
41680
|
-
children: (fields, {
|
|
41681
|
-
|
|
41682
|
-
|
|
41683
|
-
|
|
41779
|
+
children: (fields, _ref) => {
|
|
41780
|
+
let {
|
|
41781
|
+
add,
|
|
41782
|
+
remove
|
|
41783
|
+
} = _ref;
|
|
41684
41784
|
const formData = form.repeatable ? values[formId] || [] : values[formId] ? [values[formId]] : [];
|
|
41685
41785
|
if (fields.length === 0) {
|
|
41686
41786
|
const formInputs = form.inputs;
|
|
@@ -41731,7 +41831,7 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
|
|
|
41731
41831
|
padding: '0px 5px',
|
|
41732
41832
|
color: '#2E90FA'
|
|
41733
41833
|
},
|
|
41734
|
-
children:
|
|
41834
|
+
children: "#".concat(field.name + 1)
|
|
41735
41835
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41736
41836
|
className: "remove-button-for-repeatable",
|
|
41737
41837
|
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, {
|
|
@@ -41753,8 +41853,8 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
|
|
|
41753
41853
|
const inputId = input.dataId || inp;
|
|
41754
41854
|
const inputValues = Array.isArray(values[formId]) ? values[formId][field.name] || {} : values[formId] || {};
|
|
41755
41855
|
const value = inputValues[inputId];
|
|
41756
|
-
const commentValue = inputValues[
|
|
41757
|
-
const inputData = getData(formId, input, value, commentValue,
|
|
41856
|
+
const commentValue = inputValues["".concat(inputId, "Comment")];
|
|
41857
|
+
const inputData = getData(formId, input, value, commentValue, "".concat(formId, "[").concat(field.name, "].").concat(inputId), "".concat(formId, ".").concat(inputId));
|
|
41758
41858
|
const subtitles = form.subtitles || null;
|
|
41759
41859
|
inputData.repeatIndex = field.name;
|
|
41760
41860
|
inputData.inputName = inputId;
|
|
@@ -41775,64 +41875,59 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
|
|
|
41775
41875
|
message: requiredRule.message || ''
|
|
41776
41876
|
});
|
|
41777
41877
|
}
|
|
41778
|
-
return showHideInput(input, values, field.name, inputValues, setValues,
|
|
41878
|
+
return showHideInput(input, values, field.name, inputValues, setValues, "".concat(formId, "[").concat(field.name, "].").concat(inputId)) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
|
|
41779
41879
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
41780
|
-
className: form.repeatable ?
|
|
41880
|
+
className: form.repeatable ? "inputs" : "",
|
|
41781
41881
|
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, {
|
|
41782
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
41783
|
-
|
|
41784
|
-
|
|
41785
|
-
|
|
41786
|
-
|
|
41787
|
-
|
|
41788
|
-
|
|
41789
|
-
|
|
41790
|
-
|
|
41791
|
-
|
|
41792
|
-
|
|
41793
|
-
if (Array.isArray(e)) {
|
|
41794
|
-
return e;
|
|
41795
|
-
}
|
|
41796
|
-
return e && e.fileList && e.fileList.map(f => {
|
|
41797
|
-
if (f.response) {
|
|
41798
|
-
return f.response;
|
|
41799
|
-
}
|
|
41800
|
-
return f;
|
|
41801
|
-
});
|
|
41882
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({}, field), {}, {
|
|
41883
|
+
required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
|
|
41884
|
+
}, ['total100', 'group'].includes(input.type) ? {} : {
|
|
41885
|
+
name: [field.name, inputId],
|
|
41886
|
+
fieldKey: [field.fieldKey, inputId],
|
|
41887
|
+
initialValue: inputData.value
|
|
41888
|
+
}), ['upload'].includes(input.type) ? {
|
|
41889
|
+
valuePropName: "fileList",
|
|
41890
|
+
getValueFromEvent: e => {
|
|
41891
|
+
if (Array.isArray(e)) {
|
|
41892
|
+
return e;
|
|
41802
41893
|
}
|
|
41803
|
-
|
|
41894
|
+
return e && e.fileList && e.fileList.map(f => {
|
|
41895
|
+
if (f.response) {
|
|
41896
|
+
return f.response;
|
|
41897
|
+
}
|
|
41898
|
+
return f;
|
|
41899
|
+
});
|
|
41900
|
+
}
|
|
41901
|
+
} : {}), {}, {
|
|
41804
41902
|
style: input.showOnView === false ? {
|
|
41805
41903
|
display: 'none'
|
|
41806
|
-
} : {}
|
|
41807
|
-
|
|
41808
|
-
|
|
41809
|
-
|
|
41810
|
-
|
|
41811
|
-
|
|
41812
|
-
|
|
41813
|
-
|
|
41814
|
-
|
|
41815
|
-
|
|
41816
|
-
|
|
41817
|
-
|
|
41818
|
-
} : {}),
|
|
41904
|
+
} : {}
|
|
41905
|
+
}, ['switch'].includes(input.type) ? {
|
|
41906
|
+
labelCol: {
|
|
41907
|
+
span: 20
|
|
41908
|
+
},
|
|
41909
|
+
style: _objectSpread2(_objectSpread2({}, input.showOnView === false ? {
|
|
41910
|
+
display: 'none'
|
|
41911
|
+
} : {}), {}, {
|
|
41912
|
+
flexDirection: 'row',
|
|
41913
|
+
justifyContent: 'space-between'
|
|
41914
|
+
})
|
|
41915
|
+
} : {}), {}, {
|
|
41819
41916
|
label: getInputLabel(input, values),
|
|
41820
41917
|
rules: rules,
|
|
41821
|
-
className: input.comment ?
|
|
41918
|
+
className: input.comment ? "with-comment i-".concat(input.type) : "i-".concat(input.type),
|
|
41822
41919
|
extra: input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
41823
41920
|
disabled: inputData.props.disabled,
|
|
41824
41921
|
type: "link",
|
|
41825
41922
|
onClick: () => {
|
|
41826
41923
|
const inputValues = Array.isArray(values[formId]) ? values[formId][field.name] || {} : values[formId] || {};
|
|
41827
|
-
inputValues[
|
|
41924
|
+
inputValues["".concat(inputData.inputName, "Comment")] = !inputData.commentValue ? '' : undefined;
|
|
41828
41925
|
if (Array.isArray(values[formId])) {
|
|
41829
41926
|
values[formId][field.name] = inputValues;
|
|
41830
41927
|
} else {
|
|
41831
41928
|
values[formId] = inputValues;
|
|
41832
41929
|
}
|
|
41833
|
-
setValues({
|
|
41834
|
-
...values
|
|
41835
|
-
});
|
|
41930
|
+
setValues(_objectSpread2({}, values));
|
|
41836
41931
|
},
|
|
41837
41932
|
children: t(!inputData.commentValue ? 'Add Comment' : 'Remove Comment')
|
|
41838
41933
|
}) : null,
|
|
@@ -41849,9 +41944,9 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
|
|
|
41849
41944
|
getAppHeader,
|
|
41850
41945
|
getApiBaseUrl
|
|
41851
41946
|
}) : console.log(input)
|
|
41852
|
-
}), input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
41853
|
-
name: [field.name,
|
|
41854
|
-
fieldKey: [field.fieldKey,
|
|
41947
|
+
})), input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
41948
|
+
name: [field.name, "".concat(inputData.inputName, "Comment")],
|
|
41949
|
+
fieldKey: [field.fieldKey, "".concat(inputData.inputName, "Comment")],
|
|
41855
41950
|
initialValue: inputData.commentValue,
|
|
41856
41951
|
hidden: !inputData.commentValue,
|
|
41857
41952
|
children: inputTypeComponent.comment(inputData, {
|
|
@@ -41865,10 +41960,10 @@ function renderRepeatable(options, k, setValues, values, excludedKeys, i, formTi
|
|
|
41865
41960
|
}) : null]
|
|
41866
41961
|
})]
|
|
41867
41962
|
}, ii)
|
|
41868
|
-
},
|
|
41963
|
+
}, "".concat(i).concat(ii)) : null;
|
|
41869
41964
|
})
|
|
41870
41965
|
})]
|
|
41871
|
-
},
|
|
41966
|
+
}, "".concat(formId, "-").concat(field.name))), form.repeatable ? /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
41872
41967
|
type: "dashed",
|
|
41873
41968
|
style: {
|
|
41874
41969
|
margin: '10px 0px 30px',
|
|
@@ -41897,7 +41992,7 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
|
|
|
41897
41992
|
const hasLabel = label && (typeof label === 'string' && (label || '').trim() !== '' || typeof label === 'object') ? true : false;
|
|
41898
41993
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
41899
41994
|
children: [hasLabel ? /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
41900
|
-
className:
|
|
41995
|
+
className: "".concat(form.titleClass ? form.titleClass : 'title-semibold-4', " ").concat(i ? 'mt-3 mb-1' : ''),
|
|
41901
41996
|
children: label
|
|
41902
41997
|
}) : null, /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41903
41998
|
className: hasLabel ? "mb-4" : "",
|
|
@@ -41906,8 +42001,8 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
|
|
|
41906
42001
|
const inputId = input.dataId || inp;
|
|
41907
42002
|
const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
|
|
41908
42003
|
const value = inputValues[inputId];
|
|
41909
|
-
const commentValue = inputValues[
|
|
41910
|
-
const inputData = getData(formId, input, value, commentValue,
|
|
42004
|
+
const commentValue = inputValues["".concat(inputId, "Comment")];
|
|
42005
|
+
const inputData = getData(formId, input, value, commentValue, "".concat(formId, ".").concat(inputId), "".concat(formId, ".").concat(inputId));
|
|
41911
42006
|
const subtitles = form.subtitles || null;
|
|
41912
42007
|
inputData.repeatIndex = undefined;
|
|
41913
42008
|
inputData.inputName = inputId;
|
|
@@ -41928,62 +42023,58 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
|
|
|
41928
42023
|
message: requiredRule.message || ''
|
|
41929
42024
|
});
|
|
41930
42025
|
}
|
|
41931
|
-
return showHideInput(input, values, undefined, inputValues, setValues,
|
|
42026
|
+
return showHideInput(input, values, undefined, inputValues, setValues, "".concat(formId, ".").concat(inputId)) ? /*#__PURE__*/jsxRuntime.jsx(React__default["default"].Fragment, {
|
|
41932
42027
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
41933
42028
|
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, {
|
|
41934
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
41935
|
-
required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
|
|
41936
|
-
|
|
41937
|
-
|
|
41938
|
-
|
|
41939
|
-
|
|
41940
|
-
|
|
41941
|
-
|
|
41942
|
-
|
|
41943
|
-
|
|
41944
|
-
|
|
41945
|
-
return e;
|
|
41946
|
-
}
|
|
41947
|
-
return e && e.fileList && e.fileList.map(f => {
|
|
41948
|
-
if (f.response) {
|
|
41949
|
-
return f.response;
|
|
41950
|
-
}
|
|
41951
|
-
return f;
|
|
41952
|
-
});
|
|
42029
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
42030
|
+
required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
|
|
42031
|
+
}, ['total100', 'group'].includes(input.type) ? {} : {
|
|
42032
|
+
name: [formId, inputId],
|
|
42033
|
+
fieldKey: [formId, inputId],
|
|
42034
|
+
initialValue: inputData.value
|
|
42035
|
+
}), ['upload'].includes(input.type) ? {
|
|
42036
|
+
valuePropName: "fileList",
|
|
42037
|
+
getValueFromEvent: e => {
|
|
42038
|
+
if (Array.isArray(e)) {
|
|
42039
|
+
return e;
|
|
41953
42040
|
}
|
|
41954
|
-
|
|
42041
|
+
return e && e.fileList && e.fileList.map(f => {
|
|
42042
|
+
if (f.response) {
|
|
42043
|
+
return f.response;
|
|
42044
|
+
}
|
|
42045
|
+
return f;
|
|
42046
|
+
});
|
|
42047
|
+
}
|
|
42048
|
+
} : {}), {}, {
|
|
41955
42049
|
style: input.showOnView === false ? {
|
|
41956
42050
|
display: 'none'
|
|
41957
|
-
} : {}
|
|
41958
|
-
|
|
41959
|
-
|
|
41960
|
-
|
|
41961
|
-
|
|
41962
|
-
|
|
41963
|
-
|
|
41964
|
-
|
|
41965
|
-
|
|
41966
|
-
|
|
41967
|
-
|
|
41968
|
-
|
|
41969
|
-
} : {}),
|
|
42051
|
+
} : {}
|
|
42052
|
+
}, ['switch'].includes(input.type) ? {
|
|
42053
|
+
labelCol: {
|
|
42054
|
+
span: 20
|
|
42055
|
+
},
|
|
42056
|
+
style: _objectSpread2(_objectSpread2({}, input.showOnView === false ? {
|
|
42057
|
+
display: 'none'
|
|
42058
|
+
} : {}), {}, {
|
|
42059
|
+
flexDirection: 'row',
|
|
42060
|
+
justifyContent: 'space-between'
|
|
42061
|
+
})
|
|
42062
|
+
} : {}), {}, {
|
|
41970
42063
|
label: getInputLabel(input, values),
|
|
41971
42064
|
rules: rules,
|
|
41972
|
-
className: input.comment ?
|
|
42065
|
+
className: input.comment ? "with-comment i-".concat(input.type) : "i-".concat(input.type),
|
|
41973
42066
|
extra: input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
41974
42067
|
disabled: inputData.props.disabled,
|
|
41975
42068
|
type: "link",
|
|
41976
42069
|
onClick: () => {
|
|
41977
42070
|
const inputValues = Array.isArray(values[formId]) ? values[formId] || {} : values[formId] || {};
|
|
41978
|
-
inputValues[
|
|
42071
|
+
inputValues["".concat(inputData.inputName, "Comment")] = !inputData.commentValue ? '' : undefined;
|
|
41979
42072
|
if (Array.isArray(values[formId])) {
|
|
41980
42073
|
values[formId] = inputValues;
|
|
41981
42074
|
} else {
|
|
41982
42075
|
values[formId] = inputValues;
|
|
41983
42076
|
}
|
|
41984
|
-
setValues({
|
|
41985
|
-
...values
|
|
41986
|
-
});
|
|
42077
|
+
setValues(_objectSpread2({}, values));
|
|
41987
42078
|
},
|
|
41988
42079
|
children: t(!inputData.commentValue ? 'Add Comment' : 'Remove Comment')
|
|
41989
42080
|
}) : null,
|
|
@@ -41998,9 +42089,9 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
|
|
|
41998
42089
|
getAppHeader,
|
|
41999
42090
|
getApiBaseUrl
|
|
42000
42091
|
}) : console.log(input)
|
|
42001
|
-
}), input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
42002
|
-
name: [formId,
|
|
42003
|
-
fieldKey: [formId,
|
|
42092
|
+
})), input.comment ? /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
42093
|
+
name: [formId, "".concat(inputData.inputName, "Comment")],
|
|
42094
|
+
fieldKey: [formId, "".concat(inputData.inputName, "Comment")],
|
|
42004
42095
|
initialValue: inputData.commentValue,
|
|
42005
42096
|
hidden: !inputData.commentValue,
|
|
42006
42097
|
children: inputTypeComponent.comment(inputData, {
|
|
@@ -42014,7 +42105,7 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
|
|
|
42014
42105
|
}) : null]
|
|
42015
42106
|
})]
|
|
42016
42107
|
}, ii)
|
|
42017
|
-
},
|
|
42108
|
+
}, "".concat(i).concat(ii)) : null;
|
|
42018
42109
|
})
|
|
42019
42110
|
})]
|
|
42020
42111
|
});
|