@nxgt/material-vue 0.23.4 → 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 (182) hide show
  1. package/README.md +30 -28
  2. package/dist/{Button-CVIR6uLK.js → Button-C1aaI0Gw.js} +95 -72
  3. package/dist/{HoverCardTrigger-iAL5ALrL.js → HoverCardTrigger-JtHn0IFQ.js} +2 -2
  4. package/dist/{camera-Gvg5N956.js → camera-BacVyXl0.js} +6 -6
  5. package/dist/{components-AScwCcds.js → components-DRBKkOqk.js} +15764 -13833
  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-BqWxpaKu.js → i18n-provider-D0oYv0XS.js} +1 -1
  11. package/dist/i18n.js +4 -4
  12. package/dist/{icon-button-DbEME76t.js → icon-button-B2FQtIHS.js} +34 -37
  13. package/dist/lib/components/ui/actions/button/has-text-content.d.ts +10 -0
  14. package/dist/lib/components/ui/actions/copy-button/copy-value.vue.d.ts +21 -0
  15. package/dist/lib/components/ui/actions/copy-button/index.d.ts +2 -0
  16. package/dist/lib/components/ui/collections/data-table/data-table-context.d.ts +6 -0
  17. package/dist/lib/components/ui/collections/data-table/data-table-pagination.vue.d.ts +2 -0
  18. package/dist/lib/components/ui/collections/data-table/data-table.vue.d.ts +17 -27
  19. package/dist/lib/components/ui/collections/data-table/index.d.ts +1 -1
  20. package/dist/lib/components/ui/collections/data-table/partials/data-table-body.vue.d.ts +10 -1
  21. package/dist/lib/components/ui/collections/data-table/partials/data-table-empty.vue.d.ts +13 -1
  22. package/dist/lib/components/ui/collections/data-table/partials/data-table-head.vue.d.ts +22 -0
  23. package/dist/lib/components/ui/collections/data-table/partials/data-table-skeleton-rows.vue.d.ts +10 -0
  24. package/dist/lib/components/ui/collections/data-table/use-data-table.d.ts +17 -0
  25. package/dist/lib/components/ui/collections/filter/partials/filter-field-slider-range.vue.d.ts +1 -4
  26. package/dist/lib/components/ui/collections/pagination/index.d.ts +5 -0
  27. package/dist/lib/components/ui/collections/pagination/pagination-bar.vue.d.ts +21 -0
  28. package/dist/lib/components/ui/collections/pagination/pagination-items.d.ts +2 -0
  29. package/dist/lib/components/ui/collections/pagination/pagination-link.vue.d.ts +18 -0
  30. package/dist/lib/components/ui/collections/tree/use-tree.d.ts +2 -0
  31. package/dist/lib/components/ui/dates/date-field/date-field.vue.d.ts +10 -1
  32. package/dist/lib/components/ui/dates/date-field/date-form-field.vue.d.ts +3 -1
  33. package/dist/lib/components/ui/dates/date-field/day-matcher.d.ts +26 -0
  34. package/dist/lib/components/ui/dates/date-field/index.d.ts +1 -0
  35. package/dist/lib/components/ui/dates/date-field/partials/date-field-content.vue.d.ts +2 -0
  36. package/dist/lib/components/ui/dates/date-range-field/date-range-field.utils.d.ts +11 -0
  37. package/dist/lib/components/ui/dates/date-range-field/date-range-field.vue.d.ts +26 -1
  38. package/dist/lib/components/ui/dates/date-range-field/date-range-form-field.vue.d.ts +3 -1
  39. package/dist/lib/components/ui/dates/date-range-field/index.d.ts +1 -0
  40. package/dist/lib/components/ui/dates/date-range-field/partials/date-range-calendar.vue.d.ts +5 -0
  41. package/dist/lib/components/ui/dates/date-range-field/partials/date-range-field-trigger.vue.d.ts +2 -0
  42. package/dist/lib/components/ui/dates/date-range-field/partials/date-range-presets.vue.d.ts +12 -0
  43. package/dist/lib/components/ui/dates/date-range-field/partials/date-range-times.vue.d.ts +13 -0
  44. package/dist/lib/components/ui/dates/date-range-field/use-date-range-presets.d.ts +23 -0
  45. package/dist/lib/components/ui/dates/time-picker/time-picker-utils.d.ts +7 -0
  46. package/dist/lib/components/ui/display/accordion-card/accordion-card.vue.d.ts +29 -1
  47. package/dist/lib/components/ui/display/avatar/Avatar.vue.d.ts +14 -3
  48. package/dist/lib/components/ui/display/avatar/index.d.ts +1 -0
  49. package/dist/lib/components/ui/display/cards/cards.gallery.d.ts +5 -9
  50. package/dist/lib/components/ui/display/markdown/index.d.ts +18 -0
  51. package/dist/lib/components/ui/display/qrcode/qrcode.vue.d.ts +5 -3
  52. package/dist/lib/components/ui/display/status-indicator/status-tone.d.ts +3 -0
  53. package/dist/lib/components/ui/feedback/confirmation-dialog/async-form-scope.d.ts +15 -0
  54. package/dist/lib/components/ui/feedback/confirmation-dialog/confirmation-dialog.vue.d.ts +37 -24
  55. package/dist/lib/components/ui/feedback/confirmation-dialog/index.d.ts +1 -1
  56. package/dist/lib/components/ui/feedback/confirmation-dialog/partials/confirmation-dialog-form-error.vue.d.ts +3 -0
  57. package/dist/lib/components/ui/feedback/skeleton/skeleton-text.vue.d.ts +1 -1
  58. package/dist/lib/components/ui/feedback/spinner/spinner.compound-variants.d.ts +4 -0
  59. package/dist/lib/components/ui/fields/attributes/form-schema.d.ts +24 -22
  60. package/dist/lib/components/ui/fields/contacts/consts.d.ts +1 -1
  61. package/dist/lib/components/ui/fields/inline-edit/index.d.ts +1 -0
  62. package/dist/lib/components/ui/fields/inline-edit/inline-edit-form-field.vue.d.ts +7 -0
  63. package/dist/lib/components/ui/fields/number-field/number-field.vue.d.ts +2 -0
  64. package/dist/lib/components/ui/fields/slider/partials/slider-field-row.vue.d.ts +32 -0
  65. package/dist/lib/components/ui/fields/slider/slider-field.vue.d.ts +22 -1
  66. package/dist/lib/components/ui/fields/slider/slider-form-field.vue.d.ts +13 -1
  67. package/dist/lib/components/ui/forms/form-scope-schema.d.ts +43 -0
  68. package/dist/lib/components/ui/forms/form-scope.vue.d.ts +33 -0
  69. package/dist/lib/components/ui/layout/doc/doc.vue.d.ts +5 -5
  70. package/dist/lib/components/ui/layout/doc/index.d.ts +8 -1
  71. package/dist/lib/components/ui/layout/doc/partials/default-doc-link.vue.d.ts +14 -0
  72. package/dist/lib/components/ui/layout/doc/partials/doc-copy-page.vue.d.ts +6 -0
  73. package/dist/lib/components/ui/layout/doc/partials/doc-link.vue.d.ts +3 -7
  74. package/dist/lib/components/ui/layout/doc/types.d.ts +6 -1
  75. package/dist/lib/components/ui/media/file-preview/file-preview-pdf.lazy.d.ts +8 -0
  76. package/dist/lib/components/ui/media/file-preview/file-preview.vue.d.ts +9 -0
  77. package/dist/lib/components/ui/media/file-preview/index.d.ts +3 -0
  78. package/dist/lib/components/ui/media/file-preview/partials/file-preview-body.vue.d.ts +21 -0
  79. package/dist/lib/components/ui/media/file-preview/partials/file-preview-card.vue.d.ts +15 -0
  80. package/dist/lib/components/ui/media/file-preview/partials/file-preview-download.vue.d.ts +11 -0
  81. package/dist/lib/components/ui/media/file-preview/partials/file-preview-media.vue.d.ts +17 -0
  82. package/dist/lib/components/ui/media/file-preview/partials/file-preview-pdf.vue.d.ts +21 -0
  83. package/dist/lib/components/ui/media/file-preview/partials/file-preview-status.vue.d.ts +22 -0
  84. package/dist/lib/components/ui/media/file-preview/partials/file-preview-text.vue.d.ts +16 -0
  85. package/dist/lib/components/ui/media/file-preview/types.d.ts +19 -0
  86. package/dist/lib/components/ui/media/file-preview/use-file-preview.d.ts +21 -0
  87. package/dist/lib/components/ui/media/file-preview/use-text-preview.d.ts +17 -0
  88. package/dist/lib/components/ui/media/files-form-field/files-form-field.vue.d.ts +29 -0
  89. package/dist/lib/components/ui/media/files-form-field/index.d.ts +2 -0
  90. package/dist/lib/components/ui/media/image-cropper/partials/image-cropper-canvas.vue.d.ts +1 -1
  91. package/dist/lib/components/ui/media/index.d.ts +2 -0
  92. package/dist/lib/components/ui/media/pdf-viewer/index.d.ts +6 -6
  93. package/dist/lib/components/ui/media/pdf-viewer/partials/pdf-page.vue.d.ts +1 -1
  94. package/dist/lib/components/ui/media/pdf-viewer/partials/pdf-reader-body.vue.d.ts +2 -2
  95. package/dist/lib/components/ui/media/pdf-viewer/pdf-reader.vue.d.ts +2 -2
  96. package/dist/lib/components/ui/media/upload/network-upload-field/use-image-preview.d.ts +9 -1
  97. package/dist/lib/components/ui/primitives/icon/icon-context.d.ts +1 -1
  98. package/dist/lib/components/ui/primitives/tabs/Tabs.vue.d.ts +3 -0
  99. package/dist/lib/components/ui/primitives/tabs/index.d.ts +1 -0
  100. package/dist/lib/components/ui/primitives/tabs/tabs-variant.d.ts +9 -0
  101. package/dist/lib/components/ui/selection/autocomplete/autocomplete-form-field.vue.d.ts +31 -5
  102. package/dist/lib/components/ui/selection/autocomplete/autocomplete-items.d.ts +23 -0
  103. package/dist/lib/components/ui/selection/autocomplete/autocomplete.vue.d.ts +48 -13
  104. package/dist/lib/components/ui/selection/autocomplete/filter-options.d.ts +2 -1
  105. package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-box.vue.d.ts +13 -1
  106. package/dist/lib/components/ui/selection/autocomplete/partials/autocomplete-list.vue.d.ts +17 -3
  107. package/dist/lib/components/ui/selection/autocomplete/use-autocomplete-items.d.ts +15 -0
  108. package/dist/lib/components/ui/selection/autocomplete/use-autocomplete-open.d.ts +15 -0
  109. package/dist/lib/components/ui/selection/autocomplete/use-autocomplete-texts.d.ts +14 -0
  110. package/dist/lib/components/ui/selection/autocomplete/use-autocomplete.d.ts +34 -0
  111. package/dist/lib/components/ui/selection/checkbox/Checkbox.vue.d.ts +21 -5
  112. package/dist/lib/components/ui/selection/checkbox/checkbox-form-field.vue.d.ts +17 -0
  113. package/dist/lib/components/ui/selection/checkbox/index.d.ts +2 -0
  114. package/dist/lib/components/ui/selection/index.d.ts +1 -0
  115. package/dist/lib/components/ui/selection/select-field/select-field.vue.d.ts +16 -1
  116. package/dist/lib/components/ui/selection/select-field/select-form-field.vue.d.ts +16 -2
  117. package/dist/lib/components/ui/selection/tree-select-field/index.d.ts +3 -0
  118. package/dist/lib/components/ui/selection/tree-select-field/partials/tree-select-panel.vue.d.ts +27 -0
  119. package/dist/lib/components/ui/selection/tree-select-field/partials/tree-select-trigger.vue.d.ts +28 -0
  120. package/dist/lib/components/ui/selection/tree-select-field/tree-select-field.vue.d.ts +8 -0
  121. package/dist/lib/components/ui/selection/tree-select-field/tree-select-form-field.vue.d.ts +8 -0
  122. package/dist/lib/components/ui/selection/tree-select-field/tree-select.utils.d.ts +29 -0
  123. package/dist/lib/components/ui/selection/tree-select-field/types.d.ts +28 -0
  124. package/dist/lib/components/ui/selection/tree-select-field/use-tree-select-field.d.ts +19 -0
  125. package/dist/lib/components/ui/widgets/charts/chart-container.vue.d.ts +1 -1
  126. package/dist/lib/components/ui/widgets/code-editor/code-editor-form-field.vue.d.ts +13 -0
  127. package/dist/lib/components/ui/widgets/code-editor/code-editor-options.d.ts +4 -1
  128. package/dist/lib/components/ui/widgets/code-editor/code-editor.vue.d.ts +7 -0
  129. package/dist/lib/components/ui/widgets/code-editor/index.d.ts +2 -0
  130. package/dist/lib/components/ui/widgets/code-editor/monaco-editor.vue.d.ts +3 -0
  131. package/dist/lib/i18n/resources/en/en.d.ts +40 -0
  132. package/dist/lib/i18n/resources/en/material.json.d.ts +43 -3
  133. package/dist/lib/i18n/resources/fr/fr.d.ts +40 -0
  134. package/dist/lib/i18n/resources/fr/material.json.d.ts +43 -3
  135. package/dist/lib/i18n/resources/resources.d.ts +80 -0
  136. package/dist/lib/i18n/translator.d.ts +1 -1
  137. package/dist/lib/nuxt/component-names.d.ts +1 -1
  138. package/dist/lib.js +2 -2
  139. package/dist/main.js +17 -17
  140. package/dist/map.js +4 -4
  141. package/dist/material-vue.css +1 -1
  142. package/dist/{pdf-outline-sidebar-oz9wdBhB.js → pdf-outline-sidebar-jJfhNjnN.js} +2 -2
  143. package/dist/{pdf-page-0rlq1Lo6.js → pdf-page-BW1hXzPu.js} +1 -1
  144. package/dist/{pdf-page-list-DfhjNHoI.js → pdf-page-list-D277RtWS.js} +2 -2
  145. package/dist/{pdf-reader-Dr8RVcs4.js → pdf-reader-BReUTsn_.js} +73 -71
  146. package/dist/{pdf-sidebar-VXPQbC_R.js → pdf-sidebar-Bk6PowY1.js} +3 -3
  147. package/dist/{pdf-thumbnail-sidebar-BpgXrVBj.js → pdf-thumbnail-sidebar-BcNDFsks.js} +3 -3
  148. package/dist/{pdf-toolbar-B6gRRcsv.js → pdf-toolbar-CHjaMhH9.js} +4 -4
  149. package/dist/pdf.js +2 -2
  150. package/dist/{sortable-provider-oEVjQiCl.js → sortable-provider-C83VBfGl.js} +2 -2
  151. package/dist/{stored-language-rjOMJkyX.js → stored-language-CC_vdcCN.js} +90 -6
  152. package/dist/{stx-player-DNADkQ31.js → stx-player-BMQ1D2Li.js} +20 -20
  153. package/dist/{translator-BCSJSO1-.js → translator-B-X_1taI.js} +1 -1
  154. package/dist/{use-heading-spy-d50_nxgR.js → use-heading-spy-C_ySuvTl.js} +1 -1
  155. package/dist/{use-material-translation-C5zPFhbk.js → use-material-translation-B6sIk0mF.js} +3 -3
  156. package/docs/components/README.md +2 -1
  157. package/docs/components/buttons-and-actions.md +19 -3
  158. package/docs/components/data-display.md +65 -11
  159. package/docs/components/data-table-filter-and-lists.md +94 -8
  160. package/docs/components/date-and-time.md +116 -9
  161. package/docs/components/feedback-and-status.md +57 -5
  162. package/docs/components/form-fields.md +21 -9
  163. package/docs/components/media-and-files.md +120 -6
  164. package/docs/components/navigation-and-layout.md +68 -7
  165. package/docs/components/primitives.md +25 -6
  166. package/docs/components/rich-widgets.md +21 -3
  167. package/docs/components/selection-and-choice.md +151 -22
  168. package/docs/guides/forms.md +16 -8
  169. package/docs/guides/i18n.md +50 -6
  170. package/docs/guides/ssr.md +2 -0
  171. package/docs/previews/buttons-actions-copybutton.webp +0 -0
  172. package/docs/previews/data-table-filter-lists-pagination.webp +0 -0
  173. package/docs/previews/date-time-daterangefield.webp +0 -0
  174. package/docs/previews/form-fields-slider.webp +0 -0
  175. package/docs/previews/media-files-filepreview.webp +0 -0
  176. package/docs/previews/navigation-layout-stepper.webp +0 -0
  177. package/docs/previews/selection-choice-checkbox.webp +0 -0
  178. package/docs/previews/selection-choice-treeselectfield.webp +0 -0
  179. package/docs/roadmap.md +47 -1
  180. package/docs/troubleshooting.md +213 -0
  181. package/lib/nuxt/component-names.ts +16 -0
  182. package/package.json +2 -2
