tg-core-components 6.1.19-BT-47-tabindex-on-phonenumber.1 → 6.1.19-alpha.0

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.
@@ -9,7 +9,7 @@ import cn from 'classnames';
9
9
 
10
10
  var PhoneNumberInput = function PhoneNumberInput(props) {
11
11
  var val = props.value || '';
12
- var startTabIndex = props.startTabIndex || '';
12
+
13
13
  var callingCodeValue = ((props.callingCodes || []).slice().sort(function (a, b) {
14
14
  return b.value - a.value;
15
15
  }).find(function (c) {
@@ -60,9 +60,7 @@ var PhoneNumberInput = function PhoneNumberInput(props) {
60
60
  { className: cn(props.className, className) },
61
61
  callingCodeSelect.value.hasValue && React.createElement(
62
62
  Select,
63
- _extends({
64
- tabIndex: startTabIndex
65
- }, flatObj(callingCodeSelect), {
63
+ _extends({}, flatObj(callingCodeSelect), {
66
64
  name: props.name + '_calling-code',
67
65
  label: React.createElement(Translate, { id: 'label.calling-code', defaultMessage: 'Calling code' }),
68
66
  onChange: function onChange(e) {
@@ -76,8 +74,7 @@ var PhoneNumberInput = function PhoneNumberInput(props) {
76
74
  status: props.status,
77
75
  leadingLane: [props.selectIcon].filter(function (i) {
78
76
  return i;
79
- })
80
- }),
77
+ }) }),
81
78
  (props.callingCodes || []).map(function (c, i) {
82
79
  return React.createElement(
83
80
  Select.Option,
@@ -88,7 +85,6 @@ var PhoneNumberInput = function PhoneNumberInput(props) {
88
85
  ),
89
86
  React.createElement(Input, _extends({}, flatObj(phoneNumberInput), {
90
87
  autoFocus: props.autoFocus,
91
- tabIndex: startTabIndex + 1,
92
88
  type: 'tel',
93
89
  name: props.name + '_number',
94
90
  label: React.createElement(Translate, {
@@ -35,7 +35,7 @@ var Picture = function Picture(_ref) {
35
35
  });
36
36
  }),
37
37
  React.createElement('img', _extends({
38
- src: typeof src === 'string' && src,
38
+ src: typeof src === 'string' ? src : undefined,
39
39
  width: width,
40
40
  height: height,
41
41
  loading: loading
@@ -9,7 +9,7 @@ var translate = function translate(_ref, intl) {
9
9
  values = _ref.values,
10
10
  rest = _objectWithoutProperties(_ref, ['id', 'values']);
11
11
 
12
- var cacheId = id + (JSON.stringify(values) || '');
12
+ var cacheId = id + (typeof intl !== 'undefined' ? intl.locale : '') + (JSON.stringify(values) || '');
13
13
  if (cache[cacheId]) return cache[cacheId];
14
14
 
15
15
  var g = typeof window !== 'undefined' && window || typeof global !== 'undefined' && global || {};
@@ -26,7 +26,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
26
26
 
27
27
  var PhoneNumberInput = function PhoneNumberInput(props) {
28
28
  var val = props.value || '';
29
- var startTabIndex = props.startTabIndex || '';
29
+
30
30
  var callingCodeValue = ((props.callingCodes || []).slice().sort(function (a, b) {
31
31
  return b.value - a.value;
32
32
  }).find(function (c) {
@@ -77,9 +77,7 @@ var PhoneNumberInput = function PhoneNumberInput(props) {
77
77
  { className: (0, _classnames2.default)(props.className, className) },
78
78
  callingCodeSelect.value.hasValue && _react2.default.createElement(
79
79
  _common.Select,
80
- _extends({
81
- tabIndex: startTabIndex
82
- }, (0, _common.flatObj)(callingCodeSelect), {
80
+ _extends({}, (0, _common.flatObj)(callingCodeSelect), {
83
81
  name: props.name + '_calling-code',
84
82
  label: _react2.default.createElement(_Translate2.default, { id: 'label.calling-code', defaultMessage: 'Calling code' }),
85
83
  onChange: function onChange(e) {
@@ -93,8 +91,7 @@ var PhoneNumberInput = function PhoneNumberInput(props) {
93
91
  status: props.status,
94
92
  leadingLane: [props.selectIcon].filter(function (i) {
95
93
  return i;
96
- })
97
- }),
94
+ }) }),
98
95
  (props.callingCodes || []).map(function (c, i) {
99
96
  return _react2.default.createElement(
100
97
  _common.Select.Option,
@@ -105,7 +102,6 @@ var PhoneNumberInput = function PhoneNumberInput(props) {
105
102
  ),
106
103
  _react2.default.createElement(_common.Input, _extends({}, (0, _common.flatObj)(phoneNumberInput), {
107
104
  autoFocus: props.autoFocus,
108
- tabIndex: startTabIndex + 1,
109
105
  type: 'tel',
110
106
  name: props.name + '_number',
111
107
  label: _react2.default.createElement(_Translate2.default, {
@@ -52,7 +52,7 @@ var Picture = function Picture(_ref) {
52
52
  });
53
53
  }),
54
54
  _react2.default.createElement('img', _extends({
55
- src: typeof src === 'string' && src,
55
+ src: typeof src === 'string' ? src : undefined,
56
56
  width: width,
57
57
  height: height,
58
58
  loading: loading
@@ -15,7 +15,7 @@ var translate = function translate(_ref, intl) {
15
15
  values = _ref.values,
16
16
  rest = _objectWithoutProperties(_ref, ['id', 'values']);
17
17
 
18
- var cacheId = id + (JSON.stringify(values) || '');
18
+ var cacheId = id + (typeof intl !== 'undefined' ? intl.locale : '') + (JSON.stringify(values) || '');
19
19
  if (cache[cacheId]) return cache[cacheId];
20
20
 
21
21
  var g = typeof window !== 'undefined' && window || typeof global !== 'undefined' && global || {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tg-core-components",
3
- "version": "6.1.19-BT-47-tabindex-on-phonenumber.1",
3
+ "version": "6.1.19-alpha.0",
4
4
  "description": "tg-core-components",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -76,5 +76,5 @@
76
76
  "webpack": "^3.0.0",
77
77
  "webpack-blocks": "^1.0.0"
78
78
  },
79
- "gitHead": "655fb1956cc5f772c25bcb3a193836eb387d5122"
79
+ "gitHead": "6d83b9356e983d2c43f8440f6fceac7bbd545086"
80
80
  }