@motifx-community/ui 0.1.0-beta.5 → 0.1.0-beta.7
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 +101 -0
- package/README.md +7 -4
- package/dist/components/appbar/AppBar.d.ts +88 -0
- package/dist/components/appbar/app-bar-navigation-click-event-args.d.ts +9 -0
- package/dist/components/appbar/app-bar-navigation.d.ts +2 -0
- package/dist/components/appbar/app-bar-position.d.ts +2 -0
- package/dist/components/appbar/app-bar-props.d.ts +49 -0
- package/dist/components/appbar/app-bar-scroll-behavior.d.ts +2 -0
- package/dist/components/appbar/app-bar-title-align.d.ts +2 -0
- package/dist/components/appbar/app-bar-tone.d.ts +2 -0
- package/dist/components/appbar/index.d.ts +8 -0
- package/dist/components/barcode/Barcode.d.ts +62 -0
- package/dist/components/barcode/barcode-export-options.d.ts +9 -0
- package/dist/components/barcode/barcode-failed-event-args.d.ts +9 -0
- package/dist/components/barcode/barcode-props.d.ts +25 -0
- package/dist/components/barcode/index.d.ts +5 -0
- package/dist/components/bargauge/BarGauge.d.ts +120 -0
- package/dist/components/bargauge/bar-gauge-props.d.ts +38 -0
- package/dist/components/bargauge/index.d.ts +2 -0
- package/dist/components/bottomnavigation/BottomNavigation.d.ts +101 -0
- package/dist/components/bottomnavigation/bottom-navigation-item-click-event-args.d.ts +9 -0
- package/dist/components/bottomnavigation/bottom-navigation-item.d.ts +35 -0
- package/dist/components/bottomnavigation/bottom-navigation-label-mode.d.ts +2 -0
- package/dist/components/bottomnavigation/bottom-navigation-position.d.ts +2 -0
- package/dist/components/bottomnavigation/bottom-navigation-props.d.ts +31 -0
- package/dist/components/bottomnavigation/bottom-navigation-selecting-event-args.d.ts +5 -0
- package/dist/components/bottomnavigation/bottom-navigation-selection-changed-event-args.d.ts +11 -0
- package/dist/components/bottomnavigation/index.d.ts +8 -0
- package/dist/components/chart/Chart.d.ts +229 -0
- package/dist/components/chart/ChartLegend.d.ts +24 -0
- package/dist/components/chart/ChartPlot.d.ts +161 -0
- package/dist/components/chart/ChartTable.d.ts +68 -0
- package/dist/components/chart/ChartTooltip.d.ts +22 -0
- package/dist/components/chart/PartsPlot.d.ts +39 -0
- package/dist/components/chart/RadarPlot.d.ts +34 -0
- package/dist/components/chart/chart-axis-kind.d.ts +2 -0
- package/dist/components/chart/chart-axis.d.ts +31 -0
- package/dist/components/chart/chart-data-error-event-args.d.ts +7 -0
- package/dist/components/chart/chart-export-options.d.ts +7 -0
- package/dist/components/chart/chart-export.d.ts +12 -0
- package/dist/components/chart/chart-field.d.ts +2 -0
- package/dist/components/chart/chart-labels.d.ts +2 -0
- package/dist/components/chart/chart-legend-options.d.ts +10 -0
- package/dist/components/chart/chart-legend-position.d.ts +2 -0
- package/dist/components/chart/chart-look.d.ts +25 -0
- package/dist/components/chart/chart-mode-changed-event-args.d.ts +7 -0
- package/dist/components/chart/chart-mode.d.ts +2 -0
- package/dist/components/chart/chart-model.d.ts +105 -0
- package/dist/components/chart/chart-point-event-args.d.ts +9 -0
- package/dist/components/chart/chart-point-selection.d.ts +2 -0
- package/dist/components/chart/chart-point.d.ts +23 -0
- package/dist/components/chart/chart-props.d.ts +76 -0
- package/dist/components/chart/chart-reference.d.ts +12 -0
- package/dist/components/chart/chart-selection-changed-event-args.d.ts +8 -0
- package/dist/components/chart/chart-series-toggled-event-args.d.ts +10 -0
- package/dist/components/chart/chart-series-type.d.ts +6 -0
- package/dist/components/chart/chart-series.d.ts +55 -0
- package/dist/components/chart/chart-stacked.d.ts +2 -0
- package/dist/components/chart/chart-tooltip-context.d.ts +10 -0
- package/dist/components/chart/chart-tooltip-options.d.ts +10 -0
- package/dist/components/chart/chart-zoom-changed-event-args.d.ts +8 -0
- package/dist/components/chart/index.d.ts +21 -0
- package/dist/components/chart/legend-entry.d.ts +13 -0
- package/dist/components/chart/plot-text.d.ts +10 -0
- package/dist/components/chart/plot-view.d.ts +61 -0
- package/dist/components/datagrid/grid-lookup.d.ts +3 -3
- package/dist/components/datagrid/grid-settings.d.ts +3 -3
- package/dist/components/datagrid/model/GridData.d.ts +22 -3
- package/dist/components/datagrid/model/GridModel.d.ts +2 -0
- package/dist/components/gauge/Gauge.d.ts +179 -0
- package/dist/components/gauge/gauge-mark.d.ts +9 -0
- package/dist/components/gauge/gauge-marker.d.ts +2 -0
- package/dist/components/gauge/gauge-needle-shape.d.ts +2 -0
- package/dist/components/gauge/gauge-orientation.d.ts +2 -0
- package/dist/components/gauge/gauge-props.d.ts +58 -0
- package/dist/components/gauge/gauge-range.d.ts +11 -0
- package/dist/components/gauge/gauge-scale.d.ts +2 -0
- package/dist/components/gauge/gauge-shape.d.ts +43 -0
- package/dist/components/gauge/gauge-type.d.ts +2 -0
- package/dist/components/gauge/index.d.ts +9 -0
- package/dist/components/listbox/list-rows.d.ts +2 -0
- package/dist/components/otpinput/OtpInput.d.ts +73 -0
- package/dist/components/otpinput/index.d.ts +4 -0
- package/dist/components/otpinput/otp-charset.d.ts +2 -0
- package/dist/components/otpinput/otp-completed-event-args.d.ts +8 -0
- package/dist/components/otpinput/otp-input-props.d.ts +32 -0
- package/dist/components/qrcode/QRCode.d.ts +58 -0
- package/dist/components/qrcode/index.d.ts +5 -0
- package/dist/components/qrcode/qr-code-export-options.d.ts +9 -0
- package/dist/components/qrcode/qr-code-failed-event-args.d.ts +7 -0
- package/dist/components/qrcode/qr-code-props.d.ts +23 -0
- package/dist/components/signature/Signature.d.ts +100 -0
- package/dist/components/signature/index.d.ts +5 -0
- package/dist/components/signature/signature-draw.d.ts +15 -0
- package/dist/components/signature/signature-export-options.d.ts +11 -0
- package/dist/components/signature/signature-props.d.ts +30 -0
- package/dist/components/signature/signature-stroke-event-args.d.ts +9 -0
- package/dist/components/signature/signature-stroke.d.ts +11 -0
- package/dist/components/sparkline/Sparkline.d.ts +85 -0
- package/dist/components/sparkline/index.d.ts +4 -0
- package/dist/components/sparkline/sparkline-highlight.d.ts +2 -0
- package/dist/components/sparkline/sparkline-props.d.ts +34 -0
- package/dist/components/sparkline/sparkline-type.d.ts +2 -0
- package/dist/components/validationsummary/ValidationSummary.d.ts +1 -0
- package/dist/core/fonts-loaded.d.ts +2 -0
- package/dist/core/scroll-watch.d.ts +13 -0
- package/dist/core/ui-strings.d.ts +38 -0
- package/dist/generated/tokens.d.ts +3023 -863
- package/dist/index.d.ts +10 -0
- package/dist/index.js +55933 -47186
- package/dist/index.js.map +1 -1
- package/dist/locales/en.json +37 -1
- package/dist/locales/tr.json +37 -1
- package/dist/parts/chart/chart-paths.d.ts +30 -0
- package/dist/parts/chart/chart-scale.d.ts +13 -0
- package/dist/parts/chart/chart-text.d.ts +12 -0
- package/dist/parts/chart/nice-ticks.d.ts +6 -0
- package/dist/parts/chart/svg-parts.d.ts +12 -0
- package/dist/parts/chart/thin-out.d.ts +6 -0
- package/dist/parts/chart/time-ticks.d.ts +7 -0
- package/dist/parts/chart/token-lengths.d.ts +16 -0
- package/dist/parts/chart/value-motion.d.ts +16 -0
- package/dist/parts/code/barcode-encode.d.ts +23 -0
- package/dist/parts/code/code-image.d.ts +35 -0
- package/dist/parts/code/qr-encode.d.ts +10 -0
- package/dist/parts/data/DataItems.d.ts +2 -0
- package/dist/parts/data/KeyedItems.d.ts +1 -0
- package/dist/parts/field/Field.d.ts +2 -0
- package/dist/parts/list/OptionList.d.ts +6 -0
- package/dist/parts/list/item-source.d.ts +4 -0
- package/dist/styles.css +3043 -9
- package/dist/tokens/index.d.ts +3212 -967
- package/dist/tokens/index.js +3023 -863
- package/dist/tokens/index.js.map +1 -1
- package/dist/{tr-C5IXRzAH.js → tr-DhIFcH3c.js} +75 -3
- package/dist/{tr-C5IXRzAH.js.map → tr-DhIFcH3c.js.map} +1 -1
- package/docs/accordion.md +1 -1
- package/docs/actionsheet.md +1 -1
- package/docs/appbar.md +194 -0
- package/docs/avatar.md +1 -1
- package/docs/badge.md +1 -1
- package/docs/bar-gauge-angles.md +87 -0
- package/docs/bar-gauge-data.md +122 -0
- package/docs/bar-gauge-labels.md +78 -0
- package/docs/bar-gauge.md +98 -0
- package/docs/barcode.md +193 -0
- package/docs/bottomnavigation.md +258 -0
- package/docs/bottomsheet.md +1 -1
- package/docs/breadcrumb.md +1 -1
- package/docs/button.md +1 -1
- package/docs/buttongroup.md +1 -1
- package/docs/buttons.md +169 -0
- package/docs/calendar.md +1 -1
- package/docs/card.md +1 -1
- package/docs/chart-bars.md +142 -0
- package/docs/chart-candles.md +164 -0
- package/docs/chart-funnel.md +115 -0
- package/docs/chart-heatmap.md +93 -0
- package/docs/chart-lines.md +128 -0
- package/docs/chart-live.md +62 -0
- package/docs/chart-pie.md +125 -0
- package/docs/chart-radar.md +124 -0
- package/docs/chart-ranges.md +127 -0
- package/docs/chart-references.md +126 -0
- package/docs/chart-scatter.md +139 -0
- package/docs/chart-waterfall.md +111 -0
- package/docs/chart-zoom.md +95 -0
- package/docs/chart.md +427 -0
- package/docs/checkbox.md +1 -1
- package/docs/chip.md +1 -1
- package/docs/choice.md +151 -0
- package/docs/colorbox.md +1 -1
- package/docs/combobox.md +1 -1
- package/docs/control.md +1 -1
- package/docs/data.md +127 -0
- package/docs/datagrid-api.md +1 -1
- package/docs/datagrid-bands.md +1 -1
- package/docs/datagrid-drag-select.md +1 -1
- package/docs/datagrid-drag.md +1 -1
- package/docs/datagrid-editing.md +1 -1
- package/docs/datagrid-filtering.md +1 -1
- package/docs/datagrid-forms.md +1 -1
- package/docs/datagrid-grouping.md +62 -2
- package/docs/datagrid-layout.md +2 -2
- package/docs/datagrid-lookups.md +2 -2
- package/docs/datagrid-master-detail.md +1 -1
- package/docs/datagrid-scrolling.md +1 -1
- package/docs/datagrid-selection.md +1 -1
- package/docs/datagrid.md +1 -1
- package/docs/datebox.md +1 -1
- package/docs/daterangebox.md +1 -1
- package/docs/display.md +148 -0
- package/docs/draggable.md +1 -1
- package/docs/drawer.md +1 -1
- package/docs/dropdown.md +1 -1
- package/docs/editors.md +157 -0
- package/docs/feedback.md +138 -0
- package/docs/fileuploader.md +1 -1
- package/docs/filterbuilder.md +1 -1
- package/docs/formlayout.md +1 -1
- package/docs/foundations.md +79 -0
- package/docs/gallery.md +1 -1
- package/docs/gauge-base.md +78 -0
- package/docs/gauge-circular.md +101 -0
- package/docs/gauge-dashboards.md +134 -0
- package/docs/gauge-linear.md +84 -0
- package/docs/gauge-markers.md +135 -0
- package/docs/gauge-marks.md +108 -0
- package/docs/gauge-ranges.md +133 -0
- package/docs/gauge-scales.md +117 -0
- package/docs/gauge.md +152 -0
- package/docs/home.md +1 -1
- package/docs/keyboard.md +1 -1
- package/docs/language.md +1 -1
- package/docs/layout.md +1 -1
- package/docs/listbox.md +1 -1
- package/docs/loadpanel.md +1 -1
- package/docs/lookup.md +1 -1
- package/docs/menus.md +1 -1
- package/docs/multiview.md +1 -1
- package/docs/navigation.md +143 -0
- package/docs/numberbox.md +1 -1
- package/docs/otpinput.md +197 -0
- package/docs/pagination.md +1 -1
- package/docs/popover.md +1 -1
- package/docs/progress.md +1 -1
- package/docs/qrcode.md +179 -0
- package/docs/radiogroup.md +1 -1
- package/docs/rating.md +1 -1
- package/docs/resizable.md +1 -1
- package/docs/scheduler-agenda.md +1 -1
- package/docs/scheduler-big-data.md +1 -1
- package/docs/scheduler-editing.md +1 -1
- package/docs/scheduler-form.md +1 -1
- package/docs/scheduler-icalendar.md +1 -1
- package/docs/scheduler-mobile.md +1 -1
- package/docs/scheduler-recurrence.md +1 -1
- package/docs/scheduler-resources.md +1 -1
- package/docs/scheduler-timeline.md +1 -1
- package/docs/scheduler.md +1 -1
- package/docs/scrollview.md +1 -1
- package/docs/showcase-home.md +31 -0
- package/docs/showcase.md +1 -1
- package/docs/signature.md +208 -0
- package/docs/skeleton.md +1 -1
- package/docs/slider.md +1 -1
- package/docs/sortable.md +1 -1
- package/docs/sparkline.md +119 -0
- package/docs/speeddial.md +1 -1
- package/docs/splitter.md +1 -1
- package/docs/stepper.md +1 -1
- package/docs/switch.md +1 -1
- package/docs/tabdocs-dock.md +1 -1
- package/docs/tabdocs-drag.md +1 -1
- package/docs/tabdocs-menus.md +1 -1
- package/docs/tabdocs-mobile.md +1 -1
- package/docs/tabdocs-tabs.md +1 -1
- package/docs/tabdocs-windows.md +1 -1
- package/docs/tabdocs-workspace.md +1 -1
- package/docs/tabdocs.md +1 -1
- package/docs/tabs.md +1 -1
- package/docs/tagbox.md +1 -1
- package/docs/textarea.md +1 -1
- package/docs/textbox.md +1 -1
- package/docs/tileview.md +1 -1
- package/docs/timeline.md +1 -1
- package/docs/toast.md +1 -1
- package/docs/tokens.md +450 -1
- package/docs/toolbar.md +1 -1
- package/docs/tooltip.md +1 -1
- package/docs/treeview.md +1 -1
- package/docs/validationsummary.md +1 -1
- package/docs/window.md +1 -1
- package/docs/wizard.md +1 -1
- package/llms-full.txt +6725 -99
- package/llms.txt +50 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,107 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.1.0-beta.7] - 2026-11-08
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Lookup texts are asked 20 keys at a time instead of 100 (`lookup.batchSize`), so a request that carries the keys in
|
|
14
|
+
its URL stays within common server limits.
|
|
15
|
+
- A row of a list that failed to load, and a whole list that failed, say that they could not load and load again when
|
|
16
|
+
pressed or with Enter, instead of staying on Loading or showing an empty list. This covers `DropDown`, `ComboBox`,
|
|
17
|
+
`ListBox`, `TagBox` and the header filter of `DataGrid`.
|
|
18
|
+
- `DataGrid`: searching the header filter of a lookup column whose `textFrom` is a field searches that field on the
|
|
19
|
+
server, instead of turning the matching texts into a long list of keys.
|
|
20
|
+
- `DataGrid`: a lookup column grouped by its own field (`calculateGroupValue` naming it, with `textFrom`) shows the text
|
|
21
|
+
of the key in its group rows and in an export, not the key.
|
|
22
|
+
|
|
23
|
+
## [0.1.0-beta.6] - 2026-11-07
|
|
24
|
+
|
|
25
|
+
### New components
|
|
26
|
+
|
|
27
|
+
- `AppBar`: the top bar of an application, a `<header>`. A menu or back button (`navigation`, `navigationGlyph`,
|
|
28
|
+
`navigationLabel`, `onNavigationClick`), a `logo`, a `title` with a `subtitle` (`titleAlign`, `headingLevel`), a
|
|
29
|
+
control as JSX children or `content`, and `actions`, the same items as `Toolbar`, so that commands that do not fit
|
|
30
|
+
move into its menu. `tone`, `prominent`; `position`; `scrollBehavior` raises the bar over what scrolls or moves it
|
|
31
|
+
away while scrolling down, and focus brings it back (`scrollTarget`). It keeps clear of the notch of a phone.
|
|
32
|
+
- `BottomNavigation`: the destinations of an application at the bottom of the screen, a `<nav>`. One Tab stop with the
|
|
33
|
+
arrow keys, Home and End inside it, and `aria-current` on the selected item. `items` with `glyph`, `activeGlyph`,
|
|
34
|
+
`icon`, `activeIcon`, `href`, `badge` and `dot`; `value` and `x-model`; `onSelecting` may refuse,
|
|
35
|
+
`onSelectionChanged`, `onItemClick`; `labelMode`; `position`, `hideOnScroll`, `scrollTarget`. It keeps clear of the
|
|
36
|
+
home indicator of a phone.
|
|
37
|
+
- `OtpInput`: a one-time code in a row of boxes, drawn over one real input, so that typing, pasting a whole code, the
|
|
38
|
+
code a phone offers from a message and screen readers work as in any text box, and it is one Tab stop. `length`,
|
|
39
|
+
`charset` or `pattern`, `uppercase`, `masked` and `maskCharacter`, `placeholder`, `groupSize` and `separator`,
|
|
40
|
+
`autoComplete`; a field, with its label, rules and `x-model`; an incomplete code fails on its own; `onCompleted` occurs
|
|
41
|
+
once for a code, `isComplete`, `clear()`. The boxes run left to right in every page.
|
|
42
|
+
- `Signature`: a pad to sign on with a pen, a finger or a mouse. The value is the strokes themselves, in shares of the
|
|
43
|
+
pad, so that a signature can be stored as data and drawn again at any size. A pen that reports pressure sets the width
|
|
44
|
+
of the line, and otherwise it follows the speed (`minWidth`, `maxWidth`, `penColor`). `toDataURL()`, `toBlob()` and
|
|
45
|
+
`toSVG()` give an image in black, whatever the theme. `undo()`, `clear()`, buttons in the corner of the pad (`showUndo`,
|
|
46
|
+
`showClear`), Ctrl+Z and Delete; `showGuide`, `placeholder`, `height`; `onStrokeBegan`, `onStrokeEnded`; a field, with
|
|
47
|
+
its label, rules and `x-model`.
|
|
48
|
+
- `QRCode`: a code drawn as vectors, with no dependencies. The smallest of the 40 versions that holds the text is chosen,
|
|
49
|
+
in numeric, alphanumeric or byte mode, for any characters as UTF-8. `level`, `size`, `margin`, `logo` and `logoSize`;
|
|
50
|
+
`toSVG()`, `toDataURL()`; `onEncodeFailed` for a text too long for a code. It stays dark on light in every theme.
|
|
51
|
+
- `Barcode`: Code 128, Code 39, EAN-13, EAN-8, UPC-A and Interleaved 2 of 5, drawn as vectors, with no dependencies.
|
|
52
|
+
Check digits are worked out and a wrong one is refused; `moduleWidth`, `height`, `margin`, `showText`, `checkDigit`;
|
|
53
|
+
`toSVG()`, `toDataURL()`; `onEncodeFailed` for a value the format cannot hold. A narrow parent scrolls the code rather
|
|
54
|
+
than squeezing its bars.
|
|
55
|
+
- The glyphs `menu` and `arrow-start`, and the kit strings `navigationMenu`, `navigation`, `appBarActions`,
|
|
56
|
+
`otpIncomplete`, `signatureHere`, `signatureUndo`, `signatureName`, `signatureEmpty`, `signatureSigned`, `qrCodeLabel`
|
|
57
|
+
and `barcodeLabel`.
|
|
58
|
+
- `Chart`: lines, areas, bars, dots and bubbles on one axis of values, stacked as they are or as shares of a hundred,
|
|
59
|
+
upright or on its side. Time, number, log and category axes, a legend that hides series, a tooltip, a crosshair,
|
|
60
|
+
labels on chosen values, and rows from an array or a `DataSource`. Every value can be reached with the keyboard and
|
|
61
|
+
read as a table, and `toSVG()` and `toDataURL()` give an image. Needs the design system's new `color.chart.*` tokens,
|
|
62
|
+
and `@motifx/core` and `@motifx/compiler` 1.2.0-rc.25, whose compiler keeps JSX props that start with `x`.
|
|
63
|
+
Also `pie`, `donut` and `funnel` for the parts of one whole, `radar`, `heatmap` with seven steps of one hue (two
|
|
64
|
+
hues across zero), `rangeArea`, `rangeBar`, `candlestick`, `ohlc` and `waterfall`. Rising and falling candles differ in
|
|
65
|
+
shape as well as color, and the legend lists the parts of a whole or the steps of a heat map.
|
|
66
|
+
`zoom` lets the reader drag, use Ctrl and the wheel, or + and - to zoom in on positions, with `zoomTo()`, `resetZoom()`
|
|
67
|
+
and `onZoomChanged`; a zoom into 100,000 values draws in about a tenth of a second. `span` on the position axis follows
|
|
68
|
+
live data, and changed values move from where they were. `references` draws lines and bands; `pointSelection`,
|
|
69
|
+
`selectedPoints`, `clearSelection()` and `onSelectionChanged` choose values. The table view is the kit's `DataGrid`, so
|
|
70
|
+
100,000 rows open at once and scroll; live updates reach the same grid, which keeps its scroll. The table view is at
|
|
71
|
+
least eleven rows tall in every design language (`chart.table-min-height`).
|
|
72
|
+
- `Sparkline`: a chart the size of a word, for a trend beside a number, in a sentence or a row of a table. `line`, `area`,
|
|
73
|
+
`bar` and `winloss`; `highlight` marks the first, last, lowest or highest value, `referenceLine` draws a line at a
|
|
74
|
+
value or the average; the value under the pointer shows above it, and its name sums the values up.
|
|
75
|
+
- `Gauge`: a value against its scale, as an arc, a whole circle, a half or a quarter (`angle`, `rotation`), or a straight
|
|
76
|
+
bar across or upright (`orientation`). `scale` shows the ends or ticks (`tickInterval`, `ticks`, `minorTicks`), and a
|
|
77
|
+
`min` above `max` runs it down. `ranges` with a tone, a color of your own or the next chart color; the fill takes the
|
|
78
|
+
color of the range it is in. The value shows as a fill from `baseValue`, and with `marker`: a needle (`needleShape`), a
|
|
79
|
+
triangle, a circle, a rhombus, a line or a callout. `marks` show targets and limits with names, read with the value. It
|
|
80
|
+
is a meter for assistive technology, and values that come quicker than the motion are drawn at once. Its tones are
|
|
81
|
+
the design system's chart status colors (`color.chart.good`, `warning`, `danger`), clear on light themes too, and
|
|
82
|
+
its track shows on every background.
|
|
83
|
+
- `BarGauge`: several values against one scale, as bars bent round one middle. Values at the ends of the bars on lines
|
|
84
|
+
that move apart, a `legend`, a tooltip, `baseValue` for bars both ways, rows read through `valueField`, `nameField` and
|
|
85
|
+
`colorField`, and a changing number of bars, each new one growing from the base value.
|
|
86
|
+
|
|
87
|
+
### Changed
|
|
88
|
+
|
|
89
|
+
- `DataGrid` groups on the server with a pager too: over a `DataSource` that loads pages and an adapter that groups, the
|
|
90
|
+
groups come with their counts and each page asks only for the rows it shows (`loadRange`), once. Such a source was
|
|
91
|
+
grouped in the browser from every matching row before. `remoteGrouping` covers pages as well as blocks.
|
|
92
|
+
|
|
93
|
+
### Fixed
|
|
94
|
+
|
|
95
|
+
- `ValidationSummary` writes a field's label without its access key marker: `&Name` reads as Name.
|
|
96
|
+
- `ValidationSummary` keeps its lines while other fields change, so a line with focus keeps it; when the focused line
|
|
97
|
+
goes, the next one takes focus.
|
|
98
|
+
- `Button` with `toggle` and a `pressed` bound one way keeps following its state after a click.
|
|
99
|
+
|
|
100
|
+
### Documentation
|
|
101
|
+
|
|
102
|
+
- The README says that design languages are independent interpretations.
|
|
103
|
+
- Charts and gauges have their own groups in the sidebar, an overview and a page for each kind and part. The sidebar
|
|
104
|
+
starts with its groups closed, and remembers which are open and how far it was scrolled.
|
|
105
|
+
- Every group of components has an overview: what the group is for, a demo that puts its components to work in one
|
|
106
|
+
screen, which component to choose for a job, and what they share.
|
|
107
|
+
- More examples on every chart page, and a smart home panel for a tablet in the showcase, built with the kit.
|
|
108
|
+
- The DataGrid grouping page has an example of grouping on the server with a pager.
|
|
109
|
+
|
|
9
110
|
## [0.1.0-beta.5] - 2026-11-06
|
|
10
111
|
|
|
11
112
|
### Changed
|
package/README.md
CHANGED
|
@@ -42,9 +42,11 @@ component (`npm run dev`).
|
|
|
42
42
|
| Group | Components |
|
|
43
43
|
| --- | --- |
|
|
44
44
|
| Buttons and commands | `Button` (menu, split, drop-down, toggle, busy), `ButtonGroup` (segmented choice), `Toolbar` (overflow menu), `MenuBar`, `ContextMenu`, `SpeedDial` (linear, circle, semi-circle and quarter-circle layouts) |
|
|
45
|
-
|
|
|
46
|
-
|
|
|
47
|
-
|
|
|
45
|
+
| Charts | `Chart` (lines, areas, bars, dots, bubbles, pie, donut, funnel, radar, heat map, ranges, candles, waterfall; zoom, live data, references, selection; keyboard, table view, images), `Sparkline` |
|
|
46
|
+
| Gauges | `Gauge` (arc, circle, half, quarter, bar across or upright; ticks, ranges, needles and markers, marks), `BarGauge` |
|
|
47
|
+
| Display | `QRCode`, `Barcode` (Code 128, Code 39, EAN, UPC, Interleaved 2 of 5), `Badge`, `Avatar`, `AvatarGroup`, `Chip`, `ChipGroup`, `Card`, `Skeleton`, `Gallery` (slides, dots, slideshow), `TileView` (selectable, reorderable tiles on a grid), `Timeline` (vertical, or horizontal along a line of dates) |
|
|
48
|
+
| Navigation | `AppBar`, `BottomNavigation`, `Tabs`, `Accordion`, `Breadcrumb`, `Pagination`, `Stepper`, `Wizard`, `MultiView` (swipeable pages), `TabDocumentManager` |
|
|
49
|
+
| More editors | `OtpInput` (one-time codes), `Signature` (strokes, image export), `Rating`, `ColorBox`, `ColorPicker` |
|
|
48
50
|
| Scheduling | `Scheduler` (day, week, month, timeline, agenda; recurrence, resources, iCalendar) |
|
|
49
51
|
| Editors | `TextBox` (mask, validation), `TextArea` (auto-grow), `NumberBox` (locale formats, spin), `DateBox` (date, time, both), `DateRangeBox` (two months, presets, length limits), `Calendar`, `Slider` (range), `FileUploader` (drop, limits, chunks, progress), `ValidationSummary` (the invalid fields of a group, with links to them) |
|
|
50
52
|
| Choice | `CheckBox` (three states), `Switch`, `RadioGroup`, `DropDown`, `ComboBox`, `Autocomplete`, `Lookup` (columns), `TagBox`, `ListBox` |
|
|
@@ -87,7 +89,8 @@ addShortcut('Mod+K', () => palette.open()); // app-wide
|
|
|
87
89
|
`tokens/languages/<language>/`, such as Material's 56 px filled text field with square bottom corners or Fluent's
|
|
88
90
|
20 px check box. Languages do not inherit from each other, and adding one only requires new files. Decisions that
|
|
89
91
|
apply to every component at once, such as focus, raised surfaces, elevation and selection, come from the design system
|
|
90
|
-
role tokens that the component tokens reference.
|
|
92
|
+
role tokens that the component tokens reference. Design languages are independent interpretations and are not
|
|
93
|
+
affiliated with their owners.
|
|
91
94
|
- Application CSS outside a layer takes precedence over both packages. Override a design system token to restyle
|
|
92
95
|
everything that uses it:
|
|
93
96
|
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Component, Emitter, type Bind, type ComponentBase, type Event as MotifEvent, type IBaseProp } from "@motifx/core";
|
|
2
|
+
import { Control } from "../../core/control";
|
|
3
|
+
import type { IconSource } from "../../core/icon-source";
|
|
4
|
+
import { Button } from "../button/Button";
|
|
5
|
+
import { Toolbar } from "../toolbar/Toolbar";
|
|
6
|
+
import type { ToolbarItem } from "../toolbar/toolbar-item";
|
|
7
|
+
import type { ToolbarOverflow } from "../toolbar/toolbar-overflow";
|
|
8
|
+
import type { AppBarNavigation } from "./app-bar-navigation";
|
|
9
|
+
import type { AppBarNavigationClickEventArgs } from "./app-bar-navigation-click-event-args";
|
|
10
|
+
import type { AppBarPosition } from "./app-bar-position";
|
|
11
|
+
import type { AppBarProps } from "./app-bar-props";
|
|
12
|
+
import type { AppBarScrollBehavior } from "./app-bar-scroll-behavior";
|
|
13
|
+
import type { AppBarTitleAlign } from "./app-bar-title-align";
|
|
14
|
+
import type { AppBarTone } from "./app-bar-tone";
|
|
15
|
+
/**
|
|
16
|
+
* The top bar of an application (`<header>`): a menu or back button, a logo, a title with a subtitle, a control such as
|
|
17
|
+
* a search box, and commands. The commands are a `Toolbar`, so those that do not fit move into its "more" menu and the
|
|
18
|
+
* arrow keys move between them. The bar can stay at the top while the page scrolls, rise above the content or leave
|
|
19
|
+
* when scrolling down (`scrollBehavior`), and it keeps clear of the notch of a phone.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* <AppBar title="Orders" navigation="menu" onNavigationClick={() => this.drawer.show()}
|
|
23
|
+
* actions={[{ icon: searchIcon, hint: 'Search', click: () => this.search() }]} />
|
|
24
|
+
* <AppBar title="Invoice" subtitle={() => this.invoice.number} navigation="back" scrollBehavior="hide" />
|
|
25
|
+
* <AppBar title="Inbox" tone="accent"><TextBox label="Search" labelMode="hidden" /></AppBar>
|
|
26
|
+
*/
|
|
27
|
+
export declare class AppBar extends Control<HTMLElement, AppBarProps> {
|
|
28
|
+
navigationClick: Emitter<AppBarNavigationClickEventArgs>;
|
|
29
|
+
row: Component<HTMLDivElement>;
|
|
30
|
+
start: Component<HTMLDivElement>;
|
|
31
|
+
logoHost: Component<HTMLSpanElement>;
|
|
32
|
+
titles: Component<HTMLDivElement>;
|
|
33
|
+
titlePart: Component<HTMLDivElement>;
|
|
34
|
+
subtitlePart: Component<HTMLDivElement>;
|
|
35
|
+
contentHost: Component<HTMLDivElement>;
|
|
36
|
+
actionsHost: Component<HTMLDivElement>;
|
|
37
|
+
toolbar: Toolbar;
|
|
38
|
+
navigationButton: Button | null;
|
|
39
|
+
logoPart: ComponentBase | null;
|
|
40
|
+
placed: ComponentBase | null;
|
|
41
|
+
stopScroll: (() => void) | null;
|
|
42
|
+
constructor(props?: IBaseProp<AppBarProps>);
|
|
43
|
+
onMounted(): void;
|
|
44
|
+
get title(): string;
|
|
45
|
+
set title(value: Bind<string>);
|
|
46
|
+
get subtitle(): string;
|
|
47
|
+
set subtitle(value: Bind<string>);
|
|
48
|
+
get titleAlign(): AppBarTitleAlign;
|
|
49
|
+
set titleAlign(value: Bind<AppBarTitleAlign>);
|
|
50
|
+
get headingLevel(): number | null;
|
|
51
|
+
set headingLevel(value: Bind<number | null>);
|
|
52
|
+
get logo(): IconSource | null;
|
|
53
|
+
set logo(value: Bind<IconSource | null | undefined>);
|
|
54
|
+
get navigation(): AppBarNavigation;
|
|
55
|
+
set navigation(value: Bind<AppBarNavigation>);
|
|
56
|
+
get navigationGlyph(): string;
|
|
57
|
+
set navigationGlyph(value: Bind<string>);
|
|
58
|
+
get navigationLabel(): string;
|
|
59
|
+
set navigationLabel(value: Bind<string>);
|
|
60
|
+
get actions(): readonly ToolbarItem[];
|
|
61
|
+
set actions(value: Bind<readonly ToolbarItem[]>);
|
|
62
|
+
get actionsLabel(): string;
|
|
63
|
+
set actionsLabel(value: Bind<string>);
|
|
64
|
+
get actionsText(): string;
|
|
65
|
+
get overflow(): ToolbarOverflow;
|
|
66
|
+
set overflow(value: Bind<ToolbarOverflow>);
|
|
67
|
+
get content(): ComponentBase | null;
|
|
68
|
+
set content(value: Bind<ComponentBase | null>);
|
|
69
|
+
get tone(): AppBarTone;
|
|
70
|
+
set tone(value: Bind<AppBarTone>);
|
|
71
|
+
get prominent(): boolean;
|
|
72
|
+
set prominent(value: Bind<boolean>);
|
|
73
|
+
get position(): AppBarPosition;
|
|
74
|
+
set position(value: Bind<AppBarPosition>);
|
|
75
|
+
get scrollBehavior(): AppBarScrollBehavior;
|
|
76
|
+
set scrollBehavior(value: Bind<AppBarScrollBehavior>);
|
|
77
|
+
get scrollTarget(): HTMLElement | null;
|
|
78
|
+
set scrollTarget(value: Bind<HTMLElement | null>);
|
|
79
|
+
get onNavigationClick(): MotifEvent<AppBarNavigationClickEventArgs>;
|
|
80
|
+
drawTitles(): void;
|
|
81
|
+
drawNavigation(): void;
|
|
82
|
+
drawLogo(): void;
|
|
83
|
+
drawStart(): void;
|
|
84
|
+
drawActions(): void;
|
|
85
|
+
placeContent(): void;
|
|
86
|
+
drawLook(): void;
|
|
87
|
+
followScroll(): void;
|
|
88
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AppBar } from "./AppBar";
|
|
2
|
+
import type { AppBarNavigation } from "./app-bar-navigation";
|
|
3
|
+
/** Data of `AppBar.onNavigationClick`. */
|
|
4
|
+
export interface AppBarNavigationClickEventArgs {
|
|
5
|
+
/** The kind of navigation button that was pressed. */
|
|
6
|
+
navigation: AppBarNavigation;
|
|
7
|
+
originalEvent: Event;
|
|
8
|
+
source: AppBar;
|
|
9
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Bind, ComponentBase } from "@motifx/core";
|
|
2
|
+
import type { ControlProps } from "../../core/control";
|
|
3
|
+
import type { IconSource } from "../../core/icon-source";
|
|
4
|
+
import type { ToolbarItem } from "../toolbar/toolbar-item";
|
|
5
|
+
import type { ToolbarOverflow } from "../toolbar/toolbar-overflow";
|
|
6
|
+
import type { AppBarNavigation } from "./app-bar-navigation";
|
|
7
|
+
import type { AppBarNavigationClickEventArgs } from "./app-bar-navigation-click-event-args";
|
|
8
|
+
import type { AppBarPosition } from "./app-bar-position";
|
|
9
|
+
import type { AppBarScrollBehavior } from "./app-bar-scroll-behavior";
|
|
10
|
+
import type { AppBarTitleAlign } from "./app-bar-title-align";
|
|
11
|
+
import type { AppBarTone } from "./app-bar-tone";
|
|
12
|
+
/** Props of `AppBar`. Each prop is also a settable property, and a function is tracked. */
|
|
13
|
+
export interface AppBarProps extends ControlProps {
|
|
14
|
+
title?: Bind<string>;
|
|
15
|
+
/** A second, smaller line under the title. */
|
|
16
|
+
subtitle?: Bind<string>;
|
|
17
|
+
/** The default is `'start'`. */
|
|
18
|
+
titleAlign?: Bind<AppBarTitleAlign>;
|
|
19
|
+
/** Makes the title a heading of this level. By default, it is plain text. */
|
|
20
|
+
headingLevel?: Bind<number | null>;
|
|
21
|
+
/** An image, an element or a component before the title. */
|
|
22
|
+
logo?: Bind<IconSource | null | undefined>;
|
|
23
|
+
/** The button at the start of the bar. The default is `'none'`. */
|
|
24
|
+
navigation?: Bind<AppBarNavigation>;
|
|
25
|
+
/** The glyph of that button. The default is `'menu'`, or `'arrow-start'` for `'back'`. */
|
|
26
|
+
navigationGlyph?: Bind<string>;
|
|
27
|
+
/** The accessible name of that button. By default, it is a kit string. */
|
|
28
|
+
navigationLabel?: Bind<string>;
|
|
29
|
+
/** The commands at the end of the bar, the same items as `Toolbar.items`. */
|
|
30
|
+
actions?: Bind<readonly ToolbarItem[]>;
|
|
31
|
+
/** The accessible name of the commands. By default, it is a kit string. */
|
|
32
|
+
actionsLabel?: Bind<string>;
|
|
33
|
+
/** How commands that do not fit are handled. The default is `'menu'`. */
|
|
34
|
+
overflow?: Bind<ToolbarOverflow>;
|
|
35
|
+
/** A control between the title and the commands, the same as JSX children. */
|
|
36
|
+
content?: Bind<ComponentBase | null>;
|
|
37
|
+
/** The default is `'surface'`. */
|
|
38
|
+
tone?: Bind<AppBarTone>;
|
|
39
|
+
/** Puts the title on a larger row of its own under the buttons. The default is `false`. */
|
|
40
|
+
prominent?: Bind<boolean>;
|
|
41
|
+
/** The default is `'sticky'`. */
|
|
42
|
+
position?: Bind<AppBarPosition>;
|
|
43
|
+
/** The default is `'none'`. */
|
|
44
|
+
scrollBehavior?: Bind<AppBarScrollBehavior>;
|
|
45
|
+
/** What `scrollBehavior` watches. By default, the nearest ancestor that scrolls, else the page. */
|
|
46
|
+
scrollTarget?: Bind<HTMLElement | null>;
|
|
47
|
+
/** Occurs when the button at the start of the bar is pressed. */
|
|
48
|
+
onNavigationClick?: (e: AppBarNavigationClickEventArgs) => void;
|
|
49
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { AppBar } from "./AppBar";
|
|
2
|
+
export type { AppBarNavigation } from "./app-bar-navigation";
|
|
3
|
+
export type { AppBarNavigationClickEventArgs } from "./app-bar-navigation-click-event-args";
|
|
4
|
+
export type { AppBarPosition } from "./app-bar-position";
|
|
5
|
+
export type { AppBarProps } from "./app-bar-props";
|
|
6
|
+
export type { AppBarScrollBehavior } from "./app-bar-scroll-behavior";
|
|
7
|
+
export type { AppBarTitleAlign } from "./app-bar-title-align";
|
|
8
|
+
export type { AppBarTone } from "./app-bar-tone";
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Emitter, type Bind, type Component, type Event as MotifEvent, type IBaseProp } from "@motifx/core";
|
|
2
|
+
import { Control } from "../../core/control";
|
|
3
|
+
import { type BarcodeFormat, type BarcodeModel } from "../../parts/code/barcode-encode";
|
|
4
|
+
import { type CodeImage } from "../../parts/code/code-image";
|
|
5
|
+
import type { BarcodeExportOptions } from "./barcode-export-options";
|
|
6
|
+
import type { BarcodeFailedEventArgs } from "./barcode-failed-event-args";
|
|
7
|
+
import type { BarcodeProps } from "./barcode-props";
|
|
8
|
+
/**
|
|
9
|
+
* A linear barcode, drawn as vectors: Code 128, Code 39, EAN-13, EAN-8, UPC-A or Interleaved 2 of 5. EAN and UPC values
|
|
10
|
+
* may leave out the check digit, which is worked out, and a wrong one is refused. A value the format cannot hold draws
|
|
11
|
+
* nothing and raises `onEncodeFailed`. `toSVG()` and `toDataURL()` give an image.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <Barcode value={() => this.item.code} />
|
|
15
|
+
* <Barcode format="ean13" value="4006381333931" />
|
|
16
|
+
*/
|
|
17
|
+
export declare class Barcode extends Control<HTMLDivElement, BarcodeProps> {
|
|
18
|
+
encodeFailed: Emitter<BarcodeFailedEventArgs>;
|
|
19
|
+
svg: SVGSVGElement;
|
|
20
|
+
path: SVGPathElement;
|
|
21
|
+
textPart: Component<HTMLSpanElement>;
|
|
22
|
+
model: BarcodeModel | null;
|
|
23
|
+
constructor(props?: IBaseProp<BarcodeProps>);
|
|
24
|
+
get value(): string;
|
|
25
|
+
set value(value: Bind<string>);
|
|
26
|
+
get format(): BarcodeFormat;
|
|
27
|
+
set format(value: Bind<BarcodeFormat>);
|
|
28
|
+
get checkDigit(): boolean;
|
|
29
|
+
set checkDigit(value: Bind<boolean>);
|
|
30
|
+
get moduleWidth(): number;
|
|
31
|
+
set moduleWidth(value: Bind<number>);
|
|
32
|
+
get height(): number | null;
|
|
33
|
+
set height(value: Bind<number | null>);
|
|
34
|
+
get margin(): number;
|
|
35
|
+
set margin(value: Bind<number>);
|
|
36
|
+
get showText(): boolean;
|
|
37
|
+
set showText(value: Bind<boolean>);
|
|
38
|
+
get label(): string;
|
|
39
|
+
set label(value: Bind<string>);
|
|
40
|
+
get onEncodeFailed(): MotifEvent<BarcodeFailedEventArgs>;
|
|
41
|
+
/** Indicates that the value could not be drawn. */
|
|
42
|
+
get isInvalid(): boolean;
|
|
43
|
+
/** The text under the bars, with the check digit where the format has one. */
|
|
44
|
+
get codeText(): string;
|
|
45
|
+
/** The code as an SVG document, with the text under the bars. */
|
|
46
|
+
toSVG(options?: BarcodeExportOptions): string;
|
|
47
|
+
/** The code as a data URL, a PNG by default. */
|
|
48
|
+
toDataURL(type?: string, options?: BarcodeExportOptions): string;
|
|
49
|
+
exportLook(options: BarcodeExportOptions): {
|
|
50
|
+
scale: number;
|
|
51
|
+
color: string;
|
|
52
|
+
background: string;
|
|
53
|
+
};
|
|
54
|
+
withTextRoom(image: CodeImage): CodeImage;
|
|
55
|
+
svgText(image: CodeImage): string;
|
|
56
|
+
imageOf(barHeight: number): CodeImage | null;
|
|
57
|
+
render(): void;
|
|
58
|
+
barHeightOfLanguage(): number;
|
|
59
|
+
onMounted(): void;
|
|
60
|
+
drawText(): void;
|
|
61
|
+
drawName(): void;
|
|
62
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Options of `Barcode.toSVG` and `toDataURL`. */
|
|
2
|
+
export interface BarcodeExportOptions {
|
|
3
|
+
/** The width of a module in pixels. The default is `2`. */
|
|
4
|
+
scale?: number;
|
|
5
|
+
/** The default is `'#000000'`. */
|
|
6
|
+
color?: string;
|
|
7
|
+
/** The default is `'#ffffff'`. */
|
|
8
|
+
background?: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BarcodeFormat } from "../../parts/code/barcode-encode";
|
|
2
|
+
import type { Barcode } from "./Barcode";
|
|
3
|
+
/** Data of `Barcode.onEncodeFailed`. */
|
|
4
|
+
export interface BarcodeFailedEventArgs {
|
|
5
|
+
/** The value the format cannot hold. */
|
|
6
|
+
value: string;
|
|
7
|
+
format: BarcodeFormat;
|
|
8
|
+
source: Barcode;
|
|
9
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Bind } from "@motifx/core";
|
|
2
|
+
import type { ControlProps } from "../../core/control";
|
|
3
|
+
import type { BarcodeFormat } from "../../parts/code/barcode-encode";
|
|
4
|
+
import type { BarcodeFailedEventArgs } from "./barcode-failed-event-args";
|
|
5
|
+
/** Props of `Barcode`. Each prop is also a settable property, and a function is tracked. */
|
|
6
|
+
export interface BarcodeProps extends ControlProps {
|
|
7
|
+
/** The value of the code. */
|
|
8
|
+
value?: Bind<string>;
|
|
9
|
+
/** The default is `'code128'`. */
|
|
10
|
+
format?: Bind<BarcodeFormat>;
|
|
11
|
+
/** Adds the optional check character of Code 39. The default is `false`. */
|
|
12
|
+
checkDigit?: Bind<boolean>;
|
|
13
|
+
/** The width of the thinnest bar in pixels. The default is `2`. */
|
|
14
|
+
moduleWidth?: Bind<number>;
|
|
15
|
+
/** The height of the bars in pixels. By default, it comes from the design language. */
|
|
16
|
+
height?: Bind<number | null>;
|
|
17
|
+
/** The quiet zone at each side, in modules. Readers need it. The default is `10`. */
|
|
18
|
+
margin?: Bind<number>;
|
|
19
|
+
/** Shows the text under the bars. The default is `true`. */
|
|
20
|
+
showText?: Bind<boolean>;
|
|
21
|
+
/** The accessible name. By default, it is a kit string with the value. */
|
|
22
|
+
label?: Bind<string>;
|
|
23
|
+
/** Occurs when the format cannot hold the value. */
|
|
24
|
+
onEncodeFailed?: (e: BarcodeFailedEventArgs) => void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Barcode } from "./Barcode";
|
|
2
|
+
export type { BarcodeFormat } from "../../parts/code/barcode-encode";
|
|
3
|
+
export type { BarcodeExportOptions } from "./barcode-export-options";
|
|
4
|
+
export type { BarcodeFailedEventArgs } from "./barcode-failed-event-args";
|
|
5
|
+
export type { BarcodeProps } from "./barcode-props";
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import type { Bind, IBaseProp } from "@motifx/core";
|
|
2
|
+
import { Control } from "../../core/control";
|
|
3
|
+
import { ResizeWatch } from "../../core/resize-watch";
|
|
4
|
+
import { type ChartFormat } from "../../parts/chart/chart-text";
|
|
5
|
+
import { TextPool } from "../../parts/chart/svg-parts";
|
|
6
|
+
import { TokenLengths } from "../../parts/chart/token-lengths";
|
|
7
|
+
import { ValueMotion } from "../../parts/chart/value-motion";
|
|
8
|
+
import type { ChartField } from "../chart/chart-field";
|
|
9
|
+
import type { BarGaugeProps } from "./bar-gauge-props";
|
|
10
|
+
interface Bar {
|
|
11
|
+
value: number | null;
|
|
12
|
+
name: string;
|
|
13
|
+
color: string;
|
|
14
|
+
}
|
|
15
|
+
interface Look {
|
|
16
|
+
size: number;
|
|
17
|
+
thickness: number;
|
|
18
|
+
gap: number;
|
|
19
|
+
indent: number;
|
|
20
|
+
spacing: number;
|
|
21
|
+
}
|
|
22
|
+
interface Ring {
|
|
23
|
+
inner: number;
|
|
24
|
+
outer: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Several values side by side as bars bent round one middle, each against the same scale: a bar starts at the base
|
|
28
|
+
* value and goes round as far as its value. Each value is written at the end of its bar, a legend names the bars, and
|
|
29
|
+
* the pointer shows the bar under it. The values are read as one name for assistive technology, and a change moves over
|
|
30
|
+
* the design language's motion.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* <BarGauge data={() => this.sales} valueField="share" nameField="region" label="Sales by region" legend />
|
|
34
|
+
*/
|
|
35
|
+
export declare class BarGauge<T = any> extends Control<HTMLDivElement, BarGaugeProps<T>> {
|
|
36
|
+
svg: SVGSVGElement;
|
|
37
|
+
tracks: SVGGElement;
|
|
38
|
+
fills: SVGGElement;
|
|
39
|
+
connectors: SVGPathElement;
|
|
40
|
+
labels: SVGGElement;
|
|
41
|
+
labelPool: TextPool;
|
|
42
|
+
probe: SVGTextElement;
|
|
43
|
+
legendList: HTMLUListElement;
|
|
44
|
+
tip: HTMLSpanElement;
|
|
45
|
+
motion: ValueMotion;
|
|
46
|
+
tokens: TokenLengths;
|
|
47
|
+
bars: Bar[];
|
|
48
|
+
rings: Ring[];
|
|
49
|
+
cx: number;
|
|
50
|
+
cy: number;
|
|
51
|
+
start: number;
|
|
52
|
+
sweep: number;
|
|
53
|
+
reach: number;
|
|
54
|
+
box: {
|
|
55
|
+
x: number;
|
|
56
|
+
y: number;
|
|
57
|
+
width: number;
|
|
58
|
+
height: number;
|
|
59
|
+
};
|
|
60
|
+
look: Look;
|
|
61
|
+
measure: (text: string) => number;
|
|
62
|
+
lineHeight: number;
|
|
63
|
+
placed: boolean;
|
|
64
|
+
queued: boolean;
|
|
65
|
+
watch: ResizeWatch | null;
|
|
66
|
+
stopLook: (() => void) | null;
|
|
67
|
+
stopFonts: (() => void) | null;
|
|
68
|
+
constructor(props?: IBaseProp<BarGaugeProps<T>>);
|
|
69
|
+
onMounted(): void;
|
|
70
|
+
get data(): readonly (T | number)[];
|
|
71
|
+
set data(value: Bind<readonly (T | number)[]>);
|
|
72
|
+
get valueField(): ChartField<T> | null;
|
|
73
|
+
set valueField(value: Bind<ChartField<T> | null>);
|
|
74
|
+
get nameField(): ChartField<T> | null;
|
|
75
|
+
set nameField(value: Bind<ChartField<T> | null>);
|
|
76
|
+
get colorField(): ChartField<T> | null;
|
|
77
|
+
set colorField(value: Bind<ChartField<T> | null>);
|
|
78
|
+
get min(): number;
|
|
79
|
+
set min(value: Bind<number>);
|
|
80
|
+
get max(): number;
|
|
81
|
+
set max(value: Bind<number>);
|
|
82
|
+
get baseValue(): number | null;
|
|
83
|
+
set baseValue(value: Bind<number | null>);
|
|
84
|
+
get angle(): number;
|
|
85
|
+
set angle(value: Bind<number>);
|
|
86
|
+
get rotation(): number;
|
|
87
|
+
set rotation(value: Bind<number>);
|
|
88
|
+
get colors(): readonly string[] | null;
|
|
89
|
+
set colors(value: Bind<readonly string[] | null>);
|
|
90
|
+
get label(): string;
|
|
91
|
+
set label(value: Bind<string>);
|
|
92
|
+
get format(): ChartFormat | null;
|
|
93
|
+
set format(value: Bind<ChartFormat | null>);
|
|
94
|
+
get showLabels(): boolean;
|
|
95
|
+
set showLabels(value: Bind<boolean>);
|
|
96
|
+
get legend(): boolean;
|
|
97
|
+
set legend(value: Bind<boolean>);
|
|
98
|
+
get tooltip(): boolean;
|
|
99
|
+
set tooltip(value: Bind<boolean>);
|
|
100
|
+
get size(): number | null;
|
|
101
|
+
set size(value: Bind<number | null>);
|
|
102
|
+
/** Draws again after the developer changed the given rows in place. */
|
|
103
|
+
refresh(): void;
|
|
104
|
+
/** The bars, read from numbers or from rows; anything else is an empty value. */
|
|
105
|
+
read(): Bar[];
|
|
106
|
+
number(value: number): string;
|
|
107
|
+
again(): void;
|
|
108
|
+
/** New values: a bar that is new grows from the base value. */
|
|
109
|
+
moveTo(): void;
|
|
110
|
+
lengths(): Look;
|
|
111
|
+
draw(): void;
|
|
112
|
+
/** The parts that follow the moving values: the bars and the values at their ends. */
|
|
113
|
+
drawValues(values: readonly (number | null)[]): void;
|
|
114
|
+
drawLegend(): void;
|
|
115
|
+
barText(bar: Bar): string;
|
|
116
|
+
drawName(): void;
|
|
117
|
+
/** The bar under the pointer shows in the tooltip. */
|
|
118
|
+
pointAt(e: PointerEvent): void;
|
|
119
|
+
}
|
|
120
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Bind } from "@motifx/core";
|
|
2
|
+
import type { ControlProps } from "../../core/control";
|
|
3
|
+
import type { ChartFormat } from "../../parts/chart/chart-text";
|
|
4
|
+
import type { ChartField } from "../chart/chart-field";
|
|
5
|
+
/** Props of `BarGauge`. Each prop is also a settable property, and a function is tracked. */
|
|
6
|
+
export interface BarGaugeProps<T = any> extends ControlProps {
|
|
7
|
+
/** The values: numbers, or rows with `valueField`. They are read and never changed. */
|
|
8
|
+
data?: Bind<readonly (T | number)[]>;
|
|
9
|
+
/** The field of a row that holds its value. */
|
|
10
|
+
valueField?: Bind<ChartField<T> | null>;
|
|
11
|
+
/** The field of a row that holds its name, shown in the legend and the tooltip and read with its value. */
|
|
12
|
+
nameField?: Bind<ChartField<T> | null>;
|
|
13
|
+
/** The field of a row that holds a color of its own. */
|
|
14
|
+
colorField?: Bind<ChartField<T> | null>;
|
|
15
|
+
/** The ends of the scale. The defaults are `0` and `100`. */
|
|
16
|
+
min?: Bind<number>;
|
|
17
|
+
max?: Bind<number>;
|
|
18
|
+
/** Where the bars start, so they grow both ways from a value inside the scale. By default, the start of the scale. */
|
|
19
|
+
baseValue?: Bind<number | null>;
|
|
20
|
+
/** How far the bars go round, in degrees. The default is `270`. */
|
|
21
|
+
angle?: Bind<number>;
|
|
22
|
+
/** How far the middle of the bars is turned from the top, clockwise, in degrees. The default is `0`. */
|
|
23
|
+
rotation?: Bind<number>;
|
|
24
|
+
/** Colors of your own, in the order of the values, instead of the chart colors. */
|
|
25
|
+
colors?: Bind<readonly string[] | null>;
|
|
26
|
+
/** What the values are, read as its name. */
|
|
27
|
+
label?: Bind<string>;
|
|
28
|
+
/** How the values read. By default, the numbers of the language. */
|
|
29
|
+
format?: Bind<ChartFormat | null>;
|
|
30
|
+
/** Writes each value at the end of its bar. The default is `true`. */
|
|
31
|
+
showLabels?: Bind<boolean>;
|
|
32
|
+
/** Shows a legend of the names under the bars. The default is `false`. */
|
|
33
|
+
legend?: Bind<boolean>;
|
|
34
|
+
/** Shows the value under the pointer. The default is `true`. */
|
|
35
|
+
tooltip?: Bind<boolean>;
|
|
36
|
+
/** The width of the bars' whole circle in pixels. By default, it comes from the design language. */
|
|
37
|
+
size?: Bind<number | null>;
|
|
38
|
+
}
|