bitboss-ui 2.1.124 → 2.1.125
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/ai/BbButton.md +20 -11
- package/dist/index240.js +40 -36
- package/package.json +2 -2
package/dist/ai/BbButton.md
CHANGED
|
@@ -43,17 +43,17 @@
|
|
|
43
43
|
class="bb-button__append-icon"
|
|
44
44
|
:type="props['append:icon']"
|
|
45
45
|
/>
|
|
46
|
-
</BaseButton>
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
47
|
+
<BbTooltipAsync
|
|
48
|
+
v-if="tooltip != null || $slots.tooltip"
|
|
49
|
+
:activator="buttonDom"
|
|
50
|
+
:placement="tooltipPlacement"
|
|
51
|
+
:show-close="false"
|
|
52
|
+
:timeout="tooltipTimeout"
|
|
53
|
+
>
|
|
54
|
+
<slot name="tooltip" :text="tooltip">{{ tooltip }}</slot>
|
|
55
|
+
</BbTooltipAsync>
|
|
56
|
+
</BaseButton>
|
|
57
57
|
</template>
|
|
58
58
|
|
|
59
59
|
<script setup lang="ts">
|
|
@@ -63,6 +63,7 @@ import { computed, defineAsyncComponent, ref, toRef, useAttrs } from 'vue';
|
|
|
63
63
|
import { pickBy } from '@/utilities/functions/pickBy';
|
|
64
64
|
import { noop } from '@/utilities/functions/noop';
|
|
65
65
|
import { useLocale } from '@/composables/useLocale';
|
|
66
|
+
import { useLogger } from '@/composables/useLogger';
|
|
66
67
|
import { extractDomContainer } from '@/utilities/functions/extractDomContainer';
|
|
67
68
|
import { isEqual } from '@/utilities/functions/isEqual';
|
|
68
69
|
import type { BbButtonProps, BbButtonSlots } from './types';
|
|
@@ -70,7 +71,7 @@ import type { BbButtonProps, BbButtonSlots } from './types';
|
|
|
70
71
|
const BbTooltipAsync = defineAsyncComponent(
|
|
71
72
|
() => import('../BbTooltip/BbTooltip.vue')
|
|
72
73
|
);
|
|
73
|
-
|
|
74
|
+
let hasWarnedDeprecatedTooltipProp = false;
|
|
74
75
|
type Sizes = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
75
76
|
|
|
76
77
|
defineOptions({
|
|
@@ -91,6 +92,7 @@ const isPressed = computed(() => isEqual(modelValue.value, props.trueValue));
|
|
|
91
92
|
defineSlots<BbButtonSlots>();
|
|
92
93
|
|
|
93
94
|
const { t } = useLocale();
|
|
95
|
+
const logger = useLogger();
|
|
94
96
|
const attrs = useAttrs();
|
|
95
97
|
const buttonDom = ref<HTMLElement>();
|
|
96
98
|
|
|
@@ -98,6 +100,13 @@ const setButtonRef = (el: unknown) => {
|
|
|
98
100
|
buttonDom.value = extractDomContainer(el) ?? undefined;
|
|
99
101
|
};
|
|
100
102
|
|
|
103
|
+
if (import.meta.env.DEV && props.tooltip && !hasWarnedDeprecatedTooltipProp) {
|
|
104
|
+
logger.warn(
|
|
105
|
+
'BbButton: the `tooltip` prop is deprecated and will be removed in the next major version. Use `v-bb-tooltip` for more flexible handling and uniform behavior across components.'
|
|
106
|
+
);
|
|
107
|
+
hasWarnedDeprecatedTooltipProp = true;
|
|
108
|
+
}
|
|
109
|
+
|
|
101
110
|
const forwardedAttrs = computed(() => {
|
|
102
111
|
const { onClick: _, ...rest } = attrs;
|
|
103
112
|
return rest;
|
package/dist/index240.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import e from "./
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import a from "./
|
|
7
|
-
import
|
|
8
|
-
import s from "./
|
|
9
|
-
import
|
|
1
|
+
import { useLogger as e } from "./index31.js";
|
|
2
|
+
import t from "./index36.js";
|
|
3
|
+
import { useLocale as n } from "./index42.js";
|
|
4
|
+
import { extractDomContainer as r } from "./index45.js";
|
|
5
|
+
import { isEqual as i } from "./index82.js";
|
|
6
|
+
import { noop as a } from "./index142.js";
|
|
7
|
+
import o from "./index219.js";
|
|
8
|
+
import { pickBy as s } from "./index239.js";
|
|
9
|
+
import c from "./index254.js";
|
|
10
|
+
import { computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineAsyncComponent as g, defineComponent as _, mergeModels as v, mergeProps as y, normalizeClass as b, openBlock as x, ref as S, renderSlot as C, toDisplayString as w, toRef as T, unref as E, useAttrs as D, useModel as O, withCtx as k } from "vue";
|
|
10
11
|
//#region src/components/BbButton/BbButton.vue?vue&type=script&setup=true&lang.ts
|
|
11
12
|
var A = {
|
|
12
13
|
key: 2,
|
|
@@ -64,8 +65,10 @@ var A = {
|
|
|
64
65
|
}),
|
|
65
66
|
emits: ["update:modelValue"],
|
|
66
67
|
setup(_, { expose: v }) {
|
|
67
|
-
let j = g(() => import("./index345.js")), M = _, N = O(_, "modelValue"), P = l(() => N.value !== void 0), F = l(() =>
|
|
68
|
-
|
|
68
|
+
let j = g(() => import("./index345.js")), M = _, N = O(_, "modelValue"), P = l(() => N.value !== void 0), F = l(() => i(N.value, M.trueValue)), { t: I } = n();
|
|
69
|
+
e();
|
|
70
|
+
let L = D(), R = S(), z = (e) => {
|
|
71
|
+
R.value = r(e) ?? void 0;
|
|
69
72
|
}, B = l(() => {
|
|
70
73
|
let { onClick: e, ...t } = L;
|
|
71
74
|
return t;
|
|
@@ -73,16 +76,16 @@ var A = {
|
|
|
73
76
|
if (H.value && !M.enabledWhileLoading) return (M.type === "submit" || M.href || M.to) && e.preventDefault(), null;
|
|
74
77
|
if (P.value) {
|
|
75
78
|
let e = M.trueValue, t = M.falseValue;
|
|
76
|
-
N.value =
|
|
79
|
+
N.value = i(N.value, e) ? t : e;
|
|
77
80
|
}
|
|
78
|
-
V.value++, await (L.onClick ??
|
|
81
|
+
V.value++, await (L.onClick ?? a)(e), V.value--;
|
|
79
82
|
}, G = typeof M.size == "string" ? { default: M.size } : {
|
|
80
83
|
default: "md",
|
|
81
84
|
...M.size
|
|
82
85
|
}, K = Object.entries(G).reduce((e, [t, n]) => (t === "default" ? e[`data-${n}`] = "" : e[`data-${t}:${n}`] = "", e), {}), q = T(() => ({
|
|
83
86
|
...B.value,
|
|
84
87
|
...K,
|
|
85
|
-
...
|
|
88
|
+
...s(M, (e, t) => ![
|
|
86
89
|
"append:icon",
|
|
87
90
|
"autoLoading",
|
|
88
91
|
"disabled",
|
|
@@ -99,14 +102,14 @@ var A = {
|
|
|
99
102
|
"trueValue"
|
|
100
103
|
].includes(t))
|
|
101
104
|
}));
|
|
102
|
-
return v({ $el: R }), (
|
|
105
|
+
return v({ $el: R }), (e, n) => (x(), u(E(t), y({ ref: z }, q.value, {
|
|
103
106
|
"aria-disabled": H.value ? !0 : void 0,
|
|
104
107
|
"aria-pressed": P.value ? F.value : void 0,
|
|
105
108
|
class: {
|
|
106
109
|
"bb-button": !0,
|
|
107
110
|
"bb-button--loading": H.value,
|
|
108
111
|
"bb-button--group": M.group,
|
|
109
|
-
"bb-button--icon": !!
|
|
112
|
+
"bb-button--icon": !!e.icon,
|
|
110
113
|
"bb-button--active": P.value && F.value
|
|
111
114
|
},
|
|
112
115
|
disabled: U.value,
|
|
@@ -114,23 +117,37 @@ var A = {
|
|
|
114
117
|
onClick: W
|
|
115
118
|
}), {
|
|
116
119
|
default: k(() => [
|
|
117
|
-
h(E(
|
|
118
|
-
M.icon ? (x(), u(
|
|
120
|
+
h(E(c), { class: "bb-button__spinner" }),
|
|
121
|
+
M.icon ? (x(), u(o, {
|
|
119
122
|
key: 0,
|
|
120
123
|
class: "bb-button__icon",
|
|
121
124
|
type: M.icon
|
|
122
|
-
}, null, 8, ["type"])) : M["prepend:icon"] ? (x(), u(
|
|
125
|
+
}, null, 8, ["type"])) : M["prepend:icon"] ? (x(), u(o, {
|
|
123
126
|
key: 1,
|
|
124
127
|
class: "bb-button__prepend-icon",
|
|
125
128
|
type: M["prepend:icon"]
|
|
126
129
|
}, null, 8, ["type"])) : d("", !0),
|
|
127
|
-
p("span", { class: b(["bb-button__content", { "sr-only": !!
|
|
130
|
+
p("span", { class: b(["bb-button__content", { "sr-only": !!e.icon }]) }, [C(e.$slots, "default", {}, () => [m(w(e.text), 1)])], 2),
|
|
128
131
|
H.value ? (x(), f("span", A, w(E(I)("common.loadingText")), 1)) : d("", !0),
|
|
129
|
-
!
|
|
132
|
+
!e.icon && M["append:icon"] ? (x(), u(o, {
|
|
130
133
|
key: 3,
|
|
131
134
|
class: "bb-button__append-icon",
|
|
132
135
|
type: M["append:icon"]
|
|
133
|
-
}, null, 8, ["type"])) : d("", !0)
|
|
136
|
+
}, null, 8, ["type"])) : d("", !0),
|
|
137
|
+
e.tooltip != null || e.$slots.tooltip ? (x(), u(E(j), {
|
|
138
|
+
key: 4,
|
|
139
|
+
activator: R.value,
|
|
140
|
+
placement: e.tooltipPlacement,
|
|
141
|
+
"show-close": !1,
|
|
142
|
+
timeout: e.tooltipTimeout
|
|
143
|
+
}, {
|
|
144
|
+
default: k(() => [C(e.$slots, "tooltip", { text: e.tooltip }, () => [m(w(e.tooltip), 1)])]),
|
|
145
|
+
_: 3
|
|
146
|
+
}, 8, [
|
|
147
|
+
"activator",
|
|
148
|
+
"placement",
|
|
149
|
+
"timeout"
|
|
150
|
+
])) : d("", !0)
|
|
134
151
|
]),
|
|
135
152
|
_: 3
|
|
136
153
|
}, 16, [
|
|
@@ -139,20 +156,7 @@ var A = {
|
|
|
139
156
|
"class",
|
|
140
157
|
"disabled",
|
|
141
158
|
"tabindex"
|
|
142
|
-
])
|
|
143
|
-
key: 0,
|
|
144
|
-
activator: R.value,
|
|
145
|
-
placement: t.tooltipPlacement,
|
|
146
|
-
"show-close": !1,
|
|
147
|
-
timeout: t.tooltipTimeout
|
|
148
|
-
}, {
|
|
149
|
-
default: k(() => [C(t.$slots, "tooltip", { text: t.tooltip }, () => [m(w(t.tooltip), 1)])]),
|
|
150
|
-
_: 3
|
|
151
|
-
}, 8, [
|
|
152
|
-
"activator",
|
|
153
|
-
"placement",
|
|
154
|
-
"timeout"
|
|
155
|
-
])) : d("", !0)], 64));
|
|
159
|
+
]));
|
|
156
160
|
}
|
|
157
161
|
});
|
|
158
162
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bitboss-ui",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.125",
|
|
4
4
|
"description": "Vue 3 component library by BitBoss: forms, selects, layout, overlays, and more.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -113,4 +113,4 @@
|
|
|
113
113
|
"lint-staged": {
|
|
114
114
|
"*.{js,css,md,html,json,vue,ts}": "prettier --write"
|
|
115
115
|
}
|
|
116
|
-
}
|
|
116
|
+
}
|