datastake-daf 0.6.169 → 0.6.170
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 +33 -46
- package/package.json +1 -1
- package/src/@daf/core/components/EditForm/_index.scss +3 -3
- package/src/@daf/core/components/Filters/FloatingFilters/index.js +35 -41
- package/src/@daf/core/components/UI/SDGIcon/index.jsx +3 -11
- package/src/@daf/core/components/UI/SDGIcon/styles.js +0 -2
- package/src/@daf/core/components/ViewForm/_index.scss +1 -1
- package/src/index.js +1 -3
- package/.env +0 -8
- package/.vscode/settings.json +0 -13
- package/src/@daf/core/components/Filters/FloatingFilters/FloatingFilters.stories.jsx +0 -64
package/dist/components/index.js
CHANGED
|
@@ -12398,25 +12398,26 @@ function Loading(_ref) {
|
|
|
12398
12398
|
const {
|
|
12399
12399
|
Paragraph
|
|
12400
12400
|
} = antd.Typography;
|
|
12401
|
-
const useHeader =
|
|
12402
|
-
|
|
12403
|
-
|
|
12404
|
-
|
|
12405
|
-
|
|
12406
|
-
|
|
12407
|
-
|
|
12408
|
-
|
|
12409
|
-
|
|
12410
|
-
|
|
12411
|
-
|
|
12412
|
-
|
|
12413
|
-
|
|
12414
|
-
|
|
12415
|
-
|
|
12416
|
-
|
|
12417
|
-
|
|
12418
|
-
|
|
12419
|
-
|
|
12401
|
+
const useHeader = _ref => {
|
|
12402
|
+
let {
|
|
12403
|
+
title = '',
|
|
12404
|
+
tooltip = '',
|
|
12405
|
+
supportText = '',
|
|
12406
|
+
tags = [],
|
|
12407
|
+
actionButtons: _actionButtons = [],
|
|
12408
|
+
titleTooltip,
|
|
12409
|
+
className,
|
|
12410
|
+
addedHeader = null,
|
|
12411
|
+
addedHeaderFirst,
|
|
12412
|
+
extraButtons: _extraButtons = [],
|
|
12413
|
+
onDownload,
|
|
12414
|
+
downloadDisabled,
|
|
12415
|
+
goBackTo,
|
|
12416
|
+
loading,
|
|
12417
|
+
renderExtraComponents,
|
|
12418
|
+
app = '',
|
|
12419
|
+
isViewMode = false
|
|
12420
|
+
} = _ref;
|
|
12420
12421
|
const downloadButtonAction = app && app === 'sbg' && isViewMode ? null : {
|
|
12421
12422
|
onClick: onDownload,
|
|
12422
12423
|
disabled: downloadDisabled,
|
|
@@ -12442,9 +12443,9 @@ const useHeader = ({
|
|
|
12442
12443
|
const buttonCont = React.useRef();
|
|
12443
12444
|
const [mainContWidth, setMainContWidth] = React.useState(600);
|
|
12444
12445
|
const [buttonContWidth, setButtonContWidth] = React.useState(0);
|
|
12445
|
-
const hasSupportText = !!supportText
|
|
12446
|
-
const hasTags = !!tags
|
|
12447
|
-
const hasButtons = !!(actionButtons
|
|
12446
|
+
const hasSupportText = !!(supportText !== null && supportText !== void 0 && supportText.length);
|
|
12447
|
+
const hasTags = !!(tags !== null && tags !== void 0 && tags.length);
|
|
12448
|
+
const hasButtons = !!(actionButtons !== null && actionButtons !== void 0 && actionButtons.length || extraButtons !== null && extraButtons !== void 0 && extraButtons.length);
|
|
12448
12449
|
React.useEffect(() => {
|
|
12449
12450
|
const mainContObserver = new ResizeObserver(entries => {
|
|
12450
12451
|
const _mainEntry = entries[0];
|
|
@@ -18244,12 +18245,6 @@ function Filters({
|
|
|
18244
18245
|
})
|
|
18245
18246
|
})]
|
|
18246
18247
|
});
|
|
18247
|
-
// case "slider":
|
|
18248
|
-
// return (
|
|
18249
|
-
// <div className="form-row">
|
|
18250
|
-
// <label>{filter.label}</label>
|
|
18251
|
-
// </div>
|
|
18252
|
-
// );
|
|
18253
18248
|
default:
|
|
18254
18249
|
return null;
|
|
18255
18250
|
}
|
|
@@ -20481,18 +20476,15 @@ const SDGList = dt.ul`
|
|
|
20481
20476
|
justify-content: center;
|
|
20482
20477
|
background: var(--base-gray-30);
|
|
20483
20478
|
color: var(--base-gray-90);
|
|
20484
|
-
border-radius: 8px;
|
|
20485
|
-
border: 1px solid var(--base-gray-30);
|
|
20486
20479
|
}
|
|
20487
20480
|
`;
|
|
20488
20481
|
|
|
20489
20482
|
const GAP_BETWEEN_SDGS = 4;
|
|
20490
|
-
function SDGIcons(
|
|
20491
|
-
|
|
20492
|
-
|
|
20493
|
-
|
|
20494
|
-
|
|
20495
|
-
} = _ref;
|
|
20483
|
+
function SDGIcons({
|
|
20484
|
+
sdgList = [],
|
|
20485
|
+
t = str => str,
|
|
20486
|
+
iconSize = 24
|
|
20487
|
+
}) {
|
|
20496
20488
|
const containerRef = React__default["default"].useRef(null);
|
|
20497
20489
|
const [width, setWidth] = React__default["default"].useState(0);
|
|
20498
20490
|
React__default["default"].useEffect(() => {
|
|
@@ -20533,10 +20525,10 @@ function SDGIcons(_ref) {
|
|
|
20533
20525
|
children: [visibleSdgs.map((sdg, index) => /*#__PURE__*/jsxRuntime.jsx("li", {
|
|
20534
20526
|
className: "project-widget-item",
|
|
20535
20527
|
children: /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
20536
|
-
title: t(
|
|
20528
|
+
title: t(`SDGS::${sdg}`),
|
|
20537
20529
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
20538
20530
|
style: {
|
|
20539
|
-
backgroundImage:
|
|
20531
|
+
backgroundImage: `url(${SDG_IMAGES[sdg].img})`,
|
|
20540
20532
|
height: iconSize,
|
|
20541
20533
|
width: iconSize
|
|
20542
20534
|
},
|
|
@@ -20555,25 +20547,21 @@ function SDGIcons(_ref) {
|
|
|
20555
20547
|
maxWidth: 200
|
|
20556
20548
|
},
|
|
20557
20549
|
children: sdgList.slice(visibleSdgs.length).map((sdg, idx) => /*#__PURE__*/jsxRuntime.jsx(antd.Tooltip, {
|
|
20558
|
-
title: t(
|
|
20550
|
+
title: t(`SDGS::${sdg}`),
|
|
20559
20551
|
children: /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
20560
20552
|
style: {
|
|
20561
20553
|
width: iconSize,
|
|
20562
20554
|
height: iconSize,
|
|
20563
|
-
backgroundImage:
|
|
20555
|
+
backgroundImage: `url(${SDG_IMAGES[sdg].img})`,
|
|
20564
20556
|
backgroundSize: "cover",
|
|
20565
20557
|
borderRadius: 4
|
|
20566
20558
|
},
|
|
20567
|
-
title: t(
|
|
20559
|
+
title: t(`SDGS::${sdg}`)
|
|
20568
20560
|
})
|
|
20569
20561
|
}, idx))
|
|
20570
20562
|
}),
|
|
20571
20563
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
20572
20564
|
className: "sdg-item-image sdg-item-more",
|
|
20573
|
-
style: {
|
|
20574
|
-
height: iconSize,
|
|
20575
|
-
width: iconSize
|
|
20576
|
-
},
|
|
20577
20565
|
children: ["+", hiddenCount]
|
|
20578
20566
|
})
|
|
20579
20567
|
})
|
|
@@ -60236,7 +60224,6 @@ exports.ProjectVisualisationSelect = CustomSelect;
|
|
|
60236
60224
|
exports.ProjectWidget = ProjectWidget;
|
|
60237
60225
|
exports.RadarChart = RadarChart;
|
|
60238
60226
|
exports.RadialBarChart = RadialBarChart;
|
|
60239
|
-
exports.SDGIcons = SDGIcons;
|
|
60240
60227
|
exports.SDGWidget = SDGWidget;
|
|
60241
60228
|
exports.SearchFilters = SearchFilters;
|
|
60242
60229
|
exports.Segment = Segment;
|
package/package.json
CHANGED
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
flex-direction: column;
|
|
165
165
|
overflow-y: auto;
|
|
166
166
|
height: 100%; // Ensure content takes full height
|
|
167
|
-
padding: 20px 20px
|
|
167
|
+
padding: 20px 20px 60px 20px; // Increased bottom padding for better scrolling
|
|
168
168
|
|
|
169
169
|
&.risk-template.no-padding {
|
|
170
170
|
padding: 0;
|
|
@@ -354,7 +354,7 @@
|
|
|
354
354
|
padding-top: var(--size-lg);
|
|
355
355
|
overflow: auto;
|
|
356
356
|
flex-direction: column;
|
|
357
|
-
padding: 20px 100px
|
|
357
|
+
padding: 20px 100px 60px 100px; // Added bottom padding for better scrolling
|
|
358
358
|
&.has-section {
|
|
359
359
|
width: calc(100% - 200px);
|
|
360
360
|
}
|
|
@@ -1229,7 +1229,7 @@
|
|
|
1229
1229
|
padding-top: var(--size-lg);
|
|
1230
1230
|
overflow: auto;
|
|
1231
1231
|
flex-direction: column;
|
|
1232
|
-
padding: var(--size-lg) var(--size-lg)
|
|
1232
|
+
padding: var(--size-lg) var(--size-lg) 60px var(--size-lg); // Added bottom padding for better scrolling
|
|
1233
1233
|
|
|
1234
1234
|
.main-form {
|
|
1235
1235
|
min-width: 400px;
|
|
@@ -4,48 +4,42 @@ import { Fragment, useState } from "react";
|
|
|
4
4
|
import Style from "./style.js";
|
|
5
5
|
|
|
6
6
|
export default function Filters({ t, filtersConfig, onFilterChange }) {
|
|
7
|
-
|
|
7
|
+
const [opened, setOpened] = useState(false);
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
// </div>
|
|
29
|
-
// );
|
|
30
|
-
default:
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
9
|
+
const renderFilter = (filter) => {
|
|
10
|
+
switch (filter.type) {
|
|
11
|
+
case "select":
|
|
12
|
+
return (
|
|
13
|
+
<div className="form-row">
|
|
14
|
+
<label>{filter.label}</label>
|
|
15
|
+
<Select
|
|
16
|
+
allowClear
|
|
17
|
+
placeholder={filter.placeholder}
|
|
18
|
+
value={filter.value}
|
|
19
|
+
options={filter.options}
|
|
20
|
+
onChange={(c) => onFilterChange({ [filter.key]: c })}
|
|
21
|
+
/>
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
default:
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
34
28
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
29
|
+
return (
|
|
30
|
+
<Style>
|
|
31
|
+
<Button onClick={() => setOpened((p) => !p)}>
|
|
32
|
+
{t("Filter")}
|
|
33
|
+
<CustomIcon width={16} height={16} name="Filter" />
|
|
34
|
+
</Button>
|
|
41
35
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
36
|
+
{opened ? (
|
|
37
|
+
<div className="filters">
|
|
38
|
+
{filtersConfig?.map((filter) => (
|
|
39
|
+
<Fragment key={filter.key}>{renderFilter(filter)}</Fragment>
|
|
40
|
+
))}
|
|
41
|
+
</div>
|
|
42
|
+
) : null}
|
|
43
|
+
</Style>
|
|
44
|
+
);
|
|
51
45
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Tooltip, Popover } from "antd";
|
|
3
|
-
import { SDG_IMAGES } from "../../../../../constants/SDGs
|
|
4
|
-
import { SDGList } from "./styles
|
|
3
|
+
import { SDG_IMAGES } from "../../../../../constants/SDGs";
|
|
4
|
+
import { SDGList } from "./styles";
|
|
5
5
|
|
|
6
6
|
const GAP_BETWEEN_SDGS = 4;
|
|
7
7
|
|
|
@@ -90,15 +90,7 @@ export default function SDGIcons({
|
|
|
90
90
|
</div>
|
|
91
91
|
}
|
|
92
92
|
>
|
|
93
|
-
<div
|
|
94
|
-
className="sdg-item-image sdg-item-more"
|
|
95
|
-
style={{
|
|
96
|
-
height: iconSize,
|
|
97
|
-
width: iconSize,
|
|
98
|
-
}}
|
|
99
|
-
>
|
|
100
|
-
+{hiddenCount}
|
|
101
|
-
</div>
|
|
93
|
+
<div className="sdg-item-image sdg-item-more">+{hiddenCount}</div>
|
|
102
94
|
</Popover>
|
|
103
95
|
</li>
|
|
104
96
|
)}
|
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
display: flex;
|
|
232
232
|
flex-direction: column;
|
|
233
233
|
overflow-y: auto;
|
|
234
|
-
padding: var(--size-lg) var(--size-lg)
|
|
234
|
+
padding: var(--size-lg) var(--size-lg) 60px var(--size-lg); // Added bottom padding for better scrolling
|
|
235
235
|
|
|
236
236
|
&.no-padding {
|
|
237
237
|
padding: 0px;
|
package/src/index.js
CHANGED
|
@@ -23,6 +23,7 @@ export { default as Badge } from "./@daf/core/components/Badge/index.jsx";
|
|
|
23
23
|
// Icons
|
|
24
24
|
export { default as GetIcon } from "./@daf/core/components/Icon/index.jsx";
|
|
25
25
|
export { default as CustomIcon } from "./@daf/core/components/Icon/CustomIcon.jsx";
|
|
26
|
+
|
|
26
27
|
// Filters
|
|
27
28
|
export {
|
|
28
29
|
default as SelectFilters,
|
|
@@ -161,6 +162,3 @@ export { default as InformationChannelsSubject } from "./@daf/core/components/Sc
|
|
|
161
162
|
export { default as InformationChannelsView } from "./@daf/core/components/Screens/InformationChannels/InformationChannel/index.js";
|
|
162
163
|
export { default as InformationChannelsDataPoint } from "./@daf/core/components/Screens/InformationChannels/DataPoint/index.js";
|
|
163
164
|
export { InformationChannelProvider } from "./@daf/core/components/Screens/InformationChannels/context/index.js";
|
|
164
|
-
|
|
165
|
-
// UI
|
|
166
|
-
export { default as SDGIcons } from "./@daf/core/components/UI/SDGIcon/index.jsx";
|
package/.env
DELETED
package/.vscode/settings.json
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"cSpell.words": ["cukura"],
|
|
3
|
-
"files.autoSave": "afterDelay",
|
|
4
|
-
"editor.wordWrap": "on",
|
|
5
|
-
"editor.autoClosingBrackets": "always",
|
|
6
|
-
"editor.autoClosingComments": "always",
|
|
7
|
-
"editor.autoClosingQuotes": "always",
|
|
8
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
9
|
-
"editor.formatOnPaste": true,
|
|
10
|
-
"editor.formatOnSave": true,
|
|
11
|
-
"notebook.defaultFormatter": "esbenp.prettier-vscode",
|
|
12
|
-
"javascript.format.semicolons": "insert"
|
|
13
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import SearchFilters from "./index";
|
|
2
|
-
import ThemeLayout from "../../ThemeLayout";
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: "Core/Filters/FloatingFilters",
|
|
6
|
-
component: SearchFilters,
|
|
7
|
-
tags: ["autodocs"],
|
|
8
|
-
decorators: [
|
|
9
|
-
(Story) => (
|
|
10
|
-
<ThemeLayout>
|
|
11
|
-
<Story />
|
|
12
|
-
</ThemeLayout>
|
|
13
|
-
),
|
|
14
|
-
],
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const Primary = {
|
|
18
|
-
name: "Search Filters",
|
|
19
|
-
args: {
|
|
20
|
-
t: (key) => key,
|
|
21
|
-
filtersConfig: [
|
|
22
|
-
{
|
|
23
|
-
type: "select",
|
|
24
|
-
label: "Category",
|
|
25
|
-
placeholder: "Select a category",
|
|
26
|
-
key: "category",
|
|
27
|
-
options: [
|
|
28
|
-
{ label: "Books", value: "books" },
|
|
29
|
-
{ label: "Electronics", value: "electronics" },
|
|
30
|
-
{ label: "Clothing", value: "clothing" },
|
|
31
|
-
],
|
|
32
|
-
value: null,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
type: "select",
|
|
36
|
-
label: "Price Range",
|
|
37
|
-
placeholder: "Select a price range",
|
|
38
|
-
key: "priceRange",
|
|
39
|
-
options: [
|
|
40
|
-
{ label: "$0 - $50", value: "0-50" },
|
|
41
|
-
{ label: "$51 - $100", value: "51-100" },
|
|
42
|
-
{ label: "$101 - $200", value: "101-200" },
|
|
43
|
-
],
|
|
44
|
-
value: null,
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
type: "slider",
|
|
48
|
-
label: "Rating",
|
|
49
|
-
key: "rating",
|
|
50
|
-
min: 1,
|
|
51
|
-
max: 5,
|
|
52
|
-
value: 3,
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
onFilterChange: (changedFilter) => {
|
|
56
|
-
console.log("Filter changed:", changedFilter);
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
render: (args) => (
|
|
60
|
-
<div style={{ position: "relative", height: "400px" }}>
|
|
61
|
-
<SearchFilters {...args} />
|
|
62
|
-
</div>
|
|
63
|
-
),
|
|
64
|
-
};
|