bitboss-ui 0.2.71 → 0.2.73

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 (173) hide show
  1. package/dist/components/BaseCheckboxGroup/BaseCheckboxGroup.vue.d.ts +1 -1
  2. package/dist/components/BaseDialog/BaseDialog.vue.d.ts +1 -1
  3. package/dist/components/BaseRadioGroup/BaseRadioGroup.vue.d.ts +1 -1
  4. package/dist/components/BbAccordion/BbAccordion.vue.d.ts +1 -1
  5. package/dist/components/BbAlert/BbAlert.vue.d.ts +1 -1
  6. package/dist/components/BbAvatar/BbAvatar.vue.d.ts +1 -1
  7. package/dist/components/BbBadge/BbBadge.vue.d.ts +1 -1
  8. package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue.d.ts +1 -1
  9. package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +1 -1
  10. package/dist/components/BbChip/BbChip.vue.d.ts +1 -1
  11. package/dist/components/BbCollapsible/BbCollapsible.vue.d.ts +1 -1
  12. package/dist/components/BbDropdown/BbDropdown.vue.d.ts +1 -1
  13. package/dist/components/BbDropzone/BbDropzone.vue.d.ts +1 -1
  14. package/dist/components/BbIcon/BbIcon.vue.d.ts +1 -1
  15. package/dist/components/BbIntersection/BbIntersection.vue.d.ts +1 -1
  16. package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +1 -1
  17. package/dist/components/BbPagination/BbPagination.vue.d.ts +1 -1
  18. package/dist/components/BbPopover/BbPopover.vue.d.ts +1 -1
  19. package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +1 -1
  20. package/dist/components/BbRatio/BbRatio.vue.d.ts +1 -1
  21. package/dist/components/BbSelect/BbSelect.vue.d.ts +1 -1
  22. package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +1 -1
  23. package/dist/components/BbSpinner/BbSpinner.vue.d.ts +1 -1
  24. package/dist/components/BbTab/BbTab.vue.d.ts +1 -1
  25. package/dist/components/BbTable/BbTable.vue.d.ts +1 -1
  26. package/dist/components/BbTable/types.d.ts +1 -1
  27. package/dist/components/BbTooltip/BbTooltip.vue.d.ts +1 -1
  28. package/dist/composables/useConfirm.d.ts +1 -1
  29. package/dist/composables/useOptions.d.ts +1 -1
  30. package/dist/composables/useToast.d.ts +1 -1
  31. package/dist/index101.js +3 -3
  32. package/dist/index103.js +2 -2
  33. package/dist/index109.js +1 -1
  34. package/dist/index11.js +1 -1
  35. package/dist/index111.js +4 -4
  36. package/dist/index113.js +1 -1
  37. package/dist/index116.js +1 -1
  38. package/dist/index118.js +1 -1
  39. package/dist/index121.js +1 -1
  40. package/dist/index125.js +1 -1
  41. package/dist/index126.js +1 -1
  42. package/dist/index127.js +1 -1
  43. package/dist/index131.js +2 -2
  44. package/dist/index15.js +8 -8
  45. package/dist/index17.js +9 -9
  46. package/dist/index19.js +3 -3
  47. package/dist/index196.js +2 -2
  48. package/dist/index196.js.map +1 -1
  49. package/dist/index197.js +10 -2
  50. package/dist/index197.js.map +1 -1
  51. package/dist/index199.js +4 -235
  52. package/dist/index199.js.map +1 -1
  53. package/dist/index200.js +235 -2
  54. package/dist/index200.js.map +1 -1
  55. package/dist/index201.js +3 -5
  56. package/dist/index201.js.map +1 -1
  57. package/dist/index202.js +35 -16
  58. package/dist/index202.js.map +1 -1
  59. package/dist/index203.js +6 -16
  60. package/dist/index203.js.map +1 -1
  61. package/dist/index204.js +294 -18
  62. package/dist/index204.js.map +1 -1
  63. package/dist/index205.js +13 -17
  64. package/dist/index205.js.map +1 -1
  65. package/dist/index206.js +13 -26
  66. package/dist/index206.js.map +1 -1
  67. package/dist/index207.js +19 -8
  68. package/dist/index207.js.map +1 -1
  69. package/dist/index208.js +20 -2
  70. package/dist/index208.js.map +1 -1
  71. package/dist/index209.js +27 -119
  72. package/dist/index209.js.map +1 -1
  73. package/dist/index21.js +2 -2
  74. package/dist/index210.js +8 -2
  75. package/dist/index210.js.map +1 -1
  76. package/dist/index211.js +2 -6
  77. package/dist/index211.js.map +1 -1
  78. package/dist/index212.js +368 -4
  79. package/dist/index212.js.map +1 -1
  80. package/dist/index213.js +131 -365
  81. package/dist/index213.js.map +1 -1
  82. package/dist/index214.js +2 -373
  83. package/dist/index214.js.map +1 -1
  84. package/dist/index215.js +174 -3
  85. package/dist/index215.js.map +1 -1
  86. package/dist/index216.js +23 -3
  87. package/dist/index216.js.map +1 -1
  88. package/dist/index217.js +373 -3
  89. package/dist/index217.js.map +1 -1
  90. package/dist/index218.js +2 -35
  91. package/dist/index218.js.map +1 -1
  92. package/dist/index219.js +3 -134
  93. package/dist/index219.js.map +1 -1
  94. package/dist/index220.js +3 -174
  95. package/dist/index220.js.map +1 -1
  96. package/dist/index221.js +121 -23
  97. package/dist/index221.js.map +1 -1
  98. package/dist/index222.js +2 -10
  99. package/dist/index222.js.map +1 -1
  100. package/dist/index224.js +79 -6
  101. package/dist/index224.js.map +1 -1
  102. package/dist/index225.js +6 -17
  103. package/dist/index225.js.map +1 -1
  104. package/dist/index226.js +17 -79
  105. package/dist/index226.js.map +1 -1
  106. package/dist/index227.js +69 -2
  107. package/dist/index227.js.map +1 -1
  108. package/dist/index228.js +5 -295
  109. package/dist/index228.js.map +1 -1
  110. package/dist/index229.js +2 -6
  111. package/dist/index229.js.map +1 -1
  112. package/dist/index23.js +1 -1
  113. package/dist/index230.js +160 -2
  114. package/dist/index230.js.map +1 -1
  115. package/dist/index231.js +1 -4
  116. package/dist/index231.js.map +1 -1
  117. package/dist/index232.js +4 -2
  118. package/dist/index232.js.map +1 -1
  119. package/dist/index233.js +15 -2
  120. package/dist/index233.js.map +1 -1
  121. package/dist/index234.js +435 -2
  122. package/dist/index234.js.map +1 -1
  123. package/dist/index235.js +89 -2
  124. package/dist/index235.js.map +1 -1
  125. package/dist/index236.js +197 -157
  126. package/dist/index236.js.map +1 -1
  127. package/dist/index237.js +8 -1
  128. package/dist/index237.js.map +1 -1
  129. package/dist/index238.js +2 -69
  130. package/dist/index238.js.map +1 -1
  131. package/dist/index239.js +2 -106
  132. package/dist/index239.js.map +1 -1
  133. package/dist/index240.js +2 -4
  134. package/dist/index240.js.map +1 -1
  135. package/dist/index241.js +2 -5
  136. package/dist/index241.js.map +1 -1
  137. package/dist/index242.js +2 -2
  138. package/dist/index243.js +2 -224
  139. package/dist/index243.js.map +1 -1
  140. package/dist/index244.js +2 -258
  141. package/dist/index244.js.map +1 -1
  142. package/dist/index246.js +99 -428
  143. package/dist/index246.js.map +1 -1
  144. package/dist/index247.js +218 -83
  145. package/dist/index247.js.map +1 -1
  146. package/dist/index248.js +258 -200
  147. package/dist/index248.js.map +1 -1
  148. package/dist/index249.js +2 -2
  149. package/dist/index25.js +1 -1
  150. package/dist/index253.js +2 -15
  151. package/dist/index253.js.map +1 -1
  152. package/dist/index254.js +3 -2
  153. package/dist/index254.js.map +1 -1
  154. package/dist/index255.js +2 -3
  155. package/dist/index255.js.map +1 -1
  156. package/dist/index29.js +2 -2
  157. package/dist/index31.js +8 -8
  158. package/dist/index33.js +1 -1
  159. package/dist/index35.js +1 -1
  160. package/dist/index65.js +4 -4
  161. package/dist/index69.js +2 -2
  162. package/dist/index72.js +1 -1
  163. package/dist/index75.js +1 -1
  164. package/dist/index77.js +1 -1
  165. package/dist/index79.js +4 -4
  166. package/dist/index81.js +1 -1
  167. package/dist/index99.js +93 -89
  168. package/dist/index99.js.map +1 -1
  169. package/dist/style.css +1 -1
  170. package/package.json +1 -1
  171. package/dist/components/BbStep/BbStep.vue.d.ts +0 -159
  172. package/dist/index256.js +0 -5
  173. package/dist/index256.js.map +0 -1
package/dist/index249.js CHANGED
@@ -1,5 +1,5 @@
1
- var o = { exports: {} };
1
+ import e from "./index200.js";
2
2
  export {
3
- o as __module
3
+ e as default
4
4
  };
