sakana-element 1.0.1

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.
@@ -0,0 +1,106 @@
1
+ import { defineComponent as z, useSlots as I, inject as O, ref as S, computed as s, createBlock as g, openBlock as u, resolveDynamicComponent as N, unref as R, normalizeClass as U, withCtx as w, renderSlot as d, createCommentVNode as _, createVNode as D, normalizeStyle as h, provide as K, reactive as P, toRef as r, createElementBlock as V } from "vue";
2
+ import { _ as k } from "./Icon-D-m6M0GX.js";
3
+ import { t as X } from "./vendor-B6hv2FuL.js";
4
+ import { w as T } from "./utils-Dr2tNfHs.js";
5
+ const C = Symbol(
6
+ "BUTTON_GROUP_CTX_KEY"
7
+ ), Y = /* @__PURE__ */ z({
8
+ name: "ErButton",
9
+ __name: "Button",
10
+ props: {
11
+ tag: { default: "button" },
12
+ type: {},
13
+ size: {},
14
+ nativeType: { default: "button" },
15
+ disabled: { type: Boolean },
16
+ loading: { type: Boolean },
17
+ icon: {},
18
+ circle: { type: Boolean },
19
+ plain: { type: Boolean },
20
+ round: { type: Boolean },
21
+ loadingIcon: {},
22
+ autofocus: { type: Boolean },
23
+ useThrottle: { type: Boolean, default: !0 },
24
+ throttleDuration: { default: 500 }
25
+ },
26
+ emits: ["click"],
27
+ setup(a, { expose: n, emit: l }) {
28
+ const t = a, i = l, $ = I(), o = O(C, void 0), c = S(), p = s(() => (o == null ? void 0 : o.size) ?? (t == null ? void 0 : t.size) ?? ""), f = s(() => (o == null ? void 0 : o.type) ?? (t == null ? void 0 : t.type) ?? ""), y = s(() => (o == null ? void 0 : o.disabled) || (t == null ? void 0 : t.disabled) || !1), m = s(() => ({
29
+ marginRight: $.default ? "6px" : "0px"
30
+ })), v = (e) => i("click", e), G = X(
31
+ v,
32
+ t.throttleDuration,
33
+ { trailing: !1 }
34
+ );
35
+ return n({
36
+ ref: c
37
+ }), (e, B) => (u(), g(N(e.tag), {
38
+ ref_key: "_ref",
39
+ ref: c,
40
+ autofocus: e.autofocus,
41
+ type: e.tag === "button" ? e.nativeType : void 0,
42
+ class: U(["er-button", {
43
+ [`er-button--${f.value}`]: f.value,
44
+ [`er-button--${p.value}`]: p.value,
45
+ "is-plain": e.plain,
46
+ "is-round": e.round,
47
+ "is-circle": e.circle,
48
+ "is-disabled": y.value,
49
+ "is-loading": e.loading
50
+ }]),
51
+ disabled: y.value || e.loading ? !0 : void 0,
52
+ onClick: B[0] || (B[0] = (b) => e.useThrottle ? R(G)(b) : v(b))
53
+ }, {
54
+ default: w(() => [
55
+ e.loading ? d(e.$slots, "loading", { key: 0 }, () => [
56
+ D(k, {
57
+ class: "loading-icon",
58
+ icon: e.loadingIcon ?? "spinner",
59
+ style: h(m.value),
60
+ size: "1x",
61
+ spin: ""
62
+ }, null, 8, ["icon", "style"])
63
+ ], !0) : _("", !0),
64
+ e.icon && !e.loading ? (u(), g(k, {
65
+ key: 1,
66
+ icon: e.icon,
67
+ style: h(m.value),
68
+ size: "1x"
69
+ }, null, 8, ["icon", "style"])) : _("", !0),
70
+ d(e.$slots, "default", {}, void 0, !0)
71
+ ]),
72
+ _: 3
73
+ }, 8, ["autofocus", "type", "disabled", "class"]));
74
+ }
75
+ }), E = (a, n) => {
76
+ const l = a.__vccOpts || a;
77
+ for (const [t, i] of n)
78
+ l[t] = i;
79
+ return l;
80
+ }, j = /* @__PURE__ */ E(Y, [["__scopeId", "data-v-3a64ee7d"]]), q = { class: "er-button-group" }, A = /* @__PURE__ */ z({
81
+ name: "ErButtonGroup",
82
+ __name: "ButtonGroup",
83
+ props: {
84
+ size: {},
85
+ type: {},
86
+ disabled: { type: Boolean }
87
+ },
88
+ setup(a) {
89
+ const n = a;
90
+ return K(
91
+ //注入
92
+ C,
93
+ P({
94
+ size: r(n, "size"),
95
+ type: r(n, "type"),
96
+ disabled: r(n, "disabled")
97
+ })
98
+ ), (l, t) => (u(), V("div", q, [
99
+ d(l.$slots, "default", {}, void 0, !0)
100
+ ]));
101
+ }
102
+ }), F = /* @__PURE__ */ E(A, [["__scopeId", "data-v-f316cd1a"]]), Q = T(j), W = T(F);
103
+ export {
104
+ Q as E,
105
+ W as a
106
+ };
@@ -0,0 +1,49 @@
1
+ import { defineComponent as p, computed as o, createElementBlock as l, openBlock as s, mergeProps as i, createVNode as c, unref as m, normalizeProps as y, guardReactiveProps as B } from "vue";
2
+ import { FontAwesomeIcon as u } from "@fortawesome/vue-fontawesome";
3
+ import { o as f } from "./vendor-B6hv2FuL.js";
4
+ import { w as d } from "./utils-Dr2tNfHs.js";
5
+ const v = /* @__PURE__ */ p({
6
+ name: "ErIcon",
7
+ inheritAttrs: !1,
8
+ __name: "Icon",
9
+ props: {
10
+ border: { type: Boolean },
11
+ fixedWidth: { type: Boolean },
12
+ flip: {},
13
+ icon: {},
14
+ mask: {},
15
+ listItem: { type: Boolean },
16
+ pull: {},
17
+ pulse: { type: Boolean },
18
+ rotation: {},
19
+ swapOpacity: { type: Boolean },
20
+ size: {},
21
+ spin: { type: Boolean },
22
+ transform: {},
23
+ symbol: { type: [Boolean, String] },
24
+ title: {},
25
+ inverse: { type: Boolean },
26
+ bounce: { type: Boolean },
27
+ shake: { type: Boolean },
28
+ beat: { type: Boolean },
29
+ fade: { type: Boolean },
30
+ beatFade: { type: Boolean },
31
+ spinPulse: { type: Boolean },
32
+ spinReverse: { type: Boolean },
33
+ type: {},
34
+ color: {}
35
+ },
36
+ setup(t) {
37
+ const e = t, n = o(() => f(e, ["type", "color"])), r = o(() => ({ color: e.color ?? void 0 }));
38
+ return (a, I) => (s(), l("i", i({
39
+ class: ["er-icon", [`er-icon-${e.type}`]],
40
+ style: r.value
41
+ }, a.$attrs), [
42
+ c(m(u), y(B(n.value)), null, 16)
43
+ ], 16));
44
+ }
45
+ }), k = d(v);
46
+ export {
47
+ k as E,
48
+ v as _
49
+ };
@@ -0,0 +1,14 @@
1
+ import { m as o } from "./utils-Dr2tNfHs.js";
2
+ import { library as r } from "@fortawesome/fontawesome-svg-core";
3
+ import { fas as t } from "@fortawesome/free-solid-svg-icons";
4
+ import { E as a, a as m } from "./Button-B9E1LUtb.js";
5
+ import { E as s } from "./Icon-D-m6M0GX.js";
6
+ const n = [a, m, s];
7
+ r.add(t);
8
+ const E = o(n);
9
+ export {
10
+ a as ErButton,
11
+ m as ErButtonGroup,
12
+ s as ErIcon,
13
+ E as default
14
+ };
@@ -0,0 +1,14 @@
1
+ import { f as n } from "./vendor-B6hv2FuL.js";
2
+ function e(a) {
3
+ return (s) => n(a, (l) => {
4
+ s.use(l);
5
+ });
6
+ }
7
+ const i = (a) => (a.install = (t) => {
8
+ const s = a.name;
9
+ t.component(s, a);
10
+ }, a);
11
+ export {
12
+ e as m,
13
+ i as w
14
+ };