@synerise/ds-select 0.13.48 → 0.14.2
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/Select.js +74 -96
- package/dist/Select.styles.js +4 -4
- package/dist/Select.types.js +1 -0
- package/package.json +4 -4
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.14.2](https://github.com/synerise/synerise-design/compare/@synerise/ds-select@0.14.1...@synerise/ds-select@0.14.2) (2021-11-22)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-select
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.14.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-select@0.13.49...@synerise/ds-select@0.14.1) (2021-11-09)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @synerise/ds-select
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [0.14.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-select@0.13.49...@synerise/ds-select@0.14.0) (2021-11-09)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @synerise/ds-select
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [0.13.49](https://github.com/synerise/synerise-design/compare/@synerise/ds-select@0.13.48...@synerise/ds-select@0.13.49) (2021-11-05)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @synerise/ds-select
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
6
38
|
## [0.13.48](https://github.com/synerise/synerise-design/compare/@synerise/ds-select@0.13.46...@synerise/ds-select@0.13.48) (2021-10-26)
|
|
7
39
|
|
|
8
40
|
**Note:** Version bump only for package @synerise/ds-select
|
package/dist/Select.js
CHANGED
|
@@ -1,122 +1,100 @@
|
|
|
1
|
-
|
|
1
|
+
var _excluded = ["label", "description", "errorText", "error", "tooltip", "clearTooltip", "prefixel", "suffixel", "style", "listHeight", "className", "getPopupContainer", "grey"];
|
|
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 _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; }
|
|
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
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; }
|
|
10
6
|
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
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); } }
|
|
14
|
-
|
|
15
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
16
|
-
|
|
17
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
18
|
-
|
|
19
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
20
|
-
|
|
21
|
-
function _createSuper(Derived) { return function () { var Super = _getPrototypeOf(Derived), result; if (_isNativeReflectConstruct()) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
7
|
+
function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
|
|
22
8
|
|
|
23
|
-
function
|
|
24
|
-
|
|
25
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
26
|
-
|
|
27
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
28
|
-
|
|
29
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
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; }
|
|
30
10
|
|
|
31
11
|
import * as React from 'react';
|
|
32
12
|
import { ErrorText, Description } from '@synerise/ds-typography';
|
|
33
13
|
import '@synerise/ds-core/dist/js/style';
|
|
34
14
|
import "./style/index.css";
|
|
35
|
-
import { Close3M, CloseS } from '@synerise/ds-icon
|
|
36
|
-
import Icon from '@synerise/ds-icon';
|
|
15
|
+
import Icon, { Close3M, CloseS } from '@synerise/ds-icon';
|
|
37
16
|
import Tooltip from '@synerise/ds-tooltip';
|
|
38
17
|
import { getPopupContainer as defaultGetPopupContainer } from '@synerise/ds-utils';
|
|
39
18
|
import classNames from 'classnames';
|
|
40
19
|
import * as S from './Select.styles';
|
|
41
20
|
|
|
42
21
|
var Select = /*#__PURE__*/function (_React$Component) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
var _super = _createSuper(Select);
|
|
22
|
+
_inheritsLoose(Select, _React$Component);
|
|
46
23
|
|
|
47
24
|
function Select() {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return _super.apply(this, arguments);
|
|
25
|
+
return _React$Component.apply(this, arguments) || this;
|
|
51
26
|
}
|
|
52
27
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
28
|
+
var _proto = Select.prototype;
|
|
29
|
+
|
|
30
|
+
_proto.render = function render() {
|
|
31
|
+
var _classNames;
|
|
32
|
+
|
|
33
|
+
var _this$props = this.props,
|
|
34
|
+
label = _this$props.label,
|
|
35
|
+
description = _this$props.description,
|
|
36
|
+
errorText = _this$props.errorText,
|
|
37
|
+
error = _this$props.error,
|
|
38
|
+
tooltip = _this$props.tooltip,
|
|
39
|
+
clearTooltip = _this$props.clearTooltip,
|
|
40
|
+
prefixel = _this$props.prefixel,
|
|
41
|
+
suffixel = _this$props.suffixel,
|
|
42
|
+
style = _this$props.style,
|
|
43
|
+
listHeight = _this$props.listHeight,
|
|
44
|
+
className = _this$props.className,
|
|
45
|
+
_this$props$getPopupC = _this$props.getPopupContainer,
|
|
46
|
+
getPopupContainer = _this$props$getPopupC === void 0 ? defaultGetPopupContainer : _this$props$getPopupC,
|
|
47
|
+
grey = _this$props.grey,
|
|
48
|
+
antdProps = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
49
|
+
|
|
50
|
+
var size = antdProps.size;
|
|
51
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(S.Label, {
|
|
52
|
+
label: label,
|
|
53
|
+
tooltip: tooltip
|
|
54
|
+
}), /*#__PURE__*/React.createElement(S.SelectWrapper, {
|
|
55
|
+
grey: grey,
|
|
56
|
+
error: Boolean(errorText),
|
|
57
|
+
className: classNames('ds-select-wrapper', {
|
|
58
|
+
error: errorText || error
|
|
59
|
+
}, (_classNames = {}, _classNames[className] = !!className, _classNames)),
|
|
60
|
+
style: style
|
|
61
|
+
}, !!prefixel && /*#__PURE__*/React.createElement(S.PrefixWrapper, null, prefixel), /*#__PURE__*/React.createElement(S.AntdSelect, _extends({
|
|
62
|
+
dropdownAlign: {
|
|
63
|
+
offset: [0, 8]
|
|
64
|
+
} // STOR-588
|
|
65
|
+
|
|
66
|
+
}, antdProps, {
|
|
67
|
+
getPopupContainer: getPopupContainer,
|
|
68
|
+
listHeight: listHeight,
|
|
69
|
+
size: size,
|
|
70
|
+
prefixel: !!prefixel,
|
|
71
|
+
suffixel: !!suffixel,
|
|
72
|
+
clearIcon: /*#__PURE__*/React.createElement(Tooltip, {
|
|
73
|
+
title: clearTooltip
|
|
74
|
+
}, /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement(Icon, {
|
|
75
|
+
component: /*#__PURE__*/React.createElement(Close3M, null),
|
|
76
|
+
size: size === 'small' ? 18 : 24
|
|
77
|
+
}))),
|
|
78
|
+
removeIcon: /*#__PURE__*/React.createElement(Icon, {
|
|
79
|
+
component: /*#__PURE__*/React.createElement(CloseS, null)
|
|
80
|
+
}),
|
|
81
|
+
className: classNames({
|
|
82
|
+
error: errorText || error
|
|
83
|
+
})
|
|
84
|
+
})), !!suffixel && /*#__PURE__*/React.createElement(S.SuffixWrapper, null, suffixel)), errorText && /*#__PURE__*/React.createElement(S.ErrorWrapper, {
|
|
85
|
+
description: Boolean(description)
|
|
86
|
+
}, /*#__PURE__*/React.createElement(ErrorText, null, errorText)), description && /*#__PURE__*/React.createElement(S.DescWrapper, {
|
|
87
|
+
withError: Boolean(errorText)
|
|
88
|
+
}, description && /*#__PURE__*/React.createElement(Description, {
|
|
89
|
+
disabled: antdProps.disabled
|
|
90
|
+
}, description)));
|
|
91
|
+
};
|
|
116
92
|
|
|
117
93
|
return Select;
|
|
118
94
|
}(React.Component);
|
|
119
95
|
|
|
120
|
-
Select
|
|
121
|
-
|
|
96
|
+
_defineProperty(Select, "Option", S.AntdSelectOption);
|
|
97
|
+
|
|
98
|
+
_defineProperty(Select, "OptGroup", S.AntdSelectOptGroup);
|
|
99
|
+
|
|
122
100
|
export default Select;
|
package/dist/Select.styles.js
CHANGED
|
@@ -5,12 +5,12 @@ var OptGroup = Select.OptGroup,
|
|
|
5
5
|
Option = Select.Option;
|
|
6
6
|
|
|
7
7
|
var errorStyle = function errorStyle(props) {
|
|
8
|
-
return "\nborder-color: "
|
|
8
|
+
return "\nborder-color: " + props.theme.palette['red-600'] + ";\nbox-shadow: inset 0 0 0 1px " + props.theme.palette['red-600'] + ";\nbackground: " + props.theme.palette['red-050'] + ";\n";
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
var searchIconWithCustomColor = function searchIconWithCustomColor(color) {
|
|
12
12
|
var colorValueForSvg = color.replace(/#/, '%23');
|
|
13
|
-
var iconWithColor = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-6 -6 36 36' >/><path fill='none' d='M0 0h24v24H0z' /><path style='fill: "
|
|
13
|
+
var iconWithColor = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='-6 -6 36 36' >/><path fill='none' d='M0 0h24v24H0z' /><path style='fill: " + colorValueForSvg + ";' d='M10.734 17.234a6.463 6.463 0 004.03-1.41l3.721 3.722a.75.75 0 001.06-1.06l-3.72-3.722a6.494 6.494 0 10-5.09 2.47zm0-11.5a5 5 0 11-5 5 5.006 5.006 0 015-5z'/></svg>";
|
|
14
14
|
return iconWithColor;
|
|
15
15
|
};
|
|
16
16
|
|
|
@@ -23,7 +23,7 @@ var withSuffixStyles = function withSuffixStyles() {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
var addonStyles = function addonStyles(props) {
|
|
26
|
-
return "\n display: flex;\n align-items: center;\n background: "
|
|
26
|
+
return "\n display: flex;\n align-items: center;\n background: " + props.theme.palette['grey-050'] + ";\n box-shadow: inset 0 0 0 1px " + props.theme.palette['grey-300'] + ";\n color: " + props.theme.palette['grey-500'] + ";\n font-size:13px;\n line-height: 1.39;\n ";
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export var AntdSelect = styled(Select).withConfig({
|
|
@@ -36,7 +36,7 @@ export var AntdSelect = styled(Select).withConfig({
|
|
|
36
36
|
}, function (props) {
|
|
37
37
|
return !!props.suffixel && withSuffixStyles();
|
|
38
38
|
}, function (props) {
|
|
39
|
-
return "url(\""
|
|
39
|
+
return "url(\"" + searchIconWithCustomColor(props.theme.palette['grey-400']) + "\")";
|
|
40
40
|
}, function (props) {
|
|
41
41
|
return errorStyle(props);
|
|
42
42
|
}, function (props) {
|
package/dist/Select.types.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-select",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.2",
|
|
4
4
|
"description": "Select UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
],
|
|
33
33
|
"types": "dist/index.d.ts",
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@synerise/ds-input": "^0.
|
|
36
|
-
"@synerise/ds-typography": "^0.
|
|
35
|
+
"@synerise/ds-input": "^0.18.2",
|
|
36
|
+
"@synerise/ds-typography": "^0.12.2",
|
|
37
37
|
"classnames": "^2.2.6"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"@synerise/ds-utils": "^0.19.0"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "2468359677783819939fb9f1ef5acc36667ecd1a"
|
|
48
48
|
}
|