5
5
  //# sourceMappingURL=index249.js.map
package/dist/index25.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as g, computed as n, ref as _, openBlock as w, createElementBlock as B, normalizeClass as C, createElementVNode as l, normalizeProps as t, guardReactiveProps as u, renderSlot as V } from "vue";
2
2
  import { isCssColor as i } from "./index198.js";
3
- import { when as E } from "./index212.js";
3
+ import { when as E } from "./index199.js";
4
4
  const N = {
5
5
  "aria-hidden": "true",
6
6
  class: "bb-base-radio-container"
package/dist/index253.js CHANGED
@@ -1,18 +1,5 @@
1
- function r(t) {
2
- return Object.prototype.toString.call(t).slice(8, -1);
3
- }
4
- function o(t) {
5
- return r(t) === "Array";
6
- }
7
- function c(t) {
8
- if (r(t) !== "Object")
9
- return !1;
10
- const e = Object.getPrototypeOf(t);
11
- return !!e && e.constructor === Object && e === Object.prototype;
12
- }
1
+ import f from "./index227.js";
13
2
  export {
14
- r as getType,
15
- o as isArray,
16
- c as isPlainObject
3
+ f as default
17
4
  };
18
5
  //# sourceMappingURL=index253.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index253.js","sources":["../node_modules/is-what/dist/index.js"],"sourcesContent":["function getType(payload) {\n return Object.prototype.toString.call(payload).slice(8, -1);\n}\n\nfunction isAnyObject(payload) {\n return getType(payload) === \"Object\";\n}\n\nfunction isArray(payload) {\n return getType(payload) === \"Array\";\n}\n\nfunction isBlob(payload) {\n return getType(payload) === \"Blob\";\n}\n\nfunction isBoolean(payload) {\n return getType(payload) === \"Boolean\";\n}\n\nfunction isDate(payload) {\n return getType(payload) === \"Date\" && !isNaN(payload);\n}\n\nfunction isEmptyArray(payload) {\n return isArray(payload) && payload.length === 0;\n}\n\nfunction isPlainObject(payload) {\n if (getType(payload) !== \"Object\")\n return false;\n const prototype = Object.getPrototypeOf(payload);\n return !!prototype && prototype.constructor === Object && prototype === Object.prototype;\n}\n\nfunction isEmptyObject(payload) {\n return isPlainObject(payload) && Object.keys(payload).length === 0;\n}\n\nfunction isEmptyString(payload) {\n return payload === \"\";\n}\n\nfunction isError(payload) {\n return getType(payload) === \"Error\" || payload instanceof Error;\n}\n\nfunction isFile(payload) {\n return getType(payload) === \"File\";\n}\n\nfunction isFullArray(payload) {\n return isArray(payload) && payload.length > 0;\n}\n\nfunction isFullObject(payload) {\n return isPlainObject(payload) && Object.keys(payload).length > 0;\n}\n\nfunction isString(payload) {\n return getType(payload) === \"String\";\n}\n\nfunction isFullString(payload) {\n return isString(payload) && payload !== \"\";\n}\n\nfunction isFunction(payload) {\n return typeof payload === \"function\";\n}\n\nfunction isType(payload, type) {\n if (!(type instanceof Function)) {\n throw new TypeError(\"Type must be a function\");\n }\n if (!Object.prototype.hasOwnProperty.call(type, \"prototype\")) {\n throw new TypeError(\"Type is not a class\");\n }\n const name = type.name;\n return getType(payload) === name || Boolean(payload && payload.constructor === type);\n}\n\nfunction isInstanceOf(value, classOrClassName) {\n if (typeof classOrClassName === \"function\") {\n for (let p = value; p; p = Object.getPrototypeOf(p)) {\n if (isType(p, classOrClassName)) {\n return true;\n }\n }\n return false;\n } else {\n for (let p = value; p; p = Object.getPrototypeOf(p)) {\n if (getType(p) === classOrClassName) {\n return true;\n }\n }\n return false;\n }\n}\n\nfunction isMap(payload) {\n return getType(payload) === \"Map\";\n}\n\nfunction isNaNValue(payload) {\n return getType(payload) === \"Number\" && isNaN(payload);\n}\n\nfunction isNumber(payload) {\n return getType(payload) === \"Number\" && !isNaN(payload);\n}\n\nfunction isNegativeNumber(payload) {\n return isNumber(payload) && payload < 0;\n}\n\nfunction isNull(payload) {\n return getType(payload) === \"Null\";\n}\n\nfunction isOneOf(a, b, c, d, e) {\n return (value) => a(value) || b(value) || !!c && c(value) || !!d && d(value) || !!e && e(value);\n}\n\nfunction isUndefined(payload) {\n return getType(payload) === \"Undefined\";\n}\n\nconst isNullOrUndefined = isOneOf(isNull, isUndefined);\n\nfunction isObject(payload) {\n return isPlainObject(payload);\n}\n\nfunction isObjectLike(payload) {\n return isAnyObject(payload);\n}\n\nfunction isPositiveNumber(payload) {\n return isNumber(payload) && payload > 0;\n}\n\nfunction isSymbol(payload) {\n return getType(payload) === \"Symbol\";\n}\n\nfunction isPrimitive(payload) {\n return isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);\n}\n\nfunction isPromise(payload) {\n return getType(payload) === \"Promise\";\n}\n\nfunction isRegExp(payload) {\n return getType(payload) === \"RegExp\";\n}\n\nfunction isSet(payload) {\n return getType(payload) === \"Set\";\n}\n\nfunction isWeakMap(payload) {\n return getType(payload) === \"WeakMap\";\n}\n\nfunction isWeakSet(payload) {\n return getType(payload) === \"WeakSet\";\n}\n\nexport { getType, isAnyObject, isArray, isBlob, isBoolean, isDate, isEmptyArray, isEmptyObject, isEmptyString, isError, isFile, isFullArray, isFullObject, isFullString, isFunction, isInstanceOf, isMap, isNaNValue, isNegativeNumber, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isOneOf, isPlainObject, isPositiveNumber, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isType, isUndefined, isWeakMap, isWeakSet };\n"],"names":["getType","payload","isArray","isPlainObject","prototype"],"mappings":"AAAA,SAASA,EAAQC,GAAS;AACxB,SAAO,OAAO,UAAU,SAAS,KAAKA,CAAO,EAAE,MAAM,GAAG,EAAE;AAC5D;AAMA,SAASC,EAAQD,GAAS;AACxB,SAAOD,EAAQC,CAAO,MAAM;AAC9B;AAkBA,SAASE,EAAcF,GAAS;AAC9B,MAAID,EAAQC,CAAO,MAAM;AACvB,WAAO;AACT,QAAMG,IAAY,OAAO,eAAeH,CAAO;AAC/C,SAAO,CAAC,CAACG,KAAaA,EAAU,gBAAgB,UAAUA,MAAc,OAAO;AACjF;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index253.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/dist/index254.js CHANGED
@@ -1,5 +1,6 @@
1
- import f from "./index238.js";
1
+ import o from "./index230.js";
2
+ import "./index231.js";
2
3
  export {
3
- f as default
4
+ o as default
4
5
  };
5
6
  //# sourceMappingURL=index254.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index254.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index254.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
package/dist/index255.js CHANGED
@@ -1,6 +1,5 @@
1
- import o from "./index236.js";
2
- import "./index237.js";
1
+ const i = (c, e = 0, o = 0) => c.slice(0, o).concat(c.slice(o + e));
3
2
  export {
4
- o as default
3
+ i as drop
5
4
  };
6
5
  //# sourceMappingURL=index255.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index255.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"index255.js","sources":["../src/utilities/functions/drop.ts"],"sourcesContent":["/*\n * Drops N elements from an array and returns a new array.\n * Optionally start at an arbitrary index\n */\nexport const drop = <T>(arr: T[], howMany = 0, start = 0) =>\n\tarr.slice(0, start).concat(arr.slice(start + howMany));\n"],"names":["drop","arr","howMany","start"],"mappings":"AAIO,MAAMA,IAAO,CAAIC,GAAUC,IAAU,GAAGC,IAAQ,MACtDF,EAAI,MAAM,GAAGE,CAAK,EAAE,OAAOF,EAAI,MAAME,IAAQD,CAAO,CAAC;"}
package/dist/index29.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as C, ref as b, computed as f, openBlock as l, createElementBlock as i, mergeProps as g, createElementVNode as r, Fragment as I, renderList as V, normalizeClass as B, toDisplayString as h, renderSlot as x } from "vue";
2
- import { booleanishToBoolean as M } from "./index196.js";
3
- import { identity as F } from "./index197.js";
2
+ import { booleanishToBoolean as M } from "./index218.js";
3
+ import { identity as F } from "./index214.js";
4
4
  import { isCssColor as p } from "./index198.js";
5
5
  import { isNotNil as T } from "./index124.js";
