UNPKG

fui-fancyui

Version:
84 lines (83 loc) 1.93 kB
"use client"; import { jsx as g } from "react/jsx-runtime"; import { forwardRef as C, useState as h, useId as M } from "react"; import O from "../../atoms/DateInput/DateInput.js"; import R from "../../molecules/InputWrapper/InputWrapper.js"; import j from "../../../design/designFunctions/getOpositMainThemeType/getOpositMainThemeType.js"; const q = C((t, y) => { const { id: o, value: n, label: v, icon: I, systemMessage: B, align: r, disabled: s, themeType: i = "primary", layer: u = 2, placeholder: l, underline: F, onChange: c, transparentBackground: S, outlinedBackgroundStrength: T, outlinedRemoveBorder: b, externalStyle: x, className: A, readOnly: d, ...D } = t, [H, m] = h(!!n), [f, V] = h(!1), k = M(), p = o || k, a = (e) => { n && m(!0), V(e); }, w = (e) => { e.target.value === "" && m(!1); }; return /* @__PURE__ */ g( R, { id: p, hasValue: !!n || !!H || f, label: v, disabled: s || d, themeType: i, placeholder: l, underline: F, layer: u, align: r, className: A, isActive: f, icon: I, outlinedBackgroundStrength: T, outlinedRemoveBorder: b, systemMessage: B, transparentBackground: S, externalStyle: x, InputElement: /* @__PURE__ */ g( O, { ref: y, id: p, placeholder: l, readOnly: d, themeType: j(i), layer: u, onChange: (e) => { w(e), c && c(e); }, value: n, onKeyDown: () => a(!0), onFocus: (e) => { a(!0), t.onFocus && t.onFocus(e); }, onBlur: (e) => { a(!1), t.onBlur && t.onBlur(e); }, align: r, disabled: s, ...D } ) } ); }); export { q as default };