@motifx-community/ui 0.1.0-beta.2 → 0.1.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/CHANGELOG.md +87 -12
  2. package/README.md +6 -6
  3. package/dist/components/accordion/Accordion.d.ts +3 -3
  4. package/dist/components/accordion/AccordionItem.d.ts +1 -1
  5. package/dist/components/card/Card.d.ts +1 -1
  6. package/dist/components/contextmenu/ContextMenu.d.ts +1 -1
  7. package/dist/components/datagrid/DataGrid.d.ts +5 -5
  8. package/dist/components/datagrid/data-grid-props.d.ts +2 -2
  9. package/dist/components/datagrid/grid-adaptive-row-expanded-event-args.d.ts +1 -1
  10. package/dist/components/datagrid/grid-adaptive-row-expanding-event-args.d.ts +1 -1
  11. package/dist/components/datagrid/grid-grouping-changed-event-args.d.ts +1 -1
  12. package/dist/components/datagrid/grid-grouping-changing-event-args.d.ts +2 -2
  13. package/dist/components/datagrid/grid-master-detail.d.ts +1 -1
  14. package/dist/components/datagrid/grid-row-expanded-event-args.d.ts +1 -1
  15. package/dist/components/datagrid/grid-row-expanding-event-args.d.ts +1 -1
  16. package/dist/components/datagrid/grid-search-text-changed-event-args.d.ts +1 -1
  17. package/dist/components/datagrid/grid-search-text-changing-event-args.d.ts +1 -1
  18. package/dist/components/datagrid/grid-sort-changing-event-args.d.ts +1 -1
  19. package/dist/components/datagrid/model/GridSearch.d.ts +1 -1
  20. package/dist/components/draggable/Draggable.d.ts +99 -0
  21. package/dist/components/draggable/DropTarget.d.ts +38 -0
  22. package/dist/components/draggable/draggable-event-args.d.ts +17 -0
  23. package/dist/components/draggable/draggable-props.d.ts +37 -0
  24. package/dist/components/draggable/drop-event-args.d.ts +11 -0
  25. package/dist/components/draggable/drop-target-props.d.ts +13 -0
  26. package/dist/components/draggable/index.d.ts +6 -0
  27. package/dist/components/fileuploader/FileUploader.d.ts +1 -1
  28. package/dist/components/fileuploader/file-uploader-props.d.ts +1 -1
  29. package/dist/components/fileuploader/upload-mode.d.ts +1 -1
  30. package/dist/components/filterbuilder/FilterBuilder.d.ts +1 -1
  31. package/dist/components/gallery/Gallery.d.ts +132 -0
  32. package/dist/components/gallery/gallery-item-click-event-args.d.ts +9 -0
  33. package/dist/components/gallery/gallery-item.d.ts +18 -0
  34. package/dist/components/gallery/gallery-props.d.ts +38 -0
  35. package/dist/components/gallery/index.d.ts +6 -0
  36. package/dist/components/gallery/slide-changed-event-args.d.ts +11 -0
  37. package/dist/components/gallery/slide-changing-event-args.d.ts +14 -0
  38. package/dist/components/layout/ChildSettings.d.ts +1 -1
  39. package/dist/components/layout/DockPanel.d.ts +2 -2
  40. package/dist/components/layout/Grid.d.ts +1 -1
  41. package/dist/components/layout/SplitContainer.d.ts +1 -1
  42. package/dist/components/layout/Stack.d.ts +1 -1
  43. package/dist/components/multiview/MultiView.d.ts +87 -0
  44. package/dist/components/multiview/View.d.ts +41 -0
  45. package/dist/components/multiview/index.d.ts +6 -0
  46. package/dist/components/multiview/multi-view-props.d.ts +24 -0
  47. package/dist/components/multiview/view-props.d.ts +15 -0
  48. package/dist/components/multiview/view-selecting-event-args.d.ts +15 -0
  49. package/dist/components/multiview/view-selection-changed-event-args.d.ts +12 -0
  50. package/dist/components/numberbox/number-box-props.d.ts +1 -1
  51. package/dist/components/popover/Popover.d.ts +1 -1
  52. package/dist/components/popover/popover-props.d.ts +1 -1
  53. package/dist/components/resizable/Resizable.d.ts +84 -0
  54. package/dist/components/resizable/index.d.ts +3 -0
  55. package/dist/components/resizable/resizable-props.d.ts +41 -0
  56. package/dist/components/resizable/resize-event-args.d.ts +13 -0
  57. package/dist/components/scheduler/AppointmentEditor.d.ts +1 -1
  58. package/dist/components/scheduler/scheduler-props.d.ts +1 -1
  59. package/dist/components/scrollview/ScrollView.d.ts +1 -1
  60. package/dist/components/skeleton/Skeleton.d.ts +1 -1
  61. package/dist/components/speeddial/SpeedDial.d.ts +129 -0
  62. package/dist/components/speeddial/index.d.ts +6 -0
  63. package/dist/components/speeddial/speed-dial-action-click-event-args.d.ts +9 -0
  64. package/dist/components/speeddial/speed-dial-action.d.ts +25 -0
  65. package/dist/components/speeddial/speed-dial-event-args.d.ts +8 -0
  66. package/dist/components/speeddial/speed-dial-props.d.ts +49 -0
  67. package/dist/components/speeddial/speed-dial-tooltip.d.ts +3 -0
  68. package/dist/components/splitter/SplitPane.d.ts +45 -0
  69. package/dist/components/splitter/Splitter.d.ts +116 -0
  70. package/dist/components/splitter/index.d.ts +6 -0
  71. package/dist/components/splitter/split-pane-props.d.ts +21 -0
  72. package/dist/components/splitter/splitter-collapse-event-args.d.ts +13 -0
  73. package/dist/components/splitter/splitter-props.d.ts +25 -0
  74. package/dist/components/splitter/splitter-resize-event-args.d.ts +10 -0
  75. package/dist/components/stepper/Stepper.d.ts +1 -1
  76. package/dist/components/stepper/WizardStep.d.ts +1 -1
  77. package/dist/components/stepper/step-changed-event-args.d.ts +1 -1
  78. package/dist/components/stepper/step-changing-event-args.d.ts +1 -1
  79. package/dist/components/stepper/wizard-props.d.ts +1 -1
  80. package/dist/components/tabdocs/TabDocumentManager.d.ts +1 -1
  81. package/dist/components/tabs/Tabs.d.ts +2 -2
  82. package/dist/components/tileview/TileView.d.ts +128 -0
  83. package/dist/components/tileview/index.d.ts +6 -0
  84. package/dist/components/tileview/tile-click-event-args.d.ts +9 -0
  85. package/dist/components/tileview/tile-reorder-event-args.d.ts +11 -0
  86. package/dist/components/tileview/tile-selection-changed-event-args.d.ts +11 -0
  87. package/dist/components/tileview/tile-view-item.d.ts +18 -0
  88. package/dist/components/tileview/tile-view-props.d.ts +38 -0
  89. package/dist/components/timeline/Timeline.d.ts +113 -0
  90. package/dist/components/timeline/index.d.ts +5 -0
  91. package/dist/components/timeline/timeline-item-click-event-args.d.ts +9 -0
  92. package/dist/components/timeline/timeline-item.d.ts +24 -0
  93. package/dist/components/timeline/timeline-props.d.ts +30 -0
  94. package/dist/components/timeline/timeline-selection-changed-event-args.d.ts +11 -0
  95. package/dist/components/tooltip/Tooltip.d.ts +1 -1
  96. package/dist/components/treeview/TreeView.d.ts +1 -1
  97. package/dist/components/validationsummary/ValidationSummary.d.ts +56 -0
  98. package/dist/components/validationsummary/index.d.ts +3 -0
  99. package/dist/components/validationsummary/summary-item-click-event-args.d.ts +11 -0
  100. package/dist/components/validationsummary/validation-summary-props.d.ts +17 -0
  101. package/dist/core/control.d.ts +4 -4
  102. package/dist/core/flow-home.d.ts +1 -1
  103. package/dist/core/ui-strings.d.ts +26 -0
  104. package/dist/generated/tokens.d.ts +6390 -4745
  105. package/dist/index.d.ts +9 -0
  106. package/dist/index.js +5119 -759
  107. package/dist/index.js.map +1 -1
  108. package/dist/locales/en.json +22 -1
  109. package/dist/locales/tr.json +22 -1
  110. package/dist/parts/slide/slide-track-host.d.ts +19 -0
  111. package/dist/parts/slide/slide-track.d.ts +45 -0
  112. package/dist/styles.css +3072 -182
  113. package/dist/tokens/index.d.ts +6390 -4745
  114. package/dist/tokens/index.js +6390 -4745
  115. package/dist/tokens/index.js.map +1 -1
  116. package/dist/{tr-B218zMtu.js → tr-C5IXRzAH.js} +45 -3
  117. package/dist/{tr-B218zMtu.js.map → tr-C5IXRzAH.js.map} +1 -1
  118. package/docs/accordion.md +9 -9
  119. package/docs/actionsheet.md +2 -2
  120. package/docs/avatar.md +5 -5
  121. package/docs/badge.md +6 -6
  122. package/docs/bottomsheet.md +4 -4
  123. package/docs/breadcrumb.md +3 -3
  124. package/docs/button.md +8 -8
  125. package/docs/buttongroup.md +5 -5
  126. package/docs/calendar.md +6 -6
  127. package/docs/card.md +6 -6
  128. package/docs/checkbox.md +7 -7
  129. package/docs/chip.md +5 -5
  130. package/docs/colorbox.md +3 -3
  131. package/docs/combobox.md +7 -7
  132. package/docs/control.md +12 -12
  133. package/docs/datagrid-api.md +5 -5
  134. package/docs/datagrid-bands.md +1 -1
  135. package/docs/datagrid-drag-select.md +2 -2
  136. package/docs/datagrid-drag.md +1 -1
  137. package/docs/datagrid-editing.md +2 -2
  138. package/docs/datagrid-filtering.md +3 -3
  139. package/docs/datagrid-forms.md +1 -1
  140. package/docs/datagrid-grouping.md +1 -1
  141. package/docs/datagrid-layout.md +4 -4
  142. package/docs/datagrid-lookups.md +1 -1
  143. package/docs/datagrid-master-detail.md +3 -3
  144. package/docs/datagrid-scrolling.md +1 -1
  145. package/docs/datagrid-selection.md +3 -3
  146. package/docs/datagrid.md +8 -8
  147. package/docs/datebox.md +6 -6
  148. package/docs/daterangebox.md +4 -4
  149. package/docs/draggable.md +194 -0
  150. package/docs/drawer.md +1 -1
  151. package/docs/dropdown.md +8 -8
  152. package/docs/fileuploader.md +4 -4
  153. package/docs/filterbuilder.md +7 -7
  154. package/docs/formlayout.md +1 -1
  155. package/docs/gallery.md +244 -0
  156. package/docs/home.md +11 -7
  157. package/docs/keyboard.md +1 -1
  158. package/docs/language.md +1 -1
  159. package/docs/layout.md +13 -13
  160. package/docs/listbox.md +8 -8
  161. package/docs/loadpanel.md +4 -4
  162. package/docs/lookup.md +1 -1
  163. package/docs/menus.md +2 -2
  164. package/docs/multiview.md +202 -0
  165. package/docs/numberbox.md +7 -7
  166. package/docs/pagination.md +4 -4
  167. package/docs/popover.md +11 -11
  168. package/docs/progress.md +7 -7
  169. package/docs/radiogroup.md +7 -7
  170. package/docs/rating.md +4 -4
  171. package/docs/resizable.md +139 -0
  172. package/docs/scheduler-agenda.md +1 -1
  173. package/docs/scheduler-big-data.md +1 -1
  174. package/docs/scheduler-editing.md +5 -5
  175. package/docs/scheduler-form.md +1 -1
  176. package/docs/scheduler-icalendar.md +1 -1
  177. package/docs/scheduler-mobile.md +1 -1
  178. package/docs/scheduler-recurrence.md +2 -2
  179. package/docs/scheduler-resources.md +1 -1
  180. package/docs/scheduler-timeline.md +1 -1
  181. package/docs/scheduler.md +4 -4
  182. package/docs/scrollview.md +5 -5
  183. package/docs/showcase.md +1 -1
  184. package/docs/skeleton.md +2 -2
  185. package/docs/slider.md +7 -7
  186. package/docs/sortable.md +2 -2
  187. package/docs/speeddial.md +290 -0
  188. package/docs/splitter.md +204 -0
  189. package/docs/stepper.md +5 -5
  190. package/docs/switch.md +7 -7
  191. package/docs/tabdocs-dock.md +3 -3
  192. package/docs/tabdocs-drag.md +1 -1
  193. package/docs/tabdocs-menus.md +1 -1
  194. package/docs/tabdocs-mobile.md +1 -1
  195. package/docs/tabdocs-tabs.md +1 -1
  196. package/docs/tabdocs-windows.md +1 -1
  197. package/docs/tabdocs-workspace.md +1 -1
  198. package/docs/tabdocs.md +5 -5
  199. package/docs/tabs.md +9 -9
  200. package/docs/tagbox.md +8 -8
  201. package/docs/textarea.md +7 -7
  202. package/docs/textbox.md +8 -8
  203. package/docs/tileview.md +206 -0
  204. package/docs/timeline.md +174 -0
  205. package/docs/toast.md +5 -5
  206. package/docs/tokens.md +333 -4
  207. package/docs/toolbar.md +6 -6
  208. package/docs/tooltip.md +12 -12
  209. package/docs/treeview.md +9 -9
  210. package/docs/validationsummary.md +115 -0
  211. package/docs/window.md +5 -5
  212. package/docs/wizard.md +9 -9
  213. package/llms-full.txt +2525 -379
  214. package/llms.txt +13 -4
  215. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -6,6 +6,81 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.1.0-beta.3] - 2026-11-06
