bitboss-ui 0.2.20 → 0.2.22

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 (139) hide show
  1. package/dist/components/BbDropzone/BbDropzone.vue.d.ts +2 -0
  2. package/dist/index101.js +2 -2
  3. package/dist/index103.js +2 -2
  4. package/dist/index109.js +1 -1
  5. package/dist/index11.js +2 -2
  6. package/dist/index111.js +3 -3
  7. package/dist/index113.js +1 -1
  8. package/dist/index116.js +1 -1
  9. package/dist/index117.js +1 -1
  10. package/dist/index118.js +1 -1
  11. package/dist/index119.js +1 -1
  12. package/dist/index125.js +1 -1
  13. package/dist/index126.js +1 -1
  14. package/dist/index127.js +1 -1
  15. package/dist/index131.js +2 -2
  16. package/dist/index15.js +8 -8
  17. package/dist/index17.js +9 -9
  18. package/dist/index19.js +3 -3
  19. package/dist/index197.js +214 -357
  20. package/dist/index197.js.map +1 -1
  21. package/dist/index198.js +2 -134
  22. package/dist/index198.js.map +1 -1
  23. package/dist/index199.js +378 -5
  24. package/dist/index199.js.map +1 -1
  25. package/dist/index200.js +2 -19
  26. package/dist/index200.js.map +1 -1
  27. package/dist/index201.js +2 -2
  28. package/dist/index201.js.map +1 -1
  29. package/dist/index202.js +6 -2
  30. package/dist/index202.js.map +1 -1
  31. package/dist/index203.js +4 -174
  32. package/dist/index203.js.map +1 -1
  33. package/dist/index204.js +373 -23
  34. package/dist/index204.js.map +1 -1
  35. package/dist/index205.js +3 -373
  36. package/dist/index205.js.map +1 -1
  37. package/dist/index206.js +3 -16
  38. package/dist/index206.js.map +1 -1
  39. package/dist/index207.js +3 -16
  40. package/dist/index207.js.map +1 -1
  41. package/dist/index208.js +35 -20
  42. package/dist/index208.js.map +1 -1
  43. package/dist/index209.js +5 -29
  44. package/dist/index209.js.map +1 -1
  45. package/dist/index21.js +2 -2
  46. package/dist/index210.js +16 -8
  47. package/dist/index210.js.map +1 -1
  48. package/dist/index211.js +16 -2
  49. package/dist/index211.js.map +1 -1
  50. package/dist/index212.js +19 -3
  51. package/dist/index212.js.map +1 -1
  52. package/dist/index213.js +20 -35
  53. package/dist/index213.js.map +1 -1
  54. package/dist/index214.js +29 -6
  55. package/dist/index214.js.map +1 -1
  56. package/dist/index215.js +8 -2
  57. package/dist/index215.js.map +1 -1
  58. package/dist/index216.js +134 -4
  59. package/dist/index216.js.map +1 -1
  60. package/dist/index217.js +2 -3
  61. package/dist/index217.js.map +1 -1
  62. package/dist/index218.js +174 -3
  63. package/dist/index218.js.map +1 -1
  64. package/dist/index219.js +23 -2
  65. package/dist/index219.js.map +1 -1
  66. package/dist/index220.js +2 -10
  67. package/dist/index220.js.map +1 -1
  68. package/dist/index221.js +8 -233
  69. package/dist/index221.js.map +1 -1
  70. package/dist/index223.js +4 -4
  71. package/dist/index224.js +1 -1
  72. package/dist/index226.js +1 -1
  73. package/dist/index227.js +4 -6
  74. package/dist/index227.js.map +1 -1
  75. package/dist/index228.js +224 -2
  76. package/dist/index228.js.map +1 -1
  77. package/dist/index229.js +257 -294
  78. package/dist/index229.js.map +1 -1
  79. package/dist/index230.js +435 -2
  80. package/dist/index230.js.map +1 -1
  81. package/dist/index231.js +89 -2
  82. package/dist/index231.js.map +1 -1
  83. package/dist/index232.js +199 -116
  84. package/dist/index232.js.map +1 -1
  85. package/dist/index233.js +111 -100
  86. package/dist/index233.js.map +1 -1
  87. package/dist/index234.js +106 -2
  88. package/dist/index234.js.map +1 -1
  89. package/dist/index235.js +295 -2
  90. package/dist/index235.js.map +1 -1
  91. package/dist/index236.js +6 -2
  92. package/dist/index236.js.map +1 -1
  93. package/dist/index237.js +2 -2
  94. package/dist/index238.js +2 -435
  95. package/dist/index238.js.map +1 -1
  96. package/dist/index239.js +2 -89
  97. package/dist/index239.js.map +1 -1
  98. package/dist/index240.js +2 -224
  99. package/dist/index240.js.map +1 -1
  100. package/dist/index241.js +2 -258
  101. package/dist/index241.js.map +1 -1
  102. package/dist/index242.js +2 -4
  103. package/dist/index242.js.map +1 -1
  104. package/dist/index243.js +2 -200
  105. package/dist/index243.js.map +1 -1
  106. package/dist/index244.js +162 -2
  107. package/dist/index244.js.map +1 -1
  108. package/dist/index245.js +2 -15
  109. package/dist/index245.js.map +1 -1
  110. package/dist/index246.js +2 -162
  111. package/dist/index246.js.map +1 -1
  112. package/dist/index247.js +69 -2
  113. package/dist/index247.js.map +1 -1
  114. package/dist/index248.js +2 -2
  115. package/dist/index248.js.map +1 -1
  116. package/dist/index249.js +2 -69
  117. package/dist/index249.js.map +1 -1
  118. package/dist/index25.js +2 -2
  119. package/dist/index253.js +15 -2
  120. package/dist/index253.js.map +1 -1
  121. package/dist/index254.js +2 -2
  122. package/dist/index255.js +1 -1
  123. package/dist/index29.js +3 -3
  124. package/dist/index31.js +6 -6
  125. package/dist/index33.js +1 -1
  126. package/dist/index35.js +2 -2
  127. package/dist/index47.js +1 -1
  128. package/dist/index49.js +1 -1
  129. package/dist/index65.js +3 -3
  130. package/dist/index69.js +109 -103
  131. package/dist/index69.js.map +1 -1
  132. package/dist/index72.js +1 -1
  133. package/dist/index75.js +1 -1
  134. package/dist/index79.js +61 -58
  135. package/dist/index79.js.map +1 -1
  136. package/dist/index99.js +53 -52
  137. package/dist/index99.js.map +1 -1
  138. package/dist/style.css +1 -1
  139. package/package.json +1 -1
