@synerise/ds-input 0.20.6 → 0.20.7
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 +12 -0
- package/dist/Input.js +3 -3
- package/dist/InputGroup.styles.js +1 -1
- package/dist/Label/Label.d.ts +1 -2
- package/dist/Label/Label.js +6 -2
- package/dist/Label/Label.styles.d.ts +8 -0
- package/dist/Label/Label.styles.js +11 -4
- package/dist/Label/Label.types.d.ts +5 -6
- package/dist/autosize/autosize.js +13 -15
- package/package.json +5 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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.20.7](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@0.20.6...@synerise/ds-input@0.20.7) (2024-04-29)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **input:** fixes styles for input / select / textarea labels ([51f9d6b](https://github.com/synerise/synerise-design/commit/51f9d6bdf190a82d6e3b5ddb7437bfa81135d048))
|
|
12
|
+
* **input:** overwrite select margins within input group ([02e4e55](https://github.com/synerise/synerise-design/commit/02e4e555115e145395678b9529ac754bdedfe769))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
## [0.20.6](https://github.com/synerise/synerise-design/compare/@synerise/ds-input@0.20.5...@synerise/ds-input@0.20.6) (2024-04-15)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @synerise/ds-input
|
package/dist/Input.js
CHANGED
|
@@ -107,9 +107,9 @@ var createInputComponent = function createInputComponent(WrappedComponent) {
|
|
|
107
107
|
useEffect(function () {
|
|
108
108
|
if (inputRef.current) {
|
|
109
109
|
// @ts-ignore
|
|
110
|
-
var
|
|
111
|
-
paddingLeft =
|
|
112
|
-
paddingRight =
|
|
110
|
+
var _getComputedStyle2 = getComputedStyle(inputRef.current.input),
|
|
111
|
+
paddingLeft = _getComputedStyle2.paddingLeft,
|
|
112
|
+
paddingRight = _getComputedStyle2.paddingRight;
|
|
113
113
|
|
|
114
114
|
paddingDiff.current = parseFloat(paddingLeft) + parseFloat(paddingRight);
|
|
115
115
|
}
|
|
@@ -6,7 +6,7 @@ export var InputGroupItem = styled.div.withConfig({
|
|
|
6
6
|
export var InputGroupWrapper = styled.div.withConfig({
|
|
7
7
|
displayName: "InputGroupstyles__InputGroupWrapper",
|
|
8
8
|
componentId: "sc-1cn2cc5-1"
|
|
9
|
-
})(["&&&{display:flex;min-width:0;", ";", "}"], function (props) {
|
|
9
|
+
})(["&&&{", "{.ds-select-container{margin-bottom:0;}}display:flex;min-width:0;", ";", "}"], InputGroupItem, function (props) {
|
|
10
10
|
return props.compact ? '' : 'align-items: stretch';
|
|
11
11
|
}, function (props) {
|
|
12
12
|
return props.compact ? css(["", "{&:only-child{flex-grow:1;}&:not(:only-child){&:not(:last-child){margin-right:-1px;.ant-input,.ant-input-number,.ant-select-selector{border-top-right-radius:0px;border-bottom-right-radius:0px;}}&:last-child{.ant-input,.ant-input-number,.ant-select-selector{border-top-left-radius:0px;border-bottom-left-radius:0px;}flex:auto;}}"], InputGroupItem) : css(["", ":last-child{flex-grow:1;}", ":not(:last-child){margin-right:12px;}"], InputGroupItem, InputGroupItem);
|
package/dist/Label/Label.d.ts
CHANGED
package/dist/Label/Label.js
CHANGED
|
@@ -16,12 +16,16 @@ var Label = function Label(_ref) {
|
|
|
16
16
|
style: style,
|
|
17
17
|
htmlFor: id,
|
|
18
18
|
className: className
|
|
19
|
-
},
|
|
19
|
+
}, /*#__PURE__*/React.createElement(S.LabelText, {
|
|
20
|
+
ellipsis: {
|
|
21
|
+
tooltip: label
|
|
22
|
+
}
|
|
23
|
+
}, label), (tooltip || tooltipConfig) && /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
20
24
|
title: tooltip,
|
|
21
25
|
placement: "top",
|
|
22
26
|
trigger: "hover",
|
|
23
27
|
transitionName: "zoom-big-fast"
|
|
24
|
-
}, tooltipConfig), /*#__PURE__*/React.createElement(
|
|
28
|
+
}, tooltipConfig), /*#__PURE__*/React.createElement(S.IconWrapper, null, /*#__PURE__*/React.createElement(Icon, {
|
|
25
29
|
size: 24,
|
|
26
30
|
component: /*#__PURE__*/React.createElement(InfoFillS, null)
|
|
27
31
|
})))));
|
|
@@ -1 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare const Label: import("styled-components").StyledComponent<"label", any, {}, never>;
|
|
3
|
+
export declare const IconWrapper: import("styled-components").StyledComponent<"span", any, {}, never>;
|
|
4
|
+
export declare const LabelText: import("styled-components").StyledComponent<({ size, className, children, ellipsis }: {
|
|
5
|
+
size?: import("@synerise/ds-typography").TextSize | undefined;
|
|
6
|
+
ellipsis?: import("@synerise/ds-typography/dist/Ellipsis").EllipsisProps | undefined;
|
|
7
|
+
children?: import("react").ReactNode;
|
|
8
|
+
className?: string | undefined;
|
|
9
|
+
}) => JSX.Element, any, {}, never>;
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { macro } from '@synerise/ds-typography';
|
|
3
|
-
|
|
2
|
+
import { macro, Text } from '@synerise/ds-typography';
|
|
4
3
|
export var Label = styled.label.withConfig({
|
|
5
4
|
displayName: "Labelstyles__Label",
|
|
6
5
|
componentId: "sc-1eottcg-0"
|
|
7
|
-
})(["", ";height:17px;display:flex;align-items:center;cursor:pointer;white-space:nowrap;
|
|
6
|
+
})(["", ";height:17px;display:flex;align-items:center;cursor:pointer;white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis;"], macro.heading);
|
|
7
|
+
export var IconWrapper = styled.span.withConfig({
|
|
8
|
+
displayName: "Labelstyles__IconWrapper",
|
|
9
|
+
componentId: "sc-1eottcg-1"
|
|
10
|
+
})(["display:inline-block;.ds-icon > svg{margin-top:-1px;fill:", ";}"], function (props) {
|
|
8
11
|
return props.theme.palette['grey-400'];
|
|
9
|
-
});
|
|
12
|
+
});
|
|
13
|
+
export var LabelText = styled(Text).withConfig({
|
|
14
|
+
displayName: "Labelstyles__LabelText",
|
|
15
|
+
componentId: "sc-1eottcg-2"
|
|
16
|
+
})([""]);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { TooltipProps } from 'antd/lib/tooltip';
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { TooltipProps } from '@synerise/ds-tooltip';
|
|
4
3
|
export type LabelProps = {
|
|
5
4
|
id?: string;
|
|
6
|
-
label?:
|
|
7
|
-
tooltip?:
|
|
8
|
-
tooltipConfig?:
|
|
5
|
+
label?: ReactNode;
|
|
6
|
+
tooltip?: ReactNode;
|
|
7
|
+
tooltipConfig?: TooltipProps;
|
|
9
8
|
style?: object;
|
|
10
9
|
className?: string;
|
|
11
10
|
};
|
|
@@ -8,8 +8,6 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
8
8
|
|
|
9
9
|
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; }
|
|
10
10
|
|
|
11
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
-
|
|
13
11
|
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
14
12
|
|
|
15
13
|
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; }
|
|
@@ -54,22 +52,12 @@ var generateId = function generateId() {
|
|
|
54
52
|
};
|
|
55
53
|
|
|
56
54
|
var AutosizeInput = /*#__PURE__*/function (_Component) {
|
|
57
|
-
_inheritsLoose(AutosizeInput, _Component);
|
|
58
|
-
|
|
59
|
-
AutosizeInput.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
|
|
60
|
-
var id = props.id;
|
|
61
|
-
return id !== state.prevId ? {
|
|
62
|
-
inputId: id || generateId(),
|
|
63
|
-
prevId: id
|
|
64
|
-
} : null;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
55
|
function AutosizeInput(props) {
|
|
68
56
|
var _this;
|
|
69
57
|
|
|
70
58
|
_this = _Component.call(this, props) || this;
|
|
71
59
|
|
|
72
|
-
_defineProperty(
|
|
60
|
+
_defineProperty(_this, "inputRef", function (el, originalElement) {
|
|
73
61
|
_this.input = el;
|
|
74
62
|
|
|
75
63
|
if (typeof _this.props.inputRef === 'function') {
|
|
@@ -77,11 +65,11 @@ var AutosizeInput = /*#__PURE__*/function (_Component) {
|
|
|
77
65
|
}
|
|
78
66
|
});
|
|
79
67
|
|
|
80
|
-
_defineProperty(
|
|
68
|
+
_defineProperty(_this, "placeHolderSizerRef", function (el) {
|
|
81
69
|
_this.placeHolderSizer = el;
|
|
82
70
|
});
|
|
83
71
|
|
|
84
|
-
_defineProperty(
|
|
72
|
+
_defineProperty(_this, "sizerRef", function (el) {
|
|
85
73
|
var _this$props$transform = _this.props.transformRef,
|
|
86
74
|
transformRef = _this$props$transform === void 0 ? function (el) {
|
|
87
75
|
return el;
|
|
@@ -104,6 +92,16 @@ var AutosizeInput = /*#__PURE__*/function (_Component) {
|
|
|
104
92
|
return _this;
|
|
105
93
|
}
|
|
106
94
|
|
|
95
|
+
_inheritsLoose(AutosizeInput, _Component);
|
|
96
|
+
|
|
97
|
+
AutosizeInput.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
|
|
98
|
+
var id = props.id;
|
|
99
|
+
return id !== state.prevId ? {
|
|
100
|
+
inputId: id || generateId(),
|
|
101
|
+
prevId: id
|
|
102
|
+
} : null;
|
|
103
|
+
};
|
|
104
|
+
|
|
107
105
|
var _proto = AutosizeInput.prototype;
|
|
108
106
|
|
|
109
107
|
_proto.componentDidMount = function componentDidMount() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-input",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.7",
|
|
4
4
|
"description": "Input UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@synerise/ds-icon": "^0.60.7",
|
|
37
37
|
"@synerise/ds-scrollbar": "^0.10.2",
|
|
38
38
|
"@synerise/ds-tooltip": "^0.14.25",
|
|
39
|
-
"@synerise/ds-typography": "^0.
|
|
39
|
+
"@synerise/ds-typography": "^0.15.0",
|
|
40
40
|
"@synerise/ds-utils": "^0.26.3",
|
|
41
41
|
"antd-mask-input": "^0.1.13",
|
|
42
42
|
"csstype": "2.6.9",
|
|
@@ -49,7 +49,8 @@
|
|
|
49
49
|
"styled-components": "5.0.1"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@testing-library/react": "10.0.1"
|
|
52
|
+
"@testing-library/react": "10.0.1",
|
|
53
|
+
"@testing-library/user-event": "10.3.1"
|
|
53
54
|
},
|
|
54
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "6f0dc42ae79cea009e60fdb1f91ef72dcc82998e"
|
|
55
56
|
}
|