tailadmin-ui-kit-vite
Version:
VueJS UI Kit by Tailwindcss
151 lines (150 loc) • 4.6 kB
JavaScript
import { openBlock, createElementBlock, pushScopeId, popScopeId, createElementVNode, normalizeClass, createBlock, createCommentVNode, renderSlot, toDisplayString } from "vue";
var main = "";
var TCircleLoadingAnimation_vue_vue_type_style_index_0_scoped_true_lang = "";
var _export_sfc = (sfc, props) => {
const target = sfc.__vccOpts || sfc;
for (const [key, val] of props) {
target[key] = val;
}
return target;
};
const _withScopeId = (n) => (pushScopeId("data-v-28d76810"), n = n(), popScopeId(), n);
const _hoisted_1$1 = {
stroke: "currentColor",
viewBox: "0 0 100 100",
xmlns: "http://www.w3.org/2000/svg"
};
const _hoisted_2$1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("circle", {
cx: "50%",
cy: "50%",
r: "45"
}, null, -1));
const _hoisted_3$1 = [
_hoisted_2$1
];
const __default__ = {
name: "TCircleLoadingAnimation"
};
const _sfc_main$1 = /* @__PURE__ */ Object.assign(__default__, {
setup(__props) {
name = "TCircleLoadingAnimation";
return (_ctx, _cache) => {
return openBlock(), createElementBlock("svg", _hoisted_1$1, _hoisted_3$1);
};
}
});
var TCircleLoadingAnimation = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-28d76810"]]);
const _hoisted_1 = ["type", "disabled"];
const _hoisted_2 = { class: "flex flex-grow-0 flex-shrink-0" };
const _hoisted_3 = ["textContent"];
const _sfc_main = {
props: {
title: {
type: String,
default: ""
},
size: {
type: String,
default: "md"
},
design: {
type: String,
default: "filled"
},
color: {
type: String,
default: "blue"
},
radius: {
type: String,
default: "md"
},
link: {
type: String,
default: ""
},
border: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
},
loading: {
type: Boolean,
default: false
},
loadingDesign: {
type: String,
default: "circle"
},
type: {
type: String,
default: "submit"
},
animation: {
type: Boolean,
default: true
},
iconPosition: {
type: String,
default: "left"
},
block: {
type: Boolean,
default: false
}
},
setup(__props) {
name = "TButton";
return (_ctx, _cache) => {
return openBlock(), createElementBlock("button", {
type: __props.type,
disabled: __props.disabled,
class: normalizeClass(["t-btn", [
`t-btn-${__props.design} t-btn-${__props.color} t-radius-${__props.radius}`,
{ border: __props.border || __props.design === "outline" },
{ "border-0": __props.design.includes("link") },
{ "opacity-75 pointer-events-none": __props.loading || __props.disabled },
[_ctx.$slots.default ? "px-4" : "px-2"],
{ "active:scale-90": __props.animation },
[__props.iconPosition === "right" ? "flex-row-reverse" : "flex-row"],
{ "w-full justify-center": __props.block }
]])
}, [
createElementVNode("div", _hoisted_2, [
__props.loading ? (openBlock(), createBlock(TCircleLoadingAnimation, {
key: 0,
class: normalizeClass([
"w-5 h-5",
_ctx.$slots.default ? __props.iconPosition === "right" ? "ml-2" : "-ml-2 mr-2" : null
])
}, null, 8, ["class"])) : createCommentVNode("", true),
_ctx.$slots.icon && !__props.loading ? (openBlock(), createElementBlock("span", {
key: 1,
class: normalizeClass(_ctx.$slots.default ? __props.iconPosition === "right" ? "pl-2" : "pr-2" : null)
}, [
renderSlot(_ctx.$slots, "icon")
], 2)) : createCommentVNode("", true)
]),
_ctx.$slots.default || __props.title ? (openBlock(), createElementBlock("div", {
key: 0,
class: normalizeClass([
{ "text-2xl": __props.size === "2xl" },
{ "text-xl": __props.size === "xl" },
{ "text-lg": __props.size === "lg" },
{ "text-md": __props.size === "md" },
{ "text-xs": __props.size === "sm" }
])
}, [
__props.title ? (openBlock(), createElementBlock("span", {
key: 0,
textContent: toDisplayString(__props.title)
}, null, 8, _hoisted_3)) : renderSlot(_ctx.$slots, "default", { key: 1 })
], 2)) : createCommentVNode("", true)
], 10, _hoisted_1);
};
}
};
export { _sfc_main as TButton };