bani-ui 1.0.2-alpha.2 → 1.0.2-alpha.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.
@@ -0,0 +1,85 @@
1
+ import { defineComponent as $, inject as N, computed as l, useSlots as O, ref as U, openBlock as m, createBlock as y, resolveDynamicComponent as w, unref as B, normalizeClass as D, withCtx as I, renderSlot as g, createVNode as R, normalizeStyle as b, createCommentVNode as v } from "vue";
2
+ import { _ as h } from "./Icon-CrwMq7oY.js";
3
+ import { faSpinner as p } from "@fortawesome/free-solid-svg-icons";
4
+ import { library as E } from "@fortawesome/fontawesome-svg-core";
5
+ import { t as G } from "./vendor-vd2Uvf7X.js";
6
+ import { w as K } from "./utils-CWTCZ0kD.js";
7
+ const P = Symbol(
8
+ "BUTTON_GROUP_CTX_KEY"
9
+ ), V = /* @__PURE__ */ $({
10
+ name: "BnButton",
11
+ __name: "Button",
12
+ props: {
13
+ tag: { default: "button" },
14
+ type: {},
15
+ size: {},
16
+ plain: { type: Boolean },
17
+ round: { type: Boolean },
18
+ circle: { type: Boolean },
19
+ disabled: { type: Boolean },
20
+ autofocus: { type: Boolean },
21
+ nativeType: { default: "button" },
22
+ icon: {},
23
+ loading: { type: Boolean },
24
+ loadingIcon: {},
25
+ useThrottle: { type: Boolean, default: !0 },
26
+ throttleDuration: { default: 500 }
27
+ },
28
+ emits: ["click"],
29
+ setup(e, { expose: T, emit: k }) {
30
+ E.add(p);
31
+ const o = e, t = N(P, void 0), a = l(() => (t == null ? void 0 : t.size) ?? o.size ?? ""), i = l(() => (t == null ? void 0 : t.type) ?? o.type ?? ""), s = l(() => (t == null ? void 0 : t.disabled) || o.disabled || !1), C = k, z = O(), u = U(), c = l(() => ({
32
+ marginRight: z.default ? "6px" : "0px"
33
+ })), d = (n) => C("click", n), S = G(
34
+ d,
35
+ o.throttleDuration,
36
+ { trailing: !1 }
37
+ );
38
+ return T({
39
+ ref: u,
40
+ disabled: s,
41
+ size: a,
42
+ type: i
43
+ }), (n, r) => (m(), y(w(o.tag), {
44
+ ref_key: "_ref",
45
+ ref: u,
46
+ class: D(["er-button", {
47
+ [`er-button--${i.value}`]: i.value,
48
+ [`er-button--${a.value}`]: a.value,
49
+ "is-plain": e.plain,
50
+ "is-round": e.round,
51
+ "is-circle": e.circle,
52
+ "is-disabled": s.value,
53
+ "is-loading": e.loading
54
+ }]),
55
+ autofocus: e.autofocus,
56
+ type: e.tag === "button" ? e.nativeType : void 0,
57
+ disabled: s.value || e.loading,
58
+ onClick: r[0] || (r[0] = (f) => e.useThrottle ? B(S)(f) : d(f))
59
+ }, {
60
+ default: I(() => [
61
+ e.loading ? g(n.$slots, "loading", { key: 0 }, () => [
62
+ R(h, {
63
+ class: "loading-icon",
64
+ icon: e.loadingIcon ?? B(p),
65
+ style: b(c.value),
66
+ size: "1x",
67
+ spin: ""
68
+ }, null, 8, ["icon", "style"])
69
+ ]) : v("", !0),
70
+ e.icon && !e.loading ? (m(), y(h, {
71
+ key: 1,
72
+ icon: e.icon,
73
+ size: "1x",
74
+ style: b(c.value)
75
+ }, null, 8, ["icon", "style"])) : v("", !0),
76
+ g(n.$slots, "default")
77
+ ]),
78
+ _: 3
79
+ }, 8, ["autofocus", "type", "disabled", "class"]));
80
+ }
81
+ }), F = K(V);
82
+ export {
83
+ P as B,
84
+ F as a
85
+ };
@@ -0,0 +1,28 @@
1
+ import { defineComponent as r, provide as s, reactive as p, toRef as t, openBlock as a, createElementBlock as i, renderSlot as l } from "vue";
2
+ import { B as c } from "./Button-CVCKNr_z.js";
3
+ import { w as d } from "./utils-CWTCZ0kD.js";
4
+ const u = { class: "er-button-group" }, m = /* @__PURE__ */ r({
5
+ name: "BnButtonGroup",
6
+ __name: "ButtonGroup",
7
+ props: {
8
+ size: {},
9
+ type: {},
10
+ disabled: { type: Boolean }
11
+ },
12
+ setup(o) {
13
+ const e = o;
14
+ return s(
15
+ c,
16
+ p({
17
+ size: t(e, "size"),
18
+ type: t(e, "type"),
19
+ disabled: t(e, "disabled")
20
+ })
21
+ ), (n, B) => (a(), i("div", u, [
22
+ l(n.$slots, "default")
23
+ ]));
24
+ }
25
+ }), y = d(m);
26
+ export {
27
+ y as B
28
+ };
@@ -0,0 +1,49 @@
1
+ import { defineComponent as r, computed as t, openBlock as p, createElementBlock 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-vd2Uvf7X.js";
4
+ import { w as d } from "./utils-CWTCZ0kD.js";
5
+ const v = /* @__PURE__ */ r({
6
+ name: "BnIcon",
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(e) {
37
+ const o = e, n = t(() => f(o, ["type", "color"])), a = t(() => ({ color: o.color ?? void 0 }));
38
+ return (l, I) => (p(), s("i", i({
39
+ class: ["er-icon", [`er-icon--${e.type}`]],
40
+ style: a.value
41
+ }, l.$attrs), [
42
+ c(m(u), y(B(n.value)), null, 16)
43
+ ], 16));
44
+ }
45
+ }), w = d(v);
46
+ export {
47
+ w as B,
48
+ v as _
49
+ };
@@ -0,0 +1,11 @@
1
+ import { m as o } from "./utils-CWTCZ0kD.js";
2
+ import { a as t } from "./Button-CVCKNr_z.js";
3
+ import { B as n } from "./ButtonGroup-DaudVIbY.js";
4
+ import { B as r } from "./Icon-CrwMq7oY.js";
5
+ const m = [t, n, r], e = o(m);
6
+ export {
7
+ t as BnButton,
8
+ n as BnButtonGroup,
9
+ r as BnIcon,
10
+ e as default
11
+ };
@@ -0,0 +1,12 @@
1
+ import { f as n } from "./vendor-vd2Uvf7X.js";
2
+ function e(a) {
3
+ return (s) => n(a, (l) => s.use(l));
4
+ }
5
+ const i = (a) => (a.install = (t) => {
6
+ const s = a.name;
7
+ t.component(s, a);
8
+ }, a);
9
+ export {
10
+ e as m,
11
+ i as w
12
+ };