@motifx-community/ui 0.1.0-beta.10 → 0.1.0-beta.12

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.
Files changed (189) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/dist/components/combobox/ComboBox.d.ts +5 -0
  3. package/dist/components/combobox/combo-box-props.d.ts +6 -0
  4. package/dist/components/datagrid/DataGrid.d.ts +4 -1
  5. package/dist/components/datagrid/grid-lookup.d.ts +8 -0
  6. package/dist/components/datagrid/model/FilterModel.d.ts +5 -0
  7. package/dist/components/datagrid/model/LookupTexts.d.ts +2 -0
  8. package/dist/components/datagrid/model/LookupValues.d.ts +4 -0
  9. package/dist/components/datagrid/view/ActionWidths.d.ts +13 -3
  10. package/dist/components/datagrid/view/GridRow.d.ts +1 -1
  11. package/dist/components/dropdown/DropDown.d.ts +5 -0
  12. package/dist/components/dropdown/drop-down-props.d.ts +6 -0
  13. package/dist/components/filterbuilder/filter-builder-lookup.d.ts +3 -0
  14. package/dist/components/listbox/ListBox.d.ts +5 -0
  15. package/dist/components/listbox/list-box-props.d.ts +6 -0
  16. package/dist/components/listbox/select-all-state.d.ts +1 -1
  17. package/dist/components/ribbonmenu/RibbonKeyHints.d.ts +1 -0
  18. package/dist/components/tagbox/TagBox.d.ts +5 -0
  19. package/dist/components/tagbox/tag-box-props.d.ts +6 -0
  20. package/dist/components/toolbar/Toolbar.d.ts +10 -2
  21. package/dist/core/measure/after-frame.d.ts +7 -0
  22. package/dist/core/measure/drawn.d.ts +7 -0
  23. package/dist/core/measure/index.d.ts +1 -1
  24. package/dist/index.d.ts +1 -0
  25. package/dist/index.js +571 -139
  26. package/dist/index.js.map +1 -1
  27. package/dist/parts/data/DataItems.d.ts +24 -0
  28. package/dist/parts/data/KeyedItems.d.ts +31 -5
  29. package/dist/parts/data/normalize-key.d.ts +7 -0
  30. package/dist/styles.css +32 -0
  31. package/docs/accordion.md +1 -1
  32. package/docs/actionsheet.md +1 -1
  33. package/docs/appbar.md +1 -1
  34. package/docs/appmenu-api.md +1 -1
  35. package/docs/appmenu-programmatic.md +1 -1
  36. package/docs/appmenu-search.md +1 -1
  37. package/docs/appmenu.md +1 -1
  38. package/docs/avatar.md +1 -1
  39. package/docs/badge.md +1 -1
  40. package/docs/bar-gauge-angles.md +1 -1
  41. package/docs/bar-gauge-data.md +1 -1
  42. package/docs/bar-gauge-labels.md +1 -1
  43. package/docs/bar-gauge.md +1 -1
  44. package/docs/barcode.md +1 -1
  45. package/docs/bottomnavigation.md +1 -1
  46. package/docs/bottomsheet.md +1 -1
  47. package/docs/breadcrumb.md +1 -1
  48. package/docs/button.md +2 -2
  49. package/docs/buttongroup.md +1 -1
  50. package/docs/buttons.md +3 -5
  51. package/docs/calendar.md +1 -1
  52. package/docs/card.md +1 -1
  53. package/docs/chart-bars.md +1 -1
  54. package/docs/chart-candles.md +1 -1
  55. package/docs/chart-funnel.md +1 -1
  56. package/docs/chart-heatmap.md +1 -1
  57. package/docs/chart-lines.md +1 -1
  58. package/docs/chart-live.md +1 -1
  59. package/docs/chart-pie.md +1 -1
  60. package/docs/chart-radar.md +1 -1
  61. package/docs/chart-ranges.md +1 -1
  62. package/docs/chart-references.md +1 -1
  63. package/docs/chart-scatter.md +1 -1
  64. package/docs/chart-waterfall.md +1 -1
  65. package/docs/chart-zoom.md +1 -1
  66. package/docs/chart.md +1 -1
  67. package/docs/checkbox.md +1 -1
  68. package/docs/chip.md +1 -1
  69. package/docs/choice.md +1 -1
  70. package/docs/colorbox.md +1 -1
  71. package/docs/combobox.md +1 -1
  72. package/docs/commands.md +126 -0
  73. package/docs/control.md +1 -1
  74. package/docs/data.md +1 -1
  75. package/docs/datagrid-api.md +3 -3
  76. package/docs/datagrid-bands.md +1 -1
  77. package/docs/datagrid-drag-select.md +1 -1
  78. package/docs/datagrid-drag.md +1 -1
  79. package/docs/datagrid-editing.md +107 -1
  80. package/docs/datagrid-filtering.md +11 -3
  81. package/docs/datagrid-forms.md +1 -1
  82. package/docs/datagrid-grouping.md +1 -1
  83. package/docs/datagrid-layout.md +2 -2
  84. package/docs/datagrid-lookups.md +1 -1
  85. package/docs/datagrid-master-detail.md +1 -1
  86. package/docs/datagrid-scrolling.md +1 -1
  87. package/docs/datagrid-selection.md +1 -1
  88. package/docs/datagrid.md +1 -1
  89. package/docs/datebox.md +1 -1
  90. package/docs/daterangebox.md +1 -1
  91. package/docs/display.md +1 -1
  92. package/docs/draggable.md +1 -1
  93. package/docs/drawer.md +1 -1
  94. package/docs/dropdown.md +1 -1
  95. package/docs/editors.md +3 -1
  96. package/docs/feedback.md +1 -1
  97. package/docs/fileuploader.md +1 -1
  98. package/docs/filterbuilder.md +1 -1
  99. package/docs/formlayout.md +1 -1
  100. package/docs/foundations.md +1 -1
  101. package/docs/gallery.md +1 -1
  102. package/docs/gauge-base.md +1 -1
  103. package/docs/gauge-circular.md +1 -1
  104. package/docs/gauge-dashboards.md +1 -1
  105. package/docs/gauge-linear.md +1 -1
  106. package/docs/gauge-markers.md +1 -1
  107. package/docs/gauge-marks.md +1 -1
  108. package/docs/gauge-ranges.md +1 -1
  109. package/docs/gauge-scales.md +1 -1
  110. package/docs/gauge.md +1 -1
  111. package/docs/home.md +2 -2
  112. package/docs/keyboard.md +5 -3
  113. package/docs/language.md +2 -2
  114. package/docs/layout.md +1 -1
  115. package/docs/listbox.md +1 -1
  116. package/docs/loadpanel.md +2 -2
  117. package/docs/lookup.md +1 -1
  118. package/docs/menus-api.md +142 -0
  119. package/docs/menus-context.md +126 -0
  120. package/docs/menus-customization.md +138 -0
  121. package/docs/menus-merging.md +208 -0
  122. package/docs/menus-programmatic.md +74 -0
  123. package/docs/menus.md +22 -179
  124. package/docs/multiview.md +1 -1
  125. package/docs/navigation.md +7 -2
  126. package/docs/numberbox.md +3 -3
  127. package/docs/otpinput.md +1 -1
  128. package/docs/pagination.md +1 -1
  129. package/docs/popover.md +1 -1
  130. package/docs/progress.md +3 -3
  131. package/docs/qrcode.md +1 -1
  132. package/docs/radiogroup.md +1 -1
  133. package/docs/rating.md +1 -1
  134. package/docs/resizable.md +1 -1
  135. package/docs/ribbonmenu-api.md +1 -1
  136. package/docs/ribbonmenu-commands.md +1 -1
  137. package/docs/ribbonmenu-customization.md +1 -1
  138. package/docs/ribbonmenu-display.md +1 -1
  139. package/docs/ribbonmenu-layouts.md +1 -1
  140. package/docs/ribbonmenu-programmatic.md +1 -1
  141. package/docs/ribbonmenu.md +1 -1
  142. package/docs/scheduler-agenda.md +1 -1
  143. package/docs/scheduler-big-data.md +1 -1
  144. package/docs/scheduler-editing.md +1 -1
  145. package/docs/scheduler-form.md +1 -1
  146. package/docs/scheduler-icalendar.md +1 -1
  147. package/docs/scheduler-mobile.md +1 -1
  148. package/docs/scheduler-recurrence.md +1 -1
  149. package/docs/scheduler-resources.md +1 -1
  150. package/docs/scheduler-timeline.md +1 -1
  151. package/docs/scheduler.md +1 -1
  152. package/docs/scrollview.md +1 -1
  153. package/docs/shortcuteditor.md +248 -0
  154. package/docs/showcase-home.md +1 -1
  155. package/docs/showcase.md +1 -1
  156. package/docs/signature.md +1 -1
  157. package/docs/skeleton.md +1 -1
  158. package/docs/slider.md +3 -3
  159. package/docs/sortable.md +1 -1
  160. package/docs/sparkline.md +1 -1
  161. package/docs/speeddial.md +1 -1
  162. package/docs/splitter.md +1 -1
  163. package/docs/stepper.md +1 -1
  164. package/docs/switch.md +1 -1
  165. package/docs/tabdocs-dock.md +1 -1
  166. package/docs/tabdocs-drag.md +1 -1
  167. package/docs/tabdocs-menus.md +1 -1
  168. package/docs/tabdocs-mobile.md +1 -1
  169. package/docs/tabdocs-tabs.md +1 -1
  170. package/docs/tabdocs-windows.md +1 -1
  171. package/docs/tabdocs-workspace.md +1 -1
  172. package/docs/tabdocs.md +1 -1
  173. package/docs/tabs.md +1 -1
  174. package/docs/tagbox.md +1 -1
  175. package/docs/textarea.md +1 -1
  176. package/docs/textbox.md +1 -1
  177. package/docs/tileview.md +1 -1
  178. package/docs/timeline.md +1 -1
  179. package/docs/toast.md +1 -1
  180. package/docs/tokens.md +13 -1
  181. package/docs/toolbar.md +1 -1
  182. package/docs/tooltip.md +1 -1
  183. package/docs/treeview.md +1 -1
  184. package/docs/validationsummary.md +1 -1
  185. package/docs/window.md +1 -1
  186. package/docs/wizard.md +1 -1
  187. package/llms-full.txt +3774 -2692
  188. package/llms.txt +16 -6
  189. package/package.json +4 -4
