@soxa-ui/plugins 0.0.0-stage → 0.3.0-beta.1

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 (630) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +125 -2
  3. package/dist/base/base.class.d.ts +54 -0
  4. package/dist/base/base.class.js +69 -0
  5. package/dist/base/bundle.class.d.ts +25 -0
  6. package/dist/base/bundle.class.js +68 -0
  7. package/dist/base/index.d.ts +3 -0
  8. package/dist/base/types.d.ts +147 -0
  9. package/dist/custom/accordion/header.d.ts +19 -0
  10. package/dist/custom/accordion/header.js +38 -0
  11. package/dist/custom/accordion/index.d.ts +2 -0
  12. package/dist/custom/accordion/item-ids/index.d.ts +1 -0
  13. package/dist/custom/accordion/item-ids/item-ids.plugin.d.ts +24 -0
  14. package/dist/custom/accordion/item-ids/item-ids.plugin.js +44 -0
  15. package/dist/custom/action/action.plugin.d.ts +178 -0
  16. package/dist/custom/action/action.plugin.js +339 -0
  17. package/dist/custom/action/index.d.ts +2 -0
  18. package/dist/custom/action/types.d.ts +65 -0
  19. package/dist/custom/calendar/ids/ids.plugin.d.ts +25 -0
  20. package/dist/custom/calendar/ids/ids.plugin.js +44 -0
  21. package/dist/custom/calendar/ids/index.d.ts +1 -0
  22. package/dist/custom/calendar/index.d.ts +5 -0
  23. package/dist/custom/calendar/keyboard/index.d.ts +2 -0
  24. package/dist/custom/calendar/keyboard/keyboard.plugin.d.ts +114 -0
  25. package/dist/custom/calendar/keyboard/keyboard.plugin.js +249 -0
  26. package/dist/custom/calendar/keyboard/types.d.ts +16 -0
  27. package/dist/custom/calendar/names/index.d.ts +1 -0
  28. package/dist/custom/calendar/names/names.plugin.d.ts +24 -0
  29. package/dist/custom/calendar/names/names.plugin.js +45 -0
  30. package/dist/custom/calendar/parts.d.ts +58 -0
  31. package/dist/custom/calendar/parts.js +119 -0
  32. package/dist/custom/calendar/pointer/index.d.ts +2 -0
  33. package/dist/custom/calendar/pointer/pointer.plugin.d.ts +58 -0
  34. package/dist/custom/calendar/pointer/pointer.plugin.js +144 -0
  35. package/dist/custom/calendar/pointer/types.d.ts +6 -0
  36. package/dist/custom/calendar/stop.d.ts +20 -0
  37. package/dist/custom/calendar/stop.js +32 -0
  38. package/dist/custom/calendar/types.d.ts +16 -0
  39. package/dist/custom/clearable/index.d.ts +1 -0
  40. package/dist/custom/clearable/names/index.d.ts +1 -0
  41. package/dist/custom/clearable/names/names.plugin.d.ts +24 -0
  42. package/dist/custom/clearable/names/names.plugin.js +29 -0
  43. package/dist/custom/collection/bundles.plugin.d.ts +55 -0
  44. package/dist/custom/collection/bundles.plugin.js +100 -0
  45. package/dist/custom/collection/collection-bundles-access.plugin.d.ts +29 -0
  46. package/dist/custom/collection/collection-bundles-access.plugin.js +44 -0
  47. package/dist/custom/collection/collection-elements.plugin.d.ts +55 -0
  48. package/dist/custom/collection/collection-elements.plugin.js +100 -0
  49. package/dist/custom/collection/index.d.ts +4 -0
  50. package/dist/custom/collection/leaving-focus.d.ts +119 -0
  51. package/dist/custom/collection/leaving-focus.js +164 -0
  52. package/dist/custom/collection/reachable.d.ts +14 -0
  53. package/dist/custom/collection/reachable.js +18 -0
  54. package/dist/custom/collection/types.d.ts +14 -0
  55. package/dist/custom/component-view/aria.plugin.d.ts +102 -0
  56. package/dist/custom/component-view/aria.plugin.js +190 -0
  57. package/dist/custom/component-view/index.d.ts +2 -0
  58. package/dist/custom/component-view/types.d.ts +62 -0
  59. package/dist/custom/date-input/clipboard/clipboard.plugin.d.ts +41 -0
  60. package/dist/custom/date-input/clipboard/clipboard.plugin.js +98 -0
  61. package/dist/custom/date-input/clipboard/index.d.ts +2 -0
  62. package/dist/custom/date-input/clipboard/types.d.ts +6 -0
  63. package/dist/custom/date-input/ids/ids.plugin.d.ts +21 -0
  64. package/dist/custom/date-input/ids/ids.plugin.js +28 -0
  65. package/dist/custom/date-input/ids/index.d.ts +1 -0
  66. package/dist/custom/date-input/index.d.ts +6 -0
  67. package/dist/custom/date-input/keyboard/index.d.ts +2 -0
  68. package/dist/custom/date-input/keyboard/keyboard.plugin.d.ts +54 -0
  69. package/dist/custom/date-input/keyboard/keyboard.plugin.js +154 -0
  70. package/dist/custom/date-input/keyboard/types.d.ts +9 -0
  71. package/dist/custom/date-input/parts.d.ts +49 -0
  72. package/dist/custom/date-input/parts.js +127 -0
  73. package/dist/custom/date-input/pointer/index.d.ts +2 -0
  74. package/dist/custom/date-input/pointer/pointer.plugin.d.ts +51 -0
  75. package/dist/custom/date-input/pointer/pointer.plugin.js +141 -0
  76. package/dist/custom/date-input/pointer/types.d.ts +6 -0
  77. package/dist/custom/date-input/touch/index.d.ts +2 -0
  78. package/dist/custom/date-input/touch/touch.plugin.d.ts +100 -0
  79. package/dist/custom/date-input/touch/touch.plugin.js +276 -0
  80. package/dist/custom/date-input/touch/types.d.ts +6 -0
  81. package/dist/custom/date-input/types.d.ts +6 -0
  82. package/dist/custom/date-picker/field.d.ts +20 -0
  83. package/dist/custom/date-picker/field.js +27 -0
  84. package/dist/custom/date-picker/focus/focus.plugin.d.ts +56 -0
  85. package/dist/custom/date-picker/focus/focus.plugin.js +81 -0
  86. package/dist/custom/date-picker/focus/index.d.ts +2 -0
  87. package/dist/custom/date-picker/focus/types.d.ts +3 -0
  88. package/dist/custom/date-picker/ids/ids.plugin.d.ts +19 -0
  89. package/dist/custom/date-picker/ids/ids.plugin.js +28 -0
  90. package/dist/custom/date-picker/ids/index.d.ts +1 -0
  91. package/dist/custom/date-picker/index.d.ts +5 -0
  92. package/dist/custom/date-picker/names/index.d.ts +2 -0
  93. package/dist/custom/date-picker/names/names.plugin.d.ts +33 -0
  94. package/dist/custom/date-picker/names/names.plugin.js +80 -0
  95. package/dist/custom/date-picker/names/types.d.ts +12 -0
  96. package/dist/custom/date-picker/trigger/index.d.ts +2 -0
  97. package/dist/custom/date-picker/trigger/trigger.plugin.d.ts +37 -0
  98. package/dist/custom/date-picker/trigger/trigger.plugin.js +69 -0
  99. package/dist/custom/date-picker/trigger/types.d.ts +3 -0
  100. package/dist/custom/dialog/ids/ids.plugin.d.ts +15 -0
  101. package/dist/custom/dialog/ids/ids.plugin.js +28 -0
  102. package/dist/custom/dialog/ids/index.d.ts +1 -0
  103. package/dist/custom/dialog/index.d.ts +3 -0
  104. package/dist/custom/dialog/layout/index.d.ts +3 -0
  105. package/dist/custom/dialog/layout/layout.plugin.d.ts +42 -0
  106. package/dist/custom/dialog/layout/layout.plugin.js +78 -0
  107. package/dist/custom/dialog/layout/offset-event.d.ts +35 -0
  108. package/dist/custom/dialog/layout/offset-event.js +44 -0
  109. package/dist/custom/dialog/layout/types.d.ts +12 -0
  110. package/dist/custom/dialog/names/index.d.ts +1 -0
  111. package/dist/custom/dialog/names/names.plugin.d.ts +13 -0
  112. package/dist/custom/dialog/names/names.plugin.js +17 -0
  113. package/dist/custom/dismiss/dismiss.plugin.d.ts +174 -0
  114. package/dist/custom/dismiss/dismiss.plugin.js +287 -0
  115. package/dist/custom/dismiss/index.d.ts +2 -0
  116. package/dist/custom/dismiss/types.d.ts +59 -0
  117. package/dist/custom/drag-and-drop/drag.plugin.d.ts +87 -0
  118. package/dist/custom/drag-and-drop/drag.plugin.js +310 -0
  119. package/dist/custom/drag-and-drop/index.d.ts +2 -0
  120. package/dist/custom/drag-and-drop/types.d.ts +13 -0
  121. package/dist/custom/drawer/index.d.ts +1 -0
  122. package/dist/custom/drawer/layout/index.d.ts +2 -0
  123. package/dist/custom/drawer/layout/layout.plugin.d.ts +17 -0
  124. package/dist/custom/drawer/layout/layout.plugin.js +22 -0
  125. package/dist/custom/drawer/layout/types.d.ts +3 -0
  126. package/dist/custom/element/element.plugin.d.ts +35 -0
  127. package/dist/custom/element/element.plugin.js +58 -0
  128. package/dist/custom/element/index.d.ts +2 -0
  129. package/dist/custom/element/types.d.ts +18 -0
  130. package/dist/custom/field/ids/ids.plugin.d.ts +64 -0
  131. package/dist/custom/field/ids/ids.plugin.js +126 -0
  132. package/dist/custom/field/ids/index.d.ts +2 -0
  133. package/dist/custom/field/ids/types.d.ts +28 -0
  134. package/dist/custom/field/index.d.ts +1 -0
  135. package/dist/custom/frame/anchor/anchor.plugin.d.ts +483 -0
  136. package/dist/custom/frame/anchor/anchor.plugin.js +820 -0
  137. package/dist/custom/frame/anchor/index.d.ts +2 -0
  138. package/dist/custom/frame/anchor/types.d.ts +83 -0
  139. package/dist/custom/frame/index.d.ts +2 -0
  140. package/dist/custom/frame/layout/index.d.ts +2 -0
  141. package/dist/custom/frame/layout/layout.plugin.d.ts +24 -0
  142. package/dist/custom/frame/layout/layout.plugin.js +65 -0
  143. package/dist/custom/frame/layout/types.d.ts +5 -0
  144. package/dist/custom/icon/index.d.ts +2 -0
  145. package/dist/custom/icon/layout.plugin.d.ts +21 -0
  146. package/dist/custom/icon/layout.plugin.js +51 -0
  147. package/dist/custom/icon/types.d.ts +5 -0
  148. package/dist/custom/id/id.plugin.d.ts +32 -0
  149. package/dist/custom/id/id.plugin.js +42 -0
  150. package/dist/custom/id/index.d.ts +2 -0
  151. package/dist/custom/id/types.d.ts +6 -0
  152. package/dist/custom/index.d.ts +42 -0
  153. package/dist/custom/input/field.d.ts +16 -0
  154. package/dist/custom/input/field.js +27 -0
  155. package/dist/custom/input/index.d.ts +3 -0
  156. package/dist/custom/input/input.plugin.d.ts +12 -0
  157. package/dist/custom/input/input.plugin.js +46 -0
  158. package/dist/custom/input/types.d.ts +2 -0
  159. package/dist/custom/input-bool/index.d.ts +2 -0
  160. package/dist/custom/input-bool/input-bool.plugin.d.ts +30 -0
  161. package/dist/custom/input-bool/input-bool.plugin.js +77 -0
  162. package/dist/custom/input-bool/types.d.ts +5 -0
  163. package/dist/custom/input-control/index.d.ts +2 -0
  164. package/dist/custom/input-control/input-control.plugin.d.ts +12 -0
  165. package/dist/custom/input-control/input-control.plugin.js +40 -0
  166. package/dist/custom/input-control/types.d.ts +2 -0
  167. package/dist/custom/item-group/ids/ids.plugin.d.ts +19 -0
  168. package/dist/custom/item-group/ids/ids.plugin.js +32 -0
  169. package/dist/custom/item-group/ids/index.d.ts +1 -0
  170. package/dist/custom/item-group/index.d.ts +1 -0
  171. package/dist/custom/label/index.d.ts +1 -0
  172. package/dist/custom/label/nested-warn/index.d.ts +1 -0
  173. package/dist/custom/label/nested-warn/nested-warn.plugin.d.ts +21 -0
  174. package/dist/custom/label/nested-warn/nested-warn.plugin.js +41 -0
  175. package/dist/custom/list/height/height.plugin.d.ts +129 -0
  176. package/dist/custom/list/height/height.plugin.js +272 -0
  177. package/dist/custom/list/height/index.d.ts +2 -0
  178. package/dist/custom/list/height/types.d.ts +10 -0
  179. package/dist/custom/list/index.d.ts +7 -0
  180. package/dist/custom/list/item/index.d.ts +2 -0
  181. package/dist/custom/list/item/item.plugin.d.ts +25 -0
  182. package/dist/custom/list/item/item.plugin.js +46 -0
  183. package/dist/custom/list/item/types.d.ts +5 -0
  184. package/dist/custom/list/keyboard/index.d.ts +2 -0
  185. package/dist/custom/list/keyboard/keyboard.plugin.d.ts +133 -0
  186. package/dist/custom/list/keyboard/keyboard.plugin.js +199 -0
  187. package/dist/custom/list/keyboard/types.d.ts +3 -0
  188. package/dist/custom/list/navigation/index.d.ts +2 -0
  189. package/dist/custom/list/navigation/navigation.plugin.d.ts +262 -0
  190. package/dist/custom/list/navigation/navigation.plugin.js +402 -0
  191. package/dist/custom/list/navigation/types.d.ts +25 -0
  192. package/dist/custom/list/newly-selected.d.ts +17 -0
  193. package/dist/custom/list/newly-selected.js +22 -0
  194. package/dist/custom/list/option-ids/index.d.ts +1 -0
  195. package/dist/custom/list/option-ids/option-ids.plugin.d.ts +29 -0
  196. package/dist/custom/list/option-ids/option-ids.plugin.js +43 -0
  197. package/dist/custom/list/row.d.ts +50 -0
  198. package/dist/custom/list/row.js +99 -0
  199. package/dist/custom/list/scroll/index.d.ts +2 -0
  200. package/dist/custom/list/scroll/scroll.plugin.d.ts +132 -0
  201. package/dist/custom/list/scroll/scroll.plugin.js +286 -0
  202. package/dist/custom/list/scroll/types.d.ts +21 -0
  203. package/dist/custom/list/typeahead.d.ts +53 -0
  204. package/dist/custom/list/typeahead.js +58 -0
  205. package/dist/custom/menu/focus/focus.plugin.d.ts +61 -0
  206. package/dist/custom/menu/focus/focus.plugin.js +105 -0
  207. package/dist/custom/menu/focus/index.d.ts +2 -0
  208. package/dist/custom/menu/focus/types.d.ts +2 -0
  209. package/dist/custom/menu/hover/hover.plugin.d.ts +99 -0
  210. package/dist/custom/menu/hover/hover.plugin.js +235 -0
  211. package/dist/custom/menu/hover/index.d.ts +2 -0
  212. package/dist/custom/menu/hover/types.d.ts +2 -0
  213. package/dist/custom/menu/ids/ids.plugin.d.ts +29 -0
  214. package/dist/custom/menu/ids/ids.plugin.js +46 -0
  215. package/dist/custom/menu/ids/index.d.ts +1 -0
  216. package/dist/custom/menu/index.d.ts +11 -0
  217. package/dist/custom/menu/keyboard/index.d.ts +2 -0
  218. package/dist/custom/menu/keyboard/keyboard.plugin.d.ts +41 -0
  219. package/dist/custom/menu/keyboard/keyboard.plugin.js +68 -0
  220. package/dist/custom/menu/keyboard/types.d.ts +2 -0
  221. package/dist/custom/menu/navigation/index.d.ts +2 -0
  222. package/dist/custom/menu/navigation/navigation.plugin.d.ts +116 -0
  223. package/dist/custom/menu/navigation/navigation.plugin.js +222 -0
  224. package/dist/custom/menu/navigation/types.d.ts +2 -0
  225. package/dist/custom/menu/nested-layer.d.ts +13 -0
  226. package/dist/custom/menu/nested-layer.js +20 -0
  227. package/dist/custom/menu/pointer/index.d.ts +2 -0
  228. package/dist/custom/menu/pointer/pointer.plugin.d.ts +45 -0
  229. package/dist/custom/menu/pointer/pointer.plugin.js +95 -0
  230. package/dist/custom/menu/pointer/strategies/context.strategy.d.ts +70 -0
  231. package/dist/custom/menu/pointer/strategies/context.strategy.js +170 -0
  232. package/dist/custom/menu/pointer/strategies/index.d.ts +3 -0
  233. package/dist/custom/menu/pointer/strategies/press.strategy.d.ts +23 -0
  234. package/dist/custom/menu/pointer/strategies/press.strategy.js +33 -0
  235. package/dist/custom/menu/pointer/strategies/types.d.ts +49 -0
  236. package/dist/custom/menu/pointer/types.d.ts +2 -0
  237. package/dist/custom/menu/popover-item-focus/focus.plugin.d.ts +54 -0
  238. package/dist/custom/menu/popover-item-focus/focus.plugin.js +70 -0
  239. package/dist/custom/menu/popover-item-focus/index.d.ts +2 -0
  240. package/dist/custom/menu/popover-item-focus/types.d.ts +10 -0
  241. package/dist/custom/menu/popover-item-keyboard/index.d.ts +2 -0
  242. package/dist/custom/menu/popover-item-keyboard/keyboard.plugin.d.ts +43 -0
  243. package/dist/custom/menu/popover-item-keyboard/keyboard.plugin.js +79 -0
  244. package/dist/custom/menu/popover-item-keyboard/types.d.ts +2 -0
  245. package/dist/custom/menu/popup-ids/ids.plugin.d.ts +27 -0
  246. package/dist/custom/menu/popup-ids/ids.plugin.js +47 -0
  247. package/dist/custom/menu/popup-ids/index.d.ts +1 -0
  248. package/dist/custom/menu/submenu-focus/focus.plugin.d.ts +53 -0
  249. package/dist/custom/menu/submenu-focus/focus.plugin.js +84 -0
  250. package/dist/custom/menu/submenu-focus/index.d.ts +2 -0
  251. package/dist/custom/menu/submenu-focus/types.d.ts +10 -0
  252. package/dist/custom/menu/submenu-keyboard/index.d.ts +2 -0
  253. package/dist/custom/menu/submenu-keyboard/keyboard.plugin.d.ts +43 -0
  254. package/dist/custom/menu/submenu-keyboard/keyboard.plugin.js +74 -0
  255. package/dist/custom/menu/submenu-keyboard/types.d.ts +2 -0
  256. package/dist/custom/number-input/index.d.ts +5 -0
  257. package/dist/custom/number-input/keyboard/index.d.ts +2 -0
  258. package/dist/custom/number-input/keyboard/keyboard.plugin.d.ts +36 -0
  259. package/dist/custom/number-input/keyboard/keyboard.plugin.js +80 -0
  260. package/dist/custom/number-input/keyboard/types.d.ts +3 -0
  261. package/dist/custom/number-input/names/index.d.ts +1 -0
  262. package/dist/custom/number-input/names/names.plugin.d.ts +17 -0
  263. package/dist/custom/number-input/names/names.plugin.js +24 -0
  264. package/dist/custom/number-input/parts.d.ts +21 -0
  265. package/dist/custom/number-input/parts.js +39 -0
  266. package/dist/custom/number-input/stepper/index.d.ts +2 -0
  267. package/dist/custom/number-input/stepper/stepper.plugin.d.ts +59 -0
  268. package/dist/custom/number-input/stepper/stepper.plugin.js +166 -0
  269. package/dist/custom/number-input/stepper/types.d.ts +19 -0
  270. package/dist/custom/number-input/touch/index.d.ts +2 -0
  271. package/dist/custom/number-input/touch/touch.plugin.d.ts +25 -0
  272. package/dist/custom/number-input/touch/touch.plugin.js +53 -0
  273. package/dist/custom/number-input/touch/types.d.ts +3 -0
  274. package/dist/custom/number-input/types.d.ts +8 -0
  275. package/dist/custom/number-input/typing/index.d.ts +2 -0
  276. package/dist/custom/number-input/typing/types.d.ts +6 -0
  277. package/dist/custom/number-input/typing/typing.plugin.d.ts +47 -0
  278. package/dist/custom/number-input/typing/typing.plugin.js +149 -0
  279. package/dist/custom/overlay/focus/focus.plugin.d.ts +150 -0
  280. package/dist/custom/overlay/focus/focus.plugin.js +242 -0
  281. package/dist/custom/overlay/focus/index.d.ts +1 -0
  282. package/dist/custom/overlay/hide-outside/hide-outside.plugin.d.ts +84 -0
  283. package/dist/custom/overlay/hide-outside/hide-outside.plugin.js +187 -0
  284. package/dist/custom/overlay/hide-outside/index.d.ts +2 -0
  285. package/dist/custom/overlay/hide-outside/marks.d.ts +19 -0
  286. package/dist/custom/overlay/hide-outside/marks.js +43 -0
  287. package/dist/custom/overlay/hide-outside/types.d.ts +17 -0
  288. package/dist/custom/overlay/index.d.ts +9 -0
  289. package/dist/custom/overlay/modal-focus/index.d.ts +1 -0
  290. package/dist/custom/overlay/modal-focus/modal-focus.plugin.d.ts +72 -0
  291. package/dist/custom/overlay/modal-focus/modal-focus.plugin.js +109 -0
  292. package/dist/custom/overlay/modal-ids/index.d.ts +1 -0
  293. package/dist/custom/overlay/modal-ids/modal-ids.plugin.d.ts +21 -0
  294. package/dist/custom/overlay/modal-ids/modal-ids.plugin.js +30 -0
  295. package/dist/custom/overlay/modal-layout/index.d.ts +2 -0
  296. package/dist/custom/overlay/modal-layout/modal-layout.plugin.d.ts +66 -0
  297. package/dist/custom/overlay/modal-layout/modal-layout.plugin.js +119 -0
  298. package/dist/custom/overlay/modal-layout/types.d.ts +13 -0
  299. package/dist/custom/overlay/modal-names/index.d.ts +1 -0
  300. package/dist/custom/overlay/modal-names/modal-names.plugin.d.ts +14 -0
  301. package/dist/custom/overlay/modal-names/modal-names.plugin.js +17 -0
  302. package/dist/custom/overlay/open-state.d.ts +12 -0
  303. package/dist/custom/overlay/open-state.js +42 -0
  304. package/dist/custom/overlay/scroll-lock/index.d.ts +2 -0
  305. package/dist/custom/overlay/scroll-lock/lock.d.ts +17 -0
  306. package/dist/custom/overlay/scroll-lock/lock.js +83 -0
  307. package/dist/custom/overlay/scroll-lock/scroll-lock.plugin.d.ts +78 -0
  308. package/dist/custom/overlay/scroll-lock/scroll-lock.plugin.js +134 -0
  309. package/dist/custom/overlay/scroll-lock/types.d.ts +17 -0
  310. package/dist/custom/overlay/swipe/index.d.ts +2 -0
  311. package/dist/custom/overlay/swipe/swipe.plugin.d.ts +150 -0
  312. package/dist/custom/overlay/swipe/swipe.plugin.js +432 -0
  313. package/dist/custom/overlay/swipe/types.d.ts +62 -0
  314. package/dist/custom/overlay/types.d.ts +40 -0
  315. package/dist/custom/pagination/current.d.ts +24 -0
  316. package/dist/custom/pagination/current.js +34 -0
  317. package/dist/custom/pagination/focus/focus.plugin.d.ts +57 -0
  318. package/dist/custom/pagination/focus/focus.plugin.js +106 -0
  319. package/dist/custom/pagination/focus/index.d.ts +2 -0
  320. package/dist/custom/pagination/focus/types.d.ts +8 -0
  321. package/dist/custom/pagination/index.d.ts +3 -0
  322. package/dist/custom/pagination/names/index.d.ts +1 -0
  323. package/dist/custom/pagination/names/names.plugin.d.ts +15 -0
  324. package/dist/custom/pagination/names/names.plugin.js +19 -0
  325. package/dist/custom/popover/focus/focus.plugin.d.ts +69 -0
  326. package/dist/custom/popover/focus/focus.plugin.js +107 -0
  327. package/dist/custom/popover/focus/index.d.ts +2 -0
  328. package/dist/custom/popover/focus/types.d.ts +2 -0
  329. package/dist/custom/popover/ids/ids.plugin.d.ts +18 -0
  330. package/dist/custom/popover/ids/ids.plugin.js +27 -0
  331. package/dist/custom/popover/ids/index.d.ts +1 -0
  332. package/dist/custom/popover/index.d.ts +4 -0
  333. package/dist/custom/popover/names/index.d.ts +1 -0
  334. package/dist/custom/popover/names/names.plugin.d.ts +7 -0
  335. package/dist/custom/popover/names/names.plugin.js +10 -0
  336. package/dist/custom/popover/pointer/index.d.ts +2 -0
  337. package/dist/custom/popover/pointer/pointer.plugin.d.ts +35 -0
  338. package/dist/custom/popover/pointer/pointer.plugin.js +65 -0
  339. package/dist/custom/popover/pointer/types.d.ts +2 -0
  340. package/dist/custom/radio-group/checked/checked.plugin.d.ts +45 -0
  341. package/dist/custom/radio-group/checked/checked.plugin.js +81 -0
  342. package/dist/custom/radio-group/checked/index.d.ts +1 -0
  343. package/dist/custom/radio-group/index.d.ts +3 -0
  344. package/dist/custom/radio-group/name/index.d.ts +1 -0
  345. package/dist/custom/radio-group/name/name.plugin.d.ts +21 -0
  346. package/dist/custom/radio-group/name/name.plugin.js +39 -0
  347. package/dist/custom/radio-group/stop.d.ts +17 -0
  348. package/dist/custom/radio-group/stop.js +30 -0
  349. package/dist/custom/rating/hover/hover.plugin.d.ts +36 -0
  350. package/dist/custom/rating/hover/hover.plugin.js +71 -0
  351. package/dist/custom/rating/hover/index.d.ts +2 -0
  352. package/dist/custom/rating/hover/types.d.ts +7 -0
  353. package/dist/custom/rating/index.d.ts +3 -0
  354. package/dist/custom/rating/names/index.d.ts +1 -0
  355. package/dist/custom/rating/names/names.plugin.d.ts +25 -0
  356. package/dist/custom/rating/names/names.plugin.js +45 -0
  357. package/dist/custom/rating/validity/index.d.ts +2 -0
  358. package/dist/custom/rating/validity/types.d.ts +7 -0
  359. package/dist/custom/rating/validity/validity.plugin.d.ts +48 -0
  360. package/dist/custom/rating/validity/validity.plugin.js +91 -0
  361. package/dist/custom/ready/index.d.ts +1 -0
  362. package/dist/custom/ready/ready.plugin.d.ts +14 -0
  363. package/dist/custom/ready/ready.plugin.js +28 -0
  364. package/dist/custom/scroller/index.d.ts +2 -0
  365. package/dist/custom/scroller/names/index.d.ts +1 -0
  366. package/dist/custom/scroller/names/names.plugin.d.ts +11 -0
  367. package/dist/custom/scroller/names/names.plugin.js +15 -0
  368. package/dist/custom/scroller/viewport/edges.d.ts +34 -0
  369. package/dist/custom/scroller/viewport/edges.js +29 -0
  370. package/dist/custom/scroller/viewport/focus.d.ts +39 -0
  371. package/dist/custom/scroller/viewport/focus.js +61 -0
  372. package/dist/custom/scroller/viewport/index.d.ts +6 -0
  373. package/dist/custom/scroller/viewport/stop.d.ts +24 -0
  374. package/dist/custom/scroller/viewport/stop.js +34 -0
  375. package/dist/custom/scroller/viewport/types.d.ts +31 -0
  376. package/dist/custom/scroller/viewport/viewport.plugin.d.ts +163 -0
  377. package/dist/custom/scroller/viewport/viewport.plugin.js +352 -0
  378. package/dist/custom/select/backspace/backspace.plugin.d.ts +50 -0
  379. package/dist/custom/select/backspace/backspace.plugin.js +125 -0
  380. package/dist/custom/select/backspace/index.d.ts +2 -0
  381. package/dist/custom/select/backspace/types.d.ts +2 -0
  382. package/dist/custom/select/editable/editable.plugin.d.ts +193 -0
  383. package/dist/custom/select/editable/editable.plugin.js +347 -0
  384. package/dist/custom/select/editable/index.d.ts +2 -0
  385. package/dist/custom/select/editable/types.d.ts +6 -0
  386. package/dist/custom/select/ids/ids.plugin.d.ts +22 -0
  387. package/dist/custom/select/ids/ids.plugin.js +31 -0
  388. package/dist/custom/select/ids/index.d.ts +1 -0
  389. package/dist/custom/select/index.d.ts +5 -0
  390. package/dist/custom/select/keyboard/index.d.ts +2 -0
  391. package/dist/custom/select/keyboard/keyboard.plugin.d.ts +125 -0
  392. package/dist/custom/select/keyboard/keyboard.plugin.js +205 -0
  393. package/dist/custom/select/keyboard/strategies/base.strategy.d.ts +37 -0
  394. package/dist/custom/select/keyboard/strategies/base.strategy.js +81 -0
  395. package/dist/custom/select/keyboard/strategies/editable.strategy.d.ts +16 -0
  396. package/dist/custom/select/keyboard/strategies/editable.strategy.js +20 -0
  397. package/dist/custom/select/keyboard/strategies/index.d.ts +4 -0
  398. package/dist/custom/select/keyboard/strategies/select-only.strategy.d.ts +13 -0
  399. package/dist/custom/select/keyboard/strategies/select-only.strategy.js +59 -0
  400. package/dist/custom/select/keyboard/strategies/types.d.ts +29 -0
  401. package/dist/custom/select/keyboard/types.d.ts +18 -0
  402. package/dist/custom/select/pointer/index.d.ts +2 -0
  403. package/dist/custom/select/pointer/pointer.plugin.d.ts +59 -0
  404. package/dist/custom/select/pointer/pointer.plugin.js +104 -0
  405. package/dist/custom/select/pointer/types.d.ts +2 -0
  406. package/dist/custom/skeleton/index.d.ts +2 -0
  407. package/dist/custom/skeleton/layout.plugin.d.ts +18 -0
  408. package/dist/custom/skeleton/layout.plugin.js +47 -0
  409. package/dist/custom/skeleton/types.d.ts +5 -0
  410. package/dist/custom/slide/direction.d.ts +30 -0
  411. package/dist/custom/slide/direction.js +75 -0
  412. package/dist/custom/slide/index.d.ts +4 -0
  413. package/dist/custom/slide/keyboard/index.d.ts +2 -0
  414. package/dist/custom/slide/keyboard/keyboard.plugin.d.ts +46 -0
  415. package/dist/custom/slide/keyboard/keyboard.plugin.js +106 -0
  416. package/dist/custom/slide/keyboard/types.d.ts +6 -0
  417. package/dist/custom/slide/parts.d.ts +7 -0
  418. package/dist/custom/slide/parts.js +26 -0
  419. package/dist/custom/slide/pointer/index.d.ts +2 -0
  420. package/dist/custom/slide/pointer/pointer.plugin.d.ts +100 -0
  421. package/dist/custom/slide/pointer/pointer.plugin.js +268 -0
  422. package/dist/custom/slide/pointer/strategies/base.strategy.d.ts +16 -0
  423. package/dist/custom/slide/pointer/strategies/base.strategy.js +23 -0
  424. package/dist/custom/slide/pointer/strategies/hold.strategy.d.ts +28 -0
  425. package/dist/custom/slide/pointer/strategies/hold.strategy.js +48 -0
  426. package/dist/custom/slide/pointer/strategies/index.d.ts +7 -0
  427. package/dist/custom/slide/pointer/strategies/magnet.strategy.d.ts +11 -0
  428. package/dist/custom/slide/pointer/strategies/magnet.strategy.js +17 -0
  429. package/dist/custom/slide/pointer/strategies/none.strategy.d.ts +7 -0
  430. package/dist/custom/slide/pointer/strategies/none.strategy.js +9 -0
  431. package/dist/custom/slide/pointer/strategies/plateau.strategy.d.ts +24 -0
  432. package/dist/custom/slide/pointer/strategies/plateau.strategy.js +81 -0
  433. package/dist/custom/slide/pointer/strategies/points.d.ts +16 -0
  434. package/dist/custom/slide/pointer/strategies/points.js +32 -0
  435. package/dist/custom/slide/pointer/strategies/settle.strategy.d.ts +11 -0
  436. package/dist/custom/slide/pointer/strategies/settle.strategy.js +17 -0
  437. package/dist/custom/slide/pointer/strategies/types.d.ts +57 -0
  438. package/dist/custom/slide/pointer/types.d.ts +46 -0
  439. package/dist/custom/slide/types.d.ts +14 -0
  440. package/dist/custom/table/column-ids/column-ids.plugin.d.ts +26 -0
  441. package/dist/custom/table/column-ids/column-ids.plugin.js +36 -0
  442. package/dist/custom/table/column-ids/index.d.ts +1 -0
  443. package/dist/custom/table/column-names/column-names.plugin.d.ts +18 -0
  444. package/dist/custom/table/column-names/column-names.plugin.js +24 -0
  445. package/dist/custom/table/column-names/index.d.ts +1 -0
  446. package/dist/custom/table/column-reorder/column-reorder.plugin.d.ts +169 -0
  447. package/dist/custom/table/column-reorder/column-reorder.plugin.js +465 -0
  448. package/dist/custom/table/column-reorder/index.d.ts +2 -0
  449. package/dist/custom/table/column-reorder/types.d.ts +81 -0
  450. package/dist/custom/table/column-resize/column-resize.plugin.d.ts +96 -0
  451. package/dist/custom/table/column-resize/column-resize.plugin.js +271 -0
  452. package/dist/custom/table/column-resize/index.d.ts +2 -0
  453. package/dist/custom/table/column-resize/types.d.ts +38 -0
  454. package/dist/custom/table/grid/grid.plugin.d.ts +119 -0
  455. package/dist/custom/table/grid/grid.plugin.js +356 -0
  456. package/dist/custom/table/grid/index.d.ts +2 -0
  457. package/dist/custom/table/grid/types.d.ts +22 -0
  458. package/dist/custom/table/index.d.ts +8 -0
  459. package/dist/custom/table/layout/index.d.ts +2 -0
  460. package/dist/custom/table/layout/layout.plugin.d.ts +52 -0
  461. package/dist/custom/table/layout/layout.plugin.js +122 -0
  462. package/dist/custom/table/layout/types.d.ts +7 -0
  463. package/dist/custom/table/names/index.d.ts +2 -0
  464. package/dist/custom/table/names/names.plugin.d.ts +18 -0
  465. package/dist/custom/table/names/names.plugin.js +31 -0
  466. package/dist/custom/table/names/types.d.ts +6 -0
  467. package/dist/custom/table/row-ids/index.d.ts +1 -0
  468. package/dist/custom/table/row-ids/row-ids.plugin.d.ts +21 -0
  469. package/dist/custom/table/row-ids/row-ids.plugin.js +28 -0
  470. package/dist/custom/tabs/active-tab/active-tab.plugin.d.ts +42 -0
  471. package/dist/custom/tabs/active-tab/active-tab.plugin.js +103 -0
  472. package/dist/custom/tabs/active-tab/index.d.ts +2 -0
  473. package/dist/custom/tabs/active-tab/types.d.ts +17 -0
  474. package/dist/custom/tabs/content-warn/content-warn.plugin.d.ts +21 -0
  475. package/dist/custom/tabs/content-warn/content-warn.plugin.js +41 -0
  476. package/dist/custom/tabs/content-warn/index.d.ts +1 -0
  477. package/dist/custom/tabs/index.d.ts +7 -0
  478. package/dist/custom/tabs/item-ids/index.d.ts +1 -0
  479. package/dist/custom/tabs/item-ids/item-ids.plugin.d.ts +60 -0
  480. package/dist/custom/tabs/item-ids/item-ids.plugin.js +94 -0
  481. package/dist/custom/tabs/item-names/index.d.ts +1 -0
  482. package/dist/custom/tabs/item-names/item-names.plugin.d.ts +17 -0
  483. package/dist/custom/tabs/item-names/item-names.plugin.js +23 -0
  484. package/dist/custom/tabs/keyboard/index.d.ts +2 -0
  485. package/dist/custom/tabs/keyboard/keyboard.plugin.d.ts +105 -0
  486. package/dist/custom/tabs/keyboard/keyboard.plugin.js +206 -0
  487. package/dist/custom/tabs/keyboard/types.d.ts +6 -0
  488. package/dist/custom/tabs/layout/index.d.ts +2 -0
  489. package/dist/custom/tabs/layout/layout.plugin.d.ts +37 -0
  490. package/dist/custom/tabs/layout/layout.plugin.js +81 -0
  491. package/dist/custom/tabs/layout/types.d.ts +4 -0
  492. package/dist/custom/tabs/parts.d.ts +15 -0
  493. package/dist/custom/tabs/parts.js +21 -0
  494. package/dist/custom/tabs/tab.d.ts +29 -0
  495. package/dist/custom/tabs/tab.js +44 -0
  496. package/dist/custom/tags/index.d.ts +4 -0
  497. package/dist/custom/tags/item-names/index.d.ts +1 -0
  498. package/dist/custom/tags/item-names/item-names.plugin.d.ts +12 -0
  499. package/dist/custom/tags/item-names/item-names.plugin.js +18 -0
  500. package/dist/custom/tags/keyboard/index.d.ts +2 -0
  501. package/dist/custom/tags/keyboard/keyboard.plugin.d.ts +133 -0
  502. package/dist/custom/tags/keyboard/keyboard.plugin.js +253 -0
  503. package/dist/custom/tags/keyboard/types.d.ts +6 -0
  504. package/dist/custom/tags/scroll/index.d.ts +2 -0
  505. package/dist/custom/tags/scroll/scroll.plugin.d.ts +68 -0
  506. package/dist/custom/tags/scroll/scroll.plugin.js +120 -0
  507. package/dist/custom/tags/scroll/types.d.ts +6 -0
  508. package/dist/custom/tags/tag.d.ts +41 -0
  509. package/dist/custom/tags/tag.js +66 -0
  510. package/dist/custom/textarea/autoresize/autoresize.plugin.d.ts +70 -0
  511. package/dist/custom/textarea/autoresize/autoresize.plugin.js +176 -0
  512. package/dist/custom/textarea/autoresize/index.d.ts +2 -0
  513. package/dist/custom/textarea/autoresize/types.d.ts +6 -0
  514. package/dist/custom/textarea/ids/ids.plugin.d.ts +26 -0
  515. package/dist/custom/textarea/ids/ids.plugin.js +44 -0
  516. package/dist/custom/textarea/ids/index.d.ts +1 -0
  517. package/dist/custom/textarea/index.d.ts +3 -0
  518. package/dist/custom/textarea/names/index.d.ts +2 -0
  519. package/dist/custom/textarea/names/names.plugin.d.ts +33 -0
  520. package/dist/custom/textarea/names/names.plugin.js +65 -0
  521. package/dist/custom/textarea/names/types.d.ts +8 -0
  522. package/dist/custom/toasts/cascade/cascade.plugin.d.ts +81 -0
  523. package/dist/custom/toasts/cascade/cascade.plugin.js +214 -0
  524. package/dist/custom/toasts/cascade/index.d.ts +2 -0
  525. package/dist/custom/toasts/cascade/types.d.ts +15 -0
  526. package/dist/custom/toasts/index.d.ts +7 -0
  527. package/dist/custom/toasts/item-names/index.d.ts +1 -0
  528. package/dist/custom/toasts/item-names/item-names.plugin.d.ts +12 -0
  529. package/dist/custom/toasts/item-names/item-names.plugin.js +18 -0
  530. package/dist/custom/toasts/keyboard/index.d.ts +2 -0
  531. package/dist/custom/toasts/keyboard/keyboard.plugin.d.ts +57 -0
  532. package/dist/custom/toasts/keyboard/keyboard.plugin.js +136 -0
  533. package/dist/custom/toasts/keyboard/types.d.ts +6 -0
  534. package/dist/custom/toasts/layout/index.d.ts +2 -0
  535. package/dist/custom/toasts/layout/layout.plugin.d.ts +23 -0
  536. package/dist/custom/toasts/layout/layout.plugin.js +39 -0
  537. package/dist/custom/toasts/layout/types.d.ts +5 -0
  538. package/dist/custom/toasts/names/index.d.ts +1 -0
  539. package/dist/custom/toasts/names/names.plugin.d.ts +10 -0
  540. package/dist/custom/toasts/names/names.plugin.js +13 -0
  541. package/dist/custom/toasts/removal/index.d.ts +2 -0
  542. package/dist/custom/toasts/removal/removal.plugin.d.ts +35 -0
  543. package/dist/custom/toasts/removal/removal.plugin.js +69 -0
  544. package/dist/custom/toasts/removal/types.d.ts +6 -0
  545. package/dist/custom/toasts/timer/index.d.ts +2 -0
  546. package/dist/custom/toasts/timer/timer.plugin.d.ts +71 -0
  547. package/dist/custom/toasts/timer/timer.plugin.js +213 -0
  548. package/dist/custom/toasts/timer/types.d.ts +15 -0
  549. package/dist/custom/tooltip/ids/ids.plugin.d.ts +22 -0
  550. package/dist/custom/tooltip/ids/ids.plugin.js +42 -0
  551. package/dist/custom/tooltip/ids/index.d.ts +1 -0
  552. package/dist/custom/tooltip/index.d.ts +2 -0
  553. package/dist/custom/tooltip/trigger/document-state.d.ts +42 -0
  554. package/dist/custom/tooltip/trigger/document-state.js +50 -0
  555. package/dist/custom/tooltip/trigger/index.d.ts +2 -0
  556. package/dist/custom/tooltip/trigger/trigger.plugin.d.ts +133 -0
  557. package/dist/custom/tooltip/trigger/trigger.plugin.js +271 -0
  558. package/dist/custom/tooltip/trigger/types.d.ts +20 -0
  559. package/dist/custom/virtual/index.d.ts +2 -0
  560. package/dist/custom/virtual/types.d.ts +6 -0
  561. package/dist/custom/virtual/virtual.plugin.d.ts +126 -0
  562. package/dist/custom/virtual/virtual.plugin.js +311 -0
  563. package/dist/index.d.ts +7 -0
  564. package/dist/index.js +149 -0
  565. package/dist/locale/index.d.ts +6 -0
  566. package/dist/locale/locale.d.ts +38 -0
  567. package/dist/locale/locale.js +93 -0
  568. package/dist/locale/locale.plugin.d.ts +26 -0
  569. package/dist/locale/locale.plugin.js +35 -0
  570. package/dist/locale/locales/ar.d.ts +5 -0
  571. package/dist/locale/locales/ar.js +59 -0
  572. package/dist/locale/locales/en.d.ts +7 -0
  573. package/dist/locale/locales/en.js +61 -0
  574. package/dist/locale/locales/es.d.ts +2 -0
  575. package/dist/locale/locales/es.js +56 -0
  576. package/dist/locale/locales/fr.d.ts +2 -0
  577. package/dist/locale/locales/fr.js +56 -0
  578. package/dist/locale/locales/index.d.ts +6 -0
  579. package/dist/locale/locales/ru.d.ts +2 -0
  580. package/dist/locale/locales/ru.js +56 -0
  581. package/dist/locale/locales/zh.d.ts +2 -0
  582. package/dist/locale/locales/zh.js +56 -0
  583. package/dist/locale/names.plugin.d.ts +32 -0
  584. package/dist/locale/names.plugin.js +39 -0
  585. package/dist/locale/source.class.d.ts +22 -0
  586. package/dist/locale/source.class.js +32 -0
  587. package/dist/locale/types.d.ts +197 -0
  588. package/dist/motion/index.d.ts +2 -0
  589. package/dist/motion/motion.d.ts +28 -0
  590. package/dist/motion/motion.js +67 -0
  591. package/dist/motion/types.d.ts +14 -0
  592. package/dist/utils/afterTransitions.d.ts +49 -0
  593. package/dist/utils/afterTransitions.js +79 -0
  594. package/dist/utils/focusFirst.d.ts +13 -0
  595. package/dist/utils/focusFirst.js +24 -0
  596. package/dist/utils/graceArea.d.ts +21 -0
  597. package/dist/utils/graceArea.js +66 -0
  598. package/dist/utils/index.d.ts +18 -0
  599. package/dist/utils/isAboveLayer.d.ts +14 -0
  600. package/dist/utils/isAboveLayer.js +24 -0
  601. package/dist/utils/isAppleTouch.d.ts +10 -0
  602. package/dist/utils/isAppleTouch.js +17 -0
  603. package/dist/utils/isFocusableElement.d.ts +8 -0
  604. package/dist/utils/isFocusableElement.js +13 -0
  605. package/dist/utils/isMeasurableElement.d.ts +11 -0
  606. package/dist/utils/isMeasurableElement.js +16 -0
  607. package/dist/utils/isPrintableKey.d.ts +7 -0
  608. package/dist/utils/isPrintableKey.js +12 -0
  609. package/dist/utils/layerOf.d.ts +12 -0
  610. package/dist/utils/layerOf.js +21 -0
  611. package/dist/utils/nearestShift.d.ts +19 -0
  612. package/dist/utils/nearestShift.js +58 -0
  613. package/dist/utils/positionOrigin.d.ts +34 -0
  614. package/dist/utils/positionOrigin.js +71 -0
  615. package/dist/utils/scrollParent.d.ts +12 -0
  616. package/dist/utils/scrollParent.js +23 -0
  617. package/dist/utils/scrollWindow.d.ts +27 -0
  618. package/dist/utils/scrollWindow.js +50 -0
  619. package/dist/utils/tabStops.d.ts +44 -0
  620. package/dist/utils/tabStops.js +102 -0
  621. package/dist/utils/tabStopsAfter.d.ts +10 -0
  622. package/dist/utils/tabStopsAfter.js +16 -0
  623. package/dist/utils/tabStopsBefore.d.ts +11 -0
  624. package/dist/utils/tabStopsBefore.js +17 -0
  625. package/dist/utils/toCssValue.d.ts +8 -0
  626. package/dist/utils/toCssValue.js +17 -0
  627. package/dist/utils/trapTab.d.ts +16 -0
  628. package/dist/utils/trapTab.js +36 -0
  629. package/dist/utils/types.d.ts +64 -0
  630. package/package.json +43 -4
