datastake-daf 0.6.181 → 0.6.182

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.
@@ -12448,26 +12448,27 @@ function Loading(_ref) {
12448
12448
  const {
12449
12449
  Paragraph: Paragraph$1
12450
12450
  } = antd.Typography;
12451
- const useHeader = ({
12452
- title = '',
12453
- tooltip = '',
12454
- supportText = '',
12455
- tags = [],
12456
- actionButtons: _actionButtons = [],
12457
- titleTooltip,
12458
- className,
12459
- addedHeader = null,
12460
- addedHeaderFirst,
12461
- extraButtons: _extraButtons = [],
12462
- onDownload,
12463
- downloadDisabled,
12464
- goBackTo,
12465
- loading,
12466
- renderExtraComponents,
12467
- app = '',
12468
- isViewMode = false,
12469
- filtersConfig = {}
12470
- }) => {
12451
+ const useHeader = _ref => {
12452
+ let {
12453
+ title = '',
12454
+ tooltip = '',
12455
+ supportText = '',
12456
+ tags = [],
12457
+ actionButtons: _actionButtons = [],
12458
+ titleTooltip,
12459
+ className,
12460
+ addedHeader = null,
12461
+ addedHeaderFirst,
12462
+ extraButtons: _extraButtons = [],
12463
+ onDownload,
12464
+ downloadDisabled,
12465
+ goBackTo,
12466
+ loading,
12467
+ renderExtraComponents,
12468
+ app = '',
12469
+ isViewMode = false,
12470
+ filtersConfig = {}
12471
+ } = _ref;
12471
12472
  const [showFilters, setShowFilters] = React.useState(false);
12472
12473
  const hasFilters = filtersConfig && Object.keys(filtersConfig).length > 0;
12473
12474
  const downloadButtonAction = app && app === 'sbg' && isViewMode ? null : {
@@ -12504,9 +12505,9 @@ const useHeader = ({
12504
12505
  const buttonCont = React.useRef();
12505
12506
  const [mainContWidth, setMainContWidth] = React.useState(600);
12506
12507
  const [buttonContWidth, setButtonContWidth] = React.useState(0);
12507
- const hasSupportText = !!supportText?.length;
12508
- const hasTags = !!tags?.length;
12509
- const hasButtons = !!(actionButtons?.length || extraButtons?.length);
12508
+ const hasSupportText = !!(supportText !== null && supportText !== void 0 && supportText.length);
12509
+ const hasTags = !!(tags !== null && tags !== void 0 && tags.length);
12510
+ const hasButtons = !!(actionButtons !== null && actionButtons !== void 0 && actionButtons.length || extraButtons !== null && extraButtons !== void 0 && extraButtons.length);
12510
12511
  React.useEffect(() => {
12511
12512
  const mainContObserver = new ResizeObserver(entries => {
12512
12513
  const _mainEntry = entries[0];
@@ -18679,6 +18680,7 @@ const Style$A = dt.div`
18679
18680
  width: 100%;
18680
18681
  height: 472px;
18681
18682
  min-height: 300px;
18683
+ flex: 1;
18682
18684
 
18683
18685
  @media (max-width: 768px) {
18684
18686
  height: 350px;
@@ -18689,6 +18691,13 @@ const Style$A = dt.div`
18689
18691
  height: 300px;
18690
18692
  min-height: 200px;
18691
18693
  }
18694
+
18695
+ /* Responsive height adjustments for sidebar state changes */
18696
+ @media (min-width: 769px) {
18697
+ height: calc(100vh - 200px);
18698
+ min-height: 400px;
18699
+ max-height: 600px;
18700
+ }
18692
18701
 
18693
18702
  .filter-cont {
18694
18703
  position: absolute;
@@ -18779,6 +18788,9 @@ const Style$A = dt.div`
18779
18788
  flex: 1;
18780
18789
  background: rgb(0, 0, 0);
18781
18790
  z-index: 1;
18791
+ width: 100%;
18792
+ height: 100%;
18793
+ min-height: inherit;
18782
18794
 
18783
18795
  /* Mapbox GL JS specific styles */
18784
18796
  .mapboxgl-ctrl-top-right {
@@ -19048,6 +19060,23 @@ const Style$A = dt.div`
19048
19060
  right: 300px;
19049
19061
  }
19050
19062
  }
19063
+
19064
+ /* Responsive adjustments for different sidebar states */
19065
+ &.sidebar-collapsed {
19066
+ height: calc(100vh - 180px);
19067
+
19068
+ @media (min-width: 769px) {
19069
+ height: calc(100vh - 180px);
19070
+ }
19071
+ }
19072
+
19073
+ &.sidebar-expanded {
19074
+ height: calc(100vh - 200px);
19075
+
19076
+ @media (min-width: 769px) {
19077
+ height: calc(100vh - 200px);
19078
+ }
19079
+ }
19051
19080
 
19052
19081
  .sider {
19053
19082
  display: flex;
@@ -19976,6 +20005,22 @@ const useGlobe = ({
19976
20005
  };
19977
20006
  };
19978
20007
 
20008
+ typeof localStorage.getItem('is_collapsed') === 'string' ? localStorage.getItem('is_collapsed') === 'true' ? true : false : true;
20009
+ typeof localStorage.getItem('is_nested_sidebar_collapsed') === 'string' ? localStorage.getItem('is_nested_sidebar_collapsed') === 'true' : true;
20010
+ const ResizeContext = /*#__PURE__*/React.createContext({
20011
+ resizeLoading: false,
20012
+ windowWidth: 0,
20013
+ resizeDif: 0,
20014
+ isCollapsed: false,
20015
+ setIsCollapsed: () => {},
20016
+ isNestedSidebarCollapsed: false,
20017
+ setIsNestedSidebarCollapsed: () => {}
20018
+ });
20019
+ const useResizeContext = () => {
20020
+ const values = React.useContext(ResizeContext);
20021
+ return values;
20022
+ };
20023
+
19979
20024
  function Globe(_ref) {
19980
20025
  var _activeMarker$data, _activeMarker$data2;
19981
20026
  let {
@@ -20016,6 +20061,11 @@ function Globe(_ref) {
20016
20061
  });
20017
20062
  }), [data]);
20018
20063
 
20064
+ // Get resize context for sidebar state
20065
+ const {
20066
+ isCollapsed
20067
+ } = useResizeContext();
20068
+
20019
20069
  // Use custom hook to configure globe functionality
20020
20070
  const {
20021
20071
  container,
@@ -20059,9 +20109,20 @@ function Globe(_ref) {
20059
20109
  return () => clearTimeout(timer);
20060
20110
  }
20061
20111
  }, [forceResize]);
20112
+
20113
+ // Force resize when sidebar state changes
20114
+ React.useEffect(() => {
20115
+ if (forceResize) {
20116
+ // Trigger resize when sidebar collapses/expands
20117
+ const timer = setTimeout(() => {
20118
+ forceResize();
20119
+ }, 100);
20120
+ return () => clearTimeout(timer);
20121
+ }
20122
+ }, [isCollapsed, forceResize]);
20062
20123
  return /*#__PURE__*/jsxRuntime.jsx(ComponentWithFocus, {
20063
20124
  children: /*#__PURE__*/jsxRuntime.jsxs(Style$A, {
20064
- className: formatClassname([showSider && activeMarker && "with-sider"]),
20125
+ className: formatClassname([showSider && activeMarker && "with-sider", isCollapsed ? "sidebar-collapsed" : "sidebar-expanded"]),
20065
20126
  children: [filtersConfig ? /*#__PURE__*/jsxRuntime.jsx(Filters, {
20066
20127
  t: t,
20067
20128
  filtersConfig: filtersConfig,
@@ -51457,22 +51518,6 @@ function useConfig(data) {
51457
51518
  return config;
51458
51519
  }
51459
51520
 
51460
- typeof localStorage.getItem('is_collapsed') === 'string' ? localStorage.getItem('is_collapsed') === 'true' ? true : false : true;
51461
- typeof localStorage.getItem('is_nested_sidebar_collapsed') === 'string' ? localStorage.getItem('is_nested_sidebar_collapsed') === 'true' : true;
51462
- const ResizeContext = /*#__PURE__*/React.createContext({
51463
- resizeLoading: false,
51464
- windowWidth: 0,
51465
- resizeDif: 0,
51466
- isCollapsed: false,
51467
- setIsCollapsed: () => {},
51468
- isNestedSidebarCollapsed: false,
51469
- setIsNestedSidebarCollapsed: () => {}
51470
- });
51471
- const useResizeContext = () => {
51472
- const values = React.useContext(ResizeContext);
51473
- return values;
51474
- };
51475
-
51476
51521
  const DAYS = ["Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"];
51477
51522
  function UserActivity({
51478
51523
  loading,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datastake-daf",
3
- "version": "0.6.181",
3
+ "version": "0.6.182",
4
4
  "dependencies": {
5
5
  "@ant-design/icons": "^5.2.5",
6
6
  "@antv/g2": "^5.1.1",
@@ -8,6 +8,7 @@ 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";
11
12
 
12
13
  /**
13
14
  * Globe Component
@@ -129,6 +130,9 @@ function Globe({
129
130
  [data],
130
131
  );
131
132
 
133
+ // Get resize context for sidebar state
134
+ const { isCollapsed } = useResizeContext();
135
+
132
136
  // Use custom hook to configure globe functionality
133
137
  const { container, activeMarker, mapOptionsButtonsConfig, forceResize } = useGlobe({
134
138
  data: mappedData,
@@ -171,9 +175,24 @@ function Globe({
171
175
  }
172
176
  }, [forceResize]);
173
177
 
178
+ // Force resize when sidebar state 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
+
174
190
  return (
175
191
  <ComponentWithFocus>
176
- <Style className={formatClassname([showSider && activeMarker && "with-sider"])}>
192
+ <Style className={formatClassname([
193
+ showSider && activeMarker && "with-sider",
194
+ isCollapsed ? "sidebar-collapsed" : "sidebar-expanded"
195
+ ])}>
177
196
  {filtersConfig ? (
178
197
  <Filters t={t} filtersConfig={filtersConfig} onFilterChange={onFilterChange} />
179
198
  ) : null}
@@ -7,6 +7,7 @@ const Style = styled.div`
7
7
  width: 100%;
8
8
  height: 472px;
9
9
  min-height: 300px;
10
+ flex: 1;
10
11
 
11
12
  @media (max-width: 768px) {
12
13
  height: 350px;
@@ -17,6 +18,13 @@ const Style = styled.div`
17
18
  height: 300px;
18
19
  min-height: 200px;
19
20
  }
21
+
22
+ /* Responsive height adjustments for sidebar state changes */
23
+ @media (min-width: 769px) {
24
+ height: calc(100vh - 200px);
25
+ min-height: 400px;
26
+ max-height: 600px;
27
+ }
20
28
 
21
29
  .filter-cont {
22
30
  position: absolute;
@@ -107,6 +115,9 @@ const Style = styled.div`
107
115
  flex: 1;
108
116
  background: rgb(0, 0, 0);
109
117
  z-index: 1;
118
+ width: 100%;
119
+ height: 100%;
120
+ min-height: inherit;
110
121
 
111
122
  /* Mapbox GL JS specific styles */
112
123
  .mapboxgl-ctrl-top-right {
@@ -376,6 +387,23 @@ const Style = styled.div`
376
387
  right: 300px;
377
388
  }
378
389
  }
390
+
391
+ /* Responsive adjustments for different sidebar states */
392
+ &.sidebar-collapsed {
393
+ height: calc(100vh - 180px);
394
+
395
+ @media (min-width: 769px) {
396
+ height: calc(100vh - 180px);
397
+ }
398
+ }
399
+
400
+ &.sidebar-expanded {
401
+ height: calc(100vh - 200px);
402
+
403
+ @media (min-width: 769px) {
404
+ height: calc(100vh - 200px);
405
+ }
406
+ }
379
407
 
380
408
  .sider {
381
409
  display: flex;
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
- }