datastake-daf 0.6.818 → 0.6.819
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 +1161 -1064
- package/dist/pages/index.js +42 -31
- package/dist/services/index.js +0 -5
- package/package.json +1 -1
- package/src/@daf/core/components/ViewForm/components/Records/config.js +1 -0
- package/src/@daf/core/components/ViewForm/components/Records/index.jsx +0 -1
- package/src/@daf/pages/Dashboards/SupplyChain/components/KeyIndicators/config.js +2 -2
- package/src/@daf/pages/Dashboards/SupplyChain/components/KeyIndicators/index.js +3 -2
- package/src/@daf/pages/Dashboards/SupplyChain/index.jsx +4 -1
- package/src/@daf/pages/Dashboards/UserDashboard/components/KeyIndicators/config.js +3 -3
- package/src/@daf/pages/Dashboards/UserDashboard/components/KeyIndicators/index.jsx +4 -2
- package/src/@daf/pages/Dashboards/UserDashboard/components/MineSites/config.js +2 -2
- package/src/@daf/pages/Dashboards/UserDashboard/config.js +2 -2
- package/src/@daf/pages/Dashboards/UserDashboard/index.jsx +1 -0
- package/src/@daf/pages/Dashboards/helper.js +2 -2
- package/src/@daf/pages/Events/config.js +1 -1
- package/src/@daf/pages/Locations/MineSite/columns.js +1 -1
- package/src/@daf/pages/TablePage/create.jsx +3 -1
- package/src/@daf/pages/TablePage/hook.js +2 -0
- package/src/@daf/services/LinkedSubjects.js +1 -1
- package/dist/style/datastake/mapbox-gl.css +0 -330
package/dist/components/index.js
CHANGED
|
@@ -4817,7 +4817,7 @@ const config$2 = {
|
|
|
4817
4817
|
AddDocument: config$3
|
|
4818
4818
|
};
|
|
4819
4819
|
|
|
4820
|
-
const _excluded$
|
|
4820
|
+
const _excluded$G = ["width", "height", "size", "name", "fill"];
|
|
4821
4821
|
const CustomIcon = _ref => {
|
|
4822
4822
|
let {
|
|
4823
4823
|
width = 14,
|
|
@@ -4826,7 +4826,7 @@ const CustomIcon = _ref => {
|
|
|
4826
4826
|
name = "",
|
|
4827
4827
|
fill = "none"
|
|
4828
4828
|
} = _ref,
|
|
4829
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
4829
|
+
props = _objectWithoutProperties(_ref, _excluded$G);
|
|
4830
4830
|
const conf = config$2[name];
|
|
4831
4831
|
if (conf) {
|
|
4832
4832
|
return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -5115,7 +5115,7 @@ createCommonjsModule(function (module, exports) {
|
|
|
5115
5115
|
!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])+"]"}}}));
|
|
5116
5116
|
});
|
|
5117
5117
|
|
|
5118
|
-
const _excluded$
|
|
5118
|
+
const _excluded$F = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
|
|
5119
5119
|
dayjs__default["default"].extend(customParseFormat);
|
|
5120
5120
|
dayjs__default["default"].extend(utc);
|
|
5121
5121
|
dayjs__default["default"].extend(utc);
|
|
@@ -5491,7 +5491,7 @@ const filterCreateData = data => {
|
|
|
5491
5491
|
createdAt,
|
|
5492
5492
|
updatedAt
|
|
5493
5493
|
} = data,
|
|
5494
|
-
rest = _objectWithoutProperties(data, _excluded$
|
|
5494
|
+
rest = _objectWithoutProperties(data, _excluded$F);
|
|
5495
5495
|
const _meta = isObjectEmpty(meta) ? undefined : meta;
|
|
5496
5496
|
return _objectSpread2(_objectSpread2({}, rest), {}, {
|
|
5497
5497
|
meta: _meta
|
|
@@ -6023,7 +6023,7 @@ SelectFilters.propTypes = {
|
|
|
6023
6023
|
apiUrl: PropTypes__default["default"].string
|
|
6024
6024
|
};
|
|
6025
6025
|
|
|
6026
|
-
const _excluded$
|
|
6026
|
+
const _excluded$E = ["columns", "data", "defaultFilters", "style", "pagination", "loading", "onChange", "onFilterChange", "selectOptions", "filtersConfig", "rowSelection", "setShowFilters", "rowKey", "showFilters", "hideOnLoading", "sourcesKey", "className", "projects", "t", "selectedProject", "sourceId", "projectSources", "language", "scrollX", "apiUrl", "app", "doEmptyRows"];
|
|
6027
6027
|
function DAFTable(_ref) {
|
|
6028
6028
|
let {
|
|
6029
6029
|
columns = [],
|
|
@@ -6054,7 +6054,7 @@ function DAFTable(_ref) {
|
|
|
6054
6054
|
app,
|
|
6055
6055
|
doEmptyRows
|
|
6056
6056
|
} = _ref,
|
|
6057
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
6057
|
+
rest = _objectWithoutProperties(_ref, _excluded$E);
|
|
6058
6058
|
const source = React.useMemo(() => {
|
|
6059
6059
|
if (data && Array.isArray(data)) {
|
|
6060
6060
|
return data;
|
|
@@ -6879,7 +6879,7 @@ function ComponentWithFocus(_ref) {
|
|
|
6879
6879
|
}
|
|
6880
6880
|
|
|
6881
6881
|
var _templateObject$h;
|
|
6882
|
-
const _excluded$
|
|
6882
|
+
const _excluded$D = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
|
|
6883
6883
|
function StickyTable(_ref) {
|
|
6884
6884
|
let {
|
|
6885
6885
|
size = "small",
|
|
@@ -6890,7 +6890,7 @@ function StickyTable(_ref) {
|
|
|
6890
6890
|
pagination = false,
|
|
6891
6891
|
doEmptyRows = true
|
|
6892
6892
|
} = _ref,
|
|
6893
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
6893
|
+
props = _objectWithoutProperties(_ref, _excluded$D);
|
|
6894
6894
|
const data = React__default["default"].useMemo(() => {
|
|
6895
6895
|
if (!doEmptyRows) {
|
|
6896
6896
|
return dataSource;
|
|
@@ -7418,7 +7418,7 @@ const BTN_SIZE = {
|
|
|
7418
7418
|
LG: 'large'
|
|
7419
7419
|
};
|
|
7420
7420
|
|
|
7421
|
-
const _excluded$
|
|
7421
|
+
const _excluded$C = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
|
|
7422
7422
|
function DafButton(_ref) {
|
|
7423
7423
|
let {
|
|
7424
7424
|
content = '',
|
|
@@ -7432,7 +7432,7 @@ function DafButton(_ref) {
|
|
|
7432
7432
|
style = {},
|
|
7433
7433
|
className = ''
|
|
7434
7434
|
} = _ref,
|
|
7435
|
-
restProps = _objectWithoutProperties(_ref, _excluded$
|
|
7435
|
+
restProps = _objectWithoutProperties(_ref, _excluded$C);
|
|
7436
7436
|
return /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
|
|
7437
7437
|
icon: icon,
|
|
7438
7438
|
type: type,
|
|
@@ -7551,12 +7551,12 @@ const Style$R = styled__default["default"].div`
|
|
|
7551
7551
|
}
|
|
7552
7552
|
`;
|
|
7553
7553
|
|
|
7554
|
-
const _excluded$
|
|
7554
|
+
const _excluded$B = ["children"];
|
|
7555
7555
|
const BorderedButton = _ref => {
|
|
7556
7556
|
let {
|
|
7557
7557
|
children
|
|
7558
7558
|
} = _ref,
|
|
7559
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
7559
|
+
props = _objectWithoutProperties(_ref, _excluded$B);
|
|
7560
7560
|
return /*#__PURE__*/jsxRuntime.jsx(Style$R, {
|
|
7561
7561
|
className: "d-btn-cont",
|
|
7562
7562
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -7696,12 +7696,12 @@ Badge.propTypes = {
|
|
|
7696
7696
|
props: PropTypes__default["default"].object
|
|
7697
7697
|
};
|
|
7698
7698
|
|
|
7699
|
-
const _excluded$
|
|
7699
|
+
const _excluded$A = ["icon"];
|
|
7700
7700
|
function GetIcon(_ref) {
|
|
7701
7701
|
let {
|
|
7702
7702
|
icon
|
|
7703
7703
|
} = _ref,
|
|
7704
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
7704
|
+
props = _objectWithoutProperties(_ref, _excluded$A);
|
|
7705
7705
|
let Icon = Icons__namespace.CloseOutlined;
|
|
7706
7706
|
if (Icons__namespace[icon]) {
|
|
7707
7707
|
Icon = Icons__namespace[icon];
|
|
@@ -8031,7 +8031,7 @@ const MultiSelectStyled = styled__default["default"](antd.Select)`
|
|
|
8031
8031
|
}
|
|
8032
8032
|
`;
|
|
8033
8033
|
|
|
8034
|
-
const _excluded$
|
|
8034
|
+
const _excluded$z = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
|
|
8035
8035
|
const {
|
|
8036
8036
|
useToken: useToken$n
|
|
8037
8037
|
} = antd.theme;
|
|
@@ -8124,7 +8124,7 @@ function Multiselect(_ref) {
|
|
|
8124
8124
|
isSingle = false,
|
|
8125
8125
|
selectionType = SELECTION_TYPES.DEFAULT
|
|
8126
8126
|
} = _ref,
|
|
8127
|
-
restProps = _objectWithoutProperties(_ref, _excluded$
|
|
8127
|
+
restProps = _objectWithoutProperties(_ref, _excluded$z);
|
|
8128
8128
|
const {
|
|
8129
8129
|
token
|
|
8130
8130
|
} = useToken$n();
|
|
@@ -8844,7 +8844,7 @@ DAFHeader.propTypes = {
|
|
|
8844
8844
|
filtersConfig: PropTypes__default["default"].any
|
|
8845
8845
|
};
|
|
8846
8846
|
|
|
8847
|
-
const _excluded$
|
|
8847
|
+
const _excluded$y = ["tabs", "onChange", "value", "className"];
|
|
8848
8848
|
function TabsHeader(_ref) {
|
|
8849
8849
|
let {
|
|
8850
8850
|
tabs = [],
|
|
@@ -8852,7 +8852,7 @@ function TabsHeader(_ref) {
|
|
|
8852
8852
|
value = '',
|
|
8853
8853
|
className = 'mt-2'
|
|
8854
8854
|
} = _ref,
|
|
8855
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
8855
|
+
rest = _objectWithoutProperties(_ref, _excluded$y);
|
|
8856
8856
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8857
8857
|
className: formatClassname(['daf-tabs-header pl-6 pr-6', className]),
|
|
8858
8858
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Tabs, _objectSpread2({
|
|
@@ -8949,7 +8949,7 @@ DrawerHeader.propTypes = {
|
|
|
8949
8949
|
tabsConfig: PropTypes__default["default"].any
|
|
8950
8950
|
};
|
|
8951
8951
|
|
|
8952
|
-
const _excluded$
|
|
8952
|
+
const _excluded$x = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
|
|
8953
8953
|
const useFooter = _ref => {
|
|
8954
8954
|
let {
|
|
8955
8955
|
leftContent,
|
|
@@ -8984,7 +8984,7 @@ const useFooter = _ref => {
|
|
|
8984
8984
|
style = {},
|
|
8985
8985
|
className = ""
|
|
8986
8986
|
} = button,
|
|
8987
|
-
restProps = _objectWithoutProperties(button, _excluded$
|
|
8987
|
+
restProps = _objectWithoutProperties(button, _excluded$x);
|
|
8988
8988
|
return /*#__PURE__*/jsxRuntime.jsx(DafButton, _objectSpread2({
|
|
8989
8989
|
content: label,
|
|
8990
8990
|
type: type,
|
|
@@ -11865,7 +11865,7 @@ Widget.propTypes = {
|
|
|
11865
11865
|
};
|
|
11866
11866
|
Widget.displayName = 'Widget';
|
|
11867
11867
|
|
|
11868
|
-
const _excluded$
|
|
11868
|
+
const _excluded$w = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
|
|
11869
11869
|
function ImageWidget(_ref) {
|
|
11870
11870
|
let {
|
|
11871
11871
|
loading = false,
|
|
@@ -11876,7 +11876,7 @@ function ImageWidget(_ref) {
|
|
|
11876
11876
|
noDescriptionText,
|
|
11877
11877
|
isPdf = false
|
|
11878
11878
|
} = _ref,
|
|
11879
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
11879
|
+
props = _objectWithoutProperties(_ref, _excluded$w);
|
|
11880
11880
|
const expandable = isPdf ? false : props.expandable;
|
|
11881
11881
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
11882
11882
|
loading: loading,
|
|
@@ -11936,7 +11936,7 @@ function ImageWidget(_ref) {
|
|
|
11936
11936
|
ImageWidget.displayName = 'ImageWidget';
|
|
11937
11937
|
|
|
11938
11938
|
var _templateObject$e;
|
|
11939
|
-
const _excluded$
|
|
11939
|
+
const _excluded$v = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
|
|
11940
11940
|
function FlowWidget(_ref) {
|
|
11941
11941
|
let {
|
|
11942
11942
|
title,
|
|
@@ -11948,7 +11948,7 @@ function FlowWidget(_ref) {
|
|
|
11948
11948
|
className,
|
|
11949
11949
|
direction = "horizontal"
|
|
11950
11950
|
} = _ref,
|
|
11951
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11951
|
+
rest = _objectWithoutProperties(_ref, _excluded$v);
|
|
11952
11952
|
const [activeTab, setActiveTab] = React.useState();
|
|
11953
11953
|
React.useEffect(() => {
|
|
11954
11954
|
if (defaultActiveTab) {
|
|
@@ -15679,7 +15679,7 @@ Map$3.propTypes = {
|
|
|
15679
15679
|
link: PropTypes__default["default"].any
|
|
15680
15680
|
};
|
|
15681
15681
|
|
|
15682
|
-
const _excluded$
|
|
15682
|
+
const _excluded$u = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
|
|
15683
15683
|
function InExpandableWidgetMap(_ref) {
|
|
15684
15684
|
let {
|
|
15685
15685
|
isExpanded,
|
|
@@ -15693,7 +15693,7 @@ function InExpandableWidgetMap(_ref) {
|
|
|
15693
15693
|
height,
|
|
15694
15694
|
widgetConfig
|
|
15695
15695
|
} = _ref,
|
|
15696
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
15696
|
+
rest = _objectWithoutProperties(_ref, _excluded$u);
|
|
15697
15697
|
const [mapKey, setMapKey] = React.useState(0);
|
|
15698
15698
|
const [isMapReady, setIsMapReady] = React.useState(false);
|
|
15699
15699
|
React.useEffect(() => {
|
|
@@ -17893,14 +17893,14 @@ const MapConfig = ({
|
|
|
17893
17893
|
});
|
|
17894
17894
|
};
|
|
17895
17895
|
|
|
17896
|
-
const _excluded$
|
|
17896
|
+
const _excluded$t = ["config", "title", "loading"];
|
|
17897
17897
|
const Details = _ref => {
|
|
17898
17898
|
let {
|
|
17899
17899
|
config = [],
|
|
17900
17900
|
title,
|
|
17901
17901
|
loading = false
|
|
17902
17902
|
} = _ref,
|
|
17903
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17903
|
+
rest = _objectWithoutProperties(_ref, _excluded$t);
|
|
17904
17904
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
17905
17905
|
className: "with-border-header h-w-btn-header card",
|
|
17906
17906
|
loading: loading,
|
|
@@ -17916,14 +17916,14 @@ const Details = _ref => {
|
|
|
17916
17916
|
}));
|
|
17917
17917
|
};
|
|
17918
17918
|
|
|
17919
|
-
const _excluded$
|
|
17919
|
+
const _excluded$s = ["config", "title", "loading"];
|
|
17920
17920
|
const KeyIndicatorsDetails = _ref => {
|
|
17921
17921
|
let {
|
|
17922
17922
|
config,
|
|
17923
17923
|
title,
|
|
17924
17924
|
loading = false
|
|
17925
17925
|
} = _ref,
|
|
17926
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17926
|
+
rest = _objectWithoutProperties(_ref, _excluded$s);
|
|
17927
17927
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
17928
17928
|
className: "with-border-header h-w-btn-header",
|
|
17929
17929
|
title: title,
|
|
@@ -17953,7 +17953,7 @@ const Style$G = styled__default["default"].div`
|
|
|
17953
17953
|
}
|
|
17954
17954
|
`;
|
|
17955
17955
|
|
|
17956
|
-
const _excluded$
|
|
17956
|
+
const _excluded$r = ["children", "config", "detailsTitle", "firstColumnWidth"];
|
|
17957
17957
|
const DetailsSection = _ref => {
|
|
17958
17958
|
let {
|
|
17959
17959
|
children,
|
|
@@ -17961,7 +17961,7 @@ const DetailsSection = _ref => {
|
|
|
17961
17961
|
detailsTitle,
|
|
17962
17962
|
firstColumnWidth = "250px"
|
|
17963
17963
|
} = _ref,
|
|
17964
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17964
|
+
rest = _objectWithoutProperties(_ref, _excluded$r);
|
|
17965
17965
|
return /*#__PURE__*/jsxRuntime.jsx(Style$G, {
|
|
17966
17966
|
firstColumnWidth: firstColumnWidth,
|
|
17967
17967
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -18137,14 +18137,14 @@ const getGoalConfig = () => {
|
|
|
18137
18137
|
};
|
|
18138
18138
|
|
|
18139
18139
|
var _templateObject$c;
|
|
18140
|
-
const _excluded$
|
|
18140
|
+
const _excluded$q = ["title", "activeSdgGoals", "t"];
|
|
18141
18141
|
function SDGWidget(_ref) {
|
|
18142
18142
|
let {
|
|
18143
18143
|
title = "Sustainable Development Goals",
|
|
18144
18144
|
activeSdgGoals = [],
|
|
18145
18145
|
t = key => key
|
|
18146
18146
|
} = _ref,
|
|
18147
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18147
|
+
props = _objectWithoutProperties(_ref, _excluded$q);
|
|
18148
18148
|
const sdgConfig = getGoalConfig();
|
|
18149
18149
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
18150
18150
|
title: title,
|
|
@@ -18442,7 +18442,7 @@ function SdgList({
|
|
|
18442
18442
|
});
|
|
18443
18443
|
}
|
|
18444
18444
|
|
|
18445
|
-
const _excluded$
|
|
18445
|
+
const _excluded$p = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
|
|
18446
18446
|
const {
|
|
18447
18447
|
Meta
|
|
18448
18448
|
} = antd.Card;
|
|
@@ -18462,7 +18462,7 @@ function ProjectWidget(_ref) {
|
|
|
18462
18462
|
hideSDGList = false,
|
|
18463
18463
|
t = x => x
|
|
18464
18464
|
} = _ref,
|
|
18465
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18465
|
+
props = _objectWithoutProperties(_ref, _excluded$p);
|
|
18466
18466
|
const [isHovered, setIsHovered] = React__default["default"].useState(false);
|
|
18467
18467
|
const {
|
|
18468
18468
|
token
|
|
@@ -18734,13 +18734,13 @@ const WidgetCard = _ref => {
|
|
|
18734
18734
|
});
|
|
18735
18735
|
};
|
|
18736
18736
|
|
|
18737
|
-
const _excluded$
|
|
18737
|
+
const _excluded$o = ["title", "children"];
|
|
18738
18738
|
const CarouselWidget = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
18739
18739
|
let {
|
|
18740
18740
|
title,
|
|
18741
18741
|
children
|
|
18742
18742
|
} = _ref,
|
|
18743
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
18743
|
+
rest = _objectWithoutProperties(_ref, _excluded$o);
|
|
18744
18744
|
/**
|
|
18745
18745
|
* Handles carousel slide change events
|
|
18746
18746
|
* @param {number} currentSlide - The index of the current slide after change
|
|
@@ -18904,7 +18904,7 @@ const EmptyStateContainer = styled__default["default"].div`
|
|
|
18904
18904
|
}
|
|
18905
18905
|
`;
|
|
18906
18906
|
|
|
18907
|
-
const _excluded$
|
|
18907
|
+
const _excluded$n = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
|
|
18908
18908
|
function ImageCarousel(_ref) {
|
|
18909
18909
|
let {
|
|
18910
18910
|
title,
|
|
@@ -18919,7 +18919,7 @@ function ImageCarousel(_ref) {
|
|
|
18919
18919
|
emptyLogo = antd.Empty.PRESENTED_IMAGE_SIMPLE,
|
|
18920
18920
|
emptyText = "No Image"
|
|
18921
18921
|
} = _ref,
|
|
18922
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
18922
|
+
rest = _objectWithoutProperties(_ref, _excluded$n);
|
|
18923
18923
|
const [previewVisible, setPreviewVisible] = React.useState(false);
|
|
18924
18924
|
const [current, setCurrent] = React.useState(0);
|
|
18925
18925
|
const carouselRef = React.useRef(null);
|
|
@@ -19288,7 +19288,7 @@ const getVegetationConfig = () => {
|
|
|
19288
19288
|
};
|
|
19289
19289
|
|
|
19290
19290
|
var _templateObject$a, _templateObject2$3;
|
|
19291
|
-
const _excluded$
|
|
19291
|
+
const _excluded$m = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
|
|
19292
19292
|
function VegetationWidget(_ref) {
|
|
19293
19293
|
let {
|
|
19294
19294
|
title = "Vegetation Health",
|
|
@@ -19300,7 +19300,7 @@ function VegetationWidget(_ref) {
|
|
|
19300
19300
|
growthObservations = [],
|
|
19301
19301
|
t = key => key
|
|
19302
19302
|
} = _ref,
|
|
19303
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19303
|
+
props = _objectWithoutProperties(_ref, _excluded$m);
|
|
19304
19304
|
let vegetationConfig = getVegetationConfig();
|
|
19305
19305
|
const allVegetationKeys = vegetationConfig.map(item => item.key);
|
|
19306
19306
|
if (filterKeys && Array.isArray(filterKeys)) {
|
|
@@ -19416,7 +19416,7 @@ const getFaunaConfig = () => {
|
|
|
19416
19416
|
};
|
|
19417
19417
|
|
|
19418
19418
|
var _templateObject$9, _templateObject2$2;
|
|
19419
|
-
const _excluded$
|
|
19419
|
+
const _excluded$l = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
|
|
19420
19420
|
function FaunaWidget(_ref) {
|
|
19421
19421
|
let {
|
|
19422
19422
|
title = "Observed Fauna",
|
|
@@ -19427,7 +19427,7 @@ function FaunaWidget(_ref) {
|
|
|
19427
19427
|
itemHeight = 100,
|
|
19428
19428
|
t = key => key
|
|
19429
19429
|
} = _ref,
|
|
19430
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19430
|
+
props = _objectWithoutProperties(_ref, _excluded$l);
|
|
19431
19431
|
let faunaConfig = getFaunaConfig();
|
|
19432
19432
|
|
|
19433
19433
|
// Filter to show only specific keys if filterKeys is provided
|
|
@@ -19492,7 +19492,7 @@ const getInvasiveSpeciesConfig = () => {
|
|
|
19492
19492
|
};
|
|
19493
19493
|
|
|
19494
19494
|
var _templateObject$8, _templateObject2$1;
|
|
19495
|
-
const _excluded$
|
|
19495
|
+
const _excluded$k = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
|
|
19496
19496
|
function InvasiveSpeciesWidget(_ref) {
|
|
19497
19497
|
let {
|
|
19498
19498
|
title = "Invasive Species",
|
|
@@ -19504,7 +19504,7 @@ function InvasiveSpeciesWidget(_ref) {
|
|
|
19504
19504
|
itemHeight = 100,
|
|
19505
19505
|
t = key => key
|
|
19506
19506
|
} = _ref,
|
|
19507
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19507
|
+
props = _objectWithoutProperties(_ref, _excluded$k);
|
|
19508
19508
|
let invasiveSpeciesConfig = getInvasiveSpeciesConfig();
|
|
19509
19509
|
|
|
19510
19510
|
// Filter to show only specific keys if filterKeys is provided
|
|
@@ -24927,8 +24927,8 @@ const RepeatableModals = ({
|
|
|
24927
24927
|
}) : null;
|
|
24928
24928
|
};
|
|
24929
24929
|
|
|
24930
|
-
const _excluded$
|
|
24931
|
-
_excluded2$
|
|
24930
|
+
const _excluded$j = ["viewGroup"],
|
|
24931
|
+
_excluded2$1 = ["label", "icon", "position"];
|
|
24932
24932
|
const Content$1 = _ref => {
|
|
24933
24933
|
let {
|
|
24934
24934
|
style = {},
|
|
@@ -24999,7 +24999,7 @@ const Content$1 = _ref => {
|
|
|
24999
24999
|
if (groups[gKey].viewGroup === key) {
|
|
25000
25000
|
// eslint-disable-next-line no-unused-vars
|
|
25001
25001
|
const _groups$gKey = groups[gKey],
|
|
25002
|
-
gCfg = _objectWithoutProperties(_groups$gKey, _excluded$
|
|
25002
|
+
gCfg = _objectWithoutProperties(_groups$gKey, _excluded$j);
|
|
25003
25003
|
items[gKey] = gCfg;
|
|
25004
25004
|
}
|
|
25005
25005
|
return items;
|
|
@@ -25227,7 +25227,7 @@ const Content$1 = _ref => {
|
|
|
25227
25227
|
showIcon: true
|
|
25228
25228
|
});
|
|
25229
25229
|
}
|
|
25230
|
-
let groups = _objectWithoutProperties(f, _excluded2$
|
|
25230
|
+
let groups = _objectWithoutProperties(f, _excluded2$1);
|
|
25231
25231
|
groups = Object.keys(groups).reduce((items, key) => {
|
|
25232
25232
|
var _groups$key2;
|
|
25233
25233
|
if (!((_groups$key2 = groups[key]) !== null && _groups$key2 !== void 0 && (_groups$key2 = _groups$key2.meta) !== null && _groups$key2 !== void 0 && _groups$key2.excludeFromView)) {
|
|
@@ -25279,7 +25279,7 @@ const Content$1 = _ref => {
|
|
|
25279
25279
|
});
|
|
25280
25280
|
};
|
|
25281
25281
|
|
|
25282
|
-
const _excluded$
|
|
25282
|
+
const _excluded$i = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
|
|
25283
25283
|
function Modal(_ref) {
|
|
25284
25284
|
let {
|
|
25285
25285
|
t = text => text,
|
|
@@ -25295,7 +25295,7 @@ function Modal(_ref) {
|
|
|
25295
25295
|
disabled = false,
|
|
25296
25296
|
withModalFormWrapper = true
|
|
25297
25297
|
} = _ref,
|
|
25298
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
25298
|
+
props = _objectWithoutProperties(_ref, _excluded$i);
|
|
25299
25299
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Modal, _objectSpread2(_objectSpread2({
|
|
25300
25300
|
width: 650,
|
|
25301
25301
|
footer: null,
|
|
@@ -25869,6 +25869,7 @@ const getSourcesType = subject => {
|
|
|
25869
25869
|
locations: "location",
|
|
25870
25870
|
location: "location",
|
|
25871
25871
|
"production-sites": "location",
|
|
25872
|
+
scl: "location",
|
|
25872
25873
|
stakeholders: "stakeholder",
|
|
25873
25874
|
stakeholder: "stakeholder",
|
|
25874
25875
|
workers: "stakeholder",
|
|
@@ -25927,9 +25928,6 @@ const Records = _ref => {
|
|
|
25927
25928
|
source: selectedSource
|
|
25928
25929
|
}
|
|
25929
25930
|
});
|
|
25930
|
-
console.log({
|
|
25931
|
-
data
|
|
25932
|
-
});
|
|
25933
25931
|
setVersions(data);
|
|
25934
25932
|
} catch (error) {
|
|
25935
25933
|
console.error('Error fetching versions:', error);
|
|
@@ -35944,13 +35942,11 @@ const beforeUpload = allowedExtensions => file => {
|
|
|
35944
35942
|
};
|
|
35945
35943
|
const allowedImageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.avif', '.bmp', '.tiff', '.tif', '.heif', '.heic', '.svg', '.ico'];
|
|
35946
35944
|
|
|
35947
|
-
|
|
35948
|
-
_excluded2$1 = ["label", "description", "excludeFromEdit", "showFormIf", "icon", "position", "template", "formClass"];
|
|
35945
|
+
/* eslint-disable no-case-declarations */
|
|
35949
35946
|
dayjs__default["default"].extend(utc);
|
|
35950
35947
|
dayjs__default["default"].extend(timezone);
|
|
35951
35948
|
dayjs__default["default"].tz.setDefault("UTC");
|
|
35952
|
-
const getDefaultInputValue =
|
|
35953
|
-
let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
35949
|
+
const getDefaultInputValue = (input = {}) => {
|
|
35954
35950
|
let value = undefined;
|
|
35955
35951
|
if (input.type === "multiselect") {
|
|
35956
35952
|
value = [];
|
|
@@ -35968,30 +35964,33 @@ const checkCondition$1 = (condition, repeatValues, formsValue) => {
|
|
|
35968
35964
|
const isShown = _checkValue(isNotEmpty ? field : wantedValue, match, isNotEmpty ? formValue : value);
|
|
35969
35965
|
return isShown;
|
|
35970
35966
|
};
|
|
35971
|
-
const renderDataLinkGroup =
|
|
35972
|
-
|
|
35973
|
-
|
|
35974
|
-
|
|
35975
|
-
|
|
35976
|
-
|
|
35977
|
-
|
|
35978
|
-
|
|
35979
|
-
|
|
35980
|
-
|
|
35981
|
-
|
|
35982
|
-
|
|
35983
|
-
|
|
35984
|
-
const
|
|
35985
|
-
|
|
35986
|
-
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";
|
|
35987
|
-
});
|
|
35988
|
-
const dataLinkInput = ((input === null || input === void 0 ? void 0 : input.inputs) || {})[dataLinkKey];
|
|
35989
|
-
const otherInputs = Object.keys((input === null || input === void 0 ? void 0 : input.inputs) || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
|
|
35990
|
-
all[key] = input === null || input === void 0 ? void 0 : input.inputs[key];
|
|
35967
|
+
const renderDataLinkGroup = ({
|
|
35968
|
+
input,
|
|
35969
|
+
groupFormId,
|
|
35970
|
+
name,
|
|
35971
|
+
formsValue,
|
|
35972
|
+
form,
|
|
35973
|
+
onValuesChange,
|
|
35974
|
+
setValues,
|
|
35975
|
+
changeLinking,
|
|
35976
|
+
isHighlighted
|
|
35977
|
+
}) => {
|
|
35978
|
+
const dataLinkKey = Object.keys(input?.inputs || {}).find(k => input?.inputs[k]?.type === "dataLink");
|
|
35979
|
+
const dataLinkInput = (input?.inputs || {})[dataLinkKey];
|
|
35980
|
+
const otherInputs = Object.keys(input?.inputs || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
|
|
35981
|
+
all[key] = input?.inputs[key];
|
|
35991
35982
|
return all;
|
|
35992
35983
|
}, {});
|
|
35993
|
-
const isSingle =
|
|
35994
|
-
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [
|
|
35984
|
+
const isSingle = input?.meta?.maxRepeat === 1;
|
|
35985
|
+
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
|
|
35986
|
+
...(formsValue[groupFormId] || {})[name]
|
|
35987
|
+
}] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
|
|
35988
|
+
...v
|
|
35989
|
+
})) : isSingle ? formsValue[name] ? [{
|
|
35990
|
+
...formsValue[name]
|
|
35991
|
+
}] : [] : getArray(formsValue[name] || []).map(v => ({
|
|
35992
|
+
...v
|
|
35993
|
+
}));
|
|
35995
35994
|
const onUpdate = (val, i) => {
|
|
35996
35995
|
const _val = isSingle ? {
|
|
35997
35996
|
[name]: val
|
|
@@ -35999,20 +35998,31 @@ const renderDataLinkGroup = _ref2 => {
|
|
|
35999
35998
|
[name]: formData.map((d, j) => i === j ? val : d)
|
|
36000
35999
|
};
|
|
36001
36000
|
if (groupFormId) {
|
|
36002
|
-
const _defaultData =
|
|
36003
|
-
const _newData =
|
|
36004
|
-
|
|
36001
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36002
|
+
const _newData = {
|
|
36003
|
+
..._defaultData,
|
|
36004
|
+
..._val
|
|
36005
|
+
};
|
|
36006
|
+
onValuesChange(_newData, {
|
|
36007
|
+
...formsValue,
|
|
36005
36008
|
[groupFormId]: _newData
|
|
36006
|
-
})
|
|
36007
|
-
form
|
|
36008
|
-
setValues(
|
|
36009
|
+
});
|
|
36010
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36011
|
+
setValues({
|
|
36012
|
+
...formsValue,
|
|
36009
36013
|
[groupFormId]: _newData
|
|
36010
|
-
})
|
|
36014
|
+
});
|
|
36011
36015
|
return;
|
|
36012
36016
|
}
|
|
36013
|
-
onValuesChange(_val,
|
|
36014
|
-
|
|
36015
|
-
|
|
36017
|
+
onValuesChange(_val, {
|
|
36018
|
+
...formsValue,
|
|
36019
|
+
..._val
|
|
36020
|
+
});
|
|
36021
|
+
form?.setFieldValue(name, _val[name]);
|
|
36022
|
+
setValues({
|
|
36023
|
+
...formsValue,
|
|
36024
|
+
..._val
|
|
36025
|
+
});
|
|
36016
36026
|
};
|
|
36017
36027
|
return /*#__PURE__*/jsxRuntime.jsx(DataLinkGroup, {
|
|
36018
36028
|
form: input,
|
|
@@ -36023,79 +36033,102 @@ const renderDataLinkGroup = _ref2 => {
|
|
|
36023
36033
|
isHighlighted: isHighlighted,
|
|
36024
36034
|
dataLinkInput: dataLinkInput,
|
|
36025
36035
|
formsValue: formsValue,
|
|
36026
|
-
values: groupFormId ?
|
|
36036
|
+
values: groupFormId ? {
|
|
36037
|
+
...(formsValue[groupFormId] || {}),
|
|
36027
36038
|
meta: {
|
|
36028
|
-
inputs: (
|
|
36039
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
36029
36040
|
}
|
|
36030
|
-
}
|
|
36041
|
+
} : formsValue,
|
|
36031
36042
|
name: name,
|
|
36032
36043
|
groupFormId: groupFormId,
|
|
36033
|
-
maxRepeat: input
|
|
36034
|
-
remove:
|
|
36035
|
-
|
|
36036
|
-
|
|
36037
|
-
} = _ref3;
|
|
36044
|
+
maxRepeat: input?.meta?.maxRepeat,
|
|
36045
|
+
remove: ({
|
|
36046
|
+
key
|
|
36047
|
+
}) => {
|
|
36038
36048
|
const _val = isSingle ? {
|
|
36039
36049
|
[name]: null
|
|
36040
36050
|
} : {
|
|
36041
36051
|
[name]: formData.filter((v, j) => j !== key)
|
|
36042
36052
|
};
|
|
36043
36053
|
if (groupFormId) {
|
|
36044
|
-
const _defaultData =
|
|
36045
|
-
const _newData =
|
|
36046
|
-
|
|
36054
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36055
|
+
const _newData = {
|
|
36056
|
+
..._defaultData,
|
|
36057
|
+
..._val
|
|
36058
|
+
};
|
|
36059
|
+
onValuesChange(_newData, {
|
|
36060
|
+
...formsValue,
|
|
36047
36061
|
[groupFormId]: _newData
|
|
36048
|
-
})
|
|
36049
|
-
form
|
|
36050
|
-
setValues(
|
|
36062
|
+
});
|
|
36063
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36064
|
+
setValues({
|
|
36065
|
+
...formsValue,
|
|
36051
36066
|
[groupFormId]: _newData
|
|
36052
|
-
})
|
|
36067
|
+
});
|
|
36053
36068
|
return;
|
|
36054
36069
|
}
|
|
36055
|
-
onValuesChange(_val,
|
|
36056
|
-
|
|
36057
|
-
|
|
36070
|
+
onValuesChange(_val, {
|
|
36071
|
+
...formsValue,
|
|
36072
|
+
..._val
|
|
36073
|
+
});
|
|
36074
|
+
form?.setFieldValue(name, _val[name]);
|
|
36075
|
+
setValues({
|
|
36076
|
+
...formsValue,
|
|
36077
|
+
..._val
|
|
36078
|
+
});
|
|
36058
36079
|
},
|
|
36059
36080
|
add: val => {
|
|
36060
36081
|
const _val = isSingle ? {
|
|
36061
36082
|
[name]: val
|
|
36062
36083
|
} : {
|
|
36063
|
-
[name]: [...formData,
|
|
36084
|
+
[name]: [...formData, {
|
|
36085
|
+
...val
|
|
36086
|
+
}]
|
|
36064
36087
|
};
|
|
36065
36088
|
if (groupFormId) {
|
|
36066
|
-
const _defaultData =
|
|
36067
|
-
const _newData =
|
|
36068
|
-
|
|
36069
|
-
|
|
36089
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36090
|
+
const _newData = {
|
|
36091
|
+
..._defaultData,
|
|
36092
|
+
..._val
|
|
36093
|
+
};
|
|
36094
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36095
|
+
onValuesChange(_newData, {
|
|
36096
|
+
...formsValue,
|
|
36070
36097
|
[groupFormId]: _newData
|
|
36071
|
-
})
|
|
36072
|
-
setValues(
|
|
36098
|
+
});
|
|
36099
|
+
setValues({
|
|
36100
|
+
...formsValue,
|
|
36073
36101
|
[groupFormId]: _newData
|
|
36074
|
-
})
|
|
36102
|
+
});
|
|
36075
36103
|
return;
|
|
36076
36104
|
}
|
|
36077
|
-
form
|
|
36078
|
-
onValuesChange(_val,
|
|
36079
|
-
|
|
36105
|
+
form?.setFieldValue(name, _val[name]);
|
|
36106
|
+
onValuesChange(_val, {
|
|
36107
|
+
...formsValue,
|
|
36108
|
+
..._val
|
|
36109
|
+
});
|
|
36110
|
+
setValues({
|
|
36111
|
+
...formsValue,
|
|
36112
|
+
..._val
|
|
36113
|
+
});
|
|
36080
36114
|
},
|
|
36081
36115
|
k: name,
|
|
36082
36116
|
formData: formData
|
|
36083
36117
|
});
|
|
36084
36118
|
};
|
|
36085
36119
|
function showHideInput$1(input, data, repeatIndex, repeatValues, inputMeta) {
|
|
36086
|
-
|
|
36087
|
-
if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
|
|
36120
|
+
if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
|
|
36088
36121
|
return false;
|
|
36089
36122
|
}
|
|
36090
|
-
if (typeof
|
|
36091
|
-
|
|
36092
|
-
return !(input !== null && input !== void 0 && (_input$meta4 = input.meta) !== null && _input$meta4 !== void 0 && _input$meta4.excludeFromEdit);
|
|
36123
|
+
if (typeof input?.meta?.excludeFromEdit === "boolean") {
|
|
36124
|
+
return !input?.meta?.excludeFromEdit;
|
|
36093
36125
|
}
|
|
36094
|
-
const formsValue =
|
|
36095
|
-
|
|
36096
|
-
|
|
36097
|
-
|
|
36098
|
-
|
|
36126
|
+
const formsValue = {
|
|
36127
|
+
...data
|
|
36128
|
+
};
|
|
36129
|
+
Object.keys(data?.meta?.inputs || {}).forEach(key => {
|
|
36130
|
+
const input = data?.meta?.inputs[key];
|
|
36131
|
+
if (input?.notApplicable || input?.notAvailable) {
|
|
36099
36132
|
formsValue[key] = undefined;
|
|
36100
36133
|
delete formsValue[key];
|
|
36101
36134
|
}
|
|
@@ -36154,35 +36187,35 @@ function getInputHeadLines$1(type, i, input, values) {
|
|
|
36154
36187
|
switch (type) {
|
|
36155
36188
|
case "h2":
|
|
36156
36189
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36157
|
-
className:
|
|
36190
|
+
className: `title-semibold-2 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36158
36191
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36159
36192
|
children: getInputLabel$1(input, values)
|
|
36160
36193
|
})
|
|
36161
36194
|
});
|
|
36162
36195
|
case "h3":
|
|
36163
36196
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36164
|
-
className:
|
|
36197
|
+
className: `title-semibold-3 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36165
36198
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36166
36199
|
children: getInputLabel$1(input, values)
|
|
36167
36200
|
})
|
|
36168
36201
|
});
|
|
36169
36202
|
case "h4":
|
|
36170
36203
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36171
|
-
className:
|
|
36204
|
+
className: `title-semibold-4 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36172
36205
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36173
36206
|
children: getInputLabel$1(input, values)
|
|
36174
36207
|
})
|
|
36175
36208
|
});
|
|
36176
36209
|
case "h5":
|
|
36177
36210
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36178
|
-
className:
|
|
36211
|
+
className: `title-semibold-5 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36179
36212
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36180
36213
|
children: getInputLabel$1(input, values)
|
|
36181
36214
|
})
|
|
36182
36215
|
});
|
|
36183
36216
|
case "h6":
|
|
36184
36217
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36185
|
-
className:
|
|
36218
|
+
className: `title-semibold-6 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36186
36219
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36187
36220
|
children: getInputLabel$1(input, values)
|
|
36188
36221
|
})
|
|
@@ -36191,16 +36224,15 @@ function getInputHeadLines$1(type, i, input, values) {
|
|
|
36191
36224
|
return null;
|
|
36192
36225
|
}
|
|
36193
36226
|
}
|
|
36194
|
-
function getInputProp(prop) {
|
|
36195
|
-
let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
36196
|
-
let scope = arguments.length > 2 ? arguments[2] : undefined;
|
|
36227
|
+
function getInputProp(prop, formsValue = {}, scope) {
|
|
36197
36228
|
if (prop && typeof prop === "object") {
|
|
36198
36229
|
const validations = Object.keys(prop);
|
|
36199
36230
|
const key = validations.find(v => {
|
|
36200
36231
|
let [path, match, wantedValue] = v.split(/( is | includes | not | notEmpty )/gim);
|
|
36201
|
-
const value = dot__default["default"].pick(path,
|
|
36232
|
+
const value = dot__default["default"].pick(path, {
|
|
36233
|
+
...formsValue,
|
|
36202
36234
|
scope
|
|
36203
|
-
})
|
|
36235
|
+
});
|
|
36204
36236
|
return _checkValue(wantedValue, match, value);
|
|
36205
36237
|
});
|
|
36206
36238
|
const label = key ? prop[key] : prop[validations[0]];
|
|
@@ -36209,33 +36241,29 @@ function getInputProp(prop) {
|
|
|
36209
36241
|
return prop;
|
|
36210
36242
|
}
|
|
36211
36243
|
}
|
|
36212
|
-
function getInputLabel$1(input) {
|
|
36213
|
-
let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
36214
|
-
let asText = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
36244
|
+
function getInputLabel$1(input, formsValue = {}, asText = false) {
|
|
36215
36245
|
return /*#__PURE__*/jsxRuntime.jsx(InputLabel, {
|
|
36216
36246
|
input: input,
|
|
36217
36247
|
formsValue: formsValue,
|
|
36218
36248
|
asText: asText
|
|
36219
36249
|
});
|
|
36220
36250
|
}
|
|
36221
|
-
const InputLabel =
|
|
36222
|
-
|
|
36223
|
-
|
|
36224
|
-
|
|
36225
|
-
|
|
36226
|
-
asText
|
|
36227
|
-
} = _ref4;
|
|
36251
|
+
const InputLabel = ({
|
|
36252
|
+
input,
|
|
36253
|
+
formsValue,
|
|
36254
|
+
asText
|
|
36255
|
+
}) => {
|
|
36228
36256
|
const {
|
|
36229
36257
|
t,
|
|
36230
36258
|
evaluationConfig,
|
|
36231
36259
|
scope
|
|
36232
36260
|
} = useEditContext();
|
|
36233
36261
|
const label = getInputProp(input.label, formsValue, scope);
|
|
36234
|
-
return input
|
|
36262
|
+
return input?.meta?.isEvaluation || input.description && typeof input.description === "string" && !asText ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
36235
36263
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
36236
36264
|
className: "flex",
|
|
36237
36265
|
children: [ReactHtmlParser__default["default"](label), /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
|
|
36238
|
-
content: input
|
|
36266
|
+
content: input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(EvaluationPopover, {
|
|
36239
36267
|
t: t,
|
|
36240
36268
|
evaluationConfig: evaluationConfig
|
|
36241
36269
|
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -36243,7 +36271,7 @@ const InputLabel = _ref4 => {
|
|
|
36243
36271
|
children: ReactHtmlParser__default["default"](input.description)
|
|
36244
36272
|
}),
|
|
36245
36273
|
placement: "top",
|
|
36246
|
-
children: !
|
|
36274
|
+
children: !input?.meta?.isEvaluation || evaluationConfig.length > 0 ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36247
36275
|
className: "flex flex-column justify-content-center ml-1",
|
|
36248
36276
|
children: /*#__PURE__*/jsxRuntime.jsx(TooltipIcon, {
|
|
36249
36277
|
fontSize: 13
|
|
@@ -36265,9 +36293,7 @@ function getSectionLabel$1(labels, values) {
|
|
|
36265
36293
|
}
|
|
36266
36294
|
return labels;
|
|
36267
36295
|
}
|
|
36268
|
-
function getSubtitles$1(subtitles, position) {
|
|
36269
|
-
let formsValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
36270
|
-
let repeatValues = arguments.length > 4 ? arguments[4] : undefined;
|
|
36296
|
+
function getSubtitles$1(subtitles, position, formsValue = {}, repeatIndex, repeatValues) {
|
|
36271
36297
|
let subtitle = subtitles && subtitles[position];
|
|
36272
36298
|
if (subtitle && typeof subtitle === "object") {
|
|
36273
36299
|
let newSubtitle = subtitle.default || "";
|
|
@@ -36311,12 +36337,14 @@ function getSubtitles$1(subtitles, position) {
|
|
|
36311
36337
|
function getFormTitles$1(titles, key, position) {
|
|
36312
36338
|
let tilte = titles && titles[key];
|
|
36313
36339
|
return tilte ? /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
36314
|
-
className:
|
|
36340
|
+
className: `title-semibold-3 mb0 ${position ? "mt-3" : ""}`,
|
|
36315
36341
|
children: tilte
|
|
36316
36342
|
}) : null;
|
|
36317
36343
|
}
|
|
36318
36344
|
const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsValue, name, mainForm) => {
|
|
36319
|
-
formsValue = Object.assign(formsValue,
|
|
36345
|
+
formsValue = Object.assign(formsValue, {
|
|
36346
|
+
...mainForm.getFieldsValue(true)
|
|
36347
|
+
});
|
|
36320
36348
|
if (typeof repeatIndex === "number" && repeatValues) {
|
|
36321
36349
|
if (!repeatValues[inputName] || !___default["default"].isEqual(repeatValues[inputName], value)) {
|
|
36322
36350
|
repeatValues[inputName] = value;
|
|
@@ -36351,16 +36379,14 @@ const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsVa
|
|
|
36351
36379
|
};
|
|
36352
36380
|
const inputOnBlur = [];
|
|
36353
36381
|
const inputTypeComponent$1 = {
|
|
36354
|
-
text: (
|
|
36355
|
-
|
|
36356
|
-
|
|
36357
|
-
|
|
36358
|
-
|
|
36359
|
-
|
|
36360
|
-
|
|
36361
|
-
|
|
36362
|
-
isHighlighted
|
|
36363
|
-
} = _ref6;
|
|
36382
|
+
text: ({
|
|
36383
|
+
props,
|
|
36384
|
+
rules
|
|
36385
|
+
}, {
|
|
36386
|
+
inputMeta = {},
|
|
36387
|
+
t,
|
|
36388
|
+
isHighlighted
|
|
36389
|
+
}) => {
|
|
36364
36390
|
const maxRule = rules.find(r => r.max);
|
|
36365
36391
|
const maxProps = {
|
|
36366
36392
|
maxLength: MAX_TEXT_AREA_LENGTH
|
|
@@ -36368,28 +36394,26 @@ const inputTypeComponent$1 = {
|
|
|
36368
36394
|
if (maxRule) {
|
|
36369
36395
|
maxProps.maxLength = maxRule.max;
|
|
36370
36396
|
}
|
|
36371
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input,
|
|
36372
|
-
size: "large"
|
|
36373
|
-
|
|
36397
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
36398
|
+
size: "large",
|
|
36399
|
+
...maxProps,
|
|
36374
36400
|
allowClear: true,
|
|
36375
36401
|
autoComplete: "new-password",
|
|
36376
|
-
type: "text"
|
|
36377
|
-
|
|
36402
|
+
type: "text",
|
|
36403
|
+
...props,
|
|
36378
36404
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36379
36405
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36380
36406
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
36381
|
-
})
|
|
36407
|
+
});
|
|
36382
36408
|
},
|
|
36383
|
-
link: (
|
|
36384
|
-
|
|
36385
|
-
|
|
36386
|
-
|
|
36387
|
-
|
|
36388
|
-
|
|
36389
|
-
|
|
36390
|
-
|
|
36391
|
-
isHighlighted
|
|
36392
|
-
} = _ref8;
|
|
36409
|
+
link: ({
|
|
36410
|
+
props,
|
|
36411
|
+
rules
|
|
36412
|
+
}, {
|
|
36413
|
+
inputMeta = {},
|
|
36414
|
+
t,
|
|
36415
|
+
isHighlighted
|
|
36416
|
+
}) => {
|
|
36393
36417
|
const maxRule = rules.find(r => r.max);
|
|
36394
36418
|
const maxProps = {
|
|
36395
36419
|
maxLength: MAX_TEXT_AREA_LENGTH
|
|
@@ -36397,32 +36421,29 @@ const inputTypeComponent$1 = {
|
|
|
36397
36421
|
if (maxRule) {
|
|
36398
36422
|
maxProps.maxLength = maxRule.max;
|
|
36399
36423
|
}
|
|
36400
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input,
|
|
36401
|
-
size: "large"
|
|
36402
|
-
|
|
36424
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
36425
|
+
size: "large",
|
|
36426
|
+
...maxProps,
|
|
36403
36427
|
allowClear: true,
|
|
36404
36428
|
autoComplete: "new-password",
|
|
36405
|
-
type: "text"
|
|
36406
|
-
|
|
36429
|
+
type: "text",
|
|
36430
|
+
...props,
|
|
36407
36431
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36408
36432
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36409
36433
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
36410
|
-
})
|
|
36434
|
+
});
|
|
36411
36435
|
},
|
|
36412
|
-
number: (
|
|
36413
|
-
|
|
36414
|
-
|
|
36415
|
-
|
|
36416
|
-
|
|
36417
|
-
|
|
36418
|
-
|
|
36419
|
-
|
|
36420
|
-
|
|
36421
|
-
t,
|
|
36422
|
-
isHighlighted
|
|
36423
|
-
} = _ref10;
|
|
36436
|
+
number: ({
|
|
36437
|
+
props,
|
|
36438
|
+
rules,
|
|
36439
|
+
input
|
|
36440
|
+
}, {
|
|
36441
|
+
inputMeta = {},
|
|
36442
|
+
t,
|
|
36443
|
+
isHighlighted
|
|
36444
|
+
}) => {
|
|
36424
36445
|
const maxRule = rules.find(r => r.max);
|
|
36425
|
-
const integerRule = !
|
|
36446
|
+
const integerRule = !input?.meta?.isDecimal;
|
|
36426
36447
|
const parser = value => {
|
|
36427
36448
|
if (!value) {
|
|
36428
36449
|
return "";
|
|
@@ -36433,63 +36454,60 @@ const inputTypeComponent$1 = {
|
|
|
36433
36454
|
return value.replace(/\$\s?|(,*)/g, "");
|
|
36434
36455
|
};
|
|
36435
36456
|
if (maxRule) {
|
|
36436
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber,
|
|
36457
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
36437
36458
|
size: "large",
|
|
36438
36459
|
allowClear: true,
|
|
36439
|
-
autoComplete: "new-password"
|
|
36440
|
-
|
|
36460
|
+
autoComplete: "new-password",
|
|
36461
|
+
...props,
|
|
36441
36462
|
type: "number",
|
|
36442
36463
|
parser: parser,
|
|
36443
36464
|
min: 0,
|
|
36444
36465
|
max: maxRule.max,
|
|
36445
36466
|
className: formatClassname([isHighlighted && "highlighted-input"])
|
|
36446
|
-
})
|
|
36467
|
+
});
|
|
36447
36468
|
}
|
|
36448
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber,
|
|
36469
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
36449
36470
|
size: "large",
|
|
36450
36471
|
allowClear: true,
|
|
36451
36472
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36452
|
-
autoComplete: "new-password"
|
|
36453
|
-
|
|
36473
|
+
autoComplete: "new-password",
|
|
36474
|
+
...props,
|
|
36454
36475
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36455
36476
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
|
|
36456
36477
|
min: 0,
|
|
36457
36478
|
formatter: value => numberWithCommas$1(value),
|
|
36458
36479
|
parser: parser
|
|
36459
|
-
})
|
|
36480
|
+
});
|
|
36460
36481
|
},
|
|
36461
36482
|
// eslint-disable-next-line no-unused-vars
|
|
36462
|
-
select: (
|
|
36463
|
-
|
|
36464
|
-
|
|
36465
|
-
|
|
36466
|
-
|
|
36467
|
-
|
|
36468
|
-
|
|
36469
|
-
|
|
36470
|
-
|
|
36471
|
-
|
|
36472
|
-
|
|
36473
|
-
|
|
36474
|
-
|
|
36475
|
-
|
|
36476
|
-
|
|
36477
|
-
|
|
36478
|
-
|
|
36479
|
-
|
|
36480
|
-
|
|
36481
|
-
|
|
36482
|
-
|
|
36483
|
-
|
|
36484
|
-
|
|
36485
|
-
|
|
36486
|
-
|
|
36487
|
-
|
|
36488
|
-
changeInputMeta,
|
|
36489
|
-
groupFormId
|
|
36490
|
-
} = _ref12;
|
|
36483
|
+
select: ({
|
|
36484
|
+
value,
|
|
36485
|
+
options,
|
|
36486
|
+
optionGroup,
|
|
36487
|
+
props,
|
|
36488
|
+
formsValue,
|
|
36489
|
+
optionsFilter,
|
|
36490
|
+
filterCond,
|
|
36491
|
+
repeatValues,
|
|
36492
|
+
repeatIndex,
|
|
36493
|
+
name,
|
|
36494
|
+
inputName,
|
|
36495
|
+
address,
|
|
36496
|
+
addressData,
|
|
36497
|
+
input,
|
|
36498
|
+
scope
|
|
36499
|
+
}, {
|
|
36500
|
+
forms,
|
|
36501
|
+
form,
|
|
36502
|
+
setAddress,
|
|
36503
|
+
inputMeta = {},
|
|
36504
|
+
t,
|
|
36505
|
+
isHighlighted,
|
|
36506
|
+
changeInputMeta,
|
|
36507
|
+
groupFormId
|
|
36508
|
+
}) => {
|
|
36491
36509
|
let opts;
|
|
36492
|
-
const isEvaluation = input
|
|
36510
|
+
const isEvaluation = input?.meta?.isEvaluation;
|
|
36493
36511
|
let defaultValue = value;
|
|
36494
36512
|
if (typeof options === "string") {
|
|
36495
36513
|
const [formName, key] = options.split(".");
|
|
@@ -36514,7 +36532,7 @@ const inputTypeComponent$1 = {
|
|
|
36514
36532
|
opts = [];
|
|
36515
36533
|
}
|
|
36516
36534
|
} else {
|
|
36517
|
-
opts = options
|
|
36535
|
+
opts = options?.filter(o => !o.onlyView);
|
|
36518
36536
|
}
|
|
36519
36537
|
opts = JSON.parse(JSON.stringify(opts || []));
|
|
36520
36538
|
opts = opts.map(o => getSelectOptions$2(o, formsValue));
|
|
@@ -36524,7 +36542,7 @@ const inputTypeComponent$1 = {
|
|
|
36524
36542
|
const uniqueDefaultKeys = getUniqueDefaultKeys(options);
|
|
36525
36543
|
|
|
36526
36544
|
// Handle default value logic
|
|
36527
|
-
if (!propHasValue$1(value) && propHasValue$1(input
|
|
36545
|
+
if (!propHasValue$1(value) && propHasValue$1(input?.meta?.defaultValue)) {
|
|
36528
36546
|
// If no current value but there's a default value, use the default
|
|
36529
36547
|
value = input.meta.defaultValue;
|
|
36530
36548
|
defaultValue = value;
|
|
@@ -36557,7 +36575,7 @@ const inputTypeComponent$1 = {
|
|
|
36557
36575
|
}
|
|
36558
36576
|
opts = groupOptions;
|
|
36559
36577
|
}
|
|
36560
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select,
|
|
36578
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
36561
36579
|
size: "large",
|
|
36562
36580
|
autoComplete: "new-password",
|
|
36563
36581
|
allowClear: true,
|
|
@@ -36566,32 +36584,35 @@ const inputTypeComponent$1 = {
|
|
|
36566
36584
|
value: value // Use value instead of defaultValue for controlled behavior
|
|
36567
36585
|
,
|
|
36568
36586
|
filterOption: filterSelectOptions,
|
|
36569
|
-
optionFilterProp: "children"
|
|
36570
|
-
|
|
36587
|
+
optionFilterProp: "children",
|
|
36588
|
+
...props,
|
|
36571
36589
|
className: formatClassname([isHighlighted && "highlighted-select"]),
|
|
36572
36590
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36573
36591
|
placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select one option"),
|
|
36574
36592
|
onChange: (val, selectedValue) => {
|
|
36575
36593
|
// ONLY FOR SBG EVALUATON !!
|
|
36576
36594
|
if (isEvaluation && val === "na" && groupFormId) {
|
|
36577
|
-
var _formsValue$meta2;
|
|
36578
36595
|
changeInputMeta({
|
|
36579
36596
|
key: groupFormId,
|
|
36580
|
-
value:
|
|
36597
|
+
value: {
|
|
36598
|
+
...(formsValue?.meta?.inputs?.[groupFormId] || {}),
|
|
36581
36599
|
documentation: {
|
|
36582
36600
|
notApplicable: true
|
|
36583
36601
|
}
|
|
36584
|
-
}
|
|
36602
|
+
},
|
|
36585
36603
|
otherValues: {
|
|
36586
|
-
[groupFormId]:
|
|
36604
|
+
[groupFormId]: {
|
|
36605
|
+
...(formsValue?.[groupFormId] || {}),
|
|
36587
36606
|
[name]: val
|
|
36588
|
-
}
|
|
36607
|
+
}
|
|
36589
36608
|
}
|
|
36590
36609
|
});
|
|
36591
36610
|
}
|
|
36592
36611
|
if (address && selectedValue) {
|
|
36593
36612
|
dot__default["default"].str(address, selectedValue.children, addressData);
|
|
36594
|
-
setAddress(
|
|
36613
|
+
setAddress({
|
|
36614
|
+
...addressData
|
|
36615
|
+
});
|
|
36595
36616
|
}
|
|
36596
36617
|
if (props.onChange) {
|
|
36597
36618
|
props.onChange(val);
|
|
@@ -36622,15 +36643,15 @@ const inputTypeComponent$1 = {
|
|
|
36622
36643
|
if (og.disabled !== undefined) {
|
|
36623
36644
|
groupOtherProps.disabled = og.disabled;
|
|
36624
36645
|
}
|
|
36625
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36626
|
-
value: og.value
|
|
36627
|
-
|
|
36646
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36647
|
+
value: og.value,
|
|
36648
|
+
...groupOtherProps,
|
|
36628
36649
|
children: og.label
|
|
36629
|
-
}
|
|
36650
|
+
}, `${i}${j}`);
|
|
36630
36651
|
})
|
|
36631
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36632
|
-
value: option.value
|
|
36633
|
-
|
|
36652
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36653
|
+
value: option.value,
|
|
36654
|
+
...otherProps,
|
|
36634
36655
|
children: isEvaluation ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
36635
36656
|
className: "flex",
|
|
36636
36657
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -36638,35 +36659,33 @@ const inputTypeComponent$1 = {
|
|
|
36638
36659
|
children: sgbEvaluationIcons[option.value]
|
|
36639
36660
|
}), option.label]
|
|
36640
36661
|
}) : option.label
|
|
36641
|
-
}
|
|
36662
|
+
}, option.value);
|
|
36642
36663
|
})
|
|
36643
|
-
})
|
|
36664
|
+
});
|
|
36644
36665
|
},
|
|
36645
|
-
multiselect: (
|
|
36646
|
-
|
|
36647
|
-
|
|
36648
|
-
|
|
36649
|
-
|
|
36650
|
-
|
|
36651
|
-
|
|
36652
|
-
|
|
36653
|
-
|
|
36654
|
-
|
|
36655
|
-
|
|
36656
|
-
|
|
36657
|
-
|
|
36658
|
-
|
|
36659
|
-
|
|
36660
|
-
|
|
36661
|
-
|
|
36662
|
-
|
|
36663
|
-
|
|
36664
|
-
|
|
36665
|
-
|
|
36666
|
-
|
|
36667
|
-
|
|
36668
|
-
isHighlighted
|
|
36669
|
-
} = _ref14;
|
|
36666
|
+
multiselect: ({
|
|
36667
|
+
value,
|
|
36668
|
+
options,
|
|
36669
|
+
optionGroup,
|
|
36670
|
+
optionsFilter,
|
|
36671
|
+
filterCond,
|
|
36672
|
+
props,
|
|
36673
|
+
formsValue,
|
|
36674
|
+
repeatValues,
|
|
36675
|
+
repeatIndex,
|
|
36676
|
+
inputName,
|
|
36677
|
+
name,
|
|
36678
|
+
tags,
|
|
36679
|
+
maxWidth,
|
|
36680
|
+
staticWidth,
|
|
36681
|
+
fullWidth
|
|
36682
|
+
}, {
|
|
36683
|
+
forms,
|
|
36684
|
+
form,
|
|
36685
|
+
inputMeta = {},
|
|
36686
|
+
t,
|
|
36687
|
+
isHighlighted
|
|
36688
|
+
}) => {
|
|
36670
36689
|
let opts;
|
|
36671
36690
|
if (typeof options === "string") {
|
|
36672
36691
|
const [formName, key] = options.split(".");
|
|
@@ -36728,17 +36747,17 @@ const inputTypeComponent$1 = {
|
|
|
36728
36747
|
staticWidth,
|
|
36729
36748
|
fullWidth
|
|
36730
36749
|
});
|
|
36731
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select,
|
|
36750
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
36732
36751
|
size: "medium",
|
|
36733
36752
|
allowClear: true,
|
|
36734
36753
|
autoComplete: "new-password",
|
|
36735
36754
|
mode: tags ? "tags" : "multiple",
|
|
36736
|
-
optionFilterProp: "children"
|
|
36737
|
-
|
|
36738
|
-
|
|
36739
|
-
|
|
36740
|
-
filterOption: filterSelectOptions
|
|
36741
|
-
|
|
36755
|
+
optionFilterProp: "children",
|
|
36756
|
+
...(tags ? {
|
|
36757
|
+
tokenSeparators: [","]
|
|
36758
|
+
} : {}),
|
|
36759
|
+
filterOption: filterSelectOptions,
|
|
36760
|
+
...props,
|
|
36742
36761
|
className: formatClassname([isHighlighted && "highlighted-select"]),
|
|
36743
36762
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36744
36763
|
placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select all relevant options"),
|
|
@@ -36777,52 +36796,51 @@ const inputTypeComponent$1 = {
|
|
|
36777
36796
|
if (og.disabled !== undefined) {
|
|
36778
36797
|
groupOtherProps.disabled = og.disabled;
|
|
36779
36798
|
}
|
|
36780
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36781
|
-
value: og.value
|
|
36782
|
-
|
|
36799
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36800
|
+
value: og.value,
|
|
36801
|
+
...groupOtherProps,
|
|
36783
36802
|
children: og.label
|
|
36784
|
-
}
|
|
36803
|
+
}, `${i}${j}`);
|
|
36785
36804
|
})
|
|
36786
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36787
|
-
value: option.value
|
|
36788
|
-
|
|
36805
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36806
|
+
value: option.value,
|
|
36807
|
+
...otherProps,
|
|
36789
36808
|
children: option.label
|
|
36790
|
-
}
|
|
36809
|
+
}, i);
|
|
36791
36810
|
})
|
|
36792
|
-
})
|
|
36811
|
+
});
|
|
36793
36812
|
},
|
|
36794
|
-
date: (
|
|
36795
|
-
|
|
36796
|
-
|
|
36797
|
-
|
|
36798
|
-
|
|
36799
|
-
|
|
36800
|
-
|
|
36801
|
-
|
|
36802
|
-
|
|
36803
|
-
|
|
36804
|
-
|
|
36805
|
-
|
|
36806
|
-
|
|
36807
|
-
|
|
36808
|
-
isHighlighted,
|
|
36809
|
-
groupFormId
|
|
36810
|
-
} = _ref16;
|
|
36813
|
+
date: ({
|
|
36814
|
+
props,
|
|
36815
|
+
rules,
|
|
36816
|
+
repeatValues,
|
|
36817
|
+
formsValue,
|
|
36818
|
+
name
|
|
36819
|
+
}, {
|
|
36820
|
+
setFormValues,
|
|
36821
|
+
inputMeta,
|
|
36822
|
+
form,
|
|
36823
|
+
t,
|
|
36824
|
+
isHighlighted,
|
|
36825
|
+
groupFormId
|
|
36826
|
+
}) => {
|
|
36811
36827
|
const lng = localStorage.getItem("datastakeLng") || "en";
|
|
36812
36828
|
const maxRule = rules.find(r => r.max);
|
|
36813
|
-
let value = groupFormId ? formsValue
|
|
36829
|
+
let value = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue[name];
|
|
36814
36830
|
const handleDateChange = date => {
|
|
36815
36831
|
if (date) {
|
|
36816
36832
|
// const localDate = dayjs.utc(date).add(dayjs(date).utcOffset(), 'minutes');
|
|
36817
36833
|
const localDate = dayjs__default["default"].utc(date);
|
|
36818
36834
|
if (groupFormId) {
|
|
36819
|
-
const _new =
|
|
36835
|
+
const _new = {
|
|
36836
|
+
...(formsValue[groupFormId] || {}),
|
|
36820
36837
|
[name]: localDate
|
|
36821
|
-
}
|
|
36838
|
+
};
|
|
36822
36839
|
form.setFieldValue(groupFormId, _new);
|
|
36823
|
-
setFormValues(
|
|
36840
|
+
setFormValues({
|
|
36841
|
+
...formsValue,
|
|
36824
36842
|
[groupFormId]: _new
|
|
36825
|
-
})
|
|
36843
|
+
});
|
|
36826
36844
|
} else {
|
|
36827
36845
|
form.setFieldValue(name, localDate);
|
|
36828
36846
|
}
|
|
@@ -36831,13 +36849,15 @@ const inputTypeComponent$1 = {
|
|
|
36831
36849
|
if (groupFormId) {
|
|
36832
36850
|
if (typeof value === "string" || typeof value === "undefined") {
|
|
36833
36851
|
value = typeof value === "string" ? dayjs__default["default"].utc(value) : null;
|
|
36834
|
-
const _new =
|
|
36852
|
+
const _new = {
|
|
36853
|
+
...(formsValue[groupFormId] || {}),
|
|
36835
36854
|
[name]: value
|
|
36836
|
-
}
|
|
36855
|
+
};
|
|
36837
36856
|
form.setFieldValue(groupFormId, _new);
|
|
36838
|
-
setFormValues(
|
|
36857
|
+
setFormValues({
|
|
36858
|
+
...formsValue,
|
|
36839
36859
|
[groupFormId]: _new
|
|
36840
|
-
})
|
|
36860
|
+
});
|
|
36841
36861
|
}
|
|
36842
36862
|
} else {
|
|
36843
36863
|
if (typeof value === "string") {
|
|
@@ -36853,13 +36873,12 @@ const inputTypeComponent$1 = {
|
|
|
36853
36873
|
checkForMax = checkCondition$1(maxRule.condition, repeatValues, formsValue);
|
|
36854
36874
|
}
|
|
36855
36875
|
if (checkForMax) {
|
|
36856
|
-
|
|
36857
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
|
|
36876
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
36858
36877
|
size: "large",
|
|
36859
36878
|
allowClear: true,
|
|
36860
|
-
autoComplete: "new-password"
|
|
36861
|
-
|
|
36862
|
-
value: value ? dayjs__default["default"](
|
|
36879
|
+
autoComplete: "new-password",
|
|
36880
|
+
...props,
|
|
36881
|
+
value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
|
|
36863
36882
|
onChange: handleDateChange,
|
|
36864
36883
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36865
36884
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
@@ -36869,54 +36888,49 @@ const inputTypeComponent$1 = {
|
|
|
36869
36888
|
disabledDate: current => {
|
|
36870
36889
|
return current && current >= dayjs__default["default"]().endOf("day");
|
|
36871
36890
|
}
|
|
36872
|
-
})
|
|
36891
|
+
});
|
|
36873
36892
|
}
|
|
36874
36893
|
}
|
|
36875
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker,
|
|
36894
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
36876
36895
|
size: "large",
|
|
36877
36896
|
allowClear: true,
|
|
36878
|
-
autoComplete: "new-password"
|
|
36879
|
-
|
|
36880
|
-
value: value ? dayjs__default["default"](
|
|
36897
|
+
autoComplete: "new-password",
|
|
36898
|
+
...props,
|
|
36899
|
+
value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
|
|
36881
36900
|
onChange: handleDateChange,
|
|
36882
36901
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36883
36902
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36884
36903
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder,
|
|
36885
36904
|
format: DATE_FORMATS,
|
|
36886
36905
|
locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"]
|
|
36887
|
-
})
|
|
36906
|
+
});
|
|
36888
36907
|
},
|
|
36889
|
-
groupExpandable: (
|
|
36890
|
-
|
|
36891
|
-
|
|
36892
|
-
|
|
36893
|
-
|
|
36894
|
-
|
|
36895
|
-
|
|
36896
|
-
|
|
36897
|
-
groupFormId
|
|
36898
|
-
} = _ref18;
|
|
36899
|
-
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];
|
|
36908
|
+
groupExpandable: ({
|
|
36909
|
+
formsValue,
|
|
36910
|
+
name,
|
|
36911
|
+
input
|
|
36912
|
+
}, {
|
|
36913
|
+
groupFormId
|
|
36914
|
+
}) => {
|
|
36915
|
+
const data = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue?.[name];
|
|
36900
36916
|
return /*#__PURE__*/jsxRuntime.jsx(GroupExpandable, {
|
|
36901
36917
|
input: input,
|
|
36902
36918
|
formsValue: formsValue,
|
|
36903
36919
|
data: data
|
|
36904
36920
|
});
|
|
36905
36921
|
},
|
|
36906
|
-
comment: (
|
|
36907
|
-
|
|
36908
|
-
|
|
36909
|
-
|
|
36910
|
-
|
|
36911
|
-
|
|
36912
|
-
|
|
36913
|
-
|
|
36914
|
-
|
|
36915
|
-
|
|
36916
|
-
|
|
36917
|
-
|
|
36918
|
-
} = _ref20;
|
|
36919
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
|
|
36922
|
+
comment: ({
|
|
36923
|
+
props: {
|
|
36924
|
+
placeholder,
|
|
36925
|
+
...props
|
|
36926
|
+
},
|
|
36927
|
+
commentHint
|
|
36928
|
+
}, {
|
|
36929
|
+
onChange,
|
|
36930
|
+
value,
|
|
36931
|
+
isHighlighted
|
|
36932
|
+
}) => {
|
|
36933
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
|
|
36920
36934
|
allowClear: true,
|
|
36921
36935
|
value: value,
|
|
36922
36936
|
onChange: e => onChange(e.target.value),
|
|
@@ -36927,27 +36941,26 @@ const inputTypeComponent$1 = {
|
|
|
36927
36941
|
autoSize: {
|
|
36928
36942
|
minRows: 5,
|
|
36929
36943
|
maxRows: 5
|
|
36930
|
-
}
|
|
36931
|
-
|
|
36944
|
+
},
|
|
36945
|
+
...props,
|
|
36932
36946
|
disabled: false
|
|
36933
|
-
})
|
|
36947
|
+
});
|
|
36934
36948
|
},
|
|
36935
|
-
tableComment: (
|
|
36936
|
-
|
|
36937
|
-
|
|
36938
|
-
|
|
36939
|
-
|
|
36940
|
-
|
|
36941
|
-
|
|
36942
|
-
|
|
36943
|
-
|
|
36944
|
-
|
|
36945
|
-
|
|
36946
|
-
|
|
36947
|
-
} = _ref22;
|
|
36948
|
-
const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => _objectSpread2(_objectSpread2({}, v), {}, {
|
|
36949
|
+
tableComment: ({
|
|
36950
|
+
setValues,
|
|
36951
|
+
name,
|
|
36952
|
+
onValuesChange,
|
|
36953
|
+
formsValue
|
|
36954
|
+
}, {
|
|
36955
|
+
form,
|
|
36956
|
+
groupFormId,
|
|
36957
|
+
isHighlighted
|
|
36958
|
+
}) => {
|
|
36959
|
+
const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => ({
|
|
36960
|
+
...v,
|
|
36949
36961
|
key: i
|
|
36950
|
-
})) : (formsValue[name] || []).map((v, i) =>
|
|
36962
|
+
})) : (formsValue[name] || []).map((v, i) => ({
|
|
36963
|
+
...v,
|
|
36951
36964
|
key: i
|
|
36952
36965
|
}));
|
|
36953
36966
|
const onUpdate = (val, i) => {
|
|
@@ -36955,89 +36968,121 @@ const inputTypeComponent$1 = {
|
|
|
36955
36968
|
[name]: formData.map((d, j) => i === j ? val : d)
|
|
36956
36969
|
};
|
|
36957
36970
|
if (groupFormId) {
|
|
36958
|
-
const _defaultData =
|
|
36959
|
-
const _newData =
|
|
36960
|
-
|
|
36971
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36972
|
+
const _newData = {
|
|
36973
|
+
..._defaultData,
|
|
36974
|
+
..._val
|
|
36975
|
+
};
|
|
36976
|
+
onValuesChange(_newData, {
|
|
36977
|
+
...formsValue,
|
|
36961
36978
|
[groupFormId]: _newData
|
|
36962
|
-
})
|
|
36963
|
-
form
|
|
36964
|
-
setValues(
|
|
36979
|
+
});
|
|
36980
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36981
|
+
setValues({
|
|
36982
|
+
...formsValue,
|
|
36965
36983
|
[groupFormId]: _newData
|
|
36966
|
-
})
|
|
36984
|
+
});
|
|
36967
36985
|
return;
|
|
36968
36986
|
}
|
|
36969
|
-
onValuesChange(_val,
|
|
36970
|
-
|
|
36971
|
-
|
|
36987
|
+
onValuesChange(_val, {
|
|
36988
|
+
...formsValue,
|
|
36989
|
+
..._val
|
|
36990
|
+
});
|
|
36991
|
+
form?.setFieldValue(name, _val[name]);
|
|
36992
|
+
setValues({
|
|
36993
|
+
...formsValue,
|
|
36994
|
+
..._val
|
|
36995
|
+
});
|
|
36972
36996
|
};
|
|
36973
36997
|
return /*#__PURE__*/jsxRuntime.jsx(Comment, {
|
|
36974
36998
|
onUpdate: onUpdate,
|
|
36975
36999
|
isHighlighted: isHighlighted,
|
|
36976
37000
|
form: form,
|
|
36977
|
-
values: groupFormId ?
|
|
37001
|
+
values: groupFormId ? {
|
|
37002
|
+
...(formsValue[groupFormId] || {}),
|
|
36978
37003
|
meta: {
|
|
36979
|
-
inputs: (
|
|
37004
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
36980
37005
|
}
|
|
36981
|
-
}
|
|
37006
|
+
} : formsValue,
|
|
36982
37007
|
name: name,
|
|
36983
|
-
remove:
|
|
36984
|
-
|
|
36985
|
-
|
|
36986
|
-
} = _ref23;
|
|
37008
|
+
remove: ({
|
|
37009
|
+
key
|
|
37010
|
+
}) => {
|
|
36987
37011
|
const _val = {
|
|
36988
37012
|
[name]: formData.filter(v => v.key !== key)
|
|
36989
37013
|
};
|
|
36990
37014
|
if (groupFormId) {
|
|
36991
|
-
const _defaultData =
|
|
36992
|
-
const _newData =
|
|
36993
|
-
|
|
37015
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
37016
|
+
const _newData = {
|
|
37017
|
+
..._defaultData,
|
|
37018
|
+
..._val
|
|
37019
|
+
};
|
|
37020
|
+
onValuesChange(_newData, {
|
|
37021
|
+
...formsValue,
|
|
36994
37022
|
[groupFormId]: _newData
|
|
36995
|
-
})
|
|
36996
|
-
form
|
|
36997
|
-
setValues(
|
|
37023
|
+
});
|
|
37024
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
37025
|
+
setValues({
|
|
37026
|
+
...formsValue,
|
|
36998
37027
|
[groupFormId]: _newData
|
|
36999
|
-
})
|
|
37028
|
+
});
|
|
37000
37029
|
return;
|
|
37001
37030
|
}
|
|
37002
|
-
onValuesChange(_val,
|
|
37003
|
-
|
|
37004
|
-
|
|
37031
|
+
onValuesChange(_val, {
|
|
37032
|
+
...formsValue,
|
|
37033
|
+
..._val
|
|
37034
|
+
});
|
|
37035
|
+
form?.setFieldValue(name, _val[name]);
|
|
37036
|
+
setValues({
|
|
37037
|
+
...formsValue,
|
|
37038
|
+
..._val
|
|
37039
|
+
});
|
|
37005
37040
|
},
|
|
37006
37041
|
add: val => {
|
|
37007
37042
|
const _val = {
|
|
37008
|
-
[name]: [...formData,
|
|
37043
|
+
[name]: [...formData, {
|
|
37044
|
+
...val,
|
|
37009
37045
|
key: formData.length
|
|
37010
|
-
}
|
|
37046
|
+
}]
|
|
37011
37047
|
};
|
|
37012
37048
|
if (groupFormId) {
|
|
37013
|
-
const _defaultData =
|
|
37014
|
-
const _newData =
|
|
37015
|
-
|
|
37016
|
-
|
|
37049
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
37050
|
+
const _newData = {
|
|
37051
|
+
..._defaultData,
|
|
37052
|
+
..._val
|
|
37053
|
+
};
|
|
37054
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
37055
|
+
onValuesChange(_newData, {
|
|
37056
|
+
...formsValue,
|
|
37017
37057
|
[groupFormId]: _newData
|
|
37018
|
-
})
|
|
37019
|
-
setValues(
|
|
37058
|
+
});
|
|
37059
|
+
setValues({
|
|
37060
|
+
...formsValue,
|
|
37020
37061
|
[groupFormId]: _newData
|
|
37021
|
-
})
|
|
37062
|
+
});
|
|
37022
37063
|
return;
|
|
37023
37064
|
}
|
|
37024
|
-
form
|
|
37025
|
-
onValuesChange(_val,
|
|
37026
|
-
|
|
37065
|
+
form?.setFieldValue(name, _val[name]);
|
|
37066
|
+
onValuesChange(_val, {
|
|
37067
|
+
...formsValue,
|
|
37068
|
+
..._val
|
|
37069
|
+
});
|
|
37070
|
+
setValues({
|
|
37071
|
+
...formsValue,
|
|
37072
|
+
..._val
|
|
37073
|
+
});
|
|
37027
37074
|
},
|
|
37028
37075
|
k: name
|
|
37029
37076
|
});
|
|
37030
37077
|
},
|
|
37031
|
-
textarea: (
|
|
37032
|
-
|
|
37033
|
-
|
|
37034
|
-
|
|
37035
|
-
|
|
37036
|
-
|
|
37037
|
-
|
|
37038
|
-
|
|
37039
|
-
isHighlighted
|
|
37040
|
-
} = _ref25;
|
|
37078
|
+
textarea: ({
|
|
37079
|
+
props,
|
|
37080
|
+
rules
|
|
37081
|
+
}, {
|
|
37082
|
+
inputMeta,
|
|
37083
|
+
t,
|
|
37084
|
+
isHighlighted
|
|
37085
|
+
}) => {
|
|
37041
37086
|
const maxRule = rules.find(r => r.max);
|
|
37042
37087
|
let maxLength = MAX_TEXT_AREA_LENGTH;
|
|
37043
37088
|
let rows = 5;
|
|
@@ -37064,7 +37109,7 @@ const inputTypeComponent$1 = {
|
|
|
37064
37109
|
// rows = 14;
|
|
37065
37110
|
// }
|
|
37066
37111
|
}
|
|
37067
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea,
|
|
37112
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
|
|
37068
37113
|
allowClear: true,
|
|
37069
37114
|
autoComplete: "new-password",
|
|
37070
37115
|
maxLength: maxLength,
|
|
@@ -37072,37 +37117,35 @@ const inputTypeComponent$1 = {
|
|
|
37072
37117
|
autoSize: {
|
|
37073
37118
|
minRows: rows,
|
|
37074
37119
|
maxRows: rows
|
|
37075
|
-
}
|
|
37076
|
-
|
|
37120
|
+
},
|
|
37121
|
+
...props,
|
|
37077
37122
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
37078
37123
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
37079
|
-
})
|
|
37124
|
+
});
|
|
37080
37125
|
},
|
|
37081
|
-
phoneNumber: (
|
|
37082
|
-
|
|
37083
|
-
|
|
37084
|
-
|
|
37085
|
-
|
|
37086
|
-
|
|
37087
|
-
|
|
37088
|
-
|
|
37089
|
-
|
|
37090
|
-
|
|
37091
|
-
|
|
37092
|
-
|
|
37093
|
-
|
|
37094
|
-
|
|
37095
|
-
|
|
37096
|
-
} = _ref27;
|
|
37097
|
-
return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, _objectSpread2(_objectSpread2({
|
|
37126
|
+
phoneNumber: ({
|
|
37127
|
+
name,
|
|
37128
|
+
inputName,
|
|
37129
|
+
props,
|
|
37130
|
+
value,
|
|
37131
|
+
repeatIndex,
|
|
37132
|
+
repeatValues,
|
|
37133
|
+
formsValue
|
|
37134
|
+
}, {
|
|
37135
|
+
setFormValues,
|
|
37136
|
+
inputMeta,
|
|
37137
|
+
t,
|
|
37138
|
+
isHighlighted
|
|
37139
|
+
}) => {
|
|
37140
|
+
return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, {
|
|
37098
37141
|
customSelectWidthPercentage: "20%",
|
|
37099
37142
|
t: t,
|
|
37100
37143
|
size: "large",
|
|
37101
37144
|
allowClear: true,
|
|
37102
|
-
country: formsValue
|
|
37145
|
+
country: formsValue?.country,
|
|
37103
37146
|
initialValue: value,
|
|
37104
|
-
name: name
|
|
37105
|
-
|
|
37147
|
+
name: name,
|
|
37148
|
+
...props,
|
|
37106
37149
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37107
37150
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
37108
37151
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type Number"),
|
|
@@ -37123,27 +37166,26 @@ const inputTypeComponent$1 = {
|
|
|
37123
37166
|
}
|
|
37124
37167
|
return val;
|
|
37125
37168
|
}
|
|
37126
|
-
})
|
|
37169
|
+
});
|
|
37127
37170
|
},
|
|
37128
|
-
switch: (
|
|
37129
|
-
|
|
37130
|
-
|
|
37131
|
-
|
|
37132
|
-
|
|
37133
|
-
|
|
37134
|
-
|
|
37135
|
-
|
|
37136
|
-
|
|
37137
|
-
|
|
37138
|
-
|
|
37139
|
-
|
|
37140
|
-
|
|
37141
|
-
|
|
37142
|
-
|
|
37143
|
-
|
|
37144
|
-
|
|
37145
|
-
|
|
37146
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
37171
|
+
switch: ({
|
|
37172
|
+
props,
|
|
37173
|
+
value,
|
|
37174
|
+
restricted,
|
|
37175
|
+
autocomplete,
|
|
37176
|
+
formsValue,
|
|
37177
|
+
repeatValues,
|
|
37178
|
+
repeatIndex,
|
|
37179
|
+
name,
|
|
37180
|
+
inputName,
|
|
37181
|
+
replace: replaceInput,
|
|
37182
|
+
unique
|
|
37183
|
+
}, {
|
|
37184
|
+
form,
|
|
37185
|
+
isHighlighted
|
|
37186
|
+
}) => {
|
|
37187
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, {
|
|
37188
|
+
...props,
|
|
37147
37189
|
size: "default",
|
|
37148
37190
|
defaultChecked: value || false,
|
|
37149
37191
|
checked: value || false,
|
|
@@ -37171,7 +37213,9 @@ const inputTypeComponent$1 = {
|
|
|
37171
37213
|
const [formName, replaceInputName] = replaceTo.split(".");
|
|
37172
37214
|
const replaceRepeatValues = replaceInputName ? dot__default["default"].pick(formName, formsValue) : undefined;
|
|
37173
37215
|
updateFormValues$1(undefined, replaceRepeatValues, replaceInputName, isChecked ? newId : undefined, formsValue, formName, form);
|
|
37174
|
-
formsValue = Object.assign(formsValue,
|
|
37216
|
+
formsValue = Object.assign(formsValue, {
|
|
37217
|
+
...form.getFieldsValue(true)
|
|
37218
|
+
});
|
|
37175
37219
|
if (oldId) {
|
|
37176
37220
|
const allRepeatValues = dot__default["default"].pick(name, formsValue);
|
|
37177
37221
|
if (allRepeatValues && Array.isArray(allRepeatValues)) {
|
|
@@ -37212,22 +37256,20 @@ const inputTypeComponent$1 = {
|
|
|
37212
37256
|
}
|
|
37213
37257
|
}
|
|
37214
37258
|
}
|
|
37215
|
-
})
|
|
37259
|
+
});
|
|
37216
37260
|
},
|
|
37217
|
-
radioGroup: (
|
|
37218
|
-
|
|
37219
|
-
|
|
37220
|
-
|
|
37221
|
-
|
|
37222
|
-
|
|
37223
|
-
|
|
37224
|
-
|
|
37225
|
-
isHighlighted
|
|
37226
|
-
} = _ref31;
|
|
37261
|
+
radioGroup: ({
|
|
37262
|
+
props,
|
|
37263
|
+
value,
|
|
37264
|
+
options,
|
|
37265
|
+
isRisk
|
|
37266
|
+
}, {
|
|
37267
|
+
isHighlighted
|
|
37268
|
+
}) => {
|
|
37227
37269
|
if (isRisk) {
|
|
37228
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group,
|
|
37229
|
-
value: value
|
|
37230
|
-
|
|
37270
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
|
|
37271
|
+
value: value,
|
|
37272
|
+
...props,
|
|
37231
37273
|
className: "is-risk-radio",
|
|
37232
37274
|
children: (options || []).map(o => {
|
|
37233
37275
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
|
|
@@ -37241,11 +37283,11 @@ const inputTypeComponent$1 = {
|
|
|
37241
37283
|
}) : null]
|
|
37242
37284
|
}, o.value);
|
|
37243
37285
|
})
|
|
37244
|
-
})
|
|
37286
|
+
});
|
|
37245
37287
|
}
|
|
37246
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group,
|
|
37247
|
-
value: value
|
|
37248
|
-
|
|
37288
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
|
|
37289
|
+
value: value,
|
|
37290
|
+
...props,
|
|
37249
37291
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37250
37292
|
children: (options || []).map(o => {
|
|
37251
37293
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
|
|
@@ -37259,20 +37301,18 @@ const inputTypeComponent$1 = {
|
|
|
37259
37301
|
}) : null]
|
|
37260
37302
|
}, o.value);
|
|
37261
37303
|
})
|
|
37262
|
-
})
|
|
37304
|
+
});
|
|
37263
37305
|
},
|
|
37264
|
-
checkboxGroup: (
|
|
37265
|
-
|
|
37266
|
-
|
|
37267
|
-
|
|
37268
|
-
|
|
37269
|
-
|
|
37270
|
-
|
|
37271
|
-
|
|
37272
|
-
|
|
37273
|
-
|
|
37274
|
-
value: value
|
|
37275
|
-
}, props), {}, {
|
|
37306
|
+
checkboxGroup: ({
|
|
37307
|
+
props,
|
|
37308
|
+
value,
|
|
37309
|
+
options
|
|
37310
|
+
}, {
|
|
37311
|
+
isHighlighted
|
|
37312
|
+
}) => {
|
|
37313
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, {
|
|
37314
|
+
value: value,
|
|
37315
|
+
...props,
|
|
37276
37316
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37277
37317
|
style: {
|
|
37278
37318
|
display: "grid",
|
|
@@ -37296,18 +37336,16 @@ const inputTypeComponent$1 = {
|
|
|
37296
37336
|
}) : null]
|
|
37297
37337
|
}, o.value);
|
|
37298
37338
|
})
|
|
37299
|
-
})
|
|
37339
|
+
});
|
|
37300
37340
|
},
|
|
37301
|
-
total100: (
|
|
37302
|
-
|
|
37303
|
-
|
|
37304
|
-
|
|
37305
|
-
|
|
37306
|
-
|
|
37307
|
-
|
|
37308
|
-
|
|
37309
|
-
isHighlighted
|
|
37310
|
-
} = _ref35;
|
|
37341
|
+
total100: ({
|
|
37342
|
+
props,
|
|
37343
|
+
name,
|
|
37344
|
+
options,
|
|
37345
|
+
value
|
|
37346
|
+
}, {
|
|
37347
|
+
isHighlighted
|
|
37348
|
+
}) => {
|
|
37311
37349
|
value = value ? Array.isArray(value) ? value : [value] : [];
|
|
37312
37350
|
function totalValue() {
|
|
37313
37351
|
let total = 0;
|
|
@@ -37331,11 +37369,10 @@ const inputTypeComponent$1 = {
|
|
|
37331
37369
|
className: formatClassname(["total100", isHighlighted && "highlighted-input"]),
|
|
37332
37370
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
|
|
37333
37371
|
name: name,
|
|
37334
|
-
children: (fields,
|
|
37335
|
-
|
|
37336
|
-
|
|
37337
|
-
|
|
37338
|
-
} = _ref36;
|
|
37372
|
+
children: (fields, {
|
|
37373
|
+
add,
|
|
37374
|
+
remove
|
|
37375
|
+
}) => {
|
|
37339
37376
|
if (fields.length === 0) {
|
|
37340
37377
|
const formData = value || [];
|
|
37341
37378
|
if (formData.length) {
|
|
@@ -37354,27 +37391,27 @@ const inputTypeComponent$1 = {
|
|
|
37354
37391
|
const v = value[field.name] || {};
|
|
37355
37392
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Space, {
|
|
37356
37393
|
className: "total",
|
|
37357
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item,
|
|
37358
|
-
noStyle: true
|
|
37359
|
-
|
|
37394
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
37395
|
+
noStyle: true,
|
|
37396
|
+
...field,
|
|
37360
37397
|
name: [field.name, "type"],
|
|
37361
37398
|
fieldKey: [field.fieldKey, "type"],
|
|
37362
37399
|
initialValue: v.type || null,
|
|
37363
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select,
|
|
37400
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
37364
37401
|
size: "large",
|
|
37365
37402
|
allowClear: true,
|
|
37366
37403
|
showSearch: true,
|
|
37367
37404
|
filterOption: filterSelectOptions,
|
|
37368
|
-
optionFilterProp: "children"
|
|
37369
|
-
|
|
37405
|
+
optionFilterProp: "children",
|
|
37406
|
+
...props,
|
|
37370
37407
|
children: options.map((option, i) => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
37371
37408
|
value: option.value,
|
|
37372
37409
|
children: option.label
|
|
37373
37410
|
}, i))
|
|
37374
|
-
})
|
|
37375
|
-
})
|
|
37376
|
-
noStyle: true
|
|
37377
|
-
|
|
37411
|
+
})
|
|
37412
|
+
}), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
37413
|
+
noStyle: true,
|
|
37414
|
+
...field,
|
|
37378
37415
|
name: [field.name, "value"],
|
|
37379
37416
|
fieldKey: [field.fieldKey, "value"],
|
|
37380
37417
|
initialValue: v.value,
|
|
@@ -37383,14 +37420,14 @@ const inputTypeComponent$1 = {
|
|
|
37383
37420
|
allowClear: true,
|
|
37384
37421
|
name: "value",
|
|
37385
37422
|
formatter: value => {
|
|
37386
|
-
return value ?
|
|
37423
|
+
return value ? `${value}%` : "";
|
|
37387
37424
|
},
|
|
37388
37425
|
disabled: !v.type || null,
|
|
37389
37426
|
placeholder: props.valueplaceholder ? props.valueplaceholder : "Value",
|
|
37390
37427
|
min: 1,
|
|
37391
37428
|
max: 100 - siblingTotal(v.type || 0)
|
|
37392
37429
|
})
|
|
37393
|
-
})
|
|
37430
|
+
}), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
37394
37431
|
disabled: !v.value || !v.type || totalValue() >= 100,
|
|
37395
37432
|
type: "primary",
|
|
37396
37433
|
icon: /*#__PURE__*/jsxRuntime.jsx(Icons.PlusOutlined, {}),
|
|
@@ -37422,22 +37459,19 @@ const inputTypeComponent$1 = {
|
|
|
37422
37459
|
}) : null]
|
|
37423
37460
|
});
|
|
37424
37461
|
},
|
|
37425
|
-
percentage: (
|
|
37426
|
-
|
|
37427
|
-
|
|
37428
|
-
|
|
37429
|
-
|
|
37430
|
-
|
|
37431
|
-
|
|
37432
|
-
|
|
37433
|
-
|
|
37434
|
-
|
|
37435
|
-
|
|
37436
|
-
|
|
37437
|
-
|
|
37438
|
-
t,
|
|
37439
|
-
isHighlighted
|
|
37440
|
-
} = _ref38;
|
|
37462
|
+
percentage: ({
|
|
37463
|
+
name,
|
|
37464
|
+
inputName,
|
|
37465
|
+
totalMax,
|
|
37466
|
+
repeatIndex,
|
|
37467
|
+
props,
|
|
37468
|
+
formsValue,
|
|
37469
|
+
input
|
|
37470
|
+
}, {
|
|
37471
|
+
inputMeta,
|
|
37472
|
+
t,
|
|
37473
|
+
isHighlighted
|
|
37474
|
+
}) => {
|
|
37441
37475
|
const isRepeatable = Array.isArray(formsValue[name]);
|
|
37442
37476
|
let totalSiblings = 0;
|
|
37443
37477
|
if (isRepeatable && totalMax) {
|
|
@@ -37445,47 +37479,45 @@ const inputTypeComponent$1 = {
|
|
|
37445
37479
|
totl = totl + (grp[inputName] || 0);
|
|
37446
37480
|
return totl;
|
|
37447
37481
|
}, 0);
|
|
37448
|
-
} else if (Array.isArray(input
|
|
37482
|
+
} else if (Array.isArray(input?.meta?.siblings)) {
|
|
37449
37483
|
totalSiblings = input.meta.siblings.reduce((totl, key) => {
|
|
37450
37484
|
totl = totl + (formsValue[key] || 0);
|
|
37451
37485
|
return totl;
|
|
37452
37486
|
}, 0);
|
|
37453
37487
|
}
|
|
37454
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber,
|
|
37488
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
37455
37489
|
size: "large",
|
|
37456
|
-
allowClear: true
|
|
37457
|
-
|
|
37490
|
+
allowClear: true,
|
|
37491
|
+
...props,
|
|
37458
37492
|
className: formatClassname([isHighlighted && "highlighted-cont"]),
|
|
37459
37493
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
37460
37494
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
|
|
37461
37495
|
min: 0,
|
|
37462
37496
|
max: 100 - totalSiblings,
|
|
37463
37497
|
formatter: value => {
|
|
37464
|
-
return value ?
|
|
37498
|
+
return value ? `${value}` : "";
|
|
37465
37499
|
},
|
|
37466
37500
|
parser: value => value.replace("%", ""),
|
|
37467
37501
|
addonAfter: "%"
|
|
37468
|
-
})
|
|
37502
|
+
});
|
|
37469
37503
|
},
|
|
37470
|
-
drawTerritory: (
|
|
37471
|
-
|
|
37472
|
-
|
|
37473
|
-
|
|
37474
|
-
|
|
37475
|
-
|
|
37476
|
-
|
|
37477
|
-
setFormValues
|
|
37478
|
-
} = _ref40;
|
|
37504
|
+
drawTerritory: ({
|
|
37505
|
+
formsValue,
|
|
37506
|
+
name,
|
|
37507
|
+
addressData
|
|
37508
|
+
}, {
|
|
37509
|
+
setFormValues
|
|
37510
|
+
}) => {
|
|
37479
37511
|
let search = formsValue.country;
|
|
37480
37512
|
if (addressData && addressData.address && Object.keys(addressData.address).length > 0) {
|
|
37481
37513
|
if (addressData.address.country) {
|
|
37482
37514
|
search = addressData.address.country;
|
|
37483
37515
|
}
|
|
37484
37516
|
if (addressData.address.level1) {
|
|
37485
|
-
search =
|
|
37517
|
+
search = `${addressData.address.level1}, ${addressData.address.country}`;
|
|
37486
37518
|
}
|
|
37487
37519
|
if (addressData.address.level2) {
|
|
37488
|
-
search =
|
|
37520
|
+
search = `${addressData.address.level2}, ${addressData.address.level1}, ${addressData.address.country}`;
|
|
37489
37521
|
}
|
|
37490
37522
|
} else {
|
|
37491
37523
|
const country = countriesList.countries[formsValue.country] || {};
|
|
@@ -37493,10 +37525,10 @@ const inputTypeComponent$1 = {
|
|
|
37493
37525
|
search = country.name;
|
|
37494
37526
|
}
|
|
37495
37527
|
if (formsValue.administrativeLevel1Name) {
|
|
37496
|
-
search =
|
|
37528
|
+
search = `${search} ${formsValue.administrativeLevel1Name}`;
|
|
37497
37529
|
}
|
|
37498
37530
|
if (formsValue.administrativeLevel2Name) {
|
|
37499
|
-
search =
|
|
37531
|
+
search = `${search} ${formsValue.administrativeLevel2Name}`;
|
|
37500
37532
|
}
|
|
37501
37533
|
}
|
|
37502
37534
|
return /*#__PURE__*/jsxRuntime.jsx(PolygonSelector, {
|
|
@@ -37508,36 +37540,32 @@ const inputTypeComponent$1 = {
|
|
|
37508
37540
|
searchValue: search
|
|
37509
37541
|
});
|
|
37510
37542
|
},
|
|
37511
|
-
year: (
|
|
37512
|
-
|
|
37513
|
-
|
|
37514
|
-
|
|
37515
|
-
|
|
37516
|
-
isHighlighted
|
|
37517
|
-
} = _ref42;
|
|
37543
|
+
year: ({
|
|
37544
|
+
props
|
|
37545
|
+
}, {
|
|
37546
|
+
isHighlighted
|
|
37547
|
+
}) => {
|
|
37518
37548
|
const lng = localStorage.getItem("datastakeLng") || "en";
|
|
37519
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker,
|
|
37549
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
37520
37550
|
size: "large",
|
|
37521
37551
|
allowClear: true,
|
|
37522
37552
|
locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
|
|
37523
|
-
picker: "year"
|
|
37524
|
-
|
|
37553
|
+
picker: "year",
|
|
37554
|
+
...props,
|
|
37525
37555
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37526
37556
|
format: "YYYY"
|
|
37527
|
-
})
|
|
37557
|
+
});
|
|
37528
37558
|
},
|
|
37529
|
-
upload: (
|
|
37530
|
-
|
|
37531
|
-
|
|
37532
|
-
|
|
37533
|
-
|
|
37534
|
-
|
|
37535
|
-
|
|
37536
|
-
|
|
37537
|
-
|
|
37538
|
-
|
|
37539
|
-
isHighlighted
|
|
37540
|
-
} = _ref44;
|
|
37559
|
+
upload: ({
|
|
37560
|
+
rules,
|
|
37561
|
+
value
|
|
37562
|
+
}, {
|
|
37563
|
+
setLoading = () => {},
|
|
37564
|
+
getApiBaseUrl,
|
|
37565
|
+
getAppHeader,
|
|
37566
|
+
t,
|
|
37567
|
+
isHighlighted
|
|
37568
|
+
}) => {
|
|
37541
37569
|
const apiURL = getApiBaseUrl();
|
|
37542
37570
|
const accept = rules.length ? rules.find(rule => Object.keys(rule).includes("accept")).accept || "*" : null;
|
|
37543
37571
|
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) : []) || [];
|
|
@@ -37550,12 +37578,13 @@ const inputTypeComponent$1 = {
|
|
|
37550
37578
|
maxProps.multiple = true;
|
|
37551
37579
|
}
|
|
37552
37580
|
}
|
|
37553
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload,
|
|
37581
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37582
|
+
...maxProps,
|
|
37554
37583
|
accept: accept,
|
|
37555
|
-
action:
|
|
37584
|
+
action: `${apiURL}/upload`,
|
|
37556
37585
|
beforeUpload: beforeUpload(allowedExtensions),
|
|
37557
37586
|
onChange: val => {
|
|
37558
|
-
if (val
|
|
37587
|
+
if (val?.file && typeof setLoading === "function") {
|
|
37559
37588
|
if (val.file.percent !== 100) {
|
|
37560
37589
|
setLoading(true);
|
|
37561
37590
|
} else {
|
|
@@ -37563,9 +37592,10 @@ const inputTypeComponent$1 = {
|
|
|
37563
37592
|
}
|
|
37564
37593
|
}
|
|
37565
37594
|
},
|
|
37566
|
-
headers:
|
|
37567
|
-
Authorization:
|
|
37568
|
-
|
|
37595
|
+
headers: {
|
|
37596
|
+
Authorization: `Bearer ${getToken()}`,
|
|
37597
|
+
...getAppHeader()
|
|
37598
|
+
},
|
|
37569
37599
|
defaultFileList: values,
|
|
37570
37600
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
37571
37601
|
style: {
|
|
@@ -37576,20 +37606,18 @@ const inputTypeComponent$1 = {
|
|
|
37576
37606
|
children: t("Upload")
|
|
37577
37607
|
})]
|
|
37578
37608
|
})
|
|
37579
|
-
})
|
|
37609
|
+
});
|
|
37580
37610
|
},
|
|
37581
|
-
imageUpload: (
|
|
37582
|
-
|
|
37583
|
-
|
|
37584
|
-
|
|
37585
|
-
|
|
37586
|
-
|
|
37587
|
-
|
|
37588
|
-
|
|
37589
|
-
|
|
37590
|
-
|
|
37591
|
-
isHighlighted
|
|
37592
|
-
} = _ref46;
|
|
37611
|
+
imageUpload: ({
|
|
37612
|
+
rules,
|
|
37613
|
+
value
|
|
37614
|
+
}, {
|
|
37615
|
+
setLoading = () => {},
|
|
37616
|
+
getApiBaseUrl,
|
|
37617
|
+
getAppHeader,
|
|
37618
|
+
t,
|
|
37619
|
+
isHighlighted
|
|
37620
|
+
}) => {
|
|
37593
37621
|
const apiURL = getApiBaseUrl();
|
|
37594
37622
|
const values = getImageUploadEditValue(value);
|
|
37595
37623
|
const maxRule = rules.find(r => r.max);
|
|
@@ -37600,18 +37628,17 @@ const inputTypeComponent$1 = {
|
|
|
37600
37628
|
maxProps.multiple = true;
|
|
37601
37629
|
}
|
|
37602
37630
|
}
|
|
37603
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload,
|
|
37604
|
-
beforeUpload: beforeUpload(allowedImageExtensions)
|
|
37605
|
-
|
|
37631
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37632
|
+
beforeUpload: beforeUpload(allowedImageExtensions),
|
|
37633
|
+
...maxProps,
|
|
37606
37634
|
accept: "image/*",
|
|
37607
37635
|
classList: !values || !values.length ? "empty" : "",
|
|
37608
37636
|
listType: "picture",
|
|
37609
|
-
action:
|
|
37637
|
+
action: `${apiURL}/upload`,
|
|
37610
37638
|
onChange: val => {
|
|
37611
37639
|
if (typeof setLoading === "function") {
|
|
37612
|
-
if (val
|
|
37613
|
-
|
|
37614
|
-
if ((val === null || val === void 0 || (_val$file = val.file) === null || _val$file === void 0 ? void 0 : _val$file.status) === "removed") {
|
|
37640
|
+
if (val?.file) {
|
|
37641
|
+
if (val?.file?.status === "removed") {
|
|
37615
37642
|
setLoading(false);
|
|
37616
37643
|
return;
|
|
37617
37644
|
}
|
|
@@ -37623,9 +37650,10 @@ const inputTypeComponent$1 = {
|
|
|
37623
37650
|
setLoading(false);
|
|
37624
37651
|
}
|
|
37625
37652
|
},
|
|
37626
|
-
headers:
|
|
37627
|
-
Authorization:
|
|
37628
|
-
|
|
37653
|
+
headers: {
|
|
37654
|
+
Authorization: `Bearer ${getToken()}`,
|
|
37655
|
+
...getAppHeader()
|
|
37656
|
+
},
|
|
37629
37657
|
defaultFileList: values,
|
|
37630
37658
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
37631
37659
|
style: {
|
|
@@ -37636,20 +37664,18 @@ const inputTypeComponent$1 = {
|
|
|
37636
37664
|
children: t("Upload")
|
|
37637
37665
|
})]
|
|
37638
37666
|
})
|
|
37639
|
-
})
|
|
37667
|
+
});
|
|
37640
37668
|
},
|
|
37641
|
-
videoUpload: (
|
|
37642
|
-
|
|
37643
|
-
|
|
37644
|
-
|
|
37645
|
-
|
|
37646
|
-
|
|
37647
|
-
|
|
37648
|
-
|
|
37649
|
-
|
|
37650
|
-
|
|
37651
|
-
isHighlighted
|
|
37652
|
-
} = _ref48;
|
|
37669
|
+
videoUpload: ({
|
|
37670
|
+
rules,
|
|
37671
|
+
value
|
|
37672
|
+
}, {
|
|
37673
|
+
setLoading = () => {},
|
|
37674
|
+
getApiBaseUrl,
|
|
37675
|
+
getAppHeader,
|
|
37676
|
+
t,
|
|
37677
|
+
isHighlighted
|
|
37678
|
+
}) => {
|
|
37653
37679
|
const apiURL = getApiBaseUrl();
|
|
37654
37680
|
const values = getImageUploadEditValue(value);
|
|
37655
37681
|
const maxRule = rules.find(r => r.max);
|
|
@@ -37660,25 +37686,21 @@ const inputTypeComponent$1 = {
|
|
|
37660
37686
|
maxProps.multiple = true;
|
|
37661
37687
|
}
|
|
37662
37688
|
}
|
|
37663
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload,
|
|
37664
|
-
itemRender: (item, fileList) => {
|
|
37665
|
-
|
|
37666
|
-
|
|
37667
|
-
|
|
37668
|
-
|
|
37669
|
-
|
|
37670
|
-
});
|
|
37671
|
-
}
|
|
37672
|
-
}, maxProps), {}, {
|
|
37689
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37690
|
+
itemRender: (item, fileList) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
37691
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
|
|
37692
|
+
url: fileList?.response?.url || fileList?.url
|
|
37693
|
+
}), item]
|
|
37694
|
+
}),
|
|
37695
|
+
...maxProps,
|
|
37673
37696
|
accept: "video/*",
|
|
37674
37697
|
classList: !values || !values.length ? "empty" : "",
|
|
37675
37698
|
listType: "picture",
|
|
37676
|
-
action:
|
|
37699
|
+
action: `${apiURL}/upload`,
|
|
37677
37700
|
onChange: val => {
|
|
37678
37701
|
if (typeof setLoading === "function") {
|
|
37679
|
-
if (val
|
|
37680
|
-
|
|
37681
|
-
if ((val === null || val === void 0 || (_val$file2 = val.file) === null || _val$file2 === void 0 ? void 0 : _val$file2.status) === "removed") {
|
|
37702
|
+
if (val?.file) {
|
|
37703
|
+
if (val?.file?.status === "removed") {
|
|
37682
37704
|
setLoading(false);
|
|
37683
37705
|
return;
|
|
37684
37706
|
}
|
|
@@ -37690,9 +37712,10 @@ const inputTypeComponent$1 = {
|
|
|
37690
37712
|
setLoading(false);
|
|
37691
37713
|
}
|
|
37692
37714
|
},
|
|
37693
|
-
headers:
|
|
37694
|
-
Authorization:
|
|
37695
|
-
|
|
37715
|
+
headers: {
|
|
37716
|
+
Authorization: `Bearer ${getToken()}`,
|
|
37717
|
+
...getAppHeader()
|
|
37718
|
+
},
|
|
37696
37719
|
fileList: values,
|
|
37697
37720
|
defaultFileList: values,
|
|
37698
37721
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
@@ -37704,30 +37727,28 @@ const inputTypeComponent$1 = {
|
|
|
37704
37727
|
children: t("Upload")
|
|
37705
37728
|
})]
|
|
37706
37729
|
})
|
|
37707
|
-
})
|
|
37730
|
+
});
|
|
37708
37731
|
},
|
|
37709
|
-
geolocation: (
|
|
37710
|
-
|
|
37711
|
-
|
|
37712
|
-
|
|
37713
|
-
|
|
37714
|
-
|
|
37715
|
-
|
|
37716
|
-
|
|
37717
|
-
|
|
37718
|
-
|
|
37719
|
-
isHighlighted
|
|
37720
|
-
} = _ref50;
|
|
37732
|
+
geolocation: ({
|
|
37733
|
+
value,
|
|
37734
|
+
name,
|
|
37735
|
+
props,
|
|
37736
|
+
formsValue,
|
|
37737
|
+
addressData
|
|
37738
|
+
}, {
|
|
37739
|
+
inputMeta,
|
|
37740
|
+
isHighlighted
|
|
37741
|
+
}) => {
|
|
37721
37742
|
let search = formsValue.country;
|
|
37722
37743
|
if (addressData && Object.keys(addressData).length > 0) {
|
|
37723
37744
|
if (addressData.country) {
|
|
37724
37745
|
search = addressData.country;
|
|
37725
37746
|
}
|
|
37726
37747
|
if (addressData.level1) {
|
|
37727
|
-
search =
|
|
37748
|
+
search = `${addressData.level1}, ${addressData.country}`;
|
|
37728
37749
|
}
|
|
37729
37750
|
if (addressData.level2) {
|
|
37730
|
-
search =
|
|
37751
|
+
search = `${addressData.level2}, ${addressData.level1}, ${addressData.country}`;
|
|
37731
37752
|
}
|
|
37732
37753
|
} else {
|
|
37733
37754
|
const country = countriesList.countries[formsValue.country] || {};
|
|
@@ -37735,10 +37756,10 @@ const inputTypeComponent$1 = {
|
|
|
37735
37756
|
search = country.name;
|
|
37736
37757
|
}
|
|
37737
37758
|
if (formsValue.administrativeLevel1Name) {
|
|
37738
|
-
search =
|
|
37759
|
+
search = `${search} ${formsValue.administrativeLevel1Name}`;
|
|
37739
37760
|
}
|
|
37740
37761
|
if (formsValue.administrativeLevel2Name) {
|
|
37741
|
-
search =
|
|
37762
|
+
search = `${search} ${formsValue.administrativeLevel2Name}`;
|
|
37742
37763
|
}
|
|
37743
37764
|
}
|
|
37744
37765
|
return /*#__PURE__*/jsxRuntime.jsx(Geolocation, {
|
|
@@ -37752,36 +37773,34 @@ const inputTypeComponent$1 = {
|
|
|
37752
37773
|
searchValue: search
|
|
37753
37774
|
});
|
|
37754
37775
|
},
|
|
37755
|
-
ajaxSelect: (
|
|
37756
|
-
|
|
37757
|
-
|
|
37758
|
-
|
|
37759
|
-
|
|
37760
|
-
|
|
37761
|
-
|
|
37762
|
-
|
|
37763
|
-
|
|
37764
|
-
|
|
37765
|
-
|
|
37766
|
-
|
|
37767
|
-
|
|
37768
|
-
|
|
37769
|
-
|
|
37770
|
-
|
|
37771
|
-
|
|
37772
|
-
|
|
37773
|
-
|
|
37774
|
-
|
|
37775
|
-
|
|
37776
|
-
|
|
37777
|
-
|
|
37778
|
-
|
|
37779
|
-
|
|
37780
|
-
|
|
37781
|
-
|
|
37782
|
-
|
|
37783
|
-
groupFormId
|
|
37784
|
-
} = _ref52;
|
|
37776
|
+
ajaxSelect: ({
|
|
37777
|
+
call,
|
|
37778
|
+
automaticallyLink,
|
|
37779
|
+
name,
|
|
37780
|
+
inputName,
|
|
37781
|
+
props,
|
|
37782
|
+
formsValue,
|
|
37783
|
+
onNewSetValue,
|
|
37784
|
+
multiple,
|
|
37785
|
+
updateOptions,
|
|
37786
|
+
repeatValues,
|
|
37787
|
+
repeatIndex,
|
|
37788
|
+
value,
|
|
37789
|
+
unique,
|
|
37790
|
+
address,
|
|
37791
|
+
addressData = {},
|
|
37792
|
+
getFromLinking,
|
|
37793
|
+
input
|
|
37794
|
+
}, {
|
|
37795
|
+
form,
|
|
37796
|
+
forms,
|
|
37797
|
+
setAddress,
|
|
37798
|
+
changeInputMeta,
|
|
37799
|
+
inputMeta,
|
|
37800
|
+
meta,
|
|
37801
|
+
isHighlighted,
|
|
37802
|
+
groupFormId
|
|
37803
|
+
}) => {
|
|
37785
37804
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect, {
|
|
37786
37805
|
size: "medium",
|
|
37787
37806
|
input: input,
|
|
@@ -37818,7 +37837,9 @@ const inputTypeComponent$1 = {
|
|
|
37818
37837
|
const selectedValue = data.find(v => v.value === ev);
|
|
37819
37838
|
if (address && selectedValue) {
|
|
37820
37839
|
dot__default["default"].str(address, selectedValue.label, addressData);
|
|
37821
|
-
setAddress(
|
|
37840
|
+
setAddress({
|
|
37841
|
+
...addressData
|
|
37842
|
+
});
|
|
37822
37843
|
}
|
|
37823
37844
|
}
|
|
37824
37845
|
},
|
|
@@ -37827,11 +37848,10 @@ const inputTypeComponent$1 = {
|
|
|
37827
37848
|
address: true
|
|
37828
37849
|
});
|
|
37829
37850
|
},
|
|
37830
|
-
tag:
|
|
37831
|
-
|
|
37832
|
-
|
|
37833
|
-
|
|
37834
|
-
} = _ref53;
|
|
37851
|
+
tag: ({
|
|
37852
|
+
value,
|
|
37853
|
+
repeatLabel
|
|
37854
|
+
}) => {
|
|
37835
37855
|
return /*#__PURE__*/jsxRuntime.jsx(TagInput, {
|
|
37836
37856
|
size: "large",
|
|
37837
37857
|
allowClear: true,
|
|
@@ -37839,28 +37859,26 @@ const inputTypeComponent$1 = {
|
|
|
37839
37859
|
newPlaceholder: repeatLabel
|
|
37840
37860
|
});
|
|
37841
37861
|
},
|
|
37842
|
-
modal: (
|
|
37843
|
-
|
|
37844
|
-
|
|
37845
|
-
|
|
37846
|
-
|
|
37847
|
-
|
|
37848
|
-
|
|
37849
|
-
|
|
37850
|
-
|
|
37851
|
-
|
|
37852
|
-
|
|
37853
|
-
|
|
37854
|
-
|
|
37855
|
-
|
|
37856
|
-
|
|
37857
|
-
|
|
37858
|
-
|
|
37859
|
-
|
|
37860
|
-
|
|
37861
|
-
|
|
37862
|
-
add
|
|
37863
|
-
} = _ref55;
|
|
37862
|
+
modal: ({
|
|
37863
|
+
call,
|
|
37864
|
+
automaticallyLink,
|
|
37865
|
+
name,
|
|
37866
|
+
inputName,
|
|
37867
|
+
props,
|
|
37868
|
+
formsValue,
|
|
37869
|
+
allFormsValue,
|
|
37870
|
+
onNewSetValue,
|
|
37871
|
+
repeatValues,
|
|
37872
|
+
repeatIndex,
|
|
37873
|
+
value,
|
|
37874
|
+
modalTitle,
|
|
37875
|
+
totalInputs,
|
|
37876
|
+
shownInputs,
|
|
37877
|
+
allowDupplicates
|
|
37878
|
+
}, {
|
|
37879
|
+
form,
|
|
37880
|
+
add
|
|
37881
|
+
}) => {
|
|
37864
37882
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxModal, {
|
|
37865
37883
|
allowClear: true,
|
|
37866
37884
|
call: call,
|
|
@@ -37883,44 +37901,40 @@ const inputTypeComponent$1 = {
|
|
|
37883
37901
|
allowDupplicates: allowDupplicates
|
|
37884
37902
|
});
|
|
37885
37903
|
},
|
|
37886
|
-
dataLink: (
|
|
37887
|
-
|
|
37888
|
-
|
|
37889
|
-
|
|
37890
|
-
|
|
37891
|
-
|
|
37892
|
-
|
|
37893
|
-
|
|
37894
|
-
|
|
37895
|
-
|
|
37896
|
-
|
|
37897
|
-
|
|
37898
|
-
|
|
37899
|
-
|
|
37900
|
-
|
|
37901
|
-
|
|
37902
|
-
|
|
37903
|
-
|
|
37904
|
-
|
|
37905
|
-
|
|
37906
|
-
|
|
37907
|
-
|
|
37908
|
-
|
|
37909
|
-
|
|
37910
|
-
|
|
37911
|
-
|
|
37912
|
-
|
|
37913
|
-
|
|
37914
|
-
|
|
37915
|
-
|
|
37916
|
-
|
|
37917
|
-
|
|
37918
|
-
groupFormId
|
|
37919
|
-
|
|
37920
|
-
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") {
|
|
37921
|
-
var _formsValue$groupForm3, _input$meta13, _input$meta14;
|
|
37922
|
-
const currentValue = groupFormId ? (_formsValue$groupForm3 = formsValue[groupFormId]) === null || _formsValue$groupForm3 === void 0 ? void 0 : _formsValue$groupForm3[name] : formsValue[name];
|
|
37923
|
-
(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()::::";
|
|
37904
|
+
dataLink: ({
|
|
37905
|
+
setValues,
|
|
37906
|
+
name,
|
|
37907
|
+
onValuesChange,
|
|
37908
|
+
changeLinking,
|
|
37909
|
+
formsValue,
|
|
37910
|
+
input,
|
|
37911
|
+
call,
|
|
37912
|
+
automaticallyLink,
|
|
37913
|
+
inputName,
|
|
37914
|
+
props,
|
|
37915
|
+
onNewSetValue,
|
|
37916
|
+
multiple,
|
|
37917
|
+
updateOptions,
|
|
37918
|
+
repeatValues,
|
|
37919
|
+
repeatIndex,
|
|
37920
|
+
value,
|
|
37921
|
+
unique,
|
|
37922
|
+
address,
|
|
37923
|
+
addressData = {},
|
|
37924
|
+
getFromLinking
|
|
37925
|
+
}, {
|
|
37926
|
+
form,
|
|
37927
|
+
forms,
|
|
37928
|
+
setAddress,
|
|
37929
|
+
changeInputMeta,
|
|
37930
|
+
inputMeta,
|
|
37931
|
+
meta,
|
|
37932
|
+
isHighlighted,
|
|
37933
|
+
groupFormId
|
|
37934
|
+
}) => {
|
|
37935
|
+
if (input?.meta?.optionsView?.editInputType === "ajaxSelect") {
|
|
37936
|
+
const currentValue = groupFormId ? formsValue[groupFormId]?.[name] : formsValue[name];
|
|
37937
|
+
input?.meta?.optionsView?.call || input?.meta?.call || "default::list()::::";
|
|
37924
37938
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect$1, {
|
|
37925
37939
|
size: "medium",
|
|
37926
37940
|
input: input,
|
|
@@ -37957,7 +37971,9 @@ const inputTypeComponent$1 = {
|
|
|
37957
37971
|
const selectedValue = data.find(v => v.value === ev);
|
|
37958
37972
|
if (address && selectedValue) {
|
|
37959
37973
|
dot__default["default"].str(address, selectedValue.label, addressData);
|
|
37960
|
-
setAddress(
|
|
37974
|
+
setAddress({
|
|
37975
|
+
...addressData
|
|
37976
|
+
});
|
|
37961
37977
|
}
|
|
37962
37978
|
}
|
|
37963
37979
|
},
|
|
@@ -37967,93 +37983,138 @@ const inputTypeComponent$1 = {
|
|
|
37967
37983
|
isDataLink: true
|
|
37968
37984
|
});
|
|
37969
37985
|
}
|
|
37970
|
-
const isSingle =
|
|
37971
|
-
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [
|
|
37986
|
+
const isSingle = input?.meta?.maxRepeat === 1;
|
|
37987
|
+
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
|
|
37988
|
+
...(formsValue[groupFormId] || {})[name]
|
|
37989
|
+
}] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
|
|
37990
|
+
...v
|
|
37991
|
+
})) : isSingle ? formsValue[name] ? [{
|
|
37992
|
+
...formsValue[name]
|
|
37993
|
+
}] : [] : (formsValue[name] || []).map(v => ({
|
|
37994
|
+
...v
|
|
37995
|
+
}));
|
|
37972
37996
|
const onUpdate = (editData, i) => {
|
|
37973
|
-
const val =
|
|
37997
|
+
const val = {
|
|
37998
|
+
...formData[i],
|
|
37999
|
+
...editData
|
|
38000
|
+
};
|
|
37974
38001
|
const _val = isSingle ? {
|
|
37975
38002
|
[name]: val
|
|
37976
38003
|
} : {
|
|
37977
|
-
[name]: formData
|
|
38004
|
+
[name]: formData?.map((d, j) => i === j ? val : d)
|
|
37978
38005
|
};
|
|
37979
38006
|
if (groupFormId) {
|
|
37980
|
-
const _defaultData =
|
|
37981
|
-
const _newData =
|
|
37982
|
-
|
|
38007
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38008
|
+
const _newData = {
|
|
38009
|
+
..._defaultData,
|
|
38010
|
+
..._val
|
|
38011
|
+
};
|
|
38012
|
+
onValuesChange(_newData, {
|
|
38013
|
+
...formsValue,
|
|
37983
38014
|
[groupFormId]: _newData
|
|
37984
|
-
})
|
|
37985
|
-
form
|
|
37986
|
-
setValues(
|
|
38015
|
+
});
|
|
38016
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38017
|
+
setValues({
|
|
38018
|
+
...formsValue,
|
|
37987
38019
|
[groupFormId]: _newData
|
|
37988
|
-
})
|
|
38020
|
+
});
|
|
37989
38021
|
return;
|
|
37990
38022
|
}
|
|
37991
|
-
onValuesChange(_val,
|
|
37992
|
-
|
|
37993
|
-
|
|
38023
|
+
onValuesChange(_val, {
|
|
38024
|
+
...formsValue,
|
|
38025
|
+
..._val
|
|
38026
|
+
});
|
|
38027
|
+
form?.setFieldValue(name, _val[name]);
|
|
38028
|
+
setValues({
|
|
38029
|
+
...formsValue,
|
|
38030
|
+
..._val
|
|
38031
|
+
});
|
|
37994
38032
|
};
|
|
37995
|
-
if (input
|
|
37996
|
-
var _formsValue$meta4, _input$meta17;
|
|
38033
|
+
if (input?.meta?.flat) {
|
|
37997
38034
|
return /*#__PURE__*/jsxRuntime.jsx(DataLinkFlat, {
|
|
37998
38035
|
form: input,
|
|
37999
38036
|
changeLinking: changeLinking,
|
|
38000
38037
|
onUpdate: onUpdate,
|
|
38001
38038
|
isHighlighted: isHighlighted,
|
|
38002
38039
|
formsValue: formsValue,
|
|
38003
|
-
values: groupFormId ?
|
|
38040
|
+
values: groupFormId ? {
|
|
38041
|
+
...(formsValue[groupFormId] || {}),
|
|
38004
38042
|
meta: {
|
|
38005
|
-
inputs: (
|
|
38043
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
38006
38044
|
}
|
|
38007
|
-
}
|
|
38045
|
+
} : formsValue,
|
|
38008
38046
|
name: name,
|
|
38009
38047
|
groupFormId: groupFormId,
|
|
38010
|
-
maxRepeat: input
|
|
38011
|
-
remove:
|
|
38012
|
-
|
|
38013
|
-
|
|
38014
|
-
} = _ref58;
|
|
38048
|
+
maxRepeat: input?.meta?.maxRepeat,
|
|
38049
|
+
remove: ({
|
|
38050
|
+
key
|
|
38051
|
+
}) => {
|
|
38015
38052
|
const _val = isSingle ? {
|
|
38016
38053
|
[name]: null
|
|
38017
38054
|
} : {
|
|
38018
38055
|
[name]: formData.filter((v, i) => i !== key)
|
|
38019
38056
|
};
|
|
38020
38057
|
if (groupFormId) {
|
|
38021
|
-
const _defaultData =
|
|
38022
|
-
const _newData =
|
|
38023
|
-
|
|
38058
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38059
|
+
const _newData = {
|
|
38060
|
+
..._defaultData,
|
|
38061
|
+
..._val
|
|
38062
|
+
};
|
|
38063
|
+
onValuesChange(_newData, {
|
|
38064
|
+
...formsValue,
|
|
38024
38065
|
[groupFormId]: _newData
|
|
38025
|
-
})
|
|
38026
|
-
form
|
|
38027
|
-
setValues(
|
|
38066
|
+
});
|
|
38067
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38068
|
+
setValues({
|
|
38069
|
+
...formsValue,
|
|
38028
38070
|
[groupFormId]: _newData
|
|
38029
|
-
})
|
|
38071
|
+
});
|
|
38030
38072
|
return;
|
|
38031
38073
|
}
|
|
38032
|
-
onValuesChange(_val,
|
|
38033
|
-
|
|
38034
|
-
|
|
38074
|
+
onValuesChange(_val, {
|
|
38075
|
+
...formsValue,
|
|
38076
|
+
..._val
|
|
38077
|
+
});
|
|
38078
|
+
form?.setFieldValue(name, _val[name]);
|
|
38079
|
+
setValues({
|
|
38080
|
+
...formsValue,
|
|
38081
|
+
..._val
|
|
38082
|
+
});
|
|
38035
38083
|
},
|
|
38036
38084
|
add: val => {
|
|
38037
38085
|
const _val = isSingle ? {
|
|
38038
38086
|
[name]: val
|
|
38039
38087
|
} : {
|
|
38040
|
-
[name]: [...formData,
|
|
38088
|
+
[name]: [...formData, {
|
|
38089
|
+
...val
|
|
38090
|
+
}]
|
|
38041
38091
|
};
|
|
38042
38092
|
if (groupFormId) {
|
|
38043
|
-
const _defaultData =
|
|
38044
|
-
const _newData =
|
|
38045
|
-
|
|
38046
|
-
|
|
38093
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38094
|
+
const _newData = {
|
|
38095
|
+
..._defaultData,
|
|
38096
|
+
..._val
|
|
38097
|
+
};
|
|
38098
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38099
|
+
onValuesChange(_newData, {
|
|
38100
|
+
...formsValue,
|
|
38047
38101
|
[groupFormId]: _newData
|
|
38048
|
-
})
|
|
38049
|
-
setValues(
|
|
38102
|
+
});
|
|
38103
|
+
setValues({
|
|
38104
|
+
...formsValue,
|
|
38050
38105
|
[groupFormId]: _newData
|
|
38051
|
-
})
|
|
38106
|
+
});
|
|
38052
38107
|
return;
|
|
38053
38108
|
}
|
|
38054
|
-
form
|
|
38055
|
-
onValuesChange(_val,
|
|
38056
|
-
|
|
38109
|
+
form?.setFieldValue(name, _val[name]);
|
|
38110
|
+
onValuesChange(_val, {
|
|
38111
|
+
...formsValue,
|
|
38112
|
+
..._val
|
|
38113
|
+
});
|
|
38114
|
+
setValues({
|
|
38115
|
+
...formsValue,
|
|
38116
|
+
..._val
|
|
38117
|
+
});
|
|
38057
38118
|
},
|
|
38058
38119
|
k: name,
|
|
38059
38120
|
formData: formData
|
|
@@ -38065,79 +38126,101 @@ const inputTypeComponent$1 = {
|
|
|
38065
38126
|
onUpdate: onUpdate,
|
|
38066
38127
|
isHighlighted: isHighlighted,
|
|
38067
38128
|
formsValue: formsValue,
|
|
38068
|
-
values: groupFormId ?
|
|
38129
|
+
values: groupFormId ? {
|
|
38130
|
+
...(formsValue[groupFormId] || {}),
|
|
38069
38131
|
meta: {
|
|
38070
|
-
inputs: (
|
|
38132
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
38071
38133
|
}
|
|
38072
|
-
}
|
|
38134
|
+
} : formsValue,
|
|
38073
38135
|
name: name,
|
|
38074
38136
|
groupFormId: groupFormId,
|
|
38075
|
-
maxRepeat: input
|
|
38076
|
-
remove:
|
|
38077
|
-
|
|
38078
|
-
|
|
38079
|
-
} = _ref59;
|
|
38137
|
+
maxRepeat: input?.meta?.maxRepeat,
|
|
38138
|
+
remove: ({
|
|
38139
|
+
key
|
|
38140
|
+
}) => {
|
|
38080
38141
|
const _val = isSingle ? {
|
|
38081
38142
|
[name]: null
|
|
38082
38143
|
} : {
|
|
38083
38144
|
[name]: formData.filter((v, i) => i !== key)
|
|
38084
38145
|
};
|
|
38085
38146
|
if (groupFormId) {
|
|
38086
|
-
const _defaultData =
|
|
38087
|
-
const _newData =
|
|
38088
|
-
|
|
38147
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38148
|
+
const _newData = {
|
|
38149
|
+
..._defaultData,
|
|
38150
|
+
..._val
|
|
38151
|
+
};
|
|
38152
|
+
onValuesChange(_newData, {
|
|
38153
|
+
...formsValue,
|
|
38089
38154
|
[groupFormId]: _newData
|
|
38090
|
-
})
|
|
38091
|
-
form
|
|
38092
|
-
setValues(
|
|
38155
|
+
});
|
|
38156
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38157
|
+
setValues({
|
|
38158
|
+
...formsValue,
|
|
38093
38159
|
[groupFormId]: _newData
|
|
38094
|
-
})
|
|
38160
|
+
});
|
|
38095
38161
|
return;
|
|
38096
38162
|
}
|
|
38097
|
-
onValuesChange(_val,
|
|
38098
|
-
|
|
38099
|
-
|
|
38163
|
+
onValuesChange(_val, {
|
|
38164
|
+
...formsValue,
|
|
38165
|
+
..._val
|
|
38166
|
+
});
|
|
38167
|
+
form?.setFieldValue(name, _val[name]);
|
|
38168
|
+
setValues({
|
|
38169
|
+
...formsValue,
|
|
38170
|
+
..._val
|
|
38171
|
+
});
|
|
38100
38172
|
},
|
|
38101
38173
|
add: val => {
|
|
38102
38174
|
const _val = isSingle ? {
|
|
38103
38175
|
[name]: val
|
|
38104
38176
|
} : {
|
|
38105
|
-
[name]: [...formData,
|
|
38177
|
+
[name]: [...formData, {
|
|
38178
|
+
...val
|
|
38179
|
+
}]
|
|
38106
38180
|
};
|
|
38107
38181
|
if (groupFormId) {
|
|
38108
|
-
const _defaultData =
|
|
38109
|
-
const _newData =
|
|
38110
|
-
|
|
38111
|
-
|
|
38182
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38183
|
+
const _newData = {
|
|
38184
|
+
..._defaultData,
|
|
38185
|
+
..._val
|
|
38186
|
+
};
|
|
38187
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38188
|
+
onValuesChange(_newData, {
|
|
38189
|
+
...formsValue,
|
|
38112
38190
|
[groupFormId]: _newData
|
|
38113
|
-
})
|
|
38114
|
-
setValues(
|
|
38191
|
+
});
|
|
38192
|
+
setValues({
|
|
38193
|
+
...formsValue,
|
|
38115
38194
|
[groupFormId]: _newData
|
|
38116
|
-
})
|
|
38195
|
+
});
|
|
38117
38196
|
return;
|
|
38118
38197
|
}
|
|
38119
|
-
form
|
|
38120
|
-
onValuesChange(_val,
|
|
38121
|
-
|
|
38198
|
+
form?.setFieldValue(name, _val[name]);
|
|
38199
|
+
onValuesChange(_val, {
|
|
38200
|
+
...formsValue,
|
|
38201
|
+
..._val
|
|
38202
|
+
});
|
|
38203
|
+
setValues({
|
|
38204
|
+
...formsValue,
|
|
38205
|
+
..._val
|
|
38206
|
+
});
|
|
38122
38207
|
},
|
|
38123
38208
|
k: name,
|
|
38124
38209
|
formData: formData
|
|
38125
38210
|
});
|
|
38126
38211
|
},
|
|
38127
|
-
dataLinkGroup: (
|
|
38128
|
-
|
|
38129
|
-
|
|
38130
|
-
|
|
38131
|
-
|
|
38132
|
-
|
|
38133
|
-
|
|
38134
|
-
|
|
38135
|
-
|
|
38136
|
-
|
|
38137
|
-
|
|
38138
|
-
|
|
38139
|
-
isHighlighted
|
|
38140
|
-
} = _ref61;
|
|
38212
|
+
dataLinkGroup: ({
|
|
38213
|
+
setValues,
|
|
38214
|
+
name,
|
|
38215
|
+
onValuesChange,
|
|
38216
|
+
changeLinking,
|
|
38217
|
+
formsValue,
|
|
38218
|
+
input
|
|
38219
|
+
}, {
|
|
38220
|
+
form,
|
|
38221
|
+
groupFormId,
|
|
38222
|
+
isHighlighted
|
|
38223
|
+
}) => {
|
|
38141
38224
|
return renderDataLinkGroup({
|
|
38142
38225
|
input,
|
|
38143
38226
|
name,
|
|
@@ -38150,41 +38233,51 @@ const inputTypeComponent$1 = {
|
|
|
38150
38233
|
isHighlighted
|
|
38151
38234
|
});
|
|
38152
38235
|
},
|
|
38153
|
-
groupCheckbox: (
|
|
38154
|
-
|
|
38155
|
-
|
|
38156
|
-
|
|
38157
|
-
|
|
38158
|
-
|
|
38159
|
-
|
|
38160
|
-
|
|
38161
|
-
|
|
38162
|
-
|
|
38163
|
-
|
|
38164
|
-
isHighlighted
|
|
38165
|
-
} = _ref63;
|
|
38236
|
+
groupCheckbox: ({
|
|
38237
|
+
setValues,
|
|
38238
|
+
name,
|
|
38239
|
+
onValuesChange,
|
|
38240
|
+
formsValue,
|
|
38241
|
+
input
|
|
38242
|
+
}, {
|
|
38243
|
+
form,
|
|
38244
|
+
groupFormId,
|
|
38245
|
+
isHighlighted
|
|
38246
|
+
}) => {
|
|
38166
38247
|
const formData = groupFormId ? (formsValue[groupFormId] || {})[name] || [] : formsValue[name] || [];
|
|
38167
38248
|
const onUpdate = (val, key) => {
|
|
38168
38249
|
const _val = {
|
|
38169
|
-
[name]:
|
|
38250
|
+
[name]: {
|
|
38251
|
+
...formData,
|
|
38170
38252
|
[key]: val
|
|
38171
|
-
}
|
|
38253
|
+
}
|
|
38172
38254
|
};
|
|
38173
38255
|
if (groupFormId) {
|
|
38174
|
-
const _defaultData =
|
|
38175
|
-
const _newData =
|
|
38176
|
-
|
|
38256
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38257
|
+
const _newData = {
|
|
38258
|
+
..._defaultData,
|
|
38259
|
+
..._val
|
|
38260
|
+
};
|
|
38261
|
+
onValuesChange(_newData, {
|
|
38262
|
+
...formsValue,
|
|
38177
38263
|
[groupFormId]: _newData
|
|
38178
|
-
})
|
|
38179
|
-
form
|
|
38180
|
-
setValues(
|
|
38264
|
+
});
|
|
38265
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38266
|
+
setValues({
|
|
38267
|
+
...formsValue,
|
|
38181
38268
|
[groupFormId]: _newData
|
|
38182
|
-
})
|
|
38269
|
+
});
|
|
38183
38270
|
return;
|
|
38184
38271
|
}
|
|
38185
|
-
onValuesChange(_val,
|
|
38186
|
-
|
|
38187
|
-
|
|
38272
|
+
onValuesChange(_val, {
|
|
38273
|
+
...formsValue,
|
|
38274
|
+
..._val
|
|
38275
|
+
});
|
|
38276
|
+
form?.setFieldValue(name, _val[name]);
|
|
38277
|
+
setValues({
|
|
38278
|
+
...formsValue,
|
|
38279
|
+
..._val
|
|
38280
|
+
});
|
|
38188
38281
|
};
|
|
38189
38282
|
return /*#__PURE__*/jsxRuntime.jsx(GroupCheckbox, {
|
|
38190
38283
|
form: input,
|
|
@@ -38193,91 +38286,96 @@ const inputTypeComponent$1 = {
|
|
|
38193
38286
|
isHighlighted: isHighlighted
|
|
38194
38287
|
});
|
|
38195
38288
|
},
|
|
38196
|
-
website: (
|
|
38197
|
-
|
|
38198
|
-
|
|
38199
|
-
|
|
38200
|
-
|
|
38201
|
-
|
|
38202
|
-
|
|
38203
|
-
|
|
38204
|
-
|
|
38205
|
-
|
|
38206
|
-
|
|
38207
|
-
|
|
38208
|
-
|
|
38209
|
-
|
|
38210
|
-
|
|
38211
|
-
} = _ref65;
|
|
38212
|
-
return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
|
|
38289
|
+
website: ({
|
|
38290
|
+
name,
|
|
38291
|
+
inputName,
|
|
38292
|
+
props,
|
|
38293
|
+
value,
|
|
38294
|
+
repeatIndex,
|
|
38295
|
+
repeatValues,
|
|
38296
|
+
formsValue
|
|
38297
|
+
}, {
|
|
38298
|
+
form,
|
|
38299
|
+
isHighlighted,
|
|
38300
|
+
inputMeta = {},
|
|
38301
|
+
t
|
|
38302
|
+
}) => {
|
|
38303
|
+
return /*#__PURE__*/jsxRuntime.jsx(Website, {
|
|
38213
38304
|
size: "large",
|
|
38214
38305
|
allowClear: true,
|
|
38215
|
-
initialValue: value
|
|
38216
|
-
|
|
38306
|
+
initialValue: value,
|
|
38307
|
+
...props,
|
|
38217
38308
|
onChange: val => updateFormValues$1(repeatIndex, repeatValues, inputName, val, formsValue, name, form),
|
|
38218
38309
|
className: formatClassname([isHighlighted && "highlighted-cont"]),
|
|
38219
38310
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
38220
38311
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com"
|
|
38221
|
-
})
|
|
38312
|
+
});
|
|
38222
38313
|
},
|
|
38223
|
-
group: (
|
|
38224
|
-
|
|
38225
|
-
|
|
38226
|
-
|
|
38227
|
-
|
|
38228
|
-
|
|
38229
|
-
|
|
38230
|
-
|
|
38231
|
-
|
|
38232
|
-
} = _ref67;
|
|
38233
|
-
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
|
|
38314
|
+
group: ({
|
|
38315
|
+
props,
|
|
38316
|
+
groupInputs,
|
|
38317
|
+
formsValue
|
|
38318
|
+
}, {
|
|
38319
|
+
inputMeta,
|
|
38320
|
+
isHighlighted
|
|
38321
|
+
}) => {
|
|
38322
|
+
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
|
|
38234
38323
|
formsValue: formsValue,
|
|
38235
38324
|
isHighlighted: isHighlighted,
|
|
38236
38325
|
groupInputs: groupInputs,
|
|
38237
|
-
inputMeta: inputMeta
|
|
38238
|
-
|
|
38326
|
+
inputMeta: inputMeta,
|
|
38327
|
+
...props
|
|
38328
|
+
});
|
|
38239
38329
|
},
|
|
38240
|
-
groupInputs: (
|
|
38241
|
-
|
|
38242
|
-
|
|
38243
|
-
|
|
38244
|
-
|
|
38245
|
-
|
|
38246
|
-
|
|
38247
|
-
|
|
38248
|
-
|
|
38249
|
-
} = _ref69;
|
|
38250
|
-
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
|
|
38330
|
+
groupInputs: ({
|
|
38331
|
+
props,
|
|
38332
|
+
groupInputs,
|
|
38333
|
+
formsValue
|
|
38334
|
+
}, {
|
|
38335
|
+
inputMeta,
|
|
38336
|
+
isHighlighted
|
|
38337
|
+
}) => {
|
|
38338
|
+
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
|
|
38251
38339
|
formsValue: formsValue,
|
|
38252
38340
|
isHighlighted: isHighlighted,
|
|
38253
38341
|
groupInputs: groupInputs,
|
|
38254
|
-
inputMeta: inputMeta
|
|
38255
|
-
|
|
38342
|
+
inputMeta: inputMeta,
|
|
38343
|
+
...props
|
|
38344
|
+
});
|
|
38256
38345
|
},
|
|
38257
|
-
smartHelp: (
|
|
38346
|
+
smartHelp: ({
|
|
38347
|
+
name,
|
|
38348
|
+
inputName,
|
|
38349
|
+
props,
|
|
38350
|
+
value,
|
|
38351
|
+
repeatIndex,
|
|
38352
|
+
repeatValues,
|
|
38353
|
+
formsValue
|
|
38354
|
+
}, {
|
|
38355
|
+
form,
|
|
38356
|
+
isHighlighted,
|
|
38357
|
+
inputMeta = {},
|
|
38358
|
+
t
|
|
38359
|
+
}) => {
|
|
38258
38360
|
return /*#__PURE__*/jsxRuntime.jsx(Smart, {});
|
|
38259
38361
|
}
|
|
38260
38362
|
};
|
|
38261
38363
|
const filterForm = (f, d) => {
|
|
38262
38364
|
return f && (f.showFormIf ? showHideForm(f, d) : true);
|
|
38263
38365
|
};
|
|
38264
|
-
const checkFormHasSubsections =
|
|
38265
|
-
let f = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
38266
|
-
return Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
|
|
38267
|
-
};
|
|
38366
|
+
const checkFormHasSubsections = (f = {}) => Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
|
|
38268
38367
|
const mapFormGroup = (f, d) => Object.keys(f).map(key => {
|
|
38269
|
-
const
|
|
38270
|
-
|
|
38271
|
-
|
|
38272
|
-
|
|
38273
|
-
|
|
38274
|
-
|
|
38275
|
-
|
|
38276
|
-
|
|
38277
|
-
|
|
38278
|
-
|
|
38279
|
-
|
|
38280
|
-
fc = _objectWithoutProperties(_ref72, _excluded2$1);
|
|
38368
|
+
const {
|
|
38369
|
+
label,
|
|
38370
|
+
description = "",
|
|
38371
|
+
excludeFromEdit,
|
|
38372
|
+
showFormIf,
|
|
38373
|
+
icon = "",
|
|
38374
|
+
position = 0,
|
|
38375
|
+
template,
|
|
38376
|
+
formClass,
|
|
38377
|
+
...fc
|
|
38378
|
+
} = f[key] || {};
|
|
38281
38379
|
const fConf = {
|
|
38282
38380
|
id: key,
|
|
38283
38381
|
label,
|
|
@@ -38336,14 +38434,11 @@ const groupSubForms = (fConf, d) => {
|
|
|
38336
38434
|
return f;
|
|
38337
38435
|
}, {});
|
|
38338
38436
|
};
|
|
38339
|
-
const inputIsEmpty =
|
|
38340
|
-
|
|
38341
|
-
let values = arguments.length > 1 ? arguments[1] : undefined;
|
|
38342
|
-
let inputMeta = arguments.length > 2 ? arguments[2] : undefined;
|
|
38343
|
-
if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
|
|
38437
|
+
const inputIsEmpty = (input = {}, values, inputMeta) => {
|
|
38438
|
+
if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
|
|
38344
38439
|
return false;
|
|
38345
38440
|
}
|
|
38346
|
-
if (
|
|
38441
|
+
if (input?.type === "groupInputs") {
|
|
38347
38442
|
return true;
|
|
38348
38443
|
}
|
|
38349
38444
|
const value = values[input.dataId];
|
|
@@ -38355,28 +38450,26 @@ const inputIsEmpty = function () {
|
|
|
38355
38450
|
}
|
|
38356
38451
|
return !value;
|
|
38357
38452
|
};
|
|
38358
|
-
const GetFormItem$1 =
|
|
38359
|
-
|
|
38360
|
-
|
|
38361
|
-
|
|
38362
|
-
|
|
38363
|
-
|
|
38364
|
-
|
|
38365
|
-
|
|
38366
|
-
|
|
38367
|
-
|
|
38368
|
-
|
|
38369
|
-
|
|
38370
|
-
|
|
38371
|
-
|
|
38372
|
-
|
|
38373
|
-
|
|
38374
|
-
|
|
38375
|
-
|
|
38376
|
-
|
|
38377
|
-
|
|
38378
|
-
namespace
|
|
38379
|
-
} = _ref73;
|
|
38453
|
+
const GetFormItem$1 = ({
|
|
38454
|
+
highlightMandatory,
|
|
38455
|
+
inputData,
|
|
38456
|
+
inputId,
|
|
38457
|
+
input,
|
|
38458
|
+
values,
|
|
38459
|
+
MainForm,
|
|
38460
|
+
options,
|
|
38461
|
+
plainForms,
|
|
38462
|
+
setValues,
|
|
38463
|
+
setAddress,
|
|
38464
|
+
i,
|
|
38465
|
+
inputKey,
|
|
38466
|
+
onValuesChange = () => {},
|
|
38467
|
+
setLoading = () => {},
|
|
38468
|
+
inputMeta = {},
|
|
38469
|
+
changeInputMeta = () => {},
|
|
38470
|
+
changeLinking = () => {},
|
|
38471
|
+
namespace
|
|
38472
|
+
}) => {
|
|
38380
38473
|
const {
|
|
38381
38474
|
t,
|
|
38382
38475
|
user,
|
|
@@ -38391,42 +38484,44 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38391
38484
|
staticWidth,
|
|
38392
38485
|
fullWidth
|
|
38393
38486
|
} = useEditContext();
|
|
38394
|
-
const lastReview = (
|
|
38487
|
+
const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
|
|
38395
38488
|
const [isShown, setIsShown] = React.useState(!!inputData.commentValue);
|
|
38396
38489
|
const inputLabel = getInputLabel$1(input, values);
|
|
38397
38490
|
const onClickReviewSuccess = () => {
|
|
38398
38491
|
if (!isReview) {
|
|
38399
38492
|
return;
|
|
38400
38493
|
}
|
|
38401
|
-
const reviewSuccess = lastReview
|
|
38494
|
+
const reviewSuccess = lastReview?.reviewSuccess;
|
|
38402
38495
|
changeInputMeta({
|
|
38403
38496
|
key: inputId,
|
|
38404
38497
|
type: input.type,
|
|
38405
|
-
value:
|
|
38498
|
+
value: {
|
|
38499
|
+
...inputMeta,
|
|
38406
38500
|
reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
|
|
38407
38501
|
reviewer: user,
|
|
38408
38502
|
createdAt: new Date().toISOString(),
|
|
38409
38503
|
reviewSuccess: true
|
|
38410
38504
|
}]
|
|
38411
|
-
}
|
|
38505
|
+
}
|
|
38412
38506
|
});
|
|
38413
38507
|
};
|
|
38414
38508
|
const onClickReviewError = () => {
|
|
38415
38509
|
if (!isReview) {
|
|
38416
38510
|
return;
|
|
38417
38511
|
}
|
|
38418
|
-
const reviewError = lastReview
|
|
38512
|
+
const reviewError = lastReview?.reviewError;
|
|
38419
38513
|
changeInputMeta({
|
|
38420
38514
|
key: inputId,
|
|
38421
38515
|
type: input.type,
|
|
38422
|
-
value:
|
|
38516
|
+
value: {
|
|
38517
|
+
...inputMeta,
|
|
38423
38518
|
reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
|
|
38424
38519
|
reviewer: user,
|
|
38425
38520
|
createdAt: new Date().toISOString(),
|
|
38426
38521
|
reviewError: true,
|
|
38427
38522
|
comment: ""
|
|
38428
38523
|
}]
|
|
38429
|
-
}
|
|
38524
|
+
}
|
|
38430
38525
|
});
|
|
38431
38526
|
};
|
|
38432
38527
|
switch (input.type) {
|
|
@@ -38440,12 +38535,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38440
38535
|
case "header":
|
|
38441
38536
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38442
38537
|
className: "daf-title with-subtitle",
|
|
38443
|
-
style: input
|
|
38538
|
+
style: input?.meta?.style,
|
|
38444
38539
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38445
38540
|
className: "flex",
|
|
38446
38541
|
children: [/*#__PURE__*/jsxRuntime.jsx("h1", {
|
|
38447
38542
|
children: ReactHtmlParser__default["default"](getLabel$1(input.label, values))
|
|
38448
|
-
}), !!input.description || input
|
|
38543
|
+
}), !!input.description || input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
|
|
38449
38544
|
content: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38450
38545
|
className: "tooltip-popover-cont",
|
|
38451
38546
|
children: ReactHtmlParser__default["default"](input.description)
|
|
@@ -38472,7 +38567,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38472
38567
|
const specialCharsRule = rules.find(r => r.type === "specialCharacters");
|
|
38473
38568
|
|
|
38474
38569
|
// eslint-disable-next-line no-case-declarations
|
|
38475
|
-
let maxRule =
|
|
38570
|
+
let maxRule = rules.find(rule => rule.max)?.max;
|
|
38476
38571
|
if (!maxRule && input.type === "textarea") {
|
|
38477
38572
|
maxRule = MAX_TEXT_AREA_LENGTH;
|
|
38478
38573
|
}
|
|
@@ -38485,30 +38580,27 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38485
38580
|
message: requiredRule.message || ""
|
|
38486
38581
|
});
|
|
38487
38582
|
}
|
|
38488
|
-
const isHighlighted = highlightMandatory &&
|
|
38583
|
+
const isHighlighted = highlightMandatory && input?.meta?.mandatory && inputIsEmpty(input, values, inputMeta);
|
|
38489
38584
|
if (requiredRule || specialCharsRule) {
|
|
38490
38585
|
if (input.type === "groupInputs") {
|
|
38491
38586
|
rules = rules.map(r => {
|
|
38492
38587
|
if (r.required) {
|
|
38493
|
-
return
|
|
38494
|
-
|
|
38495
|
-
|
|
38496
|
-
|
|
38497
|
-
|
|
38498
|
-
validator() {
|
|
38499
|
-
if (inputMeta.notAvailable || inputMeta.notApplicable) {
|
|
38500
|
-
return Promise.resolve();
|
|
38501
|
-
}
|
|
38502
|
-
const keys = Object.keys(input.inputs);
|
|
38503
|
-
for (let i = 0; i < keys.length; i++) {
|
|
38504
|
-
if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
|
|
38505
|
-
return Promise.reject(r.message);
|
|
38506
|
-
}
|
|
38507
|
-
}
|
|
38588
|
+
return ({
|
|
38589
|
+
getFieldValue
|
|
38590
|
+
}) => ({
|
|
38591
|
+
validator() {
|
|
38592
|
+
if (inputMeta.notAvailable || inputMeta.notApplicable) {
|
|
38508
38593
|
return Promise.resolve();
|
|
38509
38594
|
}
|
|
38510
|
-
|
|
38511
|
-
|
|
38595
|
+
const keys = Object.keys(input.inputs);
|
|
38596
|
+
for (let i = 0; i < keys.length; i++) {
|
|
38597
|
+
if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
|
|
38598
|
+
return Promise.reject(r.message);
|
|
38599
|
+
}
|
|
38600
|
+
}
|
|
38601
|
+
return Promise.resolve();
|
|
38602
|
+
}
|
|
38603
|
+
});
|
|
38512
38604
|
}
|
|
38513
38605
|
return r;
|
|
38514
38606
|
});
|
|
@@ -38546,13 +38638,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38546
38638
|
}
|
|
38547
38639
|
}
|
|
38548
38640
|
if (input && typeof input === "object") {
|
|
38549
|
-
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;
|
|
38550
38641
|
// check if input is valid
|
|
38551
38642
|
const hideComment = namespace === "project-readiness";
|
|
38552
38643
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
38553
38644
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38554
38645
|
className: "flex-row input-cont",
|
|
38555
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item,
|
|
38646
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38556
38647
|
extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
38557
38648
|
children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38558
38649
|
className: formatClassname(["ml-4 input-actions"]),
|
|
@@ -38562,7 +38653,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38562
38653
|
title: t("Add review note"),
|
|
38563
38654
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38564
38655
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38565
|
-
className: formatClassname(["review-btn review-error-btn",
|
|
38656
|
+
className: formatClassname(["review-btn review-error-btn", lastReview?.reviewError && "primary"]),
|
|
38566
38657
|
type: "link",
|
|
38567
38658
|
onClick: onClickReviewError,
|
|
38568
38659
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
@@ -38578,7 +38669,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38578
38669
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38579
38670
|
type: "link",
|
|
38580
38671
|
onClick: onClickReviewSuccess,
|
|
38581
|
-
className: formatClassname(["review-btn review-success-btn",
|
|
38672
|
+
className: formatClassname(["review-btn review-success-btn", lastReview?.reviewSuccess && "primary"]),
|
|
38582
38673
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
38583
38674
|
name: "CheckSquare",
|
|
38584
38675
|
width: 16,
|
|
@@ -38615,7 +38706,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38615
38706
|
}
|
|
38616
38707
|
});
|
|
38617
38708
|
},
|
|
38618
|
-
disabled: !
|
|
38709
|
+
disabled: !input.meta?.notApplicable,
|
|
38619
38710
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
38620
38711
|
name: "NotApplicable",
|
|
38621
38712
|
width: 16,
|
|
@@ -38629,7 +38720,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38629
38720
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38630
38721
|
className: formatClassname(["default p-0", inputMeta.notAvailable && "primary"]),
|
|
38631
38722
|
type: "link",
|
|
38632
|
-
disabled: !
|
|
38723
|
+
disabled: !input.meta?.notAvailable,
|
|
38633
38724
|
onClick: () => {
|
|
38634
38725
|
const value = getDefaultInputValue(input);
|
|
38635
38726
|
MainForm.setFields([{
|
|
@@ -38661,14 +38752,14 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38661
38752
|
}), !hideComment ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
38662
38753
|
title: t("Add comment"),
|
|
38663
38754
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38664
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button,
|
|
38755
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38665
38756
|
type: "link",
|
|
38666
|
-
disabled: !
|
|
38667
|
-
|
|
38668
|
-
|
|
38669
|
-
|
|
38670
|
-
|
|
38671
|
-
|
|
38757
|
+
disabled: !input.meta?.comment,
|
|
38758
|
+
...(!isShown ? {
|
|
38759
|
+
className: "default p-0"
|
|
38760
|
+
} : {
|
|
38761
|
+
className: "p-0 primary"
|
|
38762
|
+
}),
|
|
38672
38763
|
onClick: () => {
|
|
38673
38764
|
if (inputMeta.comment !== undefined && inputMeta.comment !== null) {
|
|
38674
38765
|
return;
|
|
@@ -38687,7 +38778,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38687
38778
|
width: 16,
|
|
38688
38779
|
height: 16
|
|
38689
38780
|
})
|
|
38690
|
-
})
|
|
38781
|
+
})
|
|
38691
38782
|
})
|
|
38692
38783
|
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
38693
38784
|
title: t("Project Readiness"),
|
|
@@ -38706,34 +38797,36 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38706
38797
|
}) : null]
|
|
38707
38798
|
}) : null
|
|
38708
38799
|
}),
|
|
38709
|
-
initialValue: inputMeta
|
|
38710
|
-
|
|
38711
|
-
|
|
38712
|
-
|
|
38713
|
-
|
|
38714
|
-
|
|
38715
|
-
|
|
38716
|
-
|
|
38717
|
-
|
|
38718
|
-
|
|
38719
|
-
|
|
38720
|
-
|
|
38721
|
-
|
|
38722
|
-
|
|
38723
|
-
if (f.response) {
|
|
38724
|
-
return f.response;
|
|
38800
|
+
initialValue: inputMeta?.defaultValue,
|
|
38801
|
+
...(inputOnBlur.includes(input.type) ? {
|
|
38802
|
+
trigger: "onBlur"
|
|
38803
|
+
} : {}),
|
|
38804
|
+
...(["total100", "group"].includes(input.type) ? {} : {
|
|
38805
|
+
name: inputId,
|
|
38806
|
+
fieldKey: inputId,
|
|
38807
|
+
initialValue: inputData.value
|
|
38808
|
+
}),
|
|
38809
|
+
...(["upload"].includes(input.type) ? {
|
|
38810
|
+
valuePropName: "fileList",
|
|
38811
|
+
getValueFromEvent: e => {
|
|
38812
|
+
if (Array.isArray(e)) {
|
|
38813
|
+
return e;
|
|
38725
38814
|
}
|
|
38726
|
-
return f
|
|
38727
|
-
|
|
38728
|
-
|
|
38729
|
-
|
|
38730
|
-
|
|
38815
|
+
return e && e.fileList && e.fileList.map(f => {
|
|
38816
|
+
if (f.response) {
|
|
38817
|
+
return f.response;
|
|
38818
|
+
}
|
|
38819
|
+
return f;
|
|
38820
|
+
});
|
|
38821
|
+
}
|
|
38822
|
+
} : {}),
|
|
38823
|
+
className: formatClassname([`i-${input.type} flex-1`, input.comment && "with-comment", maxRule && "with-max-rule"]),
|
|
38731
38824
|
"data-id": inputData.name,
|
|
38732
38825
|
rules: rules,
|
|
38733
38826
|
required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
|
|
38734
38827
|
labelCol: 12,
|
|
38735
38828
|
label: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38736
|
-
className: formatClassname(["flex",
|
|
38829
|
+
className: formatClassname(["flex", input?.meta?.code && "mr-10"]),
|
|
38737
38830
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38738
38831
|
className: "mr-1",
|
|
38739
38832
|
children: getInputLabel$1(input, values)
|
|
@@ -38746,7 +38839,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38746
38839
|
config: input,
|
|
38747
38840
|
t: t,
|
|
38748
38841
|
ajaxForms: ajaxForms,
|
|
38749
|
-
linkingData:
|
|
38842
|
+
linkingData: values?.linking || values?.parent?.linking,
|
|
38750
38843
|
changeAjaxForms: changeAjaxForms,
|
|
38751
38844
|
getApiBaseUrl: getApiBaseUrl,
|
|
38752
38845
|
getAppHeader: getAppHeader,
|
|
@@ -38754,11 +38847,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38754
38847
|
getToken: getToken,
|
|
38755
38848
|
app: app,
|
|
38756
38849
|
valueOnlyString: true
|
|
38757
|
-
}) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](
|
|
38850
|
+
}) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
|
|
38851
|
+
...inputData,
|
|
38758
38852
|
maxWidth,
|
|
38759
38853
|
staticWidth,
|
|
38760
38854
|
fullWidth
|
|
38761
|
-
}
|
|
38855
|
+
}, {
|
|
38762
38856
|
form: MainForm,
|
|
38763
38857
|
forms: options,
|
|
38764
38858
|
allForms: plainForms,
|
|
@@ -38779,10 +38873,10 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38779
38873
|
staticWidth,
|
|
38780
38874
|
fullWidth
|
|
38781
38875
|
}) : console.log(input)
|
|
38782
|
-
})
|
|
38876
|
+
}), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38783
38877
|
className: "code",
|
|
38784
38878
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
38785
|
-
children:
|
|
38879
|
+
children: input.meta?.code
|
|
38786
38880
|
})
|
|
38787
38881
|
}) : null]
|
|
38788
38882
|
}), maxRule ? ["imageUpload", "upload", "videoUpload"].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -38802,10 +38896,10 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38802
38896
|
className: "max-char-span",
|
|
38803
38897
|
children: t("max-char", {
|
|
38804
38898
|
chars: maxRule,
|
|
38805
|
-
filled:
|
|
38899
|
+
filled: inputData?.value?.length || 0
|
|
38806
38900
|
})
|
|
38807
38901
|
})
|
|
38808
|
-
}) : null,
|
|
38902
|
+
}) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38809
38903
|
className: "input-content",
|
|
38810
38904
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38811
38905
|
className: "comment-textarea",
|
|
@@ -38831,7 +38925,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38831
38925
|
},
|
|
38832
38926
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38833
38927
|
type: "link",
|
|
38834
|
-
disabled: !
|
|
38928
|
+
disabled: !input.meta?.comment,
|
|
38835
38929
|
className: "p-0",
|
|
38836
38930
|
children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
|
|
38837
38931
|
width: 16,
|
|
@@ -38840,11 +38934,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38840
38934
|
})
|
|
38841
38935
|
})]
|
|
38842
38936
|
}),
|
|
38843
|
-
children: inputTypeComponent$1.comment(
|
|
38937
|
+
children: inputTypeComponent$1.comment({
|
|
38938
|
+
...inputData,
|
|
38844
38939
|
maxWidth,
|
|
38845
38940
|
staticWidth,
|
|
38846
38941
|
fullWidth
|
|
38847
|
-
}
|
|
38942
|
+
}, {
|
|
38848
38943
|
form: MainForm,
|
|
38849
38944
|
forms: options,
|
|
38850
38945
|
setFormValues: setValues,
|
|
@@ -38869,16 +38964,16 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38869
38964
|
className: "max-char-span",
|
|
38870
38965
|
children: t("max-char", {
|
|
38871
38966
|
chars: MAX_COMMENTS_LENGTH,
|
|
38872
|
-
filled:
|
|
38967
|
+
filled: inputData?.commentValue?.length || 0
|
|
38873
38968
|
})
|
|
38874
38969
|
})]
|
|
38875
|
-
}) : null, lastReview
|
|
38970
|
+
}) : null, lastReview?.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38876
38971
|
className: "input-content",
|
|
38877
38972
|
children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
38878
38973
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38879
38974
|
className: "comment-textarea",
|
|
38880
|
-
initialValue:
|
|
38881
|
-
name:
|
|
38975
|
+
initialValue: lastReview?.comment || "",
|
|
38976
|
+
name: `${inputId}-reviewErrorComment`,
|
|
38882
38977
|
label: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38883
38978
|
className: "flex w-100",
|
|
38884
38979
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -38886,28 +38981,31 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38886
38981
|
children: t("Review note")
|
|
38887
38982
|
})
|
|
38888
38983
|
}),
|
|
38889
|
-
children: inputTypeComponent$1.comment(
|
|
38984
|
+
children: inputTypeComponent$1.comment({
|
|
38985
|
+
...inputData,
|
|
38890
38986
|
maxWidth,
|
|
38891
38987
|
staticWidth,
|
|
38892
38988
|
fullWidth
|
|
38893
|
-
}
|
|
38989
|
+
}, {
|
|
38894
38990
|
form: MainForm,
|
|
38895
38991
|
forms: options,
|
|
38896
|
-
value:
|
|
38992
|
+
value: lastReview?.comment || "",
|
|
38897
38993
|
onChange: val => {
|
|
38898
38994
|
changeInputMeta({
|
|
38899
38995
|
key: inputId,
|
|
38900
38996
|
type: input.type,
|
|
38901
|
-
value:
|
|
38902
|
-
|
|
38997
|
+
value: {
|
|
38998
|
+
...inputMeta,
|
|
38999
|
+
reviews: (inputMeta?.reviews || []).map(v => {
|
|
38903
39000
|
if (v.createdAt === lastReview.createdAt) {
|
|
38904
|
-
return
|
|
39001
|
+
return {
|
|
39002
|
+
...v,
|
|
38905
39003
|
comment: val
|
|
38906
|
-
}
|
|
39004
|
+
};
|
|
38907
39005
|
}
|
|
38908
39006
|
return v;
|
|
38909
39007
|
})
|
|
38910
|
-
}
|
|
39008
|
+
}
|
|
38911
39009
|
});
|
|
38912
39010
|
},
|
|
38913
39011
|
t,
|
|
@@ -38921,7 +39019,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38921
39019
|
className: "max-char-span",
|
|
38922
39020
|
children: t("max-char", {
|
|
38923
39021
|
chars: MAX_COMMENTS_LENGTH,
|
|
38924
|
-
filled:
|
|
39022
|
+
filled: lastReview.comment?.length || 0
|
|
38925
39023
|
})
|
|
38926
39024
|
})]
|
|
38927
39025
|
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -38942,7 +39040,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38942
39040
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38943
39041
|
className: "flex flex-column justify-center mr-1",
|
|
38944
39042
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
38945
|
-
children:
|
|
39043
|
+
children: lastReview?.reviewer?.firstName + " " + lastReview?.reviewer?.lastName + " - " + moment__default["default"](lastReview.createdAt).format("DD MMM YYYY")
|
|
38946
39044
|
})
|
|
38947
39045
|
})]
|
|
38948
39046
|
})]
|
|
@@ -38953,14 +39051,13 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38953
39051
|
return null;
|
|
38954
39052
|
}
|
|
38955
39053
|
};
|
|
38956
|
-
const editErrorHandler =
|
|
38957
|
-
|
|
38958
|
-
|
|
38959
|
-
|
|
38960
|
-
} = _ref76;
|
|
39054
|
+
const editErrorHandler = ({
|
|
39055
|
+
errorFields,
|
|
39056
|
+
t = s => s
|
|
39057
|
+
}) => {
|
|
38961
39058
|
if (Array.isArray(errorFields) && errorFields.length) {
|
|
38962
39059
|
const name = errorFields[0].name.join(".");
|
|
38963
|
-
const element = document.querySelector(
|
|
39060
|
+
const element = document.querySelector(`[data-id="${name}"]`);
|
|
38964
39061
|
if (element) {
|
|
38965
39062
|
element.scrollIntoView();
|
|
38966
39063
|
antd.message.error(t("errors::please-correct-invalid-inputs"));
|