bitboss-ui 0.2.31 → 0.2.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/BaseButton/BaseButton.vue.d.ts +6 -6
- package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +16 -16
- package/dist/components/BaseCheckboxGroup/BaseCheckboxGroup.vue.d.ts +36 -36
- package/dist/components/BaseDatePicker/BaseDatePicker.vue.d.ts +20 -20
- package/dist/components/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +21 -21
- package/dist/components/BaseDialog/BaseDialog.vue.d.ts +8 -8
- package/dist/components/BaseInputContainer/BaseInputContainer.vue.d.ts +6 -6
- package/dist/components/BaseNumberInput/BaseNumberInput.vue.d.ts +20 -20
- package/dist/components/BaseRadio/BaseRadio.vue.d.ts +20 -20
- package/dist/components/BaseRadioGroup/BaseRadioGroup.vue.d.ts +36 -36
- package/dist/components/BaseRating/BaseRating.vue.d.ts +17 -17
- package/dist/components/BaseSelect/BaseSelect.vue.d.ts +23 -23
- package/dist/components/BaseSlider/BaseSlider.vue.d.ts +15 -15
- package/dist/components/BaseSwitch/BaseSwitch.vue.d.ts +1 -1
- package/dist/components/BaseSwitchGroup/BaseSwitchGroup.vue.d.ts +20 -20
- package/dist/components/BaseTag/BaseTag.vue.d.ts +20 -20
- package/dist/components/BaseTextInput/BaseTextInput.vue.d.ts +19 -19
- package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +18 -18
- package/dist/components/BbAccordion/BbAccordion.vue.d.ts +3 -3
- package/dist/components/BbAlert/BbAlert.vue.d.ts +3 -3
- package/dist/components/BbAvatar/BbAvatar.vue.d.ts +8 -8
- package/dist/components/BbBadge/BbBadge.vue.d.ts +1 -1
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue.d.ts +6 -6
- package/dist/components/BbButton/BbButton.vue.d.ts +1 -1
- package/dist/components/BbCheckbox/BbCheckbox.vue.d.ts +11 -11
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +27 -27
- package/dist/components/BbChip/BbChip.vue.d.ts +2 -2
- package/dist/components/BbConfirm/BbConfirm.vue.d.ts +4 -4
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +16 -24
- package/dist/components/BbDialog/BbDialog.vue.d.ts +2 -2
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +11 -11
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +14 -14
- package/dist/components/BbDropzone/BbDropzone.vue.d.ts +4 -4
- package/dist/components/BbIntersection/BbIntersection.vue.d.ts +3 -3
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +10 -10
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +9 -9
- package/dist/components/BbPagination/BbPagination.vue.d.ts +1 -1
- package/dist/components/BbPopover/BbPopover.vue.d.ts +8 -8
- package/dist/components/BbRadio/BbRadio.vue.d.ts +10 -10
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +27 -27
- package/dist/components/BbRating/BbRating.vue.d.ts +10 -10
- package/dist/components/BbSelect/BbSelect.vue.d.ts +19 -19
- package/dist/components/BbSlider/BbSlider.vue.d.ts +8 -8
- package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +1 -1
- package/dist/components/BbSpinner/BbSpinner.vue.d.ts +2 -2
- package/dist/components/BbSwitch/BbSwitch.vue.d.ts +2 -2
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +20 -20
- package/dist/components/BbTab/BbTab.vue.d.ts +5 -5
- package/dist/components/BbTable/BbTable.vue.d.ts +11 -11
- package/dist/components/BbTable/types.d.ts +107 -107
- package/dist/components/BbTag/BbTag.vue.d.ts +13 -13
- package/dist/components/BbTextInput/BbTextInput.vue.d.ts +11 -11
- package/dist/components/BbTextarea/BbTextarea.vue.d.ts +10 -10
- package/dist/components/BbToast/BbToast.vue.d.ts +1 -1
- package/dist/components/BbToast/BbToastMessage.vue.d.ts +1 -1
- package/dist/components/BbTooltip/BbTooltip.vue.d.ts +3 -3
- package/dist/components/BbTree/BbTree.vue.d.ts +1 -1
- package/dist/composables/useConfirm.d.ts +10 -10
- package/dist/composables/useOptions.d.ts +2 -2
- package/dist/composables/useRoute.d.ts +2 -2
- package/dist/composables/useRouter.d.ts +1 -1
- package/dist/composables/useToast.d.ts +5 -5
- package/dist/composables/useWizard.d.ts +1 -1
- package/dist/index.d.ts +126 -126
- package/dist/index101.js +32 -37
- package/dist/index101.js.map +1 -1
- package/dist/index103.js +19 -19
- package/dist/index103.js.map +1 -1
- package/dist/index105.js +16 -16
- package/dist/index105.js.map +1 -1
- package/dist/index107.js +15 -15
- package/dist/index107.js.map +1 -1
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +7 -7
- package/dist/index11.js.map +1 -1
- package/dist/index111.js +16 -16
- package/dist/index111.js.map +1 -1
- package/dist/index113.js +3 -3
- package/dist/index113.js.map +1 -1
- package/dist/index115.js +6 -6
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +1 -1
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +1 -1
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +4 -4
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +5 -5
- package/dist/index119.js.map +1 -1
- package/dist/index120.js.map +1 -1
- package/dist/index121.js.map +1 -1
- package/dist/index122.js.map +1 -1
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +4 -4
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +1 -1
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +1 -1
- package/dist/index128.js +4 -1
- package/dist/index128.js.map +1 -1
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +11 -11
- package/dist/index13.js.map +1 -1
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +2 -2
- package/dist/index15.js +226 -224
- package/dist/index15.js.map +1 -1
- package/dist/index17.js +61 -62
- package/dist/index17.js.map +1 -1
- package/dist/index19.js +22 -22
- package/dist/index19.js.map +1 -1
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +2 -5
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +4 -16
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +293 -14
- package/dist/index199.js.map +1 -1
- package/dist/index2.js +23 -23
- package/dist/index2.js.map +1 -1
- package/dist/index200.js +15 -18
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +13 -17
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +18 -28
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +20 -8
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +29 -2
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +8 -378
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +2 -134
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +235 -2
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +3 -174
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +35 -23
- package/dist/index209.js.map +1 -1
- package/dist/index21.js +4 -4
- package/dist/index21.js.map +1 -1
- package/dist/index210.js +6 -373
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +10 -2
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +378 -4
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +134 -3
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +2 -3
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +172 -8
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +23 -3
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +369 -31
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +3 -6
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +3 -2
- package/dist/index219.js.map +1 -1
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +26 -233
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +16 -8
- package/dist/index222.js.map +1 -1
- package/dist/index223.js +2 -121
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +8 -27
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +120 -12
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +1 -1
- package/dist/index227.js +4 -295
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +2 -6
- package/dist/index228.js.map +1 -1
- package/dist/index229.js +6 -2
- package/dist/index229.js.map +1 -1
- package/dist/index23.js +14 -16
- package/dist/index23.js.map +1 -1
- package/dist/index230.js +2 -2
- package/dist/index235.js +2 -2
- package/dist/index236.js +428 -110
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +88 -105
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +199 -3
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +1 -1
- package/dist/index240.js +1 -1
- package/dist/index241.js +2 -435
- package/dist/index241.js.map +1 -1
- package/dist/index242.js +115 -87
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +104 -198
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +160 -2
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +2 -2
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +9 -9
- package/dist/index246.js.map +1 -1
- package/dist/index247.js +5 -162
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +1 -1
- package/dist/index249.js +37 -14
- package/dist/index249.js.map +1 -1
- package/dist/index25.js +4 -4
- package/dist/index25.js.map +1 -1
- package/dist/index250.js +2 -38
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +2 -2
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +15 -2
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +3 -2
- package/dist/index253.js.map +1 -1
- package/dist/index255.js +2 -3
- package/dist/index255.js.map +1 -1
- package/dist/index27.js +7 -7
- package/dist/index27.js.map +1 -1
- package/dist/index29.js +15 -15
- package/dist/index29.js.map +1 -1
- package/dist/index3.js +2 -1
- package/dist/index3.js.map +1 -1
- package/dist/index31.js +28 -28
- package/dist/index31.js.map +1 -1
- package/dist/index33.js +10 -11
- package/dist/index33.js.map +1 -1
- package/dist/index35.js +2 -2
- package/dist/index35.js.map +1 -1
- package/dist/index37.js +12 -12
- package/dist/index37.js.map +1 -1
- package/dist/index39.js +5 -7
- package/dist/index39.js.map +1 -1
- package/dist/index4.js.map +1 -1
- package/dist/index41.js +5 -5
- package/dist/index41.js.map +1 -1
- package/dist/index43.js +19 -16
- package/dist/index43.js.map +1 -1
- package/dist/index45.js +9 -9
- package/dist/index45.js.map +1 -1
- package/dist/index47.js +4 -4
- package/dist/index47.js.map +1 -1
- package/dist/index49.js +1 -1
- package/dist/index49.js.map +1 -1
- package/dist/index5.js +7 -6
- package/dist/index5.js.map +1 -1
- package/dist/index51.js +6 -6
- package/dist/index51.js.map +1 -1
- package/dist/index53.js.map +1 -1
- package/dist/index55.js +20 -20
- package/dist/index55.js.map +1 -1
- package/dist/index57.js +35 -35
- package/dist/index57.js.map +1 -1
- package/dist/index59.js +8 -8
- package/dist/index59.js.map +1 -1
- package/dist/index6.js +38 -38
- package/dist/index6.js.map +1 -1
- package/dist/index61.js +27 -27
- package/dist/index61.js.map +1 -1
- package/dist/index63.js +4 -4
- package/dist/index63.js.map +1 -1
- package/dist/index65.js +20 -20
- package/dist/index65.js.map +1 -1
- package/dist/index67.js +26 -26
- package/dist/index67.js.map +1 -1
- package/dist/index69.js +21 -19
- package/dist/index69.js.map +1 -1
- package/dist/index7.js.map +1 -1
- package/dist/index71.js +2 -2
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +3 -3
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +14 -14
- package/dist/index73.js.map +1 -1
- package/dist/index75.js +18 -18
- package/dist/index75.js.map +1 -1
- package/dist/index77.js +11 -11
- package/dist/index77.js.map +1 -1
- package/dist/index79.js +15 -15
- package/dist/index79.js.map +1 -1
- package/dist/index8.js +10 -7
- package/dist/index8.js.map +1 -1
- package/dist/index81.js.map +1 -1
- package/dist/index83.js +20 -20
- package/dist/index83.js.map +1 -1
- package/dist/index85.js +34 -34
- package/dist/index85.js.map +1 -1
- package/dist/index87.js +18 -18
- package/dist/index87.js.map +1 -1
- package/dist/index89.js.map +1 -1
- package/dist/index9.js.map +1 -1
- package/dist/index91.js +53 -53
- package/dist/index91.js.map +1 -1
- package/dist/index93.js +16 -16
- package/dist/index93.js.map +1 -1
- package/dist/index95.js +21 -21
- package/dist/index95.js.map +1 -1
- package/dist/index97.js +37 -37
- package/dist/index97.js.map +1 -1
- package/dist/index99.js +18 -18
- package/dist/index99.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/CommonProps.d.ts +18 -18
- package/dist/types/ExtractGenericFromComputedRef.d.ts +1 -1
- package/dist/types/ExtractGenericFromRef.d.ts +1 -1
- package/dist/types/VoidHtmlElements.d.ts +1 -1
- package/dist/utilities/functions/cloneDeep.d.ts +1 -1
- package/dist/utilities/functions/debounce.d.ts +1 -1
- package/dist/utilities/functions/flow.d.ts +1 -1
- package/dist/utilities/functions/get.d.ts +1 -1
- package/dist/utilities/functions/isNotNil.d.ts +1 -1
- package/dist/utilities/functions/mapValues.d.ts +1 -1
- package/dist/utilities/functions/merge.d.ts +1 -1
- package/dist/utilities/functions/millisecondsTo.d.ts +1 -1
- package/dist/utilities/functions/overEvery.d.ts +1 -1
- package/dist/utilities/functions/percentage.d.ts +4 -4
- package/dist/utilities/functions/pick.d.ts +1 -1
- package/dist/utilities/functions/pickBy.d.ts +1 -1
- package/dist/utilities/functions/roundToTheNearest.d.ts +1 -1
- package/package.json +93 -77
- package/dist/index256.js +0 -5
- package/dist/index256.js.map +0 -1
package/dist/index31.js
CHANGED
|
@@ -3,33 +3,33 @@ import Pe from "./index115.js";
|
|
|
3
3
|
import "./index158.js";
|
|
4
4
|
import He from "./index119.js";
|
|
5
5
|
import "./index185.js";
|
|
6
|
-
import { autoUpdate as je, computePosition as Qe, flip as Ue, shift as We } from "./
|
|
6
|
+
import { autoUpdate as je, computePosition as Qe, flip as Ue, shift as We } from "./index212.js";
|
|
7
7
|
import { deepEqual as re } from "./index123.js";
|
|
8
8
|
import { head as le } from "./index220.js";
|
|
9
9
|
import { isNotNil as I } from "./index124.js";
|
|
10
|
-
import { last as Re } from "./
|
|
10
|
+
import { last as Re } from "./index206.js";
|
|
11
11
|
import { useItemText as Ke } from "./index125.js";
|
|
12
12
|
import { useItemValue as Ye } from "./index126.js";
|
|
13
13
|
import { wait as q } from "./index122.js";
|
|
14
|
-
import { waitFor as Ze } from "./
|
|
15
|
-
import { when as Ge } from "./
|
|
16
|
-
import { offset as Xe } from "./
|
|
17
|
-
const el = { class: "bb-base-select__input-container" }, ll = ["
|
|
14
|
+
import { waitFor as Ze } from "./index210.js";
|
|
15
|
+
import { when as Ge } from "./index198.js";
|
|
16
|
+
import { offset as Xe } from "./index217.js";
|
|
17
|
+
const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomplete", "autofocus", "disabled", "placeholder", "readonly"], tl = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "bb-base-select__loading-container"
|
|
20
20
|
}, al = {
|
|
21
21
|
key: 1,
|
|
22
22
|
class: "bb-base-select__no-data-container"
|
|
23
|
-
}, nl = ["
|
|
24
|
-
viewBox: "0 0 16 8",
|
|
23
|
+
}, nl = ["id", "aria-selected"], ul = { class: "bb-base-select-option__content" }, sl = { class: "bb-base-select-option__text" }, ol = { class: "bb-base-select__chevron" }, il = /* @__PURE__ */ w("svg", {
|
|
25
24
|
fill: "none",
|
|
25
|
+
viewBox: "0 0 16 8",
|
|
26
26
|
xmlns: "http://www.w3.org/2000/svg"
|
|
27
27
|
}, [
|
|
28
28
|
/* @__PURE__ */ w("path", {
|
|
29
|
-
"fill-rule": "evenodd",
|
|
30
29
|
"clip-rule": "evenodd",
|
|
31
30
|
d: "M0.851779 0.225802C0.90403 0.173418 0.966103 0.131858 1.03444 0.1035C1.10278 0.0751431 1.17604 0.0605469 1.25003 0.0605469C1.32402 0.0605469 1.39728 0.0751431 1.46562 0.1035C1.53396 0.131858 1.59603 0.173418 1.64828 0.225802L8.00003 6.57868L14.3518 0.225802C14.4041 0.173503 14.4662 0.132017 14.5345 0.103713C14.6028 0.0754093 14.6761 0.0608414 14.75 0.0608414C14.824 0.0608414 14.8972 0.0754093 14.9656 0.103713C15.0339 0.132017 15.096 0.173503 15.1483 0.225802C15.2006 0.278101 15.2421 0.340189 15.2704 0.408521C15.2987 0.476852 15.3132 0.55009 15.3132 0.624052C15.3132 0.698014 15.2987 0.771252 15.2704 0.839584C15.2421 0.907916 15.2006 0.970003 15.1483 1.0223L8.39828 7.7723C8.34603 7.82469 8.28395 7.86625 8.21562 7.8946C8.14728 7.92296 8.07402 7.93756 8.00003 7.93756C7.92604 7.93756 7.85278 7.92296 7.78444 7.8946C7.7161 7.86625 7.65403 7.82469 7.60178 7.7723L0.851779 1.0223C0.799395 0.970051 0.757835 0.907978 0.729477 0.83964C0.70112 0.771302 0.686523 0.69804 0.686523 0.624052C0.686523 0.550064 0.70112 0.476803 0.729477 0.408464C0.757835 0.340126 0.799395 0.278053 0.851779 0.225802Z",
|
|
32
|
-
fill: "currentColor"
|
|
31
|
+
fill: "currentColor",
|
|
32
|
+
"fill-rule": "evenodd"
|
|
33
33
|
})
|
|
34
34
|
], -1), Ol = /* @__PURE__ */ Ne({
|
|
35
35
|
__name: "BaseSelect",
|
|
@@ -512,6 +512,8 @@ const el = { class: "bb-base-select__input-container" }, ll = ["autocomplete", "
|
|
|
512
512
|
};
|
|
513
513
|
}));
|
|
514
514
|
return (e, a) => (b(), y("span", {
|
|
515
|
+
ref_key: "outerContainer",
|
|
516
|
+
ref: F,
|
|
515
517
|
class: x({
|
|
516
518
|
"bb-base-select": !0,
|
|
517
519
|
"bb-base-select--active": H.value,
|
|
@@ -520,34 +522,32 @@ const el = { class: "bb-base-select__input-container" }, ll = ["autocomplete", "
|
|
|
520
522
|
"bb-base-select--errors": e.hasErrors,
|
|
521
523
|
"bb-base-select--readonly": e.readonly
|
|
522
524
|
}),
|
|
523
|
-
onClick: xe
|
|
524
|
-
ref_key: "outerContainer",
|
|
525
|
-
ref: F
|
|
525
|
+
onClick: xe
|
|
526
526
|
}, [
|
|
527
527
|
h(e.$slots, "prepend-outer"),
|
|
528
528
|
w("span", {
|
|
529
|
-
class: "bb-base-select__inner-container",
|
|
530
529
|
ref_key: "innerContainer",
|
|
531
|
-
ref: E
|
|
530
|
+
ref: E,
|
|
531
|
+
class: "bb-base-select__inner-container"
|
|
532
532
|
}, [
|
|
533
533
|
h(e.$slots, "prepend"),
|
|
534
534
|
w("span", el, [
|
|
535
535
|
e.multiple ? (b(), y(D, { key: 0 }, [
|
|
536
536
|
e.comma ? (b(!0), y(D, { key: 0 }, j(i.value, (t, n) => (b(), y("span", {
|
|
537
|
+
key: t.id,
|
|
537
538
|
class: x({
|
|
538
539
|
"bb-base-select__selected": !0,
|
|
539
540
|
"bb-base-select__selected--comma": !0,
|
|
540
541
|
"bb-base-select__selected--focused": n === o.value
|
|
541
|
-
})
|
|
542
|
-
key: t.id
|
|
542
|
+
})
|
|
543
543
|
}, L(t.text) + L(n < i.value.length - 1 ? "," : ""), 3))), 128)) : (b(!0), y(D, { key: 1 }, j(i.value, (t, n) => (b(), se(Pe, {
|
|
544
|
+
key: t.id,
|
|
544
545
|
class: x({
|
|
545
546
|
"bb-base-select__selected": !0,
|
|
546
547
|
"bb-base-select__selected--chip": !0,
|
|
547
548
|
"bb-base-select__selected--focused": n === o.value
|
|
548
549
|
}),
|
|
549
550
|
clearable: !0,
|
|
550
|
-
key: t.id,
|
|
551
551
|
text: t.text,
|
|
552
552
|
"onClick:clear": B((u) => A(t), ["stop"])
|
|
553
553
|
}, {
|
|
@@ -570,27 +570,29 @@ const el = { class: "bb-base-select__input-container" }, ll = ["autocomplete", "
|
|
|
570
570
|
}, 1032, ["class", "text", "onClick:clear"]))), 128))
|
|
571
571
|
], 64)) : oe("", !0),
|
|
572
572
|
Fe(w("input", {
|
|
573
|
+
id: e.id,
|
|
574
|
+
ref_key: "input",
|
|
575
|
+
ref: T,
|
|
576
|
+
"onUpdate:modelValue": a[0] || (a[0] = (t) => s.value = t),
|
|
573
577
|
autocomplete: e.autocomplete,
|
|
574
578
|
autofocus: e.autofocus,
|
|
575
579
|
class: x("bb-base-select__text-input"),
|
|
576
580
|
disabled: e.disabled,
|
|
577
|
-
id: e.id,
|
|
578
581
|
placeholder: fe.value,
|
|
579
582
|
readonly: e.readonly || !e.allowWriting,
|
|
580
583
|
type: "text",
|
|
581
584
|
onBlur: B(Ve, ["stop"]),
|
|
582
|
-
onFocus: B(we, ["stop"]),
|
|
583
585
|
onChange: B(Ce, ["stop"]),
|
|
586
|
+
onFocus: B(we, ["stop"]),
|
|
584
587
|
onInput: B(ke, ["stop"]),
|
|
585
|
-
onKeydown: B(Te, ["stop"])
|
|
586
|
-
"onUpdate:modelValue": a[0] || (a[0] = (t) => s.value = t),
|
|
587
|
-
ref_key: "input",
|
|
588
|
-
ref: T
|
|
588
|
+
onKeydown: B(Te, ["stop"])
|
|
589
589
|
}, null, 40, ll), [
|
|
590
590
|
[Ae, s.value]
|
|
591
591
|
]),
|
|
592
592
|
(b(), se(Me, { to: "body" }, [
|
|
593
593
|
w("span", {
|
|
594
|
+
ref_key: "optionsContainer",
|
|
595
|
+
ref: v,
|
|
594
596
|
class: x({
|
|
595
597
|
"bb-base-select__options-container": !0,
|
|
596
598
|
"bb-base-select__options-container--shown": _.value,
|
|
@@ -600,9 +602,7 @@ const el = { class: "bb-base-select__input-container" }, ll = ["autocomplete", "
|
|
|
600
602
|
}),
|
|
601
603
|
role: "listbox",
|
|
602
604
|
style: Je({ transitionDuration: ve }),
|
|
603
|
-
tabindex: -1
|
|
604
|
-
ref_key: "optionsContainer",
|
|
605
|
-
ref: v
|
|
605
|
+
tabindex: -1
|
|
606
606
|
}, [
|
|
607
607
|
h(e.$slots, "options:prepend"),
|
|
608
608
|
!k.value.length && d.value ? (b(), y("span", tl, [
|
|
@@ -621,6 +621,7 @@ const el = { class: "bb-base-select__input-container" }, ll = ["autocomplete", "
|
|
|
621
621
|
item: t.original
|
|
622
622
|
}),
|
|
623
623
|
w("span", {
|
|
624
|
+
id: t.id,
|
|
624
625
|
"aria-selected": t.selected,
|
|
625
626
|
class: x({
|
|
626
627
|
"bb-base-select-option": !0,
|
|
@@ -628,7 +629,6 @@ const el = { class: "bb-base-select__input-container" }, ll = ["autocomplete", "
|
|
|
628
629
|
"bb-base-select-option--focused": t.focused,
|
|
629
630
|
"bb-base-select-option--disabled": t.disabled
|
|
630
631
|
}),
|
|
631
|
-
id: t.id,
|
|
632
632
|
role: "option",
|
|
633
633
|
onClick: B(Be, ["stop"])
|
|
634
634
|
}, [
|
package/dist/index31.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index31.js","sources":["../src/components/BaseSelect/BaseSelect.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, withModifiers as _withModifiers, withCtx as _withCtx, createBlock as _createBlock, vModelDynamic as _vModelDynamic, createElementVNode as _createElementVNode, withDirectives as _withDirectives, normalizeStyle as _normalizeStyle, Teleport as _Teleport, createVNode as _createVNode, mergeProps as _mergeProps } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-base-select__input-container\" }\nconst _hoisted_2 = [\"autocomplete\", \"autofocus\", \"disabled\", \"id\", \"placeholder\", \"readonly\"]\nconst _hoisted_3 = {\n key: 0,\n class: \"bb-base-select__loading-container\"\n}\nconst _hoisted_4 = {\n key: 1,\n class: \"bb-base-select__no-data-container\"\n}\nconst _hoisted_5 = [\"aria-selected\", \"id\"]\nconst _hoisted_6 = { class: \"bb-base-select-option__content\" }\nconst _hoisted_7 = { class: \"bb-base-select-option__text\" }\nconst _hoisted_8 = { class: \"bb-base-select__chevron\" }\nconst _hoisted_9 = /*#__PURE__*/_createElementVNode(\"svg\", {\n viewBox: \"0 0 16 8\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n \"fill-rule\": \"evenodd\",\n \"clip-rule\": \"evenodd\",\n d: \"M0.851779 0.225802C0.90403 0.173418 0.966103 0.131858 1.03444 0.1035C1.10278 0.0751431 1.17604 0.0605469 1.25003 0.0605469C1.32402 0.0605469 1.39728 0.0751431 1.46562 0.1035C1.53396 0.131858 1.59603 0.173418 1.64828 0.225802L8.00003 6.57868L14.3518 0.225802C14.4041 0.173503 14.4662 0.132017 14.5345 0.103713C14.6028 0.0754093 14.6761 0.0608414 14.75 0.0608414C14.824 0.0608414 14.8972 0.0754093 14.9656 0.103713C15.0339 0.132017 15.096 0.173503 15.1483 0.225802C15.2006 0.278101 15.2421 0.340189 15.2704 0.408521C15.2987 0.476852 15.3132 0.55009 15.3132 0.624052C15.3132 0.698014 15.2987 0.771252 15.2704 0.839584C15.2421 0.907916 15.2006 0.970003 15.1483 1.0223L8.39828 7.7723C8.34603 7.82469 8.28395 7.86625 8.21562 7.8946C8.14728 7.92296 8.07402 7.93756 8.00003 7.93756C7.92604 7.93756 7.85278 7.92296 7.78444 7.8946C7.7161 7.86625 7.65403 7.82469 7.60178 7.7723L0.851779 1.0223C0.799395 0.970051 0.757835 0.907978 0.729477 0.83964C0.70112 0.771302 0.686523 0.69804 0.686523 0.624052C0.686523 0.550064 0.70112 0.476803 0.729477 0.408464C0.757835 0.340126 0.799395 0.278053 0.851779 0.225802Z\",\n fill: \"currentColor\"\n })\n], -1)\n\nimport BbChip from \"../BbChip/BbChip.vue\";\nimport BbSpinner from \"../BbSpinner/BbSpinner.vue\";\nimport {\n autoUpdate,\n computePosition,\n flip,\n offset,\n shift,\n} from \"@floating-ui/dom\";\nimport {\n computed,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n watch,\n} from \"vue\";\nimport { deepEqual } from \"fast-equals\";\nimport { head } from \"@/utilities/functions/head\";\nimport { isNotNil } from \"@/utilities/functions/isNotNil\";\nimport { last } from \"@/utilities/functions/last\";\nimport { useItemText } from \"@/composables/useItemText\";\nimport { useItemValue } from \"@/composables/useItemValue\";\nimport { wait } from \"@/utilities/functions/wait\";\nimport { waitFor } from \"@/utilities/functions/waitFor\";\nimport { when } from \"@/utilities/functions/when\";\nimport type { ComputedRef, HTMLAttributes, InputHTMLAttributes } from \"vue\";\nimport type { NestedKeyOf } from \"@/types/NestedKeyOf\";\n\nexport type BaseSelectProps<T> = {\n /**\n * Allows typing into the input.\n */\n allowWriting?: boolean;\n \n /**\n * Guides to the browser as to the type of information expected in the field.\n */\n autocomplete?: InputHTMLAttributes[\"autocomplete\"];\n\n /**\n * Sets autofocus on page load.\n */\n autofocus?: InputHTMLAttributes[\"autofocus\"];\n\n /**\n * Defines an array of dependencies that will trigger actions in the component upon change.\n */\n dependencies?: any[];\n\n /**\n * Timeout used to debounce response to changes to dependencies.\n */\n depsDebounceTime?: number;\n\n /**\n * Disables the component\n */\n disabled?: boolean;\n\n /**\n * If coherence is enforce the input cannot have a modelValue the is incoherent with its current items.\n *\n * e.g. You cannot set v-model to a user that is not present in the items passed.\n *\n * modelValue will be reset upon incoherence.\n */\n enforceCoherence?: boolean;\n\n /**\n * Define if the component should be in an error state.\n * It usually attaches a CSS class for styling purposes.\n */\n hasErrors?: boolean;\n\n /**\n * The identifier of the component.\n */\n id?: HTMLAttributes[\"id\"];\n\n /**\n * String displayed while items are being loaded.\n */\n loadingText?: string;\n\n /**\n * Defines the strategy used to understand whether an option has been selected.\n * `string` is 40% faster but relies on property order.\n * `equality` is more reliable but is slower.\n */\n matchStrategy?: \"string\" | \"equality\";\n\n /**\n * Timeout used to debounce response to changes to modelValue.\n */\n modelValueDebounceTime?: number;\n\n /**\n * Allows the selection of multiple items.\n */\n multiple?: boolean;\n\n /**\n * Defines the name of the input.\n */\n name?: InputHTMLAttributes[\"name\"];\n\n /**\n * String displayed when there are no items to display.\n */\n noDataText?: string;\n\n /**\n * String displayed when there's no data.\n */\n placeholder?: InputHTMLAttributes[\"placeholder\"];\n\n /**\n * Sets the input in a readonly state.\n */\n readonly?: InputHTMLAttributes[\"readonly\"];\n\n /**\n * How long the transition has to last in milliseconds\n */\n transitionDuration?: number;\n /**\n * Used to retrieve items can be an array or a function.\n */\n items:\n | T[]\n | ((query: string, prefill: boolean, modelValue: any) => Promise<T[]>)\n | ((query: string, prefill: boolean, modelValue: any) => T[]);\n\n /**\n * Defines a path that returns a property of the object to use as text or a function that returns a string\n */\n itemText?: T extends object\n ? NestedKeyOf<T> | ((item: T) => string)\n : ((item: T) => string) | undefined;\n\n /**\n * Defines a path that returns a property of the object to use as value or a function that returns any value\n */\n itemValue?: T extends object\n ? NestedKeyOf<T> | ((item: T) => string)\n : ((item: T) => any) | undefined;\n /**\n * Used by v-model. Can be any serializable type.\n */\n modelValue: any;\n\n /**\n * Allows the user to add options to the list by\n * inserting text in the input and pressing ENTER.\n * The value and text of the option generated is a\n * string equal to what has been inserted.\n */\n addOptions?: boolean;\n /**\n * Sets the display model for selected values to a list\n * of comma separated string. In this mode the user\n * cannot deselect an option by pressing the close button.\n */\n comma?: boolean;\n /**\n * Defines how the filtering should work.\n * In any case options are always filtered by the text displayed but\n * they can also take into account other properties of the\n * passed elements when this property is a string or an array of string.\n * E.g. items could be a list of users and you can filter users by email or phone by passing `['email', 'phone']`\n * You can also pass false to not filter anything or a function for more granular control.\n *\n */\n filterBy?:\n | string\n | string[]\n | false\n | ((value: any, item: T) => boolean)\n | null;\n /**\n * Defines the prefill strategy for the input. By default the input will prefill\n * on focus. It can also always prefill with `true` and only prefill on search with `false`.\n */\n prefill?: boolean | \"focus\";\n /**\n * Time to wait when the users stops writing in the input before querying data.\n * Especially useful when searching live data on big datasets.\n */\n queryDebounceTime?: number;\n /**\n * If `true` when in multiple selection, reset the query immediately\n * upon selecting an option. By default the query is\n * not reset until focus is lost so the user can search\n * for \"Cath\" and select \"Cathy\" and then write more to\n * search for \"Catherine\"\n */\n resetQueryOnOptionSelected?: boolean;\n /**\n * Adds a stash to accumulate selected values. Especially\n * useful when searching in a big database of items.\n * E.g. if you search for \"John\" and then search for \"Richard\"\n * you either always return the previous items or you stash them passing `true` to this option.\n */\n stash?: boolean;\n /**\n * Pass `true` if the dropdown is not updating following movement in the UI, like in modals. Very expensive so use with care.\n */\n updateOnAnimationFrame?: boolean;\n};\n\nexport type BaseOption<T> = {\n id: string;\n jsonValue: string;\n manual: boolean;\n original: T;\n text: string;\n value: any;\n disabled: boolean;\n};\n\nexport type Option<T> = BaseOption<T> & {\n index: number;\n selected: boolean;\n};\n\nexport type FilteredOption<T> = Option<T> & {\n focused: boolean;\n};\n\nexport type BaseSelectEvents = {\n (e: \"blur\", event: FocusEvent): void;\n (e: \"change\", event: Event): void;\n (e: \"click\", event: MouseEvent): void;\n (e: \"focus\", event: FocusEvent): void;\n (e: \"inactive\"): void;\n (e: \"input\", event: Event): void;\n (e: \"update:modelValue\", value: any): void;\n};\n\nexport type BaseSelectSlots<T> = {\n \"prepend-outer\"?: (props: {}) => any;\n prepend?: (props: {}) => any;\n \"options:prepend\"?: (props: {}) => any;\n loading?: (props: { query: string }) => any;\n \"no-data\"?: (props: { query: string }) => any;\n \"option:prepend\"?: (props: { item: T }) => any;\n chip?: (props: {\n disabled: boolean;\n hasErrors?: boolean;\n index: number;\n item: T;\n loading: boolean;\n manual: boolean;\n selected: boolean;\n text: string;\n value: any;\n }) => any;\n option?: (props: {\n disabled: boolean;\n focused: boolean;\n hasErrors?: boolean;\n index: number;\n item: T;\n loading: boolean;\n manual: boolean;\n selected: boolean;\n text: string;\n value: any;\n }) => any;\n \"option:append\"?: (props: { item: T }) => any;\n \"options:append\"?: (props: {}) => any;\n chevron?: (props: { loading: boolean; shown: boolean }) => any;\n append?: (props: {}) => any;\n spinner?: (props: { loading: boolean }) => any;\n \"append-outer\"?: (props: {}) => any;\n};\n\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseSelect',\n props: {\n allowWriting: { type: Boolean, default: true },\n autocomplete: {},\n autofocus: {},\n dependencies: {},\n depsDebounceTime: { default: 0 },\n disabled: { type: Boolean },\n enforceCoherence: { type: Boolean },\n hasErrors: { type: Boolean },\n id: {},\n loadingText: { default: \"Caricamento...\" },\n matchStrategy: { default: \"string\" },\n modelValueDebounceTime: { default: 0 },\n multiple: { type: Boolean },\n name: {},\n noDataText: { default: \"Nessun elemento da visualizzare\" },\n placeholder: {},\n readonly: {},\n transitionDuration: { default: 200 },\n items: {},\n itemText: {},\n itemValue: {},\n modelValue: {},\n addOptions: { type: Boolean },\n comma: { type: Boolean },\n filterBy: { type: [String, Array, Boolean, Function, null], default: () => [] },\n prefill: { type: [Boolean, String], default: \"focus\" },\n queryDebounceTime: { default: 500 },\n resetQueryOnOptionSelected: { type: Boolean },\n stash: { type: Boolean },\n updateOnAnimationFrame: { type: Boolean, default: false }\n },\n emits: [\"blur\", \"change\", \"click\", \"focus\", \"inactive\", \"input\", \"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\nconst props = __props;\n\nconst emit = __emit;\n\n\n\nif (props.multiple && !Array.isArray(props.modelValue)) {\n throw new Error('Multiple is set to \"true\" but modelValue is not an array.');\n}\n\nconst outerContainer = ref<HTMLElement | null>(null);\nconst innerContainer = ref<HTMLElement | null>(null);\nconst optionsContainer = ref<HTMLElement | null>(null);\nconst input = ref<HTMLElement | null>(null);\nconst query = ref<string>(\"\");\nconst computedPlaceholder = computed(() => {\n if (selectedOptions.value.length) return \"\";\n else return props.placeholder;\n});\n/**\n * Use a number accumulator because if the fn takes 5 seconds\n * and after 2 seconds another search is run\n * When the first returns the second is still out for 2 seconds\n * and we want to track them both.\n * Debounce will not be enough.\n */\nconst loading = ref(0);\nconst transitionDuration = props.transitionDuration / 1000 + \"s\";\nlet cleanUpPositioning: () => void;\n\nonMounted(async () => {\n if (innerContainer.value && optionsContainer.value) {\n cleanUpPositioning = autoUpdate(\n innerContainer.value,\n optionsContainer.value,\n displayOptions,\n {\n ancestorResize: true,\n ancestorScroll: true,\n animationFrame: props.updateOnAnimationFrame,\n elementResize: true,\n }\n );\n }\n});\nonBeforeUnmount(() => {\n cleanUpPositioning();\n});\n\nconst internalItems = ref<T[]>([]);\nconst stash = ref<BaseOption<T>[]>([]);\nconst manualItems = ref<BaseOption<T>[]>([]);\nconst { getItemText } = useItemText();\nconst { getItemValue } = useItemValue();\n\nconst internalOptions = computed<BaseOption<T>[]>(() => {\n return internalItems.value.map((item: any, _) => {\n const text = getItemText(item, props.itemText as any);\n const value = getItemValue(item, props.itemValue);\n\n // Undefined is not JSONable\n if (value === undefined)\n throw new Error(\n 'The result of extracting \"value\" from option was undefined. Affected item is ' +\n JSON.stringify(item) +\n \" please check itemValue property is correct.\"\n );\n\n const jsonValue = JSON.stringify(value);\n return {\n disabled: !!item.disabled,\n id: \"option_\" + jsonValue.replace(/\\W/g, \"_\"),\n jsonValue,\n manual: false,\n original: item,\n text,\n value,\n };\n });\n});\n\nconst options = computed<Option<T>[]>(() => {\n let fromOptions = internalOptions.value.reduce(\n (acc: { [key: string]: BaseOption<T> }, curr: BaseOption<T>) => {\n acc[curr.id] = curr;\n return acc;\n },\n {}\n );\n const withManual: { [key: string]: BaseOption<T> } = manualItems.value.reduce(\n (acc, curr) => {\n if (!acc[curr.id]) acc[curr.id] = curr as any;\n return acc;\n },\n fromOptions\n );\n const withStash: { [key: string]: BaseOption<T> } = stash.value.reduce(\n (acc, curr) => {\n if (!acc[curr.id]) acc[curr.id] = curr as any;\n return acc;\n },\n withManual\n );\n return Object.values(withStash).map<Option<T>>(\n (option: BaseOption<T>, index) => {\n return {\n ...option,\n selected: isNotNil(modelValueIndexed.value.get(option.value)),\n index,\n };\n }\n );\n});\n\n/**\n * Filter options to be displayed based on the current query.\n * If no query is used or when query is set from the inside (after a selection) display all possible options\n */\nconst filteredOptions = computed<FilteredOption<T>[]>(() => {\n let base = [];\n /** Only filter when a value is being searched not when the query is fully set on a selected option text */\n if (\n query.value &&\n !selectedOptions.value.some(\n (option: Option<T>) => option.text === query.value\n )\n ) {\n base = options.value.filter((item: Option<T>) => {\n let matchedAnything = false;\n if (!props.filterBy) return true;\n else if (typeof props.filterBy === \"function\")\n matchedAnything = props.filterBy(item.value, item.original);\n else if (props.filterBy.length) {\n const keys = ([] as string[]).concat(props.filterBy);\n for (let index = 0; index < keys.length; index++) {\n const propName = keys[index];\n matchedAnything =\n matchedAnything ||\n ((item.original as any)[propName] &&\n (item.original as any)[propName]\n .toLowerCase()\n .includes(query.value.toLowerCase()));\n }\n }\n return (\n matchedAnything ||\n item.text.toLowerCase().includes(query.value.toLowerCase())\n );\n });\n /** Otherwise defaul;t to the whole set of options */\n } else base = options.value;\n /** This is done here so that only visible options are highlighted */\n return base.map((option: Option<T>, index) => ({\n ...option,\n focused: normalizedFocusedIndex.value === index,\n }));\n});\n\n/**\n * Indexes options by id for retrieval\n */\n\nconst optionsIndexedById = computed<{\n [key: string]: Option<T>;\n}>(() =>\n options.value.reduce(\n (acc, curr) => ({\n ...acc,\n [curr.id]: curr,\n }),\n {}\n )\n);\n\n/**\n * Indexes options by their value\n * (using JSON to circumvent identical objects not being equal in JS)\n */\nconst optionsIndexedByValue = computed(() => {\n if (props.matchStrategy === \"string\") {\n let indexed = options.value.reduce(\n (acc: { [key: string]: Option<T> }, curr: Option<T>) => {\n acc[curr.jsonValue] = curr;\n return acc;\n },\n {}\n );\n return {\n get: (key: any) => {\n return indexed[JSON.stringify(key)];\n },\n };\n } else if (props.matchStrategy === \"equality\") {\n let indexed: [any, Option<T>][] = options.value.map((option) => [\n option.value,\n option,\n ]);\n\n return {\n get: (key: any) => {\n return indexed.find((pairs) => deepEqual(pairs[0], key))?.[1];\n },\n };\n } else {\n throw new Error(\"No match strategy has been defined\");\n }\n});\n\n/**\n * Indexes modelValue to a map so when can easily know which values are selected\n * (using JSON to circumvent identical object not being equal in JS)\n */\nconst modelValueIndexed = computed(() => {\n if (props.matchStrategy === \"string\") {\n let map: { [key: string]: number } = {};\n [].concat(props.modelValue).forEach((value: any, index: number) => {\n map[JSON.stringify(value)] = index;\n });\n return {\n get: (value: any) => map[JSON.stringify(value)],\n };\n } else if (props.matchStrategy === \"equality\") {\n const map = []\n .concat(props.modelValue)\n .filter(isNotNil)\n .map((value, index) => [value, index]);\n\n return {\n get: (key: any) => {\n return map.find((pairs) => deepEqual(pairs[0], key))?.[1];\n },\n };\n } else {\n throw new Error(\"No match strategy has been defined\");\n }\n});\n\n/**\n * For every item in modelValue find the linked option if it exists.\n * This is used to display chips.\n */\nconst selectedOptions = computed(() => {\n return [].concat(props.modelValue).reduce((acc: Option<T>[], curr: any) => {\n const linkedOption = optionsIndexedByValue.value.get(curr);\n if (linkedOption) acc.push(linkedOption);\n return acc;\n }, []);\n});\n\n/**\n * When selecting an option split behavior based on single or multiple selection\n */\nconst onOptionSelected = (option: Option<T>) => {\n let valueToEmit;\n focusedIndex.value = option.index;\n /**\n * For single selection:\n * If the option was already selected - restore the value to default, clean the stash, manual items, and query.\n * If the option was not selected - use its value, save the option in the stash and display it's text as query\n * The stash is used to remove the complexity of stashing items when searching for identifying information,\n * like searching an address would not return the option that was used to selected a previous address in another country.\n * Or when searching users by username would not return the previous ones.\n * We save it so the user hasn't to.\n */\n if (!props.multiple) {\n if (option.selected) {\n if (option.manual) {\n manualItems.value = manualItems.value.filter(\n (current: any) => current.id !== option.id\n );\n }\n valueToEmit = null;\n if (props.stash) {\n stash.value = [];\n }\n query.value = \"\";\n } else {\n valueToEmit = option.value;\n if (props.stash) {\n stash.value = [option as any];\n }\n query.value = option.text;\n }\n /**\n * For multiple selection\n * If the option was selected remove it from modelValue, if it is a mnaual iutem also remove it from there.\n * In the stash we can search for the id of the option.\n * If the option was not selected we can just add it to modelValue and the stash.\n */\n } else {\n if (option.selected) {\n if (option.manual) {\n manualItems.value = manualItems.value.filter(\n (current: any) => current.id !== option.id\n );\n }\n valueToEmit = props.modelValue.filter(\n (value: any) => JSON.stringify(value) !== option.jsonValue\n );\n if (props.stash) {\n stash.value = stash.value.filter((stashed) => stashed.id !== option.id);\n }\n } else {\n valueToEmit = props.modelValue.concat(option.value);\n if (props.stash) {\n stash.value = stash.value.concat(option as any);\n }\n }\n if (props.resetQueryOnOptionSelected) {\n query.value = \"\";\n }\n }\n emit(\"update:modelValue\", valueToEmit);\n};\n\nconst getOptions = async ({ prefill = false }) => {\n let items: T[] = [];\n if (Array.isArray(props.items)) {\n items = props.items;\n } else {\n if (typeof props.items === \"function\") {\n loading.value++;\n items = await props.items(query.value, prefill, props.modelValue);\n loading.value--;\n }\n }\n internalItems.value = items as any;\n};\n\n/**\n * Add an option to the manual items and then reset the query\n */\nconst addOption = () => {\n const text = query.value;\n const value = query.value;\n const jsonValue = JSON.stringify(value);\n const option = {\n text,\n value,\n jsonValue,\n id: \"option_\" + jsonValue.replace(/\\W/g, \"_\"),\n original: value,\n manual: true,\n disabled: false,\n };\n manualItems.value = manualItems.value.concat(option as any);\n query.value = \"\";\n};\n\n/**\n * It should prefill if asked, or\n * when single if modelValue is not null\n * when multiple if modelValue is not empty\n */\nconst shouldPrefill =\n props.prefill === true ||\n (!props.multiple && isNotNil(props.modelValue)) ||\n (props.multiple && !!props.modelValue.length);\n/**\n * When modelValue changes split behavior for single and multiple selection:\n */\nlet modelValueTimeout: ReturnType<typeof setTimeout>;\nlet hasRunOnce = false;\nwatch(\n () => props.modelValue,\n (current, previous) => {\n if (modelValueTimeout) clearTimeout(modelValueTimeout);\n modelValueTimeout = setTimeout(\n async () => {\n /**\n * For single selection if the value is already in the option (most likely you are using\n * static items) just use it.\n * If the value is not in the options try searching for it (outside dependencies may fix it).\n * If at last the value cannot be found even after searching\n * reset value to the default value when coherence is enforced\n * or at least do not display the old query\n */\n if (!props.multiple) {\n let found = optionsIndexedByValue.value.get(props.modelValue);\n if (\n (!found && isNotNil(props.modelValue)) ||\n previous === undefined\n ) {\n const currentQuery = query.value;\n query.value = \"\";\n await getOptions({ prefill: true });\n query.value = currentQuery;\n }\n found = optionsIndexedByValue.value.get(props.modelValue);\n if (found) {\n query.value = found.text;\n if (props.stash) {\n stash.value = [found as any];\n }\n } else {\n if (props.enforceCoherence && isNotNil(current)) {\n query.value = \"\";\n if (props.stash) {\n stash.value = [];\n }\n emit(\"update:modelValue\", null);\n } else {\n query.value = \"\";\n }\n }\n /**\n * For multiple selection if every value is already in the options (most likely you are using\n * static items) just use them.\n * If not all the values are in the current options or is prefilling try searching (outside depencencies may fix the situation).\n * If the values are still not in the available options and coherence is enforced\n * discard the ones that are invalid.\n *\n */\n } else {\n if (!Array.isArray(props.modelValue)) {\n throw new Error(\"props.modelValue is not an array.\");\n }\n let allFound = props.modelValue.every((value: any) =>\n optionsIndexedByValue.value.get(value)\n );\n if (!allFound || previous === undefined) {\n await getOptions({ prefill: true });\n allFound = props.modelValue.every((value: any) =>\n optionsIndexedByValue.value.get(value)\n );\n }\n if (allFound) {\n if (props.stash) {\n stash.value = props.modelValue.map(\n (value: any) => optionsIndexedByValue.value.get(value)!\n ) as any;\n }\n } else {\n let coherentStash: Option<T>[] = [];\n const coherent = current.filter((value: any) => {\n let found = optionsIndexedByValue.value.get(value);\n if (found) coherentStash.push(found);\n return found;\n });\n if (props.stash) {\n stash.value = coherentStash as any;\n }\n if (props.enforceCoherence) {\n emit(\"update:modelValue\", coherent);\n }\n }\n }\n },\n shouldPrefill ? 0 : props.modelValueDebounceTime\n );\n },\n // Prefill when asked or when items are static\n { immediate: shouldPrefill, deep: true }\n);\n\n/**\n * This is triggered to refresh static items whenever the passed array changes.\n * If the parent defines an array in the template this is triggered\n * at every render so we take counter measures\n * Even if the entire array changes all the previously selected values are still in the stash.\n */\nwatch(\n () => props.items,\n async (current, previous) => {\n if (\n typeof current === \"function\" ||\n // Circumvent arrays defined in the template by the parent\n JSON.stringify(current) !== JSON.stringify(previous)\n ) {\n await getOptions({ prefill: false });\n if (props.multiple) {\n const allFound = props.modelValue.every((value: any) =>\n optionsIndexedByValue.value.get(value)\n );\n\n if (!allFound) {\n if (props.enforceCoherence) {\n const coherent = props.modelValue.filter((value: any) => {\n let found = optionsIndexedByValue.value.get(value);\n return found;\n });\n emit(\"update:modelValue\", coherent);\n }\n }\n } else {\n let found = optionsIndexedByValue.value.get(props.modelValue);\n if (!found && props.enforceCoherence && isNotNil(props.modelValue)) {\n emit(\"update:modelValue\", null);\n }\n focusedIndex.value = null;\n }\n }\n }\n);\n\n/**\n * When dependencies change\n * If the input has not been prefilled yet just return\n * Check dependencies are the same by value and not reference\n * Otherwise we search again for options as they might be different base on dependencies.\n * If coherence is enforced we set the state accordingly\n */\nlet depsTimeout: ReturnType<typeof setTimeout>;\nwatch(\n () => props.dependencies,\n (current, previous) => {\n if (!shouldPrefill && props.prefill === \"focus\" && isFirstFocus) {\n return;\n }\n // Circumvent array defined in the template by the parent\n if (JSON.stringify(current) === JSON.stringify(previous)) {\n return;\n }\n\n if (depsTimeout) clearTimeout(depsTimeout);\n depsTimeout = setTimeout(async () => {\n if (JSON.stringify(current) !== JSON.stringify(previous)) {\n // Only reset the stash if we are going to enforce coherence\n if (props.enforceCoherence) {\n if (props.stash) {\n stash.value = [];\n }\n }\n // Momentarily reset query\n let currentQuery = query.value;\n query.value = \"\";\n await getOptions({ prefill: true });\n query.value = currentQuery;\n if (!props.multiple) {\n let found = optionsIndexedByValue.value.get(props.modelValue);\n if (!found && props.enforceCoherence && isNotNil(props.modelValue)) {\n query.value = \"\";\n if (props.stash) {\n stash.value = [];\n }\n emit(\"update:modelValue\", null);\n }\n } else {\n let allFound = props.modelValue.every((value: any) =>\n optionsIndexedByValue.value.get(value)\n );\n if (!allFound && props.enforceCoherence) {\n let coherentStash: Option<T>[] = [];\n const coherent = props.modelValue.filter((value: any) => {\n let found = optionsIndexedByValue.value.get(value);\n if (found) coherentStash.push(found);\n return found;\n });\n if (props.stash) {\n stash.value = coherentStash as any;\n }\n emit(\"update:modelValue\", coherent);\n }\n }\n }\n }, props.depsDebounceTime);\n },\n { deep: true }\n);\n\n/**\n * This is used to position the option container.\n * When the linked item (outerContainer) updates its position\n * this is rerun by floating-UI\n */\nconst displayOptions = () => {\n if (innerContainer.value && optionsContainer.value) {\n computePosition(innerContainer.value, optionsContainer.value, {\n placement: \"bottom\",\n middleware: [offset(6), flip(), shift()],\n }).then((data) => {\n if (optionsContainer.value) {\n optionsContainer.value.style.left = `${data.x}px`;\n optionsContainer.value.style.top = `${data.y}px`;\n optionsContainer.value.style.width = `${innerContainer.value?.offsetWidth}px`;\n }\n });\n }\n};\n/**\n * We need the transitions because elements must be hidden and shown\n * to accessibility tools when they are fully closed or fully open,\n * while still being animated for sighted users.\n */\n\n// Option panel is open\nconst shown = ref(false);\n// Option panel is opening\nconst showing = ref(false);\n// option panel is closing\nconst hiding = ref(false);\n// Option panel il closed\nconst hidden = ref(true);\n\nconst open = async () => {\n hidden.value = false;\n showing.value = true;\n await wait(props.transitionDuration);\n showing.value = false;\n shown.value = true;\n};\n\nconst close = async () => {\n shown.value = false;\n hiding.value = true;\n await wait(props.transitionDuration);\n hiding.value = false;\n hidden.value = true;\n};\n\n/**\n * Applies a class when the user is inside this whole component.\n * We cannot use focus within as it doesn't work for elements that are teleported.\n * Also we cannot use the <input/> if we phisically move focus to the options so\n * we track it manually.\n */\nconst active = ref(false);\n\n/**\n * When the focus goes to the input we select the current text\n * so the user can replace or delete it.\n * On top of that if the prefill strategy is to prefill on first focus and options\n * weren't already retrieved by the watcher on mount, we do that\n */\nlet isFirstFocus = true;\nconst onInputFocus = async (event: FocusEvent) => {\n emit(\"focus\", event);\n active.value = true;\n document.addEventListener(\"click\", onClickOutside);\n document.addEventListener(\"focusin\", onFocusOutside);\n if (input.value instanceof HTMLInputElement) input.value.select();\n if (props.prefill === \"focus\" && isFirstFocus && !shouldPrefill) {\n await getOptions({ prefill: true });\n isFirstFocus = false;\n }\n};\n\nconst onFocusOutside = (event: FocusEvent) => {\n if (event.target instanceof Node) {\n if (outerContainer.value && optionsContainer.value) {\n if (\n !outerContainer.value.contains(event.target) &&\n !optionsContainer.value.contains(event.target)\n ) {\n close();\n emit(\"inactive\");\n document.removeEventListener(\"focusin\", onFocusOutside);\n active.value = false;\n if (props.multiple)\n wait(500).then(() => {\n query.value = \"\";\n });\n return;\n }\n }\n }\n};\n\n/**\n * On single selection restore the query that might be partially altered by the user.\n * Input can blur either by clicking outside or clicking on an option.\n * We do nothing if the user has selected an option. And we restore the\n * query to its text if the user has moved focus\n */\nconst onInputBlur = async (event: FocusEvent) => {\n emit(\"blur\", event);\n if (!props.multiple) {\n let noop = false;\n const currentModelValue = props.modelValue;\n await Promise.race([\n wait(250),\n waitFor(() => {\n return currentModelValue !== props.modelValue;\n }).then(() => {\n noop = true;\n }),\n ]);\n if (!noop) {\n const found = optionsIndexedByValue.value.get(props.modelValue);\n if (found) {\n query.value = found.text;\n }\n }\n }\n};\n\nconst onInputChange = (event: Event) => emit(\"change\", event);\n\n/**\n * Search at every input by the user.\n * When the user deletes the query unselect the current option\n */\nconst onInputInput = (event: Event) => {\n emit(\"input\", event);\n if (query.value === \"\") {\n if (!props.multiple) {\n emit(\"update:modelValue\", null);\n }\n }\n if (typeof props.items === \"function\") {\n searchByQuery();\n }\n};\n\n// This is the vertical index used to highlight options in the container\nconst focusedIndex = ref<number | null>(null);\n/**\n * Normalize the index using the displayed options so we can start over when reaching the end.\n * Please watch out for the side effect it is used to avoid the\n * complexity of using modulo over negative numbers\n */\nconst normalizedFocusedIndex: ComputedRef<number | null> = computed(() => {\n if (Number.isInteger(focusedIndex.value) && focusedIndex.value) {\n if (focusedIndex.value === -1) {\n focusedIndex.value = filteredOptions.value.length - 1;\n }\n return focusedIndex.value % filteredOptions.value.length;\n }\n return focusedIndex.value;\n});\n\n// This is the horizontal index used to highlight selected options\nconst selectedOptionsFocusedIndex = ref<number | null>(null);\n\n/**\n * Increment the focusIndex and wait for it to be normalized.\n * If the index corresponds to an option scroll it into view\n */\nconst focusOnNextOption = () => {\n if (focusedIndex.value !== null) focusedIndex.value++;\n else {\n focusedIndex.value = 0;\n }\n nextTick().then(() => {\n if (normalizedFocusedIndex.value !== null) {\n const foundOption = optionsContainer.value?.querySelector(\n `#${options.value[normalizedFocusedIndex.value].id}`\n );\n if (foundOption instanceof HTMLElement)\n foundOption.scrollIntoView({\n behavior: \"smooth\",\n block: \"nearest\",\n inline: \"start\",\n });\n }\n });\n};\n\n/**\n * Decrement the focusIndex and wait for it to be normalized.\n * If the index corresponds to an option scroll it into view\n */\nconst focusOnPreviousOption = () => {\n if (focusedIndex.value !== null) focusedIndex.value--;\n else focusedIndex.value = options.value.length - 1;\n\n nextTick().then(() => {\n if (normalizedFocusedIndex.value !== null) {\n const foundOption = optionsContainer.value?.querySelector(\n `#${options.value[normalizedFocusedIndex.value].id}`\n );\n if (foundOption instanceof HTMLElement)\n foundOption.scrollIntoView({\n behavior: \"smooth\",\n block: \"nearest\",\n inline: \"start\",\n });\n }\n });\n};\n\n/**\n * This is handled separately from input because it has a lot to do with user\n * interaction and control characters than it has with the query.\n */\nconst onInputKeyDown = async (event: KeyboardEvent) => {\n if (props.readonly || props.disabled) {\n event.preventDefault();\n return;\n }\n switch (event.key) {\n /**\n * On arrow prevent the page from scrolling.\n * Reset horizontal focus\n * When the panel is open\n * - Focus on the previous option\n * When the panel is closed\n * - focus on the first selected option\n */\n case \"ArrowUp\":\n {\n event.preventDefault();\n if (loading.value) return;\n selectedOptionsFocusedIndex.value = null;\n if (shown.value) {\n focusOnPreviousOption();\n } else {\n if (selectedOptions.value.length) {\n focusedIndex.value = head(selectedOptions.value).index;\n }\n await open();\n }\n }\n break;\n /**\n * On arrow prevent the page from scrolling.\n * Reset horizontal focus\n * When the panel is open\n * - Focus on the previous option\n * When the panel is closed\n * - focus on the first selected option\n */\n case \"ArrowDown\":\n {\n event.preventDefault();\n if (loading.value) return;\n selectedOptionsFocusedIndex.value = null;\n if (shown.value) {\n focusOnNextOption();\n } else {\n if (selectedOptions.value.length) {\n focusedIndex.value = head(selectedOptions.value).index;\n }\n await open();\n }\n }\n break;\n /**\n * When moving horizontally\n * Cycle from rightmost, next, or input focus.\n * If the focus lands on an option align the vertical focus as well\n */\n case \"ArrowLeft\":\n {\n if (loading.value) return;\n if (!query.value) {\n if (selectedOptions.value.length) {\n if (selectedOptionsFocusedIndex.value === null) {\n selectedOptionsFocusedIndex.value =\n selectedOptions.value.length - 1;\n } else if (selectedOptionsFocusedIndex.value > 0) {\n selectedOptionsFocusedIndex.value--;\n } else {\n selectedOptionsFocusedIndex.value = null;\n }\n\n if (selectedOptionsFocusedIndex.value !== null) {\n let linkedOption =\n selectedOptions.value[selectedOptionsFocusedIndex.value];\n let foundOption = optionsContainer.value?.querySelector(\n `#${linkedOption.id}`\n );\n if (foundOption) {\n foundOption.scrollIntoView({\n behavior: \"smooth\",\n block: \"nearest\",\n inline: \"start\",\n });\n\n focusedIndex.value =\n optionsIndexedById.value[\n selectedOptions.value[selectedOptionsFocusedIndex.value].id\n ].index;\n }\n }\n }\n }\n }\n break;\n /**\n * When moving horizontally\n * Cycle from leftmost, next, or input focus.\n * If the focus lands on an option align the vertical focus as well\n */\n case \"ArrowRight\":\n {\n if (loading.value) return;\n if (!query.value) {\n if (selectedOptions.value.length) {\n if (selectedOptionsFocusedIndex.value === null) {\n selectedOptionsFocusedIndex.value = 0;\n } else if (\n selectedOptionsFocusedIndex.value <\n selectedOptions.value.length - 1\n ) {\n selectedOptionsFocusedIndex.value++;\n } else {\n selectedOptionsFocusedIndex.value = null;\n }\n\n if (selectedOptionsFocusedIndex.value !== null) {\n let linkedOption =\n selectedOptions.value[selectedOptionsFocusedIndex.value];\n let foundOption = optionsContainer.value?.querySelector(\n `#${linkedOption.id}`\n );\n if (foundOption) {\n foundOption.scrollIntoView({\n behavior: \"smooth\",\n block: \"nearest\",\n inline: \"start\",\n });\n\n focusedIndex.value =\n optionsIndexedById.value[\n selectedOptions.value[selectedOptionsFocusedIndex.value].id\n ].index;\n }\n }\n }\n }\n }\n break;\n /**\n * If the panel is closed focus on the first selected option.\n * If the panel was already open select/deselect the currently focused option\n * and close the panel of single selection is enabled\n */\n case \"Enter\":\n {\n event.preventDefault();\n if (loading.value) return;\n if (!shown.value) {\n if (filteredOptions.value.length) {\n if (selectedOptions.value.length) {\n focusedIndex.value = head(selectedOptions.value).index;\n }\n }\n await open();\n } else {\n if (normalizedFocusedIndex.value !== null) {\n if (filteredOptions.value[normalizedFocusedIndex.value].disabled)\n return;\n if (!props.multiple) {\n await close();\n }\n onOptionSelected(\n filteredOptions.value[normalizedFocusedIndex.value]\n );\n } else {\n if (props.addOptions) {\n if (props.itemText || props.itemValue) {\n console.error(\n `Adding an option for mapped items is not supported. You can't create an option while passing \"item-text\" or \"item-value\".`\n );\n return;\n }\n addOption();\n const added = last(manualItems.value);\n onOptionSelected(optionsIndexedById.value[added.id]);\n }\n }\n }\n }\n break;\n /**\n * When moving away from the component reset focus both vertically and horizontally\n */\n case \"Tab\":\n case \"Escape\":\n {\n if (shown.value) {\n await close();\n }\n emit(\"inactive\");\n selectedOptionsFocusedIndex.value = null;\n focusedIndex.value = null;\n }\n break;\n // Prevent shift from opening the panel\n case \"Shift\":\n {\n if (loading.value) return;\n }\n break;\n /**\n * Delete behavior is different when query is empty\n * If query is empty\n * If no chip is selected - select rightmost chip\n * If a chip is selected - deselect that option\n * If any option remains move focus to that or reset\n */\n case \"Backspace\":\n {\n if (loading.value) return;\n if (!query.value) {\n if (selectedOptions.value.length) {\n if (selectedOptionsFocusedIndex.value === null) {\n selectedOptionsFocusedIndex.value =\n selectedOptions.value.length - 1;\n } else {\n onOptionSelected(\n selectedOptions.value[selectedOptionsFocusedIndex.value]\n );\n if (selectedOptions.value.length) {\n selectedOptionsFocusedIndex.value = Math.max(\n Math.min(\n selectedOptionsFocusedIndex.value,\n selectedOptions.value.length - 2\n ),\n 0\n );\n } else {\n selectedOptionsFocusedIndex.value = null;\n }\n }\n }\n }\n await open();\n }\n break;\n /**\n * Open the panel on writing and reset horizontal focus\n */\n default:\n {\n selectedOptionsFocusedIndex.value = null;\n focusedIndex.value = null;\n await open();\n }\n break;\n }\n};\n\n/**\n * Triggered on input when items is a function.\n */\n\nlet timeout: ReturnType<typeof setTimeout>;\nconst searchByQuery = () => {\n if (timeout) clearTimeout(timeout);\n timeout = setTimeout(async () => {\n try {\n await getOptions({ prefill: false });\n } catch (error) {\n console.error(error);\n }\n }, props.queryDebounceTime);\n};\n\n/**\n * When clicking on the outside container seamlessly move focus to the input and open the panel\n */\nconst onOuterContainerClick = (event: MouseEvent) => {\n emit(\"click\", event);\n if (props.disabled || props.readonly) return;\n if (input.value instanceof HTMLElement) {\n input.value.focus();\n }\n open();\n};\n\n/**\n * When an option is clicked wait for it to bubble to the option container to avoid slot event problems.\n * Select / deselect the option and then move focus to the input.\n * If it is single selection mode close the panel\n */\nconst onOptionClicked = (event: Event) => {\n if (event.currentTarget instanceof HTMLElement) {\n if (event.currentTarget.classList.contains(\"bb-base-select-option\")) {\n const option = optionsIndexedById.value[event.currentTarget.id];\n if (option.disabled) return;\n onOptionSelected(option);\n if (input.value instanceof HTMLInputElement) {\n input.value.focus();\n }\n if (!props.multiple) close();\n }\n }\n};\n\n/**\n * On click outside of the container close the panel, remove active state.\n * In multiple selection clear query after a timeout\n */\nconst onClickOutside = (event: Event) => {\n if (event.target instanceof Node) {\n if (outerContainer.value) {\n if (!outerContainer.value.contains(event.target)) {\n close();\n emit(\"inactive\");\n document.removeEventListener(\"click\", onClickOutside);\n active.value = false;\n if (props.multiple)\n wait(500).then(() => {\n query.value = \"\";\n });\n return;\n }\n }\n }\n};\n\n/**\n * When using this component for submission we add a bunch of hidden\n * inputs so the submitted inputs are on par with v-model\n */\n/**\n * This is used to keep the value compatible to common html expected values.\n * Convert to string everything that's not but do not double encode strings\n */\nconst makeInputValue = when(\n (item: unknown) => typeof item !== \"string\",\n JSON.stringify\n);\n\nconst hiddenInputs = computed(() => {\n return [].concat(props.modelValue).map((current) => {\n const value = makeInputValue(current);\n return {\n disabled: props.disabled,\n name: props.name,\n type: \"hidden\",\n value: value,\n };\n });\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n class: _normalizeClass({\n 'bb-base-select': true,\n 'bb-base-select--active': active.value,\n 'bb-base-select--loading': loading.value,\n 'bb-base-select--disabled': _ctx.disabled,\n 'bb-base-select--errors': _ctx.hasErrors,\n 'bb-base-select--readonly': _ctx.readonly,\n }),\n onClick: onOuterContainerClick,\n ref_key: \"outerContainer\",\n ref: outerContainer\n }, [\n _renderSlot(_ctx.$slots, \"prepend-outer\"),\n _createElementVNode(\"span\", {\n class: \"bb-base-select__inner-container\",\n ref_key: \"innerContainer\",\n ref: innerContainer\n }, [\n _renderSlot(_ctx.$slots, \"prepend\"),\n _createElementVNode(\"span\", _hoisted_1, [\n (_ctx.multiple)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (_ctx.comma)\n ? (_openBlock(true), _createElementBlock(_Fragment, { key: 0 }, _renderList(selectedOptions.value, (option, index) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n class: _normalizeClass({\n 'bb-base-select__selected': true,\n 'bb-base-select__selected--comma': true,\n 'bb-base-select__selected--focused':\n index === selectedOptionsFocusedIndex.value,\n }),\n key: option.id\n }, _toDisplayString(option.text) + _toDisplayString(index < selectedOptions.value.length - 1 ? \",\" : \"\"), 3))\n }), 128))\n : (_openBlock(true), _createElementBlock(_Fragment, { key: 1 }, _renderList(selectedOptions.value, (option, index) => {\n return (_openBlock(), _createBlock(BbChip, {\n class: _normalizeClass({\n 'bb-base-select__selected': true,\n 'bb-base-select__selected--chip': true,\n 'bb-base-select__selected--focused':\n index === selectedOptionsFocusedIndex.value,\n }),\n clearable: true,\n key: option.id,\n text: option.text,\n \"onClick:clear\": _withModifiers(($event: any) => (onOptionSelected(option)), [\"stop\"])\n }, {\n default: _withCtx(() => [\n _renderSlot(_ctx.$slots, \"chip\", {\n disabled: option.disabled,\n hasErrors: _ctx.hasErrors,\n index: option.index,\n item: option.original,\n loading: !!loading.value,\n manual: option.manual,\n selected: option.selected,\n text: option.text,\n value: option.value\n }, () => [\n _createTextVNode(_toDisplayString(option.text), 1)\n ])\n ]),\n _: 2\n }, 1032, [\"class\", \"text\", \"onClick:clear\"]))\n }), 128))\n ], 64))\n : _createCommentVNode(\"\", true),\n _withDirectives(_createElementVNode(\"input\", {\n autocomplete: _ctx.autocomplete,\n autofocus: _ctx.autofocus,\n class: _normalizeClass('bb-base-select__text-input'),\n disabled: _ctx.disabled,\n id: _ctx.id,\n placeholder: computedPlaceholder.value,\n readonly: _ctx.readonly || !_ctx.allowWriting,\n type: 'text',\n onBlur: _withModifiers(onInputBlur, [\"stop\"]),\n onFocus: _withModifiers(onInputFocus, [\"stop\"]),\n onChange: _withModifiers(onInputChange, [\"stop\"]),\n onInput: _withModifiers(onInputInput, [\"stop\"]),\n onKeydown: _withModifiers(onInputKeyDown, [\"stop\"]),\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((query).value = $event)),\n ref_key: \"input\",\n ref: input\n }, null, 40, _hoisted_2), [\n [_vModelDynamic, query.value]\n ]),\n (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n _createElementVNode(\"span\", {\n class: _normalizeClass({\n 'bb-base-select__options-container': true,\n 'bb-base-select__options-container--shown': shown.value,\n 'bb-base-select__options-container--showing': showing.value,\n 'bb-base-select__options-container--hiding': hiding.value,\n 'bb-base-select__options-container--hidden': hidden.value,\n }),\n role: 'listbox',\n style: _normalizeStyle({ transitionDuration: transitionDuration }),\n tabindex: -1,\n ref_key: \"optionsContainer\",\n ref: optionsContainer\n }, [\n _renderSlot(_ctx.$slots, \"options:prepend\"),\n (!filteredOptions.value.length && loading.value)\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_3, [\n _renderSlot(_ctx.$slots, 'loading', { query: query.value }, () => [\n _createTextVNode(_toDisplayString(_ctx.loadingText), 1)\n ])\n ]))\n : (!filteredOptions.value.length)\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_4, [\n _renderSlot(_ctx.$slots, 'no-data', { query: query.value }, () => [\n _createTextVNode(_toDisplayString(_ctx.noDataText), 1)\n ])\n ]))\n : _createCommentVNode(\"\", true),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(filteredOptions.value, (option) => {\n return (_openBlock(), _createElementBlock(_Fragment, {\n key: option.id\n }, [\n _renderSlot(_ctx.$slots, \"option:prepend\", {\n item: option.original\n }),\n _createElementVNode(\"span\", {\n \"aria-selected\": option.selected,\n class: _normalizeClass({\n 'bb-base-select-option': true,\n 'bb-base-select-option--selected': option.selected,\n 'bb-base-select-option--focused': option.focused,\n 'bb-base-select-option--disabled': option.disabled,\n }),\n id: option.id,\n role: 'option',\n onClick: _withModifiers(onOptionClicked, [\"stop\"])\n }, [\n _renderSlot(_ctx.$slots, \"option\", {\n disabled: option.disabled,\n focused: option.focused,\n hasErrors: _ctx.hasErrors,\n index: option.index,\n item: option.original,\n loading: !!loading.value,\n manual: option.manual,\n selected: option.selected,\n text: option.text,\n value: option.value\n }, () => [\n _createElementVNode(\"span\", _hoisted_6, [\n _createElementVNode(\"span\", _hoisted_7, _toDisplayString(option.text), 1)\n ])\n ])\n ], 10, _hoisted_5),\n _renderSlot(_ctx.$slots, \"option:append\", {\n item: option.original\n })\n ], 64))\n }), 128)),\n _renderSlot(_ctx.$slots, \"options:append\")\n ], 6)\n ]))\n ]),\n _createElementVNode(\"span\", _hoisted_8, [\n _renderSlot(_ctx.$slots, \"chevron\", {\n loading: !!loading.value,\n shown: shown.value\n }, () => [\n _hoisted_9\n ])\n ]),\n (!loading.value)\n ? _renderSlot(_ctx.$slots, \"append\", { key: 0 })\n : (_openBlock(), _createElementBlock(\"span\", {\n key: 1,\n class: _normalizeClass({\n 'bb-base-select__spinner': true,\n 'bb-base-select__spinner--loading': loading.value,\n })\n }, [\n _renderSlot(_ctx.$slots, 'spinner', {\n loading: !!loading.value\n }, () => [\n _createVNode(BbSpinner, { size: 'sm' })\n ])\n ], 2))\n ], 512),\n _renderSlot(_ctx.$slots, \"append-outer\"),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(hiddenInputs.value, (input) => {\n return (_openBlock(), _createElementBlock(\"input\", _mergeProps({\n key: input.value\n }, input), null, 16))\n }), 128))\n ], 2))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_sfc_main","_defineComponent","__props","__emit","props","emit","outerContainer","ref","innerContainer","optionsContainer","input","query","computedPlaceholder","computed","selectedOptions","loading","transitionDuration","cleanUpPositioning","onMounted","autoUpdate","displayOptions","onBeforeUnmount","internalItems","stash","manualItems","getItemText","useItemText","getItemValue","useItemValue","internalOptions","item","_","text","value","jsonValue","options","fromOptions","acc","curr","withManual","withStash","option","index","isNotNil","modelValueIndexed","filteredOptions","base","matchedAnything","keys","propName","normalizedFocusedIndex","optionsIndexedById","optionsIndexedByValue","indexed","key","_a","pairs","deepEqual","map","linkedOption","onOptionSelected","valueToEmit","focusedIndex","current","stashed","getOptions","prefill","items","addOption","shouldPrefill","modelValueTimeout","watch","previous","allFound","coherentStash","coherent","found","currentQuery","depsTimeout","isFirstFocus","computePosition","offset","flip","shift","data","shown","showing","hiding","hidden","open","wait","close","active","onInputFocus","event","onClickOutside","onFocusOutside","onInputBlur","noop","currentModelValue","waitFor","onInputChange","onInputInput","searchByQuery","selectedOptionsFocusedIndex","focusOnNextOption","nextTick","foundOption","focusOnPreviousOption","onInputKeyDown","head","_b","added","last","timeout","error","onOuterContainerClick","onOptionClicked","makeInputValue","when","hiddenInputs","_ctx","_cache","_openBlock","_createElementBlock","_normalizeClass","_renderSlot","_createElementVNode","_Fragment","_renderList","_toDisplayString","_createBlock","BbChip","_withModifiers","$event","_withCtx","_createTextVNode","_createCommentVNode","_withDirectives","_vModelDynamic","_Teleport","_normalizeStyle","_createVNode","BbSpinner","_mergeProps"],"mappings":";;;;;;;;;;;;;;;;AAG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AAO,CAAC9G,OAC/EiH,EAAW,GAAGC,EAAoB,SAASoB,GAAY;AAAA,QAC7D,KAAKtI,EAAM;AAAA,MACVA,GAAAA,CAAK,GAAG,MAAM,EAAE,EACpB,GAAG,GAAG;AAAA,OACN,CAAC;AAAA,EAEN;AAEA,CAAC;"}
|
|
1
|
+
{"version":3,"file":"index31.js","sources":["../src/components/BaseSelect/BaseSelect.vue?vue&type=script&setup=true&lang.ts"],"sourcesContent":["import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, withModifiers as _withModifiers, withCtx as _withCtx, createBlock as _createBlock, vModelDynamic as _vModelDynamic, createElementVNode as _createElementVNode, withDirectives as _withDirectives, normalizeStyle as _normalizeStyle, Teleport as _Teleport, createVNode as _createVNode, mergeProps as _mergeProps } from \"vue\"\n\nconst _hoisted_1 = { class: \"bb-base-select__input-container\" }\nconst _hoisted_2 = [\"id\", \"autocomplete\", \"autofocus\", \"disabled\", \"placeholder\", \"readonly\"]\nconst _hoisted_3 = {\n key: 0,\n class: \"bb-base-select__loading-container\"\n}\nconst _hoisted_4 = {\n key: 1,\n class: \"bb-base-select__no-data-container\"\n}\nconst _hoisted_5 = [\"id\", \"aria-selected\"]\nconst _hoisted_6 = { class: \"bb-base-select-option__content\" }\nconst _hoisted_7 = { class: \"bb-base-select-option__text\" }\nconst _hoisted_8 = { class: \"bb-base-select__chevron\" }\nconst _hoisted_9 = /*#__PURE__*/_createElementVNode(\"svg\", {\n fill: \"none\",\n viewBox: \"0 0 16 8\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n \"clip-rule\": \"evenodd\",\n d: \"M0.851779 0.225802C0.90403 0.173418 0.966103 0.131858 1.03444 0.1035C1.10278 0.0751431 1.17604 0.0605469 1.25003 0.0605469C1.32402 0.0605469 1.39728 0.0751431 1.46562 0.1035C1.53396 0.131858 1.59603 0.173418 1.64828 0.225802L8.00003 6.57868L14.3518 0.225802C14.4041 0.173503 14.4662 0.132017 14.5345 0.103713C14.6028 0.0754093 14.6761 0.0608414 14.75 0.0608414C14.824 0.0608414 14.8972 0.0754093 14.9656 0.103713C15.0339 0.132017 15.096 0.173503 15.1483 0.225802C15.2006 0.278101 15.2421 0.340189 15.2704 0.408521C15.2987 0.476852 15.3132 0.55009 15.3132 0.624052C15.3132 0.698014 15.2987 0.771252 15.2704 0.839584C15.2421 0.907916 15.2006 0.970003 15.1483 1.0223L8.39828 7.7723C8.34603 7.82469 8.28395 7.86625 8.21562 7.8946C8.14728 7.92296 8.07402 7.93756 8.00003 7.93756C7.92604 7.93756 7.85278 7.92296 7.78444 7.8946C7.7161 7.86625 7.65403 7.82469 7.60178 7.7723L0.851779 1.0223C0.799395 0.970051 0.757835 0.907978 0.729477 0.83964C0.70112 0.771302 0.686523 0.69804 0.686523 0.624052C0.686523 0.550064 0.70112 0.476803 0.729477 0.408464C0.757835 0.340126 0.799395 0.278053 0.851779 0.225802Z\",\n fill: \"currentColor\",\n \"fill-rule\": \"evenodd\"\n })\n], -1)\n\nimport BbChip from '../BbChip/BbChip.vue';\nimport BbSpinner from '../BbSpinner/BbSpinner.vue';\nimport {\n\tautoUpdate,\n\tcomputePosition,\n\tflip,\n\toffset,\n\tshift,\n} from '@floating-ui/dom';\nimport {\n\tcomputed,\n\tnextTick,\n\tonBeforeUnmount,\n\tonMounted,\n\tref,\n\twatch,\n} from 'vue';\nimport { deepEqual } from 'fast-equals';\nimport { head } from '@/utilities/functions/head';\nimport { isNotNil } from '@/utilities/functions/isNotNil';\nimport { last } from '@/utilities/functions/last';\nimport { useItemText } from '@/composables/useItemText';\nimport { useItemValue } from '@/composables/useItemValue';\nimport { wait } from '@/utilities/functions/wait';\nimport { waitFor } from '@/utilities/functions/waitFor';\nimport { when } from '@/utilities/functions/when';\nimport type { ComputedRef, HTMLAttributes, InputHTMLAttributes } from 'vue';\nimport type { NestedKeyOf } from '@/types/NestedKeyOf';\n\nexport type BaseSelectProps<T> = {\n\t/**\n\t * Allows typing into the input.\n\t */\n\tallowWriting?: boolean;\n\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\n\t/**\n\t * Defines an array of dependencies that will trigger actions in the component upon change.\n\t */\n\tdependencies?: any[];\n\n\t/**\n\t * Timeout used to debounce response to changes to dependencies.\n\t */\n\tdepsDebounceTime?: number;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * If coherence is enforce the input cannot have a modelValue the is incoherent with its current items.\n\t *\n\t * e.g. You cannot set v-model to a user that is not present in the items passed.\n\t *\n\t * modelValue will be reset upon incoherence.\n\t */\n\tenforceCoherence?: boolean;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid?: HTMLAttributes['id'];\n\n\t/**\n\t * String displayed while items are being loaded.\n\t */\n\tloadingText?: string;\n\n\t/**\n\t * Defines the strategy used to understand whether an option has been selected.\n\t * `string` is 40% faster but relies on property order.\n\t * `equality` is more reliable but is slower.\n\t */\n\tmatchStrategy?: 'string' | 'equality';\n\n\t/**\n\t * Timeout used to debounce response to changes to modelValue.\n\t */\n\tmodelValueDebounceTime?: number;\n\n\t/**\n\t * Allows the selection of multiple items.\n\t */\n\tmultiple?: boolean;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there are no items to display.\n\t */\n\tnoDataText?: string;\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * How long the transition has to last in milliseconds\n\t */\n\ttransitionDuration?: number;\n\t/**\n\t * Used to retrieve items can be an array or a function.\n\t */\n\titems:\n\t\t| T[]\n\t\t| ((query: string, prefill: boolean, modelValue: any) => Promise<T[]>)\n\t\t| ((query: string, prefill: boolean, modelValue: any) => T[]);\n\n\t/**\n\t * Defines a path that returns a property of the object to use as text or a function that returns a string\n\t */\n\titemText?: T extends object\n\t\t? NestedKeyOf<T> | ((item: T) => string)\n\t\t: ((item: T) => string) | undefined;\n\n\t/**\n\t * Defines a path that returns a property of the object to use as value or a function that returns any value\n\t */\n\titemValue?: T extends object\n\t\t? NestedKeyOf<T> | ((item: T) => string)\n\t\t: ((item: T) => any) | undefined;\n\t/**\n\t * Used by v-model. Can be any serializable type.\n\t */\n\tmodelValue: any;\n\n\t/**\n\t * Allows the user to add options to the list by\n\t * inserting text in the input and pressing ENTER.\n\t * The value and text of the option generated is a\n\t * string equal to what has been inserted.\n\t */\n\taddOptions?: boolean;\n\t/**\n\t * Sets the display model for selected values to a list\n\t * of comma separated string. In this mode the user\n\t * cannot deselect an option by pressing the close button.\n\t */\n\tcomma?: boolean;\n\t/**\n\t * Defines how the filtering should work.\n\t * In any case options are always filtered by the text displayed but\n\t * they can also take into account other properties of the\n\t * passed elements when this property is a string or an array of string.\n\t * E.g. items could be a list of users and you can filter users by email or phone by passing `['email', 'phone']`\n\t * You can also pass false to not filter anything or a function for more granular control.\n\t *\n\t */\n\tfilterBy?:\n\t\t| string\n\t\t| string[]\n\t\t| false\n\t\t| ((value: any, item: T) => boolean)\n\t\t| null;\n\t/**\n\t * Defines the prefill strategy for the input. By default the input will prefill\n\t * on focus. It can also always prefill with `true` and only prefill on search with `false`.\n\t */\n\tprefill?: boolean | 'focus';\n\t/**\n\t * Time to wait when the users stops writing in the input before querying data.\n\t * Especially useful when searching live data on big datasets.\n\t */\n\tqueryDebounceTime?: number;\n\t/**\n\t * If `true` when in multiple selection, reset the query immediately\n\t * upon selecting an option. By default the query is\n\t * not reset until focus is lost so the user can search\n\t * for \"Cath\" and select \"Cathy\" and then write more to\n\t * search for \"Catherine\"\n\t */\n\tresetQueryOnOptionSelected?: boolean;\n\t/**\n\t * Adds a stash to accumulate selected values. Especially\n\t * useful when searching in a big database of items.\n\t * E.g. if you search for \"John\" and then search for \"Richard\"\n\t * you either always return the previous items or you stash them passing `true` to this option.\n\t */\n\tstash?: boolean;\n\t/**\n\t * Pass `true` if the dropdown is not updating following movement in the UI, like in modals. Very expensive so use with care.\n\t */\n\tupdateOnAnimationFrame?: boolean;\n};\n\nexport type BaseOption<T> = {\n\tid: string;\n\tjsonValue: string;\n\tmanual: boolean;\n\toriginal: T;\n\ttext: string;\n\tvalue: any;\n\tdisabled: boolean;\n};\n\nexport type Option<T> = BaseOption<T> & {\n\tindex: number;\n\tselected: boolean;\n};\n\nexport type FilteredOption<T> = Option<T> & {\n\tfocused: boolean;\n};\n\nexport type BaseSelectEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\t(e: 'change', event: Event): void;\n\t(e: 'click', event: MouseEvent): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'inactive'): void;\n\t(e: 'input', event: Event): void;\n\t(e: 'update:modelValue', value: any): void;\n};\n\nexport type BaseSelectSlots<T> = {\n\t'prepend-outer'?: (props: {}) => any;\n\tprepend?: (props: {}) => any;\n\t'options:prepend'?: (props: {}) => any;\n\tloading?: (props: { query: string }) => any;\n\t'no-data'?: (props: { query: string }) => any;\n\t'option:prepend'?: (props: { item: T }) => any;\n\tchip?: (props: {\n\t\tdisabled: boolean;\n\t\thasErrors?: boolean;\n\t\tindex: number;\n\t\titem: T;\n\t\tloading: boolean;\n\t\tmanual: boolean;\n\t\tselected: boolean;\n\t\ttext: string;\n\t\tvalue: any;\n\t}) => any;\n\toption?: (props: {\n\t\tdisabled: boolean;\n\t\tfocused: boolean;\n\t\thasErrors?: boolean;\n\t\tindex: number;\n\t\titem: T;\n\t\tloading: boolean;\n\t\tmanual: boolean;\n\t\tselected: boolean;\n\t\ttext: string;\n\t\tvalue: any;\n\t}) => any;\n\t'option:append'?: (props: { item: T }) => any;\n\t'options:append'?: (props: {}) => any;\n\tchevron?: (props: { loading: boolean; shown: boolean }) => any;\n\tappend?: (props: {}) => any;\n\tspinner?: (props: { loading: boolean }) => any;\n\t'append-outer'?: (props: {}) => any;\n};\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseSelect',\n props: {\n allowWriting: { type: Boolean, default: true },\n autocomplete: {},\n autofocus: {},\n dependencies: {},\n depsDebounceTime: { default: 0 },\n disabled: { type: Boolean },\n enforceCoherence: { type: Boolean },\n hasErrors: { type: Boolean },\n id: {},\n loadingText: { default: 'Caricamento...' },\n matchStrategy: { default: 'string' },\n modelValueDebounceTime: { default: 0 },\n multiple: { type: Boolean },\n name: {},\n noDataText: { default: 'Nessun elemento da visualizzare' },\n placeholder: {},\n readonly: {},\n transitionDuration: { default: 200 },\n items: {},\n itemText: {},\n itemValue: {},\n modelValue: {},\n addOptions: { type: Boolean },\n comma: { type: Boolean },\n filterBy: { type: [String, Array, Boolean, Function, null], default: () => [] },\n prefill: { type: [Boolean, String], default: 'focus' },\n queryDebounceTime: { default: 500 },\n resetQueryOnOptionSelected: { type: Boolean },\n stash: { type: Boolean },\n updateOnAnimationFrame: { type: Boolean, default: false }\n },\n emits: [\"blur\", \"change\", \"click\", \"focus\", \"inactive\", \"input\", \"update:modelValue\"],\n setup(__props: any, { emit: __emit }) {\n\nconst props = __props;\n\nconst emit = __emit;\n\n\n\nif (props.multiple && !Array.isArray(props.modelValue)) {\n\tthrow new Error('Multiple is set to \"true\" but modelValue is not an array.');\n}\n\nconst outerContainer = ref<HTMLElement | null>(null);\nconst innerContainer = ref<HTMLElement | null>(null);\nconst optionsContainer = ref<HTMLElement | null>(null);\nconst input = ref<HTMLElement | null>(null);\nconst query = ref<string>('');\nconst computedPlaceholder = computed(() => {\n\tif (selectedOptions.value.length) return '';\n\telse return props.placeholder;\n});\n/**\n * Use a number accumulator because if the fn takes 5 seconds\n * and after 2 seconds another search is run\n * When the first returns the second is still out for 2 seconds\n * and we want to track them both.\n * Debounce will not be enough.\n */\nconst loading = ref(0);\nconst transitionDuration = props.transitionDuration / 1000 + 's';\nlet cleanUpPositioning: () => void;\n\nonMounted(async () => {\n\tif (innerContainer.value && optionsContainer.value) {\n\t\tcleanUpPositioning = autoUpdate(\n\t\t\tinnerContainer.value,\n\t\t\toptionsContainer.value,\n\t\t\tdisplayOptions,\n\t\t\t{\n\t\t\t\tancestorResize: true,\n\t\t\t\tancestorScroll: true,\n\t\t\t\tanimationFrame: props.updateOnAnimationFrame,\n\t\t\t\telementResize: true,\n\t\t\t}\n\t\t);\n\t}\n});\nonBeforeUnmount(() => {\n\tcleanUpPositioning();\n});\n\nconst internalItems = ref<T[]>([]);\nconst stash = ref<BaseOption<T>[]>([]);\nconst manualItems = ref<BaseOption<T>[]>([]);\nconst { getItemText } = useItemText();\nconst { getItemValue } = useItemValue();\n\nconst internalOptions = computed<BaseOption<T>[]>(() => {\n\treturn internalItems.value.map((item: any, _) => {\n\t\tconst text = getItemText(item, props.itemText as any);\n\t\tconst value = getItemValue(item, props.itemValue);\n\n\t\t// Undefined is not JSONable\n\t\tif (value === undefined)\n\t\t\tthrow new Error(\n\t\t\t\t'The result of extracting \"value\" from option was undefined. Affected item is ' +\n\t\t\t\t\tJSON.stringify(item) +\n\t\t\t\t\t' please check itemValue property is correct.'\n\t\t\t);\n\n\t\tconst jsonValue = JSON.stringify(value);\n\t\treturn {\n\t\t\tdisabled: !!item.disabled,\n\t\t\tid: 'option_' + jsonValue.replace(/\\W/g, '_'),\n\t\t\tjsonValue,\n\t\t\tmanual: false,\n\t\t\toriginal: item,\n\t\t\ttext,\n\t\t\tvalue,\n\t\t};\n\t});\n});\n\nconst options = computed<Option<T>[]>(() => {\n\tlet fromOptions = internalOptions.value.reduce(\n\t\t(acc: { [key: string]: BaseOption<T> }, curr: BaseOption<T>) => {\n\t\t\tacc[curr.id] = curr;\n\t\t\treturn acc;\n\t\t},\n\t\t{}\n\t);\n\tconst withManual: { [key: string]: BaseOption<T> } = manualItems.value.reduce(\n\t\t(acc, curr) => {\n\t\t\tif (!acc[curr.id]) acc[curr.id] = curr as any;\n\t\t\treturn acc;\n\t\t},\n\t\tfromOptions\n\t);\n\tconst withStash: { [key: string]: BaseOption<T> } = stash.value.reduce(\n\t\t(acc, curr) => {\n\t\t\tif (!acc[curr.id]) acc[curr.id] = curr as any;\n\t\t\treturn acc;\n\t\t},\n\t\twithManual\n\t);\n\treturn Object.values(withStash).map<Option<T>>(\n\t\t(option: BaseOption<T>, index) => {\n\t\t\treturn {\n\t\t\t\t...option,\n\t\t\t\tselected: isNotNil(modelValueIndexed.value.get(option.value)),\n\t\t\t\tindex,\n\t\t\t};\n\t\t}\n\t);\n});\n\n/**\n * Filter options to be displayed based on the current query.\n * If no query is used or when query is set from the inside (after a selection) display all possible options\n */\nconst filteredOptions = computed<FilteredOption<T>[]>(() => {\n\tlet base = [];\n\t/** Only filter when a value is being searched not when the query is fully set on a selected option text */\n\tif (\n\t\tquery.value &&\n\t\t!selectedOptions.value.some(\n\t\t\t(option: Option<T>) => option.text === query.value\n\t\t)\n\t) {\n\t\tbase = options.value.filter((item: Option<T>) => {\n\t\t\tlet matchedAnything = false;\n\t\t\tif (!props.filterBy) return true;\n\t\t\telse if (typeof props.filterBy === 'function')\n\t\t\t\tmatchedAnything = props.filterBy(item.value, item.original);\n\t\t\telse if (props.filterBy.length) {\n\t\t\t\tconst keys = ([] as string[]).concat(props.filterBy);\n\t\t\t\tfor (let index = 0; index < keys.length; index++) {\n\t\t\t\t\tconst propName = keys[index];\n\t\t\t\t\tmatchedAnything =\n\t\t\t\t\t\tmatchedAnything ||\n\t\t\t\t\t\t((item.original as any)[propName] &&\n\t\t\t\t\t\t\t(item.original as any)[propName]\n\t\t\t\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t\t\t\t.includes(query.value.toLowerCase()));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn (\n\t\t\t\tmatchedAnything ||\n\t\t\t\titem.text.toLowerCase().includes(query.value.toLowerCase())\n\t\t\t);\n\t\t});\n\t\t/** Otherwise defaul;t to the whole set of options */\n\t} else base = options.value;\n\t/** This is done here so that only visible options are highlighted */\n\treturn base.map((option: Option<T>, index) => ({\n\t\t...option,\n\t\tfocused: normalizedFocusedIndex.value === index,\n\t}));\n});\n\n/**\n * Indexes options by id for retrieval\n */\n\nconst optionsIndexedById = computed<{\n\t[key: string]: Option<T>;\n}>(() =>\n\toptions.value.reduce(\n\t\t(acc, curr) => ({\n\t\t\t...acc,\n\t\t\t[curr.id]: curr,\n\t\t}),\n\t\t{}\n\t)\n);\n\n/**\n * Indexes options by their value\n * (using JSON to circumvent identical objects not being equal in JS)\n */\nconst optionsIndexedByValue = computed(() => {\n\tif (props.matchStrategy === 'string') {\n\t\tlet indexed = options.value.reduce(\n\t\t\t(acc: { [key: string]: Option<T> }, curr: Option<T>) => {\n\t\t\t\tacc[curr.jsonValue] = curr;\n\t\t\t\treturn acc;\n\t\t\t},\n\t\t\t{}\n\t\t);\n\t\treturn {\n\t\t\tget: (key: any) => {\n\t\t\t\treturn indexed[JSON.stringify(key)];\n\t\t\t},\n\t\t};\n\t} else if (props.matchStrategy === 'equality') {\n\t\tlet indexed: [any, Option<T>][] = options.value.map((option) => [\n\t\t\toption.value,\n\t\t\toption,\n\t\t]);\n\n\t\treturn {\n\t\t\tget: (key: any) => {\n\t\t\t\treturn indexed.find((pairs) => deepEqual(pairs[0], key))?.[1];\n\t\t\t},\n\t\t};\n\t} else {\n\t\tthrow new Error('No match strategy has been defined');\n\t}\n});\n\n/**\n * Indexes modelValue to a map so when can easily know which values are selected\n * (using JSON to circumvent identical object not being equal in JS)\n */\nconst modelValueIndexed = computed(() => {\n\tif (props.matchStrategy === 'string') {\n\t\tlet map: { [key: string]: number } = {};\n\t\t[].concat(props.modelValue).forEach((value: any, index: number) => {\n\t\t\tmap[JSON.stringify(value)] = index;\n\t\t});\n\t\treturn {\n\t\t\tget: (value: any) => map[JSON.stringify(value)],\n\t\t};\n\t} else if (props.matchStrategy === 'equality') {\n\t\tconst map = []\n\t\t\t.concat(props.modelValue)\n\t\t\t.filter(isNotNil)\n\t\t\t.map((value, index) => [value, index]);\n\n\t\treturn {\n\t\t\tget: (key: any) => {\n\t\t\t\treturn map.find((pairs) => deepEqual(pairs[0], key))?.[1];\n\t\t\t},\n\t\t};\n\t} else {\n\t\tthrow new Error('No match strategy has been defined');\n\t}\n});\n\n/**\n * For every item in modelValue find the linked option if it exists.\n * This is used to display chips.\n */\nconst selectedOptions = computed(() => {\n\treturn [].concat(props.modelValue).reduce((acc: Option<T>[], curr: any) => {\n\t\tconst linkedOption = optionsIndexedByValue.value.get(curr);\n\t\tif (linkedOption) acc.push(linkedOption);\n\t\treturn acc;\n\t}, []);\n});\n\n/**\n * When selecting an option split behavior based on single or multiple selection\n */\nconst onOptionSelected = (option: Option<T>) => {\n\tlet valueToEmit;\n\tfocusedIndex.value = option.index;\n\t/**\n\t * For single selection:\n\t * If the option was already selected - restore the value to default, clean the stash, manual items, and query.\n\t * If the option was not selected - use its value, save the option in the stash and display it's text as query\n\t * The stash is used to remove the complexity of stashing items when searching for identifying information,\n\t * like searching an address would not return the option that was used to selected a previous address in another country.\n\t * Or when searching users by username would not return the previous ones.\n\t * We save it so the user hasn't to.\n\t */\n\tif (!props.multiple) {\n\t\tif (option.selected) {\n\t\t\tif (option.manual) {\n\t\t\t\tmanualItems.value = manualItems.value.filter(\n\t\t\t\t\t(current: any) => current.id !== option.id\n\t\t\t\t);\n\t\t\t}\n\t\t\tvalueToEmit = null;\n\t\t\tif (props.stash) {\n\t\t\t\tstash.value = [];\n\t\t\t}\n\t\t\tquery.value = '';\n\t\t} else {\n\t\t\tvalueToEmit = option.value;\n\t\t\tif (props.stash) {\n\t\t\t\tstash.value = [option as any];\n\t\t\t}\n\t\t\tquery.value = option.text;\n\t\t}\n\t\t/**\n\t\t * For multiple selection\n\t\t * If the option was selected remove it from modelValue, if it is a mnaual iutem also remove it from there.\n\t\t * In the stash we can search for the id of the option.\n\t\t * If the option was not selected we can just add it to modelValue and the stash.\n\t\t */\n\t} else {\n\t\tif (option.selected) {\n\t\t\tif (option.manual) {\n\t\t\t\tmanualItems.value = manualItems.value.filter(\n\t\t\t\t\t(current: any) => current.id !== option.id\n\t\t\t\t);\n\t\t\t}\n\t\t\tvalueToEmit = props.modelValue.filter(\n\t\t\t\t(value: any) => JSON.stringify(value) !== option.jsonValue\n\t\t\t);\n\t\t\tif (props.stash) {\n\t\t\t\tstash.value = stash.value.filter((stashed) => stashed.id !== option.id);\n\t\t\t}\n\t\t} else {\n\t\t\tvalueToEmit = props.modelValue.concat(option.value);\n\t\t\tif (props.stash) {\n\t\t\t\tstash.value = stash.value.concat(option as any);\n\t\t\t}\n\t\t}\n\t\tif (props.resetQueryOnOptionSelected) {\n\t\t\tquery.value = '';\n\t\t}\n\t}\n\temit('update:modelValue', valueToEmit);\n};\n\nconst getOptions = async ({ prefill = false }) => {\n\tlet items: T[] = [];\n\tif (Array.isArray(props.items)) {\n\t\titems = props.items;\n\t} else {\n\t\tif (typeof props.items === 'function') {\n\t\t\tloading.value++;\n\t\t\titems = await props.items(query.value, prefill, props.modelValue);\n\t\t\tloading.value--;\n\t\t}\n\t}\n\tinternalItems.value = items as any;\n};\n\n/**\n * Add an option to the manual items and then reset the query\n */\nconst addOption = () => {\n\tconst text = query.value;\n\tconst value = query.value;\n\tconst jsonValue = JSON.stringify(value);\n\tconst option = {\n\t\ttext,\n\t\tvalue,\n\t\tjsonValue,\n\t\tid: 'option_' + jsonValue.replace(/\\W/g, '_'),\n\t\toriginal: value,\n\t\tmanual: true,\n\t\tdisabled: false,\n\t};\n\tmanualItems.value = manualItems.value.concat(option as any);\n\tquery.value = '';\n};\n\n/**\n * It should prefill if asked, or\n * when single if modelValue is not null\n * when multiple if modelValue is not empty\n */\nconst shouldPrefill =\n\tprops.prefill === true ||\n\t(!props.multiple && isNotNil(props.modelValue)) ||\n\t(props.multiple && !!props.modelValue.length);\n/**\n * When modelValue changes split behavior for single and multiple selection:\n */\nlet modelValueTimeout: ReturnType<typeof setTimeout>;\nlet hasRunOnce = false;\nwatch(\n\t() => props.modelValue,\n\t(current, previous) => {\n\t\tif (modelValueTimeout) clearTimeout(modelValueTimeout);\n\t\tmodelValueTimeout = setTimeout(\n\t\t\tasync () => {\n\t\t\t\t/**\n\t\t\t\t * For single selection if the value is already in the option (most likely you are using\n\t\t\t\t * static items) just use it.\n\t\t\t\t * If the value is not in the options try searching for it (outside dependencies may fix it).\n\t\t\t\t * If at last the value cannot be found even after searching\n\t\t\t\t * reset value to the default value when coherence is enforced\n\t\t\t\t * or at least do not display the old query\n\t\t\t\t */\n\t\t\t\tif (!props.multiple) {\n\t\t\t\t\tlet found = optionsIndexedByValue.value.get(props.modelValue);\n\t\t\t\t\tif (\n\t\t\t\t\t\t(!found && isNotNil(props.modelValue)) ||\n\t\t\t\t\t\tprevious === undefined\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst currentQuery = query.value;\n\t\t\t\t\t\tquery.value = '';\n\t\t\t\t\t\tawait getOptions({ prefill: true });\n\t\t\t\t\t\tquery.value = currentQuery;\n\t\t\t\t\t}\n\t\t\t\t\tfound = optionsIndexedByValue.value.get(props.modelValue);\n\t\t\t\t\tif (found) {\n\t\t\t\t\t\tquery.value = found.text;\n\t\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\t\tstash.value = [found as any];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (props.enforceCoherence && isNotNil(current)) {\n\t\t\t\t\t\t\tquery.value = '';\n\t\t\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\t\t\tstash.value = [];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\temit('update:modelValue', null);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tquery.value = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/**\n\t\t\t\t\t * For multiple selection if every value is already in the options (most likely you are using\n\t\t\t\t\t * static items) just use them.\n\t\t\t\t\t * If not all the values are in the current options or is prefilling try searching (outside depencencies may fix the situation).\n\t\t\t\t\t * If the values are still not in the available options and coherence is enforced\n\t\t\t\t\t * discard the ones that are invalid.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t} else {\n\t\t\t\t\tif (!Array.isArray(props.modelValue)) {\n\t\t\t\t\t\tthrow new Error('props.modelValue is not an array.');\n\t\t\t\t\t}\n\t\t\t\t\tlet allFound = props.modelValue.every((value: any) =>\n\t\t\t\t\t\toptionsIndexedByValue.value.get(value)\n\t\t\t\t\t);\n\t\t\t\t\tif (!allFound || previous === undefined) {\n\t\t\t\t\t\tawait getOptions({ prefill: true });\n\t\t\t\t\t\tallFound = props.modelValue.every((value: any) =>\n\t\t\t\t\t\t\toptionsIndexedByValue.value.get(value)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tif (allFound) {\n\t\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\t\tstash.value = props.modelValue.map(\n\t\t\t\t\t\t\t\t(value: any) => optionsIndexedByValue.value.get(value)!\n\t\t\t\t\t\t\t) as any;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet coherentStash: Option<T>[] = [];\n\t\t\t\t\t\tconst coherent = current.filter((value: any) => {\n\t\t\t\t\t\t\tlet found = optionsIndexedByValue.value.get(value);\n\t\t\t\t\t\t\tif (found) coherentStash.push(found);\n\t\t\t\t\t\t\treturn found;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\t\tstash.value = coherentStash as any;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (props.enforceCoherence) {\n\t\t\t\t\t\t\temit('update:modelValue', coherent);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tshouldPrefill ? 0 : props.modelValueDebounceTime\n\t\t);\n\t},\n\t// Prefill when asked or when items are static\n\t{ immediate: shouldPrefill, deep: true }\n);\n\n/**\n * This is triggered to refresh static items whenever the passed array changes.\n * If the parent defines an array in the template this is triggered\n * at every render so we take counter measures\n * Even if the entire array changes all the previously selected values are still in the stash.\n */\nwatch(\n\t() => props.items,\n\tasync (current, previous) => {\n\t\tif (\n\t\t\ttypeof current === 'function' ||\n\t\t\t// Circumvent arrays defined in the template by the parent\n\t\t\tJSON.stringify(current) !== JSON.stringify(previous)\n\t\t) {\n\t\t\tawait getOptions({ prefill: false });\n\t\t\tif (props.multiple) {\n\t\t\t\tconst allFound = props.modelValue.every((value: any) =>\n\t\t\t\t\toptionsIndexedByValue.value.get(value)\n\t\t\t\t);\n\n\t\t\t\tif (!allFound) {\n\t\t\t\t\tif (props.enforceCoherence) {\n\t\t\t\t\t\tconst coherent = props.modelValue.filter((value: any) => {\n\t\t\t\t\t\t\tlet found = optionsIndexedByValue.value.get(value);\n\t\t\t\t\t\t\treturn found;\n\t\t\t\t\t\t});\n\t\t\t\t\t\temit('update:modelValue', coherent);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlet found = optionsIndexedByValue.value.get(props.modelValue);\n\t\t\t\tif (!found && props.enforceCoherence && isNotNil(props.modelValue)) {\n\t\t\t\t\temit('update:modelValue', null);\n\t\t\t\t}\n\t\t\t\tfocusedIndex.value = null;\n\t\t\t}\n\t\t}\n\t}\n);\n\n/**\n * When dependencies change\n * If the input has not been prefilled yet just return\n * Check dependencies are the same by value and not reference\n * Otherwise we search again for options as they might be different base on dependencies.\n * If coherence is enforced we set the state accordingly\n */\nlet depsTimeout: ReturnType<typeof setTimeout>;\nwatch(\n\t() => props.dependencies,\n\t(current, previous) => {\n\t\tif (!shouldPrefill && props.prefill === 'focus' && isFirstFocus) {\n\t\t\treturn;\n\t\t}\n\t\t// Circumvent array defined in the template by the parent\n\t\tif (JSON.stringify(current) === JSON.stringify(previous)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (depsTimeout) clearTimeout(depsTimeout);\n\t\tdepsTimeout = setTimeout(async () => {\n\t\t\tif (JSON.stringify(current) !== JSON.stringify(previous)) {\n\t\t\t\t// Only reset the stash if we are going to enforce coherence\n\t\t\t\tif (props.enforceCoherence) {\n\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\tstash.value = [];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Momentarily reset query\n\t\t\t\tlet currentQuery = query.value;\n\t\t\t\tquery.value = '';\n\t\t\t\tawait getOptions({ prefill: true });\n\t\t\t\tquery.value = currentQuery;\n\t\t\t\tif (!props.multiple) {\n\t\t\t\t\tlet found = optionsIndexedByValue.value.get(props.modelValue);\n\t\t\t\t\tif (!found && props.enforceCoherence && isNotNil(props.modelValue)) {\n\t\t\t\t\t\tquery.value = '';\n\t\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\t\tstash.value = [];\n\t\t\t\t\t\t}\n\t\t\t\t\t\temit('update:modelValue', null);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlet allFound = props.modelValue.every((value: any) =>\n\t\t\t\t\t\toptionsIndexedByValue.value.get(value)\n\t\t\t\t\t);\n\t\t\t\t\tif (!allFound && props.enforceCoherence) {\n\t\t\t\t\t\tlet coherentStash: Option<T>[] = [];\n\t\t\t\t\t\tconst coherent = props.modelValue.filter((value: any) => {\n\t\t\t\t\t\t\tlet found = optionsIndexedByValue.value.get(value);\n\t\t\t\t\t\t\tif (found) coherentStash.push(found);\n\t\t\t\t\t\t\treturn found;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\t\tstash.value = coherentStash as any;\n\t\t\t\t\t\t}\n\t\t\t\t\t\temit('update:modelValue', coherent);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}, props.depsDebounceTime);\n\t},\n\t{ deep: true }\n);\n\n/**\n * This is used to position the option container.\n * When the linked item (outerContainer) updates its position\n * this is rerun by floating-UI\n */\nconst displayOptions = () => {\n\tif (innerContainer.value && optionsContainer.value) {\n\t\tcomputePosition(innerContainer.value, optionsContainer.value, {\n\t\t\tplacement: 'bottom',\n\t\t\tmiddleware: [offset(6), flip(), shift()],\n\t\t}).then((data) => {\n\t\t\tif (optionsContainer.value) {\n\t\t\t\toptionsContainer.value.style.left = `${data.x}px`;\n\t\t\t\toptionsContainer.value.style.top = `${data.y}px`;\n\t\t\t\toptionsContainer.value.style.width = `${innerContainer.value?.offsetWidth}px`;\n\t\t\t}\n\t\t});\n\t}\n};\n/**\n * We need the transitions because elements must be hidden and shown\n * to accessibility tools when they are fully closed or fully open,\n * while still being animated for sighted users.\n */\n\n// Option panel is open\nconst shown = ref(false);\n// Option panel is opening\nconst showing = ref(false);\n// option panel is closing\nconst hiding = ref(false);\n// Option panel il closed\nconst hidden = ref(true);\n\nconst open = async () => {\n\thidden.value = false;\n\tshowing.value = true;\n\tawait wait(props.transitionDuration);\n\tshowing.value = false;\n\tshown.value = true;\n};\n\nconst close = async () => {\n\tshown.value = false;\n\thiding.value = true;\n\tawait wait(props.transitionDuration);\n\thiding.value = false;\n\thidden.value = true;\n};\n\n/**\n * Applies a class when the user is inside this whole component.\n * We cannot use focus within as it doesn't work for elements that are teleported.\n * Also we cannot use the <input/> if we phisically move focus to the options so\n * we track it manually.\n */\nconst active = ref(false);\n\n/**\n * When the focus goes to the input we select the current text\n * so the user can replace or delete it.\n * On top of that if the prefill strategy is to prefill on first focus and options\n * weren't already retrieved by the watcher on mount, we do that\n */\nlet isFirstFocus = true;\nconst onInputFocus = async (event: FocusEvent) => {\n\temit('focus', event);\n\tactive.value = true;\n\tdocument.addEventListener('click', onClickOutside);\n\tdocument.addEventListener('focusin', onFocusOutside);\n\tif (input.value instanceof HTMLInputElement) input.value.select();\n\tif (props.prefill === 'focus' && isFirstFocus && !shouldPrefill) {\n\t\tawait getOptions({ prefill: true });\n\t\tisFirstFocus = false;\n\t}\n};\n\nconst onFocusOutside = (event: FocusEvent) => {\n\tif (event.target instanceof Node) {\n\t\tif (outerContainer.value && optionsContainer.value) {\n\t\t\tif (\n\t\t\t\t!outerContainer.value.contains(event.target) &&\n\t\t\t\t!optionsContainer.value.contains(event.target)\n\t\t\t) {\n\t\t\t\tclose();\n\t\t\t\temit('inactive');\n\t\t\t\tdocument.removeEventListener('focusin', onFocusOutside);\n\t\t\t\tactive.value = false;\n\t\t\t\tif (props.multiple)\n\t\t\t\t\twait(500).then(() => {\n\t\t\t\t\t\tquery.value = '';\n\t\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n};\n\n/**\n * On single selection restore the query that might be partially altered by the user.\n * Input can blur either by clicking outside or clicking on an option.\n * We do nothing if the user has selected an option. And we restore the\n * query to its text if the user has moved focus\n */\nconst onInputBlur = async (event: FocusEvent) => {\n\temit('blur', event);\n\tif (!props.multiple) {\n\t\tlet noop = false;\n\t\tconst currentModelValue = props.modelValue;\n\t\tawait Promise.race([\n\t\t\twait(250),\n\t\t\twaitFor(() => {\n\t\t\t\treturn currentModelValue !== props.modelValue;\n\t\t\t}).then(() => {\n\t\t\t\tnoop = true;\n\t\t\t}),\n\t\t]);\n\t\tif (!noop) {\n\t\t\tconst found = optionsIndexedByValue.value.get(props.modelValue);\n\t\t\tif (found) {\n\t\t\t\tquery.value = found.text;\n\t\t\t}\n\t\t}\n\t}\n};\n\nconst onInputChange = (event: Event) => emit('change', event);\n\n/**\n * Search at every input by the user.\n * When the user deletes the query unselect the current option\n */\nconst onInputInput = (event: Event) => {\n\temit('input', event);\n\tif (query.value === '') {\n\t\tif (!props.multiple) {\n\t\t\temit('update:modelValue', null);\n\t\t}\n\t}\n\tif (typeof props.items === 'function') {\n\t\tsearchByQuery();\n\t}\n};\n\n// This is the vertical index used to highlight options in the container\nconst focusedIndex = ref<number | null>(null);\n/**\n * Normalize the index using the displayed options so we can start over when reaching the end.\n * Please watch out for the side effect it is used to avoid the\n * complexity of using modulo over negative numbers\n */\nconst normalizedFocusedIndex: ComputedRef<number | null> = computed(() => {\n\tif (Number.isInteger(focusedIndex.value) && focusedIndex.value) {\n\t\tif (focusedIndex.value === -1) {\n\t\t\tfocusedIndex.value = filteredOptions.value.length - 1;\n\t\t}\n\t\treturn focusedIndex.value % filteredOptions.value.length;\n\t}\n\treturn focusedIndex.value;\n});\n\n// This is the horizontal index used to highlight selected options\nconst selectedOptionsFocusedIndex = ref<number | null>(null);\n\n/**\n * Increment the focusIndex and wait for it to be normalized.\n * If the index corresponds to an option scroll it into view\n */\nconst focusOnNextOption = () => {\n\tif (focusedIndex.value !== null) focusedIndex.value++;\n\telse {\n\t\tfocusedIndex.value = 0;\n\t}\n\tnextTick().then(() => {\n\t\tif (normalizedFocusedIndex.value !== null) {\n\t\t\tconst foundOption = optionsContainer.value?.querySelector(\n\t\t\t\t`#${options.value[normalizedFocusedIndex.value].id}`\n\t\t\t);\n\t\t\tif (foundOption instanceof HTMLElement)\n\t\t\t\tfoundOption.scrollIntoView({\n\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\tinline: 'start',\n\t\t\t\t});\n\t\t}\n\t});\n};\n\n/**\n * Decrement the focusIndex and wait for it to be normalized.\n * If the index corresponds to an option scroll it into view\n */\nconst focusOnPreviousOption = () => {\n\tif (focusedIndex.value !== null) focusedIndex.value--;\n\telse focusedIndex.value = options.value.length - 1;\n\n\tnextTick().then(() => {\n\t\tif (normalizedFocusedIndex.value !== null) {\n\t\t\tconst foundOption = optionsContainer.value?.querySelector(\n\t\t\t\t`#${options.value[normalizedFocusedIndex.value].id}`\n\t\t\t);\n\t\t\tif (foundOption instanceof HTMLElement)\n\t\t\t\tfoundOption.scrollIntoView({\n\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\tinline: 'start',\n\t\t\t\t});\n\t\t}\n\t});\n};\n\n/**\n * This is handled separately from input because it has a lot to do with user\n * interaction and control characters than it has with the query.\n */\nconst onInputKeyDown = async (event: KeyboardEvent) => {\n\tif (props.readonly || props.disabled) {\n\t\tevent.preventDefault();\n\t\treturn;\n\t}\n\tswitch (event.key) {\n\t\t/**\n\t\t * On arrow prevent the page from scrolling.\n\t\t * Reset horizontal focus\n\t\t * When the panel is open\n\t\t * - Focus on the previous option\n\t\t * When the panel is closed\n\t\t * - focus on the first selected option\n\t\t */\n\t\tcase 'ArrowUp':\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (loading.value) return;\n\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\tif (shown.value) {\n\t\t\t\t\tfocusOnPreviousOption();\n\t\t\t\t} else {\n\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\tfocusedIndex.value = head(selectedOptions.value).index;\n\t\t\t\t\t}\n\t\t\t\t\tawait open();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * On arrow prevent the page from scrolling.\n\t\t * Reset horizontal focus\n\t\t * When the panel is open\n\t\t * - Focus on the previous option\n\t\t * When the panel is closed\n\t\t * - focus on the first selected option\n\t\t */\n\t\tcase 'ArrowDown':\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (loading.value) return;\n\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\tif (shown.value) {\n\t\t\t\t\tfocusOnNextOption();\n\t\t\t\t} else {\n\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\tfocusedIndex.value = head(selectedOptions.value).index;\n\t\t\t\t\t}\n\t\t\t\t\tawait open();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * When moving horizontally\n\t\t * Cycle from rightmost, next, or input focus.\n\t\t * If the focus lands on an option align the vertical focus as well\n\t\t */\n\t\tcase 'ArrowLeft':\n\t\t\t{\n\t\t\t\tif (loading.value) return;\n\t\t\t\tif (!query.value) {\n\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\tif (selectedOptionsFocusedIndex.value === null) {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value =\n\t\t\t\t\t\t\t\tselectedOptions.value.length - 1;\n\t\t\t\t\t\t} else if (selectedOptionsFocusedIndex.value > 0) {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value--;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (selectedOptionsFocusedIndex.value !== null) {\n\t\t\t\t\t\t\tlet linkedOption =\n\t\t\t\t\t\t\t\tselectedOptions.value[selectedOptionsFocusedIndex.value];\n\t\t\t\t\t\t\tlet foundOption = optionsContainer.value?.querySelector(\n\t\t\t\t\t\t\t\t`#${linkedOption.id}`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (foundOption) {\n\t\t\t\t\t\t\t\tfoundOption.scrollIntoView({\n\t\t\t\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\t\t\t\t\tinline: 'start',\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tfocusedIndex.value =\n\t\t\t\t\t\t\t\t\toptionsIndexedById.value[\n\t\t\t\t\t\t\t\t\t\tselectedOptions.value[selectedOptionsFocusedIndex.value].id\n\t\t\t\t\t\t\t\t\t].index;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * When moving horizontally\n\t\t * Cycle from leftmost, next, or input focus.\n\t\t * If the focus lands on an option align the vertical focus as well\n\t\t */\n\t\tcase 'ArrowRight':\n\t\t\t{\n\t\t\t\tif (loading.value) return;\n\t\t\t\tif (!query.value) {\n\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\tif (selectedOptionsFocusedIndex.value === null) {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value = 0;\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value <\n\t\t\t\t\t\t\tselectedOptions.value.length - 1\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (selectedOptionsFocusedIndex.value !== null) {\n\t\t\t\t\t\t\tlet linkedOption =\n\t\t\t\t\t\t\t\tselectedOptions.value[selectedOptionsFocusedIndex.value];\n\t\t\t\t\t\t\tlet foundOption = optionsContainer.value?.querySelector(\n\t\t\t\t\t\t\t\t`#${linkedOption.id}`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (foundOption) {\n\t\t\t\t\t\t\t\tfoundOption.scrollIntoView({\n\t\t\t\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\t\t\t\t\tinline: 'start',\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tfocusedIndex.value =\n\t\t\t\t\t\t\t\t\toptionsIndexedById.value[\n\t\t\t\t\t\t\t\t\t\tselectedOptions.value[selectedOptionsFocusedIndex.value].id\n\t\t\t\t\t\t\t\t\t].index;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * If the panel is closed focus on the first selected option.\n\t\t * If the panel was already open select/deselect the currently focused option\n\t\t * and close the panel of single selection is enabled\n\t\t */\n\t\tcase 'Enter':\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (loading.value) return;\n\t\t\t\tif (!shown.value) {\n\t\t\t\t\tif (filteredOptions.value.length) {\n\t\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\t\tfocusedIndex.value = head(selectedOptions.value).index;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tawait open();\n\t\t\t\t} else {\n\t\t\t\t\tif (normalizedFocusedIndex.value !== null) {\n\t\t\t\t\t\tif (filteredOptions.value[normalizedFocusedIndex.value].disabled)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\tif (!props.multiple) {\n\t\t\t\t\t\t\tawait close();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonOptionSelected(\n\t\t\t\t\t\t\tfilteredOptions.value[normalizedFocusedIndex.value]\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (props.addOptions) {\n\t\t\t\t\t\t\tif (props.itemText || props.itemValue) {\n\t\t\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t\t\t`Adding an option for mapped items is not supported. You can't create an option while passing \"item-text\" or \"item-value\".`\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taddOption();\n\t\t\t\t\t\t\tconst added = last(manualItems.value);\n\t\t\t\t\t\t\tonOptionSelected(optionsIndexedById.value[added.id]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * When moving away from the component reset focus both vertically and horizontally\n\t\t */\n\t\tcase 'Tab':\n\t\tcase 'Escape':\n\t\t\t{\n\t\t\t\tif (shown.value) {\n\t\t\t\t\tawait close();\n\t\t\t\t}\n\t\t\t\temit('inactive');\n\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\tfocusedIndex.value = null;\n\t\t\t}\n\t\t\tbreak;\n\t\t// Prevent shift from opening the panel\n\t\tcase 'Shift':\n\t\t\t{\n\t\t\t\tif (loading.value) return;\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * Delete behavior is different when query is empty\n\t\t * If query is empty\n\t\t * If no chip is selected - select rightmost chip\n\t\t * If a chip is selected - deselect that option\n\t\t * If any option remains move focus to that or reset\n\t\t */\n\t\tcase 'Backspace':\n\t\t\t{\n\t\t\t\tif (loading.value) return;\n\t\t\t\tif (!query.value) {\n\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\tif (selectedOptionsFocusedIndex.value === null) {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value =\n\t\t\t\t\t\t\t\tselectedOptions.value.length - 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tonOptionSelected(\n\t\t\t\t\t\t\t\tselectedOptions.value[selectedOptionsFocusedIndex.value]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value = Math.max(\n\t\t\t\t\t\t\t\t\tMath.min(\n\t\t\t\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value,\n\t\t\t\t\t\t\t\t\t\tselectedOptions.value.length - 2\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t0\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tawait open();\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * Open the panel on writing and reset horizontal focus\n\t\t */\n\t\tdefault:\n\t\t\t{\n\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\tfocusedIndex.value = null;\n\t\t\t\tawait open();\n\t\t\t}\n\t\t\tbreak;\n\t}\n};\n\n/**\n * Triggered on input when items is a function.\n */\n\nlet timeout: ReturnType<typeof setTimeout>;\nconst searchByQuery = () => {\n\tif (timeout) clearTimeout(timeout);\n\ttimeout = setTimeout(async () => {\n\t\ttry {\n\t\t\tawait getOptions({ prefill: false });\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t}\n\t}, props.queryDebounceTime);\n};\n\n/**\n * When clicking on the outside container seamlessly move focus to the input and open the panel\n */\nconst onOuterContainerClick = (event: MouseEvent) => {\n\temit('click', event);\n\tif (props.disabled || props.readonly) return;\n\tif (input.value instanceof HTMLElement) {\n\t\tinput.value.focus();\n\t}\n\topen();\n};\n\n/**\n * When an option is clicked wait for it to bubble to the option container to avoid slot event problems.\n * Select / deselect the option and then move focus to the input.\n * If it is single selection mode close the panel\n */\nconst onOptionClicked = (event: Event) => {\n\tif (event.currentTarget instanceof HTMLElement) {\n\t\tif (event.currentTarget.classList.contains('bb-base-select-option')) {\n\t\t\tconst option = optionsIndexedById.value[event.currentTarget.id];\n\t\t\tif (option.disabled) return;\n\t\t\tonOptionSelected(option);\n\t\t\tif (input.value instanceof HTMLInputElement) {\n\t\t\t\tinput.value.focus();\n\t\t\t}\n\t\t\tif (!props.multiple) close();\n\t\t}\n\t}\n};\n\n/**\n * On click outside of the container close the panel, remove active state.\n * In multiple selection clear query after a timeout\n */\nconst onClickOutside = (event: Event) => {\n\tif (event.target instanceof Node) {\n\t\tif (outerContainer.value) {\n\t\t\tif (!outerContainer.value.contains(event.target)) {\n\t\t\t\tclose();\n\t\t\t\temit('inactive');\n\t\t\t\tdocument.removeEventListener('click', onClickOutside);\n\t\t\t\tactive.value = false;\n\t\t\t\tif (props.multiple)\n\t\t\t\t\twait(500).then(() => {\n\t\t\t\t\t\tquery.value = '';\n\t\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n};\n\n/**\n * When using this component for submission we add a bunch of hidden\n * inputs so the submitted inputs are on par with v-model\n */\n/**\n * This is used to keep the value compatible to common html expected values.\n * Convert to string everything that's not but do not double encode strings\n */\nconst makeInputValue = when(\n\t(item: unknown) => typeof item !== 'string',\n\tJSON.stringify\n);\n\nconst hiddenInputs = computed(() => {\n\treturn [].concat(props.modelValue).map((current) => {\n\t\tconst value = makeInputValue(current);\n\t\treturn {\n\t\t\tdisabled: props.disabled,\n\t\t\tname: props.name,\n\t\t\ttype: 'hidden',\n\t\t\tvalue: value,\n\t\t};\n\t});\n});\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n ref_key: \"outerContainer\",\n ref: outerContainer,\n class: _normalizeClass({\n\t\t\t'bb-base-select': true,\n\t\t\t'bb-base-select--active': active.value,\n\t\t\t'bb-base-select--loading': loading.value,\n\t\t\t'bb-base-select--disabled': _ctx.disabled,\n\t\t\t'bb-base-select--errors': _ctx.hasErrors,\n\t\t\t'bb-base-select--readonly': _ctx.readonly,\n\t\t}),\n onClick: onOuterContainerClick\n }, [\n _renderSlot(_ctx.$slots, \"prepend-outer\"),\n _createElementVNode(\"span\", {\n ref_key: \"innerContainer\",\n ref: innerContainer,\n class: \"bb-base-select__inner-container\"\n }, [\n _renderSlot(_ctx.$slots, \"prepend\"),\n _createElementVNode(\"span\", _hoisted_1, [\n (_ctx.multiple)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (_ctx.comma)\n ? (_openBlock(true), _createElementBlock(_Fragment, { key: 0 }, _renderList(selectedOptions.value, (option, index) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n key: option.id,\n class: _normalizeClass({\n\t\t\t\t\t\t\t\t'bb-base-select__selected': true,\n\t\t\t\t\t\t\t\t'bb-base-select__selected--comma': true,\n\t\t\t\t\t\t\t\t'bb-base-select__selected--focused':\n\t\t\t\t\t\t\t\t\tindex === selectedOptionsFocusedIndex.value,\n\t\t\t\t\t\t\t})\n }, _toDisplayString(option.text) + _toDisplayString(index < selectedOptions.value.length - 1 ? ',' : ''), 3))\n }), 128))\n : (_openBlock(true), _createElementBlock(_Fragment, { key: 1 }, _renderList(selectedOptions.value, (option, index) => {\n return (_openBlock(), _createBlock(BbChip, {\n key: option.id,\n class: _normalizeClass({\n\t\t\t\t\t\t\t\t'bb-base-select__selected': true,\n\t\t\t\t\t\t\t\t'bb-base-select__selected--chip': true,\n\t\t\t\t\t\t\t\t'bb-base-select__selected--focused':\n\t\t\t\t\t\t\t\t\tindex === selectedOptionsFocusedIndex.value,\n\t\t\t\t\t\t\t}),\n clearable: true,\n text: option.text,\n \"onClick:clear\": _withModifiers(($event: any) => (onOptionSelected(option)), [\"stop\"])\n }, {\n default: _withCtx(() => [\n _renderSlot(_ctx.$slots, \"chip\", {\n disabled: option.disabled,\n hasErrors: _ctx.hasErrors,\n index: option.index,\n item: option.original,\n loading: !!loading.value,\n manual: option.manual,\n selected: option.selected,\n text: option.text,\n value: option.value\n }, () => [\n _createTextVNode(_toDisplayString(option.text), 1)\n ])\n ]),\n _: 2\n }, 1032, [\"class\", \"text\", \"onClick:clear\"]))\n }), 128))\n ], 64))\n : _createCommentVNode(\"\", true),\n _withDirectives(_createElementVNode(\"input\", {\n id: _ctx.id,\n ref_key: \"input\",\n ref: input,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((query).value = $event)),\n autocomplete: _ctx.autocomplete,\n autofocus: _ctx.autofocus,\n class: _normalizeClass('bb-base-select__text-input'),\n disabled: _ctx.disabled,\n placeholder: computedPlaceholder.value,\n readonly: _ctx.readonly || !_ctx.allowWriting,\n type: 'text',\n onBlur: _withModifiers(onInputBlur, [\"stop\"]),\n onChange: _withModifiers(onInputChange, [\"stop\"]),\n onFocus: _withModifiers(onInputFocus, [\"stop\"]),\n onInput: _withModifiers(onInputInput, [\"stop\"]),\n onKeydown: _withModifiers(onInputKeyDown, [\"stop\"])\n }, null, 40, _hoisted_2), [\n [_vModelDynamic, query.value]\n ]),\n (_openBlock(), _createBlock(_Teleport, { to: \"body\" }, [\n _createElementVNode(\"span\", {\n ref_key: \"optionsContainer\",\n ref: optionsContainer,\n class: _normalizeClass({\n\t\t\t\t\t\t\t'bb-base-select__options-container': true,\n\t\t\t\t\t\t\t'bb-base-select__options-container--shown': shown.value,\n\t\t\t\t\t\t\t'bb-base-select__options-container--showing': showing.value,\n\t\t\t\t\t\t\t'bb-base-select__options-container--hiding': hiding.value,\n\t\t\t\t\t\t\t'bb-base-select__options-container--hidden': hidden.value,\n\t\t\t\t\t\t}),\n role: 'listbox',\n style: _normalizeStyle({ transitionDuration: transitionDuration }),\n tabindex: -1\n }, [\n _renderSlot(_ctx.$slots, \"options:prepend\"),\n (!filteredOptions.value.length && loading.value)\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_3, [\n _renderSlot(_ctx.$slots, 'loading', { query: query.value }, () => [\n _createTextVNode(_toDisplayString(_ctx.loadingText), 1)\n ])\n ]))\n : (!filteredOptions.value.length)\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_4, [\n _renderSlot(_ctx.$slots, 'no-data', { query: query.value }, () => [\n _createTextVNode(_toDisplayString(_ctx.noDataText), 1)\n ])\n ]))\n : _createCommentVNode(\"\", true),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(filteredOptions.value, (option) => {\n return (_openBlock(), _createElementBlock(_Fragment, {\n key: option.id\n }, [\n _renderSlot(_ctx.$slots, \"option:prepend\", {\n item: option.original\n }),\n _createElementVNode(\"span\", {\n id: option.id,\n \"aria-selected\": option.selected,\n class: _normalizeClass({\n\t\t\t\t\t\t\t\t\t'bb-base-select-option': true,\n\t\t\t\t\t\t\t\t\t'bb-base-select-option--selected': option.selected,\n\t\t\t\t\t\t\t\t\t'bb-base-select-option--focused': option.focused,\n\t\t\t\t\t\t\t\t\t'bb-base-select-option--disabled': option.disabled,\n\t\t\t\t\t\t\t\t}),\n role: 'option',\n onClick: _withModifiers(onOptionClicked, [\"stop\"])\n }, [\n _renderSlot(_ctx.$slots, \"option\", {\n disabled: option.disabled,\n focused: option.focused,\n hasErrors: _ctx.hasErrors,\n index: option.index,\n item: option.original,\n loading: !!loading.value,\n manual: option.manual,\n selected: option.selected,\n text: option.text,\n value: option.value\n }, () => [\n _createElementVNode(\"span\", _hoisted_6, [\n _createElementVNode(\"span\", _hoisted_7, _toDisplayString(option.text), 1)\n ])\n ])\n ], 10, _hoisted_5),\n _renderSlot(_ctx.$slots, \"option:append\", {\n item: option.original\n })\n ], 64))\n }), 128)),\n _renderSlot(_ctx.$slots, \"options:append\")\n ], 6)\n ]))\n ]),\n _createElementVNode(\"span\", _hoisted_8, [\n _renderSlot(_ctx.$slots, \"chevron\", {\n loading: !!loading.value,\n shown: shown.value\n }, () => [\n _hoisted_9\n ])\n ]),\n (!loading.value)\n ? _renderSlot(_ctx.$slots, \"append\", { key: 0 })\n : (_openBlock(), _createElementBlock(\"span\", {\n key: 1,\n class: _normalizeClass({\n\t\t\t\t\t'bb-base-select__spinner': true,\n\t\t\t\t\t'bb-base-select__spinner--loading': loading.value,\n\t\t\t\t})\n }, [\n _renderSlot(_ctx.$slots, 'spinner', {\n loading: !!loading.value\n }, () => [\n _createVNode(BbSpinner, { size: 'sm' })\n ])\n ], 2))\n ], 512),\n _renderSlot(_ctx.$slots, \"append-outer\"),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(hiddenInputs.value, (input) => {\n return (_openBlock(), _createElementBlock(\"input\", _mergeProps({\n key: input.value\n }, input), null, 16))\n }), 128))\n ], 2))\n}\n}\n\n})"],"names":["_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_sfc_main","_defineComponent","__props","__emit","props","emit","outerContainer","ref","innerContainer","optionsContainer","input","query","computedPlaceholder","computed","selectedOptions","loading","transitionDuration","cleanUpPositioning","onMounted","autoUpdate","displayOptions","onBeforeUnmount","internalItems","stash","manualItems","getItemText","useItemText","getItemValue","useItemValue","internalOptions","item","_","text","value","jsonValue","options","fromOptions","acc","curr","withManual","withStash","option","index","isNotNil","modelValueIndexed","filteredOptions","base","matchedAnything","keys","propName","normalizedFocusedIndex","optionsIndexedById","optionsIndexedByValue","indexed","key","_a","pairs","deepEqual","map","linkedOption","onOptionSelected","valueToEmit","focusedIndex","current","stashed","getOptions","prefill","items","addOption","shouldPrefill","modelValueTimeout","watch","previous","allFound","coherentStash","coherent","found","currentQuery","depsTimeout","isFirstFocus","computePosition","offset","flip","shift","data","shown","showing","hiding","hidden","open","wait","close","active","onInputFocus","event","onClickOutside","onFocusOutside","onInputBlur","noop","currentModelValue","waitFor","onInputChange","onInputInput","searchByQuery","selectedOptionsFocusedIndex","focusOnNextOption","nextTick","foundOption","focusOnPreviousOption","onInputKeyDown","head","_b","added","last","timeout","error","onOuterContainerClick","onOptionClicked","makeInputValue","when","hiddenInputs","_ctx","_cache","_openBlock","_createElementBlock","_normalizeClass","_renderSlot","_createElementVNode","_Fragment","_renderList","_toDisplayString","_createBlock","BbChip","_withModifiers","$event","_withCtx","_createTextVNode","_createCommentVNode","_withDirectives","_vModelDynamic","_Teleport","_normalizeStyle","_createVNode","BbSpinner","_mergeProps"],"mappings":";;;;;;;;;;;;;;;;AAGA,MAAMA,KAAa,EAAE,OAAO,qCACtBC,KAAa,CAAC,MAAM,gBAAgB,aAAa,YAAY,eAAe,UAAU,GACtFC,KAAa;AAAA,EACjB,KAAK;AAAA,EACL,OAAO;AACT,GACMC,KAAa;AAAA,EACjB,KAAK;AAAA,EACL,OAAO;AACT,GACMC,KAAa,CAAC,MAAM,eAAe,GACnCC,KAAa,EAAE,OAAO,oCACtBC,KAAa,EAAE,OAAO,iCACtBC,KAAa,EAAE,OAAO,6BACtBC,uBAA8C,OAAO;AAAA,EACzD,MAAM;AAAA,EACN,SAAS;AAAA,EACT,OAAO;AACT,GAAG;AAAA,oBACgC,QAAQ;AAAA,IACvC,aAAa;AAAA,IACb,GAAG;AAAA,IACH,MAAM;AAAA,IACN,aAAa;AAAA,EAAA,CACd;AACH,GAAG,EAAE,GAyRuBC,KAAiBC,gBAAAA,GAAA;AAAA,EAC3C,QAAQ;AAAA,EACR,OAAO;AAAA,IACL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