@nxgt/material-vue 0.30.1 → 0.32.0

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.
Files changed (59) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +1 -1
  3. package/dist/{Button-CNbJT5qV.js → Button-DEA5W6O3.js} +1 -1
  4. package/dist/{HoverCardTrigger-BTAHE6wK.js → HoverCardTrigger-CjSteFgk.js} +2 -2
  5. package/dist/{camera-l87FB3uW.js → camera-DlWK0PLP.js} +4 -4
  6. package/dist/{components-DSl6EpOS.js → components-Dqg7KwA2.js} +13543 -13390
  7. package/dist/components.js +6 -6
  8. package/dist/composables.js +2 -2
  9. package/dist/dnd.js +1 -1
  10. package/dist/{form-scope-BTUGjQdY.js → form-scope-btEYYnGW.js} +1 -1
  11. package/dist/{i18n-provider-BPK68eqM.js → i18n-provider-CiVi05fs.js} +1 -1
  12. package/dist/i18n.js +4 -4
  13. package/dist/{icon-button-DXXjxBgr.js → icon-button-CWcOcNHr.js} +1 -1
  14. package/dist/lib/components/ui/fields/contacts/consts.d.ts +1 -1
  15. package/dist/lib/components/ui/fields/search-field/index.d.ts +2 -1
  16. package/dist/lib/components/ui/selection/autocomplete/autocomplete-items.d.ts +5 -0
  17. package/dist/lib/components/ui/selection/autocomplete/autocomplete.vue.d.ts +6 -3
  18. package/dist/lib/components/ui/selection/autocomplete/filter-options.d.ts +9 -2
  19. package/dist/lib/components/ui/selection/autocomplete/index.d.ts +1 -0
  20. package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-list.vue.d.ts +8 -1
  21. package/dist/lib/components/ui/selection/autocomplete/search-types.d.ts +34 -0
  22. package/dist/lib/components/ui/selection/autocomplete/use-autocomplete-items.d.ts +20 -3
  23. package/dist/lib/components/ui/selection/autocomplete/use-autocomplete-list.d.ts +28 -0
  24. package/dist/lib/components/ui/selection/autocomplete/use-autocomplete-search.d.ts +11 -0
  25. package/dist/lib/components/ui/selection/autocomplete/use-autocomplete-status.d.ts +32 -0
  26. package/dist/lib/components/ui/selection/autocomplete/use-autocomplete-texts.d.ts +1 -3
  27. package/dist/lib/components/ui/selection/autocomplete/use-autocomplete.d.ts +10 -5
  28. package/dist/lib/components/ui/selection/radio-group/radio-group-field.vue.d.ts +2 -0
  29. package/dist/lib/components/ui/selection/select-chip-field/select-chip-field.vue.d.ts +4 -1
  30. package/dist/lib/components/ui/selection/select-chip-field/select-chip-form-field.vue.d.ts +3 -1
  31. package/dist/lib/i18n/resources/en/en.d.ts +4 -0
  32. package/dist/lib/i18n/resources/en/material.json.d.ts +5 -1
  33. package/dist/lib/i18n/resources/fr/fr.d.ts +4 -0
  34. package/dist/lib/i18n/resources/fr/material.json.d.ts +5 -1
  35. package/dist/lib/i18n/resources/resources.d.ts +8 -0
  36. package/dist/lib/i18n/translator.d.ts +1 -1
  37. package/dist/lib.js +2 -2
  38. package/dist/main.js +11 -11
  39. package/dist/map.js +4 -4
  40. package/dist/{pdf-outline-sidebar-DQ6BCQhR.js → pdf-outline-sidebar-DchMD-_k.js} +2 -2
  41. package/dist/{pdf-page-cuvGDdM2.js → pdf-page-D-kDQq5h.js} +1 -1
  42. package/dist/{pdf-page-list-B94WdjV4.js → pdf-page-list-Cta0S89W.js} +2 -2
  43. package/dist/{pdf-reader-CEkr3KzC.js → pdf-reader-BwWozoIQ.js} +8 -8
  44. package/dist/{pdf-sidebar-DJf--6rP.js → pdf-sidebar-B0Addf1P.js} +3 -3
  45. package/dist/{pdf-thumbnail-sidebar-JLWNyl-p.js → pdf-thumbnail-sidebar-Dsptq4fb.js} +3 -3
  46. package/dist/{pdf-toolbar-B_MDicKL.js → pdf-toolbar-Da6UMt1O.js} +4 -4
  47. package/dist/pdf.js +2 -2
  48. package/dist/{sortable-provider-Cb3tm9Cy.js → sortable-provider-Cvpqk8tp.js} +2 -2
  49. package/dist/{stored-language-UnInBB6T.js → stored-language-GDRdeYD8.js} +10 -2
  50. package/dist/{stx-player-DWy055hI.js → stx-player-Bpnir1KO.js} +2 -2
  51. package/dist/{translator-J3_vaV_A.js → translator-BDFEmlcL.js} +1 -1
  52. package/dist/{use-heading-spy-_dk8kGwL.js → use-heading-spy-Czi_Xv3u.js} +1 -1
  53. package/dist/{use-material-translation-Do6ztdtV.js → use-material-translation-CaHS6oZz.js} +3 -3
  54. package/docs/components/selection-and-choice.md +77 -4
  55. package/docs/guides/helpers.md +1 -1
  56. package/docs/roadmap.md +4 -0
  57. package/docs/troubleshooting.md +95 -0
  58. package/package.json +7 -2
  59. package/dist/lib/components/ui/fields/search-field/debounce.d.ts +0 -5
