koval-ui
Version:
React components collection with minimalistic design. Supports theming, layout, and input validation.
37 lines (36 loc) • 1.11 kB
JavaScript
"use client";
import { jsxs as b, jsx as e } from "react/jsx-runtime";
import { useState as p, useEffect as i, useCallback as u } from "react";
/* empty css */
import m from "./Dialog.module.css.js";
import { FormField as d } from "../../FormField/FormField.js";
import { InputDate as f } from "../../InputDate/InputDate.js";
const j = ({ value: a, onChange: c }) => {
const [t, l] = p(a);
i(() => {
l(a);
}, [a]);
const [n, s] = t, h = u(
(o) => {
const r = [o.target.value, s];
l(r);
},
[s]
), g = u(
(o) => {
const r = [n, o.target.value];
l(r);
},
[n]
);
return i(() => {
c(t);
}, [c, t]), /* @__PURE__ */ b("div", { className: m.numberRange, children: [
/* @__PURE__ */ e(d, { className: m.numberField, label: "From:", children: /* @__PURE__ */ e(f, { value: n ?? "", onChange: h }) }),
/* @__PURE__ */ e(d, { className: m.numberField, label: "To:", children: /* @__PURE__ */ e(f, { value: s || "", onChange: g }) })
] });
};
export {
j as DateRangeField
};
//# sourceMappingURL=DateRangeField.js.map