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

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 (330) hide show
  1. package/CHANGELOG.md +113 -0
  2. package/README.md +2 -2
  3. package/dist/components/diagram/Diagram.d.ts +607 -0
  4. package/dist/components/diagram/DiagramAutoPan.d.ts +17 -0
  5. package/dist/components/diagram/DiagramBends.d.ts +70 -0
  6. package/dist/components/diagram/DiagramDragging.d.ts +66 -0
  7. package/dist/components/diagram/DiagramEdgeView.d.ts +78 -0
  8. package/dist/components/diagram/DiagramGrid.d.ts +13 -0
  9. package/dist/components/diagram/DiagramHistory.d.ts +16 -0
  10. package/dist/components/diagram/DiagramLinks.d.ts +177 -0
  11. package/dist/components/diagram/DiagramMap.d.ts +62 -0
  12. package/dist/components/diagram/DiagramNodeView.d.ts +143 -0
  13. package/dist/components/diagram/DiagramOverview.d.ts +20 -0
  14. package/dist/components/diagram/DiagramPanning.d.ts +34 -0
  15. package/dist/components/diagram/diagram-alignment.d.ts +2 -0
  16. package/dist/components/diagram/diagram-auto-pan-host.d.ts +8 -0
  17. package/dist/components/diagram/diagram-background.d.ts +2 -0
  18. package/dist/components/diagram/diagram-bends-host.d.ts +17 -0
  19. package/dist/components/diagram/diagram-card-kind.d.ts +42 -0
  20. package/dist/components/diagram/diagram-card-node.d.ts +11 -0
  21. package/dist/components/diagram/diagram-center-options.d.ts +6 -0
  22. package/dist/components/diagram/diagram-change.d.ts +11 -0
  23. package/dist/components/diagram/diagram-class-member.d.ts +13 -0
  24. package/dist/components/diagram/diagram-class-node.d.ts +12 -0
  25. package/dist/components/diagram/diagram-column-checked-event-args.d.ts +9 -0
  26. package/dist/components/diagram/diagram-connected-event-args.d.ts +6 -0
  27. package/dist/components/diagram/diagram-connecting-event-args.d.ts +9 -0
  28. package/dist/components/diagram/diagram-connection.d.ts +7 -0
  29. package/dist/components/diagram/diagram-data.d.ts +12 -0
  30. package/dist/components/diagram/diagram-deleted-event-args.d.ts +8 -0
  31. package/dist/components/diagram/diagram-deleting-event-args.d.ts +9 -0
  32. package/dist/components/diagram/diagram-dragging-host.d.ts +47 -0
  33. package/dist/components/diagram/diagram-drawn-node.d.ts +10 -0
  34. package/dist/components/diagram/diagram-edge-end.d.ts +2 -0
  35. package/dist/components/diagram/diagram-edge-path.d.ts +5 -0
  36. package/dist/components/diagram/diagram-edge-reshaped-event-args.d.ts +8 -0
  37. package/dist/components/diagram/diagram-edge-reshaping-event-args.d.ts +6 -0
  38. package/dist/components/diagram/diagram-edge.d.ts +49 -0
  39. package/dist/components/diagram/diagram-edit.d.ts +10 -0
  40. package/dist/components/diagram/diagram-export-options.d.ts +14 -0
  41. package/dist/components/diagram/diagram-export.d.ts +28 -0
  42. package/dist/components/diagram/diagram-fit-options.d.ts +12 -0
  43. package/dist/components/diagram/diagram-history-changed-event-args.d.ts +14 -0
  44. package/dist/components/diagram/diagram-history-step.d.ts +9 -0
  45. package/dist/components/diagram/diagram-kinds.d.ts +9 -0
  46. package/dist/components/diagram/diagram-layered.d.ts +39 -0
  47. package/dist/components/diagram/diagram-layout-direction.d.ts +2 -0
  48. package/dist/components/diagram/diagram-layout-options.d.ts +24 -0
  49. package/dist/components/diagram/diagram-layout-type.d.ts +5 -0
  50. package/dist/components/diagram/diagram-layout.d.ts +33 -0
  51. package/dist/components/diagram/diagram-line-look.d.ts +6 -0
  52. package/dist/components/diagram/diagram-line.d.ts +11 -0
  53. package/dist/components/diagram/diagram-links-host.d.ts +45 -0
  54. package/dist/components/diagram/diagram-links-options.d.ts +7 -0
  55. package/dist/components/diagram/diagram-map-props.d.ts +10 -0
  56. package/dist/components/diagram/diagram-map-target.d.ts +27 -0
  57. package/dist/components/diagram/diagram-marker.d.ts +6 -0
  58. package/dist/components/diagram/diagram-mini-map-options.d.ts +13 -0
  59. package/dist/components/diagram/diagram-mini-map-position.d.ts +2 -0
  60. package/dist/components/diagram/diagram-node-context.d.ts +26 -0
  61. package/dist/components/diagram/diagram-node-host.d.ts +23 -0
  62. package/dist/components/diagram/diagram-node-kind.d.ts +43 -0
  63. package/dist/components/diagram/diagram-node-move.d.ts +11 -0
  64. package/dist/components/diagram/diagram-node-resized-event-args.d.ts +8 -0
  65. package/dist/components/diagram/diagram-node-resizing-event-args.d.ts +6 -0
  66. package/dist/components/diagram/diagram-node-size.d.ts +8 -0
  67. package/dist/components/diagram/diagram-node-status.d.ts +2 -0
  68. package/dist/components/diagram/diagram-node-toggled-event-args.d.ts +7 -0
  69. package/dist/components/diagram/diagram-node.d.ts +56 -0
  70. package/dist/components/diagram/diagram-nodes-moved-event-args.d.ts +6 -0
  71. package/dist/components/diagram/diagram-nodes-moving-event-args.d.ts +6 -0
  72. package/dist/components/diagram/diagram-panning-host.d.ts +19 -0
  73. package/dist/components/diagram/diagram-pasted-event-args.d.ts +7 -0
  74. package/dist/components/diagram/diagram-pasting-event-args.d.ts +11 -0
  75. package/dist/components/diagram/diagram-path-ends.d.ts +11 -0
  76. package/dist/components/diagram/diagram-path-result.d.ts +6 -0
  77. package/dist/components/diagram/diagram-paths.d.ts +35 -0
  78. package/dist/components/diagram/diagram-point.d.ts +5 -0
  79. package/dist/components/diagram/diagram-port-place.d.ts +9 -0
  80. package/dist/components/diagram/diagram-port.d.ts +27 -0
  81. package/dist/components/diagram/diagram-props.d.ts +159 -0
  82. package/dist/components/diagram/diagram-reconnected-event-args.d.ts +10 -0
  83. package/dist/components/diagram/diagram-reconnecting-event-args.d.ts +11 -0
  84. package/dist/components/diagram/diagram-rect.d.ts +7 -0
  85. package/dist/components/diagram/diagram-resize-side.d.ts +2 -0
  86. package/dist/components/diagram/diagram-route.d.ts +10 -0
  87. package/dist/components/diagram/diagram-selection-changed-event-args.d.ts +9 -0
  88. package/dist/components/diagram/diagram-selection.d.ts +5 -0
  89. package/dist/components/diagram/diagram-side.d.ts +2 -0
  90. package/dist/components/diagram/diagram-table-column.d.ts +13 -0
  91. package/dist/components/diagram/diagram-table-node.d.ts +12 -0
  92. package/dist/components/diagram/diagram-tree.d.ts +14 -0
  93. package/dist/components/diagram/diagram-viewport-changed-event-args.d.ts +8 -0
  94. package/dist/components/diagram/diagram-viewport-options.d.ts +5 -0
  95. package/dist/components/diagram/diagram-viewport.d.ts +6 -0
  96. package/dist/components/diagram/index.d.ts +65 -0
  97. package/dist/components/diagram/swallow-next-click.d.ts +5 -0
  98. package/dist/components/expressioneditor/ExpressionEditor.d.ts +111 -0
  99. package/dist/components/expressioneditor/expression-editor-props.d.ts +24 -0
  100. package/dist/components/expressioneditor/index.d.ts +2 -0
  101. package/dist/components/formlayout/FormLayout.d.ts +10 -3
  102. package/dist/components/formlayout/form-editor-type.d.ts +1 -1
  103. package/dist/components/formlayout/form-item.d.ts +4 -1
  104. package/dist/components/formlayout/form-layout-props.d.ts +1 -1
  105. package/dist/components/formlayout/index.d.ts +1 -0
  106. package/dist/components/formlayout/schema-items.d.ts +26 -0
  107. package/dist/components/pivotgrid/model/PivotAxisWindow.d.ts +53 -1
  108. package/dist/components/pivotgrid/model/PivotCellWindow.d.ts +2 -0
  109. package/dist/components/pivotgrid/model/PivotWindows.d.ts +3 -6
  110. package/dist/components/toolbar/Toolbar.d.ts +5 -3
  111. package/dist/core/control.d.ts +2 -0
  112. package/dist/core/keyboard.d.ts +5 -0
  113. package/dist/core/measure/index.d.ts +2 -0
  114. package/dist/core/measure/picture.d.ts +27 -0
  115. package/dist/core/shortcut-options.d.ts +5 -2
  116. package/dist/core/ui-strings.d.ts +191 -0
  117. package/dist/generated/tokens.d.ts +1615 -0
  118. package/dist/index.d.ts +2 -0
  119. package/dist/index.js +11501 -705
  120. package/dist/index.js.map +1 -1
  121. package/dist/locales/en.json +180 -1
  122. package/dist/locales/tr.json +180 -1
  123. package/dist/styles.css +2262 -3
  124. package/dist/tokens/index.d.ts +1615 -0
  125. package/dist/tokens/index.js +1615 -0
  126. package/dist/tokens/index.js.map +1 -1
  127. package/dist/{tr-BGbF9uCs.js → tr-4GNbFdQh.js} +361 -3
  128. package/dist/{tr-BGbF9uCs.js.map → tr-4GNbFdQh.js.map} +1 -1
  129. package/docs/accordion.md +1 -1
  130. package/docs/actionsheet.md +1 -1
  131. package/docs/appbar.md +1 -1
  132. package/docs/appmenu-api.md +1 -1
  133. package/docs/appmenu-programmatic.md +1 -1
  134. package/docs/appmenu-search.md +1 -1
  135. package/docs/appmenu.md +1 -1
  136. package/docs/avatar.md +1 -1
  137. package/docs/badge.md +1 -1
  138. package/docs/bar-gauge-angles.md +1 -1
  139. package/docs/bar-gauge-data.md +1 -1
  140. package/docs/bar-gauge-labels.md +1 -1
  141. package/docs/bar-gauge.md +1 -1
  142. package/docs/barcode.md +1 -1
  143. package/docs/bottomnavigation.md +1 -1
  144. package/docs/bottomsheet.md +1 -1
  145. package/docs/breadcrumb.md +1 -1
  146. package/docs/button.md +1 -1
  147. package/docs/buttongroup.md +1 -1
  148. package/docs/buttons.md +1 -1
  149. package/docs/calendar.md +1 -1
  150. package/docs/card.md +1 -1
  151. package/docs/chart-bars.md +1 -1
  152. package/docs/chart-candles.md +1 -1
  153. package/docs/chart-funnel.md +1 -1
  154. package/docs/chart-heatmap.md +1 -1
  155. package/docs/chart-lines.md +1 -1
  156. package/docs/chart-live.md +1 -1
  157. package/docs/chart-pie.md +1 -1
  158. package/docs/chart-radar.md +1 -1
  159. package/docs/chart-ranges.md +1 -1
  160. package/docs/chart-references.md +1 -1
  161. package/docs/chart-scatter.md +1 -1
  162. package/docs/chart-waterfall.md +1 -1
  163. package/docs/chart-zoom.md +1 -1
  164. package/docs/chart.md +1 -1
  165. package/docs/chat.md +1 -1
  166. package/docs/checkbox.md +1 -1
  167. package/docs/chip.md +1 -1
  168. package/docs/choice.md +1 -1
  169. package/docs/colorbox.md +1 -1
  170. package/docs/combobox.md +1 -1
  171. package/docs/commands.md +1 -1
  172. package/docs/control.md +1 -1
  173. package/docs/data.md +2 -2
  174. package/docs/datagrid-api.md +1 -1
  175. package/docs/datagrid-bands.md +1 -1
  176. package/docs/datagrid-drag-select.md +1 -1
  177. package/docs/datagrid-drag.md +1 -1
  178. package/docs/datagrid-editing.md +1 -1
  179. package/docs/datagrid-filtering.md +1 -1
  180. package/docs/datagrid-forms.md +1 -1
  181. package/docs/datagrid-grouping.md +1 -1
  182. package/docs/datagrid-layout.md +1 -1
  183. package/docs/datagrid-lookups.md +1 -1
  184. package/docs/datagrid-master-detail.md +1 -1
  185. package/docs/datagrid-scrolling.md +1 -1
  186. package/docs/datagrid-selection.md +1 -1
  187. package/docs/datagrid.md +1 -1
  188. package/docs/datalayer-api.md +491 -0
  189. package/docs/datalayer-changes.md +501 -0
  190. package/docs/datalayer-odata.md +998 -0
  191. package/docs/datalayer-pivot.md +850 -0
  192. package/docs/datalayer-queries.md +516 -0
  193. package/docs/datalayer-rest.md +529 -0
  194. package/docs/datalayer-soap.md +576 -0
  195. package/docs/datalayer-source.md +464 -0
  196. package/docs/datalayer.md +264 -0
  197. package/docs/datebox.md +1 -1
  198. package/docs/daterangebox.md +1 -1
  199. package/docs/diagram-api.md +200 -0
  200. package/docs/diagram-commands.md +79 -0
  201. package/docs/diagram-connections.md +157 -0
  202. package/docs/diagram-custom-nodes.md +325 -0
  203. package/docs/diagram-designer.md +816 -0
  204. package/docs/diagram-editing.md +62 -0
  205. package/docs/diagram-flow.md +157 -0
  206. package/docs/diagram-keyboard.md +58 -0
  207. package/docs/diagram-layout.md +354 -0
  208. package/docs/diagram-nodes.md +206 -0
  209. package/docs/diagram-tables.md +212 -0
  210. package/docs/diagram.md +217 -0
  211. package/docs/display.md +1 -1
  212. package/docs/draggable.md +1 -1
  213. package/docs/drawer.md +1 -1
  214. package/docs/dropdown.md +1 -1
  215. package/docs/editors.md +1 -1
  216. package/docs/expressioneditor.md +469 -0
  217. package/docs/expressions.md +431 -0
  218. package/docs/feedback.md +1 -1
  219. package/docs/fileuploader.md +1 -1
  220. package/docs/filterbuilder.md +1 -1
  221. package/docs/formlayout-schema.md +143 -0
  222. package/docs/formlayout.md +16 -4
  223. package/docs/foundations.md +1 -1
  224. package/docs/gallery.md +1 -1
  225. package/docs/gauge-base.md +1 -1
  226. package/docs/gauge-circular.md +1 -1
  227. package/docs/gauge-dashboards.md +1 -1
  228. package/docs/gauge-linear.md +1 -1
  229. package/docs/gauge-markers.md +1 -1
  230. package/docs/gauge-marks.md +1 -1
  231. package/docs/gauge-ranges.md +1 -1
  232. package/docs/gauge-scales.md +1 -1
  233. package/docs/gauge.md +1 -1
  234. package/docs/home.md +1 -1
  235. package/docs/keyboard.md +2 -2
  236. package/docs/language.md +1 -1
  237. package/docs/layout.md +1 -1
  238. package/docs/listbox.md +1 -1
  239. package/docs/loadpanel.md +1 -1
  240. package/docs/lookup.md +1 -1
  241. package/docs/markdown.md +1 -1
  242. package/docs/menus-api.md +1 -1
  243. package/docs/menus-context.md +1 -1
  244. package/docs/menus-customization.md +1 -1
  245. package/docs/menus-merging.md +1 -1
  246. package/docs/menus-programmatic.md +1 -1
  247. package/docs/menus.md +1 -1
  248. package/docs/multiview.md +1 -1
  249. package/docs/navigation.md +1 -1
  250. package/docs/numberbox.md +1 -1
  251. package/docs/otpinput.md +1 -1
  252. package/docs/pagination.md +1 -1
  253. package/docs/pivotgrid-api.md +1 -1
  254. package/docs/pivotgrid-chart.md +1 -1
  255. package/docs/pivotgrid-drilldown.md +1 -1
  256. package/docs/pivotgrid-export.md +1 -1
  257. package/docs/pivotgrid-fields.md +1 -1
  258. package/docs/pivotgrid-keyboard.md +1 -1
  259. package/docs/pivotgrid-layout.md +1 -1
  260. package/docs/pivotgrid-panel.md +1 -1
  261. package/docs/pivotgrid-remote.md +122 -44
  262. package/docs/pivotgrid-sorting.md +3 -3
  263. package/docs/pivotgrid-state.md +1 -1
  264. package/docs/pivotgrid-summaries.md +1 -1
  265. package/docs/pivotgrid.md +1 -1
  266. package/docs/popover.md +1 -1
  267. package/docs/progress.md +1 -1
  268. package/docs/qrcode.md +1 -1
  269. package/docs/radiogroup.md +1 -1
  270. package/docs/rating.md +1 -1
  271. package/docs/resizable.md +1 -1
  272. package/docs/ribbonmenu-api.md +1 -1
  273. package/docs/ribbonmenu-commands.md +1 -1
  274. package/docs/ribbonmenu-customization.md +1 -1
  275. package/docs/ribbonmenu-display.md +1 -1
  276. package/docs/ribbonmenu-layouts.md +1 -1
  277. package/docs/ribbonmenu-programmatic.md +1 -1
  278. package/docs/ribbonmenu.md +1 -1
  279. package/docs/scheduler-agenda.md +1 -1
  280. package/docs/scheduler-big-data.md +1 -1
  281. package/docs/scheduler-editing.md +1 -1
  282. package/docs/scheduler-form.md +1 -1
  283. package/docs/scheduler-icalendar.md +1 -1
  284. package/docs/scheduler-mobile.md +1 -1
  285. package/docs/scheduler-recurrence.md +1 -1
  286. package/docs/scheduler-resources.md +1 -1
  287. package/docs/scheduler-timeline.md +1 -1
  288. package/docs/scheduler.md +1 -1
  289. package/docs/scrollview.md +1 -1
  290. package/docs/shortcuteditor.md +1 -1
  291. package/docs/showcase-flowstudio.md +61 -0
  292. package/docs/showcase-home.md +1 -1
  293. package/docs/showcase-mail.md +1 -1
  294. package/docs/showcase.md +1 -1
  295. package/docs/signature.md +1 -1
  296. package/docs/skeleton.md +1 -1
  297. package/docs/slider.md +1 -1
  298. package/docs/sortable.md +1 -1
  299. package/docs/sparkline.md +1 -1
  300. package/docs/speeddial.md +1 -1
  301. package/docs/splitter.md +1 -1
  302. package/docs/stepper.md +1 -1
  303. package/docs/switch.md +1 -1
  304. package/docs/tabdocs-dock.md +1 -1
  305. package/docs/tabdocs-drag.md +1 -1
  306. package/docs/tabdocs-menus.md +1 -1
  307. package/docs/tabdocs-mobile.md +1 -1
  308. package/docs/tabdocs-tabs.md +1 -1
  309. package/docs/tabdocs-windows.md +1 -1
  310. package/docs/tabdocs-workspace.md +1 -1
  311. package/docs/tabdocs.md +1 -1
  312. package/docs/tabs.md +1 -1
  313. package/docs/tagbox.md +1 -1
  314. package/docs/textarea.md +1 -1
  315. package/docs/textbox.md +1 -1
  316. package/docs/tileview.md +1 -1
  317. package/docs/timeline.md +1 -1
  318. package/docs/toast.md +1 -1
  319. package/docs/tokens.md +324 -1
  320. package/docs/toolbar-api.md +1 -1
  321. package/docs/toolbar-customization.md +1 -1
  322. package/docs/toolbar.md +1 -1
  323. package/docs/tooltip.md +1 -1
  324. package/docs/treeview.md +1 -1
  325. package/docs/validationsummary.md +1 -1
  326. package/docs/window.md +1 -1
  327. package/docs/wizard.md +1 -1
  328. package/llms-full.txt +10142 -462
  329. package/llms.txt +32 -1
  330. package/package.json +2 -2
