@motifx-community/ui 0.1.0-beta.16 → 0.1.0-beta.18

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 (234) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/components/datagrid/DataGrid.d.ts +2 -1
  3. package/dist/components/datagrid/grid-column.d.ts +6 -0
  4. package/dist/components/datagrid/model/ColumnModel.d.ts +2 -0
  5. package/dist/components/datagrid/model/GridModel.d.ts +4 -0
  6. package/dist/components/datagrid/view/ColumnStyles.d.ts +7 -3
  7. package/dist/components/datagrid/view/GridBody.d.ts +56 -4
  8. package/dist/components/diagram/Diagram.d.ts +92 -0
  9. package/dist/components/diagram/DiagramEdgeView.d.ts +14 -4
  10. package/dist/components/diagram/DiagramLinks.d.ts +2 -0
  11. package/dist/components/diagram/DiagramNodeView.d.ts +19 -1
  12. package/dist/components/diagram/diagram-change.d.ts +3 -2
  13. package/dist/components/diagram/diagram-edge-click-event-args.d.ts +21 -0
  14. package/dist/components/diagram/diagram-edge-pointer-event-args.d.ts +6 -0
  15. package/dist/components/diagram/diagram-edge.d.ts +8 -0
  16. package/dist/components/diagram/diagram-links-host.d.ts +3 -0
  17. package/dist/components/diagram/diagram-node-click-event-args.d.ts +23 -0
  18. package/dist/components/diagram/diagram-node-context.d.ts +5 -0
  19. package/dist/components/diagram/diagram-node-host.d.ts +4 -0
  20. package/dist/components/diagram/diagram-node-pointer-event-args.d.ts +6 -0
  21. package/dist/components/diagram/diagram-props.d.ts +45 -0
  22. package/dist/components/diagram/diagram-text-changed-event-args.d.ts +7 -0
  23. package/dist/components/diagram/diagram-text-changing-event-args.d.ts +14 -0
  24. package/dist/components/diagram/diagram-text-editing-event-args.d.ts +11 -0
  25. package/dist/components/diagram/index.d.ts +7 -0
  26. package/dist/core/ui-strings.d.ts +5 -0
  27. package/dist/excel/index.js +1 -1
  28. package/dist/excel/index.js.map +1 -1
  29. package/dist/index.js +1644 -759
  30. package/dist/index.js.map +1 -1
  31. package/dist/locales/en.json +3 -0
  32. package/dist/locales/tr.json +3 -0
  33. package/dist/parts/table/RowHeights.d.ts +23 -0
  34. package/dist/parts/table/ScrollGeometry.d.ts +6 -1
  35. package/dist/parts/table/table-sheet-column.d.ts +2 -0
  36. package/dist/pdf/index.js +1 -1
  37. package/dist/pdf/index.js.map +1 -1
  38. package/dist/pdf/pdf-export-options.d.ts +4 -1
  39. package/dist/styles.css +58 -0
  40. package/dist/{tr-4GNbFdQh.js → tr-CMuuXBUb.js} +8 -2
  41. package/dist/{tr-4GNbFdQh.js.map → tr-CMuuXBUb.js.map} +1 -1
  42. package/docs/accordion.md +1 -1
  43. package/docs/actionsheet.md +1 -1
  44. package/docs/appbar.md +1 -1
  45. package/docs/appmenu-api.md +1 -1
  46. package/docs/appmenu-programmatic.md +1 -1
  47. package/docs/appmenu-search.md +1 -1
  48. package/docs/appmenu.md +1 -1
  49. package/docs/avatar.md +1 -1
  50. package/docs/badge.md +1 -1
  51. package/docs/bar-gauge-angles.md +1 -1
  52. package/docs/bar-gauge-data.md +1 -1
  53. package/docs/bar-gauge-labels.md +1 -1
  54. package/docs/bar-gauge.md +1 -1
  55. package/docs/barcode.md +1 -1
  56. package/docs/bottomnavigation.md +1 -1
  57. package/docs/bottomsheet.md +1 -1
  58. package/docs/breadcrumb.md +1 -1
  59. package/docs/button.md +1 -1
  60. package/docs/buttongroup.md +1 -1
  61. package/docs/buttons.md +1 -1
  62. package/docs/calendar.md +1 -1
  63. package/docs/card.md +1 -1
  64. package/docs/chart-bars.md +1 -1
  65. package/docs/chart-candles.md +1 -1
  66. package/docs/chart-funnel.md +1 -1
  67. package/docs/chart-heatmap.md +1 -1
  68. package/docs/chart-lines.md +1 -1
  69. package/docs/chart-live.md +1 -1
  70. package/docs/chart-pie.md +1 -1
  71. package/docs/chart-radar.md +1 -1
  72. package/docs/chart-ranges.md +1 -1
  73. package/docs/chart-references.md +1 -1
  74. package/docs/chart-scatter.md +1 -1
  75. package/docs/chart-waterfall.md +1 -1
  76. package/docs/chart-zoom.md +1 -1
  77. package/docs/chart.md +1 -1
  78. package/docs/chat.md +1 -1
  79. package/docs/checkbox.md +1 -1
  80. package/docs/chip.md +1 -1
  81. package/docs/choice.md +1 -1
  82. package/docs/colorbox.md +1 -1
  83. package/docs/combobox.md +1 -1
  84. package/docs/commands.md +1 -1
  85. package/docs/control.md +1 -1
  86. package/docs/data.md +1 -1
  87. package/docs/datagrid-api.md +3 -2
  88. package/docs/datagrid-bands.md +1 -1
  89. package/docs/datagrid-drag-select.md +1 -1
  90. package/docs/datagrid-drag.md +1 -1
  91. package/docs/datagrid-editing.md +1 -1
  92. package/docs/datagrid-filtering.md +1 -1
  93. package/docs/datagrid-forms.md +1 -1
  94. package/docs/datagrid-grouping.md +1 -1
  95. package/docs/datagrid-layout.md +1 -1
  96. package/docs/datagrid-lookups.md +1 -1
  97. package/docs/datagrid-master-detail.md +1 -1
  98. package/docs/datagrid-scrolling.md +77 -1
  99. package/docs/datagrid-selection.md +1 -1
  100. package/docs/datagrid.md +1 -1
  101. package/docs/datebox.md +1 -1
  102. package/docs/daterangebox.md +1 -1
  103. package/docs/diagram-api.md +19 -4
  104. package/docs/diagram-commands.md +2 -1
  105. package/docs/diagram-connections.md +8 -6
  106. package/docs/diagram-custom-nodes.md +1 -1
  107. package/docs/diagram-designer.md +1 -1
  108. package/docs/diagram-editing.md +132 -5
  109. package/docs/diagram-flow.md +21 -4
  110. package/docs/diagram-keyboard.md +5 -1
  111. package/docs/diagram-layout.md +1 -1
  112. package/docs/diagram-nodes.md +1 -1
  113. package/docs/diagram-tables.md +1 -1
  114. package/docs/diagram.md +11 -8
  115. package/docs/display.md +1 -1
  116. package/docs/draggable.md +1 -1
  117. package/docs/drawer.md +1 -1
  118. package/docs/dropdown.md +1 -1
  119. package/docs/editors.md +1 -1
  120. package/docs/expressioneditor.md +1 -1
  121. package/docs/expressions.md +1 -1
  122. package/docs/feedback.md +1 -1
  123. package/docs/fileuploader.md +1 -1
  124. package/docs/filterbuilder.md +1 -1
  125. package/docs/formlayout-schema.md +1 -1
  126. package/docs/formlayout.md +1 -1
  127. package/docs/foundations.md +1 -1
  128. package/docs/gallery.md +1 -1
  129. package/docs/gauge-base.md +1 -1
  130. package/docs/gauge-circular.md +1 -1
  131. package/docs/gauge-dashboards.md +1 -1
  132. package/docs/gauge-linear.md +1 -1
  133. package/docs/gauge-markers.md +1 -1
  134. package/docs/gauge-marks.md +1 -1
  135. package/docs/gauge-ranges.md +1 -1
  136. package/docs/gauge-scales.md +1 -1
  137. package/docs/gauge.md +1 -1
  138. package/docs/home.md +1 -1
  139. package/docs/keyboard.md +1 -1
  140. package/docs/language.md +1 -1
  141. package/docs/layout.md +1 -1
  142. package/docs/listbox.md +1 -1
  143. package/docs/loadpanel.md +1 -1
  144. package/docs/lookup.md +1 -1
  145. package/docs/markdown.md +1 -1
  146. package/docs/menus-api.md +1 -1
  147. package/docs/menus-context.md +1 -1
  148. package/docs/menus-customization.md +1 -1
  149. package/docs/menus-merging.md +1 -1
  150. package/docs/menus-programmatic.md +1 -1
  151. package/docs/menus.md +1 -1
  152. package/docs/multiview.md +1 -1
  153. package/docs/navigation.md +1 -1
  154. package/docs/numberbox.md +1 -1
  155. package/docs/otpinput.md +1 -1
  156. package/docs/pagination.md +1 -1
  157. package/docs/pivotgrid-api.md +1 -1
  158. package/docs/pivotgrid-chart.md +1 -1
  159. package/docs/pivotgrid-drilldown.md +1 -1
  160. package/docs/pivotgrid-export.md +1 -1
  161. package/docs/pivotgrid-fields.md +1 -1
  162. package/docs/pivotgrid-keyboard.md +1 -1
  163. package/docs/pivotgrid-layout.md +1 -1
  164. package/docs/pivotgrid-panel.md +1 -1
  165. package/docs/pivotgrid-remote.md +1 -1
  166. package/docs/pivotgrid-sorting.md +1 -1
  167. package/docs/pivotgrid-state.md +1 -1
  168. package/docs/pivotgrid-summaries.md +1 -1
  169. package/docs/pivotgrid.md +1 -1
  170. package/docs/popover.md +1 -1
  171. package/docs/progress.md +1 -1
  172. package/docs/qrcode.md +1 -1
  173. package/docs/radiogroup.md +1 -1
  174. package/docs/rating.md +1 -1
  175. package/docs/resizable.md +1 -1
  176. package/docs/ribbonmenu-api.md +1 -1
  177. package/docs/ribbonmenu-commands.md +1 -1
  178. package/docs/ribbonmenu-customization.md +1 -1
  179. package/docs/ribbonmenu-display.md +1 -1
  180. package/docs/ribbonmenu-layouts.md +1 -1
  181. package/docs/ribbonmenu-programmatic.md +1 -1
  182. package/docs/ribbonmenu.md +1 -1
  183. package/docs/scheduler-agenda.md +1 -1
  184. package/docs/scheduler-big-data.md +1 -1
  185. package/docs/scheduler-editing.md +1 -1
  186. package/docs/scheduler-form.md +1 -1
  187. package/docs/scheduler-icalendar.md +1 -1
  188. package/docs/scheduler-mobile.md +1 -1
  189. package/docs/scheduler-recurrence.md +1 -1
  190. package/docs/scheduler-resources.md +1 -1
  191. package/docs/scheduler-timeline.md +1 -1
  192. package/docs/scheduler.md +1 -1
  193. package/docs/scrollview.md +1 -1
  194. package/docs/shortcuteditor.md +1 -1
  195. package/docs/showcase-flowstudio.md +1 -1
  196. package/docs/showcase-home.md +1 -1
  197. package/docs/showcase-mail.md +1 -1
  198. package/docs/showcase.md +1 -1
  199. package/docs/signature.md +1 -1
  200. package/docs/skeleton.md +1 -1
  201. package/docs/slider.md +1 -1
  202. package/docs/sortable.md +1 -1
  203. package/docs/sparkline.md +1 -1
  204. package/docs/speeddial.md +1 -1
  205. package/docs/splitter.md +1 -1
  206. package/docs/stepper.md +1 -1
  207. package/docs/switch.md +1 -1
  208. package/docs/tabdocs-dock.md +1 -1
  209. package/docs/tabdocs-drag.md +1 -1
  210. package/docs/tabdocs-menus.md +1 -1
  211. package/docs/tabdocs-mobile.md +1 -1
  212. package/docs/tabdocs-tabs.md +1 -1
  213. package/docs/tabdocs-windows.md +1 -1
  214. package/docs/tabdocs-workspace.md +1 -1
  215. package/docs/tabdocs.md +1 -1
  216. package/docs/tabs.md +1 -1
  217. package/docs/tagbox.md +1 -1
  218. package/docs/textarea.md +1 -1
  219. package/docs/textbox.md +1 -1
  220. package/docs/tileview.md +1 -1
  221. package/docs/timeline.md +1 -1
  222. package/docs/toast.md +1 -1
  223. package/docs/tokens.md +1 -1
  224. package/docs/toolbar-api.md +1 -1
  225. package/docs/toolbar-customization.md +1 -1
  226. package/docs/toolbar.md +1 -1
  227. package/docs/tooltip.md +1 -1
  228. package/docs/treeview.md +1 -1
  229. package/docs/validationsummary.md +1 -1
  230. package/docs/window.md +1 -1
  231. package/docs/wizard.md +1 -1
  232. package/llms-full.txt +460 -214
  233. package/llms.txt +1 -1
  234. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  # Chart: Bars
