ono-react-element 0.0.0
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/es/AutoSliderList-DqaQhmce.js +106 -0
- package/dist/es/AvatarCrop-DzGw2FVQ.js +225 -0
- package/dist/es/Button-CdxyXFF4.js +72 -0
- package/dist/es/Card3D-sf3zmiHk.js +41 -0
- package/dist/es/Checkbox-BN7rT73n.js +62 -0
- package/dist/es/InjunctiveBox-CmZg4sIq.js +39 -0
- package/dist/es/Input-wORRaL9-.js +301 -0
- package/dist/es/List-B9mP7VjN.js +35 -0
- package/dist/es/MenuButton-CuOdVlg0.js +62 -0
- package/dist/es/Message-BMimz-k2.js +219 -0
- package/dist/es/Modal-BAJOEXRd.js +154 -0
- package/dist/es/Pagination-BtmtUkVw.js +110 -0
- package/dist/es/PortalRenderer-8Iur-eZp.js +38 -0
- package/dist/es/Radio-BmSpqdK8.js +113 -0
- package/dist/es/SvgImg-Bcmzdjzl.js +38 -0
- package/dist/es/Switch-hGQGZVO2.js +110 -0
- package/dist/es/TemplateDialog-DuURiDPX.js +75 -0
- package/dist/es/Toast-CkC8zQdq.js +174 -0
- package/dist/es/Tooltip-C_gPojr9.js +94 -0
- package/dist/es/VirtualList-D8M5JJ-W.js +160 -0
- package/dist/es/Waterfall-BXE2_5Sj.js +131 -0
- package/dist/es/dependencies-DWmdjl5u.js +25491 -0
- package/dist/es/hooks-Bj-aT2k8.js +159 -0
- package/dist/es/index.js +227 -0
- package/dist/es/utils-ziqvBIOU.js +567 -0
- package/dist/index.css +1 -0
- package/dist/types/components/AutoSliderList/AutoSliderList.d.ts +2 -0
- package/dist/types/components/AutoSliderList/index.d.ts +2 -0
- package/dist/types/components/AutoSliderList/types.d.ts +23 -0
- package/dist/types/components/AvatarCrop/AvatarCanvas.d.ts +2 -0
- package/dist/types/components/AvatarCrop/AvatarCrop.d.ts +13 -0
- package/dist/types/components/AvatarCrop/index.d.ts +1 -0
- package/dist/types/components/AvatarCrop/types.d.ts +42 -0
- package/dist/types/components/Button/Button.d.ts +2 -0
- package/dist/types/components/Button/index.d.ts +2 -0
- package/dist/types/components/Button/types.d.ts +20 -0
- package/dist/types/components/Card3D/Card3D.d.ts +12 -0
- package/dist/types/components/Card3D/index.d.ts +1 -0
- package/dist/types/components/Checkbox/Checkbox.d.ts +2 -0
- package/dist/types/components/Checkbox/index.d.ts +2 -0
- package/dist/types/components/Checkbox/types.d.ts +12 -0
- package/dist/types/components/InjunctiveBox/InjunctiveBox.d.ts +18 -0
- package/dist/types/components/InjunctiveBox/index.d.ts +1 -0
- package/dist/types/components/Input/Input.d.ts +2 -0
- package/dist/types/components/Input/Textarea.d.ts +2 -0
- package/dist/types/components/Input/index.d.ts +2 -0
- package/dist/types/components/Input/types.d.ts +46 -0
- package/dist/types/components/List/AwaitList.d.ts +3 -0
- package/dist/types/components/List/List.d.ts +3 -0
- package/dist/types/components/List/index.d.ts +2 -0
- package/dist/types/components/List/types.d.ts +11 -0
- package/dist/types/components/MenuButton/MenuButton.d.ts +2 -0
- package/dist/types/components/MenuButton/index.d.ts +1 -0
- package/dist/types/components/MenuButton/types.d.ts +8 -0
- package/dist/types/components/Message/Message.d.ts +8 -0
- package/dist/types/components/Message/index.d.ts +1 -0
- package/dist/types/components/Message/types.d.ts +20 -0
- package/dist/types/components/Message/utils.d.ts +23 -0
- package/dist/types/components/Modal/Modal.d.ts +2 -0
- package/dist/types/components/Modal/index.d.ts +1 -0
- package/dist/types/components/Modal/types.d.ts +27 -0
- package/dist/types/components/Pagination/Pagination.d.ts +2 -0
- package/dist/types/components/Pagination/index.d.ts +1 -0
- package/dist/types/components/Pagination/types.d.ts +20 -0
- package/dist/types/components/PortalRenderer/PortalRenderer.d.ts +2 -0
- package/dist/types/components/PortalRenderer/index.d.ts +1 -0
- package/dist/types/components/Radio/Radio.d.ts +2 -0
- package/dist/types/components/Radio/RadioGroup.d.ts +2 -0
- package/dist/types/components/Radio/index.d.ts +2 -0
- package/dist/types/components/Radio/types.d.ts +26 -0
- package/dist/types/components/Select/Option.d.ts +2 -0
- package/dist/types/components/Select/Select.d.ts +2 -0
- package/dist/types/components/Select/index.d.ts +1 -0
- package/dist/types/components/Select/types.d.ts +30 -0
- package/dist/types/components/SvgImg/SvgImg.d.ts +10 -0
- package/dist/types/components/SvgImg/index.d.ts +1 -0
- package/dist/types/components/Switch/Switch.d.ts +2 -0
- package/dist/types/components/Switch/index.d.ts +1 -0
- package/dist/types/components/Switch/types.d.ts +18 -0
- package/dist/types/components/TemplateDialog/TemplateDialog.d.ts +2 -0
- package/dist/types/components/TemplateDialog/index.d.ts +1 -0
- package/dist/types/components/TemplateDialog/types.d.ts +19 -0
- package/dist/types/components/Toast/Toast.d.ts +7 -0
- package/dist/types/components/Toast/index.d.ts +1 -0
- package/dist/types/components/Toast/types.d.ts +19 -0
- package/dist/types/components/Tooltip/Tooltip.d.ts +2 -0
- package/dist/types/components/Tooltip/index.d.ts +1 -0
- package/dist/types/components/Tooltip/types.d.ts +15 -0
- package/dist/types/components/VirtualList/EstimatedVirtualList.d.ts +2 -0
- package/dist/types/components/VirtualList/index.d.ts +2 -0
- package/dist/types/components/VirtualList/types.d.ts +35 -0
- package/dist/types/components/Waterfall/Waterfall.d.ts +2 -0
- package/dist/types/components/Waterfall/index.d.ts +2 -0
- package/dist/types/components/Waterfall/types.d.ts +23 -0
- package/dist/types/components/index.d.ts +21 -0
- package/dist/types/hooks/index.d.ts +7 -0
- package/dist/types/hooks/useClickOutSide.d.ts +9 -0
- package/dist/types/hooks/useCountdown.d.ts +1 -0
- package/dist/types/hooks/useEventListener.d.ts +8 -0
- package/dist/types/hooks/useGetElementSize.d.ts +5 -0
- package/dist/types/hooks/useKeyPress.d.ts +12 -0
- package/dist/types/hooks/useTheme.d.ts +8 -0
- package/dist/types/hooks/useThemePro.d.ts +11 -0
- package/dist/types/index.d.ts +8 -0
- package/dist/types/utils/colorUtils.d.ts +33 -0
- package/dist/types/utils/common.d.ts +96 -0
- package/dist/types/utils/fileFormatConversion.d.ts +10 -0
- package/dist/types/utils/formatTimeUtils.d.ts +6 -0
- package/dist/types/utils/viewTransitionUtils.d.ts +9 -0
- package/dist/umd/index.css +1 -0
- package/dist/umd/index.umd.cjs +298 -0
- package/package.json +49 -0
|
@@ -0,0 +1,567 @@
|
|
|
1
|
+
import { p as j } from "./PortalRenderer-8Iur-eZp.js";
|
|
2
|
+
const L = (t, n) => {
|
|
3
|
+
const e = document.createElement("style");
|
|
4
|
+
e.setAttribute("type", "text/css"), e.setAttribute("data-style-tag", n), e.textContent = t, document.head.appendChild(e);
|
|
5
|
+
}, U = (t) => {
|
|
6
|
+
document.head.querySelectorAll("style").forEach(
|
|
7
|
+
(e) => e.getAttribute("data-style-tag") === t && e.remove()
|
|
8
|
+
);
|
|
9
|
+
}, E = (t) => {
|
|
10
|
+
const n = "ono-view-transition-clip-path-circle", { element: e, duration: s = 300, themeRules: r, onChangeTheme: o } = t, i = r != null && r() || document.documentElement.classList.contains("dark") ? "dark" : "light";
|
|
11
|
+
if (!document.startViewTransition)
|
|
12
|
+
return o(i === "dark" ? "light" : "dark");
|
|
13
|
+
const a = document.startViewTransition(() => {
|
|
14
|
+
const R = document.documentElement.classList.contains("dark");
|
|
15
|
+
o(R ? "light" : "dark");
|
|
16
|
+
}), { top: l, left: u, width: c, height: g } = e.getBoundingClientRect(), b = u + c / 2, f = l + g / 2, P = Math.hypot(
|
|
17
|
+
Math.max(b, window.innerWidth - b),
|
|
18
|
+
Math.max(f, window.innerHeight - f)
|
|
19
|
+
), S = [
|
|
20
|
+
`circle(0% at ${b}px ${f}px)`,
|
|
21
|
+
`circle(${P}px at ${b}px ${f}px)`
|
|
22
|
+
];
|
|
23
|
+
L(
|
|
24
|
+
`
|
|
25
|
+
::view-transition-old(root),
|
|
26
|
+
::view-transition-new(root) {
|
|
27
|
+
animation: none;
|
|
28
|
+
}
|
|
29
|
+
.dark::view-transition-old(root) {
|
|
30
|
+
z-index: 1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.dark::view-transition-new(root) {
|
|
34
|
+
z-index: 999;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
::view-transition-old(root) {
|
|
38
|
+
z-index: 999;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
::view-transition-new(root) {
|
|
42
|
+
z-index: 1;
|
|
43
|
+
}
|
|
44
|
+
`,
|
|
45
|
+
n
|
|
46
|
+
), a.ready.then(() => {
|
|
47
|
+
document.documentElement.animate(
|
|
48
|
+
{
|
|
49
|
+
clipPath: i === "light" ? S : S.reverse()
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
duration: s,
|
|
53
|
+
easing: "ease-in-out",
|
|
54
|
+
pseudoElement: i === "light" ? "::view-transition-new(root)" : "::view-transition-old(root)"
|
|
55
|
+
}
|
|
56
|
+
), setTimeout(() => U(n), s + 100);
|
|
57
|
+
});
|
|
58
|
+
}, Mt = {
|
|
59
|
+
changeThemeClipPathCircle: E
|
|
60
|
+
}, M = (t) => t <= 11 ? Math.random().toString(36).substring(2, 2 + t).padEnd(t, "0") : M(11) + M(t - 11), z = ({
|
|
61
|
+
el: t,
|
|
62
|
+
str: n = "hello world",
|
|
63
|
+
speed: e = 100,
|
|
64
|
+
isExtendStr: s = !0,
|
|
65
|
+
onDone: r
|
|
66
|
+
}) => {
|
|
67
|
+
let o = 0, i = null;
|
|
68
|
+
t.textContent && s && (o = t.textContent.length, n = t.textContent + n);
|
|
69
|
+
const a = () => {
|
|
70
|
+
clearTimeout(i);
|
|
71
|
+
const l = n.substring(0, o + 1);
|
|
72
|
+
t.textContent = l, o++, o !== n.length ? i = setTimeout(a, e) : r && r();
|
|
73
|
+
};
|
|
74
|
+
a();
|
|
75
|
+
}, Y = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
|
76
|
+
navigator.userAgent
|
|
77
|
+
), W = async (t, n) => {
|
|
78
|
+
const e = (s, r) => {
|
|
79
|
+
const o = window.URL.createObjectURL(s), i = document.createElement("a");
|
|
80
|
+
i.href = o, i.download = encodeURIComponent(r), document.body.appendChild(i), i.click(), document.body.removeChild(i), window.URL.revokeObjectURL(o);
|
|
81
|
+
};
|
|
82
|
+
try {
|
|
83
|
+
if (typeof t == "string") {
|
|
84
|
+
const s = await fetch(t);
|
|
85
|
+
if (!s.ok)
|
|
86
|
+
throw new Error(`Network response was not ok: ${s.statusText}`);
|
|
87
|
+
const r = await s.blob();
|
|
88
|
+
e(r, n);
|
|
89
|
+
} else e(t, n);
|
|
90
|
+
} catch (s) {
|
|
91
|
+
console.error(
|
|
92
|
+
"文件下载失败:",
|
|
93
|
+
s instanceof Error ? s.message : String(s)
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
}, H = (t, n) => {
|
|
97
|
+
t.toString().startsWith("2") ? n.onSuccess && n.onSuccess() : t.toString().startsWith("4") || t.toString().startsWith("5") ? n.onFail && n.onFail() : console.log("未知状态码");
|
|
98
|
+
}, xt = (t) => {
|
|
99
|
+
const n = t.getBoundingClientRect();
|
|
100
|
+
return { x: n.left + n.width / 2, y: n.top + n.height / 2 };
|
|
101
|
+
}, K = (t, n, e) => {
|
|
102
|
+
const s = new IntersectionObserver(n, e);
|
|
103
|
+
t instanceof HTMLElement ? s.observe(t) : t.forEach((r) => s.observe(r));
|
|
104
|
+
}, q = (t) => {
|
|
105
|
+
const n = Math.floor(t / 3600), e = Math.floor(t % 3600 / 60), s = Math.floor(t % 60), r = (o) => o.toString().padStart(2, "0");
|
|
106
|
+
return (n > 0 ? `${r(n)}:${r(e)}:${r(s)}` : `${r(e)}:${r(s)}`) + (t < 10 ? ".00" : t < 100 ? ".0" : "");
|
|
107
|
+
}, x = (t) => {
|
|
108
|
+
if (t.length < 2) return t;
|
|
109
|
+
const n = t[0], e = t.slice(1).filter((r) => r <= n), s = t.slice(1).filter((r) => r > n);
|
|
110
|
+
return [...x(e), n, ...x(s)];
|
|
111
|
+
}, J = (t, n) => {
|
|
112
|
+
const e = ["B", "KB", "MB", "GB", "TB"];
|
|
113
|
+
let r = e.indexOf((n == null ? void 0 : n.unit) ?? "B");
|
|
114
|
+
if (r === -1)
|
|
115
|
+
throw new Error("Invalid unit");
|
|
116
|
+
if (!(n != null && n.unit))
|
|
117
|
+
for (; t / Math.pow(1024, r) >= 1024; )
|
|
118
|
+
r++;
|
|
119
|
+
return `${(t / Math.pow(1024, r)).toFixed(
|
|
120
|
+
(n == null ? void 0 : n.decimalPlaces) ?? 0
|
|
121
|
+
)} ${e[r]}`;
|
|
122
|
+
}, V = (t, n) => {
|
|
123
|
+
const e = Math.floor(t / I(t, n)), s = Math.floor(n / I(t, n));
|
|
124
|
+
return `${e}:${s}`;
|
|
125
|
+
}, I = (t, n) => {
|
|
126
|
+
for (; n !== 0; ) {
|
|
127
|
+
const e = n;
|
|
128
|
+
n = t % n, t = e;
|
|
129
|
+
}
|
|
130
|
+
return t;
|
|
131
|
+
}, G = (t) => new URLSearchParams(window.location.search).get(t), Q = (t) => {
|
|
132
|
+
let n;
|
|
133
|
+
const e = new Proxy(t, {
|
|
134
|
+
construct(s, r) {
|
|
135
|
+
return n || (n = Reflect.construct(s, r)), n;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
return e.prototype.construct = e, e;
|
|
139
|
+
}, Z = (t) => typeof t != "string" || t.length === 0 ? "" : t.charAt(0).toUpperCase() + t.slice(1), T = (t) => {
|
|
140
|
+
if (typeof t != "object" || t === null) return t;
|
|
141
|
+
const n = Array.isArray(t) ? [] : {};
|
|
142
|
+
for (const e in t)
|
|
143
|
+
Object.prototype.hasOwnProperty.call(t, e) && (n[e] = T(
|
|
144
|
+
t[e]
|
|
145
|
+
));
|
|
146
|
+
return n;
|
|
147
|
+
}, X = (t) => new Promise((n) => {
|
|
148
|
+
const e = new Image();
|
|
149
|
+
e.src = typeof t == "string" ? t : URL.createObjectURL(t), e.onload = () => n({ width: e.width, height: e.height });
|
|
150
|
+
}), $t = (t) => parseFloat(t.replace(/[^0-9.]/g, "")), _ = (t, n, e, s) => Math.sqrt((t - e) ** 2 + (n - s) ** 2), tt = (t) => navigator.clipboard.writeText(t), A = (t) => {
|
|
151
|
+
if (!t) return "";
|
|
152
|
+
const n = t.lastIndexOf(".");
|
|
153
|
+
return n === -1 ? A(t.substring(t.lastIndexOf("/") + 1)) : t.substring(0, n);
|
|
154
|
+
}, et = (t) => {
|
|
155
|
+
if (!t) return "";
|
|
156
|
+
const n = t.lastIndexOf(".");
|
|
157
|
+
return t.substring(n + 1);
|
|
158
|
+
}, yt = {
|
|
159
|
+
randomString: M,
|
|
160
|
+
printStr: z,
|
|
161
|
+
downloadFile: W,
|
|
162
|
+
createIntersectionObserver: K,
|
|
163
|
+
checkDeviceIsMobile: Y,
|
|
164
|
+
checkStatusCode: H,
|
|
165
|
+
formatSecondes: q,
|
|
166
|
+
quickSort: x,
|
|
167
|
+
formatFileSize: J,
|
|
168
|
+
calculateAspectRatio: V,
|
|
169
|
+
getURLSearchParams: G,
|
|
170
|
+
singleton: Q,
|
|
171
|
+
safeCapitalizeWord: Z,
|
|
172
|
+
deepCopy: T,
|
|
173
|
+
getImageSIze: X,
|
|
174
|
+
getPointDistance: _,
|
|
175
|
+
copy2Clipboard: tt,
|
|
176
|
+
getFileName: A,
|
|
177
|
+
getFileSuffix: et
|
|
178
|
+
};
|
|
179
|
+
let $ = 1;
|
|
180
|
+
const h = [], St = (t, n, e) => (h.length === 0 && ($ = 1), nt(n.instancesKey || "", t, {
|
|
181
|
+
id: `${e}-${$++}`,
|
|
182
|
+
key: n.instancesKey || "",
|
|
183
|
+
reactNode: t,
|
|
184
|
+
props: n,
|
|
185
|
+
offsetOptions: {
|
|
186
|
+
topOffset: 0,
|
|
187
|
+
height: 0,
|
|
188
|
+
bottomOffset: 0
|
|
189
|
+
}
|
|
190
|
+
}), h), It = (t) => {
|
|
191
|
+
const n = h.findIndex((e) => e.id === t);
|
|
192
|
+
n !== -1 && h.splice(n, 1);
|
|
193
|
+
}, Tt = (t, n) => {
|
|
194
|
+
const e = h.findIndex((s) => s.id === t);
|
|
195
|
+
e < 0 || (h[e].offsetOptions = n);
|
|
196
|
+
}, At = (t) => {
|
|
197
|
+
const n = h.findIndex((e) => e.id === t);
|
|
198
|
+
return n <= 0 ? 0 : h[n - 1].offsetOptions.topOffset;
|
|
199
|
+
}, kt = (t) => {
|
|
200
|
+
const n = h.findIndex((e) => e.id === t);
|
|
201
|
+
return n <= 0 ? 0 : h[n - 1].offsetOptions.bottomOffset;
|
|
202
|
+
}, nt = (t, n, e) => {
|
|
203
|
+
const s = (i) => j(
|
|
204
|
+
n,
|
|
205
|
+
{
|
|
206
|
+
zIndex: 999 + $ - 1,
|
|
207
|
+
...i.props,
|
|
208
|
+
id: i.id
|
|
209
|
+
},
|
|
210
|
+
i.id,
|
|
211
|
+
"ono-message-root"
|
|
212
|
+
);
|
|
213
|
+
if (!t) {
|
|
214
|
+
const i = s(e);
|
|
215
|
+
h.push({
|
|
216
|
+
...e,
|
|
217
|
+
props: { ...e.props, id: e.id, destroy: i },
|
|
218
|
+
destroy: i
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
let r = !1;
|
|
222
|
+
const o = h.map((i) => {
|
|
223
|
+
if (i.key === t) {
|
|
224
|
+
r = !0;
|
|
225
|
+
const a = { ...i.props, ...e.props };
|
|
226
|
+
return { ...i, props: a };
|
|
227
|
+
} else {
|
|
228
|
+
const a = s(i);
|
|
229
|
+
return {
|
|
230
|
+
...i,
|
|
231
|
+
props: { ...i.props, id: i.id, destroy: a },
|
|
232
|
+
destroy: a
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
});
|
|
236
|
+
if (Object.assign(h, o), !r) {
|
|
237
|
+
const i = s(e);
|
|
238
|
+
h.push({
|
|
239
|
+
...e,
|
|
240
|
+
props: { ...e.props, id: e.id, destroy: i },
|
|
241
|
+
destroy: i
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
}, Ct = (t) => {
|
|
245
|
+
var n;
|
|
246
|
+
return t ? (n = h.find((e) => e.key === t)) == null ? void 0 : n.props : null;
|
|
247
|
+
}, m = /\d+/g, rt = () => "#" + Math.random().toString(16).slice(2, 8).padEnd(6, "0"), p = (t) => {
|
|
248
|
+
const n = t.match(m), e = (o) => Number(o).toString(16).padStart(2, "0"), s = (o) => o.reduce((i, a) => i + e(a), "#"), r = (o) => {
|
|
249
|
+
const i = o, a = Number(o[o.length - 1]) !== 1 ? Number(o[o.length - 1]) : 100;
|
|
250
|
+
return i.pop(), s(i) + e(a * 2.56);
|
|
251
|
+
};
|
|
252
|
+
if (n.length === 3) return s(n);
|
|
253
|
+
if (n.length === 5) {
|
|
254
|
+
const o = [
|
|
255
|
+
n[0],
|
|
256
|
+
n[1],
|
|
257
|
+
n[2],
|
|
258
|
+
Number(n[n.length - 1]) * 10
|
|
259
|
+
];
|
|
260
|
+
return r(o);
|
|
261
|
+
}
|
|
262
|
+
return r(n);
|
|
263
|
+
}, y = (t) => {
|
|
264
|
+
const n = t.split("#")[1], e = (s) => {
|
|
265
|
+
const r = parseInt(s.slice(0, 2), 16), o = parseInt(s.slice(2, 4), 16), i = parseInt(s.slice(4, 6), 16);
|
|
266
|
+
return [r, o, i];
|
|
267
|
+
};
|
|
268
|
+
if (n.length === 8) {
|
|
269
|
+
const s = parseInt(n.slice(-2), 16) / 256, r = n.slice(0, -2), o = e(r);
|
|
270
|
+
return o.push(s), "rgba(" + o.join(", ") + ")";
|
|
271
|
+
}
|
|
272
|
+
return "rgb(" + e(n).join(", ") + ")";
|
|
273
|
+
}, st = (t, n) => {
|
|
274
|
+
if (!n) return t;
|
|
275
|
+
if (t.includes("rgba")) {
|
|
276
|
+
const e = t.split(",");
|
|
277
|
+
return e.pop(), e.push(n + ")"), e.join(",");
|
|
278
|
+
}
|
|
279
|
+
if (t.includes("rgb")) {
|
|
280
|
+
const e = t.split(","), s = "rgba(" + e[0].split("(")[1], r = e[e.length - 1].split(")")[0];
|
|
281
|
+
return [s, e[1], r, " " + n + ")"].join(",");
|
|
282
|
+
}
|
|
283
|
+
}, w = (t) => {
|
|
284
|
+
const n = t.match(m), e = Number(n[0]) / 255, s = Number(n[1]) / 255, r = Number(n[2]) / 255, o = Math.min(e, s, r), i = Math.max(e, s, r);
|
|
285
|
+
let a = 0, l = 0, u = (i + o) / 2;
|
|
286
|
+
if (i === o) a = l = 0;
|
|
287
|
+
else {
|
|
288
|
+
const c = i - o;
|
|
289
|
+
switch (l = u > 0.5 ? c / (2 - i - o) : c / (i + o), i) {
|
|
290
|
+
case e:
|
|
291
|
+
a = (s - r) / c + (s < r ? 6 : 0);
|
|
292
|
+
break;
|
|
293
|
+
case s:
|
|
294
|
+
a = (r - e) / c + 2;
|
|
295
|
+
break;
|
|
296
|
+
case r:
|
|
297
|
+
a = (e - s) / c + 4;
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
a /= 6;
|
|
301
|
+
}
|
|
302
|
+
return `hsl(${Math.round(a * 360)}, ${Math.round(l * 100)}%, ${Math.round(u * 100)}%)`;
|
|
303
|
+
}, k = (t) => {
|
|
304
|
+
const n = t.match(m), e = Number(n[0]) / 360, s = Number(n[1]) / 100, r = Number(n[2]) / 100;
|
|
305
|
+
let o, i, a;
|
|
306
|
+
function l(g, b, f) {
|
|
307
|
+
return f < 0 && (f += 1), f > 1 && (f -= 1), f < 1 / 6 ? g + (b - g) * 6 * f : f < 1 / 2 ? b : f < 2 / 3 ? g + (b - g) * (2 / 3 - f) * 6 : g;
|
|
308
|
+
}
|
|
309
|
+
let u = r < 0.5 ? r * (1 + s) : r + s - r * s, c = 2 * r - u;
|
|
310
|
+
return o = l(c, u, e + 1 / 3), i = l(c, u, e), a = l(c, u, e - 1 / 3), `rgb(${Math.round(o * 255)}, ${Math.round(i * 255)}, ${Math.round(a * 255)})`;
|
|
311
|
+
}, C = (t) => w(y(t)), v = (t) => p(k(t)), N = (t) => {
|
|
312
|
+
const n = t.match(m);
|
|
313
|
+
let e = Number(n[0]) / 255, s = Number(n[1]) / 255, r = Number(n[2]) / 255;
|
|
314
|
+
const o = Math.max(e, s, r), i = Math.min(e, s, r);
|
|
315
|
+
let a = 0, l = 0, u = o;
|
|
316
|
+
const c = o - i;
|
|
317
|
+
if (l = o === 0 ? 0 : c / o, o === i)
|
|
318
|
+
a = 0;
|
|
319
|
+
else {
|
|
320
|
+
switch (o) {
|
|
321
|
+
case e:
|
|
322
|
+
a = (s - r) / c + (s < r ? 6 : 0);
|
|
323
|
+
break;
|
|
324
|
+
case s:
|
|
325
|
+
a = (r - e) / c + 2;
|
|
326
|
+
break;
|
|
327
|
+
case r:
|
|
328
|
+
a = (e - s) / c + 4;
|
|
329
|
+
break;
|
|
330
|
+
}
|
|
331
|
+
a /= 6;
|
|
332
|
+
}
|
|
333
|
+
return `hsv(${a * 360}, ${l * 100}, ${u * 100})`;
|
|
334
|
+
}, O = (t) => {
|
|
335
|
+
const n = t.match(m);
|
|
336
|
+
let e = Number(n[0]) / 360, s = Number(n[1]) / 100, r = Number(n[2]) / 100, o, i, a, l, u, c, g, b;
|
|
337
|
+
if (e && s === 0)
|
|
338
|
+
o = i = a = r;
|
|
339
|
+
else
|
|
340
|
+
switch (e /= 60, l = Math.floor(e), u = e - l, c = r * (1 - s), g = r * (1 - s * u), b = r * (1 - s * (1 - u)), l) {
|
|
341
|
+
case 0:
|
|
342
|
+
o = r, i = b, a = c;
|
|
343
|
+
break;
|
|
344
|
+
case 1:
|
|
345
|
+
o = g, i = r, a = c;
|
|
346
|
+
break;
|
|
347
|
+
case 2:
|
|
348
|
+
o = c, i = r, a = b;
|
|
349
|
+
break;
|
|
350
|
+
case 3:
|
|
351
|
+
o = c, i = g, a = r;
|
|
352
|
+
break;
|
|
353
|
+
case 4:
|
|
354
|
+
o = b, i = c, a = r;
|
|
355
|
+
break;
|
|
356
|
+
default:
|
|
357
|
+
o = r, i = c, a = g;
|
|
358
|
+
}
|
|
359
|
+
return `rgb(${Math.round(o * 255)}, ${Math.round(i * 255)}, ${Math.round(a * 255)})`;
|
|
360
|
+
}, ot = (t) => N(y(t)), it = (t) => p(O(t)), at = (t, n, e = "rgba") => {
|
|
361
|
+
const s = t.match(m);
|
|
362
|
+
let r = Number(s[0]) / 255, o = Number(s[1]) / 255, i = Number(s[2]) / 255;
|
|
363
|
+
return e === "rgba" ? `rgba(${r},${o},${i},${n})` : e === "rgb" ? t : e === "hex" ? p(t) : e === "hsl" ? w(`rgba(${r},${o},${i},${n})`) : `rgba(${r},${o},${i},${n})`;
|
|
364
|
+
}, ct = (t) => {
|
|
365
|
+
const n = /^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})$/, e = /^rgb\((1?\d{1,3},\s*1?\d{1,3},\s*1?\d{1,3})\)$/;
|
|
366
|
+
return !!(n.test(t) || e.test(t));
|
|
367
|
+
}, D = (t) => {
|
|
368
|
+
const n = /^#([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})$/, e = /^rgb\((1?\d{1,3},\s*1?\d{1,3},\s*1?\d{1,3})\)$/;
|
|
369
|
+
return n.test(t) ? "hex" : e.test(t) ? "rgb" : "unknown";
|
|
370
|
+
}, lt = (t, n, e) => {
|
|
371
|
+
const s = D(t);
|
|
372
|
+
if (s === "hex") {
|
|
373
|
+
const r = t.replace("#", ""), o = parseInt(r.slice(0, 2), 16), i = parseInt(r.slice(2, 4), 16), a = parseInt(r.slice(4, 6), 16);
|
|
374
|
+
if (n === "lighten") {
|
|
375
|
+
const l = Math.min(255, Math.max(0, o + (255 - o) * e / 100)), u = Math.min(255, Math.max(0, i + (255 - i) * e / 100)), c = Math.min(255, Math.max(0, a + (255 - a) * e / 100));
|
|
376
|
+
return `#${l.toString(16).padStart(2, "0")}${u.toString(16).padStart(2, "0")}${c.toString(16).padStart(2, "0")}`;
|
|
377
|
+
} else if (n === "darken") {
|
|
378
|
+
const l = Math.min(255, Math.max(0, o - o * e / 100)), u = Math.min(255, Math.max(0, i - i * e / 100)), c = Math.min(255, Math.max(0, a - a * e / 100));
|
|
379
|
+
return `#${l.toString(16).padStart(2, "0")}${u.toString(16).padStart(2, "0")}${c.toString(16).padStart(2, "0")}`;
|
|
380
|
+
}
|
|
381
|
+
} else if (s === "rgb") {
|
|
382
|
+
const r = t.match(/\d+/g), o = parseInt(r[0]), i = parseInt(r[1]), a = parseInt(r[2]);
|
|
383
|
+
if (n === "lighten") {
|
|
384
|
+
const l = Math.min(255, Math.max(0, o + (255 - o) * e / 100)), u = Math.min(255, Math.max(0, i + (255 - i) * e / 100)), c = Math.min(255, Math.max(0, a + (255 - a) * e / 100));
|
|
385
|
+
return `rgb(${l},${u},${c})`;
|
|
386
|
+
} else if (n === "darken") {
|
|
387
|
+
const l = Math.min(255, Math.max(0, o - o * e / 100)), u = Math.min(255, Math.max(0, i - i * e / 100)), c = Math.min(255, Math.max(0, a - a * e / 100));
|
|
388
|
+
return `rgb(${l},${u},${c})`;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
return t;
|
|
392
|
+
}, ut = (t) => {
|
|
393
|
+
const n = t.replace("#", "").split("");
|
|
394
|
+
return `#${n[0] + n[0] + n[1] + n[1] + n[2] + n[2]}`;
|
|
395
|
+
}, ht = (t) => {
|
|
396
|
+
function n(a) {
|
|
397
|
+
if (a.startsWith("#")) {
|
|
398
|
+
a.length === 4 && (a = `#${a.slice(1).repeat(2)}`);
|
|
399
|
+
const l = parseInt(a.substr(1, 2), 16), u = parseInt(a.substr(3, 2), 16), c = parseInt(a.substr(5, 2), 16);
|
|
400
|
+
return [l, u, c];
|
|
401
|
+
} else if (a.startsWith("rgb")) {
|
|
402
|
+
const l = a.match(/\d+/g), u = parseInt(l[0]), c = parseInt(l[1]), g = parseInt(l[2]);
|
|
403
|
+
return [u, c, g];
|
|
404
|
+
}
|
|
405
|
+
return null;
|
|
406
|
+
}
|
|
407
|
+
const e = (a) => (a[0] * 299 + a[1] * 587 + a[2] * 114) / 1e3, s = (a) => a > 128 ? "#000" : "#fff", r = n(t);
|
|
408
|
+
if (r === null)
|
|
409
|
+
return null;
|
|
410
|
+
const o = e(r);
|
|
411
|
+
return s(o);
|
|
412
|
+
}, gt = (t, n, e) => {
|
|
413
|
+
let s = [];
|
|
414
|
+
if (t.includes("#")) s = C(t).match(m);
|
|
415
|
+
else if (t.includes("rgb")) s = w(t).match(m);
|
|
416
|
+
else if (t.includes("hsl")) s = t.match(m);
|
|
417
|
+
else throw new Error("颜色格式错误");
|
|
418
|
+
const r = () => n === "light" ? Number(s[2]) + e > 100 ? 100 : Number(s[2]) + e : Number(s[2]) - e < 0 ? 0 : Number(s[2]) - e;
|
|
419
|
+
return v(
|
|
420
|
+
`${s[0]}, ${s[1]}%, ${r()}%`
|
|
421
|
+
);
|
|
422
|
+
}, vt = { randomColor: rt, rgb2hex: p, hex2rgb: y, rgb2rgba: st, rgb2hsl: w, hsl2rgb: k, hex2hsl: C, hsl2hex: v, rgb2hsv: N, hsv2rgb: O, hex2hsv: ot, hsv2hex: it, formatColor: at, getContrastColor: ht, adjustColor: lt, isValidColor: ct, getColorType: D, hex3To6: ut, adjustingColors: gt }, Nt = (t) => {
|
|
423
|
+
const n = t.split(","), e = n[0].match(/:(.*?);/)[1], s = atob(n[1]);
|
|
424
|
+
let r = s.length;
|
|
425
|
+
const o = new Uint8Array(r);
|
|
426
|
+
for (; r--; ) o[r] = s.charCodeAt(r);
|
|
427
|
+
return new Blob([o], { type: e });
|
|
428
|
+
}, Ot = (t, n) => {
|
|
429
|
+
const e = t.split(","), s = e[0].match(/:(.*?);/u)[1], r = atob(e[1]);
|
|
430
|
+
let o = r.length, i = s.split("/")[1] === "jpeg" ? ".jpg" : "." + s.split("/")[1];
|
|
431
|
+
const a = new Uint8Array(o);
|
|
432
|
+
for (; o--; ) a[o] = r.charCodeAt(o);
|
|
433
|
+
const l = new Blob([a], { type: s });
|
|
434
|
+
return new File([l], n + i, {
|
|
435
|
+
type: s,
|
|
436
|
+
lastModified: (/* @__PURE__ */ new Date()).getTime()
|
|
437
|
+
});
|
|
438
|
+
}, ft = (t) => new Promise((n) => {
|
|
439
|
+
const e = new FileReader();
|
|
440
|
+
e.readAsDataURL(t), e.onload = (s) => {
|
|
441
|
+
var i;
|
|
442
|
+
const o = ((i = s.target) == null ? void 0 : i.result).split(",")[1];
|
|
443
|
+
n(o);
|
|
444
|
+
};
|
|
445
|
+
}), bt = (t, n = "abc.jpg") => new File([t], n, { type: t.type }), Dt = (t) => new Promise((n) => {
|
|
446
|
+
const e = new FileReader();
|
|
447
|
+
e.readAsDataURL(t), e.onload = (s) => {
|
|
448
|
+
var r;
|
|
449
|
+
return n((r = s.target) == null ? void 0 : r.result);
|
|
450
|
+
};
|
|
451
|
+
}), Ft = (t) => t.slice(0, t.size, t.type), F = async (t) => await (await fetch(t)).blob(), Bt = async (t) => bt(await F(t)), Pt = async (t) => await ft(await F(t)), d = (t) => t < 10 ? `0${t}` : `${t}`, B = (t) => t.toString().length > 13 ? new Date(Number(t.toString().substring(0, 13))) : t.toString().length === 13 ? new Date(t) : t.toString().length < 13 && t.toString().length > 10 ? new Date(Number((t.toString() + "000").substring(0, 13))) : t.toString().length === 10 ? new Date(t * 1e3) : new Date(
|
|
452
|
+
Number((t.toString() + "000000000000").substring(0, 13))
|
|
453
|
+
), dt = (t, n) => {
|
|
454
|
+
const e = {
|
|
455
|
+
en: ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
|
|
456
|
+
cn: ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"]
|
|
457
|
+
};
|
|
458
|
+
return t.split("").map((s) => e[n][Number(s)]).join("");
|
|
459
|
+
}, mt = (t, n) => ({
|
|
460
|
+
en: [
|
|
461
|
+
"Jan",
|
|
462
|
+
"Feb",
|
|
463
|
+
"Mar",
|
|
464
|
+
"Apr",
|
|
465
|
+
"May",
|
|
466
|
+
"Jun",
|
|
467
|
+
"Jul",
|
|
468
|
+
"Aug",
|
|
469
|
+
"Sept",
|
|
470
|
+
"Oct",
|
|
471
|
+
"Nov",
|
|
472
|
+
"Dec"
|
|
473
|
+
],
|
|
474
|
+
cn: [
|
|
475
|
+
"一月",
|
|
476
|
+
"二月",
|
|
477
|
+
"三月",
|
|
478
|
+
"四月",
|
|
479
|
+
"五月",
|
|
480
|
+
"六月",
|
|
481
|
+
"七月",
|
|
482
|
+
"八月",
|
|
483
|
+
"九月",
|
|
484
|
+
"十月",
|
|
485
|
+
"十一月",
|
|
486
|
+
"十二月"
|
|
487
|
+
]
|
|
488
|
+
})[n][Number(t) - 1], pt = (t, n) => {
|
|
489
|
+
let e;
|
|
490
|
+
return n === "en" ? t === "01" || t === "21" || t === "31" ? e = Number(t) + "st" : t === "02" || t === "22" ? e = Number(t) + "nd" : t === "03" || t === "23" ? e = Number(t) + "rd" : e = Number(t) + "th" : t === "01" ? e = "一日" : t === "02" ? e = "二日" : t === "03" ? e = "三日" : t === "04" ? e = "四日" : t === "05" ? e = "五日" : t === "06" ? e = "六日" : t === "07" ? e = "七日" : t === "08" ? e = "八日" : t === "09" ? e = "九日" : t === "10" ? e = "十日" : t === "11" ? e = "十一日" : t === "12" ? e = "十二日" : t === "13" ? e = "十三日" : t === "14" ? e = "十四日" : t === "15" ? e = "十五日" : t === "16" ? e = "十六日" : t === "17" ? e = "十七日" : t === "18" ? e = "十八日" : t === "19" ? e = "十九日" : t === "20" ? e = "二十日" : t === "21" ? e = "二十一日" : t === "22" ? e = "二十二日" : t === "23" ? e = "二十三日" : t === "24" ? e = "二十四日" : t === "25" ? e = "二十五日" : t === "26" ? e = "二十六日" : t === "27" ? e = "二十七日" : t === "28" ? e = "二十八日" : t === "29" ? e = "二十九日" : t === "30" ? e = "三十日" : t === "31" && (e = "三十一日"), e ?? t;
|
|
491
|
+
}, Rt = (t, n = "YY-MM-DD hh:mm:ss") => {
|
|
492
|
+
const e = ["YY", "MM", "DD", "hh", "mm", "ss"], s = [], r = B(t);
|
|
493
|
+
s.push(r.getFullYear().toString()), s.push(d(r.getMonth() + 1)), s.push(d(r.getDate())), s.push(d(r.getHours())), s.push(d(r.getMinutes())), s.push(d(r.getSeconds()));
|
|
494
|
+
for (let o in s) n = n.replace(e[o], s[o]);
|
|
495
|
+
return n;
|
|
496
|
+
}, jt = (t, n = "YY-MM-DD hh:mm:ss", e = "cn") => {
|
|
497
|
+
const s = ["YY", "MM", "DD", "hh", "mm", "ss"], r = [], o = B(t);
|
|
498
|
+
r.push(dt(o.getFullYear().toString(), e)), r.push(mt(d(o.getMonth() + 1), e)), r.push(pt(d(o.getDate()), e)), r.push(d(o.getHours())), r.push(d(o.getMinutes())), r.push(d(o.getSeconds()));
|
|
499
|
+
for (let i in r) n = n.replace(s[i], r[i]);
|
|
500
|
+
return n;
|
|
501
|
+
}, Lt = (t, n) => {
|
|
502
|
+
const e = ["DD", "hh", "mm", "ss"], s = [];
|
|
503
|
+
s.push(Math.floor(t / (3600 * 24))), s.push(d(Math.floor(t % (3600 * 24) / 3600))), s.push(d(Math.floor(t % 3600 / 60))), s.push(d(t % 60));
|
|
504
|
+
for (let r = 0; r < e.length; r++)
|
|
505
|
+
n = n.replace(e[r], s[r].toString());
|
|
506
|
+
return n;
|
|
507
|
+
}, Ut = (t, n) => {
|
|
508
|
+
const e = {
|
|
509
|
+
year: 31536e3,
|
|
510
|
+
month: 2592e3,
|
|
511
|
+
day: 86400,
|
|
512
|
+
hour: 3600,
|
|
513
|
+
minute: 60,
|
|
514
|
+
second: 1
|
|
515
|
+
};
|
|
516
|
+
if (!e[n])
|
|
517
|
+
throw new Error(
|
|
518
|
+
'Invalid type. Please use "day", "hour", "minute", or "second".'
|
|
519
|
+
);
|
|
520
|
+
return Math.floor(t / e[n]);
|
|
521
|
+
};
|
|
522
|
+
export {
|
|
523
|
+
Rt as A,
|
|
524
|
+
A as B,
|
|
525
|
+
et as C,
|
|
526
|
+
X as D,
|
|
527
|
+
_ as E,
|
|
528
|
+
G as F,
|
|
529
|
+
jt as G,
|
|
530
|
+
z as H,
|
|
531
|
+
x as I,
|
|
532
|
+
M as J,
|
|
533
|
+
Z as K,
|
|
534
|
+
Lt as L,
|
|
535
|
+
Q as M,
|
|
536
|
+
Pt as N,
|
|
537
|
+
F as O,
|
|
538
|
+
Bt as P,
|
|
539
|
+
xt as Q,
|
|
540
|
+
Mt as R,
|
|
541
|
+
Ct as a,
|
|
542
|
+
Tt as b,
|
|
543
|
+
St as c,
|
|
544
|
+
kt as d,
|
|
545
|
+
It as e,
|
|
546
|
+
gt as f,
|
|
547
|
+
At as g,
|
|
548
|
+
Nt as h,
|
|
549
|
+
Ot as i,
|
|
550
|
+
ft as j,
|
|
551
|
+
bt as k,
|
|
552
|
+
V as l,
|
|
553
|
+
Y as m,
|
|
554
|
+
H as n,
|
|
555
|
+
vt as o,
|
|
556
|
+
$t as p,
|
|
557
|
+
yt as q,
|
|
558
|
+
Ut as r,
|
|
559
|
+
tt as s,
|
|
560
|
+
K as t,
|
|
561
|
+
T as u,
|
|
562
|
+
W as v,
|
|
563
|
+
Dt as w,
|
|
564
|
+
Ft as x,
|
|
565
|
+
J as y,
|
|
566
|
+
q as z
|
|
567
|
+
};
|
package/dist/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@charset "UTF-8";.ono-auto-slider-list-container{display:flex;list-style:none;width:fit-content;position:relative;align-items:center}.ono-auto-slider-list-container .ono-auto-slider-list-slider{top:0;left:0;z-index:0;position:absolute;background:#ccc;transform-origin:top left}.ono-auto-slider-list-is-disable{cursor:not-allowed}.ono-avatar-canvas{aspect-ratio:1;overflow:hidden;position:relative}.ono-avatar-canvas .ono-avatar-mask{display:flex;justify-content:center;align-items:center;top:0;left:0;width:100%;height:100%;position:absolute;pointer-events:none}.ono-btn-info,.ono-btn-danger,.ono-btn-warning,.ono-btn-success,.ono-btn-primary,.ono-btn-default{--btn-width: 0;--btn-height: 0;--delay: .3s;display:flex;justify-content:center;align-items:center;width:fit-content;border:none;outline:none;padding:2px 15px;font-size:16px;color:#fff;white-space:nowrap;border-radius:4px;gap:0;transition:gap .3s ease-in-out}.ono-btn-info:hover,.ono-btn-danger:hover,.ono-btn-warning:hover,.ono-btn-success:hover,.ono-btn-primary:hover,.ono-btn-default:hover{opacity:.9}.ono-btn-info:active,.ono-btn-danger:active,.ono-btn-warning:active,.ono-btn-success:active,.ono-btn-primary:active,.ono-btn-default:active{opacity:1.2}.ono-btn-default{color:#333;border:1px solid #333;background-color:transparent}.ono-btn-primary{background-color:#007bff}.ono-btn-success{background-color:#28a745}.ono-btn-warning{background-color:#ffc107}.ono-btn-danger{background-color:#dc3545}.ono-btn-info{background-color:#909399}.is-loading{opacity:.7}.is-loading .ono-btn-icon{display:grid;grid-template-columns:0fr}.is-round{border-radius:calc(var(--btn-height) / 2)}.is-icon{gap:8px}.is-circle{border-radius:50%}.is-disabled{opacity:.5;cursor:not-allowed!important}.ono-btn-icon span{overflow:hidden}.ono-loading-start{animation:loading 1s linear infinite,start var(--delay) ease-in-out forwards}.ono-loading-end{animation:loading 1s linear infinite,end var(--delay) ease-in-out forwards}@keyframes start{0%{grid-template-columns:0fr}to{grid-template-columns:1fr}}@keyframes end{0%{grid-template-columns:1fr}to{grid-template-columns:0fr}}.ono-card{overflow:hidden;transition:all .3s linear,width 0s,height 0s}.ono-card:hover{box-shadow:var(--sd)}.ono-checkbox-border,.ono-checkbox-line{--border-color: #333;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:none;width:20px;height:20px;position:relative;border:1px solid var(--border-color);background:transparent;transition:background .1s,border .1s}.ono-checkbox-border:checked,.ono-checkbox-line:checked{background:var(--checkedColor)}.ono-checkbox-border:checked:after,.ono-checkbox-line:checked:after{content:"";position:absolute;width:calc(var(--w) / 3 * 2);top:50%;left:50%;transform:translate(-50%,calc(-50% - var(--w) / 24 * 3)) rotate(-45deg);height:calc(var(--w) / 8 * 3);border:calc(var(--w) / 8) solid #fff;border-top:none;border-right:none}.ono-checkbox-border:indeterminate,.ono-checkbox-line:indeterminate{background:var(--indeterminateColor)}.ono-checkbox-border:indeterminate:after,.ono-checkbox-line:indeterminate:after{top:50%;left:50%;content:"";background:#fff;position:absolute;height:calc(var(--w) / 7);width:calc(var(--w) / 5 * 3.5);transform:translate(-50%,-50%);border-radius:calc(var(--w) / 10)}.ono-checkbox-border:indeterminate:after{content:"";width:100%;height:100%;background:transparent;border:calc(var(--w) / 8) solid #fff}.ono-menu-button{display:flex;justify-content:center;align-items:center;flex-direction:column;border:none;padding:0;margin:0;outline:none;position:relative;overflow:hidden;cursor:pointer;z-index:10}.ono-menu-button span{position:absolute}.ono-message{top:0;gap:8px;left:50%;padding:8px;color:#333;display:flex;position:fixed;font-size:16px;line-height:24px;border-radius:6px;background:#fff;align-items:center;transform-origin:top left;box-shadow:0 4px 8px #0003}.ono-message .ono-type-icon{width:20px;height:20px}.ono-info-icon{width:18px;height:18px}.ono-message-enter{animation:enter var(--speed) ease-in-out forwards}.ono-message-leave{pointer-events:none;animation:leave var(--speed) ease-in-out forwards}.ono-message-success.ono-message-color{color:#52c41a;background:#f6ffed;border:1px solid #d9f7be}.ono-message-warning.ono-message-color{color:#faad14;background:#fffbe6;border:1px solid #fff1b8}.ono-message-error.ono-message-color{color:#ff4d4f;background:#fff1f0;border:1px solid #ffccc7}.ono-message-info.ono-message-color{color:#8c8c8c;background:#f5f5f5;border:1px solid #f0f0f0}.ono-clear-icon{width:16px;height:16px;color:#999}.ono-loading{animation:loading 1s linear infinite}@keyframes enter{0%{opacity:0}to{opacity:1}}@keyframes leave{0%{opacity:1}to{opacity:0}}.ono-modal{--width: 416px;--color: #333;--themeColor: #5644b8;--themeHoverColor: #8676de;--themeActiveColor: #352494;--themeDisabledClr: #9587e7;background:transparent}.ono-modal button{background:none;outline:none;border:none;padding:0}.ono-modal-box{--top: 0;--left: 0;top:50%;left:50%;gap:12px;display:flex;padding:24px;position:fixed;background:#fff;border-radius:6px;width:var(--width);color:var(--color);flex-direction:column;transform:translate(-50%,-50%)}.ono-modal-box-body{display:flex}.ono-modal-box-body-contentBar{gap:8px;display:flex;align-items:start;justify-content:start;flex-direction:column}.ono-modal-box-body-contentBar-title{font-weight:600;line-height:24px}.ono-modal-box-body-contentBar-content{font-size:14px;line-height:22px}.ono-modal-box-footer{display:flex;justify-content:start;align-items:center;margin-left:auto;gap:16px}.ono-modal-box-footer .ono-modal-box-footer-confirmBtn,.ono-modal-box-footer .ono-modal-box-footer-cancelBtn{display:flex;padding:4px 16px;-webkit-user-select:none;user-select:none;border-radius:6px;width:fit-content;align-items:center;justify-content:center;transition:all .2s ease-in-out}.ono-modal-box-footer-cancelBtn{color:#333;background:#fff;border:1px solid #ccc}.ono-modal-box-footer-cancelBtn:hover{color:var(--themeHoverColor);border:1px solid var(--themeHoverColor)}.ono-modal-box-footer-cancelBtn:active{color:var(--themeActiveColor);border:1px solid var(--themeActiveColor)}.ono-modal-box-footer-cancelBtn:disabled{color:#ccc;cursor:no-drop;border:1px solid #ccc}.ono-modal-box-footer-confirmBtn{gap:8px;color:#f5f5f5;background:var(--themeColor)}.ono-modal-box-footer-confirmBtn-loading{width:16px;height:16px;animation:loading 1s linear infinite}.ono-modal-box-footer-confirmBtn:hover{background:var(--themeHoverColor)}.ono-modal-box-footer-confirmBtn:active{background:var(--themeActiveColor)}.ono-modal-box-footer-confirmBtn:disabled{cursor:no-drop;background:var(--themeDisabledClr)}.ono-modal::backdrop{background:#00000080;-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}.ono-modal-enter{animation:enter .3s forwards}.ono-modal-leave{animation:leave .3s forwards}@keyframes enter{0%{opacity:0;top:var(--top);left:var(--left);transform:translate(-50%,-50%) scale(0)}to{top:50%;left:50%;opacity:1;transform:translate(-50%,-50%) scale(1)}}@keyframes leave{0%{top:50%;left:50%;opacity:1;transform:translate(-50%,-50%) scale(1)}to{opacity:0;top:var(--top);left:var(--left);transform:translate(-50%,-50%) scale(0)}}@keyframes loading{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ono-input,.ono-textarea .ono-textarea-wrapper{color:#333;display:flex;font-size:16px;overflow:hidden;line-height:24px;border-radius:6px;align-items:center}.ono-input input[type=password],.ono-textarea .ono-textarea-wrapper input[type=password]{border:none;outline:none;background-color:transparent;font-family:inherit;font-size:inherit;padding:0;margin:0}.ono-input input[type=password]::-ms-reveal,.ono-textarea .ono-textarea-wrapper input[type=password]::-ms-reveal,.ono-input input[type=password]::-ms-clear,.ono-textarea .ono-textarea-wrapper input[type=password]::-ms-clear{display:none}.ono-input input[type=password]::-webkit-inner-spin-button,.ono-textarea .ono-textarea-wrapper input[type=password]::-webkit-inner-spin-button,.ono-input input[type=password]::-webkit-outer-spin-button,.ono-textarea .ono-textarea-wrapper input[type=password]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.ono-input .ono-prepend,.ono-textarea .ono-textarea-wrapper .ono-prepend{flex-shrink:0;padding:4px 12px;background:#d9d9d9;border:1px solid #999;border-right:none;border-radius:6px 0 0 6px;color:inherit;font-size:inherit;line-height:inherit}.ono-input .ono-input-wrapper,.ono-textarea .ono-textarea-wrapper .ono-input-wrapper{gap:4px;width:100%;display:flex;padding:4px 12px;align-items:center;outline:none;color:inherit;font-size:inherit;line-height:inherit;background:#f5f5f5;cursor:text}.ono-input .ono-input-wrapper .ono-append,.ono-textarea .ono-textarea-wrapper .ono-input-wrapper .ono-append{display:flex;justify-content:center;align-items:center;flex-shrink:0;color:inherit;font-size:inherit;line-height:inherit}.ono-input .ono-input-wrapper .ono-input-inner,.ono-textarea .ono-textarea-wrapper .ono-input-wrapper .ono-input-inner{flex:1;border:none;outline:none;color:inherit;font-size:inherit;line-height:inherit;background:transparent;cursor:inherit}.ono-input .ono-input-wrapper .ono-suffix,.ono-textarea .ono-textarea-wrapper .ono-input-wrapper .ono-suffix{display:flex;justify-content:center;align-items:center;gap:8px;flex-shrink:0;color:inherit;font-size:inherit;line-height:inherit}.ono-input .ono-input-wrapper .ono-suffix .ono-clear-icon,.ono-textarea .ono-textarea-wrapper .ono-input-wrapper .ono-suffix .ono-clear-icon{width:12px;height:12px;cursor:pointer}.ono-input .ono-input-wrapper .ono-suffix .ono-clear-icon .ono-input-icon,.ono-textarea .ono-textarea-wrapper .ono-input-wrapper .ono-suffix .ono-clear-icon .ono-input-icon{width:100%;height:100%;color:#999;transition:color .3s}.ono-input .ono-input-wrapper .ono-suffix .ono-clear-icon .ono-input-icon:hover,.ono-textarea .ono-textarea-wrapper .ono-input-wrapper .ono-suffix .ono-clear-icon .ono-input-icon:hover{color:#666}.ono-input .ono-input-wrapper .ono-suffix .ono-eye-icon,.ono-textarea .ono-textarea-wrapper .ono-input-wrapper .ono-suffix .ono-eye-icon{width:16px;height:16px;cursor:pointer}.ono-input .ono-input-wrapper .ono-suffix .ono-eye-icon .icon,.ono-textarea .ono-textarea-wrapper .ono-input-wrapper .ono-suffix .ono-eye-icon .icon{width:100%;height:100%;color:#999;transition:color .3s}.ono-input .ono-input-wrapper .ono-suffix .ono-eye-icon .icon:hover,.ono-textarea .ono-textarea-wrapper .ono-input-wrapper .ono-suffix .ono-eye-icon .icon:hover{color:#333}.ono-input .ono-input-wrapper .ono-suffix .ono-count,.ono-textarea .ono-textarea-wrapper .ono-input-wrapper .ono-suffix .ono-count{color:#999;font-size:inherit;line-height:inherit}.ono-input .ono-append,.ono-textarea .ono-textarea-wrapper .ono-append{flex-shrink:0;padding:4px 12px;background:#d9d9d9;border:1px solid #999;border-left:none;border-radius:0 6px 6px 0;color:inherit;font-size:inherit;line-height:inherit}.ono-textarea{gap:4px;width:100%;display:flex;flex-direction:column}.ono-textarea .ono-textarea-wrapper{width:100%;min-height:100%;outline:none;flex-shrink:0;display:initial;padding:0;background:#f5f5f5;border:1px solid #999}.ono-textarea .ono-textarea-wrapper .ono-textarea-inner{width:100%;height:100%;outline:none;color:inherit;font-size:inherit;line-height:inherit;border-radius:inherit;padding:4px 12px;display:initial;overflow:initial;background:none;border:none}.ono-textarea .ono-count-bar{width:100%;color:#999;text-align:right;font-size:16px;line-height:24px}.ono-input-border .ono-input-wrapper{border-radius:inherit;border:1px solid #999}.ono-input-border:has(.ono-prepend) .ono-input-wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.ono-input-border:has(.ono-append) .ono-input-wrapper{border-top-right-radius:0;border-bottom-right-radius:0}.ono-scrollbar{scrollbar-width:none}.ono-scrollbar::-webkit-scrollbar{width:0}.ono-input-is-focus{border:var(--ono-input-border)!important;box-shadow:var(--ono-input-box-shadow)}.ono-input-is-disabled{color:#999;-webkit-user-select:none;user-select:none;background:#d9d9d9;cursor:not-allowed}.ono-input-is-disabled .ono-input-wrapper,.ono-input-is-disabled .ono-textarea-wrapper{pointer-events:none}.ono-tooltip-popper{background:#333;color:#fff;font-weight:700;padding:4px 8px;font-size:13px;border-radius:4px}.ono-tooltip-popper .ono-tooltip-popper-arrow,.ono-tooltip-popper .ono-tooltip-popper-arrow:before{position:absolute;width:8px;height:8px;background:inherit}.ono-tooltip-popper .ono-tooltip-popper-arrow{visibility:hidden}.ono-tooltip-popper .ono-tooltip-popper-arrow:before{visibility:visible;content:"";transform:rotate(45deg)}.ono-tooltip-popper[data-popper-placement^=top]>.ono-tooltip-popper-arrow{bottom:-4px}.ono-tooltip-popper[data-popper-placement^=bottom]>.ono-tooltip-popper-arrow{top:-4px}.ono-tooltip-popper[data-popper-placement^=left]>.ono-tooltip-popper-arrow{right:-4px}.ono-tooltip-popper[data-popper-placement^=right]>.ono-tooltip-popper-arrow{left:-4px}.ono-pagination{display:flex;justify-content:center;align-items:center;gap:16px}.ono-pagination-base,.ono-pagination-btn{list-style:none;-webkit-user-select:none;user-select:none;cursor:pointer}.ono-pagination-btn{display:flex;justify-content:center;align-items:center;background:#ccc;width:fit-content;padding:0 10px;aspect-ratio:2/1}.ono-pagination-btn-active{color:#fff;background:#07c}.ono-radio-group{gap:4px;display:flex;width:fit-content;align-items:flex-start;justify-content:flex-start}.ono-radio-box{display:flex;justify-content:center;align-items:center;gap:var(--gap);width:fit-content}.ono-radio-box .ono-radio{flex-shrink:0;width:var(--w);height:var(--w);border-radius:50%;position:relative;border:1px solid #424242;background:var(--unCheckedColor)}.ono-radio-box .ono-radio input[type=radio]{width:0;height:0;opacity:0}.ono-radio-box .ono-radio:has(input[type=radio]:checked){background:var(--checkedColor)}.ono-radio-box .ono-radio:has(input[type=radio]:checked):after{top:50%;left:50%;width:50%;height:50%;content:"";border-radius:50%;position:absolute;background-color:#fff;transform:translate(-50%,-50%)}.ono-svg-img{--w: 24px;--h: 24px;--clr: #fff;width:var(--w);height:var(--h);overflow:hidden}.ono-svg-img img{width:100%;height:100%;position:relative;transform:translate(calc(-1 * var(--w)));filter:drop-shadow(var(--clr) var(--w) 0)}.ono-switch{--checkedClr: #342a7c;--uncheckedClr: rgba(0, 0, 0, .2)}.ono-switch input[type=checkbox]{width:0;height:0;margin:0;opacity:0;position:absolute}.ono-switch input[type=checkbox]:checked+.ono-switch-box{background-color:var(--checkedClr)}.ono-switch input[type=checkbox]:checked+.ono-switch-box:before{transform:translate(calc(var(--w) - var(--h)))}.ono-switch input[type=checkbox]:checked+.ono-switch-box>.ono-switch-children-bar{transform:translate(calc(var(--h) / 8))}.ono-switch.ono-switch-is-disabled .ono-switch-box{opacity:.6;cursor:not-allowed}.ono-switch .ono-switch-box{width:var(--w);height:var(--h);display:flex;flex-shrink:0;cursor:pointer;overflow:hidden;position:relative;border-radius:calc(var(--h) / 2);background-color:var(--uncheckedClr)}.ono-switch .ono-switch-box:before{top:calc(var(--h) / 8);left:calc(var(--h) / 8);width:calc(var(--h) * 3 / 4);content:"";display:block;aspect-ratio:1;border-radius:50%;background:#fff;position:absolute;transition:transform .3s}.ono-switch .ono-switch-children-bar{display:flex;position:absolute;top:calc(var(--h) / 8);transform:translate(calc((var(--w) - var(--h) * 9 / 8) * -1))}.ono-switch .ono-switch-children-bar .ono-switch-children{display:flex;justify-content:center;align-items:center;width:calc(var(--w) - var(--h));height:calc(var(--h) / 4 * 3);min-width:fit-content;text-wrap:nowrap}.ono-switch .ono-switch-children-bar .ono-switch-slider{width:calc(var(--h) * 3 / 4);aspect-ratio:1}.ono-mask{top:0;left:0;z-index:9999;width:100vw;height:100vh;position:fixed}.ono-mask .ono-dialog{top:50%;left:50%;position:absolute;transform:translate(-50%,-50%);box-shadow:0 0 10px #0000004d}.ono-mask-enter{animation:mask-enter var(--duration) forwards}.ono-mask-leave{animation:mask-leave var(--duration) forwards}.ono-zoom-enter{animation:zoom-enter var(--duration) forwards}.ono-zoom-leave{animation:zoom-leave var(--duration) forwards}.ono-fade-enter{animation:fade-enter var(--duration) forwards}.ono-fade-leave{animation:fade-leave var(--duration) forwards}@keyframes mask-enter{0%{opacity:0}to{opacity:1}}@keyframes mask-leave{0%{opacity:1}to{opacity:0}}@keyframes zoom-enter{0%{opacity:0;top:var(--top);left:var(--left);transform:translate(-50%,-50%) scale(0)}to{top:50%;left:50%;opacity:1;transform:translate(-50%,-50%) scale(1)}}@keyframes zoom-leave{0%{top:50%;left:50%;opacity:1;transform:translate(-50%,-50%) scale(1)}to{opacity:0;top:var(--top);left:var(--left);transform:translate(-50%,-50%) scale(0)}}@keyframes fade-enter{0%{opacity:0;top:var(--top);transform:translate(-50%,-100%)}to{top:50%;opacity:1;transform:translate(-50%,-50%)}}@keyframes fade-leave{0%{top:50%;opacity:1;transform:translate(-50%,-50%)}to{opacity:0;top:var(--top);transform:translate(-50%,-100%)}}._container_3s92l_1{top:0;left:0;gap:20px;width:100vw;height:100vh;padding:20px;display:flex;position:fixed;align-items:center;pointer-events:none;flex-direction:column}._base_3s92l_15,._promise_3s92l_15{--speed: .2s;gap:8px;display:flex;align-items:center;justify-content:center;width:fit-content;height:fit-content;padding:8px 10px;border-radius:6px;background-color:#fff;-webkit-user-select:none;user-select:none;transform:translateY(0) scale(1);box-shadow:0 4px 8px #0000001a;pointer-events:initial}._enter_3s92l_32{animation:_enter_3s92l_32 var(--speed) forwards}._leave_3s92l_36{animation:_leave_3s92l_36 var(--speed) forwards}._promise_3s92l_15 ._icon_3s92l_40{animation:_loading_3s92l_1 1s linear infinite}@keyframes _enter_3s92l_32{0%{opacity:0;transform:translateY(-80%) scale(.6)}60%{opacity:1;transform:translateY(0) scale(1.1)}to{opacity:1;transform:translateY(0) scale(1)}}@keyframes _leave_3s92l_36{0%{opacity:1;transform:translateY(0) scale(1)}to{opacity:0;transform:translateY(-80%) scale(.6)}}@keyframes _loading_3s92l_1{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.ono-waterfall-container{width:100%;height:100%}.ono-waterfall-content{width:100%;height:100%;overflow-y:scroll}.ono-waterfall-wrapper{width:100%;position:relative}.ono-waterfall-item{top:0;left:0;position:absolute;transform-origin:top left;transition:transform .3s ease-in-out}.ono-waterfall-loading{display:flex;justify-content:center;align-items:center;left:0;bottom:0;width:100%;z-index:10;height:100%;color:#fff;position:absolute;background:#00000080}.ono-select{width:100%}.ono-select .ono-select-arrow-down-icon{width:12px;height:12px;color:#666;transition:transform .2s linear}.ono-select .ono-select-arrow-down-active{transform:rotate(180deg)}.ono-option{padding:8px;background:#fff;box-shadow:0 4px 10px #0000001a;z-index:9999}.ono-option .ono-option-item{margin:0;padding:0;width:100%;border:none;outline:none;display:block;background:transparent}.ono-option .ono-option-item .ono-option-item-content,.ono-option .ono-option-item .ono-option-item-content-no-data{width:100%;padding:4px;color:#333;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:4px;font-weight:500;text-align:start}.ono-option .ono-option-item .ono-option-item-content:hover,.ono-option .ono-option-item .ono-option-item-content-no-data:hover{background:#ccc}.ono-option .ono-option-item .ono-option-item-content-active{color:#5644b8;font-weight:600}.ono-option .ono-option-item .ono-option-item-content-disabled{color:#ccc;cursor:not-allowed}.ono-option .ono-option-item .ono-option-item-content-disabled:hover,.ono-option .ono-option-item .ono-option-item-content-no-data:hover{background:transparent}.ono-select-readonly{cursor:pointer!important}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { AutoSliderListProps } from './types';
|
|
2
|
+
export declare const AutoSliderList: <T>({ list, style, disable, children, sliderBox, className, sliderStyle, duration, sliderClassName, currentIndex, direction, sliderTransitionTimingFunction }: AutoSliderListProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CSSProperties, JSX } from 'react';
|
|
2
|
+
export declare enum Direction {
|
|
3
|
+
Horizontal = "Horizontal",
|
|
4
|
+
Vertical = "Vertical"
|
|
5
|
+
}
|
|
6
|
+
export interface AutoSliderListProps<T> {
|
|
7
|
+
list: T[];
|
|
8
|
+
children: ({ item, index, isActive }: {
|
|
9
|
+
item: T;
|
|
10
|
+
index: number;
|
|
11
|
+
isActive: boolean;
|
|
12
|
+
}) => JSX.Element;
|
|
13
|
+
disable?: boolean;
|
|
14
|
+
duration?: number;
|
|
15
|
+
className?: string;
|
|
16
|
+
style?: CSSProperties;
|
|
17
|
+
direction?: Direction;
|
|
18
|
+
currentIndex?: number;
|
|
19
|
+
sliderBox?: JSX.Element;
|
|
20
|
+
sliderClassName?: string;
|
|
21
|
+
sliderStyle?: CSSProperties;
|
|
22
|
+
sliderTransitionTimingFunction?: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { AvatarCanvasProps } from './types';
|
|
2
|
+
export declare const AvatarCanvas: ({ imageFile, cvsW, maskBG, border, wheelScale, setCtx, maskInfo, setMaskInfo, imageStartState, setImageStartState, imageState, setImageState }: AvatarCanvasProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AvatarCropProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param param0 {
|
|
5
|
+
* imgFile: File | string // 图片文件
|
|
6
|
+
* cvsW?: number // 画布宽度
|
|
7
|
+
* maskBG?: string // 蒙版背景色
|
|
8
|
+
* border?: string // 边框样式
|
|
9
|
+
* wheelScale?: number // 滚轮缩放倍数(0-1)
|
|
10
|
+
* }
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
13
|
+
export declare const AvatarCrop: ({ imageFile, cvsW, maskBG, border, wheelScale, children }: AvatarCropProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AvatarCrop } from './AvatarCrop';
|