package/dist/index69.js CHANGED
@@ -1,12 +1,12 @@
1
- import { defineComponent as H, ref as h, watch as M, computed as m, openBlock as z, createBlock as N, resolveDynamicComponent as R, normalizeClass as j, withCtx as _, createElementVNode as d, withModifiers as g, renderSlot as G, normalizeProps as K, guardReactiveProps as O, createTextVNode as U, unref as Y, createVNode as Z, createElementBlock as x, Fragment as J, renderList as Q, toDisplayString as W } from "vue";
2
- import { findInTree as X } from "./index225.js";
3
- import { useId as ee } from "./index7.js";
4
- import te from "./index118.js";
1
+ import { defineComponent as j, ref as g, watch as x, computed as m, openBlock as V, createBlock as G, resolveDynamicComponent as K, normalizeClass as O, withCtx as M, createElementVNode as c, withModifiers as y, renderSlot as U, normalizeProps as Y, guardReactiveProps as Z, createTextVNode as J, unref as Q, createVNode as W, createElementBlock as F, Fragment as X, renderList as ee, toDisplayString as te } from "vue";
2
+ import { findInTree as ae } from "./index225.js";
3
+ import { useId as re } from "./index7.js";
4
+ import oe from "./index118.js";
5
5
  import "./index183.js";
