bitboss-ui 0.2.31 → 0.2.32

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 (326) hide show
  1. package/dist/components/BaseButton/BaseButton.vue.d.ts +6 -6
  2. package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +16 -16
  3. package/dist/components/BaseCheckboxGroup/BaseCheckboxGroup.vue.d.ts +36 -36
  4. package/dist/components/BaseDatePicker/BaseDatePicker.vue.d.ts +20 -20
  5. package/dist/components/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +21 -21
  6. package/dist/components/BaseDialog/BaseDialog.vue.d.ts +8 -8
  7. package/dist/components/BaseInputContainer/BaseInputContainer.vue.d.ts +6 -6
  8. package/dist/components/BaseNumberInput/BaseNumberInput.vue.d.ts +20 -20
  9. package/dist/components/BaseRadio/BaseRadio.vue.d.ts +20 -20
  10. package/dist/components/BaseRadioGroup/BaseRadioGroup.vue.d.ts +36 -36
  11. package/dist/components/BaseRating/BaseRating.vue.d.ts +17 -17
  12. package/dist/components/BaseSelect/BaseSelect.vue.d.ts +23 -23
  13. package/dist/components/BaseSlider/BaseSlider.vue.d.ts +15 -15
  14. package/dist/components/BaseSwitch/BaseSwitch.vue.d.ts +1 -1
  15. package/dist/components/BaseSwitchGroup/BaseSwitchGroup.vue.d.ts +20 -20
  16. package/dist/components/BaseTag/BaseTag.vue.d.ts +20 -20
  17. package/dist/components/BaseTextInput/BaseTextInput.vue.d.ts +19 -19
  18. package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +18 -18
  19. package/dist/components/BbAccordion/BbAccordion.vue.d.ts +3 -3
  20. package/dist/components/BbAlert/BbAlert.vue.d.ts +3 -3
  21. package/dist/components/BbAvatar/BbAvatar.vue.d.ts +8 -8
  22. package/dist/components/BbBadge/BbBadge.vue.d.ts +1 -1
  23. package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue.d.ts +6 -6
  24. package/dist/components/BbButton/BbButton.vue.d.ts +1 -1
  25. package/dist/components/BbCheckbox/BbCheckbox.vue.d.ts +11 -11
  26. package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +27 -27
  27. package/dist/components/BbChip/BbChip.vue.d.ts +2 -2
  28. package/dist/components/BbConfirm/BbConfirm.vue.d.ts +4 -4
  29. package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +16 -24
  30. package/dist/components/BbDialog/BbDialog.vue.d.ts +2 -2
  31. package/dist/components/BbDropdown/BbDropdown.vue.d.ts +11 -11
  32. package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +14 -14
  33. package/dist/components/BbDropzone/BbDropzone.vue.d.ts +4 -4
  34. package/dist/components/BbIntersection/BbIntersection.vue.d.ts +3 -3
  35. package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +10 -10
  36. package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +9 -9
  37. package/dist/components/BbPagination/BbPagination.vue.d.ts +1 -1
  38. package/dist/components/BbPopover/BbPopover.vue.d.ts +8 -8
  39. package/dist/components/BbRadio/BbRadio.vue.d.ts +10 -10
  40. package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +27 -27
  41. package/dist/components/BbRating/BbRating.vue.d.ts +10 -10
  42. package/dist/components/BbSelect/BbSelect.vue.d.ts +19 -19
  43. package/dist/components/BbSlider/BbSlider.vue.d.ts +8 -8
  44. package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +1 -1
  45. package/dist/components/BbSpinner/BbSpinner.vue.d.ts +2 -2
  46. package/dist/components/BbSwitch/BbSwitch.vue.d.ts +2 -2
  47. package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +20 -20
  48. package/dist/components/BbTab/BbTab.vue.d.ts +5 -5
  49. package/dist/components/BbTable/BbTable.vue.d.ts +11 -11
  50. package/dist/components/BbTable/types.d.ts +107 -107
  51. package/dist/components/BbTag/BbTag.vue.d.ts +13 -13
  52. package/dist/components/BbTextInput/BbTextInput.vue.d.ts +11 -11
  53. package/dist/components/BbTextarea/BbTextarea.vue.d.ts +10 -10
  54. package/dist/components/BbToast/BbToast.vue.d.ts +1 -1
  55. package/dist/components/BbToast/BbToastMessage.vue.d.ts +1 -1
  56. package/dist/components/BbTooltip/BbTooltip.vue.d.ts +3 -3
  57. package/dist/components/BbTree/BbTree.vue.d.ts +1 -1
  58. package/dist/composables/useConfirm.d.ts +10 -10
  59. package/dist/composables/useOptions.d.ts +2 -2
  60. package/dist/composables/useRoute.d.ts +2 -2
  61. package/dist/composables/useRouter.d.ts +1 -1
  62. package/dist/composables/useToast.d.ts +5 -5
  63. package/dist/composables/useWizard.d.ts +1 -1
  64. package/dist/index.d.ts +126 -126
  65. package/dist/index101.js +32 -37
  66. package/dist/index101.js.map +1 -1
  67. package/dist/index103.js +19 -19
  68. package/dist/index103.js.map +1 -1
  69. package/dist/index105.js +16 -16
  70. package/dist/index105.js.map +1 -1
  71. package/dist/index107.js +15 -15
  72. package/dist/index107.js.map +1 -1
  73. package/dist/index109.js.map +1 -1
  74. package/dist/index11.js +7 -7
  75. package/dist/index11.js.map +1 -1
  76. package/dist/index111.js +16 -16
  77. package/dist/index111.js.map +1 -1
  78. package/dist/index113.js +3 -3
  79. package/dist/index113.js.map +1 -1
  80. package/dist/index115.js +6 -6
  81. package/dist/index115.js.map +1 -1
  82. package/dist/index116.js +1 -1
  83. package/dist/index116.js.map +1 -1
  84. package/dist/index117.js +1 -1
  85. package/dist/index117.js.map +1 -1
  86. package/dist/index118.js +4 -4
  87. package/dist/index118.js.map +1 -1
  88. package/dist/index119.js +5 -5
  89. package/dist/index119.js.map +1 -1
  90. package/dist/index120.js.map +1 -1
  91. package/dist/index121.js.map +1 -1
  92. package/dist/index122.js.map +1 -1
  93. package/dist/index124.js.map +1 -1
  94. package/dist/index125.js +4 -4
  95. package/dist/index125.js.map +1 -1
  96. package/dist/index126.js +1 -1
  97. package/dist/index126.js.map +1 -1
  98. package/dist/index127.js +1 -1
  99. package/dist/index128.js +4 -1
  100. package/dist/index128.js.map +1 -1
  101. package/dist/index129.js.map +1 -1
  102. package/dist/index13.js +11 -11
  103. package/dist/index13.js.map +1 -1
  104. package/dist/index130.js.map +1 -1
  105. package/dist/index131.js +2 -2
  106. package/dist/index15.js +226 -224
  107. package/dist/index15.js.map +1 -1
  108. package/dist/index17.js +61 -62
  109. package/dist/index17.js.map +1 -1
  110. package/dist/index19.js +22 -22
  111. package/dist/index19.js.map +1 -1
  112. package/dist/index196.js.map +1 -1
  113. package/dist/index197.js +2 -5
  114. package/dist/index197.js.map +1 -1
  115. package/dist/index198.js +4 -16
  116. package/dist/index198.js.map +1 -1
  117. package/dist/index199.js +293 -14
  118. package/dist/index199.js.map +1 -1
  119. package/dist/index2.js +23 -23
  120. package/dist/index2.js.map +1 -1
  121. package/dist/index200.js +15 -18
  122. package/dist/index200.js.map +1 -1
  123. package/dist/index201.js +13 -17
  124. package/dist/index201.js.map +1 -1
  125. package/dist/index202.js +18 -28
  126. package/dist/index202.js.map +1 -1
  127. package/dist/index203.js +20 -8
  128. package/dist/index203.js.map +1 -1
  129. package/dist/index204.js +29 -2
  130. package/dist/index204.js.map +1 -1
  131. package/dist/index205.js +8 -378
  132. package/dist/index205.js.map +1 -1
  133. package/dist/index206.js +2 -134
  134. package/dist/index206.js.map +1 -1
  135. package/dist/index207.js +235 -2
  136. package/dist/index207.js.map +1 -1
  137. package/dist/index208.js +3 -174
  138. package/dist/index208.js.map +1 -1
  139. package/dist/index209.js +35 -23
  140. package/dist/index209.js.map +1 -1
  141. package/dist/index21.js +4 -4
  142. package/dist/index21.js.map +1 -1
  143. package/dist/index210.js +6 -373
  144. package/dist/index210.js.map +1 -1
  145. package/dist/index211.js +10 -2
  146. package/dist/index211.js.map +1 -1
  147. package/dist/index212.js +378 -4
  148. package/dist/index212.js.map +1 -1
  149. package/dist/index213.js +134 -3
  150. package/dist/index213.js.map +1 -1
  151. package/dist/index214.js +2 -3
  152. package/dist/index214.js.map +1 -1
  153. package/dist/index215.js +172 -8
  154. package/dist/index215.js.map +1 -1
  155. package/dist/index216.js +23 -3
  156. package/dist/index216.js.map +1 -1
  157. package/dist/index217.js +369 -31
  158. package/dist/index217.js.map +1 -1
  159. package/dist/index218.js +3 -6
  160. package/dist/index218.js.map +1 -1
  161. package/dist/index219.js +3 -2
  162. package/dist/index219.js.map +1 -1
  163. package/dist/index220.js.map +1 -1
  164. package/dist/index221.js +26 -233
  165. package/dist/index221.js.map +1 -1
  166. package/dist/index222.js +16 -8
  167. package/dist/index222.js.map +1 -1
  168. package/dist/index223.js +2 -121
  169. package/dist/index223.js.map +1 -1
  170. package/dist/index224.js +8 -27
  171. package/dist/index224.js.map +1 -1
  172. package/dist/index225.js +120 -12
  173. package/dist/index225.js.map +1 -1
  174. package/dist/index226.js +1 -1
  175. package/dist/index227.js +4 -295
  176. package/dist/index227.js.map +1 -1
  177. package/dist/index228.js +2 -6
  178. package/dist/index228.js.map +1 -1
  179. package/dist/index229.js +6 -2
  180. package/dist/index229.js.map +1 -1
  181. package/dist/index23.js +14 -16
  182. package/dist/index23.js.map +1 -1
  183. package/dist/index230.js +2 -2
  184. package/dist/index235.js +2 -2
  185. package/dist/index236.js +428 -110
  186. package/dist/index236.js.map +1 -1
  187. package/dist/index237.js +88 -105
  188. package/dist/index237.js.map +1 -1
  189. package/dist/index238.js +199 -3
  190. package/dist/index238.js.map +1 -1
  191. package/dist/index239.js +1 -1
  192. package/dist/index240.js +1 -1
  193. package/dist/index241.js +2 -435
  194. package/dist/index241.js.map +1 -1
  195. package/dist/index242.js +115 -87
  196. package/dist/index242.js.map +1 -1
  197. package/dist/index243.js +104 -198
  198. package/dist/index243.js.map +1 -1
  199. package/dist/index244.js +160 -2
  200. package/dist/index244.js.map +1 -1
  201. package/dist/index245.js +2 -2
  202. package/dist/index245.js.map +1 -1
  203. package/dist/index246.js +9 -9
  204. package/dist/index246.js.map +1 -1
  205. package/dist/index247.js +5 -162
  206. package/dist/index247.js.map +1 -1
  207. package/dist/index248.js +1 -1
  208. package/dist/index249.js +37 -14
  209. package/dist/index249.js.map +1 -1
  210. package/dist/index25.js +4 -4
  211. package/dist/index25.js.map +1 -1
  212. package/dist/index250.js +2 -38
  213. package/dist/index250.js.map +1 -1
  214. package/dist/index251.js +2 -2
  215. package/dist/index251.js.map +1 -1
  216. package/dist/index252.js +15 -2
  217. package/dist/index252.js.map +1 -1
  218. package/dist/index253.js +3 -2
  219. package/dist/index253.js.map +1 -1
  220. package/dist/index255.js +2 -3
  221. package/dist/index255.js.map +1 -1
  222. package/dist/index27.js +7 -7
  223. package/dist/index27.js.map +1 -1
  224. package/dist/index29.js +15 -15
  225. package/dist/index29.js.map +1 -1
  226. package/dist/index3.js +2 -1
  227. package/dist/index3.js.map +1 -1
  228. package/dist/index31.js +28 -28
  229. package/dist/index31.js.map +1 -1
  230. package/dist/index33.js +10 -11
  231. package/dist/index33.js.map +1 -1
  232. package/dist/index35.js +2 -2
  233. package/dist/index35.js.map +1 -1
  234. package/dist/index37.js +12 -12
  235. package/dist/index37.js.map +1 -1
  236. package/dist/index39.js +5 -7
  237. package/dist/index39.js.map +1 -1
  238. package/dist/index4.js.map +1 -1
  239. package/dist/index41.js +5 -5
  240. package/dist/index41.js.map +1 -1
  241. package/dist/index43.js +19 -16
  242. package/dist/index43.js.map +1 -1
  243. package/dist/index45.js +9 -9
  244. package/dist/index45.js.map +1 -1
  245. package/dist/index47.js +4 -4
  246. package/dist/index47.js.map +1 -1
  247. package/dist/index49.js +1 -1
  248. package/dist/index49.js.map +1 -1
  249. package/dist/index5.js +7 -6
  250. package/dist/index5.js.map +1 -1
  251. package/dist/index51.js +6 -6
  252. package/dist/index51.js.map +1 -1
  253. package/dist/index53.js.map +1 -1
  254. package/dist/index55.js +20 -20
  255. package/dist/index55.js.map +1 -1
  256. package/dist/index57.js +35 -35
  257. package/dist/index57.js.map +1 -1
  258. package/dist/index59.js +8 -8
  259. package/dist/index59.js.map +1 -1
  260. package/dist/index6.js +38 -38
  261. package/dist/index6.js.map +1 -1
  262. package/dist/index61.js +27 -27
  263. package/dist/index61.js.map +1 -1
  264. package/dist/index63.js +4 -4
  265. package/dist/index63.js.map +1 -1
  266. package/dist/index65.js +20 -20
  267. package/dist/index65.js.map +1 -1
  268. package/dist/index67.js +26 -26
  269. package/dist/index67.js.map +1 -1
  270. package/dist/index69.js +21 -19
  271. package/dist/index69.js.map +1 -1
  272. package/dist/index7.js.map +1 -1
  273. package/dist/index71.js +2 -2
  274. package/dist/index71.js.map +1 -1
  275. package/dist/index72.js +3 -3
  276. package/dist/index72.js.map +1 -1
  277. package/dist/index73.js +14 -14
  278. package/dist/index73.js.map +1 -1
  279. package/dist/index75.js +18 -18
  280. package/dist/index75.js.map +1 -1
  281. package/dist/index77.js +11 -11
  282. package/dist/index77.js.map +1 -1
  283. package/dist/index79.js +15 -15
  284. package/dist/index79.js.map +1 -1
  285. package/dist/index8.js +10 -7
  286. package/dist/index8.js.map +1 -1
  287. package/dist/index81.js.map +1 -1
  288. package/dist/index83.js +20 -20
  289. package/dist/index83.js.map +1 -1
  290. package/dist/index85.js +34 -34
  291. package/dist/index85.js.map +1 -1
  292. package/dist/index87.js +18 -18
  293. package/dist/index87.js.map +1 -1
  294. package/dist/index89.js.map +1 -1
  295. package/dist/index9.js.map +1 -1
  296. package/dist/index91.js +53 -53
  297. package/dist/index91.js.map +1 -1
  298. package/dist/index93.js +16 -16
  299. package/dist/index93.js.map +1 -1
  300. package/dist/index95.js +21 -21
  301. package/dist/index95.js.map +1 -1
  302. package/dist/index97.js +37 -37
  303. package/dist/index97.js.map +1 -1
  304. package/dist/index99.js +18 -18
  305. package/dist/index99.js.map +1 -1
  306. package/dist/style.css +1 -1
  307. package/dist/types/CommonProps.d.ts +18 -18
  308. package/dist/types/ExtractGenericFromComputedRef.d.ts +1 -1
  309. package/dist/types/ExtractGenericFromRef.d.ts +1 -1
  310. package/dist/types/VoidHtmlElements.d.ts +1 -1
  311. package/dist/utilities/functions/cloneDeep.d.ts +1 -1
  312. package/dist/utilities/functions/debounce.d.ts +1 -1
  313. package/dist/utilities/functions/flow.d.ts +1 -1
  314. package/dist/utilities/functions/get.d.ts +1 -1
  315. package/dist/utilities/functions/isNotNil.d.ts +1 -1
  316. package/dist/utilities/functions/mapValues.d.ts +1 -1
  317. package/dist/utilities/functions/merge.d.ts +1 -1
  318. package/dist/utilities/functions/millisecondsTo.d.ts +1 -1
  319. package/dist/utilities/functions/overEvery.d.ts +1 -1
  320. package/dist/utilities/functions/percentage.d.ts +4 -4
  321. package/dist/utilities/functions/pick.d.ts +1 -1
  322. package/dist/utilities/functions/pickBy.d.ts +1 -1
  323. package/dist/utilities/functions/roundToTheNearest.d.ts +1 -1
  324. package/package.json +93 -77
  325. package/dist/index256.js +0 -5
  326. package/dist/index256.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index107.js","sources":["../src/components/BbTextInput/BbTextInput.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, mergeProps as _mergeProps, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nimport type { HTMLAttributes, InputHTMLAttributes } from \"vue\";\nimport BaseInputContainer, {\n type BaseInputContainerSlots,\n} from \"../BaseInputContainer/BaseInputContainer.vue\";\nimport BaseTextInput from \"../BaseTextInput/BaseTextInput.vue\";\nimport type {\n BaseTextInputEvents,\n BaseTextInputSlots,\n} from \"../BaseTextInput/BaseTextInput.vue\";\n\nexport type BbTextInputProps = {\n /**\n * Guides to the browser as to the type of information expected in the field.\n */\n autocomplete?: InputHTMLAttributes[\"autocomplete\"];\n\n /**\n * Sets autofocus on page load.\n */\n autofocus?: InputHTMLAttributes[\"autofocus\"];\n\n /**\n * Disables the component\n */\n disabled?: boolean;\n\n /**\n * Define if the component should be in an error state.\n * It usually attaches a CSS class for styling purposes.\n */\n hasErrors?: boolean;\n\n /**\n * The identifier of the component.\n */\n id?: HTMLAttributes[\"id\"];\n\n /**\n * Defines the name of the input.\n */\n name?: InputHTMLAttributes[\"name\"];\n\n /**\n * String displayed when there's no data.\n */\n placeholder?: InputHTMLAttributes[\"placeholder\"];\n\n /**\n * Sets the input in a readonly state.\n */\n readonly?: InputHTMLAttributes[\"readonly\"];\n /**\n * Used my v-model\n */\n modelValue: string | null;\n /**\n * Type of the input. Returns the content type of the object.\n */\n type?: HTMLInputElement[\"type\"];\n\n /**\n * Direction of the layout of the component. Can either be a predefined value or a pattern separated by a space like `xx xxxxx`.\n */\n direction?: \"horizontal\" | \"vertical\" | \"auto\" | string;\n\n /**\n * Can be a string or an array of string containing the messages to display.\n */\n errors?: string | string[];\n\n /**\n * Visually hides the label of the input while maintaining accessibility.\n */\n hideLabel?: boolean;\n\n /**\n * Text content of the label of the element.\n */\n label: string;\n\n /**\n * Sets the text alignment of the label.\n */\n labelPosition?: \"left\" | \"center\" | \"right\";\n\n /**\n * Reverses the layout. Applicable in every direction the order of the label and the input is swapped.\n */\n reverse?: boolean;\n};\n\nexport type BbTextInputEvents = BaseTextInputEvents;\nexport type BbTextInputSlots = BaseTextInputSlots & {\n label?: (props: { text: string; hasErrors: boolean }) => any;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbTextInput',\n props: {\n autocomplete: {},\n autofocus: {},\n disabled: { type: Boolean },\n hasErrors: { type: Boolean },\n id: {},\n name: {},\n placeholder: {},\n readonly: {},\n modelValue: {},\n type: {},\n direction: {},\n errors: {},\n hideLabel: { type: Boolean },\n label: {},\n labelPosition: {},\n reverse: { type: Boolean }\n },\n emits: [\"blur\", \"change\", \"click\", \"focus\", \"input\", \"keydown\", \"mousedown\", \"mouseup\", \"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\n\n\nconst emit = __emit;\n\n\n\n/**\n * These events are just propagated\n */\nconst eventListeners = {\n onBlur: (event: FocusEvent) => emit(\"blur\", event),\n onChange: (event: Event) => emit(\"change\", event),\n onClick: (event: MouseEvent) => emit(\"click\", event),\n onFocus: (event: FocusEvent) => emit(\"focus\", event),\n onInput: (event: Event) => emit(\"input\", event),\n onKeydown: (event: KeyboardEvent) => emit(\"keydown\", event),\n onMousedown: (event: MouseEvent) => emit(\"mousedown\", event),\n onMouseup: (event: MouseEvent) => emit(\"mouseup\", event),\n \"onUpdate:modelValue\": (value: string | null) =>\n emit(\"update:modelValue\", value),\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(BaseInputContainer, {\n class: \"bb-text-input\",\n direction: _ctx.direction,\n errors: _ctx.errors,\n hasErrors: _ctx.hasErrors,\n hideLabel: _ctx.hideLabel,\n id: _ctx.id,\n label: _ctx.label,\n labelPosition: _ctx.labelPosition,\n modelValue: _ctx.modelValue,\n name: _ctx.name,\n reverse: _ctx.reverse\n }, {\n label: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"label\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n input: _withCtx(({ id, name, hasErrors }) => [\n _createVNode(BaseTextInput, _mergeProps({\n autocomplete: _ctx.autocomplete,\n autofocus: _ctx.autofocus,\n disabled: _ctx.disabled,\n hasErrors: hasErrors,\n id: id,\n modelValue: _ctx.modelValue,\n name: name,\n placeholder: _ctx.placeholder,\n readonly: _ctx.readonly,\n type: _ctx.type\n }, eventListeners), {\n \"append-outer\": _withCtx(() => [\n _renderSlot(_ctx.$slots, \"append-outer\")\n ]),\n append: _withCtx(() => [\n _renderSlot(_ctx.$slots, \"append\")\n ]),\n prepend: _withCtx(() => [\n _renderSlot(_ctx.$slots, \"prepend\")\n ]),\n \"prepend-outer\": _withCtx(() => [\n _renderSlot(_ctx.$slots, \"prepend-outer\")\n ]),\n _: 2\n }, 1040, [\"autocomplete\", \"autofocus\", \"disabled\", \"hasErrors\", \"id\", \"modelValue\", \"name\", \"placeholder\", \"readonly\", \"type\"])\n ]),\n _: 3\n }, 8, [\"direction\", \"errors\", \"hasErrors\", \"hideLabel\", \"id\", \"label\", \"labelPosition\", \"modelValue\", \"name\", \"reverse\"]))\n}\n}\n\n})"],"names":["_sfc_main","_defineComponent","__props","__emit","emit","eventListeners","event","value","_ctx","_cache","_openBlock","_createBlock","BaseInputContainer","_withCtx","data","_renderSlot","_normalizeProps","_guardReactiveProps","id","name","hasErrors","_createVNode","BaseTextInput","_mergeProps"],"mappings":";;;;;AAoGA,MAA4BA,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,cAAc,CAAC;AAAA,IACf,WAAW,CAAC;AAAA,IACZ,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,WAAW,EAAE,MAAM,QAAQ;AAAA,IAC3B,IAAI,CAAC;AAAA,IACL,MAAM,CAAC;AAAA,IACP,aAAa,CAAC;AAAA,IACd,UAAU,CAAC;AAAA,IACX,YAAY,CAAC;AAAA,IACb,MAAM,CAAC;AAAA,IACP,WAAW,CAAC;AAAA,IACZ,QAAQ,CAAC;AAAA,IACT,WAAW,EAAE,MAAM,QAAQ;AAAA,IAC3B,OAAO,CAAC;AAAA,IACR,eAAe,CAAC;AAAA,IAChB,SAAS,EAAE,MAAM,QAAQ;AAAA,EAC3B;AAAA,EACA,OAAO,CAAC,QAAQ,UAAU,SAAS,SAAS,SAAS,WAAW,aAAa,WAAW,mBAAmB;AAAA,EAC3G,MAAMC,GAAc,EAAE,MAAMC,KAAU;AAIxC,UAAMC,IAAOD,GAOPE,IAAiB;AAAA,MACrB,QAAQ,CAACC,MAAsBF,EAAK,QAAQE,CAAK;AAAA,MACjD,UAAU,CAACA,MAAiBF,EAAK,UAAUE,CAAK;AAAA,MAChD,SAAS,CAACA,MAAsBF,EAAK,SAASE,CAAK;AAAA,MACnD,SAAS,CAACA,MAAsBF,EAAK,SAASE,CAAK;AAAA,MACnD,SAAS,CAACA,MAAiBF,EAAK,SAASE,CAAK;AAAA,MAC9C,WAAW,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C;AAAA,UACD,SAASK,EAAS,MAAM;AAAA,YACtBE,EAAYP,EAAK,QAAQ,SAAS;AAAA,UAAA,CACnC;AAAA,UACD,iBAAiBK,EAAS,MAAM;AAAA,YAC9BE,EAAYP,EAAK,QAAQ,eAAe;AAAA,UAAA,CACzC;AAAA,UACD,GAAG;AAAA,QACF,GAAA,MAAM,CAAC,gBAAgB,aAAa,YAAY,aAAa,MAAM,cAAc,QAAQ,eAAe,YAAY,MAAM,CAAC;AAAA,MAAA,CAC/H;AAAA,MACD,GAAG;AAAA,IACF,GAAA,GAAG,CAAC,aAAa,UAAU,aAAa,aAAa,MAAM,SAAS,iBAAiB,cAAc,QAAQ,SAAS,CAAC;AAAA,EAE1H;AAEA,CAAC;"}
1
+ {"version":3,"file":"index107.js","sources":["../src/components/BbTextInput/BbTextInput.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, mergeProps as _mergeProps, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nimport type { HTMLAttributes, InputHTMLAttributes } from 'vue';\nimport BaseInputContainer, {\n\ttype BaseInputContainerSlots,\n} from '../BaseInputContainer/BaseInputContainer.vue';\nimport BaseTextInput from '../BaseTextInput/BaseTextInput.vue';\nimport type {\n\tBaseTextInputEvents,\n\tBaseTextInputSlots,\n} from '../BaseTextInput/BaseTextInput.vue';\n\nexport type BbTextInputProps = {\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\t/**\n\t * Used my v-model\n\t */\n\tmodelValue: string | null;\n\t/**\n\t * Type of the input. Returns the content type of the object.\n\t */\n\ttype?: HTMLInputElement['type'];\n\n\t/**\n\t * Direction of the layout of the component. Can either be a predefined value or a pattern separated by a space like `xx xxxxx`.\n\t */\n\tdirection?: 'horizontal' | 'vertical' | 'auto' | string;\n\n\t/**\n\t * Can be a string or an array of string containing the messages to display.\n\t */\n\terrors?: string | string[];\n\n\t/**\n\t * Visually hides the label of the input while maintaining accessibility.\n\t */\n\thideLabel?: boolean;\n\n\t/**\n\t * Text content of the label of the element.\n\t */\n\tlabel: string;\n\n\t/**\n\t * Sets the text alignment of the label.\n\t */\n\tlabelPosition?: 'left' | 'center' | 'right';\n\n\t/**\n\t * Reverses the layout. Applicable in every direction the order of the label and the input is swapped.\n\t */\n\treverse?: boolean;\n};\n\nexport type BbTextInputEvents = BaseTextInputEvents;\nexport type BbTextInputSlots = BaseTextInputSlots & {\n\tlabel?: (props: { text: string; hasErrors: boolean }) => any;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbTextInput',\n props: {\n autocomplete: {},\n autofocus: {},\n disabled: { type: Boolean },\n hasErrors: { type: Boolean },\n id: {},\n name: {},\n placeholder: {},\n readonly: {},\n modelValue: {},\n type: {},\n direction: {},\n errors: {},\n hideLabel: { type: Boolean },\n label: {},\n labelPosition: {},\n reverse: { type: Boolean }\n },\n emits: [\"blur\", \"change\", \"click\", \"focus\", \"input\", \"keydown\", \"mousedown\", \"mouseup\", \"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\n\n\nconst emit = __emit;\n\n\n\n/**\n * These events are just propagated\n */\nconst eventListeners = {\n\tonBlur: (event: FocusEvent) => emit('blur', event),\n\tonChange: (event: Event) => emit('change', event),\n\tonClick: (event: MouseEvent) => emit('click', event),\n\tonFocus: (event: FocusEvent) => emit('focus', event),\n\tonInput: (event: Event) => emit('input', event),\n\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n\t'onUpdate:modelValue': (value: string | null) =>\n\t\temit('update:modelValue', value),\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(BaseInputContainer, {\n id: _ctx.id,\n class: \"bb-text-input\",\n direction: _ctx.direction,\n errors: _ctx.errors,\n \"has-errors\": _ctx.hasErrors,\n \"hide-label\": _ctx.hideLabel,\n label: _ctx.label,\n \"label-position\": _ctx.labelPosition,\n \"model-value\": _ctx.modelValue,\n name: _ctx.name,\n reverse: _ctx.reverse\n }, {\n label: _withCtx((data) => [\n _renderSlot(_ctx.$slots, \"label\", _normalizeProps(_guardReactiveProps(data)))\n ]),\n input: _withCtx(({ id, name, hasErrors }) => [\n _createVNode(BaseTextInput, _mergeProps({\n id: id,\n autocomplete: _ctx.autocomplete,\n autofocus: _ctx.autofocus,\n disabled: _ctx.disabled,\n \"has-errors\": hasErrors,\n \"model-value\": _ctx.modelValue,\n name: name,\n placeholder: _ctx.placeholder,\n readonly: _ctx.readonly,\n type: _ctx.type\n }, eventListeners), {\n \"append-outer\": _withCtx(() => [\n _renderSlot(_ctx.$slots, \"append-outer\")\n ]),\n append: _withCtx(() => [\n _renderSlot(_ctx.$slots, \"append\")\n ]),\n prepend: _withCtx(() => [\n _renderSlot(_ctx.$slots, \"prepend\")\n ]),\n \"prepend-outer\": _withCtx(() => [\n _renderSlot(_ctx.$slots, \"prepend-outer\")\n ]),\n _: 2\n }, 1040, [\"id\", \"autocomplete\", \"autofocus\", \"disabled\", \"has-errors\", \"model-value\", \"name\", \"placeholder\", \"readonly\", \"type\"])\n ]),\n _: 3\n }, 8, [\"id\", \"direction\", \"errors\", \"has-errors\", \"hide-label\", \"label\", \"label-position\", \"model-value\", \"name\", \"reverse\"]))\n}\n}\n\n})"],"names":["_sfc_main","_defineComponent","__props","__emit","emit","eventListeners","event","value","_ctx","_cache","_openBlock","_createBlock","BaseInputContainer","_withCtx","data","_renderSlot","_normalizeProps","_guardReactiveProps","id","name","hasErrors","_createVNode","BaseTextInput","_mergeProps"],"mappings":";;;;;AAoGA,MAA4BA,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,cAAc,CAAC;AAAA,IACf,WAAW,CAAC;AAAA,IACZ,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,WAAW,EAAE,MAAM,QAAQ;AAAA,IAC3B,IAAI,CAAC;AAAA,IACL,MAAM,CAAC;AAAA,IACP,aAAa,CAAC;AAAA,IACd,UAAU,CAAC;AAAA,IACX,YAAY,CAAC;AAAA,IACb,MAAM,CAAC;AAAA,IACP,WAAW,CAAC;AAAA,IACZ,QAAQ,CAAC;AAAA,IACT,WAAW,EAAE,MAAM,QAAQ;AAAA,IAC3B,OAAO,CAAC;AAAA,IACR,eAAe,CAAC;AAAA,IAChB,SAAS,EAAE,MAAM,QAAQ;AAAA,EAC3B;AAAA,EACA,OAAO,CAAC,QAAQ,UAAU,SAAS,SAAS,SAAS,WAAW,aAAa,WAAW,mBAAmB;AAAA,EAC3G,MAAMC,GAAc,EAAE,MAAMC,KAAU;AAIxC,UAAMC,IAAOD,GAOPE,IAAiB;AAAA,MACtB,QAAQ,CAACC,MAAsBF,EAAK,QAAQE,CAAK;AAAA,MACjD,UAAU,CAACA,MAAiBF,EAAK,UAAUE,CAAK;AAAA,MAChD,SAAS,CAACA,MAAsBF,EAAK,SAASE,CAAK;AAAA,MACnD,SAAS,CAACA,MAAsBF,EAAK,SAASE,CAAK;AAAA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EAAS,MAAM;AAAA,YACrBE,EAAYP,EAAK,QAAQ,QAAQ;AAAA,UAAA,CAClC;AAAA,UACD,SAASK,EAAS,MAAM;AAAA,YACtBE,EAAYP,EAAK,QAAQ,SAAS;AAAA,UAAA,CACnC;AAAA,UACD,iBAAiBK,EAAS,MAAM;AAAA,YAC9BE,EAAYP,EAAK,QAAQ,eAAe;AAAA,UAAA,CACzC;AAAA,UACD,GAAG;AAAA,QACF,GAAA,MAAM,CAAC,MAAM,gBAAgB,aAAa,YAAY,cAAc,eAAe,QAAQ,eAAe,YAAY,MAAM,CAAC;AAAA,MAAA,CACjI;AAAA,MACD,GAAG;AAAA,IACF,GAAA,GAAG,CAAC,MAAM,aAAa,UAAU,cAAc,cAAc,SAAS,kBAAkB,eAAe,QAAQ,SAAS,CAAC;AAAA,EAE9H;AAEA,CAAC;"}
@@ -1 +1 @@
1
- {"version":3,"file":"index109.js","sources":["../src/components/BbToast/BbToast.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, mergeProps as _mergeProps, createBlock as _createBlock, TransitionGroup as _TransitionGroup, withCtx as _withCtx, createVNode as _createVNode, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, Teleport as _Teleport } from \"vue\"\n\nimport { state, useToast } from \"../../composables/useToast\";\nimport BbToastMessage from \"./BbToastMessage.vue\";\nexport type BbToastProps = {\n /**\n * Placement of the messages on the screen.\n */\n placement?:\n | \"bottom\"\n | \"bottom-start\"\n | \"bottom-end\"\n | \"top\"\n | \"top-start\"\n | \"top-end\";\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbToast',\n props: {\n placement: { default: \"bottom\" }\n },\n setup(__props: any) {\n\nconst { dismiss } = useToast()\n\n\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"bb-toast\", { [`bb-toast--${_ctx.placement}`]: true }])\n }, [\n _createVNode(_TransitionGroup, { name: \"toast\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(state).stack, (message) => {\n return (_openBlock(), _createBlock(BbToastMessage, _mergeProps({\n key: message.id\n }, message, { \"onClick:close\": _unref(dismiss) }), null, 16, [\"onClick:close\"]))\n }), 128))\n ]),\n _: 1\n })\n ], 2)\n ]))\n}\n}\n\n})"],"names":["_sfc_main","_defineComponent","__props","dismiss","useToast","_ctx","_cache","_openBlock","_createBlock","_Teleport","_createElementVNode","_normalizeClass","_createVNode","_TransitionGroup","_withCtx","_createElementBlock","_Fragment","_renderList","_unref","state","message","BbToastMessage","_mergeProps"],"mappings":";;;AAmBA,MAA4BA,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,WAAW,EAAE,SAAS,SAAS;AAAA,EACjC;AAAA,EACA,MAAMC,GAAc;AAEhB,UAAA,EAAE,SAAAC,MAAYC;AAIb,WAAA,CAACC,GAAUC,OACRC,EAAc,GAAAC,EAAaC,GAAW,EAAE,IAAI,UAAU;AAAA,MAC5DC,EAAoB,OAAO;AAAA,QACzB,OAAOC,EAAgB,CAAC,YAAY,EAAE,CAAC,aAAaN,EAAK,SAAS,EAAE,GAAG,GAAM,CAAA,CAAC;AAAA,MAAA,GAC7E;AAAA,QACDO,EAAaC,GAAkB,EAAE,MAAM,WAAW;AAAA,UAChD,SAASC,EAAS,MAAM;AAAA,aACrBP,EAAW,EAAI,GAAGQ,EAAoBC,GAAW,MAAMC,EAAYC,EAAOC,CAAK,EAAE,OAAO,CAACC,OAChFb,EAAW,GAAGC,EAAaa,GAAgBC,EAAY;AAAA,cAC7D,KAAKF,EAAQ;AAAA,YACZ,GAAAA,GAAS,EAAE,iBAAiBF,EAAOf,CAAO,GAAG,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,EAC/E,GAAG,GAAG;AAAA,UAAA,CACR;AAAA,UACD,GAAG;AAAA,QAAA,CACJ;AAAA,SACA,CAAC;AAAA,IAAA,CACL;AAAA,EAEH;AAEA,CAAC;"}
1
+ {"version":3,"file":"index109.js","sources":["../src/components/BbToast/BbToast.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, mergeProps as _mergeProps, createBlock as _createBlock, TransitionGroup as _TransitionGroup, withCtx as _withCtx, createVNode as _createVNode, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, Teleport as _Teleport } from \"vue\"\n\nimport { state, useToast } from '../../composables/useToast';\nimport BbToastMessage from './BbToastMessage.vue';\nexport type BbToastProps = {\n\t/**\n\t * Placement of the messages on the screen.\n\t */\n\tplacement?:\n\t\t| 'bottom'\n\t\t| 'bottom-start'\n\t\t| 'bottom-end'\n\t\t| 'top'\n\t\t| 'top-start'\n\t\t| 'top-end';\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbToast',\n props: {\n placement: { default: 'bottom' }\n },\n setup(__props: any) {\n\nconst { dismiss } = useToast();\n\n\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"bb-toast\", { [`bb-toast--${_ctx.placement}`]: true }])\n }, [\n _createVNode(_TransitionGroup, { name: \"toast\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(state).stack, (message) => {\n return (_openBlock(), _createBlock(BbToastMessage, _mergeProps({\n key: message.id\n }, message, { \"onClick:close\": _unref(dismiss) }), null, 16, [\"onClick:close\"]))\n }), 128))\n ]),\n _: 1\n })\n ], 2)\n ]))\n}\n}\n\n})"],"names":["_sfc_main","_defineComponent","__props","dismiss","useToast","_ctx","_cache","_openBlock","_createBlock","_Teleport","_createElementVNode","_normalizeClass","_createVNode","_TransitionGroup","_withCtx","_createElementBlock","_Fragment","_renderList","_unref","state","message","BbToastMessage","_mergeProps"],"mappings":";;;AAmBA,MAA4BA,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,WAAW,EAAE,SAAS,SAAS;AAAA,EACjC;AAAA,EACA,MAAMC,GAAc;AAEhB,UAAA,EAAE,SAAAC,MAAYC;AAIb,WAAA,CAACC,GAAUC,OACRC,EAAc,GAAAC,EAAaC,GAAW,EAAE,IAAI,UAAU;AAAA,MAC5DC,EAAoB,OAAO;AAAA,QACzB,OAAOC,EAAgB,CAAC,YAAY,EAAE,CAAC,aAAaN,EAAK,SAAS,EAAE,GAAG,GAAM,CAAA,CAAC;AAAA,MAAA,GAC7E;AAAA,QACDO,EAAaC,GAAkB,EAAE,MAAM,WAAW;AAAA,UAChD,SAASC,EAAS,MAAM;AAAA,aACrBP,EAAW,EAAI,GAAGQ,EAAoBC,GAAW,MAAMC,EAAYC,EAAOC,CAAK,EAAE,OAAO,CAACC,OAChFb,EAAW,GAAGC,EAAaa,GAAgBC,EAAY;AAAA,cAC7D,KAAKF,EAAQ;AAAA,YACZ,GAAAA,GAAS,EAAE,iBAAiBF,EAAOf,CAAO,GAAG,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,EAC/E,GAAG,GAAG;AAAA,UAAA,CACR;AAAA,UACD,GAAG;AAAA,QAAA,CACJ;AAAA,SACA,CAAC;AAAA,IAAA,CACL;AAAA,EAEH;AAEA,CAAC;"}
package/dist/index11.js CHANGED
@@ -1,18 +1,18 @@
1
1
  import { defineComponent as B, ref as h, computed as n, watch as L, openBlock as c, createElementBlock as i, normalizeClass as E, normalizeProps as p, mergeProps as d, createCommentVNode as I, createElementVNode as l, renderSlot as F, guardReactiveProps as M } from "vue";
2
- import { isCssColor as f } from "./index211.js";
3
- import { when as N } from "./index212.js";
2
+ import { isCssColor as f } from "./index197.js";
3
+ import { when as N } from "./index198.js";
4
4
  const A = {
5
- class: "bb-base-checkbox-container",
6
- "aria-hidden": "true"
5
+ "aria-hidden": "true",
6
+ class: "bb-base-checkbox-container"
7
7
  }, S = /* @__PURE__ */ l("path", {
8
8
  d: "M 380.93 158.834 L 286.863 158.834 C 281.088 158.834 276.411 163.511 276.411 169.286 L 276.411 263.352 C 276.411 269.127 281.088 273.804 286.863 273.804 L 380.93 273.804 C 386.704 273.804 391.382 269.127 391.382 263.352 L 391.382 169.286 C 391.382 163.511 386.699 158.834 380.93 158.834 Z",
9
9
  style: {}
10
10
  }, null, -1), J = /* @__PURE__ */ l("path", {
11
- "stroke-width": "14px",
12
- "stroke-linecap": "round",
11
+ d: "M 297.574 224.786 L 318.309 243.134 L 371.568 189.232",
13
12
  fill: "none",
14
13
  stroke: "white",
15
- d: "M 297.574 224.786 L 318.309 243.134 L 371.568 189.232"
14
+ "stroke-linecap": "round",
15
+ "stroke-width": "14px"
16
16
  }, null, -1), O = [
17
17
  S,
18
18
  J
@@ -1 +1 @@
1
- {"version":3,"file":"index11.js","sources":["../src/components/BaseCheckbox/BaseCheckbox.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, openBlock as _openBlock, createElementBlock as _createElementBlock, mergeProps as _mergeProps, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, renderSlot as _renderSlot, normalizeClass as _normalizeClass } from \"vue\"\n\nconst _hoisted_1 = {\n class: \"bb-base-checkbox-container\",\n \"aria-hidden\": \"true\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M 380.93 158.834 L 286.863 158.834 C 281.088 158.834 276.411 163.511 276.411 169.286 L 276.411 263.352 C 276.411 269.127 281.088 273.804 286.863 273.804 L 380.93 273.804 C 386.704 273.804 391.382 269.127 391.382 263.352 L 391.382 169.286 C 391.382 163.511 386.699 158.834 380.93 158.834 Z\",\n style: {}\n}, null, -1)\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"path\", {\n \"stroke-width\": \"14px\",\n \"stroke-linecap\": \"round\",\n fill: \"none\",\n stroke: \"white\",\n d: \"M 297.574 224.786 L 318.309 243.134 L 371.568 189.232\"\n}, null, -1)\nconst _hoisted_4 = [\n _hoisted_2,\n _hoisted_3\n]\n\nimport { computed, ref, watch } from \"vue\";\nimport { isCssColor } from \"@/utilities/functions/isCssColor\";\nimport { when } from \"@/utilities/functions/when\";\nimport type { HTMLAttributes, InputHTMLAttributes } from \"vue\";\n\nexport type BaseCheckboxProps = {\n /**\n * Sets autofocus on page load.\n */\n autofocus?: InputHTMLAttributes[\"autofocus\"];\n \n /**\n * Defines the input as checked\n */\n checked?: InputHTMLAttributes[\"checked\"];\n \n /**\n * Define a color for the component.\n *\n * Either a custom color or a coded color in common HEX, RGB, etc... format.\n */\n color?: string;\n \n /**\n * Disables the component\n */\n disabled?: boolean;\n \n /**\n * Value of the input when unchecked. It handles any kind of serializable object.\n */\n falseValue?: any;\n \n /**\n * Define if the component should be in an error state.\n * It usually attaches a CSS class for styling purposes.\n */\n hasErrors?: boolean;\n \n /**\n * The identifier of the component.\n */\n id?: HTMLAttributes[\"id\"];\n \n /**\n * Sets the input in an indeterminate state.\n */\n indeterminate?: InputHTMLAttributes[\"indeterminate\"];\n \n /**\n * Defines the name of the input.\n */\n name?: InputHTMLAttributes[\"name\"];\n \n /**\n * Sets the input in a readonly state.\n */\n readonly?: InputHTMLAttributes[\"readonly\"];\n \n /**\n * Will submit \"falseValue\" if the input is not checked. Otherwise \"trueValue\" will be submitted.\n */\n submitWhenFalse?: boolean;\n \n /**\n * Value of the input when checked. It handles any kind of serializable object.\n */\n trueValue?: any;\n /**\n * Used by v-model. Can be any serializable type.\n */\n modelValue?: any;\n\n}\n\nexport type BaseCheckboxEvents = {\n (e: \"blur\", event: FocusEvent): void;\n (e: \"change\", event: Event): void;\n (e: \"click\", event: MouseEvent): void;\n (e: \"focus\", event: FocusEvent): void;\n (e: \"input\", event: Event): void;\n (e: \"keydown\", event: KeyboardEvent): void;\n (e: \"mousedown\", event: MouseEvent): void;\n (e: \"mouseup\", event: MouseEvent): void;\n (e: \"update:modelValue\", value: any): void;\n };\n\n\n export type SlotAttributes = {\n checked: boolean;\n disabled: Exclude<BaseCheckboxProps['disabled'], undefined>;\n falseValue: any;\n focused: boolean;\n hasErrors: Exclude<BaseCheckboxProps['hasErrors'], undefined>;\n id: BaseCheckboxProps['id'];\n name: BaseCheckboxProps['name'];\n parsedValue: any;\n readonly: BaseCheckboxProps['readonly'];\n trueValue: any;\n value: any;\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseCheckbox',\n props: {\n autofocus: {},\n checked: {},\n color: {},\n disabled: { type: Boolean },\n falseValue: { default: false },\n hasErrors: { type: Boolean },\n id: {},\n indeterminate: {},\n name: {},\n readonly: {},\n submitWhenFalse: { type: Boolean },\n trueValue: { default: true },\n modelValue: {}\n },\n emits: [\"blur\", \"change\", \"click\", \"focus\", \"input\", \"keydown\", \"mousedown\", \"mouseup\", \"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\nconst props = __props;\n\nconst emit = __emit;\n\n\n\nconst checkboxInput = ref<HTMLInputElement | null>(null);\n\nconst checked = computed(() => {\n if (props.checked) return true;\n return JSON.stringify(props.trueValue) === JSON.stringify(props.modelValue);\n});\nconst hasFocus = ref(false);\n\nconst classes = computed(() => {\n return {\n \"bb-base-checkbox\": true,\n \"bb-base-checkbox--disabled\": props.disabled,\n \"bb-base-checkbox--errors\": props.hasErrors,\n \"bb-base-checkbox--indeterminate\": props.indeterminate,\n \"bb-base-checkbox--readonly\": props.readonly,\n [`bb-base-checkbox--${props.color}`]:\n props.color && !isCssColor(props.color),\n };\n});\n\n/**\n * This is used to keep the value compatible to common html expected values.\n * Convert to string everything that's not but do not double encode strings\n */\nconst makeInputValue = when(\n (item: unknown) => typeof item !== \"string\",\n JSON.stringify\n);\n\nconst hiddenInputAttributes = computed(() => {\n const value = makeInputValue(props.falseValue);\n return {\n disabled: props.disabled,\n name: props.name,\n type: \"hidden\",\n value: value,\n };\n});\n\nconst inputAttributes = computed(() => {\n const value = makeInputValue(props.trueValue);\n\n const onBlur = (event: FocusEvent): void => {\n hasFocus.value = false;\n emit(\"blur\", event);\n };\n\n const onChange = (event: Event): void => {\n if (event.target instanceof HTMLInputElement) {\n let value = event.target.checked ? props.trueValue : props.falseValue;\n\n emit(\"change\", event);\n emit(\"update:modelValue\", value);\n }\n };\n\n const onFocus = (event: FocusEvent): void => {\n hasFocus.value = true;\n emit(\"focus\", event);\n };\n\n const eventListeners = {\n onBlur,\n onChange,\n onClick: (event: MouseEvent) => emit(\"click\", event),\n onFocus,\n onKeydown: (event: KeyboardEvent) => emit(\"keydown\", event),\n onMousedown: (event: MouseEvent) => emit(\"mousedown\", event),\n onMouseup: (event: MouseEvent) => emit(\"mouseup\", event),\n onInput: (event: Event) => emit(\"input\", event),\n };\n\n return {\n autofocus: props.autofocus,\n checked: checked.value,\n // There is no such thing as readonly checkbox so we disable and style it with css\n disabled: props.disabled || props.readonly,\n id: props.id,\n indeterminate: props.indeterminate,\n name: props.name,\n tabindex: props.disabled ? -1 : undefined,\n type: \"checkbox\",\n value: value,\n ...eventListeners,\n };\n});\n\nconst slotAttributes = computed(() => ({\n checked: checked.value,\n disabled: props.disabled,\n falseValue: props.falseValue,\n focused: hasFocus.value,\n hasErrors: props.hasErrors,\n id: props.id,\n name: props.name,\n parsedValue: inputAttributes.value.value,\n readonly: props.readonly,\n trueValue: props.trueValue,\n value: checked.value ? props.trueValue : props.falseValue,\n}));\n\nconst iconAttributes = computed(() => {\n let style: { [key: string]: string } = {};\n if (props.color && isCssColor(props.color)) {\n style.color = props.color;\n }\n return {\n class: \"bb-base-checkbox-container__icon\",\n style,\n };\n});\n\n/**\n * Indeterminate is a very volatile prop that is reset upon clicking,\n * this keeps the state and the prop aligned\n */\nwatch(\n () => [props.modelValue, props.checked, props.indeterminate],\n () => {\n if (checkboxInput.value) {\n checkboxInput.value.indeterminate = !!props.indeterminate;\n }\n }\n);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n class: _normalizeClass(classes.value)\n }, [\n (!checked.value && _ctx.submitWhenFalse)\n ? (_openBlock(), _createElementBlock(\"input\", _normalizeProps(_mergeProps({ key: 0 }, hiddenInputAttributes.value)), null, 16))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"input\", _mergeProps(inputAttributes.value, {\n ref_key: \"checkboxInput\",\n ref: checkboxInput\n }), null, 16),\n _createElementVNode(\"span\", _hoisted_1, [\n _renderSlot(_ctx.$slots, \"icon\", _normalizeProps(_guardReactiveProps(slotAttributes.value)), () => [\n (_openBlock(), _createElementBlock(\"svg\", _mergeProps({ viewBox: \"276.411 158.834 114.971 114.97\" }, iconAttributes.value), _hoisted_4, 16))\n ])\n ])\n ], 2))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_sfc_main","_defineComponent","__props","__emit","props","emit","checkboxInput","ref","checked","computed","hasFocus","classes","isCssColor","makeInputValue","when","item","hiddenInputAttributes","value","inputAttributes","eventListeners","event","slotAttributes","iconAttributes","style","watch","_ctx","_cache","_openBlock","_createElementBlock","_normalizeClass","_normalizeProps","_mergeProps","_createCommentVNode","_createElementVNode","_renderSlot","_guardReactiveProps"],"mappings":";;;AAGA,MAAMA,IAAa;AAAA,EACjB,OAAO;AAAA,EACP,eAAe;AACjB,GACMC,sBAA8C,QAAQ;AAAA,EAC1D,GAAG;AAAA,EACH,OAAO,CAAC;AACV,GAAG,MAAM,EAAE,GACLC,sBAA8C,QAAQ;AAAA,EAC1D,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,GAAG;AACL,GAAG,MAAM,EAAE,GACLC,IAAa;A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K,CAAC,GAAG,MAAM;AAAA,WAChGM,KAAcC,EAAoB,OAAOG,EAAY,EAAE,SAAS,iCAAA,GAAoCT,EAAe,KAAK,GAAGvB,GAAY,EAAE;AAAA,QAAA,CAC3I;AAAA,MAAA,CACF;AAAA,OACA,CAAC;AAAA,EAEN;AAEA,CAAC;"}
1
+ {"version":3,"file":"index11.js","sources":["../src/components/BaseCheckbox/BaseCheckbox.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, openBlock as _openBlock, createElementBlock as _createElementBlock, mergeProps as _mergeProps, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, renderSlot as _renderSlot, normalizeClass as _normalizeClass } from \"vue\"\n\nconst _hoisted_1 = {\n \"aria-hidden\": \"true\",\n class: \"bb-base-checkbox-container\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M 380.93 158.834 L 286.863 158.834 C 281.088 158.834 276.411 163.511 276.411 169.286 L 276.411 263.352 C 276.411 269.127 281.088 273.804 286.863 273.804 L 380.93 273.804 C 386.704 273.804 391.382 269.127 391.382 263.352 L 391.382 169.286 C 391.382 163.511 386.699 158.834 380.93 158.834 Z\",\n style: {}\n}, null, -1)\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M 297.574 224.786 L 318.309 243.134 L 371.568 189.232\",\n fill: \"none\",\n stroke: \"white\",\n \"stroke-linecap\": \"round\",\n \"stroke-width\": \"14px\"\n}, null, -1)\nconst _hoisted_4 = [\n _hoisted_2,\n _hoisted_3\n]\n\nimport { computed, ref, watch } from 'vue';\nimport { isCssColor } from '@/utilities/functions/isCssColor';\nimport { when } from '@/utilities/functions/when';\nimport type { HTMLAttributes, InputHTMLAttributes } from 'vue';\n\nexport type BaseCheckboxProps = {\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Defines the input as checked\n\t */\n\tchecked?: InputHTMLAttributes['checked'];\n\n\t/**\n\t * Define a color for the component.\n\t *\n\t * Either a custom color or a coded color in common HEX, RGB, etc... format.\n\t */\n\tcolor?: string;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * Value of the input when unchecked. It handles any kind of serializable object.\n\t */\n\tfalseValue?: any;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * Sets the input in an indeterminate state.\n\t */\n\tindeterminate?: InputHTMLAttributes['indeterminate'];\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * Will submit \"falseValue\" if the input is not checked. Otherwise \"trueValue\" will be submitted.\n\t */\n\tsubmitWhenFalse?: boolean;\n\n\t/**\n\t * Value of the input when checked. It handles any kind of serializable object.\n\t */\n\ttrueValue?: any;\n\t/**\n\t * Used by v-model. Can be any serializable type.\n\t */\n\tmodelValue?: any;\n};\n\nexport type BaseCheckboxEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\t(e: 'change', event: Event): void;\n\t(e: 'click', event: MouseEvent): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'input', event: Event): void;\n\t(e: 'keydown', event: KeyboardEvent): void;\n\t(e: 'mousedown', event: MouseEvent): void;\n\t(e: 'mouseup', event: MouseEvent): void;\n\t(e: 'update:modelValue', value: any): void;\n};\n\nexport type SlotAttributes = {\n\tchecked: boolean;\n\tdisabled: Exclude<BaseCheckboxProps['disabled'], undefined>;\n\tfalseValue: any;\n\tfocused: boolean;\n\thasErrors: Exclude<BaseCheckboxProps['hasErrors'], undefined>;\n\tid: BaseCheckboxProps['id'];\n\tname: BaseCheckboxProps['name'];\n\tparsedValue: any;\n\treadonly: BaseCheckboxProps['readonly'];\n\ttrueValue: any;\n\tvalue: any;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseCheckbox',\n props: {\n autofocus: {},\n checked: {},\n color: {},\n disabled: { type: Boolean },\n falseValue: { default: false },\n hasErrors: { type: Boolean },\n id: {},\n indeterminate: {},\n name: {},\n readonly: {},\n submitWhenFalse: { type: Boolean },\n trueValue: { default: true },\n modelValue: {}\n },\n emits: [\"blur\", \"change\", \"click\", \"focus\", \"input\", \"keydown\", \"mousedown\", \"mouseup\", \"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\nconst props = __props;\n\nconst emit = __emit;\n\n\n\nconst checkboxInput = ref<HTMLInputElement | null>(null);\n\nconst checked = computed(() => {\n\tif (props.checked) return true;\n\treturn JSON.stringify(props.trueValue) === JSON.stringify(props.modelValue);\n});\nconst hasFocus = ref(false);\n\nconst classes = computed(() => {\n\treturn {\n\t\t'bb-base-checkbox': true,\n\t\t'bb-base-checkbox--disabled': props.disabled,\n\t\t'bb-base-checkbox--errors': props.hasErrors,\n\t\t'bb-base-checkbox--indeterminate': props.indeterminate,\n\t\t'bb-base-checkbox--readonly': props.readonly,\n\t\t[`bb-base-checkbox--${props.color}`]:\n\t\t\tprops.color && !isCssColor(props.color),\n\t};\n});\n\n/**\n * This is used to keep the value compatible to common html expected values.\n * Convert to string everything that's not but do not double encode strings\n */\nconst makeInputValue = when(\n\t(item: unknown) => typeof item !== 'string',\n\tJSON.stringify\n);\n\nconst hiddenInputAttributes = computed(() => {\n\tconst value = makeInputValue(props.falseValue);\n\treturn {\n\t\tdisabled: props.disabled,\n\t\tname: props.name,\n\t\ttype: 'hidden',\n\t\tvalue: value,\n\t};\n});\n\nconst inputAttributes = computed(() => {\n\tconst value = makeInputValue(props.trueValue);\n\n\tconst onBlur = (event: FocusEvent): void => {\n\t\thasFocus.value = false;\n\t\temit('blur', event);\n\t};\n\n\tconst onChange = (event: Event): void => {\n\t\tif (event.target instanceof HTMLInputElement) {\n\t\t\tlet value = event.target.checked ? props.trueValue : props.falseValue;\n\n\t\t\temit('change', event);\n\t\t\temit('update:modelValue', value);\n\t\t}\n\t};\n\n\tconst onFocus = (event: FocusEvent): void => {\n\t\thasFocus.value = true;\n\t\temit('focus', event);\n\t};\n\n\tconst eventListeners = {\n\t\tonBlur,\n\t\tonChange,\n\t\tonClick: (event: MouseEvent) => emit('click', event),\n\t\tonFocus,\n\t\tonKeydown: (event: KeyboardEvent) => emit('keydown', event),\n\t\tonMousedown: (event: MouseEvent) => emit('mousedown', event),\n\t\tonMouseup: (event: MouseEvent) => emit('mouseup', event),\n\t\tonInput: (event: Event) => emit('input', event),\n\t};\n\n\treturn {\n\t\tautofocus: props.autofocus,\n\t\tchecked: checked.value,\n\t\t// There is no such thing as readonly checkbox so we disable and style it with css\n\t\tdisabled: props.disabled || props.readonly,\n\t\tid: props.id,\n\t\tindeterminate: props.indeterminate,\n\t\tname: props.name,\n\t\ttabindex: props.disabled ? -1 : undefined,\n\t\ttype: 'checkbox',\n\t\tvalue: value,\n\t\t...eventListeners,\n\t};\n});\n\nconst slotAttributes = computed(() => ({\n\tchecked: checked.value,\n\tdisabled: props.disabled,\n\tfalseValue: props.falseValue,\n\tfocused: hasFocus.value,\n\thasErrors: props.hasErrors,\n\tid: props.id,\n\tname: props.name,\n\tparsedValue: inputAttributes.value.value,\n\treadonly: props.readonly,\n\ttrueValue: props.trueValue,\n\tvalue: checked.value ? props.trueValue : props.falseValue,\n}));\n\nconst iconAttributes = computed(() => {\n\tlet style: { [key: string]: string } = {};\n\tif (props.color && isCssColor(props.color)) {\n\t\tstyle.color = props.color;\n\t}\n\treturn {\n\t\tclass: 'bb-base-checkbox-container__icon',\n\t\tstyle,\n\t};\n});\n\n/**\n * Indeterminate is a very volatile prop that is reset upon clicking,\n * this keeps the state and the prop aligned\n */\nwatch(\n\t() => [props.modelValue, props.checked, props.indeterminate],\n\t() => {\n\t\tif (checkboxInput.value) {\n\t\t\tcheckboxInput.value.indeterminate = !!props.indeterminate;\n\t\t}\n\t}\n);\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n class: _normalizeClass(classes.value)\n }, [\n (!checked.value && _ctx.submitWhenFalse)\n ? (_openBlock(), _createElementBlock(\"input\", _normalizeProps(_mergeProps({ key: 0 }, hiddenInputAttributes.value)), null, 16))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"input\", _mergeProps(inputAttributes.value, {\n ref_key: \"checkboxInput\",\n ref: checkboxInput\n }), null, 16),\n _createElementVNode(\"span\", _hoisted_1, [\n _renderSlot(_ctx.$slots, \"icon\", _normalizeProps(_guardReactiveProps(slotAttributes.value)), () => [\n (_openBlock(), _createElementBlock(\"svg\", _mergeProps({ viewBox: \"276.411 158.834 114.971 114.97\" }, iconAttributes.value), _hoisted_4, 16))\n ])\n ])\n ], 2))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_sfc_main","_defineComponent","__props","__emit","props","emit","checkboxInput","ref","checked","computed","hasFocus","classes","isCssColor","makeInputValue","when","item","hiddenInputAttributes","value","inputAttributes","eventListeners","event","slotAttributes","iconAttributes","style","watch","_ctx","_cache","_openBlock","_createElementBlock","_normalizeClass","_normalizeProps","_mergeProps","_createCommentVNode","_createElementVNode","_renderSlot","_guardReactiveProps"],"mappings":";;;AAGA,MAAMA,IAAa;AAAA,EACjB,eAAe;AAAA,EACf,OAAO;AACT,GACMC,sBAA8C,QAAQ;AAAA,EAC1D,GAAG;AAAA,EACH,OAAO,CAAC;AACV,GAAG,MAAM,EAAE,GACLC,sBAA8C,QAAQ;AAAA,EAC1D,GAAG;AAAA,EACH,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,kBAAkB;AAAA,EAClB,gBAAgB;AAClB,GAAG,MAAM,EAAE,GACLC,IAAa;AAAA,EACjBF;AA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AAM;AAAA,WAChGM,KAAcC,EAAoB,OAAOG,EAAY,EAAE,SAAS,iCAAA,GAAoCT,EAAe,KAAK,GAAGvB,GAAY,EAAE;AAAA,QAAA,CAC3I;AAAA,MAAA,CACF;AAAA,OACA,CAAC;AAAA,EAEN;AAEA,CAAC;"}
package/dist/index111.js CHANGED
@@ -1,22 +1,22 @@
1
1
  import { defineComponent as A, ref as o, computed as E, openBlock as b, createElementBlock as $, mergeProps as D, createElementVNode as i, renderSlot as L, normalizeProps as H, guardReactiveProps as I, unref as s, createBlock as M, Teleport as R, normalizeClass as U, normalizeStyle as j, withCtx as q, createCommentVNode as O } from "vue";
2
- import { useFloating as G, arrow as J } from "./index223.js";
2
+ import { useFloating as G, arrow as J } from "./index225.js";
3
3
  import { useId as K } from "./index7.js";
4
4
  import { wait as P } from "./index122.js";
5
5
  import Q from "./index9.js";
6
6
  import "./index10.js";
7
- import { throttle as v } from "./index216.js";
8
- import { waitFor as W } from "./index218.js";
9
- import { autoUpdate as X, flip as Y, shift as Z } from "./index205.js";
7
+ import { throttle as v } from "./index208.js";
8
+ import { waitFor as W } from "./index210.js";
9
+ import { autoUpdate as X, flip as Y, shift as Z } from "./index212.js";
10
10
  const ee = { class: "bb-tooltip__bubble" }, te = /* @__PURE__ */ i("svg", {
11
- viewBox: "0 0 24 24",
12
11
  fill: "none",
12
+ viewBox: "0 0 24 24",
13
13
  xmlns: "http://www.w3.org/2000/svg"
14
14
  }, [
15
15
  /* @__PURE__ */ i("path", {
16
16
  d: "M23 23L1 1M23 1L1 23",
17
17
  stroke: "currentColor",
18
- "stroke-width": "2",
19
- "stroke-linecap": "round"
18
+ "stroke-linecap": "round",
19
+ "stroke-width": "2"
20
20
  })
21
21
  ], -1), pe = /* @__PURE__ */ A({
22
22
  __name: "BbTooltip",
@@ -82,9 +82,9 @@ const ee = { class: "bb-tooltip__bubble" }, te = /* @__PURE__ */ i("svg", {
82
82
  }));
83
83
  return (e, n) => (b(), $("span", D({ class: "bb-tooltip" }, x.value), [
84
84
  i("span", {
85
- class: "bb-tooltip__wrapper",
86
85
  ref_key: "wrapper",
87
- ref: u
86
+ ref: u,
87
+ class: "bb-tooltip__wrapper"
88
88
  }, [
89
89
  L(e.$slots, "activator", H(I({
90
90
  props: {
@@ -105,6 +105,9 @@ const ee = { class: "bb-tooltip__bubble" }, te = /* @__PURE__ */ i("svg", {
105
105
  (b(), M(R, { to: "body" }, [
106
106
  f.value || e.eager ? (b(), $("span", {
107
107
  key: 0,
108
+ id: w,
109
+ ref_key: "content",
110
+ ref: c,
108
111
  class: U(["bb-tooltip__bubble-container", {
109
112
  [`bb-tooltip__bubble-container--${s(g)}`]: !0,
110
113
  [`bb-tooltip__bubble-container--${e.theme}`]: e.theme,
@@ -113,25 +116,22 @@ const ee = { class: "bb-tooltip__bubble" }, te = /* @__PURE__ */ i("svg", {
113
116
  "bb-tooltip__bubble-container--opening": a.value,
114
117
  "bb-tooltip__bubble-container--open": l.value
115
118
  }]),
116
- ref_key: "content",
117
- ref: c,
118
119
  style: j({
119
120
  ...s(F),
120
121
  transitionDuration: `${t.transitionDuration}ms`
121
- }),
122
- id: w
122
+ })
123
123
  }, [
124
124
  i("span", D({
125
- class: "bb-tooltip__arrow",
126
125
  ref_key: "bubblearrow",
127
- ref: _
126
+ ref: _,
127
+ class: "bb-tooltip__arrow"
128
128
  }, z.value), null, 16),
129
129
  i("span", ee, [
130
130
  e.showClose ? (b(), M(Q, {
131
131
  key: 0,
132
- tabindex: "-1",
133
132
  "aria-hidden": "true",
134
133
  class: "bb-tooltip__close",
134
+ tabindex: "-1",
135
135
  onClick: N
136
136
  }, {
137
137
  default: q(() => [
@@ -1 +1 @@
1
- {"version":3,"file":"index111.js","sources":["../src/components/BbTooltip/BbTooltip.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, createElementVNode as _createElementVNode, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock, withCtx as _withCtx, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, Teleport as _Teleport } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-tooltip__bubble\" }\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"svg\", {\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M23 23L1 1M23 1L1 23\",\n stroke: \"currentColor\",\n \"stroke-width\": \"2\",\n \"stroke-linecap\": \"round\"\n })\n], -1)\n\nimport { computed, ref } from \"vue\";\nimport { useFloating, autoUpdate, flip, shift, arrow } from \"@floating-ui/vue\";\nimport { useId } from \"@/composables/useId\";\nimport { wait } from \"@/utilities/functions/wait\";\nimport BaseButton from \"../BaseButton/BaseButton.vue\";\nimport type { CommonProps } from \"@/types/CommonProps\";\nimport type { Placement } from \"@floating-ui/vue\";\nimport { throttle } from \"@/utilities/functions/throttle\";\nimport { waitFor } from \"@/utilities/functions/waitFor\";\n\nexport type BbTooltipProps = Pick<\n CommonProps,\n | \"arrowPadding\"\n | \"block\"\n | \"disabled\"\n | \"eager\"\n | \"id\"\n | \"padding\"\n | \"placement\"\n | \"showClose\"\n | \"theme\"\n | \"transitionDuration\"\n>;\n\ntype BbTooltipSlots = {\n activator?: (props: {\n props: {\n \"aria-describedby\": string;\n onMouseenter: typeof onMouseenter;\n onFocus: typeof onFocus;\n onBlur: typeof closeTooltip;\n };\n closed: boolean;\n closing: boolean;\n disabled?: boolean;\n open: boolean;\n opening: boolean;\n placement: Placement;\n }) => any;\n default?: (props: {}) => any;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbTooltip',\n props: {\n arrowPadding: { default: 10 },\n block: { type: Boolean },\n disabled: { type: Boolean },\n eager: { type: Boolean },\n id: {},\n padding: { default: 10 },\n placement: { default: \"top\" },\n showClose: { type: Boolean, default: true },\n theme: { default: \"default\" },\n transitionDuration: { default: 150 }\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\n\nconst id = `bb_${props.id ?? useId().id.value}`;\n\nconst wrapper = ref<HTMLElement>();\nconst content = ref<HTMLElement>();\nconst bubblearrow = ref<HTMLElement>();\n\nconst { floatingStyles, placement, middlewareData } = useFloating(\n wrapper,\n content,\n {\n placement: props.placement,\n whileElementsMounted: autoUpdate,\n middleware: [\n flip(),\n shift({ padding: props.padding }),\n arrow({\n element: bubblearrow,\n padding: props.arrowPadding,\n }),\n ],\n }\n);\n\nconst canOpen = ref(true);\n\nconst opening = ref(false);\nconst open = ref(false);\nconst closing = ref(false);\nconst closed = ref(true);\n\nconst arrowAttributes = computed(() => {\n if (middlewareData.value.arrow) {\n const { x, y } = middlewareData.value.arrow;\n return {\n style: {\n left: `${x}px`,\n top: `${y}px`,\n },\n };\n }\n});\n\nconst onMouseenter = () => {\n if (open.value || opening.value || props.disabled) return;\n openTooltip();\n document.addEventListener(\"mouseover\", onMouseOver, { passive: true });\n document.addEventListener(\"keydown\", onEsc, { passive: true });\n};\n\nconst onFocus = onMouseenter;\n\nconst onMouseOver = throttle((event: Event) => {\n const target = event.target;\n if (!target) return;\n if (target instanceof HTMLElement) {\n let isOutside = true;\n\n if (wrapper.value) {\n if (wrapper.value.contains(target)) {\n isOutside = false;\n }\n }\n if (content.value) {\n if (content.value.contains(target)) {\n isOutside = false;\n }\n }\n\n if (isOutside) {\n closeTooltip();\n }\n }\n}, props.transitionDuration);\n\nconst onEsc = (event: KeyboardEvent) => {\n if (open.value) {\n if (event.key === \"Escape\") {\n closeTooltip();\n }\n }\n};\n\n/* On click of close button tooltip is disallowed from reappearing */\nconst onClickClose = () => {\n canOpen.value = false;\n closeTooltip();\n};\n\nconst hasOpenedOnce = ref(false);\nconst openTooltip = throttle(async () => {\n if (!canOpen.value) return;\n hasOpenedOnce.value = true;\n closed.value = false;\n closing.value = false;\n opening.value = true;\n await wait(50);\n open.value = true;\n opening.value = false;\n}, props.transitionDuration);\n\nconst closeTooltip = throttle(async () => {\n await waitFor(() => !opening.value);\n document.removeEventListener(\"mouseover\", onMouseOver);\n document.removeEventListener(\"keydown\", onEsc);\n open.value = false;\n opening.value = false;\n closing.value = true;\n await wait(props.transitionDuration);\n closing.value = false;\n closed.value = true;\n}, props.transitionDuration);\n\nconst attributes = computed(() => {\n const classes = {\n \"bb-tooltip--block\": props.block,\n [`bb-tooltip--theme-${props.theme}`]: props.theme,\n };\n return {\n class: classes,\n };\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", _mergeProps({ class: \"bb-tooltip\" }, attributes.value), [\n _createElementVNode(\"span\", {\n class: \"bb-tooltip__wrapper\",\n ref_key: \"wrapper\",\n ref: wrapper\n }, [\n _renderSlot(_ctx.$slots, \"activator\", _normalizeProps(_guardReactiveProps({\n props: {\n ...(hasOpenedOnce.value ? {'aria-describedby': id} : {}),\n onMouseenter: onMouseenter,\n onFocus: _unref(onFocus),\n onBlur: _unref(closeTooltip),\n disabled: _ctx.disabled,\n },\n closed: closed.value,\n closing: closing.value,\n disabled: _ctx.disabled,\n open: open.value,\n opening: opening.value,\n placement: _unref(placement),\n })))\n ], 512),\n (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n (hasOpenedOnce.value || _ctx.eager)\n ? (_openBlock(), _createElementBlock(\"span\", {\n key: 0,\n class: _normalizeClass([\"bb-tooltip__bubble-container\", {\n [`bb-tooltip__bubble-container--${_unref(placement)}`]: true,\n [`bb-tooltip__bubble-container--${_ctx.theme}`]: _ctx.theme,\n 'bb-tooltip__bubble-container--hidden': closed.value,\n 'bb-tooltip__bubble-container--closing': closing.value,\n 'bb-tooltip__bubble-container--opening': opening.value,\n 'bb-tooltip__bubble-container--open': open.value,\n }]),\n ref_key: \"content\",\n ref: content,\n style: _normalizeStyle({\n ..._unref(floatingStyles),\n transitionDuration: `${props.transitionDuration}ms`,\n }),\n id: id\n }, [\n _createElementVNode(\"span\", _mergeProps({\n class: \"bb-tooltip__arrow\",\n ref_key: \"bubblearrow\",\n ref: bubblearrow\n }, arrowAttributes.value), null, 16),\n _createElementVNode(\"span\", _hoisted_1, [\n (_ctx.showClose)\n ? (_openBlock(), _createBlock(BaseButton, {\n key: 0,\n tabindex: \"-1\",\n \"aria-hidden\": \"true\",\n class: \"bb-tooltip__close\",\n onClick: onClickClose\n }, {\n default: _withCtx(() => [\n _hoisted_2\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n _renderSlot(_ctx.$slots, \"default\")\n ])\n ], 6))\n : _createCommentVNode(\"\", true)\n ]))\n ], 16))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_sfc_main","_defineComponent","__props","props","id","useId","wrapper","ref","content","bubblearrow","floatingStyles","placement","middlewareData","useFloating","autoUpdate","flip","shift","arrow","canOpen","opening","open","closing","closed","arrowAttributes","computed","x","y","onMouseenter","openTooltip","onMouseOver","onEsc","onFocus","throttle","event","target","isOutside","closeTooltip","onClickClose","hasOpenedOnce","wait","waitFor","attributes","_ctx","_cache","_openBlock","_createElementBlock","_mergeProps","_createElementVNode","_renderSlot","_normalizeProps","_guardReactiveProps","_unref","_createBlock","_Teleport","_normalizeClass","_normalizeStyle","BaseButton","_withCtx","_createCommentVNode"],"mappings":";;;;;;;;;AAGA,MAAMA,KAAa,EAAE,OAAO,wBACtBC,uBAA8C,OAAO;AAAA,EACzD,SAAS;AAAA,EACT,MAAM;AAAA,EACN,OAAO;AACT,GAAG;AAAA,oBACgC,QAAQ;AAAA,IACvC,GAAG;AAAA,IACH,QAAQ;AAAA,IACR,gBAAgB;AAAA,IAChB,kBAAkB;AAAA,EAAA,CACnB;AACH,GAAG,EAAE,GA6CuBC,KAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,cAAc,EAAE,SAAS,GAAG;AAAA,IA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sCC,EAAK;AAAA,UAAA,CAC5C,CAAC;AAAA,UACE,SAAS;AAAA,UACT,KAAKZ;AAAA,UACL,OAAO+C,EAAgB;AAAA,YACzB,GAAGJ,EAAOzC,CAAc;AAAA,YACxB,oBAAoB,GAAGP,EAAM,kBAAkB;AAAA,UAAA,CAChD;AAAA,UACG,IAAAC;AAAA,QAAA,GACC;AAAA,UACD2C,EAAoB,QAAQD,EAAY;AAAA,YACtC,OAAO;AAAA,YACP,SAAS;AAAA,YACT,KAAKrC;AAAA,UACJ,GAAAc,EAAgB,KAAK,GAAG,MAAM,EAAE;AAAA,UACnCwB,EAAoB,QAAQjD,IAAY;AAAA,YACrC4C,EAAK,aACDE,KAAcQ,EAAaI,GAAY;AAAA,cACtC,KAAK;AAAA,cACL,UAAU;AAAA,cACV,eAAe;AAAA,cACf,OAAO;AAAA,cACP,SAASnB;AAAA,YAAA,GACR;AAAA,cACD,SAASoB,EAAS,MAAM;AAAA,gBACtB1D;AAAA,cAAA,CACD;AAAA,cACD,GAAG;AAAA,YAAA,CACJ,KACD2D,EAAoB,IAAI,EAAI;AAAA,YAChCV,EAAYN,EAAK,QAAQ,SAAS;AAAA,UAAA,CACnC;AAAA,QACA,GAAA,CAAC,KACJgB,EAAoB,IAAI,EAAI;AAAA,MAAA,CACjC;AAAA,OACA,EAAE;AAAA,EAEP;AAEA,CAAC;"}
1
+ {"version":3,"file":"index111.js","sources":["../src/components/BbTooltip/BbTooltip.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, renderSlot as _renderSlot, createElementVNode as _createElementVNode, mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock, withCtx as _withCtx, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, Teleport as _Teleport } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-tooltip__bubble\" }\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"svg\", {\n fill: \"none\",\n viewBox: \"0 0 24 24\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M23 23L1 1M23 1L1 23\",\n stroke: \"currentColor\",\n \"stroke-linecap\": \"round\",\n \"stroke-width\": \"2\"\n })\n], -1)\n\nimport { computed, ref } from 'vue';\nimport { useFloating, autoUpdate, flip, shift, arrow } from '@floating-ui/vue';\nimport { useId } from '@/composables/useId';\nimport { wait } from '@/utilities/functions/wait';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport type { CommonProps } from '@/types/CommonProps';\nimport type { Placement } from '@floating-ui/vue';\nimport { throttle } from '@/utilities/functions/throttle';\nimport { waitFor } from '@/utilities/functions/waitFor';\n\nexport type BbTooltipProps = Pick<\n\tCommonProps,\n\t| 'arrowPadding'\n\t| 'block'\n\t| 'disabled'\n\t| 'eager'\n\t| 'id'\n\t| 'padding'\n\t| 'placement'\n\t| 'showClose'\n\t| 'theme'\n\t| 'transitionDuration'\n>;\n\ntype BbTooltipSlots = {\n\tactivator?: (props: {\n\t\tprops: {\n\t\t\t'aria-describedby': string;\n\t\t\tonMouseenter: typeof onMouseenter;\n\t\t\tonFocus: typeof onFocus;\n\t\t\tonBlur: typeof closeTooltip;\n\t\t};\n\t\tclosed: boolean;\n\t\tclosing: boolean;\n\t\tdisabled?: boolean;\n\t\topen: boolean;\n\t\topening: boolean;\n\t\tplacement: Placement;\n\t}) => any;\n\tdefault?: (props: {}) => any;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbTooltip',\n props: {\n arrowPadding: { default: 10 },\n block: { type: Boolean },\n disabled: { type: Boolean },\n eager: { type: Boolean },\n id: {},\n padding: { default: 10 },\n placement: { default: 'top' },\n showClose: { type: Boolean, default: true },\n theme: { default: 'default' },\n transitionDuration: { default: 150 }\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\n\nconst id = `bb_${props.id ?? useId().id.value}`;\n\nconst wrapper = ref<HTMLElement>();\nconst content = ref<HTMLElement>();\nconst bubblearrow = ref<HTMLElement>();\n\nconst { floatingStyles, placement, middlewareData } = useFloating(\n\twrapper,\n\tcontent,\n\t{\n\t\tplacement: props.placement,\n\t\twhileElementsMounted: autoUpdate,\n\t\tmiddleware: [\n\t\t\tflip(),\n\t\t\tshift({ padding: props.padding }),\n\t\t\tarrow({\n\t\t\t\telement: bubblearrow,\n\t\t\t\tpadding: props.arrowPadding,\n\t\t\t}),\n\t\t],\n\t}\n);\n\nconst canOpen = ref(true);\n\nconst opening = ref(false);\nconst open = ref(false);\nconst closing = ref(false);\nconst closed = ref(true);\n\nconst arrowAttributes = computed(() => {\n\tif (middlewareData.value.arrow) {\n\t\tconst { x, y } = middlewareData.value.arrow;\n\t\treturn {\n\t\t\tstyle: {\n\t\t\t\tleft: `${x}px`,\n\t\t\t\ttop: `${y}px`,\n\t\t\t},\n\t\t};\n\t}\n});\n\nconst onMouseenter = () => {\n\tif (open.value || opening.value || props.disabled) return;\n\topenTooltip();\n\tdocument.addEventListener('mouseover', onMouseOver, { passive: true });\n\tdocument.addEventListener('keydown', onEsc, { passive: true });\n};\n\nconst onFocus = onMouseenter;\n\nconst onMouseOver = throttle((event: Event) => {\n\tconst target = event.target;\n\tif (!target) return;\n\tif (target instanceof HTMLElement) {\n\t\tlet isOutside = true;\n\n\t\tif (wrapper.value) {\n\t\t\tif (wrapper.value.contains(target)) {\n\t\t\t\tisOutside = false;\n\t\t\t}\n\t\t}\n\t\tif (content.value) {\n\t\t\tif (content.value.contains(target)) {\n\t\t\t\tisOutside = false;\n\t\t\t}\n\t\t}\n\n\t\tif (isOutside) {\n\t\t\tcloseTooltip();\n\t\t}\n\t}\n}, props.transitionDuration);\n\nconst onEsc = (event: KeyboardEvent) => {\n\tif (open.value) {\n\t\tif (event.key === 'Escape') {\n\t\t\tcloseTooltip();\n\t\t}\n\t}\n};\n\n/* On click of close button tooltip is disallowed from reappearing */\nconst onClickClose = () => {\n\tcanOpen.value = false;\n\tcloseTooltip();\n};\n\nconst hasOpenedOnce = ref(false);\nconst openTooltip = throttle(async () => {\n\tif (!canOpen.value) return;\n\thasOpenedOnce.value = true;\n\tclosed.value = false;\n\tclosing.value = false;\n\topening.value = true;\n\tawait wait(50);\n\topen.value = true;\n\topening.value = false;\n}, props.transitionDuration);\n\nconst closeTooltip = throttle(async () => {\n\tawait waitFor(() => !opening.value);\n\tdocument.removeEventListener('mouseover', onMouseOver);\n\tdocument.removeEventListener('keydown', onEsc);\n\topen.value = false;\n\topening.value = false;\n\tclosing.value = true;\n\tawait wait(props.transitionDuration);\n\tclosing.value = false;\n\tclosed.value = true;\n}, props.transitionDuration);\n\nconst attributes = computed(() => {\n\tconst classes = {\n\t\t'bb-tooltip--block': props.block,\n\t\t[`bb-tooltip--theme-${props.theme}`]: props.theme,\n\t};\n\treturn {\n\t\tclass: classes,\n\t};\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", _mergeProps({ class: \"bb-tooltip\" }, attributes.value), [\n _createElementVNode(\"span\", {\n ref_key: \"wrapper\",\n ref: wrapper,\n class: \"bb-tooltip__wrapper\"\n }, [\n _renderSlot(_ctx.$slots, \"activator\", _normalizeProps(_guardReactiveProps({\n\t\t\t\t\tprops: {\n\t\t\t\t\t\t...(hasOpenedOnce.value ? { 'aria-describedby': id } : {}),\n\t\t\t\t\t\tonMouseenter: onMouseenter,\n\t\t\t\t\t\tonFocus: _unref(onFocus),\n\t\t\t\t\t\tonBlur: _unref(closeTooltip),\n\t\t\t\t\t\tdisabled: _ctx.disabled,\n\t\t\t\t\t},\n\t\t\t\t\tclosed: closed.value,\n\t\t\t\t\tclosing: closing.value,\n\t\t\t\t\tdisabled: _ctx.disabled,\n\t\t\t\t\topen: open.value,\n\t\t\t\t\topening: opening.value,\n\t\t\t\t\tplacement: _unref(placement),\n\t\t\t\t})))\n ], 512),\n (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n (hasOpenedOnce.value || _ctx.eager)\n ? (_openBlock(), _createElementBlock(\"span\", {\n key: 0,\n id: id,\n ref_key: \"content\",\n ref: content,\n class: _normalizeClass([\"bb-tooltip__bubble-container\", {\n\t\t\t\t\t[`bb-tooltip__bubble-container--${_unref(placement)}`]: true,\n\t\t\t\t\t[`bb-tooltip__bubble-container--${_ctx.theme}`]: _ctx.theme,\n\t\t\t\t\t'bb-tooltip__bubble-container--hidden': closed.value,\n\t\t\t\t\t'bb-tooltip__bubble-container--closing': closing.value,\n\t\t\t\t\t'bb-tooltip__bubble-container--opening': opening.value,\n\t\t\t\t\t'bb-tooltip__bubble-container--open': open.value,\n\t\t\t\t}]),\n style: _normalizeStyle({\n\t\t\t\t\t..._unref(floatingStyles),\n\t\t\t\t\ttransitionDuration: `${props.transitionDuration}ms`,\n\t\t\t\t})\n }, [\n _createElementVNode(\"span\", _mergeProps({\n ref_key: \"bubblearrow\",\n ref: bubblearrow,\n class: \"bb-tooltip__arrow\"\n }, arrowAttributes.value), null, 16),\n _createElementVNode(\"span\", _hoisted_1, [\n (_ctx.showClose)\n ? (_openBlock(), _createBlock(BaseButton, {\n key: 0,\n \"aria-hidden\": \"true\",\n class: \"bb-tooltip__close\",\n tabindex: \"-1\",\n onClick: onClickClose\n }, {\n default: _withCtx(() => [\n _hoisted_2\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n _renderSlot(_ctx.$slots, \"default\")\n ])\n ], 6))\n : _createCommentVNode(\"\", true)\n ]))\n ], 16))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_sfc_main","_defineComponent","__props","props","id","useId","wrapper","ref","content","bubblearrow","floatingStyles","placement","middlewareData","useFloating","autoUpdate","flip","shift","arrow","canOpen","opening","open","closing","closed","arrowAttributes","computed","x","y","onMouseenter","openTooltip","onMouseOver","onEsc","onFocus","throttle","event","target","isOutside","closeTooltip","onClickClose","hasOpenedOnce","wait","waitFor","attributes","_ctx","_cache","_openBlock","_createElementBlock","_mergeProps","_createElementVNode","_renderSlot","_normalizeProps","_guardReactiveProps","_unref","_createBlock","_Teleport","_normalizeClass","_normalizeStyle","BaseButton","_withCtx","_createCommentVNode"],"mappings":";;;;;;;;;AAGA,MAAMA,KAAa,EAAE,OAAO,wBACtBC,uBAA8C,OAAO;AAAA,EACzD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AACT,GAAG;AAAA,oBACgC,QAAQ;AAAA,IACvC,GAAG;AAAA,IACH,QAAQ;AAAA,IACR,kBAAkB;AAAA,IAClB,gBAAgB;AAAA,EAAA,CACjB;AACH,GAAG,EAAE,GA6CuBC,KAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,cAAc,EAAE,SAAS,GAAG;AAAA,IAC5B,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,UAAU,EAAE,MAAM,QAAQ;AAAA,IAC1B,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,IAAI,CAAC;AAAA,IACL,SAAS,EAAE,SAAS,GAAG;AAAA,IACvB,WAAW,EAAE,SAAS,MAAM;AAAA,IAC5B,WAAW,EAAE,MAAM,SAAS,SAAS,GAAK;AAAA,IAC1C,OAAO,EAAE,SAAS,UAAU;AAAA,IAC5B,oBAAoB,EAAE,SAAS,IAAI;AAAA,EACrC;AAAA,EACA,MAAMC,GAAc;AAEtB,UAAMC,IAAQD,GAIRE,IAAK,MAAMD,EAAM,MAAME,IAAQ,GAAG,KAAK,IAEvCC,IAAUC,KACVC,IAAUD,KACVE,IAAcF,KAEd,EAAE,gBAAAG,GAAgB,WAAAC,GAAW,gBAAAC,EAAmB,IAAAC;AAAA,MACrDP;AAAA,MACAE;AAAA,MACA;AAAA,QACC,WAAWL,EAAM;AAAA,QACjB,sBAAsBW;AAAA,QACtB,YAAY;AAAA,UACXC,EAAK;AAAA,UACLC,EAAM,EAAE,SAASb,EAAM,SAA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,QAAQ,SAAS;AAAA,UAAA,CACnC;AAAA,QACA,GAAA,CAAC,KACJgB,EAAoB,IAAI,EAAI;AAAA,MAAA,CACjC;AAAA,OACA,EAAE;AAAA,EAEP;AAEA,CAAC;"}
package/dist/index113.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as $, computed as g, resolveComponent as y, openBlock as f, createElementBlock as i, Fragment as v, renderList as h, normalizeClass as b, createElementVNode as s, renderSlot as p, createVNode as k, createSlots as B, withCtx as C, normalizeProps as T, guardReactiveProps as _ } from "vue";
2
- import { flattenTree as P } from "./index245.js";
2
+ import { flattenTree as P } from "./index247.js";
3
3
  const w = { class: "bb-tree-row" }, z = { class: "bb-tree-main-content" }, I = /* @__PURE__ */ $({
4
4
  __name: "BbTree",
5
5
  props: {
@@ -32,11 +32,11 @@ const w = { class: "bb-tree-row" }, z = { class: "bb-tree-main-content" }, I = /
32
32
  return (n, d) => {
33
33
  const l = y("BbTree", !0);
34
34
  return f(!0), i(v, null, h(x.value, (e) => (f(), i("div", {
35
+ key: e.identifier,
35
36
  class: b(["bb-tree", {
36
37
  [`bb-tree--depth-${e.depth}`]: !0,
37
38
  "bb-tree--open": e.open
38
- }]),
39
- key: e.identifier
39
+ }])
40
40
  }, [
41
41
  s("div", w, [
42
42
  s("div", z, [
@@ -1 +1 @@
1
- {"version":3,"file":"index113.js","sources":["../src/components/BbTree/BbTree.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, renderSlot as _renderSlot, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, resolveComponent as _resolveComponent, withCtx as _withCtx, createSlots as _createSlots, createVNode as _createVNode, normalizeClass as _normalizeClass } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-tree-row\" }\nconst _hoisted_2 = { class: \"bb-tree-main-content\" }\n\nimport { flattenTree } from \"@/utilities/functions/flattenTree\";\nimport { computed } from \"vue\";\n\nexport type TreeItem = {\n /**\n * Array of children of the current item. Is the key\n * with which we can identify whther the node is nested or not.\n */\n children?: TreeItem[];\n /**\n * Status of the current node. When a node is open\n * it's children are displayed. Otherwise its children\n * are hidden.\n */\n open?: boolean;\n [key: symbol | string]: any;\n} & Pick<BbTreeProps, \"expandable\">;\n\nexport type BbTreeProps = {\n /**\n * Array containing the tree like structure of the items.\n */\n items: TreeItem[];\n /**\n * Parent of the current node. `undefined` for the first level.\n */\n parent?: TreeItem;\n /**\n * Identifier of the item.\n */\n identifier?: string | number;\n /**\n * Current depth of the tree. Starting at 0 for\n * the first level increasing at every level down.\n */\n depth?: number;\n /**\n * Defines the item as expandable. It can be a\n * global boolean defining all items as expandable.\n * Or it can be a function that receives the item,\n * depth, and parent of the current node and returns a boolean.\n */\n expandable?:\n | boolean\n | ((item: TreeItem, depth: number, parent?: TreeItem) => boolean);\n};\n\nexport type BbTreeSlots = {\n [key: string]: (props: {\n item: any;\n parent?: any;\n index: number;\n offset: number;\n open: boolean;\n depth: number;\n identifier?: string | number;\n expandable: boolean;\n }) => any;\n};\ntype MappedItem = {\n children: TreeItem[\"children\"];\n depth: NonNullable<BbTreeProps[\"depth\"]>;\n expandable: boolean;\n identifier: any;\n index: number;\n offset: number;\n open: boolean;\n original: any;\n parent: BbTreeProps[\"parent\"];\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbTree',\n props: {\n items: { default: () => [] as TreeItem[] },\n parent: {},\n identifier: { default: \"id\" },\n depth: { default: 0 },\n expandable: { type: [Boolean, Function] }\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\n\nconst itemIsOpen = (item: TreeItem) => {\n /* If the item is not expandable it must be open */\n if (typeof item.open === \"undefined\") return true;\n return item.open;\n};\n\nconst internalItems = computed<MappedItem[]>(() => {\n let currentOffset = 0;\n\n return props.items.map((item: TreeItem, index) => {\n const open = itemIsOpen(item);\n const expandableProp = item.expandable ?? props.expandable;\n const offset = currentOffset + 1;\n\n currentOffset = currentOffset + flattenTree([item], \"children\").length;\n\n let expandable = false;\n if (typeof expandableProp !== \"undefined\") {\n if (typeof expandableProp === \"function\")\n expandable = expandableProp(item, props.depth, props.parent);\n else expandable = expandableProp;\n }\n return {\n children: item.children,\n depth: props.depth,\n expandable: expandable,\n identifier: item[props.identifier],\n offset,\n index,\n open,\n original: item,\n parent: props.parent,\n };\n });\n});\n\nreturn (_ctx: any,_cache: any) => {\n const _component_BbTree = _resolveComponent(\"BbTree\", true)!\n\n return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(internalItems.value, (item) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"bb-tree\", {\n [`bb-tree--depth-${item.depth}`]: true,\n 'bb-tree--open': item.open,\n }]),\n key: item.identifier\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_ctx.$slots[item.identifier])\n ? _renderSlot(_ctx.$slots, item.identifier, {\n key: 0,\n depth: item.depth,\n expandable: item.expandable,\n identifier: item.identifier,\n index: item.index,\n item: item.original,\n offset: item.offset,\n open: item.open,\n parent: item.parent\n })\n : (_ctx.$slots[item.depth])\n ? _renderSlot(_ctx.$slots, item.depth, {\n key: 1,\n depth: item.depth,\n expandable: item.expandable,\n identifier: item.identifier,\n index: item.index,\n item: item.original,\n offset: item.offset,\n open: item.open,\n parent: item.parent\n })\n : _renderSlot(_ctx.$slots, 'default', {\n key: 2,\n depth: item.depth,\n expandable: item.expandable,\n identifier: item.identifier,\n index: item.index,\n item: item.original,\n offset: item.offset,\n open: item.open,\n parent: item.parent\n })\n ])\n ]),\n _createElementVNode(\"div\", {\n class: _normalizeClass(`bb-tree--depth-${item.depth}-children`)\n }, [\n _renderSlot(_ctx.$slots, `${item.depth}-children`, {\n depth: item.depth,\n expandable: item.expandable,\n identifier: item.identifier,\n index: item.index,\n item: item.original,\n offset: item.offset,\n open: item.open,\n parent: item.parent\n }, () => [\n _renderSlot(_ctx.$slots, `${item.identifier}-children`, {\n depth: item.depth,\n expandable: item.expandable,\n identifier: item.identifier,\n index: item.index,\n item: item.original,\n offset: item.offset,\n open: item.open,\n parent: item.parent\n }, () => [\n _createVNode(_component_BbTree, {\n depth: item.depth + 1,\n expandable: _ctx.expandable,\n identifier: props.identifier,\n items: item.children,\n parent: item\n }, _createSlots({ _: 2 }, [\n _renderList(_ctx.$slots, (_, name) => {\n return {\n name: name,\n fn: _withCtx((data) => [\n _renderSlot(_ctx.$slots, name, _normalizeProps(_guardReactiveProps(data)))\n ])\n }\n })\n ]), 1032, [\"depth\", \"expandable\", \"identifier\", \"items\", \"parent\"])\n ])\n ])\n ], 2)\n ], 2))\n }), 128))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_sfc_main","_defineComponent","__props","props","itemIsOpen","item","internalItems","computed","currentOffset","index","open","expandableProp","offset","flattenTree","expandable","_ctx","_cache","_component_BbTree","_resolveComponent","_openBlock","_createElementBlock","_Fragment","_renderList","_normalizeClass","_createElementVNode","_renderSlot","_createVNode","_createSlots","_","name","_withCtx","data","_normalizeProps","_guardReactiveProps"],"mappings":";;AAGA,MAAMA,IAAa,EAAE,OAAO,iBACtBC,IAAa,EAAE,OAAO,0BA0EAC,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,OAAO,EAAE,SAAS,MAAM,GAAiB;AAAA,IACzC,QAAQ,CAAC;AAAA,IACT,YAAY,EAAE,SAAS,KAAK;AAAA,IAC5B,OAAO,EAAE,SAAS,EAAE;AAAA,IACpB,YAAY,EAAE,MAAM,CAAC,SAAS,QAAQ,EAAE;AAAA,EAC1C;AAAA,EACA,MAAMC,GAAc;AAEtB,UAAMC,IAAQD,GAIRE,IAAa,CAACC,MAEd,OAAOA,EAAK,OAAS,MAAoB,KACtCA,EAAK,MAGRC,IAAgBC,EAAuB,MAAM;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AAYA,EAAK;AAAA,cACjB,YAAYA,EAAK;AAAA,cACjB,OAAOA,EAAK;AAAA,cACZ,MAAMA,EAAK;AAAA,cACX,QAAQA,EAAK;AAAA,cACb,MAAMA,EAAK;AAAA,cACX,QAAQA,EAAK;AAAA,YAAA,GACZ,MAAM;AAAA,cACPqB,EAAaT,GAAmB;AAAA,gBAC9B,OAAOZ,EAAK,QAAQ;AAAA,gBACpB,YAAYU,EAAK;AAAA,gBACjB,YAAYZ,EAAM;AAAA,gBAClB,OAAOE,EAAK;AAAA,gBACZ,QAAQA;AAAA,cACP,GAAAsB,EAAa,EAAE,GAAG,KAAK;AAAA,gBACxBL,EAAYP,EAAK,QAAQ,CAACa,GAAGC,OACpB;AAAA,kBACL,MAAAA;AAAA,kBACA,IAAIC,EAAS,CAACC,MAAS;AAAA,oBACrBN,EAAYV,EAAK,QAAQc,GAAMG,EAAgBC,EAAoBF,CAAI,CAAC,CAAC;AAAA,kBAAA,CAC1E;AAAA,gBAAA,EAEJ;AAAA,cAAA,CACF,GAAG,MAAM,CAAC,SAAS,cAAc,cAAc,SAAS,QAAQ,CAAC;AAAA,YAAA,CACnE;AAAA,UAAA,CACF;AAAA,WACA,CAAC;AAAA,SACH,CAAC,EACL,GAAG,GAAG;AAAA,IAAA;AAAA,EAET;AAEA,CAAC;"}
1
+ {"version":3,"file":"index113.js","sources":["../src/components/BbTree/BbTree.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, renderSlot as _renderSlot, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, resolveComponent as _resolveComponent, withCtx as _withCtx, createSlots as _createSlots, createVNode as _createVNode, normalizeClass as _normalizeClass } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-tree-row\" }\nconst _hoisted_2 = { class: \"bb-tree-main-content\" }\n\nimport { flattenTree } from '@/utilities/functions/flattenTree';\nimport { computed } from 'vue';\n\nexport type TreeItem = {\n\t/**\n\t * Array of children of the current item. Is the key\n\t * with which we can identify whther the node is nested or not.\n\t */\n\tchildren?: TreeItem[];\n\t/**\n\t * Status of the current node. When a node is open\n\t * it's children are displayed. Otherwise its children\n\t * are hidden.\n\t */\n\topen?: boolean;\n\t[key: symbol | string]: any;\n} & Pick<BbTreeProps, 'expandable'>;\n\nexport type BbTreeProps = {\n\t/**\n\t * Array containing the tree like structure of the items.\n\t */\n\titems: TreeItem[];\n\t/**\n\t * Parent of the current node. `undefined` for the first level.\n\t */\n\tparent?: TreeItem;\n\t/**\n\t * Identifier of the item.\n\t */\n\tidentifier?: string | number;\n\t/**\n\t * Current depth of the tree. Starting at 0 for\n\t * the first level increasing at every level down.\n\t */\n\tdepth?: number;\n\t/**\n\t * Defines the item as expandable. It can be a\n\t * global boolean defining all items as expandable.\n\t * Or it can be a function that receives the item,\n\t * depth, and parent of the current node and returns a boolean.\n\t */\n\texpandable?:\n\t\t| boolean\n\t\t| ((item: TreeItem, depth: number, parent?: TreeItem) => boolean);\n};\n\nexport type BbTreeSlots = {\n\t[key: string]: (props: {\n\t\titem: any;\n\t\tparent?: any;\n\t\tindex: number;\n\t\toffset: number;\n\t\topen: boolean;\n\t\tdepth: number;\n\t\tidentifier?: string | number;\n\t\texpandable: boolean;\n\t}) => any;\n};\ntype MappedItem = {\n\tchildren: TreeItem['children'];\n\tdepth: NonNullable<BbTreeProps['depth']>;\n\texpandable: boolean;\n\tidentifier: any;\n\tindex: number;\n\toffset: number;\n\topen: boolean;\n\toriginal: any;\n\tparent: BbTreeProps['parent'];\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbTree',\n props: {\n items: { default: () => [] as TreeItem[] },\n parent: {},\n identifier: { default: 'id' },\n depth: { default: 0 },\n expandable: { type: [Boolean, Function] }\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\n\nconst itemIsOpen = (item: TreeItem) => {\n\t/* If the item is not expandable it must be open */\n\tif (typeof item.open === 'undefined') return true;\n\treturn item.open;\n};\n\nconst internalItems = computed<MappedItem[]>(() => {\n\tlet currentOffset = 0;\n\n\treturn props.items.map((item: TreeItem, index) => {\n\t\tconst open = itemIsOpen(item);\n\t\tconst expandableProp = item.expandable ?? props.expandable;\n\t\tconst offset = currentOffset + 1;\n\n\t\tcurrentOffset = currentOffset + flattenTree([item], 'children').length;\n\n\t\tlet expandable = false;\n\t\tif (typeof expandableProp !== 'undefined') {\n\t\t\tif (typeof expandableProp === 'function')\n\t\t\t\texpandable = expandableProp(item, props.depth, props.parent);\n\t\t\telse expandable = expandableProp;\n\t\t}\n\t\treturn {\n\t\t\tchildren: item.children,\n\t\t\tdepth: props.depth,\n\t\t\texpandable: expandable,\n\t\t\tidentifier: item[props.identifier],\n\t\t\toffset,\n\t\t\tindex,\n\t\t\topen,\n\t\t\toriginal: item,\n\t\t\tparent: props.parent,\n\t\t};\n\t});\n});\n\nreturn (_ctx: any,_cache: any) => {\n const _component_BbTree = _resolveComponent(\"BbTree\", true)!\n\n return (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(internalItems.value, (item) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n key: item.identifier,\n class: _normalizeClass([\"bb-tree\", {\n\t\t\t[`bb-tree--depth-${item.depth}`]: true,\n\t\t\t'bb-tree--open': item.open,\n\t\t}])\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_ctx.$slots[item.identifier])\n ? _renderSlot(_ctx.$slots, item.identifier, {\n key: 0,\n depth: item.depth,\n expandable: item.expandable,\n identifier: item.identifier,\n index: item.index,\n item: item.original,\n offset: item.offset,\n open: item.open,\n parent: item.parent\n })\n : (_ctx.$slots[item.depth])\n ? _renderSlot(_ctx.$slots, item.depth, {\n key: 1,\n depth: item.depth,\n expandable: item.expandable,\n identifier: item.identifier,\n index: item.index,\n item: item.original,\n offset: item.offset,\n open: item.open,\n parent: item.parent\n })\n : _renderSlot(_ctx.$slots, 'default', {\n key: 2,\n depth: item.depth,\n expandable: item.expandable,\n identifier: item.identifier,\n index: item.index,\n item: item.original,\n offset: item.offset,\n open: item.open,\n parent: item.parent\n })\n ])\n ]),\n _createElementVNode(\"div\", {\n class: _normalizeClass(`bb-tree--depth-${item.depth}-children`)\n }, [\n _renderSlot(_ctx.$slots, `${item.depth}-children`, {\n depth: item.depth,\n expandable: item.expandable,\n identifier: item.identifier,\n index: item.index,\n item: item.original,\n offset: item.offset,\n open: item.open,\n parent: item.parent\n }, () => [\n _renderSlot(_ctx.$slots, `${item.identifier}-children`, {\n depth: item.depth,\n expandable: item.expandable,\n identifier: item.identifier,\n index: item.index,\n item: item.original,\n offset: item.offset,\n open: item.open,\n parent: item.parent\n }, () => [\n _createVNode(_component_BbTree, {\n depth: item.depth + 1,\n expandable: _ctx.expandable,\n identifier: props.identifier,\n items: item.children,\n parent: item\n }, _createSlots({ _: 2 }, [\n _renderList(_ctx.$slots, (_, name) => {\n return {\n name: name,\n fn: _withCtx((data) => [\n _renderSlot(_ctx.$slots, name, _normalizeProps(_guardReactiveProps(data)))\n ])\n }\n })\n ]), 1032, [\"depth\", \"expandable\", \"identifier\", \"items\", \"parent\"])\n ])\n ])\n ], 2)\n ], 2))\n }), 128))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_sfc_main","_defineComponent","__props","props","itemIsOpen","item","internalItems","computed","currentOffset","index","open","expandableProp","offset","flattenTree","expandable","_ctx","_cache","_component_BbTree","_resolveComponent","_openBlock","_createElementBlock","_Fragment","_renderList","_normalizeClass","_createElementVNode","_renderSlot","_createVNode","_createSlots","_","name","_withCtx","data","_normalizeProps","_guardReactiveProps"],"mappings":";;AAGA,MAAMA,IAAa,EAAE,OAAO,iBACtBC,IAAa,EAAE,OAAO,0BA0EAC,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL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ElementVNode as l, renderSlot as r, createTextVNode as i, toDisplayString as p, withModifiers as _, createCommentVNode as d } from "vue";
2
2
  const b = { class: "bb-chip" }, h = { class: "bb-chip__content" }, m = ["aria-label"], u = {
3
- xmlns: "http://www.w3.org/2000/svg",
4
- viewBox: "0 0 20 20",
5
- role: "img",
6
3
  "aria-hidden": "true",
7
4
  class: "v-icon__svg",
8
- style: { height: "20px", width: "20px" }
5
+ role: "img",
6
+ style: { height: "20px", width: "20px" },
7
+ viewBox: "0 0 20 20",
8
+ xmlns: "http://www.w3.org/2000/svg"
9
9
  }, L = /* @__PURE__ */ l("path", {
10
10
  d: "M15 6.375L14.125 5.5L10 9.625L5.875 5.5L5 6.375L9.125 10.5L5 14.625L5.875 15.5L10 11.375L14.125 15.5L15 14.625L10.875 10.5L15 6.375Z",
11
11
  fill: "currentColor"
@@ -33,8 +33,8 @@ const b = { class: "bb-chip" }, h = { class: "bb-chip__content" }, m = ["aria-la
33
33
  key: 0,
34
34
  "aria-label": e.clearableLabel,
35
35
  class: "bb-chip__clear-button",
36
- onClick: _(n, ["stop", "prevent"]),
37
- type: "button"
36
+ type: "button",
37
+ onClick: _(n, ["stop", "prevent"])
38
38
  }, [
39
39
  (t(), o("svg", u, f))
40
40
  ], 8, m)) : d("", !0)
@@ -1 +1 @@
1
- {"version":3,"file":"index115.js","sources":["../src/components/BbChip/BbChip.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, withModifiers as _withModifiers, createCommentVNode as _createCommentVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-chip\" }\nconst _hoisted_2 = { class: \"bb-chip__content\" }\nconst _hoisted_3 = [\"aria-label\"]\nconst _hoisted_4 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n viewBox: \"0 0 20 20\",\n role: \"img\",\n \"aria-hidden\": \"true\",\n class: \"v-icon__svg\",\n style: {\"height\":\"20px\",\"width\":\"20px\"}\n}\nconst _hoisted_5 = /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M15 6.375L14.125 5.5L10 9.625L5.875 5.5L5 6.375L9.125 10.5L5 14.625L5.875 15.5L10 11.375L14.125 15.5L15 14.625L10.875 10.5L15 6.375Z\",\n fill: \"currentColor\"\n}, null, -1)\nconst _hoisted_6 = [\n _hoisted_5\n]\n\nimport type { CommonProps } from \"@/types/CommonProps\";\n\nexport type BbChipProps = Pick<CommonProps, \"text\"> & {\n /**\n * Renders a button with a close icon. Used to indicate the possibility of deleting the item.\n */\n clearable?: boolean;\n /**\n * The label the clearing button must have\n */\n clearableLabel?: string;\n};\n\nexport type BbChipEvents = {\n (e: \"click:clear\", event: MouseEvent): void;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbChip',\n props: {\n text: {},\n clearable: { type: Boolean, default: true },\n clearableLabel: { default: \"Elimina\" }\n },\n emits: [\"click:clear\"],\n setup(__props: any, { emit: __emit }) {\n\n\n\n\n\nconst emit = __emit;\nconst onClear = (event: MouseEvent) => {\n emit(\"click:clear\", event);\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", _hoisted_1, [\n _createElementVNode(\"span\", _hoisted_2, [\n _renderSlot(_ctx.$slots, \"default\", {}, () => [\n _createTextVNode(_toDisplayString(_ctx.text), 1)\n ])\n ]),\n (_ctx.clearable)\n ? (_openBlock(), _createElementBlock(\"button\", {\n key: 0,\n \"aria-label\": _ctx.clearableLabel,\n class: \"bb-chip__clear-button\",\n onClick: _withModifiers(onClear, [\"stop\",\"prevent\"]),\n type: \"button\"\n }, [\n (_openBlock(), _createElementBlock(\"svg\", _hoisted_4, _hoisted_6))\n ], 8, _hoisted_3))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_sfc_main","_defineComponent","__props","__emit","emit","onClear","event","_ctx","_cache","_openBlock","_createElementBlock","_createElementVNode","_renderSlot","_createTextVNode","_toDisplayString","_withModifiers","_createCommentVNode"],"mappings":";AAGA,MAAMA,IAAa,EAAE,OAAO,aACtBC,IAAa,EAAE,OAAO,sBACtBC,IAAa,CAAC,YAAY,GAC1BC,IAAa;AAAA,EACjB,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AAAA,EACN,eAAe;AAAA,EACf,OAAO;AAAA,EACP,OAAO,EAAC,QAAS,QAAO,OAAQ,OAAM;AACxC,GACMC,sBAA8C,QAAQ;AAAA,EAC1D,GAAG;AAAA,EACH,MAAM;AACR,GAAG,MAAM,EAAE,GACLC,IAAa;AAAA,EACjBD;AACF,GAoB4BE,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,MAAM,CAAC;AAAA,IACP,WAAW,EAAE,MAAM,SAAS,SAAS,GAAK;AAAA,IAC1C,gBAAgB,EAAE,SAAS,UAAU;AAAA,EACvC;AAAA,EACA,OAAO,CAAC,aAAa;AAAA,EACrB,MAAMC,GAAc,EAAE,MAAMC,KAAU;AAMxC,UAAMC,IAAOD,GACPE,IAAU,CAACC,MAAsB;AACrC,MAAAF,EAAK,eAAeE,CAAK;AAAA,IAAA;AAGpB,WAAA,CAACC,GAAUC,OACRC,EAAW,GAAGC,EAAoB,QAAQhB,GAAY;AAAA,MAC5DiB,EAAoB,QAAQhB,GAAY;AAAA,QACtCiB,EAAYL,EAAK,QAAQ,WAAW,IAAI,MAAM;AAAA,UAC5CM,EAAiBC,EAAiBP,EAAK,IAAI,GAAG,CAAC;AAAA,QAAA,CAChD;AAAA,MAAA,CACF;AAAA,MACAA,EAAK,aACDE,KAAcC,EAAoB,UAAU;AAAA,QAC3C,KAAK;AAAA,QACL,cAAcH,EAAK;AAAA,QACnB,OAAO;AAAA,QACP,SAASQ,EAAeV,GAAS,CAAC,QAAO,SAAS,CAAC;AAAA,QACnD,MAAM;AAAA,MAAA,GACL;AAAA,SACAI,EAAW,GAAGC,EAAoB,OAAOb,GAAYE,CAAU;AAAA,SAC/D,GAAGH,CAAU,KAChBoB,EAAoB,IAAI,EAAI;AAAA,IAAA,CACjC;AAAA,EAEH;AAEA,CAAC;"}
1
+ {"version":3,"file":"index115.js","sources":["../src/components/BbChip/BbChip.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, withModifiers as _withModifiers, createCommentVNode as _createCommentVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-chip\" }\nconst _hoisted_2 = { class: \"bb-chip__content\" }\nconst _hoisted_3 = [\"aria-label\"]\nconst _hoisted_4 = {\n \"aria-hidden\": \"true\",\n class: \"v-icon__svg\",\n role: \"img\",\n style: {\"height\":\"20px\",\"width\":\"20px\"},\n viewBox: \"0 0 20 20\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\nconst _hoisted_5 = /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M15 6.375L14.125 5.5L10 9.625L5.875 5.5L5 6.375L9.125 10.5L5 14.625L5.875 15.5L10 11.375L14.125 15.5L15 14.625L10.875 10.5L15 6.375Z\",\n fill: \"currentColor\"\n}, null, -1)\nconst _hoisted_6 = [\n _hoisted_5\n]\n\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type BbChipProps = Pick<CommonProps, 'text'> & {\n\t/**\n\t * Renders a button with a close icon. Used to indicate the possibility of deleting the item.\n\t */\n\tclearable?: boolean;\n\t/**\n\t * The label the clearing button must have\n\t */\n\tclearableLabel?: string;\n};\n\nexport type BbChipEvents = {\n\t(e: 'click:clear', event: MouseEvent): void;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbChip',\n props: {\n text: {},\n clearable: { type: Boolean, default: true },\n clearableLabel: { default: 'Elimina' }\n },\n emits: ['click:clear'],\n setup(__props: any, { emit: __emit }) {\n\n\n\n\n\nconst emit = __emit;\nconst onClear = (event: MouseEvent) => {\n\temit('click:clear', event);\n};\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", _hoisted_1, [\n _createElementVNode(\"span\", _hoisted_2, [\n _renderSlot(_ctx.$slots, \"default\", {}, () => [\n _createTextVNode(_toDisplayString(_ctx.text), 1)\n ])\n ]),\n (_ctx.clearable)\n ? (_openBlock(), _createElementBlock(\"button\", {\n key: 0,\n \"aria-label\": _ctx.clearableLabel,\n class: \"bb-chip__clear-button\",\n type: \"button\",\n onClick: _withModifiers(onClear, [\"stop\",\"prevent\"])\n }, [\n (_openBlock(), _createElementBlock(\"svg\", _hoisted_4, _hoisted_6))\n ], 8, _hoisted_3))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_sfc_main","_defineComponent","__props","__emit","emit","onClear","event","_ctx","_cache","_openBlock","_createElementBlock","_createElementVNode","_renderSlot","_createTextVNode","_toDisplayString","_withModifiers","_createCommentVNode"],"mappings":";AAGA,MAAMA,IAAa,EAAE,OAAO,aACtBC,IAAa,EAAE,OAAO,sBACtBC,IAAa,CAAC,YAAY,GAC1BC,IAAa;AAAA,EACjB,eAAe;AAAA,EACf,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO,EAAC,QAAS,QAAO,OAAQ,OAAM;AAAA,EACtC,SAAS;AAAA,EACT,OAAO;AACT,GACMC,sBAA8C,QAAQ;AAAA,EAC1D,GAAG;AAAA,EACH,MAAM;AACR,GAAG,MAAM,EAAE,GACLC,IAAa;AAAA,EACjBD;AACF,GAoB4BE,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,MAAM,CAAC;AAAA,IACP,WAAW,EAAE,MAAM,SAAS,SAAS,GAAK;AAAA,IAC1C,gBAAgB,EAAE,SAAS,UAAU;AAAA,EACvC;AAAA,EACA,OAAO,CAAC,aAAa;AAAA,EACrB,MAAMC,GAAc,EAAE,MAAMC,KAAU;AAMxC,UAAMC,IAAOD,GACPE,IAAU,CAACC,MAAsB;AACtC,MAAAF,EAAK,eAAeE,CAAK;AAAA,IAAA;AAGnB,WAAA,CAACC,GAAUC,OACRC,EAAW,GAAGC,EAAoB,QAAQhB,GAAY;AAAA,MAC5DiB,EAAoB,QAAQhB,GAAY;AAAA,QACtCiB,EAAYL,EAAK,QAAQ,WAAW,IAAI,MAAM;AAAA,UAC5CM,EAAiBC,EAAiBP,EAAK,IAAI,GAAG,CAAC;AAAA,QAAA,CAChD;AAAA,MAAA,CACF;AAAA,MACAA,EAAK,aACDE,KAAcC,EAAoB,UAAU;AAAA,QAC3C,KAAK;AAAA,QACL,cAAcH,EAAK;AAAA,QACnB,OAAO;AAAA,QACP,MAAM;AAAA,QACN,SAASQ,EAAeV,GAAS,CAAC,QAAO,SAAS,CAAC;AAAA,MAAA,GAClD;AAAA,SACAI,EAAW,GAAGC,EAAoB,OAAOb,GAAYE,CAAU;AAAA,SAC/D,GAAGH,CAAU,KAChBoB,EAAoB,IAAI,EAAI;AAAA,IAAA,CACjC;AAAA,EAEH;AAEA,CAAC;"}
package/dist/index116.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as i, ref as a, watch as s, computed as u, openBlock as c, createElementBlock as p, normalizeProps as d, guardReactiveProps as m, createElementVNode as b, renderSlot as v, createCommentVNode as f } from "vue";
2
2
  import { wait as V } from "./index122.js";
3
- import { throttle as _ } from "./index216.js";
3
+ import { throttle as _ } from "./index208.js";
4
4
  const h = { class: "bb-collapsible__content" }, k = /* @__PURE__ */ i({
5
5
  __name: "BbCollapsible",
6
6
  props: {
@@ -1 +1 @@
1
- {"version":3,"file":"index116.js","sources":["../src/components/BbCollapsible/BbCollapsible.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-collapsible__content\" }\n\nimport { wait } from \"@/utilities/functions/wait\";\nimport { throttle } from \"@/utilities/functions/throttle\";\nimport { computed, ref, watch } from \"vue\";\nimport type { CommonProps } from \"@/types/CommonProps\";\n\nexport type BbCollapsibleProps = Pick<CommonProps, 'eager' | 'transitionDuration'> & {\n /**\n * Used by v-model to trigger opening / closing the collapsible\n */\n modelValue: boolean;\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbCollapsible',\n props: {\n eager: { type: Boolean },\n transitionDuration: { default: 250 },\n modelValue: { type: Boolean }\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\n\nconst visible = ref(props.modelValue);\nconst hasRenderedOnce = ref(visible.value);\n\n/**\n * Every time model value changes if content is going to be expanded\n * make it visible straight away.\n * If content id going to be collapsed wait for end of \n * transition before hiding from keyboard navigation\n */\nwatch(\n () => props.modelValue,\n throttle(async (value) => {\n if (value) {\n hasRenderedOnce.value = true;\n visible.value = true;\n } else {\n await wait(props.transitionDuration);\n visible.value = false;\n }\n }, props.transitionDuration)\n);\nconst collapsibleAttributes = computed(() => {\n return {\n \"aria-expanded\": props.modelValue,\n class: {\n \"bb-collapsible\": true,\n \"bb-collapsible--open\": props.modelValue,\n \"bb-collapsible--closed\": !props.modelValue,\n \"bb-collapsible--invisible\": !visible.value,\n },\n style: {\n transitionDuration: props.transitionDuration + \"ms\",\n },\n };\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _normalizeProps(_guardReactiveProps(collapsibleAttributes.value)), [\n _createElementVNode(\"div\", _hoisted_1, [\n (_ctx.eager || hasRenderedOnce.value)\n ? _renderSlot(_ctx.$slots, \"default\", { key: 0 })\n : _createCommentVNode(\"\", true)\n ])\n ], 16))\n}\n}\n\n})"],"names":["_hoisted_1","_sfc_main","_defineComponent","__props","props","visible","ref","hasRenderedOnce","watch","throttle","value","wait","collapsibleAttributes","computed","_ctx","_cache","_openBlock","_createElementBlock","_normalizeProps","_guardReactiveProps","_createElementVNode","_renderSlot","_createCommentVNode"],"mappings":";;;AAGA,MAAMA,IAAa,EAAE,OAAO,6BAeAC,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,oBAAoB,EAAE,SAAS,IAAI;AAAA,IACnC,YAAY,EAAE,MAAM,QAAQ;AAAA,EAC9B;AAAA,EACA,MAAMC,GAAc;AAEtB,UAAMC,IAAQD,GAIRE,IAAUC,EAAIF,EAAM,UAAU,GAC9BG,IAAkBD,EAAID,EAAQ,KAAK;AAQzC,IAAAG;AAAA,MACE,MAAMJ,EAAM;AAAA,MACZK,EAAS,OAAOC,MAAU;AACxB,QAAIA,KACFH,EAAgB,QAAQ,IACxBF,EAAQ,QAAQ,OAEV,MAAAM,EAAKP,EAAM,kBAAkB,GACnCC,EAAQ,QAAQ;AAAA,MAClB,GACCD,EAAM,kBAAkB;AAAA,IAAA;AAEvB,UAAAQ,IAAwBC,EAAS,OAC9B;AAAA,MACL,iBAAiBT,EAAM;AAAA,MACvB,OAAO;AAAA,QACL,kBAAkB;AAAA,QAClB,wBAAwBA,EAAM;AAAA,QAC9B,0BAA0B,CAACA,EAAM;AAAA,QACjC,6BAA6B,CAACC,EAAQ;AAAA,MACxC;AAAA,MACA,OAAO;AAAA,QACL,oBAAoBD,EAAM,qBAAqB;AAAA,MACjD;AAAA,IAAA,EAEH;AAEM,WAAA,CAACU,GAAUC,OACRC,EAAA,GAAcC,EAAoB,OAAOC,EAAgBC,EAAoBP,EAAsB,KAAK,CAAC,GAAG;AAAA,MAClHQ,EAAoB,OAAOpB,GAAY;AAAA,QACpCc,EAAK,SAASP,EAAgB,QAC3Bc,EAAYP,EAAK,QAAQ,WAAW,EAAE,KAAK,EAAG,CAAA,IAC9CQ,EAAoB,IAAI,EAAI;AAAA,MAAA,CACjC;AAAA,OACA,EAAE;AAAA,EAEP;AAEA,CAAC;"}
1
+ {"version":3,"file":"index116.js","sources":["../src/components/BbCollapsible/BbCollapsible.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, normalizeProps as _normalizeProps, guardReactiveProps as _guardReactiveProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-collapsible__content\" }\n\nimport { wait } from '@/utilities/functions/wait';\nimport { throttle } from '@/utilities/functions/throttle';\nimport { computed, ref, watch } from 'vue';\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type BbCollapsibleProps = Pick<\n\tCommonProps,\n\t'eager' | 'transitionDuration'\n> & {\n\t/**\n\t * Used by v-model to trigger opening / closing the collapsible\n\t */\n\tmodelValue: boolean;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbCollapsible',\n props: {\n eager: { type: Boolean },\n transitionDuration: { default: 250 },\n modelValue: { type: Boolean }\n },\n setup(__props: any) {\n\nconst props = __props;\n\n\n\nconst visible = ref(props.modelValue);\nconst hasRenderedOnce = ref(visible.value);\n\n/**\n * Every time model value changes if content is going to be expanded\n * make it visible straight away.\n * If content id going to be collapsed wait for end of\n * transition before hiding from keyboard navigation\n */\nwatch(\n\t() => props.modelValue,\n\tthrottle(async (value) => {\n\t\tif (value) {\n\t\t\thasRenderedOnce.value = true;\n\t\t\tvisible.value = true;\n\t\t} else {\n\t\t\tawait wait(props.transitionDuration);\n\t\t\tvisible.value = false;\n\t\t}\n\t}, props.transitionDuration)\n);\nconst collapsibleAttributes = computed(() => {\n\treturn {\n\t\t'aria-expanded': props.modelValue,\n\t\tclass: {\n\t\t\t'bb-collapsible': true,\n\t\t\t'bb-collapsible--open': props.modelValue,\n\t\t\t'bb-collapsible--closed': !props.modelValue,\n\t\t\t'bb-collapsible--invisible': !visible.value,\n\t\t},\n\t\tstyle: {\n\t\t\ttransitionDuration: props.transitionDuration + 'ms',\n\t\t},\n\t};\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _normalizeProps(_guardReactiveProps(collapsibleAttributes.value)), [\n _createElementVNode(\"div\", _hoisted_1, [\n (_ctx.eager || hasRenderedOnce.value)\n ? _renderSlot(_ctx.$slots, \"default\", { key: 0 })\n : _createCommentVNode(\"\", true)\n ])\n ], 16))\n}\n}\n\n})"],"names":["_hoisted_1","_sfc_main","_defineComponent","__props","props","visible","ref","hasRenderedOnce","watch","throttle","value","wait","collapsibleAttributes","computed","_ctx","_cache","_openBlock","_createElementBlock","_normalizeProps","_guardReactiveProps","_createElementVNode","_renderSlot","_createCommentVNode"],"mappings":";;;AAGA,MAAMA,IAAa,EAAE,OAAO,6BAkBAC,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,OAAO,EAAE,MAAM,QAAQ;AAAA,IACvB,oBAAoB,EAAE,SAAS,IAAI;AAAA,IACnC,YAAY,EAAE,MAAM,QAAQ;AAAA,EAC9B;AAAA,EACA,MAAMC,GAAc;AAEtB,UAAMC,IAAQD,GAIRE,IAAUC,EAAIF,EAAM,UAAU,GAC9BG,IAAkBD,EAAID,EAAQ,KAAK;AAQzC,IAAAG;AAAA,MACC,MAAMJ,EAAM;AAAA,MACZK,EAAS,OAAOC,MAAU;AACzB,QAAIA,KACHH,EAAgB,QAAQ,IACxBF,EAAQ,QAAQ,OAEV,MAAAM,EAAKP,EAAM,kBAAkB,GACnCC,EAAQ,QAAQ;AAAA,MACjB,GACED,EAAM,kBAAkB;AAAA,IAAA;AAEtB,UAAAQ,IAAwBC,EAAS,OAC/B;AAAA,MACN,iBAAiBT,EAAM;AAAA,MACvB,OAAO;AAAA,QACN,kBAAkB;AAAA,QAClB,wBAAwBA,EAAM;AAAA,QAC9B,0BAA0B,CAACA,EAAM;AAAA,QACjC,6BAA6B,CAACC,EAAQ;AAAA,MACvC;AAAA,MACA,OAAO;AAAA,QACN,oBAAoBD,EAAM,qBAAqB;AAAA,MAChD;AAAA,IAAA,EAED;AAEM,WAAA,CAACU,GAAUC,OACRC,EAAA,GAAcC,EAAoB,OAAOC,EAAgBC,EAAoBP,EAAsB,KAAK,CAAC,GAAG;AAAA,MAClHQ,EAAoB,OAAOpB,GAAY;AAAA,QACpCc,EAAK,SAASP,EAAgB,QAC3Bc,EAAYP,EAAK,QAAQ,WAAW,EAAE,KAAK,EAAG,CAAA,IAC9CQ,EAAoB,IAAI,EAAI;AAAA,MAAA,CACjC;AAAA,OACA,EAAE;AAAA,EAEP;AAEA,CAAC;"}
package/dist/index117.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as m, getCurrentInstance as d, inject as x, computed as l, ref as y, watchEffect as _, openBlock as b, createElementBlock as h, mergeProps as w } from "vue";
2
- import { isCssColor as z } from "./index211.js";
2
+ import { isCssColor as z } from "./index197.js";
3
3
  const g = ["innerHTML"], $ = /* @__PURE__ */ m({
4
4
  __name: "BbIcon",
5
5
  props: {
@@ -1 +1 @@
1
- {"version":3,"file":"index117.js","sources":["../src/components/BbIcon/BbIcon.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = [\"innerHTML\"]\n\nimport { computed, getCurrentInstance, inject, ref, watchEffect } from \"vue\";\nimport { isCssColor } from \"@/utilities/functions/isCssColor\";\nimport type { Size as S } from \"@/types/CommonProps\";\n\nexport type Size = {\n xs: number;\n sm: number;\n md: number;\n lg: number;\n xl: number;\n xxl: number;\n};\n\nexport type BbIconProps = S<Size> & {\n /**\n * Define a color for the component.\n *\n * Either a custom color or a coded color in common HEX, RGB, etc... format.\n */\n color?: string;\n /**\n * Name of the icon to use\n */\n type: string;\n };\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbIcon',\n props: {\n size: { default: \"md\" },\n color: {},\n type: {}\n },\n setup(__props: any) {\n\nconst props = __props;\nlet icons: Record<string, () => Promise<string>> | undefined;\n// @ts-ignore\nconst isNuxt = !!getCurrentInstance()?.proxy?.$nuxt;\n\nif (isNuxt) {\n // @ts-ignore\n if (process.client) {\n // @ts-ignore\n icons = useNuxtApp()[`$icons`] as typeof icons;\n }\n} else {\n icons = inject(\"icons\");\n}\n\nconst sizeMap: Size = {\n xs: 12,\n sm: 16,\n md: 24,\n lg: 28,\n xl: 36,\n xxl: 40,\n};\n\nconst iconAttributes = computed(() => {\n const classes: any = {\n \"bb-icon\": true,\n };\n const width = computed(() => {\n let dimension: number;\n if (typeof props.size === \"string\") {\n dimension = sizeMap[props.size as keyof Size] ?? parseInt(props.size, 10);\n } else if (typeof props.size === \"number\") {\n dimension = props.size;\n } else {\n dimension = 24;\n }\n return dimension + `px`;\n });\n let style: { [key: string]: any } = { width: width.value };\n\n if (props.color) {\n if (isCssColor(props.color)) {\n style.color = props.color;\n } else {\n classes[`bb-icon-${props.color}`] = true;\n }\n }\n return {\n class: classes,\n style,\n };\n});\n\nconst icon = ref<string | null>(null);\n\nwatchEffect(async () => {\n if (icons) {\n if (typeof icons[props.type] === \"undefined\")\n throw new Error(`Icon \"${props.type}\" does not exist.`);\n icon.value = await icons[props.type]();\n }\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"i\", _mergeProps(iconAttributes.value, { innerHTML: icon.value }), null, 16, _hoisted_1))\n}\n}\n\n})"],"names":["_hoisted_1","_sfc_main","_defineComponent","__props","props","icons","_b","_a","getCurrentInstance","inject","sizeMap","iconAttributes","computed","classes","style","dimension","isCssColor","icon","ref","watchEffect","_ctx","_cache","_openBlock","_createElementBlock","_mergeProps"],"mappings":";;AAGA,MAAMA,IAAa,CAAC,WAAW,GA4BHC,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,MAAM,EAAE,SAAS,KAAK;AAAA,IACtB,OAAO,CAAC;AAAA,IACR,MAAM,CAAC;AAAA,EACT;AAAA,EACA,MAAMC,GAAc;;AAEtB,UAAMC,IAAQD;AACV,QAAAE;AAIJ,IAFe,CAAC,GAACC,KAAAC,IAAAC,EAAA,MAAA,gBAAAD,EAAsB,UAAtB,QAAAD,EAA6B,SAIxC,QAAQ,WAEFD,IAAA,WAAA,EAAa,UAGvBA,IAAQI,EAAO,OAAO;AAGxB,UAAMC,IAAgB;AAAA,MACpB,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,KAAK;AAAA,IAAA,GAGDC,IAAiBC,EAAS,MAAM;AACpC,YAAMC,IAAe;AAAA,QACnB,WAAW;AAAA,MAAA;AAab,UAAIC,IAAgC,EAAE,OAXxBF,EAAS,MAAM;AACvB,YAAAG;AACA,eAAA,OAAOX,EAAM,QAAS,WACxBW,IAAYL,EAAQN,EAAM,IAAkB,KAAK,SAASA,EAAM,MAAM,EAAE,IAC/D,OAAOA,EAAM,QAAS,WAC/BW,IAAYX,EAAM,OAENW,IAAA,IAEPA,IAAY;AAAA,MAAA,CACpB,EACkD,MAAM;AAEzD,aAAIX,EAAM,UACJY,EAAWZ,EAAM,KAAK,IACxBU,EAAM,QAAQV,EAAM,QAEpBS,EAAQ,WAAWT,EAAM,KAAK,EAAE,IAAI,KAGjC;AAAA,QACL,OAAOS;AAAA,QACP,OAAAC;AAAA,MAAA;AAAA,IACF,CACD,GAEKG,IAAOC,EAAmB,IAAI;AAEpC,WAAAC,EAAY,YAAY;AACtB,UAAId,GAAO;AACT,YAAI,OAAOA,EAAMD,EAAM,IAAI,IAAM;AAC/B,gBAAM,IAAI,MAAM,SAASA,EAAM,IAAI,mBAAmB;AACxD,QAAAa,EAAK,QAAQ,MAAMZ,EAAMD,EAAM,IAAI,EAAE;AAAA,MACvC;AAAA,IAAA,CACD,GAEM,CAACgB,GAAUC,OACRC,EAAW,GAAGC,EAAoB,KAAKC,EAAYb,EAAe,OAAO,EAAE,WAAWM,EAAK,MAAO,CAAA,GAAG,MAAM,IAAIjB,CAAU;AAAA,EAEnI;AAEA,CAAC;"}
1
+ {"version":3,"file":"index117.js","sources":["../src/components/BbIcon/BbIcon.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { mergeProps as _mergeProps, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = [\"innerHTML\"]\n\nimport { computed, getCurrentInstance, inject, ref, watchEffect } from 'vue';\nimport { isCssColor } from '@/utilities/functions/isCssColor';\nimport type { Size as S } from '@/types/CommonProps';\n\nexport type Size = {\n\txs: number;\n\tsm: number;\n\tmd: number;\n\tlg: number;\n\txl: number;\n\txxl: number;\n};\n\nexport type BbIconProps = S<Size> & {\n\t/**\n\t * Define a color for the component.\n\t *\n\t * Either a custom color or a coded color in common HEX, RGB, etc... format.\n\t */\n\tcolor?: string;\n\t/**\n\t * Name of the icon to use\n\t */\n\ttype: string;\n};\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BbIcon',\n props: {\n size: { default: 'md' },\n color: {},\n type: {}\n },\n setup(__props: any) {\n\nconst props = __props;\nlet icons: Record<string, () => Promise<string>> | undefined;\n// @ts-ignore\nconst isNuxt = !!getCurrentInstance()?.proxy?.$nuxt;\n\nif (isNuxt) {\n\t// @ts-ignore\n\tif (process.client) {\n\t\t// @ts-ignore\n\t\ticons = useNuxtApp()[`$icons`] as typeof icons;\n\t}\n} else {\n\ticons = inject('icons');\n}\n\nconst sizeMap: Size = {\n\txs: 12,\n\tsm: 16,\n\tmd: 24,\n\tlg: 28,\n\txl: 36,\n\txxl: 40,\n};\n\nconst iconAttributes = computed(() => {\n\tconst classes: any = {\n\t\t'bb-icon': true,\n\t};\n\tconst width = computed(() => {\n\t\tlet dimension: number;\n\t\tif (typeof props.size === 'string') {\n\t\t\tdimension = sizeMap[props.size as keyof Size] ?? parseInt(props.size, 10);\n\t\t} else if (typeof props.size === 'number') {\n\t\t\tdimension = props.size;\n\t\t} else {\n\t\t\tdimension = 24;\n\t\t}\n\t\treturn dimension + `px`;\n\t});\n\tlet style: { [key: string]: any } = { width: width.value };\n\n\tif (props.color) {\n\t\tif (isCssColor(props.color)) {\n\t\t\tstyle.color = props.color;\n\t\t} else {\n\t\t\tclasses[`bb-icon-${props.color}`] = true;\n\t\t}\n\t}\n\treturn {\n\t\tclass: classes,\n\t\tstyle,\n\t};\n});\n\nconst icon = ref<string | null>(null);\n\nwatchEffect(async () => {\n\tif (icons) {\n\t\tif (typeof icons[props.type] === 'undefined')\n\t\t\tthrow new Error(`Icon \"${props.type}\" does not exist.`);\n\t\ticon.value = await icons[props.type]();\n\t}\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"i\", _mergeProps(iconAttributes.value, { innerHTML: icon.value }), null, 16, _hoisted_1))\n}\n}\n\n})"],"names":["_hoisted_1","_sfc_main","_defineComponent","__props","props","icons","_b","_a","getCurrentInstance","inject","sizeMap","iconAttributes","computed","classes","style","dimension","isCssColor","icon","ref","watchEffect","_ctx","_cache","_openBlock","_createElementBlock","_mergeProps"],"mappings":";;AAGA,MAAMA,IAAa,CAAC,WAAW,GA4BHC,IAAiBC,gBAAAA,EAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL,MAAM,EAAE,SAAS,KAAK;AAAA,IACtB,OAAO,CAAC;AAAA,IACR,MAAM,CAAC;AAAA,EACT;AAAA,EACA,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,GAAG,MAAM,IAAIjB,CAAU;AAAA,EAEnI;AAEA,CAAC;"}
package/dist/index118.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as v, ref as r, onMounted as p, onBeforeUnmount as h, openBlock as i, createBlock as l, resolveDynamicComponent as u, normalizeStyle as m, withCtx as f, renderSlot as d } from "vue";
2
- import { throttle as g } from "./index216.js";
2
+ import { throttle as g } from "./index208.js";
3
3
  const O = /* @__PURE__ */ v({
4
4
  __name: "BbSmoothHeight",
5
5
  props: {
@@ -23,16 +23,16 @@ const O = /* @__PURE__ */ v({
23
23
  }
24
24
  }, 200);
25
25
  return (o, y) => (i(), l(u(o.tag), {
26
- class: "bb-smooth-height",
27
26
  ref_key: "container",
28
27
  ref: s,
28
+ class: "bb-smooth-height",
29
29
  style: m({ "transition-duration": n.transitionDuration / 1e3 + "s" })
30
30
  }, {
31
31
  default: f(() => [
32
32
  (i(), l(u(o.tag), {
33
- class: "content",
34
33
  ref_key: "content",
35
- ref: e
34
+ ref: e,
35
+ class: "content"
36
36
  }, {
37
37
  default: f(() => [
38
38
  d(o.$slots, "default")