UNPKG

xtreme-ui

Version:

Collection of reusable components that can be used in web projects

59 lines (58 loc) 1.38 kB
"use client"; import { jsx as a } from "react/jsx-runtime"; import M from "clsx"; import e from "react-datetime-picker"; import { Icon as m } from "../Icon/Icon.js"; /* empty css */ const u = { date: "dd-MM-yyyy", dateRange: "dd-MM-yyyy", time: "h:mm:ss a", timeRange: "h:mm:ss a", dateTime: "dd-MM-yyyy h:mm:ss a", dateTimeRange: "dd-MM-yyyy h:mm:ss a" }, x = { date: e, dateRange: e, time: e, timeRange: e, dateTime: e, dateTimeRange: e }, b = (r) => { const { className: c, type: t = "date", format: d, dayPlaceholder: s = "dd", monthPlaceholder: n = "mm", yearPlaceholder: l = "yyyy", hourPlaceholder: i = "hh", minutePlaceholder: y = "mm", secondPlaceholder: h = "ss", placeholder: o = "Select a Date", icon: p = "f784", value: P, onChange: D } = r, f = { className: M( "xtrDatePicker", c ), calendarIcon: /* @__PURE__ */ a(m, { code: p, type: "regular" }), clearIcon: /* @__PURE__ */ a(m, { code: "e59b", type: "solid" }), format: d ?? u[t], dayPlaceholder: s, monthPlaceholder: n, yearPlaceholder: l, hourPlaceholder: i, minutePlaceholder: y, secondPlaceholder: h, placeholder: o, value: P, onChange: D }, g = x[t]; return /* @__PURE__ */ a(g, { "data-testid": o, ...f }); }; export { b as DatePicker };