bani-ui 1.0.2-alpha.1 → 1.0.2-alpha.10

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.
Files changed (209) hide show
  1. package/dist/es/Button-DE5lOjx4.js +86 -0
  2. package/dist/es/ButtonGroup-CgAr7Q6O.js +29 -0
  3. package/dist/es/Icon-B1pHSRJ9.js +50 -0
  4. package/dist/es/Loading-BJXm3yVc.js +196 -0
  5. package/dist/es/Message-CLTFWHIN.js +167 -0
  6. package/dist/es/Popconfirm-DA_hHUdg.js +99 -0
  7. package/dist/es/Tooltip-040OoVcb.js +193 -0
  8. package/dist/es/hooks-Mfyp42JB.js +58 -0
  9. package/dist/es/index.js +32 -10
  10. package/dist/es/locale/lang/af.js +257 -0
  11. package/dist/es/locale/lang/ar-eg.js +228 -0
  12. package/dist/es/locale/lang/ar.js +239 -0
  13. package/dist/es/locale/lang/az.js +251 -0
  14. package/dist/es/locale/lang/bg.js +262 -0
  15. package/dist/es/locale/lang/bn.js +247 -0
  16. package/dist/es/locale/lang/ca.js +249 -0
  17. package/dist/es/locale/lang/ckb.js +225 -0
  18. package/dist/es/locale/lang/cs.js +254 -0
  19. package/dist/es/locale/lang/da.js +253 -0
  20. package/dist/es/locale/lang/de.js +238 -0
  21. package/dist/es/locale/lang/el.js +252 -0
  22. package/dist/es/locale/lang/en.js +197 -0
  23. package/dist/es/locale/lang/eo.js +250 -0
  24. package/dist/es/locale/lang/es.js +249 -0
  25. package/dist/es/locale/lang/et.js +248 -0
  26. package/dist/es/locale/lang/eu.js +249 -0
  27. package/dist/es/locale/lang/fa.js +211 -0
  28. package/dist/es/locale/lang/fi.js +252 -0
  29. package/dist/es/locale/lang/fr.js +203 -0
  30. package/dist/es/locale/lang/he.js +248 -0
  31. package/dist/es/locale/lang/hi.js +211 -0
  32. package/dist/es/locale/lang/hr.js +252 -0
  33. package/dist/es/locale/lang/hu.js +252 -0
  34. package/dist/es/locale/lang/hy-am.js +252 -0
  35. package/dist/es/locale/lang/id.js +247 -0
  36. package/dist/es/locale/lang/index.js +136 -0
  37. package/dist/es/locale/lang/it.js +253 -0
  38. package/dist/es/locale/lang/ja.js +245 -0
  39. package/dist/es/locale/lang/kk.js +252 -0
  40. package/dist/es/locale/lang/km.js +211 -0
  41. package/dist/es/locale/lang/ko.js +224 -0
  42. package/dist/es/locale/lang/ku.js +252 -0
  43. package/dist/es/locale/lang/ky.js +252 -0
  44. package/dist/es/locale/lang/lo.js +211 -0
  45. package/dist/es/locale/lang/lt.js +249 -0
  46. package/dist/es/locale/lang/lv.js +252 -0
  47. package/dist/es/locale/lang/mg.js +247 -0
  48. package/dist/es/locale/lang/mn.js +252 -0
  49. package/dist/es/locale/lang/ms.js +215 -0
  50. package/dist/es/locale/lang/my.js +211 -0
  51. package/dist/es/locale/lang/nb-no.js +249 -0
  52. package/dist/es/locale/lang/nl.js +228 -0
  53. package/dist/es/locale/lang/no.js +211 -0
  54. package/dist/es/locale/lang/pa.js +250 -0
  55. package/dist/es/locale/lang/pl.js +245 -0
  56. package/dist/es/locale/lang/pt-br.js +245 -0
  57. package/dist/es/locale/lang/pt.js +262 -0
  58. package/dist/es/locale/lang/ro.js +252 -0
  59. package/dist/es/locale/lang/ru.js +235 -0
  60. package/dist/es/locale/lang/sk.js +254 -0
  61. package/dist/es/locale/lang/sl.js +253 -0
  62. package/dist/es/locale/lang/sr.js +244 -0
  63. package/dist/es/locale/lang/sv.js +251 -0
  64. package/dist/es/locale/lang/sw.js +219 -0
  65. package/dist/es/locale/lang/ta.js +258 -0
  66. package/dist/es/locale/lang/te.js +211 -0
  67. package/dist/es/locale/lang/th.js +251 -0
  68. package/dist/es/locale/lang/tk.js +256 -0
  69. package/dist/es/locale/lang/tr.js +248 -0
  70. package/dist/es/locale/lang/ug-cn.js +252 -0
  71. package/dist/es/locale/lang/uk.js +249 -0
  72. package/dist/es/locale/lang/uz-uz.js +250 -0
  73. package/dist/es/locale/lang/vi.js +197 -0
  74. package/dist/es/locale/lang/zh-cn.js +197 -0
  75. package/dist/es/locale/lang/zh-hk.js +209 -0
  76. package/dist/es/locale/lang/zh-mo.js +209 -0
  77. package/dist/es/locale/lang/zh-tw.js +209 -0
  78. package/dist/es/utils-CnOVokX1.js +51 -0
  79. package/dist/es/vendor-CyogNz9a.js +2465 -0
  80. package/dist/index.css +1 -1
  81. package/dist/theme/Button.css +1 -304
  82. package/dist/theme/ButtonGroup.css +1 -46
  83. package/dist/theme/Icon.css +1 -25
  84. package/dist/theme/Loading.css +1 -0
  85. package/dist/theme/Message.css +1 -0
  86. package/dist/theme/Popconfirm.css +1 -0
  87. package/dist/theme/Tooltip.css +1 -0
  88. package/dist/theme/index.css +1 -197
  89. package/dist/theme/theme/Button.css +1 -0
  90. package/dist/theme/theme/ButtonGroup.css +1 -0
  91. package/dist/theme/theme/Icon.css +1 -0
  92. package/dist/theme/theme/Loading.css +1 -0
  93. package/dist/theme/theme/Message.css +1 -0
  94. package/dist/theme/theme/Popconfirm.css +1 -0
  95. package/dist/theme/theme/Tooltip.css +1 -0
  96. package/dist/theme/theme/index.css +1 -0
  97. package/dist/types/components/Button/constants.d.ts +1 -0
  98. package/dist/types/components/Button/index.d.ts +153 -13
  99. package/dist/types/components/Button/types.d.ts +1 -0
  100. package/dist/types/components/ButtonGroup/index.d.ts +34 -3
  101. package/dist/types/components/ButtonGroup/types.d.ts +1 -0
  102. package/dist/types/components/Icon/index.d.ts +235 -3
  103. package/dist/types/components/Icon/types.d.ts +1 -0
  104. package/dist/types/components/Loading/directive.d.ts +13 -0
  105. package/dist/types/components/Loading/index.d.ts +13 -0
  106. package/dist/types/components/Loading/service.d.ts +12 -0
  107. package/dist/types/components/Loading/types.d.ts +20 -0
  108. package/dist/types/components/Message/index.d.ts +2 -0
  109. package/dist/types/components/Message/methods.d.ts +27 -0
  110. package/dist/types/components/Message/types.d.ts +41 -0
  111. package/dist/types/components/Popconfirm/index.d.ts +163 -0
  112. package/dist/types/components/Popconfirm/types.d.ts +19 -0
  113. package/dist/types/components/Tooltip/index.d.ts +178 -0
  114. package/dist/types/components/Tooltip/types.d.ts +25 -0
  115. package/dist/types/components/Tooltip/useEventsToTiggerNode.d.ts +10 -0
  116. package/dist/types/components/index.d.ts +4 -0
  117. package/dist/types/core/index.d.ts +2 -1
  118. package/dist/types/hooks/index.d.ts +8 -0
  119. package/dist/types/hooks/useClickOutside.d.ts +3 -0
  120. package/dist/types/hooks/useEventListener.d.ts +3 -0
  121. package/dist/types/hooks/useId.d.ts +4 -0
  122. package/dist/types/hooks/useLocale.d.ts +6 -0
  123. package/dist/types/hooks/useOffset.d.ts +13 -0
  124. package/dist/types/hooks/useZIndex.d.ts +5 -0
  125. package/dist/types/locale/index.d.ts +74 -0
  126. package/dist/types/locale/lang/af.d.ts +195 -0
  127. package/dist/types/locale/lang/ar-eg.d.ts +195 -0
  128. package/dist/types/locale/lang/ar.d.ts +195 -0
  129. package/dist/types/locale/lang/az.d.ts +198 -0
  130. package/dist/types/locale/lang/bg.d.ts +195 -0
  131. package/dist/types/locale/lang/bn.d.ts +195 -0
  132. package/dist/types/locale/lang/ca.d.ts +195 -0
  133. package/dist/types/locale/lang/ckb.d.ts +195 -0
  134. package/dist/types/locale/lang/cs.d.ts +197 -0
  135. package/dist/types/locale/lang/da.d.ts +195 -0
  136. package/dist/types/locale/lang/de.d.ts +197 -0
  137. package/dist/types/locale/lang/el.d.ts +195 -0
  138. package/dist/types/locale/lang/en.d.ts +195 -0
  139. package/dist/types/locale/lang/eo.d.ts +195 -0
  140. package/dist/types/locale/lang/es.d.ts +195 -0
  141. package/dist/types/locale/lang/et.d.ts +195 -0
  142. package/dist/types/locale/lang/eu.d.ts +195 -0
  143. package/dist/types/locale/lang/fa.d.ts +195 -0
  144. package/dist/types/locale/lang/fi.d.ts +195 -0
  145. package/dist/types/locale/lang/fr.d.ts +195 -0
  146. package/dist/types/locale/lang/he.d.ts +195 -0
  147. package/dist/types/locale/lang/hi.d.ts +195 -0
  148. package/dist/types/locale/lang/hr.d.ts +195 -0
  149. package/dist/types/locale/lang/hu.d.ts +195 -0
  150. package/dist/types/locale/lang/hy-am.d.ts +195 -0
  151. package/dist/types/locale/lang/id.d.ts +195 -0
  152. package/dist/types/locale/lang/it.d.ts +195 -0
  153. package/dist/types/locale/lang/ja.d.ts +195 -0
  154. package/dist/types/locale/lang/kk.d.ts +195 -0
  155. package/dist/types/locale/lang/km.d.ts +195 -0
  156. package/dist/types/locale/lang/ko.d.ts +195 -0
  157. package/dist/types/locale/lang/ku.d.ts +195 -0
  158. package/dist/types/locale/lang/ky.d.ts +195 -0
  159. package/dist/types/locale/lang/lo.d.ts +195 -0
  160. package/dist/types/locale/lang/lt.d.ts +195 -0
  161. package/dist/types/locale/lang/lv.d.ts +195 -0
  162. package/dist/types/locale/lang/mg.d.ts +195 -0
  163. package/dist/types/locale/lang/mn.d.ts +195 -0
  164. package/dist/types/locale/lang/ms.d.ts +197 -0
  165. package/dist/types/locale/lang/my.d.ts +195 -0
  166. package/dist/types/locale/lang/nb-no.d.ts +195 -0
  167. package/dist/types/locale/lang/nl.d.ts +195 -0
  168. package/dist/types/locale/lang/no.d.ts +195 -0
  169. package/dist/types/locale/lang/pa.d.ts +195 -0
  170. package/dist/types/locale/lang/pl.d.ts +195 -0
  171. package/dist/types/locale/lang/pt-br.d.ts +195 -0
  172. package/dist/types/locale/lang/pt.d.ts +195 -0
  173. package/dist/types/locale/lang/ro.d.ts +195 -0
  174. package/dist/types/locale/lang/ru.d.ts +195 -0
  175. package/dist/types/locale/lang/sk.d.ts +197 -0
  176. package/dist/types/locale/lang/sl.d.ts +195 -0
  177. package/dist/types/locale/lang/sr.d.ts +195 -0
  178. package/dist/types/locale/lang/sv.d.ts +195 -0
  179. package/dist/types/locale/lang/sw.d.ts +195 -0
  180. package/dist/types/locale/lang/ta.d.ts +195 -0
  181. package/dist/types/locale/lang/te.d.ts +195 -0
  182. package/dist/types/locale/lang/th.d.ts +195 -0
  183. package/dist/types/locale/lang/tk.d.ts +195 -0
  184. package/dist/types/locale/lang/tr.d.ts +195 -0
  185. package/dist/types/locale/lang/ug-cn.d.ts +195 -0
  186. package/dist/types/locale/lang/uk.d.ts +195 -0
  187. package/dist/types/locale/lang/uz-uz.d.ts +195 -0
  188. package/dist/types/locale/lang/vi.d.ts +195 -0
  189. package/dist/types/locale/lang/zh-cn.d.ts +195 -0
  190. package/dist/types/locale/lang/zh-hk.d.ts +195 -0
  191. package/dist/types/locale/lang/zh-mo.d.ts +195 -0
  192. package/dist/types/locale/lang/zh-tw.d.ts +195 -0
  193. package/dist/types/utils/RenderVnode.d.ts +11 -0
  194. package/dist/types/utils/iconMap.d.ts +1 -0
  195. package/dist/types/utils/index.d.ts +3 -0
  196. package/dist/types/utils/install.d.ts +2 -0
  197. package/dist/types/utils/style.d.ts +1 -0
  198. package/dist/umd/index.css +1 -1
  199. package/dist/umd/index.css.br +0 -0
  200. package/dist/umd/index.css.gz +0 -0
  201. package/dist/umd/index.umd.cjs +16 -14
  202. package/dist/umd/index.umd.cjs.br +0 -0
  203. package/dist/umd/index.umd.cjs.gz +0 -0
  204. package/package.json +7 -4
  205. package/dist/es/Button-Bwc0dTzv.js +0 -102
  206. package/dist/es/ButtonGroup-C4UHHgrM.js +0 -35
  207. package/dist/es/Icon-CseJvWyQ.js +0 -56
  208. package/dist/es/utils-B5aZ4w8w.js +0 -16
  209. package/dist/es/vendor-BkjRo-uZ.js +0 -1176
