datastake-daf 0.6.147 → 0.6.148
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/.vscode/settings.json +13 -0
- package/dist/components/index.css +1 -1
- package/dist/components/index.js +251 -155
- package/dist/utils/index.js +22 -5
- package/package.json +1 -1
- package/src/@daf/core/components/Dashboard/Globe/hook.js +1 -106
- package/src/@daf/core/components/Dashboard/Globe/index.jsx +1 -13
- package/src/@daf/core/components/Dashboard/Globe/style.js +0 -11
- package/src/@daf/core/components/Dashboard/Widget/KeyIndicators/index.jsx +4 -3
- package/src/@daf/core/components/Dashboard/Widget/ProjectWidget/ProjectWidget.stories.jsx +72 -0
- package/src/@daf/core/components/Dashboard/Widget/ProjectWidget/index.jsx +84 -0
- package/src/@daf/core/components/Dashboard/Widget/ProjectWidget/style.js +74 -0
- package/src/@daf/core/components/Dashboard/Widget/SDGWidget/SDGWidget.stories.jsx +33 -17
- package/src/@daf/core/components/Dashboard/Widget/SDGWidget/config.js +4 -22
- package/src/@daf/core/components/Dashboard/Widget/SDGWidget/index.jsx +3 -3
- package/src/@daf/core/components/Dashboard/Widget/index.jsx +95 -82
- package/src/@daf/core/components/ProgressTabs/_index.scss +1 -11
- package/src/constants/SDGs.js +92 -0
- package/src/constants/locales/en/translation.js +1357 -1269
- package/src/index.js +11 -6
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
PlusOutlined,
|
|
8
8
|
DownOutlined,
|
|
9
9
|
UpOutlined,
|
|
10
|
-
RightOutlined
|
|
10
|
+
RightOutlined,
|
|
11
11
|
} from "@ant-design/icons";
|
|
12
12
|
import CustomIcon from "../../Icon/CustomIcon.jsx";
|
|
13
13
|
import WidgetLoader from "./WidgetLoader/index.jsx";
|
|
@@ -18,6 +18,7 @@ import { useCollapse } from "react-collapsed";
|
|
|
18
18
|
|
|
19
19
|
export default function Widget({
|
|
20
20
|
title = "",
|
|
21
|
+
noTitle = false,
|
|
21
22
|
children,
|
|
22
23
|
addedHeader = null,
|
|
23
24
|
tooltip,
|
|
@@ -73,102 +74,114 @@ export default function Widget({
|
|
|
73
74
|
])}
|
|
74
75
|
>
|
|
75
76
|
{loading && fullWidgetLoading && <WidgetLoader background="white" />}
|
|
76
|
-
|
|
77
|
-
<div className="
|
|
78
|
-
<div className="
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
{tooltip && (
|
|
83
|
-
<div className="cont icon-cont">
|
|
84
|
-
<Tooltip
|
|
85
|
-
rootClassName="dashboard-tooltip"
|
|
86
|
-
title={<div className="max-w-250">{tooltip}</div>}
|
|
87
|
-
>
|
|
88
|
-
<InfoCircleOutlined />
|
|
89
|
-
</Tooltip>
|
|
77
|
+
{!noTitle && (
|
|
78
|
+
<div className="widget-header flex-column">
|
|
79
|
+
<div className="flex flex-row widget-header-items">
|
|
80
|
+
<div className="title cont">
|
|
81
|
+
<h1>{title}</h1>
|
|
90
82
|
</div>
|
|
91
|
-
)}
|
|
92
83
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
84
|
+
{tooltip && (
|
|
85
|
+
<div className="cont icon-cont">
|
|
86
|
+
<Tooltip
|
|
87
|
+
rootClassName="dashboard-tooltip"
|
|
88
|
+
title={<div className="max-w-250">{tooltip}</div>}
|
|
89
|
+
>
|
|
90
|
+
<InfoCircleOutlined />
|
|
91
|
+
</Tooltip>
|
|
92
|
+
</div>
|
|
93
|
+
)}
|
|
94
|
+
|
|
95
|
+
{!!filtersConfig && (
|
|
96
|
+
<div className="flex-1 flex justify-content-end">
|
|
97
|
+
<Button onClick={() => setShowFilters((p) => !p)}>
|
|
98
|
+
<CustomIcon
|
|
99
|
+
name="Filter"
|
|
100
|
+
width={14}
|
|
101
|
+
height={13}
|
|
102
|
+
className="mt-1"
|
|
103
|
+
/>
|
|
104
|
+
</Button>
|
|
105
|
+
</div>
|
|
106
|
+
)}
|
|
100
107
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
{isCollapsable && (
|
|
104
|
-
<div className="flex justify-content-end">
|
|
105
|
-
<Button
|
|
106
|
-
size="small"
|
|
107
|
-
className="flex-1 no-min-width"
|
|
108
|
-
onClick={handleCollapseToggle}
|
|
109
|
-
icon={
|
|
110
|
-
isCollapsed ? (
|
|
111
|
-
<RightOutlined style={{ width: 12 }} />
|
|
112
|
-
) : (
|
|
113
|
-
<DownOutlined style={{ width: 12 }} />
|
|
114
|
-
)
|
|
115
|
-
}
|
|
116
|
-
/>
|
|
117
|
-
</div>
|
|
118
|
-
)}
|
|
108
|
+
{addedHeaderFirst && addedHeader}
|
|
119
109
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
className={formatClassname([
|
|
123
|
-
!(filtersConfig || addedHeaderFirst || isCollapsable) && "flex-1",
|
|
124
|
-
"flex justify-content-end",
|
|
125
|
-
])}
|
|
126
|
-
>
|
|
127
|
-
<div className="flex flex-column" {...getToggleProps()}>
|
|
110
|
+
{isCollapsable && (
|
|
111
|
+
<div className="flex justify-content-end">
|
|
128
112
|
<Button
|
|
129
113
|
size="small"
|
|
130
114
|
className="flex-1 no-min-width"
|
|
115
|
+
onClick={handleCollapseToggle}
|
|
131
116
|
icon={
|
|
132
|
-
|
|
133
|
-
<RightOutlined style={{ width:
|
|
134
|
-
//<PlusOutlined style={{width: 10}} />
|
|
117
|
+
isCollapsed ? (
|
|
118
|
+
<RightOutlined style={{ width: 12 }} />
|
|
135
119
|
) : (
|
|
136
|
-
|
|
137
|
-
<DownOutlined style={{ width: 10, paddingTop: '4px' }} />
|
|
120
|
+
<DownOutlined style={{ width: 12 }} />
|
|
138
121
|
)
|
|
139
122
|
}
|
|
140
123
|
/>
|
|
141
124
|
</div>
|
|
142
|
-
|
|
143
|
-
|
|
125
|
+
)}
|
|
126
|
+
|
|
127
|
+
{expandable ? (
|
|
128
|
+
<div
|
|
129
|
+
className={formatClassname([
|
|
130
|
+
!(filtersConfig || addedHeaderFirst || isCollapsable) &&
|
|
131
|
+
"flex-1",
|
|
132
|
+
"flex justify-content-end",
|
|
133
|
+
])}
|
|
134
|
+
>
|
|
135
|
+
<div className="flex flex-column" {...getToggleProps()}>
|
|
136
|
+
<Button
|
|
137
|
+
size="small"
|
|
138
|
+
className="flex-1 no-min-width"
|
|
139
|
+
icon={
|
|
140
|
+
!isExpanded ? (
|
|
141
|
+
<RightOutlined
|
|
142
|
+
style={{ width: 10, paddingTop: "4px" }}
|
|
143
|
+
/>
|
|
144
|
+
) : (
|
|
145
|
+
//<PlusOutlined style={{width: 10}} />
|
|
146
|
+
//<MinusOutlined style={{ width: 10 }} />
|
|
147
|
+
<DownOutlined
|
|
148
|
+
style={{ width: 10, paddingTop: "4px" }}
|
|
149
|
+
/>
|
|
150
|
+
)
|
|
151
|
+
}
|
|
152
|
+
/>
|
|
153
|
+
</div>
|
|
154
|
+
</div>
|
|
155
|
+
) : null}
|
|
144
156
|
|
|
145
|
-
|
|
146
|
-
|
|
157
|
+
{!addedHeaderFirst && addedHeader}
|
|
158
|
+
</div>
|
|
147
159
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
160
|
+
{!!filtersConfig && (
|
|
161
|
+
<SelectFilters
|
|
162
|
+
t={filtersConfig.t}
|
|
163
|
+
apiUrl={apiUrl}
|
|
164
|
+
showFilters={showFilters}
|
|
165
|
+
onApply={filtersConfig.onApply}
|
|
166
|
+
options={filtersConfig.options}
|
|
167
|
+
setShowFilters={setShowFilters}
|
|
168
|
+
language={filtersConfig.language}
|
|
169
|
+
type={filtersConfig.type}
|
|
170
|
+
filtersConfig={filtersConfig.filtersConfig}
|
|
171
|
+
selectedFilters={filtersConfig.selectedFilters}
|
|
172
|
+
className={filtersConfig.className}
|
|
173
|
+
/>
|
|
174
|
+
)}
|
|
175
|
+
|
|
176
|
+
{!!tabsConfig && (
|
|
177
|
+
<TabsHeader
|
|
178
|
+
tabs={tabsConfig.tabs}
|
|
179
|
+
value={tabsConfig.value}
|
|
180
|
+
onChange={tabsConfig.onChange}
|
|
181
|
+
/>
|
|
182
|
+
)}
|
|
183
|
+
</div>
|
|
184
|
+
)}
|
|
172
185
|
|
|
173
186
|
{!isCollapsed && (
|
|
174
187
|
<div className="widget-body" {...(expandable ? getCollapseProps() : {})}>
|
|
@@ -52,16 +52,6 @@
|
|
|
52
52
|
background: transparent;
|
|
53
53
|
color: #d1d5db;
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
// Override disabled styles when the item is selected
|
|
57
|
-
&.ant-segmented-item-selected {
|
|
58
|
-
background: #ffffff !important;
|
|
59
|
-
color: #374151 !important;
|
|
60
|
-
font-weight: 600 !important;
|
|
61
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
|
|
62
|
-
opacity: 1 !important;
|
|
63
|
-
cursor: pointer !important;
|
|
64
|
-
}
|
|
65
55
|
}
|
|
66
56
|
}
|
|
67
57
|
|
|
@@ -90,7 +80,7 @@
|
|
|
90
80
|
}
|
|
91
81
|
|
|
92
82
|
// Responsive design
|
|
93
|
-
@media (max-width:
|
|
83
|
+
@media (max-width: 768px) {
|
|
94
84
|
&__segmented {
|
|
95
85
|
.ant-segmented-item {
|
|
96
86
|
font-size: 12px;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
const SDG_KEYS = {
|
|
2
|
+
NO_POVERTY: "noPoverty",
|
|
3
|
+
ZERO_HUNGER: "zeroHunger",
|
|
4
|
+
GOOD_HEALTH_WELL_BEING: "goodHealthWellbeing",
|
|
5
|
+
QUALITY_EDUCATION: "qualityEducation",
|
|
6
|
+
GENDER_EQUALITY: "genderEquality",
|
|
7
|
+
CLEAN_WATER_SANITATION: "cleanWaterSanitation",
|
|
8
|
+
AFFORDABLE_CLEAN_ENERGY: "affordableCleanEnergy",
|
|
9
|
+
DECENT_WORK_ECONOMIC_GROWTH: "decentWorkEconomicGrowth",
|
|
10
|
+
INDUSTRY_INNOVATION_INFRASTRUCTURE: "industryInnovationInfrastructure",
|
|
11
|
+
REDUCED_INEQUALITIES: "reducedInequalities",
|
|
12
|
+
SUSTAINABLE_CITIES_COMMUNITIES: "sustainableCitiesCommunities",
|
|
13
|
+
RESPONSIBLE_CONSUMPTION_PRODUCTION: "responsibleConsumptionProduction",
|
|
14
|
+
CLIMATE_ACTION: "climateAction",
|
|
15
|
+
LIFE_BELOW_WATER: "lifeBelowWater",
|
|
16
|
+
LIFE_ON_LAND: "lifeOnLand",
|
|
17
|
+
PEACE_JUSTICE_STRONG_INSTITUTIONS: "peaceJusticeStrongInstitutions",
|
|
18
|
+
PARTNERSHIPS_FOR_GOALS: "partnershipsForGoals",
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const SDG_IMAGES = {
|
|
22
|
+
[SDG_KEYS.NO_POVERTY]: {
|
|
23
|
+
img: "/SDGs/SDGs.svg",
|
|
24
|
+
disabled: "/SDGs/SDGs-17.svg",
|
|
25
|
+
},
|
|
26
|
+
[SDG_KEYS.ZERO_HUNGER]: {
|
|
27
|
+
img: "/SDGs/SDGs-1.svg",
|
|
28
|
+
disabled: "/SDGs/SDGs-18.svg",
|
|
29
|
+
},
|
|
30
|
+
[SDG_KEYS.GOOD_HEALTH_WELL_BEING]: {
|
|
31
|
+
img: "/SDGs/SDGs-2.svg",
|
|
32
|
+
disabled: "/SDGs/SDGs-19.svg",
|
|
33
|
+
},
|
|
34
|
+
[SDG_KEYS.QUALITY_EDUCATION]: {
|
|
35
|
+
img: "/SDGs/SDGs-3.svg",
|
|
36
|
+
disabled: "/SDGs/SDGs-20.svg",
|
|
37
|
+
},
|
|
38
|
+
[SDG_KEYS.GENDER_EQUALITY]: {
|
|
39
|
+
img: "/SDGs/SDGs-4.svg",
|
|
40
|
+
disabled: "/SDGs/SDGs-21.svg",
|
|
41
|
+
},
|
|
42
|
+
[SDG_KEYS.CLEAN_WATER_SANITATION]: {
|
|
43
|
+
img: "/SDGs/SDGs-5.svg",
|
|
44
|
+
disabled: "/SDGs/SDGs-22.svg",
|
|
45
|
+
},
|
|
46
|
+
[SDG_KEYS.AFFORDABLE_CLEAN_ENERGY]: {
|
|
47
|
+
img: "/SDGs/SDGs-6.svg",
|
|
48
|
+
disabled: "/SDGs/SDGs-23.svg",
|
|
49
|
+
},
|
|
50
|
+
[SDG_KEYS.DECENT_WORK_ECONOMIC_GROWTH]: {
|
|
51
|
+
img: "/SDGs/SDGs-7.svg",
|
|
52
|
+
disabled: "/SDGs/SDGs-24.svg",
|
|
53
|
+
},
|
|
54
|
+
[SDG_KEYS.INDUSTRY_INNOVATION_INFRASTRUCTURE]: {
|
|
55
|
+
img: "/SDGs/SDGs-8.svg",
|
|
56
|
+
disabled: "/SDGs/SDGs-25.svg",
|
|
57
|
+
},
|
|
58
|
+
[SDG_KEYS.REDUCED_INEQUALITIES]: {
|
|
59
|
+
img: "/SDGs/SDGs-9.svg",
|
|
60
|
+
disabled: "/SDGs/SDGs-26.svg",
|
|
61
|
+
},
|
|
62
|
+
[SDG_KEYS.SUSTAINABLE_CITIES_COMMUNITIES]: {
|
|
63
|
+
img: "/SDGs/SDGs-10.svg",
|
|
64
|
+
disabled: "/SDGs/SDGs-27.svg",
|
|
65
|
+
},
|
|
66
|
+
[SDG_KEYS.RESPONSIBLE_CONSUMPTION_PRODUCTION]: {
|
|
67
|
+
img: "/SDGs/SDGs-11.svg",
|
|
68
|
+
disabled: "/SDGs/SDGs-29.svg",
|
|
69
|
+
},
|
|
70
|
+
[SDG_KEYS.CLIMATE_ACTION]: {
|
|
71
|
+
img: "/SDGs/SDGs-12.svg",
|
|
72
|
+
disabled: "/SDGs/SDGs-30.svg",
|
|
73
|
+
},
|
|
74
|
+
[SDG_KEYS.LIFE_BELOW_WATER]: {
|
|
75
|
+
img: "/SDGs/SDGs-13.svg",
|
|
76
|
+
disabled: "/SDGs/SDGs-31.svg",
|
|
77
|
+
},
|
|
78
|
+
[SDG_KEYS.LIFE_ON_LAND]: {
|
|
79
|
+
img: "/SDGs/SDGs-14.svg",
|
|
80
|
+
disabled: "/SDGs/SDGs-32.svg",
|
|
81
|
+
},
|
|
82
|
+
[SDG_KEYS.PEACE_JUSTICE_STRONG_INSTITUTIONS]: {
|
|
83
|
+
img: "/SDGs/SDGs-15.svg",
|
|
84
|
+
disabled: "/SDGs/SDGs-33.svg",
|
|
85
|
+
},
|
|
86
|
+
[SDG_KEYS.PARTNERSHIPS_FOR_GOALS]: {
|
|
87
|
+
img: "/SDGs/SDGs-16.svg",
|
|
88
|
+
disabled: "/SDGs/SDGs-34.svg",
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export { SDG_KEYS, SDG_IMAGES };
|