@@ -0,0 +1,11 @@
1
+ /**
2
+ * A link that saves the file under `name` (the browser's choice when `''`).
3
+ * Nothing until `href` is known.
4
+ */
5
+ type __VLS_Props = {
6
+ href: string | undefined;
7
+ name: string;
8
+ };
9
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * An image, a video or an audio file in the browser's own element: `<img>`
3
+ * named by the file name, `<video controls>` and `<audio controls>` labelled
4
+ * with it. `error` when the element cannot load `src`.
5
+ */
6
+ type __VLS_Props = {
7
+ kind: 'image' | 'video' | 'audio';
8
+ src: string;
9
+ name: string;
10
+ };
11
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
12
+ error: () => any;
13
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
14
+ onError?: (() => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * A PDF in `PdfReader`, loaded lazily (after mount: never on a server); the
3
+ * `fallback` slot (the file card) when the viewer cannot be loaded.
4
+ */
5
+ type __VLS_Props = {
6
+ file: Blob | string;
7
+ fileName: string;
8
+ };
9
+ declare var __VLS_1: {};
10
+ type __VLS_Slots = {} & {
11
+ fallback?: (props: typeof __VLS_1) => any;
12
+ };
13
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
14
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
17
+ type __VLS_WithSlots<T, S> = T & {
18
+ new (): {
19
+ $slots: S;
20
+ };
21
+ };
@@ -0,0 +1,22 @@
1
+ /**
2
+ * `pending`: the server's and the pre-mount box, with no text, nothing to
3
+ * mismatch. `loading`: a spinner and its message, seen only (the figure's
4
+ * live region is what is heard). `error`: the message, and in the slot
5
+ * whatever can still be done (a download).
6
+ */
7
+ type __VLS_Props = {
8
+ state: 'pending' | 'loading' | 'error';
9
+ };
10
+ declare var __VLS_11: {};
11
+ type __VLS_Slots = {} & {
12
+ default?: (props: typeof __VLS_11) => any;
13
+ };
14
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
15
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
16
+ declare const _default: typeof __VLS_export;
17
+ export default _default;
18
+ type __VLS_WithSlots<T, S> = T & {
19
+ new (): {
20
+ $slots: S;
21
+ };
22
+ };
@@ -0,0 +1,16 @@
1
+ import { FileKind, TextPreview } from '@nxgt/material-core/file-preview';
2
+ /**
3
+ * A text kind's content: JSON in `JsonViewer` and Markdown rendered when the
4
+ * whole file was read, else (and for text and CSV) as it is, in a `<pre>`.
5
+ * What scrolls is a region named after the file, and takes focus so a
6
+ * keyboard can scroll it.
7
+ */
8
+ type __VLS_Props = {
9
+ kind: FileKind;
10
+ name: string;
11
+ preview: TextPreview;
12
+ maxBytes: number;
13
+ };
14
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import { FilePreviewSource } from '@nxgt/material-core/file-preview';
2
+ import { HTMLAttributes } from 'vue';
3
+ /** Where a preview is: server or first render, reading, shown, failed. */
4
+ export type FilePreviewStatus = 'pending' | 'loading' | 'ready' | 'error';
5
+ export type FilePreviewProps = {
6
+ /**
7
+ * The file: a `File` or `Blob`, or a URL. Nothing renders without one. A
8
+ * URL must be `http(s):`, relative, `blob:`, or a `data:` URL of an
9
+ * image, video, audio, plain text, CSV, Markdown, JSON or PDF; any other (`javascript:`, …) shows the error state.
10
+ */
11
+ file: FilePreviewSource | null | undefined;
12
+ /** MIME type; overrides the `Blob`'s. Picks the kind before the extension does. */
13
+ type?: string;
14
+ /** Name shown, used as the image's alt text and the download's file name; overrides the `File`'s. */
15
+ name?: string;
16
+ /** How much of a text, JSON, CSV or Markdown file is read and shown. 256 KB by default. */
17
+ maxTextBytes?: number;
18
+ class?: HTMLAttributes['class'];
19
+ };
@@ -0,0 +1,21 @@
1
+ import { DescribedFile } from '@nxgt/material-core/file-preview';
2
+ import { ComputedRef, Ref } from 'vue';
3
+ import { FilePreviewProps, FilePreviewStatus } from './types';
4
+ import { TextPreviewState } from './use-text-preview';
5
+ export type FilePreviewState = {
6
+ described: ComputedRef<DescribedFile | null>;
7
+ status: ComputedRef<FilePreviewStatus>;
8
+ /** What the media element and the download link point at, once known. */
9
+ href: ComputedRef<string | undefined>;
10
+ text: Ref<TextPreviewState>;
11
+ /** For an `<img>`, `<video>` or `<audio>` that failed to load `href`. */
12
+ onMediaError: () => void;
13
+ };
14
+ /**
15
+ * Everything `FilePreview` decides: the file's kind, the object URL of a
16
+ * `Blob` (made after mount, revoked on change and unmount), the text of a
17
+ * text kind, and the status. On a server and before mount the status is
18
+ * `'pending'` and nothing is read; a URL `safePreviewUrl` refuses is
19
+ * `'error'` everywhere and is never used. `onError` is called once per failure.
20
+ */
21
+ export declare function useFilePreview(props: FilePreviewProps, onError: (error: unknown) => void): FilePreviewState;
@@ -0,0 +1,17 @@
1
+ import { TextPreview } from '@nxgt/material-core/file-preview';
2
+ import { Ref } from 'vue';
3
+ export type TextPreviewState = {
4
+ status: 'loading';
5
+ } | {
6
+ status: 'ready';
7
+ preview: TextPreview;
8
+ } | {
9
+ status: 'error';
10
+ error: unknown;
11
+ };
12
+ /**
13
+ * The first `maxBytes` of `source` as text, read once `source` is defined
14
+ * (the caller leaves it `undefined` until mounted: never on a server). A new
15
+ * source aborts the previous read.
16
+ */
17
+ export declare function useTextPreview(source: () => Blob | string | undefined, maxBytes: () => number | undefined): Ref<TextPreviewState>;
@@ -0,0 +1,29 @@
1
+ import { AutocompleteOption, AutocompleteProps } from '../../selection/autocomplete/autocomplete.vue';
2
+ export type FilesFormFieldProps<T extends AutocompleteOption = AutocompleteOption> = {
3
+ name: string;
4
+ } & Omit<AutocompleteProps<T>, 'modelValue' | 'error' | 'name' | 'options'> & {
5
+ /** Shows each selected file as a thumbnail rather than a file icon. */
6
+ image?: boolean;
7
+ /** Builds the thumbnail's URL from a value (a key, a path). Defaults to the value. */
8
+ imageLinkBuilder?: (image: string) => string;
9
+ /** Files to pick from; any URL can be typed too (`freeSolo`). */
10
+ options?: T[];
11
+ };
12
+ declare const __VLS_export: <T extends AutocompleteOption = AutocompleteOption>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
13
+ props: import('vue').PublicProps & __VLS_PrettifyLocal<FilesFormFieldProps<T>> & (typeof globalThis extends {
14
+ __VLS_PROPS_FALLBACK: infer P;
15
+ } ? P : {});
16
+ expose: (exposed: {}) => void;
17
+ attrs: any;
18
+ slots: {};
19
+ emit: {};
20
+ }>) => import('vue').VNode & {
21
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
22
+ };
23
+ declare const _default: typeof __VLS_export;
24
+ export default _default;
25
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
26
+ [K in keyof T]: T[K];
27
+ } : {
28
+ [K in keyof T as K]: T[K];
29
+ }) & {};
@@ -0,0 +1,2 @@
1
+ export type { FilesFormFieldProps } from './files-form-field.vue';
2
+ export { default as FilesFormField } from './files-form-field.vue';
@@ -12,8 +12,8 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {
12
12
  onChange?: ((value: ImageCropperCanvasChange) => any) | undefined;
13
13
  }>, {
14
14
  zoom: number;
15
- cropShape: ImageCropShape;
16
15
  rotation: number;
16
+ cropShape: ImageCropShape;
17
17
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
18
18
  declare const _default: typeof __VLS_export;
19
19
  export default _default;
@@ -1,6 +1,8 @@
1
1
  export * from './camera';
2
2
  export * from './carousel';
3
3
  export * from './file-list';
4
+ export * from './file-preview';
5
+ export * from './files-form-field';
4
6
  export * from './galleries';
5
7
  export * from './image-cropper';
6
8
  export * from './image-field';
@@ -91,13 +91,13 @@ export declare const PdfToolbar: import('vue').DefineComponent<import('.').PdfTo
91
91
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
92
92
  export type { PdfReaderProps } from './types';
93
93
  export declare const PdfReader: import('vue').Component<import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./types').PdfReaderProps> & Readonly<{
94
+ onPageChange?: ((page: number) => any) | undefined;
94
95
  onLoadSuccess?: ((numPages: number) => any) | undefined;
95
96
  onLoadError?: ((error: Error) => any) | undefined;
96
- onPageChange?: ((page: number) => any) | undefined;
97
97
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
98
+ pageChange: (page: number) => any;
98
99
  loadSuccess: (numPages: number) => any;
99
100
  loadError: (error: Error) => any;
100
- pageChange: (page: number) => any;
101
101
  }, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
