@skbkontur/react-ui 6.2.0-beta.0 → 6.2.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 (432) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/components/Button/Button.classes.d.ts +8 -0
  3. package/components/Button/Button.classes.js +10 -0
  4. package/components/Button/Button.classes.js.map +1 -0
  5. package/components/Button/Button.mixins.js +1 -1
  6. package/components/Button/Button.mixins.js.map +1 -1
  7. package/components/Button/Button.styles.d.ts +2 -8
  8. package/components/Button/Button.styles.js +3 -9
  9. package/components/Button/Button.styles.js.map +1 -1
  10. package/components/Calendar/Calendar.d.ts +2 -8
  11. package/components/Calendar/Calendar.js +2 -7
  12. package/components/Calendar/Calendar.js.map +1 -1
  13. package/components/Calendar/CalendarDay.js +1 -1
  14. package/components/Calendar/CalendarDay.js.map +1 -1
  15. package/components/Calendar/MonthView.js +1 -1
  16. package/components/Calendar/MonthView.js.map +1 -1
  17. package/components/Calendar/MonthViewModel.js +1 -2
  18. package/components/Calendar/MonthViewModel.js.map +1 -1
  19. package/components/Calendar/tids.d.ts +7 -0
  20. package/components/Calendar/tids.js +8 -0
  21. package/components/Calendar/tids.js.map +1 -0
  22. package/components/Checkbox/Checkbox.d.ts +5 -0
  23. package/components/Checkbox/Checkbox.js +42 -21
  24. package/components/Checkbox/Checkbox.js.map +1 -1
  25. package/components/Checkbox/Checkbox.mixins.d.ts +2 -0
  26. package/components/Checkbox/Checkbox.mixins.js +6 -0
  27. package/components/Checkbox/Checkbox.mixins.js.map +1 -1
  28. package/components/Checkbox/Checkbox.styles.d.ts +7 -0
  29. package/components/Checkbox/Checkbox.styles.js +23 -2
  30. package/components/Checkbox/Checkbox.styles.js.map +1 -1
  31. package/components/CurrencyInput/CurrencyHelper.d.ts +1 -2
  32. package/components/CurrencyInput/CurrencyHelper.js +32 -28
  33. package/components/CurrencyInput/CurrencyHelper.js.map +1 -1
  34. package/components/CurrencyInput/CurrencyInputHelper.js +1 -1
  35. package/components/CurrencyInput/CurrencyInputHelper.js.map +1 -1
  36. package/components/DateInput/DateInput.js +4 -1
  37. package/components/DateInput/DateInput.js.map +1 -1
  38. package/components/FileUploader/FileUploaderFile.d.ts +1 -1
  39. package/components/FileUploader/FileUploaderFile.js +4 -2
  40. package/components/FileUploader/FileUploaderFile.js.map +1 -1
  41. package/components/FileUploader/locale/locales/en.js +1 -0
  42. package/components/FileUploader/locale/locales/en.js.map +1 -1
  43. package/components/FileUploader/locale/locales/ru.js +1 -0
  44. package/components/FileUploader/locale/locales/ru.js.map +1 -1
  45. package/components/FileUploader/locale/types.d.ts +1 -0
  46. package/components/FileUploader/locale/types.js.map +1 -1
  47. package/components/FxInput/FxInput.d.ts +1 -1
  48. package/components/FxInput/FxInput.js.map +1 -1
  49. package/components/Group/Group.js +2 -3
  50. package/components/Group/Group.js.map +1 -1
  51. package/components/Input/Input.d.ts +4 -1
  52. package/components/Input/Input.js +4 -1
  53. package/components/Input/Input.js.map +1 -1
  54. package/components/MaskedInput/MaskedInput.d.ts +6 -2
  55. package/components/MaskedInput/MaskedInput.js +10 -126
  56. package/components/MaskedInput/MaskedInput.js.map +1 -1
  57. package/components/MaskedInput/MaskedInputLegacy.d.ts +3 -0
  58. package/components/MaskedInput/MaskedInputLegacy.js +142 -0
  59. package/components/MaskedInput/MaskedInputLegacy.js.map +1 -0
  60. package/components/MaskedInput/index.d.ts +1 -0
  61. package/components/MaskedInput/index.js +1 -0
  62. package/components/MaskedInput/index.js.map +1 -1
  63. package/components/MaskedInputV2/MaskedInputV2.d.ts +62 -0
  64. package/components/MaskedInputV2/MaskedInputV2.helpers.d.ts +9 -0
  65. package/components/MaskedInputV2/MaskedInputV2.helpers.js +17 -0
  66. package/components/MaskedInputV2/MaskedInputV2.helpers.js.map +1 -0
  67. package/components/MaskedInputV2/MaskedInputV2.js +307 -0
  68. package/components/MaskedInputV2/MaskedInputV2.js.map +1 -0
  69. package/components/MaskedInputV2/MaskedInputV2.phone.d.ts +28 -0
  70. package/components/MaskedInputV2/MaskedInputV2.phone.js +38 -0
  71. package/components/MaskedInputV2/MaskedInputV2.phone.js.map +1 -0
  72. package/{internal/TimeInput/TimeInput.styles.d.ts → components/MaskedInputV2/MaskedInputV2.styles.d.ts} +4 -3
  73. package/components/MaskedInputV2/MaskedInputV2.styles.js +19 -0
  74. package/components/MaskedInputV2/MaskedInputV2.styles.js.map +1 -0
  75. package/components/MaskedInputV2/index.d.ts +2 -0
  76. package/components/MaskedInputV2/index.js +3 -0
  77. package/components/MaskedInputV2/index.js.map +1 -0
  78. package/components/MaskedInputV2/internal/MaskOverlay.d.ts +19 -0
  79. package/components/MaskedInputV2/internal/MaskOverlay.js +54 -0
  80. package/components/MaskedInputV2/internal/MaskOverlay.js.map +1 -0
  81. package/components/MaskedInputV2/internal/MaskedCore.d.ts +8 -0
  82. package/components/MaskedInputV2/internal/MaskedCore.js +186 -0
  83. package/components/MaskedInputV2/internal/MaskedCore.js.map +1 -0
  84. package/components/MaskedInputV2/internal/MaskedCore.types.d.ts +37 -0
  85. package/components/MaskedInputV2/internal/MaskedCore.types.js +2 -0
  86. package/components/MaskedInputV2/internal/MaskedCore.types.js.map +1 -0
  87. package/components/MaskedInputV2/internal/MaskedInternal.styles.d.ts +15 -0
  88. package/components/MaskedInputV2/internal/MaskedInternal.styles.js +34 -0
  89. package/components/MaskedInputV2/internal/MaskedInternal.styles.js.map +1 -0
  90. package/components/MaskedInputV2/internal/buildSlotMap.d.ts +11 -0
  91. package/components/MaskedInputV2/internal/buildSlotMap.js +37 -0
  92. package/components/MaskedInputV2/internal/buildSlotMap.js.map +1 -0
  93. package/components/MaskedInputV2/internal/computeMaskAlignPadding.d.ts +6 -0
  94. package/components/MaskedInputV2/internal/computeMaskAlignPadding.js +47 -0
  95. package/components/MaskedInputV2/internal/computeMaskAlignPadding.js.map +1 -0
  96. package/components/MaskedInputV2/internal/computePasteMaskedCursor.d.ts +3 -0
  97. package/components/MaskedInputV2/internal/computePasteMaskedCursor.js +11 -0
  98. package/components/MaskedInputV2/internal/computePasteMaskedCursor.js.map +1 -0
  99. package/components/MaskedInputV2/internal/extractRaw.d.ts +10 -0
  100. package/components/MaskedInputV2/internal/extractRaw.js +16 -0
  101. package/components/MaskedInputV2/internal/extractRaw.js.map +1 -0
  102. package/components/MaskedInputV2/internal/findNearestRawLeft.d.ts +10 -0
  103. package/components/MaskedInputV2/internal/findNearestRawLeft.js +18 -0
  104. package/components/MaskedInputV2/internal/findNearestRawLeft.js.map +1 -0
  105. package/components/MaskedInputV2/internal/helpers.d.ts +8 -0
  106. package/components/MaskedInputV2/internal/helpers.js +9 -0
  107. package/components/MaskedInputV2/internal/helpers.js.map +1 -0
  108. package/components/MaskedInputV2/internal/maskedCoreClipboard.d.ts +37 -0
  109. package/components/MaskedInputV2/internal/maskedCoreClipboard.js +52 -0
  110. package/components/MaskedInputV2/internal/maskedCoreClipboard.js.map +1 -0
  111. package/components/MaskedInputV2/internal/maskedCoreDeletion.d.ts +28 -0
  112. package/components/MaskedInputV2/internal/maskedCoreDeletion.js +70 -0
  113. package/components/MaskedInputV2/internal/maskedCoreDeletion.js.map +1 -0
  114. package/components/MaskedInputV2/internal/maskedCoreInputChange.d.ts +38 -0
  115. package/components/MaskedInputV2/internal/maskedCoreInputChange.js +49 -0
  116. package/components/MaskedInputV2/internal/maskedCoreInputChange.js.map +1 -0
  117. package/components/MaskedInputV2/internal/maskedCoreNavigation.d.ts +13 -0
  118. package/components/MaskedInputV2/internal/maskedCoreNavigation.js +79 -0
  119. package/components/MaskedInputV2/internal/maskedCoreNavigation.js.map +1 -0
  120. package/components/MaskedInputV2/internal/measureInputTextWidth.d.ts +2 -0
  121. package/components/MaskedInputV2/internal/measureInputTextWidth.js +30 -0
  122. package/components/MaskedInputV2/internal/measureInputTextWidth.js.map +1 -0
  123. package/components/MaskedInputV2/internal/setMaskInputSelectionRange.d.ts +2 -0
  124. package/components/MaskedInputV2/internal/setMaskInputSelectionRange.js +25 -0
  125. package/components/MaskedInputV2/internal/setMaskInputSelectionRange.js.map +1 -0
  126. package/components/MaskedInputV2/internal/showOverlay.d.ts +3 -0
  127. package/components/MaskedInputV2/internal/showOverlay.js +16 -0
  128. package/components/MaskedInputV2/internal/showOverlay.js.map +1 -0
  129. package/components/MaskedInputV2/internal/stripMaskChars.d.ts +11 -0
  130. package/components/MaskedInputV2/internal/stripMaskChars.js +20 -0
  131. package/components/MaskedInputV2/internal/stripMaskChars.js.map +1 -0
  132. package/components/MaskedInputV2/internal/types.d.ts +74 -0
  133. package/components/MaskedInputV2/internal/types.js.map +1 -0
  134. package/components/MaskedInputV2/internal/useInputOverflow.d.ts +4 -0
  135. package/components/MaskedInputV2/internal/useInputOverflow.js +34 -0
  136. package/components/MaskedInputV2/internal/useInputOverflow.js.map +1 -0
  137. package/components/MaskedInputV2/internal/useMaskAlignPadding.d.ts +2 -0
  138. package/components/MaskedInputV2/internal/useMaskAlignPadding.js +33 -0
  139. package/components/MaskedInputV2/internal/useMaskAlignPadding.js.map +1 -0
  140. package/components/MaskedInputV2/internal/useMaskEngine.d.ts +42 -0
  141. package/components/MaskedInputV2/internal/useMaskEngine.js +128 -0
  142. package/components/MaskedInputV2/internal/useMaskEngine.js.map +1 -0
  143. package/components/MaskedInputV2/internal/useMaskedCoreHandlers.d.ts +34 -0
  144. package/components/MaskedInputV2/internal/useMaskedCoreHandlers.js +335 -0
  145. package/components/MaskedInputV2/internal/useMaskedCoreHandlers.js.map +1 -0
  146. package/components/MaskedInputV2/react-imask/imask/controls/html-input-mask-element.d.ts +16 -0
  147. package/components/MaskedInputV2/react-imask/imask/controls/html-input-mask-element.js +59 -0
  148. package/components/MaskedInputV2/react-imask/imask/controls/html-input-mask-element.js.map +1 -0
  149. package/components/MaskedInputV2/react-imask/imask/controls/html-mask-element.d.ts +20 -0
  150. package/components/MaskedInputV2/react-imask/imask/controls/html-mask-element.js +106 -0
  151. package/components/MaskedInputV2/react-imask/imask/controls/html-mask-element.js.map +1 -0
  152. package/components/MaskedInputV2/react-imask/imask/controls/input-history.d.ts +17 -0
  153. package/components/MaskedInputV2/react-imask/imask/controls/input-history.js +49 -0
  154. package/components/MaskedInputV2/react-imask/imask/controls/input-history.js.map +1 -0
  155. package/components/MaskedInputV2/react-imask/imask/controls/input.d.ts +95 -0
  156. package/components/MaskedInputV2/react-imask/imask/controls/input.js +420 -0
  157. package/components/MaskedInputV2/react-imask/imask/controls/input.js.map +1 -0
  158. package/components/MaskedInputV2/react-imask/imask/controls/mask-element.d.ts +30 -0
  159. package/components/MaskedInputV2/react-imask/imask/controls/mask-element.js +59 -0
  160. package/components/MaskedInputV2/react-imask/imask/controls/mask-element.js.map +1 -0
  161. package/components/MaskedInputV2/react-imask/imask/core/action-details.d.ts +30 -0
  162. package/components/MaskedInputV2/react-imask/imask/core/action-details.js +100 -0
  163. package/components/MaskedInputV2/react-imask/imask/core/action-details.js.map +1 -0
  164. package/components/MaskedInputV2/react-imask/imask/core/change-details.d.ts +20 -0
  165. package/components/MaskedInputV2/react-imask/imask/core/change-details.js +46 -0
  166. package/components/MaskedInputV2/react-imask/imask/core/change-details.js.map +1 -0
  167. package/components/MaskedInputV2/react-imask/imask/core/continuous-tail-details.d.ts +21 -0
  168. package/components/MaskedInputV2/react-imask/imask/core/continuous-tail-details.js +52 -0
  169. package/components/MaskedInputV2/react-imask/imask/core/continuous-tail-details.js.map +1 -0
  170. package/components/MaskedInputV2/react-imask/imask/core/holder.d.ts +34 -0
  171. package/components/MaskedInputV2/react-imask/imask/core/holder.js +38 -0
  172. package/components/MaskedInputV2/react-imask/imask/core/holder.js.map +1 -0
  173. package/components/MaskedInputV2/react-imask/imask/core/tail-details.d.ts +20 -0
  174. package/components/MaskedInputV2/react-imask/imask/core/tail-details.js +2 -0
  175. package/components/MaskedInputV2/react-imask/imask/core/tail-details.js.map +1 -0
  176. package/components/MaskedInputV2/react-imask/imask/core/utils.d.ts +24 -0
  177. package/components/MaskedInputV2/react-imask/imask/core/utils.js +100 -0
  178. package/components/MaskedInputV2/react-imask/imask/core/utils.js.map +1 -0
  179. package/components/MaskedInputV2/react-imask/imask/imask.d.ts +5 -0
  180. package/components/MaskedInputV2/react-imask/imask/imask.js +7 -0
  181. package/components/MaskedInputV2/react-imask/imask/imask.js.map +1 -0
  182. package/components/MaskedInputV2/react-imask/imask/index.d.ts +17 -0
  183. package/components/MaskedInputV2/react-imask/imask/index.js +16 -0
  184. package/components/MaskedInputV2/react-imask/imask/index.js.map +1 -0
  185. package/components/MaskedInputV2/react-imask/imask/masked/base.d.ts +114 -0
  186. package/components/MaskedInputV2/react-imask/imask/masked/base.js +411 -0
  187. package/components/MaskedInputV2/react-imask/imask/masked/base.js.map +1 -0
  188. package/components/MaskedInputV2/react-imask/imask/masked/create.d.ts +14 -0
  189. package/components/MaskedInputV2/react-imask/imask/masked/create.js +11 -0
  190. package/components/MaskedInputV2/react-imask/imask/masked/create.js.map +1 -0
  191. package/components/MaskedInputV2/react-imask/imask/masked/factory.d.ts +62 -0
  192. package/components/MaskedInputV2/react-imask/imask/masked/factory.js +107 -0
  193. package/components/MaskedInputV2/react-imask/imask/masked/factory.js.map +1 -0
  194. package/components/MaskedInputV2/react-imask/imask/masked/pattern.d.ts +101 -0
  195. package/components/MaskedInputV2/react-imask/imask/masked/pattern.js +549 -0
  196. package/components/MaskedInputV2/react-imask/imask/masked/pattern.js.map +1 -0
  197. package/components/MaskedInputV2/react-imask/imask/masked/patterns/block.d.ts +30 -0
  198. package/components/MaskedInputV2/react-imask/imask/masked/patterns/block.js +2 -0
  199. package/components/MaskedInputV2/react-imask/imask/masked/patterns/block.js.map +1 -0
  200. package/components/MaskedInputV2/react-imask/imask/masked/patterns/chunk-tail-details.d.ts +20 -0
  201. package/components/MaskedInputV2/react-imask/imask/masked/patterns/chunk-tail-details.js +182 -0
  202. package/components/MaskedInputV2/react-imask/imask/masked/patterns/chunk-tail-details.js.map +1 -0
  203. package/components/MaskedInputV2/react-imask/imask/masked/patterns/cursor.d.ts +31 -0
  204. package/components/MaskedInputV2/react-imask/imask/masked/patterns/cursor.js +163 -0
  205. package/components/MaskedInputV2/react-imask/imask/masked/patterns/cursor.js.map +1 -0
  206. package/components/MaskedInputV2/react-imask/imask/masked/patterns/fixed-definition.d.ts +42 -0
  207. package/components/MaskedInputV2/react-imask/imask/masked/patterns/fixed-definition.js +158 -0
  208. package/components/MaskedInputV2/react-imask/imask/masked/patterns/fixed-definition.js.map +1 -0
  209. package/components/MaskedInputV2/react-imask/imask/masked/patterns/input-definition.d.ts +56 -0
  210. package/components/MaskedInputV2/react-imask/imask/masked/patterns/input-definition.js +185 -0
  211. package/components/MaskedInputV2/react-imask/imask/masked/patterns/input-definition.js.map +1 -0
  212. package/components/MaskedInputV2/react-imask/imask/masked/regexp.d.ts +17 -0
  213. package/components/MaskedInputV2/react-imask/imask/masked/regexp.js +36 -0
  214. package/components/MaskedInputV2/react-imask/imask/masked/regexp.js.map +1 -0
  215. package/components/MaskedInputV2/react-imask/index.d.ts +3 -0
  216. package/components/MaskedInputV2/react-imask/index.js +4 -0
  217. package/components/MaskedInputV2/react-imask/index.js.map +1 -0
  218. package/components/MaskedInputV2/react-imask/input.d.ts +8 -0
  219. package/components/MaskedInputV2/react-imask/input.js +35 -0
  220. package/components/MaskedInputV2/react-imask/input.js.map +1 -0
  221. package/components/MaskedInputV2/react-imask/mixin.d.ts +31 -0
  222. package/components/MaskedInputV2/react-imask/mixin.js +246 -0
  223. package/components/MaskedInputV2/react-imask/mixin.js.map +1 -0
  224. package/components/MenuItem/MenuItem.mixins.d.ts +1 -0
  225. package/components/MenuItem/MenuItem.mixins.js +6 -1
  226. package/components/MenuItem/MenuItem.mixins.js.map +1 -1
  227. package/components/MenuItem/MenuItem.styles.d.ts +2 -1
  228. package/components/MenuItem/MenuItem.styles.js +2 -7
  229. package/components/MenuItem/MenuItem.styles.js.map +1 -1
  230. package/components/MiniModal/MiniModal.d.ts +2 -16
  231. package/components/MiniModal/MiniModal.js +2 -16
  232. package/components/MiniModal/MiniModal.js.map +1 -1
  233. package/components/MiniModal/MiniModalBody.js +1 -1
  234. package/components/MiniModal/MiniModalBody.js.map +1 -1
  235. package/components/MiniModal/MiniModalFooter.js +1 -1
  236. package/components/MiniModal/MiniModalFooter.js.map +1 -1
  237. package/components/MiniModal/MiniModalHeader.js +1 -1
  238. package/components/MiniModal/MiniModalHeader.js.map +1 -1
  239. package/components/MiniModal/MiniModalIndent.js +1 -1
  240. package/components/MiniModal/MiniModalIndent.js.map +1 -1
  241. package/components/MiniModal/tids.d.ts +7 -0
  242. package/components/MiniModal/tids.js +8 -0
  243. package/components/MiniModal/tids.js.map +1 -0
  244. package/components/Modal/Modal.constants.d.ts +9 -0
  245. package/components/Modal/Modal.constants.js +10 -0
  246. package/components/Modal/Modal.constants.js.map +1 -0
  247. package/components/Modal/Modal.d.ts +2 -15
  248. package/components/Modal/Modal.js +2 -14
  249. package/components/Modal/Modal.js.map +1 -1
  250. package/components/Modal/ModalBody.js +1 -1
  251. package/components/Modal/ModalBody.js.map +1 -1
  252. package/components/Modal/ModalClose.js +1 -1
  253. package/components/Modal/ModalClose.js.map +1 -1
  254. package/components/PasswordInput/PasswordInput.js +13 -1
  255. package/components/PasswordInput/PasswordInput.js.map +1 -1
  256. package/components/Radio/Radio.d.ts +4 -0
  257. package/components/Radio/Radio.js +20 -1
  258. package/components/Radio/Radio.js.map +1 -1
  259. package/components/Radio/Radio.mixins.d.ts +2 -0
  260. package/components/Radio/Radio.mixins.js +6 -0
  261. package/components/Radio/Radio.mixins.js.map +1 -1
  262. package/components/Radio/Radio.styles.d.ts +6 -0
  263. package/components/Radio/Radio.styles.js +22 -4
  264. package/components/Radio/Radio.styles.js.map +1 -1
  265. package/components/Select/Select.d.ts +1 -0
  266. package/components/Select/Select.js +12 -2
  267. package/components/Select/Select.js.map +1 -1
  268. package/components/Switcher/Switcher.d.ts +3 -3
  269. package/components/Switcher/Switcher.js +1 -1
  270. package/components/Switcher/Switcher.js.map +1 -1
  271. package/components/Tabs/Tab.d.ts +4 -5
  272. package/components/Tabs/Tab.js +0 -1
  273. package/components/Tabs/Tab.js.map +1 -1
  274. package/components/Tabs/Tabs.d.ts +2 -2
  275. package/components/Tabs/Tabs.js +1 -1
  276. package/components/Tabs/Tabs.js.map +1 -1
  277. package/components/Toggle/Toggle.classes.d.ts +8 -0
  278. package/components/Toggle/Toggle.classes.js +10 -0
  279. package/components/Toggle/Toggle.classes.js.map +1 -0
  280. package/components/Toggle/Toggle.d.ts +5 -0
  281. package/components/Toggle/Toggle.js +46 -22
  282. package/components/Toggle/Toggle.js.map +1 -1
  283. package/components/Toggle/Toggle.mixins.d.ts +2 -0
  284. package/components/Toggle/Toggle.mixins.js +7 -1
  285. package/components/Toggle/Toggle.mixins.js.map +1 -1
  286. package/components/Toggle/Toggle.styles.d.ts +11 -8
  287. package/components/Toggle/Toggle.styles.js +32 -11
  288. package/components/Toggle/Toggle.styles.js.map +1 -1
  289. package/components/Token/Token.d.ts +1 -1
  290. package/components/Token/Token.js +1 -1
  291. package/components/Token/Token.js.map +1 -1
  292. package/components/TokenInput/TokenInput.d.ts +8 -4
  293. package/components/TokenInput/TokenInput.js +1 -2
  294. package/components/TokenInput/TokenInput.js.map +1 -1
  295. package/components/Tooltip/Tooltip.d.ts +2 -0
  296. package/components/Tooltip/Tooltip.js +25 -4
  297. package/components/Tooltip/Tooltip.js.map +1 -1
  298. package/index.d.ts +0 -1
  299. package/index.js +0 -1
  300. package/index.js.map +1 -1
  301. package/internal/Menu/Menu.d.ts +5 -0
  302. package/internal/Menu/Menu.js +21 -0
  303. package/internal/Menu/Menu.js.map +1 -1
  304. package/internal/Popup/PopupPin.js +8 -6
  305. package/internal/Popup/PopupPin.js.map +1 -1
  306. package/internal/themes/BasicTheme.d.ts +194 -35
  307. package/internal/themes/BasicTheme.js +326 -97
  308. package/internal/themes/BasicTheme.js.map +1 -1
  309. package/internal/themes/DarkTheme6_0.js +1 -0
  310. package/internal/themes/DarkTheme6_0.js.map +1 -1
  311. package/lib/date/InternalDateValidator.js +1 -2
  312. package/lib/date/InternalDateValidator.js.map +1 -1
  313. package/lib/events/keyListener.js +6 -0
  314. package/lib/events/keyListener.js.map +1 -1
  315. package/lib/events/keyboard/KeyboardEventCodes.d.ts +2 -0
  316. package/lib/events/keyboard/KeyboardEventCodes.js +2 -0
  317. package/lib/events/keyboard/KeyboardEventCodes.js.map +1 -1
  318. package/lib/events/keyboard/KeyboardMapKeys.js +2 -0
  319. package/lib/events/keyboard/KeyboardMapKeys.js.map +1 -1
  320. package/lib/events/keyboard/identifiers.d.ts +2 -0
  321. package/lib/events/keyboard/identifiers.js +6 -0
  322. package/lib/events/keyboard/identifiers.js.map +1 -1
  323. package/lib/featureFlagsContext/ReactUIFeatureFlagsContext.d.ts +1 -0
  324. package/lib/featureFlagsContext/ReactUIFeatureFlagsContext.js +1 -0
  325. package/lib/featureFlagsContext/ReactUIFeatureFlagsContext.js.map +1 -1
  326. package/lib/locale/types.d.ts +0 -2
  327. package/lib/locale/types.js.map +1 -1
  328. package/lib/utils.d.ts +2 -3
  329. package/lib/utils.js +7 -5
  330. package/lib/utils.js.map +1 -1
  331. package/package.json +6 -11
  332. package/components/TimePicker/TimeClockIcon.d.ts +0 -3
  333. package/components/TimePicker/TimeClockIcon.js +0 -11
  334. package/components/TimePicker/TimeClockIcon.js.map +0 -1
  335. package/components/TimePicker/TimePicker.d.ts +0 -79
  336. package/components/TimePicker/TimePicker.js +0 -513
  337. package/components/TimePicker/TimePicker.js.map +0 -1
  338. package/components/TimePicker/TimePicker.styles.d.ts +0 -11
  339. package/components/TimePicker/TimePicker.styles.js +0 -36
  340. package/components/TimePicker/TimePicker.styles.js.map +0 -1
  341. package/components/TimePicker/TimePickerItems.d.ts +0 -17
  342. package/components/TimePicker/TimePickerItems.js +0 -80
  343. package/components/TimePicker/TimePickerItems.js.map +0 -1
  344. package/components/TimePicker/TimePickerMobilePopup.d.ts +0 -38
  345. package/components/TimePicker/TimePickerMobilePopup.js +0 -21
  346. package/components/TimePicker/TimePickerMobilePopup.js.map +0 -1
  347. package/components/TimePicker/TimePickerPopup.d.ts +0 -20
  348. package/components/TimePicker/TimePickerPopup.js +0 -18
  349. package/components/TimePicker/TimePickerPopup.js.map +0 -1
  350. package/components/TimePicker/helpers/TimePicker.constants.d.ts +0 -22
  351. package/components/TimePicker/helpers/TimePicker.constants.js +0 -31
  352. package/components/TimePicker/helpers/TimePicker.constants.js.map +0 -1
  353. package/components/TimePicker/helpers/TimePicker.editing.d.ts +0 -23
  354. package/components/TimePicker/helpers/TimePicker.editing.js +0 -101
  355. package/components/TimePicker/helpers/TimePicker.editing.js.map +0 -1
  356. package/components/TimePicker/helpers/TimePicker.layout.d.ts +0 -6
  357. package/components/TimePicker/helpers/TimePicker.layout.js +0 -49
  358. package/components/TimePicker/helpers/TimePicker.layout.js.map +0 -1
  359. package/components/TimePicker/helpers/TimePicker.selection.d.ts +0 -5
  360. package/components/TimePicker/helpers/TimePicker.selection.js +0 -23
  361. package/components/TimePicker/helpers/TimePicker.selection.js.map +0 -1
  362. package/components/TimePicker/helpers/TimePicker.shared.d.ts +0 -47
  363. package/components/TimePicker/helpers/TimePicker.shared.js +0 -70
  364. package/components/TimePicker/helpers/TimePicker.shared.js.map +0 -1
  365. package/components/TimePicker/helpers/TimePicker.value.d.ts +0 -30
  366. package/components/TimePicker/helpers/TimePicker.value.js +0 -96
  367. package/components/TimePicker/helpers/TimePicker.value.js.map +0 -1
  368. package/components/TimePicker/helpers/scrollSelectedItemIntoView.d.ts +0 -4
  369. package/components/TimePicker/helpers/scrollSelectedItemIntoView.js +0 -24
  370. package/components/TimePicker/helpers/scrollSelectedItemIntoView.js.map +0 -1
  371. package/components/TimePicker/helpers/validateTimePicker.d.ts +0 -8
  372. package/components/TimePicker/helpers/validateTimePicker.js +0 -16
  373. package/components/TimePicker/helpers/validateTimePicker.js.map +0 -1
  374. package/components/TimePicker/hooks/useTimePickerDropdown.d.ts +0 -17
  375. package/components/TimePicker/hooks/useTimePickerDropdown.js +0 -62
  376. package/components/TimePicker/hooks/useTimePickerDropdown.js.map +0 -1
  377. package/components/TimePicker/hooks/useTimePickerSelection.d.ts +0 -18
  378. package/components/TimePicker/hooks/useTimePickerSelection.js +0 -66
  379. package/components/TimePicker/hooks/useTimePickerSelection.js.map +0 -1
  380. package/components/TimePicker/hooks/useTimePickerValue.d.ts +0 -18
  381. package/components/TimePicker/hooks/useTimePickerValue.js +0 -59
  382. package/components/TimePicker/hooks/useTimePickerValue.js.map +0 -1
  383. package/components/TimePicker/index.d.ts +0 -2
  384. package/components/TimePicker/index.js +0 -2
  385. package/components/TimePicker/index.js.map +0 -1
  386. package/components/TimePicker/locale/index.d.ts +0 -4
  387. package/components/TimePicker/locale/index.js +0 -9
  388. package/components/TimePicker/locale/index.js.map +0 -1
  389. package/components/TimePicker/locale/locales/en.d.ts +0 -2
  390. package/components/TimePicker/locale/locales/en.js +0 -5
  391. package/components/TimePicker/locale/locales/en.js.map +0 -1
  392. package/components/TimePicker/locale/locales/ru.d.ts +0 -2
  393. package/components/TimePicker/locale/locales/ru.js +0 -5
  394. package/components/TimePicker/locale/locales/ru.js.map +0 -1
  395. package/components/TimePicker/locale/types.d.ts +0 -4
  396. package/components/TimePicker/locale/types.js.map +0 -1
  397. package/internal/NativeTimeInput/NativeTimeInput.d.ts +0 -16
  398. package/internal/NativeTimeInput/NativeTimeInput.js +0 -25
  399. package/internal/NativeTimeInput/NativeTimeInput.js.map +0 -1
  400. package/internal/NativeTimeInput/NativeTimeInput.styles.d.ts +0 -3
  401. package/internal/NativeTimeInput/NativeTimeInput.styles.js +0 -15
  402. package/internal/NativeTimeInput/NativeTimeInput.styles.js.map +0 -1
  403. package/internal/NativeTimeInput/NativeTimeInput.utils.d.ts +0 -7
  404. package/internal/NativeTimeInput/NativeTimeInput.utils.js +0 -28
  405. package/internal/NativeTimeInput/NativeTimeInput.utils.js.map +0 -1
  406. package/internal/NativeTimeInput/index.d.ts +0 -1
  407. package/internal/NativeTimeInput/index.js +0 -2
  408. package/internal/NativeTimeInput/index.js.map +0 -1
  409. package/internal/TimeInput/TimeFragments.d.ts +0 -15
  410. package/internal/TimeInput/TimeFragments.js +0 -72
  411. package/internal/TimeInput/TimeFragments.js.map +0 -1
  412. package/internal/TimeInput/TimeFragments.styles.d.ts +0 -12
  413. package/internal/TimeInput/TimeFragments.styles.js +0 -43
  414. package/internal/TimeInput/TimeFragments.styles.js.map +0 -1
  415. package/internal/TimeInput/TimeInput.d.ts +0 -22
  416. package/internal/TimeInput/TimeInput.js +0 -103
  417. package/internal/TimeInput/TimeInput.js.map +0 -1
  418. package/internal/TimeInput/TimeInput.styles.js +0 -21
  419. package/internal/TimeInput/TimeInput.styles.js.map +0 -1
  420. package/internal/TimeInput/index.d.ts +0 -1
  421. package/internal/TimeInput/index.js +0 -2
  422. package/internal/TimeInput/index.js.map +0 -1
  423. package/internal/icons2022/TimeClockIcon/TimeClockIcon16Light.d.ts +0 -2
  424. package/internal/icons2022/TimeClockIcon/TimeClockIcon16Light.js +0 -20
  425. package/internal/icons2022/TimeClockIcon/TimeClockIcon16Light.js.map +0 -1
  426. package/internal/icons2022/TimeClockIcon/TimeClockIcon20Light.d.ts +0 -2
  427. package/internal/icons2022/TimeClockIcon/TimeClockIcon20Light.js +0 -20
  428. package/internal/icons2022/TimeClockIcon/TimeClockIcon20Light.js.map +0 -1
  429. package/internal/icons2022/TimeClockIcon/TimeClockIcon24Regular.d.ts +0 -2
  430. package/internal/icons2022/TimeClockIcon/TimeClockIcon24Regular.js +0 -20
  431. package/internal/icons2022/TimeClockIcon/TimeClockIcon24Regular.js.map +0 -1
  432. /package/components/{TimePicker/locale → MaskedInputV2/internal}/types.js +0 -0