@@ -0,0 +1,208 @@
1
+ # MenuBar: Merging menus
2
+
3
+ > MenuBar · @motifx-community/ui 0.1.0-beta.11
4
+
5
+ A page can have several bars: the app’s bar, and the bars of documents, windows and tabs. The bar of the document in use shows its items in the app’s bar, so the user always finds the commands in one place.
6
+
7
+ ## Merging into the app’s bar
8
+
9
+ The app’s bar is marked `mergeHost`; a page with several such bars names them with `mergeName` (`'main'` by default). The bar of a document names the app’s bar with `mergeInto`, by name or as the bar itself; the two can be anywhere in the component tree. While it is merged, its items are shown in the app’s bar and it hides itself (`hideWhenMerged`).
10
+
11
+ `mergeAt` places an item: an index, or `{ before: key }` or `{ after: key }`. A merged item’s action, `onItemClick` and the user’s changes stay with its own bar, and it takes another access key when the app’s bar already uses its letter.
12
+
13
+ ```tsx
14
+ import { reactive } from '@motifx/core';
15
+ import { MenuBar, Stack, Tab, Tabs, type MenuItem, type MenuItemClickEventArgs } from '@motifx-community/ui';
16
+
17
+ /** The app's bar, and a bar in each document: the bar of the document shown merges into the app's. */
18
+ export default function MergedMenus() {
19
+ const s = reactive({ told: 'Nothing yet.' });
20
+ const tell = (e: MenuItemClickEventArgs) => (s.told = `${String(e.item.text).replace('&', '')} in ${(e.source as MenuBar).label}`);
21
+
22
+ const app: MenuItem[] = [
23
+ { key: 'file', text: '&File', items: [{ key: 'new', text: '&New' }, { key: 'open', text: '&Open…' }, { key: 'exit', text: 'E&xit', beginGroup: true }] },
24
+ { key: 'edit', text: '&Edit', items: [{ key: 'undo', text: '&Undo' }, { key: 'redo', text: '&Redo' }] },
25
+ { key: 'window', text: '&Window', items: [{ key: 'split', text: '&Split' }] },
26
+ { key: 'help', text: '&Help', items: [{ key: 'about', text: '&About' }] },
27
+ ];
28
+ const report: MenuItem[] = [
29
+ { key: 'file', text: '&File', items: [{ key: 'export', text: 'Export as &PDF', mergeAt: { after: 'open' } }] },
30
+ { key: 'format', text: 'F&ormat', mergeAt: { before: 'window' }, items: [{ key: 'bold', text: '&Bold' }, { key: 'italic', text: '&Italic' }] },
31
+ ];
32
+ const sheet: MenuItem[] = [
33
+ { key: 'edit', text: '&Edit', items: [{ key: 'fill', text: '&Fill down', beginGroup: true }] },
34
+ { key: 'data', text: '&Data', mergeAt: { before: 'window' }, items: [{ key: 'sort', text: '&Sort' }, { key: 'filter', text: 'F&ilter' }] },
35
+ { key: 'window', merge: 'remove', text: 'Window' },
36
+ ];
37
+
38
+ return (
39
+ <Stack gap="md">
40
+ <MenuBar label="App" items={app} mergeHost mergeName="docs-demo" onItemClick={tell} />
41
+ <Tabs label="Documents">
42
+ <Tab key="report" title="Report.docx">
43
+ <MenuBar class="mb-merge-report" label="Report" items={report} mergeInto="docs-demo" onItemClick={tell} />
44
+ <p>The report’s own commands are in the app’s bar while this document is shown.</p>
45
+ </Tab>
46
+ <Tab key="sheet" title="Budget.xlsx">
47
+ <MenuBar class="mb-merge-sheet" label="Budget" items={sheet} mergeInto="docs-demo" onItemClick={tell} />
48
+ <p>The budget adds Data, joins Edit and takes Window away.</p>
49
+ </Tab>
50
+ </Tabs>
51
+ <output class="mb-merge-told">{() => s.told}</output>
52
+ </Stack>
53
+ );
54
+ }
55
+ ```
56
+
57
+ | merge | What the item does in the app’s bar |
58
+ | --- | --- |
59
+ | `auto` | The default. An item with a menu joins the app’s item with the same key; any other item is added. |
60
+ | `add` | Always added beside the app’s items, even when one has the same key. |
61
+ | `replace` | Takes the place of the app’s item with the same key. |
62
+ | `remove` | Takes the app’s item with the same key away while the bar is merged. |
63
+ | `none` | Stays out of the app’s bar. |
64
+
65
+ ## When a bar merges
66
+
67
+ | mergeWhen | Merged |
68
+ | --- | --- |
69
+ | `shown` | The default. Merged while the bar’s place (`mergeScope`, its parent by default) is shown: the tab or the document shown. |
70
+ | `focus` | Merged while focus is in its place, such as a window that is not modal. |
71
+ | `manual` | Merged only by `merge()` and unmerged by `unmerge()`. |
72
+
73
+ The app’s bar reports the bars that come and go with `onMerged` and `onUnmerged`; `mergedBars`, `mergedInto` and `mergedItems` tell what is merged now. A bar that waits for an app’s bar not yet created merges when it comes.
74
+
75
+ ## Documents of a TabDocumentManager
76
+
77
+ Each document has a bar in its content; the bar of the active document is the one shown, so its menus are in the app’s bar. A document moved into a browser window of its own is shown there too: its menus stay in the app’s bar of the main window, beside those of the document shown in the main window, until the window closes.
78
+
79
+ ```tsx
80
+ import { reactive } from '@motifx/core';
81
+ import { Button, MenuBar, Stack, Switch, TabDocument, TabDocumentManager, TextBox, type MenuItem, type MenuItemClickEventArgs } from '@motifx-community/ui';
82
+
83
+ /**
84
+ * Documents of a TabDocumentManager, each with its own bar: the menus of the active document are shown in the app's
85
+ * bar, also while the document is in a browser window of its own. The switch merges a bar only while focus is in its
86
+ * document.
87
+ */
88
+ export default function MergedDocuments() {
89
+ const s = reactive({ told: 'Nothing yet.', focus: false });
90
+ const tell = (e: MenuItemClickEventArgs) => (s.told = `${String(e.item.text).replace('&', '')} in ${(e.source as MenuBar).label}`);
91
+
92
+ const app: MenuItem[] = [
93
+ { key: 'file', text: '&File', items: [{ key: 'new', text: '&New' }, { key: 'open', text: '&Open…' }, { key: 'close', text: '&Close', beginGroup: true }] },
94
+ { key: 'view', text: '&View', items: [{ key: 'zoom', text: '&Zoom' }] },
95
+ { key: 'help', text: '&Help', items: [{ key: 'about', text: '&About' }] },
96
+ ];
97
+ const documentOf = (title: string, items: MenuItem[], text: string) => () => (
98
+ <div class="mb-doc">
99
+ <MenuBar label={title} items={items} mergeInto="docs-documents" mergeWhen={() => (s.focus ? 'focus' : 'shown')} onItemClick={tell} />
100
+ <p>{text}</p>
101
+ <TextBox label={`${title} notes`} />
102
+ </div>
103
+ );
104
+
105
+ const docs = new TabDocumentManager({ label: 'Documents with menus' });
106
+ docs.element.style.cssText = 'block-size: 18rem; inline-size: 100%';
107
+ docs.open(
108
+ new TabDocument({
109
+ id: 'letter',
110
+ title: 'Letter',
111
+ content: documentOf('Letter', [{ key: 'format', text: 'F&ormat', mergeAt: { before: 'help' }, items: [{ key: 'bold', text: '&Bold' }, { key: 'italic', text: '&Italic' }] }], 'The letter adds Format.'),
112
+ }),
113
+ );
114
+ docs.open(
115
+ new TabDocument({
116
+ id: 'photo',
117
+ title: 'Photo',
118
+ content: documentOf(
119
+ 'Photo',
120
+ [
121
+ { key: 'image', text: '&Image', mergeAt: { before: 'help' }, items: [{ key: 'crop', text: '&Crop' }, { key: 'rotate', text: '&Rotate' }] },
122
+ { key: 'view', text: '&View', items: [{ key: 'actual', text: '&Actual size' }] },
123
+ ],
124
+ 'The photo adds Image and joins View.',
125
+ ),
126
+ }),
127
+ );
128
+
129
+ return (
130
+ <>
131
+ <MenuBar label="Studio" items={app} mergeHost mergeName="docs-documents" onItemClick={tell} />
132
+ <Stack orientation="horizontal" wrap align="center">
133
+ <Switch label="Merge only while focus is in the document" x-model={() => s.focus} />
134
+ <Button
135
+ text="Move the active document into a new window"
136
+ variant="outline"
137
+ enabled={() => !!docs.activeDocument && !docs.activeDocument.browserWindow}
138
+ onclick={() => docs.moveToNewWindow(docs.activeDocument!)}
139
+ />
140
+ <Button text="Bring it back" variant="outline" enabled={() => docs.browserWindows.length > 0} onclick={() => docs.browserWindows.forEach((w) => w.moveToMainWindow())} />
141
+ </Stack>
142
+ {docs}
143
+ <output class="mb-docs-told">{() => s.told}</output>
144
+ </>
145
+ );
146
+ }
147
+ ```
148
+
149
+ ## A window
150
+
151
+ A window that is not modal stays open while the user works elsewhere, so its bar merges while focus is in it (`mergeWhen: 'focus'`).
152
+
153
+ ```tsx
154
+ import type { Component } from '@motifx/core';
155
+ import { reactive } from '@motifx/core';
156
+ import { Button, MenuBar, MxForm, Stack, TextBox, type MenuItem, type MenuItemClickEventArgs } from '@motifx-community/ui';
157
+
158
+ /** A window with its own bar that merges while focus is in the window (`mergeWhen: 'focus'`). */
159
+ export default function MergedWindow() {
160
+ const s = reactive({ told: 'Nothing yet.' });
161
+ const tell = (e: MenuItemClickEventArgs) => (s.told = `${String(e.item.text).replace('&', '')} in ${(e.source as MenuBar).label}`);
162
+ let host: Component<HTMLDivElement> | null = null;
163
+ let form: MxForm | null = null;
164
+
165
+ const app: MenuItem[] = [
166
+ { key: 'file', text: '&File', items: [{ key: 'new', text: '&New' }, { key: 'exit', text: 'E&xit', beginGroup: true }] },
167
+ { key: 'help', text: '&Help', items: [{ key: 'about', text: '&About' }] },
168
+ ];
169
+ const notes: MenuItem[] = [
170
+ { key: 'file', text: '&File', items: [{ key: 'save', text: '&Save note', mergeAt: { after: 'new' } }] },
171
+ { key: 'insert', text: '&Insert', mergeAt: { before: 'help' }, items: [{ key: 'date', text: '&Date' }, { key: 'list', text: '&List' }] },
172
+ ];
173
+
174
+ const open = () => {
175
+ if (form && !form.isDisposed) {
176
+ form.focus();
177
+ return;
178
+ }
179
+ form = new MxForm({
180
+ title: 'Note',
181
+ startPosition: 'manual',
182
+ left: 120,
183
+ top: 160,
184
+ width: '22rem',
185
+ content: (
186
+ <div class="mb-window-note">
187
+ <MenuBar label="Note" items={notes} mergeInto="docs-window" mergeWhen="focus" onItemClick={tell} />
188
+ <TextBox label="Title" />
189
+ </div>
190
+ ),
191
+ });
192
+ form.show(host!);
193
+ };
194
+
195
+ return (
196
+ <Stack gap="md" ref={(c: Stack) => (host = c)}>
197
+ <MenuBar label="Desk" items={app} mergeHost mergeName="docs-window" onItemClick={tell} />
198
+ <Button text="Open the note window" variant="outline" onclick={open} />
199
+ <p tabIndex={0} class="mb-window-page">Focus in the window shows its menus in the bar above; click here and they go back.</p>
200
+ <output class="mb-window-told">{() => s.told}</output>
201
+ </Stack>
202
+ );
203
+ }
204
+ ```
205
+
206
+ ## Feedback
207
+
208
+ Loading issues…
@@ -0,0 +1,74 @@
1
+ # MenuBar: Programmatic changes
2
+
3
+ > MenuBar · @motifx-community/ui 0.1.0-beta.11
4
+
5
+ The items of a bar can be changed while it runs: by path, without building the whole list again, or in place followed by `refresh()`. Items can also name app commands, which give them their text, keys, state and action.
6
+
7
+ ## Changes by path
8
+
9
+ An item is named by the keys along the way, joined with `/`: `file/save`; an item without a `key` is named by its position. Each change makes a new list, in which the items along the changed path are new objects and the others are the ones given, and `onItemsChanged` reports it. An open menu stays open with its new items.
10
+
11
+ ```tsx
12
+ import { reactive } from '@motifx/core';
13
+ import { Button, MenuBar, Stack, type MenuItem } from '@motifx-community/ui';
14
+
15
+ const START: MenuItem[] = [
16
+ { key: 'file', text: '&File', items: [{ key: 'new', text: '&New' }, { key: 'save', text: '&Save' }] },
17
+ { key: 'edit', text: '&Edit', items: [{ key: 'undo', text: '&Undo' }, { key: 'paste', text: '&Paste' }] },
18
+ { key: 'help', text: '&Help', items: [{ key: 'about', text: '&About' }] },
19
+ ];
20
+
21
+ /** Items added, removed, moved and changed by path; the list given is never changed. */
22
+ export default function MenuChanges() {
23
+ const s = reactive({ changes: 0 });
24
+ let bar!: MenuBar;
25
+
26
+ return (
27
+ <Stack gap="md">
28
+ <MenuBar ref={(b: MenuBar) => (bar = b)} class="mb-changes" label="Changes" items={START} onItemsChanged={() => s.changes++} />
29
+ <Stack orientation="horizontal" gap="sm" wrap>
30
+ <Button text="Add Print to File" variant="outline" onclick={() => bar.addItem('file', { key: 'print', text: '&Print', shortcut: 'Ctrl+P' })} />
31
+ <Button text="Turn Save off" variant="outline" onclick={() => bar.updateItem('file/save', { enabled: false })} />
32
+ <Button text="Move Paste to File" variant="outline" onclick={() => bar.moveItem('edit/paste', 0, 'file')} />
33
+ <Button text="Move Help first" variant="outline" onclick={() => bar.moveItem('help', 0)} />
34
+ <Button text="Remove Edit" variant="outline" onclick={() => bar.removeItem('edit')} />
35
+ <Button text="Start again" variant="outline" onclick={() => (bar.items = START)} />
36
+ </Stack>
37
+ <output class="mb-changes-told">{() => `${s.changes} changes`}</output>
38
+ </Stack>
39
+ );
40
+ }
41
+ ```
42
+
43
+ | Method | Returns | Description |
44
+ | --- | --- | --- |
45
+ | `findItem(path)` | `MenuItem \| null` | The item at the path, as it is now. |
46
+ | `addItem(parentPath, item, index?)` | `boolean` | Adds an item to the menu at `parentPath` (the bar when empty), at the end by default. |
47
+ | `removeItem(path)` | `boolean` | Removes the item with its menu. |
48
+ | `moveItem(path, index, toParent?)` | `boolean` | Moves the item to `index` in its menu, or in the menu at `toParent`. |
49
+ | `updateItem(path, changes)` | `boolean` | Changes fields of the item; the others stay as they are. |
50
+ | `beginUpdate(), endUpdate()` | `void` | Applies the changes made between them at once, with one `onItemsChanged`. |
51
+ | `refresh()` | `void` | Reads items changed in place again: the bar, the open menu and its submenus update. |
52
+
53
+ ## Changes in place
54
+
55
+ Your items can be plain objects or reactive ones, and the bar reads them as they are. A field given as a function is followed by itself; after changing plain items in place, call `refresh()`.
56
+
57
+ ```tsx
58
+ const items = [{ key: 'file', text: '&File', items: [{ key: 'save', text: '&Save', enabled: () => doc.dirty }] }];
59
+ items[0].items.push({ key: 'print', text: '&Print' });
60
+ bar.refresh();
61
+ ```
62
+
63
+ ## Items that name commands
64
+
65
+ An item with `command: 'save'` takes what it is not given from the app command with that key: its text, icon, hint, the keys shown at its end, its state and its action. The command’s keys run it, and the user can assign other keys to them. See [Commands and shortcuts](commands.md).
66
+
67
+ ```tsx
68
+ commands.add({ key: 'save', text: '&Save', shortcut: 'Mod+S', enabled: () => doc.dirty, run: () => doc.save() });
69
+ <MenuBar items={[{ key: 'file', text: '&File', items: [{ command: 'save' }] }]} />
70
+ ```
71
+
72
+ ## Feedback
73
+
74
+ Loading issues…
package/docs/menus.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # MenuBar and ContextMenu
2
2
 