102
102
  P: {};
103
103
  B: {};
@@ -106,19 +106,19 @@ export declare const PdfReader: import('vue').Component<import('vue').CreateComp
106
106
  M: {};
107
107
  Defaults: {};
108
108
  }, Readonly<import('./types').PdfReaderProps> & Readonly<{
109
+ onPageChange?: ((page: number) => any) | undefined;
109
110
  onLoadSuccess?: ((numPages: number) => any) | undefined;
110
111
  onLoadError?: ((error: Error) => any) | undefined;
111
- onPageChange?: ((page: number) => any) | undefined;
112
112
  }>, {}, {}, {}, {}, {}>>;
113
113
  /** @deprecated Use PdfReader instead */
114
114
  export declare const PdfViewer: import('vue').Component<import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./types').PdfReaderProps> & Readonly<{
115
+ onPageChange?: ((page: number) => any) | undefined;
115
116
  onLoadSuccess?: ((numPages: number) => any) | undefined;
116
117
  onLoadError?: ((error: Error) => any) | undefined;
117
- onPageChange?: ((page: number) => any) | undefined;
118
118
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
119
+ pageChange: (page: number) => any;
119
120
  loadSuccess: (numPages: number) => any;
120
121
  loadError: (error: Error) => any;
121
- pageChange: (page: number) => any;
122
122
  }, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