6
6
  const H = { class: "bb-base-rating__inner-container" }, D = { class: "bb-base-rating__label-text" }, N = ["id", "autofocus", "checked", "disabled", "name", "value"], j = ["height", "width"], A = /* @__PURE__ */ r("path", {
package/dist/index31.js CHANGED
@@ -3,21 +3,21 @@ import Ae from "./index115.js";
3
3
  import "./index158.js";
4
4
  import Me from "./index119.js";
5
5
  import "./index185.js";
6
- import { useFloating as Je } from "./index209.js";
7
- import { clamp as qe } from "./index200.js";
6
+ import { useFloating as Je } from "./index221.js";
7
+ import { clamp as qe } from "./index196.js";
8
8
  import { deepEqual as se } from "./index123.js";
9
- import { head as G } from "./index210.js";
9
+ import { head as G } from "./index222.js";
10
10
  import { isNotNil as E } from "./index124.js";
11
- import { last as ze } from "./index208.js";
11
+ import { last as ze } from "./index211.js";
12
12
  import { useItemText as He } from "./index125.js";
13
13
  import { useItemValue as Pe } from "./index126.js";
14
14
  import { wait as X } from "./index122.js";
15
- import { waitFor as je } from "./index211.js";
16
- import { when as Qe } from "./index212.js";
15
+ import { waitFor as je } from "./index203.js";
16
+ import { when as Qe } from "./index199.js";
17
17
  import We from "./index116.js";
18
18
  import "./index160.js";
19
- import { autoUpdate as Ue, flip as Ke, shift as Re } from "./index213.js";
20
- import { offset as Ye } from "./index214.js";
19
+ import { autoUpdate as Ue, flip as Ke, shift as Re } from "./index212.js";
20
+ import { offset as Ye } from "./index217.js";
21
21
  const Ze = { class: "bb-base-select__input-container" }, Ge = ["id", "autocomplete", "autofocus", "disabled", "placeholder", "aria-controls", "aria-expanded", "readonly"], Xe = { class: "bb-base-select__chevron" }, el = /* @__PURE__ */ w("svg", {
22
22
  fill: "none",
23
23
  viewBox: "0 0 16 8",
package/dist/index33.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as R, ref as l, onMounted as S, watchEffect as z, computed as y, openBlock as D, createElementBlock as F, mergeProps as h, renderSlot as g, createElementVNode as t, normalizeProps as H, guardReactiveProps as T, normalizeStyle as E, unref as X } from "vue";
2
- import { clamp as K } from "./index200.js";
2
+ import { clamp as K } from "./index196.js";
3
3
  import { isCssColor as w } from "./index198.js";
4
4
  import { isNil as O } from "./index120.js";
5
5
  import { transposeValue as L } from "./index121.js";
package/dist/index35.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as I, ref as b, computed as n, watch as F, openBlock as m, createElementBlock as p, normalizeClass as N, normalizeProps as c, mergeProps as h, createCommentVNode as S, createElementVNode as l, renderSlot as x, guardReactiveProps as f } from "vue";
2
2
  import { isCssColor as V } from "./index198.js";
3
- import { when as A } from "./index212.js";
3
+ import { when as A } from "./index199.js";
4
4
  const J = { class: "bb-base-switch-container" }, M = /* @__PURE__ */ l("span", { class: "bb-base-switch-container__icon-thumb" }, null, -1), O = [
5
5
  M
6
6
  ], H = /* @__PURE__ */ I({
package/dist/index65.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { defineComponent as Y, computed as M, ref as v, openBlock as D, createElementBlock as H, mergeProps as S, createElementVNode as h, renderSlot as y, normalizeProps as Z, guardReactiveProps as ee, unref as c, createBlock as te, Teleport as oe, normalizeClass as ne, normalizeStyle as z, Fragment as N, renderList as ae, createVNode as le, withCtx as se, createCommentVNode as ie } from "vue";
2
2
  import { findRightIndex as I } from "./index223.js";
3
- import { useFloating as re, arrow as ue } from "./index209.js";
3
+ import { useFloating as re, arrow as ue } from "./index221.js";
4
4
  import { useId as de } from "./index7.js";
5
5
  import { wait as U } from "./index122.js";
6
6
  import ce from "./index9.js";
7
7
  import "./index10.js";
8
- import V from "./index221.js";
9
- import { autoUpdate as fe, flip as pe, shift as be } from "./index213.js";
10
- import { offset as me } from "./index214.js";
8
+ import V from "./index216.js";
9
+ import { autoUpdate as fe, flip as pe, shift as be } from "./index212.js";
10
+ import { offset as me } from "./index217.js";
11
11
  const ve = ["id", "aria-labelledby"], we = { class: "bb-dropdown__items-container" }, Me = /* @__PURE__ */ Y({
12
12
  __name: "BbDropdown",
13
13
  props: {
package/dist/index69.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as j, ref as g, watch as x, computed as m, openBlock as V, createBlock as G, resolveDynamicComponent as K, normalizeClass as O, withCtx as M, createElementVNode as c, withModifiers as y, renderSlot as U, normalizeProps as Y, guardReactiveProps as Z, createTextVNode as J, unref as Q, createVNode as W, createElementBlock as F, Fragment as X, renderList as ee, toDisplayString as te } from "vue";
2
- import { findInTree as ae } from "./index225.js";
2
+ import { findInTree as ae } from "./index226.js";
3
3
  import { useId as re } from "./index7.js";
4
4
  import oe from "./index118.js";
5
5
  import "./index183.js";
@@ -57,7 +57,7 @@ const le = ["accept", "autofocus", "disabled", "multiple"], se = {
57
57
  if (r.includes("/"))
58
58
  e.push(r);
59
59
  else {
60
- b || (b = (await import("./index224.js")).default);
60
+ b || (b = (await import("./index225.js")).default);
61
61
  const o = b.getType(r);
62
62
  if (!o)
63
63
  throw new Error(
package/dist/index72.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as h, ref as t, onMounted as m, onBeforeUnmount as p, openBlock as g, createBlock as b, resolveDynamicComponent as w, withCtx as _, renderSlot as I } from "vue";
2
- import { throttle as c } from "./index217.js";
2
+ import { throttle as c } from "./index201.js";
3
3
  const M = /* @__PURE__ */ h({
4
4
  __name: "BbIntersection",
5
5
  props: {
package/dist/index75.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as q, ref as s, useAttrs as G, computed as m, onMounted as J, watch as Q, onBeforeUnmount as X, openBlock as y, createBlock as Y, Teleport as Z, createElementVNode as o, mergeProps as N, createElementBlock as w, renderSlot as l, createTextVNode as ee, toDisplayString as z, createCommentVNode as B, nextTick as te } from "vue";
2
- import { useFocusTrap as oe } from "./index218.js";
2
+ import { useFocusTrap as oe } from "./index202.js";
3
3
  import { useId as L } from "./index7.js";
4
4
  import { wait as O } from "./index122.js";
5
5
  const se = { class: "bb-offcanvas-close" }, ae = { class: "bb-offcanvas-close__content" }, ne = { class: "bb-offcanvas-close__label" }, le = /* @__PURE__ */ o("span", { class: "bb-offcanvas-close__icon" }, [
package/dist/index77.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as x, computed as y, ref as p, onMounted as A, onBeforeUnmount as B, openBlock as k, createElementBlock as V, createElementVNode as u, renderSlot as g, createTextVNode as b, Fragment as E, renderList as P, normalizeClass as W, toDisplayString as h, nextTick as z } from "vue";
2
- import R from "./index226.js";
2
+ import R from "./index224.js";
3
3
  const T = { "aria-label": "Navigazione" }, F = ["disabled"], L = ["disabled", "onClick"], D = ["disabled"], O = /* @__PURE__ */ x({
4
4
  __name: "BbPagination",
5
5
  props: {
package/dist/index79.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as V, ref as a, computed as _, openBlock as p, createElementBlock as h, mergeProps as B, createElementVNode as d, renderSlot as P, normalizeProps as I, guardReactiveProps as R, unref as g, createBlock as D, Teleport as U, normalizeClass as W, normalizeStyle as j, createCommentVNode as y, withCtx as G, nextTick as J } from "vue";
2
- import { useFloating as K, arrow as Q } from "./index209.js";
3
- import { useFocusTrap as X } from "./index218.js";
2
+ import { useFloating as K, arrow as Q } from "./index221.js";
3
+ import { useFocusTrap as X } from "./index202.js";
4
4
  import { useId as Y } from "./index7.js";
5
5
  import { wait as E } from "./index122.js";
6
6
  import Z from "./index9.js";
7
7
  import "./index10.js";
8
- import { autoUpdate as ee, flip as oe, shift as te } from "./index213.js";
9
- import { offset as ae } from "./index214.js";
8
+ import { autoUpdate as ee, flip as oe, shift as te } from "./index212.js";
9
+ import { offset as ae } from "./index217.js";
10
10
  const re = ["id"], ne = {
11
11
  key: 1,
12
12
  class: "bb-popover__bubble"
package/dist/index81.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as a, computed as l, openBlock as s, createElementBlock as n, normalizeClass as m, createElementVNode as i, normalizeStyle as c } from "vue";
2
- import { clamp as p } from "./index200.js";
2
+ import { clamp as p } from "./index196.js";
3
3
  import { getAsPercentageBetween as d } from "./index121.js";
4
4
  const v = /* @__PURE__ */ a({
5
5
  __name: "BbProgress",
package/dist/index99.js CHANGED
@@ -1,14 +1,14 @@
1
- import { defineComponent as D, getCurrentInstance as z, ref as K, computed as p, watch as _, openBlock as u, createElementBlock as d, unref as H, normalizeClass as g, createElementVNode as m, Fragment as w, renderList as B, createVNode as J, withCtx as O, renderSlot as q, toDisplayString as j, createCommentVNode as G } from "vue";
2
- import { useId as M } from "./index7.js";
3
- import { useRoute as Q } from "./index129.js";
4
- import { useRouter as W } from "./index130.js";
5
- import { wait as X } from "./index122.js";
6
- import Y from "./index9.js";
1
+ import { defineComponent as K, ref as F, getCurrentInstance as H, computed as p, watch as _, nextTick as J, openBlock as u, createElementBlock as d, unref as O, normalizeClass as g, createElementVNode as m, Fragment as w, renderList as N, createVNode as j, withCtx as G, renderSlot as q, toDisplayString as M, createCommentVNode as Q } from "vue";
2
+ import { useId as W } from "./index7.js";
3
+ import { useRoute as X } from "./index129.js";
4
+ import { useRouter as Y } from "./index130.js";
5
+ import { wait as Z } from "./index122.js";
6
+ import ee from "./index9.js";
7
7
  import "./index10.js";
8
- const Z = ["id"], ee = { class: "bb-tab__label-boundary" }, te = {
8
+ const ae = ["id"], te = { class: "bb-tab__label-boundary" }, le = {
9
9
  class: "bb-tab__label-container",
10
10
  role: "tablist"
11
- }, ae = { class: "bb-tab__label" }, le = { class: "bb-tab__panes-container" }, se = ["id", "aria-labelledby"], be = /* @__PURE__ */ D({
11
+ }, se = { class: "bb-tab__label" }, ie = { class: "bb-tab__panes-container" }, re = ["id", "aria-labelledby"], fe = /* @__PURE__ */ K({
12
12
  __name: "BbTab",
13
13
  props: {
14
14
  disabled: { type: Boolean },
@@ -21,24 +21,24 @@ const Z = ["id"], ee = { class: "bb-tab__label-boundary" }, te = {
21
21
  querykey: { default: "tab" }
22
22
  },
23
23
  emits: ["update:modelValue"],
24
- setup(F, { expose: N, emit: A }) {
25
- var T, S, x, I, V, L, C;
26
- const a = F, P = A, o = Q(), v = W(), k = a.id ?? M().id.value, b = `bb-tab_${k}`, $ = !!((S = (T = z()) == null ? void 0 : T.proxy) != null && S.$inertia), l = K(null), i = p(
27
- () => a.items.findIndex((e) => e.key === l.value)
28
- ), y = p(() => i.value === 0), f = p(() => i.value === a.items.length - 1);
29
- if (a.items.forEach((e) => {
24
+ setup(A, { expose: P, emit: U }) {
25
+ var x, S, I, V, L, C, E;
26
+ const t = A, D = U, o = X(), v = Y(), k = F(), $ = t.id ?? W().id.value, b = `bb-tab_${$}`, T = !!((S = (x = H()) == null ? void 0 : x.proxy) != null && S.$inertia), l = F(null), i = p(
27
+ () => t.items.findIndex((e) => e.key === l.value)
28
+ ), y = p(() => i.value === 0), f = p(() => i.value === t.items.length - 1);
29
+ if (t.items.forEach((e) => {
30
30
  if (!e.key)
31
31
  throw console.error("A tab item has no key", e), new Error("A tab item has no key " + JSON.stringify(e));
32
- }), a.navigation && ((I = (x = o.value) == null ? void 0 : x.query) != null && I[a.querykey]))
33
- l.value = (L = (V = o.value) == null ? void 0 : V.query) == null ? void 0 : L[a.querykey];
34
- else if (a.navigation && $ && ((C = globalThis == null ? void 0 : globalThis.location) != null && C.href) && new URL(globalThis.location.href).searchParams.get(a.querykey))
32
+ }), t.navigation && ((V = (I = o.value) == null ? void 0 : I.query) != null && V[t.querykey]))
33
+ l.value = (C = (L = o.value) == null ? void 0 : L.query) == null ? void 0 : C[t.querykey];
34
+ else if (t.navigation && T && ((E = globalThis == null ? void 0 : globalThis.location) != null && E.href) && new URL(globalThis.location.href).searchParams.get(t.querykey))
35
35
  l.value = new URL(globalThis.location.href).searchParams.get(
36
- a.querykey
36
+ t.querykey
37
37
  );
38
- else if (a.modelValue)
39
- l.value = a.modelValue;
40
- else if (a.items[0]) {
41
- const e = a.items.find((t) => !t.disabled);
38
+ else if (t.modelValue)
39
+ l.value = t.modelValue;
40
+ else if (t.items[0]) {
41
+ const e = t.items.find((a) => !a.disabled);
42
42
  if (!e)
43
43
  throw new Error(
44
44
  "No tab has been selected so it defaulted to the first available. Still, all the tabs are disabled so no tab can be selected."
@@ -47,20 +47,20 @@ const Z = ["id"], ee = { class: "bb-tab__label-boundary" }, te = {
47
47
  l.value = s;
48
48
  }
49
49
  const c = async (e, s = !1) => {
50
- var t, n, E, R;
51
- if (a.navigation && o.value && ((n = (t = o.value) == null ? void 0 : t.query) == null ? void 0 : n[a.querykey]) !== e)
50
+ var a, n, R, B;
51
+ if (t.navigation && o.value && ((n = (a = o.value) == null ? void 0 : a.query) == null ? void 0 : n[t.querykey]) !== e)
52
52
  v == null || v.push({
53
53
  ...o,
54
- query: { ...(E = o.value) == null ? void 0 : E.query, [a.querykey]: e },
54
+ query: { ...(R = o.value) == null ? void 0 : R.query, [t.querykey]: e },
55
55
  replace: s
56
56
  });
57
- else if (a.navigation && $ && ((R = globalThis == null ? void 0 : globalThis.location) != null && R.href) && new URL(globalThis.location.href).searchParams.get(a.querykey) !== e) {
57
+ else if (t.navigation && T && ((B = globalThis == null ? void 0 : globalThis.location) != null && B.href) && new URL(globalThis.location.href).searchParams.get(t.querykey) !== e) {
58
58
  const h = new URL(globalThis.location.href);
59
- h.searchParams.set(a.querykey, e), X(0).then(() => {
59
+ h.searchParams.set(t.querykey, e), Z(0).then(() => {
60
60
  s ? history.replaceState({}, "", h.toString()) : history.pushState({}, "", h.toString());
61
61
  });
62
62
  }
63
- a.modelValue !== e && P("update:modelValue", e), l.value = e;
63
+ t.modelValue !== e && D("update:modelValue", e), l.value = e;
64
64
  };
65
65
  l.value && c(l.value, !0);
66
66
  const r = (e) => {
@@ -70,25 +70,25 @@ const Z = ["id"], ee = { class: "bb-tab__label-boundary" }, te = {
70
70
  s = 0;
71
71
  break;
72
72
  case "previous":
73
- s = (i.value + a.items.length - 1) % a.items.length;
73
+ s = (i.value + t.items.length - 1) % t.items.length;
74
74
  break;
75
75
  case "next":
76
- s = (i.value + 1) % a.items.length;
76
+ s = (i.value + 1) % t.items.length;
77
77
  break;
78
78
  case "last":
79
- s = a.items.length - 1;
79
+ s = t.items.length - 1;
80
80
  break;
81
81
  }
82
82
  if (s === null)
83
83
  throw new Error("Could not navigate to next tab");
84
- if (a.items[s].disabled)
84
+ if (t.items[s].disabled)
85
85
  return;
86
- const t = a.items[s].key, n = document.querySelector(
87
- `#${b}_tab_${t}`
86
+ const a = t.items[s].key, n = document.querySelector(
87
+ `#${b}_tab_${a}`
88
88
  );
89
- n == null || n.focus(), c(t);
90
- }, U = (e) => {
91
- if (!a.disabled)
89
+ n == null || n.focus(), c(a);
90
+ }, z = (e) => {
91
+ if (!t.disabled)
92
92
  if (e.key === "ArrowRight")
93
93
  r("next");
94
94
  else if (e.key === "ArrowLeft")
@@ -101,84 +101,88 @@ const Z = ["id"], ee = { class: "bb-tab__label-boundary" }, te = {
101
101
  return;
102
102
  };
103
103
  return _(
104
- () => a.modelValue,
104
+ () => t.modelValue,
105
105
  (e) => {
106
106
  e && c(e);
107
107
  }
108
108
  ), _(
109
109
  () => {
110
110
  var e, s;
111
- return (s = (e = o.value) == null ? void 0 : e.query) == null ? void 0 : s[a.querykey];
111
+ return (s = (e = o.value) == null ? void 0 : e.query) == null ? void 0 : s[t.querykey];
112
112
  },
113
113
  (e) => {
114
114
  e && typeof e == "string" && c(e);
115
115
  }
116
116
  ), _(
117
117
  l,
118
- () => {
119
- const e = document.querySelector(
120
- `#${k} [role=tablist] .bb-tab__btn--active`
121
- );
122
- e && e.scrollIntoView({
123
- behavior: "smooth",
124
- block: "center",
125
- inline: "nearest"
126
- });
118
+ async () => {
119
+ if (k.value) {
120
+ const e = k.value.querySelector(
121
+ "[role=tablist] .bb-tab__btn--active"
122
+ );
123
+ e && (await J(), e.scrollIntoView({
124
+ behavior: "smooth",
125
+ block: "center",
126
+ inline: "nearest"
127
+ }));
128
+ }
127
129
  },
128
130
  { flush: "post" }
129
- ), N({
131
+ ), P({
130
132
  isFirst: y,
131
133
  isLast: f,
132
134
  current: l,
133
135
  currentIndex: i,
134
136
  goTo: r
135
137
  }), (e, s) => (u(), d("div", {
136
- id: H(k),
138
+ id: O($),
137
139
  class: g(["bb-tab", {
138
140
  [`bb-tab--${e.direction}`]: !0,
139
141
  "bb-tab--disabled": !0
140
- }])
142
+ }]),
143
+ ref_key: "tabs",
144
+ ref: k
141
145
  }, [
142
- m("div", ee, [
143
- m("ul", te, [
144
- (u(!0), d(w, null, B(e.items, (t) => (u(), d("li", {
145
- key: t.key,
146
+ m("div", te, [
147
+ m("ul", le, [
148
+ (u(!0), d(w, null, N(e.items, (a) => (u(), d("li", {
149
+ key: a.key,
146
150
  role: "presentation"
147
151
  }, [
148
- J(Y, {
149
- id: `${b}_tab_${t.key}`,
150
- "aria-selected": l.value === t.key,
151
- class: g(["bb-tab__btn", { "bb-tab__btn--active": l.value === t.key }]),
152
- disabled: t.disabled || e.disabled,
152
+ j(ee, {
153
+ id: `${b}_tab_${a.key}`,
154
+ "aria-selected": l.value === a.key,
155
+ class: g(["bb-tab__btn", { "bb-tab__btn--active": l.value === a.key }]),
156
+ disabled: a.disabled || e.disabled,
153
157
  role: "tab",
154
- tabindex: l.value === t.key ? 0 : -1,
155
- onClick: (n) => c(t.key),
156
- onKeydown: U
158
+ tabindex: l.value === a.key ? 0 : -1,
159
+ onClick: (n) => c(a.key),
160
+ onKeydown: z
157
161
  }, {
158
- default: O(() => [
159
- q(e.$slots, `label-${t.key}`, {
162
+ default: G(() => [
163
+ q(e.$slots, `label-${a.key}`, {
160
164
  current: l.value,
161
165
  currentIndex: i.value,
162
- disabled: !!(t.disabled || e.disabled),
166
+ disabled: !!(a.disabled || e.disabled),
163
167
  goTo: r,
164
168
  isFirst: y.value,
165
169
  isLast: f.value,
166
- selected: l.value === t.key,
167
- text: t.label,
168
- value: t.key
170
+ selected: l.value === a.key,
171
+ text: a.label,
172
+ value: a.key
169
173
  }, () => [
170
174
  q(e.$slots, "label", {
171
175
  current: l.value,
172
176
  currentIndex: i.value,
173
- disabled: !!(t.disabled || e.disabled),
177
+ disabled: !!(a.disabled || e.disabled),
174
178
  goTo: r,
175
179
  isFirst: y.value,
176
180
  isLast: f.value,
177
- selected: l.value === t.key,
178
- text: t.label,
179
- value: t.key
181
+ selected: l.value === a.key,
182
+ text: a.label,
183
+ value: a.key
180
184
  }, () => [
181
- m("span", ae, j(t.label), 1)
185
+ m("span", se, M(a.label), 1)
182
186
  ])
183
187
  ])
184
188
  ]),
@@ -187,38 +191,38 @@ const Z = ["id"], ee = { class: "bb-tab__label-boundary" }, te = {
187
191
  ]))), 128))
188
192
  ])
189
193
  ]),
190
- m("div", le, [
191
- (u(!0), d(w, null, B(e.items, (t) => (u(), d(w, {
192
- key: t.key
194
+ m("div", ie, [
195
+ (u(!0), d(w, null, N(e.items, (a) => (u(), d(w, {
196
+ key: a.key
193
197
  }, [
194
- l.value === t.key || e.eager || t.eager ? (u(), d("section", {
198
+ l.value === a.key || e.eager || a.eager ? (u(), d("section", {
195
199
  key: 0,
196
- id: `${b}_tabpanel_${t.key}`,
197
- "aria-labelledby": `${b}_tab_${t.key}`,
200
+ id: `${b}_tabpanel_${a.key}`,
201
+ "aria-labelledby": `${b}_tab_${a.key}`,
198
202
  class: g(["bb-tab__pane", {
199
- "bb-tab__pane--shown": l.value === t.key
203
+ "bb-tab__pane--shown": l.value === a.key
200
204
  }]),
201
205
  role: "tabpanel",
202
206
  tabindex: "0"
203
207
  }, [
204
- q(e.$slots, t.key, {
208
+ q(e.$slots, a.key, {
205
209
  current: l.value,
206
210
  currentIndex: i.value,
207
- disabled: !!(t.disabled || e.disabled),
211
+ disabled: !!(a.disabled || e.disabled),
208
212
  goTo: r,
209
213
  isFirst: y.value,
210
214
  isLast: f.value,
211
- selected: l.value === t.key,
212
- text: t.label,
213
- value: t.key
215
+ selected: l.value === a.key,
216
+ text: a.label,
217
+ value: a.key
214
218
  })
215
- ], 10, se)) : G("", !0)
219
+ ], 10, re)) : Q("", !0)
216
220
  ], 64))), 128))
217
221
  ])
218
- ], 10, Z));
222
+ ], 10, ae));
219
223
  }
220
224
  });
221
225
  export {
222
- be as default
226
+ fe as default
223
227
  };
224
228
  //# sourceMappingURL=index99.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index99.js","sources":["../src/components/BbTab/BbTab.vue"],"sourcesContent":["<template>\n\t<div\n\t\t:id=\"id\"\n\t\tclass=\"bb-tab\"\n\t\t:class=\"{\n\t\t\t[`bb-tab--${direction}`]: true,\n\t\t\t'bb-tab--disabled': true,\n\t\t}\"\n\t>\n\t\t<div class=\"bb-tab__label-boundary\">\n\t\t\t<ul class=\"bb-tab__label-container\" role=\"tablist\">\n\t\t\t\t<li v-for=\"tab in items\" :key=\"tab.key\" role=\"presentation\">\n\t\t\t\t\t<BaseButton\n\t\t\t\t\t\t:id=\"`${instanceid}_tab_${tab.key}`\"\n\t\t\t\t\t\t:aria-selected=\"selectedTab === tab.key\"\n\t\t\t\t\t\tclass=\"bb-tab__btn\"\n\t\t\t\t\t\t:class=\"{ 'bb-tab__btn--active': selectedTab === tab.key }\"\n\t\t\t\t\t\t:disabled=\"tab.disabled || disabled\"\n\t\t\t\t\t\t:role=\"'tab'\"\n\t\t\t\t\t\t:tabindex=\"selectedTab === tab.key ? 0 : -1\"\n\t\t\t\t\t\t@click=\"onTabSelected(tab.key)\"\n\t\t\t\t\t\t@keydown=\"onKeydown\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t:current=\"selectedTab\"\n\t\t\t\t\t\t\t:current-index=\"currentTabIndex\"\n\t\t\t\t\t\t\t:disabled=\"!!(tab.disabled || disabled)\"\n\t\t\t\t\t\t\t:go-to=\"goTo\"\n\t\t\t\t\t\t\t:is-first=\"isFirst\"\n\t\t\t\t\t\t\t:is-last=\"isLast\"\n\t\t\t\t\t\t\t:name=\"`label-${tab.key}`\"\n\t\t\t\t\t\t\t:selected=\"selectedTab === tab.key\"\n\t\t\t\t\t\t\t:text=\"tab.label\"\n\t\t\t\t\t\t\t:value=\"tab.key\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:current=\"selectedTab\"\n\t\t\t\t\t\t\t\t:current-index=\"currentTabIndex\"\n\t\t\t\t\t\t\t\t:disabled=\"!!(tab.disabled || disabled)\"\n\t\t\t\t\t\t\t\t:go-to=\"goTo\"\n\t\t\t\t\t\t\t\t:is-first=\"isFirst\"\n\t\t\t\t\t\t\t\t:is-last=\"isLast\"\n\t\t\t\t\t\t\t\tname=\"label\"\n\t\t\t\t\t\t\t\t:selected=\"selectedTab === tab.key\"\n\t\t\t\t\t\t\t\t:text=\"tab.label\"\n\t\t\t\t\t\t\t\t:value=\"tab.key\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span class=\"bb-tab__label\">{{ tab.label }}</span>\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t</slot>\n\t\t\t\t\t</BaseButton>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t\t<div class=\"bb-tab__panes-container\">\n\t\t\t<template v-for=\"tab in items\" :key=\"tab.key\">\n\t\t\t\t<section\n\t\t\t\t\tv-if=\"selectedTab === tab.key || eager || tab.eager\"\n\t\t\t\t\t:id=\"`${instanceid}_tabpanel_${tab.key}`\"\n\t\t\t\t\t:aria-labelledby=\"`${instanceid}_tab_${tab.key}`\"\n\t\t\t\t\tclass=\"bb-tab__pane\"\n\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t'bb-tab__pane--shown': selectedTab === tab.key,\n\t\t\t\t\t}\"\n\t\t\t\t\trole=\"tabpanel\"\n\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t>\n\t\t\t\t\t<slot\n\t\t\t\t\t\t:current=\"selectedTab\"\n\t\t\t\t\t\t:current-index=\"currentTabIndex\"\n\t\t\t\t\t\t:disabled=\"!!(tab.disabled || disabled)\"\n\t\t\t\t\t\t:go-to=\"goTo\"\n\t\t\t\t\t\t:is-first=\"isFirst\"\n\t\t\t\t\t\t:is-last=\"isLast\"\n\t\t\t\t\t\t:name=\"tab.key\"\n\t\t\t\t\t\t:selected=\"selectedTab === tab.key\"\n\t\t\t\t\t\t:text=\"tab.label\"\n\t\t\t\t\t\t:value=\"tab.key\"\n\t\t\t\t\t></slot>\n\t\t\t\t</section>\n\t\t\t</template>\n\t\t</div>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, getCurrentInstance, computed } from 'vue';\nimport { useId } from '@/composables/useId';\nimport { useRoute } from '@/composables/useRoute';\nimport { useRouter } from '@/composables/useRouter';\nimport { wait } from '@/utilities/functions/wait';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type BbTabItem = Pick<CommonProps, 'disabled'> & {\n\t/**\n\t * Used to render a tab even when not visible.\n\t * It's useful if you want the content of a tab in the DOM\n\t * immediately rendered\n\t * even when not visible for SEO purposes.\n\t */\n\teager?: boolean;\n\t/**\n\t * String that identifies the tab.\n\t */\n\tkey: string;\n\t/**\n\t * Label to use as the tab text.\n\t */\n\tlabel?: string;\n};\n\nexport type BbTabProps = Pick<CommonProps, 'disabled' | 'eager' | 'id'> & {\n\t/**\n\t * Direction of the tabs component\n\t */\n\tdirection?: 'horizontal' | 'vertical';\n\t/**\n\t * Array of items that define the tabs in the component.\n\t */\n\titems: BbTabItem[];\n\t/**\n\t * The current tab. Used by v-model.\n\t */\n\tmodelValue?: null | BbTabItem['key'];\n\t/**\n\t * Synchronizes the current tab with the url.\n\t */\n\tnavigation?: boolean;\n\t/**\n\t * Defines the query key to reference for maintaining navigation\n\t */\n\tquerykey?: string;\n};\n\nconst props = withDefaults(defineProps<BbTabProps>(), {\n\tdirection: 'horizontal',\n\tquerykey: 'tab',\n});\n\nexport type BbTabEvents = {\n\t(e: 'update:modelValue', value: (typeof props.items)[number]['key']): void;\n};\nconst emit = defineEmits<BbTabEvents>();\n\ntype BbStepSlots = {\n\tlabel?: (props: {\n\t\tcurrent: string | null;\n\t\tcurrentIndex: number;\n\t\tdisabled: boolean;\n\t\tisFirst: boolean;\n\t\tisLast: boolean;\n\t\tselected: boolean;\n\t\ttext: BbTabItem['label'];\n\t\tvalue: string;\n\t\tgoTo: typeof goTo;\n\t}) => any;\n} & {\n\t[key: string]: (props: {\n\t\tcurrent: string | null;\n\t\tcurrentIndex: number;\n\t\tdisabled: boolean;\n\t\tisFirst: boolean;\n\t\tisLast: boolean;\n\t\tselected: boolean;\n\t\ttext: BbTabItem['label'];\n\t\tvalue: string;\n\t\tgoTo: typeof goTo;\n\t}) => any;\n};\n\ndefineSlots<BbStepSlots>();\n\nconst route = useRoute();\nconst router = useRouter();\n\nconst id = props.id ?? useId().id.value;\nconst instanceid = `bb-tab_${id}`;\n\n/* Ignore because possibly undefined */\n// @ts-expect-error possibly undef\nconst isInertia = !!getCurrentInstance()?.proxy?.$inertia;\n\nconst selectedTab = ref<BbTabItem['key'] | null>(null);\n\nconst currentTabIndex = computed(() =>\n\tprops.items.findIndex((el) => el.key === selectedTab.value)\n);\nconst isFirst = computed(() => currentTabIndex.value === 0);\nconst isLast = computed(() => currentTabIndex.value === props.items.length - 1);\n\nprops.items.forEach((item) => {\n\tif (!item.key) {\n\t\tconsole.error(`A tab item has no key`, item);\n\t\tthrow new Error('A tab item has no key ' + JSON.stringify(item));\n\t}\n});\n\n/* \nThis section retrieves the current tab that should be selected\n*/\n// Retrieve tab from url on load for vue apps\nif (props.navigation && route.value?.query?.[props.querykey]) {\n\tselectedTab.value = route.value?.query?.[props.querykey] as string;\n\t// Retrieve tab from url on load for inertia app\n} else if (\n\tprops.navigation &&\n\tisInertia &&\n\tglobalThis?.location?.href &&\n\tnew URL(globalThis.location.href).searchParams.get(props.querykey)\n) {\n\tselectedTab.value = new URL(globalThis.location.href).searchParams.get(\n\t\tprops.querykey\n\t) as string;\n\t// Else whatever tab is passed first\n} else if (props.modelValue) {\n\tselectedTab.value = props.modelValue;\n\t// Else whatever tab is passed first\n} else if (props.items[0]) {\n\tconst firstSelectableTab = props.items.find((item) => !item.disabled);\n\tif (!firstSelectableTab) {\n\t\tthrow new Error(\n\t\t\t'No tab has been selected so it defaulted to the first available. Still, all the tabs are disabled so no tab can be selected.'\n\t\t);\n\t}\n\tconst key = firstSelectableTab.key;\n\tselectedTab.value = key;\n}\n/* \nOnce the current tab is found update external variables\n*/\n\nconst onTabSelected = async (tab: BbTabItem['key'], replace = false) => {\n\t/* For Vue or Nuxt context */\n\tif (\n\t\tprops.navigation &&\n\t\troute.value &&\n\t\troute.value?.query?.[props.querykey] !== tab\n\t) {\n\t\trouter?.push({\n\t\t\t...route,\n\t\t\tquery: { ...route.value?.query, [props.querykey]: tab },\n\t\t\treplace,\n\t\t});\n\t\t/* Inertia context */\n\t} else if (\n\t\tprops.navigation &&\n\t\tisInertia &&\n\t\tglobalThis?.location?.href &&\n\t\tnew URL(globalThis.location.href).searchParams.get(props.querykey) !== tab\n\t) {\n\t\tconst url = new URL(globalThis.location.href);\n\t\turl.searchParams.set(props.querykey, tab);\n\t\twait(0).then(() => {\n\t\t\tif (replace) {\n\t\t\t\thistory.replaceState({}, '', url.toString());\n\t\t\t} else {\n\t\t\t\thistory.pushState({}, '', url.toString());\n\t\t\t}\n\t\t});\n\t}\n\tif (props.modelValue !== tab) {\n\t\temit('update:modelValue', tab);\n\t}\n\tselectedTab.value = tab;\n};\n\nif (selectedTab.value) {\n\tonTabSelected(selectedTab.value, true);\n}\n\nconst goTo = (target: 'first' | 'previous' | 'next' | 'last') => {\n\tvar nextTabIndex: number | null = null;\n\tswitch (target) {\n\t\tcase 'first':\n\t\t\tnextTabIndex = 0;\n\t\t\tbreak;\n\t\tcase 'previous':\n\t\t\tnextTabIndex =\n\t\t\t\t(currentTabIndex.value + props.items.length - 1) % props.items.length;\n\t\t\tbreak;\n\t\tcase 'next':\n\t\t\tnextTabIndex = (currentTabIndex.value + 1) % props.items.length;\n\t\t\tbreak;\n\t\tcase 'last':\n\t\t\tnextTabIndex = props.items.length - 1;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\tif (nextTabIndex === null) {\n\t\tthrow new Error('Could not navigate to next tab');\n\t}\n\tif (props.items[nextTabIndex].disabled) return;\n\tconst targetKey = props.items[nextTabIndex].key;\n\tconst button: HTMLButtonElement | null = document.querySelector(\n\t\t`#${instanceid}_tab_${targetKey}`\n\t);\n\tbutton?.focus();\n\tonTabSelected(targetKey);\n};\n\nconst onKeydown = (event: KeyboardEvent) => {\n\tif (props.disabled) return;\n\tif (event.key === 'ArrowRight') {\n\t\tgoTo('next');\n\t} else if (event.key === 'ArrowLeft') {\n\t\tgoTo('previous');\n\t} else if (event.key === 'Home') {\n\t\tevent.preventDefault();\n\t\tgoTo('first');\n\t} else if (event.key === 'End') {\n\t\tevent.preventDefault();\n\t\tgoTo('last');\n\t} else {\n\t\treturn;\n\t}\n};\n\nwatch(\n\t() => props.modelValue,\n\t(value) => {\n\t\tif (value) {\n\t\t\tonTabSelected(value);\n\t\t}\n\t}\n);\n\nwatch(\n\t() => route.value?.query?.[props.querykey],\n\t(value) => {\n\t\tif (value && typeof value === 'string') {\n\t\t\tonTabSelected(value);\n\t\t}\n\t}\n);\n\nwatch(\n\tselectedTab,\n\t() => {\n\t\tconst element = document.querySelector(\n\t\t\t`#${id} [role=tablist] .bb-tab__btn--active`\n\t\t);\n\t\tif (element) {\n\t\t\telement.scrollIntoView({\n\t\t\t\tbehavior: 'smooth',\n\t\t\t\tblock: 'center',\n\t\t\t\tinline: 'nearest',\n\t\t\t});\n\t\t}\n\t},\n\t{ flush: 'post' }\n);\n\ndefineExpose({\n\tisFirst,\n\tisLast,\n\tcurrent: selectedTab,\n\tcurrentIndex: currentTabIndex,\n\tgoTo,\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbTab';\n</style>\n"],"names":["props","__props","emit","__emit","route","useRoute","router","useRouter","id","useId","instanceid","isInertia","_b","_a","getCurrentInstance","selectedTab","ref","currentTabIndex","computed","el","isFirst","isLast","item","_d","_c","_f","_e","_g","firstSelectableTab","key","onTabSelected","tab","replace","url","wait","goTo","target","nextTabIndex","targetKey","button","onKeydown","event","watch","value","element","__expose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAuIA,UAAMA,IAAQC,GAQRC,IAAOC,GA8BPC,IAAQC,KACRC,IAASC,KAETC,IAAKR,EAAM,MAAMS,IAAQ,GAAG,OAC5BC,IAAa,UAAUF,CAAE,IAIzBG,IAAY,CAAC,GAACC,KAAAC,IAAAC,EAAA,MAAA,gBAA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AAAA,IAAA,GAGJC,EAAA;AAAA,MACZ,SAAAzB;AAAA,MACA,QAAAC;AAAA,MACA,SAASN;AAAA,MACT,cAAcE;AAAA,MACd,MAAAkB;AAAA,IAAA,CACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index99.js","sources":["../src/components/BbTab/BbTab.vue"],"sourcesContent":["<template>\n\t<div\n\t\t:id=\"id\"\n\t\tclass=\"bb-tab\"\n\t\tref=\"tabs\"\n\t\t:class=\"{\n\t\t\t[`bb-tab--${direction}`]: true,\n\t\t\t'bb-tab--disabled': true,\n\t\t}\"\n\t>\n\t\t<div class=\"bb-tab__label-boundary\">\n\t\t\t<ul class=\"bb-tab__label-container\" role=\"tablist\">\n\t\t\t\t<li v-for=\"tab in items\" :key=\"tab.key\" role=\"presentation\">\n\t\t\t\t\t<BaseButton\n\t\t\t\t\t\t:id=\"`${instanceid}_tab_${tab.key}`\"\n\t\t\t\t\t\t:aria-selected=\"selectedTab === tab.key\"\n\t\t\t\t\t\tclass=\"bb-tab__btn\"\n\t\t\t\t\t\t:class=\"{ 'bb-tab__btn--active': selectedTab === tab.key }\"\n\t\t\t\t\t\t:disabled=\"tab.disabled || disabled\"\n\t\t\t\t\t\t:role=\"'tab'\"\n\t\t\t\t\t\t:tabindex=\"selectedTab === tab.key ? 0 : -1\"\n\t\t\t\t\t\t@click=\"onTabSelected(tab.key)\"\n\t\t\t\t\t\t@keydown=\"onKeydown\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t:current=\"selectedTab\"\n\t\t\t\t\t\t\t:current-index=\"currentTabIndex\"\n\t\t\t\t\t\t\t:disabled=\"!!(tab.disabled || disabled)\"\n\t\t\t\t\t\t\t:go-to=\"goTo\"\n\t\t\t\t\t\t\t:is-first=\"isFirst\"\n\t\t\t\t\t\t\t:is-last=\"isLast\"\n\t\t\t\t\t\t\t:name=\"`label-${tab.key}`\"\n\t\t\t\t\t\t\t:selected=\"selectedTab === tab.key\"\n\t\t\t\t\t\t\t:text=\"tab.label\"\n\t\t\t\t\t\t\t:value=\"tab.key\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\t\t:current=\"selectedTab\"\n\t\t\t\t\t\t\t\t:current-index=\"currentTabIndex\"\n\t\t\t\t\t\t\t\t:disabled=\"!!(tab.disabled || disabled)\"\n\t\t\t\t\t\t\t\t:go-to=\"goTo\"\n\t\t\t\t\t\t\t\t:is-first=\"isFirst\"\n\t\t\t\t\t\t\t\t:is-last=\"isLast\"\n\t\t\t\t\t\t\t\tname=\"label\"\n\t\t\t\t\t\t\t\t:selected=\"selectedTab === tab.key\"\n\t\t\t\t\t\t\t\t:text=\"tab.label\"\n\t\t\t\t\t\t\t\t:value=\"tab.key\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<span class=\"bb-tab__label\">{{ tab.label }}</span>\n\t\t\t\t\t\t\t</slot>\n\t\t\t\t\t\t</slot>\n\t\t\t\t\t</BaseButton>\n\t\t\t\t</li>\n\t\t\t</ul>\n\t\t</div>\n\t\t<div class=\"bb-tab__panes-container\">\n\t\t\t<template v-for=\"tab in items\" :key=\"tab.key\">\n\t\t\t\t<section\n\t\t\t\t\tv-if=\"selectedTab === tab.key || eager || tab.eager\"\n\t\t\t\t\t:id=\"`${instanceid}_tabpanel_${tab.key}`\"\n\t\t\t\t\t:aria-labelledby=\"`${instanceid}_tab_${tab.key}`\"\n\t\t\t\t\tclass=\"bb-tab__pane\"\n\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t'bb-tab__pane--shown': selectedTab === tab.key,\n\t\t\t\t\t}\"\n\t\t\t\t\trole=\"tabpanel\"\n\t\t\t\t\ttabindex=\"0\"\n\t\t\t\t>\n\t\t\t\t\t<slot\n\t\t\t\t\t\t:current=\"selectedTab\"\n\t\t\t\t\t\t:current-index=\"currentTabIndex\"\n\t\t\t\t\t\t:disabled=\"!!(tab.disabled || disabled)\"\n\t\t\t\t\t\t:go-to=\"goTo\"\n\t\t\t\t\t\t:is-first=\"isFirst\"\n\t\t\t\t\t\t:is-last=\"isLast\"\n\t\t\t\t\t\t:name=\"tab.key\"\n\t\t\t\t\t\t:selected=\"selectedTab === tab.key\"\n\t\t\t\t\t\t:text=\"tab.label\"\n\t\t\t\t\t\t:value=\"tab.key\"\n\t\t\t\t\t></slot>\n\t\t\t\t</section>\n\t\t\t</template>\n\t\t</div>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport { ref, watch, getCurrentInstance, computed, nextTick } from 'vue';\nimport { useId } from '@/composables/useId';\nimport { useRoute } from '@/composables/useRoute';\nimport { useRouter } from '@/composables/useRouter';\nimport { wait } from '@/utilities/functions/wait';\nimport BaseButton from '../BaseButton/BaseButton.vue';\nimport type { CommonProps } from '@/types/CommonProps';\n\nexport type BbTabItem = Pick<CommonProps, 'disabled'> & {\n\t/**\n\t * Used to render a tab even when not visible.\n\t * It's useful if you want the content of a tab in the DOM\n\t * immediately rendered\n\t * even when not visible for SEO purposes.\n\t */\n\teager?: boolean;\n\t/**\n\t * String that identifies the tab.\n\t */\n\tkey: string;\n\t/**\n\t * Label to use as the tab text.\n\t */\n\tlabel?: string;\n};\n\nexport type BbTabProps = Pick<CommonProps, 'disabled' | 'eager' | 'id'> & {\n\t/**\n\t * Direction of the tabs component\n\t */\n\tdirection?: 'horizontal' | 'vertical';\n\t/**\n\t * Array of items that define the tabs in the component.\n\t */\n\titems: BbTabItem[];\n\t/**\n\t * The current tab. Used by v-model.\n\t */\n\tmodelValue?: null | BbTabItem['key'];\n\t/**\n\t * Synchronizes the current tab with the url.\n\t */\n\tnavigation?: boolean;\n\t/**\n\t * Defines the query key to reference for maintaining navigation\n\t */\n\tquerykey?: string;\n};\n\nconst props = withDefaults(defineProps<BbTabProps>(), {\n\tdirection: 'horizontal',\n\tquerykey: 'tab',\n});\n\nexport type BbTabEvents = {\n\t(e: 'update:modelValue', value: (typeof props.items)[number]['key']): void;\n};\nconst emit = defineEmits<BbTabEvents>();\n\ntype BbStepSlots = {\n\tlabel?: (props: {\n\t\tcurrent: string | null;\n\t\tcurrentIndex: number;\n\t\tdisabled: boolean;\n\t\tisFirst: boolean;\n\t\tisLast: boolean;\n\t\tselected: boolean;\n\t\ttext: BbTabItem['label'];\n\t\tvalue: string;\n\t\tgoTo: typeof goTo;\n\t}) => any;\n} & {\n\t[key: string]: (props: {\n\t\tcurrent: string | null;\n\t\tcurrentIndex: number;\n\t\tdisabled: boolean;\n\t\tisFirst: boolean;\n\t\tisLast: boolean;\n\t\tselected: boolean;\n\t\ttext: BbTabItem['label'];\n\t\tvalue: string;\n\t\tgoTo: typeof goTo;\n\t}) => any;\n};\n\ndefineSlots<BbStepSlots>();\n\nconst route = useRoute();\nconst router = useRouter();\n\nconst tabs = ref();\n\nconst id = props.id ?? useId().id.value;\nconst instanceid = `bb-tab_${id}`;\n\n/* Ignore because possibly undefined */\n// @ts-expect-error possibly undef\nconst isInertia = !!getCurrentInstance()?.proxy?.$inertia;\n\nconst selectedTab = ref<BbTabItem['key'] | null>(null);\n\nconst currentTabIndex = computed(() =>\n\tprops.items.findIndex((el) => el.key === selectedTab.value)\n);\nconst isFirst = computed(() => currentTabIndex.value === 0);\nconst isLast = computed(() => currentTabIndex.value === props.items.length - 1);\n\nprops.items.forEach((item) => {\n\tif (!item.key) {\n\t\tconsole.error(`A tab item has no key`, item);\n\t\tthrow new Error('A tab item has no key ' + JSON.stringify(item));\n\t}\n});\n\n/* \nThis section retrieves the current tab that should be selected\n*/\n// Retrieve tab from url on load for vue apps\nif (props.navigation && route.value?.query?.[props.querykey]) {\n\tselectedTab.value = route.value?.query?.[props.querykey] as string;\n\t// Retrieve tab from url on load for inertia app\n} else if (\n\tprops.navigation &&\n\tisInertia &&\n\tglobalThis?.location?.href &&\n\tnew URL(globalThis.location.href).searchParams.get(props.querykey)\n) {\n\tselectedTab.value = new URL(globalThis.location.href).searchParams.get(\n\t\tprops.querykey\n\t) as string;\n\t// Else whatever tab is passed first\n} else if (props.modelValue) {\n\tselectedTab.value = props.modelValue;\n\t// Else whatever tab is passed first\n} else if (props.items[0]) {\n\tconst firstSelectableTab = props.items.find((item) => !item.disabled);\n\tif (!firstSelectableTab) {\n\t\tthrow new Error(\n\t\t\t'No tab has been selected so it defaulted to the first available. Still, all the tabs are disabled so no tab can be selected.'\n\t\t);\n\t}\n\tconst key = firstSelectableTab.key;\n\tselectedTab.value = key;\n}\n/* \nOnce the current tab is found update external variables\n*/\n\nconst onTabSelected = async (tab: BbTabItem['key'], replace = false) => {\n\t/* For Vue or Nuxt context */\n\tif (\n\t\tprops.navigation &&\n\t\troute.value &&\n\t\troute.value?.query?.[props.querykey] !== tab\n\t) {\n\t\trouter?.push({\n\t\t\t...route,\n\t\t\tquery: { ...route.value?.query, [props.querykey]: tab },\n\t\t\treplace,\n\t\t});\n\t\t/* Inertia context */\n\t} else if (\n\t\tprops.navigation &&\n\t\tisInertia &&\n\t\tglobalThis?.location?.href &&\n\t\tnew URL(globalThis.location.href).searchParams.get(props.querykey) !== tab\n\t) {\n\t\tconst url = new URL(globalThis.location.href);\n\t\turl.searchParams.set(props.querykey, tab);\n\t\twait(0).then(() => {\n\t\t\tif (replace) {\n\t\t\t\thistory.replaceState({}, '', url.toString());\n\t\t\t} else {\n\t\t\t\thistory.pushState({}, '', url.toString());\n\t\t\t}\n\t\t});\n\t}\n\tif (props.modelValue !== tab) {\n\t\temit('update:modelValue', tab);\n\t}\n\tselectedTab.value = tab;\n};\n\nif (selectedTab.value) {\n\tonTabSelected(selectedTab.value, true);\n}\n\nconst goTo = (target: 'first' | 'previous' | 'next' | 'last') => {\n\tvar nextTabIndex: number | null = null;\n\tswitch (target) {\n\t\tcase 'first':\n\t\t\tnextTabIndex = 0;\n\t\t\tbreak;\n\t\tcase 'previous':\n\t\t\tnextTabIndex =\n\t\t\t\t(currentTabIndex.value + props.items.length - 1) % props.items.length;\n\t\t\tbreak;\n\t\tcase 'next':\n\t\t\tnextTabIndex = (currentTabIndex.value + 1) % props.items.length;\n\t\t\tbreak;\n\t\tcase 'last':\n\t\t\tnextTabIndex = props.items.length - 1;\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\tif (nextTabIndex === null) {\n\t\tthrow new Error('Could not navigate to next tab');\n\t}\n\tif (props.items[nextTabIndex].disabled) return;\n\tconst targetKey = props.items[nextTabIndex].key;\n\tconst button: HTMLButtonElement | null = document.querySelector(\n\t\t`#${instanceid}_tab_${targetKey}`\n\t);\n\tbutton?.focus();\n\tonTabSelected(targetKey);\n};\n\nconst onKeydown = (event: KeyboardEvent) => {\n\tif (props.disabled) return;\n\tif (event.key === 'ArrowRight') {\n\t\tgoTo('next');\n\t} else if (event.key === 'ArrowLeft') {\n\t\tgoTo('previous');\n\t} else if (event.key === 'Home') {\n\t\tevent.preventDefault();\n\t\tgoTo('first');\n\t} else if (event.key === 'End') {\n\t\tevent.preventDefault();\n\t\tgoTo('last');\n\t} else {\n\t\treturn;\n\t}\n};\n\nwatch(\n\t() => props.modelValue,\n\t(value) => {\n\t\tif (value) {\n\t\t\tonTabSelected(value);\n\t\t}\n\t}\n);\n\nwatch(\n\t() => route.value?.query?.[props.querykey],\n\t(value) => {\n\t\tif (value && typeof value === 'string') {\n\t\t\tonTabSelected(value);\n\t\t}\n\t}\n);\n\nwatch(\n\tselectedTab,\n\tasync () => {\n\t\tif(tabs.value) {\n\n\t\tconst element = tabs.value.querySelector(\n\t\t\t`[role=tablist] .bb-tab__btn--active`\n\t\t);\n\t\tif (element) {\n\t\t\tawait nextTick()\n\t\t\telement.scrollIntoView({\n\t\t\t\tbehavior: 'smooth',\n\t\t\t\tblock: 'center',\n\t\t\t\tinline: 'nearest',\n\t\t\t});\n\t\t}\n\t\t}\n\t},\n\t{ flush: 'post' }\n);\n\ndefineExpose({\n\tisFirst,\n\tisLast,\n\tcurrent: selectedTab,\n\tcurrentIndex: currentTabIndex,\n\tgoTo,\n});\n</script>\n\n<style lang=\"postcss\">\n@import '@/assets/css/BbTab';\n</style>\n"],"names":["props","__props","emit","__emit","route","useRoute","router","useRouter","tabs","ref","id","useId","instanceid","isInertia","_b","_a","getCurrentInstance","selectedTab","currentTabIndex","computed","el","isFirst","isLast","item","_d","_c","_f","_e","_g","firstSelectableTab","key","onTabSelected","tab","replace","url","wait","goTo","target","nextTabIndex","targetKey","button","onKeydown","event","watch","value","element","nextTick","__expose"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAwIA,UAAMA,IAAQC,GAQRC,IAAOC,GA8BPC,IAAQC,KACRC,IAASC,KAETC,IAAOC,KAEPC,IAAKV,EAAM,MAAMW,IAAQ,GAAG,OAC5BC,IAAa,UAAUF,CAAE,IAIzBG,IAAY,CAAC,GAACC,KAAAC,IAAAC,EAAA,MAAA,gBAAAD,EAAsB,UAAtB,QAAAD,EAA6B,WAE3CG,IAAcR,EAA6B,IAAI,GAE/CS,IAAkBC;AAAA,MAAS,MAChCnB,EAAM,MAAM,UAAU,CAACoB,MAAOA,EAAG,QAAQH,EAAY,KAAK;AAAA,IAAA,GAErDI,IAAUF,EAAS,MAAMD,EAAgB,UAAU,CAAC,GACpDI,IAASH,EAAS,MAAMD,EAAgB,UAAUlB,EAAM,MAAM,SAAS,CAAC;AAa9E,QAXMA,EAAA,MAAM,QAAQ,CAACuB,MAAS;AACzB,UAAA,CAACA,EAAK;AACD,sBAAA,MAAM,yBAAyBA,CAAI,GACrC,IAAI,MAAM,2BAA2B,KAAK,UAAUA,CAAI,CAAC;AAAA,IAChE,CACA,GAMGvB,EAAM,gBAAcwB,KAAAC,IAAArB,EAAM,UAAN,gBAAAqB,EAAa,UAAb,QAAAD,EAAqBxB,EAAM;AAClD,MAAAiB,EAAY,SAAQS,KAAAC,IAAAvB,EAAM,UAAN,gBAAAuB,EAAa,UAAb,gBAAAD,EAAqB1B,EAAM;AAAA,aAG/CA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