@nxgt/material 2.5.0 → 2.6.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 (115) hide show
  1. package/README.md +5 -7
  2. package/dist/{_Uint8Array-DuTT6911.js → _Uint8Array-CDlDeQmw.js} +1 -1
  3. package/dist/{_overRest-93z6TD9V.js → _overRest-CWIWQwDJ.js} +1 -1
  4. package/dist/{async-slice-B8Xv2BLH.js → async-slice-Qoen0Mqm.js} +2 -2
  5. package/dist/{blockDiagram-BEXU5L5S-C8UXdLfB.js → blockDiagram-BEXU5L5S-_6EVgQ2-.js} +2 -2
  6. package/dist/{chunk-3FUC2YCW-4gCRt6fO.js → chunk-3FUC2YCW-CRQHl-Jx.js} +2 -2
  7. package/dist/{chunk-7M6MHVWA-DnPXbiTM.js → chunk-7M6MHVWA-DqXpf6CM.js} +1 -1
  8. package/dist/{chunk-GNY47TPC-DLqgU2SJ.js → chunk-GNY47TPC-BgMsLbCS.js} +4 -4
  9. package/dist/{chunk-NETBCI7D-CBowDvwz.js → chunk-NETBCI7D-CsyH43bj.js} +1 -1
  10. package/dist/{chunk-Z7XXMR3K-dRJc1Z30.js → chunk-Z7XXMR3K-CoCjTVVx.js} +1 -1
  11. package/dist/{classDiagram-v2-NBCMYWYE-CQmePeL4.js → classDiagram-v2-NBCMYWYE-j4vk04t-.js} +2 -2
  12. package/dist/{components-CUkJhBwK.js → components-C3wIUrWw.js} +25959 -25227
  13. package/dist/components.js +5 -5
  14. package/dist/{dagre-6A5THRUB-BhyJENrD.js → dagre-6A5THRUB-DXq_YBNL.js} +54 -54
  15. package/dist/{diagram-22UHCM2B-CJc0JoTV.js → diagram-22UHCM2B-He8NDldw.js} +2 -2
  16. package/dist/{diagram-3UASUU5V-0P3Cnq5H.js → diagram-3UASUU5V-CeILva4U.js} +1 -1
  17. package/dist/dnd.js +1 -1
  18. package/dist/{elk-276RUBZZ-CvgDuHoY.js → elk-276RUBZZ-DFn4kTey.js} +3 -3
  19. package/dist/{erDiagram-OPXOYQCR-BFgRy8E9.js → erDiagram-OPXOYQCR-BzVUcUwh.js} +2 -2
  20. package/dist/{field-blur-D1eQk-49.js → field-blur-BlrE9fOD.js} +1 -1
  21. package/dist/{flowDiagram-KWPJA3E3-DGaa9iT2.js → flowDiagram-KWPJA3E3-B4pJCj2Q.js} +3 -3
  22. package/dist/{ganttDiagram-FUAMR5RP-CDGrtGHY.js → ganttDiagram-FUAMR5RP-B4A4UFFi.js} +1 -1
  23. package/dist/{graphlib-Dt-isUVV.js → graphlib-CQ3hLS1N.js} +6 -6
  24. package/dist/hooks.js +2 -2
  25. package/dist/{i18n-provider-Drsc2YXX.js → i18n-provider-CbYD2KxP.js} +1 -1
  26. package/dist/i18n.js +6 -6
  27. package/dist/{isArrayLikeObject-BhWbq65y.js → isArrayLikeObject-5rnYwEK7.js} +3 -3
  28. package/dist/{isEmpty-DdlzV8Ue.js → isEmpty-DChvniYe.js} +3 -3
  29. package/dist/{journeyDiagram-ZHPQQLJL-BuLKqWS3.js → journeyDiagram-ZHPQQLJL-C91SPPkY.js} +1 -1
  30. package/dist/lib/components/ui/collections/tree/use-tree.d.ts +2 -0
  31. package/dist/lib/components/ui/dates/date-range-field/date-range-field-trigger.d.ts +1 -1
  32. package/dist/lib/components/ui/dates/date-range-field/date-range-field.d.ts +10 -1
  33. package/dist/lib/components/ui/dates/date-range-field/date-range-field.utils.d.ts +13 -0
  34. package/dist/lib/components/ui/dates/date-range-field/index.d.ts +1 -0
  35. package/dist/lib/components/ui/dates/date-range-field/partials/date-range-field-content.d.ts +25 -0
  36. package/dist/lib/components/ui/dates/date-range-field/partials/date-range-presets.d.ts +11 -0
  37. package/dist/lib/components/ui/dates/date-range-field/partials/date-range-times.d.ts +11 -0
  38. package/dist/lib/components/ui/dates/date-range-field/use-date-range-presets.d.ts +22 -0
  39. package/dist/lib/components/ui/dates/time-picker/time-picker-utils.d.ts +7 -0
  40. package/dist/lib/components/ui/fields/number-field/number-field.d.ts +3 -1
  41. package/dist/lib/components/ui/fields/slider/slider-header.d.ts +5 -1
  42. package/dist/lib/components/ui/fields/slider/slider-readout.d.ts +5 -1
  43. package/dist/lib/components/ui/media/file-preview/file-preview-pdf.lazy.d.ts +9 -0
  44. package/dist/lib/components/ui/media/file-preview/file-preview.d.ts +12 -0
  45. package/dist/lib/components/ui/media/file-preview/index.d.ts +3 -0
  46. package/dist/lib/components/ui/media/file-preview/partials/file-preview-body.d.ts +9 -0
  47. package/dist/lib/components/ui/media/file-preview/partials/file-preview-card.d.ts +20 -0
  48. package/dist/lib/components/ui/media/file-preview/partials/file-preview-media.d.ts +11 -0
  49. package/dist/lib/components/ui/media/file-preview/partials/file-preview-pdf.d.ts +10 -0
  50. package/dist/lib/components/ui/media/file-preview/partials/file-preview-status.d.ts +17 -0
  51. package/dist/lib/components/ui/media/file-preview/partials/file-preview-text.d.ts +13 -0
  52. package/dist/lib/components/ui/media/file-preview/types.d.ts +23 -0
  53. package/dist/lib/components/ui/media/file-preview/use-file-preview.d.ts +22 -0
  54. package/dist/lib/components/ui/media/file-preview/use-text-preview.d.ts +15 -0
  55. package/dist/lib/components/ui/media/index.d.ts +1 -0
  56. package/dist/lib/components/ui/media/upload/network-upload-field/use-image-preview.d.ts +6 -0
  57. package/dist/lib/components/ui/selection/index.d.ts +1 -0
  58. package/dist/lib/components/ui/selection/tree-select-field/index.d.ts +2 -0
  59. package/dist/lib/components/ui/selection/tree-select-field/partials/tree-select-content.d.ts +13 -0
  60. package/dist/lib/components/ui/selection/tree-select-field/partials/tree-select-panel.d.ts +19 -0
  61. package/dist/lib/components/ui/selection/tree-select-field/partials/tree-select-trigger.d.ts +24 -0
  62. package/dist/lib/components/ui/selection/tree-select-field/tree-select-field.d.ts +9 -0
  63. package/dist/lib/components/ui/selection/tree-select-field/tree-select-form-field.d.ts +8 -0
  64. package/dist/lib/components/ui/selection/tree-select-field/tree-select.utils.d.ts +35 -0
  65. package/dist/lib/components/ui/selection/tree-select-field/types.d.ts +37 -0
  66. package/dist/lib/components/ui/selection/tree-select-field/use-tree-select-field.d.ts +20 -0
  67. package/dist/lib/i18n/resources/en/en.d.ts +33 -0
  68. package/dist/lib/i18n/resources/en/material.json.d.ts +36 -3
  69. package/dist/lib/i18n/resources/fr/fr.d.ts +33 -0
  70. package/dist/lib/i18n/resources/fr/material.json.d.ts +36 -3
  71. package/dist/lib/i18n/resources/resources.d.ts +66 -0
  72. package/dist/lib/i18n/translator.d.ts +1 -1
  73. package/dist/lib.js +3 -3
  74. package/dist/main.js +15 -15
  75. package/dist/map.js +2 -2
  76. package/dist/material.css +1 -1
  77. package/dist/{merge-a7J0YkZX.js → merge-_Awk4ywA.js} +4 -4
  78. package/dist/{mermaid.core-CE34byhz.js → mermaid.core-DciYB1MV.js} +21 -21
  79. package/dist/{mindmap-definition-NLK3R4M7-emoij-nW.js → mindmap-definition-NLK3R4M7-Brf_2jIE.js} +2 -2
  80. package/dist/{pieDiagram-5QR66LMP-BdG1tWLn.js → pieDiagram-5QR66LMP-MPh-EWf-.js} +1 -1
  81. package/dist/print.js +2 -2
  82. package/dist/{quadrantDiagram-O4NWA36T-BCd-NwsO.js → quadrantDiagram-O4NWA36T-CwDeE9KB.js} +1 -1
  83. package/dist/{requirementDiagram-PLB6GJNP-CCcH5uSr.js → requirementDiagram-PLB6GJNP-CCP3YtvB.js} +2 -2
  84. package/dist/{sankeyDiagram-IPEJSGJF-78cK-bfe.js → sankeyDiagram-IPEJSGJF-vgVchd2a.js} +1 -1
  85. package/dist/{sortable-provider-VCxPasNp.js → sortable-provider-CzSnl6It.js} +1 -1
  86. package/dist/{stateDiagram-v2-GCMORJYK-B4ghJrhD.js → stateDiagram-v2-GCMORJYK-T-oIXh-8.js} +2 -2
  87. package/dist/{stored-language-CeD7kHui.js → stored-language-DmUUhRb5.js} +72 -6
  88. package/dist/{swimlanes-2SLR337P-DmHm2yJS.js → swimlanes-2SLR337P-tW3_wBWO.js} +3 -3
  89. package/dist/{swimlanesDiagram-TC7HE7FX-Dq3gGsPj.js → swimlanesDiagram-TC7HE7FX-B1lWzHp1.js} +3 -3
  90. package/dist/{timeline-definition-EJHVYXUP-EqJV_QKn.js → timeline-definition-EJHVYXUP-SdA6wt2-.js} +1 -1
  91. package/dist/{translate-material-DgRdhz5d.js → translate-material-DuY12xca.js} +2 -2
  92. package/dist/{translator-B4zUVm7j.js → translator-CaIYjyFP.js} +1 -1
  93. package/dist/{use-heading-spy-1BHMXjIn.js → use-heading-spy-Crdz4OH5.js} +2 -2
  94. package/dist/{use-material-translation-UbARR81K.js → use-material-translation-Od0QsFPA.js} +2 -2
  95. package/dist/{usecaseDiagram-POWQR4AR-CvCl0p5N.js → usecaseDiagram-POWQR4AR-B3rBcR4E.js} +2 -2
  96. package/dist/{xychartDiagram-PMCCYNJV-BphsHFKA.js → xychartDiagram-PMCCYNJV-stQWLgCx.js} +1 -1
  97. package/docs/components/README.md +2 -1
  98. package/docs/components/data-display.md +3 -3
  99. package/docs/components/data-table-filter-and-lists.md +5 -0
  100. package/docs/components/date-and-time.md +106 -6
  101. package/docs/components/feedback-and-status.md +1 -1
  102. package/docs/components/form-fields.md +8 -2
  103. package/docs/components/media-and-files.md +71 -1
  104. package/docs/components/primitives.md +1 -1
  105. package/docs/components/rich-widgets.md +1 -1
  106. package/docs/components/selection-and-choice.md +79 -2
  107. package/docs/guides/forms.md +2 -1
  108. package/docs/guides/i18n.md +47 -4
  109. package/docs/previews/date-time-daterangefield.webp +0 -0
  110. package/docs/previews/media-files-filepreview.webp +0 -0
  111. package/docs/previews/selection-choice-treeselectfield.webp +0 -0
  112. package/docs/roadmap.md +32 -27
  113. package/docs/troubleshooting.md +58 -0
  114. package/package.json +2 -2
  115. package/dist/lib/components/ui/fields/slider/slider-ticks.d.ts +0 -1