123
123
  P: {};
124
124
  B: {};
@@ -127,9 +127,9 @@ export declare const PdfViewer: import('vue').Component<import('vue').CreateComp
127
127
  M: {};
128
128
  Defaults: {};
129
129
  }, Readonly<import('./types').PdfReaderProps> & Readonly<{
130
+ onPageChange?: ((page: number) => any) | undefined;
130
131
  onLoadSuccess?: ((numPages: number) => any) | undefined;
131
132
  onLoadError?: ((error: Error) => any) | undefined;
132
- onPageChange?: ((page: number) => any) | undefined;
133
133
  }>, {}, {}, {}, {}, {}>>;
134
134
  export type { PdfjsSourceParams, PdfjsUrlParams, PdfSource, PdfUrlSource, } from '@nxgt/material-core/pdf-source';
135
135
  export { toPdfjsParams, toPdfjsSource } from '@nxgt/material-core/pdf-source';
@@ -24,10 +24,10 @@ type __VLS_Props = {
24
24
  };
25
25
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
26
26
  renderText: boolean;
27
- eager: boolean;
28
27
  searchQuery: string;
29
28
  nightMode: boolean;
30
29
  isCurrent: boolean;
30
+ eager: boolean;
31
31
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
32
32
  declare const _default: typeof __VLS_export;
