tg-core-components 5.2.1-history-time-label.0 → 5.3.0-master.1

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 (93) hide show
  1. package/es/components/AcceptUpdatedTaC/index.js +8 -3
  2. package/es/components/Checkbox/index.js +93 -0
  3. package/es/components/Deposit/CardInput/index.js +1 -3
  4. package/es/components/Input/index.js +222 -22
  5. package/es/components/InputWrapper/index.js +69 -0
  6. package/es/components/Notification.js +4 -4
  7. package/es/components/Select/index.js +202 -64
  8. package/es/components/Select/test.js +111 -0
  9. package/es/index.js +2 -1
  10. package/es/lib/utils/translate.js +1 -8
  11. package/es/widgets/AccountDetail/index.js +53 -77
  12. package/es/widgets/ActivateWidget/index.js +59 -293
  13. package/es/widgets/BonusWidget/BonusCode.js +24 -17
  14. package/es/widgets/BonusWidget/index.js +83 -45
  15. package/es/widgets/Cashier/Deposit/PaymentForm/NewTab.js +28 -0
  16. package/es/widgets/Cashier/Deposit/PaymentForm/index.js +6 -2
  17. package/es/widgets/CashierAccordion/Deposit/BonusCodeInput/index.js +9 -6
  18. package/es/widgets/CashierAccordion/Deposit/DepositWidget/index.js +19 -29
  19. package/es/widgets/CashierAccordion/Payment/PaymentAccountForms/index.js +163 -347
  20. package/es/widgets/CashierAccordion/Payment/PaymentAccountParser.js +0 -6
  21. package/es/widgets/CashierAccordion/Withdraw/WithdrawWidget/index.js +8 -22
  22. package/es/widgets/ChangePassword/index.js +53 -40
  23. package/es/widgets/HistoryWidget/index.js +69 -51
  24. package/es/widgets/HistoryWidget/message.js +17 -20
  25. package/es/widgets/RequestResetPassword/index.js +15 -14
  26. package/es/widgets/ResetPassword/index.js +22 -18
  27. package/es/widgets/ResponsibleGamingAccordion/LimitStatus/index.js +5 -2
  28. package/es/widgets/ResponsibleGamingAccordion/PeriodItemContent/index.js +1 -2
  29. package/es/widgets/ResponsibleGamingSingleSignUp/AmountItem/index.js +1 -2
  30. package/es/widgets/ResponsibleGamingWidget/Timespan.js +14 -24
  31. package/es/widgets/ResponsibleGamingWidget/helpers.js +2 -2
  32. package/es/widgets/ResponsibleGamingWidget/validate.js +1 -1
  33. package/es/widgets/Settings/index.js +2 -2
  34. package/es/widgets/SignIn/SignInForm.js +4 -6
  35. package/es/widgets/SignIn/index.js +21 -21
  36. package/es/widgets/SignUp/ContactInfoStep.js +5 -6
  37. package/es/widgets/SportsbookSettings/index.js +10 -24
  38. package/es/widgets/Subscriptions/index.js +3 -5
  39. package/lib/components/AcceptUpdatedTaC/index.js +11 -3
  40. package/lib/components/Checkbox/index.js +106 -0
  41. package/lib/components/Deposit/CardInput/index.js +1 -3
  42. package/lib/components/Input/index.js +223 -26
  43. package/lib/components/InputWrapper/index.js +85 -0
  44. package/lib/components/Notification.js +3 -3
  45. package/lib/components/Select/index.js +209 -63
  46. package/lib/components/Select/test.js +121 -0
  47. package/lib/index.js +9 -4
  48. package/lib/lib/utils/translate.js +1 -8
  49. package/lib/widgets/AccountDetail/index.js +53 -86
  50. package/lib/widgets/ActivateWidget/index.js +58 -305
  51. package/lib/widgets/BonusWidget/BonusCode.js +24 -20
  52. package/lib/widgets/BonusWidget/index.js +85 -44
  53. package/lib/widgets/Cashier/Deposit/PaymentForm/NewTab.js +44 -0
  54. package/lib/widgets/Cashier/Deposit/PaymentForm/index.js +9 -2
  55. package/lib/widgets/CashierAccordion/Deposit/BonusCodeInput/index.js +13 -7
  56. package/lib/widgets/CashierAccordion/Deposit/DepositWidget/index.js +22 -32
  57. package/lib/widgets/CashierAccordion/Payment/PaymentAccountForms/index.js +195 -378
  58. package/lib/widgets/CashierAccordion/Payment/PaymentAccountParser.js +0 -6
  59. package/lib/widgets/CashierAccordion/Withdraw/WithdrawWidget/index.js +10 -24
  60. package/lib/widgets/ChangePassword/index.js +53 -43
  61. package/lib/widgets/HistoryWidget/index.js +69 -51
  62. package/lib/widgets/HistoryWidget/message.js +17 -20
  63. package/lib/widgets/RequestResetPassword/index.js +15 -17
  64. package/lib/widgets/ResetPassword/index.js +25 -21
  65. package/lib/widgets/ResponsibleGamingAccordion/LimitStatus/index.js +5 -2
  66. package/lib/widgets/ResponsibleGamingAccordion/PeriodItemContent/index.js +1 -2
  67. package/lib/widgets/ResponsibleGamingSingleSignUp/AmountItem/index.js +1 -2
  68. package/lib/widgets/ResponsibleGamingWidget/Timespan.js +14 -24
  69. package/lib/widgets/ResponsibleGamingWidget/helpers.js +2 -2
  70. package/lib/widgets/ResponsibleGamingWidget/validate.js +1 -1
  71. package/lib/widgets/Settings/index.js +6 -6
  72. package/lib/widgets/SignIn/SignInForm.js +7 -6
  73. package/lib/widgets/SignIn/index.js +25 -25
  74. package/lib/widgets/SignUp/ContactInfoStep.js +8 -6
  75. package/lib/widgets/SportsbookSettings/index.js +10 -24
  76. package/lib/widgets/Subscriptions/index.js +3 -11
  77. package/package.json +8 -3
  78. package/es/components/Input/BirthdateInput.js +0 -171
  79. package/es/components/Input/Checkbox.js +0 -51
  80. package/es/components/Input/Input.js +0 -73
  81. package/es/components/Input/PasswordInput.js +0 -84
  82. package/es/components/Input/PhoneNumberInput.js +0 -110
  83. package/es/components/Input/input.test.js +0 -80
  84. package/es/components/Input/old-input.test.js +0 -100
  85. package/es/components/common.js +0 -339
  86. package/lib/components/Input/BirthdateInput.js +0 -192
  87. package/lib/components/Input/Checkbox.js +0 -65
  88. package/lib/components/Input/Input.js +0 -87
  89. package/lib/components/Input/PasswordInput.js +0 -101
  90. package/lib/components/Input/PhoneNumberInput.js +0 -127
  91. package/lib/components/Input/input.test.js +0 -89
  92. package/lib/components/Input/old-input.test.js +0 -107
  93. package/lib/components/common.js +0 -359
