pcm-shared-components 2.0.14 → 2.0.16

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.
Files changed (58) hide show
  1. package/dist/app/config/reservation_state.js +89 -0
  2. package/dist/app/config/yes_no_status.js +72 -0
  3. package/dist/app/tools/date_formatter.js +141 -0
  4. package/dist/app/tools/date_overlap.js +177 -0
  5. package/dist/app/tools/seasonal_dates.js +229 -0
  6. package/dist/components/Buttons/CustomFab/index.js +0 -27
  7. package/dist/components/Buttons/DropdownButton/index.js +3 -11
  8. package/dist/components/Buttons/HelpButton/index.js +1 -6
  9. package/dist/components/Buttons/ProductItemButton/index.js +8 -22
  10. package/dist/components/Buttons/TillButton/index.js +3 -10
  11. package/dist/components/Date/DateRangeCalendar/index.js +1 -21
  12. package/dist/components/Dialogs/GenericAppBar/components/GenericAppBarSubMenu.js +4 -7
  13. package/dist/components/Dialogs/GenericAppBar/index.js +24 -22
  14. package/dist/components/Dialogs/GenericDialogWindow/index.js +20 -34
  15. package/dist/components/Drawing/CanvasPaint/index.js +12 -37
  16. package/dist/components/Drawing/ImageCanvasDraw/components/Controls.js +13 -10
  17. package/dist/components/Drawing/ImageCanvasDraw/index.js +11 -18
  18. package/dist/components/Drawing/ImageCanvasDraw/service/image_tools.js +6 -6
  19. package/dist/components/Images/ImageStack/index.js +0 -5
  20. package/dist/components/Labels/SimpleLabel/index.js +1 -7
  21. package/dist/components/Layout/SimpleTab/components/TabPanel.js +2 -3
  22. package/dist/components/Layout/SimpleTab/index.js +8 -15
  23. package/dist/components/Layout/TwoColumnDisplay/index.js +0 -2
  24. package/dist/components/Links/HrefLink/index.js +1 -5
  25. package/dist/components/Loaders/LoadingBackdrop/index.js +4 -4
  26. package/dist/components/Loaders/WaitingGalaxy/index.js +1 -2
  27. package/dist/components/Menus/ReusablePopupMenu/components/GenericSubMenu.js +2 -7
  28. package/dist/components/Menus/ReusablePopupMenu/components/ReusableMenu.js +6 -7
  29. package/dist/components/Menus/ReusablePopupMenu/index.js +7 -10
  30. package/dist/components/NEW_COMPONENT/index.js +1 -2
  31. package/dist/components/NEW_COMPONENT/storybook/index.stories.js +0 -2
  32. package/dist/components/PcSharedComponentThemeInheritor/index.js +1 -1
  33. package/dist/components/Platform/PlatformPaymentPlans/components/PriceToggleButton/index.js +0 -2
  34. package/dist/components/Platform/PlatformPaymentPlans/index.js +12 -27
  35. package/dist/components/Platform/PlatformPlanPrices/index.js +3 -10
  36. package/dist/components/Platform/PlatformPlanTitles/index.js +0 -6
  37. package/dist/components/Sandbox/ScrollingInnerDiv/index.js +2 -5
  38. package/dist/components/TextBoxes/CurrencyTextInput/index.js +7 -42
  39. package/dist/components/TextBoxes/SearchBar/index.js +10 -14
  40. package/dist/components/Timelines/ReservationTimelineComponent/components/SearchLotsTextBox.js +34 -0
  41. package/dist/components/Timelines/ReservationTimelineComponent/components/TimelinePopUp.js +11 -0
  42. package/dist/components/Timelines/ReservationTimelineComponent/css/header.css +98 -0
  43. package/dist/components/Timelines/ReservationTimelineComponent/css/styles.css +121 -0
  44. package/dist/components/Timelines/ReservationTimelineComponent/css/styles.old +209 -0
  45. package/dist/components/Timelines/ReservationTimelineComponent/index.js +965 -0
  46. package/dist/components/Tools/CodeHighlight/index.js +17 -21
  47. package/dist/components/Tools/PCMScrollbar/index.js +3 -5
  48. package/dist/components/Tools/isValidFunction.js +0 -1
  49. package/dist/index.js +3 -1
  50. package/dist/languages/en/translations.json +1 -1
  51. package/dist/languages/es/translations.json +1 -1
  52. package/dist/languages/fr/translations.json +1 -1
  53. package/dist/locals/coreLocals.js +0 -8
  54. package/dist/locals/currencySymbol.js +0 -3
  55. package/dist/locals/i18n.js +11 -5
  56. package/dist/locals/translationResources.js +2 -1
  57. package/dist/styles/tailwind.css +1 -1
  58. package/package.json +4 -1