@@ -0,0 +1,159 @@
1
+ import type { Bind, ComponentBase } from '@motifx/core';
2
+ import type { ControlProps } from '../../core/control';
3
+ import type { DiagramBackground } from './diagram-background';
4
+ import type { DiagramConnectedEventArgs } from './diagram-connected-event-args';
5
+ import type { DiagramConnectingEventArgs } from './diagram-connecting-event-args';
6
+ import type { DiagramConnection } from './diagram-connection';
7
+ import type { DiagramDeletedEventArgs } from './diagram-deleted-event-args';
8
+ import type { DiagramDeletingEventArgs } from './diagram-deleting-event-args';
9
+ import type { DiagramEdgeReshapedEventArgs } from './diagram-edge-reshaped-event-args';
10
+ import type { DiagramEdgeReshapingEventArgs } from './diagram-edge-reshaping-event-args';
11
+ import type { DiagramNodeToggledEventArgs } from './diagram-node-toggled-event-args';
12
+ import type { DiagramColumnCheckedEventArgs } from './diagram-column-checked-event-args';
13
+ import type { DiagramHistoryChangedEventArgs } from './diagram-history-changed-event-args';
14
+ import type { DiagramLayoutOptions } from './diagram-layout-options';
15
+ import type { DiagramMiniMapOptions } from './diagram-mini-map-options';
16
+ import type { DiagramNodeKind } from './diagram-node-kind';
17
+ import type { DiagramNodeResizedEventArgs } from './diagram-node-resized-event-args';
18
+ import type { DiagramNodeResizingEventArgs } from './diagram-node-resizing-event-args';
19
+ import type { DiagramPastedEventArgs } from './diagram-pasted-event-args';
20
+ import type { DiagramPastingEventArgs } from './diagram-pasting-event-args';
21
+ import type { DiagramNodesMovedEventArgs } from './diagram-nodes-moved-event-args';
22
+ import type { DiagramNodesMovingEventArgs } from './diagram-nodes-moving-event-args';
23
+ import type { DiagramSelectionChangedEventArgs } from './diagram-selection-changed-event-args';
24
+ import type { DiagramEdge } from './diagram-edge';
25
+ import type { DiagramEdgePath } from './diagram-edge-path';
26
+ import type { DiagramNode } from './diagram-node';
27
+ import type { DiagramReconnectedEventArgs } from './diagram-reconnected-event-args';
28
+ import type { DiagramReconnectingEventArgs } from './diagram-reconnecting-event-args';
29
+ import type { DiagramRect } from './diagram-rect';
30
+ import type { DiagramViewport } from './diagram-viewport';
31
+ import type { DiagramViewportChangedEventArgs } from './diagram-viewport-changed-event-args';
32
+ /** Props of `Diagram`. Each prop is also a settable property, and a function is tracked, except the callbacks. */
33
+ export interface DiagramProps<N extends DiagramNode = DiagramNode, E extends DiagramEdge = DiagramEdge> extends ControlProps {
34
+ /**
35
+ * The nodes, later ones over earlier ones. Given again, they are matched by `id`: a node that stays keeps its part and
36
+ * only what changed is written. A change made in place is read on `reState()` or `refresh()`.
37
+ */
38
+ nodes?: Bind<N[]>;
39
+ /**
40
+ * The connections, matched by `id` like the nodes. A connection the user draws is added to this array, and an end
41
+ * the user moves is written to its edge: the array and its objects always say what the diagram shows.
42
+ */
43
+ edges?: Bind<E[]>;
44
+ /**
45
+ * The app's kinds of node, by the name a node gives in `kind`: the content of each node of the kind (any control of
46
+ * the kit, made with JSX or in code), its ports, its look, whether it is resized or holds other nodes. A kind of the
47
+ * app's own takes the place of a built-in one of the same name (`group`, `lane`, `note`, `table`, `class`).
48
+ */
49
+ kinds?: Bind<Record<string, DiagramNodeKind<N>>>;
50
+ /** The shape of a connection's line that names none. Default: `'curve'`. */
51
+ edgePath?: Bind<DiagramEdgePath>;
52
+ /** Whether the user draws connections from the ports and moves their ends. Default: `true`. */
53
+ connectable?: Bind<boolean>;
54
+ /** Whether the user drags nodes. Default: `true`. */
55
+ draggable?: Bind<boolean>;
56
+ /** Whether the user selects nodes and connections. Default: `true`. */
57
+ selectable?: Bind<boolean>;
58
+ /** Whether the user deletes the selection with Delete or Backspace. Default: `true`. */
59
+ deletable?: Bind<boolean>;
60
+ /**
61
+ * Shows the diagram as it is: the user selects, pans, zooms and copies, and changes nothing. No node or connection is
62
+ * added, moved, resized, collapsed, reshaped, pasted or deleted, and undo and redo are off. What the app changes in
63
+ * code still changes it. Default: `false`.
64
+ */
65
+ readOnly?: Bind<boolean>;
66
+ /** Snaps dragged nodes to the grid of `gridSize`. Default: `false`. */
67
+ snapToGrid?: Bind<boolean>;
68
+ /** Lines a dragged node up with the others: it snaps to their edges and middles, and guides show it. Default: `true`. */
69
+ guides?: Bind<boolean>;
70
+ /** Keeps the user's steps to undo and redo. Default: `true`. */
71
+ history?: Bind<boolean>;
72
+ /**
73
+ * The component the diagram's commands are held to: their keys work while focus is inside it, and the toolbars and
74
+ * menus inside it that name them run this diagram's. Give the editor that holds the diagram and its toolbar. Default:
75
+ * the diagram.
76
+ */
77
+ commandScope?: Bind<ComponentBase | null>;
78
+ /** The app's own rule for a connection, on top of the diagram's: `false` refuses it. */
79
+ canConnect?: (connection: DiagramConnection) => boolean;
80
+ /** Where the view is. The user's panning and zooming change it; `onViewportChanged` tells each change. */
81
+ viewport?: Bind<DiagramViewport>;
82
+ /** The smallest zoom. Default: `0.1`. */
83
+ minZoom?: Bind<number>;
84
+ /** The largest zoom. Default: `4`. */
85
+ maxZoom?: Bind<number>;
86
+ /** The part of the diagram the view stays over, in the diagram's units. Default: `null`, anywhere. */
87
+ bounds?: Bind<DiagramRect | null>;
88
+ /** The marks on the surface. Default: `'dots'`. */
89
+ background?: Bind<DiagramBackground>;
90
+ /** The step of the grid the marks stand on, in the diagram's units. Default: `20`. */
91
+ gridSize?: Bind<number>;
92
+ /** Whether the user pans the view: a drag of the surface, the middle button, Space and a drag, the wheel, a finger, the arrow keys. Default: `true`. */
93
+ pannable?: Bind<boolean>;
94
+ /** Whether the user zooms: Ctrl and the wheel, two fingers, plus and minus. Default: `true`. */
95
+ zoomable?: Bind<boolean>;
96
+ /** Fits the nodes into view once they are first laid out. Default: `false`. */
97
+ autoFit?: Bind<boolean>;
98
+ /**
99
+ * Places the nodes as `layoutOptions` say once they are first laid out, as a part of showing them (neither a step of
100
+ * the history nor told): for nodes given without places. With `autoFit`, they are fitted into view after. Default:
101
+ * `false`.
102
+ */
103
+ autoLayout?: Bind<boolean>;
104
+ /** How `layout()` without options, `autoLayout` and the diagram's `layout` command place the nodes. Default: layers from the top down. */
105
+ layoutOptions?: Bind<DiagramLayoutOptions>;
106
+ /**
107
+ * A map of the whole diagram in a corner of it: `true`, or where it stands and how large it is. A click on it takes the
108
+ * view there, a drag moves it. Default: `false`.
109
+ */
110
+ miniMap?: Bind<boolean | DiagramMiniMapOptions>;
111
+ /**
112
+ * The most nodes the diagram keeps on the page at once. A diagram of more makes a node when it first comes into view
113
+ * and takes it off the page, its content kept, when it leaves; with more than this in view, it draws a sketch of the
114
+ * nodes and lines until fewer are in view. Default: `400`.
115
+ */
116
+ detailLimit?: Bind<number>;
117
+ /** The accessible name of the diagram. */
118
+ label?: Bind<string>;
119
+ /** Occurs whenever the view moves. */
120
+ onViewportChanged?: (e: DiagramViewportChangedEventArgs) => void;
121
+ /** Occurs before a new connection is added: change the edge it adds, or cancel it. */
122
+ onConnecting?: (e: DiagramConnectingEventArgs<E>) => void;
123
+ /** Occurs after a new connection was added to `edges`. */
124
+ onConnected?: (e: DiagramConnectedEventArgs<E>) => void;
125
+ /** Occurs before an end of a connection moves to another node or port; `cancel` keeps it. */
126
+ onReconnecting?: (e: DiagramReconnectingEventArgs<E>) => void;
127
+ /** Occurs after an end of a connection moved. */
128
+ onReconnected?: (e: DiagramReconnectedEventArgs<E>) => void;
129
+ /** Occurs whenever the selected nodes or connections change. */
130
+ onSelectionChanged?: (e: DiagramSelectionChangedEventArgs<N, E>) => void;
131
+ /** Occurs when the user starts to drag nodes; `cancel` keeps them where they are. */
132
+ onNodesMoving?: (e: DiagramNodesMovingEventArgs<N>) => void;
133
+ /** Occurs after the user dropped the nodes they dragged, or moved them with the keys. */
134
+ onNodesMoved?: (e: DiagramNodesMovedEventArgs<N>) => void;
135
+ /** Occurs before nodes and connections are deleted; `cancel` keeps them. */
136
+ onDeleting?: (e: DiagramDeletingEventArgs<N, E>) => void;
137
+ /** Occurs after nodes and connections were taken out of `nodes` and `edges`. */
138
+ onDeleted?: (e: DiagramDeletedEventArgs<N, E>) => void;
139
+ /** Occurs when the user starts to resize a node; `cancel` keeps its size. */
140
+ onNodeResizing?: (e: DiagramNodeResizingEventArgs<N>) => void;
141
+ /** Occurs after the user resized a node. */
142
+ onNodeResized?: (e: DiagramNodeResizedEventArgs<N>) => void;
143
+ /** Occurs after a node collapsed to its header or opened: a group, or a node of a kind that collapses. */
144
+ onNodeToggled?: (e: DiagramNodeToggledEventArgs<N>) => void;
145
+ /** Occurs after the box of a column of a table was ticked or cleared (see `DiagramTableNode.checkable`). */
146
+ onColumnChecked?: (e: DiagramColumnCheckedEventArgs<N>) => void;
147
+ /** Occurs when the user starts to move, add or remove a point of a connection's line; `cancel` keeps the line. */
148
+ onEdgeReshaping?: (e: DiagramEdgeReshapingEventArgs<E>) => void;
149
+ /** Occurs after the user moved, added or removed points of a connection's line. */
150
+ onEdgeReshaped?: (e: DiagramEdgeReshapedEventArgs<E>) => void;
151
+ /** Occurs before copies are added by a paste or a duplicate; change them, or cancel. */
152
+ onPasting?: (e: DiagramPastingEventArgs<N, E>) => void;
153
+ /** Occurs after copies were added to `nodes` and `edges`. */
154
+ onPasted?: (e: DiagramPastedEventArgs<N, E>) => void;
155
+ /** Occurs whenever the history changes: a step added, undone or redone, or the history cleared. */
156
+ onHistoryChanged?: (e: DiagramHistoryChangedEventArgs<N, E>) => void;
157
+ /** Occurs at most once a frame after nodes moved, changed their size, came, went or were hidden or shown, or the surface changed its size. */
158
+ onContentChanged?: () => void;
159
+ }
@@ -0,0 +1,10 @@
1
+ import type { DiagramConnection } from './diagram-connection';
2
+ import type { DiagramEdge } from './diagram-edge';
3
+ import type { DiagramEdgeEnd } from './diagram-edge-end';
4
+ /** Occurs after an end of a connection moved; the edge's fields say where it is now. */
5
+ export interface DiagramReconnectedEventArgs<E extends DiagramEdge = DiagramEdge> {
6
+ readonly edge: E;
7
+ readonly end: DiagramEdgeEnd;
8
+ /** The ends it joined before. */
9
+ readonly previous: DiagramConnection;
10
+ }
@@ -0,0 +1,11 @@
1
+ import type { DiagramConnection } from './diagram-connection';
2
+ import type { DiagramEdge } from './diagram-edge';
3
+ import type { DiagramEdgeEnd } from './diagram-edge-end';
4
+ /** Occurs before an end of a connection moves to another node or port; `cancel` keeps it. */
5
+ export interface DiagramReconnectingEventArgs<E extends DiagramEdge = DiagramEdge> {
6
+ readonly edge: E;
7
+ readonly end: DiagramEdgeEnd;
8
+ /** The ends the connection will join. */
9
+ readonly connection: DiagramConnection;
10
+ cancel: boolean;
11
+ }
@@ -0,0 +1,7 @@
1
+ /** A rectangle of the diagram in its own units: its top left corner and its size. */
2
+ export interface DiagramRect {
3
+ x: number;
4
+ y: number;
5
+ width: number;
6
+ height: number;
7
+ }
@@ -0,0 +1,2 @@
1
+ /** A handle of a node being resized: a side or a corner, by the compass. */
2
+ export type DiagramResizeSide = 'n' | 'ne' | 'e' | 'se' | 's' | 'sw' | 'w' | 'nw';
@@ -0,0 +1,10 @@
1
+ import type { DiagramPoint } from './diagram-point';
2
+ import type { DiagramRect } from './diagram-rect';
3
+ /**
4
+ * A right-angled way from `start` to `end` around `obstacles`, kept `margin` away from each: the shortest for the
5
+ * turns it takes, each turn costing as much as `turn` of length. `startOut` is the way the line already runs at the
6
+ * start (a turn there costs), `endOut` the way out of the node at the end (the line arrives against it); `null` for
7
+ * any. Obstacles far from both ends are left out, and added back when the way found crosses them. Returns the corners,
8
+ * the ends among them; `null` when there is no way or the search would be too large.
9
+ */
10
+ export declare function routeAround(start: DiagramPoint, startOut: DiagramPoint | null, end: DiagramPoint, endOut: DiagramPoint | null, obstacles: readonly DiagramRect[], margin: number, turn: number): DiagramPoint[] | null;
@@ -0,0 +1,9 @@
1
+ import type { DiagramEdge } from './diagram-edge';
2
+ import type { DiagramNode } from './diagram-node';
3
+ /** Occurs whenever the selected nodes or connections change. */
4
+ export interface DiagramSelectionChangedEventArgs<N extends DiagramNode = DiagramNode, E extends DiagramEdge = DiagramEdge> {
5
+ readonly nodes: readonly N[];
6
+ readonly edges: readonly E[];
7
+ /** `true` when the user selected, `false` when code did. */
8
+ readonly byUser: boolean;
9
+ }
@@ -0,0 +1,5 @@
1
+ /** Nodes and connections, by `id`, to select. */
2
+ export interface DiagramSelection {
3
+ nodes?: readonly string[];
4
+ edges?: readonly string[];
5
+ }
@@ -0,0 +1,2 @@
1
+ /** A side of a node. */
2
+ export type DiagramSide = 'top' | 'right' | 'bottom' | 'left';
@@ -0,0 +1,13 @@
1
+ /** A column of a table node: a row under the table's name, with a port beside it on the left and on the right. */
2
+ export interface DiagramTableColumn {
3
+ /** Unique in the table. It names the column's port too, so a connection names the column in `sourcePort` or `targetPort`. */
4
+ name: string;
5
+ /** Its type, shown after its name. */
6
+ type?: string;
7
+ /** Marks it as the primary key, as a foreign key, or as unique. */
8
+ primaryKey?: boolean;
9
+ foreignKey?: boolean;
10
+ unique?: boolean;
11
+ /** Whether its box is ticked, in a table that shows one (`checkable`). */
12
+ checked?: boolean;
13
+ }
@@ -0,0 +1,12 @@
1
+ import type { DiagramNode } from './diagram-node';
2
+ import type { DiagramTableColumn } from './diagram-table-column';
3
+ /** A node of the built-in `table` kind: its `text` is the table's name. */
4
+ export interface DiagramTableNode extends DiagramNode {
5
+ /** Its columns, in order. Changed in place, they are read on `refresh()`. */
6
+ columns: DiagramTableColumn[];
7
+ /**
8
+ * Shows a box before each column, which the user ticks and clears, as one is chosen for a query; the column's `checked`
9
+ * holds it, and `onColumnChecked` tells it.
10
+ */
11
+ checkable?: boolean;
12
+ }
@@ -0,0 +1,14 @@
1
+ import type { LayerItem, LayerLink } from './diagram-layered';
2
+ /** Where a tree layout puts the items, in its own axes: the middle of each across the levels, where it starts along them. */
3
+ export interface TreePlan {
4
+ cross: number[];
5
+ rank: number[];
6
+ extent: number;
7
+ }
8
+ /**
9
+ * Lays items out as a tree: the items no link comes into are its roots, each other item hangs under the first item that
10
+ * reaches it in the fewest steps, and the links that close a cycle or join two branches do not count. Each level of the
11
+ * tree is a layer as thick as its thickest item; each item stands over the middle of its children, and the branches
12
+ * stand as close as their outlines allow, the room between small branches shared out evenly.
13
+ */
14
+ export declare function treePlan(items: readonly LayerItem[], links: readonly LayerLink[], nodeGap: number, layerGap: number): TreePlan;
@@ -0,0 +1,8 @@
1
+ import type { DiagramViewport } from './diagram-viewport';
2
+ /** Occurs whenever the view of a diagram moves. */
3
+ export interface DiagramViewportChangedEventArgs {
4
+ readonly viewport: DiagramViewport;
5
+ readonly previous: DiagramViewport;
6
+ /** `true` when the user panned or zoomed, `false` when code moved the view. */
7
+ readonly byUser: boolean;
8
+ }
@@ -0,0 +1,5 @@
1
+ /** How a method moves the view of a diagram. */
2
+ export interface DiagramViewportOptions {
3
+ /** Glides there with the design language's motion instead of jumping. Default: `false`. */
4
+ animate?: boolean;
5
+ }
@@ -0,0 +1,6 @@
1
+ /** Where the view of a diagram is: the place of the diagram's origin on the surface, in pixels, and the zoom (1 is actual size). */
2
+ export interface DiagramViewport {
3
+ x: number;
4
+ y: number;
5
+ zoom: number;
6
+ }
@@ -0,0 +1,65 @@
1
+ export { Diagram } from './Diagram';
2
+ export type { DiagramProps } from './diagram-props';
3
+ export { DiagramMap } from './DiagramMap';
4
+ export type { DiagramMapProps } from './diagram-map-props';
5
+ export type { DiagramMapTarget } from './diagram-map-target';
6
+ export type { DiagramMiniMapOptions } from './diagram-mini-map-options';
7
+ export type { DiagramMiniMapPosition } from './diagram-mini-map-position';
8
+ export type { DiagramNode } from './diagram-node';
9
+ export type { DiagramNodeStatus } from './diagram-node-status';
10
+ export type { DiagramLinksOptions } from './diagram-links-options';
11
+ export type { DiagramPoint } from './diagram-point';
12
+ export type { DiagramRect } from './diagram-rect';
13
+ export type { DiagramViewport } from './diagram-viewport';
14
+ export type { DiagramBackground } from './diagram-background';
15
+ export type { DiagramViewportOptions } from './diagram-viewport-options';
16
+ export type { DiagramFitOptions } from './diagram-fit-options';
17
+ export type { DiagramCenterOptions } from './diagram-center-options';
18
+ export type { DiagramViewportChangedEventArgs } from './diagram-viewport-changed-event-args';
19
+ export type { DiagramEdge } from './diagram-edge';
20
+ export type { DiagramPort } from './diagram-port';
21
+ export type { DiagramSide } from './diagram-side';
22
+ export type { DiagramEdgePath } from './diagram-edge-path';
23
+ export type { DiagramMarker } from './diagram-marker';
24
+ export type { DiagramEdgeEnd } from './diagram-edge-end';
25
+ export type { DiagramPathEnds } from './diagram-path-ends';
26
+ export type { DiagramPathResult } from './diagram-path-result';
27
+ export type { DiagramConnection } from './diagram-connection';
28
+ export type { DiagramConnectingEventArgs } from './diagram-connecting-event-args';
29
+ export type { DiagramConnectedEventArgs } from './diagram-connected-event-args';
30
+ export type { DiagramReconnectingEventArgs } from './diagram-reconnecting-event-args';
31
+ export type { DiagramReconnectedEventArgs } from './diagram-reconnected-event-args';
32
+ export type { DiagramSelection } from './diagram-selection';
33
+ export type { DiagramSelectionChangedEventArgs } from './diagram-selection-changed-event-args';
34
+ export type { DiagramNodeMove } from './diagram-node-move';
35
+ export type { DiagramNodesMovingEventArgs } from './diagram-nodes-moving-event-args';
36
+ export type { DiagramNodesMovedEventArgs } from './diagram-nodes-moved-event-args';
37
+ export type { DiagramDeletingEventArgs } from './diagram-deleting-event-args';
38
+ export type { DiagramDeletedEventArgs } from './diagram-deleted-event-args';
39
+ export type { DiagramPastingEventArgs } from './diagram-pasting-event-args';
40
+ export type { DiagramPastedEventArgs } from './diagram-pasted-event-args';
41
+ export type { DiagramChange } from './diagram-change';
42
+ export type { DiagramEdit } from './diagram-edit';
43
+ export type { DiagramHistoryChangedEventArgs } from './diagram-history-changed-event-args';
44
+ export type { DiagramAlignment } from './diagram-alignment';
45
+ export type { DiagramNodeKind } from './diagram-node-kind';
46
+ export { cardKind, type DiagramCardKindOptions } from './diagram-card-kind';
47
+ export type { DiagramCardNode } from './diagram-card-node';
48
+ export type { DiagramNodeContext } from './diagram-node-context';
49
+ export type { DiagramResizeSide } from './diagram-resize-side';
50
+ export type { DiagramNodeResizingEventArgs } from './diagram-node-resizing-event-args';
51
+ export type { DiagramNodeResizedEventArgs } from './diagram-node-resized-event-args';
52
+ export type { DiagramNodeToggledEventArgs } from './diagram-node-toggled-event-args';
53
+ export type { DiagramColumnCheckedEventArgs } from './diagram-column-checked-event-args';
54
+ export type { DiagramTableNode } from './diagram-table-node';
55
+ export type { DiagramTableColumn } from './diagram-table-column';
56
+ export type { DiagramClassNode } from './diagram-class-node';
57
+ export type { DiagramClassMember } from './diagram-class-member';
58
+ export type { DiagramEdgeReshapingEventArgs } from './diagram-edge-reshaping-event-args';
59
+ export type { DiagramEdgeReshapedEventArgs } from './diagram-edge-reshaped-event-args';
60
+ export type { DiagramLayoutOptions } from './diagram-layout-options';
61
+ export type { DiagramLayoutType } from './diagram-layout-type';
62
+ export type { DiagramLayoutDirection } from './diagram-layout-direction';
63
+ export type { DiagramData } from './diagram-data';
64
+ export type { DiagramDrawnNode } from './diagram-drawn-node';
65
+ export type { DiagramExportOptions } from './diagram-export-options';
@@ -0,0 +1,5 @@
1
+ import type { ComponentBase } from '@motifx/core';
2
+ /** The click that ends a drag is not a click on what lies under the pointer: it is swallowed before anything hears it. */
3
+ export declare function swallowNextClick(surface: ComponentBase): void;
4
+ /** For a drag Escape ended while the button is still down: the click of its release is swallowed too. */
5
+ export declare function swallowClickOnRelease(surface: ComponentBase): void;
@@ -0,0 +1,111 @@
1
+ import type { Bind, ComponentBase, IBaseProp } from '@motifx/core';
2
+ import { expression } from '@motifx-community/data';
3
+ import { Field } from '../../parts/field/Field';
4
+ import type { ValidationRule } from '../../parts/validation/validation-rule';
5
+ import type { ExpressionEditorProps } from './expression-editor-props';
6
+ /**
7
+ * The text of a problem of an expression in the kit's language, with what it names: for a list of problems an app shows
8
+ * itself, as `ExpressionEditor.problemText` does.
9
+ */
10
+ export declare function expressionProblemText(problem: expression.Problem): string;
11
+ /**
12
+ * A field for an expression of the data layer's language, or for a template with `{{ … }}` expressions in it. Its
13
+ * text is colored by what each piece is, and its problems are underlined as it is typed: those of the writing, and
14
+ * with a `schema`, those of the names, the fields and the types. The words that may be written at the caret come in a
15
+ * list (Ctrl+Space shows it any time), the call the caret is in and the problem there in a box above it. The value is
16
+ * the text; `tree` and `problems` are what it reads as.
17
+ *
18
+ * @example
19
+ * <ExpressionEditor label="&Condition" schema={{ item: '{ total: number, status: text }' }} expect="boolean" x-model={() => this.rule.when} />
20
+ *
21
+ * const subject = new ExpressionEditor({ label: 'Subject', template: true, schema });
22
+ * subject.value = 'Order {{ item.id }} is late';
23
+ */
24
+ export declare class ExpressionEditor extends Field<string, ExpressionEditorProps> {
25
+ constructor(props?: IBaseProp<ExpressionEditorProps>);
26
+ get schema(): expression.Schema | null;
27
+ set schema(value: Bind<expression.Schema | null>);
28
+ get template(): boolean;
29
+ set template(value: Bind<boolean>);
30
+ get multiline(): boolean;
31
+ set multiline(value: Bind<boolean>);
32
+ get rows(): number;
33
+ set rows(value: Bind<number>);
34
+ get expect(): expression.Type | string | null;
35
+ set expect(value: Bind<expression.Type | string | null>);
36
+ get functions(): readonly expression.Function[];
37
+ set functions(value: Bind<readonly expression.Function[]>);
38
+ get placeholder(): string;
39
+ set placeholder(value: Bind<string>);
40
+ get suggest(): boolean;
41
+ set suggest(value: Bind<boolean>);
42
+ /** What the text reads as; `null` while it does not read, or is empty. */
43
+ get tree(): expression.Tree | null;
44
+ /** The problems of the text, errors and warnings, where they are: those of the writing, and with a `schema`, of the checking. */
45
+ get problems(): readonly expression.Problem[];
46
+ /** The type of the value the expression gives, with a `schema`; `null` without one, or while it does not read. */
47
+ get resultType(): expression.Type | null;
48
+ /** The `<textarea>` as a component: write its attributes with `put` and call its methods through `attr`. */
49
+ get textAreaPart(): ComponentBase<HTMLTextAreaElement>;
50
+ /** Where the selection starts in the text; the caret when nothing is selected. */
51
+ get selectionStart(): number;
52
+ /** Where the selection ends in the text; the caret when nothing is selected. */
53
+ get selectionEnd(): number;
54
+ /** Selects from `start` to `end`, or puts the caret at `start` alone, at once. */
55
+ setSelectionRange(start: number, end?: number): void;
56
+ /** Selects all text. */
57
+ select(): void;
58
+ /** Writes `text` over the selection, or at the caret, as typing it would (a name picked from a list of the page, say). */
59
+ insertText(text: string): void;
60
+ /** Shows the words that may be written at the caret, as Ctrl+Space does. */
61
+ showSuggestions(): void;
62
+ closeSuggestions(): void;
63
+ /** The text of a problem in the kit's language, with what it names. */
64
+ problemText(problem: expression.Problem): string;
65
+ /** What a function does, in the kit's language for those of the library; an application's function says it itself. */
66
+ functionText(fn: expression.Function): string;
67
+ protected get controlTag(): string;
68
+ protected createControl(): ComponentBase;
69
+ protected emptyValue(): string;
70
+ protected normalizeValue(value: string): string;
71
+ protected renderValue(value: string): void;
72
+ protected builtInRules(): ValidationRule<string>[];
73
+ private firstError;
74
+ private get editorParts();
75
+ private createEditorParts;
76
+ private get typedText();
77
+ private get caret();
78
+ private get options();
79
+ /** Reads the text: its tree, and its problems, those of the checking too with a schema. */
80
+ private read;
81
+ /** Draws the colored copy of the text: a part for each piece, cut where a problem's line starts or ends. */
82
+ private draw;
83
+ /** Lays the copy under the text again, in the window's next round: its place, its size and its scroll. */
84
+ private place;
85
+ private drawPlace;
86
+ /** An expression is code and runs left to right on every page; a template's text takes the way of its own words. */
87
+ private renderDirection;
88
+ private renderLines;
89
+ private listen;
90
+ /** The user typed (or the editor wrote) the text: read, drawn, and the words for the caret offered or not. */
91
+ private typed;
92
+ /**
93
+ * Offers the words for the caret: the list opens at the word, or closes when there are none. Typed, a word already
94
+ * written out whole is not offered again.
95
+ */
96
+ private offer;
97
+ private closeList;
98
+ private createList;
99
+ /** The highlighted word: the text points at it, and what it is shows under the list. */
100
+ private pointAt;
101
+ /** Writes the chosen word over the one at the caret. */
102
+ private choose;
103
+ /** Writes `insert` over `from`–`to` as typing would, so the browser's undo takes it back; where it cannot, at once. */
104
+ private writeText;
105
+ private keyDown;
106
+ /** The caret moved: the list closes when it left the word, and the box above it follows. */
107
+ private followCaret;
108
+ /** The box above the caret: the call the caret is in, with the argument it is at, and the problem there. */
109
+ private showHelp;
110
+ private createHelp;
111
+ }
@@ -0,0 +1,24 @@
1
+ import type { Bind } from '@motifx/core';
2
+ import type { expression } from '@motifx-community/data';
3
+ import type { FieldProps } from '../../parts/field/field-props';
4
+ /** Props of `ExpressionEditor`, in addition to the field props. Each prop is also a settable, reactive property. */
5
+ export interface ExpressionEditorProps extends FieldProps<string> {
6
+ /**
7
+ * The names the expression is given and their types (`{ item: '{ name: text, total: number }' }`): what the list of
8
+ * words offers, and what the expression is checked against. A name it does not give is a problem.
9
+ */
10
+ schema?: Bind<expression.Schema>;
11
+ /** The text is a template: plain text with `{{ … }}` expressions in it. */
12
+ template?: Bind<boolean>;
13
+ /** The text may run over several lines and Enter starts a new one. The default is one line, which Enter does not break. */
14
+ multiline?: Bind<boolean>;
15
+ /** The number of lines shown with `multiline`. The default is `3`. */
16
+ rows?: Bind<number>;
17
+ /** The type the value is wanted as (`boolean` for a condition); one that gives another is a problem. */
18
+ expect?: Bind<expression.Type | string>;
19
+ /** Functions of the application, besides those of the library: offered, checked and described as the library's are. */
20
+ functions?: Bind<readonly expression.Function[]>;
21
+ placeholder?: Bind<string>;
22
+ /** Offers the words for the caret while typing. The default is `true`; Ctrl+Space offers them either way. */
23
+ suggest?: Bind<boolean>;
24
+ }
@@ -0,0 +1,2 @@
1
+ export { ExpressionEditor, expressionProblemText } from './ExpressionEditor';
2
+ export type { ExpressionEditorProps } from './expression-editor-props';
@@ -39,7 +39,7 @@ export declare class FormLayout<T extends object = Record<string, unknown>> exte
39
39
  /** The validation group of the form's fields. */
