bitboss-ui 2.0.174 → 2.0.176

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 (177) hide show
  1. package/dist/components/BaseButton/BaseButton.vue.d.ts +1 -1
  2. package/dist/components/BaseColorInput/BaseColorInput.vue.d.ts +1 -0
  3. package/dist/components/BaseDialog/BaseDialog.vue.d.ts +34 -27
  4. package/dist/components/BbConfirm/BbConfirm.vue.d.ts +1 -1
  5. package/dist/components/BbDialog/BbDialog.vue.d.ts +8 -3
  6. package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +1 -1
  7. package/dist/components/BbToast/BbToast.vue.d.ts +1 -1
  8. package/dist/index.css +1 -1
  9. package/dist/index106.js +9 -9
  10. package/dist/index111.js +1 -1
  11. package/dist/index113.js +1 -1
  12. package/dist/index121.js +12 -12
  13. package/dist/index129.js +20 -26
  14. package/dist/index13.js +1 -1
  15. package/dist/index131.js +4 -4
  16. package/dist/index133.js +1 -1
  17. package/dist/index136.js +1 -1
  18. package/dist/index137.js +2 -2
  19. package/dist/index138.js +1 -1
  20. package/dist/index139.js +2 -2
  21. package/dist/index15.js +9 -9
  22. package/dist/index17.js +3 -3
  23. package/dist/index19.js +8 -8
  24. package/dist/index207.js +2 -2
  25. package/dist/index208.js +2 -2
  26. package/dist/index209.js +13 -2
  27. package/dist/index21.js +8 -8
  28. package/dist/index210.js +66 -4
  29. package/dist/index212.js +176 -12
  30. package/dist/index213.js +79 -59
  31. package/dist/index215.js +28 -33
  32. package/dist/index216.js +17 -4
  33. package/dist/index217.js +51 -13
  34. package/dist/index218.js +14 -10
  35. package/dist/index219.js +3 -20
  36. package/dist/index220.js +12 -200
  37. package/dist/index221.js +18 -0
  38. package/dist/index222.js +29 -115
  39. package/dist/index223.js +4 -0
  40. package/dist/index224.js +4 -2
  41. package/dist/index225.js +2 -2
  42. package/dist/index226.js +5 -3
  43. package/dist/index227.js +4 -4
  44. package/dist/index228.js +4 -4
  45. package/dist/index229.js +4 -4
  46. package/dist/index23.js +15 -15
  47. package/dist/index230.js +4 -4
  48. package/dist/index231.js +5 -5
  49. package/dist/index232.js +2 -5
  50. package/dist/index233.js +2 -2
  51. package/dist/index234.js +2 -2
  52. package/dist/index235.js +13 -2
  53. package/dist/index236.js +10 -50
  54. package/dist/index237.js +19 -16
  55. package/dist/index238.js +108 -101
  56. package/dist/index240.js +53 -47
  57. package/dist/index242.js +95 -81
  58. package/dist/index244.js +4 -29
  59. package/dist/index245.js +197 -16
  60. package/dist/index247.js +17 -11
  61. package/dist/index248.js +12 -41
  62. package/dist/index25.js +154 -224
  63. package/dist/index250.js +228 -7
  64. package/dist/index251.js +12 -14
  65. package/dist/index252.js +3 -177
  66. package/dist/index253.js +1 -1
  67. package/dist/index254.js +1 -1
  68. package/dist/index256.js +5 -5
  69. package/dist/index260.js +1 -1
  70. package/dist/index261.js +2 -18
  71. package/dist/index262.js +2 -12
  72. package/dist/index263.js +8 -227
  73. package/dist/index264.js +23 -3
  74. package/dist/index265.js +10 -6
  75. package/dist/index266.js +3 -16
  76. package/dist/index267.js +41 -10
  77. package/dist/index268.js +7 -3
  78. package/dist/index269.js +15 -3
  79. package/dist/index27.js +1 -1
  80. package/dist/index270.js +3 -9
  81. package/dist/index271.js +6 -9
  82. package/dist/index272.js +16 -23
  83. package/dist/index273.js +9 -9
  84. package/dist/index274.js +9 -8
  85. package/dist/index275.js +8 -5
  86. package/dist/index276.js +2 -67
  87. package/dist/index277.js +5 -2
  88. package/dist/index278.js +67 -5
  89. package/dist/index279.js +4 -7
  90. package/dist/index280.js +8 -4
  91. package/dist/index283.js +1 -1
  92. package/dist/index284.js +3 -2
  93. package/dist/index285.js +17 -3
  94. package/dist/index286.js +28 -3
  95. package/dist/index287.js +2 -7
  96. package/dist/index288.js +3 -10
  97. package/dist/index289.js +4 -4
  98. package/dist/index29.js +3 -3
  99. package/dist/index290.js +279 -27
  100. package/dist/index291.js +2 -280
  101. package/dist/index292.js +125 -2
  102. package/dist/index293.js +2 -125
  103. package/dist/index294.js +15 -2
  104. package/dist/index295.js +2 -15
  105. package/dist/index296.js +16 -2
  106. package/dist/index297.js +2 -16
  107. package/dist/index298.js +16 -2
  108. package/dist/index299.js +2 -16
  109. package/dist/index300.js +19 -2
  110. package/dist/index301.js +2 -19
  111. package/dist/index302.js +3 -2
  112. package/dist/index303.js +7 -6
  113. package/dist/index304.js +11 -3
  114. package/dist/index306.js +3 -17
  115. package/dist/index307.js +1 -1
  116. package/dist/index308.js +5 -470
  117. package/dist/index309.js +1 -1
  118. package/dist/index31.js +2 -2
  119. package/dist/index310.js +5 -200
  120. package/dist/index321.js +471 -2
  121. package/dist/index322.js +2 -5
  122. package/dist/index323.js +5 -701
  123. package/dist/index324.js +199 -353
  124. package/dist/index325.js +701 -58
  125. package/dist/index326.js +354 -5
  126. package/dist/index327.js +58 -2
  127. package/dist/index328.js +2 -8
  128. package/dist/index329.js +6 -5
  129. package/dist/index33.js +8 -8
  130. package/dist/index330.js +47 -8
  131. package/dist/index332.js +2 -2
  132. package/dist/index333.js +6 -32
  133. package/dist/index334.js +18 -27
  134. package/dist/index335.js +35 -0
  135. package/dist/index336.js +28 -7
  136. package/dist/index338.js +57 -227
  137. package/dist/index339.js +58 -47
  138. package/dist/index340.js +7 -6
  139. package/dist/index341.js +6 -58
  140. package/dist/index342.js +7 -57
  141. package/dist/index343.js +221 -86
  142. package/dist/index344.js +95 -0
  143. package/dist/index345.js +482 -3
  144. package/dist/index348.js +3 -127
  145. package/dist/index349.js +43 -478
  146. package/dist/index35.js +4 -4
  147. package/dist/index350.js +429 -40
  148. package/dist/index351.js +129 -0
  149. package/dist/index37.js +101 -101
  150. package/dist/index39.js +5 -5
  151. package/dist/index41.js +2 -2
  152. package/dist/index43.js +8 -8
  153. package/dist/index45.js +8 -8
  154. package/dist/index47.js +2 -2
  155. package/dist/index49.js +3 -3
  156. package/dist/index53.js +1 -1
  157. package/dist/index55.js +1 -1
  158. package/dist/index57.js +2 -2
  159. package/dist/index61.js +3 -3
  160. package/dist/index67.js +1 -1
  161. package/dist/index73.js +23 -26
  162. package/dist/index77.js +32 -34
  163. package/dist/index79.js +4 -4
  164. package/dist/index81.js +1 -1
  165. package/dist/index83.js +2 -2
  166. package/dist/index85.js +1 -1
  167. package/dist/index87.js +1 -1
  168. package/dist/index90.js +4 -4
  169. package/dist/index92.js +2 -2
  170. package/dist/index94.js +7 -6
  171. package/dist/index96.js +1 -1
  172. package/dist/utilities/functions/parseSize.d.ts +2 -0
  173. package/package.json +1 -1
  174. package/dist/index211.js +0 -4
  175. package/dist/index246.js +0 -17
  176. package/dist/index337.js +0 -21
  177. package/dist/index347.js +0 -438