@@ -9,6 +9,7 @@ import PropTypes from 'prop-types';
9
9
  import { ThemeProvider } from '@mui/system';
10
10
  import { createTheme, useTheme } from '@mui/material/styles';
11
11
  import PCMScrollbar from '../../Tools/PCMScrollbar';
12
+
12
13
  /**
13
14
  * Displays an image that can is used to draw on to generate maps with highlighted routes.
14
15
  *
@@ -23,7 +24,6 @@ import {ImageCanvasDraw} from 'pcm-shared-components';
23
24
 
24
25
  *
25
26
  */
26
-
27
27
  export const ImageCanvasDraw = props => {
28
28
  const {
29
29
  onSave,
@@ -52,25 +52,26 @@ export const ImageCanvasDraw = props => {
52
52
  }
53
53
  });
54
54
  const saveableCanvas = useRef();
55
-
56
55
  const setImageSize = imageUrl => {
57
56
  try {
58
57
  const img = new Image();
59
-
60
58
  img.onload = () => {
61
59
  //Scale the image down
62
60
  const new_width = Number(img.width) / Number(state.imageScale);
63
- const new_height = Number(img.height) / Number(state.imageScale); // Create a temporary canvas to draw the downscaled image on.
61
+ const new_height = Number(img.height) / Number(state.imageScale);
64
62
 
63
+ // Create a temporary canvas to draw the downscaled image on.
65
64
  let canvas = document.createElement("canvas");
66
65
  canvas.width = new_width;
67
- canvas.height = new_height; // Draw the downscaled image on the canvas and return the new data URL.
66
+ canvas.height = new_height;
68
67
 
68
+ // Draw the downscaled image on the canvas and return the new data URL.
69
69
  let ctx = canvas.getContext("2d");
70
70
  ctx.drawImage(img, 0, 0, new_width, new_height);
71
71
  const newDataUrl = canvas.toDataURL("image/jpeg", state.imageQuality);
72
72
  setState(previousState => {
73
- return { ...previousState,
73
+ return {
74
+ ...previousState,
74
75
  ...getStorage(),
75
76
  height: new_height,
76
77
  width: new_width,
@@ -78,21 +79,17 @@ export const ImageCanvasDraw = props => {
78
79
  };
79
80
  });
80
81
  };
81
-
82
82
  img.src = imageUrl;
83
83
  } catch (error) {
84
84
  console.error('error in setImageSize', error);
85
85
  }
86
86
  };
87
-
88
87
  useEffect(() => {
89
88
  //Get the scaled down image and width, height
90
89
  setImageSize(state.b64DataUrl);
91
-
92
90
  try {
93
91
  document.addEventListener('keydown', function (e) {
94
92
  console.log('debug e', e);
95
-
96
93
  if (e.ctrlKey && e.key.toLowerCase() === 'z') {
97
94
  saveableCanvas.current.undo();
98
95
  }
@@ -108,7 +105,6 @@ export const ImageCanvasDraw = props => {
108
105
  setStorage(state);
109
106
  }
110
107
  }, [state]);
111
-
112
108
  const DrawerButtonOpenClose = ({
113
109
  children
114
110
  }) => /*#__PURE__*/React.createElement(Button, {
@@ -120,13 +116,13 @@ export const ImageCanvasDraw = props => {
120
116
  color: "secondary",
121
117
  onClick: () => {
122
118
  setState(previousState => {
123
- return { ...previousState,
119
+ return {
120
+ ...previousState,
124
121
  drawerOpen: !previousState.drawerOpen
125
122
  };
126
123
  });
127
124
  }
128
125
  }, children);
129
-
130
126
  return /*#__PURE__*/React.createElement(ThemeProvider, {
131
127
  theme: defaultTheme
132
128
  }, state.width && state.width !== 0 ? /*#__PURE__*/React.createElement("div", {
@@ -153,7 +149,8 @@ export const ImageCanvasDraw = props => {
153
149
  }, /*#__PURE__*/React.createElement(CanvasDraw, {
154
150
  className: "",
155
151
  ref: saveableCanvas,
156
- onChange: evt => console.log("onChange", evt) // enablePanAndZoom //Don't enable pan and zoom or else it gets too complicated when saving...
152
+ onChange: evt => console.log("onChange", evt)
153
+ // enablePanAndZoom //Don't enable pan and zoom or else it gets too complicated when saving...
157
154
  // zoomExtents={{ min: 0.33, max: 10 }}
158
155
  ,
159
156
  clampLinesToDocument: true,
@@ -190,16 +187,12 @@ ImageCanvasDraw.propTypes = {
190
187
  ```
191
188
  */
192
189
  onSave: PropTypes.func,
193
-
194
190
  /** Specified the type of data the onSave function will return */
195
191
  outputFormat: PropTypes.oneOf(['blob', 'base64']),
196
-
197
192
  /** If specified then we show the download button which is mainly used for testing to display what the canvas is exporting */
198
193
  showDownloadButton: PropTypes.bool,
199
-
200
194
  /** This is the image in a base 64 url format to use as the base image to draw on */
201
195
  b64DataUrl: PropTypes.string.isRequired,
202
-
203
196
  /** Theme object to use on this component, if none provided then the MUI5 theme provider theme is used*/
204
197
  theme: PropTypes.object
205
198
  };
@@ -2,16 +2,18 @@ export const combineDrawing = canvasRef => {
2
2
  try {
3
3
  const width = canvasRef.current.props.canvasWidth;
4
4
  const height = canvasRef.current.props.canvasHeight;
5
- const background = canvasRef.current.canvasContainer.children[0]; // const test = canvasRef.current.canvasContainer.children[0];
6
-
5
+ const background = canvasRef.current.canvasContainer.children[0];
6
+ // const test = canvasRef.current.canvasContainer.children[0];
7
7
  const drawing = canvasRef.current.canvasContainer.children[1];
8
8
  const canvas = document.createElement('canvas');
9
9
  canvas.width = width;
10
- canvas.height = height; // composite now
10
+ canvas.height = height;
11
11
 
12
+ // composite now
12
13
  canvas.getContext('2d').drawImage(background, 0, 0);
13
14
  canvas.getContext('2d').globalAlpha = 1.0;
14
- canvas.getContext('2d').drawImage(drawing, 0, 0); // canvas.getContext('2d').drawImage(test, 0, 0);
15
+ canvas.getContext('2d').drawImage(drawing, 0, 0);
16
+ // canvas.getContext('2d').drawImage(test, 0, 0);
15
17
 
16
18
  const dataUri = canvas.toDataURL('image/jpeg', 1.0);
17
19
  const data = dataUri.split(',')[1];
@@ -19,11 +21,9 @@ export const combineDrawing = canvasRef => {
19
21
  const bytes = window.atob(data);
20
22
  const buf = new ArrayBuffer(bytes.length);
21
23
  const arr = new Uint8Array(buf);
22
-
23
24
  for (let i = 0; i < bytes.length; i++) {
24
25
  arr[i] = bytes.charCodeAt(i);
25
26
  }
26
-
27
27
  const blob = new Blob([arr], {
28
28
  type: mimeType
29
29
  });
@@ -3,7 +3,6 @@ import Tooltip from '@mui/material/Tooltip';
3
3
  import PropTypes from 'prop-types';
4
4
  import { ThemeProvider } from '@mui/system';
5
5
  import { createTheme, useTheme } from '@mui/material/styles';
6
-
7
6
  const ImageStack = props => {
8
7
  //?--------------------------------------------------------
9
8
  //?--------------------------------------------------------
@@ -59,7 +58,6 @@ const ImageStack = props => {
59
58
  key: 'image_stack_preview_' + idx
60
59
  }))))));
61
60
  };
62
-
63
61
  export default ImageStack;
64
62
  ImageStack.defaultProps = {
65
63
  images: [],
@@ -70,13 +68,10 @@ ImageStack.defaultProps = {
70
68
  ImageStack.propTypes = {
71
69
  /** An array of images with the full URL and image name. */
72
70
  images: PropTypes.array,
73
-
74
71
  /** This is the height and width of the image. Needs to be a cube for the stack circle to work properly. */
75
72
  imageSize: PropTypes.number,
76
-
77
73
  /** This is orientation of the image stack */
78
74
  orientation: PropTypes.oneOf(['vertical', 'horizontal']),
79
-
80
75
  /** Theme object to use on this component, if none provided then the MUI5 theme provider theme is used*/
81
76
  theme: PropTypes.object
82
77
  };
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { ThemeProvider } from '@mui/system';
4
4
  import { createTheme, useTheme } from '@mui/material/styles';
5
+
5
6
  /**
6
7
  * ## Importing the component in your project
7
8
  *
@@ -12,7 +13,6 @@ import { createTheme, useTheme } from '@mui/material/styles';
12
13
  ```
13
14
  *
14
15
  */
15
-
16
16
  export const SimpleLabel = props => {
17
17
  const {
18
18
  label,
@@ -57,22 +57,16 @@ SimpleLabel.defaultProps = {
57
57
  SimpleLabel.propTypes = {
58
58
  /** The top text over the value*/
59
59
  label: PropTypes.string,
60
-
61
60
  /** The value under the top label*/
62
61
  value: PropTypes.string,
63
-
64
62
  /** classes applied to the wrapper of both the label and value */
65
63
  classes: PropTypes.string,
66
-
67
64
  /** Font size of the top label */
68
65
  labelFontSize: PropTypes.number,
69
-
70
66
  /** Font size of the bottom value */
71
67
  valueFontSize: PropTypes.number,
72
-
73
68
  /** Text alignment of the label and value */
74
69
  textAlignment: PropTypes.oneOf(['left', 'center', 'right']),
75
-
76
70
  /** Theme object to use on this component, if none provided then the MUI5 theme provider theme is used*/
77
71
  theme: PropTypes.object
78
72
  };
@@ -1,8 +1,8 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
2
  import React from 'react';
4
- import PropTypes from 'prop-types'; //Custom tab panel allow me to specify the styles needed to ensure I can hide the overflow or else I'm having a hard time getting the panel to work without a scroll band
3
+ import PropTypes from 'prop-types';
5
4
 
5
+ //Custom tab panel allow me to specify the styles needed to ensure I can hide the overflow or else I'm having a hard time getting the panel to work without a scroll band
6
6
  const TabPanel = props => {
7
7
  const {
8
8
  children,
@@ -22,7 +22,6 @@ const TabPanel = props => {
22
22
  className: "w-full h-full"
23
23
  }, children));
24
24
  };
25
-
26
25
  export default TabPanel;
27
26
  TabPanel.propTypes = {
28
27
  children: PropTypes.node,
@@ -1,5 +1,4 @@
1
1
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
-
3
2
  import React, { useState } from 'react';
4
3
  import PropTypes from 'prop-types';
5
4
  import AppBar from '@mui/material/AppBar';
@@ -17,19 +16,21 @@ const useStyles = makeStyles(() => ({
17
16
  minHeight: ({
18
17
  tabHeight
19
18
  }) => tabHeight,
20
- backgroundColor: 'transparent' // textTransform: 'none', //changes so the text is not upper cased
19
+ backgroundColor: 'transparent'
20
+ // textTransform: 'none', //changes so the text is not upper cased
21
21
  // color: 'white !important',
22
22
  // '&:focus': {
23
23
  // color: 'orange !important',
24
24
  // },
25
-
26
25
  },
26
+
27
27
  indicator: {
28
28
  height: 3,
29
- borderRadius: 25 // backgroundColor: 'orange',
30
-
29
+ borderRadius: 25
30
+ // backgroundColor: 'orange',
31
31
  }
32
32
  }));
33
+
33
34
  export const SimpleTab = props => {
34
35
  const {
35
36
  childrenTabs,
@@ -42,22 +43,20 @@ export const SimpleTab = props => {
42
43
  } = props;
43
44
  const classes = useStyles({
44
45
  tabHeight: variant === 'dense' ? 24 : 48
45
- }); //Uses the default mui theme if none is passed.
46
+ });
46
47
 
48
+ //Uses the default mui theme if none is passed.
47
49
  const compTheme = theme ? theme : useTheme();
48
50
  const defaultTheme = createTheme(compTheme);
49
-
50
51
  const handleChange = (event, newValue) => {
51
52
  setSelectedTabIndex(newValue);
52
53
  };
53
-
54
54
  const a11yProps = index => {
55
55
  return {
56
56
  id: `scrollable-auto-tab-${index}`,
57
57
  'aria-controls': `scrollable-auto-tabpanel-${index}`
58
58
  };
59
59
  };
60
-
61
60
  return /*#__PURE__*/React.createElement(ThemeProvider, {
62
61
  theme: defaultTheme
63
62
  }, /*#__PURE__*/React.createElement("div", {
@@ -109,16 +108,12 @@ SimpleTab.propTypes = {
109
108
  ```
110
109
  */
111
110
  childrenTabs: PropTypes.array,
112
-
113
111
  /** Controls the heigh and spacing of the tab control */
114
112
  variant: PropTypes.oneOf(['dense', 'normal']),
115
-
116
113
  /** Is the index value of the current selected tab */
117
114
  selectedTabIndex: PropTypes.number,
118
-
119
115
  /** The setter for selectedTabIndex: receives one parameter and it's the ```value``` of the index*/
120
116
  setSelectedTabIndex: PropTypes.func,
121
-
122
117
  /** Additional classes passed to the Div wrapper of the <Tabs></Tabs> component.
123
118
  * Example:
124
119
  * - Center tabs 'flex flex-row justify-center w-full'
@@ -126,11 +121,9 @@ SimpleTab.propTypes = {
126
121
  * - Gray background 'bg-gray-200'
127
122
  */
128
123
  tabsWrapperClassName: PropTypes.string,
129
-
130
124
  /** Additional styles to be applied to the Tab component
131
125
  * Example: {margin:'auto'} */
132
126
  tabStyles: PropTypes.object,
133
-
134
127
  /** Theme object to use on this component, if none provided then the MUI5 theme provider theme is used*/
135
128
  theme: PropTypes.object
136
129
  };
@@ -27,7 +27,6 @@ This component depends on the following component.
27
27
 
28
28
 
29
29
  */
30
-
31
30
  export const TwoColumnDisplay = props => {
32
31
  const {
33
32
  ColumnOne,
@@ -53,7 +52,6 @@ TwoColumnDisplay.defaultProps = {
53
52
  TwoColumnDisplay.propTypes = {
54
53
  /** Column one component to display */
55
54
  ColumnTwo: PropTypes.element,
56
-
57
55
  /** Column two component to display */
58
56
  ColumnTwo: PropTypes.element
59
57
  };
@@ -6,6 +6,7 @@ import { ThemeProvider } from '@mui/system';
6
6
  import { createTheme, useTheme } from '@mui/material/styles';
7
7
  import Tooltip from '@mui/material/Tooltip';
8
8
  import clsx from 'clsx';
9
+
9
10
  /**
10
11
  * Uses a predefined link style that should be reused throughout the application when a text link is needed to another page on the internet. This will open a _blank page when the link is clicked. To control the style of the text simply pass in additional className to the component.
11
12
  *
@@ -18,7 +19,6 @@ import {HrefLink} from 'pcm-shared-components';
18
19
 
19
20
  *
20
21
  */
21
-
22
22
  export const HrefLink = props => {
23
23
  const {
24
24
  href,
@@ -52,16 +52,12 @@ HrefLink.defaultProps = {
52
52
  HrefLink.propTypes = {
53
53
  /** On click link, it's the URL to navigate too */
54
54
  href: PropTypes.string.isRequired,
55
-
56
55
  /** className override */
57
56
  className: PropTypes.string,
58
-
59
57
  /** Just a tooltip text */
60
58
  tooltipText: PropTypes.string,
61
-
62
59
  /** Any text to display as a link*/
63
60
  text: PropTypes.string,
64
-
65
61
  /** Theme object to use on this component, if none provided then the MUI5 theme provider theme is used*/
66
62
  theme: PropTypes.object
67
63
  };
@@ -10,7 +10,6 @@ import WaitingGalaxy from '../../Loaders/WaitingGalaxy';
10
10
  import {LoadingBackdrop} from 'pcm-shared-components';
11
11
  ```
12
12
  */
13
-
14
13
  export const LoadingBackdrop = ({
15
14
  isLoading = false,
16
15
  useGalaxySpinner
@@ -52,17 +51,18 @@ export const LoadingBackdrop = ({
52
51
  className: "half-circle"
53
52
  })))))))) : /*#__PURE__*/React.createElement("div", null));
54
53
  };
55
- export default LoadingBackdrop; // Specifies the default values for the props:
54
+ export default LoadingBackdrop;
56
55
 
56
+ // Specifies the default values for the props:
57
57
  LoadingBackdrop.defaultProps = {
58
58
  isLoading: false,
59
59
  useGalaxySpinner: false
60
- }; // Type of
60
+ };
61
61
 
62
+ // Type of
62
63
  LoadingBackdrop.propTypes = {
63
64
  /** Displays the galaxy spinner instead of the circular spinner */
64
65
  useGalaxySpinner: PropTypes.bool,
65
-
66
66
  /** Controls if the backdrop is to be displayed */
67
67
  isLoading: PropTypes.bool
68
68
  };
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
3
3
  import { ThemeProvider } from '@mui/system';
4
4
  import { createTheme, useTheme } from '@mui/material/styles';
5
5
  import './css/style.css';
6
+
6
7
  /**
7
8
  * ## Importing the component in your project
8
9
  *
@@ -13,7 +14,6 @@ import './css/style.css';
13
14
  ```
14
15
  *
15
16
  */
16
-
17
17
  export const WaitingGalaxy = props => {
18
18
  const {
19
19
  className,
@@ -41,7 +41,6 @@ WaitingGalaxy.defaultProps = {
41
41
  WaitingGalaxy.propTypes = {
42
42
  /** Classes applied to the body of the component*/
43
43
  className: PropTypes.string,
44
-
45
44
  /** Theme object to use on this component, if none provided then the MUI5 theme provider theme is used*/
46
45
  theme: PropTypes.object
47
46
  };
@@ -20,7 +20,6 @@ const StyledMenuItem = withStyles(() => ({
20
20
  }
21
21
  }
22
22
  }))(MenuItem);
23
-
24
23
  const GenericSubMenu = ({
25
24
  menu,
26
25
  full_menu = true,
@@ -67,21 +66,18 @@ const GenericSubMenu = ({
67
66
  }
68
67
  }));
69
68
  const classes = useStyles();
70
-
71
69
  const openSubMenu = event => {
72
70
  setAnchorSubMenu(event.currentTarget);
73
71
  };
74
-
75
72
  const handleSubMenuClose = () => {
76
- setAnchorSubMenu(false); //Closes the previous parent menu too..
73
+ setAnchorSubMenu(false);
77
74
 
75
+ //Closes the previous parent menu too..
78
76
  if (handleParentMenuClose) {
79
77
  handleParentMenuClose();
80
78
  }
81
-
82
79
  onClose();
83
80
  };
84
-
85
81
  useEffect(() => {
86
82
  setSubMenuOpen(Boolean(anchorSubMenu));
87
83
  }, [anchorSubMenu]);
@@ -143,5 +139,4 @@ const GenericSubMenu = ({
143
139
  checked: sub_menu.isChecked
144
140
  }))))));
145
141
  };
146
-
147
142
  export default GenericSubMenu;
@@ -28,16 +28,13 @@ const StyledMenuItem = withStyles(() => ({
28
28
  }
29
29
  }
30
30
  }))(MenuItem);
31
-
32
31
  const handleMenuOnClick = (menu, handleClose) => {
33
32
  menu.onClick();
34
-
35
33
  if (typeof menu.isChecked !== "boolean") {
36
34
  //This is NOT a menu with a CheckState SO close the menu after the onclick.
37
35
  handleClose();
38
36
  }
39
37
  };
40
-
41
38
  const ReusableMenu = props => {
42
39
  const {
43
40
  menuAnchor,
@@ -88,23 +85,25 @@ const ReusableMenu = props => {
88
85
  checked: menu.isChecked
89
86
  }))))));