10
+
11
+ ### New components
12
+
13
+ - `Gallery`: panes side by side, one in view or several (`itemsPerPage`), moved by the buttons over the sides, the dots
14
+ under them, a swipe, a drag with the mouse or the arrow keys (Home and End too); `loop` goes around the ends without
15
+ running back across the panes between; a slideshow with `slideInterval`, which waits under the pointer, while focus
16
+ is inside, out of sight and under reduced motion, and a button that pauses it; a pane is an image with a caption
17
+ (`image`, `alt`, `text`, `description`) or any `content`; `stretchImages`, `height`; `value` and `x-model`;
18
+ `onSlideChanging` may refuse, `onSlideChanged`, `onItemClick`. A `region` with `aria-roledescription="carousel"`,
19
+ the panes out of view hidden from readers and keys. Units in the five languages: the frame, a pane, its caption
20
+ and texts, the side buttons and their arrows, the bar, the dots, the slideshow button and its glyph.
21
+ - `MultiView` and `View`: pages side by side, one in sight, brought by a swipe or a drag, programmatically (`next()`,
22
+ `previous()`, `goTo()`, `add()`, `insert()`, `remove()`) or by a `Tabs`, a `Stepper` or buttons bound to the same
23
+ `value`; `loop`, `animated`, `lazy` and `keepAlive` as in `Tabs` (the same panel content part); hidden and disabled
24
+ views are skipped; `onSelecting` may refuse, `onSelectionChanged`.
25
+ - The slide part under both: a finger or a pointer drags the panes, a drag far or fast enough lands on the next one,
26
+ and around the ends the far pane is set next to the one leaving for the move.
27
+ - `Splitter` and `SplitPane`: panes side by side or one under the other, as many as needed, a handle between each
28
+ two that the pointer drags and the keys move (arrows by `step`, Home, End), resizing the two panes beside it; a
29
+ pane is a `Panel` with `size` (pixels, a share, or an equal share of what is left), `minSize`, `maxSize`,
30
+ `resizable`, and may be hidden from its handle (`collapsible`: a button on the handle, Enter, a double press);
31
+ `sizes` and `x-model` keep and restore a layout in pixels; panes added, inserted and removed programmatically, one may
32
+ hold another splitter; `onResizing`, `onResized`, `onCollapsing` may refuse, `onCollapsed`. The handle looks as
33
+ the `SplitContainer`’s does in every language.
34
+ - `TileView`: tiles of `widthRatio` × `heightRatio` base cells (`baseItemWidth`, `baseItemHeight`) packed densely
35
+ down the columns (the view scrolls sideways) or along the rows; a tile is a text or any `content`; `selectionMode`
36
+ none, single or multiple with `value` and `x-model` (a press, Ctrl and a press, Space, Enter); the arrow keys walk
37
+ the grid by where the tiles lie; `allowReorder` drags a tile to its new place (a long press on a touch screen) or
38
+ moves it with Ctrl and an arrow, `onReordering` may refuse, `onReordered` tells the indexes; `onItemClick`.
39
+ - Kit texts `splitterCollapse`, `splitterExpand`, `tiles` in English and Turkish.
40
+ - `Resizable`: a box resized from its sides and corners with the pointer (the window's frame and box parts), or with
41
+ the arrow keys on the grip in its end corner; `handles` (all, edges, corners or a list), `minWidth`/`minHeight`,
42
+ `maxWidth`/`maxHeight`, `area` (its parent or an element), `keepAspectRatio`, `step`; a positioned box also moves
43
+ when a start or top side is dragged; `size` and `x-model` in pixels; `onResizeStarting` may refuse, `onResizing`,
44
+ `onResized`; the new size is read out.
45
+ - `Draggable` and `DropTarget`: anything moved with the pointer, a finger (a long press) or the arrow keys, along an
46
+ `axis`, inside a `boundary`, by a `handle` only, or as a `clone` that follows the pointer while the draggable
47
+ stays; `position` and `x-model`; Escape brings it back; `onDragStarting` may refuse, `onDragging`, `onDragEnding`
48
+ may bring it back, `onDragEnded`. A target of the same `group` is marked while a drag is under way and while the
49
+ draggable is over it, may refuse in `onDragEntering`, and is told in `onDropped` with the draggable's `data`.
50
+ - Kit texts `move`, `sizeNow`, `positionNow` in English and Turkish.
51
+ - `SpeedDial`: a round button that opens its actions, each a round button with a glyph of the kit's set or an icon of
52
+ your own. `layout` lays them in a line, with a label beside each, or on a circle, a half or a quarter of one around
53
+ the button, as far out as `radius` says or as keeping them apart takes; they come out from under the button.
54
+ `position` is a corner, the middle of an edge, the centre or inline, in the viewport or in the parent
55
+ (`relativeTo`); `direction` is one of eight ways, by default into the page. `tooltip` gives the actions the kit's
56
+ `Tooltip`, on by itself while the labels are off, with options for all and a text, options or `false` per action.
57
+ `open` and `x-model`; `extended` shows the text; with one action shown the main button does it itself; a menu for
58
+ the keys (the arrows, Home, End, Enter, Escape, a press outside closes); `onOpened`, `onClosed`, `onActionClick`.
59
+ Units in the five languages: Material's FAB and small FABs, round buttons elsewhere.
60
+ - `ValidationSummary`: the failed fields of a `ValidationGroup`, one line each with the field's label and its
61
+ message under a header, a live region; a press on a line focuses the field; it follows the group's members and
62
+ each field's validity, so a check, a pass or a reset draws it again; `header`, `showHeader`, `focusOnClick`,
63
+ `onItemClick`, `failed`, `count`.
64
+ - Kit texts `actions`, `validationSummary` in English and Turkish.
65
+ - `Timeline`: events in time order (`items`: `date`, `title`, `description`, `glyph` or `icon`, `tone`, any `content`),
66
+ down the page as cards beside a line with a dot each, on either side in turn (`alternate`) or folded until pressed
67
+ (`collapsible`); or along a line of dates (`orientation`), where a press on a date, the arrow keys, Home and End
68
+ show that event's card under the line, with buttons at the ends of the track; the dates written in the kit's
69
+ language with `dateFormat` (a style or the options of `Intl.DateTimeFormat`); `value` and `x-model`; `goTo()`,
70
+ `unfold()`, `isUnfolded()`, `formatDate()`, `refresh()`; `onItemClick`, `onSelectionChanged`. A list down the
71
+ page, tabs and a tab panel along the line. Units in the five languages: the line, a dot and its glyph by tone,
72
+ a card, a flag, the texts, the detail, the track buttons.
73
+ - Kit texts `timeline`, `timelineEarlier`, `timelineLater` in English and Turkish.
74
+ - Kit texts `gallery`, `gallerySlides`, `gallerySlideOf`, `galleryPrevious`, `galleryNext`, `galleryChoose`,
75
+ `galleryPlay`, `galleryPause`, `multiView`, `multiViewPageOf` in English and Turkish; the `play` and `pause` glyphs.
76
+
77
+ ### Fixed
78
+
79
+ - `FileUploader`: the box is a drop zone, not a one-line field: as tall as the button and the hint with the same
80
+ room on every side (`zone-padding`, 8 px in Tactile and Fluent, 12 px in Lounge, Material and Lilac), where the
81
+ button used to touch the dashed frame. The label stays above the box in every language; Material's floating
82
+ label lay over the button. The dead `padding` tokens of the uploader's field place are gone.
83
+
9
84
  ## [0.1.0-beta.2] - 2026-11-05
10
85
 
11
86
  ### New components
@@ -24,13 +99,13 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
24
99
  `wizardFinish` in English and Turkish.
25
100
  - `Popover`: content next to the element it belongs to, with a title, a close button and an arrow where the
26
101
  design language draws one (Tactile, Fluent, Lilac); opened by a press on the target, by the pointer resting on it
27
- (`showOn: 'hover'`, keyboard focus too) or from code; every placement of the kit's popups, a width of its own;
102
+ (`showOn: 'hover'`, keyboard focus too) or programmatically; every placement of the kit's popups, a width of its own;
28
103
  focus goes in and comes back; Escape, a press outside, focus leaving and the close button close it, and
29
104
  `onClosing` may keep it open; `value` and `x-model`.
30
105
  - `LoadPanel`: a loading layer over a container or the whole page: a shade, a pane with the kit's spinner and a
31
106
  message, a Cancel button (`onCancel`, Escape too); what is under it is inert and `aria-busy`, focus waits on the
32
107
  panel and comes back; `delay` keeps quick work from flashing it; `value` and `x-model`, `show()` and `hide()`.
33
- - `homeOf` in the core: where a surface made from code goes for its anchor (the tooltip's rule, now shared).
108
+ - `homeOf` in the core: where a surface made programmatically goes for its anchor (the tooltip's rule, now shared).
34
109
  - `DateRangeBox`: a start and an end in one field, typed through two masks or picked on two months side by side
35
110
  (the first pick the start, the second the end, the pointer showing the range meanwhile), ready-made ranges
36
111
  (`presets`), `min`, `max`, `disabledDates`, the least and the most days a range may span (`minDays`, `maxDays`),
@@ -39,7 +114,7 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
39
114
  language) and tells the day under the pointer (`onDayPointed`).
40
115
  - `FileUploader`: files chosen with a button or dropped on the box, listed with their size and what happens to
41
116
  them; `accept`, `maxFileSize`, `minFileSize` and `maxFiles` turn files away with the reason; uploaded as they come,
42
- on an Upload button or from code, by the uploader itself (`uploadUrl`, in one piece or in chunks with
117
+ on an Upload button or programmatically, by the uploader itself (`uploadUrl`, in one piece or in chunks with
43
118
  `Content-Range`, with progress) or by your own `upload`; cancel, retry and remove on each row; a field (label,
44
119
  `required`, rules); kit glyphs `upload` and `file`.
45
120
  - Kit texts for both, in English and Turkish.
@@ -48,7 +123,7 @@ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and
48
123
  it would land, the list scrolls near its edges; sortables of one `group` take each other's items; the items
49
124
  are the JSX children, or `items` drawn with `itemTemplate` (the rows keyed by item, kept as the order
50
125
  changes); a `handle` takes the drag and the keys; `onDragStarting`, `onDragChanging` and `onDragEnding` may
51
- refuse; `onReorder`, `onRemove` and `onAdd` tell the indexes and the data stays yours; `move()` from code.
126
+ refuse; `onReorder`, `onRemove` and `onAdd` tell the indexes and the data stays yours; `move()` programmatically.
52
127
  Units in the five languages: the list, an item, the line, the copy.
53
128
  - `ScrollView`: content that scrolls in a box of its own; the bars shown on scroll, on hover, always or never;
54
129
  pull to refresh with a finger or the pointer (`onPullDown`, a promise or `release()`); more loaded near the
@@ -159,10 +234,10 @@ readers that are not a browser: a Markdown page per component in `docs/`, an ind
159
234
 
160
235
  - A property given as a function is followed by a binding of the component (`follow`, `PropBinding`): a reactive
161
236
  source updates it by itself, plain data shows on the developer's `reState()`. The value is handed on only when it
162
- differs from the last one read, so a change the user made stays across a `reState()`; a property set from code
237
+ differs from the last one read, so a change the user made stays across a `reState()`; a property set programmatically
163
238
  stops following its function. `refreshProps()` is gone (one way, not two).
164
239
  - `x-model` shows the component's state on every path: the user, code (`value`, `pressed`, `position`, a tab or a
165
- panel chosen from code), the component's own rules (a mask, `decimals`, `min`/`max`) and a cancelled close.
240
+ panel chosen programmatically), the component's own rules (a mask, `decimals`, `min`/`max`) and a cancelled close.
166
241
  - NumberBox rounds its value to `decimals` and shows that many digits; its spin buttons come back after `none`.
167
242
  Calendar shows the month of a value given from anywhere.
168
243
  - Every docs page's components converted; `onReState(component, run)` for parts drawn by hand.
@@ -183,7 +258,7 @@ readers that are not a browser: a Markdown page per component in `docs/`, an ind
183
258
  threw, and so did a scroll coming after it; a box waiting for its store shows it locked again; `selectCells` right
184
259
  after `showDate` finds the cells of the new days; a resource kind's field given as a function
185
260
  (`useColorAsDefault: () => …`) is followed again.
186
- - Docs: "From code" selects the next workday (the work week has no Saturday); the two copies of a TabDocs document
261
+ - Docs: "Programmatically" selects the next workday (the work week has no Saturday); the two copies of a TabDocs document
187
262
  read a field again when the other one changes it. Tests: the back-button session waits for its history moves
188
263
  between tests (`backButtonSettled`), a new window's `onMounted` is waited for.
189
264
 
@@ -351,7 +426,7 @@ mentioned further down.
351
426
  access key or JSX children; `icon` (an address, an element or a component) at the start or end;
352
427
  `stretch`, `type`, `hint`; `toggle` / `pressed` with `x-model`; `busy` (spinner, presses ignored,
353
428
  size kept, `aria-busy`); `focusableWhenDisabled` (`aria-disabled`, stays in the Tab order). Every
354
- prop is a value or a function and a settable, reactive property; set from code, a function is
429
+ prop is a value or a function and a settable, reactive property; set programmatically, a function is
355
430
  bound and followed too (`Control` setters as well: `ctrl.enabled = () => !state.busy`).
356
431
  - A menu: `menu` (items with icon, hint, enabled, visible, checked, beginGroup, each a value or a
357
432
  function the open menu follows; click, data) or any
@@ -510,7 +585,7 @@ mentioned further down.
510
585
  `gridSummarySeparator`, `gridTotalSummary` in en and tr.
511
586
  - Feedback: `ProgressBar`, `Spinner` (with `Spinner.cover`), `Tooltip` / `addTooltip`, `Toast` /
512
587
  `toast` / `Toaster`.
513
- - `Control` binds DOM events given from code (`new Button({ onclick })`); its private state getter is
588
+ - `Control` binds DOM events given programmatically (`new Button({ onclick })`); its private state getter is
514
589
  `controlState`, so a subclass may have a `state` field.
515
590
  - Fixed: `Stack`, `Grid` and `DockPanel` overflowed the call stack when a child was added in their
516
591
  `ref`. `TreeView` reported a check again and again when `checkedKeys` was bound both ways with
@@ -771,7 +846,7 @@ mentioned further down.
771
846
  - Methods `expandRow(key)`, `collapseRow(key)`, `isRowExpanded(key)` (reactive), `expandAllRows()`,
772
847
  `collapseAllRows()`. The row events are the groups' ones, now with `kind: 'group' | 'detail'` (and
773
848
  `row` for details): `onRowExpanding` / `onRowCollapsing` (cancellable) and `onRowExpanded` /
