Comparing version 0.0.1-alpha.6 to 0.0.1-alpha.7
@@ -1,14 +0,14 @@ | ||
import { ref as u, computed as h, onMounted as _, resolveComponent as m, openBlock as s, createElementBlock as f, normalizeClass as i, renderSlot as r, createBlock as y, withCtx as g, createCommentVNode as v } from "vue"; | ||
import { ref as b, computed as h, onMounted as _, resolveComponent as m, openBlock as o, createElementBlock as u, normalizeClass as s, renderSlot as i, createBlock as y, withCtx as g, createCommentVNode as B } from "vue"; | ||
const x = (e) => { | ||
e.addEventListener("pointerdown", (l) => { | ||
const { clientX: t, clientY: n } = l.touches ? l.touches[0] : l, { left: d, top: a, width: o, height: c } = e.getBoundingClientRect(), b = Math.sqrt(Math.pow(o, 2) + Math.pow(c, 2)) * 2; | ||
e.style.cssText = "--s: 0; --o: 1;", e.offsetTop, e.style.cssText = `--t: 1; --o: 0; --d: ${b.toFixed(1)}; --x:${(t - d).toFixed(1)}; --y:${(n - a).toFixed(1)};`; | ||
e.addEventListener("pointerdown", (a) => { | ||
const { clientX: t, clientY: n } = a.touches ? a.touches[0] : a, { left: l, top: r, width: d, height: f } = e.getBoundingClientRect(), c = Math.sqrt(Math.pow(d, 2) + Math.pow(f, 2)) * 2; | ||
e.style.cssText = "--s: 0; --o: 1;", e.offsetTop, e.style.cssText = `--t: 1; --o: 0; --d: ${c.toFixed(1)}; --x:${(t - l).toFixed(1)}; --y:${(n - r).toFixed(1)};`; | ||
}); | ||
}; | ||
const B = (e, l) => { | ||
const k = (e, a) => { | ||
const t = e.__vccOpts || e; | ||
for (const [n, d] of l) | ||
t[n] = d; | ||
for (const [n, l] of a) | ||
t[n] = l; | ||
return t; | ||
}, k = { | ||
}, v = { | ||
name: "Button", | ||
@@ -51,7 +51,11 @@ props: { | ||
default: "" | ||
}, | ||
forceRipple: { | ||
type: Boolean, | ||
default: !1 | ||
} | ||
}, | ||
setup(e, { emit: l }) { | ||
const t = u(null), n = u(!1), d = h(() => { | ||
let a = { | ||
setup(e, { emit: a }) { | ||
const t = b(null), n = h(() => { | ||
let l = { | ||
btn: !0, | ||
@@ -68,25 +72,25 @@ "btn--sm": e.size === "sm", | ||
}; | ||
return e.ripple && (a["btn--ripple"] = !0), e.progress && (a["btn--progress"] = !0), e.disabled && (a["btn--disabled"] = !0), a; | ||
return e.ripple && (l["btn--ripple"] = !0), e.progress && (l["btn--progress"] = !0), e.disabled && (l["btn--disabled"] = !0), l; | ||
}); | ||
return _(() => { | ||
(e.ripple || n.value) && x(t.value); | ||
(e.ripple || e.forceRipple) && x(t.value); | ||
}), { | ||
buttonRef: t, | ||
btnClass: d | ||
btnClass: n | ||
}; | ||
} | ||
}, C = ["disabled"], S = ["href", "disabled"]; | ||
function R(e, l, t, n, d, a) { | ||
const o = m("router-link"); | ||
return !t.route && !t.href ? (s(), f("button", { | ||
}, C = ["disabled"], R = ["href", "disabled"]; | ||
function S(e, a, t, n, l, r) { | ||
const d = m("router-link"); | ||
return !t.route && !t.href ? (o(), u("button", { | ||
key: 0, | ||
class: i(n.btnClass), | ||
class: s(n.btnClass), | ||
disabled: t.disabled, | ||
ref: "buttonRef" | ||
}, [ | ||
r(e.$slots, "default") | ||
], 10, C)) : t.route ? (s(), y(o, { | ||
i(e.$slots, "default") | ||
], 10, C)) : t.route ? (o(), y(d, { | ||
key: 1, | ||
to: t.route, | ||
class: i(n.btnClass), | ||
class: s(n.btnClass), | ||
disabled: t.disabled ? !0 : void 0, | ||
@@ -96,18 +100,18 @@ ref: "buttonRef" | ||
default: g(() => [ | ||
r(e.$slots, "default") | ||
i(e.$slots, "default") | ||
]), | ||
_: 3 | ||
}, 8, ["to", "class", "disabled"])) : t.href ? (s(), f("a", { | ||
}, 8, ["to", "class", "disabled"])) : t.href ? (o(), u("a", { | ||
key: 2, | ||
href: t.href, | ||
class: i(n.btnClass), | ||
class: s(n.btnClass), | ||
disabled: t.disabled ? !0 : void 0, | ||
ref: "buttonRef" | ||
}, [ | ||
r(e.$slots, "default") | ||
], 10, S)) : v("", !0); | ||
i(e.$slots, "default") | ||
], 10, R)) : B("", !0); | ||
} | ||
const w = /* @__PURE__ */ B(k, [["render", R]]); | ||
const w = /* @__PURE__ */ k(v, [["render", S]]); | ||
export { | ||
w as default | ||
}; |
{ | ||
"name": "btn-kit", | ||
"version": "0.0.1-alpha.6", | ||
"version": "0.0.1-alpha.7", | ||
"description": "btn-kit is a Vue 3 component for creating buttons for web applications. Built-in features include icon support, different button types and sizes, states, effects.", | ||
@@ -5,0 +5,0 @@ "author": "ux-ui.pro", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13500
144