@@ -10,7 +10,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
10
10
 
11
11
  import React, { Component } from 'react';
12
12
  import { CSSTransition } from 'react-transition-group';
13
- import { FormattedDate, injectIntl } from 'react-intl';
13
+ import { FormattedDate } from 'react-intl';
14
14
  import withSwipeListeners from '../lib/withSwipeListeners';
15
15
  import classNames from 'classnames';
16
16
  import { compose } from 'recompose';
@@ -63,9 +63,9 @@ var Notification = function (_Component) {
63
63
  timeout = _props2$timeout === undefined ? 5 : _props2$timeout,
64
64
  action = _props2.action,
65
65
  defaultAction = _props2.defaultAction,
66
- btnText = _props2.btnText,
67
66
  icon = _props2.icon,
68
- direction = _props2.direction;
67
+ direction = _props2.direction,
68
+ btnText = _props2.btnText;
69
69
 
70
70
 
71
71
  return React.createElement(
@@ -162,6 +162,6 @@ var Notification = function (_Component) {
162
162
  return Notification;
163
163
  }(Component);
164
164
 
165
- var enhance = compose(withSwipeListeners, injectIntl);
165
+ var enhance = compose(withSwipeListeners);
166
166
 
167
167
  export default enhance(Notification);
@@ -1,69 +1,207 @@
1
- var _extends = Object.assign || 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; };
1
+ var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
2
2
 
3
- import React from 'react';
4
- import { Select, useId, useValue, useFocus, useTouched, useAutofill, createClassName, statusIcons, flatObj } from '../common';
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
+
5
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
6
+
7
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
8
+
9
+ import React, { PureComponent } from 'react';
10
+ import Icon from '../Icon';
11
+ import InputWrapper from '../InputWrapper';
12
+ import PropTypes from 'prop-types';
5
13
  import cn from 'classnames';
6
14
 
7
- var TGSelect = function TGSelect(props) {
8
- var select = {
9
- id: useId(),
10
- value: useValue(props.value),
11
- focus: useFocus(),
12
- touched: useTouched(),
13
- autofill: useAutofill()
14
- };
15
-
16
- var _onChange = function _onChange(e) {
17
- return props.onChange && props.onChange(e, e.target.value);
18
- };
19
-
20
- var _onBlur = function _onBlur(e) {
21
- return props.onBlur && props.onBlur(e, e.target.value);
22
- };
23
-
24
- var className = createClassName('tg-select', {
25
- hasValue: select.value.hasValue,
26
- hasLabel: Boolean(props.label),
27
- hasFocus: select.focus.hasFocus,
28
- hasAutofill: select.autofill.hasAutofill,
29
- disabled: props.disabled,
30
- status: props.status
31
- });
32
-
33
- return React.createElement(
34
- 'div',
35
- { className: cn(props.className, className) },
36
- React.createElement(
37
- Select,
38
- _extends({}, props, flatObj(select), {
39
- onChange: function onChange(e) {
40
- select.value.onChange(e.target.value);
41
- _onChange(e);
42
- },
43
- onFocus: function onFocus() {
44
- select.focus.onFocus();
45
- select.touched.onFocus();
46
- },
47
- onBlur: function onBlur(e) {
48
- select.focus.onBlur();
49
- _onBlur(e);
50
- },
51
- leadingLane: [props.icon].filter(function (i) {
52
- return i;
53
- }),
54
- trailingLane: [statusIcons[props.status]].filter(function (i) {
55
- return i;
56
- }) }),
57
- props.children
58
- ),
59
- React.createElement(
60
- 'div',
61
- { className: 'tg-select__status-text' },
62
- props.statusText
63
- )
64
- );
15
+ var Select = function (_PureComponent) {
16
+ _inherits(Select, _PureComponent);
17
+
18
+ function Select(props) {
19
+ _classCallCheck(this, Select);
20
+
21
+ var _this = _possibleConstructorReturn(this, (Select.__proto__ || Object.getPrototypeOf(Select)).call(this, props));
22
+
23
+ _this._generateOptions = function () {
24
+ var _this$props = _this.props,
25
+ options = _this$props.options,
26
+ require = _this$props.require,
27
+ placeholder = _this$props.placeholder;
28
+ var isFocusing = _this.state.isFocusing;
29
+
30
+
31
+ if (!options) return false;
32
+
33
+ var selectOptions = options.map(function (item, index) {
34
+ if (Array.isArray(item.value)) {
35
+ return React.createElement(
36
+ 'optgroup',
37
+ { label: item.label },
38
+ item.value.map(function (v, i) {
39
+ return React.createElement(
40
+ 'option',
41
+ { key: i, value: v.value },
42
+ v.label || v
43
+ );
44
+ })
45
+ );
46
+ }
47
+
48
+ return React.createElement(
49
+ 'option',
50
+ { key: index, value: item.value },
51
+ item.label || item
52
+ );
53
+ });
54
+
55
+ if (placeholder) selectOptions.unshift(React.createElement(
56
+ 'option',
57
+ { key: 'placeholder', disabled: isFocusing && require },
58
+ placeholder
59
+ ));
60
+
61
+ return selectOptions;
62
+ };
63
+
64
+ _this._handleChange = function (e) {
65
+ var _this$props2 = _this.props,
66
+ onChange = _this$props2.onChange,
67
+ name = _this$props2.name;
68
+
69
+ var value = e.currentTarget.value;
70
+
71
+ _this.setState({
72
+ value: value,
73
+ hasValue: !!value
74
+ });
75
+
76
+ onChange && onChange(e, name, value);
77
+ };
78
+
79
+ _this._handleFocus = function () {
80
+ _this.setState({
81
+ isFocusing: true
82
+ });
83
+ };
84
+
85
+ _this._handleBlur = function () {
86
+ var onBlur = _this.props.onBlur;
87
+ var value = _this.state.value;
88
+
89
+
90
+ _this.setState({
91
+ isFocusing: false
92
+ });
93
+
94
+ onBlur && onBlur(value);
95
+ };
96
+
97
+ _this.state = {
98
+ isFocusing: false,
99
+ value: '',
100
+ hasValue: false
101
+ };
102
+ return _this;
103
+ }
104
+
105
+ _createClass(Select, [{
106
+ key: 'componentDidMount',
107
+ value: function componentDidMount() {
108
+ var _props = this.props,
109
+ placeholder = _props.placeholder,
110
+ options = _props.options;
111
+
112
+
113
+ var value = this.props.value;
114
+
115
+ if (!value && !placeholder && options) {
116
+ value = options[0].value || options[0];
117
+ }
118
+
119
+ this.setState({ value: value, hasValue: !!value });
120
+ }
121
+ }, {
122
+ key: 'componentDidUpdate',
123
+ value: function componentDidUpdate(prevProps) {
124
+ if (this.props.value !== prevProps.value) {
125
+ this.setState({ value: this.props.value, hasValue: !!this.props.value });
126
+ }
127
+ }
128
+ }, {
129
+ key: 'render',
130
+ value: function render() {
131
+ var _props2 = this.props,
132
+ className = _props2.className,
133
+ title = _props2.title,
134
+ name = _props2.name,
135
+ error = _props2.error,
136
+ disabled = _props2.disabled,
137
+ require = _props2.require;
138
+ var _state = this.state,
139
+ hasValue = _state.hasValue,
140
+ value = _state.value,
141
+ isFocusing = _state.isFocusing;
142
+
143
+
144
+ return React.createElement(
145
+ InputWrapper,
146
+ {
147
+ title: title,
148
+ className: className,
149
+ hasValue: hasValue,
150
+ isFocusing: isFocusing,
151
+ error: error,
152
+ disabled: disabled,
153
+ require: require },
154
+ React.createElement(
155
+ 'select',
156
+ {
157
+ disabled: disabled,
158
+ name: name,
159
+ value: value,
160
+ onChange: this._handleChange,
161
+ onFocus: this._handleFocus,
162
+ onBlur: this._handleBlur },
163
+ this._generateOptions()
164
+ ),
165
+ React.createElement(
166
+ 'div',
167
+ { className: cn('select-icon', { 'opa-d5': disabled }) },
168
+ React.createElement(Icon, { icon: 'angle-down' })
169
+ )
170
+ );
171
+ }
172
+ }]);
173
+
174
+ return Select;
175
+ }(PureComponent);
176
+
177
+ Select.propTypes = {
178
+ /** Determine if select is disable */
179
+ disabled: PropTypes.bool,
180
+ /** Title to show above the select */
181
+ title: PropTypes.string,
182
+ /** Error message to display */
183
+ error: PropTypes.string,
184
+ /** Name of the element */
185
+ name: PropTypes.string,
186
+ /** Determine if the select is required */
187
+ require: PropTypes.bool,
188
+ /** Optional className passed in as props */
189
+ className: PropTypes.string,
190
+ /** Placeholder */
191
+ placeholder: PropTypes.string,
192
+ /** Manually pick the default selected option */
193
+ value: PropTypes.string
194
+ };
195
+
196
+ Select.defaultProps = {
197
+ disabled: false,
198
+ title: '',
199
+ error: '',
200
+ name: '',
201
+ require: false,
202
+ className: '',
203
+ value: '',
204
+ placeholder: ''
65
205
  };
66
- TGSelect.Option = Select.Option;
67
- TGSelect.OptGroup = Select.OptGroup;
68
206
 
69
- export default TGSelect;
207
+ export default Select;
@@ -0,0 +1,111 @@
1
+ function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
2
+
3
+ import React from 'react';
4
+ import { render, unmountComponentAtNode } from 'react-dom';
5
+ import { act } from 'react-dom/test-utils';
6
+
7
+ import Select from './index';
8
+
9
+ var container = null;
10
+ beforeEach(function () {
11
+ // setup a DOM element as a render target
12
+ container = document.createElement('div');
13
+ document.body.appendChild(container);
14
+ });
15
+
16
+ afterEach(function () {
17
+ // cleanup on exiting
18
+ unmountComponentAtNode(container);
19
+ container.remove();
20
+ container = null;
21
+ });
22
+
23
+ describe('renders with correct options', function () {
24
+ it('with only options', function () {
25
+ act(function () {
26
+ render(React.createElement(Select, { options: ['Male', 'Female'] }), container);
27
+ });
28
+ expect([].concat(_toConsumableArray(container.querySelectorAll('option'))).map(function (o) {
29
+ return o.textContent;
30
+ }).join(',')).toBe('Male,Female');
31
+ });
32
+
33
+ it('with preset value and placeholder', function () {
34
+ act(function () {
35
+ render(React.createElement(Select, {
36
+ options: ['Male', 'Female'],
37
+ value: 'Female',
38
+ placeholder: 'Gender'
39
+ }), container);
40
+ });
41
+ expect([].concat(_toConsumableArray(container.querySelectorAll('option'))).map(function (o) {
42
+ return o.textContent;
43
+ }).join(',')).toBe('Gender,Male,Female');
44
+ });
45
+ });
46
+
47
+ describe('renders with correct initial value', function () {
48
+ it('with only options', function () {
49
+ act(function () {
50
+ render(React.createElement(Select, { options: ['Male', 'Female'] }), container);
51
+ });
52
+ expect(container.querySelector('select').value).toBe('Male');
53
+ });
54
+
55
+ it('with preset value', function () {
56
+ act(function () {
57
+ render(React.createElement(Select, { options: ['Male', 'Female'], value: 'Female' }), container);
58
+ });
59
+ expect(container.querySelector('select').value).toBe('Female');
60
+ });
61
+ });
62
+
63
+ describe('renders with correct placeholder value', function () {
64
+ it('with placeholder', function () {
65
+ act(function () {
66
+ render(React.createElement(Select, { options: ['Male', 'Female'], placeholder: 'Gender' }), container);
67
+ });
68
+ expect(container.querySelector('select').value).toBe('Gender');
69
+ });
70
+
71
+ it('with preset value title and placeholder', function () {
72
+ act(function () {
73
+ render(React.createElement(Select, {
74
+ options: ['Male', 'Female'],
75
+ value: 'Female',
76
+ title: 'What is your gender',
77
+ placeholder: 'gender'
78
+ }), container);
79
+ });
80
+ expect(container.querySelector('select').value).toBe('Female');
81
+ });
82
+ });
83
+
84
+ describe('renders with correct placeholder value', function () {
85
+ it('with placeholder and require', function () {
86
+ act(function () {
87
+ render(React.createElement(Select, { options: ['Male', 'Female'], placeholder: 'Gender', require: true }), container);
88
+ });
89
+ expect(container.querySelector('select').value).toBe('Gender');
90
+ });
91
+
92
+ it('with preset value, title, placeholder and require', function () {
93
+ act(function () {
94
+ render(React.createElement(Select, {
95
+ options: ['Male', 'Female'],
96
+ value: 'Male',
97
+ title: 'What is your gender',
98
+ placeholder: 'gender',
99
+ require: true
100
+ }), container);
101
+ });
102
+ expect(container.querySelector('select').value).toBe('Male');
103
+ });
104
+
105
+ it('with placeholder and require', function () {
106
+ act(function () {
107
+ render(React.createElement(Select, { options: ['Male', 'Female'], placeholder: 'Gender', require: true }), container);
108
+ });
109
+ expect(container.querySelector('select').value).toBe('Gender');
110
+ });
111
+ });
package/es/index.js CHANGED
@@ -3,6 +3,7 @@ import AcceptUpdatedTaC from './components/AcceptUpdatedTaC';
3
3
  import Alert from './components/Alert';
4
4
  import Button from './components/Button';
5
5
  import ButtonLoader from './components/ButtonLoader';
6
+ import Checkbox from './components/Checkbox';
6
7
  import Checklist from './components/Checklist';
7
8
  import Icon from './components/Icon';
8
9
  import Image from './components/Image';
@@ -54,4 +55,4 @@ import VerifyAccordionWidget from './widgets/VerifyAccordionWidget';
54
55
  // misc
55
56
  import countryEmojiFlags from './misc/countryEmojiFlags';
56
57
 
57
- export { AcceptUpdatedTaC, Alert, Button, ButtonLoader, Checklist, Icon, Image, Input, InternalMessagesInbox, Loader, Money, Notification, Radio, Select, Single, Textarea, Uploader, AccordionWidget, AccountDetail, ActivateWidget, Balance, Bonus, Deposit, Withdraw, SignUp, ChangeUsername, ChangePassword, ResetPassword, RequestResetPassword, SignIn, Pagination, Settings, TableWidget, Verify, Subscriptions, CasinoHistoryTable, PaymentHistoryTable, SportsbookHistoryTable, DepositWidgetAccordion, WithdrawWidgetAccordion, ResponsibleGamingAccordion, ResponsibleGamingAccordionSignUp, ResponsibleGamingSingleSignUp, ResponsibleGamingWidget, List, VerifyAccordionWidget, Translate, Picture, countryEmojiFlags, Skeleton };
58
+ export { AcceptUpdatedTaC, Alert, Button, ButtonLoader, Checkbox, Checklist, Icon, Image, Input, InternalMessagesInbox, Loader, Money, Notification, Radio, Select, Single, Textarea, Uploader, AccordionWidget, AccountDetail, ActivateWidget, Balance, Bonus, Deposit, Withdraw, SignUp, ChangeUsername, ChangePassword, ResetPassword, RequestResetPassword, SignIn, Pagination, Settings, TableWidget, Verify, Subscriptions, CasinoHistoryTable, PaymentHistoryTable, SportsbookHistoryTable, DepositWidgetAccordion, WithdrawWidgetAccordion, ResponsibleGamingAccordion, ResponsibleGamingAccordionSignUp, ResponsibleGamingSingleSignUp, ResponsibleGamingWidget, List, VerifyAccordionWidget, Translate, Picture, Skeleton, countryEmojiFlags };
@@ -2,25 +2,18 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < argument
2
2
 
3
3
  function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
4
4
 
5
- var cache = {};
6
-
7
5
  var translate = function translate(_ref, intl) {
8
6
  var id = _ref.id,
9
7
  values = _ref.values,
10
8
  rest = _objectWithoutProperties(_ref, ['id', 'values']);
11
9
 
12
- var cacheId = id + (JSON.stringify(values) || '');
13
- if (cache[cacheId]) return cache[cacheId];
14
-
15
10
  var g = typeof window !== 'undefined' && window || typeof global !== 'undefined' && global || {};
16
11
 
17
12
  if (!intl) console.error('Missing intl object for "' + id + '"');
18
13
 
19
14
  if (g.showTranslations || !intl || !intl.formatMessage) return id;
20
15
 
21
- var message = intl.formatMessage(_extends({ id: id }, rest), values);
22
- cache[cacheId] = message;
23
- return message;
16
+ return intl.formatMessage(_extends({ id: id }, rest), values);
24
17
  };
25
18
 
26
19
  export default translate;