2
2
 
3
- > Charts · @motifx-community/ui 0.1.0-beta.16
3
+ > Charts · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  Bars compare amounts. They stand on a common baseline, so lengths compare exactly, side by side, stacked, or on their side for long names.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Chart: Candles
2
2
 
3
- > Charts · @motifx-community/ui 0.1.0-beta.16
3
+ > Charts · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  Candles show the first, highest, lowest and last price for each position.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Chart: Funnel
2
2
 
3
- > Charts · @motifx-community/ui 0.1.0-beta.16
3
+ > Charts · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  A funnel follows a quantity through stages in order, and shows how much of it is left at each one.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Chart: Heat map
2
2
 
3
- > Charts · @motifx-community/ui 0.1.0-beta.16
3
+ > Charts · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  A heat map shows a value for each pair of two categories as a color.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Chart: Lines and areas
2
2
 
3
- > Charts · @motifx-community/ui 0.1.0-beta.16
3
+ > Charts · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  Lines and areas show how values change along an axis: over time, or from one category to the next.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Chart: Live data
2
2
 
3
- > Charts · @motifx-community/ui 0.1.0-beta.16
3
+ > Charts · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  A chart follows its data: reactive values redraw it, and live data moves along with the latest values.
6
6
 
package/docs/chart-pie.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Chart: Pie and donut
2
2
 