33
33
  export default _default;
@@ -14,20 +14,20 @@ type __VLS_Props = {
14
14
  };
15
15
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
16
16
  goToPage: (page: number) => any;
17
- setOutline: (outline: PdfOutlineNode[]) => any;
18
17
  loadSuccess: (pdf: PdfSizedDocument) => any;
19
18
  loadError: (error: Error) => any;
20
19
  passwordProtected: (incorrect: boolean) => any;
21
20
  passwordSubmit: () => any;
21
+ setOutline: (outline: PdfOutlineNode[]) => any;
22
22
  "set-sidebar-tab": (tab: import('..').PdfSidebarTab) => any;
23
23
  documentChange: (pdf: import('pdfjs-dist/types/src/display/api').PDFDocumentProxy | null) => any;
24
24
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
25
25
  onGoToPage?: ((page: number) => any) | undefined;
26
- onSetOutline?: ((outline: PdfOutlineNode[]) => any) | undefined;
27
26
  onLoadSuccess?: ((pdf: PdfSizedDocument) => any) | undefined;
28
27
  onLoadError?: ((error: Error) => any) | undefined;
29
28
  onPasswordProtected?: ((incorrect: boolean) => any) | undefined;
30
29
  onPasswordSubmit?: (() => any) | undefined;
30
+ onSetOutline?: ((outline: PdfOutlineNode[]) => any) | undefined;
31
31
  "onSet-sidebar-tab"?: ((tab: import('..').PdfSidebarTab) => any) | undefined;
