@motifx-community/ui 0.1.0-beta.1 → 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.
Potentially problematic release.
This version of @motifx-community/ui might be problematic. Click here for more details.
- package/CHANGELOG.md +147 -8
- package/README.md +19 -13
- package/dist/components/accordion/Accordion.d.ts +3 -3
- package/dist/components/accordion/AccordionItem.d.ts +1 -1
- package/dist/components/calendar/Calendar.d.ts +12 -0
- package/dist/components/calendar/calendar-props.d.ts +5 -0
- 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/daterangebox/DateRangeBox.d.ts +121 -0
- package/dist/components/daterangebox/date-range-box-props.d.ts +35 -0
- package/dist/components/daterangebox/date-range-preset.d.ts +6 -0
- package/dist/components/daterangebox/date-range.d.ts +2 -0
- package/dist/components/daterangebox/index.d.ts +4 -0
- 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 +133 -0
- package/dist/components/fileuploader/file-uploader-props.d.ts +46 -0
- package/dist/components/fileuploader/files-added-event-args.d.ts +9 -0
- package/dist/components/fileuploader/index.d.ts +7 -0
- package/dist/components/fileuploader/upload-event-args.d.ts +10 -0
- package/dist/components/fileuploader/upload-item.d.ts +12 -0
- package/dist/components/fileuploader/upload-mode.d.ts +2 -0
- package/dist/components/fileuploader/upload-status.d.ts +2 -0
- 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/loadpanel/LoadPanel.d.ts +70 -0
- package/dist/components/loadpanel/index.d.ts +3 -0
- package/dist/components/loadpanel/load-panel-props.d.ts +29 -0
- package/dist/components/loadpanel/load-panel-target.d.ts +3 -0
- 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 +98 -0
- package/dist/components/popover/index.d.ts +5 -0
- package/dist/components/popover/popover-close-reason.d.ts +2 -0
- package/dist/components/popover/popover-closing-event-args.d.ts +8 -0
- package/dist/components/popover/popover-props.d.ts +39 -0
- package/dist/components/popover/popover-show-on.d.ts +2 -0
- 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 +109 -0
- package/dist/components/scrollview/index.d.ts +7 -0
- package/dist/components/scrollview/pull-down-event-args.d.ts +9 -0
- package/dist/components/scrollview/reach-bottom-event-args.d.ts +9 -0
- package/dist/components/scrollview/scroll-event-args.d.ts +7 -0
- package/dist/components/scrollview/scroll-view-bars.d.ts +2 -0
- package/dist/components/scrollview/scroll-view-direction.d.ts +2 -0
- package/dist/components/scrollview/scroll-view-props.d.ts +31 -0
- package/dist/components/skeleton/Skeleton.d.ts +1 -1
- package/dist/components/sortable/Sortable.d.ts +106 -0
- package/dist/components/sortable/index.d.ts +5 -0
- package/dist/components/sortable/sortable-drag-event-args.d.ts +15 -0
- package/dist/components/sortable/sortable-drop-event-args.d.ts +11 -0
- package/dist/components/sortable/sortable-orientation.d.ts +2 -0
- package/dist/components/sortable/sortable-props.d.ts +34 -0
- 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 +121 -0
- package/dist/components/stepper/Wizard.d.ts +112 -0
- package/dist/components/stepper/WizardStep.d.ts +44 -0
- package/dist/components/stepper/index.d.ts +13 -0
- package/dist/components/stepper/step-changed-event-args.d.ts +11 -0
- package/dist/components/stepper/step-changing-event-args.d.ts +18 -0
- package/dist/components/stepper/stepper-item.d.ts +20 -0
- package/dist/components/stepper/stepper-label-position.d.ts +2 -0
- package/dist/components/stepper/stepper-orientation.d.ts +1 -0
- package/dist/components/stepper/stepper-props.d.ts +32 -0
- package/dist/components/stepper/stepper-status.d.ts +2 -0
- package/dist/components/stepper/wizard-finishing-event-args.d.ts +7 -0
- package/dist/components/stepper/wizard-props.d.ts +48 -0
- package/dist/components/stepper/wizard-step-props.d.ts +32 -0
- 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 +6 -0
- package/dist/core/fold-text.d.ts +6 -0
- package/dist/core/ui-locale.d.ts +0 -2
- package/dist/core/ui-strings.d.ts +67 -0
- package/dist/generated/tokens.d.ts +7270 -4490
- package/dist/index.d.ts +17 -1
- package/dist/index.js +27131 -20490
- package/dist/index.js.map +1 -1
- package/dist/locales/en.json +59 -1
- package/dist/locales/tr.json +59 -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 +4916 -206
- package/dist/tokens/index.d.ts +7270 -4490
- package/dist/tokens/index.js +7270 -4490
- package/dist/tokens/index.js.map +1 -1
- package/dist/tr-C5IXRzAH.js +1233 -0
- package/dist/tr-C5IXRzAH.js.map +1 -0
- 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 +6 -6
- package/docs/breadcrumb.md +4 -4
- package/docs/button.md +10 -10
- package/docs/buttongroup.md +5 -5
- package/docs/calendar.md +6 -6
- package/docs/card.md +6 -6
- package/docs/checkbox.md +9 -9
- 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 +7 -7
- 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 +8 -8
- package/docs/daterangebox.md +192 -0
- package/docs/draggable.md +194 -0
- package/docs/drawer.md +1 -1
- package/docs/dropdown.md +10 -10
- package/docs/fileuploader.md +201 -0
- package/docs/filterbuilder.md +9 -9
- 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 +229 -0
- package/docs/layout.md +15 -15
- package/docs/listbox.md +10 -10
- package/docs/loadpanel.md +184 -0
- package/docs/lookup.md +1 -1
- package/docs/menus.md +2 -2
- package/docs/multiview.md +202 -0
- package/docs/numberbox.md +9 -9
- package/docs/pagination.md +4 -4
- package/docs/popover.md +221 -0
- package/docs/progress.md +9 -9
- 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 +185 -0
- package/docs/showcase.md +1 -1
- package/docs/skeleton.md +2 -2
- package/docs/slider.md +9 -9
- package/docs/sortable.md +213 -0
- package/docs/speeddial.md +290 -0
- package/docs/splitter.md +204 -0
- package/docs/stepper.md +238 -0
- 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 +11 -11
- package/docs/tagbox.md +10 -10
- package/docs/textarea.md +9 -9
- package/docs/textbox.md +10 -10
- package/docs/tileview.md +206 -0
- package/docs/timeline.md +174 -0
- package/docs/toast.md +7 -7
- package/docs/tokens.md +678 -122
- package/docs/toolbar.md +8 -8
- package/docs/tooltip.md +12 -12
- package/docs/treeview.md +11 -11
- package/docs/validationsummary.md +115 -0
- package/docs/window.md +7 -7
- package/docs/wizard.md +240 -0
- package/llms-full.txt +4813 -492
- package/llms.txt +21 -3
- package/package.json +9 -3
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;
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
# ScrollView
|
|
2
|
+
|
|
3
|
+
> Navigation · @motifx-community/ui 0.1.0-beta.3
|
|
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 programmatically to a position or to an element.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { ScrollView } from '@motifx-community/ui';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## A box that scrolls
|
|
14
|
+
|
|
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
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { reactive } from '@motifx/core';
|
|
19
|
+
import { Button, ScrollView, Stack, type ScrollViewBars } from '@motifx-community/ui';
|
|
20
|
+
|
|
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
|
+
const MODES: ScrollViewBars[] = ['onScroll', 'onHover', 'always', 'never'];
|
|
23
|
+
|
|
24
|
+
/** A box that scrolls, its bars shown as told; moved programmatically to a line and back to the top. */
|
|
25
|
+
export default function Bars() {
|
|
26
|
+
const s = reactive({ bars: 'onScroll' as ScrollViewBars, top: 0 });
|
|
27
|
+
let view!: ScrollView;
|
|
28
|
+
return (
|
|
29
|
+
<Stack gap="md" style="inline-size: 100%">
|
|
30
|
+
<Stack orientation="horizontal" wrap align="center">
|
|
31
|
+
{MODES.map(mode => (
|
|
32
|
+
<Button key={mode} text={mode} size="sm" variant={() => (s.bars === mode ? 'solid' : 'outline')} onclick={() => (s.bars = mode)} />
|
|
33
|
+
))}
|
|
34
|
+
<Button text="Line 20" variant="outline" size="sm" onclick={() => view.scrollToElement(view.content.element.querySelectorAll('p')[19], true)} />
|
|
35
|
+
<Button text="Top" variant="outline" size="sm" onclick={() => view.scrollTo(0, true)} />
|
|
36
|
+
<output class="sv-top">{() => `scrollTop: ${Math.round(s.top)}`}</output>
|
|
37
|
+
</Stack>
|
|
38
|
+
<ScrollView ref={(v: ScrollView) => (view = v)} label="Long text" class="sv-text" showScrollbar={() => s.bars} style="block-size: 12rem" onScrolled={e => (s.top = e.top)}>
|
|
39
|
+
{LINES.map(line => (
|
|
40
|
+
<p key={line}>{line}</p>
|
|
41
|
+
))}
|
|
42
|
+
</ScrollView>
|
|
43
|
+
</Stack>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Pull to refresh
|
|
49
|
+
|
|
50
|
+
With `pullToRefresh`, the content pulled down from its top asks `onPullDown`. Set `promise` (or call `release()`) and the panel goes when the work is done.
|
|
51
|
+
|
|
52
|
+
```tsx
|
|
53
|
+
import { reactive } from '@motifx/core';
|
|
54
|
+
import { Panel, ScrollView, Stack } from '@motifx-community/ui';
|
|
55
|
+
|
|
56
|
+
/** Pulled down from the top, the list asks for what is new and shows the panel until the promise settles. */
|
|
57
|
+
export default function Pull() {
|
|
58
|
+
const s = reactive({ notes: ['Welcome aboard', 'Your plan was renewed', 'A new comment on "Roadmap"'], count: 0 });
|
|
59
|
+
const reload = () =>
|
|
60
|
+
new Promise<void>(resolve =>
|
|
61
|
+
setTimeout(() => {
|
|
62
|
+
s.count++;
|
|
63
|
+
s.notes = [`Fresh note ${s.count}`, ...s.notes];
|
|
64
|
+
resolve();
|
|
65
|
+
}, 1200)
|
|
66
|
+
);
|
|
67
|
+
return (
|
|
68
|
+
<Stack gap="sm" style="inline-size: 100%">
|
|
69
|
+
<span>Drag the list down from its top (a finger, or the mouse) and let go.</span>
|
|
70
|
+
<ScrollView label="Notes" class="sv-notes" pullToRefresh onPullDown={e => (e.promise = reload())} style="block-size: 12rem">
|
|
71
|
+
{s.notes.map(note => (
|
|
72
|
+
<Panel key={note} variant="outline" padding="sm">
|
|
73
|
+
{note}
|
|
74
|
+
</Panel>
|
|
75
|
+
))}
|
|
76
|
+
</ScrollView>
|
|
77
|
+
</Stack>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## Load more near the end
|
|
83
|
+
|
|
84
|
+
With `loadOnReachBottom`, a scroll within `reachBottomOffset` of the end asks `onReachBottom` once; `release()` lets the next reach ask again, `release(true)` says there is no more. Content that does not fill the box asks at once.
|
|
85
|
+
|
|
86
|
+
```tsx
|
|
87
|
+
import { reactive } from '@motifx/core';
|
|
88
|
+
import { Panel, ScrollView, Stack } from '@motifx-community/ui';
|
|
89
|
+
|
|
90
|
+
const TOTAL = 60;
|
|
91
|
+
const PAGE = 15;
|
|
92
|
+
|
|
93
|
+
// A page of rows, as a server would send them.
|
|
94
|
+
const fetchRows = (from: number) =>
|
|
95
|
+
new Promise<string[]>(resolve => setTimeout(() => resolve(Array.from({ length: Math.min(PAGE, TOTAL - from) }, (_, i) => `Order #${1000 + from + i}`)), 800));
|
|
96
|
+
|
|
97
|
+
/** Near the end the view asks for more; the indicator stays until the rows are in, and `release(true)` ends it for good when there is no more. */
|
|
98
|
+
export default function More() {
|
|
99
|
+
const s = reactive({ rows: [] as string[] });
|
|
100
|
+
const more = () =>
|
|
101
|
+
fetchRows(s.rows.length).then(rows => {
|
|
102
|
+
s.rows = [...s.rows, ...rows];
|
|
103
|
+
return s.rows.length >= TOTAL;
|
|
104
|
+
});
|
|
105
|
+
return (
|
|
106
|
+
<Stack gap="sm" style="inline-size: 100%">
|
|
107
|
+
<output class="sv-more-told">{() => (s.rows.length >= TOTAL ? `All ${TOTAL} orders are in.` : `${s.rows.length} of ${TOTAL} orders`)}</output>
|
|
108
|
+
<ScrollView label="Orders" class="sv-orders" loadOnReachBottom reachBottomOffset={80} onReachBottom={e => more().then(done => e.release(done))} style="block-size: 14rem">
|
|
109
|
+
{s.rows.map(row => (
|
|
110
|
+
<Panel key={row} variant="outline" padding="sm">
|
|
111
|
+
{row}
|
|
112
|
+
</Panel>
|
|
113
|
+
))}
|
|
114
|
+
</ScrollView>
|
|
115
|
+
</Stack>
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Behaviour
|
|
121
|
+
|
|
122
|
+
| Topic | How |
|
|
123
|
+
| --- | --- |
|
|
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
|
+
| `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
|
+
| `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
|
+
| `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. |
|
|
128
|
+
| `Texts` | The kit’s, in the kit language, unless the text props say otherwise. |
|
|
129
|
+
|
|
130
|
+
## Accessibility
|
|
131
|
+
|
|
132
|
+
| Topic | How |
|
|
133
|
+
| --- | --- |
|
|
134
|
+
| `Region` | A focusable box named by `label`; the arrow keys, Page Up/Down, Home and End scroll it as the browser does. |
|
|
135
|
+
| `Panels` | Live regions: “Refreshing…” and “Loading…” are read when they appear. |
|
|
136
|
+
| `Spinners` | Decorative; the texts say what is going on. |
|
|
137
|
+
| `Motion` | A finger that pulls does not scroll the page; a finger that scrolls does not pull. |
|
|
138
|
+
|
|
139
|
+
## Styling
|
|
140
|
+
|
|
141
|
+
| Hook | What it is |
|
|
142
|
+
| --- | --- |
|
|
143
|
+
| `.mx-scroll-view` | The box. `data-direction`, `data-bars`, `data-scrolling` while the content moves, `data-pull` when pulling is on, `data-pulling` during a pull, `data-pull-state` (`pull`, `release`, `refreshing`), `data-loading`. |
|
|
144
|
+
| `.mx-scroll-view__content` | What holds the children; it moves down during a pull. |
|
|
145
|
+
| `.mx-scroll-view__pull, .mx-scroll-view__pull-text, .mx-scroll-view__pull-spinner` | The panel above the content, its text and the kit’s spinner. |
|
|
146
|
+
| `.mx-scroll-view__bottom, .mx-scroll-view__bottom-text, .mx-scroll-view__bottom-spinner` | The panel under the content while more loads. |
|
|
147
|
+
|
|
148
|
+
### Component tokens
|
|
149
|
+
|
|
150
|
+
| Token | What it sets |
|
|
151
|
+
| --- | --- |
|
|
152
|
+
| `scroll-view.box` | Unit: the box (`focus`). |
|
|
153
|
+
| `scroll-view.pull, .pull-text, .bottom, .bottom-text` | Units: the two panels (the pull one `release` and `refreshing`) and their texts. |
|
|
154
|
+
| `scroll-view.panel-height, .panel-gap` | The panels’ height; the space between a panel’s spinner and its text. |
|
|
155
|
+
|
|
156
|
+
## API reference
|
|
157
|
+
|
|
158
|
+
### Props
|
|
159
|
+
|
|
160
|
+
| Prop | Type | Default | Description |
|
|
161
|
+
| --- | --- | --- | --- |
|
|
162
|
+
| `direction` | `Bind<ScrollViewDirection>` | `'vertical'` | `vertical`, `horizontal` or `both`: which way the content scrolls. |
|
|
163
|
+
| `showScrollbar` | `Bind<ScrollViewBars>` | `'onScroll'` | When the bars show: `onScroll` while scrolling, `onHover` while the pointer is over the view, `always`, `never`. |
|
|
164
|
+
| `pullToRefresh` | `Bind<boolean>` | `false` | Pulling the content down from its top asks `onPullDown` for what is new. |
|
|
165
|
+
| `loadOnReachBottom` | `Bind<boolean>` | `false` | Scrolling near the end asks `onReachBottom` for more; so does content that does not reach the end. |
|
|
166
|
+
| `reachBottomOffset` | `Bind<number>` | `100` | Pixels before the end at which `onReachBottom` is asked. |
|
|
167
|
+
| `pullDownText, releaseText, refreshingText` | `Bind<string>` | the kit’s texts | The pull panel’s texts: while pulling, once far enough, while refreshing. |
|
|
168
|
+
| `reachBottomText` | `Bind<string>` | the kit’s “Loading…” | The text under the content while more loads. |
|
|
169
|
+
| `label` | `Bind<string>` | `''` | What screen readers call the scrolling region. |
|
|
170
|
+
|
|
171
|
+
### Events, properties and methods
|
|
172
|
+
|
|
173
|
+
| Member | Kind | Description |
|
|
174
|
+
| --- | --- | --- |
|
|
175
|
+
| `onPullDown` | event | The content was pulled down and let go. Load what is new, then `release()`, or set `promise` and the panel goes when it settles. |
|
|
176
|
+
| `onReachBottom` | event | The content was scrolled near its end. Load more, then `release()`; `release(true)` says there is no more and the view stops asking. A `promise` releases too. |
|
|
177
|
+
| `onScrolled` | event | The position changed: `top`, `left`. |
|
|
178
|
+
| `scrollTo(where, smooth?)` | `void` | To a top, or `{ top, left }`; `smooth` animates. |
|
|
179
|
+
| `scrollBy({ top, left }, smooth?)` | `void` | By a distance. |
|
|
180
|
+
| `scrollToElement(target, smooth?)` | `void` | Brings an element (or a component) of the content into view. |
|
|
181
|
+
| `refresh(), release()` | `void` | Starts a refresh as a pull would; ends it. |
|
|
182
|
+
| `loadMore(), update()` | `boolean` / `void` | Asks for more now; looks at the position again after the content changed. |
|
|
183
|
+
| `scrollTop, scrollLeft` | read-only | Where the content stands. |
|
|
184
|
+
| `isRefreshing, isLoading` | read-only | A refresh or a loading is going on. |
|
|
185
|
+
| `content` | read-only | The element that holds the children, between the two panels. |
|
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)} />
|
|
@@ -247,7 +247,7 @@ The names of the two thumbs of a range come from `uiLocale.strings` (`minimum`,
|
|
|
247
247
|
|
|
248
248
|
```tsx
|
|
249
249
|
import { reactive } from '@motifx/core';
|
|
250
|
-
import { Button,
|
|
250
|
+
import { Button, Slider, uiLocale } from '@motifx-community/ui';
|
|
251
251
|
import { kitTexts } from '../../../shared/kit-texts';
|
|
252
252
|
|
|
253
253
|
/** Switches the names of the thumbs; the price slider writes its numbers in the chosen language. */
|
|
@@ -255,7 +255,7 @@ export default function Localization() {
|
|
|
255
255
|
const s = reactive({ lang: 'en' });
|
|
256
256
|
const toggle = () => {
|
|
257
257
|
s.lang = s.lang === 'en' ? 'tr' : 'en';
|
|
258
|
-
uiLocale.
|
|
258
|
+
void uiLocale.use(s.lang);
|
|
259
259
|
};
|
|
260
260
|
return (
|
|
261
261
|
<>
|
package/docs/sortable.md
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
# Sortable
|
|
2
|
+
|
|
3
|
+
> Navigation · @motifx-community/ui 0.1.0-beta.3
|
|
4
|
+
|
|
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
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Sortable } from '@motifx-community/ui';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Children as items
|
|
14
|
+
|
|
15
|
+
The JSX children are the items. Drag one, or focus it and press Ctrl + Down; `onReorder` says from where to where, and the app reorders its own data.
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { reactive } from '@motifx/core';
|
|
19
|
+
import { Panel, Sortable, Stack } from '@motifx-community/ui';
|
|
20
|
+
|
|
21
|
+
/** Rows put in order by dragging, or with Ctrl + an arrow on the focused row; the app reorders its data when told. */
|
|
22
|
+
export default function Basic() {
|
|
23
|
+
const s = reactive({ steps: ['Collect the order', 'Pack it', 'Print the label', 'Hand it over'], told: '' });
|
|
24
|
+
return (
|
|
25
|
+
<Stack gap="md" style="inline-size: 100%">
|
|
26
|
+
<Sortable
|
|
27
|
+
label="Steps"
|
|
28
|
+
class="so-steps"
|
|
29
|
+
onReorder={e => {
|
|
30
|
+
const next = s.steps.slice();
|
|
31
|
+
next.splice(e.toIndex, 0, ...next.splice(e.fromIndex, 1));
|
|
32
|
+
s.steps = next;
|
|
33
|
+
s.told = `"${next[e.toIndex]}" is step ${e.toIndex + 1} now`;
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
36
|
+
<Panel variant="outline" padding="sm">
|
|
37
|
+
Collect the order
|
|
38
|
+
</Panel>
|
|
39
|
+
<Panel variant="outline" padding="sm">
|
|
40
|
+
Pack it
|
|
41
|
+
</Panel>
|
|
42
|
+
<Panel variant="outline" padding="sm">
|
|
43
|
+
Print the label
|
|
44
|
+
</Panel>
|
|
45
|
+
<Panel variant="outline" padding="sm">
|
|
46
|
+
Hand it over
|
|
47
|
+
</Panel>
|
|
48
|
+
</Sortable>
|
|
49
|
+
<output class="so-told">{() => s.told || `Order: ${s.steps.join(' → ')}`}</output>
|
|
50
|
+
</Stack>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Items from data, across lists
|
|
56
|
+
|
|
57
|
+
`items` with an `itemTemplate` draws the rows from your data and keeps each row as the order changes. Two sortables of one `group` take each other’s items: `onRemove` and `onAdd` tell both sides, and each list draws its array again.
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import { reactive } from '@motifx/core';
|
|
61
|
+
import { Panel, Sortable, Stack } from '@motifx-community/ui';
|
|
62
|
+
|
|
63
|
+
interface Task {
|
|
64
|
+
id: number;
|
|
65
|
+
title: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// A task as a row.
|
|
69
|
+
const row = (task: Task) => {
|
|
70
|
+
const panel = new Panel({ variant: 'outline', padding: 'sm' });
|
|
71
|
+
panel.element.textContent = task.title;
|
|
72
|
+
return panel;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
/** Two lists of one group take each other's items; each list draws its own data and the app moves the task between arrays when told. */
|
|
76
|
+
export default function Groups() {
|
|
77
|
+
const s = reactive({
|
|
78
|
+
todo: [{ id: 1, title: 'Write the brief' }, { id: 2, title: 'Book the room' }, { id: 3, title: 'Send the invites' }] as Task[],
|
|
79
|
+
done: [{ id: 4, title: 'Pick the date' }] as Task[]
|
|
80
|
+
});
|
|
81
|
+
const reorder = (key: 'todo' | 'done') => (e: { fromIndex: number; toIndex: number }) => {
|
|
82
|
+
const next = s[key].slice();
|
|
83
|
+
next.splice(e.toIndex, 0, ...next.splice(e.fromIndex, 1));
|
|
84
|
+
s[key] = next;
|
|
85
|
+
};
|
|
86
|
+
// The item leaves one array when removed and joins the other when added: the lists draw themselves again.
|
|
87
|
+
const remove = (key: 'todo' | 'done') => (e: { fromIndex: number }) => (s[key] = s[key].filter((_, i) => i !== e.fromIndex));
|
|
88
|
+
const add = (key: 'todo' | 'done') => (e: { item: Task; toIndex: number }) => {
|
|
89
|
+
const next = s[key].slice();
|
|
90
|
+
next.splice(e.toIndex, 0, e.item);
|
|
91
|
+
s[key] = next;
|
|
92
|
+
};
|
|
93
|
+
return (
|
|
94
|
+
<Stack orientation="horizontal" gap="lg" style="inline-size: 100%">
|
|
95
|
+
<Stack gap="sm" grow>
|
|
96
|
+
<strong>To do</strong>
|
|
97
|
+
<Sortable<Task> label="To do" class="so-todo" group="tasks" items={() => s.todo} itemTemplate={row} onReorder={reorder('todo')} onRemove={remove('todo')} onAdd={add('todo')} style="min-block-size: 8rem" />
|
|
98
|
+
</Stack>
|
|
99
|
+
<Stack gap="sm" grow>
|
|
100
|
+
<strong>Done</strong>
|
|
101
|
+
<Sortable<Task> label="Done" class="so-done" group="tasks" items={() => s.done} itemTemplate={row} onReorder={reorder('done')} onRemove={remove('done')} onAdd={add('done')} style="min-block-size: 8rem" />
|
|
102
|
+
</Stack>
|
|
103
|
+
</Stack>
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## A handle, side by side, a refused drag
|
|
109
|
+
|
|
110
|
+
```tsx
|
|
111
|
+
import { reactive } from '@motifx/core';
|
|
112
|
+
import { Chip, Sortable, Stack } from '@motifx-community/ui';
|
|
113
|
+
|
|
114
|
+
/** Chips side by side, moved by their handle only (the dots), with Ctrl + Left / Right on the handle; a drag may be refused. */
|
|
115
|
+
export default function Handle() {
|
|
116
|
+
const s = reactive({ tags: ['Design', 'Build', 'Test', 'Ship', 'Locked'], told: '' });
|
|
117
|
+
return (
|
|
118
|
+
<Stack gap="md" style="inline-size: 100%">
|
|
119
|
+
<Sortable
|
|
120
|
+
label="Tags"
|
|
121
|
+
class="so-tags"
|
|
122
|
+
orientation="horizontal"
|
|
123
|
+
handle=".so-grip"
|
|
124
|
+
items={() => s.tags}
|
|
125
|
+
itemTemplate={tag => {
|
|
126
|
+
const chip = new Chip({ text: tag });
|
|
127
|
+
const grip = document.createElement('span');
|
|
128
|
+
grip.className = 'mx-glyph so-grip';
|
|
129
|
+
grip.dataset.icon = 'drag-dots';
|
|
130
|
+
grip.setAttribute('aria-label', `Move ${tag}`);
|
|
131
|
+
chip.element.prepend(grip);
|
|
132
|
+
return chip;
|
|
133
|
+
}}
|
|
134
|
+
onDragStarting={e => {
|
|
135
|
+
if (e.item === 'Locked') {
|
|
136
|
+
e.cancel = true;
|
|
137
|
+
s.told = 'Locked stays where it is.';
|
|
138
|
+
}
|
|
139
|
+
}}
|
|
140
|
+
onReorder={e => {
|
|
141
|
+
const next = s.tags.slice();
|
|
142
|
+
next.splice(e.toIndex, 0, ...next.splice(e.fromIndex, 1));
|
|
143
|
+
s.tags = next;
|
|
144
|
+
s.told = next.join(', ');
|
|
145
|
+
}}
|
|
146
|
+
/>
|
|
147
|
+
<output class="so-tags-told">{() => s.told}</output>
|
|
148
|
+
</Stack>
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Behaviour
|
|
154
|
+
|
|
155
|
+
| Topic | How |
|
|
156
|
+
| --- | --- |
|
|
157
|
+
| `Dragging` | With the pointer after a few pixels; with a finger after a long press (a finger that moves before that scrolls). A copy follows the pointer, the item stays faint in its place, a line shows where it would land; the list scrolls near its edges. |
|
|
158
|
+
| `Dropping` | The item’s element moves there at once and `onReorder` says from where to where: your data is yours to reorder. Across sortables of a group, `onRemove` and `onAdd` say the same on both sides. |
|
|
159
|
+
| `Items from data` | With `items`, each item keeps its component as the order changes (the rows are keyed by item): reordering your array moves the rows, no row is made again. |
|
|
160
|
+
| `Keys` | The focused item (its handle when there is one) takes Ctrl + Up / Down (Left / Right side by side), Ctrl + Home / End; each move is told to `onReorder` and read out. |
|
|
161
|
+
| `Escape` | Cancels a drag; nothing moves. |
|
|
162
|
+
|
|
163
|
+
## Accessibility
|
|
164
|
+
|
|
165
|
+
| Topic | How |
|
|
166
|
+
| --- | --- |
|
|
167
|
+
| `List` | A `group` named by `label`; the items are whatever you put in it. |
|
|
168
|
+
| `Items` | One Tab stop that moves between the items with the keys; an item with a focusable part of its own keeps that. A handle is a button named by you. |
|
|
169
|
+
| `Moves` | Each move by the keys is read out: “Moved to 2 of 5”. |
|
|
170
|
+
|
|
171
|
+
## Styling
|
|
172
|
+
|
|
173
|
+
| Hook | What it is |
|
|
174
|
+
| --- | --- |
|
|
175
|
+
| `.mx-sortable` | The list. `data-orientation`, `data-sortable`, `data-drop-target` while a dragged item may land here. |
|
|
176
|
+
| `.mx-sortable__item` | Each item. `data-dragging` on the one being dragged. |
|
|
177
|
+
| `.mx-sortable__line` | The line where a drop would land. |
|
|
178
|
+
| `.mx-sortable__ghost` | The copy after the pointer. |
|
|
179
|
+
|
|
180
|
+
### Component tokens
|
|
181
|
+
|
|
182
|
+
| Token | What it sets |
|
|
183
|
+
| --- | --- |
|
|
184
|
+
| `sortable.container, .item, .line, .ghost` | Units: the list (`target`), an item (`sortable`, `dragging`, `focus`), the line (its thickness and colour; standing in a horizontal list), the copy. |
|
|
185
|
+
| `sortable.gap` | Between the items. |
|
|
186
|
+
|
|
187
|
+
## API reference
|
|
188
|
+
|
|
189
|
+
### Props
|
|
190
|
+
|
|
191
|
+
| Prop | Type | Default | Description |
|
|
192
|
+
| --- | --- | --- | --- |
|
|
193
|
+
| `items` | `Bind<readonly T[]>` | — | The items, each drawn with `itemTemplate`; without them the JSX children are the items. |
|
|
194
|
+
| `itemTemplate` | `(item, index) => ComponentBase` | the item’s text | Makes an item’s component. A function, so it is not bound like the other props. |
|
|
195
|
+
| `handle` | `Bind<string \| null>` | `null` | A selector inside an item that takes the drag and the keys; without one the whole item does. |
|
|
196
|
+
| `group` | `Bind<string \| null>` | `null` | Sortables of one group take each other’s items. |
|
|
197
|
+
| `allowReordering` | `Bind<boolean>` | `true` | The items can be moved; `false` leaves them as they are. |
|
|
198
|
+
| `orientation` | `Bind<SortableOrientation>` | `'vertical'` | `vertical` or `horizontal`: the drop line and the move keys follow. |
|
|
199
|
+
| `label` | `Bind<string>` | `''` | What screen readers call the list. |
|
|
200
|
+
|
|
201
|
+
### Events, properties and methods
|
|
202
|
+
|
|
203
|
+
| Member | Kind | Description |
|
|
204
|
+
| --- | --- | --- |
|
|
205
|
+
| `onDragStarting` | event | A drag (or a move by the keys) is about to start (`item`, `fromIndex`); `cancel = true` refuses. |
|
|
206
|
+
| `onDragChanging` | event | The place it would land changed (`to`, `toIndex`); `cancel = true` refuses that place. |
|
|
207
|
+
| `onDragEnding` | event | About to drop; `cancel = true` leaves everything as it was. |
|
|
208
|
+
| `onReorder` | event | An item moved within this sortable (`fromIndex`, `toIndex`, `item`), by a drop or the keys. Reorder your data here. |
|
|
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 programmatically as a drop would, telling `onReorder`. |
|
|
211
|
+
| `elements` | read-only | The items’ elements, in order. |
|
|
212
|
+
| `isDragging` | read-only | An item is being dragged. |
|
|
213
|
+
| `refresh()` | `void` | Reads the items again after they were changed in place. |
|