@skbkontur/react-ui 6.1.6-fe902.0 → 6.1.7-1c902.0

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 (372) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/components/Checkbox/Checkbox.d.ts +5 -0
  3. package/components/Checkbox/Checkbox.js +42 -21
  4. package/components/Checkbox/Checkbox.js.map +1 -1
  5. package/components/Checkbox/Checkbox.mixins.d.ts +2 -0
  6. package/components/Checkbox/Checkbox.mixins.js +6 -0
  7. package/components/Checkbox/Checkbox.mixins.js.map +1 -1
  8. package/components/Checkbox/Checkbox.styles.d.ts +7 -0
  9. package/components/Checkbox/Checkbox.styles.js +23 -2
  10. package/components/Checkbox/Checkbox.styles.js.map +1 -1
  11. package/components/CurrencyInput/CurrencyHelper.d.ts +1 -2
  12. package/components/CurrencyInput/CurrencyHelper.js +32 -28
  13. package/components/CurrencyInput/CurrencyHelper.js.map +1 -1
  14. package/components/CurrencyInput/CurrencyInputHelper.js +1 -1
  15. package/components/CurrencyInput/CurrencyInputHelper.js.map +1 -1
  16. package/components/DateInput/DateInput.js +4 -1
  17. package/components/DateInput/DateInput.js.map +1 -1
  18. package/components/FileUploader/FileUploaderFile.d.ts +1 -1
  19. package/components/FileUploader/FileUploaderFile.js +1 -1
  20. package/components/FileUploader/FileUploaderFile.js.map +1 -1
  21. package/components/FxInput/FxInput.d.ts +1 -1
  22. package/components/FxInput/FxInput.js.map +1 -1
  23. package/components/Group/Group.js +3 -2
  24. package/components/Group/Group.js.map +1 -1
  25. package/components/Input/Input.d.ts +1 -1
  26. package/components/Input/Input.js.map +1 -1
  27. package/components/MaskedInput/MaskedInput.d.ts +2 -6
  28. package/components/MaskedInput/MaskedInput.js +126 -10
  29. package/components/MaskedInput/MaskedInput.js.map +1 -1
  30. package/components/MaskedInput/index.d.ts +0 -1
  31. package/components/MaskedInput/index.js +0 -1
  32. package/components/MaskedInput/index.js.map +1 -1
  33. package/components/MenuItem/MenuItem.js +1 -0
  34. package/components/MenuItem/MenuItem.js.map +1 -1
  35. package/components/MenuItem/MenuItem.styles.d.ts +1 -0
  36. package/components/MenuItem/MenuItem.styles.js +10 -7
  37. package/components/MenuItem/MenuItem.styles.js.map +1 -1
  38. package/components/MiniModal/MiniModal.d.ts +0 -9
  39. package/components/MiniModal/MiniModal.js +0 -9
  40. package/components/MiniModal/MiniModal.js.map +1 -1
  41. package/components/Modal/Modal.d.ts +0 -5
  42. package/components/Modal/Modal.js +0 -5
  43. package/components/Modal/Modal.js.map +1 -1
  44. package/components/Radio/Radio.d.ts +4 -0
  45. package/components/Radio/Radio.js +20 -1
  46. package/components/Radio/Radio.js.map +1 -1
  47. package/components/Radio/Radio.mixins.d.ts +2 -0
  48. package/components/Radio/Radio.mixins.js +6 -0
  49. package/components/Radio/Radio.mixins.js.map +1 -1
  50. package/components/Radio/Radio.styles.d.ts +6 -0
  51. package/components/Radio/Radio.styles.js +22 -4
  52. package/components/Radio/Radio.styles.js.map +1 -1
  53. package/components/Select/Select.d.ts +1 -0
  54. package/components/Select/Select.js +12 -2
  55. package/components/Select/Select.js.map +1 -1
  56. package/components/Switcher/Switcher.d.ts +3 -3
  57. package/components/Switcher/Switcher.js +1 -1
  58. package/components/Switcher/Switcher.js.map +1 -1
  59. package/components/Tabs/Tab.d.ts +4 -5
  60. package/components/Tabs/Tab.js +0 -1
  61. package/components/Tabs/Tab.js.map +1 -1
  62. package/components/Tabs/Tabs.d.ts +2 -2
  63. package/components/Tabs/Tabs.js +1 -1
  64. package/components/Tabs/Tabs.js.map +1 -1
  65. package/components/TimePicker/TimeClockIcon.d.ts +3 -0
  66. package/components/TimePicker/TimeClockIcon.js +11 -0
  67. package/components/TimePicker/TimeClockIcon.js.map +1 -0
  68. package/components/TimePicker/TimePicker.d.ts +137 -0
  69. package/components/TimePicker/TimePicker.js +648 -0
  70. package/components/TimePicker/TimePicker.js.map +1 -0
  71. package/components/TimePicker/TimePicker.styles.d.ts +11 -0
  72. package/components/TimePicker/TimePicker.styles.js +36 -0
  73. package/components/TimePicker/TimePicker.styles.js.map +1 -0
  74. package/components/TimePicker/TimePickerItems.d.ts +20 -0
  75. package/components/TimePicker/TimePickerItems.js +108 -0
  76. package/components/TimePicker/TimePickerItems.js.map +1 -0
  77. package/components/TimePicker/TimePickerMobilePopup.d.ts +45 -0
  78. package/components/TimePicker/TimePickerMobilePopup.js +45 -0
  79. package/components/TimePicker/TimePickerMobilePopup.js.map +1 -0
  80. package/components/TimePicker/TimePickerPopup.d.ts +23 -0
  81. package/components/TimePicker/TimePickerPopup.js +18 -0
  82. package/components/TimePicker/TimePickerPopup.js.map +1 -0
  83. package/components/TimePicker/helpers/TimePicker.constants.d.ts +24 -0
  84. package/components/TimePicker/helpers/TimePicker.constants.js +33 -0
  85. package/components/TimePicker/helpers/TimePicker.constants.js.map +1 -0
  86. package/components/TimePicker/helpers/TimePicker.editing.d.ts +23 -0
  87. package/components/TimePicker/helpers/TimePicker.editing.js +101 -0
  88. package/components/TimePicker/helpers/TimePicker.editing.js.map +1 -0
  89. package/components/TimePicker/helpers/TimePicker.layout.d.ts +6 -0
  90. package/components/TimePicker/helpers/TimePicker.layout.js +49 -0
  91. package/components/TimePicker/helpers/TimePicker.layout.js.map +1 -0
  92. package/components/TimePicker/helpers/TimePicker.selection.d.ts +5 -0
  93. package/components/TimePicker/helpers/TimePicker.selection.js +23 -0
  94. package/components/TimePicker/helpers/TimePicker.selection.js.map +1 -0
  95. package/components/TimePicker/helpers/TimePicker.shared.d.ts +82 -0
  96. package/components/TimePicker/helpers/TimePicker.shared.js +94 -0
  97. package/components/TimePicker/helpers/TimePicker.shared.js.map +1 -0
  98. package/components/TimePicker/helpers/TimePicker.value.d.ts +59 -0
  99. package/components/TimePicker/helpers/TimePicker.value.js +175 -0
  100. package/components/TimePicker/helpers/TimePicker.value.js.map +1 -0
  101. package/components/TimePicker/helpers/scrollSelectedItemIntoView.d.ts +4 -0
  102. package/components/TimePicker/helpers/scrollSelectedItemIntoView.js +24 -0
  103. package/components/TimePicker/helpers/scrollSelectedItemIntoView.js.map +1 -0
  104. package/components/TimePicker/helpers/validateTimePicker.d.ts +8 -0
  105. package/components/TimePicker/helpers/validateTimePicker.js +17 -0
  106. package/components/TimePicker/helpers/validateTimePicker.js.map +1 -0
  107. package/components/TimePicker/hooks/useTimePickerDropdown.d.ts +18 -0
  108. package/components/TimePicker/hooks/useTimePickerDropdown.js +85 -0
  109. package/components/TimePicker/hooks/useTimePickerDropdown.js.map +1 -0
  110. package/components/TimePicker/hooks/useTimePickerSelection.d.ts +18 -0
  111. package/components/TimePicker/hooks/useTimePickerSelection.js +66 -0
  112. package/components/TimePicker/hooks/useTimePickerSelection.js.map +1 -0
  113. package/components/TimePicker/hooks/useTimePickerValue.d.ts +27 -0
  114. package/components/TimePicker/hooks/useTimePickerValue.js +76 -0
  115. package/components/TimePicker/hooks/useTimePickerValue.js.map +1 -0
  116. package/components/TimePicker/index.d.ts +2 -0
  117. package/components/TimePicker/index.js +2 -0
  118. package/components/TimePicker/index.js.map +1 -0
  119. package/components/TimePicker/locale/index.d.ts +4 -0
  120. package/components/TimePicker/locale/index.js +9 -0
  121. package/components/TimePicker/locale/index.js.map +1 -0
  122. package/components/TimePicker/locale/locales/en.d.ts +2 -0
  123. package/components/TimePicker/locale/locales/en.js +5 -0
  124. package/components/TimePicker/locale/locales/en.js.map +1 -0
  125. package/components/TimePicker/locale/locales/ru.d.ts +2 -0
  126. package/components/TimePicker/locale/locales/ru.js +5 -0
  127. package/components/TimePicker/locale/locales/ru.js.map +1 -0
  128. package/components/TimePicker/locale/types.d.ts +4 -0
  129. package/components/TimePicker/locale/types.js.map +1 -0
  130. package/components/Toggle/Toggle.d.ts +5 -0
  131. package/components/Toggle/Toggle.js +46 -22
  132. package/components/Toggle/Toggle.js.map +1 -1
  133. package/components/Toggle/Toggle.mixins.d.ts +2 -0
  134. package/components/Toggle/Toggle.mixins.js +6 -0
  135. package/components/Toggle/Toggle.mixins.js.map +1 -1
  136. package/components/Toggle/Toggle.styles.d.ts +9 -0
  137. package/components/Toggle/Toggle.styles.js +29 -2
  138. package/components/Toggle/Toggle.styles.js.map +1 -1
  139. package/components/Token/Token.d.ts +1 -1
  140. package/components/Token/Token.js +1 -1
  141. package/components/Token/Token.js.map +1 -1
  142. package/components/TokenInput/TokenInput.d.ts +1 -1
  143. package/components/TokenInput/TokenInput.js +1 -1
  144. package/components/TokenInput/TokenInput.js.map +1 -1
  145. package/index.d.ts +1 -0
  146. package/index.js +1 -0
  147. package/index.js.map +1 -1
  148. package/internal/Menu/Menu.d.ts +5 -0
  149. package/internal/Menu/Menu.js +21 -0
  150. package/internal/Menu/Menu.js.map +1 -1
  151. package/internal/NativeTimeInput/NativeTimeInput.d.ts +16 -0
  152. package/internal/NativeTimeInput/NativeTimeInput.js +25 -0
  153. package/internal/NativeTimeInput/NativeTimeInput.js.map +1 -0
  154. package/internal/NativeTimeInput/NativeTimeInput.styles.d.ts +3 -0
  155. package/internal/NativeTimeInput/NativeTimeInput.styles.js +15 -0
  156. package/internal/NativeTimeInput/NativeTimeInput.styles.js.map +1 -0
  157. package/internal/NativeTimeInput/NativeTimeInput.utils.d.ts +7 -0
  158. package/internal/NativeTimeInput/NativeTimeInput.utils.js +28 -0
  159. package/internal/NativeTimeInput/NativeTimeInput.utils.js.map +1 -0
  160. package/internal/NativeTimeInput/index.d.ts +1 -0
  161. package/internal/NativeTimeInput/index.js +2 -0
  162. package/internal/NativeTimeInput/index.js.map +1 -0
  163. package/internal/TimeInput/TimeFragments.d.ts +15 -0
  164. package/internal/TimeInput/TimeFragments.js +72 -0
  165. package/internal/TimeInput/TimeFragments.js.map +1 -0
  166. package/internal/TimeInput/TimeFragments.styles.d.ts +12 -0
  167. package/internal/TimeInput/TimeFragments.styles.js +43 -0
  168. package/internal/TimeInput/TimeFragments.styles.js.map +1 -0
  169. package/internal/TimeInput/TimeInput.d.ts +22 -0
  170. package/internal/TimeInput/TimeInput.js +103 -0
  171. package/internal/TimeInput/TimeInput.js.map +1 -0
  172. package/{components/MaskedInputV2/MaskedInputV2.styles.d.ts → internal/TimeInput/TimeInput.styles.d.ts} +3 -4
  173. package/internal/TimeInput/TimeInput.styles.js +21 -0
  174. package/internal/TimeInput/TimeInput.styles.js.map +1 -0
  175. package/internal/TimeInput/index.d.ts +1 -0
  176. package/internal/TimeInput/index.js +2 -0
  177. package/internal/TimeInput/index.js.map +1 -0
  178. package/internal/icons2022/TimeClockIcon/TimeClockIcon16Light.d.ts +2 -0
  179. package/internal/icons2022/TimeClockIcon/TimeClockIcon16Light.js +20 -0
  180. package/internal/icons2022/TimeClockIcon/TimeClockIcon16Light.js.map +1 -0
  181. package/internal/icons2022/TimeClockIcon/TimeClockIcon20Light.d.ts +2 -0
  182. package/internal/icons2022/TimeClockIcon/TimeClockIcon20Light.js +20 -0
  183. package/internal/icons2022/TimeClockIcon/TimeClockIcon20Light.js.map +1 -0
  184. package/internal/icons2022/TimeClockIcon/TimeClockIcon24Regular.d.ts +2 -0
  185. package/internal/icons2022/TimeClockIcon/TimeClockIcon24Regular.js +20 -0
  186. package/internal/icons2022/TimeClockIcon/TimeClockIcon24Regular.js.map +1 -0
  187. package/internal/themes/BasicTheme.d.ts +65 -0
  188. package/internal/themes/BasicTheme.js +253 -0
  189. package/internal/themes/BasicTheme.js.map +1 -1
  190. package/internal/themes/DarkTheme6_0.js +1 -0
  191. package/internal/themes/DarkTheme6_0.js.map +1 -1
  192. package/lib/events/keyboard/KeyboardEventCodes.d.ts +0 -2
  193. package/lib/events/keyboard/KeyboardEventCodes.js +0 -2
  194. package/lib/events/keyboard/KeyboardEventCodes.js.map +1 -1
  195. package/lib/events/keyboard/KeyboardMapKeys.js +0 -2
  196. package/lib/events/keyboard/KeyboardMapKeys.js.map +1 -1
  197. package/lib/events/keyboard/identifiers.d.ts +0 -2
  198. package/lib/events/keyboard/identifiers.js +0 -6
  199. package/lib/events/keyboard/identifiers.js.map +1 -1
  200. package/lib/featureFlagsContext/ReactUIFeatureFlagsContext.d.ts +0 -1
  201. package/lib/featureFlagsContext/ReactUIFeatureFlagsContext.js +0 -1
  202. package/lib/featureFlagsContext/ReactUIFeatureFlagsContext.js.map +1 -1
  203. package/lib/locale/types.d.ts +2 -0
  204. package/lib/locale/types.js.map +1 -1
  205. package/lib/utils.d.ts +2 -0
  206. package/lib/utils.js +1 -0
  207. package/lib/utils.js.map +1 -1
  208. package/package.json +9 -4
  209. package/components/MaskedInput/MaskedInputLegacy.d.ts +0 -3
  210. package/components/MaskedInput/MaskedInputLegacy.js +0 -142
  211. package/components/MaskedInput/MaskedInputLegacy.js.map +0 -1
  212. package/components/MaskedInputV2/MaskedInputV2.d.ts +0 -62
  213. package/components/MaskedInputV2/MaskedInputV2.helpers.d.ts +0 -9
  214. package/components/MaskedInputV2/MaskedInputV2.helpers.js +0 -17
  215. package/components/MaskedInputV2/MaskedInputV2.helpers.js.map +0 -1
  216. package/components/MaskedInputV2/MaskedInputV2.js +0 -307
  217. package/components/MaskedInputV2/MaskedInputV2.js.map +0 -1
  218. package/components/MaskedInputV2/MaskedInputV2.phone.d.ts +0 -28
  219. package/components/MaskedInputV2/MaskedInputV2.phone.js +0 -38
  220. package/components/MaskedInputV2/MaskedInputV2.phone.js.map +0 -1
  221. package/components/MaskedInputV2/MaskedInputV2.styles.js +0 -19
  222. package/components/MaskedInputV2/MaskedInputV2.styles.js.map +0 -1
  223. package/components/MaskedInputV2/index.d.ts +0 -2
  224. package/components/MaskedInputV2/index.js +0 -3
  225. package/components/MaskedInputV2/index.js.map +0 -1
  226. package/components/MaskedInputV2/internal/MaskOverlay.d.ts +0 -19
  227. package/components/MaskedInputV2/internal/MaskOverlay.js +0 -54
  228. package/components/MaskedInputV2/internal/MaskOverlay.js.map +0 -1
  229. package/components/MaskedInputV2/internal/MaskedCore.d.ts +0 -8
  230. package/components/MaskedInputV2/internal/MaskedCore.js +0 -186
  231. package/components/MaskedInputV2/internal/MaskedCore.js.map +0 -1
  232. package/components/MaskedInputV2/internal/MaskedCore.types.d.ts +0 -37
  233. package/components/MaskedInputV2/internal/MaskedCore.types.js +0 -2
  234. package/components/MaskedInputV2/internal/MaskedCore.types.js.map +0 -1
  235. package/components/MaskedInputV2/internal/MaskedInternal.styles.d.ts +0 -15
  236. package/components/MaskedInputV2/internal/MaskedInternal.styles.js +0 -34
  237. package/components/MaskedInputV2/internal/MaskedInternal.styles.js.map +0 -1
  238. package/components/MaskedInputV2/internal/buildSlotMap.d.ts +0 -11
  239. package/components/MaskedInputV2/internal/buildSlotMap.js +0 -37
  240. package/components/MaskedInputV2/internal/buildSlotMap.js.map +0 -1
  241. package/components/MaskedInputV2/internal/computeMaskAlignPadding.d.ts +0 -6
  242. package/components/MaskedInputV2/internal/computeMaskAlignPadding.js +0 -47
  243. package/components/MaskedInputV2/internal/computeMaskAlignPadding.js.map +0 -1
  244. package/components/MaskedInputV2/internal/computePasteMaskedCursor.d.ts +0 -3
  245. package/components/MaskedInputV2/internal/computePasteMaskedCursor.js +0 -11
  246. package/components/MaskedInputV2/internal/computePasteMaskedCursor.js.map +0 -1
  247. package/components/MaskedInputV2/internal/extractRaw.d.ts +0 -10
  248. package/components/MaskedInputV2/internal/extractRaw.js +0 -16
  249. package/components/MaskedInputV2/internal/extractRaw.js.map +0 -1
  250. package/components/MaskedInputV2/internal/findNearestRawLeft.d.ts +0 -10
  251. package/components/MaskedInputV2/internal/findNearestRawLeft.js +0 -18
  252. package/components/MaskedInputV2/internal/findNearestRawLeft.js.map +0 -1
  253. package/components/MaskedInputV2/internal/helpers.d.ts +0 -8
  254. package/components/MaskedInputV2/internal/helpers.js +0 -9
  255. package/components/MaskedInputV2/internal/helpers.js.map +0 -1
  256. package/components/MaskedInputV2/internal/maskedCoreClipboard.d.ts +0 -37
  257. package/components/MaskedInputV2/internal/maskedCoreClipboard.js +0 -52
  258. package/components/MaskedInputV2/internal/maskedCoreClipboard.js.map +0 -1
  259. package/components/MaskedInputV2/internal/maskedCoreDeletion.d.ts +0 -28
  260. package/components/MaskedInputV2/internal/maskedCoreDeletion.js +0 -70
  261. package/components/MaskedInputV2/internal/maskedCoreDeletion.js.map +0 -1
  262. package/components/MaskedInputV2/internal/maskedCoreInputChange.d.ts +0 -38
  263. package/components/MaskedInputV2/internal/maskedCoreInputChange.js +0 -49
  264. package/components/MaskedInputV2/internal/maskedCoreInputChange.js.map +0 -1
  265. package/components/MaskedInputV2/internal/maskedCoreNavigation.d.ts +0 -13
  266. package/components/MaskedInputV2/internal/maskedCoreNavigation.js +0 -79
  267. package/components/MaskedInputV2/internal/maskedCoreNavigation.js.map +0 -1
  268. package/components/MaskedInputV2/internal/measureInputTextWidth.d.ts +0 -2
  269. package/components/MaskedInputV2/internal/measureInputTextWidth.js +0 -30
  270. package/components/MaskedInputV2/internal/measureInputTextWidth.js.map +0 -1
  271. package/components/MaskedInputV2/internal/setMaskInputSelectionRange.d.ts +0 -2
  272. package/components/MaskedInputV2/internal/setMaskInputSelectionRange.js +0 -25
  273. package/components/MaskedInputV2/internal/setMaskInputSelectionRange.js.map +0 -1
  274. package/components/MaskedInputV2/internal/showOverlay.d.ts +0 -3
  275. package/components/MaskedInputV2/internal/showOverlay.js +0 -16
  276. package/components/MaskedInputV2/internal/showOverlay.js.map +0 -1
  277. package/components/MaskedInputV2/internal/stripMaskChars.d.ts +0 -11
  278. package/components/MaskedInputV2/internal/stripMaskChars.js +0 -20
  279. package/components/MaskedInputV2/internal/stripMaskChars.js.map +0 -1
  280. package/components/MaskedInputV2/internal/types.d.ts +0 -74
  281. package/components/MaskedInputV2/internal/types.js.map +0 -1
  282. package/components/MaskedInputV2/internal/useInputOverflow.d.ts +0 -4
  283. package/components/MaskedInputV2/internal/useInputOverflow.js +0 -34
  284. package/components/MaskedInputV2/internal/useInputOverflow.js.map +0 -1
  285. package/components/MaskedInputV2/internal/useMaskAlignPadding.d.ts +0 -2
  286. package/components/MaskedInputV2/internal/useMaskAlignPadding.js +0 -33
  287. package/components/MaskedInputV2/internal/useMaskAlignPadding.js.map +0 -1
  288. package/components/MaskedInputV2/internal/useMaskEngine.d.ts +0 -42
  289. package/components/MaskedInputV2/internal/useMaskEngine.js +0 -84
  290. package/components/MaskedInputV2/internal/useMaskEngine.js.map +0 -1
  291. package/components/MaskedInputV2/internal/useMaskedCoreHandlers.d.ts +0 -34
  292. package/components/MaskedInputV2/internal/useMaskedCoreHandlers.js +0 -335
  293. package/components/MaskedInputV2/internal/useMaskedCoreHandlers.js.map +0 -1
  294. package/components/MaskedInputV2/react-imask/imask/controls/html-input-mask-element.d.ts +0 -16
  295. package/components/MaskedInputV2/react-imask/imask/controls/html-input-mask-element.js +0 -59
  296. package/components/MaskedInputV2/react-imask/imask/controls/html-input-mask-element.js.map +0 -1
  297. package/components/MaskedInputV2/react-imask/imask/controls/html-mask-element.d.ts +0 -20
  298. package/components/MaskedInputV2/react-imask/imask/controls/html-mask-element.js +0 -106
  299. package/components/MaskedInputV2/react-imask/imask/controls/html-mask-element.js.map +0 -1
  300. package/components/MaskedInputV2/react-imask/imask/controls/input-history.d.ts +0 -17
  301. package/components/MaskedInputV2/react-imask/imask/controls/input-history.js +0 -49
  302. package/components/MaskedInputV2/react-imask/imask/controls/input-history.js.map +0 -1
  303. package/components/MaskedInputV2/react-imask/imask/controls/input.d.ts +0 -95
  304. package/components/MaskedInputV2/react-imask/imask/controls/input.js +0 -420
  305. package/components/MaskedInputV2/react-imask/imask/controls/input.js.map +0 -1
  306. package/components/MaskedInputV2/react-imask/imask/controls/mask-element.d.ts +0 -30
  307. package/components/MaskedInputV2/react-imask/imask/controls/mask-element.js +0 -59
  308. package/components/MaskedInputV2/react-imask/imask/controls/mask-element.js.map +0 -1
  309. package/components/MaskedInputV2/react-imask/imask/core/action-details.d.ts +0 -30
  310. package/components/MaskedInputV2/react-imask/imask/core/action-details.js +0 -100
  311. package/components/MaskedInputV2/react-imask/imask/core/action-details.js.map +0 -1
  312. package/components/MaskedInputV2/react-imask/imask/core/change-details.d.ts +0 -20
  313. package/components/MaskedInputV2/react-imask/imask/core/change-details.js +0 -46
  314. package/components/MaskedInputV2/react-imask/imask/core/change-details.js.map +0 -1
  315. package/components/MaskedInputV2/react-imask/imask/core/continuous-tail-details.d.ts +0 -21
  316. package/components/MaskedInputV2/react-imask/imask/core/continuous-tail-details.js +0 -52
  317. package/components/MaskedInputV2/react-imask/imask/core/continuous-tail-details.js.map +0 -1
  318. package/components/MaskedInputV2/react-imask/imask/core/holder.d.ts +0 -34
  319. package/components/MaskedInputV2/react-imask/imask/core/holder.js +0 -38
  320. package/components/MaskedInputV2/react-imask/imask/core/holder.js.map +0 -1
  321. package/components/MaskedInputV2/react-imask/imask/core/tail-details.d.ts +0 -20
  322. package/components/MaskedInputV2/react-imask/imask/core/tail-details.js +0 -2
  323. package/components/MaskedInputV2/react-imask/imask/core/tail-details.js.map +0 -1
  324. package/components/MaskedInputV2/react-imask/imask/core/utils.d.ts +0 -24
  325. package/components/MaskedInputV2/react-imask/imask/core/utils.js +0 -100
  326. package/components/MaskedInputV2/react-imask/imask/core/utils.js.map +0 -1
  327. package/components/MaskedInputV2/react-imask/imask/imask.d.ts +0 -5
  328. package/components/MaskedInputV2/react-imask/imask/imask.js +0 -7
  329. package/components/MaskedInputV2/react-imask/imask/imask.js.map +0 -1
  330. package/components/MaskedInputV2/react-imask/imask/index.d.ts +0 -17
  331. package/components/MaskedInputV2/react-imask/imask/index.js +0 -16
  332. package/components/MaskedInputV2/react-imask/imask/index.js.map +0 -1
  333. package/components/MaskedInputV2/react-imask/imask/masked/base.d.ts +0 -114
  334. package/components/MaskedInputV2/react-imask/imask/masked/base.js +0 -411
  335. package/components/MaskedInputV2/react-imask/imask/masked/base.js.map +0 -1
  336. package/components/MaskedInputV2/react-imask/imask/masked/create.d.ts +0 -14
  337. package/components/MaskedInputV2/react-imask/imask/masked/create.js +0 -11
  338. package/components/MaskedInputV2/react-imask/imask/masked/create.js.map +0 -1
  339. package/components/MaskedInputV2/react-imask/imask/masked/factory.d.ts +0 -62
  340. package/components/MaskedInputV2/react-imask/imask/masked/factory.js +0 -107
  341. package/components/MaskedInputV2/react-imask/imask/masked/factory.js.map +0 -1
  342. package/components/MaskedInputV2/react-imask/imask/masked/pattern.d.ts +0 -101
  343. package/components/MaskedInputV2/react-imask/imask/masked/pattern.js +0 -549
  344. package/components/MaskedInputV2/react-imask/imask/masked/pattern.js.map +0 -1
  345. package/components/MaskedInputV2/react-imask/imask/masked/patterns/block.d.ts +0 -30
  346. package/components/MaskedInputV2/react-imask/imask/masked/patterns/block.js +0 -2
  347. package/components/MaskedInputV2/react-imask/imask/masked/patterns/block.js.map +0 -1
  348. package/components/MaskedInputV2/react-imask/imask/masked/patterns/chunk-tail-details.d.ts +0 -20
  349. package/components/MaskedInputV2/react-imask/imask/masked/patterns/chunk-tail-details.js +0 -182
  350. package/components/MaskedInputV2/react-imask/imask/masked/patterns/chunk-tail-details.js.map +0 -1
  351. package/components/MaskedInputV2/react-imask/imask/masked/patterns/cursor.d.ts +0 -31
  352. package/components/MaskedInputV2/react-imask/imask/masked/patterns/cursor.js +0 -163
  353. package/components/MaskedInputV2/react-imask/imask/masked/patterns/cursor.js.map +0 -1
  354. package/components/MaskedInputV2/react-imask/imask/masked/patterns/fixed-definition.d.ts +0 -42
  355. package/components/MaskedInputV2/react-imask/imask/masked/patterns/fixed-definition.js +0 -158
  356. package/components/MaskedInputV2/react-imask/imask/masked/patterns/fixed-definition.js.map +0 -1
  357. package/components/MaskedInputV2/react-imask/imask/masked/patterns/input-definition.d.ts +0 -56
  358. package/components/MaskedInputV2/react-imask/imask/masked/patterns/input-definition.js +0 -185
  359. package/components/MaskedInputV2/react-imask/imask/masked/patterns/input-definition.js.map +0 -1
  360. package/components/MaskedInputV2/react-imask/imask/masked/regexp.d.ts +0 -17
  361. package/components/MaskedInputV2/react-imask/imask/masked/regexp.js +0 -36
  362. package/components/MaskedInputV2/react-imask/imask/masked/regexp.js.map +0 -1
  363. package/components/MaskedInputV2/react-imask/index.d.ts +0 -3
  364. package/components/MaskedInputV2/react-imask/index.js +0 -4
  365. package/components/MaskedInputV2/react-imask/index.js.map +0 -1
  366. package/components/MaskedInputV2/react-imask/input.d.ts +0 -8
  367. package/components/MaskedInputV2/react-imask/input.js +0 -35
  368. package/components/MaskedInputV2/react-imask/input.js.map +0 -1
  369. package/components/MaskedInputV2/react-imask/mixin.d.ts +0 -31
  370. package/components/MaskedInputV2/react-imask/mixin.js +0 -246
  371. package/components/MaskedInputV2/react-imask/mixin.js.map +0 -1
  372. /package/components/{MaskedInputV2/internal → TimePicker/locale}/types.js +0 -0