@@ -138,6 +138,9 @@ words in your error.
138
138
  - [The zoom changes by itself while a long PDF is open](#the-zoom-changes-by-itself-while-a-long-pdf-is-open)
139
139
  - [A link in a PDF replaces the page the reader is on](#a-link-in-a-pdf-replaces-the-page-the-reader-is-on)
140
140
  - [`onPageChange` is not called when `initialPage` is past the end, or after a new file](#onpagechange-is-not-called-when-initialpage-is-past-the-end-or-after-a-new-file)
141
+ - [`onPageChange` reports another page after opening on `initialPage`](#onpagechange-reports-another-page-after-opening-on-initialpage)
142
+ - [`FilePreview` shows a file card with a Download link for a PDF](#filepreview-shows-a-file-card-with-a-download-link-for-a-pdf)
143
+ - [`FilePreview` says "This file could not be previewed."](#filepreview-says-this-file-could-not-be-previewed)
141
144
  - [Reporting a bug](#reporting-a-bug)
142
145
 
143
146
  ---
@@ -2430,6 +2433,61 @@ before 2.2.0.
2430
2433
  to itself. Since 2.2.0 both are reported, once.
2431
2434
  **Fix:** update `@nxgt/material`. A page you kept in sync by hand can go.
2432
2435
 
2436
+ ### `onPageChange` reports another page after opening on `initialPage`
2437
+
2438
+ **When:** the reader opens on `initialPage` and, without the user scrolling,
2439
+ `onPageChange` reports another page, most often the last one, and the page field
2440
+ shows it. Seen on slow devices and busy machines, near the end of a
2441
+ document, with `@nxgt/material` 2.5.0 and earlier.
2442
+ **Why:** after placing the opening page, the reader ignored scrolling for
2443
+ only 150 ms. When the placement scroll landed later (a late frame), it was
2444
+ read as the user's, and at the end of the pages that is the last page.
2445
+ **Fix:** update `@nxgt/material`. The opening page now keeps the page number while
2446
+ the view stays on it; the user's own scroll, find in page or a screen
2447
+ reader moving the view still report the page they reach.
2448
+
2449
+ ### `FilePreview` shows a file card with a Download link for a PDF
2450
+
2451
+ **When:** a PDF given to `FilePreview` shows its name, size and a Download
2452
+ link instead of the reader.
2453
+ **Why:** `FilePreview` imports `PdfReader` the first time it previews a PDF,
2454
+ and falls back to the file card when that import fails: the viewer's chunk
2455
+ could not be fetched (a deploy replaced the chunks the open page was built
2456
+ with, or a network error), or the bundle has no `react-pdf` and `pdfjs-dist` — they are
2457
+ dependencies of `@nxgt/material`, not optional peers, so this is a bundler
2458
+ configuration that left them out. Nothing is thrown; the next PDF previewed
2459
+ tries again.
2460
+ **Fix:** reload the page after a deploy; otherwise check that your bundler
2461
+ keeps `react-pdf` and `pdfjs-dist` and pdf.js's worker (see `PdfReader` in
2462
+ [Media & files](components/media-and-files.md#pdfreader)). The same file in a
2463
+ `PdfReader` of its own shows the underlying error. A PDF the reader loaded
2464
+ but cannot open (a corrupt or password-protected file, a URL that answers an
2465
+ error page) is different: the preview stays `ready` and `PdfReader` shows its
2466
+ own error inside it.
2467
+
2468
+ ### `FilePreview` says "This file could not be previewed."
2469
+
2470
+ **When:** a `FilePreview` given a URL, or a file it cannot show, renders that
2471
+ message (and `onError` receives the error).
2472
+ **Why:** a text, JSON, CSV or Markdown URL is fetched with `fetch`: an HTTP
2473
+ error is a `FilePreviewHttpError` with its `status`, and a cross-origin URL
2474
+ without CORS headers is a `TypeError: Failed to fetch`. An image, video or
2475
+ audio file the browser cannot decode (a corrupt file, a codec the browser
2476
+ lacks, a URL that answers an error page) fails in its own element. A URL
2477
+ that is not `http(s):`, relative, `blob:`, or a `data:` URL of an image,
2478
+ video, audio file, plain text, CSV, Markdown, JSON or PDF (`javascript:`,
2479
+ `data:text/html`, and also a `data:` URL of XML, TSV or YAML, though
2480
+ `FilePreview` would show those kinds from a `Blob`) is refused before
2481
+ anything is linked, loaded or fetched: the error is a
2482
+ `FilePreviewUnsafeUrlError`, "Refused to preview a URL with an unsafe scheme", and there is no
2483
+ Download link.
2484
+ **Fix:** serve the file with `Access-Control-Allow-Origin` for your page's
2485
+ origin, or fetch it yourself (with your credentials) and pass the `Blob`;
2486
+ pass `type` when the server answers `application/octet-stream` for a file
2487
+ whose URL has no extension; pass a refused URL's file as a `Blob`, or from
2488
+ an `https:` URL. A text file larger than `maxTextBytes` is not an error: its
2489
+ beginning is shown, with "Showing the first … of this file." below.
2490
+
2433
2491
  ---
2434
2492
 
2435
2493
  ## Reporting a bug
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nxgt/material",
3
- "version": "2.5.0",
3
+ "version": "2.6.0",
4
4
  "license": "MIT",
5
5
  "bugs": {
6
6
  "email": "stevegires@gmail.com"
@@ -113,7 +113,7 @@
113
113
  "docs:previews": "vitest run --project previews"
114
114
  },
115
115
  "dependencies": {
116
- "@nxgt/material-core": "^0.2.0",
116
+ "@nxgt/material-core": "^0.3.0",
117
117
  "@base-ui/react": "^1.6.0",
118
118
  "@dnd-kit/core": "^6.3.1",
119
119
  "@dnd-kit/sortable": "^10.0.0",
@@ -1 +0,0 @@
1
- export declare function tickValues(min: number, max: number, ticks: boolean | number, step?: number): number[];