pcm-shared-components 0.0.231 → 0.0.232

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.
@@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
3
3
  import { orange } from '@mui/material/colors';
4
4
  import { DateRangeInput } from '@datepicker-react/styled';
5
5
  import { ThemeProvider } from 'styled-components';
6
- import i18next from 'i18next';
7
6
  import './css/style.css';
8
7
  /**
9
8
  * example with styling https://codesandbox.io/s/react-date-picker-rangeinput-jw726?from-embed=&file=/src/index.js:2503-2537
@@ -31,7 +30,8 @@ export const DateRangeCalendar = props => {
31
30
  endDate,
32
31
  variant,
33
32
  vertical,
34
- zIndex
33
+ zIndex,
34
+ i18next
35
35
  } = props;
36
36
 
37
37
  const handleOnDayRender = date => {
@@ -146,7 +146,8 @@ DateRangeCalendar.defaultProps = {
146
146
  focusedInput: null,
147
147
  variant: 'standard',
148
148
  vertical: false,
149
- zIndex: 1000
149
+ zIndex: 1000,
150
+ i18next: undefined
150
151
  };
151
152
  DateRangeCalendar.propTypes = {
152
153
  /** 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')' */
@@ -189,5 +190,8 @@ DateRangeCalendar.propTypes = {
189
190
  vertical: PropTypes.bool,
190
191
 
191
192
  /** Controls the z-index of the calendar dropdown date selection */
192
- zIndex: PropTypes.number
193
+ zIndex: PropTypes.number,
194
+
195
+ /** i18next localization to use for the component. Don't use the library localization or else it won't load properly on the consuming application */
196
+ i18next: PropTypes.any
193
197
  };
@@ -1,11 +1,11 @@
1
1
  import React from 'react';
2
2
  import './style.css';
3
- import i18next from 'i18next';
4
3
 
5
4
  const PriceToggleButton = props => {
6
5
  const {
7
6
  isChecked = true,
8
- onCheck = () => {}
7
+ onCheck = () => {},
8
+ i18next
9
9
  } = props;
10
10
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("input", {
11
11
  type: "checkbox",
@@ -224,64 +224,44 @@ export const PlatformPaymentPlans = props => {
224
224
  className: "my-12 space-y-10 list-none hover:list-disc pl-8"
225
225
  }, (platformPlanFeatures || []).filter(feature => Number(feature.show_in_pricing_table) === 1).sort((a, b) => a.platform_plan_type_id - b.platform_plan_type_id).map(plan => /*#__PURE__*/React.createElement(PlatformListItem, {
226
226
  active: Number(platform_plan_type_id) >= Number(plan.platform_plan_type_id),
227
- text: t(`platform_plan_feature.feature_names.${plan.feature_key}`),
227
+ text: i18next.t(`platform_plan_feature.feature_names.${plan.feature_key}`),
228
228
  show_as_new_in_pricing_table: plan.show_as_new_in_pricing_table,
229
229
  key_item: `list_items_${billing_period_id}_${plan.platform_plan_type_id}_${plan.feature_key}`,
230
230
  key: `list_item_${billing_period_id}_${plan.platform_plan_type_id}_${plan.feature_key}`
231
231
  })))));
232
232
  };
233
233
 
234
- return (
235
- /*#__PURE__*/
236
- // <>
237
- // <div>
238
- // This is a user:
239
- // {i18next.t('common.app.user')}
240
- // </div>
241
- // <div>
242
- // This is a search:
243
- // {i18next.t('common.app.search')}
244
- // </div>
245
- // <div>
246
- // This is a yes:
247
- // {i18next.t('common.app.yes')}
248
- // </div>
249
- // <div>
250
- // This is a per reservation:
251
- // {i18next.t('common.app.per_reservation')}
252
- // </div>
253
- // </>
254
- React.createElement(ThemeProvider, {
255
- theme: defaultTheme
256
- }, /*#__PURE__*/React.createElement("div", {
257
- className: "flex flex-col w-full h-full"
258
- }, hasMonthlyAndYearlyBillingPeriod && /*#__PURE__*/React.createElement("div", {
259
- className: "flex flex-col m-auto"
260
- }, saveYearlyImgPath && /*#__PURE__*/React.createElement("div", {
261
- className: "flex justify-end w-full "
262
- }, /*#__PURE__*/React.createElement("img", {
263
- className: "mr-24 cursor-pointer hover:rotate-3 hover:scale-105 hover:translate-y-1 hover:skew-y-3 transition-all",
264
- src: saveYearlyImgPath,
265
- alt: "save on yr plans",
266
- style: {
267
- height: 80
268
- },
269
- onClick: () => {
270
- setSelectedBillingPeriod(2);
271
- }
272
- })), /*#__PURE__*/React.createElement("div", {
273
- className: "mb-12"
274
- }, /*#__PURE__*/React.createElement(PriceToggleButton, {
275
- isChecked: selectedBillingPeriod === 2,
276
- onCheck: checked => {
277
- setSelectedBillingPeriod(checked ? 2 : 1);
278
- }
279
- }))), /*#__PURE__*/React.createElement("div", {
280
- className: "flex flex-wrap justify-center max-w-max mx-auto pt-12"
281
- }, platformPricingModels.filter(price => Number(price.billing_period_id) === selectedBillingPeriod).map((model, idx) => /*#__PURE__*/React.createElement(PriceCard, _extends({
282
- key: `price_card_${idx}`
283
- }, model))))))
284
- );
234
+ return /*#__PURE__*/React.createElement(ThemeProvider, {
235
+ theme: defaultTheme
236
+ }, /*#__PURE__*/React.createElement("div", {
237
+ className: "flex flex-col w-full h-full"
238
+ }, hasMonthlyAndYearlyBillingPeriod && /*#__PURE__*/React.createElement("div", {
239
+ className: "flex flex-col m-auto"
240
+ }, saveYearlyImgPath && /*#__PURE__*/React.createElement("div", {
241
+ className: "flex justify-end w-full "
242
+ }, /*#__PURE__*/React.createElement("img", {
243
+ className: "mr-24 cursor-pointer hover:rotate-3 hover:scale-105 hover:translate-y-1 hover:skew-y-3 transition-all",
244
+ src: saveYearlyImgPath,
245
+ alt: "save on yr plans",
246
+ style: {
247
+ height: 80
248
+ },
249
+ onClick: () => {
250
+ setSelectedBillingPeriod(2);
251
+ }
252
+ })), /*#__PURE__*/React.createElement("div", {
253
+ className: "mb-12"
254
+ }, /*#__PURE__*/React.createElement(PriceToggleButton, {
255
+ i18next: i18next,
256
+ isChecked: selectedBillingPeriod === 2,
257
+ onCheck: checked => {
258
+ setSelectedBillingPeriod(checked ? 2 : 1);
259
+ }
260
+ }))), /*#__PURE__*/React.createElement("div", {
261
+ className: "flex flex-wrap justify-center max-w-max mx-auto pt-12"
262
+ }, platformPricingModels.filter(price => Number(price.billing_period_id) === selectedBillingPeriod).map((model, idx) => /*#__PURE__*/React.createElement(PriceCard, _extends({
263
+ key: `price_card_${idx}`
264
+ }, model))))));
285
265
  };
286
266
  export default PlatformPaymentPlans;
287
267
  PlatformPaymentPlans.defaultProps = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pcm-shared-components",
3
- "version": "0.0.231",
3
+ "version": "0.0.232",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "babel": {