package/dist/index25.js CHANGED
@@ -1,248 +1,178 @@
1
- import { defineComponent as ae, ref as a, computed as i, getCurrentInstance as oe, useAttrs as se, onMounted as ne, onBeforeUnmount as ie, nextTick as N, watch as re, createBlock as ue, openBlock as y, withCtx as W, createElementVNode as o, mergeProps as F, createElementBlock as B, createCommentVNode as V, renderSlot as r, createTextVNode as de, toDisplayString as E, createVNode as ce } from "vue";
2
- import { useFocusTrap as fe } from "./index248.js";
3
- import { useId as H } from "./index8.js";
4
- import { wait as g } from "./index135.js";
5
- import { waitFor as be } from "./index249.js";
6
- import { useModalsState as h } from "./index250.js";
7
- import { useMobile as pe } from "./index9.js";
8
- import ve from "./index251.js";
9
- import { useLocale as me } from "./index217.js";
10
- import ye from "./index111.js";
1
+ import { defineComponent as P, mergeModels as D, useModel as q, computed as p, ref as E, watch as A, onMounted as H, createElementBlock as d, openBlock as u, withModifiers as K, normalizeStyle as O, normalizeClass as R, unref as v, createCommentVNode as g, Fragment as U, createElementVNode as t, renderSlot as s, createTextVNode as j, toDisplayString as T, createVNode as G, withCtx as J, nextTick as Q } from "vue";
2
+ import { parseSize as X } from "./index251.js";
3
+ import { useId as V } from "./index8.js";
4
+ import { useLocale as Y } from "./index235.js";
5
+ import { useMobile as Z } from "./index9.js";
6
+ import { useUntil as x } from "./index236.js";
7
+ import { wait as h } from "./index135.js";
8
+ import ee from "./index111.js";
11
9
  /* empty css */