774
- `onRowCollapsed`, from the user and from code. `onRowPrepared` with `rowType: 'detail'`,
849
+ `onRowCollapsed`, from the user and programmatically. `onRowPrepared` with `rowType: 'detail'`,
775
850
  `getVisibleRows()` lists the details after their row. `GridRowExpandingEventArgs` and
776
851
  `GridRowExpandedEventArgs` are unions by `kind`: a handler that reads a group's `key` narrows first.
777
852
  - Keyboard and ARIA: Enter / Space and Right / Left on the expand cell, Tab into the row's details,
@@ -1363,7 +1438,7 @@ mentioned further down.
1363
1438
  no close button of its own (`data-bar-close`). `compactBarButtons` is now `'auto'` by default: an area
1364
1439
  keeps `['autoHide', 'close']`, a floating window `['closeWindow']`; a list is followed as it is in both,
1365
1440
  and an area's or a window's `barButtons` takes `'auto'` too. A floating window's close button now hides
1366
- the documents that cannot close instead of leaving the window open (`closeWindow` from code still
1441
+ the documents that cannot close instead of leaving the window open (`closeWindow` programmatically still
1367
1442
  closes them all). Hidden documents: `hide(doc)` and `show(doc, { group, side, index, active, focus })`
1368
1443
  (also `TabDocument.hide()` / `show()`, and `open(doc)` shows a hidden one) put it back into the group
1369
1444
  it was hidden from, else its dock area (made again at its size, folded if it was), else a floating
@@ -1470,7 +1545,7 @@ mentioned further down.
1470
1545
  a range over 100,000 rows × 60 virtual columns: 60 fps inside the rows, 59 fps while scrolling
1471
1546
  past the bottom edge, no cell text written while only the range changed.
1472
1547
  - Docs: a new page “Selecting by dragging” (`/datagrid/drag-select`: rows in memory with grouping,
1473
- an editable sheet of orders, 100,000 rows × 60 virtual columns set from code), the API page's
1548
+ an editable sheet of orders, 100,000 rows × 60 virtual columns set programmatically), the API page's
1474
1549
  rows and tokens; `e2e/checks/52-datagrid-drag-select.mjs`.
