@kurot/ui 1.1.7

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 (326) hide show
  1. package/README.md +258 -0
  2. package/dist/index.d.ts +8 -0
  3. package/dist/index.d.ts.map +1 -0
  4. package/dist/index.js +8 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/kurot/binding/Binding.d.ts +38 -0
  7. package/dist/kurot/binding/Binding.d.ts.map +1 -0
  8. package/dist/kurot/binding/Binding.js +88 -0
  9. package/dist/kurot/binding/Binding.js.map +1 -0
  10. package/dist/kurot/binding/Watcher.d.ts +57 -0
  11. package/dist/kurot/binding/Watcher.d.ts.map +1 -0
  12. package/dist/kurot/binding/Watcher.js +119 -0
  13. package/dist/kurot/binding/Watcher.js.map +1 -0
  14. package/dist/kurot/binding/index.d.ts +3 -0
  15. package/dist/kurot/binding/index.d.ts.map +1 -0
  16. package/dist/kurot/binding/index.js +3 -0
  17. package/dist/kurot/binding/index.js.map +1 -0
  18. package/dist/kurot/collections/ArrayCollection.d.ts +56 -0
  19. package/dist/kurot/collections/ArrayCollection.d.ts.map +1 -0
  20. package/dist/kurot/collections/ArrayCollection.js +143 -0
  21. package/dist/kurot/collections/ArrayCollection.js.map +1 -0
  22. package/dist/kurot/collections/ICollection.d.ts +24 -0
  23. package/dist/kurot/collections/ICollection.d.ts.map +1 -0
  24. package/dist/kurot/collections/ICollection.js +2 -0
  25. package/dist/kurot/collections/ICollection.js.map +1 -0
  26. package/dist/kurot/collections/index.d.ts +3 -0
  27. package/dist/kurot/collections/index.d.ts.map +1 -0
  28. package/dist/kurot/collections/index.js +2 -0
  29. package/dist/kurot/collections/index.js.map +1 -0
  30. package/dist/kurot/components/Animation.d.ts +34 -0
  31. package/dist/kurot/components/Animation.d.ts.map +1 -0
  32. package/dist/kurot/components/Animation.js +100 -0
  33. package/dist/kurot/components/Animation.js.map +1 -0
  34. package/dist/kurot/components/Button.d.ts +61 -0
  35. package/dist/kurot/components/Button.d.ts.map +1 -0
  36. package/dist/kurot/components/Button.js +176 -0
  37. package/dist/kurot/components/Button.js.map +1 -0
  38. package/dist/kurot/components/CheckBox.d.ts +11 -0
  39. package/dist/kurot/components/CheckBox.d.ts.map +1 -0
  40. package/dist/kurot/components/CheckBox.js +13 -0
  41. package/dist/kurot/components/CheckBox.js.map +1 -0
  42. package/dist/kurot/components/ComboBox.d.ts +93 -0
  43. package/dist/kurot/components/ComboBox.d.ts.map +1 -0
  44. package/dist/kurot/components/ComboBox.js +307 -0
  45. package/dist/kurot/components/ComboBox.js.map +1 -0
  46. package/dist/kurot/components/Component.d.ts +203 -0
  47. package/dist/kurot/components/Component.d.ts.map +1 -0
  48. package/dist/kurot/components/Component.js +522 -0
  49. package/dist/kurot/components/Component.js.map +1 -0
  50. package/dist/kurot/components/DataGroup.d.ts +90 -0
  51. package/dist/kurot/components/DataGroup.d.ts.map +1 -0
  52. package/dist/kurot/components/DataGroup.js +483 -0
  53. package/dist/kurot/components/DataGroup.js.map +1 -0
  54. package/dist/kurot/components/EditableText.d.ts +44 -0
  55. package/dist/kurot/components/EditableText.d.ts.map +1 -0
  56. package/dist/kurot/components/EditableText.js +126 -0
  57. package/dist/kurot/components/EditableText.js.map +1 -0
  58. package/dist/kurot/components/Group.d.ts +133 -0
  59. package/dist/kurot/components/Group.d.ts.map +1 -0
  60. package/dist/kurot/components/Group.js +454 -0
  61. package/dist/kurot/components/Group.js.map +1 -0
  62. package/dist/kurot/components/HScrollBar.d.ts +13 -0
  63. package/dist/kurot/components/HScrollBar.d.ts.map +1 -0
  64. package/dist/kurot/components/HScrollBar.js +55 -0
  65. package/dist/kurot/components/HScrollBar.js.map +1 -0
  66. package/dist/kurot/components/HSlider.d.ts +17 -0
  67. package/dist/kurot/components/HSlider.d.ts.map +1 -0
  68. package/dist/kurot/components/HSlider.js +48 -0
  69. package/dist/kurot/components/HSlider.js.map +1 -0
  70. package/dist/kurot/components/Image.d.ts +35 -0
  71. package/dist/kurot/components/Image.d.ts.map +1 -0
  72. package/dist/kurot/components/Image.js +141 -0
  73. package/dist/kurot/components/Image.js.map +1 -0
  74. package/dist/kurot/components/ItemRenderer.d.ts +42 -0
  75. package/dist/kurot/components/ItemRenderer.d.ts.map +1 -0
  76. package/dist/kurot/components/ItemRenderer.js +117 -0
  77. package/dist/kurot/components/ItemRenderer.js.map +1 -0
  78. package/dist/kurot/components/Label.d.ts +49 -0
  79. package/dist/kurot/components/Label.d.ts.map +1 -0
  80. package/dist/kurot/components/Label.js +193 -0
  81. package/dist/kurot/components/Label.js.map +1 -0
  82. package/dist/kurot/components/List.d.ts +16 -0
  83. package/dist/kurot/components/List.d.ts.map +1 -0
  84. package/dist/kurot/components/List.js +34 -0
  85. package/dist/kurot/components/List.js.map +1 -0
  86. package/dist/kurot/components/ListBase.d.ts +61 -0
  87. package/dist/kurot/components/ListBase.d.ts.map +1 -0
  88. package/dist/kurot/components/ListBase.js +202 -0
  89. package/dist/kurot/components/ListBase.js.map +1 -0
  90. package/dist/kurot/components/Panel.d.ts +53 -0
  91. package/dist/kurot/components/Panel.d.ts.map +1 -0
  92. package/dist/kurot/components/Panel.js +145 -0
  93. package/dist/kurot/components/Panel.js.map +1 -0
  94. package/dist/kurot/components/ProgressBar.d.ts +48 -0
  95. package/dist/kurot/components/ProgressBar.d.ts.map +1 -0
  96. package/dist/kurot/components/ProgressBar.js +180 -0
  97. package/dist/kurot/components/ProgressBar.js.map +1 -0
  98. package/dist/kurot/components/RadioButton.d.ts +86 -0
  99. package/dist/kurot/components/RadioButton.d.ts.map +1 -0
  100. package/dist/kurot/components/RadioButton.js +246 -0
  101. package/dist/kurot/components/RadioButton.js.map +1 -0
  102. package/dist/kurot/components/Range.d.ts +41 -0
  103. package/dist/kurot/components/Range.d.ts.map +1 -0
  104. package/dist/kurot/components/Range.js +144 -0
  105. package/dist/kurot/components/Range.js.map +1 -0
  106. package/dist/kurot/components/Rect.d.ts +33 -0
  107. package/dist/kurot/components/Rect.d.ts.map +1 -0
  108. package/dist/kurot/components/Rect.js +125 -0
  109. package/dist/kurot/components/Rect.js.map +1 -0
  110. package/dist/kurot/components/ScrollBarBase.d.ts +27 -0
  111. package/dist/kurot/components/ScrollBarBase.d.ts.map +1 -0
  112. package/dist/kurot/components/ScrollBarBase.js +50 -0
  113. package/dist/kurot/components/ScrollBarBase.js.map +1 -0
  114. package/dist/kurot/components/Scroller.d.ts +82 -0
  115. package/dist/kurot/components/Scroller.d.ts.map +1 -0
  116. package/dist/kurot/components/Scroller.js +416 -0
  117. package/dist/kurot/components/Scroller.js.map +1 -0
  118. package/dist/kurot/components/Skin.d.ts +64 -0
  119. package/dist/kurot/components/Skin.d.ts.map +1 -0
  120. package/dist/kurot/components/Skin.js +136 -0
  121. package/dist/kurot/components/Skin.js.map +1 -0
  122. package/dist/kurot/components/SliderBase.d.ts +60 -0
  123. package/dist/kurot/components/SliderBase.d.ts.map +1 -0
  124. package/dist/kurot/components/SliderBase.js +197 -0
  125. package/dist/kurot/components/SliderBase.js.map +1 -0
  126. package/dist/kurot/components/TabBar.d.ts +29 -0
  127. package/dist/kurot/components/TabBar.d.ts.map +1 -0
  128. package/dist/kurot/components/TabBar.js +92 -0
  129. package/dist/kurot/components/TabBar.js.map +1 -0
  130. package/dist/kurot/components/TextInput.d.ts +49 -0
  131. package/dist/kurot/components/TextInput.d.ts.map +1 -0
  132. package/dist/kurot/components/TextInput.js +157 -0
  133. package/dist/kurot/components/TextInput.js.map +1 -0
  134. package/dist/kurot/components/ToggleButton.d.ts +11 -0
  135. package/dist/kurot/components/ToggleButton.d.ts.map +1 -0
  136. package/dist/kurot/components/ToggleButton.js +14 -0
  137. package/dist/kurot/components/ToggleButton.js.map +1 -0
  138. package/dist/kurot/components/ToggleSwitch.d.ts +10 -0
  139. package/dist/kurot/components/ToggleSwitch.d.ts.map +1 -0
  140. package/dist/kurot/components/ToggleSwitch.js +10 -0
  141. package/dist/kurot/components/ToggleSwitch.js.map +1 -0
  142. package/dist/kurot/components/TouchScroll.d.ts +38 -0
  143. package/dist/kurot/components/TouchScroll.d.ts.map +1 -0
  144. package/dist/kurot/components/TouchScroll.js +133 -0
  145. package/dist/kurot/components/TouchScroll.js.map +1 -0
  146. package/dist/kurot/components/UILayer.d.ts +14 -0
  147. package/dist/kurot/components/UILayer.d.ts.map +1 -0
  148. package/dist/kurot/components/UILayer.js +38 -0
  149. package/dist/kurot/components/UILayer.js.map +1 -0
  150. package/dist/kurot/components/VScrollBar.d.ts +13 -0
  151. package/dist/kurot/components/VScrollBar.d.ts.map +1 -0
  152. package/dist/kurot/components/VScrollBar.js +55 -0
  153. package/dist/kurot/components/VScrollBar.js.map +1 -0
  154. package/dist/kurot/components/VSlider.d.ts +17 -0
  155. package/dist/kurot/components/VSlider.d.ts.map +1 -0
  156. package/dist/kurot/components/VSlider.js +49 -0
  157. package/dist/kurot/components/VSlider.js.map +1 -0
  158. package/dist/kurot/components/ViewStack.d.ts +42 -0
  159. package/dist/kurot/components/ViewStack.d.ts.map +1 -0
  160. package/dist/kurot/components/ViewStack.js +160 -0
  161. package/dist/kurot/components/ViewStack.js.map +1 -0
  162. package/dist/kurot/components/index.d.ts +34 -0
  163. package/dist/kurot/components/index.d.ts.map +1 -0
  164. package/dist/kurot/components/index.js +34 -0
  165. package/dist/kurot/components/index.js.map +1 -0
  166. package/dist/kurot/core/AssetAdapterRegistry.d.ts +4 -0
  167. package/dist/kurot/core/AssetAdapterRegistry.d.ts.map +1 -0
  168. package/dist/kurot/core/AssetAdapterRegistry.js +9 -0
  169. package/dist/kurot/core/AssetAdapterRegistry.js.map +1 -0
  170. package/dist/kurot/core/DefaultAssetAdapter.d.ts +10 -0
  171. package/dist/kurot/core/DefaultAssetAdapter.d.ts.map +1 -0
  172. package/dist/kurot/core/DefaultAssetAdapter.js +22 -0
  173. package/dist/kurot/core/DefaultAssetAdapter.js.map +1 -0
  174. package/dist/kurot/core/DefaultThemeAdapter.d.ts +8 -0
  175. package/dist/kurot/core/DefaultThemeAdapter.d.ts.map +1 -0
  176. package/dist/kurot/core/DefaultThemeAdapter.js +27 -0
  177. package/dist/kurot/core/DefaultThemeAdapter.js.map +1 -0
  178. package/dist/kurot/core/Direction.d.ts +10 -0
  179. package/dist/kurot/core/Direction.d.ts.map +1 -0
  180. package/dist/kurot/core/Direction.js +10 -0
  181. package/dist/kurot/core/Direction.js.map +1 -0
  182. package/dist/kurot/core/IAssetAdapter.d.ts +15 -0
  183. package/dist/kurot/core/IAssetAdapter.d.ts.map +1 -0
  184. package/dist/kurot/core/IAssetAdapter.js +2 -0
  185. package/dist/kurot/core/IAssetAdapter.js.map +1 -0
  186. package/dist/kurot/core/IDisplayText.d.ts +12 -0
  187. package/dist/kurot/core/IDisplayText.d.ts.map +1 -0
  188. package/dist/kurot/core/IDisplayText.js +2 -0
  189. package/dist/kurot/core/IDisplayText.js.map +1 -0
  190. package/dist/kurot/core/IItemRenderer.d.ts +19 -0
  191. package/dist/kurot/core/IItemRenderer.d.ts.map +1 -0
  192. package/dist/kurot/core/IItemRenderer.js +2 -0
  193. package/dist/kurot/core/IItemRenderer.js.map +1 -0
  194. package/dist/kurot/core/IThemeAdapter.d.ts +14 -0
  195. package/dist/kurot/core/IThemeAdapter.d.ts.map +1 -0
  196. package/dist/kurot/core/IThemeAdapter.js +2 -0
  197. package/dist/kurot/core/IThemeAdapter.js.map +1 -0
  198. package/dist/kurot/core/IUIComponent.d.ts +63 -0
  199. package/dist/kurot/core/IUIComponent.d.ts.map +1 -0
  200. package/dist/kurot/core/IUIComponent.js +2 -0
  201. package/dist/kurot/core/IUIComponent.js.map +1 -0
  202. package/dist/kurot/core/IViewport.d.ts +12 -0
  203. package/dist/kurot/core/IViewport.d.ts.map +1 -0
  204. package/dist/kurot/core/IViewport.js +2 -0
  205. package/dist/kurot/core/IViewport.js.map +1 -0
  206. package/dist/kurot/core/ScrollPolicy.d.ts +9 -0
  207. package/dist/kurot/core/ScrollPolicy.d.ts.map +1 -0
  208. package/dist/kurot/core/ScrollPolicy.js +9 -0
  209. package/dist/kurot/core/ScrollPolicy.js.map +1 -0
  210. package/dist/kurot/core/Theme.d.ts +53 -0
  211. package/dist/kurot/core/Theme.d.ts.map +1 -0
  212. package/dist/kurot/core/Theme.js +169 -0
  213. package/dist/kurot/core/Theme.js.map +1 -0
  214. package/dist/kurot/core/UIComponent.d.ts +2 -0
  215. package/dist/kurot/core/UIComponent.d.ts.map +1 -0
  216. package/dist/kurot/core/UIComponent.js +4 -0
  217. package/dist/kurot/core/UIComponent.js.map +1 -0
  218. package/dist/kurot/core/UIState.d.ts +84 -0
  219. package/dist/kurot/core/UIState.d.ts.map +1 -0
  220. package/dist/kurot/core/UIState.js +512 -0
  221. package/dist/kurot/core/UIState.js.map +1 -0
  222. package/dist/kurot/core/Validator.d.ts +46 -0
  223. package/dist/kurot/core/Validator.d.ts.map +1 -0
  224. package/dist/kurot/core/Validator.js +368 -0
  225. package/dist/kurot/core/Validator.js.map +1 -0
  226. package/dist/kurot/core/index.d.ts +17 -0
  227. package/dist/kurot/core/index.d.ts.map +1 -0
  228. package/dist/kurot/core/index.js +10 -0
  229. package/dist/kurot/core/index.js.map +1 -0
  230. package/dist/kurot/events/CollectionEvent.d.ts +22 -0
  231. package/dist/kurot/events/CollectionEvent.d.ts.map +1 -0
  232. package/dist/kurot/events/CollectionEvent.js +37 -0
  233. package/dist/kurot/events/CollectionEvent.js.map +1 -0
  234. package/dist/kurot/events/ItemTapEvent.d.ts +11 -0
  235. package/dist/kurot/events/ItemTapEvent.d.ts.map +1 -0
  236. package/dist/kurot/events/ItemTapEvent.js +24 -0
  237. package/dist/kurot/events/ItemTapEvent.js.map +1 -0
  238. package/dist/kurot/events/PropertyEvent.d.ts +8 -0
  239. package/dist/kurot/events/PropertyEvent.d.ts.map +1 -0
  240. package/dist/kurot/events/PropertyEvent.js +20 -0
  241. package/dist/kurot/events/PropertyEvent.js.map +1 -0
  242. package/dist/kurot/events/ScrollerThrowEvent.d.ts +17 -0
  243. package/dist/kurot/events/ScrollerThrowEvent.d.ts.map +1 -0
  244. package/dist/kurot/events/ScrollerThrowEvent.js +22 -0
  245. package/dist/kurot/events/ScrollerThrowEvent.js.map +1 -0
  246. package/dist/kurot/events/UIEvent.d.ts +29 -0
  247. package/dist/kurot/events/UIEvent.d.ts.map +1 -0
  248. package/dist/kurot/events/UIEvent.js +39 -0
  249. package/dist/kurot/events/UIEvent.js.map +1 -0
  250. package/dist/kurot/events/index.d.ts +6 -0
  251. package/dist/kurot/events/index.d.ts.map +1 -0
  252. package/dist/kurot/events/index.js +6 -0
  253. package/dist/kurot/events/index.js.map +1 -0
  254. package/dist/kurot/layouts/BasicLayout.d.ts +13 -0
  255. package/dist/kurot/layouts/BasicLayout.d.ts.map +1 -0
  256. package/dist/kurot/layouts/BasicLayout.js +146 -0
  257. package/dist/kurot/layouts/BasicLayout.js.map +1 -0
  258. package/dist/kurot/layouts/ColumnAlign.d.ts +9 -0
  259. package/dist/kurot/layouts/ColumnAlign.d.ts.map +1 -0
  260. package/dist/kurot/layouts/ColumnAlign.js +9 -0
  261. package/dist/kurot/layouts/ColumnAlign.js.map +1 -0
  262. package/dist/kurot/layouts/HorizontalLayout.d.ts +23 -0
  263. package/dist/kurot/layouts/HorizontalLayout.d.ts.map +1 -0
  264. package/dist/kurot/layouts/HorizontalLayout.js +405 -0
  265. package/dist/kurot/layouts/HorizontalLayout.js.map +1 -0
  266. package/dist/kurot/layouts/ILayoutTarget.d.ts +25 -0
  267. package/dist/kurot/layouts/ILayoutTarget.d.ts.map +1 -0
  268. package/dist/kurot/layouts/ILayoutTarget.js +2 -0
  269. package/dist/kurot/layouts/ILayoutTarget.js.map +1 -0
  270. package/dist/kurot/layouts/JustifyAlign.d.ts +8 -0
  271. package/dist/kurot/layouts/JustifyAlign.d.ts.map +1 -0
  272. package/dist/kurot/layouts/JustifyAlign.js +8 -0
  273. package/dist/kurot/layouts/JustifyAlign.js.map +1 -0
  274. package/dist/kurot/layouts/LayoutBase.d.ts +23 -0
  275. package/dist/kurot/layouts/LayoutBase.d.ts.map +1 -0
  276. package/dist/kurot/layouts/LayoutBase.js +45 -0
  277. package/dist/kurot/layouts/LayoutBase.js.map +1 -0
  278. package/dist/kurot/layouts/LinearLayoutBase.d.ts +70 -0
  279. package/dist/kurot/layouts/LinearLayoutBase.d.ts.map +1 -0
  280. package/dist/kurot/layouts/LinearLayoutBase.js +246 -0
  281. package/dist/kurot/layouts/LinearLayoutBase.js.map +1 -0
  282. package/dist/kurot/layouts/RowAlign.d.ts +9 -0
  283. package/dist/kurot/layouts/RowAlign.d.ts.map +1 -0
  284. package/dist/kurot/layouts/RowAlign.js +9 -0
  285. package/dist/kurot/layouts/RowAlign.js.map +1 -0
  286. package/dist/kurot/layouts/TileLayout.d.ts +79 -0
  287. package/dist/kurot/layouts/TileLayout.d.ts.map +1 -0
  288. package/dist/kurot/layouts/TileLayout.js +577 -0
  289. package/dist/kurot/layouts/TileLayout.js.map +1 -0
  290. package/dist/kurot/layouts/TileOrientation.d.ts +8 -0
  291. package/dist/kurot/layouts/TileOrientation.d.ts.map +1 -0
  292. package/dist/kurot/layouts/TileOrientation.js +8 -0
  293. package/dist/kurot/layouts/TileOrientation.js.map +1 -0
  294. package/dist/kurot/layouts/VerticalLayout.d.ts +23 -0
  295. package/dist/kurot/layouts/VerticalLayout.d.ts.map +1 -0
  296. package/dist/kurot/layouts/VerticalLayout.js +406 -0
  297. package/dist/kurot/layouts/VerticalLayout.js.map +1 -0
  298. package/dist/kurot/layouts/index.d.ts +12 -0
  299. package/dist/kurot/layouts/index.d.ts.map +1 -0
  300. package/dist/kurot/layouts/index.js +11 -0
  301. package/dist/kurot/layouts/index.js.map +1 -0
  302. package/dist/kurot/states/AddItems.d.ts +17 -0
  303. package/dist/kurot/states/AddItems.d.ts.map +1 -0
  304. package/dist/kurot/states/AddItems.js +42 -0
  305. package/dist/kurot/states/AddItems.js.map +1 -0
  306. package/dist/kurot/states/IOverride.d.ts +12 -0
  307. package/dist/kurot/states/IOverride.d.ts.map +1 -0
  308. package/dist/kurot/states/IOverride.js +2 -0
  309. package/dist/kurot/states/IOverride.js.map +1 -0
  310. package/dist/kurot/states/SetProperty.d.ts +19 -0
  311. package/dist/kurot/states/SetProperty.d.ts.map +1 -0
  312. package/dist/kurot/states/SetProperty.js +50 -0
  313. package/dist/kurot/states/SetProperty.js.map +1 -0
  314. package/dist/kurot/states/SetStateProperty.d.ts +17 -0
  315. package/dist/kurot/states/SetStateProperty.d.ts.map +1 -0
  316. package/dist/kurot/states/SetStateProperty.js +35 -0
  317. package/dist/kurot/states/SetStateProperty.js.map +1 -0
  318. package/dist/kurot/states/State.d.ts +14 -0
  319. package/dist/kurot/states/State.d.ts.map +1 -0
  320. package/dist/kurot/states/State.js +18 -0
  321. package/dist/kurot/states/State.js.map +1 -0
  322. package/dist/kurot/states/index.d.ts +6 -0
  323. package/dist/kurot/states/index.d.ts.map +1 -0
  324. package/dist/kurot/states/index.js +5 -0
  325. package/dist/kurot/states/index.js.map +1 -0
  326. package/package.json +55 -0
