datastake-daf 0.6.816 → 0.6.818
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 +1236 -1281
- package/dist/pages/index.js +1326 -426
- package/dist/services/index.js +202 -0
- package/dist/utils/index.js +28 -0
- package/package.json +1 -1
- package/public/Vegetation/damage-from-insects-default.svg +1 -0
- package/public/Vegetation/dry-or-dead-default.svg +1 -0
- package/public/Vegetation/healthy-default.svg +1 -0
- package/public/Vegetation/yellowing.svg +1 -0
- package/src/@daf/core/components/Charts/RadarChart/index.jsx +51 -9
- package/src/@daf/core/components/Charts/style.js +0 -1
- package/src/@daf/core/components/Dashboard/Map/ChainIcon/index.js +123 -104
- package/src/@daf/core/components/Table/index.jsx +11 -6
- package/src/@daf/pages/Events/Activities/columns.js +15 -11
- package/src/@daf/pages/Events/Incidents/columns.js +15 -11
- package/src/@daf/pages/Events/Testimonials/columns.js +173 -0
- package/src/@daf/pages/Events/Testimonials/config.js +175 -0
- package/src/@daf/pages/Events/columns.js +7 -3
- package/src/@daf/pages/Locations/ConflictAreas/columns.js +140 -0
- package/src/@daf/pages/Locations/ConflictAreas/config.js +41 -0
- package/src/@daf/pages/Locations/MineSite/columns.js +21 -12
- package/src/@daf/pages/Locations/MineSite/config.js +2 -1
- package/src/@daf/pages/Locations/columns.js +7 -3
- package/src/@daf/pages/Stakeholders/ArmedGroups/columns.js +110 -0
- package/src/@daf/pages/Stakeholders/ArmedGroups/config.js +41 -0
- package/src/@daf/pages/Stakeholders/Operators/columns.js +30 -14
- package/src/@daf/pages/Stakeholders/Workers/columns.js +23 -13
- package/src/@daf/pages/Stakeholders/columns.js +8 -4
- package/src/@daf/pages/Summary/Activities/MonitoringCampaign/components/BiodiversityHabitat/index.jsx +4 -2
- package/src/@daf/pages/TablePage/config.js +1 -1
- package/src/@daf/pages/TablePage/helper.js +45 -0
- package/src/@daf/services/EventsService.js +115 -0
- package/src/@daf/services/LinkedSubjects.js +1 -0
- package/src/@daf/services/WorkersService.js +80 -0
- package/src/helpers/errorHandling.js +142 -74
- package/src/services.js +3 -1
- package/src/utils.js +1 -1
package/dist/components/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var L$1 = require('leaflet');
|
|
|
16
16
|
var reactCollapsed = require('react-collapsed');
|
|
17
17
|
var countryCityLocation = require('country-city-location');
|
|
18
18
|
var client = require('react-dom/client');
|
|
19
|
+
var reactDom = require('react-dom');
|
|
19
20
|
require('@elfalem/leaflet-curve');
|
|
20
21
|
var dot = require('dot-object');
|
|
21
22
|
var ReactHtmlParser = require('react-html-parser');
|
|
@@ -4816,7 +4817,7 @@ const config$2 = {
|
|
|
4816
4817
|
AddDocument: config$3
|
|
4817
4818
|
};
|
|
4818
4819
|
|
|
4819
|
-
const _excluded$
|
|
4820
|
+
const _excluded$H = ["width", "height", "size", "name", "fill"];
|
|
4820
4821
|
const CustomIcon = _ref => {
|
|
4821
4822
|
let {
|
|
4822
4823
|
width = 14,
|
|
@@ -4825,7 +4826,7 @@ const CustomIcon = _ref => {
|
|
|
4825
4826
|
name = "",
|
|
4826
4827
|
fill = "none"
|
|
4827
4828
|
} = _ref,
|
|
4828
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
4829
|
+
props = _objectWithoutProperties(_ref, _excluded$H);
|
|
4829
4830
|
const conf = config$2[name];
|
|
4830
4831
|
if (conf) {
|
|
4831
4832
|
return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -5114,7 +5115,7 @@ createCommonjsModule(function (module, exports) {
|
|
|
5114
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])+"]"}}}));
|
|
5115
5116
|
});
|
|
5116
5117
|
|
|
5117
|
-
const _excluded$
|
|
5118
|
+
const _excluded$G = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
|
|
5118
5119
|
dayjs__default["default"].extend(customParseFormat);
|
|
5119
5120
|
dayjs__default["default"].extend(utc);
|
|
5120
5121
|
dayjs__default["default"].extend(utc);
|
|
@@ -5490,7 +5491,7 @@ const filterCreateData = data => {
|
|
|
5490
5491
|
createdAt,
|
|
5491
5492
|
updatedAt
|
|
5492
5493
|
} = data,
|
|
5493
|
-
rest = _objectWithoutProperties(data, _excluded$
|
|
5494
|
+
rest = _objectWithoutProperties(data, _excluded$G);
|
|
5494
5495
|
const _meta = isObjectEmpty(meta) ? undefined : meta;
|
|
5495
5496
|
return _objectSpread2(_objectSpread2({}, rest), {}, {
|
|
5496
5497
|
meta: _meta
|
|
@@ -6022,7 +6023,7 @@ SelectFilters.propTypes = {
|
|
|
6022
6023
|
apiUrl: PropTypes__default["default"].string
|
|
6023
6024
|
};
|
|
6024
6025
|
|
|
6025
|
-
const _excluded$
|
|
6026
|
+
const _excluded$F = ["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"];
|
|
6026
6027
|
function DAFTable(_ref) {
|
|
6027
6028
|
let {
|
|
6028
6029
|
columns = [],
|
|
@@ -6053,8 +6054,13 @@ function DAFTable(_ref) {
|
|
|
6053
6054
|
app,
|
|
6054
6055
|
doEmptyRows
|
|
6055
6056
|
} = _ref,
|
|
6056
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
6057
|
-
const
|
|
6057
|
+
rest = _objectWithoutProperties(_ref, _excluded$F);
|
|
6058
|
+
const source = React.useMemo(() => {
|
|
6059
|
+
if (data && Array.isArray(data)) {
|
|
6060
|
+
return data;
|
|
6061
|
+
}
|
|
6062
|
+
return [];
|
|
6063
|
+
}, [data]);
|
|
6058
6064
|
const projectData = (projects || []).find(p => p.id === selectedProject);
|
|
6059
6065
|
const [filtersInit, setFiltersInit] = React.useState(!loading);
|
|
6060
6066
|
React.useEffect(() => {
|
|
@@ -6098,11 +6104,13 @@ function DAFTable(_ref) {
|
|
|
6098
6104
|
}
|
|
6099
6105
|
}) : filtersConfig;
|
|
6100
6106
|
}, [sourcesKey, sources, filtersConfig, t]);
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
}
|
|
6107
|
+
|
|
6108
|
+
// useEffect(() => {
|
|
6109
|
+
// if (data && Array.isArray(data)) {
|
|
6110
|
+
// setSource(data);
|
|
6111
|
+
// }
|
|
6112
|
+
// }, [data, data.length]);
|
|
6113
|
+
|
|
6106
6114
|
const paginationPageSize = pagination === null || pagination === void 0 ? void 0 : pagination.pageSize;
|
|
6107
6115
|
const dataSource = React.useMemo(() => {
|
|
6108
6116
|
const pageSize = paginationPageSize ? paginationPageSize : source.length > 10 ? source.length : 10;
|
|
@@ -6871,7 +6879,7 @@ function ComponentWithFocus(_ref) {
|
|
|
6871
6879
|
}
|
|
6872
6880
|
|
|
6873
6881
|
var _templateObject$h;
|
|
6874
|
-
const _excluded$
|
|
6882
|
+
const _excluded$E = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
|
|
6875
6883
|
function StickyTable(_ref) {
|
|
6876
6884
|
let {
|
|
6877
6885
|
size = "small",
|
|
@@ -6882,7 +6890,7 @@ function StickyTable(_ref) {
|
|
|
6882
6890
|
pagination = false,
|
|
6883
6891
|
doEmptyRows = true
|
|
6884
6892
|
} = _ref,
|
|
6885
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
6893
|
+
props = _objectWithoutProperties(_ref, _excluded$E);
|
|
6886
6894
|
const data = React__default["default"].useMemo(() => {
|
|
6887
6895
|
if (!doEmptyRows) {
|
|
6888
6896
|
return dataSource;
|
|
@@ -7410,7 +7418,7 @@ const BTN_SIZE = {
|
|
|
7410
7418
|
LG: 'large'
|
|
7411
7419
|
};
|
|
7412
7420
|
|
|
7413
|
-
const _excluded$
|
|
7421
|
+
const _excluded$D = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
|
|
7414
7422
|
function DafButton(_ref) {
|
|
7415
7423
|
let {
|
|
7416
7424
|
content = '',
|
|
@@ -7424,7 +7432,7 @@ function DafButton(_ref) {
|
|
|
7424
7432
|
style = {},
|
|
7425
7433
|
className = ''
|
|
7426
7434
|
} = _ref,
|
|
7427
|
-
restProps = _objectWithoutProperties(_ref, _excluded$
|
|
7435
|
+
restProps = _objectWithoutProperties(_ref, _excluded$D);
|
|
7428
7436
|
return /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
|
|
7429
7437
|
icon: icon,
|
|
7430
7438
|
type: type,
|
|
@@ -7543,12 +7551,12 @@ const Style$R = styled__default["default"].div`
|
|
|
7543
7551
|
}
|
|
7544
7552
|
`;
|
|
7545
7553
|
|
|
7546
|
-
const _excluded$
|
|
7554
|
+
const _excluded$C = ["children"];
|
|
7547
7555
|
const BorderedButton = _ref => {
|
|
7548
7556
|
let {
|
|
7549
7557
|
children
|
|
7550
7558
|
} = _ref,
|
|
7551
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
7559
|
+
props = _objectWithoutProperties(_ref, _excluded$C);
|
|
7552
7560
|
return /*#__PURE__*/jsxRuntime.jsx(Style$R, {
|
|
7553
7561
|
className: "d-btn-cont",
|
|
7554
7562
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -7688,12 +7696,12 @@ Badge.propTypes = {
|
|
|
7688
7696
|
props: PropTypes__default["default"].object
|
|
7689
7697
|
};
|
|
7690
7698
|
|
|
7691
|
-
const _excluded$
|
|
7699
|
+
const _excluded$B = ["icon"];
|
|
7692
7700
|
function GetIcon(_ref) {
|
|
7693
7701
|
let {
|
|
7694
7702
|
icon
|
|
7695
7703
|
} = _ref,
|
|
7696
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
7704
|
+
props = _objectWithoutProperties(_ref, _excluded$B);
|
|
7697
7705
|
let Icon = Icons__namespace.CloseOutlined;
|
|
7698
7706
|
if (Icons__namespace[icon]) {
|
|
7699
7707
|
Icon = Icons__namespace[icon];
|
|
@@ -8023,7 +8031,7 @@ const MultiSelectStyled = styled__default["default"](antd.Select)`
|
|
|
8023
8031
|
}
|
|
8024
8032
|
`;
|
|
8025
8033
|
|
|
8026
|
-
const _excluded$
|
|
8034
|
+
const _excluded$A = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
|
|
8027
8035
|
const {
|
|
8028
8036
|
useToken: useToken$n
|
|
8029
8037
|
} = antd.theme;
|
|
@@ -8116,7 +8124,7 @@ function Multiselect(_ref) {
|
|
|
8116
8124
|
isSingle = false,
|
|
8117
8125
|
selectionType = SELECTION_TYPES.DEFAULT
|
|
8118
8126
|
} = _ref,
|
|
8119
|
-
restProps = _objectWithoutProperties(_ref, _excluded$
|
|
8127
|
+
restProps = _objectWithoutProperties(_ref, _excluded$A);
|
|
8120
8128
|
const {
|
|
8121
8129
|
token
|
|
8122
8130
|
} = useToken$n();
|
|
@@ -8836,7 +8844,7 @@ DAFHeader.propTypes = {
|
|
|
8836
8844
|
filtersConfig: PropTypes__default["default"].any
|
|
8837
8845
|
};
|
|
8838
8846
|
|
|
8839
|
-
const _excluded$
|
|
8847
|
+
const _excluded$z = ["tabs", "onChange", "value", "className"];
|
|
8840
8848
|
function TabsHeader(_ref) {
|
|
8841
8849
|
let {
|
|
8842
8850
|
tabs = [],
|
|
@@ -8844,7 +8852,7 @@ function TabsHeader(_ref) {
|
|
|
8844
8852
|
value = '',
|
|
8845
8853
|
className = 'mt-2'
|
|
8846
8854
|
} = _ref,
|
|
8847
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
8855
|
+
rest = _objectWithoutProperties(_ref, _excluded$z);
|
|
8848
8856
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8849
8857
|
className: formatClassname(['daf-tabs-header pl-6 pr-6', className]),
|
|
8850
8858
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Tabs, _objectSpread2({
|
|
@@ -8941,7 +8949,7 @@ DrawerHeader.propTypes = {
|
|
|
8941
8949
|
tabsConfig: PropTypes__default["default"].any
|
|
8942
8950
|
};
|
|
8943
8951
|
|
|
8944
|
-
const _excluded$
|
|
8952
|
+
const _excluded$y = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
|
|
8945
8953
|
const useFooter = _ref => {
|
|
8946
8954
|
let {
|
|
8947
8955
|
leftContent,
|
|
@@ -8976,7 +8984,7 @@ const useFooter = _ref => {
|
|
|
8976
8984
|
style = {},
|
|
8977
8985
|
className = ""
|
|
8978
8986
|
} = button,
|
|
8979
|
-
restProps = _objectWithoutProperties(button, _excluded$
|
|
8987
|
+
restProps = _objectWithoutProperties(button, _excluded$y);
|
|
8980
8988
|
return /*#__PURE__*/jsxRuntime.jsx(DafButton, _objectSpread2({
|
|
8981
8989
|
content: label,
|
|
8982
8990
|
type: type,
|
|
@@ -11857,7 +11865,7 @@ Widget.propTypes = {
|
|
|
11857
11865
|
};
|
|
11858
11866
|
Widget.displayName = 'Widget';
|
|
11859
11867
|
|
|
11860
|
-
const _excluded$
|
|
11868
|
+
const _excluded$x = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
|
|
11861
11869
|
function ImageWidget(_ref) {
|
|
11862
11870
|
let {
|
|
11863
11871
|
loading = false,
|
|
@@ -11868,7 +11876,7 @@ function ImageWidget(_ref) {
|
|
|
11868
11876
|
noDescriptionText,
|
|
11869
11877
|
isPdf = false
|
|
11870
11878
|
} = _ref,
|
|
11871
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
11879
|
+
props = _objectWithoutProperties(_ref, _excluded$x);
|
|
11872
11880
|
const expandable = isPdf ? false : props.expandable;
|
|
11873
11881
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
11874
11882
|
loading: loading,
|
|
@@ -11928,7 +11936,7 @@ function ImageWidget(_ref) {
|
|
|
11928
11936
|
ImageWidget.displayName = 'ImageWidget';
|
|
11929
11937
|
|
|
11930
11938
|
var _templateObject$e;
|
|
11931
|
-
const _excluded$
|
|
11939
|
+
const _excluded$w = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
|
|
11932
11940
|
function FlowWidget(_ref) {
|
|
11933
11941
|
let {
|
|
11934
11942
|
title,
|
|
@@ -11940,7 +11948,7 @@ function FlowWidget(_ref) {
|
|
|
11940
11948
|
className,
|
|
11941
11949
|
direction = "horizontal"
|
|
11942
11950
|
} = _ref,
|
|
11943
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11951
|
+
rest = _objectWithoutProperties(_ref, _excluded$w);
|
|
11944
11952
|
const [activeTab, setActiveTab] = React.useState();
|
|
11945
11953
|
React.useEffect(() => {
|
|
11946
11954
|
if (defaultActiveTab) {
|
|
@@ -13924,8 +13932,8 @@ function LocationIcon({
|
|
|
13924
13932
|
activeMarker,
|
|
13925
13933
|
setActiveMarker
|
|
13926
13934
|
}) {
|
|
13927
|
-
const rootsMapRef = React.useRef(new Map());
|
|
13928
13935
|
const markersRef = React.useRef([]);
|
|
13936
|
+
const [portalContainers, setPortalContainers] = React.useState([]);
|
|
13929
13937
|
const isSelected = selectedMarkersId.includes(data.datastakeId);
|
|
13930
13938
|
const Marker = React.useMemo(() => {
|
|
13931
13939
|
if (isMineSite(data.type)) {
|
|
@@ -13933,7 +13941,7 @@ function LocationIcon({
|
|
|
13933
13941
|
}
|
|
13934
13942
|
return VillageMarker;
|
|
13935
13943
|
}, [data.type]);
|
|
13936
|
-
|
|
13944
|
+
React.useState(false);
|
|
13937
13945
|
const linkedNodesData = React.useMemo(() => {
|
|
13938
13946
|
const nodes = [];
|
|
13939
13947
|
const links = data.links || [];
|
|
@@ -13998,31 +14006,32 @@ function LocationIcon({
|
|
|
13998
14006
|
return nodes;
|
|
13999
14007
|
}, [JSON.stringify(allData), JSON.stringify(data.links), JSON.stringify(data.stakeholders), zoom]);
|
|
14000
14008
|
const stakeholdersOfLocation = React.useMemo(() => {
|
|
14001
|
-
return data?.stakeholders || []
|
|
14002
|
-
|
|
14009
|
+
return (data?.stakeholders || []).filter(stakeholder => {
|
|
14010
|
+
if (!stakeholder.links || stakeholder.links.length === 0) {
|
|
14011
|
+
return true;
|
|
14012
|
+
}
|
|
14013
|
+
const locationsWithThisStakeholder = allData.filter(loc => loc.stakeholders?.some(s => s.datastakeId === stakeholder.datastakeId)).map(loc => loc.datastakeId);
|
|
14014
|
+
const primaryLocation = locationsWithThisStakeholder.sort()[0];
|
|
14015
|
+
return data.datastakeId === primaryLocation;
|
|
14016
|
+
});
|
|
14017
|
+
}, [data.stakeholders, data.datastakeId, allData, zoom]);
|
|
14003
14018
|
React.useEffect(() => {
|
|
14004
|
-
|
|
14005
|
-
|
|
14006
|
-
currentMarkers.forEach(marker => {
|
|
14007
|
-
if (mapRef.hasLayer(marker)) {
|
|
14019
|
+
markersRef.current.forEach(marker => {
|
|
14020
|
+
if (mapRef && mapRef.hasLayer(marker)) {
|
|
14008
14021
|
mapRef.removeLayer(marker);
|
|
14009
14022
|
}
|
|
14010
14023
|
});
|
|
14011
|
-
currentRoots.forEach(root => {
|
|
14012
|
-
root.unmount();
|
|
14013
|
-
});
|
|
14014
|
-
currentRoots.clear();
|
|
14015
14024
|
markersRef.current = [];
|
|
14016
|
-
|
|
14017
|
-
// Only create stakeholder markers if this location or any of its stakeholders are selected
|
|
14025
|
+
setPortalContainers([]);
|
|
14018
14026
|
const shouldShowStakeholders = isSelected || stakeholdersOfLocation.some(stk => selectedMarkersId.includes(stk.datastakeId));
|
|
14019
14027
|
if (!shouldShowStakeholders || selectedMarkersId.length === 0) {
|
|
14020
14028
|
return;
|
|
14021
14029
|
}
|
|
14022
14030
|
|
|
14023
|
-
// Create
|
|
14031
|
+
// Create markers and store their container references
|
|
14032
|
+
const containers = [];
|
|
14024
14033
|
stakeholdersOfLocation.forEach((stakeholder, index) => {
|
|
14025
|
-
const markerId = `${stakeholder.datastakeId}`;
|
|
14034
|
+
const markerId = `${data.datastakeId}-${stakeholder.datastakeId}`;
|
|
14026
14035
|
const {
|
|
14027
14036
|
x,
|
|
14028
14037
|
y,
|
|
@@ -14045,41 +14054,29 @@ function LocationIcon({
|
|
|
14045
14054
|
const pathLocLatLng = mapRef.layerPointToLatLng(pathLocPoint);
|
|
14046
14055
|
const isForceOpen = activeMarker?.datastakeId === data.datastakeId;
|
|
14047
14056
|
const iconSize = isSmallMarker(zoom) || isExtraSmallMarker(zoom) ? [11, 11] : [25, 25];
|
|
14057
|
+
|
|
14058
|
+
// Create container div
|
|
14059
|
+
const containerDiv = document.createElement('div');
|
|
14060
|
+
containerDiv.id = markerId;
|
|
14048
14061
|
const marker = L__namespace.marker(stakeholderLatLng, {
|
|
14049
14062
|
icon: L__namespace.divIcon({
|
|
14050
|
-
html:
|
|
14063
|
+
html: containerDiv.outerHTML,
|
|
14051
14064
|
className: "marker-chain",
|
|
14052
14065
|
iconSize: iconSize
|
|
14053
14066
|
})
|
|
14054
14067
|
}).addTo(mapRef);
|
|
14055
14068
|
markersRef.current.push(marker);
|
|
14056
|
-
|
|
14057
|
-
|
|
14058
|
-
|
|
14059
|
-
|
|
14060
|
-
|
|
14061
|
-
|
|
14062
|
-
|
|
14063
|
-
|
|
14064
|
-
|
|
14065
|
-
|
|
14066
|
-
|
|
14067
|
-
renderTooltip: renderTooltip,
|
|
14068
|
-
onClickLink: onClickLink,
|
|
14069
|
-
selectedMarkersId: selectedMarkersId,
|
|
14070
|
-
handleSelectMarker: handleSelectMarker,
|
|
14071
|
-
mapRef: mapRef,
|
|
14072
|
-
radius: radius,
|
|
14073
|
-
index: index,
|
|
14074
|
-
x: x,
|
|
14075
|
-
y: y,
|
|
14076
|
-
openPopupIdRef: openPopupIdRef,
|
|
14077
|
-
polylinesRef: polylinesRef,
|
|
14078
|
-
isForceOpen: isForceOpen,
|
|
14079
|
-
activeMarker: activeMarker
|
|
14080
|
-
}));
|
|
14081
|
-
}
|
|
14082
|
-
}, 0);
|
|
14069
|
+
|
|
14070
|
+
// Store container info for portal rendering
|
|
14071
|
+
containers.push({
|
|
14072
|
+
markerId,
|
|
14073
|
+
stakeholder,
|
|
14074
|
+
x,
|
|
14075
|
+
y,
|
|
14076
|
+
radius,
|
|
14077
|
+
index,
|
|
14078
|
+
isForceOpen
|
|
14079
|
+
});
|
|
14083
14080
|
setMapMarkers(prev => {
|
|
14084
14081
|
const array = [...prev, {
|
|
14085
14082
|
id: marker._leaflet_id,
|
|
@@ -14111,17 +14108,19 @@ function LocationIcon({
|
|
|
14111
14108
|
animated: true
|
|
14112
14109
|
});
|
|
14113
14110
|
});
|
|
14111
|
+
|
|
14112
|
+
// Update portal containers after markers are created
|
|
14113
|
+
setTimeout(() => {
|
|
14114
|
+
setPortalContainers(containers);
|
|
14115
|
+
}, 0);
|
|
14114
14116
|
return () => {
|
|
14115
14117
|
markersRef.current.forEach(marker => {
|
|
14116
|
-
if (mapRef.hasLayer(marker)) {
|
|
14118
|
+
if (mapRef && mapRef.hasLayer(marker)) {
|
|
14117
14119
|
mapRef.removeLayer(marker);
|
|
14118
14120
|
}
|
|
14119
14121
|
});
|
|
14120
|
-
rootsMapRef.current.forEach(root => {
|
|
14121
|
-
root.unmount();
|
|
14122
|
-
});
|
|
14123
|
-
rootsMapRef.current.clear();
|
|
14124
14122
|
markersRef.current = [];
|
|
14123
|
+
setPortalContainers([]);
|
|
14125
14124
|
};
|
|
14126
14125
|
}, [stakeholdersOfLocation, selectedMarkersId, activeMarker, zoom]);
|
|
14127
14126
|
|
|
@@ -14205,57 +14204,81 @@ function LocationIcon({
|
|
|
14205
14204
|
});
|
|
14206
14205
|
});
|
|
14207
14206
|
}, [linkedNodesData, selectedMarkersId, zoom, stakeholdersOfLocation, isSelected]);
|
|
14208
|
-
return /*#__PURE__*/jsxRuntime.
|
|
14209
|
-
|
|
14210
|
-
|
|
14211
|
-
|
|
14212
|
-
|
|
14213
|
-
|
|
14214
|
-
|
|
14215
|
-
|
|
14216
|
-
|
|
14217
|
-
|
|
14218
|
-
|
|
14219
|
-
|
|
14220
|
-
|
|
14221
|
-
|
|
14222
|
-
|
|
14223
|
-
,
|
|
14224
|
-
getPopupContainer: triggerNode => {
|
|
14225
|
-
const mapElement = document.getElementById("map");
|
|
14226
|
-
return mapElement || triggerNode.parentElement || document.body;
|
|
14227
|
-
},
|
|
14228
|
-
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
14229
|
-
style: {
|
|
14230
|
-
position: "relative",
|
|
14231
|
-
display: "inline-block"
|
|
14207
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
14208
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
|
|
14209
|
+
content: renderTooltipJsx({
|
|
14210
|
+
title: data.name,
|
|
14211
|
+
subTitle: data.subTitle,
|
|
14212
|
+
total: data.sources,
|
|
14213
|
+
className: "pt-0 pb-0",
|
|
14214
|
+
items: renderTooltip(data),
|
|
14215
|
+
link,
|
|
14216
|
+
onClickLink: () => onClickLink(data),
|
|
14217
|
+
isNewTab: true
|
|
14218
|
+
}),
|
|
14219
|
+
getPopupContainer: triggerNode => {
|
|
14220
|
+
const mapElement = document.getElementById("map");
|
|
14221
|
+
return mapElement || triggerNode.parentElement || document.body;
|
|
14232
14222
|
},
|
|
14233
|
-
children:
|
|
14223
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
14234
14224
|
style: {
|
|
14235
|
-
position: "
|
|
14236
|
-
|
|
14237
|
-
left: "50%",
|
|
14238
|
-
transform: "translateX(-50%)",
|
|
14239
|
-
width: "12px",
|
|
14240
|
-
height: "6px",
|
|
14241
|
-
background: "rgba(0,0,0,0.15)",
|
|
14242
|
-
borderRadius: "50%",
|
|
14243
|
-
filter: "blur(3px)"
|
|
14244
|
-
}
|
|
14245
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Marker, {
|
|
14246
|
-
isSelected: isSelected,
|
|
14247
|
-
onClick: () => {
|
|
14248
|
-
handleSelectMarker(data);
|
|
14249
|
-
setActiveMarker(isSelected ? null : data);
|
|
14225
|
+
position: "relative",
|
|
14226
|
+
display: "inline-block"
|
|
14250
14227
|
},
|
|
14228
|
+
children: [(isSelected || selectedMarkersId.length === 0) && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
14229
|
+
style: {
|
|
14230
|
+
position: "absolute",
|
|
14231
|
+
bottom: "0",
|
|
14232
|
+
left: "50%",
|
|
14233
|
+
transform: "translateX(-50%)",
|
|
14234
|
+
width: "12px",
|
|
14235
|
+
height: "6px",
|
|
14236
|
+
background: "rgba(0,0,0,0.15)",
|
|
14237
|
+
borderRadius: "50%",
|
|
14238
|
+
filter: "blur(3px)"
|
|
14239
|
+
}
|
|
14240
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Marker, {
|
|
14241
|
+
isSelected: isSelected,
|
|
14242
|
+
onClick: () => {
|
|
14243
|
+
handleSelectMarker(data);
|
|
14244
|
+
setActiveMarker(isSelected ? null : data);
|
|
14245
|
+
},
|
|
14246
|
+
zoom: zoom,
|
|
14247
|
+
selectedMarkersId: selectedMarkersId
|
|
14248
|
+
})]
|
|
14249
|
+
})
|
|
14250
|
+
}), portalContainers.map(({
|
|
14251
|
+
markerId,
|
|
14252
|
+
stakeholder,
|
|
14253
|
+
x,
|
|
14254
|
+
y,
|
|
14255
|
+
radius,
|
|
14256
|
+
index,
|
|
14257
|
+
isForceOpen
|
|
14258
|
+
}) => {
|
|
14259
|
+
const container = document.getElementById(markerId);
|
|
14260
|
+
if (!container) return null;
|
|
14261
|
+
return /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/jsxRuntime.jsx(StakeholderIcon$1, {
|
|
14262
|
+
data: stakeholder,
|
|
14251
14263
|
zoom: zoom,
|
|
14252
|
-
|
|
14253
|
-
|
|
14254
|
-
|
|
14255
|
-
|
|
14256
|
-
|
|
14257
|
-
|
|
14258
|
-
|
|
14264
|
+
allData: allData,
|
|
14265
|
+
link: link,
|
|
14266
|
+
parentId: data.datastakeId,
|
|
14267
|
+
renderTooltip: renderTooltip,
|
|
14268
|
+
onClickLink: onClickLink,
|
|
14269
|
+
selectedMarkersId: selectedMarkersId,
|
|
14270
|
+
handleSelectMarker: handleSelectMarker,
|
|
14271
|
+
mapRef: mapRef,
|
|
14272
|
+
radius: radius,
|
|
14273
|
+
index: index,
|
|
14274
|
+
x: x,
|
|
14275
|
+
y: y,
|
|
14276
|
+
openPopupIdRef: openPopupIdRef,
|
|
14277
|
+
polylinesRef: polylinesRef,
|
|
14278
|
+
isForceOpen: isForceOpen,
|
|
14279
|
+
activeMarker: activeMarker
|
|
14280
|
+
}, markerId), container);
|
|
14281
|
+
})]
|
|
14259
14282
|
});
|
|
14260
14283
|
}
|
|
14261
14284
|
|
|
@@ -15656,7 +15679,7 @@ Map$3.propTypes = {
|
|
|
15656
15679
|
link: PropTypes__default["default"].any
|
|
15657
15680
|
};
|
|
15658
15681
|
|
|
15659
|
-
const _excluded$
|
|
15682
|
+
const _excluded$v = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
|
|
15660
15683
|
function InExpandableWidgetMap(_ref) {
|
|
15661
15684
|
let {
|
|
15662
15685
|
isExpanded,
|
|
@@ -15670,7 +15693,7 @@ function InExpandableWidgetMap(_ref) {
|
|
|
15670
15693
|
height,
|
|
15671
15694
|
widgetConfig
|
|
15672
15695
|
} = _ref,
|
|
15673
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
15696
|
+
rest = _objectWithoutProperties(_ref, _excluded$v);
|
|
15674
15697
|
const [mapKey, setMapKey] = React.useState(0);
|
|
15675
15698
|
const [isMapReady, setIsMapReady] = React.useState(false);
|
|
15676
15699
|
React.useEffect(() => {
|
|
@@ -17870,14 +17893,14 @@ const MapConfig = ({
|
|
|
17870
17893
|
});
|
|
17871
17894
|
};
|
|
17872
17895
|
|
|
17873
|
-
const _excluded$
|
|
17896
|
+
const _excluded$u = ["config", "title", "loading"];
|
|
17874
17897
|
const Details = _ref => {
|
|
17875
17898
|
let {
|
|
17876
17899
|
config = [],
|
|
17877
17900
|
title,
|
|
17878
17901
|
loading = false
|
|
17879
17902
|
} = _ref,
|
|
17880
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17903
|
+
rest = _objectWithoutProperties(_ref, _excluded$u);
|
|
17881
17904
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
17882
17905
|
className: "with-border-header h-w-btn-header card",
|
|
17883
17906
|
loading: loading,
|
|
@@ -17893,14 +17916,14 @@ const Details = _ref => {
|
|
|
17893
17916
|
}));
|
|
17894
17917
|
};
|
|
17895
17918
|
|
|
17896
|
-
const _excluded$
|
|
17919
|
+
const _excluded$t = ["config", "title", "loading"];
|
|
17897
17920
|
const KeyIndicatorsDetails = _ref => {
|
|
17898
17921
|
let {
|
|
17899
17922
|
config,
|
|
17900
17923
|
title,
|
|
17901
17924
|
loading = false
|
|
17902
17925
|
} = _ref,
|
|
17903
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17926
|
+
rest = _objectWithoutProperties(_ref, _excluded$t);
|
|
17904
17927
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
17905
17928
|
className: "with-border-header h-w-btn-header",
|
|
17906
17929
|
title: title,
|
|
@@ -17930,7 +17953,7 @@ const Style$G = styled__default["default"].div`
|
|
|
17930
17953
|
}
|
|
17931
17954
|
`;
|
|
17932
17955
|
|
|
17933
|
-
const _excluded$
|
|
17956
|
+
const _excluded$s = ["children", "config", "detailsTitle", "firstColumnWidth"];
|
|
17934
17957
|
const DetailsSection = _ref => {
|
|
17935
17958
|
let {
|
|
17936
17959
|
children,
|
|
@@ -17938,7 +17961,7 @@ const DetailsSection = _ref => {
|
|
|
17938
17961
|
detailsTitle,
|
|
17939
17962
|
firstColumnWidth = "250px"
|
|
17940
17963
|
} = _ref,
|
|
17941
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17964
|
+
rest = _objectWithoutProperties(_ref, _excluded$s);
|
|
17942
17965
|
return /*#__PURE__*/jsxRuntime.jsx(Style$G, {
|
|
17943
17966
|
firstColumnWidth: firstColumnWidth,
|
|
17944
17967
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -18114,14 +18137,14 @@ const getGoalConfig = () => {
|
|
|
18114
18137
|
};
|
|
18115
18138
|
|
|
18116
18139
|
var _templateObject$c;
|
|
18117
|
-
const _excluded$
|
|
18140
|
+
const _excluded$r = ["title", "activeSdgGoals", "t"];
|
|
18118
18141
|
function SDGWidget(_ref) {
|
|
18119
18142
|
let {
|
|
18120
18143
|
title = "Sustainable Development Goals",
|
|
18121
18144
|
activeSdgGoals = [],
|
|
18122
18145
|
t = key => key
|
|
18123
18146
|
} = _ref,
|
|
18124
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18147
|
+
props = _objectWithoutProperties(_ref, _excluded$r);
|
|
18125
18148
|
const sdgConfig = getGoalConfig();
|
|
18126
18149
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
18127
18150
|
title: title,
|
|
@@ -18419,7 +18442,7 @@ function SdgList({
|
|
|
18419
18442
|
});
|
|
18420
18443
|
}
|
|
18421
18444
|
|
|
18422
|
-
const _excluded$
|
|
18445
|
+
const _excluded$q = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
|
|
18423
18446
|
const {
|
|
18424
18447
|
Meta
|
|
18425
18448
|
} = antd.Card;
|
|
@@ -18439,7 +18462,7 @@ function ProjectWidget(_ref) {
|
|
|
18439
18462
|
hideSDGList = false,
|
|
18440
18463
|
t = x => x
|
|
18441
18464
|
} = _ref,
|
|
18442
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18465
|
+
props = _objectWithoutProperties(_ref, _excluded$q);
|
|
18443
18466
|
const [isHovered, setIsHovered] = React__default["default"].useState(false);
|
|
18444
18467
|
const {
|
|
18445
18468
|
token
|
|
@@ -18711,13 +18734,13 @@ const WidgetCard = _ref => {
|
|
|
18711
18734
|
});
|
|
18712
18735
|
};
|
|
18713
18736
|
|
|
18714
|
-
const _excluded$
|
|
18737
|
+
const _excluded$p = ["title", "children"];
|
|
18715
18738
|
const CarouselWidget = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
18716
18739
|
let {
|
|
18717
18740
|
title,
|
|
18718
18741
|
children
|
|
18719
18742
|
} = _ref,
|
|
18720
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
18743
|
+
rest = _objectWithoutProperties(_ref, _excluded$p);
|
|
18721
18744
|
/**
|
|
18722
18745
|
* Handles carousel slide change events
|
|
18723
18746
|
* @param {number} currentSlide - The index of the current slide after change
|
|
@@ -18881,7 +18904,7 @@ const EmptyStateContainer = styled__default["default"].div`
|
|
|
18881
18904
|
}
|
|
18882
18905
|
`;
|
|
18883
18906
|
|
|
18884
|
-
const _excluded$
|
|
18907
|
+
const _excluded$o = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
|
|
18885
18908
|
function ImageCarousel(_ref) {
|
|
18886
18909
|
let {
|
|
18887
18910
|
title,
|
|
@@ -18896,7 +18919,7 @@ function ImageCarousel(_ref) {
|
|
|
18896
18919
|
emptyLogo = antd.Empty.PRESENTED_IMAGE_SIMPLE,
|
|
18897
18920
|
emptyText = "No Image"
|
|
18898
18921
|
} = _ref,
|
|
18899
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
18922
|
+
rest = _objectWithoutProperties(_ref, _excluded$o);
|
|
18900
18923
|
const [previewVisible, setPreviewVisible] = React.useState(false);
|
|
18901
18924
|
const [current, setCurrent] = React.useState(0);
|
|
18902
18925
|
const carouselRef = React.useRef(null);
|
|
@@ -19265,7 +19288,7 @@ const getVegetationConfig = () => {
|
|
|
19265
19288
|
};
|
|
19266
19289
|
|
|
19267
19290
|
var _templateObject$a, _templateObject2$3;
|
|
19268
|
-
const _excluded$
|
|
19291
|
+
const _excluded$n = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
|
|
19269
19292
|
function VegetationWidget(_ref) {
|
|
19270
19293
|
let {
|
|
19271
19294
|
title = "Vegetation Health",
|
|
@@ -19277,7 +19300,7 @@ function VegetationWidget(_ref) {
|
|
|
19277
19300
|
growthObservations = [],
|
|
19278
19301
|
t = key => key
|
|
19279
19302
|
} = _ref,
|
|
19280
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19303
|
+
props = _objectWithoutProperties(_ref, _excluded$n);
|
|
19281
19304
|
let vegetationConfig = getVegetationConfig();
|
|
19282
19305
|
const allVegetationKeys = vegetationConfig.map(item => item.key);
|
|
19283
19306
|
if (filterKeys && Array.isArray(filterKeys)) {
|
|
@@ -19393,7 +19416,7 @@ const getFaunaConfig = () => {
|
|
|
19393
19416
|
};
|
|
19394
19417
|
|
|
19395
19418
|
var _templateObject$9, _templateObject2$2;
|
|
19396
|
-
const _excluded$
|
|
19419
|
+
const _excluded$m = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
|
|
19397
19420
|
function FaunaWidget(_ref) {
|
|
19398
19421
|
let {
|
|
19399
19422
|
title = "Observed Fauna",
|
|
@@ -19404,7 +19427,7 @@ function FaunaWidget(_ref) {
|
|
|
19404
19427
|
itemHeight = 100,
|
|
19405
19428
|
t = key => key
|
|
19406
19429
|
} = _ref,
|
|
19407
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19430
|
+
props = _objectWithoutProperties(_ref, _excluded$m);
|
|
19408
19431
|
let faunaConfig = getFaunaConfig();
|
|
19409
19432
|
|
|
19410
19433
|
// Filter to show only specific keys if filterKeys is provided
|
|
@@ -19469,7 +19492,7 @@ const getInvasiveSpeciesConfig = () => {
|
|
|
19469
19492
|
};
|
|
19470
19493
|
|
|
19471
19494
|
var _templateObject$8, _templateObject2$1;
|
|
19472
|
-
const _excluded$
|
|
19495
|
+
const _excluded$l = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
|
|
19473
19496
|
function InvasiveSpeciesWidget(_ref) {
|
|
19474
19497
|
let {
|
|
19475
19498
|
title = "Invasive Species",
|
|
@@ -19481,7 +19504,7 @@ function InvasiveSpeciesWidget(_ref) {
|
|
|
19481
19504
|
itemHeight = 100,
|
|
19482
19505
|
t = key => key
|
|
19483
19506
|
} = _ref,
|
|
19484
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19507
|
+
props = _objectWithoutProperties(_ref, _excluded$l);
|
|
19485
19508
|
let invasiveSpeciesConfig = getInvasiveSpeciesConfig();
|
|
19486
19509
|
|
|
19487
19510
|
// Filter to show only specific keys if filterKeys is provided
|
|
@@ -24904,8 +24927,8 @@ const RepeatableModals = ({
|
|
|
24904
24927
|
}) : null;
|
|
24905
24928
|
};
|
|
24906
24929
|
|
|
24907
|
-
const _excluded$
|
|
24908
|
-
_excluded2$
|
|
24930
|
+
const _excluded$k = ["viewGroup"],
|
|
24931
|
+
_excluded2$2 = ["label", "icon", "position"];
|
|
24909
24932
|
const Content$1 = _ref => {
|
|
24910
24933
|
let {
|
|
24911
24934
|
style = {},
|
|
@@ -24976,7 +24999,7 @@ const Content$1 = _ref => {
|
|
|
24976
24999
|
if (groups[gKey].viewGroup === key) {
|
|
24977
25000
|
// eslint-disable-next-line no-unused-vars
|
|
24978
25001
|
const _groups$gKey = groups[gKey],
|
|
24979
|
-
gCfg = _objectWithoutProperties(_groups$gKey, _excluded$
|
|
25002
|
+
gCfg = _objectWithoutProperties(_groups$gKey, _excluded$k);
|
|
24980
25003
|
items[gKey] = gCfg;
|
|
24981
25004
|
}
|
|
24982
25005
|
return items;
|
|
@@ -25204,7 +25227,7 @@ const Content$1 = _ref => {
|
|
|
25204
25227
|
showIcon: true
|
|
25205
25228
|
});
|
|
25206
25229
|
}
|
|
25207
|
-
let groups = _objectWithoutProperties(f, _excluded2$
|
|
25230
|
+
let groups = _objectWithoutProperties(f, _excluded2$2);
|
|
25208
25231
|
groups = Object.keys(groups).reduce((items, key) => {
|
|
25209
25232
|
var _groups$key2;
|
|
25210
25233
|
if (!((_groups$key2 = groups[key]) !== null && _groups$key2 !== void 0 && (_groups$key2 = _groups$key2.meta) !== null && _groups$key2 !== void 0 && _groups$key2.excludeFromView)) {
|
|
@@ -25256,7 +25279,7 @@ const Content$1 = _ref => {
|
|
|
25256
25279
|
});
|
|
25257
25280
|
};
|
|
25258
25281
|
|
|
25259
|
-
const _excluded$
|
|
25282
|
+
const _excluded$j = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
|
|
25260
25283
|
function Modal(_ref) {
|
|
25261
25284
|
let {
|
|
25262
25285
|
t = text => text,
|
|
@@ -25272,7 +25295,7 @@ function Modal(_ref) {
|
|
|
25272
25295
|
disabled = false,
|
|
25273
25296
|
withModalFormWrapper = true
|
|
25274
25297
|
} = _ref,
|
|
25275
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
25298
|
+
props = _objectWithoutProperties(_ref, _excluded$j);
|
|
25276
25299
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Modal, _objectSpread2(_objectSpread2({
|
|
25277
25300
|
width: 650,
|
|
25278
25301
|
footer: null,
|
|
@@ -35921,11 +35944,13 @@ const beforeUpload = allowedExtensions => file => {
|
|
|
35921
35944
|
};
|
|
35922
35945
|
const allowedImageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.avif', '.bmp', '.tiff', '.tif', '.heif', '.heic', '.svg', '.ico'];
|
|
35923
35946
|
|
|
35924
|
-
|
|
35947
|
+
const _excluded$i = ["placeholder"],
|
|
35948
|
+
_excluded2$1 = ["label", "description", "excludeFromEdit", "showFormIf", "icon", "position", "template", "formClass"];
|
|
35925
35949
|
dayjs__default["default"].extend(utc);
|
|
35926
35950
|
dayjs__default["default"].extend(timezone);
|
|
35927
35951
|
dayjs__default["default"].tz.setDefault("UTC");
|
|
35928
|
-
const getDefaultInputValue = (
|
|
35952
|
+
const getDefaultInputValue = function () {
|
|
35953
|
+
let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
35929
35954
|
let value = undefined;
|
|
35930
35955
|
if (input.type === "multiselect") {
|
|
35931
35956
|
value = [];
|
|
@@ -35943,33 +35968,30 @@ const checkCondition$1 = (condition, repeatValues, formsValue) => {
|
|
|
35943
35968
|
const isShown = _checkValue(isNotEmpty ? field : wantedValue, match, isNotEmpty ? formValue : value);
|
|
35944
35969
|
return isShown;
|
|
35945
35970
|
};
|
|
35946
|
-
const renderDataLinkGroup =
|
|
35947
|
-
|
|
35948
|
-
|
|
35949
|
-
|
|
35950
|
-
|
|
35951
|
-
|
|
35952
|
-
|
|
35953
|
-
|
|
35954
|
-
|
|
35955
|
-
|
|
35956
|
-
|
|
35957
|
-
|
|
35958
|
-
|
|
35959
|
-
const
|
|
35960
|
-
|
|
35971
|
+
const renderDataLinkGroup = _ref2 => {
|
|
35972
|
+
var _input$meta, _formsValue$meta, _input$meta2;
|
|
35973
|
+
let {
|
|
35974
|
+
input,
|
|
35975
|
+
groupFormId,
|
|
35976
|
+
name,
|
|
35977
|
+
formsValue,
|
|
35978
|
+
form,
|
|
35979
|
+
onValuesChange,
|
|
35980
|
+
setValues,
|
|
35981
|
+
changeLinking,
|
|
35982
|
+
isHighlighted
|
|
35983
|
+
} = _ref2;
|
|
35984
|
+
const dataLinkKey = Object.keys((input === null || input === void 0 ? void 0 : input.inputs) || {}).find(k => {
|
|
35985
|
+
var _input$inputs$k;
|
|
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];
|
|
35961
35991
|
return all;
|
|
35962
35992
|
}, {});
|
|
35963
|
-
const isSingle = input
|
|
35964
|
-
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
|
|
35965
|
-
...(formsValue[groupFormId] || {})[name]
|
|
35966
|
-
}] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
|
|
35967
|
-
...v
|
|
35968
|
-
})) : isSingle ? formsValue[name] ? [{
|
|
35969
|
-
...formsValue[name]
|
|
35970
|
-
}] : [] : getArray(formsValue[name] || []).map(v => ({
|
|
35971
|
-
...v
|
|
35972
|
-
}));
|
|
35993
|
+
const isSingle = (input === null || input === void 0 || (_input$meta = input.meta) === null || _input$meta === void 0 ? void 0 : _input$meta.maxRepeat) === 1;
|
|
35994
|
+
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [_objectSpread2({}, (formsValue[groupFormId] || {})[name])] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => _objectSpread2({}, v)) : isSingle ? formsValue[name] ? [_objectSpread2({}, formsValue[name])] : [] : getArray(formsValue[name] || []).map(v => _objectSpread2({}, v));
|
|
35973
35995
|
const onUpdate = (val, i) => {
|
|
35974
35996
|
const _val = isSingle ? {
|
|
35975
35997
|
[name]: val
|
|
@@ -35977,31 +35999,20 @@ const renderDataLinkGroup = ({
|
|
|
35977
35999
|
[name]: formData.map((d, j) => i === j ? val : d)
|
|
35978
36000
|
};
|
|
35979
36001
|
if (groupFormId) {
|
|
35980
|
-
const _defaultData = form
|
|
35981
|
-
const _newData = {
|
|
35982
|
-
|
|
35983
|
-
..._val
|
|
35984
|
-
};
|
|
35985
|
-
onValuesChange(_newData, {
|
|
35986
|
-
...formsValue,
|
|
36002
|
+
const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
|
|
36003
|
+
const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
|
|
36004
|
+
onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
35987
36005
|
[groupFormId]: _newData
|
|
35988
|
-
});
|
|
35989
|
-
form
|
|
35990
|
-
setValues({
|
|
35991
|
-
...formsValue,
|
|
36006
|
+
}));
|
|
36007
|
+
form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
|
|
36008
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
35992
36009
|
[groupFormId]: _newData
|
|
35993
|
-
});
|
|
36010
|
+
}));
|
|
35994
36011
|
return;
|
|
35995
36012
|
}
|
|
35996
|
-
onValuesChange(_val, {
|
|
35997
|
-
|
|
35998
|
-
|
|
35999
|
-
});
|
|
36000
|
-
form?.setFieldValue(name, _val[name]);
|
|
36001
|
-
setValues({
|
|
36002
|
-
...formsValue,
|
|
36003
|
-
..._val
|
|
36004
|
-
});
|
|
36013
|
+
onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
36014
|
+
form === null || form === void 0 || form.setFieldValue(name, _val[name]);
|
|
36015
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
36005
36016
|
};
|
|
36006
36017
|
return /*#__PURE__*/jsxRuntime.jsx(DataLinkGroup, {
|
|
36007
36018
|
form: input,
|
|
@@ -36012,102 +36023,79 @@ const renderDataLinkGroup = ({
|
|
|
36012
36023
|
isHighlighted: isHighlighted,
|
|
36013
36024
|
dataLinkInput: dataLinkInput,
|
|
36014
36025
|
formsValue: formsValue,
|
|
36015
|
-
values: groupFormId ? {
|
|
36016
|
-
...(formsValue[groupFormId] || {}),
|
|
36026
|
+
values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
|
|
36017
36027
|
meta: {
|
|
36018
|
-
inputs: (formsValue
|
|
36028
|
+
inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta = formsValue.meta) === null || _formsValue$meta === void 0 ? void 0 : _formsValue$meta.inputs) || {})[groupFormId]
|
|
36019
36029
|
}
|
|
36020
|
-
} : formsValue,
|
|
36030
|
+
}) : formsValue,
|
|
36021
36031
|
name: name,
|
|
36022
36032
|
groupFormId: groupFormId,
|
|
36023
|
-
maxRepeat: input
|
|
36024
|
-
remove:
|
|
36025
|
-
|
|
36026
|
-
|
|
36033
|
+
maxRepeat: input === null || input === void 0 || (_input$meta2 = input.meta) === null || _input$meta2 === void 0 ? void 0 : _input$meta2.maxRepeat,
|
|
36034
|
+
remove: _ref3 => {
|
|
36035
|
+
let {
|
|
36036
|
+
key
|
|
36037
|
+
} = _ref3;
|
|
36027
36038
|
const _val = isSingle ? {
|
|
36028
36039
|
[name]: null
|
|
36029
36040
|
} : {
|
|
36030
36041
|
[name]: formData.filter((v, j) => j !== key)
|
|
36031
36042
|
};
|
|
36032
36043
|
if (groupFormId) {
|
|
36033
|
-
const _defaultData = form
|
|
36034
|
-
const _newData = {
|
|
36035
|
-
|
|
36036
|
-
..._val
|
|
36037
|
-
};
|
|
36038
|
-
onValuesChange(_newData, {
|
|
36039
|
-
...formsValue,
|
|
36044
|
+
const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
|
|
36045
|
+
const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
|
|
36046
|
+
onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
36040
36047
|
[groupFormId]: _newData
|
|
36041
|
-
});
|
|
36042
|
-
form
|
|
36043
|
-
setValues({
|
|
36044
|
-
...formsValue,
|
|
36048
|
+
}));
|
|
36049
|
+
form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
|
|
36050
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
36045
36051
|
[groupFormId]: _newData
|
|
36046
|
-
});
|
|
36052
|
+
}));
|
|
36047
36053
|
return;
|
|
36048
36054
|
}
|
|
36049
|
-
onValuesChange(_val, {
|
|
36050
|
-
|
|
36051
|
-
|
|
36052
|
-
});
|
|
36053
|
-
form?.setFieldValue(name, _val[name]);
|
|
36054
|
-
setValues({
|
|
36055
|
-
...formsValue,
|
|
36056
|
-
..._val
|
|
36057
|
-
});
|
|
36055
|
+
onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
36056
|
+
form === null || form === void 0 || form.setFieldValue(name, _val[name]);
|
|
36057
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
36058
36058
|
},
|
|
36059
36059
|
add: val => {
|
|
36060
36060
|
const _val = isSingle ? {
|
|
36061
36061
|
[name]: val
|
|
36062
36062
|
} : {
|
|
36063
|
-
[name]: [...formData, {
|
|
36064
|
-
...val
|
|
36065
|
-
}]
|
|
36063
|
+
[name]: [...formData, _objectSpread2({}, val)]
|
|
36066
36064
|
};
|
|
36067
36065
|
if (groupFormId) {
|
|
36068
|
-
const _defaultData = form
|
|
36069
|
-
const _newData = {
|
|
36070
|
-
|
|
36071
|
-
|
|
36072
|
-
};
|
|
36073
|
-
form?.setFieldValue(groupFormId, _newData);
|
|
36074
|
-
onValuesChange(_newData, {
|
|
36075
|
-
...formsValue,
|
|
36066
|
+
const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
|
|
36067
|
+
const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
|
|
36068
|
+
form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
|
|
36069
|
+
onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
36076
36070
|
[groupFormId]: _newData
|
|
36077
|
-
});
|
|
36078
|
-
setValues({
|
|
36079
|
-
...formsValue,
|
|
36071
|
+
}));
|
|
36072
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
36080
36073
|
[groupFormId]: _newData
|
|
36081
|
-
});
|
|
36074
|
+
}));
|
|
36082
36075
|
return;
|
|
36083
36076
|
}
|
|
36084
|
-
form
|
|
36085
|
-
onValuesChange(_val, {
|
|
36086
|
-
|
|
36087
|
-
..._val
|
|
36088
|
-
});
|
|
36089
|
-
setValues({
|
|
36090
|
-
...formsValue,
|
|
36091
|
-
..._val
|
|
36092
|
-
});
|
|
36077
|
+
form === null || form === void 0 || form.setFieldValue(name, _val[name]);
|
|
36078
|
+
onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
36079
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
36093
36080
|
},
|
|
36094
36081
|
k: name,
|
|
36095
36082
|
formData: formData
|
|
36096
36083
|
});
|
|
36097
36084
|
};
|
|
36098
36085
|
function showHideInput$1(input, data, repeatIndex, repeatValues, inputMeta) {
|
|
36099
|
-
|
|
36086
|
+
var _input$meta3, _data$meta;
|
|
36087
|
+
if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
|
|
36100
36088
|
return false;
|
|
36101
36089
|
}
|
|
36102
|
-
if (typeof input
|
|
36103
|
-
|
|
36090
|
+
if (typeof (input === null || input === void 0 || (_input$meta3 = input.meta) === null || _input$meta3 === void 0 ? void 0 : _input$meta3.excludeFromEdit) === "boolean") {
|
|
36091
|
+
var _input$meta4;
|
|
36092
|
+
return !(input !== null && input !== void 0 && (_input$meta4 = input.meta) !== null && _input$meta4 !== void 0 && _input$meta4.excludeFromEdit);
|
|
36104
36093
|
}
|
|
36105
|
-
const formsValue = {
|
|
36106
|
-
|
|
36107
|
-
|
|
36108
|
-
|
|
36109
|
-
|
|
36110
|
-
if (input?.notApplicable || input?.notAvailable) {
|
|
36094
|
+
const formsValue = _objectSpread2({}, data);
|
|
36095
|
+
Object.keys((data === null || data === void 0 || (_data$meta = data.meta) === null || _data$meta === void 0 ? void 0 : _data$meta.inputs) || {}).forEach(key => {
|
|
36096
|
+
var _data$meta2;
|
|
36097
|
+
const input = data === null || data === void 0 || (_data$meta2 = data.meta) === null || _data$meta2 === void 0 ? void 0 : _data$meta2.inputs[key];
|
|
36098
|
+
if (input !== null && input !== void 0 && input.notApplicable || input !== null && input !== void 0 && input.notAvailable) {
|
|
36111
36099
|
formsValue[key] = undefined;
|
|
36112
36100
|
delete formsValue[key];
|
|
36113
36101
|
}
|
|
@@ -36166,35 +36154,35 @@ function getInputHeadLines$1(type, i, input, values) {
|
|
|
36166
36154
|
switch (type) {
|
|
36167
36155
|
case "h2":
|
|
36168
36156
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36169
|
-
className:
|
|
36157
|
+
className: "title-semibold-2 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
|
|
36170
36158
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36171
36159
|
children: getInputLabel$1(input, values)
|
|
36172
36160
|
})
|
|
36173
36161
|
});
|
|
36174
36162
|
case "h3":
|
|
36175
36163
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36176
|
-
className:
|
|
36164
|
+
className: "title-semibold-3 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
|
|
36177
36165
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36178
36166
|
children: getInputLabel$1(input, values)
|
|
36179
36167
|
})
|
|
36180
36168
|
});
|
|
36181
36169
|
case "h4":
|
|
36182
36170
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36183
|
-
className:
|
|
36171
|
+
className: "title-semibold-4 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
|
|
36184
36172
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36185
36173
|
children: getInputLabel$1(input, values)
|
|
36186
36174
|
})
|
|
36187
36175
|
});
|
|
36188
36176
|
case "h5":
|
|
36189
36177
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36190
|
-
className:
|
|
36178
|
+
className: "title-semibold-5 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
|
|
36191
36179
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36192
36180
|
children: getInputLabel$1(input, values)
|
|
36193
36181
|
})
|
|
36194
36182
|
});
|
|
36195
36183
|
case "h6":
|
|
36196
36184
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36197
|
-
className:
|
|
36185
|
+
className: "title-semibold-6 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
|
|
36198
36186
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36199
36187
|
children: getInputLabel$1(input, values)
|
|
36200
36188
|
})
|
|
@@ -36203,15 +36191,16 @@ function getInputHeadLines$1(type, i, input, values) {
|
|
|
36203
36191
|
return null;
|
|
36204
36192
|
}
|
|
36205
36193
|
}
|
|
36206
|
-
function getInputProp(prop
|
|
36194
|
+
function getInputProp(prop) {
|
|
36195
|
+
let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
36196
|
+
let scope = arguments.length > 2 ? arguments[2] : undefined;
|
|
36207
36197
|
if (prop && typeof prop === "object") {
|
|
36208
36198
|
const validations = Object.keys(prop);
|
|
36209
36199
|
const key = validations.find(v => {
|
|
36210
36200
|
let [path, match, wantedValue] = v.split(/( is | includes | not | notEmpty )/gim);
|
|
36211
|
-
const value = dot__default["default"].pick(path, {
|
|
36212
|
-
...formsValue,
|
|
36201
|
+
const value = dot__default["default"].pick(path, _objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
36213
36202
|
scope
|
|
36214
|
-
});
|
|
36203
|
+
}));
|
|
36215
36204
|
return _checkValue(wantedValue, match, value);
|
|
36216
36205
|
});
|
|
36217
36206
|
const label = key ? prop[key] : prop[validations[0]];
|
|
@@ -36220,29 +36209,33 @@ function getInputProp(prop, formsValue = {}, scope) {
|
|
|
36220
36209
|
return prop;
|
|
36221
36210
|
}
|
|
36222
36211
|
}
|
|
36223
|
-
function getInputLabel$1(input
|
|
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;
|
|
36224
36215
|
return /*#__PURE__*/jsxRuntime.jsx(InputLabel, {
|
|
36225
36216
|
input: input,
|
|
36226
36217
|
formsValue: formsValue,
|
|
36227
36218
|
asText: asText
|
|
36228
36219
|
});
|
|
36229
36220
|
}
|
|
36230
|
-
const InputLabel =
|
|
36231
|
-
|
|
36232
|
-
|
|
36233
|
-
|
|
36234
|
-
|
|
36221
|
+
const InputLabel = _ref4 => {
|
|
36222
|
+
var _input$meta5, _input$meta6, _input$meta7;
|
|
36223
|
+
let {
|
|
36224
|
+
input,
|
|
36225
|
+
formsValue,
|
|
36226
|
+
asText
|
|
36227
|
+
} = _ref4;
|
|
36235
36228
|
const {
|
|
36236
36229
|
t,
|
|
36237
36230
|
evaluationConfig,
|
|
36238
36231
|
scope
|
|
36239
36232
|
} = useEditContext();
|
|
36240
36233
|
const label = getInputProp(input.label, formsValue, scope);
|
|
36241
|
-
return input
|
|
36234
|
+
return input !== null && input !== void 0 && (_input$meta5 = input.meta) !== null && _input$meta5 !== void 0 && _input$meta5.isEvaluation || input.description && typeof input.description === "string" && !asText ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
36242
36235
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
36243
36236
|
className: "flex",
|
|
36244
36237
|
children: [ReactHtmlParser__default["default"](label), /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
|
|
36245
|
-
content: input
|
|
36238
|
+
content: input !== null && input !== void 0 && (_input$meta6 = input.meta) !== null && _input$meta6 !== void 0 && _input$meta6.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(EvaluationPopover, {
|
|
36246
36239
|
t: t,
|
|
36247
36240
|
evaluationConfig: evaluationConfig
|
|
36248
36241
|
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -36250,7 +36243,7 @@ const InputLabel = ({
|
|
|
36250
36243
|
children: ReactHtmlParser__default["default"](input.description)
|
|
36251
36244
|
}),
|
|
36252
36245
|
placement: "top",
|
|
36253
|
-
children: !input
|
|
36246
|
+
children: !(input !== null && input !== void 0 && (_input$meta7 = input.meta) !== null && _input$meta7 !== void 0 && _input$meta7.isEvaluation) || evaluationConfig.length > 0 ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36254
36247
|
className: "flex flex-column justify-content-center ml-1",
|
|
36255
36248
|
children: /*#__PURE__*/jsxRuntime.jsx(TooltipIcon, {
|
|
36256
36249
|
fontSize: 13
|
|
@@ -36272,7 +36265,9 @@ function getSectionLabel$1(labels, values) {
|
|
|
36272
36265
|
}
|
|
36273
36266
|
return labels;
|
|
36274
36267
|
}
|
|
36275
|
-
function getSubtitles$1(subtitles, position
|
|
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;
|
|
36276
36271
|
let subtitle = subtitles && subtitles[position];
|
|
36277
36272
|
if (subtitle && typeof subtitle === "object") {
|
|
36278
36273
|
let newSubtitle = subtitle.default || "";
|
|
@@ -36316,14 +36311,12 @@ function getSubtitles$1(subtitles, position, formsValue = {}, repeatIndex, repea
|
|
|
36316
36311
|
function getFormTitles$1(titles, key, position) {
|
|
36317
36312
|
let tilte = titles && titles[key];
|
|
36318
36313
|
return tilte ? /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
36319
|
-
className:
|
|
36314
|
+
className: "title-semibold-3 mb0 ".concat(position ? "mt-3" : ""),
|
|
36320
36315
|
children: tilte
|
|
36321
36316
|
}) : null;
|
|
36322
36317
|
}
|
|
36323
36318
|
const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsValue, name, mainForm) => {
|
|
36324
|
-
formsValue = Object.assign(formsValue, {
|
|
36325
|
-
...mainForm.getFieldsValue(true)
|
|
36326
|
-
});
|
|
36319
|
+
formsValue = Object.assign(formsValue, _objectSpread2({}, mainForm.getFieldsValue(true)));
|
|
36327
36320
|
if (typeof repeatIndex === "number" && repeatValues) {
|
|
36328
36321
|
if (!repeatValues[inputName] || !___default["default"].isEqual(repeatValues[inputName], value)) {
|
|
36329
36322
|
repeatValues[inputName] = value;
|
|
@@ -36358,14 +36351,16 @@ const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsVa
|
|
|
36358
36351
|
};
|
|
36359
36352
|
const inputOnBlur = [];
|
|
36360
36353
|
const inputTypeComponent$1 = {
|
|
36361
|
-
text: ({
|
|
36362
|
-
|
|
36363
|
-
|
|
36364
|
-
|
|
36365
|
-
|
|
36366
|
-
|
|
36367
|
-
|
|
36368
|
-
|
|
36354
|
+
text: (_ref5, _ref6) => {
|
|
36355
|
+
let {
|
|
36356
|
+
props,
|
|
36357
|
+
rules
|
|
36358
|
+
} = _ref5;
|
|
36359
|
+
let {
|
|
36360
|
+
inputMeta = {},
|
|
36361
|
+
t,
|
|
36362
|
+
isHighlighted
|
|
36363
|
+
} = _ref6;
|
|
36369
36364
|
const maxRule = rules.find(r => r.max);
|
|
36370
36365
|
const maxProps = {
|
|
36371
36366
|
maxLength: MAX_TEXT_AREA_LENGTH
|
|
@@ -36373,26 +36368,28 @@ const inputTypeComponent$1 = {
|
|
|
36373
36368
|
if (maxRule) {
|
|
36374
36369
|
maxProps.maxLength = maxRule.max;
|
|
36375
36370
|
}
|
|
36376
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
36377
|
-
size: "large"
|
|
36378
|
-
|
|
36371
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
|
|
36372
|
+
size: "large"
|
|
36373
|
+
}, maxProps), {}, {
|
|
36379
36374
|
allowClear: true,
|
|
36380
36375
|
autoComplete: "new-password",
|
|
36381
|
-
type: "text"
|
|
36382
|
-
|
|
36376
|
+
type: "text"
|
|
36377
|
+
}, props), {}, {
|
|
36383
36378
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36384
36379
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36385
36380
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
36386
|
-
});
|
|
36381
|
+
}));
|
|
36387
36382
|
},
|
|
36388
|
-
link: ({
|
|
36389
|
-
|
|
36390
|
-
|
|
36391
|
-
|
|
36392
|
-
|
|
36393
|
-
|
|
36394
|
-
|
|
36395
|
-
|
|
36383
|
+
link: (_ref7, _ref8) => {
|
|
36384
|
+
let {
|
|
36385
|
+
props,
|
|
36386
|
+
rules
|
|
36387
|
+
} = _ref7;
|
|
36388
|
+
let {
|
|
36389
|
+
inputMeta = {},
|
|
36390
|
+
t,
|
|
36391
|
+
isHighlighted
|
|
36392
|
+
} = _ref8;
|
|
36396
36393
|
const maxRule = rules.find(r => r.max);
|
|
36397
36394
|
const maxProps = {
|
|
36398
36395
|
maxLength: MAX_TEXT_AREA_LENGTH
|
|
@@ -36400,29 +36397,32 @@ const inputTypeComponent$1 = {
|
|
|
36400
36397
|
if (maxRule) {
|
|
36401
36398
|
maxProps.maxLength = maxRule.max;
|
|
36402
36399
|
}
|
|
36403
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
36404
|
-
size: "large"
|
|
36405
|
-
|
|
36400
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
|
|
36401
|
+
size: "large"
|
|
36402
|
+
}, maxProps), {}, {
|
|
36406
36403
|
allowClear: true,
|
|
36407
36404
|
autoComplete: "new-password",
|
|
36408
|
-
type: "text"
|
|
36409
|
-
|
|
36405
|
+
type: "text"
|
|
36406
|
+
}, props), {}, {
|
|
36410
36407
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36411
36408
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36412
36409
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
36413
|
-
});
|
|
36410
|
+
}));
|
|
36414
36411
|
},
|
|
36415
|
-
number: ({
|
|
36416
|
-
|
|
36417
|
-
|
|
36418
|
-
|
|
36419
|
-
|
|
36420
|
-
|
|
36421
|
-
|
|
36422
|
-
|
|
36423
|
-
|
|
36412
|
+
number: (_ref9, _ref10) => {
|
|
36413
|
+
var _input$meta8;
|
|
36414
|
+
let {
|
|
36415
|
+
props,
|
|
36416
|
+
rules,
|
|
36417
|
+
input
|
|
36418
|
+
} = _ref9;
|
|
36419
|
+
let {
|
|
36420
|
+
inputMeta = {},
|
|
36421
|
+
t,
|
|
36422
|
+
isHighlighted
|
|
36423
|
+
} = _ref10;
|
|
36424
36424
|
const maxRule = rules.find(r => r.max);
|
|
36425
|
-
const integerRule = !input
|
|
36425
|
+
const integerRule = !(input !== null && input !== void 0 && (_input$meta8 = input.meta) !== null && _input$meta8 !== void 0 && _input$meta8.isDecimal);
|
|
36426
36426
|
const parser = value => {
|
|
36427
36427
|
if (!value) {
|
|
36428
36428
|
return "";
|
|
@@ -36433,60 +36433,63 @@ const inputTypeComponent$1 = {
|
|
|
36433
36433
|
return value.replace(/\$\s?|(,*)/g, "");
|
|
36434
36434
|
};
|
|
36435
36435
|
if (maxRule) {
|
|
36436
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
36436
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
|
|
36437
36437
|
size: "large",
|
|
36438
36438
|
allowClear: true,
|
|
36439
|
-
autoComplete: "new-password"
|
|
36440
|
-
|
|
36439
|
+
autoComplete: "new-password"
|
|
36440
|
+
}, props), {}, {
|
|
36441
36441
|
type: "number",
|
|
36442
36442
|
parser: parser,
|
|
36443
36443
|
min: 0,
|
|
36444
36444
|
max: maxRule.max,
|
|
36445
36445
|
className: formatClassname([isHighlighted && "highlighted-input"])
|
|
36446
|
-
});
|
|
36446
|
+
}));
|
|
36447
36447
|
}
|
|
36448
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
36448
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
|
|
36449
36449
|
size: "large",
|
|
36450
36450
|
allowClear: true,
|
|
36451
36451
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36452
|
-
autoComplete: "new-password"
|
|
36453
|
-
|
|
36452
|
+
autoComplete: "new-password"
|
|
36453
|
+
}, props), {}, {
|
|
36454
36454
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36455
36455
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
|
|
36456
36456
|
min: 0,
|
|
36457
36457
|
formatter: value => numberWithCommas$1(value),
|
|
36458
36458
|
parser: parser
|
|
36459
|
-
});
|
|
36459
|
+
}));
|
|
36460
36460
|
},
|
|
36461
36461
|
// 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
|
-
|
|
36462
|
+
select: (_ref11, _ref12) => {
|
|
36463
|
+
var _input$meta9, _input$meta10;
|
|
36464
|
+
let {
|
|
36465
|
+
value,
|
|
36466
|
+
options,
|
|
36467
|
+
optionGroup,
|
|
36468
|
+
props,
|
|
36469
|
+
formsValue,
|
|
36470
|
+
optionsFilter,
|
|
36471
|
+
filterCond,
|
|
36472
|
+
repeatValues,
|
|
36473
|
+
repeatIndex,
|
|
36474
|
+
name,
|
|
36475
|
+
inputName,
|
|
36476
|
+
address,
|
|
36477
|
+
addressData,
|
|
36478
|
+
input,
|
|
36479
|
+
scope
|
|
36480
|
+
} = _ref11;
|
|
36481
|
+
let {
|
|
36482
|
+
forms,
|
|
36483
|
+
form,
|
|
36484
|
+
setAddress,
|
|
36485
|
+
inputMeta = {},
|
|
36486
|
+
t,
|
|
36487
|
+
isHighlighted,
|
|
36488
|
+
changeInputMeta,
|
|
36489
|
+
groupFormId
|
|
36490
|
+
} = _ref12;
|
|
36488
36491
|
let opts;
|
|
36489
|
-
const isEvaluation = input
|
|
36492
|
+
const isEvaluation = input === null || input === void 0 || (_input$meta9 = input.meta) === null || _input$meta9 === void 0 ? void 0 : _input$meta9.isEvaluation;
|
|
36490
36493
|
let defaultValue = value;
|
|
36491
36494
|
if (typeof options === "string") {
|
|
36492
36495
|
const [formName, key] = options.split(".");
|
|
@@ -36511,7 +36514,7 @@ const inputTypeComponent$1 = {
|
|
|
36511
36514
|
opts = [];
|
|
36512
36515
|
}
|
|
36513
36516
|
} else {
|
|
36514
|
-
opts = options
|
|
36517
|
+
opts = options === null || options === void 0 ? void 0 : options.filter(o => !o.onlyView);
|
|
36515
36518
|
}
|
|
36516
36519
|
opts = JSON.parse(JSON.stringify(opts || []));
|
|
36517
36520
|
opts = opts.map(o => getSelectOptions$2(o, formsValue));
|
|
@@ -36521,7 +36524,7 @@ const inputTypeComponent$1 = {
|
|
|
36521
36524
|
const uniqueDefaultKeys = getUniqueDefaultKeys(options);
|
|
36522
36525
|
|
|
36523
36526
|
// Handle default value logic
|
|
36524
|
-
if (!propHasValue$1(value) && propHasValue$1(input
|
|
36527
|
+
if (!propHasValue$1(value) && propHasValue$1(input === null || input === void 0 || (_input$meta10 = input.meta) === null || _input$meta10 === void 0 ? void 0 : _input$meta10.defaultValue)) {
|
|
36525
36528
|
// If no current value but there's a default value, use the default
|
|
36526
36529
|
value = input.meta.defaultValue;
|
|
36527
36530
|
defaultValue = value;
|
|
@@ -36554,7 +36557,7 @@ const inputTypeComponent$1 = {
|
|
|
36554
36557
|
}
|
|
36555
36558
|
opts = groupOptions;
|
|
36556
36559
|
}
|
|
36557
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
36560
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
|
|
36558
36561
|
size: "large",
|
|
36559
36562
|
autoComplete: "new-password",
|
|
36560
36563
|
allowClear: true,
|
|
@@ -36563,35 +36566,32 @@ const inputTypeComponent$1 = {
|
|
|
36563
36566
|
value: value // Use value instead of defaultValue for controlled behavior
|
|
36564
36567
|
,
|
|
36565
36568
|
filterOption: filterSelectOptions,
|
|
36566
|
-
optionFilterProp: "children"
|
|
36567
|
-
|
|
36569
|
+
optionFilterProp: "children"
|
|
36570
|
+
}, props), {}, {
|
|
36568
36571
|
className: formatClassname([isHighlighted && "highlighted-select"]),
|
|
36569
36572
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36570
36573
|
placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select one option"),
|
|
36571
36574
|
onChange: (val, selectedValue) => {
|
|
36572
36575
|
// ONLY FOR SBG EVALUATON !!
|
|
36573
36576
|
if (isEvaluation && val === "na" && groupFormId) {
|
|
36577
|
+
var _formsValue$meta2;
|
|
36574
36578
|
changeInputMeta({
|
|
36575
36579
|
key: groupFormId,
|
|
36576
|
-
value: {
|
|
36577
|
-
...(formsValue?.meta?.inputs?.[groupFormId] || {}),
|
|
36580
|
+
value: _objectSpread2(_objectSpread2({}, (formsValue === null || formsValue === void 0 || (_formsValue$meta2 = formsValue.meta) === null || _formsValue$meta2 === void 0 || (_formsValue$meta2 = _formsValue$meta2.inputs) === null || _formsValue$meta2 === void 0 ? void 0 : _formsValue$meta2[groupFormId]) || {}), {}, {
|
|
36578
36581
|
documentation: {
|
|
36579
36582
|
notApplicable: true
|
|
36580
36583
|
}
|
|
36581
|
-
},
|
|
36584
|
+
}),
|
|
36582
36585
|
otherValues: {
|
|
36583
|
-
[groupFormId]: {
|
|
36584
|
-
...(formsValue?.[groupFormId] || {}),
|
|
36586
|
+
[groupFormId]: _objectSpread2(_objectSpread2({}, (formsValue === null || formsValue === void 0 ? void 0 : formsValue[groupFormId]) || {}), {}, {
|
|
36585
36587
|
[name]: val
|
|
36586
|
-
}
|
|
36588
|
+
})
|
|
36587
36589
|
}
|
|
36588
36590
|
});
|
|
36589
36591
|
}
|
|
36590
36592
|
if (address && selectedValue) {
|
|
36591
36593
|
dot__default["default"].str(address, selectedValue.children, addressData);
|
|
36592
|
-
setAddress({
|
|
36593
|
-
...addressData
|
|
36594
|
-
});
|
|
36594
|
+
setAddress(_objectSpread2({}, addressData));
|
|
36595
36595
|
}
|
|
36596
36596
|
if (props.onChange) {
|
|
36597
36597
|
props.onChange(val);
|
|
@@ -36622,15 +36622,15 @@ const inputTypeComponent$1 = {
|
|
|
36622
36622
|
if (og.disabled !== undefined) {
|
|
36623
36623
|
groupOtherProps.disabled = og.disabled;
|
|
36624
36624
|
}
|
|
36625
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36626
|
-
value: og.value
|
|
36627
|
-
|
|
36625
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
|
|
36626
|
+
value: og.value
|
|
36627
|
+
}, groupOtherProps), {}, {
|
|
36628
36628
|
children: og.label
|
|
36629
|
-
},
|
|
36629
|
+
}), "".concat(i).concat(j));
|
|
36630
36630
|
})
|
|
36631
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36632
|
-
value: option.value
|
|
36633
|
-
|
|
36631
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
|
|
36632
|
+
value: option.value
|
|
36633
|
+
}, otherProps), {}, {
|
|
36634
36634
|
children: isEvaluation ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
36635
36635
|
className: "flex",
|
|
36636
36636
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -36638,33 +36638,35 @@ const inputTypeComponent$1 = {
|
|
|
36638
36638
|
children: sgbEvaluationIcons[option.value]
|
|
36639
36639
|
}), option.label]
|
|
36640
36640
|
}) : option.label
|
|
36641
|
-
}, option.value);
|
|
36641
|
+
}), option.value);
|
|
36642
36642
|
})
|
|
36643
|
-
});
|
|
36643
|
+
}));
|
|
36644
36644
|
},
|
|
36645
|
-
multiselect: ({
|
|
36646
|
-
|
|
36647
|
-
|
|
36648
|
-
|
|
36649
|
-
|
|
36650
|
-
|
|
36651
|
-
|
|
36652
|
-
|
|
36653
|
-
|
|
36654
|
-
|
|
36655
|
-
|
|
36656
|
-
|
|
36657
|
-
|
|
36658
|
-
|
|
36659
|
-
|
|
36660
|
-
|
|
36661
|
-
|
|
36662
|
-
|
|
36663
|
-
|
|
36664
|
-
|
|
36665
|
-
|
|
36666
|
-
|
|
36667
|
-
|
|
36645
|
+
multiselect: (_ref13, _ref14) => {
|
|
36646
|
+
let {
|
|
36647
|
+
value,
|
|
36648
|
+
options,
|
|
36649
|
+
optionGroup,
|
|
36650
|
+
optionsFilter,
|
|
36651
|
+
filterCond,
|
|
36652
|
+
props,
|
|
36653
|
+
formsValue,
|
|
36654
|
+
repeatValues,
|
|
36655
|
+
repeatIndex,
|
|
36656
|
+
inputName,
|
|
36657
|
+
name,
|
|
36658
|
+
tags,
|
|
36659
|
+
maxWidth,
|
|
36660
|
+
staticWidth,
|
|
36661
|
+
fullWidth
|
|
36662
|
+
} = _ref13;
|
|
36663
|
+
let {
|
|
36664
|
+
forms,
|
|
36665
|
+
form,
|
|
36666
|
+
inputMeta = {},
|
|
36667
|
+
t,
|
|
36668
|
+
isHighlighted
|
|
36669
|
+
} = _ref14;
|
|
36668
36670
|
let opts;
|
|
36669
36671
|
if (typeof options === "string") {
|
|
36670
36672
|
const [formName, key] = options.split(".");
|
|
@@ -36726,17 +36728,17 @@ const inputTypeComponent$1 = {
|
|
|
36726
36728
|
staticWidth,
|
|
36727
36729
|
fullWidth
|
|
36728
36730
|
});
|
|
36729
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
36731
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2(_objectSpread2({
|
|
36730
36732
|
size: "medium",
|
|
36731
36733
|
allowClear: true,
|
|
36732
36734
|
autoComplete: "new-password",
|
|
36733
36735
|
mode: tags ? "tags" : "multiple",
|
|
36734
|
-
optionFilterProp: "children"
|
|
36735
|
-
|
|
36736
|
-
|
|
36737
|
-
|
|
36738
|
-
filterOption: filterSelectOptions
|
|
36739
|
-
|
|
36736
|
+
optionFilterProp: "children"
|
|
36737
|
+
}, tags ? {
|
|
36738
|
+
tokenSeparators: [","]
|
|
36739
|
+
} : {}), {}, {
|
|
36740
|
+
filterOption: filterSelectOptions
|
|
36741
|
+
}, props), {}, {
|
|
36740
36742
|
className: formatClassname([isHighlighted && "highlighted-select"]),
|
|
36741
36743
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36742
36744
|
placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select all relevant options"),
|
|
@@ -36775,51 +36777,52 @@ const inputTypeComponent$1 = {
|
|
|
36775
36777
|
if (og.disabled !== undefined) {
|
|
36776
36778
|
groupOtherProps.disabled = og.disabled;
|
|
36777
36779
|
}
|
|
36778
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36779
|
-
value: og.value
|
|
36780
|
-
|
|
36780
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
|
|
36781
|
+
value: og.value
|
|
36782
|
+
}, groupOtherProps), {}, {
|
|
36781
36783
|
children: og.label
|
|
36782
|
-
},
|
|
36784
|
+
}), "".concat(i).concat(j));
|
|
36783
36785
|
})
|
|
36784
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36785
|
-
value: option.value
|
|
36786
|
-
|
|
36786
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, _objectSpread2(_objectSpread2({
|
|
36787
|
+
value: option.value
|
|
36788
|
+
}, otherProps), {}, {
|
|
36787
36789
|
children: option.label
|
|
36788
|
-
}, i);
|
|
36790
|
+
}), i);
|
|
36789
36791
|
})
|
|
36790
|
-
});
|
|
36792
|
+
}));
|
|
36791
36793
|
},
|
|
36792
|
-
date: ({
|
|
36793
|
-
|
|
36794
|
-
|
|
36795
|
-
|
|
36796
|
-
|
|
36797
|
-
|
|
36798
|
-
|
|
36799
|
-
|
|
36800
|
-
|
|
36801
|
-
|
|
36802
|
-
|
|
36803
|
-
|
|
36804
|
-
|
|
36805
|
-
|
|
36794
|
+
date: (_ref15, _ref16) => {
|
|
36795
|
+
var _formsValue$groupForm, _value2;
|
|
36796
|
+
let {
|
|
36797
|
+
props,
|
|
36798
|
+
rules,
|
|
36799
|
+
repeatValues,
|
|
36800
|
+
formsValue,
|
|
36801
|
+
name
|
|
36802
|
+
} = _ref15;
|
|
36803
|
+
let {
|
|
36804
|
+
setFormValues,
|
|
36805
|
+
inputMeta,
|
|
36806
|
+
form,
|
|
36807
|
+
t,
|
|
36808
|
+
isHighlighted,
|
|
36809
|
+
groupFormId
|
|
36810
|
+
} = _ref16;
|
|
36806
36811
|
const lng = localStorage.getItem("datastakeLng") || "en";
|
|
36807
36812
|
const maxRule = rules.find(r => r.max);
|
|
36808
|
-
let value = groupFormId ? formsValue
|
|
36813
|
+
let value = groupFormId ? formsValue === null || formsValue === void 0 || (_formsValue$groupForm = formsValue[groupFormId]) === null || _formsValue$groupForm === void 0 ? void 0 : _formsValue$groupForm[name] : formsValue[name];
|
|
36809
36814
|
const handleDateChange = date => {
|
|
36810
36815
|
if (date) {
|
|
36811
36816
|
// const localDate = dayjs.utc(date).add(dayjs(date).utcOffset(), 'minutes');
|
|
36812
36817
|
const localDate = dayjs__default["default"].utc(date);
|
|
36813
36818
|
if (groupFormId) {
|
|
36814
|
-
const _new = {
|
|
36815
|
-
...(formsValue[groupFormId] || {}),
|
|
36819
|
+
const _new = _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
|
|
36816
36820
|
[name]: localDate
|
|
36817
|
-
};
|
|
36821
|
+
});
|
|
36818
36822
|
form.setFieldValue(groupFormId, _new);
|
|
36819
|
-
setFormValues({
|
|
36820
|
-
...formsValue,
|
|
36823
|
+
setFormValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
36821
36824
|
[groupFormId]: _new
|
|
36822
|
-
});
|
|
36825
|
+
}));
|
|
36823
36826
|
} else {
|
|
36824
36827
|
form.setFieldValue(name, localDate);
|
|
36825
36828
|
}
|
|
@@ -36828,15 +36831,13 @@ const inputTypeComponent$1 = {
|
|
|
36828
36831
|
if (groupFormId) {
|
|
36829
36832
|
if (typeof value === "string" || typeof value === "undefined") {
|
|
36830
36833
|
value = typeof value === "string" ? dayjs__default["default"].utc(value) : null;
|
|
36831
|
-
const _new = {
|
|
36832
|
-
...(formsValue[groupFormId] || {}),
|
|
36834
|
+
const _new = _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
|
|
36833
36835
|
[name]: value
|
|
36834
|
-
};
|
|
36836
|
+
});
|
|
36835
36837
|
form.setFieldValue(groupFormId, _new);
|
|
36836
|
-
setFormValues({
|
|
36837
|
-
...formsValue,
|
|
36838
|
+
setFormValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
36838
36839
|
[groupFormId]: _new
|
|
36839
|
-
});
|
|
36840
|
+
}));
|
|
36840
36841
|
}
|
|
36841
36842
|
} else {
|
|
36842
36843
|
if (typeof value === "string") {
|
|
@@ -36852,12 +36853,13 @@ const inputTypeComponent$1 = {
|
|
|
36852
36853
|
checkForMax = checkCondition$1(maxRule.condition, repeatValues, formsValue);
|
|
36853
36854
|
}
|
|
36854
36855
|
if (checkForMax) {
|
|
36855
|
-
|
|
36856
|
+
var _value;
|
|
36857
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
|
|
36856
36858
|
size: "large",
|
|
36857
36859
|
allowClear: true,
|
|
36858
|
-
autoComplete: "new-password"
|
|
36859
|
-
|
|
36860
|
-
value: value ? dayjs__default["default"](value
|
|
36860
|
+
autoComplete: "new-password"
|
|
36861
|
+
}, props), {}, {
|
|
36862
|
+
value: value ? dayjs__default["default"]((_value = value) === null || _value === void 0 ? void 0 : _value.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
|
|
36861
36863
|
onChange: handleDateChange,
|
|
36862
36864
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36863
36865
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
@@ -36867,49 +36869,54 @@ const inputTypeComponent$1 = {
|
|
|
36867
36869
|
disabledDate: current => {
|
|
36868
36870
|
return current && current >= dayjs__default["default"]().endOf("day");
|
|
36869
36871
|
}
|
|
36870
|
-
});
|
|
36872
|
+
}));
|
|
36871
36873
|
}
|
|
36872
36874
|
}
|
|
36873
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
36875
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
|
|
36874
36876
|
size: "large",
|
|
36875
36877
|
allowClear: true,
|
|
36876
|
-
autoComplete: "new-password"
|
|
36877
|
-
|
|
36878
|
-
value: value ? dayjs__default["default"](value
|
|
36878
|
+
autoComplete: "new-password"
|
|
36879
|
+
}, props), {}, {
|
|
36880
|
+
value: value ? dayjs__default["default"]((_value2 = value) === null || _value2 === void 0 ? void 0 : _value2.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
|
|
36879
36881
|
onChange: handleDateChange,
|
|
36880
36882
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36881
36883
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36882
36884
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder,
|
|
36883
36885
|
format: DATE_FORMATS,
|
|
36884
36886
|
locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"]
|
|
36885
|
-
});
|
|
36887
|
+
}));
|
|
36886
36888
|
},
|
|
36887
|
-
groupExpandable: ({
|
|
36888
|
-
|
|
36889
|
-
|
|
36890
|
-
|
|
36891
|
-
|
|
36892
|
-
|
|
36893
|
-
|
|
36894
|
-
|
|
36889
|
+
groupExpandable: (_ref17, _ref18) => {
|
|
36890
|
+
var _formsValue$groupForm2;
|
|
36891
|
+
let {
|
|
36892
|
+
formsValue,
|
|
36893
|
+
name,
|
|
36894
|
+
input
|
|
36895
|
+
} = _ref17;
|
|
36896
|
+
let {
|
|
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];
|
|
36895
36900
|
return /*#__PURE__*/jsxRuntime.jsx(GroupExpandable, {
|
|
36896
36901
|
input: input,
|
|
36897
36902
|
formsValue: formsValue,
|
|
36898
36903
|
data: data
|
|
36899
36904
|
});
|
|
36900
36905
|
},
|
|
36901
|
-
comment: ({
|
|
36902
|
-
|
|
36903
|
-
|
|
36904
|
-
|
|
36905
|
-
|
|
36906
|
-
|
|
36907
|
-
|
|
36908
|
-
|
|
36909
|
-
|
|
36910
|
-
|
|
36911
|
-
|
|
36912
|
-
|
|
36906
|
+
comment: (_ref19, _ref20) => {
|
|
36907
|
+
let {
|
|
36908
|
+
props: {
|
|
36909
|
+
placeholder
|
|
36910
|
+
},
|
|
36911
|
+
commentHint
|
|
36912
|
+
} = _ref19,
|
|
36913
|
+
props = _objectWithoutProperties(_ref19.props, _excluded$i);
|
|
36914
|
+
let {
|
|
36915
|
+
onChange,
|
|
36916
|
+
value,
|
|
36917
|
+
isHighlighted
|
|
36918
|
+
} = _ref20;
|
|
36919
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
|
|
36913
36920
|
allowClear: true,
|
|
36914
36921
|
value: value,
|
|
36915
36922
|
onChange: e => onChange(e.target.value),
|
|
@@ -36920,26 +36927,27 @@ const inputTypeComponent$1 = {
|
|
|
36920
36927
|
autoSize: {
|
|
36921
36928
|
minRows: 5,
|
|
36922
36929
|
maxRows: 5
|
|
36923
|
-
}
|
|
36924
|
-
|
|
36930
|
+
}
|
|
36931
|
+
}, props), {}, {
|
|
36925
36932
|
disabled: false
|
|
36926
|
-
});
|
|
36933
|
+
}));
|
|
36927
36934
|
},
|
|
36928
|
-
tableComment: ({
|
|
36929
|
-
|
|
36930
|
-
|
|
36931
|
-
|
|
36932
|
-
|
|
36933
|
-
|
|
36934
|
-
|
|
36935
|
-
|
|
36936
|
-
|
|
36937
|
-
|
|
36938
|
-
|
|
36939
|
-
|
|
36935
|
+
tableComment: (_ref21, _ref22) => {
|
|
36936
|
+
var _formsValue$meta3;
|
|
36937
|
+
let {
|
|
36938
|
+
setValues,
|
|
36939
|
+
name,
|
|
36940
|
+
onValuesChange,
|
|
36941
|
+
formsValue
|
|
36942
|
+
} = _ref21;
|
|
36943
|
+
let {
|
|
36944
|
+
form,
|
|
36945
|
+
groupFormId,
|
|
36946
|
+
isHighlighted
|
|
36947
|
+
} = _ref22;
|
|
36948
|
+
const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => _objectSpread2(_objectSpread2({}, v), {}, {
|
|
36940
36949
|
key: i
|
|
36941
|
-
})) : (formsValue[name] || []).map((v, i) => ({
|
|
36942
|
-
...v,
|
|
36950
|
+
})) : (formsValue[name] || []).map((v, i) => _objectSpread2(_objectSpread2({}, v), {}, {
|
|
36943
36951
|
key: i
|
|
36944
36952
|
}));
|
|
36945
36953
|
const onUpdate = (val, i) => {
|
|
@@ -36947,121 +36955,89 @@ const inputTypeComponent$1 = {
|
|
|
36947
36955
|
[name]: formData.map((d, j) => i === j ? val : d)
|
|
36948
36956
|
};
|
|
36949
36957
|
if (groupFormId) {
|
|
36950
|
-
const _defaultData = form
|
|
36951
|
-
const _newData = {
|
|
36952
|
-
|
|
36953
|
-
..._val
|
|
36954
|
-
};
|
|
36955
|
-
onValuesChange(_newData, {
|
|
36956
|
-
...formsValue,
|
|
36958
|
+
const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
|
|
36959
|
+
const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
|
|
36960
|
+
onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
36957
36961
|
[groupFormId]: _newData
|
|
36958
|
-
});
|
|
36959
|
-
form
|
|
36960
|
-
setValues({
|
|
36961
|
-
...formsValue,
|
|
36962
|
+
}));
|
|
36963
|
+
form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
|
|
36964
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
36962
36965
|
[groupFormId]: _newData
|
|
36963
|
-
});
|
|
36966
|
+
}));
|
|
36964
36967
|
return;
|
|
36965
36968
|
}
|
|
36966
|
-
onValuesChange(_val, {
|
|
36967
|
-
|
|
36968
|
-
|
|
36969
|
-
});
|
|
36970
|
-
form?.setFieldValue(name, _val[name]);
|
|
36971
|
-
setValues({
|
|
36972
|
-
...formsValue,
|
|
36973
|
-
..._val
|
|
36974
|
-
});
|
|
36969
|
+
onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
36970
|
+
form === null || form === void 0 || form.setFieldValue(name, _val[name]);
|
|
36971
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
36975
36972
|
};
|
|
36976
36973
|
return /*#__PURE__*/jsxRuntime.jsx(Comment, {
|
|
36977
36974
|
onUpdate: onUpdate,
|
|
36978
36975
|
isHighlighted: isHighlighted,
|
|
36979
36976
|
form: form,
|
|
36980
|
-
values: groupFormId ? {
|
|
36981
|
-
...(formsValue[groupFormId] || {}),
|
|
36977
|
+
values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
|
|
36982
36978
|
meta: {
|
|
36983
|
-
inputs: (formsValue
|
|
36979
|
+
inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta3 = formsValue.meta) === null || _formsValue$meta3 === void 0 ? void 0 : _formsValue$meta3.inputs) || {})[groupFormId]
|
|
36984
36980
|
}
|
|
36985
|
-
} : formsValue,
|
|
36981
|
+
}) : formsValue,
|
|
36986
36982
|
name: name,
|
|
36987
|
-
remove:
|
|
36988
|
-
|
|
36989
|
-
|
|
36983
|
+
remove: _ref23 => {
|
|
36984
|
+
let {
|
|
36985
|
+
key
|
|
36986
|
+
} = _ref23;
|
|
36990
36987
|
const _val = {
|
|
36991
36988
|
[name]: formData.filter(v => v.key !== key)
|
|
36992
36989
|
};
|
|
36993
36990
|
if (groupFormId) {
|
|
36994
|
-
const _defaultData = form
|
|
36995
|
-
const _newData = {
|
|
36996
|
-
|
|
36997
|
-
..._val
|
|
36998
|
-
};
|
|
36999
|
-
onValuesChange(_newData, {
|
|
37000
|
-
...formsValue,
|
|
36991
|
+
const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
|
|
36992
|
+
const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
|
|
36993
|
+
onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
37001
36994
|
[groupFormId]: _newData
|
|
37002
|
-
});
|
|
37003
|
-
form
|
|
37004
|
-
setValues({
|
|
37005
|
-
...formsValue,
|
|
36995
|
+
}));
|
|
36996
|
+
form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
|
|
36997
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
37006
36998
|
[groupFormId]: _newData
|
|
37007
|
-
});
|
|
36999
|
+
}));
|
|
37008
37000
|
return;
|
|
37009
37001
|
}
|
|
37010
|
-
onValuesChange(_val, {
|
|
37011
|
-
|
|
37012
|
-
|
|
37013
|
-
});
|
|
37014
|
-
form?.setFieldValue(name, _val[name]);
|
|
37015
|
-
setValues({
|
|
37016
|
-
...formsValue,
|
|
37017
|
-
..._val
|
|
37018
|
-
});
|
|
37002
|
+
onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
37003
|
+
form === null || form === void 0 || form.setFieldValue(name, _val[name]);
|
|
37004
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
37019
37005
|
},
|
|
37020
37006
|
add: val => {
|
|
37021
37007
|
const _val = {
|
|
37022
|
-
[name]: [...formData, {
|
|
37023
|
-
...val,
|
|
37008
|
+
[name]: [...formData, _objectSpread2(_objectSpread2({}, val), {}, {
|
|
37024
37009
|
key: formData.length
|
|
37025
|
-
}]
|
|
37010
|
+
})]
|
|
37026
37011
|
};
|
|
37027
37012
|
if (groupFormId) {
|
|
37028
|
-
const _defaultData = form
|
|
37029
|
-
const _newData = {
|
|
37030
|
-
|
|
37031
|
-
|
|
37032
|
-
};
|
|
37033
|
-
form?.setFieldValue(groupFormId, _newData);
|
|
37034
|
-
onValuesChange(_newData, {
|
|
37035
|
-
...formsValue,
|
|
37013
|
+
const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
|
|
37014
|
+
const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
|
|
37015
|
+
form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
|
|
37016
|
+
onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
37036
37017
|
[groupFormId]: _newData
|
|
37037
|
-
});
|
|
37038
|
-
setValues({
|
|
37039
|
-
...formsValue,
|
|
37018
|
+
}));
|
|
37019
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
37040
37020
|
[groupFormId]: _newData
|
|
37041
|
-
});
|
|
37021
|
+
}));
|
|
37042
37022
|
return;
|
|
37043
37023
|
}
|
|
37044
|
-
form
|
|
37045
|
-
onValuesChange(_val, {
|
|
37046
|
-
|
|
37047
|
-
..._val
|
|
37048
|
-
});
|
|
37049
|
-
setValues({
|
|
37050
|
-
...formsValue,
|
|
37051
|
-
..._val
|
|
37052
|
-
});
|
|
37024
|
+
form === null || form === void 0 || form.setFieldValue(name, _val[name]);
|
|
37025
|
+
onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
37026
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
37053
37027
|
},
|
|
37054
37028
|
k: name
|
|
37055
37029
|
});
|
|
37056
37030
|
},
|
|
37057
|
-
textarea: ({
|
|
37058
|
-
|
|
37059
|
-
|
|
37060
|
-
|
|
37061
|
-
|
|
37062
|
-
|
|
37063
|
-
|
|
37064
|
-
|
|
37031
|
+
textarea: (_ref24, _ref25) => {
|
|
37032
|
+
let {
|
|
37033
|
+
props,
|
|
37034
|
+
rules
|
|
37035
|
+
} = _ref24;
|
|
37036
|
+
let {
|
|
37037
|
+
inputMeta,
|
|
37038
|
+
t,
|
|
37039
|
+
isHighlighted
|
|
37040
|
+
} = _ref25;
|
|
37065
37041
|
const maxRule = rules.find(r => r.max);
|
|
37066
37042
|
let maxLength = MAX_TEXT_AREA_LENGTH;
|
|
37067
37043
|
let rows = 5;
|
|
@@ -37088,7 +37064,7 @@ const inputTypeComponent$1 = {
|
|
|
37088
37064
|
// rows = 14;
|
|
37089
37065
|
// }
|
|
37090
37066
|
}
|
|
37091
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
|
|
37067
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
|
|
37092
37068
|
allowClear: true,
|
|
37093
37069
|
autoComplete: "new-password",
|
|
37094
37070
|
maxLength: maxLength,
|
|
@@ -37096,35 +37072,37 @@ const inputTypeComponent$1 = {
|
|
|
37096
37072
|
autoSize: {
|
|
37097
37073
|
minRows: rows,
|
|
37098
37074
|
maxRows: rows
|
|
37099
|
-
}
|
|
37100
|
-
|
|
37075
|
+
}
|
|
37076
|
+
}, props), {}, {
|
|
37101
37077
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
37102
37078
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
37103
|
-
});
|
|
37079
|
+
}));
|
|
37104
37080
|
},
|
|
37105
|
-
phoneNumber: ({
|
|
37106
|
-
|
|
37107
|
-
|
|
37108
|
-
|
|
37109
|
-
|
|
37110
|
-
|
|
37111
|
-
|
|
37112
|
-
|
|
37113
|
-
|
|
37114
|
-
|
|
37115
|
-
|
|
37116
|
-
|
|
37117
|
-
|
|
37118
|
-
|
|
37119
|
-
|
|
37081
|
+
phoneNumber: (_ref26, _ref27) => {
|
|
37082
|
+
let {
|
|
37083
|
+
name,
|
|
37084
|
+
inputName,
|
|
37085
|
+
props,
|
|
37086
|
+
value,
|
|
37087
|
+
repeatIndex,
|
|
37088
|
+
repeatValues,
|
|
37089
|
+
formsValue
|
|
37090
|
+
} = _ref26;
|
|
37091
|
+
let {
|
|
37092
|
+
setFormValues,
|
|
37093
|
+
inputMeta,
|
|
37094
|
+
t,
|
|
37095
|
+
isHighlighted
|
|
37096
|
+
} = _ref27;
|
|
37097
|
+
return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, _objectSpread2(_objectSpread2({
|
|
37120
37098
|
customSelectWidthPercentage: "20%",
|
|
37121
37099
|
t: t,
|
|
37122
37100
|
size: "large",
|
|
37123
37101
|
allowClear: true,
|
|
37124
|
-
country: formsValue
|
|
37102
|
+
country: formsValue === null || formsValue === void 0 ? void 0 : formsValue.country,
|
|
37125
37103
|
initialValue: value,
|
|
37126
|
-
name: name
|
|
37127
|
-
|
|
37104
|
+
name: name
|
|
37105
|
+
}, props), {}, {
|
|
37128
37106
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37129
37107
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
37130
37108
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type Number"),
|
|
@@ -37145,26 +37123,27 @@ const inputTypeComponent$1 = {
|
|
|
37145
37123
|
}
|
|
37146
37124
|
return val;
|
|
37147
37125
|
}
|
|
37148
|
-
});
|
|
37126
|
+
}));
|
|
37149
37127
|
},
|
|
37150
|
-
switch: ({
|
|
37151
|
-
|
|
37152
|
-
|
|
37153
|
-
|
|
37154
|
-
|
|
37155
|
-
|
|
37156
|
-
|
|
37157
|
-
|
|
37158
|
-
|
|
37159
|
-
|
|
37160
|
-
|
|
37161
|
-
|
|
37162
|
-
|
|
37163
|
-
|
|
37164
|
-
|
|
37165
|
-
|
|
37166
|
-
|
|
37167
|
-
|
|
37128
|
+
switch: (_ref28, _ref29) => {
|
|
37129
|
+
let {
|
|
37130
|
+
props,
|
|
37131
|
+
value,
|
|
37132
|
+
restricted,
|
|
37133
|
+
autocomplete,
|
|
37134
|
+
formsValue,
|
|
37135
|
+
repeatValues,
|
|
37136
|
+
repeatIndex,
|
|
37137
|
+
name,
|
|
37138
|
+
inputName,
|
|
37139
|
+
replace: replaceInput,
|
|
37140
|
+
unique
|
|
37141
|
+
} = _ref28;
|
|
37142
|
+
let {
|
|
37143
|
+
form,
|
|
37144
|
+
isHighlighted
|
|
37145
|
+
} = _ref29;
|
|
37146
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
37168
37147
|
size: "default",
|
|
37169
37148
|
defaultChecked: value || false,
|
|
37170
37149
|
checked: value || false,
|
|
@@ -37192,9 +37171,7 @@ const inputTypeComponent$1 = {
|
|
|
37192
37171
|
const [formName, replaceInputName] = replaceTo.split(".");
|
|
37193
37172
|
const replaceRepeatValues = replaceInputName ? dot__default["default"].pick(formName, formsValue) : undefined;
|
|
37194
37173
|
updateFormValues$1(undefined, replaceRepeatValues, replaceInputName, isChecked ? newId : undefined, formsValue, formName, form);
|
|
37195
|
-
formsValue = Object.assign(formsValue, {
|
|
37196
|
-
...form.getFieldsValue(true)
|
|
37197
|
-
});
|
|
37174
|
+
formsValue = Object.assign(formsValue, _objectSpread2({}, form.getFieldsValue(true)));
|
|
37198
37175
|
if (oldId) {
|
|
37199
37176
|
const allRepeatValues = dot__default["default"].pick(name, formsValue);
|
|
37200
37177
|
if (allRepeatValues && Array.isArray(allRepeatValues)) {
|
|
@@ -37235,20 +37212,22 @@ const inputTypeComponent$1 = {
|
|
|
37235
37212
|
}
|
|
37236
37213
|
}
|
|
37237
37214
|
}
|
|
37238
|
-
});
|
|
37215
|
+
}));
|
|
37239
37216
|
},
|
|
37240
|
-
radioGroup: ({
|
|
37241
|
-
|
|
37242
|
-
|
|
37243
|
-
|
|
37244
|
-
|
|
37245
|
-
|
|
37246
|
-
|
|
37247
|
-
|
|
37217
|
+
radioGroup: (_ref30, _ref31) => {
|
|
37218
|
+
let {
|
|
37219
|
+
props,
|
|
37220
|
+
value,
|
|
37221
|
+
options,
|
|
37222
|
+
isRisk
|
|
37223
|
+
} = _ref30;
|
|
37224
|
+
let {
|
|
37225
|
+
isHighlighted
|
|
37226
|
+
} = _ref31;
|
|
37248
37227
|
if (isRisk) {
|
|
37249
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
|
|
37250
|
-
value: value
|
|
37251
|
-
|
|
37228
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, _objectSpread2(_objectSpread2({
|
|
37229
|
+
value: value
|
|
37230
|
+
}, props), {}, {
|
|
37252
37231
|
className: "is-risk-radio",
|
|
37253
37232
|
children: (options || []).map(o => {
|
|
37254
37233
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
|
|
@@ -37262,11 +37241,11 @@ const inputTypeComponent$1 = {
|
|
|
37262
37241
|
}) : null]
|
|
37263
37242
|
}, o.value);
|
|
37264
37243
|
})
|
|
37265
|
-
});
|
|
37244
|
+
}));
|
|
37266
37245
|
}
|
|
37267
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
|
|
37268
|
-
value: value
|
|
37269
|
-
|
|
37246
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, _objectSpread2(_objectSpread2({
|
|
37247
|
+
value: value
|
|
37248
|
+
}, props), {}, {
|
|
37270
37249
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37271
37250
|
children: (options || []).map(o => {
|
|
37272
37251
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
|
|
@@ -37280,18 +37259,20 @@ const inputTypeComponent$1 = {
|
|
|
37280
37259
|
}) : null]
|
|
37281
37260
|
}, o.value);
|
|
37282
37261
|
})
|
|
37283
|
-
});
|
|
37262
|
+
}));
|
|
37284
37263
|
},
|
|
37285
|
-
checkboxGroup: ({
|
|
37286
|
-
|
|
37287
|
-
|
|
37288
|
-
|
|
37289
|
-
|
|
37290
|
-
|
|
37291
|
-
|
|
37292
|
-
|
|
37293
|
-
|
|
37294
|
-
|
|
37264
|
+
checkboxGroup: (_ref32, _ref33) => {
|
|
37265
|
+
let {
|
|
37266
|
+
props,
|
|
37267
|
+
value,
|
|
37268
|
+
options
|
|
37269
|
+
} = _ref32;
|
|
37270
|
+
let {
|
|
37271
|
+
isHighlighted
|
|
37272
|
+
} = _ref33;
|
|
37273
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, _objectSpread2(_objectSpread2({
|
|
37274
|
+
value: value
|
|
37275
|
+
}, props), {}, {
|
|
37295
37276
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37296
37277
|
style: {
|
|
37297
37278
|
display: "grid",
|
|
@@ -37315,16 +37296,18 @@ const inputTypeComponent$1 = {
|
|
|
37315
37296
|
}) : null]
|
|
37316
37297
|
}, o.value);
|
|
37317
37298
|
})
|
|
37318
|
-
});
|
|
37299
|
+
}));
|
|
37319
37300
|
},
|
|
37320
|
-
total100: ({
|
|
37321
|
-
|
|
37322
|
-
|
|
37323
|
-
|
|
37324
|
-
|
|
37325
|
-
|
|
37326
|
-
|
|
37327
|
-
|
|
37301
|
+
total100: (_ref34, _ref35) => {
|
|
37302
|
+
let {
|
|
37303
|
+
props,
|
|
37304
|
+
name,
|
|
37305
|
+
options,
|
|
37306
|
+
value
|
|
37307
|
+
} = _ref34;
|
|
37308
|
+
let {
|
|
37309
|
+
isHighlighted
|
|
37310
|
+
} = _ref35;
|
|
37328
37311
|
value = value ? Array.isArray(value) ? value : [value] : [];
|
|
37329
37312
|
function totalValue() {
|
|
37330
37313
|
let total = 0;
|
|
@@ -37348,10 +37331,11 @@ const inputTypeComponent$1 = {
|
|
|
37348
37331
|
className: formatClassname(["total100", isHighlighted && "highlighted-input"]),
|
|
37349
37332
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
|
|
37350
37333
|
name: name,
|
|
37351
|
-
children: (fields, {
|
|
37352
|
-
|
|
37353
|
-
|
|
37354
|
-
|
|
37334
|
+
children: (fields, _ref36) => {
|
|
37335
|
+
let {
|
|
37336
|
+
add,
|
|
37337
|
+
remove
|
|
37338
|
+
} = _ref36;
|
|
37355
37339
|
if (fields.length === 0) {
|
|
37356
37340
|
const formData = value || [];
|
|
37357
37341
|
if (formData.length) {
|
|
@@ -37370,27 +37354,27 @@ const inputTypeComponent$1 = {
|
|
|
37370
37354
|
const v = value[field.name] || {};
|
|
37371
37355
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Space, {
|
|
37372
37356
|
className: "total",
|
|
37373
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
37374
|
-
noStyle: true
|
|
37375
|
-
|
|
37357
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
|
|
37358
|
+
noStyle: true
|
|
37359
|
+
}, field), {}, {
|
|
37376
37360
|
name: [field.name, "type"],
|
|
37377
37361
|
fieldKey: [field.fieldKey, "type"],
|
|
37378
37362
|
initialValue: v.type || null,
|
|
37379
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
37363
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
|
|
37380
37364
|
size: "large",
|
|
37381
37365
|
allowClear: true,
|
|
37382
37366
|
showSearch: true,
|
|
37383
37367
|
filterOption: filterSelectOptions,
|
|
37384
|
-
optionFilterProp: "children"
|
|
37385
|
-
|
|
37368
|
+
optionFilterProp: "children"
|
|
37369
|
+
}, props), {}, {
|
|
37386
37370
|
children: options.map((option, i) => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
37387
37371
|
value: option.value,
|
|
37388
37372
|
children: option.label
|
|
37389
37373
|
}, i))
|
|
37390
|
-
})
|
|
37391
|
-
}), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
37392
|
-
noStyle: true
|
|
37393
|
-
|
|
37374
|
+
}))
|
|
37375
|
+
})), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
|
|
37376
|
+
noStyle: true
|
|
37377
|
+
}, field), {}, {
|
|
37394
37378
|
name: [field.name, "value"],
|
|
37395
37379
|
fieldKey: [field.fieldKey, "value"],
|
|
37396
37380
|
initialValue: v.value,
|
|
@@ -37399,14 +37383,14 @@ const inputTypeComponent$1 = {
|
|
|
37399
37383
|
allowClear: true,
|
|
37400
37384
|
name: "value",
|
|
37401
37385
|
formatter: value => {
|
|
37402
|
-
return value ?
|
|
37386
|
+
return value ? "".concat(value, "%") : "";
|
|
37403
37387
|
},
|
|
37404
37388
|
disabled: !v.type || null,
|
|
37405
37389
|
placeholder: props.valueplaceholder ? props.valueplaceholder : "Value",
|
|
37406
37390
|
min: 1,
|
|
37407
37391
|
max: 100 - siblingTotal(v.type || 0)
|
|
37408
37392
|
})
|
|
37409
|
-
}), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
37393
|
+
})), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
37410
37394
|
disabled: !v.value || !v.type || totalValue() >= 100,
|
|
37411
37395
|
type: "primary",
|
|
37412
37396
|
icon: /*#__PURE__*/jsxRuntime.jsx(Icons.PlusOutlined, {}),
|
|
@@ -37438,19 +37422,22 @@ const inputTypeComponent$1 = {
|
|
|
37438
37422
|
}) : null]
|
|
37439
37423
|
});
|
|
37440
37424
|
},
|
|
37441
|
-
percentage: ({
|
|
37442
|
-
|
|
37443
|
-
|
|
37444
|
-
|
|
37445
|
-
|
|
37446
|
-
|
|
37447
|
-
|
|
37448
|
-
|
|
37449
|
-
|
|
37450
|
-
|
|
37451
|
-
|
|
37452
|
-
|
|
37453
|
-
|
|
37425
|
+
percentage: (_ref37, _ref38) => {
|
|
37426
|
+
var _input$meta11;
|
|
37427
|
+
let {
|
|
37428
|
+
name,
|
|
37429
|
+
inputName,
|
|
37430
|
+
totalMax,
|
|
37431
|
+
repeatIndex,
|
|
37432
|
+
props,
|
|
37433
|
+
formsValue,
|
|
37434
|
+
input
|
|
37435
|
+
} = _ref37;
|
|
37436
|
+
let {
|
|
37437
|
+
inputMeta,
|
|
37438
|
+
t,
|
|
37439
|
+
isHighlighted
|
|
37440
|
+
} = _ref38;
|
|
37454
37441
|
const isRepeatable = Array.isArray(formsValue[name]);
|
|
37455
37442
|
let totalSiblings = 0;
|
|
37456
37443
|
if (isRepeatable && totalMax) {
|
|
@@ -37458,45 +37445,47 @@ const inputTypeComponent$1 = {
|
|
|
37458
37445
|
totl = totl + (grp[inputName] || 0);
|
|
37459
37446
|
return totl;
|
|
37460
37447
|
}, 0);
|
|
37461
|
-
} else if (Array.isArray(input
|
|
37448
|
+
} else if (Array.isArray(input === null || input === void 0 || (_input$meta11 = input.meta) === null || _input$meta11 === void 0 ? void 0 : _input$meta11.siblings)) {
|
|
37462
37449
|
totalSiblings = input.meta.siblings.reduce((totl, key) => {
|
|
37463
37450
|
totl = totl + (formsValue[key] || 0);
|
|
37464
37451
|
return totl;
|
|
37465
37452
|
}, 0);
|
|
37466
37453
|
}
|
|
37467
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
37454
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
|
|
37468
37455
|
size: "large",
|
|
37469
|
-
allowClear: true
|
|
37470
|
-
|
|
37456
|
+
allowClear: true
|
|
37457
|
+
}, props), {}, {
|
|
37471
37458
|
className: formatClassname([isHighlighted && "highlighted-cont"]),
|
|
37472
37459
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
37473
37460
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
|
|
37474
37461
|
min: 0,
|
|
37475
37462
|
max: 100 - totalSiblings,
|
|
37476
37463
|
formatter: value => {
|
|
37477
|
-
return value ?
|
|
37464
|
+
return value ? "".concat(value) : "";
|
|
37478
37465
|
},
|
|
37479
37466
|
parser: value => value.replace("%", ""),
|
|
37480
37467
|
addonAfter: "%"
|
|
37481
|
-
});
|
|
37468
|
+
}));
|
|
37482
37469
|
},
|
|
37483
|
-
drawTerritory: ({
|
|
37484
|
-
|
|
37485
|
-
|
|
37486
|
-
|
|
37487
|
-
|
|
37488
|
-
|
|
37489
|
-
|
|
37470
|
+
drawTerritory: (_ref39, _ref40) => {
|
|
37471
|
+
let {
|
|
37472
|
+
formsValue,
|
|
37473
|
+
name,
|
|
37474
|
+
addressData
|
|
37475
|
+
} = _ref39;
|
|
37476
|
+
let {
|
|
37477
|
+
setFormValues
|
|
37478
|
+
} = _ref40;
|
|
37490
37479
|
let search = formsValue.country;
|
|
37491
37480
|
if (addressData && addressData.address && Object.keys(addressData.address).length > 0) {
|
|
37492
37481
|
if (addressData.address.country) {
|
|
37493
37482
|
search = addressData.address.country;
|
|
37494
37483
|
}
|
|
37495
37484
|
if (addressData.address.level1) {
|
|
37496
|
-
search =
|
|
37485
|
+
search = "".concat(addressData.address.level1, ", ").concat(addressData.address.country);
|
|
37497
37486
|
}
|
|
37498
37487
|
if (addressData.address.level2) {
|
|
37499
|
-
search =
|
|
37488
|
+
search = "".concat(addressData.address.level2, ", ").concat(addressData.address.level1, ", ").concat(addressData.address.country);
|
|
37500
37489
|
}
|
|
37501
37490
|
} else {
|
|
37502
37491
|
const country = countriesList.countries[formsValue.country] || {};
|
|
@@ -37504,10 +37493,10 @@ const inputTypeComponent$1 = {
|
|
|
37504
37493
|
search = country.name;
|
|
37505
37494
|
}
|
|
37506
37495
|
if (formsValue.administrativeLevel1Name) {
|
|
37507
|
-
search =
|
|
37496
|
+
search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
|
|
37508
37497
|
}
|
|
37509
37498
|
if (formsValue.administrativeLevel2Name) {
|
|
37510
|
-
search =
|
|
37499
|
+
search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
|
|
37511
37500
|
}
|
|
37512
37501
|
}
|
|
37513
37502
|
return /*#__PURE__*/jsxRuntime.jsx(PolygonSelector, {
|
|
@@ -37519,32 +37508,36 @@ const inputTypeComponent$1 = {
|
|
|
37519
37508
|
searchValue: search
|
|
37520
37509
|
});
|
|
37521
37510
|
},
|
|
37522
|
-
year: ({
|
|
37523
|
-
|
|
37524
|
-
|
|
37525
|
-
|
|
37526
|
-
|
|
37511
|
+
year: (_ref41, _ref42) => {
|
|
37512
|
+
let {
|
|
37513
|
+
props
|
|
37514
|
+
} = _ref41;
|
|
37515
|
+
let {
|
|
37516
|
+
isHighlighted
|
|
37517
|
+
} = _ref42;
|
|
37527
37518
|
const lng = localStorage.getItem("datastakeLng") || "en";
|
|
37528
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
37519
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
|
|
37529
37520
|
size: "large",
|
|
37530
37521
|
allowClear: true,
|
|
37531
37522
|
locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
|
|
37532
|
-
picker: "year"
|
|
37533
|
-
|
|
37523
|
+
picker: "year"
|
|
37524
|
+
}, props), {}, {
|
|
37534
37525
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37535
37526
|
format: "YYYY"
|
|
37536
|
-
});
|
|
37527
|
+
}));
|
|
37537
37528
|
},
|
|
37538
|
-
upload: ({
|
|
37539
|
-
|
|
37540
|
-
|
|
37541
|
-
|
|
37542
|
-
|
|
37543
|
-
|
|
37544
|
-
|
|
37545
|
-
|
|
37546
|
-
|
|
37547
|
-
|
|
37529
|
+
upload: (_ref43, _ref44) => {
|
|
37530
|
+
let {
|
|
37531
|
+
rules,
|
|
37532
|
+
value
|
|
37533
|
+
} = _ref43;
|
|
37534
|
+
let {
|
|
37535
|
+
setLoading = () => {},
|
|
37536
|
+
getApiBaseUrl,
|
|
37537
|
+
getAppHeader,
|
|
37538
|
+
t,
|
|
37539
|
+
isHighlighted
|
|
37540
|
+
} = _ref44;
|
|
37548
37541
|
const apiURL = getApiBaseUrl();
|
|
37549
37542
|
const accept = rules.length ? rules.find(rule => Object.keys(rule).includes("accept")).accept || "*" : null;
|
|
37550
37543
|
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) : []) || [];
|
|
@@ -37557,13 +37550,12 @@ const inputTypeComponent$1 = {
|
|
|
37557
37550
|
maxProps.multiple = true;
|
|
37558
37551
|
}
|
|
37559
37552
|
}
|
|
37560
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37561
|
-
...maxProps,
|
|
37553
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({}, maxProps), {}, {
|
|
37562
37554
|
accept: accept,
|
|
37563
|
-
action:
|
|
37555
|
+
action: "".concat(apiURL, "/upload"),
|
|
37564
37556
|
beforeUpload: beforeUpload(allowedExtensions),
|
|
37565
37557
|
onChange: val => {
|
|
37566
|
-
if (val
|
|
37558
|
+
if (val !== null && val !== void 0 && val.file && typeof setLoading === "function") {
|
|
37567
37559
|
if (val.file.percent !== 100) {
|
|
37568
37560
|
setLoading(true);
|
|
37569
37561
|
} else {
|
|
@@ -37571,10 +37563,9 @@ const inputTypeComponent$1 = {
|
|
|
37571
37563
|
}
|
|
37572
37564
|
}
|
|
37573
37565
|
},
|
|
37574
|
-
headers: {
|
|
37575
|
-
Authorization:
|
|
37576
|
-
|
|
37577
|
-
},
|
|
37566
|
+
headers: _objectSpread2({
|
|
37567
|
+
Authorization: "Bearer ".concat(getToken())
|
|
37568
|
+
}, getAppHeader()),
|
|
37578
37569
|
defaultFileList: values,
|
|
37579
37570
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
37580
37571
|
style: {
|
|
@@ -37585,18 +37576,20 @@ const inputTypeComponent$1 = {
|
|
|
37585
37576
|
children: t("Upload")
|
|
37586
37577
|
})]
|
|
37587
37578
|
})
|
|
37588
|
-
});
|
|
37579
|
+
}));
|
|
37589
37580
|
},
|
|
37590
|
-
imageUpload: ({
|
|
37591
|
-
|
|
37592
|
-
|
|
37593
|
-
|
|
37594
|
-
|
|
37595
|
-
|
|
37596
|
-
|
|
37597
|
-
|
|
37598
|
-
|
|
37599
|
-
|
|
37581
|
+
imageUpload: (_ref45, _ref46) => {
|
|
37582
|
+
let {
|
|
37583
|
+
rules,
|
|
37584
|
+
value
|
|
37585
|
+
} = _ref45;
|
|
37586
|
+
let {
|
|
37587
|
+
setLoading = () => {},
|
|
37588
|
+
getApiBaseUrl,
|
|
37589
|
+
getAppHeader,
|
|
37590
|
+
t,
|
|
37591
|
+
isHighlighted
|
|
37592
|
+
} = _ref46;
|
|
37600
37593
|
const apiURL = getApiBaseUrl();
|
|
37601
37594
|
const values = getImageUploadEditValue(value);
|
|
37602
37595
|
const maxRule = rules.find(r => r.max);
|
|
@@ -37607,17 +37600,18 @@ const inputTypeComponent$1 = {
|
|
|
37607
37600
|
maxProps.multiple = true;
|
|
37608
37601
|
}
|
|
37609
37602
|
}
|
|
37610
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37611
|
-
beforeUpload: beforeUpload(allowedImageExtensions)
|
|
37612
|
-
|
|
37603
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({
|
|
37604
|
+
beforeUpload: beforeUpload(allowedImageExtensions)
|
|
37605
|
+
}, maxProps), {}, {
|
|
37613
37606
|
accept: "image/*",
|
|
37614
37607
|
classList: !values || !values.length ? "empty" : "",
|
|
37615
37608
|
listType: "picture",
|
|
37616
|
-
action:
|
|
37609
|
+
action: "".concat(apiURL, "/upload"),
|
|
37617
37610
|
onChange: val => {
|
|
37618
37611
|
if (typeof setLoading === "function") {
|
|
37619
|
-
if (val
|
|
37620
|
-
|
|
37612
|
+
if (val !== null && val !== void 0 && val.file) {
|
|
37613
|
+
var _val$file;
|
|
37614
|
+
if ((val === null || val === void 0 || (_val$file = val.file) === null || _val$file === void 0 ? void 0 : _val$file.status) === "removed") {
|
|
37621
37615
|
setLoading(false);
|
|
37622
37616
|
return;
|
|
37623
37617
|
}
|
|
@@ -37629,10 +37623,9 @@ const inputTypeComponent$1 = {
|
|
|
37629
37623
|
setLoading(false);
|
|
37630
37624
|
}
|
|
37631
37625
|
},
|
|
37632
|
-
headers: {
|
|
37633
|
-
Authorization:
|
|
37634
|
-
|
|
37635
|
-
},
|
|
37626
|
+
headers: _objectSpread2({
|
|
37627
|
+
Authorization: "Bearer ".concat(getToken())
|
|
37628
|
+
}, getAppHeader()),
|
|
37636
37629
|
defaultFileList: values,
|
|
37637
37630
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
37638
37631
|
style: {
|
|
@@ -37643,18 +37636,20 @@ const inputTypeComponent$1 = {
|
|
|
37643
37636
|
children: t("Upload")
|
|
37644
37637
|
})]
|
|
37645
37638
|
})
|
|
37646
|
-
});
|
|
37639
|
+
}));
|
|
37647
37640
|
},
|
|
37648
|
-
videoUpload: ({
|
|
37649
|
-
|
|
37650
|
-
|
|
37651
|
-
|
|
37652
|
-
|
|
37653
|
-
|
|
37654
|
-
|
|
37655
|
-
|
|
37656
|
-
|
|
37657
|
-
|
|
37641
|
+
videoUpload: (_ref47, _ref48) => {
|
|
37642
|
+
let {
|
|
37643
|
+
rules,
|
|
37644
|
+
value
|
|
37645
|
+
} = _ref47;
|
|
37646
|
+
let {
|
|
37647
|
+
setLoading = () => {},
|
|
37648
|
+
getApiBaseUrl,
|
|
37649
|
+
getAppHeader,
|
|
37650
|
+
t,
|
|
37651
|
+
isHighlighted
|
|
37652
|
+
} = _ref48;
|
|
37658
37653
|
const apiURL = getApiBaseUrl();
|
|
37659
37654
|
const values = getImageUploadEditValue(value);
|
|
37660
37655
|
const maxRule = rules.find(r => r.max);
|
|
@@ -37665,21 +37660,25 @@ const inputTypeComponent$1 = {
|
|
|
37665
37660
|
maxProps.multiple = true;
|
|
37666
37661
|
}
|
|
37667
37662
|
}
|
|
37668
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37669
|
-
itemRender: (item, fileList) =>
|
|
37670
|
-
|
|
37671
|
-
|
|
37672
|
-
|
|
37673
|
-
|
|
37674
|
-
|
|
37663
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({
|
|
37664
|
+
itemRender: (item, fileList) => {
|
|
37665
|
+
var _fileList$response;
|
|
37666
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
37667
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
|
|
37668
|
+
url: (fileList === null || fileList === void 0 || (_fileList$response = fileList.response) === null || _fileList$response === void 0 ? void 0 : _fileList$response.url) || (fileList === null || fileList === void 0 ? void 0 : fileList.url)
|
|
37669
|
+
}), item]
|
|
37670
|
+
});
|
|
37671
|
+
}
|
|
37672
|
+
}, maxProps), {}, {
|
|
37675
37673
|
accept: "video/*",
|
|
37676
37674
|
classList: !values || !values.length ? "empty" : "",
|
|
37677
37675
|
listType: "picture",
|
|
37678
|
-
action:
|
|
37676
|
+
action: "".concat(apiURL, "/upload"),
|
|
37679
37677
|
onChange: val => {
|
|
37680
37678
|
if (typeof setLoading === "function") {
|
|
37681
|
-
if (val
|
|
37682
|
-
|
|
37679
|
+
if (val !== null && val !== void 0 && val.file) {
|
|
37680
|
+
var _val$file2;
|
|
37681
|
+
if ((val === null || val === void 0 || (_val$file2 = val.file) === null || _val$file2 === void 0 ? void 0 : _val$file2.status) === "removed") {
|
|
37683
37682
|
setLoading(false);
|
|
37684
37683
|
return;
|
|
37685
37684
|
}
|
|
@@ -37691,10 +37690,9 @@ const inputTypeComponent$1 = {
|
|
|
37691
37690
|
setLoading(false);
|
|
37692
37691
|
}
|
|
37693
37692
|
},
|
|
37694
|
-
headers: {
|
|
37695
|
-
Authorization:
|
|
37696
|
-
|
|
37697
|
-
},
|
|
37693
|
+
headers: _objectSpread2({
|
|
37694
|
+
Authorization: "Bearer ".concat(getToken())
|
|
37695
|
+
}, getAppHeader()),
|
|
37698
37696
|
fileList: values,
|
|
37699
37697
|
defaultFileList: values,
|
|
37700
37698
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
@@ -37706,28 +37704,30 @@ const inputTypeComponent$1 = {
|
|
|
37706
37704
|
children: t("Upload")
|
|
37707
37705
|
})]
|
|
37708
37706
|
})
|
|
37709
|
-
});
|
|
37707
|
+
}));
|
|
37710
37708
|
},
|
|
37711
|
-
geolocation: ({
|
|
37712
|
-
|
|
37713
|
-
|
|
37714
|
-
|
|
37715
|
-
|
|
37716
|
-
|
|
37717
|
-
|
|
37718
|
-
|
|
37719
|
-
|
|
37720
|
-
|
|
37709
|
+
geolocation: (_ref49, _ref50) => {
|
|
37710
|
+
let {
|
|
37711
|
+
value,
|
|
37712
|
+
name,
|
|
37713
|
+
props,
|
|
37714
|
+
formsValue,
|
|
37715
|
+
addressData
|
|
37716
|
+
} = _ref49;
|
|
37717
|
+
let {
|
|
37718
|
+
inputMeta,
|
|
37719
|
+
isHighlighted
|
|
37720
|
+
} = _ref50;
|
|
37721
37721
|
let search = formsValue.country;
|
|
37722
37722
|
if (addressData && Object.keys(addressData).length > 0) {
|
|
37723
37723
|
if (addressData.country) {
|
|
37724
37724
|
search = addressData.country;
|
|
37725
37725
|
}
|
|
37726
37726
|
if (addressData.level1) {
|
|
37727
|
-
search =
|
|
37727
|
+
search = "".concat(addressData.level1, ", ").concat(addressData.country);
|
|
37728
37728
|
}
|
|
37729
37729
|
if (addressData.level2) {
|
|
37730
|
-
search =
|
|
37730
|
+
search = "".concat(addressData.level2, ", ").concat(addressData.level1, ", ").concat(addressData.country);
|
|
37731
37731
|
}
|
|
37732
37732
|
} else {
|
|
37733
37733
|
const country = countriesList.countries[formsValue.country] || {};
|
|
@@ -37735,10 +37735,10 @@ const inputTypeComponent$1 = {
|
|
|
37735
37735
|
search = country.name;
|
|
37736
37736
|
}
|
|
37737
37737
|
if (formsValue.administrativeLevel1Name) {
|
|
37738
|
-
search =
|
|
37738
|
+
search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
|
|
37739
37739
|
}
|
|
37740
37740
|
if (formsValue.administrativeLevel2Name) {
|
|
37741
|
-
search =
|
|
37741
|
+
search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
|
|
37742
37742
|
}
|
|
37743
37743
|
}
|
|
37744
37744
|
return /*#__PURE__*/jsxRuntime.jsx(Geolocation, {
|
|
@@ -37752,34 +37752,36 @@ const inputTypeComponent$1 = {
|
|
|
37752
37752
|
searchValue: search
|
|
37753
37753
|
});
|
|
37754
37754
|
},
|
|
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
|
-
|
|
37755
|
+
ajaxSelect: (_ref51, _ref52) => {
|
|
37756
|
+
let {
|
|
37757
|
+
call,
|
|
37758
|
+
automaticallyLink,
|
|
37759
|
+
name,
|
|
37760
|
+
inputName,
|
|
37761
|
+
props,
|
|
37762
|
+
formsValue,
|
|
37763
|
+
onNewSetValue,
|
|
37764
|
+
multiple,
|
|
37765
|
+
updateOptions,
|
|
37766
|
+
repeatValues,
|
|
37767
|
+
repeatIndex,
|
|
37768
|
+
value,
|
|
37769
|
+
unique,
|
|
37770
|
+
address,
|
|
37771
|
+
addressData = {},
|
|
37772
|
+
getFromLinking,
|
|
37773
|
+
input
|
|
37774
|
+
} = _ref51;
|
|
37775
|
+
let {
|
|
37776
|
+
form,
|
|
37777
|
+
forms,
|
|
37778
|
+
setAddress,
|
|
37779
|
+
changeInputMeta,
|
|
37780
|
+
inputMeta,
|
|
37781
|
+
meta,
|
|
37782
|
+
isHighlighted,
|
|
37783
|
+
groupFormId
|
|
37784
|
+
} = _ref52;
|
|
37783
37785
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect, {
|
|
37784
37786
|
size: "medium",
|
|
37785
37787
|
input: input,
|
|
@@ -37816,9 +37818,7 @@ const inputTypeComponent$1 = {
|
|
|
37816
37818
|
const selectedValue = data.find(v => v.value === ev);
|
|
37817
37819
|
if (address && selectedValue) {
|
|
37818
37820
|
dot__default["default"].str(address, selectedValue.label, addressData);
|
|
37819
|
-
setAddress({
|
|
37820
|
-
...addressData
|
|
37821
|
-
});
|
|
37821
|
+
setAddress(_objectSpread2({}, addressData));
|
|
37822
37822
|
}
|
|
37823
37823
|
}
|
|
37824
37824
|
},
|
|
@@ -37827,10 +37827,11 @@ const inputTypeComponent$1 = {
|
|
|
37827
37827
|
address: true
|
|
37828
37828
|
});
|
|
37829
37829
|
},
|
|
37830
|
-
tag:
|
|
37831
|
-
|
|
37832
|
-
|
|
37833
|
-
|
|
37830
|
+
tag: _ref53 => {
|
|
37831
|
+
let {
|
|
37832
|
+
value,
|
|
37833
|
+
repeatLabel
|
|
37834
|
+
} = _ref53;
|
|
37834
37835
|
return /*#__PURE__*/jsxRuntime.jsx(TagInput, {
|
|
37835
37836
|
size: "large",
|
|
37836
37837
|
allowClear: true,
|
|
@@ -37838,26 +37839,28 @@ const inputTypeComponent$1 = {
|
|
|
37838
37839
|
newPlaceholder: repeatLabel
|
|
37839
37840
|
});
|
|
37840
37841
|
},
|
|
37841
|
-
modal: ({
|
|
37842
|
-
|
|
37843
|
-
|
|
37844
|
-
|
|
37845
|
-
|
|
37846
|
-
|
|
37847
|
-
|
|
37848
|
-
|
|
37849
|
-
|
|
37850
|
-
|
|
37851
|
-
|
|
37852
|
-
|
|
37853
|
-
|
|
37854
|
-
|
|
37855
|
-
|
|
37856
|
-
|
|
37857
|
-
|
|
37858
|
-
|
|
37859
|
-
|
|
37860
|
-
|
|
37842
|
+
modal: (_ref54, _ref55) => {
|
|
37843
|
+
let {
|
|
37844
|
+
call,
|
|
37845
|
+
automaticallyLink,
|
|
37846
|
+
name,
|
|
37847
|
+
inputName,
|
|
37848
|
+
props,
|
|
37849
|
+
formsValue,
|
|
37850
|
+
allFormsValue,
|
|
37851
|
+
onNewSetValue,
|
|
37852
|
+
repeatValues,
|
|
37853
|
+
repeatIndex,
|
|
37854
|
+
value,
|
|
37855
|
+
modalTitle,
|
|
37856
|
+
totalInputs,
|
|
37857
|
+
shownInputs,
|
|
37858
|
+
allowDupplicates
|
|
37859
|
+
} = _ref54;
|
|
37860
|
+
let {
|
|
37861
|
+
form,
|
|
37862
|
+
add
|
|
37863
|
+
} = _ref55;
|
|
37861
37864
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxModal, {
|
|
37862
37865
|
allowClear: true,
|
|
37863
37866
|
call: call,
|
|
@@ -37880,40 +37883,44 @@ const inputTypeComponent$1 = {
|
|
|
37880
37883
|
allowDupplicates: allowDupplicates
|
|
37881
37884
|
});
|
|
37882
37885
|
},
|
|
37883
|
-
dataLink: ({
|
|
37884
|
-
|
|
37885
|
-
|
|
37886
|
-
|
|
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
|
-
|
|
37886
|
+
dataLink: (_ref56, _ref57) => {
|
|
37887
|
+
var _input$meta12, _input$meta15, _input$meta16, _formsValue$meta5, _input$meta18;
|
|
37888
|
+
let {
|
|
37889
|
+
setValues,
|
|
37890
|
+
name,
|
|
37891
|
+
onValuesChange,
|
|
37892
|
+
changeLinking,
|
|
37893
|
+
formsValue,
|
|
37894
|
+
input,
|
|
37895
|
+
call,
|
|
37896
|
+
automaticallyLink,
|
|
37897
|
+
inputName,
|
|
37898
|
+
props,
|
|
37899
|
+
onNewSetValue,
|
|
37900
|
+
multiple,
|
|
37901
|
+
updateOptions,
|
|
37902
|
+
repeatValues,
|
|
37903
|
+
repeatIndex,
|
|
37904
|
+
value,
|
|
37905
|
+
unique,
|
|
37906
|
+
address,
|
|
37907
|
+
addressData = {},
|
|
37908
|
+
getFromLinking
|
|
37909
|
+
} = _ref56;
|
|
37910
|
+
let {
|
|
37911
|
+
form,
|
|
37912
|
+
forms,
|
|
37913
|
+
setAddress,
|
|
37914
|
+
changeInputMeta,
|
|
37915
|
+
inputMeta,
|
|
37916
|
+
meta,
|
|
37917
|
+
isHighlighted,
|
|
37918
|
+
groupFormId
|
|
37919
|
+
} = _ref57;
|
|
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()::::";
|
|
37917
37924
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect$1, {
|
|
37918
37925
|
size: "medium",
|
|
37919
37926
|
input: input,
|
|
@@ -37950,9 +37957,7 @@ const inputTypeComponent$1 = {
|
|
|
37950
37957
|
const selectedValue = data.find(v => v.value === ev);
|
|
37951
37958
|
if (address && selectedValue) {
|
|
37952
37959
|
dot__default["default"].str(address, selectedValue.label, addressData);
|
|
37953
|
-
setAddress({
|
|
37954
|
-
...addressData
|
|
37955
|
-
});
|
|
37960
|
+
setAddress(_objectSpread2({}, addressData));
|
|
37956
37961
|
}
|
|
37957
37962
|
}
|
|
37958
37963
|
},
|
|
@@ -37962,138 +37967,93 @@ const inputTypeComponent$1 = {
|
|
|
37962
37967
|
isDataLink: true
|
|
37963
37968
|
});
|
|
37964
37969
|
}
|
|
37965
|
-
const isSingle = input
|
|
37966
|
-
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
|
|
37967
|
-
...(formsValue[groupFormId] || {})[name]
|
|
37968
|
-
}] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
|
|
37969
|
-
...v
|
|
37970
|
-
})) : isSingle ? formsValue[name] ? [{
|
|
37971
|
-
...formsValue[name]
|
|
37972
|
-
}] : [] : (formsValue[name] || []).map(v => ({
|
|
37973
|
-
...v
|
|
37974
|
-
}));
|
|
37970
|
+
const isSingle = (input === null || input === void 0 || (_input$meta15 = input.meta) === null || _input$meta15 === void 0 ? void 0 : _input$meta15.maxRepeat) === 1;
|
|
37971
|
+
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [_objectSpread2({}, (formsValue[groupFormId] || {})[name])] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => _objectSpread2({}, v)) : isSingle ? formsValue[name] ? [_objectSpread2({}, formsValue[name])] : [] : (formsValue[name] || []).map(v => _objectSpread2({}, v));
|
|
37975
37972
|
const onUpdate = (editData, i) => {
|
|
37976
|
-
const val = {
|
|
37977
|
-
...formData[i],
|
|
37978
|
-
...editData
|
|
37979
|
-
};
|
|
37973
|
+
const val = _objectSpread2(_objectSpread2({}, formData[i]), editData);
|
|
37980
37974
|
const _val = isSingle ? {
|
|
37981
37975
|
[name]: val
|
|
37982
37976
|
} : {
|
|
37983
|
-
[name]: formData
|
|
37977
|
+
[name]: formData === null || formData === void 0 ? void 0 : formData.map((d, j) => i === j ? val : d)
|
|
37984
37978
|
};
|
|
37985
37979
|
if (groupFormId) {
|
|
37986
|
-
const _defaultData = form
|
|
37987
|
-
const _newData = {
|
|
37988
|
-
|
|
37989
|
-
..._val
|
|
37990
|
-
};
|
|
37991
|
-
onValuesChange(_newData, {
|
|
37992
|
-
...formsValue,
|
|
37980
|
+
const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
|
|
37981
|
+
const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
|
|
37982
|
+
onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
37993
37983
|
[groupFormId]: _newData
|
|
37994
|
-
});
|
|
37995
|
-
form
|
|
37996
|
-
setValues({
|
|
37997
|
-
...formsValue,
|
|
37984
|
+
}));
|
|
37985
|
+
form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
|
|
37986
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
37998
37987
|
[groupFormId]: _newData
|
|
37999
|
-
});
|
|
37988
|
+
}));
|
|
38000
37989
|
return;
|
|
38001
37990
|
}
|
|
38002
|
-
onValuesChange(_val, {
|
|
38003
|
-
|
|
38004
|
-
|
|
38005
|
-
});
|
|
38006
|
-
form?.setFieldValue(name, _val[name]);
|
|
38007
|
-
setValues({
|
|
38008
|
-
...formsValue,
|
|
38009
|
-
..._val
|
|
38010
|
-
});
|
|
37991
|
+
onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
37992
|
+
form === null || form === void 0 || form.setFieldValue(name, _val[name]);
|
|
37993
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
38011
37994
|
};
|
|
38012
|
-
if (input
|
|
37995
|
+
if (input !== null && input !== void 0 && (_input$meta16 = input.meta) !== null && _input$meta16 !== void 0 && _input$meta16.flat) {
|
|
37996
|
+
var _formsValue$meta4, _input$meta17;
|
|
38013
37997
|
return /*#__PURE__*/jsxRuntime.jsx(DataLinkFlat, {
|
|
38014
37998
|
form: input,
|
|
38015
37999
|
changeLinking: changeLinking,
|
|
38016
38000
|
onUpdate: onUpdate,
|
|
38017
38001
|
isHighlighted: isHighlighted,
|
|
38018
38002
|
formsValue: formsValue,
|
|
38019
|
-
values: groupFormId ? {
|
|
38020
|
-
...(formsValue[groupFormId] || {}),
|
|
38003
|
+
values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
|
|
38021
38004
|
meta: {
|
|
38022
|
-
inputs: (formsValue
|
|
38005
|
+
inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta4 = formsValue.meta) === null || _formsValue$meta4 === void 0 ? void 0 : _formsValue$meta4.inputs) || {})[groupFormId]
|
|
38023
38006
|
}
|
|
38024
|
-
} : formsValue,
|
|
38007
|
+
}) : formsValue,
|
|
38025
38008
|
name: name,
|
|
38026
38009
|
groupFormId: groupFormId,
|
|
38027
|
-
maxRepeat: input
|
|
38028
|
-
remove:
|
|
38029
|
-
|
|
38030
|
-
|
|
38010
|
+
maxRepeat: input === null || input === void 0 || (_input$meta17 = input.meta) === null || _input$meta17 === void 0 ? void 0 : _input$meta17.maxRepeat,
|
|
38011
|
+
remove: _ref58 => {
|
|
38012
|
+
let {
|
|
38013
|
+
key
|
|
38014
|
+
} = _ref58;
|
|
38031
38015
|
const _val = isSingle ? {
|
|
38032
38016
|
[name]: null
|
|
38033
38017
|
} : {
|
|
38034
38018
|
[name]: formData.filter((v, i) => i !== key)
|
|
38035
38019
|
};
|
|
38036
38020
|
if (groupFormId) {
|
|
38037
|
-
const _defaultData = form
|
|
38038
|
-
const _newData = {
|
|
38039
|
-
|
|
38040
|
-
..._val
|
|
38041
|
-
};
|
|
38042
|
-
onValuesChange(_newData, {
|
|
38043
|
-
...formsValue,
|
|
38021
|
+
const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
|
|
38022
|
+
const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
|
|
38023
|
+
onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
38044
38024
|
[groupFormId]: _newData
|
|
38045
|
-
});
|
|
38046
|
-
form
|
|
38047
|
-
setValues({
|
|
38048
|
-
...formsValue,
|
|
38025
|
+
}));
|
|
38026
|
+
form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
|
|
38027
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
38049
38028
|
[groupFormId]: _newData
|
|
38050
|
-
});
|
|
38029
|
+
}));
|
|
38051
38030
|
return;
|
|
38052
38031
|
}
|
|
38053
|
-
onValuesChange(_val, {
|
|
38054
|
-
|
|
38055
|
-
|
|
38056
|
-
});
|
|
38057
|
-
form?.setFieldValue(name, _val[name]);
|
|
38058
|
-
setValues({
|
|
38059
|
-
...formsValue,
|
|
38060
|
-
..._val
|
|
38061
|
-
});
|
|
38032
|
+
onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
38033
|
+
form === null || form === void 0 || form.setFieldValue(name, _val[name]);
|
|
38034
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
38062
38035
|
},
|
|
38063
38036
|
add: val => {
|
|
38064
38037
|
const _val = isSingle ? {
|
|
38065
38038
|
[name]: val
|
|
38066
38039
|
} : {
|
|
38067
|
-
[name]: [...formData, {
|
|
38068
|
-
...val
|
|
38069
|
-
}]
|
|
38040
|
+
[name]: [...formData, _objectSpread2({}, val)]
|
|
38070
38041
|
};
|
|
38071
38042
|
if (groupFormId) {
|
|
38072
|
-
const _defaultData = form
|
|
38073
|
-
const _newData = {
|
|
38074
|
-
|
|
38075
|
-
|
|
38076
|
-
};
|
|
38077
|
-
form?.setFieldValue(groupFormId, _newData);
|
|
38078
|
-
onValuesChange(_newData, {
|
|
38079
|
-
...formsValue,
|
|
38043
|
+
const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
|
|
38044
|
+
const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
|
|
38045
|
+
form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
|
|
38046
|
+
onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
38080
38047
|
[groupFormId]: _newData
|
|
38081
|
-
});
|
|
38082
|
-
setValues({
|
|
38083
|
-
...formsValue,
|
|
38048
|
+
}));
|
|
38049
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
38084
38050
|
[groupFormId]: _newData
|
|
38085
|
-
});
|
|
38051
|
+
}));
|
|
38086
38052
|
return;
|
|
38087
38053
|
}
|
|
38088
|
-
form
|
|
38089
|
-
onValuesChange(_val, {
|
|
38090
|
-
|
|
38091
|
-
..._val
|
|
38092
|
-
});
|
|
38093
|
-
setValues({
|
|
38094
|
-
...formsValue,
|
|
38095
|
-
..._val
|
|
38096
|
-
});
|
|
38054
|
+
form === null || form === void 0 || form.setFieldValue(name, _val[name]);
|
|
38055
|
+
onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
38056
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
38097
38057
|
},
|
|
38098
38058
|
k: name,
|
|
38099
38059
|
formData: formData
|
|
@@ -38105,101 +38065,79 @@ const inputTypeComponent$1 = {
|
|
|
38105
38065
|
onUpdate: onUpdate,
|
|
38106
38066
|
isHighlighted: isHighlighted,
|
|
38107
38067
|
formsValue: formsValue,
|
|
38108
|
-
values: groupFormId ? {
|
|
38109
|
-
...(formsValue[groupFormId] || {}),
|
|
38068
|
+
values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
|
|
38110
38069
|
meta: {
|
|
38111
|
-
inputs: (formsValue
|
|
38070
|
+
inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta5 = formsValue.meta) === null || _formsValue$meta5 === void 0 ? void 0 : _formsValue$meta5.inputs) || {})[groupFormId]
|
|
38112
38071
|
}
|
|
38113
|
-
} : formsValue,
|
|
38072
|
+
}) : formsValue,
|
|
38114
38073
|
name: name,
|
|
38115
38074
|
groupFormId: groupFormId,
|
|
38116
|
-
maxRepeat: input
|
|
38117
|
-
remove:
|
|
38118
|
-
|
|
38119
|
-
|
|
38075
|
+
maxRepeat: input === null || input === void 0 || (_input$meta18 = input.meta) === null || _input$meta18 === void 0 ? void 0 : _input$meta18.maxRepeat,
|
|
38076
|
+
remove: _ref59 => {
|
|
38077
|
+
let {
|
|
38078
|
+
key
|
|
38079
|
+
} = _ref59;
|
|
38120
38080
|
const _val = isSingle ? {
|
|
38121
38081
|
[name]: null
|
|
38122
38082
|
} : {
|
|
38123
38083
|
[name]: formData.filter((v, i) => i !== key)
|
|
38124
38084
|
};
|
|
38125
38085
|
if (groupFormId) {
|
|
38126
|
-
const _defaultData = form
|
|
38127
|
-
const _newData = {
|
|
38128
|
-
|
|
38129
|
-
..._val
|
|
38130
|
-
};
|
|
38131
|
-
onValuesChange(_newData, {
|
|
38132
|
-
...formsValue,
|
|
38086
|
+
const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
|
|
38087
|
+
const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
|
|
38088
|
+
onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
38133
38089
|
[groupFormId]: _newData
|
|
38134
|
-
});
|
|
38135
|
-
form
|
|
38136
|
-
setValues({
|
|
38137
|
-
...formsValue,
|
|
38090
|
+
}));
|
|
38091
|
+
form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
|
|
38092
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
38138
38093
|
[groupFormId]: _newData
|
|
38139
|
-
});
|
|
38094
|
+
}));
|
|
38140
38095
|
return;
|
|
38141
38096
|
}
|
|
38142
|
-
onValuesChange(_val, {
|
|
38143
|
-
|
|
38144
|
-
|
|
38145
|
-
});
|
|
38146
|
-
form?.setFieldValue(name, _val[name]);
|
|
38147
|
-
setValues({
|
|
38148
|
-
...formsValue,
|
|
38149
|
-
..._val
|
|
38150
|
-
});
|
|
38097
|
+
onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
38098
|
+
form === null || form === void 0 || form.setFieldValue(name, _val[name]);
|
|
38099
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
38151
38100
|
},
|
|
38152
38101
|
add: val => {
|
|
38153
38102
|
const _val = isSingle ? {
|
|
38154
38103
|
[name]: val
|
|
38155
38104
|
} : {
|
|
38156
|
-
[name]: [...formData, {
|
|
38157
|
-
...val
|
|
38158
|
-
}]
|
|
38105
|
+
[name]: [...formData, _objectSpread2({}, val)]
|
|
38159
38106
|
};
|
|
38160
38107
|
if (groupFormId) {
|
|
38161
|
-
const _defaultData = form
|
|
38162
|
-
const _newData = {
|
|
38163
|
-
|
|
38164
|
-
|
|
38165
|
-
};
|
|
38166
|
-
form?.setFieldValue(groupFormId, _newData);
|
|
38167
|
-
onValuesChange(_newData, {
|
|
38168
|
-
...formsValue,
|
|
38108
|
+
const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
|
|
38109
|
+
const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
|
|
38110
|
+
form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
|
|
38111
|
+
onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
38169
38112
|
[groupFormId]: _newData
|
|
38170
|
-
});
|
|
38171
|
-
setValues({
|
|
38172
|
-
...formsValue,
|
|
38113
|
+
}));
|
|
38114
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
38173
38115
|
[groupFormId]: _newData
|
|
38174
|
-
});
|
|
38116
|
+
}));
|
|
38175
38117
|
return;
|
|
38176
38118
|
}
|
|
38177
|
-
form
|
|
38178
|
-
onValuesChange(_val, {
|
|
38179
|
-
|
|
38180
|
-
..._val
|
|
38181
|
-
});
|
|
38182
|
-
setValues({
|
|
38183
|
-
...formsValue,
|
|
38184
|
-
..._val
|
|
38185
|
-
});
|
|
38119
|
+
form === null || form === void 0 || form.setFieldValue(name, _val[name]);
|
|
38120
|
+
onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
38121
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
38186
38122
|
},
|
|
38187
38123
|
k: name,
|
|
38188
38124
|
formData: formData
|
|
38189
38125
|
});
|
|
38190
38126
|
},
|
|
38191
|
-
dataLinkGroup: ({
|
|
38192
|
-
|
|
38193
|
-
|
|
38194
|
-
|
|
38195
|
-
|
|
38196
|
-
|
|
38197
|
-
|
|
38198
|
-
|
|
38199
|
-
|
|
38200
|
-
|
|
38201
|
-
|
|
38202
|
-
|
|
38127
|
+
dataLinkGroup: (_ref60, _ref61) => {
|
|
38128
|
+
let {
|
|
38129
|
+
setValues,
|
|
38130
|
+
name,
|
|
38131
|
+
onValuesChange,
|
|
38132
|
+
changeLinking,
|
|
38133
|
+
formsValue,
|
|
38134
|
+
input
|
|
38135
|
+
} = _ref60;
|
|
38136
|
+
let {
|
|
38137
|
+
form,
|
|
38138
|
+
groupFormId,
|
|
38139
|
+
isHighlighted
|
|
38140
|
+
} = _ref61;
|
|
38203
38141
|
return renderDataLinkGroup({
|
|
38204
38142
|
input,
|
|
38205
38143
|
name,
|
|
@@ -38212,51 +38150,41 @@ const inputTypeComponent$1 = {
|
|
|
38212
38150
|
isHighlighted
|
|
38213
38151
|
});
|
|
38214
38152
|
},
|
|
38215
|
-
groupCheckbox: ({
|
|
38216
|
-
|
|
38217
|
-
|
|
38218
|
-
|
|
38219
|
-
|
|
38220
|
-
|
|
38221
|
-
|
|
38222
|
-
|
|
38223
|
-
|
|
38224
|
-
|
|
38225
|
-
|
|
38153
|
+
groupCheckbox: (_ref62, _ref63) => {
|
|
38154
|
+
let {
|
|
38155
|
+
setValues,
|
|
38156
|
+
name,
|
|
38157
|
+
onValuesChange,
|
|
38158
|
+
formsValue,
|
|
38159
|
+
input
|
|
38160
|
+
} = _ref62;
|
|
38161
|
+
let {
|
|
38162
|
+
form,
|
|
38163
|
+
groupFormId,
|
|
38164
|
+
isHighlighted
|
|
38165
|
+
} = _ref63;
|
|
38226
38166
|
const formData = groupFormId ? (formsValue[groupFormId] || {})[name] || [] : formsValue[name] || [];
|
|
38227
38167
|
const onUpdate = (val, key) => {
|
|
38228
38168
|
const _val = {
|
|
38229
|
-
[name]: {
|
|
38230
|
-
...formData,
|
|
38169
|
+
[name]: _objectSpread2(_objectSpread2({}, formData), {}, {
|
|
38231
38170
|
[key]: val
|
|
38232
|
-
}
|
|
38171
|
+
})
|
|
38233
38172
|
};
|
|
38234
38173
|
if (groupFormId) {
|
|
38235
|
-
const _defaultData = form
|
|
38236
|
-
const _newData = {
|
|
38237
|
-
|
|
38238
|
-
..._val
|
|
38239
|
-
};
|
|
38240
|
-
onValuesChange(_newData, {
|
|
38241
|
-
...formsValue,
|
|
38174
|
+
const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
|
|
38175
|
+
const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
|
|
38176
|
+
onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
38242
38177
|
[groupFormId]: _newData
|
|
38243
|
-
});
|
|
38244
|
-
form
|
|
38245
|
-
setValues({
|
|
38246
|
-
...formsValue,
|
|
38178
|
+
}));
|
|
38179
|
+
form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
|
|
38180
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
38247
38181
|
[groupFormId]: _newData
|
|
38248
|
-
});
|
|
38182
|
+
}));
|
|
38249
38183
|
return;
|
|
38250
38184
|
}
|
|
38251
|
-
onValuesChange(_val, {
|
|
38252
|
-
|
|
38253
|
-
|
|
38254
|
-
});
|
|
38255
|
-
form?.setFieldValue(name, _val[name]);
|
|
38256
|
-
setValues({
|
|
38257
|
-
...formsValue,
|
|
38258
|
-
..._val
|
|
38259
|
-
});
|
|
38185
|
+
onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
38186
|
+
form === null || form === void 0 || form.setFieldValue(name, _val[name]);
|
|
38187
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
38260
38188
|
};
|
|
38261
38189
|
return /*#__PURE__*/jsxRuntime.jsx(GroupCheckbox, {
|
|
38262
38190
|
form: input,
|
|
@@ -38265,96 +38193,91 @@ const inputTypeComponent$1 = {
|
|
|
38265
38193
|
isHighlighted: isHighlighted
|
|
38266
38194
|
});
|
|
38267
38195
|
},
|
|
38268
|
-
website: ({
|
|
38269
|
-
|
|
38270
|
-
|
|
38271
|
-
|
|
38272
|
-
|
|
38273
|
-
|
|
38274
|
-
|
|
38275
|
-
|
|
38276
|
-
|
|
38277
|
-
|
|
38278
|
-
|
|
38279
|
-
|
|
38280
|
-
|
|
38281
|
-
|
|
38282
|
-
|
|
38196
|
+
website: (_ref64, _ref65) => {
|
|
38197
|
+
let {
|
|
38198
|
+
name,
|
|
38199
|
+
inputName,
|
|
38200
|
+
props,
|
|
38201
|
+
value,
|
|
38202
|
+
repeatIndex,
|
|
38203
|
+
repeatValues,
|
|
38204
|
+
formsValue
|
|
38205
|
+
} = _ref64;
|
|
38206
|
+
let {
|
|
38207
|
+
form,
|
|
38208
|
+
isHighlighted,
|
|
38209
|
+
inputMeta = {},
|
|
38210
|
+
t
|
|
38211
|
+
} = _ref65;
|
|
38212
|
+
return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
|
|
38283
38213
|
size: "large",
|
|
38284
38214
|
allowClear: true,
|
|
38285
|
-
initialValue: value
|
|
38286
|
-
|
|
38215
|
+
initialValue: value
|
|
38216
|
+
}, props), {}, {
|
|
38287
38217
|
onChange: val => updateFormValues$1(repeatIndex, repeatValues, inputName, val, formsValue, name, form),
|
|
38288
38218
|
className: formatClassname([isHighlighted && "highlighted-cont"]),
|
|
38289
38219
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
38290
38220
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com"
|
|
38291
|
-
});
|
|
38221
|
+
}));
|
|
38292
38222
|
},
|
|
38293
|
-
group: ({
|
|
38294
|
-
|
|
38295
|
-
|
|
38296
|
-
|
|
38297
|
-
|
|
38298
|
-
|
|
38299
|
-
|
|
38300
|
-
|
|
38301
|
-
|
|
38223
|
+
group: (_ref66, _ref67) => {
|
|
38224
|
+
let {
|
|
38225
|
+
props,
|
|
38226
|
+
groupInputs,
|
|
38227
|
+
formsValue
|
|
38228
|
+
} = _ref66;
|
|
38229
|
+
let {
|
|
38230
|
+
inputMeta,
|
|
38231
|
+
isHighlighted
|
|
38232
|
+
} = _ref67;
|
|
38233
|
+
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
|
|
38302
38234
|
formsValue: formsValue,
|
|
38303
38235
|
isHighlighted: isHighlighted,
|
|
38304
38236
|
groupInputs: groupInputs,
|
|
38305
|
-
inputMeta: inputMeta
|
|
38306
|
-
|
|
38307
|
-
});
|
|
38237
|
+
inputMeta: inputMeta
|
|
38238
|
+
}, props));
|
|
38308
38239
|
},
|
|
38309
|
-
groupInputs: ({
|
|
38310
|
-
|
|
38311
|
-
|
|
38312
|
-
|
|
38313
|
-
|
|
38314
|
-
|
|
38315
|
-
|
|
38316
|
-
|
|
38317
|
-
|
|
38240
|
+
groupInputs: (_ref68, _ref69) => {
|
|
38241
|
+
let {
|
|
38242
|
+
props,
|
|
38243
|
+
groupInputs,
|
|
38244
|
+
formsValue
|
|
38245
|
+
} = _ref68;
|
|
38246
|
+
let {
|
|
38247
|
+
inputMeta,
|
|
38248
|
+
isHighlighted
|
|
38249
|
+
} = _ref69;
|
|
38250
|
+
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
|
|
38318
38251
|
formsValue: formsValue,
|
|
38319
38252
|
isHighlighted: isHighlighted,
|
|
38320
38253
|
groupInputs: groupInputs,
|
|
38321
|
-
inputMeta: inputMeta
|
|
38322
|
-
|
|
38323
|
-
});
|
|
38254
|
+
inputMeta: inputMeta
|
|
38255
|
+
}, props));
|
|
38324
38256
|
},
|
|
38325
|
-
smartHelp: ({
|
|
38326
|
-
name,
|
|
38327
|
-
inputName,
|
|
38328
|
-
props,
|
|
38329
|
-
value,
|
|
38330
|
-
repeatIndex,
|
|
38331
|
-
repeatValues,
|
|
38332
|
-
formsValue
|
|
38333
|
-
}, {
|
|
38334
|
-
form,
|
|
38335
|
-
isHighlighted,
|
|
38336
|
-
inputMeta = {},
|
|
38337
|
-
t
|
|
38338
|
-
}) => {
|
|
38257
|
+
smartHelp: (_ref70, _ref71) => {
|
|
38339
38258
|
return /*#__PURE__*/jsxRuntime.jsx(Smart, {});
|
|
38340
38259
|
}
|
|
38341
38260
|
};
|
|
38342
38261
|
const filterForm = (f, d) => {
|
|
38343
38262
|
return f && (f.showFormIf ? showHideForm(f, d) : true);
|
|
38344
38263
|
};
|
|
38345
|
-
const checkFormHasSubsections =
|
|
38264
|
+
const checkFormHasSubsections = function () {
|
|
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
|
+
};
|
|
38346
38268
|
const mapFormGroup = (f, d) => Object.keys(f).map(key => {
|
|
38347
|
-
const {
|
|
38348
|
-
|
|
38349
|
-
|
|
38350
|
-
|
|
38351
|
-
|
|
38352
|
-
|
|
38353
|
-
|
|
38354
|
-
|
|
38355
|
-
|
|
38356
|
-
|
|
38357
|
-
|
|
38269
|
+
const _ref72 = f[key] || {},
|
|
38270
|
+
{
|
|
38271
|
+
label,
|
|
38272
|
+
description = "",
|
|
38273
|
+
excludeFromEdit,
|
|
38274
|
+
showFormIf,
|
|
38275
|
+
icon = "",
|
|
38276
|
+
position = 0,
|
|
38277
|
+
template,
|
|
38278
|
+
formClass
|
|
38279
|
+
} = _ref72,
|
|
38280
|
+
fc = _objectWithoutProperties(_ref72, _excluded2$1);
|
|
38358
38281
|
const fConf = {
|
|
38359
38282
|
id: key,
|
|
38360
38283
|
label,
|
|
@@ -38413,11 +38336,14 @@ const groupSubForms = (fConf, d) => {
|
|
|
38413
38336
|
return f;
|
|
38414
38337
|
}, {});
|
|
38415
38338
|
};
|
|
38416
|
-
const inputIsEmpty = (
|
|
38417
|
-
|
|
38339
|
+
const inputIsEmpty = function () {
|
|
38340
|
+
let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
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) {
|
|
38418
38344
|
return false;
|
|
38419
38345
|
}
|
|
38420
|
-
if (input
|
|
38346
|
+
if ((input === null || input === void 0 ? void 0 : input.type) === "groupInputs") {
|
|
38421
38347
|
return true;
|
|
38422
38348
|
}
|
|
38423
38349
|
const value = values[input.dataId];
|
|
@@ -38429,26 +38355,28 @@ const inputIsEmpty = (input = {}, values, inputMeta) => {
|
|
|
38429
38355
|
}
|
|
38430
38356
|
return !value;
|
|
38431
38357
|
};
|
|
38432
|
-
const GetFormItem$1 =
|
|
38433
|
-
|
|
38434
|
-
|
|
38435
|
-
|
|
38436
|
-
|
|
38437
|
-
|
|
38438
|
-
|
|
38439
|
-
|
|
38440
|
-
|
|
38441
|
-
|
|
38442
|
-
|
|
38443
|
-
|
|
38444
|
-
|
|
38445
|
-
|
|
38446
|
-
|
|
38447
|
-
|
|
38448
|
-
|
|
38449
|
-
|
|
38450
|
-
|
|
38451
|
-
|
|
38358
|
+
const GetFormItem$1 = _ref73 => {
|
|
38359
|
+
var _inputMeta$reviews, _input$meta19, _input$meta20, _rules$find, _input$meta21;
|
|
38360
|
+
let {
|
|
38361
|
+
highlightMandatory,
|
|
38362
|
+
inputData,
|
|
38363
|
+
inputId,
|
|
38364
|
+
input,
|
|
38365
|
+
values,
|
|
38366
|
+
MainForm,
|
|
38367
|
+
options,
|
|
38368
|
+
plainForms,
|
|
38369
|
+
setValues,
|
|
38370
|
+
setAddress,
|
|
38371
|
+
i,
|
|
38372
|
+
inputKey,
|
|
38373
|
+
onValuesChange = () => {},
|
|
38374
|
+
setLoading = () => {},
|
|
38375
|
+
inputMeta = {},
|
|
38376
|
+
changeInputMeta = () => {},
|
|
38377
|
+
changeLinking = () => {},
|
|
38378
|
+
namespace
|
|
38379
|
+
} = _ref73;
|
|
38452
38380
|
const {
|
|
38453
38381
|
t,
|
|
38454
38382
|
user,
|
|
@@ -38463,44 +38391,42 @@ const GetFormItem$1 = ({
|
|
|
38463
38391
|
staticWidth,
|
|
38464
38392
|
fullWidth
|
|
38465
38393
|
} = useEditContext();
|
|
38466
|
-
const lastReview = (inputMeta
|
|
38394
|
+
const lastReview = ((inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.reviews) || [])[((inputMeta === null || inputMeta === void 0 || (_inputMeta$reviews = inputMeta.reviews) === null || _inputMeta$reviews === void 0 ? void 0 : _inputMeta$reviews.length) || 0) - 1];
|
|
38467
38395
|
const [isShown, setIsShown] = React.useState(!!inputData.commentValue);
|
|
38468
38396
|
const inputLabel = getInputLabel$1(input, values);
|
|
38469
38397
|
const onClickReviewSuccess = () => {
|
|
38470
38398
|
if (!isReview) {
|
|
38471
38399
|
return;
|
|
38472
38400
|
}
|
|
38473
|
-
const reviewSuccess = lastReview
|
|
38401
|
+
const reviewSuccess = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess;
|
|
38474
38402
|
changeInputMeta({
|
|
38475
38403
|
key: inputId,
|
|
38476
38404
|
type: input.type,
|
|
38477
|
-
value: {
|
|
38478
|
-
...inputMeta,
|
|
38405
|
+
value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
|
|
38479
38406
|
reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
|
|
38480
38407
|
reviewer: user,
|
|
38481
38408
|
createdAt: new Date().toISOString(),
|
|
38482
38409
|
reviewSuccess: true
|
|
38483
38410
|
}]
|
|
38484
|
-
}
|
|
38411
|
+
})
|
|
38485
38412
|
});
|
|
38486
38413
|
};
|
|
38487
38414
|
const onClickReviewError = () => {
|
|
38488
38415
|
if (!isReview) {
|
|
38489
38416
|
return;
|
|
38490
38417
|
}
|
|
38491
|
-
const reviewError = lastReview
|
|
38418
|
+
const reviewError = lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError;
|
|
38492
38419
|
changeInputMeta({
|
|
38493
38420
|
key: inputId,
|
|
38494
38421
|
type: input.type,
|
|
38495
|
-
value: {
|
|
38496
|
-
...inputMeta,
|
|
38422
|
+
value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
|
|
38497
38423
|
reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
|
|
38498
38424
|
reviewer: user,
|
|
38499
38425
|
createdAt: new Date().toISOString(),
|
|
38500
38426
|
reviewError: true,
|
|
38501
38427
|
comment: ""
|
|
38502
38428
|
}]
|
|
38503
|
-
}
|
|
38429
|
+
})
|
|
38504
38430
|
});
|
|
38505
38431
|
};
|
|
38506
38432
|
switch (input.type) {
|
|
@@ -38514,12 +38440,12 @@ const GetFormItem$1 = ({
|
|
|
38514
38440
|
case "header":
|
|
38515
38441
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38516
38442
|
className: "daf-title with-subtitle",
|
|
38517
|
-
style: input
|
|
38443
|
+
style: input === null || input === void 0 || (_input$meta19 = input.meta) === null || _input$meta19 === void 0 ? void 0 : _input$meta19.style,
|
|
38518
38444
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38519
38445
|
className: "flex",
|
|
38520
38446
|
children: [/*#__PURE__*/jsxRuntime.jsx("h1", {
|
|
38521
38447
|
children: ReactHtmlParser__default["default"](getLabel$1(input.label, values))
|
|
38522
|
-
}), !!input.description || input
|
|
38448
|
+
}), !!input.description || input !== null && input !== void 0 && (_input$meta20 = input.meta) !== null && _input$meta20 !== void 0 && _input$meta20.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
|
|
38523
38449
|
content: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38524
38450
|
className: "tooltip-popover-cont",
|
|
38525
38451
|
children: ReactHtmlParser__default["default"](input.description)
|
|
@@ -38546,7 +38472,7 @@ const GetFormItem$1 = ({
|
|
|
38546
38472
|
const specialCharsRule = rules.find(r => r.type === "specialCharacters");
|
|
38547
38473
|
|
|
38548
38474
|
// eslint-disable-next-line no-case-declarations
|
|
38549
|
-
let maxRule = rules.find(rule => rule.max)
|
|
38475
|
+
let maxRule = (_rules$find = rules.find(rule => rule.max)) === null || _rules$find === void 0 ? void 0 : _rules$find.max;
|
|
38550
38476
|
if (!maxRule && input.type === "textarea") {
|
|
38551
38477
|
maxRule = MAX_TEXT_AREA_LENGTH;
|
|
38552
38478
|
}
|
|
@@ -38559,27 +38485,30 @@ const GetFormItem$1 = ({
|
|
|
38559
38485
|
message: requiredRule.message || ""
|
|
38560
38486
|
});
|
|
38561
38487
|
}
|
|
38562
|
-
const isHighlighted = highlightMandatory && input
|
|
38488
|
+
const isHighlighted = highlightMandatory && (input === null || input === void 0 || (_input$meta21 = input.meta) === null || _input$meta21 === void 0 ? void 0 : _input$meta21.mandatory) && inputIsEmpty(input, values, inputMeta);
|
|
38563
38489
|
if (requiredRule || specialCharsRule) {
|
|
38564
38490
|
if (input.type === "groupInputs") {
|
|
38565
38491
|
rules = rules.map(r => {
|
|
38566
38492
|
if (r.required) {
|
|
38567
|
-
return
|
|
38568
|
-
|
|
38569
|
-
|
|
38570
|
-
|
|
38571
|
-
|
|
38572
|
-
|
|
38573
|
-
|
|
38574
|
-
|
|
38575
|
-
|
|
38576
|
-
|
|
38577
|
-
|
|
38493
|
+
return _ref74 => {
|
|
38494
|
+
let {
|
|
38495
|
+
getFieldValue
|
|
38496
|
+
} = _ref74;
|
|
38497
|
+
return {
|
|
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
|
+
}
|
|
38578
38507
|
}
|
|
38508
|
+
return Promise.resolve();
|
|
38579
38509
|
}
|
|
38580
|
-
|
|
38581
|
-
|
|
38582
|
-
});
|
|
38510
|
+
};
|
|
38511
|
+
};
|
|
38583
38512
|
}
|
|
38584
38513
|
return r;
|
|
38585
38514
|
});
|
|
@@ -38617,12 +38546,13 @@ const GetFormItem$1 = ({
|
|
|
38617
38546
|
}
|
|
38618
38547
|
}
|
|
38619
38548
|
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;
|
|
38620
38550
|
// check if input is valid
|
|
38621
38551
|
const hideComment = namespace === "project-readiness";
|
|
38622
38552
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
38623
38553
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38624
38554
|
className: "flex-row input-cont",
|
|
38625
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38555
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
38626
38556
|
extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
38627
38557
|
children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38628
38558
|
className: formatClassname(["ml-4 input-actions"]),
|
|
@@ -38632,7 +38562,7 @@ const GetFormItem$1 = ({
|
|
|
38632
38562
|
title: t("Add review note"),
|
|
38633
38563
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38634
38564
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38635
|
-
className: formatClassname(["review-btn review-error-btn", lastReview
|
|
38565
|
+
className: formatClassname(["review-btn review-error-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewError) && "primary"]),
|
|
38636
38566
|
type: "link",
|
|
38637
38567
|
onClick: onClickReviewError,
|
|
38638
38568
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
@@ -38648,7 +38578,7 @@ const GetFormItem$1 = ({
|
|
|
38648
38578
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38649
38579
|
type: "link",
|
|
38650
38580
|
onClick: onClickReviewSuccess,
|
|
38651
|
-
className: formatClassname(["review-btn review-success-btn", lastReview
|
|
38581
|
+
className: formatClassname(["review-btn review-success-btn", (lastReview === null || lastReview === void 0 ? void 0 : lastReview.reviewSuccess) && "primary"]),
|
|
38652
38582
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
38653
38583
|
name: "CheckSquare",
|
|
38654
38584
|
width: 16,
|
|
@@ -38685,7 +38615,7 @@ const GetFormItem$1 = ({
|
|
|
38685
38615
|
}
|
|
38686
38616
|
});
|
|
38687
38617
|
},
|
|
38688
|
-
disabled: !input.meta
|
|
38618
|
+
disabled: !((_input$meta22 = input.meta) !== null && _input$meta22 !== void 0 && _input$meta22.notApplicable),
|
|
38689
38619
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
38690
38620
|
name: "NotApplicable",
|
|
38691
38621
|
width: 16,
|
|
@@ -38699,7 +38629,7 @@ const GetFormItem$1 = ({
|
|
|
38699
38629
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38700
38630
|
className: formatClassname(["default p-0", inputMeta.notAvailable && "primary"]),
|
|
38701
38631
|
type: "link",
|
|
38702
|
-
disabled: !input.meta
|
|
38632
|
+
disabled: !((_input$meta23 = input.meta) !== null && _input$meta23 !== void 0 && _input$meta23.notAvailable),
|
|
38703
38633
|
onClick: () => {
|
|
38704
38634
|
const value = getDefaultInputValue(input);
|
|
38705
38635
|
MainForm.setFields([{
|
|
@@ -38731,14 +38661,14 @@ const GetFormItem$1 = ({
|
|
|
38731
38661
|
}), !hideComment ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
38732
38662
|
title: t("Add comment"),
|
|
38733
38663
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38734
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38664
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
|
|
38735
38665
|
type: "link",
|
|
38736
|
-
disabled: !input.meta
|
|
38737
|
-
|
|
38738
|
-
|
|
38739
|
-
|
|
38740
|
-
|
|
38741
|
-
|
|
38666
|
+
disabled: !((_input$meta24 = input.meta) !== null && _input$meta24 !== void 0 && _input$meta24.comment)
|
|
38667
|
+
}, !isShown ? {
|
|
38668
|
+
className: "default p-0"
|
|
38669
|
+
} : {
|
|
38670
|
+
className: "p-0 primary"
|
|
38671
|
+
}), {}, {
|
|
38742
38672
|
onClick: () => {
|
|
38743
38673
|
if (inputMeta.comment !== undefined && inputMeta.comment !== null) {
|
|
38744
38674
|
return;
|
|
@@ -38757,7 +38687,7 @@ const GetFormItem$1 = ({
|
|
|
38757
38687
|
width: 16,
|
|
38758
38688
|
height: 16
|
|
38759
38689
|
})
|
|
38760
|
-
})
|
|
38690
|
+
}))
|
|
38761
38691
|
})
|
|
38762
38692
|
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
38763
38693
|
title: t("Project Readiness"),
|
|
@@ -38776,36 +38706,34 @@ const GetFormItem$1 = ({
|
|
|
38776
38706
|
}) : null]
|
|
38777
38707
|
}) : null
|
|
38778
38708
|
}),
|
|
38779
|
-
initialValue: inputMeta
|
|
38780
|
-
|
|
38781
|
-
|
|
38782
|
-
|
|
38783
|
-
|
|
38784
|
-
|
|
38785
|
-
|
|
38786
|
-
|
|
38787
|
-
|
|
38788
|
-
|
|
38789
|
-
|
|
38790
|
-
|
|
38791
|
-
if (Array.isArray(e)) {
|
|
38792
|
-
return e;
|
|
38793
|
-
}
|
|
38794
|
-
return e && e.fileList && e.fileList.map(f => {
|
|
38795
|
-
if (f.response) {
|
|
38796
|
-
return f.response;
|
|
38797
|
-
}
|
|
38798
|
-
return f;
|
|
38799
|
-
});
|
|
38709
|
+
initialValue: inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.defaultValue
|
|
38710
|
+
}, inputOnBlur.includes(input.type) ? {
|
|
38711
|
+
trigger: "onBlur"
|
|
38712
|
+
} : {}), ["total100", "group"].includes(input.type) ? {} : {
|
|
38713
|
+
name: inputId,
|
|
38714
|
+
fieldKey: inputId,
|
|
38715
|
+
initialValue: inputData.value
|
|
38716
|
+
}), ["upload"].includes(input.type) ? {
|
|
38717
|
+
valuePropName: "fileList",
|
|
38718
|
+
getValueFromEvent: e => {
|
|
38719
|
+
if (Array.isArray(e)) {
|
|
38720
|
+
return e;
|
|
38800
38721
|
}
|
|
38801
|
-
|
|
38802
|
-
|
|
38722
|
+
return e && e.fileList && e.fileList.map(f => {
|
|
38723
|
+
if (f.response) {
|
|
38724
|
+
return f.response;
|
|
38725
|
+
}
|
|
38726
|
+
return f;
|
|
38727
|
+
});
|
|
38728
|
+
}
|
|
38729
|
+
} : {}), {}, {
|
|
38730
|
+
className: formatClassname(["i-".concat(input.type, " flex-1"), input.comment && "with-comment", maxRule && "with-max-rule"]),
|
|
38803
38731
|
"data-id": inputData.name,
|
|
38804
38732
|
rules: rules,
|
|
38805
38733
|
required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
|
|
38806
38734
|
labelCol: 12,
|
|
38807
38735
|
label: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38808
|
-
className: formatClassname(["flex", input
|
|
38736
|
+
className: formatClassname(["flex", (input === null || input === void 0 || (_input$meta25 = input.meta) === null || _input$meta25 === void 0 ? void 0 : _input$meta25.code) && "mr-10"]),
|
|
38809
38737
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38810
38738
|
className: "mr-1",
|
|
38811
38739
|
children: getInputLabel$1(input, values)
|
|
@@ -38818,7 +38746,7 @@ const GetFormItem$1 = ({
|
|
|
38818
38746
|
config: input,
|
|
38819
38747
|
t: t,
|
|
38820
38748
|
ajaxForms: ajaxForms,
|
|
38821
|
-
linkingData: values
|
|
38749
|
+
linkingData: (values === null || values === void 0 ? void 0 : values.linking) || (values === null || values === void 0 || (_values$parent = values.parent) === null || _values$parent === void 0 ? void 0 : _values$parent.linking),
|
|
38822
38750
|
changeAjaxForms: changeAjaxForms,
|
|
38823
38751
|
getApiBaseUrl: getApiBaseUrl,
|
|
38824
38752
|
getAppHeader: getAppHeader,
|
|
@@ -38826,12 +38754,11 @@ const GetFormItem$1 = ({
|
|
|
38826
38754
|
getToken: getToken,
|
|
38827
38755
|
app: app,
|
|
38828
38756
|
valueOnlyString: true
|
|
38829
|
-
}) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
|
|
38830
|
-
...inputData,
|
|
38757
|
+
}) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](_objectSpread2(_objectSpread2({}, inputData), {}, {
|
|
38831
38758
|
maxWidth,
|
|
38832
38759
|
staticWidth,
|
|
38833
38760
|
fullWidth
|
|
38834
|
-
}, {
|
|
38761
|
+
}), {
|
|
38835
38762
|
form: MainForm,
|
|
38836
38763
|
forms: options,
|
|
38837
38764
|
allForms: plainForms,
|
|
@@ -38852,10 +38779,10 @@ const GetFormItem$1 = ({
|
|
|
38852
38779
|
staticWidth,
|
|
38853
38780
|
fullWidth
|
|
38854
38781
|
}) : console.log(input)
|
|
38855
|
-
}), input.meta
|
|
38782
|
+
})), (_input$meta26 = input.meta) !== null && _input$meta26 !== void 0 && _input$meta26.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38856
38783
|
className: "code",
|
|
38857
38784
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
38858
|
-
children: input.meta
|
|
38785
|
+
children: (_input$meta27 = input.meta) === null || _input$meta27 === void 0 ? void 0 : _input$meta27.code
|
|
38859
38786
|
})
|
|
38860
38787
|
}) : null]
|
|
38861
38788
|
}), maxRule ? ["imageUpload", "upload", "videoUpload"].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -38875,10 +38802,10 @@ const GetFormItem$1 = ({
|
|
|
38875
38802
|
className: "max-char-span",
|
|
38876
38803
|
children: t("max-char", {
|
|
38877
38804
|
chars: maxRule,
|
|
38878
|
-
filled: inputData
|
|
38805
|
+
filled: (inputData === null || inputData === void 0 || (_inputData$value = inputData.value) === null || _inputData$value === void 0 ? void 0 : _inputData$value.length) || 0
|
|
38879
38806
|
})
|
|
38880
38807
|
})
|
|
38881
|
-
}) : null, input.meta
|
|
38808
|
+
}) : null, (_input$meta28 = input.meta) !== null && _input$meta28 !== void 0 && _input$meta28.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38882
38809
|
className: "input-content",
|
|
38883
38810
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38884
38811
|
className: "comment-textarea",
|
|
@@ -38904,7 +38831,7 @@ const GetFormItem$1 = ({
|
|
|
38904
38831
|
},
|
|
38905
38832
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38906
38833
|
type: "link",
|
|
38907
|
-
disabled: !input.meta
|
|
38834
|
+
disabled: !((_input$meta29 = input.meta) !== null && _input$meta29 !== void 0 && _input$meta29.comment),
|
|
38908
38835
|
className: "p-0",
|
|
38909
38836
|
children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
|
|
38910
38837
|
width: 16,
|
|
@@ -38913,12 +38840,11 @@ const GetFormItem$1 = ({
|
|
|
38913
38840
|
})
|
|
38914
38841
|
})]
|
|
38915
38842
|
}),
|
|
38916
|
-
children: inputTypeComponent$1.comment({
|
|
38917
|
-
...inputData,
|
|
38843
|
+
children: inputTypeComponent$1.comment(_objectSpread2(_objectSpread2({}, inputData), {}, {
|
|
38918
38844
|
maxWidth,
|
|
38919
38845
|
staticWidth,
|
|
38920
38846
|
fullWidth
|
|
38921
|
-
}, {
|
|
38847
|
+
}), {
|
|
38922
38848
|
form: MainForm,
|
|
38923
38849
|
forms: options,
|
|
38924
38850
|
setFormValues: setValues,
|
|
@@ -38943,16 +38869,16 @@ const GetFormItem$1 = ({
|
|
|
38943
38869
|
className: "max-char-span",
|
|
38944
38870
|
children: t("max-char", {
|
|
38945
38871
|
chars: MAX_COMMENTS_LENGTH,
|
|
38946
|
-
filled: inputData
|
|
38872
|
+
filled: (inputData === null || inputData === void 0 || (_inputData$commentVal = inputData.commentValue) === null || _inputData$commentVal === void 0 ? void 0 : _inputData$commentVal.length) || 0
|
|
38947
38873
|
})
|
|
38948
38874
|
})]
|
|
38949
|
-
}) : null, lastReview
|
|
38875
|
+
}) : null, lastReview !== null && lastReview !== void 0 && lastReview.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38950
38876
|
className: "input-content",
|
|
38951
38877
|
children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
38952
38878
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38953
38879
|
className: "comment-textarea",
|
|
38954
|
-
initialValue: lastReview
|
|
38955
|
-
name:
|
|
38880
|
+
initialValue: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || "",
|
|
38881
|
+
name: "".concat(inputId, "-reviewErrorComment"),
|
|
38956
38882
|
label: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38957
38883
|
className: "flex w-100",
|
|
38958
38884
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -38960,31 +38886,28 @@ const GetFormItem$1 = ({
|
|
|
38960
38886
|
children: t("Review note")
|
|
38961
38887
|
})
|
|
38962
38888
|
}),
|
|
38963
|
-
children: inputTypeComponent$1.comment({
|
|
38964
|
-
...inputData,
|
|
38889
|
+
children: inputTypeComponent$1.comment(_objectSpread2(_objectSpread2({}, inputData), {}, {
|
|
38965
38890
|
maxWidth,
|
|
38966
38891
|
staticWidth,
|
|
38967
38892
|
fullWidth
|
|
38968
|
-
}, {
|
|
38893
|
+
}), {
|
|
38969
38894
|
form: MainForm,
|
|
38970
38895
|
forms: options,
|
|
38971
|
-
value: lastReview
|
|
38896
|
+
value: (lastReview === null || lastReview === void 0 ? void 0 : lastReview.comment) || "",
|
|
38972
38897
|
onChange: val => {
|
|
38973
38898
|
changeInputMeta({
|
|
38974
38899
|
key: inputId,
|
|
38975
38900
|
type: input.type,
|
|
38976
|
-
value: {
|
|
38977
|
-
|
|
38978
|
-
reviews: (inputMeta?.reviews || []).map(v => {
|
|
38901
|
+
value: _objectSpread2(_objectSpread2({}, inputMeta), {}, {
|
|
38902
|
+
reviews: ((inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.reviews) || []).map(v => {
|
|
38979
38903
|
if (v.createdAt === lastReview.createdAt) {
|
|
38980
|
-
return {
|
|
38981
|
-
...v,
|
|
38904
|
+
return _objectSpread2(_objectSpread2({}, v), {}, {
|
|
38982
38905
|
comment: val
|
|
38983
|
-
};
|
|
38906
|
+
});
|
|
38984
38907
|
}
|
|
38985
38908
|
return v;
|
|
38986
38909
|
})
|
|
38987
|
-
}
|
|
38910
|
+
})
|
|
38988
38911
|
});
|
|
38989
38912
|
},
|
|
38990
38913
|
t,
|
|
@@ -38998,7 +38921,7 @@ const GetFormItem$1 = ({
|
|
|
38998
38921
|
className: "max-char-span",
|
|
38999
38922
|
children: t("max-char", {
|
|
39000
38923
|
chars: MAX_COMMENTS_LENGTH,
|
|
39001
|
-
filled: lastReview.comment
|
|
38924
|
+
filled: ((_lastReview$comment = lastReview.comment) === null || _lastReview$comment === void 0 ? void 0 : _lastReview$comment.length) || 0
|
|
39002
38925
|
})
|
|
39003
38926
|
})]
|
|
39004
38927
|
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -39019,7 +38942,7 @@ const GetFormItem$1 = ({
|
|
|
39019
38942
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
39020
38943
|
className: "flex flex-column justify-center mr-1",
|
|
39021
38944
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
39022
|
-
children: lastReview
|
|
38945
|
+
children: (lastReview === null || lastReview === void 0 || (_lastReview$reviewer = lastReview.reviewer) === null || _lastReview$reviewer === void 0 ? void 0 : _lastReview$reviewer.firstName) + " " + (lastReview === null || lastReview === void 0 || (_lastReview$reviewer2 = lastReview.reviewer) === null || _lastReview$reviewer2 === void 0 ? void 0 : _lastReview$reviewer2.lastName) + " - " + moment__default["default"](lastReview.createdAt).format("DD MMM YYYY")
|
|
39023
38946
|
})
|
|
39024
38947
|
})]
|
|
39025
38948
|
})]
|
|
@@ -39030,13 +38953,14 @@ const GetFormItem$1 = ({
|
|
|
39030
38953
|
return null;
|
|
39031
38954
|
}
|
|
39032
38955
|
};
|
|
39033
|
-
const editErrorHandler =
|
|
39034
|
-
|
|
39035
|
-
|
|
39036
|
-
|
|
38956
|
+
const editErrorHandler = _ref76 => {
|
|
38957
|
+
let {
|
|
38958
|
+
errorFields,
|
|
38959
|
+
t = s => s
|
|
38960
|
+
} = _ref76;
|
|
39037
38961
|
if (Array.isArray(errorFields) && errorFields.length) {
|
|
39038
38962
|
const name = errorFields[0].name.join(".");
|
|
39039
|
-
const element = document.querySelector(
|
|
38963
|
+
const element = document.querySelector("[data-id=\"".concat(name, "\"]"));
|
|
39040
38964
|
if (element) {
|
|
39041
38965
|
element.scrollIntoView();
|
|
39042
38966
|
antd.message.error(t("errors::please-correct-invalid-inputs"));
|
|
@@ -47971,7 +47895,6 @@ function AvatarGroup(_ref) {
|
|
|
47971
47895
|
const Container$1 = styled__default["default"].div`
|
|
47972
47896
|
height: ${props => props.height || '300px'};
|
|
47973
47897
|
width: ${props => props.isPdf ? props.width ? props.width : '1000px' : 'calc(100% - 48px)'};
|
|
47974
|
-
overflow: ${props => props.style?.overflow || 'visible'};
|
|
47975
47898
|
`;
|
|
47976
47899
|
|
|
47977
47900
|
const _excluded$9 = ["data", "xFieldKey", "yFieldKey", "renderTooltipContent", "tooltipConfig", "animated", "isStack", "isGroup", "isPercentage", "seriesField", "formattedYAxis", "formattedXAxis", "color", "height", "t", "isPdf", "legendConfig", "width", "xAxisConfig"];
|
|
@@ -49514,6 +49437,45 @@ const RadarChart = _ref => {
|
|
|
49514
49437
|
legendConfig,
|
|
49515
49438
|
isPdf
|
|
49516
49439
|
});
|
|
49440
|
+
|
|
49441
|
+
// Helper function to wrap long text labels to multiple lines
|
|
49442
|
+
// Ensures text is never hidden - wraps to multiple lines if needed
|
|
49443
|
+
const wrapLabel = React.useCallback(function (text) {
|
|
49444
|
+
let maxLength = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10;
|
|
49445
|
+
if (!text) {
|
|
49446
|
+
return '';
|
|
49447
|
+
}
|
|
49448
|
+
const formattedText = formattedXAxis(text);
|
|
49449
|
+
|
|
49450
|
+
// If text is short enough, return as is
|
|
49451
|
+
if (formattedText.length <= maxLength) {
|
|
49452
|
+
return formattedText;
|
|
49453
|
+
}
|
|
49454
|
+
|
|
49455
|
+
// Split by spaces to find word boundaries
|
|
49456
|
+
const words = formattedText.split(' ');
|
|
49457
|
+
const lines = [];
|
|
49458
|
+
let currentLine = '';
|
|
49459
|
+
words.forEach((word, index) => {
|
|
49460
|
+
// If adding this word would exceed maxLength, start a new line
|
|
49461
|
+
if (currentLine && (currentLine + ' ' + word).length > maxLength) {
|
|
49462
|
+
if (currentLine) {
|
|
49463
|
+
lines.push(currentLine);
|
|
49464
|
+
}
|
|
49465
|
+
currentLine = word;
|
|
49466
|
+
} else {
|
|
49467
|
+
currentLine = currentLine ? currentLine + ' ' + word : word;
|
|
49468
|
+
}
|
|
49469
|
+
|
|
49470
|
+
// If it's the last word, add it to lines
|
|
49471
|
+
if (index === words.length - 1 && currentLine) {
|
|
49472
|
+
lines.push(currentLine);
|
|
49473
|
+
}
|
|
49474
|
+
});
|
|
49475
|
+
|
|
49476
|
+
// Ensure we always return something - never empty
|
|
49477
|
+
return lines.length > 0 ? lines.join('\n') : formattedText;
|
|
49478
|
+
}, [formattedXAxis]);
|
|
49517
49479
|
React.useEffect(() => {
|
|
49518
49480
|
if (!containerRef.current) {
|
|
49519
49481
|
return;
|
|
@@ -49532,16 +49494,20 @@ const RadarChart = _ref => {
|
|
|
49532
49494
|
showMarkers: true
|
|
49533
49495
|
}, tooltipConfig),
|
|
49534
49496
|
color: color || token.colorPrimary7,
|
|
49535
|
-
|
|
49536
|
-
|
|
49497
|
+
// Increased padding to ensure labels are never clipped
|
|
49498
|
+
padding: [50, 50, 50, 50],
|
|
49537
49499
|
xAxis: {
|
|
49538
49500
|
label: {
|
|
49539
|
-
formatter:
|
|
49501
|
+
formatter: text => wrapLabel(text, 10),
|
|
49540
49502
|
offset: 15,
|
|
49503
|
+
autoRotate: false,
|
|
49504
|
+
autoHide: false,
|
|
49505
|
+
// Never hide labels
|
|
49506
|
+
autoEllipsis: false,
|
|
49507
|
+
// Never truncate with ellipsis
|
|
49541
49508
|
style: {
|
|
49542
49509
|
fontSize: 12,
|
|
49543
|
-
fill: '#666'
|
|
49544
|
-
textAlign: 'center'
|
|
49510
|
+
fill: '#666'
|
|
49545
49511
|
}
|
|
49546
49512
|
},
|
|
49547
49513
|
line: null,
|
|
@@ -49597,7 +49563,7 @@ const RadarChart = _ref => {
|
|
|
49597
49563
|
} else {
|
|
49598
49564
|
chartRef.current.update(chartConfig);
|
|
49599
49565
|
}
|
|
49600
|
-
}, [data, xFieldKey, yFieldKey, seriesField, renderTooltipContent, tooltipConfig, animated, color, formattedYAxis, formattedXAxis, score, token.colorPrimary7, rest]);
|
|
49566
|
+
}, [data, xFieldKey, yFieldKey, seriesField, renderTooltipContent, tooltipConfig, animated, color, formattedYAxis, formattedXAxis, score, token.colorPrimary7, wrapLabel, rest]);
|
|
49601
49567
|
React.useEffect(() => {
|
|
49602
49568
|
return () => {
|
|
49603
49569
|
if (chartRef.current) {
|
|
@@ -49608,23 +49574,12 @@ const RadarChart = _ref => {
|
|
|
49608
49574
|
}, []);
|
|
49609
49575
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
49610
49576
|
className: "flex flex-1 flex-column justify-content-center",
|
|
49611
|
-
style: {
|
|
49612
|
-
overflow: 'visible'
|
|
49613
|
-
},
|
|
49614
49577
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
49615
49578
|
className: "flex justify-content-center",
|
|
49616
|
-
style: {
|
|
49617
|
-
paddingX: '30px',
|
|
49618
|
-
overflow: 'visible',
|
|
49619
|
-
width: '100%'
|
|
49620
|
-
},
|
|
49621
49579
|
children: /*#__PURE__*/jsxRuntime.jsx(Container$1, {
|
|
49622
49580
|
ref: containerRef,
|
|
49623
49581
|
height: height,
|
|
49624
|
-
isPdf: isPdf
|
|
49625
|
-
style: {
|
|
49626
|
-
paddingX: '30px'
|
|
49627
|
-
}
|
|
49582
|
+
isPdf: isPdf
|
|
49628
49583
|
})
|
|
49629
49584
|
}), legendEnabled && legendPosition === 'bottom' && /*#__PURE__*/jsxRuntime.jsx(CustomLegend, {
|
|
49630
49585
|
items: legendItems,
|