@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Scheduler: Editing
|
|
2
2
|
|
|
3
|
-
> Scheduler · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Scheduler · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
Appointments are added, moved, resized, copied and deleted with the pointer, the keys and code; every change asks its event first, can wait for a server, and goes back when saving fails.
|
|
6
6
|
|
|
@@ -216,15 +216,15 @@ export default function Rules() {
|
|
|
216
216
|
}
|
|
217
217
|
```
|
|
218
218
|
|
|
219
|
-
##
|
|
219
|
+
## Programmatic use
|
|
220
220
|
|
|
221
221
|
```tsx
|
|
222
222
|
import { reactive } from '@motifx/core';
|
|
223
223
|
import { Button, Scheduler } from '@motifx-community/ui';
|
|
224
224
|
import { sampleAppointments, type Meeting } from './sample-appointments';
|
|
225
225
|
|
|
226
|
-
/** The same changes
|
|
227
|
-
export default function
|
|
226
|
+
/** The same changes programmatically: add, move, delete, open the form for a new one. */
|
|
227
|
+
export default function EditProgrammatically() {
|
|
228
228
|
const state = reactive({ appointments: sampleAppointments(), said: '' });
|
|
229
229
|
let scheduler: Scheduler<Meeting> | null = null;
|
|
230
230
|
const tomorrow = (hour: number) => {
|
|
@@ -303,7 +303,7 @@ export default function EditFromCode() {
|
|
|
303
303
|
| --- | --- |
|
|
304
304
|
| `addAppointment(values)` | Adds where the appointments come from (pushed into the array, or inserted through the data source); resolves to it. |
|
|
305
305
|
| `updateAppointment(appointment, changes)` | Changes its fields; resolves `false` when an event said no or saving failed. |
|
|
306
|
-
| `deleteAppointment(appointment)` | Deletes it (no question
|
|
306
|
+
| `deleteAppointment(appointment)` | Deletes it (no question programmatically). |
|
|
307
307
|
| `showAppointmentForm(appointment?, cell?)` | The form for an appointment, or for a new one at `cell` (the selection by default). |
|
|
308
308
|
| `showTooltip(appointment, anchor?) / hideTooltip()` | Its tooltip. |
|
|
309
309
|
|
package/docs/scheduler-form.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Scheduler: The appointment form
|
|
2
2
|
|
|
3
|
-
> Scheduler · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Scheduler · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
The appointment form set up without events: which fields, in which order, in groups and tabs; editors of your own; checks per field; fields shown or locked for one appointment only. Or a form of your own.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Scheduler: iCalendar and print
|
|
2
2
|
|
|
3
|
-
> Scheduler · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Scheduler · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
Appointments out to an iCalendar file and back in (RFC 5545), for Outlook, Google Calendar and Apple Calendar; and the scheduler on paper.
|
|
6
6
|
|
package/docs/scheduler-mobile.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Scheduler: Tablet and phone
|
|
2
2
|
|
|
3
|
-
> Scheduler · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Scheduler · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
On a tablet and a phone the scheduler keeps its appointments, views and date and shows them another way: a phone gets the agenda, a compact bar and sheets from the bottom; a finger lifts, resizes, swipes and pinches.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Scheduler: Recurrence and time zones
|
|
2
2
|
|
|
3
|
-
> Scheduler · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Scheduler · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
Appointments that repeat by an RFC 5545 rule, with times left out and occurrences changed apart; a question on what a change reaches; an editor of the rule; and the days on the clock of any time zone, summer time included.
|
|
6
6
|
|
|
@@ -198,7 +198,7 @@ export default function TimeZones() {
|
|
|
198
198
|
| Prop | Type | Default | Description |
|
|
199
199
|
| --- | --- | --- | --- |
|
|
200
200
|
| `timeZone` | `Bind<string \| null>` | `null`: the browser's | The clock the days and hours are on, an IANA name (`Europe/Istanbul`). Converted with `Intl` only. |
|
|
201
|
-
| `seriesEdit` | `Bind<'ask' \\| 'occurrence' \\| 'following' \\| 'series'>` | `'ask'` | What changing or deleting an occurrence reaches. `ask` asks the user;
|
|
201
|
+
| `seriesEdit` | `Bind<'ask' \\| 'occurrence' \\| 'following' \\| 'series'>` | `'ask'` | What changing or deleting an occurrence reaches. `ask` asks the user; programmatically it is the occurrence unless the call says. |
|
|
202
202
|
| `recurrenceMarks` | `Bind<boolean>` | `true` | The marks of an occurrence and of one changed apart, where the design language draws them. |
|
|
203
203
|
| `editing.allowRecurrence` | `boolean` | `true` | The form holds the recurrence editor. |
|
|
204
204
|
| `editing.allowTimeZones` | `boolean` | `false` | The form holds a time zone picker, and a box "Separate end time zone" (`separateEndZone` in the form’s data and `items`) that shows a picker for the end; unchecked, the end follows the start’s zone. Not on all-day appointments. |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Scheduler: Resources and groups
|
|
2
2
|
|
|
3
|
-
> Scheduler · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Scheduler · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
Rooms, people and any other kind of resource: they colour the appointments, split the columns into groups (nested, or under each date), say when each one works and when nothing may be put in.
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Scheduler: Timeline
|
|
2
2
|
|
|
3
|
-
> Scheduler · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Scheduler · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
A row per resource with the time running along it: a day, a week, a work week or a month. Appointments at the same time stack in their row, and the row grows to fit them.
|
|
6
6
|
|
package/docs/scheduler.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Scheduler
|
|
2
2
|
|
|
3
|
-
> Scheduler · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Scheduler · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
Appointments over days and hours: day, week, work week and month views, all-day and multi-day bars, appointments at the same time side by side, and "+N more" where a day is full. From an array or a data source, with every setting live.
|
|
6
6
|
|
|
@@ -229,15 +229,15 @@ export default function Templates() {
|
|
|
229
229
|
}
|
|
230
230
|
```
|
|
231
231
|
|
|
232
|
-
##
|
|
232
|
+
## Programmatic use
|
|
233
233
|
|
|
234
234
|
```tsx
|
|
235
235
|
import { reactive } from '@motifx/core';
|
|
236
236
|
import { Button, Scheduler, Stack } from '@motifx-community/ui';
|
|
237
237
|
import { sampleAppointments, type Meeting } from './sample-appointments';
|
|
238
238
|
|
|
239
|
-
/** A scheduler made with `new`, added
|
|
240
|
-
export default function
|
|
239
|
+
/** A scheduler made with `new`, added programmatically and driven by its methods. */
|
|
240
|
+
export default function Programmatic() {
|
|
241
241
|
const state = reactive({ said: '' });
|
|
242
242
|
let host: Stack | null = null;
|
|
243
243
|
let scheduler: Scheduler<Meeting> | null = null;
|
package/docs/scrollview.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# ScrollView
|
|
2
2
|
|
|
3
|
-
> Navigation · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Navigation · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
|
-
Content that scrolls in a box of its own: the bars shown as told, a pull from the top that asks for what is new, a reach near the end that asks for more. Moved
|
|
5
|
+
Content that scrolls in a box of its own: the bars shown as told, a pull from the top that asks for what is new, a reach near the end that asks for more. Moved programmatically to a position or to an element.
|
|
6
6
|
|
|
7
7
|
## Import
|
|
8
8
|
|
|
@@ -12,7 +12,7 @@ import { ScrollView } from '@motifx-community/ui';
|
|
|
12
12
|
|
|
13
13
|
## A box that scrolls
|
|
14
14
|
|
|
15
|
-
The JSX children are the content. `showScrollbar` says when the bars show; `scrollTo` and `scrollToElement` move the content
|
|
15
|
+
The JSX children are the content. `showScrollbar` says when the bars show; `scrollTo` and `scrollToElement` move the content programmatically, `onScrolled` tells where it stands.
|
|
16
16
|
|
|
17
17
|
```tsx
|
|
18
18
|
import { reactive } from '@motifx/core';
|
|
@@ -21,7 +21,7 @@ import { Button, ScrollView, Stack, type ScrollViewBars } from '@motifx-communit
|
|
|
21
21
|
const LINES = Array.from({ length: 40 }, (_, i) => `Line ${i + 1} of a long text that needs a box of its own to scroll in.`);
|
|
22
22
|
const MODES: ScrollViewBars[] = ['onScroll', 'onHover', 'always', 'never'];
|
|
23
23
|
|
|
24
|
-
/** A box that scrolls, its bars shown as told; moved
|
|
24
|
+
/** A box that scrolls, its bars shown as told; moved programmatically to a line and back to the top. */
|
|
25
25
|
export default function Bars() {
|
|
26
26
|
const s = reactive({ bars: 'onScroll' as ScrollViewBars, top: 0 });
|
|
27
27
|
let view!: ScrollView;
|
|
@@ -121,7 +121,7 @@ export default function More() {
|
|
|
121
121
|
|
|
122
122
|
| Topic | How |
|
|
123
123
|
| --- | --- |
|
|
124
|
-
| `Scrolling` | The box scrolls with the wheel, the keys when focused, a finger, and
|
|
124
|
+
| `Scrolling` | The box scrolls with the wheel, the keys when focused, a finger, and programmatically. `direction` locks the other axis; the page behind does not scroll on when the content ends. |
|
|
125
125
|
| `Scrollbars` | The design system’s bars. With `onScroll` the thumb shows while the content moves and goes a moment after; with `onHover` while the pointer is over the view or focus is in it; `always` leaves them; `never` hides them, the content still scrolls. |
|
|
126
126
|
| `Pull to refresh` | From the top, with a finger or the pointer: the content comes down (harder the farther it goes) and the panel above it says to pull, then to release. Let go far enough it refreshes: the spinner turns until `release()` or the promise. A short pull goes back. |
|
|
127
127
|
| `Load more` | Within `reachBottomOffset` of the end, `onReachBottom` is asked once; the panel under the content shows meanwhile. Released, the next reach asks again, until `release(true)`. Content that does not fill the box asks at once, and again as it grows. |
|
package/docs/showcase.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Showcase: an order screen
|
|
2
2
|
|
|
3
|
-
> Get started · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Get started · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
An order screen built with the kit, the way a MotifJS app is built: the state and the operations live in a model (`OrderModel`), the page binds to it. The customer list is a data source of 5,000 rows that answers like a server.
|
package/docs/skeleton.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Skeleton
|
|
2
2
|
|
|
3
|
-
> Display · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Display · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
The shape of what is loading, so the page keeps its layout while data arrives. Given content, it shows the content in the same place once loading ends.
|
|
6
6
|
|
|
@@ -128,4 +128,4 @@ export default function Animations() {
|
|
|
128
128
|
| Property | Access | Description |
|
|
129
129
|
| --- | --- | --- |
|
|
130
130
|
| `every prop above` | read/write | A value or a function, like the prop. |
|
|
131
|
-
| `content` | read-only | The part holding what shows once loaded, for adding to it
|
|
131
|
+
| `content` | read-only | The part holding what shows once loaded, for adding to it programmatically. |
|
package/docs/slider.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Slider
|
|
2
2
|
|
|
3
|
-
> Editors · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Editors · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
A value picked on a track by dragging a thumb or with the keys: one number, or a range with two thumbs. Steps, marks with labels, a value bubble, a vertical form and number formatting, with the label, help line and validation every field has.
|
|
6
6
|
|
|
@@ -10,21 +10,21 @@ A value picked on a track by dragging a thumb or with the keys: one number, or a
|
|
|
10
10
|
import { Slider, type SliderValue } from '@motifx-community/ui';
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Declarative and programmatic
|
|
14
14
|
|
|
15
|
-
Every prop takes a value or a function; `x-model` binds the value two-way. Created with `new`, the same properties are set
|
|
15
|
+
Every prop takes a value or a function; `x-model` binds the value two-way. Created with `new`, the same properties are set programmatically.
|
|
16
16
|
|
|
17
17
|
```tsx
|
|
18
18
|
import { reactive } from '@motifx/core';
|
|
19
19
|
import { Button, Slider, Stack } from '@motifx-community/ui';
|
|
20
20
|
|
|
21
|
-
/** A slider bound to state with x-model, and sliders created with `new` and added
|
|
22
|
-
export default function
|
|
21
|
+
/** A slider bound to state with x-model, and sliders created with `new` and added programmatically. */
|
|
22
|
+
export default function Programmatic() {
|
|
23
23
|
const s = reactive({ volume: 40, result: '' });
|
|
24
24
|
let added = 0;
|
|
25
25
|
let host: Stack | null = null;
|
|
26
26
|
|
|
27
|
-
const
|
|
27
|
+
const addProgrammatic = () => {
|
|
28
28
|
const slider = new Slider({ label: `Slider ${++added}`, showValue: 'drag' });
|
|
29
29
|
slider.value = 50;
|
|
30
30
|
slider.onValueChanged((e) => (s.result = `${slider.label}: ${String(e.value)}`));
|
|
@@ -36,7 +36,7 @@ export default function FromCode() {
|
|
|
36
36
|
<>
|
|
37
37
|
<Slider label="&Volume" x-model={() => s.volume} helpText={() => `Volume: ${s.volume}`} />
|
|
38
38
|
<Stack orientation="horizontal" wrap align="center">
|
|
39
|
-
<Button text="Add a slider
|
|
39
|
+
<Button text="Add a slider programmatically" variant="outline" onclick={addProgrammatic} />
|
|
40
40
|
<output class="sl-result">{() => s.result}</output>
|
|
41
41
|
</Stack>
|
|
42
42
|
<Stack orientation="horizontal" wrap align="center" ref={(c: Stack) => (host = c)} />
|
package/docs/sortable.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Sortable
|
|
2
2
|
|
|
3
|
-
> Navigation · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Navigation · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
Items the user puts in order by dragging them, with the pointer or a finger, or with the keys; lists of one group take each other’s items. A drop moves the element and tells you the indexes: your data stays yours.
|
|
6
6
|
|
|
@@ -207,7 +207,7 @@ export default function Handle() {
|
|
|
207
207
|
| `onDragEnding` | event | About to drop; `cancel = true` leaves everything as it was. |
|
|
208
208
|
| `onReorder` | event | An item moved within this sortable (`fromIndex`, `toIndex`, `item`), by a drop or the keys. Reorder your data here. |
|
|
209
209
|
| `onRemove, onAdd` | event | An item went to another sortable of the group, and came into one: `from`, `to`, the indexes and the item. Move the data between your arrays here. |
|
|
210
|
-
| `move(fromIndex, toIndex)` | `boolean` | Moves an item
|
|
210
|
+
| `move(fromIndex, toIndex)` | `boolean` | Moves an item programmatically as a drop would, telling `onReorder`. |
|
|
211
211
|
| `elements` | read-only | The items’ elements, in order. |
|
|
212
212
|
| `isDragging` | read-only | An item is being dragged. |
|
|
213
213
|
| `refresh()` | `void` | Reads the items again after they were changed in place. |
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
# SpeedDial
|
|
2
|
+
|
|
3
|
+
> Buttons · @motifx-community/ui 0.1.0-beta.3
|
|
4
|
+
|
|
5
|
+
A round button in a corner of the page, on an edge or in the flow, that opens its actions when pressed: round buttons in a line with a label beside each, or on a circle, a half or a quarter of one around it with a tooltip each. With one action, the main button does it itself.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { SpeedDial } from '@motifx-community/ui';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## In a line
|
|
14
|
+
|
|
15
|
+
`actions` are the buttons that go out in `direction`; each has a `glyph` of the kit’s set or an `icon` of your own, a `text` shown as its label, and a `click`. `open` and `x-model` say whether the fan is out. Here in the flow of the page (`position='inline'`).
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { reactive } from '@motifx/core';
|
|
19
|
+
import { SpeedDial, Stack } from '@motifx-community/ui';
|
|
20
|
+
|
|
21
|
+
/** Two speed dials in the flow of the page: one fans up, one fans to the end; a press on an action tells. */
|
|
22
|
+
export default function Inline() {
|
|
23
|
+
const s = reactive({ told: '', open: false });
|
|
24
|
+
const actions = [
|
|
25
|
+
{ key: 'note', text: 'New note', glyph: 'pencil', click: () => (s.told = 'a new note') },
|
|
26
|
+
{ key: 'event', text: 'New event', glyph: 'calendar', click: () => (s.told = 'a new event') },
|
|
27
|
+
{ key: 'file', text: 'Upload a file', glyph: 'upload', click: () => (s.told = 'a file to upload') },
|
|
28
|
+
{ key: 'locked', text: 'Not yet', glyph: 'lock', enabled: false }
|
|
29
|
+
];
|
|
30
|
+
return (
|
|
31
|
+
<Stack gap="md" style="inline-size: 100%">
|
|
32
|
+
<div class="sd-row" style="display: flex; align-items: flex-end; gap: 48px; min-block-size: 260px; padding-inline-start: 140px">
|
|
33
|
+
<SpeedDial class="sd-up" position="inline" direction="up" text="New" actions={actions} x-model={() => s.open} />
|
|
34
|
+
<SpeedDial class="sd-end" position="inline" direction="end" text="Share" glyph="person" actions={[{ text: 'Mail', glyph: 'file', click: () => (s.told = 'shared by mail') }, { text: 'Link', glyph: 'pin', click: () => (s.told = 'a link to share') }]} />
|
|
35
|
+
</div>
|
|
36
|
+
<output class="sd-told">{() => `${s.told || 'nothing yet'}${s.open ? ' (open)' : ''}`}</output>
|
|
37
|
+
</Stack>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## On a circle
|
|
43
|
+
|
|
44
|
+
`layout='circle'` lays the actions evenly around the main button, the first in `direction`. They come out from under the button and go back there. `radius` sets how far out; by itself it is just enough to keep the actions `gap` apart and clear of the button. Around the button the labels are off and the actions have tooltips, because labels would run into each other; `showLabels` and `tooltip` say otherwise. Here it is in the centre of its box: `relativeTo='parent'` measures `position` in the nearest positioned parent.
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
import { reactive } from '@motifx/core';
|
|
48
|
+
import { Button, SpeedDial, Stack } from '@motifx-community/ui';
|
|
49
|
+
|
|
50
|
+
/** The actions on a whole circle around the button, in the centre of a box; by default just far enough out to keep them apart. */
|
|
51
|
+
export default function Circle() {
|
|
52
|
+
const s = reactive({ radius: null as number | null, told: '' });
|
|
53
|
+
const actions = [
|
|
54
|
+
{ text: 'Edit', glyph: 'pencil', click: () => (s.told = 'edit') },
|
|
55
|
+
{ text: 'Refresh', glyph: 'repeat', click: () => (s.told = 'refresh') },
|
|
56
|
+
{ text: 'Delete', glyph: 'trash', click: () => (s.told = 'delete') },
|
|
57
|
+
{ text: 'Upload', glyph: 'upload', click: () => (s.told = 'upload') },
|
|
58
|
+
{ text: 'Download', glyph: 'download', click: () => (s.told = 'download') }
|
|
59
|
+
];
|
|
60
|
+
return (
|
|
61
|
+
<Stack gap="sm" style="inline-size: 100%">
|
|
62
|
+
<Stack orientation="horizontal" wrap align="center">
|
|
63
|
+
<Button text="Radius by itself" variant="outline" onclick={() => (s.radius = null)} />
|
|
64
|
+
<Button text="Radius 120" variant="outline" onclick={() => (s.radius = 120)} />
|
|
65
|
+
<output class="sd-circle-told">{() => s.told}</output>
|
|
66
|
+
</Stack>
|
|
67
|
+
<div style="position: relative; inline-size: 100%; block-size: 22rem">
|
|
68
|
+
<SpeedDial class="sd-circle" layout="circle" position="center" relativeTo="parent" radius={() => s.radius} text="Tools" actions={actions} />
|
|
69
|
+
</div>
|
|
70
|
+
</Stack>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## On a half circle
|
|
76
|
+
|
|
77
|
+
`layout='semi-circle'` lays them on half a circle with `direction` in its middle, which suits the middle of an edge: `position` takes `top`, `bottom`, `start` and `end`, and `direction` follows from it, into the page.
|
|
78
|
+
|
|
79
|
+
```tsx
|
|
80
|
+
import { SpeedDial } from '@motifx-community/ui';
|
|
81
|
+
|
|
82
|
+
const ACTIONS = [
|
|
83
|
+
{ text: 'Edit', glyph: 'pencil' },
|
|
84
|
+
{ text: 'Refresh', glyph: 'repeat' },
|
|
85
|
+
{ text: 'Delete', glyph: 'trash' },
|
|
86
|
+
{ text: 'Upload', glyph: 'upload' },
|
|
87
|
+
{ text: 'Download', glyph: 'download' }
|
|
88
|
+
];
|
|
89
|
+
|
|
90
|
+
/** A half circle on the middle of each edge of a box: `direction` follows from `position`, into the box. */
|
|
91
|
+
export default function SemiCircle() {
|
|
92
|
+
return (
|
|
93
|
+
<div class="sd-semi" style="position: relative; inline-size: 100%; block-size: 26rem">
|
|
94
|
+
<SpeedDial class="sd-semi-top" layout="semi-circle" position="top" relativeTo="parent" text="Tools at the top" actions={ACTIONS} />
|
|
95
|
+
<SpeedDial class="sd-semi-start" layout="semi-circle" position="start" relativeTo="parent" text="Tools at the start" actions={ACTIONS} />
|
|
96
|
+
<SpeedDial class="sd-semi-end" layout="semi-circle" position="end" relativeTo="parent" text="Tools at the end" actions={ACTIONS} />
|
|
97
|
+
<SpeedDial class="sd-semi-bottom" layout="semi-circle" position="bottom" relativeTo="parent" text="Tools at the bottom" actions={ACTIONS} />
|
|
98
|
+
</div>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## On a quarter circle
|
|
104
|
+
|
|
105
|
+
`layout='quarter-circle'` lays them on a quarter of a circle, which suits a corner: `direction` follows from `position` again, and is a diagonal such as `up-start` when you set it.
|
|
106
|
+
|
|
107
|
+
```tsx
|
|
108
|
+
import { SpeedDial } from '@motifx-community/ui';
|
|
109
|
+
|
|
110
|
+
const ACTIONS = [
|
|
111
|
+
{ text: 'Edit', glyph: 'pencil' },
|
|
112
|
+
{ text: 'Refresh', glyph: 'repeat' },
|
|
113
|
+
{ text: 'Delete', glyph: 'trash' },
|
|
114
|
+
{ text: 'Upload', glyph: 'upload' },
|
|
115
|
+
{ text: 'Download', glyph: 'download' }
|
|
116
|
+
];
|
|
117
|
+
|
|
118
|
+
/** A quarter circle in each corner of a box: `direction` follows from `position`, into the box. */
|
|
119
|
+
export default function QuarterCircle() {
|
|
120
|
+
return (
|
|
121
|
+
<div class="sd-quarter" style="position: relative; inline-size: 100%; block-size: 26rem">
|
|
122
|
+
<SpeedDial class="sd-quarter-top-start" layout="quarter-circle" position="top-start" relativeTo="parent" text="Tools, top start" actions={ACTIONS} />
|
|
123
|
+
<SpeedDial class="sd-quarter-top-end" layout="quarter-circle" position="top-end" relativeTo="parent" text="Tools, top end" actions={ACTIONS} />
|
|
124
|
+
<SpeedDial class="sd-quarter-bottom-start" layout="quarter-circle" position="bottom-start" relativeTo="parent" text="Tools, bottom start" actions={ACTIONS} />
|
|
125
|
+
<SpeedDial class="sd-quarter-bottom-end" layout="quarter-circle" position="bottom-end" relativeTo="parent" text="Tools, bottom end" actions={ACTIONS} />
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## Tooltips
|
|
132
|
+
|
|
133
|
+
`tooltip` on the speed dial turns tooltips on or off for all its actions and passes options to each; `tooltip` on an action wins, with a text of its own, options, or `false`. Each is the kit’s `Tooltip`, on the outer side of the action unless `placement` says another. With one action, the main button carries its tooltip.
|
|
134
|
+
|
|
135
|
+
```tsx
|
|
136
|
+
import { reactive } from '@motifx/core';
|
|
137
|
+
import { Button, SpeedDial, Stack } from '@motifx-community/ui';
|
|
138
|
+
|
|
139
|
+
/** Tooltips on the actions: the speed dial's options for all, a text or options of an action's own, none on one. */
|
|
140
|
+
export default function Tooltips() {
|
|
141
|
+
const s = reactive({ on: true });
|
|
142
|
+
return (
|
|
143
|
+
<Stack gap="md" style="inline-size: 100%">
|
|
144
|
+
<Button class="sd-tips-toggle" text="Tooltips" variant="outline" toggle x-model={() => s.on} />
|
|
145
|
+
<div style="min-block-size: 5rem; padding-block-start: 2rem">
|
|
146
|
+
<SpeedDial
|
|
147
|
+
class="sd-tips"
|
|
148
|
+
position="inline"
|
|
149
|
+
direction="end"
|
|
150
|
+
text="Edit"
|
|
151
|
+
closeOnAction={false}
|
|
152
|
+
showLabels={false}
|
|
153
|
+
tooltip={() => (s.on ? { placement: 'top', delay: 100 } : false)}
|
|
154
|
+
actions={[
|
|
155
|
+
{ text: 'Edit', glyph: 'pencil' },
|
|
156
|
+
{ text: 'Upload', glyph: 'upload', tooltip: 'Upload a new version, up to 20 MB' },
|
|
157
|
+
{ text: 'Delete', glyph: 'trash', tooltip: { text: 'Kept in the bin for 30 days', placement: 'bottom' } },
|
|
158
|
+
{ text: 'Save', glyph: 'save', tooltip: false }
|
|
159
|
+
]}
|
|
160
|
+
/>
|
|
161
|
+
</div>
|
|
162
|
+
</Stack>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## In a corner of the viewport
|
|
168
|
+
|
|
169
|
+
By default it is fixed to the bottom end corner of the viewport, `inset` away from the edges; `position` names another place. Switch it on here to see it over the page.
|
|
170
|
+
|
|
171
|
+
```tsx
|
|
172
|
+
import { reactive } from '@motifx/core';
|
|
173
|
+
import { Button, SpeedDial, Stack } from '@motifx-community/ui';
|
|
174
|
+
|
|
175
|
+
/** A speed dial fixed to a corner of the viewport, shown while the switch is on; the corner and the fan's way can change. */
|
|
176
|
+
export default function Corner() {
|
|
177
|
+
const s = reactive({ on: false, position: 'bottom-end' as 'bottom-end' | 'bottom-start' | 'top-end' | 'top-start', told: '' });
|
|
178
|
+
return (
|
|
179
|
+
<Stack gap="sm" style="inline-size: 100%">
|
|
180
|
+
<Stack orientation="horizontal" wrap align="center">
|
|
181
|
+
<Button class="sd-corner-toggle" text="In the corner" variant="outline" toggle x-model={() => s.on} />
|
|
182
|
+
<Button text="Bottom end" variant="outline" onclick={() => (s.position = 'bottom-end')} />
|
|
183
|
+
<Button text="Bottom start" variant="outline" onclick={() => (s.position = 'bottom-start')} />
|
|
184
|
+
<Button text="Top end" variant="outline" onclick={() => (s.position = 'top-end')} />
|
|
185
|
+
<output class="sd-corner-told">{() => s.told}</output>
|
|
186
|
+
</Stack>
|
|
187
|
+
<SpeedDial
|
|
188
|
+
class="sd-corner"
|
|
189
|
+
visible={() => s.on}
|
|
190
|
+
position={() => s.position}
|
|
191
|
+
text="Create"
|
|
192
|
+
actions={[
|
|
193
|
+
{ text: 'Document', glyph: 'file', click: () => (s.told = 'a document') },
|
|
194
|
+
{ text: 'Folder', glyph: 'columns', click: () => (s.told = 'a folder') },
|
|
195
|
+
{ text: 'Upload', glyph: 'upload', click: () => (s.told = 'an upload') }
|
|
196
|
+
]}
|
|
197
|
+
/>
|
|
198
|
+
</Stack>
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## One action
|
|
204
|
+
|
|
205
|
+
With exactly one action shown, there is nothing to fan out: the main button takes the action’s glyph and name and does it itself. `extended` shows the name beside the glyph.
|
|
206
|
+
|
|
207
|
+
```tsx
|
|
208
|
+
import { reactive } from '@motifx/core';
|
|
209
|
+
import { SpeedDial, Stack } from '@motifx-community/ui';
|
|
210
|
+
|
|
211
|
+
/** With one action shown, the main button does it itself and takes its glyph and name; `extended` shows the name beside the glyph. */
|
|
212
|
+
export default function Single() {
|
|
213
|
+
const s = reactive({ saved: 0 });
|
|
214
|
+
return (
|
|
215
|
+
<Stack gap="sm" style="inline-size: 100%">
|
|
216
|
+
<Stack orientation="horizontal" gap="lg" align="center">
|
|
217
|
+
<SpeedDial class="sd-single" position="inline" actions={[{ text: 'Save', glyph: 'save', click: () => s.saved++ }]} />
|
|
218
|
+
<SpeedDial class="sd-extended" position="inline" extended actions={[{ text: 'Save a copy', glyph: 'save', click: () => s.saved++ }]} />
|
|
219
|
+
</Stack>
|
|
220
|
+
<output class="sd-single-told">{() => `saved ${s.saved} times`}</output>
|
|
221
|
+
</Stack>
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## Keyboard
|
|
227
|
+
|
|
228
|
+
| Key | What it does |
|
|
229
|
+
| --- | --- |
|
|
230
|
+
| `Tab` | The main button is the one stop; the actions are reached with the arrow keys. |
|
|
231
|
+
| `Arrow keys` | On the main button, the key along the actions opens them on the first (the other way, on the last); on the actions they move, around the ends. Up and Down for a line that stands, Left and Right for one that lies; around the button either pair, Down and Right forward along the circle. |
|
|
232
|
+
| `Home, End` | The first and the last action. |
|
|
233
|
+
| `Enter, Space` | Press the main button or the focused action. |
|
|
234
|
+
| `Escape` | Closes the actions and puts the focus back on the main button; so does a press outside, and Tab. While a tooltip is shown, the first Escape hides the tooltip. |
|
|
235
|
+
|
|
236
|
+
## Accessibility
|
|
237
|
+
|
|
238
|
+
| Topic | How |
|
|
239
|
+
| --- | --- |
|
|
240
|
+
| `The main button` | A button named by `text` (“Actions” in the kit language) with `aria-haspopup="menu"` and `aria-expanded`; with one action shown it is that action, named by it. |
|
|
241
|
+
| `The actions` | A `menu` of `menuitem`s named by their labels; out of sight they are hidden from readers and keys (`inert`). |
|
|
242
|
+
| `Labels and glyphs` | The labels are shown beside the actions while open; the name is on the action either way. The glyphs are decorative. |
|
|
243
|
+
| `Tooltips` | The kit’s `Tooltip`: on keyboard focus too, dismissed with Escape, described with `aria-describedby`. A touch does not show one, so where the glyph alone does not say it on a touch screen, keep the labels on. |
|
|
244
|
+
|
|
245
|
+
## Styling
|
|
246
|
+
|
|
247
|
+
| Hook | What it is |
|
|
248
|
+
| --- | --- |
|
|
249
|
+
| `.mx-speed-dial` | The speed dial. `data-layout`, `data-position`, `data-relative`, `data-direction`, `data-open`, `data-labels`, `data-extended`, `data-single`. |
|
|
250
|
+
| `.mx-speed-dial__main, .mx-speed-dial__main-glyph, .mx-speed-dial__main-text` | The main button, its glyph and its text. |
|
|
251
|
+
| `.mx-speed-dial__fan, .mx-speed-dial__action, .mx-speed-dial__action-icon, .mx-speed-dial__label` | The fan, an action (`aria-disabled`, `data-side`: where its label and tooltip go), its glyph or icon, its label. |
|
|
252
|
+
|
|
253
|
+
### Component tokens
|
|
254
|
+
|
|
255
|
+
| Token | What it sets |
|
|
256
|
+
| --- | --- |
|
|
257
|
+
| `speed-dial.main, .main-glyph, .main-text, .action, .action-icon, .label, .fan` | Units: the main button (`hover`, `pressed`, `focus`, `open`, `extended`, `disabled`), its glyph (`open`) and text, an action (`hover`, `pressed`, `focus`, `disabled`), its glyph, the label, the fan. |
|
|
258
|
+
| `speed-dial.inset, .gap, .label-gap` | From the edges, between the buttons (around the button too: the radius keeps this gap), between an action and its label. |
|
|
259
|
+
|
|
260
|
+
## API reference
|
|
261
|
+
|
|
262
|
+
### Props
|
|
263
|
+
|
|
264
|
+
| Prop | Type | Default | Description |
|
|
265
|
+
| --- | --- | --- | --- |
|
|
266
|
+
| `actions` | `Bind<readonly SpeedDialAction[]>` | `[]` | The actions in order: `text`, `glyph` (of the kit’s set) or `icon` (yours), `tooltip`, `enabled`, `visible`, `click`, `key`, `data`. With one shown, the main button does it itself. |
|
|
267
|
+
| `glyph, openGlyph` | `Bind<string>` | `'plus'`, `'dismiss'` | The main button’s glyph, and its glyph while the actions are open. |
|
|
268
|
+
| `text` | `Bind<string>` | the kit’s “Actions” | What screen readers call the main button, and its text when `extended`. |
|
|
269
|
+
| `extended` | `Bind<boolean>` | `false` | The main button shows its `text` beside the glyph. |
|
|
270
|
+
| `layout` | `Bind<SpeedDialLayout>` | `'linear'` | `linear`, `circle`, `semi-circle` or `quarter-circle`: in a line from the main button, or around it. |
|
|
271
|
+
| `radius` | `Bind<number \| null>` | by itself | Around the button: pixels from its centre to the actions’ centres. By itself it is just enough to keep them apart. An `extended` main button is wider than this reckons with, so give it one. |
|
|
272
|
+
| `direction` | `Bind<SpeedDialDirection>` | into the page | `up`, `down`, `start`, `end` or a diagonal such as `up-start`: where the actions go, the middle of the arc around the button. A line takes the first word of a diagonal. By itself it is away from the edges `position` names, and `up` in the centre and inline. |
|
|
273
|
+
| `position` | `Bind<SpeedDialPosition>` | `'bottom-end'` | A corner (`bottom-end`, `bottom-start`, `top-end`, `top-start`), the middle of an edge (`top`, `bottom`, `start`, `end`), `center`, or `inline` in the flow. |
|
|
274
|
+
| `relativeTo` | `Bind<SpeedDialRelativeTo>` | `'viewport'` | What `position` is measured in: `viewport`, or `parent`, the nearest positioned parent. |
|
|
275
|
+
| `open` | `Bind<boolean>` | `false` | The actions are open. `x-model` binds it two-way. |
|
|
276
|
+
| `closeOnAction` | `Bind<boolean>` | `true` | A press on an action closes the fan. |
|
|
277
|
+
| `showLabels` | `Bind<boolean>` | in a line yes, around no | The actions’ labels are shown beside them while open. |
|
|
278
|
+
| `tooltip` | `Bind<boolean \| SpeedDialTooltip>` | while the labels are off | Tooltips on the actions, with their `text`. Options go to each `Tooltip` (`placement`, `delay`, `hideDelay`, `showOn`, `content`…). By default they open on the outer side after 200 ms. An action’s own `tooltip` wins: a text, options, or `false` for none. |
|
|
279
|
+
|
|
280
|
+
### Events, properties and methods
|
|
281
|
+
|
|
282
|
+
| Member | Kind | Description |
|
|
283
|
+
| --- | --- | --- |
|
|
284
|
+
| `onOpened, onClosed` | event | The actions opened or closed (`byUser`). |
|
|
285
|
+
| `onActionClick` | event | An action was pressed (`index`, `action`); its own `click` runs first. |
|
|
286
|
+
| `isOpen` | read-only | The actions are open. |
|
|
287
|
+
| `single` | read-only | The one action shown, when there is exactly one; `null` otherwise. |
|
|
288
|
+
| `mainElement` | read-only | The main button. |
|
|
289
|
+
| `show(), close(), toggle()` | `void` | Opens or closes the actions. |
|
|
290
|
+
| `refresh()` | `void` | Reads the actions again after they were changed in place. |
|