@nxgt/material-vue 0.31.0 → 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 (57) hide show
  1. package/CHANGELOG.md +30 -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-rJmgxIEn.js → camera-DlWK0PLP.js} +4 -4
  6. package/dist/{components-Dxy9DvEe.js → components-Dqg7KwA2.js} +13503 -13362
  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-BhNw4Mm6.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/i18n/resources/en/en.d.ts +4 -0
  30. package/dist/lib/i18n/resources/en/material.json.d.ts +5 -1
  31. package/dist/lib/i18n/resources/fr/fr.d.ts +4 -0
  32. package/dist/lib/i18n/resources/fr/material.json.d.ts +5 -1
  33. package/dist/lib/i18n/resources/resources.d.ts +8 -0
  34. package/dist/lib/i18n/translator.d.ts +1 -1
  35. package/dist/lib.js +2 -2
  36. package/dist/main.js +11 -11
  37. package/dist/map.js +4 -4
  38. package/dist/{pdf-outline-sidebar-6pIxLP_o.js → pdf-outline-sidebar-DchMD-_k.js} +2 -2
  39. package/dist/{pdf-page--zE3j8bc.js → pdf-page-D-kDQq5h.js} +1 -1
  40. package/dist/{pdf-page-list-ojy2YSTr.js → pdf-page-list-Cta0S89W.js} +2 -2
  41. package/dist/{pdf-reader-CcSJaFFp.js → pdf-reader-BwWozoIQ.js} +8 -8
  42. package/dist/{pdf-sidebar-8DC9VdCG.js → pdf-sidebar-B0Addf1P.js} +3 -3
  43. package/dist/{pdf-thumbnail-sidebar-BbPcfCYm.js → pdf-thumbnail-sidebar-Dsptq4fb.js} +3 -3
  44. package/dist/{pdf-toolbar-B_MDicKL.js → pdf-toolbar-Da6UMt1O.js} +4 -4
  45. package/dist/pdf.js +2 -2
  46. package/dist/{sortable-provider-Cb3tm9Cy.js → sortable-provider-Cvpqk8tp.js} +2 -2
  47. package/dist/{stored-language-UnInBB6T.js → stored-language-GDRdeYD8.js} +10 -2
  48. package/dist/{stx-player-CjGKQF6K.js → stx-player-Bpnir1KO.js} +2 -2
  49. package/dist/{translator-J3_vaV_A.js → translator-BDFEmlcL.js} +1 -1
  50. package/dist/{use-heading-spy-_dk8kGwL.js → use-heading-spy-Czi_Xv3u.js} +1 -1
  51. package/dist/{use-material-translation-Do6ztdtV.js → use-material-translation-CaHS6oZz.js} +3 -3
  52. package/docs/components/selection-and-choice.md +75 -4
  53. package/docs/guides/helpers.md +1 -1
  54. package/docs/roadmap.md +4 -0
  55. package/docs/troubleshooting.md +78 -0
  56. package/package.json +7 -2
  57. 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**
@@ -578,6 +582,56 @@ await expect(page.getByRole('switch', { name: 'Notifications' })).toHaveAttribut
578
582
  await expect(page.getByLabel('Country')).toHaveAttribute('aria-invalid', 'true');
579
583
  ```
580
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
+
581
635
  ### A test no longer finds `aria-invalid` on an `OtpField` slot
582
636
 
583
637
  **When:** `[data-slot="input-otp-slot"][aria-invalid]` (or
@@ -793,6 +847,30 @@ which a `group` may not carry: assert its description instead,
793
847
  hidden hint sits inside the helper element, so match its text with
794
848
  `getByText('Pick any.', { exact: false })` or the description with a RegExp.
795
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
+
796
874
  ### A `Table`'s `id`, `aria-*` or `style` is no longer on its scrolling container
797
875
 
798
876
  **When:** after upgrading to 0.24.0, either:
package/package.json CHANGED
@@ -1,10 +1,15 @@
1
1
  {
2
2
  "name": "@nxgt/material-vue",
3
- "version": "0.31.0",
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>;