32
32
  onDocumentChange?: ((pdf: import('pdfjs-dist/types/src/display/api').PDFDocumentProxy | null) => any) | undefined;
33
33
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -1,12 +1,12 @@
1
1
  import { PdfReaderProps } from './types';
2
2
  declare const __VLS_export: import('vue').DefineComponent<PdfReaderProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
3
+ pageChange: (page: number) => any;
3
4
  loadSuccess: (numPages: number) => any;
4
5
  loadError: (error: Error) => any;
5
- pageChange: (page: number) => any;
6
6
  }, string, import('vue').PublicProps, Readonly<PdfReaderProps> & Readonly<{
7
+ onPageChange?: ((page: number) => any) | undefined;
7
8
  onLoadSuccess?: ((numPages: number) => any) | undefined;
8
9
  onLoadError?: ((error: Error) => any) | undefined;
9
- onPageChange?: ((page: number) => any) | undefined;
10
10
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
11
11
  declare const _default: typeof __VLS_export;
12
12
  export default _default;
@@ -1 +1,9 @@
1
- export declare function useImagePreview(file: () => File | undefined): import('vue').Ref<string | undefined, string | undefined>;
1
+ import { Ref } from 'vue';
2
+ /**
3
+ * An object URL for `blob`, made while `enabled` (pass `useIsClient()` to
4
+ * make none on a server) and revoked when `blob` changes or the component
5
+ * unmounts. `undefined` until made. `FilePreview` uses it.
6
+ */
7
+ export declare function useBlobUrl(blob: () => Blob | undefined, enabled?: Ref<boolean>): Ref<string | undefined>;
8
+ /** An object URL previewing `file` while it is an image, revoked on change. */
9
+ export declare function useImagePreview(file: () => File | undefined): Ref<string | undefined, string | undefined>;
@@ -2,7 +2,7 @@ import { InjectionKey, Ref } from 'vue';
2
2
  /**
3
3
  * `true` inside a control that already carries an accessible name — a named
4
4
  * `IconButton`, and so `InputGroupButton` and `IconLinkButton`, which render
5
- * one. An `Icon` there with no `aria-label` of its own renders
5
+ * one, and a `Button` with text or an `aria-label`. An `Icon` there with no `aria-label` of its own renders
6
6
  * `aria-hidden="true"` instead of `role="img" aria-label="Icon {name}"`, so a
7
7
  * screen reader reads "Delete" and not "Delete, Icon trash".
8
8
  *
@@ -1,7 +1,10 @@
1
1
  import { TabsRootProps } from 'reka-ui';
2
2
  import { HTMLAttributes } from 'vue';
3
+ import { TabsVariant } from './tabs-variant';
3
4
  type __VLS_Props = TabsRootProps & {
4
5
  class?: HTMLAttributes['class'];
6
+ /** `bar` (the default) or `line`, read by `TabsList` and `TabsTrigger`. */
7
+ variant?: TabsVariant;
5
8
  };
6
9
  declare var __VLS_8: {
7
10
  modelValue: string | number | undefined;
@@ -2,3 +2,4 @@ export { default as Tabs } from './Tabs.vue';
2
2
  export { default as TabsContent } from './TabsContent.vue';
3
3
  export { default as TabsList } from './TabsList.vue';
4
4
  export { default as TabsTrigger } from './TabsTrigger.vue';
5
+ export type { TabsVariant } from './tabs-variant';
@@ -0,0 +1,9 @@
1
+ import { ComputedRef, InjectionKey } from 'vue';
2
+ /**
3
+ * `bar` is the look `Tabs` always had here; `line` is `@nxgt/material`'s
4
+ * scrolling row of light tabs on a muted strip (used by `CodeGroup`).
5
+ */
6
+ export type TabsVariant = 'bar' | 'line';
7
+ export declare const TABS_VARIANT: InjectionKey<ComputedRef<TabsVariant>>;
8
+ /** The variant of the enclosing `Tabs`; `bar` outside one. */
9
+ export declare function useTabsVariant(): ComputedRef<TabsVariant>;
@@ -1,7 +1,33 @@
1
- import { AutocompleteProps } from './autocomplete.vue';
2
- type __VLS_Props = {
3
- name: string;
4
- } & Omit<AutocompleteProps, 'modelValue' | 'error' | 'name'>;
5
- declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
1
+ import { AutocompleteOption, AutocompleteProps } from './autocomplete.vue';
2
+ declare const __VLS_export: <T extends AutocompleteOption = AutocompleteOption>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
3
+ props: import('vue').PublicProps & __VLS_PrettifyLocal<{
4
+ name: string;
5
+ } & Omit<AutocompleteProps<T>, "name" | "error" | "modelValue">> & (typeof globalThis extends {
6
+ __VLS_PROPS_FALLBACK: infer P;
7
+ } ? P : {});
8
+ expose: (exposed: {}) => void;
9
+ attrs: any;
10
+ slots: {
11
+ option?: (props: {
12
+ option: T;
13
+ index: number;
14
+ selected: boolean;
15
+ }) => unknown;
16
+ 'selected-leading'?: (props: {
17
+ option: T;
18
+ }) => unknown;
19
+ actions?: (props: {
20
+ query: string;
21
+ }) => unknown;
22
+ };
23
+ emit: {};
24
+ }>) => import('vue').VNode & {
25
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
26
+ };
6
27
  declare const _default: typeof __VLS_export;
