bitboss-ui 3.0.0-beta.3 → 3.0.0-beta.4

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "library": "bitboss-ui",
4
- "version": "3.0.0-beta.3",
4
+ "version": "3.0.0-beta.4",
5
5
  "upgrade": "v2-to-v3",
6
6
  "guide": "ai/guides/migration/v2-to-v3.md",
7
7
  "summary": {
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "library": "bitboss-ui",
4
- "version": "3.0.0-beta.3",
5
- "generatedAt": "2026-08-25T11:27:40.602Z",
4
+ "version": "3.0.0-beta.4",
5
+ "generatedAt": "2026-08-25T12:52:57.898Z",
6
6
  "composables": [
7
7
  {
8
8
  "name": "useBbConfig",
@@ -141,9 +141,20 @@ const onClick = async (event: Event) => {
141
141
  const falseVal = props.falseValue;
142
142
  modelValue.value = isEqual(modelValue.value, trueVal) ? falseVal : trueVal;
143
143
  }
144
+ // Call the handler FIRST, then decide. Auto-loading is documented as
145
+ // tracking *async* click handlers, but the counter used to increment before
146
+ // the call, so a plain sync handler still passed through a loading state for
147
+ // one microtask. In isolation that never paints — the flip and Vue's
148
+ // re-render settle in the same drain. In a real app it does: a consumer's
149
+ // sync handler that opened a dialog flickered the spinner on every click,
150
+ // and `disable-auto-loading` was the only cure. A sync handler now never
151
+ // touches the counter at all, so there is no window to catch.
152
+ const result = ((attrs.onClick ?? noop) as (...args: any[]) => any)(event);
153
+ if (!result || typeof result.then !== 'function') return result;
154
+
144
155
  internalLoading.value++;
145
156
  try {
146
- await ((attrs.onClick ?? noop) as (...args: any[]) => any)(event);
157
+ return await result;
147
158
  } finally {
148
159
  // Always release the auto-loading counter, even if the handler rejects,
149
160
  // so a failing async onClick doesn't leave the button stuck loading.
@@ -108,9 +108,11 @@ var N = {
108
108
  let e = F.trueValue, t = F.falseValue;
109
109
  P.value = u(P.value, e) ? t : e;
110
110
  }
111
+ let t = (V.onClick ?? l)(e);
112
+ if (!t || typeof t.then != "function") return t;
111
113
  G.value++;
112
114
  try {
113
- await (V.onClick ?? l)(e);
115
+ return await t;
114
116
  } finally {
115
117
  G.value--;
116
118
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bitboss-ui",
3
- "version": "3.0.0-beta.3",
3
+ "version": "3.0.0-beta.4",
4
4
  "description": "Vue 3 component library by BitBoss: forms, selects, layout, overlays, and more.",
5
5
  "license": "MIT",
6
6
  "type": "module",