@synerise/ds-checkbox 0.11.0 → 0.11.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/Checkbox.js +27 -51
- package/dist/Checkbox.styles.js +4 -4
- package/package.json +3 -3
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.11.4](https://github.com/synerise/synerise-design/compare/@synerise/ds-checkbox@0.11.3...@synerise/ds-checkbox@0.11.4) (2021-11-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @synerise/ds-checkbox
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.11.3](https://github.com/synerise/synerise-design/compare/@synerise/ds-checkbox@0.11.2...@synerise/ds-checkbox@0.11.3) (2021-11-22)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @synerise/ds-checkbox
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [0.11.2](https://github.com/synerise/synerise-design/compare/@synerise/ds-checkbox@0.11.1...@synerise/ds-checkbox@0.11.2) (2021-11-16)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @synerise/ds-checkbox
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [0.11.1](https://github.com/synerise/synerise-design/compare/@synerise/ds-checkbox@0.10.30...@synerise/ds-checkbox@0.11.1) (2021-11-09)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @synerise/ds-checkbox
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
6
38
|
# [0.11.0](https://github.com/synerise/synerise-design/compare/@synerise/ds-checkbox@0.10.30...@synerise/ds-checkbox@0.11.0) (2021-11-09)
|
|
7
39
|
|
|
8
40
|
**Note:** Version bump only for package @synerise/ds-checkbox
|
package/dist/Checkbox.js
CHANGED
|
@@ -1,32 +1,12 @@
|
|
|
1
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
|
-
|
|
3
1
|
var _excluded = ["description", "errorText", "children", "withoutPadding", "hasError"];
|
|
4
2
|
|
|
5
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); }
|
|
6
4
|
|
|
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) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { 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 { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], 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 '@synerise/ds-core/dist/js/style';
|
|
@@ -35,41 +15,37 @@ import { Description, ErrorText } from '@synerise/ds-typography';
|
|
|
35
15
|
import * as S from './Checkbox.styles';
|
|
36
16
|
|
|
37
17
|
var Checkbox = /*#__PURE__*/function (_React$Component) {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
var _super = _createSuper(Checkbox);
|
|
18
|
+
_inheritsLoose(Checkbox, _React$Component);
|
|
41
19
|
|
|
42
20
|
function Checkbox() {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
return _super.apply(this, arguments);
|
|
21
|
+
return _React$Component.apply(this, arguments) || this;
|
|
46
22
|
}
|
|
47
23
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}]);
|
|
24
|
+
var _proto = Checkbox.prototype;
|
|
25
|
+
|
|
26
|
+
_proto.render = function render() {
|
|
27
|
+
var _this$props = this.props,
|
|
28
|
+
description = _this$props.description,
|
|
29
|
+
errorText = _this$props.errorText,
|
|
30
|
+
children = _this$props.children,
|
|
31
|
+
withoutPadding = _this$props.withoutPadding,
|
|
32
|
+
hasError = _this$props.hasError,
|
|
33
|
+
antdCheckboxProps = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
34
|
+
|
|
35
|
+
return /*#__PURE__*/React.createElement(S.CheckboxWrapper, {
|
|
36
|
+
className: "ds-checkbox",
|
|
37
|
+
withoutPadding: Boolean(withoutPadding)
|
|
38
|
+
}, /*#__PURE__*/React.createElement(S.AntdCheckbox, _extends({}, antdCheckboxProps, {
|
|
39
|
+
className: hasError || errorText ? 'error' : undefined,
|
|
40
|
+
solo: !children && !errorText && !description
|
|
41
|
+
}), children), (errorText || description) && /*#__PURE__*/React.createElement(S.AdditionalData, null, errorText && /*#__PURE__*/React.createElement(ErrorText, null, errorText), description && /*#__PURE__*/React.createElement(Description, {
|
|
42
|
+
disabled: antdCheckboxProps.disabled
|
|
43
|
+
}, description)));
|
|
44
|
+
};
|
|
70
45
|
|
|
71
46
|
return Checkbox;
|
|
72
47
|
}(React.Component);
|
|
73
48
|
|
|
74
|
-
Checkbox
|
|
49
|
+
_defineProperty(Checkbox, "Group", S.AntdCheckbox.Group);
|
|
50
|
+
|
|
75
51
|
export default Checkbox;
|
package/dist/Checkbox.styles.js
CHANGED
|
@@ -3,7 +3,7 @@ import BaseAntCheckbox from 'antd/lib/checkbox';
|
|
|
3
3
|
|
|
4
4
|
var checkSvgWithCustomColor = function checkSvgWithCustomColor(color) {
|
|
5
5
|
var colorValueForSvg = color.replace(/#/, '%23');
|
|
6
|
-
var iconWithColor = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='3 3 18 18' >/><path fill='none' d='M0 0h24v24H0z' /><path style='fill: "
|
|
6
|
+
var iconWithColor = "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='3 3 18 18' >/><path fill='none' d='M0 0h24v24H0z' /><path style='fill: " + colorValueForSvg + ";' stroke-width='1' stroke='" + colorValueForSvg + "' d='M10.61 15.744a.75.75 0 01-.535-.224l-3.11-3.162a.75.75 0 011.07-1.052l2.575 2.618 5.355-5.444a.75.75 0 111.07 1.052l-5.89 5.988a.75.75 0 01-.535.224z'/></svg>";
|
|
7
7
|
return iconWithColor;
|
|
8
8
|
};
|
|
9
9
|
|
|
@@ -18,9 +18,9 @@ export var AntdCheckbox = styled(BaseAntCheckbox).withConfig({
|
|
|
18
18
|
}, function (props) {
|
|
19
19
|
return props.theme.palette['blue-600'];
|
|
20
20
|
}, function (props) {
|
|
21
|
-
return "url(\""
|
|
21
|
+
return "url(\"" + checkSvgWithCustomColor(props.theme.palette['grey-400']) + "\")";
|
|
22
22
|
}, function (props) {
|
|
23
|
-
return "url(\""
|
|
23
|
+
return "url(\"" + checkSvgWithCustomColor(props.theme.palette.white) + "\")";
|
|
24
24
|
}, function (props) {
|
|
25
25
|
return props.theme.palette['blue-600'];
|
|
26
26
|
}, function (props) {
|
|
@@ -30,7 +30,7 @@ export var AntdCheckbox = styled(BaseAntCheckbox).withConfig({
|
|
|
30
30
|
}, function (props) {
|
|
31
31
|
return props.theme.palette['blue-600'];
|
|
32
32
|
}, function (props) {
|
|
33
|
-
return "url(\""
|
|
33
|
+
return "url(\"" + checkSvgWithCustomColor(props.theme.palette['blue-600']) + "\")";
|
|
34
34
|
});
|
|
35
35
|
export var AdditionalData = styled.div.withConfig({
|
|
36
36
|
displayName: "Checkboxstyles__AdditionalData",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-checkbox",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.4",
|
|
4
4
|
"description": "Checkbox UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "synerise/synerise-design",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"*.less"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@synerise/ds-utils": "^0.21.
|
|
34
|
+
"@synerise/ds-utils": "^0.21.4"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@synerise/ds-core": "*",
|
|
38
38
|
"antd": "^4",
|
|
39
39
|
"react": ">=16.9.0 < 17.0.0"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "3e5f807c3c9ce7bbcb707b1e229ad5d7ef50d830"
|
|
42
42
|
}
|