90
87
  };
88
+ export default ReusableMenu;
91
89
 
92
- export default ReusableMenu; // required props for component to work...
93
-
90
+ // required props for component to work...
94
91
  ReusableMenu.propTypes = {
95
92
  menuAnchor: PropTypes.element.isRequired,
96
93
  handleClose: PropTypes.element.isRequired,
97
94
  menuData: PropTypes.element.isRequired
98
- }; // Specifies the default values for the props:
95
+ };
99
96
 
97
+ // Specifies the default values for the props:
100
98
  ReusableMenu.defaultProps = {
101
99
  menuAnchor: undefined,
102
100
  handleClose: undefined,
103
101
  menuData: [],
104
102
  keepMounted: false,
105
103
  menuAnchorLocation: 'center'
106
- }; // Type of
104
+ };
107
105
 
106
+ // Type of
108
107
  ReusableMenu.propTypes = {
109
108
  menuAnchor: PropTypes.object,
110
109
  handleClose: PropTypes.func,
@@ -4,6 +4,7 @@ import Tooltip from '@mui/material/Tooltip';
4
4
  import PropTypes from 'prop-types';
5
5
  import { useTheme } from '@mui/material/styles';
6
6
  import { createTheme, ThemeProvider } from "@mui/material/styles";
7
+
7
8
  /**
8
9
  * Wraps any simple component and generates a simple dropdown menu on the wrapped component.
9
10
  *
@@ -16,7 +17,6 @@ import {ReusablePopupMenu} from 'pcm-shared-components';
16
17
 
17
18
  *
18
19
  */
19
-
20
20
  export const ReusablePopupMenu = props => {
21
21
  const {
22
22
  children,
@@ -28,15 +28,12 @@ export const ReusablePopupMenu = props => {
28
28
  } = props;
29
29
  const [menuAnchor, setMenuAnchor] = useState(null);
30
30
  const componentTheme = createTheme(theme ? theme : useTheme());
31
-
32
31
  const onClick = event => {
33
32
  setMenuAnchor(event.currentTarget);
34
33
  };
35
-
36
34
  const handleClose = () => {
37
35
  setMenuAnchor(null);
38
36
  };
39
-
40
37
  const hocProps = {
41
38
  menuAnchor,
42
39
  handleClose,
@@ -53,7 +50,6 @@ export const ReusablePopupMenu = props => {
53
50
  onClick
54
51
  }));
55
52
  }
56
-
57
53
  return child;
58
54
  });
