@synerise/ds-input 0.18.0 → 0.18.4
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/CHANGELOG.md +32 -0
- package/dist/Input.js +10 -26
- package/dist/Input.styles.js +8 -10
- package/dist/InputGroup.js +1 -3
- package/dist/InputMultivalue/Elements/Value.js +2 -15
- package/dist/InputMultivalue/InputMultivalue.js +11 -36
- package/dist/InputMultivalue/InputMultivalue.styles.js +3 -3
- package/dist/Textarea/Textarea.js +5 -20
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,38 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.18.4](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@0.18.3...@synerise/ds-input@0.18.4) (2022-01-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-input
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.18.3](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@0.18.2...@synerise/ds-input@0.18.3) (2021-12-22)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @synerise/ds-input
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [0.18.2](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@0.18.1...@synerise/ds-input@0.18.2) (2021-11-22)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @synerise/ds-input
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [0.18.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@0.17.46...@synerise/ds-input@0.18.1) (2021-11-09)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @synerise/ds-input
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
6
38
|
# [0.18.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@0.17.46...@synerise/ds-input@0.18.0) (2021-11-09)
|
|
7
39
|
|
|
8
40
|
**Note:** Version bump only for package @synerise/ds-input
|
package/dist/Input.js
CHANGED
|
@@ -2,26 +2,12 @@ var _excluded = ["className", "errorText", "label", "description", "counterLimit
|
|
|
2
2
|
|
|
3
3
|
function _extends() { _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; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly)
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
6
6
|
|
|
7
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
8
8
|
|
|
9
9
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
10
|
|
|
11
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
-
|
|
13
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
|
-
|
|
15
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
|
-
|
|
17
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
18
|
-
|
|
19
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
20
|
-
|
|
21
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
|
-
|
|
23
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
24
|
-
|
|
25
11
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
26
12
|
|
|
27
13
|
import * as React from 'react';
|
|
@@ -53,12 +39,11 @@ var enhancedInput = function enhancedInput(WrappedComponent, _ref) {
|
|
|
53
39
|
prefixel = _ref2.prefixel,
|
|
54
40
|
suffixel = _ref2.suffixel,
|
|
55
41
|
error = _ref2.error,
|
|
56
|
-
antdInputProps =
|
|
42
|
+
antdInputProps = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
57
43
|
|
|
58
44
|
var _React$useState = React.useState(0),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
setCharCount = _React$useState2[1];
|
|
45
|
+
charCount = _React$useState[0],
|
|
46
|
+
setCharCount = _React$useState[1];
|
|
62
47
|
|
|
63
48
|
var hasErrorMessage = Boolean(errorText);
|
|
64
49
|
var id = React.useMemo(function () {
|
|
@@ -66,10 +51,9 @@ var enhancedInput = function enhancedInput(WrappedComponent, _ref) {
|
|
|
66
51
|
}, []);
|
|
67
52
|
var inputRef = React.useRef();
|
|
68
53
|
|
|
69
|
-
var _React$
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
setInputAddonHeight = _React$useState4[1];
|
|
54
|
+
var _React$useState2 = React.useState(0),
|
|
55
|
+
inputAddonHeight = _React$useState2[0],
|
|
56
|
+
setInputAddonHeight = _React$useState2[1];
|
|
73
57
|
|
|
74
58
|
React.useEffect(function () {
|
|
75
59
|
handleInputRef && handleInputRef(inputRef);
|
|
@@ -91,7 +75,7 @@ var enhancedInput = function enhancedInput(WrappedComponent, _ref) {
|
|
|
91
75
|
|
|
92
76
|
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
|
93
77
|
// @ts-ignore
|
|
94
|
-
inputRef.current && setInputAddonHeight(inputRef
|
|
78
|
+
inputRef.current && setInputAddonHeight(inputRef == null ? void 0 : (_inputRef$current = inputRef.current) == null ? void 0 : (_inputRef$current$inp = _inputRef$current.input) == null ? void 0 : _inputRef$current$inp.offsetHeight);
|
|
95
79
|
}, [inputRef]);
|
|
96
80
|
return /*#__PURE__*/React.createElement(S.OuterWrapper, {
|
|
97
81
|
className: className,
|
|
@@ -115,7 +99,7 @@ var enhancedInput = function enhancedInput(WrappedComponent, _ref) {
|
|
|
115
99
|
title: icon1Tooltip
|
|
116
100
|
}, /*#__PURE__*/React.createElement(S.IconWrapper, {
|
|
117
101
|
className: className
|
|
118
|
-
}, icon1 &&
|
|
102
|
+
}, icon1 && React.cloneElement(icon1, _objectSpread({
|
|
119
103
|
className: 'icon icon1'
|
|
120
104
|
}, icon2 && {
|
|
121
105
|
style: {
|
|
@@ -125,7 +109,7 @@ var enhancedInput = function enhancedInput(WrappedComponent, _ref) {
|
|
|
125
109
|
title: icon2Tooltip
|
|
126
110
|
}, /*#__PURE__*/React.createElement(S.IconWrapper, {
|
|
127
111
|
className: className
|
|
128
|
-
}, icon2 &&
|
|
112
|
+
}, icon2 && React.cloneElement(icon2, {
|
|
129
113
|
className: 'icon icon2'
|
|
130
114
|
}))))), /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, antdInputProps, {
|
|
131
115
|
className: hasErrorMessage || error ? 'error' : undefined,
|
package/dist/Input.styles.js
CHANGED
|
@@ -4,8 +4,6 @@ var _excluded = ["error"],
|
|
|
4
4
|
|
|
5
5
|
function _extends() { _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; }; return _extends.apply(this, arguments); }
|
|
6
6
|
|
|
7
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
8
|
-
|
|
9
7
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
8
|
|
|
11
9
|
import styled, { css } from 'styled-components';
|
|
@@ -14,7 +12,7 @@ import * as React from 'react';
|
|
|
14
12
|
import MaskedInput from 'antd-mask-input';
|
|
15
13
|
|
|
16
14
|
var errorInputStyle = function errorInputStyle(props) {
|
|
17
|
-
return "\n &&&, && .ant-input {\n border-color: "
|
|
15
|
+
return "\n &&&, && .ant-input {\n border-color: " + props.theme.palette['red-600'] + ";\n box-shadow: inset 0 0 0 1px " + props.theme.palette['red-600'] + ";\n background: " + props.theme.palette['red-050'] + ";\n }\n";
|
|
18
16
|
};
|
|
19
17
|
|
|
20
18
|
export var OuterWrapper = styled.div.withConfig({
|
|
@@ -65,10 +63,10 @@ export var IconWrapper = styled.div.withConfig({
|
|
|
65
63
|
})([".icon:hover{svg{fill:", ";cursor:pointer;}}"], function (props) {
|
|
66
64
|
return props.theme.palette['blue-600'];
|
|
67
65
|
});
|
|
68
|
-
export var AntdInput = styled(
|
|
66
|
+
export var AntdInput = styled(React.forwardRef( // eslint-disable-next-line
|
|
69
67
|
function (_ref, ref) {
|
|
70
68
|
var error = _ref.error,
|
|
71
|
-
props =
|
|
69
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
72
70
|
|
|
73
71
|
return (
|
|
74
72
|
/*#__PURE__*/
|
|
@@ -91,11 +89,11 @@ function (_ref, ref) {
|
|
|
91
89
|
}, function (props) {
|
|
92
90
|
return props.size === 'large' ? "2.49" : "1.29";
|
|
93
91
|
});
|
|
94
|
-
export var AntdMaskedInput = styled(
|
|
92
|
+
export var AntdMaskedInput = styled(React.forwardRef( // eslint-disable-next-line
|
|
95
93
|
function (_ref2, ref) {
|
|
96
94
|
var error = _ref2.error,
|
|
97
95
|
mask = _ref2.mask,
|
|
98
|
-
props =
|
|
96
|
+
props = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
99
97
|
|
|
100
98
|
return (
|
|
101
99
|
/*#__PURE__*/
|
|
@@ -117,10 +115,10 @@ function (_ref2, ref) {
|
|
|
117
115
|
}, function (props) {
|
|
118
116
|
return props.theme.palette['grey-700'];
|
|
119
117
|
});
|
|
120
|
-
export var AntdTextArea = styled(
|
|
118
|
+
export var AntdTextArea = styled(React.forwardRef( // eslint-disable-next-line
|
|
121
119
|
function (_ref3, ref) {
|
|
122
120
|
var error = _ref3.error,
|
|
123
|
-
props =
|
|
121
|
+
props = _objectWithoutPropertiesLoose(_ref3, _excluded3);
|
|
124
122
|
|
|
125
123
|
return (
|
|
126
124
|
/*#__PURE__*/
|
|
@@ -175,5 +173,5 @@ export var AddonWrapper = styled.div.withConfig({
|
|
|
175
173
|
})(["background:", ";display:flex;align-items:center;height:", ";"], function (props) {
|
|
176
174
|
return props.theme.palette['grey-050'];
|
|
177
175
|
}, function (props) {
|
|
178
|
-
return
|
|
176
|
+
return props.height + "px" || '30px';
|
|
179
177
|
});
|
package/dist/InputGroup.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
var _excluded = ["children", "label", "errors", "description", "resetMargin", "tooltip"];
|
|
2
2
|
|
|
3
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
-
|
|
5
3
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
6
4
|
|
|
7
5
|
import * as React from 'react';
|
|
@@ -16,7 +14,7 @@ var InputGroup = function InputGroup(_ref) {
|
|
|
16
14
|
description = _ref.description,
|
|
17
15
|
resetMargin = _ref.resetMargin,
|
|
18
16
|
tooltip = _ref.tooltip,
|
|
19
|
-
antdInputGroupProps =
|
|
17
|
+
antdInputGroupProps = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
20
18
|
|
|
21
19
|
return /*#__PURE__*/React.createElement(InputStyles.OuterWrapper, {
|
|
22
20
|
resetMargin: resetMargin
|
|
@@ -1,15 +1,3 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
|
|
3
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
4
|
-
|
|
5
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
6
|
-
|
|
7
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
8
|
-
|
|
9
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
10
|
-
|
|
11
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
12
|
-
|
|
13
1
|
import * as React from 'react';
|
|
14
2
|
import Icon, { CloseS } from '@synerise/ds-icon';
|
|
15
3
|
import Tooltip from '@synerise/ds-tooltip';
|
|
@@ -23,9 +11,8 @@ var Value = function Value(_ref) {
|
|
|
23
11
|
focused = _ref.focused;
|
|
24
12
|
|
|
25
13
|
var _React$useState = React.useState(false),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
setHovered = _React$useState2[1];
|
|
14
|
+
hovered = _React$useState[0],
|
|
15
|
+
setHovered = _React$useState[1];
|
|
29
16
|
|
|
30
17
|
return (
|
|
31
18
|
/*#__PURE__*/
|
|
@@ -2,28 +2,6 @@ var _excluded = ["className", "errorText", "label", "description", "values", "on
|
|
|
2
2
|
|
|
3
3
|
function _extends() { _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; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6
|
-
|
|
7
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
8
|
-
|
|
9
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
-
|
|
11
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
-
|
|
13
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
14
|
-
|
|
15
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
|
-
|
|
17
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
18
|
-
|
|
19
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
20
|
-
|
|
21
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
22
|
-
|
|
23
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
24
|
-
|
|
25
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
26
|
-
|
|
27
5
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
28
6
|
|
|
29
7
|
import * as React from 'react';
|
|
@@ -42,30 +20,27 @@ var InputMultivalue = function InputMultivalue(props) {
|
|
|
42
20
|
disabled = props.disabled,
|
|
43
21
|
maxLength = props.maxLength,
|
|
44
22
|
error = props.error,
|
|
45
|
-
antdProps =
|
|
23
|
+
antdProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
46
24
|
|
|
47
25
|
var showError = error || !!errorText;
|
|
48
26
|
|
|
49
27
|
var _React$useState = React.useState(emptyValue),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
setValue = _React$useState2[1];
|
|
28
|
+
value = _React$useState[0],
|
|
29
|
+
setValue = _React$useState[1];
|
|
53
30
|
|
|
54
|
-
var _React$
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
setFocused = _React$useState4[1];
|
|
31
|
+
var _React$useState2 = React.useState(false),
|
|
32
|
+
isFocused = _React$useState2[0],
|
|
33
|
+
setFocused = _React$useState2[1];
|
|
58
34
|
|
|
59
35
|
var inputRef = React.useRef(null);
|
|
60
36
|
|
|
61
|
-
var _React$
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
setSelectedValues = _React$useState6[1];
|
|
37
|
+
var _React$useState3 = React.useState(values),
|
|
38
|
+
selectedValues = _React$useState3[0],
|
|
39
|
+
setSelectedValues = _React$useState3[1];
|
|
65
40
|
|
|
66
41
|
var handleKeyDown = function handleKeyDown(e) {
|
|
67
42
|
if (e.key === 'Enter') {
|
|
68
|
-
setSelectedValues([].concat(
|
|
43
|
+
setSelectedValues([].concat(selectedValues, [value]));
|
|
69
44
|
setValue(emptyValue);
|
|
70
45
|
}
|
|
71
46
|
};
|
|
@@ -88,7 +63,7 @@ var InputMultivalue = function InputMultivalue(props) {
|
|
|
88
63
|
return /*#__PURE__*/React.createElement(Value, {
|
|
89
64
|
disabled: disabled // eslint-disable-next-line react/no-array-index-key
|
|
90
65
|
,
|
|
91
|
-
key:
|
|
66
|
+
key: val + "-" + index,
|
|
92
67
|
onRemoveClick: function onRemoveClick() {
|
|
93
68
|
var filteredValues = selectedValues.filter(function (v) {
|
|
94
69
|
return v !== val;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
|
|
3
3
|
var errorInputStyle = function errorInputStyle(props) {
|
|
4
|
-
return "\n &&, .ant-input {\n border-color: "
|
|
4
|
+
return "\n &&, .ant-input {\n border-color: " + props.theme.palette['red-600'] + ";\n box-shadow: inset 0 0 0 2px " + props.theme.palette['red-600'] + ";\n background: " + props.theme.palette['red-050'] + ";\n border-radius: 4px;\n }\n";
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
var focusStyle = function focusStyle(props) {
|
|
8
|
-
return "\n && {\n box-shadow: inset 0 0 0 2px "
|
|
8
|
+
return "\n && {\n box-shadow: inset 0 0 0 2px " + props.theme.palette['blue-600'] + ";\n border-color: " + props.theme.palette['blue-600'] + ";\n background: " + props.theme.palette['blue-050'] + ";\n }\n";
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
var contentShrinkStyle = function contentShrinkStyle() {
|
|
@@ -78,7 +78,7 @@ export var ValueWrapper = styled.div.withConfig({
|
|
|
78
78
|
})(["display:grid;height:24px;&{background-color:", ";}border-radius:3px;border:none;margin:2px;white-space:nowrap;position:relative;padding:0 8px;right:8px;overflow:hidden;grid-template-columns:calc(100%) 0px;", " transition:background-color 0.1s ease-in-out,color 0.1s ease-in-out;&:hover{background-color:", ";color:", ";cursor:pointer;", "}", ""], function (props) {
|
|
79
79
|
return props.disabled ? props.theme.palette['grey-200'] : props.theme.palette['grey-100'];
|
|
80
80
|
}, function (props) {
|
|
81
|
-
return !!props.shrink && "\n "
|
|
81
|
+
return !!props.shrink && "\n " + ValueText + " {\n max-width: calc(100% - 16px);\n overflow: hidden;\nwhite-space: nowrap;\ntext-overflow: ellipsis;\n }\n " + IconWrapper + " {\n display:block;\n }\n";
|
|
82
82
|
}, function (props) {
|
|
83
83
|
return props.theme.palette['grey-200'];
|
|
84
84
|
}, function (props) {
|
|
@@ -2,26 +2,12 @@ var _excluded = ["disabled", "error", "rows", "wrapperStyle", "onBlur", "onFocus
|
|
|
2
2
|
|
|
3
3
|
function _extends() { _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; }; return _extends.apply(this, arguments); }
|
|
4
4
|
|
|
5
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly)
|
|
5
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
6
6
|
|
|
7
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
8
8
|
|
|
9
9
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
10
|
|
|
11
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
-
|
|
13
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
14
|
-
|
|
15
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
16
|
-
|
|
17
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
18
|
-
|
|
19
|
-
function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
20
|
-
|
|
21
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
|
-
|
|
23
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
24
|
-
|
|
25
11
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
26
12
|
|
|
27
13
|
import * as React from 'react';
|
|
@@ -39,12 +25,11 @@ var Textarea = function Textarea(_ref) {
|
|
|
39
25
|
_onFocus = _ref.onFocus,
|
|
40
26
|
resize = _ref.resize,
|
|
41
27
|
autoSize = _ref.autoSize,
|
|
42
|
-
props =
|
|
28
|
+
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
43
29
|
|
|
44
30
|
var _React$useState = React.useState(false),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
setFocus = _React$useState2[1];
|
|
31
|
+
focus = _React$useState[0],
|
|
32
|
+
setFocus = _React$useState[1];
|
|
48
33
|
|
|
49
34
|
return /*#__PURE__*/React.createElement(S.TextareaWrapper, {
|
|
50
35
|
className: "ds-textarea",
|
|
@@ -53,7 +38,7 @@ var Textarea = function Textarea(_ref) {
|
|
|
53
38
|
hasError: Boolean(error),
|
|
54
39
|
resize: resize,
|
|
55
40
|
style: _objectSpread({
|
|
56
|
-
height: autoSize ? 'auto' :
|
|
41
|
+
height: autoSize ? 'auto' : rows * 17 + "px"
|
|
57
42
|
}, wrapperStyle)
|
|
58
43
|
}, /*#__PURE__*/React.createElement(Scrollbar, {
|
|
59
44
|
absolute: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-input",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.4",
|
|
4
4
|
"description": "Input UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
],
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@synerise/ds-icon": "^0.
|
|
36
|
-
"@synerise/ds-scrollbar": "^0.4.
|
|
37
|
-
"@synerise/ds-tooltip": "^0.11.
|
|
38
|
-
"@synerise/ds-typography": "^0.12.
|
|
35
|
+
"@synerise/ds-icon": "^0.47.0",
|
|
36
|
+
"@synerise/ds-scrollbar": "^0.4.3",
|
|
37
|
+
"@synerise/ds-tooltip": "^0.11.4",
|
|
38
|
+
"@synerise/ds-typography": "^0.12.2",
|
|
39
39
|
"@synerise/ds-utils": "^0.19.0",
|
|
40
40
|
"antd-mask-input": "^0.1.13",
|
|
41
41
|
"uuid": "^7.0.2"
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"antd": "^4",
|
|
46
46
|
"react": ">=16.9.0 < 17.0.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "56c08eca6e2a1e41b8a39e28a9ec657ac1bdec83"
|
|
49
49
|
}
|