@@ -0,0 +1,86 @@
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-B1pHSRJ9.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-CyogNz9a.js";
6
+ import { w as K } from "./utils-CnOVokX1.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
+ V as _,
85
+ F as a
86
+ };
@@ -0,0 +1,29 @@
1
+ import { defineComponent as n, provide as s, reactive as p, toRef as t, openBlock as i, createElementBlock as a, renderSlot as l } from "vue";
2
+ import { B as c } from "./Button-DE5lOjx4.js";
3
+ import { w as d } from "./utils-CnOVokX1.js";
4
+ import "@fortawesome/free-solid-svg-icons";
5
+ const m = { class: "er-button-group" }, u = /* @__PURE__ */ n({
6
+ name: "BnButtonGroup",
7
+ __name: "ButtonGroup",
8
+ props: {
9
+ size: {},
10
+ type: {},
11
+ disabled: { type: Boolean }
12
+ },
13
+ setup(o) {
14
+ const e = o;
15
+ return s(
16
+ c,
17
+ p({
18
+ size: t(e, "size"),
19
+ type: t(e, "type"),
20
+ disabled: t(e, "disabled")
21
+ })
22
+ ), (r, B) => (i(), a("div", m, [
23
+ l(r.$slots, "default")
24
+ ]));
25
+ }
26
+ }), G = d(u);
27
+ export {
28
+ G as B
29
+ };
@@ -0,0 +1,50 @@
1
+ import { defineComponent as r, computed as t, openBlock as l, 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 { p as f } from "./vendor-CyogNz9a.js";
4
+ import { w as d } from "./utils-CnOVokX1.js";
5
+ import "@fortawesome/free-solid-svg-icons";
6
+ const v = /* @__PURE__ */ r({
7
+ name: "BnIcon",
8
+ inheritAttrs: !1,
9
+ __name: "Icon",
10
+ props: {
11
+ border: { type: Boolean },
12
+ fixedWidth: { type: Boolean },
13
+ flip: {},
14
+ icon: {},
15
+ mask: {},
16
+ listItem: { type: Boolean },
17
+ pull: {},
18
+ pulse: { type: Boolean },
19
+ rotation: {},
20
+ swapOpacity: { type: Boolean },
21
+ size: {},
22
+ spin: { type: Boolean },
23
+ transform: {},
24
+ symbol: { type: [Boolean, String] },
25
+ title: {},
26
+ inverse: { type: Boolean },
27
+ bounce: { type: Boolean },
28
+ shake: { type: Boolean },
29
+ beat: { type: Boolean },
30
+ fade: { type: Boolean },
31
+ beatFade: { type: Boolean },
32
+ spinPulse: { type: Boolean },
33
+ spinReverse: { type: Boolean },
34
+ type: {},
35
+ color: {}
36
+ },
37
+ setup(e) {
38
+ const o = e, n = t(() => f(o, ["type", "color"])), a = t(() => ({ color: o.color ?? void 0 }));
39
+ return (p, I) => (l(), s("i", i({
40
+ class: ["er-icon", [`er-icon--${e.type}`]],
41
+ style: a.value
42
+ }, p.$attrs), [
43
+ c(m(u), y(B(n.value)), null, 16)
44
+ ], 16));
45
+ }
46
+ }), _ = d(v);
47
+ export {
48
+ _ as B,
49
+ v as _
50
+ };
@@ -0,0 +1,196 @@
1
+ import { defineComponent as E, useCssVars as T, computed as V, openBlock as m, createBlock as k, Transition as w, withCtx as D, withDirectives as z, createElementVNode as x, normalizeClass as F, createCommentVNode as C, createElementBlock as M, toDisplayString as H, vShow as R, nextTick as K, ref as A, reactive as O, createApp as P } from "vue";
2
+ import { e as Y } from "./hooks-Mfyp42JB.js";
3
+ import { _ as Z } from "./Icon-B1pHSRJ9.js";
4
+ import { m as I, k as q, a as G, e as U } from "./vendor-CyogNz9a.js";
5
+ const j = { class: "er-loading__spinner" }, J = {
6
+ key: 1,
7
+ class: "er-loading-text"
8
+ }, Q = /* @__PURE__ */ E({
9
+ name: "BnLoading",
10
+ inheritAttrs: !1,
11
+ __name: "Loading",
12
+ props: {
13
+ visible: {},
14
+ background: {},
15
+ spinner: {},
16
+ text: {},
17
+ fullscreen: {},
18
+ lock: {},
19
+ beforeClose: { type: Function },
20
+ closed: { type: Function },
21
+ target: {},
22
+ body: { type: Boolean },
23
+ zIndex: {},
24
+ onAfterLeave: { type: Function }
25
+ },
26
+ setup(e) {
27
+ T((t) => ({
28
+ v098d7d6e: t.background,
29
+ v1880a613: t.zIndex
30
+ }));
31
+ const n = e, o = V(() => I(n.spinner) ? n.spinner : "spinner");
32
+ return (t, r) => (m(), k(w, {
33
+ name: "fade-in-linear",
34
+ onAfterLeave: e.onAfterLeave
35
+ }, {
36
+ default: D(() => [
37
+ z(x("div", {
38
+ class: F(["er-loading er-loading__mask", { "is-fullscreen": e.fullscreen }])
39
+ }, [
40
+ x("div", j, [
41
+ n.spinner !== !1 ? (m(), k(Z, {
42
+ key: 0,
43
+ icon: o.value,
44
+ spin: ""
45
+ }, null, 8, ["icon"])) : C("", !0),
46
+ e.text ? (m(), M("p", J, H(e.text), 1)) : C("", !0)
47
+ ])
48
+ ], 2), [
49
+ [R, n.visible.value]
50
+ ])
51
+ ]),
52
+ _: 1
53
+ }, 8, ["onAfterLeave"]));
54
+ }
55
+ }), h = "er-loading-parent--relative", S = "er-loading-parent--hiden", f = "er-loading-numb", u = /* @__PURE__ */ new Map(), { nextZIndex: W } = Y(3e4);
56
+ function X(e) {
57
+ const n = A(e.visible), o = A(!1), t = () => {
58
+ o.value && s();
59
+ }, r = O({
60
+ ...e,
61
+ onAfterLeave: t
62
+ }), c = (a) => r.text = a, s = () => {
63
+ var L, p;
64
+ const a = r.parent;
65
+ ce(a), !v(a) && (U(() => {
66
+ te(a), $(a);
67
+ }, 1), u.delete(a ?? document.body), (p = (L = i.$el) == null ? void 0 : L.parentNode) == null || p.removeChild(i.$el), y.unmount());
68
+ };
69
+ let g;
70
+ const B = () => {
71
+ var a;
72
+ e.beforeClose && !e.beforeClose() || (o.value = !0, clearTimeout(g), g = G(t), n.value = !1, (a = e.closed) == null || a.call(e));
73
+ }, y = P(Q, {
74
+ ...r,
75
+ zIndex: r.fullscreen ? W() : void 0,
76
+ visible: n
77
+ }), i = y.mount(document.createElement("div"));
78
+ return {
79
+ get $el() {
80
+ return i.$el;
81
+ },
82
+ vm: i,
83
+ close: B,
84
+ visible: n,
85
+ setText: c
86
+ };
87
+ }
88
+ function ee(e) {
89
+ let n;
90
+ return I(e.target) ? n = document.querySelector(e.target) ?? document.body : n = e.target || document.body, {
91
+ parent: n === document.body || e.body ? document.body : n,
92
+ background: e.background ?? "rgba(0, 0, 0, 0.5)",
93
+ spinner: e.spinner,
94
+ text: e.text,
95
+ fullscreen: n === document.body && (e.fullscreen ?? !0),
96
+ lock: e.lock ?? !1,
97
+ visible: e.visible ?? !0,
98
+ target: n
99
+ };
100
+ }
101
+ function ne(e = document.body) {
102
+ e.classList.add(h);
103
+ }
104
+ function te(e = document.body) {
105
+ e.classList.remove(h);
106
+ }
107
+ function oe(e = document.body) {
108
+ e.classList.add(S);
109
+ }
110
+ function $(e = document.body) {
111
+ e.classList.remove(S);
112
+ }
113
+ function v(e = document.body) {
114
+ return e.getAttribute(f);
115
+ }
116
+ function re(e = document.body) {
117
+ e.removeAttribute(f);
118
+ }
119
+ function ae(e = document.body) {
120
+ const n = v(e) ?? "0";
121
+ e.setAttribute(f, `${Number.parseInt(n) + 1}`);
122
+ }
123
+ function ce(e = document.body) {
124
+ const n = v(e);
125
+ if (n) {
126
+ const o = Number.parseInt(n) - 1;
127
+ o === 0 ? re(e) : e.setAttribute(f, `${o}`);
128
+ }
129
+ }
130
+ function se(e, n = document.body) {
131
+ e.lock ? oe(n) : $(n), ne(n);
132
+ }
133
+ let l = null;
134
+ function b(e = {}) {
135
+ var r;
136
+ const n = ee(e), o = n.parent ?? document.body;
137
+ if (n.fullscreen && !q(l))
138
+ return l;
139
+ if (ae(n == null ? void 0 : n.parent), u.has(o))
140
+ return u.get(o);
141
+ const t = X({
142
+ ...n,
143
+ closed: () => {
144
+ var c;
145
+ (c = n.closed) == null || c.call(n), n.fullscreen && (l = null);
146
+ }
147
+ });
148
+ return se(e, n == null ? void 0 : n.parent), (r = n.parent) == null || r.appendChild(t.$el), K(() => t.visible.value = !!n.visible), n.fullscreen && (l = t), u.set(o, t), t;
149
+ }
150
+ const d = Symbol("loading");
151
+ function N(e, n) {
152
+ const o = (s) => e.getAttribute(`er-loading-${s}`), t = (s) => n.modifiers[s], r = t("fullscreen"), c = {
153
+ text: o("text"),
154
+ spinner: o("spinner"),
155
+ background: o("background"),
156
+ target: r ? void 0 : e,
157
+ body: t("body"),
158
+ lock: t("lock"),
159
+ fullscreen: r
160
+ };
161
+ e[d] = {
162
+ options: c,
163
+ instance: b(c)
164
+ };
165
+ }
166
+ const _ = {
167
+ mounted(e, n) {
168
+ n.value && N(e, n);
169
+ },
170
+ updated(e, n) {
171
+ var o, t;
172
+ if (n.oldValue !== n.value) {
173
+ if (n.value && !n.oldValue) {
174
+ N(e, n);
175
+ return;
176
+ }
177
+ (t = (o = e[d]) == null ? void 0 : o.instance) == null || t.close();
178
+ }
179
+ },
180
+ unmounted(e) {
181
+ var n;
182
+ (n = e[d]) == null || n.instance.close(), e[d] = void 0;
183
+ }
184
+ }, fe = {
185
+ name: "BnLoading",
186
+ install(e) {
187
+ e.directive("loading", _), e.config.globalProperties.$loading = b;
188
+ },
189
+ directive: _,
190
+ service: b
191
+ };
192
+ export {
193
+ fe as B,
194
+ b as L,
195
+ _ as v
196
+ };
@@ -0,0 +1,167 @@
1
+ import { defineComponent as R, ref as g, computed as x, onMounted as $, watch as D, openBlock as v, createBlock as w, Transition as S, withCtx as T, withDirectives as V, createElementVNode as C, normalizeStyle as L, normalizeClass as A, createVNode as B, renderSlot as Z, unref as F, createCommentVNode as I, createElementBlock as H, withModifiers as j, vShow as q, shallowReactive as G, isVNode as J, h as K, render as N } from "vue";
2
+ import { d as P, a as Q, e as U, b as W } from "./hooks-Mfyp42JB.js";
3
+ import { t as X, R as Y, b as _ } from "./utils-CnOVokX1.js";
4
+ import { _ as b } from "./Icon-B1pHSRJ9.js";
5
+ import { faCircleInfo as ee } from "@fortawesome/free-solid-svg-icons";
6
+ import { b as te, e as se, g as k, m as ne, f as z, h as oe, s as ae } from "./vendor-CyogNz9a.js";
7
+ const re = [
8
+ "info",
9
+ "success",
10
+ "warning",
11
+ "danger",
12
+ "error"
13
+ ], ie = { class: "er-message__content" }, ce = {
14
+ key: 0,
15
+ class: "er-message__close"
16
+ }, le = /* @__PURE__ */ R({
17
+ name: "BnMessage",
18
+ __name: "Message",
19
+ props: {
20
+ id: {},
21
+ message: {},
22
+ duration: { default: 3e3 },
23
+ showClose: { type: Boolean },
24
+ center: { type: Boolean },
25
+ type: { default: "info" },
26
+ offset: { default: 10 },
27
+ zIndex: {},
28
+ transitionName: { default: "fade-up" },
29
+ onDestory: {}
30
+ },
31
+ setup(e, { expose: t }) {
32
+ const s = e, n = g(!1), i = g(), c = x(() => X.get(s.type) ?? ee), o = g(0), { topOffset: h, bottomOffset: f } = P({
33
+ getLastBottomOffset: te(me, s),
34
+ offset: s.offset,
35
+ boxHeight: o
36
+ }), d = x(() => ({
37
+ top: h.value + "px",
38
+ zIndex: s.zIndex
39
+ }));
40
+ let p;
41
+ function y() {
42
+ s.duration !== 0 && (p = se(u, s.duration));
43
+ }
44
+ function E() {
45
+ clearTimeout(p);
46
+ }
47
+ function u() {
48
+ n.value = !1;
49
+ }
50
+ return $(() => {
51
+ n.value = !0, y();
52
+ }), D(n, (l) => {
53
+ l || (o.value = -s.offset);
54
+ }), Q(document, "keydown", (l) => {
55
+ const { code: a } = l;
56
+ a === "Escape" && u();
57
+ }), t({
58
+ bottomOffset: f,
59
+ close: u
60
+ }), (l, a) => (v(), w(S, {
61
+ name: e.transitionName,
62
+ onEnter: a[0] || (a[0] = (O) => o.value = i.value.getBoundingClientRect().height),
63
+ onAfterLeave: a[1] || (a[1] = (O) => !n.value && e.onDestory())
64
+ }, {
65
+ default: T(() => [
66
+ V(C("div", {
67
+ ref_key: "messageRef",
68
+ ref: i,
69
+ class: A(["er-message", {
70
+ [`er-message--${e.type}`]: e.type,
71
+ "is-close": e.showClose,
72
+ "text-center": e.center
73
+ }]),
74
+ style: L(d.value),
75
+ role: "alert",
76
+ onMouseenter: E,
77
+ onMouseleave: y
78
+ }, [
79
+ B(b, {
80
+ class: "er-message__icon",
81
+ icon: c.value
82
+ }, null, 8, ["icon"]),
83
+ C("div", ie, [
84
+ Z(l.$slots, "default", {}, () => [
85
+ e.message ? (v(), w(F(Y), {
86
+ key: 0,
87
+ vNode: e.message
88
+ }, null, 8, ["vNode"])) : I("", !0)
89
+ ])
90
+ ]),
91
+ e.showClose ? (v(), H("div", ce, [
92
+ B(b, {
93
+ icon: "xmark",
94
+ onClick: j(u, ["stop"])
95
+ })
96
+ ])) : I("", !0)
97
+ ], 38), [
98
+ [q, n.value]
99
+ ])
100
+ ]),
101
+ _: 3
102
+ }, 8, ["name"]));
103
+ }
104
+ }), r = G([]), { nextZIndex: fe } = U(), de = {
105
+ type: "info",
106
+ duration: 3e3,
107
+ offset: 10,
108
+ transitionName: "fade-up"
109
+ };
110
+ function M(e) {
111
+ const t = !e || J(e) || ne(e) ? {
112
+ message: e
113
+ } : e;
114
+ return { ...de, ...t };
115
+ }
116
+ function ue(e) {
117
+ const t = W().value, s = document.createElement("div"), n = () => {
118
+ const d = z(r, { id: t });
119
+ d !== -1 && (r.splice(d, 1), N(null, s));
120
+ }, i = {
121
+ ...e,
122
+ id: t,
123
+ zIndex: fe(),
124
+ onDestory: n
125
+ }, c = K(le, i);
126
+ N(c, s), document.body.appendChild(s.firstElementChild);
127
+ const o = c.component, f = {
128
+ props: i,
129
+ id: t,
130
+ vm: o,
131
+ vnode: c,
132
+ handler: {
133
+ close: () => o.exposed.close()
134
+ }
135
+ };
136
+ return r.push(f), f;
137
+ }
138
+ const m = function(e = {}) {
139
+ const t = M(e);
140
+ return ue(t).handler;
141
+ };
142
+ function me() {
143
+ const e = z(r, { id: this.id });
144
+ return e <= 0 ? 0 : oe(r, [e - 1, "vm", "exposed", "bottomOffset", "value"]);
145
+ }
146
+ function ge(e) {
147
+ k(r, (t) => {
148
+ if (e) {
149
+ t.props.type === e && t.handler.close();
150
+ return;
151
+ }
152
+ t.handler.close();
153
+ });
154
+ }
155
+ k(
156
+ re,
157
+ (e) => ae(m, e, (t) => {
158
+ const s = M(t);
159
+ return m({ ...s, type: e });
160
+ })
161
+ );
162
+ m.closeAll = ge;
163
+ const Ce = _(m, "$message");
164
+ export {
165
+ Ce as B,
166
+ re as m
167
+ };
@@ -0,0 +1,99 @@
1
+ import { defineComponent as w, computed as d, ref as x, openBlock as u, createBlock as p, createSlots as $, withCtx as o, createElementVNode as n, normalizeStyle as N, createCommentVNode as P, createTextVNode as c, toDisplayString as i, createVNode as y, unref as B, renderSlot as h } from "vue";
2
+ import { _ as T } from "./Button-DE5lOjx4.js";
3
+ import { _ as S } from "./Icon-B1pHSRJ9.js";
4
+ import { B as V } from "./Tooltip-040OoVcb.js";
5
+ import { faQuestionCircle as g } from "@fortawesome/free-solid-svg-icons";
6
+ import { a as z, w as I } from "./utils-CnOVokX1.js";
7
+ import { c as A } from "./hooks-Mfyp42JB.js";
8
+ const R = { class: "er-popconfirm__main" }, D = { class: "er-popconfirm__action" }, E = /* @__PURE__ */ w({
9
+ name: "BnPopconfirm",
10
+ __name: "Popconfirm",
11
+ props: {
12
+ title: { default: "" },
13
+ confirmButtonText: {},
14
+ cancelButtonText: {},
15
+ confirmButtonType: { default: "primary" },
16
+ cancelButtonType: {},
17
+ icon: {},
18
+ iconColor: { default: "#f90" },
19
+ hideIcon: { type: Boolean },
20
+ hideAfter: { default: 200 },
21
+ width: { default: 150 }
22
+ },
23
+ emits: ["confirm", "cancel"],
24
+ setup(t, { emit: k }) {
25
+ const { t: r } = A(), l = t, a = d(() => l.icon ?? g), f = k, m = x(), v = d(() => ({ width: z(l.width) })), s = () => {
26
+ var e;
27
+ (e = m.value) == null || e.hide();
28
+ }, C = (e) => {
29
+ f("cancel", e), s();
30
+ }, _ = (e) => {
31
+ f("confirm", e), s();
32
+ };
33
+ return (e, L) => (u(), p(V, {
34
+ ref_key: "tooltipRef",
35
+ ref: m,
36
+ trigger: "click",
37
+ "hide-timeout": t.hideAfter
38
+ }, $({
39
+ content: o(() => [
40
+ n("div", {
41
+ class: "er-popconfirm",
42
+ style: N(v.value)
43
+ }, [
44
+ n("div", R, [
45
+ !t.hideIcon && a.value ? (u(), p(S, {
46
+ key: 0,
47
+ icon: a.value,
48
+ color: t.iconColor
49
+ }, null, 8, ["icon", "color"])) : P("", !0),
50
+ c(" " + i(t.title), 1)
51
+ ]),
52
+ n("div", D, [
53
+ y(T, {
54
+ size: "small",
55
+ class: "er-popconfirm__cancel",
56
+ type: t.cancelButtonType,
57
+ onClick: C
58
+ }, {
59
+ default: o(() => [
60
+ c(i(t.cancelButtonText || B(r)("popconfirm.cancelButtonText")), 1)
61
+ ]),
62
+ _: 1
63
+ }, 8, ["type"]),
64
+ y(T, {
65
+ size: "small",
66
+ class: "er-popconfirm__confirm",
67
+ type: t.confirmButtonType,
68
+ onClick: _
69
+ }, {
70
+ default: o(() => [
71
+ c(i(t.confirmButtonText || B(r)("popconfirm.confirmButtonText")), 1)
72
+ ]),
73
+ _: 1
74
+ }, 8, ["type"])
75
+ ])
76
+ ], 4)
77
+ ]),
78
+ _: 2
79
+ }, [
80
+ e.$slots.default ? {
81
+ name: "default",
82
+ fn: o(() => [
83
+ h(e.$slots, "default")
84
+ ]),
85
+ key: "0"
86
+ } : void 0,
87
+ e.$slots.reference ? {
88
+ name: "reference",
89
+ fn: o(() => [
90
+ h(e.$slots, "reference")
91
+ ]),
92
+ key: "1"
93
+ } : void 0
94
+ ]), 1032, ["hide-timeout"]));
95
+ }
96
+ }), H = I(E);
97
+ export {
98
+ H as B
99
+ };