@micromag/element-checkbox 0.3.531 → 0.3.547
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/package.json +4 -5
- package/lib/index.js +0 -64
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-checkbox",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.547",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -30,11 +30,10 @@
|
|
|
30
30
|
}
|
|
31
31
|
],
|
|
32
32
|
"license": "ISC",
|
|
33
|
-
"
|
|
33
|
+
"type": "module",
|
|
34
34
|
"module": "es/index.js",
|
|
35
35
|
"exports": {
|
|
36
36
|
".": {
|
|
37
|
-
"require": "./lib/index.js",
|
|
38
37
|
"import": "./es/index.js"
|
|
39
38
|
},
|
|
40
39
|
"./assets/css/styles": "./assets/css/styles.css",
|
|
@@ -60,7 +59,7 @@
|
|
|
60
59
|
},
|
|
61
60
|
"dependencies": {
|
|
62
61
|
"@babel/runtime": "^7.13.10",
|
|
63
|
-
"@micromag/core": "^0.3.
|
|
62
|
+
"@micromag/core": "^0.3.547",
|
|
64
63
|
"classnames": "^2.2.6",
|
|
65
64
|
"lodash": "^4.17.21",
|
|
66
65
|
"prop-types": "^15.7.2",
|
|
@@ -71,5 +70,5 @@
|
|
|
71
70
|
"access": "public",
|
|
72
71
|
"registry": "https://registry.npmjs.org/"
|
|
73
72
|
},
|
|
74
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "3c2f5904ce61fcfa61f673c38c2a5ec56e9e2b07"
|
|
75
74
|
}
|
package/lib/index.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
4
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
5
|
-
var classNames = require('classnames');
|
|
6
|
-
var PropTypes = require('prop-types');
|
|
7
|
-
var React = require('react');
|
|
8
|
-
var core = require('@micromag/core');
|
|
9
|
-
|
|
10
|
-
var styles = {"container":"micromag-element-checkbox-container","label":"micromag-element-checkbox-label","input":"micromag-element-checkbox-input"};
|
|
11
|
-
|
|
12
|
-
var propTypes = {
|
|
13
|
-
option: core.PropTypes.textElement,
|
|
14
|
-
value: PropTypes.bool,
|
|
15
|
-
onChange: PropTypes.func,
|
|
16
|
-
focusable: PropTypes.bool,
|
|
17
|
-
checkboxStyle: PropTypes.object,
|
|
18
|
-
// eslint-disable-line
|
|
19
|
-
className: PropTypes.string
|
|
20
|
-
};
|
|
21
|
-
var defaultProps = {
|
|
22
|
-
option: null,
|
|
23
|
-
value: null,
|
|
24
|
-
onChange: null,
|
|
25
|
-
focusable: true,
|
|
26
|
-
checkboxStyle: null,
|
|
27
|
-
className: null
|
|
28
|
-
};
|
|
29
|
-
var Checkbox = function Checkbox(_ref) {
|
|
30
|
-
var option = _ref.option,
|
|
31
|
-
value = _ref.value,
|
|
32
|
-
_onChange = _ref.onChange,
|
|
33
|
-
focusable = _ref.focusable,
|
|
34
|
-
checkboxStyle = _ref.checkboxStyle,
|
|
35
|
-
className = _ref.className;
|
|
36
|
-
var _ref2 = option || {},
|
|
37
|
-
_ref2$body = _ref2.body,
|
|
38
|
-
body = _ref2$body === void 0 ? null : _ref2$body;
|
|
39
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
40
|
-
className: classNames([styles.container, _defineProperty({}, className, className !== null)]),
|
|
41
|
-
style: _objectSpread({}, checkboxStyle)
|
|
42
|
-
}, /*#__PURE__*/React.createElement("label", {
|
|
43
|
-
className: classNames([styles.label, {
|
|
44
|
-
active: body === value
|
|
45
|
-
}])
|
|
46
|
-
}, /*#__PURE__*/React.createElement("input", {
|
|
47
|
-
className: styles.input,
|
|
48
|
-
type: "checkbox",
|
|
49
|
-
autoComplete: "off",
|
|
50
|
-
value: value === true,
|
|
51
|
-
checked: value === true,
|
|
52
|
-
tabIndex: focusable ? '0' : '-1',
|
|
53
|
-
onChange: function onChange() {
|
|
54
|
-
if (_onChange !== null) {
|
|
55
|
-
_onChange(!value);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}), body));
|
|
59
|
-
};
|
|
60
|
-
Checkbox.propTypes = propTypes;
|
|
61
|
-
Checkbox.defaultProps = defaultProps;
|
|
62
|
-
var Checkbox$1 = Checkbox;
|
|
63
|
-
|
|
64
|
-
module.exports = Checkbox$1;
|