linear-react-components-ui 1.1.2-beta.1 → 1.1.2-beta.2
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/lib/checkbox/index.d.ts +2 -2
- package/lib/checkbox/index.js +5 -4
- package/package.json +1 -1
package/lib/checkbox/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
1
2
|
import { ICheckBoxProps } from './types.js';
|
|
2
|
-
import 'react';
|
|
3
3
|
import '../@types/PermissionAttr.js';
|
|
4
4
|
import '../@types/Position.js';
|
|
5
5
|
|
|
@@ -8,6 +8,6 @@ import '../@types/Position.js';
|
|
|
8
8
|
* o componente Field dentro do componente Form, pois o mesmo leva em consideração o tipo do
|
|
9
9
|
* componente para gerar propriedades customizadas.
|
|
10
10
|
*/
|
|
11
|
-
declare const CheckBox:
|
|
11
|
+
declare const CheckBox: React__default.ForwardRefExoticComponent<ICheckBoxProps & React__default.RefAttributes<HTMLInputElement>>;
|
|
12
12
|
|
|
13
13
|
export { CheckBox as default };
|
package/lib/checkbox/index.js
CHANGED
|
@@ -20,7 +20,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
20
20
|
* componente para gerar propriedades customizadas.
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
const CheckBox = _ref => {
|
|
23
|
+
const CheckBox = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
24
24
|
let {
|
|
25
25
|
name,
|
|
26
26
|
required,
|
|
@@ -44,6 +44,7 @@ const CheckBox = _ref => {
|
|
|
44
44
|
const options = [_permissionValidations.OPTIONS_ON_DENIED.disabled, _permissionValidations.OPTIONS_ON_DENIED.unvisible];
|
|
45
45
|
const [onDenied] = (0, _react.useState)((0, _permissionValidations.actionsOnPermissionDenied)(options, permissionAttr));
|
|
46
46
|
const inputRef = (0, _react.useRef)(null);
|
|
47
|
+
(0, _react.useImperativeHandle)(ref, () => inputRef.current, [inputRef.current]);
|
|
47
48
|
(0, _react.useEffect)(() => {
|
|
48
49
|
setIsChecked(checked);
|
|
49
50
|
}, [checked]);
|
|
@@ -75,8 +76,7 @@ const CheckBox = _ref => {
|
|
|
75
76
|
onClick: !shouldDisable() && !skeletonize ? () => setIsChecked(!isChecked) : undefined,
|
|
76
77
|
tabIndex: -1,
|
|
77
78
|
role: "checkbox",
|
|
78
|
-
"aria-checked": "false"
|
|
79
|
-
onKeyPress: undefined
|
|
79
|
+
"aria-checked": "false"
|
|
80
80
|
}, /*#__PURE__*/_react.default.createElement("input", {
|
|
81
81
|
ref: r => {
|
|
82
82
|
if (targetRef) targetRef(r);
|
|
@@ -107,5 +107,6 @@ const CheckBox = _ref => {
|
|
|
107
107
|
customClass: "-withinput",
|
|
108
108
|
cols: gridLayout
|
|
109
109
|
}, renderInput()) : renderInput();
|
|
110
|
-
};
|
|
110
|
+
});
|
|
111
|
+
CheckBox.displayName = 'CheckBox';
|
|
111
112
|
var _default = exports.default = CheckBox;
|