datastake-daf 0.6.195 → 0.6.196

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.
@@ -5,94 +5,90 @@ import PropTypes from "prop-types";
5
5
  import ComponentWithFocus from "../../Dashboard/ComponentWithFocus/index.jsx";
6
6
 
7
7
  export default function StickyTable({
8
- size = "small",
9
- maxHeight = 300,
10
- containerHeight = 525,
11
- dataSource = [],
12
- columns = {},
13
- pagination = false,
14
- doEmptyRows = true,
15
- ...props
8
+ size = null,
9
+ maxHeight = 300,
10
+ containerHeight = 525,
11
+ dataSource = [],
12
+ columns = {},
13
+ pagination = false,
14
+ doEmptyRows = true,
15
+ ...props
16
16
  }) {
17
- const data = React.useMemo(() => {
18
- if (!doEmptyRows) {
19
- return dataSource;
20
- }
17
+ const data = React.useMemo(() => {
18
+ const MIN_ROWS = 4;
21
19
 
22
- const MIN_ROWS = 4;
20
+ if (dataSource.length < MIN_ROWS) {
21
+ const paddedData = [...dataSource];
22
+ while (paddedData.length < MIN_ROWS) {
23
+ paddedData.push({ empty: true });
24
+ }
25
+ return paddedData;
26
+ }
23
27
 
24
- if (dataSource.length < MIN_ROWS) {
25
- const paddedData = [...dataSource];
26
- while (paddedData.length < MIN_ROWS) {
27
- paddedData.push({ empty: true });
28
- }
29
- return paddedData;
30
- }
28
+ return dataSource;
29
+ }, [dataSource]);
31
30
 
32
- return dataSource;
33
- }, [dataSource, doEmptyRows]);
31
+ const Wrapper = React.useMemo(() => {
32
+ return data.length > 5 ? ComponentWithFocus : "div";
33
+ }, [data.length]);
34
34
 
35
- const Wrapper = React.useMemo(() => {
36
- return data.length > 5 ? ComponentWithFocus : "div";
37
- }, [data.length]);
38
-
39
- return (
40
- <Wrapper>
41
- <Style>
42
- <div
43
- className="daf-table-wrapper"
44
- style={{
45
- maxHeight: containerHeight,
46
- overflowY: "auto",
47
- }}
48
- >
49
- <div className="daf-sticky-table">
50
- <Table
51
- {...props}
52
- size={size}
53
- scroll
54
- sticky
55
- style={{ maxHeight }}
56
- dataSource={data}
57
- columns={columns}
58
- pagination={pagination}
59
- />
60
- </div>
61
- </div>
62
- </Style>
63
- </Wrapper>
64
- );
35
+ return (
36
+ <Wrapper>
37
+ <Style>
38
+ <div
39
+ className="daf-table-wrapper"
40
+ style={{
41
+ maxHeight: containerHeight,
42
+ overflowY: "auto",
43
+ }}
44
+ >
45
+ <div className="daf-sticky-table">
46
+ <Table
47
+ {...props}
48
+ size={size}
49
+ scroll
50
+ sticky
51
+ style={{ maxHeight }}
52
+ dataSource={data}
53
+ columns={columns}
54
+ pagination={pagination}
55
+ />
56
+ </div>
57
+ </div>
58
+ </Style>
59
+ </Wrapper>
60
+ );
65
61
  }
66
62
 
67
63
  const Style = styled.div`
68
- max-width: calc(100% - 48px);
69
- margin-left: var(--size-lg);
70
- overflow: hidden;
64
+ max-width: calc(100% - 48px);
65
+ margin-left: var(--size-lg);
66
+ overflow: hidden;
71
67
 
72
- .daf-table {
73
- padding: 0px;
74
- margin-top: 0px;
68
+ .daf-table {
69
+ padding: 0px;
70
+ margin-top: 0px;
75
71
 
76
- .ant-tag {
77
- text-align: center;
78
- }
79
- }
72
+ .ant-tag {
73
+ text-align: center;
74
+ }
75
+ }
80
76
 
81
- .daf-select-filters .filters {
82
- padding-top: 16px;
83
- padding-left: 0;
84
- padding-right: 0;
85
- }
77
+ .daf-select-filters .filters {
78
+ padding-top: 16px;
79
+ padding-left: 0;
80
+ padding-right: 0;
81
+ }
86
82
 
87
- .daf-table {
88
- padding-top: 16px;
89
- }
83
+ .daf-table {
84
+ padding-top: 16px;
85
+ }
90
86
  `;
