asterui 0.12.13 → 0.12.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/components/Button.d.ts +4 -0
- package/dist/components/Drawer.d.ts +47 -6
- package/dist/components/Dropdown.d.ts +65 -9
- package/dist/components/Input.d.ts +15 -1
- package/dist/components/Modal.d.ts +5 -1
- package/dist/components/Navbar.d.ts +15 -1
- package/dist/components/SidebarDrawer.d.ts +21 -0
- package/dist/components/Tabs.d.ts +30 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +169 -167
- package/dist/index.js.map +1 -1
- package/dist/index100.js +44 -11
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +10 -12
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +14 -7
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +7 -12
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +11 -29
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +29 -16
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +21 -0
- package/dist/index106.js.map +1 -0
- package/dist/index21.js +1 -1
- package/dist/index26.js +171 -40
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +41 -17
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +17 -33
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +33 -52
- package/dist/index29.js.map +1 -1
- package/dist/index30.js +50 -61
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +60 -181
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +184 -18
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +15 -217
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +216 -1083
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +1086 -16
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +16 -121
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +119 -37
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +34 -208
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +390 -89
- package/dist/index39.js.map +1 -1
- package/dist/index40.js +93 -158
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +211 -135
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +146 -15
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +15 -17
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +17 -21
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +18 -134
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +134 -10
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +13 -35
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +35 -34
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +34 -81
- package/dist/index49.js.map +1 -1
- package/dist/index50.js +71 -166
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +167 -144
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +152 -11
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +10 -20
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +22 -14
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +14 -7
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +6 -310
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +334 -17
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +47 -122
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +120 -108
- package/dist/index59.js.map +1 -1
- package/dist/index60.js +107 -167
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +167 -29
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +30 -120
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +116 -80
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +85 -19
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +19 -73
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +71 -54
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +56 -44
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +42 -49
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +52 -62
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +56 -101
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +107 -41
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +41 -68
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +66 -19
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +18 -55
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +55 -251
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +254 -22
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +22 -31
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +30 -93
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +89 -324
- package/dist/index79.js.map +1 -1
- package/dist/index80.js +323 -50
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +79 -39
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +40 -23
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +21 -93
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +87 -148
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +147 -152
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +159 -63
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +65 -35
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +35 -234
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +231 -31
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +69 -44
- package/dist/index9.js.map +1 -1
- package/dist/index90.js +34 -210
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +195 -198
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +159 -241
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +283 -166
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +173 -253
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +258 -14
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +12 -31
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +32 -5
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +5 -13
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +11 -43
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
package/dist/index32.js
CHANGED
|
@@ -1,21 +1,187 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { jsx as t, jsxs as N, Fragment as I } from "react/jsx-runtime";
|
|
2
|
+
import { useContext as C, createContext as F, useState as S, useEffect as W } from "react";
|
|
3
|
+
const y = () => /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 4v16m8-8H4" }) }), E = () => /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 10l7-7m0 0l7 7m-7-7v18" }) }), M = () => /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-6 w-6", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }), f = F({ inGroup: !1 }), P = {
|
|
4
|
+
left: "tooltip-left",
|
|
5
|
+
right: "tooltip-right",
|
|
6
|
+
top: "tooltip-top",
|
|
7
|
+
bottom: "tooltip-bottom"
|
|
8
|
+
}, j = {
|
|
9
|
+
default: "btn-neutral",
|
|
10
|
+
primary: "btn-primary"
|
|
11
|
+
}, L = {
|
|
12
|
+
circle: "btn-circle",
|
|
13
|
+
square: "btn-square"
|
|
14
|
+
}, B = ({
|
|
15
|
+
icon: d,
|
|
16
|
+
description: l,
|
|
17
|
+
onClick: o,
|
|
18
|
+
type: p = "default",
|
|
19
|
+
shape: u = "circle",
|
|
20
|
+
className: w = "",
|
|
21
|
+
tooltip: c,
|
|
22
|
+
tooltipPlacement: v = "left",
|
|
23
|
+
badge: a,
|
|
24
|
+
href: e,
|
|
25
|
+
target: i,
|
|
26
|
+
children: g,
|
|
27
|
+
style: m,
|
|
28
|
+
...s
|
|
29
|
+
}) => {
|
|
30
|
+
const h = C(f), x = h.inGroup && h.shape || u, n = [
|
|
31
|
+
"btn",
|
|
32
|
+
"btn-lg",
|
|
33
|
+
"shadow-lg",
|
|
34
|
+
L[x],
|
|
35
|
+
j[p],
|
|
36
|
+
w
|
|
37
|
+
].filter(Boolean).join(" "), b = d || g || /* @__PURE__ */ t(y, {}), r = /* @__PURE__ */ t(I, { children: l ? /* @__PURE__ */ N("div", { className: "flex flex-col items-center", children: [
|
|
38
|
+
b,
|
|
39
|
+
/* @__PURE__ */ t("span", { className: "text-xs mt-1", children: l })
|
|
40
|
+
] }) : b });
|
|
41
|
+
if (h.inGroup)
|
|
42
|
+
return e ? /* @__PURE__ */ t(
|
|
43
|
+
"a",
|
|
44
|
+
{
|
|
45
|
+
href: e,
|
|
46
|
+
target: i,
|
|
47
|
+
className: n,
|
|
48
|
+
title: c,
|
|
49
|
+
onClick: o,
|
|
50
|
+
...s,
|
|
51
|
+
children: r
|
|
52
|
+
}
|
|
53
|
+
) : /* @__PURE__ */ t("button", { className: n, title: c, onClick: o, ...s, children: r });
|
|
54
|
+
const G = e ? /* @__PURE__ */ t(
|
|
55
|
+
"a",
|
|
56
|
+
{
|
|
57
|
+
href: e,
|
|
58
|
+
target: i,
|
|
59
|
+
className: n,
|
|
60
|
+
style: m,
|
|
61
|
+
onClick: o,
|
|
62
|
+
...s,
|
|
63
|
+
children: r
|
|
64
|
+
}
|
|
65
|
+
) : /* @__PURE__ */ t("button", { className: n, onClick: o, style: m, ...s, children: r }), T = a !== void 0 ? /* @__PURE__ */ N("div", { className: "indicator", style: m, children: [
|
|
66
|
+
/* @__PURE__ */ t("span", { className: "indicator-item badge badge-secondary", children: a }),
|
|
67
|
+
e ? /* @__PURE__ */ t("a", { href: e, target: i, className: n, onClick: o, ...s, children: r }) : /* @__PURE__ */ t("button", { className: n, onClick: o, ...s, children: r })
|
|
68
|
+
] }) : G;
|
|
69
|
+
return c ? /* @__PURE__ */ t("div", { className: `tooltip ${P[v]}`, "data-tip": c, style: m, children: a !== void 0 ? /* @__PURE__ */ N("div", { className: "indicator", children: [
|
|
70
|
+
/* @__PURE__ */ t("span", { className: "indicator-item badge badge-secondary", children: a }),
|
|
71
|
+
e ? /* @__PURE__ */ t("a", { href: e, target: i, className: n, onClick: o, ...s, children: r }) : /* @__PURE__ */ t("button", { className: n, onClick: o, ...s, children: r })
|
|
72
|
+
] }) : e ? /* @__PURE__ */ t("a", { href: e, target: i, className: n, onClick: o, ...s, children: r }) : /* @__PURE__ */ t("button", { className: n, onClick: o, ...s, children: r }) }) : T;
|
|
73
|
+
}, k = (d) => {
|
|
74
|
+
const {
|
|
75
|
+
style: l,
|
|
76
|
+
...o
|
|
77
|
+
} = d;
|
|
78
|
+
if (C(f).inGroup)
|
|
79
|
+
return /* @__PURE__ */ t(B, { ...o });
|
|
80
|
+
const u = {
|
|
81
|
+
position: "fixed",
|
|
82
|
+
zIndex: 1e3,
|
|
83
|
+
bottom: 24,
|
|
84
|
+
right: 24,
|
|
85
|
+
...l
|
|
86
|
+
};
|
|
87
|
+
return /* @__PURE__ */ t(B, { ...o, style: u });
|
|
88
|
+
}, $ = ({
|
|
89
|
+
children: d,
|
|
90
|
+
flower: l = !1,
|
|
91
|
+
shape: o = "circle",
|
|
92
|
+
icon: p,
|
|
93
|
+
mainAction: u,
|
|
94
|
+
onMainAction: w,
|
|
95
|
+
showClose: c = !1,
|
|
96
|
+
type: v = "default",
|
|
97
|
+
position: a = "bottom-right",
|
|
98
|
+
offset: e = 24,
|
|
99
|
+
className: i = "",
|
|
100
|
+
style: g
|
|
101
|
+
}) => {
|
|
102
|
+
const m = [
|
|
103
|
+
"fab",
|
|
104
|
+
l ? "fab-flower" : "",
|
|
105
|
+
i
|
|
106
|
+
].filter(Boolean).join(" "), s = [
|
|
107
|
+
"btn",
|
|
108
|
+
"btn-lg",
|
|
109
|
+
"shadow-lg",
|
|
110
|
+
L[o],
|
|
111
|
+
j[v]
|
|
112
|
+
].filter(Boolean).join(" "), h = {
|
|
113
|
+
...a.includes("bottom") ? { bottom: e } : { top: e },
|
|
114
|
+
...a.includes("right") ? { right: e } : { left: e },
|
|
115
|
+
...g
|
|
116
|
+
};
|
|
117
|
+
return /* @__PURE__ */ N("div", { className: m, style: h, children: [
|
|
118
|
+
/* @__PURE__ */ t(
|
|
119
|
+
"div",
|
|
120
|
+
{
|
|
121
|
+
tabIndex: 0,
|
|
122
|
+
role: "button",
|
|
123
|
+
className: s,
|
|
124
|
+
children: p || /* @__PURE__ */ t(y, {})
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
u && /* @__PURE__ */ t(
|
|
128
|
+
"button",
|
|
129
|
+
{
|
|
130
|
+
className: `${s} fab-main-action`,
|
|
131
|
+
onClick: w,
|
|
132
|
+
children: u
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
c && /* @__PURE__ */ t("button", { className: `${s} fab-close`, children: /* @__PURE__ */ t(M, {}) }),
|
|
136
|
+
/* @__PURE__ */ t(f.Provider, { value: { inGroup: !0, shape: o }, children: d })
|
|
137
|
+
] });
|
|
138
|
+
}, q = ({
|
|
139
|
+
visibilityHeight: d = 400,
|
|
140
|
+
target: l,
|
|
141
|
+
onClick: o,
|
|
142
|
+
icon: p,
|
|
143
|
+
duration: u = 450,
|
|
144
|
+
position: w = "bottom-right",
|
|
145
|
+
offset: c = 24,
|
|
146
|
+
className: v = "",
|
|
147
|
+
children: a,
|
|
148
|
+
style: e,
|
|
149
|
+
...i
|
|
150
|
+
}) => {
|
|
151
|
+
const [g, m] = S(!1);
|
|
152
|
+
W(() => {
|
|
153
|
+
const n = l ? l() : window, b = () => {
|
|
154
|
+
const r = n instanceof Window ? window.scrollY : n.scrollTop;
|
|
155
|
+
m(r >= d);
|
|
156
|
+
};
|
|
157
|
+
return n.addEventListener("scroll", b), b(), () => n.removeEventListener("scroll", b);
|
|
158
|
+
}, [l, d]);
|
|
159
|
+
const s = () => {
|
|
160
|
+
o?.();
|
|
161
|
+
const n = l ? l() : window;
|
|
162
|
+
n instanceof Window ? window.scrollTo({ top: 0, behavior: "smooth" }) : n.scrollTo({ top: 0, behavior: "smooth" });
|
|
163
|
+
};
|
|
164
|
+
if (!g) return null;
|
|
165
|
+
const h = [
|
|
166
|
+
"btn",
|
|
167
|
+
"btn-lg",
|
|
168
|
+
"btn-circle",
|
|
169
|
+
"btn-neutral",
|
|
170
|
+
"shadow-lg",
|
|
171
|
+
"transition-opacity",
|
|
172
|
+
v
|
|
173
|
+
].filter(Boolean).join(" "), x = {
|
|
174
|
+
position: "fixed",
|
|
175
|
+
zIndex: 1e3,
|
|
176
|
+
bottom: c,
|
|
177
|
+
...w.includes("right") ? { right: c } : { left: c },
|
|
178
|
+
...e
|
|
179
|
+
};
|
|
180
|
+
return /* @__PURE__ */ t("button", { className: h, onClick: s, style: x, ...i, children: p || a || /* @__PURE__ */ t(E, {}) });
|
|
181
|
+
};
|
|
182
|
+
k.Group = $;
|
|
183
|
+
k.BackTop = q;
|
|
18
184
|
export {
|
|
19
|
-
|
|
185
|
+
k as FloatButton
|
|
20
186
|
};
|
|
21
187
|
//# sourceMappingURL=index32.js.map
|
package/dist/index32.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index32.js","sources":["../src/components/Footer.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface FooterProps extends React.HTMLAttributes<HTMLElement> {\n children: React.ReactNode\n center?: boolean\n horizontal?: boolean\n vertical?: boolean\n}\n\nexport interface FooterTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {\n children: React.ReactNode\n}\n\nfunction FooterRoot({ children, className = '', center = false, horizontal = false, vertical = false, ...rest }: FooterProps) {\n const classes = [\n 'footer',\n center && 'footer-center',\n horizontal && 'footer-horizontal',\n vertical && 'footer-vertical',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return <footer className={classes} {...rest}>{children}</footer>\n}\n\nfunction FooterTitle({ children, className = '', ...rest }: FooterTitleProps) {\n return <h6 className={`footer-title ${className}`} {...rest}>{children}</h6>\n}\n\nexport const Footer = Object.assign(FooterRoot, {\n Title: FooterTitle,\n})\n"],"names":["FooterRoot","children","className","center","horizontal","vertical","rest","classes","FooterTitle","jsx","Footer"],"mappings":";AAaA,SAASA,EAAW,EAAE,UAAAC,GAAU,WAAAC,IAAY,IAAI,QAAAC,IAAS,IAAO,YAAAC,IAAa,IAAO,UAAAC,IAAW,IAAO,GAAGC,KAAqB;AAC5H,QAAMC,IAAU;AAAA,IACd;AAAA,IACAJ,KAAU;AAAA,IACVC,KAAc;AAAA,IACdC,KAAY;AAAA,IACZH;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,2BAAQ,UAAA,EAAO,WAAWK,GAAU,GAAGD,GAAO,UAAAL,GAAS;AACzD;AAEA,SAASO,EAAY,EAAE,UAAAP,GAAU,WAAAC,IAAY,IAAI,GAAGI,KAA0B;AAC5E,SAAO,gBAAAG,EAAC,QAAG,WAAW,gBAAgBP,CAAS,IAAK,GAAGI,GAAO,UAAAL,GAAS;AACzE;AAEO,MAAMS,IAAS,OAAO,OAAOV,GAAY;AAAA,EAC9C,OAAOQ;AACT,CAAC;"}
|
|
1
|
+
{"version":3,"file":"index32.js","sources":["../src/components/FloatButton.tsx"],"sourcesContent":["import React, { useState, useEffect, createContext, useContext } from 'react'\n\n// Default icons\nconst PlusIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M12 4v16m8-8H4\" />\n </svg>\n)\n\nconst ArrowUpIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M5 10l7-7m0 0l7 7m-7-7v18\" />\n </svg>\n)\n\nconst CloseIcon = () => (\n <svg xmlns=\"http://www.w3.org/2000/svg\" className=\"h-6 w-6\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n)\n\nexport interface FloatButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> {\n /** Icon to display */\n icon?: React.ReactNode\n /** Description text below icon */\n description?: React.ReactNode\n /** Button type/color */\n type?: 'default' | 'primary'\n /** Button shape */\n shape?: 'circle' | 'square'\n /** Tooltip text */\n tooltip?: string\n /** Tooltip placement */\n tooltipPlacement?: 'left' | 'right' | 'top' | 'bottom'\n /** Badge content */\n badge?: number | React.ReactNode\n /** Link URL (renders as anchor) */\n href?: string\n /** Link target */\n target?: string\n /** @deprecated Use icon prop instead */\n children?: React.ReactNode\n}\n\nexport interface FloatButtonGroupProps {\n /** Child FloatButton components */\n children: React.ReactNode\n /** Arrange buttons in a quarter-circle (radial) layout */\n flower?: boolean\n /** Button shape for children */\n shape?: 'circle' | 'square'\n /** Main trigger button icon */\n icon?: React.ReactNode\n /** Main action button that replaces trigger when open (fab-main-action) */\n mainAction?: React.ReactNode\n /** Click handler for main action button */\n onMainAction?: () => void\n /** Show close button when open (fab-close) */\n showClose?: boolean\n /** Button type/color */\n type?: 'default' | 'primary'\n /** Position on screen */\n position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left'\n /** Distance from edge */\n offset?: number\n /** Additional CSS classes */\n className?: string\n /** Custom styles */\n style?: React.CSSProperties\n}\n\nexport interface BackTopProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type' | 'onClick'> {\n /** Scroll threshold to show button (pixels) */\n visibilityHeight?: number\n /** Scroll target (default: window) */\n target?: () => HTMLElement | Window\n /** Click handler (called before scrolling) */\n onClick?: () => void\n /** Custom icon */\n icon?: React.ReactNode\n /** Duration of scroll animation in ms */\n duration?: number\n /** Position on screen */\n position?: 'bottom-right' | 'bottom-left'\n /** Distance from edge in pixels */\n offset?: number\n /** @deprecated Use icon prop instead */\n children?: React.ReactNode\n}\n\n// Context for group\ninterface FloatButtonGroupContextValue {\n inGroup: boolean\n shape?: 'circle' | 'square'\n}\n\nconst FloatButtonGroupContext = createContext<FloatButtonGroupContextValue>({ inGroup: false })\n\nconst tooltipPlacementClasses: Record<string, string> = {\n left: 'tooltip-left',\n right: 'tooltip-right',\n top: 'tooltip-top',\n bottom: 'tooltip-bottom',\n}\n\nconst typeClasses: Record<string, string> = {\n default: 'btn-neutral',\n primary: 'btn-primary',\n}\n\nconst shapeClasses: Record<string, string> = {\n circle: 'btn-circle',\n square: 'btn-square',\n}\n\ninterface FloatButtonComponent extends React.FC<FloatButtonProps> {\n Group: React.FC<FloatButtonGroupProps>\n BackTop: React.FC<BackTopProps>\n}\n\nconst FloatButtonBase: React.FC<FloatButtonProps & { style?: React.CSSProperties }> = ({\n icon,\n description,\n onClick,\n type = 'default',\n shape = 'circle',\n className = '',\n tooltip,\n tooltipPlacement = 'left',\n badge,\n href,\n target,\n children,\n style,\n ...rest\n}) => {\n const groupContext = useContext(FloatButtonGroupContext)\n const effectiveShape = groupContext.inGroup ? (groupContext.shape || shape) : shape\n\n const buttonClasses = [\n 'btn',\n 'btn-lg',\n 'shadow-lg',\n shapeClasses[effectiveShape],\n typeClasses[type],\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n const content = icon || children || <PlusIcon />\n\n const buttonContent = (\n <>\n {description ? (\n <div className=\"flex flex-col items-center\">\n {content}\n <span className=\"text-xs mt-1\">{description}</span>\n </div>\n ) : (\n content\n )}\n </>\n )\n\n // When inside a group, render simple button without wrapper divs\n // DaisyUI's fab CSS requires direct button children\n if (groupContext.inGroup) {\n return href ? (\n <a\n href={href}\n target={target}\n className={buttonClasses}\n title={tooltip}\n onClick={onClick as any}\n {...(rest as any)}\n >\n {buttonContent}\n </a>\n ) : (\n <button className={buttonClasses} title={tooltip} onClick={onClick} {...rest}>\n {buttonContent}\n </button>\n )\n }\n\n const buttonElement = href ? (\n <a\n href={href}\n target={target}\n className={buttonClasses}\n style={style}\n onClick={onClick as any}\n {...(rest as any)}\n >\n {buttonContent}\n </a>\n ) : (\n <button className={buttonClasses} onClick={onClick} style={style} {...rest}>\n {buttonContent}\n </button>\n )\n\n const withBadge = badge !== undefined ? (\n <div className=\"indicator\" style={style}>\n <span className=\"indicator-item badge badge-secondary\">\n {badge}\n </span>\n {href ? (\n <a href={href} target={target} className={buttonClasses} onClick={onClick as any} {...(rest as any)}>\n {buttonContent}\n </a>\n ) : (\n <button className={buttonClasses} onClick={onClick} {...rest}>\n {buttonContent}\n </button>\n )}\n </div>\n ) : buttonElement\n\n if (tooltip) {\n return (\n <div className={`tooltip ${tooltipPlacementClasses[tooltipPlacement]}`} data-tip={tooltip} style={style}>\n {badge !== undefined ? (\n <div className=\"indicator\">\n <span className=\"indicator-item badge badge-secondary\">{badge}</span>\n {href ? (\n <a href={href} target={target} className={buttonClasses} onClick={onClick as any} {...(rest as any)}>\n {buttonContent}\n </a>\n ) : (\n <button className={buttonClasses} onClick={onClick} {...rest}>\n {buttonContent}\n </button>\n )}\n </div>\n ) : href ? (\n <a href={href} target={target} className={buttonClasses} onClick={onClick as any} {...(rest as any)}>\n {buttonContent}\n </a>\n ) : (\n <button className={buttonClasses} onClick={onClick} {...rest}>\n {buttonContent}\n </button>\n )}\n </div>\n )\n }\n\n return withBadge\n}\n\nexport const FloatButton: FloatButtonComponent = (props) => {\n const {\n style: propStyle,\n ...rest\n } = props\n\n const groupContext = useContext(FloatButtonGroupContext)\n\n // If in group, don't apply fixed positioning\n if (groupContext.inGroup) {\n return <FloatButtonBase {...rest} />\n }\n\n // Standalone button with fixed positioning\n const style: React.CSSProperties = {\n position: 'fixed',\n zIndex: 1000,\n bottom: 24,\n right: 24,\n ...propStyle,\n }\n\n return <FloatButtonBase {...rest} style={style} />\n}\n\nconst FloatButtonGroup: React.FC<FloatButtonGroupProps> = ({\n children,\n flower = false,\n shape = 'circle',\n icon,\n mainAction,\n onMainAction,\n showClose = false,\n type = 'default',\n position = 'bottom-right',\n offset = 24,\n className = '',\n style: propStyle,\n}) => {\n const fabClasses = [\n 'fab',\n flower ? 'fab-flower' : '',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n const triggerButtonClasses = [\n 'btn',\n 'btn-lg',\n 'shadow-lg',\n shapeClasses[shape],\n typeClasses[type],\n ]\n .filter(Boolean)\n .join(' ')\n\n const containerStyle: React.CSSProperties = {\n ...(position.includes('bottom') ? { bottom: offset } : { top: offset }),\n ...(position.includes('right') ? { right: offset } : { left: offset }),\n ...propStyle,\n }\n\n return (\n <div className={fabClasses} style={containerStyle}>\n {/* Trigger button - shown when closed */}\n <div\n tabIndex={0}\n role=\"button\"\n className={triggerButtonClasses}\n >\n {icon || <PlusIcon />}\n </div>\n\n {/* Main action button - shown when open (replaces trigger in flower mode) */}\n {mainAction && (\n <button\n className={`${triggerButtonClasses} fab-main-action`}\n onClick={onMainAction}\n >\n {mainAction}\n </button>\n )}\n\n {/* Close button - shown when open */}\n {showClose && (\n <button className={`${triggerButtonClasses} fab-close`}>\n <CloseIcon />\n </button>\n )}\n\n <FloatButtonGroupContext.Provider value={{ inGroup: true, shape }}>\n {children}\n </FloatButtonGroupContext.Provider>\n </div>\n )\n}\n\nconst BackTop: React.FC<BackTopProps> = ({\n visibilityHeight = 400,\n target,\n onClick,\n icon,\n duration = 450,\n position = 'bottom-right',\n offset = 24,\n className = '',\n children,\n style: propStyle,\n ...rest\n}) => {\n const [visible, setVisible] = useState(false)\n\n useEffect(() => {\n const scrollTarget = target ? target() : window\n\n const handleScroll = () => {\n const scrollTop =\n scrollTarget instanceof Window\n ? window.scrollY\n : (scrollTarget as HTMLElement).scrollTop\n\n setVisible(scrollTop >= visibilityHeight)\n }\n\n scrollTarget.addEventListener('scroll', handleScroll)\n handleScroll()\n\n return () => scrollTarget.removeEventListener('scroll', handleScroll)\n }, [target, visibilityHeight])\n\n const handleClick = () => {\n onClick?.()\n const scrollTarget = target ? target() : window\n if (scrollTarget instanceof Window) {\n window.scrollTo({ top: 0, behavior: 'smooth' })\n } else {\n (scrollTarget as HTMLElement).scrollTo({ top: 0, behavior: 'smooth' })\n }\n }\n\n if (!visible) return null\n\n const buttonClasses = [\n 'btn',\n 'btn-lg',\n 'btn-circle',\n 'btn-neutral',\n 'shadow-lg',\n 'transition-opacity',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n const style: React.CSSProperties = {\n position: 'fixed',\n zIndex: 1000,\n bottom: offset,\n ...(position.includes('right') ? { right: offset } : { left: offset }),\n ...propStyle,\n }\n\n return (\n <button className={buttonClasses} onClick={handleClick} style={style} {...rest}>\n {icon || children || <ArrowUpIcon />}\n </button>\n )\n}\n\nFloatButton.Group = FloatButtonGroup\nFloatButton.BackTop = BackTop\n"],"names":["PlusIcon","jsx","ArrowUpIcon","CloseIcon","FloatButtonGroupContext","createContext","tooltipPlacementClasses","typeClasses","shapeClasses","FloatButtonBase","icon","description","onClick","type","shape","className","tooltip","tooltipPlacement","badge","href","target","children","style","rest","groupContext","useContext","effectiveShape","buttonClasses","content","buttonContent","Fragment","jsxs","buttonElement","withBadge","FloatButton","props","propStyle","FloatButtonGroup","flower","mainAction","onMainAction","showClose","position","offset","fabClasses","triggerButtonClasses","containerStyle","BackTop","visibilityHeight","duration","visible","setVisible","useState","useEffect","scrollTarget","handleScroll","scrollTop","handleClick"],"mappings":";;AAGA,MAAMA,IAAW,MACf,gBAAAC,EAAC,OAAA,EAAI,OAAM,8BAA6B,WAAU,WAAU,MAAK,QAAO,SAAQ,aAAY,QAAO,gBACjG,UAAA,gBAAAA,EAAC,QAAA,EAAK,eAAc,SAAQ,gBAAe,SAAQ,aAAa,GAAG,GAAE,iBAAA,CAAiB,EAAA,CACxF,GAGIC,IAAc,MAClB,gBAAAD,EAAC,OAAA,EAAI,OAAM,8BAA6B,WAAU,WAAU,MAAK,QAAO,SAAQ,aAAY,QAAO,gBACjG,UAAA,gBAAAA,EAAC,QAAA,EAAK,eAAc,SAAQ,gBAAe,SAAQ,aAAa,GAAG,GAAE,4BAAA,CAA4B,EAAA,CACnG,GAGIE,IAAY,MAChB,gBAAAF,EAAC,OAAA,EAAI,OAAM,8BAA6B,WAAU,WAAU,MAAK,QAAO,SAAQ,aAAY,QAAO,gBACjG,UAAA,gBAAAA,EAAC,QAAA,EAAK,eAAc,SAAQ,gBAAe,SAAQ,aAAa,GAAG,GAAE,uBAAA,CAAuB,EAAA,CAC9F,GA8EIG,IAA0BC,EAA4C,EAAE,SAAS,IAAO,GAExFC,IAAkD;AAAA,EACtD,MAAM;AAAA,EACN,OAAO;AAAA,EACP,KAAK;AAAA,EACL,QAAQ;AACV,GAEMC,IAAsC;AAAA,EAC1C,SAAS;AAAA,EACT,SAAS;AACX,GAEMC,IAAuC;AAAA,EAC3C,QAAQ;AAAA,EACR,QAAQ;AACV,GAOMC,IAAgF,CAAC;AAAA,EACrF,MAAAC;AAAA,EACA,aAAAC;AAAA,EACA,SAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,OAAAC,IAAQ;AAAA,EACR,WAAAC,IAAY;AAAA,EACZ,SAAAC;AAAA,EACA,kBAAAC,IAAmB;AAAA,EACnB,OAAAC;AAAA,EACA,MAAAC;AAAA,EACA,QAAA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AAK,GAAG,UAAU,UAAU,IAE7CA,EAA6B,SAAS,EAAE,KAAK,GAAG,UAAU,UAAU;AAAA,EAEzE;AAEA,MAAI,CAACJ,EAAS,QAAO;AAErB,QAAMvB,IAAgB;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACAZ;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG,GAELO,IAA6B;AAAA,IACjC,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,QAAQqB;AAAA,IACR,GAAID,EAAS,SAAS,OAAO,IAAI,EAAE,OAAOC,EAAA,IAAW,EAAE,MAAMA,EAAA;AAAA,IAC7D,GAAGP;AAAA,EAAA;AAGL,SACE,gBAAAnC,EAAC,UAAA,EAAO,WAAW0B,GAAe,SAAS8B,GAAa,OAAAnC,GAAe,GAAGC,GACvE,UAAAb,KAAQW,KAAY,gBAAApB,EAACC,KAAY,GACpC;AAEJ;AAEAgC,EAAY,QAAQG;AACpBH,EAAY,UAAUa;"}
|
package/dist/index33.js
CHANGED
|
@@ -1,223 +1,21 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
message: "Please enter a valid URL"
|
|
12
|
-
},
|
|
13
|
-
number: {
|
|
14
|
-
value: /^-?\d+(\.\d+)?$/,
|
|
15
|
-
message: "Please enter a valid number"
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
function z() {
|
|
19
|
-
const r = le(P);
|
|
20
|
-
if (!r)
|
|
21
|
-
throw new Error("Form compound components must be used within Form");
|
|
22
|
-
return r;
|
|
23
|
-
}
|
|
24
|
-
function de({
|
|
25
|
-
form: r,
|
|
26
|
-
onFinish: o,
|
|
27
|
-
initialValues: s,
|
|
28
|
-
layout: u = "vertical",
|
|
29
|
-
labelWidth: m = 60,
|
|
30
|
-
size: y,
|
|
31
|
-
children: h,
|
|
32
|
-
className: l = "",
|
|
33
|
-
noValidate: i = !0,
|
|
34
|
-
...g
|
|
35
|
-
}) {
|
|
36
|
-
const p = Y({
|
|
37
|
-
defaultValues: s
|
|
38
|
-
}), v = r || p, c = ($) => {
|
|
39
|
-
$.preventDefault(), o && v.handleSubmit(o)($);
|
|
40
|
-
};
|
|
41
|
-
return /* @__PURE__ */ t(P.Provider, { value: { form: v, layout: u, labelWidth: m, size: y }, children: /* @__PURE__ */ t("form", { onSubmit: c, className: l, noValidate: i, ...g, children: h }) });
|
|
42
|
-
}
|
|
43
|
-
function fe({
|
|
44
|
-
name: r,
|
|
45
|
-
label: o,
|
|
46
|
-
help: s,
|
|
47
|
-
required: u = !1,
|
|
48
|
-
rules: m,
|
|
49
|
-
valuePropName: y = "value",
|
|
50
|
-
inline: h = !1,
|
|
51
|
-
className: l = "",
|
|
52
|
-
children: i,
|
|
53
|
-
tooltip: g,
|
|
54
|
-
extra: p,
|
|
55
|
-
hasFeedback: v = !1,
|
|
56
|
-
dependencies: c,
|
|
57
|
-
validateTrigger: $ = "onChange",
|
|
58
|
-
initialValue: B,
|
|
59
|
-
hidden: S = !1
|
|
60
|
-
}) {
|
|
61
|
-
const { form: d, size: R, listName: q, layout: W, labelWidth: G } = z(), T = J(), C = J();
|
|
62
|
-
if (!r)
|
|
63
|
-
return /* @__PURE__ */ t("div", { className: `form-control ${h ? "w-auto" : "w-full"} ${l}`, style: S ? { display: "none" } : void 0, children: i });
|
|
64
|
-
let f;
|
|
65
|
-
Array.isArray(r) ? f = (q ? [q, ...r] : r).join(".") : f = r, H(() => {
|
|
66
|
-
B !== void 0 && d.getValues(f) === void 0 && d.setValue(f, B);
|
|
67
|
-
}, []);
|
|
68
|
-
const j = ue({
|
|
69
|
-
control: d.control,
|
|
70
|
-
name: c,
|
|
71
|
-
disabled: !c || c.length === 0
|
|
72
|
-
}), Z = K(d);
|
|
73
|
-
Z.current = d;
|
|
74
|
-
const E = K(void 0);
|
|
75
|
-
H(() => {
|
|
76
|
-
if (!c || c.length === 0) return;
|
|
77
|
-
if (E.current === void 0) {
|
|
78
|
-
E.current = JSON.stringify(j);
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
const e = JSON.stringify(j);
|
|
82
|
-
E.current !== e && (E.current = e, Z.current.trigger(f));
|
|
83
|
-
}, [j, c, f]);
|
|
84
|
-
const w = ((e) => {
|
|
85
|
-
const n = e.split(".");
|
|
86
|
-
let a = d.formState.errors;
|
|
87
|
-
for (const V of n) {
|
|
88
|
-
if (!a) break;
|
|
89
|
-
a = a[V];
|
|
90
|
-
}
|
|
91
|
-
return a;
|
|
92
|
-
})(f), N = w?.message, Q = m ? Array.isArray(m) ? m : [m] : [], k = {}, A = [], I = [];
|
|
93
|
-
u && (k.required = "This field is required");
|
|
94
|
-
for (const e of Q) {
|
|
95
|
-
if (e.required && (k.required = typeof e.required == "string" ? e.required : e.message || "This field is required"), e.type && M[e.type] && A.push({
|
|
96
|
-
pattern: M[e.type].value,
|
|
97
|
-
message: e.message || M[e.type].message
|
|
98
|
-
}), e.min !== void 0) {
|
|
99
|
-
const n = typeof e.min == "object" ? e.min.value : e.min, a = typeof e.min == "object" ? e.min.message : e.message || `Minimum length is ${n} characters`;
|
|
100
|
-
k.minLength = { value: n, message: a };
|
|
101
|
-
}
|
|
102
|
-
if (e.max !== void 0) {
|
|
103
|
-
const n = typeof e.max == "object" ? e.max.value : e.max, a = typeof e.max == "object" ? e.max.message : e.message || `Maximum length is ${n} characters`;
|
|
104
|
-
k.maxLength = { value: n, message: a };
|
|
105
|
-
}
|
|
106
|
-
if (e.pattern) {
|
|
107
|
-
const n = e.pattern instanceof RegExp ? e.pattern : e.pattern.value, a = e.pattern instanceof RegExp ? e.message || "Invalid format" : e.pattern.message;
|
|
108
|
-
A.push({ pattern: n, message: a });
|
|
109
|
-
}
|
|
110
|
-
e.validate && I.push(e.validate);
|
|
111
|
-
}
|
|
112
|
-
(A.length > 0 || I.length > 0) && (k.validate = async (e) => {
|
|
113
|
-
if (!e && !k.required) return !0;
|
|
114
|
-
for (const { pattern: n, message: a } of A)
|
|
115
|
-
if (e && !n.test(e))
|
|
116
|
-
return a;
|
|
117
|
-
for (const n of I) {
|
|
118
|
-
const a = await n(e);
|
|
119
|
-
if (a !== !0)
|
|
120
|
-
return a;
|
|
121
|
-
}
|
|
122
|
-
return !0;
|
|
123
|
-
});
|
|
124
|
-
const D = Array.isArray($) ? $ : [$], O = D.includes("onChange"), X = D.includes("onBlur"), ee = ({ hasError: e, isValidating: n }) => n ? /* @__PURE__ */ t("span", { className: "loading loading-spinner loading-xs text-base-content/50" }) : e ? /* @__PURE__ */ t("svg", { className: "w-4 h-4 text-error", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) : /* @__PURE__ */ t("svg", { className: "w-4 h-4 text-success", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }), te = () => /* @__PURE__ */ t("div", { className: "tooltip tooltip-top ml-1", "data-tip": g, children: /* @__PURE__ */ t("svg", { className: "w-4 h-4 text-base-content/50 cursor-help", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }) });
|
|
125
|
-
return /* @__PURE__ */ t(
|
|
126
|
-
me,
|
|
127
|
-
{
|
|
128
|
-
name: f,
|
|
129
|
-
control: d.control,
|
|
130
|
-
rules: k,
|
|
131
|
-
render: ({ field: e, fieldState: n }) => {
|
|
132
|
-
const { value: a, onChange: V, onBlur: re, ref: se } = e, oe = n.isTouched && d.formState.isValidating, x = {
|
|
133
|
-
id: T,
|
|
134
|
-
ref: se,
|
|
135
|
-
"aria-invalid": w ? !0 : void 0,
|
|
136
|
-
"aria-describedby": w ? C : void 0
|
|
137
|
-
};
|
|
138
|
-
x.onBlur = () => {
|
|
139
|
-
re(), X && d.trigger(f);
|
|
140
|
-
}, y === "checked" ? (x.checked = a, x.onChange = (F) => {
|
|
141
|
-
V(F.target.checked), O && d.trigger(f);
|
|
142
|
-
}) : (x.value = a || "", x.onChange = (F) => {
|
|
143
|
-
F && F.target !== void 0 ? V(F.target.value) : V(F), O && d.trigger(f);
|
|
144
|
-
}), R && U(i) && (i.props.size || (x.size = R)), w && (x.color = "error", x["aria-invalid"] = !0);
|
|
145
|
-
const ne = U(i) ? ie(i, x) : i, b = W === "horizontal", _ = W === "inline";
|
|
146
|
-
return /* @__PURE__ */ L("div", { className: `form-control ${h ? "w-auto" : "w-full"} ${b ? "mb-4" : ""} ${_ ? "inline-flex mr-4" : ""} ${l}`, style: S ? { display: "none" } : void 0, children: [
|
|
147
|
-
/* @__PURE__ */ L("div", { className: b ? "flex items-center gap-4" : "", children: [
|
|
148
|
-
o && /* @__PURE__ */ t(
|
|
149
|
-
"label",
|
|
150
|
-
{
|
|
151
|
-
htmlFor: T,
|
|
152
|
-
className: `label ${b ? "flex-shrink-0 justify-end py-0" : ""} ${!b && !_ ? "pb-1" : ""}`,
|
|
153
|
-
style: b ? { width: G } : void 0,
|
|
154
|
-
children: /* @__PURE__ */ L("span", { className: "label-text flex items-center", children: [
|
|
155
|
-
o,
|
|
156
|
-
u && /* @__PURE__ */ t("span", { className: "text-error ml-1", children: "*" }),
|
|
157
|
-
g && /* @__PURE__ */ t(te, {})
|
|
158
|
-
] })
|
|
159
|
-
}
|
|
160
|
-
),
|
|
161
|
-
/* @__PURE__ */ L("div", { className: `${b ? "flex-1" : ""} ${v ? "relative" : ""}`, children: [
|
|
162
|
-
ne,
|
|
163
|
-
v && n.isTouched && /* @__PURE__ */ t("span", { className: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none", children: /* @__PURE__ */ t(ee, { hasError: !!w, isValidating: oe }) })
|
|
164
|
-
] })
|
|
165
|
-
] }),
|
|
166
|
-
!b && !h && /* @__PURE__ */ t("p", { id: C, className: `validator-hint ${N ? "!visible text-error" : ""} min-h-[1.25rem]`, role: N ? "alert" : void 0, children: N || s && /* @__PURE__ */ t("span", { className: "text-base-content/70", children: s }) || " " }),
|
|
167
|
-
b && (N || s) && /* @__PURE__ */ t("p", { id: C, className: `validator-hint ${N ? "!visible text-error" : ""} min-h-[1.25rem]`, role: N ? "alert" : void 0, children: N || s && /* @__PURE__ */ t("span", { className: "text-base-content/70", children: s }) }),
|
|
168
|
-
p && /* @__PURE__ */ t("div", { className: "text-sm text-base-content/60 mt-1", children: p })
|
|
169
|
-
] });
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
function he({
|
|
175
|
-
name: r,
|
|
176
|
-
children: o
|
|
177
|
-
}) {
|
|
178
|
-
const { form: s, layout: u, size: m } = z(), { fields: y, append: h, remove: l, move: i } = ce({
|
|
179
|
-
control: s.control,
|
|
180
|
-
name: r
|
|
181
|
-
}), g = y.map((p, v) => ({
|
|
182
|
-
...p,
|
|
183
|
-
name: v
|
|
184
|
-
}));
|
|
185
|
-
return /* @__PURE__ */ t(P.Provider, { value: { form: s, layout: u, size: m, listName: r }, children: o(g, {
|
|
186
|
-
add: h,
|
|
187
|
-
remove: l,
|
|
188
|
-
move: i
|
|
189
|
-
}) });
|
|
190
|
-
}
|
|
191
|
-
function ge() {
|
|
192
|
-
const r = Y(), o = r;
|
|
193
|
-
return o.setFieldValue = r.setValue, o.getFieldValue = (s) => r.getValues(s), o.getFieldsValue = r.getValues, o.setFieldsValue = (s) => {
|
|
194
|
-
Object.keys(s).forEach((u) => {
|
|
195
|
-
r.setValue(u, s[u]);
|
|
196
|
-
});
|
|
197
|
-
}, o.validateFields = r.trigger, o.resetFields = r.reset, o.isFieldTouched = (s) => !!r.formState.touchedFields[s], o.getFieldError = (s) => r.formState.errors[s]?.message, o;
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
function a({ children: o, className: e = "", center: t = !1, horizontal: s = !1, vertical: f = !1, ...l }) {
|
|
3
|
+
const n = [
|
|
4
|
+
"footer",
|
|
5
|
+
t && "footer-center",
|
|
6
|
+
s && "footer-horizontal",
|
|
7
|
+
f && "footer-vertical",
|
|
8
|
+
e
|
|
9
|
+
].filter(Boolean).join(" ");
|
|
10
|
+
return /* @__PURE__ */ r("footer", { className: n, ...l, children: o });
|
|
198
11
|
}
|
|
199
|
-
function
|
|
200
|
-
|
|
201
|
-
const g = [];
|
|
202
|
-
for (const p in l) {
|
|
203
|
-
const v = i ? `${i}.${p}` : p, c = l[p];
|
|
204
|
-
c?.message ? g.push({ field: v, message: c.message }) : typeof c == "object" && c !== null && g.push(...m(c, v));
|
|
205
|
-
}
|
|
206
|
-
return g;
|
|
207
|
-
}, y = m(u), h = r ? y.filter((l) => r.includes(l.field)) : y;
|
|
208
|
-
return h.length === 0 ? null : /* @__PURE__ */ t("ul", { className: `text-error text-sm space-y-1 ${o}`, role: "alert", children: h.map((l, i) => /* @__PURE__ */ L("li", { className: "flex items-start gap-2", children: [
|
|
209
|
-
/* @__PURE__ */ t("svg", { className: "w-4 h-4 mt-0.5 flex-shrink-0", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" }) }),
|
|
210
|
-
/* @__PURE__ */ t("span", { children: l.message })
|
|
211
|
-
] }, `${l.field}-${i}`)) });
|
|
12
|
+
function i({ children: o, className: e = "", ...t }) {
|
|
13
|
+
return /* @__PURE__ */ r("h6", { className: `footer-title ${e}`, ...t, children: o });
|
|
212
14
|
}
|
|
213
|
-
const
|
|
214
|
-
|
|
215
|
-
List: he,
|
|
216
|
-
ErrorList: pe,
|
|
217
|
-
useForm: ge
|
|
15
|
+
const m = Object.assign(a, {
|
|
16
|
+
Title: i
|
|
218
17
|
});
|
|
219
18
|
export {
|
|
220
|
-
|
|
221
|
-
ge as useFormInstance
|
|
19
|
+
m as Footer
|
|
222
20
|
};
|
|
223
21
|
//# sourceMappingURL=index33.js.map
|
package/dist/index33.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index33.js","sources":["../src/components/Form.tsx"],"sourcesContent":["import React, { createContext, useContext, cloneElement, isValidElement, useId, useEffect, useRef } from 'react'\nimport { useForm, UseFormReturn, FieldValues, SubmitHandler, UseFormProps, Controller, useFieldArray, FieldArrayPath, FieldArray, useWatch } from 'react-hook-form'\n\ninterface FormContextValue {\n form: UseFormReturn<any>\n layout?: 'vertical' | 'horizontal' | 'inline'\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n labelWidth?: number\n listName?: string\n}\n\nconst FormContext = createContext<FormContextValue | undefined>(undefined)\n\n// Built-in type validators\nconst TYPE_VALIDATORS = {\n email: {\n value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}$/i,\n message: 'Please enter a valid email address',\n },\n url: {\n value: /^https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)$/,\n message: 'Please enter a valid URL',\n },\n number: {\n value: /^-?\\d+(\\.\\d+)?$/,\n message: 'Please enter a valid number',\n },\n}\n\nexport interface FormProps<TFieldValues extends FieldValues = FieldValues>\n extends Omit<React.FormHTMLAttributes<HTMLFormElement>, 'onSubmit'> {\n form?: UseFormReturn<TFieldValues>\n onFinish?: SubmitHandler<TFieldValues>\n initialValues?: UseFormProps<TFieldValues>['defaultValues']\n layout?: 'vertical' | 'horizontal' | 'inline'\n /** Label width in pixels for horizontal layout (default: 80) */\n labelWidth?: number\n size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n children: React.ReactNode\n}\n\nexport interface FormRule {\n required?: boolean | string\n type?: 'email' | 'url' | 'number'\n min?: number | { value: number; message: string }\n max?: number | { value: number; message: string }\n pattern?: RegExp | { value: RegExp; message: string }\n message?: string\n validate?: (value: any) => boolean | string | Promise<boolean | string>\n}\n\nexport type ValidateTrigger = 'onChange' | 'onBlur' | 'onSubmit' | ('onChange' | 'onBlur' | 'onSubmit')[]\n\nexport interface FormItemProps {\n name?: string | string[]\n label?: string\n help?: string\n required?: boolean\n rules?: FormRule | FormRule[]\n valuePropName?: string\n inline?: boolean\n className?: string\n children: React.ReactElement\n /** Tooltip text to show next to label */\n tooltip?: string\n /** Additional content below the form control */\n extra?: React.ReactNode\n /** Show validation feedback icon */\n hasFeedback?: boolean\n /** Field names that this field depends on for validation */\n dependencies?: string[]\n /** When to trigger validation */\n validateTrigger?: ValidateTrigger\n /** Initial value for this field (overrides Form's initialValues) */\n initialValue?: any\n /** Hide this field (still validates and submits) */\n hidden?: boolean\n}\n\nexport interface FormListProps<TFieldValues extends FieldValues = FieldValues> {\n name: FieldArrayPath<TFieldValues>\n children: (\n fields: FieldArray<TFieldValues>[],\n operations: {\n add: (value?: any) => void\n remove: (index: number) => void\n move: (from: number, to: number) => void\n }\n ) => React.ReactNode\n}\n\nfunction useFormContext() {\n const context = useContext(FormContext)\n if (!context) {\n throw new Error('Form compound components must be used within Form')\n }\n return context\n}\n\nfunction FormRoot<TFieldValues extends FieldValues = FieldValues>({\n form: externalForm,\n onFinish,\n initialValues,\n layout = 'vertical',\n labelWidth = 60,\n size,\n children,\n className = '',\n noValidate = true,\n ...props\n}: FormProps<TFieldValues>) {\n const internalForm = useForm<TFieldValues>({\n defaultValues: initialValues,\n })\n\n const form = externalForm || internalForm\n\n const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {\n e.preventDefault()\n if (onFinish) {\n form.handleSubmit(onFinish)(e)\n }\n }\n\n return (\n <FormContext.Provider value={{ form, layout, labelWidth, size }}>\n <form onSubmit={handleSubmit} className={className} noValidate={noValidate} {...props}>\n {children}\n </form>\n </FormContext.Provider>\n )\n}\n\nfunction FormItem({\n name,\n label,\n help,\n required = false,\n rules,\n valuePropName = 'value',\n inline = false,\n className = '',\n children,\n tooltip,\n extra,\n hasFeedback = false,\n dependencies,\n validateTrigger = 'onChange',\n initialValue,\n hidden = false,\n}: FormItemProps) {\n const { form, size, listName, layout, labelWidth } = useFormContext()\n const inputId = useId()\n const errorId = useId()\n\n if (!name) {\n // Render without form control if no name provided\n return <div className={`form-control ${inline ? 'w-auto' : 'w-full'} ${className}`} style={hidden ? { display: 'none' } : undefined}>{children}</div>\n }\n\n // Handle nested field names (for Form.List)\n let fieldName: string\n if (Array.isArray(name)) {\n // If we're inside a Form.List, prepend the list name\n const fullPath = listName ? [listName, ...name] : name\n fieldName = fullPath.join('.')\n } else {\n fieldName = name\n }\n\n // Set initial value if provided\n useEffect(() => {\n if (initialValue !== undefined) {\n const currentValue = form.getValues(fieldName as any)\n if (currentValue === undefined) {\n form.setValue(fieldName as any, initialValue)\n }\n }\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n // Watch dependencies and re-validate when they change\n const watchedDeps = useWatch({\n control: form.control,\n name: dependencies as any,\n disabled: !dependencies || dependencies.length === 0,\n })\n\n // Use refs to avoid infinite loops\n const formRef = useRef(form)\n formRef.current = form\n const prevDepsRef = useRef<string | undefined>(undefined)\n\n useEffect(() => {\n // Skip if no dependencies\n if (!dependencies || dependencies.length === 0) return\n\n // Skip initial render\n if (prevDepsRef.current === undefined) {\n prevDepsRef.current = JSON.stringify(watchedDeps)\n return\n }\n\n // Only trigger if dependency values actually changed\n const currentDeps = JSON.stringify(watchedDeps)\n if (prevDepsRef.current !== currentDeps) {\n prevDepsRef.current = currentDeps\n formRef.current.trigger(fieldName as any)\n }\n }, [watchedDeps, dependencies, fieldName])\n\n // Get error by traversing the error object path\n const getErrorByPath = (path: string) => {\n const keys = path.split('.')\n let error: any = form.formState.errors\n for (const key of keys) {\n if (!error) break\n error = error[key]\n }\n return error\n }\n\n const error = getErrorByPath(fieldName)\n const errorMessage = error?.message as string | undefined\n\n // Normalize rules to array\n const rulesArray: FormRule[] = rules\n ? Array.isArray(rules) ? rules : [rules]\n : []\n\n // Build validation rules\n const validationRules: any = {}\n const patternValidators: Array<{ pattern: RegExp; message: string }> = []\n const customValidators: Array<(value: any) => boolean | string | Promise<boolean | string>> = []\n\n // Handle top-level required prop\n if (required) {\n validationRules.required = 'This field is required'\n }\n\n // Process each rule\n for (const rule of rulesArray) {\n // Required\n if (rule.required) {\n validationRules.required = typeof rule.required === 'string'\n ? rule.required\n : rule.message || 'This field is required'\n }\n\n // Type validator\n if (rule.type && TYPE_VALIDATORS[rule.type]) {\n patternValidators.push({\n pattern: TYPE_VALIDATORS[rule.type].value,\n message: rule.message || TYPE_VALIDATORS[rule.type].message,\n })\n }\n\n // Min length\n if (rule.min !== undefined) {\n const minValue = typeof rule.min === 'object' ? rule.min.value : rule.min\n const minMessage = typeof rule.min === 'object'\n ? rule.min.message\n : rule.message || `Minimum length is ${minValue} characters`\n validationRules.minLength = { value: minValue, message: minMessage }\n }\n\n // Max length\n if (rule.max !== undefined) {\n const maxValue = typeof rule.max === 'object' ? rule.max.value : rule.max\n const maxMessage = typeof rule.max === 'object'\n ? rule.max.message\n : rule.message || `Maximum length is ${maxValue} characters`\n validationRules.maxLength = { value: maxValue, message: maxMessage }\n }\n\n // Pattern - collect all patterns\n if (rule.pattern) {\n const patternValue = rule.pattern instanceof RegExp ? rule.pattern : rule.pattern.value\n const patternMessage = rule.pattern instanceof RegExp\n ? rule.message || 'Invalid format'\n : rule.pattern.message\n patternValidators.push({ pattern: patternValue, message: patternMessage })\n }\n\n // Custom validator\n if (rule.validate) {\n customValidators.push(rule.validate)\n }\n }\n\n // Combine all pattern and custom validators into a single validate function\n if (patternValidators.length > 0 || customValidators.length > 0) {\n validationRules.validate = async (value: any) => {\n // Skip validation if empty (required rule handles that)\n if (!value && !validationRules.required) return true\n\n // Check all patterns\n for (const { pattern, message } of patternValidators) {\n if (value && !pattern.test(value)) {\n return message\n }\n }\n\n // Run all custom validators\n for (const validator of customValidators) {\n const result = await validator(value)\n if (result !== true) {\n return result\n }\n }\n\n return true\n }\n }\n\n // Normalize validateTrigger to array\n const triggers = Array.isArray(validateTrigger) ? validateTrigger : [validateTrigger]\n const shouldValidateOnChange = triggers.includes('onChange')\n const shouldValidateOnBlur = triggers.includes('onBlur')\n\n // Feedback icons\n const FeedbackIcon = ({ hasError, isValidating }: { hasError: boolean; isValidating: boolean }) => {\n if (isValidating) {\n return (\n <span className=\"loading loading-spinner loading-xs text-base-content/50\" />\n )\n }\n if (hasError) {\n return (\n <svg className=\"w-4 h-4 text-error\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n )\n }\n return (\n <svg className=\"w-4 h-4 text-success\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M5 13l4 4L19 7\" />\n </svg>\n )\n }\n\n // Tooltip icon\n const TooltipIcon = () => (\n <div className=\"tooltip tooltip-top ml-1\" data-tip={tooltip}>\n <svg className=\"w-4 h-4 text-base-content/50 cursor-help\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z\" />\n </svg>\n </div>\n )\n\n return (\n <Controller\n name={fieldName}\n control={form.control}\n rules={validationRules}\n render={({ field, fieldState }) => {\n const { value, onChange, onBlur, ref } = field\n const isValidating = fieldState.isTouched && form.formState.isValidating\n\n // Clone the child element and inject form control props\n const childProps: any = {\n id: inputId,\n ref,\n 'aria-invalid': error ? true : undefined,\n 'aria-describedby': error ? errorId : undefined,\n }\n\n // Handle onBlur based on validateTrigger\n childProps.onBlur = () => {\n onBlur()\n if (shouldValidateOnBlur) {\n form.trigger(fieldName as any)\n }\n }\n\n // Handle different value prop names (e.g., 'checked' for checkboxes)\n if (valuePropName === 'checked') {\n childProps.checked = value\n childProps.onChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n onChange(e.target.checked)\n if (shouldValidateOnChange) {\n form.trigger(fieldName as any)\n }\n }\n } else {\n childProps.value = value || ''\n childProps.onChange = (eventOrValue: any) => {\n // Handle components that pass value directly (e.g., Range, Rating)\n // vs components that pass event object (e.g., Input, Select)\n if (eventOrValue && eventOrValue.target !== undefined) {\n onChange(eventOrValue.target.value)\n } else {\n onChange(eventOrValue)\n }\n if (shouldValidateOnChange) {\n form.trigger(fieldName as any)\n }\n }\n }\n\n // Apply size if specified at form level\n if (size && isValidElement(children)) {\n const existingProps = children.props as any\n if (!existingProps.size) {\n childProps.size = size\n }\n }\n\n // Apply error styling and accessibility\n if (error) {\n childProps.color = 'error'\n childProps['aria-invalid'] = true\n }\n\n const enhancedChild = isValidElement(children)\n ? cloneElement(children as React.ReactElement<any>, childProps)\n : children\n\n const isHorizontal = layout === 'horizontal'\n const isInline = layout === 'inline'\n\n return (\n <div className={`form-control ${inline ? 'w-auto' : 'w-full'} ${isHorizontal ? 'mb-4' : ''} ${isInline ? 'inline-flex mr-4' : ''} ${className}`} style={hidden ? { display: 'none' } : undefined}>\n <div className={isHorizontal ? 'flex items-center gap-4' : ''}>\n {label && (\n <label\n htmlFor={inputId}\n className={`label ${isHorizontal ? 'flex-shrink-0 justify-end py-0' : ''} ${!isHorizontal && !isInline ? 'pb-1' : ''}`}\n style={isHorizontal ? { width: labelWidth } : undefined}\n >\n <span className=\"label-text flex items-center\">\n {label}\n {required && <span className=\"text-error ml-1\">*</span>}\n {tooltip && <TooltipIcon />}\n </span>\n </label>\n )}\n <div className={`${isHorizontal ? 'flex-1' : ''} ${hasFeedback ? 'relative' : ''}`}>\n {enhancedChild}\n {hasFeedback && fieldState.isTouched && (\n <span className=\"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none\">\n <FeedbackIcon hasError={!!error} isValidating={isValidating} />\n </span>\n )}\n </div>\n </div>\n {!isHorizontal && !inline && (\n <p id={errorId} className={`validator-hint ${errorMessage ? '!visible text-error' : ''} min-h-[1.25rem]`} role={errorMessage ? 'alert' : undefined}>\n {errorMessage || (help && <span className=\"text-base-content/70\">{help}</span>) || '\\u00A0'}\n </p>\n )}\n {isHorizontal && (errorMessage || help) && (\n <p id={errorId} className={`validator-hint ${errorMessage ? '!visible text-error' : ''} min-h-[1.25rem]`} role={errorMessage ? 'alert' : undefined}>\n {errorMessage || (help && <span className=\"text-base-content/70\">{help}</span>)}\n </p>\n )}\n {extra && (\n <div className=\"text-sm text-base-content/60 mt-1\">{extra}</div>\n )}\n </div>\n )\n }}\n />\n )\n}\n\nfunction FormList<TFieldValues extends FieldValues = FieldValues>({\n name,\n children,\n}: FormListProps<TFieldValues>) {\n const { form, layout, size } = useFormContext()\n\n const { fields, append, remove, move } = useFieldArray({\n control: form.control,\n name,\n })\n\n // Add name (index) to each field for proper path construction\n const fieldsWithName = fields.map((field, index) => ({\n ...field,\n name: index,\n }))\n\n return (\n <FormContext.Provider value={{ form, layout, size, listName: name as string }}>\n {children(fieldsWithName as any, {\n add: append,\n remove,\n move,\n })}\n </FormContext.Provider>\n )\n}\n\n// Enhanced hook to expose full form API\nexport function useFormInstance<TFieldValues extends FieldValues = FieldValues>() {\n const formInstance = useForm<TFieldValues>()\n\n // Add convenience methods to the instance\n const enhancedInstance = formInstance as typeof formInstance & {\n setFieldValue: typeof formInstance.setValue\n getFieldValue: (name: any) => any\n getFieldsValue: typeof formInstance.getValues\n setFieldsValue: (values: any) => void\n validateFields: typeof formInstance.trigger\n resetFields: typeof formInstance.reset\n isFieldTouched: (name: string) => boolean\n getFieldError: (name: string) => string | undefined\n }\n\n // Add the alias methods\n enhancedInstance.setFieldValue = formInstance.setValue\n enhancedInstance.getFieldValue = (name: any) => formInstance.getValues(name)\n enhancedInstance.getFieldsValue = formInstance.getValues\n enhancedInstance.setFieldsValue = (values: any) => {\n Object.keys(values).forEach((key) => {\n formInstance.setValue(key as any, values[key])\n })\n }\n enhancedInstance.validateFields = formInstance.trigger\n enhancedInstance.resetFields = formInstance.reset\n enhancedInstance.isFieldTouched = (name: string) => {\n const touched = formInstance.formState.touchedFields as any\n return !!touched[name]\n }\n enhancedInstance.getFieldError = (name: string) => {\n const errors = formInstance.formState.errors as any\n return errors[name]?.message as string | undefined\n }\n\n return enhancedInstance\n}\n\nexport interface FormErrorListProps {\n /** Specific field names to show errors for (shows all errors if not specified) */\n fields?: string[]\n /** Custom className */\n className?: string\n}\n\nfunction FormErrorList({ fields, className = '' }: FormErrorListProps) {\n const { form } = useFormContext()\n const { errors } = form.formState\n\n // Flatten nested errors into a list\n const flattenErrors = (obj: any, prefix = ''): Array<{ field: string; message: string }> => {\n const result: Array<{ field: string; message: string }> = []\n\n for (const key in obj) {\n const fullKey = prefix ? `${prefix}.${key}` : key\n const value = obj[key]\n\n if (value?.message) {\n result.push({ field: fullKey, message: value.message as string })\n } else if (typeof value === 'object' && value !== null) {\n result.push(...flattenErrors(value, fullKey))\n }\n }\n\n return result\n }\n\n const allErrors = flattenErrors(errors)\n const filteredErrors = fields\n ? allErrors.filter(e => fields.includes(e.field))\n : allErrors\n\n if (filteredErrors.length === 0) {\n return null\n }\n\n return (\n <ul className={`text-error text-sm space-y-1 ${className}`} role=\"alert\">\n {filteredErrors.map((error, index) => (\n <li key={`${error.field}-${index}`} className=\"flex items-start gap-2\">\n <svg className=\"w-4 h-4 mt-0.5 flex-shrink-0\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z\" />\n </svg>\n <span>{error.message}</span>\n </li>\n ))}\n </ul>\n )\n}\n\nexport const Form = Object.assign(FormRoot, {\n Item: FormItem,\n List: FormList,\n ErrorList: FormErrorList,\n useForm: useFormInstance,\n})\n\nexport type { UseFormReturn as FormInstance }\n"],"names":["FormContext","createContext","TYPE_VALIDATORS","useFormContext","context","useContext","FormRoot","externalForm","onFinish","initialValues","layout","labelWidth","size","children","className","noValidate","props","internalForm","useForm","form","handleSubmit","e","jsx","FormItem","name","label","help","required","rules","valuePropName","inline","tooltip","extra","hasFeedback","dependencies","validateTrigger","initialValue","hidden","listName","inputId","useId","errorId","fieldName","useEffect","watchedDeps","useWatch","formRef","useRef","prevDepsRef","currentDeps","error","path","keys","key","errorMessage","rulesArray","validationRules","patternValidators","customValidators","rule","minValue","minMessage","maxValue","maxMessage","patternValue","patternMessage","value","pattern","message","validator","result","triggers","shouldValidateOnChange","shouldValidateOnBlur","FeedbackIcon","hasError","isValidating","TooltipIcon","Controller","field","fieldState","onChange","onBlur","ref","childProps","eventOrValue","isValidElement","enhancedChild","cloneElement","isHorizontal","isInline","jsxs","FormList","fields","append","remove","move","useFieldArray","fieldsWithName","index","useFormInstance","formInstance","enhancedInstance","values","FormErrorList","errors","flattenErrors","obj","prefix","fullKey","allErrors","filteredErrors","Form"],"mappings":";;;AAWA,MAAMA,IAAcC,GAA4C,MAAS,GAGnEC,IAAkB;AAAA,EACtB,OAAO;AAAA,IACL,OAAO;AAAA,IACP,SAAS;AAAA,EAAA;AAAA,EAEX,KAAK;AAAA,IACH,OAAO;AAAA,IACP,SAAS;AAAA,EAAA;AAAA,EAEX,QAAQ;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,EAAA;AAEb;AAgEA,SAASC,IAAiB;AACxB,QAAMC,IAAUC,GAAWL,CAAW;AACtC,MAAI,CAACI;AACH,UAAM,IAAI,MAAM,mDAAmD;AAErE,SAAOA;AACT;A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,EAAC,MAAA,EAAmC,WAAU,0BAC5C,UAAA;AAAA,IAAA,gBAAArE,EAAC,SAAI,WAAU,gCAA+B,MAAK,QAAO,SAAQ,aAAY,QAAO,gBACnF,4BAAC,QAAA,EAAK,eAAc,SAAQ,gBAAe,SAAQ,aAAa,GAAG,GAAE,qDAAoD,EAAA,CAC3H;AAAA,IACA,gBAAAA,EAAC,QAAA,EAAM,UAAA4B,EAAM,QAAA,CAAQ;AAAA,EAAA,KAJd,GAAGA,EAAM,KAAK,IAAIiD,CAAK,EAKhC,CACD,GACH;AAEJ;AAEO,MAAMa,KAAO,OAAO,OAAO1G,IAAU;AAAA,EAC1C,MAAMiB;AAAA,EACN,MAAMqE;AAAA,EACN,WAAWY;AAAA,EACX,SAASJ;AACX,CAAC;"}
|
|
1
|
+
{"version":3,"file":"index33.js","sources":["../src/components/Footer.tsx"],"sourcesContent":["import React from 'react'\n\nexport interface FooterProps extends React.HTMLAttributes<HTMLElement> {\n children: React.ReactNode\n center?: boolean\n horizontal?: boolean\n vertical?: boolean\n}\n\nexport interface FooterTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {\n children: React.ReactNode\n}\n\nfunction FooterRoot({ children, className = '', center = false, horizontal = false, vertical = false, ...rest }: FooterProps) {\n const classes = [\n 'footer',\n center && 'footer-center',\n horizontal && 'footer-horizontal',\n vertical && 'footer-vertical',\n className,\n ]\n .filter(Boolean)\n .join(' ')\n\n return <footer className={classes} {...rest}>{children}</footer>\n}\n\nfunction FooterTitle({ children, className = '', ...rest }: FooterTitleProps) {\n return <h6 className={`footer-title ${className}`} {...rest}>{children}</h6>\n}\n\nexport const Footer = Object.assign(FooterRoot, {\n Title: FooterTitle,\n})\n"],"names":["FooterRoot","children","className","center","horizontal","vertical","rest","classes","FooterTitle","jsx","Footer"],"mappings":";AAaA,SAASA,EAAW,EAAE,UAAAC,GAAU,WAAAC,IAAY,IAAI,QAAAC,IAAS,IAAO,YAAAC,IAAa,IAAO,UAAAC,IAAW,IAAO,GAAGC,KAAqB;AAC5H,QAAMC,IAAU;AAAA,IACd;AAAA,IACAJ,KAAU;AAAA,IACVC,KAAc;AAAA,IACdC,KAAY;AAAA,IACZH;AAAA,EAAA,EAEC,OAAO,OAAO,EACd,KAAK,GAAG;AAEX,2BAAQ,UAAA,EAAO,WAAWK,GAAU,GAAGD,GAAO,UAAAL,GAAS;AACzD;AAEA,SAASO,EAAY,EAAE,UAAAP,GAAU,WAAAC,IAAY,IAAI,GAAGI,KAA0B;AAC5E,SAAO,gBAAAG,EAAC,QAAG,WAAW,gBAAgBP,CAAS,IAAK,GAAGI,GAAO,UAAAL,GAAS;AACzE;AAEO,MAAMS,IAAS,OAAO,OAAOV,GAAY;AAAA,EAC9C,OAAOQ;AACT,CAAC;"}
|