59
55
  return /*#__PURE__*/React.createElement(React.Fragment, null, childrenWithProps, /*#__PURE__*/React.createElement(ThemeProvider, {
@@ -68,13 +64,15 @@ export const createReusablePopupMenuObject = (onClick = undefined, icon = undefi
68
64
  name: name,
69
65
  isChecked: isChecked
70
66
  };
71
- }; // required props for component to work...
67
+ };
72
68
 
69
+ // required props for component to work...
73
70
  ReusableMenu.propTypes = {
74
71
  children: PropTypes.element.isRequired,
75
72
  menuData: PropTypes.element.isRequired
76
- }; // Specifies the default values for the props:
73
+ };
77
74
 
75
+ // Specifies the default values for the props:
78
76
  ReusableMenu.defaultProps = {
79
77
  children: undefined,
80
78
  tooltipTitle: '',
@@ -82,19 +80,18 @@ ReusableMenu.defaultProps = {
82
80
  keepMounted: false,
83
81
  theme: undefined,
84
82
  menuAnchorLocation: 'center'
85
- }; // Type of
83
+ };
86
84
 
85
+ // Type of
87
86
  ReusableMenu.propTypes = {
88
87
  children: PropTypes.object,
89
88
  tooltipTitle: PropTypes.string,
90
89
  menuData: PropTypes.array,
91
90
  keepMounted: PropTypes.bool,
92
-
93
91
  /**
94
92
  * The theme object to apply to this object, if no theme provided then the component will used the default theme passed down by the ThemeProvider
95
93
  */
96
94
  theme: PropTypes.object,
97
-
98
95
  /** Controls the location of the dropdown popup menu */
99
96
  menuAnchorLocation: PropTypes.oneOf(['left', 'center', 'right'])
100
97
  };
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { ThemeProvider } from '@mui/system';
4
4
  import { createTheme, useTheme } from '@mui/material/styles';
