@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
@@ -0,0 +1,21 @@
1
+ import { DescribedFile } from '@nxgt/material-core/file-preview';
2
+ import { FilePreviewStatus as Status } from '../types';
3
+ import { TextPreviewState } from '../use-text-preview';
4
+ /** The part of `FilePreview` that depends on the file's kind and the status. */
5
+ type __VLS_Props = {
6
+ status: Status;
7
+ described: DescribedFile;
8
+ displayName: string;
9
+ href: string | undefined;
10
+ text: TextPreviewState;
11
+ maxTextBytes?: number;
12
+ };
13
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
+ "media-error": () => any;
15
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
16
+ "onMedia-error"?: (() => any) | undefined;
17
+ }>, {
18
+ maxTextBytes: number;
19
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
20
+ declare const _default: typeof __VLS_export;
21
+ export default _default;
@@ -0,0 +1,15 @@
1
+ import { FileKind } from '@nxgt/material-core/file-preview';
2
+ /** Any other file: its icon, name, size and type, and a download link. */
3
+ type __VLS_Props = {
4
+ kind: FileKind;
5
+ /** What the card shows. */
6
+ name: string;
7
+ /** What the download saves as. */
8
+ fileName: string;
9
+ size?: number;
10
+ type: string;
11
+ href: string | undefined;
12
+ };
13
+ 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>;
14
+ declare const _default: typeof __VLS_export;
15
+ export default _default;
@@ -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';
@@ -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 +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>;
@@ -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 {};
@@ -0,0 +1,34 @@
1
+ import { Ref } from 'vue';
2
+ import { AutocompleteOption } from './autocomplete.vue';
3
+ import { AutocompleteItemsOptions } from './use-autocomplete-items';
4
+ type Options<T> = AutocompleteItemsOptions<T> & {
5
+ freeSolo: boolean;
6
+ disabled?: boolean;
7
+ empty?: string;
8
+ freeSoloLabel?: (query: string) => string;
9
+ };
10
+ type Emit = {
11
+ (event: 'update:modelValue', value: string | string[] | null): void;
12
+ (event: 'queryChange', query: string): void;
13
+ };
14
+ /** Autocomplete's state and actions; the SFC only lays them out. */
15
+ export declare function useAutocomplete<T extends AutocompleteOption>(props: Options<T>, emit: Emit, root: Readonly<Ref<HTMLElement | null>>, box: Readonly<Ref<{
16
+ focus: () => void;
17
+ } | null>>): {
18
+ pick: (value: string) => void;
19
+ remove: (value: string) => void;
20
+ addFreeSolo: () => void;
21
+ onKeydown: (event: KeyboardEvent) => void;
22
+ canAddFreeSolo: import('vue').ComputedRef<boolean>;
23
+ emptyText: import('vue').ComputedRef<string>;
24
+ addLabel: import('vue').ComputedRef<string>;
25
+ query: Ref<string, string>;
26
+ selectedValues: import('vue').ComputedRef<string[]>;
27
+ selectedItems: import('vue').ComputedRef<import('./autocomplete-items').AutocompleteItem<T>[]>;
28
+ filtered: import('vue').ComputedRef<import('./autocomplete-items').AutocompleteItem<T>[]>;
29
+ open: Ref<boolean, boolean>;
30
+ onFocus(): void;
31
+ focusInput(): void;
32
+ onInput(event: Event): void;
33
+ };
34
+ export {};