40
40
  get validationGroup(): ValidationGroup;
41
41
  get isValid(): boolean;
42
- /** The editor of a field. */
42
+ /** The editor of a field; of a field in a group's object by its path (`address.city`). */
43
43
  editorOf(field: string): ComponentBase | undefined;
44
44
  /** Validates every field. The first invalid field receives focus, with its tab shown first, unless `focus` is `false`. */
45
45
  validate(options?: {
@@ -52,7 +52,7 @@ export declare class FormLayout<T extends object = Record<string, unknown>> exte
52
52
  * reactive, and the form reads them as they are.
53
53
  */
54
54
  refresh(): void;
55
- /** Re-reads one field of your data object after it has been changed in place. */
55
+ /** Re-reads one field of your data object after it has been changed in place; a field in a group's object by its path. */
56
56
  refreshField(field: string): void;
57
57
  /** Validates every field, then reports the submission as valid (`onValidSubmit`) or invalid (`onInvalidSubmit`). */
58
58
  submit(event?: Event): Promise<boolean>;
@@ -66,6 +66,10 @@ export declare class FormLayout<T extends object = Record<string, unknown>> exte
66
66
  /** Whether `part` is in one of this form's items that are not shown. */
67
67
  private hides;
68
68
  private get formParts();
69
+ /** The form's own fields: those of its data object. */
70
+ private get scope();
71
+ /** The fields of the object in `field` of a scope's object, for a group with a `field`. */
72
+ private within;
69
73
  private clear;
70
74
  /** Selects the tab a field is on (each tab up from it, for tabs in tabs). */
71
75
  private reveal;
@@ -87,7 +91,10 @@ export declare class FormLayout<T extends object = Record<string, unknown>> exte
87
91
  private place;
88
92
  /** The columns of a group or a tab, as its item gives them now. */
89
93
  private gridColumns;
90
- /** A template's component, made once: its `context.data` is the form's data now, followed where it is read. */
94
+ /**
95
+ * A template's component, made once: its `context.data` is the form's data now (in a group with a field, the object
96
+ * the group edits), followed where it is read.
97
+ */
91
98
  private template;
92
99
  /** Tabs of items: every panel is built at once, so every field is checked whichever tab shows. */
93
100
  private placeTabs;
@@ -1,2 +1,2 @@
1
1
  /** The editors a form knows by name. Register more with `FormLayout.editors`. */
2
- export type FormEditorType = 'text' | 'password' | 'email' | 'textarea' | 'number' | 'date' | 'datetime' | 'time' | 'checkbox' | 'switch' | 'dropdown' | 'combobox' | 'lookup' | 'radio' | 'slider' | (string & {});
2
+ export type FormEditorType = 'text' | 'password' | 'email' | 'textarea' | 'number' | 'date' | 'datetime' | 'time' | 'checkbox' | 'switch' | 'dropdown' | 'combobox' | 'lookup' | 'radio' | 'slider' | 'tagbox' | 'expression' | 'template' | (string & {});
@@ -10,7 +10,10 @@ import type { FormTemplateContext } from './form-template-context';
10
10
  * caption, tabs of items, a button, or any custom component.
11
11
  */
12
12
  export interface FormItem {
13
- /** The property of the data object that the editor displays and changes. */
13
+ /**
14
+ * The property of the data object that the editor displays and changes. On a group, the property that holds the
15
+ * object its items edit (`address`, its items `city` and `zip`), made when one of them is changed.
16
+ */
14
17
  field?: string;
15
18
  label?: Bind<string>;
16
19
  /**
@@ -22,7 +22,7 @@ export interface FormLayoutProps<T extends object> extends ControlProps {
22
22
  }) => void;
23
23
  /**
24
24
  * Occurs after the user changes a field and its value is written to the data object. This is where to
25
- * show what depends on it (`refresh()`).
25
+ * show what depends on it (`refresh()`). A field in a group's object comes by its path (`address.city`).
26
26
  */
27
27
  onFieldChanged?: (e: {
28
28
  field: string;
@@ -1,4 +1,5 @@
1
1
  export { FormLayout } from './FormLayout';
2
+ export { schemaItems, type SchemaItemsOptions } from './schema-items';
2
3
  export type { FormLayoutProps } from './form-layout-props';
3
4
  export type { FormItem } from './form-item';
4
5
  export type { FormEditorType } from './form-editor-type';
@@ -0,0 +1,26 @@
1
+ import { jsonSchema } from '@motifx-community/data';
2
+ import type { FormItem } from './form-item';
3
+ type Schema = jsonSchema.JsonSchema;
4
+ type Props = Record<string, unknown>;
5
+ /** Options of `schemaItems`. */
6
+ export interface SchemaItemsOptions {
7
+ /**
8
+ * Props given to the editors by their name, besides what the schema says: `{ expression: { schema: names } }` gives
9
+ * every expression field the names it may use.
10
+ */
11
+ editorProps?: Readonly<Record<string, Props>>;
12
+ }
13
+ /**
14
+ * The items of a form from a schema of its data object (the data layer's `jsonSchema` subset): a field for each
15
+ * property, with the editor its values, type and format call for, its `title` as the label, its `description` as the
16
+ * help text, and the same checks the data layer's `validate` makes, with the kit's texts. An object property is a group
17
+ * that edits the object in it; a list of texts, numbers or values of an enum is a tag box; a `const` is left out.
18
+ * `x-editor` picks an editor of `FormLayout.editors` by name (`expression`, `template`, an application's own), and
19
+ * `x-editorProps` gives it props. In development, what the schema has that the form does not read or edit is told once.
20
+ * Make the items once: each call makes new editors.
21
+ *
22
+ * @example
23
+ * <FormLayout data={this.settings} items={[...schemaItems(emailSchema, { editorProps: { template: { schema: names } } }), { button: { text: 'Save', submit: true } }]} />
24
+ */
25
+ export declare function schemaItems(schema: Schema, options?: SchemaItemsOptions): FormItem[];
26
+ export {};