@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,79 @@
1
+ import { TBasePlugin } from "../../../base/base.class.js";
2
+ import { TElementPlugin } from "../../element/element.plugin.js";
3
+ import { rowIn } from "../../list/row.js";
4
+ import { TMenuPopoverItemFocusPlugin } from "../popover-item-focus/focus.plugin.js";
5
+ //#region src/custom/menu/popover-item-keyboard/keyboard.plugin.ts
6
+ /**
7
+ * TMenuPopoverItemKeyboardPlugin — клавиатура строки пункта меню с панелью
8
+ * (`Menu.PopoverItem`, APG Menu: пункт со всплывающим окном).
9
+ *
10
+ * Стрелка к концу строки (в RTL ←) открывает панель, как у подменю, и
11
+ * гасится: меню над пунктом погашенную клавишу не трогает
12
+ * (`TMenuNavigationPlugin`). Фокус в панель уводит модель фокуса пункта — и
13
+ * после клавиши, и после клика. Панель уже открыта — её открыл указатель, и
14
+ * фокус остался на строке, — та же стрелка ведёт фокус в неё: модель фокуса
15
+ * пункта, взятая при установке (`focusPanel`). Так в открытую наведением
16
+ * панель с клавиатуры ведёт не только Tab, но и стрелка, как в подменю.
17
+ * Enter и пробел своих правил не требуют: строка — `Button` на `div`, и клик
18
+ * из них делает её `TActionPlugin`, а клик строки открывает панель —
19
+ * открытую не закрывает и фокус не двигает.
20
+ *
21
+ * Строка лежит в корне пункта, поэтому клавиши слушает корень, — и только со
22
+ * строки: клавиши содержимого слотов строки им и принадлежат. Сторона строки
23
+ * — по направлению письма меню, в котором стоит пункт.
24
+ *
25
+ * Выключенный пункт панель не открывает. Подсвеченным он не бывает, и фокуса
26
+ * на его строке с клавиатуры нет, — проверка на случай фокуса, который
27
+ * поставили кликом.
28
+ */
29
+ var TMenuPopoverItemKeyboardPlugin = class extends TBasePlugin {
30
+ _item = null;
31
+ /** Модель фокуса пункта: ведёт фокус в уже открытую панель. */
32
+ _focus = null;
33
+ /** Корень пункта — узел пункта в меню; строка лежит в нём. */
34
+ _root = null;
35
+ /** Тот же корень — под слушатель клавиш. */
36
+ _target = null;
37
+ install(ctx, options) {
38
+ super.install(ctx, options);
39
+ this._item = ctx.getInstance() ?? null;
40
+ this._focus = ctx.get(TMenuPopoverItemFocusPlugin) ?? null;
41
+ const elementPlugin = ctx.get(TElementPlugin);
42
+ elementPlugin?.events.on("ready", (element) => this._listen(element));
43
+ elementPlugin?.events.on("removed", () => this._unlisten());
44
+ }
45
+ destroy() {
46
+ this._unlisten();
47
+ this._item = null;
48
+ this._focus = null;
49
+ super.destroy();
50
+ }
51
+ _listen(element) {
52
+ this._unlisten();
53
+ const target = element;
54
+ this._root = element;
55
+ this._target = target;
56
+ target.addEventListener("keydown", this._onKeyDown);
57
+ }
58
+ _unlisten() {
59
+ this._target?.removeEventListener("keydown", this._onKeyDown);
60
+ this._target = null;
61
+ this._root = null;
62
+ }
63
+ /** Стрелка к концу строки на строке пункта — открыть панель, а открытую — фокус в неё. */
64
+ _onKeyDown = (e) => {
65
+ const root = this._root;
66
+ const item = this._item;
67
+ if (!root || !item || item.disabled || e.defaultPrevented) return;
68
+ if (e.target !== rowIn(root) || e.key !== this._toEnd(root)) return;
69
+ e.preventDefault();
70
+ if (item.open) this._focus?.focusPanel();
71
+ else item.open = true;
72
+ };
73
+ /** Стрелка к концу строки — по направлению строки пункта. */
74
+ _toEnd(root) {
75
+ return getComputedStyle(root).direction === "rtl" ? "ArrowLeft" : "ArrowRight";
76
+ }
77
+ };
78
+ //#endregion
79
+ export { TMenuPopoverItemKeyboardPlugin };
@@ -0,0 +1,2 @@
1
+ import type { TPluginEvents } from '../../../base';
2
+ export type TMenuPopoverItemKeyboardPluginEvents = TPluginEvents;
@@ -0,0 +1,27 @@
1
+ import { TBasePlugin } from '../../../base';
2
+ import type { IPluginContext } from '../../../base';
3
+ /**
4
+ * TMenuPopupIdsPlugin — связка «пункт ↔ его панель» в документе: у пункта с
5
+ * подменю (APG Menu) и у пункта с панелью (APG: пункт со всплывающим окном).
6
+ *
7
+ * Обе стороны ссылаются друг на друга: у строки пункта — `id` и
8
+ * `aria-controls` на панель (`aria` пункта, его разметка раскладывает на
9
+ * строку), у панели — `id` и `aria-labelledby` на строку (`panelAria`). Имя
10
+ * панели — текст пункта: скринридер объявляет «Поделиться, меню» и «Срок,
11
+ * диалог». Пишутся обе стороны здесь: формула одна на обе — и на оба вида
12
+ * пункта, чья панель меню или диалог.
13
+ *
14
+ * `id` строки, заданный приложением (`TIdPlugin` пункта), главнее: он и
15
+ * встаёт на строку, и на него ссылается панель. Сменили — плагин
16
+ * переписывает обе стороны ссылки на строку, сняли — снова `id` от
17
+ * монтирования. У панели `id` приложения нет, её `id` — формула.
18
+ *
19
+ * Без него — `id` от монтирования (`createId`), а не от экземпляра: он нужен
20
+ * только документу, и на сервере и в браузере обязан совпасть. Пишется при
21
+ * установке, синхронно, — связка есть уже в первой (и серверной) отрисовке.
22
+ * Ссылки стоят и у закрытой панели: панель всегда в документе, закрытие её
23
+ * только прячет.
24
+ */
25
+ export declare class TMenuPopupIdsPlugin extends TBasePlugin {
26
+ install(ctx: IPluginContext): void;
27
+ }
@@ -0,0 +1,47 @@
1
+ import { TBasePlugin } from "../../../base/base.class.js";
2
+ import { TIdPlugin } from "../../id/id.plugin.js";
3
+ //#region src/custom/menu/popup-ids/ids.plugin.ts
4
+ /**
5
+ * TMenuPopupIdsPlugin — связка «пункт ↔ его панель» в документе: у пункта с
6
+ * подменю (APG Menu) и у пункта с панелью (APG: пункт со всплывающим окном).
7
+ *
8
+ * Обе стороны ссылаются друг на друга: у строки пункта — `id` и
9
+ * `aria-controls` на панель (`aria` пункта, его разметка раскладывает на
10
+ * строку), у панели — `id` и `aria-labelledby` на строку (`panelAria`). Имя
11
+ * панели — текст пункта: скринридер объявляет «Поделиться, меню» и «Срок,
12
+ * диалог». Пишутся обе стороны здесь: формула одна на обе — и на оба вида
13
+ * пункта, чья панель меню или диалог.
14
+ *
15
+ * `id` строки, заданный приложением (`TIdPlugin` пункта), главнее: он и
16
+ * встаёт на строку, и на него ссылается панель. Сменили — плагин
17
+ * переписывает обе стороны ссылки на строку, сняли — снова `id` от
18
+ * монтирования. У панели `id` приложения нет, её `id` — формула.
19
+ *
20
+ * Без него — `id` от монтирования (`createId`), а не от экземпляра: он нужен
21
+ * только документу, и на сервере и в браузере обязан совпасть. Пишется при
22
+ * установке, синхронно, — связка есть уже в первой (и серверной) отрисовке.
23
+ * Ссылки стоят и у закрытой панели: панель всегда в документе, закрытие её
24
+ * только прячет.
25
+ */
26
+ var TMenuPopupIdsPlugin = class extends TBasePlugin {
27
+ install(ctx) {
28
+ super.install(ctx);
29
+ const item = ctx.getInstance();
30
+ if (!item) return;
31
+ const idPlugin = ctx.get(TIdPlugin);
32
+ const mountId = ctx.createId("row");
33
+ const panelId = ctx.createId("panel");
34
+ /** Обе стороны ссылки на строку: её `id` и `aria-labelledby` панели. */
35
+ const linkRow = () => {
36
+ const rowId = idPlugin?.id ?? mountId;
37
+ item.aria.add("id", rowId);
38
+ item.panelAria.add("aria-labelledby", rowId);
39
+ };
40
+ item.panelAria.add("id", panelId);
41
+ linkRow();
42
+ item.aria.add("aria-controls", panelId);
43
+ idPlugin?.events.on("change:id", linkRow);
44
+ }
45
+ };
46
+ //#endregion
47
+ export { TMenuPopupIdsPlugin };
@@ -0,0 +1 @@
1
+ export { TMenuPopupIdsPlugin } from './ids.plugin';
@@ -0,0 +1,53 @@
1
+ import type { IPluginContext } from '../../../base';
2
+ import { TOverlayFocusPlugin } from '../../overlay/focus';
3
+ import type { IOverlayOpenOptions } from '../../overlay/types';
4
+ import type { TMenuSubmenuFocusPluginEvents } from './types';
5
+ /**
6
+ * TMenuSubmenuFocusPlugin — модель фокуса подменю: уровня меню, открытого со
7
+ * строки пункта (APG Menu).
8
+ *
9
+ * Общее у оверлеев — запомнить, откуда открыли, увести фокус в панель кадром
10
+ * позже, вернуть его при закрытии, закрыться по Escape и погасить его, —
11
+ * лежит в `TOverlayFocusPlugin`. Открывают подменю со строки пункта, поэтому
12
+ * запомнена и возвращается фокусу она. Своё у подменю:
13
+ *
14
+ * - **куда при открытии.** Открыли клавишей — подсвечен первый пункт
15
+ * (`TMenuSubmenuKeyboardPlugin`), и фокус встаёт на его строку. Открыли
16
+ * указателем — наведением или нажатием строки — фокус остаётся на строке:
17
+ * в панель он входит указателем, а клавишами — стрелкой к концу строки;
18
+ * - **закрыть уровень.** Escape — один уровень: подменю закрывается, фокус
19
+ * возвращается на его строку, меню над ним открыто. Клавишу гасит
20
+ * `preventDefault`, и меню над подменю её пропускает, как слои Select в
21
+ * поповере;
22
+ * - **возвращать ли фокус.** Только когда фокус ещё в подменю или нигде
23
+ * (`holdsFocus`): подменю, закрытое вместе с меню (выбор пункта), не тянет
24
+ * его на строку спрятанной панели — меню уже вернуло его на триггер.
25
+ * Нажатие и уход фокуса мимо фокус не возвращают, как у Popover:
26
+ * пользователь уже там, куда нажал или навёл;
27
+ * - **Tab.** Закрывает все меню (APG) и ведёт к остановке за корнем меню, а
28
+ * корня подменю не знает. Поэтому подменю сообщает о Tab меню над собой
29
+ * (`tab`), а то — дальше, до корня (`TMenuFocusPlugin`): тот закрывается и
30
+ * ведёт фокус, как Tab из своей панели. Так же доходит Tab из слоёв под
31
+ * подменю — его подменю и панелей его пунктов. Подписка — через реестр
32
+ * наборов коллекции (`listenNestedTabs`).
33
+ */
34
+ export declare class TMenuSubmenuFocusPlugin extends TOverlayFocusPlugin<TMenuSubmenuFocusPluginEvents> {
35
+ private _navigation;
36
+ install(ctx: IPluginContext, options?: IOverlayOpenOptions): void;
37
+ destroy(): void;
38
+ /** Фокус при открытии — строке подсвеченного пункта, без подсветки остаётся на строке. */
39
+ protected _focusCandidates(_panel: Element): readonly Element[];
40
+ /** Запомненного элемента нет — фокус на строку пункта. */
41
+ protected _returnCandidates(root: Element): readonly Element[];
42
+ /** Возвращать фокус, только пока он в подменю или нигде. */
43
+ protected _returnsFocus(root: Element): boolean;
44
+ /** Tab в подменю — меню над ним: куда вести фокус, решает корень. */
45
+ protected _onTab(event: KeyboardEvent): void;
46
+ }
47
+ /**
48
+ * Слушать Tab вложенных слоёв этого меню — подменю и панелей пунктов с
49
+ * панелью: их модели фокуса сообщают о нём событием (`tab`), а их наборы
50
+ * лежат в реестре коллекции. Подписка — прямым `on`: шина плагина элемента
51
+ * умирает вместе с его набором.
52
+ */
53
+ export declare function listenNestedTabs(ctx: IPluginContext, onTab: (event: KeyboardEvent) => void): void;
@@ -0,0 +1,84 @@
1
+ import { TCollectionBundlesPlugin } from "../../collection/bundles.plugin.js";
2
+ import { rowIn } from "../../list/row.js";
3
+ import { TDismissPlugin } from "../../dismiss/dismiss.plugin.js";
4
+ import { TOverlayFocusPlugin } from "../../overlay/focus/focus.plugin.js";
5
+ import { TMenuSubmenuKeyboardPlugin } from "../submenu-keyboard/keyboard.plugin.js";
6
+ import { holdsFocus } from "../nested-layer.js";
7
+ import { TMenuPopoverItemFocusPlugin } from "../popover-item-focus/focus.plugin.js";
8
+ //#region src/custom/menu/submenu-focus/focus.plugin.ts
9
+ /**
10
+ * TMenuSubmenuFocusPlugin — модель фокуса подменю: уровня меню, открытого со
11
+ * строки пункта (APG Menu).
12
+ *
13
+ * Общее у оверлеев — запомнить, откуда открыли, увести фокус в панель кадром
14
+ * позже, вернуть его при закрытии, закрыться по Escape и погасить его, —
15
+ * лежит в `TOverlayFocusPlugin`. Открывают подменю со строки пункта, поэтому
16
+ * запомнена и возвращается фокусу она. Своё у подменю:
17
+ *
18
+ * - **куда при открытии.** Открыли клавишей — подсвечен первый пункт
19
+ * (`TMenuSubmenuKeyboardPlugin`), и фокус встаёт на его строку. Открыли
20
+ * указателем — наведением или нажатием строки — фокус остаётся на строке:
21
+ * в панель он входит указателем, а клавишами — стрелкой к концу строки;
22
+ * - **закрыть уровень.** Escape — один уровень: подменю закрывается, фокус
23
+ * возвращается на его строку, меню над ним открыто. Клавишу гасит
24
+ * `preventDefault`, и меню над подменю её пропускает, как слои Select в
25
+ * поповере;
26
+ * - **возвращать ли фокус.** Только когда фокус ещё в подменю или нигде
27
+ * (`holdsFocus`): подменю, закрытое вместе с меню (выбор пункта), не тянет
28
+ * его на строку спрятанной панели — меню уже вернуло его на триггер.
29
+ * Нажатие и уход фокуса мимо фокус не возвращают, как у Popover:
30
+ * пользователь уже там, куда нажал или навёл;
31
+ * - **Tab.** Закрывает все меню (APG) и ведёт к остановке за корнем меню, а
32
+ * корня подменю не знает. Поэтому подменю сообщает о Tab меню над собой
33
+ * (`tab`), а то — дальше, до корня (`TMenuFocusPlugin`): тот закрывается и
34
+ * ведёт фокус, как Tab из своей панели. Так же доходит Tab из слоёв под
35
+ * подменю — его подменю и панелей его пунктов. Подписка — через реестр
36
+ * наборов коллекции (`listenNestedTabs`).
37
+ */
38
+ var TMenuSubmenuFocusPlugin = class extends TOverlayFocusPlugin {
39
+ _navigation = null;
40
+ install(ctx, options) {
41
+ super.install(ctx, options);
42
+ this._navigation = ctx.get(TMenuSubmenuKeyboardPlugin) ?? null;
43
+ ctx.get(TDismissPlugin)?.events.on("dismiss", () => {
44
+ this._restore = false;
45
+ });
46
+ listenNestedTabs(ctx, (event) => this.events.emit("tab", event));
47
+ }
48
+ destroy() {
49
+ this._navigation = null;
50
+ super.destroy();
51
+ }
52
+ /** Фокус при открытии — строке подсвеченного пункта, без подсветки остаётся на строке. */
53
+ _focusCandidates(_panel) {
54
+ const row = this._navigation?.highlightedRow;
55
+ return row ? [row] : [];
56
+ }
57
+ /** Запомненного элемента нет — фокус на строку пункта. */
58
+ _returnCandidates(root) {
59
+ const row = rowIn(root);
60
+ return row ? [row] : [];
61
+ }
62
+ /** Возвращать фокус, только пока он в подменю или нигде. */
63
+ _returnsFocus(root) {
64
+ return holdsFocus(root, this._dismiss);
65
+ }
66
+ /** Tab в подменю — меню над ним: куда вести фокус, решает корень. */
67
+ _onTab(event) {
68
+ this.events.emit("tab", event);
69
+ }
70
+ };
71
+ /**
72
+ * Слушать Tab вложенных слоёв этого меню — подменю и панелей пунктов с
73
+ * панелью: их модели фокуса сообщают о нём событием (`tab`), а их наборы
74
+ * лежат в реестре коллекции. Подписка — прямым `on`: шина плагина элемента
75
+ * умирает вместе с его набором.
76
+ */
77
+ function listenNestedTabs(ctx, onTab) {
78
+ ctx.get(TCollectionBundlesPlugin)?.events.on("bundle:registered", ({ bundle }) => {
79
+ bundle.get(TMenuSubmenuFocusPlugin)?.events.on("tab", onTab);
80
+ bundle.get(TMenuPopoverItemFocusPlugin)?.events.on("tab", onTab);
81
+ });
82
+ }
83
+ //#endregion
84
+ export { TMenuSubmenuFocusPlugin, listenNestedTabs };
@@ -0,0 +1,2 @@
1
+ export { TMenuSubmenuFocusPlugin } from './focus.plugin';
2
+ export type { TMenuSubmenuFocusPluginEvents } from './types';
@@ -0,0 +1,10 @@
1
+ import type { TPluginEvents } from '../../../base';
2
+ export type TMenuSubmenuFocusPluginEvents = TPluginEvents & {
3
+ /**
4
+ * Tab в подменю — в его панели, на его строке или в подменю ниже: меню
5
+ * закрывается целиком, и фокус уходит, как Tab из панели корня (APG Menu).
6
+ * Куда — знает только корень, поэтому подменю сообщает о Tab меню над
7
+ * собой, а корень гасит клавишу, если повёл фокус сам
8
+ */
9
+ tab: (event: KeyboardEvent) => void;
10
+ };
@@ -0,0 +1,2 @@
1
+ export { TMenuSubmenuKeyboardPlugin } from './keyboard.plugin';
2
+ export type { TMenuSubmenuKeyboardPluginEvents } from './types';
@@ -0,0 +1,43 @@
1
+ import type { IPluginContext } from '../../../base';
2
+ import { TMenuNavigationPlugin } from '../navigation';
3
+ import type { TMenuSubmenuKeyboardPluginEvents } from './types';
4
+ /**
5
+ * TMenuSubmenuKeyboardPlugin — клавиатура пункта с подменю: клавиши его
6
+ * строки в меню над ним и его собственной панели (APG Menu).
7
+ *
8
+ * Панель — общая с меню (`TMenuNavigationPlugin`): фокус идёт за подсветкой,
9
+ * ↑/↓ по кругу, Home и End, набор по первым буквам. Своё у подменю — две
10
+ * границы уровня:
11
+ *
12
+ * - **открыть** — стрелка к концу строки (в RTL ←), Enter и пробел на строке
13
+ * пункта: подменю открывается на первом пункте, и фокус уходит на него.
14
+ * Строка лежит в корне пункта, поэтому клавиши слушает корень, — и только
15
+ * со строки: клавиши содержимого слотов строки им и принадлежат. Клавиша
16
+ * гасится: Enter и пробел иначе нажали бы строку, а клик открыл бы
17
+ * подменю ещё раз, без подсветки, — и меню над ним её не трогает
18
+ * (`defaultPrevented`): пробел подменю открывает и тогда, когда в меню над
19
+ * ним идёт набор по буквам;
20
+ * - **закрыть** — стрелка к началу строки (в RTL →) в панели подменю: уровень
21
+ * закрывается, фокус возвращается на строку пункта (модель фокуса подменю).
22
+ * Escape делает то же — его ведёт модель фокуса, как у любого слоя.
23
+ *
24
+ * Сторона строки — по направлению письма: у строки — направление меню над
25
+ * подменю, у панели — своё.
26
+ *
27
+ * Выключенный пункт подменю не открывает. Подсвеченным он не бывает, и
28
+ * фокуса на его строке с клавиатуры нет, — проверка на случай фокуса, который
29
+ * поставили кликом.
30
+ */
31
+ export declare class TMenuSubmenuKeyboardPlugin extends TMenuNavigationPlugin<TMenuSubmenuKeyboardPluginEvents> {
32
+ private _submenu;
33
+ /** Корень пункта — узел пункта в меню над подменю; строка лежит в нём. */
34
+ private _root;
35
+ install(ctx: IPluginContext, options?: unknown): void;
36
+ destroy(): void;
37
+ /** Клавиши строки пункта: открыть подменю на первом пункте. */
38
+ protected onKeyDown(e: KeyboardEvent): void;
39
+ /** Стрелка к началу строки в панели — закрыть уровень. */
40
+ protected onPanelKey(e: KeyboardEvent): boolean;
41
+ /** Стрелка к концу строки — по направлению строки пункта. */
42
+ private _toEnd;
43
+ }
@@ -0,0 +1,74 @@
1
+ import { TElementPlugin } from "../../element/element.plugin.js";
2
+ import { rowIn } from "../../list/row.js";
3
+ import { TMenuNavigationPlugin } from "../navigation/navigation.plugin.js";
4
+ //#region src/custom/menu/submenu-keyboard/keyboard.plugin.ts
5
+ /**
6
+ * TMenuSubmenuKeyboardPlugin — клавиатура пункта с подменю: клавиши его
7
+ * строки в меню над ним и его собственной панели (APG Menu).
8
+ *
9
+ * Панель — общая с меню (`TMenuNavigationPlugin`): фокус идёт за подсветкой,
10
+ * ↑/↓ по кругу, Home и End, набор по первым буквам. Своё у подменю — две
11
+ * границы уровня:
12
+ *
13
+ * - **открыть** — стрелка к концу строки (в RTL ←), Enter и пробел на строке
14
+ * пункта: подменю открывается на первом пункте, и фокус уходит на него.
15
+ * Строка лежит в корне пункта, поэтому клавиши слушает корень, — и только
16
+ * со строки: клавиши содержимого слотов строки им и принадлежат. Клавиша
17
+ * гасится: Enter и пробел иначе нажали бы строку, а клик открыл бы
18
+ * подменю ещё раз, без подсветки, — и меню над ним её не трогает
19
+ * (`defaultPrevented`): пробел подменю открывает и тогда, когда в меню над
20
+ * ним идёт набор по буквам;
21
+ * - **закрыть** — стрелка к началу строки (в RTL →) в панели подменю: уровень
22
+ * закрывается, фокус возвращается на строку пункта (модель фокуса подменю).
23
+ * Escape делает то же — его ведёт модель фокуса, как у любого слоя.
24
+ *
25
+ * Сторона строки — по направлению письма: у строки — направление меню над
26
+ * подменю, у панели — своё.
27
+ *
28
+ * Выключенный пункт подменю не открывает. Подсвеченным он не бывает, и
29
+ * фокуса на его строке с клавиатуры нет, — проверка на случай фокуса, который
30
+ * поставили кликом.
31
+ */
32
+ var TMenuSubmenuKeyboardPlugin = class extends TMenuNavigationPlugin {
33
+ _submenu = null;
34
+ /** Корень пункта — узел пункта в меню над подменю; строка лежит в нём. */
35
+ _root = null;
36
+ install(ctx, options) {
37
+ super.install(ctx, options);
38
+ this._submenu = ctx.getInstance() ?? null;
39
+ const elementPlugin = ctx.get(TElementPlugin);
40
+ elementPlugin?.events.on("ready", (element) => {
41
+ this._root = element;
42
+ });
43
+ elementPlugin?.events.on("removed", () => {
44
+ this._root = null;
45
+ });
46
+ }
47
+ destroy() {
48
+ this._submenu = null;
49
+ this._root = null;
50
+ super.destroy();
51
+ }
52
+ /** Клавиши строки пункта: открыть подменю на первом пункте. */
53
+ onKeyDown(e) {
54
+ const root = this._root;
55
+ if (!root || e.target !== rowIn(root) || this._submenu?.disabled) return;
56
+ if (e.key === "Enter" || e.key === " " || e.key === this._toEnd(root)) {
57
+ e.preventDefault();
58
+ this.openAt("first");
59
+ }
60
+ }
61
+ /** Стрелка к началу строки в панели — закрыть уровень. */
62
+ onPanelKey(e) {
63
+ const submenu = this._submenu;
64
+ if (!submenu || e.key !== (this.isRtl() ? "ArrowRight" : "ArrowLeft")) return false;
65
+ submenu.open = false;
66
+ return true;
67
+ }
68
+ /** Стрелка к концу строки — по направлению строки пункта. */
69
+ _toEnd(root) {
70
+ return getComputedStyle(root).direction === "rtl" ? "ArrowLeft" : "ArrowRight";
71
+ }
72
+ };
73
+ //#endregion
74
+ export { TMenuSubmenuKeyboardPlugin };
@@ -0,0 +1,2 @@
1
+ import type { TMenuNavigationPluginEvents } from '../navigation';
2
+ export type TMenuSubmenuKeyboardPluginEvents = TMenuNavigationPluginEvents;
@@ -0,0 +1,5 @@
1
+ export * from './keyboard';
2
+ export * from './names';
3
+ export * from './stepper';
4
+ export * from './touch';
5
+ export * from './typing';
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ export * from './keyboard.plugin';
@@ -0,0 +1,36 @@
1
+ import type { INumberInput } from '@soxa-ui/core';
2
+ import { TBasePlugin } from '../../../base';
3
+ import type { IPluginContext } from '../../../base';
4
+ import type { TNumberInputKeyboardPluginEvents } from './types';
5
+ /**
6
+ * TNumberInputKeyboardPlugin — клавиши поля числа (APG, Spinbutton): шаг,
7
+ * крупный шаг и границы.
8
+ *
9
+ * - **↑/↓** — шаг (`shift`), с Shift — крупный шаг (`largeStep` шагов);
10
+ * - **PageUp/PageDown** — крупный шаг;
11
+ * - **Home/End** — к заданной границе (`moveToEdge`); границы нет — клавиша
12
+ * браузера: каретка в начало или конец текста. С Shift — тоже браузера:
13
+ * выделение до края;
14
+ * - **Enter** — конец набора (`commit`), без `preventDefault`: Enter в поле
15
+ * формы отправляет её, и значение уходит в форму уже законченным.
16
+ *
17
+ * Каждая клавиша шага — законченное действие: шаг и `commit()`. Обработанная
18
+ * клавиша гасится `preventDefault` — иначе стрелка увела бы каретку, а PageDown
19
+ * прокрутил бы страницу. У выключенного поля и только для чтения команды
20
+ * ничего не меняют, а клавиши всё равно гасятся: счётчик своими стрелками
21
+ * текст не листает.
22
+ *
23
+ * Клавиши берутся только с самого ввода, мимо композиции IME и мимо
24
+ * Alt/Ctrl/Meta — это чужие жесты: Ctrl+Home у браузера, Alt+↓ у оверлеев.
25
+ */
26
+ export declare class TNumberInputKeyboardPlugin extends TBasePlugin<INumberInput, TNumberInputKeyboardPluginEvents> {
27
+ private _owner;
28
+ private _root;
29
+ install(ctx: IPluginContext): void;
30
+ destroy(): void;
31
+ /** Корень сменился — слушатель переезжает. */
32
+ private _bind;
33
+ private readonly _onKeyDown;
34
+ /** Что клавиша делает с числом; не клавиша поля — `null`, её обработает браузер. */
35
+ private _actionOf;
36
+ }
@@ -0,0 +1,80 @@
1
+ import { TBasePlugin } from "../../../base/base.class.js";
2
+ import { TElementPlugin } from "../../element/element.plugin.js";
3
+ import { isInputOf } from "../parts.js";
4
+ //#region src/custom/number-input/keyboard/keyboard.plugin.ts
5
+ /** Края клавиш Home и End. Без границы на краю клавиша — каретки. */
6
+ var EDGES = /* @__PURE__ */ new Map([["Home", "start"], ["End", "end"]]);
7
+ /**
8
+ * TNumberInputKeyboardPlugin — клавиши поля числа (APG, Spinbutton): шаг,
9
+ * крупный шаг и границы.
10
+ *
11
+ * - **↑/↓** — шаг (`shift`), с Shift — крупный шаг (`largeStep` шагов);
12
+ * - **PageUp/PageDown** — крупный шаг;
13
+ * - **Home/End** — к заданной границе (`moveToEdge`); границы нет — клавиша
14
+ * браузера: каретка в начало или конец текста. С Shift — тоже браузера:
15
+ * выделение до края;
16
+ * - **Enter** — конец набора (`commit`), без `preventDefault`: Enter в поле
17
+ * формы отправляет её, и значение уходит в форму уже законченным.
18
+ *
19
+ * Каждая клавиша шага — законченное действие: шаг и `commit()`. Обработанная
20
+ * клавиша гасится `preventDefault` — иначе стрелка увела бы каретку, а PageDown
21
+ * прокрутил бы страницу. У выключенного поля и только для чтения команды
22
+ * ничего не меняют, а клавиши всё равно гасятся: счётчик своими стрелками
23
+ * текст не листает.
24
+ *
25
+ * Клавиши берутся только с самого ввода, мимо композиции IME и мимо
26
+ * Alt/Ctrl/Meta — это чужие жесты: Ctrl+Home у браузера, Alt+↓ у оверлеев.
27
+ */
28
+ var TNumberInputKeyboardPlugin = class extends TBasePlugin {
29
+ _owner = null;
30
+ _root = null;
31
+ install(ctx) {
32
+ super.install(ctx);
33
+ this._owner = ctx.getInstance() ?? null;
34
+ const elementPlugin = ctx.get(TElementPlugin);
35
+ elementPlugin?.events.on("ready", (element) => this._bind(element));
36
+ elementPlugin?.events.on("removed", () => this._bind(null));
37
+ }
38
+ destroy() {
39
+ this._bind(null);
40
+ this._owner = null;
41
+ super.destroy();
42
+ }
43
+ /** Корень сменился — слушатель переезжает. */
44
+ _bind(root) {
45
+ this._root?.removeEventListener("keydown", this._onKeyDown);
46
+ this._root = root;
47
+ root?.addEventListener("keydown", this._onKeyDown);
48
+ }
49
+ _onKeyDown = (event) => {
50
+ const owner = this._owner;
51
+ const root = this._root;
52
+ if (!owner || !root || event.defaultPrevented || event.isComposing) return;
53
+ if (event.altKey || event.ctrlKey || event.metaKey) return;
54
+ if (!isInputOf(owner, root, event.target)) return;
55
+ if (event.key === "Enter") {
56
+ owner.commit();
57
+ return;
58
+ }
59
+ const action = this._actionOf(owner, event);
60
+ if (!action) return;
61
+ event.preventDefault();
62
+ action();
63
+ owner.commit();
64
+ };
65
+ /** Что клавиша делает с числом; не клавиша поля — `null`, её обработает браузер. */
66
+ _actionOf(owner, event) {
67
+ const large = owner.largeStep;
68
+ switch (event.key) {
69
+ case "ArrowUp": return () => owner.shift(event.shiftKey ? large : 1);
70
+ case "ArrowDown": return () => owner.shift(event.shiftKey ? -large : -1);
71
+ case "PageUp": return () => owner.shift(large);
72
+ case "PageDown": return () => owner.shift(-large);
73
+ }
74
+ const edge = EDGES.get(event.key);
75
+ if (edge === void 0 || event.shiftKey) return null;
76
+ return (edge === "start" ? owner.min : owner.max) === void 0 ? null : () => owner.moveToEdge(edge);
77
+ }
78
+ };
79
+ //#endregion
80
+ export { TNumberInputKeyboardPlugin };
@@ -0,0 +1,3 @@
1
+ import type { TPluginEvents } from '../../../base';
2
+ /** Своих событий у плагина нет: шаг виден в значении ядра, его конец — в `commit`. */
3
+ export type TNumberInputKeyboardPluginEvents = TPluginEvents;
@@ -0,0 +1 @@
1
+ export { TNumberInputNamesPlugin } from './names.plugin';
@@ -0,0 +1,17 @@
1
+ import type { INumberInput } from '@soxa-ui/core';
2
+ import { TClearableNamesPlugin } from '../../clearable/names';
3
+ import type { TTranslations } from '../../../locale/types';
4
+ /**
5
+ * TNumberInputNamesPlugin — имена кнопок поля числа от локали, вместе с именем
6
+ * поля: «Увеличить Количество», «Уменьшить Количество», «Очистить Количество».
7
+ *
8
+ * Кнопки шага не остановки Tab, но скринридер их находит и жмёт, и на форме с
9
+ * тремя полями числа шесть одинаковых «Увеличить, кнопка» не различить. Как имя
10
+ * складывается с именем поля, решают шаблоны локали (`numberInput.increment`,
11
+ * `numberInput.decrement`). Имя кнопки очистки — как у любого поля
12
+ * (`TClearableNamesPlugin`): плагин имён у компонента один, и наследник пишет
13
+ * имена всех его кнопок.
14
+ */
15
+ export declare class TNumberInputNamesPlugin extends TClearableNamesPlugin<INumberInput> {
16
+ protected _name(owner: INumberInput, translations: TTranslations): void;
17
+ }
@@ -0,0 +1,24 @@
1
+ import { formatName } from "../../../locale/locale.js";
2
+ import { TClearableNamesPlugin } from "../../clearable/names/names.plugin.js";
3
+ //#region src/custom/number-input/names/names.plugin.ts
4
+ /**
5
+ * TNumberInputNamesPlugin — имена кнопок поля числа от локали, вместе с именем
6
+ * поля: «Увеличить Количество», «Уменьшить Количество», «Очистить Количество».
7
+ *
8
+ * Кнопки шага не остановки Tab, но скринридер их находит и жмёт, и на форме с
9
+ * тремя полями числа шесть одинаковых «Увеличить, кнопка» не различить. Как имя
10
+ * складывается с именем поля, решают шаблоны локали (`numberInput.increment`,
11
+ * `numberInput.decrement`). Имя кнопки очистки — как у любого поля
12
+ * (`TClearableNamesPlugin`): плагин имён у компонента один, и наследник пишет
13
+ * имена всех его кнопок.
14
+ */
15
+ var TNumberInputNamesPlugin = class extends TClearableNamesPlugin {
16
+ _name(owner, translations) {
17
+ super._name(owner, translations);
18
+ const { increment, decrement } = translations.numberInput;
19
+ owner.decrementAria.add("aria-label", formatName(decrement, owner.name));
20
+ owner.incrementAria.add("aria-label", formatName(increment, owner.name));
21
+ }
22
+ };
23
+ //#endregion
24
+ export { TNumberInputNamesPlugin };