@synerise/ds-input 0.18.16 → 0.18.19
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 +27 -0
- package/README.md +1 -0
- package/dist/Input.js +8 -2
- package/dist/Input.styles.d.ts +1 -0
- package/dist/Input.styles.js +5 -1
- package/dist/Input.types.d.ts +1 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,33 @@
|
|
|
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.19](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@0.18.18...@synerise/ds-input@0.18.19) (2022-08-31)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-input
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.18.18](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@0.18.17...@synerise/ds-input@0.18.18) (2022-08-29)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **input:** add new prop autoResize and styles to change width ([ea2a53f](https://github.com/synerise/synerise-design/commit/ea2a53f2f30cd00cb6df159d04b75344e1c7544d))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## [0.18.17](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@0.18.16...@synerise/ds-input@0.18.17) (2022-08-25)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @synerise/ds-input
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
6
33
|
## [0.18.16](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@0.18.11...@synerise/ds-input@0.18.16) (2022-08-11)
|
|
7
34
|
|
|
8
35
|
**Note:** Version bump only for package @synerise/ds-input
|
package/README.md
CHANGED
|
@@ -46,6 +46,7 @@ Input UI Component
|
|
|
46
46
|
| tooltipConfig | Config of tooltip | [TooltipProps](https://design.synerise.com/docs/components/tooltip#api) | - |
|
|
47
47
|
| type | The type of input, see: [MDN](https://developer.mozilla.org/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types)(use `Input.TextArea` instead of `type="textarea"`) | string | `text` |
|
|
48
48
|
| value | The input content value | string | |
|
|
49
|
+
| autoResize | 'resize' width of the input based on width of the text in input | boolean | `false` |
|
|
49
50
|
|
|
50
51
|
#### MaskedInput
|
|
51
52
|
|
package/dist/Input.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["className", "errorText", "label", "description", "counterLimit", "tooltip", "tooltipConfig", "icon1", "icon1Tooltip", "icon2", "icon2Tooltip", "resetMargin", "handleInputRef", "prefixel", "suffixel", "error"];
|
|
1
|
+
var _excluded = ["className", "errorText", "label", "description", "counterLimit", "tooltip", "tooltipConfig", "icon1", "icon1Tooltip", "autoResize", "icon2", "icon2Tooltip", "resetMargin", "handleInputRef", "prefixel", "suffixel", "error"];
|
|
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
|
|
|
@@ -32,6 +32,7 @@ var enhancedInput = function enhancedInput(WrappedComponent, _ref) {
|
|
|
32
32
|
tooltipConfig = _ref2.tooltipConfig,
|
|
33
33
|
icon1 = _ref2.icon1,
|
|
34
34
|
icon1Tooltip = _ref2.icon1Tooltip,
|
|
35
|
+
autoResize = _ref2.autoResize,
|
|
35
36
|
icon2 = _ref2.icon2,
|
|
36
37
|
icon2Tooltip = _ref2.icon2Tooltip,
|
|
37
38
|
resetMargin = _ref2.resetMargin,
|
|
@@ -78,6 +79,7 @@ var enhancedInput = function enhancedInput(WrappedComponent, _ref) {
|
|
|
78
79
|
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);
|
|
79
80
|
}, [inputRef]);
|
|
80
81
|
return /*#__PURE__*/React.createElement(S.OuterWrapper, {
|
|
82
|
+
autoResize: autoResize,
|
|
81
83
|
className: className,
|
|
82
84
|
resetMargin: resetMargin
|
|
83
85
|
}, (label || counterLimit) && /*#__PURE__*/React.createElement(S.ContentAbove, null, /*#__PURE__*/React.createElement(Label, {
|
|
@@ -111,7 +113,11 @@ var enhancedInput = function enhancedInput(WrappedComponent, _ref) {
|
|
|
111
113
|
className: className
|
|
112
114
|
}, icon2 && React.cloneElement(icon2, {
|
|
113
115
|
className: 'icon icon2'
|
|
114
|
-
}))))), /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, antdInputProps, {
|
|
116
|
+
}))))), /*#__PURE__*/React.createElement(WrappedComponent, _extends({}, antdInputProps, autoResize ? {
|
|
117
|
+
style: {
|
|
118
|
+
width: (antdInputProps.value && antdInputProps.value.toString().length + 1) + "3px"
|
|
119
|
+
}
|
|
120
|
+
} : {}, {
|
|
115
121
|
className: hasErrorMessage || error ? 'error' : undefined,
|
|
116
122
|
addonBefore: !!prefixel && /*#__PURE__*/React.createElement(S.AddonWrapper, {
|
|
117
123
|
className: "ds-input-prefix",
|
package/dist/Input.styles.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import MaskedInput from 'antd-mask-input';
|
|
|
5
5
|
import { SizeType } from 'antd/es/config-provider/SizeContext';
|
|
6
6
|
export declare const OuterWrapper: import("styled-components").StyledComponent<"div", any, {
|
|
7
7
|
resetMargin?: boolean | undefined;
|
|
8
|
+
autoResize?: boolean | undefined;
|
|
8
9
|
}, never>;
|
|
9
10
|
export declare const Wrapper: import("styled-components").StyledComponent<"div", any, {}, never>;
|
|
10
11
|
interface InputWrapperProps {
|
package/dist/Input.styles.js
CHANGED
|
@@ -18,7 +18,7 @@ var errorInputStyle = function errorInputStyle(props) {
|
|
|
18
18
|
export var OuterWrapper = styled.div.withConfig({
|
|
19
19
|
displayName: "Inputstyles__OuterWrapper",
|
|
20
20
|
componentId: "dc57an-0"
|
|
21
|
-
})(["margin:", ";&.active{&&{input{box-shadow:inset 0 0 0 1px ", ";border-color:", ";background-color:", ";}}}"], function (props) {
|
|
21
|
+
})(["margin:", ";&.active{&&{input{box-shadow:inset 0 0 0 1px ", ";border-color:", ";background-color:", ";}}}input{max-width:", ";min-width:", ";}"], function (props) {
|
|
22
22
|
return props.resetMargin ? '0' : '0 0 16px 0';
|
|
23
23
|
}, function (props) {
|
|
24
24
|
return props.theme.palette['blue-600'];
|
|
@@ -26,6 +26,10 @@ export var OuterWrapper = styled.div.withConfig({
|
|
|
26
26
|
return props.theme.palette['blue-600'];
|
|
27
27
|
}, function (props) {
|
|
28
28
|
return props.theme.palette['blue-050'];
|
|
29
|
+
}, function (props) {
|
|
30
|
+
return props.autoResize ? '400px' : '';
|
|
31
|
+
}, function (props) {
|
|
32
|
+
return props.autoResize ? '150px' : '';
|
|
29
33
|
});
|
|
30
34
|
export var Wrapper = styled.div.withConfig({
|
|
31
35
|
displayName: "Inputstyles__Wrapper",
|
package/dist/Input.types.d.ts
CHANGED
|
@@ -20,5 +20,6 @@ export interface Props {
|
|
|
20
20
|
handleInputRef?: (ref: React.MutableRefObject<HTMLInputElement | HTMLTextAreaElement | undefined>) => void;
|
|
21
21
|
prefixel?: React.ReactNode;
|
|
22
22
|
suffixel?: React.ReactNode;
|
|
23
|
+
autoResize?: boolean;
|
|
23
24
|
}
|
|
24
25
|
export declare type EnhancedProps = Props & (InputProps | TextAreaProps | MaskedInputProps);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-input",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.19",
|
|
4
4
|
"description": "Input UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
],
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@synerise/ds-icon": "^0.
|
|
36
|
-
"@synerise/ds-scrollbar": "^0.5.
|
|
37
|
-
"@synerise/ds-tooltip": "^0.11.
|
|
35
|
+
"@synerise/ds-icon": "^0.51.0",
|
|
36
|
+
"@synerise/ds-scrollbar": "^0.5.2",
|
|
37
|
+
"@synerise/ds-tooltip": "^0.11.17",
|
|
38
38
|
"@synerise/ds-typography": "^0.12.7",
|
|
39
39
|
"@synerise/ds-utils": "^0.19.0",
|
|
40
40
|
"antd-mask-input": "^0.1.13",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"antd": "^4",
|
|
46
46
|
"react": ">=16.9.0 < 17.0.0"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "ef480757296035e4ba2928cd169a98458477b8d1"
|
|
49
49
|
}
|