anysystem-design 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{combobox-CRHFa4aF.js → combobox-CbwTCd-z.js} +18 -16
- package/dist/components/AutoComplete/AutoCompleteBase.js +3 -3
- package/dist/components/AutoComplete/AutoCompleteMultiple.js +3 -3
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/DatePicker/DatePicker.js +1 -1
- package/dist/components/Input/Input.d.ts +4 -22
- package/dist/components/Input/Input.js +6 -51
- package/dist/components/Input/InputBase.d.ts +23 -0
- package/dist/components/Input/InputBase.js +53 -0
- package/dist/components/Input/InputTel.d.ts +28 -0
- package/dist/components/Input/InputTel.js +61 -0
- package/dist/components/Label/Label.d.ts +1 -1
- package/dist/components/Label/Label.js +28 -27
- package/dist/components/RadioGroup/RadioGroup.js +25 -24
- package/dist/components/Selectbox/SelectboxBase.js +4 -4
- package/dist/components/Selectbox/SelectboxMultiple.js +4 -4
- package/dist/components/Switch/Switch.d.ts +10 -0
- package/dist/components/Switch/Switch.js +61 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Switch/index.js +4 -0
- package/dist/components/TelephoneInput/index.d.ts +2 -0
- package/dist/components/TelephoneInput/index.js +4 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +44 -40
- package/dist/{floating-ui.react-dom-xElE0hWP.js → floating-ui.react-dom-YTFlGVA5.js} +175 -175
- package/dist/index-CsJbhhQY.js +108 -0
- package/dist/index.css +1 -1
- package/dist/index.js +44 -40
- package/dist/label-M2WV1DNi.js +742 -0
- package/dist/{listbox-CzAQRl_p.js → listbox-CJZgAdIt.js} +40 -38
- package/dist/{transition-B0bHCOYe.js → transition-DgjncSwT.js} +671 -712
- package/dist/use-resolve-button-type-WMDXx_9F.js +46 -0
- package/package.json +1 -1
- package/dist/index-DsW4uhBe.js +0 -846
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import { s as $e, o as g, n as q, f as Ke,
|
|
1
|
+
import { s as $e, o as g, n as q, f as Ke, M as Re, W as re, K as Ue, a as qe, l as Ge, T as Je, e as te, z as Ye, j as Qe, H as le, u as Xe, y as de, p as Ze, I as be, G as et, $ as De, b as Fe, D as ge, g as ye, c as F, r as tt } from "./label-M2WV1DNi.js";
|
|
2
2
|
import * as ie from "react";
|
|
3
|
-
import $, { useEffect as xe, useRef as N, createContext as Se, useReducer as
|
|
3
|
+
import $, { useEffect as xe, useRef as N, createContext as Se, useReducer as nt, createRef as ot, useCallback as Ce, useMemo as G, useId as pe, useContext as Ie, useState as it, Fragment as ke } from "react";
|
|
4
4
|
import { r as Z } from "./index-DsprzSCj.js";
|
|
5
|
-
import {
|
|
5
|
+
import { w as st, T as rt } from "./use-resolve-button-type-WMDXx_9F.js";
|
|
6
|
+
import { f as lt, u as at, _ as ut } from "./index-CsJbhhQY.js";
|
|
7
|
+
import { F as ct, v as dt, f as pt, i as ce, y as ft, n as Ae, x as ht, R as mt, o as vt, h as bt, V as gt, m as xt, j as St, k as It, p as we, A as Ot, l as Me, t as Et, w as Tt, q as Rt, r as _, z as yt, s as _e } from "./transition-DgjncSwT.js";
|
|
6
8
|
function oe(e, s, t) {
|
|
7
9
|
let n = t.initialDeps ?? [], o;
|
|
8
10
|
return () => {
|
|
@@ -535,13 +537,13 @@ jt(() => {
|
|
|
535
537
|
function e(s) {
|
|
536
538
|
if (!(s.target instanceof HTMLElement) || s.target === document.body || X[0] === s.target) return;
|
|
537
539
|
let t = s.target;
|
|
538
|
-
t = t.closest(
|
|
540
|
+
t = t.closest(lt), X.unshift(t ?? s.target), X = X.filter((n) => n != null && n.isConnected), X.splice(10);
|
|
539
541
|
}
|
|
540
542
|
window.addEventListener("click", e, { capture: !0 }), window.addEventListener("mousedown", e, { capture: !0 }), window.addEventListener("focus", e, { capture: !0 }), document.body.addEventListener("click", e, { capture: !0 }), document.body.addEventListener("mousedown", e, { capture: !0 }), document.body.addEventListener("focus", e, { capture: !0 });
|
|
541
543
|
});
|
|
542
544
|
var Oe = ((e) => (e[e.Left = 0] = "Left", e[e.Right = 2] = "Right", e))(Oe || {}), Ht = ((e) => (e[e.Open = 0] = "Open", e[e.Closed = 1] = "Closed", e))(Ht || {}), Kt = ((e) => (e[e.Single = 0] = "Single", e[e.Multi = 1] = "Multi", e))(Kt || {}), Ut = ((e) => (e[e.Pointer = 0] = "Pointer", e[e.Focus = 1] = "Focus", e[e.Other = 2] = "Other", e))(Ut || {}), qt = ((e) => (e[e.OpenCombobox = 0] = "OpenCombobox", e[e.CloseCombobox = 1] = "CloseCombobox", e[e.GoToOption = 2] = "GoToOption", e[e.SetTyping = 3] = "SetTyping", e[e.RegisterOption = 4] = "RegisterOption", e[e.UnregisterOption = 5] = "UnregisterOption", e[e.SetActivationTrigger = 6] = "SetActivationTrigger", e[e.UpdateVirtualConfiguration = 7] = "UpdateVirtualConfiguration", e))(qt || {});
|
|
543
545
|
function ve(e, s = (t) => t) {
|
|
544
|
-
let t = e.activeOptionIndex !== null ? e.options[e.activeOptionIndex] : null, n = s(e.options.slice()), o = n.length > 0 && n[0].dataRef.current.order !== null ? n.sort((r, i) => r.dataRef.current.order - i.dataRef.current.order) :
|
|
546
|
+
let t = e.activeOptionIndex !== null ? e.options[e.activeOptionIndex] : null, n = s(e.options.slice()), o = n.length > 0 && n[0].dataRef.current.order !== null ? n.sort((r, i) => r.dataRef.current.order - i.dataRef.current.order) : ut(n, (r) => r.dataRef.current.domRef.current), l = t ? o.indexOf(t) : null;
|
|
545
547
|
return l === -1 && (l = null), { options: o, activeOptionIndex: l };
|
|
546
548
|
}
|
|
547
549
|
let Gt = { 1(e) {
|
|
@@ -623,7 +625,7 @@ function Jt(e) {
|
|
|
623
625
|
}, getScrollElement() {
|
|
624
626
|
var p;
|
|
625
627
|
return (p = s.optionsRef.current) != null ? p : null;
|
|
626
|
-
}, overscan: 12 }), [r, i] =
|
|
628
|
+
}, overscan: 12 }), [r, i] = it(0);
|
|
627
629
|
q(() => {
|
|
628
630
|
i((p) => p + 1);
|
|
629
631
|
}, [t]);
|
|
@@ -654,7 +656,7 @@ function Yt(e, s) {
|
|
|
654
656
|
let Qt = ke;
|
|
655
657
|
function Xt(e, s) {
|
|
656
658
|
var t, n;
|
|
657
|
-
let o =
|
|
659
|
+
let o = qe(), { value: l, defaultValue: r, onChange: i, form: a, name: p, by: d, disabled: c = o || !1, onClose: I, __demoMode: u = !1, multiple: S = !1, immediate: x = !1, virtual: h = null, nullable: R, ...D } = e, M = Ge(r), [E = S ? [] : void 0, y] = Je(l, i, M), [O, b] = nt(Yt, { dataRef: ot(), comboboxState: u ? 0 : 1, isTyping: !1, options: [], virtual: h ? { options: h.options, disabled: (t = h.disabled) != null ? t : () => !1 } : null, activeOptionIndex: null, activationTrigger: 2, __demoMode: u }), V = N(!1), U = N({ static: !1, hold: !1 }), J = N(null), j = N(null), Y = N(null), k = at(d), C = g((v) => h ? d === null ? h.options.indexOf(v) : h.options.findIndex((T) => k(T, v)) : O.options.findIndex((T) => k(T.dataRef.current.value, v))), A = Ce((v) => te(m.mode, { 1: () => E.some((T) => k(T, v)), 0: () => k(E, v) }), [E]), Q = g((v) => O.activeOptionIndex === C(v)), m = G(() => ({ ...O, immediate: x, optionsPropsRef: U, inputRef: J, buttonRef: j, optionsRef: Y, value: E, defaultValue: M, disabled: c, mode: S ? 1 : 0, virtual: h ? O.virtual : null, get activeOptionIndex() {
|
|
658
660
|
if (V.current && O.activeOptionIndex === null && (h ? h.options.length > 0 : O.options.length > 0)) {
|
|
659
661
|
if (h) {
|
|
660
662
|
let T = h.options.findIndex((K) => {
|
|
@@ -675,7 +677,7 @@ function Xt(e, s) {
|
|
|
675
677
|
O.dataRef.current = m;
|
|
676
678
|
}, [m]);
|
|
677
679
|
let ee = m.comboboxState === 0;
|
|
678
|
-
|
|
680
|
+
ct(ee, [m.buttonRef, m.inputRef, m.optionsRef], () => H.closeCombobox());
|
|
679
681
|
let P = G(() => {
|
|
680
682
|
var v, T, K;
|
|
681
683
|
return { open: m.comboboxState === 0, disabled: c, activeIndex: m.activeOptionIndex, activeOption: m.activeOptionIndex === null ? null : m.virtual ? m.virtual.options[(v = m.activeOptionIndex) != null ? v : 0] : (K = (T = m.options[m.activeOptionIndex]) == null ? void 0 : T.dataRef.current.value) != null ? K : null, value: E };
|
|
@@ -703,15 +705,15 @@ function Xt(e, s) {
|
|
|
703
705
|
return K === -1 ? T.push(v) : T.splice(K, 1), y == null ? void 0 : y(T);
|
|
704
706
|
} })), L = g((v) => {
|
|
705
707
|
b({ type: 6, trigger: v });
|
|
706
|
-
}), H = G(() => ({ onChange: w, registerOption: W, goToOption: z, setIsTyping: B, closeCombobox: f, openCombobox: he, setActivationTrigger: L, selectActiveOption: fe }), []), [Be, We] =
|
|
708
|
+
}), H = G(() => ({ onChange: w, registerOption: W, goToOption: z, setIsTyping: B, closeCombobox: f, openCombobox: he, setActivationTrigger: L, selectActiveOption: fe }), []), [Be, We] = Ye(), je = s === null ? {} : { ref: s }, He = Ce(() => {
|
|
707
709
|
if (M !== void 0) return y == null ? void 0 : y(M);
|
|
708
710
|
}, [y, M]);
|
|
709
|
-
return $.createElement(We, { value: Be, props: { htmlFor: (n = m.inputRef.current) == null ? void 0 : n.id }, slot: { open: m.comboboxState === 0, disabled: c } }, $.createElement(
|
|
711
|
+
return $.createElement(We, { value: Be, props: { htmlFor: (n = m.inputRef.current) == null ? void 0 : n.id }, slot: { open: m.comboboxState === 0, disabled: c } }, $.createElement(dt, null, $.createElement(Ee.Provider, { value: H }, $.createElement(se.Provider, { value: m }, $.createElement(pt, { value: te(m.comboboxState, { 0: ce.Open, 1: ce.Closed }) }, p != null && $.createElement(Qe, { disabled: c, data: E != null ? { [p]: E } : {}, form: a, onReset: He }), le({ ourProps: je, theirProps: D, slot: P, defaultTag: Qt, name: "Combobox" }))))));
|
|
710
712
|
}
|
|
711
713
|
let Zt = "input";
|
|
712
714
|
function en(e, s) {
|
|
713
715
|
var t, n, o, l, r;
|
|
714
|
-
let i = ne("Combobox.Input"), a = ae("Combobox.Input"), p = pe(), d =
|
|
716
|
+
let i = ne("Combobox.Input"), a = ae("Combobox.Input"), p = pe(), d = Xe(), { id: c = d || `headlessui-combobox-input-${p}`, onChange: I, displayValue: u, disabled: S = i.disabled || !1, autoFocus: x = !1, type: h = "text", ...R } = e, D = de(i.inputRef, s, ft()), M = Ae(i.inputRef), E = Ze(), y = g(() => {
|
|
715
717
|
a.onChange(null), i.optionsRef.current && (i.optionsRef.current.scrollTop = 0), a.goToOption(_.Nothing);
|
|
716
718
|
}), O = G(() => {
|
|
717
719
|
var f;
|
|
@@ -785,7 +787,7 @@ function en(e, s) {
|
|
|
785
787
|
(z = i.buttonRef.current) != null && z.contains(w) || (W = i.optionsRef.current) != null && W.contains(w) || i.disabled || i.immediate && i.comboboxState !== 0 && E.microTask(() => {
|
|
786
788
|
Z.flushSync(() => a.openCombobox()), a.setActivationTrigger(1);
|
|
787
789
|
});
|
|
788
|
-
}), C = be(), A =
|
|
790
|
+
}), C = be(), A = et(), { isFocused: Q, focusProps: m } = De({ autoFocus: x }), { isHovered: ee, hoverProps: P } = Fe({ isDisabled: S }), fe = G(() => ({ open: i.comboboxState === 0, disabled: S, hover: ee, focus: Q, autofocus: x }), [i, ee, Q, x, S]), he = ge({ ref: D, id: c, role: "combobox", type: h, "aria-controls": (t = i.optionsRef.current) == null ? void 0 : t.id, "aria-expanded": i.comboboxState === 0, "aria-activedescendant": i.activeOptionIndex === null ? void 0 : i.virtual ? (n = i.options.find((f) => !f.dataRef.current.disabled && i.compare(f.dataRef.current.value, i.virtual.options[i.activeOptionIndex]))) == null ? void 0 : n.id : (o = i.options[i.activeOptionIndex]) == null ? void 0 : o.id, "aria-labelledby": C, "aria-describedby": A, "aria-autocomplete": "list", defaultValue: (r = (l = e.defaultValue) != null ? l : i.defaultValue !== void 0 ? u == null ? void 0 : u(i.defaultValue) : null) != null ? r : i.defaultValue, disabled: S || void 0, autoFocus: x, onCompositionStart: V, onCompositionEnd: U, onKeyDown: J, onChange: j, onFocus: k, onBlur: Y }, m, P);
|
|
789
791
|
return le({ ourProps: he, theirProps: R, slot: fe, defaultTag: Zt, name: "Combobox.Input" });
|
|
790
792
|
}
|
|
791
793
|
let tn = "button";
|
|
@@ -811,8 +813,8 @@ function nn(e, s) {
|
|
|
811
813
|
return;
|
|
812
814
|
}
|
|
813
815
|
}), u = g((b) => {
|
|
814
|
-
b.preventDefault(), !
|
|
815
|
-
}), S = be([i]), { isFocusVisible: x, focusProps: h } = De({ autoFocus: p }), { isHovered: R, hoverProps: D } = Fe({ isDisabled: a }), { pressed: M, pressProps: E } =
|
|
816
|
+
b.preventDefault(), !tt(b.currentTarget) && (b.button === Oe.Left && (n.comboboxState === 0 ? o.closeCombobox() : o.openCombobox()), c());
|
|
817
|
+
}), S = be([i]), { isFocusVisible: x, focusProps: h } = De({ autoFocus: p }), { isHovered: R, hoverProps: D } = Fe({ isDisabled: a }), { pressed: M, pressProps: E } = st({ disabled: a }), y = G(() => ({ open: n.comboboxState === 0, active: M || n.comboboxState === 0, disabled: a, value: n.value, hover: R, focus: x }), [n, R, x, M, a]), O = ge({ ref: l, id: i, type: rt(e, n.buttonRef), tabIndex: -1, "aria-haspopup": "listbox", "aria-controls": (t = n.optionsRef.current) == null ? void 0 : t.id, "aria-expanded": n.comboboxState === 0, "aria-labelledby": S, disabled: a || void 0, autoFocus: p, onMouseDown: u, onKeyDown: I }, h, D, E);
|
|
816
818
|
return le({ ourProps: O, theirProps: d, slot: y, defaultTag: tn, name: "Combobox.Button" });
|
|
817
819
|
}
|
|
818
820
|
let on = "div", sn = Re.RenderStrategy | Re.Static;
|
|
@@ -879,11 +881,11 @@ function an(e, s) {
|
|
|
879
881
|
}), k = G(() => ({ active: x, focus: x, selected: h, disabled: c }), [x, h, c]);
|
|
880
882
|
return le({ ourProps: { id: p, ref: E, role: "option", tabIndex: c === !0 ? void 0 : -1, "aria-disabled": c === !0 ? !0 : void 0, "aria-selected": h, disabled: void 0, onMouseDown: b, onFocus: V, onPointerEnter: J, onMouseEnter: J, onPointerMove: j, onMouseMove: j, onPointerLeave: Y, onMouseLeave: Y }, theirProps: u, slot: k, defaultTag: ln, name: "Combobox.Option" });
|
|
881
883
|
}
|
|
882
|
-
let un = re(Xt), cn = re(nn), dn = re(en), pn =
|
|
884
|
+
let un = re(Xt), cn = re(nn), dn = re(en), pn = Ue, fn = re(rn), hn = re(an), In = Object.assign(un, { Input: dn, Button: cn, Label: pn, Options: fn, Option: hn });
|
|
883
885
|
export {
|
|
884
886
|
dn as G,
|
|
885
887
|
cn as H,
|
|
886
888
|
hn as K,
|
|
887
|
-
|
|
889
|
+
In as N,
|
|
888
890
|
fn as z
|
|
889
891
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as a, jsxs as f } from "react/jsx-runtime";
|
|
2
2
|
import d, { Fragment as p } from "react";
|
|
3
3
|
import { t as y } from "../../bundle-mjs-SHnj3fHy.js";
|
|
4
|
-
import { H as g } from "../../index-
|
|
4
|
+
import { H as g } from "../../index-CsJbhhQY.js";
|
|
5
5
|
import { b } from "../../index-wvw0O1v3.js";
|
|
6
6
|
import { getValue as o } from "../Selectbox/helper.js";
|
|
7
|
-
import { N as x, G as C, H as E, z as w, K as N } from "../../combobox-
|
|
8
|
-
import { X as L } from "../../transition-
|
|
7
|
+
import { N as x, G as C, H as E, z as w, K as N } from "../../combobox-CbwTCd-z.js";
|
|
8
|
+
import { X as L } from "../../transition-DgjncSwT.js";
|
|
9
9
|
const S = (l, r) => r.type === "SEARCH" ? {
|
|
10
10
|
...l,
|
|
11
11
|
query: r.query,
|
|
@@ -2,12 +2,12 @@ import { jsx as r, jsxs as m } from "react/jsx-runtime";
|
|
|
2
2
|
import f, { Fragment as h } from "react";
|
|
3
3
|
import { _ as x } from "../../lodash-XYp3qmxI.js";
|
|
4
4
|
import { t as v } from "../../bundle-mjs-SHnj3fHy.js";
|
|
5
|
-
import { H as C } from "../../index-
|
|
5
|
+
import { H as C } from "../../index-CsJbhhQY.js";
|
|
6
6
|
import { b } from "../../index-wvw0O1v3.js";
|
|
7
7
|
import { a as w } from "../../index-C197ia6B.js";
|
|
8
8
|
import { getValue as c } from "../Selectbox/helper.js";
|
|
9
|
-
import { N, G as S, H as L, z as T, K as q } from "../../combobox-
|
|
10
|
-
import { X as A } from "../../transition-
|
|
9
|
+
import { N, G as S, H as L, z as T, K as q } from "../../combobox-CbwTCd-z.js";
|
|
10
|
+
import { X as A } from "../../transition-DgjncSwT.js";
|
|
11
11
|
const R = (l, t) => {
|
|
12
12
|
if (t.type === "SEARCH")
|
|
13
13
|
return {
|
|
@@ -13,7 +13,7 @@ const x = ({
|
|
|
13
13
|
"label",
|
|
14
14
|
{
|
|
15
15
|
className: s(
|
|
16
|
-
"relative my-
|
|
16
|
+
"relative my-2 flex cursor-pointer select-none items-center gap-2 py-2 pr-3",
|
|
17
17
|
"after:absolute after:left-1/2 after:top-1/2 after:-z-20 after:h-[calc(100%+12px)] after:w-[calc(100%+20px)] after:-translate-x-1/2 after:-translate-y-1/2 after:transform after:rounded-md after:bg-blue-100 after:opacity-0 after:transition-all after:content-[''] dark:after:bg-gray-800",
|
|
18
18
|
"hover:after:opacity-100 hover:after:duration-200",
|
|
19
19
|
o === !0 && "hidden"
|
|
@@ -2,7 +2,7 @@ import { jsx as j, jsxs as Ne, Fragment as ct } from "react/jsx-runtime";
|
|
|
2
2
|
import { t as We } from "../../bundle-mjs-SHnj3fHy.js";
|
|
3
3
|
import { b as Hn, c as In } from "../../index-C197ia6B.js";
|
|
4
4
|
import Ln, { createContext as wa, forwardRef as pa, useRef as Qe, useReducer as An, useEffect as Fe, Fragment as ga, isValidElement as jn, cloneElement as Gn, createElement as qn, useContext as Dt, useId as $n, useMemo as br, useState as _a, useCallback as Vn, useLayoutEffect as ba } from "react";
|
|
5
|
-
import { u as Qn, a as Bn, o as zn, f as Zn, s as Xn } from "../../floating-ui.react-dom-
|
|
5
|
+
import { u as Qn, a as Bn, o as zn, f as Zn, s as Xn } from "../../floating-ui.react-dom-YTFlGVA5.js";
|
|
6
6
|
//! moment.js
|
|
7
7
|
//! version : 2.30.1
|
|
8
8
|
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
|
|
@@ -1,25 +1,7 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { InputBaseProps } from './InputBase';
|
|
3
|
+
import { InputTelProps } from './InputTel';
|
|
2
4
|
|
|
3
|
-
export type InputProps =
|
|
4
|
-
|
|
5
|
-
inputBefore?: React.ReactNode;
|
|
6
|
-
inputAfter?: React.ReactNode;
|
|
7
|
-
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
8
|
-
className?: {
|
|
9
|
-
container?: string;
|
|
10
|
-
input?: string;
|
|
11
|
-
};
|
|
12
|
-
decimal?: number;
|
|
13
|
-
};
|
|
14
|
-
declare const _default: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
15
|
-
name: string;
|
|
16
|
-
inputBefore?: React.ReactNode;
|
|
17
|
-
inputAfter?: React.ReactNode;
|
|
18
|
-
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
19
|
-
className?: {
|
|
20
|
-
container?: string;
|
|
21
|
-
input?: string;
|
|
22
|
-
};
|
|
23
|
-
decimal?: number;
|
|
24
|
-
} & React.RefAttributes<HTMLInputElement>>;
|
|
5
|
+
export type InputProps = InputBaseProps | InputTelProps;
|
|
6
|
+
declare const _default: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
25
7
|
export default _default;
|
|
@@ -1,53 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return d.useImperativeHandle(
|
|
7
|
-
x,
|
|
8
|
-
() => i.current
|
|
9
|
-
), /* @__PURE__ */ v(
|
|
10
|
-
"div",
|
|
11
|
-
{
|
|
12
|
-
className: r(
|
|
13
|
-
"flex w-full items-center",
|
|
14
|
-
(e == null ? void 0 : e.container) && e.container
|
|
15
|
-
),
|
|
16
|
-
children: [
|
|
17
|
-
l && /* @__PURE__ */ f(
|
|
18
|
-
"div",
|
|
19
|
-
{
|
|
20
|
-
className: r(
|
|
21
|
-
"btn-before mr-2 flex h-9 w-10 items-center justify-center rounded-full text-gray-400"
|
|
22
|
-
),
|
|
23
|
-
children: l
|
|
24
|
-
}
|
|
25
|
-
),
|
|
26
|
-
/* @__PURE__ */ f(
|
|
27
|
-
"input",
|
|
28
|
-
{
|
|
29
|
-
ref: i,
|
|
30
|
-
...t && t,
|
|
31
|
-
...n,
|
|
32
|
-
value: (t == null ? void 0 : t.value) || (n == null ? void 0 : n.value) || "",
|
|
33
|
-
className: r((e == null ? void 0 : e.input) && e.input),
|
|
34
|
-
readOnly: n.readOnly,
|
|
35
|
-
id: c
|
|
36
|
-
}
|
|
37
|
-
),
|
|
38
|
-
u && /* @__PURE__ */ f(
|
|
39
|
-
"div",
|
|
40
|
-
{
|
|
41
|
-
className: r(
|
|
42
|
-
"btn-after mr-2 flex h-9 w-10 items-center justify-center rounded-full text-gray-400"
|
|
43
|
-
),
|
|
44
|
-
children: u
|
|
45
|
-
}
|
|
46
|
-
)
|
|
47
|
-
]
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
}, a = d.forwardRef(y);
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import f from "react";
|
|
3
|
+
import m from "./InputBase.js";
|
|
4
|
+
import u from "./InputTel.js";
|
|
5
|
+
const p = ({ type: e, ...t }, r) => e === "tel" ? /* @__PURE__ */ o(u, { ...t, ref: r }) : /* @__PURE__ */ o(m, { ...t, ref: r }), s = f.forwardRef(p);
|
|
51
6
|
export {
|
|
52
|
-
|
|
7
|
+
s as default
|
|
53
8
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
|
|
3
|
+
export type InputBaseProps = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
4
|
+
name: string;
|
|
5
|
+
inputBefore?: React.ReactNode;
|
|
6
|
+
inputAfter?: React.ReactNode;
|
|
7
|
+
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
8
|
+
className?: {
|
|
9
|
+
container?: string;
|
|
10
|
+
input?: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
declare const _default: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
14
|
+
name: string;
|
|
15
|
+
inputBefore?: React.ReactNode;
|
|
16
|
+
inputAfter?: React.ReactNode;
|
|
17
|
+
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
18
|
+
className?: {
|
|
19
|
+
container?: string;
|
|
20
|
+
input?: string;
|
|
21
|
+
};
|
|
22
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsxs as v, jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import d from "react";
|
|
3
|
+
import { t as r } from "../../bundle-mjs-SHnj3fHy.js";
|
|
4
|
+
const a = ({ name: x, inputProps: t, inputBefore: l, inputAfter: u, className: e, ...n }, c) => {
|
|
5
|
+
const i = d.useRef(null);
|
|
6
|
+
return d.useImperativeHandle(
|
|
7
|
+
c,
|
|
8
|
+
() => i.current
|
|
9
|
+
), /* @__PURE__ */ v(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
className: r(
|
|
13
|
+
"flex w-full items-center",
|
|
14
|
+
(e == null ? void 0 : e.container) && e.container
|
|
15
|
+
),
|
|
16
|
+
children: [
|
|
17
|
+
l && /* @__PURE__ */ f(
|
|
18
|
+
"div",
|
|
19
|
+
{
|
|
20
|
+
className: r(
|
|
21
|
+
"btn-before mr-2 flex h-9 items-center justify-center rounded-full px-3 text-gray-400"
|
|
22
|
+
),
|
|
23
|
+
children: l
|
|
24
|
+
}
|
|
25
|
+
),
|
|
26
|
+
/* @__PURE__ */ f(
|
|
27
|
+
"input",
|
|
28
|
+
{
|
|
29
|
+
ref: i,
|
|
30
|
+
...t && t,
|
|
31
|
+
...n,
|
|
32
|
+
value: (t == null ? void 0 : t.value) || (n == null ? void 0 : n.value) || "",
|
|
33
|
+
className: r((e == null ? void 0 : e.input) && e.input),
|
|
34
|
+
readOnly: n.readOnly,
|
|
35
|
+
id: x
|
|
36
|
+
}
|
|
37
|
+
),
|
|
38
|
+
u && /* @__PURE__ */ f(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
className: r(
|
|
42
|
+
"btn-after mr-2 flex h-9 items-center justify-center rounded-full text-gray-400"
|
|
43
|
+
),
|
|
44
|
+
children: u
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}, j = d.forwardRef(a);
|
|
51
|
+
export {
|
|
52
|
+
j as default
|
|
53
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { SelectOption } from '../Selectbox';
|
|
3
|
+
|
|
4
|
+
export type InputTelProps = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
5
|
+
type: "tel";
|
|
6
|
+
name: string;
|
|
7
|
+
className?: {
|
|
8
|
+
container?: string;
|
|
9
|
+
input?: string;
|
|
10
|
+
};
|
|
11
|
+
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
12
|
+
phonePrefixOptions: SelectOption[];
|
|
13
|
+
phonePrefix?: string;
|
|
14
|
+
onChange?: (value: string) => void;
|
|
15
|
+
};
|
|
16
|
+
declare const _default: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
|
|
17
|
+
type: "tel";
|
|
18
|
+
name: string;
|
|
19
|
+
className?: {
|
|
20
|
+
container?: string;
|
|
21
|
+
input?: string;
|
|
22
|
+
};
|
|
23
|
+
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
24
|
+
phonePrefixOptions: SelectOption[];
|
|
25
|
+
phonePrefix?: string;
|
|
26
|
+
onChange?: (value: string) => void;
|
|
27
|
+
} & React.RefAttributes<HTMLInputElement>>;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { jsxs as $, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import o from "react";
|
|
3
|
+
import h from "./InputBase.js";
|
|
4
|
+
import x from "../AutoComplete/AutoComplete.js";
|
|
5
|
+
import { t as T } from "../../bundle-mjs-SHnj3fHy.js";
|
|
6
|
+
const E = (r, t) => t.type === "SETPREFIX" ? {
|
|
7
|
+
...r,
|
|
8
|
+
prefix: t.value,
|
|
9
|
+
realPhone: `${t.value}-${r.content}`
|
|
10
|
+
} : t.type === "SETCONTENT" ? {
|
|
11
|
+
...r,
|
|
12
|
+
content: t.value,
|
|
13
|
+
realPhone: `${r.prefix}-${t.value}`
|
|
14
|
+
} : r, N = ({ className: r, value: t, phonePrefix: i, phonePrefixOptions: f, onChange: a, ...p }, d) => {
|
|
15
|
+
const v = o.useMemo(() => {
|
|
16
|
+
let e = r || { container: void 0, input: void 0 };
|
|
17
|
+
return e.container = T("w-1/2", (e == null ? void 0 : e.container) || ""), e;
|
|
18
|
+
}, [r]), n = o.useMemo(() => (t + "").split("-"), [t]), s = o.useMemo(() => n && n[0] ? n[0] : i || "", [n, i]), m = o.useMemo(() => n && n[1] ? n[1] : "", [n]), [u, c] = o.useReducer(E, {
|
|
19
|
+
prefix: s,
|
|
20
|
+
content: m,
|
|
21
|
+
realPhone: `${s}-${m}`
|
|
22
|
+
});
|
|
23
|
+
return /* @__PURE__ */ $("div", { className: "flex", children: [
|
|
24
|
+
/* @__PURE__ */ l("div", { className: "btn-phone-prefix w-1/2", children: /* @__PURE__ */ l(
|
|
25
|
+
x,
|
|
26
|
+
{
|
|
27
|
+
options: f,
|
|
28
|
+
name: `phonePrefix-${p.name}`,
|
|
29
|
+
valueField: "value",
|
|
30
|
+
value: u.prefix,
|
|
31
|
+
onChange: (e) => {
|
|
32
|
+
c({ type: "SETPREFIX", value: e }), a && a(`${e}-${u.content}`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
) }),
|
|
36
|
+
/* @__PURE__ */ l(
|
|
37
|
+
h,
|
|
38
|
+
{
|
|
39
|
+
className: v,
|
|
40
|
+
value: u.content,
|
|
41
|
+
onChange: (e) => {
|
|
42
|
+
c({ type: "SETCONTENT", value: e.target.value }), a && a(`${u.prefix}-${e.target.value}`);
|
|
43
|
+
},
|
|
44
|
+
...p,
|
|
45
|
+
ref: d
|
|
46
|
+
}
|
|
47
|
+
),
|
|
48
|
+
/* @__PURE__ */ l(
|
|
49
|
+
"input",
|
|
50
|
+
{
|
|
51
|
+
type: "hidden",
|
|
52
|
+
name: p.name,
|
|
53
|
+
value: u.realPhone,
|
|
54
|
+
className: "!hidden"
|
|
55
|
+
}
|
|
56
|
+
)
|
|
57
|
+
] });
|
|
58
|
+
}, w = o.forwardRef(N);
|
|
59
|
+
export {
|
|
60
|
+
w as default
|
|
61
|
+
};
|
|
@@ -1,46 +1,47 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as r, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { t as s } from "../../bundle-mjs-SHnj3fHy.js";
|
|
3
|
-
import { c } from "../../index-wvw0O1v3.js";
|
|
4
|
-
const
|
|
5
|
-
label:
|
|
6
|
-
className:
|
|
7
|
-
htmlFor:
|
|
8
|
-
isError:
|
|
9
|
-
errorMessage:
|
|
10
|
-
type:
|
|
11
|
-
children:
|
|
12
|
-
}) => /* @__PURE__ */
|
|
13
|
-
/* @__PURE__ */
|
|
3
|
+
import { c as m } from "../../index-wvw0O1v3.js";
|
|
4
|
+
const h = ({
|
|
5
|
+
label: t,
|
|
6
|
+
className: i,
|
|
7
|
+
htmlFor: d,
|
|
8
|
+
isError: a = !1,
|
|
9
|
+
errorMessage: o,
|
|
10
|
+
type: e = "border",
|
|
11
|
+
children: c
|
|
12
|
+
}) => /* @__PURE__ */ r("div", { className: "flex flex-col", children: [
|
|
13
|
+
/* @__PURE__ */ r(
|
|
14
14
|
"div",
|
|
15
15
|
{
|
|
16
16
|
className: s(
|
|
17
|
-
"relative
|
|
18
|
-
|
|
19
|
-
"form-group",
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
"relative flex w-full flex-col ",
|
|
18
|
+
e === "border" && "rounded border border-gray-400",
|
|
19
|
+
e === "horizontal" ? "flex-row gap-2" : "form-group",
|
|
20
|
+
a && "error",
|
|
21
|
+
i
|
|
22
22
|
),
|
|
23
23
|
children: [
|
|
24
|
-
|
|
24
|
+
t && /* @__PURE__ */ l(
|
|
25
25
|
"label",
|
|
26
26
|
{
|
|
27
27
|
className: s(
|
|
28
|
-
|
|
29
|
-
"
|
|
28
|
+
e === "border" && "hidden text-gray-600 opacity-0 dark:text-white",
|
|
29
|
+
e === "horizontal" && "flex items-center justify-center",
|
|
30
|
+
"mb-1 text-sm font-semibold"
|
|
30
31
|
),
|
|
31
|
-
htmlFor:
|
|
32
|
-
children:
|
|
32
|
+
htmlFor: d,
|
|
33
|
+
children: t
|
|
33
34
|
}
|
|
34
35
|
),
|
|
35
|
-
|
|
36
|
+
c
|
|
36
37
|
]
|
|
37
38
|
}
|
|
38
39
|
),
|
|
39
|
-
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
|
|
40
|
+
a && o && /* @__PURE__ */ r("span", { className: "flex items-center gap-1 text-sm text-red-600", children: [
|
|
41
|
+
/* @__PURE__ */ l("div", { className: "w-4", children: /* @__PURE__ */ l(m, {}) }),
|
|
42
|
+
o
|
|
42
43
|
] })
|
|
43
44
|
] });
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
+
h as default
|
|
46
47
|
};
|