tg-core-components 5.4.5-bethard → 5.5.1-master
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/es/components/AcceptUpdatedTaC/index.js +8 -3
- package/es/components/Checkbox/index.js +93 -0
- package/es/components/Deposit/CardInput/index.js +1 -3
- package/es/components/Input/index.js +222 -22
- package/es/components/InputWrapper/index.js +69 -0
- package/es/components/Notification.js +4 -4
- package/es/components/Select/index.js +202 -64
- package/es/components/Select/test.js +111 -0
- package/es/index.js +2 -2
- package/es/lib/utils/translate.js +1 -8
- package/es/misc/countryEmojiFlags.js +0 -1
- package/es/widgets/AccountDetail/index.js +53 -77
- package/es/widgets/ActivateWidget/index.js +59 -293
- package/es/widgets/BonusWidget/BonusCode.js +24 -17
- package/es/widgets/BonusWidget/index.js +83 -45
- package/es/widgets/Cashier/Payment/index.js +2 -0
- package/es/widgets/CashierAccordion/Deposit/BonusCodeInput/index.js +9 -6
- package/es/widgets/CashierAccordion/Deposit/DepositWidget/index.js +22 -33
- package/es/widgets/CashierAccordion/Deposit/PaymentForm/index.js +2 -6
- package/es/widgets/CashierAccordion/Payment/PaymentAccountForms/astroPayBankTransaltions.js +12 -0
- package/es/widgets/CashierAccordion/Payment/PaymentAccountForms/index.js +163 -347
- package/es/widgets/CashierAccordion/Payment/PaymentAccountParser.js +0 -6
- package/es/widgets/CashierAccordion/Payment/PaymentMethodSelector/index.js +2 -2
- package/es/widgets/CashierAccordion/Payment/index.js +2 -0
- package/es/widgets/CashierAccordion/Withdraw/WithdrawWidget/index.js +9 -23
- package/es/widgets/ChangePassword/index.js +53 -40
- package/es/widgets/HistoryWidget/index.js +69 -51
- package/es/widgets/HistoryWidget/message.js +17 -20
- package/es/widgets/RequestResetPassword/index.js +15 -14
- package/es/widgets/ResetPassword/index.js +22 -18
- package/es/widgets/ResponsibleGamingAccordion/LimitStatus/index.js +5 -2
- package/es/widgets/ResponsibleGamingAccordion/PeriodItemContent/index.js +1 -2
- package/es/widgets/ResponsibleGamingSingleSignUp/AmountItem/index.js +1 -2
- package/es/widgets/ResponsibleGamingWidget/Timespan.js +14 -24
- package/es/widgets/ResponsibleGamingWidget/helpers.js +2 -2
- package/es/widgets/ResponsibleGamingWidget/validate.js +2 -6
- package/es/widgets/Settings/index.js +2 -2
- package/es/widgets/SignIn/SignInForm.js +4 -6
- package/es/widgets/SignIn/index.js +21 -21
- package/es/widgets/SignUp/ContactInfoStep.js +5 -6
- package/es/widgets/SportsbookSettings/index.js +10 -24
- package/es/widgets/Subscriptions/index.js +3 -5
- package/lib/components/AcceptUpdatedTaC/index.js +11 -3
- package/lib/components/Checkbox/index.js +106 -0
- package/lib/components/Deposit/CardInput/index.js +1 -3
- package/lib/components/Input/index.js +223 -26
- package/lib/components/InputWrapper/index.js +85 -0
- package/lib/components/Notification.js +3 -3
- package/lib/components/Select/index.js +209 -63
- package/lib/components/Select/test.js +121 -0
- package/lib/index.js +7 -7
- package/lib/lib/utils/translate.js +1 -8
- package/lib/misc/countryEmojiFlags.js +0 -1
- package/lib/widgets/AccountDetail/index.js +53 -86
- package/lib/widgets/ActivateWidget/index.js +58 -305
- package/lib/widgets/BonusWidget/BonusCode.js +24 -20
- package/lib/widgets/BonusWidget/index.js +85 -44
- package/lib/widgets/Cashier/Payment/index.js +2 -0
- package/lib/widgets/CashierAccordion/Deposit/BonusCodeInput/index.js +13 -7
- package/lib/widgets/CashierAccordion/Deposit/DepositWidget/index.js +25 -36
- package/lib/widgets/CashierAccordion/Deposit/PaymentForm/index.js +2 -9
- package/lib/widgets/CashierAccordion/Payment/PaymentAccountForms/astroPayBankTransaltions.js +12 -0
- package/lib/widgets/CashierAccordion/Payment/PaymentAccountForms/index.js +195 -378
- package/lib/widgets/CashierAccordion/Payment/PaymentAccountParser.js +0 -6
- package/lib/widgets/CashierAccordion/Payment/PaymentMethodSelector/index.js +2 -2
- package/lib/widgets/CashierAccordion/Payment/index.js +2 -0
- package/lib/widgets/CashierAccordion/Withdraw/WithdrawWidget/index.js +11 -25
- package/lib/widgets/ChangePassword/index.js +53 -43
- package/lib/widgets/HistoryWidget/index.js +69 -51
- package/lib/widgets/HistoryWidget/message.js +17 -20
- package/lib/widgets/RequestResetPassword/index.js +15 -17
- package/lib/widgets/ResetPassword/index.js +25 -21
- package/lib/widgets/ResponsibleGamingAccordion/LimitStatus/index.js +5 -2
- package/lib/widgets/ResponsibleGamingAccordion/PeriodItemContent/index.js +1 -2
- package/lib/widgets/ResponsibleGamingSingleSignUp/AmountItem/index.js +1 -2
- package/lib/widgets/ResponsibleGamingWidget/Timespan.js +14 -24
- package/lib/widgets/ResponsibleGamingWidget/helpers.js +2 -2
- package/lib/widgets/ResponsibleGamingWidget/validate.js +2 -6
- package/lib/widgets/Settings/index.js +6 -6
- package/lib/widgets/SignIn/SignInForm.js +7 -6
- package/lib/widgets/SignIn/index.js +25 -25
- package/lib/widgets/SignUp/ContactInfoStep.js +8 -6
- package/lib/widgets/SportsbookSettings/index.js +10 -24
- package/lib/widgets/Subscriptions/index.js +3 -11
- package/package.json +8 -3
- package/es/components/AutocompleteInput/index.js +0 -104
- package/es/components/Input/BirthdateInput.js +0 -174
- package/es/components/Input/Checkbox.js +0 -51
- package/es/components/Input/Input.js +0 -73
- package/es/components/Input/PasswordInput.js +0 -84
- package/es/components/Input/PhoneNumberInput.js +0 -113
- package/es/components/Input/input.test.js +0 -80
- package/es/components/Input/old-input.test.js +0 -100
- package/es/components/common.js +0 -339
- package/es/widgets/CashierAccordion/Deposit/PaymentForm/NewTab.js +0 -28
- package/lib/components/AutocompleteInput/index.js +0 -118
- package/lib/components/Input/BirthdateInput.js +0 -195
- package/lib/components/Input/Checkbox.js +0 -65
- package/lib/components/Input/Input.js +0 -87
- package/lib/components/Input/PasswordInput.js +0 -101
- package/lib/components/Input/PhoneNumberInput.js +0 -130
- package/lib/components/Input/input.test.js +0 -89
- package/lib/components/Input/old-input.test.js +0 -107
- package/lib/components/common.js +0 -359
- package/lib/widgets/CashierAccordion/Deposit/PaymentForm/NewTab.js +0 -44
|
@@ -9,6 +9,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
|
9
9
|
import React, { Component } from 'react';
|
|
10
10
|
import Translate from '../Translate';
|
|
11
11
|
import marked from 'marked';
|
|
12
|
+
import Button from '../../components/Button';
|
|
12
13
|
|
|
13
14
|
var AcceptUpdatedTaC = function (_Component) {
|
|
14
15
|
_inherits(AcceptUpdatedTaC, _Component);
|
|
@@ -25,7 +26,8 @@ var AcceptUpdatedTaC = function (_Component) {
|
|
|
25
26
|
var _props = this.props,
|
|
26
27
|
onAccept = _props.onAccept,
|
|
27
28
|
termsContent = _props.termsContent,
|
|
28
|
-
current = _props.current
|
|
29
|
+
current = _props.current,
|
|
30
|
+
isLoading = _props.isLoading;
|
|
29
31
|
|
|
30
32
|
|
|
31
33
|
return React.createElement(
|
|
@@ -51,8 +53,11 @@ var AcceptUpdatedTaC = function (_Component) {
|
|
|
51
53
|
dangerouslySetInnerHTML: { __html: marked(termsContent || '') }
|
|
52
54
|
}),
|
|
53
55
|
React.createElement(
|
|
54
|
-
|
|
55
|
-
{
|
|
56
|
+
Button,
|
|
57
|
+
{
|
|
58
|
+
className: 'button primary',
|
|
59
|
+
onClick: onAccept,
|
|
60
|
+
isLoading: isLoading },
|
|
56
61
|
React.createElement(Translate, { id: 'action.accept' })
|
|
57
62
|
)
|
|
58
63
|
);
|
|
@@ -0,0 +1,93 @@
|
|
|
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
|
+
|
|
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 from 'react';
|
|
10
|
+
import PropTypes from 'prop-types';
|
|
11
|
+
|
|
12
|
+
var Checkbox = function (_React$Component) {
|
|
13
|
+
_inherits(Checkbox, _React$Component);
|
|
14
|
+
|
|
15
|
+
function Checkbox() {
|
|
16
|
+
_classCallCheck(this, Checkbox);
|
|
17
|
+
|
|
18
|
+
return _possibleConstructorReturn(this, (Checkbox.__proto__ || Object.getPrototypeOf(Checkbox)).apply(this, arguments));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
_createClass(Checkbox, [{
|
|
22
|
+
key: 'render',
|
|
23
|
+
value: function render() {
|
|
24
|
+
var _props = this.props,
|
|
25
|
+
className = _props.className,
|
|
26
|
+
_onChange = _props.onChange,
|
|
27
|
+
title = _props.title,
|
|
28
|
+
name = _props.name,
|
|
29
|
+
error = _props.error,
|
|
30
|
+
checked = _props.checked;
|
|
31
|
+
|
|
32
|
+
if (!_onChange) {
|
|
33
|
+
throw new Error('You need to provide onChange function');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
var randomId = Math.floor(Math.random() * 100000);
|
|
37
|
+
var wrapperClassName = 'Checkbox';
|
|
38
|
+
|
|
39
|
+
if (className) {
|
|
40
|
+
wrapperClassName += ' ' + className;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return React.createElement(
|
|
44
|
+
'div',
|
|
45
|
+
{ className: wrapperClassName },
|
|
46
|
+
React.createElement(
|
|
47
|
+
'div',
|
|
48
|
+
{ className: 'flex' },
|
|
49
|
+
React.createElement('input', {
|
|
50
|
+
id: 'checkbox-' + randomId,
|
|
51
|
+
type: 'checkbox',
|
|
52
|
+
defaultValue: null,
|
|
53
|
+
defaultChecked: this.props.value === 'true' ? true : false,
|
|
54
|
+
onChange: function onChange(e) {
|
|
55
|
+
_onChange(e, name, e.target.checked ? true : '');
|
|
56
|
+
},
|
|
57
|
+
name: name ? name : '',
|
|
58
|
+
checked: checked
|
|
59
|
+
}),
|
|
60
|
+
!React.isValidElement(title) ? React.createElement('label', {
|
|
61
|
+
htmlFor: 'checkbox-' + randomId,
|
|
62
|
+
dangerouslySetInnerHTML: { __html: title }
|
|
63
|
+
}) : React.createElement(
|
|
64
|
+
'label',
|
|
65
|
+
{ htmlFor: 'checkbox-' + randomId },
|
|
66
|
+
title
|
|
67
|
+
)
|
|
68
|
+
),
|
|
69
|
+
error && React.createElement(
|
|
70
|
+
'p',
|
|
71
|
+
{ className: 'error-text' },
|
|
72
|
+
error
|
|
73
|
+
)
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
}]);
|
|
77
|
+
|
|
78
|
+
return Checkbox;
|
|
79
|
+
}(React.Component);
|
|
80
|
+
|
|
81
|
+
Checkbox.propTypes = {
|
|
82
|
+
/** Listens for value changes */
|
|
83
|
+
onChange: PropTypes.func.isRequired,
|
|
84
|
+
/** Title for the checkboxes */
|
|
85
|
+
title: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
|
|
86
|
+
/** Css class name */
|
|
87
|
+
className: PropTypes.string,
|
|
88
|
+
/** Name of the input element */
|
|
89
|
+
name: PropTypes.string,
|
|
90
|
+
/** Errors output */
|
|
91
|
+
error: PropTypes.array
|
|
92
|
+
};
|
|
93
|
+
export default Checkbox;
|
|
@@ -33,9 +33,7 @@ export var Input = function (_Component) {
|
|
|
33
33
|
return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Input.__proto__ || Object.getPrototypeOf(Input)).call.apply(_ref, [this].concat(args))), _this), _this.state = {
|
|
34
34
|
isFocusing: false
|
|
35
35
|
}, _this.formatInput = function (value) {
|
|
36
|
-
var
|
|
37
|
-
type = _this$props.type,
|
|
38
|
-
provider = _this$props.provider;
|
|
36
|
+
var type = _this.props.type;
|
|
39
37
|
|
|
40
38
|
|
|
41
39
|
if (!value) {
|
|
@@ -1,25 +1,225 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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; };
|
|
2
|
+
|
|
3
|
+
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; }; }();
|
|
4
|
+
|
|
5
|
+
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; }
|
|
6
|
+
|
|
7
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
8
|
+
|
|
9
|
+
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; }
|
|
10
|
+
|
|
11
|
+
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; }
|
|
12
|
+
|
|
13
|
+
import React, { PureComponent } from 'react';
|
|
14
|
+
import PropTypes from 'prop-types';
|
|
15
|
+
import ButtonLoader from '../ButtonLoader';
|
|
16
|
+
import cn from 'classnames';
|
|
17
|
+
import Icon from '../Icon';
|
|
18
|
+
|
|
19
|
+
var Input = function (_PureComponent) {
|
|
20
|
+
_inherits(Input, _PureComponent);
|
|
21
|
+
|
|
22
|
+
function Input(props) {
|
|
23
|
+
_classCallCheck(this, Input);
|
|
24
|
+
|
|
25
|
+
var _this = _possibleConstructorReturn(this, (Input.__proto__ || Object.getPrototypeOf(Input)).call(this, props));
|
|
26
|
+
|
|
27
|
+
_this._onTogglePassword = function () {
|
|
28
|
+
_this.setState({ showPassword: !_this.state.showPassword });
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
_this.getInputRef = function () {
|
|
32
|
+
return _this.input;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
_this._handleChange = function (e) {
|
|
36
|
+
var _this$props = _this.props,
|
|
37
|
+
onChange = _this$props.onChange,
|
|
38
|
+
name = _this$props.name;
|
|
39
|
+
|
|
40
|
+
var value = e.currentTarget.value;
|
|
41
|
+
|
|
42
|
+
_this.setState({
|
|
43
|
+
value: value
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
onChange && onChange(e, name, value);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
_this._handleFocus = function (e) {
|
|
50
|
+
var _this$props2 = _this.props,
|
|
51
|
+
onFocus = _this$props2.onFocus,
|
|
52
|
+
name = _this$props2.name;
|
|
53
|
+
var value = _this.state.value;
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
_this.setState({
|
|
57
|
+
isFocusing: true
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
onFocus && onFocus(e, name, value);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
_this._handleBlur = function () {
|
|
64
|
+
var onBlur = _this.props.onBlur;
|
|
65
|
+
var value = _this.state.value;
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
_this.setState({
|
|
69
|
+
isFocusing: false
|
|
70
|
+
});
|
|
71
|
+
onBlur && onBlur(value);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
_this._handleAutoFill = function (e) {
|
|
75
|
+
if (e.animationName === 'onAutoFill') {
|
|
76
|
+
_this.setState({
|
|
77
|
+
isAutoFill: true
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
_this.state = {
|
|
83
|
+
isFocusing: false,
|
|
84
|
+
showPassword: false,
|
|
85
|
+
value: props.value || '',
|
|
86
|
+
isAutoFill: false
|
|
87
|
+
};
|
|
88
|
+
return _this;
|
|
22
89
|
}
|
|
90
|
+
|
|
91
|
+
_createClass(Input, [{
|
|
92
|
+
key: 'componentWillReceiveProps',
|
|
93
|
+
value: function componentWillReceiveProps(nextProps) {
|
|
94
|
+
if (!this.props.isControlled && typeof nextProps.value === 'undefined') {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
if (this.state.value !== nextProps.value) {
|
|
99
|
+
this.setState({ value: nextProps.value });
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
}, {
|
|
103
|
+
key: 'render',
|
|
104
|
+
value: function render() {
|
|
105
|
+
var _props = this.props,
|
|
106
|
+
title = _props.title,
|
|
107
|
+
error = _props.error,
|
|
108
|
+
require = _props.require,
|
|
109
|
+
innerRef = _props.innerRef,
|
|
110
|
+
autoFocus = _props.autoFocus,
|
|
111
|
+
isLoading = _props.isLoading,
|
|
112
|
+
description = _props.description,
|
|
113
|
+
_props$type = _props.type,
|
|
114
|
+
type = _props$type === undefined ? 'text' : _props$type,
|
|
115
|
+
_props$className = _props.className,
|
|
116
|
+
className = _props$className === undefined ? '' : _props$className,
|
|
117
|
+
_props$showToggleIcon = _props.showToggleIcon,
|
|
118
|
+
showToggleIcon = _props$showToggleIcon === undefined ? false : _props$showToggleIcon,
|
|
119
|
+
rest = _objectWithoutProperties(_props, ['title', 'error', 'require', 'innerRef', 'autoFocus', 'isLoading', 'description', 'type', 'className', 'showToggleIcon']);
|
|
120
|
+
|
|
121
|
+
var _state = this.state,
|
|
122
|
+
value = _state.value,
|
|
123
|
+
isFocusing = _state.isFocusing,
|
|
124
|
+
showPassword = _state.showPassword,
|
|
125
|
+
isAutoFill = _state.isAutoFill;
|
|
126
|
+
|
|
127
|
+
var hasValue = !!value;
|
|
128
|
+
|
|
129
|
+
if (type === 'hidden') return React.createElement('input', _extends({}, rest, { type: type, value: value || '' }));
|
|
130
|
+
|
|
131
|
+
return React.createElement(
|
|
132
|
+
'div',
|
|
133
|
+
{
|
|
134
|
+
className: cn('tg_input', className, {
|
|
135
|
+
input_focus: isFocusing,
|
|
136
|
+
tg_input_value: hasValue,
|
|
137
|
+
error: error,
|
|
138
|
+
has_title: title,
|
|
139
|
+
input_autofill: isAutoFill
|
|
140
|
+
}) },
|
|
141
|
+
React.createElement(
|
|
142
|
+
'div',
|
|
143
|
+
{ className: 'input-wrapper' },
|
|
144
|
+
title && React.createElement(
|
|
145
|
+
'div',
|
|
146
|
+
{ className: 'input_title' },
|
|
147
|
+
title + ' ' + (require ? '*' : '')
|
|
148
|
+
),
|
|
149
|
+
React.createElement('input', _extends({}, rest, {
|
|
150
|
+
ref: innerRef,
|
|
151
|
+
type: showToggleIcon && showPassword ? 'text' : type,
|
|
152
|
+
value: value || '',
|
|
153
|
+
autoFocus: autoFocus,
|
|
154
|
+
onChange: this._handleChange,
|
|
155
|
+
onFocus: this._handleFocus,
|
|
156
|
+
onBlur: this._handleBlur,
|
|
157
|
+
onAnimationStart: this._handleAutoFill
|
|
158
|
+
})),
|
|
159
|
+
isLoading && React.createElement(ButtonLoader, null),
|
|
160
|
+
showToggleIcon && React.createElement(Icon, {
|
|
161
|
+
icon: this.state.showPassword ? 'eye-slash' : 'eye',
|
|
162
|
+
className: 'toggle-password',
|
|
163
|
+
onClick: this._onTogglePassword
|
|
164
|
+
})
|
|
165
|
+
),
|
|
166
|
+
React.createElement('div', { className: 'bottom-line' }),
|
|
167
|
+
error && React.createElement(
|
|
168
|
+
'div',
|
|
169
|
+
{ className: 'error-message' },
|
|
170
|
+
error
|
|
171
|
+
),
|
|
172
|
+
!error && description && React.createElement(
|
|
173
|
+
'div',
|
|
174
|
+
{ className: 'input_description' },
|
|
175
|
+
description
|
|
176
|
+
)
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
}]);
|
|
180
|
+
|
|
181
|
+
return Input;
|
|
182
|
+
}(PureComponent);
|
|
183
|
+
|
|
184
|
+
Input.propTypes = {
|
|
185
|
+
/** Type of value */
|
|
186
|
+
type: PropTypes.string,
|
|
187
|
+
/** Represents the label for each input field */
|
|
188
|
+
title: PropTypes.string,
|
|
189
|
+
/** The validation error message */
|
|
190
|
+
error: PropTypes.string,
|
|
191
|
+
/** Name associated with each input field */
|
|
192
|
+
name: PropTypes.string,
|
|
193
|
+
/** Minimal amount of characters required */
|
|
194
|
+
min: PropTypes.string,
|
|
195
|
+
/** Boolean props deciding whether to disable or enable input field */
|
|
196
|
+
disabled: PropTypes.bool,
|
|
197
|
+
/** Boolean props deciding whether a field is required to have a value or not */
|
|
198
|
+
require: PropTypes.bool,
|
|
199
|
+
/** Optional description text */
|
|
200
|
+
description: PropTypes.string,
|
|
201
|
+
/** Placeholder text used on the input */
|
|
202
|
+
placeholder: PropTypes.string,
|
|
203
|
+
/** Classnames that should be used on the input */
|
|
204
|
+
className: PropTypes.string,
|
|
205
|
+
/** Boolean to show toggle password icon or not */
|
|
206
|
+
showToggleIcon: PropTypes.bool
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
Input.defaultProps = {
|
|
210
|
+
type: 'text',
|
|
211
|
+
title: '',
|
|
212
|
+
error: '',
|
|
213
|
+
name: '',
|
|
214
|
+
min: '',
|
|
215
|
+
disabled: false,
|
|
216
|
+
require: false,
|
|
217
|
+
description: '',
|
|
218
|
+
placeholder: '',
|
|
219
|
+
className: '',
|
|
220
|
+
showToggleIcon: false
|
|
23
221
|
};
|
|
24
222
|
|
|
25
|
-
export default
|
|
223
|
+
export default React.forwardRef(function (props, ref) {
|
|
224
|
+
return React.createElement(Input, _extends({}, props, { innerRef: ref }));
|
|
225
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import cn from 'classnames';
|
|
4
|
+
|
|
5
|
+
var InputWrapper = function InputWrapper(_ref) {
|
|
6
|
+
var children = _ref.children,
|
|
7
|
+
className = _ref.className,
|
|
8
|
+
disabled = _ref.disabled,
|
|
9
|
+
require = _ref.require,
|
|
10
|
+
error = _ref.error,
|
|
11
|
+
title = _ref.title,
|
|
12
|
+
hasValue = _ref.hasValue,
|
|
13
|
+
isFocusing = _ref.isFocusing;
|
|
14
|
+
return React.createElement(
|
|
15
|
+
'div',
|
|
16
|
+
{
|
|
17
|
+
className: cn('tg_input ' + className, {
|
|
18
|
+
tg_input_value: hasValue,
|
|
19
|
+
input_focus: isFocusing,
|
|
20
|
+
error: error,
|
|
21
|
+
has_title: title
|
|
22
|
+
}) },
|
|
23
|
+
React.createElement(
|
|
24
|
+
'div',
|
|
25
|
+
{ className: 'input-wrapper' },
|
|
26
|
+
title && React.createElement(
|
|
27
|
+
'div',
|
|
28
|
+
{ className: cn('input_title', { 'opa-d5': disabled }) },
|
|
29
|
+
title + ' ' + (require ? '*' : '')
|
|
30
|
+
),
|
|
31
|
+
children,
|
|
32
|
+
React.createElement('div', { className: 'bottom-line' }),
|
|
33
|
+
React.createElement(
|
|
34
|
+
'div',
|
|
35
|
+
{ className: 'error-message' },
|
|
36
|
+
error
|
|
37
|
+
)
|
|
38
|
+
)
|
|
39
|
+
);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
InputWrapper.propTypes = {
|
|
43
|
+
/** Determine if select has value */
|
|
44
|
+
hasValue: PropTypes.bool,
|
|
45
|
+
/** Determine if select is focuesd */
|
|
46
|
+
isFocusing: PropTypes.bool,
|
|
47
|
+
/** Determine if select is disable */
|
|
48
|
+
disabled: PropTypes.bool,
|
|
49
|
+
/** Title to show above the select */
|
|
50
|
+
title: PropTypes.string,
|
|
51
|
+
/** Error message to display */
|
|
52
|
+
error: PropTypes.string,
|
|
53
|
+
/** Determine if the select is required */
|
|
54
|
+
require: PropTypes.bool,
|
|
55
|
+
/** Optional className passed in as props */
|
|
56
|
+
className: PropTypes.string
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
InputWrapper.defaultProps = {
|
|
60
|
+
hasValue: false,
|
|
61
|
+
isFocusing: false,
|
|
62
|
+
disabled: false,
|
|
63
|
+
title: '',
|
|
64
|
+
error: '',
|
|
65
|
+
require: false,
|
|
66
|
+
className: ''
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export default InputWrapper;
|
|
@@ -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
|
|
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
|
|
165
|
+
var enhance = compose(withSwipeListeners);
|
|
166
166
|
|
|
167
167
|
export default enhance(Notification);
|