@@ -0,0 +1,253 @@
1
+ import { TBasePlugin } from "../../../base/base.class.js";
2
+ import { TCollectionBundlesPlugin } from "../../collection/bundles.plugin.js";
3
+ import { TElementPlugin } from "../../element/element.plugin.js";
4
+ import { TCollectionElements } from "../../collection/collection-elements.plugin.js";
5
+ import { isFocusableElement } from "../../../utils/isFocusableElement.js";
6
+ import { tabStopsAfter } from "../../../utils/tabStopsAfter.js";
7
+ import { focusFirst } from "../../../utils/focusFirst.js";
8
+ import { TLeavingFocus } from "../../collection/leaving-focus.js";
9
+ import { tagOf, tagStopIn } from "../tag.js";
10
+ //#region src/custom/tags/keyboard/keyboard.plugin.ts
11
+ /** Клавиши, которые закрывают тег. */
12
+ var CLOSE_KEYS = /* @__PURE__ */ new Set(["Delete", "Backspace"]);
13
+ /**
14
+ * TTagsKeyboardPlugin — клавиатура Tags с выбором по паттерну APG Listbox и
15
+ * фокус после закрытия тега в любом режиме.
16
+ *
17
+ * Весь набор — одна остановка Tab (roving tabindex), по тегам ходят стрелки:
18
+ * ←/→ (в RTL наоборот) и ↑/↓ — к соседнему тегу по кругу, `Home`/`End` — к
19
+ * крайним. Теги, на которые нельзя перейти (`TTagsExtension.isEnabledTag`),
20
+ * пропускаются. `Delete` и `Backspace` закрывают тег, если его можно закрыть.
21
+ *
22
+ * **Фокус и выбор расходятся**, в отличие от Tabs: стрелка переносит только
23
+ * фокус, выбирает пробел. `Enter` и пробел здесь не обрабатываются — строку
24
+ * под фокусом переключает её собственный `press` (`TActionPlugin`). Поэтому
25
+ * остановку Tab коллекция не может посчитать по одному выбору: `focusin` на
26
+ * корне сообщает ей тег под фокусом (`notifyFocus`) — и от стрелок, и от
27
+ * клика, и от `focus()` из кода.
28
+ *
29
+ * Слушатели клавиш висят, пока у набора включён выбор. В `none` строка —
30
+ * `listitem` без действия, остановкой она не бывает, и перехватывать клавиши
31
+ * незачем. Режим выражен подпиской на `change:mode`, а не проверкой в
32
+ * обработчике.
33
+ *
34
+ * **Закрытый тег отдаёт фокус соседу** — в любом режиме и любым закрытием:
35
+ * клавишей, крестиком, из кода. Узел тега уходит из документа, и фокус,
36
+ * стоявший в нём, ушёл бы на страницу: следующий Tab начинал бы обход
37
+ * заново, а в поле Select стрелки прокручивали бы страницу. Переносится
38
+ * только фокус из узла закрываемого тега — к следующему соседу, у последнего
39
+ * к предыдущему, недоступные и без остановки пропускаются, — на его остановку
40
+ * (`tagStopIn`): с выбором — строку, без выбора — крестик. Соседа нет — к
41
+ * первой остановке Tab после ряда и вне его: в поле Select ряд стоит перед
42
+ * полем ввода, и фокус встаёт в поле без своего правила Select. Нет и её —
43
+ * фокус не трогается.
44
+ *
45
+ * Где фокус и кто соседи, видно только до удаления: после него узла тега нет
46
+ * в реестре, а места — в наборе. Когда переносить фокус, решает помощник
47
+ * коллекции (`TLeavingFocus`), общий с Tabs: он снимает фокус и соседей и на
48
+ * закрытии, и в хуке удаления, а переносит тем из фактов «закрыли» и «ушёл»,
49
+ * что пришёл вторым. Порядок у них разный: набор удаляет тег сам, следом за
50
+ * `item:close`, а поле Select снимает выбор с опции ещё в своём обработчике
51
+ * `item:close`, раньше плагина, — и её тег уходит до того, как закрытие
52
+ * дойдёт сюда. Удаление, отменённое в `item:remove:before`, фокус не трогает.
53
+ * Тег, ушедший без закрытия, — снятый из данных или размонтированный, — фокус
54
+ * не переносит: иначе ряд, который снимают целиком, гонял бы фокус по своим
55
+ * уходящим тегам. Здесь — только кто соседи и куда идёт фокус.
56
+ *
57
+ * Сами `tabindex` плагин не пишет: их ставит `TTagsExtension`, потому что
58
+ * атрибут обязан стоять с первой отрисовки, включая серверную. Здесь только
59
+ * то, что требует DOM: слушатели и перенос фокуса. Тег, на который ушёл
60
+ * фокус, в окно ряда `scroll` доводит `TTagsScrollPlugin` по `focusin`,
61
+ * который даёт и `focus()` этого плагина. Закрыть тег из кода можно и на
62
+ * сервере, поэтому фокус читается только при узле корня.
63
+ *
64
+ * От `TListNavigationPlugin` не наследуется: там фокус на контейнере и
65
+ * подсветка через `aria-activedescendant`, а здесь фокус ходит по самим
66
+ * тегам — у каждого свой крестик (см. AGENTS.md, «Граница переиспользования
67
+ * между похожими компонентами»).
68
+ */
69
+ var TTagsKeyboardPlugin = class extends TBasePlugin {
70
+ /** Корень: на нём слушатели, по нему же направление письма. */
71
+ _element = null;
72
+ /** Узел, на котором слушатели висят сейчас; `null` — не висят. */
73
+ _listening = null;
74
+ _elements = null;
75
+ _engine = null;
76
+ /** Фокус закрываемого тега — ждёт, пока тег закроют и он уйдёт из набора. */
77
+ _leaving = null;
78
+ install(ctx) {
79
+ super.install(ctx);
80
+ this._elements = ctx.get(TCollectionElements) ?? null;
81
+ this._leaving = new TLeavingFocus(this._elements, {
82
+ root: () => this._element,
83
+ place: (tag) => this._neighbours(tag),
84
+ pass: (root, neighbours) => this._pass(root, neighbours)
85
+ });
86
+ const elementPlugin = ctx.get(TElementPlugin);
87
+ elementPlugin?.events.on("ready", (element) => {
88
+ this._element = element;
89
+ this._syncListeners();
90
+ });
91
+ elementPlugin?.events.on("removed", () => {
92
+ this._element = null;
93
+ this._leaving?.reset();
94
+ this._syncListeners();
95
+ });
96
+ ctx.get(TCollectionBundlesPlugin)?.events.on("engine:bound", (engine) => this._bindEngine(engine));
97
+ }
98
+ destroy() {
99
+ this._element = null;
100
+ this._bindEngine(null);
101
+ this._elements = null;
102
+ this._leaving = null;
103
+ super.destroy();
104
+ }
105
+ /**
106
+ * Движок сменился — подписки на режим выбора, закрытие и удаление тегов
107
+ * переезжают вместе с ним. Закрытие и удаление слушаются в любом режиме:
108
+ * фокус после закрытия переносится и без выбора.
109
+ */
110
+ _bindEngine(engine) {
111
+ const previous = this._engine?.extensions;
112
+ previous?.selection.events.off("change:mode", this._onModeChange);
113
+ previous?.tags.events.off("item:close", this._onClose);
114
+ this._engine = engine;
115
+ const extensions = engine?.extensions;
116
+ extensions?.selection.events.on("change:mode", this._onModeChange);
117
+ extensions?.tags.events.on("item:close", this._onClose);
118
+ this._leaving?.bind(extensions?.plain ?? null);
119
+ this._syncListeners();
120
+ }
121
+ _onModeChange = () => this._syncListeners();
122
+ /** Слушатели висят на корне, пока узел есть и у набора включён выбор. */
123
+ _syncListeners() {
124
+ const target = (this._engine?.extensions.selection.mode ?? "none") !== "none" ? this._element : null;
125
+ if (target === this._listening) return;
126
+ this._listening?.removeEventListener("keydown", this._onKeyDown);
127
+ this._listening?.removeEventListener("focusin", this._onFocusIn);
128
+ this._listening = target;
129
+ target?.addEventListener("keydown", this._onKeyDown);
130
+ target?.addEventListener("focusin", this._onFocusIn);
131
+ }
132
+ _onKeyDown = (event) => {
133
+ if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) return;
134
+ const engine = this._engine;
135
+ if (!engine) return;
136
+ const tag = this._tagOf(engine, event.target);
137
+ if (!tag) return;
138
+ if (CLOSE_KEYS.has(event.key)) {
139
+ if (engine.extensions.tags.closeTag(tag)) event.preventDefault();
140
+ return;
141
+ }
142
+ const next = this._target(engine, event.key, tag);
143
+ if (!next) return;
144
+ event.preventDefault();
145
+ this._focus(next);
146
+ };
147
+ /**
148
+ * Фокус пришёл на тег — остановка Tab переходит к нему. Один путь для
149
+ * стрелок (их `focus()` тоже даёт `focusin`), клика и фокуса из кода.
150
+ */
151
+ _onFocusIn = (event) => {
152
+ const engine = this._engine;
153
+ if (!engine) return;
154
+ const tag = this._tagOf(engine, event.target);
155
+ if (tag) engine.extensions.tags.notifyFocus(tag);
156
+ };
157
+ /**
158
+ * Тег, с которого пришло событие, — тот, чей узел содержит его цель.
159
+ *
160
+ * Слушатель висит на корне, и до него всплывают события содержимого слота
161
+ * набора (поле ввода нового тега и т. п.): их перехватывать нельзя. Кнопка
162
+ * закрытия лежит внутри узла тега и считается его частью.
163
+ */
164
+ _tagOf(engine, target) {
165
+ if (!(target instanceof Node)) return void 0;
166
+ return engine.extensions.batch.shown.find((item) => this._elements?.getElementByUid(item.uid)?.contains(target));
167
+ }
168
+ /** Куда ведёт клавиша; `undefined` — клавиша не наша. */
169
+ _target(engine, key, tag) {
170
+ if (key === "Home") return this._available(engine)[0];
171
+ if (key === "End") return this._available(engine).at(-1);
172
+ const step = this._step(key);
173
+ return step === null ? void 0 : this._neighbour(engine, tag, step);
174
+ }
175
+ /**
176
+ * Шаг по набору от стрелки. Теги идут в ряд с переносом, поэтому ↑/↓ —
177
+ * тоже шаг по порядку. В RTL ряд идёт справа налево, и ←/→ меняются
178
+ * местами.
179
+ */
180
+ _step(key) {
181
+ switch (key) {
182
+ case "ArrowUp": return -1;
183
+ case "ArrowDown": return 1;
184
+ case "ArrowLeft": return this._rtl ? 1 : -1;
185
+ case "ArrowRight": return this._rtl ? -1 : 1;
186
+ default: return null;
187
+ }
188
+ }
189
+ /**
190
+ * Направление письма берётся вычисленным: `direction` компонента бывает
191
+ * `inherit`, и тогда его задаёт предок.
192
+ */
193
+ get _rtl() {
194
+ return this._element !== null && getComputedStyle(this._element).direction === "rtl";
195
+ }
196
+ /** Теги в порядке набора, на которые можно перейти. */
197
+ _available(engine) {
198
+ return engine.extensions.batch.shown.filter((item) => engine.extensions.tags.isEnabledTag(item));
199
+ }
200
+ /**
201
+ * Ближайший тег в направлении шага, по кругу: с последнего вперёд — на
202
+ * первый. Отсчёт от позиции тега в наборе, а не среди доступных: тег могли
203
+ * выключить, пока на нём фокус.
204
+ */
205
+ _neighbour(engine, tag, step) {
206
+ const shown = engine.extensions.batch.shown;
207
+ const count = shown.length;
208
+ const from = shown.indexOf(tag);
209
+ for (let offset = 1; offset <= count; offset++) {
210
+ const candidate = shown[((from + step * offset) % count + count) % count];
211
+ if (engine.extensions.tags.isEnabledTag(candidate)) return candidate;
212
+ }
213
+ }
214
+ /** Фокус на строку тега с ролью. Гард нужен: узел плагину приходит `Element`. */
215
+ _focus(item) {
216
+ const option = tagOf(this._elements, item.uid);
217
+ if (isFocusableElement(option)) option.focus();
218
+ }
219
+ /**
220
+ * Тег закрывают — любым путём: клавишей, крестиком, из кода. Переносить
221
+ * ли фокус, решает помощник: фокус мог стоять и не в этом теге.
222
+ */
223
+ _onClose = (tag) => this._leaving?.close(tag);
224
+ /**
225
+ * Соседи тега в порядке, в котором им отдаётся фокус: следующие за ним в
226
+ * наборе от ближнего, затем предыдущие от ближнего.
227
+ */
228
+ _neighbours(tag) {
229
+ const shown = this._engine?.extensions.batch.shown ?? [];
230
+ const index = shown.indexOf(tag);
231
+ return [...shown.slice(index + 1), ...shown.slice(0, Math.max(index, 0)).reverse()];
232
+ }
233
+ /**
234
+ * Фокус — на остановку ближайшего соседа, на которого можно перейти, а
235
+ * нет такого — на первую остановку Tab после ряда.
236
+ */
237
+ _pass(root, neighbours) {
238
+ const engine = this._engine;
239
+ if (!engine) return;
240
+ const { batch, tags } = engine.extensions;
241
+ const present = new Set(batch.items);
242
+ const stops = [];
243
+ for (const neighbour of neighbours) {
244
+ if (!present.has(neighbour) || !tags.isEnabledTag(neighbour)) continue;
245
+ const stop = tagStopIn(this._elements?.getElementByItem(neighbour) ?? null);
246
+ if (stop) stops.push(stop);
247
+ }
248
+ if (focusFirst(stops)) return;
249
+ focusFirst(tabStopsAfter(root, null));
250
+ }
251
+ };
252
+ //#endregion
253
+ export { TTagsKeyboardPlugin };
@@ -0,0 +1,6 @@
1
+ import type { TPluginEvents } from '../../../base';
2
+ /**
3
+ * Своих событий у плагина нет: результат нажатия виден и так — фокус сообщает
4
+ * DOM, остановку Tab — набор `aria` тегов, закрытие — коллекция (`item:close`).
5
+ */
6
+ export type TTagsKeyboardPluginEvents = TPluginEvents;
@@ -0,0 +1,2 @@
1
+ export { TTagsScrollPlugin } from './scroll.plugin';
2
+ export type { TTagsScrollPluginEvents } from './types';
@@ -0,0 +1,68 @@
1
+ import type { ITags } from '@soxa-ui/core';
2
+ import { TBasePlugin } from '../../../base';
3
+ import type { IPluginContext } from '../../../base';
4
+ import type { TTagsScrollPluginEvents } from './types';
5
+ /**
6
+ * TTagsScrollPlugin — brings the focused element of a `scroll` tags row into
7
+ * view.
8
+ *
9
+ * A `scroll` row scrolls by itself, and at its edge the focused element stayed
10
+ * cut: a partly visible one the browser doesn't scroll to on focus at all, a
11
+ * fully hidden one it centres — and then its tag stays cut. So on `focusin`
12
+ * the plugin brings the focused tag into the row's window: the padding box
13
+ * without `scroll-padding` (`scrollWindowOf`). How much room to keep at the
14
+ * edge only the theme knows — the focus ring's margin in a standalone row, the
15
+ * fade's width in a Select field. The arithmetic is shared with the scroller
16
+ * (`nearestShift`, `TScrollerViewportPlugin`).
17
+ *
18
+ * A plugin, not an extension or markup: boxes and scrolling are DOM
19
+ * operations. Decisions:
20
+ * - the tag — the row's direct child — goes into the window, not just the
21
+ * focused element. Focus lands on the tag's line or its close button, while
22
+ * in selection mode the ring is drawn by the pill: with the line in the
23
+ * window and the pill past the edge, the ring and the close button stayed
24
+ * cut, and a close button without its label doesn't tell which tag it
25
+ * closes. A tag wider than the window covers it, with the focused element
26
+ * inside;
27
+ * - the shift is the nearest one that puts the tag in the window, not start to
28
+ * start as in the scroller: the row has no snap;
29
+ * - keyboard focus only (`:focus-visible`). The browser doesn't scroll to the
30
+ * focus of a mouse press either, and rightly: had the row moved between the
31
+ * press and the release, another tag would be under the pointer, and `click`
32
+ * would miss;
33
+ * - the shift is synchronous, right in the handler, and instant, as in the
34
+ * scroller. The browser's own scroll to focus is instant too and would cut a
35
+ * smooth one short. On Tab it scrolls before `focusin`, after `focus()` —
36
+ * right after it, and after our shift it has nothing left to do.
37
+ *
38
+ * The plugin is the only path that brings a tag in: on entering the set by
39
+ * Tab and after `focus()` of the keyboard plugin (`TTagsKeyboardPlugin`:
40
+ * arrows, `Home`/`End`, the neighbour of a closed tag). The keyboard plugin
41
+ * doesn't scroll by itself: `focus()` after a key press the browser counts as
42
+ * keyboard focus, and `focusin` comes here with `:focus-visible`.
43
+ *
44
+ * Listens only while `overflow === 'scroll'`: in `wrap` the row doesn't
45
+ * scroll. The mode is expressed by the subscription, not by a check in the
46
+ * handler.
47
+ */
48
+ export declare class TTagsScrollPlugin extends TBasePlugin<ITags, TTagsScrollPluginEvents> {
49
+ /** The set's root: in `scroll` it is the scrolling row. */
50
+ private _root;
51
+ /** The node the listener is on now; `null` — it isn't on any. */
52
+ private _listening;
53
+ private _owner;
54
+ install(ctx: IPluginContext): void;
55
+ destroy(): void;
56
+ private readonly _onOverflowChange;
57
+ /** The listener is on the root while there is a node and the row scrolls by itself. */
58
+ private _syncListener;
59
+ /**
60
+ * Keyboard focus came into the row — bring its tag into the window (why —
61
+ * in the class description).
62
+ *
63
+ * The row itself is a Tab stop when it has none of its own: the browser
64
+ * makes one of a scrolling area. It is the window, and there is nowhere to
65
+ * bring it.
66
+ */
67
+ private readonly _onFocusIn;
68
+ }
@@ -0,0 +1,120 @@
1
+ import { TBasePlugin } from "../../../base/base.class.js";
2
+ import { TElementPlugin } from "../../element/element.plugin.js";
3
+ import { nearestShift } from "../../../utils/nearestShift.js";
4
+ import { itemOf, scrollWindowOf } from "../../../utils/scrollWindow.js";
5
+ //#region src/custom/tags/scroll/scroll.plugin.ts
6
+ /**
7
+ * TTagsScrollPlugin — brings the focused element of a `scroll` tags row into
8
+ * view.
9
+ *
10
+ * A `scroll` row scrolls by itself, and at its edge the focused element stayed
11
+ * cut: a partly visible one the browser doesn't scroll to on focus at all, a
12
+ * fully hidden one it centres — and then its tag stays cut. So on `focusin`
13
+ * the plugin brings the focused tag into the row's window: the padding box
14
+ * without `scroll-padding` (`scrollWindowOf`). How much room to keep at the
15
+ * edge only the theme knows — the focus ring's margin in a standalone row, the
16
+ * fade's width in a Select field. The arithmetic is shared with the scroller
17
+ * (`nearestShift`, `TScrollerViewportPlugin`).
18
+ *
19
+ * A plugin, not an extension or markup: boxes and scrolling are DOM
20
+ * operations. Decisions:
21
+ * - the tag — the row's direct child — goes into the window, not just the
22
+ * focused element. Focus lands on the tag's line or its close button, while
23
+ * in selection mode the ring is drawn by the pill: with the line in the
24
+ * window and the pill past the edge, the ring and the close button stayed
25
+ * cut, and a close button without its label doesn't tell which tag it
26
+ * closes. A tag wider than the window covers it, with the focused element
27
+ * inside;
28
+ * - the shift is the nearest one that puts the tag in the window, not start to
29
+ * start as in the scroller: the row has no snap;
30
+ * - keyboard focus only (`:focus-visible`). The browser doesn't scroll to the
31
+ * focus of a mouse press either, and rightly: had the row moved between the
32
+ * press and the release, another tag would be under the pointer, and `click`
33
+ * would miss;
34
+ * - the shift is synchronous, right in the handler, and instant, as in the
35
+ * scroller. The browser's own scroll to focus is instant too and would cut a
36
+ * smooth one short. On Tab it scrolls before `focusin`, after `focus()` —
37
+ * right after it, and after our shift it has nothing left to do.
38
+ *
39
+ * The plugin is the only path that brings a tag in: on entering the set by
40
+ * Tab and after `focus()` of the keyboard plugin (`TTagsKeyboardPlugin`:
41
+ * arrows, `Home`/`End`, the neighbour of a closed tag). The keyboard plugin
42
+ * doesn't scroll by itself: `focus()` after a key press the browser counts as
43
+ * keyboard focus, and `focusin` comes here with `:focus-visible`.
44
+ *
45
+ * Listens only while `overflow === 'scroll'`: in `wrap` the row doesn't
46
+ * scroll. The mode is expressed by the subscription, not by a check in the
47
+ * handler.
48
+ */
49
+ var TTagsScrollPlugin = class extends TBasePlugin {
50
+ /** The set's root: in `scroll` it is the scrolling row. */
51
+ _root = null;
52
+ /** The node the listener is on now; `null` — it isn't on any. */
53
+ _listening = null;
54
+ _owner = null;
55
+ install(ctx) {
56
+ super.install(ctx);
57
+ this._owner = ctx.getInstance();
58
+ const element = ctx.get(TElementPlugin);
59
+ element?.events.on("ready", (node) => {
60
+ this._root = node;
61
+ this._syncListener();
62
+ });
63
+ element?.events.on("removed", () => {
64
+ this._root = null;
65
+ this._syncListener();
66
+ });
67
+ this._listenTo(this._owner?.events, "change:overflow", this._onOverflowChange);
68
+ }
69
+ destroy() {
70
+ this._root = null;
71
+ this._syncListener();
72
+ this._owner = null;
73
+ super.destroy();
74
+ }
75
+ _onOverflowChange = () => this._syncListener();
76
+ /** The listener is on the root while there is a node and the row scrolls by itself. */
77
+ _syncListener() {
78
+ const target = this._owner?.overflow === "scroll" ? this._root : null;
79
+ if (target === this._listening) return;
80
+ this._listening?.removeEventListener("focusin", this._onFocusIn);
81
+ this._listening = target;
82
+ target?.addEventListener("focusin", this._onFocusIn);
83
+ }
84
+ /**
85
+ * Keyboard focus came into the row — bring its tag into the window (why —
86
+ * in the class description).
87
+ *
88
+ * The row itself is a Tab stop when it has none of its own: the browser
89
+ * makes one of a scrolling area. It is the window, and there is nowhere to
90
+ * bring it.
91
+ */
92
+ _onFocusIn = (event) => {
93
+ const root = this._root;
94
+ const target = event.target;
95
+ if (!root || !(target instanceof Element) || target === root) return;
96
+ if (!target.matches(":focus-visible")) return;
97
+ const shift = nearestShift({
98
+ scrollWindow: scrollWindowOf(root, getComputedStyle(root)),
99
+ focused: target.getBoundingClientRect(),
100
+ item: itemOf(target, root).getBoundingClientRect()
101
+ });
102
+ if (shift !== null) root.scrollBy({
103
+ left: wholePixels(shift),
104
+ behavior: "instant"
105
+ });
106
+ };
107
+ };
108
+ /**
109
+ * The shift in whole pixels, rounded away from zero. WebKit keeps the scroll
110
+ * position in whole pixels and truncates a fractional target toward zero: the
111
+ * tag stopped short of the window by under a pixel, and the row keeps exactly
112
+ * the focus ring's width at its edge, so the ring was cut. From a whole
113
+ * position the target stays whole, and in both engines the row moves no less
114
+ * than the tag needs. The arithmetic (`nearestShift`) stays exact.
115
+ */
116
+ function wholePixels(shift) {
117
+ return Math.sign(shift) * Math.ceil(Math.abs(shift));
118
+ }
119
+ //#endregion
120
+ export { TTagsScrollPlugin };
@@ -0,0 +1,6 @@
1
+ import type { TPluginEvents } from '../../../base';
2
+ /**
3
+ * Своих событий у плагина нет: результат доводки — положение самого ряда, и о
4
+ * прокрутке сообщает он (`scroll`).
5
+ */
6
+ export type TTagsScrollPluginEvents = TPluginEvents;
@@ -0,0 +1,41 @@
1
+ import type { IPluginContext } from '../../base';
2
+ import { TCollectionElements } from '../collection';
3
+ /**
4
+ * Строка тега с ролью опции — узел, на который уходит фокус тега, пока у
5
+ * набора включён выбор. `null` — элемента нет в документе.
6
+ *
7
+ * Одна на клавиатуру Tags (куда перевести фокус стрелкой) и фокус набора
8
+ * (`tagStopOf`): строку тега оба ищут одним правилом.
9
+ */
10
+ export declare function tagOf(elements: TCollectionElements | null, uid: string | number): Element | null;
11
+ /**
12
+ * Остановка тега в его узле — узел фокуса `Tags.Item` (`focusTarget` плагина
13
+ * действия): запись `focused = true` ставит фокус туда же, куда ведёт Tab, а
14
+ * не на корень — пилюлю для темы, которая фокус не держит.
15
+ *
16
+ * С выбором — строка с ролью опции, тем же правилом, что `tagOf`: по тегам
17
+ * ходят стрелки, и строка — опция, даже когда остановка набора не у неё. Без
18
+ * выбора у строки нет ни роли опции, ни `tabindex` — она `listitem` без
19
+ * действия, — и остановка тега — первая в его узле, крестик.
20
+ *
21
+ * `null` — узла нет, или в нём нет ни опции, ни остановки: тег без выбора не
22
+ * закрывается.
23
+ */
24
+ export declare function tagStopIn(node: Element | null): Element | null;
25
+ /**
26
+ * Остановка набора тегов — узел фокуса Tags (`focusTarget` плагина действия):
27
+ * запись `focused = true` ставит фокус туда же, куда ведёт Tab.
28
+ *
29
+ * С выбором набор — одна остановка (roving tabindex), тег-остановка
30
+ * (`tabStop` расширения тегов). Он берётся по модели, а не по
31
+ * `[tabindex="0"]`: в такте смены остановки разметка ещё старая. Без выбора
32
+ * остановки у строк нет, и у модели — тоже: остановки набора — крестики, и
33
+ * фокус встаёт на первую из них — остановку первого тега, у которого она
34
+ * есть (`tagStopIn`, то же правило, что у `Tags.Item`), по тегам в порядке
35
+ * показа, на которые можно перейти (`isEnabledTag`, то же правило, что у
36
+ * остановки с выбором).
37
+ *
38
+ * `null` — остановок у набора нет (теги не закрываются, или на них нельзя
39
+ * перейти) или узла тега нет в документе.
40
+ */
41
+ export declare function tagStopOf(_root: Element, ctx: IPluginContext): Element | null;
@@ -0,0 +1,66 @@
1
+ import { TCollectionElements } from "../collection/collection-elements.plugin.js";
2
+ import { tabStops } from "../../utils/tabStops.js";
3
+ //#region src/custom/tags/tag.ts
4
+ /**
5
+ * Узел опции внутри узла тега. Корень элемента — пилюля для темы, а опцией со
6
+ * своей ролью является вложенная строка: на неё и уходит фокус.
7
+ */
8
+ var OPTION_SELECTOR = "[role=\"option\"]";
9
+ /**
10
+ * Строка тега с ролью опции — узел, на который уходит фокус тега, пока у
11
+ * набора включён выбор. `null` — элемента нет в документе.
12
+ *
13
+ * Одна на клавиатуру Tags (куда перевести фокус стрелкой) и фокус набора
14
+ * (`tagStopOf`): строку тега оба ищут одним правилом.
15
+ */
16
+ function tagOf(elements, uid) {
17
+ return elements?.getElementByUid(uid)?.querySelector(OPTION_SELECTOR) ?? null;
18
+ }
19
+ /**
20
+ * Остановка тега в его узле — узел фокуса `Tags.Item` (`focusTarget` плагина
21
+ * действия): запись `focused = true` ставит фокус туда же, куда ведёт Tab, а
22
+ * не на корень — пилюлю для темы, которая фокус не держит.
23
+ *
24
+ * С выбором — строка с ролью опции, тем же правилом, что `tagOf`: по тегам
25
+ * ходят стрелки, и строка — опция, даже когда остановка набора не у неё. Без
26
+ * выбора у строки нет ни роли опции, ни `tabindex` — она `listitem` без
27
+ * действия, — и остановка тега — первая в его узле, крестик.
28
+ *
29
+ * `null` — узла нет, или в нём нет ни опции, ни остановки: тег без выбора не
30
+ * закрывается.
31
+ */
32
+ function tagStopIn(node) {
33
+ if (!node) return null;
34
+ return node.querySelector(OPTION_SELECTOR) ?? tabStops(node)[0] ?? null;
35
+ }
36
+ /**
37
+ * Остановка набора тегов — узел фокуса Tags (`focusTarget` плагина действия):
38
+ * запись `focused = true` ставит фокус туда же, куда ведёт Tab.
39
+ *
40
+ * С выбором набор — одна остановка (roving tabindex), тег-остановка
41
+ * (`tabStop` расширения тегов). Он берётся по модели, а не по
42
+ * `[tabindex="0"]`: в такте смены остановки разметка ещё старая. Без выбора
43
+ * остановки у строк нет, и у модели — тоже: остановки набора — крестики, и
44
+ * фокус встаёт на первую из них — остановку первого тега, у которого она
45
+ * есть (`tagStopIn`, то же правило, что у `Tags.Item`), по тегам в порядке
46
+ * показа, на которые можно перейти (`isEnabledTag`, то же правило, что у
47
+ * остановки с выбором).
48
+ *
49
+ * `null` — остановок у набора нет (теги не закрываются, или на них нельзя
50
+ * перейти) или узла тега нет в документе.
51
+ */
52
+ function tagStopOf(_root, ctx) {
53
+ const elements = ctx.get(TCollectionElements) ?? null;
54
+ const engine = elements?.engine ?? null;
55
+ if (!engine) return null;
56
+ const { batch, tags } = engine.extensions;
57
+ const stop = tags.tabStop;
58
+ if (stop) return tagOf(elements, stop.uid);
59
+ for (const tag of batch.shown) {
60
+ const first = tags.isEnabledTag(tag) ? tagStopIn(elements?.getElementByItem(tag) ?? null) : null;
61
+ if (first) return first;
62
+ }
63
+ return null;
64
+ }
65
+ //#endregion
66
+ export { tagOf, tagStopIn, tagStopOf };
@@ -0,0 +1,70 @@
1
+ import type { ITextarea } from '@soxa-ui/core';
2
+ import { TBasePlugin } from '../../../base';
3
+ import type { IPluginContext } from '../../../base';
4
+ import type { TTextareaAutoresizePluginEvents } from './types';
5
+ /**
6
+ * TTextareaAutoresizePlugin — высота многострочного поля по содержимому: от
7
+ * `rows` до `maxRows` строк.
8
+ *
9
+ * Нативная `<textarea>` не растёт, поэтому авторост — флаг `autoresize`, а
10
+ * пока он выключен, плагин поле не трогает: высоту дают `rows` и ручка.
11
+ * Свойства лежат на инстансе (`ITextarea`), плагин их читает — так же, как
12
+ * `TListHeightPlugin` читает `maxRows` списка: свойство — ядру, применение —
13
+ * плагину.
14
+ *
15
+ * Высота — инлайновый `height` самой `<textarea>` (корень растёт за ней сам:
16
+ * в нём ещё счётчик), в единицах её `box-sizing`. Строку меряет вычисленный
17
+ * интерлиньяж поля, к строкам добавляются его поля и рамка по оси блока, а
18
+ * высоту текста отдаёт `scrollHeight` — на миг сжатого до `rows` поля без
19
+ * прокрутки: так текст переносится по всей ширине, как после замера.
20
+ * Прокрутку предков, которую сжатие могло сбить, замер возвращает. Пока
21
+ * потолок не набран, прокрутки у поля нет (`overflow-y: hidden`): иначе под
22
+ * курсором мелькала бы полоса, которой вот-вот не станет. На потолке плагин
23
+ * этот запрет снимает, и поле прокручивается. Ручку (`resize: none`) плагин
24
+ * гасит на всё время автороста: высоту ведёт он. Выключили авторост — стили
25
+ * снимает, чужих не трогает. Перехода у высоты нет: поле растёт вместе с
26
+ * набором.
27
+ *
28
+ * **Ввод пользователя — синхронно**, в слушателе `input` поля: значение в
29
+ * узле уже новое, и высота встаёт до отрисовки. Остальное — значение из кода,
30
+ * `rows`, `maxRows`, `autoresize`, `size`, ширина поля и подгруженный шрифт
31
+ * (текст переносится иначе) — **кадром**: значение из кода фреймворк пишет в
32
+ * узел позже, чем ядро о нём сообщает, а размер меняет поля и кегль через
33
+ * класс. Ширину сообщает `ResizeObserver` — плагину важна только она: высоту
34
+ * поля меняет он сам.
35
+ *
36
+ * **Кадр — только при узле**: между `ready` и `removed` своего
37
+ * `TElementPlugin`. Сборка идёт и на сервере, и значение там меняется, а узла
38
+ * и `requestAnimationFrame` нет. Что сменилось до узла, применяет `ready` —
39
+ * сразу.
40
+ */
41
+ export declare class TTextareaAutoresizePlugin extends TBasePlugin<ITextarea, TTextareaAutoresizePluginEvents> {
42
+ private _owner;
43
+ /** Поле — `<textarea>` корня, пока узел корня объявлен */
44
+ private _field;
45
+ private _observer;
46
+ /** Ширина поля, о которой уже знает плагин: высоту меняет он сам */
47
+ private _width;
48
+ /** Стили поля писал плагин: при выключении автороста есть что снять */
49
+ private _applied;
50
+ /** Замер в следующем кадре; прежний отложенный отменяется. */
51
+ private readonly _fitNextFrame;
52
+ private readonly _onInput;
53
+ private readonly _onFonts;
54
+ constructor();
55
+ install(ctx: IPluginContext, options?: unknown): void;
56
+ destroy(): void;
57
+ private _attach;
58
+ private _detach;
59
+ /** Наблюдатель сообщил размер поля: замер нужен, только если сменилась ширина. */
60
+ private _resized;
61
+ /**
62
+ * Замерить кадром позже — пока у плагина есть поле. Без узла повод ничего
63
+ * не планирует: всё, что сменилось до узла, применит `ready`.
64
+ */
65
+ private _schedule;
66
+ /** Высота поля по тексту — или снять стили, если авторост выключен. */
67
+ private _fit;
68
+ /** Авторост выключен — снять то, что писал плагин; без его стилей — ничего. */
69
+ private _release;
70
+ }