datastake-daf 0.6.745 → 0.6.746
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 +71 -7
- package/dist/pages/index.css +1 -0
- package/dist/pages/index.js +3602 -12
- package/dist/style/datastake/mapbox-gl.css +330 -0
- package/package.json +1 -1
- package/src/@daf/core/components/Dashboard/Widget/ImageCarousel/index.jsx +75 -54
- package/src/@daf/core/components/Dashboard/Widget/ImageCarousel/style.js +44 -0
- package/src/@daf/core/components/Screens/TableScreen/TablePageWithTabs/index.jsx +128 -0
- package/src/@daf/{pages/pages → core/components/TableScreen}/TablePageWithTabs/index.jsx +3 -3
- package/src/@daf/pages/Documents/index.jsx +1 -1
- package/src/@daf/pages/Events/Activities/index.jsx +1 -1
- package/src/@daf/pages/Events/Incidents/index.jsx +1 -1
- package/src/@daf/pages/Events/index.jsx +1 -1
- package/src/@daf/pages/Locations/MineSite/index.jsx +1 -1
- package/src/@daf/pages/Locations/index.jsx +1 -1
- package/src/@daf/pages/Stakeholders/Operators/index.jsx +1 -1
- package/src/@daf/pages/Stakeholders/Workers/index.jsx +1 -1
- package/src/@daf/pages/Stakeholders/index.jsx +1 -1
- package/src/@daf/pages/Summary/Activities/Restoration/config.js +36 -0
- package/src/@daf/pages/Summary/Activities/Restoration/helper.js +98 -0
- package/src/@daf/pages/Summary/Activities/Restoration/index.jsx +178 -0
- package/src/@daf/pages/Summary/minesite/index.js +0 -0
- package/src/@daf/pages/Summary/operator/index.jsx +76 -0
- package/src/pages.js +6 -4
- package/src/@daf/pages/Events/Incidents2/columns.js +0 -176
- package/src/@daf/pages/Events/Incidents2/config.js +0 -170
- package/src/@daf/pages/Events/Incidents2/create.jsx +0 -104
- package/src/@daf/pages/Events/Incidents2/index.jsx +0 -156
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/GenderDistribution/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/GenderDistribution/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/Identification/hook.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/Identification/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/Locations/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/components/Locations/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/ChartsContainer/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/KeyIndicators/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/KeyIndicators/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/SupplyChainMap/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/components/TradeRelationships/index.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/SupplyChain/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/AccumulationGraph/hook.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/AccumulationGraph/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/ContributionsGraph/helper.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/ContributionsGraph/hook.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/ContributionsGraph/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/CustomSegment/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/DataChainOfCustody/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/DataCompilation/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/DataConsilidation/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/KeyIndicators/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/KeyIndicators/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/MineSites/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/MineSites/helper.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/MineSites/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/Triangulation/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/Triangulation/hook.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/components/Triangulation/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/config.js +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/UserDashboard/index.jsx +0 -0
- /package/src/@daf/pages/{dashboards → Dashboards}/helper.js +0 -0
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/* Isolated Mapbox GL CSS - Scoped to prevent Leaflet conflicts */
|
|
2
|
+
|
|
3
|
+
/* Mapbox GL Core Styles - Scoped with .mapbox-gl-scope */
|
|
4
|
+
.mapbox-gl-scope .mapboxgl-map {
|
|
5
|
+
font: 12px/20px Helvetica Neue, Arial, Helvetica, sans-serif;
|
|
6
|
+
overflow: hidden;
|
|
7
|
+
position: relative;
|
|
8
|
+
-webkit-tap-highlight-color: rgb(0 0 0/0);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.mapbox-gl-scope .mapboxgl-canvas {
|
|
12
|
+
left: 0;
|
|
13
|
+
position: absolute;
|
|
14
|
+
top: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.mapbox-gl-scope .mapboxgl-map:-webkit-full-screen {
|
|
18
|
+
height: 100%;
|
|
19
|
+
width: 100%;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.mapbox-gl-scope .mapboxgl-canary {
|
|
23
|
+
background-color: salmon;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-interactive,
|
|
27
|
+
.mapbox-gl-scope .mapboxgl-ctrl-group button.mapboxgl-ctrl-compass {
|
|
28
|
+
cursor: grab;
|
|
29
|
+
-webkit-user-select: none;
|
|
30
|
+
user-select: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer {
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-interactive:active,
|
|
38
|
+
.mapbox-gl-scope .mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active {
|
|
39
|
+
cursor: grabbing;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,
|
|
43
|
+
.mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas {
|
|
44
|
+
touch-action: pan-x pan-y;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-drag-pan,
|
|
48
|
+
.mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas {
|
|
49
|
+
touch-action: pinch-zoom;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,
|
|
53
|
+
.mapbox-gl-scope .mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas {
|
|
54
|
+
touch-action: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* Control positioning */
|
|
58
|
+
.mapbox-gl-scope .mapboxgl-ctrl-bottom,
|
|
59
|
+
.mapbox-gl-scope .mapboxgl-ctrl-bottom-left,
|
|
60
|
+
.mapbox-gl-scope .mapboxgl-ctrl-bottom-right,
|
|
61
|
+
.mapbox-gl-scope .mapboxgl-ctrl-left,
|
|
62
|
+
.mapbox-gl-scope .mapboxgl-ctrl-right,
|
|
63
|
+
.mapbox-gl-scope .mapboxgl-ctrl-top,
|
|
64
|
+
.mapbox-gl-scope .mapboxgl-ctrl-top-left,
|
|
65
|
+
.mapbox-gl-scope .mapboxgl-ctrl-top-right {
|
|
66
|
+
pointer-events: none;
|
|
67
|
+
position: absolute;
|
|
68
|
+
z-index: 2;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.mapbox-gl-scope .mapboxgl-ctrl-top-left {
|
|
72
|
+
left: 0;
|
|
73
|
+
top: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.mapbox-gl-scope .mapboxgl-ctrl-top {
|
|
77
|
+
left: 50%;
|
|
78
|
+
top: 0;
|
|
79
|
+
transform: translateX(-50%);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.mapbox-gl-scope .mapboxgl-ctrl-top-right {
|
|
83
|
+
right: 0;
|
|
84
|
+
top: 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.mapbox-gl-scope .mapboxgl-ctrl-right {
|
|
88
|
+
right: 0;
|
|
89
|
+
top: 50%;
|
|
90
|
+
transform: translateY(-50%);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.mapbox-gl-scope .mapboxgl-ctrl-bottom-right {
|
|
94
|
+
bottom: 0;
|
|
95
|
+
right: 0;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.mapbox-gl-scope .mapboxgl-ctrl-bottom {
|
|
99
|
+
bottom: 0;
|
|
100
|
+
left: 50%;
|
|
101
|
+
transform: translateX(-50%);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.mapbox-gl-scope .mapboxgl-ctrl-bottom-left {
|
|
105
|
+
bottom: 0;
|
|
106
|
+
left: 0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.mapbox-gl-scope .mapboxgl-ctrl-left {
|
|
110
|
+
left: 0;
|
|
111
|
+
top: 50%;
|
|
112
|
+
transform: translateY(-50%);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.mapbox-gl-scope .mapboxgl-ctrl {
|
|
116
|
+
clear: both;
|
|
117
|
+
pointer-events: auto;
|
|
118
|
+
transform: translate(0);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.mapbox-gl-scope .mapboxgl-ctrl-top-left .mapboxgl-ctrl {
|
|
122
|
+
float: left;
|
|
123
|
+
margin: 10px 0 0 10px;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.mapbox-gl-scope .mapboxgl-ctrl-top .mapboxgl-ctrl {
|
|
127
|
+
float: left;
|
|
128
|
+
margin: 10px 0;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.mapbox-gl-scope .mapboxgl-ctrl-top-right .mapboxgl-ctrl {
|
|
132
|
+
float: right;
|
|
133
|
+
margin: 10px 10px 0 0;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.mapbox-gl-scope .mapboxgl-ctrl-bottom-right .mapboxgl-ctrl,
|
|
137
|
+
.mapbox-gl-scope .mapboxgl-ctrl-right .mapboxgl-ctrl {
|
|
138
|
+
float: right;
|
|
139
|
+
margin: 0 10px 10px 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.mapbox-gl-scope .mapboxgl-ctrl-bottom .mapboxgl-ctrl {
|
|
143
|
+
float: left;
|
|
144
|
+
margin: 10px 0;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.mapbox-gl-scope .mapboxgl-ctrl-bottom-left .mapboxgl-ctrl,
|
|
148
|
+
.mapbox-gl-scope .mapboxgl-ctrl-left .mapboxgl-ctrl {
|
|
149
|
+
float: left;
|
|
150
|
+
margin: 0 0 10px 10px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/* Control group styling */
|
|
154
|
+
.mapbox-gl-scope .mapboxgl-ctrl-group {
|
|
155
|
+
background: #fff;
|
|
156
|
+
border-radius: 4px;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.mapbox-gl-scope .mapboxgl-ctrl-group:not(:empty) {
|
|
160
|
+
box-shadow: 0 0 0 2px #0000001a;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.mapbox-gl-scope .mapboxgl-ctrl-group button {
|
|
164
|
+
background-color: initial;
|
|
165
|
+
border: 0;
|
|
166
|
+
box-sizing: border-box;
|
|
167
|
+
cursor: pointer;
|
|
168
|
+
display: block;
|
|
169
|
+
height: 29px;
|
|
170
|
+
outline: none;
|
|
171
|
+
overflow: hidden;
|
|
172
|
+
padding: 0;
|
|
173
|
+
width: 29px;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.mapbox-gl-scope .mapboxgl-ctrl-group button+button {
|
|
177
|
+
border-top: 1px solid #ddd;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.mapbox-gl-scope .mapboxgl-ctrl button .mapboxgl-ctrl-icon {
|
|
181
|
+
background-position: 50%;
|
|
182
|
+
background-repeat: no-repeat;
|
|
183
|
+
display: block;
|
|
184
|
+
height: 100%;
|
|
185
|
+
width: 100%;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.mapbox-gl-scope .mapboxgl-ctrl-attrib-button:focus,
|
|
189
|
+
.mapbox-gl-scope .mapboxgl-ctrl-group button:focus {
|
|
190
|
+
box-shadow: 0 0 2px 2px #0096ff;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.mapbox-gl-scope .mapboxgl-ctrl button:disabled {
|
|
194
|
+
cursor: not-allowed;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.mapbox-gl-scope .mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon {
|
|
198
|
+
opacity: .25;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.mapbox-gl-scope .mapboxgl-ctrl-group button:first-child {
|
|
202
|
+
border-radius: 4px 4px 0 0;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
.mapbox-gl-scope .mapboxgl-ctrl-group button:last-child {
|
|
206
|
+
border-radius: 0 0 4px 4px;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.mapbox-gl-scope .mapboxgl-ctrl-group button:only-child {
|
|
210
|
+
border-radius: inherit;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.mapbox-gl-scope .mapboxgl-ctrl button:not(:disabled):hover {
|
|
214
|
+
background-color: #0000000d;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/* Marker styles */
|
|
218
|
+
.mapbox-gl-scope .mapboxgl-marker {
|
|
219
|
+
position: absolute;
|
|
220
|
+
z-index: 1;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.mapbox-gl-scope .mapboxgl-marker svg {
|
|
224
|
+
display: block;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/* Popup styles */
|
|
228
|
+
.mapbox-gl-scope .mapboxgl-popup {
|
|
229
|
+
position: absolute;
|
|
230
|
+
text-align: center;
|
|
231
|
+
margin-bottom: 20px;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.mapbox-gl-scope .mapboxgl-popup-content-wrapper {
|
|
235
|
+
padding: 1px;
|
|
236
|
+
text-align: left;
|
|
237
|
+
border-radius: 12px;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.mapbox-gl-scope .mapboxgl-popup-content {
|
|
241
|
+
margin: 13px 24px 13px 20px;
|
|
242
|
+
line-height: 1.3;
|
|
243
|
+
font-size: 13px;
|
|
244
|
+
min-height: 1px;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
.mapbox-gl-scope .mapboxgl-popup-content p {
|
|
248
|
+
margin: 17px 0;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.mapbox-gl-scope .mapboxgl-popup-tip-container {
|
|
252
|
+
width: 40px;
|
|
253
|
+
height: 20px;
|
|
254
|
+
position: absolute;
|
|
255
|
+
left: 50%;
|
|
256
|
+
margin-top: -1px;
|
|
257
|
+
margin-left: -20px;
|
|
258
|
+
overflow: hidden;
|
|
259
|
+
pointer-events: none;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
.mapbox-gl-scope .mapboxgl-popup-tip {
|
|
263
|
+
width: 17px;
|
|
264
|
+
height: 17px;
|
|
265
|
+
padding: 1px;
|
|
266
|
+
margin: -10px auto 0;
|
|
267
|
+
pointer-events: auto;
|
|
268
|
+
-webkit-transform: rotate(45deg);
|
|
269
|
+
-moz-transform: rotate(45deg);
|
|
270
|
+
-ms-transform: rotate(45deg);
|
|
271
|
+
transform: rotate(45deg);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.mapbox-gl-scope .mapboxgl-popup-content-wrapper,
|
|
275
|
+
.mapbox-gl-scope .mapboxgl-popup-tip {
|
|
276
|
+
background: white;
|
|
277
|
+
color: #333;
|
|
278
|
+
box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.mapbox-gl-scope .mapboxgl-popup-close-button {
|
|
282
|
+
position: absolute;
|
|
283
|
+
top: 0;
|
|
284
|
+
right: 0;
|
|
285
|
+
border: none;
|
|
286
|
+
text-align: center;
|
|
287
|
+
width: 24px;
|
|
288
|
+
height: 24px;
|
|
289
|
+
font: 16px/24px Tahoma, Verdana, sans-serif;
|
|
290
|
+
color: #757575;
|
|
291
|
+
text-decoration: none;
|
|
292
|
+
background: transparent;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.mapbox-gl-scope .mapboxgl-popup-close-button:hover,
|
|
296
|
+
.mapbox-gl-scope .mapboxgl-popup-close-button:focus {
|
|
297
|
+
color: #585858;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
/* Attribution */
|
|
301
|
+
.mapbox-gl-scope .mapboxgl-ctrl-attribution {
|
|
302
|
+
background: #fff;
|
|
303
|
+
background: rgba(255, 255, 255, 0.8);
|
|
304
|
+
margin: 0;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.mapbox-gl-scope .mapboxgl-ctrl-attribution,
|
|
308
|
+
.mapbox-gl-scope .mapboxgl-ctrl-scale-line {
|
|
309
|
+
padding: 0 5px;
|
|
310
|
+
color: #333;
|
|
311
|
+
line-height: 1.4;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
.mapbox-gl-scope .mapboxgl-ctrl-attribution a {
|
|
315
|
+
text-decoration: none;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
.mapbox-gl-scope .mapboxgl-ctrl-attribution a:hover,
|
|
319
|
+
.mapbox-gl-scope .mapboxgl-ctrl-attribution a:focus {
|
|
320
|
+
text-decoration: underline;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/* Hide attribution by default */
|
|
324
|
+
.mapbox-gl-scope .mapboxgl-ctrl-attribution {
|
|
325
|
+
display: none !important;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.mapbox-gl-scope .mapboxgl-ctrl-logo {
|
|
329
|
+
display: none !important;
|
|
330
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { useState, useRef } from "react";
|
|
2
2
|
import CarouselWidget from "../CarouselWidget/index.jsx";
|
|
3
|
-
import { Image, Carousel } from "antd";
|
|
3
|
+
import { Image, Carousel, Empty } from "antd";
|
|
4
4
|
import { LeftOutlined, RightOutlined } from "@ant-design/icons";
|
|
5
5
|
import CustomArrowButton from "./components/CustomArrowButton/index.js";
|
|
6
|
-
import { StyledCarouselWrapper } from "./style.js";
|
|
6
|
+
import { StyledCarouselWrapper, EmptyStateContainer } from "./style.js";
|
|
7
7
|
import PropTypes from "prop-types";
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -45,6 +45,8 @@ import PropTypes from "prop-types";
|
|
|
45
45
|
* @param {string} [props.arrowIconColor="#666"] - Default color of arrow icons
|
|
46
46
|
* @param {string} [props.arrowHoverIconColor="#1890ff"] - Color of arrow icons on hover
|
|
47
47
|
* @param {boolean} [props.customArrows=false] - Whether to show custom navigation arrows
|
|
48
|
+
* @param {ReactNode} [props.emptyLogo] - Custom logo/icon for empty state (defaults to Ant Design simple empty icon)
|
|
49
|
+
* @param {string|ReactNode} [props.emptyText="No Image"] - Custom text for empty state
|
|
48
50
|
* @param {Object} [props.rest] - Additional props passed to the underlying CarouselWidget component
|
|
49
51
|
*
|
|
50
52
|
* @features
|
|
@@ -74,6 +76,8 @@ function ImageCarousel({
|
|
|
74
76
|
arrowIconColor = "#666",
|
|
75
77
|
arrowHoverIconColor = "#1890ff",
|
|
76
78
|
customArrows = false,
|
|
79
|
+
emptyLogo = Empty.PRESENTED_IMAGE_SIMPLE,
|
|
80
|
+
emptyText = "No Image",
|
|
77
81
|
...rest
|
|
78
82
|
}) {
|
|
79
83
|
const [previewVisible, setPreviewVisible] = useState(false);
|
|
@@ -92,7 +96,11 @@ function ImageCarousel({
|
|
|
92
96
|
carouselRef.current?.next();
|
|
93
97
|
};
|
|
94
98
|
|
|
95
|
-
|
|
99
|
+
// Check if images array is empty or has no valid images
|
|
100
|
+
const hasImages = images && images.length > 0 && images.some(image => {
|
|
101
|
+
const imageSrc = typeof image === "string" ? image : image?.src;
|
|
102
|
+
return imageSrc && imageSrc.trim().length > 0;
|
|
103
|
+
});
|
|
96
104
|
return (
|
|
97
105
|
<>
|
|
98
106
|
<StyledCarouselWrapper
|
|
@@ -108,38 +116,47 @@ function ImageCarousel({
|
|
|
108
116
|
infinite
|
|
109
117
|
dots={false}
|
|
110
118
|
>
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
119
|
+
{hasImages ? (
|
|
120
|
+
<Carousel ref={carouselRef} afterChange={handleCarouselChange} arrows={false} {...rest} infinite>
|
|
121
|
+
{images.map((image, index) => {
|
|
122
|
+
const imageSrc = typeof image === "string" ? image : image.src;
|
|
123
|
+
const imageAlt =
|
|
124
|
+
typeof image === "string"
|
|
125
|
+
? `${title} - Image ${index + 1}`
|
|
126
|
+
: image.alt;
|
|
118
127
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
128
|
+
return (
|
|
129
|
+
<div key={imageSrc}>
|
|
130
|
+
<div className="image-container">
|
|
131
|
+
<Image
|
|
132
|
+
src={imageSrc}
|
|
133
|
+
alt={imageAlt}
|
|
134
|
+
fallback={fallback}
|
|
135
|
+
loading="lazy"
|
|
136
|
+
preview={{
|
|
137
|
+
visible: false,
|
|
138
|
+
}}
|
|
139
|
+
onClick={() => {
|
|
140
|
+
setCurrent(index);
|
|
141
|
+
setPreviewVisible(true);
|
|
142
|
+
}}
|
|
143
|
+
/>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
);
|
|
147
|
+
})}
|
|
148
|
+
</Carousel>
|
|
149
|
+
) : (
|
|
150
|
+
<EmptyStateContainer height={height}>
|
|
151
|
+
<Empty
|
|
152
|
+
image={emptyLogo || Empty.PRESENTED_IMAGE_SIMPLE}
|
|
153
|
+
description={<span style={{ color: '#8C8C8C' }}>{emptyText}</span>}
|
|
154
|
+
/>
|
|
155
|
+
</EmptyStateContainer>
|
|
156
|
+
)}
|
|
140
157
|
</CarouselWidget>
|
|
141
158
|
|
|
142
|
-
{customArrows &&
|
|
159
|
+
{customArrows && hasImages && images.length > 1 && (
|
|
143
160
|
<>
|
|
144
161
|
<CustomArrowButton
|
|
145
162
|
icon={<LeftOutlined />}
|
|
@@ -158,29 +175,31 @@ function ImageCarousel({
|
|
|
158
175
|
)}
|
|
159
176
|
</StyledCarouselWrapper>
|
|
160
177
|
|
|
161
|
-
|
|
162
|
-
<
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
178
|
+
{hasImages && (
|
|
179
|
+
<div style={{ display: "none" }}>
|
|
180
|
+
<Image.PreviewGroup
|
|
181
|
+
preview={{
|
|
182
|
+
visible: previewVisible,
|
|
183
|
+
current,
|
|
184
|
+
onVisibleChange: (vis) => setPreviewVisible(vis),
|
|
185
|
+
onChange: (idx) => {
|
|
186
|
+
setCurrent(idx);
|
|
187
|
+
carouselRef.current?.goTo(idx);
|
|
188
|
+
},
|
|
189
|
+
}}
|
|
190
|
+
>
|
|
191
|
+
{images.map((image, index) => {
|
|
192
|
+
const imageSrc = typeof image === "string" ? image : image.src;
|
|
193
|
+
const imageAlt =
|
|
194
|
+
typeof image === "string"
|
|
195
|
+
? `${title} - Image ${index + 1}`
|
|
196
|
+
: image.alt;
|
|
179
197
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
198
|
+
return <Image key={imageSrc} src={imageSrc} alt={imageAlt} />;
|
|
199
|
+
})}
|
|
200
|
+
</Image.PreviewGroup>
|
|
201
|
+
</div>
|
|
202
|
+
)}
|
|
184
203
|
</>
|
|
185
204
|
);
|
|
186
205
|
}
|
|
@@ -195,6 +214,8 @@ ImageCarousel.propTypes = {
|
|
|
195
214
|
arrowIconColor: PropTypes.string,
|
|
196
215
|
arrowHoverIconColor: PropTypes.string,
|
|
197
216
|
customArrows: PropTypes.bool,
|
|
217
|
+
emptyLogo: PropTypes.node,
|
|
218
|
+
emptyText: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),
|
|
198
219
|
};
|
|
199
220
|
|
|
200
221
|
export default ImageCarousel;
|
|
@@ -42,4 +42,48 @@ export const StyledCarouselWrapper = styled.div`
|
|
|
42
42
|
margin-bottom: -3px !important;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
export const EmptyStateContainer = styled.div`
|
|
48
|
+
width: 100%;
|
|
49
|
+
height: ${props => props.height || 400}px;
|
|
50
|
+
display: flex;
|
|
51
|
+
align-items: center;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
background-color: #ffffff;
|
|
54
|
+
border-radius: 6px;
|
|
55
|
+
position: relative;
|
|
56
|
+
|
|
57
|
+
.ant-empty {
|
|
58
|
+
margin: 0;
|
|
59
|
+
display: flex;
|
|
60
|
+
flex-direction: column;
|
|
61
|
+
align-items: center;
|
|
62
|
+
justify-content: center;
|
|
63
|
+
height: 100%;
|
|
64
|
+
width: 100%;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.ant-empty-image {
|
|
68
|
+
margin-bottom: 16px;
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
justify-content: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.ant-empty-description {
|
|
75
|
+
text-align: center;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
&::after {
|
|
79
|
+
content: '';
|
|
80
|
+
position: absolute;
|
|
81
|
+
bottom: 8px;
|
|
82
|
+
left: 50%;
|
|
83
|
+
transform: translateX(-50%);
|
|
84
|
+
width: 40px;
|
|
85
|
+
height: 2px;
|
|
86
|
+
background-color: #722ed1;
|
|
87
|
+
border-radius: 1px;
|
|
88
|
+
}
|
|
45
89
|
`;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react'
|
|
2
|
+
import { Tabs, Drawer } from 'antd'
|
|
3
|
+
import Header from '../../../Header/index.jsx'
|
|
4
|
+
import BaseScreen from '../../BaseScreen/index.jsx'
|
|
5
|
+
import { CREATE_DRAWER_WIDTH } from '../../../../../../helpers/Forms.js'
|
|
6
|
+
import DrawerHeader from '../../../Header/DrawerHeader/index.jsx'
|
|
7
|
+
|
|
8
|
+
const TablePageWithTabs = ({
|
|
9
|
+
t= () => {},
|
|
10
|
+
title,
|
|
11
|
+
breadCrumbs,
|
|
12
|
+
location,
|
|
13
|
+
loading = false,
|
|
14
|
+
goTo = () => {},
|
|
15
|
+
defaultActiveTab = "own",
|
|
16
|
+
checkboxConfig = {},
|
|
17
|
+
columns = [],
|
|
18
|
+
data = {},
|
|
19
|
+
APP,
|
|
20
|
+
getApiBaseUrl = () => {},
|
|
21
|
+
selectOptions = {},
|
|
22
|
+
selectFiltersConfig = {},
|
|
23
|
+
getRedirectLink = () => {},
|
|
24
|
+
filtersConfig = {},
|
|
25
|
+
isMobile,
|
|
26
|
+
view,
|
|
27
|
+
getActiveTab = () => {},
|
|
28
|
+
onDownload = () => {},
|
|
29
|
+
downloadDisabled = false,
|
|
30
|
+
drawerTitle = "",
|
|
31
|
+
onCreateModalClose = () => {},
|
|
32
|
+
children
|
|
33
|
+
}) => {
|
|
34
|
+
const params = new URLSearchParams(location?.search);
|
|
35
|
+
const [activeTab, setActiveTab] = useState(params.get("tab") || defaultActiveTab);
|
|
36
|
+
const [openCreateModal, setOpenCreateModal] = useState(params.has("create"));
|
|
37
|
+
|
|
38
|
+
const getActiveTabRef = useRef(getActiveTab);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
getActiveTabRef.current = getActiveTab;
|
|
41
|
+
}, [getActiveTab]);
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
getActiveTabRef.current(activeTab);
|
|
45
|
+
}, [activeTab]);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<div className="semibold form-input-output daf-create-view">
|
|
49
|
+
<Header
|
|
50
|
+
title={t(title)}
|
|
51
|
+
breadcrumbs={breadCrumbs}
|
|
52
|
+
actionButtons={[
|
|
53
|
+
{
|
|
54
|
+
type: "primary",
|
|
55
|
+
onClick: () => setOpenCreateModal(true),
|
|
56
|
+
tooltip: t("New"),
|
|
57
|
+
icon: "Add",
|
|
58
|
+
},
|
|
59
|
+
]}
|
|
60
|
+
onDownload={onDownload}
|
|
61
|
+
downloadDisabled={downloadDisabled}
|
|
62
|
+
/>
|
|
63
|
+
<Tabs
|
|
64
|
+
items={[
|
|
65
|
+
{ label: t("All Data"), key: "all" },
|
|
66
|
+
{ label: t("Own Data"), key: "own" },
|
|
67
|
+
{ label: t("Partners"), key: "shared" },
|
|
68
|
+
]}
|
|
69
|
+
defaultActiveKey={activeTab}
|
|
70
|
+
activeKey={activeTab}
|
|
71
|
+
onChange={(val) => {
|
|
72
|
+
if (loading) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
setActiveTab(val);
|
|
77
|
+
|
|
78
|
+
const newParams = new URLSearchParams(location?.search);
|
|
79
|
+
newParams.set("tab", val);
|
|
80
|
+
goTo(`${location.pathname}?${newParams.toString()}`);
|
|
81
|
+
}}
|
|
82
|
+
className="view-page-tabs mt-3"
|
|
83
|
+
/>
|
|
84
|
+
<BaseScreen
|
|
85
|
+
t={t}
|
|
86
|
+
checkboxConfig={checkboxConfig}
|
|
87
|
+
defaultTableFilters={{}}
|
|
88
|
+
columns={columns}
|
|
89
|
+
data={data}
|
|
90
|
+
loading={loading}
|
|
91
|
+
location={location}
|
|
92
|
+
goTo={goTo}
|
|
93
|
+
APP={APP}
|
|
94
|
+
getApiBaseUrl={getApiBaseUrl}
|
|
95
|
+
selectOptions={selectOptions}
|
|
96
|
+
selectFilters={selectFiltersConfig}
|
|
97
|
+
view={view}
|
|
98
|
+
getRedirectLink={getRedirectLink}
|
|
99
|
+
defaultUrlParams={{}}
|
|
100
|
+
module={APP}
|
|
101
|
+
filtersConfig={filtersConfig}
|
|
102
|
+
isMobile={isMobile}
|
|
103
|
+
/>
|
|
104
|
+
{openCreateModal && (
|
|
105
|
+
<Drawer
|
|
106
|
+
destroyOnHidden
|
|
107
|
+
title={
|
|
108
|
+
<DrawerHeader
|
|
109
|
+
title={t(drawerTitle)}
|
|
110
|
+
/>
|
|
111
|
+
}
|
|
112
|
+
open={openCreateModal}
|
|
113
|
+
onClose={() => setOpenCreateModal(false)}
|
|
114
|
+
width={CREATE_DRAWER_WIDTH}
|
|
115
|
+
bodyStyle={{ padding: 0 }}
|
|
116
|
+
>
|
|
117
|
+
{typeof children === 'function'
|
|
118
|
+
? children({ onDrawerClose: () => setOpenCreateModal(false) })
|
|
119
|
+
: children
|
|
120
|
+
}
|
|
121
|
+
</Drawer>
|
|
122
|
+
)}
|
|
123
|
+
|
|
124
|
+
</div>
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export default TablePageWithTabs
|