@nxgt/material-vue 0.38.0 → 0.39.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 (54) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/{Button-5UyKA-x_.js → Button-DVeAQorb.js} +1 -1
  3. package/dist/{DropdownMenuTrigger-BsuyNVzV.js → DropdownMenuTrigger-C7uYPf_9.js} +36 -36
  4. package/dist/{HoverCardTrigger-CmCDiTn8.js → HoverCardTrigger-VvXPswRz.js} +122 -120
  5. package/dist/{camera-BWzF8sOW.js → camera-CG6WfZNc.js} +4 -4
  6. package/dist/components/base-content.css +64 -4
  7. package/dist/{components-B_s5oxUp.js → components-B2kSyBK0.js} +9462 -9450
  8. package/dist/components.js +7 -7
  9. package/dist/composables.js +2 -2
  10. package/dist/dnd.js +1 -1
  11. package/dist/{form-scope-UzoU38db.js → form-scope-XhlaF5na.js} +1 -1
  12. package/dist/{i18n-provider-BEvjls8b.js → i18n-provider-BBnUUGqM.js} +1 -1
  13. package/dist/i18n.js +4 -4
  14. package/dist/{icon-button-DhqJE6Ej.js → icon-button-CSPfP615.js} +1 -1
  15. package/dist/in-dialog-Blhwwbyb.js +31 -0
  16. package/dist/lib/components/ui/collections/data-table/data-table-density.d.ts +15 -0
  17. package/dist/lib/components/ui/collections/data-table/data-table.stories.columns.d.ts +47 -0
  18. package/dist/lib/components/ui/collections/data-table/data-table.stories.template.d.ts +1 -0
  19. package/dist/lib/components/ui/collections/data-table/index.d.ts +1 -1
  20. package/dist/lib/components/ui/collections/data-table/types.d.ts +7 -0
  21. package/dist/lib/components/ui/fields/contacts/consts.d.ts +1 -1
  22. package/dist/lib/components/ui/overlays/dialog/in-dialog.d.ts +12 -0
  23. package/dist/lib/i18n/resources/en/en.d.ts +1 -0
  24. package/dist/lib/i18n/resources/en/material.json.d.ts +1 -0
  25. package/dist/lib/i18n/resources/fr/fr.d.ts +1 -0
  26. package/dist/lib/i18n/resources/fr/material.json.d.ts +1 -0
  27. package/dist/lib/i18n/resources/resources.d.ts +2 -0
  28. package/dist/lib/i18n/translator.d.ts +1 -1
  29. package/dist/lib.js +1 -1
  30. package/dist/main.js +12 -12
  31. package/dist/map.js +4 -4
  32. package/dist/material-vue.css +1 -1
  33. package/dist/{pdf-outline-sidebar-BsePJlTi.js → pdf-outline-sidebar-aQ5Lhbss.js} +2 -2
  34. package/dist/{pdf-page-Ct313mNF.js → pdf-page-NCmScgMW.js} +1 -1
  35. package/dist/{pdf-page-list-JrRo2BeU.js → pdf-page-list-BnvE130d.js} +2 -2
  36. package/dist/{pdf-reader-tABBZMbZ.js → pdf-reader-CMt9dKZ-.js} +8 -8
  37. package/dist/{pdf-sidebar-Caw9rzU-.js → pdf-sidebar-BWzX3e0f.js} +3 -3
  38. package/dist/{pdf-thumbnail-sidebar-ZybLeUG7.js → pdf-thumbnail-sidebar-8nbYsI3d.js} +3 -3
  39. package/dist/{pdf-toolbar-BM8Sz_JN.js → pdf-toolbar-DpQMG5rv.js} +5 -5
  40. package/dist/pdf.js +2 -2
  41. package/dist/{print-format.utils-CQFIVeUA.js → print-format.utils-oj5kle2P.js} +2 -2
  42. package/dist/{sortable-provider-CKkWYijj.js → sortable-provider-2czx1jSW.js} +2 -2
  43. package/dist/{stored-language-CvOHC8AD.js → stored-language-CKZMMJcz.js} +2 -0
  44. package/dist/{stx-player-CsVKbwFk.js → stx-player-CS1FYHVS.js} +2 -2
  45. package/dist/{translator-k1rKIgC7.js → translator-uh5FWiMq.js} +1 -1
  46. package/dist/{use-heading-spy-D-ipoQwl.js → use-heading-spy-CcJfoBA1.js} +1 -1
  47. package/dist/{use-material-translation-1FdRx9I7.js → use-material-translation-C6xccbic.js} +3 -3
  48. package/docs/components/data-table-filter-and-lists.md +3 -1
  49. package/docs/guides/forms.md +55 -4
  50. package/docs/guides/i18n.md +2 -1
  51. package/docs/troubleshooting.md +27 -0
  52. package/lib/components/base-content.css +64 -4
  53. package/package.json +1 -1
  54. package/dist/use-inert-others-CtGqZKR8.js +0 -22
