treqit-ui-library 1.4.1 → 1.4.3
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computed as r, createElementBlock as o, openBlock as d, normalizeClass as s, createCommentVNode as u, createElementVNode as i, renderSlot as c } from "vue";
|
|
2
|
-
const m = (
|
|
3
|
-
const l =
|
|
4
|
-
for (const [a, n] of
|
|
2
|
+
const m = (e, t) => {
|
|
3
|
+
const l = e.__vccOpts || e;
|
|
4
|
+
for (const [a, n] of t)
|
|
5
5
|
l[a] = n;
|
|
6
6
|
return l;
|
|
7
7
|
}, f = ["type", "disabled"], p = {
|
|
@@ -14,13 +14,13 @@ const m = (t, e) => {
|
|
|
14
14
|
type: String,
|
|
15
15
|
default: "primary",
|
|
16
16
|
// 'primary', 'secondary', 'destructive'
|
|
17
|
-
validator: (
|
|
17
|
+
validator: (e) => ["primary", "secondary", "destructive", "flat", "elevated", "text", "outlined", "outlined-primary", "outlined-secondary", "rounded"].includes(e)
|
|
18
18
|
},
|
|
19
19
|
size: {
|
|
20
20
|
type: String,
|
|
21
21
|
default: "medium",
|
|
22
22
|
// 'small', 'medium', 'large'
|
|
23
|
-
validator: (
|
|
23
|
+
validator: (e) => ["sm", "small", "medium", "large", "x-large"].includes(e)
|
|
24
24
|
},
|
|
25
25
|
type: {
|
|
26
26
|
type: String,
|
|
@@ -40,37 +40,36 @@ const m = (t, e) => {
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
emits: ["click"],
|
|
43
|
-
setup(
|
|
44
|
-
const
|
|
43
|
+
setup(e) {
|
|
44
|
+
const t = e, l = r(() => [
|
|
45
45
|
"btn",
|
|
46
|
-
`btn--${
|
|
47
|
-
`btn--${
|
|
46
|
+
`btn--${t.variant}`,
|
|
47
|
+
`btn--${t.size === "sm" ? "small" : t.size}`,
|
|
48
48
|
{
|
|
49
|
-
"btn--loading":
|
|
50
|
-
"btn--full":
|
|
49
|
+
"btn--loading": t.loading,
|
|
50
|
+
"btn--full": t.full
|
|
51
51
|
}
|
|
52
52
|
]);
|
|
53
53
|
return (a, n) => (d(), o("button", {
|
|
54
|
-
type:
|
|
54
|
+
type: e.type,
|
|
55
55
|
class: s(l.value),
|
|
56
|
-
disabled:
|
|
57
|
-
onClick: n[0] || (n[0] = (
|
|
56
|
+
disabled: e.disabled || e.loading,
|
|
57
|
+
onClick: n[0] || (n[0] = (v) => a.$emit("click"))
|
|
58
58
|
}, [
|
|
59
|
-
|
|
59
|
+
e.loading ? (d(), o("div", p, [...n[1] || (n[1] = [
|
|
60
60
|
i("div", { class: "simple-spinner" }, null, -1)
|
|
61
61
|
])])) : u("", !0),
|
|
62
62
|
i("span", {
|
|
63
|
-
class: s(["btn-content", { "content-hidden":
|
|
63
|
+
class: s(["btn-content", { "content-hidden": e.loading }])
|
|
64
64
|
}, [
|
|
65
65
|
c(a.$slots, "default", {}, void 0, !0)
|
|
66
66
|
], 2)
|
|
67
67
|
], 10, f));
|
|
68
68
|
}
|
|
69
|
-
}, b = /* @__PURE__ */ m(y, [["__scopeId", "data-v-8db92d47"]]),
|
|
70
|
-
|
|
71
|
-
}
|
|
69
|
+
}, b = /* @__PURE__ */ m(y, [["__scopeId", "data-v-8db92d47"]]), B = (e) => {
|
|
70
|
+
e.component("Button", b);
|
|
71
|
+
};
|
|
72
72
|
export {
|
|
73
73
|
b as Button,
|
|
74
|
-
|
|
75
|
-
v as install
|
|
74
|
+
B as TreqitUiLibrary
|
|
76
75
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(n,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.TreqitUiLibrary={},n.Vue))})(this,(function(n,e){"use strict";const
|
|
1
|
+
(function(n,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(n=typeof globalThis<"u"?globalThis:n||self,e(n.TreqitUiLibrary={},n.Vue))})(this,(function(n,e){"use strict";const s=(t,l)=>{const o=t.__vccOpts||t;for(const[a,i]of l)o[a]=i;return o},r=["type","disabled"],c={key:0,class:"btn-loader"},d=s({__name:"Button",props:{variant:{type:String,default:"primary",validator:t=>["primary","secondary","destructive","flat","elevated","text","outlined","outlined-primary","outlined-secondary","rounded"].includes(t)},size:{type:String,default:"medium",validator:t=>["sm","small","medium","large","x-large"].includes(t)},type:{type:String,default:"button"},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},full:{type:Boolean,default:!1}},emits:["click"],setup(t){const l=t,o=e.computed(()=>["btn",`btn--${l.variant}`,`btn--${l.size==="sm"?"small":l.size}`,{"btn--loading":l.loading,"btn--full":l.full}]);return(a,i)=>(e.openBlock(),e.createElementBlock("button",{type:t.type,class:e.normalizeClass(o.value),disabled:t.disabled||t.loading,onClick:i[0]||(i[0]=m=>a.$emit("click"))},[t.loading?(e.openBlock(),e.createElementBlock("div",c,[...i[1]||(i[1]=[e.createElementVNode("div",{class:"simple-spinner"},null,-1)])])):e.createCommentVNode("",!0),e.createElementVNode("span",{class:e.normalizeClass(["btn-content",{"content-hidden":t.loading}])},[e.renderSlot(a.$slots,"default",{},void 0,!0)],2)],10,r))}},[["__scopeId","data-v-8db92d47"]]),u=t=>{t.component("Button",d)};n.Button=d,n.TreqitUiLibrary=u,Object.defineProperty(n,Symbol.toStringTag,{value:"Module"})}));
|