3
- > Charts · @motifx-community/ui 0.1.0-beta.16
3
+ > Charts · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  A pie or a donut splits one whole into its parts, for a share seen at a glance.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Chart: Radar
2
2
 
3
- > Charts · @motifx-community/ui 0.1.0-beta.16
3
+ > Charts · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  A radar compares several measures at once, for one or more items.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Chart: Ranges
2
2
 
3
- > Charts · @motifx-community/ui 0.1.0-beta.16
3
+ > Charts · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  Ranges show a low and a high value for each position, as a band or as floating bars.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Chart: References and selection
2
2
 
3
- > Charts · @motifx-community/ui 0.1.0-beta.16
3
+ > Charts · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  Reference lines and bands give the values a target, a limit or a period, and the reader can choose values to act on.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Chart: Scatter and bubble
2
2
 
3
- > Charts · @motifx-community/ui 0.1.0-beta.16
3
+ > Charts · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  Scatter and bubble charts place each row by two numbers, to show how they relate.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Chart: Waterfall
2
2
 
3
- > Charts · @motifx-community/ui 0.1.0-beta.16
3
+ > Charts · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  A waterfall shows how a starting value becomes an end value through changes up and down.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Chart: Zoom and large data
2
2
 
3
- > Charts · @motifx-community/ui 0.1.0-beta.16
3
+ > Charts · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  Large data stays quick: long lines are thinned to the width with their peaks kept, and the reader zooms in for detail.
6
6
 
package/docs/chart.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Chart
2
2
 
3
- > Charts · @motifx-community/ui 0.1.0-beta.16
3
+ > Charts · @motifx-community/ui 0.1.0-beta.18
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/chat.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Chat
2
2
 
3
- > AI chat · @motifx-community/ui 0.1.0-beta.16
3
+ > AI chat · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  A conversation with a model, drawn by turn: the user’s question, then what the model did, in order — its thinking, text, tool calls, to-do list — each with a dot at its start. The chat draws everything, and your app talks to the model and writes the reply. There is no built-in provider: any streaming API connects through `reply()`.
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.16
3
+ > Choice · @motifx-community/ui 0.1.0-beta.18
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.16
3
+ > Display · @motifx-community/ui 0.1.0-beta.18
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
@@ -1,6 +1,6 @@
1
1
  # Choice
2
2
 
3
- > Choice · @motifx-community/ui 0.1.0-beta.16
3
+ > Choice · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  Choice components let the reader pick: on or off, one of a few, several of a list, or one of many with search.
6
6
 
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.16
3
+ > Editors · @motifx-community/ui 0.1.0-beta.18
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.16
3
+ > Choice · @motifx-community/ui 0.1.0-beta.18
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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Commands and shortcuts
2
2
 
3
- > Foundations · @motifx-community/ui 0.1.0-beta.16
3
+ > Foundations · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
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
6
 
package/docs/control.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Control
2
2
 
3
- > Foundations · @motifx-community/ui 0.1.0-beta.16
3
+ > Foundations · @motifx-community/ui 0.1.0-beta.18
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.16
3
+ > Data · @motifx-community/ui 0.1.0-beta.18
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
 
@@ -1,6 +1,6 @@
1
1
  # DataGrid: API reference
2
2
 
3
- > DataGrid · @motifx-community/ui 0.1.0-beta.16
3
+ > DataGrid · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  ## Columns
6
6
 
@@ -12,6 +12,7 @@ Up to 0.1.0-beta.8, the root of the content that `cell`, `groupCell`, `headerCel
12
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; one pinned to the end stands at the end edge, any room the columns leave coming before it), initially hidden, and the alignment. |
15
+ | `wrap` | `Bind<boolean>`: the text of the cells wraps onto more lines, and a row grows to hold its tallest cell. See [Wrapping text](datagrid-scrolling.md#wrap). |
15
16
  | `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. |
16
17
  | `value, format, compare` | Customizes how the value is read, how it is displayed (`Intl` options for a number or date column, such as `{ style: 'currency', currency: 'EUR' }`, which an Excel export also converts to a number format, or a function that returns the text), and how it is sorted (in-memory rows). |
