@motifx-community/ui 0.1.0-beta.10 → 0.1.0-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dist/components/toolbar/Toolbar.d.ts +2 -2
- package/dist/index.js +22 -7
- package/dist/index.js.map +1 -1
- package/docs/accordion.md +1 -1
- package/docs/actionsheet.md +1 -1
- package/docs/appbar.md +1 -1
- package/docs/appmenu-api.md +1 -1
- package/docs/appmenu-programmatic.md +1 -1
- package/docs/appmenu-search.md +1 -1
- package/docs/appmenu.md +1 -1
- package/docs/avatar.md +1 -1
- package/docs/badge.md +1 -1
- package/docs/bar-gauge-angles.md +1 -1
- package/docs/bar-gauge-data.md +1 -1
- package/docs/bar-gauge-labels.md +1 -1
- package/docs/bar-gauge.md +1 -1
- package/docs/barcode.md +1 -1
- package/docs/bottomnavigation.md +1 -1
- package/docs/bottomsheet.md +1 -1
- package/docs/breadcrumb.md +1 -1
- package/docs/button.md +2 -2
- package/docs/buttongroup.md +1 -1
- package/docs/buttons.md +3 -5
- package/docs/calendar.md +1 -1
- package/docs/card.md +1 -1
- package/docs/chart-bars.md +1 -1
- package/docs/chart-candles.md +1 -1
- package/docs/chart-funnel.md +1 -1
- package/docs/chart-heatmap.md +1 -1
- package/docs/chart-lines.md +1 -1
- package/docs/chart-live.md +1 -1
- package/docs/chart-pie.md +1 -1
- package/docs/chart-radar.md +1 -1
- package/docs/chart-ranges.md +1 -1
- package/docs/chart-references.md +1 -1
- package/docs/chart-scatter.md +1 -1
- package/docs/chart-waterfall.md +1 -1
- package/docs/chart-zoom.md +1 -1
- package/docs/chart.md +1 -1
- package/docs/checkbox.md +1 -1
- package/docs/chip.md +1 -1
- package/docs/choice.md +1 -1
- package/docs/colorbox.md +1 -1
- package/docs/combobox.md +1 -1
- package/docs/commands.md +126 -0
- package/docs/control.md +1 -1
- package/docs/data.md +1 -1
- package/docs/datagrid-api.md +3 -3
- package/docs/datagrid-bands.md +1 -1
- package/docs/datagrid-drag-select.md +1 -1
- package/docs/datagrid-drag.md +1 -1
- package/docs/datagrid-editing.md +107 -1
- package/docs/datagrid-filtering.md +11 -3
- package/docs/datagrid-forms.md +1 -1
- package/docs/datagrid-grouping.md +1 -1
- package/docs/datagrid-layout.md +2 -2
- package/docs/datagrid-lookups.md +1 -1
- package/docs/datagrid-master-detail.md +1 -1
- package/docs/datagrid-scrolling.md +1 -1
- package/docs/datagrid-selection.md +1 -1
- package/docs/datagrid.md +1 -1
- package/docs/datebox.md +1 -1
- package/docs/daterangebox.md +1 -1
- package/docs/display.md +1 -1
- package/docs/draggable.md +1 -1
- package/docs/drawer.md +1 -1
- package/docs/dropdown.md +1 -1
- package/docs/editors.md +3 -1
- package/docs/feedback.md +1 -1
- package/docs/fileuploader.md +1 -1
- package/docs/filterbuilder.md +1 -1
- package/docs/formlayout.md +1 -1
- package/docs/foundations.md +1 -1
- package/docs/gallery.md +1 -1
- package/docs/gauge-base.md +1 -1
- package/docs/gauge-circular.md +1 -1
- package/docs/gauge-dashboards.md +1 -1
- package/docs/gauge-linear.md +1 -1
- package/docs/gauge-markers.md +1 -1
- package/docs/gauge-marks.md +1 -1
- package/docs/gauge-ranges.md +1 -1
- package/docs/gauge-scales.md +1 -1
- package/docs/gauge.md +1 -1
- package/docs/home.md +2 -2
- package/docs/keyboard.md +5 -3
- package/docs/language.md +2 -2
- package/docs/layout.md +1 -1
- package/docs/listbox.md +1 -1
- package/docs/loadpanel.md +2 -2
- package/docs/lookup.md +1 -1
- package/docs/menus-api.md +142 -0
- package/docs/menus-context.md +126 -0
- package/docs/menus-customization.md +138 -0
- package/docs/menus-merging.md +208 -0
- package/docs/menus-programmatic.md +74 -0
- package/docs/menus.md +22 -179
- package/docs/multiview.md +1 -1
- package/docs/navigation.md +7 -2
- package/docs/numberbox.md +3 -3
- package/docs/otpinput.md +1 -1
- package/docs/pagination.md +1 -1
- package/docs/popover.md +1 -1
- package/docs/progress.md +3 -3
- package/docs/qrcode.md +1 -1
- package/docs/radiogroup.md +1 -1
- package/docs/rating.md +1 -1
- package/docs/resizable.md +1 -1
- package/docs/ribbonmenu-api.md +1 -1
- package/docs/ribbonmenu-commands.md +1 -1
- package/docs/ribbonmenu-customization.md +1 -1
- package/docs/ribbonmenu-display.md +1 -1
- package/docs/ribbonmenu-layouts.md +1 -1
- package/docs/ribbonmenu-programmatic.md +1 -1
- package/docs/ribbonmenu.md +1 -1
- package/docs/scheduler-agenda.md +1 -1
- package/docs/scheduler-big-data.md +1 -1
- package/docs/scheduler-editing.md +1 -1
- 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 +1 -1
- package/docs/scheduler-resources.md +1 -1
- package/docs/scheduler-timeline.md +1 -1
- package/docs/scheduler.md +1 -1
- package/docs/scrollview.md +1 -1
- package/docs/shortcuteditor.md +248 -0
- package/docs/showcase-home.md +1 -1
- package/docs/showcase.md +1 -1
- package/docs/signature.md +1 -1
- package/docs/skeleton.md +1 -1
- package/docs/slider.md +3 -3
- package/docs/sortable.md +1 -1
- package/docs/sparkline.md +1 -1
- package/docs/speeddial.md +1 -1
- package/docs/splitter.md +1 -1
- package/docs/stepper.md +1 -1
- package/docs/switch.md +1 -1
- package/docs/tabdocs-dock.md +1 -1
- 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 +1 -1
- package/docs/tabs.md +1 -1
- package/docs/tagbox.md +1 -1
- package/docs/textarea.md +1 -1
- package/docs/textbox.md +1 -1
- package/docs/tileview.md +1 -1
- package/docs/timeline.md +1 -1
- package/docs/toast.md +1 -1
- package/docs/tokens.md +13 -1
- package/docs/toolbar.md +1 -1
- package/docs/tooltip.md +1 -1
- package/docs/treeview.md +1 -1
- package/docs/validationsummary.md +1 -1
- package/docs/window.md +1 -1
- package/docs/wizard.md +1 -1
- package/llms-full.txt +3774 -2692
- package/llms.txt +16 -6
- package/package.json +1 -1
package/docs/accordion.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Accordion
|
|
2
2
|
|
|
3
|
-
> Navigation · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Navigation · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
An accordion expands and collapses sections under their headers. It supports one or several open sections, sections that stay open, icons, three appearances and sections that are created when first opened.
|
|
6
6
|
|
package/docs/actionsheet.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ActionSheet
|
|
2
2
|
|
|
3
|
-
> Navigation · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Navigation · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
A list of commands that slides up from the bottom of the screen, built from the kit's menu items and sized for touch. It supports a title, a message and a separate Cancel button. A context menu uses it on touch screens.
|
|
6
6
|
|
package/docs/appbar.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AppBar
|
|
2
2
|
|
|
3
|
-
> Navigation · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Navigation · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
The top bar of an application, with a navigation button, a logo, a title, a control and commands. The commands are a `Toolbar`, so those that do not fit move into a menu.
|
|
6
6
|
|
package/docs/appmenu-api.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AppMenu: Programmatic changes
|
|
2
2
|
|
|
3
|
-
> AppMenu · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> AppMenu · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
Items can be added, removed, moved and changed at any time, by their keys. Items that stay keep their place, and pages that were opened keep their state.
|
|
6
6
|
|
package/docs/appmenu-search.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AppMenu: Slots and search
|
|
2
2
|
|
|
3
|
-
> AppMenu · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> AppMenu · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
The list can hold the app’s own content above and under its items, such as the user’s name or the version, and a search that narrows a long list as the user types.
|
|
6
6
|
|
package/docs/appmenu.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# AppMenu
|
|
2
2
|
|
|
3
|
-
> AppMenu · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> AppMenu · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
The main menu of an application. It slides in from the start edge with a list of items, and each item shows its own page beside the list or runs a command. The menu holds nothing of its own: the items, the pages and the commands are given by the application.
|
|
6
6
|
|
package/docs/avatar.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Avatar and AvatarGroup
|
|
2
2
|
|
|
3
|
-
> Display · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Display · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
Represents a person with a picture, initials or an icon, with an optional presence indicator on its corner. A group stacks or spreads avatars and counts the ones it does not show.
|
|
6
6
|
|
package/docs/badge.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Badge
|
|
2
2
|
|
|
3
|
-
> Display · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Display · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
A short text, count or dot, shown inline or on the corner of a button, avatar or icon. A count above its maximum displays as “99+”, and a count of zero is hidden.
|
|
6
6
|
|
package/docs/bar-gauge-angles.md
CHANGED
package/docs/bar-gauge-data.md
CHANGED
package/docs/bar-gauge-labels.md
CHANGED
package/docs/bar-gauge.md
CHANGED
package/docs/barcode.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Barcode
|
|
2
2
|
|
|
3
|
-
> Display · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Display · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
A linear barcode, drawn as vectors: Code 128, Code 39, EAN-13, EAN-8, UPC-A or Interleaved 2 of 5. It has no dependencies, works out check digits and refuses a value the format cannot hold.
|
|
6
6
|
|
package/docs/bottomnavigation.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# BottomNavigation
|
|
2
2
|
|
|
3
|
-
> Navigation · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Navigation · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
The destinations of an application at the bottom of the screen, each an icon with a label. The bar is one Tab stop, marks the selected item for screen readers and keeps clear of the home indicator of a phone.
|
|
6
6
|
|
package/docs/bottomsheet.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# BottomSheet
|
|
2
2
|
|
|
3
|
-
> Navigation · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Navigation · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
A panel that slides up from the bottom of the page or a container and stops at set heights: peek, half, full, the height of its content, or custom values. Users can drag it by its handle and title, flick it, and swipe down to close it. It can be modal or non-modal, and the back button closes it on phones.
|
|
6
6
|
|
package/docs/breadcrumb.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Breadcrumb
|
|
2
2
|
|
|
3
|
-
> Navigation · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Navigation · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
Shows the path to the current page. Each step is a link or button, and the current page comes last. Steps that do not fit move into a menu after the first step.
|
|
6
6
|
|
package/docs/button.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Button
|
|
2
2
|
|
|
3
|
-
> Buttons · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Buttons · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
A native `<button>` styled with design tokens. It comes in three variants, three tones and three sizes, and supports an icon and an `&` access key. A button can act as a toggle, indicate that work is in progress, and open a menu or any other content, either from the whole button or from an arrow next to it with `split`, so the button keeps its own action.
|
|
6
6
|
|
|
@@ -300,7 +300,7 @@ export default function DropDown() {
|
|
|
300
300
|
|
|
301
301
|
## Localization
|
|
302
302
|
|
|
303
|
-
The only string a button displays on its own is the name of a split button's arrow. It comes from `uiLocale.strings`, which
|
|
303
|
+
The only string a button displays on its own is the name of a split button's arrow. It comes from `uiLocale.strings`, which starts from the page's `lang` (English and Turkish are included) and can be set to any `UiStrings`. Every button updates immediately. The set is used as provided, so to change one string, assign a new set: `uiLocale.strings = { ...uiLocale.strings, moreOptions: 'Mehr' }`. Changing a string inside the existing set has no effect.
|
|
304
304
|
|
|
305
305
|
```tsx
|
|
306
306
|
import { reactive } from '@motifx/core';
|
package/docs/buttongroup.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ButtonGroup
|
|
2
2
|
|
|
3
|
-
> Buttons · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Buttons · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
A set of related buttons, used as a segmented selection of one or more options or as a row of actions. The buttons are standard kit buttons and are attached by default.
|
|
6
6
|
|
package/docs/buttons.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# Buttons
|
|
2
2
|
|
|
3
|
-
> Buttons · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Buttons · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
|
-
Buttons start commands. The group covers single buttons, groups of them
|
|
5
|
+
Buttons start commands. The group covers single buttons, groups of them and a floating button for the main action of a screen. Toolbars and menus, which hold the many commands of an application, are in [Navigation](navigation.md).
|
|
6
6
|
|
|
7
7
|
## Commands of an editor
|
|
8
8
|
|
|
@@ -131,9 +131,7 @@ Each component has its own page with its examples and its full API.
|
|
|
131
131
|
| --- | --- |
|
|
132
132
|
| `[Button](button.md)` | One command, with an icon, a menu or a split part; a toggle; a busy state while the command runs. |
|
|
133
133
|
| `[ButtonGroup](buttongroup.md)` | A few related buttons side by side: one or several pressed, or plain actions. |
|
|
134
|
-
| `[Toolbar](toolbar.md)` | A row of commands that moves what does not fit into a menu. |
|
|
135
134
|
| `[SpeedDial](speeddial.md)` | A floating button for the main action, opening related actions in a line or a circle. |
|
|
136
|
-
| `[MenuBar and ContextMenu](menus.md)` | The menus of an application and the menu of an element, with shortcuts, check items and access keys. |
|
|
137
135
|
|
|
138
136
|
## Choosing a component
|
|
139
137
|
|
|
@@ -145,7 +143,7 @@ Several components can do the same job; this table points to the one that reads
|
|
|
145
143
|
| `Show a choice of a few options at once` | [ButtonGroup](buttongroup.md), or [RadioGroup](radiogroup.md) in a form |
|
|
146
144
|
| `Keep many commands in one bar at any width` | [Toolbar](toolbar.md) |
|
|
147
145
|
| `Offer the commands of a whole application` | [MenuBar](menus.md) |
|
|
148
|
-
| `Act on what is under the pointer` | [ContextMenu](menus.md) |
|
|
146
|
+
| `Act on what is under the pointer` | [ContextMenu](menus-context.md) |
|
|
149
147
|
| `Give a screen one main action, on a phone too` | [SpeedDial](speeddial.md) |
|
|
150
148
|
|
|
151
149
|
## What they share
|
package/docs/calendar.md
CHANGED
package/docs/card.md
CHANGED
package/docs/chart-bars.md
CHANGED
package/docs/chart-candles.md
CHANGED
package/docs/chart-funnel.md
CHANGED
package/docs/chart-heatmap.md
CHANGED
package/docs/chart-lines.md
CHANGED
package/docs/chart-live.md
CHANGED
package/docs/chart-pie.md
CHANGED
package/docs/chart-radar.md
CHANGED
package/docs/chart-ranges.md
CHANGED
package/docs/chart-references.md
CHANGED
package/docs/chart-scatter.md
CHANGED
package/docs/chart-waterfall.md
CHANGED
package/docs/chart-zoom.md
CHANGED
package/docs/chart.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Chart
|
|
2
2
|
|
|
3
|
-
> Charts · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Charts · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
Displays lines, areas, bars, scatter points and bubbles on a shared value axis. The chart has no dependencies, takes its appearance from the design language, and makes every value available through the keyboard and a table view.
|
|
6
6
|
|
package/docs/checkbox.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CheckBox
|
|
2
2
|
|
|
3
|
-
> Choice · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Choice · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
A check box with a label that can be checked, unchecked or indeterminate. It supports an optional three-state cycle, read-only and required states, and validation with its group. It is a native check box styled with design tokens.
|
|
6
6
|
|
package/docs/chip.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Chip and ChipGroup
|
|
2
2
|
|
|
3
|
-
> Display · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Display · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
A compact element with short text and an optional leading icon or avatar. Use it as a filter, as a choice among a few options, or to represent a selected item that can be removed. A group handles single or multiple selection and arrow key navigation.
|
|
6
6
|
|
package/docs/choice.md
CHANGED
package/docs/colorbox.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ColorBox and ColorPicker
|
|
2
2
|
|
|
3
|
-
> Editors · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Editors · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
A color field with a popup picker, or the picker on its own. The picker has a saturation and brightness area, a hue slider, an opacity slider, channel inputs and preset colors.
|
|
6
6
|
|
package/docs/combobox.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# ComboBox and Autocomplete
|
|
2
2
|
|
|
3
|
-
> Choice · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Choice · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
A text input with a list that filters as the user types. Items can come from memory or from a data layer source that is searched on the server. `Autocomplete` is the free-text variant, where the value is the text itself.
|
|
6
6
|
|
package/docs/commands.md
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Commands and shortcuts
|
|
2
|
+
|
|
3
|
+
> Foundations · @motifx-community/ui 0.1.0-beta.10
|
|
4
|
+
|
|
5
|
+
A command of the app is defined once: its text, icon, keys, state and action. Menus, toolbars and ribbons name it, its keys run it, and the user can give it other keys. Every shortcut of the app is in one list, so the ones that get in each other’s way are found.
|
|
6
|
+
|
|
7
|
+
## Defining commands
|
|
8
|
+
|
|
9
|
+
```tsx
|
|
10
|
+
import { commands } from '@motifx-community/ui';
|
|
11
|
+
|
|
12
|
+
commands.add({ key: 'save', text: '&Save', shortcut: 'Mod+S', category: 'File', enabled: () => doc.dirty, run: () => doc.save() });
|
|
13
|
+
commands.add({ key: 'bold', text: '&Bold', shortcut: 'Mod+B', scope: editor, checked: () => editor.bold, run: () => editor.toggleBold() });
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
`commands.add` adds a command and returns what takes it away. Without `scope` it is app-wide; with a component as `scope` it holds, and its keys work, while focus is inside that component, and it goes away when the component is disposed. Each document can add its own `save`; the one that holds is the one of the item’s place, else of the place that holds focus.
|
|
17
|
+
|
|
18
|
+
## Items that name commands
|
|
19
|
+
|
|
20
|
+
An item says `command: 'save'`, and what it is not given comes from the command: its text, icon, hint, the keys shown at the end of a menu item, its state and its action. The item’s own value wins, so an item can show another text for the same command.
|
|
21
|
+
|
|
22
|
+
| Item | In | From the command |
|
|
23
|
+
| --- | --- | --- |
|
|
24
|
+
| `MenuItem` | `MenuBar`, `ContextMenu`, the menu of a `Button`, `ActionSheet` | Text, icon, hint, keys at the end, enabled, checked, visible, and the action. |
|
|
25
|
+
| `ToolbarItem` | `Toolbar` | Text, icon, hint, enabled, visible, the action; a toggle is pressed as the command is checked. |
|
|
26
|
+
| `RibbonCommand` | `RibbonMenu` | Text, glyph or icon, hint, enabled, visible, the action; a toggle is pressed as the command is checked. |
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import { reactive } from '@motifx/core';
|
|
30
|
+
import { MenuBar, Stack, Toolbar, commands, shortcuts, type Keymap } from '@motifx-community/ui';
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Commands defined once, limited to this example: the menu bar and the toolbar name them, their keys run them, and the
|
|
34
|
+
* customizer's keyboard page gives them other keys.
|
|
35
|
+
*/
|
|
36
|
+
export default function SharedCommands() {
|
|
37
|
+
const s = reactive({ told: 'Nothing yet.', bold: false, keymap: {} as Keymap });
|
|
38
|
+
const run = (what: string) => () => (s.told = what);
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<Stack
|
|
42
|
+
gap="md"
|
|
43
|
+
ref={(host: Stack) => {
|
|
44
|
+
// Limited to this example (`scope`), and taken away with it.
|
|
45
|
+
commands.add({ key: 'new', text: '&New', shortcut: 'Alt+N', category: 'File', scope: host, run: run('New') });
|
|
46
|
+
commands.add({ key: 'save', text: '&Save', shortcut: 'Mod+S', category: 'File', scope: host, run: run('Save') });
|
|
47
|
+
commands.add({ key: 'print', text: '&Print', shortcut: 'Mod+P', category: 'File', scope: host, run: run('Print') });
|
|
48
|
+
commands.add({ key: 'bold', text: '&Bold', shortcut: 'Mod+B', category: 'Format', scope: host, checked: () => s.bold, run: () => (s.bold = !s.bold) });
|
|
49
|
+
const listening = shortcuts.onKeymapChanged((e) => (s.keymap = e.keymap));
|
|
50
|
+
host.motif.setDisposable(() => listening.dispose());
|
|
51
|
+
}}
|
|
52
|
+
>
|
|
53
|
+
<MenuBar
|
|
54
|
+
label="Editor"
|
|
55
|
+
customizable
|
|
56
|
+
items={[
|
|
57
|
+
{ key: 'file', text: '&File', items: [{ command: 'new' }, { command: 'save' }, { command: 'print', beginGroup: true }] },
|
|
58
|
+
{ key: 'format', text: 'F&ormat', items: [{ command: 'bold' }] },
|
|
59
|
+
]}
|
|
60
|
+
/>
|
|
61
|
+
<Toolbar label="Commands" items={[{ command: 'save' }, { command: 'print' }, { type: 'separator' }, { type: 'toggle', command: 'bold' }]} />
|
|
62
|
+
<p tabIndex={0} class="cmd-page">Click here, then press the keys: they work while focus is in this example.</p>
|
|
63
|
+
<output class="cmd-told">{() => `${s.told}${s.bold ? ' · bold' : ''}`}</output>
|
|
64
|
+
<pre class="cmd-keymap">{() => JSON.stringify(s.keymap)}</pre>
|
|
65
|
+
</Stack>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Keys
|
|
71
|
+
|
|
72
|
+
A command’s `shortcut` runs it, by the rules of [shortcuts](keyboard.md#shortcuts). The keys shown in a menu read as they do on the platform: `Mod+Shift+S` shows Ctrl+Shift+S, and ⇧⌘S on Apple platforms (`shortcutText`). A menu item’s own `shortcut` only changes the text shown.
|
|
73
|
+
|
|
74
|
+
## The user’s keys
|
|
75
|
+
|
|
76
|
+
`shortcuts.keymap` holds the keys the user assigned, by the name of the shortcut: the key of a command, or the name given to `addShortcut`. They replace the shortcut’s own keys, and an empty list leaves it without keys. It is one plain object: `onKeymapChanged` reports it to save, and assigning it back restores the keys. How it is saved is up to the app.
|
|
77
|
+
|
|
78
|
+
[ShortcutEditor](shortcuteditor.md) is the list in which the user changes them: it shows every shortcut with a name, says which shortcut already uses the keys pressed, and assigns them. The customizer of a `MenuBar` shows it on its Keyboard page.
|
|
79
|
+
|
|
80
|
+
## Conflicts
|
|
81
|
+
|
|
82
|
+
Every shortcut is in `shortcuts.list()`: the commands’ keys, the app’s own (`addShortcut` with `name`) and those of the kit’s components, such as the keys of `TabDocumentManager`. A shortcut that takes keys already taken in the same place is said on the console and by `onConflict`; the first one added runs, and the innermost scope still comes first. `conflicts()` also finds keys that start longer keys and Alt shortcuts that take an access key of the page.
|
|
83
|
+
|
|
84
|
+
## API reference
|
|
85
|
+
|
|
86
|
+
### Command
|
|
87
|
+
|
|
88
|
+
| Field | Type | Description |
|
|
89
|
+
| --- | --- | --- |
|
|
90
|
+
| `key` | `string` | Names the command. Several commands may share a key in different scopes, such as `save` in each document. |
|
|
91
|
+
| `text, hint` | `Bind<string>` | The text (`&` marks the access key) and a tooltip. |
|
|
92
|
+
| `icon, glyph` | `Bind<IconSource>`, `Bind<string>` | An image address or a component (as a function, so that a copy in a menu builds its own), or the name of a glyph for the items that take one. |
|
|
93
|
+
| `shortcut` | `string \| string[]` | The keys that run it, as `addShortcut` reads them: `Mod+S`, or several. |
|
|
94
|
+
| `enabled, checked, visible` | `Bind<boolean>` | The state of the items that name it. Off, its keys do nothing. |
|
|
95
|
+
| `category` | `Bind<string>` | A heading lists group commands under, such as `File`. |
|
|
96
|
+
| `scope` | `ComponentBase \| null` | Limits the command and its keys to times when focus is inside this component. Without it, it is app-wide. |
|
|
97
|
+
| `inEditable` | `boolean` | Its keys work in text fields too. |
|
|
98
|
+
| `run` | `(e: CommandRunEventArgs) => void` | Runs it, with the item that named it, its component and the click or the key press. |
|
|
99
|
+
|
|
100
|
+
### commands
|
|
101
|
+
|
|
102
|
+
| Member | Returns | Description |
|
|
103
|
+
| --- | --- | --- |
|
|
104
|
+
| `add(command)` | `() => void` | Adds a command with its keys; returns what takes it away. |
|
|
105
|
+
| `get(key, from?)` | `Command \| null` | The command that holds at `from` (a component, such as the menu or toolbar of the item): of the scope that holds it, else of the one that holds focus, else the app-wide one. |
|
|
106
|
+
| `run(key, from?, event?)` | `boolean` | Runs it; `false` when there is none or it is off. |
|
|
107
|
+
| `keysOf(command)` | `string[]` | Its keys: the ones the user assigned to its key, else its own `shortcut`. |
|
|
108
|
+
| `list(), has(key)` | | Every command, in the order they came. |
|
|
109
|
+
| `onChanged` | `CommandsChangedEventArgs` | A command was added or taken away. |
|
|
110
|
+
|
|
111
|
+
### shortcuts
|
|
112
|
+
|
|
113
|
+
| Member | Returns | Description |
|
|
114
|
+
| --- | --- | --- |
|
|
115
|
+
| `list()` | `ShortcutInfo[]` | Every shortcut working now: the commands’ keys, the app’s own (`addShortcut`) and those of the kit’s components, each with its keys, its own keys, name, text, category, scope and whether the user can change it. |
|
|
116
|
+
| `conflicts()` | `ShortcutConflict[]` | The shortcuts in each other’s way: `same` keys in the same place, keys that `prefix` longer keys, an Alt shortcut that takes an `accessKey` of the page. |
|
|
117
|
+
| `takenBy(keys, scope?)` | `ShortcutInfo[]` | The shortcuts that keys would get in the way of. |
|
|
118
|
+
| `keymap` | `Keymap` | The keys the user assigned, by the name of the shortcut: a plain object to save and restore; `null` clears them. |
|
|
119
|
+
| `assign(name, keys)` | `void` | Assigns the user’s keys to the shortcuts with the name (an empty list removes their keys), or restores their own keys with `null`. |
|
|
120
|
+
| `keysOf(name, defaults?), isAssigned(name)` | | The keys of the shortcuts with the name, and whether the user assigned them. |
|
|
121
|
+
| `warnings` | `boolean` | Says on the console when a shortcut added gets in another’s way. The default is `true`. |
|
|
122
|
+
| `onChanged, onConflict, onKeymapChanged` | | A shortcut was added or removed, or its keys changed; one added gets in the way of another; the user’s keys changed. |
|
|
123
|
+
|
|
124
|
+
## Feedback
|
|
125
|
+
|
|
126
|
+
Loading issues…
|
package/docs/control.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Control
|
|
2
2
|
|
|
3
|
-
> Foundations · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Foundations · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
`Control` is the base class of every control in the package. It provides the same `text`, `enabled`, `visible` and `tabStop` properties and the same focus methods, whether a control is declared in JSX and bound to state or created with `new` and changed programmatically.
|
|
6
6
|
|
package/docs/data.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Data
|
|
2
2
|
|
|
3
|
-
> Data · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> Data · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
Data components show and pick from structured data: hierarchies, lists, sets of tags, and filters that the reader builds. Tables have their own group: see [DataGrid](datagrid.md).
|
|
6
6
|
|
package/docs/datagrid-api.md
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# DataGrid: API reference
|
|
2
2
|
|
|
3
|
-
> DataGrid · @motifx-community/ui 0.1.0-beta.
|
|
3
|
+
> DataGrid · @motifx-community/ui 0.1.0-beta.10
|
|
4
4
|
|
|
5
5
|
## Columns
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Up to 0.1.0-beta.8, the root of the content that `cell`, `groupCell`, `headerCell`, a band's `headerCell` and the detail `template` return must not carry `x-display` or `x-wait`, and must not be a conditional or a fragment: such content can leave its cell when it is shown again. Put it inside a wrapper element, for example `<span hidden={() => !ctx.row}><Button … /></span>`. For buttons on each row, use the grid's `actions` with a `visible` function per row.
|
|
8
8
|
|
|
9
9
|
| Field | Description |
|
|
10
10
|
| --- | --- |
|
|
11
11
|
| `field, title` | The value's key (a dotted path reads a nested value) and the header text (`Bind<string>`). |
|
|
12
|
-
| `type` | `text`, `number`, `date`, `boolean`, `list`. Determines the alignment, format, sorting and editor (`TextBox`, `NumberBox`, `DateBox`, `CheckBox`, `DropDown`). |
|
|
12
|
+
| `type` | `text`, `number`, `date`, `datetime`, `boolean`, `list`. Determines the alignment, format, sorting and editor (`TextBox`, `NumberBox`, `DateBox`, `CheckBox`, `DropDown`). `datetime` is a date with its time: shown with both, edited with a `DateBox` of `type: 'datetime'`, filtered to the minute, and its header filter goes down to the hour. |
|
|
13
13
|
| `width, minWidth, maxWidth, flex` | In pixels (by default, the `columnWidth` and `columnMinWidth` settings). `flex` shares the free space until the user resizes. |
|
|
14
14
|
| `sticky, hidden, align` | Pinned to an edge (a column in a band sticks with its band), initially hidden, and the alignment. |
|
|
15
15
|
| `ownerBand, hidingPriority` | The band of a column in a flat list (its `name` or position), and its position in the order columns hide to fit the width, lowest first. |
|
package/docs/datagrid-bands.md
CHANGED