7
28
  export default _default;
29
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
30
+ [K in keyof T]: T[K];
31
+ } : {
32
+ [K in keyof T as K]: T[K];
33
+ }) & {};
@@ -0,0 +1,23 @@
1
+ import { AutocompleteOption } from './autocomplete.vue';
2
+ /** One option as the list shows it: its value and label, and the option itself. */
3
+ export type AutocompleteItem<T> = {
4
+ value: string;
5
+ label: string;
6
+ option: T;
7
+ };
8
+ export type OptionReaders<T> = {
9
+ getOptionValue?: (option: T) => string;
10
+ getOptionLabel?: (option: T) => string;
11
+ };
12
+ /**
13
+ * Every option as an item, then every selected value that is no option (a
14
+ * free-solo one) as itself. A free-solo value's `option` is `{ value, label }`
15
+ * cast to `T`, as `@nxgt/material` hands it: it has none of your extra fields.
16
+ */
17
+ export declare function autocompleteItems<T extends AutocompleteOption>(options: T[], selected: string[], { getOptionValue, getOptionLabel }: OptionReaders<T>): AutocompleteItem<T>[];
18
+ /** The selection after picking `value`: unchanged (same array) when already in it. */
19
+ export declare function withPickedValue(mode: 'single' | 'multiple', selected: string[], value: string): string[];
20
+ /** The `modelValue` a selection emits: the list, or its first value (or `null`). */
21
+ export declare function autocompleteModelValue(mode: 'single' | 'multiple', next: string[]): string | string[] | null;
22
+ /** The items of `selected`, in its order. */
23
+ export declare function selectedAutocompleteItems<T>(items: AutocompleteItem<T>[], selected: string[]): AutocompleteItem<T>[];
@@ -2,7 +2,13 @@ export type AutocompleteOption = {
2
2
  value: string;
3
3
  label: string;
4
4
  };
5
- export type AutocompleteProps = {
5
+ /**
6
+ * `T` is your option type, inferred from `options`: `getOptionValue` and
7
+ * `getOptionLabel` read it (they default to its `value` and `label`), and the
8
+ * `#option` and `#selected-leading` slots receive it whole. The value stays
9
+ * the options' values: a `string` (single) or `string[]` (multiple).
10
+ */
11
+ export type AutocompleteProps<T extends AutocompleteOption = AutocompleteOption> = {
6
12
  label?: string;
7
13
  placeholder?: string;
8
14
  helperText?: string;
@@ -12,22 +18,51 @@ export type AutocompleteProps = {
12
18
  class?: string;
13
19
  name?: string;
14
20
  id?: string;
15
- options: AutocompleteOption[];
21
+ options: T[];
16
22
  mode?: 'single' | 'multiple';
17
23
  freeSolo?: boolean;
18
24
  empty?: string;
19
25
  modelValue?: string | string[] | null;
26
+ /** The value an option stands for. Defaults to its `value`. */
27
+ getOptionValue?: (option: T) => string;
28
+ /** The text an option shows and is searched by. Defaults to its `label`. */
29
+ getOptionLabel?: (option: T) => string;
30
+ /** The free-solo button's text for `query`. Defaults to `Add "<query>"`, translated. */
31
+ freeSoloLabel?: (query: string) => string;
32
+ };
33
+ declare const __VLS_export: <T extends AutocompleteOption = AutocompleteOption>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
34
+ props: import('vue').PublicProps & __VLS_PrettifyLocal<AutocompleteProps<T> & {
35
+ "onUpdate:modelValue"?: ((value: string | string[] | null) => any) | undefined;
36
+ onQueryChange?: ((query: string) => any) | undefined;
37
+ }> & (typeof globalThis extends {
38
+ __VLS_PROPS_FALLBACK: infer P;
39
+ } ? P : {});
40
+ expose: (exposed: {}) => void;
41
+ attrs: any;
42
+ slots: {
43
+ /** One option in the list (`renderOption`). Defaults to its label. */
44
+ option?: (props: {
45
+ option: T;
46
+ index: number;
47
+ selected: boolean;
48
+ }) => unknown;
49
+ /** Before a selected option's chip label (`renderSelectedLeading`). */
50
+ 'selected-leading'?: (props: {
51
+ option: T;
52
+ }) => unknown;
53
+ /** Above the list, beside the query (`actions`). */
54
+ actions?: (props: {
55
+ query: string;
56
+ }) => unknown;
57
+ };
58
+ emit: ((evt: "update:modelValue", value: string | string[] | null) => void) & ((evt: "queryChange", query: string) => void);
59
+ }>) => import('vue').VNode & {
60
+ __ctx?: NonNullable<Awaited<typeof __VLS_setup>>;
20
61
  };
