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