12
- const ge = { class: "bb-base-dialog-close" }, he = ["aria-label"], Se = /* @__PURE__ */ ae({
10
+ const oe = ["aria-describedby", "aria-labelledby", "aria-live"], te = {
11
+ ref: "header",
12
+ class: "bb-base-dialog__header"
13
+ }, le = { class: "bb-base-dialog__close" }, se = ["aria-label", "disabled"], ae = {
14
+ ref: "body",
15
+ class: "bb-base-dialog__body scrollbar-border"
16
+ }, ie = {
17
+ ref: "footer",
18
+ class: "bb-base-dialog__footer"
19
+ }, ve = /* @__PURE__ */ P({
13
20
  __name: "BaseDialog",
14
- props: {
21
+ props: /* @__PURE__ */ D({
15
22
  closeLabel: {},
16
23
  compact: { type: Boolean },
17
24
  disabled: { type: Boolean },
18
25
  eager: { type: Boolean },
19
- panelClasses: { default: () => [] },
20
- overlayClasses: { default: () => [] },
21
26
  persistent: { type: Boolean },
22
27
  showClose: { type: Boolean, default: !0 },
23
28
  title: {},
24
- transition: { default: "fade" },
25
- transitionDuration: { default: 200 },
29
+ transitionDuration: { default: 300 },
26
30
  size: { default: "sm" },
27
31
  description: {},
28
32
  focusTarget: {},
29
33
  fullscreen: { type: [Boolean, String] },
30
- modelValue: { type: [Boolean, null] }
31
- },
32
- emits: ["shown", "hidden", "update:modelValue"],
33
- setup(R, { emit: K }) {
34
- var O, A;
35
- const l = R, u = K, _ = `title_${H().id.value}`, w = `description_${H().id.value}`, { isMobile: P } = pe(), d = a(null), k = a(null), U = a(null), j = a(null), $ = a(null), q = a(null), M = i(
36
- () => l.fullscreen === !0 || l.fullscreen === "mobile" && P.value
37
- ), T = !!((A = (O = oe()) == null ? void 0 : O.proxy) != null && A.$nuxt), p = a(0), G = i(() => {
38
- const { openedModals: e } = h();
39
- return e.value && e.value === p.value;
40
- }), { activate: J, deactivate: D } = fe(k, {
41
- initialFocus: l.focusTarget ?? void 0,
42
- clickOutsideDeactivates: (e) => !l.persistent && e.target === d.value,
43
- allowOutsideClick: !0,
44
- /* On esc deactivate the trap, return focus and then close the modal */
45
- escapeDeactivates: () => (N(async () => {
46
- l.persistent ? (b.value = !0, await g(100), b.value = !1) : u("update:modelValue", !1);
47
- }), !l.persistent)
48
- }), Q = se(), { t: X } = me(), Y = i(
49
- () => l.closeLabel || X("dialog.closeLabel").value
50
- );
51
- ne(async () => {
52
- !l.modelValue && !n.value || T && !globalThis.document || S();
53
- });
54
- const v = a(!1), c = a(!1), C = a(!0), f = a(!1), n = a(l.eager || l.modelValue), L = i(() => c.value || f.value), Z = () => {
55
- if (!globalThis.document) return;
56
- const e = window.innerWidth - document.documentElement.clientWidth;
57
- document.body.style.overflow = "hidden", document.body.style.paddingRight = `${e}px`;
58
- }, z = () => {
59
- globalThis.document && (document.body.style.overflow = "auto", document.body.style.paddingRight = "0px");
60
- };
61
- ie(() => {
62
- if (l.modelValue) {
63
- const { openedModals: e, modalHasClosed: t } = h();
64
- e.value && (t(), p.value = 0, z());
65
- }
66
- });
67
- const S = async () => {
68
- if (l.modelValue) {
69
- n.value || (n.value = !0, await be(() => !!$.value), await N()), C.value = !1, f.value = !1, c.value = !0;
70
- const { modalHasOpened: e, openedModals: t } = h();
71
- e(), p.value = t.value, Z(), await g(l.transitionDuration), c.value = !1, v.value = !0, u("shown"), J();
72
- } else {
73
- D(), c.value = !1, v.value = !1, f.value = !0, await g(l.transitionDuration), f.value = !1, C.value = !0;
74
- const { modalHasClosed: e, openedModals: t } = h();
75
- e(), p.value = 0, t.value || z(), u("hidden");
34
+ panelClasses: { default: () => [] },
35
+ overlayClasses: { default: () => [] }
36
+ }, {
37
+ modelValue: { type: Boolean, default: !1 },
38
+ modelModifiers: {}
39
+ }),
40
+ emits: /* @__PURE__ */ D(["shown", "hidden"], ["update:modelValue"]),
41
+ setup(y, { emit: S }) {
42
+ const o = y, w = S, l = q(y, "modelValue"), { t: z } = Y(), N = p(
43
+ () => o.closeLabel || z("dialog.closeLabel").value
44
+ ), n = E(null), c = x(
45
+ () => l.value || o.eager,
46
+ {
47
+ initialValue: l.value || o.eager
76
48
  }
49
+ ), b = `title_${V().id.value}`, f = `description_${V().id.value}`, C = (e) => {
50
+ if (e.key === "Escape" && (o.disabled || o.persistent))
51
+ return e.preventDefault(), a.value = !0, h(200).then(() => {
52
+ a.value = !1;
53
+ }), !1;
54
+ }, _ = async (e) => {
55
+ var i, B, L, M;
56
+ e ? ((i = window.globalThis) != null && i.document && !document.documentElement.style.getPropertyValue("--scrollbar-width") && (document.documentElement.style.setProperty(
57
+ "--scrollbar-width",
58
+ `${I()}px`
59
+ ), document.addEventListener("keydown", C)), (B = n.value) == null || B.showModal(), o.focusTarget && Q(() => {
60
+ var $;
61
+ const m = ($ = n.value) == null ? void 0 : $.querySelector(o.focusTarget);
62
+ m && m instanceof HTMLElement && m.focus();
63
+ }), w("shown")) : (await h(o.transitionDuration), (L = window.globalThis) != null && L.document && document.removeEventListener("keydown", C), (M = n.value) == null || M.close(), w("hidden"));
77
64
  };
78
- re(
79
- () => l.modelValue,
80
- () => {
81
- !l.modelValue && !n.value || T && !globalThis.document || S();
82
- },
83
- { flush: "post" }
84
- );
85
- const m = (e) => {
86
- e.target === d.value && e.preventDefault();
87
- }, b = a(!1), ee = async (e) => {
88
- l.disabled || L.value || d.value && e.target === d.value && (l.persistent ? k.value && (b.value = !0, await g(100), b.value = !1) : u("update:modelValue", !1));
89
- }, x = () => {
90
- l.disabled || L.value || (D(), u("update:modelValue", !1));
91
- }, le = i(() => {
92
- const e = [
93
- {
94
- "bb-base-dialog bb-base-dialog__overlay": !0,
95
- "bb-base-dialog--fullscreen": M.value,
96
- "bb-base-dialog--faded": !G.value,
97
- "bb-base-dialog--open": v.value,
98
- "bb-base-dialog--opening": c.value,
99
- "bb-base-dialog--closed": C.value,
100
- "bb-base-dialog--closing": f.value,
101
- "bb-base-dialog--attempted-closing": b.value
102
- },
103
- l.overlayClasses
104
- ].flat(), t = {
105
- onClick: ee,
106
- onScroll: m,
107
- onTouchmove: m,
108
- onWheel: m,
109
- onKeydown: m
110
- }, s = {
111
- "--transition-duration": l.transitionDuration / 1e3 + "s"
112
- };
113
- return {
114
- class: e,
115
- style: s,
116
- ...t,
117
- ...Q
118
- };
119
- }), te = i(() => {
120
- const e = [
121
- {
122
- "bb-base-dialog__panel": !0,
123
- "bb-base-dialog__panel--compact": l.compact
124
- },
125
- l.panelClasses
126
- ].flat(), t = {
127
- role: "dialog",
128
- "aria-modal": !0,
129
- "aria-live": v.value ? "polite" : "off"
130
- };
131
- n.value && (l.title && (t["aria-labelledby"] = _), l.description && (t["aria-describedby"] = w));
132
- let s;
133
- const I = {
134
- sm: 384,
135
- md: 652,
136
- lg: 896
137
- };
138
- return M.value ? s = "100%" : typeof l.size == "number" ? s = l.size + "px" : l.size in I ? s = I[l.size] + "px" : s = l.size + "px", {
139
- class: e,
140
- style: {
141
- maxWidth: s
142
- },
143
- ...t
144
- };
65
+ A(l, _), H(() => {
66
+ l.value && _(!0);
145
67
  });
146
- return (e, t) => (y(), ue(ve, null, {
147
- default: W(() => [
148
- o("div", F(le.value, {
149
- ref_key: "overlay",
150
- ref: d
151
- }), [
152
- o("div", F(te.value, {
153
- ref_key: "panel",
154
- ref: k
155
- }), [
156
- n.value ? (y(), B("div", {
157
- key: 0,
158
- ref_key: "content",
159
- ref: U,
160
- class: "bb-base-dialog__content"
68
+ const W = p(() => k.value ? "100%" : X(o.size, {
69
+ sm: 384,
70
+ md: 652,
71
+ lg: 896
72
+ })), r = (e) => {
73
+ if (e.preventDefault(), o.disabled || o.persistent)
74
+ return a.value = !0, h(300).then(() => {
75
+ a.value = !1;
76
+ }), !1;
77
+ l.value = !1;
78
+ }, a = E(!1), I = () => globalThis.document ? window.innerWidth - document.documentElement.clientWidth : 0, { isMobile: F } = Z(), k = p(
79
+ () => o.fullscreen === !0 || o.fullscreen === "mobile" && F.value
80
+ );
81
+ return (e, i) => (u(), d("dialog", {
82
+ ref_key: "dialog",
83
+ ref: n,
84
+ "aria-describedby": v(c) && e.description ? f : void 0,
85
+ "aria-labelledby": v(c) && e.title ? b : void 0,
86
+ "aria-live": l.value ? "polite" : "off",
87
+ class: R([
88
+ "bb-base-dialog",
89
+ [
90
+ {
91
+ "bb-base-dialog--open": l.value,
92
+ "bb-base-dialog--fullscreen": k.value,
93
+ "bb-base-dialog--compact": e.compact,
94
+ "bb-base-dialog--deny-close": a.value
95
+ },
96
+ e.overlayClasses,
97
+ e.panelClasses
98
+ ].flat()
99
+ ]),
100
+ style: O({
101
+ "--max-width": W.value,
102
+ "--transition-duration": `${o.transitionDuration}ms`
103
+ }),
104
+ onCancel: r,
105
+ onClick: K(r, ["self"])
106
+ }, [
107
+ v(c) ? (u(), d(U, { key: 0 }, [
108
+ t("div", te, [
109
+ s(e.$slots, "header", {
110
+ close: r,
111
+ title: e.title,
112
+ titleId: b
113
+ }, () => [
114
+ t("span", {
115
+ id: b,
116
+ class: "bb-base-dialog__title"
161
117
  }, [
162
- o("div", {
163
- ref_key: "header",
164
- ref: j,
165
- class: "bb-base-dialog__header"
118
+ s(e.$slots, "title", { text: e.title }, () => [
119
+ j(T(e.title), 1)
120
+ ])
121
+ ]),
122
+ t("span", le, [
123
+ e.showClose ? (u(), d("button", {
124
+ key: 0,
125
+ "aria-label": N.value,
126
+ disabled: o.disabled,
127
+ type: "button",
128
+ onClick: r
166
129
  }, [
167
- r(e.$slots, "header", {
168
- close: x,
169
- title: e.title,
170
- titleId: _
171
- }, () => [
172
- o("span", {
173
- id: _,
174
- class: "bb-base-dialog__title"
175
- }, [
176
- r(e.$slots, "title", { text: e.title }, () => [
177
- de(E(e.title), 1)
178
- ])
179
- ]),
180
- o("span", ge, [
181
- e.showClose ? (y(), B("button", {
182
- key: 0,
183
- "aria-label": Y.value,
184
- type: "button",
185
- onClick: x
130
+ s(e.$slots, "close", {}, () => [
131
+ i[0] || (i[0] = t("span", { class: "bb-base-dialog__close-icon" }, [
132
+ t("svg", {
133
+ "aria-hidden": "true",
134
+ fill: "none",
135
+ viewBox: "0 0 24 24",
136
+ xmlns: "http://www.w3.org/2000/svg"
186
137
  }, [
187
- r(e.$slots, "close", {}, () => [
188
- t[0] || (t[0] = o("span", { class: "bb-base-dialog-close__icon" }, [
189
- o("svg", {
190
- "aria-hidden": "true",
191
- fill: "none",
192
- viewBox: "0 0 24 24",
193
- xmlns: "http://www.w3.org/2000/svg"
194
- }, [
195
- o("path", {
196
- d: "M23 23L1 1M23 1L1 23",
197
- stroke: "currentColor",
198
- "stroke-linecap": "round",
199
- "stroke-width": "3"
200
- })
201
- ])
202
- ], -1))
203
- ])
204
- ], 8, he)) : V("", !0)
205
- ])
138
+ t("path", {
139
+ d: "M23 23L1 1M23 1L1 23",
140
+ stroke: "currentColor",
141
+ "stroke-linecap": "round",
142
+ "stroke-width": "3"
143
+ })
144
+ ])
145
+ ], -1))
206
146
  ])
207
- ], 512),
208
- o("div", {
209
- ref_key: "body",
210
- ref: $,
211
- class: "bb-base-dialog__body scrollbar-border"
212
- }, [
213
- r(e.$slots, "description", {
214
- descriptionId: w,
215
- text: e.description
216
- }, () => [
217
- e.description ? (y(), B("div", {
218
- key: 0,
219
- id: w,
220
- class: "bb-base-dialog__description sr-only"
221
- }, E(e.description), 1)) : V("", !0)
222
- ]),
223
- ce(ye, { "transition-duration": 500 }, {
224
- default: W(() => [
225
- r(e.$slots, "default")
226
- ]),
227
- _: 3
228
- })
229
- ], 512),
230
- t[1] || (t[1] = o("div", { style: { flex: "10000 10000 0%" } }, null, -1)),
231
- o("div", {
232
- ref_key: "footer",
233
- ref: q,
234
- class: "bb-base-dialog__footer"
235
- }, [
236
- r(e.$slots, "footer")
237
- ], 512)
238
- ], 512)) : V("", !0)
239
- ], 16)
240
- ], 16)
241
- ]),
242
- _: 3
243
- }));
147
+ ], 8, se)) : g("", !0)
148
+ ])
149
+ ])
150
+ ], 512),
151
+ t("div", ae, [
152
+ s(e.$slots, "description", {
153
+ descriptionId: f,
154
+ text: e.description
155
+ }, () => [
156
+ e.description ? (u(), d("div", {
157
+ key: 0,
158
+ id: f,
159
+ class: "bb-base-dialog__description sr-only"
160
+ }, T(e.description), 1)) : g("", !0)
161
+ ]),
162
+ G(ee, { "transition-duration": 500 }, {
163
+ default: J(() => [
164
+ s(e.$slots, "default")
165
+ ]),
166
+ _: 3
167
+ })
168
+ ], 512),
169
+ t("div", ie, [
170
+ s(e.$slots, "footer")
171
+ ], 512)
172
+ ], 64)) : g("", !0)
173
+ ], 46, oe));
244
174
  }
245
175
  });
246
176
  export {
247
- Se as default
177
+ ve as default
248
178
  };
package/dist/index250.js CHANGED
@@ -1,9 +1,230 @@
1
- import { ref as e } from "vue";
2
- const o = e(0), s = () => {
3
- o.value++;
4
- }, a = () => {
5
- o.value--;
6
- }, d = () => ({ openedModals: o, modalHasOpened: s, modalHasClosed: a });
1
+ import { defineComponent as U, ref as f, computed as x, watch as E, createElementBlock as d, openBlock as p, withModifiers as X, normalizeStyle as h, normalizeClass as $, createElementVNode as c, renderSlot as m, createTextVNode as H, toDisplayString as g, unref as L, Fragment as Z, renderList as ee } from "vue";
2
+ import { isNil as b } from "./index262.js";
3
+ import { useVirtualizer as te } from "./index330.js";
4
+ import { isNotNil as oe } from "./index140.js";
5
+ import { hash as N } from "./index219.js";
6
+ import { useLocale as ne } from "./index235.js";
7
+ const le = { class: "bb-listbox__outer-container scrollbar-border" }, ie = {
8
+ key: 0,
9
+ class: "bb-listbox__loading"
10
+ }, se = {
11
+ key: 1,
12
+ class: "bb-listbox__no-data"
13
+ }, ae = ["aria-selected", "data-index"], ue = { class: "autocomplete-option__content" }, re = { class: "autocomplete-option__label" }, xe = /* @__PURE__ */ U({
14
+ __name: "ListBox",
15
+ props: {
16
+ compact: { type: Boolean },
17
+ options: {},
18
+ open: { type: Boolean },
19
+ loading: { type: Boolean },
20
+ multiple: { type: Boolean },
21
+ transitionDuration: { default: 250 },
22
+ loadingText: {},
23
+ noDataText: {}
24
+ },
25
+ emits: ["option:selected", "option:unselected"],
26
+ setup(V, { expose: z, emit: C }) {
27
+ const o = V, _ = C, { t: y } = ne(), s = f(null), O = (e) => "option_" + JSON.stringify(e).replace(/\W/g, "_"), i = x(
28
+ () => o.options.map((e) => ({ ...e, id: O(e.value) }))
29
+ ), v = te({
30
+ get count() {
31
+ return o.options.length;
32
+ },
33
+ getScrollElement: () => s.value,
34
+ estimateSize: () => 42,
35
+ overscan: 5
36
+ }), F = (e) => {
37
+ e && v.value.measureElement(e);
38
+ }, M = x(() => v.value.getVirtualItems()), A = x(() => v.value.getTotalSize()), n = f(null), a = x(
39
+ () => o.open && o.options.some((e) => !e.disabled)
40
+ ), I = (e = 1) => {
41
+ const l = b(n.value) ? -1 : n.value;
42
+ let t = (l + e) % o.options.length;
43
+ for (; o.options[t].disabled && t !== l; )
44
+ t = I(e + 1);
45
+ return t;
46
+ }, P = () => {
47
+ if (!a.value) return;
48
+ const e = I();
49
+ n.value = e, u();
50
+ }, S = (e = 1) => {
51
+ const l = b(n.value) ? 0 : n.value;
52
+ let t = (l - e + o.options.length) % o.options.length;
53
+ for (; o.options[t].disabled && t !== l; )
54
+ t = S(e + 1);
55
+ return t;
56
+ }, R = async () => {
57
+ if (!a.value) return;
58
+ const e = S();
59
+ n.value = e, u();
60
+ }, q = () => {
61
+ if (!a.value) return;
62
+ let e = 0;
63
+ for (; o.options[e].disabled; )
64
+ e++;
65
+ n.value = e, u();
66
+ }, J = () => {
67
+ if (!a.value) return;
68
+ let e = o.options.length - 1;
69
+ for (; o.options[e].disabled && e !== 0; )
70
+ e--;
71
+ n.value = e, u();
72
+ }, W = () => {
73
+ if (!a.value) return;
74
+ let e = 0;
75
+ for (; o.options[e] && !o.options[e].selected && o.options.length !== e; )
76
+ e++;
77
+ n.value = e % o.options.length, u();
78
+ }, Y = () => {
79
+ if (!a.value) return;
80
+ let e = o.options.length - 1;
81
+ for (; o.options[e].selected && e > 0; )
82
+ e--;
83
+ n.value = e === -1 ? o.options.length - 1 : e, u();
84
+ }, j = (e) => {
85
+ if (!a.value) return;
86
+ const l = o.options.findIndex(
87
+ (t) => t.valueHash === e
88
+ );
89
+ l >= 0 && (n.value = l), u();
90
+ }, k = () => {
91
+ n.value = null;
92
+ }, u = () => {
93
+ s.value && oe(n.value) && v.value.scrollToIndex(n.value, {
94
+ align: "center",
95
+ behavior: "smooth"
96
+ });
97
+ }, w = () => {
98
+ if (b(n.value) || !o.open) return;
99
+ const e = o.options[n.value];
100
+ e.selected ? _("option:unselected", e) : _("option:selected", e);
101
+ }, B = f(0), T = () => {
102
+ s.value && (B.value = s.value.scrollHeight);
103
+ }, G = (e) => !e.disabled, K = (e) => {
104
+ if (e.preventDefault(), s.value && e.target && e.target instanceof HTMLElement) {
105
+ if (!s.value.querySelector('[role="listbox"]'))
106
+ throw new Error("Could not find listbox in DOM tree.");
107
+ let t = e.target, r = t.dataset.index;
108
+ for (; b(r) && t.parentElement; )
109
+ t = t.parentElement, r = t.dataset.index;
110
+ if (r) {
111
+ const D = o.options[+r];
112
+ D && G(D) && (n.value = +r, w());
113
+ }
114
+ }
115
+ }, Q = () => b(n.value) ? void 0 : o.options[n.value];
116
+ return E(
117
+ () => o.open,
118
+ () => {
119
+ T();
120
+ },
121
+ { flush: "post" }
122
+ ), E(
123
+ () => o.options,
124
+ (e, l) => {
125
+ N(e.map((t) => t.valueHash)) !== N(l.map((t) => t.valueHash)) && (v.value.calculateRange(), T(), k());
126
+ },
127
+ {
128
+ flush: "post"
129
+ }
130
+ ), z({
131
+ focusNext: P,
132
+ focusPrevious: R,
133
+ focusFirst: q,
134
+ focusFirstSelected: W,
135
+ focusLast: J,
136
+ focusLastSelected: Y,
137
+ blur: k,
138
+ confirmOption: w,
139
+ focusByHash: j,
140
+ getHighlighted: Q
141
+ }), (e, l) => (p(), d("span", {
142
+ class: $(["bb-listbox", {
143
+ "bb-listbox--compact": e.compact,
144
+ "bb-listbox--loading": e.loading,
145
+ "bb-listbox--multiple": e.multiple,
146
+ "bb-listbox--no-data": !i.value.length,
147
+ "bb-listbox--open": e.open
148
+ }]),
149
+ style: h({
150
+ "--transition-duration": `${e.transitionDuration}ms`,
151
+ "--overlay-min-height": `${B.value}px`
152
+ }),
153
+ onClick: X(K, ["stop"])
154
+ }, [
155
+ c("span", le, [
156
+ c("span", {
157
+ ref_key: "inner",
158
+ ref: s,
159
+ class: "bb-listbox__inner-container"
160
+ }, [
161
+ m(e.$slots, "options:prepend"),
162
+ e.loading && !e.options.length ? (p(), d("span", ie, [
163
+ m(e.$slots, "loading", {}, () => [
164
+ H(g(e.loadingText || L(y)("common.loadingText").value), 1)
165
+ ])
166
+ ])) : e.options.length ? (p(), d("span", {
167
+ key: 2,
168
+ role: "listbox",
169
+ style: h({
170
+ height: `${A.value}px`
171
+ }),
172
+ tabindex: "-1"
173
+ }, [
174
+ (p(!0), d(Z, null, ee(M.value, (t, r) => (p(), d("span", {
175
+ key: i.value[t.index].value,
176
+ ref_for: !0,
177
+ ref: F,
178
+ "aria-selected": n.value === r ? !0 : void 0,
179
+ class: $({
180
+ "bb-listbox__option autocomplete-option": !0,
181
+ "autocomplete-option--focused": n.value === t.index,
182
+ "autocomplete-option--selected": i.value[t.index].selected,
183
+ "autocomplete-option--disabled": i.value[t.index].disabled
184
+ }),
185
+ "data-index": t.index,
186
+ role: "option",
187
+ style: h({
188
+ transform: `translateY(${t.start}px)`
189
+ })
190
+ }, [
191
+ c("span", ue, [
192
+ m(e.$slots, "option", {
193
+ disabled: !!i.value[t.index].disabled,
194
+ focused: n.value === t.index,
195
+ index: t.index,
196
+ item: i.value[t.index].item,
197
+ selected: !!i.value[t.index].selected,
198
+ text: i.value[t.index].text,
199
+ value: i.value[t.index].value
200
+ }, () => [
201
+ l[0] || (l[0] = c("svg", {
202
+ class: "autocomplete-option__checkbox",
203
+ role: "presentation",
204
+ viewBox: "276.411 158.834 114.971 114.97"
205
+ }, [
206
+ c("path", {
207
+ d: "M 297.574 224.786 L 318.309 243.134 L 371.568 189.232",
208
+ fill: "none",
209
+ "stroke-linecap": "round",
210
+ "stroke-width": "14px"
211
+ })
212
+ ], -1)),
213
+ c("span", re, g(i.value[t.index].text), 1)
214
+ ])
215
+ ])
216
+ ], 14, ae))), 128))
217
+ ], 4)) : (p(), d("span", se, [
218
+ m(e.$slots, "no-data", {}, () => [
219
+ H(g(e.noDataText || L(y)("common.noDataText").value), 1)
220
+ ])
221
+ ])),
222
+ m(e.$slots, "options:append")
223
+ ], 512)
224
+ ])
225
+ ], 6));
226
+ }
227
+ });
7
228
  export {
8
- d as useModalsState
229
+ xe as default
9
230
  };
package/dist/index251.js CHANGED
@@ -1,17 +1,15 @@
1
- import { defineComponent as a, getCurrentInstance as c, createBlock as l, openBlock as u, Teleport as f, unref as d, renderSlot as m } from "vue";
2
- const i = /* @__PURE__ */ a({
3
- __name: "BbTeleport",
4
- props: {
5
- target: {}
6
- },
7
- setup(o) {
8
- var t, e;
9
- const r = o, n = !!((e = (t = c()) == null ? void 0 : t.proxy) != null && e.$nuxt), p = r.target || (n ? "#teleports" : "body");
10
- return (s, _) => (u(), l(f, { to: d(p) }, [
11
- m(s.$slots, "default")
12
- ], 8, ["to"]));
1
+ const c = (t, r) => {
2
+ if (typeof t == "string") {
3
+ const e = /^(\d+)([a-zA-Z%]+)?$/, n = t.match(e);
4
+ if (n) {
5
+ const [, o, a] = n;
6
+ return a ? t : o + "px";
7
+ } else if (t in r)
8
+ return r[t] + "px";
9
+ throw new Error(`Invalid size: ${t}`);
13
10
  }
14
- });
11
+ return t + "px";
12
+ };
15
13
  export {
16
- i as default
14
+ c as parseSize
17
15
  };