3
- > Buttons · @motifx-community/ui 0.1.0-beta.8
3
+ > MenuBar · @motifx-community/ui 0.1.0-beta.11
4
4
 
5
- An application menu bar (File, Edit, View) and a context menu that opens on right-click. Both use the same menu items, which support submenus, check and radio items, shortcuts and access keys.
5
+ An application menu bar (File, Edit, View) and a context menu that opens on right-click. Both use the same menu items, which support submenus, check and radio items, shortcuts and access keys. The bar can be customized by the user, changed by path and merged with the bars of documents and windows.
6
6
 
7
7
  ## Import
8
8
 
@@ -95,123 +95,37 @@ export default function MainMenu() {
95
95
 
96
96
  ## Submenus, check items, radio items and shortcuts
97
97
 
98
- An item with `items` opens a submenu at its side. Right (Left on right-to-left pages), Enter or Space opens it, Left and Escape close it, and hovering opens it after a short delay. `checked` creates a check item, and `checked` with a `group` creates one choice in a set, shown with a dot. `shortcut` is displayed at the end of the item, so register the key separately with `addShortcut`. The same items work in a `Button` menu.
98
+ An item with `items` opens a submenu at its side. Right (Left on right-to-left pages), Enter or Space opens it, Left and Escape close it, and hovering opens it after a short delay. `checked` creates a check item, and `checked` with a `group` creates one choice in a set, shown with a dot. `shortcut` is displayed at the end of the item; an item that names a [command](commands.md) shows and runs the command’s keys. The same items work in a `Button` menu and a `ContextMenu`.
99
99
 
100
100
  | Field | Type | Description |
101
101
  | --- | --- | --- |
102
+ | `key` | `string \| number` | Names the item in paths (`file/save`), in what the user changed and in merging. Without it, an item is named by its position. |
102
103
  | `text` | `Bind<string>` | The label. `&Copy` makes C select the item while the menu is open (Alt+C on a top-level menu bar item). |
104
+ | `command` | `string` | The key of an app command (`commands`). What the item is not given, such as its text, icon, keys, state and action, comes from the command. |
103
105
  | `icon, hint` | `Bind<…>` | An icon at the start, and a tooltip. |
104
- | `shortcut` | `Bind<string>` | A key combination displayed at the end (`Ctrl+S`). It is for display only, so register the key with `addShortcut`. |
105
- | `description` | `Bind<string>` | A second, dimmer text after the label that distinguishes the item, such as a folder name. It is part of the item's name and never a key. |
106
+ | `shortcut` | `Bind<string>` | A key combination displayed at the end (`Ctrl+S`). It is for display only: register the key with `addShortcut`, or name a command, whose keys are shown and run. |
107
+ | `description` | `Bind<string>` | A second, dimmer text after the label that distinguishes the item, such as a folder name. It is part of the item’s name and never a key. |
106
108
  | `items` | `Bind<readonly MenuItem[]>` | A submenu that opens at the side. |
107
109
  | `checked` | `Bind<boolean>` | A check item (`menuitemcheckbox`). |
108
110
  | `group` | `Bind<string>` | With `checked`, one choice in a group (`menuitemradio`), shown with a dot. |
109
111
  | `enabled, visible` | `Bind<boolean>` | Dims the item so it cannot be selected, or removes it. |
110
112
  | `beginGroup` | `Bind<boolean>` | Draws a separator before the item. |
111
113
  | `tone` | `Bind<'standard' \| 'accent' \| 'success' \| 'caution' \| 'danger'>` | Colors the item with a kit tone (`danger` for destructive actions). A toolbar button moved into the overflow menu keeps its tone. |
114
+ | `customizable` | `Bind<boolean>` | `false` keeps the item shown and in its place in a customizable bar; nothing moves past it. |
115
+ | `merge` | `Bind<'auto' \| 'add' \| 'replace' \| 'remove' \| 'none'>` | In a bar merged into another: what the item does there. The default is `auto`. |
116
+ | `mergeAt` | `Bind<number \| { before } \| { after }>` | In a bar merged into another: where the item stands there. The default is the end. |
112
117
  | `click` | `(e) => void` | Occurs when the item is selected, after the menu closes. `e`: `{ item, source, event }`. |
113
118
  | `data` | `unknown` | A custom value. |
114
119
 
115
- ## ContextMenu
120
+ ## In this group
116
121
 
117
- A `ContextMenu` opens at the pointer when its target is right-clicked, and at the focused element with the Menu key or Shift+F10. `onOpening` receives the component under the pointer or the focus (`e.part`) and builds the items for it, in this case for a row in a list. Setting `e.cancel = true` leaves the browser's own menu. The menu closes on Escape or a click outside. When the page scrolls, it follows the element it opened on and closes once that element is out of view.
118
-
119
- ```tsx
120
- import { reactive, type Component, type ComponentBase } from '@motifx/core';
121
- import { ContextMenu, type MenuItem } from '@motifx-community/ui';
122
-
123
- interface FileRow {
124
- id: number;
125
- name: string;
126
- locked: boolean;
127
- starred: boolean;
128
- }
129
-
130
- const BOX = 'inline-size: 100%; margin: 0; list-style: none; padding: var(--mx-space-4); background: var(--mx-color-bg-card); border: var(--mx-border-width-1) solid var(--mx-color-stroke-card); border-radius: var(--mx-radius-lg)';
131
-
132
- /** A context menu whose items `onOpening` builds for the row of a list it opens on. */
133
- export default function FileList() {
134
- const s = reactive({
135
- log: 'Nothing chosen yet.',
136
- files: [
137
- { id: 1, name: 'report.docx', locked: false, starred: true },
138
- { id: 2, name: 'budget.xlsx', locked: true, starred: false },
139
- { id: 3, name: 'photo.png', locked: false, starred: false },
140
- ] as FileRow[],
141
- });
142
- let renamed = 0;
143
- let list: Component<HTMLUListElement> | null = null;
144
-
145
- const did = (what: string) => (s.log = what);
146
- const rename = (row: FileRow) => {
147
- row.name = `copy-${++renamed}-${row.name}`;
148
- did(`Renamed to ${row.name}`);
149
- };
150
-
151
- const rowItems = (row: FileRow): MenuItem[] => [
152
- { text: '&Open', click: () => did(`Open ${row.name}`) },
153
- { text: '&Rename', enabled: !row.locked, click: () => rename(row) },
154
- { text: '&Star', checked: row.starred, click: () => (row.starred = !row.starred) },
155
- { text: '&Move to', items: ['Documents', 'Pictures', 'Archive'].map((folder) => ({ text: folder, click: () => did(`Move ${row.name} to ${folder}`) })) },
156
- { text: '&Delete', shortcut: 'Del', beginGroup: true, enabled: !row.locked, click: () => (s.files = s.files.filter((f) => f !== row)) },
157
- ];
158
-
159
- const rowOf = (part: ComponentBase) => {
160
- let id: string | null = null;
161
- for (let at: ComponentBase | null = part; at && !id; at = at.parent) id = at.attr.get('data-id');
162
- return s.files.find((f) => f.id === Number(id));
163
- };
164
-
165
- return (
166
- <>
167
- <ul class="cm-list" aria-label="Files" ref={(c: Component<HTMLUListElement>) => (list = c)} style={BOX}>
168
- {s.files.map((file) => (
169
- <li key={file.id} data-id={String(file.id)} tabindex="0" style="padding-block: var(--mx-space-2)">
170
- {() => `${file.starred ? '★ ' : ''}${file.name}${file.locked ? ' (locked)' : ''}`}
171
- </li>
172
- ))}
173
- </ul>
174
- <ContextMenu
175
- target={() => list}
176
- label="File"
177
- onOpening={(e) => {
178
- const row = rowOf(e.part);
179
- if (row) e.items = rowItems(row);
180
- else e.cancel = true;
181
- }}
182
- />
183
- <output class="cm-log">{() => s.log}</output>
184
- </>
185
- );
186
- }
187
- ```
188
-
189
- ```tsx
190
- import { reactive, type Component } from '@motifx/core';
191
- import { attachContextMenu } from '@motifx-community/ui';
192
-
193
- const START = 'Right-click here, or focus me and press the Menu key.';
194
- const BOX = 'padding: var(--mx-space-4); background: var(--mx-color-bg-card); border: var(--mx-border-width-1) solid var(--mx-color-stroke-card); border-radius: var(--mx-radius-lg)';
195
-
196
- /** A menu given to a component with `attachContextMenu`, its items built from the opening. */
197
- export default function AttachedMenu() {
198
- const s = reactive({ zone: START });
199
-
200
- const attach = (c: Component<HTMLDivElement>) => {
201
- const remove = attachContextMenu(c, (e) => [
202
- { text: '&Say where', click: () => (s.zone = `Opened ${e.byKeyboard ? 'from the keyboard' : 'with the pointer'} on ${e.part === c ? 'the zone' : 'its content'}.`) },
203
- { text: '&Reset', click: () => (s.zone = START) },
204
- ]);
205
- c.motif.setDisposable(remove);
206
- };
207
-
208
- return (
209
- <div class="cm-zone" tabindex="0" style={BOX} onBuilt={attach}>
210
- {() => s.zone}
211
- </div>
212
- );
213
- }
214
- ```
122
+ | Page | Content |
123
+ | --- | --- |
124
+ | `[ContextMenu](menus-context.md)` | The menu of an element, opened by a right-click, the Menu key or Shift+F10. |
125
+ | `[Customization](menus-customization.md)` | The user hides, moves, renames and adds items, and changes keyboard shortcuts; the changes are one object to save. |
126
+ | `[Programmatic changes](menus-programmatic.md)` | Items added, removed, moved and changed by path, and items that name app commands. |
127
+ | `[Merging menus](menus-merging.md)` | The bar of a document, a window or a tab shows its items in the app’s bar. |
128
+ | `[API reference](menus-api.md)` | Every prop, property, method and event. |
215
129
 
216
130
  ## Keyboard
217
131
 
@@ -221,11 +135,11 @@ export default function AttachedMenu() {
221
135
  | `Left / Right` | On the bar, moves to the previous or next top-level item. In a menu, moves to the adjacent menu or closes a submenu (Right opens one). These keys are mirrored on right-to-left pages. |
222
136
  | `Down, Enter, Space` | On the bar, opens the menu on its first item. Up opens it on the last item. |
223
137
  | `Up / Down, Home / End` | In a menu, moves between items and wraps at the ends. |
224
- | `A letter` | Moves to the next item that starts with that letter. An item's `&` key selects it. |
138
+ | `A letter` | Moves to the next item that starts with that letter. An item’s `&` key selects it. |
225
139
  | `Alt + key` | Opens the top-level item with that `&` key (Control + Option on Apple platforms). |
226
140
  | `Escape` | Closes a submenu, then the menu, and returns to where it opened. |
227
141
  | `F10` | Moves focus to the menu bar when `focusOnF10` is set. |
228
- | `Menu key, Shift+F10` | Opens a context menu at the focused element. |
142
+ | `Menu key, Shift+F10` | Opens a context menu at the focused element; on a customizable bar, the menu of the focused item. |
229
143
 
230
144
  ## Accessibility
231
145
 
@@ -235,82 +149,11 @@ export default function AttachedMenu() {
235
149
  | `Menus` | `role="menu"`. Items are `menuitem`, `menuitemcheckbox` or `menuitemradio` with `aria-checked`. Disabled items have `aria-disabled` and remain reachable. |
236
150
  | `Submenus` | The item has `aria-haspopup="menu"` and `aria-expanded`. The submenu opens next to it, focus moves in and returns when it closes. |
237
151
  | `Focus` | A menu opened from the keyboard focuses its first item, and a menu opened with the pointer focuses the menu itself. Closing returns focus. |
238
- | `Shortcuts` | The shortcut text is part of the item's name. Access keys are exposed through `aria-keyshortcuts` on top-level items. |
152
+ | `Shortcuts` | The shortcut text is part of the item’s name. Access keys are exposed through `aria-keyshortcuts` on top-level items. |
239
153
 
240
154
  ## Localization
241
155
 
242
- Menus have no strings of their own. Every label, shortcut and name comes from your items, so they follow your own translations. A function in `text` updates immediately when the language changes.
243
-
244
- ## Styling
245
-
246
- | Hook | Description |
247
- | --- | --- |
248
- | `.mx-menubar, .mx-menubar__bar, .mx-menubar__item` | The menu bar, its row and a top-level item (`aria-expanded="true"` while open). |
249
- | `.mx-context-menu, .mx-context-menu__anchor` | The context menu, which has no box of its own, and the point it opens at. |
250
- | `.mx-menu, .mx-menu__item, .mx-menu__separator` | A menu (shared with Button), an item and a separator. |
251
- | `.mx-menu__check, .mx-menu__icon, .mx-menu__label, .mx-menu__description, .mx-menu__shortcut, .mx-menu__arrow` | The parts of an item. |
252
-
253
- ### Component tokens
254
-
255
- | Token | Description |
256
- | --- | --- |
257
- | `menubar.height, menubar.item-height` | The height of the bar and of a top-level item. |
258
- | `menubar.bar, menubar.item, menubar.icon, menubar.mnemonic` | Units: the bar, a top-level item with its box per state (`hover`, `pressed`, `open`, `disabled`, `focus`), its icon, and its access key indicator (`shown`). |
259
- | `menu.item, menu.item-height, menu.item-white-space` | Menu items, shared with the Button menu: the item unit in each state (`highlight`, `pressed`, `focus`, `checked`, `disabled`, `first`, `last`, each tone and `<tone>-highlight`), the row height, and text wrapping. |
260
- | `menu.panel, menu.check, menu.icon, menu.check-mark, menu.radio-mark, menu.separator` | Units: the item column, the leading indicator and icon, the check and radio marks, and the separator between groups. |
261
- | `menu.label, menu.description, menu.shortcut, menu.arrow` | Units: the item text, its description, the shortcut and the submenu arrow. |
262
-
263
- ## API reference
264
-
265
- ### MenuBar props
266
-
267
- | Prop | Type | Default | Description |
268
- | --- | --- | --- | --- |
269
- | `items` | `Bind<readonly MenuItem[]>` | `[]` | The top-level items, whose `items` define the menus they open. A top-level item without `items` runs its `click`. |
270
- | `label` | `Bind<string>` | `''` | The accessible name of the bar. This is the same property as `text`. |
271
- | `focusOnF10` | `Bind<boolean>` | `false` | F10 moves focus to the bar from anywhere on the page. This is off by default because browsers use F10. |
272
- | `openOnHover` | `Bind<boolean>` | `true` | While a menu is open, hovering another top-level item opens its menu, and hovering an item opens its submenu. |
273
- | `enabled / disabled, visible, tabStop, tabIndex` | see Control | | Properties shared by all controls. |
274
-
275
- ### ContextMenu props
276
-
277
- | Prop | Type | Default | Description |
278
- | --- | --- | --- | --- |
279
- | `items` | `Bind<readonly MenuItem[]>` | `[]` | The commands. `onOpening` can provide different ones for each component. |
280
- | `target` | `Bind<Component \| null>` | Its parent | The component the menu belongs to. If not set, this is the component the `ContextMenu` is placed in. |
281
- | `label` | `Bind<string>` | `''` | The accessible name of the menu. |
282
- | `keyboard` | `Bind<boolean>` | `true` | The Menu key and Shift+F10 open the menu at the focused element. |
283
- | `closeOnScroll` | `Bind<boolean>` | `true` | Scrolling the element out of view closes the menu. Until then, the menu follows the element. |
284
- | `openOnHover` | `Bind<boolean>` | `true` | Hovering an item opens its submenu. |
285
- | `enabled` | `Bind<boolean>` | `true` | `false` shows the browser's own menu. |
286
-
287
- ### Properties
288
-
289
- | Property | Access | Description |
290
- | --- | --- | --- |
291
- | `MenuBar.openItem` | read-only, reactive | The top-level item whose menu is open. |
292
- | `ContextMenu.opened` | read-only, reactive | Indicates whether it is open. |
293
- | `ContextMenu.targetPart` | read-only, reactive | The component the menu was last opened on. |
294
- | `ContextMenu.target` | read/write, reactive | The component the menu listens on. |
295
-
296
- ### Methods
297
-
298
- | Method | Returns | Description |
299
- | --- | --- | --- |
300
- | `MenuBar.open(item \| index)` | `boolean` | Opens a top-level item's menu with focus on its first item. |
301
- | `MenuBar.close()` | `void` | Closes the open menu. |
302
- | `ContextMenu.open(at, target?)` | `boolean` | Opens the menu programmatically, at `{ x, y }` or at a component. |
303
- | `ContextMenu.close()` | `void` | Closes it. |
304
- | `MenuBar.refresh(), ContextMenu.refresh()` | `void` | Your items can be plain or reactive, and the menu reads them as they are. After changing them in place, call `refresh()`. The bar, the open menu and its submenus update. |
305
- | `attachContextMenu(target, items)` | `() => void` | Attaches a menu to a component. `items` can be a function of the opening event (`e.part`). Returns a function that removes the menu. |
306
-
307
- ### Events
308
-
309
- | Event | When |
310
- | --- | --- |
311
- | `onItemClick(e)` | On both components, occurs when an item is selected, after its own `click`. |
312
- | `ContextMenu.onOpening(e)` | Occurs before the menu opens. `e`: `{ part, items, cancel, byKeyboard, event, source }`. Set `e.items` for the component `part`, or set `e.cancel = true`. |
313
- | `ContextMenu.onClosed(reason)` | `escape`, `outside`, `focus` or `code`. |
156
+ Every label, shortcut and name of an item comes from your items, so they follow your own translations. A function in `text` updates immediately when the language changes. The texts of the bar itself, such as those of its customizer, come from the kit’s language packs.
314
157
 
315
158
  ## Feedback
316
159
 
package/docs/multiview.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MultiView
2
2
 
3
- > Navigation · @motifx-community/ui 0.1.0-beta.8
3
+ > Navigation · @motifx-community/ui 0.1.0-beta.11
4
4
 
5
5
  Displays one page at a time from a horizontal set. Users move between pages with a swipe or drag, and you can navigate with `next()`, `previous()` and `goTo()`, or with [Tabs](tabs.md), a [Stepper](stepper.md) or buttons bound to the same value. It works like the panels of a tab control without the tab strip.
6
6
 
@@ -1,8 +1,8 @@
1
1
  # Navigation
2
2
 
3
- > Navigation · @motifx-community/ui 0.1.0-beta.8
3
+ > Navigation · @motifx-community/ui 0.1.0-beta.11
4
4
 
5
- Navigation components move the reader around an application and lay out its screens: bars at the top and bottom, tabs, paths, steps and pages, panels that slide in, and the containers that arrange everything.
5
+ Navigation components move the reader around an application and lay out its screens: bars at the top and bottom, menus and toolbars, tabs, paths, steps and pages, panels that slide in, and the containers that arrange everything.
6
6
 
7
7
  ## A project app
8
8
 
@@ -97,6 +97,8 @@ Each component has its own page with its examples and its full API.
97
97
  | Component | For |
98
98
  | --- | --- |
99
99
  | `[AppBar](appbar.md)` | The bar at the top of an application. |
100
+ | `[MenuBar and ContextMenu](menus.md)` | The menus of an application and the menu of an element, with shortcuts, check items and access keys. |
101
+ | `[Toolbar](toolbar.md)` | A row of commands that moves what does not fit into a menu. |
100
102
  | `[BottomNavigation](bottomnavigation.md)` | The main places of an application at the bottom of a phone screen. |
101
103
  | `[Tabs](tabs.md)` | Views of the same thing, one at a time. |
102
104
  | `[Breadcrumb](breadcrumb.md)` | Where the reader is in a hierarchy. |
@@ -120,6 +122,9 @@ Several components can do the same job; this table points to the one that reads
120
122
  | `Split a long list` | [Pagination](pagination.md) |
121
123
  | `Fold away sections` | [Accordion](accordion.md) |
122
124
  | `Give an application its menu` | [Drawer](drawer.md), or [AppBar](appbar.md) with its menu button |
125
+ | `Offer the commands of a whole application` | [MenuBar](menus.md), or [RibbonMenu](ribbonmenu.md) for many commands in tabs |
126
+ | `Keep many commands in one bar at any width` | [Toolbar](toolbar.md) |
127
+ | `Act on what is under the pointer` | [ContextMenu](menus-context.md) |
123
128
  | `Reach the main places on a phone` | [BottomNavigation](bottomnavigation.md) |
124
129
  | `Offer actions on a phone` | [ActionSheet](actionsheet.md) |
125
130
  | `Put content beside content, resizable` | [Splitter](splitter.md) |
package/docs/numberbox.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # NumberBox
2
2
 
3
- > Editors · @motifx-community/ui 0.1.0-beta.8
3
+ > Editors · @motifx-community/ui 0.1.0-beta.11
4
4
 
5
5
  A numeric input with arrow key support, PageUp and PageDown, spin buttons that repeat while held, min and max limits, exact decimal stepping, display formats such as currency and percent, and locale-aware input.
6
6
 
@@ -111,7 +111,7 @@ export default function SpinButtons() {
111
111
 
112
112
  ## Format and locale
113
113
 
114
- Without focus, the value is displayed through `Intl.NumberFormat` using `format` and `locale` (the kit's language, `uiLocale.locale`, by default). With focus, it switches to a plain number for editing. Input is parsed in the same locale: `1.234,5` in Turkish and `1,234.5` in English. A `.` also works as the decimal point where it cannot be a group separator. A percent is edited as displayed, so 0.125 is entered as 12.5.
114
+ Without focus, the value is displayed through `Intl.NumberFormat` using `format` and `locale` (the page `lang` by default). With focus, it switches to a plain number for editing. Input is parsed in the same locale: `1.234,5` in Turkish and `1,234.5` in English. A `.` also works as the decimal point where it cannot be a group separator. A percent is edited as displayed, so 0.125 is entered as 12.5.
115
115
 
116
116
  ```tsx
117
117
  import { reactive } from '@motifx/core';
@@ -266,7 +266,7 @@ export default function Localization() {
266
266
  | `spinLayout` | `Bind<SpinLayout>` | `'stacked'` | `stacked` shows arrows on top of each other, and `inline` shows − and + side by side. |
267
267
  | `wheel` | `Bind<boolean>` | `false` | The mouse wheel changes the value while the field has focus. |
268
268
  | `format` | `Bind<Intl.NumberFormatOptions>` | `{}` | The display format without focus: `{ style: 'currency', currency: 'TRY' }`, `{ style: 'percent' }`, `{ minimumFractionDigits: 2 }`… |
269
- | `locale` | `Bind<string>` | `uiLocale.locale` | The locale of the format and of the input. |
269
+ | `locale` | `Bind<string>` | The page `lang` | The locale of the format and of the input. |
270
270
  | `decimals` | `Bind<number \| null>` | `null` | The number of digits after the decimal point. Every value is rounded to this precision (half away from zero) regardless of its source, and displayed with exactly that many digits while the field is not being edited. |
271
271
  | `clamp` | `Bind<boolean>` | `true` | Brings a value outside `min` and `max` into range when entered. `false` leaves it to the range validation. |
272
272
  | `allowEmpty` | `Bind<boolean>` | `true` | An empty field is `null`. `false` replaces it with `min` (or 0) when the field loses focus. |
package/docs/otpinput.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # OtpInput
2
2
 
3
- > Editors · @motifx-community/ui 0.1.0-beta.8
3
+ > Editors · @motifx-community/ui 0.1.0-beta.11
4
4
 
5
5
  A one-time code in a row of boxes. Typing, pasting a whole code, the code a phone offers from a message and screen readers work as in any text box, because the boxes are drawn over one real input.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Pagination
2
2
 
3
- > Navigation · @motifx-community/ui 0.1.0-beta.8
3
+ > Navigation · @motifx-community/ui 0.1.0-beta.11
4
4
 
5
5
  Navigates through pages of items, with page size options, the current position, navigation buttons and a button for each nearby page. It switches to a compact layout when it does not fit, and it looks and works like the DataGrid pager.
6
6
 
package/docs/popover.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Popover
2
2
 
3
- > Feedback · @motifx-community/ui 0.1.0-beta.8
3
+ > Feedback · @motifx-community/ui 0.1.0-beta.11
4
4
 
5
5
  Displays content next to a related element, such as a title, a close button, a form or a card. It opens on click or on hover, follows its target, and points to it with an arrow where the design language includes one.
6
6