@nxgt/material-vue 0.24.0 → 0.25.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 (139) hide show
  1. package/README.md +17 -19
  2. package/dist/{Button-DOcT4Pej.js → Button-C1aaI0Gw.js} +1 -1
  3. package/dist/{HoverCardTrigger-WQe85PCH.js → HoverCardTrigger-JtHn0IFQ.js} +2 -2
  4. package/dist/{camera-BNbLUPb1.js → camera-BacVyXl0.js} +13 -13
  5. package/dist/{components-YlYuHLEI.js → components-DRBKkOqk.js} +15333 -13879
  6. package/dist/components.js +8 -8
  7. package/dist/composables.js +2 -2
  8. package/dist/dnd.js +1 -1
  9. package/dist/form-scope-VxlJuvFe.js +43 -0
  10. package/dist/{i18n-provider-DTuxugHO.js → i18n-provider-D0oYv0XS.js} +1 -1
  11. package/dist/i18n.js +4 -4
  12. package/dist/{icon-button-DKLuZ2c-.js → icon-button-B2FQtIHS.js} +1 -1
  13. package/dist/lib/components/ui/collections/tree/use-tree.d.ts +2 -0
  14. package/dist/lib/components/ui/dates/date-field/date-field.vue.d.ts +10 -1
  15. package/dist/lib/components/ui/dates/date-field/date-form-field.vue.d.ts +3 -1
  16. package/dist/lib/components/ui/dates/date-field/day-matcher.d.ts +26 -0
  17. package/dist/lib/components/ui/dates/date-field/index.d.ts +1 -0
  18. package/dist/lib/components/ui/dates/date-field/partials/date-field-content.vue.d.ts +2 -0
  19. package/dist/lib/components/ui/dates/date-range-field/date-range-field.utils.d.ts +11 -0
  20. package/dist/lib/components/ui/dates/date-range-field/date-range-field.vue.d.ts +26 -1
  21. package/dist/lib/components/ui/dates/date-range-field/date-range-form-field.vue.d.ts +3 -1
  22. package/dist/lib/components/ui/dates/date-range-field/index.d.ts +1 -0
  23. package/dist/lib/components/ui/dates/date-range-field/partials/date-range-calendar.vue.d.ts +5 -0
  24. package/dist/lib/components/ui/dates/date-range-field/partials/date-range-field-trigger.vue.d.ts +2 -0
  25. package/dist/lib/components/ui/dates/date-range-field/partials/date-range-presets.vue.d.ts +12 -0
  26. package/dist/lib/components/ui/dates/date-range-field/partials/date-range-times.vue.d.ts +13 -0
  27. package/dist/lib/components/ui/dates/date-range-field/use-date-range-presets.d.ts +23 -0
  28. package/dist/lib/components/ui/dates/time-picker/time-picker-utils.d.ts +7 -0
  29. package/dist/lib/components/ui/display/accordion-card/accordion-card.vue.d.ts +29 -1
  30. package/dist/lib/components/ui/display/avatar/Avatar.vue.d.ts +14 -3
  31. package/dist/lib/components/ui/display/avatar/index.d.ts +1 -0
  32. package/dist/lib/components/ui/display/cards/cards.gallery.d.ts +5 -9
  33. package/dist/lib/components/ui/display/qrcode/qrcode.vue.d.ts +5 -3
  34. package/dist/lib/components/ui/display/status-indicator/status-tone.d.ts +3 -0
  35. package/dist/lib/components/ui/feedback/confirmation-dialog/async-form-scope.d.ts +15 -0
  36. package/dist/lib/components/ui/feedback/confirmation-dialog/confirmation-dialog.vue.d.ts +37 -24
  37. package/dist/lib/components/ui/feedback/confirmation-dialog/index.d.ts +1 -1
  38. package/dist/lib/components/ui/feedback/confirmation-dialog/partials/confirmation-dialog-form-error.vue.d.ts +3 -0
  39. package/dist/lib/components/ui/fields/attributes/form-schema.d.ts +24 -22
  40. package/dist/lib/components/ui/fields/contacts/consts.d.ts +1 -1
  41. package/dist/lib/components/ui/fields/number-field/number-field.vue.d.ts +2 -0
  42. package/dist/lib/components/ui/fields/slider/partials/slider-field-row.vue.d.ts +32 -0
  43. package/dist/lib/components/ui/fields/slider/slider-field.vue.d.ts +22 -1
  44. package/dist/lib/components/ui/fields/slider/slider-form-field.vue.d.ts +13 -1
  45. package/dist/lib/components/ui/forms/form-scope-schema.d.ts +43 -0
  46. package/dist/lib/components/ui/forms/form-scope.vue.d.ts +33 -0
  47. package/dist/lib/components/ui/media/file-preview/file-preview-pdf.lazy.d.ts +8 -0
  48. package/dist/lib/components/ui/media/file-preview/file-preview.vue.d.ts +9 -0
  49. package/dist/lib/components/ui/media/file-preview/index.d.ts +3 -0
  50. package/dist/lib/components/ui/media/file-preview/partials/file-preview-body.vue.d.ts +21 -0
  51. package/dist/lib/components/ui/media/file-preview/partials/file-preview-card.vue.d.ts +15 -0
  52. package/dist/lib/components/ui/media/file-preview/partials/file-preview-download.vue.d.ts +11 -0
  53. package/dist/lib/components/ui/media/file-preview/partials/file-preview-media.vue.d.ts +17 -0
  54. package/dist/lib/components/ui/media/file-preview/partials/file-preview-pdf.vue.d.ts +21 -0
  55. package/dist/lib/components/ui/media/file-preview/partials/file-preview-status.vue.d.ts +22 -0
  56. package/dist/lib/components/ui/media/file-preview/partials/file-preview-text.vue.d.ts +16 -0
  57. package/dist/lib/components/ui/media/file-preview/types.d.ts +19 -0
  58. package/dist/lib/components/ui/media/file-preview/use-file-preview.d.ts +21 -0
  59. package/dist/lib/components/ui/media/file-preview/use-text-preview.d.ts +17 -0
  60. package/dist/lib/components/ui/media/files-form-field/files-form-field.vue.d.ts +29 -0
  61. package/dist/lib/components/ui/media/files-form-field/index.d.ts +2 -0
  62. package/dist/lib/components/ui/media/image-cropper/partials/image-cropper-canvas.vue.d.ts +1 -1
  63. package/dist/lib/components/ui/media/index.d.ts +2 -0
  64. package/dist/lib/components/ui/media/pdf-viewer/partials/pdf-page.vue.d.ts +1 -1
  65. package/dist/lib/components/ui/media/pdf-viewer/partials/pdf-reader-body.vue.d.ts +2 -2
  66. package/dist/lib/components/ui/media/upload/network-upload-field/use-image-preview.d.ts +9 -1
  67. package/dist/lib/components/ui/primitives/tabs/Tabs.vue.d.ts +3 -0
  68. package/dist/lib/components/ui/primitives/tabs/index.d.ts +1 -0
  69. package/dist/lib/components/ui/primitives/tabs/tabs-variant.d.ts +9 -0
  70. package/dist/lib/components/ui/selection/autocomplete/autocomplete-form-field.vue.d.ts +31 -5
  71. package/dist/lib/components/ui/selection/autocomplete/autocomplete-items.d.ts +23 -0
  72. package/dist/lib/components/ui/selection/autocomplete/autocomplete.vue.d.ts +48 -13
  73. package/dist/lib/components/ui/selection/autocomplete/filter-options.d.ts +2 -1
  74. package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-box.vue.d.ts +13 -1
  75. package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-list.vue.d.ts +17 -3
  76. package/dist/lib/components/ui/selection/autocomplete/use-autocomplete-items.d.ts +15 -0
  77. package/dist/lib/components/ui/selection/autocomplete/use-autocomplete-open.d.ts +15 -0
  78. package/dist/lib/components/ui/selection/autocomplete/use-autocomplete-texts.d.ts +14 -0
  79. package/dist/lib/components/ui/selection/autocomplete/use-autocomplete.d.ts +34 -0
  80. package/dist/lib/components/ui/selection/index.d.ts +1 -0
  81. package/dist/lib/components/ui/selection/select-field/select-field.vue.d.ts +16 -1
  82. package/dist/lib/components/ui/selection/select-field/select-form-field.vue.d.ts +16 -2
  83. package/dist/lib/components/ui/selection/tree-select-field/index.d.ts +3 -0
  84. package/dist/lib/components/ui/selection/tree-select-field/partials/tree-select-panel.vue.d.ts +27 -0
  85. package/dist/lib/components/ui/selection/tree-select-field/partials/tree-select-trigger.vue.d.ts +28 -0
  86. package/dist/lib/components/ui/selection/tree-select-field/tree-select-field.vue.d.ts +8 -0
  87. package/dist/lib/components/ui/selection/tree-select-field/tree-select-form-field.vue.d.ts +8 -0
  88. package/dist/lib/components/ui/selection/tree-select-field/tree-select.utils.d.ts +29 -0
  89. package/dist/lib/components/ui/selection/tree-select-field/types.d.ts +28 -0
  90. package/dist/lib/components/ui/selection/tree-select-field/use-tree-select-field.d.ts +19 -0
  91. package/dist/lib/components/ui/widgets/code-editor/code-editor-options.d.ts +4 -1
  92. package/dist/lib/components/ui/widgets/code-editor/code-editor.vue.d.ts +7 -0
  93. package/dist/lib/components/ui/widgets/code-editor/index.d.ts +1 -0
  94. package/dist/lib/components/ui/widgets/code-editor/monaco-editor.vue.d.ts +3 -0
  95. package/dist/lib/i18n/resources/en/en.d.ts +33 -0
  96. package/dist/lib/i18n/resources/en/material.json.d.ts +36 -3
  97. package/dist/lib/i18n/resources/fr/fr.d.ts +33 -0
  98. package/dist/lib/i18n/resources/fr/material.json.d.ts +36 -3
  99. package/dist/lib/i18n/resources/resources.d.ts +66 -0
  100. package/dist/lib/i18n/translator.d.ts +1 -1
  101. package/dist/lib/nuxt/component-names.d.ts +1 -1
  102. package/dist/lib.js +2 -2
  103. package/dist/main.js +17 -17
  104. package/dist/map.js +4 -4
  105. package/dist/material-vue.css +1 -1
  106. package/dist/{pdf-outline-sidebar-0I-LGrgY.js → pdf-outline-sidebar-jJfhNjnN.js} +2 -2
  107. package/dist/{pdf-page-C74-6lyZ.js → pdf-page-BW1hXzPu.js} +1 -1
  108. package/dist/{pdf-page-list-DPsquYPY.js → pdf-page-list-D277RtWS.js} +2 -2
  109. package/dist/{pdf-reader-Bkpp7UZ7.js → pdf-reader-BReUTsn_.js} +73 -71
  110. package/dist/{pdf-sidebar-BH-1jvy-.js → pdf-sidebar-Bk6PowY1.js} +3 -3
  111. package/dist/{pdf-thumbnail-sidebar-ByqNaYfz.js → pdf-thumbnail-sidebar-BcNDFsks.js} +3 -3
  112. package/dist/{pdf-toolbar-BRnmzddi.js → pdf-toolbar-CHjaMhH9.js} +4 -4
  113. package/dist/pdf.js +2 -2
  114. package/dist/{sortable-provider-CC9eO1nm.js → sortable-provider-C83VBfGl.js} +2 -2
  115. package/dist/{stored-language-N_UoPJsY.js → stored-language-CC_vdcCN.js} +72 -6
  116. package/dist/{stx-player-BGKIDqNX.js → stx-player-BMQ1D2Li.js} +20 -20
  117. package/dist/{translator-CU0jKvzB.js → translator-B-X_1taI.js} +1 -1
  118. package/dist/{use-heading-spy-Bw1LIAkC.js → use-heading-spy-C_ySuvTl.js} +1 -1
  119. package/dist/{use-material-translation-8hUB2M-S.js → use-material-translation-B6sIk0mF.js} +3 -3
  120. package/docs/components/README.md +2 -1
  121. package/docs/components/data-display.md +51 -10
  122. package/docs/components/data-table-filter-and-lists.md +4 -0
  123. package/docs/components/date-and-time.md +116 -9
  124. package/docs/components/feedback-and-status.md +56 -4
  125. package/docs/components/form-fields.md +15 -5
  126. package/docs/components/media-and-files.md +119 -5
  127. package/docs/components/navigation-and-layout.md +2 -1
  128. package/docs/components/primitives.md +21 -4
  129. package/docs/components/rich-widgets.md +20 -3
  130. package/docs/components/selection-and-choice.md +135 -9
  131. package/docs/guides/forms.md +3 -4
  132. package/docs/guides/i18n.md +44 -4
  133. package/docs/previews/date-time-daterangefield.webp +0 -0
  134. package/docs/previews/media-files-filepreview.webp +0 -0
  135. package/docs/previews/selection-choice-treeselectfield.webp +0 -0
  136. package/docs/roadmap.md +43 -37
  137. package/docs/troubleshooting.md +110 -1
  138. package/lib/nuxt/component-names.ts +4 -0
  139. package/package.json +2 -2
