@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/pagination.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Pagination
|
|
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
|
Moving through pages of items: the sizes to choose from, where the page stands, the steps and a button per page around the current one. It turns compact when it does not fit. It looks and works as the grid’s pager.
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ Moving through pages of items: the sizes to choose from, where the page stands,
|
|
|
10
10
|
import { Pagination } from '@motifx-community/ui';
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Declarative and programmatic
|
|
14
14
|
|
|
15
15
|
`x-model` binds the page; `onPageChanged` tells the page size too, so the data can be loaded for both.
|
|
16
16
|
|
|
@@ -18,8 +18,8 @@ import { Pagination } from '@motifx-community/ui';
|
|
|
18
18
|
import { reactive } from '@motifx/core';
|
|
19
19
|
import { Pagination, Stack } from '@motifx-community/ui';
|
|
20
20
|
|
|
21
|
-
/** The page bound with `x-model`, the sizes to choose from; one made with `new`
|
|
22
|
-
export default function
|
|
21
|
+
/** The page bound with `x-model`, the sizes to choose from; one made with `new` programmatically. */
|
|
22
|
+
export default function Programmatic() {
|
|
23
23
|
const s = reactive({ page: 3, size: 25 });
|
|
24
24
|
const coded = new Pagination({ label: 'Pages made in code', total: 40, pageSize: 10, mode: 'full', showInfo: false });
|
|
25
25
|
|
package/docs/popover.md
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# Popover
|
|
2
|
+
|
|
3
|
+
> Feedback · @motifx-community/ui 0.1.0-beta.3
|
|
4
|
+
|
|
5
|
+
Content next to the element it belongs to: a title, a close button, a form, a card. It opens on a press or while the pointer rests on its target, follows it, and points at it with an arrow where the design language has one.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Popover } from '@motifx-community/ui';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Declarative and programmatic
|
|
14
|
+
|
|
15
|
+
The JSX children are the content; `target` names the element or component it opens next to. Programmatically, `content` gives the content and `open()`, `close()` and `toggle()` move it; `value` and `x-model` say whether it is open.
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { reactive } from '@motifx/core';
|
|
19
|
+
import { Button, Popover, Stack, TextBox } from '@motifx-community/ui';
|
|
20
|
+
|
|
21
|
+
/** A popover with a title, a close button and a small form; one made programmatically for a plain element. */
|
|
22
|
+
export default function Basic() {
|
|
23
|
+
const s = reactive({ open: false, name: 'Ada', saved: '' });
|
|
24
|
+
let button!: Button;
|
|
25
|
+
let link!: HTMLElement;
|
|
26
|
+
const coded = new Popover({ title: 'Programmatically', content: new Button({ text: 'OK', variant: 'outline', onclick: () => coded.close() }) });
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<Stack orientation="horizontal" wrap align="center">
|
|
30
|
+
<Button ref={(b: Button) => (button = b)} text="Rename" variant="outline" />
|
|
31
|
+
<Popover target={() => button} title="New name" showClose x-model={() => s.open}>
|
|
32
|
+
<Stack orientation="horizontal" wrap align="center">
|
|
33
|
+
<TextBox label="Name" x-model={() => s.name} />
|
|
34
|
+
<Button text="Save" tone="accent" onclick={() => ((s.saved = s.name), (s.open = false))} />
|
|
35
|
+
</Stack>
|
|
36
|
+
</Popover>
|
|
37
|
+
<output class="po-saved">{() => (s.saved ? `Saved: ${s.saved}` : s.open ? 'Open' : 'Closed')}</output>
|
|
38
|
+
<a
|
|
39
|
+
href="#from-code"
|
|
40
|
+
class="po-link"
|
|
41
|
+
ref={(c: { element: HTMLElement }) => (link = c.element)}
|
|
42
|
+
onclick={(e: Event) => {
|
|
43
|
+
e.preventDefault();
|
|
44
|
+
coded.target = link;
|
|
45
|
+
coded.toggle();
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
A popover programmatically
|
|
49
|
+
</a>
|
|
50
|
+
</Stack>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## While the pointer rests
|
|
56
|
+
|
|
57
|
+
`showOn: 'hover'` opens it after `delay` while the pointer rests on the target, and when the target has keyboard focus; the pointer may move onto the popover. It closes `hideDelay` after the pointer leaves both.
|
|
58
|
+
|
|
59
|
+
```tsx
|
|
60
|
+
import { Avatar, Popover, Stack } from '@motifx-community/ui';
|
|
61
|
+
|
|
62
|
+
/** A card that opens while the pointer rests on a name, or when the name has keyboard focus. */
|
|
63
|
+
export default function Hover() {
|
|
64
|
+
let name!: HTMLElement;
|
|
65
|
+
return (
|
|
66
|
+
<Stack orientation="horizontal" wrap align="center">
|
|
67
|
+
<span>
|
|
68
|
+
Reviewed by{' '}
|
|
69
|
+
<a href="#ada" class="po-person" ref={(c: { element: HTMLElement }) => (name = c.element)} onclick={(e: Event) => e.preventDefault()}>
|
|
70
|
+
Ada Lovelace
|
|
71
|
+
</a>
|
|
72
|
+
</span>
|
|
73
|
+
<Popover target={() => name} showOn="hover" placement="top" label="Ada Lovelace">
|
|
74
|
+
<Stack orientation="horizontal" align="center">
|
|
75
|
+
<Avatar name="Ada Lovelace" size="lg" />
|
|
76
|
+
<Stack>
|
|
77
|
+
<strong>Ada Lovelace</strong>
|
|
78
|
+
<span>Analytical Engine, Programs</span>
|
|
79
|
+
</Stack>
|
|
80
|
+
</Stack>
|
|
81
|
+
</Popover>
|
|
82
|
+
</Stack>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Placements, the arrow and a width
|
|
88
|
+
|
|
89
|
+
```tsx
|
|
90
|
+
import { reactive } from '@motifx/core';
|
|
91
|
+
import { Button, CheckBox, Popover, Stack, type PopupPlacement } from '@motifx-community/ui';
|
|
92
|
+
|
|
93
|
+
const PLACEMENTS: PopupPlacement[] = ['top-start', 'top', 'top-end', 'start', 'end', 'bottom-start', 'bottom', 'bottom-end'];
|
|
94
|
+
|
|
95
|
+
/** Every placement; the arrow where the language draws one, and a width of its own. */
|
|
96
|
+
export default function Placements() {
|
|
97
|
+
const s = reactive({ arrow: true, placement: 'bottom' as PopupPlacement });
|
|
98
|
+
let button!: Button;
|
|
99
|
+
return (
|
|
100
|
+
<Stack gap="md">
|
|
101
|
+
<Stack orientation="horizontal" wrap align="center">
|
|
102
|
+
{PLACEMENTS.map(placement => (
|
|
103
|
+
<Button key={placement} text={placement} variant={() => (s.placement === placement ? 'solid' : 'outline')} size="sm" onclick={() => (s.placement = placement)} />
|
|
104
|
+
))}
|
|
105
|
+
<CheckBox label="Arrow" x-model={() => s.arrow} />
|
|
106
|
+
</Stack>
|
|
107
|
+
<div style="display: flex; justify-content: center; padding: 3rem 0">
|
|
108
|
+
<Button ref={(b: Button) => (button = b)} text="Open" />
|
|
109
|
+
</div>
|
|
110
|
+
<Popover target={() => button} placement={() => s.placement} arrow={() => s.arrow} width="16rem" label="Placement">
|
|
111
|
+
<p>{() => `Placed at ${s.placement}; it moves to the other side when there is no room.`}</p>
|
|
112
|
+
</Popover>
|
|
113
|
+
</Stack>
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Keeping it open
|
|
119
|
+
|
|
120
|
+
```tsx
|
|
121
|
+
import { reactive } from '@motifx/core';
|
|
122
|
+
import { Button, Popover, Stack, TextArea } from '@motifx-community/ui';
|
|
123
|
+
|
|
124
|
+
/** A press outside does not close it, and onClosing keeps it open while there is unsaved text; Escape and the button close it. */
|
|
125
|
+
export default function Events() {
|
|
126
|
+
const s = reactive({ note: '', told: '' });
|
|
127
|
+
let button!: Button;
|
|
128
|
+
let pop!: Popover;
|
|
129
|
+
return (
|
|
130
|
+
<Stack orientation="horizontal" wrap align="center">
|
|
131
|
+
<Button ref={(b: Button) => (button = b)} text="Add a note" variant="outline" />
|
|
132
|
+
<Popover
|
|
133
|
+
ref={(p: Popover) => (pop = p)}
|
|
134
|
+
target={() => button}
|
|
135
|
+
title="Note"
|
|
136
|
+
closeOnOutside={false}
|
|
137
|
+
onClosing={e => {
|
|
138
|
+
if (e.reason === 'escape' && s.note.trim() !== '') {
|
|
139
|
+
e.cancel = true;
|
|
140
|
+
s.told = 'Save or clear the note first.';
|
|
141
|
+
}
|
|
142
|
+
}}
|
|
143
|
+
onClosed={reason => (s.told = `Closed: ${String(reason)}`)}
|
|
144
|
+
>
|
|
145
|
+
<Stack gap="sm">
|
|
146
|
+
<TextArea label="Text" x-model={() => s.note} rows={3} />
|
|
147
|
+
<Button text="Save" tone="accent" onclick={() => ((s.note = ''), pop.close())} />
|
|
148
|
+
</Stack>
|
|
149
|
+
</Popover>
|
|
150
|
+
<output class="po-told">{() => s.told}</output>
|
|
151
|
+
</Stack>
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Behaviour
|
|
157
|
+
|
|
158
|
+
| Topic | How |
|
|
159
|
+
| --- | --- |
|
|
160
|
+
| `Opening` | By a press on the target, by the pointer resting on it (`hover`), or programmatically. It appears in the browser’s top layer, next to the target, and follows it while the page scrolls. |
|
|
161
|
+
| `Focus` | Opened by a press or programmatically, focus moves to the first focusable part inside, else to the popover; it goes back to the target when the popover closes. Opened by hover, focus stays where it is. |
|
|
162
|
+
| `Closing` | Escape, a press outside it and its target, focus leaving both (Tab out), the close button, the target pressed again, or the pointer leaving both (`hover`). `onClosing` may keep it open. |
|
|
163
|
+
| `Placement` | `placement` names the side and the alignment, as for the kit’s popups; without room on that side it opens on the other. |
|
|
164
|
+
| `Where it lives` | Made programmatically, it goes into the nearest container of its target that can hold it, so it stays in the target’s window and landmark. |
|
|
165
|
+
|
|
166
|
+
## Accessibility
|
|
167
|
+
|
|
168
|
+
| Topic | How |
|
|
169
|
+
| --- | --- |
|
|
170
|
+
| `Role` | `dialog`, named by its title, else by `label`: give it one. |
|
|
171
|
+
| `Target` | `aria-controls` and `aria-expanded`; `aria-haspopup="dialog"` when a press opens it. |
|
|
172
|
+
| `Keyboard` | Tab moves through the content and out (which closes it); Escape closes and returns focus. A `hover` popover opens on keyboard focus too. |
|
|
173
|
+
| `Arrow` | Decorative. |
|
|
174
|
+
|
|
175
|
+
## Styling
|
|
176
|
+
|
|
177
|
+
| Hook | What it is |
|
|
178
|
+
| --- | --- |
|
|
179
|
+
| `.mx-popover` | The popover. `data-side` (`top`, `bottom`, `start`, `end`), `data-arrow`. |
|
|
180
|
+
| `.mx-popover__arrow` | The arrow. |
|
|
181
|
+
| `.mx-popover__header, .mx-popover__title, .mx-popover__close` | The header, its title and the close button. |
|
|
182
|
+
| `.mx-popover__body` | The content. |
|
|
183
|
+
|
|
184
|
+
### Component tokens
|
|
185
|
+
|
|
186
|
+
| Token | What it sets |
|
|
187
|
+
| --- | --- |
|
|
188
|
+
| `popover.surface, .arrow, .header, .title, .body` | Units: the surface (`focus`), the arrow (`display`, `size`, its fill and frame), the header, the title and the body. |
|
|
189
|
+
| `popover.close` | Place: the close button’s look (`variant`). |
|
|
190
|
+
| `popover.offset, .enter-offset, .header-gap` | The gap to the target, how far it comes in as it appears, the space between title and close button. |
|
|
191
|
+
|
|
192
|
+
## API reference
|
|
193
|
+
|
|
194
|
+
### Props
|
|
195
|
+
|
|
196
|
+
| Prop | Type | Default | Description |
|
|
197
|
+
| --- | --- | --- | --- |
|
|
198
|
+
| `target` | `Bind<Element \| ComponentBase \| null>` | `null` | The element or component it opens next to. |
|
|
199
|
+
| `title` | `Bind<string>` | `''` | A title in the header. The same property as `text`. |
|
|
200
|
+
| `label` | `Bind<string>` | `''` | What screen readers call it when it has no title. |
|
|
201
|
+
| `content` | `Bind<ComponentBase \| null>` | `null` | Content programmatically, after the JSX children. |
|
|
202
|
+
| `showOn` | `Bind<PopoverShowOn>` | `'click'` | `click`: a press on the target toggles it; `hover`: the pointer resting on the target, or keyboard focus on it; `manual`: only code. |
|
|
203
|
+
| `placement` | `Bind<PopupPlacement>` | `'bottom'` | The side and the alignment; it opens on the other side when there is no room. |
|
|
204
|
+
| `arrow` | `Bind<boolean>` | `true` | An arrow towards the target, where the design language draws one. |
|
|
205
|
+
| `showClose` | `Bind<boolean>` | `false` | A close button in the header. |
|
|
206
|
+
| `width` | `Bind<string \| number \| null>` | `null` | A width of its own (a CSS length, or pixels). |
|
|
207
|
+
| `closeOnOutside` | `Bind<boolean>` | `true` | A press outside it and its target closes it. |
|
|
208
|
+
| `delay, hideDelay` | `Bind<number>` | `300`, `200` | Milliseconds the pointer rests on the target before it opens, and it stays after the pointer leaves both (`showOn: 'hover'`). |
|
|
209
|
+
| `value` | `Bind<boolean>` | `false` | Open or not; `x-model` binds it two-way. |
|
|
210
|
+
|
|
211
|
+
### Events, properties and methods
|
|
212
|
+
|
|
213
|
+
| Member | Kind | Description |
|
|
214
|
+
| --- | --- | --- |
|
|
215
|
+
| `onOpened` | event | It opened. |
|
|
216
|
+
| `onClosing` | event | About to close (`reason`); `cancel = true` keeps it open. |
|
|
217
|
+
| `onClosed` | event | It closed, with the reason: `escape`, `outside`, `focus`, `toggle`, `hover`, `close-button`, `code`. |
|
|
218
|
+
| `open(), close(reason?), toggle()` | `boolean` / `void` | Programmatically; `open()` is `false` without a target on the page or when disabled. |
|
|
219
|
+
| `place()` | `void` | Lines it up with its target again, after its content changed size. |
|
|
220
|
+
| `isOpen` | read-only | Whether it is open now. |
|
|
221
|
+
| `closeButton, body` | read-only | The close button (the kit’s) and the part that holds the content. |
|
package/docs/progress.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ProgressBar and Spinner
|
|
2
2
|
|
|
3
|
-
> Feedback · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Feedback · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
ProgressBar shows how far some work is, as a line or a circle, or that it runs when that is not known. Spinner says "busy, wait": a turning ring, alone or over a panel while it loads, shown only after a delay so quick work does not flash it.
|
|
6
6
|
|
|
@@ -10,16 +10,16 @@ ProgressBar shows how far some work is, as a line or a circle, or that it runs w
|
|
|
10
10
|
import { ProgressBar, Spinner, type ProgressTone } from '@motifx-community/ui';
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Declarative and programmatic
|
|
14
14
|
|
|
15
|
-
Every prop takes a value or a function; a function of a reactive object keeps the bar in step with the work. Created with `new`, the same properties are set
|
|
15
|
+
Every prop takes a value or a function; a function of a reactive object keeps the bar in step with the work. 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, ProgressBar, Stack } from '@motifx-community/ui';
|
|
20
20
|
|
|
21
|
-
/** A bar that follows an upload, and bars created with `new` and added
|
|
22
|
-
export default function
|
|
21
|
+
/** A bar that follows an upload, and bars created with `new` and added programmatically. */
|
|
22
|
+
export default function Programmatic() {
|
|
23
23
|
const s = reactive({ upload: 0, uploading: false });
|
|
24
24
|
let added = 0;
|
|
25
25
|
let host: Stack | null = null;
|
|
@@ -36,7 +36,7 @@ export default function FromCode() {
|
|
|
36
36
|
}, 120);
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
const
|
|
39
|
+
const addProgrammatic = () => {
|
|
40
40
|
const bar = new ProgressBar({ label: `Task ${++added}`, showValue: true, tone: 'success' });
|
|
41
41
|
bar.value = 25 * added;
|
|
42
42
|
host?.controls.add(bar);
|
|
@@ -47,7 +47,7 @@ export default function FromCode() {
|
|
|
47
47
|
<ProgressBar label="Uploading" value={() => s.upload} showValue stretch />
|
|
48
48
|
<Stack orientation="horizontal" wrap align="center">
|
|
49
49
|
<Button text="Upload" tone="accent" enabled={() => !s.uploading} onclick={upload} />
|
|
50
|
-
<Button text="Add a bar
|
|
50
|
+
<Button text="Add a bar programmatically" variant="outline" onclick={addProgrammatic} />
|
|
51
51
|
</Stack>
|
|
52
52
|
<Stack orientation="horizontal" wrap align="center" ref={(c: Stack) => (host = c)} />
|
|
53
53
|
</>
|
|
@@ -307,7 +307,7 @@ A bar or a spinner without a label is named `uiLocale.strings.loading`. The perc
|
|
|
307
307
|
|
|
308
308
|
```tsx
|
|
309
309
|
import { reactive } from '@motifx/core';
|
|
310
|
-
import { Button,
|
|
310
|
+
import { Button, ProgressBar, uiLocale } from '@motifx-community/ui';
|
|
311
311
|
import { kitTexts } from '../../../shared/kit-texts';
|
|
312
312
|
|
|
313
313
|
/** Switches the name of unlabelled bars and spinners, and the language the percent is written in. */
|
|
@@ -315,7 +315,7 @@ export default function Localization() {
|
|
|
315
315
|
const s = reactive({ lang: 'en' });
|
|
316
316
|
const toggle = () => {
|
|
317
317
|
s.lang = s.lang === 'en' ? 'tr' : 'en';
|
|
318
|
-
uiLocale.
|
|
318
|
+
void uiLocale.use(s.lang);
|
|
319
319
|
};
|
|
320
320
|
return (
|
|
321
321
|
<>
|
package/docs/radiogroup.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# RadioGroup
|
|
2
2
|
|
|
3
|
-
> Choice · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Choice · @motifx-community/ui 0.1.0-beta.3
|
|
4
4
|
|
|
5
5
|
A set of options of which one is chosen: from plain values, from your own objects or from a live list; one under the other, side by side or in columns; options that are disabled, hidden or carry a help line; one Tab stop and the arrow keys.
|
|
6
6
|
|
|
@@ -10,20 +10,20 @@ A set of options of which one is chosen: from plain values, from your own object
|
|
|
10
10
|
import { RadioGroup, type RadioItem } from '@motifx-community/ui';
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Declarative and programmatic
|
|
14
14
|
|
|
15
|
-
A plain value is its own text. `x-model` binds the chosen value two-way. Created with `new`, the same properties are set
|
|
15
|
+
A plain value is its own text. `x-model` binds the chosen 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, RadioGroup, Stack } from '@motifx-community/ui';
|
|
20
20
|
|
|
21
|
-
/** A group of plain values bound with x-model, and a group created with `new` and added
|
|
22
|
-
export default function
|
|
21
|
+
/** A group of plain values bound with x-model, and a group created with `new` and added programmatically. */
|
|
22
|
+
export default function Programmatic() {
|
|
23
23
|
const s = reactive({ size: 'M' as string | null, result: '' });
|
|
24
24
|
let host: Stack | null = null;
|
|
25
25
|
|
|
26
|
-
const
|
|
26
|
+
const addProgrammatic = () => {
|
|
27
27
|
const wrap = new RadioGroup<string>({ label: 'Gift wrap', orientation: 'horizontal', items: ['None', 'Paper', 'Box'], value: 'None' });
|
|
28
28
|
wrap.onValueChanged((e) => (s.result = `Gift wrap: ${e.value}`));
|
|
29
29
|
host?.controls.add(wrap);
|
|
@@ -34,7 +34,7 @@ export default function FromCode() {
|
|
|
34
34
|
<>
|
|
35
35
|
<RadioGroup label="&Size" items={['S', 'M', 'L', 'XL']} x-model={() => s.size} helpText={() => `Chosen: ${s.size ?? 'nothing'}`} />
|
|
36
36
|
<Stack orientation="horizontal" wrap align="center">
|
|
37
|
-
<Button text="Add a group
|
|
37
|
+
<Button text="Add a group programmatically" variant="outline" onclick={addProgrammatic} />
|
|
38
38
|
<output class="rg-result">{() => s.result}</output>
|
|
39
39
|
</Stack>
|
|
40
40
|
<Stack orientation="horizontal" wrap align="center" ref={(c: Stack) => (host = c)} />
|
package/docs/rating.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Rating
|
|
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 row of stars to give a score or to show one, whole or by halves. It is a field: label, help text, rules and `x-model` work as in every field.
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ A row of stars to give a score or to show one, whole or by halves. It is a field
|
|
|
10
10
|
import { Rating } from '@motifx-community/ui';
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
##
|
|
13
|
+
## Declarative and programmatic
|
|
14
14
|
|
|
15
15
|
Every prop takes a value or a function; `x-model` binds the score two-way. Under the pointer the stars show what a press would give.
|
|
16
16
|
|
|
@@ -18,8 +18,8 @@ Every prop takes a value or a function; `x-model` binds the score two-way. Under
|
|
|
18
18
|
import { reactive } from '@motifx/core';
|
|
19
19
|
import { Rating, Stack } from '@motifx-community/ui';
|
|
20
20
|
|
|
21
|
-
/** A rating bound with `x-model`, with a label and a help line like any field; one made with `new`
|
|
22
|
-
export default function
|
|
21
|
+
/** A rating bound with `x-model`, with a label and a help line like any field; one made with `new` programmatically. */
|
|
22
|
+
export default function Programmatic() {
|
|
23
23
|
const s = reactive({ stars: 3 as number | null });
|
|
24
24
|
const coded = new Rating({ label: 'Made in code', max: 10, value: 7 });
|
|
25
25
|
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# Resizable
|
|
2
|
+
|
|
3
|
+
> Navigation · @motifx-community/ui 0.1.0-beta.3
|
|
4
|
+
|
|
5
|
+
A box the user resizes from its sides and corners with the pointer, or with the arrow keys on the grip in its end corner. It keeps to its least and most sizes, stays inside an area when told, and can keep its shape.
|
|
6
|
+
|
|
7
|
+
## Import
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { Resizable } from '@motifx-community/ui';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Sides, corners and the grip
|
|
14
|
+
|
|
15
|
+
The JSX children are the content. `handles` says which sides and corners take the pointer (`all` by default); the grip in the end corner is the Tab stop, and the arrow keys change the size by `step`. `minWidth`, `minHeight`, `maxWidth` and `maxHeight` hold it. A box laid out by its position (`absolute`, `fixed`) also moves when a start or top side is dragged, so the far side stays; one in the flow only changes size.
|
|
16
|
+
|
|
17
|
+
```tsx
|
|
18
|
+
import { reactive } from '@motifx/core';
|
|
19
|
+
import { Panel, Resizable, Stack } from '@motifx-community/ui';
|
|
20
|
+
|
|
21
|
+
/** A box resized from any side or corner, never under 160 × 80 or over 480 × 240; the grip in the corner takes the keys. */
|
|
22
|
+
export default function Basic() {
|
|
23
|
+
const s = reactive({ told: '' });
|
|
24
|
+
return (
|
|
25
|
+
<Stack gap="sm" style="inline-size: 100%">
|
|
26
|
+
<Resizable class="rs-box" width={280} height={140} minWidth={160} minHeight={80} maxWidth={480} maxHeight={240} onResized={e => (s.told = `${e.width} × ${e.height}, from the ${e.edge}`)}>
|
|
27
|
+
<Panel padding="md" variant="outline" text="A note" style="block-size: 100%">
|
|
28
|
+
<p class="rs-note">Drag a side or a corner, or focus the grip and use the arrow keys.</p>
|
|
29
|
+
</Panel>
|
|
30
|
+
</Resizable>
|
|
31
|
+
<output class="rs-box-told">{() => s.told}</output>
|
|
32
|
+
</Stack>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Inside an area, keeping its shape
|
|
38
|
+
|
|
39
|
+
`area` keeps the box inside its parent, or inside an element given; `keepAspectRatio` changes the other side along. Here only the end side, the bottom and the corner between them resize the picture.
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { Resizable } from '@motifx-community/ui';
|
|
43
|
+
import { scene } from '../../gallery/examples/scenes';
|
|
44
|
+
|
|
45
|
+
/** A picture that keeps its shape and stays inside the dashed area; only the end side, the bottom and the corner resize it. */
|
|
46
|
+
export default function Area() {
|
|
47
|
+
return (
|
|
48
|
+
<div class="rs-area" style="position: relative; inline-size: 100%; block-size: 260px; outline: 2px dashed var(--mx-color-stroke-control-strong); outline-offset: -2px">
|
|
49
|
+
<Resizable class="rs-picture" width={240} height={135} minWidth={120} minHeight={68} area="parent" keepAspectRatio handles={['end', 'bottom', 'bottom-end']} style="position: absolute; left: 16px; top: 16px">
|
|
50
|
+
<img src={scene(200)} alt="A harbour at dawn" style="display: block; inline-size: 100%; block-size: 100%; object-fit: cover" />
|
|
51
|
+
</Resizable>
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Programmatic use
|
|
58
|
+
|
|
59
|
+
`size` gives the size in pixels and `x-model` takes it back after every resize (`onResized` tells too): a layout kept and restored, or set by a button.
|
|
60
|
+
|
|
61
|
+
```tsx
|
|
62
|
+
import { reactive } from '@motifx/core';
|
|
63
|
+
import { Button, Panel, Resizable, Stack } from '@motifx-community/ui';
|
|
64
|
+
|
|
65
|
+
/** The size goes out to x-model after every resize and comes back: set, kept and restored programmatically. */
|
|
66
|
+
export default function Programmatic() {
|
|
67
|
+
const s = reactive({ size: { width: 240, height: 120 } as { width: number; height: number } | null, kept: null as { width: number; height: number } | null });
|
|
68
|
+
return (
|
|
69
|
+
<Stack gap="sm" style="inline-size: 100%">
|
|
70
|
+
<Resizable class="rs-coded" minWidth={120} minHeight={60} x-model={() => s.size}>
|
|
71
|
+
<Panel padding="md" variant="outline" style="block-size: 100%">
|
|
72
|
+
<p class="rs-note">Sized by the model.</p>
|
|
73
|
+
</Panel>
|
|
74
|
+
</Resizable>
|
|
75
|
+
<Stack orientation="horizontal" wrap align="center">
|
|
76
|
+
<Button text="Wider" variant="outline" onclick={() => (s.size = { width: (s.size?.width ?? 240) + 40, height: s.size?.height ?? 120 })} />
|
|
77
|
+
<Button text="Keep this size" variant="outline" onclick={() => (s.kept = s.size ? { ...s.size } : null)} />
|
|
78
|
+
<Button text="Restore it" variant="outline" enabled={() => !!s.kept} onclick={() => (s.size = s.kept ? { ...s.kept } : null)} />
|
|
79
|
+
<output class="rs-coded-told">{() => `size: ${JSON.stringify(s.size)}`}</output>
|
|
80
|
+
</Stack>
|
|
81
|
+
</Stack>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## Keyboard
|
|
87
|
+
|
|
88
|
+
| Key | What it does |
|
|
89
|
+
| --- | --- |
|
|
90
|
+
| `Tab` | The grip in the end corner is the one stop. |
|
|
91
|
+
| `Arrow keys` | On the grip: Left and Right change the width by `step` (the other way round in a right-to-left page), Up and Down the height; within the limits, the area and the ratio. |
|
|
92
|
+
|
|
93
|
+
## Accessibility
|
|
94
|
+
|
|
95
|
+
| Topic | How |
|
|
96
|
+
| --- | --- |
|
|
97
|
+
| `The grip` | A button named “Resize” in the kit language; the new size is read out after every change (“Width 320, height 200”). |
|
|
98
|
+
| `The handles` | Strips along the sides and corners for the pointer only, hidden from readers; the grip gives the keys the same. |
|
|
99
|
+
| `Content` | The JSX children are the content, untouched: a panel, a picture, a form. |
|
|
100
|
+
|
|
101
|
+
## Styling
|
|
102
|
+
|
|
103
|
+
| Hook | What it is |
|
|
104
|
+
| --- | --- |
|
|
105
|
+
| `.mx-resizable` | The box. `data-resizing` and `data-edge` while a handle is dragged; `data-disabled`. |
|
|
106
|
+
| `.mx-resizable__frame, .mx-resizable__handle` | The frame over the box and its eight handles (`data-edge`, `data-active` while dragged, `hidden` when not asked for). |
|
|
107
|
+
| `.mx-resizable__grip, .mx-resizable__grip-glyph` | The grip in the end corner and its glyph. |
|
|
108
|
+
|
|
109
|
+
### Component tokens
|
|
110
|
+
|
|
111
|
+
| Token | What it sets |
|
|
112
|
+
| --- | --- |
|
|
113
|
+
| `resizable.box, .handle, .grip, .grip-glyph` | Units: the box (`resizing`), a handle (`hover`, `active`, `corner`), the grip (`hover`, `pressed`, `focus`) and its glyph (`icon`). |
|
|
114
|
+
| `resizable.edge` | How wide a strip along a side takes the pointer; a corner takes twice that each way. |
|
|
115
|
+
|
|
116
|
+
## API reference
|
|
117
|
+
|
|
118
|
+
### Props
|
|
119
|
+
|
|
120
|
+
| Prop | Type | Default | Description |
|
|
121
|
+
| --- | --- | --- | --- |
|
|
122
|
+
| `handles` | `Bind<ResizeHandles>` | `'all'` | `all`, `edges`, `corners`, or a list of `top`, `bottom`, `start`, `end`, `top-start`, `top-end`, `bottom-start`, `bottom-end`. |
|
|
123
|
+
| `minWidth, minHeight` | `Bind<number>` | `30` | The least width and height, in pixels. |
|
|
124
|
+
| `maxWidth, maxHeight` | `Bind<number \| null>` | `null` | The most width and height, in pixels; `null` for no limit. |
|
|
125
|
+
| `area` | `Bind<'parent' \| HTMLElement \| null>` | `null` | The box stays inside this: its parent, or an element it lies in. |
|
|
126
|
+
| `keepAspectRatio` | `Bind<boolean>` | `false` | The width and the height keep their ratio. |
|
|
127
|
+
| `step` | `Bind<number>` | `10` | Pixels an arrow key changes a side by. |
|
|
128
|
+
| `width, height` | `Bind<number \| string \| null>` | `null` | The size to start with, a CSS length or pixels; without one the content decides. |
|
|
129
|
+
| `size` | `Bind<ResizeSize \| null>` | `null` | The size in pixels: given, it is applied; after every resize the new one is written to `x-model`. |
|
|
130
|
+
|
|
131
|
+
### Events, properties and methods
|
|
132
|
+
|
|
133
|
+
| Member | Kind | Description |
|
|
134
|
+
| --- | --- | --- |
|
|
135
|
+
| `onResizeStarting` | event | A resize is about to begin from a handle (`edge`, `width`, `height`); `cancel = true` keeps the size. |
|
|
136
|
+
| `onResizing` | event | The box is being resized (`edge`, `width`, `height` so far). |
|
|
137
|
+
| `onResized` | event | A resize ended: the pointer let go, or a key moved a side. |
|
|
138
|
+
| `currentSize` | read-only | The size in pixels now. |
|
|
139
|
+
| `gripElement` | read-only | The grip in the end corner, the Tab stop that takes the keys. |
|
package/docs/scheduler-agenda.md
CHANGED
|
@@ -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
|
|