17
18
  | `cell` | `(ctx) => component`: custom content, created once per pooled cell. Read `ctx.row` and `ctx.value` in getters. |
@@ -247,7 +248,7 @@ export interface Order {
247
248
 
248
249
  | Method | Returns | Description |
249
250
  | --- | --- | --- |
250
- | `addRow(values?)` | `Promise<boolean>` | Opens a new row, as the “New row” button does. Returns `false` when the row being edited cannot be left. |
251
+ | `addRow(values?)` | `Promise<boolean>` | Opens a new row, as the “New row” button does. While the rows load, it waits for them. Returns `false` when the row being edited cannot be left. |
251
252
  | `deleteRow(row?) / restoreRow(row)` | `Promise<boolean>` / `void` | Deletes a row (by default, the active row) according to the save mode, or undoes a batch deletion. |
252
253
  | `deleteRows(rows)` | `Promise<boolean>` | Deletes several rows in one save (one request when the adapter saves in batches), prompting once with `confirmDelete`. Returns `false` when a row failed or the user declined. |
253
254
  | `saveChanges() / discardChanges()` | `Promise<{ saved, failed }>` / `void` | Sends every unsaved change, or discards them all. |
@@ -1,6 +1,6 @@
1
1
  # DataGrid: Bands and adaptive columns
2
2
 
3
- > DataGrid · @motifx-community/ui 0.1.0-beta.16
3
+ > DataGrid · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  ## Band headers
6
6
 
@@ -1,6 +1,6 @@
1
1
  # DataGrid: Selecting by dragging
2
2
 
3
- > DataGrid · @motifx-community/ui 0.1.0-beta.16
3
+ > DataGrid · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  ## Rows
6
6
 
@@ -1,6 +1,6 @@
1
1
  # DataGrid: Row drag and drop
2
2
 
3
- > DataGrid · @motifx-community/ui 0.1.0-beta.16
3
+ > DataGrid · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  ## Reorder rows
6
6
 
@@ -1,6 +1,6 @@
1
1
  # DataGrid: Editing
2
2
 
3
- > DataGrid · @motifx-community/ui 0.1.0-beta.16
3
+ > DataGrid · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  ## Editing and save modes
6
6
 
@@ -1,6 +1,6 @@
1
1
  # DataGrid: Filtering and search
2
2
 
3
- > DataGrid · @motifx-community/ui 0.1.0-beta.16
3
+ > DataGrid · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  ## Filters
6
6
 
@@ -1,6 +1,6 @@
1
1
  # DataGrid: Edit forms and popups
2
2
 
3
- > DataGrid · @motifx-community/ui 0.1.0-beta.16
3
+ > DataGrid · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  ## Edit forms and popups
6
6
 
@@ -1,6 +1,6 @@
1
1
  # DataGrid: Grouping and summaries
2
2
 
3
- > DataGrid · @motifx-community/ui 0.1.0-beta.16
3
+ > DataGrid · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  ## Grouping
6
6
 
@@ -1,6 +1,6 @@
1
1
  # DataGrid: Layout and events
2
2
 
3
- > DataGrid · @motifx-community/ui 0.1.0-beta.16
3
+ > DataGrid · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  ## Toolbar
6
6
 
@@ -1,6 +1,6 @@
1
1
  # DataGrid: Lookup columns
2
2
 
3
- > DataGrid · @motifx-community/ui 0.1.0-beta.16
3
+ > DataGrid · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  ## Lookup columns
6
6
 
@@ -1,6 +1,6 @@
1
1
  # DataGrid: Master-detail
2
2
 
3
- > DataGrid · @motifx-community/ui 0.1.0-beta.16
3
+ > DataGrid · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  ## Master-detail
6
6
 
@@ -1,6 +1,6 @@
1
1
  # DataGrid: Scrolling
2
2
 
3
- > DataGrid · @motifx-community/ui 0.1.0-beta.16
3
+ > DataGrid · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  ## Scrolling modes
6
6
 
@@ -157,6 +157,82 @@ export default function VirtualColumns() {
157
157
  | `Export, copy` | CSV, Excel and PDF write every column, including those without cells, and copying reads the values rather than the cells. |
158
158
  | `Events` | `onCellPrepared` and `onRowPrepared` run as cells are created, so they run again after a sideways scroll. |
159
159
 
160
+ ## Wrapping text
161
+
162
+ A column with `wrap: true` wraps the text of its cells onto more lines, and each row grows to hold its tallest cell, never shorter than the rows' height. A line break in the text starts a new line. Only the rows on the screen are measured, before they are shown, so 10,000 rows of notes scroll like rows of one height, and a grid with no such column keeps all its rows one height. `wrap` can be a function, as here, or change with `columnOption(field, 'wrap', value)`.
163
+
164
+ ```tsx
165
+ import { reactive } from '@motifx/core';
166
+ import { CheckBox, DataGrid, Stack } from '@motifx-community/ui';
167
+ import type { GridColumn } from '@motifx-community/ui';
168
+
169
+ type Ticket = { id: number; subject: string; note: string; status: string };
170
+
171
+ const SUBJECTS = ['Invoice is missing', 'Cannot sign in', 'Order arrived damaged', 'Change of address', 'Refund request', 'App crashes on start'];
172
+ const SENTENCES = [
173
+ 'The customer called twice this morning.',
174
+ 'We asked for the order number and a photo.',
175
+ 'A new parcel goes out with the next delivery, and the old one is picked up at the door.',
176
+ 'Waiting for the warehouse to answer.',
177
+ 'The same thing happened last month on another order, so the account is flagged for a call from the team lead.',
178
+ 'Closed after the customer confirmed.',
179
+ ];
180
+ const STATUSES = ['Open', 'Waiting', 'Solved'];
181
+
182
+ /** A note of one to five sentences; every seventh starts a second paragraph on a line of its own. */
183
+ function noteOf(i: number): string {
184
+ const count = (i * 7) % 5 + 1;
185
+ const parts = Array.from({ length: count }, (_, k) => SENTENCES[(i * 2 + k) % SENTENCES.length]);
186
+ if (i % 7 === 0 && count > 1) return `${parts[0]}\n${parts.slice(1).join(' ')}`;
187
+ return parts.join(' ');
188
+ }
189
+
190
+ const rows: Ticket[] = Array.from({ length: 10_000 }, (_, i) => ({
191
+ id: i + 1,
192
+ subject: SUBJECTS[i % SUBJECTS.length],
193
+ note: noteOf(i),
194
+ status: STATUSES[(i * 5) % STATUSES.length],
195
+ }));
196
+
197
+ /** 10,000 tickets: the notes wrap, and each row is as tall as its note. */
198
+ export default function WrapText() {
199
+ const s = reactive({ wrap: true });
200
+
201
+ const columns: GridColumn<Ticket>[] = [
202
+ { field: 'id', title: 'No.', type: 'number', width: 80 },
203
+ { field: 'subject', title: 'Subject', width: 190 },
204
+ { field: 'note', title: 'Note', width: 120, flex: 1, wrap: () => s.wrap },
205
+ { field: 'status', title: 'Status', width: 110 },
206
+ ];
207
+
208
+ return (
209
+ <>
210
+ <Stack orientation="horizontal" wrap align="center">
211
+ <CheckBox label="Wrap the notes" x-model={() => s.wrap} />
212
+ </Stack>
213
+ <DataGrid
214
+ class="dg-wrap"
215
+ style="block-size: 28rem"
216
+ rows={rows}
217
+ rowKey="id"
218
+ columns={columns}
219
+ label="Support tickets"
220
+ locale="en"
221
+ settings={{ editable: true, striped: true }}
222
+ />
223
+ </>
224
+ );
225
+ }
226
+ ```
227
+
228
+ | Topic | Behavior with wrapped text |
229
+ | --- | --- |
230
+ | `Scrolling` | Rows not measured yet count at the rows' height, so the scrollbar settles as rows are seen. The first row in view stays where it is while rows above it are measured, when a column's width changes, and when wrapping is turned on or off. A row brought into view by the keys, such as Ctrl+End, stays whole on the screen once it is measured. |
231
+ | `Column width` | Resizing a column, or a flexible column taking more room, wraps the text again, and the rows on the screen are measured again. |
232
+ | `Keyboard` | Page Up and Page Down move by the rows that fit on the screen, counted by their heights. |
233
+ | `Editing` | A cell edited to another text has its row measured again, and the rows after it follow. |
234
+ | `Export` | An Excel export sets the cells of a wrapping column to wrap their text. A PDF export wraps them too, unless `wordWrapEnabled` says otherwise. |
235
+
160
236
  ## Keyboard
161
237
 
162
238
  | Key | Description |
@@ -1,6 +1,6 @@
1
1
  # DataGrid: Selection and export
2
2
 
3
- > DataGrid · @motifx-community/ui 0.1.0-beta.16
3
+ > DataGrid · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  ## Selection
6
6
 
package/docs/datagrid.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # DataGrid
2
2
 
3
- > DataGrid · @motifx-community/ui 0.1.0-beta.16
3
+ > DataGrid · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  A grid for data entry and large data sets. Rows can be in memory or come from any data layer adapter, and can be displayed in a virtual list or in pages. It supports sorting, column layout, editing with kit editors, new rows with Tab navigation, three save modes, row actions, selection, filters, a search panel, grouping, summaries, a toolbar, lookup columns from other services, copy and paste, export, and a persistent layout. Every feature can be disabled for the grid or for a single column.
6
6
 
package/docs/datebox.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # DateBox
2
2
 
3
- > Editors · @motifx-community/ui 0.1.0-beta.16
3
+ > Editors · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  An input for a date, a time or both. Users can type through a mask in the locale's order, or pick from a calendar and a list of times. `min`, `max` and `disabledDates` apply to both methods.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # DateRangeBox
2
2
 
3
- > Editors · @motifx-community/ui 0.1.0-beta.16
3
+ > Editors · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  A single field for a start date and an end date. Users can type through two masks, or pick from two side-by-side months and a list of presets, within the allowed dates and range length. The value is a `[start, end]` pair.
6
6
 
@@ -1,6 +1,6 @@
1
1
  # Diagram: API reference
2
2
 
3
- > Diagram · @motifx-community/ui 0.1.0-beta.16
3
+ > Diagram · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  The props, members, events, styling hooks and design tokens of `Diagram` and `DiagramMap`.
6
6
 
@@ -23,6 +23,7 @@ The props, members, events, styling hooks and design tokens of `Diagram` and `Di
23
23
  | `snapToGrid` | `Bind<boolean>` | `false` | Snaps dragged nodes to the grid of `gridSize`. |
24
24
  | `guides` | `Bind<boolean>` | `true` | Lines a dragged node up with the edges and middles of the other nodes, and shows guides while it does. |
25
25
  | `history` | `Bind<boolean>` | `true` | Keeps the user’s steps to undo and redo. `false` clears the history. |
26
+ | `textEditable` | `Bind<boolean>` | `false` | Whether the user edits a node’s `text` in place: a double click on the text, F2 or the `rename` command on the node under the keys opens an editor over it; Enter or leaving it writes the text as a step of the history, Escape keeps the old one. `editText()` opens it in code. |
26
27
  | `commandScope` | `Bind<ComponentBase \| null>` | The diagram | The component the diagram’s commands are held to. Their keys work while focus is inside it, and the toolbars and menus inside it run this diagram’s commands. Give the editor that holds the diagram and its toolbar. |
27
28
  | `viewport` | `Bind<DiagramViewport>` | `{ x: 0, y: 0, zoom: 1 }` | The position of the view. Panning and zooming change it, and `onViewportChanged` reports each change. |
28
29
  | `minZoom, maxZoom` | `Bind<number>` | `0.1`, `4` | The smallest and the largest zoom. |
@@ -55,6 +56,8 @@ The props, members, events, styling hooks and design tokens of `Diagram` and `Di
55
56
  | `deleteSelection()` | `boolean` | Deletes the selected nodes with their connections and the selected connections, except those that cannot be deleted, after `onDeleting`. A group goes with the nodes inside it. Returns whether anything was deleted. |
56
57
  | `setCollapsed(id, collapsed)` | `boolean` | Collapses a node to its header or opens it, as the button in its header does: a group, a lane, a table or a class. Returns whether it changed. |
57
58
  | `setNodeStatus(id, status, text?)` | `boolean` | Shows what a node is doing as a run goes through it, or takes it away with `null`: a mark on its corner and a ring, and a screen reader hears it with the node’s name. Not a step of the history. Returns whether it changed. |
59
+ | `setEdgeStatus(id, status, text?)` | `boolean` | Shows what a connection is doing as a run goes along it, or takes it away with `null`: the status’s color on its line and its marks, unless the connection has a `color` of its own, a line that moves while it runs, and `text` in the line’s tip. A screen reader hears it with the connection’s two nodes. Not a step of the history. Returns whether it changed. |
60
+ | `editText(id)` | `boolean` | Edits a node’s text in place, as a double click on it does with `textEditable`: an editor opens over the text, and Enter or leaving it writes the new text as a step of the history, Escape keeps the old one. Returns whether the editor opened: not in a read-only diagram, not for a node off the page, and not when `onTextEditing` cancels. |
58
61
  | `edgesOf(id, options?), nodesOf(id, options?)` | `DiagramEdge[]`, `DiagramNode[]` | The connections of a node, by `direction` (`'in'`, `'out'`, `'both'`) and `port`, and the nodes at their other ends. Read in a getter, they follow the connections. |
59
62
  | `setColumnChecked(id, column, checked)` | `boolean` | Ticks or clears the box of a column of a table that shows one, as the user does: a step of the history. Returns whether it changed. |
60
63
  | `undo(), redo()` | `boolean` | Undoes the last step, or makes the last undone step again: a move, a resize, a node collapsed or opened, a connection made or moved, its line reshaped, a deletion, a paste, an alignment, a layout or a change the app recorded. Returns whether there was a step. |
@@ -92,15 +95,15 @@ The props, members, events, styling hooks and design tokens of `Diagram` and `Di
92
95
  | --- | --- | --- |
93
96
  | `DiagramNode` | `{ id, x, y, width?, height?, text?, kind?, parent?, collapsed?, resizable?, ports?, cssClass?, style?, draggable?, selectable?, connectable?, deletable?, status?, statusText? }` | A node. `status` (`running`, `done`, `error`, `waiting`, `skipped`) and `statusText` show what it is doing as a run goes through it. `x` and `y` are its top left corner in diagram units; dragging writes them. Without `width` and `height` the node takes the size of its content. `kind` names its kind, `parent` the group it is in, and `collapsed` keeps a group, a table or a class collapsed to its header. Without `ports` it has a port in the middle of each side, named `top`, `right`, `bottom` and `left`. `cssClass` and `style` add classes and CSS properties to its element. The object is kept as it is given, so it can carry the app’s own fields. |
94
97
  | `DiagramNodeKind` | `{ content?, update?, ports?, cssClass?, resizable?, minWidth?, minHeight?, group?, collapsible?, collapse? }` | A kind of node. `content(context)` makes the content of each node once and returns a component or a text, or adds to `context.host`; `update(context)` writes what changed when the node is drawn again. `ports` may be a function that makes the ports from the node. `group` makes its nodes hold others, `collapsible` makes them collapse to their header, and `collapse` says whether a collapsed one keeps its width (`'vertical'`) or its height (`'horizontal'`). |
95
- | `DiagramNodeContext` | `{ node, host, diagram, selected, dragHandle(part), anchor(id, part), label(read) }` | What `content` and `update` receive: the node, the part its content goes into, the diagram, whether the node is selected, `dragHandle`, which makes one part the only place that drags the node, `anchor`, which stands a port beside a part of the content, such as a row, and `label`, which names the node with a function the node follows as the reactive data it reads changes. |
98
+ | `DiagramNodeContext` | `{ node, host, diagram, selected, dragHandle(part), anchor(id, part), label(read), textPart(part) }` | What `content` and `update` receive: the node, the part its content goes into, the diagram, whether the node is selected, `dragHandle`, which makes one part the only place that drags the node, `anchor`, which stands a port beside a part of the content, such as a row, `label`, which names the node with a function the node follows as the reactive data it reads changes, and `textPart`, which makes one part the place that shows the node’s `text`: the editor of an edit in place opens over it, and a double click on it starts one. The built-in kinds name theirs. |
96
99
  | `DiagramTableNode, DiagramTableColumn` | `{ …DiagramNode, columns, checkable? }`, `{ name, type?, primaryKey?, foreignKey?, unique?, checked? }` | A node of the `table` kind: its `text` is its name, and each column has a port named by it beside its row, on the left and on the right. `checkable` shows a box before each column, which the user ticks and clears, as columns are chosen for a query; the column’s `checked` holds it. |
97
100
  | `DiagramClassNode, DiagramClassMember` | `{ …DiagramNode, stereotype?, abstract?, attributes?, methods? }`, `{ name, type?, visibility?, static?, abstract? }` | A node of the `class` kind: its `text` is its name. `visibility` is `'public'`, `'private'`, `'protected'` or `'package'`. |
98
101
  | `DiagramCardNode` | `{ …DiagramNode, icon?, subtitle? }` | A node of the `card` kind: its icon and `text` in its header with the `subtitle` under them. `cardKind(options)` makes a kind of one’s own from it. |
99
102
  | `DiagramPort` | `{ id, side, offset?, direction?, type?, maxConnections?, label? }` | A port on a side of a node, or on several: a connection then takes the one that faces its other end. `offset` places it along the side, from `0` at the left or top end to `1`; the default is the middle, and a port the content anchors stands beside its part. `direction` is `'source'` for an output, `'target'` for an input, or `'both'`, the default for ports of the app’s own. |
100
- | `DiagramEdge` | `{ id, source, target, sourcePort?, targetPort?, path?, points?, label?, sourceLabel?, targetLabel?, sourceMarker?, targetMarker?, dashed?, animated?, reconnectable?, color?, width?, cssClass?, style?, selectable?, deletable? }` | A connection. Without a port, an end takes the output or input that faces the other node. The markers are `none`, `arrow`, `arrow-open`, `circle`, `triangle-open`, `diamond`, `diamond-open` and the crow’s feet `one`, `many`, `zero-or-one`, `one-or-many` and `zero-or-many`; the default is an arrow at the target. `sourceLabel` and `targetLabel` write a text at each end. `color` and `width` set its line, and `cssClass` and `style` add classes and CSS properties to its element. `points` are the points the line passes through, which the user adds, moves and takes away. `path` can also be a function that receives the ends and the points and returns an SVG path and the position of the label. `reconnectable: false` keeps its ends and its points. |
103
+ | `DiagramEdge` | `{ id, source, target, sourcePort?, targetPort?, path?, points?, label?, sourceLabel?, targetLabel?, sourceMarker?, targetMarker?, dashed?, animated?, reconnectable?, color?, width?, cssClass?, style?, selectable?, deletable?, status?, statusText? }` | A connection. Without a port, an end takes the output or input that faces the other node. The markers are `none`, `arrow`, `arrow-open`, `circle`, `triangle-open`, `diamond`, `diamond-open` and the crow’s feet `one`, `many`, `zero-or-one`, `one-or-many` and `zero-or-many`; the default is an arrow at the target. `sourceLabel` and `targetLabel` write a text at each end. `color` and `width` set its line, and `cssClass` and `style` add classes and CSS properties to its element. `points` are the points the line passes through, which the user adds, moves and takes away. `path` can also be a function that receives the ends and the points and returns an SVG path and the position of the label. `reconnectable: false` keeps its ends and its points. `status` and `statusText` show what it is doing as a run goes along it, as `setEdgeStatus` writes them. |
101
104
  | `DiagramNodeMove` | `{ node, from, to, fromParent?, toParent? }` | A node the user moved, with its position before and after, and the groups it left and joined when the drop took it into a group or out of one. |
102
105
  | `DiagramEdit` | `{ undo(), redo(), nodes?, edges? }` | A change the app made, for `record`: `undo` puts it back, `redo` makes it again, and `nodes` and `edges` say what it changed. |
103
- | `DiagramChange` | `{ kind, nodes, edges }` | What a step of the history did: `kind` is `'move'`, `'resize'`, `'collapse'`, `'connect'`, `'reconnect'`, `'reshape'`, `'delete'`, `'paste'`, `'layout'` or `'edit'` (a change the app recorded). |
106
+ | `DiagramChange` | `{ kind, nodes, edges }` | What a step of the history did: `kind` is `'move'`, `'resize'`, `'collapse'`, `'connect'`, `'reconnect'`, `'reshape'`, `'delete'`, `'paste'`, `'layout'`, `'text'` (a node’s text edited in place) or `'edit'` (a change the app recorded). |
104
107
  | `DiagramData` | `{ version?, nodes, edges?, viewport? }` | What `save` gives and `load` takes: copies of the nodes and connections, and the view. |
105
108
  | `DiagramDrawnNode` | `{ node, rect, group }` | A node on the surface, as `drawnNodes` gives it. |
106
109
  | `DiagramConnection` | `{ source, sourcePort?, target, targetPort? }` | The two ends of a connection. |
@@ -130,6 +133,17 @@ The props, members, events, styling hooks and design tokens of `Diagram` and `Di
130
133
  | `onPasting` | `{ nodes, edges, cancel }` | Occurs before copies are added by a paste or a duplicate. They are new objects with new ids; change their fields, such as an id of the app’s own, or set `cancel`. |
131
134
  | `onPasted` | `{ nodes, edges }` | Occurs after copies were added to `nodes` and `edges`. They are the selection. |
132
135
  | `onHistoryChanged` | `{ reason, change, canUndo, canRedo }` | Occurs whenever the history changes. `reason` is `'add'`, `'undo'`, `'redo'` or `'clear'`. After an undo or a redo, `nodes`, `edges` and their objects already match the diagram, so this is the event to save the diagram on. |
136
+ | `onNodeClick` | `{ node, event, byKeyboard, at, cancel }` | Occurs when the user clicks a node; a press selects it before the click, so `cancel` has nothing to keep. Not after a drag, and not from the ports, the resize handles or the text editor. `at` is where it was on the page, in pixels. |
137
+ | `onNodeDblClick` | `{ node, event, byKeyboard, at, cancel }` | Occurs when the user double-clicks a node, or presses Alt+Enter on the node under the keys (`byKeyboard`). `cancel` keeps its text from being edited (`textEditable`). |
138
+ | `onNodeContextMenu` | `{ node, event, byKeyboard, at, cancel }` | Occurs when the user right-clicks a node, or presses the Menu key or Shift+F10 on the node under the keys: open a menu at `at`, the pointer or the middle of the node, with `menu.open(e.at, diagram)`. While the app listens, the browser’s own menu stays closed, unless `cancel`. |
139
+ | `onNodePointerEnter, onNodePointerLeave` | `{ node, event }` | Occur when the pointer comes over a node and when it leaves it: its content, its ports and its frame alike. |
140
+ | `onEdgeClick` | `{ edge, event, byKeyboard, at, cancel }` | Occurs when the user clicks a connection, before it is selected; `cancel` leaves the selection as it is. |
141
+ | `onEdgeDblClick` | `{ edge, event, byKeyboard, at, cancel }` | Occurs when the user double-clicks a connection, or presses Alt+Enter on the connection under the keys; `at` is then the middle between its ends. |
142
+ | `onEdgeContextMenu` | `{ edge, event, byKeyboard, at, cancel }` | Occurs when the user right-clicks a connection, or presses the Menu key or Shift+F10 on the connection under the keys: open a menu at `at`. While the app listens, the browser’s own menu stays closed, unless `cancel`. |
143
+ | `onEdgePointerEnter, onEdgePointerLeave` | `{ edge, event }` | Occur when the pointer comes over a connection and when it leaves it: its line, its marks and its labels alike. |
144
+ | `onTextEditing` | `{ node, text, byKeyboard, cancel }` | Occurs before the editor of a node’s text opens (`textEditable`): change `text`, the text the editor starts with, or set `cancel` to keep it closed. |
145
+ | `onTextChanging` | `{ node, text, previous, cancel }` | Occurs when an edit of a node’s text ends with a new text, before it is written: change `text`, or set `cancel` to keep the old one, such as for a name already taken. The editor closes either way. |
146
+ | `onTextChanged` | `{ node, text, previous }` | Occurs after an edit wrote a node’s new text, as a step of the history. |
133
147
  | `onContentChanged` | `void` | Occurs at most once a frame after nodes moved or changed their size, came, went, were hidden in a group or shown again, or the surface changed its size. A map follows the diagram with it. |
134
148
 
135
149
  ### DiagramMap
@@ -148,6 +162,7 @@ The props, members, events, styling hooks and design tokens of `Diagram` and `Di
148
162
  | `duplicate` | Ctrl+D | Copies the selected nodes next to them. |
149
163
  | `delete` | Delete, Backspace | Deletes the selection. |
150
164
  | `selectAll` | Ctrl+A | Selects everything. |
165
+ | `rename` | F2 | Edits the text of the node under the keys, else the only one selected, in place (`textEditable`). |
151
166
  | `alignLeft, alignCenter, alignRight, alignTop, alignMiddle, alignBottom` | | Line the selected nodes up. |
152
167
  | `zoomIn, zoomOut, zoomToFit` | Plus, Minus | Zoom in, zoom out, fit the nodes into view. |
153
168
  | `layout` | | Places the nodes as `layoutOptions` says, gliding. |
@@ -1,6 +1,6 @@
1
1
  # Diagram: History and commands
2
2
 
3
- > Diagram · @motifx-community/ui 0.1.0-beta.16
3
+ > Diagram · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  Undo and redo, the clipboard and alignment, as commands that the app’s toolbars and menus name and the user runs with keys of their choice.
6
6
 
@@ -70,6 +70,7 @@ export default class Commands extends Component<HTMLDivElement> {
70
70
  | `duplicate` | Ctrl+D | Copies the selected nodes next to them. |
71
71
  | `delete` | Delete, Backspace | Deletes the selection. |
72
72
  | `selectAll` | Ctrl+A | Selects everything. |
73
+ | `rename` | F2 | Edits the text of the node under the keys, or of the only selected node, in place (`textEditable`). |
73
74
  | `alignLeft, alignCenter, alignRight, alignTop, alignMiddle, alignBottom` | | Line the selected nodes up. |
74
75
  | `zoomIn, zoomOut, zoomToFit` | Plus, Minus | Zoom in, zoom out, fit the nodes into view. |
75
76
  | `layout` | | Places the nodes as `layoutOptions` says, gliding. |
@@ -1,6 +1,6 @@
1
1
  # Diagram: Connections
2
2
 
3
- > Diagram · @motifx-community/ui 0.1.0-beta.16
3
+ > Diagram · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  Connections run from an output of a node to an input of another. The user draws them from the ports and moves their ends, and the diagram holds every connection to its rules.
6
6
 
@@ -12,7 +12,8 @@ Connections run from an output of a node to an input of another. The user draws
12
12
  import { reactive } from '@motifx/core';
13
13
  import { ButtonGroup, Diagram, Stack, type DiagramEdge, type DiagramEdgePath, type DiagramNode } from '@motifx-community/ui';
14
14
 
15
- const NODES: DiagramNode[] = [
15
+ /** The nodes and connections each time the example is shown: the diagram changes the arrays it is given. */
16
+ const nodes = (): DiagramNode[] => [
16
17
  { id: 'a', x: 0, y: 0, text: 'Arrow' },
17
18
  { id: 'b', x: 260, y: 90, text: 'Open arrow' },
18
19
  { id: 'c', x: 0, y: 200, text: 'Circle' },
@@ -21,7 +22,7 @@ const NODES: DiagramNode[] = [
21
22
  { id: 'f', x: 520, y: 290, text: 'No marks' },
22
23
  ];
23
24
 
24
- const EDGES: DiagramEdge[] = [
25
+ const edges = (): DiagramEdge[] => [
25
26
  { id: 'ab', source: 'a', target: 'b', label: 'arrow' },
26
27
  { id: 'cb', source: 'c', target: 'b', targetMarker: 'arrow-open', label: 'arrow-open' },
27
28
  { id: 'cd', source: 'c', target: 'd', sourceMarker: 'circle', targetMarker: 'circle', label: 'circle' },
@@ -36,7 +37,7 @@ export default function Connections() {
36
37
  return (
37
38
  <Stack gap="md" style="inline-size: 100%">
38
39
  <ButtonGroup label="Shape" items={['straight', 'curve', 'step', 'rounded-step']} x-model={() => s.path} />
39
- <Diagram class="diagram-connections" label="Shapes and marks" autoFit nodes={NODES} edges={EDGES} edgePath={() => s.path as DiagramEdgePath} background="lines" />
40
+ <Diagram class="diagram-connections" label="Shapes and marks" autoFit nodes={nodes()} edges={edges()} edgePath={() => s.path as DiagramEdgePath} background="lines" />
40
41
  </Stack>
41
42
  );
42
43
  }
@@ -50,7 +51,8 @@ The ports show over a node; outputs are filled and inputs are hollow. Drag from
50
51
  import { reactive } from '@motifx/core';
51
52
  import { Diagram, Stack, type DiagramConnection, type DiagramEdge, type DiagramNode } from '@motifx-community/ui';
52
53
 
53
- const NODES: DiagramNode[] = [
54
+ /** The nodes each time the example is shown: the diagram changes the array it is given. */
55
+ const nodes = (): DiagramNode[] => [
54
56
  { id: 'orders', x: 0, y: 40, text: 'Orders', ports: [{ id: 'out', side: 'right', direction: 'source', type: 'data' }] },
55
57
  { id: 'clicks', x: 0, y: 200, text: 'Clicks', ports: [{ id: 'out', side: 'right', direction: 'source', type: 'event' }] },
56
58
  {
@@ -81,7 +83,7 @@ export default function Connecting() {
81
83
  class="diagram-connecting"
82
84
  label="Data flow"
83
85
  autoFit
84
- nodes={NODES}
86
+ nodes={nodes()}
85
87
  edges={edges}
86
88
  edgePath="rounded-step"
87
89
  canConnect={(c: DiagramConnection) => c.source !== c.target}
@@ -1,6 +1,6 @@
1
1
  # Diagram: Custom nodes
2
2
 
3
- > Diagram · @motifx-community/ui 0.1.0-beta.16
3
+ > Diagram · @motifx-community/ui 0.1.0-beta.18
4
4
 
5
5
  A node of the app’s own is a node kind: the node names it in `kind`, and the diagram’s `kinds` says what the nodes of that kind hold, which ports they have, how they look and how large they are. These recipes build kinds step by step, from a card that shows data to nodes with controls, ports of their own and content made without JSX.
6
6