bitboss-ui 0.1.80 → 0.1.82

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 (224) hide show
  1. package/dist/components/BaseButton/BaseButton.vue.d.ts +5 -2
  2. package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +3 -0
  3. package/dist/components/BaseCheckboxGroup/BaseCheckboxGroup.vue.d.ts +10 -2
  4. package/dist/components/BaseDatePicker/BaseDatePicker.vue.d.ts +3 -0
  5. package/dist/components/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +3 -0
  6. package/dist/components/BaseDialog/BaseDialog.vue.d.ts +3 -0
  7. package/dist/components/BaseInputContainer/BaseInputContainer.vue.d.ts +3 -0
  8. package/dist/components/BaseNumberInput/BaseNumberInput.vue.d.ts +4 -1
  9. package/dist/components/BaseRadioGroup/BaseRadioGroup.vue.d.ts +4 -1
  10. package/dist/components/BaseRating/BaseRating.vue.d.ts +4 -1
  11. package/dist/components/BaseSelect/BaseSelect.vue.d.ts +16 -2
  12. package/dist/components/BaseSlider/BaseSlider.vue.d.ts +3 -0
  13. package/dist/components/BaseSwitch/BaseSwitch.vue.d.ts +3 -0
  14. package/dist/components/BaseSwitchGroup/BaseSwitchGroup.vue.d.ts +3 -0
  15. package/dist/components/BaseTag/BaseTag.vue.d.ts +4 -1
  16. package/dist/components/BaseTextInput/BaseTextInput.vue.d.ts +4 -1
  17. package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +2 -2
  18. package/dist/components/BbAccordion/BbAccordion.vue.d.ts +5 -2
  19. package/dist/components/BbAlert/BbAlert.vue.d.ts +3 -0
  20. package/dist/components/BbAvatar/BbAvatar.vue.d.ts +7 -58
  21. package/dist/components/BbBadge/BbBadge.vue.d.ts +4 -1
  22. package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue.d.ts +3 -0
  23. package/dist/components/BbCheckbox/BbCheckbox.vue.d.ts +3 -0
  24. package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +3 -0
  25. package/dist/components/BbChip/BbChip.vue.d.ts +7 -1
  26. package/dist/components/BbCollapsible/BbCollapsible.vue.d.ts +4 -1
  27. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +3 -0
  28. package/dist/components/BbDialog/BbDialog.vue.d.ts +3 -0
  29. package/dist/components/BbDropdown/BbDropdown.vue.d.ts +15 -3
  30. package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +4 -1
  31. package/dist/components/BbDropzone/BbDropzone.vue.d.ts +6 -7
  32. package/dist/components/BbIcon/BbIcon.vue.d.ts +3 -0
  33. package/dist/components/BbIntersection/BbIntersection.vue.d.ts +4 -1
  34. package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +3 -0
  35. package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +3 -0
  36. package/dist/components/BbPagination/BbPagination.vue.d.ts +4 -1
  37. package/dist/components/BbPopover/BbPopover.vue.d.ts +14 -7
  38. package/dist/components/BbProgress/BbProgress.vue.d.ts +3 -0
  39. package/dist/components/BbRadio/BbRadio.vue.d.ts +3 -0
  40. package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +1 -6
  41. package/dist/components/BbRating/BbRating.vue.d.ts +3 -0
  42. package/dist/components/BbRatio/BbRatio.vue.d.ts +4 -1
  43. package/dist/components/BbSelect/BbSelect.vue.d.ts +14 -3
  44. package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +5 -2
  45. package/dist/components/BbSpinner/BbSpinner.vue.d.ts +3 -0
  46. package/dist/components/BbSwitch/BbSwitch.vue.d.ts +3 -0
  47. package/dist/components/BbTab/BbTab.vue.d.ts +4 -1
  48. package/dist/components/BbTable/BbTable.vue.d.ts +258 -295
  49. package/dist/components/BbTable/types.d.ts +214 -0
  50. package/dist/components/BbTag/BbTag.vue.d.ts +3 -0
  51. package/dist/components/BbToast/BbToast.vue.d.ts +3 -0
  52. package/dist/components/BbToast/BbToastMessage.vue.d.ts +3 -0
  53. package/dist/components/BbTooltip/BbTooltip.vue.d.ts +8 -7
  54. package/dist/components/BbTree/BbTree.vue.d.ts +9 -1
  55. package/dist/composables/useItemText.d.ts +6 -1
  56. package/dist/index.d.ts +1 -1
  57. package/dist/index10.js +2 -2
  58. package/dist/index10.js.map +1 -1
  59. package/dist/index100.js +2 -2
  60. package/dist/index102.js +4 -3
  61. package/dist/index102.js.map +1 -1
  62. package/dist/index106.js +1 -1
  63. package/dist/index108.js +85 -57
  64. package/dist/index108.js.map +1 -1
  65. package/dist/index110.js +77 -55
  66. package/dist/index110.js.map +1 -1
  67. package/dist/index112.js +5 -5
  68. package/dist/index112.js.map +1 -1
  69. package/dist/index113.js +1 -1
  70. package/dist/index113.js.map +1 -1
  71. package/dist/index114.js +1 -1
  72. package/dist/index115.js +1 -1
  73. package/dist/index115.js.map +1 -1
  74. package/dist/index116.js +1 -1
  75. package/dist/index118.js +1 -1
  76. package/dist/index12.js +8 -8
  77. package/dist/index120.js +1 -1
  78. package/dist/index121.js +11 -11
  79. package/dist/index121.js.map +1 -1
  80. package/dist/index14.js +9 -9
  81. package/dist/index16.js +3 -3
  82. package/dist/index18.js +2 -2
  83. package/dist/index189.js +2 -2
  84. package/dist/index189.js.map +1 -1
  85. package/dist/index190.js +2 -4
  86. package/dist/index190.js.map +1 -1
  87. package/dist/index191.js +2 -2
  88. package/dist/index191.js.map +1 -1
  89. package/dist/index192.js +3 -2
  90. package/dist/index192.js.map +1 -1
  91. package/dist/index193.js +3 -2
  92. package/dist/index193.js.map +1 -1
  93. package/dist/index194.js +4 -3
  94. package/dist/index194.js.map +1 -1
  95. package/dist/index195.js +3 -35
  96. package/dist/index195.js.map +1 -1
  97. package/dist/index196.js +35 -6
  98. package/dist/index196.js.map +1 -1
  99. package/dist/index197.js +6 -350
  100. package/dist/index197.js.map +1 -1
  101. package/dist/index198.js +5 -134
  102. package/dist/index198.js.map +1 -1
  103. package/dist/index199.js +16 -5
  104. package/dist/index199.js.map +1 -1
  105. package/dist/index20.js +1 -1
  106. package/dist/index20.js.map +1 -1
  107. package/dist/index200.js +15 -18
  108. package/dist/index200.js.map +1 -1
  109. package/dist/index201.js +19 -2
  110. package/dist/index201.js.map +1 -1
  111. package/dist/index202.js +18 -184
  112. package/dist/index202.js.map +1 -1
  113. package/dist/index203.js +29 -23
  114. package/dist/index203.js.map +1 -1
  115. package/dist/index204.js +8 -331
  116. package/dist/index204.js.map +1 -1
  117. package/dist/index205.js +2 -2
  118. package/dist/index205.js.map +1 -1
  119. package/dist/index206.js +351 -2
  120. package/dist/index206.js.map +1 -1
  121. package/dist/index207.js +131 -13
  122. package/dist/index207.js.map +1 -1
  123. package/dist/index208.js +2 -16
  124. package/dist/index208.js.map +1 -1
  125. package/dist/index209.js +184 -18
  126. package/dist/index209.js.map +1 -1
  127. package/dist/index210.js +23 -29
  128. package/dist/index210.js.map +1 -1
  129. package/dist/index211.js +369 -8
  130. package/dist/index211.js.map +1 -1
  131. package/dist/index212.js +2 -3
  132. package/dist/index212.js.map +1 -1
  133. package/dist/index213.js +2 -3
  134. package/dist/index213.js.map +1 -1
  135. package/dist/index216.js +73 -53
  136. package/dist/index216.js.map +1 -1
  137. package/dist/index217.js +3 -3
  138. package/dist/index22.js +2 -2
  139. package/dist/index221.js +223 -10
  140. package/dist/index221.js.map +1 -1
  141. package/dist/index222.js +252 -429
  142. package/dist/index222.js.map +1 -1
  143. package/dist/index223.js +10 -8
  144. package/dist/index223.js.map +1 -1
  145. package/dist/index224.js +428 -82
  146. package/dist/index224.js.map +1 -1
  147. package/dist/index225.js +9 -8
  148. package/dist/index225.js.map +1 -1
  149. package/dist/index226.js +88 -5
  150. package/dist/index226.js.map +1 -1
  151. package/dist/index235.js +2 -69
  152. package/dist/index235.js.map +1 -1
  153. package/dist/index236.js +2 -162
  154. package/dist/index236.js.map +1 -1
  155. package/dist/index237.js +2 -2
  156. package/dist/index238.js +2 -2
  157. package/dist/index238.js.map +1 -1
  158. package/dist/index239.js +9 -2
  159. package/dist/index239.js.map +1 -1
  160. package/dist/index24.js +1 -1
  161. package/dist/index24.js.map +1 -1
  162. package/dist/index240.js +6 -2
  163. package/dist/index240.js.map +1 -1
  164. package/dist/index241.js +162 -2
  165. package/dist/index241.js.map +1 -1
  166. package/dist/index242.js +2 -2
  167. package/dist/index243.js +2 -224
  168. package/dist/index243.js.map +1 -1
  169. package/dist/index244.js +68 -257
  170. package/dist/index244.js.map +1 -1
  171. package/dist/index245.js +2 -38
  172. package/dist/index245.js.map +1 -1
  173. package/dist/index246.js +38 -2
  174. package/dist/index246.js.map +1 -1
  175. package/dist/index247.js +2 -2
  176. package/dist/index247.js.map +1 -1
  177. package/dist/index248.js +2 -2
  178. package/dist/index248.js.map +1 -1
  179. package/dist/index249.js +2 -2
  180. package/dist/index250.js +2 -2
  181. package/dist/index251.js +2 -2
  182. package/dist/index251.js.map +1 -1
  183. package/dist/index252.js +5 -0
  184. package/dist/index252.js.map +1 -0
  185. package/dist/index26.js +3 -3
  186. package/dist/index26.js.map +1 -1
  187. package/dist/index28.js +172 -155
  188. package/dist/index28.js.map +1 -1
  189. package/dist/index30.js +2 -2
  190. package/dist/index32.js +2 -2
  191. package/dist/index34.js +2 -2
  192. package/dist/index34.js.map +1 -1
  193. package/dist/index36.js +21 -19
  194. package/dist/index36.js.map +1 -1
  195. package/dist/index38.js.map +1 -1
  196. package/dist/index44.js +1 -1
  197. package/dist/index44.js.map +1 -1
  198. package/dist/index46.js +1 -1
  199. package/dist/index46.js.map +1 -1
  200. package/dist/index6.js.map +1 -1
  201. package/dist/index62.js +168 -137
  202. package/dist/index62.js.map +1 -1
  203. package/dist/index64.js +38 -30
  204. package/dist/index64.js.map +1 -1
  205. package/dist/index66.js.map +1 -1
  206. package/dist/index69.js +1 -1
  207. package/dist/index72.js +1 -1
  208. package/dist/index74.js.map +1 -1
  209. package/dist/index76.js +96 -66
  210. package/dist/index76.js.map +1 -1
  211. package/dist/index78.js +1 -1
  212. package/dist/index8.js +2 -2
  213. package/dist/index82.js +2 -2
  214. package/dist/index82.js.map +1 -1
  215. package/dist/index84.js.map +1 -1
  216. package/dist/index88.js +7 -4
  217. package/dist/index88.js.map +1 -1
  218. package/dist/index96.js +2 -2
  219. package/dist/index96.js.map +1 -1
  220. package/dist/index98.js +35 -30
  221. package/dist/index98.js.map +1 -1
  222. package/dist/style.css +1 -1
  223. package/dist/types/CommonProps.d.ts +15 -8
  224. package/package.json +1 -1
