bitboss-ui 3.0.0-beta.49 → 3.0.0-beta.50

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.
@@ -2,5 +2,7 @@ import { InjectionKey } from 'vue';
2
2
  export type FormSubmitLock = {
3
3
  /** A submit promise is pending and the form locks while it runs. */
4
4
  locked: () => boolean;
5
+ /** A submit promise is pending (with or without the lock): submit buttons spin. */
6
+ saving: () => boolean;
5
7
  };
6
8
  export declare const BB_FORM_SUBMIT_LOCK: InjectionKey<FormSubmitLock>;
@@ -20757,7 +20757,8 @@ the save (nothing spins forever), and the error goes to
20757
20757
  save, for anything else you show meanwhile.
20758
20758
 
20759
20759
  To keep the fields editable during the save, set `disable-submit-lock` on the
20760
- form.
20760
+ form. The submit button still spins while the save is pending: the prop only
20761
+ lifts the read-only lock.
20761
20762
 
20762
20763
  ### Saving in place: `snapshot()`
20763
20764
 
@@ -21316,7 +21317,7 @@ marker stays consistent with the rules.
21316
21317
 
21317
21318
  | Prop | Type | Default | Required | Description |
21318
21319
  | --- | --- | --- | --- | --- |
21319
- | `disableSubmitLock` | `boolean \| undefined` | `false` | | Keep the fields editable while a save runs. By default, while a `@submit` that returned a promise is pending, every field joined to the form is read-only (never disabled: values stay readable and focusable) and every `type="submit"` BbButton inside the form shows its spinner; both end when the promise settles. A `@submit` that returns nothing never locks. |
21320
+ | `disableSubmitLock` | `boolean \| undefined` | `false` | | Keep the fields editable while a save runs. By default, while a `@submit` that returned a promise is pending, every field joined to the form is read-only (never disabled: values stay readable and focusable); it ends when the promise settles. A `@submit` that returns nothing never locks. The `type="submit"` BbButtons inside the form show their spinner while the save is pending either way: this prop does not stop that. |
21320
21321
  | `fieldErrors` | `Record<string, unknown> \| null \| undefined` | | | A server's validation errors, shown on the fields they name, for as long as they are in the object: `form.errors` from Inertia's `useForm()`, `$page.props.errors`, a Laravel 422 body you kept in a `ref`. Keys are field paths (`email`, `address.city`, `address[city]`, `lines.0.qty`); a value is a message or a list of them; a nested object reads as dot paths. `null`, `undefined` and anything that is not a message show nothing. A key no field on the form has is in `unmatchedErrors`. The page owns them: editing the field does not hide its message, the next object you pass does. They never block a submit, and a field's own rule errors show first. When new messages arrive after a submit, the first field that has one takes focus. For a one-off message the form drops once the user edits the field, call `setErrors` instead. |
21321
21322
  | `id` | `string \| undefined` | | | Explicit id, so anything outside the form can read and drive it through `useBbFormContext(id)` — a dialog footer's submit button, a page toolbar, a leave guard. It is also the `<form>`'s own id, so a native `<button form="id" type="submit">` outside it submits it. Omit it when the form is self-contained: the slot scope already carries the same state for chrome that lives inside. |
21322
21323
  | `keepValuesOnUnmount` | `boolean \| Ref<boolean, boolean> \| undefined` | | | Keep a field's value (and its place in `@submit`) when it unmounts — the `v-if` wizard step you left, a collapsed section. Off, an unmounted field drops out of the values. |
@@ -23157,7 +23158,8 @@ symbol alone does nothing. Clearing the last digit leaves the field empty (no
23157
23158
  lone `$`), so the placeholder and `required` keep working. A pasted amount,
23158
23159
  symbol and all (`$1,234.56`, `1.234,56 €`, `1,234 kg`), is read as the number;
23159
23160
  another currency's symbol is dropped and the amount kept, with no conversion.
23160
- The unit follows the number's plural (`1 hr`, `2 hrs`), and at rest a screen
23161
+ The unit follows the number's plural (`1 day`, `2 days`; Greek `1 κιλό`,
23162
+ `2 κιλά`), and at rest a screen
23161
23163
  reader hears the amount spelled out (`1,234.50 US dollars`, `20 kilograms`).
23162
23164
  Percent is written the locale's way: `15%` in English and Italian, `15 %` in
23163
23165
  German and French, `%15` in Turkish. `unit` is typed: `kilowatt` and
