import { LoadingOutlined } from '@ant-design/icons-vue'; import { a1 as Button, f as loading } from './server.mjs'; import { defineComponent, h, useSlots, computed, mergeProps, unref, withCtx, createVNode, renderSlot, createCommentVNode, createBlock, openBlock, ref, useSSRContext } from 'vue'; import { ssrRenderComponent, ssrRenderClass, ssrRenderSlot, ssrRenderAttrs } from 'vue/server-renderer'; import { b as baseButtonIconSize, u as usePrefix, i as icons } from './BasicIconOld-I4c2ShMu.mjs'; import { _ as _export_sfc } from './_plugin-vue_export-helper-1tPrXgE0.mjs'; import { S as Spin } from './index-DqCYDGJX.mjs'; const _sfc_main$1 = /* @__PURE__ */ defineComponent({ __name: "BasicIcon", __ssrInlineRender: true, props: { icon: {}, color: { default: null }, size: {} }, setup(__props) { const props = __props; const { prefixCls } = usePrefix("icons"); const tempIcon = ref(); const refIcon = ref(); tempIcon.value = icons[`${props.icon}`]; const color = computed(() => { return props.color; }); return (_ctx, _push, _parent, _attrs) => { var _a; _push(`${(_a = tempIcon.value) != null ? _a : ""}`); }; } }); const _sfc_setup$1 = _sfc_main$1.setup; _sfc_main$1.setup = (props, ctx) => { const ssrContext = useSSRContext(); (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/BasicPacks/BasicIcon.vue"); return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0; }; const BasicIcon = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-a7e11651"]]); const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "BasicButton", __ssrInlineRender: true, props: { icon: {}, iconSize: { default: baseButtonIconSize }, iconClass: { default: "" }, suffixIcon: { type: Boolean }, type: {}, size: {}, loading: { type: Boolean }, curve: { type: Boolean, default: false } }, setup(__props) { const indicator = h(LoadingOutlined, { style: { fontSize: "24px" }, spin: true }); const slot = useSlots(); const _class = computed(() => { if (!slot.default) { return "!px-1 !py-1"; } return ""; }); const _loading = computed(() => { if (props.loading) { return "flex"; } else return "unset"; }); const { prefixCls } = usePrefix("main-button"); const props = __props; return (_ctx, _push, _parent, _attrs) => { const _component_AButton = Button; const _component_ASpin = Spin; const _cssVars = { style: { "--17d6c578": _loading.value } }; _push(ssrRenderComponent(_component_AButton, mergeProps({ type: props.type, size: props.size, class: [unref(prefixCls), _class.value, _ctx.curve ? "!rounded-full" : ""], disabled: "loading" in _ctx ? _ctx.loading : unref(loading) }, _attrs, _cssVars), { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(ssrRenderComponent(_component_ASpin, { spinning: "loading" in _ctx ? _ctx.loading : unref(loading), size: "small", class: "absolute", style: { "position-area": "center" }, indicator: unref(indicator) }, null, _parent2, _scopeId)); _push2(`
`); if (_ctx.$slots.default) { ssrRenderSlot(_ctx.$slots, "default", {}, null, _push2, _parent2, _scopeId); } else { _push2(``); } if (_ctx.icon) { _push2(ssrRenderComponent(BasicIcon, { size: _ctx.iconSize, icon: _ctx.icon, class: _ctx.iconClass }, null, _parent2, _scopeId)); } else { _push2(``); } _push2(`
`); } else { return [ createVNode(_component_ASpin, { spinning: "loading" in _ctx ? _ctx.loading : unref(loading), size: "small", class: "absolute", style: { "position-area": "center" }, indicator: unref(indicator) }, null, 8, ["spinning", "indicator"]), createVNode("div", { class: ["flex items-center gap-1 justify-center flex-row-reverse gap-2 py-1 px-2 w-full h-full transition-all", [{ "flex-row-reverse": _ctx.suffixIcon }, ("loading" in _ctx ? _ctx.loading : unref(loading)) ? "op-30" : ""]] }, [ _ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("", true), _ctx.icon ? (openBlock(), createBlock(BasicIcon, { key: 1, size: _ctx.iconSize, icon: _ctx.icon, class: _ctx.iconClass }, null, 8, ["size", "icon", "class"])) : createCommentVNode("", true) ], 2) ]; } }), _: 3 }, _parent)); }; } }); const _sfc_setup = _sfc_main.setup; _sfc_main.setup = (props, ctx) => { const ssrContext = useSSRContext(); (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/BasicPacks/BasicButton.vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; export { _sfc_main as _ }; //# sourceMappingURL=BasicButton-BAlnoE_w.mjs.map