pcm-shared-components 2.1.107 → 2.1.109
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 +11 -7
- 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
|
@@ -1,140 +1,39 @@
|
|
|
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); }
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
|
-
import { ThemeProvider } from '@mui/
|
|
4
|
-
import { createTheme, useTheme } from '@mui/material/styles';
|
|
4
|
+
import { ThemeProvider, createTheme, useTheme, styled } from '@mui/material/styles';
|
|
5
5
|
import clsx from 'clsx';
|
|
6
6
|
import Button from '@mui/material/Button';
|
|
7
|
-
// import { toFloat_2_decimal } from '../../../tools/string_formatter';
|
|
8
7
|
import IconButton from '@mui/material/IconButton';
|
|
9
8
|
import EditIcon from '@mui/icons-material/Edit';
|
|
10
|
-
// import { limitStringLength } from 'app/tools/string_formatter';
|
|
11
|
-
// import { RiBarcodeLine } from 'react-icons/ri';
|
|
12
9
|
import ImageStack from '../../Images/ImageStack';
|
|
13
10
|
import InfoIcon from '@mui/icons-material/Info';
|
|
14
|
-
import Tooltip from '@mui/material/Tooltip';
|
|
15
|
-
import { makeStyles } from '@mui/styles';
|
|
16
|
-
import withStyles from "@mui/styles/withStyles";
|
|
11
|
+
import Tooltip, { tooltipClasses } from '@mui/material/Tooltip';
|
|
17
12
|
let debounce;
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
productButtonActive: {
|
|
35
|
-
color: '#fff',
|
|
36
|
-
height: ({
|
|
37
|
-
PRODUCT_BUTTON_HEIGHT
|
|
38
|
-
}) => PRODUCT_BUTTON_HEIGHT,
|
|
39
|
-
maxHeight: ({
|
|
40
|
-
PRODUCT_BUTTON_HEIGHT
|
|
41
|
-
}) => PRODUCT_BUTTON_HEIGHT,
|
|
42
|
-
// paddingRight: ({ hasImage, isTierPricing }) => (hasImage && isTierPricing) ? 2 : undefined,
|
|
43
|
-
textAlign: 'center',
|
|
44
|
-
fontSize: 16,
|
|
45
|
-
borderRadius: 5,
|
|
46
|
-
backgroundColor: theme.palette && theme.palette.primary.main ? theme.palette.primary.main : undefined,
|
|
47
|
-
'&:hover': {
|
|
48
|
-
backgroundColor: theme.palette && theme.palette.primary.dark ? theme.palette.primary.dark : undefined
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
productButtonNotActive: {
|
|
52
|
-
color: '#fff',
|
|
53
|
-
height: ({
|
|
54
|
-
PRODUCT_BUTTON_HEIGHT
|
|
55
|
-
}) => PRODUCT_BUTTON_HEIGHT,
|
|
56
|
-
maxHeight: ({
|
|
57
|
-
PRODUCT_BUTTON_HEIGHT
|
|
58
|
-
}) => PRODUCT_BUTTON_HEIGHT,
|
|
59
|
-
// paddingRight: ({ hasImage, isTierPricing }) => (hasImage && isTierPricing) ? 2 : undefined,
|
|
60
|
-
textAlign: 'center',
|
|
61
|
-
borderRadius: 5,
|
|
62
|
-
backgroundColor: theme.palette && theme.palette.action.focus ? theme.palette.action.focus : undefined,
|
|
63
|
-
'&:hover': {
|
|
64
|
-
backgroundColor: theme.palette && theme.palette.action.active ? theme.palette.action.active : undefined
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
productName: {
|
|
68
|
-
fontSize: 16,
|
|
69
|
-
lineHeight: 1,
|
|
70
|
-
"-webkit-line-clamp": ({
|
|
71
|
-
hasFooterSection
|
|
72
|
-
}) => hasFooterSection ? 1 : 2,
|
|
73
|
-
WebkitLineClamp: ({
|
|
74
|
-
hasFooterSection
|
|
75
|
-
}) => hasFooterSection ? 1 : 2,
|
|
76
|
-
display: '-webkit-box',
|
|
77
|
-
"-webkit-box-orient": 'vertical',
|
|
78
|
-
whiteSpace: 'normal',
|
|
79
|
-
overflow: 'hidden',
|
|
80
|
-
textOverflow: 'ellipsis'
|
|
81
|
-
},
|
|
82
|
-
productPrice: {
|
|
83
|
-
fontSize: 26,
|
|
84
|
-
lineHeight: 1.5,
|
|
85
|
-
"-webkit-line-clamp": 1,
|
|
86
|
-
WebkitLineClamp: 1,
|
|
87
|
-
display: '-webkit-box',
|
|
88
|
-
"-webkit-box-orient": 'vertical',
|
|
89
|
-
whiteSpace: 'normal',
|
|
90
|
-
overflow: 'hidden',
|
|
91
|
-
textOverflow: 'ellipsis'
|
|
92
|
-
},
|
|
93
|
-
productTirePrice: {
|
|
94
|
-
fontSize: 16,
|
|
95
|
-
lineHeight: 1.3,
|
|
96
|
-
"-webkit-line-clamp": 1,
|
|
97
|
-
WebkitLineClamp: 1,
|
|
98
|
-
display: '-webkit-box',
|
|
99
|
-
"-webkit-box-orient": 'vertical',
|
|
100
|
-
whiteSpace: 'normal',
|
|
101
|
-
overflow: 'hidden',
|
|
102
|
-
textOverflow: 'ellipsis'
|
|
103
|
-
},
|
|
104
|
-
productQuantity: {
|
|
105
|
-
fontSize: 11,
|
|
106
|
-
padding: 0,
|
|
107
|
-
marginTop: 0,
|
|
108
|
-
marginBottom: 0
|
|
109
|
-
},
|
|
110
|
-
productSKU: {
|
|
111
|
-
lineHeight: 1.5,
|
|
112
|
-
fontSize: 12,
|
|
113
|
-
padding: '0 5px 0px 5px',
|
|
114
|
-
margin: 'auto',
|
|
115
|
-
backgroundColor: 'white',
|
|
116
|
-
width: '100%',
|
|
117
|
-
minWidth: '100%',
|
|
118
|
-
color: 'orange',
|
|
119
|
-
borderRadius: 5
|
|
120
|
-
},
|
|
121
|
-
tierPriceSubtitle: {
|
|
122
|
-
lineHeight: 0.5,
|
|
123
|
-
padding: 0,
|
|
124
|
-
margin: 0,
|
|
125
|
-
fontSize: 10
|
|
13
|
+
const LightTooltip = styled(({
|
|
14
|
+
className,
|
|
15
|
+
...props
|
|
16
|
+
}) => /*#__PURE__*/React.createElement(Tooltip, _extends({}, props, {
|
|
17
|
+
classes: {
|
|
18
|
+
popper: className
|
|
19
|
+
}
|
|
20
|
+
})))(({
|
|
21
|
+
theme
|
|
22
|
+
}) => ({
|
|
23
|
+
[`& .${tooltipClasses.tooltip}`]: {
|
|
24
|
+
backgroundColor: theme?.palette?.common?.white,
|
|
25
|
+
color: theme?.palette?.common?.black,
|
|
26
|
+
boxShadow: theme?.shadows ? theme.shadows[1] : 1,
|
|
27
|
+
fontSize: 14
|
|
126
28
|
}
|
|
127
29
|
}));
|
|
128
30
|
|
|
129
31
|
/**
|
|
130
32
|
* ## Importing the component in your project
|
|
131
|
-
*
|
|
132
|
-
```js
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
```
|
|
137
|
-
*
|
|
33
|
+
*
|
|
34
|
+
* ```js
|
|
35
|
+
* import { ProductItemButton } from 'pcm-shared-components';
|
|
36
|
+
* ```
|
|
138
37
|
*/
|
|
139
38
|
export const ProductItemButton = props => {
|
|
140
39
|
const {
|
|
@@ -150,52 +49,62 @@ export const ProductItemButton = props => {
|
|
|
150
49
|
i18next,
|
|
151
50
|
theme
|
|
152
51
|
} = props;
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
PRODUCT_LARGE_BUTTON_WIDTH,
|
|
158
|
-
hasImage: productData.picturesFullURL && productData.picturesFullURL.length > 0 ? true : false,
|
|
159
|
-
isTierPricing: Number(productData.is_unit_pricing) !== 1 ? true : false,
|
|
160
|
-
hasFooterSection: FooterSection ? true : false
|
|
161
|
-
});
|
|
162
|
-
const compTheme = theme ? theme : useTheme();
|
|
52
|
+
const hasImage = productData.picturesFullURL && productData.picturesFullURL.length > 0;
|
|
53
|
+
const isTierPricing = Number(productData.is_unit_pricing) !== 1;
|
|
54
|
+
const hasFooterSection = Boolean(FooterSection);
|
|
55
|
+
const compTheme = theme || useTheme();
|
|
163
56
|
const defaultTheme = createTheme(compTheme);
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
}
|
|
177
|
-
const
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
57
|
+
const commonLineClampStyle = {
|
|
58
|
+
display: '-webkit-box',
|
|
59
|
+
WebkitBoxOrient: 'vertical',
|
|
60
|
+
whiteSpace: 'normal',
|
|
61
|
+
overflow: 'hidden',
|
|
62
|
+
textOverflow: 'ellipsis'
|
|
63
|
+
};
|
|
64
|
+
const productNameStyle = {
|
|
65
|
+
fontSize: 16,
|
|
66
|
+
lineHeight: 1,
|
|
67
|
+
WebkitLineClamp: hasFooterSection ? 1 : 2,
|
|
68
|
+
...commonLineClampStyle
|
|
69
|
+
};
|
|
70
|
+
const productPriceStyle = {
|
|
71
|
+
fontSize: 26,
|
|
72
|
+
lineHeight: 1.5,
|
|
73
|
+
WebkitLineClamp: 1,
|
|
74
|
+
...commonLineClampStyle
|
|
75
|
+
};
|
|
76
|
+
const productTierPriceStyle = {
|
|
77
|
+
fontSize: 16,
|
|
78
|
+
lineHeight: 1.3,
|
|
79
|
+
WebkitLineClamp: 1,
|
|
80
|
+
...commonLineClampStyle
|
|
81
|
+
};
|
|
82
|
+
const tierPriceSubtitleStyle = {
|
|
83
|
+
lineHeight: 0.5,
|
|
84
|
+
padding: 0,
|
|
85
|
+
margin: 0,
|
|
86
|
+
fontSize: 10
|
|
87
|
+
};
|
|
88
|
+
const productSKUStyle = {
|
|
89
|
+
lineHeight: 1.5,
|
|
90
|
+
fontSize: 12,
|
|
91
|
+
padding: '0 5px',
|
|
92
|
+
margin: 'auto',
|
|
93
|
+
backgroundColor: 'white',
|
|
94
|
+
width: '100%',
|
|
95
|
+
minWidth: '100%',
|
|
96
|
+
color: 'orange',
|
|
97
|
+
borderRadius: 5
|
|
98
|
+
};
|
|
99
|
+
const productQuantityStyle = {
|
|
100
|
+
fontSize: 11,
|
|
101
|
+
padding: 0,
|
|
102
|
+
marginTop: 0,
|
|
103
|
+
marginBottom: 0
|
|
195
104
|
};
|
|
196
105
|
const toFloat_2_decimal = value => {
|
|
197
106
|
try {
|
|
198
|
-
if (value) {
|
|
107
|
+
if (value !== undefined && value !== null) {
|
|
199
108
|
value = parseFloat(Math.round(value * 100) / 100).toFixed(2);
|
|
200
109
|
}
|
|
201
110
|
} catch (e) {
|
|
@@ -205,7 +114,7 @@ export const ProductItemButton = props => {
|
|
|
205
114
|
};
|
|
206
115
|
const toFloat_0_decimal = value => {
|
|
207
116
|
try {
|
|
208
|
-
if (value) {
|
|
117
|
+
if (value !== undefined && value !== null) {
|
|
209
118
|
value = parseFloat(Math.round(value * 100) / 100).toFixed(0);
|
|
210
119
|
}
|
|
211
120
|
} catch (e) {
|
|
@@ -213,11 +122,40 @@ export const ProductItemButton = props => {
|
|
|
213
122
|
}
|
|
214
123
|
return value;
|
|
215
124
|
};
|
|
125
|
+
const TierPricing = ({
|
|
126
|
+
price,
|
|
127
|
+
sub_title
|
|
128
|
+
}) => {
|
|
129
|
+
const thisPrice = toFloat_2_decimal(price);
|
|
130
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, parseFloat(thisPrice || 0) > 0 ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
131
|
+
title: sub_title,
|
|
132
|
+
arrow: true,
|
|
133
|
+
placement: "right-end"
|
|
134
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
135
|
+
className: clsx('flex flex-row m-auto')
|
|
136
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
137
|
+
className: clsx('p-0 my-auto'),
|
|
138
|
+
style: productTierPriceStyle
|
|
139
|
+
}, toFloat_2_decimal(price)), /*#__PURE__*/React.createElement("div", {
|
|
140
|
+
className: "h-full my-auto pl-4"
|
|
141
|
+
}, /*#__PURE__*/React.createElement("p", {
|
|
142
|
+
style: tierPriceSubtitleStyle
|
|
143
|
+
}, String(sub_title).substring(0, 2))))) : null);
|
|
144
|
+
};
|
|
216
145
|
return /*#__PURE__*/React.createElement(ThemeProvider, {
|
|
217
146
|
theme: defaultTheme
|
|
218
147
|
}, /*#__PURE__*/React.createElement("div", {
|
|
219
148
|
key: `product_list_items_${productData.product_id}`,
|
|
220
|
-
className: clsx(
|
|
149
|
+
className: clsx('flex flex-row'),
|
|
150
|
+
style: {
|
|
151
|
+
color: 'lightgray',
|
|
152
|
+
height: PRODUCT_BUTTON_HEIGHT,
|
|
153
|
+
maxHeight: PRODUCT_BUTTON_HEIGHT,
|
|
154
|
+
maxWidth: 'fit-content',
|
|
155
|
+
margin: PRODUCT_BUTTON_GUTTER,
|
|
156
|
+
backgroundColor: 'lightgray',
|
|
157
|
+
borderRadius: 5
|
|
158
|
+
}
|
|
221
159
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
222
160
|
onClick: () => {
|
|
223
161
|
clearTimeout(debounce);
|
|
@@ -226,27 +164,43 @@ export const ProductItemButton = props => {
|
|
|
226
164
|
}, 50);
|
|
227
165
|
},
|
|
228
166
|
variant: "contained",
|
|
229
|
-
|
|
167
|
+
sx: theme => ({
|
|
168
|
+
color: '#fff',
|
|
169
|
+
height: PRODUCT_BUTTON_HEIGHT,
|
|
170
|
+
maxHeight: PRODUCT_BUTTON_HEIGHT,
|
|
171
|
+
textAlign: 'center',
|
|
172
|
+
borderRadius: 5,
|
|
173
|
+
fontSize: 16,
|
|
174
|
+
...(Number(productData.state_id) === 1 ? {
|
|
175
|
+
backgroundColor: theme?.palette?.primary?.main,
|
|
176
|
+
'&:hover': {
|
|
177
|
+
backgroundColor: theme?.palette?.primary?.dark
|
|
178
|
+
}
|
|
179
|
+
} : {
|
|
180
|
+
backgroundColor: theme?.palette?.action?.focus,
|
|
181
|
+
'&:hover': {
|
|
182
|
+
backgroundColor: theme?.palette?.action?.active
|
|
183
|
+
}
|
|
184
|
+
})
|
|
185
|
+
}),
|
|
230
186
|
style: {
|
|
231
|
-
//change the width based on pricing type. So we can show the tiered pricing the button
|
|
232
187
|
width: Number(productData.is_unit_pricing) === 1 ? PRODUCT_SMALL_BUTTON_WIDTH : PRODUCT_LARGE_BUTTON_WIDTH,
|
|
233
188
|
height: '100%'
|
|
234
189
|
}
|
|
235
190
|
}, /*#__PURE__*/React.createElement("div", {
|
|
236
|
-
className: "flex flex-col w-full h-full justify-between
|
|
237
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
238
|
-
className:
|
|
239
|
-
|
|
240
|
-
className: clsx(classes.productName, 'my-auto mx-12')
|
|
191
|
+
className: "flex flex-col w-full h-full justify-between"
|
|
192
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("p", {
|
|
193
|
+
className: clsx('my-auto mx-12'),
|
|
194
|
+
style: productNameStyle
|
|
241
195
|
}, productData.name), productData.description && productData.description.length > 3 && /*#__PURE__*/React.createElement("div", {
|
|
242
|
-
className: "absolute right-0 top-0
|
|
196
|
+
className: "absolute right-0 top-0"
|
|
243
197
|
}, /*#__PURE__*/React.createElement(LightTooltip, {
|
|
244
198
|
title: productData.description,
|
|
245
199
|
arrow: true
|
|
246
200
|
}, /*#__PURE__*/React.createElement(InfoIcon, {
|
|
247
|
-
fontSize: "
|
|
248
|
-
})))),
|
|
249
|
-
className: "absolute left-0 -ml-10
|
|
201
|
+
fontSize: "small"
|
|
202
|
+
})))), hasImage && /*#__PURE__*/React.createElement("div", {
|
|
203
|
+
className: "absolute left-0 -ml-10 z-99",
|
|
250
204
|
style: {
|
|
251
205
|
top: '22%'
|
|
252
206
|
}
|
|
@@ -262,24 +216,25 @@ export const ProductItemButton = props => {
|
|
|
262
216
|
/*#__PURE__*/
|
|
263
217
|
// Unit Pricing
|
|
264
218
|
React.createElement("p", {
|
|
265
|
-
className: clsx(
|
|
219
|
+
className: clsx('my-auto'),
|
|
220
|
+
style: productPriceStyle
|
|
266
221
|
}, toFloat_2_decimal(productData.price_per_unit)) :
|
|
267
222
|
/*#__PURE__*/
|
|
268
|
-
//
|
|
223
|
+
// Tier Pricing
|
|
269
224
|
React.createElement("div", {
|
|
270
|
-
className:
|
|
225
|
+
className: clsx('flex flex-row justify-around m-auto capitalize', hasImage ? 'ml-24' : '')
|
|
271
226
|
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TierPricing, {
|
|
272
227
|
price: productData.daily_price,
|
|
273
|
-
sub_title: i18next
|
|
228
|
+
sub_title: i18next?.t('common.app.nightly') || ''
|
|
274
229
|
}), /*#__PURE__*/React.createElement(TierPricing, {
|
|
275
230
|
price: productData.weekly_price,
|
|
276
|
-
sub_title: i18next
|
|
231
|
+
sub_title: i18next?.t('common.app.weekly') || ''
|
|
277
232
|
})), /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TierPricing, {
|
|
278
233
|
price: productData.monthly_price,
|
|
279
|
-
sub_title: i18next
|
|
234
|
+
sub_title: i18next?.t('common.app.monthly') || ''
|
|
280
235
|
}), /*#__PURE__*/React.createElement(TierPricing, {
|
|
281
236
|
price: productData.seasonal_price,
|
|
282
|
-
sub_title: i18next
|
|
237
|
+
sub_title: i18next?.t('common.app.seasonal') || ''
|
|
283
238
|
}))))), /*#__PURE__*/React.createElement("div", {
|
|
284
239
|
className: "flex flex-row"
|
|
285
240
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -295,7 +250,7 @@ export const ProductItemButton = props => {
|
|
|
295
250
|
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
296
251
|
size: "small",
|
|
297
252
|
color: "primary",
|
|
298
|
-
"aria-label": "
|
|
253
|
+
"aria-label": "edit product",
|
|
299
254
|
component: "span"
|
|
300
255
|
}, /*#__PURE__*/React.createElement(EditIcon, null)))));
|
|
301
256
|
};
|
|
@@ -317,25 +272,25 @@ ProductItemButton.defaultProps = {
|
|
|
317
272
|
category_id: 1,
|
|
318
273
|
state_id: 1,
|
|
319
274
|
available_online: 1,
|
|
320
|
-
name:
|
|
321
|
-
description:
|
|
322
|
-
SKU:
|
|
323
|
-
allow_sale_if_quantity_zero:
|
|
324
|
-
last_stock_quantity:
|
|
325
|
-
is_unit_pricing:
|
|
326
|
-
price_per_unit:
|
|
327
|
-
stock_quantity:
|
|
328
|
-
daily_price:
|
|
329
|
-
weekly_price:
|
|
330
|
-
monthly_price:
|
|
331
|
-
seasonal_price:
|
|
275
|
+
name: '',
|
|
276
|
+
description: '',
|
|
277
|
+
SKU: '',
|
|
278
|
+
allow_sale_if_quantity_zero: '1',
|
|
279
|
+
last_stock_quantity: '0',
|
|
280
|
+
is_unit_pricing: '1',
|
|
281
|
+
price_per_unit: '0',
|
|
282
|
+
stock_quantity: '0',
|
|
283
|
+
daily_price: '0',
|
|
284
|
+
weekly_price: '0',
|
|
285
|
+
monthly_price: '0',
|
|
286
|
+
seasonal_price: '0',
|
|
332
287
|
pictures: [],
|
|
333
288
|
picturesFullURL: [],
|
|
334
|
-
discount_type_id:
|
|
335
|
-
discount_type_amount:
|
|
336
|
-
discount_total:
|
|
337
|
-
line_price_override:
|
|
338
|
-
product_category_name:
|
|
289
|
+
discount_type_id: '0',
|
|
290
|
+
discount_type_amount: '0',
|
|
291
|
+
discount_total: '0',
|
|
292
|
+
line_price_override: '0',
|
|
293
|
+
product_category_name: 'Res Addons'
|
|
339
294
|
}
|
|
340
295
|
};
|
|
341
296
|
ProductItemButton.propTypes = {
|
|
@@ -343,22 +298,22 @@ ProductItemButton.propTypes = {
|
|
|
343
298
|
showEdit: PropTypes.bool,
|
|
344
299
|
/** Gutter around the button */
|
|
345
300
|
PRODUCT_BUTTON_GUTTER: PropTypes.number,
|
|
346
|
-
/** The
|
|
301
|
+
/** The height of the button */
|
|
347
302
|
PRODUCT_BUTTON_HEIGHT: PropTypes.number,
|
|
348
303
|
/** Length of the small button when we are displaying a unit price */
|
|
349
304
|
PRODUCT_SMALL_BUTTON_WIDTH: PropTypes.number,
|
|
350
|
-
/** Product button width
|
|
305
|
+
/** Product button width used to display a larger button (currently same as small width) */
|
|
351
306
|
PRODUCT_LARGE_BUTTON_WIDTH: PropTypes.number,
|
|
352
307
|
/** Any component to display on the footer of the button */
|
|
353
308
|
FooterSection: PropTypes.any,
|
|
354
|
-
/** The
|
|
309
|
+
/** The callback when the edit button is clicked. Returns productData */
|
|
355
310
|
onEditClick: PropTypes.any,
|
|
356
|
-
/** The onclick callback when the button is clicked. Returns
|
|
311
|
+
/** The onclick callback when the button is clicked. Returns productData */
|
|
357
312
|
onClick: PropTypes.any,
|
|
358
313
|
/** This is the product object */
|
|
359
314
|
productData: PropTypes.any,
|
|
360
|
-
/** The i18next needs to be passed in by the component
|
|
315
|
+
/** The i18next instance needs to be passed in by the component */
|
|
361
316
|
i18next: PropTypes.any,
|
|
362
|
-
/** Theme object to use on this component
|
|
317
|
+
/** Theme object to use on this component; if none provided then the MUI theme provider theme is used */
|
|
363
318
|
theme: PropTypes.object
|
|
364
319
|
};
|
|
@@ -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';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (
|
|
2
|
-
import React from "react";
|
|
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
|
+
import React, { forwardRef } from "react";
|
|
3
3
|
import { Dialog, DialogContent } from '@mui/material';
|
|
4
4
|
import PropTypes from "prop-types";
|
|
5
5
|
import VerticalImageTile from "../../../Images/VerticalImageTile";
|
|
6
6
|
import Slide from '@mui/material/Slide';
|
|
7
7
|
import { IconButton } from '@mui/material';
|
|
8
8
|
import ArrowBackIosNewIcon from '@mui/icons-material/ArrowBackIosNew';
|
|
9
|
-
const Transition = /*#__PURE__*/
|
|
9
|
+
const Transition = /*#__PURE__*/forwardRef(function Transition(props, ref) {
|
|
10
10
|
return /*#__PURE__*/React.createElement(Slide, _extends({
|
|
11
11
|
direction: "up",
|
|
12
12
|
ref: ref
|
|
@@ -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, { useState, useEffect, useCallback } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import moment from "moment";
|
|
@@ -145,7 +145,7 @@ DateCalendar.propTypes = {
|
|
|
145
145
|
dateFormat: PropTypes.string,
|
|
146
146
|
/** Min booking days allowing the user to select a valid date range.*/
|
|
147
147
|
minBookingDays: PropTypes.number,
|
|
148
|
-
/** Provides a (date:date) props to the function and expects a
|
|
148
|
+
/** Provides a (date:date) props to the function and expects a ReactNode component to be returned */
|
|
149
149
|
onDayRender: PropTypes.func,
|
|
150
150
|
/** Provides a (date:date) props to the function and expects a boolean value returned which tells the calendar to either block or not that day*/
|
|
151
151
|
isDateBlocked: PropTypes.func,
|
|
@@ -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 { useState } from 'react';
|
|
3
3
|
import DateCalendar from '..';
|
|
4
4
|
import IndexDocs from './index.docs.mdx';
|
|
@@ -135,7 +135,7 @@ DateRangeCalendar.propTypes = {
|
|
|
135
135
|
dateFormat: PropTypes.string,
|
|
136
136
|
/** Min booking days allowing the user to select a valid date range.*/
|
|
137
137
|
minBookingDays: PropTypes.number,
|
|
138
|
-
/** Provides a (date:date) props to the function and expects a
|
|
138
|
+
/** Provides a (date:date) props to the function and expects a ReactNode component to be returned */
|
|
139
139
|
onDayRender: PropTypes.func,
|
|
140
140
|
/** Provides a (date:date) props to the function and expects a boolean value returned which tells the calendar to either block or not that day*/
|
|
141
141
|
isDateBlocked: PropTypes.func,
|
package/dist/components/Date/DatePickerReactStyled/DateRangeCalendar/storybook/index.stories.js
CHANGED
|
@@ -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 { useState } from 'react';
|
|
3
3
|
import DateRangeCalendar from '..';
|
|
4
4
|
import IndexDocs from './index.docs.mdx';
|
|
@@ -37,7 +37,6 @@ export const commonCalendarTheme = ({
|
|
|
37
37
|
// normalDayHover: 'transparent',
|
|
38
38
|
...themeConfig.colors // Allows overriding color settings
|
|
39
39
|
},
|
|
40
|
-
|
|
41
40
|
inputLabelBorder: variant === 'outlined' ? undefined : 'none',
|
|
42
41
|
datepickerZIndex: zIndex,
|
|
43
42
|
dateRangeZIndex: zIndex,
|
|
@@ -46,6 +45,5 @@ export const commonCalendarTheme = ({
|
|
|
46
45
|
...themeConfig // Spread additional custom configuration
|
|
47
46
|
}
|
|
48
47
|
};
|
|
49
|
-
|
|
50
48
|
return theme;
|
|
51
49
|
};
|
|
@@ -98,7 +98,6 @@ export const PricingCalendar = props => {
|
|
|
98
98
|
// selectedDays={[moment(startDate), { from: moment(startDate).toDate(), to: new moment(endDate).toDate() }]}
|
|
99
99
|
}));
|
|
100
100
|
};
|
|
101
|
-
|
|
102
101
|
export default PricingCalendar;
|
|
103
102
|
PricingCalendar.defaultProps = {
|
|
104
103
|
i18next: undefined,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { Tooltip, IconButton, MenuItem, Menu } from "@mui/material";
|
|
3
3
|
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
|
|
4
|
-
|
|
4
|
+
function GenericAppBarSubMenu({
|
|
5
5
|
menu,
|
|
6
6
|
classes,
|
|
7
7
|
full_menu = false,
|
|
8
8
|
handleParentMenuClose = undefined
|
|
9
|
-
})
|
|
9
|
+
}) {
|
|
10
10
|
const [anchorSubMenu, setAnchorSubMenu] = useState(false);
|
|
11
11
|
const [isSubMenuOpen, setSubMenuOpen] = useState(false);
|
|
12
12
|
const openSubMenu = event => {
|
|
@@ -21,7 +21,6 @@ const GenericAppBarSubMenu = ({
|
|
|
21
21
|
}
|
|
22
22
|
// handleMobileMenuClose();
|
|
23
23
|
};
|
|
24
|
-
|
|
25
24
|
useEffect(() => {
|
|
26
25
|
setSubMenuOpen(Boolean(anchorSubMenu));
|
|
27
26
|
}, [anchorSubMenu]);
|
|
@@ -39,7 +38,6 @@ const GenericAppBarSubMenu = ({
|
|
|
39
38
|
}))) : /*#__PURE__*/React.createElement(Tooltip, {
|
|
40
39
|
title: menu.name
|
|
41
40
|
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
42
|
-
className: classes.menuButton,
|
|
43
41
|
color: "inherit",
|
|
44
42
|
"aria-owns": "menu-appbar",
|
|
45
43
|
onClick: openSubMenu
|
|
@@ -76,5 +74,5 @@ const GenericAppBarSubMenu = ({
|
|
|
76
74
|
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
77
75
|
color: "inherit"
|
|
78
76
|
}, sub_menu.icon), /*#__PURE__*/React.createElement("p", null, sub_menu.name))))));
|
|
79
|
-
}
|
|
77
|
+
}
|
|
80
78
|
export default GenericAppBarSubMenu;
|