ayongui
Version:
61 lines (60 loc) • 1.46 kB
JavaScript
import { j as m } from "../../../react/jsx-runtime.mjs";
import j from "react";
import t from "./index.module.less.mjs";
import $ from "../../config/style.module.less.mjs";
import { useDebounce as k } from "../../utils/index.mjs";
import "../icon/index.module.less.mjs";
import C from "../icon/components/loading-frame/index.mjs";
const A = (r) => {
const {
style: d = {},
type: o = "default",
size: p = "default",
shape: s = "default",
children: u,
href: l = "",
htmlType: y = "button",
className: f = "",
disabled: e,
text: b = "",
time: n = 0,
icon: a = "",
loading: i = !1,
onClick: x = () => {
}
} = r, c = () => {
x(), l && window.open(l);
}, h = {
button: t.button,
size: t[p] || "",
type: t[o] || "",
shape: t[s] || "",
notAllowed: e && $.disabled || "",
clicked: "",
ayongBtn: f
}, g = Object.values(h).join(" ");
return /* @__PURE__ */ m.jsxs(
"button",
{
style: {
...d,
...s === "circle" ? { padding: "7px 10px" } : {}
},
className: `${g} ${e ? "" : t.mutual} ${i ? t.loading : ""}`,
onClick: n ? k(c, n) : c,
disabled: e,
type: y,
children: [
i && /* @__PURE__ */ m.jsx(C, {}),
a && j.createElement(a.type, {
className: `${o !== "default" ? t.iconWihe : t.icon}`
}),
" ",
u || b
]
}
);
};
export {
A as default
};