@opengeoweb/shared 4.16.0 → 4.17.0

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/index.esm.js CHANGED
@@ -95,15 +95,16 @@ var CustomDialog = function CustomDialog(_a) {
95
95
  _a$actions = _a.actions,
96
96
  actions = _a$actions === void 0 ? null : _a$actions,
97
97
  children = _a.children,
98
- other = __rest(_a, ["title", "onClose", "description", "actions", "children"]);
98
+ sx = _a.sx,
99
+ other = __rest(_a, ["title", "onClose", "description", "actions", "children", "sx"]);
99
100
 
100
101
  return /*#__PURE__*/React.createElement(Dialog, Object.assign({
101
102
  "data-testid": "customDialog",
102
103
  PaperProps: {
103
- sx: {
104
+ sx: Object.assign({
104
105
  width: '560px',
105
106
  margin: 2.5
106
- }
107
+ }, sx)
107
108
  },
108
109
  // fix for briefly showing default options when closing dialog
109
110
  transitionDuration: 0,
@@ -122,14 +123,8 @@ var CustomDialog = function CustomDialog(_a) {
122
123
  }
123
124
  }, /*#__PURE__*/React.createElement(Typography, {
124
125
  sx: {
125
- fontSize: {
126
- xs: '16px',
127
- sm: '34px'
128
- },
129
- fontWeight: {
130
- xs: 500,
131
- sm: 400
132
- }
126
+ fontSize: '16px',
127
+ fontWeight: 500
133
128
  },
134
129
  "data-testid": "customDialog-title",
135
130
  component: "span"
@@ -602,45 +597,45 @@ var adjustPosition = function adjustPosition(bbox, containingView, position, set
602
597
  x: position.x + diffX,
603
598
  y: position.y + diffY
604
599
  });
605
- } // bottom right
606
- else if (bbox.right >= containingView.right && bbox.bottom >= containingView.bottom) {
607
- var _diffX = containingView.right - bbox.right;
600
+ } else if ( // bottom right
601
+ bbox.right >= containingView.right && bbox.bottom >= containingView.bottom) {
602
+ var _diffX = containingView.right - bbox.right;
608
603
 
609
- var _diffY = containingView.bottom - bbox.bottom;
610
-
611
- setPosition({
612
- x: position.x + _diffX,
613
- y: position.y + _diffY
614
- });
615
- } // left screen
616
- else if (bbox.x < containingView.x || isHorizontallyLarger) {
617
- var _diffX2 = containingView.x - bbox.x;
604
+ var _diffY = containingView.bottom - bbox.bottom;
618
605
 
619
- setPosition(Object.assign(Object.assign({}, position), {
620
- x: position.x + _diffX2
621
- }));
622
- } // right screen
623
- else if (bbox.right >= containingView.right) {
624
- var _diffX3 = containingView.right - bbox.right;
625
-
626
- setPosition(Object.assign(Object.assign({}, position), {
627
- x: position.x + _diffX3
628
- }));
629
- } // top screen
630
- else if (bbox.y < containingView.y || isVerticallyLarger) {
631
- var _diffY2 = containingView.y - bbox.y;
632
-
633
- setPosition(Object.assign(Object.assign({}, position), {
634
- y: position.y + _diffY2
635
- }));
636
- } // bottom screen
637
- else if (bbox.bottom >= containingView.bottom) {
638
- var _diffY3 = containingView.bottom - bbox.bottom;
639
-
640
- setPosition(Object.assign(Object.assign({}, position), {
641
- y: position.y + _diffY3
642
- }));
643
- }
606
+ setPosition({
607
+ x: position.x + _diffX,
608
+ y: position.y + _diffY
609
+ });
610
+ } else if (bbox.x < containingView.x || isHorizontallyLarger) {
611
+ // left screen
612
+ var _diffX2 = containingView.x - bbox.x;
613
+
614
+ setPosition(Object.assign(Object.assign({}, position), {
615
+ x: position.x + _diffX2
616
+ }));
617
+ } else if (bbox.right >= containingView.right) {
618
+ // right screen
619
+ var _diffX3 = containingView.right - bbox.right;
620
+
621
+ setPosition(Object.assign(Object.assign({}, position), {
622
+ x: position.x + _diffX3
623
+ }));
624
+ } else if (bbox.y < containingView.y || isVerticallyLarger) {
625
+ // top screen
626
+ var _diffY2 = containingView.y - bbox.y;
627
+
628
+ setPosition(Object.assign(Object.assign({}, position), {
629
+ y: position.y + _diffY2
630
+ }));
631
+ } else if (bbox.bottom >= containingView.bottom) {
632
+ // bottom screen
633
+ var _diffY3 = containingView.bottom - bbox.bottom;
634
+
635
+ setPosition(Object.assign(Object.assign({}, position), {
636
+ y: position.y + _diffY3
637
+ }));
638
+ }
644
639
  };
645
640
  var useMakeSureContainerStaysInsideWindow = function useMakeSureContainerStaysInsideWindow(nodeRef, position, setPosition) {
646
641
  var onResizeWindow = React__default.useCallback(function () {
@@ -964,14 +959,17 @@ var AppHeader = function AppHeader(_ref2) {
964
959
  userMenu = _ref2.userMenu,
965
960
  workspaceTopBar = _ref2.workspaceTopBar,
966
961
  _ref2$title = _ref2.title,
967
- title = _ref2$title === void 0 ? 'GeoWeb' : _ref2$title;
962
+ title = _ref2$title === void 0 ? 'GeoWeb' : _ref2$title,
963
+ onClick = _ref2.onClick;
968
964
  return /*#__PURE__*/React__default.createElement(Box, {
969
965
  component: "header",
970
966
  sx: styles$5.header
971
967
  }, /*#__PURE__*/React__default.createElement(Box, {
968
+ onClick: onClick,
972
969
  sx: {
973
970
  display: 'inherit',
974
- alignItems: 'center'
971
+ alignItems: 'center',
972
+ cursor: onClick ? 'pointer' : 'auto'
975
973
  }
976
974
  }, /*#__PURE__*/React__default.createElement(GeoWebLogo, {
977
975
  style: {
package/index.umd.js CHANGED
@@ -169,15 +169,16 @@
169
169
  _c = _a.actions,
170
170
  actions = _c === void 0 ? null : _c,
171
171
  children = _a.children,
172
- other = __rest(_a, ["title", "onClose", "description", "actions", "children"]);
172
+ sx = _a.sx,
173
+ other = __rest(_a, ["title", "onClose", "description", "actions", "children", "sx"]);
173
174
 
174
175
  return /*#__PURE__*/React__namespace.createElement(material.Dialog, __assign({
175
176
  "data-testid": "customDialog",
176
177
  PaperProps: {
177
- sx: {
178
+ sx: __assign({
178
179
  width: '560px',
179
180
  margin: 2.5
180
- }
181
+ }, sx)
181
182
  },
182
183
  // fix for briefly showing default options when closing dialog
183
184
  transitionDuration: 0,
@@ -196,14 +197,8 @@
196
197
  }
197
198
  }, /*#__PURE__*/React__namespace.createElement(material.Typography, {
198
199
  sx: {
199
- fontSize: {
200
- xs: '16px',
201
- sm: '34px'
202
- },
203
- fontWeight: {
204
- xs: 500,
205
- sm: 400
206
- }
200
+ fontSize: '16px',
201
+ fontWeight: 500
207
202
  },
208
203
  "data-testid": "customDialog-title",
209
204
  component: "span"
@@ -471,39 +466,39 @@
471
466
  x: position.x + diffX,
472
467
  y: position.y + diffY
473
468
  });
474
- } // bottom right
475
- else if (bbox.right >= containingView.right && bbox.bottom >= containingView.bottom) {
476
- var diffX = containingView.right - bbox.right;
477
- var diffY = containingView.bottom - bbox.bottom;
478
- setPosition({
479
- x: position.x + diffX,
480
- y: position.y + diffY
481
- });
482
- } // left screen
483
- else if (bbox.x < containingView.x || isHorizontallyLarger) {
484
- var diffX = containingView.x - bbox.x;
485
- setPosition(__assign(__assign({}, position), {
486
- x: position.x + diffX
487
- }));
488
- } // right screen
489
- else if (bbox.right >= containingView.right) {
490
- var diffX = containingView.right - bbox.right;
491
- setPosition(__assign(__assign({}, position), {
492
- x: position.x + diffX
493
- }));
494
- } // top screen
495
- else if (bbox.y < containingView.y || isVerticallyLarger) {
496
- var diffY = containingView.y - bbox.y;
497
- setPosition(__assign(__assign({}, position), {
498
- y: position.y + diffY
499
- }));
500
- } // bottom screen
501
- else if (bbox.bottom >= containingView.bottom) {
502
- var diffY = containingView.bottom - bbox.bottom;
503
- setPosition(__assign(__assign({}, position), {
504
- y: position.y + diffY
505
- }));
506
- }
469
+ } else if ( // bottom right
470
+ bbox.right >= containingView.right && bbox.bottom >= containingView.bottom) {
471
+ var diffX = containingView.right - bbox.right;
472
+ var diffY = containingView.bottom - bbox.bottom;
473
+ setPosition({
474
+ x: position.x + diffX,
475
+ y: position.y + diffY
476
+ });
477
+ } else if (bbox.x < containingView.x || isHorizontallyLarger) {
478
+ // left screen
479
+ var diffX = containingView.x - bbox.x;
480
+ setPosition(__assign(__assign({}, position), {
481
+ x: position.x + diffX
482
+ }));
483
+ } else if (bbox.right >= containingView.right) {
484
+ // right screen
485
+ var diffX = containingView.right - bbox.right;
486
+ setPosition(__assign(__assign({}, position), {
487
+ x: position.x + diffX
488
+ }));
489
+ } else if (bbox.y < containingView.y || isVerticallyLarger) {
490
+ // top screen
491
+ var diffY = containingView.y - bbox.y;
492
+ setPosition(__assign(__assign({}, position), {
493
+ y: position.y + diffY
494
+ }));
495
+ } else if (bbox.bottom >= containingView.bottom) {
496
+ // bottom screen
497
+ var diffY = containingView.bottom - bbox.bottom;
498
+ setPosition(__assign(__assign({}, position), {
499
+ y: position.y + diffY
500
+ }));
501
+ }
507
502
  };
508
503
  var useMakeSureContainerStaysInsideWindow = function useMakeSureContainerStaysInsideWindow(nodeRef, position, setPosition) {
509
504
  var onResizeWindow = React__default["default"].useCallback(function () {
@@ -844,14 +839,17 @@
844
839
  userMenu = _a.userMenu,
845
840
  workspaceTopBar = _a.workspaceTopBar,
846
841
  _b = _a.title,
847
- title = _b === void 0 ? 'GeoWeb' : _b;
842
+ title = _b === void 0 ? 'GeoWeb' : _b,
843
+ onClick = _a.onClick;
848
844
  return /*#__PURE__*/React__default["default"].createElement(material.Box, {
849
845
  component: "header",
850
846
  sx: styles$5.header
851
847
  }, /*#__PURE__*/React__default["default"].createElement(material.Box, {
848
+ onClick: onClick,
852
849
  sx: {
853
850
  display: 'inherit',
854
- alignItems: 'center'
851
+ alignItems: 'center',
852
+ cursor: onClick ? 'pointer' : 'auto'
855
853
  }
856
854
  }, /*#__PURE__*/React__default["default"].createElement(theme.GeoWebLogo, {
857
855
  style: {
@@ -4,6 +4,7 @@ interface AppHeaderProps {
4
4
  userMenu?: React.ReactNode;
5
5
  workspaceTopBar?: React.ReactNode;
6
6
  title?: string;
7
+ onClick?: () => void;
7
8
  }
8
9
  declare const AppHeader: React.FC<AppHeaderProps>;
9
10
  export default AppHeader;
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { IconButtonProps } from '@mui/material';
3
3
  interface DeleteButtonProps extends IconButtonProps {
4
4
  tooltipTitle: string;
5
- onClickDelete: () => void;
5
+ onClickDelete: (event: React.MouseEvent) => void;
6
6
  isEnabled?: boolean;
7
7
  }
8
8
  export declare const ManagerDeleteButton: React.FC<DeleteButtonProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/shared",
3
- "version": "4.16.0",
3
+ "version": "4.17.0",
4
4
  "description": "GeoWeb shared library with shared components and utils for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -14,7 +14,7 @@
14
14
  "peerDependencies": {
15
15
  "react": "^18.2.0",
16
16
  "@mui/material": "^5.10.8",
17
- "@opengeoweb/theme": "4.16.0",
17
+ "@opengeoweb/theme": "4.17.0",
18
18
  "react-draggable": "^4.4.5",
19
19
  "re-resizable": "^6.9.0",
20
20
  "@redux-eggs/core": "^2.2.0",