bitboss-ui 2.1.106 → 2.1.108

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 (290) hide show
  1. package/dist/components/BaseButton/BaseButton.vue.d.ts +8 -9
  2. package/dist/components/BbRows/BbRows.vue.d.ts +3 -53
  3. package/dist/components/BbRows/types.d.ts +21 -0
  4. package/dist/index.css +1 -1
  5. package/dist/index.d.ts +3 -0
  6. package/dist/index.js +153 -150
  7. package/dist/index109.js +9 -9
  8. package/dist/index11.js +1 -1
  9. package/dist/index110.js +502 -163
  10. package/dist/index112.js +130 -55
  11. package/dist/index114.js +106 -48
  12. package/dist/index116.js +52 -34
  13. package/dist/index118.js +33 -93
  14. package/dist/index12.js +2 -2
  15. package/dist/index120.js +56 -92
  16. package/dist/index122.js +120 -352
  17. package/dist/index124.js +344 -531
  18. package/dist/index126.js +535 -104
  19. package/dist/index128.js +52 -46
  20. package/dist/index13.js +6 -6
  21. package/dist/index130.js +36 -41
  22. package/dist/index132.js +117 -22
  23. package/dist/index134.js +23 -160
  24. package/dist/index136.js +158 -115
  25. package/dist/index138.js +115 -64
  26. package/dist/index14.js +2 -2
  27. package/dist/index140.js +68 -12
  28. package/dist/index142.js +13 -2
  29. package/dist/index143.js +11 -419
  30. package/dist/index144.js +2 -9
  31. package/dist/index145.js +419 -9
  32. package/dist/index146.js +9 -25
  33. package/dist/index147.js +9 -2
  34. package/dist/index148.js +25 -5
  35. package/dist/index149.js +2 -6
  36. package/dist/index150.js +5 -5
  37. package/dist/index151.js +6 -3
  38. package/dist/index152.js +5 -3
  39. package/dist/index153.js +1 -1
  40. package/dist/index154.js +1 -1
  41. package/dist/index155.js +1 -1
  42. package/dist/index156.js +1 -1
  43. package/dist/index157.js +1 -1
  44. package/dist/index158.js +1 -1
  45. package/dist/index159.js +1 -1
  46. package/dist/index16.js +5 -5
  47. package/dist/index160.js +1 -1
  48. package/dist/index161.js +1 -1
  49. package/dist/index162.js +1 -1
  50. package/dist/index163.js +1 -1
  51. package/dist/index164.js +1 -1
  52. package/dist/index165.js +1 -1
  53. package/dist/index166.js +1 -1
  54. package/dist/index167.js +1 -1
  55. package/dist/index168.js +1 -1
  56. package/dist/index169.js +1 -1
  57. package/dist/index170.js +1 -1
  58. package/dist/index171.js +1 -1
  59. package/dist/index172.js +1 -1
  60. package/dist/index173.js +1 -1
  61. package/dist/index174.js +1 -1
  62. package/dist/index175.js +1 -1
  63. package/dist/index176.js +1 -1
  64. package/dist/index177.js +1 -1
  65. package/dist/index178.js +1 -1
  66. package/dist/index179.js +1 -1
  67. package/dist/index18.js +3 -3
  68. package/dist/index180.js +1 -1
  69. package/dist/index181.js +3 -2
  70. package/dist/index182.js +1 -1
  71. package/dist/index183.js +1 -1
  72. package/dist/index184.js +1 -1
  73. package/dist/index185.js +2 -3
  74. package/dist/index186.js +1 -1
  75. package/dist/index187.js +1 -1
  76. package/dist/index188.js +1 -1
  77. package/dist/index189.js +1 -1
  78. package/dist/index190.js +3 -2
  79. package/dist/index191.js +1 -1
  80. package/dist/index192.js +2 -3
  81. package/dist/index193.js +1 -1
  82. package/dist/index194.js +1 -1
  83. package/dist/index195.js +2 -2
  84. package/dist/index196.js +2 -2
  85. package/dist/index197.js +1 -1
  86. package/dist/index198.js +1 -1
  87. package/dist/index199.js +1 -1
  88. package/dist/index20.js +8 -8
  89. package/dist/index200.js +3 -2
  90. package/dist/index201.js +1 -1
  91. package/dist/index202.js +2 -3
  92. package/dist/index203.js +1 -1
  93. package/dist/index204.js +1 -1
  94. package/dist/index205.js +1 -1
  95. package/dist/index206.js +1 -1
  96. package/dist/index207.js +1 -1
  97. package/dist/index208.js +1 -1
  98. package/dist/index209.js +1 -1
  99. package/dist/index210.js +1 -1
  100. package/dist/index211.js +1 -1
  101. package/dist/index212.js +1 -1
  102. package/dist/index213.js +1 -1
  103. package/dist/index214.js +1 -1
  104. package/dist/index215.js +1 -1
  105. package/dist/index216.js +5 -0
  106. package/dist/index217.js +3 -7
  107. package/dist/index218.js +3 -2
  108. package/dist/index22.js +13 -13
  109. package/dist/index220.js +7 -2
  110. package/dist/index221.js +137 -4
  111. package/dist/index222.js +2 -8
  112. package/dist/index223.js +2 -33
  113. package/dist/index224.js +33 -28
  114. package/dist/index225.js +30 -0
  115. package/dist/index227.js +5 -5
  116. package/dist/index228.js +8 -5
  117. package/dist/index229.js +34 -5
  118. package/dist/index230.js +86 -3
  119. package/dist/index232.js +30 -6
  120. package/dist/index233.js +17 -8
  121. package/dist/index234.js +49 -266
  122. package/dist/index235.js +18 -52
  123. package/dist/index236.js +3 -52
  124. package/dist/index237.js +12 -32
  125. package/dist/index238.js +18 -60
  126. package/dist/index239.js +2 -2
  127. package/dist/index24.js +11 -11
  128. package/dist/index240.js +25 -86
  129. package/dist/index241.js +11 -0
  130. package/dist/index242.js +2 -30
  131. package/dist/index243.js +20 -16
  132. package/dist/index244.js +5 -51
  133. package/dist/index245.js +5 -18
  134. package/dist/index246.js +5 -12
  135. package/dist/index247.js +5 -18
  136. package/dist/index248.js +5 -13
  137. package/dist/index249.js +5 -13
  138. package/dist/index250.js +3 -3
  139. package/dist/index251.js +8 -4
  140. package/dist/index252.js +133 -18
  141. package/dist/index254.js +2 -2
  142. package/dist/index255.js +4 -2
  143. package/dist/index256.js +188 -3
  144. package/dist/index257.js +3 -135
  145. package/dist/index258.js +6 -0
  146. package/dist/index259.js +20 -4
  147. package/dist/index26.js +3 -3
  148. package/dist/index260.js +8 -22
  149. package/dist/index261.js +5 -4
  150. package/dist/index262.js +5 -3
  151. package/dist/index263.js +2 -18
  152. package/dist/index264.js +6 -12
  153. package/dist/index265.js +263 -101
  154. package/dist/index266.js +54 -0
  155. package/dist/index267.js +48 -96
  156. package/dist/index268.js +34 -0
  157. package/dist/index269.js +56 -103
  158. package/dist/index270.js +13 -2
  159. package/dist/index271.js +13 -11
  160. package/dist/index272.js +2 -7
  161. package/dist/index273.js +3 -6
  162. package/dist/index274.js +10 -16
  163. package/dist/index275.js +3 -3
  164. package/dist/index276.js +4 -9
  165. package/dist/index277.js +16 -51
  166. package/dist/index278.js +11 -9
  167. package/dist/index279.js +106 -3
  168. package/dist/index28.js +2 -2
  169. package/dist/index281.js +102 -0
  170. package/dist/index283.js +107 -23
  171. package/dist/index284.js +11 -5
  172. package/dist/index285.js +2 -67
  173. package/dist/index286.js +23 -5
  174. package/dist/index287.js +6 -5
  175. package/dist/index288.js +2 -5
  176. package/dist/index289.js +7 -2
  177. package/dist/index290.js +7 -7
  178. package/dist/index291.js +3 -7
  179. package/dist/index292.js +7 -25
  180. package/dist/index293.js +32 -187
  181. package/dist/index294.js +373 -3
  182. package/dist/index296.js +3 -21
  183. package/dist/index297.js +51 -31
  184. package/dist/index298.js +6 -9
  185. package/dist/index299.js +18 -0
  186. package/dist/index30.js +6 -6
  187. package/dist/index300.js +67 -3
  188. package/dist/index301.js +9 -280
  189. package/dist/index302.js +23 -2
  190. package/dist/index304.js +3 -2
  191. package/dist/index305.js +2 -16
  192. package/dist/index306.js +28 -2
  193. package/dist/index307.js +17 -27
  194. package/dist/index308.js +7 -2
  195. package/dist/index309.js +280 -2
  196. package/dist/index310.js +2 -2
  197. package/dist/index311.js +16 -2
  198. package/dist/index312.js +2 -2
  199. package/dist/index313.js +15 -27
  200. package/dist/index314.js +2 -2
  201. package/dist/index315.js +27 -7
  202. package/dist/index316.js +2 -3
  203. package/dist/index317.js +2 -17
  204. package/dist/index318.js +2 -4
  205. package/dist/index319.js +2 -5
  206. package/dist/index32.js +2 -2
  207. package/dist/index320.js +2 -3
  208. package/dist/index321.js +2 -5
  209. package/dist/index322.js +1 -1
  210. package/dist/index323.js +4 -3
  211. package/dist/index324.js +3 -2
  212. package/dist/index325.js +3 -719
  213. package/dist/index326.js +3 -366
  214. package/dist/index327.js +2 -57
  215. package/dist/index328.js +125 -3
  216. package/dist/index329.js +2 -2
  217. package/dist/index330.js +13 -123
  218. package/dist/index331.js +2 -2
  219. package/dist/index332.js +16 -12
  220. package/dist/index334.js +5 -19
  221. package/dist/index335.js +5 -2
  222. package/dist/index336.js +3 -6
  223. package/dist/index337.js +5 -3
  224. package/dist/index338.js +4 -2
  225. package/dist/index339.js +2 -2
  226. package/dist/index34.js +8 -8
  227. package/dist/index340.js +6 -6
  228. package/dist/index341.js +2 -19
  229. package/dist/index342.js +67 -9
  230. package/dist/index343.js +66 -14
  231. package/dist/index344.js +719 -93
  232. package/dist/index345.js +366 -7
  233. package/dist/index346.js +56 -66
  234. package/dist/index347.js +7 -67
  235. package/dist/index348.js +18 -34
  236. package/dist/index349.js +9 -6
  237. package/dist/index350.js +12 -126
  238. package/dist/index351.js +198 -396
  239. package/dist/index352.js +208 -149
  240. package/dist/index353.js +34 -258
  241. package/dist/index354.js +123 -222
  242. package/dist/index355.js +398 -22
  243. package/dist/index356.js +230 -0
  244. package/dist/index357.js +21 -1
  245. package/dist/index359.js +2 -134
  246. package/dist/index36.js +4 -4
  247. package/dist/index360.js +2 -441
  248. package/dist/index361.js +91 -126
  249. package/dist/index362.js +131 -44
  250. package/dist/index363.js +44 -67
  251. package/dist/index364.js +66 -516
  252. package/dist/index365.js +435 -44
  253. package/dist/index366.js +130 -0
  254. package/dist/index367.js +522 -0
  255. package/dist/index368.js +52 -0
  256. package/dist/index38.js +24 -24
  257. package/dist/index40.js +8 -8
  258. package/dist/index42.js +2 -2
  259. package/dist/index44.js +8 -8
  260. package/dist/index46.js +9 -9
  261. package/dist/index48.js +4 -4
  262. package/dist/index50.js +4 -4
  263. package/dist/index56.js +2 -2
  264. package/dist/index58.js +2 -2
  265. package/dist/index60.js +2 -2
  266. package/dist/index62.js +6 -6
  267. package/dist/index7.js +2 -2
  268. package/dist/index74.js +3 -3
  269. package/dist/index75.js +1 -1
  270. package/dist/index82.js +8 -8
  271. package/dist/index84.js +1 -1
  272. package/dist/index86.js +3 -3
  273. package/dist/index88.js +3 -3
  274. package/dist/index9.js +1 -1
  275. package/dist/index90.js +1 -1
  276. package/dist/index93.js +3 -3
  277. package/dist/index95.js +2 -2
  278. package/dist/index97.js +5 -5
  279. package/dist/index99.js +2 -2
  280. package/package.json +1 -1
  281. package/dist/index141.js +0 -13
  282. package/dist/index219.js +0 -140
  283. package/dist/index226.js +0 -7
  284. package/dist/index231.js +0 -4
  285. package/dist/index253.js +0 -4
  286. package/dist/index280.js +0 -375
  287. package/dist/index282.js +0 -11
  288. package/dist/index295.js +0 -36
  289. package/dist/index303.js +0 -18
  290. package/dist/index358.js +0 -4
