bitboss-ui 2.0.165 → 2.0.167
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 +2 -1
- package/dist/components/BaseButton/RouterComponent.vue.d.ts +2 -1
- package/dist/components/BaseCheckbox/BaseCheckbox.vue.d.ts +5 -2
- package/dist/components/BaseCheckboxGroup/BaseCheckboxGroup.vue.d.ts +2 -4
- package/dist/components/BaseColorInput/BaseColorInput.vue.d.ts +106 -4
- package/dist/components/BaseColorInput/ColorPallette.vue.d.ts +5 -1
- package/dist/components/BaseDatePicker/BaseDatePicker.vue.d.ts +4 -3
- package/dist/components/BaseDatePicker/BaseDatePickerHeader.vue.d.ts +1 -1
- package/dist/components/BaseDatePicker/BaseDatePickerInputDaySelector.vue.d.ts +5 -2
- package/dist/components/BaseDatePicker/BaseDatePickerMonthSelector.vue.d.ts +1 -1
- package/dist/components/BaseDatePicker/BaseDatePickerYearSelector.vue.d.ts +3 -1
- package/dist/components/BaseDatePickerInput/BaseDatePickerInput.vue.d.ts +200 -10
- package/dist/components/BaseDialog/BaseDialog.vue.d.ts +10 -2
- package/dist/components/BaseInputContainer/BaseInputContainer.vue.d.ts +3 -2
- package/dist/components/BaseNumberInput/BaseNumberInput.vue.d.ts +5 -2
- package/dist/components/BaseRadio/BaseRadio.vue.d.ts +3 -2
- package/dist/components/BaseRadioGroup/BaseRadioGroup.vue.d.ts +2 -4
- package/dist/components/BaseRating/BaseRating.vue.d.ts +5 -2
- package/dist/components/BaseSelect/BaseSelect.vue.d.ts +2 -4
- package/dist/components/BaseSlider/BaseSlider.vue.d.ts +8 -2
- package/dist/components/BaseSwitch/BaseSwitch.vue.d.ts +5 -2
- package/dist/components/BaseSwitchGroup/BaseSwitchGroup.vue.d.ts +2 -4
- package/dist/components/BaseTag/BaseTag.vue.d.ts +207 -6
- package/dist/components/BaseTextInput/BaseTextInput.vue.d.ts +5 -2
- package/dist/components/BaseTextarea/BaseTextarea.vue.d.ts +5 -2
- package/dist/components/BbAccordion/BbAccordion.vue.d.ts +3 -2
- package/dist/components/BbAlert/BbAlert.vue.d.ts +2 -1
- package/dist/components/BbAvatar/BbAvatar.vue.d.ts +5 -2
- package/dist/components/BbBadge/BbBadge.vue.d.ts +3 -2
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue.d.ts +3 -2
- package/dist/components/BbButton/BbButton.vue.d.ts +2 -1
- package/dist/components/BbCheckbox/BbCheckbox.vue.d.ts +3 -2
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +2 -4
- package/dist/components/BbChip/BbChip.vue.d.ts +3 -2
- package/dist/components/BbCollapsible/BbCollapsible.vue.d.ts +2 -1
- package/dist/components/BbColorInput/BbColorInput.vue.d.ts +3 -2
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +3 -2
- package/dist/components/BbDialog/BbDialog.vue.d.ts +2 -1
- package/dist/components/BbDropdown/BbDropdown.vue.d.ts +241 -100
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +69 -126
- package/dist/components/BbDropzone/BbDropzone.vue.d.ts +5 -2
- package/dist/components/BbIntersection/BbIntersection.vue.d.ts +5 -2
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +100 -9
- package/dist/components/BbOffCanvas/BbOffCanvas.vue.d.ts +10 -2
- package/dist/components/BbPagination/BbPagination.vue.d.ts +10 -6
- package/dist/components/BbPopover/BbPopover.vue.d.ts +168 -15
- package/dist/components/BbProgress/BbProgress.vue.d.ts +1 -1
- package/dist/components/BbRadio/BbRadio.vue.d.ts +3 -2
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +2 -4
- package/dist/components/BbRating/BbRating.vue.d.ts +3 -2
- package/dist/components/BbRatio/BbRatio.vue.d.ts +2 -1
- package/dist/components/BbRows/BbRows.vue.d.ts +3 -5
- package/dist/components/BbSelect/BbSelect.vue.d.ts +2 -4
- package/dist/components/BbSlider/BbSlider.vue.d.ts +3 -2
- package/dist/components/BbSmoothHeight/BbSmoothHeight.vue.d.ts +6 -2
- package/dist/components/BbSpinner/BbSpinner.vue.d.ts +1 -1
- package/dist/components/BbSwitch/BbSwitch.vue.d.ts +3 -2
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +2 -4
- package/dist/components/BbTab/BbTab.vue.d.ts +6 -2
- package/dist/components/BbTable/BbTable.vue.d.ts +2 -4
- package/dist/components/BbTag/BbTag.vue.d.ts +3 -2
- package/dist/components/BbTeleport.vue.d.ts +2 -1
- package/dist/components/BbTextInput/BbTextInput.vue.d.ts +3 -2
- package/dist/components/BbTextarea/BbTextarea.vue.d.ts +3 -2
- package/dist/components/BbToast/BbToastMessage.vue.d.ts +1 -1
- package/dist/components/BbTooltip/BbTooltip.vue.d.ts +175 -7
- package/dist/components/BbTree/BbTree.vue.d.ts +2 -1
- package/dist/components/ClearableButton.vue.d.ts +1 -1
- package/dist/components/CommonFloating.vue.d.ts +6 -2
- package/dist/components/CommonInputInnerContainer.vue.d.ts +5 -2
- package/dist/components/CommonInputOuterContainer.vue.d.ts +5 -4
- package/dist/components/CommonPopover.vue.d.ts +42 -0
- package/dist/components/ErrorIcon.vue.d.ts +1 -1
- package/dist/components/ListBox.vue.d.ts +4 -6
- package/dist/components/OptionsContainer.vue.d.ts +4 -6
- package/dist/components/Transitions/Slide.vue.d.ts +2 -1
- package/dist/composables/useUntil.d.ts +7 -0
- package/dist/{style.css → index.css} +1 -1
- package/dist/index.js +148 -143
- package/dist/index100.js +122 -135
- package/dist/index102.js +100 -0
- package/dist/index104.js +24 -0
- package/dist/index106.js +144 -0
- package/dist/index107.js +106 -59
- package/dist/index109.js +101 -289
- package/dist/index11.js +2 -2
- package/dist/index111.js +37 -476
- package/dist/index113.js +31 -118
- package/dist/index115.js +43 -61
- package/dist/index117.js +86 -78
- package/dist/index119.js +296 -26
- package/dist/index12.js +6 -6
- package/dist/index121.js +470 -138
- package/dist/index123.js +117 -115
- package/dist/index125.js +110 -35
- package/dist/index127.js +115 -45
- package/dist/index129.js +28 -31
- package/dist/index13.js +5 -5
- package/dist/index131.js +117 -21
- package/dist/index133.js +120 -9
- package/dist/index135.js +2 -2
- package/dist/index136.js +21 -5
- package/dist/index137.js +375 -7
- package/dist/index138.js +9 -6
- package/dist/index139.js +25 -3
- package/dist/index140.js +2 -3
- package/dist/index141.js +5 -3
- package/dist/index142.js +9 -3
- package/dist/index143.js +6 -3
- package/dist/index144.js +1 -1
- package/dist/index145.js +1 -1
- package/dist/index146.js +1 -1
- package/dist/index147.js +1 -1
- package/dist/index148.js +1 -1
- package/dist/index149.js +1 -1
- package/dist/index15.js +15 -15
- package/dist/index150.js +1 -1
- package/dist/index151.js +1 -1
- package/dist/index152.js +1 -1
- package/dist/index153.js +1 -1
- package/dist/index154.js +1 -1
- package/dist/index155.js +1 -1
- package/dist/index156.js +1 -1
- package/dist/index157.js +1 -1
- package/dist/index158.js +1 -1
- package/dist/index159.js +1 -1
- package/dist/index160.js +1 -1
- package/dist/index161.js +1 -1
- package/dist/index162.js +1 -1
- package/dist/index163.js +1 -1
- package/dist/index164.js +1 -1
- package/dist/index165.js +1 -1
- package/dist/index166.js +2 -2
- package/dist/index167.js +5 -0
- package/dist/index168.js +2 -2
- package/dist/index169.js +5 -0
- package/dist/index17.js +6 -6
- package/dist/index170.js +1 -1
- package/dist/index171.js +1 -1
- package/dist/index172.js +1 -1
- package/dist/index173.js +1 -1
- package/dist/index174.js +1 -1
- package/dist/index175.js +1 -1
- package/dist/index176.js +1 -1
- package/dist/index177.js +2 -2
- package/dist/index178.js +5 -0
- package/dist/index179.js +3 -2
- package/dist/index180.js +1 -1
- package/dist/index181.js +2 -3
- package/dist/index182.js +1 -1
- package/dist/index183.js +1 -1
- package/dist/index184.js +1 -1
- package/dist/index185.js +1 -1
- package/dist/index186.js +1 -1
- package/dist/index187.js +1 -1
- package/dist/index188.js +2 -2
- package/dist/index189.js +3 -2
- package/dist/index19.js +10 -10
- package/dist/index190.js +1 -1
- package/dist/index191.js +2 -3
- package/dist/index192.js +1 -1
- package/dist/index193.js +5 -0
- package/dist/index194.js +1 -1
- package/dist/index195.js +5 -0
- package/dist/index196.js +1 -1
- package/dist/index197.js +1 -1
- package/dist/index198.js +1 -1
- package/dist/index199.js +1 -1
- package/dist/index200.js +1 -1
- package/dist/index201.js +1 -1
- package/dist/index202.js +1 -1
- package/dist/index203.js +1 -1
- package/dist/index204.js +1 -1
- package/dist/index205.js +1 -1
- package/dist/index206.js +100 -77
- package/dist/index208.js +2 -4
- package/dist/index209.js +3 -40
- package/dist/index21.js +17 -17
- package/dist/index210.js +41 -20
- package/dist/index211.js +19 -93
- package/dist/index212.js +96 -0
- package/dist/{index213.js → index214.js} +9 -9
- package/dist/{index215.js → index216.js} +15 -15
- package/dist/index218.js +13 -13
- package/dist/index219.js +13 -5
- package/dist/index220.js +5 -16
- package/dist/index221.js +5 -16
- package/dist/index222.js +5 -19
- package/dist/index223.js +5 -15
- package/dist/index224.js +5 -19
- package/dist/index225.js +5 -27
- package/dist/index226.js +5 -3
- package/dist/index227.js +3 -2
- package/dist/index228.js +2 -8
- package/dist/index229.js +6 -248
- package/dist/index23.js +25 -25
- package/dist/index230.js +240 -42
- package/dist/index231.js +43 -35
- package/dist/index232.js +44 -5
- package/dist/index233.js +5 -60
- package/dist/index234.js +60 -3
- package/dist/index235.js +5 -85
- package/dist/index236.js +9 -0
- package/dist/index237.js +15 -29
- package/dist/index238.js +34 -17
- package/dist/index239.js +86 -51
- package/dist/index241.js +28 -11
- package/dist/index242.js +15 -14
- package/dist/index243.js +50 -124
- package/dist/index244.js +15 -2
- package/dist/index245.js +12 -6
- package/dist/index246.js +16 -2
- package/dist/index247.js +5 -9
- package/dist/index248.js +2 -2
- package/dist/index249.js +2 -4
- package/dist/index25.js +8 -8
- package/dist/index250.js +9 -2
- package/dist/index251.js +18 -7
- package/dist/index252.js +127 -14
- package/dist/index253.js +4 -34
- package/dist/index254.js +106 -2
- package/dist/index256.js +100 -2
- package/dist/index258.js +12 -126
- package/dist/index259.js +211 -89
- package/dist/index260.js +370 -0
- package/dist/index261.js +2 -100
- package/dist/index262.js +4 -0
- package/dist/index263.js +2 -12
- package/dist/index264.js +3 -228
- package/dist/index265.js +162 -354
- package/dist/index266.js +2 -176
- package/dist/index27.js +18 -18
- package/dist/index270.js +11 -23
- package/dist/index271.js +101 -3
- package/dist/index273.js +23 -16
- package/dist/index274.js +6 -281
- package/dist/index275.js +16 -6
- package/dist/index276.js +3 -2
- package/dist/index277.js +9 -2
- package/dist/index278.js +8 -2
- package/dist/index279.js +2 -2
- package/dist/index280.js +67 -2
- package/dist/index281.js +5 -2
- package/dist/index282.js +5 -2
- package/dist/index283.js +8 -2
- package/dist/index284.js +471 -2
- package/dist/index285.js +3 -2
- package/dist/index286.js +3 -2
- package/dist/index287.js +3 -28
- package/dist/index289.js +9 -0
- package/dist/index29.js +5 -5
- package/dist/index290.js +6 -6
- package/dist/index291.js +11 -7
- package/dist/index292.js +279 -10
- package/dist/index293.js +2 -431
- package/dist/index294.js +16 -3
- package/dist/index295.js +2 -3
- package/dist/index296.js +16 -3
- package/dist/index297.js +4 -0
- package/dist/index298.js +18 -223
- package/dist/index299.js +2 -3
- package/dist/index300.js +15 -17
- package/dist/index301.js +2 -9
- package/dist/index302.js +18 -199
- package/dist/index303.js +2 -2
- package/dist/index304.js +27 -4
- package/dist/index305.js +2 -2
- package/dist/index306.js +1 -1
- package/dist/index307.js +2 -8
- package/dist/index308.js +2 -126
- package/dist/index309.js +2 -3
- package/dist/index31.js +4 -4
- package/dist/index310.js +28 -3
- package/dist/index311.js +21 -1
- package/dist/index313.js +199 -126
- package/dist/index314.js +4 -2
- package/dist/index315.js +2 -67
- package/dist/index316.js +6 -5
- package/dist/index317.js +2 -89
- package/dist/index318.js +3 -3
- package/dist/index319.js +17 -3
- package/dist/index320.js +123 -56
- package/dist/index321.js +2 -33
- package/dist/index322.js +128 -27
- package/dist/index323.js +5 -0
- package/dist/index324.js +3 -480
- package/dist/index325.js +2 -7
- package/dist/index326.js +4 -7
- package/dist/index327.js +379 -16
- package/dist/index328.js +125 -7
- package/dist/index329.js +5 -6
- package/dist/index33.js +10 -10
- package/dist/index330.js +3 -8
- package/dist/index331.js +5 -58
- package/dist/index332.js +700 -57
- package/dist/index333.js +354 -5
- package/dist/index334.js +57 -7
- package/dist/index335.js +7 -3
- package/dist/index336.js +5 -46
- package/dist/index337.js +8 -2
- package/dist/index338.js +9 -0
- package/dist/index339.js +32 -2
- package/dist/index340.js +28 -2
- package/dist/index342.js +57 -46
- package/dist/index343.js +60 -0
- package/dist/index344.js +7 -0
- package/dist/index345.js +230 -0
- package/dist/index346.js +4 -0
- package/dist/index347.js +49 -0
- package/dist/index348.js +9 -0
- package/dist/index349.js +21 -0
- package/dist/index35.js +9 -9
- package/dist/index350.js +95 -0
- package/dist/index352.js +5 -0
- package/dist/index353.js +484 -0
- package/dist/index354.js +49 -0
- package/dist/index355.js +483 -0
- package/dist/index356.js +4 -0
- package/dist/index37.js +33 -33
- package/dist/index39.js +15 -15
- package/dist/index41.js +5 -5
- package/dist/index43.js +10 -10
- package/dist/index45.js +25 -25
- package/dist/index47.js +6 -6
- package/dist/index49.js +15 -15
- package/dist/index51.js +4 -4
- package/dist/index53.js +6 -6
- package/dist/index55.js +6 -6
- package/dist/index57.js +16 -16
- package/dist/index59.js +3 -3
- package/dist/index6.js +1 -1
- package/dist/index61.js +9 -9
- package/dist/index63.js +5 -5
- package/dist/index65.js +2 -2
- package/dist/index67.js +35 -107
- package/dist/index69.js +42 -85
- package/dist/index7.js +2 -2
- package/dist/index71.js +47 -56
- package/dist/index73.js +83 -54
- package/dist/index75.js +113 -273
- package/dist/index77.js +50 -158
- package/dist/index79.js +228 -194
- package/dist/index81.js +148 -40
- package/dist/index83.js +221 -0
- package/dist/index85.js +53 -0
- package/dist/index87.js +46 -0
- package/dist/index88.js +125 -184
- package/dist/index9.js +1 -1
- package/dist/index90.js +240 -26
- package/dist/index92.js +230 -86
- package/dist/index94.js +135 -117
- package/dist/index96.js +27 -94
- package/dist/index98.js +85 -15
- package/package.json +27 -28
- package/dist/index101.js +0 -178
- package/dist/index103.js +0 -116
- package/dist/index105.js +0 -100
- package/dist/index126.js +0 -46
- package/dist/index128.js +0 -49
- package/dist/index130.js +0 -4
- package/dist/index132.js +0 -346
- package/dist/index134.js +0 -27
- package/dist/index217.js +0 -15
- package/dist/index240.js +0 -17
- package/dist/index255.js +0 -4
- package/dist/index257.js +0 -20
- package/dist/index272.js +0 -8
- package/dist/index288.js +0 -24
- package/dist/index312.js +0 -438
- package/dist/index341.js +0 -426
- package/dist/index82.js +0 -136
- package/dist/index84.js +0 -247
- package/dist/index86.js +0 -238
package/dist/index79.js
CHANGED
@@ -1,221 +1,255 @@
|
|
1
|
-
import { defineComponent as
|
2
|
-
import {
|
3
|
-
import { useId as
|
4
|
-
import oe from "./
|
1
|
+
import { defineComponent as U, computed as V, useTemplateRef as q, ref as F, createBlock as h, openBlock as b, normalizeClass as W, withCtx as L, createElementBlock as T, createCommentVNode as D, unref as p, normalizeStyle as G, renderSlot as v, Fragment as A, renderList as J, createVNode as Q, mergeProps as X, createElementVNode as Y, toDisplayString as Z, normalizeProps as x, guardReactiveProps as ee } from "vue";
|
2
|
+
import { findRightIndex as _ } from "./index269.js";
|
3
|
+
import { useId as te } from "./index8.js";
|
4
|
+
import { useIntersectionObserver as oe } from "./index137.js";
|
5
|
+
import { useUntil as ne } from "./index270.js";
|
6
|
+
import { wait as ae } from "./index135.js";
|
7
|
+
import le from "./index13.js";
|
8
|
+
/* empty css */
|
9
|
+
import B from "./index85.js";
|
10
|
+
/* empty css */
|
11
|
+
import se from "./index271.js";
|
5
12
|
/* empty css */
|
6
|
-
|
7
|
-
|
13
|
+
import O from "./index273.js";
|
14
|
+
const ie = ["id", "aria-labelledby", "inert"], re = { class: "item__content" }, $e = /* @__PURE__ */ U({
|
15
|
+
__name: "BbDropdown",
|
8
16
|
props: {
|
9
|
-
|
17
|
+
arrowPadding: { default: 10 },
|
18
|
+
block: { type: Boolean },
|
10
19
|
disabled: { type: Boolean },
|
11
|
-
|
12
|
-
hasErrors: { type: Boolean },
|
20
|
+
eager: { type: Boolean },
|
13
21
|
id: {},
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
22
|
+
offset: { default: 3 },
|
23
|
+
padding: { default: 6 },
|
24
|
+
placement: { default: "bottom" },
|
25
|
+
theme: { default: "default" },
|
26
|
+
transitionDuration: { default: 300 },
|
27
|
+
teleportTarget: {},
|
28
|
+
items: {},
|
29
|
+
width: { default: 200 }
|
21
30
|
},
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
throw new Error("Property accept is not an array");
|
28
|
-
if (a.multiple && !Array.isArray(a.modelValue))
|
29
|
-
throw new Error(
|
30
|
-
"Component is set to multiple but modelValue is not an array"
|
31
|
+
setup(K) {
|
32
|
+
const u = K, d = u.id ?? `bb_${te().id.value}`, c = V(() => {
|
33
|
+
let e = u.items.findIndex((o) => !o.disabled), a = _(
|
34
|
+
u.items,
|
35
|
+
(o) => !o.disabled
|
31
36
|
);
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
);
|
47
|
-
x(
|
48
|
-
() => a.accept,
|
49
|
-
async () => {
|
50
|
-
if (a.accept) {
|
51
|
-
let e = [];
|
52
|
-
for (let t = 0; t < a.accept.length; t++) {
|
53
|
-
const r = a.accept[t];
|
54
|
-
if (r.includes("/")) e.push(r);
|
55
|
-
else {
|
56
|
-
b || (b = (await import("./index272.js")).default);
|
57
|
-
const o = b.getType(r);
|
58
|
-
if (!o)
|
59
|
-
throw new Error(
|
60
|
-
`Could not detect the correct mime associated with ${r}`
|
37
|
+
return u.items.map((o, t) => {
|
38
|
+
const n = `${d}-item-${o.key}`, { onClick: S, ...C } = o, N = async () => {
|
39
|
+
await f();
|
40
|
+
const s = document.querySelector(`#${d}`);
|
41
|
+
if (s) s instanceof HTMLElement && s.focus();
|
42
|
+
else return;
|
43
|
+
S && S();
|
44
|
+
}, R = (s) => {
|
45
|
+
if (s.target instanceof HTMLElement && s.target.dataset.dropdownItem) {
|
46
|
+
if (!i.value) return;
|
47
|
+
if (s.key === "ArrowDown") {
|
48
|
+
if (s.preventDefault(), i.value && t !== a) {
|
49
|
+
const r = i.value.querySelector(
|
50
|
+
O.map((y) => `#${n} ~ ${y}`).join(",")
|
61
51
|
);
|
62
|
-
|
52
|
+
r && r instanceof HTMLElement && r.focus();
|
53
|
+
}
|
54
|
+
} else if (s.key === "ArrowUp") {
|
55
|
+
if (s.preventDefault(), i.value && t !== e) {
|
56
|
+
const r = _(u.items, (k, $) => $ < t && !k.disabled), w = Array.from(
|
57
|
+
i.value.querySelectorAll(".bb-dropdown__item")
|
58
|
+
)[r];
|
59
|
+
w && w instanceof HTMLElement && w.focus();
|
60
|
+
}
|
61
|
+
} else if (s.key === "Tab") {
|
62
|
+
if (t === a && !s.shiftKey) {
|
63
|
+
const r = O.join(","), y = Array.from(
|
64
|
+
document.querySelectorAll(r)
|
65
|
+
), w = y.findIndex(
|
66
|
+
($) => $.id === d
|
67
|
+
), k = y[w + 1];
|
68
|
+
if (k) k instanceof HTMLElement && (s.preventDefault(), f(), k.focus());
|
69
|
+
else return;
|
70
|
+
} else if (t === e && s.shiftKey) {
|
71
|
+
const r = document.querySelector(`#${d}`);
|
72
|
+
if (r) r instanceof HTMLElement && (s.preventDefault(), r.focus());
|
73
|
+
else return;
|
74
|
+
}
|
63
75
|
}
|
64
76
|
}
|
65
|
-
|
66
|
-
|
77
|
+
};
|
78
|
+
return {
|
79
|
+
...C,
|
80
|
+
original: o,
|
81
|
+
key: o.key.split(/\W+/g).join("_").toLowerCase(),
|
82
|
+
disabled: C.disabled || u.disabled,
|
83
|
+
id: n,
|
84
|
+
onClick: N,
|
85
|
+
onKeydown: R
|
86
|
+
};
|
87
|
+
});
|
88
|
+
}), m = q("wrapper"), i = q("content");
|
89
|
+
oe(
|
90
|
+
m,
|
91
|
+
([{ intersectionRatio: e }]) => {
|
92
|
+
e !== 1 && l.value && f();
|
67
93
|
},
|
68
|
-
{
|
94
|
+
{ threshold: [0, 1] }
|
69
95
|
);
|
70
|
-
const
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
r instanceof HTMLInputElement && r.focus();
|
96
|
+
const l = F(!1), g = ne(l), P = () => {
|
97
|
+
l.value ? f() : E();
|
98
|
+
}, j = async (e) => {
|
99
|
+
let a = u.items.findIndex((t) => !t.disabled), o = _(
|
100
|
+
u.items,
|
101
|
+
(t) => !t.disabled
|
102
|
+
);
|
103
|
+
if (e.key === "ArrowDown") {
|
104
|
+
if (e.preventDefault(), l.value || await E(), i.value && c.value.length && a !== -1) {
|
105
|
+
const t = c.value[a].id, n = i.value.querySelector(`#${t}`);
|
106
|
+
n && n instanceof HTMLElement && n.focus();
|
107
|
+
}
|
108
|
+
} else if (e.key === "ArrowUp") {
|
109
|
+
if (e.preventDefault(), l.value || await E(), i.value && c.value.length && o !== -1) {
|
110
|
+
const t = c.value[o].id, n = i.value.querySelector(`#${t}`);
|
111
|
+
n && n instanceof HTMLElement && n.focus();
|
87
112
|
}
|
113
|
+
} else if (e.key === "Tab" && l.value && !e.shiftKey && (e.preventDefault(), i.value && c.value.length && a !== -1)) {
|
114
|
+
const t = c.value[a].id, n = i.value.querySelector(`#${t}`);
|
115
|
+
n && n instanceof HTMLElement && n.focus();
|
88
116
|
}
|
89
117
|
}, H = (e) => {
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
}
|
95
|
-
e.target.value = "", e.target.files = null;
|
118
|
+
const a = e.target;
|
119
|
+
if (a && a instanceof HTMLElement) {
|
120
|
+
let o = !0;
|
121
|
+
m.value && m.value.$el.contains(a) && (o = !1), i.value && i.value.contains(a) && (o = !1), o && f();
|
96
122
|
}
|
97
|
-
},
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
(s) => S(s, t)
|
103
|
-
) : o = S(a.modelValue, t)), o ? (l("error", f.uniqueness(t)), !1) : a.accept && !p.value.some((n) => {
|
104
|
-
let u = !1;
|
105
|
-
return n.includes("*") ? u = u || n.split("/")[0] === t.type.split("/")[0] : u = u || n === t.type, u;
|
106
|
-
}) ? (l("error", f.accept(t)), !1) : a.maxFiles && Array.isArray(a.modelValue) && a.modelValue.length + r + 1 > a.maxFiles ? (l(
|
107
|
-
"error",
|
108
|
-
f.maxFiles(t, a.modelValue.length + r + 1)
|
109
|
-
), !1) : !0;
|
110
|
-
}), N = (e) => {
|
111
|
-
const t = e.target;
|
112
|
-
if (t instanceof HTMLElement) {
|
113
|
-
const r = ae(
|
114
|
-
[t],
|
115
|
-
"parentElement",
|
116
|
-
(o) => o.classList.contains("bb-dropzone")
|
117
|
-
);
|
118
|
-
r && (r.id === v ? E() : _());
|
123
|
+
}, I = (e) => {
|
124
|
+
const a = e.target;
|
125
|
+
if (a && a instanceof HTMLElement) {
|
126
|
+
let o = !0;
|
127
|
+
m.value && m.value.$el.contains(a) && (o = !1), o && f();
|
119
128
|
}
|
120
|
-
},
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
filename: e.name
|
148
|
-
}),
|
149
|
-
accept: (e) => ({
|
150
|
-
type: "accept",
|
151
|
-
file: e,
|
152
|
-
acceptedMimeTypes: p.value,
|
153
|
-
mimeType: e.type,
|
154
|
-
filename: e.name
|
155
|
-
}),
|
156
|
-
maxFiles: (e, t) => ({
|
157
|
-
type: "maxFiles",
|
158
|
-
file: e,
|
159
|
-
maxFiles: a.maxFiles,
|
160
|
-
totalFiles: t,
|
161
|
-
filename: e.name
|
162
|
-
})
|
163
|
-
}, w = m(() => a.errors ? [].concat(a.errors) : []), R = m(
|
164
|
-
() => !!w.value.length || a.hasErrors
|
165
|
-
);
|
166
|
-
return (e, t) => (V(), G(K(e.tag), {
|
167
|
-
id: v,
|
168
|
-
class: O(k.value)
|
129
|
+
}, M = (e) => {
|
130
|
+
var a;
|
131
|
+
if (l.value && e.key === "Escape") {
|
132
|
+
if (((a = document.activeElement) == null ? void 0 : a.id) !== d) {
|
133
|
+
const o = document.querySelector(`#${d}`);
|
134
|
+
o instanceof HTMLElement && o.focus();
|
135
|
+
}
|
136
|
+
f();
|
137
|
+
}
|
138
|
+
}, z = F(!1), E = async () => {
|
139
|
+
z.value = !0, await ae(50), l.value = !0, document.addEventListener("click", H, { passive: !0 }), document.addEventListener("focusin", I, { passive: !0 }), document.addEventListener("keydown", M, { passive: !0 });
|
140
|
+
}, f = async () => {
|
141
|
+
l.value = !1, document.removeEventListener("click", H), document.removeEventListener("focusin", I), document.removeEventListener("keydown", M);
|
142
|
+
};
|
143
|
+
return (e, a) => (b(), h(se, {
|
144
|
+
ref_key: "wrapper",
|
145
|
+
ref: m,
|
146
|
+
"arrow-padding": e.arrowPadding,
|
147
|
+
block: e.block,
|
148
|
+
class: W(["bb-dropdown", {
|
149
|
+
[`bb-dropdown--${e.theme}`]: !0
|
150
|
+
}]),
|
151
|
+
"model-value": l.value,
|
152
|
+
offset: e.offset,
|
153
|
+
padding: e.padding,
|
154
|
+
placement: e.placement,
|
155
|
+
"transition-duration": e.transitionDuration
|
169
156
|
}, {
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
157
|
+
activator: L(() => [
|
158
|
+
v(e.$slots, "activator", x(ee({
|
159
|
+
props: {
|
160
|
+
"aria-expanded": p(g) ? l.value : !1,
|
161
|
+
"aria-controls": p(g) ? `menu_${p(d)}` : void 0,
|
162
|
+
id: p(d),
|
163
|
+
onClick: P,
|
164
|
+
onKeydown: j,
|
165
|
+
disabled: e.disabled
|
166
|
+
},
|
167
|
+
disabled: e.disabled,
|
168
|
+
open: l.value,
|
169
|
+
placement: e.placement
|
170
|
+
})))
|
171
|
+
]),
|
172
|
+
default: L(() => [
|
173
|
+
p(g) ? (b(), T("span", {
|
174
|
+
key: 0,
|
175
|
+
id: `menu_${p(d)}`,
|
176
|
+
ref_key: "content",
|
177
|
+
ref: i,
|
178
|
+
"aria-labelledby": p(d),
|
179
|
+
"aria-role": "menu",
|
180
|
+
class: "bb-dropdown__items-container",
|
181
|
+
inert: !l.value,
|
182
|
+
style: G({ width: `${e.width}px` })
|
176
183
|
}, [
|
177
|
-
|
178
|
-
accept: P.value,
|
179
|
-
autofocus: e.autofocus,
|
180
|
-
class: "sr-only",
|
184
|
+
v(e.$slots, "prepend", {
|
181
185
|
disabled: e.disabled,
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
},
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
186
|
+
open: l.value,
|
187
|
+
placement: e.placement
|
188
|
+
}),
|
189
|
+
(b(!0), T(A, null, J(c.value, ({ original: o, ...t }, n) => (b(), T(A, {
|
190
|
+
key: t.key
|
191
|
+
}, [
|
192
|
+
v(e.$slots, "item:prepend", {
|
193
|
+
disabled: t.disabled,
|
194
|
+
index: n,
|
195
|
+
item: e.items[n],
|
196
|
+
open: l.value,
|
197
|
+
placement: e.placement,
|
198
|
+
text: t.text
|
199
|
+
}),
|
200
|
+
Q(le, X({
|
201
|
+
"aria-role": "menuitem",
|
202
|
+
class: ["bb-dropdown__item", {
|
203
|
+
"bb-dropdown__item--first": n === 0,
|
204
|
+
"bb-dropdown__item--last": n === e.items.length - 1
|
205
|
+
}],
|
206
|
+
"data-dropdown-item": !0,
|
207
|
+
ref_for: !0
|
208
|
+
}, t), {
|
209
|
+
default: L(() => [
|
210
|
+
v(e.$slots, t.key, {
|
211
|
+
disabled: t.disabled,
|
212
|
+
index: n,
|
213
|
+
item: o,
|
214
|
+
open: l.value,
|
215
|
+
placement: e.placement,
|
216
|
+
text: t.text
|
217
|
+
}, () => [
|
218
|
+
t["prepend:icon"] ? (b(), h(B, {
|
219
|
+
key: 0,
|
220
|
+
class: "item__prepend-icon",
|
221
|
+
type: t["prepend:icon"]
|
222
|
+
}, null, 8, ["type"])) : D("", !0),
|
223
|
+
Y("span", re, Z(t.text), 1),
|
224
|
+
t["append:icon"] ? (b(), h(B, {
|
225
|
+
key: 1,
|
226
|
+
class: "item__append-icon",
|
227
|
+
type: t["append:icon"]
|
228
|
+
}, null, 8, ["type"])) : D("", !0)
|
229
|
+
])
|
230
|
+
]),
|
231
|
+
_: 2
|
232
|
+
}, 1040, ["class"]),
|
233
|
+
v(e.$slots, "item:append", {
|
234
|
+
disabled: t.disabled,
|
235
|
+
index: n,
|
236
|
+
item: e.items[n],
|
237
|
+
open: l.value,
|
238
|
+
placement: e.placement,
|
239
|
+
text: t.text
|
240
|
+
})
|
241
|
+
], 64))), 128)),
|
242
|
+
v(e.$slots, "append", {
|
197
243
|
disabled: e.disabled,
|
198
|
-
|
199
|
-
|
200
|
-
type: "file"
|
201
|
-
}, null, 8, ne)
|
202
|
-
]),
|
203
|
-
c("span", ie, [
|
204
|
-
W(oe, { tag: "span" }, {
|
205
|
-
default: M(() => [
|
206
|
-
(V(!0), F(X, null, ee(w.value, (r) => (V(), F("span", {
|
207
|
-
key: r,
|
208
|
-
class: "bb-dropzone__error"
|
209
|
-
}, te(r), 1))), 128))
|
210
|
-
]),
|
211
|
-
_: 1
|
244
|
+
open: l.value,
|
245
|
+
placement: e.placement
|
212
246
|
})
|
213
|
-
])
|
247
|
+
], 12, ie)) : D("", !0)
|
214
248
|
]),
|
215
249
|
_: 3
|
216
|
-
}, 8, ["class"]));
|
250
|
+
}, 8, ["arrow-padding", "block", "class", "model-value", "offset", "padding", "placement", "transition-duration"]));
|
217
251
|
}
|
218
252
|
});
|
219
253
|
export {
|
220
|
-
|
254
|
+
$e as default
|
221
255
|
};
|
package/dist/index81.js
CHANGED
@@ -1,46 +1,154 @@
|
|
1
|
-
import { defineComponent as
|
2
|
-
import
|
3
|
-
|
4
|
-
|
1
|
+
import { defineComponent as j, ref as N, computed as g, createElementBlock as $, openBlock as l, mergeProps as y, unref as d, createVNode as u, withCtx as n, createBlock as L, createCommentVNode as _, createElementVNode as b, toDisplayString as v, createSlots as V, renderSlot as r, normalizeProps as s, guardReactiveProps as p, renderList as E } from "vue";
|
2
|
+
import C from "./index13.js";
|
3
|
+
/* empty css */
|
4
|
+
import A from "./index79.js";
|
5
|
+
/* empty css */
|
6
|
+
/* empty css */
|
7
|
+
/* empty css */
|
8
|
+
import z from "./index85.js";
|
9
|
+
/* empty css */
|
10
|
+
import I from "./index113.js";
|
11
|
+
/* empty css */
|
12
|
+
import { useLocale as M } from "./index219.js";
|
13
|
+
const O = { class: "bb-dropdown-button__content" }, R = {
|
14
|
+
key: 1,
|
15
|
+
class: "bb-dropdown-button__loading-label sr-only"
|
16
|
+
}, T = { class: "bb-dropdown-button__dropdown-label sr-only" }, ee = /* @__PURE__ */ j({
|
17
|
+
__name: "BbDropdownButton",
|
5
18
|
props: {
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
19
|
+
arrowPadding: {},
|
20
|
+
block: { type: Boolean },
|
21
|
+
disabled: { type: Boolean },
|
22
|
+
eager: { type: Boolean },
|
23
|
+
id: {},
|
24
|
+
items: {},
|
25
|
+
offset: {},
|
26
|
+
padding: {},
|
27
|
+
placement: {},
|
28
|
+
theme: { default: "default" },
|
29
|
+
transitionDuration: {},
|
30
|
+
width: {},
|
31
|
+
autoLoading: { type: Boolean, default: !0 },
|
32
|
+
"append:icon": {},
|
33
|
+
disabledWhileLoading: { type: Boolean, default: !0 },
|
34
|
+
loading: { type: Boolean },
|
35
|
+
"prepend:icon": {},
|
36
|
+
size: {}
|
12
37
|
},
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
}
|
39
|
-
]
|
40
|
-
|
41
|
-
|
38
|
+
setup(P) {
|
39
|
+
const t = P, { t: m } = M(), c = N(0), f = g(
|
40
|
+
() => t.loading || !!c.value && t.autoLoading
|
41
|
+
), D = (e) => async (...a) => {
|
42
|
+
f.value && t.disabledWhileLoading || (c.value++, await e(...a), c.value--);
|
43
|
+
}, w = g(
|
44
|
+
() => t.items.map((e) => e.onClick ? {
|
45
|
+
...e,
|
46
|
+
key: e.key.split(/\W+/g).join("_").toLowerCase(),
|
47
|
+
onClick: D(e.onClick)
|
48
|
+
} : {
|
49
|
+
...e,
|
50
|
+
key: e.key.split(/\W+/g).join("_").toLowerCase()
|
51
|
+
})
|
52
|
+
), h = g(() => {
|
53
|
+
const e = { ...w.value[0] };
|
54
|
+
return e.disabled = e.disabled || t.disabled, e;
|
55
|
+
}), S = typeof t.size == "string" ? { default: t.size } : { default: "md", ...t.size }, W = Object.entries(S).reduce(
|
56
|
+
(e, [a, o]) => (a === "default" ? e[`data-${o}`] = "" : e[`data-${a}:${o}`] = "", e),
|
57
|
+
{}
|
58
|
+
);
|
59
|
+
return (e, a) => (l(), $("span", y({
|
60
|
+
class: ["bb-dropdown-button", {
|
61
|
+
"bb-dropdown-button--block": e.block,
|
62
|
+
"bb-dropdown-button--loading": f.value,
|
63
|
+
[`bb-dropdown-button--${e.theme}`]: !0
|
64
|
+
}]
|
65
|
+
}, d(W)), [
|
66
|
+
u(C, y(h.value, { class: "bb-dropdown-button__main-btn" }), {
|
67
|
+
default: n(() => [
|
68
|
+
u(d(I), { class: "bb-dropdown-button__spinner" }),
|
69
|
+
t["prepend:icon"] ? (l(), L(d(z), {
|
70
|
+
key: 0,
|
71
|
+
class: "bb-dropdown-button__prepend-icon",
|
72
|
+
type: t["prepend:icon"]
|
73
|
+
}, null, 8, ["type"])) : _("", !0),
|
74
|
+
b("span", O, v(h.value.text), 1),
|
75
|
+
f.value ? (l(), $("span", R, v(d(m)("common.loadingText").value), 1)) : _("", !0),
|
76
|
+
t["append:icon"] ? (l(), L(d(z), {
|
77
|
+
key: 2,
|
78
|
+
class: "bb-dropdown-button__append-icon",
|
79
|
+
type: t["append:icon"]
|
80
|
+
}, null, 8, ["type"])) : _("", !0)
|
81
|
+
]),
|
82
|
+
_: 1
|
83
|
+
}, 16),
|
84
|
+
u(A, {
|
85
|
+
id: e.id,
|
86
|
+
"arrow-padding": e.arrowPadding,
|
87
|
+
disabled: e.disabled,
|
88
|
+
eager: e.eager,
|
89
|
+
items: w.value,
|
90
|
+
offset: e.offset,
|
91
|
+
padding: e.padding,
|
92
|
+
placement: e.placement,
|
93
|
+
theme: e.theme,
|
94
|
+
"transition-duration": e.transitionDuration,
|
95
|
+
width: e.width
|
96
|
+
}, V({
|
97
|
+
activator: n(({ props: o, open: i, disabled: k, placement: B }) => [
|
98
|
+
r(e.$slots, "activator", {
|
99
|
+
disabled: k,
|
100
|
+
open: i,
|
101
|
+
placement: B,
|
102
|
+
props: o
|
103
|
+
}, () => [
|
104
|
+
u(C, y(o, { class: "bb-dropdown-button__dropdown-btn" }), {
|
105
|
+
default: n(() => [
|
106
|
+
b("span", T, v(i ? d(m)("dropdownButton.close").value : d(m)("dropdownButton.open").value), 1),
|
107
|
+
r(e.$slots, "right-btn", {
|
108
|
+
disabled: k,
|
109
|
+
open: i,
|
110
|
+
placement: B
|
111
|
+
}, () => [
|
112
|
+
a[0] || (a[0] = b("svg", {
|
113
|
+
class: "bb-dropdown-button__dropdown-chevron",
|
114
|
+
viewBox: "0 0 24 24",
|
115
|
+
xmlns: "http://www.w3.org/2000/svg"
|
116
|
+
}, [
|
117
|
+
b("path", {
|
118
|
+
d: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6l-6 6l1.41 1.41Z",
|
119
|
+
fill: "currentColor"
|
120
|
+
})
|
121
|
+
], -1))
|
122
|
+
])
|
123
|
+
]),
|
124
|
+
_: 2
|
125
|
+
}, 1040)
|
126
|
+
])
|
127
|
+
]),
|
128
|
+
prepend: n((o) => [
|
129
|
+
r(e.$slots, "prepend", s(p(o)))
|
130
|
+
]),
|
131
|
+
"item:prepend": n((o) => [
|
132
|
+
r(e.$slots, "item:prepend", s(p(o)))
|
133
|
+
]),
|
134
|
+
"item:append": n((o) => [
|
135
|
+
r(e.$slots, "item:append", s(p(o)))
|
136
|
+
]),
|
137
|
+
append: n((o) => [
|
138
|
+
r(e.$slots, "append", s(p(o)))
|
139
|
+
]),
|
140
|
+
_: 2
|
141
|
+
}, [
|
142
|
+
E(w.value, (o) => ({
|
143
|
+
name: o.key,
|
144
|
+
fn: n((i) => [
|
145
|
+
r(e.$slots, o.key, s(p(i)))
|
146
|
+
])
|
147
|
+
}))
|
148
|
+
]), 1032, ["id", "arrow-padding", "disabled", "eager", "items", "offset", "padding", "placement", "theme", "transition-duration", "width"])
|
149
|
+
], 16));
|
42
150
|
}
|
43
151
|
});
|
44
152
|
export {
|
45
|
-
|
153
|
+
ee as default
|
46
154
|
};
|