6
- const re = ["accept", "autofocus", "disabled", "multiple"], ae = {
6
+ const le = ["accept", "autofocus", "disabled", "multiple"], se = {
7
7
  class: "bb-dropzone__submittable-label",
8
8
  "aria-hidden": "true"
9
- }, oe = ["id", "name", "multiple", "disabled"], le = { class: "bb-dropzone__errors" }, de = /* @__PURE__ */ H({
9
+ }, ne = ["id", "name", "multiple", "disabled"], ie = { class: "bb-dropzone__errors" }, fe = /* @__PURE__ */ j({
10
10
  __name: "BbDropzone",
11
11
  props: {
12
12
  autofocus: {},
@@ -23,116 +23,122 @@ const re = ["accept", "autofocus", "disabled", "multiple"], ae = {
23
23
  tag: { default: "div" }
24
24
  },
25
25
  emits: ["blur", "error", "focus", "update:modelValue"],
26
- setup(F, { emit: D }) {
27
- let y;
28
- const r = F, l = D, p = h(null);
29
- if (r.accept && !Array.isArray(r.accept))
26
+ setup(D, { emit: C }) {
27
+ let b;
28
+ const t = D, l = C, d = g(null);
29
+ if (t.accept && !Array.isArray(t.accept))
30
30
  throw new Error("Property accept is not an array");
31
- if (r.multiple && !Array.isArray(r.modelValue))
31
+ if (t.multiple && !Array.isArray(t.modelValue))
32
32
  throw new Error(
33
33
  "Component is set to multiple but modelValue is not an array"
34
34
  );
35
- M(
36
- () => r.modelValue,
35
+ const h = g(!1), I = (e) => {
36
+ h.value = !0, l("focus", e);
37
+ }, L = (e) => {
38
+ h.value = !1, l("blur", e);
39
+ };
40
+ x(
41
+ () => t.modelValue,
37
42
  () => {
38
43
  let e = new DataTransfer();
39
- Array.isArray(r.modelValue) ? r.modelValue.length && r.modelValue.forEach((t) => e.items.add(t)) : r.modelValue && e.items.add(r.modelValue), p.value && (e.items.length ? p.value.files = e.files : p.value.files = null);
44
+ Array.isArray(t.modelValue) ? t.modelValue.length && t.modelValue.forEach((a) => e.items.add(a)) : t.modelValue && e.items.add(t.modelValue), d.value && (e.items.length ? d.value.files = e.files : d.value.files = null);
40
45
  }
41
46
  );
42
- const c = h([]), C = m(
43
- () => c.value.join(",")
47
+ const p = g([]), P = m(
48
+ () => p.value.join(",")
44
49
  );
45
- M(
46
- () => r.accept,
50
+ x(
51
+ () => t.accept,
47
52
  async () => {
48
- if (r.accept) {
53
+ if (t.accept) {
49
54
  let e = [];
50
- for (let t = 0; t < r.accept.length; t++) {
51
- const a = r.accept[t];
52
- if (a.includes("/"))
53
- e.push(a);
55
+ for (let a = 0; a < t.accept.length; a++) {
56
+ const r = t.accept[a];
57
+ if (r.includes("/"))
58
+ e.push(r);
54
59
  else {
55
- y || (y = await import("./index224.js").then((s) => s.i));
56
- const o = y.getType(a);
60
+ b || (b = await import("./index224.js").then((s) => s.i));
61
+ const o = b.getType(r);
57
62
  if (!o)
58
63
  throw new Error(
59
- `Could not detect the correct mime associated with ${a}`
64
+ `Could not detect the correct mime associated with ${r}`
60
65
  );
61
66
  e.push(o);
62
67
  }
63
68
  }
64
- c.value = e;
69
+ p.value = e;
65
70
  }
66
71
  },
67
72
  { immediate: !0 }
68
73
  );
69
- const b = r.id || `${ee().id.value}`, V = `bb_dz_${b}`, n = h(!1);
70
- let v;
71
- const I = m(() => ({
74
+ const z = t.id || `${re().id.value}`, v = `bb_dz_${z}`, i = g(!1);
75
+ let T;
76
+ const k = m(() => ({
72
77
  "bb-dropzone": !0,
73
- "bb-dropzone--errors": q.value,
74
- "bb-dropzone--dragging": n.value
75
- })), L = m(() => ({
76
- dragging: n.value,
77
- id: b
78
- })), P = (e) => {
79
- if (n.value = !1, e.dataTransfer) {
78
+ "bb-dropzone--errors": R.value,
79
+ "bb-dropzone--dragging": i.value
80
+ })), q = m(() => ({
81
+ dragging: i.value,
82
+ focused: h.value,
83
+ id: z
84
+ })), $ = (e) => {
85
+ if (i.value = !1, e.dataTransfer) {
80
86
  e.stopImmediatePropagation();
81
- let t;
82
- if (t = Array.from(e.dataTransfer.files), t = T(t), r.multiple ? Array.isArray(r.modelValue) && l("update:modelValue", [...r.modelValue, ...t]) : (t = t[0], l("update:modelValue", t)), e.currentTarget instanceof HTMLLabelElement) {
83
- const a = e.currentTarget.querySelector("input[type=file]");
84
- a instanceof HTMLInputElement && a.focus();
87
+ let a;
88
+ if (a = Array.from(e.dataTransfer.files), a = _(a), t.multiple ? Array.isArray(t.modelValue) && l("update:modelValue", [...t.modelValue, ...a]) : (a = a[0], l("update:modelValue", a)), e.currentTarget instanceof HTMLLabelElement) {
89
+ const r = e.currentTarget.querySelector("input[type=file]");
90
+ r instanceof HTMLInputElement && r.focus();
85
91
  }
86
92
  }
87
- }, $ = (e) => {
93
+ }, H = (e) => {
88
94
  if (e.target instanceof HTMLInputElement) {
89
95
  if (e.target.files) {
90
- let t;
91
- t = T(Array.from(e.target.files)), r.multiple ? Array.isArray(r.modelValue) && l("update:modelValue", [...r.modelValue, ...t]) : (t = t[0], l("update:modelValue", t));
96
+ let a;
97
+ a = _(Array.from(e.target.files)), t.multiple ? Array.isArray(t.modelValue) && l("update:modelValue", [...t.modelValue, ...a]) : (a = a[0], l("update:modelValue", a));
92
98
  }
93
99
  e.target.value = "", e.target.files = null;
94
100
  }
95
- }, T = (e) => e.filter((t, a) => {
96
- if (r.maxSize && !(t.size <= r.maxSize))
97
- return l("error", f.maxSize(t)), !1;
101
+ }, _ = (e) => e.filter((a, r) => {
102
+ if (t.maxSize && !(a.size <= t.maxSize))
103
+ return l("error", f.maxSize(a)), !1;
98
104
  let o = !1;
99
- return r.modelValue && (Array.isArray(r.modelValue) ? o = r.modelValue.some(
100
- (s) => S(s, t)
101
- ) : o = S(r.modelValue, t)), o ? (l("error", f.uniqueness(t)), !1) : r.accept && !c.value.some((i) => {
105
+ return t.modelValue && (Array.isArray(t.modelValue) ? o = t.modelValue.some(
106
+ (s) => S(s, a)
107
+ ) : o = S(t.modelValue, a)), o ? (l("error", f.uniqueness(a)), !1) : t.accept && !p.value.some((n) => {
102
108
  let u = !1;
103
- return i.includes("*") ? u = u || i.split("/")[0] === t.type.split("/")[0] : u = u || i === t.type, u;
104
- }) ? (l("error", f.accept(t)), !1) : r.maxFiles && Array.isArray(r.modelValue) && r.modelValue.length + a + 1 > r.maxFiles ? (l(
109
+ return n.includes("*") ? u = u || n.split("/")[0] === a.type.split("/")[0] : u = u || n === a.type, u;
110
+ }) ? (l("error", f.accept(a)), !1) : t.maxFiles && Array.isArray(t.modelValue) && t.modelValue.length + r + 1 > t.maxFiles ? (l(
105
111
  "error",
106
- f.maxFiles(t, r.modelValue.length + a + 1)
112
+ f.maxFiles(a, t.modelValue.length + r + 1)
107
113
  ), !1) : !0;
108
- }), k = (e) => {
109
- const t = e.target;
110
- if (t instanceof HTMLElement) {
111
- const a = X(
112
- [t],
114
+ }), N = (e) => {
115
+ const a = e.target;
116
+ if (a instanceof HTMLElement) {
117
+ const r = ae(
118
+ [a],
113
119
  "parentElement",
114
120
  (o) => o.classList.contains("bb-dropzone")
115
121
  );
116
- a && (a.id === V ? B() : E());
122
+ r && (r.id === v ? B() : E());
117
123
  }
118
124
  }, B = () => {
119
- clearTimeout(v), n.value = !0;
125
+ clearTimeout(T), i.value = !0;
120
126
  }, E = () => {
121
- v = setTimeout(() => {
122
- n.value = !1;
127
+ T = setTimeout(() => {
128
+ i.value = !1;
123
129
  }, 100);
124
- }, A = (e, t = 2) => {
130
+ }, A = (e, a = 2) => {
125
131
  if (!e)
126
132
  return "0 B";
127
- const a = 1024, o = t || 0, s = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], i = Math.floor(Math.log(e) / Math.log(a));
128
- return parseFloat((e / Math.pow(a, i)).toFixed(o)) + " " + s[i];
129
- }, S = (e, t) => !["name", "size", "lastModified", "type"].some((o) => e[o] !== t[o]), f = {
133
+ const r = 1024, o = a || 0, s = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], n = Math.floor(Math.log(e) / Math.log(r));
134
+ return parseFloat((e / Math.pow(r, n)).toFixed(o)) + " " + s[n];
135
+ }, S = (e, a) => !["name", "size", "lastModified", "type"].some((o) => e[o] !== a[o]), f = {
130
136
  maxSize: (e) => {
131
- if (r.maxSize)
137
+ if (t.maxSize)
132
138
  return {
133
139
  type: "maxSize",
134
140
  file: e,
135
- formattedMaxSize: A(+r.maxSize),
141
+ formattedMaxSize: A(+t.maxSize),
136
142
  formattedSize: A(e.size),
137
143
  filename: e.name
138
144
  };
@@ -146,63 +152,63 @@ const re = ["accept", "autofocus", "disabled", "multiple"], ae = {
146
152
  accept: (e) => ({
147
153
  type: "accept",
148
154
  file: e,
149
- acceptedMimeTypes: c.value,
155
+ acceptedMimeTypes: p.value,
150
156
  mimeType: e.type,
151
157
  filename: e.name
152
158
  }),
153
- maxFiles: (e, t) => ({
159
+ maxFiles: (e, a) => ({
154
160
  type: "maxFiles",
155
161
  file: e,
156
- maxFiles: r.maxFiles,
157
- totalFiles: t,
162
+ maxFiles: t.maxFiles,
163
+ totalFiles: a,
158
164
  filename: e.name
159
165
  })
160
- }, w = m(() => r.errors ? [].concat(r.errors) : []), q = m(
161
- () => !!w.value.length || r.hasErrors
166
+ }, w = m(() => t.errors ? [].concat(t.errors) : []), R = m(
167
+ () => !!w.value.length || t.hasErrors
162
168
  );
163
- return (e, t) => (z(), N(R(e.tag), {
164
- class: j(I.value),
165
- id: V
169
+ return (e, a) => (V(), G(K(e.tag), {
170
+ class: O(k.value),
171
+ id: v
166
172
  }, {
167
- default: _(() => [
168
- d("label", {
169
- onDrop: g(P, ["prevent"]),
170
- onDragenter: g(B, ["prevent"]),
171
- onDragover: g(k, ["prevent"]),
172
- onDragleave: g(E, ["prevent"])
173
+ default: M(() => [
174
+ c("label", {
175
+ onDrop: y($, ["prevent"]),
176
+ onDragenter: y(B, ["prevent"]),
177
+ onDragover: y(N, ["prevent"]),
178
+ onDragleave: y(E, ["prevent"])
173
179
  }, [
174
- d("input", {
180
+ c("input", {
175
181
  type: "file",
176
- accept: C.value,
182
+ accept: P.value,
177
183
  autofocus: e.autofocus,
178
184
  disabled: e.disabled,
179
185
  multiple: e.multiple,
180
- onChange: $,
181
- onFocus: t[0] || (t[0] = (a) => e.$emit("focus", a)),
182
- onBlur: t[1] || (t[1] = (a) => e.$emit("blur", a))
183
- }, null, 40, re),
184
- G(e.$slots, "default", K(O(L.value)))
186
+ onChange: H,
187
+ onFocus: I,
188
+ onBlur: L
189
+ }, null, 40, le),
190
+ U(e.$slots, "default", Y(Z(q.value)))
185
191
  ], 32),
186
- d("label", ae, [
187
- U(" Server files "),
188
- d("input", {
192
+ c("label", se, [
193
+ J(" Server files "),
194
+ c("input", {
189
195
  class: "bb-dropzone__submittable-input",
190
196
  type: "file",
191
- id: Y(b),
197
+ id: Q(z),
192
198
  name: e.name,
193
199
  ref_key: "submittable",
194
- ref: p,
200
+ ref: d,
195
201
  multiple: e.multiple,
196
202
  disabled: e.disabled
197
- }, null, 8, oe)
203
+ }, null, 8, ne)
198
204
  ]),
199
- d("span", le, [
200
- Z(te, { tag: "span" }, {
201
- default: _(() => [
202
- (z(!0), x(J, null, Q(w.value, (a) => (z(), x("span", {
205
+ c("span", ie, [
206
+ W(oe, { tag: "span" }, {
207
+ default: M(() => [
208
+ (V(!0), F(X, null, ee(w.value, (r) => (V(), F("span", {
203
209
  class: "bb-dropzone__error",
204
- key: a
205
- }, W(a), 1))), 128))
210
+ key: r
211
+ }, te(r), 1))), 128))
206
212
  ]),
207
213
  _: 1
208
214
  })
@@ -213,6 +219,6 @@ const re = ["accept", "autofocus", "disabled", "multiple"], ae = {
213
219
  }
214
220
  });
215
221
  export {
216
- de as default
222
+ fe as default
217
223
  };
218
224
  //# sourceMappingURL=index69.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index69.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 = [\"accept\", \"autofocus\", \"disabled\", \"multiple\"]\nconst _hoisted_2 = {\n class: \"bb-dropzone__submittable-label\",\n \"aria-hidden\": \"true\"\n}\nconst _hoisted_3 = [\"id\", \"name\", \"multiple\", \"disabled\"]\nconst _hoisted_4 = { 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 type { 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 } as const;\n } else throw new Error('Requested to create an error for maxSize without providing a maxSize.')\n },\n uniqueness: (file: File) => {\n return {\n type: \"uniqueness\",\n file: file,\n filename: file.name,\n } as const;\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 } as const;\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 } as const;\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_1),\n _renderSlot(_ctx.$slots, \"default\", _normalizeProps(_guardReactiveProps(slotAttributes.value)))\n ], 32),\n _createElementVNode(\"label\", _hoisted_2, [\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_3)\n ]),\n _createElementVNode(\"span\", _hoisted_4, [\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","_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,aAAa,YAAY,UAAU,GAC3DC,KAAa;AAAA,EACjB,OAAO;AAAA,EACP,eAAe;AACjB,GACMC,KAAa,CAAC,MAAM,QAAQ,YAAY,UAAU,GAClDC,KAAa,EAAE,OAAO,yBA+CAC,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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AAG,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":"index69.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 = [\"accept\", \"autofocus\", \"disabled\", \"multiple\"]\nconst _hoisted_2 = {\n class: \"bb-dropzone__submittable-label\",\n \"aria-hidden\": \"true\"\n}\nconst _hoisted_3 = [\"id\", \"name\", \"multiple\", \"disabled\"]\nconst _hoisted_4 = { 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 type { 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\nconst hasFocus = ref(false);\nconst onFocus = (event: FocusEvent) => {\n hasFocus.value = true;\n emit('focus', event)\n}\nconst onBlur = (event: FocusEvent) => {\n hasFocus.value = false;\n emit('blur', event)\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 focused: hasFocus.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 } as const;\n } else throw new Error('Requested to create an error for maxSize without providing a maxSize.')\n },\n uniqueness: (file: File) => {\n return {\n type: \"uniqueness\",\n file: file,\n filename: file.name,\n } as const;\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 } as const;\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 } as const;\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: onFocus,\n onBlur: onBlur\n }, null, 40, _hoisted_1),\n _renderSlot(_ctx.$slots, \"default\", _normalizeProps(_guardReactiveProps(slotAttributes.value)))\n ], 32),\n _createElementVNode(\"label\", _hoisted_2, [\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_3)\n ]),\n _createElementVNode(\"span\", _hoisted_4, [\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","_sfc_main","_defineComponent","__props","__emit","mime","props","emit","submittable","ref","hasFocus","onFocus","event","onBlur","watch","container","file","acceptedMimeTypes","acceptedMimeTypesString","computed","accumulated","i","element","foundMime","id","useId","containerId","dragging","draggingTimeout","classes","hasErrors","slotAttributes","onDrop","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":";;;;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,IAAIM,EAAOjD,CAAE;AAAA,YACb,MAAMoC,EAAK;AAAA,YACX,SAAS;AAAA,YACT,KAAKpD;AAAA,YACL,UAAUoD,EAAK;AAAA,YACf,UAAUA,EAAK;AAAA,UAAA,GACd,MAAM,GAAG7D,EAAU;AAAA,QAAA,CACvB;AAAA,QACDoE,EAAoB,QAAQnE,IAAY;AAAA,UACtC0E,EAAaC,IAAgB,EAAE,KAAK,UAAU;AAAA,YAC5C,SAAST,EAAS,MAAM;AAAA,eACrBJ,EAAW,EAAI,GAAGc,EAAoBC,GAAW,MAAMC,GAAYnB,EAAe,OAAO,CAACoB,OACjFjB,EAAA,GAAcc,EAAoB,QAAQ;AAAA,gBAChD,OAAO;AAAA,gBACP,KAAKG;AAAA,cACJ,GAAAC,GAAiBD,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/index72.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 "./index212.js";
2
+ import { throttle as c } from "./index207.js";
3
3
  const M = /* @__PURE__ */ h({
4
4
  __name: "BbIntersection",
5
5
  props: {
package/dist/index75.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as q, ref as s, useAttrs as G, computed as m, onMounted as J, watch as Q, onBeforeUnmount as X, openBlock as y, createBlock as Y, Teleport as Z, createElementVNode as o, mergeProps as N, createElementBlock as w, renderSlot as l, createTextVNode as ee, toDisplayString as z, createCommentVNode as B, nextTick as te } from "vue";
2
- import { useFocusTrap as oe } from "./index213.js";
2
+ import { useFocusTrap as oe } from "./index208.js";
3
3
  import { useId as L } from "./index7.js";
4
4
  import { wait as O } from "./index122.js";
5
5
  const se = { class: "bb-offcanvas-close" }, ae = { class: "bb-offcanvas-close__content" }, ne = { class: "bb-offcanvas-close__label" }, le = /* @__PURE__ */ o("span", { class: "bb-offcanvas-close__icon" }, [