@motifx-community/ui 0.1.0-beta.2 → 0.1.0-beta.3
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 -12
- package/README.md +6 -6
- package/dist/components/accordion/Accordion.d.ts +3 -3
- package/dist/components/accordion/AccordionItem.d.ts +1 -1
- package/dist/components/card/Card.d.ts +1 -1
- package/dist/components/contextmenu/ContextMenu.d.ts +1 -1
- package/dist/components/datagrid/DataGrid.d.ts +5 -5
- package/dist/components/datagrid/data-grid-props.d.ts +2 -2
- package/dist/components/datagrid/grid-adaptive-row-expanded-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-adaptive-row-expanding-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-grouping-changed-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-grouping-changing-event-args.d.ts +2 -2
- package/dist/components/datagrid/grid-master-detail.d.ts +1 -1
- package/dist/components/datagrid/grid-row-expanded-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-row-expanding-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-search-text-changed-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-search-text-changing-event-args.d.ts +1 -1
- package/dist/components/datagrid/grid-sort-changing-event-args.d.ts +1 -1
- package/dist/components/datagrid/model/GridSearch.d.ts +1 -1
- package/dist/components/draggable/Draggable.d.ts +99 -0
- package/dist/components/draggable/DropTarget.d.ts +38 -0
- package/dist/components/draggable/draggable-event-args.d.ts +17 -0
- package/dist/components/draggable/draggable-props.d.ts +37 -0
- package/dist/components/draggable/drop-event-args.d.ts +11 -0
- package/dist/components/draggable/drop-target-props.d.ts +13 -0
- package/dist/components/draggable/index.d.ts +6 -0
- package/dist/components/fileuploader/FileUploader.d.ts +1 -1
- package/dist/components/fileuploader/file-uploader-props.d.ts +1 -1
- package/dist/components/fileuploader/upload-mode.d.ts +1 -1
- package/dist/components/filterbuilder/FilterBuilder.d.ts +1 -1
- package/dist/components/gallery/Gallery.d.ts +132 -0
- package/dist/components/gallery/gallery-item-click-event-args.d.ts +9 -0
- package/dist/components/gallery/gallery-item.d.ts +18 -0
- package/dist/components/gallery/gallery-props.d.ts +38 -0
- package/dist/components/gallery/index.d.ts +6 -0
- package/dist/components/gallery/slide-changed-event-args.d.ts +11 -0
- package/dist/components/gallery/slide-changing-event-args.d.ts +14 -0
- package/dist/components/layout/ChildSettings.d.ts +1 -1
- package/dist/components/layout/DockPanel.d.ts +2 -2
- package/dist/components/layout/Grid.d.ts +1 -1
- package/dist/components/layout/SplitContainer.d.ts +1 -1
- package/dist/components/layout/Stack.d.ts +1 -1
- package/dist/components/multiview/MultiView.d.ts +87 -0
- package/dist/components/multiview/View.d.ts +41 -0
- package/dist/components/multiview/index.d.ts +6 -0
- package/dist/components/multiview/multi-view-props.d.ts +24 -0
- package/dist/components/multiview/view-props.d.ts +15 -0
- package/dist/components/multiview/view-selecting-event-args.d.ts +15 -0
- package/dist/components/multiview/view-selection-changed-event-args.d.ts +12 -0
- package/dist/components/numberbox/number-box-props.d.ts +1 -1
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/popover-props.d.ts +1 -1
- package/dist/components/resizable/Resizable.d.ts +84 -0
- package/dist/components/resizable/index.d.ts +3 -0
- package/dist/components/resizable/resizable-props.d.ts +41 -0
- package/dist/components/resizable/resize-event-args.d.ts +13 -0
- package/dist/components/scheduler/AppointmentEditor.d.ts +1 -1
- package/dist/components/scheduler/scheduler-props.d.ts +1 -1
- package/dist/components/scrollview/ScrollView.d.ts +1 -1
- package/dist/components/skeleton/Skeleton.d.ts +1 -1
- package/dist/components/speeddial/SpeedDial.d.ts +129 -0
- package/dist/components/speeddial/index.d.ts +6 -0
- package/dist/components/speeddial/speed-dial-action-click-event-args.d.ts +9 -0
- package/dist/components/speeddial/speed-dial-action.d.ts +25 -0
- package/dist/components/speeddial/speed-dial-event-args.d.ts +8 -0
- package/dist/components/speeddial/speed-dial-props.d.ts +49 -0
- package/dist/components/speeddial/speed-dial-tooltip.d.ts +3 -0
- package/dist/components/splitter/SplitPane.d.ts +45 -0
- package/dist/components/splitter/Splitter.d.ts +116 -0
- package/dist/components/splitter/index.d.ts +6 -0
- package/dist/components/splitter/split-pane-props.d.ts +21 -0
- package/dist/components/splitter/splitter-collapse-event-args.d.ts +13 -0
- package/dist/components/splitter/splitter-props.d.ts +25 -0
- package/dist/components/splitter/splitter-resize-event-args.d.ts +10 -0
- package/dist/components/stepper/Stepper.d.ts +1 -1
- package/dist/components/stepper/WizardStep.d.ts +1 -1
- package/dist/components/stepper/step-changed-event-args.d.ts +1 -1
- package/dist/components/stepper/step-changing-event-args.d.ts +1 -1
- package/dist/components/stepper/wizard-props.d.ts +1 -1
- package/dist/components/tabdocs/TabDocumentManager.d.ts +1 -1
- package/dist/components/tabs/Tabs.d.ts +2 -2
- package/dist/components/tileview/TileView.d.ts +128 -0
- package/dist/components/tileview/index.d.ts +6 -0
- package/dist/components/tileview/tile-click-event-args.d.ts +9 -0
- package/dist/components/tileview/tile-reorder-event-args.d.ts +11 -0
- package/dist/components/tileview/tile-selection-changed-event-args.d.ts +11 -0
- package/dist/components/tileview/tile-view-item.d.ts +18 -0
- package/dist/components/tileview/tile-view-props.d.ts +38 -0
- package/dist/components/timeline/Timeline.d.ts +113 -0
- package/dist/components/timeline/index.d.ts +5 -0
- package/dist/components/timeline/timeline-item-click-event-args.d.ts +9 -0
- package/dist/components/timeline/timeline-item.d.ts +24 -0
- package/dist/components/timeline/timeline-props.d.ts +30 -0
- package/dist/components/timeline/timeline-selection-changed-event-args.d.ts +11 -0
- package/dist/components/tooltip/Tooltip.d.ts +1 -1
- package/dist/components/treeview/TreeView.d.ts +1 -1
- package/dist/components/validationsummary/ValidationSummary.d.ts +56 -0
- package/dist/components/validationsummary/index.d.ts +3 -0
- package/dist/components/validationsummary/summary-item-click-event-args.d.ts +11 -0
- package/dist/components/validationsummary/validation-summary-props.d.ts +17 -0
- package/dist/core/control.d.ts +4 -4
- package/dist/core/flow-home.d.ts +1 -1
- package/dist/core/ui-strings.d.ts +26 -0
- package/dist/generated/tokens.d.ts +6390 -4745
- package/dist/index.d.ts +9 -0
- package/dist/index.js +5119 -759
- package/dist/index.js.map +1 -1
- package/dist/locales/en.json +22 -1
- package/dist/locales/tr.json +22 -1
- package/dist/parts/slide/slide-track-host.d.ts +19 -0
- package/dist/parts/slide/slide-track.d.ts +45 -0
- package/dist/styles.css +3072 -182
- package/dist/tokens/index.d.ts +6390 -4745
- package/dist/tokens/index.js +6390 -4745
- package/dist/tokens/index.js.map +1 -1
- package/dist/{tr-B218zMtu.js → tr-C5IXRzAH.js} +45 -3
- package/dist/{tr-B218zMtu.js.map → tr-C5IXRzAH.js.map} +1 -1
- package/docs/accordion.md +9 -9
- package/docs/actionsheet.md +2 -2
- package/docs/avatar.md +5 -5
- package/docs/badge.md +6 -6
- package/docs/bottomsheet.md +4 -4
- package/docs/breadcrumb.md +3 -3
- package/docs/button.md +8 -8
- package/docs/buttongroup.md +5 -5
- package/docs/calendar.md +6 -6
- package/docs/card.md +6 -6
- package/docs/checkbox.md +7 -7
- package/docs/chip.md +5 -5
- package/docs/colorbox.md +3 -3
- package/docs/combobox.md +7 -7
- package/docs/control.md +12 -12
- package/docs/datagrid-api.md +5 -5
- package/docs/datagrid-bands.md +1 -1
- package/docs/datagrid-drag-select.md +2 -2
- package/docs/datagrid-drag.md +1 -1
- package/docs/datagrid-editing.md +2 -2
- package/docs/datagrid-filtering.md +3 -3
- package/docs/datagrid-forms.md +1 -1
- package/docs/datagrid-grouping.md +1 -1
- package/docs/datagrid-layout.md +4 -4
- package/docs/datagrid-lookups.md +1 -1
- package/docs/datagrid-master-detail.md +3 -3
- package/docs/datagrid-scrolling.md +1 -1
- package/docs/datagrid-selection.md +3 -3
- package/docs/datagrid.md +8 -8
- package/docs/datebox.md +6 -6
- package/docs/daterangebox.md +4 -4
- package/docs/draggable.md +194 -0
- package/docs/drawer.md +1 -1
- package/docs/dropdown.md +8 -8
- package/docs/fileuploader.md +4 -4
- package/docs/filterbuilder.md +7 -7
- package/docs/formlayout.md +1 -1
- package/docs/gallery.md +244 -0
- package/docs/home.md +11 -7
- package/docs/keyboard.md +1 -1
- package/docs/language.md +1 -1
- package/docs/layout.md +13 -13
- package/docs/listbox.md +8 -8
- package/docs/loadpanel.md +4 -4
- package/docs/lookup.md +1 -1
- package/docs/menus.md +2 -2
- package/docs/multiview.md +202 -0
- package/docs/numberbox.md +7 -7
- package/docs/pagination.md +4 -4
- package/docs/popover.md +11 -11
- package/docs/progress.md +7 -7
- package/docs/radiogroup.md +7 -7
- package/docs/rating.md +4 -4
- package/docs/resizable.md +139 -0
- package/docs/scheduler-agenda.md +1 -1
- package/docs/scheduler-big-data.md +1 -1
- package/docs/scheduler-editing.md +5 -5
- 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 +2 -2
- package/docs/scheduler-resources.md +1 -1
- package/docs/scheduler-timeline.md +1 -1
- package/docs/scheduler.md +4 -4
- package/docs/scrollview.md +5 -5
- package/docs/showcase.md +1 -1
- package/docs/skeleton.md +2 -2
- package/docs/slider.md +7 -7
- package/docs/sortable.md +2 -2
- package/docs/speeddial.md +290 -0
- package/docs/splitter.md +204 -0
- package/docs/stepper.md +5 -5
- package/docs/switch.md +7 -7
- package/docs/tabdocs-dock.md +3 -3
- 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 +5 -5
- package/docs/tabs.md +9 -9
- package/docs/tagbox.md +8 -8
- package/docs/textarea.md +7 -7
- package/docs/textbox.md +8 -8
- package/docs/tileview.md +206 -0
- package/docs/timeline.md +174 -0
- package/docs/toast.md +5 -5
- package/docs/tokens.md +333 -4
- package/docs/toolbar.md +6 -6
- package/docs/tooltip.md +12 -12
- package/docs/treeview.md +9 -9
- package/docs/validationsummary.md +115 -0
- package/docs/window.md +5 -5
- package/docs/wizard.md +9 -9
- package/llms-full.txt +2525 -379
- package/llms.txt +13 -4
- package/package.json +1 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Bind } from '@motifx/core';
|
|
2
|
+
import type { ControlProps } from '../../core/control';
|
|
3
|
+
import type { DraggableEventArgs } from './draggable-event-args';
|
|
4
|
+
/** The way a draggable may move. */
|
|
5
|
+
export type DragAxis = 'both' | 'x' | 'y';
|
|
6
|
+
/** Where a draggable stands, in pixels from where it was laid out. */
|
|
7
|
+
export interface DragPosition {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
}
|
|
11
|
+
/** Props of `Draggable`. Each one is also a settable property; a function is followed. */
|
|
12
|
+
export interface DraggableProps extends ControlProps {
|
|
13
|
+
/** Default `'both'`. */
|
|
14
|
+
axis?: Bind<DragAxis>;
|
|
15
|
+
/** The draggable stays inside this: its parent, or an element it lies in. Default `null`, no limit. */
|
|
16
|
+
boundary?: Bind<'parent' | HTMLElement | null>;
|
|
17
|
+
/** A selector inside the draggable: only a press there drags it, and it takes the keys. Default `null`, the whole draggable. */
|
|
18
|
+
handle?: Bind<string | null>;
|
|
19
|
+
/** A copy follows the pointer and the draggable stays where it is; for a drop target to take. Default `false`. */
|
|
20
|
+
clone?: Bind<boolean>;
|
|
21
|
+
/** Drop targets of the same group take it. Default `null`. */
|
|
22
|
+
group?: Bind<string | null>;
|
|
23
|
+
/** Anything of your own, given to the drop target. */
|
|
24
|
+
data?: unknown;
|
|
25
|
+
/** Pixels an arrow key moves it by. Default `10`. */
|
|
26
|
+
step?: Bind<number>;
|
|
27
|
+
/** Where it stands: given, it is applied; after every drag or key the new place is written to `x-model`. */
|
|
28
|
+
position?: Bind<DragPosition | null>;
|
|
29
|
+
/** A drag is about to begin; cancelable. */
|
|
30
|
+
onDragStarting?: (e: DraggableEventArgs) => void;
|
|
31
|
+
/** It is being dragged (`x`, `y`, the `target` under the pointer). */
|
|
32
|
+
onDragging?: (e: DraggableEventArgs) => void;
|
|
33
|
+
/** The pointer let go; `cancel = true` brings it back where it started. */
|
|
34
|
+
onDragEnding?: (e: DraggableEventArgs) => void;
|
|
35
|
+
/** The drag ended: where it stands, and whether a target took it (`dropped`). */
|
|
36
|
+
onDragEnded?: (e: DraggableEventArgs) => void;
|
|
37
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { EventArgs } from '@motifx/core';
|
|
2
|
+
import type { Draggable } from './Draggable';
|
|
3
|
+
import type { DropTarget } from './DropTarget';
|
|
4
|
+
/** A draggable came over a target (`cancel = true` refuses it), left it, or was dropped on it. */
|
|
5
|
+
export interface DropEventArgs extends EventArgs {
|
|
6
|
+
draggable: Draggable;
|
|
7
|
+
/** The draggable's `data`, as given. */
|
|
8
|
+
data: unknown;
|
|
9
|
+
source: DropTarget;
|
|
10
|
+
event?: Event;
|
|
11
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Bind } from '@motifx/core';
|
|
2
|
+
import type { ControlProps } from '../../core/control';
|
|
3
|
+
import type { DropEventArgs } from './drop-event-args';
|
|
4
|
+
/** Props of `DropTarget`. Each one is also a settable property; a function is followed. */
|
|
5
|
+
export interface DropTargetProps extends ControlProps {
|
|
6
|
+
/** Takes the draggables of this group; `null` takes those without one. Default `null`. */
|
|
7
|
+
group?: Bind<string | null>;
|
|
8
|
+
/** A draggable came over it; `cancel = true` refuses it. */
|
|
9
|
+
onDragEntering?: (e: DropEventArgs) => void;
|
|
10
|
+
onDragLeaving?: (e: DropEventArgs) => void;
|
|
11
|
+
/** A draggable was dropped on it: your data is yours to move. */
|
|
12
|
+
onDropped?: (e: DropEventArgs) => void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Draggable } from './Draggable';
|
|
2
|
+
export { DropTarget } from './DropTarget';
|
|
3
|
+
export type { DraggableProps, DragAxis, DragPosition } from './draggable-props';
|
|
4
|
+
export type { DropTargetProps } from './drop-target-props';
|
|
5
|
+
export type { DraggableEventArgs } from './draggable-event-args';
|
|
6
|
+
export type { DropEventArgs } from './drop-event-args';
|
|
@@ -33,7 +33,7 @@ interface Row {
|
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
35
|
* Files chosen with a button or dropped on the box, listed with their size and what happens to them: uploaded as
|
|
36
|
-
* they come (`uploadUrl`, in one piece or in chunks, or your own `upload`), on an Upload button, or
|
|
36
|
+
* they come (`uploadUrl`, in one piece or in chunks, or your own `upload`), on an Upload button, or programmatically;
|
|
37
37
|
* progress, cancel, retry and remove on each. `accept`, `maxFileSize`, `minFileSize` and `maxFiles` turn files
|
|
38
38
|
* away, each listed with the reason. The value is the files taken; `x-model` binds it.
|
|
39
39
|
*
|
|
@@ -16,7 +16,7 @@ export interface FileUploaderProps extends FieldProps<readonly File[]> {
|
|
|
16
16
|
maxFiles?: Bind<number | null>;
|
|
17
17
|
/** Files may be dropped on the box. Default `true`. */
|
|
18
18
|
allowDrop?: Bind<boolean>;
|
|
19
|
-
/** When files are uploaded: `instant` (as chosen), `button` (an Upload button), `manual` (`upload()`
|
|
19
|
+
/** When files are uploaded: `instant` (as chosen), `button` (an Upload button), `manual` (`upload()` programmatically). Default `instant` with `uploadUrl` or `upload`, else `manual`. */
|
|
20
20
|
uploadMode?: Bind<UploadMode>;
|
|
21
21
|
/** Where files are sent, by the uploader itself (XMLHttpRequest, with progress). */
|
|
22
22
|
uploadUrl?: Bind<string | null>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
/** When files are uploaded: as soon as they are chosen, when the Upload button is pressed, or never by the uploader (`upload()`
|
|
1
|
+
/** When files are uploaded: as soon as they are chosen, when the Upload button is pressed, or never by the uploader (`upload()` programmatically). */
|
|
2
2
|
export type UploadMode = 'instant' | 'button' | 'manual';
|
|
@@ -124,7 +124,7 @@ export declare class FilterBuilder extends Control<HTMLDivElement, FilterBuilder
|
|
|
124
124
|
private fitToField;
|
|
125
125
|
/** The tree changed: the value follows (when it is another filter) and the rows are drawn again. */
|
|
126
126
|
private changed;
|
|
127
|
-
/** A value from the prop or
|
|
127
|
+
/** A value from the prop or programmatically: the tree is built again, unless it is the value the tree stands for already. */
|
|
128
128
|
private takeValue;
|
|
129
129
|
private inTree;
|
|
130
130
|
/** Reads what the rows show, so the drawing effect follows it. */
|
|
@@ -0,0 +1,132 @@
|
|
|
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 { SlideTrack } from "../../parts/slide/slide-track";
|
|
4
|
+
import type { GalleryItem } from "./gallery-item";
|
|
5
|
+
import type { GalleryItemClickEventArgs } from "./gallery-item-click-event-args";
|
|
6
|
+
import type { GalleryProps } from "./gallery-props";
|
|
7
|
+
import type { SlideChangedEventArgs } from "./slide-changed-event-args";
|
|
8
|
+
import type { SlideChangingEventArgs } from "./slide-changing-event-args";
|
|
9
|
+
interface Look {
|
|
10
|
+
item: unknown;
|
|
11
|
+
key: string | null;
|
|
12
|
+
image: string;
|
|
13
|
+
alt: string;
|
|
14
|
+
text: string;
|
|
15
|
+
description: string;
|
|
16
|
+
content: (() => ComponentBase) | null;
|
|
17
|
+
}
|
|
18
|
+
interface Pane {
|
|
19
|
+
item: unknown;
|
|
20
|
+
pane: Component<HTMLDivElement>;
|
|
21
|
+
figure: Component<HTMLDivElement>;
|
|
22
|
+
image: HTMLImageElement | null;
|
|
23
|
+
content: ComponentBase | null;
|
|
24
|
+
caption: Component<HTMLDivElement>;
|
|
25
|
+
title: Component<HTMLSpanElement>;
|
|
26
|
+
description: Component<HTMLSpanElement>;
|
|
27
|
+
}
|
|
28
|
+
type Hold = 'hover' | 'focus' | 'drag';
|
|
29
|
+
/**
|
|
30
|
+
* Panes side by side, one in view (or several), moved by the buttons at the sides, the dots under them, a swipe
|
|
31
|
+
* or the arrow keys; a slideshow when `slideInterval` says so, which pauses under the pointer and while focus is
|
|
32
|
+
* inside. A pane is an image with a caption, or any content. The pane in view is `value`: a pane's `key`, else its
|
|
33
|
+
* index; `x-model` binds it two-way.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* <Gallery items={['/photos/1.jpg', '/photos/2.jpg']} loop slideInterval={4000} height={320} />
|
|
37
|
+
* <Gallery items={[{ image: '/a.jpg', text: 'Harbour', description: 'Early morning' }]} x-model={() => this.shown} />
|
|
38
|
+
*/
|
|
39
|
+
export declare class Gallery extends Control<HTMLElement, GalleryProps> {
|
|
40
|
+
changing: Emitter<SlideChangingEventArgs>;
|
|
41
|
+
changed: Emitter<SlideChangedEventArgs>;
|
|
42
|
+
itemClick: Emitter<GalleryItemClickEventArgs>;
|
|
43
|
+
bar: Component<HTMLDivElement>;
|
|
44
|
+
indicator: Component<HTMLDivElement>;
|
|
45
|
+
playButton: Component<HTMLButtonElement>;
|
|
46
|
+
previousButton: Component<HTMLButtonElement>;
|
|
47
|
+
nextButton: Component<HTMLButtonElement>;
|
|
48
|
+
viewport: Component<HTMLDivElement>;
|
|
49
|
+
list: Component<HTMLDivElement>;
|
|
50
|
+
slide: SlideTrack;
|
|
51
|
+
panes: Pane[];
|
|
52
|
+
dots: HTMLButtonElement[];
|
|
53
|
+
looks: Look[];
|
|
54
|
+
stopItems: (() => void) | null;
|
|
55
|
+
previousIndex: number;
|
|
56
|
+
byUser: boolean;
|
|
57
|
+
ready: boolean;
|
|
58
|
+
playing: boolean;
|
|
59
|
+
holds: Set<Hold>;
|
|
60
|
+
timer: number;
|
|
61
|
+
reduced: MediaQueryList | null;
|
|
62
|
+
constructor(props?: IBaseProp<GalleryProps>);
|
|
63
|
+
get items(): readonly (GalleryItem | string)[];
|
|
64
|
+
set items(value: Bind<readonly (GalleryItem | string)[]>);
|
|
65
|
+
get value(): string | number | null;
|
|
66
|
+
set value(value: Bind<string | number | null>);
|
|
67
|
+
get loop(): boolean;
|
|
68
|
+
set loop(value: Bind<boolean>);
|
|
69
|
+
get showNavButtons(): boolean;
|
|
70
|
+
set showNavButtons(value: Bind<boolean>);
|
|
71
|
+
get showIndicator(): boolean;
|
|
72
|
+
set showIndicator(value: Bind<boolean>);
|
|
73
|
+
get slideInterval(): number;
|
|
74
|
+
set slideInterval(value: Bind<number>);
|
|
75
|
+
get pauseOnHover(): boolean;
|
|
76
|
+
set pauseOnHover(value: Bind<boolean>);
|
|
77
|
+
get swipeEnabled(): boolean;
|
|
78
|
+
set swipeEnabled(value: Bind<boolean>);
|
|
79
|
+
get itemsPerPage(): number;
|
|
80
|
+
set itemsPerPage(value: Bind<number>);
|
|
81
|
+
get stretchImages(): boolean;
|
|
82
|
+
set stretchImages(value: Bind<boolean>);
|
|
83
|
+
get height(): string | number | null;
|
|
84
|
+
set height(value: Bind<string | number | null>);
|
|
85
|
+
get label(): string;
|
|
86
|
+
set label(value: Bind<string>);
|
|
87
|
+
/** The pane in view is about to change (`from`, `to`, `byUser`); `cancel` keeps the one there. */
|
|
88
|
+
get onSlideChanging(): MotifEvent<SlideChangingEventArgs>;
|
|
89
|
+
/** The pane in view changed, by the user, programmatically or by the slideshow (`byUser`). */
|
|
90
|
+
get onSlideChanged(): MotifEvent<SlideChangedEventArgs>;
|
|
91
|
+
/** A press on a pane that was not a drag. */
|
|
92
|
+
get onItemClick(): MotifEvent<GalleryItemClickEventArgs>;
|
|
93
|
+
/** The index of the pane in view; -1 when there is none. */
|
|
94
|
+
get selectedIndex(): number;
|
|
95
|
+
/** How many panes there are. */
|
|
96
|
+
get count(): number;
|
|
97
|
+
/** The slideshow runs: it was not paused, and nothing holds it (the pointer, focus, a drag, reduced motion). */
|
|
98
|
+
get isPlaying(): boolean;
|
|
99
|
+
/** Panes side by side, at least one. */
|
|
100
|
+
get perView(): number;
|
|
101
|
+
/** Goes to the pane after the one in view; `false` at the end without `loop`, or when the change was refused. */
|
|
102
|
+
next(): Promise<boolean>;
|
|
103
|
+
/** Goes to the pane before the one in view. */
|
|
104
|
+
previous(): Promise<boolean>;
|
|
105
|
+
/** Goes to a pane by index or key; `onSlideChanging` is asked first. */
|
|
106
|
+
goTo(pane: number | string): Promise<boolean>;
|
|
107
|
+
/** Starts the slideshow (`slideInterval` says how fast) after `pause()`. */
|
|
108
|
+
play(): void;
|
|
109
|
+
/** Stops the slideshow until `play()`. */
|
|
110
|
+
pause(): void;
|
|
111
|
+
/** Reads the items again after they were changed in place. */
|
|
112
|
+
refresh(): void;
|
|
113
|
+
/** The index a value names: a key, else an index in range; -1 for none. */
|
|
114
|
+
indexOf(value: string | number | null | undefined): number;
|
|
115
|
+
/** The value that names the pane at `index`: its key when it has one, else the index. */
|
|
116
|
+
valueAt(index: number): string | number;
|
|
117
|
+
renderName(): void;
|
|
118
|
+
renderItems(): void;
|
|
119
|
+
lookOf(item: unknown): Look;
|
|
120
|
+
drawPanes(): void;
|
|
121
|
+
makePane(look: Look): Pane;
|
|
122
|
+
writePane(pane: Pane, look: Look): void;
|
|
123
|
+
drawDots(): void;
|
|
124
|
+
drawStates(): void;
|
|
125
|
+
schedule: () => void;
|
|
126
|
+
hold(reason: Hold, on: boolean): void;
|
|
127
|
+
go(to: number, byUser: boolean, event?: Event): Promise<boolean>;
|
|
128
|
+
makeNav(direction: 'previous' | 'next'): Component<HTMLButtonElement>;
|
|
129
|
+
listen(): void;
|
|
130
|
+
keyDown(e: KeyboardEvent, onDots: boolean): void;
|
|
131
|
+
}
|
|
132
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Bind, ComponentBase } from '@motifx/core';
|
|
2
|
+
/** A pane of the gallery: an image, or any content, with a caption. Each field may be a function of your state. */
|
|
3
|
+
export interface GalleryItem {
|
|
4
|
+
/** Names the pane in `value`; without one its index does. */
|
|
5
|
+
key?: string;
|
|
6
|
+
/** The address of the image. */
|
|
7
|
+
image?: Bind<string>;
|
|
8
|
+
/** What the image shows, for screen readers; empty for a decorative one. */
|
|
9
|
+
alt?: Bind<string>;
|
|
10
|
+
/** The caption's first line. */
|
|
11
|
+
text?: Bind<string>;
|
|
12
|
+
/** The caption's second line. */
|
|
13
|
+
description?: Bind<string>;
|
|
14
|
+
/** Any content in place of an image, made when the pane is. */
|
|
15
|
+
content?: () => ComponentBase;
|
|
16
|
+
/** Anything of your own; the item comes back as given in the events. */
|
|
17
|
+
data?: unknown;
|
|
18
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Bind } from '@motifx/core';
|
|
2
|
+
import type { ControlProps } from '../../core/control';
|
|
3
|
+
import type { GalleryItem } from './gallery-item';
|
|
4
|
+
import type { GalleryItemClickEventArgs } from './gallery-item-click-event-args';
|
|
5
|
+
import type { SlideChangedEventArgs } from './slide-changed-event-args';
|
|
6
|
+
import type { SlideChangingEventArgs } from './slide-changing-event-args';
|
|
7
|
+
/** Props of `Gallery`. Each one is also a settable property; a function is followed. */
|
|
8
|
+
export interface GalleryProps extends ControlProps {
|
|
9
|
+
/** The panes in order: `GalleryItem`s or image addresses. */
|
|
10
|
+
items?: Bind<readonly (GalleryItem | string)[]>;
|
|
11
|
+
/** The pane in view: its `key`, else its index. `x-model` binds it two-way. Default `0`. */
|
|
12
|
+
value?: Bind<string | number | null>;
|
|
13
|
+
/** After the last pane comes the first. Default `false`. */
|
|
14
|
+
loop?: Bind<boolean>;
|
|
15
|
+
/** The previous and next buttons at the sides. Default `true`. */
|
|
16
|
+
showNavButtons?: Bind<boolean>;
|
|
17
|
+
/** The dots under the panes, one per pane. Default `true`. */
|
|
18
|
+
showIndicator?: Bind<boolean>;
|
|
19
|
+
/** Milliseconds a pane stays in a slideshow; `0` for none. It pauses under the pointer, while focus is inside, out of sight and under reduced motion. Default `0`. */
|
|
20
|
+
slideInterval?: Bind<number>;
|
|
21
|
+
/** The slideshow pauses while the pointer rests on the gallery. Default `true`. */
|
|
22
|
+
pauseOnHover?: Bind<boolean>;
|
|
23
|
+
/** A finger or a pointer drags the panes. Default `true`. */
|
|
24
|
+
swipeEnabled?: Bind<boolean>;
|
|
25
|
+
/** Panes side by side in the width. Default `1`. */
|
|
26
|
+
itemsPerPage?: Bind<number>;
|
|
27
|
+
/** An image fills its pane, cut at the edges, instead of fitting inside it whole. Default `false`. */
|
|
28
|
+
stretchImages?: Bind<boolean>;
|
|
29
|
+
/** The gallery's height, a CSS length or pixels. Without one it is as tall as its tallest pane. */
|
|
30
|
+
height?: Bind<string | number | null>;
|
|
31
|
+
/** What screen readers call it. Default: the kit's "Gallery". */
|
|
32
|
+
label?: Bind<string>;
|
|
33
|
+
/** The pane in view is about to change; cancelable. */
|
|
34
|
+
onSlideChanging?: (e: SlideChangingEventArgs) => void;
|
|
35
|
+
onSlideChanged?: (e: SlideChangedEventArgs) => void;
|
|
36
|
+
/** A press on a pane that was not a drag. */
|
|
37
|
+
onItemClick?: (e: GalleryItemClickEventArgs) => void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Gallery } from './Gallery';
|
|
2
|
+
export type { GalleryItem } from './gallery-item';
|
|
3
|
+
export type { GalleryProps } from './gallery-props';
|
|
4
|
+
export type { GalleryItemClickEventArgs } from './gallery-item-click-event-args';
|
|
5
|
+
export type { SlideChangingEventArgs } from './slide-changing-event-args';
|
|
6
|
+
export type { SlideChangedEventArgs } from './slide-changed-event-args';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Gallery } from './Gallery';
|
|
2
|
+
/** The pane in view changed. */
|
|
3
|
+
export interface SlideChangedEventArgs {
|
|
4
|
+
index: number;
|
|
5
|
+
/** The item as given; `null` when there is none. */
|
|
6
|
+
item: unknown;
|
|
7
|
+
previous: number;
|
|
8
|
+
/** By a press, a swipe or a key, else programmatically or the slideshow. */
|
|
9
|
+
byUser: boolean;
|
|
10
|
+
source: Gallery;
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { EventArgs } from '@motifx/core';
|
|
2
|
+
import type { Gallery } from './Gallery';
|
|
3
|
+
/** The pane in view is about to change. `cancel = true` keeps the one there. */
|
|
4
|
+
export interface SlideChangingEventArgs extends EventArgs {
|
|
5
|
+
from: number;
|
|
6
|
+
to: number;
|
|
7
|
+
/** The items as given; `null` when there is none. */
|
|
8
|
+
fromItem: unknown;
|
|
9
|
+
toItem: unknown;
|
|
10
|
+
/** By a press, a swipe or a key, else programmatically or the slideshow. */
|
|
11
|
+
byUser: boolean;
|
|
12
|
+
source: Gallery;
|
|
13
|
+
event?: Event;
|
|
14
|
+
}
|
|
@@ -31,7 +31,7 @@ export declare class ChildSettings {
|
|
|
31
31
|
/** The children that take part, in order. */
|
|
32
32
|
get children(): ComponentBase[];
|
|
33
33
|
get(child: ComponentBase, name: string): unknown;
|
|
34
|
-
/** Sets a child's setting
|
|
34
|
+
/** Sets a child's setting programmatically: a value, or a function that is followed. */
|
|
35
35
|
set(child: ComponentBase, name: string, value: Bind<unknown>): void;
|
|
36
36
|
private add;
|
|
37
37
|
private leave;
|
|
@@ -30,9 +30,9 @@ export declare class DockPanel extends Control<HTMLDivElement, DockPanelProps> {
|
|
|
30
30
|
set padding(value: Bind<LayoutSpace | undefined>);
|
|
31
31
|
/** Where a child is docked, as its props say or as set with {@link setDock}. */
|
|
32
32
|
dockOf(child: ComponentBase): Dock;
|
|
33
|
-
/** Docks a child
|
|
33
|
+
/** Docks a child programmatically: a value, or a function that is followed. */
|
|
34
34
|
setDock(child: ComponentBase, dock: Bind<Dock>): void;
|
|
35
|
-
/** Sets the anchors of a `float` child
|
|
35
|
+
/** Sets the anchors of a `float` child programmatically; each is a value or a function. Fields left out stay. */
|
|
36
36
|
setAnchors(child: ComponentBase, anchors: Omit<DockChildProps, 'dock'>): void;
|
|
37
37
|
private get settings();
|
|
38
38
|
/** Gives every child its grid area: each docked one takes an edge of what the ones before it left. */
|
|
@@ -49,7 +49,7 @@ export declare class Grid extends Control<HTMLDivElement, GridProps> {
|
|
|
49
49
|
set inline(value: Bind<boolean>);
|
|
50
50
|
/** A child's cell, as its props say or as set with {@link setCell}. */
|
|
51
51
|
cellOf(child: ComponentBase): GridCell;
|
|
52
|
-
/** Places a child
|
|
52
|
+
/** Places a child programmatically; each field is a value or a function that is followed. Fields left out stay. */
|
|
53
53
|
setCell(child: ComponentBase, cell: GridCell): void;
|
|
54
54
|
private get settings();
|
|
55
55
|
private place;
|
|
@@ -10,7 +10,7 @@ import type { SplitterMovedEventArgs } from './splitter-moved-event-args';
|
|
|
10
10
|
* Two panes, `first` and `second`, side by side or one over the other, with a splitter between
|
|
11
11
|
* them that the pointer drags and the keys move (the ARIA window splitter pattern). The pane
|
|
12
12
|
* named by `fixedPanel` keeps its size when the container is resized; `collapsed` hides one.
|
|
13
|
-
* The first JSX child goes into the first pane, the second into the second one;
|
|
13
|
+
* The first JSX child goes into the first pane, the second into the second one; programmatically, add
|
|
14
14
|
* to `split.first.controls` / `split.second.controls`.
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
@@ -38,7 +38,7 @@ export declare class Stack extends Control<HTMLDivElement, StackProps> {
|
|
|
38
38
|
set inline(value: Bind<boolean>);
|
|
39
39
|
/** A child's `grow`, as its props say or as set with {@link setGrow}. */
|
|
40
40
|
growOf(child: ComponentBase): boolean | number;
|
|
41
|
-
/** Sets a child's `grow`
|
|
41
|
+
/** Sets a child's `grow` programmatically: a value, or a function that is followed. */
|
|
42
42
|
setGrow(child: ComponentBase, grow: Bind<boolean | number>): void;
|
|
43
43
|
private get settings();
|
|
44
44
|
private renderLook;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Emitter, type Bind, type Component, type Event as MotifEvent, type IBaseProp } from "@motifx/core";
|
|
2
|
+
import { Control } from "../../core/control";
|
|
3
|
+
import { SlideTrack } from "../../parts/slide/slide-track";
|
|
4
|
+
import type { MultiViewProps } from "./multi-view-props";
|
|
5
|
+
import { View } from "./View";
|
|
6
|
+
import type { ViewSelectingEventArgs } from "./view-selecting-event-args";
|
|
7
|
+
import type { ViewSelectionChangedEventArgs } from "./view-selection-changed-event-args";
|
|
8
|
+
/**
|
|
9
|
+
* Pages side by side, one in sight: the JSX `View` children, or views added programmatically. A swipe brings the next or
|
|
10
|
+
* the previous one; programmatically `next()`, `previous()` and `goTo()` do, and a `Tabs`, a `Stepper` or buttons bound
|
|
11
|
+
* to `value` drive it. A view is built when first shown (`lazy`) and kept (`keepAlive`), as the panels of `Tabs`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* <MultiView x-model={() => this.page} loop>
|
|
15
|
+
* <View title="Details">…</View>
|
|
16
|
+
* <View title="Review">…</View>
|
|
17
|
+
* </MultiView>
|
|
18
|
+
*/
|
|
19
|
+
export declare class MultiView extends Control<HTMLDivElement, MultiViewProps> {
|
|
20
|
+
selecting: Emitter<ViewSelectingEventArgs>;
|
|
21
|
+
selectionChanged: Emitter<ViewSelectionChangedEventArgs>;
|
|
22
|
+
viewport: Component<HTMLDivElement>;
|
|
23
|
+
track: Component<HTMLDivElement>;
|
|
24
|
+
slide: SlideTrack;
|
|
25
|
+
views: View[];
|
|
26
|
+
previousIndex: number;
|
|
27
|
+
byUser: boolean;
|
|
28
|
+
ready: boolean;
|
|
29
|
+
constructor(props?: IBaseProp<MultiViewProps>);
|
|
30
|
+
get value(): string | number | null;
|
|
31
|
+
set value(value: Bind<string | number | null>);
|
|
32
|
+
get loop(): boolean;
|
|
33
|
+
set loop(value: Bind<boolean>);
|
|
34
|
+
get swipeEnabled(): boolean;
|
|
35
|
+
set swipeEnabled(value: Bind<boolean>);
|
|
36
|
+
get animated(): boolean;
|
|
37
|
+
set animated(value: Bind<boolean>);
|
|
38
|
+
get lazy(): boolean;
|
|
39
|
+
set lazy(value: Bind<boolean>);
|
|
40
|
+
get keepAlive(): boolean;
|
|
41
|
+
set keepAlive(value: Bind<boolean>);
|
|
42
|
+
get label(): string;
|
|
43
|
+
set label(value: Bind<string>);
|
|
44
|
+
/** The view in sight is about to change (`from`, `to`, `byUser`); `cancel` keeps the one there. */
|
|
45
|
+
get onSelecting(): MotifEvent<ViewSelectingEventArgs>;
|
|
46
|
+
/** The view in sight changed, by a swipe or programmatically (`byUser`). */
|
|
47
|
+
get onSelectionChanged(): MotifEvent<ViewSelectionChangedEventArgs>;
|
|
48
|
+
/** The index of the view in sight; -1 when there is none. */
|
|
49
|
+
get selectedIndex(): number;
|
|
50
|
+
/** The view in sight, `null` when there is none. */
|
|
51
|
+
get selectedView(): View | null;
|
|
52
|
+
/** How many views there are, hidden ones too. */
|
|
53
|
+
get count(): number;
|
|
54
|
+
/** Adds a view at the end. */
|
|
55
|
+
add(view: View): View;
|
|
56
|
+
/** Adds a view at `index`. */
|
|
57
|
+
insert(index: number, view: View): View;
|
|
58
|
+
/** Removes a view and disposes it; the sight moves to a neighbour. */
|
|
59
|
+
remove(view: View): boolean;
|
|
60
|
+
/** Goes to the next view that is shown and enabled; `false` at the end without `loop`, or when refused. */
|
|
61
|
+
next(): Promise<boolean>;
|
|
62
|
+
/** Goes to the previous view that is shown and enabled. */
|
|
63
|
+
previous(): Promise<boolean>;
|
|
64
|
+
/** Goes to a view, by index or key; `onSelecting` is asked first. */
|
|
65
|
+
goTo(view: number | string | View): Promise<boolean>;
|
|
66
|
+
/** Brings a view into sight, as `goTo` does. */
|
|
67
|
+
select(view: View): Promise<boolean>;
|
|
68
|
+
/** The index a value names: a key, else an index in range; -1 for none. */
|
|
69
|
+
indexOf(value: string | number | null | undefined): number;
|
|
70
|
+
/** The value that names the view at `index`: its key when it has one, else the index. */
|
|
71
|
+
valueAt(index: number): string | number;
|
|
72
|
+
onDisposing(): void;
|
|
73
|
+
/** @internal A view's title, key, visibility or enabled changed. */
|
|
74
|
+
viewChanged(): void;
|
|
75
|
+
/** @internal A view was disposed on its own. */
|
|
76
|
+
viewGone(view: View): void;
|
|
77
|
+
lane(): View[];
|
|
78
|
+
laneIndex(index: number): number;
|
|
79
|
+
place(view: View, index: number): void;
|
|
80
|
+
forget(view: View): void;
|
|
81
|
+
renderName(): void;
|
|
82
|
+
drawStates(): void;
|
|
83
|
+
lazyOf(view: View): boolean;
|
|
84
|
+
keepAliveOf(view: View): boolean;
|
|
85
|
+
usable(from: number, direction: 1 | -1): number;
|
|
86
|
+
go(to: number, byUser: boolean, event?: Event): Promise<boolean>;
|
|
87
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type Bind, type IBaseProp } from "@motifx/core";
|
|
2
|
+
import { Control } from "../../core/control";
|
|
3
|
+
import { PanelContent } from "../tabs/PanelContent";
|
|
4
|
+
import type { MultiView } from "./MultiView";
|
|
5
|
+
import type { ViewProps } from "./view-props";
|
|
6
|
+
/**
|
|
7
|
+
* One page of a `MultiView`: the JSX children are its content, built when it is first in sight (see `lazy`), and
|
|
8
|
+
* what `content` makes besides them.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* <MultiView x-model={() => this.page}>
|
|
12
|
+
* <View title="Details"><TextBox label="Name" /></View>
|
|
13
|
+
* <View title="Review" content={() => new ReviewView()} />
|
|
14
|
+
* </MultiView>
|
|
15
|
+
*/
|
|
16
|
+
export declare class View extends Control<HTMLDivElement, ViewProps> {
|
|
17
|
+
content: PanelContent;
|
|
18
|
+
owner: MultiView | null;
|
|
19
|
+
constructor(props?: IBaseProp<ViewProps>);
|
|
20
|
+
/** The `key` prop (also when written as the JSX `key`), `''` without one. */
|
|
21
|
+
get key(): string;
|
|
22
|
+
set key(value: Bind<string>);
|
|
23
|
+
get title(): string;
|
|
24
|
+
set title(value: Bind<string>);
|
|
25
|
+
/** This view's own setting; `undefined` follows the multi-view. */
|
|
26
|
+
get lazy(): boolean | undefined;
|
|
27
|
+
set lazy(value: Bind<boolean | undefined>);
|
|
28
|
+
get keepAlive(): boolean | undefined;
|
|
29
|
+
set keepAlive(value: Bind<boolean | undefined>);
|
|
30
|
+
/** Whether it is the view in sight. */
|
|
31
|
+
get isSelected(): boolean;
|
|
32
|
+
/** Whether its content has been built (see `lazy`). */
|
|
33
|
+
get contentBuilt(): boolean;
|
|
34
|
+
/** Brings the view into sight; `false` when it is hidden, disabled or not in a `MultiView`. */
|
|
35
|
+
select(): Promise<boolean>;
|
|
36
|
+
/** @internal In sight or not; the multi-view decides. */
|
|
37
|
+
reveal(on: boolean, keepAlive: boolean): void;
|
|
38
|
+
/** @internal Builds the content now. */
|
|
39
|
+
buildContent(): void;
|
|
40
|
+
protected applyProperty(name: string, value: unknown): void;
|
|
41
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { MultiView } from './MultiView';
|
|
2
|
+
export { View } from './View';
|
|
3
|
+
export type { MultiViewProps } from './multi-view-props';
|
|
4
|
+
export type { ViewProps } from './view-props';
|
|
5
|
+
export type { ViewSelectingEventArgs } from './view-selecting-event-args';
|
|
6
|
+
export type { ViewSelectionChangedEventArgs } from './view-selection-changed-event-args';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Bind } from '@motifx/core';
|
|
2
|
+
import type { ControlProps } from '../../core/control';
|
|
3
|
+
import type { ViewSelectingEventArgs } from './view-selecting-event-args';
|
|
4
|
+
import type { ViewSelectionChangedEventArgs } from './view-selection-changed-event-args';
|
|
5
|
+
/** Props of `MultiView`. Each one is also a settable property; a function is followed. */
|
|
6
|
+
export interface MultiViewProps extends ControlProps {
|
|
7
|
+
/** The view in sight: its `key`, else its index. `x-model` binds it two-way. Default `0`. */
|
|
8
|
+
value?: Bind<string | number | null>;
|
|
9
|
+
/** After the last view comes the first. Default `false`. */
|
|
10
|
+
loop?: Bind<boolean>;
|
|
11
|
+
/** A finger or a pointer drags the views. Default `true`. */
|
|
12
|
+
swipeEnabled?: Bind<boolean>;
|
|
13
|
+
/** The views slide into sight. `false` shows the next one at once. Default `true`. */
|
|
14
|
+
animated?: Bind<boolean>;
|
|
15
|
+
/** A view is built when first shown, then kept (a view's own `lazy` wins). Default `true`. */
|
|
16
|
+
lazy?: Bind<boolean>;
|
|
17
|
+
/** `false`: content made by a view's `content` is disposed while out of sight (a view's own `keepAlive` wins). Default `true`. */
|
|
18
|
+
keepAlive?: Bind<boolean>;
|
|
19
|
+
/** What screen readers call it. Default: the kit's "Pages". */
|
|
20
|
+
label?: Bind<string>;
|
|
21
|
+
/** The view in sight is about to change; cancelable. */
|
|
22
|
+
onSelecting?: (e: ViewSelectingEventArgs) => void;
|
|
23
|
+
onSelectionChanged?: (e: ViewSelectionChangedEventArgs) => void;
|
|
24
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Bind, ComponentBase } from '@motifx/core';
|
|
2
|
+
import type { ControlProps } from '../../core/control';
|
|
3
|
+
/** Props of `View`, one page of a `MultiView`. Each one is also a settable property; a function is followed. */
|
|
4
|
+
export interface ViewProps extends ControlProps {
|
|
5
|
+
/** Names the view in the multi-view's `value`; without one its index does. The JSX `key` is read too. */
|
|
6
|
+
key?: Bind<string>;
|
|
7
|
+
/** What screen readers call the page. Default: "Page 2 of 3" in the kit language. */
|
|
8
|
+
title?: Bind<string>;
|
|
9
|
+
/** Content made when the view is first shown, instead of (or besides) the JSX children. */
|
|
10
|
+
content?: () => ComponentBase | readonly ComponentBase[];
|
|
11
|
+
/** This view's own setting; `undefined` follows the multi-view. */
|
|
12
|
+
lazy?: Bind<boolean | undefined>;
|
|
13
|
+
/** This view's own setting; `undefined` follows the multi-view. */
|
|
14
|
+
keepAlive?: Bind<boolean | undefined>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { EventArgs } from '@motifx/core';
|
|
2
|
+
import type { MultiView } from './MultiView';
|
|
3
|
+
import type { View } from './View';
|
|
4
|
+
/** The view in sight is about to change. `cancel = true` keeps the one there. */
|
|
5
|
+
export interface ViewSelectingEventArgs extends EventArgs {
|
|
6
|
+
from: number;
|
|
7
|
+
to: number;
|
|
8
|
+
/** `null` when there was none. */
|
|
9
|
+
fromView: View | null;
|
|
10
|
+
toView: View;
|
|
11
|
+
/** By a swipe, else programmatically. */
|
|
12
|
+
byUser: boolean;
|
|
13
|
+
source: MultiView;
|
|
14
|
+
event?: Event;
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { MultiView } from './MultiView';
|
|
2
|
+
import type { View } from './View';
|
|
3
|
+
/** The view in sight changed. */
|
|
4
|
+
export interface ViewSelectionChangedEventArgs {
|
|
5
|
+
index: number;
|
|
6
|
+
/** `null` when there is none. */
|
|
7
|
+
view: View | null;
|
|
8
|
+
previous: number;
|
|
9
|
+
/** By a swipe, else programmatically. */
|
|
10
|
+
byUser: boolean;
|
|
11
|
+
source: MultiView;
|
|
12
|
+
}
|
|
@@ -21,7 +21,7 @@ export interface NumberBoxProps extends FieldProps<number | null> {
|
|
|
21
21
|
/** The locale of the format and of what is typed. Default the page's `lang`. */
|
|
22
22
|
locale?: Bind<string>;
|
|
23
23
|
/**
|
|
24
|
-
* Digits after the decimal point: every value is rounded to them (entered, given or set
|
|
24
|
+
* Digits after the decimal point: every value is rounded to them (entered, given or set programmatically, written back
|
|
25
25
|
* to `x-model`), and shown with exactly that many while the field is not edited. Default: as given.
|
|
26
26
|
*/
|
|
27
27
|
decimals?: Bind<number | null>;
|
|
@@ -9,7 +9,7 @@ import type { PopoverProps } from "./popover-props";
|
|
|
9
9
|
import type { PopoverShowOn } from "./popover-show-on";
|
|
10
10
|
/**
|
|
11
11
|
* Content next to the element it belongs to: a title, a close button, anything in it. It opens on a press on its
|
|
12
|
-
* target (`showOn: 'click'`), when the pointer rests on the target (`'hover'`) or
|
|
12
|
+
* target (`showOn: 'click'`), when the pointer rests on the target (`'hover'`) or programmatically; it follows the target
|
|
13
13
|
* while the page scrolls, opens on the other side when there is no room, and points at the target with an arrow
|
|
14
14
|
* where the design language draws one. Focus goes in when it opens by a press and back to the target when it
|
|
15
15
|
* closes; Escape, a press outside, focus leaving and the close button close it.
|