hair-ui
Version:
A Minimalist Component Library For React.
27 lines (26 loc) • 1.59 kB
JavaScript
;
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) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Input = void 0;
var jsx_runtime_1 = require("react/jsx-runtime");
var classnames_1 = __importDefault(require("classnames"));
function Input(_a) {
var _b = _a.type, type = _b === void 0 ? "text" : _b, _c = _a.disabled, disabled = _c === void 0 ? false : _c, _d = _a.isClean, isClean = _d === void 0 ? false : _d, placeholder = _a.placeholder, style = _a.style, onChange = _a.onChange, props = __rest(_a, ["type", "disabled", "isClean", "placeholder", "style", "onChange"]);
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)("input", { type: type, disabled: disabled, className: (0, classnames_1.default)("input", { "input-disabled": disabled }), placeholder: placeholder, style: style, onChange: function (e) {
!disabled && onChange && onChange(e);
} }, void 0) }, void 0));
}
exports.Input = Input;