datastake-daf 0.6.825 → 0.6.827
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 +1188 -1112
- package/dist/pages/index.js +111 -79
- package/dist/services/index.js +1 -2
- package/dist/style/datastake/mapbox-gl.css +330 -0
- package/dist/utils/index.js +1 -1
- package/package.json +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminTables/DocumentsTable/index.jsx +3 -13
- package/src/@daf/core/components/Screens/Admin/AdminTables/EventsTable/column.js +1 -1
- package/src/@daf/core/components/Screens/Admin/AdminTables/EventsTable/index.jsx +1 -7
- package/src/@daf/core/components/Screens/Admin/AdminTables/LocationTable/index.jsx +1 -7
- package/src/@daf/core/components/Screens/Admin/AdminTables/SubjectsTable/index.jsx +1 -7
- package/src/@daf/core/components/Screens/Admin/AdminTables/hook.js +16 -7
- package/src/@daf/pages/Events/Testimonials/config.js +1 -1
- package/src/@daf/pages/Locations/ConflictAreas/config.js +1 -1
- package/src/@daf/pages/Stakeholders/ArmedGroups/config.js +1 -1
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CommunityParticipation/JobsTimeline/index.jsx +32 -9
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CycleIndicators/HealthAndSafety/helper.js +48 -43
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CycleIndicators/HealthAndSafety/index.jsx +17 -5
- package/src/@daf/pages/Summary/Activities/PlantingCycle/components/CycleOutcomes/PlantingActivitiesTimeline.jsx +12 -5
- package/src/@daf/pages/Template/components/LinkingTemplate/config.js +5 -0
- package/src/@daf/pages/View/hooks/useViewPermissions.js +25 -3
- package/src/@daf/pages/View/index.jsx +3 -6
- package/src/@daf/services/AdminService.js +1 -2
- package/src/constants/locales/sp/translation.js +1 -1
package/dist/components/index.js
CHANGED
|
@@ -4827,7 +4827,7 @@ const config$2 = {
|
|
|
4827
4827
|
AddDocument: config$3
|
|
4828
4828
|
};
|
|
4829
4829
|
|
|
4830
|
-
const _excluded$
|
|
4830
|
+
const _excluded$E = ["width", "height", "size", "name", "fill"];
|
|
4831
4831
|
const CustomIcon = _ref => {
|
|
4832
4832
|
let {
|
|
4833
4833
|
width = 14,
|
|
@@ -4836,7 +4836,7 @@ const CustomIcon = _ref => {
|
|
|
4836
4836
|
name = "",
|
|
4837
4837
|
fill = "none"
|
|
4838
4838
|
} = _ref,
|
|
4839
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
4839
|
+
props = _objectWithoutProperties(_ref, _excluded$E);
|
|
4840
4840
|
const conf = config$2[name];
|
|
4841
4841
|
if (conf) {
|
|
4842
4842
|
return /*#__PURE__*/jsxRuntime.jsx("svg", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -5125,7 +5125,7 @@ createCommonjsModule(function (module, exports) {
|
|
|
5125
5125
|
!function(e,n){module.exports=n();}(commonjsGlobal,(function(){return {name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(e){var n=["th","st","nd","rd"],t=e%100;return "["+e+(n[(t-20)%10]||n[t]||n[0])+"]"}}}));
|
|
5126
5126
|
});
|
|
5127
5127
|
|
|
5128
|
-
const _excluded$
|
|
5128
|
+
const _excluded$D = ["view", "module", "scope", "form", "meta", "createdAt", "updatedAt"];
|
|
5129
5129
|
dayjs__default["default"].extend(customParseFormat);
|
|
5130
5130
|
dayjs__default["default"].extend(utc);
|
|
5131
5131
|
dayjs__default["default"].extend(utc);
|
|
@@ -5501,7 +5501,7 @@ const filterCreateData = data => {
|
|
|
5501
5501
|
createdAt,
|
|
5502
5502
|
updatedAt
|
|
5503
5503
|
} = data,
|
|
5504
|
-
rest = _objectWithoutProperties(data, _excluded$
|
|
5504
|
+
rest = _objectWithoutProperties(data, _excluded$D);
|
|
5505
5505
|
const _meta = isObjectEmpty(meta) ? undefined : meta;
|
|
5506
5506
|
return _objectSpread2(_objectSpread2({}, rest), {}, {
|
|
5507
5507
|
meta: _meta
|
|
@@ -6033,7 +6033,7 @@ SelectFilters.propTypes = {
|
|
|
6033
6033
|
apiUrl: PropTypes__default["default"].string
|
|
6034
6034
|
};
|
|
6035
6035
|
|
|
6036
|
-
const _excluded$
|
|
6036
|
+
const _excluded$C = ["columns", "data", "defaultFilters", "style", "pagination", "loading", "onChange", "onFilterChange", "selectOptions", "filtersConfig", "rowSelection", "setShowFilters", "rowKey", "showFilters", "hideOnLoading", "sourcesKey", "className", "projects", "t", "selectedProject", "sourceId", "projectSources", "language", "scrollX", "apiUrl", "app", "doEmptyRows"];
|
|
6037
6037
|
function DAFTable(_ref) {
|
|
6038
6038
|
let {
|
|
6039
6039
|
columns = [],
|
|
@@ -6064,7 +6064,7 @@ function DAFTable(_ref) {
|
|
|
6064
6064
|
app,
|
|
6065
6065
|
doEmptyRows
|
|
6066
6066
|
} = _ref,
|
|
6067
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
6067
|
+
rest = _objectWithoutProperties(_ref, _excluded$C);
|
|
6068
6068
|
const source = React.useMemo(() => {
|
|
6069
6069
|
if (data && Array.isArray(data)) {
|
|
6070
6070
|
return data;
|
|
@@ -6889,7 +6889,7 @@ function ComponentWithFocus(_ref) {
|
|
|
6889
6889
|
}
|
|
6890
6890
|
|
|
6891
6891
|
var _templateObject$h;
|
|
6892
|
-
const _excluded$
|
|
6892
|
+
const _excluded$B = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
|
|
6893
6893
|
function StickyTable(_ref) {
|
|
6894
6894
|
let {
|
|
6895
6895
|
size = "small",
|
|
@@ -6900,7 +6900,7 @@ function StickyTable(_ref) {
|
|
|
6900
6900
|
pagination = false,
|
|
6901
6901
|
doEmptyRows = true
|
|
6902
6902
|
} = _ref,
|
|
6903
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
6903
|
+
props = _objectWithoutProperties(_ref, _excluded$B);
|
|
6904
6904
|
const data = React__default["default"].useMemo(() => {
|
|
6905
6905
|
if (!doEmptyRows) {
|
|
6906
6906
|
return dataSource;
|
|
@@ -7428,7 +7428,7 @@ const BTN_SIZE = {
|
|
|
7428
7428
|
LG: 'large'
|
|
7429
7429
|
};
|
|
7430
7430
|
|
|
7431
|
-
const _excluded$
|
|
7431
|
+
const _excluded$A = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
|
|
7432
7432
|
function DafButton(_ref) {
|
|
7433
7433
|
let {
|
|
7434
7434
|
content = '',
|
|
@@ -7442,7 +7442,7 @@ function DafButton(_ref) {
|
|
|
7442
7442
|
style = {},
|
|
7443
7443
|
className = ''
|
|
7444
7444
|
} = _ref,
|
|
7445
|
-
restProps = _objectWithoutProperties(_ref, _excluded$
|
|
7445
|
+
restProps = _objectWithoutProperties(_ref, _excluded$A);
|
|
7446
7446
|
return /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
|
|
7447
7447
|
icon: icon,
|
|
7448
7448
|
type: type,
|
|
@@ -7561,12 +7561,12 @@ const Style$R = styled__default["default"].div`
|
|
|
7561
7561
|
}
|
|
7562
7562
|
`;
|
|
7563
7563
|
|
|
7564
|
-
const _excluded$
|
|
7564
|
+
const _excluded$z = ["children"];
|
|
7565
7565
|
const BorderedButton = _ref => {
|
|
7566
7566
|
let {
|
|
7567
7567
|
children
|
|
7568
7568
|
} = _ref,
|
|
7569
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
7569
|
+
props = _objectWithoutProperties(_ref, _excluded$z);
|
|
7570
7570
|
return /*#__PURE__*/jsxRuntime.jsx(Style$R, {
|
|
7571
7571
|
className: "d-btn-cont",
|
|
7572
7572
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -7706,12 +7706,12 @@ Badge.propTypes = {
|
|
|
7706
7706
|
props: PropTypes__default["default"].object
|
|
7707
7707
|
};
|
|
7708
7708
|
|
|
7709
|
-
const _excluded$
|
|
7709
|
+
const _excluded$y = ["icon"];
|
|
7710
7710
|
function GetIcon(_ref) {
|
|
7711
7711
|
let {
|
|
7712
7712
|
icon
|
|
7713
7713
|
} = _ref,
|
|
7714
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
7714
|
+
props = _objectWithoutProperties(_ref, _excluded$y);
|
|
7715
7715
|
let Icon = Icons__namespace.CloseOutlined;
|
|
7716
7716
|
if (Icons__namespace[icon]) {
|
|
7717
7717
|
Icon = Icons__namespace[icon];
|
|
@@ -8041,7 +8041,7 @@ const MultiSelectStyled = styled__default["default"](antd.Select)`
|
|
|
8041
8041
|
}
|
|
8042
8042
|
`;
|
|
8043
8043
|
|
|
8044
|
-
const _excluded$
|
|
8044
|
+
const _excluded$x = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
|
|
8045
8045
|
const {
|
|
8046
8046
|
useToken: useToken$p
|
|
8047
8047
|
} = antd.theme;
|
|
@@ -8134,7 +8134,7 @@ function Multiselect(_ref) {
|
|
|
8134
8134
|
isSingle = false,
|
|
8135
8135
|
selectionType = SELECTION_TYPES.DEFAULT
|
|
8136
8136
|
} = _ref,
|
|
8137
|
-
restProps = _objectWithoutProperties(_ref, _excluded$
|
|
8137
|
+
restProps = _objectWithoutProperties(_ref, _excluded$x);
|
|
8138
8138
|
const {
|
|
8139
8139
|
token
|
|
8140
8140
|
} = useToken$p();
|
|
@@ -8854,7 +8854,7 @@ DAFHeader.propTypes = {
|
|
|
8854
8854
|
filtersConfig: PropTypes__default["default"].any
|
|
8855
8855
|
};
|
|
8856
8856
|
|
|
8857
|
-
const _excluded$
|
|
8857
|
+
const _excluded$w = ["tabs", "onChange", "value", "className"];
|
|
8858
8858
|
function TabsHeader(_ref) {
|
|
8859
8859
|
let {
|
|
8860
8860
|
tabs = [],
|
|
@@ -8862,7 +8862,7 @@ function TabsHeader(_ref) {
|
|
|
8862
8862
|
value = '',
|
|
8863
8863
|
className = 'mt-2'
|
|
8864
8864
|
} = _ref,
|
|
8865
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
8865
|
+
rest = _objectWithoutProperties(_ref, _excluded$w);
|
|
8866
8866
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8867
8867
|
className: formatClassname(['daf-tabs-header pl-6 pr-6', className]),
|
|
8868
8868
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Tabs, _objectSpread2({
|
|
@@ -8959,7 +8959,7 @@ DrawerHeader.propTypes = {
|
|
|
8959
8959
|
tabsConfig: PropTypes__default["default"].any
|
|
8960
8960
|
};
|
|
8961
8961
|
|
|
8962
|
-
const _excluded$
|
|
8962
|
+
const _excluded$v = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
|
|
8963
8963
|
const useFooter = _ref => {
|
|
8964
8964
|
let {
|
|
8965
8965
|
leftContent,
|
|
@@ -8994,7 +8994,7 @@ const useFooter = _ref => {
|
|
|
8994
8994
|
style = {},
|
|
8995
8995
|
className = ""
|
|
8996
8996
|
} = button,
|
|
8997
|
-
restProps = _objectWithoutProperties(button, _excluded$
|
|
8997
|
+
restProps = _objectWithoutProperties(button, _excluded$v);
|
|
8998
8998
|
return /*#__PURE__*/jsxRuntime.jsx(DafButton, _objectSpread2({
|
|
8999
8999
|
content: label,
|
|
9000
9000
|
type: type,
|
|
@@ -11875,7 +11875,7 @@ Widget.propTypes = {
|
|
|
11875
11875
|
};
|
|
11876
11876
|
Widget.displayName = 'Widget';
|
|
11877
11877
|
|
|
11878
|
-
const _excluded$
|
|
11878
|
+
const _excluded$u = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
|
|
11879
11879
|
function ImageWidget(_ref) {
|
|
11880
11880
|
let {
|
|
11881
11881
|
loading = false,
|
|
@@ -11886,7 +11886,7 @@ function ImageWidget(_ref) {
|
|
|
11886
11886
|
noDescriptionText,
|
|
11887
11887
|
isPdf = false
|
|
11888
11888
|
} = _ref,
|
|
11889
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
11889
|
+
props = _objectWithoutProperties(_ref, _excluded$u);
|
|
11890
11890
|
const expandable = isPdf ? false : props.expandable;
|
|
11891
11891
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
11892
11892
|
loading: loading,
|
|
@@ -11946,7 +11946,7 @@ function ImageWidget(_ref) {
|
|
|
11946
11946
|
ImageWidget.displayName = 'ImageWidget';
|
|
11947
11947
|
|
|
11948
11948
|
var _templateObject$e;
|
|
11949
|
-
const _excluded$
|
|
11949
|
+
const _excluded$t = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
|
|
11950
11950
|
function FlowWidget(_ref) {
|
|
11951
11951
|
let {
|
|
11952
11952
|
title,
|
|
@@ -11958,7 +11958,7 @@ function FlowWidget(_ref) {
|
|
|
11958
11958
|
className,
|
|
11959
11959
|
direction = "horizontal"
|
|
11960
11960
|
} = _ref,
|
|
11961
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11961
|
+
rest = _objectWithoutProperties(_ref, _excluded$t);
|
|
11962
11962
|
const [activeTab, setActiveTab] = React.useState();
|
|
11963
11963
|
React.useEffect(() => {
|
|
11964
11964
|
if (defaultActiveTab) {
|
|
@@ -15689,7 +15689,7 @@ Map$3.propTypes = {
|
|
|
15689
15689
|
link: PropTypes__default["default"].any
|
|
15690
15690
|
};
|
|
15691
15691
|
|
|
15692
|
-
const _excluded$
|
|
15692
|
+
const _excluded$s = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
|
|
15693
15693
|
function InExpandableWidgetMap(_ref) {
|
|
15694
15694
|
let {
|
|
15695
15695
|
isExpanded,
|
|
@@ -15703,7 +15703,7 @@ function InExpandableWidgetMap(_ref) {
|
|
|
15703
15703
|
height,
|
|
15704
15704
|
widgetConfig
|
|
15705
15705
|
} = _ref,
|
|
15706
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
15706
|
+
rest = _objectWithoutProperties(_ref, _excluded$s);
|
|
15707
15707
|
const [mapKey, setMapKey] = React.useState(0);
|
|
15708
15708
|
const [isMapReady, setIsMapReady] = React.useState(false);
|
|
15709
15709
|
React.useEffect(() => {
|
|
@@ -17903,14 +17903,14 @@ const MapConfig = ({
|
|
|
17903
17903
|
});
|
|
17904
17904
|
};
|
|
17905
17905
|
|
|
17906
|
-
const _excluded$
|
|
17906
|
+
const _excluded$r = ["config", "title", "loading"];
|
|
17907
17907
|
const Details = _ref => {
|
|
17908
17908
|
let {
|
|
17909
17909
|
config = [],
|
|
17910
17910
|
title,
|
|
17911
17911
|
loading = false
|
|
17912
17912
|
} = _ref,
|
|
17913
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17913
|
+
rest = _objectWithoutProperties(_ref, _excluded$r);
|
|
17914
17914
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
17915
17915
|
className: "with-border-header h-w-btn-header card",
|
|
17916
17916
|
loading: loading,
|
|
@@ -17926,14 +17926,14 @@ const Details = _ref => {
|
|
|
17926
17926
|
}));
|
|
17927
17927
|
};
|
|
17928
17928
|
|
|
17929
|
-
const _excluded$
|
|
17929
|
+
const _excluded$q = ["config", "title", "loading"];
|
|
17930
17930
|
const KeyIndicatorsDetails = _ref => {
|
|
17931
17931
|
let {
|
|
17932
17932
|
config,
|
|
17933
17933
|
title,
|
|
17934
17934
|
loading = false
|
|
17935
17935
|
} = _ref,
|
|
17936
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17936
|
+
rest = _objectWithoutProperties(_ref, _excluded$q);
|
|
17937
17937
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
17938
17938
|
className: "with-border-header h-w-btn-header",
|
|
17939
17939
|
title: title,
|
|
@@ -17963,7 +17963,7 @@ const Style$G = styled__default["default"].div`
|
|
|
17963
17963
|
}
|
|
17964
17964
|
`;
|
|
17965
17965
|
|
|
17966
|
-
const _excluded$
|
|
17966
|
+
const _excluded$p = ["children", "config", "detailsTitle", "firstColumnWidth"];
|
|
17967
17967
|
const DetailsSection = _ref => {
|
|
17968
17968
|
let {
|
|
17969
17969
|
children,
|
|
@@ -17971,7 +17971,7 @@ const DetailsSection = _ref => {
|
|
|
17971
17971
|
detailsTitle,
|
|
17972
17972
|
firstColumnWidth = "250px"
|
|
17973
17973
|
} = _ref,
|
|
17974
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17974
|
+
rest = _objectWithoutProperties(_ref, _excluded$p);
|
|
17975
17975
|
return /*#__PURE__*/jsxRuntime.jsx(Style$G, {
|
|
17976
17976
|
firstColumnWidth: firstColumnWidth,
|
|
17977
17977
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -18147,14 +18147,14 @@ const getGoalConfig = () => {
|
|
|
18147
18147
|
};
|
|
18148
18148
|
|
|
18149
18149
|
var _templateObject$c;
|
|
18150
|
-
const _excluded$
|
|
18150
|
+
const _excluded$o = ["title", "activeSdgGoals", "t"];
|
|
18151
18151
|
function SDGWidget(_ref) {
|
|
18152
18152
|
let {
|
|
18153
18153
|
title = "Sustainable Development Goals",
|
|
18154
18154
|
activeSdgGoals = [],
|
|
18155
18155
|
t = key => key
|
|
18156
18156
|
} = _ref,
|
|
18157
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18157
|
+
props = _objectWithoutProperties(_ref, _excluded$o);
|
|
18158
18158
|
const sdgConfig = getGoalConfig();
|
|
18159
18159
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
18160
18160
|
title: title,
|
|
@@ -18452,7 +18452,7 @@ function SdgList({
|
|
|
18452
18452
|
});
|
|
18453
18453
|
}
|
|
18454
18454
|
|
|
18455
|
-
const _excluded$
|
|
18455
|
+
const _excluded$n = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
|
|
18456
18456
|
const {
|
|
18457
18457
|
Meta
|
|
18458
18458
|
} = antd.Card;
|
|
@@ -18472,7 +18472,7 @@ function ProjectWidget(_ref) {
|
|
|
18472
18472
|
hideSDGList = false,
|
|
18473
18473
|
t = x => x
|
|
18474
18474
|
} = _ref,
|
|
18475
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18475
|
+
props = _objectWithoutProperties(_ref, _excluded$n);
|
|
18476
18476
|
const [isHovered, setIsHovered] = React__default["default"].useState(false);
|
|
18477
18477
|
const {
|
|
18478
18478
|
token
|
|
@@ -18744,13 +18744,13 @@ const WidgetCard = _ref => {
|
|
|
18744
18744
|
});
|
|
18745
18745
|
};
|
|
18746
18746
|
|
|
18747
|
-
const _excluded$
|
|
18747
|
+
const _excluded$m = ["title", "children"];
|
|
18748
18748
|
const CarouselWidget = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
18749
18749
|
let {
|
|
18750
18750
|
title,
|
|
18751
18751
|
children
|
|
18752
18752
|
} = _ref,
|
|
18753
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
18753
|
+
rest = _objectWithoutProperties(_ref, _excluded$m);
|
|
18754
18754
|
/**
|
|
18755
18755
|
* Handles carousel slide change events
|
|
18756
18756
|
* @param {number} currentSlide - The index of the current slide after change
|
|
@@ -18914,7 +18914,7 @@ const EmptyStateContainer = styled__default["default"].div`
|
|
|
18914
18914
|
}
|
|
18915
18915
|
`;
|
|
18916
18916
|
|
|
18917
|
-
const _excluded$
|
|
18917
|
+
const _excluded$l = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
|
|
18918
18918
|
function ImageCarousel(_ref) {
|
|
18919
18919
|
let {
|
|
18920
18920
|
title,
|
|
@@ -18929,7 +18929,7 @@ function ImageCarousel(_ref) {
|
|
|
18929
18929
|
emptyLogo = antd.Empty.PRESENTED_IMAGE_SIMPLE,
|
|
18930
18930
|
emptyText = "No Image"
|
|
18931
18931
|
} = _ref,
|
|
18932
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
18932
|
+
rest = _objectWithoutProperties(_ref, _excluded$l);
|
|
18933
18933
|
const [previewVisible, setPreviewVisible] = React.useState(false);
|
|
18934
18934
|
const [current, setCurrent] = React.useState(0);
|
|
18935
18935
|
const carouselRef = React.useRef(null);
|
|
@@ -19298,7 +19298,7 @@ const getVegetationConfig = () => {
|
|
|
19298
19298
|
};
|
|
19299
19299
|
|
|
19300
19300
|
var _templateObject$a, _templateObject2$3;
|
|
19301
|
-
const _excluded$
|
|
19301
|
+
const _excluded$k = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
|
|
19302
19302
|
function VegetationWidget(_ref) {
|
|
19303
19303
|
let {
|
|
19304
19304
|
title = "Vegetation Health",
|
|
@@ -19310,7 +19310,7 @@ function VegetationWidget(_ref) {
|
|
|
19310
19310
|
growthObservations = [],
|
|
19311
19311
|
t = key => key
|
|
19312
19312
|
} = _ref,
|
|
19313
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19313
|
+
props = _objectWithoutProperties(_ref, _excluded$k);
|
|
19314
19314
|
let vegetationConfig = getVegetationConfig();
|
|
19315
19315
|
const allVegetationKeys = vegetationConfig.map(item => item.key);
|
|
19316
19316
|
if (filterKeys && Array.isArray(filterKeys)) {
|
|
@@ -19426,7 +19426,7 @@ const getFaunaConfig = () => {
|
|
|
19426
19426
|
};
|
|
19427
19427
|
|
|
19428
19428
|
var _templateObject$9, _templateObject2$2;
|
|
19429
|
-
const _excluded$
|
|
19429
|
+
const _excluded$j = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
|
|
19430
19430
|
function FaunaWidget(_ref) {
|
|
19431
19431
|
let {
|
|
19432
19432
|
title = "Observed Fauna",
|
|
@@ -19437,7 +19437,7 @@ function FaunaWidget(_ref) {
|
|
|
19437
19437
|
itemHeight = 100,
|
|
19438
19438
|
t = key => key
|
|
19439
19439
|
} = _ref,
|
|
19440
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19440
|
+
props = _objectWithoutProperties(_ref, _excluded$j);
|
|
19441
19441
|
let faunaConfig = getFaunaConfig();
|
|
19442
19442
|
|
|
19443
19443
|
// Filter to show only specific keys if filterKeys is provided
|
|
@@ -19502,7 +19502,7 @@ const getInvasiveSpeciesConfig = () => {
|
|
|
19502
19502
|
};
|
|
19503
19503
|
|
|
19504
19504
|
var _templateObject$8, _templateObject2$1;
|
|
19505
|
-
const _excluded$
|
|
19505
|
+
const _excluded$i = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
|
|
19506
19506
|
function InvasiveSpeciesWidget(_ref) {
|
|
19507
19507
|
let {
|
|
19508
19508
|
title = "Invasive Species",
|
|
@@ -19514,7 +19514,7 @@ function InvasiveSpeciesWidget(_ref) {
|
|
|
19514
19514
|
itemHeight = 100,
|
|
19515
19515
|
t = key => key
|
|
19516
19516
|
} = _ref,
|
|
19517
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19517
|
+
props = _objectWithoutProperties(_ref, _excluded$i);
|
|
19518
19518
|
let invasiveSpeciesConfig = getInvasiveSpeciesConfig();
|
|
19519
19519
|
|
|
19520
19520
|
// Filter to show only specific keys if filterKeys is provided
|
|
@@ -24937,8 +24937,8 @@ const RepeatableModals = ({
|
|
|
24937
24937
|
}) : null;
|
|
24938
24938
|
};
|
|
24939
24939
|
|
|
24940
|
-
const _excluded$
|
|
24941
|
-
_excluded2$
|
|
24940
|
+
const _excluded$h = ["viewGroup"],
|
|
24941
|
+
_excluded2$1 = ["label", "icon", "position"];
|
|
24942
24942
|
const Content$1 = _ref => {
|
|
24943
24943
|
let {
|
|
24944
24944
|
style = {},
|
|
@@ -25009,7 +25009,7 @@ const Content$1 = _ref => {
|
|
|
25009
25009
|
if (groups[gKey].viewGroup === key) {
|
|
25010
25010
|
// eslint-disable-next-line no-unused-vars
|
|
25011
25011
|
const _groups$gKey = groups[gKey],
|
|
25012
|
-
gCfg = _objectWithoutProperties(_groups$gKey, _excluded$
|
|
25012
|
+
gCfg = _objectWithoutProperties(_groups$gKey, _excluded$h);
|
|
25013
25013
|
items[gKey] = gCfg;
|
|
25014
25014
|
}
|
|
25015
25015
|
return items;
|
|
@@ -25244,7 +25244,7 @@ const Content$1 = _ref => {
|
|
|
25244
25244
|
showIcon: true
|
|
25245
25245
|
});
|
|
25246
25246
|
}
|
|
25247
|
-
let groups = _objectWithoutProperties(f, _excluded2$
|
|
25247
|
+
let groups = _objectWithoutProperties(f, _excluded2$1);
|
|
25248
25248
|
groups = Object.keys(groups).reduce((items, key) => {
|
|
25249
25249
|
var _groups$key2;
|
|
25250
25250
|
if (!((_groups$key2 = groups[key]) !== null && _groups$key2 !== void 0 && (_groups$key2 = _groups$key2.meta) !== null && _groups$key2 !== void 0 && _groups$key2.excludeFromView)) {
|
|
@@ -25296,7 +25296,7 @@ const Content$1 = _ref => {
|
|
|
25296
25296
|
});
|
|
25297
25297
|
};
|
|
25298
25298
|
|
|
25299
|
-
const _excluded$
|
|
25299
|
+
const _excluded$g = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
|
|
25300
25300
|
function Modal(_ref) {
|
|
25301
25301
|
let {
|
|
25302
25302
|
t = text => text,
|
|
@@ -25312,7 +25312,7 @@ function Modal(_ref) {
|
|
|
25312
25312
|
disabled = false,
|
|
25313
25313
|
withModalFormWrapper = true
|
|
25314
25314
|
} = _ref,
|
|
25315
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
25315
|
+
props = _objectWithoutProperties(_ref, _excluded$g);
|
|
25316
25316
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Modal, _objectSpread2(_objectSpread2({
|
|
25317
25317
|
width: 650,
|
|
25318
25318
|
footer: null,
|
|
@@ -35959,13 +35959,11 @@ const beforeUpload = allowedExtensions => file => {
|
|
|
35959
35959
|
};
|
|
35960
35960
|
const allowedImageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.avif', '.bmp', '.tiff', '.tif', '.heif', '.heic', '.svg', '.ico'];
|
|
35961
35961
|
|
|
35962
|
-
|
|
35963
|
-
_excluded2$1 = ["label", "description", "excludeFromEdit", "showFormIf", "icon", "position", "template", "formClass"];
|
|
35962
|
+
/* eslint-disable no-case-declarations */
|
|
35964
35963
|
dayjs__default["default"].extend(utc);
|
|
35965
35964
|
dayjs__default["default"].extend(timezone);
|
|
35966
35965
|
dayjs__default["default"].tz.setDefault("UTC");
|
|
35967
|
-
const getDefaultInputValue =
|
|
35968
|
-
let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
35966
|
+
const getDefaultInputValue = (input = {}) => {
|
|
35969
35967
|
let value = undefined;
|
|
35970
35968
|
if (input.type === "multiselect") {
|
|
35971
35969
|
value = [];
|
|
@@ -35983,30 +35981,33 @@ const checkCondition$1 = (condition, repeatValues, formsValue) => {
|
|
|
35983
35981
|
const isShown = _checkValue(isNotEmpty ? field : wantedValue, match, isNotEmpty ? formValue : value);
|
|
35984
35982
|
return isShown;
|
|
35985
35983
|
};
|
|
35986
|
-
const renderDataLinkGroup =
|
|
35987
|
-
|
|
35988
|
-
|
|
35989
|
-
|
|
35990
|
-
|
|
35991
|
-
|
|
35992
|
-
|
|
35993
|
-
|
|
35994
|
-
|
|
35995
|
-
|
|
35996
|
-
|
|
35997
|
-
|
|
35998
|
-
|
|
35999
|
-
const
|
|
36000
|
-
|
|
36001
|
-
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";
|
|
36002
|
-
});
|
|
36003
|
-
const dataLinkInput = ((input === null || input === void 0 ? void 0 : input.inputs) || {})[dataLinkKey];
|
|
36004
|
-
const otherInputs = Object.keys((input === null || input === void 0 ? void 0 : input.inputs) || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
|
|
36005
|
-
all[key] = input === null || input === void 0 ? void 0 : input.inputs[key];
|
|
35984
|
+
const renderDataLinkGroup = ({
|
|
35985
|
+
input,
|
|
35986
|
+
groupFormId,
|
|
35987
|
+
name,
|
|
35988
|
+
formsValue,
|
|
35989
|
+
form,
|
|
35990
|
+
onValuesChange,
|
|
35991
|
+
setValues,
|
|
35992
|
+
changeLinking,
|
|
35993
|
+
isHighlighted
|
|
35994
|
+
}) => {
|
|
35995
|
+
const dataLinkKey = Object.keys(input?.inputs || {}).find(k => input?.inputs[k]?.type === "dataLink");
|
|
35996
|
+
const dataLinkInput = (input?.inputs || {})[dataLinkKey];
|
|
35997
|
+
const otherInputs = Object.keys(input?.inputs || {}).filter(k => k !== dataLinkKey).reduce((all, key) => {
|
|
35998
|
+
all[key] = input?.inputs[key];
|
|
36006
35999
|
return all;
|
|
36007
36000
|
}, {});
|
|
36008
|
-
const isSingle =
|
|
36009
|
-
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [
|
|
36001
|
+
const isSingle = input?.meta?.maxRepeat === 1;
|
|
36002
|
+
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
|
|
36003
|
+
...(formsValue[groupFormId] || {})[name]
|
|
36004
|
+
}] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
|
|
36005
|
+
...v
|
|
36006
|
+
})) : isSingle ? formsValue[name] ? [{
|
|
36007
|
+
...formsValue[name]
|
|
36008
|
+
}] : [] : getArray(formsValue[name] || []).map(v => ({
|
|
36009
|
+
...v
|
|
36010
|
+
}));
|
|
36010
36011
|
const onUpdate = (val, i) => {
|
|
36011
36012
|
const _val = isSingle ? {
|
|
36012
36013
|
[name]: val
|
|
@@ -36014,20 +36015,31 @@ const renderDataLinkGroup = _ref2 => {
|
|
|
36014
36015
|
[name]: formData.map((d, j) => i === j ? val : d)
|
|
36015
36016
|
};
|
|
36016
36017
|
if (groupFormId) {
|
|
36017
|
-
const _defaultData =
|
|
36018
|
-
const _newData =
|
|
36019
|
-
|
|
36018
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36019
|
+
const _newData = {
|
|
36020
|
+
..._defaultData,
|
|
36021
|
+
..._val
|
|
36022
|
+
};
|
|
36023
|
+
onValuesChange(_newData, {
|
|
36024
|
+
...formsValue,
|
|
36020
36025
|
[groupFormId]: _newData
|
|
36021
|
-
})
|
|
36022
|
-
form
|
|
36023
|
-
setValues(
|
|
36026
|
+
});
|
|
36027
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36028
|
+
setValues({
|
|
36029
|
+
...formsValue,
|
|
36024
36030
|
[groupFormId]: _newData
|
|
36025
|
-
})
|
|
36031
|
+
});
|
|
36026
36032
|
return;
|
|
36027
36033
|
}
|
|
36028
|
-
onValuesChange(_val,
|
|
36029
|
-
|
|
36030
|
-
|
|
36034
|
+
onValuesChange(_val, {
|
|
36035
|
+
...formsValue,
|
|
36036
|
+
..._val
|
|
36037
|
+
});
|
|
36038
|
+
form?.setFieldValue(name, _val[name]);
|
|
36039
|
+
setValues({
|
|
36040
|
+
...formsValue,
|
|
36041
|
+
..._val
|
|
36042
|
+
});
|
|
36031
36043
|
};
|
|
36032
36044
|
return /*#__PURE__*/jsxRuntime.jsx(DataLinkGroup, {
|
|
36033
36045
|
form: input,
|
|
@@ -36038,79 +36050,102 @@ const renderDataLinkGroup = _ref2 => {
|
|
|
36038
36050
|
isHighlighted: isHighlighted,
|
|
36039
36051
|
dataLinkInput: dataLinkInput,
|
|
36040
36052
|
formsValue: formsValue,
|
|
36041
|
-
values: groupFormId ?
|
|
36053
|
+
values: groupFormId ? {
|
|
36054
|
+
...(formsValue[groupFormId] || {}),
|
|
36042
36055
|
meta: {
|
|
36043
|
-
inputs: (
|
|
36056
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
36044
36057
|
}
|
|
36045
|
-
}
|
|
36058
|
+
} : formsValue,
|
|
36046
36059
|
name: name,
|
|
36047
36060
|
groupFormId: groupFormId,
|
|
36048
|
-
maxRepeat: input
|
|
36049
|
-
remove:
|
|
36050
|
-
|
|
36051
|
-
|
|
36052
|
-
} = _ref3;
|
|
36061
|
+
maxRepeat: input?.meta?.maxRepeat,
|
|
36062
|
+
remove: ({
|
|
36063
|
+
key
|
|
36064
|
+
}) => {
|
|
36053
36065
|
const _val = isSingle ? {
|
|
36054
36066
|
[name]: null
|
|
36055
36067
|
} : {
|
|
36056
36068
|
[name]: formData.filter((v, j) => j !== key)
|
|
36057
36069
|
};
|
|
36058
36070
|
if (groupFormId) {
|
|
36059
|
-
const _defaultData =
|
|
36060
|
-
const _newData =
|
|
36061
|
-
|
|
36071
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36072
|
+
const _newData = {
|
|
36073
|
+
..._defaultData,
|
|
36074
|
+
..._val
|
|
36075
|
+
};
|
|
36076
|
+
onValuesChange(_newData, {
|
|
36077
|
+
...formsValue,
|
|
36062
36078
|
[groupFormId]: _newData
|
|
36063
|
-
})
|
|
36064
|
-
form
|
|
36065
|
-
setValues(
|
|
36079
|
+
});
|
|
36080
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36081
|
+
setValues({
|
|
36082
|
+
...formsValue,
|
|
36066
36083
|
[groupFormId]: _newData
|
|
36067
|
-
})
|
|
36084
|
+
});
|
|
36068
36085
|
return;
|
|
36069
36086
|
}
|
|
36070
|
-
onValuesChange(_val,
|
|
36071
|
-
|
|
36072
|
-
|
|
36087
|
+
onValuesChange(_val, {
|
|
36088
|
+
...formsValue,
|
|
36089
|
+
..._val
|
|
36090
|
+
});
|
|
36091
|
+
form?.setFieldValue(name, _val[name]);
|
|
36092
|
+
setValues({
|
|
36093
|
+
...formsValue,
|
|
36094
|
+
..._val
|
|
36095
|
+
});
|
|
36073
36096
|
},
|
|
36074
36097
|
add: val => {
|
|
36075
36098
|
const _val = isSingle ? {
|
|
36076
36099
|
[name]: val
|
|
36077
36100
|
} : {
|
|
36078
|
-
[name]: [...formData,
|
|
36101
|
+
[name]: [...formData, {
|
|
36102
|
+
...val
|
|
36103
|
+
}]
|
|
36079
36104
|
};
|
|
36080
36105
|
if (groupFormId) {
|
|
36081
|
-
const _defaultData =
|
|
36082
|
-
const _newData =
|
|
36083
|
-
|
|
36084
|
-
|
|
36106
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36107
|
+
const _newData = {
|
|
36108
|
+
..._defaultData,
|
|
36109
|
+
..._val
|
|
36110
|
+
};
|
|
36111
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36112
|
+
onValuesChange(_newData, {
|
|
36113
|
+
...formsValue,
|
|
36085
36114
|
[groupFormId]: _newData
|
|
36086
|
-
})
|
|
36087
|
-
setValues(
|
|
36115
|
+
});
|
|
36116
|
+
setValues({
|
|
36117
|
+
...formsValue,
|
|
36088
36118
|
[groupFormId]: _newData
|
|
36089
|
-
})
|
|
36119
|
+
});
|
|
36090
36120
|
return;
|
|
36091
36121
|
}
|
|
36092
|
-
form
|
|
36093
|
-
onValuesChange(_val,
|
|
36094
|
-
|
|
36122
|
+
form?.setFieldValue(name, _val[name]);
|
|
36123
|
+
onValuesChange(_val, {
|
|
36124
|
+
...formsValue,
|
|
36125
|
+
..._val
|
|
36126
|
+
});
|
|
36127
|
+
setValues({
|
|
36128
|
+
...formsValue,
|
|
36129
|
+
..._val
|
|
36130
|
+
});
|
|
36095
36131
|
},
|
|
36096
36132
|
k: name,
|
|
36097
36133
|
formData: formData
|
|
36098
36134
|
});
|
|
36099
36135
|
};
|
|
36100
36136
|
function showHideInput$1(input, data, repeatIndex, repeatValues, inputMeta) {
|
|
36101
|
-
|
|
36102
|
-
if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
|
|
36137
|
+
if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
|
|
36103
36138
|
return false;
|
|
36104
36139
|
}
|
|
36105
|
-
if (typeof
|
|
36106
|
-
|
|
36107
|
-
return !(input !== null && input !== void 0 && (_input$meta4 = input.meta) !== null && _input$meta4 !== void 0 && _input$meta4.excludeFromEdit);
|
|
36140
|
+
if (typeof input?.meta?.excludeFromEdit === "boolean") {
|
|
36141
|
+
return !input?.meta?.excludeFromEdit;
|
|
36108
36142
|
}
|
|
36109
|
-
const formsValue =
|
|
36110
|
-
|
|
36111
|
-
|
|
36112
|
-
|
|
36113
|
-
|
|
36143
|
+
const formsValue = {
|
|
36144
|
+
...data
|
|
36145
|
+
};
|
|
36146
|
+
Object.keys(data?.meta?.inputs || {}).forEach(key => {
|
|
36147
|
+
const input = data?.meta?.inputs[key];
|
|
36148
|
+
if (input?.notApplicable || input?.notAvailable) {
|
|
36114
36149
|
formsValue[key] = undefined;
|
|
36115
36150
|
delete formsValue[key];
|
|
36116
36151
|
}
|
|
@@ -36169,35 +36204,35 @@ function getInputHeadLines$1(type, i, input, values) {
|
|
|
36169
36204
|
switch (type) {
|
|
36170
36205
|
case "h2":
|
|
36171
36206
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36172
|
-
className:
|
|
36207
|
+
className: `title-semibold-2 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36173
36208
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36174
36209
|
children: getInputLabel$1(input, values)
|
|
36175
36210
|
})
|
|
36176
36211
|
});
|
|
36177
36212
|
case "h3":
|
|
36178
36213
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36179
|
-
className:
|
|
36214
|
+
className: `title-semibold-3 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36180
36215
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36181
36216
|
children: getInputLabel$1(input, values)
|
|
36182
36217
|
})
|
|
36183
36218
|
});
|
|
36184
36219
|
case "h4":
|
|
36185
36220
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36186
|
-
className:
|
|
36221
|
+
className: `title-semibold-4 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36187
36222
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36188
36223
|
children: getInputLabel$1(input, values)
|
|
36189
36224
|
})
|
|
36190
36225
|
});
|
|
36191
36226
|
case "h5":
|
|
36192
36227
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36193
|
-
className:
|
|
36228
|
+
className: `title-semibold-5 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36194
36229
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36195
36230
|
children: getInputLabel$1(input, values)
|
|
36196
36231
|
})
|
|
36197
36232
|
});
|
|
36198
36233
|
case "h6":
|
|
36199
36234
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36200
|
-
className:
|
|
36235
|
+
className: `title-semibold-6 ${input.marginBottom || ""} ${input.groupHeader || ""} ${i ? input.marginTop || "" : ""}`,
|
|
36201
36236
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
36202
36237
|
children: getInputLabel$1(input, values)
|
|
36203
36238
|
})
|
|
@@ -36206,16 +36241,15 @@ function getInputHeadLines$1(type, i, input, values) {
|
|
|
36206
36241
|
return null;
|
|
36207
36242
|
}
|
|
36208
36243
|
}
|
|
36209
|
-
function getInputProp(prop) {
|
|
36210
|
-
let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
36211
|
-
let scope = arguments.length > 2 ? arguments[2] : undefined;
|
|
36244
|
+
function getInputProp(prop, formsValue = {}, scope) {
|
|
36212
36245
|
if (prop && typeof prop === "object") {
|
|
36213
36246
|
const validations = Object.keys(prop);
|
|
36214
36247
|
const key = validations.find(v => {
|
|
36215
36248
|
let [path, match, wantedValue] = v.split(/( is | includes | not | notEmpty )/gim);
|
|
36216
|
-
const value = dot__default["default"].pick(path,
|
|
36249
|
+
const value = dot__default["default"].pick(path, {
|
|
36250
|
+
...formsValue,
|
|
36217
36251
|
scope
|
|
36218
|
-
})
|
|
36252
|
+
});
|
|
36219
36253
|
return _checkValue(wantedValue, match, value);
|
|
36220
36254
|
});
|
|
36221
36255
|
const label = key ? prop[key] : prop[validations[0]];
|
|
@@ -36224,33 +36258,29 @@ function getInputProp(prop) {
|
|
|
36224
36258
|
return prop;
|
|
36225
36259
|
}
|
|
36226
36260
|
}
|
|
36227
|
-
function getInputLabel$1(input) {
|
|
36228
|
-
let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
36229
|
-
let asText = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
36261
|
+
function getInputLabel$1(input, formsValue = {}, asText = false) {
|
|
36230
36262
|
return /*#__PURE__*/jsxRuntime.jsx(InputLabel, {
|
|
36231
36263
|
input: input,
|
|
36232
36264
|
formsValue: formsValue,
|
|
36233
36265
|
asText: asText
|
|
36234
36266
|
});
|
|
36235
36267
|
}
|
|
36236
|
-
const InputLabel =
|
|
36237
|
-
|
|
36238
|
-
|
|
36239
|
-
|
|
36240
|
-
|
|
36241
|
-
asText
|
|
36242
|
-
} = _ref4;
|
|
36268
|
+
const InputLabel = ({
|
|
36269
|
+
input,
|
|
36270
|
+
formsValue,
|
|
36271
|
+
asText
|
|
36272
|
+
}) => {
|
|
36243
36273
|
const {
|
|
36244
36274
|
t,
|
|
36245
36275
|
evaluationConfig,
|
|
36246
36276
|
scope
|
|
36247
36277
|
} = useEditContext();
|
|
36248
36278
|
const label = getInputProp(input.label, formsValue, scope);
|
|
36249
|
-
return input
|
|
36279
|
+
return input?.meta?.isEvaluation || input.description && typeof input.description === "string" && !asText ? /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
36250
36280
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
36251
36281
|
className: "flex",
|
|
36252
36282
|
children: [ReactHtmlParser__default["default"](label), /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
|
|
36253
|
-
content: input
|
|
36283
|
+
content: input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(EvaluationPopover, {
|
|
36254
36284
|
t: t,
|
|
36255
36285
|
evaluationConfig: evaluationConfig
|
|
36256
36286
|
}) : /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -36258,7 +36288,7 @@ const InputLabel = _ref4 => {
|
|
|
36258
36288
|
children: ReactHtmlParser__default["default"](input.description)
|
|
36259
36289
|
}),
|
|
36260
36290
|
placement: "top",
|
|
36261
|
-
children: !
|
|
36291
|
+
children: !input?.meta?.isEvaluation || evaluationConfig.length > 0 ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
36262
36292
|
className: "flex flex-column justify-content-center ml-1",
|
|
36263
36293
|
children: /*#__PURE__*/jsxRuntime.jsx(TooltipIcon, {
|
|
36264
36294
|
fontSize: 13
|
|
@@ -36280,9 +36310,7 @@ function getSectionLabel$1(labels, values) {
|
|
|
36280
36310
|
}
|
|
36281
36311
|
return labels;
|
|
36282
36312
|
}
|
|
36283
|
-
function getSubtitles$1(subtitles, position) {
|
|
36284
|
-
let formsValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
36285
|
-
let repeatValues = arguments.length > 4 ? arguments[4] : undefined;
|
|
36313
|
+
function getSubtitles$1(subtitles, position, formsValue = {}, repeatIndex, repeatValues) {
|
|
36286
36314
|
let subtitle = subtitles && subtitles[position];
|
|
36287
36315
|
if (subtitle && typeof subtitle === "object") {
|
|
36288
36316
|
let newSubtitle = subtitle.default || "";
|
|
@@ -36326,12 +36354,14 @@ function getSubtitles$1(subtitles, position) {
|
|
|
36326
36354
|
function getFormTitles$1(titles, key, position) {
|
|
36327
36355
|
let tilte = titles && titles[key];
|
|
36328
36356
|
return tilte ? /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
36329
|
-
className:
|
|
36357
|
+
className: `title-semibold-3 mb0 ${position ? "mt-3" : ""}`,
|
|
36330
36358
|
children: tilte
|
|
36331
36359
|
}) : null;
|
|
36332
36360
|
}
|
|
36333
36361
|
const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsValue, name, mainForm) => {
|
|
36334
|
-
formsValue = Object.assign(formsValue,
|
|
36362
|
+
formsValue = Object.assign(formsValue, {
|
|
36363
|
+
...mainForm.getFieldsValue(true)
|
|
36364
|
+
});
|
|
36335
36365
|
if (typeof repeatIndex === "number" && repeatValues) {
|
|
36336
36366
|
if (!repeatValues[inputName] || !___default["default"].isEqual(repeatValues[inputName], value)) {
|
|
36337
36367
|
repeatValues[inputName] = value;
|
|
@@ -36366,16 +36396,14 @@ const updateFormValues$1 = (repeatIndex, repeatValues, inputName, value, formsVa
|
|
|
36366
36396
|
};
|
|
36367
36397
|
const inputOnBlur = [];
|
|
36368
36398
|
const inputTypeComponent$1 = {
|
|
36369
|
-
text: (
|
|
36370
|
-
|
|
36371
|
-
|
|
36372
|
-
|
|
36373
|
-
|
|
36374
|
-
|
|
36375
|
-
|
|
36376
|
-
|
|
36377
|
-
isHighlighted
|
|
36378
|
-
} = _ref6;
|
|
36399
|
+
text: ({
|
|
36400
|
+
props,
|
|
36401
|
+
rules
|
|
36402
|
+
}, {
|
|
36403
|
+
inputMeta = {},
|
|
36404
|
+
t,
|
|
36405
|
+
isHighlighted
|
|
36406
|
+
}) => {
|
|
36379
36407
|
const maxRule = rules.find(r => r.max);
|
|
36380
36408
|
const maxProps = {
|
|
36381
36409
|
maxLength: MAX_TEXT_AREA_LENGTH
|
|
@@ -36383,28 +36411,26 @@ const inputTypeComponent$1 = {
|
|
|
36383
36411
|
if (maxRule) {
|
|
36384
36412
|
maxProps.maxLength = maxRule.max;
|
|
36385
36413
|
}
|
|
36386
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input,
|
|
36387
|
-
size: "large"
|
|
36388
|
-
|
|
36414
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
36415
|
+
size: "large",
|
|
36416
|
+
...maxProps,
|
|
36389
36417
|
allowClear: true,
|
|
36390
36418
|
autoComplete: "new-password",
|
|
36391
|
-
type: "text"
|
|
36392
|
-
|
|
36419
|
+
type: "text",
|
|
36420
|
+
...props,
|
|
36393
36421
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36394
36422
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36395
36423
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
36396
|
-
})
|
|
36424
|
+
});
|
|
36397
36425
|
},
|
|
36398
|
-
link: (
|
|
36399
|
-
|
|
36400
|
-
|
|
36401
|
-
|
|
36402
|
-
|
|
36403
|
-
|
|
36404
|
-
|
|
36405
|
-
|
|
36406
|
-
isHighlighted
|
|
36407
|
-
} = _ref8;
|
|
36426
|
+
link: ({
|
|
36427
|
+
props,
|
|
36428
|
+
rules
|
|
36429
|
+
}, {
|
|
36430
|
+
inputMeta = {},
|
|
36431
|
+
t,
|
|
36432
|
+
isHighlighted
|
|
36433
|
+
}) => {
|
|
36408
36434
|
const maxRule = rules.find(r => r.max);
|
|
36409
36435
|
const maxProps = {
|
|
36410
36436
|
maxLength: MAX_TEXT_AREA_LENGTH
|
|
@@ -36412,32 +36438,29 @@ const inputTypeComponent$1 = {
|
|
|
36412
36438
|
if (maxRule) {
|
|
36413
36439
|
maxProps.maxLength = maxRule.max;
|
|
36414
36440
|
}
|
|
36415
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input,
|
|
36416
|
-
size: "large"
|
|
36417
|
-
|
|
36441
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
36442
|
+
size: "large",
|
|
36443
|
+
...maxProps,
|
|
36418
36444
|
allowClear: true,
|
|
36419
36445
|
autoComplete: "new-password",
|
|
36420
|
-
type: "text"
|
|
36421
|
-
|
|
36446
|
+
type: "text",
|
|
36447
|
+
...props,
|
|
36422
36448
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36423
36449
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36424
36450
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
36425
|
-
})
|
|
36451
|
+
});
|
|
36426
36452
|
},
|
|
36427
|
-
number: (
|
|
36428
|
-
|
|
36429
|
-
|
|
36430
|
-
|
|
36431
|
-
|
|
36432
|
-
|
|
36433
|
-
|
|
36434
|
-
|
|
36435
|
-
|
|
36436
|
-
t,
|
|
36437
|
-
isHighlighted
|
|
36438
|
-
} = _ref10;
|
|
36453
|
+
number: ({
|
|
36454
|
+
props,
|
|
36455
|
+
rules,
|
|
36456
|
+
input
|
|
36457
|
+
}, {
|
|
36458
|
+
inputMeta = {},
|
|
36459
|
+
t,
|
|
36460
|
+
isHighlighted
|
|
36461
|
+
}) => {
|
|
36439
36462
|
const maxRule = rules.find(r => r.max);
|
|
36440
|
-
const integerRule = !
|
|
36463
|
+
const integerRule = !input?.meta?.isDecimal;
|
|
36441
36464
|
const parser = value => {
|
|
36442
36465
|
if (!value) {
|
|
36443
36466
|
return "";
|
|
@@ -36448,63 +36471,60 @@ const inputTypeComponent$1 = {
|
|
|
36448
36471
|
return value.replace(/\$\s?|(,*)/g, "");
|
|
36449
36472
|
};
|
|
36450
36473
|
if (maxRule) {
|
|
36451
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber,
|
|
36474
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
36452
36475
|
size: "large",
|
|
36453
36476
|
allowClear: true,
|
|
36454
|
-
autoComplete: "new-password"
|
|
36455
|
-
|
|
36477
|
+
autoComplete: "new-password",
|
|
36478
|
+
...props,
|
|
36456
36479
|
type: "number",
|
|
36457
36480
|
parser: parser,
|
|
36458
36481
|
min: 0,
|
|
36459
36482
|
max: maxRule.max,
|
|
36460
36483
|
className: formatClassname([isHighlighted && "highlighted-input"])
|
|
36461
|
-
})
|
|
36484
|
+
});
|
|
36462
36485
|
}
|
|
36463
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber,
|
|
36486
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
36464
36487
|
size: "large",
|
|
36465
36488
|
allowClear: true,
|
|
36466
36489
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36467
|
-
autoComplete: "new-password"
|
|
36468
|
-
|
|
36490
|
+
autoComplete: "new-password",
|
|
36491
|
+
...props,
|
|
36469
36492
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36470
36493
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
|
|
36471
36494
|
min: 0,
|
|
36472
36495
|
formatter: value => numberWithCommas$1(value),
|
|
36473
36496
|
parser: parser
|
|
36474
|
-
})
|
|
36497
|
+
});
|
|
36475
36498
|
},
|
|
36476
36499
|
// eslint-disable-next-line no-unused-vars
|
|
36477
|
-
select: (
|
|
36478
|
-
|
|
36479
|
-
|
|
36480
|
-
|
|
36481
|
-
|
|
36482
|
-
|
|
36483
|
-
|
|
36484
|
-
|
|
36485
|
-
|
|
36486
|
-
|
|
36487
|
-
|
|
36488
|
-
|
|
36489
|
-
|
|
36490
|
-
|
|
36491
|
-
|
|
36492
|
-
|
|
36493
|
-
|
|
36494
|
-
|
|
36495
|
-
|
|
36496
|
-
|
|
36497
|
-
|
|
36498
|
-
|
|
36499
|
-
|
|
36500
|
-
|
|
36501
|
-
|
|
36502
|
-
|
|
36503
|
-
changeInputMeta,
|
|
36504
|
-
groupFormId
|
|
36505
|
-
} = _ref12;
|
|
36500
|
+
select: ({
|
|
36501
|
+
value,
|
|
36502
|
+
options,
|
|
36503
|
+
optionGroup,
|
|
36504
|
+
props,
|
|
36505
|
+
formsValue,
|
|
36506
|
+
optionsFilter,
|
|
36507
|
+
filterCond,
|
|
36508
|
+
repeatValues,
|
|
36509
|
+
repeatIndex,
|
|
36510
|
+
name,
|
|
36511
|
+
inputName,
|
|
36512
|
+
address,
|
|
36513
|
+
addressData,
|
|
36514
|
+
input,
|
|
36515
|
+
scope
|
|
36516
|
+
}, {
|
|
36517
|
+
forms,
|
|
36518
|
+
form,
|
|
36519
|
+
setAddress,
|
|
36520
|
+
inputMeta = {},
|
|
36521
|
+
t,
|
|
36522
|
+
isHighlighted,
|
|
36523
|
+
changeInputMeta,
|
|
36524
|
+
groupFormId
|
|
36525
|
+
}) => {
|
|
36506
36526
|
let opts;
|
|
36507
|
-
const isEvaluation = input
|
|
36527
|
+
const isEvaluation = input?.meta?.isEvaluation;
|
|
36508
36528
|
let defaultValue = value;
|
|
36509
36529
|
if (typeof options === "string") {
|
|
36510
36530
|
const [formName, key] = options.split(".");
|
|
@@ -36529,7 +36549,7 @@ const inputTypeComponent$1 = {
|
|
|
36529
36549
|
opts = [];
|
|
36530
36550
|
}
|
|
36531
36551
|
} else {
|
|
36532
|
-
opts = options
|
|
36552
|
+
opts = options?.filter(o => !o.onlyView);
|
|
36533
36553
|
}
|
|
36534
36554
|
opts = JSON.parse(JSON.stringify(opts || []));
|
|
36535
36555
|
opts = opts.map(o => getSelectOptions$2(o, formsValue));
|
|
@@ -36539,7 +36559,7 @@ const inputTypeComponent$1 = {
|
|
|
36539
36559
|
const uniqueDefaultKeys = getUniqueDefaultKeys(options);
|
|
36540
36560
|
|
|
36541
36561
|
// Handle default value logic
|
|
36542
|
-
if (!propHasValue$1(value) && propHasValue$1(input
|
|
36562
|
+
if (!propHasValue$1(value) && propHasValue$1(input?.meta?.defaultValue)) {
|
|
36543
36563
|
// If no current value but there's a default value, use the default
|
|
36544
36564
|
value = input.meta.defaultValue;
|
|
36545
36565
|
defaultValue = value;
|
|
@@ -36572,7 +36592,7 @@ const inputTypeComponent$1 = {
|
|
|
36572
36592
|
}
|
|
36573
36593
|
opts = groupOptions;
|
|
36574
36594
|
}
|
|
36575
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select,
|
|
36595
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
36576
36596
|
size: "large",
|
|
36577
36597
|
autoComplete: "new-password",
|
|
36578
36598
|
allowClear: true,
|
|
@@ -36581,32 +36601,35 @@ const inputTypeComponent$1 = {
|
|
|
36581
36601
|
value: value // Use value instead of defaultValue for controlled behavior
|
|
36582
36602
|
,
|
|
36583
36603
|
filterOption: filterSelectOptions,
|
|
36584
|
-
optionFilterProp: "children"
|
|
36585
|
-
|
|
36604
|
+
optionFilterProp: "children",
|
|
36605
|
+
...props,
|
|
36586
36606
|
className: formatClassname([isHighlighted && "highlighted-select"]),
|
|
36587
36607
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36588
36608
|
placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select one option"),
|
|
36589
36609
|
onChange: (val, selectedValue) => {
|
|
36590
36610
|
// ONLY FOR SBG EVALUATON !!
|
|
36591
36611
|
if (isEvaluation && val === "na" && groupFormId) {
|
|
36592
|
-
var _formsValue$meta2;
|
|
36593
36612
|
changeInputMeta({
|
|
36594
36613
|
key: groupFormId,
|
|
36595
|
-
value:
|
|
36614
|
+
value: {
|
|
36615
|
+
...(formsValue?.meta?.inputs?.[groupFormId] || {}),
|
|
36596
36616
|
documentation: {
|
|
36597
36617
|
notApplicable: true
|
|
36598
36618
|
}
|
|
36599
|
-
}
|
|
36619
|
+
},
|
|
36600
36620
|
otherValues: {
|
|
36601
|
-
[groupFormId]:
|
|
36621
|
+
[groupFormId]: {
|
|
36622
|
+
...(formsValue?.[groupFormId] || {}),
|
|
36602
36623
|
[name]: val
|
|
36603
|
-
}
|
|
36624
|
+
}
|
|
36604
36625
|
}
|
|
36605
36626
|
});
|
|
36606
36627
|
}
|
|
36607
36628
|
if (address && selectedValue) {
|
|
36608
36629
|
dot__default["default"].str(address, selectedValue.children, addressData);
|
|
36609
|
-
setAddress(
|
|
36630
|
+
setAddress({
|
|
36631
|
+
...addressData
|
|
36632
|
+
});
|
|
36610
36633
|
}
|
|
36611
36634
|
if (props.onChange) {
|
|
36612
36635
|
props.onChange(val);
|
|
@@ -36637,15 +36660,15 @@ const inputTypeComponent$1 = {
|
|
|
36637
36660
|
if (og.disabled !== undefined) {
|
|
36638
36661
|
groupOtherProps.disabled = og.disabled;
|
|
36639
36662
|
}
|
|
36640
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36641
|
-
value: og.value
|
|
36642
|
-
|
|
36663
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36664
|
+
value: og.value,
|
|
36665
|
+
...groupOtherProps,
|
|
36643
36666
|
children: og.label
|
|
36644
|
-
}
|
|
36667
|
+
}, `${i}${j}`);
|
|
36645
36668
|
})
|
|
36646
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36647
|
-
value: option.value
|
|
36648
|
-
|
|
36669
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36670
|
+
value: option.value,
|
|
36671
|
+
...otherProps,
|
|
36649
36672
|
children: isEvaluation ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
36650
36673
|
className: "flex",
|
|
36651
36674
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -36653,35 +36676,33 @@ const inputTypeComponent$1 = {
|
|
|
36653
36676
|
children: sgbEvaluationIcons[option.value]
|
|
36654
36677
|
}), option.label]
|
|
36655
36678
|
}) : option.label
|
|
36656
|
-
}
|
|
36679
|
+
}, option.value);
|
|
36657
36680
|
})
|
|
36658
|
-
})
|
|
36681
|
+
});
|
|
36659
36682
|
},
|
|
36660
|
-
multiselect: (
|
|
36661
|
-
|
|
36662
|
-
|
|
36663
|
-
|
|
36664
|
-
|
|
36665
|
-
|
|
36666
|
-
|
|
36667
|
-
|
|
36668
|
-
|
|
36669
|
-
|
|
36670
|
-
|
|
36671
|
-
|
|
36672
|
-
|
|
36673
|
-
|
|
36674
|
-
|
|
36675
|
-
|
|
36676
|
-
|
|
36677
|
-
|
|
36678
|
-
|
|
36679
|
-
|
|
36680
|
-
|
|
36681
|
-
|
|
36682
|
-
|
|
36683
|
-
isHighlighted
|
|
36684
|
-
} = _ref14;
|
|
36683
|
+
multiselect: ({
|
|
36684
|
+
value,
|
|
36685
|
+
options,
|
|
36686
|
+
optionGroup,
|
|
36687
|
+
optionsFilter,
|
|
36688
|
+
filterCond,
|
|
36689
|
+
props,
|
|
36690
|
+
formsValue,
|
|
36691
|
+
repeatValues,
|
|
36692
|
+
repeatIndex,
|
|
36693
|
+
inputName,
|
|
36694
|
+
name,
|
|
36695
|
+
tags,
|
|
36696
|
+
maxWidth,
|
|
36697
|
+
staticWidth,
|
|
36698
|
+
fullWidth
|
|
36699
|
+
}, {
|
|
36700
|
+
forms,
|
|
36701
|
+
form,
|
|
36702
|
+
inputMeta = {},
|
|
36703
|
+
t,
|
|
36704
|
+
isHighlighted
|
|
36705
|
+
}) => {
|
|
36685
36706
|
let opts;
|
|
36686
36707
|
if (typeof options === "string") {
|
|
36687
36708
|
const [formName, key] = options.split(".");
|
|
@@ -36743,17 +36764,17 @@ const inputTypeComponent$1 = {
|
|
|
36743
36764
|
staticWidth,
|
|
36744
36765
|
fullWidth
|
|
36745
36766
|
});
|
|
36746
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select,
|
|
36767
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
36747
36768
|
size: "medium",
|
|
36748
36769
|
allowClear: true,
|
|
36749
36770
|
autoComplete: "new-password",
|
|
36750
36771
|
mode: tags ? "tags" : "multiple",
|
|
36751
|
-
optionFilterProp: "children"
|
|
36752
|
-
|
|
36753
|
-
|
|
36754
|
-
|
|
36755
|
-
filterOption: filterSelectOptions
|
|
36756
|
-
|
|
36772
|
+
optionFilterProp: "children",
|
|
36773
|
+
...(tags ? {
|
|
36774
|
+
tokenSeparators: [","]
|
|
36775
|
+
} : {}),
|
|
36776
|
+
filterOption: filterSelectOptions,
|
|
36777
|
+
...props,
|
|
36757
36778
|
className: formatClassname([isHighlighted && "highlighted-select"]),
|
|
36758
36779
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36759
36780
|
placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp(props.placeholder, formsValue) || t("Select all relevant options"),
|
|
@@ -36792,52 +36813,51 @@ const inputTypeComponent$1 = {
|
|
|
36792
36813
|
if (og.disabled !== undefined) {
|
|
36793
36814
|
groupOtherProps.disabled = og.disabled;
|
|
36794
36815
|
}
|
|
36795
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36796
|
-
value: og.value
|
|
36797
|
-
|
|
36816
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36817
|
+
value: og.value,
|
|
36818
|
+
...groupOtherProps,
|
|
36798
36819
|
children: og.label
|
|
36799
|
-
}
|
|
36820
|
+
}, `${i}${j}`);
|
|
36800
36821
|
})
|
|
36801
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option,
|
|
36802
|
-
value: option.value
|
|
36803
|
-
|
|
36822
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
36823
|
+
value: option.value,
|
|
36824
|
+
...otherProps,
|
|
36804
36825
|
children: option.label
|
|
36805
|
-
}
|
|
36826
|
+
}, i);
|
|
36806
36827
|
})
|
|
36807
|
-
})
|
|
36828
|
+
});
|
|
36808
36829
|
},
|
|
36809
|
-
date: (
|
|
36810
|
-
|
|
36811
|
-
|
|
36812
|
-
|
|
36813
|
-
|
|
36814
|
-
|
|
36815
|
-
|
|
36816
|
-
|
|
36817
|
-
|
|
36818
|
-
|
|
36819
|
-
|
|
36820
|
-
|
|
36821
|
-
|
|
36822
|
-
|
|
36823
|
-
isHighlighted,
|
|
36824
|
-
groupFormId
|
|
36825
|
-
} = _ref16;
|
|
36830
|
+
date: ({
|
|
36831
|
+
props,
|
|
36832
|
+
rules,
|
|
36833
|
+
repeatValues,
|
|
36834
|
+
formsValue,
|
|
36835
|
+
name
|
|
36836
|
+
}, {
|
|
36837
|
+
setFormValues,
|
|
36838
|
+
inputMeta,
|
|
36839
|
+
form,
|
|
36840
|
+
t,
|
|
36841
|
+
isHighlighted,
|
|
36842
|
+
groupFormId
|
|
36843
|
+
}) => {
|
|
36826
36844
|
const lng = localStorage.getItem("datastakeLng") || "en";
|
|
36827
36845
|
const maxRule = rules.find(r => r.max);
|
|
36828
|
-
let value = groupFormId ? formsValue
|
|
36846
|
+
let value = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue[name];
|
|
36829
36847
|
const handleDateChange = date => {
|
|
36830
36848
|
if (date) {
|
|
36831
36849
|
// const localDate = dayjs.utc(date).add(dayjs(date).utcOffset(), 'minutes');
|
|
36832
36850
|
const localDate = dayjs__default["default"].utc(date);
|
|
36833
36851
|
if (groupFormId) {
|
|
36834
|
-
const _new =
|
|
36852
|
+
const _new = {
|
|
36853
|
+
...(formsValue[groupFormId] || {}),
|
|
36835
36854
|
[name]: localDate
|
|
36836
|
-
}
|
|
36855
|
+
};
|
|
36837
36856
|
form.setFieldValue(groupFormId, _new);
|
|
36838
|
-
setFormValues(
|
|
36857
|
+
setFormValues({
|
|
36858
|
+
...formsValue,
|
|
36839
36859
|
[groupFormId]: _new
|
|
36840
|
-
})
|
|
36860
|
+
});
|
|
36841
36861
|
} else {
|
|
36842
36862
|
form.setFieldValue(name, localDate);
|
|
36843
36863
|
}
|
|
@@ -36846,13 +36866,15 @@ const inputTypeComponent$1 = {
|
|
|
36846
36866
|
if (groupFormId) {
|
|
36847
36867
|
if (typeof value === "string" || typeof value === "undefined") {
|
|
36848
36868
|
value = typeof value === "string" ? dayjs__default["default"].utc(value) : null;
|
|
36849
|
-
const _new =
|
|
36869
|
+
const _new = {
|
|
36870
|
+
...(formsValue[groupFormId] || {}),
|
|
36850
36871
|
[name]: value
|
|
36851
|
-
}
|
|
36872
|
+
};
|
|
36852
36873
|
form.setFieldValue(groupFormId, _new);
|
|
36853
|
-
setFormValues(
|
|
36874
|
+
setFormValues({
|
|
36875
|
+
...formsValue,
|
|
36854
36876
|
[groupFormId]: _new
|
|
36855
|
-
})
|
|
36877
|
+
});
|
|
36856
36878
|
}
|
|
36857
36879
|
} else {
|
|
36858
36880
|
if (typeof value === "string") {
|
|
@@ -36868,13 +36890,12 @@ const inputTypeComponent$1 = {
|
|
|
36868
36890
|
checkForMax = checkCondition$1(maxRule.condition, repeatValues, formsValue);
|
|
36869
36891
|
}
|
|
36870
36892
|
if (checkForMax) {
|
|
36871
|
-
|
|
36872
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
|
|
36893
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
36873
36894
|
size: "large",
|
|
36874
36895
|
allowClear: true,
|
|
36875
|
-
autoComplete: "new-password"
|
|
36876
|
-
|
|
36877
|
-
value: value ? dayjs__default["default"](
|
|
36896
|
+
autoComplete: "new-password",
|
|
36897
|
+
...props,
|
|
36898
|
+
value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
|
|
36878
36899
|
onChange: handleDateChange,
|
|
36879
36900
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36880
36901
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
@@ -36884,54 +36905,49 @@ const inputTypeComponent$1 = {
|
|
|
36884
36905
|
disabledDate: current => {
|
|
36885
36906
|
return current && current >= dayjs__default["default"]().endOf("day");
|
|
36886
36907
|
}
|
|
36887
|
-
})
|
|
36908
|
+
});
|
|
36888
36909
|
}
|
|
36889
36910
|
}
|
|
36890
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker,
|
|
36911
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
36891
36912
|
size: "large",
|
|
36892
36913
|
allowClear: true,
|
|
36893
|
-
autoComplete: "new-password"
|
|
36894
|
-
|
|
36895
|
-
value: value ? dayjs__default["default"](
|
|
36914
|
+
autoComplete: "new-password",
|
|
36915
|
+
...props,
|
|
36916
|
+
value: value ? dayjs__default["default"](value?.format("YYYY-MM-DD"), "YYYY-MM-DD") : undefined,
|
|
36896
36917
|
onChange: handleDateChange,
|
|
36897
36918
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
36898
36919
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
36899
36920
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder,
|
|
36900
36921
|
format: DATE_FORMATS,
|
|
36901
36922
|
locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"]
|
|
36902
|
-
})
|
|
36923
|
+
});
|
|
36903
36924
|
},
|
|
36904
|
-
groupExpandable: (
|
|
36905
|
-
|
|
36906
|
-
|
|
36907
|
-
|
|
36908
|
-
|
|
36909
|
-
|
|
36910
|
-
|
|
36911
|
-
|
|
36912
|
-
groupFormId
|
|
36913
|
-
} = _ref18;
|
|
36914
|
-
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];
|
|
36925
|
+
groupExpandable: ({
|
|
36926
|
+
formsValue,
|
|
36927
|
+
name,
|
|
36928
|
+
input
|
|
36929
|
+
}, {
|
|
36930
|
+
groupFormId
|
|
36931
|
+
}) => {
|
|
36932
|
+
const data = groupFormId ? formsValue?.[groupFormId]?.[name] : formsValue?.[name];
|
|
36915
36933
|
return /*#__PURE__*/jsxRuntime.jsx(GroupExpandable, {
|
|
36916
36934
|
input: input,
|
|
36917
36935
|
formsValue: formsValue,
|
|
36918
36936
|
data: data
|
|
36919
36937
|
});
|
|
36920
36938
|
},
|
|
36921
|
-
comment: (
|
|
36922
|
-
|
|
36923
|
-
|
|
36924
|
-
|
|
36925
|
-
|
|
36926
|
-
|
|
36927
|
-
|
|
36928
|
-
|
|
36929
|
-
|
|
36930
|
-
|
|
36931
|
-
|
|
36932
|
-
|
|
36933
|
-
} = _ref20;
|
|
36934
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
|
|
36939
|
+
comment: ({
|
|
36940
|
+
props: {
|
|
36941
|
+
placeholder,
|
|
36942
|
+
...props
|
|
36943
|
+
},
|
|
36944
|
+
commentHint
|
|
36945
|
+
}, {
|
|
36946
|
+
onChange,
|
|
36947
|
+
value,
|
|
36948
|
+
isHighlighted
|
|
36949
|
+
}) => {
|
|
36950
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
|
|
36935
36951
|
allowClear: true,
|
|
36936
36952
|
value: value,
|
|
36937
36953
|
onChange: e => onChange(e.target.value),
|
|
@@ -36942,27 +36958,26 @@ const inputTypeComponent$1 = {
|
|
|
36942
36958
|
autoSize: {
|
|
36943
36959
|
minRows: 5,
|
|
36944
36960
|
maxRows: 5
|
|
36945
|
-
}
|
|
36946
|
-
|
|
36961
|
+
},
|
|
36962
|
+
...props,
|
|
36947
36963
|
disabled: false
|
|
36948
|
-
})
|
|
36964
|
+
});
|
|
36949
36965
|
},
|
|
36950
|
-
tableComment: (
|
|
36951
|
-
|
|
36952
|
-
|
|
36953
|
-
|
|
36954
|
-
|
|
36955
|
-
|
|
36956
|
-
|
|
36957
|
-
|
|
36958
|
-
|
|
36959
|
-
|
|
36960
|
-
|
|
36961
|
-
|
|
36962
|
-
} = _ref22;
|
|
36963
|
-
const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => _objectSpread2(_objectSpread2({}, v), {}, {
|
|
36966
|
+
tableComment: ({
|
|
36967
|
+
setValues,
|
|
36968
|
+
name,
|
|
36969
|
+
onValuesChange,
|
|
36970
|
+
formsValue
|
|
36971
|
+
}, {
|
|
36972
|
+
form,
|
|
36973
|
+
groupFormId,
|
|
36974
|
+
isHighlighted
|
|
36975
|
+
}) => {
|
|
36976
|
+
const formData = groupFormId ? getArray((formsValue[groupFormId] || {})[name] || []).map((v, i) => ({
|
|
36977
|
+
...v,
|
|
36964
36978
|
key: i
|
|
36965
|
-
})) : (formsValue[name] || []).map((v, i) =>
|
|
36979
|
+
})) : (formsValue[name] || []).map((v, i) => ({
|
|
36980
|
+
...v,
|
|
36966
36981
|
key: i
|
|
36967
36982
|
}));
|
|
36968
36983
|
const onUpdate = (val, i) => {
|
|
@@ -36970,89 +36985,121 @@ const inputTypeComponent$1 = {
|
|
|
36970
36985
|
[name]: formData.map((d, j) => i === j ? val : d)
|
|
36971
36986
|
};
|
|
36972
36987
|
if (groupFormId) {
|
|
36973
|
-
const _defaultData =
|
|
36974
|
-
const _newData =
|
|
36975
|
-
|
|
36988
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
36989
|
+
const _newData = {
|
|
36990
|
+
..._defaultData,
|
|
36991
|
+
..._val
|
|
36992
|
+
};
|
|
36993
|
+
onValuesChange(_newData, {
|
|
36994
|
+
...formsValue,
|
|
36976
36995
|
[groupFormId]: _newData
|
|
36977
|
-
})
|
|
36978
|
-
form
|
|
36979
|
-
setValues(
|
|
36996
|
+
});
|
|
36997
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
36998
|
+
setValues({
|
|
36999
|
+
...formsValue,
|
|
36980
37000
|
[groupFormId]: _newData
|
|
36981
|
-
})
|
|
37001
|
+
});
|
|
36982
37002
|
return;
|
|
36983
37003
|
}
|
|
36984
|
-
onValuesChange(_val,
|
|
36985
|
-
|
|
36986
|
-
|
|
37004
|
+
onValuesChange(_val, {
|
|
37005
|
+
...formsValue,
|
|
37006
|
+
..._val
|
|
37007
|
+
});
|
|
37008
|
+
form?.setFieldValue(name, _val[name]);
|
|
37009
|
+
setValues({
|
|
37010
|
+
...formsValue,
|
|
37011
|
+
..._val
|
|
37012
|
+
});
|
|
36987
37013
|
};
|
|
36988
37014
|
return /*#__PURE__*/jsxRuntime.jsx(Comment, {
|
|
36989
37015
|
onUpdate: onUpdate,
|
|
36990
37016
|
isHighlighted: isHighlighted,
|
|
36991
37017
|
form: form,
|
|
36992
|
-
values: groupFormId ?
|
|
37018
|
+
values: groupFormId ? {
|
|
37019
|
+
...(formsValue[groupFormId] || {}),
|
|
36993
37020
|
meta: {
|
|
36994
|
-
inputs: (
|
|
37021
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
36995
37022
|
}
|
|
36996
|
-
}
|
|
37023
|
+
} : formsValue,
|
|
36997
37024
|
name: name,
|
|
36998
|
-
remove:
|
|
36999
|
-
|
|
37000
|
-
|
|
37001
|
-
} = _ref23;
|
|
37025
|
+
remove: ({
|
|
37026
|
+
key
|
|
37027
|
+
}) => {
|
|
37002
37028
|
const _val = {
|
|
37003
37029
|
[name]: formData.filter(v => v.key !== key)
|
|
37004
37030
|
};
|
|
37005
37031
|
if (groupFormId) {
|
|
37006
|
-
const _defaultData =
|
|
37007
|
-
const _newData =
|
|
37008
|
-
|
|
37032
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
37033
|
+
const _newData = {
|
|
37034
|
+
..._defaultData,
|
|
37035
|
+
..._val
|
|
37036
|
+
};
|
|
37037
|
+
onValuesChange(_newData, {
|
|
37038
|
+
...formsValue,
|
|
37009
37039
|
[groupFormId]: _newData
|
|
37010
|
-
})
|
|
37011
|
-
form
|
|
37012
|
-
setValues(
|
|
37040
|
+
});
|
|
37041
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
37042
|
+
setValues({
|
|
37043
|
+
...formsValue,
|
|
37013
37044
|
[groupFormId]: _newData
|
|
37014
|
-
})
|
|
37045
|
+
});
|
|
37015
37046
|
return;
|
|
37016
37047
|
}
|
|
37017
|
-
onValuesChange(_val,
|
|
37018
|
-
|
|
37019
|
-
|
|
37048
|
+
onValuesChange(_val, {
|
|
37049
|
+
...formsValue,
|
|
37050
|
+
..._val
|
|
37051
|
+
});
|
|
37052
|
+
form?.setFieldValue(name, _val[name]);
|
|
37053
|
+
setValues({
|
|
37054
|
+
...formsValue,
|
|
37055
|
+
..._val
|
|
37056
|
+
});
|
|
37020
37057
|
},
|
|
37021
37058
|
add: val => {
|
|
37022
37059
|
const _val = {
|
|
37023
|
-
[name]: [...formData,
|
|
37060
|
+
[name]: [...formData, {
|
|
37061
|
+
...val,
|
|
37024
37062
|
key: formData.length
|
|
37025
|
-
}
|
|
37063
|
+
}]
|
|
37026
37064
|
};
|
|
37027
37065
|
if (groupFormId) {
|
|
37028
|
-
const _defaultData =
|
|
37029
|
-
const _newData =
|
|
37030
|
-
|
|
37031
|
-
|
|
37066
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
37067
|
+
const _newData = {
|
|
37068
|
+
..._defaultData,
|
|
37069
|
+
..._val
|
|
37070
|
+
};
|
|
37071
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
37072
|
+
onValuesChange(_newData, {
|
|
37073
|
+
...formsValue,
|
|
37032
37074
|
[groupFormId]: _newData
|
|
37033
|
-
})
|
|
37034
|
-
setValues(
|
|
37075
|
+
});
|
|
37076
|
+
setValues({
|
|
37077
|
+
...formsValue,
|
|
37035
37078
|
[groupFormId]: _newData
|
|
37036
|
-
})
|
|
37079
|
+
});
|
|
37037
37080
|
return;
|
|
37038
37081
|
}
|
|
37039
|
-
form
|
|
37040
|
-
onValuesChange(_val,
|
|
37041
|
-
|
|
37082
|
+
form?.setFieldValue(name, _val[name]);
|
|
37083
|
+
onValuesChange(_val, {
|
|
37084
|
+
...formsValue,
|
|
37085
|
+
..._val
|
|
37086
|
+
});
|
|
37087
|
+
setValues({
|
|
37088
|
+
...formsValue,
|
|
37089
|
+
..._val
|
|
37090
|
+
});
|
|
37042
37091
|
},
|
|
37043
37092
|
k: name
|
|
37044
37093
|
});
|
|
37045
37094
|
},
|
|
37046
|
-
textarea: (
|
|
37047
|
-
|
|
37048
|
-
|
|
37049
|
-
|
|
37050
|
-
|
|
37051
|
-
|
|
37052
|
-
|
|
37053
|
-
|
|
37054
|
-
isHighlighted
|
|
37055
|
-
} = _ref25;
|
|
37095
|
+
textarea: ({
|
|
37096
|
+
props,
|
|
37097
|
+
rules
|
|
37098
|
+
}, {
|
|
37099
|
+
inputMeta,
|
|
37100
|
+
t,
|
|
37101
|
+
isHighlighted
|
|
37102
|
+
}) => {
|
|
37056
37103
|
const maxRule = rules.find(r => r.max);
|
|
37057
37104
|
let maxLength = MAX_TEXT_AREA_LENGTH;
|
|
37058
37105
|
let rows = 5;
|
|
@@ -37079,7 +37126,7 @@ const inputTypeComponent$1 = {
|
|
|
37079
37126
|
// rows = 14;
|
|
37080
37127
|
// }
|
|
37081
37128
|
}
|
|
37082
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea,
|
|
37129
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
|
|
37083
37130
|
allowClear: true,
|
|
37084
37131
|
autoComplete: "new-password",
|
|
37085
37132
|
maxLength: maxLength,
|
|
@@ -37087,37 +37134,35 @@ const inputTypeComponent$1 = {
|
|
|
37087
37134
|
autoSize: {
|
|
37088
37135
|
minRows: rows,
|
|
37089
37136
|
maxRows: rows
|
|
37090
|
-
}
|
|
37091
|
-
|
|
37137
|
+
},
|
|
37138
|
+
...props,
|
|
37092
37139
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
37093
37140
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
37094
|
-
})
|
|
37141
|
+
});
|
|
37095
37142
|
},
|
|
37096
|
-
phoneNumber: (
|
|
37097
|
-
|
|
37098
|
-
|
|
37099
|
-
|
|
37100
|
-
|
|
37101
|
-
|
|
37102
|
-
|
|
37103
|
-
|
|
37104
|
-
|
|
37105
|
-
|
|
37106
|
-
|
|
37107
|
-
|
|
37108
|
-
|
|
37109
|
-
|
|
37110
|
-
|
|
37111
|
-
} = _ref27;
|
|
37112
|
-
return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, _objectSpread2(_objectSpread2({
|
|
37143
|
+
phoneNumber: ({
|
|
37144
|
+
name,
|
|
37145
|
+
inputName,
|
|
37146
|
+
props,
|
|
37147
|
+
value,
|
|
37148
|
+
repeatIndex,
|
|
37149
|
+
repeatValues,
|
|
37150
|
+
formsValue
|
|
37151
|
+
}, {
|
|
37152
|
+
setFormValues,
|
|
37153
|
+
inputMeta,
|
|
37154
|
+
t,
|
|
37155
|
+
isHighlighted
|
|
37156
|
+
}) => {
|
|
37157
|
+
return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, {
|
|
37113
37158
|
customSelectWidthPercentage: "20%",
|
|
37114
37159
|
t: t,
|
|
37115
37160
|
size: "large",
|
|
37116
37161
|
allowClear: true,
|
|
37117
|
-
country: formsValue
|
|
37162
|
+
country: formsValue?.country,
|
|
37118
37163
|
initialValue: value,
|
|
37119
|
-
name: name
|
|
37120
|
-
|
|
37164
|
+
name: name,
|
|
37165
|
+
...props,
|
|
37121
37166
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37122
37167
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
37123
37168
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type Number"),
|
|
@@ -37138,27 +37183,26 @@ const inputTypeComponent$1 = {
|
|
|
37138
37183
|
}
|
|
37139
37184
|
return val;
|
|
37140
37185
|
}
|
|
37141
|
-
})
|
|
37186
|
+
});
|
|
37142
37187
|
},
|
|
37143
|
-
switch: (
|
|
37144
|
-
|
|
37145
|
-
|
|
37146
|
-
|
|
37147
|
-
|
|
37148
|
-
|
|
37149
|
-
|
|
37150
|
-
|
|
37151
|
-
|
|
37152
|
-
|
|
37153
|
-
|
|
37154
|
-
|
|
37155
|
-
|
|
37156
|
-
|
|
37157
|
-
|
|
37158
|
-
|
|
37159
|
-
|
|
37160
|
-
|
|
37161
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
37188
|
+
switch: ({
|
|
37189
|
+
props,
|
|
37190
|
+
value,
|
|
37191
|
+
restricted,
|
|
37192
|
+
autocomplete,
|
|
37193
|
+
formsValue,
|
|
37194
|
+
repeatValues,
|
|
37195
|
+
repeatIndex,
|
|
37196
|
+
name,
|
|
37197
|
+
inputName,
|
|
37198
|
+
replace: replaceInput,
|
|
37199
|
+
unique
|
|
37200
|
+
}, {
|
|
37201
|
+
form,
|
|
37202
|
+
isHighlighted
|
|
37203
|
+
}) => {
|
|
37204
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, {
|
|
37205
|
+
...props,
|
|
37162
37206
|
size: "default",
|
|
37163
37207
|
defaultChecked: value || false,
|
|
37164
37208
|
checked: value || false,
|
|
@@ -37186,7 +37230,9 @@ const inputTypeComponent$1 = {
|
|
|
37186
37230
|
const [formName, replaceInputName] = replaceTo.split(".");
|
|
37187
37231
|
const replaceRepeatValues = replaceInputName ? dot__default["default"].pick(formName, formsValue) : undefined;
|
|
37188
37232
|
updateFormValues$1(undefined, replaceRepeatValues, replaceInputName, isChecked ? newId : undefined, formsValue, formName, form);
|
|
37189
|
-
formsValue = Object.assign(formsValue,
|
|
37233
|
+
formsValue = Object.assign(formsValue, {
|
|
37234
|
+
...form.getFieldsValue(true)
|
|
37235
|
+
});
|
|
37190
37236
|
if (oldId) {
|
|
37191
37237
|
const allRepeatValues = dot__default["default"].pick(name, formsValue);
|
|
37192
37238
|
if (allRepeatValues && Array.isArray(allRepeatValues)) {
|
|
@@ -37227,22 +37273,20 @@ const inputTypeComponent$1 = {
|
|
|
37227
37273
|
}
|
|
37228
37274
|
}
|
|
37229
37275
|
}
|
|
37230
|
-
})
|
|
37276
|
+
});
|
|
37231
37277
|
},
|
|
37232
|
-
radioGroup: (
|
|
37233
|
-
|
|
37234
|
-
|
|
37235
|
-
|
|
37236
|
-
|
|
37237
|
-
|
|
37238
|
-
|
|
37239
|
-
|
|
37240
|
-
isHighlighted
|
|
37241
|
-
} = _ref31;
|
|
37278
|
+
radioGroup: ({
|
|
37279
|
+
props,
|
|
37280
|
+
value,
|
|
37281
|
+
options,
|
|
37282
|
+
isRisk
|
|
37283
|
+
}, {
|
|
37284
|
+
isHighlighted
|
|
37285
|
+
}) => {
|
|
37242
37286
|
if (isRisk) {
|
|
37243
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group,
|
|
37244
|
-
value: value
|
|
37245
|
-
|
|
37287
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
|
|
37288
|
+
value: value,
|
|
37289
|
+
...props,
|
|
37246
37290
|
className: "is-risk-radio",
|
|
37247
37291
|
children: (options || []).map(o => {
|
|
37248
37292
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
|
|
@@ -37256,11 +37300,11 @@ const inputTypeComponent$1 = {
|
|
|
37256
37300
|
}) : null]
|
|
37257
37301
|
}, o.value);
|
|
37258
37302
|
})
|
|
37259
|
-
})
|
|
37303
|
+
});
|
|
37260
37304
|
}
|
|
37261
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group,
|
|
37262
|
-
value: value
|
|
37263
|
-
|
|
37305
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, {
|
|
37306
|
+
value: value,
|
|
37307
|
+
...props,
|
|
37264
37308
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37265
37309
|
children: (options || []).map(o => {
|
|
37266
37310
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
|
|
@@ -37274,20 +37318,18 @@ const inputTypeComponent$1 = {
|
|
|
37274
37318
|
}) : null]
|
|
37275
37319
|
}, o.value);
|
|
37276
37320
|
})
|
|
37277
|
-
})
|
|
37321
|
+
});
|
|
37278
37322
|
},
|
|
37279
|
-
checkboxGroup: (
|
|
37280
|
-
|
|
37281
|
-
|
|
37282
|
-
|
|
37283
|
-
|
|
37284
|
-
|
|
37285
|
-
|
|
37286
|
-
|
|
37287
|
-
|
|
37288
|
-
|
|
37289
|
-
value: value
|
|
37290
|
-
}, props), {}, {
|
|
37323
|
+
checkboxGroup: ({
|
|
37324
|
+
props,
|
|
37325
|
+
value,
|
|
37326
|
+
options
|
|
37327
|
+
}, {
|
|
37328
|
+
isHighlighted
|
|
37329
|
+
}) => {
|
|
37330
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, {
|
|
37331
|
+
value: value,
|
|
37332
|
+
...props,
|
|
37291
37333
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37292
37334
|
style: {
|
|
37293
37335
|
display: "grid",
|
|
@@ -37311,18 +37353,16 @@ const inputTypeComponent$1 = {
|
|
|
37311
37353
|
}) : null]
|
|
37312
37354
|
}, o.value);
|
|
37313
37355
|
})
|
|
37314
|
-
})
|
|
37356
|
+
});
|
|
37315
37357
|
},
|
|
37316
|
-
total100: (
|
|
37317
|
-
|
|
37318
|
-
|
|
37319
|
-
|
|
37320
|
-
|
|
37321
|
-
|
|
37322
|
-
|
|
37323
|
-
|
|
37324
|
-
isHighlighted
|
|
37325
|
-
} = _ref35;
|
|
37358
|
+
total100: ({
|
|
37359
|
+
props,
|
|
37360
|
+
name,
|
|
37361
|
+
options,
|
|
37362
|
+
value
|
|
37363
|
+
}, {
|
|
37364
|
+
isHighlighted
|
|
37365
|
+
}) => {
|
|
37326
37366
|
value = value ? Array.isArray(value) ? value : [value] : [];
|
|
37327
37367
|
function totalValue() {
|
|
37328
37368
|
let total = 0;
|
|
@@ -37346,11 +37386,10 @@ const inputTypeComponent$1 = {
|
|
|
37346
37386
|
className: formatClassname(["total100", isHighlighted && "highlighted-input"]),
|
|
37347
37387
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
|
|
37348
37388
|
name: name,
|
|
37349
|
-
children: (fields,
|
|
37350
|
-
|
|
37351
|
-
|
|
37352
|
-
|
|
37353
|
-
} = _ref36;
|
|
37389
|
+
children: (fields, {
|
|
37390
|
+
add,
|
|
37391
|
+
remove
|
|
37392
|
+
}) => {
|
|
37354
37393
|
if (fields.length === 0) {
|
|
37355
37394
|
const formData = value || [];
|
|
37356
37395
|
if (formData.length) {
|
|
@@ -37369,27 +37408,27 @@ const inputTypeComponent$1 = {
|
|
|
37369
37408
|
const v = value[field.name] || {};
|
|
37370
37409
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Space, {
|
|
37371
37410
|
className: "total",
|
|
37372
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item,
|
|
37373
|
-
noStyle: true
|
|
37374
|
-
|
|
37411
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
37412
|
+
noStyle: true,
|
|
37413
|
+
...field,
|
|
37375
37414
|
name: [field.name, "type"],
|
|
37376
37415
|
fieldKey: [field.fieldKey, "type"],
|
|
37377
37416
|
initialValue: v.type || null,
|
|
37378
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select,
|
|
37417
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
37379
37418
|
size: "large",
|
|
37380
37419
|
allowClear: true,
|
|
37381
37420
|
showSearch: true,
|
|
37382
37421
|
filterOption: filterSelectOptions,
|
|
37383
|
-
optionFilterProp: "children"
|
|
37384
|
-
|
|
37422
|
+
optionFilterProp: "children",
|
|
37423
|
+
...props,
|
|
37385
37424
|
children: options.map((option, i) => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
37386
37425
|
value: option.value,
|
|
37387
37426
|
children: option.label
|
|
37388
37427
|
}, i))
|
|
37389
|
-
})
|
|
37390
|
-
})
|
|
37391
|
-
noStyle: true
|
|
37392
|
-
|
|
37428
|
+
})
|
|
37429
|
+
}), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
37430
|
+
noStyle: true,
|
|
37431
|
+
...field,
|
|
37393
37432
|
name: [field.name, "value"],
|
|
37394
37433
|
fieldKey: [field.fieldKey, "value"],
|
|
37395
37434
|
initialValue: v.value,
|
|
@@ -37398,14 +37437,14 @@ const inputTypeComponent$1 = {
|
|
|
37398
37437
|
allowClear: true,
|
|
37399
37438
|
name: "value",
|
|
37400
37439
|
formatter: value => {
|
|
37401
|
-
return value ?
|
|
37440
|
+
return value ? `${value}%` : "";
|
|
37402
37441
|
},
|
|
37403
37442
|
disabled: !v.type || null,
|
|
37404
37443
|
placeholder: props.valueplaceholder ? props.valueplaceholder : "Value",
|
|
37405
37444
|
min: 1,
|
|
37406
37445
|
max: 100 - siblingTotal(v.type || 0)
|
|
37407
37446
|
})
|
|
37408
|
-
})
|
|
37447
|
+
}), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
37409
37448
|
disabled: !v.value || !v.type || totalValue() >= 100,
|
|
37410
37449
|
type: "primary",
|
|
37411
37450
|
icon: /*#__PURE__*/jsxRuntime.jsx(Icons.PlusOutlined, {}),
|
|
@@ -37437,22 +37476,19 @@ const inputTypeComponent$1 = {
|
|
|
37437
37476
|
}) : null]
|
|
37438
37477
|
});
|
|
37439
37478
|
},
|
|
37440
|
-
percentage: (
|
|
37441
|
-
|
|
37442
|
-
|
|
37443
|
-
|
|
37444
|
-
|
|
37445
|
-
|
|
37446
|
-
|
|
37447
|
-
|
|
37448
|
-
|
|
37449
|
-
|
|
37450
|
-
|
|
37451
|
-
|
|
37452
|
-
|
|
37453
|
-
t,
|
|
37454
|
-
isHighlighted
|
|
37455
|
-
} = _ref38;
|
|
37479
|
+
percentage: ({
|
|
37480
|
+
name,
|
|
37481
|
+
inputName,
|
|
37482
|
+
totalMax,
|
|
37483
|
+
repeatIndex,
|
|
37484
|
+
props,
|
|
37485
|
+
formsValue,
|
|
37486
|
+
input
|
|
37487
|
+
}, {
|
|
37488
|
+
inputMeta,
|
|
37489
|
+
t,
|
|
37490
|
+
isHighlighted
|
|
37491
|
+
}) => {
|
|
37456
37492
|
const isRepeatable = Array.isArray(formsValue[name]);
|
|
37457
37493
|
let totalSiblings = 0;
|
|
37458
37494
|
if (isRepeatable && totalMax) {
|
|
@@ -37460,47 +37496,45 @@ const inputTypeComponent$1 = {
|
|
|
37460
37496
|
totl = totl + (grp[inputName] || 0);
|
|
37461
37497
|
return totl;
|
|
37462
37498
|
}, 0);
|
|
37463
|
-
} else if (Array.isArray(input
|
|
37499
|
+
} else if (Array.isArray(input?.meta?.siblings)) {
|
|
37464
37500
|
totalSiblings = input.meta.siblings.reduce((totl, key) => {
|
|
37465
37501
|
totl = totl + (formsValue[key] || 0);
|
|
37466
37502
|
return totl;
|
|
37467
37503
|
}, 0);
|
|
37468
37504
|
}
|
|
37469
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber,
|
|
37505
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
37470
37506
|
size: "large",
|
|
37471
|
-
allowClear: true
|
|
37472
|
-
|
|
37507
|
+
allowClear: true,
|
|
37508
|
+
...props,
|
|
37473
37509
|
className: formatClassname([isHighlighted && "highlighted-cont"]),
|
|
37474
37510
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
37475
37511
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
|
|
37476
37512
|
min: 0,
|
|
37477
37513
|
max: 100 - totalSiblings,
|
|
37478
37514
|
formatter: value => {
|
|
37479
|
-
return value ?
|
|
37515
|
+
return value ? `${value}` : "";
|
|
37480
37516
|
},
|
|
37481
37517
|
parser: value => value.replace("%", ""),
|
|
37482
37518
|
addonAfter: "%"
|
|
37483
|
-
})
|
|
37519
|
+
});
|
|
37484
37520
|
},
|
|
37485
|
-
drawTerritory: (
|
|
37486
|
-
|
|
37487
|
-
|
|
37488
|
-
|
|
37489
|
-
|
|
37490
|
-
|
|
37491
|
-
|
|
37492
|
-
setFormValues
|
|
37493
|
-
} = _ref40;
|
|
37521
|
+
drawTerritory: ({
|
|
37522
|
+
formsValue,
|
|
37523
|
+
name,
|
|
37524
|
+
addressData
|
|
37525
|
+
}, {
|
|
37526
|
+
setFormValues
|
|
37527
|
+
}) => {
|
|
37494
37528
|
let search = formsValue.country;
|
|
37495
37529
|
if (addressData && addressData.address && Object.keys(addressData.address).length > 0) {
|
|
37496
37530
|
if (addressData.address.country) {
|
|
37497
37531
|
search = addressData.address.country;
|
|
37498
37532
|
}
|
|
37499
37533
|
if (addressData.address.level1) {
|
|
37500
|
-
search =
|
|
37534
|
+
search = `${addressData.address.level1}, ${addressData.address.country}`;
|
|
37501
37535
|
}
|
|
37502
37536
|
if (addressData.address.level2) {
|
|
37503
|
-
search =
|
|
37537
|
+
search = `${addressData.address.level2}, ${addressData.address.level1}, ${addressData.address.country}`;
|
|
37504
37538
|
}
|
|
37505
37539
|
} else {
|
|
37506
37540
|
const country = countriesList.countries[formsValue.country] || {};
|
|
@@ -37508,10 +37542,10 @@ const inputTypeComponent$1 = {
|
|
|
37508
37542
|
search = country.name;
|
|
37509
37543
|
}
|
|
37510
37544
|
if (formsValue.administrativeLevel1Name) {
|
|
37511
|
-
search =
|
|
37545
|
+
search = `${search} ${formsValue.administrativeLevel1Name}`;
|
|
37512
37546
|
}
|
|
37513
37547
|
if (formsValue.administrativeLevel2Name) {
|
|
37514
|
-
search =
|
|
37548
|
+
search = `${search} ${formsValue.administrativeLevel2Name}`;
|
|
37515
37549
|
}
|
|
37516
37550
|
}
|
|
37517
37551
|
return /*#__PURE__*/jsxRuntime.jsx(PolygonSelector, {
|
|
@@ -37523,36 +37557,32 @@ const inputTypeComponent$1 = {
|
|
|
37523
37557
|
searchValue: search
|
|
37524
37558
|
});
|
|
37525
37559
|
},
|
|
37526
|
-
year: (
|
|
37527
|
-
|
|
37528
|
-
|
|
37529
|
-
|
|
37530
|
-
|
|
37531
|
-
isHighlighted
|
|
37532
|
-
} = _ref42;
|
|
37560
|
+
year: ({
|
|
37561
|
+
props
|
|
37562
|
+
}, {
|
|
37563
|
+
isHighlighted
|
|
37564
|
+
}) => {
|
|
37533
37565
|
const lng = localStorage.getItem("datastakeLng") || "en";
|
|
37534
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker,
|
|
37566
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
37535
37567
|
size: "large",
|
|
37536
37568
|
allowClear: true,
|
|
37537
37569
|
locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
|
|
37538
|
-
picker: "year"
|
|
37539
|
-
|
|
37570
|
+
picker: "year",
|
|
37571
|
+
...props,
|
|
37540
37572
|
className: formatClassname([isHighlighted && "highlighted-input"]),
|
|
37541
37573
|
format: "YYYY"
|
|
37542
|
-
})
|
|
37574
|
+
});
|
|
37543
37575
|
},
|
|
37544
|
-
upload: (
|
|
37545
|
-
|
|
37546
|
-
|
|
37547
|
-
|
|
37548
|
-
|
|
37549
|
-
|
|
37550
|
-
|
|
37551
|
-
|
|
37552
|
-
|
|
37553
|
-
|
|
37554
|
-
isHighlighted
|
|
37555
|
-
} = _ref44;
|
|
37576
|
+
upload: ({
|
|
37577
|
+
rules,
|
|
37578
|
+
value
|
|
37579
|
+
}, {
|
|
37580
|
+
setLoading = () => {},
|
|
37581
|
+
getApiBaseUrl,
|
|
37582
|
+
getAppHeader,
|
|
37583
|
+
t,
|
|
37584
|
+
isHighlighted
|
|
37585
|
+
}) => {
|
|
37556
37586
|
const apiURL = getApiBaseUrl();
|
|
37557
37587
|
const accept = rules.length ? rules.find(rule => Object.keys(rule).includes("accept")).accept || "*" : null;
|
|
37558
37588
|
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) : []) || [];
|
|
@@ -37565,12 +37595,13 @@ const inputTypeComponent$1 = {
|
|
|
37565
37595
|
maxProps.multiple = true;
|
|
37566
37596
|
}
|
|
37567
37597
|
}
|
|
37568
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload,
|
|
37598
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37599
|
+
...maxProps,
|
|
37569
37600
|
accept: accept,
|
|
37570
|
-
action:
|
|
37601
|
+
action: `${apiURL}/upload`,
|
|
37571
37602
|
beforeUpload: beforeUpload(allowedExtensions),
|
|
37572
37603
|
onChange: val => {
|
|
37573
|
-
if (val
|
|
37604
|
+
if (val?.file && typeof setLoading === "function") {
|
|
37574
37605
|
if (val.file.percent !== 100) {
|
|
37575
37606
|
setLoading(true);
|
|
37576
37607
|
} else {
|
|
@@ -37578,9 +37609,10 @@ const inputTypeComponent$1 = {
|
|
|
37578
37609
|
}
|
|
37579
37610
|
}
|
|
37580
37611
|
},
|
|
37581
|
-
headers:
|
|
37582
|
-
Authorization:
|
|
37583
|
-
|
|
37612
|
+
headers: {
|
|
37613
|
+
Authorization: `Bearer ${getToken()}`,
|
|
37614
|
+
...getAppHeader()
|
|
37615
|
+
},
|
|
37584
37616
|
defaultFileList: values,
|
|
37585
37617
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
37586
37618
|
style: {
|
|
@@ -37591,20 +37623,18 @@ const inputTypeComponent$1 = {
|
|
|
37591
37623
|
children: t("Upload")
|
|
37592
37624
|
})]
|
|
37593
37625
|
})
|
|
37594
|
-
})
|
|
37626
|
+
});
|
|
37595
37627
|
},
|
|
37596
|
-
imageUpload: (
|
|
37597
|
-
|
|
37598
|
-
|
|
37599
|
-
|
|
37600
|
-
|
|
37601
|
-
|
|
37602
|
-
|
|
37603
|
-
|
|
37604
|
-
|
|
37605
|
-
|
|
37606
|
-
isHighlighted
|
|
37607
|
-
} = _ref46;
|
|
37628
|
+
imageUpload: ({
|
|
37629
|
+
rules,
|
|
37630
|
+
value
|
|
37631
|
+
}, {
|
|
37632
|
+
setLoading = () => {},
|
|
37633
|
+
getApiBaseUrl,
|
|
37634
|
+
getAppHeader,
|
|
37635
|
+
t,
|
|
37636
|
+
isHighlighted
|
|
37637
|
+
}) => {
|
|
37608
37638
|
const apiURL = getApiBaseUrl();
|
|
37609
37639
|
const values = getImageUploadEditValue(value);
|
|
37610
37640
|
const maxRule = rules.find(r => r.max);
|
|
@@ -37615,18 +37645,17 @@ const inputTypeComponent$1 = {
|
|
|
37615
37645
|
maxProps.multiple = true;
|
|
37616
37646
|
}
|
|
37617
37647
|
}
|
|
37618
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload,
|
|
37619
|
-
beforeUpload: beforeUpload(allowedImageExtensions)
|
|
37620
|
-
|
|
37648
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37649
|
+
beforeUpload: beforeUpload(allowedImageExtensions),
|
|
37650
|
+
...maxProps,
|
|
37621
37651
|
accept: "image/*",
|
|
37622
37652
|
classList: !values || !values.length ? "empty" : "",
|
|
37623
37653
|
listType: "picture",
|
|
37624
|
-
action:
|
|
37654
|
+
action: `${apiURL}/upload`,
|
|
37625
37655
|
onChange: val => {
|
|
37626
37656
|
if (typeof setLoading === "function") {
|
|
37627
|
-
if (val
|
|
37628
|
-
|
|
37629
|
-
if ((val === null || val === void 0 || (_val$file = val.file) === null || _val$file === void 0 ? void 0 : _val$file.status) === "removed") {
|
|
37657
|
+
if (val?.file) {
|
|
37658
|
+
if (val?.file?.status === "removed") {
|
|
37630
37659
|
setLoading(false);
|
|
37631
37660
|
return;
|
|
37632
37661
|
}
|
|
@@ -37638,9 +37667,10 @@ const inputTypeComponent$1 = {
|
|
|
37638
37667
|
setLoading(false);
|
|
37639
37668
|
}
|
|
37640
37669
|
},
|
|
37641
|
-
headers:
|
|
37642
|
-
Authorization:
|
|
37643
|
-
|
|
37670
|
+
headers: {
|
|
37671
|
+
Authorization: `Bearer ${getToken()}`,
|
|
37672
|
+
...getAppHeader()
|
|
37673
|
+
},
|
|
37644
37674
|
defaultFileList: values,
|
|
37645
37675
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
37646
37676
|
style: {
|
|
@@ -37651,20 +37681,18 @@ const inputTypeComponent$1 = {
|
|
|
37651
37681
|
children: t("Upload")
|
|
37652
37682
|
})]
|
|
37653
37683
|
})
|
|
37654
|
-
})
|
|
37684
|
+
});
|
|
37655
37685
|
},
|
|
37656
|
-
videoUpload: (
|
|
37657
|
-
|
|
37658
|
-
|
|
37659
|
-
|
|
37660
|
-
|
|
37661
|
-
|
|
37662
|
-
|
|
37663
|
-
|
|
37664
|
-
|
|
37665
|
-
|
|
37666
|
-
isHighlighted
|
|
37667
|
-
} = _ref48;
|
|
37686
|
+
videoUpload: ({
|
|
37687
|
+
rules,
|
|
37688
|
+
value
|
|
37689
|
+
}, {
|
|
37690
|
+
setLoading = () => {},
|
|
37691
|
+
getApiBaseUrl,
|
|
37692
|
+
getAppHeader,
|
|
37693
|
+
t,
|
|
37694
|
+
isHighlighted
|
|
37695
|
+
}) => {
|
|
37668
37696
|
const apiURL = getApiBaseUrl();
|
|
37669
37697
|
const values = getImageUploadEditValue(value);
|
|
37670
37698
|
const maxRule = rules.find(r => r.max);
|
|
@@ -37675,25 +37703,21 @@ const inputTypeComponent$1 = {
|
|
|
37675
37703
|
maxProps.multiple = true;
|
|
37676
37704
|
}
|
|
37677
37705
|
}
|
|
37678
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload,
|
|
37679
|
-
itemRender: (item, fileList) => {
|
|
37680
|
-
|
|
37681
|
-
|
|
37682
|
-
|
|
37683
|
-
|
|
37684
|
-
|
|
37685
|
-
});
|
|
37686
|
-
}
|
|
37687
|
-
}, maxProps), {}, {
|
|
37706
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
37707
|
+
itemRender: (item, fileList) => /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
37708
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
|
|
37709
|
+
url: fileList?.response?.url || fileList?.url
|
|
37710
|
+
}), item]
|
|
37711
|
+
}),
|
|
37712
|
+
...maxProps,
|
|
37688
37713
|
accept: "video/*",
|
|
37689
37714
|
classList: !values || !values.length ? "empty" : "",
|
|
37690
37715
|
listType: "picture",
|
|
37691
|
-
action:
|
|
37716
|
+
action: `${apiURL}/upload`,
|
|
37692
37717
|
onChange: val => {
|
|
37693
37718
|
if (typeof setLoading === "function") {
|
|
37694
|
-
if (val
|
|
37695
|
-
|
|
37696
|
-
if ((val === null || val === void 0 || (_val$file2 = val.file) === null || _val$file2 === void 0 ? void 0 : _val$file2.status) === "removed") {
|
|
37719
|
+
if (val?.file) {
|
|
37720
|
+
if (val?.file?.status === "removed") {
|
|
37697
37721
|
setLoading(false);
|
|
37698
37722
|
return;
|
|
37699
37723
|
}
|
|
@@ -37705,9 +37729,10 @@ const inputTypeComponent$1 = {
|
|
|
37705
37729
|
setLoading(false);
|
|
37706
37730
|
}
|
|
37707
37731
|
},
|
|
37708
|
-
headers:
|
|
37709
|
-
Authorization:
|
|
37710
|
-
|
|
37732
|
+
headers: {
|
|
37733
|
+
Authorization: `Bearer ${getToken()}`,
|
|
37734
|
+
...getAppHeader()
|
|
37735
|
+
},
|
|
37711
37736
|
fileList: values,
|
|
37712
37737
|
defaultFileList: values,
|
|
37713
37738
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
@@ -37719,30 +37744,28 @@ const inputTypeComponent$1 = {
|
|
|
37719
37744
|
children: t("Upload")
|
|
37720
37745
|
})]
|
|
37721
37746
|
})
|
|
37722
|
-
})
|
|
37747
|
+
});
|
|
37723
37748
|
},
|
|
37724
|
-
geolocation: (
|
|
37725
|
-
|
|
37726
|
-
|
|
37727
|
-
|
|
37728
|
-
|
|
37729
|
-
|
|
37730
|
-
|
|
37731
|
-
|
|
37732
|
-
|
|
37733
|
-
|
|
37734
|
-
isHighlighted
|
|
37735
|
-
} = _ref50;
|
|
37749
|
+
geolocation: ({
|
|
37750
|
+
value,
|
|
37751
|
+
name,
|
|
37752
|
+
props,
|
|
37753
|
+
formsValue,
|
|
37754
|
+
addressData
|
|
37755
|
+
}, {
|
|
37756
|
+
inputMeta,
|
|
37757
|
+
isHighlighted
|
|
37758
|
+
}) => {
|
|
37736
37759
|
let search = formsValue.country;
|
|
37737
37760
|
if (addressData && Object.keys(addressData).length > 0) {
|
|
37738
37761
|
if (addressData.country) {
|
|
37739
37762
|
search = addressData.country;
|
|
37740
37763
|
}
|
|
37741
37764
|
if (addressData.level1) {
|
|
37742
|
-
search =
|
|
37765
|
+
search = `${addressData.level1}, ${addressData.country}`;
|
|
37743
37766
|
}
|
|
37744
37767
|
if (addressData.level2) {
|
|
37745
|
-
search =
|
|
37768
|
+
search = `${addressData.level2}, ${addressData.level1}, ${addressData.country}`;
|
|
37746
37769
|
}
|
|
37747
37770
|
} else {
|
|
37748
37771
|
const country = countriesList.countries[formsValue.country] || {};
|
|
@@ -37750,10 +37773,10 @@ const inputTypeComponent$1 = {
|
|
|
37750
37773
|
search = country.name;
|
|
37751
37774
|
}
|
|
37752
37775
|
if (formsValue.administrativeLevel1Name) {
|
|
37753
|
-
search =
|
|
37776
|
+
search = `${search} ${formsValue.administrativeLevel1Name}`;
|
|
37754
37777
|
}
|
|
37755
37778
|
if (formsValue.administrativeLevel2Name) {
|
|
37756
|
-
search =
|
|
37779
|
+
search = `${search} ${formsValue.administrativeLevel2Name}`;
|
|
37757
37780
|
}
|
|
37758
37781
|
}
|
|
37759
37782
|
return /*#__PURE__*/jsxRuntime.jsx(Geolocation, {
|
|
@@ -37767,36 +37790,34 @@ const inputTypeComponent$1 = {
|
|
|
37767
37790
|
searchValue: search
|
|
37768
37791
|
});
|
|
37769
37792
|
},
|
|
37770
|
-
ajaxSelect: (
|
|
37771
|
-
|
|
37772
|
-
|
|
37773
|
-
|
|
37774
|
-
|
|
37775
|
-
|
|
37776
|
-
|
|
37777
|
-
|
|
37778
|
-
|
|
37779
|
-
|
|
37780
|
-
|
|
37781
|
-
|
|
37782
|
-
|
|
37783
|
-
|
|
37784
|
-
|
|
37785
|
-
|
|
37786
|
-
|
|
37787
|
-
|
|
37788
|
-
|
|
37789
|
-
|
|
37790
|
-
|
|
37791
|
-
|
|
37792
|
-
|
|
37793
|
-
|
|
37794
|
-
|
|
37795
|
-
|
|
37796
|
-
|
|
37797
|
-
|
|
37798
|
-
groupFormId
|
|
37799
|
-
} = _ref52;
|
|
37793
|
+
ajaxSelect: ({
|
|
37794
|
+
call,
|
|
37795
|
+
automaticallyLink,
|
|
37796
|
+
name,
|
|
37797
|
+
inputName,
|
|
37798
|
+
props,
|
|
37799
|
+
formsValue,
|
|
37800
|
+
onNewSetValue,
|
|
37801
|
+
multiple,
|
|
37802
|
+
updateOptions,
|
|
37803
|
+
repeatValues,
|
|
37804
|
+
repeatIndex,
|
|
37805
|
+
value,
|
|
37806
|
+
unique,
|
|
37807
|
+
address,
|
|
37808
|
+
addressData = {},
|
|
37809
|
+
getFromLinking,
|
|
37810
|
+
input
|
|
37811
|
+
}, {
|
|
37812
|
+
form,
|
|
37813
|
+
forms,
|
|
37814
|
+
setAddress,
|
|
37815
|
+
changeInputMeta,
|
|
37816
|
+
inputMeta,
|
|
37817
|
+
meta,
|
|
37818
|
+
isHighlighted,
|
|
37819
|
+
groupFormId
|
|
37820
|
+
}) => {
|
|
37800
37821
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect, {
|
|
37801
37822
|
size: "medium",
|
|
37802
37823
|
input: input,
|
|
@@ -37833,7 +37854,9 @@ const inputTypeComponent$1 = {
|
|
|
37833
37854
|
const selectedValue = data.find(v => v.value === ev);
|
|
37834
37855
|
if (address && selectedValue) {
|
|
37835
37856
|
dot__default["default"].str(address, selectedValue.label, addressData);
|
|
37836
|
-
setAddress(
|
|
37857
|
+
setAddress({
|
|
37858
|
+
...addressData
|
|
37859
|
+
});
|
|
37837
37860
|
}
|
|
37838
37861
|
}
|
|
37839
37862
|
},
|
|
@@ -37842,11 +37865,10 @@ const inputTypeComponent$1 = {
|
|
|
37842
37865
|
address: true
|
|
37843
37866
|
});
|
|
37844
37867
|
},
|
|
37845
|
-
tag:
|
|
37846
|
-
|
|
37847
|
-
|
|
37848
|
-
|
|
37849
|
-
} = _ref53;
|
|
37868
|
+
tag: ({
|
|
37869
|
+
value,
|
|
37870
|
+
repeatLabel
|
|
37871
|
+
}) => {
|
|
37850
37872
|
return /*#__PURE__*/jsxRuntime.jsx(TagInput, {
|
|
37851
37873
|
size: "large",
|
|
37852
37874
|
allowClear: true,
|
|
@@ -37854,28 +37876,26 @@ const inputTypeComponent$1 = {
|
|
|
37854
37876
|
newPlaceholder: repeatLabel
|
|
37855
37877
|
});
|
|
37856
37878
|
},
|
|
37857
|
-
modal: (
|
|
37858
|
-
|
|
37859
|
-
|
|
37860
|
-
|
|
37861
|
-
|
|
37862
|
-
|
|
37863
|
-
|
|
37864
|
-
|
|
37865
|
-
|
|
37866
|
-
|
|
37867
|
-
|
|
37868
|
-
|
|
37869
|
-
|
|
37870
|
-
|
|
37871
|
-
|
|
37872
|
-
|
|
37873
|
-
|
|
37874
|
-
|
|
37875
|
-
|
|
37876
|
-
|
|
37877
|
-
add
|
|
37878
|
-
} = _ref55;
|
|
37879
|
+
modal: ({
|
|
37880
|
+
call,
|
|
37881
|
+
automaticallyLink,
|
|
37882
|
+
name,
|
|
37883
|
+
inputName,
|
|
37884
|
+
props,
|
|
37885
|
+
formsValue,
|
|
37886
|
+
allFormsValue,
|
|
37887
|
+
onNewSetValue,
|
|
37888
|
+
repeatValues,
|
|
37889
|
+
repeatIndex,
|
|
37890
|
+
value,
|
|
37891
|
+
modalTitle,
|
|
37892
|
+
totalInputs,
|
|
37893
|
+
shownInputs,
|
|
37894
|
+
allowDupplicates
|
|
37895
|
+
}, {
|
|
37896
|
+
form,
|
|
37897
|
+
add
|
|
37898
|
+
}) => {
|
|
37879
37899
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxModal, {
|
|
37880
37900
|
allowClear: true,
|
|
37881
37901
|
call: call,
|
|
@@ -37898,44 +37918,40 @@ const inputTypeComponent$1 = {
|
|
|
37898
37918
|
allowDupplicates: allowDupplicates
|
|
37899
37919
|
});
|
|
37900
37920
|
},
|
|
37901
|
-
dataLink: (
|
|
37902
|
-
|
|
37903
|
-
|
|
37904
|
-
|
|
37905
|
-
|
|
37906
|
-
|
|
37907
|
-
|
|
37908
|
-
|
|
37909
|
-
|
|
37910
|
-
|
|
37911
|
-
|
|
37912
|
-
|
|
37913
|
-
|
|
37914
|
-
|
|
37915
|
-
|
|
37916
|
-
|
|
37917
|
-
|
|
37918
|
-
|
|
37919
|
-
|
|
37920
|
-
|
|
37921
|
-
|
|
37922
|
-
|
|
37923
|
-
|
|
37924
|
-
|
|
37925
|
-
|
|
37926
|
-
|
|
37927
|
-
|
|
37928
|
-
|
|
37929
|
-
|
|
37930
|
-
|
|
37931
|
-
|
|
37932
|
-
|
|
37933
|
-
groupFormId
|
|
37934
|
-
|
|
37935
|
-
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") {
|
|
37936
|
-
var _formsValue$groupForm3, _input$meta13, _input$meta14;
|
|
37937
|
-
const currentValue = groupFormId ? (_formsValue$groupForm3 = formsValue[groupFormId]) === null || _formsValue$groupForm3 === void 0 ? void 0 : _formsValue$groupForm3[name] : formsValue[name];
|
|
37938
|
-
(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()::::";
|
|
37921
|
+
dataLink: ({
|
|
37922
|
+
setValues,
|
|
37923
|
+
name,
|
|
37924
|
+
onValuesChange,
|
|
37925
|
+
changeLinking,
|
|
37926
|
+
formsValue,
|
|
37927
|
+
input,
|
|
37928
|
+
call,
|
|
37929
|
+
automaticallyLink,
|
|
37930
|
+
inputName,
|
|
37931
|
+
props,
|
|
37932
|
+
onNewSetValue,
|
|
37933
|
+
multiple,
|
|
37934
|
+
updateOptions,
|
|
37935
|
+
repeatValues,
|
|
37936
|
+
repeatIndex,
|
|
37937
|
+
value,
|
|
37938
|
+
unique,
|
|
37939
|
+
address,
|
|
37940
|
+
addressData = {},
|
|
37941
|
+
getFromLinking
|
|
37942
|
+
}, {
|
|
37943
|
+
form,
|
|
37944
|
+
forms,
|
|
37945
|
+
setAddress,
|
|
37946
|
+
changeInputMeta,
|
|
37947
|
+
inputMeta,
|
|
37948
|
+
meta,
|
|
37949
|
+
isHighlighted,
|
|
37950
|
+
groupFormId
|
|
37951
|
+
}) => {
|
|
37952
|
+
if (input?.meta?.optionsView?.editInputType === "ajaxSelect") {
|
|
37953
|
+
const currentValue = groupFormId ? formsValue[groupFormId]?.[name] : formsValue[name];
|
|
37954
|
+
input?.meta?.optionsView?.call || input?.meta?.call || "default::list()::::";
|
|
37939
37955
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect$1, {
|
|
37940
37956
|
size: "medium",
|
|
37941
37957
|
input: input,
|
|
@@ -37972,7 +37988,9 @@ const inputTypeComponent$1 = {
|
|
|
37972
37988
|
const selectedValue = data.find(v => v.value === ev);
|
|
37973
37989
|
if (address && selectedValue) {
|
|
37974
37990
|
dot__default["default"].str(address, selectedValue.label, addressData);
|
|
37975
|
-
setAddress(
|
|
37991
|
+
setAddress({
|
|
37992
|
+
...addressData
|
|
37993
|
+
});
|
|
37976
37994
|
}
|
|
37977
37995
|
}
|
|
37978
37996
|
},
|
|
@@ -37982,93 +38000,138 @@ const inputTypeComponent$1 = {
|
|
|
37982
38000
|
isDataLink: true
|
|
37983
38001
|
});
|
|
37984
38002
|
}
|
|
37985
|
-
const isSingle =
|
|
37986
|
-
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [
|
|
38003
|
+
const isSingle = input?.meta?.maxRepeat === 1;
|
|
38004
|
+
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
|
|
38005
|
+
...(formsValue[groupFormId] || {})[name]
|
|
38006
|
+
}] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
|
|
38007
|
+
...v
|
|
38008
|
+
})) : isSingle ? formsValue[name] ? [{
|
|
38009
|
+
...formsValue[name]
|
|
38010
|
+
}] : [] : (formsValue[name] || []).map(v => ({
|
|
38011
|
+
...v
|
|
38012
|
+
}));
|
|
37987
38013
|
const onUpdate = (editData, i) => {
|
|
37988
|
-
const val =
|
|
38014
|
+
const val = {
|
|
38015
|
+
...formData[i],
|
|
38016
|
+
...editData
|
|
38017
|
+
};
|
|
37989
38018
|
const _val = isSingle ? {
|
|
37990
38019
|
[name]: val
|
|
37991
38020
|
} : {
|
|
37992
|
-
[name]: formData
|
|
38021
|
+
[name]: formData?.map((d, j) => i === j ? val : d)
|
|
37993
38022
|
};
|
|
37994
38023
|
if (groupFormId) {
|
|
37995
|
-
const _defaultData =
|
|
37996
|
-
const _newData =
|
|
37997
|
-
|
|
38024
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38025
|
+
const _newData = {
|
|
38026
|
+
..._defaultData,
|
|
38027
|
+
..._val
|
|
38028
|
+
};
|
|
38029
|
+
onValuesChange(_newData, {
|
|
38030
|
+
...formsValue,
|
|
37998
38031
|
[groupFormId]: _newData
|
|
37999
|
-
})
|
|
38000
|
-
form
|
|
38001
|
-
setValues(
|
|
38032
|
+
});
|
|
38033
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38034
|
+
setValues({
|
|
38035
|
+
...formsValue,
|
|
38002
38036
|
[groupFormId]: _newData
|
|
38003
|
-
})
|
|
38037
|
+
});
|
|
38004
38038
|
return;
|
|
38005
38039
|
}
|
|
38006
|
-
onValuesChange(_val,
|
|
38007
|
-
|
|
38008
|
-
|
|
38040
|
+
onValuesChange(_val, {
|
|
38041
|
+
...formsValue,
|
|
38042
|
+
..._val
|
|
38043
|
+
});
|
|
38044
|
+
form?.setFieldValue(name, _val[name]);
|
|
38045
|
+
setValues({
|
|
38046
|
+
...formsValue,
|
|
38047
|
+
..._val
|
|
38048
|
+
});
|
|
38009
38049
|
};
|
|
38010
|
-
if (input
|
|
38011
|
-
var _formsValue$meta4, _input$meta17;
|
|
38050
|
+
if (input?.meta?.flat) {
|
|
38012
38051
|
return /*#__PURE__*/jsxRuntime.jsx(DataLinkFlat, {
|
|
38013
38052
|
form: input,
|
|
38014
38053
|
changeLinking: changeLinking,
|
|
38015
38054
|
onUpdate: onUpdate,
|
|
38016
38055
|
isHighlighted: isHighlighted,
|
|
38017
38056
|
formsValue: formsValue,
|
|
38018
|
-
values: groupFormId ?
|
|
38057
|
+
values: groupFormId ? {
|
|
38058
|
+
...(formsValue[groupFormId] || {}),
|
|
38019
38059
|
meta: {
|
|
38020
|
-
inputs: (
|
|
38060
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
38021
38061
|
}
|
|
38022
|
-
}
|
|
38062
|
+
} : formsValue,
|
|
38023
38063
|
name: name,
|
|
38024
38064
|
groupFormId: groupFormId,
|
|
38025
|
-
maxRepeat: input
|
|
38026
|
-
remove:
|
|
38027
|
-
|
|
38028
|
-
|
|
38029
|
-
} = _ref58;
|
|
38065
|
+
maxRepeat: input?.meta?.maxRepeat,
|
|
38066
|
+
remove: ({
|
|
38067
|
+
key
|
|
38068
|
+
}) => {
|
|
38030
38069
|
const _val = isSingle ? {
|
|
38031
38070
|
[name]: null
|
|
38032
38071
|
} : {
|
|
38033
38072
|
[name]: formData.filter((v, i) => i !== key)
|
|
38034
38073
|
};
|
|
38035
38074
|
if (groupFormId) {
|
|
38036
|
-
const _defaultData =
|
|
38037
|
-
const _newData =
|
|
38038
|
-
|
|
38075
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38076
|
+
const _newData = {
|
|
38077
|
+
..._defaultData,
|
|
38078
|
+
..._val
|
|
38079
|
+
};
|
|
38080
|
+
onValuesChange(_newData, {
|
|
38081
|
+
...formsValue,
|
|
38039
38082
|
[groupFormId]: _newData
|
|
38040
|
-
})
|
|
38041
|
-
form
|
|
38042
|
-
setValues(
|
|
38083
|
+
});
|
|
38084
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38085
|
+
setValues({
|
|
38086
|
+
...formsValue,
|
|
38043
38087
|
[groupFormId]: _newData
|
|
38044
|
-
})
|
|
38088
|
+
});
|
|
38045
38089
|
return;
|
|
38046
38090
|
}
|
|
38047
|
-
onValuesChange(_val,
|
|
38048
|
-
|
|
38049
|
-
|
|
38091
|
+
onValuesChange(_val, {
|
|
38092
|
+
...formsValue,
|
|
38093
|
+
..._val
|
|
38094
|
+
});
|
|
38095
|
+
form?.setFieldValue(name, _val[name]);
|
|
38096
|
+
setValues({
|
|
38097
|
+
...formsValue,
|
|
38098
|
+
..._val
|
|
38099
|
+
});
|
|
38050
38100
|
},
|
|
38051
38101
|
add: val => {
|
|
38052
38102
|
const _val = isSingle ? {
|
|
38053
38103
|
[name]: val
|
|
38054
38104
|
} : {
|
|
38055
|
-
[name]: [...formData,
|
|
38105
|
+
[name]: [...formData, {
|
|
38106
|
+
...val
|
|
38107
|
+
}]
|
|
38056
38108
|
};
|
|
38057
38109
|
if (groupFormId) {
|
|
38058
|
-
const _defaultData =
|
|
38059
|
-
const _newData =
|
|
38060
|
-
|
|
38061
|
-
|
|
38110
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38111
|
+
const _newData = {
|
|
38112
|
+
..._defaultData,
|
|
38113
|
+
..._val
|
|
38114
|
+
};
|
|
38115
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38116
|
+
onValuesChange(_newData, {
|
|
38117
|
+
...formsValue,
|
|
38062
38118
|
[groupFormId]: _newData
|
|
38063
|
-
})
|
|
38064
|
-
setValues(
|
|
38119
|
+
});
|
|
38120
|
+
setValues({
|
|
38121
|
+
...formsValue,
|
|
38065
38122
|
[groupFormId]: _newData
|
|
38066
|
-
})
|
|
38123
|
+
});
|
|
38067
38124
|
return;
|
|
38068
38125
|
}
|
|
38069
|
-
form
|
|
38070
|
-
onValuesChange(_val,
|
|
38071
|
-
|
|
38126
|
+
form?.setFieldValue(name, _val[name]);
|
|
38127
|
+
onValuesChange(_val, {
|
|
38128
|
+
...formsValue,
|
|
38129
|
+
..._val
|
|
38130
|
+
});
|
|
38131
|
+
setValues({
|
|
38132
|
+
...formsValue,
|
|
38133
|
+
..._val
|
|
38134
|
+
});
|
|
38072
38135
|
},
|
|
38073
38136
|
k: name,
|
|
38074
38137
|
formData: formData
|
|
@@ -38080,79 +38143,101 @@ const inputTypeComponent$1 = {
|
|
|
38080
38143
|
onUpdate: onUpdate,
|
|
38081
38144
|
isHighlighted: isHighlighted,
|
|
38082
38145
|
formsValue: formsValue,
|
|
38083
|
-
values: groupFormId ?
|
|
38146
|
+
values: groupFormId ? {
|
|
38147
|
+
...(formsValue[groupFormId] || {}),
|
|
38084
38148
|
meta: {
|
|
38085
|
-
inputs: (
|
|
38149
|
+
inputs: (formsValue?.meta?.inputs || {})[groupFormId]
|
|
38086
38150
|
}
|
|
38087
|
-
}
|
|
38151
|
+
} : formsValue,
|
|
38088
38152
|
name: name,
|
|
38089
38153
|
groupFormId: groupFormId,
|
|
38090
|
-
maxRepeat: input
|
|
38091
|
-
remove:
|
|
38092
|
-
|
|
38093
|
-
|
|
38094
|
-
} = _ref59;
|
|
38154
|
+
maxRepeat: input?.meta?.maxRepeat,
|
|
38155
|
+
remove: ({
|
|
38156
|
+
key
|
|
38157
|
+
}) => {
|
|
38095
38158
|
const _val = isSingle ? {
|
|
38096
38159
|
[name]: null
|
|
38097
38160
|
} : {
|
|
38098
38161
|
[name]: formData.filter((v, i) => i !== key)
|
|
38099
38162
|
};
|
|
38100
38163
|
if (groupFormId) {
|
|
38101
|
-
const _defaultData =
|
|
38102
|
-
const _newData =
|
|
38103
|
-
|
|
38164
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38165
|
+
const _newData = {
|
|
38166
|
+
..._defaultData,
|
|
38167
|
+
..._val
|
|
38168
|
+
};
|
|
38169
|
+
onValuesChange(_newData, {
|
|
38170
|
+
...formsValue,
|
|
38104
38171
|
[groupFormId]: _newData
|
|
38105
|
-
})
|
|
38106
|
-
form
|
|
38107
|
-
setValues(
|
|
38172
|
+
});
|
|
38173
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38174
|
+
setValues({
|
|
38175
|
+
...formsValue,
|
|
38108
38176
|
[groupFormId]: _newData
|
|
38109
|
-
})
|
|
38177
|
+
});
|
|
38110
38178
|
return;
|
|
38111
38179
|
}
|
|
38112
|
-
onValuesChange(_val,
|
|
38113
|
-
|
|
38114
|
-
|
|
38180
|
+
onValuesChange(_val, {
|
|
38181
|
+
...formsValue,
|
|
38182
|
+
..._val
|
|
38183
|
+
});
|
|
38184
|
+
form?.setFieldValue(name, _val[name]);
|
|
38185
|
+
setValues({
|
|
38186
|
+
...formsValue,
|
|
38187
|
+
..._val
|
|
38188
|
+
});
|
|
38115
38189
|
},
|
|
38116
38190
|
add: val => {
|
|
38117
38191
|
const _val = isSingle ? {
|
|
38118
38192
|
[name]: val
|
|
38119
38193
|
} : {
|
|
38120
|
-
[name]: [...formData,
|
|
38194
|
+
[name]: [...formData, {
|
|
38195
|
+
...val
|
|
38196
|
+
}]
|
|
38121
38197
|
};
|
|
38122
38198
|
if (groupFormId) {
|
|
38123
|
-
const _defaultData =
|
|
38124
|
-
const _newData =
|
|
38125
|
-
|
|
38126
|
-
|
|
38199
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38200
|
+
const _newData = {
|
|
38201
|
+
..._defaultData,
|
|
38202
|
+
..._val
|
|
38203
|
+
};
|
|
38204
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38205
|
+
onValuesChange(_newData, {
|
|
38206
|
+
...formsValue,
|
|
38127
38207
|
[groupFormId]: _newData
|
|
38128
|
-
})
|
|
38129
|
-
setValues(
|
|
38208
|
+
});
|
|
38209
|
+
setValues({
|
|
38210
|
+
...formsValue,
|
|
38130
38211
|
[groupFormId]: _newData
|
|
38131
|
-
})
|
|
38212
|
+
});
|
|
38132
38213
|
return;
|
|
38133
38214
|
}
|
|
38134
|
-
form
|
|
38135
|
-
onValuesChange(_val,
|
|
38136
|
-
|
|
38215
|
+
form?.setFieldValue(name, _val[name]);
|
|
38216
|
+
onValuesChange(_val, {
|
|
38217
|
+
...formsValue,
|
|
38218
|
+
..._val
|
|
38219
|
+
});
|
|
38220
|
+
setValues({
|
|
38221
|
+
...formsValue,
|
|
38222
|
+
..._val
|
|
38223
|
+
});
|
|
38137
38224
|
},
|
|
38138
38225
|
k: name,
|
|
38139
38226
|
formData: formData
|
|
38140
38227
|
});
|
|
38141
38228
|
},
|
|
38142
|
-
dataLinkGroup: (
|
|
38143
|
-
|
|
38144
|
-
|
|
38145
|
-
|
|
38146
|
-
|
|
38147
|
-
|
|
38148
|
-
|
|
38149
|
-
|
|
38150
|
-
|
|
38151
|
-
|
|
38152
|
-
|
|
38153
|
-
|
|
38154
|
-
isHighlighted
|
|
38155
|
-
} = _ref61;
|
|
38229
|
+
dataLinkGroup: ({
|
|
38230
|
+
setValues,
|
|
38231
|
+
name,
|
|
38232
|
+
onValuesChange,
|
|
38233
|
+
changeLinking,
|
|
38234
|
+
formsValue,
|
|
38235
|
+
input
|
|
38236
|
+
}, {
|
|
38237
|
+
form,
|
|
38238
|
+
groupFormId,
|
|
38239
|
+
isHighlighted
|
|
38240
|
+
}) => {
|
|
38156
38241
|
return renderDataLinkGroup({
|
|
38157
38242
|
input,
|
|
38158
38243
|
name,
|
|
@@ -38165,41 +38250,51 @@ const inputTypeComponent$1 = {
|
|
|
38165
38250
|
isHighlighted
|
|
38166
38251
|
});
|
|
38167
38252
|
},
|
|
38168
|
-
groupCheckbox: (
|
|
38169
|
-
|
|
38170
|
-
|
|
38171
|
-
|
|
38172
|
-
|
|
38173
|
-
|
|
38174
|
-
|
|
38175
|
-
|
|
38176
|
-
|
|
38177
|
-
|
|
38178
|
-
|
|
38179
|
-
isHighlighted
|
|
38180
|
-
} = _ref63;
|
|
38253
|
+
groupCheckbox: ({
|
|
38254
|
+
setValues,
|
|
38255
|
+
name,
|
|
38256
|
+
onValuesChange,
|
|
38257
|
+
formsValue,
|
|
38258
|
+
input
|
|
38259
|
+
}, {
|
|
38260
|
+
form,
|
|
38261
|
+
groupFormId,
|
|
38262
|
+
isHighlighted
|
|
38263
|
+
}) => {
|
|
38181
38264
|
const formData = groupFormId ? (formsValue[groupFormId] || {})[name] || [] : formsValue[name] || [];
|
|
38182
38265
|
const onUpdate = (val, key) => {
|
|
38183
38266
|
const _val = {
|
|
38184
|
-
[name]:
|
|
38267
|
+
[name]: {
|
|
38268
|
+
...formData,
|
|
38185
38269
|
[key]: val
|
|
38186
|
-
}
|
|
38270
|
+
}
|
|
38187
38271
|
};
|
|
38188
38272
|
if (groupFormId) {
|
|
38189
|
-
const _defaultData =
|
|
38190
|
-
const _newData =
|
|
38191
|
-
|
|
38273
|
+
const _defaultData = form?.getFieldValue(groupFormId) || {};
|
|
38274
|
+
const _newData = {
|
|
38275
|
+
..._defaultData,
|
|
38276
|
+
..._val
|
|
38277
|
+
};
|
|
38278
|
+
onValuesChange(_newData, {
|
|
38279
|
+
...formsValue,
|
|
38192
38280
|
[groupFormId]: _newData
|
|
38193
|
-
})
|
|
38194
|
-
form
|
|
38195
|
-
setValues(
|
|
38281
|
+
});
|
|
38282
|
+
form?.setFieldValue(groupFormId, _newData);
|
|
38283
|
+
setValues({
|
|
38284
|
+
...formsValue,
|
|
38196
38285
|
[groupFormId]: _newData
|
|
38197
|
-
})
|
|
38286
|
+
});
|
|
38198
38287
|
return;
|
|
38199
38288
|
}
|
|
38200
|
-
onValuesChange(_val,
|
|
38201
|
-
|
|
38202
|
-
|
|
38289
|
+
onValuesChange(_val, {
|
|
38290
|
+
...formsValue,
|
|
38291
|
+
..._val
|
|
38292
|
+
});
|
|
38293
|
+
form?.setFieldValue(name, _val[name]);
|
|
38294
|
+
setValues({
|
|
38295
|
+
...formsValue,
|
|
38296
|
+
..._val
|
|
38297
|
+
});
|
|
38203
38298
|
};
|
|
38204
38299
|
return /*#__PURE__*/jsxRuntime.jsx(GroupCheckbox, {
|
|
38205
38300
|
form: input,
|
|
@@ -38208,91 +38303,96 @@ const inputTypeComponent$1 = {
|
|
|
38208
38303
|
isHighlighted: isHighlighted
|
|
38209
38304
|
});
|
|
38210
38305
|
},
|
|
38211
|
-
website: (
|
|
38212
|
-
|
|
38213
|
-
|
|
38214
|
-
|
|
38215
|
-
|
|
38216
|
-
|
|
38217
|
-
|
|
38218
|
-
|
|
38219
|
-
|
|
38220
|
-
|
|
38221
|
-
|
|
38222
|
-
|
|
38223
|
-
|
|
38224
|
-
|
|
38225
|
-
|
|
38226
|
-
} = _ref65;
|
|
38227
|
-
return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
|
|
38306
|
+
website: ({
|
|
38307
|
+
name,
|
|
38308
|
+
inputName,
|
|
38309
|
+
props,
|
|
38310
|
+
value,
|
|
38311
|
+
repeatIndex,
|
|
38312
|
+
repeatValues,
|
|
38313
|
+
formsValue
|
|
38314
|
+
}, {
|
|
38315
|
+
form,
|
|
38316
|
+
isHighlighted,
|
|
38317
|
+
inputMeta = {},
|
|
38318
|
+
t
|
|
38319
|
+
}) => {
|
|
38320
|
+
return /*#__PURE__*/jsxRuntime.jsx(Website, {
|
|
38228
38321
|
size: "large",
|
|
38229
38322
|
allowClear: true,
|
|
38230
|
-
initialValue: value
|
|
38231
|
-
|
|
38323
|
+
initialValue: value,
|
|
38324
|
+
...props,
|
|
38232
38325
|
onChange: val => updateFormValues$1(repeatIndex, repeatValues, inputName, val, formsValue, name, form),
|
|
38233
38326
|
className: formatClassname([isHighlighted && "highlighted-cont"]),
|
|
38234
38327
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
38235
38328
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com"
|
|
38236
|
-
})
|
|
38329
|
+
});
|
|
38237
38330
|
},
|
|
38238
|
-
group: (
|
|
38239
|
-
|
|
38240
|
-
|
|
38241
|
-
|
|
38242
|
-
|
|
38243
|
-
|
|
38244
|
-
|
|
38245
|
-
|
|
38246
|
-
|
|
38247
|
-
} = _ref67;
|
|
38248
|
-
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
|
|
38331
|
+
group: ({
|
|
38332
|
+
props,
|
|
38333
|
+
groupInputs,
|
|
38334
|
+
formsValue
|
|
38335
|
+
}, {
|
|
38336
|
+
inputMeta,
|
|
38337
|
+
isHighlighted
|
|
38338
|
+
}) => {
|
|
38339
|
+
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
|
|
38249
38340
|
formsValue: formsValue,
|
|
38250
38341
|
isHighlighted: isHighlighted,
|
|
38251
38342
|
groupInputs: groupInputs,
|
|
38252
|
-
inputMeta: inputMeta
|
|
38253
|
-
|
|
38343
|
+
inputMeta: inputMeta,
|
|
38344
|
+
...props
|
|
38345
|
+
});
|
|
38254
38346
|
},
|
|
38255
|
-
groupInputs: (
|
|
38256
|
-
|
|
38257
|
-
|
|
38258
|
-
|
|
38259
|
-
|
|
38260
|
-
|
|
38261
|
-
|
|
38262
|
-
|
|
38263
|
-
|
|
38264
|
-
} = _ref69;
|
|
38265
|
-
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, _objectSpread2({
|
|
38347
|
+
groupInputs: ({
|
|
38348
|
+
props,
|
|
38349
|
+
groupInputs,
|
|
38350
|
+
formsValue
|
|
38351
|
+
}, {
|
|
38352
|
+
inputMeta,
|
|
38353
|
+
isHighlighted
|
|
38354
|
+
}) => {
|
|
38355
|
+
return /*#__PURE__*/jsxRuntime.jsx(GroupInput, {
|
|
38266
38356
|
formsValue: formsValue,
|
|
38267
38357
|
isHighlighted: isHighlighted,
|
|
38268
38358
|
groupInputs: groupInputs,
|
|
38269
|
-
inputMeta: inputMeta
|
|
38270
|
-
|
|
38359
|
+
inputMeta: inputMeta,
|
|
38360
|
+
...props
|
|
38361
|
+
});
|
|
38271
38362
|
},
|
|
38272
|
-
smartHelp: (
|
|
38363
|
+
smartHelp: ({
|
|
38364
|
+
name,
|
|
38365
|
+
inputName,
|
|
38366
|
+
props,
|
|
38367
|
+
value,
|
|
38368
|
+
repeatIndex,
|
|
38369
|
+
repeatValues,
|
|
38370
|
+
formsValue
|
|
38371
|
+
}, {
|
|
38372
|
+
form,
|
|
38373
|
+
isHighlighted,
|
|
38374
|
+
inputMeta = {},
|
|
38375
|
+
t
|
|
38376
|
+
}) => {
|
|
38273
38377
|
return /*#__PURE__*/jsxRuntime.jsx(Smart, {});
|
|
38274
38378
|
}
|
|
38275
38379
|
};
|
|
38276
38380
|
const filterForm = (f, d) => {
|
|
38277
38381
|
return f && (f.showFormIf ? showHideForm(f, d) : true);
|
|
38278
38382
|
};
|
|
38279
|
-
const checkFormHasSubsections =
|
|
38280
|
-
let f = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
38281
|
-
return Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
|
|
38282
|
-
};
|
|
38383
|
+
const checkFormHasSubsections = (f = {}) => Object.keys(f).map(key => propHasValue$1(f[key].subSection)).includes(true);
|
|
38283
38384
|
const mapFormGroup = (f, d) => Object.keys(f).map(key => {
|
|
38284
|
-
const
|
|
38285
|
-
|
|
38286
|
-
|
|
38287
|
-
|
|
38288
|
-
|
|
38289
|
-
|
|
38290
|
-
|
|
38291
|
-
|
|
38292
|
-
|
|
38293
|
-
|
|
38294
|
-
|
|
38295
|
-
fc = _objectWithoutProperties(_ref72, _excluded2$1);
|
|
38385
|
+
const {
|
|
38386
|
+
label,
|
|
38387
|
+
description = "",
|
|
38388
|
+
excludeFromEdit,
|
|
38389
|
+
showFormIf,
|
|
38390
|
+
icon = "",
|
|
38391
|
+
position = 0,
|
|
38392
|
+
template,
|
|
38393
|
+
formClass,
|
|
38394
|
+
...fc
|
|
38395
|
+
} = f[key] || {};
|
|
38296
38396
|
const fConf = {
|
|
38297
38397
|
id: key,
|
|
38298
38398
|
label,
|
|
@@ -38351,14 +38451,11 @@ const groupSubForms = (fConf, d) => {
|
|
|
38351
38451
|
return f;
|
|
38352
38452
|
}, {});
|
|
38353
38453
|
};
|
|
38354
|
-
const inputIsEmpty =
|
|
38355
|
-
|
|
38356
|
-
let values = arguments.length > 1 ? arguments[1] : undefined;
|
|
38357
|
-
let inputMeta = arguments.length > 2 ? arguments[2] : undefined;
|
|
38358
|
-
if (inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable) {
|
|
38454
|
+
const inputIsEmpty = (input = {}, values, inputMeta) => {
|
|
38455
|
+
if (inputMeta?.notApplicable || inputMeta?.notAvailable) {
|
|
38359
38456
|
return false;
|
|
38360
38457
|
}
|
|
38361
|
-
if (
|
|
38458
|
+
if (input?.type === "groupInputs") {
|
|
38362
38459
|
return true;
|
|
38363
38460
|
}
|
|
38364
38461
|
const value = values[input.dataId];
|
|
@@ -38370,28 +38467,26 @@ const inputIsEmpty = function () {
|
|
|
38370
38467
|
}
|
|
38371
38468
|
return !value;
|
|
38372
38469
|
};
|
|
38373
|
-
const GetFormItem$1 =
|
|
38374
|
-
|
|
38375
|
-
|
|
38376
|
-
|
|
38377
|
-
|
|
38378
|
-
|
|
38379
|
-
|
|
38380
|
-
|
|
38381
|
-
|
|
38382
|
-
|
|
38383
|
-
|
|
38384
|
-
|
|
38385
|
-
|
|
38386
|
-
|
|
38387
|
-
|
|
38388
|
-
|
|
38389
|
-
|
|
38390
|
-
|
|
38391
|
-
|
|
38392
|
-
|
|
38393
|
-
namespace
|
|
38394
|
-
} = _ref73;
|
|
38470
|
+
const GetFormItem$1 = ({
|
|
38471
|
+
highlightMandatory,
|
|
38472
|
+
inputData,
|
|
38473
|
+
inputId,
|
|
38474
|
+
input,
|
|
38475
|
+
values,
|
|
38476
|
+
MainForm,
|
|
38477
|
+
options,
|
|
38478
|
+
plainForms,
|
|
38479
|
+
setValues,
|
|
38480
|
+
setAddress,
|
|
38481
|
+
i,
|
|
38482
|
+
inputKey,
|
|
38483
|
+
onValuesChange = () => {},
|
|
38484
|
+
setLoading = () => {},
|
|
38485
|
+
inputMeta = {},
|
|
38486
|
+
changeInputMeta = () => {},
|
|
38487
|
+
changeLinking = () => {},
|
|
38488
|
+
namespace
|
|
38489
|
+
}) => {
|
|
38395
38490
|
const {
|
|
38396
38491
|
t,
|
|
38397
38492
|
user,
|
|
@@ -38406,42 +38501,44 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38406
38501
|
staticWidth,
|
|
38407
38502
|
fullWidth
|
|
38408
38503
|
} = useEditContext();
|
|
38409
|
-
const lastReview = (
|
|
38504
|
+
const lastReview = (inputMeta?.reviews || [])[(inputMeta?.reviews?.length || 0) - 1];
|
|
38410
38505
|
const [isShown, setIsShown] = React.useState(!!inputData.commentValue);
|
|
38411
38506
|
const inputLabel = getInputLabel$1(input, values);
|
|
38412
38507
|
const onClickReviewSuccess = () => {
|
|
38413
38508
|
if (!isReview) {
|
|
38414
38509
|
return;
|
|
38415
38510
|
}
|
|
38416
|
-
const reviewSuccess = lastReview
|
|
38511
|
+
const reviewSuccess = lastReview?.reviewSuccess;
|
|
38417
38512
|
changeInputMeta({
|
|
38418
38513
|
key: inputId,
|
|
38419
38514
|
type: input.type,
|
|
38420
|
-
value:
|
|
38515
|
+
value: {
|
|
38516
|
+
...inputMeta,
|
|
38421
38517
|
reviews: reviewSuccess ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
|
|
38422
38518
|
reviewer: user,
|
|
38423
38519
|
createdAt: new Date().toISOString(),
|
|
38424
38520
|
reviewSuccess: true
|
|
38425
38521
|
}]
|
|
38426
|
-
}
|
|
38522
|
+
}
|
|
38427
38523
|
});
|
|
38428
38524
|
};
|
|
38429
38525
|
const onClickReviewError = () => {
|
|
38430
38526
|
if (!isReview) {
|
|
38431
38527
|
return;
|
|
38432
38528
|
}
|
|
38433
|
-
const reviewError = lastReview
|
|
38529
|
+
const reviewError = lastReview?.reviewError;
|
|
38434
38530
|
changeInputMeta({
|
|
38435
38531
|
key: inputId,
|
|
38436
38532
|
type: input.type,
|
|
38437
|
-
value:
|
|
38533
|
+
value: {
|
|
38534
|
+
...inputMeta,
|
|
38438
38535
|
reviews: reviewError ? (inputMeta.reviews || []).filter(v => v.createdAt !== lastReview.createdAt) : [...(inputMeta.reviews || []), {
|
|
38439
38536
|
reviewer: user,
|
|
38440
38537
|
createdAt: new Date().toISOString(),
|
|
38441
38538
|
reviewError: true,
|
|
38442
38539
|
comment: ""
|
|
38443
38540
|
}]
|
|
38444
|
-
}
|
|
38541
|
+
}
|
|
38445
38542
|
});
|
|
38446
38543
|
};
|
|
38447
38544
|
switch (input.type) {
|
|
@@ -38455,12 +38552,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38455
38552
|
case "header":
|
|
38456
38553
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38457
38554
|
className: "daf-title with-subtitle",
|
|
38458
|
-
style: input
|
|
38555
|
+
style: input?.meta?.style,
|
|
38459
38556
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38460
38557
|
className: "flex",
|
|
38461
38558
|
children: [/*#__PURE__*/jsxRuntime.jsx("h1", {
|
|
38462
38559
|
children: ReactHtmlParser__default["default"](getLabel$1(input.label, values))
|
|
38463
|
-
}), !!input.description || input
|
|
38560
|
+
}), !!input.description || input?.meta?.isEvaluation ? /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
|
|
38464
38561
|
content: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38465
38562
|
className: "tooltip-popover-cont",
|
|
38466
38563
|
children: ReactHtmlParser__default["default"](input.description)
|
|
@@ -38487,7 +38584,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38487
38584
|
const specialCharsRule = rules.find(r => r.type === "specialCharacters");
|
|
38488
38585
|
|
|
38489
38586
|
// eslint-disable-next-line no-case-declarations
|
|
38490
|
-
let maxRule =
|
|
38587
|
+
let maxRule = rules.find(rule => rule.max)?.max;
|
|
38491
38588
|
if (!maxRule && input.type === "textarea") {
|
|
38492
38589
|
maxRule = MAX_TEXT_AREA_LENGTH;
|
|
38493
38590
|
}
|
|
@@ -38500,30 +38597,27 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38500
38597
|
message: requiredRule.message || ""
|
|
38501
38598
|
});
|
|
38502
38599
|
}
|
|
38503
|
-
const isHighlighted = highlightMandatory &&
|
|
38600
|
+
const isHighlighted = highlightMandatory && input?.meta?.mandatory && inputIsEmpty(input, values, inputMeta);
|
|
38504
38601
|
if (requiredRule || specialCharsRule) {
|
|
38505
38602
|
if (input.type === "groupInputs") {
|
|
38506
38603
|
rules = rules.map(r => {
|
|
38507
38604
|
if (r.required) {
|
|
38508
|
-
return
|
|
38509
|
-
|
|
38510
|
-
|
|
38511
|
-
|
|
38512
|
-
|
|
38513
|
-
validator() {
|
|
38514
|
-
if (inputMeta.notAvailable || inputMeta.notApplicable) {
|
|
38515
|
-
return Promise.resolve();
|
|
38516
|
-
}
|
|
38517
|
-
const keys = Object.keys(input.inputs);
|
|
38518
|
-
for (let i = 0; i < keys.length; i++) {
|
|
38519
|
-
if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
|
|
38520
|
-
return Promise.reject(r.message);
|
|
38521
|
-
}
|
|
38522
|
-
}
|
|
38605
|
+
return ({
|
|
38606
|
+
getFieldValue
|
|
38607
|
+
}) => ({
|
|
38608
|
+
validator() {
|
|
38609
|
+
if (inputMeta.notAvailable || inputMeta.notApplicable) {
|
|
38523
38610
|
return Promise.resolve();
|
|
38524
38611
|
}
|
|
38525
|
-
|
|
38526
|
-
|
|
38612
|
+
const keys = Object.keys(input.inputs);
|
|
38613
|
+
for (let i = 0; i < keys.length; i++) {
|
|
38614
|
+
if (typeof getFieldValue(keys[i]) === "undefined" || getFieldValue(keys[i]) === null) {
|
|
38615
|
+
return Promise.reject(r.message);
|
|
38616
|
+
}
|
|
38617
|
+
}
|
|
38618
|
+
return Promise.resolve();
|
|
38619
|
+
}
|
|
38620
|
+
});
|
|
38527
38621
|
}
|
|
38528
38622
|
return r;
|
|
38529
38623
|
});
|
|
@@ -38561,13 +38655,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38561
38655
|
}
|
|
38562
38656
|
}
|
|
38563
38657
|
if (input && typeof input === "object") {
|
|
38564
|
-
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;
|
|
38565
38658
|
// check if input is valid
|
|
38566
38659
|
const hideComment = namespace === "project-readiness";
|
|
38567
38660
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
38568
38661
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38569
38662
|
className: "flex-row input-cont",
|
|
38570
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item,
|
|
38663
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38571
38664
|
extra: /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
38572
38665
|
children: !noActionsInputs.includes(input.type) ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38573
38666
|
className: formatClassname(["ml-4 input-actions"]),
|
|
@@ -38577,7 +38670,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38577
38670
|
title: t("Add review note"),
|
|
38578
38671
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38579
38672
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38580
|
-
className: formatClassname(["review-btn review-error-btn",
|
|
38673
|
+
className: formatClassname(["review-btn review-error-btn", lastReview?.reviewError && "primary"]),
|
|
38581
38674
|
type: "link",
|
|
38582
38675
|
onClick: onClickReviewError,
|
|
38583
38676
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
@@ -38593,7 +38686,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38593
38686
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38594
38687
|
type: "link",
|
|
38595
38688
|
onClick: onClickReviewSuccess,
|
|
38596
|
-
className: formatClassname(["review-btn review-success-btn",
|
|
38689
|
+
className: formatClassname(["review-btn review-success-btn", lastReview?.reviewSuccess && "primary"]),
|
|
38597
38690
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
38598
38691
|
name: "CheckSquare",
|
|
38599
38692
|
width: 16,
|
|
@@ -38630,7 +38723,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38630
38723
|
}
|
|
38631
38724
|
});
|
|
38632
38725
|
},
|
|
38633
|
-
disabled: !
|
|
38726
|
+
disabled: !input.meta?.notApplicable,
|
|
38634
38727
|
children: /*#__PURE__*/jsxRuntime.jsx(CustomIcon, {
|
|
38635
38728
|
name: "NotApplicable",
|
|
38636
38729
|
width: 16,
|
|
@@ -38644,7 +38737,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38644
38737
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38645
38738
|
className: formatClassname(["default p-0", inputMeta.notAvailable && "primary"]),
|
|
38646
38739
|
type: "link",
|
|
38647
|
-
disabled: !
|
|
38740
|
+
disabled: !input.meta?.notAvailable,
|
|
38648
38741
|
onClick: () => {
|
|
38649
38742
|
const value = getDefaultInputValue(input);
|
|
38650
38743
|
MainForm.setFields([{
|
|
@@ -38676,14 +38769,14 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38676
38769
|
}), !hideComment ? /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
38677
38770
|
title: t("Add comment"),
|
|
38678
38771
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38679
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button,
|
|
38772
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38680
38773
|
type: "link",
|
|
38681
|
-
disabled: !
|
|
38682
|
-
|
|
38683
|
-
|
|
38684
|
-
|
|
38685
|
-
|
|
38686
|
-
|
|
38774
|
+
disabled: !input.meta?.comment,
|
|
38775
|
+
...(!isShown ? {
|
|
38776
|
+
className: "default p-0"
|
|
38777
|
+
} : {
|
|
38778
|
+
className: "p-0 primary"
|
|
38779
|
+
}),
|
|
38687
38780
|
onClick: () => {
|
|
38688
38781
|
if (inputMeta.comment !== undefined && inputMeta.comment !== null) {
|
|
38689
38782
|
return;
|
|
@@ -38702,7 +38795,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38702
38795
|
width: 16,
|
|
38703
38796
|
height: 16
|
|
38704
38797
|
})
|
|
38705
|
-
})
|
|
38798
|
+
})
|
|
38706
38799
|
})
|
|
38707
38800
|
}) : /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
38708
38801
|
title: t("Project Readiness"),
|
|
@@ -38721,34 +38814,36 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38721
38814
|
}) : null]
|
|
38722
38815
|
}) : null
|
|
38723
38816
|
}),
|
|
38724
|
-
initialValue: inputMeta
|
|
38725
|
-
|
|
38726
|
-
|
|
38727
|
-
|
|
38728
|
-
|
|
38729
|
-
|
|
38730
|
-
|
|
38731
|
-
|
|
38732
|
-
|
|
38733
|
-
|
|
38734
|
-
|
|
38735
|
-
|
|
38736
|
-
|
|
38737
|
-
|
|
38738
|
-
if (f.response) {
|
|
38739
|
-
return f.response;
|
|
38817
|
+
initialValue: inputMeta?.defaultValue,
|
|
38818
|
+
...(inputOnBlur.includes(input.type) ? {
|
|
38819
|
+
trigger: "onBlur"
|
|
38820
|
+
} : {}),
|
|
38821
|
+
...(["total100", "group"].includes(input.type) ? {} : {
|
|
38822
|
+
name: inputId,
|
|
38823
|
+
fieldKey: inputId,
|
|
38824
|
+
initialValue: inputData.value
|
|
38825
|
+
}),
|
|
38826
|
+
...(["upload"].includes(input.type) ? {
|
|
38827
|
+
valuePropName: "fileList",
|
|
38828
|
+
getValueFromEvent: e => {
|
|
38829
|
+
if (Array.isArray(e)) {
|
|
38830
|
+
return e;
|
|
38740
38831
|
}
|
|
38741
|
-
return f
|
|
38742
|
-
|
|
38743
|
-
|
|
38744
|
-
|
|
38745
|
-
|
|
38832
|
+
return e && e.fileList && e.fileList.map(f => {
|
|
38833
|
+
if (f.response) {
|
|
38834
|
+
return f.response;
|
|
38835
|
+
}
|
|
38836
|
+
return f;
|
|
38837
|
+
});
|
|
38838
|
+
}
|
|
38839
|
+
} : {}),
|
|
38840
|
+
className: formatClassname([`i-${input.type} flex-1`, input.comment && "with-comment", maxRule && "with-max-rule"]),
|
|
38746
38841
|
"data-id": inputData.name,
|
|
38747
38842
|
rules: rules,
|
|
38748
38843
|
required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false,
|
|
38749
38844
|
labelCol: 12,
|
|
38750
38845
|
label: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38751
|
-
className: formatClassname(["flex",
|
|
38846
|
+
className: formatClassname(["flex", input?.meta?.code && "mr-10"]),
|
|
38752
38847
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38753
38848
|
className: "mr-1",
|
|
38754
38849
|
children: getInputLabel$1(input, values)
|
|
@@ -38761,7 +38856,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38761
38856
|
config: input,
|
|
38762
38857
|
t: t,
|
|
38763
38858
|
ajaxForms: ajaxForms,
|
|
38764
|
-
linkingData:
|
|
38859
|
+
linkingData: values?.linking || values?.parent?.linking,
|
|
38765
38860
|
changeAjaxForms: changeAjaxForms,
|
|
38766
38861
|
getApiBaseUrl: getApiBaseUrl,
|
|
38767
38862
|
getAppHeader: getAppHeader,
|
|
@@ -38769,11 +38864,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38769
38864
|
getToken: getToken,
|
|
38770
38865
|
app: app,
|
|
38771
38866
|
valueOnlyString: true
|
|
38772
|
-
}) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type](
|
|
38867
|
+
}) : inputTypeComponent$1[input.type] ? inputTypeComponent$1[input.type]({
|
|
38868
|
+
...inputData,
|
|
38773
38869
|
maxWidth,
|
|
38774
38870
|
staticWidth,
|
|
38775
38871
|
fullWidth
|
|
38776
|
-
}
|
|
38872
|
+
}, {
|
|
38777
38873
|
form: MainForm,
|
|
38778
38874
|
forms: options,
|
|
38779
38875
|
allForms: plainForms,
|
|
@@ -38794,10 +38890,10 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38794
38890
|
staticWidth,
|
|
38795
38891
|
fullWidth
|
|
38796
38892
|
}) : console.log(input)
|
|
38797
|
-
})
|
|
38893
|
+
}), input.meta?.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38798
38894
|
className: "code",
|
|
38799
38895
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
38800
|
-
children:
|
|
38896
|
+
children: input.meta?.code
|
|
38801
38897
|
})
|
|
38802
38898
|
}) : null]
|
|
38803
38899
|
}), maxRule ? ["imageUpload", "upload", "videoUpload"].includes(input.type) ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -38817,10 +38913,10 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38817
38913
|
className: "max-char-span",
|
|
38818
38914
|
children: t("max-char", {
|
|
38819
38915
|
chars: maxRule,
|
|
38820
|
-
filled:
|
|
38916
|
+
filled: inputData?.value?.length || 0
|
|
38821
38917
|
})
|
|
38822
38918
|
})
|
|
38823
|
-
}) : null,
|
|
38919
|
+
}) : null, input.meta?.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
38824
38920
|
className: "input-content",
|
|
38825
38921
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38826
38922
|
className: "comment-textarea",
|
|
@@ -38846,7 +38942,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38846
38942
|
},
|
|
38847
38943
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
38848
38944
|
type: "link",
|
|
38849
|
-
disabled: !
|
|
38945
|
+
disabled: !input.meta?.comment,
|
|
38850
38946
|
className: "p-0",
|
|
38851
38947
|
children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
|
|
38852
38948
|
width: 16,
|
|
@@ -38855,11 +38951,12 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38855
38951
|
})
|
|
38856
38952
|
})]
|
|
38857
38953
|
}),
|
|
38858
|
-
children: inputTypeComponent$1.comment(
|
|
38954
|
+
children: inputTypeComponent$1.comment({
|
|
38955
|
+
...inputData,
|
|
38859
38956
|
maxWidth,
|
|
38860
38957
|
staticWidth,
|
|
38861
38958
|
fullWidth
|
|
38862
|
-
}
|
|
38959
|
+
}, {
|
|
38863
38960
|
form: MainForm,
|
|
38864
38961
|
forms: options,
|
|
38865
38962
|
setFormValues: setValues,
|
|
@@ -38884,16 +38981,16 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38884
38981
|
className: "max-char-span",
|
|
38885
38982
|
children: t("max-char", {
|
|
38886
38983
|
chars: MAX_COMMENTS_LENGTH,
|
|
38887
|
-
filled:
|
|
38984
|
+
filled: inputData?.commentValue?.length || 0
|
|
38888
38985
|
})
|
|
38889
38986
|
})]
|
|
38890
|
-
}) : null, lastReview
|
|
38987
|
+
}) : null, lastReview?.reviewError ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38891
38988
|
className: "input-content",
|
|
38892
38989
|
children: isReview ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
38893
38990
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
38894
38991
|
className: "comment-textarea",
|
|
38895
|
-
initialValue:
|
|
38896
|
-
name:
|
|
38992
|
+
initialValue: lastReview?.comment || "",
|
|
38993
|
+
name: `${inputId}-reviewErrorComment`,
|
|
38897
38994
|
label: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38898
38995
|
className: "flex w-100",
|
|
38899
38996
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -38901,28 +38998,31 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38901
38998
|
children: t("Review note")
|
|
38902
38999
|
})
|
|
38903
39000
|
}),
|
|
38904
|
-
children: inputTypeComponent$1.comment(
|
|
39001
|
+
children: inputTypeComponent$1.comment({
|
|
39002
|
+
...inputData,
|
|
38905
39003
|
maxWidth,
|
|
38906
39004
|
staticWidth,
|
|
38907
39005
|
fullWidth
|
|
38908
|
-
}
|
|
39006
|
+
}, {
|
|
38909
39007
|
form: MainForm,
|
|
38910
39008
|
forms: options,
|
|
38911
|
-
value:
|
|
39009
|
+
value: lastReview?.comment || "",
|
|
38912
39010
|
onChange: val => {
|
|
38913
39011
|
changeInputMeta({
|
|
38914
39012
|
key: inputId,
|
|
38915
39013
|
type: input.type,
|
|
38916
|
-
value:
|
|
38917
|
-
|
|
39014
|
+
value: {
|
|
39015
|
+
...inputMeta,
|
|
39016
|
+
reviews: (inputMeta?.reviews || []).map(v => {
|
|
38918
39017
|
if (v.createdAt === lastReview.createdAt) {
|
|
38919
|
-
return
|
|
39018
|
+
return {
|
|
39019
|
+
...v,
|
|
38920
39020
|
comment: val
|
|
38921
|
-
}
|
|
39021
|
+
};
|
|
38922
39022
|
}
|
|
38923
39023
|
return v;
|
|
38924
39024
|
})
|
|
38925
|
-
}
|
|
39025
|
+
}
|
|
38926
39026
|
});
|
|
38927
39027
|
},
|
|
38928
39028
|
t,
|
|
@@ -38936,7 +39036,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38936
39036
|
className: "max-char-span",
|
|
38937
39037
|
children: t("max-char", {
|
|
38938
39038
|
chars: MAX_COMMENTS_LENGTH,
|
|
38939
|
-
filled:
|
|
39039
|
+
filled: lastReview.comment?.length || 0
|
|
38940
39040
|
})
|
|
38941
39041
|
})]
|
|
38942
39042
|
}) : /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -38957,7 +39057,7 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38957
39057
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
38958
39058
|
className: "flex flex-column justify-center mr-1",
|
|
38959
39059
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
38960
|
-
children:
|
|
39060
|
+
children: lastReview?.reviewer?.firstName + " " + lastReview?.reviewer?.lastName + " - " + moment__default["default"](lastReview.createdAt).format("DD MMM YYYY")
|
|
38961
39061
|
})
|
|
38962
39062
|
})]
|
|
38963
39063
|
})]
|
|
@@ -38968,14 +39068,13 @@ const GetFormItem$1 = _ref73 => {
|
|
|
38968
39068
|
return null;
|
|
38969
39069
|
}
|
|
38970
39070
|
};
|
|
38971
|
-
const editErrorHandler =
|
|
38972
|
-
|
|
38973
|
-
|
|
38974
|
-
|
|
38975
|
-
} = _ref76;
|
|
39071
|
+
const editErrorHandler = ({
|
|
39072
|
+
errorFields,
|
|
39073
|
+
t = s => s
|
|
39074
|
+
}) => {
|
|
38976
39075
|
if (Array.isArray(errorFields) && errorFields.length) {
|
|
38977
39076
|
const name = errorFields[0].name.join(".");
|
|
38978
|
-
const element = document.querySelector(
|
|
39077
|
+
const element = document.querySelector(`[data-id="${name}"]`);
|
|
38979
39078
|
if (element) {
|
|
38980
39079
|
element.scrollIntoView();
|
|
38981
39080
|
antd.message.error(t("errors::please-correct-invalid-inputs"));
|
|
@@ -52945,9 +53044,8 @@ class AdminService extends BaseService {
|
|
|
52945
53044
|
subject,
|
|
52946
53045
|
id
|
|
52947
53046
|
}) {
|
|
52948
|
-
const type = subject === 'location' ? 'location' : 'stakeholder';
|
|
52949
53047
|
return this.apiDelete({
|
|
52950
|
-
url: `/management/subject/${
|
|
53048
|
+
url: `/management/subject/${subject}/${id}`
|
|
52951
53049
|
});
|
|
52952
53050
|
}
|
|
52953
53051
|
async getUserGrowth(activeFilter) {
|
|
@@ -54053,14 +54151,23 @@ const useGetParams = ({
|
|
|
54053
54151
|
location
|
|
54054
54152
|
});
|
|
54055
54153
|
const cleanSearchParams = Object.fromEntries(Object.entries(searchParams).filter(([_, value]) => value != null && value !== ''));
|
|
54056
|
-
const hasPagination = paginationQuery
|
|
54154
|
+
const hasPagination = paginationQuery?.skip != null || paginationQuery?.take != null;
|
|
54057
54155
|
const {
|
|
54058
54156
|
activeTab,
|
|
54059
54157
|
...rest
|
|
54060
54158
|
} = otherParams;
|
|
54159
|
+
console.log({
|
|
54160
|
+
hasPagination
|
|
54161
|
+
});
|
|
54061
54162
|
const params = React.useMemo(() => {
|
|
54062
54163
|
if (!hasPagination) {
|
|
54063
|
-
return
|
|
54164
|
+
return {
|
|
54165
|
+
pagination: {
|
|
54166
|
+
skip: 1,
|
|
54167
|
+
take: 20
|
|
54168
|
+
},
|
|
54169
|
+
tab: 'active'
|
|
54170
|
+
};
|
|
54064
54171
|
}
|
|
54065
54172
|
return {
|
|
54066
54173
|
pagination: paginationQuery,
|
|
@@ -54070,7 +54177,7 @@ const useGetParams = ({
|
|
|
54070
54177
|
}),
|
|
54071
54178
|
tab: activeTab
|
|
54072
54179
|
};
|
|
54073
|
-
}, [location.search
|
|
54180
|
+
}, [location.search]);
|
|
54074
54181
|
return params;
|
|
54075
54182
|
};
|
|
54076
54183
|
function useSubjectsAdminTable({
|
|
@@ -54089,6 +54196,9 @@ function useSubjectsAdminTable({
|
|
|
54089
54196
|
const [initFetchDone, setInitFetchDone] = React.useState(false);
|
|
54090
54197
|
const [loading, setLoading] = React.useState(false);
|
|
54091
54198
|
const [data, setData] = React.useState([]);
|
|
54199
|
+
const params = useGetParams({
|
|
54200
|
+
location
|
|
54201
|
+
});
|
|
54092
54202
|
const filter = useFilters({
|
|
54093
54203
|
goTo,
|
|
54094
54204
|
location,
|
|
@@ -54109,7 +54219,9 @@ function useSubjectsAdminTable({
|
|
|
54109
54219
|
setLoading(true);
|
|
54110
54220
|
const {
|
|
54111
54221
|
data
|
|
54112
|
-
} = await getData(
|
|
54222
|
+
} = await getData({
|
|
54223
|
+
params
|
|
54224
|
+
});
|
|
54113
54225
|
setData(data.data || data || []);
|
|
54114
54226
|
filter.setPagination(prev => ({
|
|
54115
54227
|
...prev,
|
|
@@ -54122,10 +54234,10 @@ function useSubjectsAdminTable({
|
|
|
54122
54234
|
} catch (err) {
|
|
54123
54235
|
console.log(err);
|
|
54124
54236
|
}
|
|
54125
|
-
}, [
|
|
54237
|
+
}, [params]);
|
|
54126
54238
|
React.useEffect(() => {
|
|
54127
54239
|
fetchData();
|
|
54128
|
-
}, [
|
|
54240
|
+
}, [params, refetchTrigger]);
|
|
54129
54241
|
return {
|
|
54130
54242
|
filter,
|
|
54131
54243
|
activeTab,
|
|
@@ -55734,14 +55846,6 @@ function LocationTable(_ref) {
|
|
|
55734
55846
|
token
|
|
55735
55847
|
} = useToken$4();
|
|
55736
55848
|
const [isCombineModalOpen, setIsModalOpen] = React.useState(false);
|
|
55737
|
-
const transformedParams = useGetParams({
|
|
55738
|
-
location
|
|
55739
|
-
});
|
|
55740
|
-
const getDataWithStringPagination = async () => {
|
|
55741
|
-
return getData({
|
|
55742
|
-
params: transformedParams
|
|
55743
|
-
});
|
|
55744
|
-
};
|
|
55745
55849
|
const {
|
|
55746
55850
|
filter,
|
|
55747
55851
|
activeTab,
|
|
@@ -55761,7 +55865,7 @@ function LocationTable(_ref) {
|
|
|
55761
55865
|
defaultPageSize,
|
|
55762
55866
|
filtersConfig: filtersConfig$b,
|
|
55763
55867
|
getRedirectLink,
|
|
55764
|
-
getData:
|
|
55868
|
+
getData: getData,
|
|
55765
55869
|
refetchTrigger
|
|
55766
55870
|
});
|
|
55767
55871
|
const selectOptions = React.useMemo(() => {
|
|
@@ -56419,14 +56523,6 @@ function SubjectsTable(_ref) {
|
|
|
56419
56523
|
token
|
|
56420
56524
|
} = useToken$2();
|
|
56421
56525
|
const [isCombineModalOpen, setIsModalOpen] = React.useState(false);
|
|
56422
|
-
const transformedParams = useGetParams({
|
|
56423
|
-
location
|
|
56424
|
-
});
|
|
56425
|
-
const getDataWithStringPagination = async () => {
|
|
56426
|
-
return getData({
|
|
56427
|
-
params: transformedParams
|
|
56428
|
-
});
|
|
56429
|
-
};
|
|
56430
56526
|
const {
|
|
56431
56527
|
filter,
|
|
56432
56528
|
activeTab,
|
|
@@ -56446,7 +56542,7 @@ function SubjectsTable(_ref) {
|
|
|
56446
56542
|
defaultPageSize,
|
|
56447
56543
|
filtersConfig: filtersConfig$a,
|
|
56448
56544
|
getRedirectLink,
|
|
56449
|
-
getData:
|
|
56545
|
+
getData: getData,
|
|
56450
56546
|
refetchTrigger
|
|
56451
56547
|
});
|
|
56452
56548
|
const selectOptions = React.useMemo(() => {
|
|
@@ -58710,14 +58806,6 @@ function DocumentsTable({
|
|
|
58710
58806
|
const {
|
|
58711
58807
|
token
|
|
58712
58808
|
} = useToken$1();
|
|
58713
|
-
const transformedParams = useGetParams({
|
|
58714
|
-
location
|
|
58715
|
-
});
|
|
58716
|
-
const getDataWithStringPagination = async () => {
|
|
58717
|
-
return getData({
|
|
58718
|
-
params: transformedParams
|
|
58719
|
-
});
|
|
58720
|
-
};
|
|
58721
58809
|
const {
|
|
58722
58810
|
filter,
|
|
58723
58811
|
activeTab,
|
|
@@ -58737,16 +58825,12 @@ function DocumentsTable({
|
|
|
58737
58825
|
defaultPageSize,
|
|
58738
58826
|
filtersConfig: filtersConfig$8,
|
|
58739
58827
|
getRedirectLink,
|
|
58740
|
-
getData:
|
|
58828
|
+
getData: getData,
|
|
58741
58829
|
refetchTrigger
|
|
58742
58830
|
});
|
|
58743
58831
|
const selectOptions = React.useMemo(() => {
|
|
58744
|
-
return
|
|
58745
|
-
|
|
58746
|
-
country: config.options?.countries,
|
|
58747
|
-
sources: []
|
|
58748
|
-
};
|
|
58749
|
-
}, [config.options]);
|
|
58832
|
+
return options;
|
|
58833
|
+
}, [options]);
|
|
58750
58834
|
const columns = React.useMemo(() => {
|
|
58751
58835
|
return getColumns$1({
|
|
58752
58836
|
t,
|
|
@@ -58996,7 +59080,7 @@ const getColumns = ({
|
|
|
58996
59080
|
value: item.value,
|
|
58997
59081
|
label: typeof item.label === 'object' ? Object.values(item.label)[1] : item.label
|
|
58998
59082
|
}));
|
|
58999
|
-
const type = findOptions(value, options?.eventsType || []) || "-";
|
|
59083
|
+
const type = (value === 'other' ? t(value) : findOptions(value, options?.eventsType || [])) || "-";
|
|
59000
59084
|
return /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
59001
59085
|
title: type,
|
|
59002
59086
|
children: type
|
|
@@ -59086,14 +59170,6 @@ function EventsTable({
|
|
|
59086
59170
|
const {
|
|
59087
59171
|
token
|
|
59088
59172
|
} = useToken();
|
|
59089
|
-
const transformedParams = useGetParams({
|
|
59090
|
-
location
|
|
59091
|
-
});
|
|
59092
|
-
const getDataWithStringPagination = async () => {
|
|
59093
|
-
return getData({
|
|
59094
|
-
params: transformedParams
|
|
59095
|
-
});
|
|
59096
|
-
};
|
|
59097
59173
|
const {
|
|
59098
59174
|
filter,
|
|
59099
59175
|
activeTab,
|
|
@@ -59113,7 +59189,7 @@ function EventsTable({
|
|
|
59113
59189
|
defaultPageSize,
|
|
59114
59190
|
filtersConfig: filtersConfig$7,
|
|
59115
59191
|
getRedirectLink,
|
|
59116
|
-
getData:
|
|
59192
|
+
getData: getData,
|
|
59117
59193
|
refetchTrigger
|
|
59118
59194
|
});
|
|
59119
59195
|
const selectOptions = React.useMemo(() => {
|