bitboss-ui 2.0.165 → 2.0.167

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 (373) hide show
  1. package/dist/components/BaseButton/BaseButton.vue.d.ts +2 -1
  2. package/dist/components/BaseButton/RouterComponent.vue.d.ts +2 -1
  3. package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +5 -2
  4. package/dist/components/BaseCheckboxGroup/BaseCheckboxGroup.vue.d.ts +2 -4
  5. package/dist/components/BaseColorInput/BaseColorInput.vue.d.ts +106 -4
  6. package/dist/components/BaseColorInput/ColorPallette.vue.d.ts +5 -1
  7. package/dist/components/BaseDatePicker/BaseDatePicker.vue.d.ts +4 -3
  8. package/dist/components/BaseDatePicker/BaseDatePickerHeader.vue.d.ts +1 -1
  9. package/dist/components/BaseDatePicker/BaseDatePickerInputDaySelector.vue.d.ts +5 -2
  10. package/dist/components/BaseDatePicker/BaseDatePickerMonthSelector.vue.d.ts +1 -1
  11. package/dist/components/BaseDatePicker/BaseDatePickerYearSelector.vue.d.ts +3 -1
  12. package/dist/components/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +200 -10
  13. package/dist/components/BaseDialog/BaseDialog.vue.d.ts +10 -2
  14. package/dist/components/BaseInputContainer/BaseInputContainer.vue.d.ts +3 -2
  15. package/dist/components/BaseNumberInput/BaseNumberInput.vue.d.ts +5 -2
  16. package/dist/components/BaseRadio/BaseRadio.vue.d.ts +3 -2
  17. package/dist/components/BaseRadioGroup/BaseRadioGroup.vue.d.ts +2 -4
  18. package/dist/components/BaseRating/BaseRating.vue.d.ts +5 -2
  19. package/dist/components/BaseSelect/BaseSelect.vue.d.ts +2 -4
  20. package/dist/components/BaseSlider/BaseSlider.vue.d.ts +8 -2
  21. package/dist/components/BaseSwitch/BaseSwitch.vue.d.ts +5 -2
  22. package/dist/components/BaseSwitchGroup/BaseSwitchGroup.vue.d.ts +2 -4
  23. package/dist/components/BaseTag/BaseTag.vue.d.ts +207 -6
  24. package/dist/components/BaseTextInput/BaseTextInput.vue.d.ts +5 -2
  25. package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +5 -2
  26. package/dist/components/BbAccordion/BbAccordion.vue.d.ts +3 -2
  27. package/dist/components/BbAlert/BbAlert.vue.d.ts +2 -1
  28. package/dist/components/BbAvatar/BbAvatar.vue.d.ts +5 -2
  29. package/dist/components/BbBadge/BbBadge.vue.d.ts +3 -2
  30. package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue.d.ts +3 -2
  31. package/dist/components/BbButton/BbButton.vue.d.ts +2 -1
  32. package/dist/components/BbCheckbox/BbCheckbox.vue.d.ts +3 -2
  33. package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +2 -4
  34. package/dist/components/BbChip/BbChip.vue.d.ts +3 -2
  35. package/dist/components/BbCollapsible/BbCollapsible.vue.d.ts +2 -1
  36. package/dist/components/BbColorInput/BbColorInput.vue.d.ts +3 -2
  37. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +3 -2
  38. package/dist/components/BbDialog/BbDialog.vue.d.ts +2 -1
  39. package/dist/components/BbDropdown/BbDropdown.vue.d.ts +241 -100
  40. package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +69 -126
  41. package/dist/components/BbDropzone/BbDropzone.vue.d.ts +5 -2
  42. package/dist/components/BbIntersection/BbIntersection.vue.d.ts +5 -2
  43. package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +100 -9
  44. package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +10 -2
  45. package/dist/components/BbPagination/BbPagination.vue.d.ts +10 -6
  46. package/dist/components/BbPopover/BbPopover.vue.d.ts +168 -15
  47. package/dist/components/BbProgress/BbProgress.vue.d.ts +1 -1
  48. package/dist/components/BbRadio/BbRadio.vue.d.ts +3 -2
  49. package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +2 -4
  50. package/dist/components/BbRating/BbRating.vue.d.ts +3 -2
  51. package/dist/components/BbRatio/BbRatio.vue.d.ts +2 -1
  52. package/dist/components/BbRows/BbRows.vue.d.ts +3 -5
  53. package/dist/components/BbSelect/BbSelect.vue.d.ts +2 -4
  54. package/dist/components/BbSlider/BbSlider.vue.d.ts +3 -2
  55. package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +6 -2
  56. package/dist/components/BbSpinner/BbSpinner.vue.d.ts +1 -1
  57. package/dist/components/BbSwitch/BbSwitch.vue.d.ts +3 -2
  58. package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +2 -4
  59. package/dist/components/BbTab/BbTab.vue.d.ts +6 -2
  60. package/dist/components/BbTable/BbTable.vue.d.ts +2 -4
  61. package/dist/components/BbTag/BbTag.vue.d.ts +3 -2
  62. package/dist/components/BbTeleport.vue.d.ts +2 -1
  63. package/dist/components/BbTextInput/BbTextInput.vue.d.ts +3 -2
  64. package/dist/components/BbTextarea/BbTextarea.vue.d.ts +3 -2
  65. package/dist/components/BbToast/BbToastMessage.vue.d.ts +1 -1
  66. package/dist/components/BbTooltip/BbTooltip.vue.d.ts +175 -7
  67. package/dist/components/BbTree/BbTree.vue.d.ts +2 -1
  68. package/dist/components/ClearableButton.vue.d.ts +1 -1
  69. package/dist/components/CommonFloating.vue.d.ts +6 -2
  70. package/dist/components/CommonInputInnerContainer.vue.d.ts +5 -2
  71. package/dist/components/CommonInputOuterContainer.vue.d.ts +5 -4
  72. package/dist/components/CommonPopover.vue.d.ts +42 -0
  73. package/dist/components/ErrorIcon.vue.d.ts +1 -1
  74. package/dist/components/ListBox.vue.d.ts +4 -6
  75. package/dist/components/OptionsContainer.vue.d.ts +4 -6
  76. package/dist/components/Transitions/Slide.vue.d.ts +2 -1
  77. package/dist/composables/useUntil.d.ts +7 -0
  78. package/dist/{style.css → index.css} +1 -1
  79. package/dist/index.js +148 -143
  80. package/dist/index100.js +122 -135
  81. package/dist/index102.js +100 -0
  82. package/dist/index104.js +24 -0
  83. package/dist/index106.js +144 -0
  84. package/dist/index107.js +106 -59
  85. package/dist/index109.js +101 -289
  86. package/dist/index11.js +2 -2
  87. package/dist/index111.js +37 -476
  88. package/dist/index113.js +31 -118
  89. package/dist/index115.js +43 -61
  90. package/dist/index117.js +86 -78
  91. package/dist/index119.js +296 -26
  92. package/dist/index12.js +6 -6
  93. package/dist/index121.js +470 -138
  94. package/dist/index123.js +117 -115
  95. package/dist/index125.js +110 -35
  96. package/dist/index127.js +115 -45
  97. package/dist/index129.js +28 -31
  98. package/dist/index13.js +5 -5
  99. package/dist/index131.js +117 -21
  100. package/dist/index133.js +120 -9
  101. package/dist/index135.js +2 -2
  102. package/dist/index136.js +21 -5
  103. package/dist/index137.js +375 -7
  104. package/dist/index138.js +9 -6
  105. package/dist/index139.js +25 -3
  106. package/dist/index140.js +2 -3
  107. package/dist/index141.js +5 -3
  108. package/dist/index142.js +9 -3
  109. package/dist/index143.js +6 -3
  110. package/dist/index144.js +1 -1
  111. package/dist/index145.js +1 -1
  112. package/dist/index146.js +1 -1
  113. package/dist/index147.js +1 -1
  114. package/dist/index148.js +1 -1
  115. package/dist/index149.js +1 -1
  116. package/dist/index15.js +15 -15
  117. package/dist/index150.js +1 -1
  118. package/dist/index151.js +1 -1
  119. package/dist/index152.js +1 -1
  120. package/dist/index153.js +1 -1
  121. package/dist/index154.js +1 -1
  122. package/dist/index155.js +1 -1
  123. package/dist/index156.js +1 -1
  124. package/dist/index157.js +1 -1
  125. package/dist/index158.js +1 -1
  126. package/dist/index159.js +1 -1
  127. package/dist/index160.js +1 -1
  128. package/dist/index161.js +1 -1
  129. package/dist/index162.js +1 -1
  130. package/dist/index163.js +1 -1
  131. package/dist/index164.js +1 -1
  132. package/dist/index165.js +1 -1
  133. package/dist/index166.js +2 -2
  134. package/dist/index167.js +5 -0
  135. package/dist/index168.js +2 -2
  136. package/dist/index169.js +5 -0
  137. package/dist/index17.js +6 -6
  138. package/dist/index170.js +1 -1
  139. package/dist/index171.js +1 -1
  140. package/dist/index172.js +1 -1
  141. package/dist/index173.js +1 -1
  142. package/dist/index174.js +1 -1
  143. package/dist/index175.js +1 -1
  144. package/dist/index176.js +1 -1
  145. package/dist/index177.js +2 -2
  146. package/dist/index178.js +5 -0
  147. package/dist/index179.js +3 -2
  148. package/dist/index180.js +1 -1
  149. package/dist/index181.js +2 -3
  150. package/dist/index182.js +1 -1
  151. package/dist/index183.js +1 -1
  152. package/dist/index184.js +1 -1
  153. package/dist/index185.js +1 -1
  154. package/dist/index186.js +1 -1
  155. package/dist/index187.js +1 -1
  156. package/dist/index188.js +2 -2
  157. package/dist/index189.js +3 -2
  158. package/dist/index19.js +10 -10
  159. package/dist/index190.js +1 -1
  160. package/dist/index191.js +2 -3
  161. package/dist/index192.js +1 -1
  162. package/dist/index193.js +5 -0
  163. package/dist/index194.js +1 -1
  164. package/dist/index195.js +5 -0
  165. package/dist/index196.js +1 -1
  166. package/dist/index197.js +1 -1
  167. package/dist/index198.js +1 -1
  168. package/dist/index199.js +1 -1
  169. package/dist/index200.js +1 -1
  170. package/dist/index201.js +1 -1
  171. package/dist/index202.js +1 -1
  172. package/dist/index203.js +1 -1
  173. package/dist/index204.js +1 -1
  174. package/dist/index205.js +1 -1
  175. package/dist/index206.js +100 -77
  176. package/dist/index208.js +2 -4
  177. package/dist/index209.js +3 -40
  178. package/dist/index21.js +17 -17
  179. package/dist/index210.js +41 -20
  180. package/dist/index211.js +19 -93
  181. package/dist/index212.js +96 -0
  182. package/dist/{index213.js → index214.js} +9 -9
  183. package/dist/{index215.js → index216.js} +15 -15
  184. package/dist/index218.js +13 -13
  185. package/dist/index219.js +13 -5
  186. package/dist/index220.js +5 -16
  187. package/dist/index221.js +5 -16
  188. package/dist/index222.js +5 -19
  189. package/dist/index223.js +5 -15
  190. package/dist/index224.js +5 -19
  191. package/dist/index225.js +5 -27
  192. package/dist/index226.js +5 -3
  193. package/dist/index227.js +3 -2
  194. package/dist/index228.js +2 -8
  195. package/dist/index229.js +6 -248
  196. package/dist/index23.js +25 -25
  197. package/dist/index230.js +240 -42
  198. package/dist/index231.js +43 -35
  199. package/dist/index232.js +44 -5
  200. package/dist/index233.js +5 -60
  201. package/dist/index234.js +60 -3
  202. package/dist/index235.js +5 -85
  203. package/dist/index236.js +9 -0
  204. package/dist/index237.js +15 -29
  205. package/dist/index238.js +34 -17
  206. package/dist/index239.js +86 -51
  207. package/dist/index241.js +28 -11
  208. package/dist/index242.js +15 -14
  209. package/dist/index243.js +50 -124
  210. package/dist/index244.js +15 -2
  211. package/dist/index245.js +12 -6
  212. package/dist/index246.js +16 -2
  213. package/dist/index247.js +5 -9
  214. package/dist/index248.js +2 -2
  215. package/dist/index249.js +2 -4
  216. package/dist/index25.js +8 -8
  217. package/dist/index250.js +9 -2
  218. package/dist/index251.js +18 -7
  219. package/dist/index252.js +127 -14
  220. package/dist/index253.js +4 -34
  221. package/dist/index254.js +106 -2
  222. package/dist/index256.js +100 -2
  223. package/dist/index258.js +12 -126
  224. package/dist/index259.js +211 -89
  225. package/dist/index260.js +370 -0
  226. package/dist/index261.js +2 -100
  227. package/dist/index262.js +4 -0
  228. package/dist/index263.js +2 -12
  229. package/dist/index264.js +3 -228
  230. package/dist/index265.js +162 -354
  231. package/dist/index266.js +2 -176
  232. package/dist/index27.js +18 -18
  233. package/dist/index270.js +11 -23
  234. package/dist/index271.js +101 -3
  235. package/dist/index273.js +23 -16
  236. package/dist/index274.js +6 -281
  237. package/dist/index275.js +16 -6
  238. package/dist/index276.js +3 -2
  239. package/dist/index277.js +9 -2
  240. package/dist/index278.js +8 -2
  241. package/dist/index279.js +2 -2
  242. package/dist/index280.js +67 -2
  243. package/dist/index281.js +5 -2
  244. package/dist/index282.js +5 -2
  245. package/dist/index283.js +8 -2
  246. package/dist/index284.js +471 -2
  247. package/dist/index285.js +3 -2
  248. package/dist/index286.js +3 -2
  249. package/dist/index287.js +3 -28
  250. package/dist/index289.js +9 -0
  251. package/dist/index29.js +5 -5
  252. package/dist/index290.js +6 -6
  253. package/dist/index291.js +11 -7
  254. package/dist/index292.js +279 -10
  255. package/dist/index293.js +2 -431
  256. package/dist/index294.js +16 -3
  257. package/dist/index295.js +2 -3
  258. package/dist/index296.js +16 -3
  259. package/dist/index297.js +4 -0
  260. package/dist/index298.js +18 -223
  261. package/dist/index299.js +2 -3
  262. package/dist/index300.js +15 -17
  263. package/dist/index301.js +2 -9
  264. package/dist/index302.js +18 -199
  265. package/dist/index303.js +2 -2
  266. package/dist/index304.js +27 -4
  267. package/dist/index305.js +2 -2
  268. package/dist/index306.js +1 -1
  269. package/dist/index307.js +2 -8
  270. package/dist/index308.js +2 -126
  271. package/dist/index309.js +2 -3
  272. package/dist/index31.js +4 -4
  273. package/dist/index310.js +28 -3
  274. package/dist/index311.js +21 -1
  275. package/dist/index313.js +199 -126
  276. package/dist/index314.js +4 -2
  277. package/dist/index315.js +2 -67
  278. package/dist/index316.js +6 -5
  279. package/dist/index317.js +2 -89
  280. package/dist/index318.js +3 -3
  281. package/dist/index319.js +17 -3
  282. package/dist/index320.js +123 -56
  283. package/dist/index321.js +2 -33
  284. package/dist/index322.js +128 -27
  285. package/dist/index323.js +5 -0
  286. package/dist/index324.js +3 -480
  287. package/dist/index325.js +2 -7
  288. package/dist/index326.js +4 -7
  289. package/dist/index327.js +379 -16
  290. package/dist/index328.js +125 -7
  291. package/dist/index329.js +5 -6
  292. package/dist/index33.js +10 -10
  293. package/dist/index330.js +3 -8
  294. package/dist/index331.js +5 -58
  295. package/dist/index332.js +700 -57
  296. package/dist/index333.js +354 -5
  297. package/dist/index334.js +57 -7
  298. package/dist/index335.js +7 -3
  299. package/dist/index336.js +5 -46
  300. package/dist/index337.js +8 -2
  301. package/dist/index338.js +9 -0
  302. package/dist/index339.js +32 -2
  303. package/dist/index340.js +28 -2
  304. package/dist/index342.js +57 -46
  305. package/dist/index343.js +60 -0
  306. package/dist/index344.js +7 -0
  307. package/dist/index345.js +230 -0
  308. package/dist/index346.js +4 -0
  309. package/dist/index347.js +49 -0
  310. package/dist/index348.js +9 -0
  311. package/dist/index349.js +21 -0
  312. package/dist/index35.js +9 -9
  313. package/dist/index350.js +95 -0
  314. package/dist/index352.js +5 -0
  315. package/dist/index353.js +484 -0
  316. package/dist/index354.js +49 -0
  317. package/dist/index355.js +483 -0
  318. package/dist/index356.js +4 -0
  319. package/dist/index37.js +33 -33
  320. package/dist/index39.js +15 -15
  321. package/dist/index41.js +5 -5
  322. package/dist/index43.js +10 -10
  323. package/dist/index45.js +25 -25
  324. package/dist/index47.js +6 -6
  325. package/dist/index49.js +15 -15
  326. package/dist/index51.js +4 -4
  327. package/dist/index53.js +6 -6
  328. package/dist/index55.js +6 -6
  329. package/dist/index57.js +16 -16
  330. package/dist/index59.js +3 -3
  331. package/dist/index6.js +1 -1
  332. package/dist/index61.js +9 -9
  333. package/dist/index63.js +5 -5
  334. package/dist/index65.js +2 -2
  335. package/dist/index67.js +35 -107
  336. package/dist/index69.js +42 -85
  337. package/dist/index7.js +2 -2
  338. package/dist/index71.js +47 -56
  339. package/dist/index73.js +83 -54
  340. package/dist/index75.js +113 -273
  341. package/dist/index77.js +50 -158
  342. package/dist/index79.js +228 -194
  343. package/dist/index81.js +148 -40
  344. package/dist/index83.js +221 -0
  345. package/dist/index85.js +53 -0
  346. package/dist/index87.js +46 -0
  347. package/dist/index88.js +125 -184
  348. package/dist/index9.js +1 -1
  349. package/dist/index90.js +240 -26
  350. package/dist/index92.js +230 -86
  351. package/dist/index94.js +135 -117
  352. package/dist/index96.js +27 -94
  353. package/dist/index98.js +85 -15
  354. package/package.json +27 -28
  355. package/dist/index101.js +0 -178
  356. package/dist/index103.js +0 -116
  357. package/dist/index105.js +0 -100
  358. package/dist/index126.js +0 -46
  359. package/dist/index128.js +0 -49
  360. package/dist/index130.js +0 -4
  361. package/dist/index132.js +0 -346
  362. package/dist/index134.js +0 -27
  363. package/dist/index217.js +0 -15
  364. package/dist/index240.js +0 -17
  365. package/dist/index255.js +0 -4
  366. package/dist/index257.js +0 -20
  367. package/dist/index272.js +0 -8
  368. package/dist/index288.js +0 -24
  369. package/dist/index312.js +0 -438
  370. package/dist/index341.js +0 -426
  371. package/dist/index82.js +0 -136
  372. package/dist/index84.js +0 -247
  373. package/dist/index86.js +0 -238