package/dist/index110.js CHANGED
@@ -1,191 +1,530 @@
1
- import { defineComponent as f, ref as y, computed as g, createBlock as v, openBlock as B, withCtx as a, createVNode as $, mergeProps as w, renderSlot as n, normalizeProps as l, guardReactiveProps as i } from "vue";
2
- import T from "./index28.js";
3
- /* empty css */
4
- import V from "./index38.js";
5
- /* empty css */
6
- const F = /* @__PURE__ */ f({
7
- __name: "BbSelect",
1
+ import { defineComponent as at, ref as f, computed as l, watch as Q, toRef as X, onBeforeUnmount as rt, createElementBlock as Y, openBlock as Z, Fragment as nt, renderSlot as m, createCommentVNode as it, createVNode as F, normalizeProps as ye, mergeProps as ge, normalizeStyle as lt, normalizeClass as st, withCtx as g, createElementVNode as L, withDirectives as ut, withKeys as h, withModifiers as d, unref as I, vModelDynamic as ct, guardReactiveProps as dt, nextTick as we } from "vue";
2
+ import { extractDomContainer as pt } from "./index276.js";
3
+ import { get as vt } from "./index284.js";
4
+ import { hash as ee } from "./index236.js";
5
+ import { isNil as ft } from "./index242.js";
6
+ import { matchAnyKey as Be } from "./index277.js";
7
+ import { parseWidthString as mt } from "./index286.js";
8
+ import { useArray as ht } from "./index278.js";
9
+ import { useBaseOptions as bt } from "./index234.js";
10
+ import { useCoherence as yt } from "./index235.js";
11
+ import { useElementSize as gt, useIntersectionObserver as wt } from "./index145.js";
12
+ import { useHashedWatcher as Ae } from "./index237.js";
13
+ import { useId as Bt } from "./index8.js";
14
+ import { useIndexById as Ie } from "./index233.js";
15
+ import { useItemsGetter as At } from "./index232.js";
16
+ import { useMobile as It } from "./index9.js";
17
+ import { usePrefill as Vt } from "./index238.js";
18
+ import { useUntil as xt } from "./index271.js";
19
+ import { wait as C } from "./index144.js";
20
+ /* empty css */
21
+ /* empty css */
22
+ import Et from "./index118.js";
23
+ /* empty css */
24
+ import St from "./index252.js";
25
+ /* empty css */
26
+ import kt from "./index224.js";
27
+ import Dt from "./index283.js";
28
+ import { waitFor as Lt } from "./index287.js";
29
+ const Ct = {
30
+ key: 0,
31
+ class: "bb-select-popover__search-container"
32
+ }, Ht = ["id", "aria-activedescendant", "aria-controls", "aria-describedby", "aria-invalid", "aria-label", "autocomplete", "inputmode", "tabindex", "onKeydown"], Pt = ["aria-controls", "aria-describedby", "aria-invalid", "aria-label", "onKeydown"], $t = ["aria-hidden", "inert"], Ft = ["aria-hidden", "inert"], co = /* @__PURE__ */ at({
33
+ __name: "BbSelectPopover",
8
34
  props: {
35
+ activator: {},
9
36
  allowWriting: { type: [Boolean, String], default: !0 },
10
- "append:icon": {},
11
- autocomplete: {},
12
- autofocus: {},
13
- clearable: { type: Boolean },
14
- comma: { type: Boolean },
37
+ autocomplete: { default: "off" },
15
38
  compact: { type: Boolean },
16
- dependencies: {},
17
- depsDebounceTime: {},
18
- direction: {},
39
+ arrowPadding: { default: 10 },
40
+ boundary: {},
41
+ dependencies: { default: () => [] },
42
+ depsDebounceTime: { default: 0 },
19
43
  disabled: { type: Boolean },
44
+ hasErrors: { type: Boolean },
45
+ ariaInvalid: { type: Boolean },
46
+ ariaDescribedby: {},
47
+ flip: { type: Boolean, default: !0 },
48
+ hideArrow: { type: Boolean, default: !0 },
20
49
  enforceCoherence: { type: Boolean },
21
- errors: {},
22
50
  filterBy: { type: [String, Array, Boolean, Function, null], default: () => [] },
23
51
  groupBy: {},
24
- hasErrors: { type: Boolean },
25
- hideLabel: { type: Boolean },
26
- hint: {},
52
+ headerHeight: {},
27
53
  id: {},
28
54
  items: {},
29
- headerHeight: {},
30
55
  itemHeight: {},
31
56
  itemText: {},
32
57
  itemValue: {},
33
- label: {},
34
- labelPosition: {},
35
58
  loading: { type: Boolean },
36
59
  loadingText: {},
37
- max: {},
38
- maxSelectedLabels: {},
60
+ max: { default: 1 / 0 },
39
61
  modelValue: {},
40
- modelValueDebounceTime: {},
62
+ modelValueDebounceTime: { default: 0 },
41
63
  multiple: { type: Boolean },
42
- name: {},
43
64
  noDataText: {},
44
- persistentHint: { type: Boolean },
45
- placeholder: {},
46
- prefill: { type: [Boolean, String], default: "focus" },
47
- "prepend:icon": {},
48
- required: { type: Boolean },
49
- queryDebounceTime: {},
65
+ offset: { default: 4 },
66
+ padding: { default: 10 },
67
+ placement: { default: "bottom" },
68
+ prefill: { type: [Boolean, String], default: "interaction" },
69
+ queryDebounceTime: { default: 500 },
50
70
  readonly: { type: Boolean },
51
- reverse: { type: Boolean },
52
- selectedLabelsFn: {},
53
- showChevron: { type: Boolean, default: !0 },
71
+ searchInputAriaLabel: {},
54
72
  stash: { type: Boolean },
55
- transitionDuration: {},
56
- updateOnAnimationFrame: { type: Boolean }
73
+ transitionDuration: { default: 300 },
74
+ width: { default: "200" }
57
75
  },
58
76
  emits: ["blur", "change", "click", "focus", "inactive", "input", "update:modelValue", "option:add"],
59
- setup(d, { emit: u }) {
60
- const r = d, t = u, s = y(!1), m = g(() => r.persistentHint || s.value), h = {
61
- onBlur: (e) => t("blur", e),
62
- onChange: (e) => t("change", e),
63
- onClick: (e) => t("click", e),
64
- "onOption:add": (e) => t("option:add", e),
65
- onFocus: (e) => {
66
- s.value = !0, t("focus", e);
77
+ setup(Ve, { emit: xe }) {
78
+ const t = Ve, s = xe;
79
+ if (t.multiple && !Array.isArray(t.modelValue))
80
+ throw new Error('Multiple is set to "true" but modelValue is not an array.');
81
+ const v = f(), c = f(null), O = f(null), T = f(null), H = f(), { width: w } = gt(
82
+ v,
83
+ { width: 0, height: 0 },
84
+ {
85
+ box: "border-box"
86
+ }
87
+ ), Ee = l(() => t.activator != null), te = (e) => {
88
+ const o = pt(e);
89
+ o && (v.value = o);
90
+ };
91
+ Q(
92
+ () => t.activator,
93
+ (e) => {
94
+ e && te(e);
67
95
  },
68
- onInactive: () => {
69
- s.value = !1, t("inactive");
96
+ { immediate: !0 }
97
+ );
98
+ const { isMobile: oe } = It(), b = l(() => t.allowWriting === "not-mobile" ? !oe.value : !!t.allowWriting), Se = l(
99
+ () => t.allowWriting === "not-mobile" && oe.value ? "none" : void 0
100
+ ), ae = l(
101
+ () => t.searchInputAriaLabel ?? "Search options"
102
+ ), V = t.id || Bt().id.value, _ = l(() => t.ariaInvalid ?? !!t.hasErrors ? "true" : void 0), z = l(() => {
103
+ const e = t.ariaDescribedby;
104
+ if (Array.isArray(e))
105
+ return e.map((r) => r.trim()).filter(Boolean).join(" ") || void 0;
106
+ if (typeof e == "string")
107
+ return e.trim() || void 0;
108
+ }), { resume: ke, pause: De } = wt(
109
+ v,
110
+ async ([{ intersectionRatio: e }]) => {
111
+ e !== 1 && a.value && await A();
70
112
  },
71
- onInput: (e) => t("input", e),
72
- "onUpdate:modelValue": (e) => t("update:modelValue", e)
113
+ { threshold: [0, 1], immediate: !1 }
114
+ ), Le = l(() => {
115
+ if (t.width === "auto") return "auto";
116
+ if (t.width == null || t.width === "")
117
+ return w.value ? `${w.value}px` : "320px";
118
+ try {
119
+ const { value: e, unit: o } = mt(t.width);
120
+ return o === "%" ? w.value ? `${w.value * (e / 100)}px` : "320px" : `${e}${o}`;
121
+ } catch {
122
+ return typeof t.width == "string" ? t.width.trim() : w.value ? `${w.value}px` : "320px";
123
+ }
124
+ }), Ce = l(() => ({
125
+ "--bb-select-popover-width": Le.value
126
+ })), W = () => {
127
+ v.value?.focus();
128
+ }, x = () => {
129
+ O.value instanceof HTMLInputElement && O.value.focus();
130
+ }, K = () => {
131
+ T.value instanceof HTMLButtonElement && T.value.focus();
132
+ }, E = () => {
133
+ if (b.value) {
134
+ x();
135
+ return;
136
+ }
137
+ K();
138
+ }, He = (e) => {
139
+ s("focus", e), $();
140
+ }, Pe = (e) => {
141
+ s("blur", e), be();
142
+ }, $e = (e) => {
143
+ s("change", e);
144
+ }, Fe = (e) => {
145
+ $();
146
+ }, Oe = (e) => {
147
+ s("input", e), ze(i.value, !1, t.modelValue);
148
+ }, Te = (e) => {
149
+ H.value = e;
150
+ }, B = async (e) => {
151
+ const o = e.target instanceof Element ? e.target : e.target instanceof Text ? e.target.parentElement : null;
152
+ if (!o) return;
153
+ const r = v.value?.contains(o), n = !!o.closest(".bb-common-popover");
154
+ r || n || (await A(), he());
155
+ }, M = l(() => !(t.readonly || t.disabled || S.value)), q = async () => Lt(() => !!c.value, 100), re = () => {
156
+ const e = y.value[0];
157
+ if (e?.valueHash) {
158
+ c.value?.focusByHash(e.valueHash);
159
+ return;
160
+ }
161
+ c.value?.focusFirstSelected();
162
+ }, _e = () => {
163
+ const e = y.value[y.value.length - 1];
164
+ if (e?.valueHash) {
165
+ c.value?.focusByHash(e.valueHash);
166
+ return;
167
+ }
168
+ c.value?.focusLastSelected();
169
+ }, U = async () => {
170
+ M.value && (a.value ? c.value?.focusPrevious() : (await k({ focusPopoverContent: !1 }), await q(), await C(t.transitionDuration), _e()));
171
+ }, N = async () => {
172
+ M.value && (a.value ? c.value?.focusNext() : (await k({ focusPopoverContent: !1 }), await q(), await C(t.transitionDuration), re()));
173
+ }, j = async () => {
174
+ if (!M.value)
175
+ return;
176
+ if (a.value) {
177
+ if (c.value?.getHighlighted()) {
178
+ c.value.confirmOption();
179
+ return;
180
+ }
181
+ } else {
182
+ await k({ focusPopoverContent: !1 }), await q(), await C(t.transitionDuration), y.value.length ? re() : b.value ? x() : K();
183
+ return;
184
+ }
185
+ if (!b.value) return;
186
+ const e = i.value.trim();
187
+ Ge(e) || (s("option:add", e), i.value = "");
188
+ }, G = async () => {
189
+ a.value && (await A(), W());
190
+ }, i = f(""), ne = f(!1), {
191
+ getter: R,
192
+ debouncedGetter: ze,
193
+ items: We,
194
+ loading: Ke
195
+ } = At({
196
+ items: X(t, "items"),
197
+ debounce: t.queryDebounceTime
198
+ }), {
199
+ array: ie,
200
+ add: le,
201
+ remove: Me,
202
+ set: qe
203
+ } = ht(), {
204
+ hasPrefilled: Ue,
205
+ isPrefilling: Ne,
206
+ canLoad: se,
207
+ prefill: je
208
+ } = Vt({
209
+ trigger: l(
210
+ () => t.prefill === !0 || t.prefill === "interaction" && ne.value
211
+ ),
212
+ currentValue: void 0,
213
+ multiple: !1,
214
+ fn: async (e) => {
215
+ await R(i.value, e, t.modelValue), t.stash && le(...P.value.map((o) => o.item));
216
+ }
217
+ }), { data: ue, get: Ge } = Ie({
218
+ items: l(() => [].concat(t.modelValue))
219
+ }), { options: P } = bt({
220
+ disabled: X(t, "disabled"),
221
+ items: l(() => [...We.value, ...ie.value]),
222
+ itemText: t.itemText,
223
+ itemValue: t.itemValue,
224
+ max: t.max,
225
+ selectable: !0,
226
+ selectedIndexedByHash: ue
227
+ }), { data: ce } = Ie({
228
+ items: P,
229
+ key: "valueHash"
230
+ }), { coherent: de, coherentValue: pe } = yt({
231
+ modelValue: X(t, "modelValue"),
232
+ multiple: t.multiple,
233
+ iteratee: (e) => !!ce.value[ee(e)]
234
+ }), y = l(
235
+ () => [].concat(t.modelValue).map((e) => ce.value[ee(e)]).filter(Boolean)
236
+ ), S = l(() => !!(Ke.value || t.loading)), Re = l(() => !!t.hasErrors), Je = l(() => t.multiple ? "" : y.value[0]?.text ?? "");
237
+ Ae(
238
+ () => t.modelValue,
239
+ async () => {
240
+ se.value && (de.value || (await R(i.value, !0, t.modelValue), t.enforceCoherence && (s("update:modelValue", pe.value), c.value?.blur())));
241
+ },
242
+ { debounce: t.modelValueDebounceTime }
243
+ ), Ae(
244
+ () => [t.dependencies, t.items],
245
+ async () => {
246
+ se.value && (await R(i.value, !0, t.modelValue), t.enforceCoherence && !de.value && (s("update:modelValue", pe.value), c.value?.blur()));
247
+ },
248
+ { debounce: t.depsDebounceTime }
249
+ );
250
+ const Qe = async (e) => {
251
+ t.multiple ? (s("update:modelValue", t.modelValue.concat(e.value)), t.stash && le(e.item)) : (t.stash && qe(e.item), s("update:modelValue", e.value), await we()), t.multiple && b.value && a.value ? x() : W(), t.multiple || A();
252
+ }, Xe = async (e) => {
253
+ if (Me((o) => o.valueHash !== e.valueHash), t.multiple) {
254
+ const o = { ...ue.value };
255
+ delete o[e.valueHash], s("update:modelValue", Object.values(o));
256
+ } else
257
+ s("update:modelValue", null);
258
+ t.multiple && b.value && a.value ? x() : W();
259
+ }, ve = l(() => {
260
+ const e = y.value.some(
261
+ (n) => n.text === i.value
262
+ );
263
+ if (!(t.multiple && i.value || t.filterBy === "not_stashed" && i.value || i.value && !e && !t.multiple) || !t.filterBy) return P.value;
264
+ const r = t.filterBy === "not_stashed" ? new Set(ie.value.map((n) => n.valueHash)) : null;
265
+ return P.value.filter((n) => {
266
+ let p = !1;
267
+ return typeof t.filterBy == "function" ? p = t.filterBy(n.value, n.item, i.value) : t.filterBy === "not_stashed" && i.value ? p = !r.has(n.valueHash) : Array.isArray(t.filterBy) && t.filterBy.length && (p = Be(
268
+ n.item,
269
+ t.filterBy,
270
+ i.value.trim()
271
+ )), p || Be(n, ["text"], i.value.trim());
272
+ });
273
+ }), Ye = Symbol("default"), Ze = (e) => ft(t.groupBy) ? Ye : typeof t.groupBy == "function" ? t.groupBy(e.item) : vt(e.item, t.groupBy), et = l(() => {
274
+ const e = {};
275
+ for (const o of ve.value) {
276
+ const r = Ze(o), n = ee(r);
277
+ e[n] || (e[n] = {
278
+ id: n,
279
+ data: r ?? null,
280
+ options: []
281
+ }), e[n].options.push(o);
282
+ }
283
+ return Object.values(e).filter((o) => o.options.length);
284
+ }), a = f(!1), fe = xt(a), k = async ({
285
+ focusPopoverContent: e = !0
286
+ } = {}) => {
287
+ t.disabled || t.readonly || a.value || (ne.value = !0, ke(), a.value = !0, !Ue.value && !Ne.value && await je(), await we(), document.addEventListener("click", B), document.addEventListener("focusin", B), e && (b.value ? (await C(0), x()) : (await C(0), K())));
288
+ }, A = async () => {
289
+ a.value && (a.value = !1, c.value?.blur(), H.value = void 0, De(), document.removeEventListener("click", B), document.removeEventListener("focusin", B), i.value = "");
290
+ }, me = () => a.value ? A() : k(), J = f(!1), $ = () => {
291
+ J.value = !0;
292
+ }, he = () => {
293
+ J.value && (J.value = !1, s("inactive"));
294
+ }, tt = (e) => {
295
+ if (!(e instanceof Node)) return !1;
296
+ const o = !!v.value?.contains(e), r = !!c.value?.$el?.closest(".bb-common-popover")?.contains(e);
297
+ return o || r;
298
+ }, be = () => {
299
+ setTimeout(() => {
300
+ if (tt(document.activeElement)) {
301
+ $();
302
+ return;
303
+ }
304
+ he();
305
+ }, 0);
306
+ }, ot = () => {
307
+ s("update:modelValue", t.multiple ? [] : null);
73
308
  };
74
- return (e, D) => (B(), v(T, {
75
- id: e.id,
76
- class: "bb-select",
77
- compact: e.compact,
78
- direction: e.direction,
79
- errors: e.errors,
80
- "has-errors": e.hasErrors,
81
- "hide-label": e.hideLabel,
82
- hint: e.hint,
83
- label: e.label,
84
- "label-position": e.labelPosition,
85
- "model-value": e.modelValue,
86
- name: e.name,
87
- reverse: e.reverse,
88
- "show-hint": m.value
89
- }, {
90
- label: a((p) => [
91
- n(e.$slots, "label", l(i(p)))
92
- ]),
93
- input: a(({ id: p, hasErrors: c, ariaDescribedby: b }) => [
94
- $(V, w({
95
- id: p,
96
- "allow-writing": e.allowWriting,
97
- "append:icon": r["append:icon"],
98
- "aria-describedby": b,
99
- autocomplete: e.autocomplete,
100
- autofocus: e.autofocus,
101
- clearable: e.clearable,
102
- comma: e.comma,
103
- compact: e.compact,
104
- dependencies: e.dependencies,
105
- "deps-debounce-time": e.depsDebounceTime,
106
- disabled: e.disabled,
107
- "enforce-coherence": e.enforceCoherence,
108
- "filter-by": e.filterBy,
109
- "group-by": e.groupBy,
110
- "has-errors": c,
111
- "header-height": e.headerHeight,
112
- "item-height": e.itemHeight,
113
- "item-text": e.itemText,
114
- "item-value": e.itemValue,
115
- items: e.items,
116
- loading: e.loading,
117
- "loading-text": e.loadingText,
118
- max: e.max,
119
- "max-selected-labels": e.maxSelectedLabels,
120
- "model-value": e.modelValue,
121
- "model-value-debounce-time": e.modelValueDebounceTime,
122
- multiple: e.multiple,
123
- name: e.name,
124
- "no-data-text": e.noDataText,
125
- placeholder: e.placeholder,
126
- prefill: e.prefill,
127
- "prepend:icon": r["prepend:icon"],
128
- "query-debounce-time": e.queryDebounceTime,
129
- readonly: e.readonly,
130
- required: e.required,
131
- "selected-labels-fn": e.selectedLabelsFn,
132
- "show-chevron": e.showChevron,
133
- stash: e.stash,
134
- "transition-duration": e.transitionDuration,
135
- "update-on-animation-frame": e.updateOnAnimationFrame
136
- }, h), {
137
- "append-outer": a((o) => [
138
- n(e.$slots, "append-outer", l(i(o)))
139
- ]),
140
- append: a((o) => [
141
- n(e.$slots, "append", l(i(o)))
142
- ]),
143
- prefix: a((o) => [
144
- n(e.$slots, "prefix", l(i(o)))
145
- ]),
146
- chevron: a((o) => [
147
- n(e.$slots, "chevron", l(i(o)))
148
- ]),
149
- loading: a((o) => [
150
- n(e.$slots, "loading", l(i(o)))
151
- ]),
152
- "no-data": a((o) => [
153
- n(e.$slots, "no-data", l(i(o)))
154
- ]),
155
- option: a((o) => [
156
- n(e.$slots, "option", l(i(o)))
157
- ]),
158
- group: a((o) => [
159
- n(e.$slots, "group", l(i(o)))
160
- ]),
161
- "options:append": a((o) => [
162
- n(e.$slots, "options:append", l(i(o)))
163
- ]),
164
- "options:append:outer": a((o) => [
165
- n(e.$slots, "options:append:outer", l(i(o)))
166
- ]),
167
- "options:prepend": a((o) => [
168
- n(e.$slots, "options:prepend", l(i(o)))
169
- ]),
170
- "options:prepend:outer": a((o) => [
171
- n(e.$slots, "options:prepend:outer", l(i(o)))
172
- ]),
173
- "prepend-outer": a((o) => [
174
- n(e.$slots, "prepend-outer", l(i(o)))
175
- ]),
176
- prepend: a((o) => [
177
- n(e.$slots, "prepend", l(i(o)))
178
- ]),
179
- suffix: a((o) => [
180
- n(e.$slots, "suffix", l(i(o)))
181
- ]),
182
- _: 2
183
- }, 1040, ["id", "allow-writing", "append:icon", "aria-describedby", "autocomplete", "autofocus", "clearable", "comma", "compact", "dependencies", "deps-debounce-time", "disabled", "enforce-coherence", "filter-by", "group-by", "has-errors", "header-height", "item-height", "item-text", "item-value", "items", "loading", "loading-text", "max", "max-selected-labels", "model-value", "model-value-debounce-time", "multiple", "name", "no-data-text", "placeholder", "prefill", "prepend:icon", "query-debounce-time", "readonly", "required", "selected-labels-fn", "show-chevron", "stash", "transition-duration", "update-on-animation-frame"])
184
- ]),
185
- _: 3
186
- }, 8, ["id", "compact", "direction", "errors", "has-errors", "hide-label", "hint", "label", "label-position", "model-value", "name", "reverse", "show-hint"]));
309
+ let D = null;
310
+ return Q(
311
+ v,
312
+ (e) => {
313
+ if (D && (D(), D = null), !e) return;
314
+ e.setAttribute("role", "combobox"), e.setAttribute("aria-haspopup", "listbox");
315
+ const o = (u) => {
316
+ s("click", u), !(t.disabled || t.readonly) && (u.preventDefault(), me());
317
+ }, r = (u) => {
318
+ switch (u.key) {
319
+ case "ArrowDown":
320
+ u.preventDefault(), N();
321
+ break;
322
+ case "ArrowUp":
323
+ u.preventDefault(), U();
324
+ break;
325
+ case "Enter":
326
+ u.preventDefault(), j();
327
+ break;
328
+ case "Escape":
329
+ a.value && (u.preventDefault(), G());
330
+ break;
331
+ }
332
+ }, n = (u) => {
333
+ s("focus", u), $();
334
+ }, p = (u) => {
335
+ s("blur", u), be();
336
+ };
337
+ e.addEventListener("click", o), e.addEventListener("keydown", r), e.addEventListener("focus", n), e.addEventListener("blur", p), D = () => {
338
+ e.removeEventListener("click", o), e.removeEventListener("keydown", r), e.removeEventListener("focus", n), e.removeEventListener("blur", p), e.removeAttribute("role"), e.removeAttribute("aria-haspopup"), e.removeAttribute("aria-expanded"), e.removeAttribute("aria-controls"), e.removeAttribute("aria-invalid"), e.removeAttribute("aria-describedby"), e.removeAttribute("aria-activedescendant");
339
+ };
340
+ },
341
+ { immediate: !0 }
342
+ ), Q(
343
+ [
344
+ v,
345
+ a,
346
+ fe,
347
+ _,
348
+ z,
349
+ H
350
+ ],
351
+ ([e, o, r, n, p, u]) => {
352
+ e && (e.setAttribute("aria-expanded", String(o)), n != null ? e.setAttribute("aria-invalid", n) : e.removeAttribute("aria-invalid"), r ? e.setAttribute("aria-controls", `${V}_listbox`) : e.removeAttribute("aria-controls"), p != null ? e.setAttribute("aria-describedby", p) : e.removeAttribute("aria-describedby"), o && u ? e.setAttribute("aria-activedescendant", u) : e.removeAttribute("aria-activedescendant"));
353
+ },
354
+ { immediate: !0 }
355
+ ), rt(() => {
356
+ D?.(), document.removeEventListener("click", B), document.removeEventListener("focusin", B);
357
+ }), (e, o) => (Z(), Y(nt, null, [
358
+ Ee.value ? it("", !0) : m(e.$slots, "activator", ye(ge({ key: 0 }, {
359
+ props: {
360
+ ref: te
361
+ },
362
+ shown: a.value,
363
+ disabled: e.disabled,
364
+ readonly: e.readonly,
365
+ loading: S.value,
366
+ query: i.value,
367
+ selectedOptions: y.value,
368
+ text: Je.value,
369
+ clear: ot,
370
+ open: k,
371
+ close: A,
372
+ toggle: me
373
+ }))),
374
+ F(St, {
375
+ modelValue: a.value,
376
+ "onUpdate:modelValue": o[1] || (o[1] = (r) => a.value = r),
377
+ anchor: v.value,
378
+ "arrow-padding": e.arrowPadding,
379
+ boundary: e.boundary,
380
+ class: st(["bb-select-popover", {
381
+ "bb-select-popover--errors": Re.value,
382
+ "bb-select-popover--loading": S.value
383
+ }]),
384
+ flip: e.flip,
385
+ placement: e.placement,
386
+ offset: e.offset,
387
+ padding: e.padding,
388
+ "transition-duration": e.transitionDuration,
389
+ "hide-arrow": e.hideArrow,
390
+ style: lt(Ce.value)
391
+ }, {
392
+ default: g(() => [
393
+ b.value ? (Z(), Y("div", Ct, [
394
+ ut(L("input", {
395
+ id: `${I(V)}_search`,
396
+ ref_key: "searchInput",
397
+ ref: O,
398
+ "onUpdate:modelValue": o[0] || (o[0] = (r) => i.value = r),
399
+ "aria-activedescendant": H.value,
400
+ "aria-controls": I(fe) ? `${I(V)}_listbox` : void 0,
401
+ "aria-describedby": z.value,
402
+ "aria-invalid": _.value,
403
+ "aria-label": ae.value,
404
+ autocomplete: e.autocomplete,
405
+ class: "bb-select-popover__search-input",
406
+ inputmode: Se.value,
407
+ tabindex: a.value ? 0 : -1,
408
+ role: "searchbox",
409
+ type: "text",
410
+ onBlur: d(Pe, ["stop"]),
411
+ onChange: d($e, ["stop"]),
412
+ onFocus: d(He, ["stop"]),
413
+ onInput: d(Oe, ["stop"]),
414
+ onKeydown: [
415
+ h(d(N, ["stop", "prevent"]), ["down"]),
416
+ h(d(j, ["stop", "prevent"]), ["enter"]),
417
+ h(d(G, ["stop", "prevent"]), ["esc"]),
418
+ h(d(U, ["stop", "prevent"]), ["up"])
419
+ ]
420
+ }, null, 40, Ht), [
421
+ [ct, i.value]
422
+ ]),
423
+ F(kt, {
424
+ "aria-hidden": "true",
425
+ class: "bb-select-popover__search-error-icon",
426
+ focusable: "false"
427
+ }),
428
+ F(I(Et), {
429
+ "aria-hidden": "true",
430
+ class: "bb-select-popover__search-spinner",
431
+ focusable: "false"
432
+ }),
433
+ o[2] || (o[2] = L("svg", {
434
+ class: "bb-select-popover__search-icon",
435
+ xmlns: "http://www.w3.org/2000/svg",
436
+ viewBox: "0 0 24 24",
437
+ "aria-hidden": "true"
438
+ }, [
439
+ L("path", {
440
+ fill: "none",
441
+ stroke: "currentColor",
442
+ "stroke-linecap": "round",
443
+ "stroke-linejoin": "round",
444
+ "stroke-width": "2",
445
+ d: "m21 21-4.343-4.343m0 0A8 8 0 1 0 5.343 5.343a8 8 0 0 0 11.314 11.314"
446
+ })
447
+ ], -1))
448
+ ])) : (Z(), Y("button", {
449
+ key: 1,
450
+ ref_key: "popoverFocusProxy",
451
+ ref: T,
452
+ class: "bb-select-popover__focus-proxy sr-only",
453
+ type: "button",
454
+ "aria-controls": `${I(V)}_listbox`,
455
+ "aria-describedby": z.value,
456
+ "aria-invalid": _.value,
457
+ "aria-label": ae.value,
458
+ tabindex: "-1",
459
+ onFocus: Fe,
460
+ onKeydown: [
461
+ h(d(N, ["stop", "prevent"]), ["down"]),
462
+ h(d(U, ["stop", "prevent"]), ["up"]),
463
+ h(d(j, ["stop", "prevent"]), ["enter"]),
464
+ h(d(G, ["stop", "prevent"]), ["esc"])
465
+ ]
466
+ }, " Focus options ", 40, Pt)),
467
+ L("div", {
468
+ class: "bb-select-popover__options-outer",
469
+ "aria-hidden": a.value ? void 0 : "true",
470
+ inert: !a.value
471
+ }, [
472
+ m(e.$slots, "options:prepend:outer", { focus: E })
473
+ ], 8, $t),
474
+ F(Dt, {
475
+ id: `${I(V)}_listbox`,
476
+ ref_key: "optionsContainer",
477
+ ref: c,
478
+ compact: e.compact,
479
+ loading: S.value,
480
+ "loading-text": e.loadingText,
481
+ multiple: e.multiple,
482
+ "no-data-text": e.noDataText,
483
+ open: a.value,
484
+ options: e.groupBy ? void 0 : ve.value,
485
+ groups: e.groupBy ? et.value : void 0,
486
+ "header-height": e.headerHeight,
487
+ "option-height": e.itemHeight,
488
+ "onFocused:change": Te,
489
+ "onOption:selected": Qe,
490
+ "onOption:unselected": Xe
491
+ }, {
492
+ "options:prepend": g(() => [
493
+ m(e.$slots, "options:prepend", { focus: E })
494
+ ]),
495
+ loading: g(() => [
496
+ m(e.$slots, "loading", { query: i.value })
497
+ ]),
498
+ "no-data": g(() => [
499
+ m(e.$slots, "no-data", {
500
+ query: i.value,
501
+ focus: E
502
+ })
503
+ ]),
504
+ "options:append": g(() => [
505
+ m(e.$slots, "options:append", { focus: E })
506
+ ]),
507
+ option: g((r) => [
508
+ m(e.$slots, "option", ge({ loading: S.value }, r))
509
+ ]),
510
+ group: g((r) => [
511
+ m(e.$slots, "group", ye(dt(r)))
512
+ ]),
513
+ _: 3
514
+ }, 8, ["id", "compact", "loading", "loading-text", "multiple", "no-data-text", "open", "options", "groups", "header-height", "option-height"]),
515
+ L("div", {
516
+ class: "bb-select-popover__options-outer",
517
+ "aria-hidden": a.value ? void 0 : "true",
518
+ inert: !a.value
519
+ }, [
520
+ m(e.$slots, "options:append:outer", { focus: E })
521
+ ], 8, Ft)
522
+ ]),
523
+ _: 3
524
+ }, 8, ["modelValue", "anchor", "arrow-padding", "boundary", "class", "flip", "placement", "offset", "padding", "transition-duration", "hide-arrow", "style"])
525
+ ], 64));
187
526
  }
188
527
  });
189
528
  export {
190
- F as default
529
+ co as default
191
530
  };