pcm-shared-components 0.0.133 → 0.0.136

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.
@@ -4,9 +4,10 @@ import React, { memo } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
6
6
  import { ThemeProvider } from '@mui/system';
7
- import { createTheme, useTheme } from '@mui/material/styles';
8
- import { CustomFab } from '../CustomFab';
7
+ import { createTheme, useTheme } from '@mui/material/styles'; // import { CustomFab } from '../CustomFab';
8
+
9
9
  import { ReusablePopupMenu } from '../../Menus/ReusablePopupMenu';
10
+ import Button from '@mui/material/Button';
10
11
  /**
11
12
  * Creates a generic button with a drop down.
12
13
  * Uses:
@@ -25,11 +26,11 @@ import { ReusablePopupMenu } from '../../Menus/ReusablePopupMenu';
25
26
  export const DropdownButton = props => {
26
27
  const {
27
28
  name,
28
- defaultText,
29
29
  color,
30
+ className,
30
31
  menuData,
32
+ variant,
31
33
  size,
32
- borderRadius,
33
34
  theme
34
35
  } = props;
35
36
  const compTheme = theme ? theme : useTheme();
@@ -38,45 +39,42 @@ export const DropdownButton = props => {
38
39
  theme: defaultTheme
39
40
  }, /*#__PURE__*/React.createElement(ReusablePopupMenu, _extends({}, menuData, {
40
41
  theme: defaultTheme
41
- }), /*#__PURE__*/React.createElement(CustomFab, {
42
- Icon: KeyboardArrowDownIcon,
42
+ }), /*#__PURE__*/React.createElement(Button, {
43
+ variant: variant,
44
+ className: className,
45
+ endIcon: /*#__PURE__*/React.createElement(KeyboardArrowDownIcon, null),
43
46
  color: color,
44
- size: size,
45
- boxShadow: false,
46
- buttonText: `${defaultText} ${name ? ':' : ''} ${name}`,
47
- iconLocation: 'right',
48
- borderRadius: borderRadius,
49
- theme: defaultTheme
50
- })));
47
+ size: className ? undefined : size
48
+ }, name)));
51
49
  };
52
50
  export default /*#__PURE__*/memo(DropdownButton);
53
51
  DropdownButton.defaultProps = {
54
- name: '',
55
- defaultText: 'Any Text',
52
+ name: 'Button Name',
56
53
  menuData: [],
57
- size: 'x-small',
54
+ size: 'large',
58
55
  color: 'primary',
59
- borderRadius: 8,
56
+ className: '',
57
+ variant: 'text',
60
58
  theme: {}
61
59
  };
62
60
  DropdownButton.propTypes = {
63
61
  /** Name of the till being used. Note: if till name exist then inUse is true */
64
62
  name: PropTypes.string,
65
63
 
64
+ /** Classes applied to the button */
65
+ className: PropTypes.string,
66
+
67
+ /** Type of button to use*/
68
+ variant: PropTypes.oneOf(['text', 'contained', 'outlined']),
69
+
66
70
  /** Color of the button*/
67
71
  color: PropTypes.oneOf(['primary', 'secondary']),
68
72
 
69
- /** Text used to identify the string in front of the till name. example: Till : Some name */
70
- defaultText: PropTypes.string,
71
-
72
73
  /** Menu items for the dropdown, see the ReusablePopupMenu component for a better understanding of the props parameters */
73
74
  menuData: PropTypes.array,
74
75
 
75
- /** Controls the border radius of the button's rounded ends */
76
- borderRadius: PropTypes.number,
77
-
78
76
  /** Supported size of the button ['x-small', 'small','medium'] */
79
- size: PropTypes.oneOf(['x-small', 'small', 'medium']),
77
+ size: PropTypes.oneOf(['small', 'medium', 'large']),
80
78
 
81
79
  /** Theme object to use on this component, if none provided then the MUI5 theme provider theme is used*/
82
80
  theme: PropTypes.object
@@ -4,8 +4,7 @@ import React, { memo } from 'react';
4
4
  import PropTypes from 'prop-types';
5
5
  import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
6
6
  import { ThemeProvider } from '@mui/system';
7
- import { createTheme, useTheme } from '@mui/material/styles'; // import { CustomFab } from '../CustomFab';
8
-
7
+ import { createTheme, useTheme } from '@mui/material/styles';
9
8
  import { ReusablePopupMenu } from '../../Menus/ReusablePopupMenu';
10
9
  import i18n from '../../../locals/i18n';
11
10
  import Button from '@mui/material/Button';
@@ -155,7 +155,7 @@ DateRangeCalendar.defaultProps = {
155
155
  variant: 'standard'
156
156
  };
157
157
  DateRangeCalendar.propTypes = {
158
- /** Used to provide the minimum booking date base on the current start date before the calendar will allow a end selection. Defaults to one day from the current date and time.*/
158
+ /** Used to provide the minimum booking date. To allow date selection past todays date simply pas it an old past date example 'new Date('1999-10-02')' */
159
159
  minBookingDate: PropTypes.instanceOf(Date),
160
160
 
161
161
  /** Number of calendar months to display when we are in mobile view.*/
package/dist/index.js CHANGED
@@ -18,4 +18,5 @@ import DropdownButton from './components/Buttons/DropdownButton';
18
18
  import translationResources from './locals/translationResources';
19
19
  import coreLocals from './locals/coreLocals';
20
20
  import currencySymbol from './locals/currencySymbol';
21
- export { TestButton, CodeHighlight, CustomFab, HelpButton, GenericDialogWindow, PcSharedComponentThemeInheritor, ImageCanvasDraw, PCMScrollbar, TwoColumnDisplay, SimpleTab, HrefLink, GenericAppBar, ReusablePopupMenu, SearchBar, TillButton, DropdownButton, translationResources, coreLocals, currencySymbol };
21
+ import DateRangeCalendar from './components/Date/DateRangeCalendar';
22
+ export { TestButton, CodeHighlight, CustomFab, HelpButton, GenericDialogWindow, PcSharedComponentThemeInheritor, ImageCanvasDraw, PCMScrollbar, TwoColumnDisplay, SimpleTab, HrefLink, GenericAppBar, ReusablePopupMenu, SearchBar, TillButton, DropdownButton, translationResources, coreLocals, currencySymbol, DateRangeCalendar };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pcm-shared-components",
3
- "version": "0.0.133",
3
+ "version": "0.0.136",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "babel": {