1475
1550
  - Touch on real phones (found on an Android phone, Chrome 155): a long press drag of a tab and the DataGrid's
1476
1551
  long press selection did nothing, because the browser decides when the finger lands whether the page may
package/README.md CHANGED
@@ -35,21 +35,21 @@ this one after it.
35
35
 
36
36
  ## What is here
37
37
 
38
- Every component works from JSX (bound to state) and from code (`new X({...})`, added anywhere,
38
+ Every component works from JSX (bound to state) and programmatically (`new X({...})`, added anywhere,
39
39
  changed later); every prop and property takes a value or a function. The docs site has a page for
40
40
  each (`npm run dev`).
41
41
 
42
42
  | Group | Components |
43
43
  | --- | --- |
44
- | Buttons and commands | `Button` (menu, split, drop-down, toggle, busy), `ButtonGroup` (segmented choice), `Toolbar` (overflow menu), `MenuBar`, `ContextMenu` |
45
- | Display | `Badge`, `Avatar`, `AvatarGroup`, `Chip`, `ChipGroup`, `Card`, `Skeleton` |
46
- | Navigation | `Tabs`, `Accordion`, `Breadcrumb`, `Pagination`, `Stepper`, `Wizard`, `TabDocumentManager` |
44
+ | Buttons and commands | `Button` (menu, split, drop-down, toggle, busy), `ButtonGroup` (segmented choice), `Toolbar` (overflow menu), `MenuBar`, `ContextMenu`, `SpeedDial` (actions in a line or around a button, on a circle, a half or a quarter of one) |
45
+ | Display | `Badge`, `Avatar`, `AvatarGroup`, `Chip`, `ChipGroup`, `Card`, `Skeleton`, `Gallery` (slides, dots, slideshow), `TileView` (tiles on a grid, chosen, reordered), `Timeline` (events down the page or along a line of dates) |
46
+ | Navigation | `Tabs`, `Accordion`, `Breadcrumb`, `Pagination`, `Stepper`, `Wizard`, `MultiView` (pages by swipe), `TabDocumentManager` |
47
47
  | More editors | `Rating`, `ColorBox`, `ColorPicker` |
48
48
  | Scheduling | `Scheduler` (day, week, month, timeline, agenda; recurrence, resources, iCalendar) |
49
- | Editors | `TextBox` (mask, validation), `TextArea` (auto-grow), `NumberBox` (locale formats, spin), `DateBox` (date, time, both), `DateRangeBox` (two months, presets, a span), `Calendar`, `Slider` (range), `FileUploader` (drop, limits, chunks, progress) |
49
+ | Editors | `TextBox` (mask, validation), `TextArea` (auto-grow), `NumberBox` (locale formats, spin), `DateBox` (date, time, both), `DateRangeBox` (two months, presets, a span), `Calendar`, `Slider` (range), `FileUploader` (drop, limits, chunks, progress), `ValidationSummary` (the failed fields of a group, each a press away) |
50
50
  | Choice | `CheckBox` (three states), `Switch`, `RadioGroup`, `DropDown`, `ComboBox`, `Autocomplete`, `Lookup` (columns), `TagBox`, `ListBox` |
51
51
  | Data | `DataGrid` (virtual or paged, editing with three save modes, row actions, selection, filters, search panel, grouping with a group panel, toolbar, lookup columns, copy and paste, CSV and Excel export, kept layout), `TreeView` (lazy, check boxes, filter); lists and grids read `@motifx-community/data` sources |
52
- | Layout and windows | `Stack`, `Grid`, `DockPanel`, `Panel`, `GroupBox`, `SplitContainer`, `ScrollView` (pull to refresh, load more), `Sortable` (drag or keys, lists of a group), `FormLayout`, `Tabs`, `Accordion`, `MxForm` (window and modal form), `messageBox`, `confirm` |
52
+ | Layout and windows | `Stack`, `Grid`, `DockPanel`, `Panel`, `GroupBox`, `SplitContainer`, `Splitter` (any number of panes, hidden from the handle), `ScrollView` (pull to refresh, load more), `Sortable` (drag or keys, lists of a group), `Resizable` (sides, corners, the keys on a grip), `Draggable` and `DropTarget` (anything moved, along an axis or inside a boundary, copies into targets), `FormLayout`, `Tabs`, `Accordion`, `MxForm` (window and modal form), `messageBox`, `confirm` |
53
53
  | Feedback | `ProgressBar`, `Spinner` (cover a panel), `LoadPanel`, `Tooltip`, `Popover`, `Toast` |
54
54
  | Shared parts | `Field` (base of every editor), `InputMask`, `ValidationGroup`, `validateFields`, `checkRules`, `OptionList`, `DataItems`, `Popup`, `MenuList`, date helpers (`datePatternOf`) |
55
55
  | Base | `Control`, `FocusContainer`, `addShortcut`, `parseAccessKey`, `uiLocale` (English, Turkish) |
@@ -9,7 +9,7 @@ import type { AccordionProps } from './accordion-props';
9
9
  import type { AccordionVariant } from './accordion-variant';
10
10
  /**
11
11
  * Sections that open and close under their headers, following the ARIA accordion pattern.
12
- * Items come as `<AccordionItem>` children or from code (`add`, `insert`, `remove`). One item is
12
+ * Items come as `<AccordionItem>` children or programmatically (`add`, `insert`, `remove`). One item is
13
13
  * open at a time unless `multiple`; `value` (two-way with `x-model`) lists the open items'
14
14
  * keys. Up and Down move between the headers, an item's `&` key opens or closes it, and a
15
15
  * section is built when it is first opened (`lazy`).
@@ -66,9 +66,9 @@ export declare class Accordion extends Control<HTMLDivElement, AccordionProps> {
66
66
  insert(index: number, item: AccordionItem): AccordionItem;
67
67
  /** Removes an item and disposes it. */
68
68
  remove(item: AccordionItem): boolean;
69
- /** Opens every item (with `multiple`), from code. */
69
+ /** Opens every item (with `multiple`), programmatically. */
70
70
  expandAll(): void;
71
- /** Closes every item, from code (with `collapsible` off, the first stays open). */
71
+ /** Closes every item, programmatically (with `collapsible` off, the first stays open). */
72
72
  collapseAll(): void;
73
73
  onDisposing(): void;
74
74
  protected applyProperty(name: string, value: unknown): void;
@@ -20,7 +20,7 @@ export declare class AccordionItem extends Control<HTMLDivElement, AccordionItem
20
20
  /** The `key` prop (also when written as the JSX `key`), `''` without one. */
21
21
  get key(): string;
22
22
  set key(value: Bind<string>);
23
- /** Whether the section is open. Setting it from code fires no cancelable event. Reactive. */
23
+ /** Whether the section is open. Setting it programmatically fires no cancelable event. Reactive. */
24
24
  get expanded(): boolean;
25
25
  set expanded(value: Bind<boolean>);
26
26
  get icon(): IconSource | null;
@@ -73,7 +73,7 @@ export declare class Card extends Control<HTMLDivElement, CardProps> {
73
73
  set selected(value: Bind<boolean>);
74
74
  /** It was selected or not any more, by the user or by code (`e.byUser`). */
75
75
  get onSelectedChanged(): MotifEvent<CardSelectedChangedEventArgs>;
76
- /** The part holding the content, for adding to it from code. */
76
+ /** The part holding the content, for adding to it programmatically. */
77
77
  get contentPart(): Component<HTMLDivElement>;
78
78
  /** The avatar before the titles, when it has one. */
79
79
  get avatarControl(): Avatar | null;
@@ -50,7 +50,7 @@ export declare class ContextMenu extends Control<HTMLDivElement, ContextMenuProp
50
50
  get onItemClick(): MotifEvent<MenuItemClickEventArgs>;
51
51
  get onClosed(): MotifEvent<PopupCloseReason>;
52
52
  /**
53
- * Opens the menu from code: at a point of the viewport, or at an element (its start corner,
53
+ * Opens the menu programmatically: at a point of the viewport, or at an element (its start corner,
54
54
  * below it). `target` is what `onOpening` and `targetElement` report; the target element by
55
55
  * default. Returns whether it opened.
56
56
  */
@@ -493,7 +493,7 @@ export declare class DataGrid<T = any> extends Control<HTMLDivElement, DataGridP
493
493
  * `'cell'` mode it is saved). In the edit form, keeps every field's value. `false` when a value cannot be read.
494
494
  */
495
495
  closeEditCell(): boolean;
496
- /** Starts changes made from code together: the rows are laid out once, at the last `endUpdate()`. */
496
+ /** Starts changes made programmatically together: the rows are laid out once, at the last `endUpdate()`. */
497
497
  beginUpdate(): void;
498
498
  endUpdate(): void;
499
499
  /**
@@ -575,14 +575,14 @@ export declare class DataGrid<T = any> extends Control<HTMLDivElement, DataGridP
575
575
  /** The actions the toolbar and the bottom bar show now, for those rows. Reactive. */
576
576
  get barActions(): GridBarAction<T>[];
577
577
  /**
578
- * Runs an action from code, as a press does: on `rows`, or on the rows the bars act on now. Rows
578
+ * Runs an action programmatically, as a press does: on `rows`, or on the rows the bars act on now. Rows
579
579
  * share an action by its `id`; it runs only where it is visible and enabled for them. Resolves to
580
580
  * the outcome, or `null` when the action is not there or `onActionRunning` cancelled it.
581
581
  */
582
582
  runAction(id: string, rows?: readonly T[]): Promise<GridActionRanEventArgs<T> | null>;
583
583
  /** Stops the action working on several rows (the rows not started are left). */
584
584
  stopAction(): void;
585
- /** Raised before an action runs (in a row, a bar, a row's menu or from code): `e.cancel` keeps it from running. */
585
+ /** Raised before an action runs (in a row, a bar, a row's menu or programmatically): `e.cancel` keeps it from running. */
586
586
  get onActionRunning(): MotifEvent<GridActionRunningEventArgs<T>>;
587
587
  /** Raised when an action ran: on how many rows it worked or failed, and whether it was stopped. */
588
588
  get onActionRan(): MotifEvent<GridActionRanEventArgs<T>>;
@@ -683,7 +683,7 @@ export declare class DataGrid<T = any> extends Control<HTMLDivElement, DataGridP
683
683
  set searchText(text: Bind<string>);
684
684
  /** Searches for a text at once, as the search panel does after a typing pause; `''` stops searching. */
685
685
  searchByText(text: string): void;
686
- /** Raised when the search text changes: typed in the search box, or set from code. */
686
+ /** Raised when the search text changes: typed in the search box, or set programmatically. */
687
687
  get onSearchTextChanged(): MotifEvent<GridSearchTextChangedEventArgs>;
688
688
  /** Raised before the search text changes: `e.cancel` keeps the one before. */
689
689
  get onSearchTextChanging(): MotifEvent<GridSearchTextChangingEventArgs>;
@@ -703,7 +703,7 @@ export declare class DataGrid<T = any> extends Control<HTMLDivElement, DataGridP
703
703
  ungroup(field: string): void;
704
704
  /** Sets the order of a grouped column's groups. */
705
705
  setGroupOrder(field: string, dir: 'asc' | 'desc'): void;
706
- /** Raised before the grouping changes, by the user or from code: `e.cancel` keeps it. */
706
+ /** Raised before the grouping changes, by the user or programmatically: `e.cancel` keeps it. */
707
707
  get onGroupingChanging(): MotifEvent<GridGroupingChangingEventArgs>;
708
708
  /** Raised after the grouping changed. */
709
709
  get onGroupingChanged(): MotifEvent<GridGroupingChangedEventArgs>;
@@ -181,7 +181,7 @@ export interface DataGridProps<T> extends ControlProps {
181
181
  * `'save'`, `'cancel'`).
182
182
  */
183
183
  actions?: readonly GridActionItem<T>[] | ((row: T, state: RowState) => readonly GridActionItem<T>[]);
184
- /** An action is about to run (in a row, a bar, a row's menu or from code): `e.cancel` keeps it from running. */
184
+ /** An action is about to run (in a row, a bar, a row's menu or programmatically): `e.cancel` keeps it from running. */
185
185
  onActionRunning?: (e: GridActionRunningEventArgs<T>) => void;
186
186
  /** An action ran: on how many rows it worked or failed, and whether it was stopped. */
187
187
  onActionRan?: (e: GridActionRanEventArgs<T>) => void;
@@ -208,7 +208,7 @@ export interface DataGridProps<T> extends ControlProps {
208
208
  searchText?: Bind<string>;
209
209
  /** The search text is about to change; `e.cancel` keeps the one before. */
210
210
  onSearchTextChanging?: (e: GridSearchTextChangingEventArgs) => void;
211
- /** The search text changed (typed, or set from code). */
211
+ /** The search text changed (typed, or set programmatically). */
212
212
  onSearchTextChanged?: (e: GridSearchTextChangedEventArgs) => void;
213
213
  /**
214
214
  * Values of the rows under the filter and the search: a row of totals under the rows
@@ -1,4 +1,4 @@
1
- /** A row's adaptive detail opened or closed, by the user or from code. */
1
+ /** A row's adaptive detail opened or closed, by the user or programmatically. */
2
2
  export interface GridAdaptiveRowExpandedEventArgs<T> {
3
3
  readonly row: T;
4
4
  /** The row's key; `undefined` for a new row. */
@@ -1,5 +1,5 @@
1
1
  import type { EventArgs } from '@motifx/core';
2
- /** A row's adaptive detail is about to open or close, by the user or from code; `cancel` keeps it as it is. */
2
+ /** A row's adaptive detail is about to open or close, by the user or programmatically; `cancel` keeps it as it is. */
3
3
  export interface GridAdaptiveRowExpandingEventArgs<T> extends EventArgs {
4
4
  readonly row: T;
5
5
  /** The row's key; `undefined` for a new row. */
@@ -1,5 +1,5 @@
1
1
  import type { data } from '@motifx-community/data';
2
- /** The grouping changed (by the user or from code). */
2
+ /** The grouping changed (by the user or programmatically). */
3
3
  export interface GridGroupingChangedEventArgs {
4
4
  readonly group: readonly data.GroupItem[];
5
5
  readonly previous: readonly data.GroupItem[];
@@ -1,10 +1,10 @@
1
1
  import type { EventArgs } from '@motifx/core';
2
2
  import type { data } from '@motifx-community/data';
3
- /** The grouping is about to change (by the user or from code); `cancel` keeps it as it is. */
3
+ /** The grouping is about to change (by the user or programmatically); `cancel` keeps it as it is. */
4
4
  export interface GridGroupingChangingEventArgs extends EventArgs {
5
5
  /** The grouped columns it changes to, in order. */
6
6
  readonly group: readonly data.GroupItem[];
7
7
  readonly previous: readonly data.GroupItem[];
8
- /** The user changed it (the group panel, the column menu, a header, a chip); `false` from code. */
8
+ /** The user changed it (the group panel, the column menu, a header, a chip); `false` programmatically. */
9
9
  readonly byUser: boolean;
10
10
  }
@@ -7,7 +7,7 @@ import type { DetailContext } from './detail-context';
7
7
  * through `grid.masterDetail`.
8
8
  */
9
9
  export interface GridMasterDetail<T> {
10
- /** The expand column: the user opens and closes the details. Off, they open from code only (`expandRow`). Default `false`. */
10
+ /** The expand column: the user opens and closes the details. Off, they open programmatically only (`expandRow`). Default `false`. */
11
11
  enabled?: Bind<boolean>;
12
12
  /** Every row starts open. Changing it, `enabled` or `template` opens or closes them all again. Default `false`. */
13
13
  autoExpandAll?: Bind<boolean>;
@@ -1,4 +1,4 @@
1
- /** A group, or a row's details (`masterDetail`), opened or closed, by the user or from code. See `GridRowExpandingEventArgs`. */
1
+ /** A group, or a row's details (`masterDetail`), opened or closed, by the user or programmatically. See `GridRowExpandingEventArgs`. */
2
2
  export type GridRowExpandedEventArgs = {
3
3
  readonly kind: 'group';
4
4
  readonly key: readonly unknown[];
@@ -1,6 +1,6 @@
1
1
  import type { EventArgs } from '@motifx/core';
2
2
  /**
3
- * A group, or a row's details (`masterDetail`), is about to open or close, by the user or from code;
3
+ * A group, or a row's details (`masterDetail`), is about to open or close, by the user or programmatically;
4
4
  * `cancel` keeps it as it is. `kind` tells which: a group's `key` is the values of the groups from the
5
5
  * top level down to it, a row's is the row's key.
6
6
  */
@@ -1,4 +1,4 @@
1
- /** The search text changed: typed in the search box, or set from code. */
1
+ /** The search text changed: typed in the search box, or set programmatically. */
2
2
  export interface GridSearchTextChangedEventArgs {
3
3
  text: string;
4
4
  }
@@ -1,5 +1,5 @@
1
1
  import type { EventArgs } from '@motifx/core';
2
- /** The search text is about to change (typed, or set from code); `cancel` keeps the one before. */
2
+ /** The search text is about to change (typed, or set programmatically); `cancel` keeps the one before. */
3
3
  export interface GridSearchTextChangingEventArgs extends EventArgs {
4
4
  readonly text: string;
5
5
  readonly previous: string;
@@ -4,6 +4,6 @@ import type { data } from '@motifx-community/data';
4
4
  export interface GridSortChangingEventArgs extends EventArgs {
5
5
  readonly sort: readonly data.SortItem[];
6
6
  readonly previous: readonly data.SortItem[];
7
- /** The user changed it; `false` from code. */
7
+ /** The user changed it; `false` programmatically. */
8
8
  readonly byUser: boolean;
9
9
  }
@@ -24,7 +24,7 @@ export declare class GridSearch<T> {
24
24
  private marks;
25
25
  private loaded;
26
26
  private disposed;
27
- /** Called when the text changes (typed or set from code). */
27
+ /** Called when the text changes (typed or set programmatically). */
28
28
  onTextChanged: ((text: string) => void) | null;
29
29
  constructor(model: GridModel<T>);
30
30
  /** Changes the text; a typed one waits `searchDelay` before it searches. */
@@ -0,0 +1,99 @@
1
+ import { Component, Emitter, type Bind, type Event as MotifEvent, type IBaseProp } from "@motifx/core";
2
+ import { Control } from "../../core/control";
3
+ import { DragGhost } from "../../parts/drag/DragGhost";
4
+ import type { DraggableEventArgs } from "./draggable-event-args";
5
+ import type { DragAxis, DraggableProps, DragPosition } from "./draggable-props";
6
+ import { DropTarget } from "./DropTarget";
7
+ interface Session {
8
+ pointerId: number;
9
+ touch: boolean;
10
+ startX: number;
11
+ startY: number;
12
+ x: number;
13
+ y: number;
14
+ from: DragPosition;
15
+ started: boolean;
16
+ target: DropTarget | null;
17
+ refused: boolean;
18
+ timer: ReturnType<typeof setTimeout> | null;
19
+ rect: DOMRect | null;
20
+ bound: DOMRect | null;
21
+ }
22
+ /**
23
+ * Anything the user moves with the pointer, a finger (a long press) or the arrow keys: the JSX children in a box
24
+ * that follows the drag. It moves along `axis`, stays inside `boundary`, is taken by a `handle` only, or sends a
25
+ * `clone` after the pointer and stays where it is. A `DropTarget` of the same `group` under the pointer is told
26
+ * when it comes over, leaves and drops, with its `data`; what a drop does to your data is yours.
27
+ *
28
+ * @example
29
+ * <Draggable boundary="parent" x-model={() => this.note.at}><Card>…</Card></Draggable>
30
+ * <Draggable clone group="cards" data={card} handle=".grip">…</Draggable>
31
+ */
32
+ export declare class Draggable extends Control<HTMLDivElement, DraggableProps> {
33
+ starting: Emitter<DraggableEventArgs>;
34
+ dragging: Emitter<DraggableEventArgs>;
35
+ ending: Emitter<DraggableEventArgs>;
36
+ ended: Emitter<DraggableEventArgs>;
37
+ live: Component<HTMLSpanElement>;
38
+ ghost: DragGhost;
39
+ session: Session | null;
40
+ stops: (() => void)[];
41
+ pos: DragPosition;
42
+ handleEl: HTMLElement | null;
43
+ constructor(props?: IBaseProp<DraggableProps>);
44
+ get axis(): DragAxis;
45
+ set axis(value: Bind<DragAxis>);
46
+ get boundary(): 'parent' | HTMLElement | null;
47
+ set boundary(value: Bind<'parent' | HTMLElement | null>);
48
+ get handle(): string | null;
49
+ set handle(value: Bind<string | null>);
50
+ get clone(): boolean;
51
+ set clone(value: Bind<boolean>);
52
+ get group(): string | null;
53
+ set group(value: Bind<string | null>);
54
+ get data(): unknown;
55
+ set data(value: unknown);
56
+ get step(): number;
57
+ set step(value: Bind<number>);
58
+ get position(): DragPosition | null;
59
+ set position(value: Bind<DragPosition | null>);
60
+ /** `position`, for `x-model`. */
61
+ get value(): DragPosition | null;
62
+ set value(value: DragPosition | null);
63
+ /** A drag is about to begin; `cancel` keeps the draggable in place. */
64
+ get onDragStarting(): MotifEvent<DraggableEventArgs>;
65
+ /** It is being dragged (`x`, `y`, `target`). */
66
+ get onDragging(): MotifEvent<DraggableEventArgs>;
67
+ /** The pointer let go; `cancel` brings the draggable back where it started. */
68
+ get onDragEnding(): MotifEvent<DraggableEventArgs>;
69
+ /** The drag ended (`x`, `y`, `target`, `dropped`). */
70
+ get onDragEnded(): MotifEvent<DraggableEventArgs>;
71
+ /** Where it stands now, in pixels from where it was laid out. */
72
+ get currentPosition(): DragPosition;
73
+ /** Whether it is being dragged. */
74
+ get isDragging(): boolean;
75
+ /** The element that takes the press and the keys: the handle, else the draggable itself. */
76
+ get handleElement(): HTMLElement;
77
+ onBuilt(): void;
78
+ applyPosition(): void;
79
+ drawHandle(): void;
80
+ args(target: DropTarget | null, event?: Event): DraggableEventArgs;
81
+ dropArgs(target: DropTarget, event?: Event): {
82
+ draggable: Draggable;
83
+ data: unknown;
84
+ cancel: boolean;
85
+ source: DropTarget;
86
+ event?: Event;
87
+ };
88
+ boundRect(): DOMRect | null;
89
+ within(dx: number, dy: number, rect: DOMRect | null, bound: DOMRect | null): DragPosition;
90
+ pointerDown(e: PointerEvent): void;
91
+ pointerMove(e: PointerEvent): void;
92
+ pointerUp(e: PointerEvent): void;
93
+ start(e: PointerEvent): boolean;
94
+ track(e: PointerEvent): void;
95
+ end(e: Event | null, drop: boolean): void;
96
+ keyDown(e: KeyboardEvent): void;
97
+ announce(): void;
98
+ }
99
+ export {};
@@ -0,0 +1,38 @@
1
+ import { Emitter, type Bind, type Event as MotifEvent, type IBaseProp } from "@motifx/core";
2
+ import { Control } from "../../core/control";
3
+ import type { DropEventArgs } from "./drop-event-args";
4
+ import type { DropTargetProps } from "./drop-target-props";
5
+ /** Every drop target on the page, for the draggables to find the one under the pointer. */
6
+ export declare const TARGETS: Set<DropTarget>;
7
+ /**
8
+ * A place a `Draggable` of its group can be dropped on: marked while a drag of the group is under way and while
9
+ * the draggable is over it; `onDragEntering` may refuse it, `onDropped` tells what was dropped, with its `data`. The JSX
10
+ * children are its content; what a drop does to your data is yours.
11
+ *
12
+ * @example
13
+ * <DropTarget group="cards" onDropped={e => this.board.move(e.data as Card, 'done')}>…</DropTarget>
14
+ */
15
+ export declare class DropTarget extends Control<HTMLDivElement, DropTargetProps> {
16
+ entered: Emitter<DropEventArgs>;
17
+ left: Emitter<DropEventArgs>;
18
+ dropped: Emitter<DropEventArgs>;
19
+ constructor(props?: IBaseProp<DropTargetProps>);
20
+ get group(): string | null;
21
+ set group(value: Bind<string | null>);
22
+ /** A draggable came over it (`draggable`, `data`); `cancel` refuses it. */
23
+ get onDragEntering(): MotifEvent<DropEventArgs>;
24
+ /** A draggable left it. */
25
+ get onDragLeaving(): MotifEvent<DropEventArgs>;
26
+ /** A draggable was dropped on it. */
27
+ get onDropped(): MotifEvent<DropEventArgs>;
28
+ /** Whether it takes the draggables of `group`. */
29
+ takes(group: string | null): boolean;
30
+ /** @internal A drag of its group began or ended. */
31
+ markActive(on: boolean): void;
32
+ /** @internal The draggable came over it; `false` when it is refused. */
33
+ enter(args: DropEventArgs): boolean;
34
+ /** @internal The draggable left it. */
35
+ leave(args: DropEventArgs): void;
36
+ /** @internal The draggable was dropped on it. */
37
+ drop(args: DropEventArgs): void;
38
+ }
@@ -0,0 +1,17 @@
1
+ import type { EventArgs } from '@motifx/core';
2
+ import type { Draggable } from './Draggable';
3
+ import type { DropTarget } from './DropTarget';
4
+ /** A drag begins (`cancel = true` keeps it in place), goes on, is about to end (`cancel` brings it back), or ended. */
5
+ export interface DraggableEventArgs extends EventArgs {
6
+ /** Where the draggable stands, in pixels from where it was laid out. */
7
+ x: number;
8
+ y: number;
9
+ /** The drop target under the pointer that takes it, `null` for none. */
10
+ target: DropTarget | null;
11
+ /** By the pointer or a key, else from the props. */
12
+ byUser: boolean;
13
+ /** At the end: a target took it. */
14
+ dropped?: boolean;
15
+ source: Draggable;
16
+ event?: Event;
17
+ }