@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,25 @@
|
|
|
1
|
+
import type { Bind } from '@motifx/core';
|
|
2
|
+
import type { ControlProps } from '../../core/control';
|
|
3
|
+
import type { LayoutOrientation } from '../layout/layout-orientation';
|
|
4
|
+
import type { SplitterCollapseEventArgs } from './splitter-collapse-event-args';
|
|
5
|
+
import type { SplitterResizeEventArgs } from './splitter-resize-event-args';
|
|
6
|
+
/** Props of `Splitter`. Each one is also a settable property; a function is followed. */
|
|
7
|
+
export interface SplitterProps extends ControlProps {
|
|
8
|
+
/** `horizontal`: the panes side by side; `vertical`: one under the other. Default `'horizontal'`. */
|
|
9
|
+
orientation?: Bind<LayoutOrientation>;
|
|
10
|
+
/** The handles can be dragged and moved with the keys (a pane's own `resizable` wins). Default `true`. */
|
|
11
|
+
resizable?: Bind<boolean>;
|
|
12
|
+
/** Every pane can be hidden from the handle next to it (a pane's own `collapsible` wins). Default `false`. */
|
|
13
|
+
collapsible?: Bind<boolean>;
|
|
14
|
+
/** Pixels an arrow key moves a handle. Default `10`. */
|
|
15
|
+
step?: Bind<number>;
|
|
16
|
+
/** The panes' sizes in pane order (pixels, a share or `null`): given, they take the place of the panes' own `size`. After a drag or a key the pixels are written to `x-model`. */
|
|
17
|
+
sizes?: Bind<readonly (number | string | null)[] | null>;
|
|
18
|
+
/** A handle is being dragged; `sizes` are the pixels now. */
|
|
19
|
+
onResizing?: (e: SplitterResizeEventArgs) => void;
|
|
20
|
+
/** A drag ended or a key moved a handle. */
|
|
21
|
+
onResized?: (e: SplitterResizeEventArgs) => void;
|
|
22
|
+
/** A pane is about to be hidden or shown again; cancelable. */
|
|
23
|
+
onCollapsing?: (e: SplitterCollapseEventArgs) => void;
|
|
24
|
+
onCollapsed?: (e: SplitterCollapseEventArgs) => void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Splitter } from './Splitter';
|
|
2
|
+
/** A handle moved: `handle` is its index (between the panes `handle` and `handle + 1`), `sizes` the panes' pixels now. */
|
|
3
|
+
export interface SplitterResizeEventArgs {
|
|
4
|
+
handle: number;
|
|
5
|
+
sizes: number[];
|
|
6
|
+
/** By a drag or a key, else programmatically. */
|
|
7
|
+
byUser: boolean;
|
|
8
|
+
source: Splitter;
|
|
9
|
+
event?: Event;
|
|
10
|
+
}
|
|
@@ -81,7 +81,7 @@ export declare class Stepper extends Control<HTMLElement, StepperProps> {
|
|
|
81
81
|
set label(value: Bind<string>);
|
|
82
82
|
/** The current step is about to change (`from`, `to`, `byUser`); `cancel` keeps it, `promise` waits. */
|
|
83
83
|
get onStepChanging(): MotifEvent<StepChangingEventArgs>;
|
|
84
|
-
/** The current step changed, by the user or
|
|
84
|
+
/** The current step changed, by the user or programmatically (`byUser`). */
|
|
85
85
|
get onStepChanged(): MotifEvent<StepChangedEventArgs>;
|
|
86
86
|
/** The index of the current step; -1 when there is none. */
|
|
87
87
|
get selectedIndex(): number;
|
|
@@ -6,7 +6,7 @@ import type { Wizard } from "./Wizard";
|
|
|
6
6
|
import type { WizardStepProps } from "./wizard-step-props";
|
|
7
7
|
/**
|
|
8
8
|
* One step of a {@link Wizard}: its entry in the stepper and its page. The JSX children are the page, built when
|
|
9
|
-
* the step is first shown (see `lazy`); `content` makes it
|
|
9
|
+
* the step is first shown (see `lazy`); `content` makes it programmatically.
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* <Wizard>
|
|
@@ -5,7 +5,7 @@ export interface StepChangedEventArgs {
|
|
|
5
5
|
/** The item as given; `null` when there is no current step. */
|
|
6
6
|
item: unknown;
|
|
7
7
|
previous: number;
|
|
8
|
-
/** By a press on a step, else
|
|
8
|
+
/** By a press on a step, else programmatically. */
|
|
9
9
|
byUser: boolean;
|
|
10
10
|
source: Stepper;
|
|
11
11
|
}
|
|
@@ -10,7 +10,7 @@ export interface StepChangingEventArgs extends EventArgs {
|
|
|
10
10
|
/** The items as given; `null` when there is none (no current step). */
|
|
11
11
|
fromItem: unknown;
|
|
12
12
|
toItem: unknown;
|
|
13
|
-
/** By a press on a step, else
|
|
13
|
+
/** By a press on a step, else programmatically. */
|
|
14
14
|
byUser: boolean;
|
|
15
15
|
promise?: Promise<boolean>;
|
|
16
16
|
source: Stepper;
|
|
@@ -9,7 +9,7 @@ import type { WizardFinishingEventArgs } from './wizard-finishing-event-args';
|
|
|
9
9
|
import type { WizardStepProps } from './wizard-step-props';
|
|
10
10
|
/** Props of `Wizard`. Each one is also a settable property; a function is followed. */
|
|
11
11
|
export interface WizardProps extends ControlProps {
|
|
12
|
-
/** Steps made
|
|
12
|
+
/** Steps made programmatically, each as the props of a `WizardStep` (`title`, `content`, …); the JSX `WizardStep` children come first. */
|
|
13
13
|
steps?: readonly WizardStepProps[];
|
|
14
14
|
/** The current step: its `key`, else its index. `x-model` binds it two-way. Default `0`. */
|
|
15
15
|
value?: Bind<string | number | null>;
|
|
@@ -937,7 +937,7 @@ export declare class TabDocumentManager extends FocusContainer<HTMLDivElement, T
|
|
|
937
937
|
* active one staying active. A window left empty closes.
|
|
938
938
|
*/
|
|
939
939
|
private mainWindowBy;
|
|
940
|
-
/** Closes a new window
|
|
940
|
+
/** Closes a new window programmatically or a menu: its documents go back, or close (those that stay keep it open). */
|
|
941
941
|
private closeBrowserBy;
|
|
942
942
|
/** The floating windows a layout saved as new windows: each one opens as a new window again, if the browser lets it. */
|
|
943
943
|
private reopenWindowsBy;
|
|
@@ -11,7 +11,7 @@ import type { TabsProps } from './tabs-props';
|
|
|
11
11
|
import type { TabsVariant } from './tabs-variant';
|
|
12
12
|
/**
|
|
13
13
|
* Tabs: a strip of tabs and the panel of the selected one, following the ARIA tabs pattern.
|
|
14
|
-
* Tabs come as `<Tab>` children or
|
|
14
|
+
* Tabs come as `<Tab>` children or programmatically (`add`, `insert`, `remove`); `value` (two-way with
|
|
15
15
|
* `x-model`) is the selected tab's `key`, else its index. Arrow keys move along the strip (and
|
|
16
16
|
* select, with `activation="auto"`), Home and End go to the ends, Delete closes a closable tab,
|
|
17
17
|
* a tab's `&` key selects it. Panels are built when first shown (`lazy`).
|
|
@@ -68,7 +68,7 @@ export declare class Tabs extends Control<HTMLDivElement, TabsProps> {
|
|
|
68
68
|
insert(index: number, tab: Tab): Tab;
|
|
69
69
|
/** Removes a tab and disposes it; the selection moves to a neighbour. No `onClose`. */
|
|
70
70
|
remove(tab: Tab): boolean;
|
|
71
|
-
/** Selects a tab (or the tab at an index)
|
|
71
|
+
/** Selects a tab (or the tab at an index) programmatically; `false` when it is hidden or not here. */
|
|
72
72
|
select(tab: Tab | number): boolean;
|
|
73
73
|
/** Closes a tab as the user would: `onClose` can cancel it. */
|
|
74
74
|
close(tab: Tab, byUser?: boolean, event?: Event): boolean;
|
|
@@ -0,0 +1,128 @@
|
|
|
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 { DragGhost } from "../../parts/drag/DragGhost";
|
|
4
|
+
import type { TileClickEventArgs } from "./tile-click-event-args";
|
|
5
|
+
import type { TileReorderEventArgs } from "./tile-reorder-event-args";
|
|
6
|
+
import type { TileSelectionChangedEventArgs } from "./tile-selection-changed-event-args";
|
|
7
|
+
import type { TileViewItem } from "./tile-view-item";
|
|
8
|
+
import type { TileViewDirection, TileViewProps, TileViewSelectionMode } from "./tile-view-props";
|
|
9
|
+
interface Look {
|
|
10
|
+
item: unknown;
|
|
11
|
+
key: string | null;
|
|
12
|
+
text: string;
|
|
13
|
+
widthRatio: number;
|
|
14
|
+
heightRatio: number;
|
|
15
|
+
content: (() => ComponentBase) | null;
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface Tile {
|
|
19
|
+
item: unknown;
|
|
20
|
+
el: Component<HTMLDivElement>;
|
|
21
|
+
text: Component<HTMLSpanElement>;
|
|
22
|
+
content: ComponentBase | null;
|
|
23
|
+
}
|
|
24
|
+
interface Session {
|
|
25
|
+
pointerId: number;
|
|
26
|
+
touch: boolean;
|
|
27
|
+
startX: number;
|
|
28
|
+
startY: number;
|
|
29
|
+
x: number;
|
|
30
|
+
y: number;
|
|
31
|
+
fromIndex: number;
|
|
32
|
+
element: HTMLElement;
|
|
33
|
+
started: boolean;
|
|
34
|
+
toIndex: number;
|
|
35
|
+
timer: ReturnType<typeof setTimeout> | null;
|
|
36
|
+
frame: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Tiles of different sizes packed on a grid of base cells: a tile is `widthRatio` × `heightRatio` cells. They
|
|
40
|
+
* fill the height in columns and the view scrolls sideways (`horizontal`), or fill the width in rows
|
|
41
|
+
* (`vertical`). Tiles can be chosen (`selectionMode`) and put in another order by dragging or with Ctrl and an
|
|
42
|
+
* arrow key (`allowReorder`); a drop tells `onReordered` with the indexes, your data is yours to reorder.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* <TileView height={320} items={[{ text: 'Sales', widthRatio: 2 }, { text: 'Stock' }, { text: 'Staff', heightRatio: 2 }]} />
|
|
46
|
+
* <TileView direction="vertical" selectionMode="multiple" x-model={() => this.chosen} items={() => this.tiles} />
|
|
47
|
+
*/
|
|
48
|
+
export declare class TileView extends Control<HTMLDivElement, TileViewProps> {
|
|
49
|
+
itemClick: Emitter<TileClickEventArgs>;
|
|
50
|
+
selectionChanged: Emitter<TileSelectionChangedEventArgs>;
|
|
51
|
+
reordering: Emitter<TileReorderEventArgs>;
|
|
52
|
+
reordered: Emitter<TileReorderEventArgs>;
|
|
53
|
+
grid: Component<HTMLDivElement>;
|
|
54
|
+
live: Component<HTMLSpanElement>;
|
|
55
|
+
ghost: DragGhost;
|
|
56
|
+
tiles: Map<unknown, Tile>;
|
|
57
|
+
looks: Look[];
|
|
58
|
+
stopItems: (() => void) | null;
|
|
59
|
+
stops: (() => void)[];
|
|
60
|
+
session: Session | null;
|
|
61
|
+
focusedAt: number;
|
|
62
|
+
byUser: boolean;
|
|
63
|
+
ready: boolean;
|
|
64
|
+
lastSelection: string;
|
|
65
|
+
constructor(props?: IBaseProp<TileViewProps>);
|
|
66
|
+
get items(): readonly (TileViewItem | string)[];
|
|
67
|
+
set items(value: Bind<readonly (TileViewItem | string)[]>);
|
|
68
|
+
get baseItemWidth(): number;
|
|
69
|
+
set baseItemWidth(value: Bind<number>);
|
|
70
|
+
get baseItemHeight(): number;
|
|
71
|
+
set baseItemHeight(value: Bind<number>);
|
|
72
|
+
get direction(): TileViewDirection;
|
|
73
|
+
set direction(value: Bind<TileViewDirection>);
|
|
74
|
+
get selectionMode(): TileViewSelectionMode;
|
|
75
|
+
set selectionMode(value: Bind<TileViewSelectionMode>);
|
|
76
|
+
get value(): string | number | null | readonly (string | number)[];
|
|
77
|
+
set value(value: Bind<string | number | null | readonly (string | number)[]>);
|
|
78
|
+
get allowReorder(): boolean;
|
|
79
|
+
set allowReorder(value: Bind<boolean>);
|
|
80
|
+
get height(): string | number | null;
|
|
81
|
+
set height(value: Bind<string | number | null>);
|
|
82
|
+
get label(): string;
|
|
83
|
+
set label(value: Bind<string>);
|
|
84
|
+
/** A press on a tile that was not a drag. */
|
|
85
|
+
get onItemClick(): MotifEvent<TileClickEventArgs>;
|
|
86
|
+
/** The chosen tiles changed (`indexes`, `items`, `byUser`). */
|
|
87
|
+
get onSelectionChanged(): MotifEvent<TileSelectionChangedEventArgs>;
|
|
88
|
+
/** A tile is about to be dragged or moved with the keys; `cancel` keeps it where it is. */
|
|
89
|
+
get onReordering(): MotifEvent<TileReorderEventArgs>;
|
|
90
|
+
/** A tile was moved to another place (`fromIndex`, `toIndex`). */
|
|
91
|
+
get onReordered(): MotifEvent<TileReorderEventArgs>;
|
|
92
|
+
/** The chosen tiles' indexes, in tile order. */
|
|
93
|
+
get selectedIndexes(): number[];
|
|
94
|
+
/** How many tiles there are. */
|
|
95
|
+
get count(): number;
|
|
96
|
+
/** Whether a tile is being dragged. */
|
|
97
|
+
get isDragging(): boolean;
|
|
98
|
+
/** The index a value names: a key, else an index in range; -1 for none. */
|
|
99
|
+
indexOf(value: string | number | null | undefined): number;
|
|
100
|
+
/** The value that names the tile at `index`: its key when it has one, else the index. */
|
|
101
|
+
valueAt(index: number): string | number;
|
|
102
|
+
/** Chooses a tile programmatically: the only one (`single`), or one more (`multiple`). */
|
|
103
|
+
select(index: number): void;
|
|
104
|
+
/** Reads the items again after they were changed in place. */
|
|
105
|
+
refresh(): void;
|
|
106
|
+
renderName(): void;
|
|
107
|
+
renderItems(): void;
|
|
108
|
+
lookOf(item: unknown): Look;
|
|
109
|
+
drawTiles(): void;
|
|
110
|
+
makeTile(look: Look): Tile;
|
|
111
|
+
tileElements(): HTMLElement[];
|
|
112
|
+
drawRole(): void;
|
|
113
|
+
drawStates(): void;
|
|
114
|
+
drawStops(): void;
|
|
115
|
+
choose(index: number, byUser: boolean, how: 'only' | 'add' | 'toggle'): void;
|
|
116
|
+
click(e: MouseEvent): void;
|
|
117
|
+
neighbour(from: number, dx: number, dy: number): number;
|
|
118
|
+
keyDown(e: KeyboardEvent): void;
|
|
119
|
+
move(from: number, to: number, event: Event | undefined, ask: boolean): boolean;
|
|
120
|
+
pointerDown(e: PointerEvent): void;
|
|
121
|
+
pointerMove(e: PointerEvent): void;
|
|
122
|
+
pointerUp(e: PointerEvent): void;
|
|
123
|
+
start(e: PointerEvent): boolean;
|
|
124
|
+
track(): void;
|
|
125
|
+
autoScroll(): void;
|
|
126
|
+
end(e: Event | null, drop: boolean): void;
|
|
127
|
+
}
|
|
128
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { TileView } from './TileView';
|
|
2
|
+
export type { TileViewItem } from './tile-view-item';
|
|
3
|
+
export type { TileViewProps, TileViewDirection, TileViewSelectionMode } from './tile-view-props';
|
|
4
|
+
export type { TileClickEventArgs } from './tile-click-event-args';
|
|
5
|
+
export type { TileSelectionChangedEventArgs } from './tile-selection-changed-event-args';
|
|
6
|
+
export type { TileReorderEventArgs } from './tile-reorder-event-args';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { EventArgs } from '@motifx/core';
|
|
2
|
+
import type { TileView } from './TileView';
|
|
3
|
+
/** A tile is about to be moved (`onReordering`, `cancel = true` keeps it) or was moved (`onReordered`): from one index to another. */
|
|
4
|
+
export interface TileReorderEventArgs extends EventArgs {
|
|
5
|
+
/** The item as given. */
|
|
6
|
+
item: unknown;
|
|
7
|
+
fromIndex: number;
|
|
8
|
+
toIndex: number;
|
|
9
|
+
source: TileView;
|
|
10
|
+
event?: Event;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TileView } from './TileView';
|
|
2
|
+
/** The chosen tiles changed. */
|
|
3
|
+
export interface TileSelectionChangedEventArgs {
|
|
4
|
+
/** The chosen tiles' indexes, in tile order. */
|
|
5
|
+
indexes: number[];
|
|
6
|
+
/** Their items as given. */
|
|
7
|
+
items: unknown[];
|
|
8
|
+
/** By a press or a key, else programmatically. */
|
|
9
|
+
byUser: boolean;
|
|
10
|
+
source: TileView;
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Bind, ComponentBase } from '@motifx/core';
|
|
2
|
+
/** A tile of the `TileView`: a text, or any content, on a tile of so many base cells. Each field may be a function of your state. */
|
|
3
|
+
export interface TileViewItem {
|
|
4
|
+
/** Names the tile in `value`; without one its index does. */
|
|
5
|
+
key?: string;
|
|
6
|
+
/** The tile's text. */
|
|
7
|
+
text?: Bind<string>;
|
|
8
|
+
/** How many base cells wide the tile is. Default `1`. */
|
|
9
|
+
widthRatio?: Bind<number>;
|
|
10
|
+
/** How many base cells tall the tile is. Default `1`. */
|
|
11
|
+
heightRatio?: Bind<number>;
|
|
12
|
+
/** Any content in place of the text, made when the tile is. */
|
|
13
|
+
content?: () => ComponentBase;
|
|
14
|
+
/** A tile that cannot be chosen or moved. Default `true`. */
|
|
15
|
+
enabled?: Bind<boolean>;
|
|
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 { TileClickEventArgs } from './tile-click-event-args';
|
|
4
|
+
import type { TileReorderEventArgs } from './tile-reorder-event-args';
|
|
5
|
+
import type { TileSelectionChangedEventArgs } from './tile-selection-changed-event-args';
|
|
6
|
+
import type { TileViewItem } from './tile-view-item';
|
|
7
|
+
/** Tiles flow down the columns (`horizontal`, the view scrolls sideways) or along the rows (`vertical`). */
|
|
8
|
+
export type TileViewDirection = 'horizontal' | 'vertical';
|
|
9
|
+
/** `none`: nothing is chosen; `single`: one tile; `multiple`: any number. */
|
|
10
|
+
export type TileViewSelectionMode = 'none' | 'single' | 'multiple';
|
|
11
|
+
/** Props of `TileView`. Each one is also a settable property; a function is followed. */
|
|
12
|
+
export interface TileViewProps extends ControlProps {
|
|
13
|
+
/** The tiles in order: `TileViewItem`s or plain texts. */
|
|
14
|
+
items?: Bind<readonly (TileViewItem | string)[]>;
|
|
15
|
+
/** A base cell's width in pixels; a tile is `widthRatio` of them. Default `100`. */
|
|
16
|
+
baseItemWidth?: Bind<number>;
|
|
17
|
+
/** A base cell's height in pixels; a tile is `heightRatio` of them. Default `100`. */
|
|
18
|
+
baseItemHeight?: Bind<number>;
|
|
19
|
+
/** Default `'horizontal'`: the tiles fill the height in columns, the view scrolls sideways; give it a `height`. */
|
|
20
|
+
direction?: Bind<TileViewDirection>;
|
|
21
|
+
/** Default `'none'`. */
|
|
22
|
+
selectionMode?: Bind<TileViewSelectionMode>;
|
|
23
|
+
/** The chosen tile (`single`): its `key`, else its index; the chosen tiles (`multiple`) as a list. `x-model` binds it two-way. */
|
|
24
|
+
value?: Bind<string | number | null | readonly (string | number)[]>;
|
|
25
|
+
/** The tiles can be put in another order by dragging, or with Ctrl and an arrow key. Default `false`. */
|
|
26
|
+
allowReorder?: Bind<boolean>;
|
|
27
|
+
/** The view's height, a CSS length or pixels. */
|
|
28
|
+
height?: Bind<string | number | null>;
|
|
29
|
+
/** What screen readers call it. Default: the kit's "Tiles". */
|
|
30
|
+
label?: Bind<string>;
|
|
31
|
+
/** A press on a tile that was not a drag. */
|
|
32
|
+
onItemClick?: (e: TileClickEventArgs) => void;
|
|
33
|
+
onSelectionChanged?: (e: TileSelectionChangedEventArgs) => void;
|
|
34
|
+
/** A tile is about to be dragged; cancelable. */
|
|
35
|
+
onReordering?: (e: TileReorderEventArgs) => void;
|
|
36
|
+
/** A tile was dropped or moved with the keys to a new place: your data is yours to reorder. */
|
|
37
|
+
onReordered?: (e: TileReorderEventArgs) => void;
|
|
38
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { Component, Emitter, type Bind, type ComponentBase, type Event as MotifEvent, type IBaseProp } from "@motifx/core";
|
|
2
|
+
import { Control } from "../../core/control";
|
|
3
|
+
import type { IconSource } from "../../core/icon-source";
|
|
4
|
+
import type { TimelineItem, TimelineTone } from "./timeline-item";
|
|
5
|
+
import type { TimelineItemClickEventArgs } from "./timeline-item-click-event-args";
|
|
6
|
+
import type { TimelineDateFormat, TimelineOrientation, TimelineProps } from "./timeline-props";
|
|
7
|
+
import type { TimelineSelectionChangedEventArgs } from "./timeline-selection-changed-event-args";
|
|
8
|
+
interface Look {
|
|
9
|
+
item: unknown;
|
|
10
|
+
key: string | null;
|
|
11
|
+
date: Date | null;
|
|
12
|
+
title: string;
|
|
13
|
+
description: string;
|
|
14
|
+
glyph: string;
|
|
15
|
+
icon: IconSource | null;
|
|
16
|
+
tone: TimelineTone;
|
|
17
|
+
content: (() => ComponentBase) | null;
|
|
18
|
+
}
|
|
19
|
+
interface Entry {
|
|
20
|
+
item: unknown;
|
|
21
|
+
li: Component<HTMLLIElement>;
|
|
22
|
+
dot: Component<HTMLSpanElement>;
|
|
23
|
+
dotGlyph: Component<HTMLSpanElement>;
|
|
24
|
+
dotIcon: ComponentBase | null;
|
|
25
|
+
face: Component<HTMLElement>;
|
|
26
|
+
date: Component<HTMLTimeElement>;
|
|
27
|
+
title: Component<HTMLSpanElement>;
|
|
28
|
+
description: Component<HTMLDivElement> | null;
|
|
29
|
+
content: ComponentBase | null;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Events in time order: down the page, each a card beside a line with a dot (the cards taking turns on either side
|
|
33
|
+
* when `alternate`, folded until pressed when `collapsible`); or along a line of dates (`horizontal`), where a
|
|
34
|
+
* press on a date, or the arrow keys, shows that event's card under the line. The dates are written in the kit's
|
|
35
|
+
* language.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* <Timeline items={[{ date: '2026-03-01', title: 'Kick-off', description: 'The plan agreed' }, { date: '2026-05-14', title: 'Beta', tone: 'accent' }]} />
|
|
39
|
+
* <Timeline orientation="horizontal" items={() => this.milestones} x-model={() => this.shown} />
|
|
40
|
+
*/
|
|
41
|
+
export declare class Timeline extends Control<HTMLDivElement, TimelineProps> {
|
|
42
|
+
itemClick: Emitter<TimelineItemClickEventArgs>;
|
|
43
|
+
selectionChanged: Emitter<TimelineSelectionChangedEventArgs>;
|
|
44
|
+
track: Component<HTMLDivElement>;
|
|
45
|
+
list: Component<HTMLOListElement>;
|
|
46
|
+
previousButton: Component<HTMLButtonElement>;
|
|
47
|
+
nextButton: Component<HTMLButtonElement>;
|
|
48
|
+
detail: Component<HTMLDivElement>;
|
|
49
|
+
detailDate: Component<HTMLTimeElement>;
|
|
50
|
+
detailTitle: Component<HTMLSpanElement>;
|
|
51
|
+
detailDescription: Component<HTMLDivElement>;
|
|
52
|
+
detailContent: Component<HTMLDivElement>;
|
|
53
|
+
entries: Entry[];
|
|
54
|
+
looks: Look[];
|
|
55
|
+
expanded: Set<unknown>;
|
|
56
|
+
stopItems: (() => void) | null;
|
|
57
|
+
drawnAs: TimelineOrientation | null;
|
|
58
|
+
previousIndex: number;
|
|
59
|
+
byUser: boolean;
|
|
60
|
+
ready: boolean;
|
|
61
|
+
constructor(props?: IBaseProp<TimelineProps>);
|
|
62
|
+
get items(): readonly TimelineItem[];
|
|
63
|
+
set items(value: Bind<readonly TimelineItem[]>);
|
|
64
|
+
get orientation(): TimelineOrientation;
|
|
65
|
+
set orientation(value: Bind<TimelineOrientation>);
|
|
66
|
+
get alternate(): boolean;
|
|
67
|
+
set alternate(value: Bind<boolean>);
|
|
68
|
+
get collapsible(): boolean;
|
|
69
|
+
set collapsible(value: Bind<boolean>);
|
|
70
|
+
get dateFormat(): TimelineDateFormat;
|
|
71
|
+
set dateFormat(value: Bind<TimelineDateFormat>);
|
|
72
|
+
get value(): string | number | null;
|
|
73
|
+
set value(value: Bind<string | number | null>);
|
|
74
|
+
get label(): string;
|
|
75
|
+
set label(value: Bind<string>);
|
|
76
|
+
/** A press on an event's card or flag (`index`, `item`). */
|
|
77
|
+
get onItemClick(): MotifEvent<TimelineItemClickEventArgs>;
|
|
78
|
+
/** Horizontal: the shown event changed (`index`, `item`, `previous`, `byUser`). */
|
|
79
|
+
get onSelectionChanged(): MotifEvent<TimelineSelectionChangedEventArgs>;
|
|
80
|
+
/** Horizontal: the index of the shown event; -1 when there is none. */
|
|
81
|
+
get selectedIndex(): number;
|
|
82
|
+
/** How many events there are. */
|
|
83
|
+
get count(): number;
|
|
84
|
+
get horizontal(): boolean;
|
|
85
|
+
/** Horizontal: shows an event, by index or key. Vertical: unfolds its card. */
|
|
86
|
+
goTo(event: number | string): boolean;
|
|
87
|
+
/** Vertical, `collapsible`: unfolds or folds an event's card. */
|
|
88
|
+
unfold(event: number | string, on?: boolean): void;
|
|
89
|
+
/** Whether an event's card is unfolded. */
|
|
90
|
+
isUnfolded(event: number | string): boolean;
|
|
91
|
+
/** Reads the items again after they were changed in place. */
|
|
92
|
+
refresh(): void;
|
|
93
|
+
/** The index a value names: a key, else an index in range; -1 for none. */
|
|
94
|
+
indexOf(value: string | number | null | undefined): number;
|
|
95
|
+
valueAt(index: number): string | number;
|
|
96
|
+
/** A date as the kit's language writes it with `dateFormat`. */
|
|
97
|
+
formatDate(date: Date | null): string;
|
|
98
|
+
renderName(): void;
|
|
99
|
+
renderItems(): void;
|
|
100
|
+
lookOf(item: unknown): Look;
|
|
101
|
+
drawEntries(): void;
|
|
102
|
+
pressable(): boolean;
|
|
103
|
+
makeEntry(look: Look, as: TimelineOrientation): Entry;
|
|
104
|
+
drawTexts(): void;
|
|
105
|
+
drawStates(): void;
|
|
106
|
+
drawDetail(index: number): void;
|
|
107
|
+
drawNav(): void;
|
|
108
|
+
makeNav(direction: 'previous' | 'next'): Component<HTMLButtonElement>;
|
|
109
|
+
select(index: number, byUser: boolean, event?: Event): boolean;
|
|
110
|
+
click(e: MouseEvent): void;
|
|
111
|
+
keyDown(e: KeyboardEvent): void;
|
|
112
|
+
}
|
|
113
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Timeline } from './Timeline';
|
|
2
|
+
export type { TimelineItem, TimelineTone } from './timeline-item';
|
|
3
|
+
export type { TimelineProps, TimelineOrientation, TimelineDateFormat } from './timeline-props';
|
|
4
|
+
export type { TimelineItemClickEventArgs } from './timeline-item-click-event-args';
|
|
5
|
+
export type { TimelineSelectionChangedEventArgs } from './timeline-selection-changed-event-args';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Bind, ComponentBase } from '@motifx/core';
|
|
2
|
+
import type { IconSource } from '../../core/icon-source';
|
|
3
|
+
/** The colour of an event's dot and flag. */
|
|
4
|
+
export type TimelineTone = 'default' | 'accent' | 'success' | 'caution' | 'danger' | 'info';
|
|
5
|
+
/** One event on the `Timeline`. Each field may be a function of your state. */
|
|
6
|
+
export interface TimelineItem {
|
|
7
|
+
/** Names the event in `value` and the events; without one its index does. */
|
|
8
|
+
key?: string;
|
|
9
|
+
/** When: a `Date`, an ISO text, or milliseconds. */
|
|
10
|
+
date: Bind<Date | string | number>;
|
|
11
|
+
title: Bind<string>;
|
|
12
|
+
/** The text under the title; folded until the card is pressed when the timeline is `collapsible`. */
|
|
13
|
+
description?: Bind<string>;
|
|
14
|
+
/** A glyph of the kit's set in the dot. */
|
|
15
|
+
glyph?: Bind<string>;
|
|
16
|
+
/** An icon of your own in the dot, in place of the glyph. */
|
|
17
|
+
icon?: IconSource;
|
|
18
|
+
/** Default `'default'`. */
|
|
19
|
+
tone?: Bind<TimelineTone>;
|
|
20
|
+
/** Any content in the card, made when the card is. */
|
|
21
|
+
content?: () => ComponentBase;
|
|
22
|
+
/** Anything of your own; the item comes back as given in the events. */
|
|
23
|
+
data?: unknown;
|
|
24
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { Bind } from '@motifx/core';
|
|
2
|
+
import type { ControlProps } from '../../core/control';
|
|
3
|
+
import type { TimelineItem } from './timeline-item';
|
|
4
|
+
import type { TimelineItemClickEventArgs } from './timeline-item-click-event-args';
|
|
5
|
+
import type { TimelineSelectionChangedEventArgs } from './timeline-selection-changed-event-args';
|
|
6
|
+
/** Down the page with a card per event, or along a line of dates with the chosen event's card under it. */
|
|
7
|
+
export type TimelineOrientation = 'vertical' | 'horizontal';
|
|
8
|
+
/** How a date is written: a preset, or the options of `Intl.DateTimeFormat`. */
|
|
9
|
+
export type TimelineDateFormat = 'short' | 'medium' | 'long' | Intl.DateTimeFormatOptions;
|
|
10
|
+
/** Props of `Timeline`. Each one is also a settable property; a function is followed. */
|
|
11
|
+
export interface TimelineProps extends ControlProps {
|
|
12
|
+
/** The events, in order. */
|
|
13
|
+
items?: Bind<readonly TimelineItem[]>;
|
|
14
|
+
/** Default `'vertical'`. */
|
|
15
|
+
orientation?: Bind<TimelineOrientation>;
|
|
16
|
+
/** Vertical: the cards take turns on either side of the line. Default `false`. */
|
|
17
|
+
alternate?: Bind<boolean>;
|
|
18
|
+
/** Vertical: a card shows its description only when pressed. Default `false`. */
|
|
19
|
+
collapsible?: Bind<boolean>;
|
|
20
|
+
/** How the dates are written, in the kit's language. Default `'medium'`. */
|
|
21
|
+
dateFormat?: Bind<TimelineDateFormat>;
|
|
22
|
+
/** Horizontal: the event whose card is shown, its `key` else its index. `x-model` binds it two-way. Default `0`. */
|
|
23
|
+
value?: Bind<string | number | null>;
|
|
24
|
+
/** What screen readers call it. Default: the kit's "Timeline". */
|
|
25
|
+
label?: Bind<string>;
|
|
26
|
+
/** A press on an event's card or flag. */
|
|
27
|
+
onItemClick?: (e: TimelineItemClickEventArgs) => void;
|
|
28
|
+
/** Horizontal: the shown event changed. */
|
|
29
|
+
onSelectionChanged?: (e: TimelineSelectionChangedEventArgs) => void;
|
|
30
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Timeline } from './Timeline';
|
|
2
|
+
/** Horizontal: the event whose card is shown changed. */
|
|
3
|
+
export interface TimelineSelectionChangedEventArgs {
|
|
4
|
+
index: number;
|
|
5
|
+
/** The item as given; `null` when there is none. */
|
|
6
|
+
item: unknown;
|
|
7
|
+
previous: number;
|
|
8
|
+
/** By a press or a key, else from code. */
|
|
9
|
+
byUser: boolean;
|
|
10
|
+
source: Timeline;
|
|
11
|
+
}
|
|
@@ -6,7 +6,7 @@ import type { TooltipShowOn } from './tooltip-show-on';
|
|
|
6
6
|
import type { TooltipTarget } from './tooltip-target';
|
|
7
7
|
/**
|
|
8
8
|
* A short description shown next to an element: after the pointer rests on it, when it gets
|
|
9
|
-
* keyboard focus, or
|
|
9
|
+
* keyboard focus, or programmatically. The pointer can move onto the tooltip without closing it; Escape,
|
|
10
10
|
* a press, leaving focus and scrolling close it. One tooltip is open at a time on the page, and
|
|
11
11
|
* all of them share one set of document listeners. It never takes focus and holds nothing
|
|
12
12
|
* interactive; the target is described by it (`aria-describedby`) while it is shown.
|
|
@@ -103,7 +103,7 @@ export declare class TreeView<T = unknown> extends Control<HTMLDivElement, TreeV
|
|
|
103
103
|
/** Opens every row whose children are known (children not loaded yet are not loaded). */
|
|
104
104
|
expandAll(): void;
|
|
105
105
|
collapseAll(): void;
|
|
106
|
-
/** Selects a row
|
|
106
|
+
/** Selects a row programmatically (`multiple`: adds it to the selection). */
|
|
107
107
|
select(key: unknown): void;
|
|
108
108
|
unselect(key: unknown): void;
|
|
109
109
|
/** With `multiple`: every known row that can be selected. */
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Component, Emitter, type Bind, type Event as MotifEvent, type IBaseProp } from "@motifx/core";
|
|
2
|
+
import { Control } from "../../core/control";
|
|
3
|
+
import type { ValidationGroup } from "../../parts/validation/ValidationGroup";
|
|
4
|
+
import type { ValidationTarget } from "../../parts/validation/validation-target";
|
|
5
|
+
import type { SummaryItemClickEventArgs } from "./summary-item-click-event-args";
|
|
6
|
+
import type { ValidationSummaryProps } from "./validation-summary-props";
|
|
7
|
+
interface Row {
|
|
8
|
+
target: ValidationTarget;
|
|
9
|
+
text: string;
|
|
10
|
+
li: Component<HTMLLIElement>;
|
|
11
|
+
button: Component<HTMLButtonElement>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The failed fields of a `ValidationGroup`, one line each with the field's label and its message, under a header;
|
|
15
|
+
* a press on a line focuses the field. It draws itself again whenever a field of the group is checked, and stays
|
|
16
|
+
* out of sight while nothing has failed.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* const group = new ValidationGroup();
|
|
20
|
+
* <ValidationSummary group={group} />
|
|
21
|
+
* <TextBox label="Name" required validationGroup={group} />
|
|
22
|
+
* <Button text="Save" onclick={() => group.validate()} />
|
|
23
|
+
*/
|
|
24
|
+
export declare class ValidationSummary extends Control<HTMLDivElement, ValidationSummaryProps> {
|
|
25
|
+
itemClick: Emitter<SummaryItemClickEventArgs>;
|
|
26
|
+
head: Component<HTMLParagraphElement>;
|
|
27
|
+
headText: Component<HTMLSpanElement>;
|
|
28
|
+
list: Component<HTMLUListElement>;
|
|
29
|
+
rows: Row[];
|
|
30
|
+
targets: readonly ValidationTarget[];
|
|
31
|
+
stopTargets: (() => void) | null;
|
|
32
|
+
constructor(props?: IBaseProp<ValidationSummaryProps>);
|
|
33
|
+
get group(): ValidationGroup | null;
|
|
34
|
+
set group(value: Bind<ValidationGroup | null>);
|
|
35
|
+
get header(): string;
|
|
36
|
+
set header(value: Bind<string>);
|
|
37
|
+
get showHeader(): boolean;
|
|
38
|
+
set showHeader(value: Bind<boolean>);
|
|
39
|
+
get focusOnClick(): boolean;
|
|
40
|
+
set focusOnClick(value: Bind<boolean>);
|
|
41
|
+
/** A line was pressed (`target`, `text`). */
|
|
42
|
+
get onItemClick(): MotifEvent<SummaryItemClickEventArgs>;
|
|
43
|
+
/** The failed targets listed now, in the group's order. */
|
|
44
|
+
get failed(): readonly ValidationTarget[];
|
|
45
|
+
/** How many lines there are. */
|
|
46
|
+
get count(): number;
|
|
47
|
+
/** Draws the lines again from the fields as they are now. */
|
|
48
|
+
refresh(): void;
|
|
49
|
+
renderTargets(): void;
|
|
50
|
+
messageOf(target: ValidationTarget): string;
|
|
51
|
+
textOf(target: ValidationTarget): string;
|
|
52
|
+
draw(): void;
|
|
53
|
+
drawHeader(): void;
|
|
54
|
+
click(e: MouseEvent): void;
|
|
55
|
+
}
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ValidationTarget } from '../../parts/validation/validation-target';
|
|
2
|
+
import type { ValidationSummary } from './ValidationSummary';
|
|
3
|
+
/** A line of the summary was pressed. */
|
|
4
|
+
export interface SummaryItemClickEventArgs {
|
|
5
|
+
/** The field (or other target) the line stands for. */
|
|
6
|
+
target: ValidationTarget;
|
|
7
|
+
/** The line's text. */
|
|
8
|
+
text: string;
|
|
9
|
+
source: ValidationSummary;
|
|
10
|
+
event: Event;
|
|
11
|
+
}
|