bitboss-ui 3.0.0-beta.75 → 3.0.0-beta.76
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/README.md +5 -5
- package/bin/cli.mjs +16 -10
- package/dist/ai/BbAlert.md +1 -1
- package/dist/ai/BbBreadcrumbs.md +1 -1
- package/dist/ai/BbButton.md +2 -2
- package/dist/ai/BbColorInput.md +1 -1
- package/dist/ai/BbColorPalette.md +1 -1
- package/dist/ai/BbConfirm.md +1 -1
- package/dist/ai/BbDatePicker.md +1 -1
- package/dist/ai/BbDatePickerInput.md +1 -1
- package/dist/ai/BbDialog.md +3 -2
- package/dist/ai/BbDropdown.md +23 -21
- package/dist/ai/BbDropdownButton.md +13 -11
- package/dist/ai/BbGallery.md +3 -2
- package/dist/ai/BbIcon.md +10 -10
- package/dist/ai/BbOffCanvas.md +3 -2
- package/dist/ai/BbPopover.md +1 -1
- package/dist/ai/BbSelect.md +153 -43
- package/dist/ai/BbSelectPopover.md +115 -9
- package/dist/ai/BbTable.md +1 -1
- package/dist/ai/BbTimePicker.md +1 -1
- package/dist/ai/BbTimePickerInput.md +1 -1
- package/dist/ai/GroupedListBox.md +2 -2
- package/dist/ai/ListBox.md +3 -2
- package/dist/ai/changelog.json +153 -7
- package/dist/ai/components.json +12 -12
- package/dist/ai/guides/agent-contract.md +1 -1
- package/dist/ai/guides/calendars-and-digits.md +1 -1
- package/dist/ai/guides/eslint-rules.md +1 -1
- package/dist/ai/guides/icons-policy.md +32 -11
- package/dist/ai/guides/installation-and-plugin-setup.md +24 -23
- package/dist/ai/guides/migration/adoption-checklist.md +1 -1
- package/dist/ai/guides/migration/components/bb-icon.md +4 -4
- package/dist/ai/guides/migration/v2-to-v3.md +48 -19
- package/dist/ai/guides/migration/v3-beta-css-classes.md +18 -3
- package/dist/ai/guides/passthrough.md +58 -58
- package/dist/ai/helpers/inertia/manifest.json +1 -1
- package/dist/ai/manifest/components/BbDialog.tree.json +1 -1
- package/dist/ai/manifest/components/BbDropdown.json +19 -17
- package/dist/ai/manifest/components/BbDropdown.tree.json +9 -9
- package/dist/ai/manifest/components/BbDropdownButton.json +12 -10
- package/dist/ai/manifest/components/BbDropdownButton.tree.json +2 -0
- package/dist/ai/manifest/components/BbGallery.tree.json +1 -1
- package/dist/ai/manifest/components/BbOffCanvas.tree.json +1 -1
- package/dist/ai/manifest/components/BbSelect.json +44 -40
- package/dist/ai/manifest/components/BbSelect.tree.json +2 -1
- package/dist/ai/manifest/components/BbSelectPopover.json +10 -6
- package/dist/ai/manifest/components/BbSelectPopover.tree.json +4 -1
- package/dist/ai/manifest/components/BbTable.tree.json +5 -1
- package/dist/ai/manifest/components/GroupedListBox.json +1 -1
- package/dist/ai/manifest/components/GroupedListBox.tree.json +1 -0
- package/dist/ai/manifest/components/ListBox.json +1 -1
- package/dist/ai/manifest/components/ListBox.tree.json +1 -1
- package/dist/ai/manifest/index.json +2 -2
- package/dist/ai/recipes/inertia/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/inertia/onboarding.md +1 -1
- package/dist/ai/recipes/nuxt/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/nuxt/onboarding.md +1 -1
- package/dist/ai/recipes/vue/inline-edit-workspace.md +1 -1
- package/dist/ai/recipes/vue/onboarding.md +2 -2
- package/dist/ai/source/BbAccordion.md +4 -5
- package/dist/ai/source/BbAvatar.md +9 -2
- package/dist/ai/source/BbBadge.md +6 -2
- package/dist/ai/source/BbBreadcrumbs.md +5 -2
- package/dist/ai/source/BbCalendar.md +8 -6
- package/dist/ai/source/BbCarousel.md +10 -6
- package/dist/ai/source/BbColorPalette.md +5 -2
- package/dist/ai/source/BbDatePickerInput.md +7 -2
- package/dist/ai/source/BbDropdown.md +91 -66
- package/dist/ai/source/BbDropdownButton.md +36 -19
- package/dist/ai/source/BbDropdownGroup.md +91 -66
- package/dist/ai/source/BbGallery.md +6 -5
- package/dist/ai/source/BbPagination.md +12 -28
- package/dist/ai/source/BbRating.md +4 -4
- package/dist/ai/source/BbSelect.md +130 -106
- package/dist/ai/source/BbSelectPopover.md +128 -21
- package/dist/ai/source/BbTable.md +42 -9
- package/dist/ai/source/BbTimePickerInput.md +6 -2
- package/dist/ai/source/ClearableButton.md +4 -2
- package/dist/ai/source/ErrorIcon.md +4 -3
- package/dist/ai/source/FlatListBox.md +7 -2
- package/dist/ai/source/GroupedListBox.md +22 -3
- package/dist/ai/source/ListBox.md +7 -1
- package/dist/ai/source/WarningIcon.md +4 -3
- package/dist/assets/svgs/close.svg_raw.js +1 -1
- package/dist/components/BbAccordion/BbAccordion.vue.d.ts +1 -1
- package/dist/components/BbAccordion/BbAccordion.vue_vue_type_script_setup_true_lang.js +35 -34
- package/dist/components/BbAvatar/BbAvatar.vue_vue_type_script_setup_true_lang.js +48 -47
- package/dist/components/BbBadge/BbBadge.vue_vue_type_script_setup_true_lang.js +60 -59
- package/dist/components/BbBreadcrumbs/BbBreadcrumbs.vue_vue_type_script_setup_true_lang.js +128 -127
- package/dist/components/BbCalendar/BbCalendar.vue.d.ts +1 -1
- package/dist/components/BbCalendar/BbCalendar.vue_vue_type_script_setup_true_lang.js +240 -239
- package/dist/components/BbCarousel/BbCarousel.vue_vue_type_script_setup_true_lang.js +500 -499
- package/dist/components/BbCheckboxGroup/BbCheckboxGroup.vue.d.ts +4 -4
- package/dist/components/BbColorPalette/BbColorPalette.vue_vue_type_script_setup_true_lang.js +175 -174
- package/dist/components/BbDatePicker/BbDatePicker.vue.d.ts +1 -1
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue.d.ts +2 -2
- package/dist/components/BbDatePickerInput/BbDatePickerInput.vue_vue_type_script_setup_true_lang.js +263 -262
- package/dist/components/BbDropdown/AdaptiveDropdown.vue_vue_type_script_setup_true_lang.js +81 -80
- package/dist/components/BbDropdown/BbDropdown.vue_vue_type_script_setup_true_lang.js +4 -0
- package/dist/components/BbDropdown/BbDropdownList.vue_vue_type_script_setup_true_lang.js +318 -312
- package/dist/components/BbDropdown/DropdownRow.vue_vue_type_script_setup_true_lang.js +47 -46
- package/dist/components/BbDropdown/ptKeys.generated.d.ts +36 -20
- package/dist/components/BbDropdown/types.d.ts +51 -53
- package/dist/components/BbDropdown/types.js +2 -0
- package/dist/components/BbDropdownButton/BbDropdownButton.vue.d.ts +1 -1
- package/dist/components/BbDropdownButton/BbDropdownButton.vue_vue_type_script_setup_true_lang.js +74 -59
- package/dist/components/BbDropdownButton/ptKeys.generated.d.ts +111 -63
- package/dist/components/BbDropdownButton/types.d.ts +12 -10
- package/dist/components/BbDropdownButton/types.js +2 -0
- package/dist/components/BbDropzone/BbDropzone.vue.d.ts +1 -1
- package/dist/components/BbGallery/BbGallery.vue_vue_type_script_setup_true_lang.js +204 -203
- package/dist/components/BbIcon/iconCache.js +1 -1
- package/dist/components/BbNumberInput/BbNumberInput.vue.d.ts +1 -1
- package/dist/components/BbPagination/BbPagination.vue.d.ts +2 -2
- package/dist/components/BbPagination/BbPagination.vue_vue_type_script_setup_true_lang.js +138 -136
- package/dist/components/BbProgress/BbProgress.vue.d.ts +1 -1
- package/dist/components/BbRadioGroup/BbRadioGroup.vue.d.ts +4 -4
- package/dist/components/BbRating/BbRating.vue.d.ts +1 -1
- package/dist/components/BbRating/BbRating.vue_vue_type_script_setup_true_lang.js +100 -99
- package/dist/components/BbSelect/BbSelect.vue.d.ts +30 -20
- package/dist/components/BbSelect/BbSelect.vue_vue_type_script_setup_true_lang.js +201 -184
- package/dist/components/BbSelect/ptKeys.generated.d.ts +128 -96
- package/dist/components/BbSelect/types.d.ts +101 -105
- package/dist/components/BbSelect/types.js +1 -27
- package/dist/components/BbSelectPopover/BbSelectPopover.vue.d.ts +6 -3
- package/dist/components/BbSelectPopover/BbSelectPopover.vue_vue_type_script_setup_true_lang.js +617 -585
- package/dist/components/BbSelectPopover/ptKeys.generated.d.ts +22 -10
- package/dist/components/BbSelectPopover/types.d.ts +22 -13
- package/dist/components/BbSelectPopover/types.js +3 -1
- package/dist/components/BbSwitchGroup/BbSwitchGroup.vue.d.ts +1 -1
- package/dist/components/BbTable/BbTable.vue.d.ts +1 -1
- package/dist/components/BbTable/BbTable.vue_vue_type_script_setup_true_lang.js +1092 -1090
- package/dist/components/BbTable/BbTableDataRow.js +97 -90
- package/dist/components/BbTabs/BbTabs.vue.d.ts +3 -3
- package/dist/components/BbTimePicker/BbTimePicker.vue.d.ts +2 -2
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue.d.ts +2 -2
- package/dist/components/BbTimePickerInput/BbTimePickerInput.vue_vue_type_script_setup_true_lang.js +225 -224
- package/dist/components/BbToast/BbToastMessage.vue_vue_type_script_setup_true_lang.js +76 -75
- package/dist/components/ClearableButton/ClearableButton.vue_vue_type_script_setup_true_lang.js +9 -8
- package/dist/components/CloseIcon/CloseButton.vue.js +1 -1
- package/dist/components/CloseIcon/CloseButton.vue_vue_type_script_setup_true_lang.js +9 -7
- package/dist/components/ErrorIcon/ErrorIcon.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/components/FlatListBox/FlatListBox.vue_vue_type_script_setup_true_lang.js +69 -68
- package/dist/components/GroupedListBox/GroupedListBox.vue_vue_type_script_setup_true_lang.js +166 -165
- package/dist/components/WarningIcon/WarningIcon.vue_vue_type_script_setup_true_lang.js +8 -6
- package/dist/composables/useInternalIcon.js +25 -0
- package/dist/icon-scan.d.ts +1 -1
- package/dist/llms-full.txt +477 -187
- package/dist/llms-medium.txt +25 -24
- package/dist/llms.txt +1 -1
- package/dist/nuxt.js +1 -1
- package/dist/styles.css +2 -2
- package/dist/types/Config.d.ts +8 -1
- package/dist/types/ConfigDefaults.d.ts +10 -2
- package/dist/types/internalIcons.d.ts +89 -0
- package/dist/types/internalIcons.js +158 -0
- package/dist/types/ptComponentMap.d.ts +4 -4
- package/dist/utils/configDefaults.js +75 -64
- package/dist/utils/iconsOption.js +48 -0
- package/dist/utils/versionCheck.js +1 -1
- package/dist/vite-plugin.d.ts +10 -16
- package/dist/vite.js +319 -306
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/scripts/lib/adoption-checklist.json +1 -1
- package/scripts/lib/update-install.mjs +48 -0
- package/scripts/lib/validate-bb-markup.mjs +73 -12
- package/dist/assets/svgs/caret_down.svg_raw.js +0 -3
|
@@ -6,12 +6,13 @@ import i from "../BbCollapsible/BbCollapsible.vue.js";
|
|
|
6
6
|
import { BB_ACCORDION_PT as a } from "./types.js";
|
|
7
7
|
import { usePassthrough as o } from "../../composables/usePassthrough.js";
|
|
8
8
|
import { transitions as s } from "../../utilities/misc/transitions.js";
|
|
9
|
-
import {
|
|
9
|
+
import { useInternalIcon as c } from "../../composables/useInternalIcon.js";
|
|
10
|
+
import { computed as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, h, mergeModels as g, mergeProps as _, openBlock as v, renderSlot as y, toDisplayString as b, unref as x, useAttrs as S, useModel as C, withCtx as w } from "vue";
|
|
10
11
|
// src/components/BbAccordion/BbAccordion.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
-
var
|
|
12
|
+
var T = /*@__PURE__*/ m({
|
|
12
13
|
inheritAttrs: !1,
|
|
13
14
|
__name: "BbAccordion",
|
|
14
|
-
props: /*@__PURE__*/
|
|
15
|
+
props: /*@__PURE__*/ g({
|
|
15
16
|
"pt:root": {},
|
|
16
17
|
"pt:root:disabled": {},
|
|
17
18
|
"pt:root:open": {},
|
|
@@ -47,39 +48,39 @@ var w = /*@__PURE__*/ p({
|
|
|
47
48
|
}),
|
|
48
49
|
emits: ["update:modelValue"],
|
|
49
50
|
setup(s) {
|
|
50
|
-
let
|
|
51
|
+
let m = C(s, "modelValue"), g = s, T = c("expandChevron", t), E = o({
|
|
51
52
|
component: "BbAccordion",
|
|
52
|
-
attrs:
|
|
53
|
-
props:
|
|
53
|
+
attrs: S(),
|
|
54
|
+
props: g,
|
|
54
55
|
parts: a.parts,
|
|
55
56
|
states: a.states,
|
|
56
57
|
active: {
|
|
57
|
-
open: () =>
|
|
58
|
-
disabled: () => !!
|
|
58
|
+
open: () => A.value,
|
|
59
|
+
disabled: () => !!g.disabled
|
|
59
60
|
}
|
|
60
|
-
}),
|
|
61
|
-
|
|
61
|
+
}), D = e().id.value, O = g.id || `bba_${D}`, k = (e, { slots: t }) => g.headingLevel ? h(`h${g.headingLevel}`, { class: "bb-accordion__heading" }, t.default?.()) : t.default?.(), A = l(() => g.value === void 0 ? !!m.value : m.value === g.value), j = () => {
|
|
62
|
+
g.disabled || (g.value === void 0 ? m.value = !m.value : m.value = A.value ? null : g.value);
|
|
62
63
|
};
|
|
63
|
-
return (e,
|
|
64
|
-
default:
|
|
65
|
-
id: `${
|
|
66
|
-
"aria-controls":
|
|
64
|
+
return (e, t) => (v(), u("div", _({ class: ["bb-accordion", { "bb-accordion--titled": !e.$slots.header }] }, x(E).rootAttrs), [p(k, null, {
|
|
65
|
+
default: w(() => [p(n, _({
|
|
66
|
+
id: `${x(O)}_header`,
|
|
67
|
+
"aria-controls": x(O),
|
|
67
68
|
"aria-disabled": s.disabled || void 0,
|
|
68
|
-
"aria-expanded":
|
|
69
|
+
"aria-expanded": A.value,
|
|
69
70
|
class: "bb-accordion__header",
|
|
70
|
-
onClick:
|
|
71
|
-
},
|
|
72
|
-
default:
|
|
73
|
-
toggle:
|
|
74
|
-
open:
|
|
75
|
-
}, () => [
|
|
76
|
-
open:
|
|
77
|
-
toggle:
|
|
78
|
-
}, () => [
|
|
71
|
+
onClick: j
|
|
72
|
+
}, x(E).header), {
|
|
73
|
+
default: w(() => [y(e.$slots, "header", {
|
|
74
|
+
toggle: j,
|
|
75
|
+
open: A.value
|
|
76
|
+
}, () => [d("span", _({ class: "bb-accordion__title" }, x(E).title), [y(e.$slots, "title", {
|
|
77
|
+
open: A.value,
|
|
78
|
+
toggle: j
|
|
79
|
+
}, () => [f(b(s.title), 1)])], 16), p(r, _({
|
|
79
80
|
class: "bb-accordion__icon",
|
|
80
|
-
icon:
|
|
81
|
+
icon: x(T),
|
|
81
82
|
size: "16"
|
|
82
|
-
},
|
|
83
|
+
}, x(E).icon), null, 16, ["icon"])])]),
|
|
83
84
|
_: 3
|
|
84
85
|
}, 16, [
|
|
85
86
|
"id",
|
|
@@ -88,18 +89,18 @@ var w = /*@__PURE__*/ p({
|
|
|
88
89
|
"aria-expanded"
|
|
89
90
|
])]),
|
|
90
91
|
_: 3
|
|
91
|
-
}),
|
|
92
|
-
id:
|
|
93
|
-
"aria-labelledby": `${
|
|
92
|
+
}), p(i, {
|
|
93
|
+
id: x(O),
|
|
94
|
+
"aria-labelledby": `${x(O)}_header`,
|
|
94
95
|
eager: s.eager,
|
|
95
|
-
"model-value":
|
|
96
|
+
"model-value": A.value,
|
|
96
97
|
role: "region",
|
|
97
98
|
tag: "div",
|
|
98
99
|
"transition-duration": s.transitionDuration
|
|
99
100
|
}, {
|
|
100
|
-
default:
|
|
101
|
-
open:
|
|
102
|
-
toggle:
|
|
101
|
+
default: w(() => [d("div", _({ class: "bb-accordion__panel" }, x(E).panel), [y(e.$slots, "default", {
|
|
102
|
+
open: A.value,
|
|
103
|
+
toggle: j
|
|
103
104
|
})], 16)]),
|
|
104
105
|
_: 3
|
|
105
106
|
}, 8, [
|
|
@@ -111,4 +112,4 @@ var w = /*@__PURE__*/ p({
|
|
|
111
112
|
])], 16));
|
|
112
113
|
}
|
|
113
114
|
});
|
|
114
|
-
export {
|
|
115
|
+
export { T as default };
|
|
@@ -12,15 +12,16 @@ import { usePassthrough as u } from "../../composables/usePassthrough.js";
|
|
|
12
12
|
import { useConfig as d } from "../../composables/useConfig.js";
|
|
13
13
|
import { LOCALE_TABLE as f, localeKeyOf as p } from "../../i18n/regions.js";
|
|
14
14
|
import { avatarHue as m, initialsOf as h } from "./avatarIdentity.js";
|
|
15
|
-
import {
|
|
15
|
+
import { useInternalIcon as g } from "../../composables/useInternalIcon.js";
|
|
16
|
+
import { computed as _, createBlock as v, createCommentVNode as y, createElementBlock as b, defineComponent as x, mergeProps as S, normalizeClass as C, onMounted as w, openBlock as T, ref as E, renderSlot as D, toDisplayString as O, unref as k, useAttrs as A, watch as j } from "vue";
|
|
16
17
|
// src/components/BbAvatar/BbAvatar.vue?vue&type=script&setup=true&lang.ts
|
|
17
|
-
var
|
|
18
|
+
var M = [
|
|
18
19
|
"alt",
|
|
19
20
|
"aria-hidden",
|
|
20
21
|
"sizes",
|
|
21
22
|
"src",
|
|
22
23
|
"srcset"
|
|
23
|
-
],
|
|
24
|
+
], N = /*@__PURE__*/ x({
|
|
24
25
|
inheritAttrs: !1,
|
|
25
26
|
__name: "BbAvatar",
|
|
26
27
|
props: {
|
|
@@ -40,70 +41,70 @@ var j = [
|
|
|
40
41
|
sizes: {},
|
|
41
42
|
timeout: { default: 400 }
|
|
42
43
|
},
|
|
43
|
-
setup(
|
|
44
|
-
let
|
|
44
|
+
setup(x) {
|
|
45
|
+
let N = x, P = g("avatar", c), F = u({
|
|
45
46
|
component: "BbAvatar",
|
|
46
|
-
attrs:
|
|
47
|
-
props:
|
|
47
|
+
attrs: A(),
|
|
48
|
+
props: N,
|
|
48
49
|
parts: l.parts,
|
|
49
50
|
states: l.states,
|
|
50
51
|
active: {}
|
|
51
|
-
}),
|
|
52
|
+
}), I = n("BbAvatar", r);
|
|
52
53
|
process.env.NODE_ENV !== "production" && o("BbAvatar", a("BbAvatar"));
|
|
53
|
-
let
|
|
54
|
-
if (
|
|
55
|
-
return e(
|
|
54
|
+
let L = i(), R = _(() => {
|
|
55
|
+
if (N.size != null) try {
|
|
56
|
+
return e(N.size, I.value);
|
|
56
57
|
} catch {
|
|
57
|
-
return
|
|
58
|
+
return L.warn(`Invalid size: "${N.size}" in BbAvatar. Falling back to "md".`), `${I.value.md}px`;
|
|
58
59
|
}
|
|
59
|
-
}),
|
|
60
|
-
if (typeof
|
|
61
|
-
let e =
|
|
60
|
+
}), z = d(), B = _(() => h(N.name, f[p(z.locale) ?? "en"].tag)), V = _(() => N.alt?.trim() || N.name?.trim() || ""), H = _(() => {
|
|
61
|
+
if (typeof N.color == "string" && N.color) return "bb-avatar--custom";
|
|
62
|
+
let e = N.color === !0 ? m(N.name) : void 0;
|
|
62
63
|
return e ? ["bb-avatar--colored", `bb-avatar--${e}`] : void 0;
|
|
63
|
-
}),
|
|
64
|
+
}), U = _(() => {
|
|
64
65
|
let e = {};
|
|
65
|
-
return
|
|
66
|
-
}),
|
|
66
|
+
return R.value && (e["--size"] = R.value), typeof N.color == "string" && N.color && (e["--bg"] = N.color), e;
|
|
67
|
+
}), W = _(() => !!(N.src || N.srcset) && !Z.value), G = _(() => W.value && Q.value && !X.value), K = _(() => !W.value || G.value), q = _(() => !K.value || !V.value ? {} : {
|
|
67
68
|
role: "img",
|
|
68
|
-
"aria-label":
|
|
69
|
-
}),
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
"aria-label": V.value
|
|
70
|
+
}), J = (e) => !(!e || !e.complete || e.naturalWidth === 0), Y = E(null), X = E(!1), Z = E(!1), Q = E(!1);
|
|
71
|
+
w(async () => {
|
|
72
|
+
W.value && !Z.value && !X.value && Y.value && (await t(N.timeout), Q.value = !J(Y.value));
|
|
72
73
|
});
|
|
73
|
-
let
|
|
74
|
-
|
|
75
|
-
},
|
|
76
|
-
|
|
74
|
+
let $ = () => {
|
|
75
|
+
X.value = !0, Z.value = !1, Q.value = !1;
|
|
76
|
+
}, ee = () => {
|
|
77
|
+
Z.value = !0;
|
|
77
78
|
};
|
|
78
|
-
return
|
|
79
|
-
|
|
80
|
-
}), (e, t) => (
|
|
81
|
-
class: ["bb-avatar",
|
|
82
|
-
style:
|
|
83
|
-
},
|
|
79
|
+
return j(() => [N.src, N.srcset], () => {
|
|
80
|
+
X.value = !1, Z.value = !1, Q.value = !1;
|
|
81
|
+
}), (e, t) => (T(), b("span", S({
|
|
82
|
+
class: ["bb-avatar", H.value],
|
|
83
|
+
style: U.value
|
|
84
|
+
}, k(F).rootAttrs), [W.value ? (T(), b("img", {
|
|
84
85
|
key: 0,
|
|
85
86
|
ref_key: "image",
|
|
86
|
-
ref:
|
|
87
|
-
alt:
|
|
88
|
-
"aria-hidden":
|
|
89
|
-
class:
|
|
90
|
-
sizes:
|
|
91
|
-
src:
|
|
92
|
-
srcset:
|
|
93
|
-
onError:
|
|
94
|
-
onLoad:
|
|
95
|
-
}, null, 42,
|
|
87
|
+
ref: Y,
|
|
88
|
+
alt: V.value,
|
|
89
|
+
"aria-hidden": G.value || void 0,
|
|
90
|
+
class: C(["bb-avatar__img", { "bb-avatar__img--hidden": G.value }]),
|
|
91
|
+
sizes: x.sizes,
|
|
92
|
+
src: x.src,
|
|
93
|
+
srcset: x.srcset,
|
|
94
|
+
onError: ee,
|
|
95
|
+
onLoad: $
|
|
96
|
+
}, null, 42, M)) : y("", !0), K.value ? (T(), b("span", S({
|
|
96
97
|
key: 1,
|
|
97
98
|
class: "bb-avatar__fallback"
|
|
98
|
-
},
|
|
99
|
+
}, q.value), [D(e.$slots, "default", {}, () => [B.value ? (T(), b("span", S({
|
|
99
100
|
key: 0,
|
|
100
101
|
"aria-hidden": "true",
|
|
101
102
|
class: "bb-avatar__initials"
|
|
102
|
-
},
|
|
103
|
+
}, k(F).initials), O(B.value), 17)) : (T(), v(s, S({
|
|
103
104
|
key: 1,
|
|
104
105
|
class: "bb-avatar__default-icon",
|
|
105
|
-
icon:
|
|
106
|
-
},
|
|
106
|
+
icon: k(P)
|
|
107
|
+
}, k(F).icon), null, 16, ["icon"]))])], 16)) : y("", !0)], 16));
|
|
107
108
|
}
|
|
108
109
|
});
|
|
109
|
-
export {
|
|
110
|
+
export { N as default };
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { useConfigDefaults as e } from "../../composables/useConfigDefaults.js";
|
|
2
2
|
import { useId as t } from "../../composables/useId.js";
|
|
3
3
|
import { useLocale as n } from "../../composables/useLocale.js";
|
|
4
|
-
import { useLogger as
|
|
5
|
-
import { removedPropsFor as
|
|
6
|
-
import { warnRemovedAttrs as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { SlotNodes as
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { provideBadgeHost as
|
|
13
|
-
import
|
|
14
|
-
import { BB_BADGE_PT as
|
|
15
|
-
import { usePassthrough as
|
|
16
|
-
import {
|
|
4
|
+
import { useLogger as r } from "../../composables/useLogger.js";
|
|
5
|
+
import { removedPropsFor as ee } from "../../deprecation/removedProps.js";
|
|
6
|
+
import { warnRemovedAttrs as te } from "../../utilities/functions/warnRemovedAttrs.js";
|
|
7
|
+
import i from "../BbIcon/BbIcon.vue.js";
|
|
8
|
+
import a from "../BbSpinner/BbSpinner.vue.js";
|
|
9
|
+
import { SlotNodes as o, slotContent as s } from "../../utilities/functions/slotContent.js";
|
|
10
|
+
import c from "./BadgeBodyContent.vue.js";
|
|
11
|
+
import l from "./BbBadgeButton.vue.js";
|
|
12
|
+
import { provideBadgeHost as u } from "./badgeButtonContext.js";
|
|
13
|
+
import ne from "../../assets/svgs/clear.svg_raw.js";
|
|
14
|
+
import { BB_BADGE_PT as d } from "./types.js";
|
|
15
|
+
import { usePassthrough as re, variantPt as f } from "../../composables/usePassthrough.js";
|
|
16
|
+
import { useInternalIcon as p } from "../../composables/useInternalIcon.js";
|
|
17
|
+
import { Fragment as m, computed as h, createBlock as g, createCommentVNode as _, createElementBlock as v, createElementVNode as y, createTextVNode as ie, createVNode as b, defineComponent as x, isVNode as ae, mergeProps as S, openBlock as C, renderSlot as w, shallowRef as oe, toDisplayString as T, unref as E, useAttrs as D, useSlots as O, withCtx as k, withModifiers as A } from "vue";
|
|
17
18
|
// src/components/BbBadge/BbBadge.vue?vue&type=script&setup=true&lang.ts
|
|
18
19
|
var j = ["id"], M = {
|
|
19
20
|
key: 2,
|
|
@@ -25,8 +26,8 @@ var j = ["id"], M = {
|
|
|
25
26
|
], P = {
|
|
26
27
|
key: 3,
|
|
27
28
|
class: "bb-sr-only"
|
|
28
|
-
}, F = /*@__PURE__*/
|
|
29
|
-
mixins: [d
|
|
29
|
+
}, F = /*@__PURE__*/ x({
|
|
30
|
+
mixins: [f(d)],
|
|
30
31
|
inheritAttrs: !1,
|
|
31
32
|
__name: "BbBadge",
|
|
32
33
|
props: {
|
|
@@ -81,64 +82,64 @@ var j = ["id"], M = {
|
|
|
81
82
|
variant: { default: void 0 }
|
|
82
83
|
},
|
|
83
84
|
emits: ["click:clear"],
|
|
84
|
-
setup(
|
|
85
|
-
let F =
|
|
85
|
+
setup(f, { emit: x }) {
|
|
86
|
+
let F = f, I = x, L = O(), R = p("clear", ne), z = e("BbBadge", F, {
|
|
86
87
|
size: "md",
|
|
87
88
|
variant: "primary"
|
|
88
|
-
}),
|
|
89
|
+
}), B = oe(null), V = re({
|
|
89
90
|
component: "BbBadge",
|
|
90
91
|
attrs: D(),
|
|
91
92
|
props: F,
|
|
92
|
-
parts:
|
|
93
|
-
states:
|
|
93
|
+
parts: d.parts,
|
|
94
|
+
states: d.states,
|
|
94
95
|
active: {
|
|
95
96
|
loading: () => !!F.loading,
|
|
96
|
-
activeLink: () => !!
|
|
97
|
-
exactActiveLink: () => !!
|
|
97
|
+
activeLink: () => !!B.value?.value.activeLink,
|
|
98
|
+
exactActiveLink: () => !!B.value?.value.exactActiveLink
|
|
98
99
|
},
|
|
99
100
|
variant: {
|
|
100
|
-
...
|
|
101
|
-
current: () =>
|
|
101
|
+
...d.variant,
|
|
102
|
+
current: () => z.variant
|
|
102
103
|
}
|
|
103
104
|
});
|
|
104
|
-
process.env.NODE_ENV !== "production" &&
|
|
105
|
-
let
|
|
105
|
+
process.env.NODE_ENV !== "production" && te("BbBadge", ee("BbBadge"));
|
|
106
|
+
let H = [
|
|
106
107
|
"xs",
|
|
107
108
|
"sm",
|
|
108
109
|
"md",
|
|
109
110
|
"lg",
|
|
110
111
|
"xl",
|
|
111
112
|
"2xl"
|
|
112
|
-
], { t:
|
|
113
|
-
let e =
|
|
113
|
+
], { t: U } = n(), W = r(), G = h(() => {
|
|
114
|
+
let e = z.size, t = typeof e == "object" && e ? {
|
|
114
115
|
default: "md",
|
|
115
116
|
...e
|
|
116
117
|
} : { default: e };
|
|
117
118
|
return Object.entries(t).map(([e, t]) => {
|
|
118
119
|
let n = t ?? "md";
|
|
119
|
-
return
|
|
120
|
+
return H.includes(n) || (W.warn(`Invalid size: "${n}" in BbBadge. Expected one of: ${H.join(", ")}. Falling back to "md".`), n = "md"), e === "default" ? `bb-badge--${n}` : `bb-badge--${e}-${n}`;
|
|
120
121
|
});
|
|
121
|
-
}),
|
|
122
|
+
}), K = () => F.iconOnly === !0, q = [
|
|
122
123
|
"default",
|
|
123
124
|
"sm",
|
|
124
125
|
"md",
|
|
125
126
|
"lg",
|
|
126
127
|
"xl",
|
|
127
128
|
"2xl"
|
|
128
|
-
],
|
|
129
|
+
], se = () => {
|
|
129
130
|
let e = F.iconOnly;
|
|
130
131
|
if (!e || e === !0) return [];
|
|
131
132
|
let t = !!e.default;
|
|
132
|
-
return
|
|
133
|
-
}, J = (e) =>
|
|
134
|
-
activeLink: !!
|
|
135
|
-
exactActiveLink: !!
|
|
133
|
+
return q.flatMap((n) => (n !== "default" && e[n] !== void 0 && (t = !!e[n]), t ? [`bb-badge--icon-${n}`] : []));
|
|
134
|
+
}, J = (e) => s(L[`${e}:icon`], Y()), ce = () => !!F["prepend:icon"] || !!J("prepend"), le = () => !!F["append:icon"] || !!J("append"), Y = () => ({
|
|
135
|
+
activeLink: !!B.value?.value.activeLink,
|
|
136
|
+
exactActiveLink: !!B.value?.value.exactActiveLink,
|
|
136
137
|
loading: !!F.loading
|
|
137
|
-
}), X = () =>
|
|
138
|
-
|
|
139
|
-
passthrough:
|
|
138
|
+
}), X = () => le() && !ce(), Z = (e) => Array.isArray(e) && e.some((e) => ae(e) && (e.type === l || e.type === m && Z(e.children))), Q = () => Z(L.default?.({}));
|
|
139
|
+
u({
|
|
140
|
+
passthrough: V,
|
|
140
141
|
iconOnly: { get value() {
|
|
141
|
-
return
|
|
142
|
+
return K();
|
|
142
143
|
} },
|
|
143
144
|
iconNodes: J,
|
|
144
145
|
iconScope: { get value() {
|
|
@@ -163,50 +164,50 @@ var j = ["id"], M = {
|
|
|
163
164
|
return !!F.clearable;
|
|
164
165
|
} },
|
|
165
166
|
reportLink: (e) => {
|
|
166
|
-
|
|
167
|
+
B.value = e;
|
|
167
168
|
}
|
|
168
169
|
});
|
|
169
|
-
let
|
|
170
|
+
let ue = h(() => [
|
|
170
171
|
"bb-badge",
|
|
171
|
-
...
|
|
172
|
-
...
|
|
173
|
-
|
|
172
|
+
...G.value,
|
|
173
|
+
...se(),
|
|
174
|
+
z.variant && z.variant !== "none" && `bb-badge--${z.variant}`,
|
|
174
175
|
{
|
|
175
|
-
"bb-badge--icon":
|
|
176
|
+
"bb-badge--icon": K(),
|
|
176
177
|
"bb-badge--clearable": F.clearable,
|
|
177
178
|
"bb-badge--loading": F.loading
|
|
178
179
|
}
|
|
179
|
-
]), $ = t().id,
|
|
180
|
+
]), $ = t().id, de = h(() => F.clearableLabel || Q() ? void 0 : `${$.value}__clear ${$.value}__body`), fe = (e) => {
|
|
180
181
|
I("click:clear", e);
|
|
181
182
|
};
|
|
182
|
-
return (e, t) => (C(),
|
|
183
|
-
Q() ? w(e.$slots, "default", {}, void 0, void 0, 0) : (C(),
|
|
183
|
+
return (e, t) => (C(), v("span", S({ class: ue.value }, E(V).rootAttrs), [
|
|
184
|
+
Q() ? w(e.$slots, "default", {}, void 0, void 0, 0) : (C(), v("span", {
|
|
184
185
|
key: 1,
|
|
185
186
|
id: `${E($)}__body`,
|
|
186
187
|
class: "bb-badge__body"
|
|
187
|
-
}, [
|
|
188
|
-
default: k(() => [w(e.$slots, "default", {}, () => [
|
|
188
|
+
}, [b(c, null, {
|
|
189
|
+
default: k(() => [w(e.$slots, "default", {}, () => [ie(T(F.text), 1)])]),
|
|
189
190
|
_: 3
|
|
190
191
|
})], 8, j)),
|
|
191
|
-
F.clearable ? (C(),
|
|
192
|
+
F.clearable ? (C(), v("span", M, [K() ? _("", !0) : (C(), v(m, { key: 0 }, [F.loading && X() ? (C(), g(a, S({
|
|
192
193
|
key: 0,
|
|
193
194
|
class: "bb-badge__spinner bb-badge__append-icon"
|
|
194
|
-
}, E(
|
|
195
|
+
}, E(V).spinner), null, 16)) : J("append") ? (C(), v("span", S({
|
|
195
196
|
key: 1,
|
|
196
197
|
class: "bb-badge__append-icon bb-badge__icon-slot"
|
|
197
|
-
}, E(
|
|
198
|
+
}, E(V).icon), [b(E(o), { nodes: J("append") }, null, 8, ["nodes"])], 16)) : F["append:icon"] ? (C(), g(i, S({
|
|
198
199
|
key: 2,
|
|
199
200
|
class: "bb-badge__append-icon",
|
|
200
201
|
icon: F["append:icon"]
|
|
201
|
-
}, E(
|
|
202
|
+
}, E(V).icon), null, 16, ["icon"])) : _("", !0)], 64)), y("button", S({
|
|
202
203
|
id: `${E($)}__clear`,
|
|
203
|
-
"aria-label": F.clearableLabel || E(
|
|
204
|
-
"aria-labelledby":
|
|
204
|
+
"aria-label": F.clearableLabel || E(U)("badge.clearLabel").value,
|
|
205
|
+
"aria-labelledby": de.value,
|
|
205
206
|
class: "bb-badge__clear",
|
|
206
207
|
type: "button",
|
|
207
|
-
onClick: A(
|
|
208
|
-
}, E(
|
|
209
|
-
F.loading ? (C(),
|
|
208
|
+
onClick: A(fe, ["stop"])
|
|
209
|
+
}, E(V).clear), [b(i, { icon: E(R) }, null, 8, ["icon"])], 16, N)])) : _("", !0),
|
|
210
|
+
F.loading ? (C(), v("span", P, T(E(U)("common.loadingText")), 1)) : _("", !0)
|
|
210
211
|
], 16));
|
|
211
212
|
}
|
|
212
213
|
});
|