@@ -36,6 +36,9 @@ words in your error.
36
36
  - [An end-to-end test no longer finds a required field by a name ending in `*`](#an-end-to-end-test-no-longer-finds-a-required-field-by-a-name-ending-in-)
37
37
  - [A test no longer finds `aria-invalid` on an upload field's group or drop zone](#a-test-no-longer-finds-aria-invalid-on-an-upload-fields-group-or-drop-zone)
38
38
  - [A test no longer finds `aria-invalid` on a `Switch` row or an `Autocomplete` box](#a-test-no-longer-finds-aria-invalid-on-a-switch-row-or-an-autocomplete-box)
39
+ - [An `Autocomplete` lists more options than before, or "ecole" finds "École"](#an-autocomplete-lists-more-options-than-before-or-ecole-finds-école)
40
+ - [`@query-change` runs more often after upgrading](#query-change-runs-more-often-after-upgrading)
41
+ - [An older search's results replace the newer ones in an `Autocomplete`](#an-older-searchs-results-replace-the-newer-ones-in-an-autocomplete)
39
42
  - [A test no longer finds `aria-invalid` on an `OtpField` slot](#a-test-no-longer-finds-aria-invalid-on-an-otpfield-slot)
40
43
  - [A test no longer finds the breadcrumb's home button](#a-test-no-longer-finds-the-breadcrumbs-home-button)
41
44
  - [A test no longer finds a sidebar entry by the `button` role](#a-test-no-longer-finds-a-sidebar-entry-by-the-button-role)
@@ -47,6 +50,7 @@ words in your error.
47
50
  - [A test no longer finds a calendar day by its number](#a-test-no-longer-finds-a-calendar-day-by-its-number)
48
51
  - [A `QRCode`'s `aria-label` is no longer on its wrapper](#a-qrcodes-aria-label-is-no-longer-on-its-wrapper)
49
52
  - [A `CheckboxGroup` or `RadioGroupField` option selected by `#<id>-<value>` stops matching](#a-checkboxgroup-or-radiogroupfield-option-selected-by-id-value-stops-matching)
53
+ - [One option of a `RadioGroupField` cannot be disabled](#one-option-of-a-radiogroupfield-cannot-be-disabled)
50
54
  - [A `Table`'s `id`, `aria-*` or `style` is no longer on its scrolling container](#a-tables-id-aria--or-style-is-no-longer-on-its-scrolling-container)
51
55
 
52
56
  **Feedback**
@@ -87,6 +91,7 @@ words in your error.
87
91
  - [`meta.touched` stays false after leaving a field](#metatouched-stays-false-after-leaving-a-field)
88
92
  - [A failed submit does not focus the first invalid field](#a-failed-submit-does-not-focus-the-first-invalid-field)
89
93
  - [A test that finds a chip by `aria-selected` or `getByRole('option')` no longer finds it](#a-test-that-finds-a-chip-by-aria-selected-or-getbyroleoption-no-longer-finds-it)
94
+ - [The `ref` of a `SelectChipField` focuses nothing](#the-ref-of-a-selectchipfield-focuses-nothing)
90
95
  - [A multi-step form reopens at a later step](#a-multi-step-form-reopens-at-a-later-step)
91
96
  - [The form could not be loaded.](#the-form-could-not-be-loaded)
92
97
 
@@ -577,6 +582,56 @@ await expect(page.getByRole('switch', { name: 'Notifications' })).toHaveAttribut
577
582
  await expect(page.getByLabel('Country')).toHaveAttribute('aria-invalid', 'true');
578
583
  ```
579
584
 
585
+ ### An `Autocomplete` lists more options than before, or "ecole" finds "École"
586
+
587
+ **When:** after upgrading to 0.31.0, typing in an `Autocomplete` with local
588
+ `options` keeps options it used to drop: `e` keeps "Évry", `orle` keeps
589
+ "Orléans".
590
+ **Why:** local matching is now accent-insensitive by default (`filter`
591
+ defaults to `'accent-insensitive'`): the label or value and the query are
592
+ both lowercased in the provider's language and stripped of their accents
593
+ before they are compared. Before, an accent had to be typed to match.
594
+ **Fix:** nothing, if that is what your users expect. To match as before,
595
+ pass your own `filter`; to show `options` exactly as you give them (they are
596
+ filtered on your server), pass `filter="none"`:
597
+
598
+ ```vue
599
+ <!-- Back to a plain case-insensitive match, accents counted: -->
600
+ <Autocomplete
601
+ v-model="value"
602
+ :options="options"
603
+ :filter="(option, query) => option.label.toLowerCase().includes(query.toLowerCase())"
604
+ />
605
+ ```
606
+
607
+ ### `@query-change` runs more often after upgrading
608
+
609
+ **When:** after upgrading to 0.31.0, `@query-change` is called sooner after the
610
+ user stops typing, so a server you fetch from there gets more requests.
611
+ **Why:** the pause it waits for is now `debounceMs`, 250 ms by default; it
612
+ was a fixed 300 ms.
613
+ **Fix:** set the pause you had, `:debounce-ms="300"`, or move the fetch to `on-search`, which
614
+ also aborts the previous request and drops a stale response.
615
+
616
+ ### An older search's results replace the newer ones in an `Autocomplete`
617
+
618
+ **When:** you fetch `options` yourself from `@query-change`, and a slow response
619
+ for an earlier query lands after a faster one for the latest: the list shows
620
+ the results of what the user typed before.
621
+ **Why:** each of your requests resolves whenever the server answers, and
622
+ the last one to resolve wins.
623
+ **Fix:** use `on-search`. It hands each search an `AbortSignal` (pass it to
624
+ `fetch`), aborts the previous search, and drops any response that lands for
625
+ an older query, even from an API that ignores the signal:
626
+
627
+ ```vue
628
+ <Autocomplete
629
+ v-model="value"
630
+ :on-search="(query, { signal }) =>
631
+ fetch(`/api/people?q=${encodeURIComponent(query)}`, { signal }).then((r) => r.json())"
632
+ />
633
+ ```
634
+
580
635
  ### A test no longer finds `aria-invalid` on an `OtpField` slot
581
636
 
582
637
  **When:** `[data-slot="input-otp-slot"][aria-invalid]` (or
@@ -792,6 +847,30 @@ which a `group` may not carry: assert its description instead,
792
847
  hidden hint sits inside the helper element, so match its text with
793
848
  `getByText('Pick any.', { exact: false })` or the description with a RegExp.
794
849
 
850
+ ### One option of a `RadioGroupField` cannot be disabled
851
+
852
+ **When:** you need one choice greyed out (a person already linked, a plan the
853
+ account cannot take) and `disabled` on the group disables all of them. Before
854
+ this release the options had no `disabled`, so apps listed the unavailable ones
855
+ apart or hand-built the group from `RadioGroupItem`.
856
+ **Why:** an option was only `{ value, label }`; `disabled` was the group's.
857
+ **Fix:** upgrade, and set `disabled` on the option. It is rendered and
858
+ announced as disabled, its label is muted (still 4.5:1) and the arrow keys
859
+ skip it; the group's own `disabled` still disables every option. An option
860
+ that is disabled while it is the current `value` stays checked, as in the
861
+ Radix and Reka primitives:
862
+
863
+ ```vue
864
+ <RadioGroupField
865
+ v-model="person"
866
+ label="Person"
867
+ :options="[
868
+ { value: 'ada', label: 'Ada' },
869
+ { value: 'bob', label: 'Bob (already linked)', disabled: true },
870
+ ]"
871
+ />
872
+ ```
873
+
795
874
  ### A `Table`'s `id`, `aria-*` or `style` is no longer on its scrolling container
796
875
 
797
876
  **When:** after upgrading to 0.24.0, either:
@@ -1770,6 +1849,22 @@ const design = within(topics).getByRole('button', { name: 'Design' });
1770
1849
  expect(design).toHaveAttribute('aria-pressed', 'true');
1771
1850
  ```
1772
1851
 
1852
+ ### The `ref` of a `SelectChipField` focuses nothing
1853
+
1854
+ **When:** a template ref to a `SelectChipField` (or a `SelectChipFormField`)
1855
+ has no `focus()`, so a parent cannot put focus in the field. Before the
1856
+ release that lists this fix only.
1857
+ **Why:** the ref is the component instance, and its root is a `role="group"`
1858
+ element, which a browser cannot focus.
1859
+ **Fix:** upgrade: the instance exposes `focus()`, which focuses the chosen
1860
+ chip, else the first one that is not disabled, as a radio group does.
1861
+ Temporary, until material #502: on an older release, focus the chip
1862
+ yourself.
1863
+
1864
+ ```ts
1865
+ field.value?.$el.querySelector<HTMLElement>('[aria-pressed="true"], button')?.focus();
1866
+ ```
1867
+
1773
1868
  ### A multi-step form reopens at a later step
1774
1869
 
1775
1870
  **When:** a wizard built on `defineStepFormStore` opens at the step (and with
package/package.json CHANGED
@@ -1,10 +1,15 @@
1
1
  {
2
2
  "name": "@nxgt/material-vue",
3
- "version": "0.30.1",
3
+ "version": "0.32.0",
4
4
  "license": "MIT",
5
5
  "bugs": {
6
6
  "email": "stevegires@gmail.com"
7
7
  },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/softistx/nxgt-material.git",
11
+ "directory": "packages/material-vue"
12
+ },
8
13
  "type": "module",
9
14
  "files": [
10
15
  "dist",
@@ -119,7 +124,7 @@
119
124
  "docs:previews": "vitest run --project previews"
120
125
  },
121
126
  "dependencies": {
122
- "@nxgt/material-core": "^0.7.1",
127
+ "@nxgt/material-core": "^0.8.0",
123
128
  "@floating-ui/dom": "^1.8.0",
124
129
  "@fortawesome/fontawesome-common-types": "7.3.1",
125
130
  "@lucide/vue": "^1.45.0",
@@ -1,5 +0,0 @@
1
- export type Debounced<Args extends unknown[]> = ((...args: Args) => void) & {
2
- cancel: () => void;
3
- flush: () => void;
4
- };
5
- export declare function debounce<Args extends unknown[]>(fn: (...args: Args) => void, ms: number): Debounced<Args>;