@@ -0,0 +1,157 @@
1
+ import { Event, TouchEvent } from '@kurot/core';
2
+ import { Component } from './Component.js';
3
+ import { EditableText } from './EditableText.js';
4
+ import { Label } from './Label.js';
5
+ /**
6
+ * Text input component with prompt (placeholder) and password support.
7
+ *
8
+ * Skin parts:
9
+ * - `textDisplay` — EditableText for actual input
10
+ * - `promptDisplay` — Label shown when text is empty and unfocused
11
+ *
12
+ * States: `normal`, `disabled`, `normalWithPrompt`, `disabledWithPrompt`
13
+ *
14
+ * Egret-compatible: eui.TextInput
15
+ */
16
+ export class TextInput extends Component {
17
+ // ── Instance fields ───────────────────────────────────────────────────
18
+ textDisplay;
19
+ promptDisplay;
20
+ _prompt = '';
21
+ _text = '';
22
+ _textColor;
23
+ _displayAsPassword = false;
24
+ _maxChars = 0;
25
+ _restrict = '';
26
+ _inputType = 'text';
27
+ _isFocused = false;
28
+ // ── Constructor ───────────────────────────────────────────────────────
29
+ constructor() {
30
+ super();
31
+ this.addEventListener(TouchEvent.TOUCH_BEGIN, this._onTouchBegin);
32
+ }
33
+ // ── Getters / Setters ─────────────────────────────────────────────────
34
+ get prompt() {
35
+ return this.promptDisplay ? this.promptDisplay.text : this._prompt;
36
+ }
37
+ set prompt(value) {
38
+ this._prompt = value;
39
+ if (this.promptDisplay)
40
+ this.promptDisplay.text = value;
41
+ this.invalidateState();
42
+ }
43
+ get text() {
44
+ return this.textDisplay ? this.textDisplay.text : this._text;
45
+ }
46
+ set text(value) {
47
+ this._text = value;
48
+ if (this.textDisplay)
49
+ this.textDisplay.text = value;
50
+ this.invalidateState();
51
+ }
52
+ get textColor() {
53
+ return this.textDisplay ? this.textDisplay.textColor : (this._textColor ?? 0xffffff);
54
+ }
55
+ set textColor(value) {
56
+ this._textColor = value;
57
+ if (this.textDisplay)
58
+ this.textDisplay.textColor = value;
59
+ }
60
+ get displayAsPassword() {
61
+ return this.textDisplay ? this.textDisplay.displayAsPassword : this._displayAsPassword;
62
+ }
63
+ set displayAsPassword(value) {
64
+ this._displayAsPassword = value;
65
+ if (this.textDisplay)
66
+ this.textDisplay.displayAsPassword = value;
67
+ }
68
+ get maxChars() {
69
+ return this.textDisplay ? this.textDisplay.maxChars : this._maxChars;
70
+ }
71
+ set maxChars(value) {
72
+ this._maxChars = value;
73
+ if (this.textDisplay)
74
+ this.textDisplay.maxChars = value;
75
+ }
76
+ get restrict() {
77
+ return this.textDisplay ? (this.textDisplay.restrict ?? '') : this._restrict;
78
+ }
79
+ set restrict(value) {
80
+ this._restrict = value;
81
+ if (this.textDisplay)
82
+ this.textDisplay.restrict = value;
83
+ }
84
+ get inputType() {
85
+ return this.textDisplay ? this.textDisplay.inputType : this._inputType;
86
+ }
87
+ set inputType(value) {
88
+ this._inputType = value;
89
+ if (this.textDisplay)
90
+ this.textDisplay.inputType = value;
91
+ this.invalidateProperties();
92
+ }
93
+ // ── Override methods ──────────────────────────────────────────────────
94
+ getCurrentState() {
95
+ const hasPrompt = !!this._prompt && !this._isFocused && !this.text;
96
+ if (!this.enabled) {
97
+ return hasPrompt && this.skin?.hasState('disabledWithPrompt') ? 'disabledWithPrompt' : 'disabled';
98
+ }
99
+ return hasPrompt && this.skin?.hasState('normalWithPrompt') ? 'normalWithPrompt' : 'normal';
100
+ }
101
+ partAdded(partName, instance) {
102
+ super.partAdded(partName, instance);
103
+ if (instance instanceof EditableText && partName === 'textDisplay') {
104
+ this.textDisplay = instance;
105
+ if (this._text)
106
+ instance.text = this._text;
107
+ if (this._textColor != null)
108
+ instance.textColor = this._textColor;
109
+ if (this._displayAsPassword)
110
+ instance.displayAsPassword = true;
111
+ if (this._maxChars)
112
+ instance.maxChars = this._maxChars;
113
+ if (this._restrict)
114
+ instance.restrict = this._restrict;
115
+ if (this._inputType)
116
+ instance.inputType = this._inputType;
117
+ instance.addEventListener(Event.FOCUS_IN, this._onFocusIn);
118
+ instance.addEventListener(Event.FOCUS_OUT, this._onFocusOut);
119
+ }
120
+ else if (instance instanceof Label && partName === 'promptDisplay') {
121
+ this.promptDisplay = instance;
122
+ instance.touchEnabled = false;
123
+ if (this._prompt)
124
+ instance.text = this._prompt;
125
+ }
126
+ }
127
+ partRemoved(partName, instance) {
128
+ super.partRemoved(partName, instance);
129
+ if (instance instanceof EditableText && partName === 'textDisplay') {
130
+ this._text = instance.text;
131
+ this._textColor = instance.textColor;
132
+ this._displayAsPassword = instance.displayAsPassword;
133
+ this._maxChars = instance.maxChars;
134
+ this._restrict = instance.restrict ?? '';
135
+ instance.removeEventListener(Event.FOCUS_IN, this._onFocusIn);
136
+ instance.removeEventListener(Event.FOCUS_OUT, this._onFocusOut);
137
+ this.textDisplay = undefined;
138
+ }
139
+ else if (instance instanceof Label && partName === 'promptDisplay') {
140
+ this._prompt = instance.text;
141
+ this.promptDisplay = undefined;
142
+ }
143
+ }
144
+ // ── Private methods ───────────────────────────────────────────────────
145
+ _onFocusIn = () => {
146
+ this._isFocused = true;
147
+ this.invalidateState();
148
+ };
149
+ _onFocusOut = () => {
150
+ this._isFocused = false;
151
+ this.invalidateState();
152
+ };
153
+ _onTouchBegin = () => {
154
+ this.textDisplay?.setFocus();
155
+ };
156
+ }
157
+ //# sourceMappingURL=TextInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextInput.js","sourceRoot":"","sources":["../../../src/kurot/components/TextInput.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC;;;;;;;;;;GAUG;AACH,MAAM,OAAO,SAAU,SAAQ,SAAS;IACvC,yEAAyE;IAElE,WAAW,CAAgB;IAC3B,aAAa,CAAS;IAErB,OAAO,GAAG,EAAE,CAAC;IACb,KAAK,GAAG,EAAE,CAAC;IACX,UAAU,CAAU;IACpB,kBAAkB,GAAG,KAAK,CAAC;IAC3B,SAAS,GAAG,CAAC,CAAC;IACd,SAAS,GAAG,EAAE,CAAC;IACf,UAAU,GAAG,MAAM,CAAC;IACpB,UAAU,GAAG,KAAK,CAAC;IAE3B,yEAAyE;IAEzE;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;IACnE,CAAC;IAED,yEAAyE;IAEzE,IAAW,MAAM;QAChB,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;IACpE,CAAC;IAED,IAAW,MAAM,CAAC,KAAa;QAC9B,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,IAAI,CAAC,aAAa;YAAE,IAAI,CAAC,aAAa,CAAC,IAAI,GAAG,KAAK,CAAC;QACx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C;IACxB,CAAC,CAAC;IAEM,aAAa,GAAG,GAAS,EAAE;QAClC,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,CAAC;IAC9B,CAAC,CAAC;CACF"}
@@ -0,0 +1,11 @@
1
+ import { Button } from './Button.js';
2
+ /**
3
+ * A Button that automatically toggles its selected state on each click.
4
+ * Sets `toggle = true` by default.
5
+ *
6
+ * States: same as Button (`up`, `down`, `disabled`, `upAndSelected`, `downAndSelected`, `disabledAndSelected`).
7
+ */
8
+ export declare class ToggleButton extends Button {
9
+ constructor();
10
+ }
11
+ //# sourceMappingURL=ToggleButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToggleButton.d.ts","sourceRoot":"","sources":["../../../src/kurot/components/ToggleButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;GAKG;AACH,qBAAa,YAAa,SAAQ,MAAM;;CAKvC"}
@@ -0,0 +1,14 @@
1
+ import { Button } from './Button.js';
2
+ /**
3
+ * A Button that automatically toggles its selected state on each click.
4
+ * Sets `toggle = true` by default.
5
+ *
6
+ * States: same as Button (`up`, `down`, `disabled`, `upAndSelected`, `downAndSelected`, `disabledAndSelected`).
7
+ */
8
+ export class ToggleButton extends Button {
9
+ constructor() {
10
+ super();
11
+ this.toggle = true;
12
+ }
13
+ }
14
+ //# sourceMappingURL=ToggleButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToggleButton.js","sourceRoot":"","sources":["../../../src/kurot/components/ToggleButton.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC;;;;;GAKG;AACH,MAAM,OAAO,YAAa,SAAQ,MAAM;IACvC;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;IACpB,CAAC;CACD"}
@@ -0,0 +1,10 @@
1
+ import { ToggleButton } from './ToggleButton.js';
2
+ /**
3
+ * ToggleSwitch — a binary on/off switch.
4
+ *
5
+ * Visually distinct from CheckBox (typically renders as a sliding switch).
6
+ * Inherits toggle behavior from ToggleButton.
7
+ */
8
+ export declare class ToggleSwitch extends ToggleButton {
9
+ }
10
+ //# sourceMappingURL=ToggleSwitch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToggleSwitch.d.ts","sourceRoot":"","sources":["../../../src/kurot/components/ToggleSwitch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;;;;GAKG;AACH,qBAAa,YAAa,SAAQ,YAAY;CAG7C"}
@@ -0,0 +1,10 @@
1
+ import { ToggleButton } from './ToggleButton.js';
2
+ /**
3
+ * ToggleSwitch — a binary on/off switch.
4
+ *
5
+ * Visually distinct from CheckBox (typically renders as a sliding switch).
6
+ * Inherits toggle behavior from ToggleButton.
7
+ */
8
+ export class ToggleSwitch extends ToggleButton {
9
+ }
10
+ //# sourceMappingURL=ToggleSwitch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ToggleSwitch.js","sourceRoot":"","sources":["../../../src/kurot/components/ToggleSwitch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,OAAO,YAAa,SAAQ,YAAY;CAG7C"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Touch-scroll physics simulator.
3
+ *
4
+ * Records velocity while the user drags, then computes a target position
5
+ * and easing duration for the "throw" phase when the finger is released.
6
+ *
7
+ * Usage:
8
+ * 1. Call `start(touchPoint)` on touch-begin.
9
+ * 2. Call `update(touchPoint, maxScroll, currentScroll)` on touch-move.
10
+ * 3. Call `finish(currentScroll, maxScroll)` on touch-end.
11
+ */
12
+ export declare class TouchScroll {
13
+ scrollFactor: number;
14
+ bounces: boolean;
15
+ private _updateFunction;
16
+ private _endFunction;
17
+ private _animation;
18
+ private _previousTime;
19
+ private _velocity;
20
+ private _previousVelocity;
21
+ private _currentPosition;
22
+ private _previousPosition;
23
+ private _currentScrollPos;
24
+ private _maxScrollPos;
25
+ private _offsetPoint;
26
+ private _started;
27
+ constructor(updateFunction: (scrollPos: number) => void, endFunction: () => void);
28
+ isPlaying(): boolean;
29
+ stop(): void;
30
+ isStarted(): boolean;
31
+ start(touchPoint: number): void;
32
+ update(touchPoint: number, maxScrollValue: number, scrollValue: number): void;
33
+ finish(currentScrollPos: number, maxScrollPos: number): void;
34
+ private _onTick;
35
+ private _throwTo;
36
+ private _onScrollingUpdate;
37
+ }
38
+ //# sourceMappingURL=TouchScroll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TouchScroll.d.ts","sourceRoot":"","sources":["../../../src/kurot/components/TouchScroll.ts"],"names":[],"mappings":"AAYA;;;;;;;;;;GAUG;AACH,qBAAa,WAAW;IAGhB,YAAY,SAAO;IACnB,OAAO,UAAQ;IAEtB,OAAO,CAAC,eAAe,CAA8B;IACrD,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,UAAU,CAAY;IAC9B,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,iBAAiB,CAAgB;IACzC,OAAO,CAAC,gBAAgB,CAAK;IAC7B,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,QAAQ,CAAS;gBAIN,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,EAAE,WAAW,EAAE,MAAM,IAAI;IAShF,SAAS,IAAI,OAAO;IAIpB,IAAI,IAAI,IAAI;IAMZ,SAAS,IAAI,OAAO;IAIpB,KAAK,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAU/B,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI;IA4B7E,MAAM,CAAC,gBAAgB,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI;IAcnE,OAAO,CAAC,OAAO,CAab;IAEF,OAAO,CAAC,QAAQ;IAahB,OAAO,CAAC,kBAAkB;CAI1B"}
@@ -0,0 +1,133 @@
1
+ import { ticker, getTimer } from '@kurot/core';
2
+ import { Animation } from './Animation.js';
3
+ // ── Constants ──────────────────────────────────────────────────────────
4
+ const MAX_VELOCITY_COUNT = 4;
5
+ function easeOut(ratio) {
6
+ const inv = ratio - 1.0;
7
+ return inv * inv * inv + 1;
8
+ }
9
+ /**
10
+ * Touch-scroll physics simulator.
11
+ *
12
+ * Records velocity while the user drags, then computes a target position
13
+ * and easing duration for the "throw" phase when the finger is released.
14
+ *
15
+ * Usage:
16
+ * 1. Call `start(touchPoint)` on touch-begin.
17
+ * 2. Call `update(touchPoint, maxScroll, currentScroll)` on touch-move.
18
+ * 3. Call `finish(currentScroll, maxScroll)` on touch-end.
19
+ */
20
+ export class TouchScroll {
21
+ // ── Instance fields ───────────────────────────────────────────────────
22
+ scrollFactor = 1.0;
23
+ bounces = true;
24
+ _updateFunction;
25
+ _endFunction;
26
+ _animation;
27
+ _previousTime = 0;
28
+ _velocity = 0;
29
+ _previousVelocity = [];
30
+ _currentPosition = 0;
31
+ _previousPosition = 0;
32
+ _currentScrollPos = 0;
33
+ _maxScrollPos = 0;
34
+ _offsetPoint = 0;
35
+ _started = false;
36
+ // ── Constructor ───────────────────────────────────────────────────────
37
+ constructor(updateFunction, endFunction) {
38
+ this._updateFunction = updateFunction;
39
+ this._endFunction = endFunction;
40
+ this._animation = new Animation(this._onScrollingUpdate, this);
41
+ this._animation.easerFunction = easeOut;
42
+ }
43
+ // ── Public methods ────────────────────────────────────────────────────
44
+ isPlaying() {
45
+ return this._animation.isPlaying;
46
+ }
47
+ stop() {
48
+ this._animation.stop();
49
+ ticker.stopTick(this._onTick, this);
50
+ this._started = false;
51
+ }
52
+ isStarted() {
53
+ return this._started;
54
+ }
55
+ start(touchPoint) {
56
+ this._started = true;
57
+ this._velocity = 0;
58
+ this._previousVelocity.length = 0;
59
+ this._previousTime = getTimer();
60
+ this._previousPosition = this._currentPosition = touchPoint;
61
+ this._offsetPoint = touchPoint;
62
+ ticker.startTick(this._onTick, this);
63
+ }
64
+ update(touchPoint, maxScrollValue, scrollValue) {
65
+ maxScrollValue = Math.max(maxScrollValue, 0);
66
+ this._currentPosition = touchPoint;
67
+ this._maxScrollPos = maxScrollValue;
68
+ const disMove = this._offsetPoint - touchPoint;
69
+ let scrollPos = disMove + scrollValue;
70
+ this._offsetPoint = touchPoint;
71
+ if (scrollPos < 0) {
72
+ if (!this.bounces) {
73
+ scrollPos = 0;
74
+ }
75
+ else {
76
+ scrollPos -= disMove * 0.5;
77
+ }
78
+ }
79
+ if (scrollPos > maxScrollValue) {
80
+ if (!this.bounces) {
81
+ scrollPos = maxScrollValue;
82
+ }
83
+ else {
84
+ scrollPos -= disMove * 0.5;
85
+ }
86
+ }
87
+ this._currentScrollPos = scrollPos;
88
+ this._updateFunction(scrollPos);
89
+ }
90
+ finish(currentScrollPos, maxScrollPos) {
91
+ ticker.stopTick(this._onTick, this);
92
+ this._started = false;
93
+ if (currentScrollPos < 0 || currentScrollPos > maxScrollPos) {
94
+ const posTo = Math.max(0, Math.min(maxScrollPos, currentScrollPos));
95
+ this._throwTo(posTo, 300);
96
+ }
97
+ else {
98
+ this._endFunction();
99
+ }
100
+ }
101
+ // ── Private methods ───────────────────────────────────────────────────
102
+ _onTick = (timeStamp) => {
103
+ const timeOffset = timeStamp - this._previousTime;
104
+ if (timeOffset > 10) {
105
+ const pv = this._previousVelocity;
106
+ if (pv.length >= MAX_VELOCITY_COUNT) {
107
+ pv.shift();
108
+ }
109
+ this._velocity = (this._currentPosition - this._previousPosition) / timeOffset;
110
+ pv.push(this._velocity);
111
+ this._previousTime = timeStamp;
112
+ this._previousPosition = this._currentPosition;
113
+ }
114
+ return true;
115
+ };
116
+ _throwTo(posTo, duration = 300) {
117
+ const hsp = this._currentScrollPos;
118
+ if (Math.abs(hsp - posTo) < 0.5) {
119
+ this._endFunction();
120
+ return;
121
+ }
122
+ const anim = this._animation;
123
+ anim.duration = duration;
124
+ anim.from = hsp;
125
+ anim.to = posTo;
126
+ anim.play();
127
+ }
128
+ _onScrollingUpdate(animation) {
129
+ this._currentScrollPos = animation.currentValue;
130
+ this._updateFunction(animation.currentValue);
131
+ }
132
+ }
133
+ //# sourceMappingURL=TouchScroll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TouchScroll.js","sourceRoot":"","sources":["../../../src/kurot/components/TouchScroll.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,0EAA0E;AAE1E,MAAM,kBAAkB,GAAG,CAAC,CAAC;AAE7B,SAAS,OAAO,CAAC,KAAa;IAC7B,MAAM,GAAG,GAAG,KAAK,GAAG,GAAG,CAAC;IACxB,OAAO,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,OAAO,WAAW;IACvB,yEAAyE;IAElE,YAAY,GAAG,GAAG,CAAC;IACnB,OAAO,GAAG,IAAI,CAAC;IAEd,eAAe,CAA8B;IAC7C,YAAY,CAAa;IACzB,UAAU,CAAY;IACtB,aAAa,GAAG,CAAC,CAAC;IAClB,SAAS,GAAG,CAAC,CAAC;IACd,iBAAiB,GAAa,EAAE,CAAC;IACjC,gBAAgB,GAAG,CAAC,CAAC;IACrB,iBAAiB,GAAG,CAAC,CAAC;IACtB,iBAAiB,GAAG,CAAC,CAAC;IACtB,aAAa,GAAG,CAAC,CAAC;IAClB,YAAY,GAAG,CAAC,CAAC;IACjB,QAAQ,GAAG,KAAK,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IAC9C,CAAC;CACD"}
@@ -0,0 +1,14 @@
1
+ import { Group } from './Group.js';
2
+ /**
3
+ * UILayer — a top-level UI container that automatically sizes to the stage.
4
+ *
5
+ * Use as the root of the UI display list. When added to the stage, UILayer
6
+ * listens to RESIZE events and keeps its size synced with the stage dimensions.
7
+ */
8
+ export declare class UILayer extends Group {
9
+ constructor();
10
+ private $onAddedToStage;
11
+ private $onRemovedFromStage;
12
+ private $onResize;
13
+ }
14
+ //# sourceMappingURL=UILayer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UILayer.d.ts","sourceRoot":"","sources":["../../../src/kurot/components/UILayer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;GAKG;AACH,qBAAa,OAAQ,SAAQ,KAAK;;IAWjC,OAAO,CAAC,eAAe;IAOvB,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,SAAS;CAMjB"}
@@ -0,0 +1,38 @@
1
+ import { Event } from '@kurot/core';
2
+ import { Group } from './Group.js';
3
+ /**
4
+ * UILayer — a top-level UI container that automatically sizes to the stage.
5
+ *
6
+ * Use as the root of the UI display list. When added to the stage, UILayer
7
+ * listens to RESIZE events and keeps its size synced with the stage dimensions.
8
+ */
9
+ export class UILayer extends Group {
10
+ // ── Constructor ───────────────────────────────────────────────────────
11
+ constructor() {
12
+ super();
13
+ this.addEventListener(Event.ADDED_TO_STAGE, this.$onAddedToStage);
14
+ this.addEventListener(Event.REMOVED_FROM_STAGE, this.$onRemovedFromStage);
15
+ }
16
+ // ── Private methods ───────────────────────────────────────────────────
17
+ $onAddedToStage() {
18
+ const stage = this.stage;
19
+ if (!stage)
20
+ return;
21
+ stage.addEventListener(Event.RESIZE, this.$onResize);
22
+ this.$onResize();
23
+ }
24
+ $onRemovedFromStage() {
25
+ const stage = this.stage;
26
+ if (stage) {
27
+ stage.removeEventListener(Event.RESIZE, this.$onResize);
28
+ }
29
+ }
30
+ $onResize() {
31
+ const stage = this.stage;
32
+ if (!stage)
33
+ return;
34
+ this.width = stage.stageWidth;
35
+ this.height = stage.stageHeight;
36
+ }
37
+ }
38
+ //# sourceMappingURL=UILayer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UILayer.js","sourceRoot":"","sources":["../../../src/kurot/components/UILayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,OAAO,OAAQ,SAAQ,KAAK;IACjC,yEAAyE;IAEzE;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QAClE,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,kBAAkB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAC3E,CAAC;IAED,yEAAyE;IAEjE,eAAe;QACtB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,IAAI,CAAC,KAAK;YAAE,OAAO;QACnB,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACrD,IAAI,CAAC,SAAS,EAAE,CAAC;IAClB,CAAC;IAEO,mBAAmB;QAC1B,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,IAAI,KAAK,EAAE,CAAC;YACX,KAAK,CAAC,mBAAmB,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QACzD,CAAC;IACF,CAAC;IAEO,SAAS;QAChB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,IAAI,CAAC,KAAK;YAAE,OAAO;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,UAAU,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC;IACjC,CAAC;CACD"}
@@ -0,0 +1,13 @@
1
+ import { ScrollBarBase } from './ScrollBarBase.js';
2
+ import { PropertyEvent } from '../events/PropertyEvent.js';
3
+ /**
4
+ * Vertical scroll bar.
5
+ *
6
+ * Positions the `thumb` skin part proportionally based on the viewport's
7
+ * vertical scroll position (`scrollV`) relative to content height.
8
+ */
9
+ export declare class VScrollBar extends ScrollBarBase {
10
+ updateDisplayList(unscaledWidth: number, unscaledHeight: number): void;
11
+ protected onPropertyChanged(event: PropertyEvent): void;
12
+ }
13
+ //# sourceMappingURL=VScrollBar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VScrollBar.d.ts","sourceRoot":"","sources":["../../../src/kurot/components/VScrollBar.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D;;;;;GAKG;AACH,qBAAa,UAAW,SAAQ,aAAa;IAG5B,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,IAAI;cAmCnE,iBAAiB,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;CAQhE"}
@@ -0,0 +1,55 @@
1
+ import { Rectangle } from '@kurot/core';
2
+ import { ScrollBarBase } from './ScrollBarBase.js';
3
+ /**
4
+ * Vertical scroll bar.
5
+ *
6
+ * Positions the `thumb` skin part proportionally based on the viewport's
7
+ * vertical scroll position (`scrollV`) relative to content height.
8
+ */
9
+ export class VScrollBar extends ScrollBarBase {
10
+ // ── Override methods ──────────────────────────────────────────────────
11
+ updateDisplayList(unscaledWidth, unscaledHeight) {
12
+ super.updateDisplayList(unscaledWidth, unscaledHeight);
13
+ const thumb = this.thumb;
14
+ const viewport = this.viewport;
15
+ if (!thumb || !viewport)
16
+ return;
17
+ const bounds = new Rectangle();
18
+ thumb.getPreferredBounds(bounds);
19
+ const minThumbHeight = bounds.height;
20
+ const thumbX = bounds.x;
21
+ const vsp = viewport.scrollV;
22
+ const contentHeight = viewport.contentHeight;
23
+ const vpBounds = new Rectangle();
24
+ viewport.getLayoutBounds(vpBounds);
25
+ const vpHeight = vpBounds.height;
26
+ const proportionalHeight = contentHeight > 0 ? Math.round((unscaledHeight * vpHeight) / contentHeight) : unscaledHeight;
27
+ const thumbHeight = Math.min(unscaledHeight, Math.max(minThumbHeight, proportionalHeight));
28
+ if (vsp <= 0) {
29
+ let scaleHeight = thumbHeight * (1 - -vsp / (vpHeight * 0.5));
30
+ scaleHeight = Math.max(5, Math.round(scaleHeight));
31
+ thumb.setLayoutBoundsSize(NaN, scaleHeight);
32
+ thumb.setLayoutBoundsPosition(thumbX, 0);
33
+ }
34
+ else if (vsp >= contentHeight - vpHeight) {
35
+ let scaleHeight = thumbHeight * (1 - (vsp - contentHeight + vpHeight) / (vpHeight * 0.5));
36
+ scaleHeight = Math.max(5, Math.round(scaleHeight));
37
+ thumb.setLayoutBoundsSize(NaN, scaleHeight);
38
+ thumb.setLayoutBoundsPosition(thumbX, unscaledHeight - scaleHeight);
39
+ }
40
+ else {
41
+ const thumbY = ((unscaledHeight - thumbHeight) * vsp) / (contentHeight - vpHeight);
42
+ thumb.setLayoutBoundsSize(NaN, thumbHeight);
43
+ thumb.setLayoutBoundsPosition(thumbX, thumbY);
44
+ }
45
+ }
46
+ onPropertyChanged(event) {
47
+ switch (event.property) {
48
+ case 'scrollV':
49
+ case 'contentHeight':
50
+ this.invalidateDisplayList();
51
+ break;
52
+ }
53
+ }
54
+ }
55
+ //# sourceMappingURL=VScrollBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VScrollBar.js","sourceRoot":"","sources":["../../../src/kurot/components/VScrollBar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD;;;;;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ertical slider (bottom-to-top, standard slider convention).
4
+ *
5
+ * Overrides `pointToValue` and `updateSkinDisplayList` to position the thumb
6
+ * using the track's layout bounds (not the slider's own height), matching egret.
7
+ */
8
+ export declare class VSlider extends SliderBase {
9
+ constructor();
10
+ /**
11
+ * Range of thumb movement = track height − thumb height.
12
+ */
13
+ private _getThumbRange;
14
+ protected pointToValue(_x: number, y: number): number;
15
+ protected updateSkinDisplayList(): void;
16
+ }
17
+ //# sourceMappingURL=VSlider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VSlider.d.ts","sourceRoot":"","sources":["../../../src/kurot/components/VSlider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAI7C;;;;;GAKG;AACH,qBAAa,OAAQ,SAAQ,UAAU;;IAOtC;;OAEG;IACH,OAAO,CAAC,cAAc;cAWH,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM;cAO3C,qBAAqB,IAAI,IAAI;CAahD"}
@@ -0,0 +1,49 @@
1
+ import { Rectangle } from '@kurot/core';
2
+ import { SliderBase } from './SliderBase.js';
3
+ import { Direction } from '../core/Direction.js';
4
+ import { isUIComponent } from '../core/UIComponent.js';
5
+ /**
6
+ * VSlider — a vertical slider (bottom-to-top, standard slider convention).
7
+ *
8
+ * Overrides `pointToValue` and `updateSkinDisplayList` to position the thumb
9
+ * using the track's layout bounds (not the slider's own height), matching egret.
10
+ */
11
+ export class VSlider extends SliderBase {
12
+ constructor() {
13
+ super();
14
+ this.direction = Direction.BTT;
15
+ }
16
+ /**
17
+ * Range of thumb movement = track height − thumb height.
18
+ */
19
+ _getThumbRange() {
20
+ const track = this.track;
21
+ const thumb = this.thumb;
22
+ if (!track || !thumb || !isUIComponent(track) || !isUIComponent(thumb))
23
+ return 0;
24
+ const b = new Rectangle();
25
+ track.getLayoutBounds(b);
26
+ const trackHeight = b.height;
27
+ thumb.getLayoutBounds(b);
28
+ return trackHeight - b.height;
29
+ }
30
+ pointToValue(_x, y) {
31
+ const range = this.maximum - this.minimum;
32
+ const thumbRange = this._getThumbRange();
33
+ // BTT: y=0 at bottom (max), y=thumbRange at top (min) → invert.
34
+ return this.minimum + (thumbRange !== 0 ? ((thumbRange - y) / thumbRange) * range : 0);
35
+ }
36
+ updateSkinDisplayList() {
37
+ const thumb = this.thumb;
38
+ const track = this.track;
39
+ if (!thumb || !track || !isUIComponent(track))
40
+ return;
41
+ const thumbRange = this._getThumbRange();
42
+ const range = this.maximum - this.minimum;
43
+ const ratio = range > 0 ? (this.value - this.minimum) / range : 0;
44
+ const trackBounds = new Rectangle();
45
+ track.getLayoutBounds(trackBounds);
46
+ thumb.y = trackBounds.y + (1 - ratio) * thumbRange;
47
+ }
48
+ }
49
+ //# sourceMappingURL=VSlider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VSlider.js","sourceRoot":"","sources":["../../../src/kurot/components/VSlider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,OAAO,OAAQ,SAAQ,UAAU;IAEtC;QACC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,GAAG,CAAC;IAChC,CAAC;IAED;;OAEG;IACK,cAAc;QACrB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACzB,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;YAAE,OAAO,CAAC,CAAC;QACjF,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