datastake-daf 0.6.186 → 0.6.188
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/.env +8 -0
- package/.vscode/settings.json +13 -0
- package/dist/components/index.js +284 -269
- package/package.json +2 -2
- package/src/@daf/core/components/Dashboard/Globe/index.jsx +0 -35
- package/src/@daf/core/components/Dashboard/Globe/style.js +11 -0
- package/src/@daf/core/components/Dashboard/Map/storyConfig1.js +235 -233
- package/src/@daf/core/components/Filters/FloatingFilters/components/Slider/index.jsx +112 -107
- package/src/@daf/core/components/Table/StickyTable/StickyTable.stories.js +290 -321
- package/src/@daf/core/components/Table/StickyTable/index.jsx +75 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "datastake-daf",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.188",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"@ant-design/icons": "^5.2.5",
|
|
6
6
|
"@antv/g2": "^5.1.1",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"buffer": "^6.0.3",
|
|
16
16
|
"countries-list": "^2.6.1",
|
|
17
17
|
"country-city-location": "^1.0.13",
|
|
18
|
-
"datastake-daf": "0.
|
|
18
|
+
"datastake-daf": "^0.5.780",
|
|
19
19
|
"dayjs": "^1.11.12",
|
|
20
20
|
"deepmerge": "^4.3.1",
|
|
21
21
|
"dot-object": "^2.1.5",
|
|
@@ -8,7 +8,6 @@ import CustomIcon from "../../Icon/CustomIcon.jsx";
|
|
|
8
8
|
import ComponentWithFocus from "../ComponentWithFocus/index.jsx";
|
|
9
9
|
import { formatClassname } from "../../../../../helpers/ClassesHelper";
|
|
10
10
|
import Filters from "../../Filters/FloatingFilters/index.js";
|
|
11
|
-
import { useResizeContext } from "../../../context/Resize/index.js";
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* Globe Component
|
|
@@ -130,9 +129,6 @@ function Globe({
|
|
|
130
129
|
[data],
|
|
131
130
|
);
|
|
132
131
|
|
|
133
|
-
// Get resize context for sidebar state changes
|
|
134
|
-
const { isCollapsed } = useResizeContext();
|
|
135
|
-
|
|
136
132
|
// Use custom hook to configure globe functionality
|
|
137
133
|
const { container, activeMarker, mapOptionsButtonsConfig, forceResize } = useGlobe({
|
|
138
134
|
data: mappedData,
|
|
@@ -175,37 +171,6 @@ function Globe({
|
|
|
175
171
|
}
|
|
176
172
|
}, [forceResize]);
|
|
177
173
|
|
|
178
|
-
// Force resize when sidebar state changes (handles width changes)
|
|
179
|
-
useEffect(() => {
|
|
180
|
-
if (forceResize) {
|
|
181
|
-
// Trigger resize when sidebar collapses/expands
|
|
182
|
-
const timer = setTimeout(() => {
|
|
183
|
-
forceResize();
|
|
184
|
-
}, 100);
|
|
185
|
-
|
|
186
|
-
return () => clearTimeout(timer);
|
|
187
|
-
}
|
|
188
|
-
}, [isCollapsed, forceResize]);
|
|
189
|
-
|
|
190
|
-
// Force resize when window width changes (handles sidebar width changes)
|
|
191
|
-
useEffect(() => {
|
|
192
|
-
if (forceResize) {
|
|
193
|
-
const handleResize = () => {
|
|
194
|
-
// Small delay to ensure DOM has updated
|
|
195
|
-
setTimeout(() => {
|
|
196
|
-
forceResize();
|
|
197
|
-
}, 100);
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
window.addEventListener('resize', handleResize);
|
|
201
|
-
|
|
202
|
-
return () => {
|
|
203
|
-
window.removeEventListener('resize', handleResize);
|
|
204
|
-
};
|
|
205
|
-
}
|
|
206
|
-
}, [forceResize]);
|
|
207
|
-
|
|
208
|
-
|
|
209
174
|
return (
|
|
210
175
|
<ComponentWithFocus>
|
|
211
176
|
<Style className={formatClassname([showSider && activeMarker && "with-sider"])}>
|
|
@@ -6,6 +6,17 @@ const Style = styled.div`
|
|
|
6
6
|
position: relative;
|
|
7
7
|
width: 100%;
|
|
8
8
|
height: 472px;
|
|
9
|
+
min-height: 300px;
|
|
10
|
+
|
|
11
|
+
@media (max-width: 768px) {
|
|
12
|
+
height: 350px;
|
|
13
|
+
min-height: 250px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@media (max-width: 480px) {
|
|
17
|
+
height: 300px;
|
|
18
|
+
min-height: 200px;
|
|
19
|
+
}
|
|
9
20
|
|
|
10
21
|
.filter-cont {
|
|
11
22
|
position: absolute;
|
|
@@ -5,241 +5,243 @@ import MoreTags from "../../Table/MoreTags";
|
|
|
5
5
|
const isMineSite = true;
|
|
6
6
|
|
|
7
7
|
export const storyConfig = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
8
|
+
data: [
|
|
9
|
+
{
|
|
10
|
+
gps: {
|
|
11
|
+
latitude: -1.545726158025555,
|
|
12
|
+
longitude: 28.875630614904935,
|
|
13
|
+
},
|
|
14
|
+
name: "Rubaya",
|
|
15
|
+
datastakeId: "LOC-00000000241",
|
|
16
|
+
data: [
|
|
17
|
+
{
|
|
18
|
+
_id: "68af116e2cb57a4e3dd2e056",
|
|
19
|
+
createdBy: "4274fdb4-2798-46ea-a0a6-b4af5d92566e",
|
|
20
|
+
form: "event",
|
|
21
|
+
id: "91c3176a-d312-4259-9ddf-9d286ff6df87",
|
|
22
|
+
datastakeId: "EV-000000000150",
|
|
23
|
+
name: "Eboulement",
|
|
24
|
+
authorId: "7e17f076-09e7-4668-927c-11c12ccd1346",
|
|
25
|
+
collectId: "d78271301d04f76dfe0f70ce3c9e114ffe4dc4e0",
|
|
26
|
+
country: "CD",
|
|
27
|
+
date: "2025-08-25",
|
|
28
|
+
typeOfEvent: "incident",
|
|
29
|
+
implementers: [],
|
|
30
|
+
associatedSubjects: [],
|
|
31
|
+
testimonialsSource: [],
|
|
32
|
+
pictures: [],
|
|
33
|
+
documents: [],
|
|
34
|
+
channels: ["NAS-00000000105"],
|
|
35
|
+
published: true,
|
|
36
|
+
version: 1,
|
|
37
|
+
identifiedPerpetrators: [],
|
|
38
|
+
identifiedVictims: [],
|
|
39
|
+
assistedVictims: [],
|
|
40
|
+
mitigationMeasures: [],
|
|
41
|
+
createdAt: "2025-08-27T00:00:00.000Z",
|
|
42
|
+
updatedAt: "2025-08-27T14:12:21.395Z",
|
|
43
|
+
__v: 0,
|
|
44
|
+
percentageCompletion: 40,
|
|
45
|
+
eventCategory: "conflict",
|
|
46
|
+
incindentType: null,
|
|
47
|
+
initiative: null,
|
|
48
|
+
meta: null,
|
|
49
|
+
namespace: "incident",
|
|
50
|
+
primarySource: null,
|
|
51
|
+
severity: "moderate",
|
|
52
|
+
sources: ["7e17f076-09e7-4668-927c-11c12ccd1346"],
|
|
53
|
+
type: "minor_incident",
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
_id: "68af1fb6b52f86d82f57e945",
|
|
57
|
+
createdBy: "b1e3f288-01a2-4cea-95d2-03f65dfede99",
|
|
58
|
+
form: "event",
|
|
59
|
+
id: "5bee0d0f-39da-4bd1-85a4-e66276c82303",
|
|
60
|
+
datastakeId: "EV-000000000153",
|
|
61
|
+
name: "Request of security equipment",
|
|
62
|
+
authorId: "fc4ca5c6-f46d-424f-a948-d66b031a82c3",
|
|
63
|
+
collectId: "2142bd9f3306c9ec3c823f63bbbbb8fe3ebad7fa",
|
|
64
|
+
country: "CD",
|
|
65
|
+
date: "2025-08-11",
|
|
66
|
+
typeOfEvent: "testimonials",
|
|
67
|
+
implementers: [],
|
|
68
|
+
typeOfTestimonials: "request",
|
|
69
|
+
associatedSubjects: [],
|
|
70
|
+
testimonialsSource: [],
|
|
71
|
+
pictures: [],
|
|
72
|
+
documents: [],
|
|
73
|
+
channels: [],
|
|
74
|
+
published: true,
|
|
75
|
+
version: 1,
|
|
76
|
+
identifiedPerpetrators: [],
|
|
77
|
+
identifiedVictims: [],
|
|
78
|
+
assistedVictims: [],
|
|
79
|
+
mitigationMeasures: [],
|
|
80
|
+
createdAt: "2025-08-27T00:00:00.000Z",
|
|
81
|
+
updatedAt: "2025-08-27T15:10:00.619Z",
|
|
82
|
+
__v: 0,
|
|
83
|
+
percentageCompletion: 50,
|
|
84
|
+
meta: null,
|
|
85
|
+
namespace: "testimonials",
|
|
86
|
+
sources: ["fc4ca5c6-f46d-424f-a948-d66b031a82c3"],
|
|
87
|
+
type: "correctiveActions",
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
_id: "68af5d45b52f86d82f580fc8",
|
|
91
|
+
createdBy: "fc4ca5c6-f46d-424f-a948-d66b031a82c3",
|
|
92
|
+
form: "event",
|
|
93
|
+
id: "97348b4c-f7cf-4124-9b70-0f6891a40a15",
|
|
94
|
+
datastakeId: "EV-000000000161",
|
|
95
|
+
name: "76867485768",
|
|
96
|
+
authorId: "fc4ca5c6-f46d-424f-a948-d66b031a82c3",
|
|
97
|
+
collectId: "33b9aea707761a7a735aee81ebd29d5656f049fa",
|
|
98
|
+
country: "CD",
|
|
99
|
+
date: "2025-08-11",
|
|
100
|
+
typeOfEvent: "incident",
|
|
101
|
+
implementers: [],
|
|
102
|
+
associatedSubjects: [],
|
|
103
|
+
testimonialsSource: [],
|
|
104
|
+
pictures: [],
|
|
105
|
+
documents: [],
|
|
106
|
+
channels: [],
|
|
107
|
+
published: false,
|
|
108
|
+
version: 1,
|
|
109
|
+
identifiedPerpetrators: [],
|
|
110
|
+
identifiedVictims: [],
|
|
111
|
+
assistedVictims: [],
|
|
112
|
+
mitigationMeasures: [],
|
|
113
|
+
createdAt: "2025-08-27T00:00:00.000Z",
|
|
114
|
+
updatedAt: "2025-08-27T00:00:00.000Z",
|
|
115
|
+
__v: 0,
|
|
116
|
+
percentageCompletion: 40,
|
|
117
|
+
eventCategory: null,
|
|
118
|
+
initiative: null,
|
|
119
|
+
meta: null,
|
|
120
|
+
namespace: "incident",
|
|
121
|
+
primarySource: null,
|
|
122
|
+
severity: "major",
|
|
123
|
+
sources: ["fc4ca5c6-f46d-424f-a948-d66b031a82c3"],
|
|
124
|
+
type: "major_incident",
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
type: "Mine site",
|
|
128
|
+
total: 5,
|
|
129
|
+
sources: 2,
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
filtersConfig: [
|
|
133
|
+
{
|
|
134
|
+
label: "Location type",
|
|
135
|
+
placeholder: "Select",
|
|
136
|
+
key: "type",
|
|
137
|
+
type: "select",
|
|
138
|
+
value: "A",
|
|
139
|
+
options: [{ label: "Typ A", value: "A" }],
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
label: "Location type",
|
|
143
|
+
placeholder: "Select",
|
|
144
|
+
key: "type2",
|
|
145
|
+
type: "select",
|
|
146
|
+
value: undefined,
|
|
147
|
+
options: [{ label: "Typ A", value: "A" }],
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
type: "slider",
|
|
151
|
+
label: "Rating",
|
|
152
|
+
key: "rating",
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
onFilterChange: (v) => {
|
|
156
|
+
console.log(v);
|
|
157
|
+
},
|
|
158
|
+
// tooltipAsText: true,
|
|
159
|
+
primaryLink: true,
|
|
160
|
+
renderSider: () =>
|
|
161
|
+
isMineSite ? (
|
|
162
|
+
<div className="body-list">
|
|
163
|
+
<div className="body-row">
|
|
164
|
+
<span className="label">Territory</span>
|
|
165
|
+
<span>Territory</span>
|
|
166
|
+
</div>
|
|
162
167
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
168
|
+
<div className="body-row">
|
|
169
|
+
<span className="label">Territory</span>
|
|
170
|
+
<span>Territory</span>
|
|
171
|
+
</div>
|
|
167
172
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
173
|
+
<div className="body-row">
|
|
174
|
+
<span className="label">Territory</span>
|
|
175
|
+
<span>Territory</span>
|
|
176
|
+
</div>
|
|
177
|
+
</div>
|
|
178
|
+
) : (
|
|
179
|
+
<div className="daf-table-wrapper extra-small">
|
|
180
|
+
<DAFTable
|
|
181
|
+
loading={false}
|
|
182
|
+
scroll={{ y: 300 }}
|
|
183
|
+
className="no-padding no-margin"
|
|
184
|
+
data={[
|
|
185
|
+
{ worker: "Redis RIra", activity: "1234", key: 0 },
|
|
186
|
+
{ empty: true, key: 1 },
|
|
187
|
+
{ empty: true, key: 2 },
|
|
188
|
+
{ empty: true, key: 3 },
|
|
189
|
+
{ empty: true, key: 4 },
|
|
190
|
+
{ empty: true, key: 5 },
|
|
191
|
+
{ empty: true, key: 6 },
|
|
192
|
+
{ empty: true, key: 7 },
|
|
193
|
+
{ empty: true, key: 8 },
|
|
194
|
+
]}
|
|
195
|
+
pagination={false}
|
|
196
|
+
columns={[
|
|
197
|
+
{
|
|
198
|
+
title: "Worker",
|
|
199
|
+
dataIndex: "worker",
|
|
200
|
+
key: "worker",
|
|
201
|
+
ellipsis: true,
|
|
202
|
+
width: 90,
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
title: "Activity",
|
|
206
|
+
dataIndex: "activity",
|
|
207
|
+
key: "activity",
|
|
208
|
+
width: 90,
|
|
209
|
+
render: (_, all) => {
|
|
210
|
+
if (all.empty) {
|
|
211
|
+
return <div className="daf-default-cell md" />;
|
|
212
|
+
}
|
|
208
213
|
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
if (all.empty) {
|
|
224
|
-
return <div className="daf-default-cell md" />;
|
|
225
|
-
}
|
|
214
|
+
return (
|
|
215
|
+
<MoreTags values={[{ label: "DDdadsdas" }]} maxTextCont={40} />
|
|
216
|
+
);
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
title: "",
|
|
221
|
+
dataIndex: "action",
|
|
222
|
+
key: "action",
|
|
223
|
+
width: 34,
|
|
224
|
+
render: (_, all) => {
|
|
225
|
+
if (all.empty) {
|
|
226
|
+
return <div className="daf-default-cell md" />;
|
|
227
|
+
}
|
|
226
228
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
229
|
+
return <CustomIcon name="LinkNewTab" width={12} height={12} />;
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
]}
|
|
233
|
+
rowKey="key"
|
|
234
|
+
/>
|
|
235
|
+
</div>
|
|
236
|
+
),
|
|
237
|
+
renderTooltip: (data) => {
|
|
238
|
+
return [
|
|
239
|
+
{ label: "Workers", value: data?.administrativeLevel1 },
|
|
240
|
+
{ label: "Opinion", value: "RROFTE GERRDECI " },
|
|
241
|
+
];
|
|
242
|
+
},
|
|
243
|
+
link: true,
|
|
244
|
+
onClickLink: (data) => {
|
|
245
|
+
console.log(data);
|
|
246
|
+
},
|
|
245
247
|
};
|