package/dist/index108.js CHANGED
@@ -1,123 +1,151 @@
1
- import { defineComponent as D, ref as o, computed as z, openBlock as f, createElementBlock as F, mergeProps as O, createElementVNode as l, renderSlot as k, normalizeProps as P, guardReactiveProps as S, unref as b, createBlock as y, Teleport as N, normalizeClass as V, normalizeStyle as H, withCtx as I, createCommentVNode as R } from "vue";
2
- import { useFloating as U } from "./index216.js";
3
- import { useId as j } from "./index120.js";
4
- import { wait as C } from "./index119.js";
5
- import q from "./index6.js";
1
+ import { defineComponent as x, ref as o, computed as C, openBlock as d, createElementBlock as E, mergeProps as $, createElementVNode as r, renderSlot as L, normalizeProps as A, guardReactiveProps as H, unref as b, createBlock as M, Teleport as I, normalizeClass as R, normalizeStyle as U, withCtx as j, createCommentVNode as D } from "vue";
2
+ import { useFloating as q, arrow as G } from "./index216.js";
3
+ import { useId as J } from "./index120.js";
4
+ import { wait as O } from "./index119.js";
5
+ import K from "./index6.js";
6
6
  import "./index7.js";
7
- import { autoUpdate as A } from "./index197.js";
8
- import { flip as G, shift as J } from "./index204.js";
9
- const K = /* @__PURE__ */ l("span", { class: "bb-tooltip__arrow" }, null, -1), Q = { class: "bb-tooltip__bubble" }, W = /* @__PURE__ */ l("svg", {
7
+ import { autoUpdate as Q } from "./index206.js";
8
+ import { flip as W, shift as X } from "./index211.js";
9
+ const Y = { class: "bb-tooltip__bubble" }, Z = /* @__PURE__ */ r("svg", {
10
10
  viewBox: "0 0 24 24",
11
11
  fill: "none",
12
12
  xmlns: "http://www.w3.org/2000/svg"
13
13
  }, [
14
- /* @__PURE__ */ l("path", {
14
+ /* @__PURE__ */ r("path", {
15
15
  d: "M23 23L1 1M23 1L1 23",
16
16
  stroke: "currentColor",
17
17
  "stroke-width": "2",
18
18
  "stroke-linecap": "round"
19
19
  })
20
- ], -1), ae = /* @__PURE__ */ D({
20
+ ], -1), ie = /* @__PURE__ */ x({
21
21
  __name: "BbTooltip",
22
22
  props: {
23
+ arrowPadding: { default: 10 },
23
24
  block: { type: Boolean },
24
25
  disabled: { type: Boolean },
26
+ eager: { type: Boolean },
25
27
  id: {},
28
+ padding: { default: 10 },
26
29
  placement: { default: "top" },
27
30
  showClose: { type: Boolean, default: !0 },
28
31
  theme: { default: "default" },
29
- transitionDuration: { default: 150 },
30
- padding: { default: 10 }
32
+ transitionDuration: { default: 150 }
31
33
  },
32
- setup(E) {
33
- const t = E, m = `bb_${t.id ?? j().id.value}`, r = o(), u = o(), { floatingStyles: B, placement: v } = U(r, u, {
34
- placement: t.placement,
35
- whileElementsMounted: A,
36
- middleware: [G(), J({ padding: t.padding })]
37
- }), _ = o(!0), n = o(!1), a = o(!1), s = o(!1), c = o(!0), h = () => {
38
- a.value || n.value || t.disabled || (M(), document.addEventListener("mouseover", w, { passive: !0 }), document.addEventListener("keydown", g, { passive: !0 }));
39
- }, $ = h, w = (e) => {
40
- const i = e.target;
41
- if (i && i instanceof HTMLElement) {
42
- let d = !0;
43
- r.value && r.value.contains(i) && (d = !1), u.value && u.value.contains(i) && (d = !1), d && p();
34
+ setup(P) {
35
+ const t = P, m = `bb_${t.id ?? J().id.value}`, i = o(), u = o(), v = o(), { floatingStyles: T, placement: _, middlewareData: w } = q(
36
+ i,
37
+ u,
38
+ {
39
+ placement: t.placement,
40
+ whileElementsMounted: Q,
41
+ middleware: [
42
+ W(),
43
+ X({ padding: t.padding }),
44
+ G({
45
+ element: v,
46
+ padding: t.arrowPadding
47
+ })
48
+ ]
44
49
  }
45
- }, g = (e) => {
46
- a.value && e.key === "Escape" && p();
47
- }, L = () => {
48
- _.value = !1, p();
49
- }, M = async () => {
50
- _.value && (c.value = !1, s.value = !1, n.value = !0, await C(50), a.value = !0, n.value = !1);
50
+ ), g = o(!0), n = o(!1), l = o(!1), s = o(!1), c = o(!0), z = C(() => {
51
+ if (w.value.arrow) {
52
+ const { x: e, y: a } = w.value.arrow;
53
+ return {
54
+ style: {
55
+ left: `${e}px`,
56
+ top: `${a}px`
57
+ }
58
+ };
59
+ }
60
+ }), y = () => {
61
+ l.value || n.value || t.disabled || (N(), document.addEventListener("mouseover", h, { passive: !0 }), document.addEventListener("keydown", k, { passive: !0 }));
62
+ }, F = y, h = (e) => {
63
+ const a = e.target;
64
+ if (a && a instanceof HTMLElement) {
65
+ let f = !0;
66
+ i.value && i.value.contains(a) && (f = !1), u.value && u.value.contains(a) && (f = !1), f && p();
67
+ }
68
+ }, k = (e) => {
69
+ l.value && e.key === "Escape" && p();
70
+ }, S = () => {
71
+ g.value = !1, p();
72
+ }, B = o(!1), N = async () => {
73
+ g.value && (B.value = !0, c.value = !1, s.value = !1, n.value = !0, await O(50), l.value = !0, n.value = !1);
51
74
  }, p = async () => {
52
- a.value = !1, n.value = !1, s.value = !0, await C(t.transitionDuration), s.value = !1, c.value = !0, document.removeEventListener("mouseover", w), document.removeEventListener("keydown", g);
53
- }, T = z(() => ({
75
+ l.value = !1, n.value = !1, s.value = !0, await O(t.transitionDuration), s.value = !1, c.value = !0, document.removeEventListener("mouseover", h), document.removeEventListener("keydown", k);
76
+ }, V = C(() => ({
54
77
  class: {
55
78
  "bb-tooltip--block": t.block,
56
79
  [`bb-tooltip--theme-${t.theme}`]: t.theme
57
80
  }
58
81
  }));
59
- return (e, i) => (f(), F("span", O({ class: "bb-tooltip" }, T.value), [
60
- l("span", {
82
+ return (e, a) => (d(), E("span", $({ class: "bb-tooltip" }, V.value), [
83
+ r("span", {
61
84
  class: "bb-tooltip__wrapper",
62
85
  ref_key: "wrapper",
63
- ref: r
86
+ ref: i
64
87
  }, [
65
- k(e.$slots, "activator", P(S({
88
+ L(e.$slots, "activator", A(H({
66
89
  props: {
67
90
  "aria-describedby": m,
68
- onMouseenter: h,
69
- onFocus: b($),
91
+ onMouseenter: y,
92
+ onFocus: b(F),
70
93
  onBlur: p,
71
94
  disabled: e.disabled
72
95
  },
73
96
  closed: c.value,
74
97
  closing: s.value,
75
98
  disabled: e.disabled,
76
- open: a.value,
99
+ open: l.value,
77
100
  opening: n.value,
78
- placement: b(v)
101
+ placement: b(_)
79
102
  })))
80
103
  ], 512),
81
- (f(), y(N, { to: "body" }, [
82
- l("span", {
83
- class: V(["bb-tooltip__bubble-container", {
84
- [`bb-tooltip__bubble-container--${b(v)}`]: !0,
104
+ (d(), M(I, { to: "body" }, [
105
+ B.value || e.eager ? (d(), E("span", {
106
+ key: 0,
107
+ class: R(["bb-tooltip__bubble-container", {
108
+ [`bb-tooltip__bubble-container--${b(_)}`]: !0,
85
109
  [`bb-tooltip__bubble-container--${e.theme}`]: e.theme,
86
110
  "bb-tooltip__bubble-container--hidden": c.value,
87
111
  "bb-tooltip__bubble-container--closing": s.value,
88
112
  "bb-tooltip__bubble-container--opening": n.value,
89
- "bb-tooltip__bubble-container--open": a.value
113
+ "bb-tooltip__bubble-container--open": l.value
90
114
  }]),
91
115
  ref_key: "content",
92
116
  ref: u,
93
- style: H({
94
- ...b(B),
117
+ style: U({
118
+ ...b(T),
95
119
  transitionDuration: `${t.transitionDuration}ms`
96
120
  }),
97
121
  id: m
98
122
  }, [
99
- K,
100
- l("span", Q, [
101
- e.showClose ? (f(), y(q, {
123
+ r("span", $({
124
+ class: "bb-tooltip__arrow",
125
+ ref_key: "bubblearrow",
126
+ ref: v
127
+ }, z.value), null, 16),
128
+ r("span", Y, [
129
+ e.showClose ? (d(), M(K, {
102
130
  key: 0,
103
131
  tabindex: "-1",
104
132
  "aria-hidden": "true",
105
133
  class: "bb-tooltip__close",
106
- onClick: L
134
+ onClick: S
107
135
  }, {
108
- default: I(() => [
109
- W
136
+ default: j(() => [
137
+ Z
110
138
  ]),
111
139
  _: 1
112
- })) : R("", !0),
113
- k(e.$slots, "default")
140
+ })) : D("", !0),
141
+ L(e.$slots, "default")
114
142
  ])
115
- ], 6)
143
+ ], 6)) : D("", !0)
116
144
  ]))
117
145
  ], 16));
118
146
  }
119
147
  });
120
148
  export {
121
- ae as default
149
+ ie as default
122
150
  };
123
151
  //# sourceMappingURL=index108.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index108.js","sources":["../src/components/BbTooltip/BbTooltip.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, createElementVNode as _createElementVNode, openBlock as _openBlock, withCtx as _withCtx, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, Teleport as _Teleport, mergeProps as _mergeProps, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = /*#__PURE__*/_createElementVNode(\"span\", { class: \"bb-tooltip__arrow\" }, null, -1)\nconst _hoisted_2 = { class: \"bb-tooltip__bubble\" }\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"svg\", {\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M23 23L1 1M23 1L1 23\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\"\n })\n], -1)\n\nimport { computed, ref } from \"vue\";\nimport {\n useFloating,\n autoUpdate,\n flip,\n shift,\n Placement,\n} from \"@floating-ui/vue\";\nimport { useId } from \"@/composables/useId\";\nimport { wait } from \"@/utilities/functions/wait\";\nimport BaseButton from \"../BaseButton/BaseButton.vue\";\nimport type { CommonProps } from \"@/types/CommonProps\";\n\nexport type BbTooltipProps = Pick<\n CommonProps,\n | \"block\"\n | \"disabled\"\n | \"id\"\n | \"placement\"\n | \"showClose\"\n | \"theme\"\n | \"transitionDuration\"\n> & {\n /**\n * Minimum empty space to keep from the edge of the page\n */\n padding?: number;\n};\n\ntype BbTooltipSlots = {\n activator?: (props: {\n props: {\n \"aria-describedby\": string;\n onMouseenter: typeof onMouseenter;\n onFocus: typeof onFocus;\n onBlur: typeof closeTooltip;\n };\n closed: boolean;\n closing: boolean;\n disabled?: boolean;\n open: boolean;\n opening: boolean;\n placement: Placement;\n }) => any;\n default?: (props: {}) => any;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbTooltip',\n props: {\n block: { type: Boolean },\n disabled: { type: Boolean },\n id: {},\n placement: { default: \"top\" },\n showClose: { type: Boolean, default: true },\n theme: { default: \"default\" },\n transitionDuration: { default: 150 },\n padding: { default: 10 }\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\n\nconst id = `bb_${props.id ?? useId().id.value}`;\n\nconst wrapper = ref<HTMLElement>();\nconst content = ref<HTMLElement>();\n\nconst { floatingStyles, placement } = useFloating(wrapper, content, {\n placement: props.placement,\n whileElementsMounted: autoUpdate,\n middleware: [flip(), shift({ padding: props.padding })],\n});\n\nconst canOpen = ref(true);\n\nconst opening = ref(false);\nconst open = ref(false);\nconst closing = ref(false);\nconst closed = ref(true);\n\nconst onMouseenter = () => {\n if (open.value || opening.value || props.disabled) return;\n openTooltip();\n document.addEventListener(\"mouseover\", onMouseOver, { passive: true });\n document.addEventListener(\"keydown\", onEsc, { passive: true });\n};\n\nconst onFocus = onMouseenter;\n\nconst onMouseOver = (event: Event) => {\n const target = event.target;\n if (!target) return;\n if (target instanceof HTMLElement) {\n let isOutside = true;\n\n if (wrapper.value) {\n if (wrapper.value.contains(target)) {\n isOutside = false;\n }\n }\n if (content.value) {\n if (content.value.contains(target)) {\n isOutside = false;\n }\n }\n\n if (isOutside) {\n closeTooltip();\n }\n }\n};\n\nconst onEsc = (event: KeyboardEvent) => {\n if (open.value) {\n if (event.key === \"Escape\") {\n closeTooltip();\n }\n }\n};\n\n/* On click of close button tooltip is disallowed from reappearing */\nconst onClickClose = () => {\n canOpen.value = false;\n closeTooltip();\n};\n\nconst openTooltip = async () => {\n if (!canOpen.value) return;\n closed.value = false;\n closing.value = false;\n opening.value = true;\n await wait(50);\n open.value = true;\n opening.value = false;\n};\n\nconst closeTooltip = async () => {\n open.value = false;\n opening.value = false;\n closing.value = true;\n await wait(props.transitionDuration);\n closing.value = false;\n closed.value = true;\n document.removeEventListener(\"mouseover\", onMouseOver);\n document.removeEventListener(\"keydown\", onEsc);\n};\n\nconst attributes = computed(() => {\n const classes = {\n \"bb-tooltip--block\": props.block,\n [`bb-tooltip--theme-${props.theme}`]: props.theme,\n };\n return {\n class: classes,\n };\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", _mergeProps({ class: \"bb-tooltip\" }, attributes.value), [\n _createElementVNode(\"span\", {\n class: \"bb-tooltip__wrapper\",\n ref_key: \"wrapper\",\n ref: wrapper\n }, [\n _renderSlot(_ctx.$slots, \"activator\", _normalizeProps(_guardReactiveProps({\n props: {\n 'aria-describedby': id,\n onMouseenter: onMouseenter,\n onFocus: _unref(onFocus),\n onBlur: closeTooltip,\n disabled: _ctx.disabled,\n },\n closed: closed.value,\n closing: closing.value,\n disabled: _ctx.disabled,\n open: open.value,\n opening: opening.value,\n placement: _unref(placement),\n })))\n ], 512),\n (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n _createElementVNode(\"span\", {\n class: _normalizeClass([\"bb-tooltip__bubble-container\", {\n [`bb-tooltip__bubble-container--${_unref(placement)}`]: true,\n [`bb-tooltip__bubble-container--${_ctx.theme}`]: _ctx.theme,\n 'bb-tooltip__bubble-container--hidden': closed.value,\n 'bb-tooltip__bubble-container--closing': closing.value,\n 'bb-tooltip__bubble-container--opening': opening.value,\n 'bb-tooltip__bubble-container--open': open.value,\n }]),\n ref_key: \"content\",\n ref: content,\n style: _normalizeStyle({\n ..._unref(floatingStyles),\n transitionDuration: `${props.transitionDuration}ms`,\n }),\n id: id\n }, [\n _hoisted_1,\n _createElementVNode(\"span\", _hoisted_2, [\n (_ctx.showClose)\n ? (_openBlock(), _createBlock(BaseButton, {\n key: 0,\n tabindex: \"-1\",\n \"aria-hidden\": \"true\",\n class: \"bb-tooltip__close\",\n onClick: onClickClose\n }, {\n default: _withCtx(() => [\n _hoisted_3\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n _renderSlot(_ctx.$slots, \"default\")\n ])\n ], 6)\n ]))\n ], 16))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_sfc_main","_defineComponent","__props","props","id","useId","wrapper","ref","content","floatingStyles","placement","useFloating","autoUpdate","flip","shift","canOpen","opening","open","closing","closed","onMouseenter","openTooltip","onMouseOver","onEsc","onFocus","event","target","isOutside","closeTooltip","onClickClose","wait","attributes","computed","_ctx","_cache","_openBlock","_createElementBlock","_mergeProps","_createElementVNode","_renderSlot","_normalizeProps","_guardReactiveProps","_unref","_createBlock","_Teleport","_normalizeClass","_normalizeStyle","BaseButton","_withCtx","_createCommentVNode"],"mappings":";;;;;;;;AAGA,MAAMA,sBAA8C,QAAQ,EAAE,OAAO,uBAAuB,MAAM,EAAE,GAC9FC,IAAa,EAAE,OAAO,wBACtBC,sBAA8C,OAAO;AAAA,EACzD,SAAS;AAAA,EACT,MAAM;AAAA,EACN,OAAO;AACT,GAAG;AAAA,oBACgC,QAAQ;AAAA,IACvC,GAAG;AAAA,IACH,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,EAAA,CACnB;AACH,GAAG,EAAE,GAkDuBC,KAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,IAAI,CAAC;AAAA,IACL,WAAW,EAAE,SAAS,MAAM;AA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AAG;AAAA,OACLyB,KAAcQ,EAAaC,GAAW,EAAE,IAAI,UAAU;AAAA,QACrDN,EAAoB,QAAQ;AAAA,UAC1B,OAAOO,EAAgB,CAAC,gCAAgC;AAAA,YACtD,CAAC,iCAAiCH,EAAOhC,CAAS,CAAC,EAAE,GAAG;AAAA,YACxD,CAAC,iCAAiCuB,EAAK,KAAK,EAAE,GAAGA,EAAK;AAAA,YACtD,wCAAwCd,EAAO;AAAA,YAC/C,yCAAyCD,EAAQ;AAAA,YACjD,yCAAyCF,EAAQ;AAAA,YACjD,sCAAsCC,EAAK;AAAA,UAAA,CAC5C,CAAC;AAAA,UACF,SAAS;AAAA,UACT,KAAKT;AAAA,UACL,OAAOsC,EAAgB;AAAA,YACrB,GAAGJ,EAAOjC,CAAc;AAAA,YACxB,oBAAoB,GAAGN,EAAM,kBAAkB;AAAA,UAAA,CAChD;AAAA,UACD,IAAAC;AAAA,QAAA,GACC;AAAA,UACDP;AAAA,UACAyC,EAAoB,QAAQxC,GAAY;AAAA,YACrCmC,EAAK,aACDE,KAAcQ,EAAaI,GAAY;AAAA,cACtC,KAAK;AAAA,cACL,UAAU;AAAA,cACV,eAAe;AAAA,cACf,OAAO;AAAA,cACP,SAASlB;AAAA,YAAA,GACR;AAAA,cACD,SAASmB,EAAS,MAAM;AAAA,gBACtBjD;AAAA,cAAA,CACD;AAAA,cACD,GAAG;AAAA,YAAA,CACJ,KACDkD,EAAoB,IAAI,EAAI;AAAA,YAChCV,EAAYN,EAAK,QAAQ,SAAS;AAAA,UAAA,CACnC;AAAA,WACA,CAAC;AAAA,MAAA,CACL;AAAA,OACA,EAAE;AAAA,EAEP;AAEA,CAAC;"}
1
+ {"version":3,"file":"index108.js","sources":["../src/components/BbTooltip/BbTooltip.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, createElementVNode as _createElementVNode, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock, withCtx as _withCtx, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, Teleport as _Teleport } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-tooltip__bubble\" }\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"svg\", {\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M23 23L1 1M23 1L1 23\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\"\n })\n], -1)\n\nimport { computed, ref } from \"vue\";\nimport {\n useFloating,\n autoUpdate,\n flip,\n shift,\n Placement,\n arrow,\n} from \"@floating-ui/vue\";\nimport { useId } from \"@/composables/useId\";\nimport { wait } from \"@/utilities/functions/wait\";\nimport BaseButton from \"../BaseButton/BaseButton.vue\";\nimport type { CommonProps } from \"@/types/CommonProps\";\n\nexport type BbTooltipProps = Pick<\n CommonProps,\n | \"arrowPadding\"\n | \"block\"\n | \"disabled\"\n | \"eager\"\n | \"id\"\n | \"padding\"\n | \"placement\"\n | \"showClose\"\n | \"theme\"\n | \"transitionDuration\"\n>\n\ntype BbTooltipSlots = {\n activator?: (props: {\n props: {\n \"aria-describedby\": string;\n onMouseenter: typeof onMouseenter;\n onFocus: typeof onFocus;\n onBlur: typeof closeTooltip;\n };\n closed: boolean;\n closing: boolean;\n disabled?: boolean;\n open: boolean;\n opening: boolean;\n placement: Placement;\n }) => any;\n default?: (props: {}) => any;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbTooltip',\n props: {\n arrowPadding: { default: 10 },\n block: { type: Boolean },\n disabled: { type: Boolean },\n eager: { type: Boolean },\n id: {},\n padding: { default: 10 },\n placement: { default: \"top\" },\n showClose: { type: Boolean, default: true },\n theme: { default: \"default\" },\n transitionDuration: { default: 150 }\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\n\nconst id = `bb_${props.id ?? useId().id.value}`;\n\nconst wrapper = ref<HTMLElement>();\nconst content = ref<HTMLElement>();\nconst bubblearrow = ref<HTMLElement>();\n\nconst { floatingStyles, placement, middlewareData } = useFloating(\n wrapper,\n content,\n {\n placement: props.placement,\n whileElementsMounted: autoUpdate,\n middleware: [\n flip(),\n shift({ padding: props.padding }),\n arrow({\n element: bubblearrow,\n padding: props.arrowPadding,\n }),\n ],\n }\n);\n\nconst canOpen = ref(true);\n\nconst opening = ref(false);\nconst open = ref(false);\nconst closing = ref(false);\nconst closed = ref(true);\n\nconst arrowAttributes = computed(() => {\n if (middlewareData.value.arrow) {\n const { x, y } = middlewareData.value.arrow;\n return {\n style: {\n left: `${x}px`,\n top: `${y}px`,\n },\n };\n }\n});\n\nconst onMouseenter = () => {\n if (open.value || opening.value || props.disabled) return;\n openTooltip();\n document.addEventListener(\"mouseover\", onMouseOver, { passive: true });\n document.addEventListener(\"keydown\", onEsc, { passive: true });\n};\n\nconst onFocus = onMouseenter;\n\nconst onMouseOver = (event: Event) => {\n const target = event.target;\n if (!target) return;\n if (target instanceof HTMLElement) {\n let isOutside = true;\n\n if (wrapper.value) {\n if (wrapper.value.contains(target)) {\n isOutside = false;\n }\n }\n if (content.value) {\n if (content.value.contains(target)) {\n isOutside = false;\n }\n }\n\n if (isOutside) {\n closeTooltip();\n }\n }\n};\n\nconst onEsc = (event: KeyboardEvent) => {\n if (open.value) {\n if (event.key === \"Escape\") {\n closeTooltip();\n }\n }\n};\n\n/* On click of close button tooltip is disallowed from reappearing */\nconst onClickClose = () => {\n canOpen.value = false;\n closeTooltip();\n};\n\nconst hasOpenedOnce = ref(false);\nconst openTooltip = async () => {\n if (!canOpen.value) return;\n hasOpenedOnce.value = true;\n closed.value = false;\n closing.value = false;\n opening.value = true;\n await wait(50);\n open.value = true;\n opening.value = false;\n};\n\nconst closeTooltip = async () => {\n open.value = false;\n opening.value = false;\n closing.value = true;\n await wait(props.transitionDuration);\n closing.value = false;\n closed.value = true;\n document.removeEventListener(\"mouseover\", onMouseOver);\n document.removeEventListener(\"keydown\", onEsc);\n};\n\nconst attributes = computed(() => {\n const classes = {\n \"bb-tooltip--block\": props.block,\n [`bb-tooltip--theme-${props.theme}`]: props.theme,\n };\n return {\n class: classes,\n };\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", _mergeProps({ class: \"bb-tooltip\" }, attributes.value), [\n _createElementVNode(\"span\", {\n class: \"bb-tooltip__wrapper\",\n ref_key: \"wrapper\",\n ref: wrapper\n }, [\n _renderSlot(_ctx.$slots, \"activator\", _normalizeProps(_guardReactiveProps({\n props: {\n 'aria-describedby': id,\n onMouseenter: onMouseenter,\n onFocus: _unref(onFocus),\n onBlur: closeTooltip,\n disabled: _ctx.disabled,\n },\n closed: closed.value,\n closing: closing.value,\n disabled: _ctx.disabled,\n open: open.value,\n opening: opening.value,\n placement: _unref(placement),\n })))\n ], 512),\n (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n (hasOpenedOnce.value || _ctx.eager)\n ? (_openBlock(), _createElementBlock(\"span\", {\n key: 0,\n class: _normalizeClass([\"bb-tooltip__bubble-container\", {\n [`bb-tooltip__bubble-container--${_unref(placement)}`]: true,\n [`bb-tooltip__bubble-container--${_ctx.theme}`]: _ctx.theme,\n 'bb-tooltip__bubble-container--hidden': closed.value,\n 'bb-tooltip__bubble-container--closing': closing.value,\n 'bb-tooltip__bubble-container--opening': opening.value,\n 'bb-tooltip__bubble-container--open': open.value,\n }]),\n ref_key: \"content\",\n ref: content,\n style: _normalizeStyle({\n ..._unref(floatingStyles),\n transitionDuration: `${props.transitionDuration}ms`,\n }),\n id: id\n }, [\n _createElementVNode(\"span\", _mergeProps({\n class: \"bb-tooltip__arrow\",\n ref_key: \"bubblearrow\",\n ref: bubblearrow\n }, arrowAttributes.value), null, 16),\n _createElementVNode(\"span\", _hoisted_1, [\n (_ctx.showClose)\n ? (_openBlock(), _createBlock(BaseButton, {\n key: 0,\n tabindex: \"-1\",\n \"aria-hidden\": \"true\",\n class: \"bb-tooltip__close\",\n onClick: onClickClose\n }, {\n default: _withCtx(() => [\n _hoisted_2\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n _renderSlot(_ctx.$slots, \"default\")\n ])\n ], 6))\n : _createCommentVNode(\"\", true)\n ]))\n ], 16))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_sfc_main","_defineComponent","__props","props","id","useId","wrapper","ref","content","bubblearrow","floatingStyles","placement","middlewareData","useFloating","autoUpdate","flip","shift","arrow","canOpen","opening","open","closing","closed","arrowAttributes","computed","x","y","onMouseenter","openTooltip","onMouseOver","onEsc","onFocus","event","target","isOutside","closeTooltip","onClickClose","hasOpenedOnce","wait","attributes","_ctx","_cache","_openBlock","_createElementBlock","_mergeProps","_createElementVNode","_renderSlot","_normalizeProps","_guardReactiveProps","_unref","_createBlock","_Teleport","_normalizeClass","_normalizeStyle","BaseButton","_withCtx","_createCommentVNode"],"mappings":";;;;;;;;AAGA,MAAMA,IAAa,EAAE,OAAO,wBACtBC,sBAA8C,OAAO;AAAA,EACzD,SAAS;AAAA,EACT,MAAM;AAAA,EACN,OAAO;AACT,GAAG;AAAA,oBACgC,QAAQ;AAAA,IACvC,GAAG;AAAA,IACH,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,EAAA,CACnB;AACH,GAAG,EAAE,GAiDuBC,KAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,cAAc,EAAE,SAAS,GAAG;AAAA,IAC5B,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,IAAI,CAAC;AAAA,IACL,SAAS,EAAE,SAAS,GAAG;AAAA,IACvB,WA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A,UACnCsB,EAAoB,QAAQ/C,GAAY;AAAA,YACrC0C,EAAK,aACDE,KAAcQ,EAAaI,GAAY;AAAA,cACtC,KAAK;AAAA,cACL,UAAU;AAAA,cACV,eAAe;AAAA,cACf,OAAO;AAAA,cACP,SAASlB;AAAA,YAAA,GACR;AAAA,cACD,SAASmB,EAAS,MAAM;AAAA,gBACtBxD;AAAA,cAAA,CACD;AAAA,cACD,GAAG;AAAA,YAAA,CACJ,KACDyD,EAAoB,IAAI,EAAI;AAAA,YAChCV,EAAYN,EAAK,QAAQ,SAAS;AAAA,UAAA,CACnC;AAAA,QACA,GAAA,CAAC,KACJgB,EAAoB,IAAI,EAAI;AAAA,MAAA,CACjC;AAAA,OACA,EAAE;AAAA,EAEP;AAEA,CAAC;"}
package/dist/index110.js CHANGED
@@ -1,5 +1,6 @@
1
- import { defineComponent as $, computed as x, resolveComponent as g, openBlock as l, createElementBlock as o, Fragment as y, renderList as s, normalizeClass as f, createElementVNode as a, renderSlot as d, createVNode as v, createSlots as k, withCtx as B, normalizeProps as C, guardReactiveProps as _ } from "vue";
2
- const P = { class: "bb-tree-row" }, T = { class: "bb-tree-main-content" }, E = /* @__PURE__ */ $({
1
+ import { defineComponent as $, computed as g, resolveComponent as y, openBlock as f, createElementBlock as i, Fragment as v, renderList as h, normalizeClass as b, createElementVNode as s, renderSlot as p, createVNode as k, createSlots as B, withCtx as C, normalizeProps as T, guardReactiveProps as _ } from "vue";
2
+ import { flattenTree as P } from "./index245.js";
3
+ const w = { class: "bb-tree-row" }, z = { class: "bb-tree-main-content" }, I = /* @__PURE__ */ $({
3
4
  __name: "BbTree",
4
5
  props: {
5
6
  items: { default: () => [] },
@@ -8,86 +9,107 @@ const P = { class: "bb-tree-row" }, T = { class: "bb-tree-main-content" }, E = /
8
9
  depth: { default: 0 },
9
10
  expandable: { type: [Boolean, Function] }
10
11
  },
11
- setup(h) {
12
- const r = h, b = (n) => typeof n.open > "u" ? !0 : n.open, u = x(() => r.items.map((n) => {
13
- const p = b(n), t = n.expandable ?? r.expandable;
14
- let e = !1;
15
- return typeof t < "u" && (typeof t == "function" ? e = t(n, r.depth, r.parent) : e = t), {
16
- children: n.children,
17
- depth: r.depth,
18
- expandable: e,
19
- identifier: n[r.identifier],
20
- open: p,
21
- original: n,
22
- parent: r.parent
23
- };
24
- }));
25
- return (n, p) => {
26
- const t = g("BbTree", !0);
27
- return l(!0), o(y, null, s(u.value, (e) => (l(), o("div", {
28
- class: f(["bb-tree", {
12
+ setup(c) {
13
+ const r = c, u = (n) => typeof n.open > "u" ? !0 : n.open, x = g(() => {
14
+ let n = 0;
15
+ return r.items.map((d, l) => {
16
+ const e = u(d), t = d.expandable ?? r.expandable, a = n + 1;
17
+ n = n + P([d], "children").length;
18
+ let o = !1;
19
+ return typeof t < "u" && (typeof t == "function" ? o = t(d, r.depth, r.parent) : o = t), {
20
+ children: d.children,
21
+ depth: r.depth,
22
+ expandable: o,
23
+ identifier: d[r.identifier],
24
+ offset: a,
25
+ index: l,
26
+ open: e,
27
+ original: d,
28
+ parent: r.parent
29
+ };
30
+ });
31
+ });
32
+ return (n, d) => {
33
+ const l = y("BbTree", !0);
34
+ return f(!0), i(v, null, h(x.value, (e) => (f(), i("div", {
35
+ class: b(["bb-tree", {
29
36
  [`bb-tree--depth-${e.depth}`]: !0,
30
37
  "bb-tree--open": e.open
31
38
  }]),
32
39
  key: e.identifier
33
40
  }, [
34
- a("div", P, [
35
- a("div", T, [
36
- n.$slots[e.identifier] ? d(n.$slots, e.identifier, {
41
+ s("div", w, [
42
+ s("div", z, [
43
+ n.$slots[e.identifier] ? p(n.$slots, e.identifier, {
37
44
  key: 0,
38
- item: e.original,
39
- parent: e.parent,
40
45
  depth: e.depth,
46
+ expandable: e.expandable,
41
47
  identifier: e.identifier,
42
- expandable: e.expandable
43
- }) : n.$slots[e.depth] ? d(n.$slots, e.depth, {
44
- key: 1,
48
+ index: e.index,
45
49
  item: e.original,
46
- parent: e.parent,
50
+ offset: e.offset,
51
+ open: e.open,
52
+ parent: e.parent
53
+ }) : n.$slots[e.depth] ? p(n.$slots, e.depth, {
54
+ key: 1,
47
55
  depth: e.depth,
56
+ expandable: e.expandable,
48
57
  identifier: e.identifier,
49
- expandable: e.expandable
50
- }) : d(n.$slots, "default", {
51
- key: 2,
58
+ index: e.index,
52
59
  item: e.original,
53
- parent: e.parent,
60
+ offset: e.offset,
61
+ open: e.open,
62
+ parent: e.parent
63
+ }) : p(n.$slots, "default", {
64
+ key: 2,
54
65
  depth: e.depth,
66
+ expandable: e.expandable,
55
67
  identifier: e.identifier,
56
- expandable: e.expandable
68
+ index: e.index,
69
+ item: e.original,
70
+ offset: e.offset,
71
+ open: e.open,
72
+ parent: e.parent
57
73
  })
58
74
  ])
59
75
  ]),
60
- a("div", {
61
- class: f(`bb-tree--depth-${e.depth}-children`)
76
+ s("div", {
77
+ class: b(`bb-tree--depth-${e.depth}-children`)
62
78
  }, [
63
- d(n.$slots, `${e.depth}-children`, {
64
- item: e.original,
65
- parent: e.parent,
79
+ p(n.$slots, `${e.depth}-children`, {
66
80
  depth: e.depth,
81
+ expandable: e.expandable,
67
82
  identifier: e.identifier,
68
- expandable: e.expandable
83
+ index: e.index,
84
+ item: e.original,
85
+ offset: e.offset,
86
+ open: e.open,
87
+ parent: e.parent
69
88
  }, () => [
70
- d(n.$slots, `${e.identifier}-children`, {
71
- item: e.original,
72
- parent: e.parent,
89
+ p(n.$slots, `${e.identifier}-children`, {
73
90
  depth: e.depth,
91
+ expandable: e.expandable,
74
92
  identifier: e.identifier,
75
- expandable: e.expandable
93
+ index: e.index,
94
+ item: e.original,
95
+ offset: e.offset,
96
+ open: e.open,
97
+ parent: e.parent
76
98
  }, () => [
77
- v(t, {
99
+ k(l, {
78
100
  depth: e.depth + 1,
79
- items: e.children,
80
- parent: e,
101
+ expandable: n.expandable,
81
102
  identifier: r.identifier,
82
- expandable: n.expandable
83
- }, k({ _: 2 }, [
84
- s(n.$slots, (w, i) => ({
85
- name: i,
86
- fn: B((c) => [
87
- d(n.$slots, i, C(_(c)))
103
+ items: e.children,
104
+ parent: e
105
+ }, B({ _: 2 }, [
106
+ h(n.$slots, (t, a) => ({
107
+ name: a,
108
+ fn: C((o) => [
109
+ p(n.$slots, a, T(_(o)))
88
110
  ])
89
111
  }))
90
- ]), 1032, ["depth", "items", "parent", "identifier", "expandable"])
112
+ ]), 1032, ["depth", "expandable", "identifier", "items", "parent"])
91
113
  ])
92
114
  ])
93
115
  ], 2)
@@ -96,6 +118,6 @@ const P = { class: "bb-tree-row" }, T = { class: "bb-tree-main-content" }, E = /
96
118
  }
97
119
  });
98
120
  export {
99
- E as default
121
+ I as default
100
122
  };
101
123
  //# sourceMappingURL=index110.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index110.js","sources":["../src/components/BbTree/BbTree.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, renderSlot as _renderSlot, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, resolveComponent as _resolveComponent, withCtx as _withCtx, createSlots as _createSlots, createVNode as _createVNode, normalizeClass as _normalizeClass } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-tree-row\" }\nconst _hoisted_2 = { class: \"bb-tree-main-content\" }\n\nimport { computed } from \"vue\";\n\nexport type TreeItem = {\n /**\n * Array of children of the current item. Is the key \n * with which we can identify whther the node is nested or not.\n */\n children?: TreeItem[];\n /**\n * Status of the current node. When a node is open \n * it's children are displayed. Otherwise its children \n * are hidden.\n */\n open?: boolean;\n [key: symbol | string]: any;\n} & Pick<BbTreeProps, 'expandable'>\n\nexport type BbTreeProps = {\n /**\n * Array containing the tree like structure of the items.\n */\n items: TreeItem[];\n /**\n * Parent of the current node. `undefined` for the first level.\n */\n parent?: TreeItem;\n /**\n * Identifier of the item.\n */\n identifier?: string | number;\n /**\n * Current depth of the tree. Starting at 0 for \n * the first level increasing at every level down.\n */\n depth?: number;\n /**\n * Defines the item as expandable. It can be a \n * global boolean defining all items as expandable.\n * Or it can be a function that receives the item, \n * depth, and parent of the current node and returns a boolean.\n */\n expandable?:\n | boolean\n | ((item: TreeItem, depth: number, parent?: TreeItem) => boolean);\n};\n\nexport type BbTreeSlots = {\n [key: string]: (props: {\n item: any,\n parent?: any,\n depth: number,\n identifier?: string | number,\n expandable: boolean,\n }) => any\n}\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbTree',\n props: {\n items: { default: () => [] as TreeItem[] },\n parent: {},\n identifier: { default: \"id\" },\n depth: { default: 0 },\n expandable: { type: [Boolean, Function] }\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\n\nconst itemIsOpen = (item: TreeItem) => {\n /* If the item is not expandable it must be open */\n if (typeof item.open === \"undefined\") return true;\n return item.open;\n};\n\nconst internalItems = computed(() => {\n return props.items.map((item: TreeItem) => {\n const open = itemIsOpen(item);\n const expandableProp = item.expandable ?? props.expandable;\n let expandable = false;\n if (typeof expandableProp !== \"undefined\") {\n if (typeof expandableProp === \"function\")\n expandable = expandableProp(item, props.depth, props.parent);\n else expandable = expandableProp;\n }\n return {\n children: item.children,\n depth: props.depth,\n expandable: expandable,\n identifier: item[props.identifier],\n open,\n original: item,\n parent: props.parent,\n };\n });\n});\n\nreturn (_ctx: any,_cache: any) => {\n const _component_BbTree = _resolveComponent(\"BbTree\", true)!\n\n return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(internalItems.value, (item) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"bb-tree\", {\n [`bb-tree--depth-${item.depth}`]: true,\n 'bb-tree--open': item.open,\n }]),\n key: item.identifier\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_ctx.$slots[item.identifier])\n ? _renderSlot(_ctx.$slots, item.identifier, {\n key: 0,\n item: item.original,\n parent: item.parent,\n depth: item.depth,\n identifier: item.identifier,\n expandable: item.expandable\n })\n : (_ctx.$slots[item.depth])\n ? _renderSlot(_ctx.$slots, item.depth, {\n key: 1,\n item: item.original,\n parent: item.parent,\n depth: item.depth,\n identifier: item.identifier,\n expandable: item.expandable\n })\n : _renderSlot(_ctx.$slots, \"default\", {\n key: 2,\n item: item.original,\n parent: item.parent,\n depth: item.depth,\n identifier: item.identifier,\n expandable: item.expandable\n })\n ])\n ]),\n _createElementVNode(\"div\", {\n class: _normalizeClass(`bb-tree--depth-${item.depth}-children`)\n }, [\n _renderSlot(_ctx.$slots, `${item.depth}-children`, {\n item: item.original,\n parent: item.parent,\n depth: item.depth,\n identifier: item.identifier,\n expandable: item.expandable\n }, () => [\n _renderSlot(_ctx.$slots, `${item.identifier}-children`, {\n item: item.original,\n parent: item.parent,\n depth: item.depth,\n identifier: item.identifier,\n expandable: item.expandable\n }, () => [\n _createVNode(_component_BbTree, {\n depth: item.depth + 1,\n items: item.children,\n parent: item,\n identifier: props.identifier,\n expandable: _ctx.expandable\n }, _createSlots({ _: 2 }, [\n _renderList(_ctx.$slots, (_, name) => {\n return {\n name: name,\n fn: _withCtx((data) => [\n _renderSlot(_ctx.$slots, name, _normalizeProps(_guardReactiveProps(data)))\n ])\n }\n })\n ]), 1032, [\"depth\", \"items\", \"parent\", \"identifier\", \"expandable\"])\n ])\n ])\n ], 2)\n ], 2))\n }), 128))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_sfc_main","_defineComponent","__props","props","itemIsOpen","item","internalItems","computed","open","expandableProp","expandable","_ctx","_cache","_component_BbTree","_resolveComponent","_openBlock","_createElementBlock","_Fragment","_renderList","_normalizeClass","_createElementVNode","_renderSlot","_createVNode","_createSlots","_","name","_withCtx","data","_normalizeProps","_guardReactiveProps"],"mappings":";AAGA,MAAMA,IAAa,EAAE,OAAO,iBACtBC,IAAa,EAAE,OAAO,0BA0DAC,IAAiBC,gBAAAA,EAAA;AAAA,EA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B,MAAM;AAAA,cACPiB,EAAaT,GAAmB;AAAA,gBAC9B,OAAOR,EAAK,QAAQ;AAAA,gBACpB,OAAOA,EAAK;AAAA,gBACZ,QAAQA;AAAA,gBACR,YAAYF,EAAM;AAAA,gBAClB,YAAYQ,EAAK;AAAA,cAChB,GAAAY,EAAa,EAAE,GAAG,KAAK;AAAA,gBACxBL,EAAYP,EAAK,QAAQ,CAACa,GAAGC,OACpB;AAAA,kBACL,MAAAA;AAAA,kBACA,IAAIC,EAAS,CAACC,MAAS;AAAA,oBACrBN,EAAYV,EAAK,QAAQc,GAAMG,EAAgBC,EAAoBF,CAAI,CAAC,CAAC;AAAA,kBAAA,CAC1E;AAAA,gBAAA,EAEJ;AAAA,cAAA,CACF,GAAG,MAAM,CAAC,SAAS,SAAS,UAAU,cAAc,YAAY,CAAC;AAAA,YAAA,CACnE;AAAA,UAAA,CACF;AAAA,WACA,CAAC;AAAA,SACH,CAAC,EACL,GAAG,GAAG;AAAA,IAAA;AAAA,EAET;AAEA,CAAC;"}
1
+ {"version":3,"file":"index110.js","sources":["../src/components/BbTree/BbTree.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, renderSlot as _renderSlot, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, resolveComponent as _resolveComponent, withCtx as _withCtx, createSlots as _createSlots, createVNode as _createVNode, normalizeClass as _normalizeClass } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-tree-row\" }\nconst _hoisted_2 = { class: \"bb-tree-main-content\" }\n\nimport { flattenTree } from \"@/utilities/functions/flattenTree\";\nimport { computed } from \"vue\";\n\nexport type TreeItem = {\n /**\n * Array of children of the current item. Is the key\n * with which we can identify whther the node is nested or not.\n */\n children?: TreeItem[];\n /**\n * Status of the current node. When a node is open\n * it's children are displayed. Otherwise its children\n * are hidden.\n */\n open?: boolean;\n [key: symbol | string]: any;\n} & Pick<BbTreeProps, \"expandable\">;\n\nexport type BbTreeProps = {\n /**\n * Array containing the tree like structure of the items.\n */\n items: TreeItem[];\n /**\n * Parent of the current node. `undefined` for the first level.\n */\n parent?: TreeItem;\n /**\n * Identifier of the item.\n */\n identifier?: string | number;\n /**\n * Current depth of the tree. Starting at 0 for\n * the first level increasing at every level down.\n */\n depth?: number;\n /**\n * Defines the item as expandable. It can be a\n * global boolean defining all items as expandable.\n * Or it can be a function that receives the item,\n * depth, and parent of the current node and returns a boolean.\n */\n expandable?:\n | boolean\n | ((item: TreeItem, depth: number, parent?: TreeItem) => boolean);\n};\n\nexport type BbTreeSlots = {\n [key: string]: (props: {\n item: any;\n parent?: any;\n index: number;\n offset: number;\n open: boolean;\n depth: number;\n identifier?: string | number;\n expandable: boolean;\n }) => any;\n};\ntype MappedItem = {\n children: TreeItem[\"children\"];\n depth: NonNullable<BbTreeProps[\"depth\"]>;\n expandable: boolean;\n identifier: any;\n index: number;\n offset: number;\n open: boolean;\n original: any;\n parent: BbTreeProps[\"parent\"];\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbTree',\n props: {\n items: { default: () => [] as TreeItem[] },\n parent: {},\n identifier: { default: \"id\" },\n depth: { default: 0 },\n expandable: { type: [Boolean, Function] }\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\n\nconst itemIsOpen = (item: TreeItem) => {\n /* If the item is not expandable it must be open */\n if (typeof item.open === \"undefined\") return true;\n return item.open;\n};\n\nconst internalItems = computed<MappedItem[]>(() => {\n let currentOffset = 0;\n\n return props.items.map((item: TreeItem, index) => {\n const open = itemIsOpen(item);\n const expandableProp = item.expandable ?? props.expandable;\n const offset = currentOffset + 1;\n\n currentOffset = currentOffset + flattenTree([item], \"children\").length;\n\n let expandable = false;\n if (typeof expandableProp !== \"undefined\") {\n if (typeof expandableProp === \"function\")\n expandable = expandableProp(item, props.depth, props.parent);\n else expandable = expandableProp;\n }\n return {\n children: item.children,\n depth: props.depth,\n expandable: expandable,\n identifier: item[props.identifier],\n offset,\n index,\n open,\n original: item,\n parent: props.parent,\n };\n });\n});\n\nreturn (_ctx: any,_cache: any) => {\n const _component_BbTree = _resolveComponent(\"BbTree\", true)!\n\n return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(internalItems.value, (item) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"bb-tree\", {\n [`bb-tree--depth-${item.depth}`]: true,\n 'bb-tree--open': item.open,\n }]),\n key: item.identifier\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_ctx.$slots[item.identifier])\n ? _renderSlot(_ctx.$slots, item.identifier, {\n key: 0,\n depth: item.depth,\n expandable: item.expandable,\n identifier: item.identifier,\n index: item.index,\n item: item.original,\n offset: item.offset,\n open: item.open,\n parent: item.parent\n })\n : (_ctx.$slots[item.depth])\n ? _renderSlot(_ctx.$slots, item.depth, {\n key: 1,\n depth: item.depth,\n expandable: item.expandable,\n identifier: item.identifier,\n index: item.index,\n item: item.original,\n offset: item.offset,\n open: item.open,\n parent: item.parent\n })\n : _renderSlot(_ctx.$slots, 'default', {\n key: 2,\n depth: item.depth,\n expandable: item.expandable,\n identifier: item.identifier,\n index: item.index,\n item: item.original,\n offset: item.offset,\n open: item.open,\n parent: item.parent\n })\n ])\n ]),\n _createElementVNode(\"div\", {\n class: _normalizeClass(`bb-tree--depth-${item.depth}-children`)\n }, [\n _renderSlot(_ctx.$slots, `${item.depth}-children`, {\n depth: item.depth,\n expandable: item.expandable,\n identifier: item.identifier,\n index: item.index,\n item: item.original,\n offset: item.offset,\n open: item.open,\n parent: item.parent\n }, () => [\n _renderSlot(_ctx.$slots, `${item.identifier}-children`, {\n depth: item.depth,\n expandable: item.expandable,\n identifier: item.identifier,\n index: item.index,\n item: item.original,\n offset: item.offset,\n open: item.open,\n parent: item.parent\n }, () => [\n _createVNode(_component_BbTree, {\n depth: item.depth + 1,\n expandable: _ctx.expandable,\n identifier: props.identifier,\n items: item.children,\n parent: item\n }, _createSlots({ _: 2 }, [\n _renderList(_ctx.$slots, (_, name) => {\n return {\n name: name,\n fn: _withCtx((data) => [\n _renderSlot(_ctx.$slots, name, _normalizeProps(_guardReactiveProps(data)))\n ])\n }\n })\n ]), 1032, [\"depth\", \"expandable\", \"identifier\", \"items\", \"parent\"])\n ])\n ])\n ], 2)\n ], 2))\n }), 128))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_sfc_main","_defineComponent","__props","props","itemIsOpen","item","internalItems","computed","currentOffset","index","open","expandableProp","offset","flattenTree","expandable","_ctx","_cache","_component_BbTree","_resolveComponent","_openBlock","_createElementBlock","_Fragment","_renderList","_normalizeClass","_createElementVNode","_renderSlot","_createVNode","_createSlots","_","name","_withCtx","data","_normalizeProps","_guardReactiveProps"],"mappings":";;AAGA,MAAMA,IAAa,EAAE,OAAO,iBACtBC,IAAa,EAAE,OAAO,0BA0EAC,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,OAAO,EAAE,SAAS,MAAM,GAAiB;AAAA,IACzC,QAAQ,CAAC;AAAA,IACT,YAAY,EAAE,SAAS,KAAK;AAAA,IAC5B,OAAO,EAAE,SAAS,EAAE;AAAA,IACpB,YAAY,EAAE,MAAM,CAAC,SAAS,QAAQ,EAAE;AAAA,EAC1C;AAAA,EACA,MAAMC,GAAc;AAEtB,UAAMC,IAAQD,GAIRE,IAAa,CAACC,MAEd,OAAOA,EAAK,OAAS,MAAoB,KACtCA,EAAK,MAGRC,IAAgBC,EAAuB,MAAM;AACjD,UAAIC,IAAgB;AAEpB,aAAOL,EAAM,MAAM,IAAI,CAACE,GAAgBI,MAAU;AAC1C,cAAAC,IAAON,EAAWC,CAAI,GACtBM,IAAiBN,EAAK,cAAcF,EAAM,YAC1CS,IAASJ,IAAgB;AAE/B,QAAAA,IAA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;AAAA,cACPqB,EAAaT,GAAmB;AAAA,gBAC9B,OAAOZ,EAAK,QAAQ;AAAA,gBACpB,YAAYU,EAAK;AAAA,gBACjB,YAAYZ,EAAM;AAAA,gBAClB,OAAOE,EAAK;AAAA,gBACZ,QAAQA;AAAA,cACP,GAAAsB,EAAa,EAAE,GAAG,KAAK;AAAA,gBACxBL,EAAYP,EAAK,QAAQ,CAACa,GAAGC,OACpB;AAAA,kBACL,MAAAA;AAAA,kBACA,IAAIC,EAAS,CAACC,MAAS;AAAA,oBACrBN,EAAYV,EAAK,QAAQc,GAAMG,EAAgBC,EAAoBF,CAAI,CAAC,CAAC;AAAA,kBAAA,CAC1E;AAAA,gBAAA,EAEJ;AAAA,cAAA,CACF,GAAG,MAAM,CAAC,SAAS,cAAc,cAAc,SAAS,QAAQ,CAAC;AAAA,YAAA,CACnE;AAAA,UAAA,CACF;AAAA,WACA,CAAC;AAAA,SACH,CAAC,EACL,GAAG,GAAG;AAAA,IAAA;AAAA,EAET;AAEA,CAAC;"}
package/dist/index112.js CHANGED
@@ -1,21 +1,21 @@
1
1
  import { defineComponent as c, openBlock as t, createElementBlock as o, createElementVNode as l, renderSlot as i, createTextVNode as r, toDisplayString as p, withModifiers as _, createCommentVNode as d } from "vue";
2
- const b = { class: "bb-chip" }, h = { class: "bb-chip__content" }, m = ["aria-label", "onClick"], L = {
2
+ const b = { class: "bb-chip" }, h = { class: "bb-chip__content" }, m = ["aria-label", "onClick"], u = {
3
3
  xmlns: "http://www.w3.org/2000/svg",
4
4
  viewBox: "0 0 20 20",
5
5
  role: "img",
6
6
  "aria-hidden": "true",
7
7
  class: "v-icon__svg",
8
8
  style: { height: "20px", width: "20px" }
9
- }, u = /* @__PURE__ */ l("path", {
9
+ }, L = /* @__PURE__ */ l("path", {
10
10
  d: "M15 6.375L14.125 5.5L10 9.625L5.875 5.5L5 6.375L9.125 10.5L5 14.625L5.875 15.5L10 11.375L14.125 15.5L15 14.625L10.875 10.5L15 6.375Z",
11
11
  fill: "currentColor"
12
12
  }, null, -1), f = [
13
- u
13
+ L
14
14
  ], C = /* @__PURE__ */ c({
15
15
  __name: "BbChip",
16
16
  props: {
17
17
  text: {},
18
- clearable: { type: Boolean },
18
+ clearable: { type: Boolean, default: !0 },
19
19
  clearableLabel: { default: "Elimina" }
20
20
  },
21
21
  emits: ["click:clear"],
@@ -36,7 +36,7 @@ const b = { class: "bb-chip" }, h = { class: "bb-chip__content" }, m = ["aria-la
36
36
  onClick: _(n, ["stop", "prevent"]),
37
37
  type: "button"
38
38
  }, [
39
- (t(), o("svg", L, f))
39
+ (t(), o("svg", u, f))
40
40
  ], 8, m)) : d("", !0)
41
41
  ]));
42
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index112.js","sources":["../src/components/BbChip/BbChip.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, withModifiers as _withModifiers, createCommentVNode as _createCommentVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-chip\" }\nconst _hoisted_2 = { class: \"bb-chip__content\" }\nconst _hoisted_3 = [\"aria-label\", \"onClick\"]\nconst _hoisted_4 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n role: \"img\",\n \"aria-hidden\": \"true\",\n class: \"v-icon__svg\",\n style: {\"height\":\"20px\",\"width\":\"20px\"}\n}\nconst _hoisted_5 = /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M15 6.375L14.125 5.5L10 9.625L5.875 5.5L5 6.375L9.125 10.5L5 14.625L5.875 15.5L10 11.375L14.125 15.5L15 14.625L10.875 10.5L15 6.375Z\",\n fill: \"currentColor\"\n}, null, -1)\nconst _hoisted_6 = [\n _hoisted_5\n]\n\nimport type { CommonProps } from \"@/types/CommonProps\";\n\nexport type BbChipProps = Pick<CommonProps, \"text\"> & {\n /**\n * Renders a button with a close icon. Used to indicate the possibility of deleting the item.\n */\n clearable?: true;\n /**\n * The label the clearing button must have\n */\n clearableLabel?: string;\n};\n\nexport type BbChipEvents = {\n (e: \"click:clear\", event: MouseEvent): void;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbChip',\n props: {\n text: {},\n clearable: { type: Boolean },\n clearableLabel: { default: \"Elimina\" }\n },\n emits: [\"click:clear\"],\n setup(__props: any, { emit: __emit }) {\n\n\n\n\n\nconst emit = __emit;\nconst onClear = (event: MouseEvent) => {\n emit(\"click:clear\", event);\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", _hoisted_1, [\n _createElementVNode(\"span\", _hoisted_2, [\n _renderSlot(_ctx.$slots, \"default\", {}, () => [\n _createTextVNode(_toDisplayString(_ctx.text), 1)\n ])\n ]),\n (_ctx.clearable)\n ? (_openBlock(), _createElementBlock(\"button\", {\n key: 0,\n \"aria-label\": _ctx.clearableLabel,\n class: \"bb-chip__clear-button\",\n onClick: _withModifiers(onClear, [\"stop\",\"prevent\"]),\n type: \"button\"\n }, [\n (_openBlock(), _createElementBlock(\"svg\", _hoisted_4, _hoisted_6))\n ], 8, _hoisted_3))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_sfc_main","_defineComponent","__props","__emit","emit","onClear","event","_ctx","_cache","_openBlock","_createElementBlock","_createElementVNode","_renderSlot","_createTextVNode","_toDisplayString","_withModifiers","_createCommentVNode"],"mappings":";AAGA,MAAMA,IAAa,EAAE,OAAO,aACtBC,IAAa,EAAE,OAAO,sBACtBC,IAAa,CAAC,cAAc,SAAS,GACrCC,IAAa;AAAA,EACjB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,eAAe;AAAA,EACf,OAAO;AAAA,EACP,OAAO,EAAC,QAAS,QAAO,OAAQ,OAAM;AACxC,GACMC,sBAA8C,QAAQ;AAAA,EAC1D,GAAG;AAAA,EACH,MAAM;AACR,GAAG,MAAM,EAAE,GACLC,IAAa;AAAA,EACjBD;AACF,GAoB4BE,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,MAAM,CAAC;AAAA,IACP,WAAW,EAAE,MAAM,QAAQ;AAAA,IAC3B,gBAAgB,EAAE,SAAS,UAAU;AAAA,EACvC;AAAA,EACA,OAAO,CAAC,aAAa;AAAA,EACrB,MAAMC,GAAc,EAAE,MAAMC,KAAU;AAMxC,UAAMC,IAAOD,GACPE,IAAU,CAACC,MAAsB;AACrC,MAAAF,EAAK,eAAeE,CAAK;AAAA,IAAA;AAGpB,WAAA,CAACC,GAAUC,OACRC,EAAW,GAAGC,EAAoB,QAAQhB,GAAY;AAAA,MAC5DiB,EAAoB,QAAQhB,GAAY;AAAA,QACtCiB,EAAYL,EAAK,QAAQ,WAAW,IAAI,MAAM;AAAA,UAC5CM,EAAiBC,EAAiBP,EAAK,IAAI,GAAG,CAAC;AAAA,QAAA,CAChD;AAAA,MAAA,CACF;AAAA,MACAA,EAAK,aACDE,KAAcC,EAAoB,UAAU;AAAA,QAC3C,KAAK;AAAA,QACL,cAAcH,EAAK;AAAA,QACnB,OAAO;AAAA,QACP,SAASQ,EAAeV,GAAS,CAAC,QAAO,SAAS,CAAC;AAAA,QACnD,MAAM;AAAA,MAAA,GACL;AAAA,SACAI,EAAW,GAAGC,EAAoB,OAAOb,GAAYE,CAAU;AAAA,SAC/D,GAAGH,CAAU,KAChBoB,EAAoB,IAAI,EAAI;AAAA,IAAA,CACjC;AAAA,EAEH;AAEA,CAAC;"}
1
+ {"version":3,"file":"index112.js","sources":["../src/components/BbChip/BbChip.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, withModifiers as _withModifiers, createCommentVNode as _createCommentVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-chip\" }\nconst _hoisted_2 = { class: \"bb-chip__content\" }\nconst _hoisted_3 = [\"aria-label\", \"onClick\"]\nconst _hoisted_4 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n role: \"img\",\n \"aria-hidden\": \"true\",\n class: \"v-icon__svg\",\n style: {\"height\":\"20px\",\"width\":\"20px\"}\n}\nconst _hoisted_5 = /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M15 6.375L14.125 5.5L10 9.625L5.875 5.5L5 6.375L9.125 10.5L5 14.625L5.875 15.5L10 11.375L14.125 15.5L15 14.625L10.875 10.5L15 6.375Z\",\n fill: \"currentColor\"\n}, null, -1)\nconst _hoisted_6 = [\n _hoisted_5\n]\n\nimport type { CommonProps } from \"@/types/CommonProps\";\n\nexport type BbChipProps = Pick<CommonProps, \"text\"> & {\n /**\n * Renders a button with a close icon. Used to indicate the possibility of deleting the item.\n */\n clearable?: boolean;\n /**\n * The label the clearing button must have\n */\n clearableLabel?: string;\n};\n\nexport type BbChipEvents = {\n (e: \"click:clear\", event: MouseEvent): void;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbChip',\n props: {\n text: {},\n clearable: { type: Boolean, default: true },\n clearableLabel: { default: \"Elimina\" }\n },\n emits: [\"click:clear\"],\n setup(__props: any, { emit: __emit }) {\n\n\n\n\n\nconst emit = __emit;\nconst onClear = (event: MouseEvent) => {\n emit(\"click:clear\", event);\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", _hoisted_1, [\n _createElementVNode(\"span\", _hoisted_2, [\n _renderSlot(_ctx.$slots, \"default\", {}, () => [\n _createTextVNode(_toDisplayString(_ctx.text), 1)\n ])\n ]),\n (_ctx.clearable)\n ? (_openBlock(), _createElementBlock(\"button\", {\n key: 0,\n \"aria-label\": _ctx.clearableLabel,\n class: \"bb-chip__clear-button\",\n onClick: _withModifiers(onClear, [\"stop\",\"prevent\"]),\n type: \"button\"\n }, [\n (_openBlock(), _createElementBlock(\"svg\", _hoisted_4, _hoisted_6))\n ], 8, _hoisted_3))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_sfc_main","_defineComponent","__props","__emit","emit","onClear","event","_ctx","_cache","_openBlock","_createElementBlock","_createElementVNode","_renderSlot","_createTextVNode","_toDisplayString","_withModifiers","_createCommentVNode"],"mappings":";AAGA,MAAMA,IAAa,EAAE,OAAO,aACtBC,IAAa,EAAE,OAAO,sBACtBC,IAAa,CAAC,cAAc,SAAS,GACrCC,IAAa;AAAA,EACjB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,eAAe;AAAA,EACf,OAAO;AAAA,EACP,OAAO,EAAC,QAAS,QAAO,OAAQ,OAAM;AACxC,GACMC,sBAA8C,QAAQ;AAAA,EAC1D,GAAG;AAAA,EACH,MAAM;AACR,GAAG,MAAM,EAAE,GACLC,IAAa;AAAA,EACjBD;AACF,GAoB4BE,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,MAAM,CAAC;AAAA,IACP,WAAW,EAAE,MAAM,SAAS,SAAS,GAAK;AAAA,IAC1C,gBAAgB,EAAE,SAAS,UAAU;AAAA,EACvC;AAAA,EACA,OAAO,CAAC,aAAa;AAAA,EACrB,MAAMC,GAAc,EAAE,MAAMC,KAAU;AAMxC,UAAMC,IAAOD,GACPE,IAAU,CAACC,MAAsB;AACrC,MAAAF,EAAK,eAAeE,CAAK;AAAA,IAAA;AAGpB,WAAA,CAACC,GAAUC,OACRC,EAAW,GAAGC,EAAoB,QAAQhB,GAAY;AAAA,MAC5DiB,EAAoB,QAAQhB,GAAY;AAAA,QACtCiB,EAAYL,EAAK,QAAQ,WAAW,IAAI,MAAM;AAAA,UAC5CM,EAAiBC,EAAiBP,EAAK,IAAI,GAAG,CAAC;AAAA,QAAA,CAChD;AAAA,MAAA,CACF;AAAA,MACAA,EAAK,aACDE,KAAcC,EAAoB,UAAU;AAAA,QAC3C,KAAK;AAAA,QACL,cAAcH,EAAK;AAAA,QACnB,OAAO;AAAA,QACP,SAASQ,EAAeV,GAAS,CAAC,QAAO,SAAS,CAAC;AAAA,QACnD,MAAM;AAAA,MAAA,GACL;AAAA,SACAI,EAAW,GAAGC,EAAoB,OAAOb,GAAYE,CAAU;AAAA,SAC/D,GAAGH,CAAU,KAChBoB,EAAoB,IAAI,EAAI;AAAA,IAAA,CACjC;AAAA,EAEH;AAEA,CAAC;"}
package/dist/index113.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as i, ref as a, watch as s, computed as u, openBlock as c, createElementBlock as p, normalizeProps as d, guardReactiveProps as m, createElementVNode as b, renderSlot as v, createCommentVNode as f } from "vue";
2
2
  import { wait as V } from "./index119.js";
3
- import { throttle as _ } from "./index194.js";
3
+ import { throttle as _ } from "./index195.js";
4
4
  const h = { class: "bb-collapsible__content" }, k = /* @__PURE__ */ i({
5
5
  __name: "BbCollapsible",
6
6
  props: {
@@ -1 +1 @@
1
- {"version":3,"file":"index113.js","sources":["../src/components/BbCollapsible/BbCollapsible.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-collapsible__content\" }\n\nimport { wait } from \"@/utilities/functions/wait\";\nimport { throttle } from \"@/utilities/functions/throttle\";\nimport { computed, ref, watch } from \"vue\";\nimport type { CommonProps } from \"@/types/CommonProps\";\n\nexport type BbCollapsibleProps = Pick<CommonProps, 'eager' | 'transitionDuration'> & {\n /**\n * Used by v-model to trigger opening / closing the collapsible\n */\n modelValue?: boolean;\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbCollapsible',\n props: {\n eager: { type: Boolean },\n transitionDuration: { default: 250 },\n modelValue: { type: Boolean }\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\n\nconst visible = ref(props.modelValue);\nconst hasRenderedOnce = ref(visible.value);\n\n/**\n * Every time model value changes if content is going to be expanded\n * make it visible straight away.\n * If content id going to be collapsed wait for end of \n * transition before hiding from keyboard navigation\n */\nwatch(\n () => props.modelValue,\n throttle(async (value) => {\n if (value) {\n hasRenderedOnce.value = true;\n visible.value = true;\n } else {\n await wait(props.transitionDuration);\n visible.value = false;\n }\n }, props.transitionDuration)\n);\nconst collapsibleAttributes = computed(() => {\n return {\n \"aria-expanded\": props.modelValue,\n class: {\n \"bb-collapsible\": true,\n \"bb-collapsible--open\": props.modelValue,\n \"bb-collapsible--closed\": !props.modelValue,\n \"bb-collapsible--invisible\": !visible.value,\n },\n style: {\n transitionDuration: props.transitionDuration + \"ms\",\n },\n };\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _normalizeProps(_guardReactiveProps(collapsibleAttributes.value)), [\n _createElementVNode(\"div\", _hoisted_1, [\n (_ctx.eager || hasRenderedOnce.value)\n ? _renderSlot(_ctx.$slots, \"default\", { key: 0 })\n : _createCommentVNode(\"\", true)\n ])\n ], 16))\n}\n}\n\n})"],"names":["_hoisted_1","_sfc_main","_defineComponent","__props","props","visible","ref","hasRenderedOnce","watch","throttle","value","wait","collapsibleAttributes","computed","_ctx","_cache","_openBlock","_createElementBlock","_normalizeProps","_guardReactiveProps","_createElementVNode","_renderSlot","_createCommentVNode"],"mappings":";;;AAGA,MAAMA,IAAa,EAAE,OAAO,6BAeAC,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,oBAAoB,EAAE,SAAS,IAAI;AAAA,IACnC,YAAY,EAAE,MAAM,QAAQ;AAAA,EAC9B;AAAA,EACA,MAAMC,GAAc;AAEtB,UAAMC,IAAQD,GAIRE,IAAUC,EAAIF,EAAM,UAAU,GAC9BG,IAAkBD,EAAID,EAAQ,KAAK;AAQzC,IAAAG;AAAA,MACE,MAAMJ,EAAM;AAAA,MACZK,EAAS,OAAOC,MAAU;AACxB,QAAIA,KACFH,EAAgB,QAAQ,IACxBF,EAAQ,QAAQ,OAEV,MAAAM,EAAKP,EAAM,kBAAkB,GACnCC,EAAQ,QAAQ;AAAA,MAClB,GACCD,EAAM,kBAAkB;AAAA,IAAA;AAEvB,UAAAQ,IAAwBC,EAAS,OAC9B;AAAA,MACL,iBAAiBT,EAAM;AAAA,MACvB,OAAO;AAAA,QACL,kBAAkB;AAAA,QAClB,wBAAwBA,EAAM;AAAA,QAC9B,0BAA0B,CAACA,EAAM;AAAA,QACjC,6BAA6B,CAACC,EAAQ;AAAA,MACxC;AAAA,MACA,OAAO;AAAA,QACL,oBAAoBD,EAAM,qBAAqB;AAAA,MACjD;AAAA,IAAA,EAEH;AAEM,WAAA,CAACU,GAAUC,OACRC,EAAA,GAAcC,EAAoB,OAAOC,EAAgBC,EAAoBP,EAAsB,KAAK,CAAC,GAAG;AAAA,MAClHQ,EAAoB,OAAOpB,GAAY;AAAA,QACpCc,EAAK,SAASP,EAAgB,QAC3Bc,EAAYP,EAAK,QAAQ,WAAW,EAAE,KAAK,EAAG,CAAA,IAC9CQ,EAAoB,IAAI,EAAI;AAAA,MAAA,CACjC;AAAA,OACA,EAAE;AAAA,EAEP;AAEA,CAAC;"}
1
+ {"version":3,"file":"index113.js","sources":["../src/components/BbCollapsible/BbCollapsible.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-collapsible__content\" }\n\nimport { wait } from \"@/utilities/functions/wait\";\nimport { throttle } from \"@/utilities/functions/throttle\";\nimport { computed, ref, watch } from \"vue\";\nimport type { CommonProps } from \"@/types/CommonProps\";\n\nexport type BbCollapsibleProps = Pick<CommonProps, 'eager' | 'transitionDuration'> & {\n /**\n * Used by v-model to trigger opening / closing the collapsible\n */\n modelValue: boolean;\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbCollapsible',\n props: {\n eager: { type: Boolean },\n transitionDuration: { default: 250 },\n modelValue: { type: Boolean }\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\n\nconst visible = ref(props.modelValue);\nconst hasRenderedOnce = ref(visible.value);\n\n/**\n * Every time model value changes if content is going to be expanded\n * make it visible straight away.\n * If content id going to be collapsed wait for end of \n * transition before hiding from keyboard navigation\n */\nwatch(\n () => props.modelValue,\n throttle(async (value) => {\n if (value) {\n hasRenderedOnce.value = true;\n visible.value = true;\n } else {\n await wait(props.transitionDuration);\n visible.value = false;\n }\n }, props.transitionDuration)\n);\nconst collapsibleAttributes = computed(() => {\n return {\n \"aria-expanded\": props.modelValue,\n class: {\n \"bb-collapsible\": true,\n \"bb-collapsible--open\": props.modelValue,\n \"bb-collapsible--closed\": !props.modelValue,\n \"bb-collapsible--invisible\": !visible.value,\n },\n style: {\n transitionDuration: props.transitionDuration + \"ms\",\n },\n };\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _normalizeProps(_guardReactiveProps(collapsibleAttributes.value)), [\n _createElementVNode(\"div\", _hoisted_1, [\n (_ctx.eager || hasRenderedOnce.value)\n ? _renderSlot(_ctx.$slots, \"default\", { key: 0 })\n : _createCommentVNode(\"\", true)\n ])\n ], 16))\n}\n}\n\n})"],"names":["_hoisted_1","_sfc_main","_defineComponent","__props","props","visible","ref","hasRenderedOnce","watch","throttle","value","wait","collapsibleAttributes","computed","_ctx","_cache","_openBlock","_createElementBlock","_normalizeProps","_guardReactiveProps","_createElementVNode","_renderSlot","_createCommentVNode"],"mappings":";;;AAGA,MAAMA,IAAa,EAAE,OAAO,6BAeAC,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,oBAAoB,EAAE,SAAS,IAAI;AAAA,IACnC,YAAY,EAAE,MAAM,QAAQ;AAAA,EAC9B;AAAA,EACA,MAAMC,GAAc;AAEtB,UAAMC,IAAQD,GAIRE,IAAUC,EAAIF,EAAM,UAAU,GAC9BG,IAAkBD,EAAID,EAAQ,KAAK;AAQzC,IAAAG;AAAA,MACE,MAAMJ,EAAM;AAAA,MACZK,EAAS,OAAOC,MAAU;AACxB,QAAIA,KACFH,EAAgB,QAAQ,IACxBF,EAAQ,QAAQ,OAEV,MAAAM,EAAKP,EAAM,kBAAkB,GACnCC,EAAQ,QAAQ;AAAA,MAClB,GACCD,EAAM,kBAAkB;AAAA,IAAA;AAEvB,UAAAQ,IAAwBC,EAAS,OAC9B;AAAA,MACL,iBAAiBT,EAAM;AAAA,MACvB,OAAO;AAAA,QACL,kBAAkB;AAAA,QAClB,wBAAwBA,EAAM;AAAA,QAC9B,0BAA0B,CAACA,EAAM;AAAA,QACjC,6BAA6B,CAACC,EAAQ;AAAA,MACxC;AAAA,MACA,OAAO;AAAA,QACL,oBAAoBD,EAAM,qBAAqB;AAAA,MACjD;AAAA,IAAA,EAEH;AAEM,WAAA,CAACU,GAAUC,OACRC,EAAA,GAAcC,EAAoB,OAAOC,EAAgBC,EAAoBP,EAAsB,KAAK,CAAC,GAAG;AAAA,MAClHQ,EAAoB,OAAOpB,GAAY;AAAA,QACpCc,EAAK,SAASP,EAAgB,QAC3Bc,EAAYP,EAAK,QAAQ,WAAW,EAAE,KAAK,EAAG,CAAA,IAC9CQ,EAAoB,IAAI,EAAI;AAAA,MAAA,CACjC;AAAA,OACA,EAAE;AAAA,EAEP;AAEA,CAAC;"}
package/dist/index114.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as m, getCurrentInstance as d, inject as x, computed as l, ref as y, watchEffect as _, openBlock as b, createElementBlock as h, mergeProps as w } from "vue";
2
- import { isCssColor as z } from "./index189.js";
2
+ import { isCssColor as z } from "./index191.js";
3
3
  const g = ["innerHTML"], $ = /* @__PURE__ */ m({
4
4
  __name: "BbIcon",
5
5
  props: {
package/dist/index115.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as v, ref as r, onMounted as p, onBeforeUnmount as h, openBlock as i, createBlock as l, resolveDynamicComponent as u, normalizeStyle as m, withCtx as f, renderSlot as d } from "vue";
2
- import { throttle as g } from "./index194.js";
2
+ import { throttle as g } from "./index195.js";
3
3
  const O = /* @__PURE__ */ v({
4
4
  __name: "BbSmoothHeight",
5
5
  props: {