@motifx-community/ui 0.1.0-beta.5 → 0.1.0-beta.6
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 +87 -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-settings.d.ts +3 -3
- package/dist/components/datagrid/model/GridData.d.ts +22 -3
- 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/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 +55999 -47313
- 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/field/Field.d.ts +2 -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 +1 -1
- 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 +6724 -98
- package/llms.txt +50 -1
- package/package.json +5 -5
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Chart } from './Chart';
|
|
2
|
+
/** Data of `Chart.onZoomChanged`. */
|
|
3
|
+
export interface ChartZoomChangedEventArgs<T = any> {
|
|
4
|
+
/** The first and last position in view, as given in the rows; both null when the whole chart is in view again. */
|
|
5
|
+
from: unknown;
|
|
6
|
+
to: unknown;
|
|
7
|
+
source: Chart<T>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { Chart } from './Chart';
|
|
2
|
+
export type { ChartFormat } from '../../parts/chart/chart-text';
|
|
3
|
+
export type { ChartAxis } from './chart-axis';
|
|
4
|
+
export type { ChartAxisKind } from './chart-axis-kind';
|
|
5
|
+
export type { ChartDataErrorEventArgs } from './chart-data-error-event-args';
|
|
6
|
+
export type { ChartExportOptions } from './chart-export-options';
|
|
7
|
+
export type { ChartField } from './chart-field';
|
|
8
|
+
export type { ChartLabels } from './chart-labels';
|
|
9
|
+
export type { ChartLegendOptions } from './chart-legend-options';
|
|
10
|
+
export type { ChartLegendPosition } from './chart-legend-position';
|
|
11
|
+
export type { ChartPoint } from './chart-point';
|
|
12
|
+
export type { ChartPointEventArgs } from './chart-point-event-args';
|
|
13
|
+
export type { ChartProps } from './chart-props';
|
|
14
|
+
export type { ChartSeries } from './chart-series';
|
|
15
|
+
export type { ChartSeriesToggledEventArgs } from './chart-series-toggled-event-args';
|
|
16
|
+
export type { ChartSeriesType } from './chart-series-type';
|
|
17
|
+
export type { ChartStacked } from './chart-stacked';
|
|
18
|
+
export type { ChartTooltipContext } from './chart-tooltip-context';
|
|
19
|
+
export type { ChartTooltipOptions } from './chart-tooltip-options';
|
|
20
|
+
export type { ChartMode } from './chart-mode';
|
|
21
|
+
export type { ChartModeChangedEventArgs } from './chart-mode-changed-event-args';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** An item of a chart's legend: a series, a part of a whole, or a color of a heat map. */
|
|
2
|
+
export interface LegendEntry {
|
|
3
|
+
/** `series:2`, `part:4` or `heat:1`. */
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
/** The color of its key. */
|
|
7
|
+
mark: string;
|
|
8
|
+
/** The shape of its key follows the mark: a line, a dot, or a block. */
|
|
9
|
+
type: string;
|
|
10
|
+
shown: boolean;
|
|
11
|
+
/** A click hides or shows what it names. */
|
|
12
|
+
pressable: boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ModelPoint } from './chart-model';
|
|
2
|
+
import type { PlotInput } from './plot-view';
|
|
3
|
+
/** A position, as it reads: a date, a number or a name. `tick` is the short form of an axis. */
|
|
4
|
+
export declare function positionText(input: PlotInput, key: unknown, tickFormat?: Intl.DateTimeFormatOptions): string;
|
|
5
|
+
/** A row of a heat map, as it reads. */
|
|
6
|
+
export declare function laneText(input: PlotInput, lane: number): string;
|
|
7
|
+
/** A value, as it reads for its type: a range, four prices, a change, or a number. */
|
|
8
|
+
export declare function pointText(input: PlotInput, point: ModelPoint): string;
|
|
9
|
+
/** A share of a whole, as it reads. */
|
|
10
|
+
export declare function shareText(locale: string, share: number): string;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type { ChartAxis } from './chart-axis';
|
|
2
|
+
import type { ChartLook } from './chart-look';
|
|
3
|
+
import type { ChartModel, ModelPoint, ModelSlot } from './chart-model';
|
|
4
|
+
import type { ChartReference } from './chart-reference';
|
|
5
|
+
/** What a plot is drawn from. */
|
|
6
|
+
export interface PlotInput {
|
|
7
|
+
model: ChartModel;
|
|
8
|
+
xAxis: ChartAxis;
|
|
9
|
+
yAxis: ChartAxis;
|
|
10
|
+
horizontal: boolean;
|
|
11
|
+
rtl: boolean;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
look: ChartLook;
|
|
15
|
+
locale: string;
|
|
16
|
+
/** The part of the positions in view, once zoomed or following live data; null for all of them. */
|
|
17
|
+
window?: {
|
|
18
|
+
from: number;
|
|
19
|
+
to: number;
|
|
20
|
+
} | null;
|
|
21
|
+
references?: readonly ChartReference[];
|
|
22
|
+
/** Chosen values, as `series:index`. */
|
|
23
|
+
selected?: ReadonlySet<string>;
|
|
24
|
+
/** The values changed: the marks move from where they were. */
|
|
25
|
+
animate?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/** A rectangle of the SVG. */
|
|
28
|
+
export interface Rect {
|
|
29
|
+
left: number;
|
|
30
|
+
top: number;
|
|
31
|
+
width: number;
|
|
32
|
+
height: number;
|
|
33
|
+
}
|
|
34
|
+
/** A class of a heat map: its values and its color. */
|
|
35
|
+
export interface HeatClass {
|
|
36
|
+
from: number;
|
|
37
|
+
to: number;
|
|
38
|
+
color: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The drawing of one family of charts in an SVG of its own: on two axes, as the parts of a whole, or around a center.
|
|
42
|
+
* The chart talks to each the same way: it draws, finds what is under a place, and shows a position and a value.
|
|
43
|
+
*/
|
|
44
|
+
export interface PlotView {
|
|
45
|
+
svg: SVGSVGElement;
|
|
46
|
+
marks: SVGGElement;
|
|
47
|
+
input: PlotInput | null;
|
|
48
|
+
box: Rect;
|
|
49
|
+
/** The positions in the order the keyboard walks them. */
|
|
50
|
+
order: ModelSlot[];
|
|
51
|
+
draw(input: PlotInput): void;
|
|
52
|
+
find(x: number, y: number): {
|
|
53
|
+
slot: ModelSlot;
|
|
54
|
+
point: ModelPoint | null;
|
|
55
|
+
} | null;
|
|
56
|
+
showActive(slot: ModelSlot | null, point: ModelPoint | null, crosshair: boolean): void;
|
|
57
|
+
xText(key: unknown, tick?: boolean): string;
|
|
58
|
+
valueText(point: ModelPoint): string;
|
|
59
|
+
/** The color of a value: its series', its part's, or its class'. */
|
|
60
|
+
markOfPoint(point: ModelPoint): string;
|
|
61
|
+
}
|
|
@@ -251,9 +251,9 @@ export interface GridSettings extends ColumnFeatures {
|
|
|
251
251
|
groupExpandMode: 'button' | 'rowClick';
|
|
252
252
|
/**
|
|
253
253
|
* What groups the rows of a data source: `'auto'` uses its adapter when it supports grouping and the
|
|
254
|
-
* source loads by blocks (otherwise the browser), `true` uses the adapter whenever the source
|
|
255
|
-
* blocks and every level has a field to group by, and `false` always uses the browser,
|
|
256
|
-
* matching row. The default is `'auto'`.
|
|
254
|
+
* source loads by pages or blocks (otherwise the browser), `true` uses the adapter whenever the source
|
|
255
|
+
* loads by pages or blocks and every level has a field to group by, and `false` always uses the browser,
|
|
256
|
+
* from every matching row. The default is `'auto'`.
|
|
257
257
|
*/
|
|
258
258
|
remoteGrouping: 'auto' | boolean;
|
|
259
259
|
/**
|
|
@@ -14,9 +14,10 @@ import { GroupView } from './GroupView';
|
|
|
14
14
|
* - `'blocks'`: what is loaded where the view is.
|
|
15
15
|
*
|
|
16
16
|
* Grouped, the places are those of the grouped list (`GroupView`): group rows and, in open groups,
|
|
17
|
-
* data rows. An adapter that groups, under blocks, gives the groups (keys and counts) and
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* data rows. An adapter that groups, under pages or blocks, gives the groups (keys and counts), and
|
|
18
|
+
* only the rows the view shows are loaded, in group order: blocks by the source, pages here, a range
|
|
19
|
+
* at a time (the grid pages over the grouped list itself). Otherwise every matching row is here and
|
|
20
|
+
* grouped in memory, as with rows in memory.
|
|
20
21
|
*
|
|
21
22
|
* Infinite, the places shown end where the parts loaded so far end: blocks load part by part from
|
|
22
23
|
* the start (the end is known when a part comes back short), anything else (rows in memory, groups)
|
|
@@ -69,6 +70,13 @@ export declare class GridData<T> {
|
|
|
69
70
|
private failed;
|
|
70
71
|
/** Infinite over blocks: the places the view asked for last. */
|
|
71
72
|
private shown;
|
|
73
|
+
/** Grouped by a server over pages: the rows loaded so far by their index in group order, those on the way, and the failures. */
|
|
74
|
+
private pageRows;
|
|
75
|
+
private pageKeys;
|
|
76
|
+
private pageWaiting;
|
|
77
|
+
private pageFailed;
|
|
78
|
+
private pageController;
|
|
79
|
+
private pageGeneration;
|
|
72
80
|
private readonly partLoaded;
|
|
73
81
|
/** Tells that fields of `state` changed (the grid tells its views). */
|
|
74
82
|
private readonly changed;
|
|
@@ -107,6 +115,8 @@ export declare class GridData<T> {
|
|
|
107
115
|
get rowCount(): number;
|
|
108
116
|
/** Whether the rows are grouped now. */
|
|
109
117
|
get isGrouped(): boolean;
|
|
118
|
+
/** Grouped by a server over a source that loads pages: the rows of the groups load here, a range at a time. */
|
|
119
|
+
private get pagesOnServer();
|
|
110
120
|
/** The data row at place `index`, or `undefined` while it is not loaded (or a group row or footer is there). */
|
|
111
121
|
rowAt(index: number): T | undefined;
|
|
112
122
|
/** A data row by its index among the rows in group order (grouped); `undefined` while it is not loaded. */
|
|
@@ -188,6 +198,15 @@ export declare class GridData<T> {
|
|
|
188
198
|
private startGroupLoad;
|
|
189
199
|
private stopGroupLoad;
|
|
190
200
|
private dropEveryRow;
|
|
201
|
+
/**
|
|
202
|
+
* Grouped by a server over pages: loads the rows of these runs (indexes in group order) that are neither loaded nor
|
|
203
|
+
* on the way, each stretch in one request, in the order the source gets (the groups first).
|
|
204
|
+
*/
|
|
205
|
+
private loadRuns;
|
|
206
|
+
/** Grouped by a server over pages: the loaded rows by key, for finding a row's place. */
|
|
207
|
+
private pageKeyIndex;
|
|
208
|
+
/** Another row set or other groups: the rows loaded for the groups go, and what is on the way is dropped. */
|
|
209
|
+
private dropPageRows;
|
|
191
210
|
/** Groups the rows in memory: the source's rows, or every matching row loaded apart. */
|
|
192
211
|
private groupInMemory;
|
|
193
212
|
}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import type { Bind, IBaseProp } from "@motifx/core";
|
|
2
|
+
import { Control } from "../../core/control";
|
|
3
|
+
import { ResizeWatch } from "../../core/resize-watch";
|
|
4
|
+
import type { Place } from "../../parts/chart/chart-paths";
|
|
5
|
+
import { type ChartFormat } from "../../parts/chart/chart-text";
|
|
6
|
+
import { TextPool } from "../../parts/chart/svg-parts";
|
|
7
|
+
import { TokenLengths } from "../../parts/chart/token-lengths";
|
|
8
|
+
import { ValueMotion } from "../../parts/chart/value-motion";
|
|
9
|
+
import type { GaugeMark } from "./gauge-mark";
|
|
10
|
+
import type { GaugeMarker } from "./gauge-marker";
|
|
11
|
+
import type { GaugeNeedleShape } from "./gauge-needle-shape";
|
|
12
|
+
import type { GaugeOrientation } from "./gauge-orientation";
|
|
13
|
+
import type { GaugeProps } from "./gauge-props";
|
|
14
|
+
import type { GaugeRange } from "./gauge-range";
|
|
15
|
+
import type { GaugeScale } from "./gauge-scale";
|
|
16
|
+
import { GaugeShape } from "./gauge-shape";
|
|
17
|
+
import type { GaugeType } from "./gauge-type";
|
|
18
|
+
interface Look {
|
|
19
|
+
size: number;
|
|
20
|
+
length: number;
|
|
21
|
+
thickness: number;
|
|
22
|
+
band: number;
|
|
23
|
+
tick: number;
|
|
24
|
+
marker: number;
|
|
25
|
+
spacing: number;
|
|
26
|
+
}
|
|
27
|
+
/** What one draw worked out, kept for the moving value and the pointer. */
|
|
28
|
+
interface Drawn {
|
|
29
|
+
min: number;
|
|
30
|
+
max: number;
|
|
31
|
+
look: Look;
|
|
32
|
+
straight: boolean;
|
|
33
|
+
bandOut: number;
|
|
34
|
+
markFrom: number;
|
|
35
|
+
lineHeight: number;
|
|
36
|
+
measure: (text: string) => number;
|
|
37
|
+
box: {
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A value against its scale: an arc, a circle or a straight bar, across or upright. The scale shows its ends or ticks
|
|
46
|
+
* with their values; ranges give stretches of it a meaning, and the fill takes the tone of the range its value is in. The
|
|
47
|
+
* value shows as a fill from a base value, as a needle, a triangle, a circle, a rhombus, a line or a callout, and marks
|
|
48
|
+
* show other values on the scale, such as targets. It is a meter for assistive technology, with the value, its range
|
|
49
|
+
* and the marks read out; a change of value moves over the design language's motion.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* <Gauge value={() => this.cpu} label="CPU" format={{ style: 'unit', unit: 'percent' }}
|
|
53
|
+
* ranges={[{ from: 0, to: 70, tone: 'good' }, { from: 70, to: 90, tone: 'warning' }, { from: 90, to: 100, tone: 'danger' }]} />
|
|
54
|
+
*/
|
|
55
|
+
export declare class Gauge extends Control<HTMLDivElement, GaugeProps> {
|
|
56
|
+
svg: SVGSVGElement;
|
|
57
|
+
track: SVGPathElement;
|
|
58
|
+
bands: SVGGElement;
|
|
59
|
+
fillPath: SVGPathElement;
|
|
60
|
+
minorPath: SVGPathElement;
|
|
61
|
+
tickPath: SVGPathElement;
|
|
62
|
+
tickLabels: SVGGElement;
|
|
63
|
+
probe: SVGTextElement;
|
|
64
|
+
labelPool: TextPool;
|
|
65
|
+
markGroup: SVGGElement;
|
|
66
|
+
markerPath: SVGPathElement;
|
|
67
|
+
calloutGroup: SVGGElement;
|
|
68
|
+
calloutPath: SVGPathElement;
|
|
69
|
+
calloutText: SVGTextElement;
|
|
70
|
+
needlePath: SVGPathElement;
|
|
71
|
+
needleTip: SVGPathElement;
|
|
72
|
+
valueText: HTMLDivElement;
|
|
73
|
+
valueProbe: HTMLSpanElement;
|
|
74
|
+
labelText: HTMLDivElement;
|
|
75
|
+
tip: HTMLSpanElement;
|
|
76
|
+
shape: GaugeShape;
|
|
77
|
+
motion: ValueMotion;
|
|
78
|
+
tokens: TokenLengths;
|
|
79
|
+
drawn: Drawn | null;
|
|
80
|
+
placed: boolean;
|
|
81
|
+
queued: boolean;
|
|
82
|
+
watch: ResizeWatch | null;
|
|
83
|
+
stopLook: (() => void) | null;
|
|
84
|
+
stopFonts: (() => void) | null;
|
|
85
|
+
constructor(props?: IBaseProp<GaugeProps>);
|
|
86
|
+
onMounted(): void;
|
|
87
|
+
get value(): number | null;
|
|
88
|
+
set value(value: Bind<number | null>);
|
|
89
|
+
get min(): number;
|
|
90
|
+
set min(value: Bind<number>);
|
|
91
|
+
get max(): number;
|
|
92
|
+
set max(value: Bind<number>);
|
|
93
|
+
get type(): GaugeType;
|
|
94
|
+
set type(value: Bind<GaugeType>);
|
|
95
|
+
get orientation(): GaugeOrientation;
|
|
96
|
+
set orientation(value: Bind<GaugeOrientation>);
|
|
97
|
+
get angle(): number;
|
|
98
|
+
set angle(value: Bind<number>);
|
|
99
|
+
get rotation(): number;
|
|
100
|
+
set rotation(value: Bind<number>);
|
|
101
|
+
get ranges(): readonly GaugeRange[];
|
|
102
|
+
set ranges(value: Bind<readonly GaugeRange[]>);
|
|
103
|
+
get scale(): GaugeScale;
|
|
104
|
+
set scale(value: Bind<GaugeScale>);
|
|
105
|
+
get ticks(): readonly number[] | null;
|
|
106
|
+
set ticks(value: Bind<readonly number[] | null>);
|
|
107
|
+
get tickInterval(): number | null;
|
|
108
|
+
set tickInterval(value: Bind<number | null>);
|
|
109
|
+
get minorTicks(): number;
|
|
110
|
+
set minorTicks(value: Bind<number>);
|
|
111
|
+
get fill(): boolean;
|
|
112
|
+
set fill(value: Bind<boolean>);
|
|
113
|
+
get baseValue(): number | null;
|
|
114
|
+
set baseValue(value: Bind<number | null>);
|
|
115
|
+
get marker(): GaugeMarker | null;
|
|
116
|
+
set marker(value: Bind<GaugeMarker | null>);
|
|
117
|
+
get needleShape(): GaugeNeedleShape;
|
|
118
|
+
set needleShape(value: Bind<GaugeNeedleShape>);
|
|
119
|
+
get marks(): readonly GaugeMark[];
|
|
120
|
+
set marks(value: Bind<readonly GaugeMark[]>);
|
|
121
|
+
get markShape(): GaugeMarker;
|
|
122
|
+
set markShape(value: Bind<GaugeMarker>);
|
|
123
|
+
get label(): string;
|
|
124
|
+
set label(value: Bind<string>);
|
|
125
|
+
get format(): ChartFormat | null;
|
|
126
|
+
set format(value: Bind<ChartFormat | null>);
|
|
127
|
+
get showValue(): boolean;
|
|
128
|
+
set showValue(value: Bind<boolean>);
|
|
129
|
+
get tooltip(): boolean;
|
|
130
|
+
set tooltip(value: Bind<boolean>);
|
|
131
|
+
get size(): number | null;
|
|
132
|
+
set size(value: Bind<number | null>);
|
|
133
|
+
numberOf(name: string): number | null;
|
|
134
|
+
/** The range a value is in, or none. */
|
|
135
|
+
rangeOf(value: number | null): GaugeRange | null;
|
|
136
|
+
/** The color of a range: its own, its tone's, or the next chart color for a range with neither. */
|
|
137
|
+
toneOf(range: GaugeRange | null): string;
|
|
138
|
+
number(value: number): string;
|
|
139
|
+
again(): void;
|
|
140
|
+
moveTo(): void;
|
|
141
|
+
lengths(): Look;
|
|
142
|
+
/** The values of the ticks, and of the small ones between them. */
|
|
143
|
+
tickValues(min: number, max: number, length: number): {
|
|
144
|
+
majors: number[];
|
|
145
|
+
minors: number[];
|
|
146
|
+
};
|
|
147
|
+
draw(): void;
|
|
148
|
+
/** The size of a text as the scale draws it; an estimate where nothing is laid out. */
|
|
149
|
+
textBox(value: string, font: string, height: number): {
|
|
150
|
+
width: number;
|
|
151
|
+
height: number;
|
|
152
|
+
};
|
|
153
|
+
/** The width of the widest value the gauge can show: the ends of the scale, or a value past them. */
|
|
154
|
+
valueRoom(min: number, max: number, value: number | null): number;
|
|
155
|
+
markerKind(): GaugeMarker | null;
|
|
156
|
+
shapeOf(m: GaugeMark): GaugeMarker;
|
|
157
|
+
drawTicks(majors: number[], minors: number[], share: (v: number) => number, from: number, length: number, side: 1 | -1, on: boolean): void;
|
|
158
|
+
drawLabels(labels: readonly {
|
|
159
|
+
text: string;
|
|
160
|
+
at: Place;
|
|
161
|
+
anchor: 'start' | 'middle' | 'end';
|
|
162
|
+
}[]): void;
|
|
163
|
+
drawMarks(marks: readonly GaugeMark[], share: (v: number) => number): void;
|
|
164
|
+
/** The path of a marker or a mark, and its text for a callout. */
|
|
165
|
+
shapePath(kind: GaugeMarker, at: number, drawn: Drawn, value: string): {
|
|
166
|
+
d: string;
|
|
167
|
+
text: string;
|
|
168
|
+
at: Place | null;
|
|
169
|
+
};
|
|
170
|
+
/** The parts that follow the moving value: the fill, its tone and the marker. */
|
|
171
|
+
drawValue(shownValue: number | null): void;
|
|
172
|
+
hubPath(radius: number): string;
|
|
173
|
+
drawName(value: number | null): void;
|
|
174
|
+
markText(m: GaugeMark): string;
|
|
175
|
+
/** The value or the mark nearest the pointer shows in the tooltip. */
|
|
176
|
+
pointAt(e: PointerEvent): void;
|
|
177
|
+
valueTip(value: number): string;
|
|
178
|
+
}
|
|
179
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { GaugeMarker } from "./gauge-marker";
|
|
2
|
+
/** A value marked on a gauge's scale besides its own, such as a target or a limit. */
|
|
3
|
+
export interface GaugeMark {
|
|
4
|
+
value: number;
|
|
5
|
+
/** What it is, read with the gauge's value and shown in the tooltip. */
|
|
6
|
+
label?: string;
|
|
7
|
+
/** Its shape. By default, the gauge's `markShape`. */
|
|
8
|
+
shape?: GaugeMarker;
|
|
9
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
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 { GaugeMark } from "./gauge-mark";
|
|
5
|
+
import type { GaugeMarker } from "./gauge-marker";
|
|
6
|
+
import type { GaugeNeedleShape } from "./gauge-needle-shape";
|
|
7
|
+
import type { GaugeOrientation } from "./gauge-orientation";
|
|
8
|
+
import type { GaugeRange } from "./gauge-range";
|
|
9
|
+
import type { GaugeScale } from "./gauge-scale";
|
|
10
|
+
import type { GaugeType } from "./gauge-type";
|
|
11
|
+
/** Props of `Gauge`. Each prop is also a settable property, and a function is tracked. */
|
|
12
|
+
export interface GaugeProps extends ControlProps {
|
|
13
|
+
/** The value. */
|
|
14
|
+
value?: Bind<number | null>;
|
|
15
|
+
/** The ends of the scale. The defaults are `0` and `100`; a `min` above `max` runs the scale the other way. */
|
|
16
|
+
min?: Bind<number>;
|
|
17
|
+
max?: Bind<number>;
|
|
18
|
+
/** How it draws. The default is `'arc'`. */
|
|
19
|
+
type?: Bind<GaugeType>;
|
|
20
|
+
/** Which way a straight gauge runs. The default is `'horizontal'`. */
|
|
21
|
+
orientation?: Bind<GaugeOrientation>;
|
|
22
|
+
/** How far an arc goes round, in degrees. The default is `240`. */
|
|
23
|
+
angle?: Bind<number>;
|
|
24
|
+
/** How far the middle of an arc is turned from the top, clockwise, in degrees. The default is `0`. */
|
|
25
|
+
rotation?: Bind<number>;
|
|
26
|
+
/** Stretches of the scale and what they mean. The fill takes the tone of the range its value is in. */
|
|
27
|
+
ranges?: Bind<readonly GaugeRange[]>;
|
|
28
|
+
/** What the scale shows. The default is `'ends'`. */
|
|
29
|
+
scale?: Bind<GaugeScale>;
|
|
30
|
+
/** The values of the ticks. By default, ticks every `tickInterval`. */
|
|
31
|
+
ticks?: Bind<readonly number[] | null>;
|
|
32
|
+
/** How far apart the ticks are. By default, an even step that fits the size. */
|
|
33
|
+
tickInterval?: Bind<number | null>;
|
|
34
|
+
/** How many small ticks go between two ticks. The default is `0`. */
|
|
35
|
+
minorTicks?: Bind<number>;
|
|
36
|
+
/** Fills the track from `baseValue` to the value. The default is `true`. */
|
|
37
|
+
fill?: Bind<boolean>;
|
|
38
|
+
/** Where the fill starts. By default, the start of the scale. */
|
|
39
|
+
baseValue?: Bind<number | null>;
|
|
40
|
+
/** A shape that points at the value. The default is none. */
|
|
41
|
+
marker?: Bind<GaugeMarker | null>;
|
|
42
|
+
/** How a needle is drawn. The default is `'tapered'`. */
|
|
43
|
+
needleShape?: Bind<GaugeNeedleShape>;
|
|
44
|
+
/** Other values marked on the scale, such as targets or limits. */
|
|
45
|
+
marks?: Bind<readonly GaugeMark[]>;
|
|
46
|
+
/** The shape of the marks, unless a mark has its own. The default is `'triangle'`. */
|
|
47
|
+
markShape?: Bind<GaugeMarker>;
|
|
48
|
+
/** What it measures, shown under the value and read as its name. */
|
|
49
|
+
label?: Bind<string>;
|
|
50
|
+
/** How the values read. By default, the numbers of the language. */
|
|
51
|
+
format?: Bind<ChartFormat | null>;
|
|
52
|
+
/** Shows the value in the middle. The default is `true`. */
|
|
53
|
+
showValue?: Bind<boolean>;
|
|
54
|
+
/** Shows the value or the mark under the pointer. The default is `true`. */
|
|
55
|
+
tooltip?: Bind<boolean>;
|
|
56
|
+
/** The width of an arc's whole circle, with its ranges, or the length of an upright gauge, in pixels. By default, it comes from the design language. */
|
|
57
|
+
size?: Bind<number | null>;
|
|
58
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** A stretch of a gauge's scale, with what a value there means. */
|
|
2
|
+
export interface GaugeRange {
|
|
3
|
+
from: number;
|
|
4
|
+
to: number;
|
|
5
|
+
/** The meaning, in the design language's colors: the fill takes it while the value is in this range. */
|
|
6
|
+
tone?: 'neutral' | 'good' | 'warning' | 'danger';
|
|
7
|
+
/** A color of your own instead of a tone. A range with neither takes the next chart color. */
|
|
8
|
+
color?: string;
|
|
9
|
+
/** A name for the range, read with the value. */
|
|
10
|
+
label?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { type Place } from "../../parts/chart/chart-paths";
|
|
2
|
+
/** Where a share of the scale sits on the track: the middle of the track, the way out from it and the way along it. */
|
|
3
|
+
export interface GaugeSpot {
|
|
4
|
+
c: Place;
|
|
5
|
+
n: Place;
|
|
6
|
+
t: Place;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* The geometry of a gauge's track, an arc or a straight bar, so every part is drawn the same way on both: a part is
|
|
10
|
+
* placed by its share of the scale and its distance from the middle line of the track, outward toward the ranges.
|
|
11
|
+
*/
|
|
12
|
+
export declare class GaugeShape {
|
|
13
|
+
kind: 'arc' | 'horizontal' | 'vertical';
|
|
14
|
+
cx: number;
|
|
15
|
+
cy: number;
|
|
16
|
+
mid: number;
|
|
17
|
+
start: number;
|
|
18
|
+
sweep: number;
|
|
19
|
+
/** A straight track runs from `from` to `to` along it, with its middle line at `across`. */
|
|
20
|
+
from: number;
|
|
21
|
+
to: number;
|
|
22
|
+
across: number;
|
|
23
|
+
spot(share: number): GaugeSpot;
|
|
24
|
+
/** A point `out` from the middle line and `side` along the track. */
|
|
25
|
+
point(spot: GaugeSpot, out: number, side?: number): Place;
|
|
26
|
+
/** A band between two shares, from `inner` to `outer` away from the middle line. */
|
|
27
|
+
strip(a: number, b: number, inner: number, outer: number, round?: boolean): string;
|
|
28
|
+
polygon(points: readonly Place[]): string;
|
|
29
|
+
/** A triangle whose tip is `tip` from the middle line, pointing at the track. */
|
|
30
|
+
triangle(share: number, tip: number, size: number): string;
|
|
31
|
+
/** A circle on the middle line. */
|
|
32
|
+
dot(share: number, radius: number): string;
|
|
33
|
+
rhombus(share: number, radius: number): string;
|
|
34
|
+
/** A line across the track, `reach` out on both sides of the middle line. */
|
|
35
|
+
line(share: number, reach: number, width: number): string;
|
|
36
|
+
/** A needle from the middle of an arc to `length`, `width` wide at its base and `tip` wide at its end. */
|
|
37
|
+
needle(share: number, from: number, length: number, width: number, tip: number): string;
|
|
38
|
+
/** A box `width` by `height` with a pointer, `from` out of the middle line, or in from it; and where its text goes. */
|
|
39
|
+
callout(share: number, from: number, width: number, height: number, pointer: number, radius: number, inward?: boolean): {
|
|
40
|
+
d: string;
|
|
41
|
+
text: Place;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { Gauge } from "./Gauge";
|
|
2
|
+
export type { GaugeMark } from "./gauge-mark";
|
|
3
|
+
export type { GaugeMarker } from "./gauge-marker";
|
|
4
|
+
export type { GaugeNeedleShape } from "./gauge-needle-shape";
|
|
5
|
+
export type { GaugeOrientation } from "./gauge-orientation";
|
|
6
|
+
export type { GaugeProps } from "./gauge-props";
|
|
7
|
+
export type { GaugeRange } from "./gauge-range";
|
|
8
|
+
export type { GaugeScale } from "./gauge-scale";
|
|
9
|
+
export type { GaugeType } from "./gauge-type";
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Emitter, type Bind, type Event as MotifEvent, type IBaseProp } from "@motifx/core";
|
|
2
|
+
import { Field } from "../../parts/field/Field";
|
|
3
|
+
import type { ValidationRule } from "../../parts/validation/validation-rule";
|
|
4
|
+
import type { OtpCharset } from "./otp-charset";
|
|
5
|
+
import type { OtpCompletedEventArgs } from "./otp-completed-event-args";
|
|
6
|
+
import type { OtpInputProps } from "./otp-input-props";
|
|
7
|
+
interface Cell {
|
|
8
|
+
box: HTMLSpanElement;
|
|
9
|
+
char: HTMLSpanElement;
|
|
10
|
+
caret: HTMLSpanElement;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A one-time code in a row of boxes. It is one real input under the boxes, so typing, pasting a whole code, the code a
|
|
14
|
+
* phone offers from a message and screen readers work as in any text box, and it is one Tab stop. The next character
|
|
15
|
+
* goes into the next box, Backspace goes back, and the arrow keys move between the boxes. This is a field, so the label,
|
|
16
|
+
* help text, rules and `x-model` work as in all fields. `onCompleted` occurs when every box is filled.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* <OtpInput label="Verification code" x-model={() => this.code} onCompleted={e => this.verify(e.value)} />
|
|
20
|
+
* <OtpInput label="Access key" length={8} charset="alphanumeric" uppercase groupSize={4} />
|
|
21
|
+
* <OtpInput label="PIN" length={4} masked />
|
|
22
|
+
*/
|
|
23
|
+
export declare class OtpInput extends Field<string, OtpInputProps> {
|
|
24
|
+
completed: Emitter<OtpCompletedEventArgs>;
|
|
25
|
+
cells: Cell[];
|
|
26
|
+
row: HTMLDivElement;
|
|
27
|
+
/** The complete value told last, so that it is told once. */
|
|
28
|
+
told: string | null;
|
|
29
|
+
constructor(props?: IBaseProp<OtpInputProps>);
|
|
30
|
+
get length(): number;
|
|
31
|
+
set length(value: Bind<number>);
|
|
32
|
+
get charset(): OtpCharset;
|
|
33
|
+
set charset(value: Bind<OtpCharset>);
|
|
34
|
+
get pattern(): RegExp | null;
|
|
35
|
+
set pattern(value: Bind<RegExp | null>);
|
|
36
|
+
get uppercase(): boolean;
|
|
37
|
+
set uppercase(value: Bind<boolean>);
|
|
38
|
+
get masked(): boolean;
|
|
39
|
+
set masked(value: Bind<boolean>);
|
|
40
|
+
get maskCharacter(): string;
|
|
41
|
+
set maskCharacter(value: Bind<string>);
|
|
42
|
+
get placeholder(): string;
|
|
43
|
+
set placeholder(value: Bind<string>);
|
|
44
|
+
get groupSize(): number | null;
|
|
45
|
+
set groupSize(value: Bind<number | null>);
|
|
46
|
+
get separator(): string;
|
|
47
|
+
set separator(value: Bind<string>);
|
|
48
|
+
get autoComplete(): string;
|
|
49
|
+
set autoComplete(value: Bind<string>);
|
|
50
|
+
get onCompleted(): MotifEvent<OtpCompletedEventArgs>;
|
|
51
|
+
/** Indicates that every box is filled. */
|
|
52
|
+
get isComplete(): boolean;
|
|
53
|
+
/** Empties the boxes and puts the caret in the first one. */
|
|
54
|
+
clear(): void;
|
|
55
|
+
protected createControl(): HTMLElement;
|
|
56
|
+
protected emptyValue(): string;
|
|
57
|
+
protected normalizeValue(value: string): string;
|
|
58
|
+
protected builtInRules(): ValidationRule<string>[];
|
|
59
|
+
protected renderValue(value: string): void;
|
|
60
|
+
get input(): HTMLInputElement;
|
|
61
|
+
/** The characters of `value` the field takes, at most `length` of them. */
|
|
62
|
+
accepted(value: string): string;
|
|
63
|
+
renderInput(): void;
|
|
64
|
+
renderRules(): void;
|
|
65
|
+
fitValue(): void;
|
|
66
|
+
renderCells(): void;
|
|
67
|
+
drawCells(): void;
|
|
68
|
+
beforeInput(e: InputEvent): void;
|
|
69
|
+
typed(e: Event): void;
|
|
70
|
+
placeCaret(): void;
|
|
71
|
+
pressed(e: PointerEvent): void;
|
|
72
|
+
}
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Bind } from "@motifx/core";
|
|
2
|
+
import type { FieldProps } from "../../parts/field/field-props";
|
|
3
|
+
import type { OtpCharset } from "./otp-charset";
|
|
4
|
+
import type { OtpCompletedEventArgs } from "./otp-completed-event-args";
|
|
5
|
+
/**
|
|
6
|
+
* Props of `OtpInput`, in addition to the field props (label, help text, rules, `x-model`). Each prop is also a
|
|
7
|
+
* settable property, and a function is tracked.
|
|
8
|
+
*/
|
|
9
|
+
export interface OtpInputProps extends FieldProps<string> {
|
|
10
|
+
/** The number of characters. The default is `6`. */
|
|
11
|
+
length?: Bind<number>;
|
|
12
|
+
/** Which characters are accepted. The default is `'digits'`. */
|
|
13
|
+
charset?: Bind<OtpCharset>;
|
|
14
|
+
/** Accepts the characters this matches instead of `charset`. It is tested on one character at a time. */
|
|
15
|
+
pattern?: Bind<RegExp | null>;
|
|
16
|
+
/** Turns letters into capitals as they are typed. The default is `false`. */
|
|
17
|
+
uppercase?: Bind<boolean>;
|
|
18
|
+
/** Draws a mark in place of each character. The default is `false`. */
|
|
19
|
+
masked?: Bind<boolean>;
|
|
20
|
+
/** The mark of `masked`. The default is `'•'`. */
|
|
21
|
+
maskCharacter?: Bind<string>;
|
|
22
|
+
/** Shown in a box that is still empty. */
|
|
23
|
+
placeholder?: Bind<string>;
|
|
24
|
+
/** Puts a separator after every so many boxes, such as `3` for `123-456`. By default, there is none. */
|
|
25
|
+
groupSize?: Bind<number | null>;
|
|
26
|
+
/** The text of that separator. The default is `'–'`. */
|
|
27
|
+
separator?: Bind<string>;
|
|
28
|
+
/** The `autocomplete` of the input. The default is `'one-time-code'`, which lets a phone offer the code from a message. */
|
|
29
|
+
autoComplete?: Bind<string>;
|
|
30
|
+
/** Occurs when the user has entered every character, by typing, pasting or from the phone. */
|
|
31
|
+
onCompleted?: (e: OtpCompletedEventArgs) => void;
|
|
32
|
+
}
|