@@ -1,20 +0,0 @@
1
- import { ChangeDetails } from '../../core/change-details.js';
2
- import type { TailDetails, AppendTail } from '../../core/tail-details.js';
3
- export type ChunksTailState = Pick<ChunksTailDetails, 'from' | 'stop' | 'blockIndex'> & {
4
- chunks: Array<TailDetails['state']>;
5
- };
6
- export declare class ChunksTailDetails implements TailDetails {
7
- chunks: TailDetails[];
8
- from: number;
9
- stop?: number;
10
- /** */
11
- blockIndex?: number;
12
- constructor(chunks?: TailDetails[], from?: number);
13
- toString(): string;
14
- extend(tailChunk: string | TailDetails): void;
15
- appendTo(masked: AppendTail): ChangeDetails;
16
- get state(): ChunksTailState;
17
- set state(state: ChunksTailState);
18
- unshift(beforePos?: number): string;
19
- shift(): string;
20
- }
@@ -1,182 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import { ChangeDetails } from '../../core/change-details.js';
13
- import { ContinuousTailDetails } from '../../core/continuous-tail-details.js';
14
- import { isString } from '../../core/utils.js';
15
- function isPatternTailTarget(masked) {
16
- return typeof masked._mapPosToBlock === 'function';
17
- }
18
- var ChunksTailDetails = /** @class */ (function () {
19
- function ChunksTailDetails(chunks, from) {
20
- if (chunks === void 0) { chunks = []; }
21
- if (from === void 0) { from = 0; }
22
- this.chunks = chunks;
23
- this.from = from;
24
- }
25
- ChunksTailDetails.prototype.toString = function () {
26
- return this.chunks.map(String).join('');
27
- };
28
- ChunksTailDetails.prototype.extend = function (tailChunk) {
29
- if (!String(tailChunk)) {
30
- return;
31
- }
32
- // eslint-disable-next-line no-param-reassign
33
- tailChunk = (isString(tailChunk) ? new ContinuousTailDetails(String(tailChunk)) : tailChunk);
34
- var lastChunk = this.chunks[this.chunks.length - 1];
35
- var extendLast = lastChunk &&
36
- // if stops are same or tail has no stop
37
- (lastChunk.stop === tailChunk.stop || tailChunk.stop == null) &&
38
- // if tail chunk goes just after last chunk
39
- tailChunk.from === lastChunk.from + lastChunk.toString().length;
40
- if (tailChunk instanceof ContinuousTailDetails) {
41
- // check the ability to extend previous chunk
42
- if (extendLast) {
43
- // extend previous chunk
44
- lastChunk.extend(tailChunk.toString());
45
- }
46
- else {
47
- // append new chunk
48
- this.chunks.push(tailChunk);
49
- }
50
- }
51
- else if (tailChunk instanceof ChunksTailDetails) {
52
- if (tailChunk.stop == null) {
53
- // unwrap floating chunks to parent, keeping `from` pos
54
- var firstTailChunk = void 0;
55
- while (tailChunk.chunks.length && tailChunk.chunks[0].stop == null) {
56
- firstTailChunk = tailChunk.chunks.shift(); // not possible to be `undefined` because length was checked above
57
- firstTailChunk.from += tailChunk.from;
58
- this.extend(firstTailChunk);
59
- }
60
- }
61
- // if tail chunk still has value
62
- if (tailChunk.toString()) {
63
- // if chunks contains stops, then popup stop to container
64
- tailChunk.stop = tailChunk.blockIndex;
65
- this.chunks.push(tailChunk);
66
- }
67
- }
68
- };
69
- ChunksTailDetails.prototype.appendTo = function (masked) {
70
- if (!isPatternTailTarget(masked)) {
71
- var tail = new ContinuousTailDetails(this.toString());
72
- return tail.appendTo(masked);
73
- }
74
- var details = new ChangeDetails();
75
- for (var ci = 0; ci < this.chunks.length; ++ci) {
76
- var chunk = this.chunks[ci];
77
- var lastBlockIter = masked._mapPosToBlock(masked.displayValue.length);
78
- var stop_1 = chunk.stop;
79
- var chunkBlock = void 0;
80
- if (stop_1 != null &&
81
- // if block not found or stop is behind lastBlock
82
- (!lastBlockIter || lastBlockIter.index <= stop_1)) {
83
- if (chunk instanceof ChunksTailDetails ||
84
- // for continuous block also check if stop is exist
85
- masked._stops.indexOf(stop_1) >= 0) {
86
- details.aggregate(masked._appendPlaceholder(stop_1));
87
- }
88
- chunkBlock = chunk instanceof ChunksTailDetails && masked._blocks[stop_1];
89
- }
90
- if (chunkBlock) {
91
- var tailDetails = chunkBlock.appendTail(chunk);
92
- details.aggregate(tailDetails);
93
- // get not inserted chars
94
- var remainChars = chunk.toString().slice(tailDetails.rawInserted.length);
95
- if (remainChars) {
96
- details.aggregate(masked.append(remainChars, { tail: true }));
97
- }
98
- }
99
- else {
100
- details.aggregate(masked.append(chunk.toString(), { tail: true }));
101
- }
102
- }
103
- return details;
104
- };
105
- Object.defineProperty(ChunksTailDetails.prototype, "state", {
106
- get: function () {
107
- return {
108
- chunks: this.chunks.map(function (c) { return c.state; }),
109
- from: this.from,
110
- stop: this.stop,
111
- blockIndex: this.blockIndex,
112
- };
113
- },
114
- set: function (state) {
115
- var chunks = state.chunks, props = __rest(state, ["chunks"]);
116
- Object.assign(this, props);
117
- this.chunks = chunks.map(function (cstate) {
118
- var chunk = 'chunks' in cstate ? new ChunksTailDetails() : new ContinuousTailDetails();
119
- chunk.state = cstate;
120
- return chunk;
121
- });
122
- },
123
- enumerable: false,
124
- configurable: true
125
- });
126
- ChunksTailDetails.prototype.unshift = function (beforePos) {
127
- if (!this.chunks.length || (beforePos != null && this.from >= beforePos)) {
128
- return '';
129
- }
130
- var chunkShiftPos = beforePos != null ? beforePos - this.from : beforePos;
131
- var ci = 0;
132
- while (ci < this.chunks.length) {
133
- var chunk = this.chunks[ci];
134
- var shiftChar = chunk.unshift(chunkShiftPos);
135
- if (chunk.toString()) {
136
- // chunk still contains value
137
- // but not shifted - means no more available chars to shift
138
- if (!shiftChar) {
139
- break;
140
- }
141
- ++ci;
142
- }
143
- else {
144
- // clean if chunk has no value
145
- this.chunks.splice(ci, 1);
146
- }
147
- if (shiftChar) {
148
- return shiftChar;
149
- }
150
- }
151
- return '';
152
- };
153
- ChunksTailDetails.prototype.shift = function () {
154
- if (!this.chunks.length) {
155
- return '';
156
- }
157
- var ci = this.chunks.length - 1;
158
- while (ci >= 0) {
159
- var chunk = this.chunks[ci];
160
- var shiftChar = chunk.shift();
161
- if (chunk.toString()) {
162
- // chunk still contains value
163
- // but not shifted - means no more available chars to shift
164
- if (!shiftChar) {
165
- break;
166
- }
167
- --ci;
168
- }
169
- else {
170
- // clean if chunk has no value
171
- this.chunks.splice(ci, 1);
172
- }
173
- if (shiftChar) {
174
- return shiftChar;
175
- }
176
- }
177
- return '';
178
- };
179
- return ChunksTailDetails;
180
- }());
181
- export { ChunksTailDetails };
182
- //# sourceMappingURL=chunk-tail-details.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chunk-tail-details.js","sourceRoot":"","sources":["chunk-tail-details.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAG9E,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAW/C,SAAS,mBAAmB,CAAC,MAAkB;IAC7C,OAAO,OAAQ,MAA4B,CAAC,cAAc,KAAK,UAAU,CAAC;AAC5E,CAAC;AAMD;IAOE,2BAAY,MAA0B,EAAE,IAAgB;QAA5C,uBAAA,EAAA,WAA0B;QAAE,qBAAA,EAAA,QAAgB;QACtD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,C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,2DAA2D;gBAC3D,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,MAAM;gBACR,CAAC;gBACD,EAAE,EAAE,CAAC;YACP,CAAC;iBAAM,CAAC;gBACN,8BAA8B;gBAC9B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;YAC5B,CAAC;YAED,IAAI,SAAS,EAAE,CAAC;gBACd,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,iCAAK,GAAL;QACE,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;YACxB,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,IAAI,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC;QAChC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC;YACf,IAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;YAC9B,IAAM,SAAS,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;YAEhC,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAE,CAAC;gBACrB,6BAA6B;gBAC7B,2DAA2D;gBAC3D,IAAI,CAAC,SAAS,EAAE,CAAC;oBACf,MAAM;gBACR,CAAC;gBACD,EAAE,EAAE,CAAC;YACP,CAAC;iBAAM,CAAC;gBACN,8BAA8B;gBAC9B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;YAC5B,CAAC;YAED,IAAI,SAAS,EAAE,CAAC;gBACd,OAAO,SAAS,CAAC;YACnB,CAAC;QACH,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;IACH,wBAAC;AAAD,CAAC,AAzLD,IAyLC","sourcesContent":["import { ChangeDetails } from '../../core/change-details.js';\nimport { ContinuousTailDetails } from '../../core/continuous-tail-details.js';\n/* eslint-disable eqeqeq */\nimport type { TailDetails, AppendTail } from '../../core/tail-details.js';\nimport { isString } from '../../core/utils.js';\n\n/** Pattern-mask surface used by appendTo — duck-typed to avoid pattern ↔ chunk-tail cycle. */\ninterface PatternTailTarget extends AppendTail {\n displayValue: string;\n _stops: number[];\n _blocks: Array<{ appendTail(chunk: TailDetails): ChangeDetails }>;\n _mapPosToBlock(pos: number): { index: number } | undefined;\n _appendPlaceholder(toBlockIndex?: number): ChangeDetails;\n}\n\nfunction isPatternTailTarget(masked: AppendTail): masked is PatternTailTarget {\n return typeof (masked as PatternTailTarget)._mapPosToBlock === 'function';\n}\n\nexport type ChunksTailState = Pick<ChunksTailDetails, 'from' | 'stop' | 'blockIndex'> & {\n chunks: Array<TailDetails['state']>;\n};\n\nexport class ChunksTailDetails implements TailDetails {\n chunks!: TailDetails[];\n from!: number;\n stop?: number;\n /** */\n blockIndex?: number;\n\n constructor(chunks: TailDetails[] = [], from: number = 0) {\n this.chunks = chunks;\n this.from = from;\n }\n\n toString(): string {\n return this.chunks.map(String).join('');\n }\n\n extend(tailChunk: string | TailDetails): void {\n if (!String(tailChunk)) {\n return;\n }\n // eslint-disable-next-line no-param-reassign\n tailChunk = (isString(tailChunk) ? new ContinuousTailDetails(String(tailChunk)) : tailChunk) as TailDetails;\n\n const lastChunk = this.chunks[this.chunks.length - 1];\n const extendLast =\n lastChunk &&\n // if stops are same or tail has no stop\n (lastChunk.stop === tailChunk.stop || tailChunk.stop == null) &&\n // if tail chunk goes just after last chunk\n tailChunk.from === lastChunk.from + lastChunk.toString().length;\n\n if (tailChunk instanceof ContinuousTailDetails) {\n // check the ability to extend previous chunk\n if (extendLast) {\n // extend previous chunk\n lastChunk.extend(tailChunk.toString());\n } else {\n // append new chunk\n this.chunks.push(tailChunk);\n }\n } else if (tailChunk instanceof ChunksTailDetails) {\n if (tailChunk.stop == null) {\n // unwrap floating chunks to parent, keeping `from` pos\n let firstTailChunk;\n while (tailChunk.chunks.length && tailChunk.chunks[0].stop == null) {\n firstTailChunk = tailChunk.chunks.shift() as TailDetails; // not possible to be `undefined` because length was checked above\n firstTailChunk.from += tailChunk.from;\n this.extend(firstTailChunk);\n }\n }\n\n // if tail chunk still has value\n if (tailChunk.toString()) {\n // if chunks contains stops, then popup stop to container\n tailChunk.stop = tailChunk.blockIndex;\n this.chunks.push(tailChunk);\n }\n }\n }\n\n appendTo(masked: AppendTail): ChangeDetails {\n if (!isPatternTailTarget(masked)) {\n const tail = new ContinuousTailDetails(this.toString());\n return tail.appendTo(masked);\n }\n\n const details = new ChangeDetails();\n\n for (let ci = 0; ci < this.chunks.length; ++ci) {\n const chunk = this.chunks[ci];\n\n const lastBlockIter = masked._mapPosToBlock(masked.displayValue.length);\n const stop = chunk.stop;\n let chunkBlock;\n if (\n stop != null &&\n // if block not found or stop is behind lastBlock\n (!lastBlockIter || lastBlockIter.index <= stop)\n ) {\n if (\n chunk instanceof ChunksTailDetails ||\n // for continuous block also check if stop is exist\n masked._stops.indexOf(stop) >= 0\n ) {\n details.aggregate(masked._appendPlaceholder(stop));\n }\n chunkBlock = chunk instanceof ChunksTailDetails && masked._blocks[stop];\n }\n\n if (chunkBlock) {\n const tailDetails = chunkBlock.appendTail(chunk);\n details.aggregate(tailDetails);\n\n // get not inserted chars\n const remainChars = chunk.toString().slice(tailDetails.rawInserted.length);\n if (remainChars) {\n details.aggregate(masked.append(remainChars, { tail: true }));\n }\n } else {\n details.aggregate(masked.append(chunk.toString(), { tail: true }));\n }\n }\n\n return details;\n }\n\n get state(): ChunksTailState {\n return {\n chunks: this.chunks.map((c) => c.state),\n from: this.from,\n stop: this.stop,\n blockIndex: this.blockIndex,\n };\n }\n\n set state(state: ChunksTailState) {\n const { chunks, ...props } = state;\n Object.assign(this, props);\n this.chunks = chunks.map((cstate) => {\n const chunk = 'chunks' in cstate ? new ChunksTailDetails() : new ContinuousTailDetails();\n chunk.state = cstate;\n return chunk;\n });\n }\n\n unshift(beforePos?: number): string {\n if (!this.chunks.length || (beforePos != null && this.from >= beforePos)) {\n return '';\n }\n\n const chunkShiftPos = beforePos != null ? beforePos - this.from : beforePos;\n let ci = 0;\n while (ci < this.chunks.length) {\n const chunk = this.chunks[ci];\n const shiftChar = chunk.unshift(chunkShiftPos);\n\n if (chunk.toString()) {\n // chunk still contains value\n // but not shifted - means no more available chars to shift\n if (!shiftChar) {\n break;\n }\n ++ci;\n } else {\n // clean if chunk has no value\n this.chunks.splice(ci, 1);\n }\n\n if (shiftChar) {\n return shiftChar;\n }\n }\n\n return '';\n }\n\n shift(): string {\n if (!this.chunks.length) {\n return '';\n }\n\n let ci = this.chunks.length - 1;\n while (ci >= 0) {\n const chunk = this.chunks[ci];\n const shiftChar = chunk.shift();\n\n if (chunk.toString()) {\n // chunk still contains value\n // but not shifted - means no more available chars to shift\n if (!shiftChar) {\n break;\n }\n --ci;\n } else {\n // clean if chunk has no value\n this.chunks.splice(ci, 1);\n }\n\n if (shiftChar) {\n return shiftChar;\n }\n }\n\n return '';\n }\n}\n"]}
@@ -1,31 +0,0 @@
1
- import type { MaskedPattern } from '../pattern.js';
2
- import type { PatternBlock } from './block.js';
3
- interface PatternCursorState {
4
- offset: number;
5
- index: number;
6
- ok: boolean;
7
- }
8
- export declare class PatternCursor<Value> {
9
- masked: MaskedPattern<Value>;
10
- offset: number;
11
- index: number;
12
- ok: boolean;
13
- _log: PatternCursorState[];
14
- constructor(masked: MaskedPattern<Value>, pos: number);
15
- get block(): PatternBlock;
16
- get pos(): number;
17
- get state(): PatternCursorState;
18
- set state(s: PatternCursorState);
19
- pushState(): void;
20
- popState(): PatternCursorState | undefined;
21
- bindBlock(): void;
22
- _pushLeft(fn: () => boolean | undefined): boolean;
23
- _pushRight(fn: () => boolean | undefined): boolean;
24
- pushLeftBeforeFilled(): boolean;
25
- pushLeftBeforeInput(): boolean;
26
- pushLeftBeforeRequired(): boolean;
27
- pushRightBeforeFilled(): boolean;
28
- pushRightBeforeInput(): boolean;
29
- pushRightBeforeRequired(): boolean;
30
- }
31
- export {};
@@ -1,163 +0,0 @@
1
- import { DIRECTION } from '../../core/utils.js';
2
- var PatternCursor = /** @class */ (function () {
3
- function PatternCursor(masked, pos) {
4
- this.masked = masked;
5
- this._log = [];
6
- var _a = masked._mapPosToBlock(pos) ||
7
- (pos < 0
8
- ? // first
9
- { index: 0, offset: 0 }
10
- : // last
11
- { index: this.masked._blocks.length, offset: 0 }), offset = _a.offset, index = _a.index;
12
- this.offset = offset;
13
- this.index = index;
14
- this.ok = false;
15
- }
16
- Object.defineProperty(PatternCursor.prototype, "block", {
17
- get: function () {
18
- return this.masked._blocks[this.index];
19
- },
20
- enumerable: false,
21
- configurable: true
22
- });
23
- Object.defineProperty(PatternCursor.prototype, "pos", {
24
- get: function () {
25
- return this.masked._blockStartPos(this.index) + this.offset;
26
- },
27
- enumerable: false,
28
- configurable: true
29
- });
30
- Object.defineProperty(PatternCursor.prototype, "state", {
31
- get: function () {
32
- return { index: this.index, offset: this.offset, ok: this.ok };
33
- },
34
- set: function (s) {
35
- Object.assign(this, s);
36
- },
37
- enumerable: false,
38
- configurable: true
39
- });
40
- PatternCursor.prototype.pushState = function () {
41
- this._log.push(this.state);
42
- };
43
- PatternCursor.prototype.popState = function () {
44
- var s = this._log.pop();
45
- if (s) {
46
- this.state = s;
47
- }
48
- return s;
49
- };
50
- PatternCursor.prototype.bindBlock = function () {
51
- var _a;
52
- if (this.block) {
53
- return;
54
- }
55
- if (this.index < 0) {
56
- this.index = 0;
57
- this.offset = 0;
58
- }
59
- if (this.index >= this.masked._blocks.length) {
60
- this.index = this.masked._blocks.length - 1;
61
- var lastBlock = this.masked._blocks[this.masked._blocks.length - 1];
62
- this.offset = (_a = lastBlock === null || lastBlock === void 0 ? void 0 : lastBlock.displayValue.length) !== null && _a !== void 0 ? _a : 0;
63
- }
64
- };
65
- PatternCursor.prototype._pushLeft = function (fn) {
66
- var _a;
67
- this.pushState();
68
- for (this.bindBlock(); this.index >= 0; --this.index, this.offset = ((_a = this.block) === null || _a === void 0 ? void 0 : _a.displayValue.length) || 0) {
69
- if (fn()) {
70
- return (this.ok = true);
71
- }
72
- }
73
- return (this.ok = false);
74
- };
75
- PatternCursor.prototype._pushRight = function (fn) {
76
- this.pushState();
77
- for (this.bindBlock(); this.index < this.masked._blocks.length; ++this.index, this.offset = 0) {
78
- if (fn()) {
79
- return (this.ok = true);
80
- }
81
- }
82
- return (this.ok = false);
83
- };
84
- PatternCursor.prototype.pushLeftBeforeFilled = function () {
85
- var _this = this;
86
- return this._pushLeft(function () {
87
- if (_this.block.isFixed || !_this.block.value) {
88
- return;
89
- }
90
- _this.offset = _this.block.nearestInputPos(_this.offset, DIRECTION.FORCE_LEFT);
91
- if (_this.offset !== 0) {
92
- return true;
93
- }
94
- return;
95
- });
96
- };
97
- PatternCursor.prototype.pushLeftBeforeInput = function () {
98
- var _this = this;
99
- // cases:
100
- // filled input: 00|
101
- // optional empty input: 00[]|
102
- // nested block: XX<[]>|
103
- return this._pushLeft(function () {
104
- if (_this.block.isFixed) {
105
- return;
106
- }
107
- _this.offset = _this.block.nearestInputPos(_this.offset, DIRECTION.LEFT);
108
- return true;
109
- });
110
- };
111
- PatternCursor.prototype.pushLeftBeforeRequired = function () {
112
- var _this = this;
113
- return this._pushLeft(function () {
114
- if (_this.block.isFixed || (_this.block.isOptional && !_this.block.value)) {
115
- return;
116
- }
117
- _this.offset = _this.block.nearestInputPos(_this.offset, DIRECTION.LEFT);
118
- return true;
119
- });
120
- };
121
- PatternCursor.prototype.pushRightBeforeFilled = function () {
122
- var _this = this;
123
- return this._pushRight(function () {
124
- if (_this.block.isFixed || !_this.block.value) {
125
- return;
126
- }
127
- _this.offset = _this.block.nearestInputPos(_this.offset, DIRECTION.FORCE_RIGHT);
128
- if (_this.offset !== _this.block.value.length) {
129
- return true;
130
- }
131
- return;
132
- });
133
- };
134
- PatternCursor.prototype.pushRightBeforeInput = function () {
135
- var _this = this;
136
- return this._pushRight(function () {
137
- if (_this.block.isFixed) {
138
- return;
139
- }
140
- // const o = this.offset;
141
- _this.offset = _this.block.nearestInputPos(_this.offset, DIRECTION.NONE);
142
- // HACK cases like (STILL DOES NOT WORK FOR NESTED)
143
- // aa|X
144
- // aa<X|[]>X_ - this will not work
145
- // if (o && o === this.offset && this.block instanceof PatternInputDefinition) continue;
146
- return true;
147
- });
148
- };
149
- PatternCursor.prototype.pushRightBeforeRequired = function () {
150
- var _this = this;
151
- return this._pushRight(function () {
152
- if (_this.block.isFixed || (_this.block.isOptional && !_this.block.value)) {
153
- return;
154
- }
155
- // TODO check |[*]XX_
156
- _this.offset = _this.block.nearestInputPos(_this.offset, DIRECTION.NONE);
157
- return true;
158
- });
159
- };
160
- return PatternCursor;
161
- }());
162
- export { PatternCursor };
163
- //# sourceMappingURL=cursor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cursor.js","sourceRoot":"","sources":["cursor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAUhD;IAOE,uBAAY,MAA4B,EAAE,GAAW;QACnD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QAET,IAAA,KACJ,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC;YAC1B,CAAC,GAAG,GAAG,CAAC;gBACN,CAAC,CAAC,QAAQ;oBACR,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;gBACzB,CAAC,CAAC,OAAO;oBACP,EAAE,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,EAN/C,MAAM,YAAA,EAAE,KAAK,WAMkC,CAAC;QACxD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC;IAClB,CAAC;IAED,sBAAI,gCAAK;aAAT;YACE,OAAO,IAAI,CAAC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C;IACH,oBAAC;AAAD,CAAC,AAzKD,IAyKC","sourcesContent":["import { DIRECTION } from '../../core/utils.js';\nimport type { MaskedPattern } from '../pattern.js';\nimport type { PatternBlock } from './block.js';\n\ninterface PatternCursorState {\n offset: number;\n index: number;\n ok: boolean;\n}\n\nexport class PatternCursor<Value> {\n masked!: MaskedPattern<Value>;\n offset!: number;\n index!: number;\n ok!: boolean;\n _log!: PatternCursorState[];\n\n constructor(masked: MaskedPattern<Value>, pos: number) {\n this.masked = masked;\n this._log = [];\n\n const { offset, index } =\n masked._mapPosToBlock(pos) ||\n (pos < 0\n ? // first\n { index: 0, offset: 0 }\n : // last\n { index: this.masked._blocks.length, offset: 0 });\n this.offset = offset;\n this.index = index;\n this.ok = false;\n }\n\n get block(): PatternBlock {\n return this.masked._blocks[this.index];\n }\n\n get pos(): number {\n return this.masked._blockStartPos(this.index) + this.offset;\n }\n\n get state(): PatternCursorState {\n return { index: this.index, offset: this.offset, ok: this.ok };\n }\n\n set state(s: PatternCursorState) {\n Object.assign(this, s);\n }\n\n pushState(): void {\n this._log.push(this.state);\n }\n\n popState(): PatternCursorState | undefined {\n const s = this._log.pop();\n if (s) {\n this.state = s;\n }\n return s;\n }\n\n bindBlock(): void {\n if (this.block) {\n return;\n }\n if (this.index < 0) {\n this.index = 0;\n this.offset = 0;\n }\n if (this.index >= this.masked._blocks.length) {\n this.index = this.masked._blocks.length - 1;\n const lastBlock = this.masked._blocks[this.masked._blocks.length - 1];\n this.offset = lastBlock?.displayValue.length ?? 0;\n }\n }\n\n _pushLeft(fn: () => boolean | undefined): boolean {\n this.pushState();\n for (this.bindBlock(); this.index >= 0; --this.index, this.offset = this.block?.displayValue.length || 0) {\n if (fn()) {\n return (this.ok = true);\n }\n }\n\n return (this.ok = false);\n }\n\n _pushRight(fn: () => boolean | undefined): boolean {\n this.pushState();\n for (this.bindBlock(); this.index < this.masked._blocks.length; ++this.index, this.offset = 0) {\n if (fn()) {\n return (this.ok = true);\n }\n }\n\n return (this.ok = false);\n }\n\n pushLeftBeforeFilled(): boolean {\n return this._pushLeft(() => {\n if (this.block.isFixed || !this.block.value) {\n return;\n }\n\n this.offset = this.block.nearestInputPos(this.offset, DIRECTION.FORCE_LEFT);\n if (this.offset !== 0) {\n return true;\n }\n return;\n });\n }\n\n pushLeftBeforeInput(): boolean {\n // cases:\n // filled input: 00|\n // optional empty input: 00[]|\n // nested block: XX<[]>|\n return this._pushLeft(() => {\n if (this.block.isFixed) {\n return;\n }\n\n this.offset = this.block.nearestInputPos(this.offset, DIRECTION.LEFT);\n return true;\n });\n }\n\n pushLeftBeforeRequired(): boolean {\n return this._pushLeft(() => {\n if (this.block.isFixed || (this.block.isOptional && !this.block.value)) {\n return;\n }\n\n this.offset = this.block.nearestInputPos(this.offset, DIRECTION.LEFT);\n return true;\n });\n }\n\n pushRightBeforeFilled(): boolean {\n return this._pushRight(() => {\n if (this.block.isFixed || !this.block.value) {\n return;\n }\n\n this.offset = this.block.nearestInputPos(this.offset, DIRECTION.FORCE_RIGHT);\n if (this.offset !== this.block.value.length) {\n return true;\n }\n return;\n });\n }\n\n pushRightBeforeInput(): boolean {\n return this._pushRight(() => {\n if (this.block.isFixed) {\n return;\n }\n\n // const o = this.offset;\n this.offset = this.block.nearestInputPos(this.offset, DIRECTION.NONE);\n // HACK cases like (STILL DOES NOT WORK FOR NESTED)\n // aa|X\n // aa<X|[]>X_ - this will not work\n // if (o && o === this.offset && this.block instanceof PatternInputDefinition) continue;\n return true;\n });\n }\n\n pushRightBeforeRequired(): boolean {\n return this._pushRight(() => {\n if (this.block.isFixed || (this.block.isOptional && !this.block.value)) {\n return;\n }\n\n // TODO check |[*]XX_\n this.offset = this.block.nearestInputPos(this.offset, DIRECTION.NONE);\n return true;\n });\n }\n}\n"]}
@@ -1,42 +0,0 @@
1
- import { ChangeDetails } from '../../core/change-details.js';
2
- import { type TailDetails } from '../../core/tail-details.js';
3
- import { type Direction } from '../../core/utils.js';
4
- import { type ExtractFlags, type AppendFlags, type MaskedState } from '../base.js';
5
- import type { PatternBlock } from './block.js';
6
- export type PatternFixedDefinitionOptions = Pick<PatternFixedDefinition, 'char' | 'isUnmasking' | 'eager'>;
7
- export declare class PatternFixedDefinition implements PatternBlock {
8
- /** */
9
- _value: string;
10
- /** */
11
- char: string;
12
- /** */
13
- isUnmasking?: boolean;
14
- /** */
15
- eager: boolean | 'remove' | 'append' | undefined;
16
- /** */
17
- _isRawInput?: boolean;
18
- /** */
19
- isFixed: boolean;
20
- constructor(opts: PatternFixedDefinitionOptions);
21
- get value(): string;
22
- get unmaskedValue(): string;
23
- get rawInputValue(): string;
24
- get displayValue(): string;
25
- reset(): void;
26
- remove(fromPos?: number, toPos?: number): ChangeDetails;
27
- nearestInputPos(cursorPos: number, direction?: Direction): number;
28
- totalInputPositions(fromPos?: number, toPos?: number): number;
29
- extractInput(fromPos?: number, toPos?: number, flags?: ExtractFlags): string;
30
- get isComplete(): boolean;
31
- get isFilled(): boolean;
32
- _appendChar(ch: string, flags?: AppendFlags): ChangeDetails;
33
- _appendEager(): ChangeDetails;
34
- _appendPlaceholder(): ChangeDetails;
35
- extractTail(): TailDetails;
36
- appendTail(tail: string | TailDetails): ChangeDetails;
37
- append(str: string, flags?: AppendFlags, tail?: TailDetails): ChangeDetails;
38
- doCommit(): void;
39
- get state(): MaskedState;
40
- set state(state: MaskedState);
41
- pad(): ChangeDetails;
42
- }
@@ -1,158 +0,0 @@
1
- import { ChangeDetails } from '../../core/change-details.js';
2
- import { ContinuousTailDetails } from '../../core/continuous-tail-details.js';
3
- import { DIRECTION, isString } from '../../core/utils.js';
4
- var PatternFixedDefinition = /** @class */ (function () {
5
- function PatternFixedDefinition(opts) {
6
- Object.assign(this, opts);
7
- this._value = '';
8
- this.isFixed = true;
9
- }
10
- Object.defineProperty(PatternFixedDefinition.prototype, "value", {
11
- get: function () {
12
- return this._value;
13
- },
14
- enumerable: false,
15
- configurable: true
16
- });
17
- Object.defineProperty(PatternFixedDefinition.prototype, "unmaskedValue", {
18
- get: function () {
19
- return this.isUnmasking ? this.value : '';
20
- },
21
- enumerable: false,
22
- configurable: true
23
- });
24
- Object.defineProperty(PatternFixedDefinition.prototype, "rawInputValue", {
25
- get: function () {
26
- return this._isRawInput ? this.value : '';
27
- },
28
- enumerable: false,
29
- configurable: true
30
- });
31
- Object.defineProperty(PatternFixedDefinition.prototype, "displayValue", {
32
- get: function () {
33
- return this.value;
34
- },
35
- enumerable: false,
36
- configurable: true
37
- });
38
- PatternFixedDefinition.prototype.reset = function () {
39
- this._isRawInput = false;
40
- this._value = '';
41
- };
42
- PatternFixedDefinition.prototype.remove = function (fromPos, toPos) {
43
- if (fromPos === void 0) { fromPos = 0; }
44
- if (toPos === void 0) { toPos = this._value.length; }
45
- this._value = this._value.slice(0, fromPos) + this._value.slice(toPos);
46
- if (!this._value) {
47
- this._isRawInput = false;
48
- }
49
- return new ChangeDetails();
50
- };
51
- PatternFixedDefinition.prototype.nearestInputPos = function (cursorPos, direction) {
52
- if (direction === void 0) { direction = DIRECTION.NONE; }
53
- var minPos = 0;
54
- var maxPos = this._value.length;
55
- switch (direction) {
56
- case DIRECTION.LEFT:
57
- case DIRECTION.FORCE_LEFT:
58
- return minPos;
59
- case DIRECTION.NONE:
60
- case DIRECTION.RIGHT:
61
- case DIRECTION.FORCE_RIGHT:
62
- default:
63
- return maxPos;
64
- }
65
- };
66
- PatternFixedDefinition.prototype.totalInputPositions = function (fromPos, toPos) {
67
- if (fromPos === void 0) { fromPos = 0; }
68
- if (toPos === void 0) { toPos = this._value.length; }
69
- return this._isRawInput ? toPos - fromPos : 0;
70
- };
71
- PatternFixedDefinition.prototype.extractInput = function (fromPos, toPos, flags) {
72
- if (fromPos === void 0) { fromPos = 0; }
73
- if (toPos === void 0) { toPos = this._value.length; }
74
- if (flags === void 0) { flags = {}; }
75
- return (flags.raw && this._isRawInput && this._value.slice(fromPos, toPos)) || '';
76
- };
77
- Object.defineProperty(PatternFixedDefinition.prototype, "isComplete", {
78
- get: function () {
79
- return true;
80
- },
81
- enumerable: false,
82
- configurable: true
83
- });
84
- Object.defineProperty(PatternFixedDefinition.prototype, "isFilled", {
85
- get: function () {
86
- return Boolean(this._value);
87
- },
88
- enumerable: false,
89
- configurable: true
90
- });
91
- PatternFixedDefinition.prototype._appendChar = function (ch, flags) {
92
- if (flags === void 0) { flags = {}; }
93
- if (this.isFilled) {
94
- return new ChangeDetails();
95
- }
96
- var appendEager = this.eager === true || this.eager === 'append';
97
- var appended = this.char === ch;
98
- var isResolved = appended && (this.isUnmasking || flags.input || flags.raw) && (!flags.raw || !appendEager) && !flags.tail;
99
- var details = new ChangeDetails({
100
- inserted: this.char,
101
- rawInserted: isResolved ? this.char : '',
102
- });
103
- this._value = this.char;
104
- this._isRawInput = isResolved && flags.raw;
105
- return details;
106
- };
107
- PatternFixedDefinition.prototype._appendEager = function () {
108
- return this._appendChar(this.char, { tail: true });
109
- };
110
- PatternFixedDefinition.prototype._appendPlaceholder = function () {
111
- var details = new ChangeDetails();
112
- if (this.isFilled) {
113
- return details;
114
- }
115
- // eslint-disable-next-line no-multi-assign
116
- this._value = details.inserted = this.char;
117
- return details;
118
- };
119
- PatternFixedDefinition.prototype.extractTail = function () {
120
- return new ContinuousTailDetails('');
121
- };
122
- PatternFixedDefinition.prototype.appendTail = function (tail) {
123
- if (isString(tail)) {
124
- // eslint-disable-next-line no-param-reassign
125
- tail = new ContinuousTailDetails(String(tail));
126
- }
127
- return tail.appendTo(this);
128
- };
129
- PatternFixedDefinition.prototype.append = function (str, flags, tail) {
130
- var details = this._appendChar(str[0], flags);
131
- // eslint-disable-next-line eqeqeq
132
- if (tail != null) {
133
- details.tailShift += this.appendTail(tail).tailShift;
134
- }
135
- return details;
136
- };
137
- PatternFixedDefinition.prototype.doCommit = function () { };
138
- Object.defineProperty(PatternFixedDefinition.prototype, "state", {
139
- get: function () {
140
- return {
141
- _value: this._value,
142
- _rawInputValue: this.rawInputValue,
143
- };
144
- },
145
- set: function (state) {
146
- this._value = state._value;
147
- this._isRawInput = Boolean(state._rawInputValue);
148
- },
149
- enumerable: false,
150
- configurable: true
151
- });
152
- PatternFixedDefinition.prototype.pad = function () {
153
- return this._appendPlaceholder();
154
- };
155
- return PatternFixedDefinition;
156
- }());
157
- export { PatternFixedDefinition };
158
- //# sourceMappingURL=fixed-definition.js.map