pcm-shared-components 2.1.107 → 2.1.108
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/README.md +21 -1
- package/dist/components/Buttons/CustomFab/index.js +55 -88
- package/dist/components/Buttons/DropdownButton/index.js +1 -1
- package/dist/components/Buttons/ProductItemButton/index.js +164 -209
- package/dist/components/Buttons/TillButton/index.js +1 -1
- package/dist/components/Cards/EventCard/components/OpenEventViewAllImageDialog.js +3 -3
- package/dist/components/Cards/EventCard/index.js +1 -1
- package/dist/components/Date/DatePickerReactStyled/DateCalendar/index.js +1 -1
- package/dist/components/Date/DatePickerReactStyled/DateCalendar/storybook/index.stories.js +1 -1
- package/dist/components/Date/DatePickerReactStyled/DateRangeCalendar/index.js +1 -1
- package/dist/components/Date/DatePickerReactStyled/DateRangeCalendar/storybook/index.stories.js +1 -1
- package/dist/components/Date/DatePickerReactStyled/common/theme.js +0 -2
- package/dist/components/Date/PricingCalendar/index.js +0 -1
- package/dist/components/Dialogs/GenericAppBar/components/GenericAppBarSubMenu.js +3 -5
- package/dist/components/Dialogs/GenericAppBar/index.js +78 -171
- package/dist/components/Dialogs/GenericDialogWindow/index.js +2 -2
- package/dist/components/Dialogs/GenericDialogWindow/index_UPGRADED.js +226 -0
- package/dist/components/Drawing/ImageCanvasDraw/components/Controls.js +0 -1
- package/dist/components/Layout/SimpleTab/index.js +38 -62
- package/dist/components/Menus/ReusablePopupMenu/components/ReusableMenu.js +58 -58
- package/dist/components/Menus/ReusablePopupMenu/components/{GenericSubMenu.js → SubMenuInternal.js} +50 -80
- package/dist/components/Menus/ReusablePopupMenu/index copy.js +98 -0
- package/dist/components/Menus/ReusablePopupMenu/index.js +39 -44
- package/dist/components/PcSharedComponentThemeInheritor/index.js +2 -2
- package/dist/components/Platform/PlatformPaymentPlans/index.js +1 -1
- package/dist/locals/i18n.js +0 -1
- package/dist/styles/tailwind.css +1 -1
- package/package.json +14 -11
package/README.md
CHANGED
|
@@ -37,4 +37,24 @@ sh ./publish.sh
|
|
|
37
37
|
|
|
38
38
|
# Update the remote Library
|
|
39
39
|
|
|
40
|
-
```npm run bump``` - This will bump the version of the library and push it to the remote repository.
|
|
40
|
+
```npm run bump``` - This will bump the version of the library and push it to the remote repository.
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
# Upgraded Node Modules to 20 (Nov 15, 2025)
|
|
44
|
+
|
|
45
|
+
Steps needed to upgrade node modules to version 20 on your local machine:
|
|
46
|
+
- delete the node_modules folder
|
|
47
|
+
- delete package-lock.json
|
|
48
|
+
- nvm install 20
|
|
49
|
+
- nvm alias default 20
|
|
50
|
+
- nvm use 20
|
|
51
|
+
- echo "20" > .nvmrc
|
|
52
|
+
- nvm use
|
|
53
|
+
- npm install
|
|
54
|
+
- npm start
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# Storybook Upgrade
|
|
58
|
+
|
|
59
|
+
I tried to upgrade to the latest version 10 but it needs react 18 which I'm not ready to do yet.
|
|
60
|
+
So for now i'm sticking with version 6.
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
|
-
import { makeStyles } from '@mui/styles';
|
|
3
2
|
import Fab from '@mui/material/Fab';
|
|
4
3
|
import PropTypes from 'prop-types';
|
|
5
4
|
import Tooltip from '@mui/material/Tooltip';
|
|
6
5
|
import clsx from 'clsx';
|
|
7
6
|
import MoreVertIcon from '@mui/icons-material/MoreVert';
|
|
8
|
-
import { ThemeProvider } from '@mui/
|
|
9
|
-
import { createTheme, useTheme } from '@mui/material/styles';
|
|
7
|
+
import { ThemeProvider, createTheme, useTheme } from '@mui/material/styles';
|
|
10
8
|
const getSize = size => {
|
|
11
9
|
switch (size) {
|
|
12
10
|
case 'x-small':
|
|
@@ -16,7 +14,6 @@ const getSize = size => {
|
|
|
16
14
|
case 'medium':
|
|
17
15
|
return 48;
|
|
18
16
|
case 'large':
|
|
19
|
-
return 56;
|
|
20
17
|
default:
|
|
21
18
|
return 56;
|
|
22
19
|
}
|
|
@@ -26,74 +23,12 @@ const getPadding = size => {
|
|
|
26
23
|
case 'x-small':
|
|
27
24
|
return '0px 8px 0px 8px';
|
|
28
25
|
case 'small':
|
|
29
|
-
return '0px 16px 0px 16px';
|
|
30
26
|
case 'medium':
|
|
31
|
-
return '0px 16px 0px 16px';
|
|
32
27
|
case 'large':
|
|
33
|
-
return '0px 16px 0px 16px';
|
|
34
28
|
default:
|
|
35
29
|
return '0px 16px 0px 16px';
|
|
36
30
|
}
|
|
37
31
|
};
|
|
38
|
-
const useStyles = makeStyles(() => ({
|
|
39
|
-
rootFabElement: {
|
|
40
|
-
margin: 2,
|
|
41
|
-
borderRadius: ({
|
|
42
|
-
borderRadius
|
|
43
|
-
}) => borderRadius,
|
|
44
|
-
height: ({
|
|
45
|
-
size
|
|
46
|
-
}) => getSize(size),
|
|
47
|
-
minHeight: ({
|
|
48
|
-
size
|
|
49
|
-
}) => getSize(size),
|
|
50
|
-
width: ({
|
|
51
|
-
size,
|
|
52
|
-
buttonText
|
|
53
|
-
}) => buttonText.length === 0 ? getSize(size) : 'auto',
|
|
54
|
-
minWidth: ({
|
|
55
|
-
size,
|
|
56
|
-
buttonText
|
|
57
|
-
}) => buttonText.length === 0 ? getSize(size) : 'auto',
|
|
58
|
-
padding: ({
|
|
59
|
-
size
|
|
60
|
-
}) => getPadding(size),
|
|
61
|
-
backgroundColor: ({
|
|
62
|
-
backgroundColor
|
|
63
|
-
}) => backgroundColor,
|
|
64
|
-
'&:hover': {
|
|
65
|
-
background: ({
|
|
66
|
-
hoverBackgroundColor
|
|
67
|
-
}) => hoverBackgroundColor,
|
|
68
|
-
color: ({
|
|
69
|
-
hoverTextColor
|
|
70
|
-
}) => hoverTextColor
|
|
71
|
-
},
|
|
72
|
-
boxShadow: ({
|
|
73
|
-
boxShadow
|
|
74
|
-
}) => boxShadow ? '' : 'none',
|
|
75
|
-
color: ({
|
|
76
|
-
textColor
|
|
77
|
-
}) => textColor
|
|
78
|
-
},
|
|
79
|
-
Icon: {
|
|
80
|
-
width: ({
|
|
81
|
-
iconSize
|
|
82
|
-
}) => iconSize,
|
|
83
|
-
height: ({
|
|
84
|
-
iconSize
|
|
85
|
-
}) => iconSize,
|
|
86
|
-
// width: ({iconSize}) => `${iconSize}px !important`,
|
|
87
|
-
// height: ({iconSize}) => `${iconSize}px !important`,
|
|
88
|
-
marginTop: 'auto',
|
|
89
|
-
marginBottom: 'auto'
|
|
90
|
-
},
|
|
91
|
-
buttonText: {
|
|
92
|
-
fontSize: ({
|
|
93
|
-
buttonFontSize
|
|
94
|
-
}) => buttonFontSize
|
|
95
|
-
}
|
|
96
|
-
}));
|
|
97
32
|
export const CustomFab = props => {
|
|
98
33
|
const {
|
|
99
34
|
onClick,
|
|
@@ -108,11 +43,20 @@ export const CustomFab = props => {
|
|
|
108
43
|
boxShadow,
|
|
109
44
|
borderRadius,
|
|
110
45
|
iconLocation,
|
|
46
|
+
iconSize,
|
|
47
|
+
buttonFontSize,
|
|
48
|
+
hoverBackgroundColor,
|
|
49
|
+
textColor,
|
|
50
|
+
hoverTextColor,
|
|
111
51
|
theme
|
|
112
52
|
} = props;
|
|
113
|
-
const compTheme = theme
|
|
53
|
+
const compTheme = theme || useTheme();
|
|
114
54
|
const defaultTheme = createTheme(compTheme);
|
|
115
|
-
const
|
|
55
|
+
const hasText = buttonText && buttonText.length > 0;
|
|
56
|
+
const fabSizeValue = getSize(size);
|
|
57
|
+
|
|
58
|
+
// Map custom 'x-small' to a valid MUI size for the Fab itself
|
|
59
|
+
const muiFabSize = size === 'x-small' ? 'small' : size;
|
|
116
60
|
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
117
61
|
theme: defaultTheme
|
|
118
62
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -122,21 +66,44 @@ export const CustomFab = props => {
|
|
|
122
66
|
padding: 4
|
|
123
67
|
}
|
|
124
68
|
}, tooltipText) : undefined,
|
|
125
|
-
disableHoverListener: !tooltipText || tooltipText.length === 0
|
|
69
|
+
disableHoverListener: !tooltipText || tooltipText.length === 0
|
|
126
70
|
}, /*#__PURE__*/React.createElement(Fab, {
|
|
127
|
-
size:
|
|
128
|
-
color: backgroundColor ?
|
|
71
|
+
size: muiFabSize,
|
|
72
|
+
color: backgroundColor ? undefined : color,
|
|
129
73
|
"aria-label": "add",
|
|
130
|
-
className: clsx(
|
|
131
|
-
variant:
|
|
132
|
-
onClick: onClick
|
|
74
|
+
className: clsx(className),
|
|
75
|
+
variant: hasText ? 'extended' : variant,
|
|
76
|
+
onClick: onClick,
|
|
77
|
+
sx: {
|
|
78
|
+
m: 0.5,
|
|
79
|
+
borderRadius: borderRadius,
|
|
80
|
+
height: fabSizeValue,
|
|
81
|
+
minHeight: fabSizeValue,
|
|
82
|
+
width: hasText ? 'auto' : fabSizeValue,
|
|
83
|
+
minWidth: hasText ? 'auto' : fabSizeValue,
|
|
84
|
+
padding: getPadding(size),
|
|
85
|
+
backgroundColor: backgroundColor,
|
|
86
|
+
'&:hover': {
|
|
87
|
+
background: hoverBackgroundColor,
|
|
88
|
+
color: hoverTextColor
|
|
89
|
+
},
|
|
90
|
+
boxShadow: boxShadow ? undefined : 'none',
|
|
91
|
+
color: textColor
|
|
92
|
+
}
|
|
133
93
|
}, /*#__PURE__*/React.createElement("div", {
|
|
134
|
-
className:
|
|
94
|
+
className: clsx('flex', iconLocation === 'left' ? 'flex-row' : 'flex-row-reverse')
|
|
135
95
|
}, Icon && /*#__PURE__*/React.createElement(Icon, {
|
|
136
|
-
className:
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
96
|
+
className: "my-auto",
|
|
97
|
+
sx: {
|
|
98
|
+
width: iconSize,
|
|
99
|
+
height: iconSize
|
|
100
|
+
}
|
|
101
|
+
}), hasText && /*#__PURE__*/React.createElement("div", {
|
|
102
|
+
className: "mx-6 my-auto",
|
|
103
|
+
style: {
|
|
104
|
+
fontSize: buttonFontSize
|
|
105
|
+
}
|
|
106
|
+
}, buttonText)))));
|
|
140
107
|
};
|
|
141
108
|
export default /*#__PURE__*/memo(CustomFab);
|
|
142
109
|
CustomFab.defaultProps = {
|
|
@@ -161,26 +128,26 @@ CustomFab.defaultProps = {
|
|
|
161
128
|
};
|
|
162
129
|
CustomFab.propTypes = {
|
|
163
130
|
/** onClick function passed to the button */
|
|
164
|
-
onClick: PropTypes.
|
|
165
|
-
/** Icon to be used in the button */
|
|
166
|
-
Icon: PropTypes.
|
|
131
|
+
onClick: PropTypes.func,
|
|
132
|
+
/** Icon component to be used in the button */
|
|
133
|
+
Icon: PropTypes.elementType,
|
|
167
134
|
/** Controls the size of the icon in pixels */
|
|
168
135
|
iconSize: PropTypes.number,
|
|
169
136
|
/** Controls the border radius of the button's rounded ends */
|
|
170
137
|
borderRadius: PropTypes.number,
|
|
171
138
|
/** Text inside of the button */
|
|
172
139
|
buttonText: PropTypes.string,
|
|
173
|
-
|
|
140
|
+
/** Font size of the button text */
|
|
174
141
|
buttonFontSize: PropTypes.number,
|
|
175
142
|
/** Either [circular or extended] if including text */
|
|
176
143
|
variant: PropTypes.oneOf(['extended', 'circular']),
|
|
177
|
-
/** Either [left or right] controls the location of the icon*/
|
|
144
|
+
/** Either [left or right] controls the location of the icon */
|
|
178
145
|
iconLocation: PropTypes.oneOf(['left', 'right']),
|
|
179
146
|
/** The text to display in the tooltip */
|
|
180
147
|
tooltipText: PropTypes.string,
|
|
181
|
-
/** Display the drop shadow or not
|
|
148
|
+
/** Display the drop shadow or not */
|
|
182
149
|
boxShadow: PropTypes.bool,
|
|
183
|
-
/** Background color */
|
|
150
|
+
/** Background color (overrides MUI color prop) */
|
|
184
151
|
backgroundColor: PropTypes.string,
|
|
185
152
|
/** On hover background color. */
|
|
186
153
|
hoverBackgroundColor: PropTypes.string,
|
|
@@ -188,12 +155,12 @@ CustomFab.propTypes = {
|
|
|
188
155
|
textColor: PropTypes.string,
|
|
189
156
|
/** The color of the text and icon on hover */
|
|
190
157
|
hoverTextColor: PropTypes.string,
|
|
191
|
-
/** Size of the FAB icon ['small','medium','large'] */
|
|
158
|
+
/** Size of the FAB icon ['x-small','small','medium','large'] */
|
|
192
159
|
size: PropTypes.oneOf(['x-small', 'small', 'medium', 'large']),
|
|
193
160
|
/** Classes to override */
|
|
194
161
|
className: PropTypes.string,
|
|
195
162
|
/** Theme colors if not using backgroundColor ['primary','secondary'] */
|
|
196
163
|
color: PropTypes.oneOf(['primary', 'secondary']),
|
|
197
|
-
/** Theme object to use on this component, if none provided then the
|
|
164
|
+
/** Theme object to use on this component, if none provided then the MUI theme provider theme is used */
|
|
198
165
|
theme: PropTypes.object
|
|
199
166
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
2
|
import React, { memo } from 'react';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import KeyboardArrowDownIcon from '@mui/icons-material/KeyboardArrowDown';
|