react-mkx-toolkit
Advanced tools
Comparing version 1.2.0 to 1.2.1
"use strict"; | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -17,14 +6,5 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.useRowSelection = exports.Input = void 0; | ||
const react_1 = __importDefault(require("react")); | ||
const useRowSelection_1 = require("./useRowSelection"); | ||
Object.defineProperty(exports, "useRowSelection", { enumerable: true, get: function () { return useRowSelection_1.useRowSelection; } }); | ||
const Input = (_a) => { | ||
var { value, setValue } = _a, rest = __rest(_a, ["value", "setValue"]); | ||
const handleChange = (e) => { | ||
setValue(e.target.value); | ||
}; | ||
return react_1.default.createElement("input", Object.assign({ type: "text", value: value, onChange: handleChange }, rest)); | ||
}; | ||
exports.Input = Input; | ||
exports.useKeyboard = void 0; | ||
const useKeyboard_1 = __importDefault(require("useKeyboard")); | ||
exports.useKeyboard = useKeyboard_1.default; | ||
//# sourceMappingURL=index.js.map |
32
index.ts
@@ -1,30 +0,2 @@ | ||
import React, { ChangeEvent } from "react"; | ||
import { InputProps } from "./index.d"; | ||
import { useRowSelection } from "./useRowSelection"; | ||
/** | ||
* Input component. | ||
* @param {InputProps} props - The props for the Input component. | ||
* @returns {JSX.Element} The rendered Input component. | ||
*/ | ||
const Input: React.FC<InputProps> = ({ | ||
value, | ||
setValue, | ||
...rest | ||
}: InputProps): JSX.Element => { | ||
/** | ||
* Handles the change event of the input. | ||
* @param {ChangeEvent<HTMLInputElement>} e - The change event. | ||
*/ | ||
const handleChange = (e: ChangeEvent<HTMLInputElement>) => { | ||
setValue(e.target.value); | ||
}; | ||
return React.createElement("input", { | ||
type: "text", | ||
value: value, | ||
onChange: handleChange, | ||
...rest, | ||
}); | ||
}; | ||
export { Input, useRowSelection }; | ||
import useKeyboard from "useKeyboard"; | ||
export { useKeyboard }; |
{ | ||
"name": "react-mkx-toolkit", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "", | ||
@@ -9,5 +9,5 @@ "main": "./dist/index.js", | ||
"keywords": [ | ||
"react", | ||
"mkx", | ||
"custom component" | ||
"useKeyboard", | ||
"hotkeys", | ||
"keyboard" | ||
], | ||
@@ -14,0 +14,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
12
7760
137
1