package/dist/index79.js CHANGED
@@ -1,221 +1,255 @@
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 "./index273.js";
3
- import { useId as re } from "./index8.js";
4
- import oe from "./index128.js";
1
+ import { defineComponent as U, computed as V, useTemplateRef as q, ref as F, createBlock as h, openBlock as b, normalizeClass as W, withCtx as L, createElementBlock as T, createCommentVNode as D, unref as p, normalizeStyle as G, renderSlot as v, Fragment as A, renderList as J, createVNode as Q, mergeProps as X, createElementVNode as Y, toDisplayString as Z, normalizeProps as x, guardReactiveProps as ee } from "vue";
2
+ import { findRightIndex as _ } from "./index269.js";
3
+ import { useId as te } from "./index8.js";
4
+ import { useIntersectionObserver as oe } from "./index137.js";
5
+ import { useUntil as ne } from "./index270.js";
6
+ import { wait as ae } from "./index135.js";
7
+ import le from "./index13.js";
8
+ /* empty css */
9
+ import B from "./index85.js";
10
+ /* empty css */
11
+ import se from "./index271.js";
5
12
  /* empty css */
6
- const le = ["accept", "autofocus", "disabled", "multiple"], se = { class: "bb-dropzone__submittable-label" }, ne = ["id", "disabled", "multiple", "name"], ie = { class: "bb-dropzone__errors" }, fe = /* @__PURE__ */ j({
7
- __name: "BbDropzone",
13
+ import O from "./index273.js";
14
+ const ie = ["id", "aria-labelledby", "inert"], re = { class: "item__content" }, $e = /* @__PURE__ */ U({
15
+ __name: "BbDropdown",
8
16
  props: {
9
- autofocus: {},
17
+ arrowPadding: { default: 10 },
18
+ block: { type: Boolean },
10
19
  disabled: { type: Boolean },
11
- errors: {},
12
- hasErrors: { type: Boolean },
20
+ eager: { type: Boolean },
13
21
  id: {},
14
- multiple: { type: Boolean },
15
- name: {},
16
- accept: {},
17
- maxFiles: {},
18
- maxSize: {},
19
- modelValue: {},
20
- tag: { default: "div" }
22
+ offset: { default: 3 },
23
+ padding: { default: 6 },
24
+ placement: { default: "bottom" },
25
+ theme: { default: "default" },
26
+ transitionDuration: { default: 300 },
27
+ teleportTarget: {},
28
+ items: {},
29
+ width: { default: 200 }
21
30
  },
22
- emits: ["blur", "error", "focus", "update:modelValue"],
23
- setup(D, { emit: C }) {
24
- let b;
25
- const a = D, l = C, d = g(null);
26
- if (a.accept && !Array.isArray(a.accept))
27
- throw new Error("Property accept is not an array");
28
- if (a.multiple && !Array.isArray(a.modelValue))
29
- throw new Error(
30
- "Component is set to multiple but modelValue is not an array"
31
+ setup(K) {
32
+ const u = K, d = u.id ?? `bb_${te().id.value}`, c = V(() => {
33
+ let e = u.items.findIndex((o) => !o.disabled), a = _(
34
+ u.items,
35
+ (o) => !o.disabled
31
36
  );
32
- const h = g(!1), I = (e) => {
33
- h.value = !0, l("focus", e);
34
- }, L = (e) => {
35
- h.value = !1, l("blur", e);
36
- };
37
- x(
38
- () => a.modelValue,
39
- () => {
40
- let e = new DataTransfer();
41
- Array.isArray(a.modelValue) ? a.modelValue.length && a.modelValue.forEach((t) => e.items.add(t)) : a.modelValue && e.items.add(a.modelValue), d.value && (e.items.length ? d.value.files = e.files : d.value.files = null);
42
- }
43
- );
44
- const p = g([]), P = m(
45
- () => p.value.join(",")
46
- );
47
- x(
48
- () => a.accept,
49
- async () => {
50
- if (a.accept) {
51
- let e = [];
52
- for (let t = 0; t < a.accept.length; t++) {
53
- const r = a.accept[t];
54
- if (r.includes("/")) e.push(r);
55
- else {
56
- b || (b = (await import("./index272.js")).default);
57
- const o = b.getType(r);
58
- if (!o)
59
- throw new Error(
60
- `Could not detect the correct mime associated with ${r}`
37
+ return u.items.map((o, t) => {
38
+ const n = `${d}-item-${o.key}`, { onClick: S, ...C } = o, N = async () => {
39
+ await f();
40
+ const s = document.querySelector(`#${d}`);
41
+ if (s) s instanceof HTMLElement && s.focus();
42
+ else return;
43
+ S && S();
44
+ }, R = (s) => {
45
+ if (s.target instanceof HTMLElement && s.target.dataset.dropdownItem) {
46
+ if (!i.value) return;
47
+ if (s.key === "ArrowDown") {
48
+ if (s.preventDefault(), i.value && t !== a) {
49
+ const r = i.value.querySelector(
50
+ O.map((y) => `#${n} ~ ${y}`).join(",")
61
51
  );
62
- e.push(o);
52
+ r && r instanceof HTMLElement && r.focus();
53
+ }
54
+ } else if (s.key === "ArrowUp") {
55
+ if (s.preventDefault(), i.value && t !== e) {
56
+ const r = _(u.items, (k, $) => $ < t && !k.disabled), w = Array.from(
57
+ i.value.querySelectorAll(".bb-dropdown__item")
58
+ )[r];
59
+ w && w instanceof HTMLElement && w.focus();
60
+ }
61
+ } else if (s.key === "Tab") {
62
+ if (t === a && !s.shiftKey) {
63
+ const r = O.join(","), y = Array.from(
64
+ document.querySelectorAll(r)
65
+ ), w = y.findIndex(
66
+ ($) => $.id === d
67
+ ), k = y[w + 1];
68
+ if (k) k instanceof HTMLElement && (s.preventDefault(), f(), k.focus());
69
+ else return;
70
+ } else if (t === e && s.shiftKey) {
71
+ const r = document.querySelector(`#${d}`);
72
+ if (r) r instanceof HTMLElement && (s.preventDefault(), r.focus());
73
+ else return;
74
+ }
63
75
  }
64
76
  }
65
- p.value = e;
66
- }
77
+ };
78
+ return {
79
+ ...C,
80
+ original: o,
81
+ key: o.key.split(/\W+/g).join("_").toLowerCase(),
82
+ disabled: C.disabled || u.disabled,
83
+ id: n,
84
+ onClick: N,
85
+ onKeydown: R
86
+ };
87
+ });
88
+ }), m = q("wrapper"), i = q("content");
89
+ oe(
90
+ m,
91
+ ([{ intersectionRatio: e }]) => {
92
+ e !== 1 && l.value && f();
67
93
  },
68
- { immediate: !0 }
94
+ { threshold: [0, 1] }
69
95
  );
70
- const z = a.id || `${re().id.value}`, v = `bb_dz_${z}`, i = g(!1);
71
- let T;
72
- const k = m(() => ({
73
- "bb-dropzone": !0,
74
- "bb-dropzone--errors": R.value,
75
- "bb-dropzone--dragging": i.value
76
- })), q = m(() => ({
77
- dragging: i.value,
78
- focused: h.value,
79
- id: z
80
- })), $ = (e) => {
81
- if (i.value = !1, e.dataTransfer) {
82
- e.stopImmediatePropagation();
83
- let t;
84
- if (t = Array.from(e.dataTransfer.files), t = B(t), a.multiple ? Array.isArray(a.modelValue) && l("update:modelValue", [...a.modelValue, ...t]) : (t = t[0], l("update:modelValue", t)), e.currentTarget instanceof HTMLLabelElement) {
85
- const r = e.currentTarget.querySelector("input[type=file]");
86
- r instanceof HTMLInputElement && r.focus();
96
+ const l = F(!1), g = ne(l), P = () => {
97
+ l.value ? f() : E();
98
+ }, j = async (e) => {
99
+ let a = u.items.findIndex((t) => !t.disabled), o = _(
100
+ u.items,
101
+ (t) => !t.disabled
102
+ );
103
+ if (e.key === "ArrowDown") {
104
+ if (e.preventDefault(), l.value || await E(), i.value && c.value.length && a !== -1) {
105
+ const t = c.value[a].id, n = i.value.querySelector(`#${t}`);
106
+ n && n instanceof HTMLElement && n.focus();
107
+ }
108
+ } else if (e.key === "ArrowUp") {
109
+ if (e.preventDefault(), l.value || await E(), i.value && c.value.length && o !== -1) {
110
+ const t = c.value[o].id, n = i.value.querySelector(`#${t}`);
111
+ n && n instanceof HTMLElement && n.focus();
87
112
  }
113
+ } else if (e.key === "Tab" && l.value && !e.shiftKey && (e.preventDefault(), i.value && c.value.length && a !== -1)) {
114
+ const t = c.value[a].id, n = i.value.querySelector(`#${t}`);
115
+ n && n instanceof HTMLElement && n.focus();
88
116
  }
89
117
  }, H = (e) => {
90
- if (e.target instanceof HTMLInputElement) {
91
- if (e.target.files) {
92
- let t;
93
- t = B(Array.from(e.target.files)), a.multiple ? Array.isArray(a.modelValue) && l("update:modelValue", [...a.modelValue, ...t]) : (t = t[0], l("update:modelValue", t));
94
- }
95
- e.target.value = "", e.target.files = null;
118
+ const a = e.target;
119
+ if (a && a instanceof HTMLElement) {
120
+ let o = !0;
121
+ m.value && m.value.$el.contains(a) && (o = !1), i.value && i.value.contains(a) && (o = !1), o && f();
96
122
  }
97
- }, B = (e) => e.filter((t, r) => {
98
- if (a.maxSize && !(t.size <= a.maxSize))
99
- return l("error", f.maxSize(t)), !1;
100
- let o = !1;
101
- return a.modelValue && (Array.isArray(a.modelValue) ? o = a.modelValue.some(
102
- (s) => S(s, t)
103
- ) : o = S(a.modelValue, t)), o ? (l("error", f.uniqueness(t)), !1) : a.accept && !p.value.some((n) => {
104
- let u = !1;
105
- return n.includes("*") ? u = u || n.split("/")[0] === t.type.split("/")[0] : u = u || n === t.type, u;
106
- }) ? (l("error", f.accept(t)), !1) : a.maxFiles && Array.isArray(a.modelValue) && a.modelValue.length + r + 1 > a.maxFiles ? (l(
107
- "error",
108
- f.maxFiles(t, a.modelValue.length + r + 1)
109
- ), !1) : !0;
110
- }), N = (e) => {
111
- const t = e.target;
112
- if (t instanceof HTMLElement) {
113
- const r = ae(
114
- [t],
115
- "parentElement",
116
- (o) => o.classList.contains("bb-dropzone")
117
- );
118
- r && (r.id === v ? E() : _());
123
+ }, I = (e) => {
124
+ const a = e.target;
125
+ if (a && a instanceof HTMLElement) {
126
+ let o = !0;
127
+ m.value && m.value.$el.contains(a) && (o = !1), o && f();
119
128
  }
120
- }, E = () => {
121
- clearTimeout(T), i.value = !0;
122
- }, _ = () => {
123
- T = setTimeout(() => {
124
- i.value = !1;
125
- }, 100);
126
- }, A = (e, t = 2) => {
127
- if (!e) return "0 B";
128
- const r = 1024, o = t || 0, s = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"], n = Math.floor(Math.log(e) / Math.log(r));
129
- return parseFloat((e / Math.pow(r, n)).toFixed(o)) + " " + s[n];
130
- }, S = (e, t) => !["name", "size", "lastModified", "type"].some((o) => e[o] !== t[o]), f = {
131
- maxSize: (e) => {
132
- if (a.maxSize)
133
- return {
134
- type: "maxSize",
135
- file: e,
136
- formattedMaxSize: A(+a.maxSize),
137
- formattedSize: A(e.size),
138
- filename: e.name
139
- };
140
- throw new Error(
141
- "Requested to create an error for maxSize without providing a maxSize."
142
- );
143
- },
144
- uniqueness: (e) => ({
145
- type: "uniqueness",
146
- file: e,
147
- filename: e.name
148
- }),
149
- accept: (e) => ({
150
- type: "accept",
151
- file: e,
152
- acceptedMimeTypes: p.value,
153
- mimeType: e.type,
154
- filename: e.name
155
- }),
156
- maxFiles: (e, t) => ({
157
- type: "maxFiles",
158
- file: e,
159
- maxFiles: a.maxFiles,
160
- totalFiles: t,
161
- filename: e.name
162
- })
163
- }, w = m(() => a.errors ? [].concat(a.errors) : []), R = m(
164
- () => !!w.value.length || a.hasErrors
165
- );
166
- return (e, t) => (V(), G(K(e.tag), {
167
- id: v,
168
- class: O(k.value)
129
+ }, M = (e) => {
130
+ var a;
131
+ if (l.value && e.key === "Escape") {
132
+ if (((a = document.activeElement) == null ? void 0 : a.id) !== d) {
133
+ const o = document.querySelector(`#${d}`);
134
+ o instanceof HTMLElement && o.focus();
135
+ }
136
+ f();
137
+ }
138
+ }, z = F(!1), E = async () => {
139
+ z.value = !0, await ae(50), l.value = !0, document.addEventListener("click", H, { passive: !0 }), document.addEventListener("focusin", I, { passive: !0 }), document.addEventListener("keydown", M, { passive: !0 });
140
+ }, f = async () => {
141
+ l.value = !1, document.removeEventListener("click", H), document.removeEventListener("focusin", I), document.removeEventListener("keydown", M);
142
+ };
143
+ return (e, a) => (b(), h(se, {
144
+ ref_key: "wrapper",
145
+ ref: m,
146
+ "arrow-padding": e.arrowPadding,
147
+ block: e.block,
148
+ class: W(["bb-dropdown", {
149
+ [`bb-dropdown--${e.theme}`]: !0
150
+ }]),
151
+ "model-value": l.value,
152
+ offset: e.offset,
153
+ padding: e.padding,
154
+ placement: e.placement,
155
+ "transition-duration": e.transitionDuration
169
156
  }, {
170
- default: M(() => [
171
- c("label", {
172
- onDragenter: y(E, ["prevent"]),
173
- onDragleave: y(_, ["prevent"]),
174
- onDragover: y(N, ["prevent"]),
175
- onDrop: y($, ["prevent"])
157
+ activator: L(() => [
158
+ v(e.$slots, "activator", x(ee({
159
+ props: {
160
+ "aria-expanded": p(g) ? l.value : !1,
161
+ "aria-controls": p(g) ? `menu_${p(d)}` : void 0,
162
+ id: p(d),
163
+ onClick: P,
164
+ onKeydown: j,
165
+ disabled: e.disabled
166
+ },
167
+ disabled: e.disabled,
168
+ open: l.value,
169
+ placement: e.placement
170
+ })))
171
+ ]),
172
+ default: L(() => [
173
+ p(g) ? (b(), T("span", {
174
+ key: 0,
175
+ id: `menu_${p(d)}`,
176
+ ref_key: "content",
177
+ ref: i,
178
+ "aria-labelledby": p(d),
179
+ "aria-role": "menu",
180
+ class: "bb-dropdown__items-container",
181
+ inert: !l.value,
182
+ style: G({ width: `${e.width}px` })
176
183
  }, [
177
- c("input", {
178
- accept: P.value,
179
- autofocus: e.autofocus,
180
- class: "sr-only",
184
+ v(e.$slots, "prepend", {
181
185
  disabled: e.disabled,
182
- multiple: e.multiple,
183
- type: "file",
184
- onBlur: L,
185
- onChange: H,
186
- onFocus: I
187
- }, null, 40, le),
188
- U(e.$slots, "default", Y(Z(q.value)))
189
- ], 32),
190
- c("label", se, [
191
- t[0] || (t[0] = J(" Server files ")),
192
- c("input", {
193
- id: Q(z),
194
- ref_key: "submittable",
195
- ref: d,
196
- class: "bb-dropzone__submittable-input",
186
+ open: l.value,
187
+ placement: e.placement
188
+ }),
189
+ (b(!0), T(A, null, J(c.value, ({ original: o, ...t }, n) => (b(), T(A, {
190
+ key: t.key
191
+ }, [
192
+ v(e.$slots, "item:prepend", {
193
+ disabled: t.disabled,
194
+ index: n,
195
+ item: e.items[n],
196
+ open: l.value,
197
+ placement: e.placement,
198
+ text: t.text
199
+ }),
200
+ Q(le, X({
201
+ "aria-role": "menuitem",
202
+ class: ["bb-dropdown__item", {
203
+ "bb-dropdown__item--first": n === 0,
204
+ "bb-dropdown__item--last": n === e.items.length - 1
205
+ }],
206
+ "data-dropdown-item": !0,
207
+ ref_for: !0
208
+ }, t), {
209
+ default: L(() => [
210
+ v(e.$slots, t.key, {
211
+ disabled: t.disabled,
212
+ index: n,
213
+ item: o,
214
+ open: l.value,
215
+ placement: e.placement,
216
+ text: t.text
217
+ }, () => [
218
+ t["prepend:icon"] ? (b(), h(B, {
219
+ key: 0,
220
+ class: "item__prepend-icon",
221
+ type: t["prepend:icon"]
222
+ }, null, 8, ["type"])) : D("", !0),
223
+ Y("span", re, Z(t.text), 1),
224
+ t["append:icon"] ? (b(), h(B, {
225
+ key: 1,
226
+ class: "item__append-icon",
227
+ type: t["append:icon"]
228
+ }, null, 8, ["type"])) : D("", !0)
229
+ ])
230
+ ]),
231
+ _: 2
232
+ }, 1040, ["class"]),
233
+ v(e.$slots, "item:append", {
234
+ disabled: t.disabled,
235
+ index: n,
236
+ item: e.items[n],
237
+ open: l.value,
238
+ placement: e.placement,
239
+ text: t.text
240
+ })
241
+ ], 64))), 128)),
242
+ v(e.$slots, "append", {
197
243
  disabled: e.disabled,
198
- multiple: e.multiple,
199
- name: e.name,
200
- type: "file"
201
- }, null, 8, ne)
202
- ]),
203
- c("span", ie, [
204
- W(oe, { tag: "span" }, {
205
- default: M(() => [
206
- (V(!0), F(X, null, ee(w.value, (r) => (V(), F("span", {
207
- key: r,
208
- class: "bb-dropzone__error"
209
- }, te(r), 1))), 128))
210
- ]),
211
- _: 1
244
+ open: l.value,
245
+ placement: e.placement
212
246
  })
213
- ])
247
+ ], 12, ie)) : D("", !0)
214
248
  ]),
215
249
  _: 3
216
- }, 8, ["class"]));
250
+ }, 8, ["arrow-padding", "block", "class", "model-value", "offset", "padding", "placement", "transition-duration"]));
217
251
  }
218
252
  });
219
253
  export {
220
- fe as default
254
+ $e as default
221
255
  };
package/dist/index81.js CHANGED
@@ -1,46 +1,154 @@
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 "./index271.js";
3
- const M = /* @__PURE__ */ h({
4
- __name: "BbIntersection",
1
+ import { defineComponent as j, ref as N, computed as g, createElementBlock as $, openBlock as l, mergeProps as y, unref as d, createVNode as u, withCtx as n, createBlock as L, createCommentVNode as _, createElementVNode as b, toDisplayString as v, createSlots as V, renderSlot as r, normalizeProps as s, guardReactiveProps as p, renderList as E } from "vue";
2
+ import C from "./index13.js";
3
+ /* empty css */
4
+ import A from "./index79.js";
5
+ /* empty css */
6
+ /* empty css */
7
+ /* empty css */
8
+ import z from "./index85.js";
9
+ /* empty css */
10
+ import I from "./index113.js";
11
+ /* empty css */
12
+ import { useLocale as M } from "./index219.js";
13
+ const O = { class: "bb-dropdown-button__content" }, R = {
14
+ key: 1,
15
+ class: "bb-dropdown-button__loading-label sr-only"
16
+ }, T = { class: "bb-dropdown-button__dropdown-label sr-only" }, ee = /* @__PURE__ */ j({
17
+ __name: "BbDropdownButton",
5
18
  props: {
6
- debounceTime: { default: 0 },
7
- options: { default: () => ({
8
- root: null,
9
- threshold: [0, 0.2, 0.4, 0.6, 0.8, 1]
10
- }) },
11
- tag: { default: "div" }
19
+ arrowPadding: {},
20
+ block: { type: Boolean },
21
+ disabled: { type: Boolean },
22
+ eager: { type: Boolean },
23
+ id: {},
24
+ items: {},
25
+ offset: {},
26
+ padding: {},
27
+ placement: {},
28
+ theme: { default: "default" },
29
+ transitionDuration: {},
30
+ width: {},
31
+ autoLoading: { type: Boolean, default: !0 },
32
+ "append:icon": {},
33
+ disabledWhileLoading: { type: Boolean, default: !0 },
34
+ loading: { type: Boolean },
35
+ "prepend:icon": {},
36
+ size: {}
12
37
  },
13
- emits: ["shown", "hidden", "intersected"],
14
- setup(u, { emit: d }) {
15
- const r = u, i = d, n = t(null), l = t(null), o = t(!1), s = t(!0), a = t(0);
16
- m(() => {
17
- n.value = new IntersectionObserver((e) => {
18
- f(e[0]);
19
- }, r.options), l.value && n.value.observe(l.value);
20
- }), p(() => {
21
- n.value && n.value.disconnect();
22
- });
23
- const f = c((e) => {
24
- e.isIntersecting ? (a.value = Math.trunc(e.intersectionRatio * 100), e.intersectionRatio === 1 ? (o.value = !0, s.value = !1, i("shown")) : (o.value = !1, s.value = !1, v(Math.trunc(e.intersectionRatio * 100)))) : (o.value = !1, s.value = !0, i("hidden"));
25
- }), v = c((e) => {
26
- i("intersected", e);
27
- }, r.debounceTime);
28
- return (e, B) => (g(), b(w(e.tag), {
29
- ref_key: "infinitescrolltrigger",
30
- ref: l,
31
- class: "bb-intersection"
32
- }, {
33
- default: _(() => [
34
- I(e.$slots, "default", {
35
- hidden: s.value,
36
- percentage: a.value,
37
- shown: o.value
38
- })
39
- ]),
40
- _: 3
41
- }, 512));
38
+ setup(P) {
39
+ const t = P, { t: m } = M(), c = N(0), f = g(
40
+ () => t.loading || !!c.value && t.autoLoading
41
+ ), D = (e) => async (...a) => {
42
+ f.value && t.disabledWhileLoading || (c.value++, await e(...a), c.value--);
43
+ }, w = g(
44
+ () => t.items.map((e) => e.onClick ? {
45
+ ...e,
46
+ key: e.key.split(/\W+/g).join("_").toLowerCase(),
47
+ onClick: D(e.onClick)
48
+ } : {
49
+ ...e,
50
+ key: e.key.split(/\W+/g).join("_").toLowerCase()
51
+ })
52
+ ), h = g(() => {
53
+ const e = { ...w.value[0] };
54
+ return e.disabled = e.disabled || t.disabled, e;
55
+ }), S = typeof t.size == "string" ? { default: t.size } : { default: "md", ...t.size }, W = Object.entries(S).reduce(
56
+ (e, [a, o]) => (a === "default" ? e[`data-${o}`] = "" : e[`data-${a}:${o}`] = "", e),
57
+ {}
58
+ );
59
+ return (e, a) => (l(), $("span", y({
60
+ class: ["bb-dropdown-button", {
61
+ "bb-dropdown-button--block": e.block,
62
+ "bb-dropdown-button--loading": f.value,
63
+ [`bb-dropdown-button--${e.theme}`]: !0
64
+ }]
65
+ }, d(W)), [
66
+ u(C, y(h.value, { class: "bb-dropdown-button__main-btn" }), {
67
+ default: n(() => [
68
+ u(d(I), { class: "bb-dropdown-button__spinner" }),
69
+ t["prepend:icon"] ? (l(), L(d(z), {
70
+ key: 0,
71
+ class: "bb-dropdown-button__prepend-icon",
72
+ type: t["prepend:icon"]
73
+ }, null, 8, ["type"])) : _("", !0),
74
+ b("span", O, v(h.value.text), 1),
75
+ f.value ? (l(), $("span", R, v(d(m)("common.loadingText").value), 1)) : _("", !0),
76
+ t["append:icon"] ? (l(), L(d(z), {
77
+ key: 2,
78
+ class: "bb-dropdown-button__append-icon",
79
+ type: t["append:icon"]
80
+ }, null, 8, ["type"])) : _("", !0)
81
+ ]),
82
+ _: 1
83
+ }, 16),
84
+ u(A, {
85
+ id: e.id,
86
+ "arrow-padding": e.arrowPadding,
87
+ disabled: e.disabled,
88
+ eager: e.eager,
89
+ items: w.value,
90
+ offset: e.offset,
91
+ padding: e.padding,
92
+ placement: e.placement,
93
+ theme: e.theme,
94
+ "transition-duration": e.transitionDuration,
95
+ width: e.width
96
+ }, V({
97
+ activator: n(({ props: o, open: i, disabled: k, placement: B }) => [
98
+ r(e.$slots, "activator", {
99
+ disabled: k,
100
+ open: i,
101
+ placement: B,
102
+ props: o
103
+ }, () => [
104
+ u(C, y(o, { class: "bb-dropdown-button__dropdown-btn" }), {
105
+ default: n(() => [
106
+ b("span", T, v(i ? d(m)("dropdownButton.close").value : d(m)("dropdownButton.open").value), 1),
107
+ r(e.$slots, "right-btn", {
108
+ disabled: k,
109
+ open: i,
110
+ placement: B
111
+ }, () => [
112
+ a[0] || (a[0] = b("svg", {
113
+ class: "bb-dropdown-button__dropdown-chevron",
114
+ viewBox: "0 0 24 24",
115
+ xmlns: "http://www.w3.org/2000/svg"
116
+ }, [
117
+ b("path", {
118
+ d: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6l1.41 1.41Z",
119
+ fill: "currentColor"
120
+ })
121
+ ], -1))
122
+ ])
123
+ ]),
124
+ _: 2
125
+ }, 1040)
126
+ ])
127
+ ]),
128
+ prepend: n((o) => [
129
+ r(e.$slots, "prepend", s(p(o)))
130
+ ]),
131
+ "item:prepend": n((o) => [
132
+ r(e.$slots, "item:prepend", s(p(o)))
133
+ ]),
134
+ "item:append": n((o) => [
135
+ r(e.$slots, "item:append", s(p(o)))
136
+ ]),
137
+ append: n((o) => [
138
+ r(e.$slots, "append", s(p(o)))
139
+ ]),
140
+ _: 2
141
+ }, [
142
+ E(w.value, (o) => ({
143
+ name: o.key,
144
+ fn: n((i) => [
145
+ r(e.$slots, o.key, s(p(i)))
146
+ ])
147
+ }))
148
+ ]), 1032, ["id", "arrow-padding", "disabled", "eager", "items", "offset", "padding", "placement", "theme", "transition-duration", "width"])
149
+ ], 16));
42
150
  }
43
151
  });
44
152
  export {
45
- M as default
153
+ ee as default
46
154
  };