@nxgt/material 3.58.0 → 3.59.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +31 -0
- package/dist/{async-slice-C_Juki7i.js → async-slice-Cmvxrvn9.js} +2 -2
- package/dist/barcode.js +440 -0
- package/dist/{button-CCHGtPIN.js → button-Deo7l4wM.js} +1 -1
- package/dist/charts.js +3 -3
- package/dist/{chip-1XnyX4bd.js → chip-BlmIjpiD.js} +2 -2
- package/dist/{code-editor-1Y7ykpam.js → code-editor-BYEpBp_U.js} +11 -11
- package/dist/code-editor.js +5 -5
- package/dist/{code-language-items-Clbln9C6.js → code-language-items-Cqk4Fq61.js} +2 -2
- package/dist/components/components.css +1 -0
- package/dist/components/ui/widgets/barcode/barcode.css +112 -0
- package/dist/{components-Cj3lJ_uK.js → components-BsKpeqVX.js} +10568 -10517
- package/dist/components.js +26 -26
- package/dist/{dialog-Cx_xWUVR.js → dialog-1BstKBvt.js} +4 -4
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-Jp6pHNgP.js → dropdown-menu-hoaocAS7.js} +1 -1
- package/dist/editor.js +9 -9
- package/dist/{empty-state-D61RimJr.js → empty-state-DEG9h7xk.js} +2 -2
- package/dist/{escape-owner-Ch_-kDLw.js → escape-owner-BvLBo_Al.js} +22 -22
- package/dist/{field-blur-BJjUHsgJ.js → field-blur-BkeYPaWi.js} +1 -1
- package/dist/{field-blur-context-CmOF0FIN.js → field-blur-context-Ba7iZVm_.js} +1 -1
- package/dist/hooks.js +2 -2
- package/dist/{hover-card-CVmY0Z44.js → hover-card-C5DTU9P_.js} +2 -2
- package/dist/{i18n-provider-C0uLEv0G.js → i18n-provider-BJDI-A5w.js} +1 -1
- package/dist/i18n.js +5 -5
- package/dist/{icon-badge-bAQQK3ls.js → icon-badge-9ZE6k7cn.js} +3 -3
- package/dist/{icon-button-Csvj2R8S.js → icon-button-AwJtCkV5.js} +1 -1
- package/dist/lib/barcode/index.d.ts +15 -0
- package/dist/lib/components/ui/actions/index.d.ts +1 -0
- package/dist/lib/components/ui/actions/load-more-footer/index.d.ts +1 -0
- package/dist/lib/components/ui/actions/load-more-footer/load-more-footer.d.ts +24 -0
- package/dist/lib/components/ui/feedback/index.d.ts +1 -0
- package/dist/lib/components/ui/feedback/page-load-failed/index.d.ts +1 -0
- package/dist/lib/components/ui/feedback/page-load-failed/page-load-failed.d.ts +15 -0
- package/dist/lib/components/ui/fields/contacts/placeholders.d.ts +1 -1
- package/dist/lib/components/ui/widgets/barcode/barcode-error.d.ts +4 -0
- package/dist/lib/components/ui/widgets/barcode/barcode-geometry.d.ts +22 -0
- package/dist/lib/components/ui/widgets/barcode/barcode.d.ts +31 -0
- package/dist/lib/components/ui/widgets/barcode/code128.d.ts +15 -0
- package/dist/lib/components/ui/widgets/barcode/datamatrix-placement.d.ts +7 -0
- package/dist/lib/components/ui/widgets/barcode/datamatrix-rs.d.ts +2 -0
- package/dist/lib/components/ui/widgets/barcode/datamatrix-tables.d.ts +13 -0
- package/dist/lib/components/ui/widgets/barcode/datamatrix.d.ts +10 -0
- package/dist/lib/components/ui/widgets/barcode/encode.d.ts +12 -0
- package/dist/lib/components/ui/widgets/barcode/index.d.ts +6 -0
- package/dist/lib/components/ui/widgets/barcode/label-length.d.ts +4 -0
- package/dist/lib/components/ui/widgets/barcode/label-sheet.d.ts +37 -0
- package/dist/lib/i18n/resources/en/en.d.ts +8 -0
- package/dist/lib/i18n/resources/en/material.json.d.ts +8 -0
- package/dist/lib/i18n/resources/fr/fr.d.ts +8 -0
- package/dist/lib/i18n/resources/fr/material.json.d.ts +8 -0
- package/dist/lib/i18n/resources/resources.d.ts +16 -0
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib/print/components/print-section.d.ts +8 -1
- package/dist/lib.js +1 -1
- package/dist/main.js +43 -43
- package/dist/map.js +8 -8
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +4 -3
- package/dist/{public-B42vT7ee.js → public-CLkf8uky.js} +15 -15
- package/dist/{rich-code-block-DIJ1X1AF.js → rich-code-block-hJexXOdk.js} +5 -5
- package/dist/{sortable-provider-Csby6WpB.js → sortable-provider-DE-MSfeJ.js} +2 -2
- package/dist/{spinner-DC35lhqx.js → spinner-CquTUxzt.js} +1 -1
- package/dist/{stored-language-BIxd7uiP.js → stored-language-BDzGeEAm.js} +16 -0
- package/dist/theme-picker.js +2 -2
- package/dist/{theme-toggle-BWdNFLvB.js → theme-toggle-DBgsBw8S.js} +1 -1
- package/dist/{toolbar-items-oqmVfnfO.js → toolbar-items-Bm1baIp6.js} +4 -4
- package/dist/{translate-material-Bgtjuh85.js → translate-material-Q67GD4co.js} +2 -2
- package/dist/{translator-BrZv1U54.js → translator-CBhGdYun.js} +1 -1
- package/dist/{use-chat-composer-Dj0TP_B1.js → use-chat-composer-Cx7Q_KOV.js} +929 -929
- package/dist/{use-heading-spy-1Dqxj_JQ.js → use-heading-spy-COxCWqWF.js} +1 -1
- package/dist/{use-material-translation-DLdQKdfw.js → use-material-translation-BZAy_ffS.js} +2 -2
- package/docs/README.md +1 -0
- package/docs/components/buttons-and-actions.md +37 -0
- package/docs/components/feedback-and-status.md +25 -0
- package/docs/components/rich-widgets.md +31 -0
- package/docs/guides/barcode.md +203 -0
- package/docs/guides/printing.md +28 -3
- package/docs/previews/buttons-actions-loadmorefooter.webp +0 -0
- package/docs/previews/feedback-status-pageloadfailed.webp +0 -0
- package/docs/roadmap.md +14 -7
- package/docs/troubleshooting.md +62 -0
- package/lib/components/components.css +1 -0
- package/lib/components/ui/widgets/barcode/barcode.css +112 -0
- package/package.json +10 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @nxgt/material
|
|
2
2
|
|
|
3
|
+
## 3.59.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1970](https://github.com/softistx/nxgt-material/pull/1970) [`991aa74`](https://github.com/softistx/nxgt-material/commit/991aa746f83f04565da5dcb106213bd888fca991) Thanks [@SteveGT96](https://github.com/SteveGT96)! - Add `@nxgt/material/barcode`: `Barcode` draws Code 128 and Data Matrix as accessible SVG that follows the theme and dark mode (`appearance="paper"` keeps it dark on light) and prints black on white, and `LabelSheet` / `Label` lay a printed sheet of labels out by label size, columns, rows, gaps, a start offset and `skip`. The encoders are written in the package (no runtime dependency); `barcodeGeometry` returns the path for an SVG of your own. Nothing to migrate. Closes [#1963](https://github.com/softistx/nxgt-material/issues/1963).
|
|
8
|
+
|
|
9
|
+
- [#1985](https://github.com/softistx/nxgt-material/pull/1985) [`9ebd264`](https://github.com/softistx/nxgt-material/commit/9ebd26405cb7d48655db77087d08f1cf6d728248) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `LoadMoreFooter` (Buttons & actions) is the footer of a paged list: a "Showing N of M" line in a polite live region (`shown`, `total`), the load button (`hasMore`, `loading`, `label`, `onLoad`) and, with `failed`, an error alert in its place with a tonal "Try again" that calls `onLoad` and keeps the rows shown. It renders nothing when `hasMore` is false. `PageLoadFailed` (Feedback & status) is an `EmptyState` for a page opened at a cursor that failed, with a "Back to the start" link (`href`, rendered by the `LinkComponentProvider`'s component). New texts under `material.load-more.*`, in English and French. Additive; React only for now. Fixes [#1983](https://github.com/softistx/nxgt-material/issues/1983).
|
|
10
|
+
|
|
11
|
+
- [#1967](https://github.com/softistx/nxgt-material/pull/1967) [`204e4cd`](https://github.com/softistx/nxgt-material/commit/204e4cd05dfce84ad781af838d5f854ef71a48e4) Thanks [@SteveGT96](https://github.com/SteveGT96)! - print: a typed `keepTogether` option on `PrintSection` and on the `section` and `stack` nodes of a document as data moves a block to the next page whole rather than split across a break (react-pdf's `wrap={false}`, without a cast). Only for blocks shorter than a page: react-pdf cannot break a taller one, it overflows.
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#1982](https://github.com/softistx/nxgt-material/pull/1982) [`5cbed3b`](https://github.com/softistx/nxgt-material/commit/5cbed3b100b1c590778da0103d6f37610a25cfc5) Thanks [@SteveGT96](https://github.com/SteveGT96)! - Roadmap: the size-limit split shipped.
|
|
16
|
+
- Updated dependencies [[`204e4cd`](https://github.com/softistx/nxgt-material/commit/204e4cd05dfce84ad781af838d5f854ef71a48e4)]:
|
|
17
|
+
- @nxgt/material-core@0.43.0
|
|
18
|
+
|
|
3
19
|
## 3.58.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -199,6 +199,7 @@ reads `duotone.svg`, the file that exists (it used to ask for the missing
|
|
|
199
199
|
| `@nxgt/material/print` | PDF documents over `@react-pdf/renderer`: the `PrintDocument` page shell, the print blocks, `PrintDrawing` and the `drawing(scene)` node (a vector drawing from `@nxgt/material-core/draw` printed as vectors), and `PrintDataTable`, `PrintKeyValue` and `PrintMetric` from column definitions and plain rows; documents as plain data (`pdfDocument` and its builders, with `outline` and `conformance`); `registerPdfFont` (with the `PdfFontFaces` type) to embed a font, and the `PdfConformance` type for the PDF/A marker; a `numeric` column and `tabularNums` for figures that line up; `downloadPdf`, `openPdf`, `usePdfFile` and `pdfResponse` to get the file in one call — **its own entry, and not in the barrel above** ([printing guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/printing.md)) |
|
|
200
200
|
| `@nxgt/material/pdf-reader` | `PdfReader`, the redesigned PDF reader (header, floating page pill, rail and panel; `embedded`, `dialog`, `page` and `fullscreen` modes; single page and two-page layouts; `look="expressive"` by default, `"classic"` to opt out, type `PdfReaderLook`) and `configurePdfReader` for pdf.js's worker and assets. **Its own entry, browser-only** (pdf.js loads on first render); also exported as `PdfReader` from `/components` since 3.0 ([guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/pdf-reader.md)) |
|
|
201
201
|
| `@nxgt/material/charts` | Native SVG charts (d3-scale and d3-shape for the maths only) with keyboard point navigation, a screen-reader summary, a "View data" table and `patterns`: `LineChart` and `AreaChart` (`LineChartProps`, `AreaChartProps`, `ChartCurve`), `BarChart` (`BarChartProps`, `BarLayout`, `BarOrientation`), `PieChart` (`PieChartProps`), `DonutChart` (`DonutChartProps`), `Gauge` (`GaugeProps`, `GaugeSize`), `RadialBarChart` (`RadialBarChartProps`), `FunnelChart` (`FunnelChartProps`), `HeatmapChart` (`HeatmapChartProps`, `HeatColumn`), `RadarChart` (`RadarChartProps`), `ScatterChart` (`ScatterChartProps`, `ScatterSeries`, `ScatterPoint`), `ComboChart` (`ComboChartProps`, `ComboSeries`: bars, areas and lines, each on a left or a right axis), `zoom` (a mini overview with a window and two slider handles that picks the rows shown; `range`, `defaultRange`, `onRangeChange`) and `scroll` (a dense plot scrolls sideways on a phone, the value axis pinned) on the line, area, bar and combo charts (`ChartRangeProps`, `ChartZoomOptions`, `ChartScrollOptions`, `ChartRange`), `bands` (shaded ranges), `thresholds` (labelled lines) and `pointTone` (a ringed point with its word, `toneLabels`) on the line and area charts, read against the value axis and carried into the tooltip, the summary and the "View data" table (`ChartBand`, `ChartThreshold`), `onPointClick` on every chart but `Gauge`, `palette` (`'soft'`: the soft palette, or `data-chart-palette="soft"` on an ancestor; `ChartPalette`) on every chart, and the shared types (`ChartSlice`, `ChartRow`, `ChartValue`, `ChartColor`, `ChartShape`, `ChartSeries`, `ChartAxis`, `ChartXAxis`, `ChartPoint`, `ChartBaseProps`). `categoryLabel` names the "View data" table's category column: on Line, Area, Bar and Combo it defaults to the x axis label, on Radar and Heatmap it is always "Category" unless set. **Its own entry, client-only** (import it from a `'use client'` file), not in the barrel above; replaces the Nivo charts (removed in 3.0) of `/components` ([guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/charts.md)) |
|
|
202
|
+
| `@nxgt/material/barcode` | `Barcode` (Code 128 and Data Matrix as accessible SVG that follows the theme and dark mode, black on white in print; no runtime dependency) and `LabelSheet` / `Label` (label size, columns, rows, gaps and a start offset for a printed sheet of labels), plus `barcodeGeometry` and `BarcodeError` — **its own entry** ([barcode guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/barcode.md)) |
|
|
202
203
|
| `@nxgt/material/draw` | Vector drawing: a scene of plain data or JSX primitives drawn as accessible, themeable SVG that is safe under a strict CSP and identical on the server and in the browser. `Drawing` (`DrawingProps`, `NodeHandlers`; `scene` or `w`/`h` with children; a `title` (with an optional long `description`, written as a `<desc>`) or `decorative`, enforced by the type), the primitives `Rect`, `Ellipse`, `Circle`, `Line`, `Polygon`, `Path` (takes `node`), `Text`, `Group` and `Image`, and the builders of `@nxgt/material-core/draw` re-exported by name (`scene`, `rect`, `ellipse`, `circle`, `line`, `polygon`, `path`, `text`, `group`, `image`, `linear`, `radial`, `pattern`, `hatch`, `tone`, `toSVG`, `compileScene`, `ROLES`, `DRAW_PALETTE`, and the types `Scene`, `DrawNode`, `Paint`, `Role`, `ToneRef`), plus Material 3 Expressive's shapes (`shape`, `morph`, `SHAPE_NAMES`, `toCubics`) and the layout helpers (`bbox`, `stack`, `grid`, `align`, `distribute`) re-exported by name. Colours are theme roles (`primary-container`, `on-surface`...) mapped to classes in `styles.css`, so import it. Interactive nodes are focusable `button`s with a focus ring; wrapped text is re-measured by the browser once mounted. **Its own entry, client-only** (render `Drawing` from a `'use client'` file; the builders and `toSVG` run anywhere), not in the barrel above ([drawing guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/drawing.md)) |
|
|
203
204
|
| `@nxgt/material/draw/sketch` | The sketchy, hand-drawn style for a drawing: `Sketch` (`seed`, `roughness`, `bowing`, `fill`: `hachure`, `cross-hatch`, `solid` or `none`, `hachureAngle`, `hachureGap`, `strokeWidth`) wraps a `Drawing`, or primitives inside one, and draws shapes as double wobbling strokes with hatched fills; `sketch(sceneOrNode, options)` does it to plain data for `toSVG`. Seeded, so the server and the client draw the same lines; ids, labels, focus rings and events keep working. **Its own entry, client-only** (render `Sketch` from a `'use client'` file), not in the barrel above ([drawing guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/drawing.md#sketch)) |
|
|
204
205
|
| `@nxgt/material/map` | Leaflet maps, markers, a location field — **its own entry, not in the barrel, and browser-only** ([maps guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/maps.md)) |
|
|
@@ -419,6 +420,32 @@ from `@nxgt/material/print` puts it in a PDF as vectors. The
|
|
|
419
420
|
[drawing guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/drawing.md)
|
|
420
421
|
covers colours, accessibility, events, sketch, animation, PNG, PDF and e-mail.
|
|
421
422
|
|
|
423
|
+
### Barcodes and label sheets
|
|
424
|
+
|
|
425
|
+
`@nxgt/material/barcode` draws Code 128 and Data Matrix as accessible SVG, with
|
|
426
|
+
encoders written in the package (no runtime dependency). The symbol follows the
|
|
427
|
+
theme on screen (`appearance="paper"` keeps it dark on light) and prints black
|
|
428
|
+
on white; `LabelSheet` lays printed labels out by size, columns, rows and gaps.
|
|
429
|
+
Its own entry, server-safe.
|
|
430
|
+
|
|
431
|
+
```tsx
|
|
432
|
+
import { Barcode, Label, LabelSheet } from '@nxgt/material/barcode';
|
|
433
|
+
|
|
434
|
+
<Barcode value="TUBE-0042" label="Tube 0042" showText />
|
|
435
|
+
<Barcode value="TUBE-0042" symbology="datamatrix" />
|
|
436
|
+
|
|
437
|
+
<LabelSheet label={{ width: '50mm', height: '25mm' }} columns={3} rows={8} gap="2mm">
|
|
438
|
+
{items.map((i) => (
|
|
439
|
+
<Label key={i.id}>
|
|
440
|
+
<Barcode value={i.code} decorative />
|
|
441
|
+
{i.code}
|
|
442
|
+
</Label>
|
|
443
|
+
))}
|
|
444
|
+
</LabelSheet>
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
The [barcode guide](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/barcode.md) covers the props, start offsets and `skip`, errors and printing.
|
|
448
|
+
|
|
422
449
|
## Guides
|
|
423
450
|
|
|
424
451
|
Each area a consumer starts from has its own page under `docs/guides/`.
|
|
@@ -434,6 +461,7 @@ Each area a consumer starts from has its own page under `docs/guides/`.
|
|
|
434
461
|
| [Maps](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/maps.md) | using `@nxgt/material/map` — browser-only, optional leaflet peers, `map.css` |
|
|
435
462
|
| [Charts](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/charts.md) | drawing charts with `@nxgt/material/charts` (client-only): the twelve charts, shared props, legend, View data, `onPointClick`, reference bands, thresholds and point tones on the line chart, zoom and phone scroll, right-to-left pages, keyboard and accessibility, theming the `--chart-*` tokens, and migrating from the Nivo charts, removed in 3.0 |
|
|
436
463
|
| [Drawing](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/drawing.md) | drawing diagrams, badges and illustrations from code with `@nxgt/material/draw`: a scene or JSX, theme roles and tones, strict CSP, accessibility, events, sketch, animation, PNG, PDF and e-mail |
|
|
464
|
+
| [Barcodes](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/barcode.md) | Code 128 and Data Matrix with `@nxgt/material/barcode`: props, paper appearance, accessibility, `barcodeGeometry`, `LabelSheet` label sizes, offsets and `skip`, errors and printing |
|
|
437
465
|
| [Backgrounds](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/backgrounds.md) | tones, intensity, the opt-in `backgrounds.css` and per-preset files, custom tone tokens, motion and CSP |
|
|
438
466
|
| [Illustrations](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/illustrations.md) | `@nxgt/material/illustrations`: the twelve scenes and the health and education sets, icons from your sprites, `EmptyState` / `ErrorState` / `DataTable` with `illustration`, `IllustrationDefaults` for an app, sizes, motion and CSP |
|
|
439
467
|
| [Icon motifs](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/guides/icon-motifs.md) | icon backgrounds, celestial skies, illustrations and themes together: serving your own Font Awesome sprites (the package ships none), `IconSpritesProvider`, `icons` / `iconStyle` / `iconMotif`, `sky`, the health and education sets, a theme naming its motif, Free fallbacks for Pro-only names |
|
|
@@ -519,6 +547,7 @@ Not components: what the stylesheet gives any element.
|
|
|
519
547
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/buttons-actions-copybutton.webp" width="120" alt="CopyButton"> | [`CopyButton`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/buttons-and-actions.md#copybutton), `CopyValue` | Copies a value to the clipboard and briefly shows a check mark. `CopyValue` displays the value next to the button. | `CopyButton`, `CopyValue` |
|
|
520
548
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/buttons-actions-highlighttext.webp" width="120" alt="HighlightText"> | [`HighlightText`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/buttons-and-actions.md#highlighttext) | Marks case-insensitive matches of a query inside a string (`splitMatch`). | `HighlightText` |
|
|
521
549
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/buttons-actions-loadmorebutton.webp" width="120" alt="LoadMoreButton"> | [`LoadMoreButton`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/buttons-and-actions.md#loadmorebutton) | "Load more" button for cursor pagination; icon-only with a tooltip unless `expanded`. | `LoadMoreButton` |
|
|
550
|
+
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/buttons-actions-loadmorefooter.webp" width="120" alt="LoadMoreFooter"> | [`LoadMoreFooter`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/buttons-and-actions.md#loadmorefooter) | Footer of a paged list: shown-of-total line, load button, and a failed state with retry. | not yet |
|
|
522
551
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/buttons-actions-scrolltotop.webp" width="120" alt="ScrollToTop"> | [`ScrollToTop`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/buttons-and-actions.md#scrolltotop) | Floating button that appears past a scroll threshold. | `ScrollToTop` |
|
|
523
552
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/buttons-actions-scrolltolatestbutton.webp" width="120" alt="ScrollToLatestButton"> | [`ScrollToLatestButton`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/buttons-and-actions.md#scrolltolatestbutton) | "Jump to latest" over a scroll box: an arrow that widens into "3 new messages". | — |
|
|
524
553
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/buttons-actions-actioncard.webp" width="120" alt="ActionCard"> | [`ActionCard`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/buttons-and-actions.md#actioncard) | Clickable card (a `role="button"` with `aria-pressed`) with a shape icon that morphs when chosen, title, description and active indicator; `status`, `meta`, a trailing `action` (a `RowMenu`) and `variant="tile"` make a compact cell for status boards; `titleLink` makes the title a link and `footer` adds a row of secondary links. | `ActionCard` |
|
|
@@ -708,6 +737,7 @@ Not components: what the stylesheet gives any element.
|
|
|
708
737
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/feedback-status-customdialog.webp" width="120" alt="CustomDialog"> | [`CustomDialog`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/feedback-and-status.md#customdialog) | Ready-made dialog with trigger, icon, title, body and footer. | `CustomDialog` |
|
|
709
738
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/feedback-status-stepupdialog.webp" width="120" alt="StepUpDialog"> | [`StepUpDialog`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/feedback-and-status.md#stepupdialog) | "Confirm it's you": a dialog that asks for a one-time code, driven by props (`via`, `attemptsLeft`, `error`, `pending`, `confirming`). The title takes the focus, the field after a refusal; `DialogFooter` `stackOnPhone={false}` keeps its footer one row on a phone. | — |
|
|
710
739
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/feedback-status-emptystate.webp" width="120" alt="EmptyState"> | [`EmptyState`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/feedback-and-status.md#emptystate) | Illustration, title, description and action, by kind (empty, search, not-found, unauthorized); `compact` size, or `inline` as one row in a list. | `EmptyState` |
|
|
740
|
+
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/feedback-status-pageloadfailed.webp" width="120" alt="PageLoadFailed"> | [`PageLoadFailed`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/feedback-and-status.md#pageloadfailed) | An `EmptyState` for a page opened at a cursor that failed, with a "Back to the start" link. | not yet |
|
|
711
741
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/feedback-status-errorstate.webp" width="120" alt="ErrorState"> | [`ErrorState`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/feedback-and-status.md#errorstate) | Failure block (`role="alert"`) with illustration, outlined Retry and collapsed technical details; generic, offline and maintenance kinds. | `ErrorState` |
|
|
712
742
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/feedback-status-progress.webp" width="120" alt="Progress"> | [`Progress`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/feedback-and-status.md#progress), `CircularProgress`, `ProgressField` | Material 3 Expressive linear bar and circular ring (flat or wavy, eight tones, buffer and stop dot), and a labelled progress field. | `Progress`, `CircularProgress`, `ProgressField` |
|
|
713
743
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/feedback-status-scrollprogress.webp" width="120" alt="ScrollProgress"> | [`ScrollProgress`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/feedback-and-status.md#scrollprogress) | Hairline that tracks window or a scrollable `target` (`react-use` `useWindowScroll` / `useScroll`). `DocProgress` composes it. | `ScrollProgress` |
|
|
@@ -766,6 +796,7 @@ Not components: what the stylesheet gives any element.
|
|
|
766
796
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/rich-widgets-codeeditor-diff.webp" width="120" alt="CodeDiff"> | [`CodeDiff`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/rich-widgets.md#codediff) | A Monaco diff in the code editor's frame and themes: side by side or inline (always inline on a phone), previous/next change, `+N −M` counts and copy. From `@nxgt/material/code-editor`. | `CodeDiff` |
|
|
767
797
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/rich-widgets-quiz.webp" width="120" alt="Quiz"> | [`Quiz`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/rich-widgets.md#quiz), `QuestionCard` · [`QuestionNavigator`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/rich-widgets.md#questionnavigator) | Exam or practice quizzes: step progress, instant feedback with explanations and hints, a time limit, keyboard shortcuts, and a results screen with a score ring, a breakdown and a retry of the misses. Container queries. | `Quiz`, `QuestionCard` (modes and results: React only for now); `QuestionNavigator` React only for now |
|
|
768
798
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/rich-widgets-drawing.webp" width="120" alt="Drawing"> | [`Drawing`, `Rect`, `Ellipse`, `Circle`, `Line`, `Polygon`, `Path`, `Text`, `Group`, `Image`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/rich-widgets.md#drawing) from `@nxgt/material/draw` | Vector drawings from a scene of plain data or from JSX: theme-role colours that follow light and dark, no inline style (strict CSP), a `title` or `decorative` enforced by the type, focusable nodes with `onClick` and a focus ring, text that wraps with Inter's metrics and is refined by the browser. Client-only entry. | React only for now |
|
|
799
|
+
| — | [`Barcode`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/rich-widgets.md#barcode), `LabelSheet`, `Label`, `barcodeGeometry` | Code 128 and Data Matrix as accessible SVG that follows the theme and prints black on white, and a printed sheet of labels. Its own entry, `@nxgt/material/barcode`, server-safe. | React only for now |
|
|
769
800
|
|
|
770
801
|
`RadioGroupField`, `SliderField` and `SwitchField` are aliases of the
|
|
771
802
|
labelled `RadioGroup`, `Slider` and `Switch`, under the names
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as e, r as t, t as n } from "./stored-language-
|
|
2
|
-
import { r } from "./translator-
|
|
1
|
+
import { i as e, r as t, t as n } from "./stored-language-BDzGeEAm.js";
|
|
2
|
+
import { r } from "./translator-CBhGdYun.js";
|
|
3
3
|
import { t as i } from "./_baseIsEqual-C6ksIHya.js";
|
|
4
4
|
import { useMemo as a } from "react";
|
|
5
5
|
import { asyncThunkCreator as o, buildCreateSlice as s } from "@reduxjs/toolkit";
|
package/dist/barcode.js
ADDED
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
import { Children as e, useLayoutEffect as t, useMemo as n, useRef as r } from "react";
|
|
2
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
3
|
+
//#region lib/components/ui/widgets/barcode/barcode-error.ts
|
|
4
|
+
var o = class extends Error {
|
|
5
|
+
constructor(e) {
|
|
6
|
+
super(e), this.name = "BarcodeError";
|
|
7
|
+
}
|
|
8
|
+
}, s = "212222 222122 222221 121223 121322 131222 122213 122312 132212 221213\n221312 231212 112232 122132 122231 113222 123122 123221 223211 221132\n221231 213212 223112 312131 311222 321122 321221 312212 322112 322211\n212123 212321 232121 111323 131123 131321 112313 132113 132311 211313\n231113 231311 112133 112331 132131 113123 113321 133121 313121 211331\n231131 213113 213311 213131 311123 311321 331121 312113 312311 332111\n314111 221411 431111 111224 111422 121124 121421 141122 141221 112214\n112412 122114 122411 142112 142211 241211 221114 413111 241112 134111\n111242 121142 121241 114212 124112 124211 411212 421112 421211 212141\n214121 412121 111143 111341 131141 114113 114311 411113 411311 113141\n114131 311141 411131 211412 211214 211232 2331112".split(/\s+/), c = [
|
|
9
|
+
"A",
|
|
10
|
+
"B",
|
|
11
|
+
"C"
|
|
12
|
+
], l = {
|
|
13
|
+
A: 103,
|
|
14
|
+
B: 104,
|
|
15
|
+
C: 105
|
|
16
|
+
}, u = {
|
|
17
|
+
A: 101,
|
|
18
|
+
B: 100,
|
|
19
|
+
C: 99
|
|
20
|
+
}, d = 106, f = (e) => e >= 48 && e <= 57;
|
|
21
|
+
function p(e, t, n) {
|
|
22
|
+
let r = e[t];
|
|
23
|
+
if (n === "C") {
|
|
24
|
+
let n = e[t + 1];
|
|
25
|
+
return f(r) && n !== void 0 && f(n) ? {
|
|
26
|
+
len: 2,
|
|
27
|
+
value: (r - 48) * 10 + (n - 48)
|
|
28
|
+
} : null;
|
|
29
|
+
}
|
|
30
|
+
return n === "A" ? r < 32 ? {
|
|
31
|
+
len: 1,
|
|
32
|
+
value: r + 64
|
|
33
|
+
} : r < 96 ? {
|
|
34
|
+
len: 1,
|
|
35
|
+
value: r - 32
|
|
36
|
+
} : null : r >= 32 ? {
|
|
37
|
+
len: 1,
|
|
38
|
+
value: r - 32
|
|
39
|
+
} : null;
|
|
40
|
+
}
|
|
41
|
+
function m(e) {
|
|
42
|
+
if (e.length === 0) throw new o("Code 128 needs a value: got an empty string");
|
|
43
|
+
let t = Array.from(e, (e) => e.codePointAt(0));
|
|
44
|
+
for (let e of t) if (e > 127) throw new o("Code 128 holds ASCII only (0-127): use symbology=\"datamatrix\" for other text");
|
|
45
|
+
let n = t.length, r = 1e9, i = [], a = [];
|
|
46
|
+
for (let e = 0; e <= n; e++) i[e] = [
|
|
47
|
+
r,
|
|
48
|
+
r,
|
|
49
|
+
r
|
|
50
|
+
], a[e] = [
|
|
51
|
+
0,
|
|
52
|
+
0,
|
|
53
|
+
0
|
|
54
|
+
];
|
|
55
|
+
for (let e = n - 1; e >= 0; e--) {
|
|
56
|
+
for (let n = 0; n < 3; n++) {
|
|
57
|
+
let o = p(t, e, c[n]), s = o ? a[e + o.len][n] : r;
|
|
58
|
+
i[e][n] = o ? 1 + s : r;
|
|
59
|
+
}
|
|
60
|
+
for (let t = 0; t < 3; t++) {
|
|
61
|
+
let n = i[e][t];
|
|
62
|
+
for (let r = 0; r < 3; r++) r !== t && (n = Math.min(n, 1 + i[e][r]));
|
|
63
|
+
a[e][t] = n;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
let s = [
|
|
67
|
+
0,
|
|
68
|
+
1,
|
|
69
|
+
2
|
|
70
|
+
], f = (e) => i[0][e], m = s[0];
|
|
71
|
+
for (let e of s) f(e) < f(m) && (m = e);
|
|
72
|
+
let h = [l[c[m]]], g = 0;
|
|
73
|
+
for (; g < n;) {
|
|
74
|
+
let e = p(t, g, c[m]), n = i[g][m], r = a[g][m];
|
|
75
|
+
if (!e || n !== r) {
|
|
76
|
+
let n = -1;
|
|
77
|
+
for (let e of s) if (e !== m && 1 + i[g][e] === r) {
|
|
78
|
+
n = e;
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
m = n, h.push(u[c[m]]), e = p(t, g, c[m]);
|
|
82
|
+
}
|
|
83
|
+
h.push(e.value), g += e.len;
|
|
84
|
+
}
|
|
85
|
+
let _ = h[0];
|
|
86
|
+
for (let e = 1; e < h.length; e++) _ += e * h[e];
|
|
87
|
+
return h.push(_ % 103, d), h;
|
|
88
|
+
}
|
|
89
|
+
function h(e) {
|
|
90
|
+
let t = [];
|
|
91
|
+
for (let n of e) for (let e of s[n]) t.push(Number(e));
|
|
92
|
+
return t;
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region lib/components/ui/widgets/barcode/datamatrix-placement.ts
|
|
96
|
+
function g(e, t, n, r) {
|
|
97
|
+
e(t - 2, n - 2, r, 1), e(t - 2, n - 1, r, 2), e(t - 1, n - 2, r, 3), e(t - 1, n - 1, r, 4), e(t - 1, n, r, 5), e(t, n - 2, r, 6), e(t, n - 1, r, 7), e(t, n, r, 8);
|
|
98
|
+
}
|
|
99
|
+
function _(e, t, n, { nrow: r, ncol: i }) {
|
|
100
|
+
let a = r, o = i;
|
|
101
|
+
({
|
|
102
|
+
1: [
|
|
103
|
+
[a - 1, 0],
|
|
104
|
+
[a - 1, 1],
|
|
105
|
+
[a - 1, 2],
|
|
106
|
+
[0, o - 2],
|
|
107
|
+
[0, o - 1],
|
|
108
|
+
[1, o - 1],
|
|
109
|
+
[2, o - 1],
|
|
110
|
+
[3, o - 1]
|
|
111
|
+
],
|
|
112
|
+
2: [
|
|
113
|
+
[a - 3, 0],
|
|
114
|
+
[a - 2, 0],
|
|
115
|
+
[a - 1, 0],
|
|
116
|
+
[0, o - 4],
|
|
117
|
+
[0, o - 3],
|
|
118
|
+
[0, o - 2],
|
|
119
|
+
[0, o - 1],
|
|
120
|
+
[1, o - 1]
|
|
121
|
+
],
|
|
122
|
+
3: [
|
|
123
|
+
[a - 3, 0],
|
|
124
|
+
[a - 2, 0],
|
|
125
|
+
[a - 1, 0],
|
|
126
|
+
[0, o - 2],
|
|
127
|
+
[0, o - 1],
|
|
128
|
+
[1, o - 1],
|
|
129
|
+
[2, o - 1],
|
|
130
|
+
[3, o - 1]
|
|
131
|
+
],
|
|
132
|
+
4: [
|
|
133
|
+
[a - 1, 0],
|
|
134
|
+
[a - 1, o - 1],
|
|
135
|
+
[0, o - 3],
|
|
136
|
+
[0, o - 2],
|
|
137
|
+
[0, o - 1],
|
|
138
|
+
[1, o - 3],
|
|
139
|
+
[1, o - 2],
|
|
140
|
+
[1, o - 1]
|
|
141
|
+
]
|
|
142
|
+
})[t].forEach(([t, r], i) => {
|
|
143
|
+
e(t, r, n, i + 1);
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
function v(e, t, n) {
|
|
147
|
+
let r = Array(t * n).fill(!1), i = Array(t * n).fill(!1), a = (a, o, s, c) => {
|
|
148
|
+
let l = a, u = o;
|
|
149
|
+
l < 0 && (l += t, u += 4 - (t + 4) % 8), u < 0 && (u += n, l += 4 - (n + 4) % 8), r[l * n + u] = (e[s] >> 8 - c & 1) == 1, i[l * n + u] = !0;
|
|
150
|
+
}, o = {
|
|
151
|
+
nrow: t,
|
|
152
|
+
ncol: n
|
|
153
|
+
}, s = (e, t) => !i[e * n + t], c = 0, l = 4, u = 0;
|
|
154
|
+
do {
|
|
155
|
+
l === t && u === 0 && _(a, 1, c++, o), l === t - 2 && u === 0 && n % 4 != 0 && _(a, 2, c++, o), l === t - 2 && u === 0 && n % 8 == 4 && _(a, 3, c++, o), l === t + 4 && u === 2 && n % 8 == 0 && _(a, 4, c++, o);
|
|
156
|
+
do
|
|
157
|
+
l < t && u >= 0 && s(l, u) && g(a, l, u, c++), l -= 2, u += 2;
|
|
158
|
+
while (l >= 0 && u < n);
|
|
159
|
+
l += 1, u += 3;
|
|
160
|
+
do
|
|
161
|
+
l >= 0 && u < n && s(l, u) && g(a, l, u, c++), l += 2, u -= 2;
|
|
162
|
+
while (l < t && u >= 0);
|
|
163
|
+
l += 3, u += 1;
|
|
164
|
+
} while (l < t || u < n);
|
|
165
|
+
let d = t * n - 1;
|
|
166
|
+
return i[d] || (r[d] = !0, r[d - n - 1] = !0), r;
|
|
167
|
+
}
|
|
168
|
+
//#endregion
|
|
169
|
+
//#region lib/components/ui/widgets/barcode/datamatrix-rs.ts
|
|
170
|
+
var y = /* @__PURE__ */ new Uint8Array(512), b = /* @__PURE__ */ new Uint8Array(256);
|
|
171
|
+
{
|
|
172
|
+
let e = 1;
|
|
173
|
+
for (let t = 0; t < 255; t++) y[t] = e, b[e] = t, e <<= 1, e & 256 && (e ^= 301);
|
|
174
|
+
for (let e = 255; e < 512; e++) y[e] = y[e - 255];
|
|
175
|
+
}
|
|
176
|
+
var x = /* @__PURE__ */ new Map();
|
|
177
|
+
function S(e) {
|
|
178
|
+
let t = x.get(e);
|
|
179
|
+
if (t) return t;
|
|
180
|
+
let n = [1];
|
|
181
|
+
for (let t = 1; t <= e; t++) {
|
|
182
|
+
let e = Array(n.length + 1).fill(0);
|
|
183
|
+
for (let r = 0; r < n.length; r++) e[r] ^= n[r], e[r + 1] ^= n[r] === 0 ? 0 : y[b[n[r]] + t];
|
|
184
|
+
n = e;
|
|
185
|
+
}
|
|
186
|
+
return x.set(e, n), n;
|
|
187
|
+
}
|
|
188
|
+
function C(e, t) {
|
|
189
|
+
let n = S(t), r = Array(t).fill(0);
|
|
190
|
+
for (let i of e) {
|
|
191
|
+
let e = i ^ r[0];
|
|
192
|
+
if (r.shift(), r.push(0), e !== 0) for (let i = 0; i < t; i++) {
|
|
193
|
+
let t = n[i + 1];
|
|
194
|
+
t !== 0 && (r[i] ^= y[b[e] + b[t]]);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return r;
|
|
198
|
+
}
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region lib/components/ui/widgets/barcode/datamatrix-tables.ts
|
|
201
|
+
var w = (e, t, n, r, i = 1) => ({
|
|
202
|
+
side: e,
|
|
203
|
+
regions: t,
|
|
204
|
+
data: n,
|
|
205
|
+
ecc: r,
|
|
206
|
+
blocks: i
|
|
207
|
+
}), T = [
|
|
208
|
+
w(10, 1, 3, 5),
|
|
209
|
+
w(12, 1, 5, 7),
|
|
210
|
+
w(14, 1, 8, 10),
|
|
211
|
+
w(16, 1, 12, 12),
|
|
212
|
+
w(18, 1, 18, 14),
|
|
213
|
+
w(20, 1, 22, 18),
|
|
214
|
+
w(22, 1, 30, 20),
|
|
215
|
+
w(24, 1, 36, 24),
|
|
216
|
+
w(26, 1, 44, 28),
|
|
217
|
+
w(32, 2, 62, 36),
|
|
218
|
+
w(36, 2, 86, 42),
|
|
219
|
+
w(40, 2, 114, 48),
|
|
220
|
+
w(44, 2, 144, 56),
|
|
221
|
+
w(48, 2, 174, 68),
|
|
222
|
+
w(52, 2, 204, 84, 2),
|
|
223
|
+
w(64, 4, 280, 112, 2),
|
|
224
|
+
w(72, 4, 368, 144, 4),
|
|
225
|
+
w(80, 4, 456, 192, 4),
|
|
226
|
+
w(88, 4, 576, 224, 4),
|
|
227
|
+
w(96, 4, 696, 272, 4),
|
|
228
|
+
w(104, 4, 816, 336, 6),
|
|
229
|
+
w(120, 6, 1050, 408, 6),
|
|
230
|
+
w(132, 6, 1304, 496, 8),
|
|
231
|
+
w(144, 6, 1558, 620, 10)
|
|
232
|
+
];
|
|
233
|
+
//#endregion
|
|
234
|
+
//#region lib/components/ui/widgets/barcode/datamatrix.ts
|
|
235
|
+
function E(e) {
|
|
236
|
+
let t = new TextEncoder().encode(e), n = [];
|
|
237
|
+
for (let e = 0; e < t.length; e++) {
|
|
238
|
+
let r = t[e], i = t[e + 1];
|
|
239
|
+
r >= 48 && r <= 57 && i !== void 0 && i >= 48 && i <= 57 ? (n.push(130 + (r - 48) * 10 + (i - 48)), e++) : r < 128 ? n.push(r + 1) : n.push(235, r - 127);
|
|
240
|
+
}
|
|
241
|
+
return n;
|
|
242
|
+
}
|
|
243
|
+
function D(e, t) {
|
|
244
|
+
let n = e.slice();
|
|
245
|
+
for (n.length < t && n.push(129); n.length < t;) {
|
|
246
|
+
let e = 129 + (149 * (n.length + 1) % 253 + 1);
|
|
247
|
+
n.push(e > 254 ? e - 254 : e);
|
|
248
|
+
}
|
|
249
|
+
return n;
|
|
250
|
+
}
|
|
251
|
+
function O(e) {
|
|
252
|
+
if (e.length === 0) throw new o("Data Matrix needs a value: got an empty string");
|
|
253
|
+
let t = E(e), n = T.find((e) => e.data >= t.length);
|
|
254
|
+
if (!n) throw new o(`Data Matrix holds at most 1558 codewords (about 3116 digits): got ${t.length}`);
|
|
255
|
+
let r = D(t, n.data), { blocks: i } = n, a = n.ecc / i, s = Array.from({ length: i }, () => []);
|
|
256
|
+
r.forEach((e, t) => {
|
|
257
|
+
s[t % i].push(e);
|
|
258
|
+
});
|
|
259
|
+
let c = s.map((e) => C(e, a)), l = r.slice();
|
|
260
|
+
for (let e = 0; e < a; e++) for (let t = 0; t < i; t++) l.push(c[t][e]);
|
|
261
|
+
let { side: u, regions: d } = n, f = u / d, p = f - 2, m = p * d, h = v(l, m, m), g = Array.from({ length: u }, () => Array(u).fill(!1));
|
|
262
|
+
for (let e = 0; e < d; e++) for (let t = 0; t < d; t++) {
|
|
263
|
+
let n = e * f, r = t * f;
|
|
264
|
+
for (let e = 0; e < f; e++) g[n + f - 1][r + e] = !0, g[n + e][r] = !0, g[n][r + e] = e % 2 == 0;
|
|
265
|
+
for (let e = 0; e < f; e++) g[n + e][r + f - 1] = e % 2 == 1;
|
|
266
|
+
for (let i = 0; i < p; i++) for (let a = 0; a < p; a++) g[n + 1 + i][r + 1 + a] = h[(e * p + i) * m + t * p + a] === !0;
|
|
267
|
+
}
|
|
268
|
+
return g;
|
|
269
|
+
}
|
|
270
|
+
//#endregion
|
|
271
|
+
//#region lib/components/ui/widgets/barcode/encode.ts
|
|
272
|
+
function k(e, t = "code128") {
|
|
273
|
+
if (t === "code128") {
|
|
274
|
+
let n = h(m(e)), r = [], i = 0;
|
|
275
|
+
return n.forEach((e, t) => {
|
|
276
|
+
t % 2 == 0 && r.push([i, e]), i += e;
|
|
277
|
+
}), {
|
|
278
|
+
symbology: t,
|
|
279
|
+
width: i,
|
|
280
|
+
runs: r
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
if (t === "datamatrix") {
|
|
284
|
+
let n = O(e);
|
|
285
|
+
return {
|
|
286
|
+
symbology: t,
|
|
287
|
+
width: n.length,
|
|
288
|
+
rows: n
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
throw new o(`Unknown symbology "${String(t)}": use "code128" or "datamatrix"`);
|
|
292
|
+
}
|
|
293
|
+
//#endregion
|
|
294
|
+
//#region lib/components/ui/widgets/barcode/barcode-geometry.ts
|
|
295
|
+
function A(e, t = {}) {
|
|
296
|
+
let n = t.symbology ?? "code128", r = k(e, n);
|
|
297
|
+
if (r.symbology === "code128") {
|
|
298
|
+
let e = t.quietZone ?? 10, i = t.barHeight ?? 40, a = t.textHeight ?? 0, o = r.runs.map(([t, n]) => `M${t + e} 0h${n}v${i}h${-n}z`).join("");
|
|
299
|
+
return {
|
|
300
|
+
symbology: n,
|
|
301
|
+
width: r.width + 2 * e,
|
|
302
|
+
height: i + a,
|
|
303
|
+
path: o,
|
|
304
|
+
textY: i + a * .8
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
let i = t.quietZone ?? 2, a = r.width, o = "";
|
|
308
|
+
return r.rows.forEach((e, t) => {
|
|
309
|
+
let n = 0;
|
|
310
|
+
for (; n < a;) {
|
|
311
|
+
if (!e[n]) {
|
|
312
|
+
n++;
|
|
313
|
+
continue;
|
|
314
|
+
}
|
|
315
|
+
let r = n;
|
|
316
|
+
for (; e[r];) r++;
|
|
317
|
+
o += `M${n + i} ${t + i}h${r - n}v1h${n - r}z`, n = r;
|
|
318
|
+
}
|
|
319
|
+
}), {
|
|
320
|
+
symbology: n,
|
|
321
|
+
width: a + 2 * i,
|
|
322
|
+
height: a + 2 * i,
|
|
323
|
+
path: o,
|
|
324
|
+
textY: 0
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
//#endregion
|
|
328
|
+
//#region lib/components/ui/widgets/barcode/barcode.tsx
|
|
329
|
+
var j = 12;
|
|
330
|
+
function M({ value: e, symbology: t = "code128", label: r, decorative: o = !1, showText: s = !1, appearance: c = "themed", moduleSize: l, quietZone: u, barHeight: d, className: f, ...p }) {
|
|
331
|
+
let m = s && t === "code128" ? j : 0, h = n(() => A(e, {
|
|
332
|
+
symbology: t,
|
|
333
|
+
quietZone: u,
|
|
334
|
+
barHeight: d,
|
|
335
|
+
textHeight: m
|
|
336
|
+
}), [
|
|
337
|
+
e,
|
|
338
|
+
t,
|
|
339
|
+
u,
|
|
340
|
+
d,
|
|
341
|
+
m
|
|
342
|
+
]), g = r ?? e, _ = l ? {
|
|
343
|
+
width: h.width * l,
|
|
344
|
+
height: h.height * l
|
|
345
|
+
} : {};
|
|
346
|
+
return /* @__PURE__ */ a("svg", {
|
|
347
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
348
|
+
viewBox: `0 0 ${h.width} ${h.height}`,
|
|
349
|
+
shapeRendering: "crispEdges",
|
|
350
|
+
"data-symbology": t,
|
|
351
|
+
"data-appearance": c,
|
|
352
|
+
...o ? { "aria-hidden": !0 } : {
|
|
353
|
+
role: "img",
|
|
354
|
+
"aria-label": g
|
|
355
|
+
},
|
|
356
|
+
..._,
|
|
357
|
+
...p,
|
|
358
|
+
className: f ? `nxgt-barcode ${f}` : "nxgt-barcode",
|
|
359
|
+
children: [
|
|
360
|
+
o ? null : /* @__PURE__ */ i("title", { children: g }),
|
|
361
|
+
/* @__PURE__ */ i("rect", {
|
|
362
|
+
className: "nxgt-barcode-paper",
|
|
363
|
+
width: h.width,
|
|
364
|
+
height: h.height
|
|
365
|
+
}),
|
|
366
|
+
/* @__PURE__ */ i("path", {
|
|
367
|
+
className: "nxgt-barcode-ink",
|
|
368
|
+
d: h.path
|
|
369
|
+
}),
|
|
370
|
+
m > 0 ? /* @__PURE__ */ i("text", {
|
|
371
|
+
className: "nxgt-barcode-text",
|
|
372
|
+
x: h.width / 2,
|
|
373
|
+
y: h.textY,
|
|
374
|
+
fontSize: m * .7,
|
|
375
|
+
textAnchor: "middle",
|
|
376
|
+
children: e
|
|
377
|
+
}) : null
|
|
378
|
+
]
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
//#endregion
|
|
382
|
+
//#region lib/components/ui/widgets/barcode/label-length.ts
|
|
383
|
+
var N = /^-?(\d+\.?\d*|\.\d+)(mm|cm|in|pt|px|rem|em)$/;
|
|
384
|
+
function P(e, t) {
|
|
385
|
+
if (typeof e == "number" && Number.isFinite(e) && e >= 0) return `${e}mm`;
|
|
386
|
+
if (typeof e == "string" && N.test(e)) return e;
|
|
387
|
+
throw new o(`${t} must be a number (millimetres) or a length such as "50mm": got ${JSON.stringify(e)}`);
|
|
388
|
+
}
|
|
389
|
+
//#endregion
|
|
390
|
+
//#region lib/components/ui/widgets/barcode/label-sheet.tsx
|
|
391
|
+
function F({ className: e, ...t }) {
|
|
392
|
+
return /* @__PURE__ */ i("div", {
|
|
393
|
+
...t,
|
|
394
|
+
className: e ? `nxgt-label ${e}` : "nxgt-label"
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
function I(e, t, n) {
|
|
398
|
+
let r = e ?? n;
|
|
399
|
+
if (!Number.isInteger(r) || r < (t === "skip" ? 0 : 1)) throw new o(`${t} must be a whole number (rows and columns at least 1, skip at least 0): got ${String(e)}`);
|
|
400
|
+
return r;
|
|
401
|
+
}
|
|
402
|
+
function L(e) {
|
|
403
|
+
let { label: t, columns: n, gap: r, offset: i } = e, a = typeof r == "object" ? r.x : r, o = typeof r == "object" ? r.y : r;
|
|
404
|
+
return {
|
|
405
|
+
"--nxgt-label-w": P(t.width, "label.width"),
|
|
406
|
+
"--nxgt-label-h": P(t.height, "label.height"),
|
|
407
|
+
"--nxgt-label-cols": String(I(n, "columns", 1)),
|
|
408
|
+
"--nxgt-label-gap-x": P(a ?? 0, "gap"),
|
|
409
|
+
"--nxgt-label-gap-y": P(o ?? 0, "gap"),
|
|
410
|
+
"--nxgt-label-off-x": P(i?.x ?? 0, "offset.x"),
|
|
411
|
+
"--nxgt-label-off-y": P(i?.y ?? 0, "offset.y")
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
function R(n) {
|
|
415
|
+
let { label: a, columns: o, rows: s, gap: c, offset: l, skip: u, children: d, className: f, ...p } = n, m = r(null), h = L({
|
|
416
|
+
label: a,
|
|
417
|
+
columns: o,
|
|
418
|
+
gap: c,
|
|
419
|
+
offset: l
|
|
420
|
+
}), g = s === void 0 ? Infinity : o * I(s, "rows", 1), _ = [...Array.from({ length: I(u, "skip", 0) }, (e, t) => /* @__PURE__ */ i(F, {
|
|
421
|
+
"data-blank": "",
|
|
422
|
+
"aria-hidden": "true"
|
|
423
|
+
}, `blank-${t}`)), ...e.toArray(d)], v = [];
|
|
424
|
+
for (let e = 0; (e < _.length || e === 0) && (v.push(_.slice(e, Number.isFinite(g) ? e + g : void 0)), Number.isFinite(g)); e += g);
|
|
425
|
+
return t(() => {
|
|
426
|
+
let e = m.current;
|
|
427
|
+
if (e) for (let [t, n] of Object.entries(h)) e.style.setProperty(t, n);
|
|
428
|
+
}, [JSON.stringify(h)]), /* @__PURE__ */ i("div", {
|
|
429
|
+
...p,
|
|
430
|
+
ref: m,
|
|
431
|
+
className: f ? `nxgt-label-sheet ${f}` : "nxgt-label-sheet",
|
|
432
|
+
children: v.map((e, t) => /* @__PURE__ */ i("div", {
|
|
433
|
+
className: "nxgt-label-page",
|
|
434
|
+
"data-page": t + 1,
|
|
435
|
+
children: e
|
|
436
|
+
}, t))
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
//#endregion
|
|
440
|
+
export { M as Barcode, o as BarcodeError, F as Label, R as LabelSheet, A as barcodeGeometry };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
2
|
import { n as t, t as n } from "./dist-DVRQkaTK.js";
|
|
3
|
-
import { n as r, r as i, t as a } from "./spinner-
|
|
3
|
+
import { n as r, r as i, t as a } from "./spinner-CquTUxzt.js";
|
|
4
4
|
import { a as o, i as s, n as c, o as l, s as u, t as d } from "./use-click-lock-BZYtTmVt.js";
|
|
5
5
|
import { t as f } from "./is-production-GLw59WU8.js";
|
|
6
6
|
import { t as p } from "./button-group-context-CaP0X5p_.js";
|
package/dist/charts.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as e } from "./ui.utils-CAnKTCw5.js";
|
|
2
2
|
import { t } from "./utils-BLfntITJ.js";
|
|
3
3
|
import { t as n } from "./warn-once-C_e47JM8.js";
|
|
4
|
-
import { t as r } from "./button-
|
|
5
|
-
import { t as i } from "./use-material-translation-
|
|
4
|
+
import { t as r } from "./button-Deo7l4wM.js";
|
|
5
|
+
import { t as i } from "./use-material-translation-BZAy_ffS.js";
|
|
6
6
|
import { t as a } from "./use-ssr-media-query-C6M5m8sf.js";
|
|
7
7
|
import { i as o, n as s, r as c, t as l } from "./util-4heV2LPI.js";
|
|
8
8
|
import { t as u } from "./useIsomorphicLayoutEffect-DfgAhWcH.js";
|
|
9
|
-
import { t as d } from "./chip-
|
|
9
|
+
import { t as d } from "./chip-BlmIjpiD.js";
|
|
10
10
|
import { c as f, d as p, f as m, i as h, o as g, p as _, s as v, t as y } from "./line-path-C5pZGC49.js";
|
|
11
11
|
import { t as b } from "./live-status-BGPaN8r8.js";
|
|
12
12
|
import { t as x } from "./linear-G97mfnKF.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
|
-
import { r as t } from "./spinner-
|
|
2
|
+
import { r as t } from "./spinner-CquTUxzt.js";
|
|
3
3
|
import { s as n } from "./use-click-lock-BZYtTmVt.js";
|
|
4
|
-
import { t as r } from "./use-material-translation-
|
|
4
|
+
import { t as r } from "./use-material-translation-BZAy_ffS.js";
|
|
5
5
|
import { t as i } from "./react-node-text-Crkpfpco.js";
|
|
6
6
|
import { cloneElement as a, isValidElement as o } from "react";
|
|
7
7
|
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { r as e } from "./rolldown-runtime-BFFgcFxR.js";
|
|
2
2
|
import { t } from "./utils-BLfntITJ.js";
|
|
3
3
|
import { a as n } from "./dist-lmHmz_bu.js";
|
|
4
|
-
import { c as r, d as i, f as a, n as o, t as s } from "./dropdown-menu-
|
|
5
|
-
import { a as c, i as l, n as u } from "./field-blur-context-
|
|
6
|
-
import { a as d, d as f, r as p, t as m, u as h } from "./toolbar-items-
|
|
4
|
+
import { c as r, d as i, f as a, n as o, t as s } from "./dropdown-menu-hoaocAS7.js";
|
|
5
|
+
import { a as c, i as l, n as u } from "./field-blur-context-Ba7iZVm_.js";
|
|
6
|
+
import { a as d, d as f, r as p, t as m, u as h } from "./toolbar-items-Bm1baIp6.js";
|
|
7
7
|
import { t as g } from "./is-production-GLw59WU8.js";
|
|
8
|
-
import { t as _ } from "./use-material-translation-
|
|
9
|
-
import { i as v, n as y, o as b, t as x } from "./code-language-items-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
8
|
+
import { t as _ } from "./use-material-translation-BZAy_ffS.js";
|
|
9
|
+
import { i as v, n as y, o as b, t as x } from "./code-language-items-Cqk4Fq61.js";
|
|
10
|
+
import { n as S, t as C } from "./escape-owner-BvLBo_Al.js";
|
|
11
|
+
import { t as w } from "./useIsomorphicLayoutEffect-DfgAhWcH.js";
|
|
12
12
|
import { t as T } from "./skeleton-DSdtr2qc.js";
|
|
13
13
|
import { t as E } from "./react-node-text-Crkpfpco.js";
|
|
14
14
|
import D, { memo as O, useCallback as ee, useEffect as k, useId as A, useImperativeHandle as j, useMemo as M, useRef as N, useState as P } from "react";
|
|
@@ -975,7 +975,7 @@ function sn(e, t, r) {
|
|
|
975
975
|
t
|
|
976
976
|
]);
|
|
977
977
|
let o = (t) => {
|
|
978
|
-
let n = e.current, r = t.nativeEvent.defaultPrevented && !
|
|
978
|
+
let n = e.current, r = t.nativeEvent.defaultPrevented && !S(t.nativeEvent);
|
|
979
979
|
!i || !n || r || n.contains(t.target) && (t.key === "Escape" ? (t.preventDefault(), a(!1)) : t.key === "Tab" && on(t, n));
|
|
980
980
|
};
|
|
981
981
|
return {
|
|
@@ -989,7 +989,7 @@ function sn(e, t, r) {
|
|
|
989
989
|
tabIndex: -1
|
|
990
990
|
},
|
|
991
991
|
"data-fullscreen": i || void 0,
|
|
992
|
-
[
|
|
992
|
+
[C]: i || void 0,
|
|
993
993
|
onKeyDown: o
|
|
994
994
|
})
|
|
995
995
|
};
|
|
@@ -1327,10 +1327,10 @@ function Pn() {
|
|
|
1327
1327
|
}
|
|
1328
1328
|
function Fn(e, t) {
|
|
1329
1329
|
let n = M(() => jn(e, t), [e, t]), r = N(null), [i] = P(() => typeof document > "u" ? void 0 : Pn()), a = N(void 0);
|
|
1330
|
-
return
|
|
1330
|
+
return w(() => {
|
|
1331
1331
|
let e = r.current;
|
|
1332
1332
|
e && Mn(e, n, a.current), i && Nn(i, n, a.current), a.current = n;
|
|
1333
|
-
}, [n, i]),
|
|
1333
|
+
}, [n, i]), w(() => {
|
|
1334
1334
|
if (i) return (r.current?.parentElement?.closest("[role=\"dialog\"]") ?? document.body).appendChild(i), () => i.remove();
|
|
1335
1335
|
}, [i]), {
|
|
1336
1336
|
scope: n,
|