5
+
5
6
  /**
6
7
  * ## Importing the component in your project
7
8
  *
@@ -12,7 +13,6 @@ import { createTheme, useTheme } from '@mui/material/styles';
12
13
  ```
13
14
  *
14
15
  */
15
-
16
16
  export const NEW_COMPONENT = props => {
17
17
  const {
18
18
  i18next,
@@ -32,7 +32,6 @@ NEW_COMPONENT.defaultProps = {
32
32
  NEW_COMPONENT.propTypes = {
33
33
  /** The i18next needs to be passed in by the component or else they will be blank */
34
34
  i18next: PropTypes.any,
35
-
36
35
  /** Theme object to use on this component, if none provided then the MUI5 theme provider theme is used*/
37
36
  theme: PropTypes.object
38
37
  };
@@ -12,9 +12,7 @@ export default {
12
12
  }
13
13
  }
14
14
  };
15
-
16
15
  const NEWCOMPONENTTemplate = args => /*#__PURE__*/React.createElement(NEW_COMPONENT, args);
17
-
18
16
  export const NEW_COMPONENTExample = NEWCOMPONENTTemplate.bind({});
19
17
  NEW_COMPONENTExample.args = {
20
18
  className: '',
@@ -1,11 +1,11 @@
1
1
  import React from "react";
2
2
  import { createTheme, useTheme, ThemeProvider } from "@mui/material/styles";
3
+
3
4
  /**
4
5
  * Used to bridge the gab between MUI4 currently used in the app and MUI5 used in this library.
5
6
  * By wrapping the app with this function allows the MUI5 theme provider to properly receive the theme eliminating the need to pass in the theme manually as a props to each component.
6
7
  *
7
8
  */
8
-
9
9
  export const PcSharedComponentThemeInheritor = props => {
10
10
  const {
11
11
  theme,
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
2
  import './style.css';
3
-
4
3
  const PriceToggleButton = props => {
5
4
  const {
6
5
  isChecked = true,
@@ -20,5 +19,4 @@ const PriceToggleButton = props => {
20
19
  className: "toggleContainer"
21
20
  }, /*#__PURE__*/React.createElement("div", null, i18next.t('platform_plan_feature.monthly_plans')), /*#__PURE__*/React.createElement("div", null, i18next.t('platform_plan_feature.yearly_plans'))));
22
21
  };
23
-
24
22
  export default PriceToggleButton;