@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.
- package/README.md +17 -19
- package/dist/{Button-DOcT4Pej.js → Button-C1aaI0Gw.js} +1 -1
- package/dist/{HoverCardTrigger-WQe85PCH.js → HoverCardTrigger-JtHn0IFQ.js} +2 -2
- package/dist/{camera-BNbLUPb1.js → camera-BacVyXl0.js} +13 -13
- package/dist/{components-YlYuHLEI.js → components-DRBKkOqk.js} +15333 -13879
- package/dist/components.js +8 -8
- package/dist/composables.js +2 -2
- package/dist/dnd.js +1 -1
- package/dist/form-scope-VxlJuvFe.js +43 -0
- package/dist/{i18n-provider-DTuxugHO.js → i18n-provider-D0oYv0XS.js} +1 -1
- package/dist/i18n.js +4 -4
- package/dist/{icon-button-DKLuZ2c-.js → icon-button-B2FQtIHS.js} +1 -1
- package/dist/lib/components/ui/collections/tree/use-tree.d.ts +2 -0
- package/dist/lib/components/ui/dates/date-field/date-field.vue.d.ts +10 -1
- package/dist/lib/components/ui/dates/date-field/date-form-field.vue.d.ts +3 -1
- package/dist/lib/components/ui/dates/date-field/day-matcher.d.ts +26 -0
- package/dist/lib/components/ui/dates/date-field/index.d.ts +1 -0
- package/dist/lib/components/ui/dates/date-field/partials/date-field-content.vue.d.ts +2 -0
- package/dist/lib/components/ui/dates/date-range-field/date-range-field.utils.d.ts +11 -0
- package/dist/lib/components/ui/dates/date-range-field/date-range-field.vue.d.ts +26 -1
- package/dist/lib/components/ui/dates/date-range-field/date-range-form-field.vue.d.ts +3 -1
- package/dist/lib/components/ui/dates/date-range-field/index.d.ts +1 -0
- package/dist/lib/components/ui/dates/date-range-field/partials/date-range-calendar.vue.d.ts +5 -0
- package/dist/lib/components/ui/dates/date-range-field/partials/date-range-field-trigger.vue.d.ts +2 -0
- package/dist/lib/components/ui/dates/date-range-field/partials/date-range-presets.vue.d.ts +12 -0
- package/dist/lib/components/ui/dates/date-range-field/partials/date-range-times.vue.d.ts +13 -0
- package/dist/lib/components/ui/dates/date-range-field/use-date-range-presets.d.ts +23 -0
- package/dist/lib/components/ui/dates/time-picker/time-picker-utils.d.ts +7 -0
- package/dist/lib/components/ui/display/accordion-card/accordion-card.vue.d.ts +29 -1
- package/dist/lib/components/ui/display/avatar/Avatar.vue.d.ts +14 -3
- package/dist/lib/components/ui/display/avatar/index.d.ts +1 -0
- package/dist/lib/components/ui/display/cards/cards.gallery.d.ts +5 -9
- package/dist/lib/components/ui/display/qrcode/qrcode.vue.d.ts +5 -3
- package/dist/lib/components/ui/display/status-indicator/status-tone.d.ts +3 -0
- package/dist/lib/components/ui/feedback/confirmation-dialog/async-form-scope.d.ts +15 -0
- package/dist/lib/components/ui/feedback/confirmation-dialog/confirmation-dialog.vue.d.ts +37 -24
- package/dist/lib/components/ui/feedback/confirmation-dialog/index.d.ts +1 -1
- package/dist/lib/components/ui/feedback/confirmation-dialog/partials/confirmation-dialog-form-error.vue.d.ts +3 -0
- package/dist/lib/components/ui/fields/attributes/form-schema.d.ts +24 -22
- package/dist/lib/components/ui/fields/contacts/consts.d.ts +1 -1
- package/dist/lib/components/ui/fields/number-field/number-field.vue.d.ts +2 -0
- package/dist/lib/components/ui/fields/slider/partials/slider-field-row.vue.d.ts +32 -0
- package/dist/lib/components/ui/fields/slider/slider-field.vue.d.ts +22 -1
- package/dist/lib/components/ui/fields/slider/slider-form-field.vue.d.ts +13 -1
- package/dist/lib/components/ui/forms/form-scope-schema.d.ts +43 -0
- package/dist/lib/components/ui/forms/form-scope.vue.d.ts +33 -0
- package/dist/lib/components/ui/media/file-preview/file-preview-pdf.lazy.d.ts +8 -0
- package/dist/lib/components/ui/media/file-preview/file-preview.vue.d.ts +9 -0
- package/dist/lib/components/ui/media/file-preview/index.d.ts +3 -0
- package/dist/lib/components/ui/media/file-preview/partials/file-preview-body.vue.d.ts +21 -0
- package/dist/lib/components/ui/media/file-preview/partials/file-preview-card.vue.d.ts +15 -0
- package/dist/lib/components/ui/media/file-preview/partials/file-preview-download.vue.d.ts +11 -0
- package/dist/lib/components/ui/media/file-preview/partials/file-preview-media.vue.d.ts +17 -0
- package/dist/lib/components/ui/media/file-preview/partials/file-preview-pdf.vue.d.ts +21 -0
- package/dist/lib/components/ui/media/file-preview/partials/file-preview-status.vue.d.ts +22 -0
- package/dist/lib/components/ui/media/file-preview/partials/file-preview-text.vue.d.ts +16 -0
- package/dist/lib/components/ui/media/file-preview/types.d.ts +19 -0
- package/dist/lib/components/ui/media/file-preview/use-file-preview.d.ts +21 -0
- package/dist/lib/components/ui/media/file-preview/use-text-preview.d.ts +17 -0
- package/dist/lib/components/ui/media/files-form-field/files-form-field.vue.d.ts +29 -0
- package/dist/lib/components/ui/media/files-form-field/index.d.ts +2 -0
- package/dist/lib/components/ui/media/image-cropper/partials/image-cropper-canvas.vue.d.ts +1 -1
- package/dist/lib/components/ui/media/index.d.ts +2 -0
- package/dist/lib/components/ui/media/pdf-viewer/partials/pdf-page.vue.d.ts +1 -1
- package/dist/lib/components/ui/media/pdf-viewer/partials/pdf-reader-body.vue.d.ts +2 -2
- package/dist/lib/components/ui/media/upload/network-upload-field/use-image-preview.d.ts +9 -1
- package/dist/lib/components/ui/primitives/tabs/Tabs.vue.d.ts +3 -0
- package/dist/lib/components/ui/primitives/tabs/index.d.ts +1 -0
- package/dist/lib/components/ui/primitives/tabs/tabs-variant.d.ts +9 -0
- package/dist/lib/components/ui/selection/autocomplete/autocomplete-form-field.vue.d.ts +31 -5
- package/dist/lib/components/ui/selection/autocomplete/autocomplete-items.d.ts +23 -0
- package/dist/lib/components/ui/selection/autocomplete/autocomplete.vue.d.ts +48 -13
- package/dist/lib/components/ui/selection/autocomplete/filter-options.d.ts +2 -1
- package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-box.vue.d.ts +13 -1
- package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-list.vue.d.ts +17 -3
- package/dist/lib/components/ui/selection/autocomplete/use-autocomplete-items.d.ts +15 -0
- package/dist/lib/components/ui/selection/autocomplete/use-autocomplete-open.d.ts +15 -0
- package/dist/lib/components/ui/selection/autocomplete/use-autocomplete-texts.d.ts +14 -0
- package/dist/lib/components/ui/selection/autocomplete/use-autocomplete.d.ts +34 -0
- package/dist/lib/components/ui/selection/index.d.ts +1 -0
- package/dist/lib/components/ui/selection/select-field/select-field.vue.d.ts +16 -1
- package/dist/lib/components/ui/selection/select-field/select-form-field.vue.d.ts +16 -2
- package/dist/lib/components/ui/selection/tree-select-field/index.d.ts +3 -0
- package/dist/lib/components/ui/selection/tree-select-field/partials/tree-select-panel.vue.d.ts +27 -0
- package/dist/lib/components/ui/selection/tree-select-field/partials/tree-select-trigger.vue.d.ts +28 -0
- package/dist/lib/components/ui/selection/tree-select-field/tree-select-field.vue.d.ts +8 -0
- package/dist/lib/components/ui/selection/tree-select-field/tree-select-form-field.vue.d.ts +8 -0
- package/dist/lib/components/ui/selection/tree-select-field/tree-select.utils.d.ts +29 -0
- package/dist/lib/components/ui/selection/tree-select-field/types.d.ts +28 -0
- package/dist/lib/components/ui/selection/tree-select-field/use-tree-select-field.d.ts +19 -0
- package/dist/lib/components/ui/widgets/code-editor/code-editor-options.d.ts +4 -1
- package/dist/lib/components/ui/widgets/code-editor/code-editor.vue.d.ts +7 -0
- package/dist/lib/components/ui/widgets/code-editor/index.d.ts +1 -0
- package/dist/lib/components/ui/widgets/code-editor/monaco-editor.vue.d.ts +3 -0
- package/dist/lib/i18n/resources/en/en.d.ts +33 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +36 -3
- package/dist/lib/i18n/resources/fr/fr.d.ts +33 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +36 -3
- package/dist/lib/i18n/resources/resources.d.ts +66 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib/nuxt/component-names.d.ts +1 -1
- package/dist/lib.js +2 -2
- package/dist/main.js +17 -17
- package/dist/map.js +4 -4
- package/dist/material-vue.css +1 -1
- package/dist/{pdf-outline-sidebar-0I-LGrgY.js → pdf-outline-sidebar-jJfhNjnN.js} +2 -2
- package/dist/{pdf-page-C74-6lyZ.js → pdf-page-BW1hXzPu.js} +1 -1
- package/dist/{pdf-page-list-DPsquYPY.js → pdf-page-list-D277RtWS.js} +2 -2
- package/dist/{pdf-reader-Bkpp7UZ7.js → pdf-reader-BReUTsn_.js} +73 -71
- package/dist/{pdf-sidebar-BH-1jvy-.js → pdf-sidebar-Bk6PowY1.js} +3 -3
- package/dist/{pdf-thumbnail-sidebar-ByqNaYfz.js → pdf-thumbnail-sidebar-BcNDFsks.js} +3 -3
- package/dist/{pdf-toolbar-BRnmzddi.js → pdf-toolbar-CHjaMhH9.js} +4 -4
- package/dist/pdf.js +2 -2
- package/dist/{sortable-provider-CC9eO1nm.js → sortable-provider-C83VBfGl.js} +2 -2
- package/dist/{stored-language-N_UoPJsY.js → stored-language-CC_vdcCN.js} +72 -6
- package/dist/{stx-player-BGKIDqNX.js → stx-player-BMQ1D2Li.js} +20 -20
- package/dist/{translator-CU0jKvzB.js → translator-B-X_1taI.js} +1 -1
- package/dist/{use-heading-spy-Bw1LIAkC.js → use-heading-spy-C_ySuvTl.js} +1 -1
- package/dist/{use-material-translation-8hUB2M-S.js → use-material-translation-B6sIk0mF.js} +3 -3
- package/docs/components/README.md +2 -1
- package/docs/components/data-display.md +51 -10
- package/docs/components/data-table-filter-and-lists.md +4 -0
- package/docs/components/date-and-time.md +116 -9
- package/docs/components/feedback-and-status.md +56 -4
- package/docs/components/form-fields.md +15 -5
- package/docs/components/media-and-files.md +119 -5
- package/docs/components/navigation-and-layout.md +2 -1
- package/docs/components/primitives.md +21 -4
- package/docs/components/rich-widgets.md +20 -3
- package/docs/components/selection-and-choice.md +135 -9
- package/docs/guides/forms.md +3 -4
- package/docs/guides/i18n.md +44 -4
- package/docs/previews/date-time-daterangefield.webp +0 -0
- package/docs/previews/media-files-filepreview.webp +0 -0
- package/docs/previews/selection-choice-treeselectfield.webp +0 -0
- package/docs/roadmap.md +43 -37
- package/docs/troubleshooting.md +110 -1
- package/lib/nuxt/component-names.ts +4 -0
- 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
|
-
- **
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- **
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
- **
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
`
|
|
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
|
package/docs/troubleshooting.md
CHANGED
|
@@ -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.
|
|
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.
|
|
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",
|