@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
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Emitter, type Bind, type Event as MotifEvent, type IBaseProp } from "@motifx/core";
|
|
2
|
+
import { Control } from "../../core/control";
|
|
3
|
+
import { type CodeImage } from "../../parts/code/code-image";
|
|
4
|
+
import { type QrLevel, type QrMatrix } from "../../parts/code/qr-encode";
|
|
5
|
+
import type { QRCodeExportOptions } from "./qr-code-export-options";
|
|
6
|
+
import type { QRCodeFailedEventArgs } from "./qr-code-failed-event-args";
|
|
7
|
+
import type { QRCodeProps } from "./qr-code-props";
|
|
8
|
+
/**
|
|
9
|
+
* A QR code, drawn as vectors so that it stays sharp at any size. The smallest version that holds the text is chosen, and
|
|
10
|
+
* the text may hold any characters. `level` sets how much of the code can be damaged, and `logo` puts an image in the
|
|
11
|
+
* middle. `toSVG()` and `toDataURL()` give an image. A text too long for a code draws nothing and raises `onEncodeFailed`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <QRCode value={() => this.link} size={200} />
|
|
15
|
+
* <QRCode value="https://example.com" level="H" logo="/logo.svg" />
|
|
16
|
+
*/
|
|
17
|
+
export declare class QRCode extends Control<HTMLDivElement, QRCodeProps> {
|
|
18
|
+
encodeFailed: Emitter<QRCodeFailedEventArgs>;
|
|
19
|
+
svg: SVGSVGElement;
|
|
20
|
+
path: SVGPathElement;
|
|
21
|
+
logoImage: HTMLImageElement;
|
|
22
|
+
matrix: QrMatrix | null;
|
|
23
|
+
image: CodeImage | null;
|
|
24
|
+
constructor(props?: IBaseProp<QRCodeProps>);
|
|
25
|
+
get value(): string;
|
|
26
|
+
set value(value: Bind<string>);
|
|
27
|
+
get level(): QrLevel;
|
|
28
|
+
set level(value: Bind<QrLevel>);
|
|
29
|
+
get size(): number | null;
|
|
30
|
+
set size(value: Bind<number | null>);
|
|
31
|
+
get margin(): number;
|
|
32
|
+
set margin(value: Bind<number>);
|
|
33
|
+
get logo(): string | null;
|
|
34
|
+
set logo(value: Bind<string | null>);
|
|
35
|
+
get logoSize(): number;
|
|
36
|
+
set logoSize(value: Bind<number>);
|
|
37
|
+
get label(): string;
|
|
38
|
+
set label(value: Bind<string>);
|
|
39
|
+
get onEncodeFailed(): MotifEvent<QRCodeFailedEventArgs>;
|
|
40
|
+
/** Indicates that the value could not be drawn. */
|
|
41
|
+
get isInvalid(): boolean;
|
|
42
|
+
/** The number of modules along a side of the code, without its margin. */
|
|
43
|
+
get modules(): number;
|
|
44
|
+
/** The code as an SVG document. The logo is not part of it. */
|
|
45
|
+
toSVG(options?: QRCodeExportOptions): string;
|
|
46
|
+
/** The code as a data URL, a PNG by default. The logo is not part of it. */
|
|
47
|
+
toDataURL(type?: string, options?: QRCodeExportOptions): string;
|
|
48
|
+
exportLook(options: QRCodeExportOptions): {
|
|
49
|
+
scale: number;
|
|
50
|
+
color: string;
|
|
51
|
+
background: string;
|
|
52
|
+
};
|
|
53
|
+
render(): void;
|
|
54
|
+
imageOf(matrix: QrMatrix): CodeImage;
|
|
55
|
+
logoHole(size: number): (x: number, y: number) => boolean;
|
|
56
|
+
drawLogo(): void;
|
|
57
|
+
drawName(): void;
|
|
58
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { QRCode } from "./QRCode";
|
|
2
|
+
export type { QrLevel } from "../../parts/code/qr-encode";
|
|
3
|
+
export type { QRCodeExportOptions } from "./qr-code-export-options";
|
|
4
|
+
export type { QRCodeFailedEventArgs } from "./qr-code-failed-event-args";
|
|
5
|
+
export type { QRCodeProps } from "./qr-code-props";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Options of `QRCode.toSVG` and `toDataURL`. */
|
|
2
|
+
export interface QRCodeExportOptions {
|
|
3
|
+
/** The width and height of the image in pixels, rounded to whole modules. The default is about `512`. */
|
|
4
|
+
size?: number;
|
|
5
|
+
/** The default is `'#000000'`. */
|
|
6
|
+
color?: string;
|
|
7
|
+
/** The default is `'#ffffff'`. */
|
|
8
|
+
background?: string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Bind } from "@motifx/core";
|
|
2
|
+
import type { ControlProps } from "../../core/control";
|
|
3
|
+
import type { QrLevel } from "../../parts/code/qr-encode";
|
|
4
|
+
import type { QRCodeFailedEventArgs } from "./qr-code-failed-event-args";
|
|
5
|
+
/** Props of `QRCode`. Each prop is also a settable property, and a function is tracked. */
|
|
6
|
+
export interface QRCodeProps extends ControlProps {
|
|
7
|
+
/** The text of the code. */
|
|
8
|
+
value?: Bind<string>;
|
|
9
|
+
/** How much of the code can be damaged: `'L'`, `'M'`, `'Q'` or `'H'`. The default is `'M'`. */
|
|
10
|
+
level?: Bind<QrLevel>;
|
|
11
|
+
/** The width and height in pixels. By default, it comes from the design language. */
|
|
12
|
+
size?: Bind<number | null>;
|
|
13
|
+
/** The quiet zone around the code, in modules. Readers need at least `4`, which is the default. */
|
|
14
|
+
margin?: Bind<number>;
|
|
15
|
+
/** The address of an image in the middle of the code. Use level `'H'` with it. */
|
|
16
|
+
logo?: Bind<string | null>;
|
|
17
|
+
/** The share of the code the logo covers, at most `0.3`. The default is `0.2`. */
|
|
18
|
+
logoSize?: Bind<number>;
|
|
19
|
+
/** The accessible name. By default, it is a kit string with the text of the code. */
|
|
20
|
+
label?: Bind<string>;
|
|
21
|
+
/** Occurs when the text does not fit in a code. */
|
|
22
|
+
onEncodeFailed?: (e: QRCodeFailedEventArgs) => void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Component, Emitter, type Bind, type Event as MotifEvent, type IBaseProp } from "@motifx/core";
|
|
2
|
+
import { Field } from "../../parts/field/Field";
|
|
3
|
+
import { Button } from "../button/Button";
|
|
4
|
+
import type { SignatureExportOptions } from "./signature-export-options";
|
|
5
|
+
import type { SignatureProps } from "./signature-props";
|
|
6
|
+
import type { SignaturePoint, SignatureStroke } from "./signature-stroke";
|
|
7
|
+
import type { SignatureStrokeEventArgs } from "./signature-stroke-event-args";
|
|
8
|
+
import { type InkLook } from "./signature-draw";
|
|
9
|
+
type Strokes = readonly SignatureStroke[];
|
|
10
|
+
/**
|
|
11
|
+
* A pad to sign on with a pen, a finger or a mouse. The value is the strokes themselves, so that a signature can be
|
|
12
|
+
* stored as data, drawn again at any size and loaded back; `toDataURL()`, `toBlob()` and `toSVG()` give an image. A pen
|
|
13
|
+
* that reports pressure sets the width of the line, and otherwise it follows the speed. This is a field, so the label,
|
|
14
|
+
* help text, rules and `x-model` work as in all fields. `Delete` removes the signature and `Ctrl+Z` the last stroke.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* <Signature label="Your signature" required x-model={() => this.form.signature} />
|
|
18
|
+
* const image = await signature.toBlob();
|
|
19
|
+
*/
|
|
20
|
+
export declare class Signature extends Field<Strokes, SignatureProps> {
|
|
21
|
+
strokeBegan: Emitter<SignatureStrokeEventArgs>;
|
|
22
|
+
strokeEnded: Emitter<SignatureStrokeEventArgs>;
|
|
23
|
+
canvas: HTMLCanvasElement;
|
|
24
|
+
placeholderPart: HTMLSpanElement;
|
|
25
|
+
guide: HTMLSpanElement;
|
|
26
|
+
actions: Component<HTMLDivElement>;
|
|
27
|
+
undoButton: Button;
|
|
28
|
+
clearButton: Button;
|
|
29
|
+
/** The stroke under the pen, until it is lifted. */
|
|
30
|
+
drawing: SignaturePoint[] | null;
|
|
31
|
+
pointer: number | null;
|
|
32
|
+
lastTime: number;
|
|
33
|
+
lastPressure: number;
|
|
34
|
+
padSize: {
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
};
|
|
38
|
+
observer: ResizeObserver | null;
|
|
39
|
+
constructor(props?: IBaseProp<SignatureProps>);
|
|
40
|
+
onMounted(): void;
|
|
41
|
+
get height(): number | null;
|
|
42
|
+
set height(value: Bind<number | null>);
|
|
43
|
+
get penColor(): string | null;
|
|
44
|
+
set penColor(value: Bind<string | null>);
|
|
45
|
+
get minWidth(): number;
|
|
46
|
+
set minWidth(value: Bind<number>);
|
|
47
|
+
get maxWidth(): number;
|
|
48
|
+
set maxWidth(value: Bind<number>);
|
|
49
|
+
get placeholder(): string;
|
|
50
|
+
set placeholder(value: Bind<string>);
|
|
51
|
+
get showGuide(): boolean;
|
|
52
|
+
set showGuide(value: Bind<boolean>);
|
|
53
|
+
get showClear(): boolean;
|
|
54
|
+
set showClear(value: Bind<boolean>);
|
|
55
|
+
get showUndo(): boolean;
|
|
56
|
+
set showUndo(value: Bind<boolean>);
|
|
57
|
+
get onStrokeBegan(): MotifEvent<SignatureStrokeEventArgs>;
|
|
58
|
+
get onStrokeEnded(): MotifEvent<SignatureStrokeEventArgs>;
|
|
59
|
+
/** The pad, which takes the pen and the keys. */
|
|
60
|
+
get padElement(): HTMLElement;
|
|
61
|
+
/** Indicates that nothing has been signed. */
|
|
62
|
+
get isEmpty(): boolean;
|
|
63
|
+
/** Removes the signature. */
|
|
64
|
+
clear(): void;
|
|
65
|
+
/** Removes the last stroke. */
|
|
66
|
+
undo(): void;
|
|
67
|
+
/** The signature as an SVG document. */
|
|
68
|
+
toSVG(options?: SignatureExportOptions): string;
|
|
69
|
+
/** The signature as a data URL, a PNG by default. */
|
|
70
|
+
toDataURL(type?: string, options?: SignatureExportOptions): string;
|
|
71
|
+
/** The signature as an image file, a PNG by default. */
|
|
72
|
+
toBlob(type?: string, options?: SignatureExportOptions): Promise<Blob | null>;
|
|
73
|
+
protected createControl(): HTMLElement;
|
|
74
|
+
protected get formRole(): boolean;
|
|
75
|
+
protected emptyValue(): Strokes;
|
|
76
|
+
protected normalizeValue(value: Strokes): Strokes;
|
|
77
|
+
protected isEmptyValue(value: Strokes): boolean;
|
|
78
|
+
protected sameValue(a: Strokes, b: Strokes): boolean;
|
|
79
|
+
protected renderValue(): void;
|
|
80
|
+
change(value: Strokes, event?: Event): void;
|
|
81
|
+
get canChange(): boolean;
|
|
82
|
+
actionButton(icon: string, press: () => void): Button;
|
|
83
|
+
drawParts(): void;
|
|
84
|
+
/** Sizes the canvas to the pad, in the pixels of the screen. */
|
|
85
|
+
fit(): void;
|
|
86
|
+
padLook(): InkLook;
|
|
87
|
+
redraw(): void;
|
|
88
|
+
exportLook(options: SignatureExportOptions): InkLook;
|
|
89
|
+
exportCanvas(options: SignatureExportOptions): HTMLCanvasElement;
|
|
90
|
+
pointOf(e: PointerEvent): SignaturePoint;
|
|
91
|
+
pressureOf(e: PointerEvent, x: number, y: number, box: {
|
|
92
|
+
width: number;
|
|
93
|
+
height: number;
|
|
94
|
+
}): number;
|
|
95
|
+
penDown(e: PointerEvent): void;
|
|
96
|
+
penMove(e: PointerEvent): void;
|
|
97
|
+
penUp(e: PointerEvent): void;
|
|
98
|
+
keyDown(e: KeyboardEvent): void;
|
|
99
|
+
}
|
|
100
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Signature } from "./Signature";
|
|
2
|
+
export type { SignatureExportOptions } from "./signature-export-options";
|
|
3
|
+
export type { SignatureProps } from "./signature-props";
|
|
4
|
+
export type { SignaturePoint, SignatureStroke } from "./signature-stroke";
|
|
5
|
+
export type { SignatureStrokeEventArgs } from "./signature-stroke-event-args";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SignatureStroke } from "./signature-stroke";
|
|
2
|
+
/** How a set of strokes is drawn, in the pixels of the target. */
|
|
3
|
+
export interface InkLook {
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
minWidth: number;
|
|
7
|
+
maxWidth: number;
|
|
8
|
+
color: string;
|
|
9
|
+
}
|
|
10
|
+
/** The strokes as the data of one SVG path. */
|
|
11
|
+
export declare function inkPath(strokes: readonly SignatureStroke[], look: InkLook): string;
|
|
12
|
+
/** Draws the strokes on a canvas whose scale is already set. */
|
|
13
|
+
export declare function drawInk(context: CanvasRenderingContext2D, strokes: readonly SignatureStroke[], look: InkLook): void;
|
|
14
|
+
/** The strokes as an SVG document. */
|
|
15
|
+
export declare function inkSvg(strokes: readonly SignatureStroke[], look: InkLook, background: string | null): string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** Options of `Signature.toDataURL`, `toBlob` and `toSVG`. */
|
|
2
|
+
export interface SignatureExportOptions {
|
|
3
|
+
/** The width of the image in pixels. The default is the width of the pad at twice its size. */
|
|
4
|
+
width?: number;
|
|
5
|
+
/** The height of the image in pixels. The default keeps the shape of the pad. */
|
|
6
|
+
height?: number;
|
|
7
|
+
/** The color of the lines. The default is `'#000000'`, so that the image does not depend on the theme. */
|
|
8
|
+
color?: string;
|
|
9
|
+
/** The background. By default, it is transparent. */
|
|
10
|
+
background?: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Bind } from "@motifx/core";
|
|
2
|
+
import type { FieldProps } from "../../parts/field/field-props";
|
|
3
|
+
import type { SignatureStroke } from "./signature-stroke";
|
|
4
|
+
import type { SignatureStrokeEventArgs } from "./signature-stroke-event-args";
|
|
5
|
+
/**
|
|
6
|
+
* Props of `Signature`, 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 SignatureProps extends FieldProps<readonly SignatureStroke[]> {
|
|
10
|
+
/** The height of the pad in pixels. By default, it comes from the design language. */
|
|
11
|
+
height?: Bind<number | null>;
|
|
12
|
+
/** The color of the lines. By default, it comes from the design language. */
|
|
13
|
+
penColor?: Bind<string | null>;
|
|
14
|
+
/** The width of a line at its thinnest, in pixels. The default is `1`. */
|
|
15
|
+
minWidth?: Bind<number>;
|
|
16
|
+
/** The width of a line at its thickest, in pixels. The default is `3`. */
|
|
17
|
+
maxWidth?: Bind<number>;
|
|
18
|
+
/** The text of the empty pad. By default, it is a kit string, and `''` removes it. */
|
|
19
|
+
placeholder?: Bind<string>;
|
|
20
|
+
/** Draws the line to sign on. The default is `true`. */
|
|
21
|
+
showGuide?: Bind<boolean>;
|
|
22
|
+
/** Shows the button that removes the signature. The default is `true`. */
|
|
23
|
+
showClear?: Bind<boolean>;
|
|
24
|
+
/** Shows the button that removes the last stroke. The default is `true`. */
|
|
25
|
+
showUndo?: Bind<boolean>;
|
|
26
|
+
/** Occurs when the pen touches the pad. */
|
|
27
|
+
onStrokeBegan?: (e: SignatureStrokeEventArgs) => void;
|
|
28
|
+
/** Occurs when the pen leaves the pad, after the value has changed. */
|
|
29
|
+
onStrokeEnded?: (e: SignatureStrokeEventArgs) => void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Signature } from "./Signature";
|
|
2
|
+
import type { SignatureStroke } from "./signature-stroke";
|
|
3
|
+
/** Data of `Signature.onStrokeBegan` and `onStrokeEnded`. */
|
|
4
|
+
export interface SignatureStrokeEventArgs {
|
|
5
|
+
/** The stroke so far. */
|
|
6
|
+
stroke: SignatureStroke;
|
|
7
|
+
originalEvent: PointerEvent;
|
|
8
|
+
source: Signature;
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** One point of a stroke. `x` and `y` run from `0` to `1` across the pad, so a signature fits a pad of any size. */
|
|
2
|
+
export interface SignaturePoint {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
/** How hard the pen pressed, from `0` to `1`. Without a pressure-sensitive pen, this follows the speed. */
|
|
6
|
+
pressure: number;
|
|
7
|
+
}
|
|
8
|
+
/** One line drawn without lifting the pen. */
|
|
9
|
+
export interface SignatureStroke {
|
|
10
|
+
points: readonly SignaturePoint[];
|
|
11
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
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 { TokenLengths } from "../../parts/chart/token-lengths";
|
|
6
|
+
import type { ChartField } from "../chart/chart-field";
|
|
7
|
+
import type { SparklineHighlight } from "./sparkline-highlight";
|
|
8
|
+
import type { SparklineProps } from "./sparkline-props";
|
|
9
|
+
import type { SparklineType } from "./sparkline-type";
|
|
10
|
+
interface Look {
|
|
11
|
+
line: number;
|
|
12
|
+
marker: number;
|
|
13
|
+
gap: number;
|
|
14
|
+
radius: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A chart the size of a word, for a trend beside a number, in a sentence or in a row of a table. The last value is marked
|
|
18
|
+
* by default; the accessible name says how many values there are, the first and the last, the lowest and the highest.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* <Sparkline data={() => this.week} label="Visits" highlight={['last', 'max']} />
|
|
22
|
+
* <Sparkline data={[3, -1, 2, -2, 4]} type="winloss" />
|
|
23
|
+
*/
|
|
24
|
+
export declare class Sparkline<T = any> extends Control<HTMLSpanElement, SparklineProps<T>> {
|
|
25
|
+
svg: SVGSVGElement;
|
|
26
|
+
area: SVGPathElement;
|
|
27
|
+
referenceLine: SVGPathElement;
|
|
28
|
+
marks: SVGPathElement;
|
|
29
|
+
rise: SVGPathElement;
|
|
30
|
+
fall: SVGPathElement;
|
|
31
|
+
dots: SVGPathElement;
|
|
32
|
+
active: SVGPathElement;
|
|
33
|
+
tip: HTMLSpanElement;
|
|
34
|
+
values: (number | null)[];
|
|
35
|
+
places: {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
}[];
|
|
39
|
+
look: Look | null;
|
|
40
|
+
tokens: TokenLengths;
|
|
41
|
+
placed: boolean;
|
|
42
|
+
queued: boolean;
|
|
43
|
+
watch: ResizeWatch | null;
|
|
44
|
+
stopLook: (() => void) | null;
|
|
45
|
+
constructor(props?: IBaseProp<SparklineProps<T>>);
|
|
46
|
+
onMounted(): void;
|
|
47
|
+
get data(): readonly unknown[] | null;
|
|
48
|
+
set data(value: Bind<readonly (number | null)[] | readonly T[] | null>);
|
|
49
|
+
get yField(): ChartField<T> | null;
|
|
50
|
+
set yField(value: Bind<ChartField<T> | null>);
|
|
51
|
+
get type(): SparklineType;
|
|
52
|
+
set type(value: Bind<SparklineType>);
|
|
53
|
+
get highlight(): readonly SparklineHighlight[];
|
|
54
|
+
set highlight(value: Bind<readonly SparklineHighlight[]>);
|
|
55
|
+
get reference(): number | 'average' | null;
|
|
56
|
+
set reference(value: Bind<number | 'average' | null>);
|
|
57
|
+
get min(): number | null;
|
|
58
|
+
set min(value: Bind<number | null>);
|
|
59
|
+
get max(): number | null;
|
|
60
|
+
set max(value: Bind<number | null>);
|
|
61
|
+
get smooth(): boolean;
|
|
62
|
+
set smooth(value: Bind<boolean>);
|
|
63
|
+
get color(): string | null;
|
|
64
|
+
set color(value: Bind<string | null>);
|
|
65
|
+
get label(): string;
|
|
66
|
+
set label(value: Bind<string>);
|
|
67
|
+
get format(): ChartFormat | null;
|
|
68
|
+
set format(value: Bind<ChartFormat | null>);
|
|
69
|
+
get tooltip(): boolean;
|
|
70
|
+
set tooltip(value: Bind<boolean>);
|
|
71
|
+
get height(): number | null;
|
|
72
|
+
set height(value: Bind<number | null>);
|
|
73
|
+
/** Draws again from the values as they are now, after they changed in place. */
|
|
74
|
+
refresh(): void;
|
|
75
|
+
again(): void;
|
|
76
|
+
/** The values, read from numbers or from rows; anything else is an empty value. */
|
|
77
|
+
read(): (number | null)[];
|
|
78
|
+
readLook(): Look;
|
|
79
|
+
valueText(value: number): string;
|
|
80
|
+
draw(): void;
|
|
81
|
+
drawName(known: number[]): void;
|
|
82
|
+
pointed(e: PointerEvent): void;
|
|
83
|
+
leave(): void;
|
|
84
|
+
}
|
|
85
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
import type { SparklineHighlight } from "./sparkline-highlight";
|
|
6
|
+
import type { SparklineType } from "./sparkline-type";
|
|
7
|
+
/** Props of `Sparkline`. Each prop is also a settable property, and a function is tracked. */
|
|
8
|
+
export interface SparklineProps<T = any> extends ControlProps {
|
|
9
|
+
/** The values: numbers, or rows with `yField`. They are read, never changed. */
|
|
10
|
+
data?: Bind<readonly (number | null)[] | readonly T[] | null>;
|
|
11
|
+
/** The field of a row that holds its value. */
|
|
12
|
+
yField?: Bind<ChartField<T> | null>;
|
|
13
|
+
/** How it draws. The default is `'line'`. */
|
|
14
|
+
type?: Bind<SparklineType>;
|
|
15
|
+
/** The values marked with a dot. The default is the last one, for a line or an area. */
|
|
16
|
+
highlight?: Bind<readonly SparklineHighlight[]>;
|
|
17
|
+
/** A line across at a value, or at the average. */
|
|
18
|
+
reference?: Bind<number | 'average' | null>;
|
|
19
|
+
/** The lowest and highest value of its scale. By default, they come from the values. */
|
|
20
|
+
min?: Bind<number | null>;
|
|
21
|
+
max?: Bind<number | null>;
|
|
22
|
+
/** Curves the line, never past the values it joins. */
|
|
23
|
+
smooth?: Bind<boolean>;
|
|
24
|
+
/** A color of your own. By default, the first chart color of the design language. */
|
|
25
|
+
color?: Bind<string | null>;
|
|
26
|
+
/** What the values are, for the accessible name: "Sales" reads "Sales: 12 values, from 4 to 9…". */
|
|
27
|
+
label?: Bind<string>;
|
|
28
|
+
/** How a value reads. By default, the numbers of the language. */
|
|
29
|
+
format?: Bind<ChartFormat | null>;
|
|
30
|
+
/** The value under the pointer shows above it. The default is `true`. */
|
|
31
|
+
tooltip?: Bind<boolean>;
|
|
32
|
+
/** The height in pixels. By default, it comes from the design language. */
|
|
33
|
+
height?: Bind<number | null>;
|
|
34
|
+
}
|
|
@@ -50,6 +50,7 @@ export declare class ValidationSummary extends Control<HTMLDivElement, Validatio
|
|
|
50
50
|
messageOf(target: ValidationTarget): string;
|
|
51
51
|
textOf(target: ValidationTarget): string;
|
|
52
52
|
draw(): void;
|
|
53
|
+
addLine(target: ValidationTarget, index: number): Row;
|
|
53
54
|
drawHeader(): void;
|
|
54
55
|
click(e: MouseEvent): void;
|
|
55
56
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** What scrolls: an element, or the page. */
|
|
2
|
+
export type ScrollSource = HTMLElement | Window;
|
|
3
|
+
/** The nearest ancestor of `el` that scrolls, else the page. */
|
|
4
|
+
export declare function scrollParent(el: Element): ScrollSource;
|
|
5
|
+
/** How far `source` is scrolled. */
|
|
6
|
+
export declare function scrollTop(source: ScrollSource): number;
|
|
7
|
+
/**
|
|
8
|
+
* Calls `report` with the position of `source` and how far it moved, now and on each scroll. Returns what stops it.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* const stop = watchScroll(scrollParent(this.element), (top, moved) => this.place(top, moved));
|
|
12
|
+
*/
|
|
13
|
+
export declare function watchScroll(source: ScrollSource, report: (top: number, moved: number) => void): () => void;
|
|
@@ -434,6 +434,44 @@ export interface UiStrings {
|
|
|
434
434
|
tabDocsHidden: string;
|
|
435
435
|
tabDocsShown: string;
|
|
436
436
|
back: string;
|
|
437
|
+
navigationMenu: string;
|
|
438
|
+
navigation: string;
|
|
439
|
+
appBarActions: string;
|
|
440
|
+
otpIncomplete: string;
|
|
441
|
+
signatureHere: string;
|
|
442
|
+
signatureUndo: string;
|
|
443
|
+
signatureName: string;
|
|
444
|
+
signatureEmpty: string;
|
|
445
|
+
signatureSigned: string;
|
|
446
|
+
qrCodeLabel: string;
|
|
447
|
+
barcodeLabel: string;
|
|
448
|
+
/** Chart: its name, what a screen reader hears, its empty and failed states, and the table view. */
|
|
449
|
+
chartName: string;
|
|
450
|
+
chartRole: string;
|
|
451
|
+
chartPlot: string;
|
|
452
|
+
chartHelp: string;
|
|
453
|
+
chartValue: string;
|
|
454
|
+
chartEmpty: string;
|
|
455
|
+
chartFailed: string;
|
|
456
|
+
chartLegend: string;
|
|
457
|
+
chartPosition: string;
|
|
458
|
+
chartShowTable: string;
|
|
459
|
+
chartShowChart: string;
|
|
460
|
+
chartResetZoom: string;
|
|
461
|
+
chartTime: string;
|
|
462
|
+
/** Sparkline and Gauge: their names and what a screen reader hears. */
|
|
463
|
+
sparklineName: string;
|
|
464
|
+
sparklineSummary: string;
|
|
465
|
+
gaugeName: string;
|
|
466
|
+
gaugeValueIn: string;
|
|
467
|
+
gaugeMark: string;
|
|
468
|
+
gaugeMarkAt: string;
|
|
469
|
+
barGaugeName: string;
|
|
470
|
+
barGaugeBar: string;
|
|
471
|
+
barGaugeSummary: string;
|
|
472
|
+
chartShare: string;
|
|
473
|
+
chartRange: string;
|
|
474
|
+
chartPrices: string;
|
|
437
475
|
/** BottomSheet, ActionSheet and Drawer: their names when they have no title, the sheet's handle and its heights. `{height}` is filled in. */
|
|
438
476
|
sheetLabel: string;
|
|
439
477
|
sheetHandle: string;
|