dibk-design 0.4.44 → 0.4.45
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.
|
@@ -1,110 +1,110 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
|
-
var _theme = require("../functions/theme");
|
|
15
|
-
|
|
16
|
-
var _CheckBoxIconModule = _interopRequireDefault(require("./CheckBoxIcon.module.scss"));
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
-
|
|
22
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
-
|
|
24
|
-
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; }
|
|
25
|
-
|
|
26
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
27
|
-
|
|
28
|
-
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); } }
|
|
29
|
-
|
|
30
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
31
|
-
|
|
32
|
-
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
33
|
-
|
|
34
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
35
|
-
|
|
36
|
-
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); }; }
|
|
37
|
-
|
|
38
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
39
|
-
|
|
40
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
41
|
-
|
|
42
|
-
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; } }
|
|
43
|
-
|
|
44
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
|
-
|
|
46
|
-
var CheckBoxIcon = /*#__PURE__*/function (_React$Component) {
|
|
47
|
-
_inherits(CheckBoxIcon, _React$Component);
|
|
48
|
-
|
|
49
|
-
var _super = _createSuper(CheckBoxIcon);
|
|
50
|
-
|
|
51
|
-
function CheckBoxIcon() {
|
|
52
|
-
_classCallCheck(this, CheckBoxIcon);
|
|
53
|
-
|
|
54
|
-
return _super.apply(this, arguments);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
_createClass(CheckBoxIcon, [{
|
|
58
|
-
key: "render",
|
|
59
|
-
value: function render() {
|
|
60
|
-
var inlineStyle = {
|
|
61
|
-
height: this.props.size,
|
|
62
|
-
width: this.props.size,
|
|
63
|
-
fontSize: this.props.size
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
if (this.props.theme && this.props.checked) {
|
|
67
|
-
inlineStyle = _objectSpread(_objectSpread({}, inlineStyle), {}, {
|
|
68
|
-
color: (0, _theme.getThemePaletteBackgroundColor)(this.props.theme, 'primary'),
|
|
69
|
-
boxShadow: "0 0 0 1px ".concat((0, _theme.getThemePaletteBackgroundColor)(this.props.theme, 'primary')) // TODO: support theme error color
|
|
70
|
-
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
var ariaExpandedIndex = "aria-expanded";
|
|
75
|
-
|
|
76
|
-
var props = _defineProperty({
|
|
77
|
-
className: "".concat(_CheckBoxIconModule.default.checkBoxIcon, " ").concat(this.props.checked ? _CheckBoxIconModule.default.checked : '', " ").concat(this.props.disabled ? _CheckBoxIconModule.default.disabled : '', " ").concat(this.props.showBox ? _CheckBoxIconModule.default.showBox : '', " ").concat(this.props.hasErrors ? _CheckBoxIconModule.default.hasErrors : ''),
|
|
78
|
-
style: inlineStyle
|
|
79
|
-
}, ariaExpandedIndex, this.props.expandable ? this.props.checked.toString() : null);
|
|
80
|
-
|
|
81
|
-
return /*#__PURE__*/_react.default.createElement("span", props, /*#__PURE__*/_react.default.createElement("span", {
|
|
82
|
-
className: _CheckBoxIconModule.default.checkmark
|
|
83
|
-
}, this.props.checked ? this.props.checkmarkCharacter : ''));
|
|
84
|
-
}
|
|
85
|
-
}]);
|
|
86
|
-
|
|
87
|
-
return CheckBoxIcon;
|
|
88
|
-
}(_react.default.Component);
|
|
89
|
-
|
|
90
|
-
CheckBoxIcon.propTypes = {
|
|
91
|
-
size: _propTypes.default.string,
|
|
92
|
-
checked: _propTypes.default.bool,
|
|
93
|
-
disabled: _propTypes.default.bool,
|
|
94
|
-
showBox: _propTypes.default.bool,
|
|
95
|
-
theme: _propTypes.default.object,
|
|
96
|
-
hasErrors: _propTypes.default.bool,
|
|
97
|
-
checkmarkCharacter: _propTypes.default.string,
|
|
98
|
-
expandable: _propTypes.default.bool
|
|
99
|
-
};
|
|
100
|
-
CheckBoxIcon.defaultProps = {
|
|
101
|
-
size: '20px',
|
|
102
|
-
checked: false,
|
|
103
|
-
disabled: false,
|
|
104
|
-
showBox: true,
|
|
105
|
-
hasErrors: false,
|
|
106
|
-
checkmarkCharacter: '✔',
|
|
107
|
-
expandable: false
|
|
108
|
-
};
|
|
109
|
-
var _default = CheckBoxIcon;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _theme = require("../functions/theme");
|
|
15
|
+
|
|
16
|
+
var _CheckBoxIconModule = _interopRequireDefault(require("./CheckBoxIcon.module.scss"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
+
|
|
22
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
27
|
+
|
|
28
|
+
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); } }
|
|
29
|
+
|
|
30
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
31
|
+
|
|
32
|
+
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
33
|
+
|
|
34
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
35
|
+
|
|
36
|
+
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); }; }
|
|
37
|
+
|
|
38
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
39
|
+
|
|
40
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
41
|
+
|
|
42
|
+
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; } }
|
|
43
|
+
|
|
44
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
|
+
|
|
46
|
+
var CheckBoxIcon = /*#__PURE__*/function (_React$Component) {
|
|
47
|
+
_inherits(CheckBoxIcon, _React$Component);
|
|
48
|
+
|
|
49
|
+
var _super = _createSuper(CheckBoxIcon);
|
|
50
|
+
|
|
51
|
+
function CheckBoxIcon() {
|
|
52
|
+
_classCallCheck(this, CheckBoxIcon);
|
|
53
|
+
|
|
54
|
+
return _super.apply(this, arguments);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
_createClass(CheckBoxIcon, [{
|
|
58
|
+
key: "render",
|
|
59
|
+
value: function render() {
|
|
60
|
+
var inlineStyle = {
|
|
61
|
+
height: this.props.size,
|
|
62
|
+
width: this.props.size,
|
|
63
|
+
fontSize: this.props.size
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
if (this.props.theme && this.props.checked) {
|
|
67
|
+
inlineStyle = _objectSpread(_objectSpread({}, inlineStyle), {}, {
|
|
68
|
+
color: (0, _theme.getThemePaletteBackgroundColor)(this.props.theme, 'primary'),
|
|
69
|
+
boxShadow: "0 0 0 1px ".concat((0, _theme.getThemePaletteBackgroundColor)(this.props.theme, 'primary')) // TODO: support theme error color
|
|
70
|
+
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
var ariaExpandedIndex = "aria-expanded";
|
|
75
|
+
|
|
76
|
+
var props = _defineProperty({
|
|
77
|
+
className: "".concat(_CheckBoxIconModule.default.checkBoxIcon, " ").concat(this.props.checked ? _CheckBoxIconModule.default.checked : '', " ").concat(this.props.disabled ? _CheckBoxIconModule.default.disabled : '', " ").concat(this.props.showBox ? _CheckBoxIconModule.default.showBox : '', " ").concat(this.props.hasErrors ? _CheckBoxIconModule.default.hasErrors : ''),
|
|
78
|
+
style: inlineStyle
|
|
79
|
+
}, ariaExpandedIndex, this.props.expandable ? this.props.checked.toString() : null);
|
|
80
|
+
|
|
81
|
+
return /*#__PURE__*/_react.default.createElement("span", props, /*#__PURE__*/_react.default.createElement("span", {
|
|
82
|
+
className: _CheckBoxIconModule.default.checkmark
|
|
83
|
+
}, this.props.checked ? this.props.checkmarkCharacter : ''));
|
|
84
|
+
}
|
|
85
|
+
}]);
|
|
86
|
+
|
|
87
|
+
return CheckBoxIcon;
|
|
88
|
+
}(_react.default.Component);
|
|
89
|
+
|
|
90
|
+
CheckBoxIcon.propTypes = {
|
|
91
|
+
size: _propTypes.default.string,
|
|
92
|
+
checked: _propTypes.default.bool,
|
|
93
|
+
disabled: _propTypes.default.bool,
|
|
94
|
+
showBox: _propTypes.default.bool,
|
|
95
|
+
theme: _propTypes.default.object,
|
|
96
|
+
hasErrors: _propTypes.default.bool,
|
|
97
|
+
checkmarkCharacter: _propTypes.default.string,
|
|
98
|
+
expandable: _propTypes.default.bool
|
|
99
|
+
};
|
|
100
|
+
CheckBoxIcon.defaultProps = {
|
|
101
|
+
size: '20px',
|
|
102
|
+
checked: false,
|
|
103
|
+
disabled: false,
|
|
104
|
+
showBox: true,
|
|
105
|
+
hasErrors: false,
|
|
106
|
+
checkmarkCharacter: '✔',
|
|
107
|
+
expandable: false
|
|
108
|
+
};
|
|
109
|
+
var _default = CheckBoxIcon;
|
|
110
110
|
exports.default = _default;
|
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
|
-
var _CheckBoxIcon = _interopRequireDefault(require("./CheckBoxIcon"));
|
|
15
|
-
|
|
16
|
-
var _CheckBoxInputModule = _interopRequireDefault(require("./CheckBoxInput.module.scss"));
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21
|
-
|
|
22
|
-
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); } }
|
|
23
|
-
|
|
24
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
|
-
|
|
26
|
-
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
|
-
|
|
28
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
-
|
|
30
|
-
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); }; }
|
|
31
|
-
|
|
32
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
33
|
-
|
|
34
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
35
|
-
|
|
36
|
-
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; } }
|
|
37
|
-
|
|
38
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
|
-
|
|
40
|
-
var CheckBoxInput = /*#__PURE__*/function (_React$Component) {
|
|
41
|
-
_inherits(CheckBoxInput, _React$Component);
|
|
42
|
-
|
|
43
|
-
var _super = _createSuper(CheckBoxInput);
|
|
44
|
-
|
|
45
|
-
function CheckBoxInput() {
|
|
46
|
-
_classCallCheck(this, CheckBoxInput);
|
|
47
|
-
|
|
48
|
-
return _super.apply(this, arguments);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
_createClass(CheckBoxInput, [{
|
|
52
|
-
key: "render",
|
|
53
|
-
value: function render() {
|
|
54
|
-
return /*#__PURE__*/_react.default.createElement("label", {
|
|
55
|
-
className: "".concat(_CheckBoxInputModule.default.checkBoxInput, " ").concat(this.props.contentOnly ? _CheckBoxInputModule.default.contentOnly : '', " ").concat(this.props.disabled ? _CheckBoxInputModule.default.disabled : '', " ").concat(this.props.hasErrors ? _CheckBoxInputModule.default.hasErrors : ''),
|
|
56
|
-
htmlFor: this.props.id
|
|
57
|
-
}, !this.props.contentOnly ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CheckBoxIcon.default, {
|
|
58
|
-
checked: this.props.checked,
|
|
59
|
-
disabled: this.props.disabled,
|
|
60
|
-
theme: this.props.theme,
|
|
61
|
-
hasErrors: this.props.hasErrors,
|
|
62
|
-
checkmarkCharacter: this.props.checkmarkCharacter,
|
|
63
|
-
expandable: this.props.expandable
|
|
64
|
-
}), /*#__PURE__*/_react.default.createElement("input", {
|
|
65
|
-
onChange: this.props.onChange,
|
|
66
|
-
type: "checkbox",
|
|
67
|
-
name: this.props.name,
|
|
68
|
-
id: this.props.id,
|
|
69
|
-
checked: this.props.checked,
|
|
70
|
-
disabled: this.props.disabled
|
|
71
|
-
})) : /*#__PURE__*/_react.default.createElement(_CheckBoxIcon.default, {
|
|
72
|
-
checked: this.props.checked,
|
|
73
|
-
disabled: this.props.disabled,
|
|
74
|
-
showBox: false,
|
|
75
|
-
theme: this.props.theme
|
|
76
|
-
}), /*#__PURE__*/_react.default.createElement("span", null, this.props.children));
|
|
77
|
-
}
|
|
78
|
-
}]);
|
|
79
|
-
|
|
80
|
-
return CheckBoxInput;
|
|
81
|
-
}(_react.default.Component);
|
|
82
|
-
|
|
83
|
-
CheckBoxInput.propTypes = {
|
|
84
|
-
checked: _propTypes.default.bool,
|
|
85
|
-
disabled: _propTypes.default.bool,
|
|
86
|
-
id: _propTypes.default.string.isRequired,
|
|
87
|
-
name: _propTypes.default.string,
|
|
88
|
-
onChange: _propTypes.default.func.isRequired,
|
|
89
|
-
contentOnly: _propTypes.default.bool,
|
|
90
|
-
hasErrors: _propTypes.default.bool,
|
|
91
|
-
theme: _propTypes.default.object,
|
|
92
|
-
checkmarkCharacter: _propTypes.default.string,
|
|
93
|
-
expandable: _propTypes.default.bool
|
|
94
|
-
};
|
|
95
|
-
CheckBoxInput.defaultProps = {
|
|
96
|
-
checked: false,
|
|
97
|
-
disabled: false,
|
|
98
|
-
name: '',
|
|
99
|
-
contentOnly: false,
|
|
100
|
-
hasErrors: false,
|
|
101
|
-
checkmarkCharacter: '✔',
|
|
102
|
-
expandable: false
|
|
103
|
-
};
|
|
104
|
-
var _default = CheckBoxInput;
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _CheckBoxIcon = _interopRequireDefault(require("./CheckBoxIcon"));
|
|
15
|
+
|
|
16
|
+
var _CheckBoxInputModule = _interopRequireDefault(require("./CheckBoxInput.module.scss"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21
|
+
|
|
22
|
+
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); } }
|
|
23
|
+
|
|
24
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
|
+
|
|
26
|
+
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
|
+
|
|
28
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
+
|
|
30
|
+
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); }; }
|
|
31
|
+
|
|
32
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
33
|
+
|
|
34
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
35
|
+
|
|
36
|
+
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; } }
|
|
37
|
+
|
|
38
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
|
+
|
|
40
|
+
var CheckBoxInput = /*#__PURE__*/function (_React$Component) {
|
|
41
|
+
_inherits(CheckBoxInput, _React$Component);
|
|
42
|
+
|
|
43
|
+
var _super = _createSuper(CheckBoxInput);
|
|
44
|
+
|
|
45
|
+
function CheckBoxInput() {
|
|
46
|
+
_classCallCheck(this, CheckBoxInput);
|
|
47
|
+
|
|
48
|
+
return _super.apply(this, arguments);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
_createClass(CheckBoxInput, [{
|
|
52
|
+
key: "render",
|
|
53
|
+
value: function render() {
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement("label", {
|
|
55
|
+
className: "".concat(_CheckBoxInputModule.default.checkBoxInput, " ").concat(this.props.contentOnly ? _CheckBoxInputModule.default.contentOnly : '', " ").concat(this.props.disabled ? _CheckBoxInputModule.default.disabled : '', " ").concat(this.props.hasErrors ? _CheckBoxInputModule.default.hasErrors : ''),
|
|
56
|
+
htmlFor: this.props.id
|
|
57
|
+
}, !this.props.contentOnly ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CheckBoxIcon.default, {
|
|
58
|
+
checked: this.props.checked,
|
|
59
|
+
disabled: this.props.disabled,
|
|
60
|
+
theme: this.props.theme,
|
|
61
|
+
hasErrors: this.props.hasErrors,
|
|
62
|
+
checkmarkCharacter: this.props.checkmarkCharacter,
|
|
63
|
+
expandable: this.props.expandable
|
|
64
|
+
}), /*#__PURE__*/_react.default.createElement("input", {
|
|
65
|
+
onChange: this.props.onChange,
|
|
66
|
+
type: "checkbox",
|
|
67
|
+
name: this.props.name,
|
|
68
|
+
id: this.props.id,
|
|
69
|
+
checked: this.props.checked,
|
|
70
|
+
disabled: this.props.disabled
|
|
71
|
+
})) : /*#__PURE__*/_react.default.createElement(_CheckBoxIcon.default, {
|
|
72
|
+
checked: this.props.checked,
|
|
73
|
+
disabled: this.props.disabled,
|
|
74
|
+
showBox: false,
|
|
75
|
+
theme: this.props.theme
|
|
76
|
+
}), /*#__PURE__*/_react.default.createElement("span", null, this.props.children));
|
|
77
|
+
}
|
|
78
|
+
}]);
|
|
79
|
+
|
|
80
|
+
return CheckBoxInput;
|
|
81
|
+
}(_react.default.Component);
|
|
82
|
+
|
|
83
|
+
CheckBoxInput.propTypes = {
|
|
84
|
+
checked: _propTypes.default.bool,
|
|
85
|
+
disabled: _propTypes.default.bool,
|
|
86
|
+
id: _propTypes.default.string.isRequired,
|
|
87
|
+
name: _propTypes.default.string,
|
|
88
|
+
onChange: _propTypes.default.func.isRequired,
|
|
89
|
+
contentOnly: _propTypes.default.bool,
|
|
90
|
+
hasErrors: _propTypes.default.bool,
|
|
91
|
+
theme: _propTypes.default.object,
|
|
92
|
+
checkmarkCharacter: _propTypes.default.string,
|
|
93
|
+
expandable: _propTypes.default.bool
|
|
94
|
+
};
|
|
95
|
+
CheckBoxInput.defaultProps = {
|
|
96
|
+
checked: false,
|
|
97
|
+
disabled: false,
|
|
98
|
+
name: '',
|
|
99
|
+
contentOnly: false,
|
|
100
|
+
hasErrors: false,
|
|
101
|
+
checkmarkCharacter: '✔',
|
|
102
|
+
expandable: false
|
|
103
|
+
};
|
|
104
|
+
var _default = CheckBoxInput;
|
|
105
105
|
exports.default = _default;
|
|
@@ -1,96 +1,102 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
|
-
var _theme = require("../functions/theme");
|
|
15
|
-
|
|
16
|
-
var _RadioButtonIconModule = _interopRequireDefault(require("./RadioButtonIcon.module.scss"));
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
-
|
|
22
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
-
|
|
24
|
-
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; }
|
|
25
|
-
|
|
26
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
27
|
-
|
|
28
|
-
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); } }
|
|
29
|
-
|
|
30
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
31
|
-
|
|
32
|
-
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
33
|
-
|
|
34
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
35
|
-
|
|
36
|
-
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); }; }
|
|
37
|
-
|
|
38
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
39
|
-
|
|
40
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
41
|
-
|
|
42
|
-
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; } }
|
|
43
|
-
|
|
44
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
|
-
|
|
46
|
-
var RadioButtonIcon = /*#__PURE__*/function (_React$Component) {
|
|
47
|
-
_inherits(RadioButtonIcon, _React$Component);
|
|
48
|
-
|
|
49
|
-
var _super = _createSuper(RadioButtonIcon);
|
|
50
|
-
|
|
51
|
-
function RadioButtonIcon() {
|
|
52
|
-
_classCallCheck(this, RadioButtonIcon);
|
|
53
|
-
|
|
54
|
-
return _super.apply(this, arguments);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
_createClass(RadioButtonIcon, [{
|
|
58
|
-
key: "render",
|
|
59
|
-
value: function render() {
|
|
60
|
-
var inlineStyle = {
|
|
61
|
-
height: this.props.size,
|
|
62
|
-
width: this.props.size
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
if (this.props.theme && this.props.checked) {
|
|
66
|
-
inlineStyle = _objectSpread(_objectSpread({}, inlineStyle), {}, {
|
|
67
|
-
background: (0, _theme.getThemePaletteBackgroundColor)(this.props.theme, 'primary'),
|
|
68
|
-
boxShadow: "0 0 0 1px ".concat((0, _theme.getThemePaletteBackgroundColor)(this.props.theme, 'primary'))
|
|
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
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _theme = require("../functions/theme");
|
|
15
|
+
|
|
16
|
+
var _RadioButtonIconModule = _interopRequireDefault(require("./RadioButtonIcon.module.scss"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21
|
+
|
|
22
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
23
|
+
|
|
24
|
+
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; }
|
|
25
|
+
|
|
26
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
27
|
+
|
|
28
|
+
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); } }
|
|
29
|
+
|
|
30
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
31
|
+
|
|
32
|
+
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
33
|
+
|
|
34
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
35
|
+
|
|
36
|
+
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); }; }
|
|
37
|
+
|
|
38
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
39
|
+
|
|
40
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
41
|
+
|
|
42
|
+
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; } }
|
|
43
|
+
|
|
44
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
45
|
+
|
|
46
|
+
var RadioButtonIcon = /*#__PURE__*/function (_React$Component) {
|
|
47
|
+
_inherits(RadioButtonIcon, _React$Component);
|
|
48
|
+
|
|
49
|
+
var _super = _createSuper(RadioButtonIcon);
|
|
50
|
+
|
|
51
|
+
function RadioButtonIcon() {
|
|
52
|
+
_classCallCheck(this, RadioButtonIcon);
|
|
53
|
+
|
|
54
|
+
return _super.apply(this, arguments);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
_createClass(RadioButtonIcon, [{
|
|
58
|
+
key: "render",
|
|
59
|
+
value: function render() {
|
|
60
|
+
var inlineStyle = {
|
|
61
|
+
height: this.props.size,
|
|
62
|
+
width: this.props.size
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
if (this.props.theme && this.props.checked) {
|
|
66
|
+
inlineStyle = _objectSpread(_objectSpread({}, inlineStyle), {}, {
|
|
67
|
+
background: (0, _theme.getThemePaletteBackgroundColor)(this.props.theme, 'primary'),
|
|
68
|
+
boxShadow: "0 0 0 1px ".concat((0, _theme.getThemePaletteBackgroundColor)(this.props.theme, 'primary'))
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
var ariaExpandedIndex = "aria-expanded";
|
|
73
|
+
|
|
74
|
+
var props = _defineProperty({
|
|
75
|
+
className: "".concat(_RadioButtonIconModule.default.radioButtonIcon, " ").concat(this.props.checked ? _RadioButtonIconModule.default.checked : '', " ").concat(this.props.disabled ? _RadioButtonIconModule.default.disabled : '', " ").concat(this.props.hasErrors ? _RadioButtonIconModule.default.hasErrors : ''),
|
|
76
|
+
style: inlineStyle
|
|
77
|
+
}, ariaExpandedIndex, this.props.expandable ? this.props.checked.toString() : null);
|
|
78
|
+
|
|
79
|
+
return /*#__PURE__*/_react.default.createElement("span", props);
|
|
80
|
+
}
|
|
81
|
+
}]);
|
|
82
|
+
|
|
83
|
+
return RadioButtonIcon;
|
|
84
|
+
}(_react.default.Component);
|
|
85
|
+
|
|
86
|
+
RadioButtonIcon.propTypes = {
|
|
87
|
+
size: _propTypes.default.string,
|
|
88
|
+
checked: _propTypes.default.bool,
|
|
89
|
+
disabled: _propTypes.default.bool,
|
|
90
|
+
theme: _propTypes.default.object,
|
|
91
|
+
hasErrors: _propTypes.default.bool,
|
|
92
|
+
expandable: _propTypes.default.bool
|
|
93
|
+
};
|
|
94
|
+
RadioButtonIcon.defaultProps = {
|
|
95
|
+
size: '10px',
|
|
96
|
+
checked: false,
|
|
97
|
+
disabled: false,
|
|
98
|
+
hasErrors: false,
|
|
99
|
+
expandable: false
|
|
100
|
+
};
|
|
101
|
+
var _default = RadioButtonIcon;
|
|
96
102
|
exports.default = _default;
|
|
@@ -1,95 +1,98 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _react = _interopRequireDefault(require("react"));
|
|
11
|
-
|
|
12
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
-
|
|
14
|
-
var _RadioButtonIcon = _interopRequireDefault(require("./RadioButtonIcon"));
|
|
15
|
-
|
|
16
|
-
var _RadioButtonInputModule = _interopRequireDefault(require("./RadioButtonInput.module.scss"));
|
|
17
|
-
|
|
18
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
|
|
20
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21
|
-
|
|
22
|
-
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); } }
|
|
23
|
-
|
|
24
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
|
-
|
|
26
|
-
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
|
-
|
|
28
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
-
|
|
30
|
-
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); }; }
|
|
31
|
-
|
|
32
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
33
|
-
|
|
34
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
35
|
-
|
|
36
|
-
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; } }
|
|
37
|
-
|
|
38
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
|
-
|
|
40
|
-
var RadioButtonInput = /*#__PURE__*/function (_React$Component) {
|
|
41
|
-
_inherits(RadioButtonInput, _React$Component);
|
|
42
|
-
|
|
43
|
-
var _super = _createSuper(RadioButtonInput);
|
|
44
|
-
|
|
45
|
-
function RadioButtonInput() {
|
|
46
|
-
_classCallCheck(this, RadioButtonInput);
|
|
47
|
-
|
|
48
|
-
return _super.apply(this, arguments);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
_createClass(RadioButtonInput, [{
|
|
52
|
-
key: "render",
|
|
53
|
-
value: function render() {
|
|
54
|
-
return /*#__PURE__*/_react.default.createElement("label", {
|
|
55
|
-
htmlFor: this.props.id,
|
|
56
|
-
className: "".concat(_RadioButtonInputModule.default.radioButtonInput, " ").concat(this.props.checked ? _RadioButtonInputModule.default.checked : '', " ").concat(this.props.disabled ? _RadioButtonInputModule.default.disabled : '', " ").concat(this.props.hasErrors ? _RadioButtonInputModule.default.hasErrors : '')
|
|
57
|
-
}, !this.props.contentOnly ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_RadioButtonIcon.default, {
|
|
58
|
-
checked: this.props.checked,
|
|
59
|
-
disabled: this.props.disabled,
|
|
60
|
-
theme: this.props.theme,
|
|
61
|
-
hasErrors: this.props.hasErrors
|
|
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
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
13
|
+
|
|
14
|
+
var _RadioButtonIcon = _interopRequireDefault(require("./RadioButtonIcon"));
|
|
15
|
+
|
|
16
|
+
var _RadioButtonInputModule = _interopRequireDefault(require("./RadioButtonInput.module.scss"));
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
20
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
21
|
+
|
|
22
|
+
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); } }
|
|
23
|
+
|
|
24
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
25
|
+
|
|
26
|
+
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
|
+
|
|
28
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
+
|
|
30
|
+
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); }; }
|
|
31
|
+
|
|
32
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
33
|
+
|
|
34
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
35
|
+
|
|
36
|
+
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; } }
|
|
37
|
+
|
|
38
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
39
|
+
|
|
40
|
+
var RadioButtonInput = /*#__PURE__*/function (_React$Component) {
|
|
41
|
+
_inherits(RadioButtonInput, _React$Component);
|
|
42
|
+
|
|
43
|
+
var _super = _createSuper(RadioButtonInput);
|
|
44
|
+
|
|
45
|
+
function RadioButtonInput() {
|
|
46
|
+
_classCallCheck(this, RadioButtonInput);
|
|
47
|
+
|
|
48
|
+
return _super.apply(this, arguments);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
_createClass(RadioButtonInput, [{
|
|
52
|
+
key: "render",
|
|
53
|
+
value: function render() {
|
|
54
|
+
return /*#__PURE__*/_react.default.createElement("label", {
|
|
55
|
+
htmlFor: this.props.id,
|
|
56
|
+
className: "".concat(_RadioButtonInputModule.default.radioButtonInput, " ").concat(this.props.checked ? _RadioButtonInputModule.default.checked : '', " ").concat(this.props.disabled ? _RadioButtonInputModule.default.disabled : '', " ").concat(this.props.hasErrors ? _RadioButtonInputModule.default.hasErrors : '')
|
|
57
|
+
}, !this.props.contentOnly ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_RadioButtonIcon.default, {
|
|
58
|
+
checked: this.props.checked,
|
|
59
|
+
disabled: this.props.disabled,
|
|
60
|
+
theme: this.props.theme,
|
|
61
|
+
hasErrors: this.props.hasErrors,
|
|
62
|
+
expandable: this.props.expandable
|
|
63
|
+
}), /*#__PURE__*/_react.default.createElement("input", {
|
|
64
|
+
type: "radio",
|
|
65
|
+
onChange: this.props.onChange,
|
|
66
|
+
id: this.props.id,
|
|
67
|
+
name: this.props.name,
|
|
68
|
+
value: this.props.inputValue,
|
|
69
|
+
checked: this.props.checked
|
|
70
|
+
})) : '', /*#__PURE__*/_react.default.createElement("span", null, this.props.children));
|
|
71
|
+
}
|
|
72
|
+
}]);
|
|
73
|
+
|
|
74
|
+
return RadioButtonInput;
|
|
75
|
+
}(_react.default.Component);
|
|
76
|
+
|
|
77
|
+
RadioButtonInput.propTypes = {
|
|
78
|
+
checked: _propTypes.default.bool,
|
|
79
|
+
disabled: _propTypes.default.bool,
|
|
80
|
+
inputValue: _propTypes.default.string.isRequired,
|
|
81
|
+
name: _propTypes.default.string,
|
|
82
|
+
id: _propTypes.default.string.isRequired,
|
|
83
|
+
onChange: _propTypes.default.func,
|
|
84
|
+
contentOnly: _propTypes.default.bool,
|
|
85
|
+
theme: _propTypes.default.object,
|
|
86
|
+
hasErrors: _propTypes.default.bool,
|
|
87
|
+
expandable: _propTypes.default.bool
|
|
88
|
+
};
|
|
89
|
+
RadioButtonInput.defaultProps = {
|
|
90
|
+
name: '',
|
|
91
|
+
checked: false,
|
|
92
|
+
disabled: false,
|
|
93
|
+
contentOnly: false,
|
|
94
|
+
hasErrors: false,
|
|
95
|
+
expandable: false
|
|
96
|
+
};
|
|
97
|
+
var _default = RadioButtonInput;
|
|
95
98
|
exports.default = _default;
|
|
@@ -6,6 +6,8 @@ Radio button input example:
|
|
|
6
6
|
<RadioButtonInput onChange={()=>{console.log('onchange')}} inputValue="value 2" name="radio-button-input" id="radio-button-input-2"><span>Unchecked radio button</span></RadioButtonInput>
|
|
7
7
|
<RadioButtonInput onChange={()=>{console.log('onchange')}} inputValue="value 1" name="radio-button-input" id="radio-button-input-3" checked={true} disabled={true}><span>Checked disabled radio button</span></RadioButtonInput>
|
|
8
8
|
<RadioButtonInput onChange={()=>{console.log('onchange')}} inputValue="value 2" name="radio-button-input" id="radio-button-input-4" disabled={true}><span>Unchecked disabled radio button</span></RadioButtonInput>
|
|
9
|
+
<RadioButtonInput onChange={()=>{console.log('onchange')}} inputValue="value 2" name="radio-button-input" id="radio-button-input-4" checked={false} expandable={true}><span>Unchecked expandable radio button </span></RadioButtonInput>
|
|
10
|
+
<RadioButtonInput onChange={()=>{console.log('onchange')}} inputValue="value 2" name="radio-button-input" id="radio-button-input-4" checked={true} expandable={true}><span>Checked expandable radio button </span></RadioButtonInput>
|
|
9
11
|
</div>
|
|
10
12
|
```
|
|
11
13
|
|