jb-number-input
Version:
number input web component
33 lines (32 loc) • 949 B
JavaScript
import n, { forwardRef as e, useImperativeHandle as o, useRef as t } from "react";
import "jb-number-input";
import { useJBInputAttribute as r, useJBInputEvents as i } from "jb-input/react";
const u = e((e, u) => {
const a = t(null);
o(u, () => a.current ?? void 0, [a]);
const { disabled: l, initialValue: p, required: d, validationList: c, value: m, onBeforeinput: s, onBlur: b, onChange: f, onEnter: v, onFocus: y, onInput: B, onKeydown: g, onKeyup: h, children: K, ...j } = e;
return r(a, {
disabled: l,
required: d,
validationList: c,
...j
}), i(a, {
onBeforeinput: s,
onBlur: b,
onChange: f,
onEnter: v,
onFocus: y,
onInput: B,
onKeydown: g,
onKeyup: h,
...j
}), n.createElement("jb-number-input", {
ref: a,
value: m?.toString() ?? "",
initialValue: p?.toString() ?? "",
...j
}, e.children);
});
u.displayName = "JBNumberInput";
export { u as JBNumberInput };
//# sourceMappingURL=JBNumberInput.js.map