@@ -1,7 +1,7 @@
1
1
  import { n as e } from "./rolldown-runtime-CWhphoD1.js";
2
2
  import { t } from "./utils-CykWQ0iJ.js";
3
- import { Hf as n } from "./components-B_s5oxUp.js";
4
- import { t as r } from "./use-material-translation-1FdRx9I7.js";
3
+ import { Hf as n } from "./components-B2kSyBK0.js";
4
+ import { t as r } from "./use-material-translation-C6xccbic.js";
5
5
  import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, defineComponent as u, normalizeClass as d, normalizeStyle as f, openBlock as p, ref as m, renderList as h, toDisplayString as g, unref as _, withCtx as v } from "vue";
6
6
  //#region lib/components/ui/media/pdf-viewer/partials/pdf-outline-row.vue?vue&type=script&setup=true&lang.ts
7
7
  var y = {
@@ -1,5 +1,5 @@
1
1
  import { t as e } from "./utils-CykWQ0iJ.js";
2
- import { Gp as t } from "./components-B_s5oxUp.js";
2
+ import { Gp as t } from "./components-B2kSyBK0.js";
3
3
  import { computed as n, createBlock as r, createCommentVNode as i, createElementBlock as a, createElementVNode as o, defineComponent as s, nextTick as c, normalizeClass as l, normalizeStyle as u, onBeforeUnmount as d, openBlock as f, ref as p, shallowRef as m, unref as h, watch as g } from "vue";
4
4
  import { DEFAULT_PAGE_SIZE as _, escapeHtml as v, findTextMatches as y, highlightItemHtml as b, placeholderSize as x, rotatedSize as S } from "@nxgt/material-core/pdf-viewer";
5
5
  //#region lib/components/ui/media/pdf-viewer/pdf-note-icons.ts
@@ -1,6 +1,6 @@
1
1
  import { n as e } from "./rolldown-runtime-CWhphoD1.js";
2
- import { Hf as t } from "./components-B_s5oxUp.js";
3
- import { t as n } from "./pdf-page-Ct313mNF.js";
2
+ import { Hf as t } from "./components-B2kSyBK0.js";
3
+ import { t as n } from "./pdf-page-NCmScgMW.js";
4
4
  import { Fragment as r, createBlock as i, createElementBlock as a, createElementVNode as o, defineComponent as s, openBlock as c, renderList as l, withCtx as u } from "vue";
5
5
  //#region lib/components/ui/media/pdf-viewer/partials/pdf-page-list.vue?vue&type=script&setup=true&lang.ts
6
6
  var d = { class: "flex flex-col items-center gap-4 px-4 py-4" }, f = /*@__PURE__*/ s({
@@ -1,12 +1,12 @@
1
1
  import { t as e } from "./utils-CykWQ0iJ.js";
2
- import { kn as t } from "./components-B_s5oxUp.js";
3
- import { t as n } from "./use-material-translation-1FdRx9I7.js";
4
- import { t as r } from "./Button-5UyKA-x_.js";
5
- import { o as i } from "./HoverCardTrigger-CmCDiTn8.js";
6
- import { n as a } from "./pdf-page-Ct313mNF.js";
7
- import { t as o } from "./pdf-page-list-JrRo2BeU.js";
8
- import { t as s } from "./pdf-sidebar-Caw9rzU-.js";
9
- import { t as c } from "./pdf-toolbar-BM8Sz_JN.js";
2
+ import { kn as t } from "./components-B2kSyBK0.js";
3
+ import { t as n } from "./use-material-translation-C6xccbic.js";
4
+ import { t as r } from "./Button-DVeAQorb.js";
5
+ import { o as i } from "./HoverCardTrigger-VvXPswRz.js";
6
+ import { n as a } from "./pdf-page-NCmScgMW.js";
7
+ import { t as o } from "./pdf-page-list-BnvE130d.js";
8
+ import { t as s } from "./pdf-sidebar-BWzX3e0f.js";
9
+ import { t as c } from "./pdf-toolbar-DpQMG5rv.js";
10
10
  import { computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineComponent as g, nextTick as _, normalizeClass as v, onBeforeUnmount as y, onMounted as b, openBlock as x, reactive as S, ref as C, shallowRef as w, toDisplayString as T, toRef as E, unref as D, useId as O, watch as k, withCtx as A } from "vue";
11
11
  import { AlertCircle as j, FileX2 as M, KeyRound as N, Loader2 as P } from "@lucide/vue";
12
12
  import { pdfSourceKey as F, toPdfjsParams as I } from "@nxgt/material-core/pdf-source";
@@ -1,8 +1,8 @@
1
1
  import { n as e } from "./rolldown-runtime-CWhphoD1.js";
2
2
  import { t } from "./utils-CykWQ0iJ.js";
3
- import { t as n } from "./use-material-translation-1FdRx9I7.js";
4
- import { t as r } from "./pdf-outline-sidebar-BsePJlTi.js";
5
- import { t as i } from "./pdf-thumbnail-sidebar-ZybLeUG7.js";
3
+ import { t as n } from "./use-material-translation-C6xccbic.js";
4
+ import { t as r } from "./pdf-outline-sidebar-aQ5Lhbss.js";
5
+ import { t as i } from "./pdf-thumbnail-sidebar-8nbYsI3d.js";
6
6
  import { createElementBlock as a, createElementVNode as o, createVNode as s, defineComponent as c, normalizeClass as l, openBlock as u, toDisplayString as d, unref as f, useId as p, useTemplateRef as m } from "vue";
7
7
  //#region lib/components/ui/media/pdf-viewer/partials/pdf-sidebar.vue?vue&type=script&setup=true&lang.ts
8
8
  var h = ["aria-label"], g = ["aria-label"], _ = [
@@ -1,8 +1,8 @@
1
1
  import { n as e } from "./rolldown-runtime-CWhphoD1.js";
2
2
  import { t } from "./utils-CykWQ0iJ.js";
3
- import { Hf as n } from "./components-B_s5oxUp.js";
4
- import { t as r } from "./use-material-translation-1FdRx9I7.js";
5
- import { t as i } from "./pdf-page-Ct313mNF.js";
3
+ import { Hf as n } from "./components-B2kSyBK0.js";
4
+ import { t as r } from "./use-material-translation-C6xccbic.js";
5
+ import { t as i } from "./pdf-page-NCmScgMW.js";
6
6
  import { Fragment as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createVNode as l, defineComponent as u, normalizeClass as d, openBlock as f, renderList as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
7
7
  //#region lib/components/ui/media/pdf-viewer/partials/pdf-thumbnail-sidebar.vue?vue&type=script&setup=true&lang.ts
8
8
  var _ = ["aria-label"], v = {
@@ -1,10 +1,10 @@
1
1
  import { n as e } from "./rolldown-runtime-CWhphoD1.js";
2
2
  import { t } from "./utils-CykWQ0iJ.js";
3
- import { t as n } from "./use-material-translation-1FdRx9I7.js";
4
- import { d as r } from "./Button-5UyKA-x_.js";
5
- import { t as i } from "./icon-button-DhqJE6Ej.js";
6
- import { a, i as o, n as s, o as c, r as l, t as u } from "./DropdownMenuTrigger-BsuyNVzV.js";
7
- import { o as d } from "./HoverCardTrigger-CmCDiTn8.js";
3
+ import { t as n } from "./use-material-translation-C6xccbic.js";
4
+ import { d as r } from "./Button-DVeAQorb.js";
5
+ import { t as i } from "./icon-button-CSPfP615.js";
6
+ import { a, i as o, n as s, o as c, r as l, t as u } from "./DropdownMenuTrigger-C7uYPf_9.js";
7
+ import { o as d } from "./HoverCardTrigger-VvXPswRz.js";
8
8
  import { Fragment as f, computed as p, createBlock as m, createCommentVNode as h, createElementBlock as g, createElementVNode as _, createTextVNode as v, createVNode as y, defineComponent as b, nextTick as x, normalizeClass as S, openBlock as C, ref as w, renderList as T, toDisplayString as E, unref as D, useTemplateRef as O, watch as k, withCtx as A } from "vue";
9
9
  import { ChevronDown as j, ChevronLeft as M, ChevronRight as N, ChevronUp as P, Download as F, Maximize2 as I, Minimize2 as L, Moon as R, Printer as z, RotateCw as B, Search as V, Sidebar as H, ZoomIn as U, ZoomOut as W } from "@lucide/vue";
10
10
  //#region lib/components/ui/media/pdf-viewer/partials/pdf-toolbar-search.vue?vue&type=script&setup=true&lang.ts
package/dist/pdf.js CHANGED
@@ -1,5 +1,5 @@
1
- import { n as e, t } from "./use-material-translation-1FdRx9I7.js";
2
- import { t as n } from "./Button-5UyKA-x_.js";
1
+ import { n as e, t } from "./use-material-translation-C6xccbic.js";
2
+ import { t as n } from "./Button-DVeAQorb.js";
3
3
  import { computed as r, createBlock as i, createTextVNode as a, defineComponent as o, getCurrentInstance as s, nextTick as c, onMounted as l, onScopeDispose as u, openBlock as d, ref as f, renderSlot as p, shallowRef as m, toDisplayString as ee, toValue as h, unref as g, watch as te, withCtx as ne } from "vue";
4
4
  import { contentDisposition as re, pdfBytesResponse as ie, toWebStream as ae } from "@nxgt/material-core/pdf/http";
5
5
  import { badge as oe, dataTable as se, defaultPdfTheme as ce, definePdfDocument as _, divider as v, header as y, heading as b, image as x, keyValue as S, keyValueOf as C, link as w, metric as T, page as E, pageBreak as D, pageNumber as O, pdfDocument as k, resolvePdfColor as A, resolvePdfTheme as j, row as M, section as N, spacer as P, stack as F, table as I, text as L, totals as R } from "@nxgt/material-core/pdf/model";
@@ -1,5 +1,5 @@
1
- import { i as e, r as t, t as n } from "./stored-language-CvOHC8AD.js";
2
- import { r } from "./translator-k1rKIgC7.js";
1
+ import { i as e, r as t, t as n } from "./stored-language-CKZMMJcz.js";
2
+ import { r } from "./translator-uh5FWiMq.js";
3
3
  import { t as i } from "./_baseIsEqual-BUD8VQJE.js";
4
4
  import { n as a } from "./number.utils-Bpo9tUaJ.js";
5
5
  import { defineComponent as o, getCurrentInstance as s, h as c, inject as l, provide as u, useId as d } from "vue";
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./utils-CykWQ0iJ.js";
2
- import { t } from "./use-material-translation-1FdRx9I7.js";
3
- import { t as n } from "./icon-button-DhqJE6Ej.js";
2
+ import { t } from "./use-material-translation-C6xccbic.js";
3
+ import { t as n } from "./icon-button-CSPfP615.js";
4
4
  import { Teleport as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createVNode as c, defineComponent as l, inject as u, mergeProps as d, normalizeStyle as f, onUnmounted as p, openBlock as m, provide as h, reactive as g, ref as _, renderSlot as v, toValue as y, unref as b, useAttrs as x, watch as S, watchEffect as C, withCtx as w, withModifiers as T } from "vue";
5
5
  import { GripVertical as E } from "@lucide/vue";
6
6
  import { Primitive as D } from "reka-ui";
@@ -345,6 +345,7 @@ var e = {
345
345
  "select-all": "Select all",
346
346
  "select-row": "Select row",
347
347
  "toggle-row": "Toggle row details",
348
+ expand: "Expand",
348
349
  "scroll-region": "Scrollable table"
349
350
  },
350
351
  pagination: {
@@ -1581,6 +1582,7 @@ var e = {
1581
1582
  "select-all": "Tout sélectionner",
1582
1583
  "select-row": "Sélectionner la ligne",
1583
1584
  "toggle-row": "Afficher ou masquer les détails de la ligne",
1585
+ expand: "Déplier",
1584
1586
  "scroll-region": "Tableau défilant"
1585
1587
  },
1586
1588
  pagination: {
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./utils-CykWQ0iJ.js";
2
- import { $t as t, Jp as n, Jt as r, Qt as i, Xt as a, Yt as o, en as s, tn as c } from "./components-B_s5oxUp.js";
3
- import { t as l } from "./use-material-translation-1FdRx9I7.js";
2
+ import { $t as t, Jp as n, Jt as r, Qt as i, Xt as a, Yt as o, en as s, tn as c } from "./components-B2kSyBK0.js";
3
+ import { t as l } from "./use-material-translation-C6xccbic.js";
4
4
  import { createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineComponent as g, normalizeClass as _, openBlock as v, toDisplayString as y, unref as b, withCtx as x } from "vue";
5
5
  //#region lib/components/ui/media/stx-player/partials/stx-player-frame.vue?vue&type=script&setup=true&lang.ts
6
6
  var S = ["data-layout", "aria-label"], C = {
@@ -1,4 +1,4 @@
1
- import { a as e, i as t, r as n, t as r } from "./stored-language-CvOHC8AD.js";
1
+ import { a as e, i as t, r as n, t as r } from "./stored-language-CKZMMJcz.js";
2
2
  import { t as i } from "./get-CTzJAwfc.js";
3
3
  //#region ../../node_modules/@formatjs/fast-memoize/index.js
4
4
  function a(e, t) {
@@ -1,4 +1,4 @@
1
- import { a as e } from "./i18n-provider-BEvjls8b.js";
1
+ import { a as e } from "./i18n-provider-BBnUUGqM.js";
2
2
  import { c as t, d as n, f as r, l as i, r as a, u as o } from "./number.utils-Bpo9tUaJ.js";
3
3
  import { computed as s, getCurrentInstance as c, inject as l, onMounted as u, ref as d, shallowRef as f, toValue as p, watch as m } from "vue";
4
4
  import { injectConfigProviderContext as h } from "reka-ui";
@@ -1,6 +1,6 @@
1
- import "./stored-language-CvOHC8AD.js";
2
- import { a as e } from "./i18n-provider-BEvjls8b.js";
3
- import { i as t, r as n } from "./translator-k1rKIgC7.js";
1
+ import "./stored-language-CKZMMJcz.js";
2
+ import { a as e } from "./i18n-provider-BBnUUGqM.js";
3
+ import { i as t, r as n } from "./translator-uh5FWiMq.js";
4
4
  //#region lib/i18n/translate-material.ts
5
5
  function r(e, r, i, a) {
6
6
  if (e) for (let t of /* @__PURE__ */ new Set([e, e.split("-")[0]])) {
@@ -64,7 +64,8 @@ of your own; both footers take `disabled`);
64
64
  `useColumnHelpers<T>()` returns a
65
65
  `columnHelper` bound to the table's features and `predefinedColumns()` —
66
66
  `select` (checkboxes) and `expand` (a toggle for the expanded row, named
67
- "Toggle row details" (`material.table.labels.toggle-row`) with `aria-expanded`);
67
+ "Toggle row details" (`material.table.labels.toggle-row`) with `aria-expanded`, under a
68
+ visually hidden header "Expand", `material.table.labels.expand`);
68
69
  `useDeleteRowsHandler(onDelete)` for a delete-selected action behind a
69
70
  confirm dialog.
70
71
  `dataTableFeatures` / `DataTableFeatures` are the TanStack v9 features the
@@ -84,6 +85,7 @@ table enables, for typing your own column defs.
84
85
  | `scrollLabel` | `string` | "Scrollable table" | the name of the scroll region the table becomes while it overflows |
85
86
  | `loading` | `boolean` | `false` | skeleton rows, or the current rows dimmed; `aria-busy`; controls disabled |
86
87
  | `loadingRows` | `number` | the page size | how many skeleton rows |
88
+ | `density` | `'comfortable' \| 'compact'` | `'comfortable'` | `compact` tightens the cell padding, the row and header heights and the gap between rows, the selection column included; it is the table's `data-density` attribute, styled with classes (no inline style). The toolbar band and the empty state keep their size; the print variant is unchanged |
87
89
  | `#empty="{ filtered }"` | slot | icon and "No data available" | content of the empty row, spanning every visible column |
88
90
  | `manual` | `boolean` | `false` | `data` is one server page: no client filtering, sorting or paging; the footer is the server footer ([server-side data](#server-side-data)) |
89
91
  | `v-model:sorting` | `SortingState` | held inside | controlled sorting; `update:sorting` gets the new state |
@@ -293,6 +293,55 @@ in `[data-slot="form-actions"]`) and put each group of fields in a
293
293
  fields still take a row of their own. A rule separates each section from the
294
294
  one before it (`:separated="false"` drops it).
295
295
 
296
+ ### One scroll, sticky actions
297
+
298
+ The form grid has no height of its own and its fields no scroll box: a long
299
+ form grows with the page, and the page is the one scroll. The actions
300
+ (`[data-slot="form-actions"]`) are sticky at the bottom of whatever scrolls
301
+ the form, on a translucent, blurred background, so Cancel and Save stay in
302
+ reach while the fields scroll under them; a form shorter than the screen
303
+ shows them right under its fields.
304
+
305
+ - In a `DialogContent` or a `SheetContent`, which are capped to the screen
306
+ and scroll themselves, the actions stick to the dialog's or the sheet's
307
+ bottom. A `DrawerContent` does not scroll: a form that is its direct child
308
+ is the scroll box there.
309
+ - In an `AlertDialogContent` (the rich text editor's edit dialogs use one),
310
+ the actions stick to its bottom the same way, over its padding.
311
+ - `ConfirmationDialog` holds a form when you pass it `form-options` (a schema and its `defaultValues`) and the `#form` slot: it renders the
312
+ fields in a `.form-grid-layout` with no `form-actions`, so its footer
313
+ (Cancel, Confirm) is what sticks to the dialog's bottom. Any `Dialog` or
314
+ `AlertDialog` whose content holds a `.form-grid-layout` without
315
+ `form-actions` gets the same sticky footer.
316
+ - A focused control or link is scrolled into view clear of the actions and
317
+ a line of helper text below it (`scroll-margin-bottom` on the fields'
318
+ controls: 6rem, plus a dialog's bottom padding, 7.5rem above a
319
+ `ConfirmationDialog`'s stacked footer), so a field you tab to is never
320
+ hidden behind them (WCAG 2.4.11). It is set on the controls, so it holds
321
+ in a scroll box of your own too.
322
+ - Taller actions (a third button, labels that wrap) or helper text on
323
+ several lines need more room: raise `--form-actions-clearance` on the
324
+ form. A dialog whose bottom padding is not the default 1.5rem (`p-0` and
325
+ `p-4` are recognised) sets `--form-actions-fill` to it:
326
+
327
+ ```css
328
+ .edit-school-form {
329
+ --form-actions-clearance: 9rem;
330
+ }
331
+ .edit-school-dialog {
332
+ --form-actions-fill: 2rem; /* its pb-8 */
333
+ }
334
+ ```
335
+
336
+ ```vue
337
+ <form class="form-grid-layout edit-school-form">
338
+ ```
339
+ - To scroll a form in a box of your own, give it a height and the scroll
340
+ (`class="form-grid-layout max-h-[60vh] overflow-y-auto"`); to keep the
341
+ actions in place, give them `class="static"`. The
342
+ [troubleshooting entry](../troubleshooting.md#a-forms-fields-no-longer-scroll-in-their-own-box-after-upgrading)
343
+ has the details.
344
+
296
345
  ## Validation messages
297
346
 
298
347
  `zodLocaleError()` from `@nxgt/material-vue/lib` is a Zod v4 error map that
@@ -902,10 +951,12 @@ const onSubmit = handleSubmit(() => {
902
951
 
903
952
  - `meta.valid` keeps the button disabled until the schema passes; the form
904
953
  runs a silent validation when it mounts, so it starts disabled.
905
- - `ConfirmationDialog` has no form of its own in `@nxgt/material-vue`: it
906
- renders its default slot above Cancel / Confirm and emits `confirm`, then
907
- closes. Use it for a plain confirmation, and the pattern above when the
908
- user has to type something.
954
+ - `ConfirmationDialog` renders its default slot above Cancel / Confirm and
955
+ emits `confirm`, then closes. For a small form (a name to type before a
956
+ delete), pass `form-options` (a schema and its `defaultValues`) and render
957
+ the fields in its `#form` slot: Confirm stays disabled until the form is
958
+ valid, and `@confirm` receives the schema's output. Use the pattern above
959
+ for a larger form with its own submit.
909
960
  - `ConfirmDialog` (controlled: `open` is required) awaits its `@confirm`
910
961
  handler: while the promise is pending both buttons are disabled and the
911
962
  confirm button reads "Processing..." (`material.confirm-dialog.processing`);
@@ -281,7 +281,8 @@ checkboxes, the filter's presets and `Min`/`Max` fields, the `variant="4"` spinn
281
281
  `DialogFooter`. `CopyButton` reads `material.copy.copy`, `copied` and `failed` ("Copy", "Copied",
282
282
  "Copy failed"). The other icon-only buttons are named from it too: the
283
283
  `Sidebar` toggle (`material.sidebar.toggle`), the data table's row expander
284
- (`material.table.labels.toggle-row`), its loading status, "Loading data…" /
284
+ (`material.table.labels.toggle-row`) and its header, a hidden "Expand" / "Déplier"
285
+ (`material.table.labels.expand`), its loading status, "Loading data…" /
285
286
  "Chargement des données…" (`material.table.loading`), its scroll region,
286
287
  "Scrollable table" / "Tableau défilant"
287
288
  (`material.table.labels.scroll-region`, or the `scroll-label` prop), a `Chip`'s remove button, which the
@@ -27,6 +27,7 @@ words in your error.
27
27
  - [A Content-Security-Policy reports a `data:` image on every form with a required field](#a-content-security-policy-reports-a-data-image-on-every-form-with-a-required-field)
28
28
  - [A Button's label overflows a card on a phone](#a-buttons-label-overflows-a-card-on-a-phone)
29
29
  - [A dialog or sheet scrolls, or clips a child, after upgrading](#a-dialog-or-sheet-scrolls-or-clips-a-child-after-upgrading)
30
+ - [A form's fields no longer scroll in their own box after upgrading](#a-forms-fields-no-longer-scroll-in-their-own-box-after-upgrading)
30
31
  - [`JsBarcode is not a function`](#jsbarcode-is-not-a-function)
31
32
  - [A `LinkButton` selected as a `button` stops matching](#a-linkbutton-selected-as-a-button-stops-matching)
32
33
  - [A `Toc`, `Pager`, `SeeAlso` or `ScrollProgress` inside `Doc` selected by `data-slot` stops matching](#a-toc-pager-seealso-or-scrollprogress-inside-doc-selected-by-data-slot-stops-matching)
@@ -1284,6 +1285,32 @@ with `class="max-h-none overflow-visible"`; to change the cap, pass your own
1284
1285
  For a dialog that should grow taller than the screen and scroll inside the
1285
1286
  overlay instead of capping, use `DialogScrollContent`.
1286
1287
 
1288
+ ### A form's fields no longer scroll in their own box after upgrading
1289
+
1290
+ **When:** after upgrading, a `.form-grid-layout` form grows with the page
1291
+ instead of scrolling its fields in a box of its own, Cancel and Save stay at
1292
+ the bottom of the screen, or a form inside a box you gave a fixed height
1293
+ overflows it.
1294
+ **Why:** the form grid used to cap its height
1295
+ (`max-h-[calc(100lvh-184px)]`, more from `md`) and scroll
1296
+ `[data-slot="form-fields"]` inside it, so a page had two scrolls, one inside
1297
+ the other. It now has no cap and no scroll of its own: the page, or the
1298
+ `DialogContent` / `SheetContent` around it, is the one scroll, and
1299
+ `[data-slot="form-actions"]` is sticky at its bottom on a blurred background.
1300
+ A `Drawer`'s content does not scroll, so a form that is a direct child of
1301
+ `DrawerContent` is the scroll box there.
1302
+ **Fix:** to scroll a form inside a box again, give the box (or the form) a
1303
+ height and the scroll; the actions then stick to its bottom. To keep the
1304
+ actions where they are, make them static:
1305
+
1306
+ ```vue
1307
+ <form class="form-grid-layout max-h-[60vh] overflow-y-auto">
1308
+ <div data-slot="form-actions" class="static">
1309
+ ```
1310
+
1311
+ An app's own fixed bottom bar or floating action button now sits under the
1312
+ sticky actions (`z-index: 10`): give it a z-index above 10 (`class="z-20"`).
1313
+
1287
1314
  ## Feedback
1288
1315
 
1289
1316
  ### A toast with an action never goes away
@@ -97,7 +97,7 @@
97
97
  .form-grid-layout {
98
98
  @apply relative flex flex-col gap-2 @container;
99
99
  [data-slot="form-fields"] {
100
- @apply grid @2xl:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-2 bg-background/80 p-4 place-items-start overflow-auto;
100
+ @apply grid @2xl:grid-cols-2 @4xl:grid-cols-3 @6xl:grid-cols-4 gap-2 bg-background/80 p-4 place-items-start;
101
101
 
102
102
  [data-slot="separator"] {
103
103
  @apply col-start-full;
@@ -125,13 +125,73 @@
125
125
  @apply col-start-full;
126
126
  }
127
127
  }
128
+ /* A focused control scrolls into view clear of the actions and a line
129
+ of helper text, in any scroll box (WCAG 2.4.11 Focus Not Obscured). */
130
+ [data-slot="form-fields"]
131
+ :is(
132
+ input,
133
+ textarea,
134
+ select,
135
+ button,
136
+ a[href],
137
+ summary,
138
+ [tabindex],
139
+ [contenteditable]
140
+ ) {
141
+ scroll-margin-bottom: calc(
142
+ var(--form-actions-clearance, 6rem) +
143
+ var(--form-actions-fill, 0px)
144
+ );
145
+ }
146
+ /* Sticky at the bottom of whatever scrolls the form: in reach. */
128
147
  [data-slot="form-actions"] {
129
- @apply flex w-full justify-end gap-2 bottom-2 p-4 max-sm:*:flex-1;
148
+ @apply sticky bottom-0 z-10 flex w-full justify-end gap-2 bg-background/90 p-4 backdrop-blur-sm max-sm:*:flex-1;
130
149
  }
131
150
  }
132
151
 
133
- .form-grid-layout {
134
- @apply max-h-[calc(100lvh-184px)] md:max-h-[calc(100lvh-242px)] lg:max-h-[calc(100lvh-280px)];
152
+ /* No height cap and no scroll of its own: the page (or the overlay) is
153
+ the one scroll. A Drawer's content does not scroll: the form does. */
154
+ [data-slot="drawer-content"] > .form-grid-layout {
155
+ @apply min-h-0 overflow-y-auto;
156
+ }
157
+
158
+ /* In a dialog, the stuck actions sit above its bottom padding
159
+ (`--form-actions-fill`: p-6 by default; set it for another one). */
160
+ :is([data-slot="dialog-content"], [data-slot="alert-dialog-content"]) {
161
+ --form-actions-fill: 1.5rem;
162
+ &:is(.p-0, .py-0, .pb-0) {
163
+ --form-actions-fill: 0px;
164
+ }
165
+ &:is(.p-4, .py-4, .pb-4) {
166
+ --form-actions-fill: 1rem;
167
+ }
168
+ }
169
+
170
+ /* ConfirmationDialog's form has no actions of its own: the dialog's
171
+ footer (two stacked buttons on a phone) sticks instead. */
172
+ :is([data-slot="dialog-content"], [data-slot="alert-dialog-content"]):has(
173
+ .form-grid-layout
174
+ ):not(:has([data-slot="form-actions"])) {
175
+ --form-actions-clearance: 7.5rem;
176
+ > :is([data-slot="dialog-footer"], [data-slot="alert-dialog-footer"]) {
177
+ @apply sticky bottom-0 z-10 bg-background/90 backdrop-blur-sm;
178
+ }
179
+ }
180
+
181
+ /* A sticky element stops at the scroll box's padding: in a dialog, an
182
+ `::after` as tall as that padding fills the strip below the stuck
183
+ actions, so no field shows there, and adds no overflow. */
184
+ :is([data-slot="dialog-content"], [data-slot="alert-dialog-content"])
185
+ .form-grid-layout
186
+ > [data-slot="form-actions"]::after,
187
+ :is([data-slot="dialog-content"], [data-slot="alert-dialog-content"]):has(
188
+ .form-grid-layout
189
+ ):not(:has([data-slot="form-actions"]))
190
+ > :is(
191
+ [data-slot="dialog-footer"],
192
+ [data-slot="alert-dialog-footer"]
193
+ )::after {
194
+ @apply absolute inset-x-0 top-full h-(--form-actions-fill) bg-background content-[""];
135
195
  }
136
196
 
137
197
  /* No height cap on `DataTable` here (it nested a scroll in the page's):
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxgt/material-vue",
3
- "version": "0.38.0",
3
+ "version": "0.39.0",
4
4
  "license": "MIT",
5
5
  "bugs": {
6
6
  "email": "stevegires@gmail.com"
@@ -1,22 +0,0 @@
1
- import { nextTick as e, useTemplateRef as t, watch as n } from "vue";
2
- import { unrefElement as r } from "@vueuse/core";
3
- import { inertOthers as i } from "@nxgt/material-core/inert-others";
4
- //#region lib/components/ui/overlays/dialog/use-inert-others.ts
5
- function a(a, o) {
6
- let s = typeof a == "string" ? t(a) : a;
7
- n(o, (t, n, a) => {
8
- if (!t || typeof document > "u") return;
9
- let o, c = !1;
10
- e(() => {
11
- let e = r(s);
12
- !c && e instanceof Element && (o = i(e));
13
- }), a(() => {
14
- c = !0, o?.();
15
- });
16
- }, {
17
- immediate: !0,
18
- flush: "post"
19
- });
20
- }
21
- //#endregion
22
- export { a as t };