package/docs/roadmap.md CHANGED
@@ -6,31 +6,22 @@ the version something shipped in.
6
6
 
7
7
  ## Now
8
8
 
9
- - **Spinner `light` colour renders** — a `Spinner` with `color="light"` shows
10
- its light ring, for loading states on dark or coloured surfaces.
11
- - **Range filters announce their field name** — the slider thumbs and the
12
- `Min`/`Max` inputs of a `slider-range` or `number-range` filter are named
13
- after the field, so a screen reader says which range is changing.
14
- - **Alert keeps long content inside** — a long title, description or unbroken
15
- string wraps inside the `Alert` instead of running past its edge.
16
- - **Slider thumb follows the theme in dark mode** — the `Slider` thumb takes
17
- the dark theme's colours instead of staying light. Vue only.
18
- - **Stepper: unique ids, announced steps and truncated titles** — two steppers
19
- on one page no longer share ids, a screen reader hears which step is current
20
- and whether each is done or in error, and a long step title truncates.
21
- - **Layouts that hold long content** — `ListTile`, `StatCard` and `Banner`
22
- keep long titles, values and actions inside their box instead of overflowing.
23
- - **The same exports as `@nxgt/material`** — a `Checkbox` with its own
24
- `label` and `helper-text` (the bare box is unchanged) and
25
- `CheckboxFormField`, `InlineEditFormField`, `CodeEditorFormField`,
26
- `PaginationBar` with `paginationItems` and `PaginationLink`, `CopyValue`,
27
- `MermaidDiagram`, and the `Doc` parts `DocArticle`, `DocNav`, `DocLink`,
28
- `DefaultDocLink` and `DocCopyPage`, under the names they have in React.
29
- ([forms](guides/forms.md#what-each-field-emits))
30
- - **DataTable loading and empty states** — skeleton rows while the data loads
31
- (the rows already shown stay in place, dimmed, during a refresh), the table
32
- announced as busy, and your own content when there are no rows, told
33
- whether a filter emptied it.
9
+ - **TreeSelectField** — pick one or several items from a tree inside a form
10
+ field, as chips when several, with an optional filter that keeps each match
11
+ under its ancestors (`TreeSelectField`, `TreeSelectFormField`).
12
+ - **The same options as `@nxgt/material`** — a generic `Autocomplete` and
13
+ `FilesFormField` typed by your items, a `ConfirmationDialog` that holds a
14
+ form, date fields that disable chosen days, `SliderField` ticks and
15
+ leading/trailing content, a presence status on `Avatar`, a logo slot on the
16
+ QR code, slots on `AccordionCard`, an option slot on `SelectField`, Monaco's
17
+ own options on `CodeEditor` and a line variant for `Tabs`.
18
+ - **DateRangeField presets and time** — one-click ranges such as Today, Last 7
19
+ days and This month, or your own, beside the calendar (`presets`), and a time
20
+ of day on each end of the range (`with-time`), and `min-date` / `max-date`.
21
+ - **FilePreview** — preview a file picked by its type, in one component: an
22
+ image, a PDF in `PdfReader`, a video or audio file, the text of a text, JSON,
23
+ CSV or Markdown file, or a card with a download link for anything else
24
+ (`FilePreview`, `@error`). Safe on a server.
34
25
 
35
26
  ## Next
36
27
 
@@ -40,18 +31,6 @@ the version something shipped in.
40
31
  Vue only: `@nxgt/material`'s print blocks already produce a PDF.
41
32
  - **`StepperIndicator`, as in `@nxgt/material`** — the step markers on their
42
33
  own, for a stepper laid out your way.
43
- - **The same options as `@nxgt/material`** — a generic `Autocomplete` and
44
- `FilesFormField` typed by your items, a `ConfirmationDialog` that holds a
45
- form, date fields that disable chosen days, `SliderField` ticks and
46
- leading/trailing content, a presence status on `Avatar`, a logo in the QR
47
- code, slots on `AccordionCard`, an option slot on `SelectField`, editor
48
- options on `CodeEditor` and a line variant for `Tabs`.
49
- - **DateRangeField presets and time** — one-click ranges such as Today, Last 7
50
- days and This month, and a time of day on each end of the range.
51
- - **TreeSelectField** — pick one or several items from a tree inside a form
52
- field.
53
- - **FilePreview** — preview an image, PDF, video or text file, chosen by its
54
- type, in one component.
55
34
 
56
35
  ## Later
57
36
 
@@ -128,6 +107,33 @@ the version something shipped in.
128
107
 
129
108
  ## Shipped
130
109
 
110
+ - **Spinner `light` colour renders** — a `Spinner` with `color="light"` shows
111
+ its light ring, for loading states on dark or coloured surfaces. 0.24.0.
112
+ - **Range filters announce their field name** — the slider thumbs and the
113
+ `Min`/`Max` inputs of a `slider-range` or `number-range` filter are named
114
+ after the field, so a screen reader says which range is changing. 0.24.0.
115
+ - **Alert keeps long content inside** — a long title, description or unbroken
116
+ string wraps inside the `Alert` instead of running past its edge. 0.24.0.
117
+ - **Slider thumb follows the theme in dark mode** — the `Slider` thumb takes
118
+ the dark theme's colours instead of staying light. Vue only. 0.24.0.
119
+ - **Stepper: unique ids, announced steps and truncated titles** — two steppers
120
+ on one page no longer share ids, a screen reader hears which step is current
121
+ and whether each is done or in error, and a long step title truncates. 0.24.0.
122
+ - **Layouts that hold long content** — `ListTile`, `StatCard` and `Banner`
123
+ keep long titles, values and actions inside their box instead of overflowing.
124
+ 0.24.0.
125
+ - **The same exports as `@nxgt/material`** — a `Checkbox` with its own
126
+ `label` and `helper-text` (the bare box is unchanged) and
127
+ `CheckboxFormField`, `InlineEditFormField`, `CodeEditorFormField`,
128
+ `PaginationBar` with `paginationItems` and `PaginationLink`, `CopyValue`,
129
+ `MermaidDiagram`, and the `Doc` parts `DocArticle`, `DocNav`, `DocLink`,
130
+ `DefaultDocLink` and `DocCopyPage`, under the names they have in React.
131
+ 0.24.0.
132
+ ([forms](guides/forms.md#what-each-field-emits))
133
+ - **DataTable loading and empty states** — skeleton rows while the data loads
134
+ (the rows already shown stay in place, dimmed, during a refresh), the table
135
+ announced as busy, and your own content when there are no rows, told
136
+ whether a filter emptied it. 0.24.0.
131
137
  - **One copy of the framework-free code, shared with `@nxgt/material`** —
132
138
  the PDF document model and renderer, the print formatters, the PDF file
133
139
  helpers, `PdfReader`'s page geometry, scroll spy and search, the
@@ -49,6 +49,11 @@ words in your error.
49
49
  - [A `*FormField` is missing from the submitted values, or never shows an error](#a-formfield-is-missing-from-the-submitted-values-or-never-shows-an-error)
50
50
  - [`meta.touched` stays false after leaving a field](#metatouched-stays-false-after-leaving-a-field)
51
51
  - [A multi-step form reopens at a later step](#a-multi-step-form-reopens-at-a-later-step)
52
+ - [The form could not be loaded.](#the-form-could-not-be-loaded)
53
+
54
+ **TypeScript**
55
+
56
+ - [`does not satisfy the constraint 'abstract new (...args: any) => any'`](#does-not-satisfy-the-constraint-abstract-new-args-any--any)
52
57
 
53
58
  **Printing**
54
59
 
@@ -136,6 +141,9 @@ words in your error.
136
141
  - [A PDF page shows sideways in `PdfReader`](#a-pdf-page-shows-sideways-in-pdfreader)
137
142
  - [The zoom changes by itself while a long PDF is open](#the-zoom-changes-by-itself-while-a-long-pdf-is-open)
138
143
  - [`@page-change` is not called when `initialPage` is past the end, or after a new file](#page-change-is-not-called-when-initialpage-is-past-the-end-or-after-a-new-file)
144
+ - [`@page-change` reports another page after opening on `initialPage`](#page-change-reports-another-page-after-opening-on-initialpage)
145
+ - [`FilePreview` shows a file card with a Download link for a PDF](#filepreview-shows-a-file-card-with-a-download-link-for-a-pdf)
146
+ - [`FilePreview` says "This file could not be previewed."](#filepreview-says-this-file-could-not-be-previewed)
139
147
  - [Reporting a bug](#reporting-a-bug)
140
148
 
141
149
  ---
@@ -564,7 +572,7 @@ hidden hint sits inside the helper element, so match its text with
564
572
 
565
573
  ### A `Table`'s `id`, `aria-*` or `style` is no longer on its scrolling container
566
574
 
567
- **When:** after upgrading, either:
575
+ **When:** after upgrading to 0.24.0, either:
568
576
 
569
577
  - a selector or listener aimed at the attributes you put on `<Table>` finds
570
578
  nothing on `div[data-slot="table-container"]` (`#orders` matches the
@@ -966,6 +974,52 @@ In an SSR app the server renders step 0. A client hydrating that page renders
966
974
  step 0 too and resumes at the stored step once mounted, so hydration matches
967
975
  without `clientOnly`: see [forms](guides/forms.md#a-multi-step-form).
968
976
 
977
+ ### The form could not be loaded.
978
+
979
+ **When:** a `ConfirmationDialog` with `form-options` shows this line
980
+ ("Le formulaire n’a pas pu être chargé." in French,
981
+ `material.confirm-dialog.form-failed`) where its form should be, and its
982
+ confirm button stays disabled. The form's code is a separate chunk, loaded the
983
+ first time such a dialog renders it, and that load failed twice: the browser
984
+ was offline, or a deploy removed the chunk the page still names.
985
+ **Why:** each dialog tries the load once more after a failure, then gives up
986
+ and keeps that result: reopening the same dialog shows the message again
987
+ without a new attempt. A dialog rendered anew (another page, a remounted
988
+ component) tries again from the start.
989
+ **Fix:** reload the page — after a deploy, that fetches the new chunk names.
990
+ If it keeps happening, check that your server or CDN serves the chunk that holds
991
+ the dialog's form (its name usually starts with `form-scope`) with the rest of
992
+ the same build, and keeps the previous build's chunks for pages already open.
993
+
994
+ ## TypeScript
995
+
996
+ ### `does not satisfy the constraint 'abstract new (...args: any) => any'`
997
+
998
+ **When:** `vue-tsc` on code that types a template ref with
999
+ `InstanceType<typeof Autocomplete>` (or `AutocompleteFormField`,
1000
+ `ConfirmationDialog`, `FilesFormField`). The whole message reads:
1001
+
1002
+ ```text
1003
+ error TS2344: Type '<T extends AutocompleteOption = AutocompleteOption>(__VLS_props: …) => …' does not satisfy the constraint 'abstract new (...args: any) => any'.
1004
+ … provides no match for the signature 'new (...args: any): any'.
1005
+ ```
1006
+
1007
+ **Why:** these four components are generic (`<script setup generic>`): your
1008
+ option type, or your form schema, types their props and slots. A generic
1009
+ component's default export is a function, not a component constructor, so
1010
+ `InstanceType` has nothing to read.
1011
+ **Fix:** use `ComponentExposed` from `vue-component-type-helpers` (the helpers
1012
+ `vue-tsc` itself ships; add it as a dev dependency if your app does not list
1013
+ it):
1014
+
1015
+ ```ts
1016
+ import { useTemplateRef } from 'vue';
1017
+ import type { ComponentExposed } from 'vue-component-type-helpers';
1018
+ import { Autocomplete } from '@nxgt/material-vue/components';
1019
+
1020
+ const field = useTemplateRef<ComponentExposed<typeof Autocomplete>>('field');
1021
+ ```
1022
+
969
1023
  ## Printing
970
1024
 
971
1025
  ### The table header and the total row print blank
@@ -2379,6 +2433,61 @@ last page without reporting it; or `file` changes and the reader goes back to
2379
2433
  to itself. Since 0.22.0 both are reported, once.
2380
2434
  **Fix:** update `@nxgt/material-vue`. A page you kept in sync by hand can go.
2381
2435
 
2436
+ ### `@page-change` reports another page after opening on `initialPage`
2437
+
2438
+ **When:** the reader opens on `initialPage` and, without the user scrolling,
2439
+ `@page-change` reports another page, most often the last one, and the page field
2440
+ shows it. Seen on slow devices and busy machines, near the end of a
2441
+ document, with `@nxgt/material-vue` 0.24.0 and earlier.
2442
+ **Why:** after placing the opening page, the reader ignored scrolling for
2443
+ only 150 ms. When the placement scroll landed later (a late frame), it was
2444
+ read as the user's, and at the end of the pages that is the last page.
2445
+ **Fix:** update `@nxgt/material-vue`. The opening page now keeps the page number while
2446
+ the view stays on it; the user's own scroll, find in page or a screen
2447
+ reader moving the view still report the page they reach.
2448
+
2449
+ ### `FilePreview` shows a file card with a Download link for a PDF
2450
+
2451
+ **When:** a PDF given to `FilePreview` shows its name, size and a Download
2452
+ link instead of the reader.
2453
+ **Why:** `FilePreview` imports `PdfReader` the first time it previews a PDF,
2454
+ and falls back to the file card when that import fails: the viewer's chunk
2455
+ could not be fetched (a deploy replaced the chunks the open page was built
2456
+ with, or a network error), or the bundle has no `pdfjs-dist` — they are
2457
+ dependencies of `@nxgt/material-vue`, not optional peers, so this is a bundler
2458
+ configuration that left them out. Nothing is thrown; the next PDF previewed
2459
+ tries again.
2460
+ **Fix:** reload the page after a deploy; otherwise check that your bundler
2461
+ keeps `pdfjs-dist` and pdf.js's worker (see `PdfReader` in
2462
+ [Media & files](components/media-and-files.md#pdfreader)). The same file in a
2463
+ `PdfReader` of its own shows the underlying error. A PDF the reader loaded
2464
+ but cannot open (a corrupt or password-protected file, a URL that answers an
2465
+ error page) is different: the preview stays `ready` and `PdfReader` shows its
2466
+ own error inside it.
2467
+
2468
+ ### `FilePreview` says "This file could not be previewed."
2469
+
2470
+ **When:** a `FilePreview` given a URL, or a file it cannot show, renders that
2471
+ message (and `@error` receives the error).
2472
+ **Why:** a text, JSON, CSV or Markdown URL is fetched with `fetch`: an HTTP
2473
+ error is a `FilePreviewHttpError` with its `status`, and a cross-origin URL
2474
+ without CORS headers is a `TypeError: Failed to fetch`. An image, video or
2475
+ audio file the browser cannot decode (a corrupt file, a codec the browser
2476
+ lacks, a URL that answers an error page) fails in its own element. A URL
2477
+ that is not `http(s):`, relative, `blob:`, or a `data:` URL of an image,
2478
+ video, audio file, plain text, CSV, Markdown, JSON or PDF (`javascript:`,
2479
+ `data:text/html`, and also a `data:` URL of XML, TSV or YAML, though
2480
+ `FilePreview` would show those kinds from a `Blob`) is refused before
2481
+ anything is linked, loaded or fetched: the error is a
2482
+ `FilePreviewUnsafeUrlError`, "Refused to preview a URL with an unsafe scheme", and there is no
2483
+ Download link.
2484
+ **Fix:** serve the file with `Access-Control-Allow-Origin` for your page's
2485
+ origin, or fetch it yourself (with your credentials) and pass the `Blob`;
2486
+ pass `type` when the server answers `application/octet-stream` for a file
2487
+ whose URL has no extension; pass a refused URL's file as a `Blob`, or from
2488
+ an `https:` URL. A text file larger than `max-text-bytes` is not an error: its
2489
+ beginning is shown, with "Showing the first … of this file." below.
2490
+
2382
2491
  ---
2383
2492
 
2384
2493
  ## Reporting a bug
@@ -247,6 +247,8 @@ export const COMPONENT_NAMES = [
247
247
  'FileListFormField',
248
248
  'FileListS3Field',
249
249
  'FileListS3FormField',
250
+ 'FilePreview',
251
+ 'FilesFormField',
250
252
  'Filter',
251
253
  'FilterActions',
252
254
  'FilterChips',
@@ -567,6 +569,8 @@ export const COMPONENT_NAMES = [
567
569
  'TransferListFormField',
568
570
  'Tree',
569
571
  'TreeItem',
572
+ 'TreeSelectField',
573
+ 'TreeSelectFormField',
570
574
  'TrendCard',
571
575
  'Typography',
572
576
  'UploadField',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxgt/material-vue",
3
- "version": "0.24.0",
3
+ "version": "0.25.0",
4
4
  "license": "MIT",
5
5
  "bugs": {
6
6
  "email": "stevegires@gmail.com"
@@ -118,7 +118,7 @@
118
118
  "docs:previews": "vitest run --project previews"
119
119
  },
120
120
  "dependencies": {
121
- "@nxgt/material-core": "^0.2.0",
121
+ "@nxgt/material-core": "^0.3.0",
122
122
  "@floating-ui/dom": "^1.8.0",
123
123
  "@fortawesome/fontawesome-common-types": "7.3.1",
124
124
  "@lucide/vue": "^1.45.0",