datastake-daf 0.6.775 → 0.6.776
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/index.js +244 -297
- package/dist/hooks/index.js +0 -72
- package/dist/pages/index.js +223 -271
- package/dist/utils/index.js +0 -13
- package/package.json +1 -1
- package/src/@daf/core/components/Dashboard/Map/ChainIcon/Markers/StakeholderMarker.js +76 -8
- package/src/@daf/core/components/Dashboard/Map/ChainIcon/index.js +8 -116
- package/src/@daf/core/components/Dashboard/Map/ChainIcon/utils.js +17 -73
- package/src/@daf/core/components/Dashboard/Map/helper.js +0 -1
- package/src/@daf/core/components/Dashboard/Map/hook.js +29 -53
- package/src/@daf/core/components/Dashboard/Map/style.js +5 -20
- package/src/@daf/utils/object.js +1 -3
- package/src/hooks.js +1 -2
- package/src/utils.js +1 -1
package/dist/components/index.js
CHANGED
|
@@ -6623,8 +6623,8 @@ Pagination.propTypes = {
|
|
|
6623
6623
|
isMobile: PropTypes__default["default"].bool
|
|
6624
6624
|
};
|
|
6625
6625
|
|
|
6626
|
-
var _templateObject$
|
|
6627
|
-
const Style$T = styled__default["default"].div(_templateObject$
|
|
6626
|
+
var _templateObject$g;
|
|
6627
|
+
const Style$T = styled__default["default"].div(_templateObject$g || (_templateObject$g = _taggedTemplateLiteral(["\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n\n\t.p-placeholder {\n\t\tposition: absolute;\n\t\ttop: 0px;\n\t\tleft: 0px;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tbackground: transparent;\n\t\tz-index: 100;\n\t}\n"])));
|
|
6628
6628
|
|
|
6629
6629
|
/**
|
|
6630
6630
|
* ComponentWithFocus
|
|
@@ -6696,7 +6696,7 @@ function ComponentWithFocus(_ref) {
|
|
|
6696
6696
|
});
|
|
6697
6697
|
}
|
|
6698
6698
|
|
|
6699
|
-
var _templateObject$
|
|
6699
|
+
var _templateObject$f;
|
|
6700
6700
|
const _excluded$x = ["size", "maxHeight", "containerHeight", "dataSource", "columns", "pagination", "doEmptyRows"];
|
|
6701
6701
|
function StickyTable(_ref) {
|
|
6702
6702
|
let {
|
|
@@ -6754,7 +6754,7 @@ function StickyTable(_ref) {
|
|
|
6754
6754
|
})
|
|
6755
6755
|
});
|
|
6756
6756
|
}
|
|
6757
|
-
const Style$S = styled__default["default"].div(_templateObject$
|
|
6757
|
+
const Style$S = styled__default["default"].div(_templateObject$f || (_templateObject$f = _taggedTemplateLiteral(["\n\tmax-width: calc(100% - 48px);\n\tmargin-left: var(--size-lg);\n\toverflow: hidden;\n\n\t.daf-table {\n\t\tpadding: 0px;\n\t\tmargin-top: 0px;\n\n\t\t.ant-tag {\n\t\t\ttext-align: center;\n\t\t}\n\t}\n\n\t.daf-select-filters .filters {\n\t\tpadding-top: 16px;\n\t\tpadding-left: 0;\n\t\tpadding-right: 0;\n\t}\n\n\t.daf-table {\n\t\tpadding-top: 16px;\n\t}\n"])));
|
|
6758
6758
|
StickyTable.propTypes = {
|
|
6759
6759
|
size: PropTypes__default["default"].any,
|
|
6760
6760
|
maxHeight: PropTypes__default["default"].number,
|
|
@@ -7380,7 +7380,7 @@ const BorderedButton = _ref => {
|
|
|
7380
7380
|
});
|
|
7381
7381
|
};
|
|
7382
7382
|
|
|
7383
|
-
var _templateObject$
|
|
7383
|
+
var _templateObject$e;
|
|
7384
7384
|
const variantConfig = {
|
|
7385
7385
|
default: {
|
|
7386
7386
|
className: "default-badge",
|
|
@@ -7498,7 +7498,7 @@ function Badge(_ref) {
|
|
|
7498
7498
|
})
|
|
7499
7499
|
});
|
|
7500
7500
|
}
|
|
7501
|
-
const Style$Q = styled__default["default"].div(_templateObject$
|
|
7501
|
+
const Style$Q = styled__default["default"].div(_templateObject$e || (_templateObject$e = _taggedTemplateLiteral(["\n\tdisplay: inline-flex;\n\talign-items: center;\n\tjustify-content: center;\n\tgap: 4px;\n\tpadding: 4px;\n\tmax-width: 100%;\n\n\toverflow: hidden;\n\twhite-space: nowrap;\n\ttext-overflow: ellipsis;\n\n\t> svg {\n\t\tflex-shrink: 0;\n\t}\n\n\t> span {\n\t\tall: unset;\n\t\tmargin-left: 4px;\n\t\tfont-weight: 600;\n\t\tfont-size: 12px;\n\n\t\toverflow: hidden;\n\t\ttext-overflow: ellipsis;\n\t\twhite-space: nowrap;\n\t\tdisplay: block;\n\t\tmax-width: 100%;\n\t}\n"])));
|
|
7502
7502
|
Badge.propTypes = {
|
|
7503
7503
|
children: PropTypes__default["default"].node,
|
|
7504
7504
|
className: PropTypes__default["default"].string,
|
|
@@ -8814,8 +8814,8 @@ const useFooter = _ref => {
|
|
|
8814
8814
|
};
|
|
8815
8815
|
};
|
|
8816
8816
|
|
|
8817
|
-
var _templateObject$
|
|
8818
|
-
const FooterContainer = styled__default["default"].div(_templateObject$
|
|
8817
|
+
var _templateObject$d;
|
|
8818
|
+
const FooterContainer = styled__default["default"].div(_templateObject$d || (_templateObject$d = _taggedTemplateLiteral(["\n\t.daf-footer {\n\t\tbackground: #ffffff;\n\t\tborder-top: 1px solid #e8e8e8;\n\t\tborder-left: none;\n\t\tborder-right: none;\n\t\tborder-bottom: none;\n\t\tborder-radius: 0;\n\t\tpadding: 24px;\n\t\tmargin: 0;\n\t\tbox-shadow: none;\n\t\tz-index: 100;\n\t\tposition: relative;\n\t\tmin-height: 80px;\n\n\t\t&.daf-footer-fixed {\n\t\t\tposition: fixed;\n\t\t\tbottom: 0;\n\t\t\tleft: 0;\n\t\t\tright: 0;\n\t\t\tz-index: 1000;\n\t\t}\n\n\t\t.daf-footer-content {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t\tjustify-content: space-between;\n\t\t\twidth: 100%;\n\t\t\tmin-height: 32px;\n\n\t\t\t.daf-footer-left {\n\t\t\t\tflex: 1;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: flex-start;\n\t\t\t}\n\n\t\t\t.daf-footer-center {\n\t\t\t\tflex: 1;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: center;\n\t\t\t}\n\n\t\t\t.daf-footer-right {\n\t\t\t\tflex: 1;\n\t\t\t\tdisplay: flex;\n\t\t\t\talign-items: center;\n\t\t\t\tjustify-content: flex-end;\n\t\t\t\tgap: 12px;\n\n\t\t\t\t.daf-footer-actions {\n\t\t\t\t\t.ant-btn {\n\t\t\t\t\t\theight: 40px;\n\t\t\t\t\t\tpadding: 0 24px;\n\t\t\t\t\t\tborder-radius: 6px;\n\t\t\t\t\t\tfont-weight: 500;\n\t\t\t\t\t\tfont-size: 14px;\n\t\t\t\t\t\ttransition: all 0.3s ease;\n\t\t\t\t\t\tborder: 1px solid transparent;\n\n\t\t\t\t\t\t&.ant-btn-primary {\n\t\t\t\t\t\t\tbackground-color: var(--color-primary-70);\n\t\t\t\t\t\t\tcolor: #ffffff;\n\t\t\t\t\t\t\tborder-color: var(--color-primary-70);\n\n\t\t\t\t\t\t\t&:hover {\n\t\t\t\t\t\t\t\tbackground-color: var(--color-primary-60);\n\t\t\t\t\t\t\t\tborder-color: var(--color-primary-60);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t&:active {\n\t\t\t\t\t\t\t\tbackground-color: var(--color-primary-80);\n\t\t\t\t\t\t\t\tborder-color: var(--color-primary-80);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t&:disabled {\n\t\t\t\t\t\t\t\tbackground-color: #f5f5f5;\n\t\t\t\t\t\t\t\tcolor: #bfbfbf;\n\t\t\t\t\t\t\t\tborder-color: #d9d9d9;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t&.ant-btn-default {\n\t\t\t\t\t\t\tbackground: #ffffff;\n\t\t\t\t\t\t\tcolor: #666666;\n\t\t\t\t\t\t\tborder-color: #d9d9d9;\n\n\t\t\t\t\t\t\t&:hover {\n\t\t\t\t\t\t\t\tborder-color: var(--color-primary-70);\n\t\t\t\t\t\t\t\tcolor: var(--color-primary-70);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t&:active {\n\t\t\t\t\t\t\t\tborder-color: var(--color-primary-80);\n\t\t\t\t\t\t\t\tcolor: var(--color-primary-80);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t&:disabled {\n\t\t\t\t\t\t\t\tbackground-color: #f5f5f5;\n\t\t\t\t\t\t\t\tcolor: #bfbfbf;\n\t\t\t\t\t\t\t\tborder-color: #d9d9d9;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t&.ant-btn-ghost {\n\t\t\t\t\t\t\tbackground: transparent;\n\t\t\t\t\t\t\tcolor: #666666;\n\t\t\t\t\t\t\tborder-color: #d9d9d9;\n\n\t\t\t\t\t\t\t&:hover {\n\t\t\t\t\t\t\t\tborder-color: var(--color-primary-70);\n\t\t\t\t\t\t\t\tcolor: var(--color-primary-70);\n\t\t\t\t\t\t\t\tbackground: rgba(0, 0, 0, 0.02);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t&:active {\n\t\t\t\t\t\t\t\tborder-color: var(--color-primary-80);\n\t\t\t\t\t\t\t\tcolor: var(--color-primary-80);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t&:disabled {\n\t\t\t\t\t\t\t\tcolor: #bfbfbf;\n\t\t\t\t\t\t\t\tborder-color: #d9d9d9;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/* Responsive design */\n\t@media (max-width: 768px) {\n\t\t.daf-footer {\n\t\t\tmargin: 0;\n\t\t\tpadding: 16px;\n\n\t\t\t.daf-footer-content {\n\t\t\t\tflex-direction: column;\n\t\t\t\tgap: 16px;\n\t\t\t\talign-items: stretch;\n\n\t\t\t\t.daf-footer-left,\n\t\t\t\t.daf-footer-center,\n\t\t\t\t.daf-footer-right {\n\t\t\t\t\tflex: none;\n\t\t\t\t\tjustify-content: center;\n\t\t\t\t}\n\n\t\t\t\t.daf-footer-right {\n\t\t\t\t\t.daf-footer-actions {\n\t\t\t\t\t\tjustify-content: center;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/* App-specific styling */\n\t&.sbg-app {\n\t\t.daf-footer {\n\t\t\tbackground: #f8f9fa;\n\t\t\tborder-color: #e9ecef;\n\t\t}\n\t}\n\n\t&.nashiriki-app {\n\t\t.daf-footer {\n\t\t\tbackground: #fff;\n\t\t\tborder-color: #d9d9d9;\n\t\t}\n\t}\n"])));
|
|
8819
8819
|
|
|
8820
8820
|
function DAFFooter(_ref) {
|
|
8821
8821
|
let {
|
|
@@ -11738,7 +11738,7 @@ function ImageWidget(_ref) {
|
|
|
11738
11738
|
}
|
|
11739
11739
|
ImageWidget.displayName = 'ImageWidget';
|
|
11740
11740
|
|
|
11741
|
-
var _templateObject$
|
|
11741
|
+
var _templateObject$c;
|
|
11742
11742
|
const _excluded$p = ["title", "loading", "data", "current", "defaultActiveTab", "widgetClassname", "className", "direction"];
|
|
11743
11743
|
function FlowWidget(_ref) {
|
|
11744
11744
|
let {
|
|
@@ -11888,7 +11888,7 @@ function Icon(_ref2) {
|
|
|
11888
11888
|
return icon(status);
|
|
11889
11889
|
}
|
|
11890
11890
|
}
|
|
11891
|
-
const Style$P = styled__default["default"].div(_templateObject$
|
|
11891
|
+
const Style$P = styled__default["default"].div(_templateObject$c || (_templateObject$c = _taggedTemplateLiteral(["\n\toverflow-x: auto;\n\toverflow-y: hidden;\n\n\t::-webkit-scrollbar {\n\t\tdisplay: none;\n\t}\n\n\tscrollbar-width: none;\n\n\t-ms-overflow-style: none;\n\n\t@media (max-width: 532px) {\n\t\toverflow-x: hidden;\n\t}\n\n\t:where(.ant-steps-horizontal):not(.ant-steps-label-vertical) {\n\t\t.ant-steps-item-content {\n\t\t\twidth: 100%;\n\n\t\t\t.ant-steps-item-description {\n\t\t\t\tmin-width: 205px;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t}\n\t}\n"])));
|
|
11892
11892
|
FlowWidget.propTypes = {
|
|
11893
11893
|
title: PropTypes__default["default"].string,
|
|
11894
11894
|
loading: PropTypes__default["default"].bool,
|
|
@@ -12296,7 +12296,7 @@ const NoMinWidth = styled__default["default"].div`
|
|
|
12296
12296
|
}
|
|
12297
12297
|
`;
|
|
12298
12298
|
|
|
12299
|
-
var _templateObject$
|
|
12299
|
+
var _templateObject$b;
|
|
12300
12300
|
function ActivityIndicatorsWidget(_ref) {
|
|
12301
12301
|
let {
|
|
12302
12302
|
t = s => s,
|
|
@@ -12431,7 +12431,7 @@ function renderStatus$1(configItem) {
|
|
|
12431
12431
|
});
|
|
12432
12432
|
}
|
|
12433
12433
|
}
|
|
12434
|
-
const StatusBadge = styled__default["default"].div(_templateObject$
|
|
12434
|
+
const StatusBadge = styled__default["default"].div(_templateObject$b || (_templateObject$b = _taggedTemplateLiteral(["\n\twidth: 24px;\n\theight: 24px;\n\tborder-radius: 50%;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tflex-shrink: 0;\n\n\t&.compliant {\n\t\tbackground-color: #ECFDF3;\n\t\tborder: 1px solid #A7F3D0;\n\t}\n\n\t&.not-compliant {\n\t\tbackground-color: #FEF3F2;\n\t\tborder: 1px solid #FECACA;\n\t}\n\n\t&.empty {\n\t\tbackground-color: #F9FAFB;\n\t\tborder: 1px solid #E5E7EB;\n\t}\n"])));
|
|
12435
12435
|
ActivityIndicatorsWidget.displayName = "ActivityIndicatorsWidget";
|
|
12436
12436
|
|
|
12437
12437
|
function TooltipIcon(_ref) {
|
|
@@ -12454,8 +12454,6 @@ const Style$M = styled__default["default"].div`
|
|
|
12454
12454
|
width: 100%;
|
|
12455
12455
|
height: 472px;
|
|
12456
12456
|
|
|
12457
|
-
|
|
12458
|
-
|
|
12459
12457
|
.filter-cont {
|
|
12460
12458
|
position: absolute;
|
|
12461
12459
|
top: 24px;
|
|
@@ -12558,24 +12556,11 @@ const Style$M = styled__default["default"].div`
|
|
|
12558
12556
|
align-items: center;
|
|
12559
12557
|
}
|
|
12560
12558
|
|
|
12561
|
-
|
|
12562
|
-
|
|
12563
|
-
|
|
12564
|
-
|
|
12565
|
-
|
|
12566
|
-
|
|
12567
|
-
.animated-polyline {
|
|
12568
|
-
stroke-dasharray: 10 10;
|
|
12569
|
-
animation: dash-flow 1.5s linear infinite;
|
|
12570
|
-
stroke-linecap: round;
|
|
12571
|
-
}
|
|
12572
|
-
|
|
12573
|
-
@keyframes dash-flow {
|
|
12574
|
-
to {
|
|
12575
|
-
stroke-dashoffset: -20;
|
|
12576
|
-
}
|
|
12577
|
-
}
|
|
12578
|
-
|
|
12559
|
+
.marker-chain {
|
|
12560
|
+
display: flex;
|
|
12561
|
+
align-items: center;
|
|
12562
|
+
justify-content: center;
|
|
12563
|
+
}
|
|
12579
12564
|
|
|
12580
12565
|
}
|
|
12581
12566
|
|
|
@@ -13021,15 +13006,18 @@ const VILLAGE = "village";
|
|
|
13021
13006
|
const EXPORTER = "exporter";
|
|
13022
13007
|
const PROCESSOR = "mineralProcessor";
|
|
13023
13008
|
const DEPOT = "depot";
|
|
13024
|
-
const OPERATOR = "miningOperator";
|
|
13025
13009
|
const MAX_EXTRA_SMALL_ZOOM_THRESHOLD = 2;
|
|
13026
13010
|
const MAX_SMALL_ZOOM_THRESHOLD = 3;
|
|
13027
13011
|
const MAX_MEDIUM_ZOOM_THRESHOLD = 6;
|
|
13028
13012
|
const LOCATION_TYPES = [MINE_SITE, VILLAGE];
|
|
13029
|
-
const STAKEHOLDER_TYPES = [EXPORTER, PROCESSOR, DEPOT
|
|
13013
|
+
const STAKEHOLDER_TYPES = [EXPORTER, PROCESSOR, DEPOT];
|
|
13030
13014
|
const RADIUS_SMALL = 15;
|
|
13031
13015
|
const RADIUS_MEDIUM = 35;
|
|
13032
13016
|
const RADIUS_LARGE = 60;
|
|
13017
|
+
const RADIUS_CURVE_SMALL = 10;
|
|
13018
|
+
const RADIUS_CURVE_MEDIUM = 15;
|
|
13019
|
+
const RADIUS_CURVE_LARGE = 20;
|
|
13020
|
+
const TENSION = 0.2;
|
|
13033
13021
|
function isLocation(type) {
|
|
13034
13022
|
return LOCATION_TYPES.includes(type);
|
|
13035
13023
|
}
|
|
@@ -13086,6 +13074,7 @@ function getStakeholderPosition({
|
|
|
13086
13074
|
const isLarge = isLargeMarker(zoom);
|
|
13087
13075
|
let radius;
|
|
13088
13076
|
let center = {
|
|
13077
|
+
// NOT BEING USED FOR NOW AND MAYBE NEVER
|
|
13089
13078
|
left: 0,
|
|
13090
13079
|
top: 0
|
|
13091
13080
|
};
|
|
@@ -13109,25 +13098,6 @@ function getStakeholderPosition({
|
|
|
13109
13098
|
angleDeg
|
|
13110
13099
|
};
|
|
13111
13100
|
}
|
|
13112
|
-
function applyAnimationDirect(el, isShortLink) {
|
|
13113
|
-
if (!(el instanceof SVGElement) || isShortLink) return;
|
|
13114
|
-
el.style.strokeDasharray = "10, 10";
|
|
13115
|
-
el.style.strokeDashoffset = "0";
|
|
13116
|
-
el.style.animation = "dash-flow 1.2s linear infinite";
|
|
13117
|
-
el.classList.add('animated-polyline');
|
|
13118
|
-
}
|
|
13119
|
-
function removeAnimationFromElement(element) {
|
|
13120
|
-
if (!element) return;
|
|
13121
|
-
element.classList.remove('animated-polyline');
|
|
13122
|
-
element.style.animation = '';
|
|
13123
|
-
element.style.strokeDasharray = '';
|
|
13124
|
-
}
|
|
13125
|
-
function applyAnimationToPolyline(polyline, isShortLink) {
|
|
13126
|
-
const element = polyline.getElement();
|
|
13127
|
-
if (element) {
|
|
13128
|
-
applyAnimationDirect(element, isShortLink);
|
|
13129
|
-
}
|
|
13130
|
-
}
|
|
13131
13101
|
function createPolyline({
|
|
13132
13102
|
L,
|
|
13133
13103
|
startLatLng,
|
|
@@ -13137,48 +13107,110 @@ function createPolyline({
|
|
|
13137
13107
|
zoom,
|
|
13138
13108
|
listOfPolylines = [],
|
|
13139
13109
|
isFromStakeholder = false,
|
|
13140
|
-
isForceOpen = false
|
|
13141
|
-
stakeholderType = null,
|
|
13142
|
-
animated = false,
|
|
13143
|
-
mapRef
|
|
13110
|
+
isForceOpen = false
|
|
13144
13111
|
}) {
|
|
13145
|
-
const
|
|
13146
|
-
const
|
|
13147
|
-
const
|
|
13148
|
-
const lineCoordinates = [[startLatLng.lat, startLatLng.lng], [endLatLng.lat, endLatLng.lng]];
|
|
13149
|
-
const polylineStyle = {
|
|
13112
|
+
const width = isFromStakeholder && isExtraSmallMarker(zoom) && !isForceOpen ? 0 : 1.2;
|
|
13113
|
+
const coordinates = [[startLatLng.lat, startLatLng.lng], [endLatLng.lat, endLatLng.lng]];
|
|
13114
|
+
const style = {
|
|
13150
13115
|
color: "var(--base-gray-70)",
|
|
13151
|
-
weight:
|
|
13152
|
-
opacity:
|
|
13153
|
-
smoothFactor:
|
|
13116
|
+
weight: width,
|
|
13117
|
+
opacity: 0.5,
|
|
13118
|
+
smoothFactor: 1,
|
|
13154
13119
|
id,
|
|
13155
|
-
dashArray:
|
|
13156
|
-
renderer: L.svg()
|
|
13120
|
+
dashArray: !isSelected ? "5, 5" : "0, 0"
|
|
13157
13121
|
};
|
|
13158
|
-
const
|
|
13159
|
-
if (
|
|
13160
|
-
|
|
13161
|
-
|
|
13162
|
-
|
|
13163
|
-
|
|
13164
|
-
|
|
13165
|
-
applyAnimationToPolyline(existingPolyline, isShortLink);
|
|
13166
|
-
});
|
|
13167
|
-
applyAnimationToPolyline(existingPolyline, isShortLink);
|
|
13168
|
-
}
|
|
13169
|
-
return existingPolyline;
|
|
13170
|
-
}
|
|
13171
|
-
const newPolyline = L.polyline(lineCoordinates, polylineStyle);
|
|
13172
|
-
newPolyline.addTo(mapRef);
|
|
13173
|
-
listOfPolylines.push(newPolyline);
|
|
13174
|
-
if (shouldAnimate && isSelected) {
|
|
13175
|
-
newPolyline.once('add', () => {
|
|
13176
|
-
applyAnimationToPolyline(newPolyline, isShortLink);
|
|
13177
|
-
});
|
|
13178
|
-
applyAnimationToPolyline(newPolyline, isShortLink);
|
|
13122
|
+
const newPolyline = L.polyline(coordinates, style);
|
|
13123
|
+
if (listOfPolylines.find(p => p.options.id === id)) {
|
|
13124
|
+
const polylineToUpdateCoordinates = listOfPolylines.find(p => p.options.id === id);
|
|
13125
|
+
polylineToUpdateCoordinates.setLatLngs(coordinates);
|
|
13126
|
+
polylineToUpdateCoordinates.setStyle(style);
|
|
13127
|
+
} else {
|
|
13128
|
+
listOfPolylines.push(newPolyline);
|
|
13179
13129
|
}
|
|
13180
13130
|
return newPolyline;
|
|
13181
13131
|
}
|
|
13132
|
+
function createCurvePath({
|
|
13133
|
+
zoom,
|
|
13134
|
+
totalMarkers,
|
|
13135
|
+
markerIndex
|
|
13136
|
+
}) {
|
|
13137
|
+
const radius = getCurvePointRadius(zoom);
|
|
13138
|
+
const {
|
|
13139
|
+
x,
|
|
13140
|
+
y,
|
|
13141
|
+
angleDeg
|
|
13142
|
+
} = getAngleDeg(totalMarkers, markerIndex, radius);
|
|
13143
|
+
return {
|
|
13144
|
+
x,
|
|
13145
|
+
y,
|
|
13146
|
+
angleDeg
|
|
13147
|
+
};
|
|
13148
|
+
}
|
|
13149
|
+
function getCurvePointRadius(zoom) {
|
|
13150
|
+
const isSmall = isSmallMarker(zoom) || isExtraSmallMarker(zoom);
|
|
13151
|
+
const isMedium = isMediumMarker(zoom);
|
|
13152
|
+
if (isSmall) {
|
|
13153
|
+
return RADIUS_SMALL + RADIUS_CURVE_SMALL;
|
|
13154
|
+
} else if (isMedium) {
|
|
13155
|
+
return RADIUS_MEDIUM + RADIUS_CURVE_MEDIUM;
|
|
13156
|
+
} else {
|
|
13157
|
+
return RADIUS_LARGE + RADIUS_CURVE_LARGE;
|
|
13158
|
+
}
|
|
13159
|
+
}
|
|
13160
|
+
function buildSmoothCurve(layerPoints, mapRef) {
|
|
13161
|
+
const path = [];
|
|
13162
|
+
for (let i = 0; i < layerPoints.length - 1; i++) {
|
|
13163
|
+
const p0 = layerPoints[i];
|
|
13164
|
+
const p1 = layerPoints[i + 1];
|
|
13165
|
+
const pPrev = layerPoints[i - 1] || p0;
|
|
13166
|
+
const pNext = layerPoints[i + 2] || p1;
|
|
13167
|
+
const cp1 = L__namespace.point(p0.x + (p1.x - pPrev.x) * TENSION, p0.y + (p1.y - pPrev.y) * TENSION);
|
|
13168
|
+
const cp2 = L__namespace.point(p1.x - (pNext.x - p0.x) * TENSION, p1.y - (pNext.y - p0.y) * TENSION);
|
|
13169
|
+
if (i === 0) {
|
|
13170
|
+
path.push("M", [mapRef.layerPointToLatLng(p0).lat, mapRef.layerPointToLatLng(p0).lng]);
|
|
13171
|
+
}
|
|
13172
|
+
path.push("C", [mapRef.layerPointToLatLng(cp1).lat, mapRef.layerPointToLatLng(cp1).lng], [mapRef.layerPointToLatLng(cp2).lat, mapRef.layerPointToLatLng(cp2).lng], [mapRef.layerPointToLatLng(p1).lat, mapRef.layerPointToLatLng(p1).lng]);
|
|
13173
|
+
}
|
|
13174
|
+
return path;
|
|
13175
|
+
}
|
|
13176
|
+
function getSiblingCurveStrength(zoom) {
|
|
13177
|
+
if (isExtraSmallMarker(zoom)) return RADIUS_CURVE_SMALL / 2;
|
|
13178
|
+
if (isSmallMarker(zoom)) return RADIUS_CURVE_MEDIUM;
|
|
13179
|
+
if (isMediumMarker(zoom)) return RADIUS_CURVE_LARGE;
|
|
13180
|
+
return RADIUS_CURVE_LARGE;
|
|
13181
|
+
}
|
|
13182
|
+
function buildCurveWIthTwoSiblings({
|
|
13183
|
+
mapRef,
|
|
13184
|
+
startLatLng,
|
|
13185
|
+
endLatLng,
|
|
13186
|
+
zoom,
|
|
13187
|
+
isSelected,
|
|
13188
|
+
id
|
|
13189
|
+
}) {
|
|
13190
|
+
const fromPoint = mapRef.latLngToLayerPoint(startLatLng);
|
|
13191
|
+
const toPoint = mapRef.latLngToLayerPoint(endLatLng);
|
|
13192
|
+
const midX = (fromPoint.x + toPoint.x) / 2;
|
|
13193
|
+
const midY = (fromPoint.y + toPoint.y) / 2 + (isSmallMarker(zoom) ? RADIUS_CURVE_SMALL / 2 : 0);
|
|
13194
|
+
const dx = toPoint.x - fromPoint.x;
|
|
13195
|
+
const dy = toPoint.y - fromPoint.y;
|
|
13196
|
+
const normal = L__namespace.point(-dy, dx);
|
|
13197
|
+
const length = Math.sqrt(normal.x ** 2 + normal.y ** 2) || 1;
|
|
13198
|
+
const normalized = normal.multiplyBy(1 / length);
|
|
13199
|
+
const curveStrength = getSiblingCurveStrength(zoom);
|
|
13200
|
+
const controlPoint = L__namespace.point(midX, midY).add(normalized.multiplyBy(curveStrength));
|
|
13201
|
+
const latlngs = [startLatLng, mapRef.layerPointToLatLng(controlPoint), endLatLng];
|
|
13202
|
+
const layerPoints = latlngs.map(latlng => mapRef.latLngToLayerPoint(latlng));
|
|
13203
|
+
const path = buildSmoothCurve(layerPoints, mapRef);
|
|
13204
|
+
const curve = L__namespace.curve(path, {
|
|
13205
|
+
color: "var(--base-gray-70)",
|
|
13206
|
+
weight: isExtraSmallMarker(zoom) ? 0 : 1.2,
|
|
13207
|
+
opacity: 0.5,
|
|
13208
|
+
smoothFactor: 1,
|
|
13209
|
+
id,
|
|
13210
|
+
dashArray: !isSelected ? "5, 5" : "0, 0"
|
|
13211
|
+
});
|
|
13212
|
+
mapRef.addLayer(curve);
|
|
13213
|
+
}
|
|
13182
13214
|
|
|
13183
13215
|
const StakeholderMarker = styled__default["default"].div`
|
|
13184
13216
|
background-color: var(--blue-50);
|
|
@@ -13479,9 +13511,6 @@ function StakeholderIcon$1({
|
|
|
13479
13511
|
return null;
|
|
13480
13512
|
}, [parentId, allData]);
|
|
13481
13513
|
React.useEffect(() => {
|
|
13482
|
-
if (selectedMarkersId.length === 0 || !isSelected) {
|
|
13483
|
-
return;
|
|
13484
|
-
}
|
|
13485
13514
|
linkNodesData.map(node => {
|
|
13486
13515
|
const isConnectingToStakeholder = node.isStakeholder;
|
|
13487
13516
|
const id = `${data.datastakeId}-${node.stakeholderId || node.datastakeId}`;
|
|
@@ -13493,6 +13522,8 @@ function StakeholderIcon$1({
|
|
|
13493
13522
|
const stakeholderPoint = centerPoint.add(L__namespace.point(x, y));
|
|
13494
13523
|
const stakeholderLatLng = mapRef.layerPointToLatLng(stakeholderPoint);
|
|
13495
13524
|
let endLatLng = L__namespace.latLng(node.gps.latitude, node.gps.longitude);
|
|
13525
|
+
const areNextToEachOther = targetMarkerIndex === index + 1 || targetMarkerIndex === index - 1 || index === 0 && targetMarkerIndex === node.totalStakeholders - 1 || targetMarkerIndex === 0 && index === node.totalStakeholders - 1;
|
|
13526
|
+
const areOnlyTwoSiblings = node.totalStakeholders === 2;
|
|
13496
13527
|
if (isExtraSmallMarker(zoom) && !isForceOpen) {
|
|
13497
13528
|
createPolyline({
|
|
13498
13529
|
L: L__namespace,
|
|
@@ -13502,8 +13533,7 @@ function StakeholderIcon$1({
|
|
|
13502
13533
|
zoom,
|
|
13503
13534
|
isSelected,
|
|
13504
13535
|
id,
|
|
13505
|
-
listOfPolylines: polylinesRef.current
|
|
13506
|
-
animated: true
|
|
13536
|
+
listOfPolylines: polylinesRef.current
|
|
13507
13537
|
});
|
|
13508
13538
|
return;
|
|
13509
13539
|
}
|
|
@@ -13521,8 +13551,61 @@ function StakeholderIcon$1({
|
|
|
13521
13551
|
const nodePoint = mapRef.latLngToLayerPoint(nodeLatLng);
|
|
13522
13552
|
const endPoint = L__namespace.point(x + nodePoint.x + center.left, y + nodePoint.y + center.top);
|
|
13523
13553
|
endLatLng = mapRef.layerPointToLatLng(endPoint);
|
|
13554
|
+
if (isSibling && (!areNextToEachOther || areOnlyTwoSiblings)) {
|
|
13555
|
+
if (areOnlyTwoSiblings) {
|
|
13556
|
+
buildCurveWIthTwoSiblings({
|
|
13557
|
+
mapRef,
|
|
13558
|
+
startLatLng: stakeholderLatLng,
|
|
13559
|
+
endLatLng,
|
|
13560
|
+
zoom,
|
|
13561
|
+
isSelected,
|
|
13562
|
+
id
|
|
13563
|
+
});
|
|
13564
|
+
return;
|
|
13565
|
+
}
|
|
13566
|
+
const total = node.totalStakeholders;
|
|
13567
|
+
let from = index;
|
|
13568
|
+
let to = targetMarkerIndex;
|
|
13569
|
+
let flip = false;
|
|
13570
|
+
const forwardDistance = (to - from + total) % total;
|
|
13571
|
+
const backwardDistance = (from - to + total) % total;
|
|
13572
|
+
if (backwardDistance < forwardDistance) {
|
|
13573
|
+
[from, to] = [to, from];
|
|
13574
|
+
flip = true;
|
|
13575
|
+
}
|
|
13576
|
+
const intermediateIndices = [];
|
|
13577
|
+
for (let i = 1; i < (to - from + total) % total; i++) {
|
|
13578
|
+
intermediateIndices.push((from + i) % total);
|
|
13579
|
+
}
|
|
13580
|
+
const indices = [from, ...intermediateIndices, to];
|
|
13581
|
+
const intermediatePoints = [];
|
|
13582
|
+
for (const i of indices) {
|
|
13583
|
+
const {
|
|
13584
|
+
x,
|
|
13585
|
+
y
|
|
13586
|
+
} = createCurvePath({
|
|
13587
|
+
zoom,
|
|
13588
|
+
totalMarkers: node.totalStakeholders,
|
|
13589
|
+
markerIndex: i
|
|
13590
|
+
});
|
|
13591
|
+
const point = centerPoint.add(L__namespace.point(x, y));
|
|
13592
|
+
const latlng = mapRef.layerPointToLatLng(point);
|
|
13593
|
+
intermediatePoints.push(latlng);
|
|
13594
|
+
}
|
|
13595
|
+
const latlngs = flip ? [endLatLng, ...intermediatePoints, stakeholderLatLng] : [stakeholderLatLng, ...intermediatePoints, endLatLng];
|
|
13596
|
+
const layerPoints = latlngs.map(latlng => mapRef.latLngToLayerPoint(latlng));
|
|
13597
|
+
const path = buildSmoothCurve(layerPoints, mapRef);
|
|
13598
|
+
const curve = L__namespace?.curve?.(path, {
|
|
13599
|
+
color: "var(--base-gray-70)",
|
|
13600
|
+
weight: isExtraSmallMarker(zoom) ? 0 : 1,
|
|
13601
|
+
opacity: isSelected ? 1 : 0.5,
|
|
13602
|
+
smoothFactor: 1,
|
|
13603
|
+
id
|
|
13604
|
+
});
|
|
13605
|
+
mapRef.addLayer(curve);
|
|
13606
|
+
return;
|
|
13607
|
+
}
|
|
13524
13608
|
}
|
|
13525
|
-
// Always use straight lines
|
|
13526
13609
|
createPolyline({
|
|
13527
13610
|
L: L__namespace,
|
|
13528
13611
|
mapRef,
|
|
@@ -13532,11 +13615,10 @@ function StakeholderIcon$1({
|
|
|
13532
13615
|
isFromStakeholder: false,
|
|
13533
13616
|
isSelected,
|
|
13534
13617
|
id,
|
|
13535
|
-
listOfPolylines: polylinesRef.current
|
|
13536
|
-
animated: true
|
|
13618
|
+
listOfPolylines: polylinesRef.current
|
|
13537
13619
|
});
|
|
13538
13620
|
});
|
|
13539
|
-
}, [mapRef, x, y, parentData, linkNodesData, isSelected, zoom, isForceOpen
|
|
13621
|
+
}, [mapRef, x, y, parentData, linkNodesData, isSelected, zoom, isForceOpen]);
|
|
13540
13622
|
return /*#__PURE__*/jsxRuntime.jsx(jsxRuntime.Fragment, {
|
|
13541
13623
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
|
|
13542
13624
|
content: renderTooltipJsx({
|
|
@@ -13603,8 +13685,6 @@ function LocationIcon({
|
|
|
13603
13685
|
const linkedNodesData = React.useMemo(() => {
|
|
13604
13686
|
const nodes = [];
|
|
13605
13687
|
const links = data.links || [];
|
|
13606
|
-
|
|
13607
|
-
// Add links from the location itself
|
|
13608
13688
|
links.forEach(link => {
|
|
13609
13689
|
allData.forEach(d => {
|
|
13610
13690
|
if (d.datastakeId === link) {
|
|
@@ -13624,45 +13704,8 @@ function LocationIcon({
|
|
|
13624
13704
|
}
|
|
13625
13705
|
});
|
|
13626
13706
|
});
|
|
13627
|
-
|
|
13628
|
-
// ADD: Also include links from this location's stakeholders
|
|
13629
|
-
const stakeholders = data.stakeholders || [];
|
|
13630
|
-
stakeholders.forEach(stakeholder => {
|
|
13631
|
-
const stakeholderLinks = stakeholder.links || [];
|
|
13632
|
-
stakeholderLinks.forEach(link => {
|
|
13633
|
-
allData.forEach(d => {
|
|
13634
|
-
// Check if it's a direct location link
|
|
13635
|
-
if (d.datastakeId === link) {
|
|
13636
|
-
// Avoid duplicates
|
|
13637
|
-
if (!nodes.find(n => n.datastakeId === link && !n.isStakeholder)) {
|
|
13638
|
-
nodes.push({
|
|
13639
|
-
...d,
|
|
13640
|
-
fromStakeholderId: stakeholder.datastakeId
|
|
13641
|
-
});
|
|
13642
|
-
}
|
|
13643
|
-
}
|
|
13644
|
-
// Check if it's a stakeholder link
|
|
13645
|
-
if (d.stakeholders && d.stakeholders.length > 0) {
|
|
13646
|
-
d.stakeholders.forEach(targetStakeholder => {
|
|
13647
|
-
if (targetStakeholder.datastakeId === link) {
|
|
13648
|
-
// Avoid duplicates
|
|
13649
|
-
if (!nodes.find(n => n.isStakeholder && n.datastakeId === d.datastakeId && n.stakeholdersIndex === d.stakeholders.indexOf(targetStakeholder))) {
|
|
13650
|
-
nodes.push({
|
|
13651
|
-
...d,
|
|
13652
|
-
isStakeholder: true,
|
|
13653
|
-
totalStakeholders: d.stakeholders.length,
|
|
13654
|
-
stakeholdersIndex: d.stakeholders.indexOf(targetStakeholder),
|
|
13655
|
-
fromStakeholderId: stakeholder.datastakeId
|
|
13656
|
-
});
|
|
13657
|
-
}
|
|
13658
|
-
}
|
|
13659
|
-
});
|
|
13660
|
-
}
|
|
13661
|
-
});
|
|
13662
|
-
});
|
|
13663
|
-
});
|
|
13664
13707
|
return nodes;
|
|
13665
|
-
}, [JSON.stringify(allData), JSON.stringify(data.links),
|
|
13708
|
+
}, [JSON.stringify(allData), JSON.stringify(data.links), zoom]);
|
|
13666
13709
|
const stakeholdersOfLocation = React.useMemo(() => {
|
|
13667
13710
|
return data?.stakeholders || [];
|
|
13668
13711
|
}, [data.stakeholders, zoom]);
|
|
@@ -13680,13 +13723,7 @@ function LocationIcon({
|
|
|
13680
13723
|
currentRoots.clear();
|
|
13681
13724
|
markersRef.current = [];
|
|
13682
13725
|
|
|
13683
|
-
//
|
|
13684
|
-
const shouldShowStakeholders = isSelected || stakeholdersOfLocation.some(stk => selectedMarkersId.includes(stk.datastakeId));
|
|
13685
|
-
if (!shouldShowStakeholders || selectedMarkersId.length === 0) {
|
|
13686
|
-
return;
|
|
13687
|
-
}
|
|
13688
|
-
|
|
13689
|
-
// Create new markers only when selected
|
|
13726
|
+
// Create new markers
|
|
13690
13727
|
stakeholdersOfLocation.forEach((stakeholder, index) => {
|
|
13691
13728
|
const markerId = `${stakeholder.datastakeId}`;
|
|
13692
13729
|
const {
|
|
@@ -13772,9 +13809,7 @@ function LocationIcon({
|
|
|
13772
13809
|
zoom,
|
|
13773
13810
|
isFromStakeholder: true,
|
|
13774
13811
|
isForceOpen,
|
|
13775
|
-
listOfPolylines: polylinesRef.current
|
|
13776
|
-
stakeholderType: stakeholder.type,
|
|
13777
|
-
animated: true
|
|
13812
|
+
listOfPolylines: polylinesRef.current
|
|
13778
13813
|
});
|
|
13779
13814
|
});
|
|
13780
13815
|
return () => {
|
|
@@ -13789,88 +13824,38 @@ function LocationIcon({
|
|
|
13789
13824
|
rootsMapRef.current.clear();
|
|
13790
13825
|
markersRef.current = [];
|
|
13791
13826
|
};
|
|
13792
|
-
}, [stakeholdersOfLocation, selectedMarkersId, activeMarker
|
|
13793
|
-
|
|
13794
|
-
|
|
13795
|
-
|
|
13796
|
-
|
|
13797
|
-
|
|
13798
|
-
|
|
13799
|
-
|
|
13800
|
-
|
|
13801
|
-
|
|
13802
|
-
|
|
13803
|
-
|
|
13804
|
-
}
|
|
13805
|
-
|
|
13806
|
-
// Filter linkedNodesData to only include nodes that are in the selected chain
|
|
13807
|
-
const relevantLinks = linkedNodesData.filter(node => {
|
|
13808
|
-
// Check if the target node (location) is in the selected markers
|
|
13809
|
-
const targetLocationInSelection = selectedMarkersId.includes(node.datastakeId);
|
|
13810
|
-
|
|
13811
|
-
// If connecting to a stakeholder, check if that stakeholder is selected
|
|
13812
|
-
if (node.isStakeholder) {
|
|
13813
|
-
const stakeholderInSelection = node.stakeholdersIndex !== undefined && selectedMarkersId.includes(node.datastakeId);
|
|
13814
|
-
return stakeholderInSelection;
|
|
13815
|
-
}
|
|
13816
|
-
return targetLocationInSelection;
|
|
13817
|
-
});
|
|
13818
|
-
relevantLinks.forEach(node => {
|
|
13819
|
-
const id = node.fromStakeholderId ? `${node.fromStakeholderId}-${node.datastakeId}` : `${data.datastakeId}-${node.datastakeId}`;
|
|
13820
|
-
const isConnectingToStakeholder = node.isStakeholder;
|
|
13821
|
-
|
|
13822
|
-
// If the link is from a stakeholder, start from the stakeholder position
|
|
13823
|
-
let startLatLng;
|
|
13824
|
-
if (node.fromStakeholderId) {
|
|
13825
|
-
// Find the stakeholder index in this location's stakeholders
|
|
13826
|
-
const stakeholderIndex = stakeholdersOfLocation.findIndex(s => s.datastakeId === node.fromStakeholderId);
|
|
13827
|
-
if (stakeholderIndex !== -1) {
|
|
13828
|
-
const {
|
|
13829
|
-
x,
|
|
13830
|
-
y
|
|
13831
|
-
} = getStakeholderPosition({
|
|
13832
|
-
zoom,
|
|
13833
|
-
totalMarkers: stakeholdersOfLocation.length,
|
|
13834
|
-
markerIndex: stakeholderIndex
|
|
13835
|
-
});
|
|
13836
|
-
const centerLatLng = L__namespace.latLng(data.gps.latitude, data.gps.longitude);
|
|
13837
|
-
const centerPoint = mapRef.latLngToLayerPoint(centerLatLng);
|
|
13838
|
-
const stakeholderPoint = centerPoint.add(L__namespace.point(x, y));
|
|
13839
|
-
startLatLng = mapRef.layerPointToLatLng(stakeholderPoint);
|
|
13840
|
-
} else {
|
|
13841
|
-
startLatLng = L__namespace.latLng(data.gps.latitude, data.gps.longitude);
|
|
13842
|
-
}
|
|
13843
|
-
} else {
|
|
13844
|
-
startLatLng = L__namespace.latLng(data.gps.latitude, data.gps.longitude);
|
|
13845
|
-
}
|
|
13846
|
-
let endLatLng = L__namespace.latLng(node.gps.latitude, node.gps.longitude);
|
|
13847
|
-
const isConnectingToStakeholderSelected = selectedMarkersId.includes(node.datastakeId);
|
|
13848
|
-
if (isConnectingToStakeholder && !isExtraSmallMarker(zoom)) {
|
|
13849
|
-
const {
|
|
13850
|
-
x,
|
|
13851
|
-
y
|
|
13852
|
-
} = getStakeholderPosition({
|
|
13853
|
-
zoom,
|
|
13854
|
-
totalMarkers: node.totalStakeholders,
|
|
13855
|
-
markerIndex: node.stakeholdersIndex
|
|
13856
|
-
});
|
|
13857
|
-
const nodeLatLng = L__namespace.latLng(node.gps.latitude, node.gps.longitude);
|
|
13858
|
-
const nodePoint = mapRef.latLngToLayerPoint(nodeLatLng);
|
|
13859
|
-
const endPoint = L__namespace.point(x + nodePoint.x, y + nodePoint.y);
|
|
13860
|
-
endLatLng = mapRef.layerPointToLatLng(endPoint);
|
|
13861
|
-
}
|
|
13862
|
-
createPolyline({
|
|
13863
|
-
L: L__namespace,
|
|
13864
|
-
mapRef,
|
|
13865
|
-
startLatLng,
|
|
13866
|
-
endLatLng,
|
|
13867
|
-
isSelected: isConnectingToStakeholderSelected,
|
|
13868
|
-
id,
|
|
13827
|
+
}, [stakeholdersOfLocation, selectedMarkersId, activeMarker]);
|
|
13828
|
+
linkedNodesData.map(node => {
|
|
13829
|
+
const id = `${data.datastakeId}-${node.datastakeId}`;
|
|
13830
|
+
const isConnectingToStakeholder = node.isStakeholder;
|
|
13831
|
+
const centerLatLng = L__namespace.latLng(data.gps.latitude, data.gps.longitude);
|
|
13832
|
+
let endLatLng = L__namespace.latLng(node.gps.latitude, node.gps.longitude);
|
|
13833
|
+
const isConnectingToStakeholderSelected = selectedMarkersId.includes(node.datastakeId);
|
|
13834
|
+
if (isConnectingToStakeholder && !isExtraSmallMarker(zoom)) {
|
|
13835
|
+
const {
|
|
13836
|
+
x,
|
|
13837
|
+
y
|
|
13838
|
+
} = getStakeholderPosition({
|
|
13869
13839
|
zoom,
|
|
13870
|
-
|
|
13871
|
-
|
|
13840
|
+
totalMarkers: node.totalStakeholders,
|
|
13841
|
+
markerIndex: node.stakeholdersIndex
|
|
13842
|
+
});
|
|
13843
|
+
const nodeLatLng = L__namespace.latLng(node.gps.latitude, node.gps.longitude);
|
|
13844
|
+
const nodePoint = mapRef.latLngToLayerPoint(nodeLatLng);
|
|
13845
|
+
const endPoint = L__namespace.point(x + nodePoint.x, y + nodePoint.y);
|
|
13846
|
+
endLatLng = mapRef.layerPointToLatLng(endPoint);
|
|
13847
|
+
}
|
|
13848
|
+
createPolyline({
|
|
13849
|
+
L: L__namespace,
|
|
13850
|
+
mapRef,
|
|
13851
|
+
startLatLng: centerLatLng,
|
|
13852
|
+
endLatLng,
|
|
13853
|
+
isSelected: isConnectingToStakeholderSelected,
|
|
13854
|
+
id,
|
|
13855
|
+
zoom,
|
|
13856
|
+
listOfPolylines: polylinesRef.current
|
|
13872
13857
|
});
|
|
13873
|
-
}
|
|
13858
|
+
});
|
|
13874
13859
|
return /*#__PURE__*/jsxRuntime.jsx(antd.Popover, {
|
|
13875
13860
|
content: renderTooltipJsx({
|
|
13876
13861
|
title: data.name,
|
|
@@ -14386,8 +14371,7 @@ function useMapHelper$1({
|
|
|
14386
14371
|
link: link,
|
|
14387
14372
|
onClickLink: onClickLink,
|
|
14388
14373
|
activeStakeholder: activeStakeholder,
|
|
14389
|
-
setActiveStakeholder: setActiveStakeholder
|
|
14390
|
-
mapRef: mapRef
|
|
14374
|
+
setActiveStakeholder: setActiveStakeholder
|
|
14391
14375
|
}));
|
|
14392
14376
|
roots.current.push(root);
|
|
14393
14377
|
} else if (type === "location") {
|
|
@@ -14592,8 +14576,7 @@ const useMap$1 = ({
|
|
|
14592
14576
|
MAP_TOKEN
|
|
14593
14577
|
} = useMapConfig({
|
|
14594
14578
|
app,
|
|
14595
|
-
isSatellite
|
|
14596
|
-
mapRef: container
|
|
14579
|
+
isSatellite
|
|
14597
14580
|
});
|
|
14598
14581
|
const [initialMarkerSetIsDone, setInitialMarkerSetIsDone] = React.useState(false);
|
|
14599
14582
|
const [mapCenter, setMapCenter] = React.useState([0, 0]);
|
|
@@ -14610,8 +14593,6 @@ const useMap$1 = ({
|
|
|
14610
14593
|
const graph = new Map();
|
|
14611
14594
|
const stakeToLoc = new Map();
|
|
14612
14595
|
const nodeTypes = new Map();
|
|
14613
|
-
|
|
14614
|
-
// Build the graph
|
|
14615
14596
|
for (const loc of data) {
|
|
14616
14597
|
const locId = loc.datastakeId;
|
|
14617
14598
|
nodeTypes.set(locId, loc.type);
|
|
@@ -14636,45 +14617,26 @@ const useMap$1 = ({
|
|
|
14636
14617
|
}
|
|
14637
14618
|
}
|
|
14638
14619
|
const highlightTable = {};
|
|
14639
|
-
|
|
14640
|
-
// Perform BFS/DFS to find all connected nodes in the entire chain
|
|
14641
14620
|
for (const [node] of graph) {
|
|
14642
14621
|
const highlighted = new Set();
|
|
14643
|
-
|
|
14644
|
-
const
|
|
14645
|
-
|
|
14646
|
-
const
|
|
14647
|
-
highlighted.add(
|
|
14648
|
-
|
|
14649
|
-
|
|
14650
|
-
const
|
|
14651
|
-
if (
|
|
14652
|
-
const
|
|
14653
|
-
if (
|
|
14654
|
-
highlighted.add(parentLoc);
|
|
14655
|
-
visited.add(parentLoc);
|
|
14656
|
-
queue.push(parentLoc);
|
|
14657
|
-
}
|
|
14658
|
-
}
|
|
14659
|
-
|
|
14660
|
-
// Traverse all neighbors
|
|
14661
|
-
for (const neighbor of graph.get(current) || []) {
|
|
14662
|
-
if (!visited.has(neighbor)) {
|
|
14663
|
-
visited.add(neighbor);
|
|
14664
|
-
queue.push(neighbor);
|
|
14622
|
+
highlighted.add(node);
|
|
14623
|
+
const nodeIsStakeholder = !isLocation(nodeTypes.get(node));
|
|
14624
|
+
if (nodeIsStakeholder && stakeToLoc.has(node)) {
|
|
14625
|
+
const parentLoc = stakeToLoc.get(node);
|
|
14626
|
+
highlighted.add(parentLoc);
|
|
14627
|
+
}
|
|
14628
|
+
for (const neighbor of graph.get(node) || []) {
|
|
14629
|
+
const neighborIsStakeholder = !isLocation(nodeTypes.get(neighbor));
|
|
14630
|
+
if (neighborIsStakeholder && stakeToLoc.has(neighbor)) {
|
|
14631
|
+
const neighborParent = stakeToLoc.get(neighbor);
|
|
14632
|
+
if (isLocation(nodeTypes.get(node)) && neighborParent === node || nodeIsStakeholder && stakeToLoc.get(node) === neighborParent) {
|
|
14665
14633
|
highlighted.add(neighbor);
|
|
14666
|
-
|
|
14667
|
-
|
|
14668
|
-
|
|
14669
|
-
if (neighborIsStakeholder && stakeToLoc.has(neighbor)) {
|
|
14670
|
-
const neighborParent = stakeToLoc.get(neighbor);
|
|
14671
|
-
if (!visited.has(neighborParent)) {
|
|
14672
|
-
highlighted.add(neighborParent);
|
|
14673
|
-
visited.add(neighborParent);
|
|
14674
|
-
queue.push(neighborParent);
|
|
14675
|
-
}
|
|
14676
|
-
}
|
|
14634
|
+
} else {
|
|
14635
|
+
highlighted.add(neighbor);
|
|
14636
|
+
highlighted.add(neighborParent);
|
|
14677
14637
|
}
|
|
14638
|
+
} else {
|
|
14639
|
+
highlighted.add(neighbor);
|
|
14678
14640
|
}
|
|
14679
14641
|
}
|
|
14680
14642
|
highlightTable[node] = [...highlighted];
|
|
@@ -14739,29 +14701,19 @@ const useMap$1 = ({
|
|
|
14739
14701
|
});
|
|
14740
14702
|
}
|
|
14741
14703
|
}
|
|
14742
|
-
if (type === "chain" && selectedMarkersId.length === 0) {
|
|
14743
|
-
if (polylinesRef.current.length) {
|
|
14744
|
-
polylinesRef.current.forEach(polyline => {
|
|
14745
|
-
if (mapRef.hasLayer(polyline)) {
|
|
14746
|
-
mapRef.removeLayer(polyline);
|
|
14747
|
-
}
|
|
14748
|
-
});
|
|
14749
|
-
polylinesRef.current = [];
|
|
14750
|
-
}
|
|
14751
|
-
}
|
|
14752
14704
|
clearMapMarkers();
|
|
14753
14705
|
if (data) {
|
|
14754
|
-
|
|
14706
|
+
// Filters out locations that are not connected to any stakeholders
|
|
14707
|
+
const excludedType = ['village', 'town', 'area', 'territory'];
|
|
14708
|
+
const filteredData = data?.filter(obj => !excludedType.includes(obj?.type) && (obj?.stakeholders?.length > 0 || data.some(other => other.datastakeId !== obj.datastakeId && (other.stakeholders || []).some(stk => (stk.links || []).includes(obj.datastakeId)))));
|
|
14755
14709
|
const maxTotal = Math.max(...(data || []).map(d => d.total));
|
|
14756
14710
|
const dataToRender = type === "chain" ? filteredData : data;
|
|
14757
14711
|
dataToRender.forEach((d, i) => {
|
|
14758
14712
|
addIconToMapInitialy([d?.marker?.lat, d?.marker?.lng], "location", d.category || "mineSite", d, maxTotal, i);
|
|
14759
14713
|
});
|
|
14760
|
-
|
|
14761
|
-
|
|
14762
|
-
|
|
14763
|
-
});
|
|
14764
|
-
}
|
|
14714
|
+
polylinesRef.current.forEach(polyline => {
|
|
14715
|
+
mapRef.addLayer(polyline);
|
|
14716
|
+
});
|
|
14765
14717
|
mapRef.invalidateSize();
|
|
14766
14718
|
mapRef.fire("moveend");
|
|
14767
14719
|
}
|
|
@@ -17750,7 +17702,7 @@ const getGoalConfig = () => {
|
|
|
17750
17702
|
}];
|
|
17751
17703
|
};
|
|
17752
17704
|
|
|
17753
|
-
var _templateObject$
|
|
17705
|
+
var _templateObject$a;
|
|
17754
17706
|
const _excluded$k = ["title", "activeSdgGoals", "t"];
|
|
17755
17707
|
function SDGWidget(_ref) {
|
|
17756
17708
|
let {
|
|
@@ -17779,10 +17731,10 @@ function SDGWidget(_ref) {
|
|
|
17779
17731
|
})
|
|
17780
17732
|
}));
|
|
17781
17733
|
}
|
|
17782
|
-
const SDGContainer = styled__default["default"].div(_templateObject$
|
|
17734
|
+
const SDGContainer = styled__default["default"].div(_templateObject$a || (_templateObject$a = _taggedTemplateLiteral(["\n\tdisplay: grid;\n\tgrid-template-columns: repeat(auto-fit, minmax(53px, 1fr));\n\tgap: 8px;\n\n\t.sdg-item {\n\t\theight: 53px;\n\t\twidth: 53px;\n\t\tborder-radius: 8px;\n\t\tbackground-size: cover;\n\t\tbackground-position: center;\n\t\tbackground-repeat: no-repeat;\n\t}\n\n\t.sdg-item-content {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\theight: 100%;\n\t\tcolor: white;\n\t\ttext-align: center;\n\t}\n"])));
|
|
17783
17735
|
|
|
17784
|
-
var _templateObject$
|
|
17785
|
-
const Style$F = styled__default["default"].div(_templateObject$
|
|
17736
|
+
var _templateObject$9;
|
|
17737
|
+
const Style$F = styled__default["default"].div(_templateObject$9 || (_templateObject$9 = _taggedTemplateLiteral(["\n\tposition: relative;\n\twidth: 100%;\n\theight: 100%;\n\n\t.p-placeholder {\n\t\tposition: absolute;\n\t\ttop: 0px;\n\t\tleft: 0px;\n\t\twidth: 100%;\n\t\theight: 100%;\n\t\tbackground: transparent;\n\t\tz-index: 100;\n\t\tcursor: default;\n\t}\n"])));
|
|
17786
17738
|
|
|
17787
17739
|
/**
|
|
17788
17740
|
* ComponentWithHoverFocus
|
|
@@ -25414,7 +25366,7 @@ const countriesPhoneNumberLength = {
|
|
|
25414
25366
|
ZW: 9
|
|
25415
25367
|
};
|
|
25416
25368
|
|
|
25417
|
-
var _templateObject$
|
|
25369
|
+
var _templateObject$8;
|
|
25418
25370
|
const dialCodes = Object.keys(countriesList.countries).map(country => {
|
|
25419
25371
|
return {
|
|
25420
25372
|
name: country === 'XK' ? "+383" : "+".concat(countriesList.countries[country].phone.split(',')[0]),
|
|
@@ -25425,7 +25377,7 @@ const dialCodes = Object.keys(countriesList.countries).map(country => {
|
|
|
25425
25377
|
length: countriesPhoneNumberLength[country] || 9
|
|
25426
25378
|
};
|
|
25427
25379
|
}).sort((a, b) => a.countryName > b.countryName ? 1 : b.countryName > a.countryName ? -1 : 0);
|
|
25428
|
-
const Styles$9 = styled__default["default"].div(_templateObject$
|
|
25380
|
+
const Styles$9 = styled__default["default"].div(_templateObject$8 || (_templateObject$8 = _taggedTemplateLiteral(["\n display: flex;\n width: 100%;\n flex-direction: column;\n\n .input-c {\n display: flex;\n flex-direction: row;\n justify-content: flex-start;\n flex-grow: 1;\n align-items: center;\n position: relative\n\n &.highlighted-input {\n border: 0.5px solid #FF7A45;\n border-radius: 8px;\n }\n\n .ant-select {\n width: ", ";\n .ant-select-selector {\n border-top-right-radius: 0;\n background-color: var(--base-gray-20);\n border-bottom-right-radius: 0;\n }\n }\n .ant-input-number {\n border-left: none;\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n\n .ant-input-number-handler-wrap {\n display: none;\n }\n width: 100%;\n }\n\n &.has-error {\n .error-icon {\n position: absolute;\n right: 10px;\n color: red;\n top: 50%;\n transform: translate(0%, -50%);\n }\n }\n }\n\n .ant-form-item-explain-error {\n margin-bottom: 0px;\n }\n"])), props => props.customSelectWidthPercentage || '100%');
|
|
25429
25381
|
function PhoneInput(_ref) {
|
|
25430
25382
|
let {
|
|
25431
25383
|
className,
|
|
@@ -41960,13 +41912,8 @@ const Navigation = _ref => {
|
|
|
41960
41912
|
}) : null;
|
|
41961
41913
|
};
|
|
41962
41914
|
|
|
41963
|
-
|
|
41964
|
-
width: 100
|
|
41965
|
-
|
|
41966
|
-
.ant-select-arrow {
|
|
41967
|
-
margin-top: 1px !important;
|
|
41968
|
-
}
|
|
41969
|
-
`;
|
|
41915
|
+
var _templateObject$7;
|
|
41916
|
+
const StyledSelect = styled__default["default"](antd.Select)(_templateObject$7 || (_templateObject$7 = _taggedTemplateLiteral(["\n width: 100%;\n \n .ant-select-arrow {\n margin-top: 1px !important;\n }\n"])));
|
|
41970
41917
|
|
|
41971
41918
|
const _excluded$d = ["onChange", "value"];
|
|
41972
41919
|
function AuthForm(_ref) {
|