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/index64.js CHANGED
@@ -1,9 +1,9 @@
1
- import { defineComponent as v, computed as B, openBlock as k, createElementBlock as _, normalizeClass as D, createVNode as p, mergeProps as c, withCtx as o, renderSlot as n, createSlots as y, createElementVNode as m, toDisplayString as C, normalizeProps as s, guardReactiveProps as d, renderList as g } from "vue";
2
- import f from "./index6.js";
1
+ import { defineComponent as c, computed as v, openBlock as B, createElementBlock as k, normalizeClass as y, createVNode as l, mergeProps as h, withCtx as o, renderSlot as n, createSlots as D, createElementVNode as m, toDisplayString as C, normalizeProps as d, guardReactiveProps as a, renderList as P } from "vue";
2
+ import g from "./index6.js";
3
3
  import "./index7.js";
4
4
  import L from "./index62.js";
5
5
  import "./index63.js";
6
- const P = { class: "bb-dropdown-button__dropdown-label" }, S = /* @__PURE__ */ m("svg", {
6
+ const S = { class: "bb-dropdown-button__dropdown-label" }, _ = /* @__PURE__ */ m("svg", {
7
7
  class: "bb-dropdown-button__dropdown-chevron",
8
8
  xmlns: "http://www.w3.org/2000/svg",
9
9
  viewBox: "0 0 24 24"
@@ -12,30 +12,34 @@ const P = { class: "bb-dropdown-button__dropdown-label" }, S = /* @__PURE__ */ m
12
12
  fill: "currentColor",
13
13
  d: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6l1.41 1.41Z"
14
14
  })
15
- ], -1), R = /* @__PURE__ */ v({
15
+ ], -1), R = /* @__PURE__ */ c({
16
16
  __name: "BbDropdownButton",
17
17
  props: {
18
+ arrowPadding: {},
18
19
  block: { type: Boolean },
19
20
  disabled: { type: Boolean },
21
+ eager: { type: Boolean },
20
22
  id: {},
21
23
  items: {},
24
+ offset: {},
25
+ padding: {},
22
26
  placement: {},
23
27
  theme: { default: "default" },
24
28
  transitionDuration: {},
25
29
  width: {}
26
30
  },
27
31
  setup($) {
28
- const a = $, i = B(() => {
29
- const e = { ...a.items[0] };
30
- return e.disabled = e.disabled || a.disabled, e;
32
+ const s = $, i = v(() => {
33
+ const e = { ...s.items[0] };
34
+ return e.disabled = e.disabled || s.disabled, e;
31
35
  });
32
- return (e, z) => (k(), _("span", {
33
- class: D(["bb-dropdown-button", {
36
+ return (e, z) => (B(), k("span", {
37
+ class: y(["bb-dropdown-button", {
34
38
  "bb-dropdown-button--block": e.block,
35
- [`bb-dropdown-button--theme-${a.theme}`]: a.theme
39
+ [`bb-dropdown-button--theme-${s.theme}`]: s.theme
36
40
  }])
37
41
  }, [
38
- p(f, c(i.value, { class: "bb-dropdown-button__main-btn" }), {
42
+ l(g, h(i.value, { class: "bb-dropdown-button__main-btn" }), {
39
43
  default: o(() => [
40
44
  n(e.$slots, "left-btn", {
41
45
  disabled: i.value.disabled,
@@ -44,45 +48,49 @@ const P = { class: "bb-dropdown-button__dropdown-label" }, S = /* @__PURE__ */ m
44
48
  ]),
45
49
  _: 3
46
50
  }, 16),
47
- p(L, {
51
+ l(L, {
52
+ "arrow-padding": e.arrowPadding,
48
53
  disabled: e.disabled,
54
+ eager: e.eager,
49
55
  id: e.id,
50
56
  items: e.items,
57
+ offset: e.offset,
58
+ padding: e.padding,
51
59
  placement: e.placement,
52
60
  theme: e.theme,
53
61
  transitionDuration: e.transitionDuration,
54
62
  width: e.width
55
- }, y({
63
+ }, D({
56
64
  activator: o(({
57
65
  props: t,
58
66
  opening: r,
59
- open: l,
67
+ open: p,
60
68
  closed: b,
61
69
  closing: u,
62
70
  disabled: w,
63
- placement: h
71
+ placement: f
64
72
  }) => [
65
73
  n(e.$slots, "activator", {
66
74
  props: t,
67
75
  opening: r,
68
- open: l,
76
+ open: p,
69
77
  closed: b,
70
78
  closing: u,
71
79
  disabled: w,
72
- placement: h
80
+ placement: f
73
81
  }, () => [
74
- p(f, c(t, { class: "bb-dropdown-button__dropdown-btn" }), {
82
+ l(g, h(t, { class: "bb-dropdown-button__dropdown-btn" }), {
75
83
  default: o(() => [
76
- m("span", P, C(l || r ? "Chiudi" : "Apri") + " il menu", 1),
84
+ m("span", S, C(p || r ? "Chiudi" : "Apri") + " il menu", 1),
77
85
  n(e.$slots, "right-btn", {
78
86
  opening: r,
79
- open: l,
87
+ open: p,
80
88
  closed: b,
81
89
  closing: u,
82
90
  disabled: w,
83
- placement: h
91
+ placement: f
84
92
  }, () => [
85
- S
93
+ _
86
94
  ])
87
95
  ]),
88
96
  _: 2
@@ -90,29 +98,29 @@ const P = { class: "bb-dropdown-button__dropdown-label" }, S = /* @__PURE__ */ m
90
98
  ])
91
99
  ]),
92
100
  prepend: o((t) => [
93
- n(e.$slots, "prepend", s(d(t)))
101
+ n(e.$slots, "prepend", d(a(t)))
94
102
  ]),
95
103
  "item:prepend": o((t) => [
96
- n(e.$slots, "item:prepend", s(d(t)))
104
+ n(e.$slots, "item:prepend", d(a(t)))
97
105
  ]),
98
106
  item: o((t) => [
99
- n(e.$slots, "item", s(d(t)))
107
+ n(e.$slots, "item", d(a(t)))
100
108
  ]),
101
109
  "item:append": o((t) => [
102
- n(e.$slots, "item:append", s(d(t)))
110
+ n(e.$slots, "item:append", d(a(t)))
103
111
  ]),
104
112
  append: o((t) => [
105
- n(e.$slots, "append", s(d(t)))
113
+ n(e.$slots, "append", d(a(t)))
106
114
  ]),
107
115
  _: 2
108
116
  }, [
109
- g(e.items, (t) => ({
117
+ P(e.items, (t) => ({
110
118
  name: t.key,
111
119
  fn: o((r) => [
112
- n(e.$slots, t.key, s(d(r)))
120
+ n(e.$slots, t.key, d(a(r)))
113
121
  ])
114
122
  }))
115
- ]), 1032, ["disabled", "id", "items", "placement", "theme", "transitionDuration", "width"])
123
+ ]), 1032, ["arrow-padding", "disabled", "eager", "id", "items", "offset", "padding", "placement", "theme", "transitionDuration", "width"])
116
124
  ], 2));
117
125
  }
118
126
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index64.js","sources":["../src/components/BbDropdownButton/BbDropdownButton.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, mergeProps as _mergeProps, withCtx as _withCtx, createVNode as _createVNode, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderList as _renderList, createSlots as _createSlots, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-dropdown-button__dropdown-label\" }\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"svg\", {\n class: \"bb-dropdown-button__dropdown-chevron\",\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n d: \"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6l1.41 1.41Z\"\n })\n], -1)\n\nimport { computed } from \"vue\";\nimport BaseButton from \"../BaseButton/BaseButton.vue\";\nimport BbDropdown from \"../BbDropdown/BbDropdown.vue\";\nimport type {\n BbDropdownProps,\n MappedItem,\n} from \"../BbDropdown/BbDropdown.vue\";\n\nexport type BbDropdownButtonProps = Pick<\n BbDropdownProps,\n | \"block\"\n | \"disabled\"\n | \"id\"\n | \"items\"\n | \"placement\"\n | \"theme\"\n | \"transitionDuration\"\n | \"width\"\n>;\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbDropdownButton',\n props: {\n block: { type: Boolean },\n disabled: { type: Boolean },\n id: {},\n items: {},\n placement: {},\n theme: { default: \"default\" },\n transitionDuration: {},\n width: {}\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\n\nconst mainBtn = computed(() => {\n const base = { ...props.items[0] };\n base.disabled = base.disabled || props.disabled;\n return base;\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n class: _normalizeClass([\"bb-dropdown-button\", {\n 'bb-dropdown-button--block': _ctx.block,\n [`bb-dropdown-button--theme-${props.theme}`]: props.theme,\n }])\n }, [\n _createVNode(BaseButton, _mergeProps(mainBtn.value, { class: \"bb-dropdown-button__main-btn\" }), {\n default: _withCtx(() => [\n _renderSlot(_ctx.$slots, \"left-btn\", {\n disabled: mainBtn.value.disabled,\n text: mainBtn.value.text\n })\n ]),\n _: 3\n }, 16),\n _createVNode(BbDropdown, {\n disabled: _ctx.disabled,\n id: _ctx.id,\n items: _ctx.items,\n placement: _ctx.placement,\n theme: _ctx.theme,\n transitionDuration: _ctx.transitionDuration,\n width: _ctx.width\n }, _createSlots({\n activator: _withCtx(({\n props,\n opening,\n open,\n closed,\n closing,\n disabled,\n placement,\n }) => [\n _renderSlot(_ctx.$slots, \"activator\", {\n props: props,\n opening: opening,\n open: open,\n closed: closed,\n closing: closing,\n disabled: disabled,\n placement: placement\n }, () => [\n _createVNode(BaseButton, _mergeProps(props, { class: \"bb-dropdown-button__dropdown-btn\" }), {\n default: _withCtx(() => [\n _createElementVNode(\"span\", _hoisted_1, _toDisplayString(open || opening ? \"Chiudi\" : \"Apri\") + \" il menu\", 1),\n _renderSlot(_ctx.$slots, \"right-btn\", {\n opening: opening,\n open: open,\n closed: closed,\n closing: closing,\n disabled: disabled,\n placement: placement\n }, () => [\n _hoisted_2\n ])\n ]),\n _: 2\n }, 1040)\n ])\n ]),\n prepend: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"prepend\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n \"item:prepend\": _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"item:prepend\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n item: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"item\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n \"item:append\": _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"item:append\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n append: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"append\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n _: 2\n }, [\n _renderList(_ctx.items, (item) => {\n return {\n name: item.key,\n fn: _withCtx((data) => [\n _renderSlot(_ctx.$slots, item.key, _normalizeProps(_guardReactiveProps(data)))\n ])\n }\n })\n ]), 1032, [\"disabled\", \"id\", \"items\", \"placement\", \"theme\", \"transitionDuration\", \"width\"])\n ], 2))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_sfc_main","_defineComponent","__props","props","mainBtn","computed","base","_ctx","_cache","_openBlock","_createElementBlock","_normalizeClass","_createVNode","BaseButton","_mergeProps","_withCtx","_renderSlot","BbDropdown","_createSlots","opening","open","closed","closing","disabled","placement","_createElementVNode","_toDisplayString","data","_normalizeProps","_guardReactiveProps","_renderList","item"],"mappings":";;;;;AAGA,MAAMA,IAAa,EAAE,OAAO,wCACtBC,sBAA8C,OAAO;AAAA,EACzD,OAAO;AAAA,EACP,OAAO;AAAA,EACP,SAAS;AACX,GAAG;AAAA,oBACgC,QAAQ;AAAA,IACvC,MAAM;AAAA,IACN,GAAG;AAAA,EAAA,CACJ;AACH,GAAG,EAAE,GAuBuBC,IAAiBC,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,OAAO,CAAC;AAAA,IACR,WAAW,CAAC;AAAA,IACZ,OAAO,EAAE,SAAS,UAAU;AAAA,IAC5B,oBAAoB,CAAC;AAAA,IACrB,OAAO,CAAC;AAAA,EACV;AAAA,EACA,MAAMC,GAAc;AAEtB,UAAMC,IAAQD,GAIRE,IAAUC,EAAS,MAAM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AAO,CAACwB,OAChB;AAAA,UACL,MAAMA,EAAK;AAAA,UACX,IAAIhB,EAAS,CAACY,MAAS;AAAA,YACrBX,EAAYT,EAAK,QAAQwB,EAAK,KAAKH,EAAgBC,EAAoBF,CAAI,CAAC,CAAC;AAAA,UAAA,CAC9E;AAAA,QAAA,EAEJ;AAAA,MAAA,CACF,GAAG,MAAM,CAAC,YAAY,MAAM,SAAS,aAAa,SAAS,sBAAsB,OAAO,CAAC;AAAA,OACzF,CAAC;AAAA,EAEN;AAEA,CAAC;"}
1
+ {"version":3,"file":"index64.js","sources":["../src/components/BbDropdownButton/BbDropdownButton.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, mergeProps as _mergeProps, withCtx as _withCtx, createVNode as _createVNode, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderList as _renderList, createSlots as _createSlots, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-dropdown-button__dropdown-label\" }\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"svg\", {\n class: \"bb-dropdown-button__dropdown-chevron\",\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 24 24\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n fill: \"currentColor\",\n d: \"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6l1.41 1.41Z\"\n })\n], -1)\n\nimport { computed } from \"vue\";\nimport BaseButton from \"../BaseButton/BaseButton.vue\";\nimport BbDropdown from \"../BbDropdown/BbDropdown.vue\";\nimport type {\n BbDropdownProps,\n MappedItem,\n} from \"../BbDropdown/BbDropdown.vue\";\n\nexport type BbDropdownButtonProps = Pick<\n BbDropdownProps,\n | \"arrowPadding\"\n | \"block\"\n | \"disabled\"\n | \"eager\"\n | \"id\"\n | \"items\"\n | \"offset\"\n | \"padding\"\n | \"placement\"\n | \"theme\"\n | \"transitionDuration\"\n | \"width\"\n>;\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbDropdownButton',\n props: {\n arrowPadding: {},\n block: { type: Boolean },\n disabled: { type: Boolean },\n eager: { type: Boolean },\n id: {},\n items: {},\n offset: {},\n padding: {},\n placement: {},\n theme: { default: \"default\" },\n transitionDuration: {},\n width: {}\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\n\nconst mainBtn = computed(() => {\n const base = { ...props.items[0] };\n base.disabled = base.disabled || props.disabled;\n return base;\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n class: _normalizeClass([\"bb-dropdown-button\", {\n 'bb-dropdown-button--block': _ctx.block,\n [`bb-dropdown-button--theme-${props.theme}`]: props.theme,\n }])\n }, [\n _createVNode(BaseButton, _mergeProps(mainBtn.value, { class: \"bb-dropdown-button__main-btn\" }), {\n default: _withCtx(() => [\n _renderSlot(_ctx.$slots, \"left-btn\", {\n disabled: mainBtn.value.disabled,\n text: mainBtn.value.text\n })\n ]),\n _: 3\n }, 16),\n _createVNode(BbDropdown, {\n \"arrow-padding\": _ctx.arrowPadding,\n disabled: _ctx.disabled,\n eager: _ctx.eager,\n id: _ctx.id,\n items: _ctx.items,\n offset: _ctx.offset,\n padding: _ctx.padding,\n placement: _ctx.placement,\n theme: _ctx.theme,\n transitionDuration: _ctx.transitionDuration,\n width: _ctx.width\n }, _createSlots({\n activator: _withCtx(({\n props,\n opening,\n open,\n closed,\n closing,\n disabled,\n placement,\n }) => [\n _renderSlot(_ctx.$slots, \"activator\", {\n props: props,\n opening: opening,\n open: open,\n closed: closed,\n closing: closing,\n disabled: disabled,\n placement: placement\n }, () => [\n _createVNode(BaseButton, _mergeProps(props, { class: \"bb-dropdown-button__dropdown-btn\" }), {\n default: _withCtx(() => [\n _createElementVNode(\"span\", _hoisted_1, _toDisplayString(open || opening ? \"Chiudi\" : \"Apri\") + \" il menu\", 1),\n _renderSlot(_ctx.$slots, \"right-btn\", {\n opening: opening,\n open: open,\n closed: closed,\n closing: closing,\n disabled: disabled,\n placement: placement\n }, () => [\n _hoisted_2\n ])\n ]),\n _: 2\n }, 1040)\n ])\n ]),\n prepend: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"prepend\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n \"item:prepend\": _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"item:prepend\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n item: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"item\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n \"item:append\": _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"item:append\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n append: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"append\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n _: 2\n }, [\n _renderList(_ctx.items, (item) => {\n return {\n name: item.key,\n fn: _withCtx((data) => [\n _renderSlot(_ctx.$slots, item.key, _normalizeProps(_guardReactiveProps(data)))\n ])\n }\n })\n ]), 1032, [\"arrow-padding\", \"disabled\", \"eager\", \"id\", \"items\", \"offset\", \"padding\", \"placement\", \"theme\", \"transitionDuration\", \"width\"])\n ], 2))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_sfc_main","_defineComponent","__props","props","mainBtn","computed","base","_ctx","_cache","_openBlock","_createElementBlock","_normalizeClass","_createVNode","BaseButton","_mergeProps","_withCtx","_renderSlot","BbDropdown","_createSlots","opening","open","closed","closing","disabled","placement","_createElementVNode","_toDisplayString","data","_normalizeProps","_guardReactiveProps","_renderList","item"],"mappings":";;;;;AAGA,MAAMA,IAAa,EAAE,OAAO,wCACtBC,sBAA8C,OAAO;AAAA,EACzD,OAAO;AAAA,EACP,OAAO;AAAA,EACP,SAAS;AACX,GAAG;AAAA,oBACgC,QAAQ;AAAA,IACvC,MAAM;A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AoBF,CAAI,CAAC,CAAC;AAAA,QAAA,CAC/E;AAAA,QACD,gBAAgBZ,EAAS,CAACY,MAAS;AAAA,UACjCX,EAAYT,EAAK,QAAQ,gBAAgBqB,EAAgBC,EAAoBF,CAAI,CAAC,CAAC;AAAA,QAAA,CACpF;AAAA,QACD,MAAMZ,EAAS,CAACY,MAAS;AAAA,UACvBX,EAAYT,EAAK,QAAQ,QAAQqB,EAAgBC,EAAoBF,CAAI,CAAC,CAAC;AAAA,QAAA,CAC5E;AAAA,QACD,eAAeZ,EAAS,CAACY,MAAS;AAAA,UAChCX,EAAYT,EAAK,QAAQ,eAAeqB,EAAgBC,EAAoBF,CAAI,CAAC,CAAC;AAAA,QAAA,CACnF;AAAA,QACD,QAAQZ,EAAS,CAACY,MAAS;AAAA,UACzBX,EAAYT,EAAK,QAAQ,UAAUqB,EAAgBC,EAAoBF,CAAI,CAAC,CAAC;AAAA,QAAA,CAC9E;AAAA,QACD,GAAG;AAAA,MAAA,GACF;AAAA,QACDG,EAAYvB,EAAK,OAAO,CAACwB,OAChB;AAAA,UACL,MAAMA,EAAK;AAAA,UACX,IAAIhB,EAAS,CAACY,MAAS;AAAA,YACrBX,EAAYT,EAAK,QAAQwB,EAAK,KAAKH,EAAgBC,EAAoBF,CAAI,CAAC,CAAC;AAAA,UAAA,CAC9E;AAAA,QAAA,EAEJ;AAAA,MACF,CAAA,GAAG,MAAM,CAAC,iBAAiB,YAAY,SAAS,MAAM,SAAS,UAAU,WAAW,aAAa,SAAS,sBAAsB,OAAO,CAAC;AAAA,OACxI,CAAC;AAAA,EAEN;AAEA,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index66.js","sources":["../src/components/BbDropzone/BbDropzone.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, withModifiers as _withModifiers, unref as _unref, createTextVNode as _createTextVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, withCtx as _withCtx, createVNode as _createVNode, resolveDynamicComponent as _resolveDynamicComponent, normalizeClass as _normalizeClass, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = [\"onDrop\", \"onDragenter\", \"onDragover\", \"onDragleave\"]\nconst _hoisted_2 = [\"accept\", \"autofocus\", \"disabled\", \"multiple\"]\nconst _hoisted_3 = {\n class: \"bb-dropzone__submittable-label\",\n \"aria-hidden\": \"true\"\n}\nconst _hoisted_4 = [\"id\", \"name\", \"multiple\", \"disabled\"]\nconst _hoisted_5 = { class: \"bb-dropzone__errors\" }\n\nimport { computed, ref, watch } from \"vue\";\nimport { findInTree } from \"@/utilities/functions/findInTree\";\nimport { useId } from \"@/composables/useId\";\nimport BbSmoothHeight from \"../BbSmoothHeight/BbSmoothHeight.vue\";\nimport { CommonProps } from \"@/types/CommonProps\";\n\nexport type DropZoneError = ReturnType<\n (typeof createError)[keyof typeof createError]\n>;\n\nexport type BbDropzoneProps = Pick<CommonProps, \n'autofocus' |\n'disabled' |\n'errors' |\n'hasErrors' |\n'id' |\n'multiple' |\n'name' \n> & {\n /**\n * Array of mime-types or extensions to filter selectable files.\n */\n accept?: string[];\n /**\n * Maximum number of acceptable files\n */\n maxFiles?: number;\n /**\n * Max size of the files in bytes.\n */\n maxSize?: number;\n /**\n * Used by v-model.\n */\n modelValue: any;\n /**\n * HTML tag of the outer container.\n */\n tag?: string;\n}\n\n// This is the dynamic import for mime\nexport type BbDropzoneEvents = {\n (e: \"blur\", event: FocusEvent): void;\n (e: \"error\", data: DropZoneError): void;\n (e: \"focus\", event: FocusEvent): void;\n (e: \"update:modelValue\", data: any): void;\n};\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbDropzone',\n props: {\n autofocus: {},\n disabled: { type: Boolean },\n errors: {},\n hasErrors: { type: Boolean },\n id: {},\n multiple: { type: Boolean },\n name: {},\n accept: {},\n maxFiles: {},\n maxSize: {},\n modelValue: {},\n tag: { default: \"div\" }\n },\n emits: [\"blur\", \"error\", \"focus\", \"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\nlet mime: any;\n\nconst props = __props;\n\nconst emit = __emit;\n\n\n\nconst submittable = ref<any | null>(null);\n\nif (props.accept) {\n if (!Array.isArray(props.accept)) {\n throw new Error(\"Property accept is not an array\");\n }\n}\nif (props.multiple) {\n if (!Array.isArray(props.modelValue)) {\n throw new Error(\n \"Component is set to multiple but modelValue is not an array\"\n );\n }\n}\n\n/** Allow dropzone to be submittable (this is flimsy and might break) */\nwatch(\n () => props.modelValue,\n () => {\n let container = new DataTransfer();\n if (Array.isArray(props.modelValue)) {\n if (props.modelValue.length) {\n props.modelValue.forEach((file) => container.items.add(file));\n }\n } else {\n if (props.modelValue) container.items.add(props.modelValue);\n }\n if (submittable.value) {\n if (container.items.length) {\n submittable.value.files = container.files;\n } else {\n submittable.value.files = null;\n }\n }\n }\n);\n\nconst acceptedMimeTypes = ref<string[]>([]);\nconst acceptedMimeTypesString = computed(() =>\n acceptedMimeTypes.value.join(\",\")\n);\nwatch(\n () => props.accept,\n async () => {\n if (props.accept) {\n let accumulated = [];\n for (let i = 0; i < props.accept.length; i++) {\n const element = props.accept[i];\n if (element.includes(\"/\")) accumulated.push(element);\n else {\n if (!mime) mime = await import(\"mime\");\n const foundMime = mime.getType(element);\n if (!foundMime) {\n throw new Error(\n `Could not detect the correct mime associated with ${element}`\n );\n }\n accumulated.push(foundMime);\n }\n }\n acceptedMimeTypes.value = accumulated;\n }\n },\n { immediate: true }\n);\n\n/**\n * Component state\n */\nconst id = props.id || `${useId().id.value}`;\nconst containerId = `bb_dz_${id}`;\n\nconst dragging = ref(false);\n// Add a timeout to prevent browser flickering\nlet draggingTimeout: ReturnType<typeof setTimeout>;\n\nconst classes = computed(() => {\n return {\n \"bb-dropzone\": true,\n \"bb-dropzone--errors\": hasErrors.value,\n \"bb-dropzone--dragging\": dragging.value,\n };\n});\nconst slotAttributes = computed(() => {\n return {\n dragging: dragging.value,\n id: id,\n };\n});\n\n/**\n * Component handlers\n */\nconst onDrop = (event: DragEvent) => {\n dragging.value = false;\n\n if (event.dataTransfer) {\n event.stopImmediatePropagation();\n let files;\n files = Array.from(event.dataTransfer.files);\n files = parseFiles(files);\n if (props.multiple) {\n if (Array.isArray(props.modelValue)) {\n emit(\"update:modelValue\", [...props.modelValue, ...files]);\n }\n } else {\n files = files[0];\n emit(\"update:modelValue\", files);\n }\n if (event.currentTarget instanceof HTMLLabelElement) {\n const innerInput = event.currentTarget.querySelector(\"input[type=file]\");\n if (innerInput instanceof HTMLInputElement) {\n innerInput.focus();\n }\n }\n }\n};\nconst onChange = (event: Event) => {\n if (event.target instanceof HTMLInputElement) {\n if (event.target.files) {\n let files;\n files = parseFiles(Array.from(event.target.files));\n if (props.multiple) {\n if (Array.isArray(props.modelValue)) {\n emit(\"update:modelValue\", [...props.modelValue, ...files]);\n }\n } else {\n files = files[0];\n emit(\"update:modelValue\", files);\n }\n }\n event.target.value = \"\";\n event.target.files = null;\n }\n};\n\nconst parseFiles = (files: File[]) => {\n return files.filter((file, index) => {\n // Sizecheck\n if (props.maxSize) {\n let passing = file.size <= props.maxSize;\n if (!passing) {\n emit(\"error\", createError.maxSize(file));\n return false;\n }\n }\n // Uniqueness check\n let alreadyExists = false;\n if (props.modelValue) {\n if (Array.isArray(props.modelValue)) {\n alreadyExists = props.modelValue.some((current) =>\n compareFiles(current, file)\n );\n } else {\n alreadyExists = compareFiles(props.modelValue, file);\n }\n }\n if (alreadyExists) {\n emit(\"error\", createError.uniqueness(file));\n return false;\n }\n // Mime type check\n if (props.accept) {\n const mimePassed = acceptedMimeTypes.value.some((mime) => {\n let found = false;\n if (mime.includes(\"*\"))\n found = found || mime.split(\"/\")[0] === file.type.split(\"/\")[0];\n else found = found || mime === file.type;\n return found;\n });\n if (!mimePassed) {\n emit(\"error\", createError.accept(file));\n return false;\n }\n }\n // Max files check\n if (props.maxFiles) {\n if (Array.isArray(props.modelValue)) {\n if (props.modelValue.length + index + 1 > props.maxFiles) {\n emit(\n \"error\",\n createError.maxFiles(file, props.modelValue.length + index + 1)\n );\n return false;\n }\n }\n }\n return true;\n });\n};\n\nconst onDragOver = (event: Event) => {\n // Find the closest dropzone in case of nested dropzones\n const target = event.target;\n if (target instanceof HTMLElement) {\n const closestDropzone = findInTree([target], \"parentElement\", (el) =>\n el.classList.contains(\"bb-dropzone\")\n );\n if (closestDropzone) {\n /* When dragging over this dropzone set as dragging */\n if (closestDropzone.id === containerId) {\n setDragging();\n /* When dragging over a nested dropzone do not highlight this dropzone */\n } else {\n unsetDragging();\n }\n }\n }\n};\n\nconst setDragging = () => {\n clearTimeout(draggingTimeout);\n dragging.value = true;\n};\n\nconst unsetDragging = () => {\n draggingTimeout = setTimeout(() => {\n dragging.value = false;\n }, 100);\n};\n\nconst bytesToUnit = (bytes: number, decimals = 2) => {\n if (!bytes) return \"0 B\";\n const k = 1024;\n const dm = decimals || 0;\n const sizes = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\"];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + \" \" + sizes[i];\n};\n\n/**\n * Returns true if files are identical by the properties that are accessible\n * @param file The file to check\n * @param otherFile The file to check against\n */\nconst compareFiles = (file: File, otherFile: File) => {\n const properties: (keyof File)[] = [\"name\", \"size\", \"lastModified\", \"type\"];\n return !properties.some((key) => file[key] !== otherFile[key]);\n};\n\n/**\n * Helper that creates errors based on component properties\n */\nconst createError = {\n maxSize: (file: File) => {\n // Todo update to isNil\n if (props.maxSize) {\n return {\n type: \"maxSize\",\n file: file,\n formattedMaxSize: bytesToUnit(+props.maxSize),\n formattedSize: bytesToUnit(file.size),\n filename: file.name,\n };\n }\n },\n uniqueness: (file: File) => {\n // Todo update to isNil\n if (props.maxSize) {\n return {\n type: \"uniqueness\",\n file: file,\n filename: file.name,\n };\n }\n },\n accept: (file: File) => {\n return {\n type: \"accept\",\n file: file,\n acceptedMimeTypes: acceptedMimeTypes.value,\n mimeType: file.type,\n filename: file.name,\n };\n },\n maxFiles: (file: File, totalFiles: number) => {\n return {\n type: \"maxFiles\",\n file: file,\n maxFiles: props.maxFiles,\n totalFiles,\n filename: file.name,\n };\n },\n};\n\nconst computedErrors = computed(() => {\n return props.errors ? ([] as string[]).concat(props.errors) : [];\n});\n\nconst hasErrors = computed(\n () => Boolean(computedErrors.value.length) || props.hasErrors\n);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(_resolveDynamicComponent(_ctx.tag), {\n class: _normalizeClass(classes.value),\n id: containerId\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"label\", {\n onDrop: _withModifiers(onDrop, [\"prevent\"]),\n onDragenter: _withModifiers(setDragging, [\"prevent\"]),\n onDragover: _withModifiers(onDragOver, [\"prevent\"]),\n onDragleave: _withModifiers(unsetDragging, [\"prevent\"])\n }, [\n _createElementVNode(\"input\", {\n type: \"file\",\n accept: acceptedMimeTypesString.value,\n autofocus: _ctx.autofocus,\n disabled: _ctx.disabled,\n multiple: _ctx.multiple,\n onChange: onChange,\n onFocus: _cache[0] || (_cache[0] = (event) => _ctx.$emit('focus', event)),\n onBlur: _cache[1] || (_cache[1] = (event) => _ctx.$emit('blur', event))\n }, null, 40, _hoisted_2),\n _renderSlot(_ctx.$slots, \"default\", _normalizeProps(_guardReactiveProps(slotAttributes.value)))\n ], 40, _hoisted_1),\n _createElementVNode(\"label\", _hoisted_3, [\n _createTextVNode(\" Server files \"),\n _createElementVNode(\"input\", {\n class: \"bb-dropzone__submittable-input\",\n type: \"file\",\n id: _unref(id),\n name: _ctx.name,\n ref_key: \"submittable\",\n ref: submittable,\n multiple: _ctx.multiple,\n disabled: _ctx.disabled\n }, null, 8, _hoisted_4)\n ]),\n _createElementVNode(\"span\", _hoisted_5, [\n _createVNode(BbSmoothHeight, { tag: \"span\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(computedErrors.value, (error) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n class: \"bb-dropzone__error\",\n key: error\n }, _toDisplayString(error), 1))\n }), 128))\n ]),\n _: 1\n })\n ])\n ]),\n _: 3\n }, 8, [\"class\"]))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_sfc_main","_defineComponent","__props","__emit","mime","props","emit","submittable","ref","watch","container","file","acceptedMimeTypes","acceptedMimeTypesString","computed","accumulated","i","element","foundMime","id","useId","containerId","dragging","draggingTimeout","classes","hasErrors","slotAttributes","onDrop","event","files","parseFiles","innerInput","onChange","index","createError","alreadyExists","current","compareFiles","found","onDragOver","target","closestDropzone","findInTree","el","setDragging","unsetDragging","bytesToUnit","bytes","decimals","k","dm","sizes","otherFile","key","totalFiles","computedErrors","_ctx","_cache","_openBlock","_createBlock","_resolveDynamicComponent","_normalizeClass","_withCtx","_createElementVNode","_withModifiers","_renderSlot","_normalizeProps","_guardReactiveProps","_createTextVNode","_unref","_createVNode","BbSmoothHeight","_createElementBlock","_Fragment","_renderList","error","_toDisplayString"],"mappings":";;;;;AAGA,MAAMA,KAAa,CAAC,UAAU,eAAe,cAAc,aAAa,GAClEC,KAAa,CAAC,UAAU,aAAa,YAAY,UAAU,GAC3DC,KAAa;AAAA,EACjB,OAAO;AAAA,EACP,eAAe;AACjB,GACMC,KAAa,CAAC,MAAM,QAAQ,YAAY,UAAU,GAClDC,KAAa,EAAE,OAAO,yBAmDAC,KAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,WAAW,CAAC;AAAA,IACZ,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,QAAQ,CAAC;AAAA,IACT,WAAW,EAAE,MAAM,QAAQ;AAAA,IAC3B,IAAI,CAAC;AAAA,IACL,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J,GAAAC,EAAiBD,CAAK,GAAG,CAAC,EAC9B,GAAG,GAAG;AAAA,YAAA,CACR;AAAA,YACD,GAAG;AAAA,UAAA,CACJ;AAAA,QAAA,CACF;AAAA,MAAA,CACF;AAAA,MACD,GAAG;AAAA,IAAA,GACF,GAAG,CAAC,OAAO,CAAC;AAAA,EAEjB;AAEA,CAAC;"}
1
+ {"version":3,"file":"index66.js","sources":["../src/components/BbDropzone/BbDropzone.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, withModifiers as _withModifiers, unref as _unref, createTextVNode as _createTextVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, withCtx as _withCtx, createVNode as _createVNode, resolveDynamicComponent as _resolveDynamicComponent, normalizeClass as _normalizeClass, createBlock as _createBlock } from \"vue\"\n\nconst _hoisted_1 = [\"onDrop\", \"onDragenter\", \"onDragover\", \"onDragleave\"]\nconst _hoisted_2 = [\"accept\", \"autofocus\", \"disabled\", \"multiple\"]\nconst _hoisted_3 = {\n class: \"bb-dropzone__submittable-label\",\n \"aria-hidden\": \"true\"\n}\nconst _hoisted_4 = [\"id\", \"name\", \"multiple\", \"disabled\"]\nconst _hoisted_5 = { class: \"bb-dropzone__errors\" }\n\nimport { computed, ref, watch } from \"vue\";\nimport { findInTree } from \"@/utilities/functions/findInTree\";\nimport { useId } from \"@/composables/useId\";\nimport BbSmoothHeight from \"../BbSmoothHeight/BbSmoothHeight.vue\";\nimport { CommonProps, NonVoidElementTag } from \"@/types/CommonProps\";\n\nexport type DropZoneError = ReturnType<\n (typeof createError)[keyof typeof createError]\n>;\n\nexport type BbDropzoneProps = Pick<CommonProps, \n'autofocus' |\n'disabled' |\n'errors' |\n'hasErrors' |\n'id' |\n'multiple' |\n'name'\n> & {\n /**\n * Array of mime-types or extensions to filter selectable files.\n */\n accept?: string[];\n /**\n * Maximum number of acceptable files\n */\n maxFiles?: number;\n /**\n * Max size of the files in bytes.\n */\n maxSize?: number;\n /**\n * Used by v-model.\n */\n modelValue: any;\n} & NonVoidElementTag\n\n// This is the dynamic import for mime\nexport type BbDropzoneEvents = {\n (e: \"blur\", event: FocusEvent): void;\n (e: \"error\", data: DropZoneError): void;\n (e: \"focus\", event: FocusEvent): void;\n (e: \"update:modelValue\", data: any): void;\n};\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbDropzone',\n props: {\n autofocus: {},\n disabled: { type: Boolean },\n errors: {},\n hasErrors: { type: Boolean },\n id: {},\n multiple: { type: Boolean },\n name: {},\n accept: {},\n maxFiles: {},\n maxSize: {},\n modelValue: {},\n tag: { default: \"div\" }\n },\n emits: [\"blur\", \"error\", \"focus\", \"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\nlet mime: any;\n\nconst props = __props;\n\nconst emit = __emit;\n\n\n\nconst submittable = ref<any | null>(null);\n\nif (props.accept) {\n if (!Array.isArray(props.accept)) {\n throw new Error(\"Property accept is not an array\");\n }\n}\nif (props.multiple) {\n if (!Array.isArray(props.modelValue)) {\n throw new Error(\n \"Component is set to multiple but modelValue is not an array\"\n );\n }\n}\n\n/** Allow dropzone to be submittable (this is flimsy and might break) */\nwatch(\n () => props.modelValue,\n () => {\n let container = new DataTransfer();\n if (Array.isArray(props.modelValue)) {\n if (props.modelValue.length) {\n props.modelValue.forEach((file) => container.items.add(file));\n }\n } else {\n if (props.modelValue) container.items.add(props.modelValue);\n }\n if (submittable.value) {\n if (container.items.length) {\n submittable.value.files = container.files;\n } else {\n submittable.value.files = null;\n }\n }\n }\n);\n\nconst acceptedMimeTypes = ref<string[]>([]);\nconst acceptedMimeTypesString = computed(() =>\n acceptedMimeTypes.value.join(\",\")\n);\nwatch(\n () => props.accept,\n async () => {\n if (props.accept) {\n let accumulated = [];\n for (let i = 0; i < props.accept.length; i++) {\n const element = props.accept[i];\n if (element.includes(\"/\")) accumulated.push(element);\n else {\n if (!mime) mime = await import(\"mime\");\n const foundMime = mime.getType(element);\n if (!foundMime) {\n throw new Error(\n `Could not detect the correct mime associated with ${element}`\n );\n }\n accumulated.push(foundMime);\n }\n }\n acceptedMimeTypes.value = accumulated;\n }\n },\n { immediate: true }\n);\n\n/**\n * Component state\n */\nconst id = props.id || `${useId().id.value}`;\nconst containerId = `bb_dz_${id}`;\n\nconst dragging = ref(false);\n// Add a timeout to prevent browser flickering\nlet draggingTimeout: ReturnType<typeof setTimeout>;\n\nconst classes = computed(() => {\n return {\n \"bb-dropzone\": true,\n \"bb-dropzone--errors\": hasErrors.value,\n \"bb-dropzone--dragging\": dragging.value,\n };\n});\nconst slotAttributes = computed(() => {\n return {\n dragging: dragging.value,\n id: id,\n };\n});\n\n/**\n * Component handlers\n */\nconst onDrop = (event: DragEvent) => {\n dragging.value = false;\n\n if (event.dataTransfer) {\n event.stopImmediatePropagation();\n let files;\n files = Array.from(event.dataTransfer.files);\n files = parseFiles(files);\n if (props.multiple) {\n if (Array.isArray(props.modelValue)) {\n emit(\"update:modelValue\", [...props.modelValue, ...files]);\n }\n } else {\n files = files[0];\n emit(\"update:modelValue\", files);\n }\n if (event.currentTarget instanceof HTMLLabelElement) {\n const innerInput = event.currentTarget.querySelector(\"input[type=file]\");\n if (innerInput instanceof HTMLInputElement) {\n innerInput.focus();\n }\n }\n }\n};\nconst onChange = (event: Event) => {\n if (event.target instanceof HTMLInputElement) {\n if (event.target.files) {\n let files;\n files = parseFiles(Array.from(event.target.files));\n if (props.multiple) {\n if (Array.isArray(props.modelValue)) {\n emit(\"update:modelValue\", [...props.modelValue, ...files]);\n }\n } else {\n files = files[0];\n emit(\"update:modelValue\", files);\n }\n }\n event.target.value = \"\";\n event.target.files = null;\n }\n};\n\nconst parseFiles = (files: File[]) => {\n return files.filter((file, index) => {\n // Sizecheck\n if (props.maxSize) {\n let passing = file.size <= props.maxSize;\n if (!passing) {\n emit(\"error\", createError.maxSize(file));\n return false;\n }\n }\n // Uniqueness check\n let alreadyExists = false;\n if (props.modelValue) {\n if (Array.isArray(props.modelValue)) {\n alreadyExists = props.modelValue.some((current) =>\n compareFiles(current, file)\n );\n } else {\n alreadyExists = compareFiles(props.modelValue, file);\n }\n }\n if (alreadyExists) {\n emit(\"error\", createError.uniqueness(file));\n return false;\n }\n // Mime type check\n if (props.accept) {\n const mimePassed = acceptedMimeTypes.value.some((mime) => {\n let found = false;\n if (mime.includes(\"*\"))\n found = found || mime.split(\"/\")[0] === file.type.split(\"/\")[0];\n else found = found || mime === file.type;\n return found;\n });\n if (!mimePassed) {\n emit(\"error\", createError.accept(file));\n return false;\n }\n }\n // Max files check\n if (props.maxFiles) {\n if (Array.isArray(props.modelValue)) {\n if (props.modelValue.length + index + 1 > props.maxFiles) {\n emit(\n \"error\",\n createError.maxFiles(file, props.modelValue.length + index + 1)\n );\n return false;\n }\n }\n }\n return true;\n });\n};\n\nconst onDragOver = (event: Event) => {\n // Find the closest dropzone in case of nested dropzones\n const target = event.target;\n if (target instanceof HTMLElement) {\n const closestDropzone = findInTree([target], \"parentElement\", (el) =>\n el.classList.contains(\"bb-dropzone\")\n );\n if (closestDropzone) {\n /* When dragging over this dropzone set as dragging */\n if (closestDropzone.id === containerId) {\n setDragging();\n /* When dragging over a nested dropzone do not highlight this dropzone */\n } else {\n unsetDragging();\n }\n }\n }\n};\n\nconst setDragging = () => {\n clearTimeout(draggingTimeout);\n dragging.value = true;\n};\n\nconst unsetDragging = () => {\n draggingTimeout = setTimeout(() => {\n dragging.value = false;\n }, 100);\n};\n\nconst bytesToUnit = (bytes: number, decimals = 2) => {\n if (!bytes) return \"0 B\";\n const k = 1024;\n const dm = decimals || 0;\n const sizes = [\"B\", \"KB\", \"MB\", \"GB\", \"TB\", \"PB\", \"EB\", \"ZB\", \"YB\"];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + \" \" + sizes[i];\n};\n\n/**\n * Returns true if files are identical by the properties that are accessible\n * @param file The file to check\n * @param otherFile The file to check against\n */\nconst compareFiles = (file: File, otherFile: File) => {\n const properties: (keyof File)[] = [\"name\", \"size\", \"lastModified\", \"type\"];\n return !properties.some((key) => file[key] !== otherFile[key]);\n};\n\n/**\n * Helper that creates errors based on component properties\n */\nconst createError = {\n maxSize: (file: File) => {\n // Todo update to isNil\n if (props.maxSize) {\n return {\n type: \"maxSize\",\n file: file,\n formattedMaxSize: bytesToUnit(+props.maxSize),\n formattedSize: bytesToUnit(file.size),\n filename: file.name,\n };\n }\n },\n uniqueness: (file: File) => {\n // Todo update to isNil\n if (props.maxSize) {\n return {\n type: \"uniqueness\",\n file: file,\n filename: file.name,\n };\n }\n },\n accept: (file: File) => {\n return {\n type: \"accept\",\n file: file,\n acceptedMimeTypes: acceptedMimeTypes.value,\n mimeType: file.type,\n filename: file.name,\n };\n },\n maxFiles: (file: File, totalFiles: number) => {\n return {\n type: \"maxFiles\",\n file: file,\n maxFiles: props.maxFiles,\n totalFiles,\n filename: file.name,\n };\n },\n};\n\nconst computedErrors = computed(() => {\n return props.errors ? ([] as string[]).concat(props.errors) : [];\n});\n\nconst hasErrors = computed(\n () => Boolean(computedErrors.value.length) || props.hasErrors\n);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(_resolveDynamicComponent(_ctx.tag), {\n class: _normalizeClass(classes.value),\n id: containerId\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"label\", {\n onDrop: _withModifiers(onDrop, [\"prevent\"]),\n onDragenter: _withModifiers(setDragging, [\"prevent\"]),\n onDragover: _withModifiers(onDragOver, [\"prevent\"]),\n onDragleave: _withModifiers(unsetDragging, [\"prevent\"])\n }, [\n _createElementVNode(\"input\", {\n type: \"file\",\n accept: acceptedMimeTypesString.value,\n autofocus: _ctx.autofocus,\n disabled: _ctx.disabled,\n multiple: _ctx.multiple,\n onChange: onChange,\n onFocus: _cache[0] || (_cache[0] = (event) => _ctx.$emit('focus', event)),\n onBlur: _cache[1] || (_cache[1] = (event) => _ctx.$emit('blur', event))\n }, null, 40, _hoisted_2),\n _renderSlot(_ctx.$slots, \"default\", _normalizeProps(_guardReactiveProps(slotAttributes.value)))\n ], 40, _hoisted_1),\n _createElementVNode(\"label\", _hoisted_3, [\n _createTextVNode(\" Server files \"),\n _createElementVNode(\"input\", {\n class: \"bb-dropzone__submittable-input\",\n type: \"file\",\n id: _unref(id),\n name: _ctx.name,\n ref_key: \"submittable\",\n ref: submittable,\n multiple: _ctx.multiple,\n disabled: _ctx.disabled\n }, null, 8, _hoisted_4)\n ]),\n _createElementVNode(\"span\", _hoisted_5, [\n _createVNode(BbSmoothHeight, { tag: \"span\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(computedErrors.value, (error) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n class: \"bb-dropzone__error\",\n key: error\n }, _toDisplayString(error), 1))\n }), 128))\n ]),\n _: 1\n })\n ])\n ]),\n _: 3\n }, 8, [\"class\"]))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_sfc_main","_defineComponent","__props","__emit","mime","props","emit","submittable","ref","watch","container","file","acceptedMimeTypes","acceptedMimeTypesString","computed","accumulated","i","element","foundMime","id","useId","containerId","dragging","draggingTimeout","classes","hasErrors","slotAttributes","onDrop","event","files","parseFiles","innerInput","onChange","index","createError","alreadyExists","current","compareFiles","found","onDragOver","target","closestDropzone","findInTree","el","setDragging","unsetDragging","bytesToUnit","bytes","decimals","k","dm","sizes","otherFile","key","totalFiles","computedErrors","_ctx","_cache","_openBlock","_createBlock","_resolveDynamicComponent","_normalizeClass","_withCtx","_createElementVNode","_withModifiers","_renderSlot","_normalizeProps","_guardReactiveProps","_createTextVNode","_unref","_createVNode","BbSmoothHeight","_createElementBlock","_Fragment","_renderList","error","_toDisplayString"],"mappings":";;;;;AAGA,MA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b,MAAMqC,EAAK;AAAA,YACX,SAAS;AAAA,YACT,KAAKjD;AAAA,YACL,UAAUiD,EAAK;AAAA,YACf,UAAUA,EAAK;AAAA,UAAA,GACd,MAAM,GAAG1D,EAAU;AAAA,QAAA,CACvB;AAAA,QACDiE,EAAoB,QAAQhE,IAAY;AAAA,UACtCuE,EAAaC,IAAgB,EAAE,KAAK,UAAU;AAAA,YAC5C,SAAST,EAAS,MAAM;AAAA,eACrBJ,EAAW,EAAI,GAAGc,EAAoBC,GAAW,MAAMC,EAAYnB,EAAe,OAAO,CAACoB,OACjFjB,EAAA,GAAcc,EAAoB,QAAQ;AAAA,gBAChD,OAAO;AAAA,gBACP,KAAKG;AAAA,cACJ,GAAAC,EAAiBD,CAAK,GAAG,CAAC,EAC9B,GAAG,GAAG;AAAA,YAAA,CACR;AAAA,YACD,GAAG;AAAA,UAAA,CACJ;AAAA,QAAA,CACF;AAAA,MAAA,CACF;AAAA,MACD,GAAG;AAAA,IAAA,GACF,GAAG,CAAC,OAAO,CAAC;AAAA,EAEjB;AAEA,CAAC;"}
package/dist/index69.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as h, ref as t, onMounted as m, onBeforeUnmount as p, openBlock as g, createBlock as b, resolveDynamicComponent as w, withCtx as _, renderSlot as I } from "vue";
2
- import { throttle as c } from "./index194.js";
2
+ import { throttle as c } from "./index195.js";
3
3
  const M = /* @__PURE__ */ h({
4
4
  __name: "BbIntersection",
5
5
  props: {
package/dist/index72.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as G, ref as o, useAttrs as J, computed as p, onMounted as Q, watch as U, openBlock as b, createBlock as X, Teleport as Y, createElementVNode as s, mergeProps as N, createElementBlock as w, renderSlot as n, createTextVNode as Z, toDisplayString as z, createCommentVNode as B, nextTick as ee } from "vue";
2
- import { useFocusTrap as te } from "./index195.js";
2
+ import { useFocusTrap as te } from "./index196.js";
3
3
  import { useId as L } from "./index120.js";
4
4
  import { wait as E } from "./index119.js";
5
5
  const se = { class: "bb-offcanvas-close" }, oe = { class: "bb-offcanvas-close__content" }, ae = { class: "bb-offcanvas-close__label" }, le = /* @__PURE__ */ s("span", { class: "bb-offcanvas-close__icon" }, [
@@ -1 +1 @@
1
- {"version":3,"file":"index74.js","sources":["../src/components/BbPagination/BbPagination.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass } from \"vue\"\n\nconst _hoisted_1 = { \"aria-label\": \"Navigazione\" }\nconst _hoisted_2 = [\"disabled\"]\nconst _hoisted_3 = [\"onClick\", \"disabled\"]\nconst _hoisted_4 = [\"disabled\"]\n\nimport { computed, nextTick, onBeforeUnmount, onMounted, ref } from \"vue\";\nimport { debounce } from \"@/utilities/functions/debounce\";\nimport type { CommonProps } from \"@/types/CommonProps\";\n\nexport type BbPaginationProps = Pick<CommonProps, \n'disabled' | 'loading'\n> & {\n /**\n * String of text displayed in place of hidden pages\n */\n ellipsis?: string;\n /**\n * Maximum number of clickable pages displayed at all times. \n * This has a tolerance of +/- 1 for odd / even numbering.\n * It does not include ellipses.\n */\n maxSize?: number | string;\n /**\n * Used by v-model. Indicates the current page.\n */\n modelValue?: number;\n /**\n * Total number of pages there is.\n */\n totalPages?: number | string;\n}\n\nexport type BbPaginationEvents = {\n (e: \"update:modelValue\", value: number): void;\n};\n\ntype Item = {\n active: boolean;\n key: string;\n page: string;\n ellipsis: true;\n disabled: boolean;\n} | {\n active: boolean;\n key: number;\n page: number;\n ellipsis: false;\n disabled: boolean;\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbPagination',\n props: {\n disabled: { type: Boolean },\n loading: { type: Boolean },\n ellipsis: { default: \"...\" },\n maxSize: { default: 5 },\n modelValue: { default: 1 },\n totalPages: { default: 1 }\n },\n emits: [\"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\nconst props = __props;\n\nconst emit = __emit;\n\n\n\nconst totalPages = computed(() => +props.totalPages);\nconst start = ref(1);\nconst maxSize = ref(+props.maxSize);\n\nconst outercontainer = ref<HTMLElement>();\nconst innercontainer = ref<HTMLElement>();\n\nconst buttonFootprint = ref<number>(Infinity);\n\n/**\n * Adjusts how many buttons to show.\n * if current buttons can't fit subtract maxSize until they do or until minimum is reached\n * if more buttons could fit add buttons until the don't\n * If minimum or maximum is reached just quit until next resize\n */\nconst adjustMaxElements = () => {\n if (outercontainer.value && innercontainer.value) {\n /* If some buttons do not fit */\n if (outercontainer.value.clientWidth < innercontainer.value.clientWidth) {\n if (maxSize.value - 1 > 3) {\n maxSize.value--;\n nextTick(adjustMaxElements);\n } else {\n maxSize.value = 3;\n }\n /* If all current buttons do fit */\n } else {\n /* If some buttons have been hidden */\n if (maxSize.value < +props.maxSize) {\n if (\n /* If there is enough space to fit one */\n outercontainer.value.clientWidth - innercontainer.value.clientWidth >\n buttonFootprint.value\n ) {\n maxSize.value = Math.min(maxSize.value + 1, +props.maxSize);\n nextTick(adjustMaxElements);\n }\n }\n }\n }\n};\nif (globalThis.ResizeObserver) {\n const observer = new ResizeObserver(debounce(adjustMaxElements, 200));\n onMounted(() => {\n if (outercontainer.value && innercontainer.value) {\n const button = outercontainer.value.querySelectorAll(\n \".bb-pagination__page\"\n )[1];\n if (button) {\n /* Compute the footprint necessary to render a new button */\n const gapString = getComputedStyle(innercontainer.value).columnGap;\n const numberAsString = gapString.replaceAll(/\\D/g, \"\");\n const gap = Number(numberAsString);\n buttonFootprint.value = button.clientWidth + gap;\n }\n observer.observe(outercontainer.value);\n }\n });\n onBeforeUnmount(() => {\n observer.disconnect();\n });\n}\n\nconst range = computed(() => {\n if (\n totalPages.value <= 0 ||\n isNaN(totalPages.value) ||\n totalPages.value > Number.MAX_SAFE_INTEGER\n )\n return [];\n\n if (maxSize.value <= 1) return [props.modelValue];\n\n if (totalPages.value <= maxSize.value) {\n return createRange(totalPages.value, start.value);\n }\n\n const even = maxSize.value % 2 === 0;\n const middle = even ? maxSize.value / 2 : Math.floor(maxSize.value / 2);\n const left = even ? middle : middle + 1;\n const right = totalPages.value - middle;\n\n if (left - props.modelValue >= 0) {\n return [\n ...createRange(Math.max(1, maxSize.value - 1), start.value),\n props.ellipsis,\n totalPages.value,\n ];\n } else if (props.modelValue - right >= (even ? 1 : 0)) {\n const rangeLength = maxSize.value - 1;\n const rangeStart = totalPages.value - rangeLength + start.value;\n return [\n start.value,\n props.ellipsis,\n ...createRange(rangeLength, rangeStart),\n ];\n } else {\n const rangeLength = Math.max(1, maxSize.value - 3);\n const rangeStart =\n rangeLength === 1\n ? props.modelValue\n : props.modelValue - Math.ceil(rangeLength / 2) + start.value;\n return [\n start.value,\n props.ellipsis,\n ...createRange(rangeLength, rangeStart),\n props.ellipsis,\n totalPages.value,\n ];\n }\n});\n\nconst items = computed<Item[]>(() => {\n return range.value.map((item, index) => {\n if (typeof item === \"string\") {\n return {\n active: false,\n key: `ellipsis-${index}`,\n page: item,\n ellipsis: true,\n disabled: true,\n };\n } else {\n const active = item === props.modelValue;\n return {\n active,\n key: item,\n page: item,\n ellipsis: false,\n disabled: !!props.disabled || +props.totalPages < 2 || props.loading,\n };\n }\n });\n});\n\nconst createRange = (length: number, start = 0): number[] => {\n return Array.from({ length }, (_, k) => start + k);\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"bb-pagination\",\n ref_key: \"outercontainer\",\n ref: outercontainer\n }, [\n _createElementVNode(\"nav\", _hoisted_1, [\n _createElementVNode(\"ul\", {\n class: \"bb-pagination__pages\",\n ref_key: \"innercontainer\",\n ref: innercontainer\n }, [\n _createElementVNode(\"li\", null, [\n _createElementVNode(\"button\", {\n class: \"bb-pagination__page bb-pagination__page--previous\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (emit('update:modelValue', props.modelValue - 1))),\n disabled: props.modelValue <= 1 || _ctx.loading || _ctx.disabled\n }, [\n _renderSlot(_ctx.$slots, \"previous\", {}, () => [\n _createTextVNode(\"Precedente\")\n ])\n ], 8, _hoisted_2)\n ]),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items.value, (item) => {\n return (_openBlock(), _createElementBlock(\"li\", null, [\n _createElementVNode(\"button\", {\n class: _normalizeClass([\"bb-pagination__page\", {\n 'bb-pagination__page--active': item.active,\n 'bb-pagination__page--ellipsis': item.ellipsis,\n }]),\n onClick: ($event: any) => (emit('update:modelValue', item.key)),\n disabled: item.disabled\n }, [\n (item.ellipsis === true)\n ? _renderSlot(_ctx.$slots, \"ellipsis\", { key: 0 }, () => [\n _createTextVNode(_toDisplayString(props.ellipsis), 1)\n ])\n : _renderSlot(_ctx.$slots, \"item\", {\n key: 1,\n active: item.active,\n disabled: item.disabled,\n item: item.key\n }, () => [\n _createTextVNode(_toDisplayString(item.key), 1)\n ])\n ], 10, _hoisted_3)\n ]))\n }), 256)),\n _createElementVNode(\"li\", null, [\n _createElementVNode(\"button\", {\n class: \"bb-pagination__page bb-pagination__page--next\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (emit('update:modelValue', props.modelValue + 1))),\n disabled: props.modelValue >= +totalPages.value || _ctx.loading || _ctx.disabled\n }, [\n _renderSlot(_ctx.$slots, \"next\", {}, () => [\n _createTextVNode(\"Successivi\")\n ])\n ], 8, _hoisted_4)\n ])\n ], 512)\n ])\n ], 512))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_sfc_main","_defineComponent","__props","__emit","props","emit","totalPages","computed","start","ref","maxSize","outercontainer","innercontainer","buttonFootprint","adjustMaxElements","nextTick","observer","debounce","onMounted","button","numberAsString","gap","onBeforeUnmount","range","createRange","even","middle","left","right","rangeLength","rangeStart","items","item","index","length","_","k","_ctx","_cache","_openBlock","_createElementBlock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AC9BA,EAAoB,UAAU;AAAA,cAC5B,OAAO;AAAA,cACP,SAASH,EAAO,CAAC,MAAMA,EAAO,CAAC,IAAI,CAACI,MAAiBrC,EAAK,qBAAqBD,EAAM,aAAa,CAAC;AAAA,cACnG,UAAUA,EAAM,cAAc,CAACE,EAAW,SAAS+B,EAAK,WAAWA,EAAK;AAAA,YAAA,GACvE;AAAA,cACDM,EAAYN,EAAK,QAAQ,QAAQ,IAAI,MAAM;AAAA,gBACzCO,EAAiB,YAAY;AAAA,cAAA,CAC9B;AAAA,YAAA,GACA,GAAG7C,CAAU;AAAA,UAAA,CACjB;AAAA,WACA,GAAG;AAAA,MAAA,CACP;AAAA,OACA,GAAG;AAAA,EAER;AAEA,CAAC;"}
1
+ {"version":3,"file":"index74.js","sources":["../src/components/BbPagination/BbPagination.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass } from \"vue\"\n\nconst _hoisted_1 = { \"aria-label\": \"Navigazione\" }\nconst _hoisted_2 = [\"disabled\"]\nconst _hoisted_3 = [\"onClick\", \"disabled\"]\nconst _hoisted_4 = [\"disabled\"]\n\nimport { computed, nextTick, onBeforeUnmount, onMounted, ref } from \"vue\";\nimport { debounce } from \"@/utilities/functions/debounce\";\nimport type { CommonProps } from \"@/types/CommonProps\";\n\nexport type BbPaginationProps = Pick<CommonProps, \n'disabled' | 'loading'\n> & {\n /**\n * String of text displayed in place of hidden pages\n */\n ellipsis?: string;\n /**\n * Maximum number of clickable pages displayed at all times. \n * This has a tolerance of +/- 1 for odd / even numbering.\n * It does not include ellipses.\n */\n maxSize?: number | string;\n /**\n * Used by v-model. Indicates the current page.\n */\n modelValue: number;\n /**\n * Total number of pages there is.\n */\n totalPages?: number | string;\n}\n\nexport type BbPaginationEvents = {\n (e: \"update:modelValue\", value: number): void;\n};\n\ntype Item = {\n active: boolean;\n key: string;\n page: string;\n ellipsis: true;\n disabled: boolean;\n} | {\n active: boolean;\n key: number;\n page: number;\n ellipsis: false;\n disabled: boolean;\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbPagination',\n props: {\n disabled: { type: Boolean },\n loading: { type: Boolean },\n ellipsis: { default: \"...\" },\n maxSize: { default: 5 },\n modelValue: { default: 1 },\n totalPages: { default: 1 }\n },\n emits: [\"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\nconst props = __props;\n\nconst emit = __emit;\n\n\n\nconst totalPages = computed(() => +props.totalPages);\nconst start = ref(1);\nconst maxSize = ref(+props.maxSize);\n\nconst outercontainer = ref<HTMLElement>();\nconst innercontainer = ref<HTMLElement>();\n\nconst buttonFootprint = ref<number>(Infinity);\n\n/**\n * Adjusts how many buttons to show.\n * if current buttons can't fit subtract maxSize until they do or until minimum is reached\n * if more buttons could fit add buttons until the don't\n * If minimum or maximum is reached just quit until next resize\n */\nconst adjustMaxElements = () => {\n if (outercontainer.value && innercontainer.value) {\n /* If some buttons do not fit */\n if (outercontainer.value.clientWidth < innercontainer.value.clientWidth) {\n if (maxSize.value - 1 > 3) {\n maxSize.value--;\n nextTick(adjustMaxElements);\n } else {\n maxSize.value = 3;\n }\n /* If all current buttons do fit */\n } else {\n /* If some buttons have been hidden */\n if (maxSize.value < +props.maxSize) {\n if (\n /* If there is enough space to fit one */\n outercontainer.value.clientWidth - innercontainer.value.clientWidth >\n buttonFootprint.value\n ) {\n maxSize.value = Math.min(maxSize.value + 1, +props.maxSize);\n nextTick(adjustMaxElements);\n }\n }\n }\n }\n};\nif (globalThis.ResizeObserver) {\n const observer = new ResizeObserver(debounce(adjustMaxElements, 200));\n onMounted(() => {\n if (outercontainer.value && innercontainer.value) {\n const button = outercontainer.value.querySelectorAll(\n \".bb-pagination__page\"\n )[1];\n if (button) {\n /* Compute the footprint necessary to render a new button */\n const gapString = getComputedStyle(innercontainer.value).columnGap;\n const numberAsString = gapString.replaceAll(/\\D/g, \"\");\n const gap = Number(numberAsString);\n buttonFootprint.value = button.clientWidth + gap;\n }\n observer.observe(outercontainer.value);\n }\n });\n onBeforeUnmount(() => {\n observer.disconnect();\n });\n}\n\nconst range = computed(() => {\n if (\n totalPages.value <= 0 ||\n isNaN(totalPages.value) ||\n totalPages.value > Number.MAX_SAFE_INTEGER\n )\n return [];\n\n if (maxSize.value <= 1) return [props.modelValue];\n\n if (totalPages.value <= maxSize.value) {\n return createRange(totalPages.value, start.value);\n }\n\n const even = maxSize.value % 2 === 0;\n const middle = even ? maxSize.value / 2 : Math.floor(maxSize.value / 2);\n const left = even ? middle : middle + 1;\n const right = totalPages.value - middle;\n\n if (left - props.modelValue >= 0) {\n return [\n ...createRange(Math.max(1, maxSize.value - 1), start.value),\n props.ellipsis,\n totalPages.value,\n ];\n } else if (props.modelValue - right >= (even ? 1 : 0)) {\n const rangeLength = maxSize.value - 1;\n const rangeStart = totalPages.value - rangeLength + start.value;\n return [\n start.value,\n props.ellipsis,\n ...createRange(rangeLength, rangeStart),\n ];\n } else {\n const rangeLength = Math.max(1, maxSize.value - 3);\n const rangeStart =\n rangeLength === 1\n ? props.modelValue\n : props.modelValue - Math.ceil(rangeLength / 2) + start.value;\n return [\n start.value,\n props.ellipsis,\n ...createRange(rangeLength, rangeStart),\n props.ellipsis,\n totalPages.value,\n ];\n }\n});\n\nconst items = computed<Item[]>(() => {\n return range.value.map((item, index) => {\n if (typeof item === \"string\") {\n return {\n active: false,\n key: `ellipsis-${index}`,\n page: item,\n ellipsis: true,\n disabled: true,\n };\n } else {\n const active = item === props.modelValue;\n return {\n active,\n key: item,\n page: item,\n ellipsis: false,\n disabled: !!props.disabled || +props.totalPages < 2 || props.loading,\n };\n }\n });\n});\n\nconst createRange = (length: number, start = 0): number[] => {\n return Array.from({ length }, (_, k) => start + k);\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"bb-pagination\",\n ref_key: \"outercontainer\",\n ref: outercontainer\n }, [\n _createElementVNode(\"nav\", _hoisted_1, [\n _createElementVNode(\"ul\", {\n class: \"bb-pagination__pages\",\n ref_key: \"innercontainer\",\n ref: innercontainer\n }, [\n _createElementVNode(\"li\", null, [\n _createElementVNode(\"button\", {\n class: \"bb-pagination__page bb-pagination__page--previous\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (emit('update:modelValue', props.modelValue - 1))),\n disabled: props.modelValue <= 1 || _ctx.loading || _ctx.disabled\n }, [\n _renderSlot(_ctx.$slots, \"previous\", {}, () => [\n _createTextVNode(\"Precedente\")\n ])\n ], 8, _hoisted_2)\n ]),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(items.value, (item) => {\n return (_openBlock(), _createElementBlock(\"li\", null, [\n _createElementVNode(\"button\", {\n class: _normalizeClass([\"bb-pagination__page\", {\n 'bb-pagination__page--active': item.active,\n 'bb-pagination__page--ellipsis': item.ellipsis,\n }]),\n onClick: ($event: any) => (emit('update:modelValue', item.key)),\n disabled: item.disabled\n }, [\n (item.ellipsis === true)\n ? _renderSlot(_ctx.$slots, \"ellipsis\", { key: 0 }, () => [\n _createTextVNode(_toDisplayString(props.ellipsis), 1)\n ])\n : _renderSlot(_ctx.$slots, \"item\", {\n key: 1,\n active: item.active,\n disabled: item.disabled,\n item: item.key\n }, () => [\n _createTextVNode(_toDisplayString(item.key), 1)\n ])\n ], 10, _hoisted_3)\n ]))\n }), 256)),\n _createElementVNode(\"li\", null, [\n _createElementVNode(\"button\", {\n class: \"bb-pagination__page bb-pagination__page--next\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (emit('update:modelValue', props.modelValue + 1))),\n disabled: props.modelValue >= +totalPages.value || _ctx.loading || _ctx.disabled\n }, [\n _renderSlot(_ctx.$slots, \"next\", {}, () => [\n _createTextVNode(\"Successivi\")\n ])\n ], 8, _hoisted_4)\n ])\n ], 512)\n ])\n ], 512))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_sfc_main","_defineComponent","__props","__emit","props","emit","totalPages","computed","start","ref","maxSize","outercontainer","innercontainer","buttonFootprint","adjustMaxElements","nextTick","observer","debounce","onMounted","button","numberAsString","gap","onBeforeUnmount","range","createRange","even","middle","left","right","rangeLength","rangeStart","items","item","index","length","_","k","_ctx","_cache","_openBlock","_createElementBlock","_createElementVNode","$event","_renderSlot","_createTextVNode","_Fragment","_renderList","_normalizeClass","_toDisplayString"],"mappings":";;AAGA,MAAMA,IAAa,EAAE,cAAc,iBAC7BC,IAAa,CAAC,UAAU,GACxBC,IAAa,CAAC,WAAW,UAAU,GACnCC,IAAa,CAAC,UAAU,GAgDFC,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,SAAS,EAAE,MAAM,QAAQ;AAAA,IACzB,UAAU,EAAE,SAAS,MAAM;AAAA,IAC3B,SAAS,EAAE,SAAS,EAAE;AAAA,IACtB,YAAY,EAAE,SAAS,EAAE;AAAA,IACzB,YAAY,EAAE,SAAS,EAAE;AAAA,EAC3B;AAAA,EACA,OAAO,CAAC,mBAAmB;AAAA,EAC3B,MAAMC,GAAc,EAAE,MAAMC,KAAU;AAExC,UAAMC,IAAQF,GAERG,IAAOF,GAIPG,IAAaC,EAAS,MAAM,CAACH,EAAM,UAAU,GAC7CI,IAAQC,EAAI,CAAC,GACbC,IAAUD,EAAI,CAACL,EAAM,OAAO,GAE5BO,IAAiBF,KACjBG,IAAiBH,KAEjBI,IAAkBJ,EAAY,KAAQ,GAQtCK,IAAoB,MAAM;AAC1B,MAAAH,EAAe,SAASC,EAAe,UAErCD,EAAe,MAAM,cAAcC,EAAe,MAAM,cACtDF,EAAQ,QAAQ,IAAI,KACdA,EAAA,SACRK,EAASD,CA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