91
87
 
92
88
  StickyTable.propTypes = {
93
- size: PropTypes.any,
94
- maxHeight: PropTypes.number,
95
- dataSource: PropTypes.array,
96
- columns: PropTypes.object,
97
- pagination: PropTypes.any,
89
+ size: PropTypes.any,
90
+ maxHeight: PropTypes.number,
91
+ dataSource: PropTypes.array,
92
+ columns: PropTypes.object,
93
+ pagination: PropTypes.any,
98
94
  };
@@ -1,4 +1,5 @@
1
1
  const en = {
2
+ "Currently unavailable": "Currently unavailable",
2
3
  Description: "Description",
3
4
  "missing-inputs": "Missing Inputs",
4
5
  "all-inputs-fullfilled": "All inputs in this section are fullfilled",
@@ -1,4 +1,5 @@
1
1
  const fr = {
2
+ "Currently unavailable": "Actuellement indisponible",
2
3
  "Description": "Description",
3
4
  "missing-inputs": "Données Manquantes",
4
5
  "all-inputs-fullfilled": "Toutes les données de cette section ont été saisies.",
@@ -1,4 +1,5 @@
1
1
  const sp = {
2
+ "Currently unavailable": "Actualmente no disponible",
2
3
  "Description": "Descripción",
3
4
  "missing-inputs": "Datos que Faltan",
4
5
  "all-inputs-fullfilled": "Todas las entradas de esta sección están completas.",
package/.env DELETED
@@ -1,8 +0,0 @@
1
- REACT_APP_API_KEY=
2
- REACT_APP_AUTH_DOMAIN=
3
- REACT_APP_PROJECT_ID=
4
- REACT_APP_STORAGE_BUCKED=
5
- REACT_APP_SENDER_ID=
6
- REACT_APP_APP_ID=
7
- REACT_APP_MEASUREMENT_ID=
8
- REACT_APP_VAPID_KEY=
@@ -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,39 +0,0 @@
1
- import ScrollWidget from "./index";
2
- import ThemeLayout from "../../../ThemeLayout";
3
- import DashboardLayout from "../../DashboardLayout";
4
- import ProjectWidget from "../ProjectWidget";
5
-
6
- export default {
7
- title: "Dashboard/Widgets/ScrollWidget",
8
- component: ScrollWidget,
9
- tags: ["autodocs"],
10
- decorators: [
11
- (Story) => (
12
- <div style={{ margin: "3em" }}>
13
- <ThemeLayout>
14
- <Story />
15
- </ThemeLayout>
16
- </div>
17
- ),
18
- ],
19
- };
20
-
21
- export const Primary = {
22
- name: "Scroll Widget",
23
- args: {
24
- title: "Scroll Widget Title",
25
- },
26
- render: (args) => (
27
- <DashboardLayout>
28
- <ScrollWidget {...args}>
29
- <section className="nowrap">
30
- <ProjectWidget hideSDGList />
31
- <ProjectWidget hideSDGList />
32
- <ProjectWidget hideSDGList />
33
- <ProjectWidget hideSDGList />
34
- <ProjectWidget hideSDGList />
35
- </section>
36
- </ScrollWidget>
37
- </DashboardLayout>
38
- ),
39
- };
@@ -1,22 +0,0 @@
1
- import Widget from "../index.jsx";
2
-
3
- export default function ScrollWidget({ classname, widgetClassname, children, ...props }) {
4
- return (
5
- <Widget className={widgetClassname} {...props}>
6
- <div
7
- style={{
8
- overflowX: "auto",
9
- overflowY: "hidden",
10
- width: "100%",
11
- display: "flex",
12
- gap: "10px",
13
- alignItems: "stretch",
14
- scrollbarWidth: "thin",
15
- scrollbarColor: "#ccc transparent",
16
- }}
17
- >
18
- {children}
19
- </div>
20
- </Widget>
21
- );
22
- }