@@ -1,36 +0,0 @@
1
- var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
- return cooked;
4
- };
5
- import { memoizeGetStyles } from '../../lib/theming/Emotion.js';
6
- export var getStyles = memoizeGetStyles(function (_a) {
7
- var css = _a.css;
8
- return ({
9
- root: function () {
10
- return css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: inline-block;\n position: relative;\n line-height: normal;\n "], ["\n display: inline-block;\n position: relative;\n line-height: normal;\n "])));
11
- },
12
- popup: function (t) {
13
- return css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n background: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n font-variant-numeric: tabular-nums;\n overflow: hidden;\n "], ["\n background: ", ";\n border-radius: ", ";\n box-shadow: ", ";\n font-variant-numeric: tabular-nums;\n overflow: hidden;\n "])), t.timePickerPopupBg, t.timePickerPopupBorderRadius, t.timePickerPopupShadow);
14
- },
15
- item: function () {
16
- return css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: flex;\n align-items: center;\n width: 100%;\n font-variant-numeric: tabular-nums;\n "], ["\n display: flex;\n align-items: center;\n width: 100%;\n font-variant-numeric: tabular-nums;\n "])));
17
- },
18
- itemSmall: function (t) {
19
- return css(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n gap: ", ";\n "], ["\n gap: ", ";\n "])), t.timePickerItemGapSmall);
20
- },
21
- itemMedium: function (t) {
22
- return css(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n gap: ", ";\n "], ["\n gap: ", ";\n "])), t.timePickerItemGapMedium);
23
- },
24
- itemLarge: function (t) {
25
- return css(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n gap: ", ";\n "], ["\n gap: ", ";\n "])), t.timePickerItemGapLarge);
26
- },
27
- itemValue: function () {
28
- return css(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n "], ["\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n "])));
29
- },
30
- itemLabel: function (t) {
31
- return css(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n color: ", ";\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n "], ["\n color: ", ";\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n "])), t.menuItemCommentColor);
32
- },
33
- });
34
- });
35
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
36
- //# sourceMappingURL=TimePicker.styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TimePicker.styles.js","sourceRoot":"","sources":["TimePicker.styles.ts"],"names":[],"mappings":";;;;AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE,MAAM,CAAC,IAAM,SAAS,GAAG,gBAAgB,CAAC,UAAC,EAAgB;QAAd,GAAG,SAAA;IAAgB,OAAA,CAAC;QAC/D,IAAI;YACF,OAAO,GAAG,gKAAA,6FAIT,KAAC;QACJ,CAAC;QAED,KAAK,YAAC,CAAQ;YACZ,OAAO,GAAG,6NAAA,sBACM,EAAmB,0BAChB,EAA6B,uBAChC,EAAuB,6EAGtC,KALe,CAAC,CAAC,iBAAiB,EAChB,CAAC,CAAC,2BAA2B,EAChC,CAAC,CAAC,qBAAqB,EAGrC;QACJ,CAAC;QAED,IAAI;YACF,OAAO,GAAG,4LAAA,yHAKT,KAAC;QACJ,CAAC;QAED,SAAS,YAAC,CAAQ;YAChB,OAAO,GAAG,6FAAA,eACD,EAAwB,SAChC,KADQ,CAAC,CAAC,sBAAsB,EAC/B;QACJ,CAAC;QAED,UAAU,YAAC,CAAQ;YACjB,OAAO,GAAG,6FAAA,eACD,EAAyB,SACjC,KADQ,CAAC,CAAC,uBAAuB,EAChC;QACJ,CAAC;QAED,SAAS,YAAC,CAAQ;YAChB,OAAO,GAAG,6FAAA,eACD,EAAwB,SAChC,KADQ,CAAC,CAAC,sBAAsB,EAC/B;QACJ,CAAC;QAED,SAAS;YACP,OAAO,GAAG,kJAAA,+EAGT,KAAC;QACJ,CAAC;QAED,SAAS,YAAC,CAAQ;YAChB,OAAO,GAAG,sKAAA,iBACC,EAAsB,gFAGhC,KAHU,CAAC,CAAC,oBAAoB,EAG/B;QACJ,CAAC;KACF,CAAC;AA5D8D,CA4D9D,CAAC,CAAC","sourcesContent":["import type { Emotion } from '@emotion/css/create-instance';\n\nimport { memoizeGetStyles } from '../../lib/theming/Emotion.js';\nimport type { Theme } from '../../lib/theming/Theme.js';\n\nexport const getStyles = memoizeGetStyles(({ css }: Emotion) => ({\n root() {\n return css`\n display: inline-block;\n position: relative;\n line-height: normal;\n `;\n },\n\n popup(t: Theme) {\n return css`\n background: ${t.timePickerPopupBg};\n border-radius: ${t.timePickerPopupBorderRadius};\n box-shadow: ${t.timePickerPopupShadow};\n font-variant-numeric: tabular-nums;\n overflow: hidden;\n `;\n },\n\n item() {\n return css`\n display: flex;\n align-items: center;\n width: 100%;\n font-variant-numeric: tabular-nums;\n `;\n },\n\n itemSmall(t: Theme) {\n return css`\n gap: ${t.timePickerItemGapSmall};\n `;\n },\n\n itemMedium(t: Theme) {\n return css`\n gap: ${t.timePickerItemGapMedium};\n `;\n },\n\n itemLarge(t: Theme) {\n return css`\n gap: ${t.timePickerItemGapLarge};\n `;\n },\n\n itemValue() {\n return css`\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n `;\n },\n\n itemLabel(t: Theme) {\n return css`\n color: ${t.menuItemCommentColor};\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n `;\n },\n}));\n"]}
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import type { SizeProp } from '../../lib/types/props.js';
3
- import type { TimeFormat, TimeItem } from './helpers/TimePicker.shared.js';
4
- interface TimePickerItemsProps {
5
- itemIdPrefix?: string;
6
- format: TimeFormat;
7
- size: SizeProp;
8
- resolvedItems: TimeItem[];
9
- highlightedItemIndex: number | null;
10
- normalizedValue: string;
11
- itemRefs?: React.RefObject<Map<number, HTMLSpanElement>>;
12
- maxHeight?: React.CSSProperties['maxHeight'];
13
- disableScrollContainer?: boolean;
14
- onSelectItem(item: TimeItem): void;
15
- }
16
- export declare const TimePickerItems: (props: TimePickerItemsProps) => React.JSX.Element;
17
- export {};
@@ -1,80 +0,0 @@
1
- var __assign = (this && this.__assign) || function () {
2
- __assign = Object.assign || function(t) {
3
- for (var s, i = 1, n = arguments.length; i < n; i++) {
4
- s = arguments[i];
5
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
- t[p] = s[p];
7
- }
8
- return t;
9
- };
10
- return __assign.apply(this, arguments);
11
- };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
- import { cx } from '@emotion/css';
24
- import React, { useContext } from 'react';
25
- import { Menu } from '../../internal/Menu/index.js';
26
- import { useStyles } from '../../lib/renderEnvironment/index.js';
27
- import { ThemeContext } from '../../lib/theming/ThemeContext.js';
28
- import { MenuItem } from '../MenuItem/index.js';
29
- import { TimePickerDataTids } from './helpers/TimePicker.constants.js';
30
- import { normalizeTimeValue } from './helpers/TimePicker.value.js';
31
- import { getStyles } from './TimePicker.styles.js';
32
- var getItemSizeClassName = function (styles, theme, size) {
33
- switch (size) {
34
- case 'large':
35
- return styles.itemLarge(theme);
36
- case 'medium':
37
- return styles.itemMedium(theme);
38
- case 'small':
39
- default:
40
- return styles.itemSmall(theme);
41
- }
42
- };
43
- var ItemRoot = React.forwardRef(function (_a, ref) {
44
- var _b = _a.disabled, disabled = _b === void 0 ? false : _b, _state = _a.state, props = __rest(_a, ["disabled", "state"]);
45
- if (disabled) {
46
- return React.createElement("div", __assign({}, props, { ref: ref }));
47
- }
48
- return React.createElement("button", __assign({}, props, { ref: ref, type: 'button', disabled: disabled }));
49
- });
50
- export var TimePickerItems = function (props) {
51
- var itemIdPrefix = props.itemIdPrefix, format = props.format, size = props.size, resolvedItems = props.resolvedItems, highlightedItemIndex = props.highlightedItemIndex, normalizedValue = props.normalizedValue, itemRefs = props.itemRefs, maxHeight = props.maxHeight, disableScrollContainer = props.disableScrollContainer, onSelectItem = props.onSelectItem;
52
- var theme = useContext(ThemeContext);
53
- var styles = useStyles(getStyles);
54
- var itemSizeClassName = getItemSizeClassName(styles, theme, size);
55
- return (React.createElement(Menu, { hasMargin: false, width: '100%', maxHeight: maxHeight, disableScrollContainer: disableScrollContainer }, resolvedItems.map(function (item, index) {
56
- var normalizedItem = normalizeTimeValue(item.value, format);
57
- var state;
58
- if (highlightedItemIndex === index) {
59
- state = 'hover';
60
- }
61
- else if (normalizedItem === normalizedValue) {
62
- state = 'selected';
63
- }
64
- return (React.createElement(MenuItem, { key: "".concat(item.value, "-").concat(index), component: ItemRoot, disabled: item.disabled, isNotSelectable: item.disabled, size: size, state: state, onClick: item.disabled ? undefined : function () { return onSelectItem(item); } },
65
- React.createElement("span", { id: itemIdPrefix ? "".concat(itemIdPrefix, "-item-").concat(index) : undefined, "data-tid": TimePickerDataTids.item, className: cx(styles.item(), itemSizeClassName), ref: function (node) {
66
- if (!itemRefs) {
67
- return;
68
- }
69
- if (node) {
70
- itemRefs.current.set(index, node);
71
- }
72
- else {
73
- itemRefs.current.delete(index);
74
- }
75
- } },
76
- React.createElement("span", { className: styles.itemValue() }, normalizedItem),
77
- item.label && React.createElement("span", { className: styles.itemLabel(theme) }, item.label))));
78
- })));
79
- };
80
- //# sourceMappingURL=TimePickerItems.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TimePickerItems.js","sourceRoot":"","sources":["TimePickerItems.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OA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AAC,SAAS,CAAC,CAAC,CAAC,cAAM,OAAA,YAAY,CAAC,IAAI,CAAC,EAAlB,CAAkB;YAE7D,8BACE,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC,UAAG,YAAY,mBAAS,KAAK,CAAE,CAAC,CAAC,CAAC,SAAS,cACpD,kBAAkB,CAAC,IAAI,EACjC,SAAS,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,iBAAiB,CAAC,EAC/C,GAAG,EAAE,UAAC,IAAI;oBACR,IAAI,CAAC,QAAQ,EAAE,CAAC;wBACd,OAAO;oBACT,CAAC;oBAED,IAAI,IAAI,EAAE,CAAC;wBACT,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;oBACpC,CAAC;yBAAM,CAAC;wBACN,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;oBACjC,CAAC;gBACH,CAAC;gBAED,8BAAM,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,IAAG,cAAc,CAAQ;gBAC3D,IAAI,CAAC,KAAK,IAAI,8BAAM,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAG,IAAI,CAAC,KAAK,CAAQ,CACvE,CACE,CACZ,CAAC;IACJ,CAAC,CAAC,CACG,CACR,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import { cx } from '@emotion/css';\nimport React, { useContext } from 'react';\n\nimport { Menu } from '../../internal/Menu/index.js';\nimport { useStyles } from '../../lib/renderEnvironment/index.js';\nimport type { Theme } from '../../lib/theming/Theme.js';\nimport { ThemeContext } from '../../lib/theming/ThemeContext.js';\nimport type { SizeProp } from '../../lib/types/props.js';\nimport { MenuItem } from '../MenuItem/index.js';\nimport { TimePickerDataTids } from './helpers/TimePicker.constants.js';\nimport type { TimeFormat, TimeItem } from './helpers/TimePicker.shared.js';\nimport { normalizeTimeValue } from './helpers/TimePicker.value.js';\nimport { getStyles } from './TimePicker.styles.js';\n\nconst getItemSizeClassName = (styles: ReturnType<typeof getStyles>, theme: Theme, size: SizeProp): string => {\n switch (size) {\n case 'large':\n return styles.itemLarge(theme);\n case 'medium':\n return styles.itemMedium(theme);\n case 'small':\n default:\n return styles.itemSmall(theme);\n }\n};\n\nconst ItemRoot = React.forwardRef<\n HTMLElement,\n React.HTMLAttributes<HTMLElement> & { disabled?: boolean; state?: unknown }\n>(({ disabled = false, state: _state, ...props }, ref) => {\n if (disabled) {\n return <div {...props} ref={ref as React.Ref<HTMLDivElement>} />;\n }\n\n return <button {...props} ref={ref as React.Ref<HTMLButtonElement>} type={'button'} disabled={disabled} />;\n});\n\ninterface TimePickerItemsProps {\n itemIdPrefix?: string;\n format: TimeFormat;\n size: SizeProp;\n resolvedItems: TimeItem[];\n highlightedItemIndex: number | null;\n normalizedValue: string;\n itemRefs?: React.RefObject<Map<number, HTMLSpanElement>>;\n maxHeight?: React.CSSProperties['maxHeight'];\n disableScrollContainer?: boolean;\n onSelectItem(item: TimeItem): void;\n}\n\nexport const TimePickerItems = (props: TimePickerItemsProps) => {\n const {\n itemIdPrefix,\n format,\n size,\n resolvedItems,\n highlightedItemIndex,\n normalizedValue,\n itemRefs,\n maxHeight,\n disableScrollContainer,\n onSelectItem,\n } = props;\n\n const theme = useContext(ThemeContext);\n const styles = useStyles(getStyles);\n const itemSizeClassName = getItemSizeClassName(styles, theme, size);\n\n return (\n <Menu hasMargin={false} width={'100%'} maxHeight={maxHeight} disableScrollContainer={disableScrollContainer}>\n {resolvedItems.map((item, index) => {\n const normalizedItem = normalizeTimeValue(item.value, format);\n\n let state: 'hover' | 'selected' | undefined;\n\n if (highlightedItemIndex === index) {\n state = 'hover';\n } else if (normalizedItem === normalizedValue) {\n state = 'selected';\n }\n\n return (\n <MenuItem\n key={`${item.value}-${index}`}\n component={ItemRoot}\n disabled={item.disabled}\n isNotSelectable={item.disabled}\n size={size}\n state={state}\n onClick={item.disabled ? undefined : () => onSelectItem(item)}\n >\n <span\n id={itemIdPrefix ? `${itemIdPrefix}-item-${index}` : undefined}\n data-tid={TimePickerDataTids.item}\n className={cx(styles.item(), itemSizeClassName)}\n ref={(node) => {\n if (!itemRefs) {\n return;\n }\n\n if (node) {\n itemRefs.current.set(index, node);\n } else {\n itemRefs.current.delete(index);\n }\n }}\n >\n <span className={styles.itemValue()}>{normalizedItem}</span>\n {item.label && <span className={styles.itemLabel(theme)}>{item.label}</span>}\n </span>\n </MenuItem>\n );\n })}\n </Menu>\n );\n};\n"]}
@@ -1,38 +0,0 @@
1
- import React from 'react';
2
- import type { ReactNode } from 'react';
3
- import type { TimeInputRef } from '../../internal/TimeInput/index.js';
4
- import type { SizeProp } from '../../lib/types/props.js';
5
- import type { InputIconType } from '../Input/index.js';
6
- import type { TimeSegment, TimeFormat, TimeItem } from './helpers/TimePicker.shared.js';
7
- interface TimePickerMobilePopupProps {
8
- id?: string;
9
- opened: boolean;
10
- value: string;
11
- inputRef: React.RefObject<TimeInputRef | null>;
12
- disabled?: boolean;
13
- format: TimeFormat;
14
- size: SizeProp;
15
- rightIcon?: InputIconType;
16
- suffix?: ReactNode;
17
- resolvedItems: TimeItem[];
18
- highlightedItemIndex: number | null;
19
- normalizedValue: string;
20
- itemRefs: React.RefObject<Map<number, HTMLSpanElement>>;
21
- error?: boolean;
22
- warning?: boolean;
23
- 'aria-describedby'?: string;
24
- 'aria-label'?: string;
25
- 'aria-placeholder'?: string;
26
- onFocus(event: React.FocusEvent<HTMLInputElement>): void;
27
- onBlur(event: React.FocusEvent<HTMLInputElement>): void;
28
- onClick(event: React.MouseEvent<HTMLInputElement>): void;
29
- onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void;
30
- onMouseDownCapture(event: React.MouseEvent<HTMLInputElement>): void;
31
- onMouseUp(event: React.MouseEvent<HTMLInputElement>): void;
32
- onPaste(event: React.ClipboardEvent<HTMLInputElement>): void;
33
- onSelectSegment(segment: TimeSegment, event: React.MouseEvent<HTMLSpanElement>): void;
34
- onSelectItem(item: TimeItem): void;
35
- onCloseRequest(): void;
36
- }
37
- export declare const TimePickerMobilePopup: (props: TimePickerMobilePopupProps) => React.JSX.Element;
38
- export {};
@@ -1,21 +0,0 @@
1
- import React, { useLayoutEffect } from 'react';
2
- import { MobilePopup } from '../../internal/MobilePopup/index.js';
3
- import { TimeInput } from '../../internal/TimeInput/index.js';
4
- import { TimePickerDataTids } from './helpers/TimePicker.constants.js';
5
- import { TimePickerItems } from './TimePickerItems.js';
6
- export var TimePickerMobilePopup = function (props) {
7
- var id = props.id, opened = props.opened, value = props.value, inputRef = props.inputRef, disabled = props.disabled, format = props.format, size = props.size, rightIcon = props.rightIcon, suffix = props.suffix, resolvedItems = props.resolvedItems, highlightedItemIndex = props.highlightedItemIndex, normalizedValue = props.normalizedValue, itemRefs = props.itemRefs, error = props.error, warning = props.warning, ariaDescribedby = props["aria-describedby"], ariaLabel = props["aria-label"], ariaPlaceholder = props["aria-placeholder"], onFocus = props.onFocus, onBlur = props.onBlur, onClick = props.onClick, onKeyDown = props.onKeyDown, onMouseDownCapture = props.onMouseDownCapture, onMouseUp = props.onMouseUp, onPaste = props.onPaste, onSelectSegment = props.onSelectSegment, onSelectItem = props.onSelectItem, onCloseRequest = props.onCloseRequest;
8
- useLayoutEffect(function () {
9
- var timer = setTimeout(function () {
10
- var _a;
11
- (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
12
- });
13
- return function () {
14
- clearTimeout(timer);
15
- };
16
- }, [inputRef]);
17
- return (React.createElement(MobilePopup, { id: id, opened: opened, verticalAlign: 'center', size: size, headerChildComponent: React.createElement(TimeInput, { ref: inputRef, "data-tid": TimePickerDataTids.mobileInput, width: '100%', disabled: disabled, format: format, size: size, rightIcon: rightIcon, suffix: suffix, value: value, error: error, warning: warning, "aria-describedby": ariaDescribedby, "aria-label": ariaLabel, "aria-placeholder": ariaPlaceholder, onFocus: onFocus, onBlur: onBlur, onClick: onClick, onKeyDown: onKeyDown, onMouseDownCapture: onMouseDownCapture, onMouseUp: onMouseUp, onPaste: onPaste, onSelectSegment: onSelectSegment }), onCloseRequest: onCloseRequest },
18
- React.createElement("div", { "data-tid": TimePickerDataTids.mobilePopup },
19
- React.createElement(TimePickerItems, { itemIdPrefix: id, format: format, size: size, resolvedItems: resolvedItems, highlightedItemIndex: highlightedItemIndex, normalizedValue: normalizedValue, itemRefs: itemRefs, maxHeight: 'auto', disableScrollContainer: true, onSelectItem: onSelectItem }))));
20
- };
21
- //# sourceMappingURL=TimePickerMobilePopup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TimePickerMobilePopup.js","sourceRoot":"","sources":["TimePickerMobilePopup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAG/C,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAElE,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAG9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAiCvD,MAAM,CAAC,IAAM,qBAAqB,GAAG,UAAC,KAAiC;IAEnE,IAAA,EAAE,GA4BA,KAAK,GA5BL,EACF,MAAM,GA2BJ,KAAK,OA3BD,EACN,KAAK,GA0BH,KAAK,MA1BF,EACL,QAAQ,GAyBN,KAAK,SAzBC,EACR,QAAQ,GAwBN,KAAK,SAxBC,EACR,MAAM,GAuBJ,KAAK,OAvBD,EACN,IAAI,GAsBF,KAAK,KAtBH,EACJ,SAAS,GAqBP,KAAK,UArBE,EACT,MAAM,GAoBJ,KAAK,OApBD,EACN,aAAa,GAmBX,KAAK,cAnBM,EACb,oBAAoB,GAkBlB,KAAK,qBAlBa,EACpB,eAAe,GAiBb,KAAK,gBAjBQ,EACf,QAAQ,GAgBN,KAAK,SAhBC,EACR,KAAK,GAeH,KAAK,MAfF,EACL,OAAO,GAcL,KAAK,QAdA,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SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,eAAe,GAChC,EAEJ,cAAc,EAAE,cAAc;QAE9B,yCAAe,kBAAkB,CAAC,WAAW;YAC3C,oBAAC,eAAe,IACd,YAAY,EAAE,EAAE,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,aAAa,EAC5B,oBAAoB,EAAE,oBAAoB,EAC1C,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,MAAM,EACjB,sBAAsB,QACtB,YAAY,EAAE,YAAY,GAC1B,CACE,CACM,CACf,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React, { useLayoutEffect } from 'react';\nimport type { ReactNode } from 'react';\n\nimport { MobilePopup } from '../../internal/MobilePopup/index.js';\nimport type { TimeInputRef } from '../../internal/TimeInput/index.js';\nimport { TimeInput } from '../../internal/TimeInput/index.js';\nimport type { SizeProp } from '../../lib/types/props.js';\nimport type { InputIconType } from '../Input/index.js';\nimport { TimePickerDataTids } from './helpers/TimePicker.constants.js';\nimport type { TimeSegment, TimeFormat, TimeItem } from './helpers/TimePicker.shared.js';\nimport { TimePickerItems } from './TimePickerItems.js';\n\ninterface TimePickerMobilePopupProps {\n id?: string;\n opened: boolean;\n value: string;\n inputRef: React.RefObject<TimeInputRef | null>;\n disabled?: boolean;\n format: TimeFormat;\n size: SizeProp;\n rightIcon?: InputIconType;\n suffix?: ReactNode;\n resolvedItems: TimeItem[];\n highlightedItemIndex: number | null;\n normalizedValue: string;\n itemRefs: React.RefObject<Map<number, HTMLSpanElement>>;\n error?: boolean;\n warning?: boolean;\n 'aria-describedby'?: string;\n 'aria-label'?: string;\n 'aria-placeholder'?: string;\n onFocus(event: React.FocusEvent<HTMLInputElement>): void;\n onBlur(event: React.FocusEvent<HTMLInputElement>): void;\n onClick(event: React.MouseEvent<HTMLInputElement>): void;\n onKeyDown(event: React.KeyboardEvent<HTMLInputElement>): void;\n onMouseDownCapture(event: React.MouseEvent<HTMLInputElement>): void;\n onMouseUp(event: React.MouseEvent<HTMLInputElement>): void;\n onPaste(event: React.ClipboardEvent<HTMLInputElement>): void;\n onSelectSegment(segment: TimeSegment, event: React.MouseEvent<HTMLSpanElement>): void;\n onSelectItem(item: TimeItem): void;\n onCloseRequest(): void;\n}\n\nexport const TimePickerMobilePopup = (props: TimePickerMobilePopupProps) => {\n const {\n id,\n opened,\n value,\n inputRef,\n disabled,\n format,\n size,\n rightIcon,\n suffix,\n resolvedItems,\n highlightedItemIndex,\n normalizedValue,\n itemRefs,\n error,\n warning,\n 'aria-describedby': ariaDescribedby,\n 'aria-label': ariaLabel,\n 'aria-placeholder': ariaPlaceholder,\n onFocus,\n onBlur,\n onClick,\n onKeyDown,\n onMouseDownCapture,\n onMouseUp,\n onPaste,\n onSelectSegment,\n onSelectItem,\n onCloseRequest,\n } = props;\n\n useLayoutEffect(() => {\n const timer = setTimeout(() => {\n inputRef.current?.focus();\n });\n\n return () => {\n clearTimeout(timer);\n };\n }, [inputRef]);\n\n return (\n <MobilePopup\n id={id}\n opened={opened}\n verticalAlign={'center'}\n size={size}\n headerChildComponent={\n <TimeInput\n ref={inputRef}\n data-tid={TimePickerDataTids.mobileInput}\n width={'100%'}\n disabled={disabled}\n format={format}\n size={size}\n rightIcon={rightIcon}\n suffix={suffix}\n value={value}\n error={error}\n warning={warning}\n aria-describedby={ariaDescribedby}\n aria-label={ariaLabel}\n aria-placeholder={ariaPlaceholder}\n onFocus={onFocus}\n onBlur={onBlur}\n onClick={onClick}\n onKeyDown={onKeyDown}\n onMouseDownCapture={onMouseDownCapture}\n onMouseUp={onMouseUp}\n onPaste={onPaste}\n onSelectSegment={onSelectSegment}\n />\n }\n onCloseRequest={onCloseRequest}\n >\n <div data-tid={TimePickerDataTids.mobilePopup}>\n <TimePickerItems\n itemIdPrefix={id}\n format={format}\n size={size}\n resolvedItems={resolvedItems}\n highlightedItemIndex={highlightedItemIndex}\n normalizedValue={normalizedValue}\n itemRefs={itemRefs}\n maxHeight={'auto'}\n disableScrollContainer\n onSelectItem={onSelectItem}\n />\n </div>\n </MobilePopup>\n );\n};\n"]}
@@ -1,20 +0,0 @@
1
- import React from 'react';
2
- import type { SizeProp } from '../../lib/types/props.js';
3
- import type { TimeFormat, TimeItem } from './helpers/TimePicker.shared.js';
4
- interface TimePickerPopupProps {
5
- id?: string;
6
- anchorElement: HTMLElement;
7
- menuPos?: 'top' | 'bottom';
8
- menuAlign?: 'left' | 'right';
9
- menuWidth?: React.CSSProperties['width'];
10
- popupMaxHeight: string;
11
- format: TimeFormat;
12
- size: SizeProp;
13
- resolvedItems: TimeItem[];
14
- highlightedItemIndex: number | null;
15
- normalizedValue: string;
16
- itemRefs: React.RefObject<Map<number, HTMLSpanElement>>;
17
- onSelectItem(item: TimeItem): void;
18
- }
19
- export declare const TimePickerPopup: (props: TimePickerPopupProps) => React.JSX.Element;
20
- export {};
@@ -1,18 +0,0 @@
1
- import React, { useContext } from 'react';
2
- import { Popup } from '../../internal/Popup/index.js';
3
- import { ZIndex } from '../../internal/ZIndex/index.js';
4
- import { getMenuPositions } from '../../lib/getMenuPositions.js';
5
- import { useStyles } from '../../lib/renderEnvironment/index.js';
6
- import { ThemeContext } from '../../lib/theming/ThemeContext.js';
7
- import { TimePickerDataTids } from './helpers/TimePicker.constants.js';
8
- import { getStyles } from './TimePicker.styles.js';
9
- import { TimePickerItems } from './TimePickerItems.js';
10
- export var TimePickerPopup = function (props) {
11
- var id = props.id, anchorElement = props.anchorElement, menuPos = props.menuPos, menuAlign = props.menuAlign, menuWidth = props.menuWidth, popupMaxHeight = props.popupMaxHeight, format = props.format, size = props.size, resolvedItems = props.resolvedItems, highlightedItemIndex = props.highlightedItemIndex, normalizedValue = props.normalizedValue, itemRefs = props.itemRefs, onSelectItem = props.onSelectItem;
12
- var theme = useContext(ThemeContext);
13
- var styles = useStyles(getStyles);
14
- return (React.createElement(Popup, { id: id, opened: true, hasShadow: true, anchorElement: anchorElement, "data-tid": TimePickerDataTids.popup, priority: ZIndex.priorities.PopupMenu, margin: parseInt(theme.timePickerMenuOffsetY), width: menuWidth, minWidth: menuWidth === undefined ? '100%' : undefined, positions: getMenuPositions(menuPos, menuAlign) },
15
- React.createElement("div", { className: styles.popup(theme), onMouseDown: function (event) { return event.preventDefault(); } },
16
- React.createElement(TimePickerItems, { itemIdPrefix: id, format: format, size: size, resolvedItems: resolvedItems, highlightedItemIndex: highlightedItemIndex, normalizedValue: normalizedValue, itemRefs: itemRefs, maxHeight: popupMaxHeight, onSelectItem: onSelectItem }))));
17
- };
18
- //# sourceMappingURL=TimePickerPopup.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TimePickerPopup.js","sourceRoot":"","sources":["TimePickerPopup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAkBvD,MAAM,CAAC,IAAM,eAAe,GAAG,UAAC,KAA2B;IAEvD,IAAA,EAAE,GAaA,KAAK,GAbL,EACF,aAAa,GAYX,KAAK,cAZM,EACb,OAAO,GAWL,KAAK,QAXA,EACP,SAAS,GAUP,KAAK,UAVE,EACT,SAAS,GASP,KAAK,UATE,EACT,cAAc,GAQZ,KAAK,eARO,EACd,MAAM,GAOJ,KAAK,OAPD,EACN,IAAI,GAMF,KAAK,KANH,EACJ,aAAa,GAKX,KAAK,cALM,EACb,oBAAoB,GAIlB,KAAK,qBAJa,EACpB,eAAe,GAGb,KAAK,gBAHQ,EACf,QAAQ,GAEN,KAAK,SAFC,EACR,YAAY,GACV,KAAK,aADK,CACJ;IAEV,IAAM,KAAK,GAAG,UAAU,CAAC,YAAY,CAAC,CAAC;IACvC,IAAM,MAAM,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC;IAEpC,OAAO,CACL,oBAAC,KAAK,IACJ,EAAE,EAAE,EAAE,EACN,MAAM,QACN,SAAS,QACT,aAAa,EAAE,aAAa,cAClB,kBAAkB,CAAC,KAAK,EAClC,QAAQ,EAAE,MAAM,CAAC,UAAU,CAAC,SAAS,EACrC,MAAM,EAAE,QAAQ,CAAC,KAAK,CAAC,qBAAqB,CAAC,EAC7C,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EACtD,SAAS,EAAE,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC;QAE/C,6BAAK,SAAS,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,WAAW,EAAE,UAAC,KAAK,IAAK,OAAA,KAAK,CAAC,cAAc,EAAE,EAAtB,CAAsB;YACjF,oBAAC,eAAe,IACd,YAAY,EAAE,EAAE,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,aAAa,EAC5B,oBAAoB,EAAE,oBAAoB,EAC1C,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,cAAc,EACzB,YAAY,EAAE,YAAY,GAC1B,CACE,CACA,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import React, { useContext } from 'react';\n\nimport { Popup } from '../../internal/Popup/index.js';\nimport { ZIndex } from '../../internal/ZIndex/index.js';\nimport { getMenuPositions } from '../../lib/getMenuPositions.js';\nimport { useStyles } from '../../lib/renderEnvironment/index.js';\nimport { ThemeContext } from '../../lib/theming/ThemeContext.js';\nimport type { SizeProp } from '../../lib/types/props.js';\nimport { TimePickerDataTids } from './helpers/TimePicker.constants.js';\nimport type { TimeFormat, TimeItem } from './helpers/TimePicker.shared.js';\nimport { getStyles } from './TimePicker.styles.js';\nimport { TimePickerItems } from './TimePickerItems.js';\n\ninterface TimePickerPopupProps {\n id?: string;\n anchorElement: HTMLElement;\n menuPos?: 'top' | 'bottom';\n menuAlign?: 'left' | 'right';\n menuWidth?: React.CSSProperties['width'];\n popupMaxHeight: string;\n format: TimeFormat;\n size: SizeProp;\n resolvedItems: TimeItem[];\n highlightedItemIndex: number | null;\n normalizedValue: string;\n itemRefs: React.RefObject<Map<number, HTMLSpanElement>>;\n onSelectItem(item: TimeItem): void;\n}\n\nexport const TimePickerPopup = (props: TimePickerPopupProps) => {\n const {\n id,\n anchorElement,\n menuPos,\n menuAlign,\n menuWidth,\n popupMaxHeight,\n format,\n size,\n resolvedItems,\n highlightedItemIndex,\n normalizedValue,\n itemRefs,\n onSelectItem,\n } = props;\n\n const theme = useContext(ThemeContext);\n const styles = useStyles(getStyles);\n\n return (\n <Popup\n id={id}\n opened\n hasShadow\n anchorElement={anchorElement}\n data-tid={TimePickerDataTids.popup}\n priority={ZIndex.priorities.PopupMenu}\n margin={parseInt(theme.timePickerMenuOffsetY)}\n width={menuWidth}\n minWidth={menuWidth === undefined ? '100%' : undefined}\n positions={getMenuPositions(menuPos, menuAlign)}\n >\n <div className={styles.popup(theme)} onMouseDown={(event) => event.preventDefault()}>\n <TimePickerItems\n itemIdPrefix={id}\n format={format}\n size={size}\n resolvedItems={resolvedItems}\n highlightedItemIndex={highlightedItemIndex}\n normalizedValue={normalizedValue}\n itemRefs={itemRefs}\n maxHeight={popupMaxHeight}\n onSelectItem={onSelectItem}\n />\n </div>\n </Popup>\n );\n};\n"]}
@@ -1,22 +0,0 @@
1
- import type { TimeFormat, TimeSegment } from './TimePicker.shared.js';
2
- export declare const TimePickerDataTids: {
3
- readonly root: "TimePicker__root";
4
- readonly input: "TimePicker__input";
5
- readonly mobileInput: "TimePicker__mobileInput";
6
- readonly nativeInput: "TimePicker__nativeInput";
7
- readonly popup: "TimePicker__popup";
8
- readonly mobilePopup: "TimePicker__mobilePopup";
9
- readonly item: "TimePicker__item";
10
- };
11
- export declare const TIME_PLACEHOLDER_CHAR = "\u2212";
12
- export declare const TIME_SEPARATOR = ":";
13
- export declare const TIME_SEGMENT_LENGTH = 2;
14
- export declare const HOURS_MAX_VALUE = 23;
15
- export declare const MINUTES_AND_SECONDS_MAX_VALUE = 59;
16
- export declare const ZERO_PAD_CHAR = "0";
17
- export declare const EMPTY_VALUE = "";
18
- export declare const DIGIT_REGEXP: RegExp;
19
- export declare const NON_DIGIT_REGEXP: RegExp;
20
- export declare const EMPTY_SEGMENT: string;
21
- export declare const TIME_SEGMENTS_BY_FORMAT: Record<TimeFormat, TimeSegment[]>;
22
- export declare const FIRST_DIGIT_MAX_BY_SEGMENT: Record<TimeSegment, number>;
@@ -1,31 +0,0 @@
1
- export var TimePickerDataTids = {
2
- root: 'TimePicker__root',
3
- input: 'TimePicker__input',
4
- mobileInput: 'TimePicker__mobileInput',
5
- nativeInput: 'TimePicker__nativeInput',
6
- popup: 'TimePicker__popup',
7
- mobilePopup: 'TimePicker__mobilePopup',
8
- item: 'TimePicker__item',
9
- };
10
- var HOURS_FIRST_DIGIT_MAX = 2;
11
- var MINUTES_AND_SECONDS_FIRST_DIGIT_MAX = 5;
12
- export var TIME_PLACEHOLDER_CHAR = '\u2212';
13
- export var TIME_SEPARATOR = ':';
14
- export var TIME_SEGMENT_LENGTH = 2;
15
- export var HOURS_MAX_VALUE = 23;
16
- export var MINUTES_AND_SECONDS_MAX_VALUE = 59;
17
- export var ZERO_PAD_CHAR = '0';
18
- export var EMPTY_VALUE = '';
19
- export var DIGIT_REGEXP = /\d/;
20
- export var NON_DIGIT_REGEXP = /\D/g;
21
- export var EMPTY_SEGMENT = TIME_PLACEHOLDER_CHAR.repeat(TIME_SEGMENT_LENGTH);
22
- export var TIME_SEGMENTS_BY_FORMAT = {
23
- 'HH:mm': ['hours', 'minutes'],
24
- 'HH:mm:ss': ['hours', 'minutes', 'seconds'],
25
- };
26
- export var FIRST_DIGIT_MAX_BY_SEGMENT = {
27
- hours: HOURS_FIRST_DIGIT_MAX,
28
- minutes: MINUTES_AND_SECONDS_FIRST_DIGIT_MAX,
29
- seconds: MINUTES_AND_SECONDS_FIRST_DIGIT_MAX,
30
- };
31
- //# sourceMappingURL=TimePicker.constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TimePicker.constants.js","sourceRoot":"","sources":["TimePicker.constants.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,IAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,yBAAyB;IACtC,WAAW,EAAE,yBAAyB;IACtC,KAAK,EAAE,mBAAmB;IAC1B,WAAW,EAAE,yBAAyB;IACtC,IAAI,EAAE,kBAAkB;CAChB,CAAC;AAEX,IAAM,qBAAqB,GAAG,CAAC,CAAC;AAChC,IAAM,mCAAmC,GAAG,CAAC,CAAC;AAC9C,MAAM,CAAC,IAAM,qBAAqB,GAAG,QAAQ,CAAC;AAC9C,MAAM,CAAC,IAAM,cAAc,GAAG,GAAG,CAAC;AAClC,MAAM,CAAC,IAAM,mBAAmB,GAAG,CAAC,CAAC;AACrC,MAAM,CAAC,IAAM,eAAe,GAAG,EAAE,CAAC;AAClC,MAAM,CAAC,IAAM,6BAA6B,GAAG,EAAE,CAAC;AAChD,MAAM,CAAC,IAAM,aAAa,GAAG,GAAG,CAAC;AACjC,MAAM,CAAC,IAAM,WAAW,GAAG,EAAE,CAAC;AAC9B,MAAM,CAAC,IAAM,YAAY,GAAG,IAAI,CAAC;AACjC,MAAM,CAAC,IAAM,gBAAgB,GAAG,KAAK,CAAC;AACtC,MAAM,CAAC,IAAM,aAAa,GAAG,qBAAqB,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC;AAE/E,MAAM,CAAC,IAAM,uBAAuB,GAAsC;IACxE,OAAO,EAAE,CAAC,OAAO,EAAE,SAAS,CAAC;IAC7B,UAAU,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,SAAS,CAAC;CAC5C,CAAC;AAEF,MAAM,CAAC,IAAM,0BAA0B,GAAgC;IACrE,KAAK,EAAE,qBAAqB;IAC5B,OAAO,EAAE,mCAAmC;IAC5C,OAAO,EAAE,mCAAmC;CAC7C,CAAC","sourcesContent":["import type { TimeFormat, TimeSegment } from './TimePicker.shared.js';\n\nexport const TimePickerDataTids = {\n root: 'TimePicker__root',\n input: 'TimePicker__input',\n mobileInput: 'TimePicker__mobileInput',\n nativeInput: 'TimePicker__nativeInput',\n popup: 'TimePicker__popup',\n mobilePopup: 'TimePicker__mobilePopup',\n item: 'TimePicker__item',\n} as const;\n\nconst HOURS_FIRST_DIGIT_MAX = 2;\nconst MINUTES_AND_SECONDS_FIRST_DIGIT_MAX = 5;\nexport const TIME_PLACEHOLDER_CHAR = '\\u2212';\nexport const TIME_SEPARATOR = ':';\nexport const TIME_SEGMENT_LENGTH = 2;\nexport const HOURS_MAX_VALUE = 23;\nexport const MINUTES_AND_SECONDS_MAX_VALUE = 59;\nexport const ZERO_PAD_CHAR = '0';\nexport const EMPTY_VALUE = '';\nexport const DIGIT_REGEXP = /\\d/;\nexport const NON_DIGIT_REGEXP = /\\D/g;\nexport const EMPTY_SEGMENT = TIME_PLACEHOLDER_CHAR.repeat(TIME_SEGMENT_LENGTH);\n\nexport const TIME_SEGMENTS_BY_FORMAT: Record<TimeFormat, TimeSegment[]> = {\n 'HH:mm': ['hours', 'minutes'],\n 'HH:mm:ss': ['hours', 'minutes', 'seconds'],\n};\n\nexport const FIRST_DIGIT_MAX_BY_SEGMENT: Record<TimeSegment, number> = {\n hours: HOURS_FIRST_DIGIT_MAX,\n minutes: MINUTES_AND_SECONDS_FIRST_DIGIT_MAX,\n seconds: MINUTES_AND_SECONDS_FIRST_DIGIT_MAX,\n};\n"]}
@@ -1,23 +0,0 @@
1
- import { type TimeDigitInputResult, type TimeFormat, type TimeSegment } from './TimePicker.shared.js';
2
- /**
3
- * Удаляет одну цифру из активного сегмента справа налево.
4
- * Сначала превращает заполненный сегмент в значение с одной ожидающей цифрой,
5
- * затем — в полностью пустой сегмент.
6
- */
7
- export declare const deleteTimeSegmentDigit: (value: string, segment: TimeSegment, format: TimeFormat) => string;
8
- /**
9
- * Коммитит активный сегмент при уходе с него или потере фокуса.
10
- * Частично введенное значение дополняется и нормализуется, а полностью пустой сегмент остается пустым.
11
- */
12
- export declare const commitTimeSegmentOnLeave: (value: string, segment: TimeSegment, format: TimeFormat) => string;
13
- /**
14
- * Сдвигает значение активного сегмента на шаг вверх или вниз с циклическим переходом по границам.
15
- * Пустой сегмент трактуется как `00`.
16
- */
17
- export declare const shiftTimeSegmentValue: (value: string, segment: TimeSegment, step: 1 | -1, format: TimeFormat) => string;
18
- /**
19
- * Обрабатывает ввод одной цифры в активный сегмент.
20
- * Возвращает следующее display-значение и метаданные для UI:
21
- * нужно ли завершить сегмент, перейти к следующему сегменту или показать анимацию ошибки.
22
- */
23
- export declare const formatDigitToTimeSegment: (value: string, segment: TimeSegment, digit: string, format: TimeFormat) => TimeDigitInputResult;
@@ -1,101 +0,0 @@
1
- import { DIGIT_REGEXP, EMPTY_SEGMENT, EMPTY_VALUE, FIRST_DIGIT_MAX_BY_SEGMENT, TIME_PLACEHOLDER_CHAR, TIME_SEGMENT_LENGTH, ZERO_PAD_CHAR, } from './TimePicker.constants.js';
2
- import { getNextTimeSegment } from './TimePicker.selection.js';
3
- import { getDigits, getTimeSegmentMax, hasPendingSingleDigit, normalizeEditableSegment, } from './TimePicker.shared.js';
4
- import { getTimeSegmentValue, replaceTimeSegment } from './TimePicker.value.js';
5
- /**
6
- * Удаляет одну цифру из активного сегмента справа налево.
7
- * Сначала превращает заполненный сегмент в значение с одной ожидающей цифрой,
8
- * затем — в полностью пустой сегмент.
9
- */
10
- export var deleteTimeSegmentDigit = function (value, segment, format) {
11
- var currentSegmentValue = getTimeSegmentValue(value, segment, format);
12
- var _a = Array.from(currentSegmentValue), first = _a[0], second = _a[1];
13
- if (DIGIT_REGEXP.test(second !== null && second !== void 0 ? second : EMPTY_VALUE)) {
14
- return replaceTimeSegment(value, segment, "".concat(first).concat(TIME_PLACEHOLDER_CHAR), format);
15
- }
16
- if (DIGIT_REGEXP.test(first !== null && first !== void 0 ? first : EMPTY_VALUE)) {
17
- return replaceTimeSegment(value, segment, EMPTY_SEGMENT, format);
18
- }
19
- return value;
20
- };
21
- /**
22
- * Коммитит активный сегмент при уходе с него или потере фокуса.
23
- * Частично введенное значение дополняется и нормализуется, а полностью пустой сегмент остается пустым.
24
- */
25
- export var commitTimeSegmentOnLeave = function (value, segment, format) {
26
- var nextValue = normalizeEditableSegment(getTimeSegmentValue(value, segment, format), segment);
27
- if (nextValue === EMPTY_SEGMENT) {
28
- return replaceTimeSegment(value, segment, EMPTY_SEGMENT, format);
29
- }
30
- return replaceTimeSegment(value, segment, nextValue, format);
31
- };
32
- /**
33
- * Сдвигает значение активного сегмента на шаг вверх или вниз с циклическим переходом по границам.
34
- * Пустой сегмент трактуется как `00`.
35
- */
36
- export var shiftTimeSegmentValue = function (value, segment, step, format) {
37
- var currentSegmentValue = getTimeSegmentValue(value, segment, format);
38
- var normalizedSegmentValue = normalizeEditableSegment(currentSegmentValue, segment);
39
- var max = getTimeSegmentMax(segment);
40
- var current = normalizedSegmentValue === EMPTY_SEGMENT ? 0 : Number(normalizedSegmentValue);
41
- var next = (current + step + max + 1) % (max + 1);
42
- return replaceTimeSegment(value, segment, String(next).padStart(TIME_SEGMENT_LENGTH, ZERO_PAD_CHAR), format);
43
- };
44
- /**
45
- * Обрабатывает ввод одной цифры в активный сегмент.
46
- * Возвращает следующее display-значение и метаданные для UI:
47
- * нужно ли завершить сегмент, перейти к следующему сегменту или показать анимацию ошибки.
48
- */
49
- export var formatDigitToTimeSegment = function (value, segment, digit, format) {
50
- var currentSegmentValue = getTimeSegmentValue(value, segment, format);
51
- var nextSegment = getNextTimeSegment(segment, format);
52
- var shouldAppend = hasPendingSingleDigit(currentSegmentValue);
53
- var currentDigits = shouldAppend ? getDigits(currentSegmentValue) : '';
54
- var firstDigitThreshold = FIRST_DIGIT_MAX_BY_SEGMENT[segment];
55
- if (currentDigits.length === 0) {
56
- if (segment === 'hours' && Number(digit) > firstDigitThreshold) {
57
- var nextValue_1 = replaceTimeSegment(value, segment, "0".concat(digit), format);
58
- return {
59
- isFinalPart: nextSegment === null,
60
- isCompletedPart: true,
61
- shouldBlink: false,
62
- selectedSegment: nextSegment !== null && nextSegment !== void 0 ? nextSegment : segment,
63
- nextValue: nextValue_1,
64
- };
65
- }
66
- return {
67
- isFinalPart: false,
68
- isCompletedPart: false,
69
- shouldBlink: false,
70
- selectedSegment: segment,
71
- nextValue: replaceTimeSegment(value, segment, "".concat(digit).concat(TIME_PLACEHOLDER_CHAR), format),
72
- };
73
- }
74
- if (segment === 'hours' && currentDigits === '2' && Number(digit) > 3) {
75
- return {
76
- isFinalPart: false,
77
- isCompletedPart: false,
78
- shouldBlink: true,
79
- selectedSegment: segment,
80
- nextValue: value,
81
- };
82
- }
83
- if (segment !== 'hours' && Number("".concat(currentDigits).concat(digit)) > getTimeSegmentMax(segment)) {
84
- return {
85
- isFinalPart: false,
86
- isCompletedPart: false,
87
- shouldBlink: true,
88
- selectedSegment: segment,
89
- nextValue: value,
90
- };
91
- }
92
- var nextValue = replaceTimeSegment(value, segment, String(Number("".concat(currentDigits).concat(digit))).padStart(TIME_SEGMENT_LENGTH, ZERO_PAD_CHAR), format);
93
- return {
94
- isFinalPart: nextSegment === null,
95
- isCompletedPart: true,
96
- shouldBlink: false,
97
- selectedSegment: nextSegment !== null && nextSegment !== void 0 ? nextSegment : segment,
98
- nextValue: nextValue,
99
- };
100
- };
101
- //# sourceMappingURL=TimePicker.editing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TimePicker.editing.js","sourceRoot":"","sources":["TimePicker.editing.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,WAAW,EACX,0BAA0B,EAC1B,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,GACd,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,GAIzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhF;;;;GAIG;AACH,MAAM,CAAC,IAAM,sBAAsB,GAAG,UAAC,KAAa,EAAE,OAAoB,EAAE,MAAkB;IAC5F,IAAM,mBAAmB,GAAG,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAElE,IAAA,KAAkB,KAAK,CAAC,IAAI,CAAC,mBAAmB,CAAC,EAAhD,KAAK,QAAA,EAAE,MAAM,QAAmC,CAAC;IAExD,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,WAAW,CAAC,EAAE,CAAC;QAC7C,OAAO,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,UAAG,KAAK,SAAG,qBAAqB,CAAE,EAAE,MAAM,CAAC,CAAC;IACxF,CAAC;IAED,IAAI,YAAY,CAAC,IAAI,CAAC,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,WAAW,CAAC,EAAE,CAAC;QAC5C,OAAO,kBAAkB,CAAC,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF;;;GAG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eAAe,EAAE,KAAK;YACtB,WAAW,EAAE,IAAI;YACjB,eAAe,EAAE,OAAO;YACxB,SAAS,EAAE,KAAK;SACjB,CAAC;IACJ,CAAC;IAED,IAAI,OAAO,KAAK,OAAO,IAAI,MAAM,CAAC,UAAG,aAAa,SAAG,KAAK,CAAE,CAAC,GAAG,iBAAiB,CAAC,OAAO,CAAC,EAAE,CAAC;QAC3F,OAAO;YACL,WAAW,EAAE,KAAK;YAClB,eAAe,EAAE,KAAK;YACtB,WAAW,EAAE,IAAI;YACjB,eAAe,EAAE,OAAO;YACxB,SAAS,EAAE,KAAK;SACjB,CAAC;IACJ,CAAC;IAED,IAAM,SAAS,GAAG,kBAAkB,CAClC,KAAK,EACL,OAAO,EACP,MAAM,CAAC,MAAM,CAAC,UAAG,aAAa,SAAG,KAAK,CAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,mBAAmB,EAAE,aAAa,CAAC,EACvF,MAAM,CACP,CAAC;IAEF,OAAO;QACL,WAAW,EAAE,WAAW,KAAK,IAAI;QACjC,eAAe,EAAE,IAAI;QACrB,WAAW,EAAE,KAAK;QAClB,eAAe,EAAE,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,OAAO;QACvC,SAAS,WAAA;KACV,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {\n DIGIT_REGEXP,\n EMPTY_SEGMENT,\n EMPTY_VALUE,\n FIRST_DIGIT_MAX_BY_SEGMENT,\n TIME_PLACEHOLDER_CHAR,\n TIME_SEGMENT_LENGTH,\n ZERO_PAD_CHAR,\n} from './TimePicker.constants.js';\nimport { getNextTimeSegment } from './TimePicker.selection.js';\nimport {\n getDigits,\n getTimeSegmentMax,\n hasPendingSingleDigit,\n normalizeEditableSegment,\n type TimeDigitInputResult,\n type TimeFormat,\n type TimeSegment,\n} from './TimePicker.shared.js';\nimport { getTimeSegmentValue, replaceTimeSegment } from './TimePicker.value.js';\n\n/**\n * Удаляет одну цифру из активного сегмента справа налево.\n * Сначала превращает заполненный сегмент в значение с одной ожидающей цифрой,\n * затем — в полностью пустой сегмент.\n */\nexport const deleteTimeSegmentDigit = (value: string, segment: TimeSegment, format: TimeFormat): string => {\n const currentSegmentValue = getTimeSegmentValue(value, segment, format);\n\n const [first, second] = Array.from(currentSegmentValue);\n\n if (DIGIT_REGEXP.test(second ?? EMPTY_VALUE)) {\n return replaceTimeSegment(value, segment, `${first}${TIME_PLACEHOLDER_CHAR}`, format);\n }\n\n if (DIGIT_REGEXP.test(first ?? EMPTY_VALUE)) {\n return replaceTimeSegment(value, segment, EMPTY_SEGMENT, format);\n }\n\n return value;\n};\n\n/**\n * Коммитит активный сегмент при уходе с него или потере фокуса.\n * Частично введенное значение дополняется и нормализуется, а полностью пустой сегмент остается пустым.\n */\nexport const commitTimeSegmentOnLeave = (value: string, segment: TimeSegment, format: TimeFormat): string => {\n const nextValue = normalizeEditableSegment(getTimeSegmentValue(value, segment, format), segment);\n\n if (nextValue === EMPTY_SEGMENT) {\n return replaceTimeSegment(value, segment, EMPTY_SEGMENT, format);\n }\n\n return replaceTimeSegment(value, segment, nextValue, format);\n};\n\n/**\n * Сдвигает значение активного сегмента на шаг вверх или вниз с циклическим переходом по границам.\n * Пустой сегмент трактуется как `00`.\n */\nexport const shiftTimeSegmentValue = (\n value: string,\n segment: TimeSegment,\n step: 1 | -1,\n format: TimeFormat,\n): string => {\n const currentSegmentValue = getTimeSegmentValue(value, segment, format);\n\n const normalizedSegmentValue = normalizeEditableSegment(currentSegmentValue, segment);\n\n const max = getTimeSegmentMax(segment);\n\n const current = normalizedSegmentValue === EMPTY_SEGMENT ? 0 : Number(normalizedSegmentValue);\n const next = (current + step + max + 1) % (max + 1);\n\n return replaceTimeSegment(value, segment, String(next).padStart(TIME_SEGMENT_LENGTH, ZERO_PAD_CHAR), format);\n};\n\n/**\n * Обрабатывает ввод одной цифры в активный сегмент.\n * Возвращает следующее display-значение и метаданные для UI:\n * нужно ли завершить сегмент, перейти к следующему сегменту или показать анимацию ошибки.\n */\nexport const formatDigitToTimeSegment = (\n value: string,\n segment: TimeSegment,\n digit: string,\n format: TimeFormat,\n): TimeDigitInputResult => {\n const currentSegmentValue = getTimeSegmentValue(value, segment, format);\n\n const nextSegment = getNextTimeSegment(segment, format);\n\n const shouldAppend = hasPendingSingleDigit(currentSegmentValue);\n\n const currentDigits = shouldAppend ? getDigits(currentSegmentValue) : '';\n const firstDigitThreshold = FIRST_DIGIT_MAX_BY_SEGMENT[segment];\n\n if (currentDigits.length === 0) {\n if (segment === 'hours' && Number(digit) > firstDigitThreshold) {\n const nextValue = replaceTimeSegment(value, segment, `0${digit}`, format);\n\n return {\n isFinalPart: nextSegment === null,\n isCompletedPart: true,\n shouldBlink: false,\n selectedSegment: nextSegment ?? segment,\n nextValue,\n };\n }\n\n return {\n isFinalPart: false,\n isCompletedPart: false,\n shouldBlink: false,\n selectedSegment: segment,\n nextValue: replaceTimeSegment(value, segment, `${digit}${TIME_PLACEHOLDER_CHAR}`, format),\n };\n }\n\n if (segment === 'hours' && currentDigits === '2' && Number(digit) > 3) {\n return {\n isFinalPart: false,\n isCompletedPart: false,\n shouldBlink: true,\n selectedSegment: segment,\n nextValue: value,\n };\n }\n\n if (segment !== 'hours' && Number(`${currentDigits}${digit}`) > getTimeSegmentMax(segment)) {\n return {\n isFinalPart: false,\n isCompletedPart: false,\n shouldBlink: true,\n selectedSegment: segment,\n nextValue: value,\n };\n }\n\n const nextValue = replaceTimeSegment(\n value,\n segment,\n String(Number(`${currentDigits}${digit}`)).padStart(TIME_SEGMENT_LENGTH, ZERO_PAD_CHAR),\n format,\n );\n\n return {\n isFinalPart: nextSegment === null,\n isCompletedPart: true,\n shouldBlink: false,\n selectedSegment: nextSegment ?? segment,\n nextValue,\n };\n};\n"]}
@@ -1,6 +0,0 @@
1
- import type { Theme } from '../../../lib/theming/Theme.js';
2
- import type { SizeProp } from '../../../lib/types/props.js';
3
- import type { TimeFormat } from './TimePicker.shared.js';
4
- export declare const getTimePickerPopupMaxHeight: (size: SizeProp, theme: Theme) => string;
5
- export declare const getTimePickerSuffixMargin: (size: SizeProp, theme: Theme) => string;
6
- export declare const getTimePickerInputMinWidth: (size: SizeProp, format: TimeFormat, hasIcon: boolean, theme: Theme) => string;
@@ -1,49 +0,0 @@
1
- export var getTimePickerPopupMaxHeight = function (size, theme) {
2
- switch (size) {
3
- case 'large':
4
- return theme.timePickerMenuMaxHeightLarge;
5
- case 'medium':
6
- return theme.timePickerMenuMaxHeightMedium;
7
- case 'small':
8
- default:
9
- return theme.timePickerMenuMaxHeightSmall;
10
- }
11
- };
12
- export var getTimePickerSuffixMargin = function (size, theme) {
13
- switch (size) {
14
- case 'large':
15
- return theme.timePickerSuffixGapLarge;
16
- case 'medium':
17
- return theme.timePickerSuffixGapMedium;
18
- case 'small':
19
- default:
20
- return theme.timePickerSuffixGapSmall;
21
- }
22
- };
23
- export var getTimePickerInputMinWidth = function (size, format, hasIcon, theme) {
24
- switch (size) {
25
- case 'large':
26
- if (format === 'HH:mm:ss') {
27
- return hasIcon
28
- ? theme.timePickerInputMinWidthWithIconAndSecondsLarge
29
- : theme.timePickerInputMinWidthWithSecondsLarge;
30
- }
31
- return hasIcon ? theme.timePickerInputMinWidthWithIconLarge : theme.timePickerInputMinWidthLarge;
32
- case 'medium':
33
- if (format === 'HH:mm:ss') {
34
- return hasIcon
35
- ? theme.timePickerInputMinWidthWithIconAndSecondsMedium
36
- : theme.timePickerInputMinWidthWithSecondsMedium;
37
- }
38
- return hasIcon ? theme.timePickerInputMinWidthWithIconMedium : theme.timePickerInputMinWidthMedium;
39
- case 'small':
40
- default:
41
- if (format === 'HH:mm:ss') {
42
- return hasIcon
43
- ? theme.timePickerInputMinWidthWithIconAndSecondsSmall
44
- : theme.timePickerInputMinWidthWithSecondsSmall;
45
- }
46
- return hasIcon ? theme.timePickerInputMinWidthWithIconSmall : theme.timePickerInputMinWidthSmall;
47
- }
48
- };
49
- //# sourceMappingURL=TimePicker.layout.js.map
@@ -1 +0,0 @@
1
- {"version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AAC;YACrD,CAAC;YAED,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,qCAAqC,CAAC,CAAC,CAAC,KAAK,CAAC,6BAA6B,CAAC;QAErG,KAAK,OAAO,CAAC;QAEb;YACE,IAAI,MAAM,KAAK,UAAU,EAAE,CAAC;gBAC1B,OAAO,OAAO;oBACZ,CAAC,CAAC,KAAK,CAAC,8CAA8C;oBACtD,CAAC,CAAC,KAAK,CAAC,uCAAuC,CAAC;YACpD,CAAC;YAED,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,oCAAoC,CAAC,CAAC,CAAC,KAAK,CAAC,4BAA4B,CAAC;IACrG,CAAC;AACH,CAAC,CAAC","sourcesContent":["import type { Theme } from '../../../lib/theming/Theme.js';\nimport type { SizeProp } from '../../../lib/types/props.js';\nimport type { TimeFormat } from './TimePicker.shared.js';\n\nexport const getTimePickerPopupMaxHeight = (size: SizeProp, theme: Theme): string => {\n switch (size) {\n case 'large':\n return theme.timePickerMenuMaxHeightLarge;\n\n case 'medium':\n return theme.timePickerMenuMaxHeightMedium;\n\n case 'small':\n\n default:\n return theme.timePickerMenuMaxHeightSmall;\n }\n};\n\nexport const getTimePickerSuffixMargin = (size: SizeProp, theme: Theme): string => {\n switch (size) {\n case 'large':\n return theme.timePickerSuffixGapLarge;\n\n case 'medium':\n return theme.timePickerSuffixGapMedium;\n\n case 'small':\n\n default:\n return theme.timePickerSuffixGapSmall;\n }\n};\n\nexport const getTimePickerInputMinWidth = (\n size: SizeProp,\n format: TimeFormat,\n hasIcon: boolean,\n theme: Theme,\n): string => {\n switch (size) {\n case 'large':\n if (format === 'HH:mm:ss') {\n return hasIcon\n ? theme.timePickerInputMinWidthWithIconAndSecondsLarge\n : theme.timePickerInputMinWidthWithSecondsLarge;\n }\n\n return hasIcon ? theme.timePickerInputMinWidthWithIconLarge : theme.timePickerInputMinWidthLarge;\n\n case 'medium':\n if (format === 'HH:mm:ss') {\n return hasIcon\n ? theme.timePickerInputMinWidthWithIconAndSecondsMedium\n : theme.timePickerInputMinWidthWithSecondsMedium;\n }\n\n return hasIcon ? theme.timePickerInputMinWidthWithIconMedium : theme.timePickerInputMinWidthMedium;\n\n case 'small':\n\n default:\n if (format === 'HH:mm:ss') {\n return hasIcon\n ? theme.timePickerInputMinWidthWithIconAndSecondsSmall\n : theme.timePickerInputMinWidthWithSecondsSmall;\n }\n\n return hasIcon ? theme.timePickerInputMinWidthWithIconSmall : theme.timePickerInputMinWidthSmall;\n }\n};\n"]}
@@ -1,5 +0,0 @@
1
- import type { TimeFormat, TimeSegment } from './TimePicker.shared.js';
2
- /** Возвращает следующий сегмент для навигации по вводу или `null`, если текущий сегмент последний. */
3
- export declare const getNextTimeSegment: (segment: TimeSegment, format: TimeFormat) => TimeSegment | null;
4
- /** Возвращает предыдущий сегмент для навигации по вводу или `null`, если текущий сегмент первый. */
5
- export declare const getPreviousTimeSegment: (segment: TimeSegment) => TimeSegment | null;
@@ -1,23 +0,0 @@
1
- /** Возвращает следующий сегмент для навигации по вводу или `null`, если текущий сегмент последний. */
2
- export var getNextTimeSegment = function (segment, format) {
3
- switch (segment) {
4
- case 'hours':
5
- return 'minutes';
6
- case 'minutes':
7
- return format === 'HH:mm:ss' ? 'seconds' : null;
8
- case 'seconds':
9
- return null;
10
- }
11
- };
12
- /** Возвращает предыдущий сегмент для навигации по вводу или `null`, если текущий сегмент первый. */
13
- export var getPreviousTimeSegment = function (segment) {
14
- switch (segment) {
15
- case 'hours':
16
- return null;
17
- case 'minutes':
18
- return 'hours';
19
- case 'seconds':
20
- return 'minutes';
21
- }
22
- };
23
- //# sourceMappingURL=TimePicker.selection.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TimePicker.selection.js","sourceRoot":"","sources":["TimePicker.selection.ts"],"names":[],"mappings":"AAEA,sGAAsG;AACtG,MAAM,CAAC,IAAM,kBAAkB,GAAG,UAAC,OAAoB,EAAE,MAAkB;IACzE,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,OAAO;YACV,OAAO,SAAS,CAAC;QAEnB,KAAK,SAAS;YACZ,OAAO,MAAM,KAAK,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC;QAElD,KAAK,SAAS;YACZ,OAAO,IAAI,CAAC;IAChB,CAAC;AACH,CAAC,CAAC;AAEF,oGAAoG;AACpG,MAAM,CAAC,IAAM,sBAAsB,GAAG,UAAC,OAAoB;IACzD,QAAQ,OAAO,EAAE,CAAC;QAChB,KAAK,OAAO;YACV,OAAO,IAAI,CAAC;QAEd,KAAK,SAAS;YACZ,OAAO,OAAO,CAAC;QAEjB,KAAK,SAAS;YACZ,OAAO,SAAS,CAAC;IACrB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import type { TimeFormat, TimeSegment } from './TimePicker.shared.js';\n\n/** Возвращает следующий сегмент для навигации по вводу или `null`, если текущий сегмент последний. */\nexport const getNextTimeSegment = (segment: TimeSegment, format: TimeFormat): TimeSegment | null => {\n switch (segment) {\n case 'hours':\n return 'minutes';\n\n case 'minutes':\n return format === 'HH:mm:ss' ? 'seconds' : null;\n\n case 'seconds':\n return null;\n }\n};\n\n/** Возвращает предыдущий сегмент для навигации по вводу или `null`, если текущий сегмент первый. */\nexport const getPreviousTimeSegment = (segment: TimeSegment): TimeSegment | null => {\n switch (segment) {\n case 'hours':\n return null;\n\n case 'minutes':\n return 'hours';\n\n case 'seconds':\n return 'minutes';\n }\n};\n"]}