@@ -23514,12 +23516,13 @@ Parts: `root` (the container), `label`, `description`, `message` (the errors / w
23514
23516
  States: `errors`, `warnings` (never beside errors), `loading`, `disabled`, `readonly`, `hasValue` (written `pt:box:has-value`). A name outside that list is a type error and an
23515
23517
  ESLint error.
23516
23518
 
23517
- The currency line item above, restyled through those parts: muted affixes on
23518
- `pt:prefix` / `pt:suffix`, tabular figures on `pt:input`, a primary edge on
23519
+ The currency line item above, restyled through those parts: the `$` comes
23520
+ from `currency` (it is text, so `pt:input` styles it), a muted note on
23521
+ `pt:suffix`, tabular figures on `pt:input`, a primary edge on
23519
23522
  `pt:box:has-value` (`0` still counts). The stepper buttons in the slot ring
23520
23523
  are yours, not a part.
23521
23524
 
23522
- **pt:prefix / pt:suffix / pt:input — the invoice unit price**
23525
+ **pt:suffix / pt:input — the invoice unit price**
23523
23526
 
23524
23527
  ```vue
23525
23528
  <template>
@@ -23529,24 +23532,22 @@ are yours, not a part.
23529
23532
  <div>
23530
23533
  <p class="text-sm font-medium">Line item · INV-2048</p>
23531
23534
  <p class="text-xs text-(--bb-text-muted)">
23532
- Currency stays in the chrome; the model is a clean number.
23535
+ The dollar sign sits in the text; the model is a clean number.
23533
23536
  </p>
23534
23537
  </div>
23535
23538
  <BbNumberInput
23536
23539
  v-model="price"
23537
23540
  compact
23541
+ currency="USD"
23538
23542
  label="Unit price"
23539
- :max-precision="2"
23540
23543
  :min="0"
23541
23544
  name="unit-price"
23542
23545
  pt:box:has-value="border-(--bb-primary)"
23543
23546
  pt:input="tabular-nums"
23544
- pt:prefix="text-(--bb-text-muted)"
23545
23547
  pt:suffix="text-(--bb-text-muted)"
23546
23548
  :step="0.5"
23547
23549
  >
23548
- <template #prefix>$</template>
23549
- <template #suffix>USD</template>
23550
+ <template #suffix>per unit</template>
23550
23551
  </BbNumberInput>
23551
23552
  </div>
23552
23553
  </template>
@@ -23556,8 +23557,9 @@ import { ref } from 'vue';
23556
23557
  import { BbNumberInput } from 'bitboss-ui';
23557
23558
 
23558
23559
  // Same currency line item as `PriceCurrencyAffixes.vue`, restyled through
23559
- // passthrough: muted affixes on `pt:prefix` / `pt:suffix`, tabular figures
23560
- // on `pt:input`, a primary edge on `pt:box:has-value` (`0` counts).
23560
+ // passthrough: the `$` comes from `currency` (inside the text, never in
23561
+ // `#prefix`), a muted note on `pt:suffix`, tabular figures on `pt:input`, a
23562
+ // primary edge on `pt:box:has-value` (`0` counts).
23561
23563
  const price = ref<number | null>(49.99);
23562
23564
  </script>
23563
23565
  ```
@@ -60330,7 +60332,8 @@ Global locale for the library's built-in strings (empty states, close/clear
60330
60332
  labels, screen-reader announcements, confirm buttons, …) and for the formats
60331
60333
  around them (dates, numbers, week start). The list is fixed and typed (see
60332
60334
  [Locales](#locales) below): a language (`it`, `de`, …), a region (`en-GB`,
60333
- `de-CH`, `fr-CA`, …), or `pt-BR` / `pt-PT` / `zh-CN` / `zh-TW`. Shipping ≠
60335
+ `de-CH`, `fr-CA`, …), or a language with its own dictionaries per
60336
+ region: `es-MX`, `pt-BR` / `pt-PT`, `zh-CN` / `zh-TW` / `zh-HK`. Shipping ≠
60334
60337
  bundling: only the **enabled** locales enter your build (next option). Runtime
60335
60338
  switching: `useBbConfig().setConfig({ locale })` — to a locale you enabled.
60336
60339
 
@@ -66351,7 +66354,7 @@ Nothing here fails to compile — these change what existing code does.
66351
66354
  A `:loading="isSubmitting"` on the submit button is now redundant (drop
66352
66355
  it); a submit button outside the form still binds `loading` itself. A
66353
66356
  page that wants the fields editable during the save sets
66354
- `disable-submit-lock` on the form.
66357
+ `disable-submit-lock` on the form (the submit button still spins).
66355
66358
 
66356
66359
  54. **A set of `group` toggle buttons is one Tab stop** (since
66357
66360
  3.0.0-beta.49). Adjacent `group` `BbButton`s that each bind a `v-model`
@@ -1551,7 +1551,8 @@ Global locale for the library's built-in strings (empty states, close/clear
1551
1551
  labels, screen-reader announcements, confirm buttons, …) and for the formats
1552
1552
  around them (dates, numbers, week start). The list is fixed and typed (see
1553
1553
  [Locales](#locales) below): a language (`it`, `de`, …), a region (`en-GB`,
1554
- `de-CH`, `fr-CA`, …), or `pt-BR` / `pt-PT` / `zh-CN` / `zh-TW`. Shipping ≠
1554
+ `de-CH`, `fr-CA`, …), or a language with its own dictionaries per
1555
+ region: `es-MX`, `pt-BR` / `pt-PT`, `zh-CN` / `zh-TW` / `zh-HK`. Shipping ≠
1555
1556
  bundling: only the **enabled** locales enter your build (next option). Runtime
1556
1557
  switching: `useBbConfig().setConfig({ locale })` — to a locale you enabled.
1557
1558