bitboss-ui 0.2.32 → 0.2.34
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/index103.js +2 -2
- package/dist/index109.js +1 -1
- package/dist/index111.js +4 -4
- package/dist/index116.js +1 -1
- package/dist/index118.js +1 -1
- package/dist/index125.js +1 -1
- package/dist/index126.js +1 -1
- package/dist/index127.js +1 -1
- package/dist/index131.js +2 -2
- package/dist/index15.js +8 -8
- package/dist/index17.js +9 -9
- package/dist/index19.js +3 -3
- package/dist/index199.js +10 -295
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +3 -16
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +3 -16
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +376 -17
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +131 -17
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +5 -29
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +19 -8
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +2 -2
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +2 -235
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +174 -3
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +23 -35
- package/dist/index209.js.map +1 -1
- package/dist/index21.js +2 -2
- package/dist/index210.js +373 -6
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +16 -10
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +14 -376
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +17 -131
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +29 -2
- package/dist/index214.js.map +1 -1
- package/dist/index215.js +8 -174
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +3 -23
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +31 -369
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +6 -3
- package/dist/index218.js.map +1 -1
- package/dist/index219.js +235 -3
- package/dist/index219.js.map +1 -1
- package/dist/index221.js +8 -27
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +120 -16
- package/dist/index222.js.map +1 -1
- package/dist/index224.js +27 -8
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +16 -120
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +1 -1
- package/dist/index229.js +223 -5
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +258 -2
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +6 -2
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +2 -2
- package/dist/index233.js +295 -2
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +2 -2
- package/dist/index236.js +110 -428
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +105 -88
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +2 -200
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +2 -224
- package/dist/index239.js.map +1 -1
- package/dist/index240.js +2 -258
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +2 -2
- package/dist/index242.js +428 -110
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +88 -105
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +197 -157
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +160 -2
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +2 -69
- package/dist/index246.js.map +1 -1
- package/dist/index248.js +69 -2
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +14 -37
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +38 -2
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +2 -2
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +2 -15
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +2 -3
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +3 -2
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +2 -2
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +5 -0
- package/dist/index256.js.map +1 -0
- package/dist/index29.js +1 -1
- package/dist/index31.js +306 -292
- package/dist/index31.js.map +1 -1
- package/dist/index65.js +5 -5
- package/dist/index69.js +2 -2
- package/dist/index72.js +1 -1
- package/dist/index75.js +1 -1
- package/dist/index79.js +4 -4
- package/dist/index91.js +9 -7
- package/dist/index91.js.map +1 -1
- package/dist/{components → src/components}/BaseSelect/BaseSelect.vue.d.ts +13 -6
- package/dist/{components → src/components}/BbSelect/BbSelect.vue.d.ts +13 -6
- package/dist/{components → src/components}/BbTab/BbTab.vue.d.ts +5 -5
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/{components → src/components}/BaseButton/BaseButton.vue.d.ts +0 -0
- package/dist/{components → src/components}/BaseCheckbox/BaseCheckbox.vue.d.ts +0 -0
- package/dist/{components → src/components}/BaseCheckboxGroup/BaseCheckboxGroup.vue.d.ts +0 -0
- package/dist/{components → src/components}/BaseDatePicker/BaseDatePicker.vue.d.ts +1 -1
- package/dist/{components → src/components}/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +0 -0
- package/dist/{components → src/components}/BaseDialog/BaseDialog.vue.d.ts +3 -3
- package/dist/{components → src/components}/BaseInputContainer/BaseInputContainer.vue.d.ts +0 -0
- package/dist/{components → src/components}/BaseNumberInput/BaseNumberInput.vue.d.ts +0 -0
- package/dist/{components → src/components}/BaseRadio/BaseRadio.vue.d.ts +0 -0
- package/dist/{components → src/components}/BaseRadioGroup/BaseRadioGroup.vue.d.ts +0 -0
- package/dist/{components → src/components}/BaseRating/BaseRating.vue.d.ts +0 -0
- package/dist/{components → src/components}/BaseSlider/BaseSlider.vue.d.ts +2 -2
- package/dist/{components → src/components}/BaseSwitch/BaseSwitch.vue.d.ts +0 -0
- package/dist/{components → src/components}/BaseSwitchGroup/BaseSwitchGroup.vue.d.ts +0 -0
- package/dist/{components → src/components}/BaseTag/BaseTag.vue.d.ts +0 -0
- package/dist/{components → src/components}/BaseTextInput/BaseTextInput.vue.d.ts +0 -0
- package/dist/{components → src/components}/BaseTextarea/BaseTextarea.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbAccordion/BbAccordion.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbAlert/BbAlert.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbAvatar/BbAvatar.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbBadge/BbBadge.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbBreadcrumbs/BbBreadcrumbs.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbButton/BbButton.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbCheckbox/BbCheckbox.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbChip/BbChip.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbCollapsible/BbCollapsible.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbConfirm/BbConfirm.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbDatePickerInput/BbDatePickerInput.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbDialog/BbDialog.vue.d.ts +2 -2
- package/dist/{components → src/components}/BbDropdown/BbDropdown.vue.d.ts +1 -1
- package/dist/{components → src/components}/BbDropdownButton/BbDropdownButton.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbDropzone/BbDropzone.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbHover/BbHover.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbIcon/BbIcon.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbIntersection/BbIntersection.vue.d.ts +1 -1
- package/dist/{components → src/components}/BbNumberInput/BbNumberInput.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbOffCanvas/BbOffCanvas.vue.d.ts +4 -4
- package/dist/{components → src/components}/BbPagination/BbPagination.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbPopover/BbPopover.vue.d.ts +3 -3
- package/dist/{components → src/components}/BbProgress/BbProgress.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbRadio/BbRadio.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbRadioGroup/BbRadioGroup.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbRating/BbRating.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbRatio/BbRatio.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbSlider/BbSlider.vue.d.ts +1 -1
- package/dist/{components → src/components}/BbSmoothHeight/BbSmoothHeight.vue.d.ts +2 -2
- package/dist/{components → src/components}/BbSpinner/BbSpinner.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbSwitch/BbSwitch.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbSwitchGroup/BbSwitchGroup.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbTable/BbTable.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbTable/types.d.ts +0 -0
- package/dist/{components → src/components}/BbTag/BbTag.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbTextInput/BbTextInput.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbTextarea/BbTextarea.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbToast/BbToast.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbToast/BbToastMessage.vue.d.ts +0 -0
- package/dist/{components → src/components}/BbTooltip/BbTooltip.vue.d.ts +2 -2
- /package/dist/{components → src/components}/BbTree/BbTree.vue.d.ts +0 -0
- /package/dist/{composables → src/composables}/useBroadcastChannelInstance.d.ts +0 -0
- /package/dist/{composables → src/composables}/useConfirm.d.ts +0 -0
- /package/dist/{composables → src/composables}/useCountdown.d.ts +0 -0
- /package/dist/{composables → src/composables}/useId.d.ts +0 -0
- /package/dist/{composables → src/composables}/useItemText.d.ts +0 -0
- /package/dist/{composables → src/composables}/useItemValue.d.ts +0 -0
- /package/dist/{composables → src/composables}/useOptions.d.ts +0 -0
- /package/dist/{composables → src/composables}/useRoute.d.ts +0 -0
- /package/dist/{composables → src/composables}/useRouter.d.ts +0 -0
- /package/dist/{composables → src/composables}/useToast.d.ts +0 -0
- /package/dist/{composables → src/composables}/useWizard.d.ts +0 -0
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/{types → src/types}/Classes.d.ts +0 -0
- /package/dist/{types → src/types}/CommonProps.d.ts +0 -0
- /package/dist/{types → src/types}/ExtractGenericFromComputedRef.d.ts +0 -0
- /package/dist/{types → src/types}/ExtractGenericFromRef.d.ts +0 -0
- /package/dist/{types → src/types}/NestedKeyOf.d.ts +0 -0
- /package/dist/{types → src/types}/Simplify.d.ts +0 -0
- /package/dist/{types → src/types}/VoidHtmlElements.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/add.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/booleanishToBoolean.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/capitalize.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/clamp.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/cloneDeep.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/curry.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/debounce.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/deburr.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/drop.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/empty.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/findInTree.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/findRight.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/findRightIndex.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/flattenTree.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/flow.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/get.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/groupBy.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/gt.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/head.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/identity.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/includes.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/indexBy.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/initial.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/isCssColor.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/isNil.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/isNotNil.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/last.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/lt.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/makeUrl.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/mapKeys.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/mapValues.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/matchesPropertyInsensitive.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/mean.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/merge.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/millisecondsTo.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/negate.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/noop.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/omit.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/overEvery.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/percentage.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/pick.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/pickBy.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/replace.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/replaceInTree.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/retry.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/roundToTheNearest.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/set.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/snakeCase.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/throttle.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/tryTo.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/wait.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/waitFor.d.ts +0 -0
- /package/dist/{utilities → src/utilities}/functions/when.d.ts +0 -0
package/dist/index31.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { defineComponent as Ne, ref as f, computed as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as Ne, ref as f, computed as y, onMounted as $e, onBeforeUnmount as De, watch as X, openBlock as g, createElementBlock as h, normalizeClass as x, renderSlot as b, createElementVNode as w, Fragment as D, renderList as H, toDisplayString as L, createBlock as ue, withModifiers as I, withCtx as Le, createTextVNode as ee, createCommentVNode as ie, withDirectives as Fe, vModelDynamic as Me, Teleport as Ae, normalizeStyle as Je, createVNode as qe, mergeProps as Re, nextTick as se } from "vue";
|
|
2
|
+
import ze from "./index115.js";
|
|
3
3
|
import "./index158.js";
|
|
4
|
-
import
|
|
4
|
+
import Pe from "./index119.js";
|
|
5
5
|
import "./index185.js";
|
|
6
|
-
import { autoUpdate as
|
|
6
|
+
import { autoUpdate as He, computePosition as Ue, flip as je, shift as Qe } from "./index202.js";
|
|
7
7
|
import { deepEqual as re } from "./index123.js";
|
|
8
8
|
import { head as le } from "./index220.js";
|
|
9
|
-
import { isNotNil as
|
|
10
|
-
import { last as
|
|
9
|
+
import { isNotNil as B } from "./index124.js";
|
|
10
|
+
import { last as We } from "./index207.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 "./
|
|
14
|
+
import { waitFor as Ze } from "./index218.js";
|
|
15
15
|
import { when as Ge } from "./index198.js";
|
|
16
|
-
import { offset as Xe } from "./
|
|
16
|
+
import { offset as Xe } from "./index210.js";
|
|
17
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 = ["id", "aria-selected"],
|
|
23
|
+
}, nl = ["id", "aria-selected"], ol = { class: "bb-base-select-option__content" }, ul = { class: "bb-base-select-option__text" }, il = { class: "bb-base-select__chevron" }, sl = /* @__PURE__ */ w("svg", {
|
|
24
24
|
fill: "none",
|
|
25
25
|
viewBox: "0 0 16 8",
|
|
26
26
|
xmlns: "http://www.w3.org/2000/svg"
|
|
@@ -31,12 +31,13 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
31
31
|
fill: "currentColor",
|
|
32
32
|
"fill-rule": "evenodd"
|
|
33
33
|
})
|
|
34
|
-
], -1),
|
|
34
|
+
], -1), _l = /* @__PURE__ */ Ne({
|
|
35
35
|
__name: "BaseSelect",
|
|
36
36
|
props: {
|
|
37
37
|
allowWriting: { type: Boolean, default: !0 },
|
|
38
38
|
autocomplete: {},
|
|
39
39
|
autofocus: {},
|
|
40
|
+
debug: { type: Boolean },
|
|
40
41
|
dependencies: {},
|
|
41
42
|
depsDebounceTime: { default: 0 },
|
|
42
43
|
disabled: { type: Boolean },
|
|
@@ -67,150 +68,161 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
67
68
|
},
|
|
68
69
|
emits: ["blur", "change", "click", "focus", "inactive", "input", "update:modelValue"],
|
|
69
70
|
setup(de, { emit: ce }) {
|
|
70
|
-
const
|
|
71
|
-
if (
|
|
71
|
+
const e = de, c = ce;
|
|
72
|
+
if (e.multiple && !Array.isArray(e.modelValue))
|
|
72
73
|
throw new Error('Multiple is set to "true" but modelValue is not an array.');
|
|
73
|
-
const F = f(null), E = f(null), v = f(null),
|
|
74
|
+
const F = f(null), E = f(null), v = f(null), S = f(null), u = f(""), fe = y(() => s.value.length ? "" : e.placeholder), d = f(0), ve = e.transitionDuration / 1e3 + "s";
|
|
74
75
|
let te;
|
|
75
76
|
$e(async () => {
|
|
76
|
-
E.value && v.value && (te =
|
|
77
|
+
e.debug && console.log("Calling onMounted"), E.value && v.value && (te = He(
|
|
77
78
|
E.value,
|
|
78
79
|
v.value,
|
|
79
|
-
|
|
80
|
+
ye,
|
|
80
81
|
{
|
|
81
82
|
ancestorResize: !0,
|
|
82
83
|
ancestorScroll: !0,
|
|
83
|
-
animationFrame:
|
|
84
|
+
animationFrame: e.updateOnAnimationFrame,
|
|
84
85
|
elementResize: !0
|
|
85
86
|
}
|
|
86
87
|
));
|
|
87
88
|
}), De(() => {
|
|
88
|
-
te();
|
|
89
|
+
e.debug && console.log("Calling onBeforeUnMount"), te();
|
|
89
90
|
});
|
|
90
|
-
const ae = f([]),
|
|
91
|
-
|
|
91
|
+
const ae = f([]), p = f([]), V = f([]), { getItemText: pe } = Ke(), { getItemValue: me } = Ye(), ge = y(() => ae.value.map((l, a) => {
|
|
92
|
+
e.debug && console.log("Mapping items in internalOptions", { item: l });
|
|
93
|
+
const t = pe(l, e.itemText), n = me(l, e.itemValue);
|
|
92
94
|
if (n === void 0)
|
|
93
95
|
throw new Error(
|
|
94
|
-
'The result of extracting "value" from option was undefined. Affected item is ' + JSON.stringify(
|
|
96
|
+
'The result of extracting "value" from option was undefined. Affected item is ' + JSON.stringify(l) + " please check itemValue property is correct."
|
|
95
97
|
);
|
|
96
|
-
const
|
|
98
|
+
const o = JSON.stringify(n);
|
|
97
99
|
return {
|
|
98
|
-
disabled: !!
|
|
99
|
-
id: "option_" +
|
|
100
|
-
jsonValue:
|
|
100
|
+
disabled: !!l.disabled,
|
|
101
|
+
id: "option_" + o.replace(/\W/g, "_"),
|
|
102
|
+
jsonValue: o,
|
|
101
103
|
manual: !1,
|
|
102
|
-
original:
|
|
104
|
+
original: l,
|
|
103
105
|
text: t,
|
|
104
106
|
value: n
|
|
105
107
|
};
|
|
106
|
-
})),
|
|
107
|
-
let
|
|
108
|
-
(n,
|
|
108
|
+
})), O = y(() => {
|
|
109
|
+
let l = ge.value.reduce(
|
|
110
|
+
(n, o) => (n[o.id] = o, n),
|
|
109
111
|
{}
|
|
110
112
|
);
|
|
111
113
|
const a = V.value.reduce(
|
|
112
|
-
(n,
|
|
113
|
-
|
|
114
|
-
), t =
|
|
115
|
-
(n,
|
|
114
|
+
(n, o) => (n[o.id] || (n[o.id] = o), n),
|
|
115
|
+
l
|
|
116
|
+
), t = p.value.reduce(
|
|
117
|
+
(n, o) => (n[o.id] || (n[o.id] = o), n),
|
|
116
118
|
a
|
|
117
119
|
);
|
|
118
|
-
return
|
|
119
|
-
|
|
120
|
+
return e.debug && console.log("Computing options in options", {
|
|
121
|
+
fromOptions: l,
|
|
122
|
+
withManual: a,
|
|
123
|
+
withStash: t
|
|
124
|
+
}), Object.values(t).map(
|
|
125
|
+
(n, o) => ({
|
|
120
126
|
...n,
|
|
121
|
-
selected:
|
|
122
|
-
index:
|
|
127
|
+
selected: B(be.value.get(n.value)),
|
|
128
|
+
index: o
|
|
123
129
|
})
|
|
124
130
|
);
|
|
125
|
-
}),
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
131
|
+
}), C = y(() => {
|
|
132
|
+
e.debug && console.log("Computing filtered options");
|
|
133
|
+
let l = [];
|
|
134
|
+
return u.value && !s.value.some(
|
|
135
|
+
(a) => a.text === u.value
|
|
136
|
+
) ? l = O.value.filter((a) => {
|
|
130
137
|
let t = !1;
|
|
131
|
-
if (
|
|
132
|
-
if (typeof
|
|
133
|
-
t =
|
|
134
|
-
else if (
|
|
135
|
-
const n = [].concat(
|
|
136
|
-
for (let
|
|
137
|
-
const
|
|
138
|
-
t = t || a.original[
|
|
138
|
+
if (e.filterBy) {
|
|
139
|
+
if (typeof e.filterBy == "function")
|
|
140
|
+
t = e.filterBy(a.value, a.original);
|
|
141
|
+
else if (e.filterBy.length) {
|
|
142
|
+
const n = [].concat(e.filterBy);
|
|
143
|
+
for (let o = 0; o < n.length; o++) {
|
|
144
|
+
const T = n[o];
|
|
145
|
+
t = t || a.original[T] && a.original[T].toLowerCase().includes(u.value.toLowerCase());
|
|
139
146
|
}
|
|
140
147
|
}
|
|
141
148
|
} else
|
|
142
149
|
return !0;
|
|
143
|
-
return t || a.text.toLowerCase().includes(
|
|
144
|
-
}) :
|
|
150
|
+
return t || a.text.toLowerCase().includes(u.value.toLowerCase());
|
|
151
|
+
}) : l = O.value, l.map((a, t) => ({
|
|
145
152
|
...a,
|
|
146
|
-
focused:
|
|
153
|
+
focused: _.value === t
|
|
147
154
|
}));
|
|
148
|
-
}),
|
|
149
|
-
() =>
|
|
150
|
-
(
|
|
151
|
-
...
|
|
155
|
+
}), R = y(
|
|
156
|
+
() => O.value.reduce(
|
|
157
|
+
(l, a) => ({
|
|
158
|
+
...l,
|
|
152
159
|
[a.id]: a
|
|
153
160
|
}),
|
|
154
161
|
{}
|
|
155
162
|
)
|
|
156
|
-
),
|
|
157
|
-
if (
|
|
158
|
-
let
|
|
163
|
+
), m = y(() => {
|
|
164
|
+
if (e.debug && console.log("Computing optionsIndexedByValue"), e.matchStrategy === "string") {
|
|
165
|
+
let l = O.value.reduce(
|
|
159
166
|
(a, t) => (a[t.jsonValue] = t, a),
|
|
160
167
|
{}
|
|
161
168
|
);
|
|
162
169
|
return {
|
|
163
|
-
get: (a) =>
|
|
170
|
+
get: (a) => l[JSON.stringify(a)]
|
|
164
171
|
};
|
|
165
|
-
} else if (
|
|
166
|
-
let
|
|
172
|
+
} else if (e.matchStrategy === "equality") {
|
|
173
|
+
let l = O.value.map((a) => [
|
|
167
174
|
a.value,
|
|
168
175
|
a
|
|
169
176
|
]);
|
|
170
177
|
return {
|
|
171
178
|
get: (a) => {
|
|
172
179
|
var t;
|
|
173
|
-
return (t =
|
|
180
|
+
return (t = l.find((n) => re(n[0], a))) == null ? void 0 : t[1];
|
|
174
181
|
}
|
|
175
182
|
};
|
|
176
183
|
} else
|
|
177
184
|
throw new Error("No match strategy has been defined");
|
|
178
|
-
}),
|
|
179
|
-
if (
|
|
180
|
-
let
|
|
181
|
-
return [].concat(
|
|
182
|
-
|
|
185
|
+
}), be = y(() => {
|
|
186
|
+
if (e.debug && console.log("Computing modelValueIndexed"), e.matchStrategy === "string") {
|
|
187
|
+
let l = {};
|
|
188
|
+
return [].concat(e.modelValue).forEach((a, t) => {
|
|
189
|
+
l[JSON.stringify(a)] = t;
|
|
183
190
|
}), {
|
|
184
|
-
get: (a) =>
|
|
191
|
+
get: (a) => l[JSON.stringify(a)]
|
|
185
192
|
};
|
|
186
|
-
} else if (
|
|
187
|
-
const
|
|
193
|
+
} else if (e.matchStrategy === "equality") {
|
|
194
|
+
const l = [].concat(e.modelValue).filter(B).map((a, t) => [a, t]);
|
|
188
195
|
return {
|
|
189
196
|
get: (a) => {
|
|
190
197
|
var t;
|
|
191
|
-
return (t =
|
|
198
|
+
return (t = l.find((n) => re(n[0], a))) == null ? void 0 : t[1];
|
|
192
199
|
}
|
|
193
200
|
};
|
|
194
201
|
} else
|
|
195
202
|
throw new Error("No match strategy has been defined");
|
|
196
|
-
}),
|
|
197
|
-
const t =
|
|
198
|
-
return t &&
|
|
199
|
-
}, [])),
|
|
203
|
+
}), s = y(() => (e.debug && console.log("Computing selectedOptions"), [].concat(e.modelValue).reduce((l, a) => {
|
|
204
|
+
const t = m.value.get(a);
|
|
205
|
+
return t && l.push(t), l;
|
|
206
|
+
}, []))), M = (l) => {
|
|
207
|
+
e.debug && console.log("Running onOptionSelected", { option: l });
|
|
200
208
|
let a;
|
|
201
|
-
r.value =
|
|
202
|
-
(t) => t.id !==
|
|
203
|
-
)), a =
|
|
204
|
-
(t) => JSON.stringify(t) !==
|
|
205
|
-
),
|
|
206
|
-
|
|
207
|
-
)
|
|
208
|
-
|
|
209
|
+
r.value = l.index, e.multiple ? (l.selected ? (l.manual && (e.debug && console.log("onOptionSelected: inside multiple > selected > manual"), V.value = V.value.filter(
|
|
210
|
+
(t) => t.id !== l.id
|
|
211
|
+
)), a = e.modelValue.filter(
|
|
212
|
+
(t) => JSON.stringify(t) !== l.jsonValue
|
|
213
|
+
), e.stash && (e.debug && console.log("onOptionSelected: inside multiple > selected > stash"), p.value = p.value.filter((t) => t.id !== l.id))) : (e.debug && console.log("onOptionSelected: inside multiple > not selected"), a = e.modelValue.concat(l.value), e.stash && (e.debug && console.log(
|
|
214
|
+
"onOptionSelected: inside multiple > not selected > stash"
|
|
215
|
+
), p.value = p.value.concat(l))), e.resetQueryOnOptionSelected && (e.debug && console.log("onOptionSelected: resetting query"), u.value = "")) : l.selected ? (l.manual && (e.debug && console.log("onOptionSelected: inside single > selected > manual"), V.value = V.value.filter(
|
|
216
|
+
(t) => t.id !== l.id
|
|
217
|
+
)), a = null, e.stash && (e.debug && console.log("onOptionSelected: inside single > selected > stash"), p.value = []), u.value = "") : (e.debug && console.log("onOptionSelected: inside single > not selected"), a = l.value, e.stash && (e.debug && console.log("onOptionSelected: inside single > not selected > stash"), p.value = [l]), u.value = l.text), c("update:modelValue", a);
|
|
218
|
+
}, N = async ({ prefill: l = !1 }) => {
|
|
219
|
+
e.debug && console.log("running getOptions");
|
|
209
220
|
let a = [];
|
|
210
|
-
Array.isArray(
|
|
211
|
-
},
|
|
212
|
-
|
|
213
|
-
|
|
221
|
+
Array.isArray(e.items) ? a = e.items : typeof e.items == "function" && (d.value++, a = await e.items(u.value, l, e.modelValue), d.value--), ae.value = a;
|
|
222
|
+
}, he = () => {
|
|
223
|
+
e.debug && console.log("running addOption");
|
|
224
|
+
const l = u.value, a = u.value, t = JSON.stringify(a), n = {
|
|
225
|
+
text: l,
|
|
214
226
|
value: a,
|
|
215
227
|
jsonValue: t,
|
|
216
228
|
id: "option_" + t.replace(/\W/g, "_"),
|
|
@@ -218,134 +230,136 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
218
230
|
manual: !0,
|
|
219
231
|
disabled: !1
|
|
220
232
|
};
|
|
221
|
-
V.value = V.value.concat(n),
|
|
222
|
-
},
|
|
223
|
-
let
|
|
233
|
+
V.value = V.value.concat(n), u.value = "";
|
|
234
|
+
}, z = e.prefill === !0 || !e.multiple && B(e.modelValue) || e.multiple && !!e.modelValue.length;
|
|
235
|
+
let U;
|
|
224
236
|
X(
|
|
225
|
-
() =>
|
|
226
|
-
(
|
|
227
|
-
|
|
237
|
+
() => e.modelValue,
|
|
238
|
+
(l, a) => {
|
|
239
|
+
e.debug && console.log("running watch.modelValue"), U && clearTimeout(U), U = setTimeout(
|
|
228
240
|
async () => {
|
|
229
|
-
if (
|
|
230
|
-
if (!Array.isArray(
|
|
241
|
+
if (e.multiple) {
|
|
242
|
+
if (!Array.isArray(e.modelValue))
|
|
231
243
|
throw new Error("props.modelValue is not an array.");
|
|
232
|
-
let t =
|
|
233
|
-
(n) =>
|
|
244
|
+
let t = e.modelValue.every(
|
|
245
|
+
(n) => m.value.get(n)
|
|
234
246
|
);
|
|
235
|
-
if ((!t || a === void 0) && (await N({ prefill: !0 }), t =
|
|
236
|
-
(n) =>
|
|
247
|
+
if ((!t || a === void 0) && (await N({ prefill: !0 }), t = e.modelValue.every(
|
|
248
|
+
(n) => m.value.get(n)
|
|
237
249
|
)), t)
|
|
238
|
-
|
|
239
|
-
(n) =>
|
|
250
|
+
e.stash && (p.value = e.modelValue.map(
|
|
251
|
+
(n) => m.value.get(n)
|
|
240
252
|
));
|
|
241
253
|
else {
|
|
242
254
|
let n = [];
|
|
243
|
-
const
|
|
244
|
-
let J =
|
|
255
|
+
const o = l.filter((T) => {
|
|
256
|
+
let J = m.value.get(T);
|
|
245
257
|
return J && n.push(J), J;
|
|
246
258
|
});
|
|
247
|
-
|
|
259
|
+
e.stash && (p.value = n), e.enforceCoherence && c("update:modelValue", o);
|
|
248
260
|
}
|
|
249
261
|
} else {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
262
|
+
e.debug && console.log("watch.modelValue >> single");
|
|
263
|
+
let t = m.value.get(e.modelValue);
|
|
264
|
+
if (!t && B(e.modelValue) || a === void 0) {
|
|
265
|
+
e.debug && console.log("watch.modelValue >> not found line 895");
|
|
266
|
+
const n = u.value;
|
|
267
|
+
u.value = "", await N({ prefill: !0 }), u.value = n;
|
|
254
268
|
}
|
|
255
|
-
t =
|
|
269
|
+
t = m.value.get(e.modelValue), t ? (e.debug && console.log("watch.modelValue >> found"), u.value = t.text, e.stash && (p.value = [t])) : e.enforceCoherence && B(l) ? (e.debug && console.log("watch.modelValue >> not found line 911"), u.value = "", e.stash && (p.value = []), c("update:modelValue", null)) : u.value = "";
|
|
256
270
|
}
|
|
257
271
|
},
|
|
258
|
-
|
|
272
|
+
z ? 0 : e.modelValueDebounceTime
|
|
259
273
|
);
|
|
260
274
|
},
|
|
261
275
|
// Prefill when asked or when items are static
|
|
262
|
-
{ immediate:
|
|
276
|
+
{ immediate: z, deep: !0 }
|
|
263
277
|
), X(
|
|
264
|
-
() =>
|
|
265
|
-
async (
|
|
266
|
-
if (typeof
|
|
267
|
-
JSON.stringify(
|
|
268
|
-
if (await N({ prefill: !1 }),
|
|
269
|
-
if (!
|
|
270
|
-
(n) =>
|
|
271
|
-
) &&
|
|
272
|
-
const n =
|
|
278
|
+
() => e.items,
|
|
279
|
+
async (l, a) => {
|
|
280
|
+
if (typeof l == "function" || // Circumvent arrays defined in the template by the parent
|
|
281
|
+
JSON.stringify(l) !== JSON.stringify(a))
|
|
282
|
+
if (e.debug && console.log("watch.items"), await N({ prefill: !1 }), e.multiple) {
|
|
283
|
+
if (!e.modelValue.every(
|
|
284
|
+
(n) => m.value.get(n)
|
|
285
|
+
) && e.enforceCoherence) {
|
|
286
|
+
const n = e.modelValue.filter((o) => m.value.get(o));
|
|
273
287
|
c("update:modelValue", n);
|
|
274
288
|
}
|
|
275
289
|
} else
|
|
276
|
-
!
|
|
290
|
+
!m.value.get(e.modelValue) && e.enforceCoherence && B(e.modelValue) && c("update:modelValue", null), r.value = null;
|
|
277
291
|
}
|
|
278
292
|
);
|
|
279
|
-
let
|
|
293
|
+
let j;
|
|
280
294
|
X(
|
|
281
|
-
() =>
|
|
282
|
-
(
|
|
283
|
-
!
|
|
284
|
-
if (JSON.stringify(
|
|
285
|
-
|
|
286
|
-
let t =
|
|
287
|
-
if (
|
|
288
|
-
!
|
|
289
|
-
else if (!
|
|
290
|
-
(
|
|
291
|
-
) &&
|
|
292
|
-
let
|
|
293
|
-
const
|
|
294
|
-
let G =
|
|
295
|
-
return G &&
|
|
295
|
+
() => e.dependencies,
|
|
296
|
+
(l, a) => {
|
|
297
|
+
!z && e.prefill === "focus" && Y || JSON.stringify(l) !== JSON.stringify(a) && (j && clearTimeout(j), j = setTimeout(async () => {
|
|
298
|
+
if (JSON.stringify(l) !== JSON.stringify(a)) {
|
|
299
|
+
e.enforceCoherence && e.stash && (p.value = []);
|
|
300
|
+
let t = u.value;
|
|
301
|
+
if (u.value = "", await N({ prefill: !0 }), u.value = t, !e.multiple)
|
|
302
|
+
!m.value.get(e.modelValue) && e.enforceCoherence && B(e.modelValue) && (u.value = "", e.stash && (p.value = []), c("update:modelValue", null));
|
|
303
|
+
else if (!e.modelValue.every(
|
|
304
|
+
(o) => m.value.get(o)
|
|
305
|
+
) && e.enforceCoherence) {
|
|
306
|
+
let o = [];
|
|
307
|
+
const T = e.modelValue.filter((J) => {
|
|
308
|
+
let G = m.value.get(J);
|
|
309
|
+
return G && o.push(G), G;
|
|
296
310
|
});
|
|
297
|
-
|
|
311
|
+
e.stash && (p.value = o), c("update:modelValue", T);
|
|
298
312
|
}
|
|
299
313
|
}
|
|
300
|
-
},
|
|
314
|
+
}, e.depsDebounceTime));
|
|
301
315
|
},
|
|
302
316
|
{ deep: !0 }
|
|
303
317
|
);
|
|
304
|
-
const
|
|
305
|
-
E.value && v.value &&
|
|
318
|
+
const ye = () => {
|
|
319
|
+
e.debug && console.log("Running display options"), E.value && v.value && Ue(E.value, v.value, {
|
|
306
320
|
placement: "bottom",
|
|
307
|
-
middleware: [Xe(6),
|
|
308
|
-
}).then((
|
|
321
|
+
middleware: [Xe(6), je(), Qe()]
|
|
322
|
+
}).then((l) => {
|
|
309
323
|
var a;
|
|
310
|
-
v.value && (v.value.style.left = `${
|
|
324
|
+
v.value && (v.value.style.left = `${l.x}px`, v.value.style.top = `${l.y}px`, v.value.style.width = `${(a = E.value) == null ? void 0 : a.offsetWidth}px`);
|
|
311
325
|
});
|
|
312
|
-
},
|
|
313
|
-
K.value = !1,
|
|
314
|
-
},
|
|
315
|
-
|
|
316
|
-
},
|
|
326
|
+
}, k = f(!1), Q = f(!1), W = f(!1), K = f(!0), $ = async () => {
|
|
327
|
+
K.value = !1, Q.value = !0, await q(e.transitionDuration), Q.value = !1, k.value = !0;
|
|
328
|
+
}, A = async () => {
|
|
329
|
+
k.value = !1, W.value = !0, await q(e.transitionDuration), W.value = !1, K.value = !0;
|
|
330
|
+
}, P = f(!1);
|
|
317
331
|
let Y = !0;
|
|
318
|
-
const we = async (
|
|
319
|
-
c("focus",
|
|
320
|
-
}, ne = (
|
|
321
|
-
if (e.target instanceof Node && F.value && v.value && !F.value.contains(
|
|
322
|
-
|
|
323
|
-
|
|
332
|
+
const we = async (l) => {
|
|
333
|
+
e.debug && console.log("Running onInputFocus"), c("focus", l), P.value = !0, document.addEventListener("click", oe), document.addEventListener("focusin", ne), S.value instanceof HTMLInputElement && S.value.select(), e.prefill === "focus" && Y && !z && (await N({ prefill: !0 }), Y = !1);
|
|
334
|
+
}, ne = (l) => {
|
|
335
|
+
if (e.debug && console.log("Running onFocusOutside"), l.target instanceof Node && F.value && v.value && !F.value.contains(l.target) && !v.value.contains(l.target)) {
|
|
336
|
+
A(), c("inactive"), document.removeEventListener("focusin", ne), P.value = !1, e.multiple && q(500).then(() => {
|
|
337
|
+
u.value = "";
|
|
324
338
|
});
|
|
325
339
|
return;
|
|
326
340
|
}
|
|
327
|
-
}, Ve = async (
|
|
328
|
-
if (c("blur",
|
|
341
|
+
}, Ve = async (l) => {
|
|
342
|
+
if (e.debug && console.log("Running onInputBlur"), c("blur", l), !e.multiple) {
|
|
329
343
|
let a = !1;
|
|
330
|
-
const t =
|
|
344
|
+
const t = e.modelValue;
|
|
331
345
|
if (await Promise.race([
|
|
332
346
|
q(250),
|
|
333
|
-
Ze(() => t !==
|
|
347
|
+
Ze(() => t !== e.modelValue).then(() => {
|
|
334
348
|
a = !0;
|
|
335
349
|
})
|
|
336
350
|
]), !a) {
|
|
337
|
-
const n =
|
|
338
|
-
n && (
|
|
351
|
+
const n = m.value.get(e.modelValue);
|
|
352
|
+
n && (u.value = n.text);
|
|
339
353
|
}
|
|
340
354
|
}
|
|
341
|
-
},
|
|
342
|
-
c("input",
|
|
343
|
-
}, r = f(null),
|
|
344
|
-
r.value !== null ? r.value++ : r.value = 0,
|
|
345
|
-
var
|
|
346
|
-
if (
|
|
347
|
-
const a = (
|
|
348
|
-
`#${
|
|
355
|
+
}, Oe = (l) => c("change", l), Ce = (l) => {
|
|
356
|
+
e.debug && console.log("Running onInputInput"), c("input", l), u.value === "" && (e.multiple || c("update:modelValue", null)), typeof e.items == "function" && Te();
|
|
357
|
+
}, r = f(null), _ = y(() => Number.isInteger(r.value) && r.value ? (r.value === -1 && (r.value = C.value.length - 1), r.value % C.value.length) : r.value), i = f(null), ke = () => {
|
|
358
|
+
r.value !== null ? r.value++ : r.value = 0, se().then(() => {
|
|
359
|
+
var l;
|
|
360
|
+
if (_.value !== null) {
|
|
361
|
+
const a = (l = v.value) == null ? void 0 : l.querySelector(
|
|
362
|
+
`#${O.value[_.value].id}`
|
|
349
363
|
);
|
|
350
364
|
a instanceof HTMLElement && a.scrollIntoView({
|
|
351
365
|
behavior: "smooth",
|
|
@@ -354,12 +368,12 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
354
368
|
});
|
|
355
369
|
}
|
|
356
370
|
});
|
|
357
|
-
},
|
|
358
|
-
r.value !== null ? r.value-- : r.value =
|
|
359
|
-
var
|
|
360
|
-
if (
|
|
361
|
-
const a = (
|
|
362
|
-
`#${
|
|
371
|
+
}, _e = () => {
|
|
372
|
+
r.value !== null ? r.value-- : r.value = O.value.length - 1, se().then(() => {
|
|
373
|
+
var l;
|
|
374
|
+
if (_.value !== null) {
|
|
375
|
+
const a = (l = v.value) == null ? void 0 : l.querySelector(
|
|
376
|
+
`#${O.value[_.value].id}`
|
|
363
377
|
);
|
|
364
378
|
a instanceof HTMLElement && a.scrollIntoView({
|
|
365
379
|
behavior: "smooth",
|
|
@@ -368,40 +382,40 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
368
382
|
});
|
|
369
383
|
}
|
|
370
384
|
});
|
|
371
|
-
},
|
|
385
|
+
}, Se = async (l) => {
|
|
372
386
|
var a, t;
|
|
373
|
-
if (
|
|
374
|
-
|
|
387
|
+
if (e.readonly || e.disabled) {
|
|
388
|
+
l.preventDefault();
|
|
375
389
|
return;
|
|
376
390
|
}
|
|
377
|
-
switch (
|
|
391
|
+
switch (l.key) {
|
|
378
392
|
case "ArrowUp":
|
|
379
393
|
{
|
|
380
|
-
if (
|
|
394
|
+
if (l.preventDefault(), d.value)
|
|
381
395
|
return;
|
|
382
|
-
|
|
396
|
+
i.value = null, k.value ? _e() : (s.value.length && (r.value = le(s.value).index), await $());
|
|
383
397
|
}
|
|
384
398
|
break;
|
|
385
399
|
case "ArrowDown":
|
|
386
400
|
{
|
|
387
|
-
if (
|
|
401
|
+
if (l.preventDefault(), d.value)
|
|
388
402
|
return;
|
|
389
|
-
|
|
403
|
+
i.value = null, k.value ? ke() : (s.value.length && (r.value = le(s.value).index), await $());
|
|
390
404
|
}
|
|
391
405
|
break;
|
|
392
406
|
case "ArrowLeft":
|
|
393
407
|
{
|
|
394
408
|
if (d.value)
|
|
395
409
|
return;
|
|
396
|
-
if (!
|
|
397
|
-
let n =
|
|
410
|
+
if (!u.value && s.value.length && (i.value === null ? i.value = s.value.length - 1 : i.value > 0 ? i.value-- : i.value = null, i.value !== null)) {
|
|
411
|
+
let n = s.value[i.value], o = (a = v.value) == null ? void 0 : a.querySelector(
|
|
398
412
|
`#${n.id}`
|
|
399
413
|
);
|
|
400
|
-
|
|
414
|
+
o && (o.scrollIntoView({
|
|
401
415
|
behavior: "smooth",
|
|
402
416
|
block: "nearest",
|
|
403
417
|
inline: "start"
|
|
404
|
-
}), r.value =
|
|
418
|
+
}), r.value = R.value[s.value[i.value].id].index);
|
|
405
419
|
}
|
|
406
420
|
}
|
|
407
421
|
break;
|
|
@@ -409,46 +423,46 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
409
423
|
{
|
|
410
424
|
if (d.value)
|
|
411
425
|
return;
|
|
412
|
-
if (!
|
|
413
|
-
let n =
|
|
426
|
+
if (!u.value && s.value.length && (i.value === null ? i.value = 0 : i.value < s.value.length - 1 ? i.value++ : i.value = null, i.value !== null)) {
|
|
427
|
+
let n = s.value[i.value], o = (t = v.value) == null ? void 0 : t.querySelector(
|
|
414
428
|
`#${n.id}`
|
|
415
429
|
);
|
|
416
|
-
|
|
430
|
+
o && (o.scrollIntoView({
|
|
417
431
|
behavior: "smooth",
|
|
418
432
|
block: "nearest",
|
|
419
433
|
inline: "start"
|
|
420
|
-
}), r.value =
|
|
434
|
+
}), r.value = R.value[s.value[i.value].id].index);
|
|
421
435
|
}
|
|
422
436
|
}
|
|
423
437
|
break;
|
|
424
438
|
case "Enter":
|
|
425
439
|
{
|
|
426
|
-
if (
|
|
440
|
+
if (l.preventDefault(), d.value)
|
|
427
441
|
return;
|
|
428
|
-
if (!
|
|
429
|
-
|
|
430
|
-
else if (
|
|
431
|
-
if (
|
|
442
|
+
if (!k.value)
|
|
443
|
+
C.value.length && s.value.length && (r.value = le(s.value).index), await $();
|
|
444
|
+
else if (_.value !== null) {
|
|
445
|
+
if (C.value[_.value].disabled)
|
|
432
446
|
return;
|
|
433
|
-
|
|
434
|
-
|
|
447
|
+
e.multiple || await A(), M(
|
|
448
|
+
C.value[_.value]
|
|
435
449
|
);
|
|
436
|
-
} else if (
|
|
437
|
-
if (
|
|
450
|
+
} else if (e.addOptions) {
|
|
451
|
+
if (e.itemText || e.itemValue) {
|
|
438
452
|
console.error(
|
|
439
453
|
`Adding an option for mapped items is not supported. You can't create an option while passing "item-text" or "item-value".`
|
|
440
454
|
);
|
|
441
455
|
return;
|
|
442
456
|
}
|
|
443
|
-
|
|
444
|
-
const n =
|
|
445
|
-
|
|
457
|
+
he();
|
|
458
|
+
const n = We(V.value);
|
|
459
|
+
M(R.value[n.id]);
|
|
446
460
|
}
|
|
447
461
|
}
|
|
448
462
|
break;
|
|
449
463
|
case "Tab":
|
|
450
464
|
case "Escape":
|
|
451
|
-
|
|
465
|
+
k.value && await A(), c("inactive"), i.value = null, r.value = null;
|
|
452
466
|
break;
|
|
453
467
|
case "Shift":
|
|
454
468
|
if (d.value)
|
|
@@ -458,103 +472,103 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
458
472
|
{
|
|
459
473
|
if (d.value)
|
|
460
474
|
return;
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
),
|
|
475
|
+
u.value || s.value.length && (i.value === null ? i.value = s.value.length - 1 : (M(
|
|
476
|
+
s.value[i.value]
|
|
477
|
+
), s.value.length ? i.value = Math.max(
|
|
464
478
|
Math.min(
|
|
465
|
-
|
|
466
|
-
|
|
479
|
+
i.value,
|
|
480
|
+
s.value.length - 2
|
|
467
481
|
),
|
|
468
482
|
0
|
|
469
|
-
) :
|
|
483
|
+
) : i.value = null)), await $();
|
|
470
484
|
}
|
|
471
485
|
break;
|
|
472
486
|
default:
|
|
473
|
-
|
|
487
|
+
i.value = null, r.value = null, await $();
|
|
474
488
|
break;
|
|
475
489
|
}
|
|
476
490
|
};
|
|
477
491
|
let Z;
|
|
478
|
-
const
|
|
492
|
+
const Te = () => {
|
|
479
493
|
Z && clearTimeout(Z), Z = setTimeout(async () => {
|
|
480
494
|
try {
|
|
481
495
|
await N({ prefill: !1 });
|
|
482
|
-
} catch (
|
|
483
|
-
console.error(
|
|
496
|
+
} catch (l) {
|
|
497
|
+
console.error(l);
|
|
484
498
|
}
|
|
485
|
-
},
|
|
486
|
-
}, xe = (
|
|
487
|
-
c("click",
|
|
488
|
-
},
|
|
489
|
-
if (
|
|
490
|
-
const a =
|
|
499
|
+
}, e.queryDebounceTime);
|
|
500
|
+
}, xe = (l) => {
|
|
501
|
+
c("click", l), !(e.disabled || e.readonly) && (S.value instanceof HTMLElement && S.value.focus(), $());
|
|
502
|
+
}, Ie = (l) => {
|
|
503
|
+
if (l.currentTarget instanceof HTMLElement && l.currentTarget.classList.contains("bb-base-select-option")) {
|
|
504
|
+
const a = R.value[l.currentTarget.id];
|
|
491
505
|
if (a.disabled)
|
|
492
506
|
return;
|
|
493
|
-
|
|
507
|
+
M(a), S.value instanceof HTMLInputElement && S.value.focus(), e.multiple || A();
|
|
494
508
|
}
|
|
495
|
-
},
|
|
496
|
-
if (
|
|
497
|
-
|
|
498
|
-
|
|
509
|
+
}, oe = (l) => {
|
|
510
|
+
if (l.target instanceof Node && F.value && !F.value.contains(l.target)) {
|
|
511
|
+
A(), c("inactive"), document.removeEventListener("click", oe), P.value = !1, e.multiple && q(500).then(() => {
|
|
512
|
+
u.value = "";
|
|
499
513
|
});
|
|
500
514
|
return;
|
|
501
515
|
}
|
|
502
|
-
},
|
|
503
|
-
(
|
|
516
|
+
}, Be = Ge(
|
|
517
|
+
(l) => typeof l != "string",
|
|
504
518
|
JSON.stringify
|
|
505
|
-
), Ee =
|
|
506
|
-
const a =
|
|
519
|
+
), Ee = y(() => [].concat(e.modelValue).map((l) => {
|
|
520
|
+
const a = Be(l);
|
|
507
521
|
return {
|
|
508
|
-
disabled:
|
|
509
|
-
name:
|
|
522
|
+
disabled: e.disabled,
|
|
523
|
+
name: e.name,
|
|
510
524
|
type: "hidden",
|
|
511
525
|
value: a
|
|
512
526
|
};
|
|
513
527
|
}));
|
|
514
|
-
return (
|
|
528
|
+
return (l, a) => (g(), h("span", {
|
|
515
529
|
ref_key: "outerContainer",
|
|
516
530
|
ref: F,
|
|
517
531
|
class: x({
|
|
518
532
|
"bb-base-select": !0,
|
|
519
|
-
"bb-base-select--active":
|
|
533
|
+
"bb-base-select--active": P.value,
|
|
520
534
|
"bb-base-select--loading": d.value,
|
|
521
|
-
"bb-base-select--disabled":
|
|
522
|
-
"bb-base-select--errors":
|
|
523
|
-
"bb-base-select--readonly":
|
|
535
|
+
"bb-base-select--disabled": l.disabled,
|
|
536
|
+
"bb-base-select--errors": l.hasErrors,
|
|
537
|
+
"bb-base-select--readonly": l.readonly
|
|
524
538
|
}),
|
|
525
539
|
onClick: xe
|
|
526
540
|
}, [
|
|
527
|
-
|
|
541
|
+
b(l.$slots, "prepend-outer"),
|
|
528
542
|
w("span", {
|
|
529
543
|
ref_key: "innerContainer",
|
|
530
544
|
ref: E,
|
|
531
545
|
class: "bb-base-select__inner-container"
|
|
532
546
|
}, [
|
|
533
|
-
|
|
547
|
+
b(l.$slots, "prepend"),
|
|
534
548
|
w("span", el, [
|
|
535
|
-
|
|
536
|
-
|
|
549
|
+
l.multiple ? (g(), h(D, { key: 0 }, [
|
|
550
|
+
l.comma ? (g(!0), h(D, { key: 0 }, H(s.value, (t, n) => (g(), h("span", {
|
|
537
551
|
key: t.id,
|
|
538
552
|
class: x({
|
|
539
553
|
"bb-base-select__selected": !0,
|
|
540
554
|
"bb-base-select__selected--comma": !0,
|
|
541
|
-
"bb-base-select__selected--focused": n ===
|
|
555
|
+
"bb-base-select__selected--focused": n === i.value
|
|
542
556
|
})
|
|
543
|
-
}, L(t.text) + L(n <
|
|
557
|
+
}, L(t.text) + L(n < s.value.length - 1 ? "," : ""), 3))), 128)) : (g(!0), h(D, { key: 1 }, H(s.value, (t, n) => (g(), ue(ze, {
|
|
544
558
|
key: t.id,
|
|
545
559
|
class: x({
|
|
546
560
|
"bb-base-select__selected": !0,
|
|
547
561
|
"bb-base-select__selected--chip": !0,
|
|
548
|
-
"bb-base-select__selected--focused": n ===
|
|
562
|
+
"bb-base-select__selected--focused": n === i.value
|
|
549
563
|
}),
|
|
550
564
|
clearable: !0,
|
|
551
565
|
text: t.text,
|
|
552
|
-
"onClick:clear":
|
|
566
|
+
"onClick:clear": I((o) => M(t), ["stop"])
|
|
553
567
|
}, {
|
|
554
568
|
default: Le(() => [
|
|
555
|
-
|
|
569
|
+
b(l.$slots, "chip", {
|
|
556
570
|
disabled: t.disabled,
|
|
557
|
-
hasErrors:
|
|
571
|
+
hasErrors: l.hasErrors,
|
|
558
572
|
index: t.index,
|
|
559
573
|
item: t.original,
|
|
560
574
|
loading: !!d.value,
|
|
@@ -568,56 +582,56 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
568
582
|
]),
|
|
569
583
|
_: 2
|
|
570
584
|
}, 1032, ["class", "text", "onClick:clear"]))), 128))
|
|
571
|
-
], 64)) :
|
|
585
|
+
], 64)) : ie("", !0),
|
|
572
586
|
Fe(w("input", {
|
|
573
|
-
id:
|
|
587
|
+
id: l.id,
|
|
574
588
|
ref_key: "input",
|
|
575
|
-
ref:
|
|
576
|
-
"onUpdate:modelValue": a[0] || (a[0] = (t) =>
|
|
577
|
-
autocomplete:
|
|
578
|
-
autofocus:
|
|
589
|
+
ref: S,
|
|
590
|
+
"onUpdate:modelValue": a[0] || (a[0] = (t) => u.value = t),
|
|
591
|
+
autocomplete: l.autocomplete,
|
|
592
|
+
autofocus: l.autofocus,
|
|
579
593
|
class: x("bb-base-select__text-input"),
|
|
580
|
-
disabled:
|
|
594
|
+
disabled: l.disabled,
|
|
581
595
|
placeholder: fe.value,
|
|
582
|
-
readonly:
|
|
596
|
+
readonly: l.readonly || !l.allowWriting,
|
|
583
597
|
type: "text",
|
|
584
|
-
onBlur:
|
|
585
|
-
onChange:
|
|
586
|
-
onFocus:
|
|
587
|
-
onInput:
|
|
588
|
-
onKeydown:
|
|
598
|
+
onBlur: I(Ve, ["stop"]),
|
|
599
|
+
onChange: I(Oe, ["stop"]),
|
|
600
|
+
onFocus: I(we, ["stop"]),
|
|
601
|
+
onInput: I(Ce, ["stop"]),
|
|
602
|
+
onKeydown: I(Se, ["stop"])
|
|
589
603
|
}, null, 40, ll), [
|
|
590
|
-
[
|
|
604
|
+
[Me, u.value]
|
|
591
605
|
]),
|
|
592
|
-
(
|
|
606
|
+
(g(), ue(Ae, { to: "body" }, [
|
|
593
607
|
w("span", {
|
|
594
608
|
ref_key: "optionsContainer",
|
|
595
609
|
ref: v,
|
|
596
610
|
class: x({
|
|
597
611
|
"bb-base-select__options-container": !0,
|
|
598
|
-
"bb-base-select__options-container--shown":
|
|
599
|
-
"bb-base-select__options-container--showing":
|
|
600
|
-
"bb-base-select__options-container--hiding":
|
|
612
|
+
"bb-base-select__options-container--shown": k.value,
|
|
613
|
+
"bb-base-select__options-container--showing": Q.value,
|
|
614
|
+
"bb-base-select__options-container--hiding": W.value,
|
|
601
615
|
"bb-base-select__options-container--hidden": K.value
|
|
602
616
|
}),
|
|
603
617
|
role: "listbox",
|
|
604
618
|
style: Je({ transitionDuration: ve }),
|
|
605
619
|
tabindex: -1
|
|
606
620
|
}, [
|
|
607
|
-
|
|
608
|
-
!
|
|
609
|
-
|
|
610
|
-
ee(L(
|
|
621
|
+
b(l.$slots, "options:prepend"),
|
|
622
|
+
!C.value.length && d.value ? (g(), h("span", tl, [
|
|
623
|
+
b(l.$slots, "loading", { query: u.value }, () => [
|
|
624
|
+
ee(L(l.loadingText), 1)
|
|
611
625
|
])
|
|
612
|
-
])) :
|
|
613
|
-
|
|
614
|
-
ee(L(
|
|
626
|
+
])) : C.value.length ? ie("", !0) : (g(), h("span", al, [
|
|
627
|
+
b(l.$slots, "no-data", { query: u.value }, () => [
|
|
628
|
+
ee(L(l.noDataText), 1)
|
|
615
629
|
])
|
|
616
630
|
])),
|
|
617
|
-
(
|
|
631
|
+
(g(!0), h(D, null, H(C.value, (t) => (g(), h(D, {
|
|
618
632
|
key: t.id
|
|
619
633
|
}, [
|
|
620
|
-
|
|
634
|
+
b(l.$slots, "option:prepend", {
|
|
621
635
|
item: t.original
|
|
622
636
|
}),
|
|
623
637
|
w("span", {
|
|
@@ -630,12 +644,12 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
630
644
|
"bb-base-select-option--disabled": t.disabled
|
|
631
645
|
}),
|
|
632
646
|
role: "option",
|
|
633
|
-
onClick:
|
|
647
|
+
onClick: I(Ie, ["stop"])
|
|
634
648
|
}, [
|
|
635
|
-
|
|
649
|
+
b(l.$slots, "option", {
|
|
636
650
|
disabled: t.disabled,
|
|
637
651
|
focused: t.focused,
|
|
638
|
-
hasErrors:
|
|
652
|
+
hasErrors: l.hasErrors,
|
|
639
653
|
index: t.index,
|
|
640
654
|
item: t.original,
|
|
641
655
|
loading: !!d.value,
|
|
@@ -644,49 +658,49 @@ const el = { class: "bb-base-select__input-container" }, ll = ["id", "autocomple
|
|
|
644
658
|
text: t.text,
|
|
645
659
|
value: t.value
|
|
646
660
|
}, () => [
|
|
647
|
-
w("span",
|
|
648
|
-
w("span",
|
|
661
|
+
w("span", ol, [
|
|
662
|
+
w("span", ul, L(t.text), 1)
|
|
649
663
|
])
|
|
650
664
|
])
|
|
651
665
|
], 10, nl),
|
|
652
|
-
|
|
666
|
+
b(l.$slots, "option:append", {
|
|
653
667
|
item: t.original
|
|
654
668
|
})
|
|
655
669
|
], 64))), 128)),
|
|
656
|
-
|
|
670
|
+
b(l.$slots, "options:append")
|
|
657
671
|
], 6)
|
|
658
672
|
]))
|
|
659
673
|
]),
|
|
660
|
-
w("span",
|
|
661
|
-
|
|
674
|
+
w("span", il, [
|
|
675
|
+
b(l.$slots, "chevron", {
|
|
662
676
|
loading: !!d.value,
|
|
663
|
-
shown:
|
|
677
|
+
shown: k.value
|
|
664
678
|
}, () => [
|
|
665
|
-
|
|
679
|
+
sl
|
|
666
680
|
])
|
|
667
681
|
]),
|
|
668
|
-
d.value ? (
|
|
682
|
+
d.value ? (g(), h("span", {
|
|
669
683
|
key: 1,
|
|
670
684
|
class: x({
|
|
671
685
|
"bb-base-select__spinner": !0,
|
|
672
686
|
"bb-base-select__spinner--loading": d.value
|
|
673
687
|
})
|
|
674
688
|
}, [
|
|
675
|
-
|
|
689
|
+
b(l.$slots, "spinner", {
|
|
676
690
|
loading: !!d.value
|
|
677
691
|
}, () => [
|
|
678
|
-
qe(
|
|
692
|
+
qe(Pe, { size: "sm" })
|
|
679
693
|
])
|
|
680
|
-
], 2)) :
|
|
694
|
+
], 2)) : b(l.$slots, "append", { key: 0 })
|
|
681
695
|
], 512),
|
|
682
|
-
|
|
683
|
-
(
|
|
696
|
+
b(l.$slots, "append-outer"),
|
|
697
|
+
(g(!0), h(D, null, H(Ee.value, (t) => (g(), h("input", Re({
|
|
684
698
|
key: t.value
|
|
685
699
|
}, t), null, 16))), 128))
|
|
686
700
|
], 2));
|
|
687
701
|
}
|
|
688
702
|
});
|
|
689
703
|
export {
|
|
690
|
-
|
|
704
|
+
_l as default
|
|
691
705
|
};
|
|
692
706
|
//# sourceMappingURL=index31.js.map
|