tabler-react-2 0.1.144 → 0.1.146
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/input/checkbox.js +42 -0
- package/dist/input/index.js +11 -0
- package/docs/src/docs/changelog.mdx +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Checkbox = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
var Checkbox = exports.Checkbox = function Checkbox(_ref) {
|
|
11
|
+
var value = _ref.value,
|
|
12
|
+
_onChange = _ref.onChange,
|
|
13
|
+
label = _ref.label,
|
|
14
|
+
_ref$required = _ref.required,
|
|
15
|
+
required = _ref$required === void 0 ? false : _ref$required;
|
|
16
|
+
return /*#__PURE__*/_react["default"].createElement("label", {
|
|
17
|
+
className: "form-check",
|
|
18
|
+
style: {
|
|
19
|
+
display: "flex",
|
|
20
|
+
alignItems: "center",
|
|
21
|
+
gap: 8
|
|
22
|
+
}
|
|
23
|
+
}, /*#__PURE__*/_react["default"].createElement("input", {
|
|
24
|
+
className: "form-check-input",
|
|
25
|
+
type: "checkbox",
|
|
26
|
+
checked: value,
|
|
27
|
+
onChange: function onChange(e) {
|
|
28
|
+
return _onChange(e.target.checked);
|
|
29
|
+
}
|
|
30
|
+
}), /*#__PURE__*/_react["default"].createElement("span", {
|
|
31
|
+
className: "form-check-label ".concat(required ? "required" : ""),
|
|
32
|
+
style: {
|
|
33
|
+
textAlign: "left"
|
|
34
|
+
}
|
|
35
|
+
}, label));
|
|
36
|
+
};
|
|
37
|
+
Checkbox.propTypes = {
|
|
38
|
+
value: _propTypes["default"].bool.isRequired,
|
|
39
|
+
onChange: _propTypes["default"].func.isRequired,
|
|
40
|
+
label: _propTypes["default"].string.isRequired,
|
|
41
|
+
required: _propTypes["default"].bool
|
|
42
|
+
};
|
package/dist/input/index.js
CHANGED
|
@@ -57,4 +57,15 @@ Object.keys(_enclosedselectgroup).forEach(function (key) {
|
|
|
57
57
|
return _enclosedselectgroup[key];
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
+
});
|
|
61
|
+
var _checkbox = require("./checkbox");
|
|
62
|
+
Object.keys(_checkbox).forEach(function (key) {
|
|
63
|
+
if (key === "default" || key === "__esModule") return;
|
|
64
|
+
if (key in exports && exports[key] === _checkbox[key]) return;
|
|
65
|
+
Object.defineProperty(exports, key, {
|
|
66
|
+
enumerable: true,
|
|
67
|
+
get: function get() {
|
|
68
|
+
return _checkbox[key];
|
|
69
|
+
}
|
|
70
|
+
});
|
|
60
71
|
});
|
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
title: Changelog
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
+
# 0.1.146
|
|
6
|
+
|
|
7
|
+
- Added the Checkbox component.
|
|
8
|
+
|
|
9
|
+
# 0.1.144
|
|
10
|
+
|
|
11
|
+
- Fixed issue with `DropdownInput` component where the `key` prop was not being set correctly.
|
|
12
|
+
|
|
5
13
|
# 0.1.143
|
|
6
14
|
|
|
7
15
|
- Added `invalid` prop to the `DropdownInput` component.
|