datastake-daf 0.6.841 → 0.6.843
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/build/favicon.ico +0 -0
- package/build/logo192.png +0 -0
- package/build/logo512.png +0 -0
- package/build/manifest.json +25 -0
- package/build/robots.txt +3 -0
- package/dist/components/index.js +773 -768
- package/dist/hooks/index.js +4 -6
- package/dist/layouts/index.js +6 -0
- package/dist/pages/index.js +187 -133
- package/package.json +1 -1
- package/src/@daf/core/components/DynamicForm/hook.js +2 -2
- package/src/@daf/core/components/DynamicForm/index.jsx +1 -1
- package/src/@daf/core/components/Filters/selectFilters/index.jsx +7 -1
- package/src/@daf/core/components/Graphs/TradeRelationship/index.jsx +1 -27
- package/src/@daf/core/components/Graphs/components/BaseGraph.jsx +22 -18
- package/src/@daf/core/components/Select/MultiSelect/style.js +1 -1
- package/src/@daf/core/components/ViewForm/components/DataLink/flat.js +7 -3
- package/src/@daf/core/components/ViewForm/components/DataLink/index.js +6 -2
- package/src/@daf/core/components/ViewForm/components/input.js +7 -7
- package/src/@daf/hooks/useWidgetFetch.js +26 -35
- package/src/@daf/pages/Dashboards/ConflictManagement/components/RisksWidget/components/IncidentsTime/index.js +1 -0
- package/src/@daf/pages/Dashboards/SupplyChain/components/ChartsContainer/components/Locations/index.js +20 -19
- package/src/@daf/pages/Dashboards/SupplyChain/components/ChartsContainer/index.js +5 -2
- package/src/@daf/pages/Events/Activities/columns.js +7 -3
- package/src/@daf/pages/Events/Incidents/columns.js +7 -3
- package/src/@daf/pages/Summary/Operator/components/KeyInformation/config.js +0 -1
- package/src/@daf/pages/Summary/Operator/components/TradeRelationships/helper.js +7 -5
- package/src/@daf/pages/Summary/Operator/components/TradeRelationships/hook.js +29 -14
- package/src/@daf/pages/Summary/Operator/components/TradeRelationships/index.js +69 -20
- package/src/@daf/pages/Summary/Operator/index.jsx +1 -0
- package/src/@daf/pages/View/index.jsx +1 -1
- package/src/helpers/Forms.js +7 -5
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$F = ["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$F);
|
|
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$E = ["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$E);
|
|
5505
5505
|
const _meta = isObjectEmpty(meta) ? undefined : meta;
|
|
5506
5506
|
return _objectSpread2(_objectSpread2({}, rest), {}, {
|
|
5507
5507
|
meta: _meta
|
|
@@ -5593,7 +5593,8 @@ const getValueOnSelectFromDefaultKeys = (val, options, uniqueDefaultKeys) => {
|
|
|
5593
5593
|
* @param {object} obj - Object to traverse
|
|
5594
5594
|
* @returns {any} - Resolved value or undefined
|
|
5595
5595
|
*/
|
|
5596
|
-
const resolveValuePath = (path, obj) => {
|
|
5596
|
+
const resolveValuePath = (path, obj, form) => {
|
|
5597
|
+
var _Object$keys;
|
|
5597
5598
|
if (!path || !obj) return undefined;
|
|
5598
5599
|
|
|
5599
5600
|
// Split by / and traverse the object
|
|
@@ -5612,7 +5613,8 @@ const resolveValuePath = (path, obj) => {
|
|
|
5612
5613
|
current = current[part];
|
|
5613
5614
|
}
|
|
5614
5615
|
}
|
|
5615
|
-
|
|
5616
|
+
const value = ((_Object$keys = Object.keys(form || {})) === null || _Object$keys === void 0 ? void 0 : _Object$keys.length) > 0 ? findOptions(current, (form === null || form === void 0 ? void 0 : form.options) || []) : current;
|
|
5617
|
+
return value;
|
|
5616
5618
|
};
|
|
5617
5619
|
|
|
5618
5620
|
/**
|
|
@@ -5684,6 +5686,7 @@ const getCombinedPrefilledValues = form => {
|
|
|
5684
5686
|
const resolveCombinedPrefilledValue = function (template) {
|
|
5685
5687
|
let values = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
5686
5688
|
let parentValues = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
5689
|
+
let form = arguments.length > 3 ? arguments[3] : undefined;
|
|
5687
5690
|
if (!template || typeof template !== 'string') return '';
|
|
5688
5691
|
|
|
5689
5692
|
// Regular expression to match placeholders like {path} or {path^subpath}
|
|
@@ -5696,7 +5699,8 @@ const resolveCombinedPrefilledValue = function (template) {
|
|
|
5696
5699
|
if (nonParentPaths.length > 0) {
|
|
5697
5700
|
// Check if at least one non-parent value has actual data
|
|
5698
5701
|
hasNonParentValue = nonParentPaths.some(path => {
|
|
5699
|
-
|
|
5702
|
+
var _form$inputs;
|
|
5703
|
+
const value = resolveValuePath(path, values, form === null || form === void 0 || (_form$inputs = form.inputs) === null || _form$inputs === void 0 ? void 0 : _form$inputs[path]);
|
|
5700
5704
|
return value !== undefined && value !== null && value !== '';
|
|
5701
5705
|
});
|
|
5702
5706
|
|
|
@@ -5715,8 +5719,9 @@ const resolveCombinedPrefilledValue = function (template) {
|
|
|
5715
5719
|
const resolved = resolveValuePath(actualPath, parentValues);
|
|
5716
5720
|
return formatValue(resolved);
|
|
5717
5721
|
} else {
|
|
5722
|
+
var _form$inputs2;
|
|
5718
5723
|
// Regular path in current values
|
|
5719
|
-
const resolved = resolveValuePath(path, values);
|
|
5724
|
+
const resolved = resolveValuePath(path, values, form === null || form === void 0 || (_form$inputs2 = form.inputs) === null || _form$inputs2 === void 0 ? void 0 : _form$inputs2[path]);
|
|
5720
5725
|
return formatValue(resolved);
|
|
5721
5726
|
}
|
|
5722
5727
|
});
|
|
@@ -5868,6 +5873,12 @@ const SelectFilters = _ref => {
|
|
|
5868
5873
|
} = _ref;
|
|
5869
5874
|
const [filters, setFilters] = React.useState(selectedFilters || {});
|
|
5870
5875
|
const [initFilters, setInitFilters] = React.useState(selectedFilters || {});
|
|
5876
|
+
|
|
5877
|
+
// Sync internal state with selectedFilters prop when it changes
|
|
5878
|
+
React.useEffect(() => {
|
|
5879
|
+
setFilters(selectedFilters || {});
|
|
5880
|
+
setInitFilters(selectedFilters || {});
|
|
5881
|
+
}, [selectedFilters]);
|
|
5871
5882
|
const getClearLabel = () => {
|
|
5872
5883
|
switch (type) {
|
|
5873
5884
|
case 'small':
|
|
@@ -6033,7 +6044,7 @@ SelectFilters.propTypes = {
|
|
|
6033
6044
|
apiUrl: PropTypes__default["default"].string
|
|
6034
6045
|
};
|
|
6035
6046
|
|
|
6036
|
-
const _excluded$
|
|
6047
|
+
const _excluded$D = ["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
6048
|
function DAFTable(_ref) {
|
|
6038
6049
|
let {
|
|
6039
6050
|
columns = [],
|
|
@@ -6064,7 +6075,7 @@ function DAFTable(_ref) {
|
|
|
6064
6075
|
app,
|
|
6065
6076
|
doEmptyRows
|
|
6066
6077
|
} = _ref,
|
|
6067
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
6078
|
+
rest = _objectWithoutProperties(_ref, _excluded$D);
|
|
6068
6079
|
const source = React.useMemo(() => {
|
|
6069
6080
|
if (data && Array.isArray(data)) {
|
|
6070
6081
|
return data;
|
|
@@ -6889,7 +6900,7 @@ function ComponentWithFocus(_ref) {
|
|
|
6889
6900
|
}
|
|
6890
6901
|
|
|
6891
6902
|
var _templateObject$h;
|
|
6892
|
-
const _excluded$
|
|
6903
|
+
const _excluded$C = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
|
|
6893
6904
|
function StickyTable(_ref) {
|
|
6894
6905
|
let {
|
|
6895
6906
|
size = "small",
|
|
@@ -6900,7 +6911,7 @@ function StickyTable(_ref) {
|
|
|
6900
6911
|
pagination = false,
|
|
6901
6912
|
doEmptyRows = true
|
|
6902
6913
|
} = _ref,
|
|
6903
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
6914
|
+
props = _objectWithoutProperties(_ref, _excluded$C);
|
|
6904
6915
|
const data = React__default["default"].useMemo(() => {
|
|
6905
6916
|
if (!doEmptyRows) {
|
|
6906
6917
|
return dataSource;
|
|
@@ -7428,7 +7439,7 @@ const BTN_SIZE = {
|
|
|
7428
7439
|
LG: 'large'
|
|
7429
7440
|
};
|
|
7430
7441
|
|
|
7431
|
-
const _excluded$
|
|
7442
|
+
const _excluded$B = ["content", "size", "type", "icon", "onClick", "disabled", "loading", "title", "style", "className"];
|
|
7432
7443
|
function DafButton(_ref) {
|
|
7433
7444
|
let {
|
|
7434
7445
|
content = '',
|
|
@@ -7442,7 +7453,7 @@ function DafButton(_ref) {
|
|
|
7442
7453
|
style = {},
|
|
7443
7454
|
className = ''
|
|
7444
7455
|
} = _ref,
|
|
7445
|
-
restProps = _objectWithoutProperties(_ref, _excluded$
|
|
7456
|
+
restProps = _objectWithoutProperties(_ref, _excluded$B);
|
|
7446
7457
|
return /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
|
|
7447
7458
|
icon: icon,
|
|
7448
7459
|
type: type,
|
|
@@ -7561,12 +7572,12 @@ const Style$R = styled__default["default"].div`
|
|
|
7561
7572
|
}
|
|
7562
7573
|
`;
|
|
7563
7574
|
|
|
7564
|
-
const _excluded$
|
|
7575
|
+
const _excluded$A = ["children"];
|
|
7565
7576
|
const BorderedButton = _ref => {
|
|
7566
7577
|
let {
|
|
7567
7578
|
children
|
|
7568
7579
|
} = _ref,
|
|
7569
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
7580
|
+
props = _objectWithoutProperties(_ref, _excluded$A);
|
|
7570
7581
|
return /*#__PURE__*/jsxRuntime.jsx(Style$R, {
|
|
7571
7582
|
className: "d-btn-cont",
|
|
7572
7583
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
@@ -7706,12 +7717,12 @@ Badge.propTypes = {
|
|
|
7706
7717
|
props: PropTypes__default["default"].object
|
|
7707
7718
|
};
|
|
7708
7719
|
|
|
7709
|
-
const _excluded$
|
|
7720
|
+
const _excluded$z = ["icon"];
|
|
7710
7721
|
function GetIcon(_ref) {
|
|
7711
7722
|
let {
|
|
7712
7723
|
icon
|
|
7713
7724
|
} = _ref,
|
|
7714
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
7725
|
+
props = _objectWithoutProperties(_ref, _excluded$z);
|
|
7715
7726
|
let Icon = Icons__namespace.CloseOutlined;
|
|
7716
7727
|
if (Icons__namespace[icon]) {
|
|
7717
7728
|
Icon = Icons__namespace[icon];
|
|
@@ -8034,14 +8045,14 @@ const MultiSelectStyled = styled__default["default"](antd.Select)`
|
|
|
8034
8045
|
&.ant-select-single {
|
|
8035
8046
|
.ant-select-selector {
|
|
8036
8047
|
padding-inline-end: 24px !important;
|
|
8037
|
-
padding:
|
|
8048
|
+
padding: 3px !important;
|
|
8038
8049
|
max-width: 56px !important;
|
|
8039
8050
|
width: 56px !important;
|
|
8040
8051
|
}
|
|
8041
8052
|
}
|
|
8042
8053
|
`;
|
|
8043
8054
|
|
|
8044
|
-
const _excluded$
|
|
8055
|
+
const _excluded$y = ["options", "defaultSelected", "onChange", "textWhenMultiple", "withCount", "oneAlwaysSelected", "canUnselectLast", "isAvatarGroup", "maxAvatarCount", "dropDownWidth", "topAvatarValue", "isSingle", "selectionType"];
|
|
8045
8056
|
const {
|
|
8046
8057
|
useToken: useToken$p
|
|
8047
8058
|
} = antd.theme;
|
|
@@ -8134,7 +8145,7 @@ function Multiselect(_ref) {
|
|
|
8134
8145
|
isSingle = false,
|
|
8135
8146
|
selectionType = SELECTION_TYPES.DEFAULT
|
|
8136
8147
|
} = _ref,
|
|
8137
|
-
restProps = _objectWithoutProperties(_ref, _excluded$
|
|
8148
|
+
restProps = _objectWithoutProperties(_ref, _excluded$y);
|
|
8138
8149
|
const {
|
|
8139
8150
|
token
|
|
8140
8151
|
} = useToken$p();
|
|
@@ -8854,7 +8865,7 @@ DAFHeader.propTypes = {
|
|
|
8854
8865
|
filtersConfig: PropTypes__default["default"].any
|
|
8855
8866
|
};
|
|
8856
8867
|
|
|
8857
|
-
const _excluded$
|
|
8868
|
+
const _excluded$x = ["tabs", "onChange", "value", "className"];
|
|
8858
8869
|
function TabsHeader(_ref) {
|
|
8859
8870
|
let {
|
|
8860
8871
|
tabs = [],
|
|
@@ -8862,7 +8873,7 @@ function TabsHeader(_ref) {
|
|
|
8862
8873
|
value = '',
|
|
8863
8874
|
className = 'mt-2'
|
|
8864
8875
|
} = _ref,
|
|
8865
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
8876
|
+
rest = _objectWithoutProperties(_ref, _excluded$x);
|
|
8866
8877
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
8867
8878
|
className: formatClassname(['daf-tabs-header pl-6 pr-6', className]),
|
|
8868
8879
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Tabs, _objectSpread2({
|
|
@@ -8959,7 +8970,7 @@ DrawerHeader.propTypes = {
|
|
|
8959
8970
|
tabsConfig: PropTypes__default["default"].any
|
|
8960
8971
|
};
|
|
8961
8972
|
|
|
8962
|
-
const _excluded$
|
|
8973
|
+
const _excluded$w = ["label", "onClick", "icon", "type", "tooltip", "disabled", "loading", "style", "className"];
|
|
8963
8974
|
const useFooter = _ref => {
|
|
8964
8975
|
let {
|
|
8965
8976
|
leftContent,
|
|
@@ -8994,7 +9005,7 @@ const useFooter = _ref => {
|
|
|
8994
9005
|
style = {},
|
|
8995
9006
|
className = ""
|
|
8996
9007
|
} = button,
|
|
8997
|
-
restProps = _objectWithoutProperties(button, _excluded$
|
|
9008
|
+
restProps = _objectWithoutProperties(button, _excluded$w);
|
|
8998
9009
|
return /*#__PURE__*/jsxRuntime.jsx(DafButton, _objectSpread2({
|
|
8999
9010
|
content: label,
|
|
9000
9011
|
type: type,
|
|
@@ -11875,7 +11886,7 @@ Widget.propTypes = {
|
|
|
11875
11886
|
};
|
|
11876
11887
|
Widget.displayName = 'Widget';
|
|
11877
11888
|
|
|
11878
|
-
const _excluded$
|
|
11889
|
+
const _excluded$v = ["loading", "title", "image", "description", "imgAlt", "noDescriptionText", "isPdf"];
|
|
11879
11890
|
function ImageWidget(_ref) {
|
|
11880
11891
|
let {
|
|
11881
11892
|
loading = false,
|
|
@@ -11886,7 +11897,7 @@ function ImageWidget(_ref) {
|
|
|
11886
11897
|
noDescriptionText,
|
|
11887
11898
|
isPdf = false
|
|
11888
11899
|
} = _ref,
|
|
11889
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
11900
|
+
props = _objectWithoutProperties(_ref, _excluded$v);
|
|
11890
11901
|
const expandable = isPdf ? false : props.expandable;
|
|
11891
11902
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
11892
11903
|
loading: loading,
|
|
@@ -11946,7 +11957,7 @@ function ImageWidget(_ref) {
|
|
|
11946
11957
|
ImageWidget.displayName = 'ImageWidget';
|
|
11947
11958
|
|
|
11948
11959
|
var _templateObject$e;
|
|
11949
|
-
const _excluded$
|
|
11960
|
+
const _excluded$u = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
|
|
11950
11961
|
function FlowWidget(_ref) {
|
|
11951
11962
|
let {
|
|
11952
11963
|
title,
|
|
@@ -11958,7 +11969,7 @@ function FlowWidget(_ref) {
|
|
|
11958
11969
|
className,
|
|
11959
11970
|
direction = "horizontal"
|
|
11960
11971
|
} = _ref,
|
|
11961
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
11972
|
+
rest = _objectWithoutProperties(_ref, _excluded$u);
|
|
11962
11973
|
const [activeTab, setActiveTab] = React.useState();
|
|
11963
11974
|
React.useEffect(() => {
|
|
11964
11975
|
if (defaultActiveTab) {
|
|
@@ -15689,7 +15700,7 @@ Map$3.propTypes = {
|
|
|
15689
15700
|
link: PropTypes__default["default"].any
|
|
15690
15701
|
};
|
|
15691
15702
|
|
|
15692
|
-
const _excluded$
|
|
15703
|
+
const _excluded$t = ["isExpanded", "shouldRenderMap", "renderKey", "title", "loading", "t", "user", "data", "height", "widgetConfig"];
|
|
15693
15704
|
function InExpandableWidgetMap(_ref) {
|
|
15694
15705
|
let {
|
|
15695
15706
|
isExpanded,
|
|
@@ -15703,7 +15714,7 @@ function InExpandableWidgetMap(_ref) {
|
|
|
15703
15714
|
height,
|
|
15704
15715
|
widgetConfig
|
|
15705
15716
|
} = _ref,
|
|
15706
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
15717
|
+
rest = _objectWithoutProperties(_ref, _excluded$t);
|
|
15707
15718
|
const [mapKey, setMapKey] = React.useState(0);
|
|
15708
15719
|
const [isMapReady, setIsMapReady] = React.useState(false);
|
|
15709
15720
|
React.useEffect(() => {
|
|
@@ -17903,14 +17914,14 @@ const MapConfig = ({
|
|
|
17903
17914
|
});
|
|
17904
17915
|
};
|
|
17905
17916
|
|
|
17906
|
-
const _excluded$
|
|
17917
|
+
const _excluded$s = ["config", "title", "loading"];
|
|
17907
17918
|
const Details = _ref => {
|
|
17908
17919
|
let {
|
|
17909
17920
|
config = [],
|
|
17910
17921
|
title,
|
|
17911
17922
|
loading = false
|
|
17912
17923
|
} = _ref,
|
|
17913
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17924
|
+
rest = _objectWithoutProperties(_ref, _excluded$s);
|
|
17914
17925
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
17915
17926
|
className: "with-border-header h-w-btn-header card",
|
|
17916
17927
|
loading: loading,
|
|
@@ -17926,14 +17937,14 @@ const Details = _ref => {
|
|
|
17926
17937
|
}));
|
|
17927
17938
|
};
|
|
17928
17939
|
|
|
17929
|
-
const _excluded$
|
|
17940
|
+
const _excluded$r = ["config", "title", "loading"];
|
|
17930
17941
|
const KeyIndicatorsDetails = _ref => {
|
|
17931
17942
|
let {
|
|
17932
17943
|
config,
|
|
17933
17944
|
title,
|
|
17934
17945
|
loading = false
|
|
17935
17946
|
} = _ref,
|
|
17936
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17947
|
+
rest = _objectWithoutProperties(_ref, _excluded$r);
|
|
17937
17948
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
17938
17949
|
className: "with-border-header h-w-btn-header",
|
|
17939
17950
|
title: title,
|
|
@@ -17963,7 +17974,7 @@ const Style$G = styled__default["default"].div`
|
|
|
17963
17974
|
}
|
|
17964
17975
|
`;
|
|
17965
17976
|
|
|
17966
|
-
const _excluded$
|
|
17977
|
+
const _excluded$q = ["children", "config", "detailsTitle", "firstColumnWidth"];
|
|
17967
17978
|
const DetailsSection = _ref => {
|
|
17968
17979
|
let {
|
|
17969
17980
|
children,
|
|
@@ -17971,7 +17982,7 @@ const DetailsSection = _ref => {
|
|
|
17971
17982
|
detailsTitle,
|
|
17972
17983
|
firstColumnWidth = "250px"
|
|
17973
17984
|
} = _ref,
|
|
17974
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
17985
|
+
rest = _objectWithoutProperties(_ref, _excluded$q);
|
|
17975
17986
|
return /*#__PURE__*/jsxRuntime.jsx(Style$G, {
|
|
17976
17987
|
firstColumnWidth: firstColumnWidth,
|
|
17977
17988
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -18147,14 +18158,14 @@ const getGoalConfig = () => {
|
|
|
18147
18158
|
};
|
|
18148
18159
|
|
|
18149
18160
|
var _templateObject$c;
|
|
18150
|
-
const _excluded$
|
|
18161
|
+
const _excluded$p = ["title", "activeSdgGoals", "t"];
|
|
18151
18162
|
function SDGWidget(_ref) {
|
|
18152
18163
|
let {
|
|
18153
18164
|
title = "Sustainable Development Goals",
|
|
18154
18165
|
activeSdgGoals = [],
|
|
18155
18166
|
t = key => key
|
|
18156
18167
|
} = _ref,
|
|
18157
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18168
|
+
props = _objectWithoutProperties(_ref, _excluded$p);
|
|
18158
18169
|
const sdgConfig = getGoalConfig();
|
|
18159
18170
|
return /*#__PURE__*/jsxRuntime.jsx(Widget, _objectSpread2(_objectSpread2({
|
|
18160
18171
|
title: title,
|
|
@@ -18452,7 +18463,7 @@ function SdgList({
|
|
|
18452
18463
|
});
|
|
18453
18464
|
}
|
|
18454
18465
|
|
|
18455
|
-
const _excluded$
|
|
18466
|
+
const _excluded$o = ["title", "description", "onLinkClick", "image", "linkIcon", "sdgList", "items", "onCardClick", "hideSDGList", "t"];
|
|
18456
18467
|
const {
|
|
18457
18468
|
Meta
|
|
18458
18469
|
} = antd.Card;
|
|
@@ -18472,7 +18483,7 @@ function ProjectWidget(_ref) {
|
|
|
18472
18483
|
hideSDGList = false,
|
|
18473
18484
|
t = x => x
|
|
18474
18485
|
} = _ref,
|
|
18475
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
18486
|
+
props = _objectWithoutProperties(_ref, _excluded$o);
|
|
18476
18487
|
const [isHovered, setIsHovered] = React__default["default"].useState(false);
|
|
18477
18488
|
const {
|
|
18478
18489
|
token
|
|
@@ -18744,13 +18755,13 @@ const WidgetCard = _ref => {
|
|
|
18744
18755
|
});
|
|
18745
18756
|
};
|
|
18746
18757
|
|
|
18747
|
-
const _excluded$
|
|
18758
|
+
const _excluded$n = ["title", "children"];
|
|
18748
18759
|
const CarouselWidget = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
18749
18760
|
let {
|
|
18750
18761
|
title,
|
|
18751
18762
|
children
|
|
18752
18763
|
} = _ref,
|
|
18753
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
18764
|
+
rest = _objectWithoutProperties(_ref, _excluded$n);
|
|
18754
18765
|
/**
|
|
18755
18766
|
* Handles carousel slide change events
|
|
18756
18767
|
* @param {number} currentSlide - The index of the current slide after change
|
|
@@ -18914,7 +18925,7 @@ const EmptyStateContainer = styled__default["default"].div`
|
|
|
18914
18925
|
}
|
|
18915
18926
|
`;
|
|
18916
18927
|
|
|
18917
|
-
const _excluded$
|
|
18928
|
+
const _excluded$m = ["title", "images", "height", "fallback", "activeDotColor", "inactiveDotColor", "arrowIconColor", "arrowHoverIconColor", "customArrows", "emptyLogo", "emptyText"];
|
|
18918
18929
|
function ImageCarousel(_ref) {
|
|
18919
18930
|
let {
|
|
18920
18931
|
title,
|
|
@@ -18929,7 +18940,7 @@ function ImageCarousel(_ref) {
|
|
|
18929
18940
|
emptyLogo = antd.Empty.PRESENTED_IMAGE_SIMPLE,
|
|
18930
18941
|
emptyText = "No Image"
|
|
18931
18942
|
} = _ref,
|
|
18932
|
-
rest = _objectWithoutProperties(_ref, _excluded$
|
|
18943
|
+
rest = _objectWithoutProperties(_ref, _excluded$m);
|
|
18933
18944
|
const [previewVisible, setPreviewVisible] = React.useState(false);
|
|
18934
18945
|
const [current, setCurrent] = React.useState(0);
|
|
18935
18946
|
const carouselRef = React.useRef(null);
|
|
@@ -19298,7 +19309,7 @@ const getVegetationConfig = () => {
|
|
|
19298
19309
|
};
|
|
19299
19310
|
|
|
19300
19311
|
var _templateObject$a, _templateObject2$3;
|
|
19301
|
-
const _excluded$
|
|
19312
|
+
const _excluded$l = ["title", "activeVegetationConditions", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "growthObservations", "t"];
|
|
19302
19313
|
function VegetationWidget(_ref) {
|
|
19303
19314
|
let {
|
|
19304
19315
|
title = "Vegetation Health",
|
|
@@ -19310,7 +19321,7 @@ function VegetationWidget(_ref) {
|
|
|
19310
19321
|
growthObservations = [],
|
|
19311
19322
|
t = key => key
|
|
19312
19323
|
} = _ref,
|
|
19313
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19324
|
+
props = _objectWithoutProperties(_ref, _excluded$l);
|
|
19314
19325
|
let vegetationConfig = getVegetationConfig();
|
|
19315
19326
|
const allVegetationKeys = vegetationConfig.map(item => item.key);
|
|
19316
19327
|
if (filterKeys && Array.isArray(filterKeys)) {
|
|
@@ -19426,7 +19437,7 @@ const getFaunaConfig = () => {
|
|
|
19426
19437
|
};
|
|
19427
19438
|
|
|
19428
19439
|
var _templateObject$9, _templateObject2$2;
|
|
19429
|
-
const _excluded$
|
|
19440
|
+
const _excluded$k = ["title", "faunaPresent", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
|
|
19430
19441
|
function FaunaWidget(_ref) {
|
|
19431
19442
|
let {
|
|
19432
19443
|
title = "Observed Fauna",
|
|
@@ -19437,7 +19448,7 @@ function FaunaWidget(_ref) {
|
|
|
19437
19448
|
itemHeight = 100,
|
|
19438
19449
|
t = key => key
|
|
19439
19450
|
} = _ref,
|
|
19440
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19451
|
+
props = _objectWithoutProperties(_ref, _excluded$k);
|
|
19441
19452
|
let faunaConfig = getFaunaConfig();
|
|
19442
19453
|
|
|
19443
19454
|
// Filter to show only specific keys if filterKeys is provided
|
|
@@ -19502,7 +19513,7 @@ const getInvasiveSpeciesConfig = () => {
|
|
|
19502
19513
|
};
|
|
19503
19514
|
|
|
19504
19515
|
var _templateObject$8, _templateObject2$1;
|
|
19505
|
-
const _excluded$
|
|
19516
|
+
const _excluded$j = ["title", "invasiveSpecies", "hasInvasiveSpecies", "filterKeys", "columnsPerRow", "itemWidth", "itemHeight", "t"];
|
|
19506
19517
|
function InvasiveSpeciesWidget(_ref) {
|
|
19507
19518
|
let {
|
|
19508
19519
|
title = "Invasive Species",
|
|
@@ -19514,7 +19525,7 @@ function InvasiveSpeciesWidget(_ref) {
|
|
|
19514
19525
|
itemHeight = 100,
|
|
19515
19526
|
t = key => key
|
|
19516
19527
|
} = _ref,
|
|
19517
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
19528
|
+
props = _objectWithoutProperties(_ref, _excluded$j);
|
|
19518
19529
|
let invasiveSpeciesConfig = getInvasiveSpeciesConfig();
|
|
19519
19530
|
|
|
19520
19531
|
// Filter to show only specific keys if filterKeys is provided
|
|
@@ -20697,11 +20708,15 @@ function DataLink$1({
|
|
|
20697
20708
|
getToken
|
|
20698
20709
|
});
|
|
20699
20710
|
const data = React.useMemo(() => {
|
|
20711
|
+
const filteredPrefilledValues = Object.entries(form?.meta?.prefilledValues || {}).filter(([_, value]) => !(value && typeof value === 'object' && 'combine' in value)).reduce((acc, [key, value]) => ({
|
|
20712
|
+
...acc,
|
|
20713
|
+
[key]: value
|
|
20714
|
+
}), {});
|
|
20700
20715
|
const _formData = isSingle ? formData && !Array.isArray(formData) ? [{
|
|
20701
|
-
...
|
|
20716
|
+
...filteredPrefilledValues,
|
|
20702
20717
|
...formData
|
|
20703
20718
|
}] : [] : (Array.isArray(formData) ? formData : []).map(f => ({
|
|
20704
|
-
...
|
|
20719
|
+
...filteredPrefilledValues,
|
|
20705
20720
|
...f
|
|
20706
20721
|
}));
|
|
20707
20722
|
return (_formData || []).map((f, i) => {
|
|
@@ -22440,11 +22455,15 @@ function DataLinkFlat$1({
|
|
|
22440
22455
|
}
|
|
22441
22456
|
}, [entity, values.linking]);
|
|
22442
22457
|
const dataLinkFormData = React.useMemo(() => {
|
|
22458
|
+
const filteredPrefilledValues = Object.entries(form?.meta?.prefilledValues || {}).filter(([_, value]) => !(value && typeof value === 'object' && 'combine' in value)).reduce((acc, [key, value]) => ({
|
|
22459
|
+
...acc,
|
|
22460
|
+
[key]: value
|
|
22461
|
+
}), {});
|
|
22443
22462
|
const _formData = isSingle ? formData && !Array.isArray(formData) ? [{
|
|
22444
|
-
...
|
|
22463
|
+
...filteredPrefilledValues,
|
|
22445
22464
|
...formData
|
|
22446
22465
|
}] : [] : (Array.isArray(formData) ? formData : []).map(f => ({
|
|
22447
|
-
...
|
|
22466
|
+
...filteredPrefilledValues,
|
|
22448
22467
|
...f
|
|
22449
22468
|
}));
|
|
22450
22469
|
return (_formData || []).map((f, i) => {
|
|
@@ -23449,10 +23468,10 @@ const BasicInput = _ref => {
|
|
|
23449
23468
|
case 'text':
|
|
23450
23469
|
case 'phoneNumber':
|
|
23451
23470
|
case 'textarea':
|
|
23452
|
-
return item ? propHasValue$1(item[inputName]) ? item[inputName] : placeholder(item, inputName, withPlaceholder) : propHasValue$1(data[inputName]) ? data[inputName] : placeholder(data, inputName, withPlaceholder);
|
|
23471
|
+
return item ? propHasValue$1(item[inputName]) && item[inputName] !== '' ? item[inputName] : placeholder(item, inputName, withPlaceholder) : propHasValue$1(data[inputName]) && data[inputName] !== '' ? data[inputName] : placeholder(data, inputName, withPlaceholder);
|
|
23453
23472
|
case 'website':
|
|
23454
23473
|
case 'link':
|
|
23455
|
-
const v = item ? propHasValue$1(item[inputName]) ? item[inputName] : placeholder(item, inputName, withPlaceholder) : propHasValue$1(data[inputName]) ? data[inputName] : placeholder(data, inputName, withPlaceholder);
|
|
23474
|
+
const v = item ? propHasValue$1(item[inputName]) && item[inputName] !== '' ? item[inputName] : placeholder(item, inputName, withPlaceholder) : propHasValue$1(data[inputName]) && data[inputName] !== '' ? data[inputName] : placeholder(data, inputName, withPlaceholder);
|
|
23456
23475
|
if (isModal) {
|
|
23457
23476
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
23458
23477
|
className: "flex flex-column ant-upload-list",
|
|
@@ -24081,7 +24100,7 @@ const Input = _ref2 => {
|
|
|
24081
24100
|
ajaxOptions: ajaxOptions,
|
|
24082
24101
|
evaluationConfig: evaluationConfig
|
|
24083
24102
|
}, key);
|
|
24084
|
-
}), isRepeatable && Array.isArray(modalData) && !modalData.length ? /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
24103
|
+
}), isRepeatable && Array.isArray(modalData) && !modalData.length || modalData === "" ? /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
24085
24104
|
className: "text-muted",
|
|
24086
24105
|
children: t('Not answered')
|
|
24087
24106
|
}) : null]
|
|
@@ -24116,7 +24135,7 @@ const Input = _ref2 => {
|
|
|
24116
24135
|
linkingData: linkingData,
|
|
24117
24136
|
evaluationConfig: evaluationConfig
|
|
24118
24137
|
}, key);
|
|
24119
|
-
}), !modalData || Array.isArray(modalData) && !modalData.length ? /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
24138
|
+
}), !modalData || Array.isArray(modalData) && !modalData.length || modalData === "" ? /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
24120
24139
|
className: "text-muted",
|
|
24121
24140
|
children: t('Not answered')
|
|
24122
24141
|
}) : (Array.isArray(modalData) ? modalData : [modalData]).map((item, itemId) => /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -24203,7 +24222,7 @@ const Input = _ref2 => {
|
|
|
24203
24222
|
linkingData: linkingData,
|
|
24204
24223
|
evaluationConfig: evaluationConfig
|
|
24205
24224
|
}, key);
|
|
24206
|
-
}), !formData || Array.isArray(formData) && !formData.length ? /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
24225
|
+
}), !formData || Array.isArray(formData) && !formData.length || formData === "" ? /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
24207
24226
|
className: "text-muted",
|
|
24208
24227
|
children: t('Not answered')
|
|
24209
24228
|
}) : (_ref3 = Array.isArray(formData) ? formData : [formData]) === null || _ref3 === void 0 ? void 0 : _ref3.map((item, itemId) => /*#__PURE__*/jsxRuntime.jsxs(React__default["default"].Fragment, {
|
|
@@ -24937,7 +24956,7 @@ const RepeatableModals = ({
|
|
|
24937
24956
|
}) : null;
|
|
24938
24957
|
};
|
|
24939
24958
|
|
|
24940
|
-
const _excluded$
|
|
24959
|
+
const _excluded$i = ["viewGroup"],
|
|
24941
24960
|
_excluded2$2 = ["label", "icon", "position"];
|
|
24942
24961
|
const Content$1 = _ref => {
|
|
24943
24962
|
let {
|
|
@@ -25009,7 +25028,7 @@ const Content$1 = _ref => {
|
|
|
25009
25028
|
if (groups[gKey].viewGroup === key) {
|
|
25010
25029
|
// eslint-disable-next-line no-unused-vars
|
|
25011
25030
|
const _groups$gKey = groups[gKey],
|
|
25012
|
-
gCfg = _objectWithoutProperties(_groups$gKey, _excluded$
|
|
25031
|
+
gCfg = _objectWithoutProperties(_groups$gKey, _excluded$i);
|
|
25013
25032
|
items[gKey] = gCfg;
|
|
25014
25033
|
}
|
|
25015
25034
|
return items;
|
|
@@ -25289,7 +25308,7 @@ const Content$1 = _ref => {
|
|
|
25289
25308
|
});
|
|
25290
25309
|
};
|
|
25291
25310
|
|
|
25292
|
-
const _excluded$
|
|
25311
|
+
const _excluded$h = ["t", "open", "title", "children", "onClose", "onSuccess", "cancelBtnText", "saveBtnText", "className", "loading", "disabled", "withModalFormWrapper"];
|
|
25293
25312
|
function Modal(_ref) {
|
|
25294
25313
|
let {
|
|
25295
25314
|
t = text => text,
|
|
@@ -25305,7 +25324,7 @@ function Modal(_ref) {
|
|
|
25305
25324
|
disabled = false,
|
|
25306
25325
|
withModalFormWrapper = true
|
|
25307
25326
|
} = _ref,
|
|
25308
|
-
props = _objectWithoutProperties(_ref, _excluded$
|
|
25327
|
+
props = _objectWithoutProperties(_ref, _excluded$h);
|
|
25309
25328
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Modal, _objectSpread2(_objectSpread2({
|
|
25310
25329
|
width: 650,
|
|
25311
25330
|
footer: null,
|
|
@@ -35952,7 +35971,7 @@ const beforeUpload = allowedExtensions => file => {
|
|
|
35952
35971
|
};
|
|
35953
35972
|
const allowedImageExtensions = ['.jpg', '.jpeg', '.png', '.gif', '.webp', '.avif', '.bmp', '.tiff', '.tif', '.heif', '.heic', '.svg', '.ico'];
|
|
35954
35973
|
|
|
35955
|
-
const _excluded$
|
|
35974
|
+
const _excluded$g = ["placeholder"],
|
|
35956
35975
|
_excluded2$1 = ["label", "description", "excludeFromEdit", "showFormIf", "icon", "position", "template", "formClass"];
|
|
35957
35976
|
dayjs__default["default"].extend(utc);
|
|
35958
35977
|
dayjs__default["default"].extend(timezone);
|
|
@@ -36918,7 +36937,7 @@ const inputTypeComponent$1 = {
|
|
|
36918
36937
|
},
|
|
36919
36938
|
commentHint
|
|
36920
36939
|
} = _ref19,
|
|
36921
|
-
props = _objectWithoutProperties(_ref19.props, _excluded$
|
|
36940
|
+
props = _objectWithoutProperties(_ref19.props, _excluded$g);
|
|
36922
36941
|
let {
|
|
36923
36942
|
onChange,
|
|
36924
36943
|
value,
|
|
@@ -39624,7 +39643,7 @@ function AjaxSelect(props) {
|
|
|
39624
39643
|
}, props));
|
|
39625
39644
|
}
|
|
39626
39645
|
|
|
39627
|
-
|
|
39646
|
+
const _excluded$f = ["placeholder"];
|
|
39628
39647
|
const propHasValue = val => {
|
|
39629
39648
|
if (Array.isArray(val)) {
|
|
39630
39649
|
return val.length > 0 ? true : false;
|
|
@@ -39642,14 +39661,14 @@ const checkCondition = (condition, repeatValues, formsValue) => {
|
|
|
39642
39661
|
return isShown;
|
|
39643
39662
|
};
|
|
39644
39663
|
function showHideInput(input, formsValue, repeatIndex, repeatValues, setValues, ref) {
|
|
39645
|
-
|
|
39664
|
+
var _input$meta;
|
|
39665
|
+
if ((input === null || input === void 0 || (_input$meta = input.meta) === null || _input$meta === void 0 ? void 0 : _input$meta.hidden) === true) {
|
|
39666
|
+
var _input$meta2;
|
|
39646
39667
|
// Set default value for hidden fields
|
|
39647
|
-
if (input
|
|
39668
|
+
if ((input === null || input === void 0 || (_input$meta2 = input.meta) === null || _input$meta2 === void 0 ? void 0 : _input$meta2.defaultValue) !== undefined && !propHasValue(formsValue[ref])) {
|
|
39648
39669
|
formsValue[ref] = input.meta.defaultValue;
|
|
39649
39670
|
if (setValues && typeof setValues === 'function') {
|
|
39650
|
-
setValues({
|
|
39651
|
-
...formsValue
|
|
39652
|
-
});
|
|
39671
|
+
setValues(_objectSpread2({}, formsValue));
|
|
39653
39672
|
}
|
|
39654
39673
|
}
|
|
39655
39674
|
return false;
|
|
@@ -39708,35 +39727,35 @@ function getInputHeadLines(type, i, input, values) {
|
|
|
39708
39727
|
switch (type) {
|
|
39709
39728
|
case "h2":
|
|
39710
39729
|
return /*#__PURE__*/jsxRuntime.jsx("h2", {
|
|
39711
|
-
className:
|
|
39730
|
+
className: "title-semibold-2 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
|
|
39712
39731
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
39713
39732
|
children: getInputLabel(input, values)
|
|
39714
39733
|
})
|
|
39715
39734
|
});
|
|
39716
39735
|
case "h3":
|
|
39717
39736
|
return /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
39718
|
-
className:
|
|
39737
|
+
className: "title-semibold-3 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
|
|
39719
39738
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
39720
39739
|
children: getInputLabel(input, values)
|
|
39721
39740
|
})
|
|
39722
39741
|
});
|
|
39723
39742
|
case "h4":
|
|
39724
39743
|
return /*#__PURE__*/jsxRuntime.jsx("h4", {
|
|
39725
|
-
className:
|
|
39744
|
+
className: "title-semibold-4 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
|
|
39726
39745
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
39727
39746
|
children: getInputLabel(input, values)
|
|
39728
39747
|
})
|
|
39729
39748
|
});
|
|
39730
39749
|
case "h5":
|
|
39731
39750
|
return /*#__PURE__*/jsxRuntime.jsx("h5", {
|
|
39732
|
-
className:
|
|
39751
|
+
className: "title-semibold-5 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
|
|
39733
39752
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
39734
39753
|
children: getInputLabel(input, values)
|
|
39735
39754
|
})
|
|
39736
39755
|
});
|
|
39737
39756
|
case "h6":
|
|
39738
39757
|
return /*#__PURE__*/jsxRuntime.jsx("h6", {
|
|
39739
|
-
className:
|
|
39758
|
+
className: "title-semibold-6 ".concat(input.marginBottom || "", " ").concat(input.groupHeader || "", " ").concat(i ? input.marginTop || "" : ""),
|
|
39740
39759
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
39741
39760
|
children: getInputLabel(input, values)
|
|
39742
39761
|
})
|
|
@@ -39745,7 +39764,9 @@ function getInputHeadLines(type, i, input, values) {
|
|
|
39745
39764
|
return null;
|
|
39746
39765
|
}
|
|
39747
39766
|
}
|
|
39748
|
-
function getInputLabel(input
|
|
39767
|
+
function getInputLabel(input) {
|
|
39768
|
+
let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
39769
|
+
let asText = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
39749
39770
|
if (typeof input.label === "object") {
|
|
39750
39771
|
const validations = Object.keys(input.label);
|
|
39751
39772
|
const key = validations.find(v => {
|
|
@@ -39803,7 +39824,8 @@ function getInputLabel(input, formsValue = {}, asText = false) {
|
|
|
39803
39824
|
}) : ReactHtmlParser__default["default"](input.label);
|
|
39804
39825
|
}
|
|
39805
39826
|
}
|
|
39806
|
-
function getSelectOptions$1(option
|
|
39827
|
+
function getSelectOptions$1(option) {
|
|
39828
|
+
let formsValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
39807
39829
|
if (typeof option.label === "object") {
|
|
39808
39830
|
const validations = Object.keys(option.label);
|
|
39809
39831
|
const key = validations.find(v => {
|
|
@@ -39827,7 +39849,9 @@ function getSectionLabel(labels, values) {
|
|
|
39827
39849
|
}
|
|
39828
39850
|
return labels;
|
|
39829
39851
|
}
|
|
39830
|
-
function getSubtitles(subtitles, position
|
|
39852
|
+
function getSubtitles(subtitles, position) {
|
|
39853
|
+
let formsValue = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
39854
|
+
let repeatValues = arguments.length > 4 ? arguments[4] : undefined;
|
|
39831
39855
|
let subtitle = subtitles && subtitles[position];
|
|
39832
39856
|
if (subtitle && typeof subtitle === "object") {
|
|
39833
39857
|
let newSubtitle = subtitle.default || "";
|
|
@@ -39871,14 +39895,12 @@ function getSubtitles(subtitles, position, formsValue = {}, repeatIndex, repeatV
|
|
|
39871
39895
|
function getFormTitles(titles, key, position) {
|
|
39872
39896
|
let tilte = titles && titles[key];
|
|
39873
39897
|
return tilte ? /*#__PURE__*/jsxRuntime.jsx("h3", {
|
|
39874
|
-
className:
|
|
39898
|
+
className: "title-semibold-3 mb0 ".concat(position ? "mt-3" : ""),
|
|
39875
39899
|
children: tilte
|
|
39876
39900
|
}) : null;
|
|
39877
39901
|
}
|
|
39878
39902
|
const updateFormValues = (repeatIndex, repeatValues, inputName, value, formsValue, name, mainForm) => {
|
|
39879
|
-
formsValue = Object.assign(formsValue, {
|
|
39880
|
-
...mainForm.getFieldsValue(true)
|
|
39881
|
-
});
|
|
39903
|
+
formsValue = Object.assign(formsValue, _objectSpread2({}, mainForm.getFieldsValue(true)));
|
|
39882
39904
|
if (typeof repeatIndex === "number" && repeatValues) {
|
|
39883
39905
|
if (!repeatValues[inputName] || !___default["default"].isEqual(repeatValues[inputName], value)) {
|
|
39884
39906
|
repeatValues[inputName] = value;
|
|
@@ -39912,48 +39934,52 @@ const updateFormValues = (repeatIndex, repeatValues, inputName, value, formsValu
|
|
|
39912
39934
|
}
|
|
39913
39935
|
};
|
|
39914
39936
|
const inputTypeComponent = {
|
|
39915
|
-
text: ({
|
|
39916
|
-
|
|
39917
|
-
|
|
39918
|
-
|
|
39919
|
-
|
|
39920
|
-
|
|
39921
|
-
|
|
39937
|
+
text: (_ref, _ref2) => {
|
|
39938
|
+
let {
|
|
39939
|
+
props,
|
|
39940
|
+
rules
|
|
39941
|
+
} = _ref;
|
|
39942
|
+
let {
|
|
39943
|
+
inputMeta = {},
|
|
39944
|
+
t
|
|
39945
|
+
} = _ref2;
|
|
39922
39946
|
const maxRule = rules.find(r => r.max);
|
|
39923
39947
|
const maxProps = {};
|
|
39924
39948
|
if (maxRule) {
|
|
39925
39949
|
maxProps.maxLength = maxRule.max;
|
|
39926
39950
|
}
|
|
39927
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
39928
|
-
size: "medium"
|
|
39929
|
-
|
|
39951
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
|
|
39952
|
+
size: "medium"
|
|
39953
|
+
}, maxProps), {}, {
|
|
39930
39954
|
allowClear: true,
|
|
39931
39955
|
autoComplete: "new-password",
|
|
39932
|
-
type: "text"
|
|
39933
|
-
|
|
39956
|
+
type: "text"
|
|
39957
|
+
}, props), {}, {
|
|
39934
39958
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
39935
39959
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
39936
|
-
});
|
|
39960
|
+
}));
|
|
39937
39961
|
},
|
|
39938
|
-
drawTerritory: ({
|
|
39939
|
-
|
|
39940
|
-
|
|
39941
|
-
|
|
39942
|
-
|
|
39943
|
-
|
|
39944
|
-
|
|
39945
|
-
|
|
39946
|
-
|
|
39962
|
+
drawTerritory: (_ref3, _ref4) => {
|
|
39963
|
+
let {
|
|
39964
|
+
formsValue,
|
|
39965
|
+
name,
|
|
39966
|
+
addressData,
|
|
39967
|
+
onValuesChange
|
|
39968
|
+
} = _ref3;
|
|
39969
|
+
let {
|
|
39970
|
+
setFormValues,
|
|
39971
|
+
form
|
|
39972
|
+
} = _ref4;
|
|
39947
39973
|
let search = formsValue.country;
|
|
39948
39974
|
if (addressData && addressData.address && Object.keys(addressData.address).length > 0) {
|
|
39949
39975
|
if (addressData.address.country) {
|
|
39950
39976
|
search = addressData.address.country;
|
|
39951
39977
|
}
|
|
39952
39978
|
if (addressData.address.level1) {
|
|
39953
|
-
search =
|
|
39979
|
+
search = "".concat(addressData.address.level1, ", ").concat(addressData.address.country);
|
|
39954
39980
|
}
|
|
39955
39981
|
if (addressData.address.level2) {
|
|
39956
|
-
search =
|
|
39982
|
+
search = "".concat(addressData.address.level2, ", ").concat(addressData.address.level1, ", ").concat(addressData.address.country);
|
|
39957
39983
|
}
|
|
39958
39984
|
} else {
|
|
39959
39985
|
const country = countriesList.countries[formsValue.country] || {};
|
|
@@ -39961,10 +39987,10 @@ const inputTypeComponent = {
|
|
|
39961
39987
|
search = country.name;
|
|
39962
39988
|
}
|
|
39963
39989
|
if (formsValue.administrativeLevel1Name) {
|
|
39964
|
-
search =
|
|
39990
|
+
search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
|
|
39965
39991
|
}
|
|
39966
39992
|
if (formsValue.administrativeLevel2Name) {
|
|
39967
|
-
search =
|
|
39993
|
+
search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
|
|
39968
39994
|
}
|
|
39969
39995
|
}
|
|
39970
39996
|
console.log("search", {
|
|
@@ -39984,10 +40010,9 @@ const inputTypeComponent = {
|
|
|
39984
40010
|
const allFormValues = form && typeof form.getFieldsValue === 'function' ? form.getFieldsValue(true) : formsValue;
|
|
39985
40011
|
|
|
39986
40012
|
// Create the updated values
|
|
39987
|
-
const updatedValues = {
|
|
39988
|
-
...allFormValues,
|
|
40013
|
+
const updatedValues = _objectSpread2(_objectSpread2({}, allFormValues), {}, {
|
|
39989
40014
|
[name]: val
|
|
39990
|
-
};
|
|
40015
|
+
});
|
|
39991
40016
|
|
|
39992
40017
|
// Call onValuesChange with the change and all values
|
|
39993
40018
|
if (typeof onValuesChange === 'function') {
|
|
@@ -40002,39 +40027,44 @@ const inputTypeComponent = {
|
|
|
40002
40027
|
searchValue: search
|
|
40003
40028
|
});
|
|
40004
40029
|
},
|
|
40005
|
-
link: ({
|
|
40006
|
-
|
|
40007
|
-
|
|
40008
|
-
|
|
40009
|
-
|
|
40010
|
-
|
|
40011
|
-
|
|
40030
|
+
link: (_ref5, _ref6) => {
|
|
40031
|
+
let {
|
|
40032
|
+
props,
|
|
40033
|
+
rules
|
|
40034
|
+
} = _ref5;
|
|
40035
|
+
let {
|
|
40036
|
+
inputMeta = {},
|
|
40037
|
+
t
|
|
40038
|
+
} = _ref6;
|
|
40012
40039
|
const maxRule = rules.find(r => r.max);
|
|
40013
40040
|
const maxProps = {};
|
|
40014
40041
|
if (maxRule) {
|
|
40015
40042
|
maxProps.maxLength = maxRule.max;
|
|
40016
40043
|
}
|
|
40017
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, {
|
|
40018
|
-
size: "medium"
|
|
40019
|
-
|
|
40044
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input, _objectSpread2(_objectSpread2(_objectSpread2({
|
|
40045
|
+
size: "medium"
|
|
40046
|
+
}, maxProps), {}, {
|
|
40020
40047
|
allowClear: true,
|
|
40021
40048
|
autoComplete: "new-password",
|
|
40022
|
-
type: "text"
|
|
40023
|
-
|
|
40049
|
+
type: "text"
|
|
40050
|
+
}, props), {}, {
|
|
40024
40051
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
40025
40052
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
40026
|
-
});
|
|
40053
|
+
}));
|
|
40027
40054
|
},
|
|
40028
|
-
number: ({
|
|
40029
|
-
|
|
40030
|
-
|
|
40031
|
-
|
|
40032
|
-
|
|
40033
|
-
|
|
40034
|
-
|
|
40035
|
-
|
|
40055
|
+
number: (_ref7, _ref8) => {
|
|
40056
|
+
var _input$meta3;
|
|
40057
|
+
let {
|
|
40058
|
+
props,
|
|
40059
|
+
rules,
|
|
40060
|
+
input
|
|
40061
|
+
} = _ref7;
|
|
40062
|
+
let {
|
|
40063
|
+
inputMeta = {},
|
|
40064
|
+
t
|
|
40065
|
+
} = _ref8;
|
|
40036
40066
|
const maxRule = rules.find(r => r.max);
|
|
40037
|
-
const integerRule = !input
|
|
40067
|
+
const integerRule = !(input !== null && input !== void 0 && (_input$meta3 = input.meta) !== null && _input$meta3 !== void 0 && _input$meta3.isDecimal);
|
|
40038
40068
|
const parser = value => {
|
|
40039
40069
|
if (!value) {
|
|
40040
40070
|
return "";
|
|
@@ -40045,50 +40075,53 @@ const inputTypeComponent = {
|
|
|
40045
40075
|
return value.replace(/\$\s?|(,*)/g, "");
|
|
40046
40076
|
};
|
|
40047
40077
|
if (maxRule) {
|
|
40048
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
40078
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
|
|
40049
40079
|
allowClear: true,
|
|
40050
|
-
autoComplete: "new-password"
|
|
40051
|
-
|
|
40080
|
+
autoComplete: "new-password"
|
|
40081
|
+
}, props), {}, {
|
|
40052
40082
|
type: "number",
|
|
40053
40083
|
min: 0,
|
|
40054
40084
|
max: maxRule.max,
|
|
40055
40085
|
parser: parser
|
|
40056
|
-
});
|
|
40086
|
+
}));
|
|
40057
40087
|
}
|
|
40058
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
40088
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
|
|
40059
40089
|
allowClear: true,
|
|
40060
|
-
autoComplete: "new-password"
|
|
40061
|
-
|
|
40090
|
+
autoComplete: "new-password"
|
|
40091
|
+
}, props), {}, {
|
|
40062
40092
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
40063
40093
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type number"),
|
|
40064
40094
|
min: 0,
|
|
40065
40095
|
formatter: value => numberWithCommas$1(value),
|
|
40066
40096
|
parser: parser
|
|
40067
|
-
});
|
|
40097
|
+
}));
|
|
40068
40098
|
},
|
|
40069
|
-
select: ({
|
|
40070
|
-
|
|
40071
|
-
|
|
40072
|
-
|
|
40073
|
-
|
|
40074
|
-
|
|
40075
|
-
|
|
40076
|
-
|
|
40077
|
-
|
|
40078
|
-
|
|
40079
|
-
|
|
40080
|
-
|
|
40081
|
-
|
|
40082
|
-
|
|
40083
|
-
|
|
40084
|
-
|
|
40085
|
-
|
|
40086
|
-
|
|
40087
|
-
|
|
40088
|
-
|
|
40089
|
-
|
|
40090
|
-
|
|
40091
|
-
|
|
40099
|
+
select: (_ref9, _ref10) => {
|
|
40100
|
+
var _input$meta4;
|
|
40101
|
+
let {
|
|
40102
|
+
value,
|
|
40103
|
+
options,
|
|
40104
|
+
optionGroup,
|
|
40105
|
+
props,
|
|
40106
|
+
formsValue,
|
|
40107
|
+
optionsFilter,
|
|
40108
|
+
filterCond,
|
|
40109
|
+
repeatValues,
|
|
40110
|
+
repeatIndex,
|
|
40111
|
+
name,
|
|
40112
|
+
inputName,
|
|
40113
|
+
address,
|
|
40114
|
+
addressData,
|
|
40115
|
+
input
|
|
40116
|
+
} = _ref9;
|
|
40117
|
+
let {
|
|
40118
|
+
forms,
|
|
40119
|
+
form,
|
|
40120
|
+
setAddress,
|
|
40121
|
+
inputMeta = {},
|
|
40122
|
+
t,
|
|
40123
|
+
changeInputMeta
|
|
40124
|
+
} = _ref10;
|
|
40092
40125
|
let opts;
|
|
40093
40126
|
if (typeof options === "string") {
|
|
40094
40127
|
const [formName, key] = options.split(".");
|
|
@@ -40144,18 +40177,19 @@ const inputTypeComponent = {
|
|
|
40144
40177
|
}
|
|
40145
40178
|
opts = groupOptions;
|
|
40146
40179
|
}
|
|
40147
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
40180
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
|
|
40148
40181
|
autoComplete: "new-password",
|
|
40149
40182
|
allowClear: true,
|
|
40150
40183
|
showSearch: true,
|
|
40151
|
-
defaultValue: input
|
|
40184
|
+
defaultValue: input === null || input === void 0 || (_input$meta4 = input.meta) === null || _input$meta4 === void 0 ? void 0 : _input$meta4.defaultValue,
|
|
40152
40185
|
filterOption: filterSelectOptions,
|
|
40153
|
-
optionFilterProp: "children"
|
|
40154
|
-
|
|
40186
|
+
optionFilterProp: "children"
|
|
40187
|
+
}, props), {}, {
|
|
40155
40188
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
40156
40189
|
placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp$1(props.placeholder, formsValue) || t("Select one option"),
|
|
40157
40190
|
onChange: (val, selectedValue) => {
|
|
40158
|
-
|
|
40191
|
+
var _input$meta5;
|
|
40192
|
+
if (typeof (input === null || input === void 0 || (_input$meta5 = input.meta) === null || _input$meta5 === void 0 ? void 0 : _input$meta5.onChange) === "string") {
|
|
40159
40193
|
const [value, otherKey, otherVal] = input.meta.onChange.split(".");
|
|
40160
40194
|
if (val === value) {
|
|
40161
40195
|
changeInputMeta({
|
|
@@ -40169,9 +40203,7 @@ const inputTypeComponent = {
|
|
|
40169
40203
|
}
|
|
40170
40204
|
if (address && selectedValue) {
|
|
40171
40205
|
dot__default["default"].str(address, selectedValue.children, addressData);
|
|
40172
|
-
setAddress({
|
|
40173
|
-
...addressData
|
|
40174
|
-
});
|
|
40206
|
+
setAddress(_objectSpread2({}, addressData));
|
|
40175
40207
|
}
|
|
40176
40208
|
if (props.onChange) {
|
|
40177
40209
|
props.onChange(val);
|
|
@@ -40183,33 +40215,35 @@ const inputTypeComponent = {
|
|
|
40183
40215
|
value: og.value,
|
|
40184
40216
|
disabled: og.disabled,
|
|
40185
40217
|
children: og.label
|
|
40186
|
-
},
|
|
40218
|
+
}, "".concat(i).concat(j)))
|
|
40187
40219
|
}, i) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
40188
40220
|
value: option.value,
|
|
40189
40221
|
disabled: option.disabled,
|
|
40190
40222
|
children: option.label
|
|
40191
40223
|
}, i))
|
|
40192
|
-
});
|
|
40224
|
+
}));
|
|
40193
40225
|
},
|
|
40194
|
-
multiselect: ({
|
|
40195
|
-
|
|
40196
|
-
|
|
40197
|
-
|
|
40198
|
-
|
|
40199
|
-
|
|
40200
|
-
|
|
40201
|
-
|
|
40202
|
-
|
|
40203
|
-
|
|
40204
|
-
|
|
40205
|
-
|
|
40206
|
-
|
|
40207
|
-
|
|
40208
|
-
|
|
40209
|
-
|
|
40210
|
-
|
|
40211
|
-
|
|
40212
|
-
|
|
40226
|
+
multiselect: (_ref11, _ref12) => {
|
|
40227
|
+
let {
|
|
40228
|
+
value,
|
|
40229
|
+
options,
|
|
40230
|
+
optionGroup,
|
|
40231
|
+
optionsFilter,
|
|
40232
|
+
filterCond,
|
|
40233
|
+
props,
|
|
40234
|
+
formsValue,
|
|
40235
|
+
repeatValues,
|
|
40236
|
+
repeatIndex,
|
|
40237
|
+
inputName,
|
|
40238
|
+
name,
|
|
40239
|
+
tags
|
|
40240
|
+
} = _ref11;
|
|
40241
|
+
let {
|
|
40242
|
+
forms,
|
|
40243
|
+
form,
|
|
40244
|
+
inputMeta = {},
|
|
40245
|
+
t
|
|
40246
|
+
} = _ref12;
|
|
40213
40247
|
let opts;
|
|
40214
40248
|
if (typeof options === "string") {
|
|
40215
40249
|
const [formName, key] = options.split(".");
|
|
@@ -40266,16 +40300,16 @@ const inputTypeComponent = {
|
|
|
40266
40300
|
}
|
|
40267
40301
|
opts = groupOptions;
|
|
40268
40302
|
}
|
|
40269
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
40303
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2(_objectSpread2({
|
|
40270
40304
|
allowClear: true,
|
|
40271
40305
|
autoComplete: "new-password",
|
|
40272
40306
|
mode: tags ? "tags" : "multiple",
|
|
40273
|
-
optionFilterProp: "children"
|
|
40274
|
-
|
|
40275
|
-
|
|
40276
|
-
|
|
40277
|
-
filterOption: filterSelectOptions
|
|
40278
|
-
|
|
40307
|
+
optionFilterProp: "children"
|
|
40308
|
+
}, tags ? {
|
|
40309
|
+
tokenSeparators: [",", "\n", "\t"]
|
|
40310
|
+
} : {}), {}, {
|
|
40311
|
+
filterOption: filterSelectOptions
|
|
40312
|
+
}, props), {}, {
|
|
40279
40313
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
40280
40314
|
placeholder: getMetaPlaceholer(inputMeta, t) || getInputProp$1(props.placeholder, formsValue) || t("Select all relevant options"),
|
|
40281
40315
|
children: (opts || []).map((option, i) => option.items ? /*#__PURE__*/jsxRuntime.jsx(antd.Select.OptGroup, {
|
|
@@ -40284,42 +40318,42 @@ const inputTypeComponent = {
|
|
|
40284
40318
|
value: og.value,
|
|
40285
40319
|
disabled: og.disabled,
|
|
40286
40320
|
children: og.label
|
|
40287
|
-
},
|
|
40321
|
+
}, "".concat(i).concat(j)))
|
|
40288
40322
|
}, i) : /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
40289
40323
|
value: option.value,
|
|
40290
40324
|
disabled: option.disabled,
|
|
40291
40325
|
children: option.label
|
|
40292
40326
|
}, i))
|
|
40293
|
-
});
|
|
40327
|
+
}));
|
|
40294
40328
|
},
|
|
40295
|
-
date: ({
|
|
40296
|
-
|
|
40297
|
-
|
|
40298
|
-
|
|
40299
|
-
|
|
40300
|
-
|
|
40301
|
-
|
|
40302
|
-
|
|
40303
|
-
|
|
40304
|
-
|
|
40305
|
-
|
|
40306
|
-
|
|
40307
|
-
|
|
40329
|
+
date: (_ref13, _ref14) => {
|
|
40330
|
+
let {
|
|
40331
|
+
props,
|
|
40332
|
+
rules,
|
|
40333
|
+
repeatValues,
|
|
40334
|
+
formsValue,
|
|
40335
|
+
name
|
|
40336
|
+
} = _ref13;
|
|
40337
|
+
let {
|
|
40338
|
+
inputMeta,
|
|
40339
|
+
t,
|
|
40340
|
+
groupFormId,
|
|
40341
|
+
form,
|
|
40342
|
+
setFormValues
|
|
40343
|
+
} = _ref14;
|
|
40308
40344
|
const lng = localStorage.getItem("datastakeLng") || "en";
|
|
40309
40345
|
const maxRule = rules.find(r => r.max);
|
|
40310
40346
|
const handleDateChange = date => {
|
|
40311
40347
|
if (date) {
|
|
40312
40348
|
const localDate = dayjs__default["default"].utc(date);
|
|
40313
40349
|
if (groupFormId) {
|
|
40314
|
-
const _new = {
|
|
40315
|
-
...(formsValue[groupFormId] || {}),
|
|
40350
|
+
const _new = _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
|
|
40316
40351
|
[name]: localDate
|
|
40317
|
-
};
|
|
40352
|
+
});
|
|
40318
40353
|
form.setFieldValue(groupFormId, _new);
|
|
40319
|
-
setFormValues({
|
|
40320
|
-
...formsValue,
|
|
40354
|
+
setFormValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
40321
40355
|
[groupFormId]: _new
|
|
40322
|
-
});
|
|
40356
|
+
}));
|
|
40323
40357
|
} else {
|
|
40324
40358
|
form.setFieldValue(name, localDate);
|
|
40325
40359
|
}
|
|
@@ -40331,10 +40365,10 @@ const inputTypeComponent = {
|
|
|
40331
40365
|
checkForMax = checkCondition(maxRule.condition, repeatValues, formsValue);
|
|
40332
40366
|
}
|
|
40333
40367
|
if (checkForMax) {
|
|
40334
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
40368
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
|
|
40335
40369
|
allowClear: true,
|
|
40336
|
-
autoComplete: "new-password"
|
|
40337
|
-
|
|
40370
|
+
autoComplete: "new-password"
|
|
40371
|
+
}, props), {}, {
|
|
40338
40372
|
onChange: handleDateChange,
|
|
40339
40373
|
format: DATE_FORMATS,
|
|
40340
40374
|
locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
|
|
@@ -40343,31 +40377,33 @@ const inputTypeComponent = {
|
|
|
40343
40377
|
disabledDate: current => {
|
|
40344
40378
|
return current && current >= dayjs__default["default"]().endOf("day");
|
|
40345
40379
|
}
|
|
40346
|
-
});
|
|
40380
|
+
}));
|
|
40347
40381
|
}
|
|
40348
40382
|
}
|
|
40349
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
40383
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
|
|
40350
40384
|
allowClear: true,
|
|
40351
|
-
autoComplete: "new-password"
|
|
40352
|
-
|
|
40385
|
+
autoComplete: "new-password"
|
|
40386
|
+
}, props), {}, {
|
|
40353
40387
|
onChange: handleDateChange,
|
|
40354
40388
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Select date"),
|
|
40355
40389
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
40356
40390
|
format: DATE_FORMATS,
|
|
40357
40391
|
locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"]
|
|
40358
|
-
});
|
|
40392
|
+
}));
|
|
40359
40393
|
},
|
|
40360
|
-
comment: ({
|
|
40361
|
-
|
|
40362
|
-
|
|
40363
|
-
|
|
40364
|
-
|
|
40365
|
-
|
|
40366
|
-
|
|
40367
|
-
|
|
40368
|
-
|
|
40369
|
-
|
|
40370
|
-
|
|
40394
|
+
comment: (_ref15, _ref16) => {
|
|
40395
|
+
let {
|
|
40396
|
+
props: {
|
|
40397
|
+
placeholder
|
|
40398
|
+
},
|
|
40399
|
+
commentHint
|
|
40400
|
+
} = _ref15,
|
|
40401
|
+
props = _objectWithoutProperties(_ref15.props, _excluded$f);
|
|
40402
|
+
let {
|
|
40403
|
+
onChange,
|
|
40404
|
+
value
|
|
40405
|
+
} = _ref16;
|
|
40406
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
|
|
40371
40407
|
allowClear: true,
|
|
40372
40408
|
value: value,
|
|
40373
40409
|
onChange: e => onChange(e.target.value),
|
|
@@ -40377,56 +40413,60 @@ const inputTypeComponent = {
|
|
|
40377
40413
|
autoSize: {
|
|
40378
40414
|
minRows: 5,
|
|
40379
40415
|
maxRows: 5
|
|
40380
|
-
}
|
|
40381
|
-
|
|
40416
|
+
}
|
|
40417
|
+
}, props), {}, {
|
|
40382
40418
|
disabled: false
|
|
40383
|
-
});
|
|
40419
|
+
}));
|
|
40384
40420
|
},
|
|
40385
|
-
textarea: ({
|
|
40386
|
-
|
|
40387
|
-
|
|
40388
|
-
|
|
40389
|
-
|
|
40390
|
-
|
|
40391
|
-
|
|
40421
|
+
textarea: (_ref17, _ref18) => {
|
|
40422
|
+
let {
|
|
40423
|
+
props,
|
|
40424
|
+
rules
|
|
40425
|
+
} = _ref17;
|
|
40426
|
+
let {
|
|
40427
|
+
inputMeta,
|
|
40428
|
+
t
|
|
40429
|
+
} = _ref18;
|
|
40392
40430
|
const maxRule = rules.find(r => r.max);
|
|
40393
40431
|
let maxLength = MAX_TEXT_AREA_LENGTH;
|
|
40394
40432
|
if (maxRule) {
|
|
40395
40433
|
maxLength = maxRule.max;
|
|
40396
40434
|
}
|
|
40397
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, {
|
|
40435
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Input.TextArea, _objectSpread2(_objectSpread2({
|
|
40398
40436
|
allowClear: true,
|
|
40399
40437
|
autoComplete: "new-password",
|
|
40400
40438
|
maxLength: maxLength,
|
|
40401
40439
|
autoSize: {
|
|
40402
40440
|
minRows: 5,
|
|
40403
40441
|
maxRows: 5
|
|
40404
|
-
}
|
|
40405
|
-
|
|
40442
|
+
}
|
|
40443
|
+
}, props), {}, {
|
|
40406
40444
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
40407
40445
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || t("Type")
|
|
40408
|
-
});
|
|
40446
|
+
}));
|
|
40409
40447
|
},
|
|
40410
|
-
phoneNumber: ({
|
|
40411
|
-
|
|
40412
|
-
|
|
40413
|
-
|
|
40414
|
-
|
|
40415
|
-
|
|
40416
|
-
|
|
40417
|
-
|
|
40418
|
-
|
|
40419
|
-
|
|
40420
|
-
|
|
40421
|
-
|
|
40422
|
-
|
|
40448
|
+
phoneNumber: (_ref19, _ref20) => {
|
|
40449
|
+
let {
|
|
40450
|
+
name,
|
|
40451
|
+
inputName,
|
|
40452
|
+
props,
|
|
40453
|
+
value,
|
|
40454
|
+
repeatIndex,
|
|
40455
|
+
repeatValues,
|
|
40456
|
+
formsValue
|
|
40457
|
+
} = _ref19;
|
|
40458
|
+
let {
|
|
40459
|
+
setFormValues,
|
|
40460
|
+
t
|
|
40461
|
+
} = _ref20;
|
|
40462
|
+
return /*#__PURE__*/jsxRuntime.jsx(PhoneInput, _objectSpread2(_objectSpread2({
|
|
40423
40463
|
t: t,
|
|
40424
40464
|
doChangeErrors: false,
|
|
40425
40465
|
allowClear: true,
|
|
40426
|
-
country: formsValue
|
|
40466
|
+
country: formsValue === null || formsValue === void 0 ? void 0 : formsValue.country,
|
|
40427
40467
|
formsValue: formsValue,
|
|
40428
|
-
initialValue: value
|
|
40429
|
-
|
|
40468
|
+
initialValue: value
|
|
40469
|
+
}, props), {}, {
|
|
40430
40470
|
onChange: val => {
|
|
40431
40471
|
if (repeatValues) {
|
|
40432
40472
|
const inputValues = Array.isArray(formsValue[name]) ? formsValue[name] || [] : [];
|
|
@@ -40442,24 +40482,25 @@ const inputTypeComponent = {
|
|
|
40442
40482
|
setFormValues(formsValue);
|
|
40443
40483
|
}
|
|
40444
40484
|
}
|
|
40445
|
-
});
|
|
40485
|
+
}));
|
|
40446
40486
|
},
|
|
40447
|
-
switch: ({
|
|
40448
|
-
|
|
40449
|
-
|
|
40450
|
-
|
|
40451
|
-
|
|
40452
|
-
|
|
40453
|
-
|
|
40454
|
-
|
|
40455
|
-
|
|
40456
|
-
|
|
40457
|
-
|
|
40458
|
-
|
|
40459
|
-
|
|
40460
|
-
|
|
40461
|
-
|
|
40462
|
-
|
|
40487
|
+
switch: (_ref21, _ref22) => {
|
|
40488
|
+
let {
|
|
40489
|
+
props,
|
|
40490
|
+
value,
|
|
40491
|
+
restricted,
|
|
40492
|
+
autocomplete,
|
|
40493
|
+
formsValue,
|
|
40494
|
+
repeatIndex,
|
|
40495
|
+
name,
|
|
40496
|
+
inputName,
|
|
40497
|
+
replace
|
|
40498
|
+
} = _ref21;
|
|
40499
|
+
let {
|
|
40500
|
+
form,
|
|
40501
|
+
setFormValues
|
|
40502
|
+
} = _ref22;
|
|
40503
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Switch, _objectSpread2(_objectSpread2({}, props), {}, {
|
|
40463
40504
|
defaultChecked: value || false,
|
|
40464
40505
|
checked: value || false,
|
|
40465
40506
|
onChange: isChecked => {
|
|
@@ -40501,14 +40542,15 @@ const inputTypeComponent = {
|
|
|
40501
40542
|
setFormValues(formsValue);
|
|
40502
40543
|
}
|
|
40503
40544
|
}
|
|
40504
|
-
});
|
|
40545
|
+
}));
|
|
40505
40546
|
},
|
|
40506
|
-
total100:
|
|
40507
|
-
|
|
40508
|
-
|
|
40509
|
-
|
|
40510
|
-
|
|
40511
|
-
|
|
40547
|
+
total100: _ref23 => {
|
|
40548
|
+
let {
|
|
40549
|
+
props,
|
|
40550
|
+
name,
|
|
40551
|
+
options,
|
|
40552
|
+
value
|
|
40553
|
+
} = _ref23;
|
|
40512
40554
|
value = value ? Array.isArray(value) ? value : [value] : [];
|
|
40513
40555
|
function totalValue() {
|
|
40514
40556
|
let total = 0;
|
|
@@ -40532,10 +40574,11 @@ const inputTypeComponent = {
|
|
|
40532
40574
|
className: "total100",
|
|
40533
40575
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.List, {
|
|
40534
40576
|
name: name,
|
|
40535
|
-
children: (fields, {
|
|
40536
|
-
|
|
40537
|
-
|
|
40538
|
-
|
|
40577
|
+
children: (fields, _ref24) => {
|
|
40578
|
+
let {
|
|
40579
|
+
add,
|
|
40580
|
+
remove
|
|
40581
|
+
} = _ref24;
|
|
40539
40582
|
if (fields.length === 0) {
|
|
40540
40583
|
const formData = value || [];
|
|
40541
40584
|
if (formData.length) {
|
|
@@ -40554,26 +40597,26 @@ const inputTypeComponent = {
|
|
|
40554
40597
|
const v = value[field.name];
|
|
40555
40598
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Space, {
|
|
40556
40599
|
className: "total",
|
|
40557
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
40558
|
-
noStyle: true
|
|
40559
|
-
|
|
40600
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
|
|
40601
|
+
noStyle: true
|
|
40602
|
+
}, field), {}, {
|
|
40560
40603
|
name: [field.name, "type"],
|
|
40561
40604
|
fieldKey: [field.fieldKey, "type"],
|
|
40562
40605
|
initialValue: v.type,
|
|
40563
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, {
|
|
40606
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Select, _objectSpread2(_objectSpread2({
|
|
40564
40607
|
allowClear: true,
|
|
40565
40608
|
showSearch: true,
|
|
40566
40609
|
filterOption: filterSelectOptions,
|
|
40567
|
-
optionFilterProp: "children"
|
|
40568
|
-
|
|
40610
|
+
optionFilterProp: "children"
|
|
40611
|
+
}, props), {}, {
|
|
40569
40612
|
children: options.map((option, i) => /*#__PURE__*/jsxRuntime.jsx(antd.Select.Option, {
|
|
40570
40613
|
value: option.value,
|
|
40571
40614
|
children: option.label
|
|
40572
40615
|
}, i))
|
|
40573
|
-
})
|
|
40574
|
-
}), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
40575
|
-
noStyle: true
|
|
40576
|
-
|
|
40616
|
+
}))
|
|
40617
|
+
})), /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2({
|
|
40618
|
+
noStyle: true
|
|
40619
|
+
}, field), {}, {
|
|
40577
40620
|
name: [field.name, "value"],
|
|
40578
40621
|
fieldKey: [field.fieldKey, "value"],
|
|
40579
40622
|
initialValue: v.value,
|
|
@@ -40581,14 +40624,14 @@ const inputTypeComponent = {
|
|
|
40581
40624
|
allowClear: true,
|
|
40582
40625
|
name: "value",
|
|
40583
40626
|
formatter: value => {
|
|
40584
|
-
return value ?
|
|
40627
|
+
return value ? "".concat(value, "%") : "";
|
|
40585
40628
|
},
|
|
40586
40629
|
disabled: !v.type,
|
|
40587
40630
|
placeholder: props.valueplaceholder ? props.valueplaceholder : "Value",
|
|
40588
40631
|
min: 1,
|
|
40589
40632
|
max: 100 - siblingTotal(v.type)
|
|
40590
40633
|
})
|
|
40591
|
-
}), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
40634
|
+
})), fields.length - 1 === i ? /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
40592
40635
|
disabled: !v.value || !v.type || totalValue() >= 100,
|
|
40593
40636
|
type: "primary",
|
|
40594
40637
|
icon: /*#__PURE__*/jsxRuntime.jsx(Icons.PlusOutlined, {}),
|
|
@@ -40620,18 +40663,21 @@ const inputTypeComponent = {
|
|
|
40620
40663
|
}) : null]
|
|
40621
40664
|
});
|
|
40622
40665
|
},
|
|
40623
|
-
percentage: ({
|
|
40624
|
-
|
|
40625
|
-
|
|
40626
|
-
|
|
40627
|
-
|
|
40628
|
-
|
|
40629
|
-
|
|
40630
|
-
|
|
40631
|
-
|
|
40632
|
-
|
|
40633
|
-
|
|
40634
|
-
|
|
40666
|
+
percentage: (_ref25, _ref26) => {
|
|
40667
|
+
var _input$meta6;
|
|
40668
|
+
let {
|
|
40669
|
+
name,
|
|
40670
|
+
inputName,
|
|
40671
|
+
totalMax,
|
|
40672
|
+
repeatIndex,
|
|
40673
|
+
props,
|
|
40674
|
+
formsValue,
|
|
40675
|
+
input
|
|
40676
|
+
} = _ref25;
|
|
40677
|
+
let {
|
|
40678
|
+
inputMeta,
|
|
40679
|
+
t
|
|
40680
|
+
} = _ref26;
|
|
40635
40681
|
const isRepeatable = Array.isArray(formsValue[name]);
|
|
40636
40682
|
let totalSiblings = 0;
|
|
40637
40683
|
if (isRepeatable && totalMax) {
|
|
@@ -40639,15 +40685,15 @@ const inputTypeComponent = {
|
|
|
40639
40685
|
totl = totl + (grp[inputName] || 0);
|
|
40640
40686
|
return totl;
|
|
40641
40687
|
}, 0);
|
|
40642
|
-
} else if (Array.isArray(input
|
|
40688
|
+
} else if (Array.isArray(input === null || input === void 0 || (_input$meta6 = input.meta) === null || _input$meta6 === void 0 ? void 0 : _input$meta6.siblings)) {
|
|
40643
40689
|
totalSiblings = input.meta.siblings.reduce((totl, key) => {
|
|
40644
40690
|
totl = totl + (formsValue[key] || 0);
|
|
40645
40691
|
return totl;
|
|
40646
40692
|
}, 0);
|
|
40647
40693
|
}
|
|
40648
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, {
|
|
40649
|
-
allowClear: true
|
|
40650
|
-
|
|
40694
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.InputNumber, _objectSpread2(_objectSpread2({
|
|
40695
|
+
allowClear: true
|
|
40696
|
+
}, props), {}, {
|
|
40651
40697
|
style: {
|
|
40652
40698
|
width: "100%"
|
|
40653
40699
|
},
|
|
@@ -40656,33 +40702,36 @@ const inputTypeComponent = {
|
|
|
40656
40702
|
min: 0,
|
|
40657
40703
|
max: 100 - totalSiblings,
|
|
40658
40704
|
formatter: value => {
|
|
40659
|
-
return value ?
|
|
40705
|
+
return value ? "".concat(value) : "";
|
|
40660
40706
|
},
|
|
40661
40707
|
parser: value => value.replace("%", ""),
|
|
40662
40708
|
addonAfter: "%"
|
|
40663
|
-
});
|
|
40709
|
+
}));
|
|
40664
40710
|
},
|
|
40665
|
-
year:
|
|
40666
|
-
|
|
40667
|
-
|
|
40711
|
+
year: _ref27 => {
|
|
40712
|
+
let {
|
|
40713
|
+
props
|
|
40714
|
+
} = _ref27;
|
|
40668
40715
|
const lng = localStorage.getItem("datastakeLng") || "en";
|
|
40669
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, {
|
|
40716
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.DatePicker, _objectSpread2(_objectSpread2({
|
|
40670
40717
|
allowClear: true,
|
|
40671
40718
|
locale: lng === "fr" ? localeFr__default["default"] : localeEn__default["default"],
|
|
40672
|
-
picker: "year"
|
|
40673
|
-
|
|
40719
|
+
picker: "year"
|
|
40720
|
+
}, props), {}, {
|
|
40674
40721
|
format: "YYYY"
|
|
40675
|
-
});
|
|
40722
|
+
}));
|
|
40676
40723
|
},
|
|
40677
|
-
upload: ({
|
|
40678
|
-
|
|
40679
|
-
|
|
40680
|
-
|
|
40681
|
-
|
|
40682
|
-
|
|
40683
|
-
|
|
40684
|
-
|
|
40685
|
-
|
|
40724
|
+
upload: (_ref28, _ref29) => {
|
|
40725
|
+
let {
|
|
40726
|
+
rules,
|
|
40727
|
+
value
|
|
40728
|
+
} = _ref28;
|
|
40729
|
+
let {
|
|
40730
|
+
setLoading,
|
|
40731
|
+
t,
|
|
40732
|
+
getApiBaseUrl,
|
|
40733
|
+
getAppHeader
|
|
40734
|
+
} = _ref29;
|
|
40686
40735
|
const apiURL = getApiBaseUrl();
|
|
40687
40736
|
const accept = rules.length ? rules.find(rule => Object.keys(rule).includes("accept")).accept || "*" : null;
|
|
40688
40737
|
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) : []) || [];
|
|
@@ -40695,13 +40744,12 @@ const inputTypeComponent = {
|
|
|
40695
40744
|
}
|
|
40696
40745
|
}
|
|
40697
40746
|
const allowedExtensions = accept && accept !== "*" ? accept.split(",").map(ext => ext.trim().toLowerCase()) : [];
|
|
40698
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
40699
|
-
...maxProps,
|
|
40747
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({}, maxProps), {}, {
|
|
40700
40748
|
accept: accept,
|
|
40701
|
-
action:
|
|
40749
|
+
action: "".concat(apiURL, "/upload"),
|
|
40702
40750
|
beforeUpload: beforeUpload(allowedExtensions),
|
|
40703
40751
|
onChange: val => {
|
|
40704
|
-
if (val
|
|
40752
|
+
if (val !== null && val !== void 0 && val.file && typeof setLoading === "function") {
|
|
40705
40753
|
if (val.file.percent !== 100) {
|
|
40706
40754
|
setLoading(true);
|
|
40707
40755
|
} else {
|
|
@@ -40709,10 +40757,9 @@ const inputTypeComponent = {
|
|
|
40709
40757
|
}
|
|
40710
40758
|
}
|
|
40711
40759
|
},
|
|
40712
|
-
headers: {
|
|
40713
|
-
Authorization:
|
|
40714
|
-
|
|
40715
|
-
},
|
|
40760
|
+
headers: _objectSpread2({
|
|
40761
|
+
Authorization: "Bearer ".concat(getToken())
|
|
40762
|
+
}, getAppHeader()),
|
|
40716
40763
|
defaultFileList: values,
|
|
40717
40764
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
40718
40765
|
style: {
|
|
@@ -40722,17 +40769,19 @@ const inputTypeComponent = {
|
|
|
40722
40769
|
children: t("Upload")
|
|
40723
40770
|
})]
|
|
40724
40771
|
})
|
|
40725
|
-
});
|
|
40772
|
+
}));
|
|
40726
40773
|
},
|
|
40727
|
-
imageUpload: ({
|
|
40728
|
-
|
|
40729
|
-
|
|
40730
|
-
|
|
40731
|
-
|
|
40732
|
-
|
|
40733
|
-
|
|
40734
|
-
|
|
40735
|
-
|
|
40774
|
+
imageUpload: (_ref30, _ref31) => {
|
|
40775
|
+
let {
|
|
40776
|
+
rules,
|
|
40777
|
+
value
|
|
40778
|
+
} = _ref30;
|
|
40779
|
+
let {
|
|
40780
|
+
setLoading,
|
|
40781
|
+
getApiBaseUrl,
|
|
40782
|
+
getAppHeader,
|
|
40783
|
+
t
|
|
40784
|
+
} = _ref31;
|
|
40736
40785
|
const apiURL = getApiBaseUrl();
|
|
40737
40786
|
const values = getImageUploadEditValue(value);
|
|
40738
40787
|
const maxRule = rules.find(r => r.max);
|
|
@@ -40743,17 +40792,17 @@ const inputTypeComponent = {
|
|
|
40743
40792
|
maxProps.multiple = true;
|
|
40744
40793
|
}
|
|
40745
40794
|
}
|
|
40746
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
40747
|
-
...maxProps,
|
|
40795
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({}, maxProps), {}, {
|
|
40748
40796
|
beforeUpload: beforeUpload(allowedImageExtensions),
|
|
40749
40797
|
accept: "image/*",
|
|
40750
40798
|
classList: !values || !values.length ? "empty" : "",
|
|
40751
40799
|
listType: "picture",
|
|
40752
|
-
action:
|
|
40800
|
+
action: "".concat(apiURL, "/upload"),
|
|
40753
40801
|
onChange: val => {
|
|
40754
40802
|
if (typeof setLoading === "function") {
|
|
40755
|
-
if (val
|
|
40756
|
-
|
|
40803
|
+
if (val !== null && val !== void 0 && val.file) {
|
|
40804
|
+
var _val$file;
|
|
40805
|
+
if ((val === null || val === void 0 || (_val$file = val.file) === null || _val$file === void 0 ? void 0 : _val$file.status) === "removed") {
|
|
40757
40806
|
setLoading(false);
|
|
40758
40807
|
return;
|
|
40759
40808
|
}
|
|
@@ -40765,10 +40814,9 @@ const inputTypeComponent = {
|
|
|
40765
40814
|
setLoading(false);
|
|
40766
40815
|
}
|
|
40767
40816
|
},
|
|
40768
|
-
headers: {
|
|
40769
|
-
Authorization:
|
|
40770
|
-
|
|
40771
|
-
},
|
|
40817
|
+
headers: _objectSpread2({
|
|
40818
|
+
Authorization: "Bearer ".concat(getToken())
|
|
40819
|
+
}, getAppHeader()),
|
|
40772
40820
|
defaultFileList: values,
|
|
40773
40821
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
40774
40822
|
style: {
|
|
@@ -40778,17 +40826,19 @@ const inputTypeComponent = {
|
|
|
40778
40826
|
children: t("Upload")
|
|
40779
40827
|
})]
|
|
40780
40828
|
})
|
|
40781
|
-
});
|
|
40829
|
+
}));
|
|
40782
40830
|
},
|
|
40783
|
-
videoUpload: ({
|
|
40784
|
-
|
|
40785
|
-
|
|
40786
|
-
|
|
40787
|
-
|
|
40788
|
-
|
|
40789
|
-
|
|
40790
|
-
|
|
40791
|
-
|
|
40831
|
+
videoUpload: (_ref32, _ref33) => {
|
|
40832
|
+
let {
|
|
40833
|
+
rules,
|
|
40834
|
+
value
|
|
40835
|
+
} = _ref32;
|
|
40836
|
+
let {
|
|
40837
|
+
setLoading = () => {},
|
|
40838
|
+
getApiBaseUrl,
|
|
40839
|
+
getAppHeader,
|
|
40840
|
+
t
|
|
40841
|
+
} = _ref33;
|
|
40792
40842
|
const apiURL = getApiBaseUrl();
|
|
40793
40843
|
const values = getImageUploadEditValue(value);
|
|
40794
40844
|
const maxRule = rules.find(r => r.max);
|
|
@@ -40799,21 +40849,25 @@ const inputTypeComponent = {
|
|
|
40799
40849
|
maxProps.multiple = true;
|
|
40800
40850
|
}
|
|
40801
40851
|
}
|
|
40802
|
-
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, {
|
|
40803
|
-
itemRender: (item, fileList) =>
|
|
40804
|
-
|
|
40805
|
-
|
|
40806
|
-
|
|
40807
|
-
|
|
40808
|
-
|
|
40852
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Upload, _objectSpread2(_objectSpread2({
|
|
40853
|
+
itemRender: (item, fileList) => {
|
|
40854
|
+
var _fileList$response;
|
|
40855
|
+
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
40856
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(EditVideoPreview, {
|
|
40857
|
+
url: (fileList === null || fileList === void 0 || (_fileList$response = fileList.response) === null || _fileList$response === void 0 ? void 0 : _fileList$response.url) || (fileList === null || fileList === void 0 ? void 0 : fileList.url)
|
|
40858
|
+
}), item]
|
|
40859
|
+
});
|
|
40860
|
+
}
|
|
40861
|
+
}, maxProps), {}, {
|
|
40809
40862
|
accept: "video/*",
|
|
40810
40863
|
classList: !values || !values.length ? "empty" : "",
|
|
40811
40864
|
listType: "picture",
|
|
40812
|
-
action:
|
|
40865
|
+
action: "".concat(apiURL, "/upload"),
|
|
40813
40866
|
onChange: val => {
|
|
40814
40867
|
if (typeof setLoading === "function") {
|
|
40815
|
-
if (val
|
|
40816
|
-
|
|
40868
|
+
if (val !== null && val !== void 0 && val.file) {
|
|
40869
|
+
var _val$file2;
|
|
40870
|
+
if ((val === null || val === void 0 || (_val$file2 = val.file) === null || _val$file2 === void 0 ? void 0 : _val$file2.status) === "removed") {
|
|
40817
40871
|
setLoading(false);
|
|
40818
40872
|
return;
|
|
40819
40873
|
}
|
|
@@ -40825,10 +40879,9 @@ const inputTypeComponent = {
|
|
|
40825
40879
|
setLoading(false);
|
|
40826
40880
|
}
|
|
40827
40881
|
},
|
|
40828
|
-
headers: {
|
|
40829
|
-
Authorization:
|
|
40830
|
-
|
|
40831
|
-
},
|
|
40882
|
+
headers: _objectSpread2({
|
|
40883
|
+
Authorization: "Bearer ".concat(getToken())
|
|
40884
|
+
}, getAppHeader()),
|
|
40832
40885
|
defaultFileList: values,
|
|
40833
40886
|
children: /*#__PURE__*/jsxRuntime.jsxs(antd.Button, {
|
|
40834
40887
|
style: {
|
|
@@ -40838,17 +40891,19 @@ const inputTypeComponent = {
|
|
|
40838
40891
|
children: t("Upload")
|
|
40839
40892
|
})]
|
|
40840
40893
|
})
|
|
40841
|
-
});
|
|
40894
|
+
}));
|
|
40842
40895
|
},
|
|
40843
|
-
geolocation: ({
|
|
40844
|
-
|
|
40845
|
-
|
|
40846
|
-
|
|
40847
|
-
|
|
40848
|
-
|
|
40849
|
-
|
|
40850
|
-
|
|
40851
|
-
|
|
40896
|
+
geolocation: (_ref34, _ref35) => {
|
|
40897
|
+
let {
|
|
40898
|
+
value,
|
|
40899
|
+
name,
|
|
40900
|
+
formsValue,
|
|
40901
|
+
addressData,
|
|
40902
|
+
props
|
|
40903
|
+
} = _ref34;
|
|
40904
|
+
let {
|
|
40905
|
+
inputMeta
|
|
40906
|
+
} = _ref35;
|
|
40852
40907
|
let search = formsValue.country;
|
|
40853
40908
|
if (addressData && Object.keys(addressData).length > 0) {
|
|
40854
40909
|
const country = countriesList.countries[formsValue.country] || {};
|
|
@@ -40856,10 +40911,10 @@ const inputTypeComponent = {
|
|
|
40856
40911
|
search = addressData.country;
|
|
40857
40912
|
}
|
|
40858
40913
|
if (addressData.level1) {
|
|
40859
|
-
search =
|
|
40914
|
+
search = "".concat(addressData.level1, ", ").concat(addressData.country || country.name);
|
|
40860
40915
|
}
|
|
40861
40916
|
if (addressData.level2) {
|
|
40862
|
-
search =
|
|
40917
|
+
search = "".concat(addressData.level2, ", ").concat(addressData.level1, ", ").concat(addressData.country || country.name);
|
|
40863
40918
|
}
|
|
40864
40919
|
} else {
|
|
40865
40920
|
const country = countriesList.countries[formsValue.country] || {};
|
|
@@ -40867,10 +40922,10 @@ const inputTypeComponent = {
|
|
|
40867
40922
|
search = country.name;
|
|
40868
40923
|
}
|
|
40869
40924
|
if (formsValue.administrativeLevel1Name) {
|
|
40870
|
-
search =
|
|
40925
|
+
search = "".concat(search, " ").concat(formsValue.administrativeLevel1Name);
|
|
40871
40926
|
}
|
|
40872
40927
|
if (formsValue.administrativeLevel2Name) {
|
|
40873
|
-
search =
|
|
40928
|
+
search = "".concat(search, " ").concat(formsValue.administrativeLevel2Name);
|
|
40874
40929
|
}
|
|
40875
40930
|
}
|
|
40876
40931
|
return /*#__PURE__*/jsxRuntime.jsx(Geolocation, {
|
|
@@ -40883,33 +40938,35 @@ const inputTypeComponent = {
|
|
|
40883
40938
|
searchValue: search
|
|
40884
40939
|
});
|
|
40885
40940
|
},
|
|
40886
|
-
ajaxSelect: ({
|
|
40887
|
-
|
|
40888
|
-
|
|
40889
|
-
|
|
40890
|
-
|
|
40891
|
-
|
|
40892
|
-
|
|
40893
|
-
|
|
40894
|
-
|
|
40895
|
-
|
|
40896
|
-
|
|
40897
|
-
|
|
40898
|
-
|
|
40899
|
-
|
|
40900
|
-
|
|
40901
|
-
|
|
40902
|
-
|
|
40903
|
-
|
|
40904
|
-
|
|
40905
|
-
|
|
40906
|
-
|
|
40907
|
-
|
|
40908
|
-
|
|
40909
|
-
|
|
40910
|
-
|
|
40911
|
-
|
|
40912
|
-
|
|
40941
|
+
ajaxSelect: (_ref36, _ref37) => {
|
|
40942
|
+
let {
|
|
40943
|
+
call,
|
|
40944
|
+
automaticallyLink,
|
|
40945
|
+
name,
|
|
40946
|
+
preSelected,
|
|
40947
|
+
inputName,
|
|
40948
|
+
props,
|
|
40949
|
+
formsValue,
|
|
40950
|
+
onNewSetValue,
|
|
40951
|
+
multiple,
|
|
40952
|
+
updateOptions,
|
|
40953
|
+
repeatValues,
|
|
40954
|
+
repeatIndex,
|
|
40955
|
+
value,
|
|
40956
|
+
unique,
|
|
40957
|
+
address,
|
|
40958
|
+
addressData = {},
|
|
40959
|
+
input
|
|
40960
|
+
} = _ref36;
|
|
40961
|
+
let {
|
|
40962
|
+
form,
|
|
40963
|
+
forms,
|
|
40964
|
+
setAddress,
|
|
40965
|
+
changeInputMeta,
|
|
40966
|
+
inputMeta = {},
|
|
40967
|
+
meta,
|
|
40968
|
+
setFormValues
|
|
40969
|
+
} = _ref37;
|
|
40913
40970
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect, {
|
|
40914
40971
|
preSelected: preSelected,
|
|
40915
40972
|
input: input,
|
|
@@ -40945,40 +41002,41 @@ const inputTypeComponent = {
|
|
|
40945
41002
|
const selectedValue = data.find(v => v.value === ev);
|
|
40946
41003
|
if (address && selectedValue) {
|
|
40947
41004
|
dot__default["default"].str(address, selectedValue.label, addressData);
|
|
40948
|
-
setAddress({
|
|
40949
|
-
...addressData
|
|
40950
|
-
});
|
|
41005
|
+
setAddress(_objectSpread2({}, addressData));
|
|
40951
41006
|
}
|
|
40952
41007
|
}
|
|
40953
41008
|
},
|
|
40954
41009
|
setAddress: setAddress
|
|
40955
41010
|
});
|
|
40956
41011
|
},
|
|
40957
|
-
tag:
|
|
40958
|
-
|
|
40959
|
-
|
|
40960
|
-
|
|
41012
|
+
tag: _ref38 => {
|
|
41013
|
+
let {
|
|
41014
|
+
value,
|
|
41015
|
+
repeatLabel
|
|
41016
|
+
} = _ref38;
|
|
40961
41017
|
return /*#__PURE__*/jsxRuntime.jsx(TagInput$1, {
|
|
40962
41018
|
allowClear: true,
|
|
40963
41019
|
value: value || [],
|
|
40964
41020
|
newPlaceholder: repeatLabel
|
|
40965
41021
|
});
|
|
40966
41022
|
},
|
|
40967
|
-
modal: ({
|
|
40968
|
-
|
|
40969
|
-
|
|
40970
|
-
|
|
40971
|
-
|
|
40972
|
-
|
|
40973
|
-
|
|
40974
|
-
|
|
40975
|
-
|
|
40976
|
-
|
|
40977
|
-
|
|
40978
|
-
|
|
40979
|
-
|
|
40980
|
-
|
|
40981
|
-
|
|
41023
|
+
modal: (_ref39, _ref40) => {
|
|
41024
|
+
let {
|
|
41025
|
+
call,
|
|
41026
|
+
automaticallyLink,
|
|
41027
|
+
name,
|
|
41028
|
+
inputName,
|
|
41029
|
+
props,
|
|
41030
|
+
formsValue,
|
|
41031
|
+
onNewSetValue,
|
|
41032
|
+
repeatValues,
|
|
41033
|
+
repeatIndex,
|
|
41034
|
+
value,
|
|
41035
|
+
modalTitle
|
|
41036
|
+
} = _ref39;
|
|
41037
|
+
let {
|
|
41038
|
+
form
|
|
41039
|
+
} = _ref40;
|
|
40982
41040
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxModal$2, {
|
|
40983
41041
|
allowClear: true,
|
|
40984
41042
|
call: call,
|
|
@@ -40996,63 +41054,69 @@ const inputTypeComponent = {
|
|
|
40996
41054
|
buttonText: modalTitle
|
|
40997
41055
|
});
|
|
40998
41056
|
},
|
|
40999
|
-
website: ({
|
|
41000
|
-
|
|
41001
|
-
|
|
41002
|
-
|
|
41003
|
-
|
|
41004
|
-
|
|
41005
|
-
|
|
41006
|
-
|
|
41007
|
-
|
|
41008
|
-
|
|
41009
|
-
|
|
41010
|
-
|
|
41011
|
-
|
|
41012
|
-
|
|
41057
|
+
website: (_ref41, _ref42) => {
|
|
41058
|
+
let {
|
|
41059
|
+
name,
|
|
41060
|
+
inputName,
|
|
41061
|
+
props,
|
|
41062
|
+
value,
|
|
41063
|
+
repeatIndex,
|
|
41064
|
+
repeatValues,
|
|
41065
|
+
formsValue
|
|
41066
|
+
} = _ref41;
|
|
41067
|
+
let {
|
|
41068
|
+
form,
|
|
41069
|
+
inputMeta = {},
|
|
41070
|
+
t
|
|
41071
|
+
} = _ref42;
|
|
41072
|
+
return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
|
|
41013
41073
|
allowClear: true,
|
|
41014
41074
|
initialValue: value,
|
|
41015
|
-
t: t
|
|
41016
|
-
|
|
41075
|
+
t: t
|
|
41076
|
+
}, props), {}, {
|
|
41017
41077
|
onChange: val => updateFormValues(repeatIndex, repeatValues, inputName, val, formsValue, name, form),
|
|
41018
41078
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
41019
41079
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com"
|
|
41020
|
-
});
|
|
41080
|
+
}));
|
|
41021
41081
|
},
|
|
41022
|
-
dataLink: ({
|
|
41023
|
-
|
|
41024
|
-
|
|
41025
|
-
|
|
41026
|
-
|
|
41027
|
-
|
|
41028
|
-
|
|
41029
|
-
|
|
41030
|
-
|
|
41031
|
-
|
|
41032
|
-
|
|
41033
|
-
|
|
41034
|
-
|
|
41035
|
-
|
|
41036
|
-
|
|
41037
|
-
|
|
41038
|
-
|
|
41039
|
-
|
|
41040
|
-
|
|
41041
|
-
|
|
41042
|
-
|
|
41043
|
-
|
|
41044
|
-
|
|
41045
|
-
|
|
41046
|
-
|
|
41047
|
-
|
|
41048
|
-
|
|
41049
|
-
|
|
41050
|
-
|
|
41051
|
-
|
|
41052
|
-
|
|
41053
|
-
|
|
41054
|
-
|
|
41055
|
-
|
|
41082
|
+
dataLink: (_ref43, _ref44) => {
|
|
41083
|
+
var _input$meta7, _input$meta10, _formsValue$meta, _input$meta11;
|
|
41084
|
+
let {
|
|
41085
|
+
setValues,
|
|
41086
|
+
name,
|
|
41087
|
+
onValuesChange,
|
|
41088
|
+
formsValue,
|
|
41089
|
+
input,
|
|
41090
|
+
changeLinking,
|
|
41091
|
+
call,
|
|
41092
|
+
automaticallyLink,
|
|
41093
|
+
inputName,
|
|
41094
|
+
props,
|
|
41095
|
+
onNewSetValue,
|
|
41096
|
+
multiple,
|
|
41097
|
+
updateOptions,
|
|
41098
|
+
repeatValues,
|
|
41099
|
+
repeatIndex,
|
|
41100
|
+
value,
|
|
41101
|
+
unique,
|
|
41102
|
+
address,
|
|
41103
|
+
addressData = {},
|
|
41104
|
+
getFromLinking
|
|
41105
|
+
} = _ref43;
|
|
41106
|
+
let {
|
|
41107
|
+
form,
|
|
41108
|
+
groupFormId,
|
|
41109
|
+
setAddress,
|
|
41110
|
+
isHighlighted,
|
|
41111
|
+
changeInputMeta,
|
|
41112
|
+
meta,
|
|
41113
|
+
inputMeta,
|
|
41114
|
+
forms
|
|
41115
|
+
} = _ref44;
|
|
41116
|
+
if ((input === null || input === void 0 || (_input$meta7 = input.meta) === null || _input$meta7 === void 0 || (_input$meta7 = _input$meta7.optionsView) === null || _input$meta7 === void 0 ? void 0 : _input$meta7.editInputType) === "ajaxSelect") {
|
|
41117
|
+
var _formsValue$groupForm, _input$meta8, _input$meta9;
|
|
41118
|
+
const currentValue = groupFormId ? (_formsValue$groupForm = formsValue[groupFormId]) === null || _formsValue$groupForm === void 0 ? void 0 : _formsValue$groupForm[name] : formsValue[name];
|
|
41119
|
+
(input === null || input === void 0 || (_input$meta8 = input.meta) === null || _input$meta8 === void 0 || (_input$meta8 = _input$meta8.optionsView) === null || _input$meta8 === void 0 ? void 0 : _input$meta8.call) || (input === null || input === void 0 || (_input$meta9 = input.meta) === null || _input$meta9 === void 0 ? void 0 : _input$meta9.call) || "default::list()::::";
|
|
41056
41120
|
return /*#__PURE__*/jsxRuntime.jsx(AjaxSelect$1, {
|
|
41057
41121
|
size: "medium",
|
|
41058
41122
|
input: input,
|
|
@@ -41089,9 +41153,7 @@ const inputTypeComponent = {
|
|
|
41089
41153
|
const selectedValue = data.find(v => v.value === ev);
|
|
41090
41154
|
if (address && selectedValue) {
|
|
41091
41155
|
dot__default["default"].str(address, selectedValue.label, addressData);
|
|
41092
|
-
setAddress({
|
|
41093
|
-
...addressData
|
|
41094
|
-
});
|
|
41156
|
+
setAddress(_objectSpread2({}, addressData));
|
|
41095
41157
|
}
|
|
41096
41158
|
}
|
|
41097
41159
|
},
|
|
@@ -41101,188 +41163,149 @@ const inputTypeComponent = {
|
|
|
41101
41163
|
isDataLink: true
|
|
41102
41164
|
});
|
|
41103
41165
|
}
|
|
41104
|
-
const isSingle = input
|
|
41105
|
-
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [{
|
|
41106
|
-
...(formsValue[groupFormId] || {})[name]
|
|
41107
|
-
}] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => ({
|
|
41108
|
-
...v
|
|
41109
|
-
})) : isSingle ? formsValue[name] ? [{
|
|
41110
|
-
...formsValue[name]
|
|
41111
|
-
}] : [] : (formsValue[name] || []).map(v => ({
|
|
41112
|
-
...v
|
|
41113
|
-
}));
|
|
41166
|
+
const isSingle = (input === null || input === void 0 || (_input$meta10 = input.meta) === null || _input$meta10 === void 0 ? void 0 : _input$meta10.maxRepeat) === 1;
|
|
41167
|
+
const formData = groupFormId ? isSingle ? (formsValue[groupFormId] || {})[name] ? [_objectSpread2({}, (formsValue[groupFormId] || {})[name])] : [] : getArray((formsValue[groupFormId] || {})[name] || []).map(v => _objectSpread2({}, v)) : isSingle ? formsValue[name] ? [_objectSpread2({}, formsValue[name])] : [] : (formsValue[name] || []).map(v => _objectSpread2({}, v));
|
|
41114
41168
|
const onUpdate = (val, i) => {
|
|
41115
41169
|
const _val = isSingle ? {
|
|
41116
41170
|
[name]: val
|
|
41117
41171
|
} : {
|
|
41118
|
-
[name]: formData
|
|
41172
|
+
[name]: formData === null || formData === void 0 ? void 0 : formData.map((d, j) => i === j ? val : d)
|
|
41119
41173
|
};
|
|
41120
41174
|
if (groupFormId) {
|
|
41121
|
-
const _defaultData = form
|
|
41122
|
-
const _newData = {
|
|
41123
|
-
|
|
41124
|
-
..._val
|
|
41125
|
-
};
|
|
41126
|
-
onValuesChange(_newData, {
|
|
41127
|
-
...formsValue,
|
|
41175
|
+
const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
|
|
41176
|
+
const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
|
|
41177
|
+
onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
41128
41178
|
[groupFormId]: _newData
|
|
41129
|
-
});
|
|
41130
|
-
form
|
|
41131
|
-
setValues({
|
|
41132
|
-
...formsValue,
|
|
41179
|
+
}));
|
|
41180
|
+
form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
|
|
41181
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
41133
41182
|
[groupFormId]: _newData
|
|
41134
|
-
});
|
|
41183
|
+
}));
|
|
41135
41184
|
return;
|
|
41136
41185
|
}
|
|
41137
|
-
onValuesChange(_val, {
|
|
41138
|
-
|
|
41139
|
-
|
|
41140
|
-
});
|
|
41141
|
-
form?.setFieldValue(name, _val[name]);
|
|
41142
|
-
setValues({
|
|
41143
|
-
...formsValue,
|
|
41144
|
-
..._val
|
|
41145
|
-
});
|
|
41186
|
+
onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
41187
|
+
form === null || form === void 0 || form.setFieldValue(name, _val[name]);
|
|
41188
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
41146
41189
|
};
|
|
41147
41190
|
return /*#__PURE__*/jsxRuntime.jsx(DataLink, {
|
|
41148
41191
|
form: input,
|
|
41149
41192
|
formsValue: formsValue,
|
|
41150
41193
|
onUpdate: onUpdate,
|
|
41151
41194
|
isHighlighted: isHighlighted,
|
|
41152
|
-
values: groupFormId ? {
|
|
41153
|
-
...(formsValue[groupFormId] || {}),
|
|
41195
|
+
values: groupFormId ? _objectSpread2(_objectSpread2({}, formsValue[groupFormId] || {}), {}, {
|
|
41154
41196
|
meta: {
|
|
41155
|
-
inputs: (formsValue
|
|
41197
|
+
inputs: ((formsValue === null || formsValue === void 0 || (_formsValue$meta = formsValue.meta) === null || _formsValue$meta === void 0 ? void 0 : _formsValue$meta.inputs) || {})[groupFormId]
|
|
41156
41198
|
}
|
|
41157
|
-
} : formsValue,
|
|
41199
|
+
}) : formsValue,
|
|
41158
41200
|
name: name,
|
|
41159
41201
|
groupFormId: groupFormId,
|
|
41160
|
-
maxRepeat: input
|
|
41161
|
-
remove:
|
|
41162
|
-
|
|
41163
|
-
|
|
41202
|
+
maxRepeat: input === null || input === void 0 || (_input$meta11 = input.meta) === null || _input$meta11 === void 0 ? void 0 : _input$meta11.maxRepeat,
|
|
41203
|
+
remove: _ref45 => {
|
|
41204
|
+
let {
|
|
41205
|
+
key
|
|
41206
|
+
} = _ref45;
|
|
41164
41207
|
const _val = isSingle ? {
|
|
41165
41208
|
[name]: null
|
|
41166
41209
|
} : {
|
|
41167
41210
|
[name]: formData.filter((v, i) => i !== key)
|
|
41168
41211
|
};
|
|
41169
41212
|
if (groupFormId) {
|
|
41170
|
-
const _defaultData = form
|
|
41171
|
-
const _newData = {
|
|
41172
|
-
|
|
41173
|
-
..._val
|
|
41174
|
-
};
|
|
41175
|
-
onValuesChange(_newData, {
|
|
41176
|
-
...formsValue,
|
|
41213
|
+
const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
|
|
41214
|
+
const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
|
|
41215
|
+
onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
41177
41216
|
[groupFormId]: _newData
|
|
41178
|
-
});
|
|
41179
|
-
form
|
|
41180
|
-
setValues({
|
|
41181
|
-
...formsValue,
|
|
41217
|
+
}));
|
|
41218
|
+
form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
|
|
41219
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
41182
41220
|
[groupFormId]: _newData
|
|
41183
|
-
});
|
|
41221
|
+
}));
|
|
41184
41222
|
return;
|
|
41185
41223
|
}
|
|
41186
|
-
onValuesChange(_val, {
|
|
41187
|
-
|
|
41188
|
-
|
|
41189
|
-
});
|
|
41190
|
-
form?.setFieldValue(name, _val[name]);
|
|
41191
|
-
setValues({
|
|
41192
|
-
...formsValue,
|
|
41193
|
-
..._val
|
|
41194
|
-
});
|
|
41224
|
+
onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
41225
|
+
form === null || form === void 0 || form.setFieldValue(name, _val[name]);
|
|
41226
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
41195
41227
|
},
|
|
41196
41228
|
add: val => {
|
|
41197
41229
|
const _val = isSingle ? {
|
|
41198
41230
|
[name]: val
|
|
41199
41231
|
} : {
|
|
41200
|
-
[name]: [...formData, {
|
|
41201
|
-
...val
|
|
41202
|
-
}]
|
|
41232
|
+
[name]: [...formData, _objectSpread2({}, val)]
|
|
41203
41233
|
};
|
|
41204
41234
|
if (groupFormId) {
|
|
41205
|
-
const _defaultData = form
|
|
41206
|
-
const _newData = {
|
|
41207
|
-
|
|
41208
|
-
|
|
41209
|
-
};
|
|
41210
|
-
form?.setFieldValue(groupFormId, _newData);
|
|
41211
|
-
onValuesChange(_newData, {
|
|
41212
|
-
...formsValue,
|
|
41235
|
+
const _defaultData = (form === null || form === void 0 ? void 0 : form.getFieldValue(groupFormId)) || {};
|
|
41236
|
+
const _newData = _objectSpread2(_objectSpread2({}, _defaultData), _val);
|
|
41237
|
+
form === null || form === void 0 || form.setFieldValue(groupFormId, _newData);
|
|
41238
|
+
onValuesChange(_newData, _objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
41213
41239
|
[groupFormId]: _newData
|
|
41214
|
-
});
|
|
41215
|
-
setValues({
|
|
41216
|
-
...formsValue,
|
|
41240
|
+
}));
|
|
41241
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), {}, {
|
|
41217
41242
|
[groupFormId]: _newData
|
|
41218
|
-
});
|
|
41243
|
+
}));
|
|
41219
41244
|
return;
|
|
41220
41245
|
}
|
|
41221
|
-
form
|
|
41222
|
-
onValuesChange(_val, {
|
|
41223
|
-
|
|
41224
|
-
..._val
|
|
41225
|
-
});
|
|
41226
|
-
setValues({
|
|
41227
|
-
...formsValue,
|
|
41228
|
-
..._val
|
|
41229
|
-
});
|
|
41246
|
+
form === null || form === void 0 || form.setFieldValue(name, _val[name]);
|
|
41247
|
+
onValuesChange(_val, _objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
41248
|
+
setValues(_objectSpread2(_objectSpread2({}, formsValue), _val));
|
|
41230
41249
|
},
|
|
41231
41250
|
k: name,
|
|
41232
41251
|
formData: formData
|
|
41233
41252
|
});
|
|
41234
41253
|
},
|
|
41235
|
-
internallink: ({
|
|
41236
|
-
|
|
41237
|
-
|
|
41238
|
-
|
|
41239
|
-
|
|
41240
|
-
|
|
41241
|
-
|
|
41242
|
-
|
|
41243
|
-
|
|
41244
|
-
|
|
41245
|
-
|
|
41246
|
-
|
|
41247
|
-
|
|
41248
|
-
|
|
41254
|
+
internallink: (_ref46, _ref47) => {
|
|
41255
|
+
let {
|
|
41256
|
+
name,
|
|
41257
|
+
inputName,
|
|
41258
|
+
props,
|
|
41259
|
+
value,
|
|
41260
|
+
repeatIndex,
|
|
41261
|
+
repeatValues,
|
|
41262
|
+
formsValue
|
|
41263
|
+
} = _ref46;
|
|
41264
|
+
let {
|
|
41265
|
+
form,
|
|
41266
|
+
inputMeta = {},
|
|
41267
|
+
t
|
|
41268
|
+
} = _ref47;
|
|
41269
|
+
return /*#__PURE__*/jsxRuntime.jsx(Website, _objectSpread2(_objectSpread2({
|
|
41249
41270
|
allowClear: true,
|
|
41250
41271
|
disabled: props.disabled || inputMeta.notApplicable || inputMeta.notAvailable,
|
|
41251
41272
|
placeholder: getMetaPlaceholer(inputMeta, t) || props.placeholder || "www.example.com",
|
|
41252
|
-
initialValue: value
|
|
41253
|
-
|
|
41273
|
+
initialValue: value
|
|
41274
|
+
}, props), {}, {
|
|
41254
41275
|
onChange: val => updateFormValues(repeatIndex, repeatValues, inputName, val, formsValue, name, form)
|
|
41255
|
-
});
|
|
41276
|
+
}));
|
|
41256
41277
|
},
|
|
41257
|
-
group:
|
|
41258
|
-
|
|
41259
|
-
|
|
41260
|
-
|
|
41261
|
-
|
|
41262
|
-
|
|
41263
|
-
|
|
41264
|
-
});
|
|
41278
|
+
group: _ref48 => {
|
|
41279
|
+
let {
|
|
41280
|
+
props,
|
|
41281
|
+
groupInputs
|
|
41282
|
+
} = _ref48;
|
|
41283
|
+
return /*#__PURE__*/jsxRuntime.jsx(GroupInput$1, _objectSpread2({
|
|
41284
|
+
groupInputs: groupInputs
|
|
41285
|
+
}, props));
|
|
41265
41286
|
},
|
|
41266
|
-
groupInputs: ({
|
|
41267
|
-
|
|
41268
|
-
|
|
41269
|
-
|
|
41270
|
-
|
|
41271
|
-
|
|
41272
|
-
|
|
41287
|
+
groupInputs: (_ref49, _ref50) => {
|
|
41288
|
+
let {
|
|
41289
|
+
props,
|
|
41290
|
+
groupInputs
|
|
41291
|
+
} = _ref49;
|
|
41292
|
+
let {
|
|
41293
|
+
inputMeta
|
|
41294
|
+
} = _ref50;
|
|
41295
|
+
return /*#__PURE__*/jsxRuntime.jsx(GroupInput$1, _objectSpread2({
|
|
41273
41296
|
groupInputs: groupInputs,
|
|
41274
|
-
inputMeta: inputMeta
|
|
41275
|
-
|
|
41276
|
-
});
|
|
41297
|
+
inputMeta: inputMeta
|
|
41298
|
+
}, props));
|
|
41277
41299
|
},
|
|
41278
|
-
radioGroup:
|
|
41279
|
-
|
|
41280
|
-
|
|
41281
|
-
|
|
41282
|
-
|
|
41283
|
-
|
|
41284
|
-
|
|
41285
|
-
|
|
41300
|
+
radioGroup: _ref51 => {
|
|
41301
|
+
let {
|
|
41302
|
+
props,
|
|
41303
|
+
value,
|
|
41304
|
+
options
|
|
41305
|
+
} = _ref51;
|
|
41306
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Radio.Group, _objectSpread2(_objectSpread2({
|
|
41307
|
+
value: value
|
|
41308
|
+
}, props), {}, {
|
|
41286
41309
|
children: (options || []).map(o => {
|
|
41287
41310
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Radio, {
|
|
41288
41311
|
value: o.value,
|
|
@@ -41295,16 +41318,17 @@ const inputTypeComponent = {
|
|
|
41295
41318
|
}) : null]
|
|
41296
41319
|
}, o.value);
|
|
41297
41320
|
})
|
|
41298
|
-
});
|
|
41321
|
+
}));
|
|
41299
41322
|
},
|
|
41300
|
-
checkboxGroup:
|
|
41301
|
-
|
|
41302
|
-
|
|
41303
|
-
|
|
41304
|
-
|
|
41305
|
-
|
|
41306
|
-
|
|
41307
|
-
|
|
41323
|
+
checkboxGroup: _ref52 => {
|
|
41324
|
+
let {
|
|
41325
|
+
props,
|
|
41326
|
+
value,
|
|
41327
|
+
options
|
|
41328
|
+
} = _ref52;
|
|
41329
|
+
return /*#__PURE__*/jsxRuntime.jsx(antd.Checkbox.Group, _objectSpread2(_objectSpread2({
|
|
41330
|
+
value: value
|
|
41331
|
+
}, props), {}, {
|
|
41308
41332
|
children: (options || []).map(o => {
|
|
41309
41333
|
return /*#__PURE__*/jsxRuntime.jsxs(antd.Checkbox, {
|
|
41310
41334
|
value: o.value,
|
|
@@ -41317,28 +41341,30 @@ const inputTypeComponent = {
|
|
|
41317
41341
|
}) : null]
|
|
41318
41342
|
}, o.value);
|
|
41319
41343
|
})
|
|
41320
|
-
});
|
|
41344
|
+
}));
|
|
41321
41345
|
}
|
|
41322
41346
|
};
|
|
41323
|
-
const GetFormItem =
|
|
41324
|
-
|
|
41325
|
-
|
|
41326
|
-
|
|
41327
|
-
|
|
41328
|
-
|
|
41329
|
-
|
|
41330
|
-
|
|
41331
|
-
|
|
41332
|
-
|
|
41333
|
-
|
|
41334
|
-
|
|
41335
|
-
|
|
41336
|
-
|
|
41337
|
-
|
|
41338
|
-
|
|
41339
|
-
|
|
41340
|
-
|
|
41341
|
-
|
|
41347
|
+
const GetFormItem = _ref53 => {
|
|
41348
|
+
var _find, _input$meta12, _input$meta13, _input$meta14, _input$meta15, _input$meta16, _input$meta17, _input$meta18, _inputData$value, _input$meta19, _input$meta20, _inputData$commentVal;
|
|
41349
|
+
let {
|
|
41350
|
+
code,
|
|
41351
|
+
inputData,
|
|
41352
|
+
inputId,
|
|
41353
|
+
input,
|
|
41354
|
+
setLoading,
|
|
41355
|
+
values,
|
|
41356
|
+
MainForm,
|
|
41357
|
+
options,
|
|
41358
|
+
plainForms,
|
|
41359
|
+
setValues,
|
|
41360
|
+
alertError,
|
|
41361
|
+
setAddress,
|
|
41362
|
+
inputMeta = {},
|
|
41363
|
+
inputKey,
|
|
41364
|
+
changeInputMeta = () => {},
|
|
41365
|
+
i,
|
|
41366
|
+
isCreate = false
|
|
41367
|
+
} = _ref53;
|
|
41342
41368
|
const {
|
|
41343
41369
|
t,
|
|
41344
41370
|
getAppHeader,
|
|
@@ -41354,7 +41380,7 @@ const GetFormItem = ({
|
|
|
41354
41380
|
case "h6":
|
|
41355
41381
|
return getInputHeadLines(input.type, i, input, values);
|
|
41356
41382
|
default:
|
|
41357
|
-
const rules = inputMeta
|
|
41383
|
+
const rules = inputMeta !== null && inputMeta !== void 0 && inputMeta.notApplicable || inputMeta !== null && inputMeta !== void 0 && inputMeta.notAvailable ? [] : inputData.rules ? inputData.rules.filter(rule => !Object.keys(rule).includes("accept") && !Object.keys(rule).includes("max")) : [];
|
|
41358
41384
|
const requiredRule = rules.find(r => r.required);
|
|
41359
41385
|
if (requiredRule && input.type === "text") {
|
|
41360
41386
|
rules.push({
|
|
@@ -41363,47 +41389,45 @@ const GetFormItem = ({
|
|
|
41363
41389
|
});
|
|
41364
41390
|
}
|
|
41365
41391
|
const noLabel = ["message"].includes(input.type);
|
|
41366
|
-
let maxRule = (inputData
|
|
41392
|
+
let maxRule = (_find = ((inputData === null || inputData === void 0 ? void 0 : inputData.rules) || []).find(rule => rule.max)) === null || _find === void 0 ? void 0 : _find.max;
|
|
41367
41393
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
41368
41394
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41369
41395
|
className: "flex input-cont",
|
|
41370
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
41371
|
-
initialValue: inputMeta
|
|
41372
|
-
|
|
41373
|
-
|
|
41374
|
-
|
|
41375
|
-
|
|
41376
|
-
|
|
41377
|
-
|
|
41378
|
-
|
|
41379
|
-
|
|
41380
|
-
|
|
41381
|
-
return e;
|
|
41382
|
-
}
|
|
41383
|
-
return e && e.fileList && e.fileList.map(f => {
|
|
41384
|
-
if (f.response) {
|
|
41385
|
-
return f.response;
|
|
41386
|
-
}
|
|
41387
|
-
return f;
|
|
41388
|
-
});
|
|
41396
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, _objectSpread2(_objectSpread2(_objectSpread2(_objectSpread2({
|
|
41397
|
+
initialValue: inputMeta === null || inputMeta === void 0 ? void 0 : inputMeta.defaultValue
|
|
41398
|
+
}, ["total100", "group"].includes(input.type) ? {} : {
|
|
41399
|
+
name: inputId,
|
|
41400
|
+
fieldKey: inputId,
|
|
41401
|
+
initialValue: inputData.value
|
|
41402
|
+
}), ["upload", "imageUpload", "videoUpload"].includes(input.type) ? {
|
|
41403
|
+
valuePropName: "fileList",
|
|
41404
|
+
getValueFromEvent: e => {
|
|
41405
|
+
if (Array.isArray(e)) {
|
|
41406
|
+
return e;
|
|
41389
41407
|
}
|
|
41390
|
-
|
|
41408
|
+
return e && e.fileList && e.fileList.map(f => {
|
|
41409
|
+
if (f.response) {
|
|
41410
|
+
return f.response;
|
|
41411
|
+
}
|
|
41412
|
+
return f;
|
|
41413
|
+
});
|
|
41414
|
+
}
|
|
41415
|
+
} : {}), {}, {
|
|
41391
41416
|
style: input.showOnView === false ? {
|
|
41392
41417
|
display: "none"
|
|
41393
|
-
} : {}
|
|
41394
|
-
|
|
41395
|
-
|
|
41396
|
-
|
|
41397
|
-
|
|
41398
|
-
|
|
41399
|
-
|
|
41400
|
-
|
|
41401
|
-
|
|
41402
|
-
|
|
41403
|
-
|
|
41404
|
-
|
|
41405
|
-
|
|
41406
|
-
className: input.comment ? `flex-1 with-comment i-${input.type}` : `i-${input.type} flex-1`,
|
|
41418
|
+
} : {}
|
|
41419
|
+
}, ["switch"].includes(input.type) ? {
|
|
41420
|
+
labelCol: {
|
|
41421
|
+
span: 20
|
|
41422
|
+
},
|
|
41423
|
+
style: _objectSpread2(_objectSpread2({}, input.showOnView === false ? {
|
|
41424
|
+
display: "none"
|
|
41425
|
+
} : {}), {}, {
|
|
41426
|
+
flexDirection: "row",
|
|
41427
|
+
justifyContent: "space-between"
|
|
41428
|
+
})
|
|
41429
|
+
} : {}), {}, {
|
|
41430
|
+
className: input.comment ? "flex-1 with-comment i-".concat(input.type) : "i-".concat(input.type, " flex-1"),
|
|
41407
41431
|
"data-id": inputData.name,
|
|
41408
41432
|
rules: rules,
|
|
41409
41433
|
required: inputData.rules && inputData.rules instanceof Array && inputData.rules.filter(r => r.required).length > 0 ? true : false
|
|
@@ -41414,8 +41438,8 @@ const GetFormItem = ({
|
|
|
41414
41438
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41415
41439
|
className: "mr-1",
|
|
41416
41440
|
children: getInputLabel(input, values)
|
|
41417
|
-
}), !!input
|
|
41418
|
-
title: input
|
|
41441
|
+
}), !!(input !== null && input !== void 0 && (_input$meta12 = input.meta) !== null && _input$meta12 !== void 0 && _input$meta12.tooltip) && /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
41442
|
+
title: input === null || input === void 0 || (_input$meta13 = input.meta) === null || _input$meta13 === void 0 ? void 0 : _input$meta13.tooltip,
|
|
41419
41443
|
trigger: "hover",
|
|
41420
41444
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41421
41445
|
className: "flex flex-column justify-content-center",
|
|
@@ -41433,7 +41457,7 @@ const GetFormItem = ({
|
|
|
41433
41457
|
title: t("Not applicable"),
|
|
41434
41458
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41435
41459
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
41436
|
-
disabled: !input
|
|
41460
|
+
disabled: !(input !== null && input !== void 0 && (_input$meta14 = input.meta) !== null && _input$meta14 !== void 0 && _input$meta14.notApplicable),
|
|
41437
41461
|
className: formatClassname(["default p-0", inputMeta.notApplicable && "primary"]),
|
|
41438
41462
|
type: "link",
|
|
41439
41463
|
onClick: () => {
|
|
@@ -41468,7 +41492,7 @@ const GetFormItem = ({
|
|
|
41468
41492
|
title: t("No available information"),
|
|
41469
41493
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41470
41494
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
41471
|
-
disabled: !input
|
|
41495
|
+
disabled: !(input !== null && input !== void 0 && (_input$meta15 = input.meta) !== null && _input$meta15 !== void 0 && _input$meta15.notAvailable),
|
|
41472
41496
|
className: formatClassname(["default p-0", inputMeta.notAvailable && "primary"]),
|
|
41473
41497
|
type: "link",
|
|
41474
41498
|
onClick: () => {
|
|
@@ -41502,14 +41526,14 @@ const GetFormItem = ({
|
|
|
41502
41526
|
}), /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
41503
41527
|
title: t("Add comment"),
|
|
41504
41528
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41505
|
-
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
41529
|
+
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, _objectSpread2(_objectSpread2({
|
|
41506
41530
|
type: "link",
|
|
41507
|
-
disabled: !input
|
|
41508
|
-
|
|
41509
|
-
|
|
41510
|
-
|
|
41511
|
-
|
|
41512
|
-
|
|
41531
|
+
disabled: !(input !== null && input !== void 0 && (_input$meta16 = input.meta) !== null && _input$meta16 !== void 0 && _input$meta16.comment)
|
|
41532
|
+
}, !isShown ? {
|
|
41533
|
+
className: "default p-0"
|
|
41534
|
+
} : {
|
|
41535
|
+
className: "p-0 primary"
|
|
41536
|
+
}), {}, {
|
|
41513
41537
|
onClick: () => {
|
|
41514
41538
|
setIsShown(true);
|
|
41515
41539
|
changeInputMeta({
|
|
@@ -41525,18 +41549,18 @@ const GetFormItem = ({
|
|
|
41525
41549
|
width: 16,
|
|
41526
41550
|
height: 16
|
|
41527
41551
|
})
|
|
41528
|
-
})
|
|
41552
|
+
}))
|
|
41529
41553
|
})
|
|
41530
41554
|
})]
|
|
41531
|
-
}), input.meta
|
|
41555
|
+
}), (_input$meta17 = input.meta) !== null && _input$meta17 !== void 0 && _input$meta17.code ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41532
41556
|
className: "code",
|
|
41533
41557
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
41534
|
-
children: input.meta
|
|
41558
|
+
children: (_input$meta18 = input.meta) === null || _input$meta18 === void 0 ? void 0 : _input$meta18.code
|
|
41535
41559
|
})
|
|
41536
41560
|
}) : code ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
41537
41561
|
className: "code",
|
|
41538
41562
|
children: /*#__PURE__*/jsxRuntime.jsx("span", {
|
|
41539
|
-
children:
|
|
41563
|
+
children: "".concat(code, ".").concat(i + 1)
|
|
41540
41564
|
})
|
|
41541
41565
|
}) : null]
|
|
41542
41566
|
})
|
|
@@ -41556,7 +41580,7 @@ const GetFormItem = ({
|
|
|
41556
41580
|
getAppHeader,
|
|
41557
41581
|
getApiBaseUrl
|
|
41558
41582
|
}) : console.log(input)
|
|
41559
|
-
})
|
|
41583
|
+
}))
|
|
41560
41584
|
}), alertError ? /*#__PURE__*/jsxRuntime.jsx(antd.Alert, {
|
|
41561
41585
|
message: alertError.message,
|
|
41562
41586
|
type: "error",
|
|
@@ -41585,10 +41609,10 @@ const GetFormItem = ({
|
|
|
41585
41609
|
className: "max-char-span",
|
|
41586
41610
|
children: t("max-char", {
|
|
41587
41611
|
chars: maxRule,
|
|
41588
|
-
filled: inputData
|
|
41612
|
+
filled: (inputData === null || inputData === void 0 || (_inputData$value = inputData.value) === null || _inputData$value === void 0 ? void 0 : _inputData$value.length) || 0
|
|
41589
41613
|
})
|
|
41590
41614
|
})
|
|
41591
|
-
}) : null, input.meta
|
|
41615
|
+
}) : null, (_input$meta19 = input.meta) !== null && _input$meta19 !== void 0 && _input$meta19.comment && isShown ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
41592
41616
|
className: "input-content dynamic-form-comment",
|
|
41593
41617
|
children: [/*#__PURE__*/jsxRuntime.jsx(antd.Form.Item, {
|
|
41594
41618
|
className: "comment-textarea",
|
|
@@ -41614,7 +41638,7 @@ const GetFormItem = ({
|
|
|
41614
41638
|
},
|
|
41615
41639
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Button, {
|
|
41616
41640
|
type: "link",
|
|
41617
|
-
disabled: !input.meta
|
|
41641
|
+
disabled: !((_input$meta20 = input.meta) !== null && _input$meta20 !== void 0 && _input$meta20.comment),
|
|
41618
41642
|
className: "p-0",
|
|
41619
41643
|
children: /*#__PURE__*/jsxRuntime.jsx(Icons.DeleteOutlined, {
|
|
41620
41644
|
width: 16,
|
|
@@ -41645,7 +41669,7 @@ const GetFormItem = ({
|
|
|
41645
41669
|
className: "max-char-span",
|
|
41646
41670
|
children: t("max-char", {
|
|
41647
41671
|
chars: MAX_COMMENTS_LENGTH,
|
|
41648
|
-
filled: inputData
|
|
41672
|
+
filled: (inputData === null || inputData === void 0 || (_inputData$commentVal = inputData.commentValue) === null || _inputData$commentVal === void 0 ? void 0 : _inputData$commentVal.length) || 0
|
|
41649
41673
|
})
|
|
41650
41674
|
})]
|
|
41651
41675
|
}) : null]
|
|
@@ -42020,7 +42044,7 @@ const getGrouContent = (form, values, i, formId, excludedKeys, getData, setValue
|
|
|
42020
42044
|
});
|
|
42021
42045
|
};
|
|
42022
42046
|
|
|
42023
|
-
const useCombinedPrefilledValues = (combinedPrefilledValues, values, parentValues, setValues, MainForm) => {
|
|
42047
|
+
const useCombinedPrefilledValues = (combinedPrefilledValues, values, parentValues, setValues, MainForm, form) => {
|
|
42024
42048
|
const combinedValuesRef = React.useRef({});
|
|
42025
42049
|
React.useEffect(() => {
|
|
42026
42050
|
if (!combinedPrefilledValues || Object.keys(combinedPrefilledValues).length === 0) {
|
|
@@ -42030,7 +42054,7 @@ const useCombinedPrefilledValues = (combinedPrefilledValues, values, parentValue
|
|
|
42030
42054
|
let hasChanges = false;
|
|
42031
42055
|
Object.keys(combinedPrefilledValues).forEach(fieldKey => {
|
|
42032
42056
|
const template = combinedPrefilledValues[fieldKey];
|
|
42033
|
-
const resolvedValue = resolveCombinedPrefilledValue(template, values, parentValues);
|
|
42057
|
+
const resolvedValue = resolveCombinedPrefilledValue(template, values, parentValues, form);
|
|
42034
42058
|
if (resolvedValue === null) {
|
|
42035
42059
|
return;
|
|
42036
42060
|
}
|
|
@@ -42209,7 +42233,7 @@ function DynamicForm(_ref) {
|
|
|
42209
42233
|
}, [data, isCreate]);
|
|
42210
42234
|
|
|
42211
42235
|
// Handle combined prefilled values (auto-fill based on templates)
|
|
42212
|
-
useCombinedPrefilledValues(combinedPrefilledValues, values, parentValues, setValues, MainForm);
|
|
42236
|
+
useCombinedPrefilledValues(combinedPrefilledValues, values, parentValues, setValues, MainForm, form);
|
|
42213
42237
|
|
|
42214
42238
|
// Initialize default values for hidden and disabled fields
|
|
42215
42239
|
React.useEffect(() => {
|
|
@@ -50893,6 +50917,7 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
|
|
|
50893
50917
|
getViewport,
|
|
50894
50918
|
fitView
|
|
50895
50919
|
} = react.useReactFlow();
|
|
50920
|
+
const hasInitialFitRef = React.useRef(false);
|
|
50896
50921
|
const nodesToFit = React.useMemo(() => {
|
|
50897
50922
|
let result;
|
|
50898
50923
|
if (mandatoryNodesToFit) {
|
|
@@ -50903,27 +50928,29 @@ const BaseGraph = /*#__PURE__*/React.forwardRef(function BaseGraph({
|
|
|
50903
50928
|
return result;
|
|
50904
50929
|
}, [nodes.length, mandatoryNodesToFit?.length, mandatoryNodesToFit]);
|
|
50905
50930
|
|
|
50906
|
-
//
|
|
50931
|
+
// Only auto-fit on initial render or when node count changes, not on property changes
|
|
50907
50932
|
React.useEffect(() => {
|
|
50908
50933
|
if (nodesToFit.length === 0) return;
|
|
50909
50934
|
|
|
50910
|
-
//
|
|
50911
|
-
|
|
50912
|
-
|
|
50913
|
-
|
|
50914
|
-
|
|
50915
|
-
|
|
50916
|
-
|
|
50917
|
-
|
|
50918
|
-
|
|
50919
|
-
|
|
50920
|
-
|
|
50921
|
-
|
|
50935
|
+
// Only auto-fit on initial render or when node count changes
|
|
50936
|
+
if (!hasInitialFitRef.current) {
|
|
50937
|
+
hasInitialFitRef.current = true;
|
|
50938
|
+
const timer = setTimeout(() => {
|
|
50939
|
+
fitView({
|
|
50940
|
+
padding: 0.4,
|
|
50941
|
+
nodes: [...nodesToFit],
|
|
50942
|
+
maxZoom: 0.9
|
|
50943
|
+
});
|
|
50944
|
+
}, 100);
|
|
50945
|
+
return () => clearTimeout(timer);
|
|
50946
|
+
}
|
|
50947
|
+
}, [nodesToFit.length, withDuration]);
|
|
50922
50948
|
return /*#__PURE__*/jsxRuntime.jsx(ComponentWithFocus, {
|
|
50923
50949
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
50924
50950
|
style: {
|
|
50925
50951
|
height: "100%",
|
|
50926
|
-
width: "100%"
|
|
50952
|
+
width: "100%",
|
|
50953
|
+
position: "relative"
|
|
50927
50954
|
},
|
|
50928
50955
|
ref: ref,
|
|
50929
50956
|
children: [filtersConfig ? /*#__PURE__*/jsxRuntime.jsx(Filters, {
|
|
@@ -51152,8 +51179,7 @@ function TradeRelationship(_ref) {
|
|
|
51152
51179
|
filtersConfig,
|
|
51153
51180
|
onFilterChange = () => {},
|
|
51154
51181
|
renderTooltipItems = () => [],
|
|
51155
|
-
getTotal = () => 0
|
|
51156
|
-
onRenderComplete = () => {}
|
|
51182
|
+
getTotal = () => 0
|
|
51157
51183
|
} = _ref;
|
|
51158
51184
|
const reactFlowWrapper = React.useRef(null);
|
|
51159
51185
|
const [nodes, setNodes] = react.useNodesState([]);
|
|
@@ -51166,27 +51192,6 @@ function TradeRelationship(_ref) {
|
|
|
51166
51192
|
const [activeNode, setActiveNode] = React.useState(null);
|
|
51167
51193
|
// const [initCenter, setInitCenter] = useState(true);
|
|
51168
51194
|
const [associatedNodes, setAssociatedNodes] = React.useState(null);
|
|
51169
|
-
const isFullyRenderedRef = React.useRef(false);
|
|
51170
|
-
const [isFullyRendered, setIsFullyRendered] = React.useState(false);
|
|
51171
|
-
React.useEffect(() => {
|
|
51172
|
-
isFullyRenderedRef.current = false;
|
|
51173
|
-
setIsFullyRendered(false);
|
|
51174
|
-
setActiveNode(null);
|
|
51175
|
-
}, [data]);
|
|
51176
|
-
React.useEffect(() => {
|
|
51177
|
-
if (nodes.length > 0 && edges.length > 0 && !isFullyRenderedRef.current) {
|
|
51178
|
-
const timeoutId = setTimeout(() => {
|
|
51179
|
-
isFullyRenderedRef.current = true;
|
|
51180
|
-
setIsFullyRendered(true);
|
|
51181
|
-
onRenderComplete(true);
|
|
51182
|
-
}, 200);
|
|
51183
|
-
return () => clearTimeout(timeoutId);
|
|
51184
|
-
}
|
|
51185
|
-
if (nodes.length === 0 || edges.length === 0) {
|
|
51186
|
-
setIsFullyRendered(true);
|
|
51187
|
-
onRenderComplete(true);
|
|
51188
|
-
}
|
|
51189
|
-
}, [nodes.length, edges.length, associatedNodes]);
|
|
51190
51195
|
React.useEffect(() => {
|
|
51191
51196
|
setActiveNode(null);
|
|
51192
51197
|
}, [data]);
|
|
@@ -51373,7 +51378,7 @@ function TradeRelationship(_ref) {
|
|
|
51373
51378
|
|
|
51374
51379
|
// Cleanup to prevent memory leaks if component unmounts quickly
|
|
51375
51380
|
return () => clearTimeout(timeoutId);
|
|
51376
|
-
}, [data
|
|
51381
|
+
}, [data]);
|
|
51377
51382
|
React.useEffect(() => {
|
|
51378
51383
|
if (activeNode) {
|
|
51379
51384
|
let _associatedNodesRight = [activeNode];
|