21
- declare const __VLS_export: import('vue').DefineComponent<AutocompleteProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
22
- "update:modelValue": (value: string | string[] | null) => any;
23
- queryChange: (query: string) => any;
24
- }, string, import('vue').PublicProps, Readonly<AutocompleteProps> & Readonly<{
25
- "onUpdate:modelValue"?: ((value: string | string[] | null) => any) | undefined;
26
- onQueryChange?: ((query: string) => any) | undefined;
27
- }>, {
28
- mode: "single" | "multiple";
29
- modelValue: string | string[] | null;
30
- freeSolo: boolean;
31
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
32
62
  declare const _default: typeof __VLS_export;
33
63
  export default _default;
64
+ type __VLS_PrettifyLocal<T> = (T extends any ? {
65
+ [K in keyof T]: T[K];
66
+ } : {
67
+ [K in keyof T as K]: T[K];
68
+ }) & {};
@@ -1,5 +1,6 @@
1
1
  import { AutocompleteOption } from './autocomplete.vue';
2
- export declare function filterAutocompleteOptions(options: AutocompleteOption[], query: string): AutocompleteOption[];
2
+ /** The options whose label or value holds `query`; any extra fields are kept. */
3
+ export declare function filterAutocompleteOptions<O extends AutocompleteOption>(options: O[], query: string): O[];
3
4
  export declare function selectedAutocompleteValues(mode: 'single' | 'multiple', modelValue?: string | string[] | null): string[];
4
5
  export declare function extraAutocompleteOptions(options: AutocompleteOption[], selected: string[]): {
5
6
  value: string;
@@ -9,9 +9,15 @@ type __VLS_Props = {
9
9
  selected: {
10
10
  value: string;
11
11
  label: string;
12
+ option?: unknown;
12
13
  }[];
13
14
  };
14
- declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {
15
+ type __VLS_Slots = {
16
+ 'selected-leading'?: (props: {
17
+ option: unknown;
18
+ }) => unknown;
19
+ };
20
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {
15
21
  focus: () => void | undefined;
16
22
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
17
23
  input: (event: Event) => any;
@@ -26,5 +32,11 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {
26
32
  onFocus?: (() => any) | undefined;
27
33
  onKeydown?: ((event: KeyboardEvent) => any) | undefined;
28
34
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
35
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
29
36
  declare const _default: typeof __VLS_export;
30
37
  export default _default;
38
+ type __VLS_WithSlots<T, S> = T & {
39
+ new (): {
40
+ $slots: S;
41
+ };
42
+ };
@@ -1,19 +1,33 @@
1
- import { AutocompleteOption } from '../autocomplete.vue';
1
+ import { AutocompleteItem } from '../autocomplete-items';
2
2
  type __VLS_Props = {
3
3
  name?: string;
4
4
  query: string;
5
- filtered: AutocompleteOption[];
5
+ filtered: AutocompleteItem<unknown>[];
6
6
  selected: string[];
7
7
  canAdd: boolean;
8
8
  empty: string;
9
9
  addLabel: string;
10
10
  };
11
- declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
11
+ type __VLS_Slots = {
12
+ option?: (props: {
13
+ item: AutocompleteItem<unknown>;
14
+ index: number;
15
+ selected: boolean;
16
+ }) => unknown;
17
+ actions?: () => unknown;
18
+ };
19
+ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
12
20
  pick: (value: string) => any;
13
21
  add: () => any;
14
22
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
15
23
  onPick?: ((value: string) => any) | undefined;
16
24
  onAdd?: (() => any) | undefined;
17
25
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
26
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
18
27
  declare const _default: typeof __VLS_export;
19
28
  export default _default;
29
+ type __VLS_WithSlots<T, S> = T & {
30
+ new (): {
31
+ $slots: S;
32
+ };
33
+ };
@@ -0,0 +1,15 @@
1
+ import { Ref } from 'vue';
2
+ import { AutocompleteOption } from './autocomplete.vue';
3
+ import { OptionReaders } from './autocomplete-items';
4
+ export type AutocompleteItemsOptions<T> = OptionReaders<T> & {
5
+ options: T[];
6
+ mode: 'single' | 'multiple';
7
+ modelValue?: string | string[] | null;
8
+ };
9
+ /** The selected values, every item, the ones the query keeps, and the selected ones. */
10
+ export declare function useAutocompleteItems<T extends AutocompleteOption>(props: AutocompleteItemsOptions<T>, query: Readonly<Ref<string>>): {
11
+ selectedValues: import('vue').ComputedRef<string[]>;
12
+ allItems: import('vue').ComputedRef<import('./autocomplete-items').AutocompleteItem<T>[]>;
13
+ filtered: import('vue').ComputedRef<import('./autocomplete-items').AutocompleteItem<T>[]>;
14
+ selectedItems: import('vue').ComputedRef<import('./autocomplete-items').AutocompleteItem<T>[]>;
15
+ };
@@ -0,0 +1,15 @@
1
+ import { Ref } from 'vue';
2
+ /**
3
+ * Whether the list is open, and the handlers that open it: focus, a click
4
+ * on the box, typing. A click outside closes it; a disabled field never opens.
5
+ */
6
+ export declare function useAutocompleteOpen(props: {
7
+ disabled?: boolean;
8
+ }, query: Ref<string>, root: Readonly<Ref<HTMLElement | null>>, box: Readonly<Ref<{
9
+ focus: () => void;
10
+ } | null>>): {
11
+ open: Ref<boolean, boolean>;
12
+ onFocus(): void;
13
+ focusInput(): void;
14
+ onInput(event: Event): void;
15
+ };
@@ -0,0 +1,14 @@
1
+ import { Ref } from 'vue';
2
+ import { AutocompleteItem } from './autocomplete-items';
3
+ type Options = {
4
+ freeSolo: boolean;
5
+ empty?: string;
6
+ freeSoloLabel?: (query: string) => string;
7
+ };
8
+ /** Whether the typed text can be added (free solo), and the list's two texts. */
9
+ export declare function useAutocompleteTexts<T>(props: Options, query: Ref<string>, items: Readonly<Ref<AutocompleteItem<T>[]>>): {
10
+ canAddFreeSolo: import('vue').ComputedRef<boolean>;
11
+ emptyText: import('vue').ComputedRef<string>;
12
+ addLabel: import('vue').ComputedRef<string>;
13
+ };
14
+ export {};