@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,21 @@
1
+ import type { INumberInput } from '@soxa-ui/core';
2
+ import type { TNumberInputButton } from './types';
3
+ /**
4
+ * Узлы поля числа — один поиск на все плагины поля: набор, клавиши, кнопки
5
+ * шага и сенсорный режим находят ввод и кнопки одинаково.
6
+ *
7
+ * Узлы находят по классам владельца (`classes.resolve`), а не строкой в
8
+ * плагине, и только внутри его корня. Ввод — по своему классу: рядом в корне
9
+ * лежит скрытое поле формы.
10
+ */
11
+ /** Ввод поля — `__input` в корне. */
12
+ export declare function inputOf(owner: INumberInput, root: Element): HTMLInputElement | null;
13
+ /** Цель события — ввод этого поля, а не поле в слоте и не кнопка. */
14
+ export declare function isInputOf(owner: INumberInput, root: Element, target: EventTarget | null): target is HTMLInputElement;
15
+ /**
16
+ * Кнопка шага, в узле которой лежит `target`: «меньше» (`__decrement`) или
17
+ * «больше» (`__increment`). Не кнопка шага этого поля — `undefined`.
18
+ */
19
+ export declare function buttonOf(owner: INumberInput, root: Element, target: EventTarget | null): TNumberInputButton | undefined;
20
+ /** Выключена ли кнопка шага в эту сторону — у края, выключенного поля и только для чтения. */
21
+ export declare function isButtonDisabled(owner: INumberInput, direction: 1 | -1): boolean;
@@ -0,0 +1,39 @@
1
+ //#region src/custom/number-input/parts.ts
2
+ /**
3
+ * Узлы поля числа — один поиск на все плагины поля: набор, клавиши, кнопки
4
+ * шага и сенсорный режим находят ввод и кнопки одинаково.
5
+ *
6
+ * Узлы находят по классам владельца (`classes.resolve`), а не строкой в
7
+ * плагине, и только внутри его корня. Ввод — по своему классу: рядом в корне
8
+ * лежит скрытое поле формы.
9
+ */
10
+ /** Ввод поля — `__input` в корне. */
11
+ function inputOf(owner, root) {
12
+ const input = root.querySelector(owner.classes.resolve("__input", { point: true }));
13
+ return input instanceof HTMLInputElement ? input : null;
14
+ }
15
+ /** Цель события — ввод этого поля, а не поле в слоте и не кнопка. */
16
+ function isInputOf(owner, root, target) {
17
+ return target !== null && target === inputOf(owner, root);
18
+ }
19
+ /**
20
+ * Кнопка шага, в узле которой лежит `target`: «меньше» (`__decrement`) или
21
+ * «больше» (`__increment`). Не кнопка шага этого поля — `undefined`.
22
+ */
23
+ function buttonOf(owner, root, target) {
24
+ if (!(target instanceof Element)) return void 0;
25
+ for (const direction of [-1, 1]) {
26
+ const entry = direction > 0 ? "__increment" : "__decrement";
27
+ const element = target.closest(owner.classes.resolve(entry, { point: true }));
28
+ if (element && root.contains(element)) return {
29
+ direction,
30
+ element
31
+ };
32
+ }
33
+ }
34
+ /** Выключена ли кнопка шага в эту сторону — у края, выключенного поля и только для чтения. */
35
+ function isButtonDisabled(owner, direction) {
36
+ return direction > 0 ? owner.incrementDisabled : owner.decrementDisabled;
37
+ }
38
+ //#endregion
39
+ export { buttonOf, inputOf, isButtonDisabled, isInputOf };
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ export * from './stepper.plugin';
@@ -0,0 +1,59 @@
1
+ import type { INumberInput } from '@soxa-ui/core';
2
+ import { TBasePlugin } from '../../../base';
3
+ import type { IPluginContext } from '../../../base';
4
+ import type { INumberInputStepperPluginOptions, TNumberInputStepperPluginEvents } from './types';
5
+ /**
6
+ * TNumberInputStepperPlugin — кнопки шага «меньше» и «больше»: нажатие,
7
+ * удержание и активация скринридером.
8
+ *
9
+ * **Нажатие** основной кнопкой на включённой кнопке шага гасится
10
+ * (`preventDefault`): фокус остаётся во вводе, и кольцо поля не гаснет, а
11
+ * текст не выделяется. Мышь и перо ставят фокус во ввод, если его там не было,
12
+ * — клавиши продолжают с того же числа; палец — нет. Шаг — сразу, а пока
13
+ * кнопку держат, через `repeatDelay` он повторяется каждые `repeatInterval`
14
+ * до края. Пока держат, у кнопки `data-pressed` в её наборе (`incrementDataset`,
15
+ * `decrementDataset`): удержание видно и там, где браузер у погашенного нажатия
16
+ * не ставит `:active`.
17
+ *
18
+ * **Конец удержания** — отпускание, отмена указателя (палец увёл прокрутку),
19
+ * уход указателя с кнопки, выключенная кнопка (край, `disabled`, `readonly`) и
20
+ * снятый узел. Удержание — одно действие: `commit()` в конце, одно событие
21
+ * `commit` на всю серию шагов.
22
+ *
23
+ * **Скринридер** жмёт кнопку без указателя — `click` с `detail === 0`: шаг и
24
+ * `commit()`. Клик мышью кончает нажатие, уже исполненное, и шага не делает.
25
+ * Контекстное меню над кнопкой гасится: долгое касание — удержание, а не меню.
26
+ *
27
+ * Кнопки — по классам владельца в его корне; слушатели — на корне.
28
+ */
29
+ export declare class TNumberInputStepperPlugin extends TBasePlugin<INumberInput, TNumberInputStepperPluginEvents> {
30
+ private _owner;
31
+ private _root;
32
+ private _hold;
33
+ private _repeatDelay;
34
+ private _repeatInterval;
35
+ install(ctx: IPluginContext, options?: INumberInputStepperPluginOptions): void;
36
+ destroy(): void;
37
+ /** Корень сменился — слушатели переезжают; удержание на снятом узле кончается. */
38
+ private _bind;
39
+ private readonly _onPointerDown;
40
+ private readonly _onPointerUp;
41
+ /** Указатель ушёл с кнопки — не на её же значок, а наружу. */
42
+ private readonly _onPointerOut;
43
+ /** Нажатие без указателя — скринридер или клавиша на кнопке: один шаг. */
44
+ private readonly _onClick;
45
+ private readonly _onContextMenu;
46
+ /** Кнопка выключилась под удержанием — удержание кончено. */
47
+ private readonly _onLock;
48
+ /** Нажали: шаг сразу, `data-pressed`, а через задержку — повтор. */
49
+ private _press;
50
+ /** Повтор шага, пока держат. */
51
+ private readonly _repeat;
52
+ /**
53
+ * Шаг удержания. Дошёл до края — кнопка выключена, и удержание кончено; край
54
+ * значения, записанного снаружи, следующий шаг увидит так же.
55
+ */
56
+ private _step;
57
+ /** Отпустили: повтора нет, `data-pressed` снят, действие закрыто — `commit()`. */
58
+ private _release;
59
+ }
@@ -0,0 +1,166 @@
1
+ import { TBasePlugin } from "../../../base/base.class.js";
2
+ import { TElementPlugin } from "../../element/element.plugin.js";
3
+ import { buttonOf, inputOf, isButtonDisabled } from "../parts.js";
4
+ //#region src/custom/number-input/stepper/stepper.plugin.ts
5
+ /** Сколько ждать до повтора, когда кнопку держат, мс, — пока опция не задана. */
6
+ var REPEAT_DELAY = 400;
7
+ /** Шаг повтора, мс, — пока опция не задана. */
8
+ var REPEAT_INTERVAL = 60;
9
+ /**
10
+ * Указатели, нажатие которых ставит фокус во ввод: мышь и перо. Палец — нет:
11
+ * фокус во вводе открыл бы экранную клавиатуру поверх кнопок, которые жмут.
12
+ */
13
+ var FOCUSING_POINTERS = /* @__PURE__ */ new Set(["mouse", "pen"]);
14
+ /**
15
+ * TNumberInputStepperPlugin — кнопки шага «меньше» и «больше»: нажатие,
16
+ * удержание и активация скринридером.
17
+ *
18
+ * **Нажатие** основной кнопкой на включённой кнопке шага гасится
19
+ * (`preventDefault`): фокус остаётся во вводе, и кольцо поля не гаснет, а
20
+ * текст не выделяется. Мышь и перо ставят фокус во ввод, если его там не было,
21
+ * — клавиши продолжают с того же числа; палец — нет. Шаг — сразу, а пока
22
+ * кнопку держат, через `repeatDelay` он повторяется каждые `repeatInterval`
23
+ * до края. Пока держат, у кнопки `data-pressed` в её наборе (`incrementDataset`,
24
+ * `decrementDataset`): удержание видно и там, где браузер у погашенного нажатия
25
+ * не ставит `:active`.
26
+ *
27
+ * **Конец удержания** — отпускание, отмена указателя (палец увёл прокрутку),
28
+ * уход указателя с кнопки, выключенная кнопка (край, `disabled`, `readonly`) и
29
+ * снятый узел. Удержание — одно действие: `commit()` в конце, одно событие
30
+ * `commit` на всю серию шагов.
31
+ *
32
+ * **Скринридер** жмёт кнопку без указателя — `click` с `detail === 0`: шаг и
33
+ * `commit()`. Клик мышью кончает нажатие, уже исполненное, и шага не делает.
34
+ * Контекстное меню над кнопкой гасится: долгое касание — удержание, а не меню.
35
+ *
36
+ * Кнопки — по классам владельца в его корне; слушатели — на корне.
37
+ */
38
+ var TNumberInputStepperPlugin = class extends TBasePlugin {
39
+ _owner = null;
40
+ _root = null;
41
+ _hold = null;
42
+ _repeatDelay = REPEAT_DELAY;
43
+ _repeatInterval = REPEAT_INTERVAL;
44
+ install(ctx, options) {
45
+ super.install(ctx, options);
46
+ this._repeatDelay = options?.repeatDelay ?? this._repeatDelay;
47
+ this._repeatInterval = options?.repeatInterval ?? this._repeatInterval;
48
+ this._owner = ctx.getInstance() ?? null;
49
+ const elementPlugin = ctx.get(TElementPlugin);
50
+ elementPlugin?.events.on("ready", (element) => this._bind(element));
51
+ elementPlugin?.events.on("removed", () => this._bind(null));
52
+ this._listenTo(this._owner?.events, "change:disabled", this._onLock);
53
+ this._listenTo(this._owner?.events, "change:readonly", this._onLock);
54
+ }
55
+ destroy() {
56
+ this._bind(null);
57
+ this._owner = null;
58
+ super.destroy();
59
+ }
60
+ /** Корень сменился — слушатели переезжают; удержание на снятом узле кончается. */
61
+ _bind(root) {
62
+ this._release();
63
+ const previous = this._root;
64
+ previous?.removeEventListener("pointerdown", this._onPointerDown);
65
+ previous?.removeEventListener("pointerup", this._onPointerUp);
66
+ previous?.removeEventListener("pointercancel", this._onPointerUp);
67
+ previous?.removeEventListener("pointerout", this._onPointerOut);
68
+ previous?.removeEventListener("click", this._onClick);
69
+ previous?.removeEventListener("contextmenu", this._onContextMenu);
70
+ this._root = root;
71
+ const target = root;
72
+ target?.addEventListener("pointerdown", this._onPointerDown);
73
+ target?.addEventListener("pointerup", this._onPointerUp);
74
+ target?.addEventListener("pointercancel", this._onPointerUp);
75
+ target?.addEventListener("pointerout", this._onPointerOut);
76
+ target?.addEventListener("click", this._onClick);
77
+ target?.addEventListener("contextmenu", this._onContextMenu);
78
+ }
79
+ _onPointerDown = (event) => {
80
+ const owner = this._owner;
81
+ const root = this._root;
82
+ if (!owner || !root || event.button !== 0) return;
83
+ const button = buttonOf(owner, root, event.target);
84
+ if (!button || isButtonDisabled(owner, button.direction)) return;
85
+ event.preventDefault();
86
+ if (FOCUSING_POINTERS.has(event.pointerType)) {
87
+ const input = inputOf(owner, root);
88
+ if (input && root.ownerDocument.activeElement !== input) input.focus();
89
+ }
90
+ this._press(owner, button);
91
+ };
92
+ _onPointerUp = () => {
93
+ this._release();
94
+ };
95
+ /** Указатель ушёл с кнопки — не на её же значок, а наружу. */
96
+ _onPointerOut = (event) => {
97
+ const hold = this._hold;
98
+ const related = event.relatedTarget;
99
+ if (!hold || related instanceof Node && hold.button.element.contains(related)) return;
100
+ if (event.target instanceof Node && hold.button.element.contains(event.target)) this._release();
101
+ };
102
+ /** Нажатие без указателя — скринридер или клавиша на кнопке: один шаг. */
103
+ _onClick = (event) => {
104
+ const owner = this._owner;
105
+ const root = this._root;
106
+ if (!owner || !root || event.detail !== 0) return;
107
+ const button = buttonOf(owner, root, event.target);
108
+ if (!button || isButtonDisabled(owner, button.direction)) return;
109
+ owner.shift(button.direction);
110
+ owner.commit();
111
+ };
112
+ _onContextMenu = (event) => {
113
+ const owner = this._owner;
114
+ const root = this._root;
115
+ if (owner && root && buttonOf(owner, root, event.target)) event.preventDefault();
116
+ };
117
+ /** Кнопка выключилась под удержанием — удержание кончено. */
118
+ _onLock = () => {
119
+ const owner = this._owner;
120
+ const hold = this._hold;
121
+ if (owner && hold && isButtonDisabled(owner, hold.button.direction)) this._release();
122
+ };
123
+ /** Нажали: шаг сразу, `data-pressed`, а через задержку — повтор. */
124
+ _press(owner, button) {
125
+ this._release();
126
+ this._hold = {
127
+ button,
128
+ timer: setTimeout(this._repeat, this._repeatDelay)
129
+ };
130
+ datasetOf(owner, button.direction).add("pressed", true);
131
+ this._step(owner, button.direction);
132
+ }
133
+ /** Повтор шага, пока держат. */
134
+ _repeat = () => {
135
+ const owner = this._owner;
136
+ const hold = this._hold;
137
+ if (!owner || !hold) return;
138
+ hold.timer = setTimeout(this._repeat, this._repeatInterval);
139
+ this._step(owner, hold.button.direction);
140
+ };
141
+ /**
142
+ * Шаг удержания. Дошёл до края — кнопка выключена, и удержание кончено; край
143
+ * значения, записанного снаружи, следующий шаг увидит так же.
144
+ */
145
+ _step(owner, direction) {
146
+ owner.shift(direction);
147
+ if (isButtonDisabled(owner, direction)) this._release();
148
+ }
149
+ /** Отпустили: повтора нет, `data-pressed` снят, действие закрыто — `commit()`. */
150
+ _release() {
151
+ const owner = this._owner;
152
+ const hold = this._hold;
153
+ if (!hold) return;
154
+ this._hold = null;
155
+ clearTimeout(hold.timer);
156
+ if (!owner) return;
157
+ datasetOf(owner, hold.button.direction).add("pressed", null);
158
+ owner.commit();
159
+ }
160
+ };
161
+ /** Набор темы кнопки шага в эту сторону. */
162
+ function datasetOf(owner, direction) {
163
+ return direction > 0 ? owner.incrementDataset : owner.decrementDataset;
164
+ }
165
+ //#endregion
166
+ export { TNumberInputStepperPlugin };
@@ -0,0 +1,19 @@
1
+ import type { TPluginEvents } from '../../../base';
2
+ import type { TNumberInputButton } from '../types';
3
+ /**
4
+ * Своих событий у плагина нет: шаги видны в значении ядра, удержание — в
5
+ * `data-pressed` набора кнопки, его конец — событием ядра `commit`.
6
+ */
7
+ export type TNumberInputStepperPluginEvents = TPluginEvents;
8
+ /** Опции установки плагина кнопок шага. */
9
+ export interface INumberInputStepperPluginOptions {
10
+ /** Сколько держать кнопку до повтора шага, мс; по умолчанию 400 */
11
+ repeatDelay?: number;
12
+ /** Шаг повтора, пока кнопку держат, мс; по умолчанию 60 */
13
+ repeatInterval?: number;
14
+ }
15
+ /** Удержание кнопки шага: какую держат и таймер следующего шага. */
16
+ export type TNumberInputHold = {
17
+ readonly button: TNumberInputButton;
18
+ timer: ReturnType<typeof setTimeout>;
19
+ };
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ export * from './touch.plugin';
@@ -0,0 +1,25 @@
1
+ import type { INumberInput } from '@soxa-ui/core';
2
+ import { TBasePlugin } from '../../../base';
3
+ import type { IPluginContext } from '../../../base';
4
+ import type { TNumberInputTouchPluginEvents } from './types';
5
+ /**
6
+ * TNumberInputTouchPlugin — поле числа на сенсорных устройствах Apple.
7
+ *
8
+ * VoiceOver на iOS счётчик (`spinbutton`) не фокусирует — поле там
9
+ * `textbox`, и значение звучит его текстом: роль из набора поля
10
+ * (`inputSets`) снимает `aria-value*` ядра, как у частей поля даты. Минус на
11
+ * цифровой и десятичной клавиатуре iOS не набрать, поэтому у поля, где он
12
+ * разрешён (`signed`), клавиатура — текстовая; смена `min` пересчитывает её.
13
+ *
14
+ * Устройство плагин узнаёт после `ready`, у документа корня: сервер и прочие
15
+ * устройства рисуют счётчик с клавиатурой ядра. Записанное в набор уходит
16
+ * вместе с плагином — набор у поля, а поле переживает монтирование.
17
+ */
18
+ export declare class TNumberInputTouchPlugin extends TBasePlugin<INumberInput, TNumberInputTouchPluginEvents> {
19
+ private _owner;
20
+ /** Сенсорное устройство Apple: роль — `textbox`, клавиатура с минусом — текстовая */
21
+ private _appleTouch;
22
+ install(ctx: IPluginContext): void;
23
+ destroy(): void;
24
+ private readonly _sync;
25
+ }
@@ -0,0 +1,53 @@
1
+ import { TBasePlugin } from "../../../base/base.class.js";
2
+ import { TElementPlugin } from "../../element/element.plugin.js";
3
+ import { isAppleTouch } from "../../../utils/isAppleTouch.js";
4
+ //#region src/custom/number-input/touch/touch.plugin.ts
5
+ /** Роль поля на сенсорных устройствах Apple: счётчик VoiceOver на iOS не фокусирует. */
6
+ var APPLE_TOUCH_ROLE = "textbox";
7
+ /**
8
+ * Клавиатура поля с минусом на сенсорных устройствах Apple: у цифровой и
9
+ * десятичной клавиатуры iOS минуса нет.
10
+ */
11
+ var SIGNED_INPUT_MODE = "text";
12
+ /**
13
+ * TNumberInputTouchPlugin — поле числа на сенсорных устройствах Apple.
14
+ *
15
+ * VoiceOver на iOS счётчик (`spinbutton`) не фокусирует — поле там
16
+ * `textbox`, и значение звучит его текстом: роль из набора поля
17
+ * (`inputSets`) снимает `aria-value*` ядра, как у частей поля даты. Минус на
18
+ * цифровой и десятичной клавиатуре iOS не набрать, поэтому у поля, где он
19
+ * разрешён (`signed`), клавиатура — текстовая; смена `min` пересчитывает её.
20
+ *
21
+ * Устройство плагин узнаёт после `ready`, у документа корня: сервер и прочие
22
+ * устройства рисуют счётчик с клавиатурой ядра. Записанное в набор уходит
23
+ * вместе с плагином — набор у поля, а поле переживает монтирование.
24
+ */
25
+ var TNumberInputTouchPlugin = class extends TBasePlugin {
26
+ _owner = null;
27
+ /** Сенсорное устройство Apple: роль — `textbox`, клавиатура с минусом — текстовая */
28
+ _appleTouch = false;
29
+ install(ctx) {
30
+ super.install(ctx);
31
+ this._owner = ctx.getInstance() ?? null;
32
+ ctx.get(TElementPlugin)?.events.on("ready", (element) => {
33
+ this._appleTouch = isAppleTouch(element.ownerDocument.defaultView?.navigator);
34
+ this._sync();
35
+ });
36
+ this._listenTo(this._owner?.events, "change:min", this._sync);
37
+ }
38
+ destroy() {
39
+ this._appleTouch = false;
40
+ this._sync();
41
+ this._owner = null;
42
+ super.destroy();
43
+ }
44
+ _sync = () => {
45
+ const owner = this._owner;
46
+ if (!owner) return;
47
+ const apple = this._appleTouch;
48
+ owner.inputSets.aria.add("role", apple ? APPLE_TOUCH_ROLE : null);
49
+ owner.inputSets.attrs.add("inputmode", apple && owner.signed ? SIGNED_INPUT_MODE : null);
50
+ };
51
+ };
52
+ //#endregion
53
+ export { TNumberInputTouchPlugin };
@@ -0,0 +1,3 @@
1
+ import type { TPluginEvents } from '../../../base';
2
+ /** Своих событий у плагина нет: роль и клавиатура видны в наборе поля (`inputSets`). */
3
+ export type TNumberInputTouchPluginEvents = TPluginEvents;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Кнопка шага поля числа и её узел: `direction` — куда она шагает, `1` —
3
+ * «больше», `-1` — «меньше».
4
+ */
5
+ export type TNumberInputButton = {
6
+ readonly direction: 1 | -1;
7
+ readonly element: Element;
8
+ };
@@ -0,0 +1,2 @@
1
+ export * from './types';
2
+ export * from './typing.plugin';
@@ -0,0 +1,6 @@
1
+ import type { TPluginEvents } from '../../../base';
2
+ /**
3
+ * Своих событий у плагина нет: набранное видно в тексте и значении ядра, конец
4
+ * набора — событием ядра `commit`.
5
+ */
6
+ export type TNumberInputTypingPluginEvents = TPluginEvents;
@@ -0,0 +1,47 @@
1
+ import type { INumberInput } from '@soxa-ui/core';
2
+ import { TBasePlugin } from '../../../base';
3
+ import type { IPluginContext } from '../../../base';
4
+ import type { TNumberInputTypingPluginEvents } from './types';
5
+ /**
6
+ * TNumberInputTypingPlugin — набор в поле числа: что набирается, решает ядро.
7
+ *
8
+ * **До правки** (`beforeinput`) плагин считает, каким станет текст, — по типу
9
+ * правки и выделению, — и спрашивает ядро, годится ли он (`acceptsText`): не
10
+ * годится — правка гасится, и ни текст, ни каретка не сдвигаются. Так буква,
11
+ * второй разделитель или минус у поля без отрицательных не встают в поле даже
12
+ * на миг. Отмена, повтор и перевод строки (Enter отправляет форму) идут мимо.
13
+ *
14
+ * **После правки** (`input`) текст поля уходит ядру (`typeText`): пока он
15
+ * число, ядро пишет значение. Ядро отказало или показывает другое — запись
16
+ * отменили в `change:value:before`, правку браузер сделал мимо `beforeinput`,
17
+ * — узел получает текст ядра обратно: фреймворк его не перерисует, если текст
18
+ * ядра не сменился. Композицию (IME, клавиатуры Android) не погасить: её
19
+ * текст поле показывает, пока она идёт, а ядру он уходит на `compositionend`.
20
+ *
21
+ * **Уход фокуса** с ввода закрывает набор: `commit()` — значение с точностью
22
+ * формата, текст строкой формата.
23
+ *
24
+ * Слушает корень, а берёт только правки самого ввода: у содержимого слотов
25
+ * свой текст.
26
+ */
27
+ export declare class TNumberInputTypingPlugin extends TBasePlugin<INumberInput, TNumberInputTypingPluginEvents> {
28
+ private _owner;
29
+ private _root;
30
+ /** Идёт композиция: её текст уйдёт ядру на `compositionend` */
31
+ private _composing;
32
+ install(ctx: IPluginContext): void;
33
+ destroy(): void;
34
+ /** Корень сменился — слушатели переезжают. */
35
+ private _bind;
36
+ /** Правка, текст которой ядро не возьмёт, гасится: поле его не показывает. */
37
+ private readonly _onBeforeInput;
38
+ /** Текст поля — ядру; пока идёт композиция, её вернёт `compositionend`. */
39
+ private readonly _onInput;
40
+ private readonly _onCompositionStart;
41
+ private readonly _onCompositionEnd;
42
+ /**
43
+ * Фокус ушёл с ввода — набор закончен. Текст формата, который поставит
44
+ * `commit()`, фреймворк напишет сам: узел до него показывал текст ядра.
45
+ */
46
+ private readonly _onFocusOut;
47
+ }
@@ -0,0 +1,149 @@
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/typing/typing.plugin.ts
5
+ /**
6
+ * Правки, которые идут мимо проверки: отмена и повтор возвращают текст,
7
+ * который поле уже приняло, а перевод строки — Enter, неявная отправка формы,
8
+ * — текста не меняет.
9
+ */
10
+ var PASS = /* @__PURE__ */ new Set([
11
+ "historyUndo",
12
+ "historyRedo",
13
+ "insertLineBreak",
14
+ "insertParagraph"
15
+ ]);
16
+ /** Единиц UTF-16 у знака перед `index`: цифра вне BMP — две. */
17
+ function unitsBefore(text, index) {
18
+ const code = text.charCodeAt(index - 1);
19
+ return code >= 56320 && code <= 57343 && index > 1 ? 2 : 1;
20
+ }
21
+ /** Единиц UTF-16 у знака с `index`: цифра вне BMP — две. */
22
+ function unitsAfter(text, index) {
23
+ const code = text.charCodeAt(index);
24
+ return code >= 55296 && code <= 56319 ? 2 : 1;
25
+ }
26
+ /**
27
+ * Текст поля, если правку пропустить: по типу правки и выделению. Вставка
28
+ * встаёт вместо выделения; удаление снимает выделение, а без него — знак у
29
+ * каретки. Чего по правке не предсказать (удаление слова), — `undefined`:
30
+ * итог проверит `input`.
31
+ */
32
+ function nextText(input, event) {
33
+ const { value } = input;
34
+ const start = input.selectionStart ?? value.length;
35
+ const end = input.selectionEnd ?? start;
36
+ const type = event.inputType;
37
+ if (type.startsWith("insert")) {
38
+ const data = event.data ?? event.dataTransfer?.getData("text/plain") ?? null;
39
+ return data === null ? void 0 : value.slice(0, start) + data + value.slice(end);
40
+ }
41
+ if (!type.startsWith("delete")) return void 0;
42
+ if (start !== end) return value.slice(0, start) + value.slice(end);
43
+ if (type === "deleteContentBackward") return start === 0 ? value : value.slice(0, start - unitsBefore(value, start)) + value.slice(end);
44
+ if (type === "deleteContentForward") return value.slice(0, start) + value.slice(end + unitsAfter(value, end));
45
+ }
46
+ /**
47
+ * TNumberInputTypingPlugin — набор в поле числа: что набирается, решает ядро.
48
+ *
49
+ * **До правки** (`beforeinput`) плагин считает, каким станет текст, — по типу
50
+ * правки и выделению, — и спрашивает ядро, годится ли он (`acceptsText`): не
51
+ * годится — правка гасится, и ни текст, ни каретка не сдвигаются. Так буква,
52
+ * второй разделитель или минус у поля без отрицательных не встают в поле даже
53
+ * на миг. Отмена, повтор и перевод строки (Enter отправляет форму) идут мимо.
54
+ *
55
+ * **После правки** (`input`) текст поля уходит ядру (`typeText`): пока он
56
+ * число, ядро пишет значение. Ядро отказало или показывает другое — запись
57
+ * отменили в `change:value:before`, правку браузер сделал мимо `beforeinput`,
58
+ * — узел получает текст ядра обратно: фреймворк его не перерисует, если текст
59
+ * ядра не сменился. Композицию (IME, клавиатуры Android) не погасить: её
60
+ * текст поле показывает, пока она идёт, а ядру он уходит на `compositionend`.
61
+ *
62
+ * **Уход фокуса** с ввода закрывает набор: `commit()` — значение с точностью
63
+ * формата, текст строкой формата.
64
+ *
65
+ * Слушает корень, а берёт только правки самого ввода: у содержимого слотов
66
+ * свой текст.
67
+ */
68
+ var TNumberInputTypingPlugin = class extends TBasePlugin {
69
+ _owner = null;
70
+ _root = null;
71
+ /** Идёт композиция: её текст уйдёт ядру на `compositionend` */
72
+ _composing = false;
73
+ install(ctx) {
74
+ super.install(ctx);
75
+ this._owner = ctx.getInstance() ?? null;
76
+ const elementPlugin = ctx.get(TElementPlugin);
77
+ elementPlugin?.events.on("ready", (element) => this._bind(element));
78
+ elementPlugin?.events.on("removed", () => this._bind(null));
79
+ }
80
+ destroy() {
81
+ this._bind(null);
82
+ this._owner = null;
83
+ super.destroy();
84
+ }
85
+ /** Корень сменился — слушатели переезжают. */
86
+ _bind(root) {
87
+ const previous = this._root;
88
+ previous?.removeEventListener("beforeinput", this._onBeforeInput);
89
+ previous?.removeEventListener("input", this._onInput);
90
+ previous?.removeEventListener("compositionstart", this._onCompositionStart);
91
+ previous?.removeEventListener("compositionend", this._onCompositionEnd);
92
+ previous?.removeEventListener("focusout", this._onFocusOut);
93
+ this._root = root;
94
+ this._composing = false;
95
+ const target = root;
96
+ target?.addEventListener("beforeinput", this._onBeforeInput);
97
+ target?.addEventListener("input", this._onInput);
98
+ target?.addEventListener("compositionstart", this._onCompositionStart);
99
+ target?.addEventListener("compositionend", this._onCompositionEnd);
100
+ target?.addEventListener("focusout", this._onFocusOut);
101
+ }
102
+ /** Правка, текст которой ядро не возьмёт, гасится: поле его не показывает. */
103
+ _onBeforeInput = (event) => {
104
+ const owner = this._owner;
105
+ const root = this._root;
106
+ if (!owner || !root || event.defaultPrevented || !isInputOf(owner, root, event.target)) return;
107
+ if (event.isComposing || event.inputType === "insertCompositionText") return;
108
+ if (PASS.has(event.inputType)) return;
109
+ const next = nextText(event.target, event);
110
+ if (next !== void 0 && !owner.acceptsText(next)) event.preventDefault();
111
+ };
112
+ /** Текст поля — ядру; пока идёт композиция, её вернёт `compositionend`. */
113
+ _onInput = (event) => {
114
+ const owner = this._owner;
115
+ const root = this._root;
116
+ if (!owner || !root || this._composing || !isInputOf(owner, root, event.target)) return;
117
+ typeText(owner, event.target);
118
+ };
119
+ _onCompositionStart = () => {
120
+ this._composing = true;
121
+ };
122
+ _onCompositionEnd = (event) => {
123
+ this._composing = false;
124
+ const owner = this._owner;
125
+ const root = this._root;
126
+ if (owner && root && isInputOf(owner, root, event.target)) typeText(owner, event.target);
127
+ };
128
+ /**
129
+ * Фокус ушёл с ввода — набор закончен. Текст формата, который поставит
130
+ * `commit()`, фреймворк напишет сам: узел до него показывал текст ядра.
131
+ */
132
+ _onFocusOut = (event) => {
133
+ const owner = this._owner;
134
+ const root = this._root;
135
+ if (owner && root && isInputOf(owner, root, event.target)) owner.commit();
136
+ };
137
+ };
138
+ /**
139
+ * Текст узла — ядру. Показывает узел не то, что приняло ядро, — отказ или
140
+ * поправленная запись, — узел получает текст ядра: фреймворк перерисует его,
141
+ * только если текст ядра сменился. Запись того же текста сбросила бы каретку,
142
+ * поэтому — только при расхождении.
143
+ */
144
+ function typeText(owner, input) {
145
+ owner.typeText(input.value);
146
+ if (input.value !== owner.text) input.value = owner.text;
147
+ }
148
+ //#endregion
149
+ export { TNumberInputTypingPlugin };