dibk-design 0.4.29 → 0.4.33
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/dist/components/Accordion.js +77 -39
- package/dist/components/Button.js +75 -31
- package/dist/components/CheckBoxIcon.js +64 -20
- package/dist/components/CheckBoxIcon.md +13 -4
- package/dist/components/CheckBoxIcon.module.scss +7 -0
- package/dist/components/CheckBoxInput.js +63 -22
- package/dist/components/CheckBoxInput.md +14 -8
- package/dist/components/CheckBoxInput.module.scss +4 -1
- package/dist/components/CheckBoxListItem.js +55 -16
- package/dist/components/CheckBoxListItem.md +20 -5
- package/dist/components/CheckBoxListItem.module.scss +8 -2
- package/dist/components/ContentBox.js +67 -30
- package/dist/components/Dialog.js +98 -57
- package/dist/components/DragAndDropFileInput.js +140 -90
- package/dist/components/Footer.js +44 -8
- package/dist/components/Header.js +47 -11
- package/dist/components/InputField.js +127 -78
- package/dist/components/Label.js +53 -11
- package/dist/components/List.js +72 -21
- package/dist/components/LoadingAnimation.js +42 -6
- package/dist/components/NavigationBar.js +179 -126
- package/dist/components/NavigationBarListItem.js +59 -22
- package/dist/components/Paper.js +42 -6
- package/dist/components/RadioButtonIcon.js +63 -19
- package/dist/components/RadioButtonIcon.md +7 -1
- package/dist/components/RadioButtonIcon.module.scss +9 -1
- package/dist/components/RadioButtonInput.js +56 -17
- package/dist/components/RadioButtonInput.md +8 -0
- package/dist/components/RadioButtonInput.module.scss +7 -0
- package/dist/components/RadioButtonListItem.js +52 -13
- package/dist/components/RadioButtonListItem.md +21 -3
- package/dist/components/RadioButtonListItem.module.scss +8 -2
- package/dist/components/Select.js +142 -100
- package/dist/components/Textarea.js +91 -52
- package/dist/components/Theme.js +98 -55
- package/dist/components/WizardNavigation/Step.js +72 -35
- package/dist/components/WizardNavigation.js +59 -25
- package/dist/functions/theme.js +10 -10
- package/dist/index.js +24 -24
- package/package.json +1 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
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
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -13,52 +15,88 @@ var _AccordionModule = _interopRequireDefault(require("./Accordion.module.scss")
|
|
|
13
15
|
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
17
|
|
|
16
|
-
class
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
19
|
+
|
|
20
|
+
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); } }
|
|
21
|
+
|
|
22
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
23
|
+
|
|
24
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
25
|
+
|
|
26
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
27
|
+
|
|
28
|
+
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); }; }
|
|
29
|
+
|
|
30
|
+
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); }
|
|
31
|
+
|
|
32
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
33
|
+
|
|
34
|
+
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; } }
|
|
35
|
+
|
|
36
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
37
|
+
|
|
38
|
+
var Accordion = /*#__PURE__*/function (_React$Component) {
|
|
39
|
+
_inherits(Accordion, _React$Component);
|
|
25
40
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
41
|
+
var _super = _createSuper(Accordion);
|
|
42
|
+
|
|
43
|
+
function Accordion(props) {
|
|
44
|
+
var _this;
|
|
45
|
+
|
|
46
|
+
_classCallCheck(this, Accordion);
|
|
47
|
+
|
|
48
|
+
_this = _super.call(this, props);
|
|
49
|
+
_this.state = {
|
|
50
|
+
expanded: _this.props.expanded,
|
|
51
|
+
initialized: _this.props.expanded
|
|
52
|
+
};
|
|
53
|
+
_this.handleToggleExpand = _this.handleToggleExpand.bind(_assertThisInitialized(_this));
|
|
54
|
+
return _this;
|
|
31
55
|
}
|
|
32
56
|
|
|
33
|
-
|
|
34
|
-
|
|
57
|
+
_createClass(Accordion, [{
|
|
58
|
+
key: "handleToggleExpand",
|
|
59
|
+
value: function handleToggleExpand() {
|
|
35
60
|
this.setState({
|
|
36
|
-
expanded: this.
|
|
61
|
+
expanded: !this.state.expanded,
|
|
62
|
+
initialized: true
|
|
37
63
|
});
|
|
38
64
|
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
65
|
+
}, {
|
|
66
|
+
key: "componentDidUpdate",
|
|
67
|
+
value: function componentDidUpdate(prevProps) {
|
|
68
|
+
if (this.props.expanded !== prevProps.expanded) {
|
|
69
|
+
this.setState({
|
|
70
|
+
expanded: this.props.expanded
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
key: "renderPanel",
|
|
76
|
+
value: function renderPanel() {
|
|
77
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
78
|
+
className: _AccordionModule.default.panel,
|
|
79
|
+
onClick: this.handleToggleExpand
|
|
80
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
81
|
+
className: _AccordionModule.default.panelText
|
|
82
|
+
}, this.props.title), /*#__PURE__*/_react.default.createElement("span", {
|
|
83
|
+
className: "".concat(_AccordionModule.default.panelChevron, " ").concat(this.state.expanded ? _AccordionModule.default.expanded : '')
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
key: "render",
|
|
88
|
+
value: function render() {
|
|
89
|
+
var className = "".concat(_AccordionModule.default.accordion, " ").concat(this.props.color ? _AccordionModule.default[this.props.color] : '');
|
|
90
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
91
|
+
className: className
|
|
92
|
+
}, this.renderPanel(), /*#__PURE__*/_react.default.createElement("div", {
|
|
93
|
+
className: "".concat(_AccordionModule.default.content, " ").concat(this.state.initialized ? _AccordionModule.default.initialized : '', " ").concat(this.state.expanded ? _AccordionModule.default.expanded : '')
|
|
94
|
+
}, this.props.children));
|
|
95
|
+
}
|
|
96
|
+
}]);
|
|
60
97
|
|
|
61
|
-
|
|
98
|
+
return Accordion;
|
|
99
|
+
}(_react.default.Component);
|
|
62
100
|
|
|
63
101
|
Accordion.propTypes = {
|
|
64
102
|
/** Content title inside box */
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
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
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -17,43 +19,85 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
17
19
|
|
|
18
20
|
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); }
|
|
19
21
|
|
|
20
|
-
|
|
21
|
-
getArrowClass() {
|
|
22
|
-
switch (this.props.arrow) {
|
|
23
|
-
case 'left':
|
|
24
|
-
return _ButtonModule.default.hasArrowLeft;
|
|
22
|
+
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; }
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
return _ButtonModule.default.hasArrowRight;
|
|
24
|
+
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; }
|
|
28
25
|
|
|
29
|
-
|
|
30
|
-
return '';
|
|
31
|
-
}
|
|
32
|
-
}
|
|
26
|
+
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; }
|
|
33
27
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
29
|
+
|
|
30
|
+
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); } }
|
|
31
|
+
|
|
32
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
33
|
+
|
|
34
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
35
|
+
|
|
36
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
37
|
+
|
|
38
|
+
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); }; }
|
|
39
|
+
|
|
40
|
+
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); }
|
|
41
|
+
|
|
42
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
43
|
+
|
|
44
|
+
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; } }
|
|
42
45
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
47
|
+
|
|
48
|
+
var Button = /*#__PURE__*/function (_React$Component) {
|
|
49
|
+
_inherits(Button, _React$Component);
|
|
50
|
+
|
|
51
|
+
var _super = _createSuper(Button);
|
|
52
|
+
|
|
53
|
+
function Button() {
|
|
54
|
+
_classCallCheck(this, Button);
|
|
55
|
+
|
|
56
|
+
return _super.apply(this, arguments);
|
|
54
57
|
}
|
|
55
58
|
|
|
56
|
-
|
|
59
|
+
_createClass(Button, [{
|
|
60
|
+
key: "getArrowClass",
|
|
61
|
+
value: function getArrowClass() {
|
|
62
|
+
switch (this.props.arrow) {
|
|
63
|
+
case 'left':
|
|
64
|
+
return _ButtonModule.default.hasArrowLeft;
|
|
65
|
+
|
|
66
|
+
case 'right':
|
|
67
|
+
return _ButtonModule.default.hasArrowRight;
|
|
68
|
+
|
|
69
|
+
default:
|
|
70
|
+
return '';
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}, {
|
|
74
|
+
key: "getThemeStyle",
|
|
75
|
+
value: function getThemeStyle(theme, color) {
|
|
76
|
+
return {
|
|
77
|
+
backgroundColor: (0, _theme.getThemePaletteBackgroundColor)(theme, color),
|
|
78
|
+
color: (0, _theme.getThemePaletteTextColor)(theme, color),
|
|
79
|
+
borderColor: (0, _theme.getThemePaletteBorderColor)(theme, color),
|
|
80
|
+
borderWidth: (0, _theme.getThemePaletteBorderColor)(theme, color) ? '1px' : '0'
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
}, {
|
|
84
|
+
key: "render",
|
|
85
|
+
value: function render() {
|
|
86
|
+
var buttonProps = _objectSpread({}, this.props);
|
|
87
|
+
|
|
88
|
+
delete buttonProps.noHover;
|
|
89
|
+
delete buttonProps.rounded;
|
|
90
|
+
var themeStyle = this.props.theme ? this.getThemeStyle(this.props.theme, this.props.color) : null;
|
|
91
|
+
var className = "".concat(_ButtonModule.default.button, " ").concat(_ButtonModule.default[this.props.color], " ").concat(_ButtonModule.default[this.props.size], " ").concat(this.getArrowClass(), " ").concat(this.props.theme ? _ButtonModule.default.hasTheme : '', " ").concat(this.props.noHover ? _ButtonModule.default.noHover : '', " ").concat(this.props.rounded ? _ButtonModule.default.rounded : '');
|
|
92
|
+
return /*#__PURE__*/_react.default.createElement("button", _extends({}, buttonProps, {
|
|
93
|
+
className: className,
|
|
94
|
+
style: themeStyle
|
|
95
|
+
}), this.props.content);
|
|
96
|
+
}
|
|
97
|
+
}]);
|
|
98
|
+
|
|
99
|
+
return Button;
|
|
100
|
+
}(_react.default.Component);
|
|
57
101
|
|
|
58
102
|
Button.propTypes = {
|
|
59
103
|
/** Text content inside button */
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
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
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -15,35 +17,76 @@ var _CheckBoxIconModule = _interopRequireDefault(require("./CheckBoxIcon.module.
|
|
|
15
17
|
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
render() {
|
|
20
|
-
let inlineStyle = {
|
|
21
|
-
height: this.props.size,
|
|
22
|
-
width: this.props.size,
|
|
23
|
-
fontSize: this.props.size
|
|
24
|
-
};
|
|
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; }
|
|
25
21
|
|
|
26
|
-
|
|
27
|
-
inlineStyle = { ...inlineStyle,
|
|
28
|
-
color: (0, _theme.getThemePaletteBackgroundColor)(this.props.theme, 'primary'),
|
|
29
|
-
boxShadow: "0 0 0 1px ".concat((0, _theme.getThemePaletteBackgroundColor)(this.props.theme, 'primary')) // TODO: support theme error color
|
|
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; }
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
|
|
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"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), 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; }
|
|
33
41
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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);
|
|
40
55
|
}
|
|
41
56
|
|
|
42
|
-
|
|
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
|
+
return /*#__PURE__*/_react.default.createElement("span", {
|
|
75
|
+
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 : ''),
|
|
76
|
+
style: inlineStyle
|
|
77
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
78
|
+
className: _CheckBoxIconModule.default.checkmark
|
|
79
|
+
}, this.props.checked ? this.props.checkmarkCharacter : ''));
|
|
80
|
+
}
|
|
81
|
+
}]);
|
|
82
|
+
|
|
83
|
+
return CheckBoxIcon;
|
|
84
|
+
}(_react.default.Component);
|
|
43
85
|
|
|
44
86
|
CheckBoxIcon.propTypes = {
|
|
45
87
|
size: _propTypes.default.string,
|
|
46
88
|
checked: _propTypes.default.bool,
|
|
89
|
+
disabled: _propTypes.default.bool,
|
|
47
90
|
showBox: _propTypes.default.bool,
|
|
48
91
|
theme: _propTypes.default.object,
|
|
49
92
|
hasErrors: _propTypes.default.bool,
|
|
@@ -52,6 +95,7 @@ CheckBoxIcon.propTypes = {
|
|
|
52
95
|
CheckBoxIcon.defaultProps = {
|
|
53
96
|
size: '20px',
|
|
54
97
|
checked: false,
|
|
98
|
+
disabled: false,
|
|
55
99
|
showBox: true,
|
|
56
100
|
hasErrors: false,
|
|
57
101
|
checkmarkCharacter: '✔'
|
|
@@ -4,6 +4,9 @@ Regular check box icons example:
|
|
|
4
4
|
<CheckBoxIcon />
|
|
5
5
|
<CheckBoxIcon checked={true} />
|
|
6
6
|
<CheckBoxIcon checked={true} checkmarkCharacter="✕" />
|
|
7
|
+
<CheckBoxIcon disabled={true} />
|
|
8
|
+
<CheckBoxIcon checked={true} disabled={true} />
|
|
9
|
+
<CheckBoxIcon checked={true} checkmarkCharacter="✕" disabled={true} />
|
|
7
10
|
```
|
|
8
11
|
|
|
9
12
|
Themed Regular check box icons example:
|
|
@@ -11,18 +14,24 @@ Themed Regular check box icons example:
|
|
|
11
14
|
```js
|
|
12
15
|
import customTheme from 'data/customTheme';
|
|
13
16
|
<React.Fragment>
|
|
14
|
-
<CheckBoxIcon
|
|
15
|
-
<CheckBoxIcon checked={true}
|
|
16
|
-
<CheckBoxIcon checked={true}
|
|
17
|
+
<CheckBoxIcon size='43px' />
|
|
18
|
+
<CheckBoxIcon size='43px' checked={true} />
|
|
19
|
+
<CheckBoxIcon size='43px' checked={true} checkmarkCharacter="✕" />
|
|
20
|
+
<CheckBoxIcon size='43px' disabled={true} />
|
|
21
|
+
<CheckBoxIcon size='43px' checked={true} disabled={true} />
|
|
22
|
+
<CheckBoxIcon size='43px' checked={true} checkmarkCharacter="✕" disabled={true} />
|
|
17
23
|
</React.Fragment>
|
|
18
24
|
```
|
|
19
25
|
|
|
20
26
|
Check box icons with custom size example:
|
|
21
27
|
|
|
22
28
|
```js
|
|
23
|
-
<CheckBoxIcon size='43px'
|
|
29
|
+
<CheckBoxIcon size='43px' />
|
|
24
30
|
<CheckBoxIcon size='43px' checked={true} />
|
|
25
31
|
<CheckBoxIcon size='43px' checked={true} checkmarkCharacter="✕" />
|
|
32
|
+
<CheckBoxIcon size='43px' disabled={true} />
|
|
33
|
+
<CheckBoxIcon size='43px' checked={true} disabled={true} />
|
|
34
|
+
<CheckBoxIcon size='43px' checked={true} checkmarkCharacter="✕" disabled={true} />
|
|
26
35
|
```
|
|
27
36
|
|
|
28
37
|
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
margin-right: 0.2em;
|
|
14
14
|
line-height: 1;
|
|
15
15
|
text-align: center;
|
|
16
|
+
cursor: pointer;
|
|
16
17
|
|
|
17
18
|
&:local(.showBox) {
|
|
18
19
|
margin-right: 0.4em;
|
|
@@ -38,6 +39,12 @@
|
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
|
|
42
|
+
&:local(.disabled) {
|
|
43
|
+
opacity: 0.5;
|
|
44
|
+
background: rgba(0, 0, 0, 0.25);
|
|
45
|
+
cursor: default;
|
|
46
|
+
}
|
|
47
|
+
|
|
41
48
|
:local(.checkmark) {
|
|
42
49
|
font-size: 1em;
|
|
43
50
|
line-height: 0.75em;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
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
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
@@ -15,33 +17,71 @@ var _CheckBoxInputModule = _interopRequireDefault(require("./CheckBoxInput.modul
|
|
|
15
17
|
|
|
16
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
19
|
|
|
18
|
-
class
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), 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);
|
|
39
49
|
}
|
|
40
50
|
|
|
41
|
-
|
|
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
|
+
}), /*#__PURE__*/_react.default.createElement("input", {
|
|
64
|
+
onChange: this.props.onChange,
|
|
65
|
+
type: "checkbox",
|
|
66
|
+
name: this.props.name,
|
|
67
|
+
id: this.props.id,
|
|
68
|
+
checked: this.props.checked,
|
|
69
|
+
disabled: this.props.disabled
|
|
70
|
+
})) : /*#__PURE__*/_react.default.createElement(_CheckBoxIcon.default, {
|
|
71
|
+
checked: this.props.checked,
|
|
72
|
+
disabled: this.props.disabled,
|
|
73
|
+
showBox: false,
|
|
74
|
+
theme: this.props.theme
|
|
75
|
+
}), /*#__PURE__*/_react.default.createElement("span", null, this.props.children));
|
|
76
|
+
}
|
|
77
|
+
}]);
|
|
78
|
+
|
|
79
|
+
return CheckBoxInput;
|
|
80
|
+
}(_react.default.Component);
|
|
42
81
|
|
|
43
82
|
CheckBoxInput.propTypes = {
|
|
44
83
|
checked: _propTypes.default.bool,
|
|
84
|
+
disabled: _propTypes.default.bool,
|
|
45
85
|
id: _propTypes.default.string.isRequired,
|
|
46
86
|
name: _propTypes.default.string,
|
|
47
87
|
onChange: _propTypes.default.func.isRequired,
|
|
@@ -52,6 +92,7 @@ CheckBoxInput.propTypes = {
|
|
|
52
92
|
};
|
|
53
93
|
CheckBoxInput.defaultProps = {
|
|
54
94
|
checked: false,
|
|
95
|
+
disabled: false,
|
|
55
96
|
name: '',
|
|
56
97
|
contentOnly: false,
|
|
57
98
|
hasErrors: false,
|
|
@@ -5,16 +5,19 @@ Checkbox input example:
|
|
|
5
5
|
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="checkbox" id="checkBoxInput-1" checked={true}>
|
|
6
6
|
<span>Label for checked checkbox</span>
|
|
7
7
|
</CheckBoxInput>
|
|
8
|
-
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="checkbox" id="checkBoxInput-2">
|
|
8
|
+
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="checkbox" id="checkBoxInput-2" checked={true} disabled={true}>
|
|
9
|
+
<span>Label for checked disabled checkbox</span>
|
|
10
|
+
</CheckBoxInput>
|
|
11
|
+
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="checkbox" id="checkBoxInput-3">
|
|
9
12
|
<span>Label for unchecked checkbox</span>
|
|
10
13
|
</CheckBoxInput>
|
|
11
|
-
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="checkbox" id="checkBoxInput-
|
|
14
|
+
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="checkbox" id="checkBoxInput-4" checked={true} contentOnly={true}>
|
|
12
15
|
<span>Checked checkbox with content only</span>
|
|
13
16
|
</CheckBoxInput>
|
|
14
|
-
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="checkbox" id="checkBoxInput-
|
|
17
|
+
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="checkbox" id="checkBoxInput-5" contentOnly={true}>
|
|
15
18
|
<span>Unchecked checkbox with content only</span>
|
|
16
19
|
</CheckBoxInput>
|
|
17
|
-
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="checkbox" id="checkBoxInput-
|
|
20
|
+
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="checkbox" id="checkBoxInput-6" checked={true} checkmarkCharacter="✕">
|
|
18
21
|
<span>Label for checked checkbox with custom checkmark</span>
|
|
19
22
|
</CheckBoxInput>
|
|
20
23
|
</div>
|
|
@@ -29,16 +32,19 @@ import customTheme from 'data/customTheme';
|
|
|
29
32
|
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="themed-checkbox" id="themed-checkBoxInput-1" checked={true} theme={customTheme}>
|
|
30
33
|
<span>Label for checked checkbox</span>
|
|
31
34
|
</CheckBoxInput>
|
|
32
|
-
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="themed-checkbox" id="themed-checkBoxInput-2" theme={customTheme}>
|
|
35
|
+
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="themed-checkbox" id="themed-checkBoxInput-2" checked={true} disabled={true} theme={customTheme}>
|
|
36
|
+
<span>Label for checked disabled checkbox</span>
|
|
37
|
+
</CheckBoxInput>
|
|
38
|
+
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="themed-checkbox" id="themed-checkBoxInput-3" theme={customTheme}>
|
|
33
39
|
<span>Label for unchecked checkbox</span>
|
|
34
40
|
</CheckBoxInput>
|
|
35
|
-
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="themed-checkbox" id="themed-checkBoxInput-
|
|
41
|
+
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="themed-checkbox" id="themed-checkBoxInput-4" checked={true} contentOnly={true} theme={customTheme}>
|
|
36
42
|
<span>Checked checkbox with content only</span>
|
|
37
43
|
</CheckBoxInput>
|
|
38
|
-
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="themed-checkbox" id="themed-checkBoxInput-
|
|
44
|
+
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="themed-checkbox" id="themed-checkBoxInput-5" contentOnly={true} theme={customTheme}>
|
|
39
45
|
<span>Unchecked checkbox with content only</span>
|
|
40
46
|
</CheckBoxInput>
|
|
41
|
-
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="checkbox" id="themed-checkBoxInput-
|
|
47
|
+
<CheckBoxInput onChange={()=>{console.log('onchange')}} name="checkbox" id="themed-checkBoxInput-6" checked={true} checkmarkCharacter="✕" theme={customTheme}>
|
|
42
48
|
<span>Label for checked checkbox with custom checkmark</span>
|
|
43
49
|
</CheckBoxInput>
|
|
44
50
|
</div>
|